@nulab/bee 1.1.0 → 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 (253) hide show
  1. package/README.md +6 -3
  2. package/dist/activities-BPTHt_MD.mjs +69 -0
  3. package/dist/activities-CRiEq51-.mjs +72 -0
  4. package/dist/activities-DyOMqdsM.mjs +69 -0
  5. package/dist/activity-labels-CLFpxp8o.mjs +34 -0
  6. package/dist/add-Br-_TLRp.mjs +55 -0
  7. package/dist/add-CTmmy2t9.mjs +26 -0
  8. package/dist/add-user-BVWFcbH7.mjs +26 -0
  9. package/dist/api-kJR0fRPw.mjs +143 -0
  10. package/dist/attachments-CnL8t9tK.mjs +50 -0
  11. package/dist/attachments-D8IoJjYE.mjs +50 -0
  12. package/dist/attachments-DfgEkAY2.mjs +46 -0
  13. package/dist/auth-5TJGBPxi.mjs +13 -0
  14. package/dist/bee-command-v0qvZeth.mjs +57 -0
  15. package/dist/browse-vgF6nz7X.mjs +304 -0
  16. package/dist/category-BZ7XdVgx.mjs +11 -0
  17. package/dist/clone-DAWVtVbZ.mjs +43 -0
  18. package/dist/close-cTyZPv77.mjs +37 -0
  19. package/dist/comment-CkYJYFrF.mjs +115 -0
  20. package/dist/comment-DzRBQNv8.mjs +102 -0
  21. package/dist/comments-SnOZ-EUJ.mjs +47 -0
  22. package/dist/common-options-BuYWxYdO.mjs +45 -0
  23. package/dist/completion-yfcnEl7k.mjs +113 -0
  24. package/dist/count-BI7ld4k5.mjs +50 -0
  25. package/dist/count-Bw0mVlxC.mjs +40 -0
  26. package/dist/count-CH_LN4k6.mjs +51 -0
  27. package/dist/count-CHzDiMV3.mjs +25 -0
  28. package/dist/count-DvmYzPD_.mjs +46 -0
  29. package/dist/create-BHjwacOk.mjs +47 -0
  30. package/dist/create-BXWATibN.mjs +41 -0
  31. package/dist/create-BtLVFmbR.mjs +29 -0
  32. package/dist/create-CoF2bahH.mjs +29 -0
  33. package/dist/create-DhAOhro9.mjs +60 -0
  34. package/dist/create-DtMLv7Wq.mjs +26 -0
  35. package/dist/create-PtahSFdG.mjs +66 -0
  36. package/dist/create-Y4vo2zwX.mjs +44 -0
  37. package/dist/create-vwRKZ3Lm.mjs +31 -0
  38. package/dist/dashboard-CYYU5Yii.mjs +97 -0
  39. package/dist/delete-BCAPHs-g.mjs +25 -0
  40. package/dist/delete-BHNt5SWa.mjs +24 -0
  41. package/dist/delete-BlmanW0H.mjs +25 -0
  42. package/dist/delete-Bxk14ntp.mjs +24 -0
  43. package/dist/delete-C05oMZEW.mjs +24 -0
  44. package/dist/delete-CMwkcSiA.mjs +25 -0
  45. package/dist/delete-CTeH7nzL.mjs +29 -0
  46. package/dist/delete-D2yDBhZc.mjs +24 -0
  47. package/dist/delete-HMOfvtv3.mjs +25 -0
  48. package/dist/document-CiIzSyoS.mjs +13 -0
  49. package/dist/edit-BBvSbt0m.mjs +22 -0
  50. package/dist/edit-CN1gdpjd.mjs +37 -0
  51. package/dist/edit-C_KbKopB.mjs +36 -0
  52. package/dist/edit-D5Z45NVj.mjs +27 -0
  53. package/dist/edit-DKQw-XXP.mjs +27 -0
  54. package/dist/edit-DRxr4r-r.mjs +60 -0
  55. package/dist/edit-DxsP-aPX.mjs +43 -0
  56. package/dist/edit-Otc7XHU7.mjs +52 -0
  57. package/dist/format-DHAR0n3J.mjs +9 -0
  58. package/dist/history-DpjqxFkX.mjs +55 -0
  59. package/dist/index.mjs +35 -207
  60. package/dist/issue-BRzJy3k1.mjs +18 -0
  61. package/dist/issue-type-Byzh4yLx.mjs +11 -0
  62. package/dist/list-B3A5SDEm.mjs +35 -0
  63. package/dist/list-BMKaJoe_.mjs +64 -0
  64. package/dist/list-BOMbpS4m.mjs +46 -0
  65. package/dist/list-BmZ_JbLB.mjs +104 -0
  66. package/dist/list-BpUUxxwQ.mjs +46 -0
  67. package/dist/list-CgIebllW.mjs +94 -0
  68. package/dist/list-D0Z__0nw.mjs +42 -0
  69. package/dist/list-D3FkO9gb.mjs +56 -0
  70. package/dist/list-D7WLdHvX.mjs +42 -0
  71. package/dist/list-DAr3urtu.mjs +53 -0
  72. package/dist/list-DqpWd9aR.mjs +59 -0
  73. package/dist/list-VO_PbRjC.mjs +50 -0
  74. package/dist/list-b6ByzUFt.mjs +79 -0
  75. package/dist/list-jpQ28gU2.mjs +56 -0
  76. package/dist/list-y93EXyDj.mjs +42 -0
  77. package/dist/login-BnJYzdR3.mjs +228 -0
  78. package/dist/logout-YMnSRLLF.mjs +56 -0
  79. package/dist/me-CLPAe7X2.mjs +36 -0
  80. package/dist/milestone-Dc3alfp9.mjs +11 -0
  81. package/dist/notification-CsOuC8Uk.mjs +11 -0
  82. package/dist/output-DBvfyU1J.mjs +39 -0
  83. package/dist/pr-BBe07JUp.mjs +15 -0
  84. package/dist/project-Dilo1T5e.mjs +16 -0
  85. package/dist/read-BS2G4sNq.mjs +17 -0
  86. package/dist/read-CyCASx6U.mjs +17 -0
  87. package/dist/read-all-CjgMJ2to.mjs +16 -0
  88. package/dist/refresh-DDU2ZLnc.mjs +54 -0
  89. package/dist/registry-B0ZQfBD5.mjs +35 -0
  90. package/dist/registry-RATsKPUm.mjs +2 -0
  91. package/dist/remove-BSDJvkVJ.mjs +17 -0
  92. package/dist/remove-user-CShNCvf8.mjs +26 -0
  93. package/dist/reopen-BIRhcmsI.mjs +28 -0
  94. package/dist/repo-B2K8y0mD.mjs +10 -0
  95. package/dist/role-labels-CLA2wmjO.mjs +11 -0
  96. package/dist/space-BgZeUqoH.mjs +6 -0
  97. package/dist/{shared/bee.B3N0WBdU.mjs → src-BWaxjrq_.mjs} +143 -176
  98. package/dist/src-CP4YLIAh.mjs +1008 -0
  99. package/dist/src-CTD9-bSB.mjs +22760 -0
  100. package/dist/star-Sgb-e2CQ.mjs +11 -0
  101. package/dist/status-BkFMW8Jh.mjs +53 -0
  102. package/dist/status-CaGqMXh7.mjs +64 -0
  103. package/dist/status-DDFyQrRZ.mjs +11 -0
  104. package/dist/status-nI4Dpcoo.mjs +58 -0
  105. package/dist/stdin-C-vjNi9T.mjs +17 -0
  106. package/dist/switch-CMLfVGDN.mjs +34 -0
  107. package/dist/tags-DuMJZyBL.mjs +29 -0
  108. package/dist/team-DfQn8Tf5.mjs +6 -0
  109. package/dist/token-BmkUX9vc.mjs +28 -0
  110. package/dist/tree-CozBqPbN.mjs +46 -0
  111. package/dist/user-DMyFmoP3.mjs +11 -0
  112. package/dist/users-BSGqsGSy.mjs +51 -0
  113. package/dist/view-Bj99sk7O.mjs +48 -0
  114. package/dist/view-Bs8o0c7i.mjs +36 -0
  115. package/dist/view-C1ECwTMN.mjs +54 -0
  116. package/dist/view-COBYBfu7.mjs +38 -0
  117. package/dist/view-CZHT-HiE.mjs +36 -0
  118. package/dist/view-D1RuQJV6.mjs +76 -0
  119. package/dist/view-DBO75WzR.mjs +54 -0
  120. package/dist/view-DJHrnN8j.mjs +62 -0
  121. package/dist/view-DLx6qQt9.mjs +51 -0
  122. package/dist/watching-D22YYxOT.mjs +12 -0
  123. package/dist/wiki-B-DQUuIX.mjs +16 -0
  124. package/package.json +12 -7
  125. package/dist/chunks/activities.mjs +0 -77
  126. package/dist/chunks/activities2.mjs +0 -77
  127. package/dist/chunks/activities3.mjs +0 -77
  128. package/dist/chunks/add-user.mjs +0 -40
  129. package/dist/chunks/add.mjs +0 -65
  130. package/dist/chunks/add2.mjs +0 -41
  131. package/dist/chunks/api.mjs +0 -176
  132. package/dist/chunks/attachments.mjs +0 -49
  133. package/dist/chunks/attachments2.mjs +0 -49
  134. package/dist/chunks/attachments3.mjs +0 -50
  135. package/dist/chunks/browse.mjs +0 -271
  136. package/dist/chunks/clone.mjs +0 -62
  137. package/dist/chunks/close.mjs +0 -52
  138. package/dist/chunks/comment.mjs +0 -127
  139. package/dist/chunks/comment2.mjs +0 -113
  140. package/dist/chunks/comments.mjs +0 -59
  141. package/dist/chunks/completion.mjs +0 -118
  142. package/dist/chunks/count.mjs +0 -70
  143. package/dist/chunks/count2.mjs +0 -71
  144. package/dist/chunks/count3.mjs +0 -61
  145. package/dist/chunks/count4.mjs +0 -37
  146. package/dist/chunks/count5.mjs +0 -54
  147. package/dist/chunks/create.mjs +0 -62
  148. package/dist/chunks/create2.mjs +0 -90
  149. package/dist/chunks/create3.mjs +0 -66
  150. package/dist/chunks/create4.mjs +0 -76
  151. package/dist/chunks/create5.mjs +0 -58
  152. package/dist/chunks/create6.mjs +0 -39
  153. package/dist/chunks/create7.mjs +0 -47
  154. package/dist/chunks/create8.mjs +0 -51
  155. package/dist/chunks/create9.mjs +0 -51
  156. package/dist/chunks/dashboard.mjs +0 -86
  157. package/dist/chunks/delete.mjs +0 -50
  158. package/dist/chunks/delete2.mjs +0 -48
  159. package/dist/chunks/delete3.mjs +0 -48
  160. package/dist/chunks/delete4.mjs +0 -51
  161. package/dist/chunks/delete5.mjs +0 -52
  162. package/dist/chunks/delete6.mjs +0 -52
  163. package/dist/chunks/delete7.mjs +0 -64
  164. package/dist/chunks/delete8.mjs +0 -55
  165. package/dist/chunks/delete9.mjs +0 -50
  166. package/dist/chunks/edit.mjs +0 -58
  167. package/dist/chunks/edit2.mjs +0 -80
  168. package/dist/chunks/edit3.mjs +0 -67
  169. package/dist/chunks/edit4.mjs +0 -53
  170. package/dist/chunks/edit5.mjs +0 -45
  171. package/dist/chunks/edit6.mjs +0 -56
  172. package/dist/chunks/edit7.mjs +0 -52
  173. package/dist/chunks/edit8.mjs +0 -52
  174. package/dist/chunks/history.mjs +0 -58
  175. package/dist/chunks/index.mjs +0 -15
  176. package/dist/chunks/index10.mjs +0 -18
  177. package/dist/chunks/index11.mjs +0 -13
  178. package/dist/chunks/index12.mjs +0 -13
  179. package/dist/chunks/index13.mjs +0 -13
  180. package/dist/chunks/index14.mjs +0 -8
  181. package/dist/chunks/index15.mjs +0 -13
  182. package/dist/chunks/index16.mjs +0 -13
  183. package/dist/chunks/index17.mjs +0 -14
  184. package/dist/chunks/index2.mjs +0 -18
  185. package/dist/chunks/index3.mjs +0 -20
  186. package/dist/chunks/index4.mjs +0 -15
  187. package/dist/chunks/index5.mjs +0 -13
  188. package/dist/chunks/index6.mjs +0 -17
  189. package/dist/chunks/index7.mjs +0 -8
  190. package/dist/chunks/index8.mjs +0 -8
  191. package/dist/chunks/index9.mjs +0 -13
  192. package/dist/chunks/list.mjs +0 -54
  193. package/dist/chunks/list10.mjs +0 -46
  194. package/dist/chunks/list11.mjs +0 -51
  195. package/dist/chunks/list12.mjs +0 -47
  196. package/dist/chunks/list13.mjs +0 -47
  197. package/dist/chunks/list14.mjs +0 -56
  198. package/dist/chunks/list15.mjs +0 -48
  199. package/dist/chunks/list2.mjs +0 -105
  200. package/dist/chunks/list3.mjs +0 -87
  201. package/dist/chunks/list4.mjs +0 -81
  202. package/dist/chunks/list5.mjs +0 -79
  203. package/dist/chunks/list6.mjs +0 -47
  204. package/dist/chunks/list7.mjs +0 -50
  205. package/dist/chunks/list8.mjs +0 -48
  206. package/dist/chunks/list9.mjs +0 -55
  207. package/dist/chunks/login.mjs +0 -220
  208. package/dist/chunks/logout.mjs +0 -72
  209. package/dist/chunks/me.mjs +0 -50
  210. package/dist/chunks/read-all.mjs +0 -31
  211. package/dist/chunks/read.mjs +0 -31
  212. package/dist/chunks/read2.mjs +0 -29
  213. package/dist/chunks/refresh.mjs +0 -78
  214. package/dist/chunks/remove-user.mjs +0 -40
  215. package/dist/chunks/remove.mjs +0 -29
  216. package/dist/chunks/reopen.mjs +0 -44
  217. package/dist/chunks/status.mjs +0 -61
  218. package/dist/chunks/status2.mjs +0 -63
  219. package/dist/chunks/status3.mjs +0 -68
  220. package/dist/chunks/switch.mjs +0 -51
  221. package/dist/chunks/tags.mjs +0 -43
  222. package/dist/chunks/token.mjs +0 -38
  223. package/dist/chunks/tree.mjs +0 -63
  224. package/dist/chunks/users.mjs +0 -50
  225. package/dist/chunks/view.mjs +0 -60
  226. package/dist/chunks/view2.mjs +0 -96
  227. package/dist/chunks/view3.mjs +0 -70
  228. package/dist/chunks/view4.mjs +0 -72
  229. package/dist/chunks/view5.mjs +0 -63
  230. package/dist/chunks/view6.mjs +0 -54
  231. package/dist/chunks/view7.mjs +0 -50
  232. package/dist/chunks/view8.mjs +0 -63
  233. package/dist/chunks/view9.mjs +0 -50
  234. package/dist/shared/bee.BImw1HZl.mjs +0 -28
  235. package/dist/shared/bee.BTBGpv4K.mjs +0 -34
  236. package/dist/shared/bee.BXiuAfjJ.mjs +0 -10
  237. package/dist/shared/bee.BYqxm3yG.mjs +0 -24
  238. package/dist/shared/bee.Btmq3TXs.mjs +0 -19
  239. package/dist/shared/bee.C--ZWPxf.mjs +0 -14
  240. package/dist/shared/bee.C4p7W8_P.mjs +0 -18
  241. package/dist/shared/bee.CirccSk2.mjs +0 -51
  242. package/dist/shared/bee.CktwmH8R.mjs +0 -25
  243. package/dist/shared/bee.CzKcWSES.mjs +0 -42
  244. package/dist/shared/bee.DFnSWb6q.mjs +0 -396
  245. package/dist/shared/bee.DessOtkV.mjs +0 -132
  246. package/dist/shared/bee.DfqnFet4.mjs +0 -49
  247. package/dist/shared/bee.DoTvz3uW.mjs +0 -13
  248. package/dist/shared/bee.G4d7izLe.mjs +0 -14
  249. package/dist/shared/bee.KteAW2rM.mjs +0 -73
  250. package/dist/shared/bee.PF8hrVKn.mjs +0 -27
  251. package/dist/shared/bee.a05kNWpn.mjs +0 -32
  252. package/dist/shared/bee.n5MYN4a6.mjs +0 -12
  253. package/dist/shared/bee.x-FvgDW2.mjs +0 -37660
@@ -1,50 +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 '../shared/bee.BYqxm3yG.mjs';
6
- import { f as formatDate } from '../shared/bee.n5MYN4a6.mjs';
7
- import { p as printDefinitionList } from '../shared/bee.C4p7W8_P.mjs';
8
- import { R as ROLE_LABELS } from '../shared/bee.BXiuAfjJ.mjs';
9
- import { g as getClient } from '../shared/bee.DessOtkV.mjs';
10
- import 'backlog-js';
11
- import 'node:http';
12
- import 'open';
13
- import 'node:child_process';
14
- import '../shared/bee.x-FvgDW2.mjs';
15
- import { B as BeeCommand, E as ENV_AUTH } from '../shared/bee.KteAW2rM.mjs';
16
- import { j as json, s as space } from '../shared/bee.B3N0WBdU.mjs';
17
- import '../shared/bee.DFnSWb6q.mjs';
18
- import '../shared/bee.CktwmH8R.mjs';
19
- import '../shared/bee.DfqnFet4.mjs';
20
- import '../shared/bee.BImw1HZl.mjs';
21
- import 'node:module';
22
- import 'commander';
23
- import 'consola/utils';
24
- import 'node:fs';
25
- import 'node:path';
26
- import 'node:os';
27
-
28
- const me = new BeeCommand("me").summary("View the authenticated user").description(`Shortcut for \`bee user view\` using the currently authenticated user.`).addOption(json()).addOption(space()).envVars([...ENV_AUTH]).examples([
29
- { description: "View your own profile", command: "bee user me" },
30
- { description: "Output as JSON", command: "bee user me --json" }
31
- ]).action(async (opts) => {
32
- const { client } = await getClient(opts.space);
33
- const myself = await client.getMyself();
34
- outputResult(myself, opts, (data) => {
35
- consola.log("");
36
- consola.log(` ${data.name}`);
37
- consola.log("");
38
- printDefinitionList([
39
- ["ID", String(data.id)],
40
- ["User ID", data.userId],
41
- ["Email", data.mailAddress],
42
- ["Role", ROLE_LABELS[data.roleType] ?? `Unknown (${data.roleType})`],
43
- ["Language", data.lang],
44
- ["Last Login", data.lastLoginTime ? formatDate(data.lastLoginTime) : void 0]
45
- ]);
46
- consola.log("");
47
- });
48
- });
49
-
50
- export { me as default };
@@ -1,31 +0,0 @@
1
- import consola from 'consola';
2
- import 'node:stream/consumers';
3
- import 'valibot';
4
- import '../shared/bee.BYqxm3yG.mjs';
5
- import { g as getClient } from '../shared/bee.DessOtkV.mjs';
6
- import 'backlog-js';
7
- import 'node:http';
8
- import 'open';
9
- import 'node:child_process';
10
- import '../shared/bee.x-FvgDW2.mjs';
11
- import { B as BeeCommand, E as ENV_AUTH } from '../shared/bee.KteAW2rM.mjs';
12
- import { s as space } from '../shared/bee.B3N0WBdU.mjs';
13
- import '../shared/bee.CktwmH8R.mjs';
14
- import '../shared/bee.DfqnFet4.mjs';
15
- import '../shared/bee.BImw1HZl.mjs';
16
- import 'node:module';
17
- import 'commander';
18
- import 'consola/utils';
19
- import 'node:fs';
20
- import 'node:path';
21
- import 'node:os';
22
-
23
- const readAll = new BeeCommand("read-all").summary("Mark all notifications as read").description(`Resets the unread notification count to zero.`).addOption(space()).envVars([...ENV_AUTH]).examples([
24
- { description: "Mark all notifications as read", command: "bee notification read-all" }
25
- ]).action(async (opts) => {
26
- const { client } = await getClient(opts.space);
27
- await client.resetNotificationsMarkAsRead();
28
- consola.success("Marked all notifications as read.");
29
- });
30
-
31
- export { readAll as default };
@@ -1,31 +0,0 @@
1
- import consola from 'consola';
2
- import 'node:stream/consumers';
3
- import 'valibot';
4
- import { p as parseArg, v as vInteger } from '../shared/bee.BYqxm3yG.mjs';
5
- import { g as getClient } from '../shared/bee.DessOtkV.mjs';
6
- import 'backlog-js';
7
- import 'node:http';
8
- import 'open';
9
- import 'node:child_process';
10
- import '../shared/bee.x-FvgDW2.mjs';
11
- import { B as BeeCommand, E as ENV_AUTH } from '../shared/bee.KteAW2rM.mjs';
12
- import { s as space } from '../shared/bee.B3N0WBdU.mjs';
13
- import '../shared/bee.CktwmH8R.mjs';
14
- import '../shared/bee.DfqnFet4.mjs';
15
- import '../shared/bee.BImw1HZl.mjs';
16
- import 'node:module';
17
- import 'commander';
18
- import 'consola/utils';
19
- import 'node:fs';
20
- import 'node:path';
21
- import 'node:os';
22
-
23
- const read = new BeeCommand("read").summary("Mark a notification as read").description(`Use \`bee notification list\` to find notification IDs.`).argument("<id>", "Notification ID").addOption(space()).envVars([...ENV_AUTH]).examples([
24
- { description: "Mark a notification as read", command: "bee notification read 12345" }
25
- ]).action(async (id, opts) => {
26
- const { client } = await getClient(opts.space);
27
- await client.markAsReadNotification(parseArg(vInteger, id, "id"));
28
- consola.success(`Marked notification ${id} as read.`);
29
- });
30
-
31
- export { read as default };
@@ -1,29 +0,0 @@
1
- import consola from 'consola';
2
- import 'node:stream/consumers';
3
- import 'valibot';
4
- import { p as parseArg, v as vInteger } from '../shared/bee.BYqxm3yG.mjs';
5
- import { g as getClient } from '../shared/bee.DessOtkV.mjs';
6
- import 'backlog-js';
7
- import 'node:http';
8
- import 'open';
9
- import 'node:child_process';
10
- import '../shared/bee.x-FvgDW2.mjs';
11
- import { B as BeeCommand, E as ENV_AUTH } from '../shared/bee.KteAW2rM.mjs';
12
- import { s as space } from '../shared/bee.B3N0WBdU.mjs';
13
- import '../shared/bee.CktwmH8R.mjs';
14
- import '../shared/bee.DfqnFet4.mjs';
15
- import '../shared/bee.BImw1HZl.mjs';
16
- import 'node:module';
17
- import 'commander';
18
- import 'consola/utils';
19
- import 'node:fs';
20
- import 'node:path';
21
- import 'node:os';
22
-
23
- const read = new BeeCommand("read").summary("Mark a watching item as read").description(`Use \`bee watching list\` to find watching IDs.`).argument("<watching>", "Watching ID").addOption(space()).envVars([...ENV_AUTH]).examples([{ description: "Mark a watching item as read", command: "bee watching read 12345" }]).action(async (watching, opts) => {
24
- const { client } = await getClient(opts.space);
25
- await client.resetWatchingListItemAsRead(parseArg(vInteger, watching, "watching"));
26
- consola.success(`Marked watching ${watching} as read.`);
27
- });
28
-
29
- export { read as default };
@@ -1,78 +0,0 @@
1
- import consola from 'consola';
2
- import { U as UserError } from '../shared/bee.BYqxm3yG.mjs';
3
- import 'node:stream/consumers';
4
- import 'valibot';
5
- import { Backlog } from 'backlog-js';
6
- import { r as refreshAccessToken } from '../shared/bee.CktwmH8R.mjs';
7
- import { s as space, l as loadConfig } from '../shared/bee.B3N0WBdU.mjs';
8
- import { f as findSpace, u as updateSpaceAuth } from '../shared/bee.DfqnFet4.mjs';
9
- import '../shared/bee.BImw1HZl.mjs';
10
- import 'node:http';
11
- import 'open';
12
- import 'node:child_process';
13
- import '../shared/bee.x-FvgDW2.mjs';
14
- import { B as BeeCommand } from '../shared/bee.KteAW2rM.mjs';
15
- import 'node:fs';
16
- import 'node:path';
17
- import 'node:os';
18
- import 'commander';
19
- import 'node:module';
20
- import 'consola/utils';
21
-
22
- const refresh = new BeeCommand("refresh").summary("Refresh OAuth token").description(
23
- `Only available for spaces authenticated with OAuth. If the refresh token is expired, re-authenticate with \`bee auth login -m oauth\`.`
24
- ).addOption(space()).examples([
25
- { description: "Refresh token for default space", command: "bee auth refresh" },
26
- {
27
- description: "Refresh token for specific space",
28
- command: "bee auth refresh -s xxx.backlog.com"
29
- }
30
- ]).action(async (opts) => {
31
- const config = loadConfig();
32
- const host = opts.space ?? config.defaultSpace;
33
- const space = host ? findSpace(config.spaces, host) : null;
34
- if (!space) {
35
- throw new UserError("No space configured. Run `bee auth login` to authenticate.");
36
- }
37
- if (space.auth.method !== "oauth") {
38
- throw new UserError(
39
- "Token refresh is only available for OAuth authentication. Current space uses API key."
40
- );
41
- }
42
- const { clientId, clientSecret } = space.auth;
43
- if (!clientId || !clientSecret) {
44
- throw new UserError(
45
- "Client ID and Client Secret are missing from the stored OAuth configuration. Please re-authenticate with `bee auth login -m oauth`."
46
- );
47
- }
48
- consola.start(`Refreshing OAuth token for ${space.host}...`);
49
- let tokenResponse;
50
- try {
51
- tokenResponse = await refreshAccessToken(space.host, {
52
- clientId,
53
- clientSecret,
54
- refreshToken: space.auth.refreshToken
55
- });
56
- } catch {
57
- throw new UserError(
58
- "Failed to refresh OAuth token. Please re-authenticate with `bee auth login -m oauth`."
59
- );
60
- }
61
- let user;
62
- try {
63
- const client = new Backlog({ host: space.host, accessToken: tokenResponse.access_token });
64
- user = await client.getMyself();
65
- } catch {
66
- throw new UserError("Token verification failed after refresh.");
67
- }
68
- updateSpaceAuth(space.host, {
69
- method: "oauth",
70
- accessToken: tokenResponse.access_token,
71
- refreshToken: tokenResponse.refresh_token,
72
- clientId,
73
- clientSecret
74
- });
75
- consola.success(`Token refreshed for ${space.host} (${user.name})`);
76
- });
77
-
78
- export { refresh as default };
@@ -1,40 +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 { p as parseArg, v as vInteger } from '../shared/bee.BYqxm3yG.mjs';
6
- import { g as getClient } from '../shared/bee.DessOtkV.mjs';
7
- import 'backlog-js';
8
- import 'node:http';
9
- import 'open';
10
- import 'node:child_process';
11
- import '../shared/bee.x-FvgDW2.mjs';
12
- import { B as BeeCommand, E as ENV_AUTH, a as ENV_PROJECT } from '../shared/bee.KteAW2rM.mjs';
13
- import { d as project, R as RequiredOption, j as json, s as space, r as resolveOptions } from '../shared/bee.B3N0WBdU.mjs';
14
- import '../shared/bee.CktwmH8R.mjs';
15
- import '../shared/bee.DfqnFet4.mjs';
16
- import '../shared/bee.BImw1HZl.mjs';
17
- import 'node:module';
18
- import 'commander';
19
- import 'consola/utils';
20
- import 'node:fs';
21
- import 'node:path';
22
- import 'node:os';
23
-
24
- const removeUser = new BeeCommand("remove-user").summary("Remove a user from a project").description(`Use \`bee project users\` to look up user IDs.`).addOption(project()).addOption(new RequiredOption("--user-id <id>", "User ID")).addOption(json()).addOption(space()).envVars([...ENV_AUTH, ENV_PROJECT]).examples([
25
- {
26
- description: "Remove a user from a project",
27
- command: "bee project remove-user -p PROJECT_KEY --user-id 12345"
28
- }
29
- ]).action(async (opts, cmd) => {
30
- await resolveOptions(cmd);
31
- const userId = parseArg(vInteger, opts.userId, "--user-id");
32
- const { client } = await getClient(opts.space);
33
- const user = await client.deleteProjectUsers(opts.project, { userId });
34
- const jsonArg = opts.json === true ? "" : opts.json;
35
- outputResult(user, { ...opts, json: jsonArg }, (data) => {
36
- consola.success(`Removed user ${data.name} from project ${opts.project}.`);
37
- });
38
- });
39
-
40
- export { removeUser as default };
@@ -1,29 +0,0 @@
1
- import consola from 'consola';
2
- import 'node:stream/consumers';
3
- import 'valibot';
4
- import { p as parseArg, v as vInteger } from '../shared/bee.BYqxm3yG.mjs';
5
- import { g as getClient } from '../shared/bee.DessOtkV.mjs';
6
- import 'backlog-js';
7
- import 'node:http';
8
- import 'open';
9
- import 'node:child_process';
10
- import '../shared/bee.x-FvgDW2.mjs';
11
- import { B as BeeCommand, E as ENV_AUTH } from '../shared/bee.KteAW2rM.mjs';
12
- import { s as space } from '../shared/bee.B3N0WBdU.mjs';
13
- import '../shared/bee.CktwmH8R.mjs';
14
- import '../shared/bee.DfqnFet4.mjs';
15
- import '../shared/bee.BImw1HZl.mjs';
16
- import 'node:module';
17
- import 'commander';
18
- import 'consola/utils';
19
- import 'node:fs';
20
- import 'node:path';
21
- import 'node:os';
22
-
23
- const remove = new BeeCommand("remove").summary("Remove a star").description(`Use \`bee star list\` to find star IDs.`).argument("<star>", "Star ID").addOption(space()).envVars([...ENV_AUTH]).examples([{ description: "Remove a star", command: "bee star remove 12345" }]).action(async (star, opts) => {
24
- const { client } = await getClient(opts.space);
25
- await client.removeStar(parseArg(vInteger, star, "star"));
26
- consola.success(`Removed star ${star}.`);
27
- });
28
-
29
- export { remove as default };
@@ -1,44 +0,0 @@
1
- import consola from 'consola';
2
- import { 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 '../shared/bee.BYqxm3yG.mjs';
7
- import { g as getClient } from '../shared/bee.DessOtkV.mjs';
8
- import 'backlog-js';
9
- import 'node:http';
10
- import 'open';
11
- import 'node:child_process';
12
- import '../shared/bee.x-FvgDW2.mjs';
13
- import { B as BeeCommand, E as ENV_AUTH } from '../shared/bee.KteAW2rM.mjs';
14
- import { x as notify, j as json, s as space } from '../shared/bee.B3N0WBdU.mjs';
15
- import '../shared/bee.CktwmH8R.mjs';
16
- import '../shared/bee.DfqnFet4.mjs';
17
- import '../shared/bee.BImw1HZl.mjs';
18
- import 'node:module';
19
- import 'commander';
20
- import 'consola/utils';
21
- import 'node:fs';
22
- import 'node:path';
23
- import 'node:os';
24
-
25
- const reopen = new BeeCommand("reopen").summary("Reopen an issue").description(`Sets the status back to Open.`).argument("<issue>", "Issue ID or issue key").option("-c, --comment <text>", "Comment to add when reopening").addOption(notify()).addOption(json()).addOption(space()).envVars([...ENV_AUTH]).examples([
26
- { description: "Reopen an issue", command: "bee issue reopen PROJECT-123" },
27
- {
28
- description: "Reopen with a comment",
29
- command: 'bee issue reopen PROJECT-123 -c "Reopening due to regression"'
30
- }
31
- ]).action(async (issue, opts) => {
32
- const { client } = await getClient(opts.space);
33
- const notifiedUserId = opts.notify ?? [];
34
- const issueData = await client.patchIssue(issue, {
35
- statusId: IssueStatusId.Open,
36
- comment: opts.comment,
37
- notifiedUserId
38
- });
39
- outputResult(issueData, opts, (data) => {
40
- consola.success(`Reopened issue ${data.issueKey}: ${data.summary}`);
41
- });
42
- });
43
-
44
- export { reopen as default };
@@ -1,61 +0,0 @@
1
- import { s as space, l as loadConfig } from '../shared/bee.B3N0WBdU.mjs';
2
- import '../shared/bee.BImw1HZl.mjs';
3
- import { Backlog } from 'backlog-js';
4
- import consola from 'consola';
5
- import 'node:stream/consumers';
6
- import 'valibot';
7
- import '../shared/bee.BYqxm3yG.mjs';
8
- import { p as printDefinitionList } from '../shared/bee.C4p7W8_P.mjs';
9
- import { B as BeeCommand } from '../shared/bee.KteAW2rM.mjs';
10
- import 'node:fs';
11
- import 'node:path';
12
- import 'node:os';
13
- import 'commander';
14
- import '../shared/bee.DFnSWb6q.mjs';
15
- import 'consola/utils';
16
-
17
- const getToken = (auth) => auth.method === "api-key" ? auth.apiKey : auth.accessToken;
18
- const status = new BeeCommand("status").summary("Show authentication status").description(
19
- `Verifies credential validity for each configured space via the Backlog API. The active (default) space is indicated.`
20
- ).addOption(space()).option("--show-token", "Display the auth token").examples([
21
- { description: "Display status for all spaces", command: "bee auth status" },
22
- {
23
- description: "Check a specific space",
24
- command: "bee auth status -s xxx.backlog.com"
25
- },
26
- { description: "Show auth tokens in the output", command: "bee auth status --show-token" }
27
- ]).action(async (opts) => {
28
- const config = loadConfig();
29
- const filterSpace = opts.space;
30
- const spaces = filterSpace ? config.spaces.filter((s) => s.host === filterSpace) : config.spaces;
31
- if (spaces.length === 0) {
32
- if (filterSpace) {
33
- consola.info(`No authentication configured for ${filterSpace}.`);
34
- } else {
35
- consola.info("No spaces are authenticated. Run `bee auth login` to get started.");
36
- }
37
- return;
38
- }
39
- for (const space of spaces) {
40
- const isDefault = config.defaultSpace === space.host;
41
- const label = isDefault ? `${space.host} (default)` : space.host;
42
- let user = null;
43
- try {
44
- const client = space.auth.method === "api-key" ? new Backlog({ host: space.host, apiKey: space.auth.apiKey }) : new Backlog({ host: space.host, accessToken: space.auth.accessToken });
45
- user = await client.getMyself();
46
- } catch (error) {
47
- consola.debug("Token verification failed:", error);
48
- }
49
- consola.log("");
50
- consola.log(` ${label}`);
51
- printDefinitionList([
52
- ["Method", space.auth.method],
53
- ["User", user ? `${user.name} (${user.userId})` : void 0],
54
- ["Status", user ? "Authenticated" : "Authentication failed"],
55
- ["Token", opts.showToken ? getToken(space.auth) : void 0]
56
- ]);
57
- }
58
- consola.log("");
59
- });
60
-
61
- export { status as default };
@@ -1,63 +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 '../shared/bee.BYqxm3yG.mjs';
6
- import { g as getClient } from '../shared/bee.DessOtkV.mjs';
7
- import 'backlog-js';
8
- import 'node:http';
9
- import 'open';
10
- import 'node:child_process';
11
- import '../shared/bee.x-FvgDW2.mjs';
12
- import { B as BeeCommand, E as ENV_AUTH } from '../shared/bee.KteAW2rM.mjs';
13
- import { j as json, s as space } from '../shared/bee.B3N0WBdU.mjs';
14
- import '../shared/bee.CktwmH8R.mjs';
15
- import '../shared/bee.DfqnFet4.mjs';
16
- import '../shared/bee.BImw1HZl.mjs';
17
- import 'node:module';
18
- import 'commander';
19
- import 'consola/utils';
20
- import 'node:fs';
21
- import 'node:path';
22
- import 'node:os';
23
-
24
- const status = new BeeCommand("status").summary("Show issue status summary for yourself").description(
25
- `Displays your assigned issues grouped by status (e.g., Open, In Progress, Resolved).`
26
- ).addOption(json()).addOption(space()).envVars([...ENV_AUTH]).examples([
27
- { description: "Show your issue status summary", command: "bee issue status" },
28
- { description: "Output as JSON", command: "bee issue status --json" }
29
- ]).action(async (opts) => {
30
- const { client } = await getClient(opts.space);
31
- const me = await client.getMyself();
32
- const issues = await client.getIssues({
33
- assigneeId: [me.id],
34
- count: 100
35
- });
36
- if (issues.length === 0) {
37
- outputResult({ user: me, issues: [] }, opts, () => {
38
- consola.info("No issues assigned to you.");
39
- });
40
- return;
41
- }
42
- outputResult({ user: me, issues }, opts, (data) => {
43
- const grouped = /* @__PURE__ */ new Map();
44
- for (const issue of data.issues) {
45
- const { name } = issue.status;
46
- const group = grouped.get(name) ?? [];
47
- group.push(issue);
48
- grouped.set(name, group);
49
- }
50
- consola.log("");
51
- consola.log(` Issues assigned to ${data.user.name}:`);
52
- consola.log("");
53
- for (const [statusName, statusIssues] of grouped) {
54
- consola.log(` ${statusName} (${statusIssues.length}):`);
55
- for (const issue of statusIssues) {
56
- consola.log(` ${issue.issueKey} ${issue.summary}`);
57
- }
58
- consola.log("");
59
- }
60
- });
61
- });
62
-
63
- export { status as default };
@@ -1,68 +0,0 @@
1
- import consola from 'consola';
2
- import { b as PrStatusId } 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 '../shared/bee.BYqxm3yG.mjs';
7
- import { g as getClient } from '../shared/bee.DessOtkV.mjs';
8
- import 'backlog-js';
9
- import 'node:http';
10
- import 'open';
11
- import 'node:child_process';
12
- import '../shared/bee.x-FvgDW2.mjs';
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, j as json, s as space, r as resolveOptions } from '../shared/bee.B3N0WBdU.mjs';
15
- import '../shared/bee.CktwmH8R.mjs';
16
- import '../shared/bee.DfqnFet4.mjs';
17
- import '../shared/bee.BImw1HZl.mjs';
18
- import 'node:module';
19
- import 'commander';
20
- import 'consola/utils';
21
- import 'node:fs';
22
- import 'node:path';
23
- import 'node:os';
24
-
25
- 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([...ENV_AUTH, ENV_PROJECT, ENV_REPO]).examples([
26
- {
27
- description: "Show your pull request status summary",
28
- command: "bee pr status -p PROJECT -R repo"
29
- },
30
- { description: "Output as JSON", command: "bee pr status -p PROJECT -R repo --json" }
31
- ]).action(async (opts, cmd) => {
32
- await resolveOptions(cmd);
33
- const { client } = await getClient(opts.space);
34
- const me = await client.getMyself();
35
- const pullRequests = await client.getPullRequests(opts.project, opts.repo, {
36
- assigneeId: [me.id],
37
- statusId: [PrStatusId.Open, PrStatusId.Closed, PrStatusId.Merged],
38
- count: 100
39
- });
40
- const json = opts.json === true ? "" : opts.json;
41
- if (pullRequests.length === 0) {
42
- outputResult({ user: me, pullRequests: [] }, { json }, () => {
43
- consola.info("No pull requests assigned to you.");
44
- });
45
- return;
46
- }
47
- outputResult({ user: me, pullRequests }, { json }, (data) => {
48
- const grouped = /* @__PURE__ */ new Map();
49
- for (const pr of data.pullRequests) {
50
- const { name } = pr.status;
51
- const group = grouped.get(name) ?? [];
52
- group.push(pr);
53
- grouped.set(name, group);
54
- }
55
- consola.log("");
56
- consola.log(` Pull requests assigned to ${data.user.name}:`);
57
- consola.log("");
58
- for (const [statusName, statusPrs] of grouped) {
59
- consola.log(` ${statusName} (${statusPrs.length}):`);
60
- for (const pr of statusPrs) {
61
- consola.log(` #${pr.number} ${pr.summary}`);
62
- }
63
- consola.log("");
64
- }
65
- });
66
- });
67
-
68
- export { status as default };
@@ -1,51 +0,0 @@
1
- import consola from 'consola';
2
- import { U as UserError } from '../shared/bee.BYqxm3yG.mjs';
3
- import 'node:stream/consumers';
4
- import 'valibot';
5
- import { s as space, l as loadConfig, b as writeConfig } from '../shared/bee.B3N0WBdU.mjs';
6
- import '../shared/bee.BImw1HZl.mjs';
7
- import { B as BeeCommand } from '../shared/bee.KteAW2rM.mjs';
8
- import 'node:fs';
9
- import 'node:path';
10
- import 'node:os';
11
- import 'commander';
12
- import 'consola/utils';
13
-
14
- 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([
15
- { description: "Select space via prompt", command: "bee auth switch" },
16
- {
17
- description: "Switch to a specific space",
18
- command: "bee auth switch -s xxx.backlog.com"
19
- }
20
- ]).action(async (opts) => {
21
- const config = loadConfig();
22
- let hostname = opts.space;
23
- if (!hostname) {
24
- if (config.spaces.length === 0) {
25
- throw new UserError("No spaces configured. Run `bee auth login` to add a space.");
26
- }
27
- if (!process.stdin.isTTY) {
28
- throw new UserError(
29
- "Hostname is required. Use --space to provide it in non-interactive mode."
30
- );
31
- }
32
- const hosts = config.spaces.map((s) => s.host);
33
- hostname = await consola.prompt("Select space:", {
34
- type: "select",
35
- options: hosts
36
- });
37
- if (typeof hostname !== "string" || !hostname) {
38
- throw new UserError("No space selected.");
39
- }
40
- }
41
- const space = config.spaces.find((s) => s.host === hostname);
42
- if (!space) {
43
- throw new UserError(
44
- `Space "${hostname}" not found. Available spaces: ${config.spaces.map((s) => s.host).join(", ")}`
45
- );
46
- }
47
- writeConfig({ ...config, defaultSpace: hostname });
48
- consola.success(`Switched active space to ${hostname}.`);
49
- });
50
-
51
- export { switchSpace as default };
@@ -1,43 +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 '../shared/bee.BYqxm3yG.mjs';
6
- import { g as getClient } from '../shared/bee.DessOtkV.mjs';
7
- import 'backlog-js';
8
- import 'node:http';
9
- import 'open';
10
- import 'node:child_process';
11
- import '../shared/bee.x-FvgDW2.mjs';
12
- import { B as BeeCommand, E as ENV_AUTH, a as ENV_PROJECT } from '../shared/bee.KteAW2rM.mjs';
13
- import { d as project, j as json, s as space, r as resolveOptions } from '../shared/bee.B3N0WBdU.mjs';
14
- import '../shared/bee.CktwmH8R.mjs';
15
- import '../shared/bee.DfqnFet4.mjs';
16
- import '../shared/bee.BImw1HZl.mjs';
17
- import 'node:module';
18
- import 'commander';
19
- import 'consola/utils';
20
- import 'node:fs';
21
- import 'node:path';
22
- import 'node:os';
23
-
24
- 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([
25
- { description: "List wiki tags", command: "bee wiki tags -p PROJECT" },
26
- { description: "Output as JSON", command: "bee wiki tags -p PROJECT --json" }
27
- ]).action(async (opts, cmd) => {
28
- await resolveOptions(cmd);
29
- const { client } = await getClient(opts.space);
30
- const result = await client.getWikisTags(opts.project);
31
- const json = opts.json === true ? "" : opts.json;
32
- outputResult(result, { json }, (data) => {
33
- if (data.length === 0) {
34
- consola.info("No wiki tags found.");
35
- return;
36
- }
37
- for (const tag of data) {
38
- consola.log(tag.name);
39
- }
40
- });
41
- });
42
-
43
- export { tags as default };
@@ -1,38 +0,0 @@
1
- import 'consola';
2
- import { U as UserError } from '../shared/bee.BYqxm3yG.mjs';
3
- import 'node:stream/consumers';
4
- import 'valibot';
5
- import { s as space, l as loadConfig } from '../shared/bee.B3N0WBdU.mjs';
6
- import { f as findSpace } from '../shared/bee.DfqnFet4.mjs';
7
- import '../shared/bee.BImw1HZl.mjs';
8
- import { B as BeeCommand } from '../shared/bee.KteAW2rM.mjs';
9
- import 'node:fs';
10
- import 'node:path';
11
- import 'node:os';
12
- import 'commander';
13
- import 'consola/utils';
14
-
15
- const tokenCommand = new BeeCommand("token").summary("Print the auth token to stdout").description(
16
- `Prints the token for the default space, or the space given by \`--space\`. Useful for piping to other commands.`
17
- ).addOption(space()).examples([
18
- { description: "Print token for default space", command: "bee auth token" },
19
- {
20
- description: "Print token for specific space",
21
- command: "bee auth token -s xxx.backlog.com"
22
- },
23
- {
24
- description: "Use token in a script",
25
- command: 'TOKEN=$(bee auth token) && curl -H "X-Api-Key: $TOKEN" https://xxx.backlog.com/api/v2/users/myself'
26
- }
27
- ]).action((opts) => {
28
- const config = loadConfig();
29
- const host = opts.space ?? config.defaultSpace;
30
- const space = host ? findSpace(config.spaces, host) : null;
31
- if (!space) {
32
- throw new UserError("No space configured. Run `bee auth login` to authenticate.");
33
- }
34
- const token = space.auth.method === "api-key" ? space.auth.apiKey : space.auth.accessToken;
35
- process.stdout.write(token);
36
- });
37
-
38
- export { tokenCommand as default };