@nulab/bee 1.1.1 → 1.1.2

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 (249) hide show
  1. package/dist/activities-BPTHt_MD.mjs +69 -0
  2. package/dist/activities-CRiEq51-.mjs +72 -0
  3. package/dist/activities-DyOMqdsM.mjs +69 -0
  4. package/dist/activity-labels-CLFpxp8o.mjs +34 -0
  5. package/dist/add-Br-_TLRp.mjs +55 -0
  6. package/dist/add-CTmmy2t9.mjs +26 -0
  7. package/dist/add-user-BVWFcbH7.mjs +26 -0
  8. package/dist/api-kJR0fRPw.mjs +143 -0
  9. package/dist/attachments-CnL8t9tK.mjs +50 -0
  10. package/dist/attachments-D8IoJjYE.mjs +50 -0
  11. package/dist/attachments-DfgEkAY2.mjs +46 -0
  12. package/dist/auth-5TJGBPxi.mjs +13 -0
  13. package/dist/bee-command-v0qvZeth.mjs +57 -0
  14. package/dist/browse-vgF6nz7X.mjs +304 -0
  15. package/dist/category-BZ7XdVgx.mjs +11 -0
  16. package/dist/clone-DAWVtVbZ.mjs +43 -0
  17. package/dist/close-cTyZPv77.mjs +37 -0
  18. package/dist/comment-CkYJYFrF.mjs +115 -0
  19. package/dist/comment-DzRBQNv8.mjs +102 -0
  20. package/dist/comments-SnOZ-EUJ.mjs +47 -0
  21. package/dist/common-options-BuYWxYdO.mjs +45 -0
  22. package/dist/completion-yfcnEl7k.mjs +113 -0
  23. package/dist/count-BI7ld4k5.mjs +50 -0
  24. package/dist/count-Bw0mVlxC.mjs +40 -0
  25. package/dist/count-CH_LN4k6.mjs +51 -0
  26. package/dist/count-CHzDiMV3.mjs +25 -0
  27. package/dist/count-DvmYzPD_.mjs +46 -0
  28. package/dist/create-BHjwacOk.mjs +47 -0
  29. package/dist/create-BXWATibN.mjs +41 -0
  30. package/dist/create-BtLVFmbR.mjs +29 -0
  31. package/dist/create-CoF2bahH.mjs +29 -0
  32. package/dist/create-DhAOhro9.mjs +60 -0
  33. package/dist/create-DtMLv7Wq.mjs +26 -0
  34. package/dist/create-PtahSFdG.mjs +66 -0
  35. package/dist/create-Y4vo2zwX.mjs +44 -0
  36. package/dist/create-vwRKZ3Lm.mjs +31 -0
  37. package/dist/dashboard-CYYU5Yii.mjs +97 -0
  38. package/dist/delete-BCAPHs-g.mjs +25 -0
  39. package/dist/delete-BHNt5SWa.mjs +24 -0
  40. package/dist/delete-BlmanW0H.mjs +25 -0
  41. package/dist/delete-Bxk14ntp.mjs +24 -0
  42. package/dist/delete-C05oMZEW.mjs +24 -0
  43. package/dist/delete-CMwkcSiA.mjs +25 -0
  44. package/dist/delete-CTeH7nzL.mjs +29 -0
  45. package/dist/delete-D2yDBhZc.mjs +24 -0
  46. package/dist/delete-HMOfvtv3.mjs +25 -0
  47. package/dist/document-CiIzSyoS.mjs +13 -0
  48. package/dist/edit-BBvSbt0m.mjs +22 -0
  49. package/dist/edit-CN1gdpjd.mjs +37 -0
  50. package/dist/edit-C_KbKopB.mjs +36 -0
  51. package/dist/edit-D5Z45NVj.mjs +27 -0
  52. package/dist/edit-DKQw-XXP.mjs +27 -0
  53. package/dist/edit-DRxr4r-r.mjs +60 -0
  54. package/dist/edit-DxsP-aPX.mjs +43 -0
  55. package/dist/edit-Otc7XHU7.mjs +52 -0
  56. package/dist/format-DHAR0n3J.mjs +9 -0
  57. package/dist/history-DpjqxFkX.mjs +55 -0
  58. package/dist/index.mjs +33 -37918
  59. package/dist/issue-BRzJy3k1.mjs +18 -0
  60. package/dist/issue-type-Byzh4yLx.mjs +11 -0
  61. package/dist/list-B3A5SDEm.mjs +35 -0
  62. package/dist/list-BMKaJoe_.mjs +64 -0
  63. package/dist/list-BOMbpS4m.mjs +46 -0
  64. package/dist/list-BmZ_JbLB.mjs +104 -0
  65. package/dist/list-BpUUxxwQ.mjs +46 -0
  66. package/dist/list-CgIebllW.mjs +94 -0
  67. package/dist/list-D0Z__0nw.mjs +42 -0
  68. package/dist/list-D3FkO9gb.mjs +56 -0
  69. package/dist/list-D7WLdHvX.mjs +42 -0
  70. package/dist/list-DAr3urtu.mjs +53 -0
  71. package/dist/list-DqpWd9aR.mjs +59 -0
  72. package/dist/list-VO_PbRjC.mjs +50 -0
  73. package/dist/list-b6ByzUFt.mjs +79 -0
  74. package/dist/list-jpQ28gU2.mjs +56 -0
  75. package/dist/list-y93EXyDj.mjs +42 -0
  76. package/dist/login-BnJYzdR3.mjs +228 -0
  77. package/dist/logout-YMnSRLLF.mjs +56 -0
  78. package/dist/me-CLPAe7X2.mjs +36 -0
  79. package/dist/milestone-Dc3alfp9.mjs +11 -0
  80. package/dist/notification-CsOuC8Uk.mjs +11 -0
  81. package/dist/output-DBvfyU1J.mjs +39 -0
  82. package/dist/pr-BBe07JUp.mjs +15 -0
  83. package/dist/project-Dilo1T5e.mjs +16 -0
  84. package/dist/read-BS2G4sNq.mjs +17 -0
  85. package/dist/read-CyCASx6U.mjs +17 -0
  86. package/dist/read-all-CjgMJ2to.mjs +16 -0
  87. package/dist/refresh-DDU2ZLnc.mjs +54 -0
  88. package/dist/registry-B0ZQfBD5.mjs +35 -0
  89. package/dist/registry-RATsKPUm.mjs +2 -0
  90. package/dist/remove-BSDJvkVJ.mjs +17 -0
  91. package/dist/remove-user-CShNCvf8.mjs +26 -0
  92. package/dist/reopen-BIRhcmsI.mjs +28 -0
  93. package/dist/repo-B2K8y0mD.mjs +10 -0
  94. package/dist/role-labels-CLA2wmjO.mjs +11 -0
  95. package/dist/space-BgZeUqoH.mjs +6 -0
  96. package/dist/{shared/bee.CHtg3F43.mjs → src-BWaxjrq_.mjs} +143 -175
  97. package/dist/src-CP4YLIAh.mjs +1008 -0
  98. package/dist/src-CTD9-bSB.mjs +22760 -0
  99. package/dist/star-Sgb-e2CQ.mjs +11 -0
  100. package/dist/status-BkFMW8Jh.mjs +53 -0
  101. package/dist/status-CaGqMXh7.mjs +64 -0
  102. package/dist/status-DDFyQrRZ.mjs +11 -0
  103. package/dist/status-nI4Dpcoo.mjs +58 -0
  104. package/dist/stdin-C-vjNi9T.mjs +17 -0
  105. package/dist/switch-CMLfVGDN.mjs +34 -0
  106. package/dist/tags-DuMJZyBL.mjs +29 -0
  107. package/dist/team-DfQn8Tf5.mjs +6 -0
  108. package/dist/token-BmkUX9vc.mjs +28 -0
  109. package/dist/tree-CozBqPbN.mjs +46 -0
  110. package/dist/user-DMyFmoP3.mjs +11 -0
  111. package/dist/users-BSGqsGSy.mjs +51 -0
  112. package/dist/view-Bj99sk7O.mjs +48 -0
  113. package/dist/view-Bs8o0c7i.mjs +36 -0
  114. package/dist/view-C1ECwTMN.mjs +54 -0
  115. package/dist/view-COBYBfu7.mjs +38 -0
  116. package/dist/view-CZHT-HiE.mjs +36 -0
  117. package/dist/view-D1RuQJV6.mjs +76 -0
  118. package/dist/view-DBO75WzR.mjs +54 -0
  119. package/dist/view-DJHrnN8j.mjs +62 -0
  120. package/dist/view-DLx6qQt9.mjs +51 -0
  121. package/dist/watching-D22YYxOT.mjs +12 -0
  122. package/dist/wiki-B-DQUuIX.mjs +16 -0
  123. package/package.json +13 -10
  124. package/dist/chunks/activities.mjs +0 -75
  125. package/dist/chunks/activities2.mjs +0 -75
  126. package/dist/chunks/activities3.mjs +0 -75
  127. package/dist/chunks/add-user.mjs +0 -38
  128. package/dist/chunks/add.mjs +0 -63
  129. package/dist/chunks/add2.mjs +0 -39
  130. package/dist/chunks/api.mjs +0 -174
  131. package/dist/chunks/attachments.mjs +0 -47
  132. package/dist/chunks/attachments2.mjs +0 -47
  133. package/dist/chunks/attachments3.mjs +0 -48
  134. package/dist/chunks/browse.mjs +0 -269
  135. package/dist/chunks/clone.mjs +0 -60
  136. package/dist/chunks/close.mjs +0 -50
  137. package/dist/chunks/comment.mjs +0 -125
  138. package/dist/chunks/comment2.mjs +0 -111
  139. package/dist/chunks/comments.mjs +0 -57
  140. package/dist/chunks/completion.mjs +0 -113
  141. package/dist/chunks/count.mjs +0 -68
  142. package/dist/chunks/count2.mjs +0 -69
  143. package/dist/chunks/count3.mjs +0 -59
  144. package/dist/chunks/count4.mjs +0 -35
  145. package/dist/chunks/count5.mjs +0 -52
  146. package/dist/chunks/create.mjs +0 -60
  147. package/dist/chunks/create2.mjs +0 -88
  148. package/dist/chunks/create3.mjs +0 -64
  149. package/dist/chunks/create4.mjs +0 -74
  150. package/dist/chunks/create5.mjs +0 -56
  151. package/dist/chunks/create6.mjs +0 -37
  152. package/dist/chunks/create7.mjs +0 -45
  153. package/dist/chunks/create8.mjs +0 -49
  154. package/dist/chunks/create9.mjs +0 -49
  155. package/dist/chunks/dashboard.mjs +0 -84
  156. package/dist/chunks/delete.mjs +0 -48
  157. package/dist/chunks/delete2.mjs +0 -46
  158. package/dist/chunks/delete3.mjs +0 -46
  159. package/dist/chunks/delete4.mjs +0 -49
  160. package/dist/chunks/delete5.mjs +0 -50
  161. package/dist/chunks/delete6.mjs +0 -50
  162. package/dist/chunks/delete7.mjs +0 -62
  163. package/dist/chunks/delete8.mjs +0 -53
  164. package/dist/chunks/delete9.mjs +0 -48
  165. package/dist/chunks/edit.mjs +0 -56
  166. package/dist/chunks/edit2.mjs +0 -78
  167. package/dist/chunks/edit3.mjs +0 -65
  168. package/dist/chunks/edit4.mjs +0 -51
  169. package/dist/chunks/edit5.mjs +0 -43
  170. package/dist/chunks/edit6.mjs +0 -54
  171. package/dist/chunks/edit7.mjs +0 -50
  172. package/dist/chunks/edit8.mjs +0 -50
  173. package/dist/chunks/history.mjs +0 -56
  174. package/dist/chunks/index.mjs +0 -15
  175. package/dist/chunks/index10.mjs +0 -18
  176. package/dist/chunks/index11.mjs +0 -13
  177. package/dist/chunks/index12.mjs +0 -13
  178. package/dist/chunks/index13.mjs +0 -13
  179. package/dist/chunks/index14.mjs +0 -8
  180. package/dist/chunks/index15.mjs +0 -13
  181. package/dist/chunks/index16.mjs +0 -13
  182. package/dist/chunks/index17.mjs +0 -14
  183. package/dist/chunks/index2.mjs +0 -18
  184. package/dist/chunks/index3.mjs +0 -20
  185. package/dist/chunks/index4.mjs +0 -15
  186. package/dist/chunks/index5.mjs +0 -13
  187. package/dist/chunks/index6.mjs +0 -17
  188. package/dist/chunks/index7.mjs +0 -8
  189. package/dist/chunks/index8.mjs +0 -8
  190. package/dist/chunks/index9.mjs +0 -13
  191. package/dist/chunks/list.mjs +0 -52
  192. package/dist/chunks/list10.mjs +0 -44
  193. package/dist/chunks/list11.mjs +0 -49
  194. package/dist/chunks/list12.mjs +0 -45
  195. package/dist/chunks/list13.mjs +0 -45
  196. package/dist/chunks/list14.mjs +0 -54
  197. package/dist/chunks/list15.mjs +0 -46
  198. package/dist/chunks/list2.mjs +0 -103
  199. package/dist/chunks/list3.mjs +0 -85
  200. package/dist/chunks/list4.mjs +0 -79
  201. package/dist/chunks/list5.mjs +0 -77
  202. package/dist/chunks/list6.mjs +0 -45
  203. package/dist/chunks/list7.mjs +0 -48
  204. package/dist/chunks/list8.mjs +0 -46
  205. package/dist/chunks/list9.mjs +0 -53
  206. package/dist/chunks/login.mjs +0 -218
  207. package/dist/chunks/logout.mjs +0 -76
  208. package/dist/chunks/me.mjs +0 -48
  209. package/dist/chunks/read-all.mjs +0 -29
  210. package/dist/chunks/read.mjs +0 -29
  211. package/dist/chunks/read2.mjs +0 -27
  212. package/dist/chunks/refresh.mjs +0 -76
  213. package/dist/chunks/remove-user.mjs +0 -38
  214. package/dist/chunks/remove.mjs +0 -27
  215. package/dist/chunks/reopen.mjs +0 -42
  216. package/dist/chunks/status.mjs +0 -64
  217. package/dist/chunks/status2.mjs +0 -61
  218. package/dist/chunks/status3.mjs +0 -66
  219. package/dist/chunks/switch.mjs +0 -55
  220. package/dist/chunks/tags.mjs +0 -41
  221. package/dist/chunks/token.mjs +0 -42
  222. package/dist/chunks/tree.mjs +0 -61
  223. package/dist/chunks/users.mjs +0 -48
  224. package/dist/chunks/view.mjs +0 -58
  225. package/dist/chunks/view2.mjs +0 -95
  226. package/dist/chunks/view3.mjs +0 -68
  227. package/dist/chunks/view4.mjs +0 -70
  228. package/dist/chunks/view5.mjs +0 -61
  229. package/dist/chunks/view6.mjs +0 -52
  230. package/dist/chunks/view7.mjs +0 -48
  231. package/dist/chunks/view8.mjs +0 -61
  232. package/dist/chunks/view9.mjs +0 -48
  233. package/dist/shared/bee.084B_7FC.mjs +0 -27
  234. package/dist/shared/bee.BTBGpv4K.mjs +0 -34
  235. package/dist/shared/bee.BXiuAfjJ.mjs +0 -10
  236. package/dist/shared/bee.Btmq3TXs.mjs +0 -19
  237. package/dist/shared/bee.C--ZWPxf.mjs +0 -14
  238. package/dist/shared/bee.C4p7W8_P.mjs +0 -18
  239. package/dist/shared/bee.CAARNIp6.mjs +0 -49
  240. package/dist/shared/bee.CirccSk2.mjs +0 -51
  241. package/dist/shared/bee.CktwmH8R.mjs +0 -25
  242. package/dist/shared/bee.CzKcWSES.mjs +0 -42
  243. package/dist/shared/bee.DFnSWb6q.mjs +0 -396
  244. package/dist/shared/bee.DoTvz3uW.mjs +0 -13
  245. package/dist/shared/bee.KteAW2rM.mjs +0 -73
  246. package/dist/shared/bee.RsR9yniy.mjs +0 -131
  247. package/dist/shared/bee.a05kNWpn.mjs +0 -32
  248. package/dist/shared/bee.n5MYN4a6.mjs +0 -12
  249. package/dist/shared/bee.q93n012-.mjs +0 -14
@@ -1,50 +0,0 @@
1
- import consola from 'consola';
2
- import { R as ResolutionId, I as IssueStatusId } from '../shared/bee.Btmq3TXs.mjs';
3
- import { o as outputResult } from '../shared/bee.BTBGpv4K.mjs';
4
- import 'node:stream/consumers';
5
- import 'valibot';
6
- import { p as parseArg, v as vInteger } from '../index.mjs';
7
- import { g as getClient } from '../shared/bee.RsR9yniy.mjs';
8
- import 'backlog-js';
9
- import 'node:http';
10
- import 'open';
11
- import 'node:child_process';
12
- import { B as BeeCommand, E as ENV_AUTH } from '../shared/bee.KteAW2rM.mjs';
13
- import { x as notify, j as json, s as space } from '../shared/bee.CHtg3F43.mjs';
14
- import 'node:fs';
15
- import 'node:path';
16
- import 'node:os';
17
- import 'node:module';
18
- import 'commander';
19
- import 'consola/utils';
20
- import '../shared/bee.CktwmH8R.mjs';
21
- import '../shared/bee.CAARNIp6.mjs';
22
-
23
- const close = new BeeCommand("close").summary("Close an issue").description(
24
- `Sets the status to Closed with resolution \`Fixed\` by default. Use \`--resolution\` for a different resolution.`
25
- ).argument("<issue>", "Issue ID or issue key").option("-c, --comment <text>", "Comment to add when closing").option("--resolution <name>", `Resolution`).addOption(notify()).addOption(json()).addOption(space()).envVars([...ENV_AUTH]).examples([
26
- { description: "Close an issue", command: "bee issue close PROJECT-123" },
27
- {
28
- description: "Close with a comment",
29
- command: 'bee issue close PROJECT-123 -c "Done"'
30
- },
31
- {
32
- description: "Close as duplicate",
33
- command: "bee issue close PROJECT-123 --resolution duplicate"
34
- }
35
- ]).action(async (issue, opts) => {
36
- const { client } = await getClient(opts.space);
37
- const resolutionId = opts.resolution ? ResolutionId[opts.resolution] ?? parseArg(vInteger, opts.resolution, "--resolution") : ResolutionId.fixed;
38
- const notifiedUserId = opts.notify ?? [];
39
- const issueData = await client.patchIssue(issue, {
40
- statusId: IssueStatusId.Closed,
41
- resolutionId,
42
- comment: opts.comment,
43
- notifiedUserId
44
- });
45
- outputResult(issueData, opts, (data) => {
46
- consola.success(`Closed issue ${data.issueKey}: ${data.summary}`);
47
- });
48
- });
49
-
50
- export { close as default };
@@ -1,125 +0,0 @@
1
- import consola from 'consola';
2
- import { o as outputResult } from '../shared/bee.BTBGpv4K.mjs';
3
- import { x as notify, y as attachment, j as json, s as space, e as confirmOrExit } from '../shared/bee.CHtg3F43.mjs';
4
- import { a as resolveStdinArg } from '../shared/bee.C--ZWPxf.mjs';
5
- import 'valibot';
6
- import '../index.mjs';
7
- import { f as formatDate } from '../shared/bee.n5MYN4a6.mjs';
8
- import { p as printTable } from '../shared/bee.a05kNWpn.mjs';
9
- import { g as getClient } from '../shared/bee.RsR9yniy.mjs';
10
- import 'backlog-js';
11
- import 'node:http';
12
- import 'open';
13
- import 'node:child_process';
14
- import { B as BeeCommand, E as ENV_AUTH } from '../shared/bee.KteAW2rM.mjs';
15
- import 'node:fs';
16
- import 'node:path';
17
- import 'node:os';
18
- import 'node:stream/consumers';
19
- import 'commander';
20
- import 'node:module';
21
- import 'consola/utils';
22
- import '../shared/bee.DFnSWb6q.mjs';
23
- import '../shared/bee.CktwmH8R.mjs';
24
- import '../shared/bee.CAARNIp6.mjs';
25
-
26
- const comment = new BeeCommand("comment").summary("Add a comment to an issue").description(
27
- `When input is piped, it is used as the body automatically.
28
-
29
- Use \`--list\`, \`--edit-last\`, or \`--delete-last\` for other comment operations.`
30
- ).argument("<issue>", "Issue ID or issue key").option("-b, --body <text>", "Comment body").addOption(notify()).addOption(attachment()).option("--list", "List comments on the issue").option("--edit-last", "Edit your most recent comment").option("--delete-last", "Delete your most recent comment").addOption(json()).addOption(space()).envVars([...ENV_AUTH]).examples([
31
- {
32
- description: "Add a comment",
33
- command: 'bee issue comment PROJECT-123 -b "This is a comment"'
34
- },
35
- {
36
- description: "Add a comment from stdin",
37
- command: 'echo "Comment body" | bee issue comment PROJECT-123'
38
- },
39
- { description: "List all comments", command: "bee issue comment PROJECT-123 --list" },
40
- {
41
- description: "Edit your last comment",
42
- command: 'bee issue comment PROJECT-123 --edit-last -b "Updated text"'
43
- },
44
- {
45
- description: "Delete your last comment",
46
- command: "bee issue comment PROJECT-123 --delete-last --yes"
47
- }
48
- ]).action(async (issue, opts) => {
49
- const { client } = await getClient(opts.space);
50
- if (opts.list) {
51
- const comments = await client.getIssueComments(issue, { order: "asc" });
52
- outputResult(comments, opts, (data) => {
53
- const filtered = data.filter((c) => c.content);
54
- if (filtered.length === 0) {
55
- consola.info("No comments found.");
56
- return;
57
- }
58
- const rows = filtered.map((c) => [
59
- { header: "ID", value: String(c.id) },
60
- { header: "AUTHOR", value: c.createdUser.name },
61
- { header: "DATE", value: formatDate(c.created) },
62
- { header: "CONTENT", value: c.content }
63
- ]);
64
- printTable(rows);
65
- });
66
- return;
67
- }
68
- if (opts.editLast) {
69
- const myself = await client.getMyself();
70
- const comments = await client.getIssueComments(issue, { order: "desc" });
71
- const myComment = comments.find((c) => c.createdUser.id === myself.id);
72
- if (!myComment) {
73
- consola.error(`No comment by you was found on ${issue}.`);
74
- return;
75
- }
76
- const content2 = await resolveStdinArg(opts.body) ?? opts.body;
77
- if (!content2) {
78
- consola.error("Comment body is required. Use --body or pipe input.");
79
- return;
80
- }
81
- const result2 = await client.patchIssueComment(issue, myComment.id, { content: content2 });
82
- outputResult(result2, opts, () => {
83
- consola.success(`Updated comment on ${issue}`);
84
- });
85
- return;
86
- }
87
- if (opts.deleteLast) {
88
- const myself = await client.getMyself();
89
- const comments = await client.getIssueComments(issue, { order: "desc" });
90
- const myComment = comments.find((c) => c.createdUser.id === myself.id);
91
- if (!myComment) {
92
- consola.error(`No comment by you was found on ${issue}.`);
93
- return;
94
- }
95
- const confirmed = await confirmOrExit(
96
- `Are you sure you want to delete your comment on ${issue}?`,
97
- opts.yes
98
- );
99
- if (!confirmed) {
100
- return;
101
- }
102
- const result2 = await client.deleteIssueComment(issue, myComment.id);
103
- outputResult(result2, opts, () => {
104
- consola.success(`Deleted comment on ${issue}`);
105
- });
106
- return;
107
- }
108
- const content = await resolveStdinArg(opts.body) ?? opts.body;
109
- if (!content) {
110
- consola.error("Comment body is required. Use --body or pipe input.");
111
- return;
112
- }
113
- const notifiedUserId = opts.notify ?? [];
114
- const attachmentId = opts.attachment ?? [];
115
- const result = await client.postIssueComments(issue, {
116
- content,
117
- notifiedUserId,
118
- attachmentId
119
- });
120
- outputResult(result, opts, () => {
121
- consola.success(`Added comment to ${issue}`);
122
- });
123
- });
124
-
125
- export { comment as default };
@@ -1,111 +0,0 @@
1
- import consola from 'consola';
2
- import { o as outputResult } from '../shared/bee.BTBGpv4K.mjs';
3
- import { a as resolveStdinArg } from '../shared/bee.C--ZWPxf.mjs';
4
- import 'valibot';
5
- import { p as parseArg, v as vInteger } from '../index.mjs';
6
- import { f as formatDate } from '../shared/bee.n5MYN4a6.mjs';
7
- import { p as printTable } from '../shared/bee.a05kNWpn.mjs';
8
- import { g as getClient } from '../shared/bee.RsR9yniy.mjs';
9
- import 'backlog-js';
10
- import 'node:http';
11
- import 'open';
12
- import 'node:child_process';
13
- import { B as BeeCommand, E as ENV_AUTH, a as ENV_PROJECT, b as ENV_REPO } from '../shared/bee.KteAW2rM.mjs';
14
- import { d as project, C as repo, x as notify, j as json, s as space, r as resolveOptions } from '../shared/bee.CHtg3F43.mjs';
15
- import 'node:stream/consumers';
16
- import 'node:fs';
17
- import 'node:path';
18
- import 'node:os';
19
- import 'node:module';
20
- import 'commander';
21
- import 'consola/utils';
22
- import '../shared/bee.DFnSWb6q.mjs';
23
- import '../shared/bee.CktwmH8R.mjs';
24
- import '../shared/bee.CAARNIp6.mjs';
25
-
26
- const comment = new BeeCommand("comment").summary("Add a comment to a pull request").description(
27
- `When input is piped, it is used as the body automatically.
28
-
29
- Use \`--list\` or \`--edit-last\` for other comment operations.`
30
- ).argument("<number>", "Pull request number").addOption(project()).addOption(repo()).option("-b, --body <text>", "Comment body").addOption(notify()).option("--list", "List comments on the pull request").option("--edit-last", "Edit your most recent comment").addOption(json()).addOption(space()).envVars([...ENV_AUTH, ENV_PROJECT, ENV_REPO]).examples([
31
- {
32
- description: "Add a comment",
33
- command: 'bee pr comment 42 -p PROJECT -R repo -b "Looks good!"'
34
- },
35
- {
36
- description: "Add a comment from stdin",
37
- command: 'echo "Comment body" | bee pr comment 42 -p PROJECT -R repo'
38
- },
39
- { description: "List all comments", command: "bee pr comment 42 -p PROJECT -R repo --list" },
40
- {
41
- description: "Edit your last comment",
42
- command: 'bee pr comment 42 -p PROJECT -R repo --edit-last -b "Updated"'
43
- }
44
- ]).action(async (number, opts, cmd) => {
45
- await resolveOptions(cmd);
46
- const { client } = await getClient(opts.space);
47
- const prNumber = parseArg(vInteger, number, "number");
48
- const json = opts.json === true ? "" : opts.json;
49
- if (opts.list) {
50
- const comments = await client.getPullRequestComments(opts.project, opts.repo, prNumber, {
51
- order: "asc"
52
- });
53
- outputResult(comments, { json }, (data) => {
54
- const filtered = data.filter((c) => c.content);
55
- if (filtered.length === 0) {
56
- consola.info("No comments found.");
57
- return;
58
- }
59
- const rows = filtered.map((c) => [
60
- { header: "ID", value: String(c.id) },
61
- { header: "AUTHOR", value: c.createdUser.name },
62
- { header: "DATE", value: formatDate(c.created) },
63
- { header: "CONTENT", value: c.content }
64
- ]);
65
- printTable(rows);
66
- });
67
- return;
68
- }
69
- if (opts.editLast) {
70
- const myself = await client.getMyself();
71
- const comments = await client.getPullRequestComments(opts.project, opts.repo, prNumber, {
72
- order: "desc"
73
- });
74
- const myComment = comments.find((c) => c.createdUser.id === myself.id);
75
- if (!myComment) {
76
- consola.error(`No comment by you was found on pull request #${number}.`);
77
- return;
78
- }
79
- const content2 = await resolveStdinArg(opts.body) ?? opts.body;
80
- if (!content2) {
81
- consola.error("Comment body is required. Use --body or pipe input.");
82
- return;
83
- }
84
- const result2 = await client.patchPullRequestComments(
85
- opts.project,
86
- opts.repo,
87
- prNumber,
88
- myComment.id,
89
- { content: content2 }
90
- );
91
- outputResult(result2, { json }, () => {
92
- consola.success(`Updated comment on pull request #${number}`);
93
- });
94
- return;
95
- }
96
- const content = await resolveStdinArg(opts.body) ?? opts.body;
97
- if (!content) {
98
- consola.error("Comment body is required. Use --body or pipe input.");
99
- return;
100
- }
101
- const notifiedUserId = opts.notify ?? [];
102
- const result = await client.postPullRequestComments(opts.project, opts.repo, prNumber, {
103
- content,
104
- notifiedUserId
105
- });
106
- outputResult(result, { json }, () => {
107
- consola.success(`Added comment to pull request #${number}`);
108
- });
109
- });
110
-
111
- export { comment as default };
@@ -1,57 +0,0 @@
1
- import consola from 'consola';
2
- import { o as outputResult } from '../shared/bee.BTBGpv4K.mjs';
3
- import 'node:stream/consumers';
4
- import * as v from 'valibot';
5
- import { p as parseArg, v as vInteger } from '../index.mjs';
6
- import { f as formatDate } from '../shared/bee.n5MYN4a6.mjs';
7
- import { g as getClient } from '../shared/bee.RsR9yniy.mjs';
8
- import 'backlog-js';
9
- import 'node:http';
10
- import 'open';
11
- import 'node:child_process';
12
- import { B as BeeCommand, E as ENV_AUTH, a as ENV_PROJECT, b as ENV_REPO } from '../shared/bee.KteAW2rM.mjs';
13
- import { d as project, C as repo, A as minId, B as maxId, g as count, o as order, j as json, s as space, r as resolveOptions } from '../shared/bee.CHtg3F43.mjs';
14
- import 'node:fs';
15
- import 'node:path';
16
- import 'node:os';
17
- import 'node:module';
18
- import 'commander';
19
- import 'consola/utils';
20
- import '../shared/bee.CktwmH8R.mjs';
21
- import '../shared/bee.CAARNIp6.mjs';
22
-
23
- const comments = new BeeCommand("comments").summary("List comments on a pull request").description(`Displays all comments in chronological order.`).argument("<number>", "Pull request number").addOption(project()).addOption(repo()).addOption(minId()).addOption(maxId()).addOption(count()).addOption(order()).addOption(json()).addOption(space()).envVars([...ENV_AUTH, ENV_PROJECT, ENV_REPO]).examples([
24
- {
25
- description: "List pull request comments",
26
- command: "bee pr comments 42 -p PROJECT -R repo"
27
- },
28
- { description: "Output as JSON", command: "bee pr comments 42 -p PROJECT -R repo --json" }
29
- ]).action(async (number, opts, cmd) => {
30
- await resolveOptions(cmd);
31
- const { client } = await getClient(opts.space);
32
- const prNumber = parseArg(vInteger, number, "number");
33
- const prComments = await client.getPullRequestComments(opts.project, opts.repo, prNumber, {
34
- minId: parseArg(v.optional(vInteger), opts.minId, "--min-id"),
35
- maxId: parseArg(v.optional(vInteger), opts.maxId, "--max-id"),
36
- order: opts.order ?? "asc",
37
- count: parseArg(v.optional(vInteger), opts.count, "--count")
38
- });
39
- const json = opts.json === true ? "" : opts.json;
40
- outputResult(prComments, { json }, (data) => {
41
- const contentComments = data.filter((c) => c.content);
42
- if (contentComments.length === 0) {
43
- consola.info("No comments found.");
44
- return;
45
- }
46
- consola.log("");
47
- for (const comment of contentComments) {
48
- consola.log(` ${comment.createdUser.name} (${formatDate(comment.created)}):`);
49
- consola.log(
50
- comment.content.split("\n").map((line) => ` ${line}`).join("\n")
51
- );
52
- consola.log("");
53
- }
54
- });
55
- });
56
-
57
- export { comments as default };
@@ -1,113 +0,0 @@
1
- import 'consola';
2
- import { U as UserError } from '../index.mjs';
3
- import 'node:stream/consumers';
4
- import 'valibot';
5
- import { B as BeeCommand } from '../shared/bee.KteAW2rM.mjs';
6
- import 'backlog-js';
7
- import 'node:fs';
8
- import 'node:path';
9
- import 'node:os';
10
- import 'node:http';
11
- import 'open';
12
- import 'node:child_process';
13
- import 'node:module';
14
- import 'commander';
15
- import 'consola/utils';
16
-
17
- const isListable = (cmd) => cmd.name() !== "help";
18
- const toEntry = (cmd) => ({
19
- name: cmd.name(),
20
- summary: cmd.summary() || cmd.description()
21
- });
22
- const commandEntries = (program) => program.commands.filter(isListable).map(toEntry);
23
- const escapeZsh = (text) => text.replaceAll(":", String.raw`\:`);
24
- const escapeDoubleQuoted = (text) => text.replaceAll(/(["$`\\])/g, String.raw`\$1`);
25
- const renderBash = (entries) => `# bash completion for bee
26
- # Add to ~/.bashrc:
27
- # eval "$(bee completion bash)"
28
-
29
- _bee_completions() {
30
- local cur="\${COMP_WORDS[COMP_CWORD]}"
31
- local commands="${entries.map((entry) => entry.name).join(" ")}"
32
-
33
- if [ "\${COMP_CWORD}" -eq 1 ]; then
34
- COMPREPLY=( $(compgen -W "\${commands}" -- "\${cur}") )
35
- fi
36
- }
37
-
38
- complete -F _bee_completions bee
39
- `;
40
- const renderZsh = (entries) => {
41
- const pairs = entries.map((entry) => ` '${escapeZsh(entry.name)}:${escapeZsh(entry.summary)}'`).join(" \\\n");
42
- return `#compdef bee
43
- # zsh completion for bee
44
- # Add to ~/.zshrc:
45
- # eval "$(bee completion zsh)"
46
-
47
- _bee() {
48
- local -a commands
49
- commands=(
50
- ${pairs}
51
- )
52
-
53
- _arguments '1: :->command' '*:: :->args'
54
-
55
- case $state in
56
- command)
57
- _describe 'command' commands
58
- ;;
59
- esac
60
- }
61
-
62
- compdef _bee bee
63
- `;
64
- };
65
- const renderFish = (entries) => {
66
- const lines = entries.map(
67
- (entry) => `complete -c bee -n "__fish_use_subcommand" -a "${entry.name}" -d "${escapeDoubleQuoted(entry.summary)}"`
68
- ).join("\n");
69
- return `# fish completion for bee
70
- # Add to ~/.config/fish/completions/bee.fish:
71
- # bee completion fish > ~/.config/fish/completions/bee.fish
72
-
73
- complete -c bee -e
74
- ${lines}
75
- `;
76
- };
77
- const RENDERERS = Object.assign(
78
- /* @__PURE__ */ Object.create(null),
79
- { bash: renderBash, zsh: renderZsh, fish: renderFish }
80
- );
81
- const SUPPORTED_SHELLS = Object.keys(RENDERERS);
82
- const isSupportedShell = (shell) => shell in RENDERERS;
83
- const renderCompletionScript = (shell, program) => RENDERERS[shell](commandEntries(program));
84
-
85
- const buildProgram = async () => {
86
- const { loadCommands } = await import('../index.mjs').then(function (n) { return n.r; });
87
- const program = new BeeCommand("bee");
88
- await program.addCommands(loadCommands());
89
- return program;
90
- };
91
- const completion = new BeeCommand("completion").summary("Generate shell completion scripts").description(`Supported shells: bash, zsh, fish. Source the output in your shell configuration.`).argument("<shell>", "Shell to generate completions for").examples([
92
- {
93
- description: "Set up completions for bash (add to ~/.bashrc)",
94
- command: `echo 'eval "$(bee completion bash)"' >> ~/.bashrc`
95
- },
96
- {
97
- description: "Set up completions for zsh (add to ~/.zshrc)",
98
- command: `echo 'eval "$(bee completion zsh)"' >> ~/.zshrc`
99
- },
100
- {
101
- description: "Set up completions for fish",
102
- command: "bee completion fish > ~/.config/fish/completions/bee.fish"
103
- }
104
- ]).action(async (shell) => {
105
- if (!isSupportedShell(shell)) {
106
- throw new UserError(
107
- `Unsupported shell: "${shell}". Supported shells: ${SUPPORTED_SHELLS.join(", ")}.`
108
- );
109
- }
110
- process.stdout.write(renderCompletionScript(shell, await buildProgram()));
111
- });
112
-
113
- export { completion as default };
@@ -1,68 +0,0 @@
1
- import consola from 'consola';
2
- import { P as PriorityId, a as PRIORITY_NAMES } from '../shared/bee.Btmq3TXs.mjs';
3
- import { r as resolveProjectIds } from '../shared/bee.084B_7FC.mjs';
4
- import { r as resolveUserId } from '../shared/bee.q93n012-.mjs';
5
- import { g as getClient } from '../shared/bee.RsR9yniy.mjs';
6
- import 'backlog-js';
7
- import 'node:http';
8
- import 'open';
9
- import 'node:child_process';
10
- import '../index.mjs';
11
- import { o as outputResult } from '../shared/bee.BTBGpv4K.mjs';
12
- import 'node:stream/consumers';
13
- import 'valibot';
14
- import { B as BeeCommand, E as ENV_AUTH, a as ENV_PROJECT } from '../shared/bee.KteAW2rM.mjs';
15
- import { p as projectOptional, h as assigneeList, f as collectNum, c as collect, k as keyword, j as json, s as space } from '../shared/bee.CHtg3F43.mjs';
16
- import '../shared/bee.CktwmH8R.mjs';
17
- import '../shared/bee.CAARNIp6.mjs';
18
- import 'node:fs';
19
- import 'node:path';
20
- import 'node:os';
21
- import 'node:module';
22
- import 'commander';
23
- import 'consola/utils';
24
-
25
- const resolvePriorityIds = (priorities) => priorities.map((name) => {
26
- const id = PriorityId[name.toLowerCase()];
27
- if (id === void 0) {
28
- throw new Error(`Unknown priority "${name}". Valid values: ${PRIORITY_NAMES.join(", ")}`);
29
- }
30
- return id;
31
- });
32
- const count = new BeeCommand("count").summary("Count issues").description(`Accepts the same filter flags as \`bee issue list\`.`).addOption(projectOptional("Project ID or project key (comma-separated for multiple)")).addOption(assigneeList()).option("-S, --status <id>", "Status ID (repeatable)", collectNum, []).option("-P, --priority <name>", "Priority name (repeatable)", collect, []).addOption(keyword()).option("--created-since <date>", "Show issues created on or after this date").option("--created-until <date>", "Show issues created on or before this date").option("--updated-since <date>", "Show issues updated on or after this date").option("--updated-until <date>", "Show issues updated on or before this date").option("--due-since <date>", "Show issues due on or after this date").option("--due-until <date>", "Show issues due on or before this date").addOption(json()).addOption(space()).envVars([...ENV_AUTH, ENV_PROJECT]).examples([
33
- { description: "Count all issues in a project", command: "bee issue count -p PROJECT" },
34
- {
35
- description: "Count open bugs assigned to you",
36
- command: 'bee issue count -p PROJECT -a @me -k "bug"'
37
- },
38
- { description: "Output as JSON", command: "bee issue count -p PROJECT --json" }
39
- ]).action(async (opts) => {
40
- const { client } = await getClient(opts.space);
41
- const projectId = opts.project ? await resolveProjectIds(
42
- client,
43
- opts.project.split(",").map((s) => s.trim()).filter(Boolean)
44
- ) : [];
45
- const assigneeId = await Promise.all(
46
- (opts.assignee ?? []).map((id) => resolveUserId(client, id))
47
- );
48
- const statusId = opts.status;
49
- const priorityId = opts.priority.length > 0 ? resolvePriorityIds(opts.priority) : [];
50
- const result = await client.getIssuesCount({
51
- projectId,
52
- assigneeId,
53
- statusId,
54
- priorityId,
55
- keyword: opts.keyword,
56
- createdSince: opts.createdSince,
57
- createdUntil: opts.createdUntil,
58
- updatedSince: opts.updatedSince,
59
- updatedUntil: opts.updatedUntil,
60
- dueDateSince: opts.dueSince,
61
- dueDateUntil: opts.dueUntil
62
- });
63
- outputResult(result, { json: opts.json }, (data) => {
64
- consola.log(data.count);
65
- });
66
- });
67
-
68
- export { count as default };
@@ -1,69 +0,0 @@
1
- import consola from 'consola';
2
- import { o as outputResult } from '../shared/bee.BTBGpv4K.mjs';
3
- import 'node:stream/consumers';
4
- import 'valibot';
5
- import '../index.mjs';
6
- import { g as getClient } from '../shared/bee.RsR9yniy.mjs';
7
- import 'backlog-js';
8
- import 'node:http';
9
- import 'open';
10
- import 'node:child_process';
11
- import { B as BeeCommand, E as ENV_AUTH } from '../shared/bee.KteAW2rM.mjs';
12
- import { j as json, s as space } from '../shared/bee.CHtg3F43.mjs';
13
- import 'node:fs';
14
- import 'node:path';
15
- import 'node:os';
16
- import 'node:module';
17
- import 'commander';
18
- import 'consola/utils';
19
- import '../shared/bee.CktwmH8R.mjs';
20
- import '../shared/bee.CAARNIp6.mjs';
21
-
22
- const parseReadFilter = (value) => {
23
- if (value === void 0 || value === "all") {
24
- return void 0;
25
- }
26
- return value === "read";
27
- };
28
- const count = new BeeCommand("count").summary("Count notifications").description(
29
- `By default, counts all notifications regardless of read status.
30
-
31
- For details, see:
32
- https://developer.nulab.com/docs/backlog/api/2/count-notification/`
33
- ).option(
34
- "--already-read <value>",
35
- "Filter by read status. If omitted, count all. {read|unread|all}"
36
- ).option(
37
- "--resource-already-read <value>",
38
- "Filter by resource read status. If omitted, count all. {read|unread|all}"
39
- ).addOption(json()).addOption(space()).envVars([...ENV_AUTH]).examples([
40
- { description: "Count all notifications", command: "bee notification count" },
41
- {
42
- description: "Count only unread notifications",
43
- command: "bee notification count --already-read unread"
44
- },
45
- {
46
- description: "Count only read notifications",
47
- command: "bee notification count --already-read read"
48
- },
49
- { description: "Output as JSON", command: "bee notification count --json" }
50
- ]).action(async (opts) => {
51
- const { client } = await getClient(opts.space);
52
- const alreadyRead = parseReadFilter(opts.alreadyRead);
53
- const resourceAlreadyRead = parseReadFilter(opts.resourceAlreadyRead);
54
- const params = {};
55
- if (alreadyRead !== void 0) {
56
- params.alreadyRead = alreadyRead;
57
- }
58
- if (resourceAlreadyRead !== void 0) {
59
- params.resourceAlreadyRead = resourceAlreadyRead;
60
- }
61
- const result = await client.getNotificationsCount(
62
- params
63
- );
64
- outputResult(result, opts, (data) => {
65
- consola.log(String(data.count));
66
- });
67
- });
68
-
69
- export { count as default };
@@ -1,59 +0,0 @@
1
- import consola from 'consola';
2
- import { P as PrStatusName, a as PR_STATUS_NAMES } from '../shared/bee.DoTvz3uW.mjs';
3
- import { o as outputResult } from '../shared/bee.BTBGpv4K.mjs';
4
- import 'node:stream/consumers';
5
- import 'valibot';
6
- import '../index.mjs';
7
- import { r as resolveUserId } from '../shared/bee.q93n012-.mjs';
8
- import { g as getClient } from '../shared/bee.RsR9yniy.mjs';
9
- import 'backlog-js';
10
- import 'node:http';
11
- import 'open';
12
- import 'node:child_process';
13
- import { B as BeeCommand, E as ENV_AUTH, a as ENV_PROJECT, b as ENV_REPO } from '../shared/bee.KteAW2rM.mjs';
14
- import { d as project, C as repo, c as collect, h as assigneeList, f as collectNum, j as json, s as space, r as resolveOptions } from '../shared/bee.CHtg3F43.mjs';
15
- import 'node:fs';
16
- import 'node:path';
17
- import 'node:os';
18
- import 'node:module';
19
- import 'commander';
20
- import 'consola/utils';
21
- import '../shared/bee.CktwmH8R.mjs';
22
- import '../shared/bee.CAARNIp6.mjs';
23
-
24
- const resolveStatusIds = (statuses) => statuses.map((name) => {
25
- const id = PrStatusName[name.toLowerCase()];
26
- if (id === void 0) {
27
- throw new Error(`Unknown status "${name}". Valid values: ${PR_STATUS_NAMES.join(", ")}`);
28
- }
29
- return id;
30
- });
31
- const count = new BeeCommand("count").summary("Count pull requests").description(`Accepts the same filter flags as \`bee pr list\`.`).addOption(project()).addOption(repo()).option("-S, --status <name>", "Status name (repeatable)", collect, []).addOption(assigneeList()).option("--issue <id>", "Issue ID (repeatable)", collectNum, []).option("--created-user <id>", "Created user ID (repeatable)", collectNum, []).addOption(json()).addOption(space()).envVars([...ENV_AUTH, ENV_PROJECT, ENV_REPO]).examples([
32
- { description: "Count all pull requests", command: "bee pr count -p PROJECT -R repo" },
33
- {
34
- description: "Count open pull requests",
35
- command: "bee pr count -p PROJECT -R repo --status open"
36
- },
37
- { description: "Output as JSON", command: "bee pr count -p PROJECT -R repo --json" }
38
- ]).action(async (opts, cmd) => {
39
- await resolveOptions(cmd);
40
- const { client } = await getClient(opts.space);
41
- const statusId = opts.status.length > 0 ? resolveStatusIds(opts.status) : void 0;
42
- const assigneeId = await Promise.all(
43
- (opts.assignee ?? []).map((id) => resolveUserId(client, id))
44
- );
45
- const issueId = opts.issue;
46
- const createdUserId = opts.createdUser;
47
- const result = await client.getPullRequestsCount(opts.project, opts.repo, {
48
- statusId,
49
- assigneeId: assigneeId.length > 0 ? assigneeId : void 0,
50
- issueId: issueId.length > 0 ? issueId : void 0,
51
- createdUserId: createdUserId.length > 0 ? createdUserId : void 0
52
- });
53
- const json = opts.json === true ? "" : opts.json;
54
- outputResult(result, { json }, (data) => {
55
- consola.log(data.count);
56
- });
57
- });
58
-
59
- export { count as default };