@candriajs/git-neko-kit 0.8.3 → 0.8.5
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/dist/index.cjs +6 -6
- package/dist/index.d.ts +178 -172
- package/dist/index.mjs +6 -6
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
@@ -3,8 +3,13 @@ import { ExecException, exec } from 'child_process';
|
|
3
3
|
|
4
4
|
/** 代理地址类型 */
|
5
5
|
type ProxyUrlType = string;
|
6
|
-
/**
|
7
|
-
|
6
|
+
/**
|
7
|
+
* 代理类型:
|
8
|
+
* - reverse: 反向代理
|
9
|
+
* - original: 原始代理
|
10
|
+
* - common: 通用代理
|
11
|
+
*/
|
12
|
+
type ProxyType = 'reverse' | 'original' | 'common';
|
8
13
|
/** Git类型 */
|
9
14
|
type GitType = 'github' | 'gitee' | 'gitcode';
|
10
15
|
/**
|
@@ -250,20 +255,9 @@ interface ClientType {
|
|
250
255
|
}
|
251
256
|
|
252
257
|
/** 用户信息参数类型 */
|
253
|
-
|
254
|
-
/** 授权token */
|
255
|
-
access_token?: AccessTokenType['access_token'];
|
256
|
-
}
|
257
|
-
/** 授权用户信息参数对象类型 */
|
258
|
-
interface UserInfoByAuthParamType {
|
259
|
-
/** 授权token */
|
260
|
-
access_token?: AccessTokenType['access_token'];
|
261
|
-
}
|
258
|
+
type UserInfoParamType = UserNameParamType;
|
262
259
|
/** 通过用户ID 获取用户信息参数类型 */
|
263
|
-
|
264
|
-
/** 授权token */
|
265
|
-
access_token?: AccessTokenType['access_token'];
|
266
|
-
}
|
260
|
+
type UserInfoByIdParamType = UserIdParamType;
|
267
261
|
/** 用户信息响应类型 */
|
268
262
|
interface UserInfoResponseType {
|
269
263
|
/** 账号ID */
|
@@ -541,7 +535,7 @@ type CommitListParamType = RepoParamType & {
|
|
541
535
|
type CommitListResponseType = CommitInfoResponseType[];
|
542
536
|
|
543
537
|
/** 议题用户信息响应类型 */
|
544
|
-
type IssueUser = Omit<UserInfoResponseType, 'bio' | 'blog' | 'followers' | 'following' | 'public_repos'>;
|
538
|
+
type IssueUser = Omit<UserInfoResponseType, 'bio' | 'blog' | 'followers' | 'following' | 'public_repos' | 'type'>;
|
545
539
|
/** 议题标签类型 */
|
546
540
|
interface IssueLabelType {
|
547
541
|
/** 标签ID */
|
@@ -611,6 +605,7 @@ interface IssueInfoResponseType {
|
|
611
605
|
* 议题所有指派人列表
|
612
606
|
* 先不处理,后面再说
|
613
607
|
* */
|
608
|
+
assignees: Array<IssueUser> | null;
|
614
609
|
/** 议题所属里程碑 */
|
615
610
|
milestone: MilestoneType | null;
|
616
611
|
/** 关闭时间 */
|
@@ -895,7 +890,7 @@ interface SubIssueListParamType extends RepoBaseParamType {
|
|
895
890
|
/** 获取子议题列表响应类型 */
|
896
891
|
type SubIssueListResponseType = IssueInfoResponseType[];
|
897
892
|
/** 添加子议题参数类型 */
|
898
|
-
interface
|
893
|
+
interface CreateSubIssueParamType extends RepoBaseParamType {
|
899
894
|
/** 议题ID */
|
900
895
|
issue_number: IssueNumberParamType['issue_number'];
|
901
896
|
/** * 子议题ID */
|
@@ -904,7 +899,7 @@ interface AddSubIssueParamType extends RepoBaseParamType {
|
|
904
899
|
replace_parent: boolean;
|
905
900
|
}
|
906
901
|
/** 添加子议题响应类型 */
|
907
|
-
type
|
902
|
+
type CreateSubIssueResponseType = IssueInfoResponseType;
|
908
903
|
/** 删除子议题参数类型 */
|
909
904
|
interface RemoveSubIssueParamType extends RepoBaseParamType {
|
910
905
|
/** 议题ID */
|
@@ -1006,8 +1001,8 @@ interface RepoInfoResponseType {
|
|
1006
1001
|
interface OrgRepoListParmType extends RepoListBaseParamType {
|
1007
1002
|
/** 组织名称 */
|
1008
1003
|
org: string;
|
1009
|
-
/** 类型,可选all, public, private
|
1010
|
-
type?: 'all' | 'public' | 'private'
|
1004
|
+
/** 类型,可选all, public, private 默认为 all */
|
1005
|
+
type?: 'all' | 'public' | 'private';
|
1011
1006
|
}
|
1012
1007
|
/**
|
1013
1008
|
* 组织仓库列表响应类型
|
@@ -1079,17 +1074,17 @@ type GetRepoDefaultBranchResponseType = RepoInfoResponseType['default_branch'];
|
|
1079
1074
|
type GetRepoMainLanguageParamType = RepoBaseParamType;
|
1080
1075
|
/** 仓库主要语言响应类型 */
|
1081
1076
|
type GetRepoMainLanguageResponseType = RepoInfoResponseType['language'];
|
1077
|
+
/**
|
1078
|
+
* 协作者权限 ,可选 pull,triage, push, maintain, admin,默认pull
|
1079
|
+
* pull - 只读访问,协作者可以查看仓库内容。
|
1080
|
+
* push - 允许推送代码到仓库分支,同时拥有 pull 权限。
|
1081
|
+
* admin - 拥有仓库的完全控制权,包括更改设置和删除仓库。
|
1082
|
+
*/
|
1083
|
+
type CollaboratorPermissionType = 'pull' | 'push' | 'admin';
|
1082
1084
|
/** 协作者参数类型 */
|
1083
1085
|
type CollaboratorParamType = RepoInfoParamType & UserNameParamType & {
|
1084
|
-
/**
|
1085
|
-
|
1086
|
-
* pull - 只读访问,协作者可以查看仓库内容。
|
1087
|
-
* triage - 允许管理议题和拉取请求,包括标记、分配和修改状态。
|
1088
|
-
* push - 允许推送代码到仓库分支,同时拥有 pull 权限。
|
1089
|
-
* maintain - 允许管理仓库中的代码和议题,但不能更改仓库设置。
|
1090
|
-
* admin - 拥有仓库的完全控制权,包括更改设置和删除仓库。
|
1091
|
-
*/
|
1092
|
-
permission?: string;
|
1086
|
+
/** 邀请的权限 */
|
1087
|
+
permission?: CollaboratorPermissionType;
|
1093
1088
|
};
|
1094
1089
|
/** 邀请协作者响应类型 */
|
1095
1090
|
interface AddCollaboratorResponseType {
|
@@ -1105,7 +1100,7 @@ interface AddCollaboratorResponseType {
|
|
1105
1100
|
permissions: string;
|
1106
1101
|
}
|
1107
1102
|
/** 协作者列表参数类型 */
|
1108
|
-
type
|
1103
|
+
type GetCollaboratorListParamType = RepoInfoParamType & {
|
1109
1104
|
/**
|
1110
1105
|
* 筛选按隶属关系返回的协作者
|
1111
1106
|
* outside - 列出所有外部协作者,包括仓库成员和外部 collaborator。
|
@@ -1113,15 +1108,8 @@ type CollaboratorListParamType = RepoInfoParamType & {
|
|
1113
1108
|
* all - 列出仓库成员和外部 collaborator。
|
1114
1109
|
*/
|
1115
1110
|
affiliation?: 'outside' | 'direct' | 'all';
|
1116
|
-
/**
|
1117
|
-
|
1118
|
-
* pull - 只读访问,协作者可以查看仓库内容。
|
1119
|
-
* triage - 允许管理议题和拉取请求,包括标记、分配和修改状态。
|
1120
|
-
* push - 允许推送代码到仓库分支,同时拥有 pull 权限。
|
1121
|
-
* maintain - 允许管理仓库中的代码和议题,但不能更改仓库设置。
|
1122
|
-
* admin - 拥有仓库的完全控制权,包括更改设置和删除仓库。
|
1123
|
-
*/
|
1124
|
-
permission?: 'pull' | 'triage' | 'push' | 'maintain' | 'admin';
|
1111
|
+
/** 权限 */
|
1112
|
+
permission?: CollaboratorPermissionType;
|
1125
1113
|
/** 每页数量 */
|
1126
1114
|
per_page?: number;
|
1127
1115
|
/** 页码 */
|
@@ -1152,11 +1140,9 @@ interface CollaboratorInfoResponseType {
|
|
1152
1140
|
/** 管理权限 */
|
1153
1141
|
admin: boolean;
|
1154
1142
|
};
|
1155
|
-
/** 角色名称 */
|
1156
|
-
role_name: string;
|
1157
1143
|
}
|
1158
1144
|
/** 协作者列表响应类型 */
|
1159
|
-
type
|
1145
|
+
type GetCollaboratorListResponseType = CollaboratorInfoResponseType[];
|
1160
1146
|
/** 移除协作者参数类型 */
|
1161
1147
|
type RemoveCollaboratorParamType = RepoBaseParamType & UserNameParamType;
|
1162
1148
|
/** 移除协作者响应类型 */
|
@@ -1230,19 +1216,30 @@ interface PullRequestInfoResponseType {
|
|
1230
1216
|
merged_at: string | null;
|
1231
1217
|
/** PR作者 */
|
1232
1218
|
user: PrUser;
|
1219
|
+
/** PR的目标分支 */
|
1233
1220
|
base: {
|
1221
|
+
/** 分支标签 */
|
1234
1222
|
label: string;
|
1223
|
+
/** 分支名称 */
|
1235
1224
|
ref: string;
|
1225
|
+
/** 当前分支最新提交的 SHA 值 */
|
1236
1226
|
sha: string;
|
1227
|
+
/** 分支的用户信息 */
|
1237
1228
|
user: PrUser;
|
1229
|
+
/** 分支的仓库信息 */
|
1238
1230
|
repo: PrRepo;
|
1239
1231
|
};
|
1240
1232
|
/** PR的源分支信息 */
|
1241
1233
|
head: {
|
1234
|
+
/** 分支标签 */
|
1242
1235
|
label: string;
|
1236
|
+
/** 分支名称 */
|
1243
1237
|
ref: string;
|
1238
|
+
/** 当前分支最新提交的 SHA 值 */
|
1244
1239
|
sha: string;
|
1240
|
+
/** 分支的用户信息 */
|
1245
1241
|
user: PrUser;
|
1242
|
+
/** 分支的仓库信息 */
|
1246
1243
|
repo: PrRepo;
|
1247
1244
|
};
|
1248
1245
|
/** 指派人 */
|
@@ -1600,8 +1597,6 @@ interface DeleteReleaseResponseType {
|
|
1600
1597
|
}
|
1601
1598
|
|
1602
1599
|
interface WebHookSignatureParamType {
|
1603
|
-
/** WebHook 的 secret */
|
1604
|
-
secret?: string;
|
1605
1600
|
/** 请求体 */
|
1606
1601
|
payload: string;
|
1607
1602
|
/** GitHub 发送的签名头 */
|
@@ -1622,10 +1617,11 @@ interface WebHookSignatureResponseType {
|
|
1622
1617
|
* @returns 格式化后的日期字符串
|
1623
1618
|
* @example
|
1624
1619
|
* ```ts
|
1625
|
-
* console.log(await
|
1620
|
+
* console.log(await format_date('2025-04-16T10:00:00')
|
1621
|
+
* -> '2025-04-16 10:00:00'
|
1626
1622
|
* ```
|
1627
1623
|
*/
|
1628
|
-
declare function
|
1624
|
+
declare function format_date(dateString: string, locale?: string, format?: string): Promise<string>;
|
1629
1625
|
/**
|
1630
1626
|
* 获取相对时间
|
1631
1627
|
* @param dateString - 日期字符串
|
@@ -1644,7 +1640,8 @@ declare function get_relative_time(dateString: string, locale?: string): Promise
|
|
1644
1640
|
* @returns 默认分支名称
|
1645
1641
|
* @example
|
1646
1642
|
* ```ts
|
1647
|
-
* console.log(await get_local_repo_default_branch('/path/to/repo'))
|
1643
|
+
* console.log(await get_local_repo_default_branch('/path/to/repo'))
|
1644
|
+
* -> 'main'
|
1648
1645
|
* ```
|
1649
1646
|
*/
|
1650
1647
|
declare function get_local_repo_default_branch(local_path: string): Promise<string>;
|
@@ -1654,7 +1651,8 @@ declare function get_local_repo_default_branch(local_path: string): Promise<stri
|
|
1654
1651
|
* @returns 默认分支名称
|
1655
1652
|
* @example
|
1656
1653
|
* ```ts
|
1657
|
-
* console.log(await get_remote_repo_default_branch('https://github.com/CandriaJS/git-neko-kit'))
|
1654
|
+
* console.log(await get_remote_repo_default_branch('https://github.com/CandriaJS/git-neko-kit'))
|
1655
|
+
* -> 'main'
|
1658
1656
|
* ```
|
1659
1657
|
*/
|
1660
1658
|
declare function get_remote_repo_default_branch(remote_url: string): Promise<string>;
|
@@ -1664,7 +1662,8 @@ declare function get_remote_repo_default_branch(remote_url: string): Promise<str
|
|
1664
1662
|
* @returns 颜色值的十六进制字符串
|
1665
1663
|
* @example
|
1666
1664
|
* ```ts
|
1667
|
-
* console.log(get_langage_color('JavaScript'))
|
1665
|
+
* console.log(get_langage_color('JavaScript'))
|
1666
|
+
* -> '#f1e05a'
|
1668
1667
|
* ```
|
1669
1668
|
*/
|
1670
1669
|
declare function get_langage_color(language: string): string;
|
@@ -1674,7 +1673,8 @@ declare function get_langage_color(language: string): string;
|
|
1674
1673
|
* @returns 生成的唯一标识符
|
1675
1674
|
* @example
|
1676
1675
|
* ```ts
|
1677
|
-
* const stateId = await create_state_id()
|
1676
|
+
* const stateId = await create_state_id()
|
1677
|
+
* -> '34523452345234523452345234523452'
|
1678
1678
|
* ```
|
1679
1679
|
*/
|
1680
1680
|
declare function create_state_id(): Promise<string>;
|
@@ -1699,7 +1699,7 @@ declare class Auth extends GitHubClient {
|
|
1699
1699
|
* @example
|
1700
1700
|
* ```ts
|
1701
1701
|
* const token = await auth.get_token_by_code({ code: 'code' })
|
1702
|
-
*
|
1702
|
+
* -> { info: '获取'access_token: 'token', refresh_token: 'refresh_token' }
|
1703
1703
|
* ```
|
1704
1704
|
*/
|
1705
1705
|
get_token_by_code(options: AccessCodeType): Promise<ApiResponseType<TokenResponseType>>;
|
@@ -1762,7 +1762,7 @@ declare class Commit extends GitHubClient {
|
|
1762
1762
|
* @example
|
1763
1763
|
* ```ts
|
1764
1764
|
* const commitInfo = await commit.get_commit_info({ owner: 'owner', repo: 'repo' })
|
1765
|
-
*
|
1765
|
+
* -> 提交信息对象
|
1766
1766
|
* ```
|
1767
1767
|
*/
|
1768
1768
|
get_commit_info(options: CommitInfoParamType): Promise<ApiResponseType<CommitInfoResponseType>>;
|
@@ -1784,7 +1784,7 @@ declare class Commit extends GitHubClient {
|
|
1784
1784
|
* @example
|
1785
1785
|
* ```ts
|
1786
1786
|
* const commitList = await commit.get_commit_list({ owner: 'owner', repo:'repo' })
|
1787
|
-
*
|
1787
|
+
* -> 提交对象列表
|
1788
1788
|
* ```
|
1789
1789
|
*/
|
1790
1790
|
get_commit_list(options: CommitListParamType): Promise<ApiResponseType<CommitListResponseType>>;
|
@@ -1816,9 +1816,8 @@ declare class Issue extends GitHubClient {
|
|
1816
1816
|
* @returns 包含Issue信息的响应对象
|
1817
1817
|
* @example
|
1818
1818
|
* ```ts
|
1819
|
-
* const issue = get_issue() // 获取issue实例
|
1820
1819
|
* const res = await issue.get_issue_info({ owner: 'owner', repo:'repo', issue_number:1 })
|
1821
|
-
*
|
1820
|
+
* -> 议题信息对象
|
1822
1821
|
* ```
|
1823
1822
|
*/
|
1824
1823
|
get_issue_info(options: IssueInfoParamType): Promise<ApiResponseType<IssueInfoResponseType>>;
|
@@ -1844,9 +1843,8 @@ declare class Issue extends GitHubClient {
|
|
1844
1843
|
* @returns 包含Issue列表的响应对象
|
1845
1844
|
* @example
|
1846
1845
|
* ```ts
|
1847
|
-
* const issue = get_issue() // 获取issue实例
|
1848
1846
|
* const res = await issue.get_issue_list({ owner: 'owner', repo: 'repo' })
|
1849
|
-
*
|
1847
|
+
* -> 议题信息对象列表
|
1850
1848
|
* ```
|
1851
1849
|
*/
|
1852
1850
|
get_issues_list(options: RepoIssueListParamType): Promise<ApiResponseType<IssueListResponseType>>;
|
@@ -1866,9 +1864,8 @@ declare class Issue extends GitHubClient {
|
|
1866
1864
|
* @returns 包含Issue信息的响应对象
|
1867
1865
|
* @example
|
1868
1866
|
* ```ts
|
1869
|
-
* const issue = get_issue() // 获取issue实例
|
1870
1867
|
* const res = await issue.create_issue({ owner: 'owner', repo:'repo', title:'title', body:'body' })
|
1871
|
-
*
|
1868
|
+
* -> 创建议题信息对象
|
1872
1869
|
* ```
|
1873
1870
|
*/
|
1874
1871
|
create_issue(options: CreteIssueParamType): Promise<ApiResponseType<CreateIssueResponseType>>;
|
@@ -1891,9 +1888,8 @@ declare class Issue extends GitHubClient {
|
|
1891
1888
|
* @returns 包含Issue信息的响应对象
|
1892
1889
|
* @example
|
1893
1890
|
* ```ts
|
1894
|
-
* const issue = get_issue() // 获取issue实例
|
1895
1891
|
* const res = await issue.update_issue({ owner: 'owner', repo:'repo', issue_number:1, title:'title', body:'body' })
|
1896
|
-
*
|
1892
|
+
* -> 更新议题信息对象
|
1897
1893
|
* ```
|
1898
1894
|
*/
|
1899
1895
|
update_issue(options: UpdateIssueParamType): Promise<ApiResponseType<UpdateIssueResponseType>>;
|
@@ -1910,9 +1906,8 @@ declare class Issue extends GitHubClient {
|
|
1910
1906
|
* @returns 包含Issue信息的响应对象
|
1911
1907
|
* @example
|
1912
1908
|
* ```ts
|
1913
|
-
* const issue = get_issue() // 获取issue实例
|
1914
1909
|
* const res = await issue.open_issue({ owner: 'owner', repo:'repo', issue_number:1 })
|
1915
|
-
*
|
1910
|
+
* -> 打开议题信息对象
|
1916
1911
|
* ```
|
1917
1912
|
*/
|
1918
1913
|
open_issue(options: OpenIssueParamType): Promise<ApiResponseType<OpenIssueResponseType>>;
|
@@ -1939,14 +1934,14 @@ declare class Issue extends GitHubClient {
|
|
1939
1934
|
* @returns 包含Issue信息的响应对象
|
1940
1935
|
* @example
|
1941
1936
|
* ```ts
|
1942
|
-
* const issue = get_issue() // 获取issue实例
|
1943
1937
|
* const res = await issue.close_issue({ owner: 'owner', repo:'repo', issue_number:1, state_reason:'completed' })
|
1944
|
-
*
|
1938
|
+
* -> 关闭议题信息对象
|
1945
1939
|
* ```
|
1946
1940
|
*/
|
1947
1941
|
close_issue(options: CloseIssueParamType): Promise<ApiResponseType<CloseIssueResponseType>>;
|
1948
1942
|
/**
|
1949
1943
|
* 锁定一个议题
|
1944
|
+
* @github
|
1950
1945
|
* 仅GitHub平台可用
|
1951
1946
|
* 权限:
|
1952
1947
|
* - Issues: Write
|
@@ -1960,14 +1955,14 @@ declare class Issue extends GitHubClient {
|
|
1960
1955
|
* @returns 锁定状态信息
|
1961
1956
|
* @example
|
1962
1957
|
* ```ts
|
1963
|
-
* const issue = get_issue() // 获取issue实例
|
1964
1958
|
* const res = await issue.lock_issue({ owner: 'owner', repo:'repo', issue_number:1, lock_reason:'off-topic' })
|
1965
|
-
*
|
1959
|
+
* -> 锁定议题信息对象
|
1966
1960
|
* ```
|
1967
1961
|
*/
|
1968
1962
|
lock_issue(options: LockIssueParamType): Promise<ApiResponseType<LockIssueResponseType>>;
|
1969
1963
|
/**
|
1970
1964
|
* 解锁一个议题
|
1965
|
+
* @github
|
1971
1966
|
* 仅GitHub平台可用
|
1972
1967
|
* 权限:
|
1973
1968
|
* - Issues: Write
|
@@ -1980,9 +1975,8 @@ declare class Issue extends GitHubClient {
|
|
1980
1975
|
* @returns 解锁状态信息
|
1981
1976
|
* @example
|
1982
1977
|
* ```ts
|
1983
|
-
* const issue = get_issue() // 获取issue实例
|
1984
1978
|
* const res = await issue.unlock_issue({ owner: 'owner', repo:'repo', issue_number})
|
1985
|
-
*
|
1979
|
+
* -> 解锁议题信息对象
|
1986
1980
|
* ```
|
1987
1981
|
*/
|
1988
1982
|
unlock_issue(options: UnLockIssueParamType): Promise<ApiResponseType<UnLockIssueResponseType>>;
|
@@ -2003,9 +1997,8 @@ declare class Issue extends GitHubClient {
|
|
2003
1997
|
* @returns 包含Issue评论列表的响应对象
|
2004
1998
|
* @example
|
2005
1999
|
* ```ts
|
2006
|
-
* const issue = get_issue() // 获取issue实例
|
2007
2000
|
* const res = await issue.get_issue_comments_list({ owner: 'owner', repo:'repo', issue_number:1 })
|
2008
|
-
*
|
2001
|
+
* -> 议题评论对象列表
|
2009
2002
|
* ```
|
2010
2003
|
*/
|
2011
2004
|
get_repo_comments_list(options: RepoCommentListParamType): Promise<ApiResponseType<RepoCommentListResponseType>>;
|
@@ -2025,9 +2018,8 @@ declare class Issue extends GitHubClient {
|
|
2025
2018
|
* @returns 包含Issue评论列表的响应对象
|
2026
2019
|
* @example
|
2027
2020
|
* ```ts
|
2028
|
-
* const issue = get_issue() // 获取issue实例
|
2029
2021
|
* const res = await issue.get_issue_comments_list({ owner: 'owner', repo:'repo', issue_number:1 })
|
2030
|
-
*
|
2022
|
+
* -> 议题评论对象列表
|
2031
2023
|
* ```
|
2032
2024
|
*/
|
2033
2025
|
get_issue_comments_list(options: IssueCommentListParamType): Promise<ApiResponseType<IssueCommentListResponseType>>;
|
@@ -2044,9 +2036,8 @@ declare class Issue extends GitHubClient {
|
|
2044
2036
|
* @returns Issue评论信息
|
2045
2037
|
* @example
|
2046
2038
|
* ```ts
|
2047
|
-
* const issue = get_issue() // 获取issue实例
|
2048
2039
|
* const res = await issue.get_issue_comment({ owner: 'owner', repo:'repo', comment_id:1 })
|
2049
|
-
*
|
2040
|
+
* -> 议题评论对象
|
2050
2041
|
* ```
|
2051
2042
|
*/
|
2052
2043
|
get_issue_comment_info(options: IssueCommentInfoParamType): Promise<ApiResponseType<IssueCommentInfoResponseType>>;
|
@@ -2066,7 +2057,7 @@ declare class Issue extends GitHubClient {
|
|
2066
2057
|
* ```ts
|
2067
2058
|
* const issue = get_issue() // 获取issue实例
|
2068
2059
|
* const res = await issue.create_issue_comment({ owner: 'owner', repo:'repo', issue_number:1, body:'comment' })
|
2069
|
-
*
|
2060
|
+
* -> 创建议题评论对象
|
2070
2061
|
* ```
|
2071
2062
|
*/
|
2072
2063
|
create_issue_comment(options: CreteIssueCommentParamType): Promise<ApiResponseType<CreteIssueCommentResponseType>>;
|
@@ -2084,9 +2075,8 @@ declare class Issue extends GitHubClient {
|
|
2084
2075
|
* @returns 更新后的Issue评论信息
|
2085
2076
|
* @example
|
2086
2077
|
* ```ts
|
2087
|
-
* const issue = get_issue() // 获取issue实例
|
2088
2078
|
* const res = await issue.update_issue_comment({ owner: 'owner', repo:'repo', comment_id:1, body:'body' })
|
2089
|
-
*
|
2079
|
+
* -> 更新议题评论对象
|
2090
2080
|
* ```
|
2091
2081
|
*/
|
2092
2082
|
update_issue_comment(options: UpdateIssueCommentParamType): Promise<ApiResponseType<UpdateIssueCommentResponseType>>;
|
@@ -2103,9 +2093,8 @@ declare class Issue extends GitHubClient {
|
|
2103
2093
|
* @returns 删除结果信息
|
2104
2094
|
* @example
|
2105
2095
|
* ```ts
|
2106
|
-
* const issue = get_issue() // 获取issue实例
|
2107
2096
|
* const res = awaitissue.remove_issue_comment()
|
2108
|
-
*
|
2097
|
+
* -> 删除议题评论对象
|
2109
2098
|
* ```
|
2110
2099
|
*/
|
2111
2100
|
remove_issue_comment(options: RemoveIssueCommentParamType): Promise<ApiResponseType<RemoveCollaboratorResponseType>>;
|
@@ -2133,14 +2122,13 @@ declare class Issue extends GitHubClient {
|
|
2133
2122
|
* @returns 子议题列表
|
2134
2123
|
* @example
|
2135
2124
|
* ```ts
|
2136
|
-
* const issue = get_issue() // 获取issue实例
|
2137
2125
|
* const res = await issue.get_sub_issue_list({ owner: 'owner', repo:'repo', issue_number:1 })
|
2138
|
-
*
|
2126
|
+
* -> 子议题信息对象列表
|
2139
2127
|
* ```
|
2140
2128
|
*/
|
2141
2129
|
get_sub_issue_list(options: SubIssueListParamType): Promise<ApiResponseType<SubIssueListResponseType>>;
|
2142
2130
|
/**
|
2143
|
-
*
|
2131
|
+
* 创建子议题
|
2144
2132
|
* 添加一个子议题到指定的议题中
|
2145
2133
|
* @github
|
2146
2134
|
* 仅GitHub 平台使用
|
@@ -2155,12 +2143,19 @@ declare class Issue extends GitHubClient {
|
|
2155
2143
|
* @returns 添加结果信息
|
2156
2144
|
* @example
|
2157
2145
|
* ```ts
|
2158
|
-
* const issue = get_issue() // 获取issue实例
|
2159
2146
|
* const res = await issue.add_sub_issue({ owner: 'owner', repo:'repo', issue_number:1, sub_issue_id:1, replace_parent:true })
|
2160
|
-
*
|
2147
|
+
* -> 创建子议题信息对象
|
2161
2148
|
* ```
|
2162
2149
|
*/
|
2163
|
-
|
2150
|
+
create_sub_issue(options: CreateSubIssueParamType): Promise<ApiResponseType<CreateSubIssueResponseType>>;
|
2151
|
+
/**
|
2152
|
+
* 添加子议题
|
2153
|
+
* 添加一个子议题到指定的议题中
|
2154
|
+
* @github
|
2155
|
+
* 仅GitHub 平台使用
|
2156
|
+
* @deprecated 已弃用,请使用`create_sub_issue`方法
|
2157
|
+
*/
|
2158
|
+
add_sub_issue(options: CreateSubIssueParamType): Promise<ApiResponseType<CreateSubIssueResponseType>>;
|
2164
2159
|
/**
|
2165
2160
|
* 删除子议题
|
2166
2161
|
* @github
|
@@ -2175,9 +2170,8 @@ declare class Issue extends GitHubClient {
|
|
2175
2170
|
* @returns 删除结果信息
|
2176
2171
|
* @example
|
2177
2172
|
* ```ts
|
2178
|
-
* const issue = get_issue() // 获取issue实例
|
2179
2173
|
* const res = await issue.remove_sub_issue({ owner: 'owner', repo:'repo', issue_number:1, sub_issue_id:1 })
|
2180
|
-
*
|
2174
|
+
* -> 删除子议题信息对象
|
2181
2175
|
* ```
|
2182
2176
|
*/
|
2183
2177
|
remove_sub_issue(options: RemoveSubIssueParamType): Promise<ApiResponseType<RemoveSubIssueResponseType>>;
|
@@ -2205,9 +2199,8 @@ declare class Issue extends GitHubClient {
|
|
2205
2199
|
* - after_id 指定要在哪个子议题之后插入,传入目标子议题的编号
|
2206
2200
|
* @example
|
2207
2201
|
* ```ts
|
2208
|
-
* const issue = get_issue() // 获取issue实例
|
2209
2202
|
* const res = await issue.reprioritize_sub_issue({ owner: 'owner', repo:'repo', issue_number:1, sub_issue_id:1, before_id:1 })
|
2210
|
-
*
|
2203
|
+
* -> 排序子议题信息对象
|
2211
2204
|
* ```
|
2212
2205
|
*/
|
2213
2206
|
reprioritize_sub_issue(options: ReprioritizeSubIssueParamType): Promise<ApiResponseType<ReprioritizeSubIssueResponseType>>;
|
@@ -2231,7 +2224,7 @@ declare class Org extends GitHubClient {
|
|
2231
2224
|
* @example
|
2232
2225
|
* ```ts
|
2233
2226
|
* const orgInfo = await org.get_org_info({ org: 'org' })
|
2234
|
-
*
|
2227
|
+
* -> 组织信息对象
|
2235
2228
|
* ```
|
2236
2229
|
*/
|
2237
2230
|
get_org_info(options: OrgInfoParamType): Promise<ApiResponseType<OrgInfoResponseType>>;
|
@@ -2246,7 +2239,7 @@ declare class Org extends GitHubClient {
|
|
2246
2239
|
* @example
|
2247
2240
|
* ```ts
|
2248
2241
|
* const orgInfo = await org.add_member({ org: 'org', username: 'username' })
|
2249
|
-
*
|
2242
|
+
* -> 添加组织成员对象
|
2250
2243
|
* ```
|
2251
2244
|
*/
|
2252
2245
|
add_member(options: AddMemberParamType): Promise<ApiResponseType<AddMemberResponseType>>;
|
@@ -2276,9 +2269,8 @@ declare class Pull_Request extends GitHubClient {
|
|
2276
2269
|
* @returns 包含pull_request信息的响应对象
|
2277
2270
|
* @example
|
2278
2271
|
* ```ts
|
2279
|
-
* const pull_request = get_pull_request() // 获取pull_request实例
|
2280
2272
|
* const res = await pull_request.get_pull_request_info({ owner: 'owner', repo:'repo', pr_number:1 })
|
2281
|
-
*
|
2273
|
+
* -> 拉取提交信息对象
|
2282
2274
|
* ```
|
2283
2275
|
*/
|
2284
2276
|
get_pull_request_info(options: PullRequestInfoParamType): Promise<ApiResponseType<PullRequestInfoResponseType>>;
|
@@ -2299,9 +2291,8 @@ declare class Pull_Request extends GitHubClient {
|
|
2299
2291
|
* @returns 包含pull_request信息的响应对象
|
2300
2292
|
* @example
|
2301
2293
|
* ```ts
|
2302
|
-
* const pull_request = get_pull_request() // 获取pull_request实例
|
2303
2294
|
* const res = await pull_request.get_get_pull_request_list({ owner: 'owner', repo:'repo' })
|
2304
|
-
*
|
2295
|
+
* -> 拉取提交信息对象列表
|
2305
2296
|
* ```
|
2306
2297
|
*/
|
2307
2298
|
get_get_pull_request_list(options: PullRequestListParamType): Promise<ApiResponseType<PullRequestListResponseType>>;
|
@@ -2323,9 +2314,8 @@ declare class Pull_Request extends GitHubClient {
|
|
2323
2314
|
* @returns 包含pull_request信息的响应对象
|
2324
2315
|
* @example
|
2325
2316
|
* ```ts
|
2326
|
-
* const pull_request = get_pull_request() // 获取pull_request实例
|
2327
2317
|
* const res = await pull_request.create_pull_requestt({ owner: 'owner', repo:'repo', issue: 1, head: 'head', base: 'base' })
|
2328
|
-
*
|
2318
|
+
* -> 创建拉取提交信息对象
|
2329
2319
|
*/
|
2330
2320
|
create_pull_request(options: CreatePullRequestParamType): Promise<ApiResponseType<CreatePullRequestResponseType>>;
|
2331
2321
|
/**
|
@@ -2341,9 +2331,8 @@ declare class Pull_Request extends GitHubClient {
|
|
2341
2331
|
* @returns 包含pull_request信息的响应对象
|
2342
2332
|
* @example
|
2343
2333
|
* ```ts
|
2344
|
-
* const pull_request = get_pull_request() // 获取pull_request实例
|
2345
2334
|
* const res = await pull_request.create_pull_requestt({ owner: 'owner', repo:'repo', pr_number:1, state:'open' })
|
2346
|
-
*
|
2335
|
+
* -> 更新拉取提交信息对象
|
2347
2336
|
*/
|
2348
2337
|
update_pull_request(options: UpdatePullRequestParamType): Promise<ApiResponseType<UpdatePullRequestResponseType>>;
|
2349
2338
|
/**
|
@@ -2361,9 +2350,8 @@ declare class Pull_Request extends GitHubClient {
|
|
2361
2350
|
* @returns 包含pull_request信息的响应对象
|
2362
2351
|
* @example
|
2363
2352
|
* ```ts
|
2364
|
-
* const pull_request = get_pull_request() // 获取pull_request实例
|
2365
2353
|
* const res = await pull_request.merge_pull_request({ owner: 'owner', repo:'repo', pr_number:1 })
|
2366
|
-
*
|
2354
|
+
* -> 合并拉取提交信息对象
|
2367
2355
|
* ```
|
2368
2356
|
*/
|
2369
2357
|
merge_pull_request(options: MergePullRequestParamType): Promise<ApiResponseType<MergePullRequestResponseType>>;
|
@@ -2380,9 +2368,8 @@ declare class Pull_Request extends GitHubClient {
|
|
2380
2368
|
* @returns 包含拉取请求文件列表的响应对象
|
2381
2369
|
* @example
|
2382
2370
|
* ```ts
|
2383
|
-
* const pull_request = get_pull_request() // 获取pull_request实例
|
2384
2371
|
* const res = await pull_request.get_pull_request_files_list({ owner: 'owner', repo:'repo', pr_number:1 })
|
2385
|
-
*
|
2372
|
+
* -> 拉取提交文件信息对象列表
|
2386
2373
|
* ```
|
2387
2374
|
*/
|
2388
2375
|
get_pull_request_files_list(options: GetPullRequestFilesListParamType): Promise<ApiResponseType<GetPullRequestFilesListResponseType>>;
|
@@ -2397,9 +2384,8 @@ declare class Pull_Request extends GitHubClient {
|
|
2397
2384
|
* @returns 包含拉取请求指定的评论id的信息
|
2398
2385
|
* @example
|
2399
2386
|
* ```ts
|
2400
|
-
* const pull_request = get_pull_request() // 获取pull_request实例
|
2401
2387
|
* const res = await pull_request.get_pull_request_comment_info({ owner: 'owner', repo:'repo', comment_id:1 })
|
2402
|
-
*
|
2388
|
+
* -> 拉取提交评论信息对象
|
2403
2389
|
* ```
|
2404
2390
|
*/
|
2405
2391
|
get_pull_request_comment_info(options: GetPullRequestCommentInfoParamType): Promise<ApiResponseType<GetPullRequestCommentInfoResponseType>>;
|
@@ -2417,9 +2403,8 @@ declare class Pull_Request extends GitHubClient {
|
|
2417
2403
|
* @returns 包含拉取请求评论列表响应信息列表
|
2418
2404
|
* @example
|
2419
2405
|
* ```ts
|
2420
|
-
* const pull_request = get_pull_request() // 获取pull_request实例
|
2421
2406
|
* const res = await pull_request.get_pull_request_comments_list({ owner: 'owner', repo:'repo', pr_number:1 })
|
2422
|
-
*
|
2407
|
+
* -> 拉取提交评论信息对象
|
2423
2408
|
* ```
|
2424
2409
|
*/
|
2425
2410
|
get_pull_request_comments_list(options: GetPullRequestCommentsListParamType): Promise<ApiResponseType<GetPullRequestCommentsListResponseType>>;
|
@@ -2435,9 +2420,8 @@ declare class Pull_Request extends GitHubClient {
|
|
2435
2420
|
* @returns 包含创建拉取请求评论响应信息
|
2436
2421
|
* @example
|
2437
2422
|
* ```ts
|
2438
|
-
* const pull_request = get_pull_request() // 获取pull_request实例
|
2439
2423
|
* const res = await pull_request.create_pull_request_comment({ owner: 'owner', repo:'repo', pr_number:1, body: 'loli' })
|
2440
|
-
*
|
2424
|
+
* -> 创建拉取提交评论信息对象
|
2441
2425
|
* ```
|
2442
2426
|
*/
|
2443
2427
|
create_pull_request_comment(options: CreatePullRequestCommentParamType): Promise<ApiResponseType<CreatePullRequestCommentResponseType>>;
|
@@ -2453,25 +2437,18 @@ declare class Pull_Request extends GitHubClient {
|
|
2453
2437
|
* @returns 包含更新拉取请求评论响应信息
|
2454
2438
|
* @example
|
2455
2439
|
* ```ts
|
2456
|
-
* const pull_request = get_pull_request() // 获取pull_request实例
|
2457
2440
|
* const res = await pull_request.update_pull_request_comment({ owner: 'owner', repo:'repo', comment_id:1, body: 'loli' })
|
2458
|
-
*
|
2441
|
+
* -> 更新拉取提交评论信息对象
|
2459
2442
|
* ```
|
2460
2443
|
*/
|
2461
2444
|
update_pull_request_comment(options: UpdatePullRequestCommentParamType): Promise<ApiResponseType<UpdatePullRequestCommentResponseType>>;
|
2462
2445
|
/**
|
2463
|
-
*
|
2446
|
+
* 编辑拉取请求评论
|
2464
2447
|
* @deprecated 请使用update_issue_comment方法
|
2465
2448
|
* 权限:
|
2466
2449
|
* - Pull requests: Read-And-Write
|
2467
2450
|
* @param options - 删除拉取请求评论参数对象
|
2468
2451
|
* @returns 删除结果
|
2469
|
-
* @example
|
2470
|
-
* ```ts
|
2471
|
-
* const pull_request = get_pull_request() // 获取pull_request实例
|
2472
|
-
* const res = await pull_request. public async edit_pull_request_comment (
|
2473
|
-
({ owner: 'owner', repo:'repo', comment_id:1, body: 'loli' })
|
2474
|
-
* console.log(res) // { data: CreatePullRequestCommentResponseType }
|
2475
2452
|
* ```
|
2476
2453
|
*/
|
2477
2454
|
edit_pull_request_comment(options: UpdatePullRequestCommentParamType): Promise<ApiResponseType<UpdatePullRequestCommentResponseType>>;
|
@@ -2486,9 +2463,8 @@ declare class Pull_Request extends GitHubClient {
|
|
2486
2463
|
* @returns 包含更新拉取请求评论响应信息
|
2487
2464
|
* @example
|
2488
2465
|
* ```ts
|
2489
|
-
* const pull_request = get_pull_request() // 获取pull_request实例
|
2490
2466
|
* const res = await pull_request.delete_pull_request_comment({ owner: 'owner', repo:'repo', comment_id: 1 })
|
2491
|
-
*
|
2467
|
+
* -> 更新拉取提交评论信息对象
|
2492
2468
|
* ```
|
2493
2469
|
*/
|
2494
2470
|
delete_pull_request_comment(options: DeletePullRequestCommentParamType): Promise<ApiResponseType<DeletePullRequestCommentResponseType>>;
|
@@ -2520,7 +2496,7 @@ declare class Repo extends GitHubClient {
|
|
2520
2496
|
* @example
|
2521
2497
|
* ```ts
|
2522
2498
|
* const repos = await repo.get_org_repos_list({ org: 'org' })
|
2523
|
-
*
|
2499
|
+
* -> 组织仓库信息对象列表
|
2524
2500
|
* ```
|
2525
2501
|
*/
|
2526
2502
|
get_org_repos_list(options: OrgRepoListParmType): Promise<ApiResponseType<OrgRepoListResponseType>>;
|
@@ -2539,7 +2515,7 @@ declare class Repo extends GitHubClient {
|
|
2539
2515
|
* @example
|
2540
2516
|
* ```ts
|
2541
2517
|
* const repos = await repo.get_repos_list({ username: 'username' })
|
2542
|
-
*
|
2518
|
+
* -> 用户仓库信息对象列表
|
2543
2519
|
* ```
|
2544
2520
|
*/
|
2545
2521
|
get_user_repos_list_by_token(options?: UserByTokenRepoListParamType): Promise<ApiResponseType<UserRepoListType>>;
|
@@ -2556,6 +2532,11 @@ declare class Repo extends GitHubClient {
|
|
2556
2532
|
* - per_page - 每页数量(1-100), 默认值:30
|
2557
2533
|
* - page - 页码 默认值:1
|
2558
2534
|
* @returns 用户仓库列表
|
2535
|
+
* @example
|
2536
|
+
* ```ts
|
2537
|
+
* const repos = await github.get_user_repos_list({ username: 'loli' })
|
2538
|
+
* -> 用户仓库信息对象列表
|
2539
|
+
* ```
|
2559
2540
|
*/
|
2560
2541
|
get_user_repos_list(options: UserRepoListParamType): Promise<ApiResponseType<UserRepoListType>>;
|
2561
2542
|
/**
|
@@ -2568,7 +2549,7 @@ declare class Repo extends GitHubClient {
|
|
2568
2549
|
* @example
|
2569
2550
|
* ```ts
|
2570
2551
|
* const repo = await repo.get_repo_info({ owner: 'owner', repo: 'repo' })
|
2571
|
-
*
|
2552
|
+
* -> 仓库信息对象
|
2572
2553
|
* ```
|
2573
2554
|
*/
|
2574
2555
|
get_repo_info(options: RepoInfoParamType): Promise<ApiResponseType<RepoInfoResponseType>>;
|
@@ -2582,7 +2563,7 @@ declare class Repo extends GitHubClient {
|
|
2582
2563
|
* @example
|
2583
2564
|
* ```ts
|
2584
2565
|
* const repo = await repo.get_repo_languages_list({ owner: 'owner', repo: 'repo' })
|
2585
|
-
*
|
2566
|
+
* -> 仓库语言对象列表
|
2586
2567
|
* ```
|
2587
2568
|
*/
|
2588
2569
|
get_repo_languages_list(options: RepoLanguagesListParamType): Promise<ApiResponseType<RepoLanguagesListResponseType>>;
|
@@ -2600,6 +2581,11 @@ declare class Repo extends GitHubClient {
|
|
2600
2581
|
* - has_wiki: 是否启用wiki功能, 默认值:true
|
2601
2582
|
* - auto_init: 是否自动初始化仓库 默认值:false
|
2602
2583
|
* @returns 返回创建成功的仓库信息
|
2584
|
+
* @example
|
2585
|
+
* ```ts
|
2586
|
+
* const repoInfo = await org.create_org_repo({org: 'loli', repo: 'git-neko-kit'})
|
2587
|
+
* -> 创建组织仓库信息对象
|
2588
|
+
* ```
|
2603
2589
|
*/
|
2604
2590
|
create_org_repo(options: OrgRepoCreateParamType): Promise<ApiResponseType<OrgRepoCreateResponseType>>;
|
2605
2591
|
/**
|
@@ -2616,6 +2602,11 @@ declare class Repo extends GitHubClient {
|
|
2616
2602
|
* - has_wiki: 是否启用wiki功能, 默认值:true
|
2617
2603
|
* - auto_init: 是否自动初始化仓库 默认值:false
|
2618
2604
|
* @returns 返回创建成功的仓库信息
|
2605
|
+
* @example
|
2606
|
+
* ```ts
|
2607
|
+
* const repoInfo = await repo.create_user_repo({org: 'loli', repo: 'git-neko-kit'})
|
2608
|
+
* -> 创建用户仓库信息对象
|
2609
|
+
* ```
|
2619
2610
|
*/
|
2620
2611
|
create_user_repo(options: UserRepoCreateParamType): Promise<ApiResponseType<UserRepoCreateResponseType>>;
|
2621
2612
|
/**
|
@@ -2652,10 +2643,10 @@ declare class Repo extends GitHubClient {
|
|
2652
2643
|
* @example
|
2653
2644
|
* ```ts
|
2654
2645
|
* const result = await collaborator.get_collaborators_list(options)
|
2655
|
-
*
|
2646
|
+
* -> 仓库协作者信息对象列表
|
2656
2647
|
* ```
|
2657
2648
|
*/
|
2658
|
-
get_collaborators_list(options:
|
2649
|
+
get_collaborators_list(options: GetCollaboratorListParamType): Promise<ApiResponseType<GetCollaboratorListResponseType>>;
|
2659
2650
|
/**
|
2660
2651
|
* 邀请协作者
|
2661
2652
|
* 权限:
|
@@ -2676,7 +2667,7 @@ declare class Repo extends GitHubClient {
|
|
2676
2667
|
* username: 'username',
|
2677
2668
|
* permission: 'pull'
|
2678
2669
|
* })
|
2679
|
-
*
|
2670
|
+
* -> 邀请仓库协作者信息对象
|
2680
2671
|
* ```
|
2681
2672
|
*/
|
2682
2673
|
add_collaborator(options: CollaboratorParamType): Promise<ApiResponseType<AddCollaboratorResponseType>>;
|
@@ -2687,8 +2678,6 @@ declare class Repo extends GitHubClient {
|
|
2687
2678
|
* @param options 删除协作者对象
|
2688
2679
|
* - owner: 仓库拥有者
|
2689
2680
|
* - repo: 仓库名称
|
2690
|
-
* - url: 仓库地址
|
2691
|
-
* owner和repo或者url选择一个即可
|
2692
2681
|
* - username: 要删除协作者用户名
|
2693
2682
|
* @returns 返回删除协作者结果
|
2694
2683
|
* @example
|
@@ -2698,7 +2687,7 @@ declare class Repo extends GitHubClient {
|
|
2698
2687
|
* repo:'repo',
|
2699
2688
|
* username: 'username'
|
2700
2689
|
* })
|
2701
|
-
*
|
2690
|
+
* -> 移除仓库协作者信息对象
|
2702
2691
|
* ```
|
2703
2692
|
*/
|
2704
2693
|
remove_collaborator(options: RemoveCollaboratorParamType): Promise<ApiResponseType<RemoveCollaboratorResponseType>>;
|
@@ -2707,15 +2696,6 @@ declare class Repo extends GitHubClient {
|
|
2707
2696
|
* @deprecated 请使用remove_collaborator方法
|
2708
2697
|
* @param options 删除协作者对象
|
2709
2698
|
* @returns 返回删除协作者结果
|
2710
|
-
* @example
|
2711
|
-
* ```ts
|
2712
|
-
* const result = await collaborator.delete_collaborator({
|
2713
|
-
* owner: 'owner',
|
2714
|
-
* repo:'repo',
|
2715
|
-
* username: 'username'
|
2716
|
-
* })
|
2717
|
-
* console.log(result)
|
2718
|
-
* ```
|
2719
2699
|
*/
|
2720
2700
|
delete_collaborator(options: RemoveCollaboratorParamType): Promise<ApiResponseType<RemoveCollaboratorResponseType>>;
|
2721
2701
|
/**
|
@@ -2731,8 +2711,12 @@ declare class Repo extends GitHubClient {
|
|
2731
2711
|
* @returns 仓库可见性,
|
2732
2712
|
* @example
|
2733
2713
|
* ```ts
|
2714
|
+
* // 公开仓库
|
2715
|
+
* const visibility = await repo.get_repo_visibility({url: 'https://github.com/CandriaJS/git-neko-kit'})
|
2716
|
+
* -> 'public'
|
2717
|
+
* // 私有仓库
|
2734
2718
|
* const visibility = await repo.get_repo_visibility({url: 'https://github.com/CandriaJS/git-neko-kit'})
|
2735
|
-
*
|
2719
|
+
* -> 'private'
|
2736
2720
|
* ```
|
2737
2721
|
*/
|
2738
2722
|
get_repo_visibility(options: GetRepoVisibilityParamType): Promise<GetRepoVisibilityResponseType>;
|
@@ -2746,7 +2730,7 @@ declare class Repo extends GitHubClient {
|
|
2746
2730
|
* @example
|
2747
2731
|
* ```ts
|
2748
2732
|
* const defaultBranch = await repo.get_repo_default_branch({owner: CandriaJS, repo: meme-plugin)}
|
2749
|
-
*
|
2733
|
+
* -> 'main'
|
2750
2734
|
* ```ts
|
2751
2735
|
*/
|
2752
2736
|
get_repo_default_branch(options: GetRepoDefaultBranchParamType): Promise<GetRepoDefaultBranchResponseType | null>;
|
@@ -2762,7 +2746,7 @@ declare class Repo extends GitHubClient {
|
|
2762
2746
|
* @example
|
2763
2747
|
* ```ts
|
2764
2748
|
* const language = await repo.get_repo_language({url: 'URL_ADDRESS.com/CandriaJS/meme-plugin')}
|
2765
|
-
*
|
2749
|
+
* -> 'JavaScript'
|
2766
2750
|
* ```ts
|
2767
2751
|
*/
|
2768
2752
|
get_repo_main_language(options: GetRepoMainLanguageParamType): Promise<GetRepoMainLanguageResponseType>;
|
@@ -2786,7 +2770,7 @@ declare class User extends GitHubClient {
|
|
2786
2770
|
* @example
|
2787
2771
|
* ```ts
|
2788
2772
|
* const userInfo = await user.get_user_info({ username: 'username' })
|
2789
|
-
*
|
2773
|
+
* -> 用户信息对象
|
2790
2774
|
* ```
|
2791
2775
|
*/
|
2792
2776
|
get_user_info(options: UserInfoParamType): Promise<ApiResponseType<UserInfoResponseType>>;
|
@@ -2800,7 +2784,7 @@ declare class User extends GitHubClient {
|
|
2800
2784
|
* @example
|
2801
2785
|
* ```ts
|
2802
2786
|
* const userInfo = await user.get_user_info_by_user_id({ user_id: 123456789 })
|
2803
|
-
*
|
2787
|
+
* -> 用户信息对象
|
2804
2788
|
* ```
|
2805
2789
|
*/
|
2806
2790
|
get_user_info_by_user_id(options: UserInfoByIdParamType): Promise<ApiResponseType<UserInfoResponseType>>;
|
@@ -2810,7 +2794,7 @@ declare class User extends GitHubClient {
|
|
2810
2794
|
* @example
|
2811
2795
|
* ```ts
|
2812
2796
|
* const userInfo = await user.get_user_info_by_token()
|
2813
|
-
*
|
2797
|
+
* -> 用户信息对象
|
2814
2798
|
* ```
|
2815
2799
|
*/
|
2816
2800
|
get_user_info_by_auth(): Promise<ApiResponseType<UserInfoResponseType>>;
|
@@ -2818,10 +2802,6 @@ declare class User extends GitHubClient {
|
|
2818
2802
|
* 通过访问令牌获取用户信息
|
2819
2803
|
* 权限:无需任何权限
|
2820
2804
|
* @deprecated 该方法已过时,请使用get_user_info_by_auth方法牌
|
2821
|
-
* @example
|
2822
|
-
* ```ts
|
2823
|
-
* const userInfo = await user.get_user_info_by_token()
|
2824
|
-
* console.log(userInfo)
|
2825
2805
|
* ```
|
2826
2806
|
*/
|
2827
2807
|
get_user_info_by_token(): Promise<ApiResponseType<UserInfoResponseType>>;
|
@@ -2834,7 +2814,14 @@ declare class User extends GitHubClient {
|
|
2834
2814
|
* @example
|
2835
2815
|
* ```ts
|
2836
2816
|
* const contribution = await user.get_user_contribution({ username: 'username' })
|
2837
|
-
*
|
2817
|
+
* ->
|
2818
|
+
* {
|
2819
|
+
* success: true,
|
2820
|
+
* status: 'ok',
|
2821
|
+
* statusCode: 200,
|
2822
|
+
* msg: '请求成功',
|
2823
|
+
* data: { total: 5, contributions: [[{ date: '2023-04-16', count: 5 }]] }
|
2824
|
+
* }
|
2838
2825
|
* ```
|
2839
2826
|
*/
|
2840
2827
|
get_user_contribution(options: UserNameParamType): Promise<ApiResponseType<ContributionResult>>;
|
@@ -2846,9 +2833,9 @@ declare class User extends GitHubClient {
|
|
2846
2833
|
* @example
|
2847
2834
|
* ```ts
|
2848
2835
|
* const userId = await user.get_user_id()
|
2849
|
-
*
|
2836
|
+
* -> 114514
|
2850
2837
|
*/
|
2851
|
-
get_user_id(): Promise<number
|
2838
|
+
get_user_id(): Promise<number>;
|
2852
2839
|
/**
|
2853
2840
|
* 快速获取获取用户名
|
2854
2841
|
* 权限:无需任何权限
|
@@ -2857,20 +2844,19 @@ declare class User extends GitHubClient {
|
|
2857
2844
|
* @example
|
2858
2845
|
* ```ts
|
2859
2846
|
* const username = await user.get_username()
|
2860
|
-
*
|
2847
|
+
* -> 'loli'
|
2861
2848
|
* ```
|
2862
2849
|
*/
|
2863
|
-
get_username(): Promise<string
|
2850
|
+
get_username(): Promise<string>;
|
2864
2851
|
/**
|
2865
2852
|
* 快速获取获取用户昵称
|
2866
2853
|
* 该方法会自动获取当前用户的昵称,需要传入token
|
2867
2854
|
* 权限:无需任何权限
|
2868
|
-
* @remarks 用户昵称可能会为null
|
2869
2855
|
* @returns 昵称
|
2870
2856
|
* @example
|
2871
2857
|
* ```ts
|
2872
2858
|
* const nickname = await user.get_nickname()
|
2873
|
-
*
|
2859
|
+
* -> 'loli'
|
2874
2860
|
* ```
|
2875
2861
|
*/
|
2876
2862
|
get_nickname(): Promise<string | null>;
|
@@ -2882,7 +2868,7 @@ declare class User extends GitHubClient {
|
|
2882
2868
|
* @example
|
2883
2869
|
* ```ts
|
2884
2870
|
* const email = await user.get_email()
|
2885
|
-
*
|
2871
|
+
* -> '114514@gmail.com'
|
2886
2872
|
* ```
|
2887
2873
|
*/
|
2888
2874
|
get_user_email(): Promise<string | null>;
|
@@ -2894,7 +2880,7 @@ declare class User extends GitHubClient {
|
|
2894
2880
|
* @example
|
2895
2881
|
* ```ts
|
2896
2882
|
* const avatarUrl = await user.get_avatar_url()
|
2897
|
-
*
|
2883
|
+
* -> 'https://avatars.githubusercontent.com/u/12345678?v=4'
|
2898
2884
|
* ```
|
2899
2885
|
*/
|
2900
2886
|
get_avatar_url(): Promise<string>;
|
@@ -2912,7 +2898,6 @@ declare class WebHook extends GitHubClient {
|
|
2912
2898
|
* 检查WebHook签名是否正确
|
2913
2899
|
* 权限:无需任何权限
|
2914
2900
|
* @param options - WebHook参数对象,必须包含以下参数:
|
2915
|
-
* - secret: WebHook的密钥, 可以从Base类入口传递
|
2916
2901
|
* - payload: 要验证的签名主体
|
2917
2902
|
* - signature: 要验证的签名
|
2918
2903
|
* @returns 验证结果
|
@@ -2923,6 +2908,16 @@ declare class WebHook extends GitHubClient {
|
|
2923
2908
|
* payload: 'your_payload',
|
2924
2909
|
* signature: 'your_signature'
|
2925
2910
|
* })
|
2911
|
+
* ->
|
2912
|
+
* {
|
2913
|
+
* success: true,
|
2914
|
+
* status: 'ok',
|
2915
|
+
* msg: '请求成功'
|
2916
|
+
* data: {
|
2917
|
+
* success: true,
|
2918
|
+
* info: '验证成功'
|
2919
|
+
* }
|
2920
|
+
* }
|
2926
2921
|
* ```
|
2927
2922
|
*/
|
2928
2923
|
check_webhook_signature(options: WebHookSignatureParamType): Promise<ApiResponseType<WebHookSignatureResponseType>>;
|
@@ -3164,9 +3159,15 @@ declare class App extends GitHubClient {
|
|
3164
3159
|
/**
|
3165
3160
|
* 获取应用基本信息
|
3166
3161
|
* 权限:
|
3167
|
-
* - `none`
|
3162
|
+
* - `none` 无
|
3168
3163
|
* @param options - 应用标识符
|
3169
3164
|
* @returns 应用基本信息
|
3165
|
+
* @example
|
3166
|
+
* ```ts
|
3167
|
+
* const app = base.get_app()
|
3168
|
+
* console.log(app.get_app_info({ app_slug: 'loli' }))
|
3169
|
+
* -> app的信息
|
3170
|
+
* ```
|
3170
3171
|
*/
|
3171
3172
|
get_app_info(options: AppInfoParamType): Promise<ApiResponseType<AppInfoResponseType>>;
|
3172
3173
|
/**
|
@@ -3177,7 +3178,8 @@ declare class App extends GitHubClient {
|
|
3177
3178
|
* @example
|
3178
3179
|
* ```ts
|
3179
3180
|
* const app = base.get_app()
|
3180
|
-
* console.log(app.get_app_info_by_auth())
|
3181
|
+
* console.log(app.get_app_info_by_auth())
|
3182
|
+
* -> app的信息
|
3181
3183
|
* ```
|
3182
3184
|
*/
|
3183
3185
|
private get_app_info_by_auth;
|
@@ -3188,8 +3190,6 @@ declare class App extends GitHubClient {
|
|
3188
3190
|
* @param options - 仓库安装应用参数对象
|
3189
3191
|
* - owner 拥有者
|
3190
3192
|
* - repo 仓库名
|
3191
|
-
* - url 仓库地址
|
3192
|
-
* ownwe和repo与url只能二选一
|
3193
3193
|
* @returns 返回应用安装信息
|
3194
3194
|
* @example
|
3195
3195
|
* ```ts
|
@@ -3201,9 +3201,12 @@ declare class App extends GitHubClient {
|
|
3201
3201
|
/**
|
3202
3202
|
* 生成Github App 安装链接
|
3203
3203
|
* @param state_id - 随机生成的 state_id,用于验证授权请求的状态,可选,默认不使用
|
3204
|
-
* @returns 返回安装链接对象
|
3205
|
-
* @returns state_id 随机生成的字符串,用于验证
|
3206
3204
|
* @returns install_link 安装链接,用于跳转 Github 安装页
|
3205
|
+
* @example
|
3206
|
+
* ```ts
|
3207
|
+
* const link = await app.create_install_link('state_id')
|
3208
|
+
* -> https://github.com/apps/<app_name>/installations/new?state=<state_id>
|
3209
|
+
* ```
|
3207
3210
|
*/
|
3208
3211
|
create_install_link(state_id?: string): Promise<string>;
|
3209
3212
|
/**
|
@@ -3214,7 +3217,7 @@ declare class App extends GitHubClient {
|
|
3214
3217
|
* @example
|
3215
3218
|
* ```ts
|
3216
3219
|
* const link = await app.create_config_install_link('state_id')
|
3217
|
-
*
|
3220
|
+
* -> // https://github.com/apps/<app_name>/installations/new?state=<state_id></state_id>
|
3218
3221
|
* ```
|
3219
3222
|
*/
|
3220
3223
|
create_config_install_link(state_id?: string): Promise<string>;
|
@@ -3223,8 +3226,8 @@ declare class App extends GitHubClient {
|
|
3223
3226
|
* @returns 返回 Github App 名称
|
3224
3227
|
* @example
|
3225
3228
|
* ```ts
|
3226
|
-
*
|
3227
|
-
*
|
3229
|
+
* console.log(app.get_app_name())
|
3230
|
+
* -> 输出AppName
|
3228
3231
|
* ```
|
3229
3232
|
*/
|
3230
3233
|
get_app_name(): Promise<string>;
|
@@ -3236,9 +3239,12 @@ declare class App extends GitHubClient {
|
|
3236
3239
|
* @returns 是否安装
|
3237
3240
|
* @example
|
3238
3241
|
* ```ts
|
3242
|
+
* // 当前App已安装在此仓库
|
3243
|
+
* const isInstalled = await app.is_app_inttalled_in_repo({ owner: 'owner', repo: 'repo' })
|
3244
|
+
* -> true
|
3245
|
+
* // 当前App未安装此仓库
|
3239
3246
|
* const isInstalled = await app.is_app_inttalled_in_repo({ owner: 'owner', repo: 'repo' })
|
3240
|
-
*
|
3241
|
-
* ·
|
3247
|
+
* -> false
|
3242
3248
|
*/
|
3243
3249
|
is_app_installed_in_repo(options: RepoBaseParamType): Promise<boolean>;
|
3244
3250
|
}
|
@@ -3273,4 +3279,4 @@ declare class Client {
|
|
3273
3279
|
constructor(options: ClientType);
|
3274
3280
|
}
|
3275
3281
|
|
3276
|
-
export { type AccessCodeType, type AccessTokenClentTYpe, type AccessTokenType, type AddCollaboratorResponseType, type AddMemberParamType, type AddMemberResponseType, type
|
3282
|
+
export { type AccessCodeType, type AccessTokenClentTYpe, type AccessTokenType, type AddCollaboratorResponseType, type AddMemberParamType, type AddMemberResponseType, 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 CollaboratorParamType, type CollaboratorPermissionType, 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 CreateSubIssueParamType, type CreateSubIssueResponseType, type CreteIssueCommentParamType, type CreteIssueCommentResponseType, type CreteIssueParamType, type DeletePullRequestCommentParamType, type DeletePullRequestCommentResponseType, type DeleteReleaseParamType, type DeleteReleaseResponseType, type DiffEntry, type ExecOptions, type ExecReturn, type ExecType, type GetCollaboratorListParamType, type GetCollaboratorListResponseType, 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 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, type formatParamType, format_date, get_langage_color, get_local_repo_default_branch, get_relative_time, get_remote_repo_default_branch, index as github };
|