@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
@@ -0,0 +1,11 @@
1
+ import { t as BeeCommand } from "./bee-command-v0qvZeth.mjs";
2
+ //#region src/commands/star/index.ts
3
+ const star = new BeeCommand("star").summary("Manage stars");
4
+ await star.addCommands([
5
+ import("./add-Br-_TLRp.mjs"),
6
+ import("./list-D3FkO9gb.mjs"),
7
+ import("./count-Bw0mVlxC.mjs"),
8
+ import("./remove-BSDJvkVJ.mjs")
9
+ ]);
10
+ //#endregion
11
+ export { star as default };
@@ -0,0 +1,53 @@
1
+ import { y as getClient } from "./src-CTD9-bSB.mjs";
2
+ import { t as outputResult } from "./output-DBvfyU1J.mjs";
3
+ import "./src-CP4YLIAh.mjs";
4
+ import { n as ENV_AUTH, t as BeeCommand } from "./bee-command-v0qvZeth.mjs";
5
+ import { S as space, u as json } from "./common-options-BuYWxYdO.mjs";
6
+ import consola from "consola";
7
+ import { getIssues, getMyself } from "backlog-js";
8
+ //#region src/commands/issue/status.ts
9
+ const status = new BeeCommand("status").summary("Show issue status summary for yourself").description(`Displays your assigned issues grouped by status (e.g., Open, In Progress, Resolved).`).addOption(json()).addOption(space()).envVars([...ENV_AUTH]).examples([{
10
+ description: "Show your issue status summary",
11
+ command: "bee issue status"
12
+ }, {
13
+ description: "Output as JSON",
14
+ command: "bee issue status --json"
15
+ }]).action(async (opts) => {
16
+ const { client } = await getClient(opts.space);
17
+ const me = await getMyself(client);
18
+ const issues = await getIssues(client, {
19
+ assigneeId: [me.id],
20
+ count: 100
21
+ });
22
+ if (issues.length === 0) {
23
+ outputResult({
24
+ user: me,
25
+ issues: []
26
+ }, opts, () => {
27
+ consola.info("No issues assigned to you.");
28
+ });
29
+ return;
30
+ }
31
+ outputResult({
32
+ user: me,
33
+ issues
34
+ }, opts, (data) => {
35
+ const grouped = /* @__PURE__ */ new Map();
36
+ for (const issue of data.issues) {
37
+ const { name } = issue.status;
38
+ const group = grouped.get(name) ?? [];
39
+ group.push(issue);
40
+ grouped.set(name, group);
41
+ }
42
+ consola.log("");
43
+ consola.log(` Issues assigned to ${data.user.name}:`);
44
+ consola.log("");
45
+ for (const [statusName, statusIssues] of grouped) {
46
+ consola.log(` ${statusName} (${statusIssues.length}):`);
47
+ for (const issue of statusIssues) consola.log(` ${issue.issueKey} ${issue.summary}`);
48
+ consola.log("");
49
+ }
50
+ });
51
+ });
52
+ //#endregion
53
+ export { status as default };
@@ -0,0 +1,64 @@
1
+ import { T as PrStatusId, y as getClient } from "./src-CTD9-bSB.mjs";
2
+ import { t as outputResult } from "./output-DBvfyU1J.mjs";
3
+ import "./src-CP4YLIAh.mjs";
4
+ import { i as ENV_REPO, n as ENV_AUTH, r as ENV_PROJECT, t as BeeCommand } from "./bee-command-v0qvZeth.mjs";
5
+ import { E as resolveOptions, S as space, u as json, x as repo, y as project } from "./common-options-BuYWxYdO.mjs";
6
+ import consola from "consola";
7
+ import { getMyself, getPullRequests } from "backlog-js";
8
+ //#region src/commands/pr/status.ts
9
+ const status = new BeeCommand("status").summary("Show pull request status summary for yourself").description(`Displays your assigned pull requests grouped by status (Open, Closed, Merged).`).addOption(project()).addOption(repo()).addOption(json()).addOption(space()).envVars([
10
+ ...ENV_AUTH,
11
+ ENV_PROJECT,
12
+ ENV_REPO
13
+ ]).examples([{
14
+ description: "Show your pull request status summary",
15
+ command: "bee pr status -p PROJECT -R repo"
16
+ }, {
17
+ description: "Output as JSON",
18
+ command: "bee pr status -p PROJECT -R repo --json"
19
+ }]).action(async (opts, cmd) => {
20
+ await resolveOptions(cmd);
21
+ const { client } = await getClient(opts.space);
22
+ const me = await getMyself(client);
23
+ const pullRequests = await getPullRequests(client, opts.project, opts.repo, {
24
+ assigneeId: [me.id],
25
+ statusId: [
26
+ PrStatusId.Open,
27
+ PrStatusId.Closed,
28
+ PrStatusId.Merged
29
+ ],
30
+ count: 100
31
+ });
32
+ const json = opts.json === true ? "" : opts.json;
33
+ if (pullRequests.length === 0) {
34
+ outputResult({
35
+ user: me,
36
+ pullRequests: []
37
+ }, { json }, () => {
38
+ consola.info("No pull requests assigned to you.");
39
+ });
40
+ return;
41
+ }
42
+ outputResult({
43
+ user: me,
44
+ pullRequests
45
+ }, { json }, (data) => {
46
+ const grouped = /* @__PURE__ */ new Map();
47
+ for (const pr of data.pullRequests) {
48
+ const { name } = pr.status;
49
+ const group = grouped.get(name) ?? [];
50
+ group.push(pr);
51
+ grouped.set(name, group);
52
+ }
53
+ consola.log("");
54
+ consola.log(` Pull requests assigned to ${data.user.name}:`);
55
+ consola.log("");
56
+ for (const [statusName, statusPrs] of grouped) {
57
+ consola.log(` ${statusName} (${statusPrs.length}):`);
58
+ for (const pr of statusPrs) consola.log(` #${pr.number} ${pr.summary}`);
59
+ consola.log("");
60
+ }
61
+ });
62
+ });
63
+ //#endregion
64
+ export { status as default };
@@ -0,0 +1,11 @@
1
+ import { t as BeeCommand } from "./bee-command-v0qvZeth.mjs";
2
+ //#region src/commands/status/index.ts
3
+ const status = new BeeCommand("status").summary("Manage project statuses");
4
+ await status.addCommands([
5
+ import("./list-y93EXyDj.mjs"),
6
+ import("./create-BtLVFmbR.mjs"),
7
+ import("./edit-D5Z45NVj.mjs"),
8
+ import("./delete-HMOfvtv3.mjs")
9
+ ]);
10
+ //#endregion
11
+ export { status as default };
@@ -0,0 +1,58 @@
1
+ import { n as printDefinitionList } from "./src-CP4YLIAh.mjs";
2
+ import { a as loadConfig } from "./src-BWaxjrq_.mjs";
3
+ import { t as BeeCommand } from "./bee-command-v0qvZeth.mjs";
4
+ import { S as space } from "./common-options-BuYWxYdO.mjs";
5
+ import consola from "consola";
6
+ import { createClient, getMyself } from "backlog-js";
7
+ //#region src/commands/auth/status.ts
8
+ const getToken = (auth) => auth.method === "api-key" ? auth.apiKey : auth.accessToken;
9
+ const status = new BeeCommand("status").summary("Show authentication status").description(`Verifies credential validity for each configured space via the Backlog API. The active (default) space is indicated.`).addOption(space()).option("--show-token", "Display the auth token").examples([
10
+ {
11
+ description: "Display status for all spaces",
12
+ command: "bee auth status"
13
+ },
14
+ {
15
+ description: "Check a specific space",
16
+ command: "bee auth status -s xxx.backlog.com"
17
+ },
18
+ {
19
+ description: "Show auth tokens in the output",
20
+ command: "bee auth status --show-token"
21
+ }
22
+ ]).action(async (opts) => {
23
+ const config = loadConfig();
24
+ const filterSpace = opts.space;
25
+ const spaces = filterSpace ? config.spaces.filter((s) => s.host === filterSpace) : config.spaces;
26
+ if (spaces.length === 0) {
27
+ if (filterSpace) consola.info(`No authentication configured for ${filterSpace}.`);
28
+ else consola.info("No spaces are authenticated. Run `bee auth login` to get started.");
29
+ return;
30
+ }
31
+ for (const space of spaces) {
32
+ const label = config.defaultSpace === space.host ? `${space.host} (default)` : space.host;
33
+ let user = null;
34
+ try {
35
+ const client = space.auth.method === "api-key" ? createClient({
36
+ host: space.host,
37
+ apiKey: space.auth.apiKey
38
+ }) : createClient({
39
+ host: space.host,
40
+ accessToken: space.auth.accessToken
41
+ });
42
+ user = await getMyself(client);
43
+ } catch (error) {
44
+ consola.debug("Token verification failed:", error);
45
+ }
46
+ consola.log("");
47
+ consola.log(` ${label}`);
48
+ printDefinitionList([
49
+ ["Method", space.auth.method],
50
+ ["User", user ? `${user.name} (${user.userId})` : void 0],
51
+ ["Status", user ? "Authenticated" : "Authentication failed"],
52
+ ["Token", opts.showToken ? getToken(space.auth) : void 0]
53
+ ]);
54
+ }
55
+ consola.log("");
56
+ });
57
+ //#endregion
58
+ export { status as default };
@@ -0,0 +1,17 @@
1
+ import { text } from "node:stream/consumers";
2
+ //#region ../../packages/cli-utils/src/stdin.ts
3
+ const readStdin = async () => {
4
+ return (await text(process.stdin)).trim();
5
+ };
6
+ /**
7
+ * Resolve a flag value that supports reading from stdin.
8
+ *
9
+ * Returns the stdin content when the flag value is falsy (empty or
10
+ * omitted) and stdin is piped. Otherwise returns the original value.
11
+ */
12
+ const resolveStdinArg = async (value) => {
13
+ if (!value && !process.stdin.isTTY) return readStdin();
14
+ return value;
15
+ };
16
+ //#endregion
17
+ export { resolveStdinArg as n, readStdin as t };
@@ -0,0 +1,34 @@
1
+ import { u as UserError } from "./src-CP4YLIAh.mjs";
2
+ import { a as loadConfig, s as writeConfig } from "./src-BWaxjrq_.mjs";
3
+ import { t as BeeCommand } from "./bee-command-v0qvZeth.mjs";
4
+ import { S as space } from "./common-options-BuYWxYdO.mjs";
5
+ import consola from "consola";
6
+ //#region src/commands/auth/switch.ts
7
+ const switchSpace = new BeeCommand("switch").summary("Switch active space").description(`Changes which space is used by default when \`--space\` is not provided.`).addOption(space()).examples([{
8
+ description: "Select space via prompt",
9
+ command: "bee auth switch"
10
+ }, {
11
+ description: "Switch to a specific space",
12
+ command: "bee auth switch -s xxx.backlog.com"
13
+ }]).action(async (opts) => {
14
+ const config = loadConfig();
15
+ let hostname = opts.space;
16
+ if (!hostname) {
17
+ if (config.spaces.length === 0) throw new UserError("No spaces configured. Run `bee auth login` to add a space.");
18
+ if (!process.stdin.isTTY) throw new UserError("Hostname is required. Use --space to provide it in non-interactive mode.");
19
+ const hosts = config.spaces.map((s) => s.host);
20
+ hostname = await consola.prompt("Select space:", {
21
+ type: "select",
22
+ options: hosts
23
+ });
24
+ if (typeof hostname !== "string" || !hostname) throw new UserError("No space selected.");
25
+ }
26
+ if (!config.spaces.find((s) => s.host === hostname)) throw new UserError(`Space "${hostname}" not found. Available spaces: ${config.spaces.map((s) => s.host).join(", ")}`);
27
+ writeConfig({
28
+ ...config,
29
+ defaultSpace: hostname
30
+ });
31
+ consola.success(`Switched active space to ${hostname}.`);
32
+ });
33
+ //#endregion
34
+ export { switchSpace as default };
@@ -0,0 +1,29 @@
1
+ import { y as getClient } from "./src-CTD9-bSB.mjs";
2
+ import { t as outputResult } from "./output-DBvfyU1J.mjs";
3
+ import "./src-CP4YLIAh.mjs";
4
+ import { n as ENV_AUTH, r as ENV_PROJECT, t as BeeCommand } from "./bee-command-v0qvZeth.mjs";
5
+ import { E as resolveOptions, S as space, u as json, y as project } from "./common-options-BuYWxYdO.mjs";
6
+ import consola from "consola";
7
+ import { getWikisTags } from "backlog-js";
8
+ //#region src/commands/wiki/tags.ts
9
+ const tags = new BeeCommand("tags").summary("List wiki tags").description(`Tags are labels attached to wiki pages for organization.`).addOption(project()).addOption(json()).addOption(space()).envVars([...ENV_AUTH, ENV_PROJECT]).examples([{
10
+ description: "List wiki tags",
11
+ command: "bee wiki tags -p PROJECT"
12
+ }, {
13
+ description: "Output as JSON",
14
+ command: "bee wiki tags -p PROJECT --json"
15
+ }]).action(async (opts, cmd) => {
16
+ await resolveOptions(cmd);
17
+ const { client } = await getClient(opts.space);
18
+ const result = await getWikisTags(client, opts.project);
19
+ const json = opts.json === true ? "" : opts.json;
20
+ outputResult(result, { json }, (data) => {
21
+ if (data.length === 0) {
22
+ consola.info("No wiki tags found.");
23
+ return;
24
+ }
25
+ for (const tag of data) consola.log(tag.name);
26
+ });
27
+ });
28
+ //#endregion
29
+ export { tags as default };
@@ -0,0 +1,6 @@
1
+ import { t as BeeCommand } from "./bee-command-v0qvZeth.mjs";
2
+ //#region src/commands/team/index.ts
3
+ const team = new BeeCommand("team").summary("Manage Backlog teams");
4
+ await team.addCommands([import("./list-jpQ28gU2.mjs"), import("./view-COBYBfu7.mjs")]);
5
+ //#endregion
6
+ export { team as default };
@@ -0,0 +1,28 @@
1
+ import { u as UserError } from "./src-CP4YLIAh.mjs";
2
+ import { a as loadConfig, t as findSpace } from "./src-BWaxjrq_.mjs";
3
+ import { t as BeeCommand } from "./bee-command-v0qvZeth.mjs";
4
+ import { S as space } from "./common-options-BuYWxYdO.mjs";
5
+ //#region src/commands/auth/token.ts
6
+ const tokenCommand = new BeeCommand("token").summary("Print the auth token to stdout").description(`Prints the token for the default space, or the space given by \`--space\`. Useful for piping to other commands.`).addOption(space()).examples([
7
+ {
8
+ description: "Print token for default space",
9
+ command: "bee auth token"
10
+ },
11
+ {
12
+ description: "Print token for specific space",
13
+ command: "bee auth token -s xxx.backlog.com"
14
+ },
15
+ {
16
+ description: "Use token in a script",
17
+ command: "TOKEN=$(bee auth token) && curl -H \"X-Api-Key: $TOKEN\" https://xxx.backlog.com/api/v2/users/myself"
18
+ }
19
+ ]).action((opts) => {
20
+ const config = loadConfig();
21
+ const host = opts.space ?? config.defaultSpace;
22
+ const space = host ? findSpace(config.spaces, host) : null;
23
+ if (!space) throw new UserError("No space configured. Run `bee auth login` to authenticate.");
24
+ const token = space.auth.method === "api-key" ? space.auth.apiKey : space.auth.accessToken;
25
+ process.stdout.write(token);
26
+ });
27
+ //#endregion
28
+ export { tokenCommand as default };
@@ -0,0 +1,46 @@
1
+ import { y as getClient } from "./src-CTD9-bSB.mjs";
2
+ import { t as outputResult } from "./output-DBvfyU1J.mjs";
3
+ import "./src-CP4YLIAh.mjs";
4
+ import { n as ENV_AUTH, r as ENV_PROJECT, t as BeeCommand } from "./bee-command-v0qvZeth.mjs";
5
+ import { E as resolveOptions, S as space, u as json, y as project } from "./common-options-BuYWxYdO.mjs";
6
+ import consola from "consola";
7
+ import { getDocumentTree } from "backlog-js";
8
+ //#region src/commands/document/tree.ts
9
+ const renderNode = (node, prefix, isLast) => {
10
+ const lines = [`${prefix}${isLast ? "└──" : "├──"} ${node.emoji ? `${node.emoji} ` : ""}${node.name ?? node.id}`];
11
+ const childPrefix = prefix + (isLast ? " " : "│ ");
12
+ for (let i = 0; i < node.children.length; i++) {
13
+ const child = node.children[i];
14
+ lines.push(...renderNode(child, childPrefix, i === node.children.length - 1));
15
+ }
16
+ return lines;
17
+ };
18
+ const renderTree = (children) => {
19
+ const lines = [];
20
+ for (let i = 0; i < children.length; i++) {
21
+ const child = children[i];
22
+ lines.push(...renderNode(child, "", i === children.length - 1));
23
+ }
24
+ return lines;
25
+ };
26
+ const tree = new BeeCommand("tree").summary("Display document tree").description(`Shows the hierarchical structure of documents with tree-style indentation.`).addOption(project()).addOption(json()).addOption(space()).envVars([...ENV_AUTH, ENV_PROJECT]).examples([{
27
+ description: "Show document tree",
28
+ command: "bee document tree -p PROJECT"
29
+ }, {
30
+ description: "Output as JSON",
31
+ command: "bee document tree -p PROJECT --json"
32
+ }]).action(async (opts, cmd) => {
33
+ await resolveOptions(cmd);
34
+ const { client } = await getClient(opts.space);
35
+ const docTree = await getDocumentTree(client, opts.project);
36
+ outputResult(docTree, opts, (data) => {
37
+ if (!data.activeTree || data.activeTree.children.length === 0) {
38
+ consola.info("No documents found.");
39
+ return;
40
+ }
41
+ const lines = renderTree(data.activeTree.children);
42
+ for (const line of lines) consola.log(line);
43
+ });
44
+ });
45
+ //#endregion
46
+ export { tree as default };
@@ -0,0 +1,11 @@
1
+ import { t as BeeCommand } from "./bee-command-v0qvZeth.mjs";
2
+ //#region src/commands/user/index.ts
3
+ const user = new BeeCommand("user").summary("Manage Backlog users");
4
+ await user.addCommands([
5
+ import("./list-BOMbpS4m.mjs"),
6
+ import("./view-CZHT-HiE.mjs"),
7
+ import("./me-CLPAe7X2.mjs"),
8
+ import("./activities-BPTHt_MD.mjs")
9
+ ]);
10
+ //#endregion
11
+ export { user as default };
@@ -0,0 +1,51 @@
1
+ import { y as getClient } from "./src-CTD9-bSB.mjs";
2
+ import { t as outputResult } from "./output-DBvfyU1J.mjs";
3
+ import { r as printTable } from "./src-CP4YLIAh.mjs";
4
+ import { t as ROLE_LABELS } from "./role-labels-CLA2wmjO.mjs";
5
+ import { n as ENV_AUTH, r as ENV_PROJECT, t as BeeCommand } from "./bee-command-v0qvZeth.mjs";
6
+ import { E as resolveOptions, S as space, u as json, y as project } from "./common-options-BuYWxYdO.mjs";
7
+ import consola from "consola";
8
+ import { getProjectUsers } from "backlog-js";
9
+ //#region src/commands/project/users.ts
10
+ const users = new BeeCommand("users").summary("List project users").description(`Displays each member's ID, name, and role.`).addOption(project()).addOption(json()).addOption(space()).envVars([...ENV_AUTH, ENV_PROJECT]).examples([{
11
+ description: "List project members",
12
+ command: "bee project users -p PROJECT_KEY"
13
+ }, {
14
+ description: "Output as JSON",
15
+ command: "bee project users -p PROJECT_KEY --json"
16
+ }]).action(async (opts, cmd) => {
17
+ await resolveOptions(cmd);
18
+ const { client } = await getClient(opts.space);
19
+ const members = await getProjectUsers(client, opts.project);
20
+ const jsonArg = opts.json === true ? "" : opts.json;
21
+ outputResult(members, {
22
+ ...opts,
23
+ json: jsonArg
24
+ }, (data) => {
25
+ if (data.length === 0) {
26
+ consola.info("No users found.");
27
+ return;
28
+ }
29
+ const rows = data.map((user) => [
30
+ {
31
+ header: "ID",
32
+ value: String(user.id)
33
+ },
34
+ {
35
+ header: "USER ID",
36
+ value: user.userId ?? ""
37
+ },
38
+ {
39
+ header: "NAME",
40
+ value: user.name
41
+ },
42
+ {
43
+ header: "ROLE",
44
+ value: ROLE_LABELS[user.roleType] ?? `Unknown (${user.roleType})`
45
+ }
46
+ ]);
47
+ printTable(rows);
48
+ });
49
+ });
50
+ //#endregion
51
+ export { users as default };
@@ -0,0 +1,48 @@
1
+ import { f as openOrPrintUrl, g as repositoryUrl, y as getClient } from "./src-CTD9-bSB.mjs";
2
+ import { t as outputResult } from "./output-DBvfyU1J.mjs";
3
+ import { n as printDefinitionList } from "./src-CP4YLIAh.mjs";
4
+ import { t as formatDate } from "./format-DHAR0n3J.mjs";
5
+ import { n as ENV_AUTH, r as ENV_PROJECT, t as BeeCommand } from "./bee-command-v0qvZeth.mjs";
6
+ import { E as resolveOptions, S as space, h as noBrowser, u as json, w as web, y as project } from "./common-options-BuYWxYdO.mjs";
7
+ import consola from "consola";
8
+ import { getGitRepository } from "backlog-js";
9
+ //#region src/commands/repo/view.ts
10
+ const view = new BeeCommand("view").summary("View a repository").description(`Use \`--web\` to open in the browser.`).argument("<repository>", "Repository name or ID").addOption(project()).addOption(web("repository")).addOption(noBrowser()).addOption(json()).addOption(space()).envVars([...ENV_AUTH, ENV_PROJECT]).examples([
11
+ {
12
+ description: "View repository details",
13
+ command: "bee repo view api-server -p PROJECT_KEY"
14
+ },
15
+ {
16
+ description: "Open repository in browser",
17
+ command: "bee repo view api-server -p PROJECT_KEY --web"
18
+ },
19
+ {
20
+ description: "Output as JSON",
21
+ command: "bee repo view api-server -p PROJECT_KEY --json"
22
+ }
23
+ ]).action(async (repository, opts, cmd) => {
24
+ await resolveOptions(cmd);
25
+ const { client, host } = await getClient(opts.space);
26
+ if (opts.web || opts.browser === false) {
27
+ const url = repositoryUrl(host, opts.project, repository);
28
+ await openOrPrintUrl(url, opts.browser === false, consola);
29
+ return;
30
+ }
31
+ const repo = await getGitRepository(client, opts.project, repository);
32
+ outputResult(repo, opts, (data) => {
33
+ consola.log("");
34
+ consola.log(` ${data.name}`);
35
+ consola.log("");
36
+ printDefinitionList([
37
+ ["Description", data.description ?? ""],
38
+ ["HTTP URL", data.httpUrl],
39
+ ["SSH URL", data.sshUrl],
40
+ ["Created", formatDate(data.created)],
41
+ ["Updated", formatDate(data.updated)],
42
+ ["Last Pushed", data.pushedAt ? formatDate(data.pushedAt) : ""]
43
+ ]);
44
+ consola.log("");
45
+ });
46
+ });
47
+ //#endregion
48
+ export { view as default };
@@ -0,0 +1,36 @@
1
+ import { y as getClient } from "./src-CTD9-bSB.mjs";
2
+ import { t as outputResult } from "./output-DBvfyU1J.mjs";
3
+ import { a as parseArg, n as printDefinitionList, s as vInteger } from "./src-CP4YLIAh.mjs";
4
+ import { t as formatDate } from "./format-DHAR0n3J.mjs";
5
+ import { n as ENV_AUTH, t as BeeCommand } from "./bee-command-v0qvZeth.mjs";
6
+ import { S as space, u as json } from "./common-options-BuYWxYdO.mjs";
7
+ import consola from "consola";
8
+ import { getWatchingListItem } from "backlog-js";
9
+ //#region src/commands/watching/view.ts
10
+ const view = new BeeCommand("view").summary("View a watching item").description(`Shows the associated issue, note, read status, and timestamps.`).argument("<watching>", "Watching ID").addOption(json()).addOption(space()).envVars([...ENV_AUTH]).examples([{
11
+ description: "View a watching item",
12
+ command: "bee watching view 12345"
13
+ }, {
14
+ description: "Output as JSON",
15
+ command: "bee watching view 12345 --json"
16
+ }]).action(async (watching, opts) => {
17
+ const { client } = await getClient(opts.space);
18
+ const watchingData = await getWatchingListItem(client, parseArg(vInteger, watching, "watching"));
19
+ outputResult(watchingData, opts, (data) => {
20
+ consola.log("");
21
+ consola.log(` ${data.issue.issueKey}: ${data.issue.summary}`);
22
+ consola.log("");
23
+ printDefinitionList([
24
+ ["ID", String(data.id)],
25
+ ["Issue Key", data.issue.issueKey],
26
+ ["Title", data.issue.summary],
27
+ ["Note", data.note || void 0],
28
+ ["Read", data.resourceAlreadyRead ? "Read" : "Unread"],
29
+ ["Created", formatDate(data.created)],
30
+ ["Updated", formatDate(data.updated)]
31
+ ]);
32
+ consola.log("");
33
+ });
34
+ });
35
+ //#endregion
36
+ export { view as default };
@@ -0,0 +1,54 @@
1
+ import { f as openOrPrintUrl, m as projectUrl, y as getClient } from "./src-CTD9-bSB.mjs";
2
+ import { t as outputResult } from "./output-DBvfyU1J.mjs";
3
+ import { n as printDefinitionList } from "./src-CP4YLIAh.mjs";
4
+ import { n as ENV_AUTH, r as ENV_PROJECT, t as BeeCommand } from "./bee-command-v0qvZeth.mjs";
5
+ import { E as resolveOptions, S as space, h as noBrowser, u as json, w as web, y as project } from "./common-options-BuYWxYdO.mjs";
6
+ import consola from "consola";
7
+ import { getProject } from "backlog-js";
8
+ //#region src/commands/project/view.ts
9
+ const view = new BeeCommand("view").summary("View a project").description(`Use \`--web\` to open in the browser.`).addOption(project()).addOption(web("project")).addOption(noBrowser()).addOption(json()).addOption(space()).envVars([...ENV_AUTH, ENV_PROJECT]).examples([
10
+ {
11
+ description: "View project details",
12
+ command: "bee project view -p PROJECT_KEY"
13
+ },
14
+ {
15
+ description: "Open project in browser",
16
+ command: "bee project view -p PROJECT_KEY --web"
17
+ },
18
+ {
19
+ description: "Output as JSON",
20
+ command: "bee project view -p PROJECT_KEY --json"
21
+ }
22
+ ]).action(async (opts, cmd) => {
23
+ await resolveOptions(cmd);
24
+ const { client, host } = await getClient(opts.space);
25
+ if (opts.web || opts.browser === false) {
26
+ const url = projectUrl(host, opts.project);
27
+ await openOrPrintUrl(url, opts.browser === false, consola);
28
+ return;
29
+ }
30
+ const projectData = await getProject(client, opts.project);
31
+ const jsonArg = opts.json === true ? "" : opts.json;
32
+ outputResult(projectData, {
33
+ ...opts,
34
+ json: jsonArg
35
+ }, (data) => {
36
+ consola.log("");
37
+ consola.log(` ${data.name} (${data.projectKey})`);
38
+ consola.log("");
39
+ printDefinitionList([
40
+ ["Status", data.archived ? "Archived" : "Active"],
41
+ ["Text Formatting", data.textFormattingRule],
42
+ ["Chart", data.chartEnabled ? "Yes" : "No"],
43
+ ["Subtasking", data.subtaskingEnabled ? "Yes" : "No"],
44
+ ["Wiki", data.useWiki ? "Yes" : "No"],
45
+ ["File Sharing", data.useFileSharing ? "Yes" : "No"],
46
+ ["Git", data.useGit ? "Yes" : "No"],
47
+ ["Subversion", data.useSubversion ? "Yes" : "No"],
48
+ ["Dev Attributes", data.useDevAttributes ? "Yes" : "No"]
49
+ ]);
50
+ consola.log("");
51
+ });
52
+ });
53
+ //#endregion
54
+ export { view as default };
@@ -0,0 +1,38 @@
1
+ import { y as getClient } from "./src-CTD9-bSB.mjs";
2
+ import { t as outputResult } from "./output-DBvfyU1J.mjs";
3
+ import { a as parseArg, n as printDefinitionList, s as vInteger } from "./src-CP4YLIAh.mjs";
4
+ import { n as ENV_AUTH, t as BeeCommand } from "./bee-command-v0qvZeth.mjs";
5
+ import { S as space, u as json } from "./common-options-BuYWxYdO.mjs";
6
+ import consola from "consola";
7
+ import { getTeam } from "backlog-js";
8
+ //#region src/commands/team/view.ts
9
+ const view = new BeeCommand("view").summary("View a team").description(`Shows team details and the list of members.`).argument("<team>", "Team ID").addOption(json()).addOption(space()).envVars([...ENV_AUTH]).examples([{
10
+ description: "View team details",
11
+ command: "bee team view 12345"
12
+ }, {
13
+ description: "Output as JSON",
14
+ command: "bee team view 12345 --json"
15
+ }]).action(async (team, opts) => {
16
+ const { client } = await getClient(opts.space);
17
+ const t = await getTeam(client, parseArg(vInteger, team, "team"));
18
+ outputResult(t, opts, (data) => {
19
+ consola.log("");
20
+ consola.log(` ${data.name}`);
21
+ consola.log("");
22
+ printDefinitionList([
23
+ ["ID", String(data.id)],
24
+ ["Created by", data.createdUser?.name ?? "—"],
25
+ ["Created", data.created],
26
+ ["Updated", data.updated],
27
+ ["Members", String(data.members.length)]
28
+ ]);
29
+ if (data.members.length > 0) {
30
+ consola.log("");
31
+ consola.log(" Members:");
32
+ for (const member of data.members) consola.log(` - ${member.name} (${member.userId ?? member.id})`);
33
+ }
34
+ consola.log("");
35
+ });
36
+ });
37
+ //#endregion
38
+ export { view as default };
@@ -0,0 +1,36 @@
1
+ import { y as getClient } from "./src-CTD9-bSB.mjs";
2
+ import { t as outputResult } from "./output-DBvfyU1J.mjs";
3
+ import { a as parseArg, n as printDefinitionList, s as vInteger } from "./src-CP4YLIAh.mjs";
4
+ import { t as formatDate } from "./format-DHAR0n3J.mjs";
5
+ import { t as ROLE_LABELS } from "./role-labels-CLA2wmjO.mjs";
6
+ import { n as ENV_AUTH, t as BeeCommand } from "./bee-command-v0qvZeth.mjs";
7
+ import { S as space, u as json } from "./common-options-BuYWxYdO.mjs";
8
+ import consola from "consola";
9
+ import { getUser } from "backlog-js";
10
+ //#region src/commands/user/view.ts
11
+ const view = new BeeCommand("view").summary("View a user").description(`Use \`bee user me\` as a shortcut to view your own profile.`).argument("<user>", "User ID").addOption(json()).addOption(space()).envVars([...ENV_AUTH]).examples([{
12
+ description: "View user details",
13
+ command: "bee user view 12345"
14
+ }, {
15
+ description: "Output as JSON",
16
+ command: "bee user view 12345 --json"
17
+ }]).action(async (user, opts) => {
18
+ const { client } = await getClient(opts.space);
19
+ const userData = await getUser(client, parseArg(vInteger, user, "user"));
20
+ outputResult(userData, opts, (data) => {
21
+ consola.log("");
22
+ consola.log(` ${data.name}`);
23
+ consola.log("");
24
+ printDefinitionList([
25
+ ["ID", String(data.id)],
26
+ ["User ID", data.userId],
27
+ ["Email", data.mailAddress],
28
+ ["Role", ROLE_LABELS[data.roleType] ?? `Unknown (${data.roleType})`],
29
+ ["Language", data.lang],
30
+ ["Last Login", data.lastLoginTime ? formatDate(data.lastLoginTime) : void 0]
31
+ ]);
32
+ consola.log("");
33
+ });
34
+ });
35
+ //#endregion
36
+ export { view as default };