@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,217 @@
1
+ // Pull Request 操作の API。cli/core/github/pulls.py の移植。
2
+ // 返す値のキー名は、Python の辞書と同じ snake_case にする(CLI の JSON 出力がそのまま使う)。
3
+ import { isJsonObject, jsonField } from '../../domain/json.js';
4
+ import { JSON_NULL } from '../../domain/json-null.js';
5
+ import { extractReferencesIssueNumbers } from '../../domain/reference-parser.js';
6
+ import { isJsonArray } from '../../domain/python-format.js';
7
+ import { GitHubAPIError, GitHubNotFoundError } from './errors.js';
8
+ import { IssuesApi } from './issues.js';
9
+ import { asObject, isTruthy, numberOrNull, requireNumber, requireString, requireValue, stringOrNull, throwMalformed, truthyNodes } from './payload.js';
10
+ import { QUERY_GET_PULL_REQUEST_SLIM, QUERY_GET_PULL_REQUEST_WITH_REVIEWS, QUERY_LIST_OPEN_PULL_REQUESTS, QUERY_LIST_PULL_REQUESTS_BY_HEAD } from './queries.js';
11
+ import { readPullRequests } from './readout.js';
12
+ import { repositoryPath } from './rest-path.js';
13
+ /**
14
+ Stacks API が求める X-GitHub-Api-Version(https://docs.github.com/en/rest/pulls/stacks)
15
+ */
16
+ export const STACKS_API_VERSION = '2026-03-10';
17
+ function readStack(value) {
18
+ if (!isJsonObject(value))
19
+ throwMalformed('stack');
20
+ const pullRequests = jsonField(value, 'pull_requests');
21
+ if (!isJsonArray(pullRequests))
22
+ throwMalformed('stack.pull_requests');
23
+ return {
24
+ number: requireNumber(jsonField(value, 'number'), 'stack.number'),
25
+ pullRequests: pullRequests.map(pullRequest => requireNumber(jsonField(pullRequest, 'number'), 'stack.pull_requests.number')),
26
+ };
27
+ }
28
+ // 番号の型を問わずに、その PR を含むか。数でない番号でも含めば、readStack が形の誤りとして止める
29
+ function hasPullRequestNumber(stack, pullRequestNumber) {
30
+ const pullRequests = jsonField(stack, 'pull_requests');
31
+ return isJsonArray(pullRequests) && pullRequests.some((pullRequest) => {
32
+ const number = jsonField(pullRequest, 'number');
33
+ return number === pullRequestNumber || number === String(pullRequestNumber);
34
+ });
35
+ }
36
+ // author がある場合だけ login を読む。author が無い(削除されたユーザーなど)、または login が空なら null
37
+ function loginOrNull(author) {
38
+ const login = jsonField(author, 'login');
39
+ return isTruthy(login) ? stringOrNull(login) : JSON_NULL;
40
+ }
41
+ function formatPullRequestBase(pullRequest, owner, repository) {
42
+ const closingIssues = truthyNodes(jsonField(pullRequest, 'closingIssuesReferences')).map(issue => ({
43
+ number: requireNumber(jsonField(issue, 'number'), 'closingIssue.number'),
44
+ title: requireString(jsonField(issue, 'title'), 'closingIssue.title'),
45
+ }));
46
+ // Refs #XXX(本文から抽出)。Closing Issues と重複しないものだけ
47
+ const closingNumbers = new Set(closingIssues.map(issue => issue.number));
48
+ const body = jsonField(pullRequest, 'body');
49
+ const referenced = extractReferencesIssueNumbers(typeof body === 'string' ? body : undefined, { owner, repository });
50
+ const referencedIssues = [...referenced].filter(number => !closingNumbers.has(number)).toSorted((a, b) => a - b).map(number => ({ number, title: '' }));
51
+ const isDraft = jsonField(pullRequest, 'isDraft');
52
+ return {
53
+ number: requireNumber(jsonField(pullRequest, 'number'), 'pullRequest.number'),
54
+ state: requireString(jsonField(pullRequest, 'state'), 'pullRequest.state'),
55
+ title: requireString(jsonField(pullRequest, 'title'), 'pullRequest.title'),
56
+ body: requireString(body, 'pullRequest.body'),
57
+ head_ref: requireString(jsonField(pullRequest, 'headRefName'), 'pullRequest.headRefName'),
58
+ base_ref: requireString(jsonField(pullRequest, 'baseRefName'), 'pullRequest.baseRefName'),
59
+ is_draft: typeof isDraft === 'boolean' ? isDraft : throwMalformed('pullRequest.isDraft'),
60
+ mergeable: requireString(jsonField(pullRequest, 'mergeable'), 'pullRequest.mergeable'),
61
+ comments: requireNumber(jsonField(jsonField(pullRequest, 'comments'), 'totalCount'), 'pullRequest.comments.totalCount'),
62
+ closing_issues: closingIssues,
63
+ referenced_issues: referencedIssues,
64
+ };
65
+ }
66
+ function isDependabotAuthor(node) {
67
+ if (!isJsonObject(node))
68
+ return false;
69
+ const author = jsonField(node, 'author');
70
+ return jsonField(author, '__typename') === 'Bot' && jsonField(author, 'login') === 'dependabot';
71
+ }
72
+ function requiredTextOrEmpty(value) {
73
+ return isTruthy(value) ? requireString(value, 'text') : '';
74
+ }
75
+ export class PullsApi extends IssuesApi {
76
+ // PR の取得クエリを実行し、pullRequest ノードを返す
77
+ async fetchPullRequest(query, owner, repository, number) {
78
+ const result = await this.executeGraphql(query, { owner, repo: repository, number });
79
+ const repositoryNode = jsonField(result, 'repository');
80
+ if (!isTruthy(repositoryNode))
81
+ throw new GitHubNotFoundError(`repository not found: ${owner}/${repository}`);
82
+ const pullRequest = jsonField(repositoryNode, 'pullRequest');
83
+ if (!isTruthy(pullRequest))
84
+ throw new GitHubNotFoundError(`PR not found: ${owner}/${repository}/${String(number)}`);
85
+ return requireValue(pullRequest, 'pullRequest');
86
+ }
87
+ /**
88
+ head のブランチ名で PR を引く(open・closed・merged。新しい順に先頭 20 件)。
89
+ 20 件に収まらないときは hasNextPage が真。リポが無ければ GitHubNotFoundError
90
+ */
91
+ async listPullRequestsByHead(owner, repository, headReferenceName) {
92
+ const result = await this.executeGraphql(QUERY_LIST_PULL_REQUESTS_BY_HEAD, { owner, repo: repository, headRefName: headReferenceName });
93
+ const repositoryNode = jsonField(result, 'repository');
94
+ if (!isTruthy(repositoryNode))
95
+ throw new GitHubNotFoundError(`repository not found: ${owner}/${repository}`);
96
+ const connection = jsonField(repositoryNode, 'pullRequests');
97
+ return {
98
+ pullRequests: readPullRequests(truthyNodes(connection)),
99
+ hasNextPage: jsonField(jsonField(connection, 'pageInfo'), 'hasNextPage') === true,
100
+ };
101
+ }
102
+ /**
103
+ PR を作る
104
+ */
105
+ async createPullRequest(owner, repository, title, body, head, base, isDraft = false) {
106
+ return this.restObject('POST', `${repositoryPath(owner, repository)}/pulls`, {
107
+ json: { title, body, head, base, draft: isDraft },
108
+ });
109
+ }
110
+ /**
111
+ PR の詳細を取る(GraphQL)。関連 Issue とレビューを 1 回のクエリで取る
112
+ */
113
+ async getPullRequestSlim(owner, repository, number) {
114
+ const pullRequest = await this.fetchPullRequest(QUERY_GET_PULL_REQUEST_SLIM, owner, repository, number);
115
+ return {
116
+ ...formatPullRequestBase(pullRequest, owner, repository),
117
+ reviews: truthyNodes(jsonField(pullRequest, 'reviews')).map(review => ({
118
+ state: requireString(jsonField(review, 'state'), 'review.state'),
119
+ author: isTruthy(jsonField(review, 'author')) ? requireString(jsonField(jsonField(review, 'author'), 'login'), 'review.author.login') : JSON_NULL,
120
+ })),
121
+ };
122
+ }
123
+ /**
124
+ PR の詳細をレビュー情報付きで取る。getPullRequestSlim に、レビュー本文と行コメント(reviewThreads)を足したもの
125
+ */
126
+ async getPullRequestWithReviews(owner, repository, number) {
127
+ const pullRequest = await this.fetchPullRequest(QUERY_GET_PULL_REQUEST_WITH_REVIEWS, owner, repository, number);
128
+ return {
129
+ ...formatPullRequestBase(pullRequest, owner, repository),
130
+ reviews: truthyNodes(jsonField(pullRequest, 'reviews')).map(review => ({
131
+ state: requireString(jsonField(review, 'state'), 'review.state'),
132
+ author: loginOrNull(jsonField(review, 'author')),
133
+ body: requiredTextOrEmpty(jsonField(review, 'body')),
134
+ submitted_at: stringOrNull(jsonField(review, 'submittedAt')),
135
+ })),
136
+ review_threads: truthyNodes(jsonField(pullRequest, 'reviewThreads')).map(thread => ({
137
+ is_resolved: jsonField(thread, 'isResolved') === true,
138
+ path: stringOrNull(jsonField(thread, 'path')),
139
+ line: numberOrNull(jsonField(thread, 'line')),
140
+ comments: truthyNodes(jsonField(thread, 'comments')).map(comment => ({
141
+ author: loginOrNull(jsonField(comment, 'author')),
142
+ body: requiredTextOrEmpty(jsonField(comment, 'body')),
143
+ created_at: stringOrNull(jsonField(comment, 'createdAt')),
144
+ })),
145
+ })),
146
+ };
147
+ }
148
+ /**
149
+ PR をマージする。mergeMethod は merge・squash・rebase。既定は squash
150
+ */
151
+ async mergePullRequest(owner, repository, number, mergeMethod = 'squash') {
152
+ return this.restObject('PUT', `${repositoryPath(owner, repository)}/pulls/${String(number)}/merge`, {
153
+ json: { merge_method: mergeMethod },
154
+ });
155
+ }
156
+ /**
157
+ その PR が入っているスタックを読む。入っていなければ undefined。
158
+ スタックの機能が無いリポは GitHubNotFoundError
159
+ */
160
+ async getStackOfPullRequest(owner, repository, pullRequestNumber) {
161
+ const stacks = await this.restJson('GET', `${repositoryPath(owner, repository)}/stacks`, {
162
+ params: { pull_request: pullRequestNumber },
163
+ apiVersion: STACKS_API_VERSION,
164
+ });
165
+ if (!isJsonArray(stacks))
166
+ throwMalformed('stacks');
167
+ // 関係の無いスタックの形の誤りで登録を止めないよう、探している PR を含むものだけ厳しく読む
168
+ const found = stacks.find(stack => hasPullRequestNumber(stack, pullRequestNumber));
169
+ return found === undefined ? undefined : readStack(found);
170
+ }
171
+ /**
172
+ スタックを作る。pullRequestNumbers は下の段からの順
173
+ */
174
+ async createStack(owner, repository, pullRequestNumbers) {
175
+ return readStack(await this.restJson('POST', `${repositoryPath(owner, repository)}/stacks`, {
176
+ json: { pull_requests: [...pullRequestNumbers] },
177
+ apiVersion: STACKS_API_VERSION,
178
+ }));
179
+ }
180
+ /**
181
+ 既にあるスタックの一番上に PR を足す。pullRequestNumbers は下からの順
182
+ */
183
+ async addToStack(owner, repository, stackNumber, pullRequestNumbers) {
184
+ return readStack(await this.restJson('POST', `${repositoryPath(owner, repository)}/stacks/${String(stackNumber)}/add`, {
185
+ json: { pull_requests: [...pullRequestNumbers] },
186
+ apiVersion: STACKS_API_VERSION,
187
+ }));
188
+ }
189
+ /**
190
+ open の dependabot の PR を全件取る(GraphQL)。pullRequests に author の引数が無いので、全ページを辿ってから絞る。
191
+ GraphQL のノードをそのまま返す
192
+ */
193
+ async listOpenDependabotPullRequests(owner, repository) {
194
+ const nodes = [];
195
+ let after = JSON_NULL;
196
+ for (;;) {
197
+ const result = await this.executeGraphql(QUERY_LIST_OPEN_PULL_REQUESTS, { owner, repo: repository, after });
198
+ const connection = jsonField(jsonField(result, 'repository'), 'pullRequests');
199
+ // null を PR 0 件と読むと、sync が待つ PR は無いと判断して Tracker を閉じてしまう
200
+ if (!isJsonObject(connection))
201
+ throw new GitHubAPIError('the PR list response has no repository.pullRequests');
202
+ const pageNodes = jsonField(connection, 'nodes');
203
+ if (!isJsonArray(pageNodes))
204
+ throw new GitHubAPIError('nodes in the PR list response is not an array');
205
+ nodes.push(...pageNodes.filter(node => isTruthy(node)));
206
+ const pageInfo = asObject(jsonField(connection, 'pageInfo'));
207
+ if (!isTruthy(pageInfo['hasNextPage']))
208
+ break;
209
+ const cursor = pageInfo['endCursor'];
210
+ if (typeof cursor !== 'string' || cursor === '')
211
+ throw new GitHubAPIError('the next page of the PR list has no endCursor');
212
+ after = cursor;
213
+ }
214
+ return nodes.filter(node => isDependabotAuthor(node));
215
+ }
216
+ }
217
+ //# sourceMappingURL=pulls.js.map
@@ -0,0 +1,44 @@
1
+ export declare const QUERY_LIST_PROJECT_ITEMS: string;
2
+ export declare const QUERY_LIST_PROJECT_ITEMS_LEGACY: string;
3
+ export declare const QUERY_LIST_PROJECT_ITEMS_FILTERED = "query ($projectId: ID!, $cursor: String, $filterQuery: String) {\n node(id: $projectId) {\n ... on ProjectV2 {\n items(first: 100, after: $cursor, query: $filterQuery) {\n nodes {\n id\n updatedAt\n fieldValues(first: 10) {\n nodes {\n ... on ProjectV2ItemFieldSingleSelectValue {\n field {\n ... on ProjectV2SingleSelectField {\n name\n }\n }\n name\n }\n }\n }\n content {\n ... on Issue {\n id\n number\n title\n state\n url\n labels(first: 10) {\n nodes {\n name\n }\n }\n repository {\n owner {\n login\n }\n name\n }\n }\n ... on PullRequest {\n id\n number\n title\n state\n url\n repository {\n owner {\n login\n }\n name\n }\n }\n }\n }\n pageInfo {\n hasNextPage\n endCursor\n }\n }\n }\n }\n}";
4
+ export declare const QUERY_GET_ISSUE_NODE_ID = "query ($owner: String!, $repo: String!, $number: Int!) {\n repository(owner: $owner, name: $repo) {\n issue(number: $number) {\n id\n title\n }\n }\n}";
5
+ export declare const QUERY_GET_LINKED_REPOSITORIES_USER = "query ($owner: String!, $projectNumber: Int!) {\n user(login: $owner) {\n projectV2(number: $projectNumber) {\n repositories(first: 100) {\n nodes {\n owner {\n login\n }\n name\n }\n }\n }\n }\n}";
6
+ export declare const QUERY_GET_LINKED_REPOSITORIES_ORG = "query ($owner: String!, $projectNumber: Int!) {\n organization(login: $owner) {\n projectV2(number: $projectNumber) {\n repositories(first: 100) {\n nodes {\n owner {\n login\n }\n name\n }\n }\n }\n }\n}";
7
+ export declare const QUERY_GET_PROJECT_ID_USER = "query ($owner: String!, $projectNumber: Int!) {\n user(login: $owner) {\n projectV2(number: $projectNumber) {\n id\n }\n }\n}";
8
+ export declare const QUERY_GET_PROJECT_ID_ORG = "query ($owner: String!, $projectNumber: Int!) {\n organization(login: $owner) {\n projectV2(number: $projectNumber) {\n id\n }\n }\n}";
9
+ export declare const QUERY_GET_REPOSITORY_ID = "query ($owner: String!, $name: String!) {\n repository(owner: $owner, name: $name) {\n id\n }\n}";
10
+ export declare const MUTATION_LINK_PROJECT_REPOSITORY = "mutation ($projectId: ID!, $repositoryId: ID!) {\n linkProjectV2ToRepository(\n input: { projectId: $projectId, repositoryId: $repositoryId }\n ) {\n repository {\n id\n nameWithOwner\n }\n }\n}";
11
+ export declare const MUTATION_ADD_TO_PROJECT = "mutation ($projectId: ID!, $contentId: ID!) {\n addProjectV2ItemById(input: { projectId: $projectId, contentId: $contentId }) {\n item {\n id\n }\n }\n}";
12
+ export declare const MUTATION_UPDATE_PROJECT_ITEM_FIELD = "mutation ($projectId: ID!, $itemId: ID!, $fieldId: ID!, $optionId: String!) {\n updateProjectV2ItemFieldValue(\n input: {\n projectId: $projectId\n itemId: $itemId\n fieldId: $fieldId\n value: { singleSelectOptionId: $optionId }\n }\n ) {\n projectV2Item {\n id\n }\n }\n}";
13
+ export declare const MUTATION_DELETE_PROJECT_ITEM = "mutation ($projectId: ID!, $itemId: ID!) {\n deleteProjectV2Item(input: { projectId: $projectId, itemId: $itemId }) {\n deletedItemId\n }\n}";
14
+ export declare const MUTATION_UNARCHIVE_PROJECT_ITEM = "mutation ($projectId: ID!, $itemId: ID!) {\n unarchiveProjectV2Item(input: { projectId: $projectId, itemId: $itemId }) {\n item {\n id\n }\n }\n}";
15
+ export declare const MUTATION_ADD_SUB_ISSUE = "mutation ($parentId: ID!, $childId: ID!) {\n addSubIssue(input: { issueId: $parentId, subIssueId: $childId }) {\n issue {\n number\n }\n subIssue {\n number\n }\n }\n}";
16
+ export declare const MUTATION_CREATE_LINKED_BRANCH = "mutation CreateLinkedBranch($input: CreateLinkedBranchInput!) {\n createLinkedBranch(input: $input) {\n linkedBranch {\n ref {\n name\n prefix\n }\n }\n }\n}";
17
+ export declare const QUERY_GET_ISSUE_PROJECT_ITEMS = "query ($owner: String!, $repo: String!, $number: Int!) {\n repository(owner: $owner, name: $repo) {\n issue(number: $number) {\n projectItems(first: 20) {\n nodes {\n id\n isArchived\n project {\n id\n }\n fieldValues(first: 20) {\n nodes {\n ... on ProjectV2ItemFieldSingleSelectValue {\n field {\n ... on ProjectV2SingleSelectField {\n id\n }\n }\n }\n }\n }\n }\n }\n }\n }\n}";
18
+ export declare const QUERY_LIST_PROJECTS_USER = "query ($owner: String!, $first: Int!) {\n user(login: $owner) {\n projectsV2(first: $first) {\n nodes {\n number\n title\n url\n id\n }\n }\n }\n}";
19
+ export declare const QUERY_LIST_PROJECTS_ORG = "query ($owner: String!, $first: Int!) {\n organization(login: $owner) {\n projectsV2(first: $first) {\n nodes {\n number\n title\n url\n id\n }\n }\n }\n}";
20
+ export declare const QUERY_GET_PROJECT_FIELDS_USER = "query ($owner: String!, $projectNumber: Int!) {\n user(login: $owner) {\n projectV2(number: $projectNumber) {\n id\n title\n url\n fields(first: 50) {\n nodes {\n ... on ProjectV2SingleSelectField {\n id\n databaseId\n name\n options {\n id\n name\n color\n description\n }\n }\n ... on ProjectV2Field {\n id\n name\n }\n }\n }\n views(first: 1) {\n nodes {\n number\n }\n }\n }\n }\n}";
21
+ export declare const QUERY_GET_PROJECT_FIELDS_ORG = "query ($owner: String!, $projectNumber: Int!) {\n organization(login: $owner) {\n projectV2(number: $projectNumber) {\n id\n title\n url\n fields(first: 50) {\n nodes {\n ... on ProjectV2SingleSelectField {\n id\n databaseId\n name\n options {\n id\n name\n color\n description\n }\n }\n ... on ProjectV2Field {\n id\n name\n }\n }\n }\n views(first: 1) {\n nodes {\n number\n }\n }\n }\n }\n}";
22
+ export declare const MUTATION_CREATE_PROJECT_FIELD = "mutation ($projectId: ID!, $name: String!, $options: [ProjectV2SingleSelectFieldOptionInput!]!) {\n createProjectV2Field(\n input: {\n projectId: $projectId\n dataType: SINGLE_SELECT\n name: $name\n singleSelectOptions: $options\n }\n ) {\n projectV2Field {\n ... on ProjectV2SingleSelectField {\n id\n name\n options {\n id\n name\n }\n }\n }\n }\n}";
23
+ export declare const MUTATION_UPDATE_PROJECT_FIELD = "mutation ($fieldId: ID!, $options: [ProjectV2SingleSelectFieldOptionInput!]!) {\n updateProjectV2Field(\n input: { fieldId: $fieldId, singleSelectOptions: $options }\n ) {\n projectV2Field {\n ... on ProjectV2SingleSelectField {\n id\n name\n options {\n id\n name\n }\n }\n }\n }\n}";
24
+ export declare const QUERY_GET_USER_NODE_ID = "query ($login: String!) {\n user(login: $login) {\n id\n }\n}";
25
+ export declare const QUERY_GET_ORG_NODE_ID = "query ($login: String!) {\n organization(login: $login) {\n id\n }\n}";
26
+ export declare const MUTATION_CREATE_PROJECT = "mutation ($ownerId: ID!, $title: String!) {\n createProjectV2(input: { ownerId: $ownerId, title: $title }) {\n projectV2 {\n id\n number\n title\n url\n }\n }\n}";
27
+ export declare const QUERY_GET_ISSUE_KIND = "query ($owner: String!, $repo: String!, $number: Int!) {\n repository(owner: $owner, name: $repo) {\n issue(number: $number) {\n number\n state\n issueType {\n name\n }\n subIssues(first: 1) {\n totalCount\n }\n }\n }\n}";
28
+ export declare const QUERY_GET_ISSUE_KIND_PHASE1 = "query ($owner: String!, $repo: String!, $number: Int!) {\n repository(owner: $owner, name: $repo) {\n issue(number: $number) {\n number\n state\n subIssues(first: 1) {\n totalCount\n }\n }\n }\n}";
29
+ export declare const QUERY_GET_ISSUE_SLIM: string;
30
+ export declare const QUERY_GET_ISSUE_SLIM_WITHOUT_BLOCKED_BY: string;
31
+ export declare const QUERY_GET_SUB_ISSUES_PAGE = "query ($owner: String!, $repo: String!, $number: Int!, $after: String!) {\n repository(owner: $owner, name: $repo) {\n issue(number: $number) {\n subIssues(first: 100, after: $after) {\n nodes {\n number\n state\n title\n }\n pageInfo {\n hasNextPage\n endCursor\n }\n }\n }\n }\n}";
32
+ export declare const QUERY_GET_PULL_REQUEST_SLIM = "query ($owner: String!, $repo: String!, $number: Int!) {\n repository(owner: $owner, name: $repo) {\n pullRequest(number: $number) {\n number\n state\n title\n body\n headRefName\n baseRefName\n isDraft\n mergeable\n comments {\n totalCount\n }\n closingIssuesReferences(first: 10) {\n nodes {\n number\n title\n }\n }\n reviews(first: 10) {\n nodes {\n state\n author {\n login\n }\n }\n }\n }\n }\n}";
33
+ export declare const QUERY_GET_PULL_REQUEST_WITH_REVIEWS = "query ($owner: String!, $repo: String!, $number: Int!) {\n repository(owner: $owner, name: $repo) {\n pullRequest(number: $number) {\n number\n state\n title\n body\n headRefName\n baseRefName\n isDraft\n mergeable\n comments {\n totalCount\n }\n closingIssuesReferences(first: 10) {\n nodes {\n number\n title\n }\n }\n reviews(first: 20) {\n nodes {\n state\n body\n author {\n login\n }\n submittedAt\n }\n }\n reviewThreads(first: 50) {\n nodes {\n isResolved\n path\n line\n comments(first: 10) {\n nodes {\n author {\n login\n }\n body\n createdAt\n }\n }\n }\n }\n }\n }\n}";
34
+ export declare const QUERY_LIST_OPEN_PULL_REQUESTS = "query ($owner: String!, $repo: String!, $after: String) {\n repository(owner: $owner, name: $repo) {\n pullRequests(\n first: 25\n states: OPEN\n after: $after\n orderBy: { field: CREATED_AT, direction: ASC }\n ) {\n pageInfo {\n hasNextPage\n endCursor\n }\n nodes {\n number\n title\n url\n createdAt\n author {\n __typename\n login\n }\n isInMergeQueue\n autoMergeRequest {\n enabledAt\n }\n mergeable\n baseRef {\n target {\n ... on Commit {\n committedDate\n }\n }\n }\n firstCommits: commits(first: 1) {\n nodes {\n commit {\n message\n signature {\n isValid\n }\n author {\n user {\n login\n }\n }\n }\n }\n }\n headCommits: commits(last: 1) {\n nodes {\n commit {\n statusCheckRollup {\n state\n }\n }\n }\n }\n lastForcePush: timelineItems(last: 1, itemTypes: [HEAD_REF_FORCE_PUSHED_EVENT]) {\n nodes {\n ... on HeadRefForcePushedEvent {\n createdAt\n }\n }\n }\n lastDequeue: timelineItems(last: 1, itemTypes: [REMOVED_FROM_MERGE_QUEUE_EVENT]) {\n nodes {\n ... on RemovedFromMergeQueueEvent {\n createdAt\n }\n }\n }\n }\n }\n }\n}";
35
+ export declare const QUERY_HAS_ADD_BLOCKED_BY_INPUT = "{\n __type(name: \"AddBlockedByInput\") {\n name\n }\n}";
36
+ export declare const MUTATION_ADD_BLOCKED_BY = "mutation ($issueId: ID!, $blockingIssueId: ID!) {\n addBlockedBy(input: { issueId: $issueId, blockingIssueId: $blockingIssueId }) {\n issue {\n number\n }\n blockingIssue {\n number\n }\n }\n}";
37
+ export declare const MUTATION_REMOVE_BLOCKED_BY = "mutation ($issueId: ID!, $blockingIssueId: ID!) {\n removeBlockedBy(input: { issueId: $issueId, blockingIssueId: $blockingIssueId }) {\n issue {\n number\n }\n blockingIssue {\n number\n }\n }\n}";
38
+ export declare const QUERY_GET_ISSUE_PREREQUISITES = "query ($owner: String!, $repo: String!, $number: Int!, $columnFieldName: String!, $labelFieldName: String!, $blockedByFirst: Int!) {\n repository(owner: $owner, name: $repo) {\n issue(number: $number) {\n ...PrerequisiteIssueFields\n body\n parent {\n number\n repository {\n owner {\n login\n }\n name\n }\n }\n blockedBy(first: $blockedByFirst) {\n totalCount\n nodes {\n ...PrerequisiteIssueFields\n }\n }\n }\n }\n}\n\nfragment PrerequisiteIssueFields on Issue {\n id\n number\n state\n title\n repository {\n owner {\n login\n }\n name\n }\n issueType {\n name\n }\n subIssues(first: 1) {\n totalCount\n }\n projectItems(first: 20, includeArchived: false) {\n totalCount\n nodes {\n project {\n id\n }\n column: fieldValueByName(name: $columnFieldName) {\n ...SingleSelectValueFields\n }\n label: fieldValueByName(name: $labelFieldName) {\n ...SingleSelectValueFields\n }\n }\n }\n linkedBranches(first: 10) {\n totalCount\n nodes {\n ref {\n name\n associatedPullRequests(first: 10) {\n totalCount\n nodes {\n ...PullRequestFields\n }\n }\n }\n }\n }\n closedByPullRequestsReferences(first: 10, includeClosedPrs: true) {\n totalCount\n nodes {\n ...PullRequestFields\n }\n }\n timelineItems(\n itemTypes: [CONNECTED_EVENT, DISCONNECTED_EVENT, CROSS_REFERENCED_EVENT]\n first: 20\n ) {\n totalCount\n nodes {\n __typename\n ... on ConnectedEvent {\n subject {\n ... on PullRequest {\n ...PullRequestFields\n }\n }\n }\n ... on DisconnectedEvent {\n subject {\n ... on PullRequest {\n ...PullRequestFields\n }\n }\n }\n ... on CrossReferencedEvent {\n willCloseTarget\n source {\n ... on PullRequest {\n ...PullRequestFields\n }\n }\n }\n }\n }\n}\n\nfragment SingleSelectValueFields on ProjectV2ItemFieldValue {\n ... on ProjectV2ItemFieldSingleSelectValue {\n name\n optionId\n field {\n ... on ProjectV2SingleSelectField {\n id\n }\n }\n }\n}\n\nfragment PullRequestFields on PullRequest {\n number\n state\n headRefName\n baseRefName\n isDraft\n isCrossRepository\n repository {\n owner {\n login\n }\n name\n }\n}";
39
+ export declare const QUERY_LIST_PULL_REQUESTS_BY_HEAD = "query ($owner: String!, $repo: String!, $headRefName: String!) {\n repository(owner: $owner, name: $repo) {\n pullRequests(\n headRefName: $headRefName\n states: [OPEN, CLOSED, MERGED]\n first: 20\n orderBy: { field: CREATED_AT, direction: DESC }\n ) {\n pageInfo {\n hasNextPage\n }\n nodes {\n ...PullRequestFields\n }\n }\n }\n}\n\nfragment PullRequestFields on PullRequest {\n number\n state\n headRefName\n baseRefName\n isDraft\n isCrossRepository\n repository {\n owner {\n login\n }\n name\n }\n}";
40
+ export declare const QUERY_GET_ISSUE_BLOCKED_BY_REFERENCES = "query ($owner: String!, $repo: String!, $number: Int!, $blockedByFirst: Int!) {\n repository(owner: $owner, name: $repo) {\n issue(number: $number) {\n id\n body\n blockedBy(first: $blockedByFirst) {\n totalCount\n nodes {\n ...BlockedByReferenceFields\n }\n }\n }\n }\n}\n\nfragment BlockedByReferenceFields on Issue {\n id\n number\n state\n repository {\n owner {\n login\n }\n name\n }\n}";
41
+ export declare const QUERY_GET_BLOCKED_BY_OF_NODES = "query ($ids: [ID!]!, $blockedByFirst: Int!) {\n nodes(ids: $ids) {\n ... on Issue {\n id\n blockedBy(first: $blockedByFirst) {\n totalCount\n nodes {\n ...BlockedByReferenceFields\n }\n }\n }\n }\n}\n\nfragment BlockedByReferenceFields on Issue {\n id\n number\n state\n repository {\n owner {\n login\n }\n name\n }\n}";
42
+ export declare const QUERY_GET_ISSUE_BLOCKING_REFERENCES = "query ($owner: String!, $repo: String!, $number: Int!, $blockingFirst: Int!) {\n repository(owner: $owner, name: $repo) {\n issue(number: $number) {\n blocking(first: $blockingFirst) {\n totalCount\n nodes {\n ...BlockedByReferenceFields\n }\n }\n }\n }\n}\n\nfragment BlockedByReferenceFields on Issue {\n id\n number\n state\n repository {\n owner {\n login\n }\n name\n }\n}";
43
+ export declare const QUERY_GET_ISSUE_BOARD_ITEM = "query ($owner: String!, $repo: String!, $number: Int!, $workflowFieldName: String!) {\n repository(owner: $owner, name: $repo) {\n issue(number: $number) {\n number\n title\n state\n url\n repository {\n owner {\n login\n }\n name\n }\n projectItems(first: 20, includeArchived: false) {\n nodes {\n id\n project {\n id\n }\n workflow: fieldValueByName(name: $workflowFieldName) {\n ... on ProjectV2ItemFieldSingleSelectValue {\n name\n }\n }\n }\n }\n }\n }\n}";
44
+ //# sourceMappingURL=queries.d.ts.map