@candriajs/git-neko-kit 0.8.4 → 0.8.6
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 +659 -455
- package/dist/index.mjs +5 -5
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
@@ -1,10 +1,38 @@
|
|
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
|
-
/**
|
7
|
-
|
29
|
+
/**
|
30
|
+
* 代理类型:
|
31
|
+
* - reverse: 反向代理
|
32
|
+
* - original: 原始代理
|
33
|
+
* - common: 通用代理
|
34
|
+
*/
|
35
|
+
type ProxyType = 'reverse' | 'original' | 'common';
|
8
36
|
/** Git类型 */
|
9
37
|
type GitType = 'github' | 'gitee' | 'gitcode';
|
10
38
|
/**
|
@@ -250,20 +278,9 @@ interface ClientType {
|
|
250
278
|
}
|
251
279
|
|
252
280
|
/** 用户信息参数类型 */
|
253
|
-
|
254
|
-
/** 授权token */
|
255
|
-
access_token?: AccessTokenType['access_token'];
|
256
|
-
}
|
257
|
-
/** 授权用户信息参数对象类型 */
|
258
|
-
interface UserInfoByAuthParamType {
|
259
|
-
/** 授权token */
|
260
|
-
access_token?: AccessTokenType['access_token'];
|
261
|
-
}
|
281
|
+
type UserInfoParamType = UserNameParamType;
|
262
282
|
/** 通过用户ID 获取用户信息参数类型 */
|
263
|
-
|
264
|
-
/** 授权token */
|
265
|
-
access_token?: AccessTokenType['access_token'];
|
266
|
-
}
|
283
|
+
type UserInfoByIdParamType = UserIdParamType;
|
267
284
|
/** 用户信息响应类型 */
|
268
285
|
interface UserInfoResponseType {
|
269
286
|
/** 账号ID */
|
@@ -296,6 +313,228 @@ interface UserInfoResponseType {
|
|
296
313
|
following: number;
|
297
314
|
}
|
298
315
|
|
316
|
+
/** 仓库所有者参数类型 */
|
317
|
+
type RepoUser = Omit<UserInfoResponseType, 'followers' | 'following' | 'blog' | 'bio' | 'public_repos'>;
|
318
|
+
/** 仓库列表参数类型 */
|
319
|
+
interface RepoListBaseParamType {
|
320
|
+
/** 排序方式,可选created, updated, pushed, full_name, 默认为 full_name */
|
321
|
+
sort?: 'created' | 'updated' | 'pushed' | 'full_name';
|
322
|
+
/** 排序方式,可选asc, desc, 默认为 desc */
|
323
|
+
direction?: 'asc' | 'desc';
|
324
|
+
/** 每页数量 */
|
325
|
+
per_page?: number;
|
326
|
+
/** 页码 */
|
327
|
+
page?: number;
|
328
|
+
}
|
329
|
+
interface UserByTokenRepoListParamType extends RepoListBaseParamType {
|
330
|
+
/** 仓库的可见性,可选all, public, private, 默认为 all */
|
331
|
+
visibility?: 'all' | 'public' | 'private';
|
332
|
+
/** 仓库的状态,可选all, public, private, 默认为 all */
|
333
|
+
affiliation?: 'owner' | 'collaborator' | 'organization_member';
|
334
|
+
/** 类型,可选all, owner, member, 默认为 all */
|
335
|
+
type?: 'all' | 'owner' | 'member';
|
336
|
+
}
|
337
|
+
/** 仓库信息请求参数 */
|
338
|
+
type RepoInfoParamType = RepoBaseParamType;
|
339
|
+
/** * 仓库信息 */
|
340
|
+
interface RepoInfoResponseType {
|
341
|
+
/** * 仓库的唯一 ID */
|
342
|
+
id: number;
|
343
|
+
/** * 仓库的名称 */
|
344
|
+
name: string;
|
345
|
+
/** * 仓库的完整名称,包含用户名或组织名 */
|
346
|
+
full_name: string;
|
347
|
+
/** * 仓库拥有者的信息 */
|
348
|
+
owner: RepoUser;
|
349
|
+
/** 仓库是否公开 */
|
350
|
+
public: boolean;
|
351
|
+
/** * 仓库是否私有 */
|
352
|
+
private: boolean;
|
353
|
+
/** * 仓库的可见性 */
|
354
|
+
visibility: 'public' | 'private';
|
355
|
+
/** * 仓库是否是 fork 仓库 */
|
356
|
+
fork: boolean;
|
357
|
+
/** * 仓库是否已归档 */
|
358
|
+
archived: boolean;
|
359
|
+
/** * 仓库是否被禁用 */
|
360
|
+
disabled: boolean;
|
361
|
+
/** * 仓库的 HTML 页面 URL */
|
362
|
+
html_url: string;
|
363
|
+
/** * 仓库的描述信息 */
|
364
|
+
description: string | null;
|
365
|
+
/** * 仓库的 Stargazer 数量 */
|
366
|
+
stargazers_count: number;
|
367
|
+
/** * 仓库的 Watcher 数量 */
|
368
|
+
watchers_count: number;
|
369
|
+
/** * 仓库的主编程语言 */
|
370
|
+
language: string | null;
|
371
|
+
/** * 仓库的 fork 数量 */
|
372
|
+
forks_count: number;
|
373
|
+
/** * 开放的 issue 数量 */
|
374
|
+
open_issues_count: number;
|
375
|
+
/** * 仓库的默认分支 */
|
376
|
+
default_branch: string;
|
377
|
+
/** * 仓库的创建时间 */
|
378
|
+
created_at: string;
|
379
|
+
/** * 仓库的更新时间 */
|
380
|
+
updated_at: string;
|
381
|
+
/** * 仓库的推送时间 */
|
382
|
+
pushed_at: string;
|
383
|
+
}
|
384
|
+
/** 组织仓库列表参数类型 */
|
385
|
+
interface OrgRepoListParmType extends RepoListBaseParamType {
|
386
|
+
/** 组织名称 */
|
387
|
+
org: string;
|
388
|
+
/** 类型,可选all, public, private 默认为 all */
|
389
|
+
type?: 'all' | 'public' | 'private';
|
390
|
+
}
|
391
|
+
/**
|
392
|
+
* 组织仓库列表响应类型
|
393
|
+
* 该类型包含了多个仓库的信息,每个仓库都有自己的详细信息。
|
394
|
+
*/
|
395
|
+
type OrgRepoListResponseType = RepoInfoResponseType[];
|
396
|
+
/** 创建组织仓库请求参数 */
|
397
|
+
interface OrgRepoCreateParamType extends OrgNameParamType {
|
398
|
+
/** 仓库名称 */
|
399
|
+
name: string;
|
400
|
+
/** 仓库描述 */
|
401
|
+
description?: string;
|
402
|
+
/** 仓库主页 */
|
403
|
+
homepage?: string;
|
404
|
+
/** 仓库可见性 */
|
405
|
+
visibility?: 'public' | 'private';
|
406
|
+
/** 是否开启议题issue */
|
407
|
+
has_issues?: boolean;
|
408
|
+
/** 是否开启wiki */
|
409
|
+
has_wiki?: boolean;
|
410
|
+
/** 仓库自动初始化 */
|
411
|
+
auto_init?: boolean;
|
412
|
+
}
|
413
|
+
/** 创建组织仓库响应类型 */
|
414
|
+
type OrgRepoCreateResponseType = RepoInfoResponseType;
|
415
|
+
/** 创建用户仓库参数类型 */
|
416
|
+
type UserRepoCreateParamType = Omit<OrgRepoCreateParamType, 'org'> & RepoOwnerParamType;
|
417
|
+
/** 创建用户仓库响应类型 */
|
418
|
+
type UserRepoCreateResponseType = RepoInfoResponseType;
|
419
|
+
/** 用户仓库列表参数类型 */
|
420
|
+
interface UserRepoListParamType extends RepoListBaseParamType {
|
421
|
+
/** 用户名 */
|
422
|
+
username: string;
|
423
|
+
/** 类型,可选all, owner, member, 默认为 all */
|
424
|
+
type?: 'all' | 'owner' | 'member';
|
425
|
+
}
|
426
|
+
/** 用户仓库列表类型 */
|
427
|
+
type UserRepoListType = Array<RepoInfoResponseType & {
|
428
|
+
/** * 仓库的角色名称 */
|
429
|
+
role_name?: string;
|
430
|
+
}>;
|
431
|
+
/** 仓库语言信息类型 */
|
432
|
+
interface LanguageInfo {
|
433
|
+
/** 编程语言名称 */
|
434
|
+
language: string;
|
435
|
+
/** 语言对应的颜色 */
|
436
|
+
color: string;
|
437
|
+
/** 在仓库中的占比(百分比) */
|
438
|
+
percent: number;
|
439
|
+
/** 该语言的代码字节数 */
|
440
|
+
bytes: number;
|
441
|
+
}
|
442
|
+
/** 仓库语言列表参数类型 */
|
443
|
+
type RepoLanguagesListParamType = RepoBaseParamType;
|
444
|
+
/** 仓库语言列表类型 */
|
445
|
+
interface RepoLanguagesListResponseType {
|
446
|
+
/** 仓库的语言统计信息列表 */
|
447
|
+
languages: LanguageInfo[];
|
448
|
+
}
|
449
|
+
/** 获取仓库可见性参数类型 */
|
450
|
+
type GetRepoVisibilityParamType = RepoBaseParamType;
|
451
|
+
/** 获取仓库可见性响应类型 */
|
452
|
+
type GetRepoVisibilityResponseType = RepoInfoResponseType['visibility'];
|
453
|
+
/** 获取仓库默认分支参数类型 */
|
454
|
+
type GetRepoDefaultBranchParamType = RepoBaseParamType;
|
455
|
+
/** 获取仓库默认分支响应类型 */
|
456
|
+
type GetRepoDefaultBranchResponseType = RepoInfoResponseType['default_branch'];
|
457
|
+
/** 获取仓库主要语言参数类型 */
|
458
|
+
type GetRepoMainLanguageParamType = RepoBaseParamType;
|
459
|
+
/** 仓库主要语言响应类型 */
|
460
|
+
type GetRepoMainLanguageResponseType = RepoInfoResponseType['language'];
|
461
|
+
/**
|
462
|
+
* 协作者权限 ,可选 pull,triage, push, maintain, admin,默认pull
|
463
|
+
* pull - 只读访问,协作者可以查看仓库内容。
|
464
|
+
* push - 允许推送代码到仓库分支,同时拥有 pull 权限。
|
465
|
+
* admin - 拥有仓库的完全控制权,包括更改设置和删除仓库。
|
466
|
+
*/
|
467
|
+
type CollaboratorPermissionType = 'pull' | 'push' | 'admin';
|
468
|
+
/** 协作者参数类型 */
|
469
|
+
type CollaboratorParamType = RepoInfoParamType & UserNameParamType & {
|
470
|
+
/** 邀请的权限 */
|
471
|
+
permission?: CollaboratorPermissionType;
|
472
|
+
};
|
473
|
+
/** 邀请协作者响应类型 */
|
474
|
+
interface AddCollaboratorResponseType {
|
475
|
+
/** 被邀请者ID */
|
476
|
+
id: number;
|
477
|
+
/** 被邀请者用户名 */
|
478
|
+
login: string;
|
479
|
+
/** 被邀请者的别名 */
|
480
|
+
name: string | null;
|
481
|
+
/** 仓库的地址 */
|
482
|
+
html_url: string;
|
483
|
+
/** 被邀请者的权限 */
|
484
|
+
permissions: string;
|
485
|
+
}
|
486
|
+
/** 协作者列表参数类型 */
|
487
|
+
type GetCollaboratorListParamType = RepoInfoParamType & {
|
488
|
+
/**
|
489
|
+
* 筛选按隶属关系返回的协作者
|
490
|
+
* outside - 列出所有外部协作者,包括仓库成员和外部 collaborator。
|
491
|
+
* direct - 列出仓库成员。
|
492
|
+
* all - 列出仓库成员和外部 collaborator。
|
493
|
+
*/
|
494
|
+
affiliation?: 'outside' | 'direct' | 'all';
|
495
|
+
/** 权限 */
|
496
|
+
permission?: CollaboratorPermissionType;
|
497
|
+
/** 每页数量 */
|
498
|
+
per_page?: number;
|
499
|
+
/** 页码 */
|
500
|
+
page?: number;
|
501
|
+
};
|
502
|
+
/** 协作者信息类型 */
|
503
|
+
interface CollaboratorInfoResponseType {
|
504
|
+
/** 协作者id */
|
505
|
+
id: number;
|
506
|
+
/** 协作者登录名 */
|
507
|
+
login: string;
|
508
|
+
/** 头像URL */
|
509
|
+
avatar_url: string;
|
510
|
+
/** 协作者邮箱 */
|
511
|
+
email: string | null;
|
512
|
+
/** 协作者姓名 */
|
513
|
+
name: string | null;
|
514
|
+
/** 权限设置 */
|
515
|
+
permissions: {
|
516
|
+
/** 拉取权限 */
|
517
|
+
pull: boolean;
|
518
|
+
/** 分类权限 */
|
519
|
+
triage: boolean;
|
520
|
+
/** 推送权限 */
|
521
|
+
push: boolean;
|
522
|
+
/** 维护权限 */
|
523
|
+
maintain: boolean;
|
524
|
+
/** 管理权限 */
|
525
|
+
admin: boolean;
|
526
|
+
};
|
527
|
+
}
|
528
|
+
/** 协作者列表响应类型 */
|
529
|
+
type GetCollaboratorListResponseType = CollaboratorInfoResponseType[];
|
530
|
+
/** 移除协作者参数类型 */
|
531
|
+
type RemoveCollaboratorParamType = RepoBaseParamType & UserNameParamType;
|
532
|
+
/** 移除协作者响应类型 */
|
533
|
+
interface RemoveCollaboratorResponseType {
|
534
|
+
/** 状态信息 */
|
535
|
+
info: string;
|
536
|
+
}
|
537
|
+
|
299
538
|
type AppUser = Omit<UserInfoResponseType, 'bio' | 'blog' | 'followers' | 'following' | 'public_repos'>;
|
300
539
|
/**
|
301
540
|
* 定义 Base 应用所需的权限
|
@@ -318,8 +557,6 @@ interface AppInfoParamType {
|
|
318
557
|
* 是https://github.com/settings/apps/:app_slug的
|
319
558
|
* */
|
320
559
|
app_slug: string;
|
321
|
-
/** 访问令牌 */
|
322
|
-
access_token?: AccessTokenType['access_token'];
|
323
560
|
}
|
324
561
|
/**
|
325
562
|
* 应用的详细信息
|
@@ -381,6 +618,148 @@ interface AppRepoInfoResponseType {
|
|
381
618
|
/** 更新时间 */
|
382
619
|
updated_at: string;
|
383
620
|
}
|
621
|
+
/** 通过仓库信息获取应用信息参数类型 */
|
622
|
+
type GetAppInfoByRepoParamType = RepoInfoParamType;
|
623
|
+
/** 通过仓库信息获取应用信息响应类型 */
|
624
|
+
type GetAppInfoByRepoResponseType = AppRepoInfoResponseType;
|
625
|
+
/** 通过用户信息获取应用信息参数 */
|
626
|
+
type GetAppInfoByUserParamType = UserNameParamType;
|
627
|
+
/** 通过用户信息获取应用信息响应类型 */
|
628
|
+
type GetAppInfoByUserResponseType = AppRepoInfoResponseType;
|
629
|
+
/** 通过用户信息获取应用信息参数 */
|
630
|
+
type GetAppInfoByOrgParamType = OrgNameParamType;
|
631
|
+
/** 通过用户信息获取应用信息响应类型 */
|
632
|
+
type GetAppInfoByOrgResponseType = AppRepoInfoResponseType;
|
633
|
+
/** 访问令牌权限 */
|
634
|
+
interface AccessTokenPermissionsType {
|
635
|
+
/** GitHub Actions 工作流、工作流运行和工件的权限 */
|
636
|
+
actions: 'read' | 'write';
|
637
|
+
/** 存储库创建、删除、设置、团队和协作者创建的权限 */
|
638
|
+
administration: 'read' | 'write';
|
639
|
+
/** 代码检查的权限 */
|
640
|
+
checks: 'read' | 'write';
|
641
|
+
/** 创建、编辑、删除和列出 GitHub Codespaces 的权限 */
|
642
|
+
codespaces: 'read' | 'write';
|
643
|
+
/** 存储库内容、提交、分支、下载、发布和合并的权限 */
|
644
|
+
contents: 'read' | 'write';
|
645
|
+
/** 管理 Dependabot 密钥的权限 */
|
646
|
+
dependabot_secrets: 'read' | 'write';
|
647
|
+
/** 部署和部署状态的权限 */
|
648
|
+
deployments: 'read' | 'write';
|
649
|
+
/** 管理存储库环境的权限 */
|
650
|
+
environments: 'read' | 'write';
|
651
|
+
/** 问题和相关评论、指派、标签和里程碑的权限 */
|
652
|
+
issues: 'read' | 'write';
|
653
|
+
/** 搜索存储库、列出协作者和访问存储库元数据的权限 */
|
654
|
+
metadata: 'read' | 'write';
|
655
|
+
/** 管理 GitHub Packages 发布的包的权限 */
|
656
|
+
packages: 'read' | 'write';
|
657
|
+
/** 获取 Pages 状态、配置和构建的权限,并创建新的构建 */
|
658
|
+
pages: 'read' | 'write';
|
659
|
+
/** 管理拉取请求及相关评论、指派、标签、里程碑和合并的权限 */
|
660
|
+
pull_requests: 'read' | 'write';
|
661
|
+
/** 查看和编辑存储库自定义属性的权限 */
|
662
|
+
repository_custom_properties: 'read' | 'write';
|
663
|
+
/** 管理存储库的 post-receive 钩子的权限 */
|
664
|
+
repository_hooks: 'read' | 'write';
|
665
|
+
/** 管理存储库项目、列和卡片的权限 */
|
666
|
+
repository_projects: 'read' | 'write' | 'admin';
|
667
|
+
/** 查看和管理秘密扫描警报的权限 */
|
668
|
+
secret_scanning_alerts: 'read' | 'write';
|
669
|
+
/** 管理存储库秘密的权限 */
|
670
|
+
secrets: 'read' | 'write';
|
671
|
+
/** 查看和管理安全事件的权限,比如代码扫描警报 */
|
672
|
+
security_events: 'read' | 'write';
|
673
|
+
/** 只管理单个文件的权限 */
|
674
|
+
single_file: 'read' | 'write';
|
675
|
+
/** 管理提交状态的权限 */
|
676
|
+
statuses: 'read' | 'write';
|
677
|
+
/** 管理 Dependabot 警报的权限 */
|
678
|
+
vulnerability_alerts: 'read' | 'write';
|
679
|
+
/** 更新 GitHub Actions 工作流文件的权限 */
|
680
|
+
workflows: 'write';
|
681
|
+
/** 管理组织团队和成员的权限 */
|
682
|
+
members: 'read' | 'write';
|
683
|
+
/** 管理组织访问权限的权限 */
|
684
|
+
organization_administration: 'read' | 'write';
|
685
|
+
/** 管理自定义存储库角色的权限 */
|
686
|
+
organization_custom_roles: 'read' | 'write';
|
687
|
+
/** 管理自定义组织角色的权限 */
|
688
|
+
organization_custom_org_roles: 'read' | 'write';
|
689
|
+
/** 管理自定义属性的权限 */
|
690
|
+
organization_custom_properties: 'read' | 'write' | 'admin';
|
691
|
+
/** 管理 GitHub Copilot 组织成员访问权限的权限 */
|
692
|
+
organization_copilot_seat_management: 'write';
|
693
|
+
/** 查看和管理组织公告横幅的权限 */
|
694
|
+
organization_announcement_banners: 'read' | 'write';
|
695
|
+
/** 查看组织活动的权限 */
|
696
|
+
organization_events: 'read';
|
697
|
+
/** 管理组织的 post-receive 钩子的权限 */
|
698
|
+
organization_hooks: 'read' | 'write';
|
699
|
+
/** 查看和管理组织的个人访问令牌请求的权限 */
|
700
|
+
organization_personal_access_tokens: 'read' | 'write';
|
701
|
+
/** 查看和管理组织批准的个人访问令牌的权限 */
|
702
|
+
organization_personal_access_token_requests: 'read' | 'write';
|
703
|
+
/** 查看组织计划的权限 */
|
704
|
+
organization_plan: 'read';
|
705
|
+
/** 管理组织项目的权限 */
|
706
|
+
organization_projects: 'read' | 'write' | 'admin';
|
707
|
+
/** 管理组织 GitHub Packages 包的权限 */
|
708
|
+
organization_packages: 'read' | 'write';
|
709
|
+
/** 管理组织秘密的权限 */
|
710
|
+
organization_secrets: 'read' | 'write';
|
711
|
+
/** 查看和管理组织 GitHub Actions 自托管运行器的权限 */
|
712
|
+
organization_self_hosted_runners: 'read' | 'write';
|
713
|
+
/** 查看和管理被组织屏蔽的用户的权限 */
|
714
|
+
organization_user_blocking: 'read' | 'write';
|
715
|
+
/** 管理团队讨论和相关评论的权限 */
|
716
|
+
team_discussions: 'read' | 'write';
|
717
|
+
/** 管理用户的电子邮件地址的权限 */
|
718
|
+
email_addresses: 'read' | 'write';
|
719
|
+
/** 管理用户的关注者的权限 */
|
720
|
+
followers: 'read' | 'write';
|
721
|
+
/** 管理 Git SSH 密钥的权限 */
|
722
|
+
git_ssh_keys: 'read' | 'write';
|
723
|
+
/** 查看和管理 GPG 密钥的权限 */
|
724
|
+
gpg_keys: 'read' | 'write';
|
725
|
+
/** 查看和管理存储库的互动限制的权限 */
|
726
|
+
interaction_limits: 'read' | 'write';
|
727
|
+
/** 管理用户的个人资料设置的权限 */
|
728
|
+
profile: 'write';
|
729
|
+
/** 列出和管理用户标星的存储库的权限 */
|
730
|
+
starring: 'read' | 'write';
|
731
|
+
}
|
732
|
+
/** 为应用创建访问令牌参数类型 */
|
733
|
+
interface CreateAccessTokenForAppParamType {
|
734
|
+
/** 应用安装id */
|
735
|
+
installation_id: number;
|
736
|
+
/** 存储库名称列表 */
|
737
|
+
repositories: Array<string>;
|
738
|
+
/** 存储库id列表 */
|
739
|
+
repository_ids: Array<number>;
|
740
|
+
/** 访问令牌权限 */
|
741
|
+
permissions: AccessTokenPermissionsType;
|
742
|
+
}
|
743
|
+
/** 为应用创建访问令牌响应类型 */
|
744
|
+
interface CreateAccessTokenForAppResponseType {
|
745
|
+
/** 访问令牌 */
|
746
|
+
token: string;
|
747
|
+
/** 访问令牌过期时间 */
|
748
|
+
expires_at: string;
|
749
|
+
/** 访问令牌权限 */
|
750
|
+
permissions: Record<string, string>;
|
751
|
+
/** 访问令牌仓库选择范围 */
|
752
|
+
repository_selection: 'all' | 'selected';
|
753
|
+
/** 访问令牌仓库列表 */
|
754
|
+
repositories: Array<RepoInfoResponseType>;
|
755
|
+
}
|
756
|
+
/** 撤销应用程序访问令牌响应类型 */
|
757
|
+
interface RevokeAccessTokenResponseType {
|
758
|
+
/** 是否撤销成功 */
|
759
|
+
success: boolean;
|
760
|
+
/** 撤销结果信息 */
|
761
|
+
info: string;
|
762
|
+
}
|
384
763
|
|
385
764
|
/** Github 授权令牌接口返回类型 */
|
386
765
|
interface TokenResponseType {
|
@@ -861,300 +1240,79 @@ interface CreteIssueCommentParamType extends RepoBaseParamType {
|
|
861
1240
|
}
|
862
1241
|
/** 创建议题评论响应类型 */
|
863
1242
|
type CreteIssueCommentResponseType = IssueCommentInfoResponseType;
|
864
|
-
/** 更新议题评论参数类型 */
|
865
|
-
interface UpdateIssueCommentParamType extends IssueCommentInfoParamType {
|
866
|
-
/** 评论内容 */
|
867
|
-
body: string;
|
868
|
-
}
|
869
|
-
/** 更新议题评论响应类型 */
|
870
|
-
type UpdateIssueCommentResponseType = IssueCommentInfoResponseType;
|
871
|
-
/** 删除议题评论参数类型 */
|
872
|
-
interface RemoveIssueCommentParamType extends RepoBaseParamType {
|
873
|
-
/** 评论ID */
|
874
|
-
comment_id: string | number;
|
875
|
-
}
|
876
|
-
/** 删除议题评论响应类型 */
|
877
|
-
interface RemoveIssueCommentResponseType {
|
878
|
-
/** 删除状态信息 */
|
879
|
-
info: string;
|
880
|
-
}
|
881
|
-
/** 获取子议题列表参数类型 */
|
882
|
-
interface SubIssueListParamType extends RepoBaseParamType {
|
883
|
-
/** 议题ID */
|
884
|
-
issue_number: IssueNumberParamType['issue_number'];
|
885
|
-
/**
|
886
|
-
* 每页结果数量
|
887
|
-
* @default 30
|
888
|
-
*/
|
889
|
-
per_page?: number;
|
890
|
-
/**
|
891
|
-
* 页码
|
892
|
-
* @default 1
|
893
|
-
*/
|
894
|
-
page?: number;
|
895
|
-
}
|
896
|
-
/** 获取子议题列表响应类型 */
|
897
|
-
type SubIssueListResponseType = IssueInfoResponseType[];
|
898
|
-
/** 添加子议题参数类型 */
|
899
|
-
interface AddSubIssueParamType extends RepoBaseParamType {
|
900
|
-
/** 议题ID */
|
901
|
-
issue_number: IssueNumberParamType['issue_number'];
|
902
|
-
/** * 子议题ID */
|
903
|
-
sub_issue_id: IssueNumberParamType['issue_number'];
|
904
|
-
/** * 是否替换父议题 */
|
905
|
-
replace_parent: boolean;
|
906
|
-
}
|
907
|
-
/** 添加子议题响应类型 */
|
908
|
-
type AddSubIssueResponseType = IssueInfoResponseType;
|
909
|
-
/** 删除子议题参数类型 */
|
910
|
-
interface RemoveSubIssueParamType extends RepoBaseParamType {
|
911
|
-
/** 议题ID */
|
912
|
-
issue_number: IssueNumberParamType['issue_number'];
|
913
|
-
/** 子议题ID */
|
914
|
-
sub_issue_id: IssueNumberParamType['issue_number'];
|
915
|
-
}
|
916
|
-
/** 删除子议题响应类型 */
|
917
|
-
type RemoveSubIssueResponseType = IssueInfoResponseType;
|
918
|
-
/** 重新确定子议题优先级参数类型 */
|
919
|
-
interface ReprioritizeSubIssueParamType extends RepoBaseParamType {
|
920
|
-
/** 议题ID */
|
921
|
-
issue_number: IssueNumberParamType['issue_number'];
|
922
|
-
/** 子议题ID */
|
923
|
-
sub_issue_id: IssueNumberParamType['issue_number'];
|
924
|
-
/**
|
925
|
-
* 要优先排序的子问题的 ID(与 before_id 互斥,只能指定其中一个)
|
926
|
-
* 在此 ID 之后放置子问题
|
927
|
-
*/
|
928
|
-
after_id?: IssueNumberParamType['issue_number'];
|
929
|
-
/**
|
930
|
-
* 要优先排序的子问题的 ID(与 after_id 互斥,只能指定其中一个)
|
931
|
-
* 在此 ID 之前放置子问题
|
932
|
-
*/
|
933
|
-
before_id?: IssueNumberParamType['issue_number'];
|
934
|
-
}
|
935
|
-
/** 重新确定子议题优先级响应类型 */
|
936
|
-
type ReprioritizeSubIssueResponseType = IssueInfoResponseType;
|
937
|
-
|
938
|
-
/** 仓库所有者参数类型 */
|
939
|
-
type RepoUser = Omit<UserInfoResponseType, 'followers' | 'following' | 'blog' | 'bio' | 'public_repos'>;
|
940
|
-
/** 仓库列表参数类型 */
|
941
|
-
interface RepoListBaseParamType {
|
942
|
-
/** 排序方式,可选created, updated, pushed, full_name, 默认为 full_name */
|
943
|
-
sort?: 'created' | 'updated' | 'pushed' | 'full_name';
|
944
|
-
/** 排序方式,可选asc, desc, 默认为 desc */
|
945
|
-
direction?: 'asc' | 'desc';
|
946
|
-
/** 每页数量 */
|
947
|
-
per_page?: number;
|
948
|
-
/** 页码 */
|
949
|
-
page?: number;
|
950
|
-
}
|
951
|
-
interface UserByTokenRepoListParamType extends RepoListBaseParamType {
|
952
|
-
/** 仓库的可见性,可选all, public, private, 默认为 all */
|
953
|
-
visibility?: 'all' | 'public' | 'private';
|
954
|
-
/** 仓库的状态,可选all, public, private, 默认为 all */
|
955
|
-
affiliation?: 'owner' | 'collaborator' | 'organization_member';
|
956
|
-
/** 类型,可选all, owner, member, 默认为 all */
|
957
|
-
type?: 'all' | 'owner' | 'member';
|
958
|
-
}
|
959
|
-
/** 仓库信息请求参数 */
|
960
|
-
type RepoInfoParamType = RepoBaseParamType;
|
961
|
-
/** * 仓库信息 */
|
962
|
-
interface RepoInfoResponseType {
|
963
|
-
/** * 仓库的唯一 ID */
|
964
|
-
id: number;
|
965
|
-
/** * 仓库的名称 */
|
966
|
-
name: string;
|
967
|
-
/** * 仓库的完整名称,包含用户名或组织名 */
|
968
|
-
full_name: string;
|
969
|
-
/** * 仓库拥有者的信息 */
|
970
|
-
owner: RepoUser;
|
971
|
-
/** 仓库是否公开 */
|
972
|
-
public: boolean;
|
973
|
-
/** * 仓库是否私有 */
|
974
|
-
private: boolean;
|
975
|
-
/** * 仓库的可见性 */
|
976
|
-
visibility: 'public' | 'private';
|
977
|
-
/** * 仓库是否是 fork 仓库 */
|
978
|
-
fork: boolean;
|
979
|
-
/** * 仓库是否已归档 */
|
980
|
-
archived: boolean;
|
981
|
-
/** * 仓库是否被禁用 */
|
982
|
-
disabled: boolean;
|
983
|
-
/** * 仓库的 HTML 页面 URL */
|
984
|
-
html_url: string;
|
985
|
-
/** * 仓库的描述信息 */
|
986
|
-
description: string | null;
|
987
|
-
/** * 仓库的 Stargazer 数量 */
|
988
|
-
stargazers_count: number;
|
989
|
-
/** * 仓库的 Watcher 数量 */
|
990
|
-
watchers_count: number;
|
991
|
-
/** * 仓库的主编程语言 */
|
992
|
-
language: string | null;
|
993
|
-
/** * 仓库的 fork 数量 */
|
994
|
-
forks_count: number;
|
995
|
-
/** * 开放的 issue 数量 */
|
996
|
-
open_issues_count: number;
|
997
|
-
/** * 仓库的默认分支 */
|
998
|
-
default_branch: string;
|
999
|
-
/** * 仓库的创建时间 */
|
1000
|
-
created_at: string;
|
1001
|
-
/** * 仓库的更新时间 */
|
1002
|
-
updated_at: string;
|
1003
|
-
/** * 仓库的推送时间 */
|
1004
|
-
pushed_at: string;
|
1005
|
-
}
|
1006
|
-
/** 组织仓库列表参数类型 */
|
1007
|
-
interface OrgRepoListParmType extends RepoListBaseParamType {
|
1008
|
-
/** 组织名称 */
|
1009
|
-
org: string;
|
1010
|
-
/** 类型,可选all, public, private 默认为 all */
|
1011
|
-
type?: 'all' | 'public' | 'private';
|
1012
|
-
}
|
1013
|
-
/**
|
1014
|
-
* 组织仓库列表响应类型
|
1015
|
-
* 该类型包含了多个仓库的信息,每个仓库都有自己的详细信息。
|
1016
|
-
*/
|
1017
|
-
type OrgRepoListResponseType = RepoInfoResponseType[];
|
1018
|
-
/** 创建组织仓库请求参数 */
|
1019
|
-
interface OrgRepoCreateParamType extends OrgNameParamType {
|
1020
|
-
/** 仓库名称 */
|
1021
|
-
name: string;
|
1022
|
-
/** 仓库描述 */
|
1023
|
-
description?: string;
|
1024
|
-
/** 仓库主页 */
|
1025
|
-
homepage?: string;
|
1026
|
-
/** 仓库可见性 */
|
1027
|
-
visibility?: 'public' | 'private';
|
1028
|
-
/** 是否开启议题issue */
|
1029
|
-
has_issues?: boolean;
|
1030
|
-
/** 是否开启wiki */
|
1031
|
-
has_wiki?: boolean;
|
1032
|
-
/** 仓库自动初始化 */
|
1033
|
-
auto_init?: boolean;
|
1034
|
-
}
|
1035
|
-
/** 创建组织仓库响应类型 */
|
1036
|
-
type OrgRepoCreateResponseType = RepoInfoResponseType;
|
1037
|
-
/** 创建用户仓库参数类型 */
|
1038
|
-
type UserRepoCreateParamType = Omit<OrgRepoCreateParamType, 'org'> & RepoOwnerParamType;
|
1039
|
-
/** 创建用户仓库响应类型 */
|
1040
|
-
type UserRepoCreateResponseType = RepoInfoResponseType;
|
1041
|
-
/** 用户仓库列表参数类型 */
|
1042
|
-
interface UserRepoListParamType extends RepoListBaseParamType {
|
1043
|
-
/** 用户名 */
|
1044
|
-
username: string;
|
1045
|
-
/** 类型,可选all, owner, member, 默认为 all */
|
1046
|
-
type?: 'all' | 'owner' | 'member';
|
1047
|
-
}
|
1048
|
-
/** 用户仓库列表类型 */
|
1049
|
-
type UserRepoListType = Array<RepoInfoResponseType & {
|
1050
|
-
/** * 仓库的角色名称 */
|
1051
|
-
role_name?: string;
|
1052
|
-
}>;
|
1053
|
-
/** 仓库语言信息类型 */
|
1054
|
-
interface LanguageInfo {
|
1055
|
-
/** 编程语言名称 */
|
1056
|
-
language: string;
|
1057
|
-
/** 语言对应的颜色 */
|
1058
|
-
color: string;
|
1059
|
-
/** 在仓库中的占比(百分比) */
|
1060
|
-
percent: number;
|
1061
|
-
/** 该语言的代码字节数 */
|
1062
|
-
bytes: number;
|
1063
|
-
}
|
1064
|
-
/** 仓库语言列表参数类型 */
|
1065
|
-
type RepoLanguagesListParamType = RepoBaseParamType;
|
1066
|
-
/** 仓库语言列表类型 */
|
1067
|
-
interface RepoLanguagesListResponseType {
|
1068
|
-
/** 仓库的语言统计信息列表 */
|
1069
|
-
languages: LanguageInfo[];
|
1243
|
+
/** 更新议题评论参数类型 */
|
1244
|
+
interface UpdateIssueCommentParamType extends IssueCommentInfoParamType {
|
1245
|
+
/** 评论内容 */
|
1246
|
+
body: string;
|
1070
1247
|
}
|
1071
|
-
/**
|
1072
|
-
type
|
1073
|
-
/**
|
1074
|
-
|
1075
|
-
/**
|
1076
|
-
|
1077
|
-
/** 获取仓库默认分支响应类型 */
|
1078
|
-
type GetRepoDefaultBranchResponseType = RepoInfoResponseType['default_branch'];
|
1079
|
-
/** 获取仓库主要语言参数类型 */
|
1080
|
-
type GetRepoMainLanguageParamType = RepoBaseParamType;
|
1081
|
-
/** 仓库主要语言响应类型 */
|
1082
|
-
type GetRepoMainLanguageResponseType = RepoInfoResponseType['language'];
|
1083
|
-
/**
|
1084
|
-
* 协作者权限 ,可选 pull,triage, push, maintain, admin,默认pull
|
1085
|
-
* pull - 只读访问,协作者可以查看仓库内容。
|
1086
|
-
* push - 允许推送代码到仓库分支,同时拥有 pull 权限。
|
1087
|
-
* admin - 拥有仓库的完全控制权,包括更改设置和删除仓库。
|
1088
|
-
*/
|
1089
|
-
type CollaboratorPermissionType = 'pull' | 'push' | 'admin';
|
1090
|
-
/** 协作者参数类型 */
|
1091
|
-
type CollaboratorParamType = RepoInfoParamType & UserNameParamType & {
|
1092
|
-
permission?: CollaboratorPermissionType;
|
1093
|
-
};
|
1094
|
-
/** 邀请协作者响应类型 */
|
1095
|
-
interface AddCollaboratorResponseType {
|
1096
|
-
/** 被邀请者ID */
|
1097
|
-
id: number;
|
1098
|
-
/** 被邀请者用户名 */
|
1099
|
-
login: string;
|
1100
|
-
/** 被邀请者的别名 */
|
1101
|
-
name: string | null;
|
1102
|
-
/** 仓库的地址 */
|
1103
|
-
html_url: string;
|
1104
|
-
/** 被邀请者的权限 */
|
1105
|
-
permissions: string;
|
1248
|
+
/** 更新议题评论响应类型 */
|
1249
|
+
type UpdateIssueCommentResponseType = IssueCommentInfoResponseType;
|
1250
|
+
/** 删除议题评论参数类型 */
|
1251
|
+
interface RemoveIssueCommentParamType extends RepoBaseParamType {
|
1252
|
+
/** 评论ID */
|
1253
|
+
comment_id: string | number;
|
1106
1254
|
}
|
1107
|
-
/**
|
1108
|
-
|
1255
|
+
/** 删除议题评论响应类型 */
|
1256
|
+
interface RemoveIssueCommentResponseType {
|
1257
|
+
/** 删除状态信息 */
|
1258
|
+
info: string;
|
1259
|
+
}
|
1260
|
+
/** 获取子议题列表参数类型 */
|
1261
|
+
interface SubIssueListParamType extends RepoBaseParamType {
|
1262
|
+
/** 议题ID */
|
1263
|
+
issue_number: IssueNumberParamType['issue_number'];
|
1109
1264
|
/**
|
1110
|
-
*
|
1111
|
-
*
|
1112
|
-
|
1113
|
-
* all - 列出仓库成员和外部 collaborator。
|
1114
|
-
*/
|
1115
|
-
affiliation?: 'outside' | 'direct' | 'all';
|
1116
|
-
/** 权限 */
|
1117
|
-
permission?: CollaboratorPermissionType;
|
1118
|
-
/** 每页数量 */
|
1265
|
+
* 每页结果数量
|
1266
|
+
* @default 30
|
1267
|
+
*/
|
1119
1268
|
per_page?: number;
|
1120
|
-
/**
|
1269
|
+
/**
|
1270
|
+
* 页码
|
1271
|
+
* @default 1
|
1272
|
+
*/
|
1121
1273
|
page?: number;
|
1122
|
-
};
|
1123
|
-
/** 协作者信息类型 */
|
1124
|
-
interface CollaboratorInfoResponseType {
|
1125
|
-
/** 协作者id */
|
1126
|
-
id: number;
|
1127
|
-
/** 协作者登录名 */
|
1128
|
-
login: string;
|
1129
|
-
/** 头像URL */
|
1130
|
-
avatar_url: string;
|
1131
|
-
/** 协作者邮箱 */
|
1132
|
-
email: string | null;
|
1133
|
-
/** 协作者姓名 */
|
1134
|
-
name: string | null;
|
1135
|
-
/** 权限设置 */
|
1136
|
-
permissions: {
|
1137
|
-
/** 拉取权限 */
|
1138
|
-
pull: boolean;
|
1139
|
-
/** 分类权限 */
|
1140
|
-
triage: boolean;
|
1141
|
-
/** 推送权限 */
|
1142
|
-
push: boolean;
|
1143
|
-
/** 维护权限 */
|
1144
|
-
maintain: boolean;
|
1145
|
-
/** 管理权限 */
|
1146
|
-
admin: boolean;
|
1147
|
-
};
|
1148
1274
|
}
|
1149
|
-
/**
|
1150
|
-
type
|
1151
|
-
/**
|
1152
|
-
|
1153
|
-
/**
|
1154
|
-
|
1155
|
-
/**
|
1156
|
-
|
1275
|
+
/** 获取子议题列表响应类型 */
|
1276
|
+
type SubIssueListResponseType = IssueInfoResponseType[];
|
1277
|
+
/** 添加子议题参数类型 */
|
1278
|
+
interface CreateSubIssueParamType extends RepoBaseParamType {
|
1279
|
+
/** 议题ID */
|
1280
|
+
issue_number: IssueNumberParamType['issue_number'];
|
1281
|
+
/** * 子议题ID */
|
1282
|
+
sub_issue_id: IssueNumberParamType['issue_number'];
|
1283
|
+
/** * 是否替换父议题 */
|
1284
|
+
replace_parent: boolean;
|
1285
|
+
}
|
1286
|
+
/** 添加子议题响应类型 */
|
1287
|
+
type CreateSubIssueResponseType = IssueInfoResponseType;
|
1288
|
+
/** 删除子议题参数类型 */
|
1289
|
+
interface RemoveSubIssueParamType extends RepoBaseParamType {
|
1290
|
+
/** 议题ID */
|
1291
|
+
issue_number: IssueNumberParamType['issue_number'];
|
1292
|
+
/** 子议题ID */
|
1293
|
+
sub_issue_id: IssueNumberParamType['issue_number'];
|
1294
|
+
}
|
1295
|
+
/** 删除子议题响应类型 */
|
1296
|
+
type RemoveSubIssueResponseType = IssueInfoResponseType;
|
1297
|
+
/** 重新确定子议题优先级参数类型 */
|
1298
|
+
interface ReprioritizeSubIssueParamType extends RepoBaseParamType {
|
1299
|
+
/** 议题ID */
|
1300
|
+
issue_number: IssueNumberParamType['issue_number'];
|
1301
|
+
/** 子议题ID */
|
1302
|
+
sub_issue_id: IssueNumberParamType['issue_number'];
|
1303
|
+
/**
|
1304
|
+
* 要优先排序的子问题的 ID(与 before_id 互斥,只能指定其中一个)
|
1305
|
+
* 在此 ID 之后放置子问题
|
1306
|
+
*/
|
1307
|
+
after_id?: IssueNumberParamType['issue_number'];
|
1308
|
+
/**
|
1309
|
+
* 要优先排序的子问题的 ID(与 after_id 互斥,只能指定其中一个)
|
1310
|
+
* 在此 ID 之前放置子问题
|
1311
|
+
*/
|
1312
|
+
before_id?: IssueNumberParamType['issue_number'];
|
1157
1313
|
}
|
1314
|
+
/** 重新确定子议题优先级响应类型 */
|
1315
|
+
type ReprioritizeSubIssueResponseType = IssueInfoResponseType;
|
1158
1316
|
|
1159
1317
|
/** 组织信息参数类型 */
|
1160
1318
|
type OrgInfoParamType = OrgNameParamType;
|
@@ -1221,19 +1379,30 @@ interface PullRequestInfoResponseType {
|
|
1221
1379
|
merged_at: string | null;
|
1222
1380
|
/** PR作者 */
|
1223
1381
|
user: PrUser;
|
1382
|
+
/** PR的目标分支 */
|
1224
1383
|
base: {
|
1384
|
+
/** 分支标签 */
|
1225
1385
|
label: string;
|
1386
|
+
/** 分支名称 */
|
1226
1387
|
ref: string;
|
1388
|
+
/** 当前分支最新提交的 SHA 值 */
|
1227
1389
|
sha: string;
|
1390
|
+
/** 分支的用户信息 */
|
1228
1391
|
user: PrUser;
|
1392
|
+
/** 分支的仓库信息 */
|
1229
1393
|
repo: PrRepo;
|
1230
1394
|
};
|
1231
1395
|
/** PR的源分支信息 */
|
1232
1396
|
head: {
|
1397
|
+
/** 分支标签 */
|
1233
1398
|
label: string;
|
1399
|
+
/** 分支名称 */
|
1234
1400
|
ref: string;
|
1401
|
+
/** 当前分支最新提交的 SHA 值 */
|
1235
1402
|
sha: string;
|
1403
|
+
/** 分支的用户信息 */
|
1236
1404
|
user: PrUser;
|
1405
|
+
/** 分支的仓库信息 */
|
1237
1406
|
repo: PrRepo;
|
1238
1407
|
};
|
1239
1408
|
/** 指派人 */
|
@@ -1591,8 +1760,6 @@ interface DeleteReleaseResponseType {
|
|
1591
1760
|
}
|
1592
1761
|
|
1593
1762
|
interface WebHookSignatureParamType {
|
1594
|
-
/** WebHook 的 secret */
|
1595
|
-
secret?: string;
|
1596
1763
|
/** 请求体 */
|
1597
1764
|
payload: string;
|
1598
1765
|
/** GitHub 发送的签名头 */
|
@@ -1613,10 +1780,11 @@ interface WebHookSignatureResponseType {
|
|
1613
1780
|
* @returns 格式化后的日期字符串
|
1614
1781
|
* @example
|
1615
1782
|
* ```ts
|
1616
|
-
* console.log(await
|
1783
|
+
* console.log(await format_date('2025-04-16T10:00:00')
|
1784
|
+
* -> '2025-04-16 10:00:00'
|
1617
1785
|
* ```
|
1618
1786
|
*/
|
1619
|
-
declare function
|
1787
|
+
declare function format_date(dateString: string, locale?: string, format?: string): Promise<string>;
|
1620
1788
|
/**
|
1621
1789
|
* 获取相对时间
|
1622
1790
|
* @param dateString - 日期字符串
|
@@ -1629,33 +1797,14 @@ declare function formatDate(dateString: string, locale?: string, format?: string
|
|
1629
1797
|
* ```
|
1630
1798
|
*/
|
1631
1799
|
declare function get_relative_time(dateString: string, locale?: string): Promise<string>;
|
1632
|
-
/**
|
1633
|
-
* 获取本地仓库的默认分支
|
1634
|
-
* @param local_path - 本地仓库路径
|
1635
|
-
* @returns 默认分支名称
|
1636
|
-
* @example
|
1637
|
-
* ```ts
|
1638
|
-
* console.log(await get_local_repo_default_branch('/path/to/repo')) // 输出 'main'
|
1639
|
-
* ```
|
1640
|
-
*/
|
1641
|
-
declare function get_local_repo_default_branch(local_path: string): Promise<string>;
|
1642
|
-
/**
|
1643
|
-
* 获取远程仓库的默认分支
|
1644
|
-
* @param remote_url - 远程仓库URL
|
1645
|
-
* @returns 默认分支名称
|
1646
|
-
* @example
|
1647
|
-
* ```ts
|
1648
|
-
* console.log(await get_remote_repo_default_branch('https://github.com/CandriaJS/git-neko-kit')) // 输出 'main'
|
1649
|
-
* ```
|
1650
|
-
*/
|
1651
|
-
declare function get_remote_repo_default_branch(remote_url: string): Promise<string>;
|
1652
1800
|
/**
|
1653
1801
|
* 根据语言名称获取对应的颜色值
|
1654
1802
|
* @param language - 语言名称
|
1655
1803
|
* @returns 颜色值的十六进制字符串
|
1656
1804
|
* @example
|
1657
1805
|
* ```ts
|
1658
|
-
* console.log(get_langage_color('JavaScript'))
|
1806
|
+
* console.log(get_langage_color('JavaScript'))
|
1807
|
+
* -> '#f1e05a'
|
1659
1808
|
* ```
|
1660
1809
|
*/
|
1661
1810
|
declare function get_langage_color(language: string): string;
|
@@ -1665,7 +1814,8 @@ declare function get_langage_color(language: string): string;
|
|
1665
1814
|
* @returns 生成的唯一标识符
|
1666
1815
|
* @example
|
1667
1816
|
* ```ts
|
1668
|
-
* const stateId = await create_state_id()
|
1817
|
+
* const stateId = await create_state_id()
|
1818
|
+
* -> '34523452345234523452345234523452'
|
1669
1819
|
* ```
|
1670
1820
|
*/
|
1671
1821
|
declare function create_state_id(): Promise<string>;
|
@@ -1690,7 +1840,7 @@ declare class Auth extends GitHubClient {
|
|
1690
1840
|
* @example
|
1691
1841
|
* ```ts
|
1692
1842
|
* const token = await auth.get_token_by_code({ code: 'code' })
|
1693
|
-
*
|
1843
|
+
* -> { info: '获取'access_token: 'token', refresh_token: 'refresh_token' }
|
1694
1844
|
* ```
|
1695
1845
|
*/
|
1696
1846
|
get_token_by_code(options: AccessCodeType): Promise<ApiResponseType<TokenResponseType>>;
|
@@ -1753,7 +1903,7 @@ declare class Commit extends GitHubClient {
|
|
1753
1903
|
* @example
|
1754
1904
|
* ```ts
|
1755
1905
|
* const commitInfo = await commit.get_commit_info({ owner: 'owner', repo: 'repo' })
|
1756
|
-
*
|
1906
|
+
* -> 提交信息对象
|
1757
1907
|
* ```
|
1758
1908
|
*/
|
1759
1909
|
get_commit_info(options: CommitInfoParamType): Promise<ApiResponseType<CommitInfoResponseType>>;
|
@@ -1775,7 +1925,7 @@ declare class Commit extends GitHubClient {
|
|
1775
1925
|
* @example
|
1776
1926
|
* ```ts
|
1777
1927
|
* const commitList = await commit.get_commit_list({ owner: 'owner', repo:'repo' })
|
1778
|
-
*
|
1928
|
+
* -> 提交对象列表
|
1779
1929
|
* ```
|
1780
1930
|
*/
|
1781
1931
|
get_commit_list(options: CommitListParamType): Promise<ApiResponseType<CommitListResponseType>>;
|
@@ -1807,9 +1957,8 @@ declare class Issue extends GitHubClient {
|
|
1807
1957
|
* @returns 包含Issue信息的响应对象
|
1808
1958
|
* @example
|
1809
1959
|
* ```ts
|
1810
|
-
* const issue = get_issue() // 获取issue实例
|
1811
1960
|
* const res = await issue.get_issue_info({ owner: 'owner', repo:'repo', issue_number:1 })
|
1812
|
-
*
|
1961
|
+
* -> 议题信息对象
|
1813
1962
|
* ```
|
1814
1963
|
*/
|
1815
1964
|
get_issue_info(options: IssueInfoParamType): Promise<ApiResponseType<IssueInfoResponseType>>;
|
@@ -1835,9 +1984,8 @@ declare class Issue extends GitHubClient {
|
|
1835
1984
|
* @returns 包含Issue列表的响应对象
|
1836
1985
|
* @example
|
1837
1986
|
* ```ts
|
1838
|
-
* const issue = get_issue() // 获取issue实例
|
1839
1987
|
* const res = await issue.get_issue_list({ owner: 'owner', repo: 'repo' })
|
1840
|
-
*
|
1988
|
+
* -> 议题信息对象列表
|
1841
1989
|
* ```
|
1842
1990
|
*/
|
1843
1991
|
get_issues_list(options: RepoIssueListParamType): Promise<ApiResponseType<IssueListResponseType>>;
|
@@ -1857,9 +2005,8 @@ declare class Issue extends GitHubClient {
|
|
1857
2005
|
* @returns 包含Issue信息的响应对象
|
1858
2006
|
* @example
|
1859
2007
|
* ```ts
|
1860
|
-
* const issue = get_issue() // 获取issue实例
|
1861
2008
|
* const res = await issue.create_issue({ owner: 'owner', repo:'repo', title:'title', body:'body' })
|
1862
|
-
*
|
2009
|
+
* -> 创建议题信息对象
|
1863
2010
|
* ```
|
1864
2011
|
*/
|
1865
2012
|
create_issue(options: CreteIssueParamType): Promise<ApiResponseType<CreateIssueResponseType>>;
|
@@ -1882,9 +2029,8 @@ declare class Issue extends GitHubClient {
|
|
1882
2029
|
* @returns 包含Issue信息的响应对象
|
1883
2030
|
* @example
|
1884
2031
|
* ```ts
|
1885
|
-
* const issue = get_issue() // 获取issue实例
|
1886
2032
|
* const res = await issue.update_issue({ owner: 'owner', repo:'repo', issue_number:1, title:'title', body:'body' })
|
1887
|
-
*
|
2033
|
+
* -> 更新议题信息对象
|
1888
2034
|
* ```
|
1889
2035
|
*/
|
1890
2036
|
update_issue(options: UpdateIssueParamType): Promise<ApiResponseType<UpdateIssueResponseType>>;
|
@@ -1901,9 +2047,8 @@ declare class Issue extends GitHubClient {
|
|
1901
2047
|
* @returns 包含Issue信息的响应对象
|
1902
2048
|
* @example
|
1903
2049
|
* ```ts
|
1904
|
-
* const issue = get_issue() // 获取issue实例
|
1905
2050
|
* const res = await issue.open_issue({ owner: 'owner', repo:'repo', issue_number:1 })
|
1906
|
-
*
|
2051
|
+
* -> 打开议题信息对象
|
1907
2052
|
* ```
|
1908
2053
|
*/
|
1909
2054
|
open_issue(options: OpenIssueParamType): Promise<ApiResponseType<OpenIssueResponseType>>;
|
@@ -1930,14 +2075,14 @@ declare class Issue extends GitHubClient {
|
|
1930
2075
|
* @returns 包含Issue信息的响应对象
|
1931
2076
|
* @example
|
1932
2077
|
* ```ts
|
1933
|
-
* const issue = get_issue() // 获取issue实例
|
1934
2078
|
* const res = await issue.close_issue({ owner: 'owner', repo:'repo', issue_number:1, state_reason:'completed' })
|
1935
|
-
*
|
2079
|
+
* -> 关闭议题信息对象
|
1936
2080
|
* ```
|
1937
2081
|
*/
|
1938
2082
|
close_issue(options: CloseIssueParamType): Promise<ApiResponseType<CloseIssueResponseType>>;
|
1939
2083
|
/**
|
1940
2084
|
* 锁定一个议题
|
2085
|
+
* @github
|
1941
2086
|
* 仅GitHub平台可用
|
1942
2087
|
* 权限:
|
1943
2088
|
* - Issues: Write
|
@@ -1951,14 +2096,14 @@ declare class Issue extends GitHubClient {
|
|
1951
2096
|
* @returns 锁定状态信息
|
1952
2097
|
* @example
|
1953
2098
|
* ```ts
|
1954
|
-
* const issue = get_issue() // 获取issue实例
|
1955
2099
|
* const res = await issue.lock_issue({ owner: 'owner', repo:'repo', issue_number:1, lock_reason:'off-topic' })
|
1956
|
-
*
|
2100
|
+
* -> 锁定议题信息对象
|
1957
2101
|
* ```
|
1958
2102
|
*/
|
1959
2103
|
lock_issue(options: LockIssueParamType): Promise<ApiResponseType<LockIssueResponseType>>;
|
1960
2104
|
/**
|
1961
2105
|
* 解锁一个议题
|
2106
|
+
* @github
|
1962
2107
|
* 仅GitHub平台可用
|
1963
2108
|
* 权限:
|
1964
2109
|
* - Issues: Write
|
@@ -1971,9 +2116,8 @@ declare class Issue extends GitHubClient {
|
|
1971
2116
|
* @returns 解锁状态信息
|
1972
2117
|
* @example
|
1973
2118
|
* ```ts
|
1974
|
-
* const issue = get_issue() // 获取issue实例
|
1975
2119
|
* const res = await issue.unlock_issue({ owner: 'owner', repo:'repo', issue_number})
|
1976
|
-
*
|
2120
|
+
* -> 解锁议题信息对象
|
1977
2121
|
* ```
|
1978
2122
|
*/
|
1979
2123
|
unlock_issue(options: UnLockIssueParamType): Promise<ApiResponseType<UnLockIssueResponseType>>;
|
@@ -1994,9 +2138,8 @@ declare class Issue extends GitHubClient {
|
|
1994
2138
|
* @returns 包含Issue评论列表的响应对象
|
1995
2139
|
* @example
|
1996
2140
|
* ```ts
|
1997
|
-
* const issue = get_issue() // 获取issue实例
|
1998
2141
|
* const res = await issue.get_issue_comments_list({ owner: 'owner', repo:'repo', issue_number:1 })
|
1999
|
-
*
|
2142
|
+
* -> 议题评论对象列表
|
2000
2143
|
* ```
|
2001
2144
|
*/
|
2002
2145
|
get_repo_comments_list(options: RepoCommentListParamType): Promise<ApiResponseType<RepoCommentListResponseType>>;
|
@@ -2016,9 +2159,8 @@ declare class Issue extends GitHubClient {
|
|
2016
2159
|
* @returns 包含Issue评论列表的响应对象
|
2017
2160
|
* @example
|
2018
2161
|
* ```ts
|
2019
|
-
* const issue = get_issue() // 获取issue实例
|
2020
2162
|
* const res = await issue.get_issue_comments_list({ owner: 'owner', repo:'repo', issue_number:1 })
|
2021
|
-
*
|
2163
|
+
* -> 议题评论对象列表
|
2022
2164
|
* ```
|
2023
2165
|
*/
|
2024
2166
|
get_issue_comments_list(options: IssueCommentListParamType): Promise<ApiResponseType<IssueCommentListResponseType>>;
|
@@ -2035,9 +2177,8 @@ declare class Issue extends GitHubClient {
|
|
2035
2177
|
* @returns Issue评论信息
|
2036
2178
|
* @example
|
2037
2179
|
* ```ts
|
2038
|
-
* const issue = get_issue() // 获取issue实例
|
2039
2180
|
* const res = await issue.get_issue_comment({ owner: 'owner', repo:'repo', comment_id:1 })
|
2040
|
-
*
|
2181
|
+
* -> 议题评论对象
|
2041
2182
|
* ```
|
2042
2183
|
*/
|
2043
2184
|
get_issue_comment_info(options: IssueCommentInfoParamType): Promise<ApiResponseType<IssueCommentInfoResponseType>>;
|
@@ -2057,7 +2198,7 @@ declare class Issue extends GitHubClient {
|
|
2057
2198
|
* ```ts
|
2058
2199
|
* const issue = get_issue() // 获取issue实例
|
2059
2200
|
* const res = await issue.create_issue_comment({ owner: 'owner', repo:'repo', issue_number:1, body:'comment' })
|
2060
|
-
*
|
2201
|
+
* -> 创建议题评论对象
|
2061
2202
|
* ```
|
2062
2203
|
*/
|
2063
2204
|
create_issue_comment(options: CreteIssueCommentParamType): Promise<ApiResponseType<CreteIssueCommentResponseType>>;
|
@@ -2075,9 +2216,8 @@ declare class Issue extends GitHubClient {
|
|
2075
2216
|
* @returns 更新后的Issue评论信息
|
2076
2217
|
* @example
|
2077
2218
|
* ```ts
|
2078
|
-
* const issue = get_issue() // 获取issue实例
|
2079
2219
|
* const res = await issue.update_issue_comment({ owner: 'owner', repo:'repo', comment_id:1, body:'body' })
|
2080
|
-
*
|
2220
|
+
* -> 更新议题评论对象
|
2081
2221
|
* ```
|
2082
2222
|
*/
|
2083
2223
|
update_issue_comment(options: UpdateIssueCommentParamType): Promise<ApiResponseType<UpdateIssueCommentResponseType>>;
|
@@ -2094,9 +2234,8 @@ declare class Issue extends GitHubClient {
|
|
2094
2234
|
* @returns 删除结果信息
|
2095
2235
|
* @example
|
2096
2236
|
* ```ts
|
2097
|
-
* const issue = get_issue() // 获取issue实例
|
2098
2237
|
* const res = awaitissue.remove_issue_comment()
|
2099
|
-
*
|
2238
|
+
* -> 删除议题评论对象
|
2100
2239
|
* ```
|
2101
2240
|
*/
|
2102
2241
|
remove_issue_comment(options: RemoveIssueCommentParamType): Promise<ApiResponseType<RemoveCollaboratorResponseType>>;
|
@@ -2124,14 +2263,13 @@ declare class Issue extends GitHubClient {
|
|
2124
2263
|
* @returns 子议题列表
|
2125
2264
|
* @example
|
2126
2265
|
* ```ts
|
2127
|
-
* const issue = get_issue() // 获取issue实例
|
2128
2266
|
* const res = await issue.get_sub_issue_list({ owner: 'owner', repo:'repo', issue_number:1 })
|
2129
|
-
*
|
2267
|
+
* -> 子议题信息对象列表
|
2130
2268
|
* ```
|
2131
2269
|
*/
|
2132
2270
|
get_sub_issue_list(options: SubIssueListParamType): Promise<ApiResponseType<SubIssueListResponseType>>;
|
2133
2271
|
/**
|
2134
|
-
*
|
2272
|
+
* 创建子议题
|
2135
2273
|
* 添加一个子议题到指定的议题中
|
2136
2274
|
* @github
|
2137
2275
|
* 仅GitHub 平台使用
|
@@ -2146,12 +2284,19 @@ declare class Issue extends GitHubClient {
|
|
2146
2284
|
* @returns 添加结果信息
|
2147
2285
|
* @example
|
2148
2286
|
* ```ts
|
2149
|
-
* const issue = get_issue() // 获取issue实例
|
2150
2287
|
* const res = await issue.add_sub_issue({ owner: 'owner', repo:'repo', issue_number:1, sub_issue_id:1, replace_parent:true })
|
2151
|
-
*
|
2288
|
+
* -> 创建子议题信息对象
|
2152
2289
|
* ```
|
2153
2290
|
*/
|
2154
|
-
|
2291
|
+
create_sub_issue(options: CreateSubIssueParamType): Promise<ApiResponseType<CreateSubIssueResponseType>>;
|
2292
|
+
/**
|
2293
|
+
* 添加子议题
|
2294
|
+
* 添加一个子议题到指定的议题中
|
2295
|
+
* @github
|
2296
|
+
* 仅GitHub 平台使用
|
2297
|
+
* @deprecated 已弃用,请使用`create_sub_issue`方法
|
2298
|
+
*/
|
2299
|
+
add_sub_issue(options: CreateSubIssueParamType): Promise<ApiResponseType<CreateSubIssueResponseType>>;
|
2155
2300
|
/**
|
2156
2301
|
* 删除子议题
|
2157
2302
|
* @github
|
@@ -2166,9 +2311,8 @@ declare class Issue extends GitHubClient {
|
|
2166
2311
|
* @returns 删除结果信息
|
2167
2312
|
* @example
|
2168
2313
|
* ```ts
|
2169
|
-
* const issue = get_issue() // 获取issue实例
|
2170
2314
|
* const res = await issue.remove_sub_issue({ owner: 'owner', repo:'repo', issue_number:1, sub_issue_id:1 })
|
2171
|
-
*
|
2315
|
+
* -> 删除子议题信息对象
|
2172
2316
|
* ```
|
2173
2317
|
*/
|
2174
2318
|
remove_sub_issue(options: RemoveSubIssueParamType): Promise<ApiResponseType<RemoveSubIssueResponseType>>;
|
@@ -2196,9 +2340,8 @@ declare class Issue extends GitHubClient {
|
|
2196
2340
|
* - after_id 指定要在哪个子议题之后插入,传入目标子议题的编号
|
2197
2341
|
* @example
|
2198
2342
|
* ```ts
|
2199
|
-
* const issue = get_issue() // 获取issue实例
|
2200
2343
|
* const res = await issue.reprioritize_sub_issue({ owner: 'owner', repo:'repo', issue_number:1, sub_issue_id:1, before_id:1 })
|
2201
|
-
*
|
2344
|
+
* -> 排序子议题信息对象
|
2202
2345
|
* ```
|
2203
2346
|
*/
|
2204
2347
|
reprioritize_sub_issue(options: ReprioritizeSubIssueParamType): Promise<ApiResponseType<ReprioritizeSubIssueResponseType>>;
|
@@ -2222,7 +2365,7 @@ declare class Org extends GitHubClient {
|
|
2222
2365
|
* @example
|
2223
2366
|
* ```ts
|
2224
2367
|
* const orgInfo = await org.get_org_info({ org: 'org' })
|
2225
|
-
*
|
2368
|
+
* -> 组织信息对象
|
2226
2369
|
* ```
|
2227
2370
|
*/
|
2228
2371
|
get_org_info(options: OrgInfoParamType): Promise<ApiResponseType<OrgInfoResponseType>>;
|
@@ -2237,7 +2380,7 @@ declare class Org extends GitHubClient {
|
|
2237
2380
|
* @example
|
2238
2381
|
* ```ts
|
2239
2382
|
* const orgInfo = await org.add_member({ org: 'org', username: 'username' })
|
2240
|
-
*
|
2383
|
+
* -> 添加组织成员对象
|
2241
2384
|
* ```
|
2242
2385
|
*/
|
2243
2386
|
add_member(options: AddMemberParamType): Promise<ApiResponseType<AddMemberResponseType>>;
|
@@ -2267,9 +2410,8 @@ declare class Pull_Request extends GitHubClient {
|
|
2267
2410
|
* @returns 包含pull_request信息的响应对象
|
2268
2411
|
* @example
|
2269
2412
|
* ```ts
|
2270
|
-
* const pull_request = get_pull_request() // 获取pull_request实例
|
2271
2413
|
* const res = await pull_request.get_pull_request_info({ owner: 'owner', repo:'repo', pr_number:1 })
|
2272
|
-
*
|
2414
|
+
* -> 拉取提交信息对象
|
2273
2415
|
* ```
|
2274
2416
|
*/
|
2275
2417
|
get_pull_request_info(options: PullRequestInfoParamType): Promise<ApiResponseType<PullRequestInfoResponseType>>;
|
@@ -2290,9 +2432,8 @@ declare class Pull_Request extends GitHubClient {
|
|
2290
2432
|
* @returns 包含pull_request信息的响应对象
|
2291
2433
|
* @example
|
2292
2434
|
* ```ts
|
2293
|
-
* const pull_request = get_pull_request() // 获取pull_request实例
|
2294
2435
|
* const res = await pull_request.get_get_pull_request_list({ owner: 'owner', repo:'repo' })
|
2295
|
-
*
|
2436
|
+
* -> 拉取提交信息对象列表
|
2296
2437
|
* ```
|
2297
2438
|
*/
|
2298
2439
|
get_get_pull_request_list(options: PullRequestListParamType): Promise<ApiResponseType<PullRequestListResponseType>>;
|
@@ -2314,9 +2455,8 @@ declare class Pull_Request extends GitHubClient {
|
|
2314
2455
|
* @returns 包含pull_request信息的响应对象
|
2315
2456
|
* @example
|
2316
2457
|
* ```ts
|
2317
|
-
* const pull_request = get_pull_request() // 获取pull_request实例
|
2318
2458
|
* const res = await pull_request.create_pull_requestt({ owner: 'owner', repo:'repo', issue: 1, head: 'head', base: 'base' })
|
2319
|
-
*
|
2459
|
+
* -> 创建拉取提交信息对象
|
2320
2460
|
*/
|
2321
2461
|
create_pull_request(options: CreatePullRequestParamType): Promise<ApiResponseType<CreatePullRequestResponseType>>;
|
2322
2462
|
/**
|
@@ -2332,9 +2472,8 @@ declare class Pull_Request extends GitHubClient {
|
|
2332
2472
|
* @returns 包含pull_request信息的响应对象
|
2333
2473
|
* @example
|
2334
2474
|
* ```ts
|
2335
|
-
* const pull_request = get_pull_request() // 获取pull_request实例
|
2336
2475
|
* const res = await pull_request.create_pull_requestt({ owner: 'owner', repo:'repo', pr_number:1, state:'open' })
|
2337
|
-
*
|
2476
|
+
* -> 更新拉取提交信息对象
|
2338
2477
|
*/
|
2339
2478
|
update_pull_request(options: UpdatePullRequestParamType): Promise<ApiResponseType<UpdatePullRequestResponseType>>;
|
2340
2479
|
/**
|
@@ -2352,9 +2491,8 @@ declare class Pull_Request extends GitHubClient {
|
|
2352
2491
|
* @returns 包含pull_request信息的响应对象
|
2353
2492
|
* @example
|
2354
2493
|
* ```ts
|
2355
|
-
* const pull_request = get_pull_request() // 获取pull_request实例
|
2356
2494
|
* const res = await pull_request.merge_pull_request({ owner: 'owner', repo:'repo', pr_number:1 })
|
2357
|
-
*
|
2495
|
+
* -> 合并拉取提交信息对象
|
2358
2496
|
* ```
|
2359
2497
|
*/
|
2360
2498
|
merge_pull_request(options: MergePullRequestParamType): Promise<ApiResponseType<MergePullRequestResponseType>>;
|
@@ -2371,9 +2509,8 @@ declare class Pull_Request extends GitHubClient {
|
|
2371
2509
|
* @returns 包含拉取请求文件列表的响应对象
|
2372
2510
|
* @example
|
2373
2511
|
* ```ts
|
2374
|
-
* const pull_request = get_pull_request() // 获取pull_request实例
|
2375
2512
|
* const res = await pull_request.get_pull_request_files_list({ owner: 'owner', repo:'repo', pr_number:1 })
|
2376
|
-
*
|
2513
|
+
* -> 拉取提交文件信息对象列表
|
2377
2514
|
* ```
|
2378
2515
|
*/
|
2379
2516
|
get_pull_request_files_list(options: GetPullRequestFilesListParamType): Promise<ApiResponseType<GetPullRequestFilesListResponseType>>;
|
@@ -2388,9 +2525,8 @@ declare class Pull_Request extends GitHubClient {
|
|
2388
2525
|
* @returns 包含拉取请求指定的评论id的信息
|
2389
2526
|
* @example
|
2390
2527
|
* ```ts
|
2391
|
-
* const pull_request = get_pull_request() // 获取pull_request实例
|
2392
2528
|
* const res = await pull_request.get_pull_request_comment_info({ owner: 'owner', repo:'repo', comment_id:1 })
|
2393
|
-
*
|
2529
|
+
* -> 拉取提交评论信息对象
|
2394
2530
|
* ```
|
2395
2531
|
*/
|
2396
2532
|
get_pull_request_comment_info(options: GetPullRequestCommentInfoParamType): Promise<ApiResponseType<GetPullRequestCommentInfoResponseType>>;
|
@@ -2408,9 +2544,8 @@ declare class Pull_Request extends GitHubClient {
|
|
2408
2544
|
* @returns 包含拉取请求评论列表响应信息列表
|
2409
2545
|
* @example
|
2410
2546
|
* ```ts
|
2411
|
-
* const pull_request = get_pull_request() // 获取pull_request实例
|
2412
2547
|
* const res = await pull_request.get_pull_request_comments_list({ owner: 'owner', repo:'repo', pr_number:1 })
|
2413
|
-
*
|
2548
|
+
* -> 拉取提交评论信息对象
|
2414
2549
|
* ```
|
2415
2550
|
*/
|
2416
2551
|
get_pull_request_comments_list(options: GetPullRequestCommentsListParamType): Promise<ApiResponseType<GetPullRequestCommentsListResponseType>>;
|
@@ -2426,9 +2561,8 @@ declare class Pull_Request extends GitHubClient {
|
|
2426
2561
|
* @returns 包含创建拉取请求评论响应信息
|
2427
2562
|
* @example
|
2428
2563
|
* ```ts
|
2429
|
-
* const pull_request = get_pull_request() // 获取pull_request实例
|
2430
2564
|
* const res = await pull_request.create_pull_request_comment({ owner: 'owner', repo:'repo', pr_number:1, body: 'loli' })
|
2431
|
-
*
|
2565
|
+
* -> 创建拉取提交评论信息对象
|
2432
2566
|
* ```
|
2433
2567
|
*/
|
2434
2568
|
create_pull_request_comment(options: CreatePullRequestCommentParamType): Promise<ApiResponseType<CreatePullRequestCommentResponseType>>;
|
@@ -2444,25 +2578,18 @@ declare class Pull_Request extends GitHubClient {
|
|
2444
2578
|
* @returns 包含更新拉取请求评论响应信息
|
2445
2579
|
* @example
|
2446
2580
|
* ```ts
|
2447
|
-
* const pull_request = get_pull_request() // 获取pull_request实例
|
2448
2581
|
* const res = await pull_request.update_pull_request_comment({ owner: 'owner', repo:'repo', comment_id:1, body: 'loli' })
|
2449
|
-
*
|
2582
|
+
* -> 更新拉取提交评论信息对象
|
2450
2583
|
* ```
|
2451
2584
|
*/
|
2452
2585
|
update_pull_request_comment(options: UpdatePullRequestCommentParamType): Promise<ApiResponseType<UpdatePullRequestCommentResponseType>>;
|
2453
2586
|
/**
|
2454
|
-
*
|
2587
|
+
* 编辑拉取请求评论
|
2455
2588
|
* @deprecated 请使用update_issue_comment方法
|
2456
2589
|
* 权限:
|
2457
2590
|
* - Pull requests: Read-And-Write
|
2458
2591
|
* @param options - 删除拉取请求评论参数对象
|
2459
2592
|
* @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
2593
|
* ```
|
2467
2594
|
*/
|
2468
2595
|
edit_pull_request_comment(options: UpdatePullRequestCommentParamType): Promise<ApiResponseType<UpdatePullRequestCommentResponseType>>;
|
@@ -2477,9 +2604,8 @@ declare class Pull_Request extends GitHubClient {
|
|
2477
2604
|
* @returns 包含更新拉取请求评论响应信息
|
2478
2605
|
* @example
|
2479
2606
|
* ```ts
|
2480
|
-
* const pull_request = get_pull_request() // 获取pull_request实例
|
2481
2607
|
* const res = await pull_request.delete_pull_request_comment({ owner: 'owner', repo:'repo', comment_id: 1 })
|
2482
|
-
*
|
2608
|
+
* -> 更新拉取提交评论信息对象
|
2483
2609
|
* ```
|
2484
2610
|
*/
|
2485
2611
|
delete_pull_request_comment(options: DeletePullRequestCommentParamType): Promise<ApiResponseType<DeletePullRequestCommentResponseType>>;
|
@@ -2511,7 +2637,7 @@ declare class Repo extends GitHubClient {
|
|
2511
2637
|
* @example
|
2512
2638
|
* ```ts
|
2513
2639
|
* const repos = await repo.get_org_repos_list({ org: 'org' })
|
2514
|
-
*
|
2640
|
+
* -> 组织仓库信息对象列表
|
2515
2641
|
* ```
|
2516
2642
|
*/
|
2517
2643
|
get_org_repos_list(options: OrgRepoListParmType): Promise<ApiResponseType<OrgRepoListResponseType>>;
|
@@ -2530,7 +2656,7 @@ declare class Repo extends GitHubClient {
|
|
2530
2656
|
* @example
|
2531
2657
|
* ```ts
|
2532
2658
|
* const repos = await repo.get_repos_list({ username: 'username' })
|
2533
|
-
*
|
2659
|
+
* -> 用户仓库信息对象列表
|
2534
2660
|
* ```
|
2535
2661
|
*/
|
2536
2662
|
get_user_repos_list_by_token(options?: UserByTokenRepoListParamType): Promise<ApiResponseType<UserRepoListType>>;
|
@@ -2547,6 +2673,11 @@ declare class Repo extends GitHubClient {
|
|
2547
2673
|
* - per_page - 每页数量(1-100), 默认值:30
|
2548
2674
|
* - page - 页码 默认值:1
|
2549
2675
|
* @returns 用户仓库列表
|
2676
|
+
* @example
|
2677
|
+
* ```ts
|
2678
|
+
* const repos = await github.get_user_repos_list({ username: 'loli' })
|
2679
|
+
* -> 用户仓库信息对象列表
|
2680
|
+
* ```
|
2550
2681
|
*/
|
2551
2682
|
get_user_repos_list(options: UserRepoListParamType): Promise<ApiResponseType<UserRepoListType>>;
|
2552
2683
|
/**
|
@@ -2559,7 +2690,7 @@ declare class Repo extends GitHubClient {
|
|
2559
2690
|
* @example
|
2560
2691
|
* ```ts
|
2561
2692
|
* const repo = await repo.get_repo_info({ owner: 'owner', repo: 'repo' })
|
2562
|
-
*
|
2693
|
+
* -> 仓库信息对象
|
2563
2694
|
* ```
|
2564
2695
|
*/
|
2565
2696
|
get_repo_info(options: RepoInfoParamType): Promise<ApiResponseType<RepoInfoResponseType>>;
|
@@ -2573,7 +2704,7 @@ declare class Repo extends GitHubClient {
|
|
2573
2704
|
* @example
|
2574
2705
|
* ```ts
|
2575
2706
|
* const repo = await repo.get_repo_languages_list({ owner: 'owner', repo: 'repo' })
|
2576
|
-
*
|
2707
|
+
* -> 仓库语言对象列表
|
2577
2708
|
* ```
|
2578
2709
|
*/
|
2579
2710
|
get_repo_languages_list(options: RepoLanguagesListParamType): Promise<ApiResponseType<RepoLanguagesListResponseType>>;
|
@@ -2591,6 +2722,11 @@ declare class Repo extends GitHubClient {
|
|
2591
2722
|
* - has_wiki: 是否启用wiki功能, 默认值:true
|
2592
2723
|
* - auto_init: 是否自动初始化仓库 默认值:false
|
2593
2724
|
* @returns 返回创建成功的仓库信息
|
2725
|
+
* @example
|
2726
|
+
* ```ts
|
2727
|
+
* const repoInfo = await org.create_org_repo({org: 'loli', repo: 'git-neko-kit'})
|
2728
|
+
* -> 创建组织仓库信息对象
|
2729
|
+
* ```
|
2594
2730
|
*/
|
2595
2731
|
create_org_repo(options: OrgRepoCreateParamType): Promise<ApiResponseType<OrgRepoCreateResponseType>>;
|
2596
2732
|
/**
|
@@ -2607,6 +2743,11 @@ declare class Repo extends GitHubClient {
|
|
2607
2743
|
* - has_wiki: 是否启用wiki功能, 默认值:true
|
2608
2744
|
* - auto_init: 是否自动初始化仓库 默认值:false
|
2609
2745
|
* @returns 返回创建成功的仓库信息
|
2746
|
+
* @example
|
2747
|
+
* ```ts
|
2748
|
+
* const repoInfo = await repo.create_user_repo({org: 'loli', repo: 'git-neko-kit'})
|
2749
|
+
* -> 创建用户仓库信息对象
|
2750
|
+
* ```
|
2610
2751
|
*/
|
2611
2752
|
create_user_repo(options: UserRepoCreateParamType): Promise<ApiResponseType<UserRepoCreateResponseType>>;
|
2612
2753
|
/**
|
@@ -2643,7 +2784,7 @@ declare class Repo extends GitHubClient {
|
|
2643
2784
|
* @example
|
2644
2785
|
* ```ts
|
2645
2786
|
* const result = await collaborator.get_collaborators_list(options)
|
2646
|
-
*
|
2787
|
+
* -> 仓库协作者信息对象列表
|
2647
2788
|
* ```
|
2648
2789
|
*/
|
2649
2790
|
get_collaborators_list(options: GetCollaboratorListParamType): Promise<ApiResponseType<GetCollaboratorListResponseType>>;
|
@@ -2667,7 +2808,7 @@ declare class Repo extends GitHubClient {
|
|
2667
2808
|
* username: 'username',
|
2668
2809
|
* permission: 'pull'
|
2669
2810
|
* })
|
2670
|
-
*
|
2811
|
+
* -> 邀请仓库协作者信息对象
|
2671
2812
|
* ```
|
2672
2813
|
*/
|
2673
2814
|
add_collaborator(options: CollaboratorParamType): Promise<ApiResponseType<AddCollaboratorResponseType>>;
|
@@ -2678,8 +2819,6 @@ declare class Repo extends GitHubClient {
|
|
2678
2819
|
* @param options 删除协作者对象
|
2679
2820
|
* - owner: 仓库拥有者
|
2680
2821
|
* - repo: 仓库名称
|
2681
|
-
* - url: 仓库地址
|
2682
|
-
* owner和repo或者url选择一个即可
|
2683
2822
|
* - username: 要删除协作者用户名
|
2684
2823
|
* @returns 返回删除协作者结果
|
2685
2824
|
* @example
|
@@ -2689,7 +2828,7 @@ declare class Repo extends GitHubClient {
|
|
2689
2828
|
* repo:'repo',
|
2690
2829
|
* username: 'username'
|
2691
2830
|
* })
|
2692
|
-
*
|
2831
|
+
* -> 移除仓库协作者信息对象
|
2693
2832
|
* ```
|
2694
2833
|
*/
|
2695
2834
|
remove_collaborator(options: RemoveCollaboratorParamType): Promise<ApiResponseType<RemoveCollaboratorResponseType>>;
|
@@ -2698,15 +2837,6 @@ declare class Repo extends GitHubClient {
|
|
2698
2837
|
* @deprecated 请使用remove_collaborator方法
|
2699
2838
|
* @param options 删除协作者对象
|
2700
2839
|
* @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
2840
|
*/
|
2711
2841
|
delete_collaborator(options: RemoveCollaboratorParamType): Promise<ApiResponseType<RemoveCollaboratorResponseType>>;
|
2712
2842
|
/**
|
@@ -2722,8 +2852,12 @@ declare class Repo extends GitHubClient {
|
|
2722
2852
|
* @returns 仓库可见性,
|
2723
2853
|
* @example
|
2724
2854
|
* ```ts
|
2855
|
+
* // 公开仓库
|
2725
2856
|
* const visibility = await repo.get_repo_visibility({url: 'https://github.com/CandriaJS/git-neko-kit'})
|
2726
|
-
*
|
2857
|
+
* -> 'public'
|
2858
|
+
* // 私有仓库
|
2859
|
+
* const visibility = await repo.get_repo_visibility({url: 'https://github.com/CandriaJS/git-neko-kit'})
|
2860
|
+
* -> 'private'
|
2727
2861
|
* ```
|
2728
2862
|
*/
|
2729
2863
|
get_repo_visibility(options: GetRepoVisibilityParamType): Promise<GetRepoVisibilityResponseType>;
|
@@ -2737,7 +2871,7 @@ declare class Repo extends GitHubClient {
|
|
2737
2871
|
* @example
|
2738
2872
|
* ```ts
|
2739
2873
|
* const defaultBranch = await repo.get_repo_default_branch({owner: CandriaJS, repo: meme-plugin)}
|
2740
|
-
*
|
2874
|
+
* -> 'main'
|
2741
2875
|
* ```ts
|
2742
2876
|
*/
|
2743
2877
|
get_repo_default_branch(options: GetRepoDefaultBranchParamType): Promise<GetRepoDefaultBranchResponseType | null>;
|
@@ -2753,7 +2887,7 @@ declare class Repo extends GitHubClient {
|
|
2753
2887
|
* @example
|
2754
2888
|
* ```ts
|
2755
2889
|
* const language = await repo.get_repo_language({url: 'URL_ADDRESS.com/CandriaJS/meme-plugin')}
|
2756
|
-
*
|
2890
|
+
* -> 'JavaScript'
|
2757
2891
|
* ```ts
|
2758
2892
|
*/
|
2759
2893
|
get_repo_main_language(options: GetRepoMainLanguageParamType): Promise<GetRepoMainLanguageResponseType>;
|
@@ -2777,7 +2911,7 @@ declare class User extends GitHubClient {
|
|
2777
2911
|
* @example
|
2778
2912
|
* ```ts
|
2779
2913
|
* const userInfo = await user.get_user_info({ username: 'username' })
|
2780
|
-
*
|
2914
|
+
* -> 用户信息对象
|
2781
2915
|
* ```
|
2782
2916
|
*/
|
2783
2917
|
get_user_info(options: UserInfoParamType): Promise<ApiResponseType<UserInfoResponseType>>;
|
@@ -2791,7 +2925,7 @@ declare class User extends GitHubClient {
|
|
2791
2925
|
* @example
|
2792
2926
|
* ```ts
|
2793
2927
|
* const userInfo = await user.get_user_info_by_user_id({ user_id: 123456789 })
|
2794
|
-
*
|
2928
|
+
* -> 用户信息对象
|
2795
2929
|
* ```
|
2796
2930
|
*/
|
2797
2931
|
get_user_info_by_user_id(options: UserInfoByIdParamType): Promise<ApiResponseType<UserInfoResponseType>>;
|
@@ -2801,7 +2935,7 @@ declare class User extends GitHubClient {
|
|
2801
2935
|
* @example
|
2802
2936
|
* ```ts
|
2803
2937
|
* const userInfo = await user.get_user_info_by_token()
|
2804
|
-
*
|
2938
|
+
* -> 用户信息对象
|
2805
2939
|
* ```
|
2806
2940
|
*/
|
2807
2941
|
get_user_info_by_auth(): Promise<ApiResponseType<UserInfoResponseType>>;
|
@@ -2809,10 +2943,6 @@ declare class User extends GitHubClient {
|
|
2809
2943
|
* 通过访问令牌获取用户信息
|
2810
2944
|
* 权限:无需任何权限
|
2811
2945
|
* @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
2946
|
* ```
|
2817
2947
|
*/
|
2818
2948
|
get_user_info_by_token(): Promise<ApiResponseType<UserInfoResponseType>>;
|
@@ -2825,7 +2955,14 @@ declare class User extends GitHubClient {
|
|
2825
2955
|
* @example
|
2826
2956
|
* ```ts
|
2827
2957
|
* const contribution = await user.get_user_contribution({ username: 'username' })
|
2828
|
-
*
|
2958
|
+
* ->
|
2959
|
+
* {
|
2960
|
+
* success: true,
|
2961
|
+
* status: 'ok',
|
2962
|
+
* statusCode: 200,
|
2963
|
+
* msg: '请求成功',
|
2964
|
+
* data: { total: 5, contributions: [[{ date: '2023-04-16', count: 5 }]] }
|
2965
|
+
* }
|
2829
2966
|
* ```
|
2830
2967
|
*/
|
2831
2968
|
get_user_contribution(options: UserNameParamType): Promise<ApiResponseType<ContributionResult>>;
|
@@ -2837,9 +2974,9 @@ declare class User extends GitHubClient {
|
|
2837
2974
|
* @example
|
2838
2975
|
* ```ts
|
2839
2976
|
* const userId = await user.get_user_id()
|
2840
|
-
*
|
2977
|
+
* -> 114514
|
2841
2978
|
*/
|
2842
|
-
get_user_id(): Promise<number
|
2979
|
+
get_user_id(): Promise<number>;
|
2843
2980
|
/**
|
2844
2981
|
* 快速获取获取用户名
|
2845
2982
|
* 权限:无需任何权限
|
@@ -2848,20 +2985,19 @@ declare class User extends GitHubClient {
|
|
2848
2985
|
* @example
|
2849
2986
|
* ```ts
|
2850
2987
|
* const username = await user.get_username()
|
2851
|
-
*
|
2988
|
+
* -> 'loli'
|
2852
2989
|
* ```
|
2853
2990
|
*/
|
2854
|
-
get_username(): Promise<string
|
2991
|
+
get_username(): Promise<string>;
|
2855
2992
|
/**
|
2856
2993
|
* 快速获取获取用户昵称
|
2857
2994
|
* 该方法会自动获取当前用户的昵称,需要传入token
|
2858
2995
|
* 权限:无需任何权限
|
2859
|
-
* @remarks 用户昵称可能会为null
|
2860
2996
|
* @returns 昵称
|
2861
2997
|
* @example
|
2862
2998
|
* ```ts
|
2863
2999
|
* const nickname = await user.get_nickname()
|
2864
|
-
*
|
3000
|
+
* -> 'loli'
|
2865
3001
|
* ```
|
2866
3002
|
*/
|
2867
3003
|
get_nickname(): Promise<string | null>;
|
@@ -2873,7 +3009,7 @@ declare class User extends GitHubClient {
|
|
2873
3009
|
* @example
|
2874
3010
|
* ```ts
|
2875
3011
|
* const email = await user.get_email()
|
2876
|
-
*
|
3012
|
+
* -> '114514@gmail.com'
|
2877
3013
|
* ```
|
2878
3014
|
*/
|
2879
3015
|
get_user_email(): Promise<string | null>;
|
@@ -2885,7 +3021,7 @@ declare class User extends GitHubClient {
|
|
2885
3021
|
* @example
|
2886
3022
|
* ```ts
|
2887
3023
|
* const avatarUrl = await user.get_avatar_url()
|
2888
|
-
*
|
3024
|
+
* -> 'https://avatars.githubusercontent.com/u/12345678?v=4'
|
2889
3025
|
* ```
|
2890
3026
|
*/
|
2891
3027
|
get_avatar_url(): Promise<string>;
|
@@ -2903,7 +3039,6 @@ declare class WebHook extends GitHubClient {
|
|
2903
3039
|
* 检查WebHook签名是否正确
|
2904
3040
|
* 权限:无需任何权限
|
2905
3041
|
* @param options - WebHook参数对象,必须包含以下参数:
|
2906
|
-
* - secret: WebHook的密钥, 可以从Base类入口传递
|
2907
3042
|
* - payload: 要验证的签名主体
|
2908
3043
|
* - signature: 要验证的签名
|
2909
3044
|
* @returns 验证结果
|
@@ -2914,6 +3049,16 @@ declare class WebHook extends GitHubClient {
|
|
2914
3049
|
* payload: 'your_payload',
|
2915
3050
|
* signature: 'your_signature'
|
2916
3051
|
* })
|
3052
|
+
* ->
|
3053
|
+
* {
|
3054
|
+
* success: true,
|
3055
|
+
* status: 'ok',
|
3056
|
+
* msg: '请求成功'
|
3057
|
+
* data: {
|
3058
|
+
* success: true,
|
3059
|
+
* info: '验证成功'
|
3060
|
+
* }
|
3061
|
+
* }
|
2917
3062
|
* ```
|
2918
3063
|
*/
|
2919
3064
|
check_webhook_signature(options: WebHookSignatureParamType): Promise<ApiResponseType<WebHookSignatureResponseType>>;
|
@@ -3081,6 +3226,11 @@ declare class GitHubClient {
|
|
3081
3226
|
* @param options.APP_ID GitHub App ID
|
3082
3227
|
* @param options.Private_Key 私钥内容
|
3083
3228
|
* @returns 返回生成的 JWT
|
3229
|
+
* @example
|
3230
|
+
* ```ts
|
3231
|
+
* const jwt = await client.generate_jwt()
|
3232
|
+
* -> 'eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE2MjYxNjEyMjAsImlhdCI6MTYyNjE2MTIyMCwiaXNzIjoiMTIzNDU2Nzg5In0.XxXxXxXxXx
|
3233
|
+
* ```
|
3084
3234
|
*/
|
3085
3235
|
private generate_jwt;
|
3086
3236
|
/**
|
@@ -3155,9 +3305,15 @@ declare class App extends GitHubClient {
|
|
3155
3305
|
/**
|
3156
3306
|
* 获取应用基本信息
|
3157
3307
|
* 权限:
|
3158
|
-
* - `none`
|
3308
|
+
* - `none` 无
|
3159
3309
|
* @param options - 应用标识符
|
3160
3310
|
* @returns 应用基本信息
|
3311
|
+
* @example
|
3312
|
+
* ```ts
|
3313
|
+
* const app = base.get_app()
|
3314
|
+
* console.log(app.get_app_info({ app_slug: 'loli' }))
|
3315
|
+
* -> app的信息
|
3316
|
+
* ```
|
3161
3317
|
*/
|
3162
3318
|
get_app_info(options: AppInfoParamType): Promise<ApiResponseType<AppInfoResponseType>>;
|
3163
3319
|
/**
|
@@ -3168,10 +3324,11 @@ declare class App extends GitHubClient {
|
|
3168
3324
|
* @example
|
3169
3325
|
* ```ts
|
3170
3326
|
* const app = base.get_app()
|
3171
|
-
* console.log(app.get_app_info_by_auth())
|
3327
|
+
* console.log(app.get_app_info_by_auth())
|
3328
|
+
* -> app的信息
|
3172
3329
|
* ```
|
3173
3330
|
*/
|
3174
|
-
|
3331
|
+
get_app_info_by_auth(): Promise<ApiResponseType<AppInfoResponseType>>;
|
3175
3332
|
/**
|
3176
3333
|
* 获取仓库的应用安装信息
|
3177
3334
|
* 权限:
|
@@ -3179,22 +3336,66 @@ declare class App extends GitHubClient {
|
|
3179
3336
|
* @param options - 仓库安装应用参数对象
|
3180
3337
|
* - owner 拥有者
|
3181
3338
|
* - repo 仓库名
|
3182
|
-
* - url 仓库地址
|
3183
|
-
* ownwe和repo与url只能二选一
|
3184
3339
|
* @returns 返回应用安装信息
|
3185
3340
|
* @example
|
3186
3341
|
* ```ts
|
3187
|
-
*
|
3188
|
-
*
|
3342
|
+
* console.log(app.get_app_installation_by_repo({owner: 'owner', repo: 'repo'}))
|
3343
|
+
* -> 仓库安装应用信息
|
3344
|
+
* ```
|
3345
|
+
*/
|
3346
|
+
get_app_installation_by_repo(options: GetAppInfoByRepoParamType): Promise<ApiResponseType<GetAppInfoByRepoResponseType>>;
|
3347
|
+
/**
|
3348
|
+
* 获取用户的应用安装信息
|
3349
|
+
* 权限:
|
3350
|
+
* - `none` 此节点仅App Client可用
|
3351
|
+
* @param options - 仓库安装应用参数对象
|
3352
|
+
* - owner 拥有者
|
3353
|
+
* - repo 仓库名
|
3354
|
+
* @returns 返回应用安装信息
|
3355
|
+
* @example
|
3356
|
+
* ```ts
|
3357
|
+
* console.log(app.get_app_installation_by_repo({owner: 'owner', repo: 'repo'}))
|
3358
|
+
* -> 用户安装应用信息
|
3359
|
+
* ```
|
3360
|
+
*/
|
3361
|
+
get_app_installation_by_user(options: GetAppInfoByUserParamType): Promise<ApiResponseType<GetAppInfoByUserResponseType>>;
|
3362
|
+
/**
|
3363
|
+
* 获取组织的应用安装信息
|
3364
|
+
* 权限:
|
3365
|
+
* - `none` 此节点仅App Client可用
|
3366
|
+
* @param options - 仓库安装应用参数对象
|
3367
|
+
* - owner 拥有者
|
3368
|
+
* - repo 仓库名
|
3369
|
+
* @returns 返回应用安装信息
|
3370
|
+
* @example
|
3371
|
+
* ```ts
|
3372
|
+
* console.log(app.get_app_installation_by_repo({owner: 'owner', repo: 'repo'}))
|
3373
|
+
* -> 组织安装应用信息
|
3374
|
+
* ```
|
3375
|
+
*/
|
3376
|
+
get_app_installation_by_org(options: GetAppInfoByOrgParamType): Promise<ApiResponseType<GetAppInfoByOrgResponseType>>;
|
3377
|
+
/**
|
3378
|
+
* 为应用程序创建访问令牌
|
3379
|
+
* @param options
|
3380
|
+
* - installation_id - 安装 ID
|
3381
|
+
* @returns 创建访问令牌对象
|
3382
|
+
* @example
|
3383
|
+
* ```ts
|
3384
|
+
* const accessToken = await app.create_access_token_for_app({ installation_id: 123456 })
|
3385
|
+
* -> 创建访问令牌对象
|
3189
3386
|
* ```
|
3190
3387
|
*/
|
3191
|
-
|
3388
|
+
create_access_token_for_app(options: CreateAccessTokenForAppParamType): Promise<ApiResponseType<CreateAccessTokenForAppResponseType>>;
|
3389
|
+
revoke_access_token_for_app(): Promise<ApiResponseType<RevokeAccessTokenResponseType>>;
|
3192
3390
|
/**
|
3193
3391
|
* 生成Github App 安装链接
|
3194
3392
|
* @param state_id - 随机生成的 state_id,用于验证授权请求的状态,可选,默认不使用
|
3195
|
-
* @returns 返回安装链接对象
|
3196
|
-
* @returns state_id 随机生成的字符串,用于验证
|
3197
3393
|
* @returns install_link 安装链接,用于跳转 Github 安装页
|
3394
|
+
* @example
|
3395
|
+
* ```ts
|
3396
|
+
* const link = await app.create_install_link('state_id')
|
3397
|
+
* -> https://github.com/apps/<app_name>/installations/new?state=<state_id>
|
3398
|
+
* ```
|
3198
3399
|
*/
|
3199
3400
|
create_install_link(state_id?: string): Promise<string>;
|
3200
3401
|
/**
|
@@ -3205,7 +3406,7 @@ declare class App extends GitHubClient {
|
|
3205
3406
|
* @example
|
3206
3407
|
* ```ts
|
3207
3408
|
* const link = await app.create_config_install_link('state_id')
|
3208
|
-
*
|
3409
|
+
* -> // https://github.com/apps/<app_name>/installations/new?state=<state_id></state_id>
|
3209
3410
|
* ```
|
3210
3411
|
*/
|
3211
3412
|
create_config_install_link(state_id?: string): Promise<string>;
|
@@ -3214,8 +3415,8 @@ declare class App extends GitHubClient {
|
|
3214
3415
|
* @returns 返回 Github App 名称
|
3215
3416
|
* @example
|
3216
3417
|
* ```ts
|
3217
|
-
*
|
3218
|
-
*
|
3418
|
+
* console.log(app.get_app_name())
|
3419
|
+
* -> 输出AppName
|
3219
3420
|
* ```
|
3220
3421
|
*/
|
3221
3422
|
get_app_name(): Promise<string>;
|
@@ -3227,9 +3428,12 @@ declare class App extends GitHubClient {
|
|
3227
3428
|
* @returns 是否安装
|
3228
3429
|
* @example
|
3229
3430
|
* ```ts
|
3431
|
+
* // 当前App已安装在此仓库
|
3432
|
+
* const isInstalled = await app.is_app_inttalled_in_repo({ owner: 'owner', repo: 'repo' })
|
3433
|
+
* -> true
|
3434
|
+
* // 当前App未安装此仓库
|
3230
3435
|
* const isInstalled = await app.is_app_inttalled_in_repo({ owner: 'owner', repo: 'repo' })
|
3231
|
-
*
|
3232
|
-
* ·
|
3436
|
+
* -> false
|
3233
3437
|
*/
|
3234
3438
|
is_app_installed_in_repo(options: RepoBaseParamType): Promise<boolean>;
|
3235
3439
|
}
|
@@ -3264,4 +3468,4 @@ declare class Client {
|
|
3264
3468
|
constructor(options: ClientType);
|
3265
3469
|
}
|
3266
3470
|
|
3267
|
-
export { type AccessCodeType, type AccessTokenClentTYpe, type AccessTokenType, type AddCollaboratorResponseType, type AddMemberParamType, type AddMemberResponseType, type
|
3471
|
+
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 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 RevokeAccessTokenResponseType, 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 };
|