@bragduck/cli 2.9.1 → 2.9.3

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.
@@ -2176,6 +2176,10 @@ var theme = {
2176
2176
  * Format values
2177
2177
  */
2178
2178
  value: (text) => colors.highlight(text),
2179
+ /**
2180
+ * Format highlighted text
2181
+ */
2182
+ highlight: (text) => colors.highlight(text),
2179
2183
  /**
2180
2184
  * Format counts and numbers
2181
2185
  */
@@ -3326,6 +3330,11 @@ var JiraService = class {
3326
3330
  throw new JiraError("Resource not found", {
3327
3331
  originalError: statusText
3328
3332
  });
3333
+ } else if (status === 410) {
3334
+ throw new JiraError("Resource no longer available (deleted, archived, or moved)", {
3335
+ hint: "The Jira issue, project, or instance may have been deleted/archived. Verify your instance URL and that the resource still exists.",
3336
+ originalError: statusText
3337
+ });
3329
3338
  } else if (status === 429) {
3330
3339
  throw new JiraError("Rate limit exceeded", {
3331
3340
  hint: "Wait a few minutes before trying again",
@@ -3415,18 +3424,36 @@ var JiraService = class {
3415
3424
  const maxResults = 100;
3416
3425
  while (true) {
3417
3426
  const endpoint = `/rest/api/2/search?jql=${encodeURIComponent(jql)}&startAt=${startAt}&maxResults=${maxResults}&fields=${fields.join(",")}`;
3418
- const response = await this.request(endpoint);
3419
- allIssues.push(...response.issues);
3420
- logger.debug(
3421
- `Fetched ${response.issues.length} issues (total: ${allIssues.length} of ${response.total})${startAt + maxResults < response.total ? ", fetching next page..." : ""}`
3422
- );
3423
- if (startAt + maxResults >= response.total) {
3424
- break;
3425
- }
3426
- if (options.limit && allIssues.length >= options.limit) {
3427
- return allIssues.slice(0, options.limit).map((issue) => this.transformIssueToCommit(issue));
3427
+ try {
3428
+ const response = await this.request(endpoint);
3429
+ allIssues.push(...response.issues);
3430
+ logger.debug(
3431
+ `Fetched ${response.issues.length} issues (total: ${allIssues.length} of ${response.total})${startAt + maxResults < response.total ? ", fetching next page..." : ""}`
3432
+ );
3433
+ if (startAt + maxResults >= response.total) {
3434
+ break;
3435
+ }
3436
+ if (options.limit && allIssues.length >= options.limit) {
3437
+ return allIssues.slice(0, options.limit).map((issue) => this.transformIssueToCommit(issue));
3438
+ }
3439
+ startAt += maxResults;
3440
+ } catch (error) {
3441
+ if (error instanceof JiraError && error.message.includes("no longer available")) {
3442
+ logger.warning(`Skipping unavailable Jira resource: ${error.message}`);
3443
+ if (allIssues.length > 0) {
3444
+ logger.info(
3445
+ `Returning ${allIssues.length} available issues (some resources were unavailable)`
3446
+ );
3447
+ break;
3448
+ }
3449
+ if (startAt === 0) {
3450
+ throw error;
3451
+ }
3452
+ startAt += maxResults;
3453
+ continue;
3454
+ }
3455
+ throw error;
3428
3456
  }
3429
- startAt += maxResults;
3430
3457
  }
3431
3458
  return allIssues.map((issue) => this.transformIssueToCommit(issue));
3432
3459
  }
@@ -3595,6 +3622,11 @@ var ConfluenceService = class {
3595
3622
  throw new ConfluenceError("Resource not found", {
3596
3623
  originalError: statusText
3597
3624
  });
3625
+ } else if (status === 410) {
3626
+ throw new ConfluenceError("Resource no longer available (deleted, archived, or moved)", {
3627
+ hint: "The Confluence page, space, or instance may have been deleted/archived. Verify your instance URL and that the resource still exists.",
3628
+ originalError: statusText
3629
+ });
3598
3630
  } else if (status === 429) {
3599
3631
  throw new ConfluenceError("Rate limit exceeded", {
3600
3632
  hint: "Wait a few minutes before trying again",