@oh-gc/cli 0.6.1 → 0.7.2
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/README.md +139 -89
- package/dist/api/issues.d.ts +43 -0
- package/dist/api/issues.js +33 -0
- package/dist/api/issues.js.map +1 -1
- package/dist/api/prs.d.ts +52 -0
- package/dist/api/prs.js +63 -0
- package/dist/api/prs.js.map +1 -1
- package/dist/api/repos.d.ts +186 -0
- package/dist/api/repos.js +155 -0
- package/dist/api/repos.js.map +1 -1
- package/dist/api/tags.d.ts +25 -0
- package/dist/api/tags.js +34 -0
- package/dist/api/tags.js.map +1 -1
- package/dist/commands/branch/create.d.ts +14 -0
- package/dist/commands/branch/create.js +48 -0
- package/dist/commands/branch/create.js.map +1 -0
- package/dist/commands/branch/delete.d.ts +13 -0
- package/dist/commands/branch/delete.js +42 -0
- package/dist/commands/branch/delete.js.map +1 -0
- package/dist/commands/branch/protect-rule-create.d.ts +15 -0
- package/dist/commands/branch/protect-rule-create.js +53 -0
- package/dist/commands/branch/protect-rule-create.js.map +1 -0
- package/dist/commands/branch/protect-rule-delete.d.ts +13 -0
- package/dist/commands/branch/protect-rule-delete.js +42 -0
- package/dist/commands/branch/protect-rule-delete.js.map +1 -0
- package/dist/commands/branch/protect-rule-update.d.ts +15 -0
- package/dist/commands/branch/protect-rule-update.js +57 -0
- package/dist/commands/branch/protect-rule-update.js.map +1 -0
- package/dist/commands/branch/protect-rules.d.ts +12 -0
- package/dist/commands/branch/protect-rules.js +53 -0
- package/dist/commands/branch/protect-rules.js.map +1 -0
- package/dist/commands/commit/comment.d.ts +14 -0
- package/dist/commands/commit/comment.js +48 -0
- package/dist/commands/commit/comment.js.map +1 -0
- package/dist/commands/commit/comments.d.ts +15 -0
- package/dist/commands/commit/comments.js +57 -0
- package/dist/commands/commit/comments.js.map +1 -0
- package/dist/commands/file/create.d.ts +18 -0
- package/dist/commands/file/create.js +64 -0
- package/dist/commands/file/create.js.map +1 -0
- package/dist/commands/file/delete.d.ts +16 -0
- package/dist/commands/file/delete.js +56 -0
- package/dist/commands/file/delete.js.map +1 -0
- package/dist/commands/file/update.d.ts +19 -0
- package/dist/commands/file/update.js +69 -0
- package/dist/commands/file/update.js.map +1 -0
- package/dist/commands/issue/branches.d.ts +14 -0
- package/dist/commands/issue/branches.js +69 -0
- package/dist/commands/issue/branches.js.map +1 -0
- package/dist/commands/issue/close.js +1 -1
- package/dist/commands/issue/comment-delete.d.ts +16 -0
- package/dist/commands/issue/comment-delete.js +42 -0
- package/dist/commands/issue/comment-delete.js.map +1 -0
- package/dist/commands/issue/comment-edit.d.ts +17 -0
- package/dist/commands/issue/comment-edit.js +48 -0
- package/dist/commands/issue/comment-edit.js.map +1 -0
- package/dist/commands/issue/comment-get.d.ts +16 -0
- package/dist/commands/issue/comment-get.js +50 -0
- package/dist/commands/issue/comment-get.js.map +1 -0
- package/dist/commands/issue/comment-history.d.ts +16 -0
- package/dist/commands/issue/comment-history.js +51 -0
- package/dist/commands/issue/comment-history.js.map +1 -0
- package/dist/commands/issue/comment-reactions.d.ts +19 -0
- package/dist/commands/issue/comment-reactions.js +58 -0
- package/dist/commands/issue/comment-reactions.js.map +1 -0
- package/dist/commands/issue/history.js +1 -1
- package/dist/commands/issue/labels.js +1 -1
- package/dist/commands/issue/prs.d.ts +14 -0
- package/dist/commands/issue/prs.js +56 -0
- package/dist/commands/issue/prs.js.map +1 -0
- package/dist/commands/issue/reactions.js +1 -1
- package/dist/commands/issue/reopen.js +1 -1
- package/dist/commands/issue/update.js +1 -1
- package/dist/commands/pr/assignees.d.ts +20 -0
- package/dist/commands/pr/assignees.js +76 -0
- package/dist/commands/pr/assignees.js.map +1 -0
- package/dist/commands/pr/close.js +1 -1
- package/dist/commands/pr/comment-delete.d.ts +16 -0
- package/dist/commands/pr/comment-delete.js +42 -0
- package/dist/commands/pr/comment-delete.js.map +1 -0
- package/dist/commands/pr/comment-edit.d.ts +17 -0
- package/dist/commands/pr/comment-edit.js +48 -0
- package/dist/commands/pr/comment-edit.js.map +1 -0
- package/dist/commands/pr/comment-get.d.ts +16 -0
- package/dist/commands/pr/comment-get.js +49 -0
- package/dist/commands/pr/comment-get.js.map +1 -0
- package/dist/commands/pr/comment-history.d.ts +16 -0
- package/dist/commands/pr/comment-history.js +51 -0
- package/dist/commands/pr/comment-history.js.map +1 -0
- package/dist/commands/pr/comment-reactions.d.ts +19 -0
- package/dist/commands/pr/comment-reactions.js +58 -0
- package/dist/commands/pr/comment-reactions.js.map +1 -0
- package/dist/commands/pr/comment.js +1 -1
- package/dist/commands/pr/files.d.ts +16 -0
- package/dist/commands/pr/files.js +52 -0
- package/dist/commands/pr/files.js.map +1 -0
- package/dist/commands/pr/history.d.ts +16 -0
- package/dist/commands/pr/history.js +51 -0
- package/dist/commands/pr/history.js.map +1 -0
- package/dist/commands/pr/labels.d.ts +1 -0
- package/dist/commands/pr/labels.js +18 -0
- package/dist/commands/pr/labels.js.map +1 -1
- package/dist/commands/pr/linked-issues.d.ts +18 -0
- package/dist/commands/pr/linked-issues.js +56 -0
- package/dist/commands/pr/linked-issues.js.map +1 -0
- package/dist/commands/pr/option-reviewers.d.ts +16 -0
- package/dist/commands/pr/option-reviewers.js +50 -0
- package/dist/commands/pr/option-reviewers.js.map +1 -0
- package/dist/commands/pr/reactions.js +1 -1
- package/dist/commands/pr/reopen.js +1 -1
- package/dist/commands/pr/settings-update.d.ts +18 -0
- package/dist/commands/pr/settings-update.js +74 -0
- package/dist/commands/pr/settings-update.js.map +1 -0
- package/dist/commands/pr/settings.d.ts +10 -0
- package/dist/commands/pr/settings.js +45 -0
- package/dist/commands/pr/settings.js.map +1 -0
- package/dist/commands/repo/archive.d.ts +12 -0
- package/dist/commands/repo/archive.js +46 -0
- package/dist/commands/repo/archive.js.map +1 -0
- package/dist/commands/repo/contributors.d.ts +15 -0
- package/dist/commands/repo/contributors.js +91 -0
- package/dist/commands/repo/contributors.js.map +1 -0
- package/dist/commands/repo/create.d.ts +24 -0
- package/dist/commands/repo/create.js +74 -0
- package/dist/commands/repo/create.js.map +1 -0
- package/dist/commands/repo/delete.d.ts +11 -0
- package/dist/commands/repo/delete.js +46 -0
- package/dist/commands/repo/delete.js.map +1 -0
- package/dist/commands/repo/events.d.ts +16 -0
- package/dist/commands/repo/events.js +72 -0
- package/dist/commands/repo/events.js.map +1 -0
- package/dist/commands/repo/fork.d.ts +13 -0
- package/dist/commands/repo/fork.js +56 -0
- package/dist/commands/repo/fork.js.map +1 -0
- package/dist/commands/repo/forks.d.ts +13 -0
- package/dist/commands/repo/forks.js +66 -0
- package/dist/commands/repo/forks.js.map +1 -0
- package/dist/commands/repo/languages.d.ts +10 -0
- package/dist/commands/repo/languages.js +56 -0
- package/dist/commands/repo/languages.js.map +1 -0
- package/dist/commands/repo/list.d.ts +18 -0
- package/dist/commands/repo/list.js +89 -0
- package/dist/commands/repo/list.js.map +1 -0
- package/dist/commands/repo/module.d.ts +17 -0
- package/dist/commands/repo/module.js +69 -0
- package/dist/commands/repo/module.js.map +1 -0
- package/dist/commands/repo/roles.d.ts +10 -0
- package/dist/commands/repo/roles.js +53 -0
- package/dist/commands/repo/roles.js.map +1 -0
- package/dist/commands/repo/settings.d.ts +17 -0
- package/dist/commands/repo/settings.js +82 -0
- package/dist/commands/repo/settings.js.map +1 -0
- package/dist/commands/repo/stats.d.ts +16 -0
- package/dist/commands/repo/stats.js +92 -0
- package/dist/commands/repo/stats.js.map +1 -0
- package/dist/commands/repo/transition.d.ts +11 -0
- package/dist/commands/repo/transition.js +67 -0
- package/dist/commands/repo/transition.js.map +1 -0
- package/dist/commands/tag/create.d.ts +15 -0
- package/dist/commands/tag/create.js +58 -0
- package/dist/commands/tag/create.js.map +1 -0
- package/dist/commands/tag/delete.d.ts +13 -0
- package/dist/commands/tag/delete.js +42 -0
- package/dist/commands/tag/delete.js.map +1 -0
- package/dist/commands/tag/protect-create.d.ts +14 -0
- package/dist/commands/tag/protect-create.js +57 -0
- package/dist/commands/tag/protect-create.js.map +1 -0
- package/dist/commands/tag/protect-delete.d.ts +13 -0
- package/dist/commands/tag/protect-delete.js +42 -0
- package/dist/commands/tag/protect-delete.js.map +1 -0
- package/dist/commands/tag/protect-get.d.ts +13 -0
- package/dist/commands/tag/protect-get.js +48 -0
- package/dist/commands/tag/protect-get.js.map +1 -0
- package/dist/commands/tag/protect-update.d.ts +14 -0
- package/dist/commands/tag/protect-update.js +54 -0
- package/dist/commands/tag/protect-update.js.map +1 -0
- package/dist/commands/user/emails.js +1 -1
- package/dist/commands/user/followers.js +1 -1
- package/dist/commands/user/following.js +1 -1
- package/dist/commands/user/view.js +1 -1
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
A command-line interface for [GitCode](https://gitcode.com), modeled after GitHub CLI (`gh`). Manage issues, pull requests, and authentication without leaving the terminal.
|
|
4
4
|
|
|
5
5
|
```
|
|
6
|
-
oh-gc issue
|
|
7
|
-
oh-gc issue
|
|
8
|
-
oh-gc pr
|
|
9
|
-
oh-gc pr
|
|
6
|
+
oh-gc issue list
|
|
7
|
+
oh-gc issue view 12
|
|
8
|
+
oh-gc pr create --title "Fix login bug" --base main
|
|
9
|
+
oh-gc pr merge 5 --method squash
|
|
10
10
|
```
|
|
11
11
|
|
|
12
12
|
---
|
|
@@ -37,7 +37,7 @@ npm link
|
|
|
37
37
|
**1. Log in with your GitCode personal access token:**
|
|
38
38
|
|
|
39
39
|
```bash
|
|
40
|
-
oh-gc auth
|
|
40
|
+
oh-gc auth login
|
|
41
41
|
# Enter your GitCode personal access token: ••••••••••
|
|
42
42
|
# Logged in as yourname (Your Name)
|
|
43
43
|
```
|
|
@@ -48,13 +48,13 @@ Get a token at: **GitCode → Settings → Access Tokens**
|
|
|
48
48
|
|
|
49
49
|
```bash
|
|
50
50
|
cd your-project # must be a git repo with a gitcode.com remote
|
|
51
|
-
oh-gc issue
|
|
51
|
+
oh-gc issue list
|
|
52
52
|
```
|
|
53
53
|
|
|
54
54
|
If your remote is not named `origin`, configure it:
|
|
55
55
|
|
|
56
56
|
```bash
|
|
57
|
-
oh-gc repo
|
|
57
|
+
oh-gc repo set-remote upstream
|
|
58
58
|
```
|
|
59
59
|
|
|
60
60
|
---
|
|
@@ -65,143 +65,193 @@ oh-gc repo:set-remote upstream
|
|
|
65
65
|
|
|
66
66
|
| Command | Description | Docs |
|
|
67
67
|
|---------|-------------|------|
|
|
68
|
-
| `oh-gc auth
|
|
69
|
-
| `oh-gc auth
|
|
70
|
-
| `oh-gc auth
|
|
68
|
+
| `oh-gc auth login` | Log in with a personal access token | [→ Details](docs/commands/en/auth.md#oh-gc-auth-login) |
|
|
69
|
+
| `oh-gc auth logout` | Remove stored token | [→ Details](docs/commands/en/auth.md#oh-gc-auth-logout) |
|
|
70
|
+
| `oh-gc auth status` | Show currently logged-in user | [→ Details](docs/commands/en/auth.md#oh-gc-auth-status) |
|
|
71
71
|
|
|
72
72
|
### Issues
|
|
73
73
|
| Command | Description | Docs |
|
|
74
74
|
|---------|-------------|------|
|
|
75
|
-
| `oh-gc issue
|
|
76
|
-
| `oh-gc issue
|
|
77
|
-
| `oh-gc issue
|
|
78
|
-
| `oh-gc issue
|
|
79
|
-
| `oh-gc issue
|
|
80
|
-
| `oh-gc issue
|
|
81
|
-
| `oh-gc issue
|
|
82
|
-
| `oh-gc issue
|
|
83
|
-
| `oh-gc issue
|
|
84
|
-
| `oh-gc issue
|
|
75
|
+
| `oh-gc issue list` | List issues | [→ Details](docs/commands/en/issue.md#oh-gc-issue-list) |
|
|
76
|
+
| `oh-gc issue view` | View issue details | [→ Details](docs/commands/en/issue.md#oh-gc-issue-view) |
|
|
77
|
+
| `oh-gc issue create` | Create an issue | [→ Details](docs/commands/en/issue.md#oh-gc-issue-create) |
|
|
78
|
+
| `oh-gc issue update` | Update an issue | [→ Details](docs/commands/en/issue.md#oh-gc-issue-update) |
|
|
79
|
+
| `oh-gc issue close` | Close an issue | [→ Details](docs/commands/en/issue.md#oh-gc-issue-close) |
|
|
80
|
+
| `oh-gc issue reopen` | Reopen a closed issue | [→ Details](docs/commands/en/issue.md#oh-gc-issue-reopen) |
|
|
81
|
+
| `oh-gc issue comment` | Add a comment | [→ Details](docs/commands/en/issue.md#oh-gc-issue-comment) |
|
|
82
|
+
| `oh-gc issue history` | View modification history | [→ Details](docs/commands/en/issue.md#oh-gc-issue-history) |
|
|
83
|
+
| `oh-gc issue labels` | Add or remove labels | [→ Details](docs/commands/en/issue.md#oh-gc-issue-labels) |
|
|
84
|
+
| `oh-gc issue reactions` | List reactions | [→ Details](docs/commands/en/issue.md#oh-gc-issue-reactions) |
|
|
85
|
+
| `oh-gc issue prs` | List linked pull requests | [→ Details](docs/commands/en/issue.md#oh-gc-issue-prs) |
|
|
86
|
+
| `oh-gc issue branches` | List or set related branches | [→ Details](docs/commands/en/issue.md#oh-gc-issue-branches) |
|
|
87
|
+
| `oh-gc issue comment-get` | Get a comment | [→ Details](docs/commands/en/issue.md#oh-gc-issue-comment-get) |
|
|
88
|
+
| `oh-gc issue comment-edit` | Edit a comment | [→ Details](docs/commands/en/issue.md#oh-gc-issue-comment-edit) |
|
|
89
|
+
| `oh-gc issue comment-delete` | Delete a comment | [→ Details](docs/commands/en/issue.md#oh-gc-issue-comment-delete) |
|
|
90
|
+
| `oh-gc issue comment-history` | View comment history | [→ Details](docs/commands/en/issue.md#oh-gc-issue-comment-history) |
|
|
91
|
+
| `oh-gc issue comment-reactions` | View comment reactions | [→ Details](docs/commands/en/issue.md#oh-gc-issue-comment-reactions) |
|
|
85
92
|
|
|
86
93
|
### Pull Requests
|
|
87
94
|
| Command | Description | Docs |
|
|
88
95
|
|---------|-------------|------|
|
|
89
|
-
| `oh-gc pr
|
|
90
|
-
| `oh-gc pr
|
|
91
|
-
| `oh-gc pr
|
|
92
|
-
| `oh-gc pr
|
|
93
|
-
| `oh-gc pr
|
|
94
|
-
| `oh-gc pr
|
|
95
|
-
| `oh-gc pr
|
|
96
|
-
| `oh-gc pr
|
|
97
|
-
| `oh-gc pr
|
|
98
|
-
| `oh-gc pr
|
|
99
|
-
| `oh-gc pr
|
|
100
|
-
| `oh-gc pr
|
|
101
|
-
| `oh-gc pr
|
|
102
|
-
| `oh-gc pr
|
|
103
|
-
| `oh-gc pr
|
|
104
|
-
| `oh-gc pr
|
|
105
|
-
| `oh-gc pr
|
|
106
|
-
| `oh-gc pr
|
|
107
|
-
| `oh-gc pr
|
|
96
|
+
| `oh-gc pr list` | List pull requests | [→ Details](docs/commands/en/pr.md#oh-gc-pr-list) |
|
|
97
|
+
| `oh-gc pr view` | View PR details | [→ Details](docs/commands/en/pr.md#oh-gc-pr-view) |
|
|
98
|
+
| `oh-gc pr create` | Create a pull request | [→ Details](docs/commands/en/pr.md#oh-gc-pr-create) |
|
|
99
|
+
| `oh-gc pr update` | Update a pull request | [→ Details](docs/commands/en/pr.md#oh-gc-pr-update) |
|
|
100
|
+
| `oh-gc pr close` | Close a pull request | [→ Details](docs/commands/en/pr.md#oh-gc-pr-close) |
|
|
101
|
+
| `oh-gc pr reopen` | Reopen a closed PR | [→ Details](docs/commands/en/pr.md#oh-gc-pr-reopen) |
|
|
102
|
+
| `oh-gc pr merge` | Merge a pull request | [→ Details](docs/commands/en/pr.md#oh-gc-pr-merge) |
|
|
103
|
+
| `oh-gc pr diff` | View PR changes | [→ Details](docs/commands/en/pr.md#oh-gc-pr-diff) |
|
|
104
|
+
| `oh-gc pr comment` | Add a comment | [→ Details](docs/commands/en/pr.md#oh-gc-pr-comment) |
|
|
105
|
+
| `oh-gc pr comments` | List or delete comments | [→ Details](docs/commands/en/pr.md#oh-gc-pr-comments) |
|
|
106
|
+
| `oh-gc pr commits` | List commits in a PR | [→ Details](docs/commands/en/pr.md#oh-gc-pr-commits) |
|
|
107
|
+
| `oh-gc pr logs` | View operation logs | [→ Details](docs/commands/en/pr.md#oh-gc-pr-logs) |
|
|
108
|
+
| `oh-gc pr reactions` | List reactions | [→ Details](docs/commands/en/pr.md#oh-gc-pr-reactions) |
|
|
109
|
+
| `oh-gc pr reviewers` | Manage reviewers | [→ Details](docs/commands/en/pr.md#oh-gc-pr-reviewers) |
|
|
110
|
+
| `oh-gc pr testers` | Manage testers | [→ Details](docs/commands/en/pr.md#oh-gc-pr-testers) |
|
|
111
|
+
| `oh-gc pr review` | Approve a PR review | [→ Details](docs/commands/en/pr.md#oh-gc-pr-review) |
|
|
112
|
+
| `oh-gc pr test` | Mark test as passed | [→ Details](docs/commands/en/pr.md#oh-gc-pr-test) |
|
|
113
|
+
| `oh-gc pr labels` | Add or remove labels | [→ Details](docs/commands/en/pr.md#oh-gc-pr-labels) |
|
|
114
|
+
| `oh-gc pr link` | Link or unlink issues | [→ Details](docs/commands/en/pr.md#oh-gc-pr-link) |
|
|
115
|
+
| `oh-gc pr files` | List changed files | [→ Details](docs/commands/en/pr.md#oh-gc-pr-files) |
|
|
116
|
+
| `oh-gc pr history` | View modification history | [→ Details](docs/commands/en/pr.md#oh-gc-pr-history) |
|
|
117
|
+
| `oh-gc pr linked-issues` | List linked issues | [→ Details](docs/commands/en/pr.md#oh-gc-pr-linked-issues) |
|
|
118
|
+
| `oh-gc pr assignees` | Manage assignees | [→ Details](docs/commands/en/pr.md#oh-gc-pr-assignees) |
|
|
119
|
+
| `oh-gc pr settings` | View PR settings | [→ Details](docs/commands/en/pr.md#oh-gc-pr-settings) |
|
|
120
|
+
| `oh-gc pr settings-update` | Update PR settings | [→ Details](docs/commands/en/pr.md#oh-gc-pr-settings-update) |
|
|
121
|
+
| `oh-gc pr option-reviewers` | List eligible reviewers | [→ Details](docs/commands/en/pr.md#oh-gc-pr-option-reviewers) |
|
|
122
|
+
| `oh-gc pr comment-get` | Get a PR comment | [→ Details](docs/commands/en/pr.md#oh-gc-pr-comment-get) |
|
|
123
|
+
| `oh-gc pr comment-edit` | Edit a PR comment | [→ Details](docs/commands/en/pr.md#oh-gc-pr-comment-edit) |
|
|
124
|
+
| `oh-gc pr comment-delete` | Delete a PR comment | [→ Details](docs/commands/en/pr.md#oh-gc-pr-comment-delete) |
|
|
125
|
+
| `oh-gc pr comment-history` | View comment history | [→ Details](docs/commands/en/pr.md#oh-gc-pr-comment-history) |
|
|
126
|
+
| `oh-gc pr comment-reactions` | View comment reactions | [→ Details](docs/commands/en/pr.md#oh-gc-pr-comment-reactions) |
|
|
108
127
|
|
|
109
128
|
### Repository
|
|
110
129
|
| Command | Description | Docs |
|
|
111
130
|
|---------|-------------|------|
|
|
112
|
-
| `oh-gc repo
|
|
113
|
-
| `oh-gc repo
|
|
114
|
-
| `oh-gc repo
|
|
115
|
-
| `oh-gc repo
|
|
116
|
-
| `oh-gc repo
|
|
131
|
+
| `oh-gc repo list` | List repositories | [→ Details](docs/commands/en/repo.md#oh-gc-repo-list) |
|
|
132
|
+
| `oh-gc repo create` | Create a new repository | [→ Details](docs/commands/en/repo.md#oh-gc-repo-create) |
|
|
133
|
+
| `oh-gc repo delete` | Delete a repository | [→ Details](docs/commands/en/repo.md#oh-gc-repo-delete) |
|
|
134
|
+
| `oh-gc repo fork` | Fork a repository | [→ Details](docs/commands/en/repo.md#oh-gc-repo-fork) |
|
|
135
|
+
| `oh-gc repo forks` | List repository forks | [→ Details](docs/commands/en/repo.md#oh-gc-repo-forks) |
|
|
136
|
+
| `oh-gc repo settings` | View or update repo settings | [→ Details](docs/commands/en/repo.md#oh-gc-repo-settings) |
|
|
137
|
+
| `oh-gc repo languages` | Show languages used in a repo | [→ Details](docs/commands/en/repo.md#oh-gc-repo-languages) |
|
|
138
|
+
| `oh-gc repo contributors` | List contributors | [→ Details](docs/commands/en/repo.md#oh-gc-repo-contributors) |
|
|
139
|
+
| `oh-gc repo events` | List repository events | [→ Details](docs/commands/en/repo.md#oh-gc-repo-events) |
|
|
140
|
+
| `oh-gc repo stats` | Show commit/download statistics | [→ Details](docs/commands/en/repo.md#oh-gc-repo-stats) |
|
|
141
|
+
| `oh-gc repo archive` | Archive or unarchive a repository | [→ Details](docs/commands/en/repo.md#oh-gc-repo-archive) |
|
|
142
|
+
| `oh-gc repo transition` | View or update permission mode | [→ Details](docs/commands/en/repo.md#oh-gc-repo-transition) |
|
|
143
|
+
| `oh-gc repo module` | Enable or disable repo modules | [→ Details](docs/commands/en/repo.md#oh-gc-repo-module) |
|
|
144
|
+
| `oh-gc repo roles` | List customized roles | [→ Details](docs/commands/en/repo.md#oh-gc-repo-roles) |
|
|
145
|
+
| `oh-gc repo view` | View repository info | [→ Details](docs/commands/en/repo.md#oh-gc-repo-view) |
|
|
146
|
+
| `oh-gc repo update` | Update repository settings | [→ Details](docs/commands/en/repo.md#oh-gc-repo-update) |
|
|
147
|
+
| `oh-gc repo transfer` | Transfer repository ownership | [→ Details](docs/commands/en/repo.md#oh-gc-repo-transfer) |
|
|
148
|
+
| `oh-gc repo set-remote` | Set which remote oh-gc uses | [→ Details](docs/commands/en/repo.md#oh-gc-repo-set-remote) |
|
|
149
|
+
| `oh-gc repo get-remote` | Show current remote | [→ Details](docs/commands/en/repo.md#oh-gc-repo-get-remote) |
|
|
117
150
|
|
|
118
151
|
### Branches
|
|
119
152
|
| Command | Description | Docs |
|
|
120
153
|
|---------|-------------|------|
|
|
121
|
-
| `oh-gc branch
|
|
122
|
-
| `oh-gc branch
|
|
123
|
-
| `oh-gc branch
|
|
154
|
+
| `oh-gc branch list` | List branches | [→ Details](docs/commands/en/branch.md#oh-gc-branch-list) |
|
|
155
|
+
| `oh-gc branch get` | View branch details | [→ Details](docs/commands/en/branch.md#oh-gc-branch-get) |
|
|
156
|
+
| `oh-gc branch create` | Create a branch | [→ Details](docs/commands/en/branch.md#oh-gc-branch-create) |
|
|
157
|
+
| `oh-gc branch delete` | Delete a branch | [→ Details](docs/commands/en/branch.md#oh-gc-branch-delete) |
|
|
158
|
+
| `oh-gc branch protect` | Set branch protection | [→ Details](docs/commands/en/branch.md#oh-gc-branch-protect) |
|
|
159
|
+
| `oh-gc branch protect-rules` | List protection rules | [→ Details](docs/commands/en/branch.md#oh-gc-branch-protect-rules) |
|
|
160
|
+
| `oh-gc branch protect-rule-create` | Create protection rule | [→ Details](docs/commands/en/branch.md#oh-gc-branch-protect-rule-create) |
|
|
161
|
+
| `oh-gc branch protect-rule-update` | Update protection rule | [→ Details](docs/commands/en/branch.md#oh-gc-branch-protect-rule-update) |
|
|
162
|
+
| `oh-gc branch protect-rule-delete` | Delete protection rule | [→ Details](docs/commands/en/branch.md#oh-gc-branch-protect-rule-delete) |
|
|
124
163
|
|
|
125
164
|
### Commits
|
|
126
165
|
| Command | Description | Docs |
|
|
127
166
|
|---------|-------------|------|
|
|
128
|
-
| `oh-gc commit
|
|
129
|
-
| `oh-gc commit
|
|
130
|
-
| `oh-gc commit
|
|
131
|
-
| `oh-gc commit
|
|
167
|
+
| `oh-gc commit list` | List commits | [→ Details](docs/commands/en/commit.md#oh-gc-commit-list) |
|
|
168
|
+
| `oh-gc commit get` | View commit details | [→ Details](docs/commands/en/commit.md#oh-gc-commit-get) |
|
|
169
|
+
| `oh-gc commit diff` | View commit diff | [→ Details](docs/commands/en/commit.md#oh-gc-commit-diff) |
|
|
170
|
+
| `oh-gc commit compare` | Compare two refs | [→ Details](docs/commands/en/commit.md#oh-gc-commit-compare) |
|
|
171
|
+
| `oh-gc commit comments` | List commit comments | [→ Details](docs/commands/en/commit.md#oh-gc-commit-comments) |
|
|
172
|
+
| `oh-gc commit comment` | Create a commit comment | [→ Details](docs/commands/en/commit.md#oh-gc-commit-comment) |
|
|
132
173
|
|
|
133
174
|
### Files
|
|
134
175
|
| Command | Description | Docs |
|
|
135
176
|
|---------|-------------|------|
|
|
136
|
-
| `oh-gc file
|
|
137
|
-
| `oh-gc file
|
|
138
|
-
| `oh-gc file
|
|
177
|
+
| `oh-gc file get` | Get file contents (base64) | [→ Details](docs/commands/en/file.md#oh-gc-file-get) |
|
|
178
|
+
| `oh-gc file raw` | Get raw file contents | [→ Details](docs/commands/en/file.md#oh-gc-file-raw) |
|
|
179
|
+
| `oh-gc file list` | List directory contents | [→ Details](docs/commands/en/file.md#oh-gc-file-list) |
|
|
180
|
+
| `oh-gc file create` | Create a file | [→ Details](docs/commands/en/file.md#oh-gc-file-create) |
|
|
181
|
+
| `oh-gc file update` | Update a file | [→ Details](docs/commands/en/file.md#oh-gc-file-update) |
|
|
182
|
+
| `oh-gc file delete` | Delete a file | [→ Details](docs/commands/en/file.md#oh-gc-file-delete) |
|
|
139
183
|
|
|
140
184
|
### Labels
|
|
141
185
|
| Command | Description | Docs |
|
|
142
186
|
|---------|-------------|------|
|
|
143
|
-
| `oh-gc label
|
|
144
|
-
| `oh-gc label
|
|
145
|
-
| `oh-gc label
|
|
146
|
-
| `oh-gc label
|
|
187
|
+
| `oh-gc label list` | List repository labels | [→ Details](docs/commands/en/label.md#oh-gc-label-list) |
|
|
188
|
+
| `oh-gc label create` | Create a label | [→ Details](docs/commands/en/label.md#oh-gc-label-create) |
|
|
189
|
+
| `oh-gc label update` | Update a label | [→ Details](docs/commands/en/label.md#oh-gc-label-update) |
|
|
190
|
+
| `oh-gc label delete` | Delete a label | [→ Details](docs/commands/en/label.md#oh-gc-label-delete) |
|
|
147
191
|
|
|
148
192
|
### Milestones
|
|
149
193
|
| Command | Description | Docs |
|
|
150
194
|
|---------|-------------|------|
|
|
151
|
-
| `oh-gc milestone
|
|
152
|
-
| `oh-gc milestone
|
|
153
|
-
| `oh-gc milestone
|
|
154
|
-
| `oh-gc milestone
|
|
155
|
-
| `oh-gc milestone
|
|
195
|
+
| `oh-gc milestone list` | List milestones | [→ Details](docs/commands/en/milestone.md#oh-gc-milestone-list) |
|
|
196
|
+
| `oh-gc milestone get` | View milestone details | [→ Details](docs/commands/en/milestone.md#oh-gc-milestone-get) |
|
|
197
|
+
| `oh-gc milestone create` | Create a milestone | [→ Details](docs/commands/en/milestone.md#oh-gc-milestone-create) |
|
|
198
|
+
| `oh-gc milestone update` | Update a milestone | [→ Details](docs/commands/en/milestone.md#oh-gc-milestone-update) |
|
|
199
|
+
| `oh-gc milestone delete` | Delete a milestone | [→ Details](docs/commands/en/milestone.md#oh-gc-milestone-delete) |
|
|
156
200
|
|
|
157
201
|
### Collaborators
|
|
158
202
|
| Command | Description | Docs |
|
|
159
203
|
|---------|-------------|------|
|
|
160
|
-
| `oh-gc collaborator
|
|
161
|
-
| `oh-gc collaborator
|
|
162
|
-
| `oh-gc collaborator
|
|
163
|
-
| `oh-gc collaborator
|
|
204
|
+
| `oh-gc collaborator list` | List collaborators | [→ Details](docs/commands/en/collaborator.md#oh-gc-collaborator-list) |
|
|
205
|
+
| `oh-gc collaborator add` | Add a collaborator | [→ Details](docs/commands/en/collaborator.md#oh-gc-collaborator-add) |
|
|
206
|
+
| `oh-gc collaborator remove` | Remove a collaborator | [→ Details](docs/commands/en/collaborator.md#oh-gc-collaborator-remove) |
|
|
207
|
+
| `oh-gc collaborator permission` | Get permission level | [→ Details](docs/commands/en/collaborator.md#oh-gc-collaborator-permission) |
|
|
164
208
|
|
|
165
209
|
### Webhooks
|
|
166
210
|
| Command | Description | Docs |
|
|
167
211
|
|---------|-------------|------|
|
|
168
|
-
| `oh-gc hook
|
|
169
|
-
| `oh-gc hook
|
|
170
|
-
| `oh-gc hook
|
|
171
|
-
| `oh-gc hook
|
|
212
|
+
| `oh-gc hook list` | List webhooks | [→ Details](docs/commands/en/hook.md#oh-gc-hook-list) |
|
|
213
|
+
| `oh-gc hook get` | View webhook details | [→ Details](docs/commands/en/hook.md#oh-gc-hook-get) |
|
|
214
|
+
| `oh-gc hook create` | Create a webhook | [→ Details](docs/commands/en/hook.md#oh-gc-hook-create) |
|
|
215
|
+
| `oh-gc hook delete` | Delete a webhook | [→ Details](docs/commands/en/hook.md#oh-gc-hook-delete) |
|
|
172
216
|
|
|
173
217
|
### Tags
|
|
174
218
|
| Command | Description | Docs |
|
|
175
219
|
|---------|-------------|------|
|
|
176
|
-
| `oh-gc tag
|
|
177
|
-
| `oh-gc tag
|
|
220
|
+
| `oh-gc tag list` | List repository tags | [→ Details](docs/commands/en/tag.md#oh-gc-tag-list) |
|
|
221
|
+
| `oh-gc tag create` | Create a tag | [→ Details](docs/commands/en/tag.md#oh-gc-tag-create) |
|
|
222
|
+
| `oh-gc tag delete` | Delete a tag | [→ Details](docs/commands/en/tag.md#oh-gc-tag-delete) |
|
|
223
|
+
| `oh-gc tag protect` | Protect or unprotect a tag | [→ Details](docs/commands/en/tag.md#oh-gc-tag-protect) |
|
|
224
|
+
| `oh-gc tag protect-get` | Get protected tag details | [→ Details](docs/commands/en/tag.md#oh-gc-tag-protect-get) |
|
|
225
|
+
| `oh-gc tag protect-create` | Create protected tag rule | [→ Details](docs/commands/en/tag.md#oh-gc-tag-protect-create) |
|
|
226
|
+
| `oh-gc tag protect-update` | Update protected tag rule | [→ Details](docs/commands/en/tag.md#oh-gc-tag-protect-update) |
|
|
227
|
+
| `oh-gc tag protect-delete` | Delete protected tag rule | [→ Details](docs/commands/en/tag.md#oh-gc-tag-protect-delete) |
|
|
178
228
|
|
|
179
229
|
### Release
|
|
180
230
|
| Command | Description | Docs |
|
|
181
231
|
|---------|-------------|------|
|
|
182
|
-
| `oh-gc release
|
|
232
|
+
| `oh-gc release create` | Create a release | [→ Details](docs/commands/en/release.md#oh-gc-release-create) |
|
|
183
233
|
|
|
184
234
|
### Organizations
|
|
185
235
|
| Command | Description | Docs |
|
|
186
236
|
|---------|-------------|------|
|
|
187
|
-
| `oh-gc org
|
|
188
|
-
| `oh-gc org
|
|
189
|
-
| `oh-gc org
|
|
237
|
+
| `oh-gc org list` | List your organizations | [→ Details](docs/commands/en/org.md#oh-gc-org-list) |
|
|
238
|
+
| `oh-gc org view` | View organization details | [→ Details](docs/commands/en/org.md#oh-gc-org-view) |
|
|
239
|
+
| `oh-gc org members` | List organization members | [→ Details](docs/commands/en/org.md#oh-gc-org-members) |
|
|
190
240
|
|
|
191
241
|
### User
|
|
192
242
|
| Command | Description | Docs |
|
|
193
243
|
|---------|-------------|------|
|
|
194
|
-
| `oh-gc user
|
|
195
|
-
| `oh-gc user
|
|
196
|
-
| `oh-gc user
|
|
197
|
-
| `oh-gc user
|
|
244
|
+
| `oh-gc user view` | View user profile | [→ Details](docs/commands/en/user.md#oh-gc-user-view) |
|
|
245
|
+
| `oh-gc user emails` | List your email addresses | [→ Details](docs/commands/en/user.md#oh-gc-user-emails) |
|
|
246
|
+
| `oh-gc user followers` | List user followers | [→ Details](docs/commands/en/user.md#oh-gc-user-followers) |
|
|
247
|
+
| `oh-gc user following` | List followed users | [→ Details](docs/commands/en/user.md#oh-gc-user-following) |
|
|
198
248
|
|
|
199
249
|
### Search
|
|
200
250
|
| Command | Description | Docs |
|
|
201
251
|
|---------|-------------|------|
|
|
202
|
-
| `oh-gc search
|
|
203
|
-
| `oh-gc search
|
|
204
|
-
| `oh-gc search
|
|
252
|
+
| `oh-gc search repos` | Search repositories | [→ Details](docs/commands/en/search.md#oh-gc-search-repos) |
|
|
253
|
+
| `oh-gc search issues` | Search issues and PRs | [→ Details](docs/commands/en/search.md#oh-gc-search-issues) |
|
|
254
|
+
| `oh-gc search code` | Search code | [→ Details](docs/commands/en/search.md#oh-gc-search-code) |
|
|
205
255
|
|
|
206
256
|
---
|
|
207
257
|
|
|
@@ -215,9 +265,9 @@ Most commands that operate on a repository support the `--repo` flag, which allo
|
|
|
215
265
|
|
|
216
266
|
Examples:
|
|
217
267
|
```bash
|
|
218
|
-
oh-gc issue
|
|
219
|
-
oh-gc issue
|
|
220
|
-
oh-gc pr
|
|
268
|
+
oh-gc issue list --repo openharmony/arkui_ace_engine
|
|
269
|
+
oh-gc issue create --repo owner/repo --title "Bug report"
|
|
270
|
+
oh-gc pr view 123 --repo owner/repo
|
|
221
271
|
```
|
|
222
272
|
|
|
223
273
|
## Global Flags
|
|
@@ -235,11 +285,11 @@ All commands support:
|
|
|
235
285
|
|
|
236
286
|
### Token
|
|
237
287
|
|
|
238
|
-
Stored at `~/.config/gitcode-cli/config.json`. Set via `oh-gc auth
|
|
288
|
+
Stored at `~/.config/gitcode-cli/config.json`. Set via `oh-gc auth login`, removed via `oh-gc auth logout`.
|
|
239
289
|
|
|
240
290
|
### Remote
|
|
241
291
|
|
|
242
|
-
By default `oh-gc` uses the `origin` remote. To use a different remote for run `oh-gc repo
|
|
292
|
+
By default `oh-gc` uses the `origin` remote. To use a different remote for run `oh-gc repo set-remote <name>`. This writes a `.gitcode/oh-gc-config.json` file in the repo root:
|
|
243
293
|
|
|
244
294
|
```json
|
|
245
295
|
{ "remote": "upstream" }
|
package/dist/api/issues.d.ts
CHANGED
|
@@ -101,3 +101,46 @@ export declare function listIssueHistory(token: string, owner: string, repo: str
|
|
|
101
101
|
page?: number;
|
|
102
102
|
per_page?: number;
|
|
103
103
|
}): Promise<IssueHistory[]>;
|
|
104
|
+
export interface LinkedPR {
|
|
105
|
+
id: number;
|
|
106
|
+
number: number;
|
|
107
|
+
html_url: string;
|
|
108
|
+
state: string;
|
|
109
|
+
title: string;
|
|
110
|
+
body: string;
|
|
111
|
+
created_at: string;
|
|
112
|
+
updated_at: string;
|
|
113
|
+
head?: {
|
|
114
|
+
ref: string;
|
|
115
|
+
sha: string;
|
|
116
|
+
};
|
|
117
|
+
base?: {
|
|
118
|
+
ref: string;
|
|
119
|
+
sha: string;
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
export declare function listIssueLinkedPRs(token: string, owner: string, repo: string, number: string, params?: {
|
|
123
|
+
mode?: number;
|
|
124
|
+
}): Promise<LinkedPR[]>;
|
|
125
|
+
export declare function listIssueRelatedBranches(token: string, owner: string, repo: string, number: string): Promise<string[]>;
|
|
126
|
+
export declare function setIssueRelatedBranches(token: string, owner: string, repo: string, number: string, branchNames: string[]): Promise<unknown>;
|
|
127
|
+
export interface IssueCommentDetail {
|
|
128
|
+
id: number;
|
|
129
|
+
body: string;
|
|
130
|
+
comment_type?: string;
|
|
131
|
+
user: {
|
|
132
|
+
login: string;
|
|
133
|
+
name: string;
|
|
134
|
+
};
|
|
135
|
+
created_at: string;
|
|
136
|
+
updated_at?: string;
|
|
137
|
+
}
|
|
138
|
+
export declare function getIssueComment(token: string, owner: string, repo: string, id: number): Promise<IssueCommentDetail>;
|
|
139
|
+
export declare function editIssueComment(token: string, owner: string, repo: string, id: number, body: string): Promise<IssueCommentDetail>;
|
|
140
|
+
export declare function deleteIssueComment(token: string, owner: string, repo: string, id: number): Promise<void>;
|
|
141
|
+
export declare function listIssueCommentHistory(token: string, owner: string, repo: string, commentId: number): Promise<IssueHistory[]>;
|
|
142
|
+
export declare function listIssueCommentReactions(token: string, owner: string, repo: string, commentId: number, params?: {
|
|
143
|
+
emoji_name?: string;
|
|
144
|
+
page?: number;
|
|
145
|
+
per_page?: number;
|
|
146
|
+
}): Promise<Reaction[]>;
|
package/dist/api/issues.js
CHANGED
|
@@ -13,6 +13,14 @@ exports.removeIssueLabel = removeIssueLabel;
|
|
|
13
13
|
exports.listIssueReactions = listIssueReactions;
|
|
14
14
|
exports.createIssueReaction = createIssueReaction;
|
|
15
15
|
exports.listIssueHistory = listIssueHistory;
|
|
16
|
+
exports.listIssueLinkedPRs = listIssueLinkedPRs;
|
|
17
|
+
exports.listIssueRelatedBranches = listIssueRelatedBranches;
|
|
18
|
+
exports.setIssueRelatedBranches = setIssueRelatedBranches;
|
|
19
|
+
exports.getIssueComment = getIssueComment;
|
|
20
|
+
exports.editIssueComment = editIssueComment;
|
|
21
|
+
exports.deleteIssueComment = deleteIssueComment;
|
|
22
|
+
exports.listIssueCommentHistory = listIssueCommentHistory;
|
|
23
|
+
exports.listIssueCommentReactions = listIssueCommentReactions;
|
|
16
24
|
const client_1 = require("./client");
|
|
17
25
|
async function listIssues(token, owner, repo, params = {}) {
|
|
18
26
|
return (0, client_1.apiRequest)(`/repos/${owner}/${repo}/issues`, token, {
|
|
@@ -72,4 +80,29 @@ async function createIssueReaction(token, owner, repo, number, content) {
|
|
|
72
80
|
async function listIssueHistory(token, owner, repo, number, params = {}) {
|
|
73
81
|
return (0, client_1.apiRequest)(`/repos/${owner}/${repo}/issues/${number}/modify_history`, token, { query: params });
|
|
74
82
|
}
|
|
83
|
+
async function listIssueLinkedPRs(token, owner, repo, number, params = {}) {
|
|
84
|
+
return (0, client_1.apiRequest)(`/repos/${owner}/${repo}/issues/${number}/pull_requests`, token, { query: params });
|
|
85
|
+
}
|
|
86
|
+
// --- Issue Related Branches ---
|
|
87
|
+
async function listIssueRelatedBranches(token, owner, repo, number) {
|
|
88
|
+
return (0, client_1.apiRequest)(`/repos/${owner}/${repo}/issues/${number}/related_branches`, token);
|
|
89
|
+
}
|
|
90
|
+
async function setIssueRelatedBranches(token, owner, repo, number, branchNames) {
|
|
91
|
+
return (0, client_1.apiRequest)(`/repos/${owner}/${repo}/issues/${number}/related_branches`, token, { method: 'PUT', body: { branch_names: branchNames } });
|
|
92
|
+
}
|
|
93
|
+
async function getIssueComment(token, owner, repo, id) {
|
|
94
|
+
return (0, client_1.apiRequest)(`/repos/${owner}/${repo}/issues/comments/${id}`, token);
|
|
95
|
+
}
|
|
96
|
+
async function editIssueComment(token, owner, repo, id, body) {
|
|
97
|
+
return (0, client_1.apiRequest)(`/repos/${owner}/${repo}/issues/comments/${id}`, token, { method: 'PATCH', body: { body } });
|
|
98
|
+
}
|
|
99
|
+
async function deleteIssueComment(token, owner, repo, id) {
|
|
100
|
+
return (0, client_1.apiRequest)(`/repos/${owner}/${repo}/issues/comments/${id}`, token, { method: 'DELETE' });
|
|
101
|
+
}
|
|
102
|
+
async function listIssueCommentHistory(token, owner, repo, commentId) {
|
|
103
|
+
return (0, client_1.apiRequest)(`/repos/${owner}/${repo}/issues/comment/${commentId}/modify_history`, token);
|
|
104
|
+
}
|
|
105
|
+
async function listIssueCommentReactions(token, owner, repo, commentId, params = {}) {
|
|
106
|
+
return (0, client_1.apiRequest)(`/repos/${owner}/${repo}/issues/comment/${commentId}/user_reactions`, token, { query: params });
|
|
107
|
+
}
|
|
75
108
|
//# sourceMappingURL=issues.js.map
|
package/dist/api/issues.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"issues.js","sourceRoot":"","sources":["../../src/api/issues.ts"],"names":[],"mappings":";;AAqCA,gCASC;AAED,4BAOC;AAED,kCAWC;AAED,sCAYC;AAED,oCAYC;AAcD,kCAiBC;AAED,gCASC;AAED,kCASC;AAUD,wCAYC;AAED,4CAYC;AAWD,gDAUC;AAED,kDAYC;AAYD,4CAYC;
|
|
1
|
+
{"version":3,"file":"issues.js","sourceRoot":"","sources":["../../src/api/issues.ts"],"names":[],"mappings":";;AAqCA,gCASC;AAED,4BAOC;AAED,kCAWC;AAED,sCAYC;AAED,oCAYC;AAcD,kCAiBC;AAED,gCASC;AAED,kCASC;AAUD,wCAYC;AAED,4CAYC;AAWD,gDAUC;AAED,kDAYC;AAYD,4CAYC;AAiBD,gDAYC;AAID,4DAUC;AAED,0DAYC;AAaD,0CAUC;AAED,4CAYC;AAED,gDAWC;AAED,0DAUC;AAED,8DAYC;AAzXD,qCAAqC;AAqC9B,KAAK,UAAU,UAAU,CAC9B,KAAa,EACb,KAAa,EACb,IAAY,EACZ,SAA2B,EAAE;IAE7B,OAAO,IAAA,mBAAU,EAAU,UAAU,KAAK,IAAI,IAAI,SAAS,EAAE,KAAK,EAAE;QAClE,KAAK,EAAE,MAAqD;KAC7D,CAAC,CAAA;AACJ,CAAC;AAEM,KAAK,UAAU,QAAQ,CAC5B,KAAa,EACb,KAAa,EACb,IAAY,EACZ,MAAc;IAEd,OAAO,IAAA,mBAAU,EAAQ,UAAU,KAAK,IAAI,IAAI,WAAW,MAAM,EAAE,EAAE,KAAK,CAAC,CAAA;AAC7E,CAAC;AAEM,KAAK,UAAU,WAAW,CAC/B,KAAa,EACb,KAAa,EACb,IAAY,EACZ,MAA+F;IAE/F,uFAAuF;IACvF,OAAO,IAAA,mBAAU,EAAQ,UAAU,KAAK,SAAS,EAAE,KAAK,EAAE;QACxD,MAAM,EAAE,MAAM;QACd,IAAI,EAAE,EAAE,IAAI,EAAE,GAAG,MAAM,EAAE;KAC1B,CAAC,CAAA;AACJ,CAAC;AAEM,KAAK,UA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,KAAa,EACb,KAAa,EACb,IAAY,EACZ,EAAU,EACV,IAAY;IAEZ,OAAO,IAAA,mBAAU,EACf,UAAU,KAAK,IAAI,IAAI,oBAAoB,EAAE,EAAE,EAC/C,KAAK,EACL,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,EAAE,CACpC,CAAA;AACH,CAAC;AAEM,KAAK,UAAU,kBAAkB,CACtC,KAAa,EACb,KAAa,EACb,IAAY,EACZ,EAAU;IAEV,OAAO,IAAA,mBAAU,EACf,UAAU,KAAK,IAAI,IAAI,oBAAoB,EAAE,EAAE,EAC/C,KAAK,EACL,EAAE,MAAM,EAAE,QAAQ,EAAE,CACrB,CAAA;AACH,CAAC;AAEM,KAAK,UAAU,uBAAuB,CAC3C,KAAa,EACb,KAAa,EACb,IAAY,EACZ,SAAiB;IAEjB,OAAO,IAAA,mBAAU,EACf,UAAU,KAAK,IAAI,IAAI,mBAAmB,SAAS,iBAAiB,EACpE,KAAK,CACN,CAAA;AACH,CAAC;AAEM,KAAK,UAAU,yBAAyB,CAC7C,KAAa,EACb,KAAa,EACb,IAAY,EACZ,SAAiB,EACjB,SAAoE,EAAE;IAEtE,OAAO,IAAA,mBAAU,EACf,UAAU,KAAK,IAAI,IAAI,mBAAmB,SAAS,iBAAiB,EACpE,KAAK,EACL,EAAE,KAAK,EAAE,MAAqD,EAAE,CACjE,CAAA;AACH,CAAC"}
|
package/dist/api/prs.d.ts
CHANGED
|
@@ -204,3 +204,55 @@ export interface PRReaction {
|
|
|
204
204
|
}
|
|
205
205
|
export declare function listPRReactions(token: string, owner: string, repo: string, number: number): Promise<PRReaction[]>;
|
|
206
206
|
export declare function createPRReaction(token: string, owner: string, repo: string, number: number, content: string): Promise<PRReaction>;
|
|
207
|
+
export interface PRModifyHistory {
|
|
208
|
+
id: number;
|
|
209
|
+
content: string;
|
|
210
|
+
created_at: string;
|
|
211
|
+
user: {
|
|
212
|
+
login: string;
|
|
213
|
+
name: string;
|
|
214
|
+
};
|
|
215
|
+
}
|
|
216
|
+
export declare function listPRModifyHistory(token: string, owner: string, repo: string, number: number): Promise<PRModifyHistory[]>;
|
|
217
|
+
export declare function listLinkedIssues(token: string, owner: string, repo: string, number: number, params?: {
|
|
218
|
+
page?: number;
|
|
219
|
+
per_page?: number;
|
|
220
|
+
}): Promise<LinkedIssue[]>;
|
|
221
|
+
export declare function assignPRAssignees(token: string, owner: string, repo: string, number: number, assignees: string): Promise<{
|
|
222
|
+
assignees_number: number;
|
|
223
|
+
}>;
|
|
224
|
+
export declare function resetPRAssignees(token: string, owner: string, repo: string, number: number, resetAll?: boolean): Promise<unknown>;
|
|
225
|
+
export declare function removePRAssignees(token: string, owner: string, repo: string, number: number, assignees?: string): Promise<unknown>;
|
|
226
|
+
export interface PRSettings {
|
|
227
|
+
[key: string]: unknown;
|
|
228
|
+
}
|
|
229
|
+
export declare function getPRSettings(token: string, owner: string, repo: string): Promise<PRSettings>;
|
|
230
|
+
export declare function updatePRSettings(token: string, owner: string, repo: string, params: Record<string, unknown>): Promise<PRSettings>;
|
|
231
|
+
export declare function listOptionReviewers(token: string, owner: string, repo: string, number: number): Promise<PRUser[]>;
|
|
232
|
+
export declare function getPRComment(token: string, owner: string, repo: string, id: number): Promise<PRComment>;
|
|
233
|
+
export declare function editPRComment(token: string, owner: string, repo: string, id: number, body: string): Promise<PRComment>;
|
|
234
|
+
export interface CommentModifyHistory {
|
|
235
|
+
id: number;
|
|
236
|
+
content: string;
|
|
237
|
+
created_at: string;
|
|
238
|
+
user: {
|
|
239
|
+
login: string;
|
|
240
|
+
name: string;
|
|
241
|
+
};
|
|
242
|
+
}
|
|
243
|
+
export declare function getPRCommentHistory(token: string, owner: string, repo: string, commentId: number): Promise<CommentModifyHistory[]>;
|
|
244
|
+
export interface CommentReaction {
|
|
245
|
+
id: number;
|
|
246
|
+
user: {
|
|
247
|
+
login: string;
|
|
248
|
+
name: string;
|
|
249
|
+
};
|
|
250
|
+
content: string;
|
|
251
|
+
created_at: string;
|
|
252
|
+
}
|
|
253
|
+
export declare function listPRCommentReactions(token: string, owner: string, repo: string, commentId: number, params?: {
|
|
254
|
+
emoji_name?: string;
|
|
255
|
+
page?: number;
|
|
256
|
+
per_page?: number;
|
|
257
|
+
}): Promise<CommentReaction[]>;
|
|
258
|
+
export declare function replacePRLabels(token: string, owner: string, repo: string, number: number, labels: string[]): Promise<PRLabel[]>;
|
package/dist/api/prs.js
CHANGED
|
@@ -25,6 +25,19 @@ exports.closePR = closePR;
|
|
|
25
25
|
exports.reopenPR = reopenPR;
|
|
26
26
|
exports.listPRReactions = listPRReactions;
|
|
27
27
|
exports.createPRReaction = createPRReaction;
|
|
28
|
+
exports.listPRModifyHistory = listPRModifyHistory;
|
|
29
|
+
exports.listLinkedIssues = listLinkedIssues;
|
|
30
|
+
exports.assignPRAssignees = assignPRAssignees;
|
|
31
|
+
exports.resetPRAssignees = resetPRAssignees;
|
|
32
|
+
exports.removePRAssignees = removePRAssignees;
|
|
33
|
+
exports.getPRSettings = getPRSettings;
|
|
34
|
+
exports.updatePRSettings = updatePRSettings;
|
|
35
|
+
exports.listOptionReviewers = listOptionReviewers;
|
|
36
|
+
exports.getPRComment = getPRComment;
|
|
37
|
+
exports.editPRComment = editPRComment;
|
|
38
|
+
exports.getPRCommentHistory = getPRCommentHistory;
|
|
39
|
+
exports.listPRCommentReactions = listPRCommentReactions;
|
|
40
|
+
exports.replacePRLabels = replacePRLabels;
|
|
28
41
|
const client_1 = require("./client");
|
|
29
42
|
async function listPRs(token, owner, repo, params = {}) {
|
|
30
43
|
return (0, client_1.apiRequest)(`/repos/${owner}/${repo}/pulls`, token, {
|
|
@@ -155,4 +168,54 @@ async function listPRReactions(token, owner, repo, number) {
|
|
|
155
168
|
async function createPRReaction(token, owner, repo, number, content) {
|
|
156
169
|
return (0, client_1.apiRequest)(`/repos/${owner}/${repo}/pulls/${number}/user_reactions`, token, { method: 'POST', body: { content } });
|
|
157
170
|
}
|
|
171
|
+
async function listPRModifyHistory(token, owner, repo, number) {
|
|
172
|
+
return (0, client_1.apiRequest)(`/repos/${owner}/${repo}/pulls/${number}/modify_history`, token);
|
|
173
|
+
}
|
|
174
|
+
// --- Linked Issues (list) ---
|
|
175
|
+
async function listLinkedIssues(token, owner, repo, number, params = {}) {
|
|
176
|
+
return (0, client_1.apiRequest)(`/repos/${owner}/${repo}/pulls/${number}/issues`, token, { query: params });
|
|
177
|
+
}
|
|
178
|
+
// --- PR Assignees ---
|
|
179
|
+
async function assignPRAssignees(token, owner, repo, number, assignees) {
|
|
180
|
+
return (0, client_1.apiRequest)(`/repos/${owner}/${repo}/pulls/${number}/assignees`, token, { method: 'POST', body: { assignees } });
|
|
181
|
+
}
|
|
182
|
+
async function resetPRAssignees(token, owner, repo, number, resetAll) {
|
|
183
|
+
const body = {};
|
|
184
|
+
if (resetAll)
|
|
185
|
+
body.reset_all = true;
|
|
186
|
+
return (0, client_1.apiRequest)(`/repos/${owner}/${repo}/pulls/${number}/assignees`, token, { method: 'PATCH', body });
|
|
187
|
+
}
|
|
188
|
+
async function removePRAssignees(token, owner, repo, number, assignees) {
|
|
189
|
+
const options = { method: 'DELETE' };
|
|
190
|
+
if (assignees)
|
|
191
|
+
options.body = { assignees };
|
|
192
|
+
return (0, client_1.apiRequest)(`/repos/${owner}/${repo}/pulls/${number}/assignees`, token, options);
|
|
193
|
+
}
|
|
194
|
+
async function getPRSettings(token, owner, repo) {
|
|
195
|
+
return (0, client_1.apiRequest)(`/repos/${owner}/${repo}/pull_request_settings`, token);
|
|
196
|
+
}
|
|
197
|
+
async function updatePRSettings(token, owner, repo, params) {
|
|
198
|
+
return (0, client_1.apiRequest)(`/repos/${owner}/${repo}/pull_request_settings`, token, { method: 'PUT', body: params });
|
|
199
|
+
}
|
|
200
|
+
// --- Option Reviewers ---
|
|
201
|
+
async function listOptionReviewers(token, owner, repo, number) {
|
|
202
|
+
return (0, client_1.apiRequest)(`/repos/${owner}/${repo}/pulls/${number}/option_reviewers`, token);
|
|
203
|
+
}
|
|
204
|
+
// --- PR Comment CRUD ---
|
|
205
|
+
async function getPRComment(token, owner, repo, id) {
|
|
206
|
+
return (0, client_1.apiRequest)(`/repos/${owner}/${repo}/pulls/comments/${id}`, token);
|
|
207
|
+
}
|
|
208
|
+
async function editPRComment(token, owner, repo, id, body) {
|
|
209
|
+
return (0, client_1.apiRequest)(`/repos/${owner}/${repo}/pulls/comments/${id}`, token, { method: 'PATCH', body: { body } });
|
|
210
|
+
}
|
|
211
|
+
async function getPRCommentHistory(token, owner, repo, commentId) {
|
|
212
|
+
return (0, client_1.apiRequest)(`/repos/${owner}/${repo}/pulls/comment/${commentId}/modify_history`, token);
|
|
213
|
+
}
|
|
214
|
+
async function listPRCommentReactions(token, owner, repo, commentId, params = {}) {
|
|
215
|
+
return (0, client_1.apiRequest)(`/repos/${owner}/${repo}/pulls/comment/${commentId}/user_reactions`, token, { query: params });
|
|
216
|
+
}
|
|
217
|
+
// --- PR Labels (replace) ---
|
|
218
|
+
async function replacePRLabels(token, owner, repo, number, labels) {
|
|
219
|
+
return (0, client_1.apiRequest)(`/repos/${owner}/${repo}/pulls/${number}/labels`, token, { method: 'PUT', body: labels });
|
|
220
|
+
}
|
|
158
221
|
//# sourceMappingURL=prs.js.map
|