@bragduck/cli 2.13.1 → 2.13.5

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.
@@ -3380,20 +3380,13 @@ 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
- if (options.author.includes("@")) {
3389
- queries.push(
3390
- "(creator = currentUser() OR reporter = currentUser() OR assignee = currentUser())"
3391
- );
3392
- } else {
3393
- queries.push(
3394
- `(creator = "${options.author}" OR reporter = "${options.author}" OR assignee = "${options.author}")`
3395
- );
3396
- }
3386
+ const escapedAuthor = options.author.replace(/"/g, '\\"');
3387
+ queries.push(
3388
+ `(creator = "${escapedAuthor}" OR reporter = "${escapedAuthor}" OR assignee = "${escapedAuthor}")`
3389
+ );
3397
3390
  } else {
3398
3391
  queries.push(
3399
3392
  "(creator = currentUser() OR reporter = currentUser() OR assignee = currentUser())"
@@ -3477,6 +3470,11 @@ var JiraService = class {
3477
3470
  * Fetch issues with optional filtering
3478
3471
  */
3479
3472
  async getIssues(options = {}) {
3473
+ if (options.author) {
3474
+ logger.debug(`Fetching issues for author: ${options.author}`);
3475
+ } else {
3476
+ logger.debug("Fetching issues for current user (no author specified)");
3477
+ }
3480
3478
  const jql = this.buildJQL(options);
3481
3479
  logger.debug(`Using JQL query: ${jql}`);
3482
3480
  const fields = [
@@ -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(issue, void 0, email2);
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,14 +3830,11 @@ var ConfluenceService = class {
3828
3830
  const queries = [];
3829
3831
  queries.push("type = page");
3830
3832
  if (options.days) {
3831
- queries.push(`lastmodified > startOfDay("-${options.days}d")`);
3833
+ queries.push(`lastModified > startOfDay("-${options.days}d")`);
3832
3834
  }
3833
3835
  if (options.author) {
3834
- if (options.author.includes("@")) {
3835
- queries.push("(creator = currentUser() or contributor = currentUser())");
3836
- } else {
3837
- queries.push(`(creator = "${options.author}" or contributor = "${options.author}")`);
3838
- }
3836
+ const escapedAuthor = options.author.replace(/"/g, '\\"');
3837
+ queries.push(`(creator = "${escapedAuthor}" or contributor = "${escapedAuthor}")`);
3839
3838
  } else {
3840
3839
  queries.push("(creator = currentUser() or contributor = currentUser())");
3841
3840
  }
@@ -3974,7 +3973,14 @@ var ConfluenceService = class {
3974
3973
  break;
3975
3974
  }
3976
3975
  if (options.limit && allPages.length >= options.limit) {
3977
- return allPages.slice(0, options.limit).map((page) => this.transformPageToCommit(page));
3976
+ const email2 = await this.getCurrentUser();
3977
+ const limitedPages = allPages.slice(0, options.limit);
3978
+ const commits2 = [];
3979
+ for (const page of limitedPages) {
3980
+ const commit = await this.transformPageToCommit(page, void 0, email2 || void 0);
3981
+ commits2.push(commit);
3982
+ }
3983
+ return commits2;
3978
3984
  }
3979
3985
  start += limit;
3980
3986
  } catch (error) {
@@ -4001,7 +4007,7 @@ var ConfluenceService = class {
4001
4007
  const email = await this.getCurrentUser();
4002
4008
  const commits = [];
4003
4009
  for (const page of allPages) {
4004
- const commit = await this.transformPageToCommit(page, void 0, email);
4010
+ const commit = await this.transformPageToCommit(page, void 0, email || void 0);
4005
4011
  commits.push(commit);
4006
4012
  }
4007
4013
  return commits;