@nulab/bee 1.1.1 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (251) 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-DhA8avDD.mjs +134 -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-yX2VOQSl.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-vTiqLew9.mjs +14 -0
  48. package/dist/edit-BBvSbt0m.mjs +22 -0
  49. package/dist/edit-BfCZ2Abi.mjs +50 -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/file-DwPTUKOI.mjs +17 -0
  58. package/dist/format-DHAR0n3J.mjs +9 -0
  59. package/dist/history-DpjqxFkX.mjs +55 -0
  60. package/dist/index.mjs +33 -37918
  61. package/dist/issue-BRzJy3k1.mjs +18 -0
  62. package/dist/issue-type-Byzh4yLx.mjs +11 -0
  63. package/dist/list-B3A5SDEm.mjs +35 -0
  64. package/dist/list-BMKaJoe_.mjs +64 -0
  65. package/dist/list-BOMbpS4m.mjs +46 -0
  66. package/dist/list-BmZ_JbLB.mjs +104 -0
  67. package/dist/list-BpUUxxwQ.mjs +46 -0
  68. package/dist/list-CgIebllW.mjs +94 -0
  69. package/dist/list-D0Z__0nw.mjs +42 -0
  70. package/dist/list-D3FkO9gb.mjs +56 -0
  71. package/dist/list-D7WLdHvX.mjs +42 -0
  72. package/dist/list-DAr3urtu.mjs +53 -0
  73. package/dist/list-DqpWd9aR.mjs +59 -0
  74. package/dist/list-VO_PbRjC.mjs +50 -0
  75. package/dist/list-b6ByzUFt.mjs +79 -0
  76. package/dist/list-jpQ28gU2.mjs +56 -0
  77. package/dist/list-y93EXyDj.mjs +42 -0
  78. package/dist/login-BnJYzdR3.mjs +228 -0
  79. package/dist/logout-YMnSRLLF.mjs +56 -0
  80. package/dist/me-CLPAe7X2.mjs +36 -0
  81. package/dist/milestone-Dc3alfp9.mjs +11 -0
  82. package/dist/notification-CsOuC8Uk.mjs +11 -0
  83. package/dist/output-DBvfyU1J.mjs +39 -0
  84. package/dist/pr-BBe07JUp.mjs +15 -0
  85. package/dist/project-Dilo1T5e.mjs +16 -0
  86. package/dist/read-BS2G4sNq.mjs +17 -0
  87. package/dist/read-CyCASx6U.mjs +17 -0
  88. package/dist/read-all-CjgMJ2to.mjs +16 -0
  89. package/dist/refresh-DDU2ZLnc.mjs +54 -0
  90. package/dist/registry-D8DfbunX.mjs +2 -0
  91. package/dist/registry-PlBmfTR4.mjs +35 -0
  92. package/dist/remove-BSDJvkVJ.mjs +17 -0
  93. package/dist/remove-user-CShNCvf8.mjs +26 -0
  94. package/dist/reopen-BIRhcmsI.mjs +28 -0
  95. package/dist/repo-B2K8y0mD.mjs +10 -0
  96. package/dist/role-labels-CLA2wmjO.mjs +11 -0
  97. package/dist/space-BgZeUqoH.mjs +6 -0
  98. package/dist/{shared/bee.CHtg3F43.mjs → src-BWaxjrq_.mjs} +143 -175
  99. package/dist/src-CP4YLIAh.mjs +1008 -0
  100. package/dist/src-CTD9-bSB.mjs +22760 -0
  101. package/dist/star-Sgb-e2CQ.mjs +11 -0
  102. package/dist/status-BkFMW8Jh.mjs +53 -0
  103. package/dist/status-CaGqMXh7.mjs +64 -0
  104. package/dist/status-DDFyQrRZ.mjs +11 -0
  105. package/dist/status-nI4Dpcoo.mjs +58 -0
  106. package/dist/stdin-C-vjNi9T.mjs +17 -0
  107. package/dist/switch-CMLfVGDN.mjs +34 -0
  108. package/dist/tags-DuMJZyBL.mjs +29 -0
  109. package/dist/team-DfQn8Tf5.mjs +6 -0
  110. package/dist/token-BmkUX9vc.mjs +28 -0
  111. package/dist/tree-CozBqPbN.mjs +46 -0
  112. package/dist/user-DMyFmoP3.mjs +11 -0
  113. package/dist/users-BSGqsGSy.mjs +51 -0
  114. package/dist/view-Bj99sk7O.mjs +48 -0
  115. package/dist/view-Bs8o0c7i.mjs +36 -0
  116. package/dist/view-C1ECwTMN.mjs +54 -0
  117. package/dist/view-COBYBfu7.mjs +38 -0
  118. package/dist/view-CZHT-HiE.mjs +36 -0
  119. package/dist/view-D1RuQJV6.mjs +76 -0
  120. package/dist/view-DBO75WzR.mjs +54 -0
  121. package/dist/view-DJHrnN8j.mjs +62 -0
  122. package/dist/view-DLx6qQt9.mjs +51 -0
  123. package/dist/watching-D22YYxOT.mjs +12 -0
  124. package/dist/wiki-B-DQUuIX.mjs +16 -0
  125. package/package.json +14 -11
  126. package/dist/chunks/activities.mjs +0 -75
  127. package/dist/chunks/activities2.mjs +0 -75
  128. package/dist/chunks/activities3.mjs +0 -75
  129. package/dist/chunks/add-user.mjs +0 -38
  130. package/dist/chunks/add.mjs +0 -63
  131. package/dist/chunks/add2.mjs +0 -39
  132. package/dist/chunks/api.mjs +0 -174
  133. package/dist/chunks/attachments.mjs +0 -47
  134. package/dist/chunks/attachments2.mjs +0 -47
  135. package/dist/chunks/attachments3.mjs +0 -48
  136. package/dist/chunks/browse.mjs +0 -269
  137. package/dist/chunks/clone.mjs +0 -60
  138. package/dist/chunks/close.mjs +0 -50
  139. package/dist/chunks/comment.mjs +0 -125
  140. package/dist/chunks/comment2.mjs +0 -111
  141. package/dist/chunks/comments.mjs +0 -57
  142. package/dist/chunks/completion.mjs +0 -113
  143. package/dist/chunks/count.mjs +0 -68
  144. package/dist/chunks/count2.mjs +0 -69
  145. package/dist/chunks/count3.mjs +0 -59
  146. package/dist/chunks/count4.mjs +0 -35
  147. package/dist/chunks/count5.mjs +0 -52
  148. package/dist/chunks/create.mjs +0 -60
  149. package/dist/chunks/create2.mjs +0 -88
  150. package/dist/chunks/create3.mjs +0 -64
  151. package/dist/chunks/create4.mjs +0 -74
  152. package/dist/chunks/create5.mjs +0 -56
  153. package/dist/chunks/create6.mjs +0 -37
  154. package/dist/chunks/create7.mjs +0 -45
  155. package/dist/chunks/create8.mjs +0 -49
  156. package/dist/chunks/create9.mjs +0 -49
  157. package/dist/chunks/dashboard.mjs +0 -84
  158. package/dist/chunks/delete.mjs +0 -48
  159. package/dist/chunks/delete2.mjs +0 -46
  160. package/dist/chunks/delete3.mjs +0 -46
  161. package/dist/chunks/delete4.mjs +0 -49
  162. package/dist/chunks/delete5.mjs +0 -50
  163. package/dist/chunks/delete6.mjs +0 -50
  164. package/dist/chunks/delete7.mjs +0 -62
  165. package/dist/chunks/delete8.mjs +0 -53
  166. package/dist/chunks/delete9.mjs +0 -48
  167. package/dist/chunks/edit.mjs +0 -56
  168. package/dist/chunks/edit2.mjs +0 -78
  169. package/dist/chunks/edit3.mjs +0 -65
  170. package/dist/chunks/edit4.mjs +0 -51
  171. package/dist/chunks/edit5.mjs +0 -43
  172. package/dist/chunks/edit6.mjs +0 -54
  173. package/dist/chunks/edit7.mjs +0 -50
  174. package/dist/chunks/edit8.mjs +0 -50
  175. package/dist/chunks/history.mjs +0 -56
  176. package/dist/chunks/index.mjs +0 -15
  177. package/dist/chunks/index10.mjs +0 -18
  178. package/dist/chunks/index11.mjs +0 -13
  179. package/dist/chunks/index12.mjs +0 -13
  180. package/dist/chunks/index13.mjs +0 -13
  181. package/dist/chunks/index14.mjs +0 -8
  182. package/dist/chunks/index15.mjs +0 -13
  183. package/dist/chunks/index16.mjs +0 -13
  184. package/dist/chunks/index17.mjs +0 -14
  185. package/dist/chunks/index2.mjs +0 -18
  186. package/dist/chunks/index3.mjs +0 -20
  187. package/dist/chunks/index4.mjs +0 -15
  188. package/dist/chunks/index5.mjs +0 -13
  189. package/dist/chunks/index6.mjs +0 -17
  190. package/dist/chunks/index7.mjs +0 -8
  191. package/dist/chunks/index8.mjs +0 -8
  192. package/dist/chunks/index9.mjs +0 -13
  193. package/dist/chunks/list.mjs +0 -52
  194. package/dist/chunks/list10.mjs +0 -44
  195. package/dist/chunks/list11.mjs +0 -49
  196. package/dist/chunks/list12.mjs +0 -45
  197. package/dist/chunks/list13.mjs +0 -45
  198. package/dist/chunks/list14.mjs +0 -54
  199. package/dist/chunks/list15.mjs +0 -46
  200. package/dist/chunks/list2.mjs +0 -103
  201. package/dist/chunks/list3.mjs +0 -85
  202. package/dist/chunks/list4.mjs +0 -79
  203. package/dist/chunks/list5.mjs +0 -77
  204. package/dist/chunks/list6.mjs +0 -45
  205. package/dist/chunks/list7.mjs +0 -48
  206. package/dist/chunks/list8.mjs +0 -46
  207. package/dist/chunks/list9.mjs +0 -53
  208. package/dist/chunks/login.mjs +0 -218
  209. package/dist/chunks/logout.mjs +0 -76
  210. package/dist/chunks/me.mjs +0 -48
  211. package/dist/chunks/read-all.mjs +0 -29
  212. package/dist/chunks/read.mjs +0 -29
  213. package/dist/chunks/read2.mjs +0 -27
  214. package/dist/chunks/refresh.mjs +0 -76
  215. package/dist/chunks/remove-user.mjs +0 -38
  216. package/dist/chunks/remove.mjs +0 -27
  217. package/dist/chunks/reopen.mjs +0 -42
  218. package/dist/chunks/status.mjs +0 -64
  219. package/dist/chunks/status2.mjs +0 -61
  220. package/dist/chunks/status3.mjs +0 -66
  221. package/dist/chunks/switch.mjs +0 -55
  222. package/dist/chunks/tags.mjs +0 -41
  223. package/dist/chunks/token.mjs +0 -42
  224. package/dist/chunks/tree.mjs +0 -61
  225. package/dist/chunks/users.mjs +0 -48
  226. package/dist/chunks/view.mjs +0 -58
  227. package/dist/chunks/view2.mjs +0 -95
  228. package/dist/chunks/view3.mjs +0 -68
  229. package/dist/chunks/view4.mjs +0 -70
  230. package/dist/chunks/view5.mjs +0 -61
  231. package/dist/chunks/view6.mjs +0 -52
  232. package/dist/chunks/view7.mjs +0 -48
  233. package/dist/chunks/view8.mjs +0 -61
  234. package/dist/chunks/view9.mjs +0 -48
  235. package/dist/shared/bee.084B_7FC.mjs +0 -27
  236. package/dist/shared/bee.BTBGpv4K.mjs +0 -34
  237. package/dist/shared/bee.BXiuAfjJ.mjs +0 -10
  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.CAARNIp6.mjs +0 -49
  242. package/dist/shared/bee.CirccSk2.mjs +0 -51
  243. package/dist/shared/bee.CktwmH8R.mjs +0 -25
  244. package/dist/shared/bee.CzKcWSES.mjs +0 -42
  245. package/dist/shared/bee.DFnSWb6q.mjs +0 -396
  246. package/dist/shared/bee.DoTvz3uW.mjs +0 -13
  247. package/dist/shared/bee.KteAW2rM.mjs +0 -73
  248. package/dist/shared/bee.RsR9yniy.mjs +0 -131
  249. package/dist/shared/bee.a05kNWpn.mjs +0 -32
  250. package/dist/shared/bee.n5MYN4a6.mjs +0 -12
  251. package/dist/shared/bee.q93n012-.mjs +0 -14
@@ -1,58 +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 { p as printDefinitionList } from '../shared/bee.C4p7W8_P.mjs';
7
- import { g as getClient } from '../shared/bee.RsR9yniy.mjs';
8
- import 'backlog-js';
9
- import 'node:http';
10
- import { p as projectUrl, o as openOrPrintUrl } from '../shared/bee.CzKcWSES.mjs';
11
- import 'node:child_process';
12
- import { B as BeeCommand, E as ENV_AUTH, a as ENV_PROJECT } from '../shared/bee.KteAW2rM.mjs';
13
- import { d as project, w as web, n as noBrowser, 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 'open';
18
- import 'node:module';
19
- import 'commander';
20
- import 'consola/utils';
21
- import '../shared/bee.DFnSWb6q.mjs';
22
- import '../shared/bee.CktwmH8R.mjs';
23
- import '../shared/bee.CAARNIp6.mjs';
24
-
25
- 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([
26
- { description: "View project details", command: "bee project view -p PROJECT_KEY" },
27
- { description: "Open project in browser", command: "bee project view -p PROJECT_KEY --web" },
28
- { description: "Output as JSON", command: "bee project view -p PROJECT_KEY --json" }
29
- ]).action(async (opts, cmd) => {
30
- await resolveOptions(cmd);
31
- const { client, host } = await getClient(opts.space);
32
- if (opts.web || opts.browser === false) {
33
- const url = projectUrl(host, opts.project);
34
- await openOrPrintUrl(url, opts.browser === false, consola);
35
- return;
36
- }
37
- const projectData = await client.getProject(opts.project);
38
- const jsonArg = opts.json === true ? "" : opts.json;
39
- outputResult(projectData, { ...opts, json: jsonArg }, (data) => {
40
- consola.log("");
41
- consola.log(` ${data.name} (${data.projectKey})`);
42
- consola.log("");
43
- printDefinitionList([
44
- ["Status", data.archived ? "Archived" : "Active"],
45
- ["Text Formatting", data.textFormattingRule],
46
- ["Chart", data.chartEnabled ? "Yes" : "No"],
47
- ["Subtasking", data.subtaskingEnabled ? "Yes" : "No"],
48
- ["Wiki", data.useWiki ? "Yes" : "No"],
49
- ["File Sharing", data.useFileSharing ? "Yes" : "No"],
50
- ["Git", data.useGit ? "Yes" : "No"],
51
- ["Subversion", data.useSubversion ? "Yes" : "No"],
52
- ["Dev Attributes", data.useDevAttributes ? "Yes" : "No"]
53
- ]);
54
- consola.log("");
55
- });
56
- });
57
-
58
- export { view as default };
@@ -1,95 +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 { f as formatDate } from '../shared/bee.n5MYN4a6.mjs';
7
- import { p as printDefinitionList } from '../shared/bee.C4p7W8_P.mjs';
8
- import { g as getClient } from '../shared/bee.RsR9yniy.mjs';
9
- import 'backlog-js';
10
- import 'node:http';
11
- import { o as openOrPrintUrl, i as issueUrl } from '../shared/bee.CzKcWSES.mjs';
12
- import 'node:child_process';
13
- import { B as BeeCommand, E as ENV_AUTH } from '../shared/bee.KteAW2rM.mjs';
14
- import { w as web, n as noBrowser, j as json, s as space } from '../shared/bee.CHtg3F43.mjs';
15
- import 'node:fs';
16
- import 'node:path';
17
- import 'node:os';
18
- import 'open';
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 formatHours = (hours) => hours === null || hours === void 0 ? void 0 : `${hours}h`;
27
- const view = new BeeCommand("view").summary("View an issue").description(`Use \`--comments\` to include comments. Use \`--web\` to open in the browser.`).argument("<issue>", "Issue ID or issue key").option("--comments", "Include comments").addOption(web("issue")).addOption(noBrowser()).addOption(json()).addOption(space()).envVars([...ENV_AUTH]).examples([
28
- { description: "View issue details", command: "bee issue view PROJECT-123" },
29
- { description: "View with comments", command: "bee issue view PROJECT-123 --comments" },
30
- { description: "Open issue in browser", command: "bee issue view PROJECT-123 --web" },
31
- { description: "Output as JSON", command: "bee issue view PROJECT-123 --json" }
32
- ]).action(async (issue, opts) => {
33
- const { client, host } = await getClient(opts.space);
34
- if (opts.web || opts.browser === false) {
35
- const url = issueUrl(host, issue);
36
- await openOrPrintUrl(url, opts.browser === false, consola);
37
- return;
38
- }
39
- const issueData = await client.getIssue(issue);
40
- const comments = opts.comments ? await client.getIssueComments(issue, { order: "asc" }) : [];
41
- outputResult(issueData, opts, (data) => {
42
- consola.log("");
43
- consola.log(` ${data.issueKey}: ${data.summary}`);
44
- consola.log("");
45
- printDefinitionList([
46
- ["Status", data.status.name],
47
- ["Type", data.issueType.name],
48
- ["Priority", data.priority.name],
49
- ["Assignee", data.assignee?.name ?? "Unassigned"],
50
- ["Created by", data.createdUser?.name ?? "Unknown"],
51
- ["Created", formatDate(data.created)],
52
- ["Updated", formatDate(data.updated)],
53
- ["Start Date", data.startDate ? formatDate(data.startDate) : void 0],
54
- ["Due Date", data.dueDate ? formatDate(data.dueDate) : void 0],
55
- ["Estimated", formatHours(data.estimatedHours)],
56
- ["Actual", formatHours(data.actualHours)],
57
- [
58
- "Categories",
59
- data.category.length > 0 ? data.category.map((c) => c.name).join(", ") : void 0
60
- ],
61
- [
62
- "Milestones",
63
- data.milestone.length > 0 ? data.milestone.map((m) => m.name).join(", ") : void 0
64
- ],
65
- [
66
- "Versions",
67
- data.versions && data.versions.length > 0 ? data.versions.map((v) => v.name).join(", ") : void 0
68
- ]
69
- ]);
70
- if (data.description) {
71
- consola.log("");
72
- consola.log(" Description:");
73
- consola.log(
74
- data.description.split("\n").map((line) => ` ${line}`).join("\n")
75
- );
76
- }
77
- if (comments.length > 0) {
78
- consola.log("");
79
- consola.log(" Comments:");
80
- for (const comment of comments) {
81
- if (!comment.content) {
82
- continue;
83
- }
84
- consola.log("");
85
- consola.log(` ${comment.createdUser.name} (${formatDate(comment.created)}):`);
86
- consola.log(
87
- comment.content.split("\n").map((line) => ` ${line}`).join("\n")
88
- );
89
- }
90
- }
91
- consola.log("");
92
- });
93
- });
94
-
95
- export { view as default };
@@ -1,68 +0,0 @@
1
- import consola from 'consola';
2
- import { o as outputResult } from '../shared/bee.BTBGpv4K.mjs';
3
- import { U as UserError } from '../index.mjs';
4
- import 'node:stream/consumers';
5
- import 'valibot';
6
- import { f as formatDate } from '../shared/bee.n5MYN4a6.mjs';
7
- import { p as printDefinitionList } from '../shared/bee.C4p7W8_P.mjs';
8
- import { g as getClient } from '../shared/bee.RsR9yniy.mjs';
9
- import 'backlog-js';
10
- import 'node:http';
11
- import { f as documentUrl, o as openOrPrintUrl } from '../shared/bee.CzKcWSES.mjs';
12
- import 'node:child_process';
13
- import { B as BeeCommand, E as ENV_AUTH, a as ENV_PROJECT } from '../shared/bee.KteAW2rM.mjs';
14
- import { p as projectOptional, w as web, n as noBrowser, j as json, s as space } from '../shared/bee.CHtg3F43.mjs';
15
- import 'node:fs';
16
- import 'node:path';
17
- import 'node:os';
18
- import 'open';
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 view = new BeeCommand("view").summary("View a document").description(`Use \`--web\` to open in the browser (\`--project\` is required for \`--web\`).`).argument("<document>", "Document ID").addOption(projectOptional("Project ID or project key (required for --web)")).addOption(web("document")).addOption(noBrowser()).addOption(json()).addOption(space()).envVars([...ENV_AUTH, ENV_PROJECT]).examples([
27
- { description: "View document details", command: "bee document view 12345" },
28
- {
29
- description: "Open document in browser",
30
- command: "bee document view 12345 --web -p PROJECT"
31
- },
32
- { description: "Output as JSON", command: "bee document view 12345 --json" }
33
- ]).action(async (document, opts) => {
34
- const { client, host } = await getClient(opts.space);
35
- if (opts.web || opts.browser === false) {
36
- if (!opts.project) {
37
- throw new UserError("The --project flag is required when using --web.");
38
- }
39
- const url = documentUrl(host, opts.project, document);
40
- await openOrPrintUrl(url, opts.browser === false, consola);
41
- return;
42
- }
43
- const doc = await client.getDocument(document);
44
- outputResult(doc, opts, (data) => {
45
- consola.log("");
46
- consola.log(` ${data.title}`);
47
- consola.log("");
48
- printDefinitionList([
49
- ["ID", data.id],
50
- ["Emoji", data.emoji ?? void 0],
51
- ["Tags", data.tags.length > 0 ? data.tags.map((t) => t.name).join(", ") : void 0],
52
- ["Created by", data.createdUser?.name ?? "Unknown"],
53
- ["Created", formatDate(data.created)],
54
- ["Updated by", data.updatedUser?.name ?? "Unknown"],
55
- ["Updated", formatDate(data.updated)]
56
- ]);
57
- if (data.plain) {
58
- consola.log("");
59
- consola.log(" Body:");
60
- consola.log(
61
- data.plain.split("\n").map((line) => ` ${line}`).join("\n")
62
- );
63
- }
64
- consola.log("");
65
- });
66
- });
67
-
68
- export { view as default };
@@ -1,70 +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 '../index.mjs';
6
- import { f as formatDate } from '../shared/bee.n5MYN4a6.mjs';
7
- import { p as printDefinitionList } from '../shared/bee.C4p7W8_P.mjs';
8
- import { g as getClient } from '../shared/bee.RsR9yniy.mjs';
9
- import 'backlog-js';
10
- import 'node:http';
11
- import { h as pullRequestUrl, o as openOrPrintUrl } from '../shared/bee.CzKcWSES.mjs';
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, w as web, n as noBrowser, 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 'open';
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 view = new BeeCommand("view").summary("View a pull request").description(`Use \`--web\` to open in the browser.`).argument("<number>", "Pull request number").addOption(project()).addOption(repo()).addOption(web("pull request")).addOption(noBrowser()).addOption(json()).addOption(space()).envVars([...ENV_AUTH, ENV_PROJECT, ENV_REPO]).examples([
27
- { description: "View pull request details", command: "bee pr view 42 -p PROJECT -R repo" },
28
- {
29
- description: "Open pull request in browser",
30
- command: "bee pr view 42 -p PROJECT -R repo --web"
31
- },
32
- { description: "Output as JSON", command: "bee pr view 42 -p PROJECT -R repo --json" }
33
- ]).action(async (number, opts, cmd) => {
34
- await resolveOptions(cmd);
35
- const { client, host } = await getClient(opts.space);
36
- const prNumber = parseArg(vInteger, number, "number");
37
- if (opts.web || opts.browser === false) {
38
- const url = pullRequestUrl(host, opts.project, opts.repo, prNumber);
39
- await openOrPrintUrl(url, opts.browser === false, consola);
40
- return;
41
- }
42
- const pullRequest = await client.getPullRequest(opts.project, opts.repo, prNumber);
43
- const json = opts.json === true ? "" : opts.json;
44
- outputResult(pullRequest, { json }, (data) => {
45
- consola.log("");
46
- consola.log(` #${data.number}: ${data.summary}`);
47
- consola.log("");
48
- printDefinitionList([
49
- ["Status", data.status.name],
50
- ["Base", data.base],
51
- ["Head", data.branch],
52
- ["Assignee", data.assignee?.name ?? "Unassigned"],
53
- ["Created by", data.createdUser?.name ?? "Unknown"],
54
- ["Created", formatDate(data.created)],
55
- ["Updated", formatDate(data.updated)],
56
- ["Merged at", data.mergeAt ? formatDate(data.mergeAt) : void 0],
57
- ["Closed at", data.closeAt ? formatDate(data.closeAt) : void 0]
58
- ]);
59
- if (data.description) {
60
- consola.log("");
61
- consola.log(" Description:");
62
- consola.log(
63
- data.description.split("\n").map((line) => ` ${line}`).join("\n")
64
- );
65
- }
66
- consola.log("");
67
- });
68
- });
69
-
70
- export { view as default };
@@ -1,61 +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 { f as formatDate } from '../shared/bee.n5MYN4a6.mjs';
7
- import { p as printDefinitionList } from '../shared/bee.C4p7W8_P.mjs';
8
- import { g as getClient } from '../shared/bee.RsR9yniy.mjs';
9
- import 'backlog-js';
10
- import 'node:http';
11
- import { r as repositoryUrl, o as openOrPrintUrl } from '../shared/bee.CzKcWSES.mjs';
12
- import 'node:child_process';
13
- import { B as BeeCommand, E as ENV_AUTH, a as ENV_PROJECT } from '../shared/bee.KteAW2rM.mjs';
14
- import { d as project, w as web, n as noBrowser, 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 'open';
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 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([
27
- {
28
- description: "View repository details",
29
- command: "bee repo view api-server -p PROJECT_KEY"
30
- },
31
- {
32
- description: "Open repository in browser",
33
- command: "bee repo view api-server -p PROJECT_KEY --web"
34
- },
35
- { description: "Output as JSON", command: "bee repo view api-server -p PROJECT_KEY --json" }
36
- ]).action(async (repository, opts, cmd) => {
37
- await resolveOptions(cmd);
38
- const { client, host } = await getClient(opts.space);
39
- if (opts.web || opts.browser === false) {
40
- const url = repositoryUrl(host, opts.project, repository);
41
- await openOrPrintUrl(url, opts.browser === false, consola);
42
- return;
43
- }
44
- const repo = await client.getGitRepository(opts.project, repository);
45
- outputResult(repo, opts, (data) => {
46
- consola.log("");
47
- consola.log(` ${data.name}`);
48
- consola.log("");
49
- printDefinitionList([
50
- ["Description", data.description ?? ""],
51
- ["HTTP URL", data.httpUrl],
52
- ["SSH URL", data.sshUrl],
53
- ["Created", formatDate(data.created)],
54
- ["Updated", formatDate(data.updated)],
55
- ["Last Pushed", data.pushedAt ? formatDate(data.pushedAt) : ""]
56
- ]);
57
- consola.log("");
58
- });
59
- });
60
-
61
- export { view as default };
@@ -1,52 +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 '../index.mjs';
6
- import { p as printDefinitionList } from '../shared/bee.C4p7W8_P.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 { 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.DFnSWb6q.mjs';
21
- import '../shared/bee.CktwmH8R.mjs';
22
- import '../shared/bee.CAARNIp6.mjs';
23
-
24
- 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([
25
- { description: "View team details", command: "bee team view 12345" },
26
- { description: "Output as JSON", command: "bee team view 12345 --json" }
27
- ]).action(async (team, opts) => {
28
- const { client } = await getClient(opts.space);
29
- const t = await client.getTeam(parseArg(vInteger, team, "team"));
30
- outputResult(t, opts, (data) => {
31
- consola.log("");
32
- consola.log(` ${data.name}`);
33
- consola.log("");
34
- printDefinitionList([
35
- ["ID", String(data.id)],
36
- ["Created by", data.createdUser?.name ?? "\u2014"],
37
- ["Created", data.created],
38
- ["Updated", data.updated],
39
- ["Members", String(data.members.length)]
40
- ]);
41
- if (data.members.length > 0) {
42
- consola.log("");
43
- consola.log(" Members:");
44
- for (const member of data.members) {
45
- consola.log(` - ${member.name} (${member.userId ?? member.id})`);
46
- }
47
- }
48
- consola.log("");
49
- });
50
- });
51
-
52
- export { view as default };
@@ -1,48 +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 '../index.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.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 { j as json, s as space } from '../shared/bee.CHtg3F43.mjs';
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 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([
27
- { description: "View user details", command: "bee user view 12345" },
28
- { description: "Output as JSON", command: "bee user view 12345 --json" }
29
- ]).action(async (user, opts) => {
30
- const { client } = await getClient(opts.space);
31
- const userData = await client.getUser(parseArg(vInteger, user, "user"));
32
- outputResult(userData, opts, (data) => {
33
- consola.log("");
34
- consola.log(` ${data.name}`);
35
- consola.log("");
36
- printDefinitionList([
37
- ["ID", String(data.id)],
38
- ["User ID", data.userId],
39
- ["Email", data.mailAddress],
40
- ["Role", ROLE_LABELS[data.roleType] ?? `Unknown (${data.roleType})`],
41
- ["Language", data.lang],
42
- ["Last Login", data.lastLoginTime ? formatDate(data.lastLoginTime) : void 0]
43
- ]);
44
- consola.log("");
45
- });
46
- });
47
-
48
- export { view as default };
@@ -1,61 +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 '../index.mjs';
6
- import { f as formatDate } from '../shared/bee.n5MYN4a6.mjs';
7
- import { p as printDefinitionList } from '../shared/bee.C4p7W8_P.mjs';
8
- import { g as getClient } from '../shared/bee.RsR9yniy.mjs';
9
- import 'backlog-js';
10
- import 'node:http';
11
- import { w as wikiUrl, o as openOrPrintUrl } from '../shared/bee.CzKcWSES.mjs';
12
- import 'node:child_process';
13
- import { B as BeeCommand, E as ENV_AUTH } from '../shared/bee.KteAW2rM.mjs';
14
- import { w as web, n as noBrowser, j as json, s as space } from '../shared/bee.CHtg3F43.mjs';
15
- import 'node:fs';
16
- import 'node:path';
17
- import 'node:os';
18
- import 'open';
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 view = new BeeCommand("view").summary("View a wiki page").description(`Use \`--web\` to open in the browser.`).argument("<wiki>", "Wiki page ID").addOption(web("wiki page")).addOption(noBrowser()).addOption(json()).addOption(space()).envVars([...ENV_AUTH]).examples([
27
- { description: "View a wiki page", command: "bee wiki view 12345" },
28
- { description: "Open wiki page in browser", command: "bee wiki view 12345 --web" },
29
- { description: "Output as JSON", command: "bee wiki view 12345 --json" }
30
- ]).action(async (wiki, opts) => {
31
- const { client, host } = await getClient(opts.space);
32
- if (opts.web || opts.browser === false) {
33
- const url = wikiUrl(host, parseArg(vInteger, wiki, "wiki"));
34
- await openOrPrintUrl(url, opts.browser === false, consola);
35
- return;
36
- }
37
- const wikiData = await client.getWiki(parseArg(vInteger, wiki, "wiki"));
38
- outputResult(wikiData, opts, (data) => {
39
- consola.log("");
40
- consola.log(` ${data.name}`);
41
- consola.log("");
42
- printDefinitionList([
43
- ["ID", String(data.id)],
44
- [
45
- "Tags",
46
- data.tags.length > 0 ? data.tags.map((t) => t.name).join(", ") : void 0
47
- ],
48
- ["Created by", data.createdUser?.name],
49
- ["Created", formatDate(data.created)],
50
- ["Updated by", data.updatedUser?.name],
51
- ["Updated", formatDate(data.updated)]
52
- ]);
53
- if (data.content) {
54
- consola.log("");
55
- consola.log(` ${data.content}`);
56
- }
57
- consola.log("");
58
- });
59
- });
60
-
61
- export { view as default };
@@ -1,48 +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 '../index.mjs';
6
- import { f as formatDate } from '../shared/bee.n5MYN4a6.mjs';
7
- import { p as printDefinitionList } from '../shared/bee.C4p7W8_P.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 } from '../shared/bee.KteAW2rM.mjs';
14
- import { j as json, s as space } 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.DFnSWb6q.mjs';
22
- import '../shared/bee.CktwmH8R.mjs';
23
- import '../shared/bee.CAARNIp6.mjs';
24
-
25
- 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([
26
- { description: "View a watching item", command: "bee watching view 12345" },
27
- { description: "Output as JSON", command: "bee watching view 12345 --json" }
28
- ]).action(async (watching, opts) => {
29
- const { client } = await getClient(opts.space);
30
- const watchingData = await client.getWatchingListItem(parseArg(vInteger, watching, "watching"));
31
- outputResult(watchingData, opts, (data) => {
32
- consola.log("");
33
- consola.log(` ${data.issue.issueKey}: ${data.issue.summary}`);
34
- consola.log("");
35
- printDefinitionList([
36
- ["ID", String(data.id)],
37
- ["Issue Key", data.issue.issueKey],
38
- ["Title", data.issue.summary],
39
- ["Note", data.note || void 0],
40
- ["Read", data.resourceAlreadyRead ? "Read" : "Unread"],
41
- ["Created", formatDate(data.created)],
42
- ["Updated", formatDate(data.updated)]
43
- ]);
44
- consola.log("");
45
- });
46
- });
47
-
48
- export { view as default };
@@ -1,27 +0,0 @@
1
- import 'consola';
2
- import 'node:stream/consumers';
3
- import * as v from 'valibot';
4
- import { v as vInteger } from '../index.mjs';
5
-
6
- const resolveProjectIds = async (client, values) => {
7
- if (values.length === 0) {
8
- return [];
9
- }
10
- const projects = await client.getProjects();
11
- return values.map((value) => {
12
- const numResult = v.safeParse(vInteger, value);
13
- if (numResult.success) {
14
- const byId = projects.find((p) => p.id === numResult.output);
15
- if (byId) {
16
- return byId.id;
17
- }
18
- }
19
- const byKey = projects.find((p) => p.projectKey === value);
20
- if (byKey) {
21
- return byKey.id;
22
- }
23
- throw new Error(`Project not found: "${value}"`);
24
- });
25
- };
26
-
27
- export { resolveProjectIds as r };
@@ -1,34 +0,0 @@
1
- const isRecord = (value) => typeof value === "object" && value !== null;
2
- const pickFields = (obj, fields) => {
3
- if (!isRecord(obj)) {
4
- return {};
5
- }
6
- const result = {};
7
- for (const field of fields) {
8
- if (field in obj) {
9
- result[field] = obj[field];
10
- }
11
- }
12
- return result;
13
- };
14
- const filterFields = (data, fields) => {
15
- if (Array.isArray(data)) {
16
- return data.map((item) => pickFields(item, fields));
17
- }
18
- return pickFields(data, fields);
19
- };
20
- const outputResult = (data, args, defaultFormat) => {
21
- if (args.json === void 0) {
22
- defaultFormat(data);
23
- return;
24
- }
25
- const output = args.json ? filterFields(
26
- data,
27
- args.json.split(",").map((f) => f.trim())
28
- ) : data;
29
- const json = process.stdout.isTTY ? JSON.stringify(output, null, 2) : JSON.stringify(output);
30
- process.stdout.write(`${json}
31
- `);
32
- };
33
-
34
- export { outputResult as o };
@@ -1,10 +0,0 @@
1
- const ROLE_LABELS = {
2
- 1: "Administrator",
3
- 2: "Normal User",
4
- 3: "Reporter",
5
- 4: "Viewer",
6
- 5: "Guest Reporter",
7
- 6: "Guest Viewer"
8
- };
9
-
10
- export { ROLE_LABELS as R };
@@ -1,19 +0,0 @@
1
- const IssueStatusId = {
2
- Open: 1,
3
- Closed: 4
4
- };
5
- const ResolutionId = {
6
- fixed: 0,
7
- "wont-fix": 1,
8
- invalid: 2,
9
- duplicate: 3,
10
- "cannot-reproduce": 4
11
- };
12
- const PriorityId = {
13
- high: 2,
14
- normal: 3,
15
- low: 4
16
- };
17
- const PRIORITY_NAMES = Object.keys(PriorityId);
18
-
19
- export { IssueStatusId as I, PriorityId as P, ResolutionId as R, PRIORITY_NAMES as a };