@bretwardjames/ghp-core 0.1.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 +1276 -0
- package/dist/index.d.cts +885 -0
- package/dist/index.d.ts +885 -0
- package/dist/index.js +1230 -0
- package/package.json +48 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,885 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Core types for GitHub Projects V2 API
|
|
3
|
+
*
|
|
4
|
+
* This module provides both:
|
|
5
|
+
* - Raw GraphQL response types (ProjectV2, ProjectV2Item, etc.) for full API access
|
|
6
|
+
* - Normalized types (ProjectItem, Project) for simplified usage
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Interface for providing authentication tokens.
|
|
10
|
+
* Implement this to integrate with different auth systems (CLI, VSCode, etc.)
|
|
11
|
+
*/
|
|
12
|
+
interface TokenProvider {
|
|
13
|
+
getToken(): Promise<string | null>;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Options for GitHubAPI constructor
|
|
17
|
+
*/
|
|
18
|
+
interface GitHubAPIOptions {
|
|
19
|
+
/** Provider for authentication tokens */
|
|
20
|
+
tokenProvider: TokenProvider;
|
|
21
|
+
/** Callback for authentication errors (scope issues, SSO, etc.) */
|
|
22
|
+
onAuthError?: (error: AuthError) => void;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Authentication error with details about what went wrong
|
|
26
|
+
*/
|
|
27
|
+
interface AuthError extends Error {
|
|
28
|
+
type: 'INSUFFICIENT_SCOPES' | 'SSO_REQUIRED' | 'TOKEN_EXPIRED' | 'UNKNOWN';
|
|
29
|
+
requiredScopes?: string[];
|
|
30
|
+
ssoUrl?: string;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Interface for persisting branch-issue links.
|
|
34
|
+
* Implement this for different storage backends (file system, VSCode state, etc.)
|
|
35
|
+
*/
|
|
36
|
+
interface StorageAdapter {
|
|
37
|
+
load(): BranchLink[] | Promise<BranchLink[]>;
|
|
38
|
+
save(links: BranchLink[]): void | Promise<void>;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* A link between a git branch and a GitHub issue/item
|
|
42
|
+
*/
|
|
43
|
+
interface BranchLink {
|
|
44
|
+
branch: string;
|
|
45
|
+
issueNumber: number;
|
|
46
|
+
issueTitle: string;
|
|
47
|
+
itemId: string;
|
|
48
|
+
repo: string;
|
|
49
|
+
linkedAt: string;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Options for git operations
|
|
53
|
+
*/
|
|
54
|
+
interface GitOptions {
|
|
55
|
+
/** Working directory for git commands. Defaults to process.cwd() */
|
|
56
|
+
cwd?: string;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Information about a GitHub repository
|
|
60
|
+
*/
|
|
61
|
+
interface RepoInfo {
|
|
62
|
+
owner: string;
|
|
63
|
+
name: string;
|
|
64
|
+
fullName: string;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* A simplified project representation
|
|
68
|
+
*/
|
|
69
|
+
interface Project {
|
|
70
|
+
id: string;
|
|
71
|
+
title: string;
|
|
72
|
+
number: number;
|
|
73
|
+
url: string;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* A normalized project item for display purposes
|
|
77
|
+
*/
|
|
78
|
+
interface ProjectItem {
|
|
79
|
+
id: string;
|
|
80
|
+
title: string;
|
|
81
|
+
number: number | null;
|
|
82
|
+
type: 'issue' | 'pull_request' | 'draft';
|
|
83
|
+
issueType: string | null;
|
|
84
|
+
status: string | null;
|
|
85
|
+
statusIndex: number;
|
|
86
|
+
state: 'open' | 'closed' | 'merged' | null;
|
|
87
|
+
assignees: string[];
|
|
88
|
+
labels: Array<{
|
|
89
|
+
name: string;
|
|
90
|
+
color: string;
|
|
91
|
+
}>;
|
|
92
|
+
repository: string | null;
|
|
93
|
+
url: string | null;
|
|
94
|
+
projectId: string;
|
|
95
|
+
projectTitle: string;
|
|
96
|
+
fields: Record<string, string>;
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Status field information for a project
|
|
100
|
+
*/
|
|
101
|
+
interface StatusField {
|
|
102
|
+
fieldId: string;
|
|
103
|
+
options: Array<{
|
|
104
|
+
id: string;
|
|
105
|
+
name: string;
|
|
106
|
+
}>;
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Full issue details including body and comments
|
|
110
|
+
*/
|
|
111
|
+
interface IssueDetails {
|
|
112
|
+
title: string;
|
|
113
|
+
body: string;
|
|
114
|
+
state: string;
|
|
115
|
+
type: 'issue' | 'pull_request';
|
|
116
|
+
createdAt: string;
|
|
117
|
+
author: string;
|
|
118
|
+
labels: Array<{
|
|
119
|
+
name: string;
|
|
120
|
+
color: string;
|
|
121
|
+
}>;
|
|
122
|
+
comments: Array<{
|
|
123
|
+
author: string;
|
|
124
|
+
body: string;
|
|
125
|
+
createdAt: string;
|
|
126
|
+
}>;
|
|
127
|
+
totalComments: number;
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* A repository collaborator
|
|
131
|
+
*/
|
|
132
|
+
interface Collaborator {
|
|
133
|
+
login: string;
|
|
134
|
+
name: string | null;
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* An issue reference (for autocomplete)
|
|
138
|
+
*/
|
|
139
|
+
interface IssueReference {
|
|
140
|
+
number: number;
|
|
141
|
+
title: string;
|
|
142
|
+
state: string;
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Raw GitHub Project V2 from GraphQL
|
|
146
|
+
*/
|
|
147
|
+
interface ProjectV2 {
|
|
148
|
+
id: string;
|
|
149
|
+
title: string;
|
|
150
|
+
number: number;
|
|
151
|
+
url: string;
|
|
152
|
+
closed?: boolean;
|
|
153
|
+
shortDescription?: string | null;
|
|
154
|
+
owner?: {
|
|
155
|
+
login: string;
|
|
156
|
+
__typename: 'User' | 'Organization';
|
|
157
|
+
};
|
|
158
|
+
fields?: {
|
|
159
|
+
nodes: ProjectV2Field[];
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* A field in a GitHub Project V2
|
|
164
|
+
*/
|
|
165
|
+
interface ProjectV2Field {
|
|
166
|
+
__typename: string;
|
|
167
|
+
id: string;
|
|
168
|
+
name: string;
|
|
169
|
+
options?: Array<{
|
|
170
|
+
id: string;
|
|
171
|
+
name: string;
|
|
172
|
+
color?: string;
|
|
173
|
+
}>;
|
|
174
|
+
}
|
|
175
|
+
/**
|
|
176
|
+
* A saved view in a GitHub Project (Board, Table, or Roadmap layout)
|
|
177
|
+
*/
|
|
178
|
+
interface ProjectV2View {
|
|
179
|
+
id: string;
|
|
180
|
+
name: string;
|
|
181
|
+
number: number;
|
|
182
|
+
layout: 'BOARD_LAYOUT' | 'TABLE_LAYOUT' | 'ROADMAP_LAYOUT';
|
|
183
|
+
groupByFields?: {
|
|
184
|
+
nodes: Array<{
|
|
185
|
+
__typename: string;
|
|
186
|
+
id: string;
|
|
187
|
+
name: string;
|
|
188
|
+
options?: Array<{
|
|
189
|
+
id: string;
|
|
190
|
+
name: string;
|
|
191
|
+
color?: string;
|
|
192
|
+
}>;
|
|
193
|
+
}>;
|
|
194
|
+
};
|
|
195
|
+
verticalGroupByFields?: {
|
|
196
|
+
nodes: Array<{
|
|
197
|
+
__typename: string;
|
|
198
|
+
id: string;
|
|
199
|
+
name: string;
|
|
200
|
+
}>;
|
|
201
|
+
};
|
|
202
|
+
sortByFields?: {
|
|
203
|
+
nodes: Array<{
|
|
204
|
+
__typename: string;
|
|
205
|
+
field: {
|
|
206
|
+
id: string;
|
|
207
|
+
name: string;
|
|
208
|
+
};
|
|
209
|
+
direction: 'ASC' | 'DESC';
|
|
210
|
+
}>;
|
|
211
|
+
};
|
|
212
|
+
filter?: string | null;
|
|
213
|
+
}
|
|
214
|
+
/**
|
|
215
|
+
* Extended project info with views and fields
|
|
216
|
+
*/
|
|
217
|
+
interface ProjectWithViews extends ProjectV2 {
|
|
218
|
+
views: ProjectV2View[];
|
|
219
|
+
fields: {
|
|
220
|
+
nodes: ProjectV2Field[];
|
|
221
|
+
};
|
|
222
|
+
}
|
|
223
|
+
/**
|
|
224
|
+
* Raw project item from GraphQL
|
|
225
|
+
*/
|
|
226
|
+
interface ProjectV2Item {
|
|
227
|
+
id: string;
|
|
228
|
+
type: 'ISSUE' | 'PULL_REQUEST' | 'DRAFT_ISSUE';
|
|
229
|
+
content: ProjectItemContent | null;
|
|
230
|
+
fieldValues: FieldValueConnection;
|
|
231
|
+
}
|
|
232
|
+
/**
|
|
233
|
+
* Content of a project item (Issue, PR, or Draft)
|
|
234
|
+
*/
|
|
235
|
+
interface ProjectItemContent {
|
|
236
|
+
__typename: 'Issue' | 'PullRequest' | 'DraftIssue';
|
|
237
|
+
title: string;
|
|
238
|
+
number?: number;
|
|
239
|
+
url?: string;
|
|
240
|
+
state?: 'OPEN' | 'CLOSED' | 'MERGED';
|
|
241
|
+
merged?: boolean;
|
|
242
|
+
issueType?: {
|
|
243
|
+
name: string;
|
|
244
|
+
} | null;
|
|
245
|
+
repository?: {
|
|
246
|
+
name: string;
|
|
247
|
+
owner?: {
|
|
248
|
+
login: string;
|
|
249
|
+
};
|
|
250
|
+
};
|
|
251
|
+
assignees?: {
|
|
252
|
+
nodes: Array<{
|
|
253
|
+
login: string;
|
|
254
|
+
avatarUrl?: string;
|
|
255
|
+
}>;
|
|
256
|
+
};
|
|
257
|
+
labels?: {
|
|
258
|
+
nodes: Array<{
|
|
259
|
+
name: string;
|
|
260
|
+
color: string;
|
|
261
|
+
}>;
|
|
262
|
+
};
|
|
263
|
+
}
|
|
264
|
+
/**
|
|
265
|
+
* Connection wrapper for field values
|
|
266
|
+
*/
|
|
267
|
+
interface FieldValueConnection {
|
|
268
|
+
nodes: FieldValue[];
|
|
269
|
+
}
|
|
270
|
+
/**
|
|
271
|
+
* Union type for all field value types
|
|
272
|
+
*/
|
|
273
|
+
type FieldValue = SingleSelectFieldValue | TextFieldValue | DateFieldValue | NumberFieldValue | IterationFieldValue;
|
|
274
|
+
interface SingleSelectFieldValue {
|
|
275
|
+
__typename: 'ProjectV2ItemFieldSingleSelectValue';
|
|
276
|
+
name: string;
|
|
277
|
+
field: {
|
|
278
|
+
name: string;
|
|
279
|
+
};
|
|
280
|
+
}
|
|
281
|
+
interface TextFieldValue {
|
|
282
|
+
__typename: 'ProjectV2ItemFieldTextValue';
|
|
283
|
+
text: string;
|
|
284
|
+
field: {
|
|
285
|
+
name: string;
|
|
286
|
+
};
|
|
287
|
+
}
|
|
288
|
+
interface DateFieldValue {
|
|
289
|
+
__typename: 'ProjectV2ItemFieldDateValue';
|
|
290
|
+
date: string;
|
|
291
|
+
field: {
|
|
292
|
+
name: string;
|
|
293
|
+
};
|
|
294
|
+
}
|
|
295
|
+
interface NumberFieldValue {
|
|
296
|
+
__typename: 'ProjectV2ItemFieldNumberValue';
|
|
297
|
+
number: number;
|
|
298
|
+
field: {
|
|
299
|
+
name: string;
|
|
300
|
+
};
|
|
301
|
+
}
|
|
302
|
+
interface IterationFieldValue {
|
|
303
|
+
__typename: 'ProjectV2ItemFieldIterationValue';
|
|
304
|
+
title: string;
|
|
305
|
+
startDate: string;
|
|
306
|
+
duration: number;
|
|
307
|
+
field: {
|
|
308
|
+
name: string;
|
|
309
|
+
};
|
|
310
|
+
}
|
|
311
|
+
interface ProjectsQueryResponse {
|
|
312
|
+
viewer: {
|
|
313
|
+
login: string;
|
|
314
|
+
projectsV2: {
|
|
315
|
+
nodes: ProjectV2[];
|
|
316
|
+
};
|
|
317
|
+
};
|
|
318
|
+
}
|
|
319
|
+
interface ProjectItemsQueryResponse {
|
|
320
|
+
node: {
|
|
321
|
+
items: {
|
|
322
|
+
pageInfo: {
|
|
323
|
+
hasNextPage: boolean;
|
|
324
|
+
endCursor: string | null;
|
|
325
|
+
};
|
|
326
|
+
nodes: ProjectV2Item[];
|
|
327
|
+
};
|
|
328
|
+
};
|
|
329
|
+
}
|
|
330
|
+
/**
|
|
331
|
+
* Configuration for connecting to a GitHub Project
|
|
332
|
+
*/
|
|
333
|
+
interface ProjectConfig {
|
|
334
|
+
owner: string;
|
|
335
|
+
projectNumber: number;
|
|
336
|
+
type: 'user' | 'organization';
|
|
337
|
+
}
|
|
338
|
+
/**
|
|
339
|
+
* Label information with optional color
|
|
340
|
+
*/
|
|
341
|
+
interface LabelInfo {
|
|
342
|
+
name: string;
|
|
343
|
+
color: string | null;
|
|
344
|
+
}
|
|
345
|
+
/**
|
|
346
|
+
* Field information with value and color
|
|
347
|
+
*/
|
|
348
|
+
interface FieldInfo {
|
|
349
|
+
value: string;
|
|
350
|
+
color: string | null;
|
|
351
|
+
}
|
|
352
|
+
/**
|
|
353
|
+
* Assignee information
|
|
354
|
+
*/
|
|
355
|
+
interface AssigneeInfo {
|
|
356
|
+
login: string;
|
|
357
|
+
avatarUrl: string | null;
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
/**
|
|
361
|
+
* GitHub API client for Projects V2.
|
|
362
|
+
*
|
|
363
|
+
* This class is auth-agnostic - it uses a TokenProvider interface to get
|
|
364
|
+
* authentication tokens, making it work with both CLI and IDE environments.
|
|
365
|
+
*
|
|
366
|
+
* @example CLI usage:
|
|
367
|
+
* ```typescript
|
|
368
|
+
* const api = new GitHubAPI({
|
|
369
|
+
* tokenProvider: {
|
|
370
|
+
* async getToken() {
|
|
371
|
+
* const { stdout } = await exec('gh auth token');
|
|
372
|
+
* return stdout.trim();
|
|
373
|
+
* }
|
|
374
|
+
* },
|
|
375
|
+
* onAuthError: (err) => { console.error(err.message); process.exit(1); }
|
|
376
|
+
* });
|
|
377
|
+
* ```
|
|
378
|
+
*
|
|
379
|
+
* @example VSCode usage:
|
|
380
|
+
* ```typescript
|
|
381
|
+
* const api = new GitHubAPI({
|
|
382
|
+
* tokenProvider: {
|
|
383
|
+
* async getToken() {
|
|
384
|
+
* const session = await vscode.authentication.getSession('github', ['project']);
|
|
385
|
+
* return session?.accessToken ?? null;
|
|
386
|
+
* }
|
|
387
|
+
* }
|
|
388
|
+
* });
|
|
389
|
+
* ```
|
|
390
|
+
*/
|
|
391
|
+
|
|
392
|
+
declare class GitHubAPI {
|
|
393
|
+
private graphqlWithAuth;
|
|
394
|
+
private tokenProvider;
|
|
395
|
+
private onAuthError?;
|
|
396
|
+
username: string | null;
|
|
397
|
+
constructor(options: GitHubAPIOptions);
|
|
398
|
+
/**
|
|
399
|
+
* Handle authentication errors by calling the error handler or throwing
|
|
400
|
+
*/
|
|
401
|
+
private handleAuthError;
|
|
402
|
+
/**
|
|
403
|
+
* Authenticate with GitHub using the token provider
|
|
404
|
+
*/
|
|
405
|
+
authenticate(): Promise<boolean>;
|
|
406
|
+
get isAuthenticated(): boolean;
|
|
407
|
+
/**
|
|
408
|
+
* Get the current token (for REST API calls)
|
|
409
|
+
*/
|
|
410
|
+
getToken(): Promise<string | null>;
|
|
411
|
+
/**
|
|
412
|
+
* Get projects linked to a repository
|
|
413
|
+
*/
|
|
414
|
+
getProjects(repo: RepoInfo): Promise<Project[]>;
|
|
415
|
+
/**
|
|
416
|
+
* Get items from a project
|
|
417
|
+
*/
|
|
418
|
+
getProjectItems(projectId: string, projectTitle: string): Promise<ProjectItem[]>;
|
|
419
|
+
/**
|
|
420
|
+
* Get the Status field info for a project
|
|
421
|
+
*/
|
|
422
|
+
getStatusField(projectId: string): Promise<StatusField | null>;
|
|
423
|
+
/**
|
|
424
|
+
* Get project views
|
|
425
|
+
*/
|
|
426
|
+
getProjectViews(projectId: string): Promise<Array<{
|
|
427
|
+
name: string;
|
|
428
|
+
filter: string | null;
|
|
429
|
+
}>>;
|
|
430
|
+
/**
|
|
431
|
+
* Update an item's status
|
|
432
|
+
*/
|
|
433
|
+
updateItemStatus(projectId: string, itemId: string, fieldId: string, optionId: string): Promise<boolean>;
|
|
434
|
+
/**
|
|
435
|
+
* Find an item by issue number across all projects for this repo
|
|
436
|
+
*/
|
|
437
|
+
findItemByNumber(repo: RepoInfo, issueNumber: number): Promise<ProjectItem | null>;
|
|
438
|
+
/**
|
|
439
|
+
* Get all fields for a project
|
|
440
|
+
*/
|
|
441
|
+
getProjectFields(projectId: string): Promise<Array<{
|
|
442
|
+
id: string;
|
|
443
|
+
name: string;
|
|
444
|
+
type: string;
|
|
445
|
+
options?: Array<{
|
|
446
|
+
id: string;
|
|
447
|
+
name: string;
|
|
448
|
+
}>;
|
|
449
|
+
}>>;
|
|
450
|
+
/**
|
|
451
|
+
* Set a field value on a project item
|
|
452
|
+
*/
|
|
453
|
+
setFieldValue(projectId: string, itemId: string, fieldId: string, value: {
|
|
454
|
+
text?: string;
|
|
455
|
+
number?: number;
|
|
456
|
+
singleSelectOptionId?: string;
|
|
457
|
+
}): Promise<boolean>;
|
|
458
|
+
/**
|
|
459
|
+
* Create a new issue
|
|
460
|
+
*/
|
|
461
|
+
createIssue(repo: RepoInfo, title: string, body?: string): Promise<{
|
|
462
|
+
id: string;
|
|
463
|
+
number: number;
|
|
464
|
+
} | null>;
|
|
465
|
+
/**
|
|
466
|
+
* Add an issue to a project
|
|
467
|
+
*/
|
|
468
|
+
addToProject(projectId: string, contentId: string): Promise<string | null>;
|
|
469
|
+
/**
|
|
470
|
+
* Get full issue details including body and comments
|
|
471
|
+
*/
|
|
472
|
+
getIssueDetails(repo: RepoInfo, issueNumber: number): Promise<IssueDetails | null>;
|
|
473
|
+
/**
|
|
474
|
+
* Add a comment to an issue or PR
|
|
475
|
+
*/
|
|
476
|
+
addComment(repo: RepoInfo, issueNumber: number, body: string): Promise<boolean>;
|
|
477
|
+
/**
|
|
478
|
+
* Get repository collaborators (for @ mention suggestions)
|
|
479
|
+
*/
|
|
480
|
+
getCollaborators(repo: RepoInfo): Promise<Collaborator[]>;
|
|
481
|
+
/**
|
|
482
|
+
* Get recent issues (for # reference suggestions)
|
|
483
|
+
*/
|
|
484
|
+
getRecentIssues(repo: RepoInfo, limit?: number): Promise<IssueReference[]>;
|
|
485
|
+
/**
|
|
486
|
+
* Get the active label name for a user
|
|
487
|
+
*/
|
|
488
|
+
getActiveLabelName(): string;
|
|
489
|
+
/**
|
|
490
|
+
* Ensure a label exists in the repository, create if it doesn't
|
|
491
|
+
*/
|
|
492
|
+
ensureLabel(repo: RepoInfo, labelName: string, color?: string): Promise<boolean>;
|
|
493
|
+
/**
|
|
494
|
+
* Add a label to an issue
|
|
495
|
+
*/
|
|
496
|
+
addLabelToIssue(repo: RepoInfo, issueNumber: number, labelName: string): Promise<boolean>;
|
|
497
|
+
/**
|
|
498
|
+
* Remove a label from an issue
|
|
499
|
+
*/
|
|
500
|
+
removeLabelFromIssue(repo: RepoInfo, issueNumber: number, labelName: string): Promise<boolean>;
|
|
501
|
+
/**
|
|
502
|
+
* Find all issues with a specific label
|
|
503
|
+
*/
|
|
504
|
+
findIssuesWithLabel(repo: RepoInfo, labelName: string): Promise<number[]>;
|
|
505
|
+
/**
|
|
506
|
+
* Get available issue types for a repository
|
|
507
|
+
*/
|
|
508
|
+
getIssueTypes(repo: RepoInfo): Promise<Array<{
|
|
509
|
+
id: string;
|
|
510
|
+
name: string;
|
|
511
|
+
}>>;
|
|
512
|
+
/**
|
|
513
|
+
* Set the issue type on an issue
|
|
514
|
+
*/
|
|
515
|
+
setIssueType(repo: RepoInfo, issueNumber: number, issueTypeId: string): Promise<boolean>;
|
|
516
|
+
}
|
|
517
|
+
|
|
518
|
+
/**
|
|
519
|
+
* Branch-issue linking with pluggable storage.
|
|
520
|
+
*
|
|
521
|
+
* The BranchLinker class manages associations between git branches and GitHub issues.
|
|
522
|
+
* Storage is abstracted via the StorageAdapter interface, allowing different backends:
|
|
523
|
+
* - File system (for CLI)
|
|
524
|
+
* - VSCode workspaceState (for extensions)
|
|
525
|
+
* - In-memory (for testing)
|
|
526
|
+
*
|
|
527
|
+
* @example CLI usage with file storage:
|
|
528
|
+
* ```typescript
|
|
529
|
+
* import { readFileSync, writeFileSync, existsSync, mkdirSync } from 'fs';
|
|
530
|
+
* import { homedir } from 'os';
|
|
531
|
+
* import { join } from 'path';
|
|
532
|
+
*
|
|
533
|
+
* const DATA_DIR = join(homedir(), '.config', 'ghp-cli');
|
|
534
|
+
* const LINKS_FILE = join(DATA_DIR, 'branch-links.json');
|
|
535
|
+
*
|
|
536
|
+
* const fileAdapter: StorageAdapter = {
|
|
537
|
+
* load() {
|
|
538
|
+
* if (existsSync(LINKS_FILE)) {
|
|
539
|
+
* return JSON.parse(readFileSync(LINKS_FILE, 'utf-8'));
|
|
540
|
+
* }
|
|
541
|
+
* return [];
|
|
542
|
+
* },
|
|
543
|
+
* save(links) {
|
|
544
|
+
* if (!existsSync(DATA_DIR)) {
|
|
545
|
+
* mkdirSync(DATA_DIR, { recursive: true });
|
|
546
|
+
* }
|
|
547
|
+
* writeFileSync(LINKS_FILE, JSON.stringify(links, null, 2));
|
|
548
|
+
* }
|
|
549
|
+
* };
|
|
550
|
+
*
|
|
551
|
+
* const linker = new BranchLinker(fileAdapter);
|
|
552
|
+
* ```
|
|
553
|
+
*
|
|
554
|
+
* @example VSCode usage with workspaceState:
|
|
555
|
+
* ```typescript
|
|
556
|
+
* const vscodeAdapter: StorageAdapter = {
|
|
557
|
+
* load() {
|
|
558
|
+
* return context.workspaceState.get<BranchLink[]>('branchLinks', []);
|
|
559
|
+
* },
|
|
560
|
+
* save(links) {
|
|
561
|
+
* context.workspaceState.update('branchLinks', links);
|
|
562
|
+
* }
|
|
563
|
+
* };
|
|
564
|
+
*
|
|
565
|
+
* const linker = new BranchLinker(vscodeAdapter);
|
|
566
|
+
* ```
|
|
567
|
+
*/
|
|
568
|
+
|
|
569
|
+
/**
|
|
570
|
+
* Manages branch-issue links using a pluggable storage adapter.
|
|
571
|
+
*/
|
|
572
|
+
declare class BranchLinker {
|
|
573
|
+
private storage;
|
|
574
|
+
constructor(storage: StorageAdapter);
|
|
575
|
+
/**
|
|
576
|
+
* Load links from storage (handles both sync and async adapters)
|
|
577
|
+
*/
|
|
578
|
+
private loadLinks;
|
|
579
|
+
/**
|
|
580
|
+
* Save links to storage (handles both sync and async adapters)
|
|
581
|
+
*/
|
|
582
|
+
private saveLinks;
|
|
583
|
+
/**
|
|
584
|
+
* Create a link between a branch and an issue.
|
|
585
|
+
* If a link already exists for this branch or issue in this repo, it will be replaced.
|
|
586
|
+
*/
|
|
587
|
+
link(branch: string, issueNumber: number, issueTitle: string, itemId: string, repo: string): Promise<void>;
|
|
588
|
+
/**
|
|
589
|
+
* Remove the link for an issue.
|
|
590
|
+
* @returns true if a link was removed, false if no link existed
|
|
591
|
+
*/
|
|
592
|
+
unlink(repo: string, issueNumber: number): Promise<boolean>;
|
|
593
|
+
/**
|
|
594
|
+
* Remove the link for a branch.
|
|
595
|
+
* @returns true if a link was removed, false if no link existed
|
|
596
|
+
*/
|
|
597
|
+
unlinkBranch(repo: string, branch: string): Promise<boolean>;
|
|
598
|
+
/**
|
|
599
|
+
* Get the branch linked to an issue.
|
|
600
|
+
*/
|
|
601
|
+
getBranchForIssue(repo: string, issueNumber: number): Promise<string | null>;
|
|
602
|
+
/**
|
|
603
|
+
* Get the full link info for a branch.
|
|
604
|
+
*/
|
|
605
|
+
getLinkForBranch(repo: string, branch: string): Promise<BranchLink | null>;
|
|
606
|
+
/**
|
|
607
|
+
* Get the full link info for an issue.
|
|
608
|
+
*/
|
|
609
|
+
getLinkForIssue(repo: string, issueNumber: number): Promise<BranchLink | null>;
|
|
610
|
+
/**
|
|
611
|
+
* Get all links for a repository.
|
|
612
|
+
*/
|
|
613
|
+
getLinksForRepo(repo: string): Promise<BranchLink[]>;
|
|
614
|
+
/**
|
|
615
|
+
* Get all links.
|
|
616
|
+
*/
|
|
617
|
+
getAllLinks(): Promise<BranchLink[]>;
|
|
618
|
+
/**
|
|
619
|
+
* Check if a branch has a link.
|
|
620
|
+
*/
|
|
621
|
+
hasLinkForBranch(repo: string, branch: string): Promise<boolean>;
|
|
622
|
+
/**
|
|
623
|
+
* Check if an issue has a link.
|
|
624
|
+
*/
|
|
625
|
+
hasLinkForIssue(repo: string, issueNumber: number): Promise<boolean>;
|
|
626
|
+
}
|
|
627
|
+
/**
|
|
628
|
+
* Create an in-memory storage adapter for testing.
|
|
629
|
+
*/
|
|
630
|
+
declare function createInMemoryAdapter(): StorageAdapter & {
|
|
631
|
+
links: BranchLink[];
|
|
632
|
+
};
|
|
633
|
+
|
|
634
|
+
/**
|
|
635
|
+
* Git utility functions for working with local repositories.
|
|
636
|
+
*
|
|
637
|
+
* All functions accept an optional `options.cwd` parameter to specify
|
|
638
|
+
* the working directory. This makes the library usable in both CLI
|
|
639
|
+
* contexts (process.cwd()) and IDE contexts (workspace folder).
|
|
640
|
+
*/
|
|
641
|
+
|
|
642
|
+
/**
|
|
643
|
+
* Detect the GitHub repository from the current directory's git remote
|
|
644
|
+
*/
|
|
645
|
+
declare function detectRepository(options?: GitOptions): Promise<RepoInfo | null>;
|
|
646
|
+
/**
|
|
647
|
+
* Get the current git branch
|
|
648
|
+
*/
|
|
649
|
+
declare function getCurrentBranch(options?: GitOptions): Promise<string | null>;
|
|
650
|
+
/**
|
|
651
|
+
* Check if there are uncommitted changes
|
|
652
|
+
*/
|
|
653
|
+
declare function hasUncommittedChanges(options?: GitOptions): Promise<boolean>;
|
|
654
|
+
/**
|
|
655
|
+
* Check if a branch exists locally
|
|
656
|
+
*/
|
|
657
|
+
declare function branchExists(branchName: string, options?: GitOptions): Promise<boolean>;
|
|
658
|
+
/**
|
|
659
|
+
* Create and checkout a new branch
|
|
660
|
+
*/
|
|
661
|
+
declare function createBranch(branchName: string, options?: GitOptions): Promise<void>;
|
|
662
|
+
/**
|
|
663
|
+
* Checkout an existing branch
|
|
664
|
+
*/
|
|
665
|
+
declare function checkoutBranch(branchName: string, options?: GitOptions): Promise<void>;
|
|
666
|
+
/**
|
|
667
|
+
* Pull latest from origin
|
|
668
|
+
*/
|
|
669
|
+
declare function pullLatest(options?: GitOptions): Promise<void>;
|
|
670
|
+
/**
|
|
671
|
+
* Fetch from origin
|
|
672
|
+
*/
|
|
673
|
+
declare function fetchOrigin(options?: GitOptions): Promise<void>;
|
|
674
|
+
/**
|
|
675
|
+
* Get number of commits behind origin
|
|
676
|
+
*/
|
|
677
|
+
declare function getCommitsBehind(branch: string, options?: GitOptions): Promise<number>;
|
|
678
|
+
/**
|
|
679
|
+
* Get number of commits ahead of origin
|
|
680
|
+
*/
|
|
681
|
+
declare function getCommitsAhead(branch: string, options?: GitOptions): Promise<number>;
|
|
682
|
+
/**
|
|
683
|
+
* Check if working directory is a git repository
|
|
684
|
+
*/
|
|
685
|
+
declare function isGitRepository(options?: GitOptions): Promise<boolean>;
|
|
686
|
+
/**
|
|
687
|
+
* Get the root directory of the git repository
|
|
688
|
+
*/
|
|
689
|
+
declare function getRepositoryRoot(options?: GitOptions): Promise<string | null>;
|
|
690
|
+
/**
|
|
691
|
+
* Sanitize a string for use in a branch name
|
|
692
|
+
*/
|
|
693
|
+
declare function sanitizeForBranchName(str: string): string;
|
|
694
|
+
/**
|
|
695
|
+
* Generate a branch name from a pattern
|
|
696
|
+
*/
|
|
697
|
+
declare function generateBranchName(pattern: string, vars: {
|
|
698
|
+
user: string;
|
|
699
|
+
number: number | null;
|
|
700
|
+
title: string;
|
|
701
|
+
repo: string;
|
|
702
|
+
}, maxLength?: number): string;
|
|
703
|
+
/**
|
|
704
|
+
* Get the default branch name (main or master)
|
|
705
|
+
*/
|
|
706
|
+
declare function getDefaultBranch(options?: GitOptions): Promise<string>;
|
|
707
|
+
|
|
708
|
+
/**
|
|
709
|
+
* URL parsing utilities for GitHub repositories and issues.
|
|
710
|
+
*/
|
|
711
|
+
|
|
712
|
+
/**
|
|
713
|
+
* Parse a GitHub URL into owner and repo name.
|
|
714
|
+
* Supports both SSH and HTTPS formats.
|
|
715
|
+
*
|
|
716
|
+
* @example
|
|
717
|
+
* parseGitHubUrl('git@github.com:owner/repo.git')
|
|
718
|
+
* // => { owner: 'owner', name: 'repo', fullName: 'owner/repo' }
|
|
719
|
+
*
|
|
720
|
+
* @example
|
|
721
|
+
* parseGitHubUrl('https://github.com/owner/repo')
|
|
722
|
+
* // => { owner: 'owner', name: 'repo', fullName: 'owner/repo' }
|
|
723
|
+
*/
|
|
724
|
+
declare function parseGitHubUrl(url: string): RepoInfo | null;
|
|
725
|
+
/**
|
|
726
|
+
* Parse a GitHub issue/PR URL to extract repo and number.
|
|
727
|
+
*
|
|
728
|
+
* @example
|
|
729
|
+
* parseIssueUrl('https://github.com/owner/repo/issues/123')
|
|
730
|
+
* // => { owner: 'owner', repo: 'repo', number: 123, type: 'issue' }
|
|
731
|
+
*/
|
|
732
|
+
declare function parseIssueUrl(url: string): {
|
|
733
|
+
owner: string;
|
|
734
|
+
repo: string;
|
|
735
|
+
number: number;
|
|
736
|
+
type: 'issue' | 'pull';
|
|
737
|
+
} | null;
|
|
738
|
+
/**
|
|
739
|
+
* Build a GitHub issue URL from components.
|
|
740
|
+
*/
|
|
741
|
+
declare function buildIssueUrl(owner: string, repo: string, number: number): string;
|
|
742
|
+
/**
|
|
743
|
+
* Build a GitHub pull request URL from components.
|
|
744
|
+
*/
|
|
745
|
+
declare function buildPullRequestUrl(owner: string, repo: string, number: number): string;
|
|
746
|
+
/**
|
|
747
|
+
* Build a GitHub repository URL from components.
|
|
748
|
+
*/
|
|
749
|
+
declare function buildRepoUrl(owner: string, repo: string): string;
|
|
750
|
+
/**
|
|
751
|
+
* Build a GitHub project URL from components.
|
|
752
|
+
*/
|
|
753
|
+
declare function buildProjectUrl(owner: string, projectNumber: number): string;
|
|
754
|
+
/**
|
|
755
|
+
* Build an organization project URL.
|
|
756
|
+
*/
|
|
757
|
+
declare function buildOrgProjectUrl(org: string, projectNumber: number): string;
|
|
758
|
+
|
|
759
|
+
/**
|
|
760
|
+
* GraphQL query strings for GitHub Projects V2 API.
|
|
761
|
+
*
|
|
762
|
+
* These queries are extracted for reusability and testability.
|
|
763
|
+
* Each query is a template string that can be used with @octokit/graphql.
|
|
764
|
+
*/
|
|
765
|
+
/**
|
|
766
|
+
* Query to get the current authenticated user
|
|
767
|
+
*/
|
|
768
|
+
declare const VIEWER_QUERY = "\n query {\n viewer {\n login\n }\n }\n";
|
|
769
|
+
/**
|
|
770
|
+
* Query to get projects linked to a repository
|
|
771
|
+
*/
|
|
772
|
+
declare const REPOSITORY_PROJECTS_QUERY = "\n query($owner: String!, $name: String!) {\n repository(owner: $owner, name: $name) {\n projectsV2(first: 20) {\n nodes {\n id\n title\n number\n url\n }\n }\n }\n }\n";
|
|
773
|
+
/**
|
|
774
|
+
* Query to get the repository ID
|
|
775
|
+
*/
|
|
776
|
+
declare const REPOSITORY_ID_QUERY = "\n query($owner: String!, $name: String!) {\n repository(owner: $owner, name: $name) {\n id\n }\n }\n";
|
|
777
|
+
/**
|
|
778
|
+
* Query to get project items with all field values
|
|
779
|
+
*/
|
|
780
|
+
declare const PROJECT_ITEMS_QUERY = "\n query($projectId: ID!) {\n node(id: $projectId) {\n ... on ProjectV2 {\n items(first: 100) {\n nodes {\n id\n fieldValues(first: 20) {\n nodes {\n __typename\n ... on ProjectV2ItemFieldSingleSelectValue {\n name\n field { ... on ProjectV2SingleSelectField { name } }\n }\n ... on ProjectV2ItemFieldTextValue {\n text\n field { ... on ProjectV2Field { name } }\n }\n ... on ProjectV2ItemFieldNumberValue {\n number\n field { ... on ProjectV2Field { name } }\n }\n ... on ProjectV2ItemFieldDateValue {\n date\n field { ... on ProjectV2Field { name } }\n }\n ... on ProjectV2ItemFieldIterationValue {\n title\n field { ... on ProjectV2IterationField { name } }\n }\n }\n }\n content {\n __typename\n ... on Issue {\n title\n number\n url\n state\n issueType { name }\n assignees(first: 5) { nodes { login } }\n labels(first: 10) { nodes { name color } }\n repository { name }\n }\n ... on PullRequest {\n title\n number\n url\n state\n merged\n assignees(first: 5) { nodes { login } }\n labels(first: 10) { nodes { name color } }\n repository { name }\n }\n ... on DraftIssue {\n title\n }\n }\n }\n }\n }\n }\n }\n";
|
|
781
|
+
/**
|
|
782
|
+
* Query to get project fields (including status options)
|
|
783
|
+
*/
|
|
784
|
+
declare const PROJECT_FIELDS_QUERY = "\n query($projectId: ID!) {\n node(id: $projectId) {\n ... on ProjectV2 {\n fields(first: 30) {\n nodes {\n __typename\n ... on ProjectV2Field {\n id\n name\n }\n ... on ProjectV2SingleSelectField {\n id\n name\n options { id name }\n }\n ... on ProjectV2IterationField {\n id\n name\n }\n }\n }\n }\n }\n }\n";
|
|
785
|
+
/**
|
|
786
|
+
* Query to get project views
|
|
787
|
+
*/
|
|
788
|
+
declare const PROJECT_VIEWS_QUERY = "\n query($projectId: ID!) {\n node(id: $projectId) {\n ... on ProjectV2 {\n views(first: 20) {\n nodes {\n name\n filter\n }\n }\n }\n }\n }\n";
|
|
789
|
+
/**
|
|
790
|
+
* Mutation to update a project item field value
|
|
791
|
+
*/
|
|
792
|
+
declare const UPDATE_ITEM_FIELD_MUTATION = "\n mutation($projectId: ID!, $itemId: ID!, $fieldId: ID!, $value: ProjectV2FieldValue!) {\n updateProjectV2ItemFieldValue(input: {\n projectId: $projectId\n itemId: $itemId\n fieldId: $fieldId\n value: $value\n }) {\n projectV2Item { id }\n }\n }\n";
|
|
793
|
+
/**
|
|
794
|
+
* Legacy mutation for updating single select field (status)
|
|
795
|
+
*/
|
|
796
|
+
declare const UPDATE_ITEM_STATUS_MUTATION = "\n mutation($projectId: ID!, $itemId: ID!, $fieldId: ID!, $optionId: String!) {\n updateProjectV2ItemFieldValue(input: {\n projectId: $projectId\n itemId: $itemId\n fieldId: $fieldId\n value: { singleSelectOptionId: $optionId }\n }) {\n projectV2Item { id }\n }\n }\n";
|
|
797
|
+
/**
|
|
798
|
+
* Mutation to create a new issue
|
|
799
|
+
*/
|
|
800
|
+
declare const CREATE_ISSUE_MUTATION = "\n mutation($repositoryId: ID!, $title: String!, $body: String) {\n createIssue(input: {\n repositoryId: $repositoryId\n title: $title\n body: $body\n }) {\n issue {\n id\n number\n }\n }\n }\n";
|
|
801
|
+
/**
|
|
802
|
+
* Mutation to add an item to a project
|
|
803
|
+
*/
|
|
804
|
+
declare const ADD_TO_PROJECT_MUTATION = "\n mutation($projectId: ID!, $contentId: ID!) {\n addProjectV2ItemById(input: {\n projectId: $projectId\n contentId: $contentId\n }) {\n item { id }\n }\n }\n";
|
|
805
|
+
/**
|
|
806
|
+
* Query to get full issue details including comments
|
|
807
|
+
*/
|
|
808
|
+
declare const ISSUE_DETAILS_QUERY = "\n query($owner: String!, $name: String!, $number: Int!) {\n repository(owner: $owner, name: $name) {\n issueOrPullRequest(number: $number) {\n __typename\n ... on Issue {\n title\n body\n state\n createdAt\n author { login }\n labels(first: 10) { nodes { name color } }\n comments(first: 50) {\n totalCount\n nodes {\n author { login }\n body\n createdAt\n }\n }\n }\n ... on PullRequest {\n title\n body\n state\n createdAt\n author { login }\n labels(first: 10) { nodes { name color } }\n comments(first: 50) {\n totalCount\n nodes {\n author { login }\n body\n createdAt\n }\n }\n }\n }\n }\n }\n";
|
|
809
|
+
/**
|
|
810
|
+
* Query to get issue/PR node ID
|
|
811
|
+
*/
|
|
812
|
+
declare const ISSUE_NODE_ID_QUERY = "\n query($owner: String!, $name: String!, $number: Int!) {\n repository(owner: $owner, name: $name) {\n issueOrPullRequest(number: $number) {\n ... on Issue { id }\n ... on PullRequest { id }\n }\n }\n }\n";
|
|
813
|
+
/**
|
|
814
|
+
* Mutation to add a comment
|
|
815
|
+
*/
|
|
816
|
+
declare const ADD_COMMENT_MUTATION = "\n mutation($subjectId: ID!, $body: String!) {\n addComment(input: { subjectId: $subjectId, body: $body }) {\n commentEdge {\n node { id }\n }\n }\n }\n";
|
|
817
|
+
/**
|
|
818
|
+
* Query to get repository collaborators
|
|
819
|
+
*/
|
|
820
|
+
declare const COLLABORATORS_QUERY = "\n query($owner: String!, $name: String!) {\n repository(owner: $owner, name: $name) {\n collaborators(first: 50) {\n nodes { login name }\n }\n assignableUsers(first: 50) {\n nodes { login name }\n }\n }\n }\n";
|
|
821
|
+
/**
|
|
822
|
+
* Query to get recent issues
|
|
823
|
+
*/
|
|
824
|
+
declare const RECENT_ISSUES_QUERY = "\n query($owner: String!, $name: String!, $limit: Int!) {\n repository(owner: $owner, name: $name) {\n issues(first: $limit, orderBy: { field: UPDATED_AT, direction: DESC }) {\n nodes {\n number\n title\n state\n }\n }\n }\n }\n";
|
|
825
|
+
/**
|
|
826
|
+
* Query to check if a label exists
|
|
827
|
+
*/
|
|
828
|
+
declare const LABEL_EXISTS_QUERY = "\n query($owner: String!, $name: String!, $labelName: String!) {\n repository(owner: $owner, name: $name) {\n label(name: $labelName) {\n id\n }\n }\n }\n";
|
|
829
|
+
/**
|
|
830
|
+
* Query to get issue and label IDs for adding labels
|
|
831
|
+
*/
|
|
832
|
+
declare const ISSUE_AND_LABEL_QUERY = "\n query($owner: String!, $name: String!, $number: Int!, $labelName: String!) {\n repository(owner: $owner, name: $name) {\n issue(number: $number) {\n id\n }\n label(name: $labelName) {\n id\n }\n }\n }\n";
|
|
833
|
+
/**
|
|
834
|
+
* Mutation to add labels to an issue
|
|
835
|
+
*/
|
|
836
|
+
declare const ADD_LABELS_MUTATION = "\n mutation($issueId: ID!, $labelIds: [ID!]!) {\n addLabelsToLabelable(input: { labelableId: $issueId, labelIds: $labelIds }) {\n clientMutationId\n }\n }\n";
|
|
837
|
+
/**
|
|
838
|
+
* Mutation to remove labels from an issue
|
|
839
|
+
*/
|
|
840
|
+
declare const REMOVE_LABELS_MUTATION = "\n mutation($issueId: ID!, $labelIds: [ID!]!) {\n removeLabelsFromLabelable(input: { labelableId: $issueId, labelIds: $labelIds }) {\n clientMutationId\n }\n }\n";
|
|
841
|
+
/**
|
|
842
|
+
* Query to find issues with a specific label
|
|
843
|
+
*/
|
|
844
|
+
declare const ISSUES_WITH_LABEL_QUERY = "\n query($owner: String!, $name: String!, $labels: [String!]) {\n repository(owner: $owner, name: $name) {\n issues(first: 10, labels: $labels, states: [OPEN]) {\n nodes {\n number\n }\n }\n }\n }\n";
|
|
845
|
+
/**
|
|
846
|
+
* Query to get available issue types for a repository
|
|
847
|
+
*/
|
|
848
|
+
declare const ISSUE_TYPES_QUERY = "\n query($owner: String!, $name: String!) {\n repository(owner: $owner, name: $name) {\n issueTypes(first: 20) {\n nodes {\n id\n name\n }\n }\n }\n }\n";
|
|
849
|
+
/**
|
|
850
|
+
* Query to get issue node ID for updating
|
|
851
|
+
*/
|
|
852
|
+
declare const ISSUE_FOR_UPDATE_QUERY = "\n query($owner: String!, $name: String!, $number: Int!) {\n repository(owner: $owner, name: $name) {\n issue(number: $number) {\n id\n }\n }\n }\n";
|
|
853
|
+
/**
|
|
854
|
+
* Mutation to update issue type
|
|
855
|
+
*/
|
|
856
|
+
declare const UPDATE_ISSUE_TYPE_MUTATION = "\n mutation($issueId: ID!, $issueTypeId: ID!) {\n updateIssue(input: { id: $issueId, issueTypeId: $issueTypeId }) {\n issue {\n id\n }\n }\n }\n";
|
|
857
|
+
|
|
858
|
+
declare const queries_ADD_COMMENT_MUTATION: typeof ADD_COMMENT_MUTATION;
|
|
859
|
+
declare const queries_ADD_LABELS_MUTATION: typeof ADD_LABELS_MUTATION;
|
|
860
|
+
declare const queries_ADD_TO_PROJECT_MUTATION: typeof ADD_TO_PROJECT_MUTATION;
|
|
861
|
+
declare const queries_COLLABORATORS_QUERY: typeof COLLABORATORS_QUERY;
|
|
862
|
+
declare const queries_CREATE_ISSUE_MUTATION: typeof CREATE_ISSUE_MUTATION;
|
|
863
|
+
declare const queries_ISSUES_WITH_LABEL_QUERY: typeof ISSUES_WITH_LABEL_QUERY;
|
|
864
|
+
declare const queries_ISSUE_AND_LABEL_QUERY: typeof ISSUE_AND_LABEL_QUERY;
|
|
865
|
+
declare const queries_ISSUE_DETAILS_QUERY: typeof ISSUE_DETAILS_QUERY;
|
|
866
|
+
declare const queries_ISSUE_FOR_UPDATE_QUERY: typeof ISSUE_FOR_UPDATE_QUERY;
|
|
867
|
+
declare const queries_ISSUE_NODE_ID_QUERY: typeof ISSUE_NODE_ID_QUERY;
|
|
868
|
+
declare const queries_ISSUE_TYPES_QUERY: typeof ISSUE_TYPES_QUERY;
|
|
869
|
+
declare const queries_LABEL_EXISTS_QUERY: typeof LABEL_EXISTS_QUERY;
|
|
870
|
+
declare const queries_PROJECT_FIELDS_QUERY: typeof PROJECT_FIELDS_QUERY;
|
|
871
|
+
declare const queries_PROJECT_ITEMS_QUERY: typeof PROJECT_ITEMS_QUERY;
|
|
872
|
+
declare const queries_PROJECT_VIEWS_QUERY: typeof PROJECT_VIEWS_QUERY;
|
|
873
|
+
declare const queries_RECENT_ISSUES_QUERY: typeof RECENT_ISSUES_QUERY;
|
|
874
|
+
declare const queries_REMOVE_LABELS_MUTATION: typeof REMOVE_LABELS_MUTATION;
|
|
875
|
+
declare const queries_REPOSITORY_ID_QUERY: typeof REPOSITORY_ID_QUERY;
|
|
876
|
+
declare const queries_REPOSITORY_PROJECTS_QUERY: typeof REPOSITORY_PROJECTS_QUERY;
|
|
877
|
+
declare const queries_UPDATE_ISSUE_TYPE_MUTATION: typeof UPDATE_ISSUE_TYPE_MUTATION;
|
|
878
|
+
declare const queries_UPDATE_ITEM_FIELD_MUTATION: typeof UPDATE_ITEM_FIELD_MUTATION;
|
|
879
|
+
declare const queries_UPDATE_ITEM_STATUS_MUTATION: typeof UPDATE_ITEM_STATUS_MUTATION;
|
|
880
|
+
declare const queries_VIEWER_QUERY: typeof VIEWER_QUERY;
|
|
881
|
+
declare namespace queries {
|
|
882
|
+
export { queries_ADD_COMMENT_MUTATION as ADD_COMMENT_MUTATION, queries_ADD_LABELS_MUTATION as ADD_LABELS_MUTATION, queries_ADD_TO_PROJECT_MUTATION as ADD_TO_PROJECT_MUTATION, queries_COLLABORATORS_QUERY as COLLABORATORS_QUERY, queries_CREATE_ISSUE_MUTATION as CREATE_ISSUE_MUTATION, queries_ISSUES_WITH_LABEL_QUERY as ISSUES_WITH_LABEL_QUERY, queries_ISSUE_AND_LABEL_QUERY as ISSUE_AND_LABEL_QUERY, queries_ISSUE_DETAILS_QUERY as ISSUE_DETAILS_QUERY, queries_ISSUE_FOR_UPDATE_QUERY as ISSUE_FOR_UPDATE_QUERY, queries_ISSUE_NODE_ID_QUERY as ISSUE_NODE_ID_QUERY, queries_ISSUE_TYPES_QUERY as ISSUE_TYPES_QUERY, queries_LABEL_EXISTS_QUERY as LABEL_EXISTS_QUERY, queries_PROJECT_FIELDS_QUERY as PROJECT_FIELDS_QUERY, queries_PROJECT_ITEMS_QUERY as PROJECT_ITEMS_QUERY, queries_PROJECT_VIEWS_QUERY as PROJECT_VIEWS_QUERY, queries_RECENT_ISSUES_QUERY as RECENT_ISSUES_QUERY, queries_REMOVE_LABELS_MUTATION as REMOVE_LABELS_MUTATION, queries_REPOSITORY_ID_QUERY as REPOSITORY_ID_QUERY, queries_REPOSITORY_PROJECTS_QUERY as REPOSITORY_PROJECTS_QUERY, queries_UPDATE_ISSUE_TYPE_MUTATION as UPDATE_ISSUE_TYPE_MUTATION, queries_UPDATE_ITEM_FIELD_MUTATION as UPDATE_ITEM_FIELD_MUTATION, queries_UPDATE_ITEM_STATUS_MUTATION as UPDATE_ITEM_STATUS_MUTATION, queries_VIEWER_QUERY as VIEWER_QUERY };
|
|
883
|
+
}
|
|
884
|
+
|
|
885
|
+
export { type AssigneeInfo, type AuthError, type BranchLink, BranchLinker, type Collaborator, type DateFieldValue, type FieldInfo, type FieldValue, type FieldValueConnection, GitHubAPI, type GitHubAPIOptions, type GitOptions, type IssueDetails, type IssueReference, type IterationFieldValue, type LabelInfo, type NumberFieldValue, type Project, type ProjectConfig, type ProjectItem, type ProjectItemContent, type ProjectItemsQueryResponse, type ProjectV2, type ProjectV2Field, type ProjectV2Item, type ProjectV2View, type ProjectWithViews, type ProjectsQueryResponse, type RepoInfo, type SingleSelectFieldValue, type StatusField, type StorageAdapter, type TextFieldValue, type TokenProvider, branchExists, buildIssueUrl, buildOrgProjectUrl, buildProjectUrl, buildPullRequestUrl, buildRepoUrl, checkoutBranch, createBranch, createInMemoryAdapter, detectRepository, fetchOrigin, generateBranchName, getCommitsAhead, getCommitsBehind, getCurrentBranch, getDefaultBranch, getRepositoryRoot, hasUncommittedChanges, isGitRepository, parseGitHubUrl, parseIssueUrl, pullLatest, queries, sanitizeForBranchName };
|