@chief-clancy/core 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (635) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +50 -0
  3. package/dist/board/azdo/api/api.d.ts +95 -0
  4. package/dist/board/azdo/api/api.d.ts.map +1 -0
  5. package/dist/board/azdo/api/api.js +173 -0
  6. package/dist/board/azdo/api/api.js.map +1 -0
  7. package/dist/board/azdo/api/helpers.d.ts +89 -0
  8. package/dist/board/azdo/api/helpers.d.ts.map +1 -0
  9. package/dist/board/azdo/api/helpers.js +133 -0
  10. package/dist/board/azdo/api/helpers.js.map +1 -0
  11. package/dist/board/azdo/api/index.d.ts +5 -0
  12. package/dist/board/azdo/api/index.d.ts.map +1 -0
  13. package/dist/board/azdo/api/index.js +3 -0
  14. package/dist/board/azdo/api/index.js.map +1 -0
  15. package/dist/board/azdo/azdo-board.d.ts +12 -0
  16. package/dist/board/azdo/azdo-board.d.ts.map +1 -0
  17. package/dist/board/azdo/azdo-board.js +104 -0
  18. package/dist/board/azdo/azdo-board.js.map +1 -0
  19. package/dist/board/azdo/index.d.ts +3 -0
  20. package/dist/board/azdo/index.d.ts.map +1 -0
  21. package/dist/board/azdo/index.js +3 -0
  22. package/dist/board/azdo/index.js.map +1 -0
  23. package/dist/board/azdo/labels/index.d.ts +2 -0
  24. package/dist/board/azdo/labels/index.d.ts.map +1 -0
  25. package/dist/board/azdo/labels/index.js +2 -0
  26. package/dist/board/azdo/labels/index.js.map +1 -0
  27. package/dist/board/azdo/labels/labels.d.ts +27 -0
  28. package/dist/board/azdo/labels/labels.d.ts.map +1 -0
  29. package/dist/board/azdo/labels/labels.js +64 -0
  30. package/dist/board/azdo/labels/labels.js.map +1 -0
  31. package/dist/board/azdo/relations/index.d.ts +2 -0
  32. package/dist/board/azdo/relations/index.d.ts.map +1 -0
  33. package/dist/board/azdo/relations/index.js +2 -0
  34. package/dist/board/azdo/relations/index.js.map +1 -0
  35. package/dist/board/azdo/relations/relations.d.ts +37 -0
  36. package/dist/board/azdo/relations/relations.d.ts.map +1 -0
  37. package/dist/board/azdo/relations/relations.js +109 -0
  38. package/dist/board/azdo/relations/relations.js.map +1 -0
  39. package/dist/board/detect-board.d.ts +28 -0
  40. package/dist/board/detect-board.d.ts.map +1 -0
  41. package/dist/board/detect-board.js +80 -0
  42. package/dist/board/detect-board.js.map +1 -0
  43. package/dist/board/factory/factory.d.ts +18 -0
  44. package/dist/board/factory/factory.d.ts.map +1 -0
  45. package/dist/board/factory/factory.js +34 -0
  46. package/dist/board/factory/factory.js.map +1 -0
  47. package/dist/board/factory/index.d.ts +2 -0
  48. package/dist/board/factory/index.d.ts.map +1 -0
  49. package/dist/board/factory/index.js +2 -0
  50. package/dist/board/factory/index.js.map +1 -0
  51. package/dist/board/github/api/api.d.ts +86 -0
  52. package/dist/board/github/api/api.d.ts.map +1 -0
  53. package/dist/board/github/api/api.js +161 -0
  54. package/dist/board/github/api/api.js.map +1 -0
  55. package/dist/board/github/api/index.d.ts +3 -0
  56. package/dist/board/github/api/index.d.ts.map +1 -0
  57. package/dist/board/github/api/index.js +2 -0
  58. package/dist/board/github/api/index.js.map +1 -0
  59. package/dist/board/github/github-board.d.ts +19 -0
  60. package/dist/board/github/github-board.d.ts.map +1 -0
  61. package/dist/board/github/github-board.js +104 -0
  62. package/dist/board/github/github-board.js.map +1 -0
  63. package/dist/board/github/index.d.ts +3 -0
  64. package/dist/board/github/index.d.ts.map +1 -0
  65. package/dist/board/github/index.js +3 -0
  66. package/dist/board/github/index.js.map +1 -0
  67. package/dist/board/github/labels/index.d.ts +2 -0
  68. package/dist/board/github/labels/index.d.ts.map +1 -0
  69. package/dist/board/github/labels/index.js +2 -0
  70. package/dist/board/github/labels/index.js.map +1 -0
  71. package/dist/board/github/labels/labels.d.ts +42 -0
  72. package/dist/board/github/labels/labels.d.ts.map +1 -0
  73. package/dist/board/github/labels/labels.js +93 -0
  74. package/dist/board/github/labels/labels.js.map +1 -0
  75. package/dist/board/github/relations/index.d.ts +2 -0
  76. package/dist/board/github/relations/index.d.ts.map +1 -0
  77. package/dist/board/github/relations/index.js +2 -0
  78. package/dist/board/github/relations/index.js.map +1 -0
  79. package/dist/board/github/relations/relations.d.ts +54 -0
  80. package/dist/board/github/relations/relations.d.ts.map +1 -0
  81. package/dist/board/github/relations/relations.js +152 -0
  82. package/dist/board/github/relations/relations.js.map +1 -0
  83. package/dist/board/index.d.ts +2 -0
  84. package/dist/board/index.d.ts.map +1 -0
  85. package/dist/board/index.js +2 -0
  86. package/dist/board/index.js.map +1 -0
  87. package/dist/board/jira/api/api.d.ts +129 -0
  88. package/dist/board/jira/api/api.d.ts.map +1 -0
  89. package/dist/board/jira/api/api.js +207 -0
  90. package/dist/board/jira/api/api.js.map +1 -0
  91. package/dist/board/jira/api/index.d.ts +3 -0
  92. package/dist/board/jira/api/index.d.ts.map +1 -0
  93. package/dist/board/jira/api/index.js +2 -0
  94. package/dist/board/jira/api/index.js.map +1 -0
  95. package/dist/board/jira/index.d.ts +3 -0
  96. package/dist/board/jira/index.d.ts.map +1 -0
  97. package/dist/board/jira/index.js +3 -0
  98. package/dist/board/jira/index.js.map +1 -0
  99. package/dist/board/jira/jira-board.d.ts +12 -0
  100. package/dist/board/jira/jira-board.d.ts.map +1 -0
  101. package/dist/board/jira/jira-board.js +112 -0
  102. package/dist/board/jira/jira-board.js.map +1 -0
  103. package/dist/board/jira/labels/index.d.ts +2 -0
  104. package/dist/board/jira/labels/index.d.ts.map +1 -0
  105. package/dist/board/jira/labels/index.js +2 -0
  106. package/dist/board/jira/labels/index.js.map +1 -0
  107. package/dist/board/jira/labels/labels.d.ts +34 -0
  108. package/dist/board/jira/labels/labels.d.ts.map +1 -0
  109. package/dist/board/jira/labels/labels.js +69 -0
  110. package/dist/board/jira/labels/labels.js.map +1 -0
  111. package/dist/board/jira/relations/index.d.ts +2 -0
  112. package/dist/board/jira/relations/index.d.ts.map +1 -0
  113. package/dist/board/jira/relations/index.js +2 -0
  114. package/dist/board/jira/relations/index.js.map +1 -0
  115. package/dist/board/jira/relations/relations.d.ts +44 -0
  116. package/dist/board/jira/relations/relations.d.ts.map +1 -0
  117. package/dist/board/jira/relations/relations.js +111 -0
  118. package/dist/board/jira/relations/relations.js.map +1 -0
  119. package/dist/board/linear/api/api.d.ts +68 -0
  120. package/dist/board/linear/api/api.d.ts.map +1 -0
  121. package/dist/board/linear/api/api.js +179 -0
  122. package/dist/board/linear/api/api.js.map +1 -0
  123. package/dist/board/linear/api/index.d.ts +2 -0
  124. package/dist/board/linear/api/index.d.ts.map +1 -0
  125. package/dist/board/linear/api/index.js +2 -0
  126. package/dist/board/linear/api/index.js.map +1 -0
  127. package/dist/board/linear/index.d.ts +3 -0
  128. package/dist/board/linear/index.d.ts.map +1 -0
  129. package/dist/board/linear/index.js +3 -0
  130. package/dist/board/linear/index.js.map +1 -0
  131. package/dist/board/linear/labels/index.d.ts +2 -0
  132. package/dist/board/linear/labels/index.d.ts.map +1 -0
  133. package/dist/board/linear/labels/index.js +2 -0
  134. package/dist/board/linear/labels/index.js.map +1 -0
  135. package/dist/board/linear/labels/labels.d.ts +63 -0
  136. package/dist/board/linear/labels/labels.d.ts.map +1 -0
  137. package/dist/board/linear/labels/labels.js +204 -0
  138. package/dist/board/linear/labels/labels.js.map +1 -0
  139. package/dist/board/linear/linear-board.d.ts +18 -0
  140. package/dist/board/linear/linear-board.d.ts.map +1 -0
  141. package/dist/board/linear/linear-board.js +115 -0
  142. package/dist/board/linear/linear-board.js.map +1 -0
  143. package/dist/board/linear/relations/index.d.ts +2 -0
  144. package/dist/board/linear/relations/index.d.ts.map +1 -0
  145. package/dist/board/linear/relations/index.js +2 -0
  146. package/dist/board/linear/relations/index.js.map +1 -0
  147. package/dist/board/linear/relations/relations.d.ts +67 -0
  148. package/dist/board/linear/relations/relations.d.ts.map +1 -0
  149. package/dist/board/linear/relations/relations.js +195 -0
  150. package/dist/board/linear/relations/relations.js.map +1 -0
  151. package/dist/board/notion/api/api.d.ts +83 -0
  152. package/dist/board/notion/api/api.d.ts.map +1 -0
  153. package/dist/board/notion/api/api.js +124 -0
  154. package/dist/board/notion/api/api.js.map +1 -0
  155. package/dist/board/notion/api/helpers.d.ts +105 -0
  156. package/dist/board/notion/api/helpers.d.ts.map +1 -0
  157. package/dist/board/notion/api/helpers.js +175 -0
  158. package/dist/board/notion/api/helpers.js.map +1 -0
  159. package/dist/board/notion/api/index.d.ts +4 -0
  160. package/dist/board/notion/api/index.d.ts.map +1 -0
  161. package/dist/board/notion/api/index.js +3 -0
  162. package/dist/board/notion/api/index.js.map +1 -0
  163. package/dist/board/notion/index.d.ts +3 -0
  164. package/dist/board/notion/index.d.ts.map +1 -0
  165. package/dist/board/notion/index.js +3 -0
  166. package/dist/board/notion/index.js.map +1 -0
  167. package/dist/board/notion/labels/index.d.ts +2 -0
  168. package/dist/board/notion/labels/index.d.ts.map +1 -0
  169. package/dist/board/notion/labels/index.js +2 -0
  170. package/dist/board/notion/labels/index.js.map +1 -0
  171. package/dist/board/notion/labels/labels.d.ts +30 -0
  172. package/dist/board/notion/labels/labels.d.ts.map +1 -0
  173. package/dist/board/notion/labels/labels.js +56 -0
  174. package/dist/board/notion/labels/labels.js.map +1 -0
  175. package/dist/board/notion/notion-board.d.ts +12 -0
  176. package/dist/board/notion/notion-board.d.ts.map +1 -0
  177. package/dist/board/notion/notion-board.js +156 -0
  178. package/dist/board/notion/notion-board.js.map +1 -0
  179. package/dist/board/notion/relations/index.d.ts +2 -0
  180. package/dist/board/notion/relations/index.d.ts.map +1 -0
  181. package/dist/board/notion/relations/index.js +2 -0
  182. package/dist/board/notion/relations/index.js.map +1 -0
  183. package/dist/board/notion/relations/relations.d.ts +43 -0
  184. package/dist/board/notion/relations/relations.d.ts.map +1 -0
  185. package/dist/board/notion/relations/relations.js +127 -0
  186. package/dist/board/notion/relations/relations.js.map +1 -0
  187. package/dist/board/shortcut/api/api.d.ts +110 -0
  188. package/dist/board/shortcut/api/api.d.ts.map +1 -0
  189. package/dist/board/shortcut/api/api.js +227 -0
  190. package/dist/board/shortcut/api/api.js.map +1 -0
  191. package/dist/board/shortcut/api/index.d.ts +2 -0
  192. package/dist/board/shortcut/api/index.d.ts.map +1 -0
  193. package/dist/board/shortcut/api/index.js +2 -0
  194. package/dist/board/shortcut/api/index.js.map +1 -0
  195. package/dist/board/shortcut/index.d.ts +3 -0
  196. package/dist/board/shortcut/index.d.ts.map +1 -0
  197. package/dist/board/shortcut/index.js +3 -0
  198. package/dist/board/shortcut/index.js.map +1 -0
  199. package/dist/board/shortcut/labels/index.d.ts +2 -0
  200. package/dist/board/shortcut/labels/index.d.ts.map +1 -0
  201. package/dist/board/shortcut/labels/index.js +2 -0
  202. package/dist/board/shortcut/labels/index.js.map +1 -0
  203. package/dist/board/shortcut/labels/labels.d.ts +95 -0
  204. package/dist/board/shortcut/labels/labels.d.ts.map +1 -0
  205. package/dist/board/shortcut/labels/labels.js +154 -0
  206. package/dist/board/shortcut/labels/labels.js.map +1 -0
  207. package/dist/board/shortcut/relations/index.d.ts +2 -0
  208. package/dist/board/shortcut/relations/index.d.ts.map +1 -0
  209. package/dist/board/shortcut/relations/index.js +2 -0
  210. package/dist/board/shortcut/relations/index.js.map +1 -0
  211. package/dist/board/shortcut/relations/relations.d.ts +44 -0
  212. package/dist/board/shortcut/relations/relations.d.ts.map +1 -0
  213. package/dist/board/shortcut/relations/relations.js +118 -0
  214. package/dist/board/shortcut/relations/relations.js.map +1 -0
  215. package/dist/board/shortcut/shortcut-board.d.ts +18 -0
  216. package/dist/board/shortcut/shortcut-board.d.ts.map +1 -0
  217. package/dist/board/shortcut/shortcut-board.js +143 -0
  218. package/dist/board/shortcut/shortcut-board.js.map +1 -0
  219. package/dist/dev/lifecycle/branch/branch.d.ts +35 -0
  220. package/dist/dev/lifecycle/branch/branch.d.ts.map +1 -0
  221. package/dist/dev/lifecycle/branch/branch.js +48 -0
  222. package/dist/dev/lifecycle/branch/branch.js.map +1 -0
  223. package/dist/dev/lifecycle/branch/index.d.ts +2 -0
  224. package/dist/dev/lifecycle/branch/index.d.ts.map +1 -0
  225. package/dist/dev/lifecycle/branch/index.js +2 -0
  226. package/dist/dev/lifecycle/branch/index.js.map +1 -0
  227. package/dist/dev/lifecycle/commit-type/commit-type.d.ts +22 -0
  228. package/dist/dev/lifecycle/commit-type/commit-type.d.ts.map +1 -0
  229. package/dist/dev/lifecycle/commit-type/commit-type.js +50 -0
  230. package/dist/dev/lifecycle/commit-type/commit-type.js.map +1 -0
  231. package/dist/dev/lifecycle/commit-type/index.d.ts +2 -0
  232. package/dist/dev/lifecycle/commit-type/index.d.ts.map +1 -0
  233. package/dist/dev/lifecycle/commit-type/index.js +2 -0
  234. package/dist/dev/lifecycle/commit-type/index.js.map +1 -0
  235. package/dist/dev/lifecycle/cost/cost.d.ts +28 -0
  236. package/dist/dev/lifecycle/cost/cost.d.ts.map +1 -0
  237. package/dist/dev/lifecycle/cost/cost.js +36 -0
  238. package/dist/dev/lifecycle/cost/cost.js.map +1 -0
  239. package/dist/dev/lifecycle/deliver-epic/deliver-epic.d.ts +44 -0
  240. package/dist/dev/lifecycle/deliver-epic/deliver-epic.d.ts.map +1 -0
  241. package/dist/dev/lifecycle/deliver-epic/deliver-epic.js +75 -0
  242. package/dist/dev/lifecycle/deliver-epic/deliver-epic.js.map +1 -0
  243. package/dist/dev/lifecycle/deliver-ticket/deliver-ticket.d.ts +51 -0
  244. package/dist/dev/lifecycle/deliver-ticket/deliver-ticket.d.ts.map +1 -0
  245. package/dist/dev/lifecycle/deliver-ticket/deliver-ticket.js +132 -0
  246. package/dist/dev/lifecycle/deliver-ticket/deliver-ticket.js.map +1 -0
  247. package/dist/dev/lifecycle/epic/epic.d.ts +66 -0
  248. package/dist/dev/lifecycle/epic/epic.d.ts.map +1 -0
  249. package/dist/dev/lifecycle/epic/epic.js +91 -0
  250. package/dist/dev/lifecycle/epic/epic.js.map +1 -0
  251. package/dist/dev/lifecycle/epic/index.d.ts +2 -0
  252. package/dist/dev/lifecycle/epic/index.d.ts.map +1 -0
  253. package/dist/dev/lifecycle/epic/index.js +2 -0
  254. package/dist/dev/lifecycle/epic/index.js.map +1 -0
  255. package/dist/dev/lifecycle/feasibility/feasibility.d.ts +55 -0
  256. package/dist/dev/lifecycle/feasibility/feasibility.d.ts.map +1 -0
  257. package/dist/dev/lifecycle/feasibility/feasibility.js +75 -0
  258. package/dist/dev/lifecycle/feasibility/feasibility.js.map +1 -0
  259. package/dist/dev/lifecycle/fetch-ticket/fetch-ticket.d.ts +49 -0
  260. package/dist/dev/lifecycle/fetch-ticket/fetch-ticket.d.ts.map +1 -0
  261. package/dist/dev/lifecycle/fetch-ticket/fetch-ticket.js +81 -0
  262. package/dist/dev/lifecycle/fetch-ticket/fetch-ticket.js.map +1 -0
  263. package/dist/dev/lifecycle/format/format.d.ts +11 -0
  264. package/dist/dev/lifecycle/format/format.d.ts.map +1 -0
  265. package/dist/dev/lifecycle/format/format.js +23 -0
  266. package/dist/dev/lifecycle/format/format.js.map +1 -0
  267. package/dist/dev/lifecycle/lock/index.d.ts +3 -0
  268. package/dist/dev/lifecycle/lock/index.d.ts.map +1 -0
  269. package/dist/dev/lifecycle/lock/index.js +2 -0
  270. package/dist/dev/lifecycle/lock/index.js.map +1 -0
  271. package/dist/dev/lifecycle/lock/lock.d.ts +68 -0
  272. package/dist/dev/lifecycle/lock/lock.d.ts.map +1 -0
  273. package/dist/dev/lifecycle/lock/lock.js +125 -0
  274. package/dist/dev/lifecycle/lock/lock.js.map +1 -0
  275. package/dist/dev/lifecycle/outcome/index.d.ts +2 -0
  276. package/dist/dev/lifecycle/outcome/index.d.ts.map +1 -0
  277. package/dist/dev/lifecycle/outcome/index.js +2 -0
  278. package/dist/dev/lifecycle/outcome/index.js.map +1 -0
  279. package/dist/dev/lifecycle/outcome/outcome.d.ts +65 -0
  280. package/dist/dev/lifecycle/outcome/outcome.d.ts.map +1 -0
  281. package/dist/dev/lifecycle/outcome/outcome.js +61 -0
  282. package/dist/dev/lifecycle/outcome/outcome.js.map +1 -0
  283. package/dist/dev/lifecycle/pr-creation/index.d.ts +3 -0
  284. package/dist/dev/lifecycle/pr-creation/index.d.ts.map +1 -0
  285. package/dist/dev/lifecycle/pr-creation/index.js +2 -0
  286. package/dist/dev/lifecycle/pr-creation/index.js.map +1 -0
  287. package/dist/dev/lifecycle/pr-creation/pr-creation.d.ts +47 -0
  288. package/dist/dev/lifecycle/pr-creation/pr-creation.d.ts.map +1 -0
  289. package/dist/dev/lifecycle/pr-creation/pr-creation.js +143 -0
  290. package/dist/dev/lifecycle/pr-creation/pr-creation.js.map +1 -0
  291. package/dist/dev/lifecycle/preflight/preflight.d.ts +42 -0
  292. package/dist/dev/lifecycle/preflight/preflight.d.ts.map +1 -0
  293. package/dist/dev/lifecycle/preflight/preflight.js +101 -0
  294. package/dist/dev/lifecycle/preflight/preflight.js.map +1 -0
  295. package/dist/dev/lifecycle/progress/index.d.ts +3 -0
  296. package/dist/dev/lifecycle/progress/index.d.ts.map +1 -0
  297. package/dist/dev/lifecycle/progress/index.js +2 -0
  298. package/dist/dev/lifecycle/progress/index.js.map +1 -0
  299. package/dist/dev/lifecycle/progress/progress.d.ts +98 -0
  300. package/dist/dev/lifecycle/progress/progress.d.ts.map +1 -0
  301. package/dist/dev/lifecycle/progress/progress.js +212 -0
  302. package/dist/dev/lifecycle/progress/progress.js.map +1 -0
  303. package/dist/dev/lifecycle/pull-request/azdo/azdo.d.ts +86 -0
  304. package/dist/dev/lifecycle/pull-request/azdo/azdo.d.ts.map +1 -0
  305. package/dist/dev/lifecycle/pull-request/azdo/azdo.js +198 -0
  306. package/dist/dev/lifecycle/pull-request/azdo/azdo.js.map +1 -0
  307. package/dist/dev/lifecycle/pull-request/azdo/index.d.ts +2 -0
  308. package/dist/dev/lifecycle/pull-request/azdo/index.d.ts.map +1 -0
  309. package/dist/dev/lifecycle/pull-request/azdo/index.js +2 -0
  310. package/dist/dev/lifecycle/pull-request/azdo/index.js.map +1 -0
  311. package/dist/dev/lifecycle/pull-request/bitbucket/cloud.d.ts +85 -0
  312. package/dist/dev/lifecycle/pull-request/bitbucket/cloud.d.ts.map +1 -0
  313. package/dist/dev/lifecycle/pull-request/bitbucket/cloud.js +158 -0
  314. package/dist/dev/lifecycle/pull-request/bitbucket/cloud.js.map +1 -0
  315. package/dist/dev/lifecycle/pull-request/bitbucket/index.d.ts +3 -0
  316. package/dist/dev/lifecycle/pull-request/bitbucket/index.d.ts.map +1 -0
  317. package/dist/dev/lifecycle/pull-request/bitbucket/index.js +3 -0
  318. package/dist/dev/lifecycle/pull-request/bitbucket/index.js.map +1 -0
  319. package/dist/dev/lifecycle/pull-request/bitbucket/server.d.ts +85 -0
  320. package/dist/dev/lifecycle/pull-request/bitbucket/server.d.ts.map +1 -0
  321. package/dist/dev/lifecycle/pull-request/bitbucket/server.js +168 -0
  322. package/dist/dev/lifecycle/pull-request/bitbucket/server.js.map +1 -0
  323. package/dist/dev/lifecycle/pull-request/github/github.d.ts +107 -0
  324. package/dist/dev/lifecycle/pull-request/github/github.d.ts.map +1 -0
  325. package/dist/dev/lifecycle/pull-request/github/github.js +225 -0
  326. package/dist/dev/lifecycle/pull-request/github/github.js.map +1 -0
  327. package/dist/dev/lifecycle/pull-request/github/index.d.ts +2 -0
  328. package/dist/dev/lifecycle/pull-request/github/index.d.ts.map +1 -0
  329. package/dist/dev/lifecycle/pull-request/github/index.js +2 -0
  330. package/dist/dev/lifecycle/pull-request/github/index.js.map +1 -0
  331. package/dist/dev/lifecycle/pull-request/gitlab/gitlab.d.ts +103 -0
  332. package/dist/dev/lifecycle/pull-request/gitlab/gitlab.d.ts.map +1 -0
  333. package/dist/dev/lifecycle/pull-request/gitlab/gitlab.js +215 -0
  334. package/dist/dev/lifecycle/pull-request/gitlab/gitlab.js.map +1 -0
  335. package/dist/dev/lifecycle/pull-request/gitlab/index.d.ts +2 -0
  336. package/dist/dev/lifecycle/pull-request/gitlab/index.d.ts.map +1 -0
  337. package/dist/dev/lifecycle/pull-request/gitlab/index.js +2 -0
  338. package/dist/dev/lifecycle/pull-request/gitlab/index.js.map +1 -0
  339. package/dist/dev/lifecycle/pull-request/post-pr/post-pr.d.ts +44 -0
  340. package/dist/dev/lifecycle/pull-request/post-pr/post-pr.d.ts.map +1 -0
  341. package/dist/dev/lifecycle/pull-request/post-pr/post-pr.js +64 -0
  342. package/dist/dev/lifecycle/pull-request/post-pr/post-pr.js.map +1 -0
  343. package/dist/dev/lifecycle/pull-request/pr-body/index.d.ts +3 -0
  344. package/dist/dev/lifecycle/pull-request/pr-body/index.d.ts.map +1 -0
  345. package/dist/dev/lifecycle/pull-request/pr-body/index.js +2 -0
  346. package/dist/dev/lifecycle/pull-request/pr-body/index.js.map +1 -0
  347. package/dist/dev/lifecycle/pull-request/pr-body/pr-body.d.ts +65 -0
  348. package/dist/dev/lifecycle/pull-request/pr-body/pr-body.d.ts.map +1 -0
  349. package/dist/dev/lifecycle/pull-request/pr-body/pr-body.js +144 -0
  350. package/dist/dev/lifecycle/pull-request/pr-body/pr-body.js.map +1 -0
  351. package/dist/dev/lifecycle/pull-request/rework-comment/rework-comment.d.ts +30 -0
  352. package/dist/dev/lifecycle/pull-request/rework-comment/rework-comment.d.ts.map +1 -0
  353. package/dist/dev/lifecycle/pull-request/rework-comment/rework-comment.js +39 -0
  354. package/dist/dev/lifecycle/pull-request/rework-comment/rework-comment.js.map +1 -0
  355. package/dist/dev/lifecycle/quality/quality.d.ts +99 -0
  356. package/dist/dev/lifecycle/quality/quality.d.ts.map +1 -0
  357. package/dist/dev/lifecycle/quality/quality.js +213 -0
  358. package/dist/dev/lifecycle/quality/quality.js.map +1 -0
  359. package/dist/dev/lifecycle/resume/resume.d.ts +64 -0
  360. package/dist/dev/lifecycle/resume/resume.d.ts.map +1 -0
  361. package/dist/dev/lifecycle/resume/resume.js +171 -0
  362. package/dist/dev/lifecycle/resume/resume.js.map +1 -0
  363. package/dist/dev/lifecycle/rework/rework-builders.d.ts +20 -0
  364. package/dist/dev/lifecycle/rework/rework-builders.d.ts.map +1 -0
  365. package/dist/dev/lifecycle/rework/rework-builders.js +203 -0
  366. package/dist/dev/lifecycle/rework/rework-builders.js.map +1 -0
  367. package/dist/dev/lifecycle/rework/rework-handlers.d.ts +50 -0
  368. package/dist/dev/lifecycle/rework/rework-handlers.d.ts.map +1 -0
  369. package/dist/dev/lifecycle/rework/rework-handlers.js +41 -0
  370. package/dist/dev/lifecycle/rework/rework-handlers.js.map +1 -0
  371. package/dist/dev/lifecycle/rework/rework.d.ts +63 -0
  372. package/dist/dev/lifecycle/rework/rework.d.ts.map +1 -0
  373. package/dist/dev/lifecycle/rework/rework.js +141 -0
  374. package/dist/dev/lifecycle/rework/rework.js.map +1 -0
  375. package/dist/dev/pipeline/context.d.ts +105 -0
  376. package/dist/dev/pipeline/context.d.ts.map +1 -0
  377. package/dist/dev/pipeline/context.js +107 -0
  378. package/dist/dev/pipeline/context.js.map +1 -0
  379. package/dist/dev/pipeline/index.d.ts +6 -0
  380. package/dist/dev/pipeline/index.d.ts.map +1 -0
  381. package/dist/dev/pipeline/index.js +5 -0
  382. package/dist/dev/pipeline/index.js.map +1 -0
  383. package/dist/dev/pipeline/phases/branch-setup/branch-setup.d.ts +62 -0
  384. package/dist/dev/pipeline/phases/branch-setup/branch-setup.d.ts.map +1 -0
  385. package/dist/dev/pipeline/phases/branch-setup/branch-setup.js +128 -0
  386. package/dist/dev/pipeline/phases/branch-setup/branch-setup.js.map +1 -0
  387. package/dist/dev/pipeline/phases/branch-setup/index.d.ts +3 -0
  388. package/dist/dev/pipeline/phases/branch-setup/index.d.ts.map +1 -0
  389. package/dist/dev/pipeline/phases/branch-setup/index.js +2 -0
  390. package/dist/dev/pipeline/phases/branch-setup/index.js.map +1 -0
  391. package/dist/dev/pipeline/phases/cleanup-phase/cleanup-phase.d.ts +32 -0
  392. package/dist/dev/pipeline/phases/cleanup-phase/cleanup-phase.d.ts.map +1 -0
  393. package/dist/dev/pipeline/phases/cleanup-phase/cleanup-phase.js +32 -0
  394. package/dist/dev/pipeline/phases/cleanup-phase/cleanup-phase.js.map +1 -0
  395. package/dist/dev/pipeline/phases/cleanup-phase/index.d.ts +3 -0
  396. package/dist/dev/pipeline/phases/cleanup-phase/index.d.ts.map +1 -0
  397. package/dist/dev/pipeline/phases/cleanup-phase/index.js +2 -0
  398. package/dist/dev/pipeline/phases/cleanup-phase/index.js.map +1 -0
  399. package/dist/dev/pipeline/phases/cost-phase/cost-phase.d.ts +40 -0
  400. package/dist/dev/pipeline/phases/cost-phase/cost-phase.d.ts.map +1 -0
  401. package/dist/dev/pipeline/phases/cost-phase/cost-phase.js +43 -0
  402. package/dist/dev/pipeline/phases/cost-phase/cost-phase.js.map +1 -0
  403. package/dist/dev/pipeline/phases/cost-phase/index.d.ts +3 -0
  404. package/dist/dev/pipeline/phases/cost-phase/index.d.ts.map +1 -0
  405. package/dist/dev/pipeline/phases/cost-phase/index.js +2 -0
  406. package/dist/dev/pipeline/phases/cost-phase/index.js.map +1 -0
  407. package/dist/dev/pipeline/phases/deliver-phase/deliver-phase.d.ts +68 -0
  408. package/dist/dev/pipeline/phases/deliver-phase/deliver-phase.d.ts.map +1 -0
  409. package/dist/dev/pipeline/phases/deliver-phase/deliver-phase.js +125 -0
  410. package/dist/dev/pipeline/phases/deliver-phase/deliver-phase.js.map +1 -0
  411. package/dist/dev/pipeline/phases/deliver-phase/index.d.ts +3 -0
  412. package/dist/dev/pipeline/phases/deliver-phase/index.d.ts.map +1 -0
  413. package/dist/dev/pipeline/phases/deliver-phase/index.js +2 -0
  414. package/dist/dev/pipeline/phases/deliver-phase/index.js.map +1 -0
  415. package/dist/dev/pipeline/phases/dry-run/dry-run.d.ts +38 -0
  416. package/dist/dev/pipeline/phases/dry-run/dry-run.d.ts.map +1 -0
  417. package/dist/dev/pipeline/phases/dry-run/dry-run.js +33 -0
  418. package/dist/dev/pipeline/phases/dry-run/dry-run.js.map +1 -0
  419. package/dist/dev/pipeline/phases/dry-run/index.d.ts +2 -0
  420. package/dist/dev/pipeline/phases/dry-run/index.d.ts.map +1 -0
  421. package/dist/dev/pipeline/phases/dry-run/index.js +2 -0
  422. package/dist/dev/pipeline/phases/dry-run/index.js.map +1 -0
  423. package/dist/dev/pipeline/phases/epic-completion/epic-completion.d.ts +48 -0
  424. package/dist/dev/pipeline/phases/epic-completion/epic-completion.d.ts.map +1 -0
  425. package/dist/dev/pipeline/phases/epic-completion/epic-completion.js +42 -0
  426. package/dist/dev/pipeline/phases/epic-completion/epic-completion.js.map +1 -0
  427. package/dist/dev/pipeline/phases/epic-completion/index.d.ts +3 -0
  428. package/dist/dev/pipeline/phases/epic-completion/index.d.ts.map +1 -0
  429. package/dist/dev/pipeline/phases/epic-completion/index.js +2 -0
  430. package/dist/dev/pipeline/phases/epic-completion/index.js.map +1 -0
  431. package/dist/dev/pipeline/phases/feasibility/feasibility.d.ts +52 -0
  432. package/dist/dev/pipeline/phases/feasibility/feasibility.d.ts.map +1 -0
  433. package/dist/dev/pipeline/phases/feasibility/feasibility.js +34 -0
  434. package/dist/dev/pipeline/phases/feasibility/feasibility.js.map +1 -0
  435. package/dist/dev/pipeline/phases/feasibility/index.d.ts +3 -0
  436. package/dist/dev/pipeline/phases/feasibility/index.d.ts.map +1 -0
  437. package/dist/dev/pipeline/phases/feasibility/index.js +2 -0
  438. package/dist/dev/pipeline/phases/feasibility/index.js.map +1 -0
  439. package/dist/dev/pipeline/phases/index.d.ts +26 -0
  440. package/dist/dev/pipeline/phases/index.d.ts.map +1 -0
  441. package/dist/dev/pipeline/phases/index.js +14 -0
  442. package/dist/dev/pipeline/phases/index.js.map +1 -0
  443. package/dist/dev/pipeline/phases/lock-check/index.d.ts +3 -0
  444. package/dist/dev/pipeline/phases/lock-check/index.d.ts.map +1 -0
  445. package/dist/dev/pipeline/phases/lock-check/index.js +2 -0
  446. package/dist/dev/pipeline/phases/lock-check/index.js.map +1 -0
  447. package/dist/dev/pipeline/phases/lock-check/lock-check.d.ts +55 -0
  448. package/dist/dev/pipeline/phases/lock-check/lock-check.d.ts.map +1 -0
  449. package/dist/dev/pipeline/phases/lock-check/lock-check.js +60 -0
  450. package/dist/dev/pipeline/phases/lock-check/lock-check.js.map +1 -0
  451. package/dist/dev/pipeline/phases/pr-retry/index.d.ts +3 -0
  452. package/dist/dev/pipeline/phases/pr-retry/index.d.ts.map +1 -0
  453. package/dist/dev/pipeline/phases/pr-retry/index.js +2 -0
  454. package/dist/dev/pipeline/phases/pr-retry/index.js.map +1 -0
  455. package/dist/dev/pipeline/phases/pr-retry/pr-retry.d.ts +58 -0
  456. package/dist/dev/pipeline/phases/pr-retry/pr-retry.d.ts.map +1 -0
  457. package/dist/dev/pipeline/phases/pr-retry/pr-retry.js +82 -0
  458. package/dist/dev/pipeline/phases/pr-retry/pr-retry.js.map +1 -0
  459. package/dist/dev/pipeline/phases/preflight-phase/index.d.ts +3 -0
  460. package/dist/dev/pipeline/phases/preflight-phase/index.d.ts.map +1 -0
  461. package/dist/dev/pipeline/phases/preflight-phase/index.js +2 -0
  462. package/dist/dev/pipeline/phases/preflight-phase/index.js.map +1 -0
  463. package/dist/dev/pipeline/phases/preflight-phase/preflight-phase.d.ts +42 -0
  464. package/dist/dev/pipeline/phases/preflight-phase/preflight-phase.d.ts.map +1 -0
  465. package/dist/dev/pipeline/phases/preflight-phase/preflight-phase.js +41 -0
  466. package/dist/dev/pipeline/phases/preflight-phase/preflight-phase.js.map +1 -0
  467. package/dist/dev/pipeline/phases/rework-detection/index.d.ts +3 -0
  468. package/dist/dev/pipeline/phases/rework-detection/index.d.ts.map +1 -0
  469. package/dist/dev/pipeline/phases/rework-detection/index.js +2 -0
  470. package/dist/dev/pipeline/phases/rework-detection/index.js.map +1 -0
  471. package/dist/dev/pipeline/phases/rework-detection/rework-detection.d.ts +40 -0
  472. package/dist/dev/pipeline/phases/rework-detection/rework-detection.d.ts.map +1 -0
  473. package/dist/dev/pipeline/phases/rework-detection/rework-detection.js +38 -0
  474. package/dist/dev/pipeline/phases/rework-detection/rework-detection.js.map +1 -0
  475. package/dist/dev/pipeline/phases/ticket-fetch/index.d.ts +3 -0
  476. package/dist/dev/pipeline/phases/ticket-fetch/index.d.ts.map +1 -0
  477. package/dist/dev/pipeline/phases/ticket-fetch/index.js +2 -0
  478. package/dist/dev/pipeline/phases/ticket-fetch/index.js.map +1 -0
  479. package/dist/dev/pipeline/phases/ticket-fetch/ticket-fetch.d.ts +46 -0
  480. package/dist/dev/pipeline/phases/ticket-fetch/ticket-fetch.d.ts.map +1 -0
  481. package/dist/dev/pipeline/phases/ticket-fetch/ticket-fetch.js +64 -0
  482. package/dist/dev/pipeline/phases/ticket-fetch/ticket-fetch.js.map +1 -0
  483. package/dist/dev/pipeline/phases/transition/index.d.ts +3 -0
  484. package/dist/dev/pipeline/phases/transition/index.d.ts.map +1 -0
  485. package/dist/dev/pipeline/phases/transition/index.js +2 -0
  486. package/dist/dev/pipeline/phases/transition/index.js.map +1 -0
  487. package/dist/dev/pipeline/phases/transition/transition.d.ts +30 -0
  488. package/dist/dev/pipeline/phases/transition/transition.d.ts.map +1 -0
  489. package/dist/dev/pipeline/phases/transition/transition.js +27 -0
  490. package/dist/dev/pipeline/phases/transition/transition.js.map +1 -0
  491. package/dist/dev/pipeline/run-pipeline.d.ts +98 -0
  492. package/dist/dev/pipeline/run-pipeline.d.ts.map +1 -0
  493. package/dist/dev/pipeline/run-pipeline.js +106 -0
  494. package/dist/dev/pipeline/run-pipeline.js.map +1 -0
  495. package/dist/index.d.ts +58 -0
  496. package/dist/index.d.ts.map +1 -0
  497. package/dist/index.js +58 -0
  498. package/dist/index.js.map +1 -0
  499. package/dist/schemas/azdo/azdo-pr.d.ts +58 -0
  500. package/dist/schemas/azdo/azdo-pr.d.ts.map +1 -0
  501. package/dist/schemas/azdo/azdo-pr.js +48 -0
  502. package/dist/schemas/azdo/azdo-pr.js.map +1 -0
  503. package/dist/schemas/azdo/azdo.d.ts +88 -0
  504. package/dist/schemas/azdo/azdo.d.ts.map +1 -0
  505. package/dist/schemas/azdo/azdo.js +60 -0
  506. package/dist/schemas/azdo/azdo.js.map +1 -0
  507. package/dist/schemas/bitbucket/bitbucket.d.ts +112 -0
  508. package/dist/schemas/bitbucket/bitbucket.d.ts.map +1 -0
  509. package/dist/schemas/bitbucket/bitbucket.js +73 -0
  510. package/dist/schemas/bitbucket/bitbucket.js.map +1 -0
  511. package/dist/schemas/env/env.d.ts +336 -0
  512. package/dist/schemas/env/env.d.ts.map +1 -0
  513. package/dist/schemas/env/env.js +94 -0
  514. package/dist/schemas/env/env.js.map +1 -0
  515. package/dist/schemas/github/github.d.ts +128 -0
  516. package/dist/schemas/github/github.d.ts.map +1 -0
  517. package/dist/schemas/github/github.js +65 -0
  518. package/dist/schemas/github/github.js.map +1 -0
  519. package/dist/schemas/gitlab/gitlab.d.ts +72 -0
  520. package/dist/schemas/gitlab/gitlab.d.ts.map +1 -0
  521. package/dist/schemas/gitlab/gitlab.js +38 -0
  522. package/dist/schemas/gitlab/gitlab.js.map +1 -0
  523. package/dist/schemas/index.d.ts +15 -0
  524. package/dist/schemas/index.d.ts.map +1 -0
  525. package/dist/schemas/index.js +8 -0
  526. package/dist/schemas/index.js.map +1 -0
  527. package/dist/schemas/jira/jira.d.ts +79 -0
  528. package/dist/schemas/jira/jira.d.ts.map +1 -0
  529. package/dist/schemas/jira/jira.js +69 -0
  530. package/dist/schemas/jira/jira.js.map +1 -0
  531. package/dist/schemas/linear/linear.d.ts +178 -0
  532. package/dist/schemas/linear/linear.d.ts.map +1 -0
  533. package/dist/schemas/linear/linear.js +136 -0
  534. package/dist/schemas/linear/linear.js.map +1 -0
  535. package/dist/schemas/notion/notion.d.ts +131 -0
  536. package/dist/schemas/notion/notion.d.ts.map +1 -0
  537. package/dist/schemas/notion/notion.js +102 -0
  538. package/dist/schemas/notion/notion.js.map +1 -0
  539. package/dist/schemas/shortcut/shortcut.d.ts +149 -0
  540. package/dist/schemas/shortcut/shortcut.d.ts.map +1 -0
  541. package/dist/schemas/shortcut/shortcut.js +68 -0
  542. package/dist/schemas/shortcut/shortcut.js.map +1 -0
  543. package/dist/shared/cache/cache.d.ts +14 -0
  544. package/dist/shared/cache/cache.d.ts.map +1 -0
  545. package/dist/shared/cache/cache.js +25 -0
  546. package/dist/shared/cache/cache.js.map +1 -0
  547. package/dist/shared/cache/index.d.ts +2 -0
  548. package/dist/shared/cache/index.d.ts.map +1 -0
  549. package/dist/shared/cache/index.js +2 -0
  550. package/dist/shared/cache/index.js.map +1 -0
  551. package/dist/shared/env-parser/env-parser.d.ts +42 -0
  552. package/dist/shared/env-parser/env-parser.d.ts.map +1 -0
  553. package/dist/shared/env-parser/env-parser.js +97 -0
  554. package/dist/shared/env-parser/env-parser.js.map +1 -0
  555. package/dist/shared/env-parser/index.d.ts +3 -0
  556. package/dist/shared/env-parser/index.d.ts.map +1 -0
  557. package/dist/shared/env-parser/index.js +2 -0
  558. package/dist/shared/env-parser/index.js.map +1 -0
  559. package/dist/shared/git-ops/git-ops.d.ts +127 -0
  560. package/dist/shared/git-ops/git-ops.d.ts.map +1 -0
  561. package/dist/shared/git-ops/git-ops.js +225 -0
  562. package/dist/shared/git-ops/git-ops.js.map +1 -0
  563. package/dist/shared/git-ops/index.d.ts +3 -0
  564. package/dist/shared/git-ops/index.d.ts.map +1 -0
  565. package/dist/shared/git-ops/index.js +2 -0
  566. package/dist/shared/git-ops/index.js.map +1 -0
  567. package/dist/shared/git-token/git-token.d.ts +18 -0
  568. package/dist/shared/git-token/git-token.d.ts.map +1 -0
  569. package/dist/shared/git-token/git-token.js +28 -0
  570. package/dist/shared/git-token/git-token.js.map +1 -0
  571. package/dist/shared/git-token/index.d.ts +2 -0
  572. package/dist/shared/git-token/index.d.ts.map +1 -0
  573. package/dist/shared/git-token/index.js +2 -0
  574. package/dist/shared/git-token/index.js.map +1 -0
  575. package/dist/shared/http/fetch-and-parse/fetch-and-parse.d.ts +32 -0
  576. package/dist/shared/http/fetch-and-parse/fetch-and-parse.d.ts.map +1 -0
  577. package/dist/shared/http/fetch-and-parse/fetch-and-parse.js +53 -0
  578. package/dist/shared/http/fetch-and-parse/fetch-and-parse.js.map +1 -0
  579. package/dist/shared/http/fetch-and-parse/index.d.ts +3 -0
  580. package/dist/shared/http/fetch-and-parse/index.d.ts.map +1 -0
  581. package/dist/shared/http/fetch-and-parse/index.js +2 -0
  582. package/dist/shared/http/fetch-and-parse/index.js.map +1 -0
  583. package/dist/shared/http/index.d.ts +7 -0
  584. package/dist/shared/http/index.d.ts.map +1 -0
  585. package/dist/shared/http/index.js +4 -0
  586. package/dist/shared/http/index.js.map +1 -0
  587. package/dist/shared/http/ping-endpoint/index.d.ts +3 -0
  588. package/dist/shared/http/ping-endpoint/index.d.ts.map +1 -0
  589. package/dist/shared/http/ping-endpoint/index.js +2 -0
  590. package/dist/shared/http/ping-endpoint/index.js.map +1 -0
  591. package/dist/shared/http/ping-endpoint/ping-endpoint.d.ts +29 -0
  592. package/dist/shared/http/ping-endpoint/ping-endpoint.d.ts.map +1 -0
  593. package/dist/shared/http/ping-endpoint/ping-endpoint.js +31 -0
  594. package/dist/shared/http/ping-endpoint/ping-endpoint.js.map +1 -0
  595. package/dist/shared/http/retry-fetch/index.d.ts +3 -0
  596. package/dist/shared/http/retry-fetch/index.d.ts.map +1 -0
  597. package/dist/shared/http/retry-fetch/index.js +2 -0
  598. package/dist/shared/http/retry-fetch/index.js.map +1 -0
  599. package/dist/shared/http/retry-fetch/retry-fetch.d.ts +33 -0
  600. package/dist/shared/http/retry-fetch/retry-fetch.d.ts.map +1 -0
  601. package/dist/shared/http/retry-fetch/retry-fetch.js +94 -0
  602. package/dist/shared/http/retry-fetch/retry-fetch.js.map +1 -0
  603. package/dist/shared/label-helpers/index.d.ts +3 -0
  604. package/dist/shared/label-helpers/index.d.ts.map +1 -0
  605. package/dist/shared/label-helpers/index.js +2 -0
  606. package/dist/shared/label-helpers/index.js.map +1 -0
  607. package/dist/shared/label-helpers/label-helpers.d.ts +41 -0
  608. package/dist/shared/label-helpers/label-helpers.d.ts.map +1 -0
  609. package/dist/shared/label-helpers/label-helpers.js +51 -0
  610. package/dist/shared/label-helpers/label-helpers.js.map +1 -0
  611. package/dist/shared/remote/index.d.ts +2 -0
  612. package/dist/shared/remote/index.d.ts.map +1 -0
  613. package/dist/shared/remote/index.js +2 -0
  614. package/dist/shared/remote/index.js.map +1 -0
  615. package/dist/shared/remote/remote.d.ts +39 -0
  616. package/dist/shared/remote/remote.d.ts.map +1 -0
  617. package/dist/shared/remote/remote.js +180 -0
  618. package/dist/shared/remote/remote.js.map +1 -0
  619. package/dist/types/board.d.ts +62 -0
  620. package/dist/types/board.d.ts.map +1 -0
  621. package/dist/types/board.js +5 -0
  622. package/dist/types/board.js.map +1 -0
  623. package/dist/types/index.d.ts +5 -0
  624. package/dist/types/index.d.ts.map +1 -0
  625. package/dist/types/index.js +2 -0
  626. package/dist/types/index.js.map +1 -0
  627. package/dist/types/progress.d.ts +21 -0
  628. package/dist/types/progress.d.ts.map +1 -0
  629. package/dist/types/progress.js +34 -0
  630. package/dist/types/progress.js.map +1 -0
  631. package/dist/types/remote.d.ts +77 -0
  632. package/dist/types/remote.d.ts.map +1 -0
  633. package/dist/types/remote.js +5 -0
  634. package/dist/types/remote.js.map +1 -0
  635. package/package.json +44 -0
@@ -0,0 +1,85 @@
1
+ import type { PrCreationResult, PrReviewState } from '../../../../types/index.js';
2
+ /** Minimal fetch signature for Bitbucket API calls. */
3
+ type BbFetch = (url: string, init: RequestInit) => Promise<Response>;
4
+ /** Options for {@link createPullRequest}. */
5
+ type CreateCloudPrOpts = {
6
+ readonly fetchFn: BbFetch;
7
+ readonly username: string;
8
+ readonly token: string;
9
+ readonly workspace: string;
10
+ readonly repoSlug: string;
11
+ readonly sourceBranch: string;
12
+ readonly targetBranch: string;
13
+ readonly title: string;
14
+ readonly description: string;
15
+ };
16
+ /** Options for {@link postCloudPrComment}. */
17
+ type PostCloudCommentOpts = {
18
+ readonly fetchFn: BbFetch;
19
+ readonly username: string;
20
+ readonly token: string;
21
+ readonly workspace: string;
22
+ readonly repoSlug: string;
23
+ readonly prId: number;
24
+ readonly body: string;
25
+ };
26
+ /** Options for {@link checkPrReviewState}. */
27
+ type CheckCloudOpts = {
28
+ readonly fetchFn: BbFetch;
29
+ readonly username: string;
30
+ readonly token: string;
31
+ readonly workspace: string;
32
+ readonly repoSlug: string;
33
+ readonly branch: string;
34
+ readonly since?: string;
35
+ };
36
+ /** Options for {@link fetchPrReviewComments}. */
37
+ type FetchCloudCommentsOpts = {
38
+ readonly fetchFn: BbFetch;
39
+ readonly username: string;
40
+ readonly token: string;
41
+ readonly workspace: string;
42
+ readonly repoSlug: string;
43
+ readonly prId: number;
44
+ readonly since?: string;
45
+ };
46
+ /**
47
+ * Create a pull request on Bitbucket Cloud.
48
+ *
49
+ * @param opts - Cloud PR creation options.
50
+ * @returns A result with the PR URL and ID on success, or an error.
51
+ */
52
+ export declare function createPullRequest(opts: CreateCloudPrOpts): Promise<PrCreationResult>;
53
+ /**
54
+ * Post a comment on a Bitbucket Cloud pull request.
55
+ *
56
+ * Best-effort — never throws.
57
+ *
58
+ * @param opts - Cloud comment options.
59
+ * @returns `true` on success, `false` on error.
60
+ */
61
+ export declare function postCloudPrComment(opts: PostCloudCommentOpts): Promise<boolean>;
62
+ /**
63
+ * Check the review state of an open PR on Bitbucket Cloud.
64
+ *
65
+ * Inline comments (with `inline` property) always trigger rework.
66
+ * Conversation comments only trigger when prefixed with `Rework:`.
67
+ * Does not check formal approval state — only GitHub checks formal
68
+ * reviews (CHANGES_REQUESTED) via the reviews API.
69
+ *
70
+ * @param opts - Cloud review state options.
71
+ * @returns The review state, or `undefined` if no open PR or on error.
72
+ */
73
+ export declare function checkPrReviewState(opts: CheckCloudOpts): Promise<PrReviewState | undefined>;
74
+ /**
75
+ * Fetch feedback comments from a Bitbucket Cloud PR.
76
+ *
77
+ * Inline comments are always included (prefixed with `[path]`).
78
+ * Conversation comments only when prefixed with `Rework:` (prefix stripped).
79
+ *
80
+ * @param opts - Cloud comment fetch options.
81
+ * @returns Array of feedback strings, or `[]` on error.
82
+ */
83
+ export declare function fetchPrReviewComments(opts: FetchCloudCommentsOpts): Promise<readonly string[]>;
84
+ export {};
85
+ //# sourceMappingURL=cloud.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cloud.d.ts","sourceRoot":"","sources":["../../../../../src/dev/lifecycle/pull-request/bitbucket/cloud.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAe1E,uDAAuD;AACvD,KAAK,OAAO,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,WAAW,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAC;AAKrE,6CAA6C;AAC7C,KAAK,iBAAiB,GAAG;IACvB,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;CAC9B,CAAC;AAEF,8CAA8C;AAC9C,KAAK,oBAAoB,GAAG;IAC1B,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ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O,CAAC,SAAS,MAAM,EAAE,CAAC,CAoB5B"}
@@ -0,0 +1,158 @@
1
+ import { bitbucketCommentsSchema, bitbucketPrCreatedSchema, bitbucketPrListSchema, } from '../../../../schemas/bitbucket/bitbucket.js';
2
+ import { basicAuth, postPullRequest } from '../post-pr/post-pr.js';
3
+ import { extractReworkContent, isClancyComment, isReworkComment, } from '../rework-comment/rework-comment.js';
4
+ /** Bitbucket Cloud API base. */
5
+ const CLOUD_API = 'https://api.bitbucket.org/2.0';
6
+ /**
7
+ * Create a pull request on Bitbucket Cloud.
8
+ *
9
+ * @param opts - Cloud PR creation options.
10
+ * @returns A result with the PR URL and ID on success, or an error.
11
+ */
12
+ export async function createPullRequest(opts) {
13
+ const { fetchFn, username, token, workspace, repoSlug } = opts;
14
+ const { sourceBranch, targetBranch, title, description } = opts;
15
+ return postPullRequest({
16
+ fetchFn,
17
+ url: `${CLOUD_API}/repositories/${encodeURIComponent(workspace)}/${encodeURIComponent(repoSlug)}/pullrequests`,
18
+ headers: { Authorization: basicAuth(username, token) },
19
+ body: {
20
+ title,
21
+ description,
22
+ source: { branch: { name: sourceBranch } },
23
+ destination: { branch: { name: targetBranch } },
24
+ close_source_branch: true,
25
+ },
26
+ parseSuccess: (json) => {
27
+ const data = bitbucketPrCreatedSchema.parse(json);
28
+ return { url: data.links?.html?.href ?? '', number: data.id ?? 0 };
29
+ },
30
+ isAlreadyExists: (status, text) => status === 409 && text.includes('already exists'),
31
+ });
32
+ }
33
+ /**
34
+ * Post a comment on a Bitbucket Cloud pull request.
35
+ *
36
+ * Best-effort — never throws.
37
+ *
38
+ * @param opts - Cloud comment options.
39
+ * @returns `true` on success, `false` on error.
40
+ */
41
+ export async function postCloudPrComment(opts) {
42
+ const { fetchFn, username, token, workspace, repoSlug, prId, body } = opts;
43
+ try {
44
+ const res = await fetchFn(`${CLOUD_API}/repositories/${encodeURIComponent(workspace)}/${encodeURIComponent(repoSlug)}/pullrequests/${prId}/comments`, {
45
+ method: 'POST',
46
+ headers: {
47
+ Authorization: basicAuth(username, token),
48
+ 'Content-Type': 'application/json',
49
+ },
50
+ body: JSON.stringify({ content: { raw: body } }),
51
+ });
52
+ return res.ok;
53
+ }
54
+ catch {
55
+ return false;
56
+ }
57
+ }
58
+ /**
59
+ * Check the review state of an open PR on Bitbucket Cloud.
60
+ *
61
+ * Inline comments (with `inline` property) always trigger rework.
62
+ * Conversation comments only trigger when prefixed with `Rework:`.
63
+ * Does not check formal approval state — only GitHub checks formal
64
+ * reviews (CHANGES_REQUESTED) via the reviews API.
65
+ *
66
+ * @param opts - Cloud review state options.
67
+ * @returns The review state, or `undefined` if no open PR or on error.
68
+ */
69
+ export async function checkPrReviewState(opts) {
70
+ const { fetchFn, username, token, workspace, repoSlug, branch, since } = opts;
71
+ const auth = basicAuth(username, token);
72
+ try {
73
+ const prRes = await fetchFn(`${CLOUD_API}/repositories/${encodeURIComponent(workspace)}/${encodeURIComponent(repoSlug)}/pullrequests?q=source.branch.name="${encodeURIComponent(branch)}"&state=OPEN`, { headers: { Authorization: auth } });
74
+ if (!prRes.ok)
75
+ return undefined;
76
+ const parsed = bitbucketPrListSchema.parse(await prRes.json());
77
+ if (parsed.values.length === 0)
78
+ return undefined;
79
+ const pr = parsed.values[0];
80
+ const comments = await fetchCloudComments({
81
+ fetchFn,
82
+ auth,
83
+ workspace,
84
+ repoSlug,
85
+ prId: pr.id,
86
+ });
87
+ if (!comments)
88
+ return undefined;
89
+ const relevant = filterBySince(comments, since).filter((c) => !isClancyComment(c.content.raw));
90
+ const hasInline = relevant.some((c) => c.inline != null);
91
+ const hasReworkConvo = relevant.some((c) => c.inline == null && isReworkComment(c.content.raw));
92
+ return {
93
+ changesRequested: hasInline || hasReworkConvo,
94
+ prNumber: pr.id,
95
+ prUrl: pr.links.html?.href ?? '',
96
+ };
97
+ }
98
+ catch {
99
+ return undefined;
100
+ }
101
+ }
102
+ /**
103
+ * Fetch feedback comments from a Bitbucket Cloud PR.
104
+ *
105
+ * Inline comments are always included (prefixed with `[path]`).
106
+ * Conversation comments only when prefixed with `Rework:` (prefix stripped).
107
+ *
108
+ * @param opts - Cloud comment fetch options.
109
+ * @returns Array of feedback strings, or `[]` on error.
110
+ */
111
+ export async function fetchPrReviewComments(opts) {
112
+ const { fetchFn, username, token, workspace, repoSlug, prId, since } = opts;
113
+ const auth = basicAuth(username, token);
114
+ try {
115
+ const comments = await fetchCloudComments({
116
+ fetchFn,
117
+ auth,
118
+ workspace,
119
+ repoSlug,
120
+ prId,
121
+ });
122
+ if (!comments)
123
+ return [];
124
+ return filterBySince(comments, since)
125
+ .filter((c) => !isClancyComment(c.content.raw))
126
+ .flatMap((c) => formatComment(c));
127
+ }
128
+ catch {
129
+ return [];
130
+ }
131
+ }
132
+ /** Fetch Cloud PR comments. Returns `undefined` on error. */
133
+ async function fetchCloudComments(opts) {
134
+ const { fetchFn, auth, workspace, repoSlug, prId } = opts;
135
+ const res = await fetchFn(`${CLOUD_API}/repositories/${encodeURIComponent(workspace)}/${encodeURIComponent(repoSlug)}/pullrequests/${prId}/comments?pagelen=100`, { headers: { Authorization: auth } });
136
+ if (!res.ok)
137
+ return undefined;
138
+ const parsed = bitbucketCommentsSchema.parse(await res.json());
139
+ return parsed.values;
140
+ }
141
+ /** Filter comments by since timestamp. */
142
+ function filterBySince(comments, since) {
143
+ if (!since)
144
+ return comments;
145
+ return comments.filter((c) => c.created_on > since);
146
+ }
147
+ /** Format a comment into a feedback string, or empty if not actionable. */
148
+ function formatComment(c) {
149
+ if (c.inline != null) {
150
+ const prefix = c.inline.path ? `[${c.inline.path}] ` : '';
151
+ return [`${prefix}${c.content.raw}`];
152
+ }
153
+ if (isReworkComment(c.content.raw)) {
154
+ return [extractReworkContent(c.content.raw)];
155
+ }
156
+ return [];
157
+ }
158
+ //# sourceMappingURL=cloud.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cloud.js","sourceRoot":"","sources":["../../../../../src/dev/lifecycle/pull-request/bitbucket/cloud.ts"],"names":[],"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AO,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE,EAAE,CACrC,CAAC;IACF,IAAI,CAAC,GAAG,CAAC,EAAE;QAAE,OAAO,SAAS,CAAC;IAE9B,MAAM,MAAM,GAAG,uBAAuB,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC;IAC/D,OAAO,MAAM,CAAC,MAAM,CAAC;AACvB,CAAC;AAED,0CAA0C;AAC1C,SAAS,aAAa,CACpB,QAAqC,EACrC,KAAc;IAEd,IAAI,CAAC,KAAK;QAAE,OAAO,QAAQ,CAAC;IAC5B,OAAO,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,UAAU,GAAG,KAAK,CAAC,CAAC;AACtD,CAAC;AAED,2EAA2E;AAC3E,SAAS,aAAa,CAAC,CAAmB;IACxC,IAAI,CAAC,CAAC,MAAM,IAAI,IAAI,EAAE,CAAC;QACrB,MAAM,MAAM,GAAG,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;QAC1D,OAAO,CAAC,GAAG,MAAM,GAAG,CAAC,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;IACvC,CAAC;IAED,IAAI,eAAe,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC;QACnC,OAAO,CAAC,oBAAoB,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC;IAC/C,CAAC;IAED,OAAO,EAAE,CAAC;AACZ,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { checkPrReviewState, createPullRequest, fetchPrReviewComments, postCloudPrComment, } from './cloud.js';
2
+ export { checkServerPrReviewState, createServerPullRequest, fetchServerPrReviewComments, postServerPrComment, } from './server.js';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/dev/lifecycle/pull-request/bitbucket/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAClB,iBAAiB,EACjB,qBAAqB,EACrB,kBAAkB,GACnB,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,wBAAwB,EACxB,uBAAuB,EACvB,2BAA2B,EAC3B,mBAAmB,GACpB,MAAM,aAAa,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { checkPrReviewState, createPullRequest, fetchPrReviewComments, postCloudPrComment, } from './cloud.js';
2
+ export { checkServerPrReviewState, createServerPullRequest, fetchServerPrReviewComments, postServerPrComment, } from './server.js';
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/dev/lifecycle/pull-request/bitbucket/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAClB,iBAAiB,EACjB,qBAAqB,EACrB,kBAAkB,GACnB,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,wBAAwB,EACxB,uBAAuB,EACvB,2BAA2B,EAC3B,mBAAmB,GACpB,MAAM,aAAa,CAAC"}
@@ -0,0 +1,85 @@
1
+ import type { PrCreationResult, PrReviewState } from '../../../../types/index.js';
2
+ /** Minimal fetch signature for Bitbucket API calls. */
3
+ type BbFetch = (url: string, init: RequestInit) => Promise<Response>;
4
+ /** Options for {@link createServerPullRequest}. */
5
+ type CreateServerPrOpts = {
6
+ readonly fetchFn: BbFetch;
7
+ readonly token: string;
8
+ readonly apiBase: string;
9
+ readonly projectKey: string;
10
+ readonly repoSlug: string;
11
+ readonly sourceBranch: string;
12
+ readonly targetBranch: string;
13
+ readonly title: string;
14
+ readonly description: string;
15
+ };
16
+ /** Options for {@link postServerPrComment}. */
17
+ type PostServerCommentOpts = {
18
+ readonly fetchFn: BbFetch;
19
+ readonly token: string;
20
+ readonly apiBase: string;
21
+ readonly projectKey: string;
22
+ readonly repoSlug: string;
23
+ readonly prId: number;
24
+ readonly body: string;
25
+ };
26
+ /** Options for {@link checkServerPrReviewState}. */
27
+ type CheckServerOpts = {
28
+ readonly fetchFn: BbFetch;
29
+ readonly token: string;
30
+ readonly apiBase: string;
31
+ readonly projectKey: string;
32
+ readonly repoSlug: string;
33
+ readonly branch: string;
34
+ readonly since?: string;
35
+ };
36
+ /** Options for {@link fetchServerPrReviewComments}. */
37
+ type FetchServerCommentsOpts = {
38
+ readonly fetchFn: BbFetch;
39
+ readonly token: string;
40
+ readonly apiBase: string;
41
+ readonly projectKey: string;
42
+ readonly repoSlug: string;
43
+ readonly prId: number;
44
+ readonly since?: string;
45
+ };
46
+ /**
47
+ * Create a pull request on Bitbucket Server / Data Center.
48
+ *
49
+ * @param opts - Server PR creation options.
50
+ * @returns A result with the PR URL and ID on success, or an error.
51
+ */
52
+ export declare function createServerPullRequest(opts: CreateServerPrOpts): Promise<PrCreationResult>;
53
+ /**
54
+ * Post a comment on a Bitbucket Server/DC pull request.
55
+ *
56
+ * Best-effort — never throws.
57
+ *
58
+ * @param opts - Server comment options.
59
+ * @returns `true` on success, `false` on error.
60
+ */
61
+ export declare function postServerPrComment(opts: PostServerCommentOpts): Promise<boolean>;
62
+ /**
63
+ * Check the review state of an open PR on Bitbucket Server/DC.
64
+ *
65
+ * Inline comments (with `anchor` property) always trigger rework.
66
+ * Conversation comments only trigger when prefixed with `Rework:`.
67
+ * Does not check formal approval state — only GitHub checks formal
68
+ * reviews (CHANGES_REQUESTED) via the reviews API.
69
+ *
70
+ * @param opts - Server review state options.
71
+ * @returns The review state, or `undefined` if no open PR or on error.
72
+ */
73
+ export declare function checkServerPrReviewState(opts: CheckServerOpts): Promise<PrReviewState | undefined>;
74
+ /**
75
+ * Fetch feedback comments from a Bitbucket Server/DC PR.
76
+ *
77
+ * Inline comments are always included (prefixed with `[path]`).
78
+ * Conversation comments only when prefixed with `Rework:` (prefix stripped).
79
+ *
80
+ * @param opts - Server comment fetch options.
81
+ * @returns Array of feedback strings, or `[]` on error.
82
+ */
83
+ export declare function fetchServerPrReviewComments(opts: FetchServerCommentsOpts): Promise<readonly string[]>;
84
+ export {};
85
+ //# sourceMappingURL=server.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../../../../src/dev/lifecycle/pull-request/bitbucket/server.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAe1E,uDAAuD;AACvD,KAAK,OAAO,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,WAAW,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAC;AAErE,mDAAmD;AACnD,KAAK,kBAAkB,GAAG;IACxB,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;CAC9B,CAAC;AAEF,+CAA+C;AAC/C,KAAK,qBAAqB,GAAG;IAC3B,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAA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
1
+ import { bitbucketServerActivitiesSchema, bitbucketServerPrCreatedSchema, bitbucketServerPrListSchema, } from '../../../../schemas/bitbucket/bitbucket.js';
2
+ import { postPullRequest } from '../post-pr/post-pr.js';
3
+ import { extractReworkContent, isClancyComment, isReworkComment, } from '../rework-comment/rework-comment.js';
4
+ /**
5
+ * Create a pull request on Bitbucket Server / Data Center.
6
+ *
7
+ * @param opts - Server PR creation options.
8
+ * @returns A result with the PR URL and ID on success, or an error.
9
+ */
10
+ export async function createServerPullRequest(opts) {
11
+ const { fetchFn, token, apiBase, projectKey, repoSlug } = opts;
12
+ const { sourceBranch, targetBranch, title, description } = opts;
13
+ return postPullRequest({
14
+ fetchFn,
15
+ url: `${apiBase}/projects/${encodeURIComponent(projectKey)}/repos/${encodeURIComponent(repoSlug)}/pull-requests`,
16
+ headers: { Authorization: `Bearer ${token}` },
17
+ body: {
18
+ title,
19
+ description,
20
+ fromRef: {
21
+ id: `refs/heads/${sourceBranch}`,
22
+ repository: { slug: repoSlug, project: { key: projectKey } },
23
+ },
24
+ toRef: {
25
+ id: `refs/heads/${targetBranch}`,
26
+ repository: { slug: repoSlug, project: { key: projectKey } },
27
+ },
28
+ },
29
+ parseSuccess: (json) => {
30
+ const data = bitbucketServerPrCreatedSchema.parse(json);
31
+ return { url: data.links?.self?.[0]?.href ?? '', number: data.id ?? 0 };
32
+ },
33
+ isAlreadyExists: (status, text) => status === 409 &&
34
+ (text.includes('already exists') ||
35
+ text.includes('Only one pull request')),
36
+ });
37
+ }
38
+ /**
39
+ * Post a comment on a Bitbucket Server/DC pull request.
40
+ *
41
+ * Best-effort — never throws.
42
+ *
43
+ * @param opts - Server comment options.
44
+ * @returns `true` on success, `false` on error.
45
+ */
46
+ export async function postServerPrComment(opts) {
47
+ const { fetchFn, token, apiBase, projectKey, repoSlug, prId, body } = opts;
48
+ try {
49
+ const res = await fetchFn(`${apiBase}/projects/${encodeURIComponent(projectKey)}/repos/${encodeURIComponent(repoSlug)}/pull-requests/${prId}/comments`, {
50
+ method: 'POST',
51
+ headers: {
52
+ Authorization: `Bearer ${token}`,
53
+ 'Content-Type': 'application/json',
54
+ },
55
+ body: JSON.stringify({ text: body }),
56
+ });
57
+ return res.ok;
58
+ }
59
+ catch {
60
+ return false;
61
+ }
62
+ }
63
+ /**
64
+ * Check the review state of an open PR on Bitbucket Server/DC.
65
+ *
66
+ * Inline comments (with `anchor` property) always trigger rework.
67
+ * Conversation comments only trigger when prefixed with `Rework:`.
68
+ * Does not check formal approval state — only GitHub checks formal
69
+ * reviews (CHANGES_REQUESTED) via the reviews API.
70
+ *
71
+ * @param opts - Server review state options.
72
+ * @returns The review state, or `undefined` if no open PR or on error.
73
+ */
74
+ export async function checkServerPrReviewState(opts) {
75
+ const { fetchFn, token, apiBase, projectKey, repoSlug, branch, since } = opts;
76
+ const auth = `Bearer ${token}`;
77
+ try {
78
+ const prRes = await fetchFn(`${apiBase}/projects/${encodeURIComponent(projectKey)}/repos/${encodeURIComponent(repoSlug)}/pull-requests?state=OPEN&at=${encodeURIComponent(`refs/heads/${branch}`)}`, { headers: { Authorization: auth } });
79
+ if (!prRes.ok)
80
+ return undefined;
81
+ const parsed = bitbucketServerPrListSchema.parse(await prRes.json());
82
+ if (parsed.values.length === 0)
83
+ return undefined;
84
+ const pr = parsed.values[0];
85
+ const activities = await fetchActivities({
86
+ fetchFn,
87
+ auth,
88
+ apiBase,
89
+ projectKey,
90
+ repoSlug,
91
+ prId: pr.id,
92
+ });
93
+ if (!activities)
94
+ return undefined;
95
+ const relevant = filterBySince(activities, since).filter((c) => !isClancyComment(c.text));
96
+ const hasInline = relevant.some((c) => c.anchor != null);
97
+ const hasReworkConvo = relevant.some((c) => c.anchor == null && isReworkComment(c.text));
98
+ return {
99
+ changesRequested: hasInline || hasReworkConvo,
100
+ prNumber: pr.id,
101
+ prUrl: pr.links.self?.[0]?.href ?? '',
102
+ };
103
+ }
104
+ catch {
105
+ return undefined;
106
+ }
107
+ }
108
+ /**
109
+ * Fetch feedback comments from a Bitbucket Server/DC PR.
110
+ *
111
+ * Inline comments are always included (prefixed with `[path]`).
112
+ * Conversation comments only when prefixed with `Rework:` (prefix stripped).
113
+ *
114
+ * @param opts - Server comment fetch options.
115
+ * @returns Array of feedback strings, or `[]` on error.
116
+ */
117
+ export async function fetchServerPrReviewComments(opts) {
118
+ const { fetchFn, token, apiBase, projectKey, repoSlug, prId, since } = opts;
119
+ const auth = `Bearer ${token}`;
120
+ try {
121
+ const activities = await fetchActivities({
122
+ fetchFn,
123
+ auth,
124
+ apiBase,
125
+ projectKey,
126
+ repoSlug,
127
+ prId,
128
+ });
129
+ if (!activities)
130
+ return [];
131
+ return filterBySince(activities, since)
132
+ .filter((c) => !isClancyComment(c.text))
133
+ .flatMap((c) => formatComment(c));
134
+ }
135
+ catch {
136
+ return [];
137
+ }
138
+ }
139
+ /** Fetch Server PR activities and extract comments. Returns `undefined` on error. */
140
+ async function fetchActivities(opts) {
141
+ const { fetchFn, auth, apiBase, projectKey, repoSlug, prId } = opts;
142
+ const res = await fetchFn(`${apiBase}/projects/${encodeURIComponent(projectKey)}/repos/${encodeURIComponent(repoSlug)}/pull-requests/${prId}/activities?limit=100`, { headers: { Authorization: auth } });
143
+ if (!res.ok)
144
+ return undefined;
145
+ const parsed = bitbucketServerActivitiesSchema.parse(await res.json());
146
+ return parsed.values
147
+ .filter((a) => a.action === 'COMMENTED' && a.comment != null)
148
+ .map((a) => a.comment);
149
+ }
150
+ /** Filter comments by since timestamp (milliseconds epoch). */
151
+ function filterBySince(comments, since) {
152
+ if (!since)
153
+ return comments;
154
+ const sinceMs = Date.parse(since);
155
+ return comments.filter((c) => c.createdDate > sinceMs);
156
+ }
157
+ /** Format a comment into a feedback string, or empty if not actionable. */
158
+ function formatComment(c) {
159
+ if (c.anchor != null) {
160
+ const prefix = c.anchor.path ? `[${c.anchor.path}] ` : '';
161
+ return [`${prefix}${c.text}`];
162
+ }
163
+ if (isReworkComment(c.text)) {
164
+ return [extractReworkContent(c.text)];
165
+ }
166
+ return [];
167
+ }
168
+ //# sourceMappingURL=server.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"server.js","sourceRoot":"","sources":["../../../../../src/dev/lifecycle/pull-request/bitbucket/server.ts"],"names":[],"mappings":"AAQA,OAAO,EACL,+BAA+B,EAC/B,8BAA8B,EAC9B,2BAA2B,GAC5B,MAAM,oCAAoC,CAAC;AAE5C,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EACL,oBAAoB,EACpB,eAAe,EACf,eAAe,GAChB,MAAM,qCAAqC,CAAC;AAmD7C;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,uBAAuB,CAC3C,IAAwB;IAExB,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,GAAG,IAAI,CAAC;IAC/D,MAAM,EAAE,YAAY,EAAE,YAAY,EAAE,KAAK,EAAE,WAAW,EAAE,GAAG,IAAI,CAAC;IAEhE,OAAO,eAAe,CAAC;QACrB,OAAO;QACP,GAAG,EAAE,GAAG,OAAO,aAAa,kBAAkB,CAAC,UAAU,CAAC,UAAU,kBAAkB,CAAC,QAAQ,CAAC,gBAAgB;QAChH,OAAO,EAAE,EAAE,aAAa,EAAE,UAAU,KAAK,EAAE,EAAE;QAC7C,IAAI,EAAE;YACJ,KAAK;YACL,WAAW;YACX,OAAO,EAAE;gBACP,EAAE,EAAE,cAAc,YAAY,EAAE;gBAChC,UAAU,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,GAAG,EAAE,UAAU,EAAE,EAAE;aAC7D;YACD,KAAK,EAAE;gBACL,EAAE,EAAE,cAAc,YAAY,EAAE;gBAChC,UAAU,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,GAAG,EAAE,UAAU,EAAE,EAAE;aAC7D;SACF;QACD,YAAY,EAAE,CAAC,IAAI,EAAE,EAAE;YACr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CAAC,GAAG,MAAM,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;IAChC,CAAC;IAED,IAAI,eAAe,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC;QAC5B,OAAO,CAAC,oBAAoB,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;IACxC,CAAC;IAED,OAAO,EAAE,CAAC;AACZ,CAAC"}
@@ -0,0 +1,107 @@
1
+ /**
2
+ * GitHub pull request creation and review state checking.
3
+ *
4
+ * Uses the GitHub REST API to create pull requests, check review state,
5
+ * and fetch review comments.
6
+ * Supports both github.com and GitHub Enterprise (GHE).
7
+ */
8
+ import type { PrCreationResult, PrReviewState } from '../../../../types/index.js';
9
+ /** Minimal fetch signature for GitHub API calls. */
10
+ type GitHubFetch = (url: string, init: RequestInit) => Promise<Response>;
11
+ /** Options for {@link checkPrReviewState}. */
12
+ type CheckReviewOpts = {
13
+ readonly fetchFn: GitHubFetch;
14
+ readonly token: string;
15
+ readonly repo: string;
16
+ readonly branch: string;
17
+ readonly owner: string;
18
+ readonly apiBase?: string;
19
+ readonly since?: string;
20
+ };
21
+ /** Options for {@link fetchPrReviewComments}. */
22
+ type FetchCommentsOpts = {
23
+ readonly fetchFn: GitHubFetch;
24
+ readonly token: string;
25
+ readonly repo: string;
26
+ readonly prNumber: number;
27
+ readonly apiBase?: string;
28
+ readonly since?: string;
29
+ };
30
+ /** Options for {@link postPrComment}. */
31
+ type PostCommentOpts = {
32
+ readonly fetchFn: GitHubFetch;
33
+ readonly token: string;
34
+ readonly repo: string;
35
+ readonly prNumber: number;
36
+ readonly body: string;
37
+ readonly apiBase?: string;
38
+ };
39
+ /** Options for {@link requestReview}. */
40
+ type RequestReviewOpts = {
41
+ readonly fetchFn: GitHubFetch;
42
+ readonly token: string;
43
+ readonly repo: string;
44
+ readonly prNumber: number;
45
+ readonly reviewers: readonly string[];
46
+ readonly apiBase?: string;
47
+ };
48
+ /** Options for {@link createPullRequest}. */
49
+ type CreatePrOpts = {
50
+ readonly fetchFn: GitHubFetch;
51
+ readonly token: string;
52
+ readonly repo: string;
53
+ readonly head: string;
54
+ readonly base: string;
55
+ readonly title: string;
56
+ readonly body: string;
57
+ readonly apiBase?: string;
58
+ };
59
+ /**
60
+ * Check the review state of an open PR for a given branch.
61
+ *
62
+ * Finds the open PR matching the branch, fetches inline and conversation
63
+ * comments. Any inline comment triggers rework. Conversation comments
64
+ * only trigger rework when prefixed with `Rework:`.
65
+ *
66
+ * @param opts - Options including fetch, token, repo, branch, and owner.
67
+ * @returns The review state, or `undefined` if no open PR or on error.
68
+ */
69
+ export declare function checkPrReviewState(opts: CheckReviewOpts): Promise<PrReviewState | undefined>;
70
+ /**
71
+ * Fetch feedback comments (inline + conversation) for a PR.
72
+ *
73
+ * Inline comments are included unconditionally. Conversation comments
74
+ * are only included when prefixed with `Rework:` (case-insensitive),
75
+ * with the prefix stripped. Comments prefixed with `[clancy]` are excluded.
76
+ *
77
+ * @param opts - Options including fetch, token, repo, and prNumber.
78
+ * @returns An array of feedback descriptions, or `[]` on error.
79
+ */
80
+ export declare function fetchPrReviewComments(opts: FetchCommentsOpts): Promise<readonly string[]>;
81
+ /**
82
+ * Post a comment on a GitHub PR/issue.
83
+ *
84
+ * Best-effort — never throws. Returns `true` on success, `false` on error.
85
+ *
86
+ * @param opts - Options including fetch, token, repo, prNumber, and body.
87
+ * @returns `true` on success, `false` on error.
88
+ */
89
+ export declare function postPrComment(opts: PostCommentOpts): Promise<boolean>;
90
+ /**
91
+ * Re-request review from specified reviewers on a GitHub PR.
92
+ *
93
+ * Best-effort — never throws. Returns `true` on success, `false` on error.
94
+ *
95
+ * @param opts - Options including fetch, token, repo, prNumber, and reviewers.
96
+ * @returns `true` on success, `false` on error.
97
+ */
98
+ export declare function requestReview(opts: RequestReviewOpts): Promise<boolean>;
99
+ /**
100
+ * Create a pull request on GitHub.
101
+ *
102
+ * @param opts - Options including fetch, token, repo, head, base, title, and body.
103
+ * @returns A result with the PR URL and number on success, or an error.
104
+ */
105
+ export declare function createPullRequest(opts: CreatePrOpts): Promise<PrCreationResult>;
106
+ export {};
107
+ //# sourceMappingURL=github.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"github.d.ts","sourceRoot":"","sources":["../../../../../src/dev/lifecycle/pull-request/github/github.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAkB1E,oDAAoD;AACpD,KAAK,WAAW,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,WAAW,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAC;AAEzE,8CAA8C;AAC9C,KAAK,eAAe,GAAG;IACrB,QAAQ,CAAC,OAAO,EAAE,WAAW,CAAC;IAC9B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;CACzB,CAAC;AAEF,iDAAiD;AACjD,KAAK,iBAAiB,GAAG;IACvB,QAAQ,CAAC,OAAO,EAAE,WAAW,CAAC;IAC9B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;CACzB,CAAC;AAEF,yCAAyC;AACzC,KAAK,eAAe,GAAG;IACrB,QAAQ,CAAC,OAAO,EAAE,WAAW,CAAC;IAC9B,QAAQ,CAAC,KAAK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