@bragduck/cli 2.13.0 → 2.13.4
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/bin/bragduck.js +27 -18
- package/dist/bin/bragduck.js.map +1 -1
- package/package.json +1 -1
package/dist/bin/bragduck.js
CHANGED
|
@@ -3380,9 +3380,7 @@ var JiraService = class {
|
|
|
3380
3380
|
buildJQL(options) {
|
|
3381
3381
|
const queries = [];
|
|
3382
3382
|
if (options.days) {
|
|
3383
|
-
queries.push(
|
|
3384
|
-
`(created >= -${options.days}d OR resolutiondate >= -${options.days}d OR updated >= -${options.days}d)`
|
|
3385
|
-
);
|
|
3383
|
+
queries.push(`updated >= -${options.days}d`);
|
|
3386
3384
|
}
|
|
3387
3385
|
if (options.author) {
|
|
3388
3386
|
if (options.author.includes("@")) {
|
|
@@ -3535,7 +3533,11 @@ var JiraService = class {
|
|
|
3535
3533
|
const limitedIssues = allIssues.slice(0, options.limit);
|
|
3536
3534
|
const commits2 = [];
|
|
3537
3535
|
for (const issue of limitedIssues) {
|
|
3538
|
-
const commit = await this.transformIssueToCommit(
|
|
3536
|
+
const commit = await this.transformIssueToCommit(
|
|
3537
|
+
issue,
|
|
3538
|
+
void 0,
|
|
3539
|
+
email2 || void 0
|
|
3540
|
+
);
|
|
3539
3541
|
commits2.push(commit);
|
|
3540
3542
|
}
|
|
3541
3543
|
return commits2;
|
|
@@ -3565,7 +3567,7 @@ var JiraService = class {
|
|
|
3565
3567
|
const email = await this.getCurrentUser();
|
|
3566
3568
|
const commits = [];
|
|
3567
3569
|
for (const issue of allIssues) {
|
|
3568
|
-
const commit = await this.transformIssueToCommit(issue, void 0, email);
|
|
3570
|
+
const commit = await this.transformIssueToCommit(issue, void 0, email || void 0);
|
|
3569
3571
|
commits.push(commit);
|
|
3570
3572
|
}
|
|
3571
3573
|
return commits;
|
|
@@ -3828,7 +3830,7 @@ var ConfluenceService = class {
|
|
|
3828
3830
|
const queries = [];
|
|
3829
3831
|
queries.push("type = page");
|
|
3830
3832
|
if (options.days) {
|
|
3831
|
-
queries.push(`
|
|
3833
|
+
queries.push(`lastModified > startOfDay("-${options.days}d")`);
|
|
3832
3834
|
}
|
|
3833
3835
|
if (options.author) {
|
|
3834
3836
|
if (options.author.includes("@")) {
|
|
@@ -3859,24 +3861,24 @@ var ConfluenceService = class {
|
|
|
3859
3861
|
if (page.history?.createdBy?.email === userEmail) {
|
|
3860
3862
|
return {
|
|
3861
3863
|
type: "created",
|
|
3862
|
-
details: `Created page with ${page.version
|
|
3864
|
+
details: `Created page with ${page.version?.number || 1} version${(page.version?.number || 1) > 1 ? "s" : ""}`
|
|
3863
3865
|
};
|
|
3864
3866
|
}
|
|
3865
|
-
const hasEdits = page.version
|
|
3867
|
+
const hasEdits = page.version?.by?.email === userEmail && (page.version?.number || 0) > 1;
|
|
3866
3868
|
const userComments = page.children?.comment?.results?.filter(
|
|
3867
|
-
(comment) => comment.version
|
|
3869
|
+
(comment) => comment.version?.by?.email === userEmail
|
|
3868
3870
|
) || [];
|
|
3869
3871
|
const hasComments = userComments.length > 0;
|
|
3870
3872
|
if (hasEdits && hasComments) {
|
|
3871
3873
|
return {
|
|
3872
3874
|
type: "edited",
|
|
3873
|
-
details: `Edited page (v${page.version
|
|
3875
|
+
details: `Edited page (v${page.version?.number || 1}) and added ${userComments.length} comment${userComments.length > 1 ? "s" : ""}`
|
|
3874
3876
|
};
|
|
3875
3877
|
}
|
|
3876
3878
|
if (hasEdits) {
|
|
3877
3879
|
return {
|
|
3878
3880
|
type: "edited",
|
|
3879
|
-
details: `Edited page to version ${page.version
|
|
3881
|
+
details: `Edited page to version ${page.version?.number || 1}`
|
|
3880
3882
|
};
|
|
3881
3883
|
}
|
|
3882
3884
|
if (hasComments) {
|
|
@@ -3974,7 +3976,14 @@ var ConfluenceService = class {
|
|
|
3974
3976
|
break;
|
|
3975
3977
|
}
|
|
3976
3978
|
if (options.limit && allPages.length >= options.limit) {
|
|
3977
|
-
|
|
3979
|
+
const email2 = await this.getCurrentUser();
|
|
3980
|
+
const limitedPages = allPages.slice(0, options.limit);
|
|
3981
|
+
const commits2 = [];
|
|
3982
|
+
for (const page of limitedPages) {
|
|
3983
|
+
const commit = await this.transformPageToCommit(page, void 0, email2 || void 0);
|
|
3984
|
+
commits2.push(commit);
|
|
3985
|
+
}
|
|
3986
|
+
return commits2;
|
|
3978
3987
|
}
|
|
3979
3988
|
start += limit;
|
|
3980
3989
|
} catch (error) {
|
|
@@ -4001,7 +4010,7 @@ var ConfluenceService = class {
|
|
|
4001
4010
|
const email = await this.getCurrentUser();
|
|
4002
4011
|
const commits = [];
|
|
4003
4012
|
for (const page of allPages) {
|
|
4004
|
-
const commit = await this.transformPageToCommit(page, void 0, email);
|
|
4013
|
+
const commit = await this.transformPageToCommit(page, void 0, email || void 0);
|
|
4005
4014
|
commits.push(commit);
|
|
4006
4015
|
}
|
|
4007
4016
|
return commits;
|
|
@@ -4040,11 +4049,11 @@ var ConfluenceService = class {
|
|
|
4040
4049
|
message = `${contributionPrefix}${page.title}
|
|
4041
4050
|
|
|
4042
4051
|
${contribution.details}
|
|
4043
|
-
[Confluence Page v${page.version
|
|
4052
|
+
[Confluence Page v${page.version?.number || 1}]`;
|
|
4044
4053
|
} else {
|
|
4045
4054
|
message = `${page.title}
|
|
4046
4055
|
|
|
4047
|
-
[Confluence Page v${page.version
|
|
4056
|
+
[Confluence Page v${page.version?.number || 1}]`;
|
|
4048
4057
|
}
|
|
4049
4058
|
let baseUrl = "https://confluence.atlassian.net";
|
|
4050
4059
|
if (instanceUrl) {
|
|
@@ -4061,9 +4070,9 @@ ${contribution.details}
|
|
|
4061
4070
|
const url = `${baseUrl}/wiki${page._links.webui}`;
|
|
4062
4071
|
const baseSize = this.estimatePageSize(page);
|
|
4063
4072
|
const impactScore = contribution ? this.calculateContributionImpact(contribution.type, baseSize) : baseSize;
|
|
4064
|
-
const author = page.history?.createdBy?.displayName || page.version
|
|
4065
|
-
const authorEmail = page.history?.createdBy?.email || page.version
|
|
4066
|
-
const date = contribution?.type === "created" ? page.history?.createdDate || page.version
|
|
4073
|
+
const author = page.history?.createdBy?.displayName || page.version?.by?.displayName || "Unknown Author";
|
|
4074
|
+
const authorEmail = page.history?.createdBy?.email || page.version?.by?.email || "unknown@example.com";
|
|
4075
|
+
const date = contribution?.type === "created" ? page.history?.createdDate || page.version?.when : page.version?.when || (/* @__PURE__ */ new Date()).toISOString();
|
|
4067
4076
|
return {
|
|
4068
4077
|
sha: page.id,
|
|
4069
4078
|
message,
|