@spaceflow/core 0.17.0 → 0.18.0
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.js
CHANGED
|
@@ -1075,8 +1075,30 @@ function parseDiffText(diffText) {
|
|
|
1075
1075
|
async deletePullReviewComment(owner, repo, commentId) {
|
|
1076
1076
|
await this.request("DELETE", `/repos/${owner}/${repo}/pulls/comments/${commentId}`);
|
|
1077
1077
|
}
|
|
1078
|
-
async listResolvedThreads() {
|
|
1079
|
-
|
|
1078
|
+
async listResolvedThreads(owner, repo, index) {
|
|
1079
|
+
const result = [];
|
|
1080
|
+
try {
|
|
1081
|
+
const reviews = await this.listPullReviews(owner, repo, index);
|
|
1082
|
+
for (const review of reviews){
|
|
1083
|
+
if (!review.id) continue;
|
|
1084
|
+
const comments = await this.listPullReviewComments(owner, repo, index, review.id);
|
|
1085
|
+
for (const comment of comments){
|
|
1086
|
+
if (!comment.resolver) continue;
|
|
1087
|
+
result.push({
|
|
1088
|
+
path: comment.path,
|
|
1089
|
+
line: comment.position,
|
|
1090
|
+
resolvedBy: {
|
|
1091
|
+
id: comment.resolver.id,
|
|
1092
|
+
login: comment.resolver.login
|
|
1093
|
+
},
|
|
1094
|
+
body: comment.body
|
|
1095
|
+
});
|
|
1096
|
+
}
|
|
1097
|
+
}
|
|
1098
|
+
} catch {
|
|
1099
|
+
// 获取失败时返回空数组,不影响主流程
|
|
1100
|
+
}
|
|
1101
|
+
return result;
|
|
1080
1102
|
}
|
|
1081
1103
|
// ============ Reaction 操作 ============
|
|
1082
1104
|
async getIssueCommentReactions(owner, repo, commentId) {
|
|
@@ -1664,13 +1686,15 @@ function parseDiffText(diffText) {
|
|
|
1664
1686
|
const result = [];
|
|
1665
1687
|
for (const thread of threads){
|
|
1666
1688
|
if (!thread.isResolved) continue;
|
|
1689
|
+
const firstComment = thread.comments.nodes[0];
|
|
1667
1690
|
result.push({
|
|
1668
1691
|
path: thread.path ?? undefined,
|
|
1669
1692
|
line: thread.line ?? undefined,
|
|
1670
1693
|
resolvedBy: thread.resolvedBy ? {
|
|
1671
1694
|
id: thread.resolvedBy.databaseId,
|
|
1672
1695
|
login: thread.resolvedBy.login
|
|
1673
|
-
} : null
|
|
1696
|
+
} : null,
|
|
1697
|
+
body: firstComment?.body
|
|
1674
1698
|
});
|
|
1675
1699
|
}
|
|
1676
1700
|
return result;
|
|
@@ -1689,7 +1713,7 @@ function parseDiffText(diffText) {
|
|
|
1689
1713
|
path
|
|
1690
1714
|
line
|
|
1691
1715
|
comments(first: 1) {
|
|
1692
|
-
nodes { databaseId }
|
|
1716
|
+
nodes { databaseId body }
|
|
1693
1717
|
}
|
|
1694
1718
|
}
|
|
1695
1719
|
}
|
|
@@ -11424,7 +11448,7 @@ async function exec(extensions = [], options = {}) {
|
|
|
11424
11448
|
// 6. 创建 CLI 程序
|
|
11425
11449
|
const program = new Command();
|
|
11426
11450
|
const cliVersion = options.cliVersion || "0.0.0";
|
|
11427
|
-
const coreVersion = true ? "0.
|
|
11451
|
+
const coreVersion = true ? "0.18.0" : 0;
|
|
11428
11452
|
const versionOutput = `spaceflow/${cliVersion} core/${coreVersion}`;
|
|
11429
11453
|
program.name("spaceflow").description("Spaceflow CLI").version(versionOutput, "-V, --version", "显示版本信息");
|
|
11430
11454
|
// 定义全局 verbose 选项(支持计数:-v, -vv, -vvv)
|