@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,26 @@
|
|
|
1
|
+
import { r as categoryUrl, y as getClient } from "./src-CTD9-bSB.mjs";
|
|
2
|
+
import { t as outputResult } from "./output-DBvfyU1J.mjs";
|
|
3
|
+
import { l as promptRequired } 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 { postCategories } from "backlog-js";
|
|
8
|
+
//#region src/commands/category/create.ts
|
|
9
|
+
const create = new BeeCommand("create").summary("Create a category").description(`Omitted fields will be prompted interactively.`).addOption(project()).option("-n, --name <value>", "Category name").addOption(json()).addOption(space()).envVars([...ENV_AUTH, ENV_PROJECT]).examples([{
|
|
10
|
+
description: "Create a category",
|
|
11
|
+
command: "bee category create -p PROJECT -n \"Bug Report\""
|
|
12
|
+
}, {
|
|
13
|
+
description: "Create interactively",
|
|
14
|
+
command: "bee category create -p PROJECT"
|
|
15
|
+
}]).action(async (opts, cmd) => {
|
|
16
|
+
await resolveOptions(cmd);
|
|
17
|
+
const { client, host } = await getClient(opts.space);
|
|
18
|
+
const name = await promptRequired("Category name:", opts.name);
|
|
19
|
+
const category = await postCategories(client, opts.project, { name });
|
|
20
|
+
outputResult(category, opts, (data) => {
|
|
21
|
+
consola.success(`Created category ${data.name} (ID: ${data.id})`);
|
|
22
|
+
consola.info(categoryUrl(host, data.id, data.projectId));
|
|
23
|
+
});
|
|
24
|
+
});
|
|
25
|
+
//#endregion
|
|
26
|
+
export { create as default };
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { C as resolveProjectIds, O as PRIORITY_NAMES, S as resolveUserId, k as PriorityId, u as issueUrl, y as getClient } from "./src-CTD9-bSB.mjs";
|
|
2
|
+
import { t as outputResult } from "./output-DBvfyU1J.mjs";
|
|
3
|
+
import { a as parseArg, l as promptRequired, o as vFiniteNumber, 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 { C as version, S as space, b as projectOptional, g as notify, i as category, p as milestone, r as attachment, t as assignee, u as json } from "./common-options-BuYWxYdO.mjs";
|
|
6
|
+
import consola from "consola";
|
|
7
|
+
import { postIssue } from "backlog-js";
|
|
8
|
+
import * as v from "valibot";
|
|
9
|
+
//#region src/commands/issue/create.ts
|
|
10
|
+
const create = new BeeCommand("create").summary("Create an issue").description(`Omitted required fields will be prompted interactively. Priority accepts a name: \`high\`, \`normal\`, or \`low\`.`).addOption(projectOptional()).option("-t, --title <text>", "Issue title").option("-T, --type <id>", "Issue type ID").option("-P, --priority <name>", "Priority").option("-d, --description <text>", "Issue description").addOption(assignee()).addOption(category()).addOption(version()).addOption(milestone()).option("--parent-issue <id>", "Parent issue ID").option("--start-date <date>", "Start date").option("--due-date <date>", "Due date").option("--estimated-hours <n>", "Estimated hours").option("--actual-hours <n>", "Actual hours").addOption(notify()).addOption(attachment()).addOption(json()).addOption(space()).envVars([...ENV_AUTH, ENV_PROJECT]).examples([
|
|
11
|
+
{
|
|
12
|
+
description: "Create an issue with required fields",
|
|
13
|
+
command: "bee issue create -p PROJECT --type 1 --priority normal -t \"Fix login bug\""
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
description: "Create an issue with description",
|
|
17
|
+
command: "bee issue create -p PROJECT --type 1 --priority normal -t \"Title\" -d \"Details here\""
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
description: "Create an issue assigned to yourself",
|
|
21
|
+
command: "bee issue create -p PROJECT --type 1 --priority high -t \"Title\" --assignee @me"
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
description: "Output as JSON",
|
|
25
|
+
command: "bee issue create -p PROJECT --type 1 --priority normal -t \"Title\" --json"
|
|
26
|
+
}
|
|
27
|
+
]).action(async (opts) => {
|
|
28
|
+
const { client, host } = await getClient(opts.space);
|
|
29
|
+
const project = await promptRequired("Project:", opts.project);
|
|
30
|
+
const title = await promptRequired("Summary:", opts.title);
|
|
31
|
+
const issueTypeId = await promptRequired("Issue type ID:", opts.type);
|
|
32
|
+
const priority = await promptRequired("Priority:", opts.priority, { valueHint: `{${PRIORITY_NAMES.join("|")}}` });
|
|
33
|
+
const priorityId = PriorityId[priority.toLowerCase()];
|
|
34
|
+
if (priorityId === void 0) throw new Error(`Unknown priority "${priority}". Valid values: ${PRIORITY_NAMES.join(", ")}`);
|
|
35
|
+
const [projectId] = await resolveProjectIds(client, [project]);
|
|
36
|
+
const assigneeId = opts.assignee ? await resolveUserId(client, opts.assignee) : void 0;
|
|
37
|
+
const categoryId = opts.category ?? [];
|
|
38
|
+
const versionId = opts.version ?? [];
|
|
39
|
+
const milestoneId = opts.milestone ?? [];
|
|
40
|
+
const notifiedUserId = opts.notify ?? [];
|
|
41
|
+
const attachmentId = opts.attachment ?? [];
|
|
42
|
+
const issue = await postIssue(client, {
|
|
43
|
+
projectId,
|
|
44
|
+
summary: title,
|
|
45
|
+
issueTypeId: parseArg(vInteger, issueTypeId, "issueTypeId"),
|
|
46
|
+
priorityId,
|
|
47
|
+
description: opts.description,
|
|
48
|
+
assigneeId,
|
|
49
|
+
categoryId,
|
|
50
|
+
versionId,
|
|
51
|
+
milestoneId,
|
|
52
|
+
parentIssueId: parseArg(v.optional(vInteger), opts.parentIssue, "--parent-issue"),
|
|
53
|
+
startDate: opts.startDate,
|
|
54
|
+
dueDate: opts.dueDate,
|
|
55
|
+
estimatedHours: parseArg(v.optional(vFiniteNumber), opts.estimatedHours, "--estimated-hours"),
|
|
56
|
+
actualHours: parseArg(v.optional(vFiniteNumber), opts.actualHours, "--actual-hours"),
|
|
57
|
+
notifiedUserId,
|
|
58
|
+
attachmentId
|
|
59
|
+
});
|
|
60
|
+
outputResult(issue, opts, (data) => {
|
|
61
|
+
consola.success(`Created issue ${data.issueKey}: ${data.summary}`);
|
|
62
|
+
consola.info(issueUrl(host, data.issueKey));
|
|
63
|
+
});
|
|
64
|
+
});
|
|
65
|
+
//#endregion
|
|
66
|
+
export { create as default };
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { m as projectUrl, y as getClient } from "./src-CTD9-bSB.mjs";
|
|
2
|
+
import { t as outputResult } from "./output-DBvfyU1J.mjs";
|
|
3
|
+
import { l as promptRequired } 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 { postProject } from "backlog-js";
|
|
8
|
+
//#region src/commands/project/create.ts
|
|
9
|
+
const create = new BeeCommand("create").summary("Create a project").description(`Project key must consist of uppercase letters, numbers, and underscores. Omitted fields will be prompted interactively.`).option("-k, --key <key>", "Project key").option("-n, --name <name>", "Project name").option("--chart-enabled", "Enable chart").option("--subtasking-enabled", "Enable subtasking").option("--project-leader-can-edit-project-leader", "Allow project administrators to manage each other").option("--text-formatting-rule <rule>", "Formatting rules").addOption(json()).addOption(space()).envVars([...ENV_AUTH]).examples([
|
|
10
|
+
{
|
|
11
|
+
description: "Create a project with key and name",
|
|
12
|
+
command: "bee project create --key TEST --name \"Test Project\""
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
description: "Create a project with markdown formatting",
|
|
16
|
+
command: "bee project create --key TEST --name \"Test Project\" --text-formatting-rule markdown"
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
description: "Create a project interactively",
|
|
20
|
+
command: "bee project create"
|
|
21
|
+
}
|
|
22
|
+
]).action(async (opts) => {
|
|
23
|
+
const { client, host } = await getClient(opts.space);
|
|
24
|
+
const key = await promptRequired("Project key:", opts.key);
|
|
25
|
+
const name = await promptRequired("Project name:", opts.name);
|
|
26
|
+
const project = await postProject(client, {
|
|
27
|
+
key,
|
|
28
|
+
name,
|
|
29
|
+
chartEnabled: opts.chartEnabled ?? false,
|
|
30
|
+
subtaskingEnabled: opts.subtaskingEnabled ?? false,
|
|
31
|
+
projectLeaderCanEditProjectLeader: opts.projectLeaderCanEditProjectLeader,
|
|
32
|
+
textFormattingRule: opts.textFormattingRule ?? "markdown"
|
|
33
|
+
});
|
|
34
|
+
const jsonArg = opts.json === true ? "" : opts.json;
|
|
35
|
+
outputResult(project, {
|
|
36
|
+
...opts,
|
|
37
|
+
json: jsonArg
|
|
38
|
+
}, (data) => {
|
|
39
|
+
consola.success(`Created project ${data.projectKey}: ${data.name}`);
|
|
40
|
+
consola.info(projectUrl(host, data.projectKey));
|
|
41
|
+
});
|
|
42
|
+
});
|
|
43
|
+
//#endregion
|
|
44
|
+
export { create as default };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { d as milestoneUrl, y as getClient } from "./src-CTD9-bSB.mjs";
|
|
2
|
+
import { t as outputResult } from "./output-DBvfyU1J.mjs";
|
|
3
|
+
import { l as promptRequired } 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 { postVersions } from "backlog-js";
|
|
8
|
+
//#region src/commands/milestone/create.ts
|
|
9
|
+
const create = new BeeCommand("create").summary("Create a milestone").description(`Omitted fields will be prompted interactively.`).addOption(project()).option("-n, --name <value>", "Milestone name").option("-d, --description <value>", "Milestone description").option("--start-date <yyyy-MM-dd>", "Start date").option("--release-due-date <yyyy-MM-dd>", "Release due date").addOption(json()).addOption(space()).envVars([...ENV_AUTH, ENV_PROJECT]).examples([{
|
|
10
|
+
description: "Create a milestone",
|
|
11
|
+
command: "bee milestone create -p PROJECT -n \"v1.0.0\""
|
|
12
|
+
}, {
|
|
13
|
+
description: "Create with dates",
|
|
14
|
+
command: "bee milestone create -p PROJECT -n \"v1.0.0\" --start-date 2026-04-01 --release-due-date 2026-06-30"
|
|
15
|
+
}]).action(async (opts, cmd) => {
|
|
16
|
+
await resolveOptions(cmd);
|
|
17
|
+
const { client, host } = await getClient(opts.space);
|
|
18
|
+
const name = await promptRequired("Milestone name:", opts.name);
|
|
19
|
+
const milestone = await postVersions(client, opts.project, {
|
|
20
|
+
name,
|
|
21
|
+
description: opts.description,
|
|
22
|
+
startDate: opts.startDate,
|
|
23
|
+
releaseDueDate: opts.releaseDueDate
|
|
24
|
+
});
|
|
25
|
+
outputResult(milestone, opts, (data) => {
|
|
26
|
+
consola.success(`Created milestone ${data.name} (ID: ${data.id})`);
|
|
27
|
+
consola.info(milestoneUrl(host, data.id));
|
|
28
|
+
});
|
|
29
|
+
});
|
|
30
|
+
//#endregion
|
|
31
|
+
export { create as default };
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { f as openOrPrintUrl, i as dashboardUrl, 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 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 { getIssues, getMyself, getNotificationsCount, getProjects } from "backlog-js";
|
|
9
|
+
//#region src/commands/dashboard.ts
|
|
10
|
+
const dashboard = new BeeCommand("dashboard").summary("Show a summary of your Backlog activity").description(`Displays assigned issues, unread notifications, and projects. Use \`--web\` to open in the browser.`).addOption(json()).addOption(web("dashboard")).addOption(noBrowser()).addOption(space()).envVars([...ENV_AUTH]).examples([
|
|
11
|
+
{
|
|
12
|
+
description: "Show dashboard",
|
|
13
|
+
command: "bee dashboard"
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
description: "Open dashboard in browser",
|
|
17
|
+
command: "bee dashboard --web"
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
description: "Output as JSON",
|
|
21
|
+
command: "bee dashboard --json"
|
|
22
|
+
}
|
|
23
|
+
]).action(async (opts) => {
|
|
24
|
+
const { client, host } = await getClient(opts.space);
|
|
25
|
+
if (opts.web || opts.browser === false) {
|
|
26
|
+
const url = dashboardUrl(host);
|
|
27
|
+
await openOrPrintUrl(url, opts.browser === false, consola);
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
const [myself, notifications, issues, projects] = await Promise.all([
|
|
31
|
+
getMyself(client),
|
|
32
|
+
getNotificationsCount(client, {
|
|
33
|
+
alreadyRead: false,
|
|
34
|
+
resourceAlreadyRead: false
|
|
35
|
+
}),
|
|
36
|
+
getIssues(client, {
|
|
37
|
+
assigneeId: [-1],
|
|
38
|
+
statusId: [
|
|
39
|
+
1,
|
|
40
|
+
2,
|
|
41
|
+
3
|
|
42
|
+
],
|
|
43
|
+
count: 20,
|
|
44
|
+
sort: "dueDate",
|
|
45
|
+
order: "asc"
|
|
46
|
+
}),
|
|
47
|
+
getProjects(client, { all: false })
|
|
48
|
+
]);
|
|
49
|
+
const result = {
|
|
50
|
+
myself,
|
|
51
|
+
notifications,
|
|
52
|
+
issues,
|
|
53
|
+
projects
|
|
54
|
+
};
|
|
55
|
+
const jsonVal = opts.json === true ? "" : opts.json;
|
|
56
|
+
outputResult(result, { json: jsonVal }, (data) => {
|
|
57
|
+
consola.log("");
|
|
58
|
+
consola.log(` ${data.myself.name} (${host})`);
|
|
59
|
+
if (data.notifications.count > 0) consola.log(` Unread notifications: ${data.notifications.count}`);
|
|
60
|
+
consola.log("");
|
|
61
|
+
consola.log(" Assigned Issues:");
|
|
62
|
+
if (data.issues.length === 0) consola.log(" No assigned issues.");
|
|
63
|
+
else {
|
|
64
|
+
const issueRows = data.issues.map((issue) => [
|
|
65
|
+
{
|
|
66
|
+
header: "KEY",
|
|
67
|
+
value: issue.issueKey
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
header: "SUMMARY",
|
|
71
|
+
value: issue.summary
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
header: "STATUS",
|
|
75
|
+
value: issue.status?.name ?? ""
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
header: "PRIORITY",
|
|
79
|
+
value: issue.priority?.name ?? ""
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
header: "DUE DATE",
|
|
83
|
+
value: issue.dueDate ? formatDate(issue.dueDate) : ""
|
|
84
|
+
}
|
|
85
|
+
]);
|
|
86
|
+
printTable(issueRows);
|
|
87
|
+
}
|
|
88
|
+
if (data.projects.length > 0) {
|
|
89
|
+
consola.log("");
|
|
90
|
+
consola.log(" Projects:");
|
|
91
|
+
for (const project of data.projects) consola.log(` ${project.projectKey.padEnd(20)} ${project.name}`);
|
|
92
|
+
}
|
|
93
|
+
consola.log("");
|
|
94
|
+
});
|
|
95
|
+
});
|
|
96
|
+
//#endregion
|
|
97
|
+
export { dashboard as default };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { y as getClient } from "./src-CTD9-bSB.mjs";
|
|
2
|
+
import { t as outputResult } from "./output-DBvfyU1J.mjs";
|
|
3
|
+
import { a as parseArg, c as confirmOrExit, 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 { E as resolveOptions, S as space, u as json, y as project } from "./common-options-BuYWxYdO.mjs";
|
|
6
|
+
import consola from "consola";
|
|
7
|
+
import { deleteCategories } from "backlog-js";
|
|
8
|
+
//#region src/commands/category/delete.ts
|
|
9
|
+
const deleteCategory = new BeeCommand("delete").summary("Delete a category").description(`This action is irreversible.`).argument("<category>", "Category ID").addOption(project()).addOption(json()).addOption(space()).envVars([...ENV_AUTH, ENV_PROJECT]).examples([{
|
|
10
|
+
description: "Delete a category (with confirmation)",
|
|
11
|
+
command: "bee category delete 12345 -p PROJECT"
|
|
12
|
+
}, {
|
|
13
|
+
description: "Delete without confirmation",
|
|
14
|
+
command: "bee category delete 12345 -p PROJECT --yes"
|
|
15
|
+
}]).action(async (category, opts, cmd) => {
|
|
16
|
+
await resolveOptions(cmd);
|
|
17
|
+
if (!await confirmOrExit(`Are you sure you want to delete category ${category}? This cannot be undone.`, opts.yes)) return;
|
|
18
|
+
const { client } = await getClient(opts.space);
|
|
19
|
+
const result = await deleteCategories(client, opts.project, parseArg(vInteger, category, "category"));
|
|
20
|
+
outputResult(result, opts, (data) => {
|
|
21
|
+
consola.success(`Deleted category ${data.name} (ID: ${data.id})`);
|
|
22
|
+
});
|
|
23
|
+
});
|
|
24
|
+
//#endregion
|
|
25
|
+
export { deleteCategory as default };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { y as getClient } from "./src-CTD9-bSB.mjs";
|
|
2
|
+
import { t as outputResult } from "./output-DBvfyU1J.mjs";
|
|
3
|
+
import { c as confirmOrExit } 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 { deleteDocument as deleteDocument$1 } from "backlog-js";
|
|
8
|
+
//#region src/commands/document/delete.ts
|
|
9
|
+
const deleteDocument = new BeeCommand("delete").summary("Delete a document").description(`This action is irreversible.`).argument("<document>", "Document ID").addOption(json()).addOption(space()).envVars([...ENV_AUTH]).examples([{
|
|
10
|
+
description: "Delete a document (with confirmation)",
|
|
11
|
+
command: "bee document delete 12345"
|
|
12
|
+
}, {
|
|
13
|
+
description: "Delete a document without confirmation",
|
|
14
|
+
command: "bee document delete 12345 --yes"
|
|
15
|
+
}]).action(async (document, opts) => {
|
|
16
|
+
if (!await confirmOrExit(`Are you sure you want to delete document ${document}? This cannot be undone.`, opts.yes)) return;
|
|
17
|
+
const { client } = await getClient(opts.space);
|
|
18
|
+
const doc = await deleteDocument$1(client, document);
|
|
19
|
+
outputResult(doc, opts, (data) => {
|
|
20
|
+
consola.success(`Deleted document ${data.title} (ID: ${data.id})`);
|
|
21
|
+
});
|
|
22
|
+
});
|
|
23
|
+
//#endregion
|
|
24
|
+
export { deleteDocument as default };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { y as getClient } from "./src-CTD9-bSB.mjs";
|
|
2
|
+
import { t as outputResult } from "./output-DBvfyU1J.mjs";
|
|
3
|
+
import { a as parseArg, c as confirmOrExit, 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 { E as resolveOptions, S as space, u as json, y as project } from "./common-options-BuYWxYdO.mjs";
|
|
6
|
+
import consola from "consola";
|
|
7
|
+
import { deleteIssueType as deleteIssueType$1 } from "backlog-js";
|
|
8
|
+
//#region src/commands/issue-type/delete.ts
|
|
9
|
+
const deleteIssueType = new BeeCommand("delete").summary("Delete an issue type").description(`All issues of this type are reassigned to the substitute issue type. This action is irreversible.`).argument("<issueType>", "Issue type ID").addOption(project()).requiredOption("--substitute-issue-type-id <value>", "Replacement issue type ID for affected issues").addOption(json()).addOption(space()).envVars([...ENV_AUTH, ENV_PROJECT]).examples([{
|
|
10
|
+
description: "Delete an issue type",
|
|
11
|
+
command: "bee issue-type delete 12345 -p PROJECT --substitute-issue-type-id 67890"
|
|
12
|
+
}, {
|
|
13
|
+
description: "Delete without confirmation",
|
|
14
|
+
command: "bee issue-type delete 12345 -p PROJECT --substitute-issue-type-id 67890 --yes"
|
|
15
|
+
}]).action(async (issueType, opts, cmd) => {
|
|
16
|
+
await resolveOptions(cmd);
|
|
17
|
+
if (!await confirmOrExit(`Are you sure you want to delete issue type ${issueType}? This cannot be undone.`, opts.yes)) return;
|
|
18
|
+
const { client } = await getClient(opts.space);
|
|
19
|
+
const result = await deleteIssueType$1(client, opts.project, parseArg(vInteger, issueType, "issueType"), { substituteIssueTypeId: parseArg(vInteger, opts.substituteIssueTypeId, "--substitute-issue-type-id") });
|
|
20
|
+
outputResult(result, opts, (data) => {
|
|
21
|
+
consola.success(`Deleted issue type ${data.name} (ID: ${data.id})`);
|
|
22
|
+
});
|
|
23
|
+
});
|
|
24
|
+
//#endregion
|
|
25
|
+
export { deleteIssueType as default };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { y as getClient } from "./src-CTD9-bSB.mjs";
|
|
2
|
+
import { t as outputResult } from "./output-DBvfyU1J.mjs";
|
|
3
|
+
import { c as confirmOrExit } 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 { deleteIssue as deleteIssue$1 } from "backlog-js";
|
|
8
|
+
//#region src/commands/issue/delete.ts
|
|
9
|
+
const deleteIssue = new BeeCommand("delete").summary("Delete an issue").description(`This action is irreversible.`).argument("<issue>", "Issue ID or issue key").addOption(json()).addOption(space()).envVars([...ENV_AUTH]).examples([{
|
|
10
|
+
description: "Delete an issue (with confirmation)",
|
|
11
|
+
command: "bee issue delete PROJECT-123"
|
|
12
|
+
}, {
|
|
13
|
+
description: "Delete an issue without confirmation",
|
|
14
|
+
command: "bee issue delete PROJECT-123 --yes"
|
|
15
|
+
}]).action(async (issue, opts) => {
|
|
16
|
+
if (!await confirmOrExit(`Are you sure you want to delete issue ${issue}? This cannot be undone.`, opts.yes)) return;
|
|
17
|
+
const { client } = await getClient(opts.space);
|
|
18
|
+
const issueData = await deleteIssue$1(client, issue);
|
|
19
|
+
outputResult(issueData, opts, (data) => {
|
|
20
|
+
consola.success(`Deleted issue ${data.issueKey}: ${data.summary}`);
|
|
21
|
+
});
|
|
22
|
+
});
|
|
23
|
+
//#endregion
|
|
24
|
+
export { deleteIssue as default };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { y as getClient } from "./src-CTD9-bSB.mjs";
|
|
2
|
+
import { t as outputResult } from "./output-DBvfyU1J.mjs";
|
|
3
|
+
import { a as parseArg, c as confirmOrExit, s as vInteger } from "./src-CP4YLIAh.mjs";
|
|
4
|
+
import { n as ENV_AUTH, t as BeeCommand } from "./bee-command-v0qvZeth.mjs";
|
|
5
|
+
import { S as space, u as json } from "./common-options-BuYWxYdO.mjs";
|
|
6
|
+
import consola from "consola";
|
|
7
|
+
import { deletehWatchingListItem } from "backlog-js";
|
|
8
|
+
//#region src/commands/watching/delete.ts
|
|
9
|
+
const deleteWatching = new BeeCommand("delete").summary("Delete a watching item").description(`Removes the issue from your watching list. You will no longer receive update notifications.`).argument("<watching>", "Watching ID").addOption(json()).addOption(space()).envVars([...ENV_AUTH]).examples([{
|
|
10
|
+
description: "Delete a watching item (with confirmation)",
|
|
11
|
+
command: "bee watching delete 12345"
|
|
12
|
+
}, {
|
|
13
|
+
description: "Delete without confirmation",
|
|
14
|
+
command: "bee watching delete 12345 --yes"
|
|
15
|
+
}]).action(async (watching, opts) => {
|
|
16
|
+
if (!await confirmOrExit(`Are you sure you want to delete watching ${watching}? This cannot be undone.`, opts.yes)) return;
|
|
17
|
+
const { client } = await getClient(opts.space);
|
|
18
|
+
const result = await deletehWatchingListItem(client, parseArg(vInteger, watching, "watching"));
|
|
19
|
+
outputResult(result, opts, (data) => {
|
|
20
|
+
consola.success(`Deleted watching ${data.id}.`);
|
|
21
|
+
});
|
|
22
|
+
});
|
|
23
|
+
//#endregion
|
|
24
|
+
export { deleteWatching as default };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { y as getClient } from "./src-CTD9-bSB.mjs";
|
|
2
|
+
import { t as outputResult } from "./output-DBvfyU1J.mjs";
|
|
3
|
+
import { a as parseArg, c as confirmOrExit, 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 { E as resolveOptions, S as space, u as json, y as project } from "./common-options-BuYWxYdO.mjs";
|
|
6
|
+
import consola from "consola";
|
|
7
|
+
import { deleteVersions } from "backlog-js";
|
|
8
|
+
//#region src/commands/milestone/delete.ts
|
|
9
|
+
const deleteMilestone = new BeeCommand("delete").summary("Delete a milestone").description(`This action is irreversible.`).argument("<milestone>", "Milestone ID").addOption(project()).addOption(json()).addOption(space()).envVars([...ENV_AUTH, ENV_PROJECT]).examples([{
|
|
10
|
+
description: "Delete a milestone (with confirmation)",
|
|
11
|
+
command: "bee milestone delete 12345 -p PROJECT"
|
|
12
|
+
}, {
|
|
13
|
+
description: "Delete without confirmation",
|
|
14
|
+
command: "bee milestone delete 12345 -p PROJECT --yes"
|
|
15
|
+
}]).action(async (milestone, opts, cmd) => {
|
|
16
|
+
await resolveOptions(cmd);
|
|
17
|
+
if (!await confirmOrExit(`Are you sure you want to delete milestone ${milestone}? This cannot be undone.`, opts.yes)) return;
|
|
18
|
+
const { client } = await getClient(opts.space);
|
|
19
|
+
const result = await deleteVersions(client, opts.project, parseArg(vInteger, milestone, "milestone"));
|
|
20
|
+
outputResult(result, opts, (data) => {
|
|
21
|
+
consola.success(`Deleted milestone ${data.name} (ID: ${data.id})`);
|
|
22
|
+
});
|
|
23
|
+
});
|
|
24
|
+
//#endregion
|
|
25
|
+
export { deleteMilestone as default };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { y as getClient } from "./src-CTD9-bSB.mjs";
|
|
2
|
+
import { t as outputResult } from "./output-DBvfyU1J.mjs";
|
|
3
|
+
import { c as confirmOrExit } 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 { deleteProject as deleteProject$1 } from "backlog-js";
|
|
8
|
+
//#region src/commands/project/delete.ts
|
|
9
|
+
const deleteProject = new BeeCommand("delete").summary("Delete a project").description(`This action is irreversible. Requires Administrator role.`).addOption(project()).addOption(json()).addOption(space()).envVars([...ENV_AUTH, ENV_PROJECT]).examples([{
|
|
10
|
+
description: "Delete a project (with confirmation)",
|
|
11
|
+
command: "bee project delete -p PROJECT_KEY"
|
|
12
|
+
}, {
|
|
13
|
+
description: "Delete a project without confirmation",
|
|
14
|
+
command: "bee project delete -p PROJECT_KEY --yes"
|
|
15
|
+
}]).action(async (opts, cmd) => {
|
|
16
|
+
await resolveOptions(cmd);
|
|
17
|
+
if (!await confirmOrExit(`Are you sure you want to delete project ${opts.project}? This cannot be undone.`, opts.yes)) return;
|
|
18
|
+
const { client } = await getClient(opts.space);
|
|
19
|
+
const projectData = await deleteProject$1(client, opts.project);
|
|
20
|
+
const jsonArg = opts.json === true ? "" : opts.json;
|
|
21
|
+
outputResult(projectData, {
|
|
22
|
+
...opts,
|
|
23
|
+
json: jsonArg
|
|
24
|
+
}, (data) => {
|
|
25
|
+
consola.success(`Deleted project ${data.projectKey}: ${data.name}`);
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
//#endregion
|
|
29
|
+
export { deleteProject as default };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { y as getClient } from "./src-CTD9-bSB.mjs";
|
|
2
|
+
import { t as outputResult } from "./output-DBvfyU1J.mjs";
|
|
3
|
+
import { a as parseArg, c as confirmOrExit, s as vInteger } from "./src-CP4YLIAh.mjs";
|
|
4
|
+
import { n as ENV_AUTH, t as BeeCommand } from "./bee-command-v0qvZeth.mjs";
|
|
5
|
+
import { S as space, u as json } from "./common-options-BuYWxYdO.mjs";
|
|
6
|
+
import consola from "consola";
|
|
7
|
+
import { deleteWiki as deleteWiki$1 } from "backlog-js";
|
|
8
|
+
//#region src/commands/wiki/delete.ts
|
|
9
|
+
const deleteWiki = new BeeCommand("delete").summary("Delete a wiki page").description(`This action is irreversible.`).argument("<wiki>", "Wiki page ID").option("--mail-notify", "Send notification email").addOption(json()).addOption(space()).envVars([...ENV_AUTH]).examples([{
|
|
10
|
+
description: "Delete a wiki page (with confirmation)",
|
|
11
|
+
command: "bee wiki delete 12345"
|
|
12
|
+
}, {
|
|
13
|
+
description: "Delete a wiki page without confirmation",
|
|
14
|
+
command: "bee wiki delete 12345 --yes"
|
|
15
|
+
}]).action(async (wiki, opts) => {
|
|
16
|
+
if (!await confirmOrExit(`Are you sure you want to delete wiki page ${wiki}? This cannot be undone.`, opts.yes)) return;
|
|
17
|
+
const { client } = await getClient(opts.space);
|
|
18
|
+
const wikiData = await deleteWiki$1(client, parseArg(vInteger, wiki, "wiki"), opts.mailNotify ?? false);
|
|
19
|
+
outputResult(wikiData, opts, (data) => {
|
|
20
|
+
consola.success(`Deleted wiki page ${data.id}: ${data.name}`);
|
|
21
|
+
});
|
|
22
|
+
});
|
|
23
|
+
//#endregion
|
|
24
|
+
export { deleteWiki as default };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { y as getClient } from "./src-CTD9-bSB.mjs";
|
|
2
|
+
import { t as outputResult } from "./output-DBvfyU1J.mjs";
|
|
3
|
+
import { a as parseArg, c as confirmOrExit, 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 { E as resolveOptions, S as space, u as json, y as project } from "./common-options-BuYWxYdO.mjs";
|
|
6
|
+
import consola from "consola";
|
|
7
|
+
import { deleteProjectStatus } from "backlog-js";
|
|
8
|
+
//#region src/commands/status/delete.ts
|
|
9
|
+
const deleteStatus = new BeeCommand("delete").summary("Delete a status").description(`All issues with this status are reassigned to the substitute status. This action is irreversible.`).argument("<status>", "Status ID").addOption(project()).requiredOption("--substitute-status-id <value>", "Replacement status ID for affected issues").addOption(json()).addOption(space()).envVars([...ENV_AUTH, ENV_PROJECT]).examples([{
|
|
10
|
+
description: "Delete a status",
|
|
11
|
+
command: "bee status delete 12345 -p PROJECT --substitute-status-id 67890"
|
|
12
|
+
}, {
|
|
13
|
+
description: "Delete without confirmation",
|
|
14
|
+
command: "bee status delete 12345 -p PROJECT --substitute-status-id 67890 --yes"
|
|
15
|
+
}]).action(async (status, opts, cmd) => {
|
|
16
|
+
await resolveOptions(cmd);
|
|
17
|
+
if (!await confirmOrExit(`Are you sure you want to delete status ${status}? This cannot be undone.`, opts.yes)) return;
|
|
18
|
+
const { client } = await getClient(opts.space);
|
|
19
|
+
const result = await deleteProjectStatus(client, opts.project, parseArg(vInteger, status, "status"), parseArg(vInteger, opts.substituteStatusId, "--substitute-status-id"));
|
|
20
|
+
outputResult(result, opts, (data) => {
|
|
21
|
+
consola.success(`Deleted status ${data.name} (ID: ${data.id})`);
|
|
22
|
+
});
|
|
23
|
+
});
|
|
24
|
+
//#endregion
|
|
25
|
+
export { deleteStatus as default };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { t as BeeCommand } from "./bee-command-v0qvZeth.mjs";
|
|
2
|
+
//#region src/commands/document/index.ts
|
|
3
|
+
const document = new BeeCommand("document").summary("Manage Backlog documents");
|
|
4
|
+
await document.addCommands([
|
|
5
|
+
import("./list-BMKaJoe_.mjs"),
|
|
6
|
+
import("./view-DBO75WzR.mjs"),
|
|
7
|
+
import("./tree-CozBqPbN.mjs"),
|
|
8
|
+
import("./attachments-CnL8t9tK.mjs"),
|
|
9
|
+
import("./create-BHjwacOk.mjs"),
|
|
10
|
+
import("./delete-BHNt5SWa.mjs")
|
|
11
|
+
]);
|
|
12
|
+
//#endregion
|
|
13
|
+
export { document as default };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { y as getClient } from "./src-CTD9-bSB.mjs";
|
|
2
|
+
import { t as outputResult } from "./output-DBvfyU1J.mjs";
|
|
3
|
+
import { a as parseArg, l as promptRequired, 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 { E as resolveOptions, S as space, u as json, y as project } from "./common-options-BuYWxYdO.mjs";
|
|
6
|
+
import consola from "consola";
|
|
7
|
+
import { patchCategories } from "backlog-js";
|
|
8
|
+
//#region src/commands/category/edit.ts
|
|
9
|
+
const edit = new BeeCommand("edit").summary("Edit a category").description(`Renames the specified category.`).argument("<category>", "Category ID").addOption(project()).option("-n, --name <value>", "New name of the category").addOption(json()).addOption(space()).envVars([...ENV_AUTH, ENV_PROJECT]).examples([{
|
|
10
|
+
description: "Rename a category",
|
|
11
|
+
command: "bee category edit 12345 -p PROJECT -n \"New Name\""
|
|
12
|
+
}]).action(async (category, opts, cmd) => {
|
|
13
|
+
await resolveOptions(cmd);
|
|
14
|
+
const { client } = await getClient(opts.space);
|
|
15
|
+
const name = await promptRequired("Category name:", opts.name);
|
|
16
|
+
const result = await patchCategories(client, opts.project, parseArg(vInteger, category, "category"), { name });
|
|
17
|
+
outputResult(result, opts, (data) => {
|
|
18
|
+
consola.success(`Updated category ${data.name} (ID: ${data.id})`);
|
|
19
|
+
});
|
|
20
|
+
});
|
|
21
|
+
//#endregion
|
|
22
|
+
export { edit as default };
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { y as getClient } from "./src-CTD9-bSB.mjs";
|
|
2
|
+
import { t as outputResult } from "./output-DBvfyU1J.mjs";
|
|
3
|
+
import { a as parseArg, 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 { E as resolveOptions, S as space, u as json, y as project } from "./common-options-BuYWxYdO.mjs";
|
|
6
|
+
import consola from "consola";
|
|
7
|
+
import { patchVersions } from "backlog-js";
|
|
8
|
+
//#region src/commands/milestone/edit.ts
|
|
9
|
+
const edit = new BeeCommand("edit").summary("Edit a milestone").description(`Only specified fields are updated; others remain unchanged.`).argument("<milestone>", "Milestone ID").addOption(project()).requiredOption("-n, --name <value>", "New name of the milestone").option("-d, --description <value>", "New description of the milestone").option("--start-date <yyyy-MM-dd>", "New start date").option("--release-due-date <yyyy-MM-dd>", "New release due date").option("--archived", "Change whether the milestone is archived").addOption(json()).addOption(space()).envVars([...ENV_AUTH, ENV_PROJECT]).examples([
|
|
10
|
+
{
|
|
11
|
+
description: "Rename a milestone",
|
|
12
|
+
command: "bee milestone edit 12345 -p PROJECT -n \"v2.0.0\""
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
description: "Archive a milestone",
|
|
16
|
+
command: "bee milestone edit 12345 -p PROJECT --archived"
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
description: "Update release date",
|
|
20
|
+
command: "bee milestone edit 12345 -p PROJECT --release-due-date 2026-12-31"
|
|
21
|
+
}
|
|
22
|
+
]).action(async (milestone, opts, cmd) => {
|
|
23
|
+
await resolveOptions(cmd);
|
|
24
|
+
const { client } = await getClient(opts.space);
|
|
25
|
+
const result = await patchVersions(client, opts.project, parseArg(vInteger, milestone, "milestone"), {
|
|
26
|
+
name: opts.name,
|
|
27
|
+
description: opts.description,
|
|
28
|
+
startDate: opts.startDate,
|
|
29
|
+
releaseDueDate: opts.releaseDueDate,
|
|
30
|
+
archived: opts.archived
|
|
31
|
+
});
|
|
32
|
+
outputResult(result, opts, (data) => {
|
|
33
|
+
consola.success(`Updated milestone ${data.name} (ID: ${data.id})`);
|
|
34
|
+
});
|
|
35
|
+
});
|
|
36
|
+
//#endregion
|
|
37
|
+
export { edit as default };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { y as getClient } from "./src-CTD9-bSB.mjs";
|
|
2
|
+
import { t as outputResult } from "./output-DBvfyU1J.mjs";
|
|
3
|
+
import { a as parseArg, s as vInteger } from "./src-CP4YLIAh.mjs";
|
|
4
|
+
import { n as resolveStdinArg } from "./stdin-C-vjNi9T.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 { patchWiki } from "backlog-js";
|
|
9
|
+
//#region src/commands/wiki/edit.ts
|
|
10
|
+
const edit = new BeeCommand("edit").summary("Edit a wiki page").description(`Only specified fields are updated. When input is piped, it is used as the body automatically.`).argument("<wiki>", "Wiki page ID").option("-n, --name <name>", "New name of the wiki page").option("-b, --body <text>", "New content of the wiki page").option("--mail-notify", "Send notification email").addOption(json()).addOption(space()).envVars([...ENV_AUTH]).examples([
|
|
11
|
+
{
|
|
12
|
+
description: "Update wiki page name",
|
|
13
|
+
command: "bee wiki edit 12345 -n \"New Name\""
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
description: "Update wiki page body",
|
|
17
|
+
command: "bee wiki edit 12345 -b \"New content\""
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
description: "Update body from stdin",
|
|
21
|
+
command: "echo \"New content\" | bee wiki edit 12345"
|
|
22
|
+
}
|
|
23
|
+
]).action(async (wiki, opts) => {
|
|
24
|
+
const { client } = await getClient(opts.space);
|
|
25
|
+
const content = await resolveStdinArg(opts.body);
|
|
26
|
+
const wikiData = await patchWiki(client, parseArg(vInteger, wiki, "wiki"), {
|
|
27
|
+
name: opts.name,
|
|
28
|
+
content,
|
|
29
|
+
mailNotify: opts.mailNotify
|
|
30
|
+
});
|
|
31
|
+
outputResult(wikiData, opts, (data) => {
|
|
32
|
+
consola.success(`Updated wiki page ${data.id}: ${data.name}`);
|
|
33
|
+
});
|
|
34
|
+
});
|
|
35
|
+
//#endregion
|
|
36
|
+
export { edit as default };
|