@nulab/bee 0.0.0 → 1.0.0-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +36 -0
- package/bin/cli.mjs +2 -0
- package/dist/chunks/activities.mjs +90 -0
- package/dist/chunks/activities2.mjs +91 -0
- package/dist/chunks/activities3.mjs +91 -0
- package/dist/chunks/add-user.mjs +42 -0
- package/dist/chunks/add.mjs +62 -0
- package/dist/chunks/add2.mjs +40 -0
- package/dist/chunks/api.mjs +138 -0
- package/dist/chunks/attachments.mjs +48 -0
- package/dist/chunks/attachments2.mjs +48 -0
- package/dist/chunks/attachments3.mjs +49 -0
- package/dist/chunks/browse.mjs +270 -0
- package/dist/chunks/clone.mjs +61 -0
- package/dist/chunks/close.mjs +51 -0
- package/dist/chunks/comment.mjs +124 -0
- package/dist/chunks/comment2.mjs +112 -0
- package/dist/chunks/comments.mjs +58 -0
- package/dist/chunks/completion.mjs +118 -0
- package/dist/chunks/count.mjs +74 -0
- package/dist/chunks/count2.mjs +70 -0
- package/dist/chunks/count3.mjs +60 -0
- package/dist/chunks/count4.mjs +35 -0
- package/dist/chunks/count5.mjs +53 -0
- package/dist/chunks/create.mjs +61 -0
- package/dist/chunks/create2.mjs +83 -0
- package/dist/chunks/create3.mjs +65 -0
- package/dist/chunks/create4.mjs +74 -0
- package/dist/chunks/create5.mjs +57 -0
- package/dist/chunks/create6.mjs +38 -0
- package/dist/chunks/create7.mjs +46 -0
- package/dist/chunks/create8.mjs +50 -0
- package/dist/chunks/create9.mjs +50 -0
- package/dist/chunks/dashboard.mjs +85 -0
- package/dist/chunks/delete.mjs +48 -0
- package/dist/chunks/delete2.mjs +47 -0
- package/dist/chunks/delete3.mjs +47 -0
- package/dist/chunks/delete4.mjs +47 -0
- package/dist/chunks/delete5.mjs +48 -0
- package/dist/chunks/delete6.mjs +48 -0
- package/dist/chunks/delete7.mjs +55 -0
- package/dist/chunks/delete8.mjs +54 -0
- package/dist/chunks/delete9.mjs +49 -0
- package/dist/chunks/edit.mjs +56 -0
- package/dist/chunks/edit2.mjs +73 -0
- package/dist/chunks/edit3.mjs +65 -0
- package/dist/chunks/edit4.mjs +52 -0
- package/dist/chunks/edit5.mjs +38 -0
- package/dist/chunks/edit6.mjs +51 -0
- package/dist/chunks/edit7.mjs +47 -0
- package/dist/chunks/edit8.mjs +47 -0
- package/dist/chunks/history.mjs +57 -0
- package/dist/chunks/index.mjs +15 -0
- package/dist/chunks/index10.mjs +18 -0
- package/dist/chunks/index11.mjs +13 -0
- package/dist/chunks/index12.mjs +13 -0
- package/dist/chunks/index13.mjs +13 -0
- package/dist/chunks/index14.mjs +8 -0
- package/dist/chunks/index15.mjs +13 -0
- package/dist/chunks/index16.mjs +13 -0
- package/dist/chunks/index17.mjs +14 -0
- package/dist/chunks/index2.mjs +18 -0
- package/dist/chunks/index3.mjs +20 -0
- package/dist/chunks/index4.mjs +15 -0
- package/dist/chunks/index5.mjs +13 -0
- package/dist/chunks/index6.mjs +17 -0
- package/dist/chunks/index7.mjs +8 -0
- package/dist/chunks/index8.mjs +8 -0
- package/dist/chunks/index9.mjs +13 -0
- package/dist/chunks/list.mjs +53 -0
- package/dist/chunks/list10.mjs +44 -0
- package/dist/chunks/list11.mjs +49 -0
- package/dist/chunks/list12.mjs +45 -0
- package/dist/chunks/list13.mjs +45 -0
- package/dist/chunks/list14.mjs +55 -0
- package/dist/chunks/list15.mjs +47 -0
- package/dist/chunks/list2.mjs +95 -0
- package/dist/chunks/list3.mjs +86 -0
- package/dist/chunks/list4.mjs +80 -0
- package/dist/chunks/list5.mjs +78 -0
- package/dist/chunks/list6.mjs +45 -0
- package/dist/chunks/list7.mjs +49 -0
- package/dist/chunks/list8.mjs +47 -0
- package/dist/chunks/list9.mjs +53 -0
- package/dist/chunks/login.mjs +206 -0
- package/dist/chunks/logout.mjs +57 -0
- package/dist/chunks/me.mjs +49 -0
- package/dist/chunks/read-all.mjs +30 -0
- package/dist/chunks/read.mjs +30 -0
- package/dist/chunks/read2.mjs +28 -0
- package/dist/chunks/refresh.mjs +77 -0
- package/dist/chunks/remove-user.mjs +42 -0
- package/dist/chunks/remove.mjs +28 -0
- package/dist/chunks/reopen.mjs +43 -0
- package/dist/chunks/status.mjs +62 -0
- package/dist/chunks/status2.mjs +62 -0
- package/dist/chunks/status3.mjs +67 -0
- package/dist/chunks/switch.mjs +52 -0
- package/dist/chunks/tags.mjs +41 -0
- package/dist/chunks/token.mjs +39 -0
- package/dist/chunks/tree.mjs +61 -0
- package/dist/chunks/users.mjs +48 -0
- package/dist/chunks/view.mjs +58 -0
- package/dist/chunks/view2.mjs +95 -0
- package/dist/chunks/view3.mjs +69 -0
- package/dist/chunks/view4.mjs +71 -0
- package/dist/chunks/view5.mjs +62 -0
- package/dist/chunks/view6.mjs +53 -0
- package/dist/chunks/view7.mjs +49 -0
- package/dist/chunks/view8.mjs +62 -0
- package/dist/chunks/view9.mjs +49 -0
- package/dist/index.mjs +152 -0
- package/dist/shared/bee.-8tk76YJ.mjs +42 -0
- package/dist/shared/bee.BTBGpv4K.mjs +34 -0
- package/dist/shared/bee.BXiuAfjJ.mjs +10 -0
- package/dist/shared/bee.BeQSH2t0.mjs +25 -0
- package/dist/shared/bee.Btmq3TXs.mjs +19 -0
- package/dist/shared/bee.C--ZWPxf.mjs +14 -0
- package/dist/shared/bee.CCNmDHVv.mjs +33 -0
- package/dist/shared/bee.CQ3kBgas.mjs +58 -0
- package/dist/shared/bee.CThuQMit.mjs +124 -0
- package/dist/shared/bee.ChBdZ0cH.mjs +9 -0
- package/dist/shared/bee.CktwmH8R.mjs +25 -0
- package/dist/shared/bee.CzKcWSES.mjs +42 -0
- package/dist/shared/bee.D6yQ6Pqf.mjs +18 -0
- package/dist/shared/bee.DHTPkjMh.mjs +48 -0
- package/dist/shared/bee.DVTuFf-T.mjs +276 -0
- package/dist/shared/bee.DoTvz3uW.mjs +13 -0
- package/dist/shared/bee.Ds2l-nTJ.mjs +308 -0
- package/dist/shared/bee.IM3QELRf.mjs +32 -0
- package/dist/shared/bee.XxOB1Her.mjs +8 -0
- package/dist/shared/bee.n5MYN4a6.mjs +12 -0
- package/dist/shared/bee.sHWg0IFT.mjs +22 -0
- package/package.json +50 -2
- package/.github/workflows/initial-release.yml +0 -23
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { l as loadConfig } from '../shared/bee.DVTuFf-T.mjs';
|
|
2
|
+
import { Backlog } from 'backlog-js';
|
|
3
|
+
import consola from 'consola';
|
|
4
|
+
import 'node:stream/consumers';
|
|
5
|
+
import 'valibot';
|
|
6
|
+
import { p as printDefinitionList } from '../shared/bee.D6yQ6Pqf.mjs';
|
|
7
|
+
import { B as BeeCommand } from '../shared/bee.CQ3kBgas.mjs';
|
|
8
|
+
import { s as space } from '../shared/bee.DHTPkjMh.mjs';
|
|
9
|
+
import '../shared/bee.XxOB1Her.mjs';
|
|
10
|
+
import 'node:fs';
|
|
11
|
+
import 'node:path';
|
|
12
|
+
import 'node:os';
|
|
13
|
+
import '../shared/bee.BeQSH2t0.mjs';
|
|
14
|
+
import '../shared/bee.Ds2l-nTJ.mjs';
|
|
15
|
+
import 'commander';
|
|
16
|
+
import 'consola/utils';
|
|
17
|
+
|
|
18
|
+
const getToken = (auth) => auth.method === "api-key" ? auth.apiKey : auth.accessToken;
|
|
19
|
+
const status = new BeeCommand("status").summary("Show authentication status").description(
|
|
20
|
+
`Verifies credential validity for each configured space via the Backlog API. The active (default) space is indicated.`
|
|
21
|
+
).addOption(space()).option("--show-token", "Display the auth token").examples([
|
|
22
|
+
{ description: "Display status for all spaces", command: "bee auth status" },
|
|
23
|
+
{
|
|
24
|
+
description: "Check a specific space",
|
|
25
|
+
command: "bee auth status -s xxx.backlog.com"
|
|
26
|
+
},
|
|
27
|
+
{ description: "Show auth tokens in the output", command: "bee auth status --show-token" }
|
|
28
|
+
]).action(async (opts) => {
|
|
29
|
+
const config = loadConfig();
|
|
30
|
+
const filterSpace = opts.space;
|
|
31
|
+
const spaces = filterSpace ? config.spaces.filter((s) => s.host === filterSpace) : config.spaces;
|
|
32
|
+
if (spaces.length === 0) {
|
|
33
|
+
if (filterSpace) {
|
|
34
|
+
consola.info(`No authentication configured for ${filterSpace}.`);
|
|
35
|
+
} else {
|
|
36
|
+
consola.info("No spaces are authenticated. Run `bee auth login` to get started.");
|
|
37
|
+
}
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
for (const space of spaces) {
|
|
41
|
+
const isDefault = config.defaultSpace === space.host;
|
|
42
|
+
const label = isDefault ? `${space.host} (default)` : space.host;
|
|
43
|
+
let user = null;
|
|
44
|
+
try {
|
|
45
|
+
const client = space.auth.method === "api-key" ? new Backlog({ host: space.host, apiKey: space.auth.apiKey }) : new Backlog({ host: space.host, accessToken: space.auth.accessToken });
|
|
46
|
+
user = await client.getMyself();
|
|
47
|
+
} catch (error) {
|
|
48
|
+
consola.debug("Token verification failed:", error);
|
|
49
|
+
}
|
|
50
|
+
consola.log("");
|
|
51
|
+
consola.log(` ${label}`);
|
|
52
|
+
printDefinitionList([
|
|
53
|
+
["Method", space.auth.method],
|
|
54
|
+
["User", user ? `${user.name} (${user.userId})` : void 0],
|
|
55
|
+
["Status", user ? "Authenticated" : "Authentication failed"],
|
|
56
|
+
["Token", opts.showToken ? getToken(space.auth) : void 0]
|
|
57
|
+
]);
|
|
58
|
+
}
|
|
59
|
+
consola.log("");
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
export { status as default };
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import consola from 'consola';
|
|
2
|
+
import { g as getClient } from '../shared/bee.CThuQMit.mjs';
|
|
3
|
+
import 'backlog-js';
|
|
4
|
+
import 'node:http';
|
|
5
|
+
import 'open';
|
|
6
|
+
import 'node:child_process';
|
|
7
|
+
import { o as outputResult } from '../shared/bee.BTBGpv4K.mjs';
|
|
8
|
+
import 'node:stream/consumers';
|
|
9
|
+
import 'valibot';
|
|
10
|
+
import { B as BeeCommand, E as ENV_AUTH } from '../shared/bee.CQ3kBgas.mjs';
|
|
11
|
+
import { j as json, s as space } from '../shared/bee.DHTPkjMh.mjs';
|
|
12
|
+
import '../shared/bee.XxOB1Her.mjs';
|
|
13
|
+
import '../shared/bee.CktwmH8R.mjs';
|
|
14
|
+
import '../shared/bee.DVTuFf-T.mjs';
|
|
15
|
+
import 'node:fs';
|
|
16
|
+
import 'node:path';
|
|
17
|
+
import 'node:os';
|
|
18
|
+
import '../shared/bee.BeQSH2t0.mjs';
|
|
19
|
+
import '../shared/bee.-8tk76YJ.mjs';
|
|
20
|
+
import 'commander';
|
|
21
|
+
import 'consola/utils';
|
|
22
|
+
|
|
23
|
+
const status = new BeeCommand("status").summary("Show issue status summary for yourself").description(
|
|
24
|
+
`Displays your assigned issues grouped by status (e.g., Open, In Progress, Resolved).`
|
|
25
|
+
).addOption(json()).addOption(space()).envVars([...ENV_AUTH]).examples([
|
|
26
|
+
{ description: "Show your issue status summary", command: "bee issue status" },
|
|
27
|
+
{ description: "Output as JSON", command: "bee issue status --json" }
|
|
28
|
+
]).action(async (opts) => {
|
|
29
|
+
const { client } = await getClient(opts.space);
|
|
30
|
+
const me = await client.getMyself();
|
|
31
|
+
const issues = await client.getIssues({
|
|
32
|
+
assigneeId: [me.id],
|
|
33
|
+
count: 100
|
|
34
|
+
});
|
|
35
|
+
if (issues.length === 0) {
|
|
36
|
+
outputResult({ user: me, issues: [] }, opts, () => {
|
|
37
|
+
consola.info("No issues assigned to you.");
|
|
38
|
+
});
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
outputResult({ user: me, issues }, opts, (data) => {
|
|
42
|
+
const grouped = /* @__PURE__ */ new Map();
|
|
43
|
+
for (const issue of data.issues) {
|
|
44
|
+
const { name } = issue.status;
|
|
45
|
+
const group = grouped.get(name) ?? [];
|
|
46
|
+
group.push(issue);
|
|
47
|
+
grouped.set(name, group);
|
|
48
|
+
}
|
|
49
|
+
consola.log("");
|
|
50
|
+
consola.log(` Issues assigned to ${data.user.name}:`);
|
|
51
|
+
consola.log("");
|
|
52
|
+
for (const [statusName, statusIssues] of grouped) {
|
|
53
|
+
consola.log(` ${statusName} (${statusIssues.length}):`);
|
|
54
|
+
for (const issue of statusIssues) {
|
|
55
|
+
consola.log(` ${issue.issueKey} ${issue.summary}`);
|
|
56
|
+
}
|
|
57
|
+
consola.log("");
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
export { status as default };
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import consola from 'consola';
|
|
2
|
+
import { b as PrStatusId } from '../shared/bee.DoTvz3uW.mjs';
|
|
3
|
+
import { g as getClient } from '../shared/bee.CThuQMit.mjs';
|
|
4
|
+
import 'backlog-js';
|
|
5
|
+
import 'node:http';
|
|
6
|
+
import 'open';
|
|
7
|
+
import 'node:child_process';
|
|
8
|
+
import { o as outputResult } from '../shared/bee.BTBGpv4K.mjs';
|
|
9
|
+
import 'node:stream/consumers';
|
|
10
|
+
import 'valibot';
|
|
11
|
+
import { B as BeeCommand, E as ENV_AUTH, a as ENV_PROJECT, b as ENV_REPO } from '../shared/bee.CQ3kBgas.mjs';
|
|
12
|
+
import { p as project, q as repo, j as json, s as space, r as resolveOptions } from '../shared/bee.DHTPkjMh.mjs';
|
|
13
|
+
import '../shared/bee.XxOB1Her.mjs';
|
|
14
|
+
import '../shared/bee.CktwmH8R.mjs';
|
|
15
|
+
import '../shared/bee.DVTuFf-T.mjs';
|
|
16
|
+
import 'node:fs';
|
|
17
|
+
import 'node:path';
|
|
18
|
+
import 'node:os';
|
|
19
|
+
import '../shared/bee.BeQSH2t0.mjs';
|
|
20
|
+
import '../shared/bee.-8tk76YJ.mjs';
|
|
21
|
+
import 'commander';
|
|
22
|
+
import 'consola/utils';
|
|
23
|
+
|
|
24
|
+
const status = new BeeCommand("status").summary("Show pull request status summary for yourself").description(`Displays your assigned pull requests grouped by status (Open, Closed, Merged).`).addOption(project()).addOption(repo()).addOption(json()).addOption(space()).envVars([...ENV_AUTH, ENV_PROJECT, ENV_REPO]).examples([
|
|
25
|
+
{
|
|
26
|
+
description: "Show your pull request status summary",
|
|
27
|
+
command: "bee pr status -p PROJECT -R repo"
|
|
28
|
+
},
|
|
29
|
+
{ description: "Output as JSON", command: "bee pr status -p PROJECT -R repo --json" }
|
|
30
|
+
]).action(async (opts, cmd) => {
|
|
31
|
+
await resolveOptions(cmd);
|
|
32
|
+
const { client } = await getClient(opts.space);
|
|
33
|
+
const me = await client.getMyself();
|
|
34
|
+
const pullRequests = await client.getPullRequests(opts.project, opts.repo, {
|
|
35
|
+
assigneeId: [me.id],
|
|
36
|
+
statusId: [PrStatusId.Open, PrStatusId.Closed, PrStatusId.Merged],
|
|
37
|
+
count: 100
|
|
38
|
+
});
|
|
39
|
+
const json = opts.json === true ? "" : opts.json;
|
|
40
|
+
if (pullRequests.length === 0) {
|
|
41
|
+
outputResult({ user: me, pullRequests: [] }, { json }, () => {
|
|
42
|
+
consola.info("No pull requests assigned to you.");
|
|
43
|
+
});
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
outputResult({ user: me, pullRequests }, { json }, (data) => {
|
|
47
|
+
const grouped = /* @__PURE__ */ new Map();
|
|
48
|
+
for (const pr of data.pullRequests) {
|
|
49
|
+
const { name } = pr.status;
|
|
50
|
+
const group = grouped.get(name) ?? [];
|
|
51
|
+
group.push(pr);
|
|
52
|
+
grouped.set(name, group);
|
|
53
|
+
}
|
|
54
|
+
consola.log("");
|
|
55
|
+
consola.log(` Pull requests assigned to ${data.user.name}:`);
|
|
56
|
+
consola.log("");
|
|
57
|
+
for (const [statusName, statusPrs] of grouped) {
|
|
58
|
+
consola.log(` ${statusName} (${statusPrs.length}):`);
|
|
59
|
+
for (const pr of statusPrs) {
|
|
60
|
+
consola.log(` #${pr.number} ${pr.summary}`);
|
|
61
|
+
}
|
|
62
|
+
consola.log("");
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
export { status as default };
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import consola from 'consola';
|
|
2
|
+
import { U as UserError } from '../shared/bee.XxOB1Her.mjs';
|
|
3
|
+
import 'node:stream/consumers';
|
|
4
|
+
import 'valibot';
|
|
5
|
+
import { l as loadConfig, w as writeConfig } from '../shared/bee.DVTuFf-T.mjs';
|
|
6
|
+
import { B as BeeCommand } from '../shared/bee.CQ3kBgas.mjs';
|
|
7
|
+
import { s as space } from '../shared/bee.DHTPkjMh.mjs';
|
|
8
|
+
import 'node:fs';
|
|
9
|
+
import 'node:path';
|
|
10
|
+
import 'node:os';
|
|
11
|
+
import '../shared/bee.BeQSH2t0.mjs';
|
|
12
|
+
import 'commander';
|
|
13
|
+
import 'consola/utils';
|
|
14
|
+
|
|
15
|
+
const switchSpace = new BeeCommand("switch").summary("Switch active space").description(`Changes which space is used by default when \`--space\` is not provided.`).addOption(space()).examples([
|
|
16
|
+
{ description: "Select space via prompt", command: "bee auth switch" },
|
|
17
|
+
{
|
|
18
|
+
description: "Switch to a specific space",
|
|
19
|
+
command: "bee auth switch -s xxx.backlog.com"
|
|
20
|
+
}
|
|
21
|
+
]).action(async (opts) => {
|
|
22
|
+
const config = loadConfig();
|
|
23
|
+
let hostname = opts.space;
|
|
24
|
+
if (!hostname) {
|
|
25
|
+
if (config.spaces.length === 0) {
|
|
26
|
+
throw new UserError("No spaces configured. Run `bee auth login` to add a space.");
|
|
27
|
+
}
|
|
28
|
+
if (!process.stdin.isTTY) {
|
|
29
|
+
throw new UserError(
|
|
30
|
+
"Hostname is required. Use --space to provide it in non-interactive mode."
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
const hosts = config.spaces.map((s) => s.host);
|
|
34
|
+
hostname = await consola.prompt("Select space:", {
|
|
35
|
+
type: "select",
|
|
36
|
+
options: hosts
|
|
37
|
+
});
|
|
38
|
+
if (typeof hostname !== "string" || !hostname) {
|
|
39
|
+
throw new UserError("No space selected.");
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
const space = config.spaces.find((s) => s.host === hostname);
|
|
43
|
+
if (!space) {
|
|
44
|
+
throw new UserError(
|
|
45
|
+
`Space "${hostname}" not found. Available spaces: ${config.spaces.map((s) => s.host).join(", ")}`
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
writeConfig({ ...config, defaultSpace: hostname });
|
|
49
|
+
consola.success(`Switched active space to ${hostname}.`);
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
export { switchSpace as default };
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import consola from 'consola';
|
|
2
|
+
import { g as getClient } from '../shared/bee.CThuQMit.mjs';
|
|
3
|
+
import 'backlog-js';
|
|
4
|
+
import 'node:http';
|
|
5
|
+
import 'open';
|
|
6
|
+
import 'node:child_process';
|
|
7
|
+
import { o as outputResult } from '../shared/bee.BTBGpv4K.mjs';
|
|
8
|
+
import 'node:stream/consumers';
|
|
9
|
+
import 'valibot';
|
|
10
|
+
import { B as BeeCommand, E as ENV_AUTH, a as ENV_PROJECT } from '../shared/bee.CQ3kBgas.mjs';
|
|
11
|
+
import { j as json, s as space } from '../shared/bee.DHTPkjMh.mjs';
|
|
12
|
+
import '../shared/bee.XxOB1Her.mjs';
|
|
13
|
+
import '../shared/bee.CktwmH8R.mjs';
|
|
14
|
+
import '../shared/bee.DVTuFf-T.mjs';
|
|
15
|
+
import 'node:fs';
|
|
16
|
+
import 'node:path';
|
|
17
|
+
import 'node:os';
|
|
18
|
+
import '../shared/bee.BeQSH2t0.mjs';
|
|
19
|
+
import '../shared/bee.-8tk76YJ.mjs';
|
|
20
|
+
import 'commander';
|
|
21
|
+
import 'consola/utils';
|
|
22
|
+
|
|
23
|
+
const tags = new BeeCommand("tags").summary("List wiki tags").description(`Tags are labels attached to wiki pages for organization.`).argument("<project>", "Project ID or project key").addOption(json()).addOption(space()).envVars([...ENV_AUTH, ENV_PROJECT]).examples([
|
|
24
|
+
{ description: "List wiki tags", command: "bee wiki tags PROJECT" },
|
|
25
|
+
{ description: "Output as JSON", command: "bee wiki tags PROJECT --json" }
|
|
26
|
+
]).action(async (project, opts) => {
|
|
27
|
+
const { client } = await getClient(opts.space);
|
|
28
|
+
const result = await client.getWikisTags(project);
|
|
29
|
+
const json = opts.json === true ? "" : opts.json;
|
|
30
|
+
outputResult(result, { json }, (data) => {
|
|
31
|
+
if (data.length === 0) {
|
|
32
|
+
consola.info("No wiki tags found.");
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
for (const tag of data) {
|
|
36
|
+
consola.log(tag.name);
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
export { tags as default };
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import 'consola';
|
|
2
|
+
import { U as UserError } from '../shared/bee.XxOB1Her.mjs';
|
|
3
|
+
import 'node:stream/consumers';
|
|
4
|
+
import 'valibot';
|
|
5
|
+
import { l as loadConfig } from '../shared/bee.DVTuFf-T.mjs';
|
|
6
|
+
import { f as findSpace } from '../shared/bee.-8tk76YJ.mjs';
|
|
7
|
+
import { B as BeeCommand } from '../shared/bee.CQ3kBgas.mjs';
|
|
8
|
+
import { s as space } from '../shared/bee.DHTPkjMh.mjs';
|
|
9
|
+
import 'node:fs';
|
|
10
|
+
import 'node:path';
|
|
11
|
+
import 'node:os';
|
|
12
|
+
import '../shared/bee.BeQSH2t0.mjs';
|
|
13
|
+
import 'commander';
|
|
14
|
+
import 'consola/utils';
|
|
15
|
+
|
|
16
|
+
const tokenCommand = new BeeCommand("token").summary("Print the auth token to stdout").description(
|
|
17
|
+
`Prints the token for the default space, or the space given by \`--space\`. Useful for piping to other commands.`
|
|
18
|
+
).addOption(space()).examples([
|
|
19
|
+
{ description: "Print token for default space", command: "bee auth token" },
|
|
20
|
+
{
|
|
21
|
+
description: "Print token for specific space",
|
|
22
|
+
command: "bee auth token -s xxx.backlog.com"
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
description: "Use token in a script",
|
|
26
|
+
command: 'TOKEN=$(bee auth token) && curl -H "X-Api-Key: $TOKEN" https://xxx.backlog.com/api/v2/users/myself'
|
|
27
|
+
}
|
|
28
|
+
]).action((opts) => {
|
|
29
|
+
const config = loadConfig();
|
|
30
|
+
const host = opts.space ?? config.defaultSpace;
|
|
31
|
+
const space = host ? findSpace(config.spaces, host) : null;
|
|
32
|
+
if (!space) {
|
|
33
|
+
throw new UserError("No space configured. Run `bee auth login` to authenticate.");
|
|
34
|
+
}
|
|
35
|
+
const token = space.auth.method === "api-key" ? space.auth.apiKey : space.auth.accessToken;
|
|
36
|
+
process.stdout.write(token);
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
export { tokenCommand as default };
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import consola from 'consola';
|
|
2
|
+
import { g as getClient } from '../shared/bee.CThuQMit.mjs';
|
|
3
|
+
import 'backlog-js';
|
|
4
|
+
import 'node:http';
|
|
5
|
+
import 'open';
|
|
6
|
+
import 'node:child_process';
|
|
7
|
+
import { o as outputResult } from '../shared/bee.BTBGpv4K.mjs';
|
|
8
|
+
import 'node:stream/consumers';
|
|
9
|
+
import 'valibot';
|
|
10
|
+
import { B as BeeCommand, E as ENV_AUTH, a as ENV_PROJECT } from '../shared/bee.CQ3kBgas.mjs';
|
|
11
|
+
import { j as json, s as space } from '../shared/bee.DHTPkjMh.mjs';
|
|
12
|
+
import '../shared/bee.XxOB1Her.mjs';
|
|
13
|
+
import '../shared/bee.CktwmH8R.mjs';
|
|
14
|
+
import '../shared/bee.DVTuFf-T.mjs';
|
|
15
|
+
import 'node:fs';
|
|
16
|
+
import 'node:path';
|
|
17
|
+
import 'node:os';
|
|
18
|
+
import '../shared/bee.BeQSH2t0.mjs';
|
|
19
|
+
import '../shared/bee.-8tk76YJ.mjs';
|
|
20
|
+
import 'commander';
|
|
21
|
+
import 'consola/utils';
|
|
22
|
+
|
|
23
|
+
const renderNode = (node, prefix, isLast) => {
|
|
24
|
+
const connector = isLast ? "\u2514\u2500\u2500" : "\u251C\u2500\u2500";
|
|
25
|
+
const emoji = node.emoji ? `${node.emoji} ` : "";
|
|
26
|
+
const name = node.name ?? node.id;
|
|
27
|
+
const lines = [`${prefix}${connector} ${emoji}${name}`];
|
|
28
|
+
const childPrefix = prefix + (isLast ? " " : "\u2502 ");
|
|
29
|
+
for (let i = 0; i < node.children.length; i++) {
|
|
30
|
+
const child = node.children[i];
|
|
31
|
+
lines.push(...renderNode(child, childPrefix, i === node.children.length - 1));
|
|
32
|
+
}
|
|
33
|
+
return lines;
|
|
34
|
+
};
|
|
35
|
+
const renderTree = (children) => {
|
|
36
|
+
const lines = [];
|
|
37
|
+
for (let i = 0; i < children.length; i++) {
|
|
38
|
+
const child = children[i];
|
|
39
|
+
lines.push(...renderNode(child, "", i === children.length - 1));
|
|
40
|
+
}
|
|
41
|
+
return lines;
|
|
42
|
+
};
|
|
43
|
+
const tree = new BeeCommand("tree").summary("Display document tree").description(`Shows the hierarchical structure of documents with tree-style indentation.`).argument("[project]", "Project ID or project key", process.env.BACKLOG_PROJECT).addOption(json()).addOption(space()).envVars([...ENV_AUTH, ENV_PROJECT]).examples([
|
|
44
|
+
{ description: "Show document tree", command: "bee document tree PROJECT" },
|
|
45
|
+
{ description: "Output as JSON", command: "bee document tree PROJECT --json" }
|
|
46
|
+
]).action(async (project, opts) => {
|
|
47
|
+
const { client } = await getClient(opts.space);
|
|
48
|
+
const docTree = await client.getDocumentTree(project);
|
|
49
|
+
outputResult(docTree, opts, (data) => {
|
|
50
|
+
if (!data.activeTree || data.activeTree.children.length === 0) {
|
|
51
|
+
consola.info("No documents found.");
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
const lines = renderTree(data.activeTree.children);
|
|
55
|
+
for (const line of lines) {
|
|
56
|
+
consola.log(line);
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
export { tree as default };
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import consola from 'consola';
|
|
2
|
+
import { R as ROLE_LABELS } from '../shared/bee.BXiuAfjJ.mjs';
|
|
3
|
+
import { g as getClient } from '../shared/bee.CThuQMit.mjs';
|
|
4
|
+
import 'backlog-js';
|
|
5
|
+
import 'node:http';
|
|
6
|
+
import 'open';
|
|
7
|
+
import 'node:child_process';
|
|
8
|
+
import { o as outputResult } from '../shared/bee.BTBGpv4K.mjs';
|
|
9
|
+
import 'node:stream/consumers';
|
|
10
|
+
import 'valibot';
|
|
11
|
+
import { p as printTable } from '../shared/bee.IM3QELRf.mjs';
|
|
12
|
+
import { B as BeeCommand, E as ENV_AUTH, a as ENV_PROJECT } from '../shared/bee.CQ3kBgas.mjs';
|
|
13
|
+
import { j as json, s as space } from '../shared/bee.DHTPkjMh.mjs';
|
|
14
|
+
import '../shared/bee.XxOB1Her.mjs';
|
|
15
|
+
import '../shared/bee.CktwmH8R.mjs';
|
|
16
|
+
import '../shared/bee.DVTuFf-T.mjs';
|
|
17
|
+
import 'node:fs';
|
|
18
|
+
import 'node:path';
|
|
19
|
+
import 'node:os';
|
|
20
|
+
import '../shared/bee.BeQSH2t0.mjs';
|
|
21
|
+
import '../shared/bee.-8tk76YJ.mjs';
|
|
22
|
+
import '../shared/bee.Ds2l-nTJ.mjs';
|
|
23
|
+
import 'commander';
|
|
24
|
+
import 'consola/utils';
|
|
25
|
+
|
|
26
|
+
const users = new BeeCommand("users").summary("List project users").description(`Displays each member's ID, name, and role.`).argument("<project>", "Project ID or project key").addOption(json()).addOption(space()).envVars([...ENV_AUTH, ENV_PROJECT]).examples([
|
|
27
|
+
{ description: "List project members", command: "bee project users PROJECT_KEY" },
|
|
28
|
+
{ description: "Output as JSON", command: "bee project users PROJECT_KEY --json" }
|
|
29
|
+
]).action(async (project, opts) => {
|
|
30
|
+
const { client } = await getClient(opts.space);
|
|
31
|
+
const members = await client.getProjectUsers(project);
|
|
32
|
+
const jsonArg = opts.json === true ? "" : opts.json;
|
|
33
|
+
outputResult(members, { ...opts, json: jsonArg }, (data) => {
|
|
34
|
+
if (data.length === 0) {
|
|
35
|
+
consola.info("No users found.");
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
const rows = data.map((user) => [
|
|
39
|
+
{ header: "ID", value: String(user.id) },
|
|
40
|
+
{ header: "USER ID", value: user.userId ?? "" },
|
|
41
|
+
{ header: "NAME", value: user.name },
|
|
42
|
+
{ header: "ROLE", value: ROLE_LABELS[user.roleType] ?? `Unknown (${user.roleType})` }
|
|
43
|
+
]);
|
|
44
|
+
printTable(rows);
|
|
45
|
+
});
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
export { users as default };
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import consola from 'consola';
|
|
2
|
+
import { g as getClient } from '../shared/bee.CThuQMit.mjs';
|
|
3
|
+
import 'backlog-js';
|
|
4
|
+
import 'node:http';
|
|
5
|
+
import { o as openOrPrintUrl, p as projectUrl } from '../shared/bee.CzKcWSES.mjs';
|
|
6
|
+
import 'node:child_process';
|
|
7
|
+
import { o as outputResult } from '../shared/bee.BTBGpv4K.mjs';
|
|
8
|
+
import 'node:stream/consumers';
|
|
9
|
+
import 'valibot';
|
|
10
|
+
import { p as printDefinitionList } from '../shared/bee.D6yQ6Pqf.mjs';
|
|
11
|
+
import { B as BeeCommand, E as ENV_AUTH, a as ENV_PROJECT } from '../shared/bee.CQ3kBgas.mjs';
|
|
12
|
+
import { w as web, n as noBrowser, j as json, s as space } from '../shared/bee.DHTPkjMh.mjs';
|
|
13
|
+
import '../shared/bee.XxOB1Her.mjs';
|
|
14
|
+
import '../shared/bee.CktwmH8R.mjs';
|
|
15
|
+
import '../shared/bee.DVTuFf-T.mjs';
|
|
16
|
+
import 'node:fs';
|
|
17
|
+
import 'node:path';
|
|
18
|
+
import 'node:os';
|
|
19
|
+
import '../shared/bee.BeQSH2t0.mjs';
|
|
20
|
+
import '../shared/bee.-8tk76YJ.mjs';
|
|
21
|
+
import 'open';
|
|
22
|
+
import '../shared/bee.Ds2l-nTJ.mjs';
|
|
23
|
+
import 'commander';
|
|
24
|
+
import 'consola/utils';
|
|
25
|
+
|
|
26
|
+
const view = new BeeCommand("view").summary("View a project").description(`Use \`--web\` to open in the browser.`).argument("<project>", "Project ID or project key").addOption(web("project")).addOption(noBrowser()).addOption(json()).addOption(space()).envVars([...ENV_AUTH, ENV_PROJECT]).examples([
|
|
27
|
+
{ description: "View project details", command: "bee project view PROJECT_KEY" },
|
|
28
|
+
{ description: "Open project in browser", command: "bee project view PROJECT_KEY --web" },
|
|
29
|
+
{ description: "Output as JSON", command: "bee project view PROJECT_KEY --json" }
|
|
30
|
+
]).action(async (project, opts) => {
|
|
31
|
+
const { client, host } = await getClient(opts.space);
|
|
32
|
+
if (opts.web || opts.browser === false) {
|
|
33
|
+
const url = projectUrl(host, project);
|
|
34
|
+
await openOrPrintUrl(url, opts.browser === false, consola);
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
const projectData = await client.getProject(project);
|
|
38
|
+
const jsonArg = opts.json === true ? "" : opts.json;
|
|
39
|
+
outputResult(projectData, { ...opts, json: jsonArg }, (data) => {
|
|
40
|
+
consola.log("");
|
|
41
|
+
consola.log(` ${data.name} (${data.projectKey})`);
|
|
42
|
+
consola.log("");
|
|
43
|
+
printDefinitionList([
|
|
44
|
+
["Status", data.archived ? "Archived" : "Active"],
|
|
45
|
+
["Text Formatting", data.textFormattingRule],
|
|
46
|
+
["Chart", data.chartEnabled ? "Yes" : "No"],
|
|
47
|
+
["Subtasking", data.subtaskingEnabled ? "Yes" : "No"],
|
|
48
|
+
["Wiki", data.useWiki ? "Yes" : "No"],
|
|
49
|
+
["File Sharing", data.useFileSharing ? "Yes" : "No"],
|
|
50
|
+
["Git", data.useGit ? "Yes" : "No"],
|
|
51
|
+
["Subversion", data.useSubversion ? "Yes" : "No"],
|
|
52
|
+
["Dev Attributes", data.useDevAttributes ? "Yes" : "No"]
|
|
53
|
+
]);
|
|
54
|
+
consola.log("");
|
|
55
|
+
});
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
export { view as default };
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import consola from 'consola';
|
|
2
|
+
import { g as getClient } from '../shared/bee.CThuQMit.mjs';
|
|
3
|
+
import 'backlog-js';
|
|
4
|
+
import 'node:http';
|
|
5
|
+
import { o as openOrPrintUrl, i as issueUrl } from '../shared/bee.CzKcWSES.mjs';
|
|
6
|
+
import 'node:child_process';
|
|
7
|
+
import { o as outputResult } from '../shared/bee.BTBGpv4K.mjs';
|
|
8
|
+
import 'node:stream/consumers';
|
|
9
|
+
import 'valibot';
|
|
10
|
+
import { f as formatDate } from '../shared/bee.n5MYN4a6.mjs';
|
|
11
|
+
import { p as printDefinitionList } from '../shared/bee.D6yQ6Pqf.mjs';
|
|
12
|
+
import { B as BeeCommand, E as ENV_AUTH } from '../shared/bee.CQ3kBgas.mjs';
|
|
13
|
+
import { w as web, n as noBrowser, j as json, s as space } from '../shared/bee.DHTPkjMh.mjs';
|
|
14
|
+
import '../shared/bee.XxOB1Her.mjs';
|
|
15
|
+
import '../shared/bee.CktwmH8R.mjs';
|
|
16
|
+
import '../shared/bee.DVTuFf-T.mjs';
|
|
17
|
+
import 'node:fs';
|
|
18
|
+
import 'node:path';
|
|
19
|
+
import 'node:os';
|
|
20
|
+
import '../shared/bee.BeQSH2t0.mjs';
|
|
21
|
+
import '../shared/bee.-8tk76YJ.mjs';
|
|
22
|
+
import 'open';
|
|
23
|
+
import '../shared/bee.Ds2l-nTJ.mjs';
|
|
24
|
+
import 'commander';
|
|
25
|
+
import 'consola/utils';
|
|
26
|
+
|
|
27
|
+
const view = new BeeCommand("view").summary("View an issue").description(`Use \`--comments\` to include comments. Use \`--web\` to open in the browser.`).argument("<issue>", "Issue ID or issue key").option("--comments", "Include comments").addOption(web("issue")).addOption(noBrowser()).addOption(json()).addOption(space()).envVars([...ENV_AUTH]).examples([
|
|
28
|
+
{ description: "View issue details", command: "bee issue view PROJECT-123" },
|
|
29
|
+
{ description: "View with comments", command: "bee issue view PROJECT-123 --comments" },
|
|
30
|
+
{ description: "Open issue in browser", command: "bee issue view PROJECT-123 --web" },
|
|
31
|
+
{ description: "Output as JSON", command: "bee issue view PROJECT-123 --json" }
|
|
32
|
+
]).action(async (issue, opts) => {
|
|
33
|
+
const { client, host } = await getClient(opts.space);
|
|
34
|
+
if (opts.web || opts.browser === false) {
|
|
35
|
+
const url = issueUrl(host, issue);
|
|
36
|
+
await openOrPrintUrl(url, opts.browser === false, consola);
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
const issueData = await client.getIssue(issue);
|
|
40
|
+
const comments = opts.comments ? await client.getIssueComments(issue, { order: "asc" }) : [];
|
|
41
|
+
outputResult(issueData, opts, (data) => {
|
|
42
|
+
consola.log("");
|
|
43
|
+
consola.log(` ${data.issueKey}: ${data.summary}`);
|
|
44
|
+
consola.log("");
|
|
45
|
+
printDefinitionList([
|
|
46
|
+
["Status", data.status.name],
|
|
47
|
+
["Type", data.issueType.name],
|
|
48
|
+
["Priority", data.priority.name],
|
|
49
|
+
["Assignee", data.assignee?.name ?? "Unassigned"],
|
|
50
|
+
["Created by", data.createdUser?.name ?? "Unknown"],
|
|
51
|
+
["Created", formatDate(data.created)],
|
|
52
|
+
["Updated", formatDate(data.updated)],
|
|
53
|
+
["Start Date", data.startDate ? formatDate(data.startDate) : void 0],
|
|
54
|
+
["Due Date", data.dueDate ? formatDate(data.dueDate) : void 0],
|
|
55
|
+
["Estimated", data.estimatedHours === void 0 ? void 0 : `${data.estimatedHours}h`],
|
|
56
|
+
["Actual", data.actualHours === void 0 ? void 0 : `${data.actualHours}h`],
|
|
57
|
+
[
|
|
58
|
+
"Categories",
|
|
59
|
+
data.category.length > 0 ? data.category.map((c) => c.name).join(", ") : void 0
|
|
60
|
+
],
|
|
61
|
+
[
|
|
62
|
+
"Milestones",
|
|
63
|
+
data.milestone.length > 0 ? data.milestone.map((m) => m.name).join(", ") : void 0
|
|
64
|
+
],
|
|
65
|
+
[
|
|
66
|
+
"Versions",
|
|
67
|
+
data.versions && data.versions.length > 0 ? data.versions.map((v) => v.name).join(", ") : void 0
|
|
68
|
+
]
|
|
69
|
+
]);
|
|
70
|
+
if (data.description) {
|
|
71
|
+
consola.log("");
|
|
72
|
+
consola.log(" Description:");
|
|
73
|
+
consola.log(
|
|
74
|
+
data.description.split("\n").map((line) => ` ${line}`).join("\n")
|
|
75
|
+
);
|
|
76
|
+
}
|
|
77
|
+
if (comments.length > 0) {
|
|
78
|
+
consola.log("");
|
|
79
|
+
consola.log(" Comments:");
|
|
80
|
+
for (const comment of comments) {
|
|
81
|
+
if (!comment.content) {
|
|
82
|
+
continue;
|
|
83
|
+
}
|
|
84
|
+
consola.log("");
|
|
85
|
+
consola.log(` ${comment.createdUser.name} (${formatDate(comment.created)}):`);
|
|
86
|
+
consola.log(
|
|
87
|
+
comment.content.split("\n").map((line) => ` ${line}`).join("\n")
|
|
88
|
+
);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
consola.log("");
|
|
92
|
+
});
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
export { view as default };
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import consola from 'consola';
|
|
2
|
+
import { g as getClient } from '../shared/bee.CThuQMit.mjs';
|
|
3
|
+
import 'backlog-js';
|
|
4
|
+
import 'node:http';
|
|
5
|
+
import { f as documentUrl, o as openOrPrintUrl } from '../shared/bee.CzKcWSES.mjs';
|
|
6
|
+
import 'node:child_process';
|
|
7
|
+
import { o as outputResult } from '../shared/bee.BTBGpv4K.mjs';
|
|
8
|
+
import { U as UserError } from '../shared/bee.XxOB1Her.mjs';
|
|
9
|
+
import 'node:stream/consumers';
|
|
10
|
+
import 'valibot';
|
|
11
|
+
import { f as formatDate } from '../shared/bee.n5MYN4a6.mjs';
|
|
12
|
+
import { p as printDefinitionList } from '../shared/bee.D6yQ6Pqf.mjs';
|
|
13
|
+
import { B as BeeCommand, E as ENV_AUTH, a as ENV_PROJECT } from '../shared/bee.CQ3kBgas.mjs';
|
|
14
|
+
import { w as web, n as noBrowser, j as json, s as space } from '../shared/bee.DHTPkjMh.mjs';
|
|
15
|
+
import '../shared/bee.CktwmH8R.mjs';
|
|
16
|
+
import '../shared/bee.DVTuFf-T.mjs';
|
|
17
|
+
import 'node:fs';
|
|
18
|
+
import 'node:path';
|
|
19
|
+
import 'node:os';
|
|
20
|
+
import '../shared/bee.BeQSH2t0.mjs';
|
|
21
|
+
import '../shared/bee.-8tk76YJ.mjs';
|
|
22
|
+
import 'open';
|
|
23
|
+
import '../shared/bee.Ds2l-nTJ.mjs';
|
|
24
|
+
import 'commander';
|
|
25
|
+
import 'consola/utils';
|
|
26
|
+
|
|
27
|
+
const view = new BeeCommand("view").summary("View a document").description(`Use \`--web\` to open in the browser (\`--project\` is required for \`--web\`).`).argument("<document>", "Document ID").option("-p, --project <id>", "Project ID or project key (required for --web)").addOption(web("document")).addOption(noBrowser()).addOption(json()).addOption(space()).envVars([...ENV_AUTH, ENV_PROJECT]).examples([
|
|
28
|
+
{ description: "View document details", command: "bee document view 12345" },
|
|
29
|
+
{
|
|
30
|
+
description: "Open document in browser",
|
|
31
|
+
command: "bee document view 12345 --web -p PROJECT"
|
|
32
|
+
},
|
|
33
|
+
{ description: "Output as JSON", command: "bee document view 12345 --json" }
|
|
34
|
+
]).action(async (document, opts) => {
|
|
35
|
+
const { client, host } = await getClient(opts.space);
|
|
36
|
+
if (opts.web || opts.browser === false) {
|
|
37
|
+
if (!opts.project) {
|
|
38
|
+
throw new UserError("The --project flag is required when using --web.");
|
|
39
|
+
}
|
|
40
|
+
const url = documentUrl(host, opts.project, document);
|
|
41
|
+
await openOrPrintUrl(url, opts.browser === false, consola);
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
const doc = await client.getDocument(document);
|
|
45
|
+
outputResult(doc, opts, (data) => {
|
|
46
|
+
consola.log("");
|
|
47
|
+
consola.log(` ${data.title}`);
|
|
48
|
+
consola.log("");
|
|
49
|
+
printDefinitionList([
|
|
50
|
+
["ID", data.id],
|
|
51
|
+
["Emoji", data.emoji ?? void 0],
|
|
52
|
+
["Tags", data.tags.length > 0 ? data.tags.map((t) => t.name).join(", ") : void 0],
|
|
53
|
+
["Created by", data.createdUser?.name ?? "Unknown"],
|
|
54
|
+
["Created", formatDate(data.created)],
|
|
55
|
+
["Updated by", data.updatedUser?.name ?? "Unknown"],
|
|
56
|
+
["Updated", formatDate(data.updated)]
|
|
57
|
+
]);
|
|
58
|
+
if (data.plain) {
|
|
59
|
+
consola.log("");
|
|
60
|
+
consola.log(" Body:");
|
|
61
|
+
consola.log(
|
|
62
|
+
data.plain.split("\n").map((line) => ` ${line}`).join("\n")
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
consola.log("");
|
|
66
|
+
});
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
export { view as default };
|