@bragduck/cli 2.13.4 → 2.13.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.
@@ -3364,12 +3364,12 @@ var JiraService = class {
3364
3364
  }
3365
3365
  }
3366
3366
  /**
3367
- * Get current user's email
3367
+ * Get current user's account ID (for Jira Cloud) or username (for Jira Server)
3368
3368
  */
3369
3369
  async getCurrentUser() {
3370
3370
  try {
3371
3371
  const user = await this.request("/rest/api/2/myself");
3372
- return user.emailAddress;
3372
+ return user.accountId || user.name || user.emailAddress;
3373
3373
  } catch {
3374
3374
  return null;
3375
3375
  }
@@ -3383,15 +3383,10 @@ var JiraService = class {
3383
3383
  queries.push(`updated >= -${options.days}d`);
3384
3384
  }
3385
3385
  if (options.author) {
3386
- if (options.author.includes("@")) {
3387
- queries.push(
3388
- "(creator = currentUser() OR reporter = currentUser() OR assignee = currentUser())"
3389
- );
3390
- } else {
3391
- queries.push(
3392
- `(creator = "${options.author}" OR reporter = "${options.author}" OR assignee = "${options.author}")`
3393
- );
3394
- }
3386
+ const escapedAuthor = options.author.replace(/"/g, '\\"');
3387
+ queries.push(
3388
+ `(creator = "${escapedAuthor}" OR reporter = "${escapedAuthor}" OR assignee = "${escapedAuthor}")`
3389
+ );
3395
3390
  } else {
3396
3391
  queries.push(
3397
3392
  "(creator = currentUser() OR reporter = currentUser() OR assignee = currentUser())"
@@ -3475,6 +3470,11 @@ var JiraService = class {
3475
3470
  * Fetch issues with optional filtering
3476
3471
  */
3477
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
+ }
3478
3478
  const jql = this.buildJQL(options);
3479
3479
  logger.debug(`Using JQL query: ${jql}`);
3480
3480
  const fields = [
@@ -3533,11 +3533,7 @@ var JiraService = class {
3533
3533
  const limitedIssues = allIssues.slice(0, options.limit);
3534
3534
  const commits2 = [];
3535
3535
  for (const issue of limitedIssues) {
3536
- const commit = await this.transformIssueToCommit(
3537
- issue,
3538
- void 0,
3539
- email2 || void 0
3540
- );
3536
+ const commit = await this.transformIssueToCommit(issue, void 0, email2 || void 0);
3541
3537
  commits2.push(commit);
3542
3538
  }
3543
3539
  return commits2;
@@ -3809,12 +3805,12 @@ var ConfluenceService = class {
3809
3805
  }
3810
3806
  }
3811
3807
  /**
3812
- * Get current user's email
3808
+ * Get current user's account ID (for Confluence Cloud) or username (for Server/DC)
3813
3809
  */
3814
3810
  async getCurrentUser() {
3815
3811
  try {
3816
- const creds = await this.getCredentials();
3817
- return creds.email;
3812
+ const user = await this.request("/wiki/rest/api/user/current");
3813
+ return user.accountId || user.username || user.email;
3818
3814
  } catch {
3819
3815
  return null;
3820
3816
  }
@@ -3833,11 +3829,8 @@ var ConfluenceService = class {
3833
3829
  queries.push(`lastModified > startOfDay("-${options.days}d")`);
3834
3830
  }
3835
3831
  if (options.author) {
3836
- if (options.author.includes("@")) {
3837
- queries.push("(creator = currentUser() or contributor = currentUser())");
3838
- } else {
3839
- queries.push(`(creator = "${options.author}" or contributor = "${options.author}")`);
3840
- }
3832
+ const escapedAuthor = options.author.replace(/"/g, '\\"');
3833
+ queries.push(`(creator = "${escapedAuthor}" or contributor = "${escapedAuthor}")`);
3841
3834
  } else {
3842
3835
  queries.push("(creator = currentUser() or contributor = currentUser())");
3843
3836
  }