@candriajs/git-neko-kit 0.7.6 → 0.8.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/README.md +46 -8
- package/dist/exports/axios.d.ts +3 -0
- package/dist/exports/dayjs.cjs +1 -0
- package/dist/exports/dayjs.d.ts +1 -0
- package/dist/exports/dayjs.mjs +1 -0
- package/dist/exports/lodash.cjs +1 -0
- package/dist/exports/lodash.d.ts +1 -0
- package/dist/exports/lodash.mjs +1 -0
- package/dist/exports/simple-git.cjs +1 -0
- package/dist/exports/simple-git.d.ts +2 -0
- package/dist/exports/simple-git.mjs +1 -0
- package/dist/index.cjs +6 -6
- package/dist/index.d.ts +941 -425
- package/dist/index.mjs +6 -6
- package/dist/root.cjs +1 -1
- package/dist/root.mjs +1 -1
- package/package.json +17 -1
package/dist/index.d.ts
CHANGED
@@ -1,9 +1,11 @@
|
|
1
|
+
import { RawAxiosResponseHeaders, AxiosResponseHeaders } from 'axios';
|
2
|
+
|
1
3
|
/** 代理地址类型 */
|
2
4
|
type ProxyUrlType = string;
|
3
5
|
/** 代理类型 */
|
4
6
|
type ProxyType = 'reverse' | 'common';
|
5
7
|
/** Git类型 */
|
6
|
-
type
|
8
|
+
type GitType = 'github' | 'gitee' | 'gitcode';
|
7
9
|
/**
|
8
10
|
* 通用代理配置
|
9
11
|
*/
|
@@ -64,7 +66,7 @@ type RequestTokenType = 'Bearer' | 'Basic';
|
|
64
66
|
interface RequestConfigType {
|
65
67
|
/** 请求地址 */
|
66
68
|
url?: string;
|
67
|
-
/**
|
69
|
+
/** 访问令牌令牌 */
|
68
70
|
token?: string | null;
|
69
71
|
/** 令牌类型,默认为 Bearer,即使用 Bearer 令牌 */
|
70
72
|
tokenType?: RequestTokenType;
|
@@ -77,7 +79,7 @@ type ResponseStatusCodeType = number;
|
|
77
79
|
/** 消息响应类型 */
|
78
80
|
type ResponseMsgType = string;
|
79
81
|
/** 响应头类型 */
|
80
|
-
type ResponseHeadersType =
|
82
|
+
type ResponseHeadersType = RawAxiosResponseHeaders | AxiosResponseHeaders;
|
81
83
|
/** 响应类型 */
|
82
84
|
interface ResponseType<D = any> {
|
83
85
|
success: ResponseSuccessType;
|
@@ -129,7 +131,7 @@ interface UserNameParamType {
|
|
129
131
|
/** 用户名 */
|
130
132
|
username: string;
|
131
133
|
}
|
132
|
-
interface
|
134
|
+
interface OrgNameParamType {
|
133
135
|
/** 组织登录名 */
|
134
136
|
org: string;
|
135
137
|
}
|
@@ -175,26 +177,47 @@ type RepoParamType = RepoBaseParamType | RepoUrlParamType;
|
|
175
177
|
/**
|
176
178
|
* 议题参数
|
177
179
|
*/
|
178
|
-
interface
|
180
|
+
interface IssueNumberParamType {
|
179
181
|
/** 问题id */
|
180
|
-
|
182
|
+
issue_number: number | string;
|
183
|
+
}
|
184
|
+
/**
|
185
|
+
* 拉取请求ID参数
|
186
|
+
*/
|
187
|
+
interface PullRequestNumberParamType {
|
188
|
+
/** 拉取请求id */
|
189
|
+
pr_number: number;
|
190
|
+
}
|
191
|
+
interface CommentIdParamType {
|
192
|
+
/** 评论id */
|
193
|
+
comment_id: number | string;
|
181
194
|
}
|
182
|
-
/** App
|
195
|
+
/** App 客户端类型 */
|
183
196
|
interface AppClientType {
|
184
197
|
/** App Client ID */
|
185
|
-
Client_ID
|
198
|
+
Client_ID?: string | null;
|
186
199
|
/** App Client Secret */
|
187
|
-
Client_Secret
|
200
|
+
Client_Secret?: string | null;
|
188
201
|
/** 私钥内容 */
|
189
|
-
Private_Key
|
202
|
+
Private_Key?: string | null;
|
190
203
|
/** WebHook Secret */
|
191
|
-
WebHook_Secret
|
192
|
-
|
193
|
-
|
204
|
+
WebHook_Secret?: string | null;
|
205
|
+
}
|
206
|
+
/** 访问令牌客户端类型 */
|
207
|
+
interface AccessTokenClentTYpe {
|
208
|
+
/** 访问令牌 */
|
209
|
+
access_token?: string | null;
|
194
210
|
}
|
195
211
|
|
212
|
+
/** GitHub客户端类型 */
|
213
|
+
type GitHubBaseClient = AppClientType | AccessTokenClentTYpe;
|
214
|
+
type GitHubClientType = GitHubBaseClient & {
|
215
|
+
/** 是否格式化 */
|
216
|
+
readonly format?: formatParamType['format'];
|
217
|
+
};
|
218
|
+
/** 客户端类型 */
|
196
219
|
interface ClientType {
|
197
|
-
github:
|
220
|
+
github: GitHubClientType;
|
198
221
|
}
|
199
222
|
|
200
223
|
/** 用户信息参数类型 */
|
@@ -232,19 +255,19 @@ interface UserInfoResponseType {
|
|
232
255
|
html_url: string;
|
233
256
|
/** 账号头像URL */
|
234
257
|
avatar_url: string;
|
235
|
-
/** 公司 */
|
236
|
-
company: string | null;
|
237
258
|
/** 个人简介 */
|
238
259
|
bio: string | null;
|
239
260
|
/** 博客URL */
|
240
261
|
blog: string | null;
|
262
|
+
/** 公开仓库数量 */
|
263
|
+
public_repos: number;
|
241
264
|
/** 粉丝数 */
|
242
265
|
followers: number;
|
243
266
|
/** 关注数 */
|
244
267
|
following: number;
|
245
268
|
}
|
246
269
|
|
247
|
-
type AppUser = Omit<UserInfoResponseType, '
|
270
|
+
type AppUser = Omit<UserInfoResponseType, 'bio' | 'blog' | 'followers' | 'following' | 'public_repos'>;
|
248
271
|
/**
|
249
272
|
* 定义 Base 应用所需的权限
|
250
273
|
*/
|
@@ -379,11 +402,9 @@ interface CheckTokenResponseType {
|
|
379
402
|
interface CommitInfoCommonParamType {
|
380
403
|
/** 提交SHA */
|
381
404
|
sha?: ShaParamType['sha'];
|
382
|
-
/** 是否格式化消息和日期 */
|
383
|
-
format?: formatParamType['format'];
|
384
405
|
}
|
385
406
|
/** Git提交用户信息 */
|
386
|
-
interface GitUser extends Omit<UserInfoResponseType, '
|
407
|
+
interface GitUser extends Omit<UserInfoResponseType, 'bio' | 'blog' | 'followers' | 'following' | 'public_repos'> {
|
387
408
|
/** 日期字符串 */
|
388
409
|
date: string;
|
389
410
|
}
|
@@ -486,14 +507,12 @@ type CommitListParamType = RepoParamType & {
|
|
486
507
|
per_page?: number;
|
487
508
|
/** 要获取的结果页码,默认: 1 */
|
488
509
|
page?: number;
|
489
|
-
/** 是否格式化消息和日期 */
|
490
|
-
format?: formatParamType['format'];
|
491
510
|
};
|
492
511
|
/** 提交列表响应类型 */
|
493
512
|
type CommitListResponseType = CommitInfoResponseType[];
|
494
513
|
|
495
514
|
/** 议题用户信息响应类型 */
|
496
|
-
type IssueUser = Omit<UserInfoResponseType, '
|
515
|
+
type IssueUser = Omit<UserInfoResponseType, 'bio' | 'blog' | 'followers' | 'following' | 'public_repos'>;
|
497
516
|
/** 议题标签类型 */
|
498
517
|
interface IssueLabelType {
|
499
518
|
/** 标签ID */
|
@@ -511,8 +530,8 @@ interface MilestoneType {
|
|
511
530
|
url: string;
|
512
531
|
/** 里程碑编号 */
|
513
532
|
number: number;
|
514
|
-
/** 里程碑状态: open/closed
|
515
|
-
state:
|
533
|
+
/** 里程碑状态: open/closed */
|
534
|
+
state: 'open' | 'closed';
|
516
535
|
/** 里程碑标题 */
|
517
536
|
title: string;
|
518
537
|
/** 里程碑描述 */
|
@@ -531,14 +550,11 @@ interface MilestoneType {
|
|
531
550
|
due_on: string | null;
|
532
551
|
}
|
533
552
|
/** 议题信息参数类型 */
|
534
|
-
type IssueInfoParamType = RepoBaseParamType &
|
535
|
-
/** 议题ID */
|
536
|
-
issue_number: IssueIdParamType['issue_id'];
|
537
|
-
};
|
553
|
+
type IssueInfoParamType = RepoBaseParamType & IssueNumberParamType;
|
538
554
|
/** 议题详情响应类型 */
|
539
555
|
interface IssueInfoResponseType {
|
540
556
|
/** 议题ID */
|
541
|
-
id:
|
557
|
+
id: IssueNumberParamType['issue_number'];
|
542
558
|
/** 议题HTML页面URL */
|
543
559
|
html_url: string;
|
544
560
|
/** 议题编号 */
|
@@ -674,7 +690,7 @@ type CreateIssueResponseType = IssueInfoResponseType;
|
|
674
690
|
/** 更新议题参数类型 */
|
675
691
|
interface UpdateIssueParamType extends Omit<CreteIssueParamType, 'title' | 'type'> {
|
676
692
|
/** 问题ID */
|
677
|
-
issue_number:
|
693
|
+
issue_number: IssueNumberParamType['issue_number'];
|
678
694
|
/** 问题的名称 */
|
679
695
|
title?: string | null;
|
680
696
|
/** 问题的内容 */
|
@@ -685,10 +701,7 @@ interface UpdateIssueParamType extends Omit<CreteIssueParamType, 'title' | 'type
|
|
685
701
|
/** 更新议题响应类型 */
|
686
702
|
type UpdateIssueResponseType = IssueInfoResponseType;
|
687
703
|
/** 打开议题参数类型 */
|
688
|
-
|
689
|
-
/** 议题ID */
|
690
|
-
issue_number: IssueIdParamType['issue_id'];
|
691
|
-
}
|
704
|
+
type OpenIssueParamType = RepoBaseParamType & IssueNumberParamType;
|
692
705
|
/** 打开议题响应类型 */
|
693
706
|
type OpenIssueResponseType = IssueInfoResponseType;
|
694
707
|
/** 关闭议题参数类型 */
|
@@ -698,7 +711,7 @@ type CloseIssueResponseType = IssueInfoResponseType;
|
|
698
711
|
/** 锁定议题参数类型 */
|
699
712
|
interface LockIssueParamType extends RepoBaseParamType {
|
700
713
|
/** 议题ID */
|
701
|
-
issue_number:
|
714
|
+
issue_number: IssueNumberParamType['issue_number'];
|
702
715
|
/**
|
703
716
|
* 锁定原因
|
704
717
|
* 可以是以下之一:
|
@@ -812,7 +825,7 @@ type IssueCommentListResponseType = IssueCommentInfoResponseType[];
|
|
812
825
|
/** 创建议题评论参数类型 */
|
813
826
|
interface CreteIssueCommentParamType extends RepoBaseParamType {
|
814
827
|
/** 议题ID */
|
815
|
-
issue_number:
|
828
|
+
issue_number: IssueNumberParamType['issue_number'];
|
816
829
|
/** 评论内容 */
|
817
830
|
body: string;
|
818
831
|
}
|
@@ -838,7 +851,7 @@ interface RemoveIssueCommentResponseType {
|
|
838
851
|
/** 获取子议题列表参数类型 */
|
839
852
|
interface SubIssueListParamType extends RepoBaseParamType {
|
840
853
|
/** 议题ID */
|
841
|
-
issue_number:
|
854
|
+
issue_number: IssueNumberParamType['issue_number'];
|
842
855
|
/**
|
843
856
|
* 每页结果数量
|
844
857
|
* @default 30
|
@@ -855,9 +868,9 @@ type SubIssueListResponseType = IssueInfoResponseType[];
|
|
855
868
|
/** 添加子议题参数类型 */
|
856
869
|
interface AddSubIssueParamType extends RepoBaseParamType {
|
857
870
|
/** 议题ID */
|
858
|
-
issue_number:
|
871
|
+
issue_number: IssueNumberParamType['issue_number'];
|
859
872
|
/** * 子议题ID */
|
860
|
-
sub_issue_id:
|
873
|
+
sub_issue_id: IssueNumberParamType['issue_number'];
|
861
874
|
/** * 是否替换父议题 */
|
862
875
|
replace_parent: boolean;
|
863
876
|
}
|
@@ -866,162 +879,34 @@ type AddSubIssueResponseType = IssueInfoResponseType;
|
|
866
879
|
/** 删除子议题参数类型 */
|
867
880
|
interface RemoveSubIssueParamType extends RepoBaseParamType {
|
868
881
|
/** 议题ID */
|
869
|
-
issue_number:
|
882
|
+
issue_number: IssueNumberParamType['issue_number'];
|
870
883
|
/** 子议题ID */
|
871
|
-
sub_issue_id:
|
884
|
+
sub_issue_id: IssueNumberParamType['issue_number'];
|
872
885
|
}
|
873
886
|
/** 删除子议题响应类型 */
|
874
887
|
type RemoveSubIssueResponseType = IssueInfoResponseType;
|
875
888
|
/** 重新确定子议题优先级参数类型 */
|
876
889
|
interface ReprioritizeSubIssueParamType extends RepoBaseParamType {
|
877
890
|
/** 议题ID */
|
878
|
-
issue_number:
|
891
|
+
issue_number: IssueNumberParamType['issue_number'];
|
879
892
|
/** 子议题ID */
|
880
|
-
sub_issue_id:
|
893
|
+
sub_issue_id: IssueNumberParamType['issue_number'];
|
881
894
|
/**
|
882
895
|
* 要优先排序的子问题的 ID(与 before_id 互斥,只能指定其中一个)
|
883
896
|
* 在此 ID 之后放置子问题
|
884
897
|
*/
|
885
|
-
after_id?:
|
898
|
+
after_id?: IssueNumberParamType['issue_number'];
|
886
899
|
/**
|
887
900
|
* 要优先排序的子问题的 ID(与 after_id 互斥,只能指定其中一个)
|
888
901
|
* 在此 ID 之前放置子问题
|
889
902
|
*/
|
890
|
-
before_id?:
|
903
|
+
before_id?: IssueNumberParamType['issue_number'];
|
891
904
|
}
|
892
905
|
/** 重新确定子议题优先级响应类型 */
|
893
906
|
type ReprioritizeSubIssueResponseType = IssueInfoResponseType;
|
894
907
|
|
895
|
-
/** 组织信息参数类型 */
|
896
|
-
interface OrgInfoParamType {
|
897
|
-
/** 组织名称 */
|
898
|
-
org: string;
|
899
|
-
}
|
900
|
-
/** 组织信息响应类型 */
|
901
|
-
interface OrgInfoResponseType {
|
902
|
-
/** 组织ID */
|
903
|
-
id: number;
|
904
|
-
/** 组织名称 */
|
905
|
-
login: string;
|
906
|
-
/** 组织描述 */
|
907
|
-
name: string;
|
908
|
-
/** 组织头像 */
|
909
|
-
avatar_url: string;
|
910
|
-
/** 组织描述 */
|
911
|
-
description: string;
|
912
|
-
/** 组织地址 */
|
913
|
-
html_url: string;
|
914
|
-
}
|
915
|
-
|
916
|
-
type ReleaseUser = Omit<UserInfoResponseType, 'company' | 'bio' | 'blog' | 'followers' | 'following'>;
|
917
|
-
/** 反应信息类型 */
|
918
|
-
interface ReactionInfoType {
|
919
|
-
/** 反应 API URL */
|
920
|
-
url: string;
|
921
|
-
/** 总反应数 */
|
922
|
-
total_count: number;
|
923
|
-
/** 👍 反应数 */
|
924
|
-
'+1': number;
|
925
|
-
/** 👎 反应数 */
|
926
|
-
'-1': number;
|
927
|
-
/** 😄 反应数 */
|
928
|
-
laugh: number;
|
929
|
-
/** 😕 反应数 */
|
930
|
-
confused: number;
|
931
|
-
/** ❤️ 反应数 */
|
932
|
-
heart: number;
|
933
|
-
/** 🎉 反应数 */
|
934
|
-
hooray: number;
|
935
|
-
/** 👀 反应数 */
|
936
|
-
eyes: number;
|
937
|
-
/** 🚀 反应数 */
|
938
|
-
rocket: number;
|
939
|
-
}
|
940
|
-
/** 发布资源类型 */
|
941
|
-
interface ReleaseAssetsType {
|
942
|
-
/** 资源 URL */
|
943
|
-
url: string;
|
944
|
-
/** 资源下载 URL */
|
945
|
-
browser_download_url: string;
|
946
|
-
}
|
947
|
-
/** 获取Release信息参数类型 */
|
948
|
-
type ReleaseInfoParamType = RepoBaseParamType & {
|
949
|
-
/** 发布ID */
|
950
|
-
release_id: number;
|
951
|
-
};
|
952
|
-
/** 获Release信息响应类型 */
|
953
|
-
interface ReleaseInfoResponseType {
|
954
|
-
/**
|
955
|
-
* 发布版本的 ID
|
956
|
-
* 该字段在gitcode平台同target_commitish一致
|
957
|
-
*/
|
958
|
-
id: number | string;
|
959
|
-
/** 标签名称 */
|
960
|
-
tag_name: string;
|
961
|
-
/** 目标分支或提交 */
|
962
|
-
target_commitish: string;
|
963
|
-
/** 发布版本名称 */
|
964
|
-
name: string | null;
|
965
|
-
/** 发布说明 */
|
966
|
-
body: string | null;
|
967
|
-
/** 是否为预发布版本 */
|
968
|
-
prerelease: boolean;
|
969
|
-
/** 发布者信息 */
|
970
|
-
author: ReleaseUser;
|
971
|
-
/** 发布资源列表 */
|
972
|
-
assets: Array<ReleaseAssetsType>;
|
973
|
-
/** 发布时间 */
|
974
|
-
created_at: string;
|
975
|
-
}
|
976
|
-
/** 获取最新Release参数类型 */
|
977
|
-
type ReleaseLatestParamTypeType = RepoBaseParamType;
|
978
|
-
/** 获取最新Release响应类型 */
|
979
|
-
type ReleaseLatestResponseType = ReleaseInfoResponseType;
|
980
|
-
/** 通过Tag获取Release信息参数类型 */
|
981
|
-
type ReleaseInfoByTagParamType = RepoBaseParamType & {
|
982
|
-
/** 标签名称 */
|
983
|
-
tag: string;
|
984
|
-
};
|
985
|
-
/** 通过Tag获取Release信息响应类型 */
|
986
|
-
type ReleaseInfoByTagResponseType = ReleaseInfoResponseType;
|
987
|
-
/** 获取Release列表参数类型 */
|
988
|
-
type ReleaseListParamType = RepoBaseParamType & {
|
989
|
-
/** 每页数量 */
|
990
|
-
per_page?: number;
|
991
|
-
/** 页码 */
|
992
|
-
page?: number;
|
993
|
-
};
|
994
|
-
/** 获取Release列表响应类型 */
|
995
|
-
type ReleaseListResponseType = Array<ReleaseInfoResponseType>;
|
996
|
-
/** 创建Release参数类型 */
|
997
|
-
type CreateReleaseParamType = RepoBaseParamType & {
|
998
|
-
/** 标签名称 */
|
999
|
-
tag_name: string;
|
1000
|
-
/** 目标分支或提交 */
|
1001
|
-
target_commitish: string;
|
1002
|
-
/** 发布版本名称 */
|
1003
|
-
name: string;
|
1004
|
-
/** 发布说明 */
|
1005
|
-
body: string;
|
1006
|
-
/** 是否为预发布版本 */
|
1007
|
-
prerelease: boolean;
|
1008
|
-
};
|
1009
|
-
/** 获取Release列表参数类型 */
|
1010
|
-
type CreateReleaseResponseType = ReleaseInfoResponseType;
|
1011
|
-
/** 更新Release参数类型 */
|
1012
|
-
type UpdateReleaseParamType = CreateReleaseParamType;
|
1013
|
-
/** 更新Release响应类型 */
|
1014
|
-
type UpdateReleaseResponseType = ReleaseInfoResponseType;
|
1015
|
-
/** 删除Release参数类型 */
|
1016
|
-
type DeleteReleaseParamType = ReleaseInfoParamType;
|
1017
|
-
/** 删除Release响应类型 */
|
1018
|
-
interface DeleteReleaseResponseType {
|
1019
|
-
/** 删除信息 */
|
1020
|
-
info: string;
|
1021
|
-
}
|
1022
|
-
|
1023
908
|
/** 仓库所有者参数类型 */
|
1024
|
-
type RepoUser = Omit<UserInfoResponseType, 'followers' | 'following' | 'blog' | 'bio' | '
|
909
|
+
type RepoUser = Omit<UserInfoResponseType, 'followers' | 'following' | 'blog' | 'bio' | 'public_repos'>;
|
1025
910
|
/** 仓库列表参数类型 */
|
1026
911
|
interface RepoListBaseParamType {
|
1027
912
|
/** 排序方式,可选created, updated, pushed, full_name, 默认为 full_name */
|
@@ -1040,112 +925,9 @@ interface UserByTokenRepoListParamType extends RepoListBaseParamType {
|
|
1040
925
|
affiliation?: 'owner' | 'collaborator' | 'organization_member';
|
1041
926
|
/** 类型,可选all, owner, member, 默认为 all */
|
1042
927
|
type?: 'all' | 'owner' | 'member';
|
1043
|
-
/** 是否格式化日期 */
|
1044
|
-
format?: formatParamType['format'];
|
1045
928
|
}
|
1046
929
|
/** 仓库信息请求参数 */
|
1047
|
-
type RepoInfoParamType = RepoBaseParamType
|
1048
|
-
/** 是否格式化日期 */
|
1049
|
-
format?: formatParamType['format'];
|
1050
|
-
};
|
1051
|
-
/** 许可证信息 */
|
1052
|
-
interface License {
|
1053
|
-
/** * 许可证的键,例如 'mit' */
|
1054
|
-
key: string;
|
1055
|
-
/** * 许可证的名称,例如 'MIT License' */
|
1056
|
-
name: string;
|
1057
|
-
/** * 许可证的 SPDX ID,例如 'MIT' */
|
1058
|
-
spdx_id: string;
|
1059
|
-
/** * 许可证的 URL 地址 */
|
1060
|
-
url: string | null;
|
1061
|
-
/** * 许可证的 HTML URL */
|
1062
|
-
html_url?: string;
|
1063
|
-
/** * 许可证的节点 ID */
|
1064
|
-
node_id: string;
|
1065
|
-
}
|
1066
|
-
/** 仓库行为准则 */
|
1067
|
-
interface CodeOfConduct {
|
1068
|
-
/** * 行为准则的键 */
|
1069
|
-
key: string;
|
1070
|
-
/** * 行为准则的名称 */
|
1071
|
-
name: string;
|
1072
|
-
/** * 行为准则的 URL */
|
1073
|
-
url: string;
|
1074
|
-
/** * 行为准则的主体 */
|
1075
|
-
body?: string;
|
1076
|
-
/** * 行为准则的 HTML URL */
|
1077
|
-
html_url: string | null;
|
1078
|
-
}
|
1079
|
-
/** 仓库高级安全状态 */
|
1080
|
-
interface SecurityAnalysisAdvancedSecurity {
|
1081
|
-
/** * 高级安全状态 */
|
1082
|
-
status: string;
|
1083
|
-
}
|
1084
|
-
/** Dependabot 安全更新状态 */
|
1085
|
-
interface SecurityAnalysisDependabotSecurityUpdates {
|
1086
|
-
/** * Dependabot 安全更新状态 */
|
1087
|
-
status: string;
|
1088
|
-
}
|
1089
|
-
/** 秘钥扫描状态 */
|
1090
|
-
interface SecurityAnalysisSecretScanning {
|
1091
|
-
/** * 秘钥扫描状态 */
|
1092
|
-
status: string;
|
1093
|
-
}
|
1094
|
-
/** 秘钥扫描推送保护状态 */
|
1095
|
-
interface SecurityAnalysisSecretScanningPushProtection {
|
1096
|
-
/** * 秘钥扫描推送保护状态 */
|
1097
|
-
status: string;
|
1098
|
-
}
|
1099
|
-
/** 仓库安全和分析设置 */
|
1100
|
-
interface SecurityAndAnalysis {
|
1101
|
-
/** * 高级安全设置 */
|
1102
|
-
advanced_security?: SecurityAnalysisAdvancedSecurity;
|
1103
|
-
/** * Dependabot 安全更新设置 */
|
1104
|
-
dependabot_security_updates?: SecurityAnalysisDependabotSecurityUpdates;
|
1105
|
-
/** * 秘钥扫描设置 */
|
1106
|
-
secret_scanning?: SecurityAnalysisSecretScanning;
|
1107
|
-
/** * 秘钥扫描推送保护设置 */
|
1108
|
-
secret_scanning_push_protection?: SecurityAnalysisSecretScanningPushProtection;
|
1109
|
-
}
|
1110
|
-
/** 仓库的权限信息 */
|
1111
|
-
interface Permissions {
|
1112
|
-
/** * 管理员权限 */
|
1113
|
-
admin: boolean;
|
1114
|
-
/** * 推送权限 */
|
1115
|
-
push: boolean;
|
1116
|
-
/** * 拉取权限 */
|
1117
|
-
pull: boolean;
|
1118
|
-
/** * 维护权限 */
|
1119
|
-
maintain?: boolean;
|
1120
|
-
/** * 分类权限 */
|
1121
|
-
triage?: boolean;
|
1122
|
-
}
|
1123
|
-
/**
|
1124
|
-
* 合并提交标题的格式选项
|
1125
|
-
* - PR_TITLE: 使用 Pull Request 标题作为合并提交标题
|
1126
|
-
* - MERGE_MESSAGE: 使用默认的合并消息格式作为标题
|
1127
|
-
*/
|
1128
|
-
type MergeCommitTitle = 'PR_TITLE' | 'MERGE_MESSAGE';
|
1129
|
-
/**
|
1130
|
-
* 合并提交消息的格式选项
|
1131
|
-
* - PR_BODY: 使用 Pull Request 正文作为合并提交消息
|
1132
|
-
* - PR_TITLE: 使用 Pull Request 标题作为合并提交消息
|
1133
|
-
* - BLANK: 留空合并提交消息
|
1134
|
-
*/
|
1135
|
-
type MergeCommitMessage = 'PR_BODY' | 'PR_TITLE' | 'BLANK';
|
1136
|
-
/**
|
1137
|
-
* Squash 合并提交标题的格式选项
|
1138
|
-
* - PR_TITLE: 使用 Pull Request 标题作为 Squash 合并提交标题
|
1139
|
-
* - COMMIT_OR_PR_TITLE: 使用提交信息或 Pull Request 标题作为标题
|
1140
|
-
*/
|
1141
|
-
type SquashMergeCommitTitle = 'PR_TITLE' | 'COMMIT_OR_PR_TITLE';
|
1142
|
-
/**
|
1143
|
-
* Squash 合并提交消息的格式选项
|
1144
|
-
* - PR_BODY: 使用 Pull Request 正文作为 Squash 合并提交消息
|
1145
|
-
* - COMMIT_MESSAGES: 使用所有提交信息作为 Squash 合并提交消息
|
1146
|
-
* - BLANK: 留空 Squash 合并提交消息
|
1147
|
-
*/
|
1148
|
-
type SquashMergeCommitMessage = 'PR_BODY' | 'COMMIT_MESSAGES' | 'BLANK';
|
930
|
+
type RepoInfoParamType = RepoBaseParamType;
|
1149
931
|
/** * 仓库信息 */
|
1150
932
|
interface RepoInfoResponseType {
|
1151
933
|
/** * 仓库的唯一 ID */
|
@@ -1197,8 +979,6 @@ interface OrgRepoListParmType extends RepoListBaseParamType {
|
|
1197
979
|
org: string;
|
1198
980
|
/** 类型,可选all, public, private, forks, sources, member, 默认为 all */
|
1199
981
|
type?: 'all' | 'public' | 'private' | 'forks' | 'sources' | 'member';
|
1200
|
-
/** 是否格式化日期 */
|
1201
|
-
format?: formatParamType['format'];
|
1202
982
|
}
|
1203
983
|
/**
|
1204
984
|
* 组织仓库列表响应类型
|
@@ -1206,7 +986,7 @@ interface OrgRepoListParmType extends RepoListBaseParamType {
|
|
1206
986
|
*/
|
1207
987
|
type OrgRepoListResponseType = RepoInfoResponseType[];
|
1208
988
|
/** 创建组织仓库请求参数 */
|
1209
|
-
interface OrgRepoCreateParamType extends
|
989
|
+
interface OrgRepoCreateParamType extends OrgNameParamType {
|
1210
990
|
/** 仓库名称 */
|
1211
991
|
name: string;
|
1212
992
|
/** 仓库描述 */
|
@@ -1217,57 +997,23 @@ interface OrgRepoCreateParamType extends RepoOwnerParamType {
|
|
1217
997
|
visibility?: 'public' | 'private';
|
1218
998
|
/** 是否开启议题issue */
|
1219
999
|
has_issues?: boolean;
|
1220
|
-
/** 是否开启项目project */
|
1221
|
-
has_projects?: boolean;
|
1222
1000
|
/** 是否开启wiki */
|
1223
1001
|
has_wiki?: boolean;
|
1224
|
-
/** 是否开启下载 */
|
1225
|
-
has_downloads?: boolean;
|
1226
|
-
/** 是否设置为模板仓库 */
|
1227
|
-
is_template?: boolean;
|
1228
|
-
/** 仓库团队id, 这仅在组织中创建仓库时有效。 */
|
1229
|
-
team_id?: number;
|
1230
1002
|
/** 仓库自动初始化 */
|
1231
1003
|
auto_init?: boolean;
|
1232
|
-
/** 仓库的gitignore模板 */
|
1233
|
-
gitignore_template?: string;
|
1234
|
-
/** 仓库的license模板 */
|
1235
|
-
license_template?: string;
|
1236
|
-
/** 是否允许合并提交 */
|
1237
|
-
allow_squash_merge?: boolean;
|
1238
|
-
/** 是否允许变基合并提交 */
|
1239
|
-
allow_merge_commit?: boolean;
|
1240
|
-
/** 是否允许重新基础合并提交 */
|
1241
|
-
allow_rebase_merge?: boolean;
|
1242
|
-
/** 是否允许自动合并 */
|
1243
|
-
allow_auto_merge?: boolean;
|
1244
|
-
/** 是否删除分支后合并 */
|
1245
|
-
delete_branch_on_merge?: boolean;
|
1246
|
-
/** 合并提交标题格式 */
|
1247
|
-
squash_merge_commit_title?: 'PR_TITLE' | 'COMMIT_OR_PR_TITLE';
|
1248
|
-
/** 合并提交消息格式 */
|
1249
|
-
squash_merge_commit_message?: 'PR_BODY' | 'COMMIT_MESSAGES' | 'BLANK';
|
1250
|
-
/** 合并提交标题格式 */
|
1251
|
-
merge_commit_title?: 'PR_TITLE' | 'MERGE_MESSAGE';
|
1252
|
-
/** 合并提交消息格式 */
|
1253
|
-
merge_commit_message?: 'PR_BODY' | 'COMMIT_MESSAGES' | 'BLANK';
|
1254
|
-
/** 新存储库的自定义属性 */
|
1255
|
-
custom_properties?: {
|
1256
|
-
[key: string]: string;
|
1257
|
-
};
|
1258
|
-
/** 是否格式化日期 */
|
1259
|
-
format?: formatParamType['format'];
|
1260
1004
|
}
|
1261
1005
|
/** 创建组织仓库响应类型 */
|
1262
1006
|
type OrgRepoCreateResponseType = RepoInfoResponseType;
|
1007
|
+
/** 创建用户仓库参数类型 */
|
1008
|
+
type UserRepoCreateParamType = Omit<OrgRepoCreateParamType, 'org'> & RepoOwnerParamType;
|
1009
|
+
/** 创建用户仓库响应类型 */
|
1010
|
+
type UserRepoCreateResponseType = RepoInfoResponseType;
|
1263
1011
|
/** 用户仓库列表参数类型 */
|
1264
1012
|
interface UserRepoListParamType extends RepoListBaseParamType {
|
1265
1013
|
/** 用户名 */
|
1266
1014
|
username: string;
|
1267
1015
|
/** 类型,可选all, owner, member, 默认为 all */
|
1268
1016
|
type?: 'all' | 'owner' | 'member';
|
1269
|
-
/** 是否格式化日期 */
|
1270
|
-
format?: formatParamType['format'];
|
1271
1017
|
}
|
1272
1018
|
/** 用户仓库列表类型 */
|
1273
1019
|
type UserRepoListType = Array<RepoInfoResponseType & {
|
@@ -1292,22 +1038,18 @@ interface RepoLanguagesListResponseType {
|
|
1292
1038
|
/** 仓库的语言统计信息列表 */
|
1293
1039
|
languages: LanguageInfo[];
|
1294
1040
|
}
|
1295
|
-
/**
|
1296
|
-
|
1297
|
-
|
1298
|
-
|
1299
|
-
|
1300
|
-
|
1301
|
-
/**
|
1302
|
-
|
1303
|
-
|
1304
|
-
|
1305
|
-
}
|
1041
|
+
/** 获取仓库可见性参数类型 */
|
1042
|
+
type GetRepoVisibilityParamType = RepoBaseParamType;
|
1043
|
+
/** 获取仓库可见性响应类型 */
|
1044
|
+
type GetRepoVisibilityResponseType = RepoInfoResponseType['visibility'];
|
1045
|
+
/** 获取仓库默认分支参数类型 */
|
1046
|
+
type GetRepoDefaultBranchParamType = RepoBaseParamType;
|
1047
|
+
/** 获取仓库默认分支响应类型 */
|
1048
|
+
type GetRepoDefaultBranchResponseType = RepoInfoResponseType['default_branch'];
|
1049
|
+
/** 获取仓库主要语言参数类型 */
|
1050
|
+
type GetRepoMainLanguageParamType = RepoBaseParamType;
|
1306
1051
|
/** 仓库主要语言响应类型 */
|
1307
|
-
|
1308
|
-
/** * 仓库的主要语言 */
|
1309
|
-
language: RepoInfoResponseType['language'];
|
1310
|
-
}
|
1052
|
+
type GetRepoMainLanguageResponseType = RepoInfoResponseType['language'];
|
1311
1053
|
/** 协作者参数类型 */
|
1312
1054
|
type CollaboratorParamType = RepoInfoParamType & UserNameParamType & {
|
1313
1055
|
/**
|
@@ -1319,8 +1061,6 @@ type CollaboratorParamType = RepoInfoParamType & UserNameParamType & {
|
|
1319
1061
|
* admin - 拥有仓库的完全控制权,包括更改设置和删除仓库。
|
1320
1062
|
*/
|
1321
1063
|
permission?: string;
|
1322
|
-
/** 是否格式化日期 */
|
1323
|
-
format?: formatParamType['format'];
|
1324
1064
|
};
|
1325
1065
|
/** 邀请协作者响应类型 */
|
1326
1066
|
interface AddCollaboratorResponseType {
|
@@ -1330,8 +1070,6 @@ interface AddCollaboratorResponseType {
|
|
1330
1070
|
login: string;
|
1331
1071
|
/** 被邀请者的别名 */
|
1332
1072
|
name: string | null;
|
1333
|
-
/** 被邀请者的头像URL */
|
1334
|
-
avatar_url: string;
|
1335
1073
|
/** 仓库的地址 */
|
1336
1074
|
html_url: string;
|
1337
1075
|
/** 被邀请者的权限 */
|
@@ -1388,13 +1126,447 @@ interface CollaboratorInfoResponseType {
|
|
1388
1126
|
/** 角色名称 */
|
1389
1127
|
role_name: string;
|
1390
1128
|
}
|
1391
|
-
/** 协作者列表响应类型 */
|
1392
|
-
type CollaboratorListResponseType = CollaboratorInfoResponseType[];
|
1393
|
-
/** 移除协作者参数类型 */
|
1394
|
-
type RemoveCollaboratorParamType = RepoBaseParamType & UserNameParamType;
|
1395
|
-
/** 移除协作者响应类型 */
|
1396
|
-
interface RemoveCollaboratorResponseType {
|
1397
|
-
/** 状态信息 */
|
1129
|
+
/** 协作者列表响应类型 */
|
1130
|
+
type CollaboratorListResponseType = CollaboratorInfoResponseType[];
|
1131
|
+
/** 移除协作者参数类型 */
|
1132
|
+
type RemoveCollaboratorParamType = RepoBaseParamType & UserNameParamType;
|
1133
|
+
/** 移除协作者响应类型 */
|
1134
|
+
interface RemoveCollaboratorResponseType {
|
1135
|
+
/** 状态信息 */
|
1136
|
+
info: string;
|
1137
|
+
}
|
1138
|
+
|
1139
|
+
/** 组织信息参数类型 */
|
1140
|
+
type OrgInfoParamType = OrgNameParamType;
|
1141
|
+
/** 组织信息响应类型 */
|
1142
|
+
interface OrgInfoResponseType {
|
1143
|
+
/** 组织ID */
|
1144
|
+
id: number;
|
1145
|
+
/** 组织名称 */
|
1146
|
+
login: string;
|
1147
|
+
/** 组织描述 */
|
1148
|
+
name: string;
|
1149
|
+
/** 组织头像 */
|
1150
|
+
avatar_url: string;
|
1151
|
+
/** 组织描述 */
|
1152
|
+
description: string;
|
1153
|
+
/** 组织地址 */
|
1154
|
+
html_url: string;
|
1155
|
+
}
|
1156
|
+
/** 添加组织成员参数类型 */
|
1157
|
+
interface AddMemberParamType extends OrgNameParamType, UserNameParamType {
|
1158
|
+
/**
|
1159
|
+
* 角色
|
1160
|
+
* @default 'member'
|
1161
|
+
*/
|
1162
|
+
role?: 'admin' | 'member';
|
1163
|
+
}
|
1164
|
+
/** 添加组织成员响应类型 */
|
1165
|
+
interface AddMemberResponseType extends Omit<AddCollaboratorResponseType, 'permissions' | 'html_url'> {
|
1166
|
+
/** 组织地址 */
|
1167
|
+
html_url: string;
|
1168
|
+
/** 角色 */
|
1169
|
+
role: 'admin' | 'member';
|
1170
|
+
}
|
1171
|
+
|
1172
|
+
type PrUser = Pick<UserInfoResponseType, 'id' | 'login' | 'name' | 'avatar_url' | 'html_url'>;
|
1173
|
+
type PrRepo = Pick<RepoInfoResponseType, 'id' | 'owner' | 'name' | 'full_name'>;
|
1174
|
+
/** 拉取请求信息参数类型 */
|
1175
|
+
type PullRequestInfoParamType = PullRequestNumberParamType & RepoBaseParamType;
|
1176
|
+
/** 拉取请求信息响应类型 */
|
1177
|
+
interface PullRequestInfoResponseType {
|
1178
|
+
/** 拉取请求的id */
|
1179
|
+
id: number;
|
1180
|
+
/** 拉取请求的URL */
|
1181
|
+
html_url: string;
|
1182
|
+
/** 拉取请求的编号 */
|
1183
|
+
number: number;
|
1184
|
+
/** 拉取请求的状态 (open/closed) */
|
1185
|
+
state: 'open' | 'closed';
|
1186
|
+
/** 是否被锁定 */
|
1187
|
+
locked: boolean;
|
1188
|
+
/** 拉取请求的标题 */
|
1189
|
+
title: string;
|
1190
|
+
/** 拉取请求的描述 */
|
1191
|
+
body: string | null;
|
1192
|
+
/** 是否为草稿PR */
|
1193
|
+
draft: boolean;
|
1194
|
+
/** 创建时间 */
|
1195
|
+
created_at: string;
|
1196
|
+
/** 更新时间 */
|
1197
|
+
updated_at: string;
|
1198
|
+
/** 关闭时间 */
|
1199
|
+
closed_at: string | null;
|
1200
|
+
/** 合并时间 */
|
1201
|
+
merged_at: string | null;
|
1202
|
+
/** PR作者 */
|
1203
|
+
user: PrUser;
|
1204
|
+
base: {
|
1205
|
+
label: string;
|
1206
|
+
ref: string;
|
1207
|
+
sha: string;
|
1208
|
+
user: PrUser;
|
1209
|
+
repo: PrRepo;
|
1210
|
+
};
|
1211
|
+
/** PR的源分支信息 */
|
1212
|
+
head: {
|
1213
|
+
label: string;
|
1214
|
+
ref: string;
|
1215
|
+
sha: string;
|
1216
|
+
user: PrUser;
|
1217
|
+
repo: PrRepo;
|
1218
|
+
};
|
1219
|
+
/** 指派人 */
|
1220
|
+
assignee: PrUser | null;
|
1221
|
+
/** 指派人列表 */
|
1222
|
+
assignees: Array<PrUser> | null;
|
1223
|
+
/** 里程碑 */
|
1224
|
+
milestone: MilestoneType | null;
|
1225
|
+
/** 标签列表 */
|
1226
|
+
labels: Array<IssueLabelType>;
|
1227
|
+
/** 提交数量 */
|
1228
|
+
commits: number;
|
1229
|
+
/** 新增行数 */
|
1230
|
+
additions: number;
|
1231
|
+
/** 删除行数 */
|
1232
|
+
deletions: number;
|
1233
|
+
/** 更改的文件数 */
|
1234
|
+
changed_files: number;
|
1235
|
+
}
|
1236
|
+
/** 拉取请求列表参数类型 */
|
1237
|
+
interface PullRequestListParamType extends RepoBaseParamType {
|
1238
|
+
/**
|
1239
|
+
* 拉取请求状态
|
1240
|
+
* @default "open"
|
1241
|
+
* - open: 打开的拉取请求
|
1242
|
+
* - closed: 已关闭的拉取请求
|
1243
|
+
* - all: 所有拉取请求
|
1244
|
+
*/
|
1245
|
+
state?: 'open' | 'closed' | 'all';
|
1246
|
+
/**
|
1247
|
+
* 基础分支名称
|
1248
|
+
* 用于筛选指定目标分支的拉取请求
|
1249
|
+
* @example "main"
|
1250
|
+
*/
|
1251
|
+
base?: string;
|
1252
|
+
/**
|
1253
|
+
* 排序依据
|
1254
|
+
* @default "created"
|
1255
|
+
* - created: 按创建时间排序
|
1256
|
+
* - updated: 按更新时间排序
|
1257
|
+
*/
|
1258
|
+
sort?: 'created' | 'updated';
|
1259
|
+
/**
|
1260
|
+
* 排序方向
|
1261
|
+
* @default "desc"
|
1262
|
+
* - asc: 升序
|
1263
|
+
* - desc: 降序
|
1264
|
+
*/
|
1265
|
+
direction?: 'asc' | 'desc';
|
1266
|
+
/**
|
1267
|
+
* 每页结果数量
|
1268
|
+
* @default "30"
|
1269
|
+
* @remarks 取值范围:1-100
|
1270
|
+
*/
|
1271
|
+
per_page?: string;
|
1272
|
+
/**
|
1273
|
+
* 页码
|
1274
|
+
* @default "1"
|
1275
|
+
* @remarks 必须大于等于1
|
1276
|
+
*/
|
1277
|
+
page?: string;
|
1278
|
+
}
|
1279
|
+
/** 拉取请求列表响应类型 */
|
1280
|
+
type PullRequestListResponseType = Array<PullRequestInfoResponseType>;
|
1281
|
+
/** 使用issue填充拉取提交标题与内容 */
|
1282
|
+
type WithIssue = {
|
1283
|
+
/** 拉取请求标题 */
|
1284
|
+
title?: never;
|
1285
|
+
/** 拉取请求描述 */
|
1286
|
+
body?: never;
|
1287
|
+
/**
|
1288
|
+
* 关联的议题
|
1289
|
+
* Pull Request的标题和内容可以根据指定的Issue Id自动填充
|
1290
|
+
*/
|
1291
|
+
issue: string | number;
|
1292
|
+
};
|
1293
|
+
/** 不使用issue填充拉取提交标题与内容 */
|
1294
|
+
type WithoutIssue = {
|
1295
|
+
/** 拉取请求标题 */
|
1296
|
+
title: string;
|
1297
|
+
/** 拉取请求描述 */
|
1298
|
+
body?: string;
|
1299
|
+
/**
|
1300
|
+
* 关联的议题
|
1301
|
+
* Pull Request的标题和内容可以根据指定的Issue Id自动填充
|
1302
|
+
*/
|
1303
|
+
issue?: never;
|
1304
|
+
};
|
1305
|
+
/** 创建拉取提交参数类型 */
|
1306
|
+
type CreatePullRequestParamType = RepoBaseParamType & (WithIssue | WithoutIssue) & {
|
1307
|
+
/** 拉取请求源分支 */
|
1308
|
+
head: string;
|
1309
|
+
/**
|
1310
|
+
* 拉取请求源仓库
|
1311
|
+
* 。如果两个存储库都由同一组织拥有,则跨存储库拉取请求需要此字段
|
1312
|
+
* */
|
1313
|
+
head_repo?: string;
|
1314
|
+
/** 拉取请求目标分支 */
|
1315
|
+
base: string;
|
1316
|
+
/** 是否为草稿 */
|
1317
|
+
draft?: boolean;
|
1318
|
+
};
|
1319
|
+
/** 创建拉取请求响应类型 */
|
1320
|
+
type CreatePullRequestResponseType = PullRequestInfoResponseType;
|
1321
|
+
/** 更新拉取请求参数类型 */
|
1322
|
+
interface UpdatePullRequestParamType extends RepoBaseParamType, PullRequestNumberParamType {
|
1323
|
+
/** 拉取请求标题 */
|
1324
|
+
title?: string;
|
1325
|
+
/** 拉取请求内容 */
|
1326
|
+
body?: string;
|
1327
|
+
/** 拉取请求状态 */
|
1328
|
+
state?: 'open' | 'closed';
|
1329
|
+
}
|
1330
|
+
/** 更新拉取请求响应类型 */
|
1331
|
+
type UpdatePullRequestResponseType = PullRequestInfoResponseType;
|
1332
|
+
/**
|
1333
|
+
* 合并拉取请求方式类型
|
1334
|
+
* merge: 合并提交
|
1335
|
+
* squash: 压缩提交
|
1336
|
+
* rebase: 变基提交
|
1337
|
+
*/
|
1338
|
+
type MergeMethodType = 'merge' | 'squash' | 'rebase';
|
1339
|
+
/** 合并拉取请求参数类型 */
|
1340
|
+
interface MergePullRequestParamType extends RepoBaseParamType, PullRequestNumberParamType {
|
1341
|
+
/** 拉取请求合并提交信息 */
|
1342
|
+
commit_title?: string;
|
1343
|
+
/** 拉取请求合并提交信息 */
|
1344
|
+
commit_message?: string;
|
1345
|
+
/**
|
1346
|
+
* 拉取请求合并SHA值
|
1347
|
+
* 拉取请求头部必须匹配的 SHA 才能允许合并
|
1348
|
+
* */
|
1349
|
+
sha?: string;
|
1350
|
+
/**
|
1351
|
+
* 拉取请求合并方式
|
1352
|
+
* @default merge
|
1353
|
+
* merge: 合并提交
|
1354
|
+
* squash: 压缩提交
|
1355
|
+
* rebase: 变基提交
|
1356
|
+
* */
|
1357
|
+
merge_method?: MergeMethodType;
|
1358
|
+
}
|
1359
|
+
/**
|
1360
|
+
* 合并拉取请求响应类型
|
1361
|
+
* 对应 GitHub API 返回的 Pull Request Merge Result 结构
|
1362
|
+
*/
|
1363
|
+
interface MergePullRequestResponseType {
|
1364
|
+
/**
|
1365
|
+
* 合并后的提交 SHA 值
|
1366
|
+
* 表示合并操作生成的提交哈希
|
1367
|
+
*/
|
1368
|
+
sha: string;
|
1369
|
+
/**
|
1370
|
+
* 是否成功合并
|
1371
|
+
* - true: 成功合并
|
1372
|
+
* - false: 合并失败或冲突
|
1373
|
+
*/
|
1374
|
+
merged: boolean;
|
1375
|
+
/**
|
1376
|
+
* 合并结果描述信息
|
1377
|
+
* 包含成功或失败的具体原因
|
1378
|
+
*/
|
1379
|
+
message: string;
|
1380
|
+
}
|
1381
|
+
/** 文件列表类型 */
|
1382
|
+
interface PullRequestFilesListType {
|
1383
|
+
/** 文件的SHA值 */
|
1384
|
+
sha: string;
|
1385
|
+
/** 文件路径 */
|
1386
|
+
filename: string;
|
1387
|
+
/** 文件状态 */
|
1388
|
+
status: 'added' | 'removed' | 'modified' | 'renamed' | 'changed' | 'unchanged';
|
1389
|
+
/** 文件添加行数 */
|
1390
|
+
additions: number;
|
1391
|
+
/** 文件删除行数 */
|
1392
|
+
deletions: number;
|
1393
|
+
/** 文件修改行数 */
|
1394
|
+
changes: number;
|
1395
|
+
/** 文件的blob SHA值 */
|
1396
|
+
blob_url: string;
|
1397
|
+
/** 文件的raw URL */
|
1398
|
+
raw_url: string;
|
1399
|
+
/** 文件的patch内容, 也就是diff差异内容 */
|
1400
|
+
patch: string;
|
1401
|
+
}
|
1402
|
+
/** 获取拉取请求文件列表参数类型 */
|
1403
|
+
interface GetPullRequestFilesListParamType extends RepoBaseParamType, PullRequestNumberParamType {
|
1404
|
+
/** 每页结果数量 */
|
1405
|
+
per_page?: string;
|
1406
|
+
/** 页码 */
|
1407
|
+
page?: string;
|
1408
|
+
}
|
1409
|
+
/** 获取拉取请求文件列表响应类型 */
|
1410
|
+
type GetPullRequestFilesListResponseType = Array<PullRequestFilesListType>;
|
1411
|
+
/** 获取拉取请求评论信息参数类型 */
|
1412
|
+
type GetPullRequestCommentInfoParamType = RepoBaseParamType & CommentIdParamType;
|
1413
|
+
/** 获取拉取请求评论信息响应类型 */
|
1414
|
+
interface GetPullRequestCommentInfoResponseType {
|
1415
|
+
/** 评论ID */
|
1416
|
+
id: CommentIdParamType['comment_id'];
|
1417
|
+
/** 评论内容 */
|
1418
|
+
body: string;
|
1419
|
+
/** 评论用户 */
|
1420
|
+
user: PrUser;
|
1421
|
+
/** 评论创建时间 */
|
1422
|
+
created_at: string;
|
1423
|
+
/** 评论更新时间 */
|
1424
|
+
updated_at: string;
|
1425
|
+
}
|
1426
|
+
/** 获取拉取请求评论列表参数类型 */
|
1427
|
+
interface GetPullRequestCommentsListParamType extends RepoBaseParamType, PullRequestNumberParamType {
|
1428
|
+
direction: 'asc' | 'desc';
|
1429
|
+
/** 每页结果数量 */
|
1430
|
+
per_page?: string;
|
1431
|
+
/** 页码 */
|
1432
|
+
page?: string;
|
1433
|
+
}
|
1434
|
+
/** 获取拉取请求评论列表响应类型 */
|
1435
|
+
type GetPullRequestCommentsListResponseType = Array<GetPullRequestCommentInfoResponseType>;
|
1436
|
+
/** 创建拉取请求评论参数类型 */
|
1437
|
+
interface CreatePullRequestCommentParamType extends RepoBaseParamType, PullRequestNumberParamType {
|
1438
|
+
/** 评论内容 */
|
1439
|
+
body: string;
|
1440
|
+
}
|
1441
|
+
/** 创建拉取请求评论响应类型 */
|
1442
|
+
interface CreatePullRequestCommentResponseType {
|
1443
|
+
/** 评论id */
|
1444
|
+
id: CommentIdParamType['comment_id'];
|
1445
|
+
/** 评论内容 */
|
1446
|
+
body: string;
|
1447
|
+
}
|
1448
|
+
/** 更新拉取请求评论参数类型 */
|
1449
|
+
interface UpdatePullRequestCommentParamType extends RepoBaseParamType, CommentIdParamType {
|
1450
|
+
/** 评论内容 */
|
1451
|
+
body: string;
|
1452
|
+
}
|
1453
|
+
/** 更新拉取请求评论响应类型 */
|
1454
|
+
interface UpdatePullRequestCommentResponseType {
|
1455
|
+
/** 是否评论成功 */
|
1456
|
+
success: boolean;
|
1457
|
+
}
|
1458
|
+
/** 删除拉取请求评论参数类型 */
|
1459
|
+
type DeletePullRequestCommentParamType = RepoBaseParamType & CommentIdParamType;
|
1460
|
+
/** 删除拉取请求评论响应类型 */
|
1461
|
+
interface DeletePullRequestCommentResponseType {
|
1462
|
+
/** 是否删除成功 */
|
1463
|
+
success: boolean;
|
1464
|
+
}
|
1465
|
+
|
1466
|
+
type ReleaseUser = Omit<UserInfoResponseType, 'bio' | 'blog' | 'followers' | 'following' | 'public_repos'>;
|
1467
|
+
/** 反应信息类型 */
|
1468
|
+
interface ReactionInfoType {
|
1469
|
+
/** 反应 API URL */
|
1470
|
+
url: string;
|
1471
|
+
/** 总反应数 */
|
1472
|
+
total_count: number;
|
1473
|
+
/** 👍 反应数 */
|
1474
|
+
'+1': number;
|
1475
|
+
/** 👎 反应数 */
|
1476
|
+
'-1': number;
|
1477
|
+
/** 😄 反应数 */
|
1478
|
+
laugh: number;
|
1479
|
+
/** 😕 反应数 */
|
1480
|
+
confused: number;
|
1481
|
+
/** ❤️ 反应数 */
|
1482
|
+
heart: number;
|
1483
|
+
/** 🎉 反应数 */
|
1484
|
+
hooray: number;
|
1485
|
+
/** 👀 反应数 */
|
1486
|
+
eyes: number;
|
1487
|
+
/** 🚀 反应数 */
|
1488
|
+
rocket: number;
|
1489
|
+
}
|
1490
|
+
/** 发布资源类型 */
|
1491
|
+
interface ReleaseAssetsType {
|
1492
|
+
/** 资源 URL */
|
1493
|
+
url: string;
|
1494
|
+
/** 资源下载 URL */
|
1495
|
+
browser_download_url: string;
|
1496
|
+
}
|
1497
|
+
/** 获取Release信息参数类型 */
|
1498
|
+
type ReleaseInfoParamType = RepoBaseParamType & {
|
1499
|
+
/** 发布ID */
|
1500
|
+
release_id: number;
|
1501
|
+
};
|
1502
|
+
/** 获Release信息响应类型 */
|
1503
|
+
interface ReleaseInfoResponseType {
|
1504
|
+
/**
|
1505
|
+
* 发布版本的 ID
|
1506
|
+
* 该字段在gitcode平台为null
|
1507
|
+
*/
|
1508
|
+
id: number | null;
|
1509
|
+
/** 标签名称 */
|
1510
|
+
tag_name: string;
|
1511
|
+
/** 目标分支或提交 */
|
1512
|
+
target_commitish: string;
|
1513
|
+
/** 发布版本名称 */
|
1514
|
+
name: string | null;
|
1515
|
+
/** 发布说明 */
|
1516
|
+
body: string | null;
|
1517
|
+
/** 是否为预发布版本 */
|
1518
|
+
prerelease: boolean;
|
1519
|
+
/** 发布者信息 */
|
1520
|
+
author: ReleaseUser;
|
1521
|
+
/** 发布资源列表 */
|
1522
|
+
assets: Array<ReleaseAssetsType>;
|
1523
|
+
/** 发布时间 */
|
1524
|
+
created_at: string;
|
1525
|
+
}
|
1526
|
+
/** 获取最新Release参数类型 */
|
1527
|
+
type ReleaseLatestParamTypeType = RepoBaseParamType;
|
1528
|
+
/** 获取最新Release响应类型 */
|
1529
|
+
type ReleaseLatestResponseType = ReleaseInfoResponseType;
|
1530
|
+
/** 通过Tag获取Release信息参数类型 */
|
1531
|
+
type ReleaseInfoByTagParamType = RepoBaseParamType & {
|
1532
|
+
/** 标签名称 */
|
1533
|
+
tag: string;
|
1534
|
+
};
|
1535
|
+
/** 通过Tag获取Release信息响应类型 */
|
1536
|
+
type ReleaseInfoByTagResponseType = ReleaseInfoResponseType;
|
1537
|
+
/** 获取Release列表参数类型 */
|
1538
|
+
type ReleaseListParamType = RepoBaseParamType & {
|
1539
|
+
/** 每页数量 */
|
1540
|
+
per_page?: number;
|
1541
|
+
/** 页码 */
|
1542
|
+
page?: number;
|
1543
|
+
};
|
1544
|
+
/** 获取Release列表响应类型 */
|
1545
|
+
type ReleaseListResponseType = Array<ReleaseInfoResponseType>;
|
1546
|
+
/** 创建Release参数类型 */
|
1547
|
+
type CreateReleaseParamType = RepoBaseParamType & {
|
1548
|
+
/** 标签名称 */
|
1549
|
+
tag_name: string;
|
1550
|
+
/** 目标分支或提交 */
|
1551
|
+
target_commitish: string;
|
1552
|
+
/** 发布版本名称 */
|
1553
|
+
name: string;
|
1554
|
+
/** 发布说明 */
|
1555
|
+
body: string;
|
1556
|
+
/** 是否为预发布版本 */
|
1557
|
+
prerelease: boolean;
|
1558
|
+
};
|
1559
|
+
/** 获取Release列表参数类型 */
|
1560
|
+
type CreateReleaseResponseType = ReleaseInfoResponseType;
|
1561
|
+
/** 更新Release参数类型 */
|
1562
|
+
type UpdateReleaseParamType = CreateReleaseParamType;
|
1563
|
+
/** 更新Release响应类型 */
|
1564
|
+
type UpdateReleaseResponseType = ReleaseInfoResponseType;
|
1565
|
+
/** 删除Release参数类型 */
|
1566
|
+
type DeleteReleaseParamType = ReleaseInfoParamType;
|
1567
|
+
/** 删除Release响应类型 */
|
1568
|
+
interface DeleteReleaseResponseType {
|
1569
|
+
/** 删除信息 */
|
1398
1570
|
info: string;
|
1399
1571
|
}
|
1400
1572
|
|
@@ -1436,6 +1608,26 @@ declare function formatDate(dateString: string, locale?: string, format?: string
|
|
1436
1608
|
* ```
|
1437
1609
|
*/
|
1438
1610
|
declare function get_relative_time(dateString: string, locale?: string): Promise<string>;
|
1611
|
+
/**
|
1612
|
+
* 获取本地仓库的默认分支
|
1613
|
+
* @param local_path - 本地仓库路径
|
1614
|
+
* @returns 默认分支名称
|
1615
|
+
* @example
|
1616
|
+
* ```ts
|
1617
|
+
* console.log(await get_local_repo_default_branch('/path/to/repo')) // 输出 'main'
|
1618
|
+
* ```
|
1619
|
+
*/
|
1620
|
+
declare function get_local_repo_default_branch(local_path: string): Promise<string>;
|
1621
|
+
/**
|
1622
|
+
* 获取远程仓库的默认分支
|
1623
|
+
* @param remote_url - 远程仓库URL
|
1624
|
+
* @returns 默认分支名称
|
1625
|
+
* @example
|
1626
|
+
* ```ts
|
1627
|
+
* console.log(await get_remote_repo_default_branch('https://github.com/CandriaJS/git-neko-kit')) // 输出 'main'
|
1628
|
+
* ```
|
1629
|
+
*/
|
1630
|
+
declare function get_remote_repo_default_branch(remote_url: string): Promise<string>;
|
1439
1631
|
/**
|
1440
1632
|
* 根据语言名称获取对应的颜色值
|
1441
1633
|
* @param language - 语言名称
|
@@ -1466,8 +1658,6 @@ declare function create_state_id(): Promise<string>;
|
|
1466
1658
|
* - 检查访问令牌状态
|
1467
1659
|
* - 刷新访问令牌
|
1468
1660
|
*
|
1469
|
-
* @class Auth
|
1470
|
-
* @extends Base GitHub基础操作类
|
1471
1661
|
*/
|
1472
1662
|
declare class Auth extends GitHubClient {
|
1473
1663
|
constructor(base: GitHubClient);
|
@@ -1538,7 +1728,6 @@ declare class Commit extends GitHubClient {
|
|
1538
1728
|
* - url 仓库URL地址
|
1539
1729
|
* - owner 仓库拥有者
|
1540
1730
|
* - sha 提交的SHA值,如果不提供,则默认获取仓库的默认分支的最新提交信息
|
1541
|
-
* - format - 可选,是否格式化提交信息, 默认为false
|
1542
1731
|
* @returns 提交信息
|
1543
1732
|
* @example
|
1544
1733
|
* ```ts
|
@@ -1572,7 +1761,7 @@ declare class Commit extends GitHubClient {
|
|
1572
1761
|
}
|
1573
1762
|
|
1574
1763
|
/**
|
1575
|
-
* GitHub Issue 处理类,提供
|
1764
|
+
* GitHub Issue 处理类,提供Issue相关操作功能
|
1576
1765
|
*
|
1577
1766
|
* 提供完整的GitHub Issue管理,包括:
|
1578
1767
|
* - 获取Issue列表
|
@@ -1587,7 +1776,7 @@ declare class Commit extends GitHubClient {
|
|
1587
1776
|
declare class Issue extends GitHubClient {
|
1588
1777
|
constructor(base: GitHubClient);
|
1589
1778
|
/**
|
1590
|
-
*
|
1779
|
+
* 获取议题详情
|
1591
1780
|
* 权限:
|
1592
1781
|
* - Issues: Read-only
|
1593
1782
|
* @param options 请求参数列表
|
@@ -1604,7 +1793,7 @@ declare class Issue extends GitHubClient {
|
|
1604
1793
|
*/
|
1605
1794
|
get_issue_info(options: IssueInfoParamType): Promise<ApiResponseType<IssueInfoResponseType>>;
|
1606
1795
|
/**
|
1607
|
-
*
|
1796
|
+
* 获取仓库的议题列表
|
1608
1797
|
* 权限:
|
1609
1798
|
* - Issues:Read-only
|
1610
1799
|
* @param options 请求参数列表
|
@@ -1632,7 +1821,7 @@ declare class Issue extends GitHubClient {
|
|
1632
1821
|
*/
|
1633
1822
|
get_issues_list(options: RepoIssueListParamType): Promise<ApiResponseType<IssueListResponseType>>;
|
1634
1823
|
/**
|
1635
|
-
*
|
1824
|
+
* 创建一个议题
|
1636
1825
|
* 权限:
|
1637
1826
|
* - Issues: Write
|
1638
1827
|
* @param options 发送Issue的参数对象
|
@@ -1654,7 +1843,7 @@ declare class Issue extends GitHubClient {
|
|
1654
1843
|
*/
|
1655
1844
|
create_issue(options: CreteIssueParamType): Promise<ApiResponseType<CreateIssueResponseType>>;
|
1656
1845
|
/**
|
1657
|
-
*
|
1846
|
+
* 更新一个议题
|
1658
1847
|
* 权限:
|
1659
1848
|
* - Issues: Write
|
1660
1849
|
* - Pull requests: Write
|
@@ -1679,7 +1868,7 @@ declare class Issue extends GitHubClient {
|
|
1679
1868
|
*/
|
1680
1869
|
update_issue(options: UpdateIssueParamType): Promise<ApiResponseType<UpdateIssueResponseType>>;
|
1681
1870
|
/**
|
1682
|
-
*
|
1871
|
+
* 重新打开一个议题
|
1683
1872
|
* 权限:
|
1684
1873
|
* - Issues: Write
|
1685
1874
|
* - Pull requests: Write
|
@@ -1707,7 +1896,7 @@ declare class Issue extends GitHubClient {
|
|
1707
1896
|
*/
|
1708
1897
|
reopen_issue(options: OpenIssueParamType): Promise<ApiResponseType<OpenIssueResponseType>>;
|
1709
1898
|
/**
|
1710
|
-
*
|
1899
|
+
* 关闭一个议题
|
1711
1900
|
* 权限:
|
1712
1901
|
* - Issues: Write
|
1713
1902
|
* - Pull requests: Write
|
@@ -1727,7 +1916,7 @@ declare class Issue extends GitHubClient {
|
|
1727
1916
|
*/
|
1728
1917
|
close_issue(options: CloseIssueParamType): Promise<ApiResponseType<CloseIssueResponseType>>;
|
1729
1918
|
/**
|
1730
|
-
*
|
1919
|
+
* 锁定一个议题
|
1731
1920
|
* 仅GitHub平台可用
|
1732
1921
|
* 权限:
|
1733
1922
|
* - Issues: Write
|
@@ -1748,7 +1937,7 @@ declare class Issue extends GitHubClient {
|
|
1748
1937
|
*/
|
1749
1938
|
lock_issue(options: LockIssueParamType): Promise<ApiResponseType<LockIssueResponseType>>;
|
1750
1939
|
/**
|
1751
|
-
*
|
1940
|
+
* 解锁一个议题
|
1752
1941
|
* 仅GitHub平台可用
|
1753
1942
|
* 权限:
|
1754
1943
|
* - Issues: Write
|
@@ -1768,7 +1957,7 @@ declare class Issue extends GitHubClient {
|
|
1768
1957
|
*/
|
1769
1958
|
unlock_issue(options: UnLockIssueParamType): Promise<ApiResponseType<UnLockIssueResponseType>>;
|
1770
1959
|
/**
|
1771
|
-
*
|
1960
|
+
* 获取一个仓库下议题的评论列表
|
1772
1961
|
* 权限:
|
1773
1962
|
* - Issues: Read-only
|
1774
1963
|
* - Pull requests: Read-only
|
@@ -1789,9 +1978,9 @@ declare class Issue extends GitHubClient {
|
|
1789
1978
|
* console.log(res) // { data: IssueCommentListResponseType[] }
|
1790
1979
|
* ```
|
1791
1980
|
*/
|
1792
|
-
|
1981
|
+
get_repo_comments_list(options: RepoCommentListParamType): Promise<ApiResponseType<RepoCommentListResponseType>>;
|
1793
1982
|
/**
|
1794
|
-
*
|
1983
|
+
* 获取一个议题下的评论列表
|
1795
1984
|
* 权限:
|
1796
1985
|
* - Issues: Read-only
|
1797
1986
|
* - Pull requests: Read-only
|
@@ -1813,7 +2002,7 @@ declare class Issue extends GitHubClient {
|
|
1813
2002
|
*/
|
1814
2003
|
get_issue_comments_list(options: IssueCommentListParamType): Promise<ApiResponseType<IssueCommentListResponseType>>;
|
1815
2004
|
/**
|
1816
|
-
*
|
2005
|
+
* 获取议题评论信息
|
1817
2006
|
* 权限:
|
1818
2007
|
* - Issues: Read-only
|
1819
2008
|
* - Pull requests: Read-only
|
@@ -1832,7 +2021,7 @@ declare class Issue extends GitHubClient {
|
|
1832
2021
|
*/
|
1833
2022
|
get_issue_comment_info(options: IssueCommentInfoParamType): Promise<ApiResponseType<IssueCommentInfoResponseType>>;
|
1834
2023
|
/**
|
1835
|
-
*
|
2024
|
+
* 创建一个议题评论
|
1836
2025
|
* 权限:
|
1837
2026
|
* - Issues: Write
|
1838
2027
|
* - Pull requests: Write
|
@@ -1852,7 +2041,7 @@ declare class Issue extends GitHubClient {
|
|
1852
2041
|
*/
|
1853
2042
|
create_issue_comment(options: CreteIssueCommentParamType): Promise<ApiResponseType<CreteIssueCommentResponseType>>;
|
1854
2043
|
/**
|
1855
|
-
*
|
2044
|
+
* 更新议题评论信息
|
1856
2045
|
* 权限:
|
1857
2046
|
* - Issues: Write
|
1858
2047
|
* - Pull requests: Write
|
@@ -1872,7 +2061,7 @@ declare class Issue extends GitHubClient {
|
|
1872
2061
|
*/
|
1873
2062
|
update_issue_comment(options: UpdateIssueCommentParamType): Promise<ApiResponseType<UpdateIssueCommentResponseType>>;
|
1874
2063
|
/**
|
1875
|
-
*
|
2064
|
+
* 删除议题评论信息
|
1876
2065
|
* 权限:
|
1877
2066
|
* - Issues: Write
|
1878
2067
|
* - Pull requests: Write
|
@@ -1891,7 +2080,7 @@ declare class Issue extends GitHubClient {
|
|
1891
2080
|
*/
|
1892
2081
|
remove_issue_comment(options: RemoveIssueCommentParamType): Promise<ApiResponseType<RemoveCollaboratorResponseType>>;
|
1893
2082
|
/**
|
1894
|
-
*
|
2083
|
+
* 删除议题评论信息
|
1895
2084
|
* 权限:
|
1896
2085
|
* - Issues: Write
|
1897
2086
|
* - Pull requests: Write
|
@@ -1995,7 +2184,7 @@ declare class Issue extends GitHubClient {
|
|
1995
2184
|
}
|
1996
2185
|
|
1997
2186
|
/**
|
1998
|
-
*
|
2187
|
+
* Github 组织操作类
|
1999
2188
|
*
|
2000
2189
|
* 提供对GitHub组织的CRUD操作,包括:
|
2001
2190
|
* - 获取组织信息
|
@@ -2005,7 +2194,7 @@ declare class Org extends GitHubClient {
|
|
2005
2194
|
/**
|
2006
2195
|
* 获取组织信息
|
2007
2196
|
* 权限:
|
2008
|
-
* -
|
2197
|
+
* - Metadata Read-only , 如果获取公开组织可无需此权限
|
2009
2198
|
* @param options 组织参数
|
2010
2199
|
* - org 组织名称
|
2011
2200
|
* @returns 组织信息
|
@@ -2016,6 +2205,263 @@ declare class Org extends GitHubClient {
|
|
2016
2205
|
* ```
|
2017
2206
|
*/
|
2018
2207
|
get_org_info(options: OrgInfoParamType): Promise<ApiResponseType<OrgInfoResponseType>>;
|
2208
|
+
/**
|
2209
|
+
* 添加组织成员
|
2210
|
+
* 权限:
|
2211
|
+
* - Members Read-And_Write
|
2212
|
+
* @param options 组织参数
|
2213
|
+
* - org 组织名称
|
2214
|
+
* - username 成员名称
|
2215
|
+
* @returns 成员信息
|
2216
|
+
* @example
|
2217
|
+
* ```ts
|
2218
|
+
* const orgInfo = await org.add_member({ org: 'org', username: 'username' })
|
2219
|
+
* console.log(orgInfo)
|
2220
|
+
* ```
|
2221
|
+
*/
|
2222
|
+
add_member(options: AddMemberParamType): Promise<ApiResponseType<AddMemberResponseType>>;
|
2223
|
+
}
|
2224
|
+
|
2225
|
+
/**
|
2226
|
+
* GitHub pull_request类
|
2227
|
+
*
|
2228
|
+
* 提供完整的GitHub pull_request管理,包括
|
2229
|
+
* - 获取pull_request列表
|
2230
|
+
* - 获取pull_request详情
|
2231
|
+
*
|
2232
|
+
* @class Auth
|
2233
|
+
* @extends GitHubClient GitHub基础操作类
|
2234
|
+
*/
|
2235
|
+
declare class Pull_Request extends GitHubClient {
|
2236
|
+
constructor(base: GitHubClient);
|
2237
|
+
/**
|
2238
|
+
* 获取拉取请求详情
|
2239
|
+
* 权限:
|
2240
|
+
* - Pull requests: Read-And-Wirte
|
2241
|
+
* - Contents: Read-And-Wirte
|
2242
|
+
* @param options 请求参数列表
|
2243
|
+
* - owner 仓库拥有者
|
2244
|
+
* - repo 仓库名称
|
2245
|
+
* - pr_number Pr编号
|
2246
|
+
* @returns 包含pull_request信息的响应对象
|
2247
|
+
* @example
|
2248
|
+
* ```ts
|
2249
|
+
* const pull_request = get_pull_request() // 获取pull_request实例
|
2250
|
+
* const res = await pull_request.get_pull_request_info({ owner: 'owner', repo:'repo', pr_number:1 })
|
2251
|
+
* console.log(res) // { data: PullRequestInfoResponseType }
|
2252
|
+
* ```
|
2253
|
+
*/
|
2254
|
+
get_pull_request_info(options: PullRequestInfoParamType): Promise<ApiResponseType<PullRequestInfoResponseType>>;
|
2255
|
+
/**
|
2256
|
+
* 获取拉取请求列表
|
2257
|
+
* 权限:
|
2258
|
+
* - Pull requests: Read-Only
|
2259
|
+
* @param options 请求参数列表
|
2260
|
+
* - owner 仓库拥有者
|
2261
|
+
* - repo 仓库名称
|
2262
|
+
* - pr_number Pr编号
|
2263
|
+
* - state 状态
|
2264
|
+
* - base 基准分支
|
2265
|
+
* - sort 排序
|
2266
|
+
* - direction 排序方向
|
2267
|
+
* - per_page 每页数量
|
2268
|
+
* - page 页码
|
2269
|
+
* @returns 包含pull_request信息的响应对象
|
2270
|
+
* @example
|
2271
|
+
* ```ts
|
2272
|
+
* const pull_request = get_pull_request() // 获取pull_request实例
|
2273
|
+
* const res = await pull_request.get_get_pull_request_list({ owner: 'owner', repo:'repo' })
|
2274
|
+
* console.log(res) // { data: PullRequestListResponseType }
|
2275
|
+
* ```
|
2276
|
+
*/
|
2277
|
+
get_get_pull_request_list(options: PullRequestListParamType): Promise<ApiResponseType<PullRequestListResponseType>>;
|
2278
|
+
/**
|
2279
|
+
* 创建一个拉取请求
|
2280
|
+
* 权限:
|
2281
|
+
* - Pull requests: Read-And-Write
|
2282
|
+
* @param options 请求参数列表
|
2283
|
+
* - owner 仓库拥有者
|
2284
|
+
* - repo 仓库名称
|
2285
|
+
* - title 标题
|
2286
|
+
* - body 内容
|
2287
|
+
* - issue 关联的议题
|
2288
|
+
* title和body与issue参数传入其中一种,当传入issue参数时,title和body参数将自动填充
|
2289
|
+
* - head 拉取请求源分支
|
2290
|
+
* - head_repo 拉取请求源仓库, 如果两个存储库都由同一组织拥有,则跨存储库拉取请求需要此字段
|
2291
|
+
* - base 拉取请求目标分支
|
2292
|
+
* - draft 是否为草稿
|
2293
|
+
* @returns 包含pull_request信息的响应对象
|
2294
|
+
* @example
|
2295
|
+
* ```ts
|
2296
|
+
* const pull_request = get_pull_request() // 获取pull_request实例
|
2297
|
+
* const res = await pull_request.create_pull_requestt({ owner: 'owner', repo:'repo', issue: 1, head: 'head', base: 'base' })
|
2298
|
+
* console.log(res) // { data: CreatePullRequestResponseType }
|
2299
|
+
*/
|
2300
|
+
create_pull_request(options: CreatePullRequestParamType): Promise<ApiResponseType<CreatePullRequestResponseType>>;
|
2301
|
+
/**
|
2302
|
+
* 更新一个拉取请求
|
2303
|
+
* 权限:
|
2304
|
+
* - Pull requests: Read-And-Write
|
2305
|
+
* @param options 请求参数列表
|
2306
|
+
* - owner 仓库拥有者
|
2307
|
+
* - repo 仓库名称
|
2308
|
+
* - title 标题
|
2309
|
+
* - body 内容
|
2310
|
+
* - state 状态
|
2311
|
+
* @returns 包含pull_request信息的响应对象
|
2312
|
+
* @example
|
2313
|
+
* ```ts
|
2314
|
+
* const pull_request = get_pull_request() // 获取pull_request实例
|
2315
|
+
* const res = await pull_request.create_pull_requestt({ owner: 'owner', repo:'repo', pr_number:1, state:'open' })
|
2316
|
+
* console.log(res) // { data: CreatePullRequestResponseType }
|
2317
|
+
*/
|
2318
|
+
update_pull_request(options: UpdatePullRequestParamType): Promise<ApiResponseType<UpdatePullRequestResponseType>>;
|
2319
|
+
/**
|
2320
|
+
* 合并拉取请求
|
2321
|
+
* 权限:
|
2322
|
+
* - Pull requests: Read-And-Write
|
2323
|
+
* @param options 请求参数列表
|
2324
|
+
* - owner 仓库拥有者
|
2325
|
+
* - repo 仓库名称
|
2326
|
+
* - pr_number 拉取请求编号
|
2327
|
+
* - commit_title 合并提交标题
|
2328
|
+
* - commit_message 合并提交信息
|
2329
|
+
* - sha 拉取请求头部必须匹配的 SHA 才能允许合并
|
2330
|
+
* - merge_method 拉取请求合并方式, 默认为 merge
|
2331
|
+
* @returns 包含pull_request信息的响应对象
|
2332
|
+
* @example
|
2333
|
+
* ```ts
|
2334
|
+
* const pull_request = get_pull_request() // 获取pull_request实例
|
2335
|
+
* const res = await pull_request.merge_pull_request({ owner: 'owner', repo:'repo', pr_number:1 })
|
2336
|
+
* console.log(res) // { data: CreatePullRequestResponseType }
|
2337
|
+
* ```
|
2338
|
+
*/
|
2339
|
+
merge_pull_request(options: MergePullRequestParamType): Promise<ApiResponseType<MergePullRequestResponseType>>;
|
2340
|
+
/**
|
2341
|
+
* 获取拉取请求文件列表
|
2342
|
+
* 权限:
|
2343
|
+
* - Pull requests: Read-And-Write
|
2344
|
+
* @param options 请求参数列表
|
2345
|
+
* - owner 仓库拥有者
|
2346
|
+
* - repo 仓库名称
|
2347
|
+
* - pr_number 拉取请求编号
|
2348
|
+
* - per_page 每页结果数量
|
2349
|
+
* - page 页码
|
2350
|
+
* @returns 包含拉取请求文件列表的响应对象
|
2351
|
+
* @example
|
2352
|
+
* ```ts
|
2353
|
+
* const pull_request = get_pull_request() // 获取pull_request实例
|
2354
|
+
* const res = await pull_request.get_pull_request_files_list({ owner: 'owner', repo:'repo', pr_number:1 })
|
2355
|
+
* console.log(res) // { data: GetPullRequestFilesListResponseType }
|
2356
|
+
* ```
|
2357
|
+
*/
|
2358
|
+
get_pull_request_files_list(options: GetPullRequestFilesListParamType): Promise<ApiResponseType<GetPullRequestFilesListResponseType>>;
|
2359
|
+
/**
|
2360
|
+
* 获取拉取请求评论信息
|
2361
|
+
* 权限:
|
2362
|
+
* - Pull requests: Read-And-Write
|
2363
|
+
* @param options 请求参数列表
|
2364
|
+
* - owner 仓库拥有者
|
2365
|
+
* - repo 仓库名称
|
2366
|
+
* - comment_id 评论ID
|
2367
|
+
* @returns 包含拉取请求指定的评论id的信息
|
2368
|
+
* @example
|
2369
|
+
* ```ts
|
2370
|
+
* const pull_request = get_pull_request() // 获取pull_request实例
|
2371
|
+
* const res = await pull_request.get_pull_request_comment_info({ owner: 'owner', repo:'repo', comment_id:1 })
|
2372
|
+
* console.log(res) // { data: GetPullRequestCommentInfoResponseType }
|
2373
|
+
* ```
|
2374
|
+
*/
|
2375
|
+
get_pull_request_comment_info(options: GetPullRequestCommentInfoParamType): Promise<ApiResponseType<GetPullRequestCommentInfoResponseType>>;
|
2376
|
+
/**
|
2377
|
+
* 获取拉取请求评论列表
|
2378
|
+
* 权限:
|
2379
|
+
* - Pull requests: Read-And-Write
|
2380
|
+
* @param options 请求参数列表
|
2381
|
+
* - owner 仓库拥有者
|
2382
|
+
* - repo 仓库名称
|
2383
|
+
* - pr_number 拉取请求编号
|
2384
|
+
* - direction 排序方向
|
2385
|
+
* - per_page 每页结果数量
|
2386
|
+
* - page 页码
|
2387
|
+
* @returns 包含拉取请求评论列表响应信息列表
|
2388
|
+
* @example
|
2389
|
+
* ```ts
|
2390
|
+
* const pull_request = get_pull_request() // 获取pull_request实例
|
2391
|
+
* const res = await pull_request.get_pull_request_comments_list({ owner: 'owner', repo:'repo', pr_number:1 })
|
2392
|
+
* console.log(res) // { data: GetPullRequestCommentsListResponseType }
|
2393
|
+
* ```
|
2394
|
+
*/
|
2395
|
+
get_pull_request_comments_list(options: GetPullRequestCommentsListParamType): Promise<ApiResponseType<GetPullRequestCommentsListResponseType>>;
|
2396
|
+
/**
|
2397
|
+
* 创建拉取请求评论
|
2398
|
+
* 权限:
|
2399
|
+
* - Pull requests: Read-And-Write
|
2400
|
+
* @param options 请求参数列表
|
2401
|
+
* - owner 仓库拥有者
|
2402
|
+
* - repo 仓库名称
|
2403
|
+
* - pr_number 拉取请求编号
|
2404
|
+
* - body 评论内容
|
2405
|
+
* @returns 包含创建拉取请求评论响应信息
|
2406
|
+
* @example
|
2407
|
+
* ```ts
|
2408
|
+
* const pull_request = get_pull_request() // 获取pull_request实例
|
2409
|
+
* const res = await pull_request.create_pull_request_comment({ owner: 'owner', repo:'repo', pr_number:1, body: 'loli' })
|
2410
|
+
* console.log(res) // { data: CreatePullRequestCommentResponseType }
|
2411
|
+
* ```
|
2412
|
+
*/
|
2413
|
+
create_pull_request_comment(options: CreatePullRequestCommentParamType): Promise<ApiResponseType<CreatePullRequestCommentResponseType>>;
|
2414
|
+
/**
|
2415
|
+
* 更新拉取请求评论
|
2416
|
+
* 权限:
|
2417
|
+
* - Pull requests: Read-And-Write
|
2418
|
+
* @param options 请求参数列表
|
2419
|
+
* - owner 仓库拥有者
|
2420
|
+
* - repo 仓库名称
|
2421
|
+
* - comment_id 评论ID
|
2422
|
+
* - body 评论内容
|
2423
|
+
* @returns 包含更新拉取请求评论响应信息
|
2424
|
+
* @example
|
2425
|
+
* ```ts
|
2426
|
+
* const pull_request = get_pull_request() // 获取pull_request实例
|
2427
|
+
* const res = await pull_request.update_pull_request_comment({ owner: 'owner', repo:'repo', comment_id:1, body: 'loli' })
|
2428
|
+
* console.log(res) // { data: CreatePullRequestCommentResponseType }
|
2429
|
+
* ```
|
2430
|
+
*/
|
2431
|
+
update_pull_request_comment(options: UpdatePullRequestCommentParamType): Promise<ApiResponseType<UpdatePullRequestCommentResponseType>>;
|
2432
|
+
/**
|
2433
|
+
* 删除拉取请求评论
|
2434
|
+
* @deprecated 请使用update_issue_comment方法
|
2435
|
+
* 权限:
|
2436
|
+
* - Pull requests: Read-And-Write
|
2437
|
+
* @param options - 删除拉取请求评论参数对象
|
2438
|
+
* @returns 删除结果
|
2439
|
+
* @example
|
2440
|
+
* ```ts
|
2441
|
+
* const pull_request = get_pull_request() // 获取pull_request实例
|
2442
|
+
* const res = await pull_request. public async edit_pull_request_comment (
|
2443
|
+
({ owner: 'owner', repo:'repo', comment_id:1, body: 'loli' })
|
2444
|
+
* console.log(res) // { data: CreatePullRequestCommentResponseType }
|
2445
|
+
* ```
|
2446
|
+
*/
|
2447
|
+
edit_pull_request_comment(options: UpdatePullRequestCommentParamType): Promise<ApiResponseType<UpdatePullRequestCommentResponseType>>;
|
2448
|
+
/**
|
2449
|
+
* 删除拉取请求评论
|
2450
|
+
* 权限:
|
2451
|
+
* - Pull requests: Read-And-Write
|
2452
|
+
* @param options 请求参数列表
|
2453
|
+
* - owner 仓库拥有者
|
2454
|
+
* - repo 仓库名称
|
2455
|
+
* - comment_id 评论ID
|
2456
|
+
* @returns 包含更新拉取请求评论响应信息
|
2457
|
+
* @example
|
2458
|
+
* ```ts
|
2459
|
+
* const pull_request = get_pull_request() // 获取pull_request实例
|
2460
|
+
* const res = await pull_request.delete_pull_request_comment({ owner: 'owner', repo:'repo', comment_id: 1 })
|
2461
|
+
* console.log(res) // { data: DeletePullRequestCommentResponseType }
|
2462
|
+
* ```
|
2463
|
+
*/
|
2464
|
+
delete_pull_request_comment(options: DeletePullRequestCommentParamType): Promise<ApiResponseType<DeletePullRequestCommentResponseType>>;
|
2019
2465
|
}
|
2020
2466
|
|
2021
2467
|
/**
|
@@ -2087,50 +2533,78 @@ declare class Repo extends GitHubClient {
|
|
2087
2533
|
* 权限:
|
2088
2534
|
* - Metadata: Read-only, 如果只获取公开仓库可无需此权限
|
2089
2535
|
* @param options - 仓库信息参数对象,必须包含以下两种组合之一:
|
2090
|
-
* -
|
2091
|
-
* -
|
2092
|
-
* - options.repo 仓库名称
|
2093
|
-
* url参数和owner、repo参数传入其中的一种
|
2536
|
+
* - owner 仓库拥有者
|
2537
|
+
* - repo 仓库名称
|
2094
2538
|
* @example
|
2095
2539
|
* ```ts
|
2096
|
-
* const repo = await repo.get_repo_info({
|
2540
|
+
* const repo = await repo.get_repo_info({ owner: 'owner', repo: 'repo' })
|
2097
2541
|
* console.log(repo)
|
2098
2542
|
* ```
|
2099
2543
|
*/
|
2100
2544
|
get_repo_info(options: RepoInfoParamType): Promise<ApiResponseType<RepoInfoResponseType>>;
|
2545
|
+
/**
|
2546
|
+
* 获取仓库语言列表
|
2547
|
+
* 权限:
|
2548
|
+
* - Metadata: Read-only, 如果只获取公开仓库可无需此权限
|
2549
|
+
* @param options - 仓库信息参数对象,必须包含以下两种组合之一:
|
2550
|
+
* - owner 仓库拥有者
|
2551
|
+
* - repo 仓库名称
|
2552
|
+
* @example
|
2553
|
+
* ```ts
|
2554
|
+
* const repo = await repo.get_repo_languages_list({ owner: 'owner', repo: 'repo' })
|
2555
|
+
* console.log(repo)
|
2556
|
+
* ```
|
2557
|
+
*/
|
2101
2558
|
get_repo_languages_list(options: RepoLanguagesListParamType): Promise<ApiResponseType<RepoLanguagesListResponseType>>;
|
2102
2559
|
/**
|
2103
2560
|
* 创建组织仓库
|
2104
2561
|
* 权限:
|
2105
2562
|
* - Administration: Read and write
|
2106
2563
|
* @param options 创建组织仓库参数
|
2107
|
-
* -
|
2564
|
+
* - org: 组织名称
|
2108
2565
|
* - name: 仓库名称
|
2109
2566
|
* - description: 仓库描述
|
2110
2567
|
* - homepage: 仓库主页URL
|
2111
2568
|
* - visibility: 仓库可见性,可选值:'public' | 'private', 默认值:'public'
|
2112
2569
|
* - has_issues: 是否启用issues功能, 默认值:true
|
2113
|
-
* - has_projects: 是否启用projects功能, 默认值:true
|
2114
2570
|
* - has_wiki: 是否启用wiki功能, 默认值:true
|
2115
|
-
* - has_downloads: 是否启用下载功能 默认值:true
|
2116
|
-
* - is_template: 是否设置为模板仓库 默认值:false
|
2117
|
-
* - team_id: 关联团队ID(组织仓库专用)
|
2118
2571
|
* - auto_init: 是否自动初始化仓库 默认值:false
|
2119
|
-
* - gitignore_template: gitignore模板名称(需配合auto_init使用)
|
2120
|
-
* - license_template: license模板名称(需配合auto_init使用)
|
2121
|
-
* - allow_squash_merge: 是否允许squash merge, 默认值:true
|
2122
|
-
* - allow_merge_commit: 是否允许普通合并, 默认值:true
|
2123
|
-
* - allow_rebase_merge: 是否允许rebase合并 默认值:true
|
2124
|
-
* - allow_auto_merge: 是否允许自动合并 默认值:false
|
2125
|
-
* - delete_branch_on_merge: 合并后是否自动删除分支 默认值:false
|
2126
|
-
* - squash_merge_commit_title: squash合并提交标题格式 默认值:'PR_TITLE'
|
2127
|
-
* - squash_merge_commit_message: squash合并提交信息格式 默认值:'PR_BODY'
|
2128
|
-
* - merge_commit_title: 合并提交标题格式 默认值:'PR_TITLE'
|
2129
|
-
* - merge_commit_message: 合并提交信息格式 默认值:'PR_BODY'
|
2130
|
-
* - custom_properties: 自定义键值对属性
|
2131
2572
|
* @returns 返回创建成功的仓库信息
|
2132
2573
|
*/
|
2133
2574
|
create_org_repo(options: OrgRepoCreateParamType): Promise<ApiResponseType<OrgRepoCreateResponseType>>;
|
2575
|
+
/**
|
2576
|
+
* 创建用户仓库
|
2577
|
+
* 权限:
|
2578
|
+
* - Administration: Read and write
|
2579
|
+
* @param options 创建组织仓库参数
|
2580
|
+
* - owner: 仓库拥有者,用户名称
|
2581
|
+
* - name: 仓库名称
|
2582
|
+
* - description: 仓库描述
|
2583
|
+
* - homepage: 仓库主页URL
|
2584
|
+
* - visibility: 仓库可见性,可选值:'public' | 'private', 默认值:'public'
|
2585
|
+
* - has_issues: 是否启用issues功能, 默认值:true
|
2586
|
+
* - has_wiki: 是否启用wiki功能, 默认值:true
|
2587
|
+
* - auto_init: 是否自动初始化仓库 默认值:false
|
2588
|
+
* @returns 返回创建成功的仓库信息
|
2589
|
+
*/
|
2590
|
+
create_user_repo(options: UserRepoCreateParamType): Promise<ApiResponseType<UserRepoCreateResponseType>>;
|
2591
|
+
/**
|
2592
|
+
* 创建用户仓库
|
2593
|
+
* @deprecated 请使用create_user_repo方法
|
2594
|
+
* 权限:
|
2595
|
+
* - Administration: Read and write
|
2596
|
+
* @param options 创建组织仓库参数
|
2597
|
+
* - owner: 仓库拥有者,用户名称
|
2598
|
+
* - name: 仓库名称
|
2599
|
+
* - description: 仓库描述
|
2600
|
+
* - homepage: 仓库主页URL
|
2601
|
+
* - visibility: 仓库可见性,可选值:'public' | 'private', 默认值:'public'
|
2602
|
+
* - has_issues: 是否启用issues功能, 默认值:true
|
2603
|
+
* - has_wiki: 是否启用wiki功能, 默认值:true
|
2604
|
+
* - auto_init: 是否自动初始化仓库 默认值:false
|
2605
|
+
* @returns 返回创建成功的仓库信息
|
2606
|
+
*/
|
2607
|
+
create_repo(options: UserRepoCreateParamType): Promise<ApiResponseType<RepoInfoResponseType>>;
|
2134
2608
|
/**
|
2135
2609
|
* 获取协作者列表
|
2136
2610
|
* 权限:
|
@@ -2231,7 +2705,7 @@ declare class Repo extends GitHubClient {
|
|
2231
2705
|
* console.log(visibility) // 输出 public 或 private
|
2232
2706
|
* ```
|
2233
2707
|
*/
|
2234
|
-
get_repo_visibility(options:
|
2708
|
+
get_repo_visibility(options: GetRepoVisibilityParamType): Promise<GetRepoVisibilityResponseType>;
|
2235
2709
|
/**
|
2236
2710
|
* 获取仓库默认分支
|
2237
2711
|
* 权限:
|
@@ -2243,11 +2717,11 @@ declare class Repo extends GitHubClient {
|
|
2243
2717
|
* url参数和owner、repo参数传入其中的一种
|
2244
2718
|
* @example
|
2245
2719
|
* ```ts
|
2246
|
-
* const defaultBranch = await repo.get_repo_default_branch({
|
2720
|
+
* const defaultBranch = await repo.get_repo_default_branch({owner: CandriaJS, repo: meme-plugin)}
|
2247
2721
|
* console.log(defaultBranch) // 输出 main
|
2248
2722
|
* ```ts
|
2249
2723
|
*/
|
2250
|
-
get_repo_default_branch(options:
|
2724
|
+
get_repo_default_branch(options: GetRepoDefaultBranchParamType): Promise<GetRepoDefaultBranchResponseType | null>;
|
2251
2725
|
/**
|
2252
2726
|
* 获取仓库主要语言
|
2253
2727
|
* 权限:
|
@@ -2263,7 +2737,7 @@ declare class Repo extends GitHubClient {
|
|
2263
2737
|
* console.log(language) // 输出 JavaScript
|
2264
2738
|
* ```ts
|
2265
2739
|
*/
|
2266
|
-
get_repo_main_language(options:
|
2740
|
+
get_repo_main_language(options: GetRepoMainLanguageParamType): Promise<GetRepoMainLanguageResponseType>;
|
2267
2741
|
}
|
2268
2742
|
|
2269
2743
|
/**
|
@@ -2305,28 +2779,24 @@ declare class User extends GitHubClient {
|
|
2305
2779
|
/**
|
2306
2780
|
* 通过访问令牌获取用户信息
|
2307
2781
|
* 权限:无需任何权限
|
2308
|
-
* @param options - 访问令牌配置参数对象
|
2309
|
-
* - access_token - 访问令牌
|
2310
2782
|
* @example
|
2311
2783
|
* ```ts
|
2312
|
-
* const userInfo = await user.get_user_info_by_token(
|
2784
|
+
* const userInfo = await user.get_user_info_by_token()
|
2313
2785
|
* console.log(userInfo)
|
2314
2786
|
* ```
|
2315
2787
|
*/
|
2316
|
-
get_user_info_by_auth(
|
2788
|
+
get_user_info_by_auth(): Promise<ApiResponseType<UserInfoResponseType>>;
|
2317
2789
|
/**
|
2318
2790
|
* 通过访问令牌获取用户信息
|
2319
2791
|
* 权限:无需任何权限
|
2320
|
-
* @deprecated 该方法已过时,请使用get_user_info_by_auth
|
2321
|
-
* @param options - 访问令牌配置参数对象
|
2322
|
-
* - access_token - 访问令牌
|
2792
|
+
* @deprecated 该方法已过时,请使用get_user_info_by_auth方法牌
|
2323
2793
|
* @example
|
2324
2794
|
* ```ts
|
2325
|
-
* const userInfo = await user.get_user_info_by_token(
|
2795
|
+
* const userInfo = await user.get_user_info_by_token()
|
2326
2796
|
* console.log(userInfo)
|
2327
2797
|
* ```
|
2328
2798
|
*/
|
2329
|
-
get_user_info_by_token(
|
2799
|
+
get_user_info_by_token(): Promise<ApiResponseType<UserInfoResponseType>>;
|
2330
2800
|
/**
|
2331
2801
|
* 获取用户贡献数据
|
2332
2802
|
* 权限:无需任何权限
|
@@ -2403,7 +2873,7 @@ declare class User extends GitHubClient {
|
|
2403
2873
|
}
|
2404
2874
|
|
2405
2875
|
/**
|
2406
|
-
*
|
2876
|
+
* GitHUb WebHook操作类
|
2407
2877
|
*
|
2408
2878
|
* 提供对GitHub WebHook的CRUD操作,包括:
|
2409
2879
|
* - 检查webhook签名是否正确
|
@@ -2436,13 +2906,13 @@ declare class WebHook extends GitHubClient {
|
|
2436
2906
|
* 此类作为GitHub API功能的入口点,封装了以下核心能力:
|
2437
2907
|
* - JWT令牌生成与管理
|
2438
2908
|
* - 请求代理配置
|
2439
|
-
* - 基础HTTP请求方法(GET/POST)
|
2909
|
+
* - 基础HTTP请求方法(GET/POST/PATCH/DELETE/PUT)
|
2440
2910
|
* - 应用认证管理
|
2441
2911
|
* - 模块化服务(App/Auth/Commit/Repo/User/WebHook)
|
2442
2912
|
*
|
2443
2913
|
* @example
|
2444
2914
|
* ```ts
|
2445
|
-
* const base = new
|
2915
|
+
* const base = new GitHubClient({
|
2446
2916
|
* APP_ID: 12345,
|
2447
2917
|
* Private_Key: '-----BEGIN PRIVATE KEY-----...',
|
2448
2918
|
* Client_ID: 'Iv1.1234567890abcdef',
|
@@ -2460,24 +2930,35 @@ declare class GitHubClient {
|
|
2460
2930
|
webhook: WebHook;
|
2461
2931
|
issue: Issue;
|
2462
2932
|
org: Org;
|
2463
|
-
|
2464
|
-
|
2933
|
+
pull_request: Pull_Request;
|
2934
|
+
base_url: string;
|
2935
|
+
api_url: string;
|
2465
2936
|
jwtToken: string;
|
2466
|
-
userToken
|
2937
|
+
userToken?: string | null;
|
2938
|
+
readonly Private_Key?: string | null;
|
2939
|
+
readonly Client_ID?: string | null;
|
2940
|
+
readonly Client_Secret?: string | null;
|
2941
|
+
readonly WebHook_Secret?: string | null;
|
2467
2942
|
readonly format: boolean;
|
2468
|
-
readonly Private_Key: string;
|
2469
|
-
readonly Client_ID: string;
|
2470
|
-
readonly Client_Secret: string;
|
2471
|
-
readonly WebHook_Secret: string;
|
2472
2943
|
private currentRequestConfig;
|
2473
2944
|
private proxy?;
|
2474
|
-
constructor(options:
|
2945
|
+
constructor(options: GitHubClientType);
|
2946
|
+
/**
|
2947
|
+
* 获取Git平台类型
|
2948
|
+
* @returns Git平台类型,如: github,gitee
|
2949
|
+
*/
|
2950
|
+
get type(): GitType;
|
2951
|
+
/**
|
2952
|
+
* 是否是App客户端
|
2953
|
+
*/
|
2954
|
+
get is_app_client(): boolean;
|
2955
|
+
private validateAppClient;
|
2475
2956
|
/**
|
2476
2957
|
* 获取App实例
|
2477
2958
|
* @returns App实例
|
2478
2959
|
* @example
|
2479
2960
|
* ```ts
|
2480
|
-
* const app = await
|
2961
|
+
* const app = await GitHubClient.get_app()
|
2481
2962
|
* ```
|
2482
2963
|
*/
|
2483
2964
|
get_app(): Promise<App>;
|
@@ -2486,7 +2967,7 @@ declare class GitHubClient {
|
|
2486
2967
|
* @returns Auth实例
|
2487
2968
|
* @example
|
2488
2969
|
* ```ts
|
2489
|
-
* const auth = await
|
2970
|
+
* const auth = await GitHubClient.get_auth()
|
2490
2971
|
* ```
|
2491
2972
|
*/
|
2492
2973
|
get_auth(): Promise<Auth>;
|
@@ -2495,7 +2976,7 @@ declare class GitHubClient {
|
|
2495
2976
|
* @returns Commit实例
|
2496
2977
|
* @example
|
2497
2978
|
* ```ts
|
2498
|
-
* const commit = await
|
2979
|
+
* const commit = await GitHubClient.get_commit()
|
2499
2980
|
* ```
|
2500
2981
|
*/
|
2501
2982
|
get_commit(): Promise<Commit>;
|
@@ -2504,7 +2985,7 @@ declare class GitHubClient {
|
|
2504
2985
|
* @returns Issue实例
|
2505
2986
|
* @example
|
2506
2987
|
* ```ts
|
2507
|
-
* const issue = await
|
2988
|
+
* const issue = await GitHubClient.get_issue()
|
2508
2989
|
* ```
|
2509
2990
|
*/
|
2510
2991
|
get_issue(): Promise<Issue>;
|
@@ -2513,7 +2994,7 @@ declare class GitHubClient {
|
|
2513
2994
|
* @returns Repo实例
|
2514
2995
|
* @example
|
2515
2996
|
* ```ts
|
2516
|
-
* const repo = await
|
2997
|
+
* const repo = await GitHubClient.get_repo()
|
2517
2998
|
* ```
|
2518
2999
|
*/
|
2519
3000
|
get_repo(): Promise<Repo>;
|
@@ -2522,7 +3003,7 @@ declare class GitHubClient {
|
|
2522
3003
|
* @returns User实例
|
2523
3004
|
* @example
|
2524
3005
|
* ```ts
|
2525
|
-
* const user = await
|
3006
|
+
* const user = await GitHubClient.get_user()
|
2526
3007
|
* ```
|
2527
3008
|
*/
|
2528
3009
|
get_user(): Promise<User>;
|
@@ -2531,7 +3012,7 @@ declare class GitHubClient {
|
|
2531
3012
|
* @returns Org实例
|
2532
3013
|
* @example
|
2533
3014
|
* ```ts
|
2534
|
-
* const org = await
|
3015
|
+
* const org = await GitHubClient.get_org()
|
2535
3016
|
* ```
|
2536
3017
|
*/
|
2537
3018
|
get_org(): Promise<Org>;
|
@@ -2540,10 +3021,19 @@ declare class GitHubClient {
|
|
2540
3021
|
* @returns WebHook实例
|
2541
3022
|
* @example
|
2542
3023
|
* ```ts
|
2543
|
-
* const webhook = await
|
3024
|
+
* const webhook = await GitHubClient.get_webhook()
|
2544
3025
|
* ```
|
2545
3026
|
*/
|
2546
3027
|
get_webhook(): Promise<WebHook>;
|
3028
|
+
/**
|
3029
|
+
* 获取Pull_request实例
|
3030
|
+
* @returns Pull_request实例
|
3031
|
+
* @example
|
3032
|
+
* ```ts
|
3033
|
+
* const pull_request = await GitHubClient.get_pull_request()
|
3034
|
+
* ```
|
3035
|
+
*/
|
3036
|
+
get_pull_request(): Promise<Pull_Request>;
|
2547
3037
|
/**
|
2548
3038
|
* 设置请求代理
|
2549
3039
|
* @param proxy 代理参数
|
@@ -2558,7 +3048,7 @@ declare class GitHubClient {
|
|
2558
3048
|
setProxy(proxy: ProxyParamsType): void;
|
2559
3049
|
/**
|
2560
3050
|
* 设置 token
|
2561
|
-
* 传入的 token 必须以 ghu_ 开头,否则会抛出错误
|
3051
|
+
* 传入的 token 必须以 ghu_ 或ghp_开头,否则会抛出错误
|
2562
3052
|
* @param token 传入的 token
|
2563
3053
|
* @example
|
2564
3054
|
* ```ts
|
@@ -2643,9 +3133,18 @@ declare class GitHubClient {
|
|
2643
3133
|
*/
|
2644
3134
|
declare class App extends GitHubClient {
|
2645
3135
|
constructor(base: GitHubClient);
|
3136
|
+
/**
|
3137
|
+
* 获取应用基本信息
|
3138
|
+
* 权限:
|
3139
|
+
* - `none` 此节点仅App Client可用
|
3140
|
+
* @param options - 应用标识符
|
3141
|
+
* @returns 应用基本信息
|
3142
|
+
*/
|
2646
3143
|
get_app_info(options: AppInfoParamType): Promise<ApiResponseType<AppInfoResponseType>>;
|
2647
3144
|
/**
|
2648
3145
|
* 获取当前 Github App 信息
|
3146
|
+
* 权限:
|
3147
|
+
* - `none` 此节点仅App Client可用
|
2649
3148
|
* @returns 返回 Github App 信息
|
2650
3149
|
* @example
|
2651
3150
|
* ```ts
|
@@ -2656,6 +3155,8 @@ declare class App extends GitHubClient {
|
|
2656
3155
|
private get_app_info_by_auth;
|
2657
3156
|
/**
|
2658
3157
|
* 获取仓库的应用安装信息
|
3158
|
+
* 权限:
|
3159
|
+
* - `none` 此节点仅App Client可用
|
2659
3160
|
* @param options - 仓库安装应用参数对象
|
2660
3161
|
* - owner 拥有者
|
2661
3162
|
* - repo 仓库名
|
@@ -2699,6 +3200,19 @@ declare class App extends GitHubClient {
|
|
2699
3200
|
* ```
|
2700
3201
|
*/
|
2701
3202
|
get_app_name(): Promise<string>;
|
3203
|
+
/**
|
3204
|
+
* 快速判断指定仓库是否安装了当前App 应用
|
3205
|
+
* @param options - 仓库安装应用参数对象
|
3206
|
+
* - owner 拥有者
|
3207
|
+
* - repo 仓库名
|
3208
|
+
* @returns 是否安装
|
3209
|
+
* @example
|
3210
|
+
* ```ts
|
3211
|
+
* const isInstalled = await app.is_app_inttalled_in_repo({ owner: 'owner', repo: 'repo' })
|
3212
|
+
* console.log(isInstalled) // 输出是否安装
|
3213
|
+
* ·
|
3214
|
+
*/
|
3215
|
+
is_app_installed_in_repo(options: RepoBaseParamType): Promise<boolean>;
|
2702
3216
|
}
|
2703
3217
|
|
2704
3218
|
type index_App = App;
|
@@ -2713,6 +3227,8 @@ type index_Issue = Issue;
|
|
2713
3227
|
declare const index_Issue: typeof Issue;
|
2714
3228
|
type index_Org = Org;
|
2715
3229
|
declare const index_Org: typeof Org;
|
3230
|
+
type index_Pull_Request = Pull_Request;
|
3231
|
+
declare const index_Pull_Request: typeof Pull_Request;
|
2716
3232
|
type index_Repo = Repo;
|
2717
3233
|
declare const index_Repo: typeof Repo;
|
2718
3234
|
type index_User = User;
|
@@ -2720,7 +3236,7 @@ declare const index_User: typeof User;
|
|
2720
3236
|
type index_WebHook = WebHook;
|
2721
3237
|
declare const index_WebHook: typeof WebHook;
|
2722
3238
|
declare namespace index {
|
2723
|
-
export { index_App as App, index_Auth as Auth, index_Commit as Commit, index_GitHubClient as GitHubClient, index_Issue as Issue, index_Org as Org, index_Repo as Repo, index_User as User, index_WebHook as WebHook };
|
3239
|
+
export { index_App as App, index_Auth as Auth, index_Commit as Commit, index_GitHubClient as GitHubClient, index_Issue as Issue, index_Org as Org, index_Pull_Request as Pull_Request, index_Repo as Repo, index_User as User, index_WebHook as WebHook };
|
2724
3240
|
}
|
2725
3241
|
|
2726
3242
|
/** 基本客户端 */
|
@@ -2729,4 +3245,4 @@ declare class Client {
|
|
2729
3245
|
constructor(options: ClientType);
|
2730
3246
|
}
|
2731
3247
|
|
2732
|
-
export { type AccessCodeType, type AccessTokenType, type AddCollaboratorResponseType, type
|
3248
|
+
export { type AccessCodeType, type AccessTokenClentTYpe, type AccessTokenType, type AddCollaboratorResponseType, type AddMemberParamType, type AddMemberResponseType, type AddSubIssueParamType, type AddSubIssueResponseType, type ApiResponseType, type AppClientType, type AppInfoParamType, type AppInfoResponseType, type AppPermissions, type AppRepoInfoResponseType, type AppUser, type CheckTokenResponseType, Client, type ClientType, type CloseIssueParamType, type CloseIssueResponseType, type CollaboratorInfoResponseType, type CollaboratorListParamType, type CollaboratorListResponseType, type CollaboratorParamType, type CommentIdParamType, type Commit$1 as Commit, type CommitInfoCommonParamType, type CommitInfoParamType, type CommitInfoResponseType, type CommitListParamType, type CommitListResponseType, type CommitStats, type CommonProxyType, type ContributionData, type ContributionResult, type CreateIssueResponseType, type CreatePullRequestCommentParamType, type CreatePullRequestCommentResponseType, type CreatePullRequestParamType, type CreatePullRequestResponseType, type CreateReleaseParamType, type CreateReleaseResponseType, type CreteIssueCommentParamType, type CreteIssueCommentResponseType, type CreteIssueParamType, type DeletePullRequestCommentParamType, type DeletePullRequestCommentResponseType, type DeleteReleaseParamType, type DeleteReleaseResponseType, type DiffEntry, type GetPullRequestCommentInfoParamType, type GetPullRequestCommentInfoResponseType, type GetPullRequestCommentsListParamType, type GetPullRequestCommentsListResponseType, type GetPullRequestFilesListParamType, type GetPullRequestFilesListResponseType, type GetRepoDefaultBranchParamType, type GetRepoDefaultBranchResponseType, type GetRepoMainLanguageParamType, type GetRepoMainLanguageResponseType, type GetRepoVisibilityParamType, type GetRepoVisibilityResponseType, type GitHubBaseClient, GitHubClient, type GitHubClientType, type GitType, type GitUser, type HttpProxyType, type HttpsProxyType, type IssueCommentInfoParamType, type IssueCommentInfoResponseType, type IssueCommentListParamType, type IssueCommentListResponseType, type IssueInfoParamType, type IssueInfoResponseType, type IssueLabelType, type IssueListResponseType, type IssueNumberParamType, type IssueUser, type LanguageInfo, type LockIssueParamType, type LockIssueResponseType, type MergeMethodType, type MergePullRequestParamType, type MergePullRequestResponseType, type MilestoneType, type OpenIssueParamType, type OpenIssueResponseType, type OrgInfoParamType, type OrgInfoResponseType, type OrgNameParamType, type OrgRepoCreateParamType, type OrgRepoCreateResponseType, type OrgRepoListParmType, type OrgRepoListResponseType, type ParentCommit, type PkgInfoType, type PrRepo, type PrUser, type ProxyParamsType, type ProxyType, type ProxyUrlType, type PullRequestFilesListType, type PullRequestInfoParamType, type PullRequestInfoResponseType, type PullRequestListParamType, type PullRequestListResponseType, type PullRequestNumberParamType, type ReactionInfoType, type RefreshTokenResponseType, type RefreshTokenType, type ReleaseAssetsType, type ReleaseInfoByTagParamType, type ReleaseInfoByTagResponseType, type ReleaseInfoParamType, type ReleaseInfoResponseType, type ReleaseLatestParamTypeType, type ReleaseLatestResponseType, type ReleaseListParamType, type ReleaseListResponseType, type ReleaseUser, type RemoveCollaboratorParamType, type RemoveCollaboratorResponseType, type RemoveIssueCommentParamType, type RemoveIssueCommentResponseType, type RemoveSubIssueParamType, type RemoveSubIssueResponseType, type RepoBaseParamType, type RepoCommentListParamType, type RepoCommentListResponseType, type RepoInfoParamType, type RepoInfoResponseType, type RepoIssueListParamType, type RepoLanguagesListParamType, type RepoLanguagesListResponseType, type RepoListBaseParamType, type RepoNameParamType, type RepoOwnerParamType, type RepoParamType, type RepoUrlParamType, type RepoUser, type ReprioritizeSubIssueParamType, type ReprioritizeSubIssueResponseType, type RequestConfigType, type RequestTokenType, type ResponseHeadersType, type ResponseMsgType, type ResponseStatusCodeType, type ResponseSuccessType, type ResponseType, type ReverseProxyType, type ShaParamType, type Socks5ProxyType, type SocksProxyType, type SubIssueListParamType, type SubIssueListResponseType, type TokenResponseType, type UnLockIssueParamType, type UnLockIssueResponseType, type UpdateIssueCommentParamType, type UpdateIssueCommentResponseType, type UpdateIssueParamType, type UpdateIssueResponseType, type UpdatePullRequestCommentParamType, type UpdatePullRequestCommentResponseType, type UpdatePullRequestParamType, type UpdatePullRequestResponseType, type UpdateReleaseParamType, type UpdateReleaseResponseType, type UserByTokenRepoListParamType, type UserIdParamType, type UserInfoByAuthParamType, type UserInfoByIdParamType, type UserInfoParamType, type UserInfoResponseType, type UserNameParamType, type UserRepoCreateParamType, type UserRepoCreateResponseType, type UserRepoListParamType, type UserRepoListType, type WebHookSignatureParamType, type WebHookSignatureResponseType, create_state_id, Client as default, formatDate, type formatParamType, get_langage_color, get_local_repo_default_branch, get_relative_time, get_remote_repo_default_branch, index as github };
|