@bragduck/cli 2.12.1 → 2.13.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.
@@ -3381,17 +3381,23 @@ var JiraService = class {
3381
3381
  const queries = [];
3382
3382
  if (options.days) {
3383
3383
  queries.push(
3384
- `(created >= -${options.days}d OR resolved >= -${options.days}d OR updated >= -${options.days}d)`
3384
+ `(created >= -${options.days}d OR resolutiondate >= -${options.days}d OR updated >= -${options.days}d)`
3385
3385
  );
3386
3386
  }
3387
3387
  if (options.author) {
3388
3388
  if (options.author.includes("@")) {
3389
- queries.push("(creator = currentUser() OR assignee = currentUser())");
3389
+ queries.push(
3390
+ "(creator = currentUser() OR reporter = currentUser() OR assignee = currentUser())"
3391
+ );
3390
3392
  } else {
3391
- queries.push(`(creator = "${options.author}" OR assignee = "${options.author}")`);
3393
+ queries.push(
3394
+ `(creator = "${options.author}" OR reporter = "${options.author}" OR assignee = "${options.author}")`
3395
+ );
3392
3396
  }
3393
3397
  } else {
3394
- queries.push("(creator = currentUser() OR assignee = currentUser())");
3398
+ queries.push(
3399
+ "(creator = currentUser() OR reporter = currentUser() OR assignee = currentUser())"
3400
+ );
3395
3401
  }
3396
3402
  if (options.jql) {
3397
3403
  queries.push(`(${options.jql})`);
@@ -3413,15 +3419,23 @@ var JiraService = class {
3413
3419
  }
3414
3420
  /**
3415
3421
  * Determine the type of contribution the current user made to an issue
3416
- * Returns: 'created' | 'assigned-resolved' | 'edited'
3422
+ * Returns: 'created' | 'reported' | 'assigned-resolved' | 'edited'
3417
3423
  */
3418
3424
  async determineJiraContributionType(issue, userEmail) {
3419
- if (issue.fields.creator.emailAddress === userEmail) {
3425
+ const isCreator = issue.fields.creator.emailAddress === userEmail;
3426
+ const isReporter = issue.fields.reporter?.emailAddress === userEmail;
3427
+ if (isCreator) {
3420
3428
  return {
3421
3429
  type: "created",
3422
3430
  details: `Created ${issue.fields.issuetype.name}: ${issue.fields.status.name}`
3423
3431
  };
3424
3432
  }
3433
+ if (isReporter && !isCreator) {
3434
+ return {
3435
+ type: "reported",
3436
+ details: `Reported ${issue.fields.issuetype.name}: ${issue.fields.status.name}`
3437
+ };
3438
+ }
3425
3439
  const isAssigned = issue.fields.assignee?.emailAddress === userEmail;
3426
3440
  const isResolved = issue.fields.resolutiondate !== null && issue.fields.resolutiondate !== void 0;
3427
3441
  const userEdits = issue.changelog?.histories?.filter((history) => history.author.emailAddress === userEmail) || [];
@@ -3450,6 +3464,8 @@ var JiraService = class {
3450
3464
  const multipliers = {
3451
3465
  created: 1,
3452
3466
  // 100% - highest impact (created the issue)
3467
+ reported: 0.9,
3468
+ // 90% - very high impact (reported/initiated the issue)
3453
3469
  "assigned-resolved": 0.8,
3454
3470
  // 80% - high impact (owned and resolved)
3455
3471
  edited: 0.4
@@ -3470,6 +3486,7 @@ var JiraService = class {
3470
3486
  "updated",
3471
3487
  "resolutiondate",
3472
3488
  "creator",
3489
+ "reporter",
3473
3490
  "assignee",
3474
3491
  "status",
3475
3492
  "issuetype"
@@ -3579,6 +3596,8 @@ var JiraService = class {
3579
3596
  if (contribution) {
3580
3597
  if (contribution.type === "created") {
3581
3598
  contributionPrefix = "\u{1F3AB} Created: ";
3599
+ } else if (contribution.type === "reported") {
3600
+ contributionPrefix = "\u{1F4CB} Reported: ";
3582
3601
  } else if (contribution.type === "assigned-resolved") {
3583
3602
  contributionPrefix = "\u2705 Resolved: ";
3584
3603
  } else {
@@ -3605,7 +3624,7 @@ ${truncatedDesc}`;
3605
3624
  }
3606
3625
  }
3607
3626
  let date;
3608
- if (contribution?.type === "created") {
3627
+ if (contribution?.type === "created" || contribution?.type === "reported") {
3609
3628
  date = issue.fields.created;
3610
3629
  } else if (contribution?.type === "assigned-resolved" && issue.fields.resolutiondate) {
3611
3630
  date = issue.fields.resolutiondate;