@bretwardjames/ghp-cli 0.1.1 → 0.1.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.
Files changed (49) hide show
  1. package/dist/branch-linker.d.ts +31 -9
  2. package/dist/branch-linker.d.ts.map +1 -1
  3. package/dist/branch-linker.js +61 -35
  4. package/dist/branch-linker.js.map +1 -1
  5. package/dist/commands/link-branch.d.ts.map +1 -1
  6. package/dist/commands/link-branch.js +20 -0
  7. package/dist/commands/link-branch.js.map +1 -1
  8. package/dist/commands/plan.d.ts.map +1 -1
  9. package/dist/commands/plan.js +235 -95
  10. package/dist/commands/plan.js.map +1 -1
  11. package/dist/commands/set-field.d.ts.map +1 -1
  12. package/dist/commands/set-field.js +25 -1
  13. package/dist/commands/set-field.js.map +1 -1
  14. package/dist/commands/start.d.ts.map +1 -1
  15. package/dist/commands/start.js +21 -0
  16. package/dist/commands/start.js.map +1 -1
  17. package/dist/commands/switch.d.ts.map +1 -1
  18. package/dist/commands/switch.js +20 -0
  19. package/dist/commands/switch.js.map +1 -1
  20. package/dist/commands/sync.d.ts +2 -0
  21. package/dist/commands/sync.d.ts.map +1 -0
  22. package/dist/commands/sync.js +77 -0
  23. package/dist/commands/sync.js.map +1 -0
  24. package/dist/commands/work.d.ts +5 -0
  25. package/dist/commands/work.d.ts.map +1 -1
  26. package/dist/commands/work.js +226 -36
  27. package/dist/commands/work.js.map +1 -1
  28. package/dist/config.d.ts +1 -0
  29. package/dist/config.d.ts.map +1 -1
  30. package/dist/config.js.map +1 -1
  31. package/dist/git-utils.d.ts +6 -52
  32. package/dist/git-utils.d.ts.map +1 -1
  33. package/dist/git-utils.js +7 -137
  34. package/dist/git-utils.js.map +1 -1
  35. package/dist/github-api.d.ts +17 -108
  36. package/dist/github-api.d.ts.map +1 -1
  37. package/dist/github-api.js +48 -579
  38. package/dist/github-api.js.map +1 -1
  39. package/dist/index.js +16 -2
  40. package/dist/index.js.map +1 -1
  41. package/dist/table.d.ts +16 -0
  42. package/dist/table.d.ts.map +1 -0
  43. package/dist/table.js +230 -0
  44. package/dist/table.js.map +1 -0
  45. package/dist/types.d.ts +6 -36
  46. package/dist/types.d.ts.map +1 -1
  47. package/dist/types.js +5 -0
  48. package/dist/types.js.map +1 -1
  49. package/package.json +2 -2
@@ -1,110 +1,19 @@
1
- import type { RepoInfo, ProjectItem, Project, StatusField } from './types.js';
2
- export declare class GitHubAPI {
3
- private graphqlWithAuth;
4
- username: string | null;
5
- /**
6
- * Get token from gh CLI or environment variable
7
- */
8
- getToken(): Promise<string | null>;
9
- /**
10
- * Authenticate with GitHub
11
- */
12
- authenticate(): Promise<boolean>;
13
- get isAuthenticated(): boolean;
14
- /**
15
- * Get projects linked to a repository
16
- */
17
- getProjects(repo: RepoInfo): Promise<Project[]>;
18
- /**
19
- * Get items from a project
20
- */
21
- getProjectItems(projectId: string, projectTitle: string): Promise<ProjectItem[]>;
22
- /**
23
- * Get the Status field info for a project
24
- */
25
- getStatusField(projectId: string): Promise<StatusField | null>;
26
- /**
27
- * Update an item's status
28
- */
29
- updateItemStatus(projectId: string, itemId: string, fieldId: string, optionId: string): Promise<boolean>;
30
- /**
31
- * Find an item by issue number across all projects for this repo
32
- */
33
- findItemByNumber(repo: RepoInfo, issueNumber: number): Promise<ProjectItem | null>;
34
- /**
35
- * Get all fields for a project
36
- */
37
- getProjectFields(projectId: string): Promise<Array<{
38
- id: string;
39
- name: string;
40
- type: string;
41
- options?: Array<{
42
- id: string;
43
- name: string;
44
- }>;
45
- }>>;
46
- /**
47
- * Set a field value on a project item
48
- */
49
- setFieldValue(projectId: string, itemId: string, fieldId: string, value: {
50
- text?: string;
51
- number?: number;
52
- singleSelectOptionId?: string;
53
- }): Promise<boolean>;
54
- /**
55
- * Create a new issue
56
- */
57
- createIssue(repo: RepoInfo, title: string, body?: string): Promise<{
58
- id: string;
59
- number: number;
60
- } | null>;
61
- /**
62
- * Add an issue to a project
63
- */
64
- addToProject(projectId: string, contentId: string): Promise<string | null>;
65
- /**
66
- * Get full issue details including body and comments
67
- */
68
- getIssueDetails(repo: RepoInfo, issueNumber: number): Promise<IssueDetails | null>;
69
- /**
70
- * Add a comment to an issue or PR
71
- */
72
- addComment(repo: RepoInfo, issueNumber: number, body: string): Promise<boolean>;
73
- /**
74
- * Get repository collaborators (for @ mention suggestions)
75
- */
76
- getCollaborators(repo: RepoInfo): Promise<Collaborator[]>;
77
- /**
78
- * Get recent issues (for # reference suggestions)
79
- */
80
- getRecentIssues(repo: RepoInfo, limit?: number): Promise<IssueReference[]>;
1
+ /**
2
+ * CLI-specific GitHub API wrapper.
3
+ *
4
+ * This module wraps the core GitHubAPI class with CLI-specific behavior:
5
+ * - Token from `gh auth token` or environment variables
6
+ * - Chalk-colored error messages
7
+ * - process.exit on auth errors
8
+ */
9
+ import { GitHubAPI as CoreGitHubAPI } from '@bretwardjames/ghp-core';
10
+ /**
11
+ * Extended GitHubAPI class for CLI with pre-configured token provider
12
+ */
13
+ declare class CLIGitHubAPI extends CoreGitHubAPI {
14
+ constructor();
81
15
  }
82
- export interface IssueDetails {
83
- title: string;
84
- body: string;
85
- state: string;
86
- type: 'issue' | 'pull_request';
87
- createdAt: string;
88
- author: string;
89
- labels: Array<{
90
- name: string;
91
- color: string;
92
- }>;
93
- comments: Array<{
94
- author: string;
95
- body: string;
96
- createdAt: string;
97
- }>;
98
- totalComments: number;
99
- }
100
- export interface Collaborator {
101
- login: string;
102
- name: string | null;
103
- }
104
- export interface IssueReference {
105
- number: number;
106
- title: string;
107
- state: string;
108
- }
109
- export declare const api: GitHubAPI;
16
+ export type { RepoInfo, Project, ProjectItem, StatusField, IssueDetails, Collaborator, IssueReference, } from '@bretwardjames/ghp-core';
17
+ export declare const api: CLIGitHubAPI;
18
+ export { CLIGitHubAPI as GitHubAPI };
110
19
  //# sourceMappingURL=github-api.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"github-api.d.ts","sourceRoot":"","sources":["../src/github-api.ts"],"names":[],"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