mcp-ticketer 0.3.0__py3-none-any.whl → 2.2.9__py3-none-any.whl

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 (160) hide show
  1. mcp_ticketer/__init__.py +10 -10
  2. mcp_ticketer/__version__.py +3 -3
  3. mcp_ticketer/_version_scm.py +1 -0
  4. mcp_ticketer/adapters/__init__.py +2 -0
  5. mcp_ticketer/adapters/aitrackdown.py +930 -52
  6. mcp_ticketer/adapters/asana/__init__.py +15 -0
  7. mcp_ticketer/adapters/asana/adapter.py +1537 -0
  8. mcp_ticketer/adapters/asana/client.py +292 -0
  9. mcp_ticketer/adapters/asana/mappers.py +348 -0
  10. mcp_ticketer/adapters/asana/types.py +146 -0
  11. mcp_ticketer/adapters/github/__init__.py +26 -0
  12. mcp_ticketer/adapters/github/adapter.py +3229 -0
  13. mcp_ticketer/adapters/github/client.py +335 -0
  14. mcp_ticketer/adapters/github/mappers.py +797 -0
  15. mcp_ticketer/adapters/github/queries.py +692 -0
  16. mcp_ticketer/adapters/github/types.py +460 -0
  17. mcp_ticketer/adapters/hybrid.py +58 -16
  18. mcp_ticketer/adapters/jira/__init__.py +35 -0
  19. mcp_ticketer/adapters/jira/adapter.py +1351 -0
  20. mcp_ticketer/adapters/jira/client.py +271 -0
  21. mcp_ticketer/adapters/jira/mappers.py +246 -0
  22. mcp_ticketer/adapters/jira/queries.py +216 -0
  23. mcp_ticketer/adapters/jira/types.py +304 -0
  24. mcp_ticketer/adapters/linear/__init__.py +1 -1
  25. mcp_ticketer/adapters/linear/adapter.py +3810 -462
  26. mcp_ticketer/adapters/linear/client.py +312 -69
  27. mcp_ticketer/adapters/linear/mappers.py +305 -85
  28. mcp_ticketer/adapters/linear/queries.py +317 -17
  29. mcp_ticketer/adapters/linear/types.py +187 -64
  30. mcp_ticketer/adapters/linear.py +2 -2
  31. mcp_ticketer/analysis/__init__.py +56 -0
  32. mcp_ticketer/analysis/dependency_graph.py +255 -0
  33. mcp_ticketer/analysis/health_assessment.py +304 -0
  34. mcp_ticketer/analysis/orphaned.py +218 -0
  35. mcp_ticketer/analysis/project_status.py +594 -0
  36. mcp_ticketer/analysis/similarity.py +224 -0
  37. mcp_ticketer/analysis/staleness.py +266 -0
  38. mcp_ticketer/automation/__init__.py +11 -0
  39. mcp_ticketer/automation/project_updates.py +378 -0
  40. mcp_ticketer/cache/memory.py +9 -8
  41. mcp_ticketer/cli/adapter_diagnostics.py +91 -54
  42. mcp_ticketer/cli/auggie_configure.py +116 -15
  43. mcp_ticketer/cli/codex_configure.py +274 -82
  44. mcp_ticketer/cli/configure.py +1323 -151
  45. mcp_ticketer/cli/cursor_configure.py +314 -0
  46. mcp_ticketer/cli/diagnostics.py +209 -114
  47. mcp_ticketer/cli/discover.py +297 -26
  48. mcp_ticketer/cli/gemini_configure.py +119 -26
  49. mcp_ticketer/cli/init_command.py +880 -0
  50. mcp_ticketer/cli/install_mcp_server.py +418 -0
  51. mcp_ticketer/cli/instruction_commands.py +435 -0
  52. mcp_ticketer/cli/linear_commands.py +256 -130
  53. mcp_ticketer/cli/main.py +140 -1544
  54. mcp_ticketer/cli/mcp_configure.py +1013 -100
  55. mcp_ticketer/cli/mcp_server_commands.py +415 -0
  56. mcp_ticketer/cli/migrate_config.py +12 -8
  57. mcp_ticketer/cli/platform_commands.py +123 -0
  58. mcp_ticketer/cli/platform_detection.py +477 -0
  59. mcp_ticketer/cli/platform_installer.py +545 -0
  60. mcp_ticketer/cli/project_update_commands.py +350 -0
  61. mcp_ticketer/cli/python_detection.py +126 -0
  62. mcp_ticketer/cli/queue_commands.py +15 -15
  63. mcp_ticketer/cli/setup_command.py +794 -0
  64. mcp_ticketer/cli/simple_health.py +84 -59
  65. mcp_ticketer/cli/ticket_commands.py +1375 -0
  66. mcp_ticketer/cli/update_checker.py +313 -0
  67. mcp_ticketer/cli/utils.py +195 -72
  68. mcp_ticketer/core/__init__.py +64 -1
  69. mcp_ticketer/core/adapter.py +618 -18
  70. mcp_ticketer/core/config.py +77 -68
  71. mcp_ticketer/core/env_discovery.py +75 -16
  72. mcp_ticketer/core/env_loader.py +121 -97
  73. mcp_ticketer/core/exceptions.py +32 -24
  74. mcp_ticketer/core/http_client.py +26 -26
  75. mcp_ticketer/core/instructions.py +405 -0
  76. mcp_ticketer/core/label_manager.py +732 -0
  77. mcp_ticketer/core/mappers.py +42 -30
  78. mcp_ticketer/core/milestone_manager.py +252 -0
  79. mcp_ticketer/core/models.py +566 -19
  80. mcp_ticketer/core/onepassword_secrets.py +379 -0
  81. mcp_ticketer/core/priority_matcher.py +463 -0
  82. mcp_ticketer/core/project_config.py +189 -49
  83. mcp_ticketer/core/project_utils.py +281 -0
  84. mcp_ticketer/core/project_validator.py +376 -0
  85. mcp_ticketer/core/registry.py +3 -3
  86. mcp_ticketer/core/session_state.py +176 -0
  87. mcp_ticketer/core/state_matcher.py +592 -0
  88. mcp_ticketer/core/url_parser.py +425 -0
  89. mcp_ticketer/core/validators.py +69 -0
  90. mcp_ticketer/defaults/ticket_instructions.md +644 -0
  91. mcp_ticketer/mcp/__init__.py +29 -1
  92. mcp_ticketer/mcp/__main__.py +60 -0
  93. mcp_ticketer/mcp/server/__init__.py +25 -0
  94. mcp_ticketer/mcp/server/__main__.py +60 -0
  95. mcp_ticketer/mcp/server/constants.py +58 -0
  96. mcp_ticketer/mcp/server/diagnostic_helper.py +175 -0
  97. mcp_ticketer/mcp/server/dto.py +195 -0
  98. mcp_ticketer/mcp/server/main.py +1343 -0
  99. mcp_ticketer/mcp/server/response_builder.py +206 -0
  100. mcp_ticketer/mcp/server/routing.py +723 -0
  101. mcp_ticketer/mcp/server/server_sdk.py +151 -0
  102. mcp_ticketer/mcp/server/tools/__init__.py +69 -0
  103. mcp_ticketer/mcp/server/tools/analysis_tools.py +854 -0
  104. mcp_ticketer/mcp/server/tools/attachment_tools.py +224 -0
  105. mcp_ticketer/mcp/server/tools/bulk_tools.py +330 -0
  106. mcp_ticketer/mcp/server/tools/comment_tools.py +152 -0
  107. mcp_ticketer/mcp/server/tools/config_tools.py +1564 -0
  108. mcp_ticketer/mcp/server/tools/diagnostic_tools.py +211 -0
  109. mcp_ticketer/mcp/server/tools/hierarchy_tools.py +942 -0
  110. mcp_ticketer/mcp/server/tools/instruction_tools.py +295 -0
  111. mcp_ticketer/mcp/server/tools/label_tools.py +942 -0
  112. mcp_ticketer/mcp/server/tools/milestone_tools.py +338 -0
  113. mcp_ticketer/mcp/server/tools/pr_tools.py +150 -0
  114. mcp_ticketer/mcp/server/tools/project_status_tools.py +158 -0
  115. mcp_ticketer/mcp/server/tools/project_update_tools.py +473 -0
  116. mcp_ticketer/mcp/server/tools/search_tools.py +318 -0
  117. mcp_ticketer/mcp/server/tools/session_tools.py +308 -0
  118. mcp_ticketer/mcp/server/tools/ticket_tools.py +1413 -0
  119. mcp_ticketer/mcp/server/tools/user_ticket_tools.py +364 -0
  120. mcp_ticketer/queue/__init__.py +1 -0
  121. mcp_ticketer/queue/health_monitor.py +168 -136
  122. mcp_ticketer/queue/manager.py +78 -63
  123. mcp_ticketer/queue/queue.py +108 -21
  124. mcp_ticketer/queue/run_worker.py +2 -2
  125. mcp_ticketer/queue/ticket_registry.py +213 -155
  126. mcp_ticketer/queue/worker.py +96 -58
  127. mcp_ticketer/utils/__init__.py +5 -0
  128. mcp_ticketer/utils/token_utils.py +246 -0
  129. mcp_ticketer-2.2.9.dist-info/METADATA +1396 -0
  130. mcp_ticketer-2.2.9.dist-info/RECORD +158 -0
  131. mcp_ticketer-2.2.9.dist-info/top_level.txt +2 -0
  132. py_mcp_installer/examples/phase3_demo.py +178 -0
  133. py_mcp_installer/scripts/manage_version.py +54 -0
  134. py_mcp_installer/setup.py +6 -0
  135. py_mcp_installer/src/py_mcp_installer/__init__.py +153 -0
  136. py_mcp_installer/src/py_mcp_installer/command_builder.py +445 -0
  137. py_mcp_installer/src/py_mcp_installer/config_manager.py +541 -0
  138. py_mcp_installer/src/py_mcp_installer/exceptions.py +243 -0
  139. py_mcp_installer/src/py_mcp_installer/installation_strategy.py +617 -0
  140. py_mcp_installer/src/py_mcp_installer/installer.py +656 -0
  141. py_mcp_installer/src/py_mcp_installer/mcp_inspector.py +750 -0
  142. py_mcp_installer/src/py_mcp_installer/platform_detector.py +451 -0
  143. py_mcp_installer/src/py_mcp_installer/platforms/__init__.py +26 -0
  144. py_mcp_installer/src/py_mcp_installer/platforms/claude_code.py +225 -0
  145. py_mcp_installer/src/py_mcp_installer/platforms/codex.py +181 -0
  146. py_mcp_installer/src/py_mcp_installer/platforms/cursor.py +191 -0
  147. py_mcp_installer/src/py_mcp_installer/types.py +222 -0
  148. py_mcp_installer/src/py_mcp_installer/utils.py +463 -0
  149. py_mcp_installer/tests/__init__.py +0 -0
  150. py_mcp_installer/tests/platforms/__init__.py +0 -0
  151. py_mcp_installer/tests/test_platform_detector.py +17 -0
  152. mcp_ticketer/adapters/github.py +0 -1354
  153. mcp_ticketer/adapters/jira.py +0 -1011
  154. mcp_ticketer/mcp/server.py +0 -2030
  155. mcp_ticketer-0.3.0.dist-info/METADATA +0 -414
  156. mcp_ticketer-0.3.0.dist-info/RECORD +0 -59
  157. mcp_ticketer-0.3.0.dist-info/top_level.txt +0 -1
  158. {mcp_ticketer-0.3.0.dist-info → mcp_ticketer-2.2.9.dist-info}/WHEEL +0 -0
  159. {mcp_ticketer-0.3.0.dist-info → mcp_ticketer-2.2.9.dist-info}/entry_points.txt +0 -0
  160. {mcp_ticketer-0.3.0.dist-info → mcp_ticketer-2.2.9.dist-info}/licenses/LICENSE +0 -0
@@ -0,0 +1,692 @@
1
+ """GraphQL queries and fragments for GitHub API v4.
2
+
3
+ This module contains all GraphQL query strings used by the GitHub adapter.
4
+ Queries are organized into fragments (reusable field sets) and operations.
5
+
6
+ Design Pattern: Fragment Composition
7
+ ------------------------------------
8
+ We use GraphQL fragments to:
9
+ 1. Reduce duplication of field definitions
10
+ 2. Enable different detail levels (compact vs. full)
11
+ 3. Optimize token usage in API responses
12
+ 4. Maintain consistency across queries
13
+
14
+ Token Optimization:
15
+ ------------------
16
+ - Compact fragments: Include only essential fields (~120 tokens/item)
17
+ - Full fragments: Include all fields including comments, reactions (~600 tokens/item)
18
+
19
+ Usage:
20
+ -----
21
+ Queries are pre-composed strings that include their fragments.
22
+ Simply pass to GraphQL client with appropriate variables.
23
+ """
24
+
25
+ # =============================================================================
26
+ # GraphQL Fragments (Reusable Field Sets)
27
+ # =============================================================================
28
+
29
+ ISSUE_FRAGMENT = """
30
+ fragment IssueFields on Issue {
31
+ id
32
+ number
33
+ title
34
+ body
35
+ state
36
+ createdAt
37
+ updatedAt
38
+ url
39
+ author {
40
+ login
41
+ }
42
+ assignees(first: 10) {
43
+ nodes {
44
+ login
45
+ email
46
+ }
47
+ }
48
+ labels(first: 20) {
49
+ nodes {
50
+ name
51
+ color
52
+ }
53
+ }
54
+ milestone {
55
+ id
56
+ number
57
+ title
58
+ state
59
+ description
60
+ }
61
+ projectCards(first: 10) {
62
+ nodes {
63
+ project {
64
+ name
65
+ url
66
+ }
67
+ column {
68
+ name
69
+ }
70
+ }
71
+ }
72
+ comments(first: 100) {
73
+ nodes {
74
+ id
75
+ body
76
+ author {
77
+ login
78
+ }
79
+ createdAt
80
+ }
81
+ }
82
+ reactions(first: 10) {
83
+ nodes {
84
+ content
85
+ user {
86
+ login
87
+ }
88
+ }
89
+ }
90
+ }
91
+ """
92
+
93
+ ISSUE_COMPACT_FRAGMENT = """
94
+ fragment IssueCompactFields on Issue {
95
+ id
96
+ number
97
+ title
98
+ body
99
+ state
100
+ createdAt
101
+ updatedAt
102
+ url
103
+ author {
104
+ login
105
+ }
106
+ assignees(first: 10) {
107
+ nodes {
108
+ login
109
+ email
110
+ }
111
+ }
112
+ labels(first: 20) {
113
+ nodes {
114
+ name
115
+ color
116
+ }
117
+ }
118
+ milestone {
119
+ id
120
+ number
121
+ title
122
+ state
123
+ }
124
+ }
125
+ """
126
+
127
+ MILESTONE_FRAGMENT = """
128
+ fragment MilestoneFields on Milestone {
129
+ id
130
+ number
131
+ title
132
+ description
133
+ state
134
+ createdAt
135
+ updatedAt
136
+ dueOn
137
+ creator {
138
+ login
139
+ }
140
+ }
141
+ """
142
+
143
+ USER_FRAGMENT = """
144
+ fragment UserFields on User {
145
+ id
146
+ login
147
+ email
148
+ name
149
+ avatarUrl
150
+ }
151
+ """
152
+
153
+ LABEL_FRAGMENT = """
154
+ fragment LabelFields on Label {
155
+ id
156
+ name
157
+ color
158
+ description
159
+ }
160
+ """
161
+
162
+ # =============================================================================
163
+ # Issue Queries
164
+ # =============================================================================
165
+
166
+ GET_ISSUE = (
167
+ ISSUE_FRAGMENT
168
+ + """
169
+ query GetIssue($owner: String!, $repo: String!, $number: Int!) {
170
+ repository(owner: $owner, name: $repo) {
171
+ issue(number: $number) {
172
+ ...IssueFields
173
+ }
174
+ }
175
+ }
176
+ """
177
+ )
178
+
179
+ SEARCH_ISSUES = (
180
+ ISSUE_FRAGMENT
181
+ + """
182
+ query SearchIssues($query: String!, $first: Int!, $after: String) {
183
+ search(query: $query, type: ISSUE, first: $first, after: $after) {
184
+ issueCount
185
+ pageInfo {
186
+ hasNextPage
187
+ endCursor
188
+ }
189
+ nodes {
190
+ ... on Issue {
191
+ ...IssueFields
192
+ }
193
+ }
194
+ }
195
+ }
196
+ """
197
+ )
198
+
199
+ SEARCH_ISSUES_COMPACT = (
200
+ ISSUE_COMPACT_FRAGMENT
201
+ + """
202
+ query SearchIssuesCompact($query: String!, $first: Int!, $after: String) {
203
+ search(query: $query, type: ISSUE, first: $first, after: $after) {
204
+ issueCount
205
+ pageInfo {
206
+ hasNextPage
207
+ endCursor
208
+ }
209
+ nodes {
210
+ ... on Issue {
211
+ ...IssueCompactFields
212
+ }
213
+ }
214
+ }
215
+ }
216
+ """
217
+ )
218
+
219
+ LIST_REPOSITORY_ISSUES = (
220
+ ISSUE_COMPACT_FRAGMENT
221
+ + """
222
+ query ListRepositoryIssues(
223
+ $owner: String!,
224
+ $repo: String!,
225
+ $first: Int!,
226
+ $after: String,
227
+ $states: [IssueState!]
228
+ ) {
229
+ repository(owner: $owner, name: $repo) {
230
+ issues(first: $first, after: $after, states: $states, orderBy: {field: UPDATED_AT, direction: DESC}) {
231
+ totalCount
232
+ pageInfo {
233
+ hasNextPage
234
+ endCursor
235
+ }
236
+ nodes {
237
+ ...IssueCompactFields
238
+ }
239
+ }
240
+ }
241
+ }
242
+ """
243
+ )
244
+
245
+ # =============================================================================
246
+ # Project Queries (Projects V2)
247
+ # =============================================================================
248
+
249
+ # --- ProjectV2 Fragment (Reusable Fields) ---
250
+
251
+ PROJECT_V2_FRAGMENT = """
252
+ fragment ProjectV2Fields on ProjectV2 {
253
+ id
254
+ number
255
+ title
256
+ shortDescription
257
+ readme
258
+ public
259
+ closed
260
+ url
261
+ createdAt
262
+ updatedAt
263
+ closedAt
264
+ owner {
265
+ __typename
266
+ ... on Organization {
267
+ login
268
+ id
269
+ }
270
+ ... on User {
271
+ login
272
+ id
273
+ }
274
+ }
275
+ }
276
+ """
277
+
278
+ # --- Core ProjectV2 Queries ---
279
+
280
+ GET_PROJECT_QUERY = (
281
+ PROJECT_V2_FRAGMENT
282
+ + """
283
+ query GetProjectByNumber($owner: String!, $number: Int!) {
284
+ organization(login: $owner) {
285
+ projectV2(number: $number) {
286
+ ...ProjectV2Fields
287
+ items {
288
+ totalCount
289
+ }
290
+ }
291
+ }
292
+ }
293
+ """
294
+ )
295
+
296
+ GET_PROJECT_BY_ID_QUERY = (
297
+ PROJECT_V2_FRAGMENT
298
+ + """
299
+ query GetProjectById($projectId: ID!) {
300
+ node(id: $projectId) {
301
+ ... on ProjectV2 {
302
+ ...ProjectV2Fields
303
+ items {
304
+ totalCount
305
+ }
306
+ }
307
+ }
308
+ }
309
+ """
310
+ )
311
+
312
+ LIST_PROJECTS_QUERY = (
313
+ PROJECT_V2_FRAGMENT
314
+ + """
315
+ query ListProjects($owner: String!, $first: Int!, $after: String) {
316
+ organization(login: $owner) {
317
+ projectsV2(first: $first, after: $after, orderBy: {field: UPDATED_AT, direction: DESC}) {
318
+ totalCount
319
+ pageInfo {
320
+ hasNextPage
321
+ endCursor
322
+ }
323
+ nodes {
324
+ ...ProjectV2Fields
325
+ }
326
+ }
327
+ }
328
+ }
329
+ """
330
+ )
331
+
332
+ PROJECT_ITEMS_QUERY = """
333
+ query GetProjectItems($projectId: ID!, $first: Int!, $after: String) {
334
+ node(id: $projectId) {
335
+ ... on ProjectV2 {
336
+ items(first: $first, after: $after) {
337
+ totalCount
338
+ pageInfo {
339
+ hasNextPage
340
+ endCursor
341
+ }
342
+ nodes {
343
+ id
344
+ content {
345
+ __typename
346
+ ... on Issue {
347
+ id
348
+ number
349
+ title
350
+ state
351
+ labels(first: 20) {
352
+ nodes {
353
+ name
354
+ }
355
+ }
356
+ }
357
+ ... on PullRequest {
358
+ id
359
+ number
360
+ title
361
+ state
362
+ }
363
+ ... on DraftIssue {
364
+ id
365
+ title
366
+ }
367
+ }
368
+ }
369
+ }
370
+ }
371
+ }
372
+ }
373
+ """
374
+
375
+ # --- ProjectV2 Mutations ---
376
+
377
+ CREATE_PROJECT_MUTATION = """
378
+ mutation CreateProject($ownerId: ID!, $title: String!) {
379
+ createProjectV2(input: {
380
+ ownerId: $ownerId
381
+ title: $title
382
+ }) {
383
+ projectV2 {
384
+ id
385
+ number
386
+ title
387
+ url
388
+ createdAt
389
+ }
390
+ }
391
+ }
392
+ """
393
+
394
+ UPDATE_PROJECT_MUTATION = """
395
+ mutation UpdateProject(
396
+ $projectId: ID!,
397
+ $title: String,
398
+ $shortDescription: String,
399
+ $readme: String,
400
+ $public: Boolean,
401
+ $closed: Boolean
402
+ ) {
403
+ updateProjectV2(input: {
404
+ projectId: $projectId
405
+ title: $title
406
+ shortDescription: $shortDescription
407
+ readme: $readme
408
+ public: $public
409
+ closed: $closed
410
+ }) {
411
+ projectV2 {
412
+ id
413
+ number
414
+ title
415
+ shortDescription
416
+ readme
417
+ public
418
+ closed
419
+ updatedAt
420
+ }
421
+ }
422
+ }
423
+ """
424
+
425
+ DELETE_PROJECT_MUTATION = """
426
+ mutation DeleteProject($projectId: ID!) {
427
+ deleteProjectV2(input: {
428
+ projectId: $projectId
429
+ }) {
430
+ projectV2 {
431
+ id
432
+ number
433
+ }
434
+ }
435
+ }
436
+ """
437
+
438
+ ADD_PROJECT_ITEM_MUTATION = """
439
+ mutation AddIssueToProject($projectId: ID!, $contentId: ID!) {
440
+ addProjectV2ItemById(input: {
441
+ projectId: $projectId
442
+ contentId: $contentId
443
+ }) {
444
+ item {
445
+ id
446
+ content {
447
+ ... on Issue {
448
+ id
449
+ number
450
+ title
451
+ }
452
+ }
453
+ }
454
+ }
455
+ }
456
+ """
457
+
458
+ REMOVE_PROJECT_ITEM_MUTATION = """
459
+ mutation RemoveIssueFromProject($projectId: ID!, $itemId: ID!) {
460
+ deleteProjectV2Item(input: {
461
+ projectId: $projectId
462
+ itemId: $itemId
463
+ }) {
464
+ deletedItemId
465
+ }
466
+ }
467
+ """
468
+
469
+ # --- Legacy ProjectV2 Queries (Deprecated - use above instead) ---
470
+
471
+ GET_PROJECT_ITERATIONS = """
472
+ query GetProjectIterations($projectId: ID!, $first: Int!, $after: String) {
473
+ node(id: $projectId) {
474
+ ... on ProjectV2 {
475
+ iterations(first: $first, after: $after) {
476
+ nodes {
477
+ id
478
+ title
479
+ startDate
480
+ duration
481
+ }
482
+ pageInfo {
483
+ hasNextPage
484
+ endCursor
485
+ }
486
+ }
487
+ }
488
+ }
489
+ }
490
+ """
491
+
492
+ GET_PROJECT_ITEMS = """
493
+ query GetProjectItems($projectId: ID!, $first: Int!, $after: String) {
494
+ node(id: $projectId) {
495
+ ... on ProjectV2 {
496
+ items(first: $first, after: $after) {
497
+ totalCount
498
+ pageInfo {
499
+ hasNextPage
500
+ endCursor
501
+ }
502
+ nodes {
503
+ id
504
+ content {
505
+ ... on Issue {
506
+ number
507
+ title
508
+ state
509
+ }
510
+ }
511
+ fieldValues(first: 20) {
512
+ nodes {
513
+ ... on ProjectV2ItemFieldTextValue {
514
+ text
515
+ field {
516
+ ... on ProjectV2Field {
517
+ name
518
+ }
519
+ }
520
+ }
521
+ ... on ProjectV2ItemFieldDateValue {
522
+ date
523
+ field {
524
+ ... on ProjectV2Field {
525
+ name
526
+ }
527
+ }
528
+ }
529
+ ... on ProjectV2ItemFieldIterationValue {
530
+ title
531
+ field {
532
+ ... on ProjectV2Field {
533
+ name
534
+ }
535
+ }
536
+ }
537
+ }
538
+ }
539
+ }
540
+ }
541
+ }
542
+ }
543
+ }
544
+ """
545
+
546
+ # =============================================================================
547
+ # Milestone Queries
548
+ # =============================================================================
549
+
550
+ GET_MILESTONE = (
551
+ MILESTONE_FRAGMENT
552
+ + """
553
+ query GetMilestone($owner: String!, $repo: String!, $number: Int!) {
554
+ repository(owner: $owner, name: $repo) {
555
+ milestone(number: $number) {
556
+ ...MilestoneFields
557
+ }
558
+ }
559
+ }
560
+ """
561
+ )
562
+
563
+ LIST_MILESTONES = (
564
+ MILESTONE_FRAGMENT
565
+ + """
566
+ query ListMilestones(
567
+ $owner: String!,
568
+ $repo: String!,
569
+ $first: Int!,
570
+ $after: String,
571
+ $states: [MilestoneState!]
572
+ ) {
573
+ repository(owner: $owner, name: $repo) {
574
+ milestones(first: $first, after: $after, states: $states, orderBy: {field: DUE_DATE, direction: ASC}) {
575
+ totalCount
576
+ pageInfo {
577
+ hasNextPage
578
+ endCursor
579
+ }
580
+ nodes {
581
+ ...MilestoneFields
582
+ }
583
+ }
584
+ }
585
+ }
586
+ """
587
+ )
588
+
589
+ # =============================================================================
590
+ # User and Collaborator Queries
591
+ # =============================================================================
592
+
593
+ GET_USER = (
594
+ USER_FRAGMENT
595
+ + """
596
+ query GetUser($login: String!) {
597
+ user(login: $login) {
598
+ ...UserFields
599
+ }
600
+ }
601
+ """
602
+ )
603
+
604
+ GET_REPOSITORY_COLLABORATORS = (
605
+ USER_FRAGMENT
606
+ + """
607
+ query GetRepositoryCollaborators($owner: String!, $repo: String!, $first: Int!, $after: String) {
608
+ repository(owner: $owner, name: $repo) {
609
+ collaborators(first: $first, after: $after) {
610
+ totalCount
611
+ pageInfo {
612
+ hasNextPage
613
+ endCursor
614
+ }
615
+ nodes {
616
+ ...UserFields
617
+ }
618
+ }
619
+ }
620
+ }
621
+ """
622
+ )
623
+
624
+ GET_VIEWER = (
625
+ USER_FRAGMENT
626
+ + """
627
+ query GetViewer {
628
+ viewer {
629
+ ...UserFields
630
+ }
631
+ }
632
+ """
633
+ )
634
+
635
+ # =============================================================================
636
+ # Label Queries
637
+ # =============================================================================
638
+
639
+ LIST_LABELS = (
640
+ LABEL_FRAGMENT
641
+ + """
642
+ query ListLabels($owner: String!, $repo: String!, $first: Int!, $after: String) {
643
+ repository(owner: $owner, name: $repo) {
644
+ labels(first: $first, after: $after, orderBy: {field: NAME, direction: ASC}) {
645
+ totalCount
646
+ pageInfo {
647
+ hasNextPage
648
+ endCursor
649
+ }
650
+ nodes {
651
+ ...LabelFields
652
+ }
653
+ }
654
+ }
655
+ }
656
+ """
657
+ )
658
+
659
+ # =============================================================================
660
+ # Comment Queries
661
+ # =============================================================================
662
+
663
+ GET_ISSUE_COMMENTS = """
664
+ query GetIssueComments(
665
+ $owner: String!,
666
+ $repo: String!,
667
+ $number: Int!,
668
+ $first: Int!,
669
+ $after: String
670
+ ) {
671
+ repository(owner: $owner, name: $repo) {
672
+ issue(number: $number) {
673
+ comments(first: $first, after: $after) {
674
+ totalCount
675
+ pageInfo {
676
+ hasNextPage
677
+ endCursor
678
+ }
679
+ nodes {
680
+ id
681
+ body
682
+ author {
683
+ login
684
+ }
685
+ createdAt
686
+ updatedAt
687
+ }
688
+ }
689
+ }
690
+ }
691
+ }
692
+ """