@pecot/workflow-mcp 0.0.0-stage → 6.0.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.
Files changed (287) hide show
  1. package/.claude-plugin/plugin.json +8 -0
  2. package/LICENSE +21 -0
  3. package/README.md +184 -2
  4. package/bin/pecot-workflow-mcp.mjs +10 -0
  5. package/cli/dist/cli.d.ts +26 -0
  6. package/cli/dist/cli.js +227 -0
  7. package/cli/dist/commands/board-add.d.ts +3 -0
  8. package/cli/dist/commands/board-add.js +59 -0
  9. package/cli/dist/commands/board-judgment.d.ts +60 -0
  10. package/cli/dist/commands/board-judgment.js +144 -0
  11. package/cli/dist/commands/board-move.d.ts +3 -0
  12. package/cli/dist/commands/board-move.js +57 -0
  13. package/cli/dist/commands/board-readiness.d.ts +34 -0
  14. package/cli/dist/commands/board-readiness.js +108 -0
  15. package/cli/dist/commands/board-show.d.ts +3 -0
  16. package/cli/dist/commands/board-show.js +72 -0
  17. package/cli/dist/commands/board-sync.d.ts +3 -0
  18. package/cli/dist/commands/board-sync.js +111 -0
  19. package/cli/dist/commands/board-view.d.ts +62 -0
  20. package/cli/dist/commands/board-view.js +191 -0
  21. package/cli/dist/commands/board.d.ts +3 -0
  22. package/cli/dist/commands/board.js +12 -0
  23. package/cli/dist/commands/branch.d.ts +3 -0
  24. package/cli/dist/commands/branch.js +100 -0
  25. package/cli/dist/commands/cell-table.d.ts +3 -0
  26. package/cli/dist/commands/cell-table.js +495 -0
  27. package/cli/dist/commands/command-binding.d.ts +26 -0
  28. package/cli/dist/commands/command-binding.js +270 -0
  29. package/cli/dist/commands/command-definition.d.ts +150 -0
  30. package/cli/dist/commands/command-definition.js +105 -0
  31. package/cli/dist/commands/command-help.d.ts +8 -0
  32. package/cli/dist/commands/command-help.js +173 -0
  33. package/cli/dist/commands/command-hint.d.ts +5 -0
  34. package/cli/dist/commands/command-hint.js +13 -0
  35. package/cli/dist/commands/command-stop.d.ts +21 -0
  36. package/cli/dist/commands/command-stop.js +31 -0
  37. package/cli/dist/commands/directory-option.d.ts +7 -0
  38. package/cli/dist/commands/directory-option.js +48 -0
  39. package/cli/dist/commands/failure-kind.d.ts +3 -0
  40. package/cli/dist/commands/failure-kind.js +34 -0
  41. package/cli/dist/commands/failure.d.ts +19 -0
  42. package/cli/dist/commands/failure.js +59 -0
  43. package/cli/dist/commands/fuzzy.d.ts +7 -0
  44. package/cli/dist/commands/fuzzy.js +79 -0
  45. package/cli/dist/commands/github-client.d.ts +16 -0
  46. package/cli/dist/commands/github-client.js +33 -0
  47. package/cli/dist/commands/global-options.d.ts +25 -0
  48. package/cli/dist/commands/global-options.js +83 -0
  49. package/cli/dist/commands/help-layout.d.ts +40 -0
  50. package/cli/dist/commands/help-layout.js +117 -0
  51. package/cli/dist/commands/help.d.ts +8 -0
  52. package/cli/dist/commands/help.js +50 -0
  53. package/cli/dist/commands/input-schema.d.ts +14 -0
  54. package/cli/dist/commands/input-schema.js +56 -0
  55. package/cli/dist/commands/issue-board.d.ts +71 -0
  56. package/cli/dist/commands/issue-board.js +122 -0
  57. package/cli/dist/commands/issue-comment.d.ts +3 -0
  58. package/cli/dist/commands/issue-comment.js +215 -0
  59. package/cli/dist/commands/issue-create.d.ts +3 -0
  60. package/cli/dist/commands/issue-create.js +786 -0
  61. package/cli/dist/commands/issue-dependency.d.ts +3 -0
  62. package/cli/dist/commands/issue-dependency.js +282 -0
  63. package/cli/dist/commands/issue-readiness.d.ts +94 -0
  64. package/cli/dist/commands/issue-readiness.js +218 -0
  65. package/cli/dist/commands/issue-reopen.d.ts +3 -0
  66. package/cli/dist/commands/issue-reopen.js +115 -0
  67. package/cli/dist/commands/issue-shared.d.ts +172 -0
  68. package/cli/dist/commands/issue-shared.js +426 -0
  69. package/cli/dist/commands/issue-show.d.ts +3 -0
  70. package/cli/dist/commands/issue-show.js +169 -0
  71. package/cli/dist/commands/issue.d.ts +3 -0
  72. package/cli/dist/commands/issue.js +13 -0
  73. package/cli/dist/commands/names.d.ts +42 -0
  74. package/cli/dist/commands/names.js +78 -0
  75. package/cli/dist/commands/output.d.ts +90 -0
  76. package/cli/dist/commands/output.js +194 -0
  77. package/cli/dist/commands/pr-waiting.d.ts +20 -0
  78. package/cli/dist/commands/pr-waiting.js +106 -0
  79. package/cli/dist/commands/pr.d.ts +22 -0
  80. package/cli/dist/commands/pr.js +852 -0
  81. package/cli/dist/commands/project-sync.d.ts +92 -0
  82. package/cli/dist/commands/project-sync.js +282 -0
  83. package/cli/dist/commands/project.d.ts +6 -0
  84. package/cli/dist/commands/project.js +714 -0
  85. package/cli/dist/commands/registry.d.ts +6 -0
  86. package/cli/dist/commands/registry.js +30 -0
  87. package/cli/dist/commands/release.d.ts +10 -0
  88. package/cli/dist/commands/release.js +353 -0
  89. package/cli/dist/commands/renamed-commands.d.ts +26 -0
  90. package/cli/dist/commands/renamed-commands.js +53 -0
  91. package/cli/dist/commands/repository-display.d.ts +3 -0
  92. package/cli/dist/commands/repository-display.js +7 -0
  93. package/cli/dist/commands/repository-match.d.ts +14 -0
  94. package/cli/dist/commands/repository-match.js +34 -0
  95. package/cli/dist/commands/rich-panel.d.ts +22 -0
  96. package/cli/dist/commands/rich-panel.js +295 -0
  97. package/cli/dist/commands/session-finish.d.ts +3 -0
  98. package/cli/dist/commands/session-finish.js +267 -0
  99. package/cli/dist/commands/session-start.d.ts +3 -0
  100. package/cli/dist/commands/session-start.js +236 -0
  101. package/cli/dist/commands/session.d.ts +6 -0
  102. package/cli/dist/commands/session.js +214 -0
  103. package/cli/dist/commands/tracker-sync-dependabot.d.ts +7 -0
  104. package/cli/dist/commands/tracker-sync-dependabot.js +156 -0
  105. package/cli/dist/commands/tracker-sync-security.d.ts +7 -0
  106. package/cli/dist/commands/tracker-sync-security.js +153 -0
  107. package/cli/dist/commands/tracker-sync.d.ts +65 -0
  108. package/cli/dist/commands/tracker-sync.js +50 -0
  109. package/cli/dist/commands/tracker.d.ts +3 -0
  110. package/cli/dist/commands/tracker.js +18 -0
  111. package/cli/dist/commands/usage-error.d.ts +51 -0
  112. package/cli/dist/commands/usage-error.js +78 -0
  113. package/cli/dist/commands/value-types.d.ts +46 -0
  114. package/cli/dist/commands/value-types.js +94 -0
  115. package/cli/dist/commands/work-target.d.ts +22 -0
  116. package/cli/dist/commands/work-target.js +82 -0
  117. package/cli/dist/commands/worktree.d.ts +3 -0
  118. package/cli/dist/commands/worktree.js +339 -0
  119. package/cli/dist/domain/api-error-detail.d.ts +10 -0
  120. package/cli/dist/domain/api-error-detail.js +25 -0
  121. package/cli/dist/domain/batch-plan.d.ts +73 -0
  122. package/cli/dist/domain/batch-plan.js +114 -0
  123. package/cli/dist/domain/blocked-by-change.d.ts +99 -0
  124. package/cli/dist/domain/blocked-by-change.js +101 -0
  125. package/cli/dist/domain/board-move.d.ts +90 -0
  126. package/cli/dist/domain/board-move.js +92 -0
  127. package/cli/dist/domain/branch-name.d.ts +5 -0
  128. package/cli/dist/domain/branch-name.js +10 -0
  129. package/cli/dist/domain/changelog.d.ts +43 -0
  130. package/cli/dist/domain/changelog.js +107 -0
  131. package/cli/dist/domain/command-hint.d.ts +85 -0
  132. package/cli/dist/domain/command-hint.js +148 -0
  133. package/cli/dist/domain/config.d.ts +219 -0
  134. package/cli/dist/domain/config.js +310 -0
  135. package/cli/dist/domain/dependabot-pull-requests.d.ts +82 -0
  136. package/cli/dist/domain/dependabot-pull-requests.js +338 -0
  137. package/cli/dist/domain/dependabot-source.d.ts +51 -0
  138. package/cli/dist/domain/dependabot-source.js +4 -0
  139. package/cli/dist/domain/dependabot.d.ts +47 -0
  140. package/cli/dist/domain/dependabot.js +88 -0
  141. package/cli/dist/domain/errors.d.ts +24 -0
  142. package/cli/dist/domain/errors.js +36 -0
  143. package/cli/dist/domain/field-options.d.ts +31 -0
  144. package/cli/dist/domain/field-options.js +44 -0
  145. package/cli/dist/domain/format.d.ts +94 -0
  146. package/cli/dist/domain/format.js +234 -0
  147. package/cli/dist/domain/frontmatter.d.ts +137 -0
  148. package/cli/dist/domain/frontmatter.js +290 -0
  149. package/cli/dist/domain/git-runner.d.ts +10 -0
  150. package/cli/dist/domain/git-runner.js +4 -0
  151. package/cli/dist/domain/git-url.d.ts +17 -0
  152. package/cli/dist/domain/git-url.js +30 -0
  153. package/cli/dist/domain/issue-kind.d.ts +16 -0
  154. package/cli/dist/domain/issue-kind.js +16 -0
  155. package/cli/dist/domain/issue-order.d.ts +55 -0
  156. package/cli/dist/domain/issue-order.js +65 -0
  157. package/cli/dist/domain/issue-readout.d.ts +143 -0
  158. package/cli/dist/domain/issue-readout.js +4 -0
  159. package/cli/dist/domain/json-null.d.ts +2 -0
  160. package/cli/dist/domain/json-null.js +5 -0
  161. package/cli/dist/domain/json.d.ts +21 -0
  162. package/cli/dist/domain/json.js +47 -0
  163. package/cli/dist/domain/prerequisites.d.ts +32 -0
  164. package/cli/dist/domain/prerequisites.js +192 -0
  165. package/cli/dist/domain/pull-request.d.ts +201 -0
  166. package/cli/dist/domain/pull-request.js +281 -0
  167. package/cli/dist/domain/python-format.d.ts +105 -0
  168. package/cli/dist/domain/python-format.js +304 -0
  169. package/cli/dist/domain/readiness.d.ts +199 -0
  170. package/cli/dist/domain/readiness.js +391 -0
  171. package/cli/dist/domain/reference-parser.d.ts +51 -0
  172. package/cli/dist/domain/reference-parser.js +123 -0
  173. package/cli/dist/domain/release.d.ts +53 -0
  174. package/cli/dist/domain/release.js +65 -0
  175. package/cli/dist/domain/repository-policy.d.ts +38 -0
  176. package/cli/dist/domain/repository-policy.js +66 -0
  177. package/cli/dist/domain/repository-resolver.d.ts +57 -0
  178. package/cli/dist/domain/repository-resolver.js +122 -0
  179. package/cli/dist/domain/sections.d.ts +69 -0
  180. package/cli/dist/domain/sections.js +514 -0
  181. package/cli/dist/domain/security-alerts-source.d.ts +29 -0
  182. package/cli/dist/domain/security-alerts-source.js +4 -0
  183. package/cli/dist/domain/security-alerts.d.ts +52 -0
  184. package/cli/dist/domain/security-alerts.js +107 -0
  185. package/cli/dist/domain/security-tracker.d.ts +115 -0
  186. package/cli/dist/domain/security-tracker.js +353 -0
  187. package/cli/dist/domain/state.d.ts +59 -0
  188. package/cli/dist/domain/state.js +95 -0
  189. package/cli/dist/domain/tracker-body.d.ts +70 -0
  190. package/cli/dist/domain/tracker-body.js +65 -0
  191. package/cli/dist/domain/work-start.d.ts +34 -0
  192. package/cli/dist/domain/work-start.js +49 -0
  193. package/cli/dist/domain/yaml-document.d.ts +5 -0
  194. package/cli/dist/domain/yaml-document.js +206 -0
  195. package/cli/dist/infra/authored-notes.d.ts +37 -0
  196. package/cli/dist/infra/authored-notes.js +72 -0
  197. package/cli/dist/infra/changelog-file.d.ts +19 -0
  198. package/cli/dist/infra/changelog-file.js +43 -0
  199. package/cli/dist/infra/child-stdin.d.ts +4 -0
  200. package/cli/dist/infra/child-stdin.js +8 -0
  201. package/cli/dist/infra/config-store.d.ts +53 -0
  202. package/cli/dist/infra/config-store.js +134 -0
  203. package/cli/dist/infra/diagnostics.d.ts +9 -0
  204. package/cli/dist/infra/diagnostics.js +2 -0
  205. package/cli/dist/infra/file-kind.d.ts +9 -0
  206. package/cli/dist/infra/file-kind.js +26 -0
  207. package/cli/dist/infra/frontmatter-file.d.ts +14 -0
  208. package/cli/dist/infra/frontmatter-file.js +30 -0
  209. package/cli/dist/infra/git.d.ts +86 -0
  210. package/cli/dist/infra/git.js +145 -0
  211. package/cli/dist/infra/github/auth.d.ts +60 -0
  212. package/cli/dist/infra/github/auth.js +158 -0
  213. package/cli/dist/infra/github/client.d.ts +178 -0
  214. package/cli/dist/infra/github/client.js +579 -0
  215. package/cli/dist/infra/github/dependabot-source.d.ts +13 -0
  216. package/cli/dist/infra/github/dependabot-source.js +33 -0
  217. package/cli/dist/infra/github/errors.d.ts +65 -0
  218. package/cli/dist/infra/github/errors.js +64 -0
  219. package/cli/dist/infra/github/index.d.ts +13 -0
  220. package/cli/dist/infra/github/index.js +19 -0
  221. package/cli/dist/infra/github/issues.d.ts +165 -0
  222. package/cli/dist/infra/github/issues.js +428 -0
  223. package/cli/dist/infra/github/payload.d.ts +44 -0
  224. package/cli/dist/infra/github/payload.js +80 -0
  225. package/cli/dist/infra/github/projects.d.ts +143 -0
  226. package/cli/dist/infra/github/projects.js +384 -0
  227. package/cli/dist/infra/github/pulls.d.ts +104 -0
  228. package/cli/dist/infra/github/pulls.js +217 -0
  229. package/cli/dist/infra/github/queries.d.ts +44 -0
  230. package/cli/dist/infra/github/queries.js +1031 -0
  231. package/cli/dist/infra/github/readout.d.ts +22 -0
  232. package/cli/dist/infra/github/readout.js +167 -0
  233. package/cli/dist/infra/github/repos.d.ts +86 -0
  234. package/cli/dist/infra/github/repos.js +168 -0
  235. package/cli/dist/infra/github/rest-path.d.ts +14 -0
  236. package/cli/dist/infra/github/rest-path.js +31 -0
  237. package/cli/dist/infra/github/security-alerts-source.d.ts +15 -0
  238. package/cli/dist/infra/github/security-alerts-source.js +73 -0
  239. package/cli/dist/infra/gitignore-spec.d.ts +36 -0
  240. package/cli/dist/infra/gitignore-spec.js +235 -0
  241. package/cli/dist/infra/nx-scope.d.ts +51 -0
  242. package/cli/dist/infra/nx-scope.js +182 -0
  243. package/cli/dist/infra/os-error.d.ts +24 -0
  244. package/cli/dist/infra/os-error.js +38 -0
  245. package/cli/dist/infra/paths.d.ts +88 -0
  246. package/cli/dist/infra/paths.js +234 -0
  247. package/cli/dist/infra/state-store.d.ts +54 -0
  248. package/cli/dist/infra/state-store.js +130 -0
  249. package/cli/dist/infra/template-store.d.ts +15 -0
  250. package/cli/dist/infra/template-store.js +34 -0
  251. package/cli/dist/infra/text-file.d.ts +12 -0
  252. package/cli/dist/infra/text-file.js +33 -0
  253. package/cli/dist/infra/worktree-copy.d.ts +24 -0
  254. package/cli/dist/infra/worktree-copy.js +95 -0
  255. package/cli/dist/infra/worktree-links.d.ts +142 -0
  256. package/cli/dist/infra/worktree-links.js +440 -0
  257. package/cli/dist/infra/worktree-setup.d.ts +21 -0
  258. package/cli/dist/infra/worktree-setup.js +41 -0
  259. package/cli/dist/infra/worktree.d.ts +185 -0
  260. package/cli/dist/infra/worktree.js +584 -0
  261. package/cli/dist/mcp/result.d.ts +61 -0
  262. package/cli/dist/mcp/result.js +96 -0
  263. package/cli/dist/mcp/serve.d.ts +51 -0
  264. package/cli/dist/mcp/serve.js +183 -0
  265. package/cli/dist/mcp/server.d.ts +21 -0
  266. package/cli/dist/mcp/server.js +142 -0
  267. package/cli/dist/mcp/session-directory.d.ts +26 -0
  268. package/cli/dist/mcp/session-directory.js +84 -0
  269. package/cli/dist/package.json +1 -0
  270. package/cli/dist/version.d.ts +17 -0
  271. package/cli/dist/version.js +42 -0
  272. package/cli/templates/comment/merge-diff.md +34 -0
  273. package/cli/templates/comment/plan.md +195 -0
  274. package/cli/templates/comment/precede-notify.md +33 -0
  275. package/cli/templates/comment/review-findings.md +42 -0
  276. package/cli/templates/comment/review-resolution.md +48 -0
  277. package/cli/templates/issue/bug.md +63 -0
  278. package/cli/templates/issue/epic.md +54 -0
  279. package/cli/templates/issue/task-implement.md +74 -0
  280. package/cli/templates/issue/task.md +48 -0
  281. package/cli/templates/issue/tracker.md +48 -0
  282. package/cli/templates/pr/create.md +123 -0
  283. package/cli/templates/pr/release.md +56 -0
  284. package/cli/templates/workflow/pecot-board-sync.yml +84 -0
  285. package/hooks/lib/core/pecot-gitignore-ensure.sh +48 -0
  286. package/npm-shrinkwrap.json +83 -0
  287. package/package.json +22 -4
@@ -0,0 +1,1031 @@
1
+ // GitHub GraphQL API のクエリ・mutation 文字列。
2
+ // 先頭の 30 個は cli/core/github/queries.py を gql が送る形で写し、一致は infra/github/tests/queries.test.ts が固定する。
3
+ // 末尾の blocked by 関係の 4 個は Python に無く、graphql-js の print の出力の形で書く。
4
+ // 着手の判定に使う、Issue の依存関係・種別・親のフィールド。Issue の依存関係に対応しない GHES では通らない
5
+ const ISSUE_READINESS_FIELDS = `
6
+ issueType {
7
+ name
8
+ }
9
+ subIssues(first: 1) {
10
+ totalCount
11
+ }
12
+ parent {
13
+ number
14
+ repository {
15
+ owner {
16
+ login
17
+ }
18
+ name
19
+ }
20
+ }
21
+ blockedBy(first: 1) {
22
+ totalCount
23
+ }`;
24
+ // 一覧のクエリ。operationName が空なら無名。readinessFields は Issue の枝に足すフィールド
25
+ function listProjectItemsQuery(operationName, readinessFields) {
26
+ return `query${operationName === '' ? ' ' : ` ${operationName}`}($projectId: ID!, $cursor: String) {
27
+ node(id: $projectId) {
28
+ ... on ProjectV2 {
29
+ items(first: 100, after: $cursor) {
30
+ nodes {
31
+ id
32
+ updatedAt
33
+ fieldValues(first: 10) {
34
+ nodes {
35
+ ... on ProjectV2ItemFieldSingleSelectValue {
36
+ field {
37
+ ... on ProjectV2SingleSelectField {
38
+ name
39
+ }
40
+ }
41
+ name
42
+ }
43
+ }
44
+ }
45
+ content {
46
+ ... on Issue {
47
+ id
48
+ number
49
+ title
50
+ state
51
+ url${readinessFields}
52
+ labels(first: 10) {
53
+ nodes {
54
+ name
55
+ }
56
+ }
57
+ repository {
58
+ owner {
59
+ login
60
+ }
61
+ name
62
+ }
63
+ }
64
+ ... on PullRequest {
65
+ id
66
+ number
67
+ title
68
+ state
69
+ url
70
+ repository {
71
+ owner {
72
+ login
73
+ }
74
+ name
75
+ }
76
+ }
77
+ }
78
+ }
79
+ pageInfo {
80
+ hasNextPage
81
+ endCursor
82
+ }
83
+ }
84
+ }
85
+ }
86
+ }`;
87
+ }
88
+ // プロジェクトアイテム一覧取得(ページネーション対応)
89
+ export const QUERY_LIST_PROJECT_ITEMS = listProjectItemsQuery('', ISSUE_READINESS_FIELDS);
90
+ // 上の一覧から、Issue の依存関係に対応しない GHES で通らないフィールドを除いたもの
91
+ export const QUERY_LIST_PROJECT_ITEMS_LEGACY = listProjectItemsQuery('ListProjectItemsLegacy', '');
92
+ // プロジェクトアイテム一覧取得(フィルタリング対応)
93
+ export const QUERY_LIST_PROJECT_ITEMS_FILTERED = `query ($projectId: ID!, $cursor: String, $filterQuery: String) {
94
+ node(id: $projectId) {
95
+ ... on ProjectV2 {
96
+ items(first: 100, after: $cursor, query: $filterQuery) {
97
+ nodes {
98
+ id
99
+ updatedAt
100
+ fieldValues(first: 10) {
101
+ nodes {
102
+ ... on ProjectV2ItemFieldSingleSelectValue {
103
+ field {
104
+ ... on ProjectV2SingleSelectField {
105
+ name
106
+ }
107
+ }
108
+ name
109
+ }
110
+ }
111
+ }
112
+ content {
113
+ ... on Issue {
114
+ id
115
+ number
116
+ title
117
+ state
118
+ url
119
+ labels(first: 10) {
120
+ nodes {
121
+ name
122
+ }
123
+ }
124
+ repository {
125
+ owner {
126
+ login
127
+ }
128
+ name
129
+ }
130
+ }
131
+ ... on PullRequest {
132
+ id
133
+ number
134
+ title
135
+ state
136
+ url
137
+ repository {
138
+ owner {
139
+ login
140
+ }
141
+ name
142
+ }
143
+ }
144
+ }
145
+ }
146
+ pageInfo {
147
+ hasNextPage
148
+ endCursor
149
+ }
150
+ }
151
+ }
152
+ }
153
+ }`;
154
+ // Issue Node ID・タイトル取得
155
+ export const QUERY_GET_ISSUE_NODE_ID = `query ($owner: String!, $repo: String!, $number: Int!) {
156
+ repository(owner: $owner, name: $repo) {
157
+ issue(number: $number) {
158
+ id
159
+ title
160
+ }
161
+ }
162
+ }`;
163
+ // リンクリポジトリ取得(user版)
164
+ export const QUERY_GET_LINKED_REPOSITORIES_USER = `query ($owner: String!, $projectNumber: Int!) {
165
+ user(login: $owner) {
166
+ projectV2(number: $projectNumber) {
167
+ repositories(first: 100) {
168
+ nodes {
169
+ owner {
170
+ login
171
+ }
172
+ name
173
+ }
174
+ }
175
+ }
176
+ }
177
+ }`;
178
+ // リンクリポジトリ取得(organization版)
179
+ export const QUERY_GET_LINKED_REPOSITORIES_ORG = `query ($owner: String!, $projectNumber: Int!) {
180
+ organization(login: $owner) {
181
+ projectV2(number: $projectNumber) {
182
+ repositories(first: 100) {
183
+ nodes {
184
+ owner {
185
+ login
186
+ }
187
+ name
188
+ }
189
+ }
190
+ }
191
+ }
192
+ }`;
193
+ // プロジェクトNode ID取得(user版)
194
+ export const QUERY_GET_PROJECT_ID_USER = `query ($owner: String!, $projectNumber: Int!) {
195
+ user(login: $owner) {
196
+ projectV2(number: $projectNumber) {
197
+ id
198
+ }
199
+ }
200
+ }`;
201
+ // プロジェクトNode ID取得(organization版)
202
+ export const QUERY_GET_PROJECT_ID_ORG = `query ($owner: String!, $projectNumber: Int!) {
203
+ organization(login: $owner) {
204
+ projectV2(number: $projectNumber) {
205
+ id
206
+ }
207
+ }
208
+ }`;
209
+ // リポジトリNode ID取得
210
+ export const QUERY_GET_REPOSITORY_ID = `query ($owner: String!, $name: String!) {
211
+ repository(owner: $owner, name: $name) {
212
+ id
213
+ }
214
+ }`;
215
+ // プロジェクトにリポジトリをリンク
216
+ export const MUTATION_LINK_PROJECT_REPOSITORY = `mutation ($projectId: ID!, $repositoryId: ID!) {
217
+ linkProjectV2ToRepository(
218
+ input: { projectId: $projectId, repositoryId: $repositoryId }
219
+ ) {
220
+ repository {
221
+ id
222
+ nameWithOwner
223
+ }
224
+ }
225
+ }`;
226
+ // ボードにアイテム追加
227
+ export const MUTATION_ADD_TO_PROJECT = `mutation ($projectId: ID!, $contentId: ID!) {
228
+ addProjectV2ItemById(input: { projectId: $projectId, contentId: $contentId }) {
229
+ item {
230
+ id
231
+ }
232
+ }
233
+ }`;
234
+ // プロジェクトアイテムフィールド更新
235
+ export const MUTATION_UPDATE_PROJECT_ITEM_FIELD = `mutation ($projectId: ID!, $itemId: ID!, $fieldId: ID!, $optionId: String!) {
236
+ updateProjectV2ItemFieldValue(
237
+ input: {
238
+ projectId: $projectId
239
+ itemId: $itemId
240
+ fieldId: $fieldId
241
+ value: { singleSelectOptionId: $optionId }
242
+ }
243
+ ) {
244
+ projectV2Item {
245
+ id
246
+ }
247
+ }
248
+ }`;
249
+ // プロジェクトアイテム削除
250
+ export const MUTATION_DELETE_PROJECT_ITEM = `mutation ($projectId: ID!, $itemId: ID!) {
251
+ deleteProjectV2Item(input: { projectId: $projectId, itemId: $itemId }) {
252
+ deletedItemId
253
+ }
254
+ }`;
255
+ // プロジェクトアイテムのアーカイブを解く
256
+ export const MUTATION_UNARCHIVE_PROJECT_ITEM = `mutation ($projectId: ID!, $itemId: ID!) {
257
+ unarchiveProjectV2Item(input: { projectId: $projectId, itemId: $itemId }) {
258
+ item {
259
+ id
260
+ }
261
+ }
262
+ }`;
263
+ // サブIssue紐づけ
264
+ export const MUTATION_ADD_SUB_ISSUE = `mutation ($parentId: ID!, $childId: ID!) {
265
+ addSubIssue(input: { issueId: $parentId, subIssueId: $childId }) {
266
+ issue {
267
+ number
268
+ }
269
+ subIssue {
270
+ number
271
+ }
272
+ }
273
+ }`;
274
+ // リンクブランチ作成(Issueに紐づいたブランチ)
275
+ export const MUTATION_CREATE_LINKED_BRANCH = `mutation CreateLinkedBranch($input: CreateLinkedBranchInput!) {
276
+ createLinkedBranch(input: $input) {
277
+ linkedBranch {
278
+ ref {
279
+ name
280
+ prefix
281
+ }
282
+ }
283
+ }
284
+ }`;
285
+ // Issue番号からプロジェクトアイテム取得(高速版)
286
+ export const QUERY_GET_ISSUE_PROJECT_ITEMS = `query ($owner: String!, $repo: String!, $number: Int!) {
287
+ repository(owner: $owner, name: $repo) {
288
+ issue(number: $number) {
289
+ projectItems(first: 20) {
290
+ nodes {
291
+ id
292
+ isArchived
293
+ project {
294
+ id
295
+ }
296
+ fieldValues(first: 20) {
297
+ nodes {
298
+ ... on ProjectV2ItemFieldSingleSelectValue {
299
+ field {
300
+ ... on ProjectV2SingleSelectField {
301
+ id
302
+ }
303
+ }
304
+ }
305
+ }
306
+ }
307
+ }
308
+ }
309
+ }
310
+ }
311
+ }`;
312
+ // プロジェクト一覧取得(user版)
313
+ export const QUERY_LIST_PROJECTS_USER = `query ($owner: String!, $first: Int!) {
314
+ user(login: $owner) {
315
+ projectsV2(first: $first) {
316
+ nodes {
317
+ number
318
+ title
319
+ url
320
+ id
321
+ }
322
+ }
323
+ }
324
+ }`;
325
+ // プロジェクト一覧取得(organization版)
326
+ export const QUERY_LIST_PROJECTS_ORG = `query ($owner: String!, $first: Int!) {
327
+ organization(login: $owner) {
328
+ projectsV2(first: $first) {
329
+ nodes {
330
+ number
331
+ title
332
+ url
333
+ id
334
+ }
335
+ }
336
+ }
337
+ }`;
338
+ // プロジェクトフィールド取得(user版)
339
+ export const QUERY_GET_PROJECT_FIELDS_USER = `query ($owner: String!, $projectNumber: Int!) {
340
+ user(login: $owner) {
341
+ projectV2(number: $projectNumber) {
342
+ id
343
+ title
344
+ url
345
+ fields(first: 50) {
346
+ nodes {
347
+ ... on ProjectV2SingleSelectField {
348
+ id
349
+ databaseId
350
+ name
351
+ options {
352
+ id
353
+ name
354
+ color
355
+ description
356
+ }
357
+ }
358
+ ... on ProjectV2Field {
359
+ id
360
+ name
361
+ }
362
+ }
363
+ }
364
+ views(first: 1) {
365
+ nodes {
366
+ number
367
+ }
368
+ }
369
+ }
370
+ }
371
+ }`;
372
+ // プロジェクトフィールド取得(organization版)
373
+ export const QUERY_GET_PROJECT_FIELDS_ORG = `query ($owner: String!, $projectNumber: Int!) {
374
+ organization(login: $owner) {
375
+ projectV2(number: $projectNumber) {
376
+ id
377
+ title
378
+ url
379
+ fields(first: 50) {
380
+ nodes {
381
+ ... on ProjectV2SingleSelectField {
382
+ id
383
+ databaseId
384
+ name
385
+ options {
386
+ id
387
+ name
388
+ color
389
+ description
390
+ }
391
+ }
392
+ ... on ProjectV2Field {
393
+ id
394
+ name
395
+ }
396
+ }
397
+ }
398
+ views(first: 1) {
399
+ nodes {
400
+ number
401
+ }
402
+ }
403
+ }
404
+ }
405
+ }`;
406
+ // プロジェクトフィールド作成(SingleSelect用)
407
+ export const MUTATION_CREATE_PROJECT_FIELD = `mutation ($projectId: ID!, $name: String!, $options: [ProjectV2SingleSelectFieldOptionInput!]!) {
408
+ createProjectV2Field(
409
+ input: {
410
+ projectId: $projectId
411
+ dataType: SINGLE_SELECT
412
+ name: $name
413
+ singleSelectOptions: $options
414
+ }
415
+ ) {
416
+ projectV2Field {
417
+ ... on ProjectV2SingleSelectField {
418
+ id
419
+ name
420
+ options {
421
+ id
422
+ name
423
+ }
424
+ }
425
+ }
426
+ }
427
+ }`;
428
+ // プロジェクトフィールドの選択肢の置き換え(SingleSelect用。一覧の全体を送る)
429
+ export const MUTATION_UPDATE_PROJECT_FIELD = `mutation ($fieldId: ID!, $options: [ProjectV2SingleSelectFieldOptionInput!]!) {
430
+ updateProjectV2Field(
431
+ input: { fieldId: $fieldId, singleSelectOptions: $options }
432
+ ) {
433
+ projectV2Field {
434
+ ... on ProjectV2SingleSelectField {
435
+ id
436
+ name
437
+ options {
438
+ id
439
+ name
440
+ }
441
+ }
442
+ }
443
+ }
444
+ }`;
445
+ // ユーザーNode ID取得
446
+ export const QUERY_GET_USER_NODE_ID = `query ($login: String!) {
447
+ user(login: $login) {
448
+ id
449
+ }
450
+ }`;
451
+ // 組織Node ID取得
452
+ export const QUERY_GET_ORG_NODE_ID = `query ($login: String!) {
453
+ organization(login: $login) {
454
+ id
455
+ }
456
+ }`;
457
+ // プロジェクト作成
458
+ export const MUTATION_CREATE_PROJECT = `mutation ($ownerId: ID!, $title: String!) {
459
+ createProjectV2(input: { ownerId: $ownerId, title: $title }) {
460
+ projectV2 {
461
+ id
462
+ number
463
+ title
464
+ url
465
+ }
466
+ }
467
+ }`;
468
+ // Issue 種別判定用クエリ(軽量・Epic 判定専用)
469
+ // Phase2: issueType.name == "Epic" を一次判定
470
+ export const QUERY_GET_ISSUE_KIND = `query ($owner: String!, $repo: String!, $number: Int!) {
471
+ repository(owner: $owner, name: $repo) {
472
+ issue(number: $number) {
473
+ number
474
+ state
475
+ issueType {
476
+ name
477
+ }
478
+ subIssues(first: 1) {
479
+ totalCount
480
+ }
481
+ }
482
+ }
483
+ }`;
484
+ // issueType フィールド非対応 GHES 向けのフォールバック(Phase1 単独)
485
+ export const QUERY_GET_ISSUE_KIND_PHASE1 = `query ($owner: String!, $repo: String!, $number: Int!) {
486
+ repository(owner: $owner, name: $repo) {
487
+ issue(number: $number) {
488
+ number
489
+ state
490
+ subIssues(first: 1) {
491
+ totalCount
492
+ }
493
+ }
494
+ }
495
+ }`;
496
+ // Issue詳細取得のクエリ。blockedByCount は前提の件数のフィールド。Issue の依存関係に対応しない GHES では通らない
497
+ function getIssueSlimQuery(operationName, blockedByCount) {
498
+ return `query${operationName === '' ? ' ' : ` ${operationName}`}($owner: String!, $repo: String!, $number: Int!, $commentLimit: Int!) {
499
+ repository(owner: $owner, name: $repo) {
500
+ issue(number: $number) {
501
+ number
502
+ state
503
+ title
504
+ body
505
+ comments(last: $commentLimit) {
506
+ totalCount
507
+ nodes {
508
+ author {
509
+ login
510
+ }
511
+ createdAt
512
+ body
513
+ }
514
+ }
515
+ parent {
516
+ number
517
+ title
518
+ state
519
+ repository {
520
+ owner {
521
+ login
522
+ }
523
+ name
524
+ }
525
+ }
526
+ subIssues(first: 20) {
527
+ nodes {
528
+ number
529
+ state
530
+ title
531
+ }
532
+ pageInfo {
533
+ hasNextPage
534
+ endCursor
535
+ }
536
+ }
537
+ linkedBranches(first: 10) {
538
+ nodes {
539
+ ref {
540
+ name
541
+ }
542
+ }
543
+ }
544
+ timelineItems(itemTypes: [CONNECTED_EVENT, CROSS_REFERENCED_EVENT], first: 20) {
545
+ nodes {
546
+ ... on ConnectedEvent {
547
+ subject {
548
+ ... on PullRequest {
549
+ number
550
+ title
551
+ state
552
+ }
553
+ }
554
+ }
555
+ ... on CrossReferencedEvent {
556
+ source {
557
+ ... on PullRequest {
558
+ number
559
+ title
560
+ state
561
+ }
562
+ }
563
+ }
564
+ }
565
+ }${blockedByCount}
566
+ }
567
+ }
568
+ }`;
569
+ }
570
+ // Issue詳細取得(スリム版 - 必要なフィールドのみ。前提の件数つき)
571
+ export const QUERY_GET_ISSUE_SLIM = getIssueSlimQuery('', `
572
+ blockedBy(first: 1) {
573
+ totalCount
574
+ }`);
575
+ // 上のクエリから、前提の件数を除いたもの。Issue の依存関係を持たない GHES で読み直すのに使う
576
+ export const QUERY_GET_ISSUE_SLIM_WITHOUT_BLOCKED_BY = getIssueSlimQuery('GetIssueSlimWithoutBlockedBy', '');
577
+ // Python 版 queries.py の QUERY_GET_SUB_ISSUES_PAGE と逐語で一致させる。
578
+ export const QUERY_GET_SUB_ISSUES_PAGE = `query ($owner: String!, $repo: String!, $number: Int!, $after: String!) {
579
+ repository(owner: $owner, name: $repo) {
580
+ issue(number: $number) {
581
+ subIssues(first: 100, after: $after) {
582
+ nodes {
583
+ number
584
+ state
585
+ title
586
+ }
587
+ pageInfo {
588
+ hasNextPage
589
+ endCursor
590
+ }
591
+ }
592
+ }
593
+ }
594
+ }`;
595
+ // PR詳細取得(スリム版 - 必要なフィールドのみ)
596
+ export const QUERY_GET_PULL_REQUEST_SLIM = `query ($owner: String!, $repo: String!, $number: Int!) {
597
+ repository(owner: $owner, name: $repo) {
598
+ pullRequest(number: $number) {
599
+ number
600
+ state
601
+ title
602
+ body
603
+ headRefName
604
+ baseRefName
605
+ isDraft
606
+ mergeable
607
+ comments {
608
+ totalCount
609
+ }
610
+ closingIssuesReferences(first: 10) {
611
+ nodes {
612
+ number
613
+ title
614
+ }
615
+ }
616
+ reviews(first: 10) {
617
+ nodes {
618
+ state
619
+ author {
620
+ login
621
+ }
622
+ }
623
+ }
624
+ }
625
+ }
626
+ }`;
627
+ // PR詳細取得(レビュー詳細付き - --reviews オプション用)
628
+ export const QUERY_GET_PULL_REQUEST_WITH_REVIEWS = `query ($owner: String!, $repo: String!, $number: Int!) {
629
+ repository(owner: $owner, name: $repo) {
630
+ pullRequest(number: $number) {
631
+ number
632
+ state
633
+ title
634
+ body
635
+ headRefName
636
+ baseRefName
637
+ isDraft
638
+ mergeable
639
+ comments {
640
+ totalCount
641
+ }
642
+ closingIssuesReferences(first: 10) {
643
+ nodes {
644
+ number
645
+ title
646
+ }
647
+ }
648
+ reviews(first: 20) {
649
+ nodes {
650
+ state
651
+ body
652
+ author {
653
+ login
654
+ }
655
+ submittedAt
656
+ }
657
+ }
658
+ reviewThreads(first: 50) {
659
+ nodes {
660
+ isResolved
661
+ path
662
+ line
663
+ comments(first: 10) {
664
+ nodes {
665
+ author {
666
+ login
667
+ }
668
+ body
669
+ createdAt
670
+ }
671
+ }
672
+ }
673
+ }
674
+ }
675
+ }
676
+ }`;
677
+ // open の PR の一覧。dependabot の PR の待ち状態の判定に使う。ページを辿る
678
+ // 入れ子の connection が多く、ノード数の上限に近づくので first は 25 にしている。
679
+ // timelineItems は、2 種のイベントを合わせて last: N だと force-push が多いときに片方が押し出されるため、
680
+ // 種類ごとに別名で最後の 1 件だけを取る。
681
+ export const QUERY_LIST_OPEN_PULL_REQUESTS = `query ($owner: String!, $repo: String!, $after: String) {
682
+ repository(owner: $owner, name: $repo) {
683
+ pullRequests(
684
+ first: 25
685
+ states: OPEN
686
+ after: $after
687
+ orderBy: { field: CREATED_AT, direction: ASC }
688
+ ) {
689
+ pageInfo {
690
+ hasNextPage
691
+ endCursor
692
+ }
693
+ nodes {
694
+ number
695
+ title
696
+ url
697
+ createdAt
698
+ author {
699
+ __typename
700
+ login
701
+ }
702
+ isInMergeQueue
703
+ autoMergeRequest {
704
+ enabledAt
705
+ }
706
+ mergeable
707
+ baseRef {
708
+ target {
709
+ ... on Commit {
710
+ committedDate
711
+ }
712
+ }
713
+ }
714
+ firstCommits: commits(first: 1) {
715
+ nodes {
716
+ commit {
717
+ message
718
+ signature {
719
+ isValid
720
+ }
721
+ author {
722
+ user {
723
+ login
724
+ }
725
+ }
726
+ }
727
+ }
728
+ }
729
+ headCommits: commits(last: 1) {
730
+ nodes {
731
+ commit {
732
+ statusCheckRollup {
733
+ state
734
+ }
735
+ }
736
+ }
737
+ }
738
+ lastForcePush: timelineItems(last: 1, itemTypes: [HEAD_REF_FORCE_PUSHED_EVENT]) {
739
+ nodes {
740
+ ... on HeadRefForcePushedEvent {
741
+ createdAt
742
+ }
743
+ }
744
+ }
745
+ lastDequeue: timelineItems(last: 1, itemTypes: [REMOVED_FROM_MERGE_QUEUE_EVENT]) {
746
+ nodes {
747
+ ... on RemovedFromMergeQueueEvent {
748
+ createdAt
749
+ }
750
+ }
751
+ }
752
+ }
753
+ }
754
+ }
755
+ }`;
756
+ // 前提(blocked by)を付ける入力の型があるか。対応しない GHES(3.19 より前)では null になる
757
+ export const QUERY_HAS_ADD_BLOCKED_BY_INPUT = `{
758
+ __type(name: "AddBlockedByInput") {
759
+ name
760
+ }
761
+ }`;
762
+ // 前提(blocked by)を付ける。issueId が待つ側、blockingIssueId が前提
763
+ export const MUTATION_ADD_BLOCKED_BY = `mutation ($issueId: ID!, $blockingIssueId: ID!) {
764
+ addBlockedBy(input: { issueId: $issueId, blockingIssueId: $blockingIssueId }) {
765
+ issue {
766
+ number
767
+ }
768
+ blockingIssue {
769
+ number
770
+ }
771
+ }
772
+ }`;
773
+ // 前提(blocked by)を外す
774
+ export const MUTATION_REMOVE_BLOCKED_BY = `mutation ($issueId: ID!, $blockingIssueId: ID!) {
775
+ removeBlockedBy(input: { issueId: $issueId, blockingIssueId: $blockingIssueId }) {
776
+ issue {
777
+ number
778
+ }
779
+ blockingIssue {
780
+ number
781
+ }
782
+ }
783
+ }`;
784
+ const PULL_REQUEST_FIELDS = `fragment PullRequestFields on PullRequest {
785
+ number
786
+ state
787
+ headRefName
788
+ baseRefName
789
+ isDraft
790
+ isCrossRepository
791
+ repository {
792
+ owner {
793
+ login
794
+ }
795
+ name
796
+ }
797
+ }`;
798
+ const PREREQUISITE_ISSUE_FIELDS = `fragment PrerequisiteIssueFields on Issue {
799
+ id
800
+ number
801
+ state
802
+ title
803
+ repository {
804
+ owner {
805
+ login
806
+ }
807
+ name
808
+ }
809
+ issueType {
810
+ name
811
+ }
812
+ subIssues(first: 1) {
813
+ totalCount
814
+ }
815
+ projectItems(first: 20, includeArchived: false) {
816
+ totalCount
817
+ nodes {
818
+ project {
819
+ id
820
+ }
821
+ column: fieldValueByName(name: $columnFieldName) {
822
+ ...SingleSelectValueFields
823
+ }
824
+ label: fieldValueByName(name: $labelFieldName) {
825
+ ...SingleSelectValueFields
826
+ }
827
+ }
828
+ }
829
+ linkedBranches(first: 10) {
830
+ totalCount
831
+ nodes {
832
+ ref {
833
+ name
834
+ associatedPullRequests(first: 10) {
835
+ totalCount
836
+ nodes {
837
+ ...PullRequestFields
838
+ }
839
+ }
840
+ }
841
+ }
842
+ }
843
+ closedByPullRequestsReferences(first: 10, includeClosedPrs: true) {
844
+ totalCount
845
+ nodes {
846
+ ...PullRequestFields
847
+ }
848
+ }
849
+ timelineItems(
850
+ itemTypes: [CONNECTED_EVENT, DISCONNECTED_EVENT, CROSS_REFERENCED_EVENT]
851
+ first: 20
852
+ ) {
853
+ totalCount
854
+ nodes {
855
+ __typename
856
+ ... on ConnectedEvent {
857
+ subject {
858
+ ... on PullRequest {
859
+ ...PullRequestFields
860
+ }
861
+ }
862
+ }
863
+ ... on DisconnectedEvent {
864
+ subject {
865
+ ... on PullRequest {
866
+ ...PullRequestFields
867
+ }
868
+ }
869
+ }
870
+ ... on CrossReferencedEvent {
871
+ willCloseTarget
872
+ source {
873
+ ... on PullRequest {
874
+ ...PullRequestFields
875
+ }
876
+ }
877
+ }
878
+ }
879
+ }
880
+ }`;
881
+ const SINGLE_SELECT_VALUE_FIELDS = `fragment SingleSelectValueFields on ProjectV2ItemFieldValue {
882
+ ... on ProjectV2ItemFieldSingleSelectValue {
883
+ name
884
+ optionId
885
+ field {
886
+ ... on ProjectV2SingleSelectField {
887
+ id
888
+ }
889
+ }
890
+ }
891
+ }`;
892
+ // Issue と、その前提(blockedBy)を 1 回で読む。PR は 3 つの読み口から集める
893
+ export const QUERY_GET_ISSUE_PREREQUISITES = `query ($owner: String!, $repo: String!, $number: Int!, $columnFieldName: String!, $labelFieldName: String!, $blockedByFirst: Int!) {
894
+ repository(owner: $owner, name: $repo) {
895
+ issue(number: $number) {
896
+ ...PrerequisiteIssueFields
897
+ body
898
+ parent {
899
+ number
900
+ repository {
901
+ owner {
902
+ login
903
+ }
904
+ name
905
+ }
906
+ }
907
+ blockedBy(first: $blockedByFirst) {
908
+ totalCount
909
+ nodes {
910
+ ...PrerequisiteIssueFields
911
+ }
912
+ }
913
+ }
914
+ }
915
+ }
916
+
917
+ ${PREREQUISITE_ISSUE_FIELDS}
918
+
919
+ ${SINGLE_SELECT_VALUE_FIELDS}
920
+
921
+ ${PULL_REQUEST_FIELDS}`;
922
+ // head のブランチ名で PR を引く(open・closed・merged。新しい順)
923
+ export const QUERY_LIST_PULL_REQUESTS_BY_HEAD = `query ($owner: String!, $repo: String!, $headRefName: String!) {
924
+ repository(owner: $owner, name: $repo) {
925
+ pullRequests(
926
+ headRefName: $headRefName
927
+ states: [OPEN, CLOSED, MERGED]
928
+ first: 20
929
+ orderBy: { field: CREATED_AT, direction: DESC }
930
+ ) {
931
+ pageInfo {
932
+ hasNextPage
933
+ }
934
+ nodes {
935
+ ...PullRequestFields
936
+ }
937
+ }
938
+ }
939
+ }
940
+
941
+ ${PULL_REQUEST_FIELDS}`;
942
+ const BLOCKED_BY_REFERENCE_FIELDS = `fragment BlockedByReferenceFields on Issue {
943
+ id
944
+ number
945
+ state
946
+ repository {
947
+ owner {
948
+ login
949
+ }
950
+ name
951
+ }
952
+ }`;
953
+ // 前提の追加・削除の前の読み取り。判定の読み取りより軽く、本文と前提の参照だけを取る
954
+ export const QUERY_GET_ISSUE_BLOCKED_BY_REFERENCES = `query ($owner: String!, $repo: String!, $number: Int!, $blockedByFirst: Int!) {
955
+ repository(owner: $owner, name: $repo) {
956
+ issue(number: $number) {
957
+ id
958
+ body
959
+ blockedBy(first: $blockedByFirst) {
960
+ totalCount
961
+ nodes {
962
+ ...BlockedByReferenceFields
963
+ }
964
+ }
965
+ }
966
+ }
967
+ }
968
+
969
+ ${BLOCKED_BY_REFERENCE_FIELDS}`;
970
+ // 輪をたどる 1 段分。node ID の並びのそれぞれの前提を、まとめて読む
971
+ export const QUERY_GET_BLOCKED_BY_OF_NODES = `query ($ids: [ID!]!, $blockedByFirst: Int!) {
972
+ nodes(ids: $ids) {
973
+ ... on Issue {
974
+ id
975
+ blockedBy(first: $blockedByFirst) {
976
+ totalCount
977
+ nodes {
978
+ ...BlockedByReferenceFields
979
+ }
980
+ }
981
+ }
982
+ }
983
+ }
984
+
985
+ ${BLOCKED_BY_REFERENCE_FIELDS}`;
986
+ // その Issue を前提にしている Issue(blocking)の参照。PR を作った後に、待つ側の Issue を絞るために読む
987
+ export const QUERY_GET_ISSUE_BLOCKING_REFERENCES = `query ($owner: String!, $repo: String!, $number: Int!, $blockingFirst: Int!) {
988
+ repository(owner: $owner, name: $repo) {
989
+ issue(number: $number) {
990
+ blocking(first: $blockingFirst) {
991
+ totalCount
992
+ nodes {
993
+ ...BlockedByReferenceFields
994
+ }
995
+ }
996
+ }
997
+ }
998
+ }
999
+
1000
+ ${BLOCKED_BY_REFERENCE_FIELDS}`;
1001
+ // Issue 1 件の、指定のプロジェクトの項目と進行の列。ボード全体を読まずに、列を動かす対象を読む
1002
+ export const QUERY_GET_ISSUE_BOARD_ITEM = `query ($owner: String!, $repo: String!, $number: Int!, $workflowFieldName: String!) {
1003
+ repository(owner: $owner, name: $repo) {
1004
+ issue(number: $number) {
1005
+ number
1006
+ title
1007
+ state
1008
+ url
1009
+ repository {
1010
+ owner {
1011
+ login
1012
+ }
1013
+ name
1014
+ }
1015
+ projectItems(first: 20, includeArchived: false) {
1016
+ nodes {
1017
+ id
1018
+ project {
1019
+ id
1020
+ }
1021
+ workflow: fieldValueByName(name: $workflowFieldName) {
1022
+ ... on ProjectV2ItemFieldSingleSelectValue {
1023
+ name
1024
+ }
1025
+ }
1026
+ }
1027
+ }
1028
+ }
1029
+ }
1030
+ }`;
1031
+ //# sourceMappingURL=queries.js.map