@candriajs/git-neko-kit 0.8.5 → 0.8.7
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 +5 -5
- package/dist/index.d.ts +752 -522
- package/dist/index.mjs +5 -5
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
@@ -1,6 +1,29 @@
|
|
1
1
|
import { RawAxiosResponseHeaders, AxiosResponseHeaders } from 'axios';
|
2
2
|
import { ExecException, exec } from 'child_process';
|
3
3
|
|
4
|
+
/**
|
5
|
+
* 获取本地仓库的默认分支
|
6
|
+
* @param local_path - 本地仓库路径
|
7
|
+
* @returns 默认分支名称
|
8
|
+
* @example
|
9
|
+
* ```ts
|
10
|
+
* console.log(await get_local_repo_default_branch('/path/to/repo'))
|
11
|
+
* -> 'main'
|
12
|
+
* ```
|
13
|
+
*/
|
14
|
+
declare function get_local_repo_default_branch(local_path: string): Promise<string>;
|
15
|
+
/**
|
16
|
+
* 获取远程仓库的默认分支
|
17
|
+
* @param remote_url - 远程仓库URL
|
18
|
+
* @returns 默认分支名称
|
19
|
+
* @example
|
20
|
+
* ```ts
|
21
|
+
* console.log(await get_remote_repo_default_branch('https://github.com/CandriaJS/git-neko-kit'))
|
22
|
+
* -> 'main'
|
23
|
+
* ```
|
24
|
+
*/
|
25
|
+
declare function get_remote_repo_default_branch(remote_url: string): Promise<string>;
|
26
|
+
|
4
27
|
/** 代理地址类型 */
|
5
28
|
type ProxyUrlType = string;
|
6
29
|
/**
|
@@ -222,6 +245,16 @@ interface PullRequestNumberParamType {
|
|
222
245
|
/** 拉取请求id */
|
223
246
|
pr_number: number;
|
224
247
|
}
|
248
|
+
/**
|
249
|
+
* 角色名称参数
|
250
|
+
* - 角色名称
|
251
|
+
* @default 'member'
|
252
|
+
* - admin 管理员
|
253
|
+
* - member 成员
|
254
|
+
*/
|
255
|
+
interface RoleNameType {
|
256
|
+
role: 'admin' | 'member';
|
257
|
+
}
|
225
258
|
interface CommentIdParamType {
|
226
259
|
/** 评论id */
|
227
260
|
comment_id: number | string;
|
@@ -251,6 +284,7 @@ type GitHubClientType = GitHubBaseClient & {
|
|
251
284
|
};
|
252
285
|
/** 客户端类型 */
|
253
286
|
interface ClientType {
|
287
|
+
/** GitHub客户端 */
|
254
288
|
github: GitHubClientType;
|
255
289
|
}
|
256
290
|
|
@@ -290,138 +324,6 @@ interface UserInfoResponseType {
|
|
290
324
|
following: number;
|
291
325
|
}
|
292
326
|
|
293
|
-
type AppUser = Omit<UserInfoResponseType, 'bio' | 'blog' | 'followers' | 'following' | 'public_repos'>;
|
294
|
-
/**
|
295
|
-
* 定义 Base 应用所需的权限
|
296
|
-
*/
|
297
|
-
interface AppPermissions {
|
298
|
-
/** 对仓库内容的权限(例如读取、写入) */
|
299
|
-
contents: string;
|
300
|
-
/** 对部署的权限(例如读取、写入) */
|
301
|
-
deployments: string;
|
302
|
-
/** 对议题的权限(例如写) */
|
303
|
-
issues: string;
|
304
|
-
/** 对检查的权限 */
|
305
|
-
checks: string;
|
306
|
-
/** 对元数据的权限(例如读取) */
|
307
|
-
metadata: string;
|
308
|
-
}
|
309
|
-
interface AppInfoParamType {
|
310
|
-
/**
|
311
|
-
* 应用的标识符
|
312
|
-
* 是https://github.com/settings/apps/:app_slug的
|
313
|
-
* */
|
314
|
-
app_slug: string;
|
315
|
-
/** 访问令牌 */
|
316
|
-
access_token?: AccessTokenType['access_token'];
|
317
|
-
}
|
318
|
-
/**
|
319
|
-
* 应用的详细信息
|
320
|
-
*/
|
321
|
-
interface AppInfoResponseType {
|
322
|
-
/** 应用的唯一 ID */
|
323
|
-
id: number;
|
324
|
-
/** 应用的名称 */
|
325
|
-
name: string;
|
326
|
-
/** 应用的 Client ID */
|
327
|
-
client_id: string;
|
328
|
-
/** 应用的标识符(slug) */
|
329
|
-
slug: string;
|
330
|
-
/** 应用所有者的信息 */
|
331
|
-
owner: AppUser;
|
332
|
-
/** 应用的描述 */
|
333
|
-
description: string;
|
334
|
-
/** 应用的外部 URL */
|
335
|
-
external_url: string;
|
336
|
-
/** 应用的 Base 页面 URL */
|
337
|
-
html_url: string;
|
338
|
-
/** 应用所需的权限 */
|
339
|
-
permissions: AppPermissions;
|
340
|
-
/** 应用监听的事件列表 */
|
341
|
-
events: string[];
|
342
|
-
/** 应用创建时间的时间戳 */
|
343
|
-
created_at: string;
|
344
|
-
/** 应用最后更新时间的时间戳 */
|
345
|
-
updated_at: string;
|
346
|
-
}
|
347
|
-
/** GitHub应用安装仓库信息响应类型 */
|
348
|
-
interface AppRepoInfoResponseType {
|
349
|
-
/** 安装的唯一ID */
|
350
|
-
id: number;
|
351
|
-
/** 安装页面URL */
|
352
|
-
html_url: string;
|
353
|
-
/** 应用ID */
|
354
|
-
app_id: number;
|
355
|
-
/** 应用标识符 */
|
356
|
-
app_slug: string;
|
357
|
-
/** 目标ID(用户或组织的ID) */
|
358
|
-
target_id: number;
|
359
|
-
/** 目标类型(如'Organization') */
|
360
|
-
target_type: string;
|
361
|
-
/** 安装的账户信息,可以是用户或企业 */
|
362
|
-
account: AppUser;
|
363
|
-
/** 仓库选择类型 */
|
364
|
-
repository_selection: 'all' | 'selected';
|
365
|
-
/** 访问令牌URL */
|
366
|
-
access_tokens_url: string;
|
367
|
-
/** 仓库列表URL */
|
368
|
-
repositories_url: string;
|
369
|
-
/** 权限配置 */
|
370
|
-
permissions: AppPermissions;
|
371
|
-
/** 事件列表 */
|
372
|
-
events: string[];
|
373
|
-
/** 创建时间 */
|
374
|
-
created_at: string;
|
375
|
-
/** 更新时间 */
|
376
|
-
updated_at: string;
|
377
|
-
}
|
378
|
-
|
379
|
-
/** Github 授权令牌接口返回类型 */
|
380
|
-
interface TokenResponseType {
|
381
|
-
/** 是否成功刷新 */
|
382
|
-
success: boolean;
|
383
|
-
/** 获取访问令牌信息 */
|
384
|
-
info: string;
|
385
|
-
/** 用户访问令牌, 格式为 ghu_ 开头 */
|
386
|
-
access_token: string;
|
387
|
-
/** access_token 过期前的秒数,默认值为 28800(8小时) */
|
388
|
-
expires_in: number | null;
|
389
|
-
/** 刷新令牌,格式为 ghr_ 开头,可能为 null */
|
390
|
-
refresh_token: string | null;
|
391
|
-
/** refresh_token 过期前的秒数,默认值为 15897600(6个月) */
|
392
|
-
refresh_token_expires_in: number | null;
|
393
|
-
/** 令牌范围,默认是空字符串 */
|
394
|
-
scope: string;
|
395
|
-
/** 令牌类型,始终为 'bearer' */
|
396
|
-
token_type: 'bearer';
|
397
|
-
}
|
398
|
-
/** Github 刷新令牌接口返回类型 */
|
399
|
-
interface RefreshTokenResponseType {
|
400
|
-
/** 是否成功刷新 */
|
401
|
-
success: boolean;
|
402
|
-
/** 获取刷新令牌信息 */
|
403
|
-
info: string;
|
404
|
-
/** 用户访问令牌,格式为 ghu_ 开头 */
|
405
|
-
access_token: string;
|
406
|
-
/** access_token 过期前的秒数,默认值为 28800(8小时) */
|
407
|
-
expires_in: number | null;
|
408
|
-
/** 刷新令牌,格式为 ghr_ 开头,可能为 null */
|
409
|
-
refresh_token: string | null;
|
410
|
-
/** refresh_token 过期前的秒数,默认值为 15897600(6个月),可能为 null */
|
411
|
-
refresh_token_expires_in: number | null;
|
412
|
-
/** 令牌范围,默认是空字符串 */
|
413
|
-
scope: string;
|
414
|
-
/** 令牌类型,始终为 'bearer' */
|
415
|
-
token_type: 'bearer';
|
416
|
-
}
|
417
|
-
/** 检查Token状态返回类型 */
|
418
|
-
interface CheckTokenResponseType {
|
419
|
-
/** 令牌是否有效 */
|
420
|
-
success: boolean;
|
421
|
-
/** 状态信息 */
|
422
|
-
info: string;
|
423
|
-
}
|
424
|
-
|
425
327
|
interface CommitInfoCommonParamType {
|
426
328
|
/** 提交SHA */
|
427
329
|
sha?: ShaParamType['sha'];
|
@@ -534,60 +436,552 @@ type CommitListParamType = RepoParamType & {
|
|
534
436
|
/** 提交列表响应类型 */
|
535
437
|
type CommitListResponseType = CommitInfoResponseType[];
|
536
438
|
|
537
|
-
/**
|
538
|
-
type
|
539
|
-
/**
|
540
|
-
interface
|
541
|
-
/**
|
542
|
-
|
543
|
-
/**
|
544
|
-
|
545
|
-
/**
|
546
|
-
|
439
|
+
/** 仓库所有者参数类型 */
|
440
|
+
type RepoUser = Omit<UserInfoResponseType, 'followers' | 'following' | 'blog' | 'bio' | 'public_repos'>;
|
441
|
+
/** 仓库列表参数类型 */
|
442
|
+
interface RepoListBaseParamType {
|
443
|
+
/** 排序方式,可选created, updated, pushed, full_name, 默认为 full_name */
|
444
|
+
sort?: 'created' | 'updated' | 'pushed' | 'full_name';
|
445
|
+
/** 排序方式,可选asc, desc, 默认为 desc */
|
446
|
+
direction?: 'asc' | 'desc';
|
447
|
+
/** 每页数量 */
|
448
|
+
per_page?: number;
|
449
|
+
/** 页码 */
|
450
|
+
page?: number;
|
547
451
|
}
|
548
|
-
|
549
|
-
|
550
|
-
|
452
|
+
interface UserByTokenRepoListParamType extends RepoListBaseParamType {
|
453
|
+
/** 仓库的可见性,可选all, public, private, 默认为 all */
|
454
|
+
visibility?: 'all' | 'public' | 'private';
|
455
|
+
/** 仓库的状态,可选all, public, private, 默认为 all */
|
456
|
+
affiliation?: 'owner' | 'collaborator' | 'organization_member';
|
457
|
+
/** 类型,可选all, owner, member, 默认为 all */
|
458
|
+
type?: 'all' | 'owner' | 'member';
|
459
|
+
}
|
460
|
+
/** 仓库信息请求参数 */
|
461
|
+
type RepoInfoParamType = RepoBaseParamType;
|
462
|
+
/** * 仓库信息 */
|
463
|
+
interface RepoInfoResponseType {
|
464
|
+
/** * 仓库的唯一 ID */
|
551
465
|
id: number;
|
552
|
-
/**
|
553
|
-
|
554
|
-
/**
|
555
|
-
|
556
|
-
/**
|
557
|
-
|
558
|
-
/**
|
559
|
-
|
560
|
-
/**
|
466
|
+
/** * 仓库的名称 */
|
467
|
+
name: string;
|
468
|
+
/** * 仓库的完整名称,包含用户名或组织名 */
|
469
|
+
full_name: string;
|
470
|
+
/** * 仓库拥有者的信息 */
|
471
|
+
owner: RepoUser;
|
472
|
+
/** 仓库是否公开 */
|
473
|
+
public: boolean;
|
474
|
+
/** * 仓库是否私有 */
|
475
|
+
private: boolean;
|
476
|
+
/** * 仓库的可见性 */
|
477
|
+
visibility: 'public' | 'private';
|
478
|
+
/** * 仓库是否是 fork 仓库 */
|
479
|
+
fork: boolean;
|
480
|
+
/** * 仓库是否已归档 */
|
481
|
+
archived: boolean;
|
482
|
+
/** * 仓库是否被禁用 */
|
483
|
+
disabled: boolean;
|
484
|
+
/** * 仓库的 HTML 页面 URL */
|
485
|
+
html_url: string;
|
486
|
+
/** * 仓库的描述信息 */
|
561
487
|
description: string | null;
|
562
|
-
/**
|
563
|
-
|
564
|
-
/**
|
565
|
-
|
566
|
-
/**
|
488
|
+
/** * 仓库的 Stargazer 数量 */
|
489
|
+
stargazers_count: number;
|
490
|
+
/** * 仓库的 Watcher 数量 */
|
491
|
+
watchers_count: number;
|
492
|
+
/** * 仓库的主编程语言 */
|
493
|
+
language: string | null;
|
494
|
+
/** * 仓库的 fork 数量 */
|
495
|
+
forks_count: number;
|
496
|
+
/** * 开放的 issue 数量 */
|
497
|
+
open_issues_count: number;
|
498
|
+
/** * 仓库的默认分支 */
|
499
|
+
default_branch: string;
|
500
|
+
/** * 仓库的创建时间 */
|
567
501
|
created_at: string;
|
568
|
-
/**
|
502
|
+
/** * 仓库的更新时间 */
|
569
503
|
updated_at: string;
|
570
|
-
/**
|
571
|
-
|
572
|
-
/** 截止时间 */
|
573
|
-
due_on: string | null;
|
504
|
+
/** * 仓库的推送时间 */
|
505
|
+
pushed_at: string;
|
574
506
|
}
|
575
|
-
/**
|
576
|
-
|
577
|
-
/**
|
578
|
-
|
579
|
-
/**
|
580
|
-
|
581
|
-
|
507
|
+
/** 组织仓库列表参数类型 */
|
508
|
+
interface OrgRepoListParmType extends RepoListBaseParamType {
|
509
|
+
/** 组织名称 */
|
510
|
+
org: string;
|
511
|
+
/** 类型,可选all, public, private 默认为 all */
|
512
|
+
type?: 'all' | 'public' | 'private';
|
513
|
+
}
|
514
|
+
/**
|
515
|
+
* 组织仓库列表响应类型
|
516
|
+
* 该类型包含了多个仓库的信息,每个仓库都有自己的详细信息。
|
517
|
+
*/
|
518
|
+
type OrgRepoListResponseType = RepoInfoResponseType[];
|
519
|
+
/** 创建组织仓库请求参数 */
|
520
|
+
interface OrgRepoCreateParamType extends OrgNameParamType {
|
521
|
+
/** 仓库名称 */
|
522
|
+
name: string;
|
523
|
+
/** 仓库描述 */
|
524
|
+
description?: string;
|
525
|
+
/** 仓库主页 */
|
526
|
+
homepage?: string;
|
527
|
+
/** 仓库可见性 */
|
528
|
+
visibility?: 'public' | 'private';
|
529
|
+
/** 是否开启议题issue */
|
530
|
+
has_issues?: boolean;
|
531
|
+
/** 是否开启wiki */
|
532
|
+
has_wiki?: boolean;
|
533
|
+
/** 仓库自动初始化 */
|
534
|
+
auto_init?: boolean;
|
535
|
+
}
|
536
|
+
/** 创建组织仓库响应类型 */
|
537
|
+
type OrgRepoCreateResponseType = RepoInfoResponseType;
|
538
|
+
/** 创建用户仓库参数类型 */
|
539
|
+
type UserRepoCreateParamType = Omit<OrgRepoCreateParamType, 'org'> & RepoOwnerParamType;
|
540
|
+
/** 创建用户仓库响应类型 */
|
541
|
+
type UserRepoCreateResponseType = RepoInfoResponseType;
|
542
|
+
/** 用户仓库列表参数类型 */
|
543
|
+
interface UserRepoListParamType extends RepoListBaseParamType {
|
544
|
+
/** 用户名 */
|
545
|
+
username: string;
|
546
|
+
/** 类型,可选all, owner, member, 默认为 all */
|
547
|
+
type?: 'all' | 'owner' | 'member';
|
548
|
+
}
|
549
|
+
/** 用户仓库列表类型 */
|
550
|
+
type UserRepoListType = Array<RepoInfoResponseType & {
|
551
|
+
/** * 仓库的角色名称 */
|
552
|
+
role_name?: string;
|
553
|
+
}>;
|
554
|
+
/** 仓库语言信息类型 */
|
555
|
+
interface LanguageInfo {
|
556
|
+
/** 编程语言名称 */
|
557
|
+
language: string;
|
558
|
+
/** 语言对应的颜色 */
|
559
|
+
color: string;
|
560
|
+
/** 在仓库中的占比(百分比) */
|
561
|
+
percent: number;
|
562
|
+
/** 该语言的代码字节数 */
|
563
|
+
bytes: number;
|
564
|
+
}
|
565
|
+
/** 仓库语言列表参数类型 */
|
566
|
+
type RepoLanguagesListParamType = RepoBaseParamType;
|
567
|
+
/** 仓库语言列表类型 */
|
568
|
+
interface RepoLanguagesListResponseType {
|
569
|
+
/** 仓库的语言统计信息列表 */
|
570
|
+
languages: LanguageInfo[];
|
571
|
+
}
|
572
|
+
/** 获取仓库可见性参数类型 */
|
573
|
+
type GetRepoVisibilityParamType = RepoBaseParamType;
|
574
|
+
/** 获取仓库可见性响应类型 */
|
575
|
+
type GetRepoVisibilityResponseType = RepoInfoResponseType['visibility'];
|
576
|
+
/** 获取仓库默认分支参数类型 */
|
577
|
+
type GetRepoDefaultBranchParamType = RepoBaseParamType;
|
578
|
+
/** 获取仓库默认分支响应类型 */
|
579
|
+
type GetRepoDefaultBranchResponseType = RepoInfoResponseType['default_branch'];
|
580
|
+
/** 获取仓库主要语言参数类型 */
|
581
|
+
type GetRepoMainLanguageParamType = RepoBaseParamType;
|
582
|
+
/** 仓库主要语言响应类型 */
|
583
|
+
type GetRepoMainLanguageResponseType = RepoInfoResponseType['language'];
|
584
|
+
/**
|
585
|
+
* 协作者权限 ,可选 pull,triage, push, maintain, admin,默认pull
|
586
|
+
* pull - 只读访问,协作者可以查看仓库内容。
|
587
|
+
* push - 允许推送代码到仓库分支,同时拥有 pull 权限。
|
588
|
+
* admin - 拥有仓库的完全控制权,包括更改设置和删除仓库。
|
589
|
+
*/
|
590
|
+
type CollaboratorPermissionType = 'pull' | 'push' | 'admin';
|
591
|
+
/** 协作者参数类型 */
|
592
|
+
type CollaboratorParamType = RepoInfoParamType & UserNameParamType & {
|
593
|
+
/** 邀请的权限 */
|
594
|
+
permission?: CollaboratorPermissionType;
|
595
|
+
};
|
596
|
+
/** 邀请协作者响应类型 */
|
597
|
+
interface AddCollaboratorResponseType {
|
598
|
+
/** 被邀请者ID */
|
599
|
+
id: number;
|
600
|
+
/** 被邀请者用户名 */
|
601
|
+
login: string;
|
602
|
+
/** 被邀请者的别名 */
|
603
|
+
name: string | null;
|
604
|
+
/** 仓库的地址 */
|
605
|
+
html_url: string;
|
606
|
+
/** 被邀请者的权限 */
|
607
|
+
permissions: string;
|
608
|
+
}
|
609
|
+
/** 协作者列表参数类型 */
|
610
|
+
type GetCollaboratorListParamType = RepoInfoParamType & {
|
611
|
+
/**
|
612
|
+
* 筛选按隶属关系返回的协作者
|
613
|
+
* outside - 列出所有外部协作者,包括仓库成员和外部 collaborator。
|
614
|
+
* direct - 列出仓库成员。
|
615
|
+
* all - 列出仓库成员和外部 collaborator。
|
616
|
+
*/
|
617
|
+
affiliation?: 'outside' | 'direct' | 'all';
|
618
|
+
/** 权限 */
|
619
|
+
permission?: CollaboratorPermissionType;
|
620
|
+
/** 每页数量 */
|
621
|
+
per_page?: number;
|
622
|
+
/** 页码 */
|
623
|
+
page?: number;
|
624
|
+
};
|
625
|
+
/** 协作者信息类型 */
|
626
|
+
interface CollaboratorInfoResponseType {
|
627
|
+
/** 协作者id */
|
628
|
+
id: number;
|
629
|
+
/** 协作者登录名 */
|
630
|
+
login: string;
|
631
|
+
/** 头像URL */
|
632
|
+
avatar_url: string;
|
633
|
+
/** 协作者邮箱 */
|
634
|
+
email: string | null;
|
635
|
+
/** 协作者姓名 */
|
636
|
+
name: string | null;
|
637
|
+
/** 权限设置 */
|
638
|
+
permissions: {
|
639
|
+
/** 拉取权限 */
|
640
|
+
pull: boolean;
|
641
|
+
/** 分类权限 */
|
642
|
+
triage: boolean;
|
643
|
+
/** 推送权限 */
|
644
|
+
push: boolean;
|
645
|
+
/** 维护权限 */
|
646
|
+
maintain: boolean;
|
647
|
+
/** 管理权限 */
|
648
|
+
admin: boolean;
|
649
|
+
};
|
650
|
+
}
|
651
|
+
/** 协作者列表响应类型 */
|
652
|
+
type GetCollaboratorListResponseType = CollaboratorInfoResponseType[];
|
653
|
+
/** 移除协作者参数类型 */
|
654
|
+
type RemoveCollaboratorParamType = RepoBaseParamType & UserNameParamType;
|
655
|
+
/** 移除协作者响应类型 */
|
656
|
+
interface RemoveCollaboratorResponseType {
|
657
|
+
/** 是否移除成功 */
|
658
|
+
success: boolean;
|
659
|
+
/** 状态信息 */
|
660
|
+
message: string;
|
661
|
+
}
|
662
|
+
|
663
|
+
type AppUser = Omit<UserInfoResponseType, 'bio' | 'blog' | 'followers' | 'following' | 'public_repos'>;
|
664
|
+
/**
|
665
|
+
* 定义 Base 应用所需的权限
|
666
|
+
*/
|
667
|
+
interface AppPermissions {
|
668
|
+
/** 对仓库内容的权限(例如读取、写入) */
|
669
|
+
contents: string;
|
670
|
+
/** 对部署的权限(例如读取、写入) */
|
671
|
+
deployments: string;
|
672
|
+
/** 对议题的权限(例如写) */
|
673
|
+
issues: string;
|
674
|
+
/** 对检查的权限 */
|
675
|
+
checks: string;
|
676
|
+
/** 对元数据的权限(例如读取) */
|
677
|
+
metadata: string;
|
678
|
+
}
|
679
|
+
interface AppInfoParamType {
|
680
|
+
/**
|
681
|
+
* 应用的标识符
|
682
|
+
* 是https://github.com/settings/apps/:app_slug的
|
683
|
+
* */
|
684
|
+
app_slug: string;
|
685
|
+
}
|
686
|
+
/**
|
687
|
+
* 应用的详细信息
|
688
|
+
*/
|
689
|
+
interface AppInfoResponseType {
|
690
|
+
/** 应用的唯一 ID */
|
691
|
+
id: number;
|
692
|
+
/** 应用的名称 */
|
693
|
+
name: string;
|
694
|
+
/** 应用的 Client ID */
|
695
|
+
client_id: string;
|
696
|
+
/** 应用的标识符(slug) */
|
697
|
+
slug: string;
|
698
|
+
/** 应用所有者的信息 */
|
699
|
+
owner: AppUser;
|
700
|
+
/** 应用的描述 */
|
701
|
+
description: string;
|
702
|
+
/** 应用的外部 URL */
|
703
|
+
external_url: string;
|
704
|
+
/** 应用的 Base 页面 URL */
|
705
|
+
html_url: string;
|
706
|
+
/** 应用所需的权限 */
|
707
|
+
permissions: AppPermissions;
|
708
|
+
/** 应用监听的事件列表 */
|
709
|
+
events: string[];
|
710
|
+
/** 应用创建时间的时间戳 */
|
711
|
+
created_at: string;
|
712
|
+
/** 应用最后更新时间的时间戳 */
|
713
|
+
updated_at: string;
|
714
|
+
}
|
715
|
+
/** GitHub应用安装仓库信息响应类型 */
|
716
|
+
interface AppRepoInfoResponseType {
|
717
|
+
/** 安装的唯一ID */
|
718
|
+
id: number;
|
719
|
+
/** 安装页面URL */
|
720
|
+
html_url: string;
|
721
|
+
/** 应用ID */
|
722
|
+
app_id: number;
|
723
|
+
/** 应用标识符 */
|
724
|
+
app_slug: string;
|
725
|
+
/** 目标ID(用户或组织的ID) */
|
726
|
+
target_id: number;
|
727
|
+
/** 目标类型(如'Organization') */
|
728
|
+
target_type: string;
|
729
|
+
/** 安装的账户信息,可以是用户或企业 */
|
730
|
+
account: AppUser;
|
731
|
+
/** 仓库选择类型 */
|
732
|
+
repository_selection: 'all' | 'selected';
|
733
|
+
/** 访问令牌URL */
|
734
|
+
access_tokens_url: string;
|
735
|
+
/** 仓库列表URL */
|
736
|
+
repositories_url: string;
|
737
|
+
/** 权限配置 */
|
738
|
+
permissions: AppPermissions;
|
739
|
+
/** 事件列表 */
|
740
|
+
events: string[];
|
741
|
+
/** 创建时间 */
|
742
|
+
created_at: string;
|
743
|
+
/** 更新时间 */
|
744
|
+
updated_at: string;
|
745
|
+
}
|
746
|
+
/** 通过仓库信息获取应用信息参数类型 */
|
747
|
+
type GetAppInfoByRepoParamType = RepoInfoParamType;
|
748
|
+
/** 通过仓库信息获取应用信息响应类型 */
|
749
|
+
type GetAppInfoByRepoResponseType = AppRepoInfoResponseType;
|
750
|
+
/** 通过用户信息获取应用信息参数 */
|
751
|
+
type GetAppInfoByUserParamType = UserNameParamType;
|
752
|
+
/** 通过用户信息获取应用信息响应类型 */
|
753
|
+
type GetAppInfoByUserResponseType = AppRepoInfoResponseType;
|
754
|
+
/** 通过用户信息获取应用信息参数 */
|
755
|
+
type GetAppInfoByOrgParamType = OrgNameParamType;
|
756
|
+
/** 通过用户信息获取应用信息响应类型 */
|
757
|
+
type GetAppInfoByOrgResponseType = AppRepoInfoResponseType;
|
758
|
+
/** 访问令牌权限 */
|
759
|
+
interface AccessTokenPermissionsType {
|
760
|
+
/** GitHub Actions 工作流、工作流运行和工件的权限 */
|
761
|
+
actions: 'read' | 'write';
|
762
|
+
/** 存储库创建、删除、设置、团队和协作者创建的权限 */
|
763
|
+
administration: 'read' | 'write';
|
764
|
+
/** 代码检查的权限 */
|
765
|
+
checks: 'read' | 'write';
|
766
|
+
/** 创建、编辑、删除和列出 GitHub Codespaces 的权限 */
|
767
|
+
codespaces: 'read' | 'write';
|
768
|
+
/** 存储库内容、提交、分支、下载、发布和合并的权限 */
|
769
|
+
contents: 'read' | 'write';
|
770
|
+
/** 管理 Dependabot 密钥的权限 */
|
771
|
+
dependabot_secrets: 'read' | 'write';
|
772
|
+
/** 部署和部署状态的权限 */
|
773
|
+
deployments: 'read' | 'write';
|
774
|
+
/** 管理存储库环境的权限 */
|
775
|
+
environments: 'read' | 'write';
|
776
|
+
/** 问题和相关评论、指派、标签和里程碑的权限 */
|
777
|
+
issues: 'read' | 'write';
|
778
|
+
/** 搜索存储库、列出协作者和访问存储库元数据的权限 */
|
779
|
+
metadata: 'read' | 'write';
|
780
|
+
/** 管理 GitHub Packages 发布的包的权限 */
|
781
|
+
packages: 'read' | 'write';
|
782
|
+
/** 获取 Pages 状态、配置和构建的权限,并创建新的构建 */
|
783
|
+
pages: 'read' | 'write';
|
784
|
+
/** 管理拉取请求及相关评论、指派、标签、里程碑和合并的权限 */
|
785
|
+
pull_requests: 'read' | 'write';
|
786
|
+
/** 查看和编辑存储库自定义属性的权限 */
|
787
|
+
repository_custom_properties: 'read' | 'write';
|
788
|
+
/** 管理存储库的 post-receive 钩子的权限 */
|
789
|
+
repository_hooks: 'read' | 'write';
|
790
|
+
/** 管理存储库项目、列和卡片的权限 */
|
791
|
+
repository_projects: 'read' | 'write' | 'admin';
|
792
|
+
/** 查看和管理秘密扫描警报的权限 */
|
793
|
+
secret_scanning_alerts: 'read' | 'write';
|
794
|
+
/** 管理存储库秘密的权限 */
|
795
|
+
secrets: 'read' | 'write';
|
796
|
+
/** 查看和管理安全事件的权限,比如代码扫描警报 */
|
797
|
+
security_events: 'read' | 'write';
|
798
|
+
/** 只管理单个文件的权限 */
|
799
|
+
single_file: 'read' | 'write';
|
800
|
+
/** 管理提交状态的权限 */
|
801
|
+
statuses: 'read' | 'write';
|
802
|
+
/** 管理 Dependabot 警报的权限 */
|
803
|
+
vulnerability_alerts: 'read' | 'write';
|
804
|
+
/** 更新 GitHub Actions 工作流文件的权限 */
|
805
|
+
workflows: 'write';
|
806
|
+
/** 管理组织团队和成员的权限 */
|
807
|
+
members: 'read' | 'write';
|
808
|
+
/** 管理组织访问权限的权限 */
|
809
|
+
organization_administration: 'read' | 'write';
|
810
|
+
/** 管理自定义存储库角色的权限 */
|
811
|
+
organization_custom_roles: 'read' | 'write';
|
812
|
+
/** 管理自定义组织角色的权限 */
|
813
|
+
organization_custom_org_roles: 'read' | 'write';
|
814
|
+
/** 管理自定义属性的权限 */
|
815
|
+
organization_custom_properties: 'read' | 'write' | 'admin';
|
816
|
+
/** 管理 GitHub Copilot 组织成员访问权限的权限 */
|
817
|
+
organization_copilot_seat_management: 'write';
|
818
|
+
/** 查看和管理组织公告横幅的权限 */
|
819
|
+
organization_announcement_banners: 'read' | 'write';
|
820
|
+
/** 查看组织活动的权限 */
|
821
|
+
organization_events: 'read';
|
822
|
+
/** 管理组织的 post-receive 钩子的权限 */
|
823
|
+
organization_hooks: 'read' | 'write';
|
824
|
+
/** 查看和管理组织的个人访问令牌请求的权限 */
|
825
|
+
organization_personal_access_tokens: 'read' | 'write';
|
826
|
+
/** 查看和管理组织批准的个人访问令牌的权限 */
|
827
|
+
organization_personal_access_token_requests: 'read' | 'write';
|
828
|
+
/** 查看组织计划的权限 */
|
829
|
+
organization_plan: 'read';
|
830
|
+
/** 管理组织项目的权限 */
|
831
|
+
organization_projects: 'read' | 'write' | 'admin';
|
832
|
+
/** 管理组织 GitHub Packages 包的权限 */
|
833
|
+
organization_packages: 'read' | 'write';
|
834
|
+
/** 管理组织秘密的权限 */
|
835
|
+
organization_secrets: 'read' | 'write';
|
836
|
+
/** 查看和管理组织 GitHub Actions 自托管运行器的权限 */
|
837
|
+
organization_self_hosted_runners: 'read' | 'write';
|
838
|
+
/** 查看和管理被组织屏蔽的用户的权限 */
|
839
|
+
organization_user_blocking: 'read' | 'write';
|
840
|
+
/** 管理团队讨论和相关评论的权限 */
|
841
|
+
team_discussions: 'read' | 'write';
|
842
|
+
/** 管理用户的电子邮件地址的权限 */
|
843
|
+
email_addresses: 'read' | 'write';
|
844
|
+
/** 管理用户的关注者的权限 */
|
845
|
+
followers: 'read' | 'write';
|
846
|
+
/** 管理 Git SSH 密钥的权限 */
|
847
|
+
git_ssh_keys: 'read' | 'write';
|
848
|
+
/** 查看和管理 GPG 密钥的权限 */
|
849
|
+
gpg_keys: 'read' | 'write';
|
850
|
+
/** 查看和管理存储库的互动限制的权限 */
|
851
|
+
interaction_limits: 'read' | 'write';
|
852
|
+
/** 管理用户的个人资料设置的权限 */
|
853
|
+
profile: 'write';
|
854
|
+
/** 列出和管理用户标星的存储库的权限 */
|
855
|
+
starring: 'read' | 'write';
|
856
|
+
}
|
857
|
+
/** 为应用创建访问令牌参数类型 */
|
858
|
+
interface CreateAccessTokenForAppParamType {
|
859
|
+
/** 应用安装id */
|
860
|
+
installation_id: number;
|
861
|
+
/** 存储库名称列表 */
|
862
|
+
repositories: Array<string>;
|
863
|
+
/** 存储库id列表 */
|
864
|
+
repository_ids: Array<number>;
|
865
|
+
/** 访问令牌权限 */
|
866
|
+
permissions: AccessTokenPermissionsType;
|
867
|
+
}
|
868
|
+
/** 为应用创建访问令牌响应类型 */
|
869
|
+
interface CreateAccessTokenForAppResponseType {
|
870
|
+
/** 访问令牌 */
|
871
|
+
token: string;
|
872
|
+
/** 访问令牌过期时间 */
|
873
|
+
expires_at: string;
|
874
|
+
/** 访问令牌权限 */
|
875
|
+
permissions: Record<string, string>;
|
876
|
+
/** 访问令牌仓库选择范围 */
|
877
|
+
repository_selection: 'all' | 'selected';
|
878
|
+
/** 访问令牌仓库列表 */
|
879
|
+
repositories: Array<RepoInfoResponseType>;
|
880
|
+
}
|
881
|
+
/** 撤销应用程序访问令牌响应类型 */
|
882
|
+
interface RevokeAccessTokenResponseType {
|
883
|
+
/** 是否撤销成功 */
|
884
|
+
success: boolean;
|
885
|
+
/** 撤销结果信息 */
|
886
|
+
message: string;
|
887
|
+
}
|
888
|
+
|
889
|
+
/** Github 授权令牌接口返回类型 */
|
890
|
+
interface TokenResponseType {
|
891
|
+
/** 是否成功刷新 */
|
892
|
+
success: boolean;
|
893
|
+
/** 获取访问令牌信息 */
|
894
|
+
message: string;
|
895
|
+
/** 用户访问令牌, 格式为 ghu_ 开头 */
|
896
|
+
access_token: string;
|
897
|
+
/** access_token 过期前的秒数,默认值为 28800(8小时) */
|
898
|
+
expires_in: number | null;
|
899
|
+
/** 刷新令牌,格式为 ghr_ 开头,可能为 null */
|
900
|
+
refresh_token: string | null;
|
901
|
+
/** refresh_token 过期前的秒数,默认值为 15897600(6个月) */
|
902
|
+
refresh_token_expires_in: number | null;
|
903
|
+
/** 令牌范围,默认是空字符串 */
|
904
|
+
scope: string;
|
905
|
+
/** 令牌类型,始终为 'bearer' */
|
906
|
+
token_type: 'bearer';
|
907
|
+
}
|
908
|
+
/** Github 刷新令牌接口返回类型 */
|
909
|
+
interface RefreshTokenResponseType {
|
910
|
+
/** 是否成功刷新 */
|
911
|
+
success: boolean;
|
912
|
+
/** 获取刷新令牌信息 */
|
913
|
+
message: string;
|
914
|
+
/** 用户访问令牌,格式为 ghu_ 开头 */
|
915
|
+
access_token: string;
|
916
|
+
/** access_token 过期前的秒数,默认值为 28800(8小时) */
|
917
|
+
expires_in: number | null;
|
918
|
+
/** 刷新令牌,格式为 ghr_ 开头,可能为 null */
|
919
|
+
refresh_token: string | null;
|
920
|
+
/** refresh_token 过期前的秒数,默认值为 15897600(6个月),可能为 null */
|
921
|
+
refresh_token_expires_in: number | null;
|
922
|
+
/** 令牌范围,默认是空字符串 */
|
923
|
+
scope: string;
|
924
|
+
/** 令牌类型,始终为 'bearer' */
|
925
|
+
token_type: 'bearer';
|
926
|
+
}
|
927
|
+
/** 检查Token状态返回类型 */
|
928
|
+
interface CheckTokenResponseType {
|
929
|
+
/** 令牌是否有效 */
|
930
|
+
success: boolean;
|
931
|
+
/** 状态信息 */
|
932
|
+
message: string;
|
933
|
+
}
|
934
|
+
|
935
|
+
/** 议题用户信息响应类型 */
|
936
|
+
type IssueUser = Omit<UserInfoResponseType, 'bio' | 'blog' | 'followers' | 'following' | 'public_repos' | 'type'>;
|
937
|
+
/** 议题标签类型 */
|
938
|
+
interface IssueLabelType {
|
939
|
+
/** 标签ID */
|
940
|
+
id: number;
|
941
|
+
/** 标签名称 */
|
942
|
+
name: string;
|
943
|
+
/** 标签颜色代码 */
|
944
|
+
color?: string | null;
|
945
|
+
}
|
946
|
+
/** 议题里程碑类型 */
|
947
|
+
interface MilestoneType {
|
948
|
+
/** 里程碑ID */
|
949
|
+
id: number;
|
950
|
+
/** 里程碑URL */
|
951
|
+
url: string;
|
952
|
+
/** 里程碑编号 */
|
953
|
+
number: number;
|
954
|
+
/** 里程碑状态: open/closed */
|
955
|
+
state: 'open' | 'closed';
|
956
|
+
/** 里程碑标题 */
|
957
|
+
title: string;
|
958
|
+
/** 里程碑描述 */
|
959
|
+
description: string | null;
|
960
|
+
/** 开放议题数 */
|
961
|
+
open_issues: number;
|
962
|
+
/** 关闭议题数 */
|
963
|
+
closed_issues: number;
|
964
|
+
/** 创建时间 */
|
965
|
+
created_at: string;
|
966
|
+
/** 更新时间 */
|
967
|
+
updated_at: string;
|
968
|
+
/** 关闭时间 */
|
969
|
+
closed_at: string | null;
|
970
|
+
/** 截止时间 */
|
971
|
+
due_on: string | null;
|
972
|
+
}
|
973
|
+
/** 议题信息参数类型 */
|
974
|
+
type IssueInfoParamType = RepoBaseParamType & IssueNumberParamType;
|
975
|
+
/** 议题详情响应类型 */
|
976
|
+
interface IssueInfoResponseType {
|
977
|
+
/** 议题ID */
|
978
|
+
id: IssueNumberParamType['issue_number'];
|
979
|
+
/** 议题HTML页面URL */
|
582
980
|
html_url: string;
|
583
981
|
/** 议题编号 */
|
584
982
|
number: number;
|
585
|
-
/** 评论数 */
|
586
|
-
comments: number;
|
587
983
|
/** 议题状态: open/closed */
|
588
984
|
state: string;
|
589
|
-
/** 状态原因: completed/reopened/not_planned/null */
|
590
|
-
state_reason: string | null;
|
591
985
|
/** 议题标题 */
|
592
986
|
title: string;
|
593
987
|
/** 议题正文内容 */
|
@@ -748,13 +1142,20 @@ interface LockIssueParamType extends RepoBaseParamType {
|
|
748
1142
|
}
|
749
1143
|
/** 锁定议题响应类型 */
|
750
1144
|
interface LockIssueResponseType {
|
1145
|
+
/** 是否成功锁定 */
|
1146
|
+
success: boolean;
|
751
1147
|
/** 锁定状态信息 */
|
752
|
-
|
1148
|
+
message: string;
|
753
1149
|
}
|
754
1150
|
/** 解锁议题参数类型 */
|
755
1151
|
type UnLockIssueParamType = Omit<LockIssueParamType, 'lock_reason'>;
|
756
1152
|
/** 解锁议题响应类型 */
|
757
|
-
|
1153
|
+
interface UnLockIssueResponseType {
|
1154
|
+
/** 是否成功解锁 */
|
1155
|
+
success: LockIssueResponseType['success'];
|
1156
|
+
/** 解锁状态信息 */
|
1157
|
+
message: LockIssueResponseType['message'];
|
1158
|
+
}
|
758
1159
|
/** 议题评论信息参数类型 */
|
759
1160
|
interface IssueCommentInfoParamType extends RepoBaseParamType {
|
760
1161
|
/** 评论id,评论唯一标识符 */
|
@@ -776,7 +1177,7 @@ interface IssueCommentInfoResponseType {
|
|
776
1177
|
updated_at: string;
|
777
1178
|
}
|
778
1179
|
/** 仓库评论列表参数类型 */
|
779
|
-
interface
|
1180
|
+
interface RepoCommentsListParamType extends RepoBaseParamType {
|
780
1181
|
/**
|
781
1182
|
* 排序依据
|
782
1183
|
* 用于指定结果的排序属性
|
@@ -819,9 +1220,9 @@ interface RepoCommentListParamType extends RepoBaseParamType {
|
|
819
1220
|
page?: number;
|
820
1221
|
}
|
821
1222
|
/** 仓库评论列表响应类型 */
|
822
|
-
type
|
1223
|
+
type RepoCommentsListResponseType = IssueCommentInfoResponseType[];
|
823
1224
|
/** 议题评论列表参数类型 */
|
824
|
-
interface
|
1225
|
+
interface IssueCommentsListParamType extends RepoBaseParamType {
|
825
1226
|
/** 议题ID */
|
826
1227
|
issue_number: number;
|
827
1228
|
/**
|
@@ -841,315 +1242,95 @@ interface IssueCommentListParamType extends RepoBaseParamType {
|
|
841
1242
|
* 页码
|
842
1243
|
* @default 1
|
843
1244
|
* @remarks 取值范围:1-100
|
844
|
-
*/
|
845
|
-
page?: number;
|
846
|
-
}
|
847
|
-
/** 议题评论列表响应类型 */
|
848
|
-
type IssueCommentListResponseType = IssueCommentInfoResponseType[];
|
849
|
-
/** 创建议题评论参数类型 */
|
850
|
-
interface CreteIssueCommentParamType extends RepoBaseParamType {
|
851
|
-
/** 议题ID */
|
852
|
-
issue_number: IssueNumberParamType['issue_number'];
|
853
|
-
/** 评论内容 */
|
854
|
-
body: string;
|
855
|
-
}
|
856
|
-
/** 创建议题评论响应类型 */
|
857
|
-
type CreteIssueCommentResponseType = IssueCommentInfoResponseType;
|
858
|
-
/** 更新议题评论参数类型 */
|
859
|
-
interface UpdateIssueCommentParamType extends IssueCommentInfoParamType {
|
860
|
-
/** 评论内容 */
|
861
|
-
body: string;
|
862
|
-
}
|
863
|
-
/** 更新议题评论响应类型 */
|
864
|
-
type UpdateIssueCommentResponseType = IssueCommentInfoResponseType;
|
865
|
-
/** 删除议题评论参数类型 */
|
866
|
-
interface RemoveIssueCommentParamType extends RepoBaseParamType {
|
867
|
-
/** 评论ID */
|
868
|
-
comment_id: string | number;
|
869
|
-
}
|
870
|
-
/** 删除议题评论响应类型 */
|
871
|
-
interface RemoveIssueCommentResponseType {
|
872
|
-
/** 删除状态信息 */
|
873
|
-
info: string;
|
874
|
-
}
|
875
|
-
/** 获取子议题列表参数类型 */
|
876
|
-
interface SubIssueListParamType extends RepoBaseParamType {
|
877
|
-
/** 议题ID */
|
878
|
-
issue_number: IssueNumberParamType['issue_number'];
|
879
|
-
/**
|
880
|
-
* 每页结果数量
|
881
|
-
* @default 30
|
882
|
-
*/
|
883
|
-
per_page?: number;
|
884
|
-
/**
|
885
|
-
* 页码
|
886
|
-
* @default 1
|
887
|
-
*/
|
888
|
-
page?: number;
|
889
|
-
}
|
890
|
-
/** 获取子议题列表响应类型 */
|
891
|
-
type SubIssueListResponseType = IssueInfoResponseType[];
|
892
|
-
/** 添加子议题参数类型 */
|
893
|
-
interface CreateSubIssueParamType extends RepoBaseParamType {
|
894
|
-
/** 议题ID */
|
895
|
-
issue_number: IssueNumberParamType['issue_number'];
|
896
|
-
/** * 子议题ID */
|
897
|
-
sub_issue_id: IssueNumberParamType['issue_number'];
|
898
|
-
/** * 是否替换父议题 */
|
899
|
-
replace_parent: boolean;
|
900
|
-
}
|
901
|
-
/** 添加子议题响应类型 */
|
902
|
-
type CreateSubIssueResponseType = IssueInfoResponseType;
|
903
|
-
/** 删除子议题参数类型 */
|
904
|
-
interface RemoveSubIssueParamType extends RepoBaseParamType {
|
905
|
-
/** 议题ID */
|
906
|
-
issue_number: IssueNumberParamType['issue_number'];
|
907
|
-
/** 子议题ID */
|
908
|
-
sub_issue_id: IssueNumberParamType['issue_number'];
|
909
|
-
}
|
910
|
-
/** 删除子议题响应类型 */
|
911
|
-
type RemoveSubIssueResponseType = IssueInfoResponseType;
|
912
|
-
/** 重新确定子议题优先级参数类型 */
|
913
|
-
interface ReprioritizeSubIssueParamType extends RepoBaseParamType {
|
914
|
-
/** 议题ID */
|
915
|
-
issue_number: IssueNumberParamType['issue_number'];
|
916
|
-
/** 子议题ID */
|
917
|
-
sub_issue_id: IssueNumberParamType['issue_number'];
|
918
|
-
/**
|
919
|
-
* 要优先排序的子问题的 ID(与 before_id 互斥,只能指定其中一个)
|
920
|
-
* 在此 ID 之后放置子问题
|
921
|
-
*/
|
922
|
-
after_id?: IssueNumberParamType['issue_number'];
|
923
|
-
/**
|
924
|
-
* 要优先排序的子问题的 ID(与 after_id 互斥,只能指定其中一个)
|
925
|
-
* 在此 ID 之前放置子问题
|
926
|
-
*/
|
927
|
-
before_id?: IssueNumberParamType['issue_number'];
|
928
|
-
}
|
929
|
-
/** 重新确定子议题优先级响应类型 */
|
930
|
-
type ReprioritizeSubIssueResponseType = IssueInfoResponseType;
|
931
|
-
|
932
|
-
/** 仓库所有者参数类型 */
|
933
|
-
type RepoUser = Omit<UserInfoResponseType, 'followers' | 'following' | 'blog' | 'bio' | 'public_repos'>;
|
934
|
-
/** 仓库列表参数类型 */
|
935
|
-
interface RepoListBaseParamType {
|
936
|
-
/** 排序方式,可选created, updated, pushed, full_name, 默认为 full_name */
|
937
|
-
sort?: 'created' | 'updated' | 'pushed' | 'full_name';
|
938
|
-
/** 排序方式,可选asc, desc, 默认为 desc */
|
939
|
-
direction?: 'asc' | 'desc';
|
940
|
-
/** 每页数量 */
|
941
|
-
per_page?: number;
|
942
|
-
/** 页码 */
|
943
|
-
page?: number;
|
944
|
-
}
|
945
|
-
interface UserByTokenRepoListParamType extends RepoListBaseParamType {
|
946
|
-
/** 仓库的可见性,可选all, public, private, 默认为 all */
|
947
|
-
visibility?: 'all' | 'public' | 'private';
|
948
|
-
/** 仓库的状态,可选all, public, private, 默认为 all */
|
949
|
-
affiliation?: 'owner' | 'collaborator' | 'organization_member';
|
950
|
-
/** 类型,可选all, owner, member, 默认为 all */
|
951
|
-
type?: 'all' | 'owner' | 'member';
|
952
|
-
}
|
953
|
-
/** 仓库信息请求参数 */
|
954
|
-
type RepoInfoParamType = RepoBaseParamType;
|
955
|
-
/** * 仓库信息 */
|
956
|
-
interface RepoInfoResponseType {
|
957
|
-
/** * 仓库的唯一 ID */
|
958
|
-
id: number;
|
959
|
-
/** * 仓库的名称 */
|
960
|
-
name: string;
|
961
|
-
/** * 仓库的完整名称,包含用户名或组织名 */
|
962
|
-
full_name: string;
|
963
|
-
/** * 仓库拥有者的信息 */
|
964
|
-
owner: RepoUser;
|
965
|
-
/** 仓库是否公开 */
|
966
|
-
public: boolean;
|
967
|
-
/** * 仓库是否私有 */
|
968
|
-
private: boolean;
|
969
|
-
/** * 仓库的可见性 */
|
970
|
-
visibility: 'public' | 'private';
|
971
|
-
/** * 仓库是否是 fork 仓库 */
|
972
|
-
fork: boolean;
|
973
|
-
/** * 仓库是否已归档 */
|
974
|
-
archived: boolean;
|
975
|
-
/** * 仓库是否被禁用 */
|
976
|
-
disabled: boolean;
|
977
|
-
/** * 仓库的 HTML 页面 URL */
|
978
|
-
html_url: string;
|
979
|
-
/** * 仓库的描述信息 */
|
980
|
-
description: string | null;
|
981
|
-
/** * 仓库的 Stargazer 数量 */
|
982
|
-
stargazers_count: number;
|
983
|
-
/** * 仓库的 Watcher 数量 */
|
984
|
-
watchers_count: number;
|
985
|
-
/** * 仓库的主编程语言 */
|
986
|
-
language: string | null;
|
987
|
-
/** * 仓库的 fork 数量 */
|
988
|
-
forks_count: number;
|
989
|
-
/** * 开放的 issue 数量 */
|
990
|
-
open_issues_count: number;
|
991
|
-
/** * 仓库的默认分支 */
|
992
|
-
default_branch: string;
|
993
|
-
/** * 仓库的创建时间 */
|
994
|
-
created_at: string;
|
995
|
-
/** * 仓库的更新时间 */
|
996
|
-
updated_at: string;
|
997
|
-
/** * 仓库的推送时间 */
|
998
|
-
pushed_at: string;
|
999
|
-
}
|
1000
|
-
/** 组织仓库列表参数类型 */
|
1001
|
-
interface OrgRepoListParmType extends RepoListBaseParamType {
|
1002
|
-
/** 组织名称 */
|
1003
|
-
org: string;
|
1004
|
-
/** 类型,可选all, public, private 默认为 all */
|
1005
|
-
type?: 'all' | 'public' | 'private';
|
1006
|
-
}
|
1007
|
-
/**
|
1008
|
-
* 组织仓库列表响应类型
|
1009
|
-
* 该类型包含了多个仓库的信息,每个仓库都有自己的详细信息。
|
1010
|
-
*/
|
1011
|
-
type OrgRepoListResponseType = RepoInfoResponseType[];
|
1012
|
-
/** 创建组织仓库请求参数 */
|
1013
|
-
interface OrgRepoCreateParamType extends OrgNameParamType {
|
1014
|
-
/** 仓库名称 */
|
1015
|
-
name: string;
|
1016
|
-
/** 仓库描述 */
|
1017
|
-
description?: string;
|
1018
|
-
/** 仓库主页 */
|
1019
|
-
homepage?: string;
|
1020
|
-
/** 仓库可见性 */
|
1021
|
-
visibility?: 'public' | 'private';
|
1022
|
-
/** 是否开启议题issue */
|
1023
|
-
has_issues?: boolean;
|
1024
|
-
/** 是否开启wiki */
|
1025
|
-
has_wiki?: boolean;
|
1026
|
-
/** 仓库自动初始化 */
|
1027
|
-
auto_init?: boolean;
|
1028
|
-
}
|
1029
|
-
/** 创建组织仓库响应类型 */
|
1030
|
-
type OrgRepoCreateResponseType = RepoInfoResponseType;
|
1031
|
-
/** 创建用户仓库参数类型 */
|
1032
|
-
type UserRepoCreateParamType = Omit<OrgRepoCreateParamType, 'org'> & RepoOwnerParamType;
|
1033
|
-
/** 创建用户仓库响应类型 */
|
1034
|
-
type UserRepoCreateResponseType = RepoInfoResponseType;
|
1035
|
-
/** 用户仓库列表参数类型 */
|
1036
|
-
interface UserRepoListParamType extends RepoListBaseParamType {
|
1037
|
-
/** 用户名 */
|
1038
|
-
username: string;
|
1039
|
-
/** 类型,可选all, owner, member, 默认为 all */
|
1040
|
-
type?: 'all' | 'owner' | 'member';
|
1245
|
+
*/
|
1246
|
+
page?: number;
|
1041
1247
|
}
|
1042
|
-
/**
|
1043
|
-
type
|
1044
|
-
|
1045
|
-
|
1046
|
-
|
1047
|
-
|
1048
|
-
|
1049
|
-
|
1050
|
-
language: string;
|
1051
|
-
/** 语言对应的颜色 */
|
1052
|
-
color: string;
|
1053
|
-
/** 在仓库中的占比(百分比) */
|
1054
|
-
percent: number;
|
1055
|
-
/** 该语言的代码字节数 */
|
1056
|
-
bytes: number;
|
1248
|
+
/** 议题评论列表响应类型 */
|
1249
|
+
type IssueCommentsListResponseType = IssueCommentInfoResponseType[];
|
1250
|
+
/** 创建议题评论参数类型 */
|
1251
|
+
interface CreteIssueCommentParamType extends RepoBaseParamType {
|
1252
|
+
/** 议题ID */
|
1253
|
+
issue_number: IssueNumberParamType['issue_number'];
|
1254
|
+
/** 评论内容 */
|
1255
|
+
body: string;
|
1057
1256
|
}
|
1058
|
-
/**
|
1059
|
-
type
|
1060
|
-
/**
|
1061
|
-
interface
|
1062
|
-
/**
|
1063
|
-
|
1257
|
+
/** 创建议题评论响应类型 */
|
1258
|
+
type CreteIssueCommentResponseType = IssueCommentInfoResponseType;
|
1259
|
+
/** 更新议题评论参数类型 */
|
1260
|
+
interface UpdateIssueCommentParamType extends IssueCommentInfoParamType {
|
1261
|
+
/** 评论内容 */
|
1262
|
+
body: string;
|
1064
1263
|
}
|
1065
|
-
/**
|
1066
|
-
type
|
1067
|
-
/**
|
1068
|
-
|
1069
|
-
/**
|
1070
|
-
|
1071
|
-
/** 获取仓库默认分支响应类型 */
|
1072
|
-
type GetRepoDefaultBranchResponseType = RepoInfoResponseType['default_branch'];
|
1073
|
-
/** 获取仓库主要语言参数类型 */
|
1074
|
-
type GetRepoMainLanguageParamType = RepoBaseParamType;
|
1075
|
-
/** 仓库主要语言响应类型 */
|
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';
|
1084
|
-
/** 协作者参数类型 */
|
1085
|
-
type CollaboratorParamType = RepoInfoParamType & UserNameParamType & {
|
1086
|
-
/** 邀请的权限 */
|
1087
|
-
permission?: CollaboratorPermissionType;
|
1088
|
-
};
|
1089
|
-
/** 邀请协作者响应类型 */
|
1090
|
-
interface AddCollaboratorResponseType {
|
1091
|
-
/** 被邀请者ID */
|
1092
|
-
id: number;
|
1093
|
-
/** 被邀请者用户名 */
|
1094
|
-
login: string;
|
1095
|
-
/** 被邀请者的别名 */
|
1096
|
-
name: string | null;
|
1097
|
-
/** 仓库的地址 */
|
1098
|
-
html_url: string;
|
1099
|
-
/** 被邀请者的权限 */
|
1100
|
-
permissions: string;
|
1264
|
+
/** 更新议题评论响应类型 */
|
1265
|
+
type UpdateIssueCommentResponseType = IssueCommentInfoResponseType;
|
1266
|
+
/** 删除议题评论参数类型 */
|
1267
|
+
interface RemoveIssueCommentParamType extends RepoBaseParamType {
|
1268
|
+
/** 评论ID */
|
1269
|
+
comment_id: string | number;
|
1101
1270
|
}
|
1102
|
-
/**
|
1103
|
-
|
1271
|
+
/** 删除议题评论响应类型 */
|
1272
|
+
interface RemoveIssueCommentResponseType {
|
1273
|
+
/** 是否成功删除议题 */
|
1274
|
+
success: boolean;
|
1275
|
+
/** 删除状态信息 */
|
1276
|
+
message: string;
|
1277
|
+
}
|
1278
|
+
/** 获取子议题列表参数类型 */
|
1279
|
+
interface SubIssueListParamType extends RepoBaseParamType {
|
1280
|
+
/** 议题ID */
|
1281
|
+
issue_number: IssueNumberParamType['issue_number'];
|
1104
1282
|
/**
|
1105
|
-
*
|
1106
|
-
*
|
1107
|
-
|
1108
|
-
* all - 列出仓库成员和外部 collaborator。
|
1109
|
-
*/
|
1110
|
-
affiliation?: 'outside' | 'direct' | 'all';
|
1111
|
-
/** 权限 */
|
1112
|
-
permission?: CollaboratorPermissionType;
|
1113
|
-
/** 每页数量 */
|
1283
|
+
* 每页结果数量
|
1284
|
+
* @default 30
|
1285
|
+
*/
|
1114
1286
|
per_page?: number;
|
1115
|
-
/**
|
1287
|
+
/**
|
1288
|
+
* 页码
|
1289
|
+
* @default 1
|
1290
|
+
*/
|
1116
1291
|
page?: number;
|
1117
|
-
};
|
1118
|
-
/** 协作者信息类型 */
|
1119
|
-
interface CollaboratorInfoResponseType {
|
1120
|
-
/** 协作者id */
|
1121
|
-
id: number;
|
1122
|
-
/** 协作者登录名 */
|
1123
|
-
login: string;
|
1124
|
-
/** 头像URL */
|
1125
|
-
avatar_url: string;
|
1126
|
-
/** 协作者邮箱 */
|
1127
|
-
email: string | null;
|
1128
|
-
/** 协作者姓名 */
|
1129
|
-
name: string | null;
|
1130
|
-
/** 权限设置 */
|
1131
|
-
permissions: {
|
1132
|
-
/** 拉取权限 */
|
1133
|
-
pull: boolean;
|
1134
|
-
/** 分类权限 */
|
1135
|
-
triage: boolean;
|
1136
|
-
/** 推送权限 */
|
1137
|
-
push: boolean;
|
1138
|
-
/** 维护权限 */
|
1139
|
-
maintain: boolean;
|
1140
|
-
/** 管理权限 */
|
1141
|
-
admin: boolean;
|
1142
|
-
};
|
1143
1292
|
}
|
1144
|
-
/**
|
1145
|
-
type
|
1146
|
-
/**
|
1147
|
-
|
1148
|
-
/**
|
1149
|
-
|
1150
|
-
/**
|
1151
|
-
|
1293
|
+
/** 获取子议题列表响应类型 */
|
1294
|
+
type SubIssueListResponseType = IssueInfoResponseType[];
|
1295
|
+
/** 添加子议题参数类型 */
|
1296
|
+
interface CreateSubIssueParamType extends RepoBaseParamType {
|
1297
|
+
/** 议题ID */
|
1298
|
+
issue_number: IssueNumberParamType['issue_number'];
|
1299
|
+
/** * 子议题ID */
|
1300
|
+
sub_issue_id: IssueNumberParamType['issue_number'];
|
1301
|
+
/** * 是否替换父议题 */
|
1302
|
+
replace_parent: boolean;
|
1303
|
+
}
|
1304
|
+
/** 添加子议题响应类型 */
|
1305
|
+
type CreateSubIssueResponseType = IssueInfoResponseType;
|
1306
|
+
/** 删除子议题参数类型 */
|
1307
|
+
interface RemoveSubIssueParamType extends RepoBaseParamType {
|
1308
|
+
/** 议题ID */
|
1309
|
+
issue_number: IssueNumberParamType['issue_number'];
|
1310
|
+
/** 子议题ID */
|
1311
|
+
sub_issue_id: IssueNumberParamType['issue_number'];
|
1312
|
+
}
|
1313
|
+
/** 删除子议题响应类型 */
|
1314
|
+
type RemoveSubIssueResponseType = IssueInfoResponseType;
|
1315
|
+
/** 重新确定子议题优先级参数类型 */
|
1316
|
+
interface ReprioritizeSubIssueParamType extends RepoBaseParamType {
|
1317
|
+
/** 议题ID */
|
1318
|
+
issue_number: IssueNumberParamType['issue_number'];
|
1319
|
+
/** 子议题ID */
|
1320
|
+
sub_issue_id: IssueNumberParamType['issue_number'];
|
1321
|
+
/**
|
1322
|
+
* 要优先排序的子问题的 ID(与 before_id 互斥,只能指定其中一个)
|
1323
|
+
* 在此 ID 之后放置子问题
|
1324
|
+
*/
|
1325
|
+
after_id?: IssueNumberParamType['issue_number'];
|
1326
|
+
/**
|
1327
|
+
* 要优先排序的子问题的 ID(与 after_id 互斥,只能指定其中一个)
|
1328
|
+
* 在此 ID 之前放置子问题
|
1329
|
+
*/
|
1330
|
+
before_id?: IssueNumberParamType['issue_number'];
|
1152
1331
|
}
|
1332
|
+
/** 重新确定子议题优先级响应类型 */
|
1333
|
+
type ReprioritizeSubIssueResponseType = IssueInfoResponseType;
|
1153
1334
|
|
1154
1335
|
/** 组织信息参数类型 */
|
1155
1336
|
type OrgInfoParamType = OrgNameParamType;
|
@@ -1172,16 +1353,15 @@ interface OrgInfoResponseType {
|
|
1172
1353
|
interface AddMemberParamType extends OrgNameParamType, UserNameParamType {
|
1173
1354
|
/**
|
1174
1355
|
* 角色
|
1175
|
-
* @default 'member'
|
1176
1356
|
*/
|
1177
|
-
role?: '
|
1357
|
+
role?: RoleNameType['role'];
|
1178
1358
|
}
|
1179
1359
|
/** 添加组织成员响应类型 */
|
1180
1360
|
interface AddMemberResponseType extends Omit<AddCollaboratorResponseType, 'permissions' | 'html_url'> {
|
1181
1361
|
/** 组织地址 */
|
1182
1362
|
html_url: string;
|
1183
1363
|
/** 角色 */
|
1184
|
-
role: '
|
1364
|
+
role: RoleNameType['role'];
|
1185
1365
|
}
|
1186
1366
|
|
1187
1367
|
type PrUser = Pick<UserInfoResponseType, 'id' | 'login' | 'name' | 'avatar_url' | 'html_url'>;
|
@@ -1197,7 +1377,7 @@ interface PullRequestInfoResponseType {
|
|
1197
1377
|
/** 拉取请求的编号 */
|
1198
1378
|
number: number;
|
1199
1379
|
/** 拉取请求的状态 (open/closed) */
|
1200
|
-
state: 'open' | 'closed';
|
1380
|
+
state: 'open' | 'closed' | 'merged';
|
1201
1381
|
/** 是否被锁定 */
|
1202
1382
|
locked: boolean;
|
1203
1383
|
/** 拉取请求的标题 */
|
@@ -1209,7 +1389,7 @@ interface PullRequestInfoResponseType {
|
|
1209
1389
|
/** 创建时间 */
|
1210
1390
|
created_at: string;
|
1211
1391
|
/** 更新时间 */
|
1212
|
-
updated_at: string;
|
1392
|
+
updated_at: string | null;
|
1213
1393
|
/** 关闭时间 */
|
1214
1394
|
closed_at: string | null;
|
1215
1395
|
/** 合并时间 */
|
@@ -1478,8 +1658,10 @@ interface UpdatePullRequestCommentParamType extends RepoBaseParamType, CommentId
|
|
1478
1658
|
}
|
1479
1659
|
/** 更新拉取请求评论响应类型 */
|
1480
1660
|
interface UpdatePullRequestCommentResponseType {
|
1481
|
-
/**
|
1661
|
+
/** 是否更新评论信息成功 */
|
1482
1662
|
success: boolean;
|
1663
|
+
/** 更新评论状态信息 */
|
1664
|
+
message: string;
|
1483
1665
|
}
|
1484
1666
|
/** 删除拉取请求评论参数类型 */
|
1485
1667
|
type DeletePullRequestCommentParamType = RepoBaseParamType & CommentIdParamType;
|
@@ -1487,6 +1669,8 @@ type DeletePullRequestCommentParamType = RepoBaseParamType & CommentIdParamType;
|
|
1487
1669
|
interface DeletePullRequestCommentResponseType {
|
1488
1670
|
/** 是否删除成功 */
|
1489
1671
|
success: boolean;
|
1672
|
+
/** 删除状态信息 */
|
1673
|
+
message: string;
|
1490
1674
|
}
|
1491
1675
|
|
1492
1676
|
type ReleaseUser = Omit<UserInfoResponseType, 'bio' | 'blog' | 'followers' | 'following' | 'public_repos'>;
|
@@ -1592,8 +1776,10 @@ type UpdateReleaseResponseType = ReleaseInfoResponseType;
|
|
1592
1776
|
type DeleteReleaseParamType = ReleaseInfoParamType;
|
1593
1777
|
/** 删除Release响应类型 */
|
1594
1778
|
interface DeleteReleaseResponseType {
|
1595
|
-
/**
|
1596
|
-
|
1779
|
+
/** 是否删除成功 */
|
1780
|
+
success: boolean;
|
1781
|
+
/** 删除状态信息 */
|
1782
|
+
message: string;
|
1597
1783
|
}
|
1598
1784
|
|
1599
1785
|
interface WebHookSignatureParamType {
|
@@ -1606,7 +1792,7 @@ interface WebHookSignatureResponseType {
|
|
1606
1792
|
/** 是否验证成功 */
|
1607
1793
|
success: boolean;
|
1608
1794
|
/** 验证信息 */
|
1609
|
-
|
1795
|
+
message: string;
|
1610
1796
|
}
|
1611
1797
|
|
1612
1798
|
/**
|
@@ -1634,28 +1820,6 @@ declare function format_date(dateString: string, locale?: string, format?: strin
|
|
1634
1820
|
* ```
|
1635
1821
|
*/
|
1636
1822
|
declare function get_relative_time(dateString: string, locale?: string): Promise<string>;
|
1637
|
-
/**
|
1638
|
-
* 获取本地仓库的默认分支
|
1639
|
-
* @param local_path - 本地仓库路径
|
1640
|
-
* @returns 默认分支名称
|
1641
|
-
* @example
|
1642
|
-
* ```ts
|
1643
|
-
* console.log(await get_local_repo_default_branch('/path/to/repo'))
|
1644
|
-
* -> 'main'
|
1645
|
-
* ```
|
1646
|
-
*/
|
1647
|
-
declare function get_local_repo_default_branch(local_path: string): Promise<string>;
|
1648
|
-
/**
|
1649
|
-
* 获取远程仓库的默认分支
|
1650
|
-
* @param remote_url - 远程仓库URL
|
1651
|
-
* @returns 默认分支名称
|
1652
|
-
* @example
|
1653
|
-
* ```ts
|
1654
|
-
* console.log(await get_remote_repo_default_branch('https://github.com/CandriaJS/git-neko-kit'))
|
1655
|
-
* -> 'main'
|
1656
|
-
* ```
|
1657
|
-
*/
|
1658
|
-
declare function get_remote_repo_default_branch(remote_url: string): Promise<string>;
|
1659
1823
|
/**
|
1660
1824
|
* 根据语言名称获取对应的颜色值
|
1661
1825
|
* @param language - 语言名称
|
@@ -2001,7 +2165,7 @@ declare class Issue extends GitHubClient {
|
|
2001
2165
|
* -> 议题评论对象列表
|
2002
2166
|
* ```
|
2003
2167
|
*/
|
2004
|
-
get_repo_comments_list(options:
|
2168
|
+
get_repo_comments_list(options: RepoCommentsListParamType): Promise<ApiResponseType<RepoCommentsListResponseType>>;
|
2005
2169
|
/**
|
2006
2170
|
* 获取一个议题下的评论列表
|
2007
2171
|
* 权限:
|
@@ -2022,7 +2186,7 @@ declare class Issue extends GitHubClient {
|
|
2022
2186
|
* -> 议题评论对象列表
|
2023
2187
|
* ```
|
2024
2188
|
*/
|
2025
|
-
get_issue_comments_list(options:
|
2189
|
+
get_issue_comments_list(options: IssueCommentsListParamType): Promise<ApiResponseType<IssueCommentsListResponseType>>;
|
2026
2190
|
/**
|
2027
2191
|
* 获取议题评论信息
|
2028
2192
|
* 权限:
|
@@ -2097,7 +2261,7 @@ declare class Issue extends GitHubClient {
|
|
2097
2261
|
* -> 删除议题评论对象
|
2098
2262
|
* ```
|
2099
2263
|
*/
|
2100
|
-
remove_issue_comment(options: RemoveIssueCommentParamType): Promise<ApiResponseType<
|
2264
|
+
remove_issue_comment(options: RemoveIssueCommentParamType): Promise<ApiResponseType<RemoveIssueCommentResponseType>>;
|
2101
2265
|
/**
|
2102
2266
|
* 删除议题评论信息
|
2103
2267
|
* 权限:
|
@@ -2106,7 +2270,7 @@ declare class Issue extends GitHubClient {
|
|
2106
2270
|
* 需以上权限之一
|
2107
2271
|
* @deprecated 请使用 remove_issue_comment 方法代替
|
2108
2272
|
*/
|
2109
|
-
delete_issue_comment(options: RemoveIssueCommentParamType): Promise<ApiResponseType<
|
2273
|
+
delete_issue_comment(options: RemoveIssueCommentParamType): Promise<ApiResponseType<RemoveIssueCommentResponseType>>;
|
2110
2274
|
/**
|
2111
2275
|
* 获取子议题列表
|
2112
2276
|
* @github
|
@@ -2904,7 +3068,6 @@ declare class WebHook extends GitHubClient {
|
|
2904
3068
|
* @example
|
2905
3069
|
* ```ts
|
2906
3070
|
* const res = await check_webhook_signature({
|
2907
|
-
* secret: 'your_secret',
|
2908
3071
|
* payload: 'your_payload',
|
2909
3072
|
* signature: 'your_signature'
|
2910
3073
|
* })
|
@@ -2915,7 +3078,7 @@ declare class WebHook extends GitHubClient {
|
|
2915
3078
|
* msg: '请求成功'
|
2916
3079
|
* data: {
|
2917
3080
|
* success: true,
|
2918
|
-
*
|
3081
|
+
* message: '验证成功'
|
2919
3082
|
* }
|
2920
3083
|
* }
|
2921
3084
|
* ```
|
@@ -2969,10 +3132,21 @@ declare class GitHubClient {
|
|
2969
3132
|
/**
|
2970
3133
|
* 获取Git平台类型
|
2971
3134
|
* @returns Git平台类型,如: github,gitee
|
3135
|
+
* @example
|
3136
|
+
* ```ts
|
3137
|
+
* const type = await client.type
|
3138
|
+
* -> 'github'
|
3139
|
+
* ```
|
2972
3140
|
*/
|
2973
3141
|
get type(): GitType;
|
2974
3142
|
/**
|
2975
3143
|
* 是否是App客户端
|
3144
|
+
* @returns 是否是App客户端
|
3145
|
+
* @example
|
3146
|
+
* ```ts
|
3147
|
+
* const isAppClient = await client.is_app_client
|
3148
|
+
* -> true
|
3149
|
+
* ```
|
2976
3150
|
*/
|
2977
3151
|
get is_app_client(): boolean;
|
2978
3152
|
private validateAppClient;
|
@@ -3085,6 +3259,11 @@ declare class GitHubClient {
|
|
3085
3259
|
* @param options.APP_ID GitHub App ID
|
3086
3260
|
* @param options.Private_Key 私钥内容
|
3087
3261
|
* @returns 返回生成的 JWT
|
3262
|
+
* @example
|
3263
|
+
* ```ts
|
3264
|
+
* const jwt = await client.generate_jwt()
|
3265
|
+
* -> 'eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE2MjYxNjEyMjAsImlhdCI6MTYyNjE2MTIyMCwiaXNzIjoiMTIzNDU2Nzg5In0.XxXxXxXxXx
|
3266
|
+
* ```
|
3088
3267
|
*/
|
3089
3268
|
private generate_jwt;
|
3090
3269
|
/**
|
@@ -3182,7 +3361,7 @@ declare class App extends GitHubClient {
|
|
3182
3361
|
* -> app的信息
|
3183
3362
|
* ```
|
3184
3363
|
*/
|
3185
|
-
|
3364
|
+
get_app_info_by_auth(): Promise<ApiResponseType<AppInfoResponseType>>;
|
3186
3365
|
/**
|
3187
3366
|
* 获取仓库的应用安装信息
|
3188
3367
|
* 权限:
|
@@ -3193,11 +3372,62 @@ declare class App extends GitHubClient {
|
|
3193
3372
|
* @returns 返回应用安装信息
|
3194
3373
|
* @example
|
3195
3374
|
* ```ts
|
3196
|
-
*
|
3197
|
-
*
|
3375
|
+
* console.log(app.get_app_installation_by_repo({owner: 'owner', repo: 'repo'}))
|
3376
|
+
* -> 仓库安装应用信息
|
3198
3377
|
* ```
|
3199
3378
|
*/
|
3200
|
-
get_app_installation_by_repo(options:
|
3379
|
+
get_app_installation_by_repo(options: GetAppInfoByRepoParamType): Promise<ApiResponseType<GetAppInfoByRepoResponseType>>;
|
3380
|
+
/**
|
3381
|
+
* 获取用户的应用安装信息
|
3382
|
+
* 权限:
|
3383
|
+
* - `none` 此节点仅App Client可用
|
3384
|
+
* @param options - 仓库安装应用参数对象
|
3385
|
+
* - owner 拥有者
|
3386
|
+
* - repo 仓库名
|
3387
|
+
* @returns 返回应用安装信息
|
3388
|
+
* @example
|
3389
|
+
* ```ts
|
3390
|
+
* console.log(app.get_app_installation_by_repo({owner: 'owner', repo: 'repo'}))
|
3391
|
+
* -> 用户安装应用信息
|
3392
|
+
* ```
|
3393
|
+
*/
|
3394
|
+
get_app_installation_by_user(options: GetAppInfoByUserParamType): Promise<ApiResponseType<GetAppInfoByUserResponseType>>;
|
3395
|
+
/**
|
3396
|
+
* 获取组织的应用安装信息
|
3397
|
+
* 权限:
|
3398
|
+
* - `none` 此节点仅App Client可用
|
3399
|
+
* @param options - 仓库安装应用参数对象
|
3400
|
+
* - owner 拥有者
|
3401
|
+
* - repo 仓库名
|
3402
|
+
* @returns 返回应用安装信息
|
3403
|
+
* @example
|
3404
|
+
* ```ts
|
3405
|
+
* console.log(app.get_app_installation_by_repo({owner: 'owner', repo: 'repo'}))
|
3406
|
+
* -> 组织安装应用信息
|
3407
|
+
* ```
|
3408
|
+
*/
|
3409
|
+
get_app_installation_by_org(options: GetAppInfoByOrgParamType): Promise<ApiResponseType<GetAppInfoByOrgResponseType>>;
|
3410
|
+
/**
|
3411
|
+
* 为应用程序创建访问令牌
|
3412
|
+
* @param options
|
3413
|
+
* - installation_id - 安装 ID
|
3414
|
+
* @returns 创建访问令牌对象
|
3415
|
+
* @example
|
3416
|
+
* ```ts
|
3417
|
+
* const accessToken = await app.create_access_token_for_app({ installation_id: 123456 })
|
3418
|
+
* -> 创建访问令牌对象
|
3419
|
+
* ```
|
3420
|
+
*/
|
3421
|
+
create_access_token_for_app(options: CreateAccessTokenForAppParamType): Promise<ApiResponseType<CreateAccessTokenForAppResponseType>>;
|
3422
|
+
/**
|
3423
|
+
* 撤销应用程序访问令牌
|
3424
|
+
* @returns 撤销应用程序访问令牌
|
3425
|
+
* @example
|
3426
|
+
* ```ts
|
3427
|
+
* const res = await auth.revoke_access_token_for_app()
|
3428
|
+
* -> data: { 'success': true, 'message': '喵呜~ 访问令牌撤销成功' }
|
3429
|
+
*/
|
3430
|
+
revoke_access_token_for_app(): Promise<ApiResponseType<RevokeAccessTokenResponseType>>;
|
3201
3431
|
/**
|
3202
3432
|
* 生成Github App 安装链接
|
3203
3433
|
* @param state_id - 随机生成的 state_id,用于验证授权请求的状态,可选,默认不使用
|
@@ -3279,4 +3509,4 @@ declare class Client {
|
|
3279
3509
|
constructor(options: ClientType);
|
3280
3510
|
}
|
3281
3511
|
|
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
|
3512
|
+
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 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 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 ExecOptions, type ExecReturn, type ExecType, type GetAppInfoByOrgParamType, type GetAppInfoByOrgResponseType, type GetAppInfoByRepoParamType, type GetAppInfoByRepoResponseType, type GetAppInfoByUserParamType, type GetAppInfoByUserResponseType, 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 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 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 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 ReverseProxyType, type RevokeAccessTokenResponseType, type RoleNameType, 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 };
|