@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,18 @@
|
|
|
1
|
+
import { t as BeeCommand } from "./bee-command-v0qvZeth.mjs";
|
|
2
|
+
//#region src/commands/issue/index.ts
|
|
3
|
+
const issue = new BeeCommand("issue").summary("Manage Backlog issues");
|
|
4
|
+
await issue.addCommands([
|
|
5
|
+
import("./list-BmZ_JbLB.mjs"),
|
|
6
|
+
import("./view-D1RuQJV6.mjs"),
|
|
7
|
+
import("./status-BkFMW8Jh.mjs"),
|
|
8
|
+
import("./create-PtahSFdG.mjs"),
|
|
9
|
+
import("./edit-DRxr4r-r.mjs"),
|
|
10
|
+
import("./close-cTyZPv77.mjs"),
|
|
11
|
+
import("./reopen-BIRhcmsI.mjs"),
|
|
12
|
+
import("./attachments-D8IoJjYE.mjs"),
|
|
13
|
+
import("./comment-CkYJYFrF.mjs"),
|
|
14
|
+
import("./count-CH_LN4k6.mjs"),
|
|
15
|
+
import("./delete-Bxk14ntp.mjs")
|
|
16
|
+
]);
|
|
17
|
+
//#endregion
|
|
18
|
+
export { issue as default };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { t as BeeCommand } from "./bee-command-v0qvZeth.mjs";
|
|
2
|
+
//#region src/commands/issue-type/index.ts
|
|
3
|
+
const issueType = new BeeCommand("issue-type").summary("Manage project issue types");
|
|
4
|
+
await issueType.addCommands([
|
|
5
|
+
import("./list-D0Z__0nw.mjs"),
|
|
6
|
+
import("./create-CoF2bahH.mjs"),
|
|
7
|
+
import("./edit-DKQw-XXP.mjs"),
|
|
8
|
+
import("./delete-BlmanW0H.mjs")
|
|
9
|
+
]);
|
|
10
|
+
//#endregion
|
|
11
|
+
export { issueType as default };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { y as getClient } from "./src-CTD9-bSB.mjs";
|
|
2
|
+
import { t as outputResult } from "./output-DBvfyU1J.mjs";
|
|
3
|
+
import { r as printTable } from "./src-CP4YLIAh.mjs";
|
|
4
|
+
import { n as ENV_AUTH, r as ENV_PROJECT, t as BeeCommand } from "./bee-command-v0qvZeth.mjs";
|
|
5
|
+
import { E as resolveOptions, S as space, u as json, y as project } from "./common-options-BuYWxYdO.mjs";
|
|
6
|
+
import consola from "consola";
|
|
7
|
+
import { getCategories } from "backlog-js";
|
|
8
|
+
//#region src/commands/category/list.ts
|
|
9
|
+
const list = new BeeCommand("list").summary("List categories").description(`Categories help organize issues by grouping them into logical areas.`).addOption(project()).addOption(json()).addOption(space()).envVars([...ENV_AUTH, ENV_PROJECT]).examples([{
|
|
10
|
+
description: "List all categories in a project",
|
|
11
|
+
command: "bee category list -p PROJECT"
|
|
12
|
+
}, {
|
|
13
|
+
description: "Output as JSON",
|
|
14
|
+
command: "bee category list -p PROJECT --json"
|
|
15
|
+
}]).action(async (opts, cmd) => {
|
|
16
|
+
await resolveOptions(cmd);
|
|
17
|
+
const { client } = await getClient(opts.space);
|
|
18
|
+
const categories = await getCategories(client, opts.project);
|
|
19
|
+
outputResult(categories, opts, (data) => {
|
|
20
|
+
if (data.length === 0) {
|
|
21
|
+
consola.info("No categories found.");
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
const rows = data.map((c) => [{
|
|
25
|
+
header: "ID",
|
|
26
|
+
value: String(c.id)
|
|
27
|
+
}, {
|
|
28
|
+
header: "NAME",
|
|
29
|
+
value: c.name
|
|
30
|
+
}]);
|
|
31
|
+
printTable(rows);
|
|
32
|
+
});
|
|
33
|
+
});
|
|
34
|
+
//#endregion
|
|
35
|
+
export { list as default };
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { C as resolveProjectIds, y as getClient } from "./src-CTD9-bSB.mjs";
|
|
2
|
+
import { t as outputResult } from "./output-DBvfyU1J.mjs";
|
|
3
|
+
import { a as parseArg, i as splitArg, r as printTable, s as vInteger } from "./src-CP4YLIAh.mjs";
|
|
4
|
+
import { t as formatDate } from "./format-DHAR0n3J.mjs";
|
|
5
|
+
import { n as ENV_AUTH, r as ENV_PROJECT, t as BeeCommand } from "./bee-command-v0qvZeth.mjs";
|
|
6
|
+
import { E as resolveOptions, S as space, _ as offset, c as count, d as keyword, u as json, v as order, y as project } from "./common-options-BuYWxYdO.mjs";
|
|
7
|
+
import consola from "consola";
|
|
8
|
+
import { getDocuments } from "backlog-js";
|
|
9
|
+
import * as v from "valibot";
|
|
10
|
+
//#region src/commands/document/list.ts
|
|
11
|
+
const list = new BeeCommand("list").summary("List documents").description(`Use \`--keyword\` to search within document titles and content.`).addOption(project()).addOption(keyword()).option("--sort <field>", "Sort field {created|updated}").addOption(order()).addOption(count()).addOption(offset()).addOption(json()).addOption(space()).envVars([...ENV_AUTH, ENV_PROJECT]).examples([
|
|
12
|
+
{
|
|
13
|
+
description: "List documents in a project",
|
|
14
|
+
command: "bee document list -p PROJECT"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
description: "Search documents by keyword",
|
|
18
|
+
command: "bee document list -p PROJECT -k \"meeting notes\""
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
description: "Output as JSON",
|
|
22
|
+
command: "bee document list -p PROJECT --json"
|
|
23
|
+
}
|
|
24
|
+
]).action(async (opts, cmd) => {
|
|
25
|
+
await resolveOptions(cmd);
|
|
26
|
+
const { client } = await getClient(opts.space);
|
|
27
|
+
const projectId = await resolveProjectIds(client, splitArg(opts.project, v.string()));
|
|
28
|
+
const documents = await getDocuments(client, {
|
|
29
|
+
projectId,
|
|
30
|
+
keyword: opts.keyword,
|
|
31
|
+
sort: opts.sort,
|
|
32
|
+
order: opts.order,
|
|
33
|
+
count: parseArg(v.optional(vInteger), opts.count, "--count"),
|
|
34
|
+
offset: parseArg(v.optional(vInteger), opts.offset, "--offset") ?? 0
|
|
35
|
+
});
|
|
36
|
+
const json = opts.json === true ? "" : opts.json;
|
|
37
|
+
outputResult(documents, { json }, (data) => {
|
|
38
|
+
if (data.length === 0) {
|
|
39
|
+
consola.info("No documents found.");
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
const rows = data.map((doc) => [
|
|
43
|
+
{
|
|
44
|
+
header: "ID",
|
|
45
|
+
value: doc.id
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
header: "EMOJI",
|
|
49
|
+
value: doc.emoji ?? ""
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
header: "TITLE",
|
|
53
|
+
value: doc.title
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
header: "UPDATED",
|
|
57
|
+
value: formatDate(doc.updated)
|
|
58
|
+
}
|
|
59
|
+
]);
|
|
60
|
+
printTable(rows);
|
|
61
|
+
});
|
|
62
|
+
});
|
|
63
|
+
//#endregion
|
|
64
|
+
export { list as default };
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { y as getClient } from "./src-CTD9-bSB.mjs";
|
|
2
|
+
import { t as outputResult } from "./output-DBvfyU1J.mjs";
|
|
3
|
+
import { r as printTable } from "./src-CP4YLIAh.mjs";
|
|
4
|
+
import { t as ROLE_LABELS } from "./role-labels-CLA2wmjO.mjs";
|
|
5
|
+
import { n as ENV_AUTH, t as BeeCommand } from "./bee-command-v0qvZeth.mjs";
|
|
6
|
+
import { S as space, u as json } from "./common-options-BuYWxYdO.mjs";
|
|
7
|
+
import consola from "consola";
|
|
8
|
+
import { getUsers } from "backlog-js";
|
|
9
|
+
//#region src/commands/user/list.ts
|
|
10
|
+
const list = new BeeCommand("list").summary("List users").description(`Only space administrators can see the full list of users.`).addOption(json()).addOption(space()).envVars([...ENV_AUTH]).examples([{
|
|
11
|
+
description: "List all users",
|
|
12
|
+
command: "bee user list"
|
|
13
|
+
}, {
|
|
14
|
+
description: "Output as JSON",
|
|
15
|
+
command: "bee user list --json"
|
|
16
|
+
}]).action(async (opts) => {
|
|
17
|
+
const { client } = await getClient(opts.space);
|
|
18
|
+
const users = await getUsers(client);
|
|
19
|
+
outputResult(users, opts, (data) => {
|
|
20
|
+
if (data.length === 0) {
|
|
21
|
+
consola.info("No users found.");
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
const rows = data.map((u) => [
|
|
25
|
+
{
|
|
26
|
+
header: "ID",
|
|
27
|
+
value: String(u.id)
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
header: "USER ID",
|
|
31
|
+
value: u.userId ?? ""
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
header: "NAME",
|
|
35
|
+
value: u.name
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
header: "ROLE",
|
|
39
|
+
value: ROLE_LABELS[u.roleType] ?? `Unknown (${u.roleType})`
|
|
40
|
+
}
|
|
41
|
+
]);
|
|
42
|
+
printTable(rows);
|
|
43
|
+
});
|
|
44
|
+
});
|
|
45
|
+
//#endregion
|
|
46
|
+
export { list as default };
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { C as resolveProjectIds, O as PRIORITY_NAMES, S as resolveUserId, k as PriorityId, y as getClient } from "./src-CTD9-bSB.mjs";
|
|
2
|
+
import { t as outputResult } from "./output-DBvfyU1J.mjs";
|
|
3
|
+
import { a as parseArg, r as printTable, s as vInteger } from "./src-CP4YLIAh.mjs";
|
|
4
|
+
import { n as ENV_AUTH, r as ENV_PROJECT, t as BeeCommand } from "./bee-command-v0qvZeth.mjs";
|
|
5
|
+
import { S as space, _ as offset, a as collect, b as projectOptional, c as count, d as keyword, n as assigneeList, o as collectNum, u as json, v as order } from "./common-options-BuYWxYdO.mjs";
|
|
6
|
+
import consola from "consola";
|
|
7
|
+
import { getIssues } from "backlog-js";
|
|
8
|
+
import * as v from "valibot";
|
|
9
|
+
//#region src/commands/issue/list.ts
|
|
10
|
+
const resolvePriorityIds = (priorities) => priorities.map((name) => {
|
|
11
|
+
const id = PriorityId[name.toLowerCase()];
|
|
12
|
+
if (id === void 0) throw new Error(`Unknown priority "${name}". Valid values: ${PRIORITY_NAMES.join(", ")}`);
|
|
13
|
+
return id;
|
|
14
|
+
});
|
|
15
|
+
const list = new BeeCommand("list").summary("List issues").description(`By default, sorted by last updated date in descending order. Multiple project keys can be comma-separated.`).addOption(projectOptional("Project ID or project key (comma-separated for multiple)")).addOption(assigneeList()).option("-S, --status <id>", "Status ID (repeatable)", collectNum, []).option("-P, --priority <name>", "Priority name (repeatable)", collect, []).option("-T, --type <id>", "Issue type ID (repeatable)", collectNum, []).option("--category <id>", "Category ID (repeatable)", collectNum, []).option("--version <id>", "Version ID (repeatable)", collectNum, []).option("--milestone <id>", "Milestone ID (repeatable)", collectNum, []).option("--resolution <id>", "Resolution ID (repeatable)", collectNum, []).option("--parent-issue <id>", "Parent issue ID (repeatable)", collectNum, []).addOption(keyword()).option("--created-since <date>", "Show issues created on or after this date").option("--created-until <date>", "Show issues created on or before this date").option("--updated-since <date>", "Show issues updated on or after this date").option("--updated-until <date>", "Show issues updated on or before this date").option("--start-since <date>", "Show issues starting on or after this date").option("--start-until <date>", "Show issues starting on or before this date").option("--due-since <date>", "Show issues due on or after this date").option("--due-until <date>", "Show issues due on or before this date").option("--sort <field>", "Sort field").addOption(order()).addOption(count()).addOption(offset()).addOption(json()).addOption(space()).envVars([...ENV_AUTH, ENV_PROJECT]).examples([
|
|
16
|
+
{
|
|
17
|
+
description: "List issues in a project",
|
|
18
|
+
command: "bee issue list -p PROJECT"
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
description: "List your assigned issues",
|
|
22
|
+
command: "bee issue list -p PROJECT -a @me"
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
description: "Filter by keyword and priority",
|
|
26
|
+
command: "bee issue list -p PROJECT -k \"login bug\" --priority high"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
description: "Output as JSON",
|
|
30
|
+
command: "bee issue list -p PROJECT --json"
|
|
31
|
+
}
|
|
32
|
+
]).action(async (opts) => {
|
|
33
|
+
const { client } = await getClient(opts.space);
|
|
34
|
+
const projectId = opts.project ? await resolveProjectIds(client, opts.project.split(",").map((s) => s.trim()).filter(Boolean)) : [];
|
|
35
|
+
const assigneeId = await Promise.all((opts.assignee ?? []).map((id) => resolveUserId(client, id)));
|
|
36
|
+
const statusId = opts.status;
|
|
37
|
+
const priorityId = opts.priority.length > 0 ? resolvePriorityIds(opts.priority) : [];
|
|
38
|
+
const issueTypeId = opts.type;
|
|
39
|
+
const categoryId = opts.category;
|
|
40
|
+
const versionId = opts.version;
|
|
41
|
+
const milestoneId = opts.milestone;
|
|
42
|
+
const resolutionId = opts.resolution;
|
|
43
|
+
const parentIssueId = opts.parentIssue;
|
|
44
|
+
const issues = await getIssues(client, {
|
|
45
|
+
projectId,
|
|
46
|
+
assigneeId,
|
|
47
|
+
statusId,
|
|
48
|
+
priorityId,
|
|
49
|
+
issueTypeId,
|
|
50
|
+
categoryId,
|
|
51
|
+
versionId,
|
|
52
|
+
milestoneId,
|
|
53
|
+
resolutionId,
|
|
54
|
+
parentIssueId,
|
|
55
|
+
keyword: opts.keyword,
|
|
56
|
+
sort: opts.sort,
|
|
57
|
+
order: opts.order,
|
|
58
|
+
count: parseArg(v.optional(vInteger), opts.count, "--count"),
|
|
59
|
+
offset: parseArg(v.optional(vInteger), opts.offset, "--offset"),
|
|
60
|
+
createdSince: opts.createdSince,
|
|
61
|
+
createdUntil: opts.createdUntil,
|
|
62
|
+
updatedSince: opts.updatedSince,
|
|
63
|
+
updatedUntil: opts.updatedUntil,
|
|
64
|
+
startDateSince: opts.startSince,
|
|
65
|
+
startDateUntil: opts.startUntil,
|
|
66
|
+
dueDateSince: opts.dueSince,
|
|
67
|
+
dueDateUntil: opts.dueUntil
|
|
68
|
+
});
|
|
69
|
+
outputResult(issues, { json: opts.json }, (data) => {
|
|
70
|
+
if (data.length === 0) {
|
|
71
|
+
consola.info("No issues found.");
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
const rows = data.map((issue) => [
|
|
75
|
+
{
|
|
76
|
+
header: "KEY",
|
|
77
|
+
value: issue.issueKey
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
header: "STATUS",
|
|
81
|
+
value: issue.status?.name ?? ""
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
header: "TYPE",
|
|
85
|
+
value: issue.issueType?.name ?? ""
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
header: "PRIORITY",
|
|
89
|
+
value: issue.priority?.name ?? ""
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
header: "ASSIGNEE",
|
|
93
|
+
value: issue.assignee?.name ?? "Unassigned"
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
header: "SUMMARY",
|
|
97
|
+
value: issue.summary
|
|
98
|
+
}
|
|
99
|
+
]);
|
|
100
|
+
printTable(rows);
|
|
101
|
+
});
|
|
102
|
+
});
|
|
103
|
+
//#endregion
|
|
104
|
+
export { list as default };
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { y as getClient } from "./src-CTD9-bSB.mjs";
|
|
2
|
+
import { t as outputResult } from "./output-DBvfyU1J.mjs";
|
|
3
|
+
import { r as printTable } from "./src-CP4YLIAh.mjs";
|
|
4
|
+
import { n as ENV_AUTH, t as BeeCommand } from "./bee-command-v0qvZeth.mjs";
|
|
5
|
+
import { S as space, u as json } from "./common-options-BuYWxYdO.mjs";
|
|
6
|
+
import consola from "consola";
|
|
7
|
+
import { getMyself, getWatchingListItems } from "backlog-js";
|
|
8
|
+
//#region src/commands/watching/list.ts
|
|
9
|
+
const list = new BeeCommand("list").summary("List watching items").description(`Unread items are marked with an asterisk (\`*\`).`).addOption(json()).addOption(space()).envVars([...ENV_AUTH]).examples([{
|
|
10
|
+
description: "List your watching items",
|
|
11
|
+
command: "bee watching list"
|
|
12
|
+
}, {
|
|
13
|
+
description: "Output as JSON",
|
|
14
|
+
command: "bee watching list --json"
|
|
15
|
+
}]).action(async (opts) => {
|
|
16
|
+
const { client } = await getClient(opts.space);
|
|
17
|
+
const myself = await getMyself(client);
|
|
18
|
+
const watchings = await getWatchingListItems(client, myself.id);
|
|
19
|
+
outputResult(watchings, opts, (data) => {
|
|
20
|
+
if (data.length === 0) {
|
|
21
|
+
consola.info("No watching items found.");
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
const rows = data.map((w) => [
|
|
25
|
+
{
|
|
26
|
+
header: "",
|
|
27
|
+
value: w.resourceAlreadyRead ? " " : "*"
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
header: "ID",
|
|
31
|
+
value: String(w.id)
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
header: "ISSUE KEY",
|
|
35
|
+
value: w.issue.issueKey
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
header: "TITLE",
|
|
39
|
+
value: w.issue.summary
|
|
40
|
+
}
|
|
41
|
+
]);
|
|
42
|
+
printTable(rows);
|
|
43
|
+
});
|
|
44
|
+
});
|
|
45
|
+
//#endregion
|
|
46
|
+
export { list as default };
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { y as getClient } from "./src-CTD9-bSB.mjs";
|
|
2
|
+
import { t as outputResult } from "./output-DBvfyU1J.mjs";
|
|
3
|
+
import { a as parseArg, r as printTable, 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, c as count, f as maxId, m as minId, u as json, v as order } from "./common-options-BuYWxYdO.mjs";
|
|
7
|
+
import consola from "consola";
|
|
8
|
+
import { getNotifications } from "backlog-js";
|
|
9
|
+
import * as v from "valibot";
|
|
10
|
+
//#region ../../packages/backlog-utils/src/notification-reason-labels.ts
|
|
11
|
+
const NOTIFICATION_REASON_LABELS = {
|
|
12
|
+
1: "Assigned",
|
|
13
|
+
2: "Commented",
|
|
14
|
+
3: "Issue created",
|
|
15
|
+
4: "Issue updated",
|
|
16
|
+
5: "File attached",
|
|
17
|
+
6: "Project user added",
|
|
18
|
+
9: "Other",
|
|
19
|
+
10: "Pull request assigned",
|
|
20
|
+
11: "Pull request commented",
|
|
21
|
+
12: "Pull request added",
|
|
22
|
+
13: "Pull request updated",
|
|
23
|
+
14: "Comment mentioned",
|
|
24
|
+
15: "Pull request comment mentioned",
|
|
25
|
+
16: "Team mentioned",
|
|
26
|
+
17: "Team mentioned in PR"
|
|
27
|
+
};
|
|
28
|
+
//#endregion
|
|
29
|
+
//#region src/commands/notification/list.ts
|
|
30
|
+
const list = new BeeCommand("list").summary("List notifications").description(`Unread notifications are marked with \`*\`. Use \`--min-id\` / \`--max-id\` for cursor-based pagination.`).addOption(count()).addOption(minId()).addOption(maxId()).addOption(order()).addOption(json()).addOption(space()).envVars([...ENV_AUTH]).examples([
|
|
31
|
+
{
|
|
32
|
+
description: "List recent notifications",
|
|
33
|
+
command: "bee notification list"
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
description: "List the last 5 notifications",
|
|
37
|
+
command: "bee notification list --count 5"
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
description: "List notifications in ascending order",
|
|
41
|
+
command: "bee notification list --order asc"
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
description: "Output as JSON",
|
|
45
|
+
command: "bee notification list --json"
|
|
46
|
+
}
|
|
47
|
+
]).action(async (opts) => {
|
|
48
|
+
const { client } = await getClient(opts.space);
|
|
49
|
+
const notifications = await getNotifications(client, {
|
|
50
|
+
count: parseArg(v.optional(vInteger), opts.count, "--count"),
|
|
51
|
+
minId: parseArg(v.optional(vInteger), opts.minId, "--min-id"),
|
|
52
|
+
maxId: parseArg(v.optional(vInteger), opts.maxId, "--max-id"),
|
|
53
|
+
order: opts.order
|
|
54
|
+
});
|
|
55
|
+
outputResult(notifications, opts, (data) => {
|
|
56
|
+
if (data.length === 0) {
|
|
57
|
+
consola.info("No notifications found.");
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
const rows = data.map((n) => [
|
|
61
|
+
{
|
|
62
|
+
header: "",
|
|
63
|
+
value: n.alreadyRead ? " " : "*"
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
header: "ID",
|
|
67
|
+
value: String(n.id)
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
header: "REASON",
|
|
71
|
+
value: NOTIFICATION_REASON_LABELS[n.reason] ?? String(n.reason)
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
header: "ISSUE",
|
|
75
|
+
value: n.issue?.issueKey ?? "-"
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
header: "SUMMARY",
|
|
79
|
+
value: n.issue?.summary ?? "-"
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
header: "SENDER",
|
|
83
|
+
value: n.sender.name
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
header: "DATE",
|
|
87
|
+
value: formatDate(n.created)
|
|
88
|
+
}
|
|
89
|
+
]);
|
|
90
|
+
printTable(rows);
|
|
91
|
+
});
|
|
92
|
+
});
|
|
93
|
+
//#endregion
|
|
94
|
+
export { list as default };
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { y as getClient } from "./src-CTD9-bSB.mjs";
|
|
2
|
+
import { t as outputResult } from "./output-DBvfyU1J.mjs";
|
|
3
|
+
import { r as printTable } from "./src-CP4YLIAh.mjs";
|
|
4
|
+
import { n as ENV_AUTH, r as ENV_PROJECT, t as BeeCommand } from "./bee-command-v0qvZeth.mjs";
|
|
5
|
+
import { E as resolveOptions, S as space, u as json, y as project } from "./common-options-BuYWxYdO.mjs";
|
|
6
|
+
import consola from "consola";
|
|
7
|
+
import { getIssueTypes } from "backlog-js";
|
|
8
|
+
//#region src/commands/issue-type/list.ts
|
|
9
|
+
const list = new BeeCommand("list").summary("List issue types").description(`Issue types categorize issues and are displayed with their associated color.`).addOption(project()).addOption(json()).addOption(space()).envVars([...ENV_AUTH, ENV_PROJECT]).examples([{
|
|
10
|
+
description: "List all issue types",
|
|
11
|
+
command: "bee issue-type list -p PROJECT"
|
|
12
|
+
}, {
|
|
13
|
+
description: "Output as JSON",
|
|
14
|
+
command: "bee issue-type list -p PROJECT --json"
|
|
15
|
+
}]).action(async (opts, cmd) => {
|
|
16
|
+
await resolveOptions(cmd);
|
|
17
|
+
const { client } = await getClient(opts.space);
|
|
18
|
+
const issueTypes = await getIssueTypes(client, opts.project);
|
|
19
|
+
outputResult(issueTypes, opts, (data) => {
|
|
20
|
+
if (data.length === 0) {
|
|
21
|
+
consola.info("No issue types found.");
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
const rows = data.map((t) => [
|
|
25
|
+
{
|
|
26
|
+
header: "ID",
|
|
27
|
+
value: String(t.id)
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
header: "NAME",
|
|
31
|
+
value: t.name
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
header: "COLOR",
|
|
35
|
+
value: t.color
|
|
36
|
+
}
|
|
37
|
+
]);
|
|
38
|
+
printTable(rows);
|
|
39
|
+
});
|
|
40
|
+
});
|
|
41
|
+
//#endregion
|
|
42
|
+
export { list as default };
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { y as getClient } from "./src-CTD9-bSB.mjs";
|
|
2
|
+
import { t as outputResult } from "./output-DBvfyU1J.mjs";
|
|
3
|
+
import { a as parseArg, r as printTable, s as vInteger } from "./src-CP4YLIAh.mjs";
|
|
4
|
+
import { t as formatDate } from "./format-DHAR0n3J.mjs";
|
|
5
|
+
import { n as ENV_AUTH, t as BeeCommand } from "./bee-command-v0qvZeth.mjs";
|
|
6
|
+
import { S as space, u as json } from "./common-options-BuYWxYdO.mjs";
|
|
7
|
+
import consola from "consola";
|
|
8
|
+
import { getMyself, getUserStars } from "backlog-js";
|
|
9
|
+
//#region src/commands/star/list.ts
|
|
10
|
+
const list = new BeeCommand("list").summary("List received stars").description(`Defaults to the authenticated user if no user ID is given.`).argument("[user]", "User ID").addOption(json()).addOption(space()).envVars([...ENV_AUTH]).examples([
|
|
11
|
+
{
|
|
12
|
+
description: "List your stars",
|
|
13
|
+
command: "bee star list"
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
description: "List stars for a specific user",
|
|
17
|
+
command: "bee star list 12345"
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
description: "Output as JSON",
|
|
21
|
+
command: "bee star list --json"
|
|
22
|
+
}
|
|
23
|
+
]).action(async (user, opts) => {
|
|
24
|
+
const { client } = await getClient(opts.space);
|
|
25
|
+
let userId;
|
|
26
|
+
if (user) userId = parseArg(vInteger, user, "user");
|
|
27
|
+
else userId = (await getMyself(client)).id;
|
|
28
|
+
const stars = await getUserStars(client, userId, {});
|
|
29
|
+
outputResult(stars, opts, (data) => {
|
|
30
|
+
if (data.length === 0) {
|
|
31
|
+
consola.info("No stars found.");
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
const rows = data.map((s) => [
|
|
35
|
+
{
|
|
36
|
+
header: "ID",
|
|
37
|
+
value: String(s.id)
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
header: "TITLE",
|
|
41
|
+
value: s.title
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
header: "PRESENTER",
|
|
45
|
+
value: s.presenter.name
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
header: "DATE",
|
|
49
|
+
value: formatDate(s.created)
|
|
50
|
+
}
|
|
51
|
+
]);
|
|
52
|
+
printTable(rows);
|
|
53
|
+
});
|
|
54
|
+
});
|
|
55
|
+
//#endregion
|
|
56
|
+
export { list as default };
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { y as getClient } from "./src-CTD9-bSB.mjs";
|
|
2
|
+
import { t as outputResult } from "./output-DBvfyU1J.mjs";
|
|
3
|
+
import { r as printTable } from "./src-CP4YLIAh.mjs";
|
|
4
|
+
import { n as ENV_AUTH, r as ENV_PROJECT, t as BeeCommand } from "./bee-command-v0qvZeth.mjs";
|
|
5
|
+
import { E as resolveOptions, S as space, u as json, y as project } from "./common-options-BuYWxYdO.mjs";
|
|
6
|
+
import consola from "consola";
|
|
7
|
+
import { getGitRepositories } from "backlog-js";
|
|
8
|
+
//#region src/commands/repo/list.ts
|
|
9
|
+
const list = new BeeCommand("list").summary("List repositories in a project").description(`Repositories are listed in the configured display order.`).addOption(project()).addOption(json()).addOption(space()).envVars([...ENV_AUTH, ENV_PROJECT]).examples([{
|
|
10
|
+
description: "List repositories in a project",
|
|
11
|
+
command: "bee repo list -p PROJECT_KEY"
|
|
12
|
+
}, {
|
|
13
|
+
description: "Output as JSON",
|
|
14
|
+
command: "bee repo list -p PROJECT_KEY --json"
|
|
15
|
+
}]).action(async (opts, cmd) => {
|
|
16
|
+
await resolveOptions(cmd);
|
|
17
|
+
const { client } = await getClient(opts.space);
|
|
18
|
+
const repos = await getGitRepositories(client, opts.project);
|
|
19
|
+
outputResult(repos, opts, (data) => {
|
|
20
|
+
if (data.length === 0) {
|
|
21
|
+
consola.info("No repositories found.");
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
const rows = data.map((repo) => [
|
|
25
|
+
{
|
|
26
|
+
header: "NAME",
|
|
27
|
+
value: repo.name
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
header: "DESCRIPTION",
|
|
31
|
+
value: repo.description ?? ""
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
header: "LAST PUSHED",
|
|
35
|
+
value: repo.pushedAt?.slice(0, 10) ?? ""
|
|
36
|
+
}
|
|
37
|
+
]);
|
|
38
|
+
printTable(rows);
|
|
39
|
+
});
|
|
40
|
+
});
|
|
41
|
+
//#endregion
|
|
42
|
+
export { list as default };
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { y as getClient } from "./src-CTD9-bSB.mjs";
|
|
2
|
+
import { t as outputResult } from "./output-DBvfyU1J.mjs";
|
|
3
|
+
import { r as printTable } from "./src-CP4YLIAh.mjs";
|
|
4
|
+
import { n as ENV_AUTH, r as ENV_PROJECT, t as BeeCommand } from "./bee-command-v0qvZeth.mjs";
|
|
5
|
+
import { E as resolveOptions, S as space, d as keyword, u as json, y as project } from "./common-options-BuYWxYdO.mjs";
|
|
6
|
+
import consola from "consola";
|
|
7
|
+
import { getWikis } from "backlog-js";
|
|
8
|
+
//#region src/commands/wiki/list.ts
|
|
9
|
+
const list = new BeeCommand("list").summary("List wiki pages").description(`Use \`--keyword\` to filter pages by name or content.`).addOption(project()).addOption(keyword()).addOption(json()).addOption(space()).envVars([...ENV_AUTH, ENV_PROJECT]).examples([
|
|
10
|
+
{
|
|
11
|
+
description: "List all wiki pages in a project",
|
|
12
|
+
command: "bee wiki list -p PROJECT"
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
description: "Search wiki pages by keyword",
|
|
16
|
+
command: "bee wiki list -p PROJECT --keyword \"setup\""
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
description: "Output as JSON",
|
|
20
|
+
command: "bee wiki list -p PROJECT --json"
|
|
21
|
+
}
|
|
22
|
+
]).action(async (opts, cmd) => {
|
|
23
|
+
await resolveOptions(cmd);
|
|
24
|
+
const { client } = await getClient(opts.space);
|
|
25
|
+
const wikis = await getWikis(client, {
|
|
26
|
+
projectIdOrKey: opts.project,
|
|
27
|
+
keyword: opts.keyword
|
|
28
|
+
});
|
|
29
|
+
const json = opts.json === true ? "" : opts.json;
|
|
30
|
+
outputResult(wikis, { json }, (data) => {
|
|
31
|
+
if (data.length === 0) {
|
|
32
|
+
consola.info("No wiki pages found.");
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
const rows = data.map((wiki) => [
|
|
36
|
+
{
|
|
37
|
+
header: "ID",
|
|
38
|
+
value: String(wiki.id)
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
header: "NAME",
|
|
42
|
+
value: wiki.name
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
header: "UPDATED",
|
|
46
|
+
value: wiki.updated.slice(0, 10)
|
|
47
|
+
}
|
|
48
|
+
]);
|
|
49
|
+
printTable(rows);
|
|
50
|
+
});
|
|
51
|
+
});
|
|
52
|
+
//#endregion
|
|
53
|
+
export { list as default };
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { y as getClient } from "./src-CTD9-bSB.mjs";
|
|
2
|
+
import { t as outputResult } from "./output-DBvfyU1J.mjs";
|
|
3
|
+
import { r as printTable } from "./src-CP4YLIAh.mjs";
|
|
4
|
+
import { n as ENV_AUTH, t as BeeCommand } from "./bee-command-v0qvZeth.mjs";
|
|
5
|
+
import { S as space, u as json } from "./common-options-BuYWxYdO.mjs";
|
|
6
|
+
import consola from "consola";
|
|
7
|
+
import { getProjects } from "backlog-js";
|
|
8
|
+
//#region src/commands/project/list.ts
|
|
9
|
+
const list = new BeeCommand("list").summary("List projects").description(`By default, only active (non-archived) projects are shown. Use \`--all\` to list all projects in the space (admin only).`).option("--archived", "Include archived projects").option("--all", "Include all projects (admin only)").addOption(json()).addOption(space()).envVars([...ENV_AUTH]).examples([
|
|
10
|
+
{
|
|
11
|
+
description: "List your active projects",
|
|
12
|
+
command: "bee project list"
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
description: "Include archived projects",
|
|
16
|
+
command: "bee project list --archived"
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
description: "List all projects (admin only)",
|
|
20
|
+
command: "bee project list --all"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
description: "Output as JSON",
|
|
24
|
+
command: "bee project list --json"
|
|
25
|
+
}
|
|
26
|
+
]).action(async (opts) => {
|
|
27
|
+
const { client } = await getClient(opts.space);
|
|
28
|
+
const projects = await getProjects(client, {
|
|
29
|
+
archived: opts.archived,
|
|
30
|
+
all: opts.all
|
|
31
|
+
});
|
|
32
|
+
const jsonArg = opts.json === true ? "" : opts.json;
|
|
33
|
+
outputResult(projects, {
|
|
34
|
+
...opts,
|
|
35
|
+
json: jsonArg
|
|
36
|
+
}, (data) => {
|
|
37
|
+
if (data.length === 0) {
|
|
38
|
+
consola.info("No projects found.");
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
const rows = data.map((project) => [
|
|
42
|
+
{
|
|
43
|
+
header: "KEY",
|
|
44
|
+
value: project.projectKey
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
header: "NAME",
|
|
48
|
+
value: project.name
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
header: "STATUS",
|
|
52
|
+
value: project.archived ? "Archived" : "Active"
|
|
53
|
+
}
|
|
54
|
+
]);
|
|
55
|
+
printTable(rows);
|
|
56
|
+
});
|
|
57
|
+
});
|
|
58
|
+
//#endregion
|
|
59
|
+
export { list as default };
|