@bretwardjames/ghp-core 0.10.0 → 0.11.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.
package/dist/index.cjs CHANGED
@@ -1280,6 +1280,21 @@ var GitHubAPI = class {
1280
1280
  return false;
1281
1281
  }
1282
1282
  }
1283
+ /**
1284
+ * Move an issue to a target status in its project.
1285
+ * Returns { success, error? } — does not throw.
1286
+ */
1287
+ async moveIssueToStatus(repo, issueNumber, targetStatus) {
1288
+ const item = await this.findItemByNumber(repo, issueNumber);
1289
+ if (!item) return { success: false, error: `Issue #${issueNumber} not found in any project` };
1290
+ if (item.status === targetStatus) return { success: true };
1291
+ const statusField = await this.getStatusField(item.projectId);
1292
+ if (!statusField) return { success: false, error: "Could not find Status field on project" };
1293
+ const option = statusField.options.find((o) => o.name === targetStatus);
1294
+ if (!option) return { success: false, error: `Status "${targetStatus}" not found. Available: ${statusField.options.map((o) => o.name).join(", ")}` };
1295
+ const updated = await this.updateItemStatus(item.projectId, item.id, statusField.fieldId, option.id);
1296
+ return updated ? { success: true } : { success: false, error: "Failed to update status" };
1297
+ }
1283
1298
  /**
1284
1299
  * Find an item by issue number - direct lookup via issue's projectItems
1285
1300
  * Much faster than iterating through all project items
@@ -2651,31 +2666,41 @@ var SYNCABLE_KEYS = [
2651
2666
  "mainBranch",
2652
2667
  "branchPattern",
2653
2668
  "startWorkingStatus",
2654
- "doneStatus"
2669
+ "doneStatus",
2670
+ "prOpenedStatus",
2671
+ "prMergedStatus"
2655
2672
  ];
2656
2673
  var SETTING_DISPLAY_NAMES = {
2657
2674
  mainBranch: "Main Branch",
2658
2675
  branchPattern: "Branch Name Pattern",
2659
2676
  startWorkingStatus: "Start Working Status",
2660
- doneStatus: "Done/PR Merged Status"
2677
+ doneStatus: "Done Status",
2678
+ prOpenedStatus: "PR Opened Status",
2679
+ prMergedStatus: "PR Merged Status"
2661
2680
  };
2662
2681
  var VSCODE_TO_CLI_MAP = {
2663
2682
  "mainBranch": "mainBranch",
2664
2683
  "branchNamePattern": "branchPattern",
2665
2684
  "startWorkingStatus": "startWorkingStatus",
2666
- "prMergedStatus": "doneStatus"
2685
+ "doneStatus": "doneStatus",
2686
+ "prOpenedStatus": "prOpenedStatus",
2687
+ "prMergedStatus": "prMergedStatus"
2667
2688
  };
2668
2689
  var CLI_TO_VSCODE_MAP = {
2669
2690
  mainBranch: "mainBranch",
2670
2691
  branchPattern: "branchNamePattern",
2671
2692
  startWorkingStatus: "startWorkingStatus",
2672
- doneStatus: "prMergedStatus"
2693
+ doneStatus: "doneStatus",
2694
+ prOpenedStatus: "prOpenedStatus",
2695
+ prMergedStatus: "prMergedStatus"
2673
2696
  };
2674
2697
  var DEFAULT_VALUES = {
2675
2698
  mainBranch: "main",
2676
2699
  branchPattern: "{user}/{number}-{title}",
2677
2700
  startWorkingStatus: "In Progress",
2678
- doneStatus: "Done"
2701
+ doneStatus: "Done",
2702
+ prOpenedStatus: "In Review",
2703
+ prMergedStatus: "Ready for Beta"
2679
2704
  };
2680
2705
  function normalizeVSCodeSettings(vscodeSettings) {
2681
2706
  const result = {};
package/dist/index.d.cts CHANGED
@@ -539,6 +539,14 @@ declare class GitHubAPI {
539
539
  * Update an item's status
540
540
  */
541
541
  updateItemStatus(projectId: string, itemId: string, fieldId: string, optionId: string): Promise<boolean>;
542
+ /**
543
+ * Move an issue to a target status in its project.
544
+ * Returns { success, error? } — does not throw.
545
+ */
546
+ moveIssueToStatus(repo: RepoInfo, issueNumber: number, targetStatus: string): Promise<{
547
+ success: boolean;
548
+ error?: string;
549
+ }>;
542
550
  /**
543
551
  * Find an item by issue number - direct lookup via issue's projectItems
544
552
  * Much faster than iterating through all project items
@@ -1021,7 +1029,7 @@ declare function buildOrgProjectUrl(org: string, projectNumber: number): string;
1021
1029
  * The canonical setting keys used in sync operations.
1022
1030
  * These are the CLI key names (used as the canonical form).
1023
1031
  */
1024
- type SyncableSettingKey = 'mainBranch' | 'branchPattern' | 'startWorkingStatus' | 'doneStatus';
1032
+ type SyncableSettingKey = 'mainBranch' | 'branchPattern' | 'startWorkingStatus' | 'doneStatus' | 'prOpenedStatus' | 'prMergedStatus';
1025
1033
  /**
1026
1034
  * Settings that can be synced between CLI and VSCode.
1027
1035
  * Uses CLI key names as the canonical form.
@@ -1031,6 +1039,8 @@ interface SyncableSettings {
1031
1039
  branchPattern?: string;
1032
1040
  startWorkingStatus?: string;
1033
1041
  doneStatus?: string;
1042
+ prOpenedStatus?: string;
1043
+ prMergedStatus?: string;
1034
1044
  }
1035
1045
  /**
1036
1046
  * A source of settings (CLI or VSCode)
package/dist/index.d.ts CHANGED
@@ -539,6 +539,14 @@ declare class GitHubAPI {
539
539
  * Update an item's status
540
540
  */
541
541
  updateItemStatus(projectId: string, itemId: string, fieldId: string, optionId: string): Promise<boolean>;
542
+ /**
543
+ * Move an issue to a target status in its project.
544
+ * Returns { success, error? } — does not throw.
545
+ */
546
+ moveIssueToStatus(repo: RepoInfo, issueNumber: number, targetStatus: string): Promise<{
547
+ success: boolean;
548
+ error?: string;
549
+ }>;
542
550
  /**
543
551
  * Find an item by issue number - direct lookup via issue's projectItems
544
552
  * Much faster than iterating through all project items
@@ -1021,7 +1029,7 @@ declare function buildOrgProjectUrl(org: string, projectNumber: number): string;
1021
1029
  * The canonical setting keys used in sync operations.
1022
1030
  * These are the CLI key names (used as the canonical form).
1023
1031
  */
1024
- type SyncableSettingKey = 'mainBranch' | 'branchPattern' | 'startWorkingStatus' | 'doneStatus';
1032
+ type SyncableSettingKey = 'mainBranch' | 'branchPattern' | 'startWorkingStatus' | 'doneStatus' | 'prOpenedStatus' | 'prMergedStatus';
1025
1033
  /**
1026
1034
  * Settings that can be synced between CLI and VSCode.
1027
1035
  * Uses CLI key names as the canonical form.
@@ -1031,6 +1039,8 @@ interface SyncableSettings {
1031
1039
  branchPattern?: string;
1032
1040
  startWorkingStatus?: string;
1033
1041
  doneStatus?: string;
1042
+ prOpenedStatus?: string;
1043
+ prMergedStatus?: string;
1034
1044
  }
1035
1045
  /**
1036
1046
  * A source of settings (CLI or VSCode)
package/dist/index.js CHANGED
@@ -1109,6 +1109,21 @@ var GitHubAPI = class {
1109
1109
  return false;
1110
1110
  }
1111
1111
  }
1112
+ /**
1113
+ * Move an issue to a target status in its project.
1114
+ * Returns { success, error? } — does not throw.
1115
+ */
1116
+ async moveIssueToStatus(repo, issueNumber, targetStatus) {
1117
+ const item = await this.findItemByNumber(repo, issueNumber);
1118
+ if (!item) return { success: false, error: `Issue #${issueNumber} not found in any project` };
1119
+ if (item.status === targetStatus) return { success: true };
1120
+ const statusField = await this.getStatusField(item.projectId);
1121
+ if (!statusField) return { success: false, error: "Could not find Status field on project" };
1122
+ const option = statusField.options.find((o) => o.name === targetStatus);
1123
+ if (!option) return { success: false, error: `Status "${targetStatus}" not found. Available: ${statusField.options.map((o) => o.name).join(", ")}` };
1124
+ const updated = await this.updateItemStatus(item.projectId, item.id, statusField.fieldId, option.id);
1125
+ return updated ? { success: true } : { success: false, error: "Failed to update status" };
1126
+ }
1112
1127
  /**
1113
1128
  * Find an item by issue number - direct lookup via issue's projectItems
1114
1129
  * Much faster than iterating through all project items
@@ -2480,31 +2495,41 @@ var SYNCABLE_KEYS = [
2480
2495
  "mainBranch",
2481
2496
  "branchPattern",
2482
2497
  "startWorkingStatus",
2483
- "doneStatus"
2498
+ "doneStatus",
2499
+ "prOpenedStatus",
2500
+ "prMergedStatus"
2484
2501
  ];
2485
2502
  var SETTING_DISPLAY_NAMES = {
2486
2503
  mainBranch: "Main Branch",
2487
2504
  branchPattern: "Branch Name Pattern",
2488
2505
  startWorkingStatus: "Start Working Status",
2489
- doneStatus: "Done/PR Merged Status"
2506
+ doneStatus: "Done Status",
2507
+ prOpenedStatus: "PR Opened Status",
2508
+ prMergedStatus: "PR Merged Status"
2490
2509
  };
2491
2510
  var VSCODE_TO_CLI_MAP = {
2492
2511
  "mainBranch": "mainBranch",
2493
2512
  "branchNamePattern": "branchPattern",
2494
2513
  "startWorkingStatus": "startWorkingStatus",
2495
- "prMergedStatus": "doneStatus"
2514
+ "doneStatus": "doneStatus",
2515
+ "prOpenedStatus": "prOpenedStatus",
2516
+ "prMergedStatus": "prMergedStatus"
2496
2517
  };
2497
2518
  var CLI_TO_VSCODE_MAP = {
2498
2519
  mainBranch: "mainBranch",
2499
2520
  branchPattern: "branchNamePattern",
2500
2521
  startWorkingStatus: "startWorkingStatus",
2501
- doneStatus: "prMergedStatus"
2522
+ doneStatus: "doneStatus",
2523
+ prOpenedStatus: "prOpenedStatus",
2524
+ prMergedStatus: "prMergedStatus"
2502
2525
  };
2503
2526
  var DEFAULT_VALUES = {
2504
2527
  mainBranch: "main",
2505
2528
  branchPattern: "{user}/{number}-{title}",
2506
2529
  startWorkingStatus: "In Progress",
2507
- doneStatus: "Done"
2530
+ doneStatus: "Done",
2531
+ prOpenedStatus: "In Review",
2532
+ prMergedStatus: "Ready for Beta"
2508
2533
  };
2509
2534
  function normalizeVSCodeSettings(vscodeSettings) {
2510
2535
  const result = {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bretwardjames/ghp-core",
3
- "version": "0.10.0",
3
+ "version": "0.11.0",
4
4
  "description": "Shared core library for GitHub Projects tools",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.js",