@candriajs/git-neko-kit 0.8.4 → 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 +161 -146
- 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 */
|
@@ -896,7 +890,7 @@ interface SubIssueListParamType extends RepoBaseParamType {
|
|
896
890
|
/** 获取子议题列表响应类型 */
|
897
891
|
type SubIssueListResponseType = IssueInfoResponseType[];
|
898
892
|
/** 添加子议题参数类型 */
|
899
|
-
interface
|
893
|
+
interface CreateSubIssueParamType extends RepoBaseParamType {
|
900
894
|
/** 议题ID */
|
901
895
|
issue_number: IssueNumberParamType['issue_number'];
|
902
896
|
/** * 子议题ID */
|
@@ -905,7 +899,7 @@ interface AddSubIssueParamType extends RepoBaseParamType {
|
|
905
899
|
replace_parent: boolean;
|
906
900
|
}
|
907
901
|
/** 添加子议题响应类型 */
|
908
|
-
type
|
902
|
+
type CreateSubIssueResponseType = IssueInfoResponseType;
|
909
903
|
/** 删除子议题参数类型 */
|
910
904
|
interface RemoveSubIssueParamType extends RepoBaseParamType {
|
911
905
|
/** 议题ID */
|
@@ -1089,6 +1083,7 @@ type GetRepoMainLanguageResponseType = RepoInfoResponseType['language'];
|
|
1089
1083
|
type CollaboratorPermissionType = 'pull' | 'push' | 'admin';
|
1090
1084
|
/** 协作者参数类型 */
|
1091
1085
|
type CollaboratorParamType = RepoInfoParamType & UserNameParamType & {
|
1086
|
+
/** 邀请的权限 */
|
1092
1087
|
permission?: CollaboratorPermissionType;
|
1093
1088
|
};
|
1094
1089
|
/** 邀请协作者响应类型 */
|
@@ -1221,19 +1216,30 @@ interface PullRequestInfoResponseType {
|
|
1221
1216
|
merged_at: string | null;
|
1222
1217
|
/** PR作者 */
|
1223
1218
|
user: PrUser;
|
1219
|
+
/** PR的目标分支 */
|
1224
1220
|
base: {
|
1221
|
+
/** 分支标签 */
|
1225
1222
|
label: string;
|
1223
|
+
/** 分支名称 */
|
1226
1224
|
ref: string;
|
1225
|
+
/** 当前分支最新提交的 SHA 值 */
|
1227
1226
|
sha: string;
|
1227
|
+
/** 分支的用户信息 */
|
1228
1228
|
user: PrUser;
|
1229
|
+
/** 分支的仓库信息 */
|
1229
1230
|
repo: PrRepo;
|
1230
1231
|
};
|
1231
1232
|
/** PR的源分支信息 */
|
1232
1233
|
head: {
|
1234
|
+
/** 分支标签 */
|
1233
1235
|
label: string;
|
1236
|
+
/** 分支名称 */
|
1234
1237
|
ref: string;
|
1238
|
+
/** 当前分支最新提交的 SHA 值 */
|
1235
1239
|
sha: string;
|
1240
|
+
/** 分支的用户信息 */
|
1236
1241
|
user: PrUser;
|
1242
|
+
/** 分支的仓库信息 */
|
1237
1243
|
repo: PrRepo;
|
1238
1244
|
};
|
1239
1245
|
/** 指派人 */
|
@@ -1591,8 +1597,6 @@ interface DeleteReleaseResponseType {
|
|
1591
1597
|
}
|
1592
1598
|
|
1593
1599
|
interface WebHookSignatureParamType {
|
1594
|
-
/** WebHook 的 secret */
|
1595
|
-
secret?: string;
|
1596
1600
|
/** 请求体 */
|
1597
1601
|
payload: string;
|
1598
1602
|
/** GitHub 发送的签名头 */
|
@@ -1613,10 +1617,11 @@ interface WebHookSignatureResponseType {
|
|
1613
1617
|
* @returns 格式化后的日期字符串
|
1614
1618
|
* @example
|
1615
1619
|
* ```ts
|
1616
|
-
* console.log(await
|
1620
|
+
* console.log(await format_date('2025-04-16T10:00:00')
|
1621
|
+
* -> '2025-04-16 10:00:00'
|
1617
1622
|
* ```
|
1618
1623
|
*/
|
1619
|
-
declare function
|
1624
|
+
declare function format_date(dateString: string, locale?: string, format?: string): Promise<string>;
|
1620
1625
|
/**
|
1621
1626
|
* 获取相对时间
|
1622
1627
|
* @param dateString - 日期字符串
|
@@ -1635,7 +1640,8 @@ declare function get_relative_time(dateString: string, locale?: string): Promise
|
|
1635
1640
|
* @returns 默认分支名称
|
1636
1641
|
* @example
|
1637
1642
|
* ```ts
|
1638
|
-
* 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'
|
1639
1645
|
* ```
|
1640
1646
|
*/
|
1641
1647
|
declare function get_local_repo_default_branch(local_path: string): Promise<string>;
|
@@ -1645,7 +1651,8 @@ declare function get_local_repo_default_branch(local_path: string): Promise<stri
|
|
1645
1651
|
* @returns 默认分支名称
|
1646
1652
|
* @example
|
1647
1653
|
* ```ts
|
1648
|
-
* 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'
|
1649
1656
|
* ```
|
1650
1657
|
*/
|
1651
1658
|
declare function get_remote_repo_default_branch(remote_url: string): Promise<string>;
|
@@ -1655,7 +1662,8 @@ declare function get_remote_repo_default_branch(remote_url: string): Promise<str
|
|
1655
1662
|
* @returns 颜色值的十六进制字符串
|
1656
1663
|
* @example
|
1657
1664
|
* ```ts
|
1658
|
-
* console.log(get_langage_color('JavaScript'))
|
1665
|
+
* console.log(get_langage_color('JavaScript'))
|
1666
|
+
* -> '#f1e05a'
|
1659
1667
|
* ```
|
1660
1668
|
*/
|
1661
1669
|
declare function get_langage_color(language: string): string;
|
@@ -1665,7 +1673,8 @@ declare function get_langage_color(language: string): string;
|
|
1665
1673
|
* @returns 生成的唯一标识符
|
1666
1674
|
* @example
|
1667
1675
|
* ```ts
|
1668
|
-
* const stateId = await create_state_id()
|
1676
|
+
* const stateId = await create_state_id()
|
1677
|
+
* -> '34523452345234523452345234523452'
|
1669
1678
|
* ```
|
1670
1679
|
*/
|
1671
1680
|
declare function create_state_id(): Promise<string>;
|
@@ -1690,7 +1699,7 @@ declare class Auth extends GitHubClient {
|
|
1690
1699
|
* @example
|
1691
1700
|
* ```ts
|
1692
1701
|
* const token = await auth.get_token_by_code({ code: 'code' })
|
1693
|
-
*
|
1702
|
+
* -> { info: '获取'access_token: 'token', refresh_token: 'refresh_token' }
|
1694
1703
|
* ```
|
1695
1704
|
*/
|
1696
1705
|
get_token_by_code(options: AccessCodeType): Promise<ApiResponseType<TokenResponseType>>;
|
@@ -1753,7 +1762,7 @@ declare class Commit extends GitHubClient {
|
|
1753
1762
|
* @example
|
1754
1763
|
* ```ts
|
1755
1764
|
* const commitInfo = await commit.get_commit_info({ owner: 'owner', repo: 'repo' })
|
1756
|
-
*
|
1765
|
+
* -> 提交信息对象
|
1757
1766
|
* ```
|
1758
1767
|
*/
|
1759
1768
|
get_commit_info(options: CommitInfoParamType): Promise<ApiResponseType<CommitInfoResponseType>>;
|
@@ -1775,7 +1784,7 @@ declare class Commit extends GitHubClient {
|
|
1775
1784
|
* @example
|
1776
1785
|
* ```ts
|
1777
1786
|
* const commitList = await commit.get_commit_list({ owner: 'owner', repo:'repo' })
|
1778
|
-
*
|
1787
|
+
* -> 提交对象列表
|
1779
1788
|
* ```
|
1780
1789
|
*/
|
1781
1790
|
get_commit_list(options: CommitListParamType): Promise<ApiResponseType<CommitListResponseType>>;
|
@@ -1807,9 +1816,8 @@ declare class Issue extends GitHubClient {
|
|
1807
1816
|
* @returns 包含Issue信息的响应对象
|
1808
1817
|
* @example
|
1809
1818
|
* ```ts
|
1810
|
-
* const issue = get_issue() // 获取issue实例
|
1811
1819
|
* const res = await issue.get_issue_info({ owner: 'owner', repo:'repo', issue_number:1 })
|
1812
|
-
*
|
1820
|
+
* -> 议题信息对象
|
1813
1821
|
* ```
|
1814
1822
|
*/
|
1815
1823
|
get_issue_info(options: IssueInfoParamType): Promise<ApiResponseType<IssueInfoResponseType>>;
|
@@ -1835,9 +1843,8 @@ declare class Issue extends GitHubClient {
|
|
1835
1843
|
* @returns 包含Issue列表的响应对象
|
1836
1844
|
* @example
|
1837
1845
|
* ```ts
|
1838
|
-
* const issue = get_issue() // 获取issue实例
|
1839
1846
|
* const res = await issue.get_issue_list({ owner: 'owner', repo: 'repo' })
|
1840
|
-
*
|
1847
|
+
* -> 议题信息对象列表
|
1841
1848
|
* ```
|
1842
1849
|
*/
|
1843
1850
|
get_issues_list(options: RepoIssueListParamType): Promise<ApiResponseType<IssueListResponseType>>;
|
@@ -1857,9 +1864,8 @@ declare class Issue extends GitHubClient {
|
|
1857
1864
|
* @returns 包含Issue信息的响应对象
|
1858
1865
|
* @example
|
1859
1866
|
* ```ts
|
1860
|
-
* const issue = get_issue() // 获取issue实例
|
1861
1867
|
* const res = await issue.create_issue({ owner: 'owner', repo:'repo', title:'title', body:'body' })
|
1862
|
-
*
|
1868
|
+
* -> 创建议题信息对象
|
1863
1869
|
* ```
|
1864
1870
|
*/
|
1865
1871
|
create_issue(options: CreteIssueParamType): Promise<ApiResponseType<CreateIssueResponseType>>;
|
@@ -1882,9 +1888,8 @@ declare class Issue extends GitHubClient {
|
|
1882
1888
|
* @returns 包含Issue信息的响应对象
|
1883
1889
|
* @example
|
1884
1890
|
* ```ts
|
1885
|
-
* const issue = get_issue() // 获取issue实例
|
1886
1891
|
* const res = await issue.update_issue({ owner: 'owner', repo:'repo', issue_number:1, title:'title', body:'body' })
|
1887
|
-
*
|
1892
|
+
* -> 更新议题信息对象
|
1888
1893
|
* ```
|
1889
1894
|
*/
|
1890
1895
|
update_issue(options: UpdateIssueParamType): Promise<ApiResponseType<UpdateIssueResponseType>>;
|
@@ -1901,9 +1906,8 @@ declare class Issue extends GitHubClient {
|
|
1901
1906
|
* @returns 包含Issue信息的响应对象
|
1902
1907
|
* @example
|
1903
1908
|
* ```ts
|
1904
|
-
* const issue = get_issue() // 获取issue实例
|
1905
1909
|
* const res = await issue.open_issue({ owner: 'owner', repo:'repo', issue_number:1 })
|
1906
|
-
*
|
1910
|
+
* -> 打开议题信息对象
|
1907
1911
|
* ```
|
1908
1912
|
*/
|
1909
1913
|
open_issue(options: OpenIssueParamType): Promise<ApiResponseType<OpenIssueResponseType>>;
|
@@ -1930,14 +1934,14 @@ declare class Issue extends GitHubClient {
|
|
1930
1934
|
* @returns 包含Issue信息的响应对象
|
1931
1935
|
* @example
|
1932
1936
|
* ```ts
|
1933
|
-
* const issue = get_issue() // 获取issue实例
|
1934
1937
|
* const res = await issue.close_issue({ owner: 'owner', repo:'repo', issue_number:1, state_reason:'completed' })
|
1935
|
-
*
|
1938
|
+
* -> 关闭议题信息对象
|
1936
1939
|
* ```
|
1937
1940
|
*/
|
1938
1941
|
close_issue(options: CloseIssueParamType): Promise<ApiResponseType<CloseIssueResponseType>>;
|
1939
1942
|
/**
|
1940
1943
|
* 锁定一个议题
|
1944
|
+
* @github
|
1941
1945
|
* 仅GitHub平台可用
|
1942
1946
|
* 权限:
|
1943
1947
|
* - Issues: Write
|
@@ -1951,14 +1955,14 @@ declare class Issue extends GitHubClient {
|
|
1951
1955
|
* @returns 锁定状态信息
|
1952
1956
|
* @example
|
1953
1957
|
* ```ts
|
1954
|
-
* const issue = get_issue() // 获取issue实例
|
1955
1958
|
* const res = await issue.lock_issue({ owner: 'owner', repo:'repo', issue_number:1, lock_reason:'off-topic' })
|
1956
|
-
*
|
1959
|
+
* -> 锁定议题信息对象
|
1957
1960
|
* ```
|
1958
1961
|
*/
|
1959
1962
|
lock_issue(options: LockIssueParamType): Promise<ApiResponseType<LockIssueResponseType>>;
|
1960
1963
|
/**
|
1961
1964
|
* 解锁一个议题
|
1965
|
+
* @github
|
1962
1966
|
* 仅GitHub平台可用
|
1963
1967
|
* 权限:
|
1964
1968
|
* - Issues: Write
|
@@ -1971,9 +1975,8 @@ declare class Issue extends GitHubClient {
|
|
1971
1975
|
* @returns 解锁状态信息
|
1972
1976
|
* @example
|
1973
1977
|
* ```ts
|
1974
|
-
* const issue = get_issue() // 获取issue实例
|
1975
1978
|
* const res = await issue.unlock_issue({ owner: 'owner', repo:'repo', issue_number})
|
1976
|
-
*
|
1979
|
+
* -> 解锁议题信息对象
|
1977
1980
|
* ```
|
1978
1981
|
*/
|
1979
1982
|
unlock_issue(options: UnLockIssueParamType): Promise<ApiResponseType<UnLockIssueResponseType>>;
|
@@ -1994,9 +1997,8 @@ declare class Issue extends GitHubClient {
|
|
1994
1997
|
* @returns 包含Issue评论列表的响应对象
|
1995
1998
|
* @example
|
1996
1999
|
* ```ts
|
1997
|
-
* const issue = get_issue() // 获取issue实例
|
1998
2000
|
* const res = await issue.get_issue_comments_list({ owner: 'owner', repo:'repo', issue_number:1 })
|
1999
|
-
*
|
2001
|
+
* -> 议题评论对象列表
|
2000
2002
|
* ```
|
2001
2003
|
*/
|
2002
2004
|
get_repo_comments_list(options: RepoCommentListParamType): Promise<ApiResponseType<RepoCommentListResponseType>>;
|
@@ -2016,9 +2018,8 @@ declare class Issue extends GitHubClient {
|
|
2016
2018
|
* @returns 包含Issue评论列表的响应对象
|
2017
2019
|
* @example
|
2018
2020
|
* ```ts
|
2019
|
-
* const issue = get_issue() // 获取issue实例
|
2020
2021
|
* const res = await issue.get_issue_comments_list({ owner: 'owner', repo:'repo', issue_number:1 })
|
2021
|
-
*
|
2022
|
+
* -> 议题评论对象列表
|
2022
2023
|
* ```
|
2023
2024
|
*/
|
2024
2025
|
get_issue_comments_list(options: IssueCommentListParamType): Promise<ApiResponseType<IssueCommentListResponseType>>;
|
@@ -2035,9 +2036,8 @@ declare class Issue extends GitHubClient {
|
|
2035
2036
|
* @returns Issue评论信息
|
2036
2037
|
* @example
|
2037
2038
|
* ```ts
|
2038
|
-
* const issue = get_issue() // 获取issue实例
|
2039
2039
|
* const res = await issue.get_issue_comment({ owner: 'owner', repo:'repo', comment_id:1 })
|
2040
|
-
*
|
2040
|
+
* -> 议题评论对象
|
2041
2041
|
* ```
|
2042
2042
|
*/
|
2043
2043
|
get_issue_comment_info(options: IssueCommentInfoParamType): Promise<ApiResponseType<IssueCommentInfoResponseType>>;
|
@@ -2057,7 +2057,7 @@ declare class Issue extends GitHubClient {
|
|
2057
2057
|
* ```ts
|
2058
2058
|
* const issue = get_issue() // 获取issue实例
|
2059
2059
|
* const res = await issue.create_issue_comment({ owner: 'owner', repo:'repo', issue_number:1, body:'comment' })
|
2060
|
-
*
|
2060
|
+
* -> 创建议题评论对象
|
2061
2061
|
* ```
|
2062
2062
|
*/
|
2063
2063
|
create_issue_comment(options: CreteIssueCommentParamType): Promise<ApiResponseType<CreteIssueCommentResponseType>>;
|
@@ -2075,9 +2075,8 @@ declare class Issue extends GitHubClient {
|
|
2075
2075
|
* @returns 更新后的Issue评论信息
|
2076
2076
|
* @example
|
2077
2077
|
* ```ts
|
2078
|
-
* const issue = get_issue() // 获取issue实例
|
2079
2078
|
* const res = await issue.update_issue_comment({ owner: 'owner', repo:'repo', comment_id:1, body:'body' })
|
2080
|
-
*
|
2079
|
+
* -> 更新议题评论对象
|
2081
2080
|
* ```
|
2082
2081
|
*/
|
2083
2082
|
update_issue_comment(options: UpdateIssueCommentParamType): Promise<ApiResponseType<UpdateIssueCommentResponseType>>;
|
@@ -2094,9 +2093,8 @@ declare class Issue extends GitHubClient {
|
|
2094
2093
|
* @returns 删除结果信息
|
2095
2094
|
* @example
|
2096
2095
|
* ```ts
|
2097
|
-
* const issue = get_issue() // 获取issue实例
|
2098
2096
|
* const res = awaitissue.remove_issue_comment()
|
2099
|
-
*
|
2097
|
+
* -> 删除议题评论对象
|
2100
2098
|
* ```
|
2101
2099
|
*/
|
2102
2100
|
remove_issue_comment(options: RemoveIssueCommentParamType): Promise<ApiResponseType<RemoveCollaboratorResponseType>>;
|
@@ -2124,14 +2122,13 @@ declare class Issue extends GitHubClient {
|
|
2124
2122
|
* @returns 子议题列表
|
2125
2123
|
* @example
|
2126
2124
|
* ```ts
|
2127
|
-
* const issue = get_issue() // 获取issue实例
|
2128
2125
|
* const res = await issue.get_sub_issue_list({ owner: 'owner', repo:'repo', issue_number:1 })
|
2129
|
-
*
|
2126
|
+
* -> 子议题信息对象列表
|
2130
2127
|
* ```
|
2131
2128
|
*/
|
2132
2129
|
get_sub_issue_list(options: SubIssueListParamType): Promise<ApiResponseType<SubIssueListResponseType>>;
|
2133
2130
|
/**
|
2134
|
-
*
|
2131
|
+
* 创建子议题
|
2135
2132
|
* 添加一个子议题到指定的议题中
|
2136
2133
|
* @github
|
2137
2134
|
* 仅GitHub 平台使用
|
@@ -2146,12 +2143,19 @@ declare class Issue extends GitHubClient {
|
|
2146
2143
|
* @returns 添加结果信息
|
2147
2144
|
* @example
|
2148
2145
|
* ```ts
|
2149
|
-
* const issue = get_issue() // 获取issue实例
|
2150
2146
|
* const res = await issue.add_sub_issue({ owner: 'owner', repo:'repo', issue_number:1, sub_issue_id:1, replace_parent:true })
|
2151
|
-
*
|
2147
|
+
* -> 创建子议题信息对象
|
2152
2148
|
* ```
|
2153
2149
|
*/
|
2154
|
-
|
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>>;
|
2155
2159
|
/**
|
2156
2160
|
* 删除子议题
|
2157
2161
|
* @github
|
@@ -2166,9 +2170,8 @@ declare class Issue extends GitHubClient {
|
|
2166
2170
|
* @returns 删除结果信息
|
2167
2171
|
* @example
|
2168
2172
|
* ```ts
|
2169
|
-
* const issue = get_issue() // 获取issue实例
|
2170
2173
|
* const res = await issue.remove_sub_issue({ owner: 'owner', repo:'repo', issue_number:1, sub_issue_id:1 })
|
2171
|
-
*
|
2174
|
+
* -> 删除子议题信息对象
|
2172
2175
|
* ```
|
2173
2176
|
*/
|
2174
2177
|
remove_sub_issue(options: RemoveSubIssueParamType): Promise<ApiResponseType<RemoveSubIssueResponseType>>;
|
@@ -2196,9 +2199,8 @@ declare class Issue extends GitHubClient {
|
|
2196
2199
|
* - after_id 指定要在哪个子议题之后插入,传入目标子议题的编号
|
2197
2200
|
* @example
|
2198
2201
|
* ```ts
|
2199
|
-
* const issue = get_issue() // 获取issue实例
|
2200
2202
|
* const res = await issue.reprioritize_sub_issue({ owner: 'owner', repo:'repo', issue_number:1, sub_issue_id:1, before_id:1 })
|
2201
|
-
*
|
2203
|
+
* -> 排序子议题信息对象
|
2202
2204
|
* ```
|
2203
2205
|
*/
|
2204
2206
|
reprioritize_sub_issue(options: ReprioritizeSubIssueParamType): Promise<ApiResponseType<ReprioritizeSubIssueResponseType>>;
|
@@ -2222,7 +2224,7 @@ declare class Org extends GitHubClient {
|
|
2222
2224
|
* @example
|
2223
2225
|
* ```ts
|
2224
2226
|
* const orgInfo = await org.get_org_info({ org: 'org' })
|
2225
|
-
*
|
2227
|
+
* -> 组织信息对象
|
2226
2228
|
* ```
|
2227
2229
|
*/
|
2228
2230
|
get_org_info(options: OrgInfoParamType): Promise<ApiResponseType<OrgInfoResponseType>>;
|
@@ -2237,7 +2239,7 @@ declare class Org extends GitHubClient {
|
|
2237
2239
|
* @example
|
2238
2240
|
* ```ts
|
2239
2241
|
* const orgInfo = await org.add_member({ org: 'org', username: 'username' })
|
2240
|
-
*
|
2242
|
+
* -> 添加组织成员对象
|
2241
2243
|
* ```
|
2242
2244
|
*/
|
2243
2245
|
add_member(options: AddMemberParamType): Promise<ApiResponseType<AddMemberResponseType>>;
|
@@ -2267,9 +2269,8 @@ declare class Pull_Request extends GitHubClient {
|
|
2267
2269
|
* @returns 包含pull_request信息的响应对象
|
2268
2270
|
* @example
|
2269
2271
|
* ```ts
|
2270
|
-
* const pull_request = get_pull_request() // 获取pull_request实例
|
2271
2272
|
* const res = await pull_request.get_pull_request_info({ owner: 'owner', repo:'repo', pr_number:1 })
|
2272
|
-
*
|
2273
|
+
* -> 拉取提交信息对象
|
2273
2274
|
* ```
|
2274
2275
|
*/
|
2275
2276
|
get_pull_request_info(options: PullRequestInfoParamType): Promise<ApiResponseType<PullRequestInfoResponseType>>;
|
@@ -2290,9 +2291,8 @@ declare class Pull_Request extends GitHubClient {
|
|
2290
2291
|
* @returns 包含pull_request信息的响应对象
|
2291
2292
|
* @example
|
2292
2293
|
* ```ts
|
2293
|
-
* const pull_request = get_pull_request() // 获取pull_request实例
|
2294
2294
|
* const res = await pull_request.get_get_pull_request_list({ owner: 'owner', repo:'repo' })
|
2295
|
-
*
|
2295
|
+
* -> 拉取提交信息对象列表
|
2296
2296
|
* ```
|
2297
2297
|
*/
|
2298
2298
|
get_get_pull_request_list(options: PullRequestListParamType): Promise<ApiResponseType<PullRequestListResponseType>>;
|
@@ -2314,9 +2314,8 @@ declare class Pull_Request extends GitHubClient {
|
|
2314
2314
|
* @returns 包含pull_request信息的响应对象
|
2315
2315
|
* @example
|
2316
2316
|
* ```ts
|
2317
|
-
* const pull_request = get_pull_request() // 获取pull_request实例
|
2318
2317
|
* const res = await pull_request.create_pull_requestt({ owner: 'owner', repo:'repo', issue: 1, head: 'head', base: 'base' })
|
2319
|
-
*
|
2318
|
+
* -> 创建拉取提交信息对象
|
2320
2319
|
*/
|
2321
2320
|
create_pull_request(options: CreatePullRequestParamType): Promise<ApiResponseType<CreatePullRequestResponseType>>;
|
2322
2321
|
/**
|
@@ -2332,9 +2331,8 @@ declare class Pull_Request extends GitHubClient {
|
|
2332
2331
|
* @returns 包含pull_request信息的响应对象
|
2333
2332
|
* @example
|
2334
2333
|
* ```ts
|
2335
|
-
* const pull_request = get_pull_request() // 获取pull_request实例
|
2336
2334
|
* const res = await pull_request.create_pull_requestt({ owner: 'owner', repo:'repo', pr_number:1, state:'open' })
|
2337
|
-
*
|
2335
|
+
* -> 更新拉取提交信息对象
|
2338
2336
|
*/
|
2339
2337
|
update_pull_request(options: UpdatePullRequestParamType): Promise<ApiResponseType<UpdatePullRequestResponseType>>;
|
2340
2338
|
/**
|
@@ -2352,9 +2350,8 @@ declare class Pull_Request extends GitHubClient {
|
|
2352
2350
|
* @returns 包含pull_request信息的响应对象
|
2353
2351
|
* @example
|
2354
2352
|
* ```ts
|
2355
|
-
* const pull_request = get_pull_request() // 获取pull_request实例
|
2356
2353
|
* const res = await pull_request.merge_pull_request({ owner: 'owner', repo:'repo', pr_number:1 })
|
2357
|
-
*
|
2354
|
+
* -> 合并拉取提交信息对象
|
2358
2355
|
* ```
|
2359
2356
|
*/
|
2360
2357
|
merge_pull_request(options: MergePullRequestParamType): Promise<ApiResponseType<MergePullRequestResponseType>>;
|
@@ -2371,9 +2368,8 @@ declare class Pull_Request extends GitHubClient {
|
|
2371
2368
|
* @returns 包含拉取请求文件列表的响应对象
|
2372
2369
|
* @example
|
2373
2370
|
* ```ts
|
2374
|
-
* const pull_request = get_pull_request() // 获取pull_request实例
|
2375
2371
|
* const res = await pull_request.get_pull_request_files_list({ owner: 'owner', repo:'repo', pr_number:1 })
|
2376
|
-
*
|
2372
|
+
* -> 拉取提交文件信息对象列表
|
2377
2373
|
* ```
|
2378
2374
|
*/
|
2379
2375
|
get_pull_request_files_list(options: GetPullRequestFilesListParamType): Promise<ApiResponseType<GetPullRequestFilesListResponseType>>;
|
@@ -2388,9 +2384,8 @@ declare class Pull_Request extends GitHubClient {
|
|
2388
2384
|
* @returns 包含拉取请求指定的评论id的信息
|
2389
2385
|
* @example
|
2390
2386
|
* ```ts
|
2391
|
-
* const pull_request = get_pull_request() // 获取pull_request实例
|
2392
2387
|
* const res = await pull_request.get_pull_request_comment_info({ owner: 'owner', repo:'repo', comment_id:1 })
|
2393
|
-
*
|
2388
|
+
* -> 拉取提交评论信息对象
|
2394
2389
|
* ```
|
2395
2390
|
*/
|
2396
2391
|
get_pull_request_comment_info(options: GetPullRequestCommentInfoParamType): Promise<ApiResponseType<GetPullRequestCommentInfoResponseType>>;
|
@@ -2408,9 +2403,8 @@ declare class Pull_Request extends GitHubClient {
|
|
2408
2403
|
* @returns 包含拉取请求评论列表响应信息列表
|
2409
2404
|
* @example
|
2410
2405
|
* ```ts
|
2411
|
-
* const pull_request = get_pull_request() // 获取pull_request实例
|
2412
2406
|
* const res = await pull_request.get_pull_request_comments_list({ owner: 'owner', repo:'repo', pr_number:1 })
|
2413
|
-
*
|
2407
|
+
* -> 拉取提交评论信息对象
|
2414
2408
|
* ```
|
2415
2409
|
*/
|
2416
2410
|
get_pull_request_comments_list(options: GetPullRequestCommentsListParamType): Promise<ApiResponseType<GetPullRequestCommentsListResponseType>>;
|
@@ -2426,9 +2420,8 @@ declare class Pull_Request extends GitHubClient {
|
|
2426
2420
|
* @returns 包含创建拉取请求评论响应信息
|
2427
2421
|
* @example
|
2428
2422
|
* ```ts
|
2429
|
-
* const pull_request = get_pull_request() // 获取pull_request实例
|
2430
2423
|
* const res = await pull_request.create_pull_request_comment({ owner: 'owner', repo:'repo', pr_number:1, body: 'loli' })
|
2431
|
-
*
|
2424
|
+
* -> 创建拉取提交评论信息对象
|
2432
2425
|
* ```
|
2433
2426
|
*/
|
2434
2427
|
create_pull_request_comment(options: CreatePullRequestCommentParamType): Promise<ApiResponseType<CreatePullRequestCommentResponseType>>;
|
@@ -2444,25 +2437,18 @@ declare class Pull_Request extends GitHubClient {
|
|
2444
2437
|
* @returns 包含更新拉取请求评论响应信息
|
2445
2438
|
* @example
|
2446
2439
|
* ```ts
|
2447
|
-
* const pull_request = get_pull_request() // 获取pull_request实例
|
2448
2440
|
* const res = await pull_request.update_pull_request_comment({ owner: 'owner', repo:'repo', comment_id:1, body: 'loli' })
|
2449
|
-
*
|
2441
|
+
* -> 更新拉取提交评论信息对象
|
2450
2442
|
* ```
|
2451
2443
|
*/
|
2452
2444
|
update_pull_request_comment(options: UpdatePullRequestCommentParamType): Promise<ApiResponseType<UpdatePullRequestCommentResponseType>>;
|
2453
2445
|
/**
|
2454
|
-
*
|
2446
|
+
* 编辑拉取请求评论
|
2455
2447
|
* @deprecated 请使用update_issue_comment方法
|
2456
2448
|
* 权限:
|
2457
2449
|
* - Pull requests: Read-And-Write
|
2458
2450
|
* @param options - 删除拉取请求评论参数对象
|
2459
2451
|
* @returns 删除结果
|
2460
|
-
* @example
|
2461
|
-
* ```ts
|
2462
|
-
* const pull_request = get_pull_request() // 获取pull_request实例
|
2463
|
-
* const res = await pull_request. public async edit_pull_request_comment (
|
2464
|
-
({ owner: 'owner', repo:'repo', comment_id:1, body: 'loli' })
|
2465
|
-
* console.log(res) // { data: CreatePullRequestCommentResponseType }
|
2466
2452
|
* ```
|
2467
2453
|
*/
|
2468
2454
|
edit_pull_request_comment(options: UpdatePullRequestCommentParamType): Promise<ApiResponseType<UpdatePullRequestCommentResponseType>>;
|
@@ -2477,9 +2463,8 @@ declare class Pull_Request extends GitHubClient {
|
|
2477
2463
|
* @returns 包含更新拉取请求评论响应信息
|
2478
2464
|
* @example
|
2479
2465
|
* ```ts
|
2480
|
-
* const pull_request = get_pull_request() // 获取pull_request实例
|
2481
2466
|
* const res = await pull_request.delete_pull_request_comment({ owner: 'owner', repo:'repo', comment_id: 1 })
|
2482
|
-
*
|
2467
|
+
* -> 更新拉取提交评论信息对象
|
2483
2468
|
* ```
|
2484
2469
|
*/
|
2485
2470
|
delete_pull_request_comment(options: DeletePullRequestCommentParamType): Promise<ApiResponseType<DeletePullRequestCommentResponseType>>;
|
@@ -2511,7 +2496,7 @@ declare class Repo extends GitHubClient {
|
|
2511
2496
|
* @example
|
2512
2497
|
* ```ts
|
2513
2498
|
* const repos = await repo.get_org_repos_list({ org: 'org' })
|
2514
|
-
*
|
2499
|
+
* -> 组织仓库信息对象列表
|
2515
2500
|
* ```
|
2516
2501
|
*/
|
2517
2502
|
get_org_repos_list(options: OrgRepoListParmType): Promise<ApiResponseType<OrgRepoListResponseType>>;
|
@@ -2530,7 +2515,7 @@ declare class Repo extends GitHubClient {
|
|
2530
2515
|
* @example
|
2531
2516
|
* ```ts
|
2532
2517
|
* const repos = await repo.get_repos_list({ username: 'username' })
|
2533
|
-
*
|
2518
|
+
* -> 用户仓库信息对象列表
|
2534
2519
|
* ```
|
2535
2520
|
*/
|
2536
2521
|
get_user_repos_list_by_token(options?: UserByTokenRepoListParamType): Promise<ApiResponseType<UserRepoListType>>;
|
@@ -2547,6 +2532,11 @@ declare class Repo extends GitHubClient {
|
|
2547
2532
|
* - per_page - 每页数量(1-100), 默认值:30
|
2548
2533
|
* - page - 页码 默认值:1
|
2549
2534
|
* @returns 用户仓库列表
|
2535
|
+
* @example
|
2536
|
+
* ```ts
|
2537
|
+
* const repos = await github.get_user_repos_list({ username: 'loli' })
|
2538
|
+
* -> 用户仓库信息对象列表
|
2539
|
+
* ```
|
2550
2540
|
*/
|
2551
2541
|
get_user_repos_list(options: UserRepoListParamType): Promise<ApiResponseType<UserRepoListType>>;
|
2552
2542
|
/**
|
@@ -2559,7 +2549,7 @@ declare class Repo extends GitHubClient {
|
|
2559
2549
|
* @example
|
2560
2550
|
* ```ts
|
2561
2551
|
* const repo = await repo.get_repo_info({ owner: 'owner', repo: 'repo' })
|
2562
|
-
*
|
2552
|
+
* -> 仓库信息对象
|
2563
2553
|
* ```
|
2564
2554
|
*/
|
2565
2555
|
get_repo_info(options: RepoInfoParamType): Promise<ApiResponseType<RepoInfoResponseType>>;
|
@@ -2573,7 +2563,7 @@ declare class Repo extends GitHubClient {
|
|
2573
2563
|
* @example
|
2574
2564
|
* ```ts
|
2575
2565
|
* const repo = await repo.get_repo_languages_list({ owner: 'owner', repo: 'repo' })
|
2576
|
-
*
|
2566
|
+
* -> 仓库语言对象列表
|
2577
2567
|
* ```
|
2578
2568
|
*/
|
2579
2569
|
get_repo_languages_list(options: RepoLanguagesListParamType): Promise<ApiResponseType<RepoLanguagesListResponseType>>;
|
@@ -2591,6 +2581,11 @@ declare class Repo extends GitHubClient {
|
|
2591
2581
|
* - has_wiki: 是否启用wiki功能, 默认值:true
|
2592
2582
|
* - auto_init: 是否自动初始化仓库 默认值:false
|
2593
2583
|
* @returns 返回创建成功的仓库信息
|
2584
|
+
* @example
|
2585
|
+
* ```ts
|
2586
|
+
* const repoInfo = await org.create_org_repo({org: 'loli', repo: 'git-neko-kit'})
|
2587
|
+
* -> 创建组织仓库信息对象
|
2588
|
+
* ```
|
2594
2589
|
*/
|
2595
2590
|
create_org_repo(options: OrgRepoCreateParamType): Promise<ApiResponseType<OrgRepoCreateResponseType>>;
|
2596
2591
|
/**
|
@@ -2607,6 +2602,11 @@ declare class Repo extends GitHubClient {
|
|
2607
2602
|
* - has_wiki: 是否启用wiki功能, 默认值:true
|
2608
2603
|
* - auto_init: 是否自动初始化仓库 默认值:false
|
2609
2604
|
* @returns 返回创建成功的仓库信息
|
2605
|
+
* @example
|
2606
|
+
* ```ts
|
2607
|
+
* const repoInfo = await repo.create_user_repo({org: 'loli', repo: 'git-neko-kit'})
|
2608
|
+
* -> 创建用户仓库信息对象
|
2609
|
+
* ```
|
2610
2610
|
*/
|
2611
2611
|
create_user_repo(options: UserRepoCreateParamType): Promise<ApiResponseType<UserRepoCreateResponseType>>;
|
2612
2612
|
/**
|
@@ -2643,7 +2643,7 @@ declare class Repo extends GitHubClient {
|
|
2643
2643
|
* @example
|
2644
2644
|
* ```ts
|
2645
2645
|
* const result = await collaborator.get_collaborators_list(options)
|
2646
|
-
*
|
2646
|
+
* -> 仓库协作者信息对象列表
|
2647
2647
|
* ```
|
2648
2648
|
*/
|
2649
2649
|
get_collaborators_list(options: GetCollaboratorListParamType): Promise<ApiResponseType<GetCollaboratorListResponseType>>;
|
@@ -2667,7 +2667,7 @@ declare class Repo extends GitHubClient {
|
|
2667
2667
|
* username: 'username',
|
2668
2668
|
* permission: 'pull'
|
2669
2669
|
* })
|
2670
|
-
*
|
2670
|
+
* -> 邀请仓库协作者信息对象
|
2671
2671
|
* ```
|
2672
2672
|
*/
|
2673
2673
|
add_collaborator(options: CollaboratorParamType): Promise<ApiResponseType<AddCollaboratorResponseType>>;
|
@@ -2678,8 +2678,6 @@ declare class Repo extends GitHubClient {
|
|
2678
2678
|
* @param options 删除协作者对象
|
2679
2679
|
* - owner: 仓库拥有者
|
2680
2680
|
* - repo: 仓库名称
|
2681
|
-
* - url: 仓库地址
|
2682
|
-
* owner和repo或者url选择一个即可
|
2683
2681
|
* - username: 要删除协作者用户名
|
2684
2682
|
* @returns 返回删除协作者结果
|
2685
2683
|
* @example
|
@@ -2689,7 +2687,7 @@ declare class Repo extends GitHubClient {
|
|
2689
2687
|
* repo:'repo',
|
2690
2688
|
* username: 'username'
|
2691
2689
|
* })
|
2692
|
-
*
|
2690
|
+
* -> 移除仓库协作者信息对象
|
2693
2691
|
* ```
|
2694
2692
|
*/
|
2695
2693
|
remove_collaborator(options: RemoveCollaboratorParamType): Promise<ApiResponseType<RemoveCollaboratorResponseType>>;
|
@@ -2698,15 +2696,6 @@ declare class Repo extends GitHubClient {
|
|
2698
2696
|
* @deprecated 请使用remove_collaborator方法
|
2699
2697
|
* @param options 删除协作者对象
|
2700
2698
|
* @returns 返回删除协作者结果
|
2701
|
-
* @example
|
2702
|
-
* ```ts
|
2703
|
-
* const result = await collaborator.delete_collaborator({
|
2704
|
-
* owner: 'owner',
|
2705
|
-
* repo:'repo',
|
2706
|
-
* username: 'username'
|
2707
|
-
* })
|
2708
|
-
* console.log(result)
|
2709
|
-
* ```
|
2710
2699
|
*/
|
2711
2700
|
delete_collaborator(options: RemoveCollaboratorParamType): Promise<ApiResponseType<RemoveCollaboratorResponseType>>;
|
2712
2701
|
/**
|
@@ -2722,8 +2711,12 @@ declare class Repo extends GitHubClient {
|
|
2722
2711
|
* @returns 仓库可见性,
|
2723
2712
|
* @example
|
2724
2713
|
* ```ts
|
2714
|
+
* // 公开仓库
|
2725
2715
|
* const visibility = await repo.get_repo_visibility({url: 'https://github.com/CandriaJS/git-neko-kit'})
|
2726
|
-
*
|
2716
|
+
* -> 'public'
|
2717
|
+
* // 私有仓库
|
2718
|
+
* const visibility = await repo.get_repo_visibility({url: 'https://github.com/CandriaJS/git-neko-kit'})
|
2719
|
+
* -> 'private'
|
2727
2720
|
* ```
|
2728
2721
|
*/
|
2729
2722
|
get_repo_visibility(options: GetRepoVisibilityParamType): Promise<GetRepoVisibilityResponseType>;
|
@@ -2737,7 +2730,7 @@ declare class Repo extends GitHubClient {
|
|
2737
2730
|
* @example
|
2738
2731
|
* ```ts
|
2739
2732
|
* const defaultBranch = await repo.get_repo_default_branch({owner: CandriaJS, repo: meme-plugin)}
|
2740
|
-
*
|
2733
|
+
* -> 'main'
|
2741
2734
|
* ```ts
|
2742
2735
|
*/
|
2743
2736
|
get_repo_default_branch(options: GetRepoDefaultBranchParamType): Promise<GetRepoDefaultBranchResponseType | null>;
|
@@ -2753,7 +2746,7 @@ declare class Repo extends GitHubClient {
|
|
2753
2746
|
* @example
|
2754
2747
|
* ```ts
|
2755
2748
|
* const language = await repo.get_repo_language({url: 'URL_ADDRESS.com/CandriaJS/meme-plugin')}
|
2756
|
-
*
|
2749
|
+
* -> 'JavaScript'
|
2757
2750
|
* ```ts
|
2758
2751
|
*/
|
2759
2752
|
get_repo_main_language(options: GetRepoMainLanguageParamType): Promise<GetRepoMainLanguageResponseType>;
|
@@ -2777,7 +2770,7 @@ declare class User extends GitHubClient {
|
|
2777
2770
|
* @example
|
2778
2771
|
* ```ts
|
2779
2772
|
* const userInfo = await user.get_user_info({ username: 'username' })
|
2780
|
-
*
|
2773
|
+
* -> 用户信息对象
|
2781
2774
|
* ```
|
2782
2775
|
*/
|
2783
2776
|
get_user_info(options: UserInfoParamType): Promise<ApiResponseType<UserInfoResponseType>>;
|
@@ -2791,7 +2784,7 @@ declare class User extends GitHubClient {
|
|
2791
2784
|
* @example
|
2792
2785
|
* ```ts
|
2793
2786
|
* const userInfo = await user.get_user_info_by_user_id({ user_id: 123456789 })
|
2794
|
-
*
|
2787
|
+
* -> 用户信息对象
|
2795
2788
|
* ```
|
2796
2789
|
*/
|
2797
2790
|
get_user_info_by_user_id(options: UserInfoByIdParamType): Promise<ApiResponseType<UserInfoResponseType>>;
|
@@ -2801,7 +2794,7 @@ declare class User extends GitHubClient {
|
|
2801
2794
|
* @example
|
2802
2795
|
* ```ts
|
2803
2796
|
* const userInfo = await user.get_user_info_by_token()
|
2804
|
-
*
|
2797
|
+
* -> 用户信息对象
|
2805
2798
|
* ```
|
2806
2799
|
*/
|
2807
2800
|
get_user_info_by_auth(): Promise<ApiResponseType<UserInfoResponseType>>;
|
@@ -2809,10 +2802,6 @@ declare class User extends GitHubClient {
|
|
2809
2802
|
* 通过访问令牌获取用户信息
|
2810
2803
|
* 权限:无需任何权限
|
2811
2804
|
* @deprecated 该方法已过时,请使用get_user_info_by_auth方法牌
|
2812
|
-
* @example
|
2813
|
-
* ```ts
|
2814
|
-
* const userInfo = await user.get_user_info_by_token()
|
2815
|
-
* console.log(userInfo)
|
2816
2805
|
* ```
|
2817
2806
|
*/
|
2818
2807
|
get_user_info_by_token(): Promise<ApiResponseType<UserInfoResponseType>>;
|
@@ -2825,7 +2814,14 @@ declare class User extends GitHubClient {
|
|
2825
2814
|
* @example
|
2826
2815
|
* ```ts
|
2827
2816
|
* const contribution = await user.get_user_contribution({ username: 'username' })
|
2828
|
-
*
|
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
|
+
* }
|
2829
2825
|
* ```
|
2830
2826
|
*/
|
2831
2827
|
get_user_contribution(options: UserNameParamType): Promise<ApiResponseType<ContributionResult>>;
|
@@ -2837,9 +2833,9 @@ declare class User extends GitHubClient {
|
|
2837
2833
|
* @example
|
2838
2834
|
* ```ts
|
2839
2835
|
* const userId = await user.get_user_id()
|
2840
|
-
*
|
2836
|
+
* -> 114514
|
2841
2837
|
*/
|
2842
|
-
get_user_id(): Promise<number
|
2838
|
+
get_user_id(): Promise<number>;
|
2843
2839
|
/**
|
2844
2840
|
* 快速获取获取用户名
|
2845
2841
|
* 权限:无需任何权限
|
@@ -2848,20 +2844,19 @@ declare class User extends GitHubClient {
|
|
2848
2844
|
* @example
|
2849
2845
|
* ```ts
|
2850
2846
|
* const username = await user.get_username()
|
2851
|
-
*
|
2847
|
+
* -> 'loli'
|
2852
2848
|
* ```
|
2853
2849
|
*/
|
2854
|
-
get_username(): Promise<string
|
2850
|
+
get_username(): Promise<string>;
|
2855
2851
|
/**
|
2856
2852
|
* 快速获取获取用户昵称
|
2857
2853
|
* 该方法会自动获取当前用户的昵称,需要传入token
|
2858
2854
|
* 权限:无需任何权限
|
2859
|
-
* @remarks 用户昵称可能会为null
|
2860
2855
|
* @returns 昵称
|
2861
2856
|
* @example
|
2862
2857
|
* ```ts
|
2863
2858
|
* const nickname = await user.get_nickname()
|
2864
|
-
*
|
2859
|
+
* -> 'loli'
|
2865
2860
|
* ```
|
2866
2861
|
*/
|
2867
2862
|
get_nickname(): Promise<string | null>;
|
@@ -2873,7 +2868,7 @@ declare class User extends GitHubClient {
|
|
2873
2868
|
* @example
|
2874
2869
|
* ```ts
|
2875
2870
|
* const email = await user.get_email()
|
2876
|
-
*
|
2871
|
+
* -> '114514@gmail.com'
|
2877
2872
|
* ```
|
2878
2873
|
*/
|
2879
2874
|
get_user_email(): Promise<string | null>;
|
@@ -2885,7 +2880,7 @@ declare class User extends GitHubClient {
|
|
2885
2880
|
* @example
|
2886
2881
|
* ```ts
|
2887
2882
|
* const avatarUrl = await user.get_avatar_url()
|
2888
|
-
*
|
2883
|
+
* -> 'https://avatars.githubusercontent.com/u/12345678?v=4'
|
2889
2884
|
* ```
|
2890
2885
|
*/
|
2891
2886
|
get_avatar_url(): Promise<string>;
|
@@ -2903,7 +2898,6 @@ declare class WebHook extends GitHubClient {
|
|
2903
2898
|
* 检查WebHook签名是否正确
|
2904
2899
|
* 权限:无需任何权限
|
2905
2900
|
* @param options - WebHook参数对象,必须包含以下参数:
|
2906
|
-
* - secret: WebHook的密钥, 可以从Base类入口传递
|
2907
2901
|
* - payload: 要验证的签名主体
|
2908
2902
|
* - signature: 要验证的签名
|
2909
2903
|
* @returns 验证结果
|
@@ -2914,6 +2908,16 @@ declare class WebHook extends GitHubClient {
|
|
2914
2908
|
* payload: 'your_payload',
|
2915
2909
|
* signature: 'your_signature'
|
2916
2910
|
* })
|
2911
|
+
* ->
|
2912
|
+
* {
|
2913
|
+
* success: true,
|
2914
|
+
* status: 'ok',
|
2915
|
+
* msg: '请求成功'
|
2916
|
+
* data: {
|
2917
|
+
* success: true,
|
2918
|
+
* info: '验证成功'
|
2919
|
+
* }
|
2920
|
+
* }
|
2917
2921
|
* ```
|
2918
2922
|
*/
|
2919
2923
|
check_webhook_signature(options: WebHookSignatureParamType): Promise<ApiResponseType<WebHookSignatureResponseType>>;
|
@@ -3155,9 +3159,15 @@ declare class App extends GitHubClient {
|
|
3155
3159
|
/**
|
3156
3160
|
* 获取应用基本信息
|
3157
3161
|
* 权限:
|
3158
|
-
* - `none`
|
3162
|
+
* - `none` 无
|
3159
3163
|
* @param options - 应用标识符
|
3160
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
|
+
* ```
|
3161
3171
|
*/
|
3162
3172
|
get_app_info(options: AppInfoParamType): Promise<ApiResponseType<AppInfoResponseType>>;
|
3163
3173
|
/**
|
@@ -3168,7 +3178,8 @@ declare class App extends GitHubClient {
|
|
3168
3178
|
* @example
|
3169
3179
|
* ```ts
|
3170
3180
|
* const app = base.get_app()
|
3171
|
-
* console.log(app.get_app_info_by_auth())
|
3181
|
+
* console.log(app.get_app_info_by_auth())
|
3182
|
+
* -> app的信息
|
3172
3183
|
* ```
|
3173
3184
|
*/
|
3174
3185
|
private get_app_info_by_auth;
|
@@ -3179,8 +3190,6 @@ declare class App extends GitHubClient {
|
|
3179
3190
|
* @param options - 仓库安装应用参数对象
|
3180
3191
|
* - owner 拥有者
|
3181
3192
|
* - repo 仓库名
|
3182
|
-
* - url 仓库地址
|
3183
|
-
* ownwe和repo与url只能二选一
|
3184
3193
|
* @returns 返回应用安装信息
|
3185
3194
|
* @example
|
3186
3195
|
* ```ts
|
@@ -3192,9 +3201,12 @@ declare class App extends GitHubClient {
|
|
3192
3201
|
/**
|
3193
3202
|
* 生成Github App 安装链接
|
3194
3203
|
* @param state_id - 随机生成的 state_id,用于验证授权请求的状态,可选,默认不使用
|
3195
|
-
* @returns 返回安装链接对象
|
3196
|
-
* @returns state_id 随机生成的字符串,用于验证
|
3197
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
|
+
* ```
|
3198
3210
|
*/
|
3199
3211
|
create_install_link(state_id?: string): Promise<string>;
|
3200
3212
|
/**
|
@@ -3205,7 +3217,7 @@ declare class App extends GitHubClient {
|
|
3205
3217
|
* @example
|
3206
3218
|
* ```ts
|
3207
3219
|
* const link = await app.create_config_install_link('state_id')
|
3208
|
-
*
|
3220
|
+
* -> // https://github.com/apps/<app_name>/installations/new?state=<state_id></state_id>
|
3209
3221
|
* ```
|
3210
3222
|
*/
|
3211
3223
|
create_config_install_link(state_id?: string): Promise<string>;
|
@@ -3214,8 +3226,8 @@ declare class App extends GitHubClient {
|
|
3214
3226
|
* @returns 返回 Github App 名称
|
3215
3227
|
* @example
|
3216
3228
|
* ```ts
|
3217
|
-
*
|
3218
|
-
*
|
3229
|
+
* console.log(app.get_app_name())
|
3230
|
+
* -> 输出AppName
|
3219
3231
|
* ```
|
3220
3232
|
*/
|
3221
3233
|
get_app_name(): Promise<string>;
|
@@ -3227,9 +3239,12 @@ declare class App extends GitHubClient {
|
|
3227
3239
|
* @returns 是否安装
|
3228
3240
|
* @example
|
3229
3241
|
* ```ts
|
3242
|
+
* // 当前App已安装在此仓库
|
3243
|
+
* const isInstalled = await app.is_app_inttalled_in_repo({ owner: 'owner', repo: 'repo' })
|
3244
|
+
* -> true
|
3245
|
+
* // 当前App未安装此仓库
|
3230
3246
|
* const isInstalled = await app.is_app_inttalled_in_repo({ owner: 'owner', repo: 'repo' })
|
3231
|
-
*
|
3232
|
-
* ·
|
3247
|
+
* -> false
|
3233
3248
|
*/
|
3234
3249
|
is_app_installed_in_repo(options: RepoBaseParamType): Promise<boolean>;
|
3235
3250
|
}
|
@@ -3264,4 +3279,4 @@ declare class Client {
|
|
3264
3279
|
constructor(options: ClientType);
|
3265
3280
|
}
|
3266
3281
|
|
3267
|
-
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 };
|