@nulab/bee 1.1.0 → 1.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -3
- 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 +35 -207
- 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.B3N0WBdU.mjs → src-BWaxjrq_.mjs} +143 -176
- 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 +12 -7
- package/dist/chunks/activities.mjs +0 -77
- package/dist/chunks/activities2.mjs +0 -77
- package/dist/chunks/activities3.mjs +0 -77
- package/dist/chunks/add-user.mjs +0 -40
- package/dist/chunks/add.mjs +0 -65
- package/dist/chunks/add2.mjs +0 -41
- package/dist/chunks/api.mjs +0 -176
- package/dist/chunks/attachments.mjs +0 -49
- package/dist/chunks/attachments2.mjs +0 -49
- package/dist/chunks/attachments3.mjs +0 -50
- package/dist/chunks/browse.mjs +0 -271
- package/dist/chunks/clone.mjs +0 -62
- package/dist/chunks/close.mjs +0 -52
- package/dist/chunks/comment.mjs +0 -127
- package/dist/chunks/comment2.mjs +0 -113
- package/dist/chunks/comments.mjs +0 -59
- package/dist/chunks/completion.mjs +0 -118
- package/dist/chunks/count.mjs +0 -70
- package/dist/chunks/count2.mjs +0 -71
- package/dist/chunks/count3.mjs +0 -61
- package/dist/chunks/count4.mjs +0 -37
- package/dist/chunks/count5.mjs +0 -54
- package/dist/chunks/create.mjs +0 -62
- package/dist/chunks/create2.mjs +0 -90
- package/dist/chunks/create3.mjs +0 -66
- package/dist/chunks/create4.mjs +0 -76
- package/dist/chunks/create5.mjs +0 -58
- package/dist/chunks/create6.mjs +0 -39
- package/dist/chunks/create7.mjs +0 -47
- package/dist/chunks/create8.mjs +0 -51
- package/dist/chunks/create9.mjs +0 -51
- package/dist/chunks/dashboard.mjs +0 -86
- package/dist/chunks/delete.mjs +0 -50
- package/dist/chunks/delete2.mjs +0 -48
- package/dist/chunks/delete3.mjs +0 -48
- package/dist/chunks/delete4.mjs +0 -51
- package/dist/chunks/delete5.mjs +0 -52
- package/dist/chunks/delete6.mjs +0 -52
- package/dist/chunks/delete7.mjs +0 -64
- package/dist/chunks/delete8.mjs +0 -55
- package/dist/chunks/delete9.mjs +0 -50
- package/dist/chunks/edit.mjs +0 -58
- package/dist/chunks/edit2.mjs +0 -80
- package/dist/chunks/edit3.mjs +0 -67
- package/dist/chunks/edit4.mjs +0 -53
- package/dist/chunks/edit5.mjs +0 -45
- package/dist/chunks/edit6.mjs +0 -56
- package/dist/chunks/edit7.mjs +0 -52
- package/dist/chunks/edit8.mjs +0 -52
- package/dist/chunks/history.mjs +0 -58
- 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 -54
- package/dist/chunks/list10.mjs +0 -46
- package/dist/chunks/list11.mjs +0 -51
- package/dist/chunks/list12.mjs +0 -47
- package/dist/chunks/list13.mjs +0 -47
- package/dist/chunks/list14.mjs +0 -56
- package/dist/chunks/list15.mjs +0 -48
- package/dist/chunks/list2.mjs +0 -105
- package/dist/chunks/list3.mjs +0 -87
- package/dist/chunks/list4.mjs +0 -81
- package/dist/chunks/list5.mjs +0 -79
- package/dist/chunks/list6.mjs +0 -47
- package/dist/chunks/list7.mjs +0 -50
- package/dist/chunks/list8.mjs +0 -48
- package/dist/chunks/list9.mjs +0 -55
- package/dist/chunks/login.mjs +0 -220
- package/dist/chunks/logout.mjs +0 -72
- package/dist/chunks/me.mjs +0 -50
- package/dist/chunks/read-all.mjs +0 -31
- package/dist/chunks/read.mjs +0 -31
- package/dist/chunks/read2.mjs +0 -29
- package/dist/chunks/refresh.mjs +0 -78
- package/dist/chunks/remove-user.mjs +0 -40
- package/dist/chunks/remove.mjs +0 -29
- package/dist/chunks/reopen.mjs +0 -44
- package/dist/chunks/status.mjs +0 -61
- package/dist/chunks/status2.mjs +0 -63
- package/dist/chunks/status3.mjs +0 -68
- package/dist/chunks/switch.mjs +0 -51
- package/dist/chunks/tags.mjs +0 -43
- package/dist/chunks/token.mjs +0 -38
- package/dist/chunks/tree.mjs +0 -63
- package/dist/chunks/users.mjs +0 -50
- package/dist/chunks/view.mjs +0 -60
- package/dist/chunks/view2.mjs +0 -96
- package/dist/chunks/view3.mjs +0 -70
- package/dist/chunks/view4.mjs +0 -72
- package/dist/chunks/view5.mjs +0 -63
- package/dist/chunks/view6.mjs +0 -54
- package/dist/chunks/view7.mjs +0 -50
- package/dist/chunks/view8.mjs +0 -63
- package/dist/chunks/view9.mjs +0 -50
- package/dist/shared/bee.BImw1HZl.mjs +0 -28
- package/dist/shared/bee.BTBGpv4K.mjs +0 -34
- package/dist/shared/bee.BXiuAfjJ.mjs +0 -10
- package/dist/shared/bee.BYqxm3yG.mjs +0 -24
- 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.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.DessOtkV.mjs +0 -132
- package/dist/shared/bee.DfqnFet4.mjs +0 -49
- package/dist/shared/bee.DoTvz3uW.mjs +0 -13
- package/dist/shared/bee.G4d7izLe.mjs +0 -14
- package/dist/shared/bee.KteAW2rM.mjs +0 -73
- package/dist/shared/bee.PF8hrVKn.mjs +0 -27
- package/dist/shared/bee.a05kNWpn.mjs +0 -32
- package/dist/shared/bee.n5MYN4a6.mjs +0 -12
- package/dist/shared/bee.x-FvgDW2.mjs +0 -37660
package/dist/chunks/clone.mjs
DELETED
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import { spawn } from 'node:child_process';
|
|
2
|
-
import consola from 'consola';
|
|
3
|
-
import { o as outputResult } from '../shared/bee.BTBGpv4K.mjs';
|
|
4
|
-
import 'node:stream/consumers';
|
|
5
|
-
import 'valibot';
|
|
6
|
-
import '../shared/bee.BYqxm3yG.mjs';
|
|
7
|
-
import { g as getClient } from '../shared/bee.DessOtkV.mjs';
|
|
8
|
-
import 'backlog-js';
|
|
9
|
-
import 'node:http';
|
|
10
|
-
import 'open';
|
|
11
|
-
import '../shared/bee.x-FvgDW2.mjs';
|
|
12
|
-
import { B as BeeCommand, E as ENV_AUTH, a as ENV_PROJECT } from '../shared/bee.KteAW2rM.mjs';
|
|
13
|
-
import { d as project, j as json, s as space, r as resolveOptions } from '../shared/bee.B3N0WBdU.mjs';
|
|
14
|
-
import '../shared/bee.CktwmH8R.mjs';
|
|
15
|
-
import '../shared/bee.DfqnFet4.mjs';
|
|
16
|
-
import '../shared/bee.BImw1HZl.mjs';
|
|
17
|
-
import 'node:module';
|
|
18
|
-
import 'commander';
|
|
19
|
-
import 'consola/utils';
|
|
20
|
-
import 'node:fs';
|
|
21
|
-
import 'node:path';
|
|
22
|
-
import 'node:os';
|
|
23
|
-
|
|
24
|
-
const gitClone = (gitArgs) => new Promise((resolve, reject) => {
|
|
25
|
-
const child = spawn("git", gitArgs, { stdio: "inherit" });
|
|
26
|
-
child.on("close", (code) => {
|
|
27
|
-
if (code === 0) {
|
|
28
|
-
resolve();
|
|
29
|
-
} else {
|
|
30
|
-
reject(new Error(`git clone exited with code ${code}`));
|
|
31
|
-
}
|
|
32
|
-
});
|
|
33
|
-
});
|
|
34
|
-
const clone = new BeeCommand("clone").summary("Clone a repository").description(`By default the SSH URL is used; pass \`--http\` to clone over HTTPS instead.`).argument("<repository>", "Repository name or ID").addOption(project()).option("-d, --directory <path>", "Directory to clone into").option("--http", "Clone using HTTP URL instead of SSH").addOption(json()).addOption(space()).envVars([...ENV_AUTH, ENV_PROJECT]).examples([
|
|
35
|
-
{ description: "Clone a repository", command: "bee repo clone api-server -p PROJECT_KEY" },
|
|
36
|
-
{
|
|
37
|
-
description: "Clone to a specific directory",
|
|
38
|
-
command: "bee repo clone api-server -p PROJECT_KEY --directory ./dest"
|
|
39
|
-
},
|
|
40
|
-
{
|
|
41
|
-
description: "Clone using HTTP URL",
|
|
42
|
-
command: "bee repo clone api-server -p PROJECT_KEY --http"
|
|
43
|
-
}
|
|
44
|
-
]).action(async (repository, opts, cmd) => {
|
|
45
|
-
await resolveOptions(cmd);
|
|
46
|
-
const { client } = await getClient(opts.space);
|
|
47
|
-
const repo = await client.getGitRepository(opts.project, repository);
|
|
48
|
-
if (opts.json !== void 0) {
|
|
49
|
-
outputResult(repo, opts, () => {
|
|
50
|
-
});
|
|
51
|
-
return;
|
|
52
|
-
}
|
|
53
|
-
const cloneUrl = opts.http ? repo.httpUrl : repo.sshUrl;
|
|
54
|
-
const gitArgs = ["clone", cloneUrl];
|
|
55
|
-
if (opts.directory) {
|
|
56
|
-
gitArgs.push(opts.directory);
|
|
57
|
-
}
|
|
58
|
-
consola.info(`Cloning into '${opts.directory ?? repo.name}'...`);
|
|
59
|
-
await gitClone(gitArgs);
|
|
60
|
-
});
|
|
61
|
-
|
|
62
|
-
export { clone as default };
|
package/dist/chunks/close.mjs
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import consola from 'consola';
|
|
2
|
-
import { R as ResolutionId, I as IssueStatusId } from '../shared/bee.Btmq3TXs.mjs';
|
|
3
|
-
import { o as outputResult } from '../shared/bee.BTBGpv4K.mjs';
|
|
4
|
-
import 'node:stream/consumers';
|
|
5
|
-
import 'valibot';
|
|
6
|
-
import { p as parseArg, v as vInteger } from '../shared/bee.BYqxm3yG.mjs';
|
|
7
|
-
import { g as getClient } from '../shared/bee.DessOtkV.mjs';
|
|
8
|
-
import 'backlog-js';
|
|
9
|
-
import 'node:http';
|
|
10
|
-
import 'open';
|
|
11
|
-
import 'node:child_process';
|
|
12
|
-
import '../shared/bee.x-FvgDW2.mjs';
|
|
13
|
-
import { B as BeeCommand, E as ENV_AUTH } from '../shared/bee.KteAW2rM.mjs';
|
|
14
|
-
import { x as notify, j as json, s as space } from '../shared/bee.B3N0WBdU.mjs';
|
|
15
|
-
import '../shared/bee.CktwmH8R.mjs';
|
|
16
|
-
import '../shared/bee.DfqnFet4.mjs';
|
|
17
|
-
import '../shared/bee.BImw1HZl.mjs';
|
|
18
|
-
import 'node:module';
|
|
19
|
-
import 'commander';
|
|
20
|
-
import 'consola/utils';
|
|
21
|
-
import 'node:fs';
|
|
22
|
-
import 'node:path';
|
|
23
|
-
import 'node:os';
|
|
24
|
-
|
|
25
|
-
const close = new BeeCommand("close").summary("Close an issue").description(
|
|
26
|
-
`Sets the status to Closed with resolution \`Fixed\` by default. Use \`--resolution\` for a different resolution.`
|
|
27
|
-
).argument("<issue>", "Issue ID or issue key").option("-c, --comment <text>", "Comment to add when closing").option("--resolution <name>", `Resolution`).addOption(notify()).addOption(json()).addOption(space()).envVars([...ENV_AUTH]).examples([
|
|
28
|
-
{ description: "Close an issue", command: "bee issue close PROJECT-123" },
|
|
29
|
-
{
|
|
30
|
-
description: "Close with a comment",
|
|
31
|
-
command: 'bee issue close PROJECT-123 -c "Done"'
|
|
32
|
-
},
|
|
33
|
-
{
|
|
34
|
-
description: "Close as duplicate",
|
|
35
|
-
command: "bee issue close PROJECT-123 --resolution duplicate"
|
|
36
|
-
}
|
|
37
|
-
]).action(async (issue, opts) => {
|
|
38
|
-
const { client } = await getClient(opts.space);
|
|
39
|
-
const resolutionId = opts.resolution ? ResolutionId[opts.resolution] ?? parseArg(vInteger, opts.resolution, "--resolution") : ResolutionId.fixed;
|
|
40
|
-
const notifiedUserId = opts.notify ?? [];
|
|
41
|
-
const issueData = await client.patchIssue(issue, {
|
|
42
|
-
statusId: IssueStatusId.Closed,
|
|
43
|
-
resolutionId,
|
|
44
|
-
comment: opts.comment,
|
|
45
|
-
notifiedUserId
|
|
46
|
-
});
|
|
47
|
-
outputResult(issueData, opts, (data) => {
|
|
48
|
-
consola.success(`Closed issue ${data.issueKey}: ${data.summary}`);
|
|
49
|
-
});
|
|
50
|
-
});
|
|
51
|
-
|
|
52
|
-
export { close as default };
|
package/dist/chunks/comment.mjs
DELETED
|
@@ -1,127 +0,0 @@
|
|
|
1
|
-
import consola from 'consola';
|
|
2
|
-
import { o as outputResult } from '../shared/bee.BTBGpv4K.mjs';
|
|
3
|
-
import { x as notify, y as attachment, j as json, s as space, e as confirmOrExit } from '../shared/bee.B3N0WBdU.mjs';
|
|
4
|
-
import { a as resolveStdinArg } from '../shared/bee.C--ZWPxf.mjs';
|
|
5
|
-
import 'valibot';
|
|
6
|
-
import '../shared/bee.BYqxm3yG.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.DessOtkV.mjs';
|
|
10
|
-
import 'backlog-js';
|
|
11
|
-
import 'node:http';
|
|
12
|
-
import 'open';
|
|
13
|
-
import 'node:child_process';
|
|
14
|
-
import '../shared/bee.x-FvgDW2.mjs';
|
|
15
|
-
import { B as BeeCommand, E as ENV_AUTH } from '../shared/bee.KteAW2rM.mjs';
|
|
16
|
-
import 'node:fs';
|
|
17
|
-
import 'node:path';
|
|
18
|
-
import 'node:os';
|
|
19
|
-
import 'node:stream/consumers';
|
|
20
|
-
import '../shared/bee.BImw1HZl.mjs';
|
|
21
|
-
import 'commander';
|
|
22
|
-
import '../shared/bee.DFnSWb6q.mjs';
|
|
23
|
-
import '../shared/bee.CktwmH8R.mjs';
|
|
24
|
-
import '../shared/bee.DfqnFet4.mjs';
|
|
25
|
-
import 'node:module';
|
|
26
|
-
import 'consola/utils';
|
|
27
|
-
|
|
28
|
-
const comment = new BeeCommand("comment").summary("Add a comment to an issue").description(
|
|
29
|
-
`When input is piped, it is used as the body automatically.
|
|
30
|
-
|
|
31
|
-
Use \`--list\`, \`--edit-last\`, or \`--delete-last\` for other comment operations.`
|
|
32
|
-
).argument("<issue>", "Issue ID or issue key").option("-b, --body <text>", "Comment body").addOption(notify()).addOption(attachment()).option("--list", "List comments on the issue").option("--edit-last", "Edit your most recent comment").option("--delete-last", "Delete your most recent comment").addOption(json()).addOption(space()).envVars([...ENV_AUTH]).examples([
|
|
33
|
-
{
|
|
34
|
-
description: "Add a comment",
|
|
35
|
-
command: 'bee issue comment PROJECT-123 -b "This is a comment"'
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
description: "Add a comment from stdin",
|
|
39
|
-
command: 'echo "Comment body" | bee issue comment PROJECT-123'
|
|
40
|
-
},
|
|
41
|
-
{ description: "List all comments", command: "bee issue comment PROJECT-123 --list" },
|
|
42
|
-
{
|
|
43
|
-
description: "Edit your last comment",
|
|
44
|
-
command: 'bee issue comment PROJECT-123 --edit-last -b "Updated text"'
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
description: "Delete your last comment",
|
|
48
|
-
command: "bee issue comment PROJECT-123 --delete-last --yes"
|
|
49
|
-
}
|
|
50
|
-
]).action(async (issue, opts) => {
|
|
51
|
-
const { client } = await getClient(opts.space);
|
|
52
|
-
if (opts.list) {
|
|
53
|
-
const comments = await client.getIssueComments(issue, { order: "asc" });
|
|
54
|
-
outputResult(comments, opts, (data) => {
|
|
55
|
-
const filtered = data.filter((c) => c.content);
|
|
56
|
-
if (filtered.length === 0) {
|
|
57
|
-
consola.info("No comments found.");
|
|
58
|
-
return;
|
|
59
|
-
}
|
|
60
|
-
const rows = filtered.map((c) => [
|
|
61
|
-
{ header: "ID", value: String(c.id) },
|
|
62
|
-
{ header: "AUTHOR", value: c.createdUser.name },
|
|
63
|
-
{ header: "DATE", value: formatDate(c.created) },
|
|
64
|
-
{ header: "CONTENT", value: c.content }
|
|
65
|
-
]);
|
|
66
|
-
printTable(rows);
|
|
67
|
-
});
|
|
68
|
-
return;
|
|
69
|
-
}
|
|
70
|
-
if (opts.editLast) {
|
|
71
|
-
const myself = await client.getMyself();
|
|
72
|
-
const comments = await client.getIssueComments(issue, { order: "desc" });
|
|
73
|
-
const myComment = comments.find((c) => c.createdUser.id === myself.id);
|
|
74
|
-
if (!myComment) {
|
|
75
|
-
consola.error(`No comment by you was found on ${issue}.`);
|
|
76
|
-
return;
|
|
77
|
-
}
|
|
78
|
-
const content2 = await resolveStdinArg(opts.body) ?? opts.body;
|
|
79
|
-
if (!content2) {
|
|
80
|
-
consola.error("Comment body is required. Use --body or pipe input.");
|
|
81
|
-
return;
|
|
82
|
-
}
|
|
83
|
-
const result2 = await client.patchIssueComment(issue, myComment.id, { content: content2 });
|
|
84
|
-
outputResult(result2, opts, () => {
|
|
85
|
-
consola.success(`Updated comment on ${issue}`);
|
|
86
|
-
});
|
|
87
|
-
return;
|
|
88
|
-
}
|
|
89
|
-
if (opts.deleteLast) {
|
|
90
|
-
const myself = await client.getMyself();
|
|
91
|
-
const comments = await client.getIssueComments(issue, { order: "desc" });
|
|
92
|
-
const myComment = comments.find((c) => c.createdUser.id === myself.id);
|
|
93
|
-
if (!myComment) {
|
|
94
|
-
consola.error(`No comment by you was found on ${issue}.`);
|
|
95
|
-
return;
|
|
96
|
-
}
|
|
97
|
-
const confirmed = await confirmOrExit(
|
|
98
|
-
`Are you sure you want to delete your comment on ${issue}?`,
|
|
99
|
-
opts.yes
|
|
100
|
-
);
|
|
101
|
-
if (!confirmed) {
|
|
102
|
-
return;
|
|
103
|
-
}
|
|
104
|
-
const result2 = await client.deleteIssueComment(issue, myComment.id);
|
|
105
|
-
outputResult(result2, opts, () => {
|
|
106
|
-
consola.success(`Deleted comment on ${issue}`);
|
|
107
|
-
});
|
|
108
|
-
return;
|
|
109
|
-
}
|
|
110
|
-
const content = await resolveStdinArg(opts.body) ?? opts.body;
|
|
111
|
-
if (!content) {
|
|
112
|
-
consola.error("Comment body is required. Use --body or pipe input.");
|
|
113
|
-
return;
|
|
114
|
-
}
|
|
115
|
-
const notifiedUserId = opts.notify ?? [];
|
|
116
|
-
const attachmentId = opts.attachment ?? [];
|
|
117
|
-
const result = await client.postIssueComments(issue, {
|
|
118
|
-
content,
|
|
119
|
-
notifiedUserId,
|
|
120
|
-
attachmentId
|
|
121
|
-
});
|
|
122
|
-
outputResult(result, opts, () => {
|
|
123
|
-
consola.success(`Added comment to ${issue}`);
|
|
124
|
-
});
|
|
125
|
-
});
|
|
126
|
-
|
|
127
|
-
export { comment as default };
|
package/dist/chunks/comment2.mjs
DELETED
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
import consola from 'consola';
|
|
2
|
-
import { o as outputResult } from '../shared/bee.BTBGpv4K.mjs';
|
|
3
|
-
import { a as resolveStdinArg } from '../shared/bee.C--ZWPxf.mjs';
|
|
4
|
-
import 'valibot';
|
|
5
|
-
import { p as parseArg, v as vInteger } from '../shared/bee.BYqxm3yG.mjs';
|
|
6
|
-
import { f as formatDate } from '../shared/bee.n5MYN4a6.mjs';
|
|
7
|
-
import { p as printTable } from '../shared/bee.a05kNWpn.mjs';
|
|
8
|
-
import { g as getClient } from '../shared/bee.DessOtkV.mjs';
|
|
9
|
-
import 'backlog-js';
|
|
10
|
-
import 'node:http';
|
|
11
|
-
import 'open';
|
|
12
|
-
import 'node:child_process';
|
|
13
|
-
import '../shared/bee.x-FvgDW2.mjs';
|
|
14
|
-
import { B as BeeCommand, E as ENV_AUTH, a as ENV_PROJECT, b as ENV_REPO } from '../shared/bee.KteAW2rM.mjs';
|
|
15
|
-
import { d as project, C as repo, x as notify, j as json, s as space, r as resolveOptions } from '../shared/bee.B3N0WBdU.mjs';
|
|
16
|
-
import 'node:stream/consumers';
|
|
17
|
-
import '../shared/bee.DFnSWb6q.mjs';
|
|
18
|
-
import '../shared/bee.CktwmH8R.mjs';
|
|
19
|
-
import '../shared/bee.DfqnFet4.mjs';
|
|
20
|
-
import '../shared/bee.BImw1HZl.mjs';
|
|
21
|
-
import 'node:module';
|
|
22
|
-
import 'commander';
|
|
23
|
-
import 'consola/utils';
|
|
24
|
-
import 'node:fs';
|
|
25
|
-
import 'node:path';
|
|
26
|
-
import 'node:os';
|
|
27
|
-
|
|
28
|
-
const comment = new BeeCommand("comment").summary("Add a comment to a pull request").description(
|
|
29
|
-
`When input is piped, it is used as the body automatically.
|
|
30
|
-
|
|
31
|
-
Use \`--list\` or \`--edit-last\` for other comment operations.`
|
|
32
|
-
).argument("<number>", "Pull request number").addOption(project()).addOption(repo()).option("-b, --body <text>", "Comment body").addOption(notify()).option("--list", "List comments on the pull request").option("--edit-last", "Edit your most recent comment").addOption(json()).addOption(space()).envVars([...ENV_AUTH, ENV_PROJECT, ENV_REPO]).examples([
|
|
33
|
-
{
|
|
34
|
-
description: "Add a comment",
|
|
35
|
-
command: 'bee pr comment 42 -p PROJECT -R repo -b "Looks good!"'
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
description: "Add a comment from stdin",
|
|
39
|
-
command: 'echo "Comment body" | bee pr comment 42 -p PROJECT -R repo'
|
|
40
|
-
},
|
|
41
|
-
{ description: "List all comments", command: "bee pr comment 42 -p PROJECT -R repo --list" },
|
|
42
|
-
{
|
|
43
|
-
description: "Edit your last comment",
|
|
44
|
-
command: 'bee pr comment 42 -p PROJECT -R repo --edit-last -b "Updated"'
|
|
45
|
-
}
|
|
46
|
-
]).action(async (number, opts, cmd) => {
|
|
47
|
-
await resolveOptions(cmd);
|
|
48
|
-
const { client } = await getClient(opts.space);
|
|
49
|
-
const prNumber = parseArg(vInteger, number, "number");
|
|
50
|
-
const json = opts.json === true ? "" : opts.json;
|
|
51
|
-
if (opts.list) {
|
|
52
|
-
const comments = await client.getPullRequestComments(opts.project, opts.repo, prNumber, {
|
|
53
|
-
order: "asc"
|
|
54
|
-
});
|
|
55
|
-
outputResult(comments, { json }, (data) => {
|
|
56
|
-
const filtered = data.filter((c) => c.content);
|
|
57
|
-
if (filtered.length === 0) {
|
|
58
|
-
consola.info("No comments found.");
|
|
59
|
-
return;
|
|
60
|
-
}
|
|
61
|
-
const rows = filtered.map((c) => [
|
|
62
|
-
{ header: "ID", value: String(c.id) },
|
|
63
|
-
{ header: "AUTHOR", value: c.createdUser.name },
|
|
64
|
-
{ header: "DATE", value: formatDate(c.created) },
|
|
65
|
-
{ header: "CONTENT", value: c.content }
|
|
66
|
-
]);
|
|
67
|
-
printTable(rows);
|
|
68
|
-
});
|
|
69
|
-
return;
|
|
70
|
-
}
|
|
71
|
-
if (opts.editLast) {
|
|
72
|
-
const myself = await client.getMyself();
|
|
73
|
-
const comments = await client.getPullRequestComments(opts.project, opts.repo, prNumber, {
|
|
74
|
-
order: "desc"
|
|
75
|
-
});
|
|
76
|
-
const myComment = comments.find((c) => c.createdUser.id === myself.id);
|
|
77
|
-
if (!myComment) {
|
|
78
|
-
consola.error(`No comment by you was found on pull request #${number}.`);
|
|
79
|
-
return;
|
|
80
|
-
}
|
|
81
|
-
const content2 = await resolveStdinArg(opts.body) ?? opts.body;
|
|
82
|
-
if (!content2) {
|
|
83
|
-
consola.error("Comment body is required. Use --body or pipe input.");
|
|
84
|
-
return;
|
|
85
|
-
}
|
|
86
|
-
const result2 = await client.patchPullRequestComments(
|
|
87
|
-
opts.project,
|
|
88
|
-
opts.repo,
|
|
89
|
-
prNumber,
|
|
90
|
-
myComment.id,
|
|
91
|
-
{ content: content2 }
|
|
92
|
-
);
|
|
93
|
-
outputResult(result2, { json }, () => {
|
|
94
|
-
consola.success(`Updated comment on pull request #${number}`);
|
|
95
|
-
});
|
|
96
|
-
return;
|
|
97
|
-
}
|
|
98
|
-
const content = await resolveStdinArg(opts.body) ?? opts.body;
|
|
99
|
-
if (!content) {
|
|
100
|
-
consola.error("Comment body is required. Use --body or pipe input.");
|
|
101
|
-
return;
|
|
102
|
-
}
|
|
103
|
-
const notifiedUserId = opts.notify ?? [];
|
|
104
|
-
const result = await client.postPullRequestComments(opts.project, opts.repo, prNumber, {
|
|
105
|
-
content,
|
|
106
|
-
notifiedUserId
|
|
107
|
-
});
|
|
108
|
-
outputResult(result, { json }, () => {
|
|
109
|
-
consola.success(`Added comment to pull request #${number}`);
|
|
110
|
-
});
|
|
111
|
-
});
|
|
112
|
-
|
|
113
|
-
export { comment as default };
|
package/dist/chunks/comments.mjs
DELETED
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import consola from 'consola';
|
|
2
|
-
import { o as outputResult } from '../shared/bee.BTBGpv4K.mjs';
|
|
3
|
-
import 'node:stream/consumers';
|
|
4
|
-
import * as v from 'valibot';
|
|
5
|
-
import { p as parseArg, v as vInteger } from '../shared/bee.BYqxm3yG.mjs';
|
|
6
|
-
import { f as formatDate } from '../shared/bee.n5MYN4a6.mjs';
|
|
7
|
-
import { g as getClient } from '../shared/bee.DessOtkV.mjs';
|
|
8
|
-
import 'backlog-js';
|
|
9
|
-
import 'node:http';
|
|
10
|
-
import 'open';
|
|
11
|
-
import 'node:child_process';
|
|
12
|
-
import '../shared/bee.x-FvgDW2.mjs';
|
|
13
|
-
import { B as BeeCommand, E as ENV_AUTH, a as ENV_PROJECT, b as ENV_REPO } from '../shared/bee.KteAW2rM.mjs';
|
|
14
|
-
import { d as project, C as repo, A as minId, B as maxId, g as count, o as order, j as json, s as space, r as resolveOptions } from '../shared/bee.B3N0WBdU.mjs';
|
|
15
|
-
import '../shared/bee.CktwmH8R.mjs';
|
|
16
|
-
import '../shared/bee.DfqnFet4.mjs';
|
|
17
|
-
import '../shared/bee.BImw1HZl.mjs';
|
|
18
|
-
import 'node:module';
|
|
19
|
-
import 'commander';
|
|
20
|
-
import 'consola/utils';
|
|
21
|
-
import 'node:fs';
|
|
22
|
-
import 'node:path';
|
|
23
|
-
import 'node:os';
|
|
24
|
-
|
|
25
|
-
const comments = new BeeCommand("comments").summary("List comments on a pull request").description(`Displays all comments in chronological order.`).argument("<number>", "Pull request number").addOption(project()).addOption(repo()).addOption(minId()).addOption(maxId()).addOption(count()).addOption(order()).addOption(json()).addOption(space()).envVars([...ENV_AUTH, ENV_PROJECT, ENV_REPO]).examples([
|
|
26
|
-
{
|
|
27
|
-
description: "List pull request comments",
|
|
28
|
-
command: "bee pr comments 42 -p PROJECT -R repo"
|
|
29
|
-
},
|
|
30
|
-
{ description: "Output as JSON", command: "bee pr comments 42 -p PROJECT -R repo --json" }
|
|
31
|
-
]).action(async (number, opts, cmd) => {
|
|
32
|
-
await resolveOptions(cmd);
|
|
33
|
-
const { client } = await getClient(opts.space);
|
|
34
|
-
const prNumber = parseArg(vInteger, number, "number");
|
|
35
|
-
const prComments = await client.getPullRequestComments(opts.project, opts.repo, prNumber, {
|
|
36
|
-
minId: parseArg(v.optional(vInteger), opts.minId, "--min-id"),
|
|
37
|
-
maxId: parseArg(v.optional(vInteger), opts.maxId, "--max-id"),
|
|
38
|
-
order: opts.order ?? "asc",
|
|
39
|
-
count: parseArg(v.optional(vInteger), opts.count, "--count")
|
|
40
|
-
});
|
|
41
|
-
const json = opts.json === true ? "" : opts.json;
|
|
42
|
-
outputResult(prComments, { json }, (data) => {
|
|
43
|
-
const contentComments = data.filter((c) => c.content);
|
|
44
|
-
if (contentComments.length === 0) {
|
|
45
|
-
consola.info("No comments found.");
|
|
46
|
-
return;
|
|
47
|
-
}
|
|
48
|
-
consola.log("");
|
|
49
|
-
for (const comment of contentComments) {
|
|
50
|
-
consola.log(` ${comment.createdUser.name} (${formatDate(comment.created)}):`);
|
|
51
|
-
consola.log(
|
|
52
|
-
comment.content.split("\n").map((line) => ` ${line}`).join("\n")
|
|
53
|
-
);
|
|
54
|
-
consola.log("");
|
|
55
|
-
}
|
|
56
|
-
});
|
|
57
|
-
});
|
|
58
|
-
|
|
59
|
-
export { comments as default };
|
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
import 'consola';
|
|
2
|
-
import { U as UserError } from '../shared/bee.BYqxm3yG.mjs';
|
|
3
|
-
import 'node:stream/consumers';
|
|
4
|
-
import 'valibot';
|
|
5
|
-
import { B as BeeCommand } from '../shared/bee.KteAW2rM.mjs';
|
|
6
|
-
import 'commander';
|
|
7
|
-
import 'consola/utils';
|
|
8
|
-
|
|
9
|
-
const COMPLETION_SCRIPTS = {
|
|
10
|
-
bash: `# bash completion for bee
|
|
11
|
-
# Add to ~/.bashrc:
|
|
12
|
-
# eval "$(bee completion bash)"
|
|
13
|
-
|
|
14
|
-
_bee_completions() {
|
|
15
|
-
local cur="\${COMP_WORDS[COMP_CWORD]}"
|
|
16
|
-
local commands="auth project issue document notification pr repo team user wiki category milestone issue-type space status star watching dashboard browse api completion"
|
|
17
|
-
|
|
18
|
-
if [ "\${COMP_CWORD}" -eq 1 ]; then
|
|
19
|
-
COMPREPLY=( $(compgen -W "\${commands}" -- "\${cur}") )
|
|
20
|
-
fi
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
complete -F _bee_completions bee
|
|
24
|
-
`,
|
|
25
|
-
zsh: `#compdef bee
|
|
26
|
-
# zsh completion for bee
|
|
27
|
-
# Add to ~/.zshrc:
|
|
28
|
-
# eval "$(bee completion zsh)"
|
|
29
|
-
|
|
30
|
-
_bee() {
|
|
31
|
-
local -a commands
|
|
32
|
-
commands=(
|
|
33
|
-
'auth:auth commands' \\
|
|
34
|
-
'project:project commands' \\
|
|
35
|
-
'issue:issue commands' \\
|
|
36
|
-
'document:document commands' \\
|
|
37
|
-
'notification:notification commands' \\
|
|
38
|
-
'pr:pr commands' \\
|
|
39
|
-
'repo:repo commands' \\
|
|
40
|
-
'team:team commands' \\
|
|
41
|
-
'user:user commands' \\
|
|
42
|
-
'wiki:wiki commands' \\
|
|
43
|
-
'category:category commands' \\
|
|
44
|
-
'milestone:milestone commands' \\
|
|
45
|
-
'issue-type:issue-type commands' \\
|
|
46
|
-
'space:space commands' \\
|
|
47
|
-
'status:status commands' \\
|
|
48
|
-
'star:star commands' \\
|
|
49
|
-
'watching:watching commands' \\
|
|
50
|
-
'dashboard:dashboard commands' \\
|
|
51
|
-
'browse:browse commands' \\
|
|
52
|
-
'api:api commands' \\
|
|
53
|
-
'completion:completion commands'
|
|
54
|
-
)
|
|
55
|
-
|
|
56
|
-
_arguments '1: :->command' '*:: :->args'
|
|
57
|
-
|
|
58
|
-
case $state in
|
|
59
|
-
command)
|
|
60
|
-
_describe 'command' commands
|
|
61
|
-
;;
|
|
62
|
-
esac
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
compdef _bee bee
|
|
66
|
-
`,
|
|
67
|
-
fish: `# fish completion for bee
|
|
68
|
-
# Add to ~/.config/fish/completions/bee.fish:
|
|
69
|
-
# bee completion fish > ~/.config/fish/completions/bee.fish
|
|
70
|
-
|
|
71
|
-
complete -c bee -e
|
|
72
|
-
complete -c bee -n "__fish_use_subcommand" -a "auth" -d "auth commands"
|
|
73
|
-
complete -c bee -n "__fish_use_subcommand" -a "project" -d "project commands"
|
|
74
|
-
complete -c bee -n "__fish_use_subcommand" -a "issue" -d "issue commands"
|
|
75
|
-
complete -c bee -n "__fish_use_subcommand" -a "document" -d "document commands"
|
|
76
|
-
complete -c bee -n "__fish_use_subcommand" -a "notification" -d "notification commands"
|
|
77
|
-
complete -c bee -n "__fish_use_subcommand" -a "pr" -d "pr commands"
|
|
78
|
-
complete -c bee -n "__fish_use_subcommand" -a "repo" -d "repo commands"
|
|
79
|
-
complete -c bee -n "__fish_use_subcommand" -a "team" -d "team commands"
|
|
80
|
-
complete -c bee -n "__fish_use_subcommand" -a "user" -d "user commands"
|
|
81
|
-
complete -c bee -n "__fish_use_subcommand" -a "wiki" -d "wiki commands"
|
|
82
|
-
complete -c bee -n "__fish_use_subcommand" -a "category" -d "category commands"
|
|
83
|
-
complete -c bee -n "__fish_use_subcommand" -a "milestone" -d "milestone commands"
|
|
84
|
-
complete -c bee -n "__fish_use_subcommand" -a "issue-type" -d "issue-type commands"
|
|
85
|
-
complete -c bee -n "__fish_use_subcommand" -a "space" -d "space commands"
|
|
86
|
-
complete -c bee -n "__fish_use_subcommand" -a "status" -d "status commands"
|
|
87
|
-
complete -c bee -n "__fish_use_subcommand" -a "star" -d "star commands"
|
|
88
|
-
complete -c bee -n "__fish_use_subcommand" -a "watching" -d "watching commands"
|
|
89
|
-
complete -c bee -n "__fish_use_subcommand" -a "dashboard" -d "dashboard commands"
|
|
90
|
-
complete -c bee -n "__fish_use_subcommand" -a "browse" -d "browse commands"
|
|
91
|
-
complete -c bee -n "__fish_use_subcommand" -a "api" -d "api commands"
|
|
92
|
-
complete -c bee -n "__fish_use_subcommand" -a "completion" -d "completion commands"
|
|
93
|
-
`
|
|
94
|
-
};
|
|
95
|
-
const completion = new BeeCommand("completion").summary("Generate shell completion scripts").description(`Supported shells: bash, zsh, fish. Source the output in your shell configuration.`).argument("<shell>", "Shell to generate completions for").examples([
|
|
96
|
-
{
|
|
97
|
-
description: "Set up completions for bash (add to ~/.bashrc)",
|
|
98
|
-
command: `echo 'eval "$(bee completion bash)"' >> ~/.bashrc`
|
|
99
|
-
},
|
|
100
|
-
{
|
|
101
|
-
description: "Set up completions for zsh (add to ~/.zshrc)",
|
|
102
|
-
command: `echo 'eval "$(bee completion zsh)"' >> ~/.zshrc`
|
|
103
|
-
},
|
|
104
|
-
{
|
|
105
|
-
description: "Set up completions for fish",
|
|
106
|
-
command: "bee completion fish > ~/.config/fish/completions/bee.fish"
|
|
107
|
-
}
|
|
108
|
-
]).action((shell) => {
|
|
109
|
-
const script = COMPLETION_SCRIPTS[shell];
|
|
110
|
-
if (!script) {
|
|
111
|
-
throw new UserError(
|
|
112
|
-
`Unsupported shell: "${shell}". Supported shells: ${Object.keys(COMPLETION_SCRIPTS).join(", ")}.`
|
|
113
|
-
);
|
|
114
|
-
}
|
|
115
|
-
process.stdout.write(script);
|
|
116
|
-
});
|
|
117
|
-
|
|
118
|
-
export { completion as default };
|
package/dist/chunks/count.mjs
DELETED
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import consola from 'consola';
|
|
2
|
-
import { P as PriorityId, a as PRIORITY_NAMES } from '../shared/bee.Btmq3TXs.mjs';
|
|
3
|
-
import { r as resolveProjectIds } from '../shared/bee.PF8hrVKn.mjs';
|
|
4
|
-
import { r as resolveUserId } from '../shared/bee.G4d7izLe.mjs';
|
|
5
|
-
import { g as getClient } from '../shared/bee.DessOtkV.mjs';
|
|
6
|
-
import 'backlog-js';
|
|
7
|
-
import 'node:http';
|
|
8
|
-
import 'open';
|
|
9
|
-
import 'node:child_process';
|
|
10
|
-
import '../shared/bee.x-FvgDW2.mjs';
|
|
11
|
-
import { o as outputResult } from '../shared/bee.BTBGpv4K.mjs';
|
|
12
|
-
import 'node:stream/consumers';
|
|
13
|
-
import 'valibot';
|
|
14
|
-
import '../shared/bee.BYqxm3yG.mjs';
|
|
15
|
-
import { B as BeeCommand, E as ENV_AUTH, a as ENV_PROJECT } from '../shared/bee.KteAW2rM.mjs';
|
|
16
|
-
import { p as projectOptional, h as assigneeList, f as collectNum, c as collect, k as keyword, j as json, s as space } from '../shared/bee.B3N0WBdU.mjs';
|
|
17
|
-
import '../shared/bee.CktwmH8R.mjs';
|
|
18
|
-
import '../shared/bee.DfqnFet4.mjs';
|
|
19
|
-
import '../shared/bee.BImw1HZl.mjs';
|
|
20
|
-
import 'node:module';
|
|
21
|
-
import 'commander';
|
|
22
|
-
import 'consola/utils';
|
|
23
|
-
import 'node:fs';
|
|
24
|
-
import 'node:path';
|
|
25
|
-
import 'node:os';
|
|
26
|
-
|
|
27
|
-
const resolvePriorityIds = (priorities) => priorities.map((name) => {
|
|
28
|
-
const id = PriorityId[name.toLowerCase()];
|
|
29
|
-
if (id === void 0) {
|
|
30
|
-
throw new Error(`Unknown priority "${name}". Valid values: ${PRIORITY_NAMES.join(", ")}`);
|
|
31
|
-
}
|
|
32
|
-
return id;
|
|
33
|
-
});
|
|
34
|
-
const count = new BeeCommand("count").summary("Count issues").description(`Accepts the same filter flags as \`bee issue list\`.`).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, []).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("--due-since <date>", "Show issues due on or after this date").option("--due-until <date>", "Show issues due on or before this date").addOption(json()).addOption(space()).envVars([...ENV_AUTH, ENV_PROJECT]).examples([
|
|
35
|
-
{ description: "Count all issues in a project", command: "bee issue count -p PROJECT" },
|
|
36
|
-
{
|
|
37
|
-
description: "Count open bugs assigned to you",
|
|
38
|
-
command: 'bee issue count -p PROJECT -a @me -k "bug"'
|
|
39
|
-
},
|
|
40
|
-
{ description: "Output as JSON", command: "bee issue count -p PROJECT --json" }
|
|
41
|
-
]).action(async (opts) => {
|
|
42
|
-
const { client } = await getClient(opts.space);
|
|
43
|
-
const projectId = opts.project ? await resolveProjectIds(
|
|
44
|
-
client,
|
|
45
|
-
opts.project.split(",").map((s) => s.trim()).filter(Boolean)
|
|
46
|
-
) : [];
|
|
47
|
-
const assigneeId = await Promise.all(
|
|
48
|
-
(opts.assignee ?? []).map((id) => resolveUserId(client, id))
|
|
49
|
-
);
|
|
50
|
-
const statusId = opts.status;
|
|
51
|
-
const priorityId = opts.priority.length > 0 ? resolvePriorityIds(opts.priority) : [];
|
|
52
|
-
const result = await client.getIssuesCount({
|
|
53
|
-
projectId,
|
|
54
|
-
assigneeId,
|
|
55
|
-
statusId,
|
|
56
|
-
priorityId,
|
|
57
|
-
keyword: opts.keyword,
|
|
58
|
-
createdSince: opts.createdSince,
|
|
59
|
-
createdUntil: opts.createdUntil,
|
|
60
|
-
updatedSince: opts.updatedSince,
|
|
61
|
-
updatedUntil: opts.updatedUntil,
|
|
62
|
-
dueDateSince: opts.dueSince,
|
|
63
|
-
dueDateUntil: opts.dueUntil
|
|
64
|
-
});
|
|
65
|
-
outputResult(result, { json: opts.json }, (data) => {
|
|
66
|
-
consola.log(data.count);
|
|
67
|
-
});
|
|
68
|
-
});
|
|
69
|
-
|
|
70
|
-
export { count as default };
|
package/dist/chunks/count2.mjs
DELETED
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import consola from 'consola';
|
|
2
|
-
import { o as outputResult } from '../shared/bee.BTBGpv4K.mjs';
|
|
3
|
-
import 'node:stream/consumers';
|
|
4
|
-
import 'valibot';
|
|
5
|
-
import '../shared/bee.BYqxm3yG.mjs';
|
|
6
|
-
import { g as getClient } from '../shared/bee.DessOtkV.mjs';
|
|
7
|
-
import 'backlog-js';
|
|
8
|
-
import 'node:http';
|
|
9
|
-
import 'open';
|
|
10
|
-
import 'node:child_process';
|
|
11
|
-
import '../shared/bee.x-FvgDW2.mjs';
|
|
12
|
-
import { B as BeeCommand, E as ENV_AUTH } from '../shared/bee.KteAW2rM.mjs';
|
|
13
|
-
import { j as json, s as space } from '../shared/bee.B3N0WBdU.mjs';
|
|
14
|
-
import '../shared/bee.CktwmH8R.mjs';
|
|
15
|
-
import '../shared/bee.DfqnFet4.mjs';
|
|
16
|
-
import '../shared/bee.BImw1HZl.mjs';
|
|
17
|
-
import 'node:module';
|
|
18
|
-
import 'commander';
|
|
19
|
-
import 'consola/utils';
|
|
20
|
-
import 'node:fs';
|
|
21
|
-
import 'node:path';
|
|
22
|
-
import 'node:os';
|
|
23
|
-
|
|
24
|
-
const parseReadFilter = (value) => {
|
|
25
|
-
if (value === void 0 || value === "all") {
|
|
26
|
-
return void 0;
|
|
27
|
-
}
|
|
28
|
-
return value === "read";
|
|
29
|
-
};
|
|
30
|
-
const count = new BeeCommand("count").summary("Count notifications").description(
|
|
31
|
-
`By default, counts all notifications regardless of read status.
|
|
32
|
-
|
|
33
|
-
For details, see:
|
|
34
|
-
https://developer.nulab.com/docs/backlog/api/2/count-notification/`
|
|
35
|
-
).option(
|
|
36
|
-
"--already-read <value>",
|
|
37
|
-
"Filter by read status. If omitted, count all. {read|unread|all}"
|
|
38
|
-
).option(
|
|
39
|
-
"--resource-already-read <value>",
|
|
40
|
-
"Filter by resource read status. If omitted, count all. {read|unread|all}"
|
|
41
|
-
).addOption(json()).addOption(space()).envVars([...ENV_AUTH]).examples([
|
|
42
|
-
{ description: "Count all notifications", command: "bee notification count" },
|
|
43
|
-
{
|
|
44
|
-
description: "Count only unread notifications",
|
|
45
|
-
command: "bee notification count --already-read unread"
|
|
46
|
-
},
|
|
47
|
-
{
|
|
48
|
-
description: "Count only read notifications",
|
|
49
|
-
command: "bee notification count --already-read read"
|
|
50
|
-
},
|
|
51
|
-
{ description: "Output as JSON", command: "bee notification count --json" }
|
|
52
|
-
]).action(async (opts) => {
|
|
53
|
-
const { client } = await getClient(opts.space);
|
|
54
|
-
const alreadyRead = parseReadFilter(opts.alreadyRead);
|
|
55
|
-
const resourceAlreadyRead = parseReadFilter(opts.resourceAlreadyRead);
|
|
56
|
-
const params = {};
|
|
57
|
-
if (alreadyRead !== void 0) {
|
|
58
|
-
params.alreadyRead = alreadyRead;
|
|
59
|
-
}
|
|
60
|
-
if (resourceAlreadyRead !== void 0) {
|
|
61
|
-
params.resourceAlreadyRead = resourceAlreadyRead;
|
|
62
|
-
}
|
|
63
|
-
const result = await client.getNotificationsCount(
|
|
64
|
-
params
|
|
65
|
-
);
|
|
66
|
-
outputResult(result, opts, (data) => {
|
|
67
|
-
consola.log(String(data.count));
|
|
68
|
-
});
|
|
69
|
-
});
|
|
70
|
-
|
|
71
|
-
export { count as default };
|