@candriajs/git-neko-kit 1.0.0 → 1.1.1
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/exports/axios.d.ts +1 -0
- package/dist/exports/markdown.cjs +1 -0
- package/dist/exports/markdown.d.ts +1 -0
- package/dist/exports/markdown.mjs +1 -0
- package/dist/index.cjs +6 -6
- package/dist/index.d.ts +56 -24
- package/dist/index.mjs +6 -6
- package/package.json +9 -1
package/dist/index.d.ts
CHANGED
@@ -25,9 +25,7 @@ declare enum ProxyProtocol {
|
|
25
25
|
/** HTTPS */
|
26
26
|
HTTPS = "https",
|
27
27
|
/** SOCKS */
|
28
|
-
SOCKS = "socks"
|
29
|
-
/** SOCKS5 */
|
30
|
-
SOCKS5 = "socks5"
|
28
|
+
SOCKS = "socks"
|
31
29
|
}
|
32
30
|
/**
|
33
31
|
* 基本代理配置
|
@@ -38,7 +36,7 @@ interface BaseProxyType<T extends ProxyType | ProxyProtocol> {
|
|
38
36
|
address: ProxyUrlType;
|
39
37
|
}
|
40
38
|
/** 代理配置参数类型 */
|
41
|
-
type ProxyParamsType = BaseProxyType<ProxyProtocol.HTTP> | BaseProxyType<ProxyProtocol.HTTPS> | BaseProxyType<ProxyProtocol.SOCKS> | BaseProxyType<
|
39
|
+
type ProxyParamsType = BaseProxyType<ProxyProtocol.HTTP> | BaseProxyType<ProxyProtocol.HTTPS> | BaseProxyType<ProxyProtocol.SOCKS> | BaseProxyType<ProxyType.Common> | BaseProxyType<ProxyType.Reverse>;
|
42
40
|
|
43
41
|
/** 本地Git仓库信息 */
|
44
42
|
interface GitRepoInfoType {
|
@@ -1099,7 +1097,7 @@ interface MilestoneType {
|
|
1099
1097
|
type IssueInfoParamType = RepoBaseParamType & IssueNumberParamType;
|
1100
1098
|
/** 议题详情响应类型 */
|
1101
1099
|
interface IssueInfoResponseType {
|
1102
|
-
/**
|
1100
|
+
/** 问题id */
|
1103
1101
|
id: IssueNumberParamType['issue_number'];
|
1104
1102
|
/** 议题HTML页面URL */
|
1105
1103
|
html_url: string;
|
@@ -1135,7 +1133,7 @@ interface IssueInfoResponseType {
|
|
1135
1133
|
updated_at: string;
|
1136
1134
|
}
|
1137
1135
|
/** 议题列表参数类型 */
|
1138
|
-
|
1136
|
+
interface RepoIssueListParamType extends RepoBaseParamType {
|
1139
1137
|
/**
|
1140
1138
|
* 里程碑筛选
|
1141
1139
|
* @default *
|
@@ -1208,7 +1206,7 @@ type RepoIssueListParamType = RepoBaseParamType & {
|
|
1208
1206
|
* @default 1
|
1209
1207
|
*/
|
1210
1208
|
page?: number;
|
1211
|
-
}
|
1209
|
+
}
|
1212
1210
|
/** 议题列表响应类型 */
|
1213
1211
|
type IssueListResponseType = IssueInfoResponseType[];
|
1214
1212
|
/** 创建议题参数类型 */
|
@@ -1227,9 +1225,7 @@ type CreteIssueParamType = RepoBaseParamType & {
|
|
1227
1225
|
/** 创建议题响应类型 */
|
1228
1226
|
type CreateIssueResponseType = IssueInfoResponseType;
|
1229
1227
|
/** 更新议题参数类型 */
|
1230
|
-
interface UpdateIssueParamType extends Omit<CreteIssueParamType, 'title' | 'type'
|
1231
|
-
/** 问题ID */
|
1232
|
-
issue_number: IssueNumberParamType['issue_number'];
|
1228
|
+
interface UpdateIssueParamType extends Omit<CreteIssueParamType, 'title' | 'type'>, IssueNumberParamType {
|
1233
1229
|
/** 问题的名称 */
|
1234
1230
|
title?: string | null;
|
1235
1231
|
/** 问题的内容 */
|
@@ -1248,9 +1244,7 @@ type CloseIssueParamType = OpenIssueParamType;
|
|
1248
1244
|
/** 关闭议题响应类型 */
|
1249
1245
|
type CloseIssueResponseType = IssueInfoResponseType;
|
1250
1246
|
/** 锁定议题参数类型 */
|
1251
|
-
interface LockIssueParamType extends RepoBaseParamType {
|
1252
|
-
/** 议题ID */
|
1253
|
-
issue_number: IssueNumberParamType['issue_number'];
|
1247
|
+
interface LockIssueParamType extends RepoBaseParamType, IssueNumberParamType {
|
1254
1248
|
/**
|
1255
1249
|
* 锁定原因
|
1256
1250
|
* 可以是以下之一:
|
@@ -1278,10 +1272,7 @@ interface UnLockIssueResponseType {
|
|
1278
1272
|
message: LockIssueResponseType['message'];
|
1279
1273
|
}
|
1280
1274
|
/** 议题评论信息参数类型 */
|
1281
|
-
|
1282
|
-
/** 评论id,评论唯一标识符 */
|
1283
|
-
comment_id: string | number;
|
1284
|
-
}
|
1275
|
+
type IssueCommentInfoParamType = RepoBaseParamType & CommentIdParamType;
|
1285
1276
|
/** 议题评论信息响应类型 */
|
1286
1277
|
interface IssueCommentInfoResponseType {
|
1287
1278
|
/** 评论ID */
|
@@ -1343,7 +1334,7 @@ type RepoCommentsListResponseType = IssueCommentInfoResponseType[];
|
|
1343
1334
|
/** 议题评论列表参数类型 */
|
1344
1335
|
interface IssueCommentsListParamType extends RepoBaseParamType {
|
1345
1336
|
/** 议题ID */
|
1346
|
-
issue_number:
|
1337
|
+
issue_number: IssueNumberParamType['issue_number'];
|
1347
1338
|
/**
|
1348
1339
|
* 筛选此时间之后更新的评论
|
1349
1340
|
* 仅显示在指定时间之后更新的结果
|
@@ -2071,6 +2062,38 @@ declare function get_local_repo_default_branch(local_path: string): Promise<stri
|
|
2071
2062
|
*/
|
2072
2063
|
declare function get_remote_repo_default_branch(remote_url: string): Promise<string>;
|
2073
2064
|
|
2065
|
+
/**
|
2066
|
+
* 渲染 markdown 内容为 HTML
|
2067
|
+
* @description 使用配置好的 markdown-it 实例渲染 markdown 内容
|
2068
|
+
* @param md - 要渲染的 markdown 字符串
|
2069
|
+
* @returns 渲染后的 HTML 字符串
|
2070
|
+
* @example
|
2071
|
+
* ```ts
|
2072
|
+
* const html = await render_markdown(`# 标题
|
2073
|
+
* - 无序列表项1
|
2074
|
+
* - 无序列表项2
|
2075
|
+
* - 子列表项
|
2076
|
+
*
|
2077
|
+
* 1. 有序列表项1
|
2078
|
+
* 2. 有序列表项2
|
2079
|
+
* `);
|
2080
|
+
*
|
2081
|
+
* -> <h1>标题</h1>
|
2082
|
+
* <ul style="list-style: none;">
|
2083
|
+
* <li>无序列表项1</li>
|
2084
|
+
* <li>无序列表项2</li>
|
2085
|
+
* <ul style="list-style: none;">
|
2086
|
+
* <li>子列表项</li>
|
2087
|
+
* </ul>
|
2088
|
+
* </ul>
|
2089
|
+
* <ol style="list-style: none;">
|
2090
|
+
* <li>有序列表项1</li>
|
2091
|
+
* <li>有序列表项2</li>
|
2092
|
+
* </ol>
|
2093
|
+
* ```
|
2094
|
+
*/
|
2095
|
+
declare function render_markdown(md: string): Promise<string>;
|
2096
|
+
|
2074
2097
|
/**
|
2075
2098
|
* 获取本地 NPM 包信息
|
2076
2099
|
* @description 获取本地 NPM 包信息
|
@@ -2132,15 +2155,24 @@ declare function format_date(dateString: string, locale?: string, format?: strin
|
|
2132
2155
|
/**
|
2133
2156
|
* 获取相对时间
|
2134
2157
|
* @param dateString - 日期字符串
|
2135
|
-
* @param
|
2136
|
-
* @
|
2158
|
+
* @param options - 可选参数对象
|
2159
|
+
* @param options.locale - 语言环境,默认为 'zh-cn'
|
2160
|
+
* @param options.useAbsoluteIfOver30Days - 是否在超过30天时返回绝对时间
|
2161
|
+
* @returns 相对时间或绝对时间
|
2137
2162
|
* @example
|
2138
|
-
* ```
|
2163
|
+
* ```ts
|
2139
2164
|
* console.log(await get_relative_time('2023-04-01 12:00:00'))
|
2140
|
-
* ->
|
2165
|
+
* -> "1 小时前"
|
2166
|
+
*
|
2167
|
+
* // 如果当前时间距离该日期已超过30天,则返回绝对时间
|
2168
|
+
* console.log(await get_relative_time('2023-01-01 12:00:00', { useAbsoluteIfOver30Days: true }))
|
2169
|
+
* -> "2025-07-01 13:00:00"
|
2141
2170
|
* ```
|
2142
2171
|
*/
|
2143
|
-
declare function get_relative_time(dateString: string,
|
2172
|
+
declare function get_relative_time(dateString: string, options?: {
|
2173
|
+
locale?: string;
|
2174
|
+
useAbsoluteIfOver30Days?: boolean;
|
2175
|
+
}): Promise<string>;
|
2144
2176
|
/**
|
2145
2177
|
* 根据语言名称获取对应的颜色值
|
2146
2178
|
* @param language - 语言名称
|
@@ -4130,4 +4162,4 @@ declare class Client {
|
|
4130
4162
|
constructor(options: ClientType);
|
4131
4163
|
}
|
4132
4164
|
|
4133
|
-
export { type AccessCodeType, type AccessTokenClentTYpe, type AccessTokenPermissionsType, type AccessTokenType, type AddCollaboratorResponseType, type AddMemberParamType, type AddMemberResponseType, type ApiResponseType, type AppClientType, type AppInfoParamType, type AppInfoResponseType, type AppPermissions, type AppRepoInfoResponseType, type AppUser, type BaseProxyType, 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 ContributionData, type ContributionResult, type CreateAccessTokenForAppParamType, type CreateAccessTokenForAppResponseType, 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 DisEnableRepoWorkflowParamType, type DisEnableRepoWorkflowResponseType, type EnableRepoWorkflowParamType, type EnableRepoWorkflowResponseType, type GetAppInfoByOrgParamType, type GetAppInfoByOrgResponseType, type GetAppInfoByRepoParamType, type GetAppInfoByRepoResponseType, type GetAppInfoByUserParamType, type GetAppInfoByUserResponseType, type GetCollaboratorListParamType, type GetCollaboratorListResponseType, type GetOrgMemberInfoParamType, type GetOrgMemberInfoResponseType, type GetOrgMemberListParamType, type GetOrgMemberListResponseType, type GetOrgMemberListType, 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 GetRepoWorkflowsList, type GetRepoWorkflowsListResponseType, type GitHubBaseClient, GitHubClient, type GitHubClientType, type GitInfoListType, type GitRepoInfoListOptionsType, type GitRepoInfoType, type GitRepoType, type GitType, type GitUser, type IssueCommentInfoParamType, type IssueCommentInfoResponseType, type IssueCommentsListParamType, type IssueCommentsListResponseType, 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 NpmPackageInfoListOptionsType, type NpmPackageInfoListType, type NpmPackageInfoType, type OpenIssueParamType, type OpenIssueResponseType, type OrgInfoParamType, type OrgInfoResponseType, type OrgNameParamType, type OrgRepoCreateParamType, type OrgRepoCreateResponseType, type OrgRepoListParmType, type OrgRepoListResponseType, type OrgUser, type ParentCommit, type PkgInfoType, type PrRepo, type PrUser, type ProxyParamsType, ProxyProtocol, ProxyType, type ProxyUrlType, type PullRequestFilesListType, type PullRequestInfoParamType, type PullRequestInfoResponseType, type PullRequestListParamType, type PullRequestListResponseType, type PullRequestNumberParamType, type ReRunRepoWorkflowParamType, type ReRunRepoWorkflowResponseType, 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 RemoveOrgMemberParamType, type RemoveOrgMemberResponseType, type RemoveSubIssueParamType, type RemoveSubIssueResponseType, type RepoBaseParamType, type RepoCommentsListParamType, type RepoCommentsListResponseType, 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 RevokeAccessTokenResponseType, type RoleNameType, type RunRepoWorkflow, type RunRepoWorkflowResponseType, type SearchRepo, type SearchReposParamType, type SearchReposResponseType, type SearchUser, type SearchUsersParamType, type SearchUsersResponseType, type ShaParamType, 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, type WorkflowInfoParamType, type WorkflowInfoResponseType, WorkflowState, create_state_id, Client as default, type formatParamType, format_date, get_langage_color, get_local_git_repo_info, get_local_git_repos_list, get_local_npm_package_info, get_local_npm_packages_list, get_local_repo_default_branch, get_relative_time, get_remote_repo_default_branch, index as github, type isAppInstalledInRepo, type workflowIdParamType };
|
4165
|
+
export { type AccessCodeType, type AccessTokenClentTYpe, type AccessTokenPermissionsType, type AccessTokenType, type AddCollaboratorResponseType, type AddMemberParamType, type AddMemberResponseType, type ApiResponseType, type AppClientType, type AppInfoParamType, type AppInfoResponseType, type AppPermissions, type AppRepoInfoResponseType, type AppUser, type BaseProxyType, 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 ContributionData, type ContributionResult, type CreateAccessTokenForAppParamType, type CreateAccessTokenForAppResponseType, 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 DisEnableRepoWorkflowParamType, type DisEnableRepoWorkflowResponseType, type EnableRepoWorkflowParamType, type EnableRepoWorkflowResponseType, type GetAppInfoByOrgParamType, type GetAppInfoByOrgResponseType, type GetAppInfoByRepoParamType, type GetAppInfoByRepoResponseType, type GetAppInfoByUserParamType, type GetAppInfoByUserResponseType, type GetCollaboratorListParamType, type GetCollaboratorListResponseType, type GetOrgMemberInfoParamType, type GetOrgMemberInfoResponseType, type GetOrgMemberListParamType, type GetOrgMemberListResponseType, type GetOrgMemberListType, 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 GetRepoWorkflowsList, type GetRepoWorkflowsListResponseType, type GitHubBaseClient, GitHubClient, type GitHubClientType, type GitInfoListType, type GitRepoInfoListOptionsType, type GitRepoInfoType, type GitRepoType, type GitType, type GitUser, type IssueCommentInfoParamType, type IssueCommentInfoResponseType, type IssueCommentsListParamType, type IssueCommentsListResponseType, 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 NpmPackageInfoListOptionsType, type NpmPackageInfoListType, type NpmPackageInfoType, type OpenIssueParamType, type OpenIssueResponseType, type OrgInfoParamType, type OrgInfoResponseType, type OrgNameParamType, type OrgRepoCreateParamType, type OrgRepoCreateResponseType, type OrgRepoListParmType, type OrgRepoListResponseType, type OrgUser, type ParentCommit, type PkgInfoType, type PrRepo, type PrUser, type ProxyParamsType, ProxyProtocol, ProxyType, type ProxyUrlType, type PullRequestFilesListType, type PullRequestInfoParamType, type PullRequestInfoResponseType, type PullRequestListParamType, type PullRequestListResponseType, type PullRequestNumberParamType, type ReRunRepoWorkflowParamType, type ReRunRepoWorkflowResponseType, 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 RemoveOrgMemberParamType, type RemoveOrgMemberResponseType, type RemoveSubIssueParamType, type RemoveSubIssueResponseType, type RepoBaseParamType, type RepoCommentsListParamType, type RepoCommentsListResponseType, 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 RevokeAccessTokenResponseType, type RoleNameType, type RunRepoWorkflow, type RunRepoWorkflowResponseType, type SearchRepo, type SearchReposParamType, type SearchReposResponseType, type SearchUser, type SearchUsersParamType, type SearchUsersResponseType, type ShaParamType, 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, type WorkflowInfoParamType, type WorkflowInfoResponseType, WorkflowState, create_state_id, Client as default, type formatParamType, format_date, get_langage_color, get_local_git_repo_info, get_local_git_repos_list, get_local_npm_package_info, get_local_npm_packages_list, get_local_repo_default_branch, get_relative_time, get_remote_repo_default_branch, index as github, type isAppInstalledInRepo, render_markdown, type workflowIdParamType };
|