@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.
- package/dist/activities-BPTHt_MD.mjs +69 -0
- package/dist/activities-CRiEq51-.mjs +72 -0
- package/dist/activities-DyOMqdsM.mjs +69 -0
- package/dist/activity-labels-CLFpxp8o.mjs +34 -0
- package/dist/add-Br-_TLRp.mjs +55 -0
- package/dist/add-CTmmy2t9.mjs +26 -0
- package/dist/add-user-BVWFcbH7.mjs +26 -0
- package/dist/api-kJR0fRPw.mjs +143 -0
- package/dist/attachments-CnL8t9tK.mjs +50 -0
- package/dist/attachments-D8IoJjYE.mjs +50 -0
- package/dist/attachments-DfgEkAY2.mjs +46 -0
- package/dist/auth-5TJGBPxi.mjs +13 -0
- package/dist/bee-command-v0qvZeth.mjs +57 -0
- package/dist/browse-vgF6nz7X.mjs +304 -0
- package/dist/category-BZ7XdVgx.mjs +11 -0
- package/dist/clone-DAWVtVbZ.mjs +43 -0
- package/dist/close-cTyZPv77.mjs +37 -0
- package/dist/comment-CkYJYFrF.mjs +115 -0
- package/dist/comment-DzRBQNv8.mjs +102 -0
- package/dist/comments-SnOZ-EUJ.mjs +47 -0
- package/dist/common-options-BuYWxYdO.mjs +45 -0
- package/dist/completion-yfcnEl7k.mjs +113 -0
- package/dist/count-BI7ld4k5.mjs +50 -0
- package/dist/count-Bw0mVlxC.mjs +40 -0
- package/dist/count-CH_LN4k6.mjs +51 -0
- package/dist/count-CHzDiMV3.mjs +25 -0
- package/dist/count-DvmYzPD_.mjs +46 -0
- package/dist/create-BHjwacOk.mjs +47 -0
- package/dist/create-BXWATibN.mjs +41 -0
- package/dist/create-BtLVFmbR.mjs +29 -0
- package/dist/create-CoF2bahH.mjs +29 -0
- package/dist/create-DhAOhro9.mjs +60 -0
- package/dist/create-DtMLv7Wq.mjs +26 -0
- package/dist/create-PtahSFdG.mjs +66 -0
- package/dist/create-Y4vo2zwX.mjs +44 -0
- package/dist/create-vwRKZ3Lm.mjs +31 -0
- package/dist/dashboard-CYYU5Yii.mjs +97 -0
- package/dist/delete-BCAPHs-g.mjs +25 -0
- package/dist/delete-BHNt5SWa.mjs +24 -0
- package/dist/delete-BlmanW0H.mjs +25 -0
- package/dist/delete-Bxk14ntp.mjs +24 -0
- package/dist/delete-C05oMZEW.mjs +24 -0
- package/dist/delete-CMwkcSiA.mjs +25 -0
- package/dist/delete-CTeH7nzL.mjs +29 -0
- package/dist/delete-D2yDBhZc.mjs +24 -0
- package/dist/delete-HMOfvtv3.mjs +25 -0
- package/dist/document-CiIzSyoS.mjs +13 -0
- package/dist/edit-BBvSbt0m.mjs +22 -0
- package/dist/edit-CN1gdpjd.mjs +37 -0
- package/dist/edit-C_KbKopB.mjs +36 -0
- package/dist/edit-D5Z45NVj.mjs +27 -0
- package/dist/edit-DKQw-XXP.mjs +27 -0
- package/dist/edit-DRxr4r-r.mjs +60 -0
- package/dist/edit-DxsP-aPX.mjs +43 -0
- package/dist/edit-Otc7XHU7.mjs +52 -0
- package/dist/format-DHAR0n3J.mjs +9 -0
- package/dist/history-DpjqxFkX.mjs +55 -0
- package/dist/index.mjs +33 -37918
- package/dist/issue-BRzJy3k1.mjs +18 -0
- package/dist/issue-type-Byzh4yLx.mjs +11 -0
- package/dist/list-B3A5SDEm.mjs +35 -0
- package/dist/list-BMKaJoe_.mjs +64 -0
- package/dist/list-BOMbpS4m.mjs +46 -0
- package/dist/list-BmZ_JbLB.mjs +104 -0
- package/dist/list-BpUUxxwQ.mjs +46 -0
- package/dist/list-CgIebllW.mjs +94 -0
- package/dist/list-D0Z__0nw.mjs +42 -0
- package/dist/list-D3FkO9gb.mjs +56 -0
- package/dist/list-D7WLdHvX.mjs +42 -0
- package/dist/list-DAr3urtu.mjs +53 -0
- package/dist/list-DqpWd9aR.mjs +59 -0
- package/dist/list-VO_PbRjC.mjs +50 -0
- package/dist/list-b6ByzUFt.mjs +79 -0
- package/dist/list-jpQ28gU2.mjs +56 -0
- package/dist/list-y93EXyDj.mjs +42 -0
- package/dist/login-BnJYzdR3.mjs +228 -0
- package/dist/logout-YMnSRLLF.mjs +56 -0
- package/dist/me-CLPAe7X2.mjs +36 -0
- package/dist/milestone-Dc3alfp9.mjs +11 -0
- package/dist/notification-CsOuC8Uk.mjs +11 -0
- package/dist/output-DBvfyU1J.mjs +39 -0
- package/dist/pr-BBe07JUp.mjs +15 -0
- package/dist/project-Dilo1T5e.mjs +16 -0
- package/dist/read-BS2G4sNq.mjs +17 -0
- package/dist/read-CyCASx6U.mjs +17 -0
- package/dist/read-all-CjgMJ2to.mjs +16 -0
- package/dist/refresh-DDU2ZLnc.mjs +54 -0
- package/dist/registry-B0ZQfBD5.mjs +35 -0
- package/dist/registry-RATsKPUm.mjs +2 -0
- package/dist/remove-BSDJvkVJ.mjs +17 -0
- package/dist/remove-user-CShNCvf8.mjs +26 -0
- package/dist/reopen-BIRhcmsI.mjs +28 -0
- package/dist/repo-B2K8y0mD.mjs +10 -0
- package/dist/role-labels-CLA2wmjO.mjs +11 -0
- package/dist/space-BgZeUqoH.mjs +6 -0
- package/dist/{shared/bee.CHtg3F43.mjs → src-BWaxjrq_.mjs} +143 -175
- package/dist/src-CP4YLIAh.mjs +1008 -0
- package/dist/src-CTD9-bSB.mjs +22760 -0
- package/dist/star-Sgb-e2CQ.mjs +11 -0
- package/dist/status-BkFMW8Jh.mjs +53 -0
- package/dist/status-CaGqMXh7.mjs +64 -0
- package/dist/status-DDFyQrRZ.mjs +11 -0
- package/dist/status-nI4Dpcoo.mjs +58 -0
- package/dist/stdin-C-vjNi9T.mjs +17 -0
- package/dist/switch-CMLfVGDN.mjs +34 -0
- package/dist/tags-DuMJZyBL.mjs +29 -0
- package/dist/team-DfQn8Tf5.mjs +6 -0
- package/dist/token-BmkUX9vc.mjs +28 -0
- package/dist/tree-CozBqPbN.mjs +46 -0
- package/dist/user-DMyFmoP3.mjs +11 -0
- package/dist/users-BSGqsGSy.mjs +51 -0
- package/dist/view-Bj99sk7O.mjs +48 -0
- package/dist/view-Bs8o0c7i.mjs +36 -0
- package/dist/view-C1ECwTMN.mjs +54 -0
- package/dist/view-COBYBfu7.mjs +38 -0
- package/dist/view-CZHT-HiE.mjs +36 -0
- package/dist/view-D1RuQJV6.mjs +76 -0
- package/dist/view-DBO75WzR.mjs +54 -0
- package/dist/view-DJHrnN8j.mjs +62 -0
- package/dist/view-DLx6qQt9.mjs +51 -0
- package/dist/watching-D22YYxOT.mjs +12 -0
- package/dist/wiki-B-DQUuIX.mjs +16 -0
- package/package.json +13 -10
- package/dist/chunks/activities.mjs +0 -75
- package/dist/chunks/activities2.mjs +0 -75
- package/dist/chunks/activities3.mjs +0 -75
- package/dist/chunks/add-user.mjs +0 -38
- package/dist/chunks/add.mjs +0 -63
- package/dist/chunks/add2.mjs +0 -39
- package/dist/chunks/api.mjs +0 -174
- package/dist/chunks/attachments.mjs +0 -47
- package/dist/chunks/attachments2.mjs +0 -47
- package/dist/chunks/attachments3.mjs +0 -48
- package/dist/chunks/browse.mjs +0 -269
- package/dist/chunks/clone.mjs +0 -60
- package/dist/chunks/close.mjs +0 -50
- package/dist/chunks/comment.mjs +0 -125
- package/dist/chunks/comment2.mjs +0 -111
- package/dist/chunks/comments.mjs +0 -57
- package/dist/chunks/completion.mjs +0 -113
- package/dist/chunks/count.mjs +0 -68
- package/dist/chunks/count2.mjs +0 -69
- package/dist/chunks/count3.mjs +0 -59
- package/dist/chunks/count4.mjs +0 -35
- package/dist/chunks/count5.mjs +0 -52
- package/dist/chunks/create.mjs +0 -60
- package/dist/chunks/create2.mjs +0 -88
- package/dist/chunks/create3.mjs +0 -64
- package/dist/chunks/create4.mjs +0 -74
- package/dist/chunks/create5.mjs +0 -56
- package/dist/chunks/create6.mjs +0 -37
- package/dist/chunks/create7.mjs +0 -45
- package/dist/chunks/create8.mjs +0 -49
- package/dist/chunks/create9.mjs +0 -49
- package/dist/chunks/dashboard.mjs +0 -84
- package/dist/chunks/delete.mjs +0 -48
- package/dist/chunks/delete2.mjs +0 -46
- package/dist/chunks/delete3.mjs +0 -46
- package/dist/chunks/delete4.mjs +0 -49
- package/dist/chunks/delete5.mjs +0 -50
- package/dist/chunks/delete6.mjs +0 -50
- package/dist/chunks/delete7.mjs +0 -62
- package/dist/chunks/delete8.mjs +0 -53
- package/dist/chunks/delete9.mjs +0 -48
- package/dist/chunks/edit.mjs +0 -56
- package/dist/chunks/edit2.mjs +0 -78
- package/dist/chunks/edit3.mjs +0 -65
- package/dist/chunks/edit4.mjs +0 -51
- package/dist/chunks/edit5.mjs +0 -43
- package/dist/chunks/edit6.mjs +0 -54
- package/dist/chunks/edit7.mjs +0 -50
- package/dist/chunks/edit8.mjs +0 -50
- package/dist/chunks/history.mjs +0 -56
- package/dist/chunks/index.mjs +0 -15
- package/dist/chunks/index10.mjs +0 -18
- package/dist/chunks/index11.mjs +0 -13
- package/dist/chunks/index12.mjs +0 -13
- package/dist/chunks/index13.mjs +0 -13
- package/dist/chunks/index14.mjs +0 -8
- package/dist/chunks/index15.mjs +0 -13
- package/dist/chunks/index16.mjs +0 -13
- package/dist/chunks/index17.mjs +0 -14
- package/dist/chunks/index2.mjs +0 -18
- package/dist/chunks/index3.mjs +0 -20
- package/dist/chunks/index4.mjs +0 -15
- package/dist/chunks/index5.mjs +0 -13
- package/dist/chunks/index6.mjs +0 -17
- package/dist/chunks/index7.mjs +0 -8
- package/dist/chunks/index8.mjs +0 -8
- package/dist/chunks/index9.mjs +0 -13
- package/dist/chunks/list.mjs +0 -52
- package/dist/chunks/list10.mjs +0 -44
- package/dist/chunks/list11.mjs +0 -49
- package/dist/chunks/list12.mjs +0 -45
- package/dist/chunks/list13.mjs +0 -45
- package/dist/chunks/list14.mjs +0 -54
- package/dist/chunks/list15.mjs +0 -46
- package/dist/chunks/list2.mjs +0 -103
- package/dist/chunks/list3.mjs +0 -85
- package/dist/chunks/list4.mjs +0 -79
- package/dist/chunks/list5.mjs +0 -77
- package/dist/chunks/list6.mjs +0 -45
- package/dist/chunks/list7.mjs +0 -48
- package/dist/chunks/list8.mjs +0 -46
- package/dist/chunks/list9.mjs +0 -53
- package/dist/chunks/login.mjs +0 -218
- package/dist/chunks/logout.mjs +0 -76
- package/dist/chunks/me.mjs +0 -48
- package/dist/chunks/read-all.mjs +0 -29
- package/dist/chunks/read.mjs +0 -29
- package/dist/chunks/read2.mjs +0 -27
- package/dist/chunks/refresh.mjs +0 -76
- package/dist/chunks/remove-user.mjs +0 -38
- package/dist/chunks/remove.mjs +0 -27
- package/dist/chunks/reopen.mjs +0 -42
- package/dist/chunks/status.mjs +0 -64
- package/dist/chunks/status2.mjs +0 -61
- package/dist/chunks/status3.mjs +0 -66
- package/dist/chunks/switch.mjs +0 -55
- package/dist/chunks/tags.mjs +0 -41
- package/dist/chunks/token.mjs +0 -42
- package/dist/chunks/tree.mjs +0 -61
- package/dist/chunks/users.mjs +0 -48
- package/dist/chunks/view.mjs +0 -58
- package/dist/chunks/view2.mjs +0 -95
- package/dist/chunks/view3.mjs +0 -68
- package/dist/chunks/view4.mjs +0 -70
- package/dist/chunks/view5.mjs +0 -61
- package/dist/chunks/view6.mjs +0 -52
- package/dist/chunks/view7.mjs +0 -48
- package/dist/chunks/view8.mjs +0 -61
- package/dist/chunks/view9.mjs +0 -48
- package/dist/shared/bee.084B_7FC.mjs +0 -27
- package/dist/shared/bee.BTBGpv4K.mjs +0 -34
- package/dist/shared/bee.BXiuAfjJ.mjs +0 -10
- package/dist/shared/bee.Btmq3TXs.mjs +0 -19
- package/dist/shared/bee.C--ZWPxf.mjs +0 -14
- package/dist/shared/bee.C4p7W8_P.mjs +0 -18
- package/dist/shared/bee.CAARNIp6.mjs +0 -49
- package/dist/shared/bee.CirccSk2.mjs +0 -51
- package/dist/shared/bee.CktwmH8R.mjs +0 -25
- package/dist/shared/bee.CzKcWSES.mjs +0 -42
- package/dist/shared/bee.DFnSWb6q.mjs +0 -396
- package/dist/shared/bee.DoTvz3uW.mjs +0 -13
- package/dist/shared/bee.KteAW2rM.mjs +0 -73
- package/dist/shared/bee.RsR9yniy.mjs +0 -131
- package/dist/shared/bee.a05kNWpn.mjs +0 -32
- package/dist/shared/bee.n5MYN4a6.mjs +0 -12
- package/dist/shared/bee.q93n012-.mjs +0 -14
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { f as openOrPrintUrl, u as issueUrl, 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, t as BeeCommand } from "./bee-command-v0qvZeth.mjs";
|
|
6
|
+
import { S as space, h as noBrowser, u as json, w as web } from "./common-options-BuYWxYdO.mjs";
|
|
7
|
+
import consola from "consola";
|
|
8
|
+
import { getIssue, getIssueComments } from "backlog-js";
|
|
9
|
+
//#region src/commands/issue/view.ts
|
|
10
|
+
const formatHours = (hours) => hours === null || hours === void 0 ? void 0 : `${hours}h`;
|
|
11
|
+
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([
|
|
12
|
+
{
|
|
13
|
+
description: "View issue details",
|
|
14
|
+
command: "bee issue view PROJECT-123"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
description: "View with comments",
|
|
18
|
+
command: "bee issue view PROJECT-123 --comments"
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
description: "Open issue in browser",
|
|
22
|
+
command: "bee issue view PROJECT-123 --web"
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
description: "Output as JSON",
|
|
26
|
+
command: "bee issue view PROJECT-123 --json"
|
|
27
|
+
}
|
|
28
|
+
]).action(async (issue, opts) => {
|
|
29
|
+
const { client, host } = await getClient(opts.space);
|
|
30
|
+
if (opts.web || opts.browser === false) {
|
|
31
|
+
const url = issueUrl(host, issue);
|
|
32
|
+
await openOrPrintUrl(url, opts.browser === false, consola);
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
const issueData = await getIssue(client, issue);
|
|
36
|
+
const comments = opts.comments ? await getIssueComments(client, issue, { order: "asc" }) : [];
|
|
37
|
+
outputResult(issueData, opts, (data) => {
|
|
38
|
+
consola.log("");
|
|
39
|
+
consola.log(` ${data.issueKey}: ${data.summary}`);
|
|
40
|
+
consola.log("");
|
|
41
|
+
printDefinitionList([
|
|
42
|
+
["Status", data.status.name],
|
|
43
|
+
["Type", data.issueType.name],
|
|
44
|
+
["Priority", data.priority.name],
|
|
45
|
+
["Assignee", data.assignee?.name ?? "Unassigned"],
|
|
46
|
+
["Created by", data.createdUser?.name ?? "Unknown"],
|
|
47
|
+
["Created", formatDate(data.created)],
|
|
48
|
+
["Updated", formatDate(data.updated)],
|
|
49
|
+
["Start Date", data.startDate ? formatDate(data.startDate) : void 0],
|
|
50
|
+
["Due Date", data.dueDate ? formatDate(data.dueDate) : void 0],
|
|
51
|
+
["Estimated", formatHours(data.estimatedHours)],
|
|
52
|
+
["Actual", formatHours(data.actualHours)],
|
|
53
|
+
["Categories", data.category.length > 0 ? data.category.map((c) => c.name).join(", ") : void 0],
|
|
54
|
+
["Milestones", data.milestone.length > 0 ? data.milestone.map((m) => m.name).join(", ") : void 0],
|
|
55
|
+
["Versions", data.versions && data.versions.length > 0 ? data.versions.map((v) => v.name).join(", ") : void 0]
|
|
56
|
+
]);
|
|
57
|
+
if (data.description) {
|
|
58
|
+
consola.log("");
|
|
59
|
+
consola.log(" Description:");
|
|
60
|
+
consola.log(data.description.split("\n").map((line) => ` ${line}`).join("\n"));
|
|
61
|
+
}
|
|
62
|
+
if (comments.length > 0) {
|
|
63
|
+
consola.log("");
|
|
64
|
+
consola.log(" Comments:");
|
|
65
|
+
for (const comment of comments) {
|
|
66
|
+
if (!comment.content) continue;
|
|
67
|
+
consola.log("");
|
|
68
|
+
consola.log(` ${comment.createdUser.name} (${formatDate(comment.created)}):`);
|
|
69
|
+
consola.log(comment.content.split("\n").map((line) => ` ${line}`).join("\n"));
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
consola.log("");
|
|
73
|
+
});
|
|
74
|
+
});
|
|
75
|
+
//#endregion
|
|
76
|
+
export { view as default };
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { a as documentUrl, f as openOrPrintUrl, y as getClient } from "./src-CTD9-bSB.mjs";
|
|
2
|
+
import { t as outputResult } from "./output-DBvfyU1J.mjs";
|
|
3
|
+
import { n as printDefinitionList, u as UserError } 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 { S as space, b as projectOptional, h as noBrowser, u as json, w as web } from "./common-options-BuYWxYdO.mjs";
|
|
7
|
+
import consola from "consola";
|
|
8
|
+
import { getDocument } from "backlog-js";
|
|
9
|
+
//#region src/commands/document/view.ts
|
|
10
|
+
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([
|
|
11
|
+
{
|
|
12
|
+
description: "View document details",
|
|
13
|
+
command: "bee document view 12345"
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
description: "Open document in browser",
|
|
17
|
+
command: "bee document view 12345 --web -p PROJECT"
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
description: "Output as JSON",
|
|
21
|
+
command: "bee document view 12345 --json"
|
|
22
|
+
}
|
|
23
|
+
]).action(async (document, opts) => {
|
|
24
|
+
const { client, host } = await getClient(opts.space);
|
|
25
|
+
if (opts.web || opts.browser === false) {
|
|
26
|
+
if (!opts.project) throw new UserError("The --project flag is required when using --web.");
|
|
27
|
+
const url = documentUrl(host, opts.project, document);
|
|
28
|
+
await openOrPrintUrl(url, opts.browser === false, consola);
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
const doc = await getDocument(client, document);
|
|
32
|
+
outputResult(doc, opts, (data) => {
|
|
33
|
+
consola.log("");
|
|
34
|
+
consola.log(` ${data.title}`);
|
|
35
|
+
consola.log("");
|
|
36
|
+
printDefinitionList([
|
|
37
|
+
["ID", data.id],
|
|
38
|
+
["Emoji", data.emoji ?? void 0],
|
|
39
|
+
["Tags", data.tags.length > 0 ? data.tags.map((t) => t.name).join(", ") : void 0],
|
|
40
|
+
["Created by", data.createdUser?.name ?? "Unknown"],
|
|
41
|
+
["Created", formatDate(data.created)],
|
|
42
|
+
["Updated by", data.updatedUser?.name ?? "Unknown"],
|
|
43
|
+
["Updated", formatDate(data.updated)]
|
|
44
|
+
]);
|
|
45
|
+
if (data.plain) {
|
|
46
|
+
consola.log("");
|
|
47
|
+
consola.log(" Body:");
|
|
48
|
+
consola.log(data.plain.split("\n").map((line) => ` ${line}`).join("\n"));
|
|
49
|
+
}
|
|
50
|
+
consola.log("");
|
|
51
|
+
});
|
|
52
|
+
});
|
|
53
|
+
//#endregion
|
|
54
|
+
export { view as default };
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { f as openOrPrintUrl, h as pullRequestUrl, 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 { i as ENV_REPO, 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, x as repo, y as project } from "./common-options-BuYWxYdO.mjs";
|
|
7
|
+
import consola from "consola";
|
|
8
|
+
import { getPullRequest } from "backlog-js";
|
|
9
|
+
//#region src/commands/pr/view.ts
|
|
10
|
+
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([
|
|
11
|
+
...ENV_AUTH,
|
|
12
|
+
ENV_PROJECT,
|
|
13
|
+
ENV_REPO
|
|
14
|
+
]).examples([
|
|
15
|
+
{
|
|
16
|
+
description: "View pull request details",
|
|
17
|
+
command: "bee pr view 42 -p PROJECT -R repo"
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
description: "Open pull request in browser",
|
|
21
|
+
command: "bee pr view 42 -p PROJECT -R repo --web"
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
description: "Output as JSON",
|
|
25
|
+
command: "bee pr view 42 -p PROJECT -R repo --json"
|
|
26
|
+
}
|
|
27
|
+
]).action(async (number, opts, cmd) => {
|
|
28
|
+
await resolveOptions(cmd);
|
|
29
|
+
const { client, host } = await getClient(opts.space);
|
|
30
|
+
const prNumber = parseArg(vInteger, number, "number");
|
|
31
|
+
if (opts.web || opts.browser === false) {
|
|
32
|
+
const url = pullRequestUrl(host, opts.project, opts.repo, prNumber);
|
|
33
|
+
await openOrPrintUrl(url, opts.browser === false, consola);
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
const pullRequest = await getPullRequest(client, opts.project, opts.repo, prNumber);
|
|
37
|
+
const json = opts.json === true ? "" : opts.json;
|
|
38
|
+
outputResult(pullRequest, { json }, (data) => {
|
|
39
|
+
consola.log("");
|
|
40
|
+
consola.log(` #${data.number}: ${data.summary}`);
|
|
41
|
+
consola.log("");
|
|
42
|
+
printDefinitionList([
|
|
43
|
+
["Status", data.status.name],
|
|
44
|
+
["Base", data.base],
|
|
45
|
+
["Head", data.branch],
|
|
46
|
+
["Assignee", data.assignee?.name ?? "Unassigned"],
|
|
47
|
+
["Created by", data.createdUser?.name ?? "Unknown"],
|
|
48
|
+
["Created", formatDate(data.created)],
|
|
49
|
+
["Updated", formatDate(data.updated)],
|
|
50
|
+
["Merged at", data.mergeAt ? formatDate(data.mergeAt) : void 0],
|
|
51
|
+
["Closed at", data.closeAt ? formatDate(data.closeAt) : void 0]
|
|
52
|
+
]);
|
|
53
|
+
if (data.description) {
|
|
54
|
+
consola.log("");
|
|
55
|
+
consola.log(" Description:");
|
|
56
|
+
consola.log(data.description.split("\n").map((line) => ` ${line}`).join("\n"));
|
|
57
|
+
}
|
|
58
|
+
consola.log("");
|
|
59
|
+
});
|
|
60
|
+
});
|
|
61
|
+
//#endregion
|
|
62
|
+
export { view as default };
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { f as openOrPrintUrl, v as wikiUrl, 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, h as noBrowser, u as json, w as web } from "./common-options-BuYWxYdO.mjs";
|
|
7
|
+
import consola from "consola";
|
|
8
|
+
import { getWiki } from "backlog-js";
|
|
9
|
+
//#region src/commands/wiki/view.ts
|
|
10
|
+
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([
|
|
11
|
+
{
|
|
12
|
+
description: "View a wiki page",
|
|
13
|
+
command: "bee wiki view 12345"
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
description: "Open wiki page in browser",
|
|
17
|
+
command: "bee wiki view 12345 --web"
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
description: "Output as JSON",
|
|
21
|
+
command: "bee wiki view 12345 --json"
|
|
22
|
+
}
|
|
23
|
+
]).action(async (wiki, opts) => {
|
|
24
|
+
const { client, host } = await getClient(opts.space);
|
|
25
|
+
if (opts.web || opts.browser === false) {
|
|
26
|
+
const url = wikiUrl(host, parseArg(vInteger, wiki, "wiki"));
|
|
27
|
+
await openOrPrintUrl(url, opts.browser === false, consola);
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
const wikiData = await getWiki(client, parseArg(vInteger, wiki, "wiki"));
|
|
31
|
+
outputResult(wikiData, opts, (data) => {
|
|
32
|
+
consola.log("");
|
|
33
|
+
consola.log(` ${data.name}`);
|
|
34
|
+
consola.log("");
|
|
35
|
+
printDefinitionList([
|
|
36
|
+
["ID", String(data.id)],
|
|
37
|
+
["Tags", data.tags.length > 0 ? data.tags.map((t) => t.name).join(", ") : void 0],
|
|
38
|
+
["Created by", data.createdUser?.name],
|
|
39
|
+
["Created", formatDate(data.created)],
|
|
40
|
+
["Updated by", data.updatedUser?.name],
|
|
41
|
+
["Updated", formatDate(data.updated)]
|
|
42
|
+
]);
|
|
43
|
+
if (data.content) {
|
|
44
|
+
consola.log("");
|
|
45
|
+
consola.log(` ${data.content}`);
|
|
46
|
+
}
|
|
47
|
+
consola.log("");
|
|
48
|
+
});
|
|
49
|
+
});
|
|
50
|
+
//#endregion
|
|
51
|
+
export { view as default };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { t as BeeCommand } from "./bee-command-v0qvZeth.mjs";
|
|
2
|
+
//#region src/commands/watching/index.ts
|
|
3
|
+
const watching = new BeeCommand("watching").summary("Manage watching (issue subscriptions)");
|
|
4
|
+
await watching.addCommands([
|
|
5
|
+
import("./list-BpUUxxwQ.mjs"),
|
|
6
|
+
import("./add-CTmmy2t9.mjs"),
|
|
7
|
+
import("./view-Bs8o0c7i.mjs"),
|
|
8
|
+
import("./delete-C05oMZEW.mjs"),
|
|
9
|
+
import("./read-BS2G4sNq.mjs")
|
|
10
|
+
]);
|
|
11
|
+
//#endregion
|
|
12
|
+
export { watching as default };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { t as BeeCommand } from "./bee-command-v0qvZeth.mjs";
|
|
2
|
+
//#region src/commands/wiki/index.ts
|
|
3
|
+
const wiki = new BeeCommand("wiki").summary("Manage Backlog wiki pages");
|
|
4
|
+
await wiki.addCommands([
|
|
5
|
+
import("./list-DAr3urtu.mjs"),
|
|
6
|
+
import("./view-DLx6qQt9.mjs"),
|
|
7
|
+
import("./count-CHzDiMV3.mjs"),
|
|
8
|
+
import("./tags-DuMJZyBL.mjs"),
|
|
9
|
+
import("./history-DpjqxFkX.mjs"),
|
|
10
|
+
import("./attachments-DfgEkAY2.mjs"),
|
|
11
|
+
import("./create-BXWATibN.mjs"),
|
|
12
|
+
import("./edit-C_KbKopB.mjs"),
|
|
13
|
+
import("./delete-D2yDBhZc.mjs")
|
|
14
|
+
]);
|
|
15
|
+
//#endregion
|
|
16
|
+
export { wiki as default };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nulab/bee",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.2",
|
|
4
4
|
"description": "Bring Backlog to your command line",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"backlog",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"access": "public"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"backlog-js": "^
|
|
34
|
+
"backlog-js": "^1.1.0",
|
|
35
35
|
"commander": "^14.0.3",
|
|
36
36
|
"consola": "^3.4.2",
|
|
37
37
|
"is-unicode-supported": "^2.1.0",
|
|
@@ -40,23 +40,26 @@
|
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"tsx": "^4.23.12",
|
|
43
|
-
"unbuild": "^3.6.1",
|
|
44
|
-
"vitest": "^4.1.11",
|
|
45
43
|
"@repo/backlog-utils": "0.0.0",
|
|
44
|
+
"@repo/cli-utils": "0.0.0",
|
|
46
45
|
"@repo/config": "0.0.0",
|
|
47
|
-
"@repo/tsconfigs": "0.0.0",
|
|
48
46
|
"@repo/test-utils": "0.0.0",
|
|
49
|
-
"@repo/
|
|
47
|
+
"@repo/tsconfigs": "0.0.0"
|
|
48
|
+
},
|
|
49
|
+
"devEngines": {
|
|
50
|
+
"runtime": {
|
|
51
|
+
"name": "node",
|
|
52
|
+
"version": "^22.18.0 || ^24.11.0",
|
|
53
|
+
"onFail": "error"
|
|
54
|
+
}
|
|
50
55
|
},
|
|
51
56
|
"engines": {
|
|
52
57
|
"node": ">=20.18"
|
|
53
58
|
},
|
|
54
59
|
"scripts": {
|
|
55
|
-
"build": "
|
|
60
|
+
"build": "vp pack",
|
|
56
61
|
"dev": "tsx --env-file=.env.development src/index.ts",
|
|
57
62
|
"generate:skill": "tsx src/scripts/generate-skill.ts",
|
|
58
|
-
"generate:skill:check": "tsx src/scripts/generate-skill.ts --check"
|
|
59
|
-
"test": "vitest run",
|
|
60
|
-
"typecheck": "tsc --noEmit"
|
|
63
|
+
"generate:skill:check": "tsx src/scripts/generate-skill.ts --check"
|
|
61
64
|
}
|
|
62
65
|
}
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import consola from 'consola';
|
|
2
|
-
import { A as ACTIVITY_LABELS, g as getActivitySummary } from '../shared/bee.CirccSk2.mjs';
|
|
3
|
-
import { o as outputResult } from '../shared/bee.BTBGpv4K.mjs';
|
|
4
|
-
import 'node:stream/consumers';
|
|
5
|
-
import * as v from 'valibot';
|
|
6
|
-
import { p as parseArg, v as vInteger } from '../index.mjs';
|
|
7
|
-
import { f as formatDate } from '../shared/bee.n5MYN4a6.mjs';
|
|
8
|
-
import { p as printTable } from '../shared/bee.a05kNWpn.mjs';
|
|
9
|
-
import { g as getClient } from '../shared/bee.RsR9yniy.mjs';
|
|
10
|
-
import 'backlog-js';
|
|
11
|
-
import 'node:http';
|
|
12
|
-
import 'open';
|
|
13
|
-
import 'node:child_process';
|
|
14
|
-
import { B as BeeCommand, E as ENV_AUTH, a as ENV_PROJECT } from '../shared/bee.KteAW2rM.mjs';
|
|
15
|
-
import { d as project, f as collectNum, g as count, o as order, j as json, s as space, r as resolveOptions } 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 activities = new BeeCommand("activities").summary("List project activities").description(
|
|
27
|
-
`Results are ordered by most recent first. Use \`--activity-type\` to filter by type.
|
|
28
|
-
|
|
29
|
-
For activity type IDs, see:
|
|
30
|
-
https://developer.nulab.com/docs/backlog/api/2/get-project-recent-updates/#response-description`
|
|
31
|
-
).addOption(project()).option(
|
|
32
|
-
"--activity-type <id>",
|
|
33
|
-
"Filter by activity type IDs (repeatable)",
|
|
34
|
-
collectNum,
|
|
35
|
-
[]
|
|
36
|
-
).addOption(count()).addOption(order()).addOption(json()).addOption(space()).envVars([...ENV_AUTH, ENV_PROJECT]).examples([
|
|
37
|
-
{ description: "List recent activities", command: "bee project activities -p PROJECT_KEY" },
|
|
38
|
-
{
|
|
39
|
-
description: "Show only issue-related activities",
|
|
40
|
-
command: "bee project activities -p PROJECT_KEY --activity-type 1 --activity-type 2 --activity-type 3"
|
|
41
|
-
},
|
|
42
|
-
{
|
|
43
|
-
description: "Show last 50 activities",
|
|
44
|
-
command: "bee project activities -p PROJECT_KEY --count 50"
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
description: "Output as JSON",
|
|
48
|
-
command: "bee project activities -p PROJECT_KEY --json"
|
|
49
|
-
}
|
|
50
|
-
]).action(async (opts, cmd) => {
|
|
51
|
-
await resolveOptions(cmd);
|
|
52
|
-
const { client } = await getClient(opts.space);
|
|
53
|
-
const activityTypeId = opts.activityType;
|
|
54
|
-
const activityList = await client.getProjectActivities(opts.project, {
|
|
55
|
-
activityTypeId,
|
|
56
|
-
count: parseArg(v.optional(vInteger), opts.count, "--count"),
|
|
57
|
-
order: opts.order
|
|
58
|
-
});
|
|
59
|
-
const jsonArg = opts.json === true ? "" : opts.json;
|
|
60
|
-
outputResult(activityList, { ...opts, json: jsonArg }, (data) => {
|
|
61
|
-
if (data.length === 0) {
|
|
62
|
-
consola.info("No activities found.");
|
|
63
|
-
return;
|
|
64
|
-
}
|
|
65
|
-
const rows = data.map((activity) => [
|
|
66
|
-
{ header: "DATE", value: formatDate(activity.created) },
|
|
67
|
-
{ header: "TYPE", value: ACTIVITY_LABELS[activity.type] ?? `Type ${activity.type}` },
|
|
68
|
-
{ header: "USER", value: activity.createdUser?.name ?? "Unknown" },
|
|
69
|
-
{ header: "SUMMARY", value: getActivitySummary(activity) }
|
|
70
|
-
]);
|
|
71
|
-
printTable(rows);
|
|
72
|
-
});
|
|
73
|
-
});
|
|
74
|
-
|
|
75
|
-
export { activities as default };
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import consola from 'consola';
|
|
2
|
-
import { A as ACTIVITY_LABELS, g as getActivitySummary } from '../shared/bee.CirccSk2.mjs';
|
|
3
|
-
import { o as outputResult } from '../shared/bee.BTBGpv4K.mjs';
|
|
4
|
-
import 'node:stream/consumers';
|
|
5
|
-
import * as v from 'valibot';
|
|
6
|
-
import { p as parseArg, v as vInteger } from '../index.mjs';
|
|
7
|
-
import { f as formatDate } from '../shared/bee.n5MYN4a6.mjs';
|
|
8
|
-
import { p as printTable } from '../shared/bee.a05kNWpn.mjs';
|
|
9
|
-
import { g as getClient } from '../shared/bee.RsR9yniy.mjs';
|
|
10
|
-
import 'backlog-js';
|
|
11
|
-
import 'node:http';
|
|
12
|
-
import 'open';
|
|
13
|
-
import 'node:child_process';
|
|
14
|
-
import { B as BeeCommand, E as ENV_AUTH } from '../shared/bee.KteAW2rM.mjs';
|
|
15
|
-
import { f as collectNum, g as count, o as order, A as minId, B as maxId, 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 activities = new BeeCommand("activities").summary("List user activities").description(
|
|
27
|
-
`Results are ordered by most recent first. Use \`--activity-type\` to filter by type.
|
|
28
|
-
|
|
29
|
-
For activity type IDs, see:
|
|
30
|
-
https://developer.nulab.com/docs/backlog/api/2/get-user-recent-updates/#response-description`
|
|
31
|
-
).argument("<user>", "User ID").option(
|
|
32
|
-
"--activity-type <id>",
|
|
33
|
-
"Filter by activity type IDs (repeatable)",
|
|
34
|
-
collectNum,
|
|
35
|
-
[]
|
|
36
|
-
).addOption(count()).addOption(order()).addOption(minId()).addOption(maxId()).addOption(json()).addOption(space()).envVars([...ENV_AUTH]).examples([
|
|
37
|
-
{ description: "List user activities", command: "bee user activities 12345" },
|
|
38
|
-
{
|
|
39
|
-
description: "Show only issue-related activities",
|
|
40
|
-
command: "bee user activities 12345 --activity-type 1 --activity-type 2 --activity-type 3"
|
|
41
|
-
},
|
|
42
|
-
{
|
|
43
|
-
description: "Show last 50 activities",
|
|
44
|
-
command: "bee user activities 12345 --count 50"
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
description: "Output as JSON",
|
|
48
|
-
command: "bee user activities 12345 --json"
|
|
49
|
-
}
|
|
50
|
-
]).action(async (user, opts) => {
|
|
51
|
-
const { client } = await getClient(opts.space);
|
|
52
|
-
const activityTypeId = opts.activityType;
|
|
53
|
-
const activityList = await client.getUserActivities(parseArg(vInteger, user, "user"), {
|
|
54
|
-
activityTypeId,
|
|
55
|
-
count: parseArg(v.optional(vInteger), opts.count, "--count"),
|
|
56
|
-
order: opts.order,
|
|
57
|
-
minId: parseArg(v.optional(vInteger), opts.minId, "--min-id"),
|
|
58
|
-
maxId: parseArg(v.optional(vInteger), opts.maxId, "--max-id")
|
|
59
|
-
});
|
|
60
|
-
outputResult(activityList, opts, (data) => {
|
|
61
|
-
if (data.length === 0) {
|
|
62
|
-
consola.info("No activities found.");
|
|
63
|
-
return;
|
|
64
|
-
}
|
|
65
|
-
const rows = data.map((activity) => [
|
|
66
|
-
{ header: "DATE", value: formatDate(activity.created) },
|
|
67
|
-
{ header: "TYPE", value: ACTIVITY_LABELS[activity.type] ?? `Type ${activity.type}` },
|
|
68
|
-
{ header: "PROJECT", value: activity.project?.name ?? "" },
|
|
69
|
-
{ header: "SUMMARY", value: getActivitySummary(activity) }
|
|
70
|
-
]);
|
|
71
|
-
printTable(rows);
|
|
72
|
-
});
|
|
73
|
-
});
|
|
74
|
-
|
|
75
|
-
export { activities as default };
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import consola from 'consola';
|
|
2
|
-
import { A as ACTIVITY_LABELS, g as getActivitySummary } from '../shared/bee.CirccSk2.mjs';
|
|
3
|
-
import { o as outputResult } from '../shared/bee.BTBGpv4K.mjs';
|
|
4
|
-
import 'node:stream/consumers';
|
|
5
|
-
import * as v from 'valibot';
|
|
6
|
-
import { p as parseArg, v as vInteger } from '../index.mjs';
|
|
7
|
-
import { f as formatDate } from '../shared/bee.n5MYN4a6.mjs';
|
|
8
|
-
import { p as printTable } from '../shared/bee.a05kNWpn.mjs';
|
|
9
|
-
import { g as getClient } from '../shared/bee.RsR9yniy.mjs';
|
|
10
|
-
import 'backlog-js';
|
|
11
|
-
import 'node:http';
|
|
12
|
-
import 'open';
|
|
13
|
-
import 'node:child_process';
|
|
14
|
-
import { B as BeeCommand, E as ENV_AUTH } from '../shared/bee.KteAW2rM.mjs';
|
|
15
|
-
import { f as collectNum, g as count, o as order, A as minId, B as maxId, 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 activities = new BeeCommand("activities").summary("List space activities").description(
|
|
27
|
-
`Results are ordered by most recent first. Use \`--activity-type\` to filter by type.
|
|
28
|
-
|
|
29
|
-
For activity type IDs, see:
|
|
30
|
-
https://developer.nulab.com/docs/backlog/api/2/get-recent-updates/#response-description`
|
|
31
|
-
).option(
|
|
32
|
-
"--activity-type <id>",
|
|
33
|
-
"Filter by activity type IDs (repeatable)",
|
|
34
|
-
collectNum,
|
|
35
|
-
[]
|
|
36
|
-
).addOption(count()).addOption(order()).addOption(minId()).addOption(maxId()).addOption(json()).addOption(space()).envVars([...ENV_AUTH]).examples([
|
|
37
|
-
{ description: "List space activities", command: "bee space activities" },
|
|
38
|
-
{
|
|
39
|
-
description: "Show only issue-related activities",
|
|
40
|
-
command: "bee space activities --activity-type 1 --activity-type 2 --activity-type 3"
|
|
41
|
-
},
|
|
42
|
-
{
|
|
43
|
-
description: "Show last 50 activities",
|
|
44
|
-
command: "bee space activities --count 50"
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
description: "Output as JSON",
|
|
48
|
-
command: "bee space activities --json"
|
|
49
|
-
}
|
|
50
|
-
]).action(async (opts) => {
|
|
51
|
-
const { client } = await getClient(opts.space);
|
|
52
|
-
const activityTypeId = opts.activityType;
|
|
53
|
-
const activityList = await client.getSpaceActivities({
|
|
54
|
-
activityTypeId,
|
|
55
|
-
count: parseArg(v.optional(vInteger), opts.count, "--count"),
|
|
56
|
-
order: opts.order,
|
|
57
|
-
minId: parseArg(v.optional(vInteger), opts.minId, "--min-id"),
|
|
58
|
-
maxId: parseArg(v.optional(vInteger), opts.maxId, "--max-id")
|
|
59
|
-
});
|
|
60
|
-
outputResult(activityList, opts, (data) => {
|
|
61
|
-
if (data.length === 0) {
|
|
62
|
-
consola.info("No activities found.");
|
|
63
|
-
return;
|
|
64
|
-
}
|
|
65
|
-
const rows = data.map((activity) => [
|
|
66
|
-
{ header: "DATE", value: formatDate(activity.created) },
|
|
67
|
-
{ header: "TYPE", value: ACTIVITY_LABELS[activity.type] ?? `Type ${activity.type}` },
|
|
68
|
-
{ header: "PROJECT", value: activity.project?.name ?? "" },
|
|
69
|
-
{ header: "SUMMARY", value: getActivitySummary(activity) }
|
|
70
|
-
]);
|
|
71
|
-
printTable(rows);
|
|
72
|
-
});
|
|
73
|
-
});
|
|
74
|
-
|
|
75
|
-
export { activities as default };
|
package/dist/chunks/add-user.mjs
DELETED
|
@@ -1,38 +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 { g as getClient } from '../shared/bee.RsR9yniy.mjs';
|
|
7
|
-
import 'backlog-js';
|
|
8
|
-
import 'node:http';
|
|
9
|
-
import 'open';
|
|
10
|
-
import 'node:child_process';
|
|
11
|
-
import { B as BeeCommand, E as ENV_AUTH, a as ENV_PROJECT } from '../shared/bee.KteAW2rM.mjs';
|
|
12
|
-
import { d as project, R as RequiredOption, j as json, s as space, r as resolveOptions } from '../shared/bee.CHtg3F43.mjs';
|
|
13
|
-
import 'node:fs';
|
|
14
|
-
import 'node:path';
|
|
15
|
-
import 'node:os';
|
|
16
|
-
import 'node:module';
|
|
17
|
-
import 'commander';
|
|
18
|
-
import 'consola/utils';
|
|
19
|
-
import '../shared/bee.CktwmH8R.mjs';
|
|
20
|
-
import '../shared/bee.CAARNIp6.mjs';
|
|
21
|
-
|
|
22
|
-
const addUser = new BeeCommand("add-user").summary("Add a user to 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([
|
|
23
|
-
{
|
|
24
|
-
description: "Add a user to a project",
|
|
25
|
-
command: "bee project add-user -p PROJECT_KEY --user-id 12345"
|
|
26
|
-
}
|
|
27
|
-
]).action(async (opts, cmd) => {
|
|
28
|
-
await resolveOptions(cmd);
|
|
29
|
-
const userId = parseArg(vInteger, opts.userId, "--user-id");
|
|
30
|
-
const { client } = await getClient(opts.space);
|
|
31
|
-
const user = await client.postProjectUser(opts.project, String(userId));
|
|
32
|
-
const jsonArg = opts.json === true ? "" : opts.json;
|
|
33
|
-
outputResult(user, { ...opts, json: jsonArg }, (data) => {
|
|
34
|
-
consola.success(`Added user ${data.name} to project ${opts.project}.`);
|
|
35
|
-
});
|
|
36
|
-
});
|
|
37
|
-
|
|
38
|
-
export { addUser as default };
|
package/dist/chunks/add.mjs
DELETED
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import consola from 'consola';
|
|
2
|
-
import { U as UserError, p as parseArg, v as vInteger } from '../index.mjs';
|
|
3
|
-
import 'node:stream/consumers';
|
|
4
|
-
import 'valibot';
|
|
5
|
-
import { g as getClient } from '../shared/bee.RsR9yniy.mjs';
|
|
6
|
-
import 'backlog-js';
|
|
7
|
-
import 'node:http';
|
|
8
|
-
import 'open';
|
|
9
|
-
import 'node:child_process';
|
|
10
|
-
import { B as BeeCommand, E as ENV_AUTH } from '../shared/bee.KteAW2rM.mjs';
|
|
11
|
-
import { D as issue, s as space } from '../shared/bee.CHtg3F43.mjs';
|
|
12
|
-
import 'node:fs';
|
|
13
|
-
import 'node:path';
|
|
14
|
-
import 'node:os';
|
|
15
|
-
import 'node:module';
|
|
16
|
-
import 'commander';
|
|
17
|
-
import 'consola/utils';
|
|
18
|
-
import '../shared/bee.CktwmH8R.mjs';
|
|
19
|
-
import '../shared/bee.CAARNIp6.mjs';
|
|
20
|
-
|
|
21
|
-
const add = new BeeCommand("add").summary("Add a star").description(
|
|
22
|
-
`Specify exactly one target: \`--issue\` (accepts key or ID), \`--comment\`, \`--wiki\`, or \`--pr-comment\`.`
|
|
23
|
-
).addOption(issue()).option("--comment <number>", "Comment ID to star").option("--wiki <number>", "Wiki page ID to star").option("--pr-comment <number>", "Pull request comment ID to star").addOption(space()).envVars([...ENV_AUTH]).examples([
|
|
24
|
-
{ description: "Star an issue by key", command: "bee star add --issue PROJECT-123" },
|
|
25
|
-
{ description: "Star an issue by ID", command: "bee star add --issue 12345" },
|
|
26
|
-
{ description: "Star a comment", command: "bee star add --comment 67890" },
|
|
27
|
-
{ description: "Star a wiki page", command: "bee star add --wiki 111" },
|
|
28
|
-
{ description: "Star a pull request comment", command: "bee star add --pr-comment 222" }
|
|
29
|
-
]).action(async (opts) => {
|
|
30
|
-
const flags = [opts.issue, opts.comment, opts.wiki, opts.prComment].filter(
|
|
31
|
-
(val) => val !== void 0
|
|
32
|
-
);
|
|
33
|
-
if (flags.length === 0) {
|
|
34
|
-
throw new UserError(
|
|
35
|
-
"Exactly one of --issue, --comment, --wiki, or --pr-comment must be provided."
|
|
36
|
-
);
|
|
37
|
-
}
|
|
38
|
-
if (flags.length > 1) {
|
|
39
|
-
throw new UserError(
|
|
40
|
-
"Only one of --issue, --comment, --wiki, or --pr-comment can be provided at a time."
|
|
41
|
-
);
|
|
42
|
-
}
|
|
43
|
-
const { client } = await getClient(opts.space);
|
|
44
|
-
if (opts.issue) {
|
|
45
|
-
const issue = /^\d+$/.test(opts.issue) ? { id: parseArg(vInteger, opts.issue, "--issue") } : await client.getIssue(opts.issue);
|
|
46
|
-
const issueId = issue.id;
|
|
47
|
-
await client.postStar({ issueId });
|
|
48
|
-
consola.success(`Starred issue ${opts.issue}.`);
|
|
49
|
-
} else if (opts.comment) {
|
|
50
|
-
await client.postStar({ commentId: parseArg(vInteger, opts.comment, "--comment") });
|
|
51
|
-
consola.success(`Starred comment ${opts.comment}.`);
|
|
52
|
-
} else if (opts.wiki) {
|
|
53
|
-
await client.postStar({ wikiId: parseArg(vInteger, opts.wiki, "--wiki") });
|
|
54
|
-
consola.success(`Starred wiki ${opts.wiki}.`);
|
|
55
|
-
} else if (opts.prComment) {
|
|
56
|
-
await client.postStar({
|
|
57
|
-
pullRequestCommentId: parseArg(vInteger, opts.prComment, "--pr-comment")
|
|
58
|
-
});
|
|
59
|
-
consola.success(`Starred pull request comment ${opts.prComment}.`);
|
|
60
|
-
}
|
|
61
|
-
});
|
|
62
|
-
|
|
63
|
-
export { add as default };
|