@nulab/bee 0.0.0 → 1.0.0-rc.1

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.
Files changed (135) hide show
  1. package/README.md +36 -0
  2. package/bin/cli.mjs +2 -0
  3. package/dist/chunks/activities.mjs +90 -0
  4. package/dist/chunks/activities2.mjs +91 -0
  5. package/dist/chunks/activities3.mjs +91 -0
  6. package/dist/chunks/add-user.mjs +42 -0
  7. package/dist/chunks/add.mjs +62 -0
  8. package/dist/chunks/add2.mjs +40 -0
  9. package/dist/chunks/api.mjs +138 -0
  10. package/dist/chunks/attachments.mjs +48 -0
  11. package/dist/chunks/attachments2.mjs +48 -0
  12. package/dist/chunks/attachments3.mjs +49 -0
  13. package/dist/chunks/browse.mjs +270 -0
  14. package/dist/chunks/clone.mjs +61 -0
  15. package/dist/chunks/close.mjs +51 -0
  16. package/dist/chunks/comment.mjs +124 -0
  17. package/dist/chunks/comment2.mjs +112 -0
  18. package/dist/chunks/comments.mjs +58 -0
  19. package/dist/chunks/completion.mjs +118 -0
  20. package/dist/chunks/count.mjs +74 -0
  21. package/dist/chunks/count2.mjs +70 -0
  22. package/dist/chunks/count3.mjs +60 -0
  23. package/dist/chunks/count4.mjs +35 -0
  24. package/dist/chunks/count5.mjs +53 -0
  25. package/dist/chunks/create.mjs +61 -0
  26. package/dist/chunks/create2.mjs +83 -0
  27. package/dist/chunks/create3.mjs +65 -0
  28. package/dist/chunks/create4.mjs +74 -0
  29. package/dist/chunks/create5.mjs +57 -0
  30. package/dist/chunks/create6.mjs +38 -0
  31. package/dist/chunks/create7.mjs +46 -0
  32. package/dist/chunks/create8.mjs +50 -0
  33. package/dist/chunks/create9.mjs +50 -0
  34. package/dist/chunks/dashboard.mjs +85 -0
  35. package/dist/chunks/delete.mjs +48 -0
  36. package/dist/chunks/delete2.mjs +47 -0
  37. package/dist/chunks/delete3.mjs +47 -0
  38. package/dist/chunks/delete4.mjs +47 -0
  39. package/dist/chunks/delete5.mjs +48 -0
  40. package/dist/chunks/delete6.mjs +48 -0
  41. package/dist/chunks/delete7.mjs +55 -0
  42. package/dist/chunks/delete8.mjs +54 -0
  43. package/dist/chunks/delete9.mjs +49 -0
  44. package/dist/chunks/edit.mjs +56 -0
  45. package/dist/chunks/edit2.mjs +73 -0
  46. package/dist/chunks/edit3.mjs +65 -0
  47. package/dist/chunks/edit4.mjs +52 -0
  48. package/dist/chunks/edit5.mjs +38 -0
  49. package/dist/chunks/edit6.mjs +51 -0
  50. package/dist/chunks/edit7.mjs +47 -0
  51. package/dist/chunks/edit8.mjs +47 -0
  52. package/dist/chunks/history.mjs +57 -0
  53. package/dist/chunks/index.mjs +15 -0
  54. package/dist/chunks/index10.mjs +18 -0
  55. package/dist/chunks/index11.mjs +13 -0
  56. package/dist/chunks/index12.mjs +13 -0
  57. package/dist/chunks/index13.mjs +13 -0
  58. package/dist/chunks/index14.mjs +8 -0
  59. package/dist/chunks/index15.mjs +13 -0
  60. package/dist/chunks/index16.mjs +13 -0
  61. package/dist/chunks/index17.mjs +14 -0
  62. package/dist/chunks/index2.mjs +18 -0
  63. package/dist/chunks/index3.mjs +20 -0
  64. package/dist/chunks/index4.mjs +15 -0
  65. package/dist/chunks/index5.mjs +13 -0
  66. package/dist/chunks/index6.mjs +17 -0
  67. package/dist/chunks/index7.mjs +8 -0
  68. package/dist/chunks/index8.mjs +8 -0
  69. package/dist/chunks/index9.mjs +13 -0
  70. package/dist/chunks/list.mjs +53 -0
  71. package/dist/chunks/list10.mjs +44 -0
  72. package/dist/chunks/list11.mjs +49 -0
  73. package/dist/chunks/list12.mjs +45 -0
  74. package/dist/chunks/list13.mjs +45 -0
  75. package/dist/chunks/list14.mjs +55 -0
  76. package/dist/chunks/list15.mjs +47 -0
  77. package/dist/chunks/list2.mjs +95 -0
  78. package/dist/chunks/list3.mjs +86 -0
  79. package/dist/chunks/list4.mjs +80 -0
  80. package/dist/chunks/list5.mjs +78 -0
  81. package/dist/chunks/list6.mjs +45 -0
  82. package/dist/chunks/list7.mjs +49 -0
  83. package/dist/chunks/list8.mjs +47 -0
  84. package/dist/chunks/list9.mjs +53 -0
  85. package/dist/chunks/login.mjs +206 -0
  86. package/dist/chunks/logout.mjs +57 -0
  87. package/dist/chunks/me.mjs +49 -0
  88. package/dist/chunks/read-all.mjs +30 -0
  89. package/dist/chunks/read.mjs +30 -0
  90. package/dist/chunks/read2.mjs +28 -0
  91. package/dist/chunks/refresh.mjs +77 -0
  92. package/dist/chunks/remove-user.mjs +42 -0
  93. package/dist/chunks/remove.mjs +28 -0
  94. package/dist/chunks/reopen.mjs +43 -0
  95. package/dist/chunks/status.mjs +62 -0
  96. package/dist/chunks/status2.mjs +62 -0
  97. package/dist/chunks/status3.mjs +67 -0
  98. package/dist/chunks/switch.mjs +52 -0
  99. package/dist/chunks/tags.mjs +41 -0
  100. package/dist/chunks/token.mjs +39 -0
  101. package/dist/chunks/tree.mjs +61 -0
  102. package/dist/chunks/users.mjs +48 -0
  103. package/dist/chunks/view.mjs +58 -0
  104. package/dist/chunks/view2.mjs +95 -0
  105. package/dist/chunks/view3.mjs +69 -0
  106. package/dist/chunks/view4.mjs +71 -0
  107. package/dist/chunks/view5.mjs +62 -0
  108. package/dist/chunks/view6.mjs +53 -0
  109. package/dist/chunks/view7.mjs +49 -0
  110. package/dist/chunks/view8.mjs +62 -0
  111. package/dist/chunks/view9.mjs +49 -0
  112. package/dist/index.mjs +152 -0
  113. package/dist/shared/bee.-8tk76YJ.mjs +42 -0
  114. package/dist/shared/bee.BTBGpv4K.mjs +34 -0
  115. package/dist/shared/bee.BXiuAfjJ.mjs +10 -0
  116. package/dist/shared/bee.BeQSH2t0.mjs +25 -0
  117. package/dist/shared/bee.Btmq3TXs.mjs +19 -0
  118. package/dist/shared/bee.C--ZWPxf.mjs +14 -0
  119. package/dist/shared/bee.CCNmDHVv.mjs +33 -0
  120. package/dist/shared/bee.CQ3kBgas.mjs +58 -0
  121. package/dist/shared/bee.CThuQMit.mjs +124 -0
  122. package/dist/shared/bee.ChBdZ0cH.mjs +9 -0
  123. package/dist/shared/bee.CktwmH8R.mjs +25 -0
  124. package/dist/shared/bee.CzKcWSES.mjs +42 -0
  125. package/dist/shared/bee.D6yQ6Pqf.mjs +18 -0
  126. package/dist/shared/bee.DHTPkjMh.mjs +48 -0
  127. package/dist/shared/bee.DVTuFf-T.mjs +276 -0
  128. package/dist/shared/bee.DoTvz3uW.mjs +13 -0
  129. package/dist/shared/bee.Ds2l-nTJ.mjs +308 -0
  130. package/dist/shared/bee.IM3QELRf.mjs +32 -0
  131. package/dist/shared/bee.XxOB1Her.mjs +8 -0
  132. package/dist/shared/bee.n5MYN4a6.mjs +12 -0
  133. package/dist/shared/bee.sHWg0IFT.mjs +22 -0
  134. package/package.json +50 -2
  135. package/.github/workflows/initial-release.yml +0 -23
@@ -0,0 +1,83 @@
1
+ import consola from 'consola';
2
+ import { a as PRIORITY_NAMES, P as PriorityId } from '../shared/bee.Btmq3TXs.mjs';
3
+ import { r as resolveProjectIds } from '../shared/bee.sHWg0IFT.mjs';
4
+ import { r as resolveUserId } from '../shared/bee.ChBdZ0cH.mjs';
5
+ import { g as getClient } from '../shared/bee.CThuQMit.mjs';
6
+ import 'backlog-js';
7
+ import 'node:http';
8
+ import { i as issueUrl } from '../shared/bee.CzKcWSES.mjs';
9
+ import 'node:child_process';
10
+ import { o as outputResult } from '../shared/bee.BTBGpv4K.mjs';
11
+ import { p as promptRequired } from '../shared/bee.DVTuFf-T.mjs';
12
+ import 'node:stream/consumers';
13
+ import 'valibot';
14
+ import { Option } from 'commander';
15
+ import { B as BeeCommand, E as ENV_AUTH, a as ENV_PROJECT } from '../shared/bee.CQ3kBgas.mjs';
16
+ import { f as assignee, g as notify, h as attachment, j as json, s as space } from '../shared/bee.DHTPkjMh.mjs';
17
+ import '../shared/bee.XxOB1Her.mjs';
18
+ import '../shared/bee.CktwmH8R.mjs';
19
+ import '../shared/bee.-8tk76YJ.mjs';
20
+ import 'open';
21
+ import 'node:fs';
22
+ import 'node:path';
23
+ import 'node:os';
24
+ import '../shared/bee.BeQSH2t0.mjs';
25
+ import 'consola/utils';
26
+
27
+ const create = new BeeCommand("create").summary("Create an issue").description(
28
+ `Omitted required fields will be prompted interactively. Priority accepts a name: \`high\`, \`normal\`, or \`low\`.`
29
+ ).addOption(new Option("-p, --project <id>", "Project ID or project key").env("BACKLOG_PROJECT")).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()).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([
30
+ {
31
+ description: "Create an issue with required fields",
32
+ command: 'bee issue create -p PROJECT --type 1 --priority normal -t "Fix login bug"'
33
+ },
34
+ {
35
+ description: "Create an issue with description",
36
+ command: 'bee issue create -p PROJECT --type 1 --priority normal -t "Title" -d "Details here"'
37
+ },
38
+ {
39
+ description: "Create an issue assigned to yourself",
40
+ command: 'bee issue create -p PROJECT --type 1 --priority high -t "Title" --assignee @me'
41
+ },
42
+ {
43
+ description: "Output as JSON",
44
+ command: 'bee issue create -p PROJECT --type 1 --priority normal -t "Title" --json'
45
+ }
46
+ ]).action(async (opts) => {
47
+ const { client, host } = await getClient(opts.space);
48
+ const project = await promptRequired("Project:", opts.project);
49
+ const title = await promptRequired("Summary:", opts.title);
50
+ const issueTypeId = await promptRequired("Issue type ID:", opts.type);
51
+ const priority = await promptRequired("Priority:", opts.priority, {
52
+ valueHint: `{${PRIORITY_NAMES.join("|")}}`
53
+ });
54
+ const priorityId = PriorityId[priority.toLowerCase()];
55
+ if (priorityId === void 0) {
56
+ throw new Error(`Unknown priority "${priority}". Valid values: ${PRIORITY_NAMES.join(", ")}`);
57
+ }
58
+ const [projectId] = await resolveProjectIds(client, [project]);
59
+ const assigneeId = opts.assignee ? await resolveUserId(client, opts.assignee) : void 0;
60
+ const notifiedUserId = opts.notify ?? [];
61
+ const attachmentId = opts.attachment ?? [];
62
+ const issue = await client.postIssue({
63
+ projectId,
64
+ summary: title,
65
+ issueTypeId: Number(issueTypeId),
66
+ priorityId,
67
+ description: opts.description,
68
+ assigneeId,
69
+ parentIssueId: opts.parentIssue ? Number(opts.parentIssue) : void 0,
70
+ startDate: opts.startDate,
71
+ dueDate: opts.dueDate,
72
+ estimatedHours: opts.estimatedHours ? Number(opts.estimatedHours) : void 0,
73
+ actualHours: opts.actualHours ? Number(opts.actualHours) : void 0,
74
+ notifiedUserId,
75
+ attachmentId
76
+ });
77
+ outputResult(issue, opts, (data) => {
78
+ consola.success(`Created issue ${data.issueKey}: ${data.summary}`);
79
+ consola.info(issueUrl(host, data.issueKey));
80
+ });
81
+ });
82
+
83
+ export { create as default };
@@ -0,0 +1,65 @@
1
+ import consola from 'consola';
2
+ import { r as resolveProjectIds } from '../shared/bee.sHWg0IFT.mjs';
3
+ import { g as getClient } from '../shared/bee.CThuQMit.mjs';
4
+ import 'backlog-js';
5
+ import 'node:http';
6
+ import { f as documentUrl } from '../shared/bee.CzKcWSES.mjs';
7
+ import 'node:child_process';
8
+ import { o as outputResult } from '../shared/bee.BTBGpv4K.mjs';
9
+ import { p as promptRequired } from '../shared/bee.DVTuFf-T.mjs';
10
+ import { a as resolveStdinArg } from '../shared/bee.C--ZWPxf.mjs';
11
+ import 'valibot';
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 'node:stream/consumers';
16
+ import '../shared/bee.CktwmH8R.mjs';
17
+ import '../shared/bee.-8tk76YJ.mjs';
18
+ import 'open';
19
+ import 'node:fs';
20
+ import 'node:path';
21
+ import 'node:os';
22
+ import '../shared/bee.BeQSH2t0.mjs';
23
+ import 'commander';
24
+ import 'consola/utils';
25
+
26
+ const create = new BeeCommand("create").summary("Create a document").description(
27
+ `Omitted required fields will be prompted interactively. When input is piped, it is used as the body automatically.`
28
+ ).option("-p, --project <id>", "Project ID or project key").option("-t, --title <text>", "Document title").option("-b, --body <text>", "Document body content").option("--emoji <emoji>", "Emoji for the document").option("--parent-id <id>", "Parent document ID for creating as a child document").option("--add-last", "Add document to the end of the list").addOption(json()).addOption(space()).envVars([...ENV_AUTH, ENV_PROJECT]).examples([
29
+ {
30
+ description: "Create a document with title and body",
31
+ command: 'bee document create -p PROJECT -t "Meeting Notes" -b "Content here"'
32
+ },
33
+ {
34
+ description: "Create a document from stdin",
35
+ command: 'echo "Content" | bee document create -p PROJECT -t "Notes"'
36
+ },
37
+ {
38
+ description: "Create a child document",
39
+ command: 'bee document create -p PROJECT -t "Sub Page" --parent-id 12345'
40
+ },
41
+ {
42
+ description: "Output as JSON",
43
+ command: 'bee document create -p PROJECT -t "Title" --json'
44
+ }
45
+ ]).action(async (opts) => {
46
+ const { client, host } = await getClient(opts.space);
47
+ const project = await promptRequired("Project:", opts.project);
48
+ const title = await promptRequired("Title:", opts.title);
49
+ const [projectId] = await resolveProjectIds(client, [project]);
50
+ const body = await resolveStdinArg(opts.body);
51
+ const doc = await client.addDocument({
52
+ projectId,
53
+ title,
54
+ content: body,
55
+ emoji: opts.emoji,
56
+ parentId: opts.parentId,
57
+ addLast: opts.addLast
58
+ });
59
+ outputResult(doc, opts, (data) => {
60
+ consola.success(`Created document ${data.title} (ID: ${data.id})`);
61
+ consola.info(documentUrl(host, project, data.id));
62
+ });
63
+ });
64
+
65
+ export { create as default };
@@ -0,0 +1,74 @@
1
+ import consola from 'consola';
2
+ import { r as resolveUserId } from '../shared/bee.ChBdZ0cH.mjs';
3
+ import { g as getClient } from '../shared/bee.CThuQMit.mjs';
4
+ import 'backlog-js';
5
+ import 'node:http';
6
+ import { h as pullRequestUrl } from '../shared/bee.CzKcWSES.mjs';
7
+ import 'node:child_process';
8
+ import { o as outputResult } from '../shared/bee.BTBGpv4K.mjs';
9
+ import { p as promptRequired } from '../shared/bee.DVTuFf-T.mjs';
10
+ import 'node:stream/consumers';
11
+ import 'valibot';
12
+ import { B as BeeCommand, E as ENV_AUTH, a as ENV_PROJECT, b as ENV_REPO } from '../shared/bee.CQ3kBgas.mjs';
13
+ import { p as project, q as repo, f as assignee, g as notify, h as attachment, j as json, s as space, r as resolveOptions } from '../shared/bee.DHTPkjMh.mjs';
14
+ import '../shared/bee.XxOB1Her.mjs';
15
+ import '../shared/bee.CktwmH8R.mjs';
16
+ import '../shared/bee.-8tk76YJ.mjs';
17
+ import 'open';
18
+ import 'node:fs';
19
+ import 'node:path';
20
+ import 'node:os';
21
+ import '../shared/bee.BeQSH2t0.mjs';
22
+ import 'commander';
23
+ import 'consola/utils';
24
+
25
+ const create = new BeeCommand("create").summary("Create a pull request").description(`Omitted required fields will be prompted interactively.`).addOption(project()).addOption(repo()).option("--base <branch>", "Base branch name").option("--head <branch>", "Head branch name").option("-t, --title <text>", "Pull request title").option("-b, --body <text>", "Pull request description").addOption(assignee()).option("--issue <key>", "Related issue ID or issue key").addOption(notify()).addOption(attachment()).addOption(json()).addOption(space()).envVars([...ENV_AUTH, ENV_PROJECT, ENV_REPO]).examples([
26
+ {
27
+ description: "Create a pull request",
28
+ command: 'bee pr create -p PROJECT -R repo --base main --head feature -t "Add login" -b "Details"'
29
+ },
30
+ {
31
+ description: "Create a pull request assigned to yourself",
32
+ command: 'bee pr create -p PROJECT -R repo --base main --head feature -t "Title" -b "Desc" --assignee @me'
33
+ },
34
+ {
35
+ description: "Create a pull request linked to an issue",
36
+ command: 'bee pr create -p PROJECT -R repo --base main --head feature -t "Title" -b "Desc" --issue 123'
37
+ }
38
+ ]).action(async (opts, cmd) => {
39
+ await resolveOptions(cmd);
40
+ const { client, host } = await getClient(opts.space);
41
+ const base = await promptRequired("Base branch:", opts.base);
42
+ const head = await promptRequired("Head branch:", opts.head);
43
+ const summary = await promptRequired("Summary:", opts.title);
44
+ const description = await promptRequired("Body:", opts.body);
45
+ const assigneeId = opts.assignee ? await resolveUserId(client, opts.assignee) : void 0;
46
+ const notifiedUserId = opts.notify ?? [];
47
+ const attachmentId = opts.attachment ?? [];
48
+ let issueId;
49
+ if (opts.issue) {
50
+ if (Number.isNaN(Number(opts.issue))) {
51
+ const issue = await client.getIssue(opts.issue);
52
+ issueId = issue.id;
53
+ } else {
54
+ issueId = Number(opts.issue);
55
+ }
56
+ }
57
+ const pullRequest = await client.postPullRequest(opts.project, opts.repo, {
58
+ summary,
59
+ description,
60
+ base,
61
+ branch: head,
62
+ issueId,
63
+ assigneeId,
64
+ notifiedUserId,
65
+ attachmentId
66
+ });
67
+ const json = opts.json === true ? "" : opts.json;
68
+ outputResult(pullRequest, { json }, (data) => {
69
+ consola.success(`Created pull request #${data.number}: ${data.summary}`);
70
+ consola.info(pullRequestUrl(host, opts.project, opts.repo, data.number));
71
+ });
72
+ });
73
+
74
+ export { create as default };
@@ -0,0 +1,57 @@
1
+ import consola from 'consola';
2
+ import { r as resolveProjectIds } from '../shared/bee.sHWg0IFT.mjs';
3
+ import { g as getClient } from '../shared/bee.CThuQMit.mjs';
4
+ import 'backlog-js';
5
+ import 'node:http';
6
+ import { w as wikiUrl } from '../shared/bee.CzKcWSES.mjs';
7
+ import 'node:child_process';
8
+ import { o as outputResult } from '../shared/bee.BTBGpv4K.mjs';
9
+ import { p as promptRequired } from '../shared/bee.DVTuFf-T.mjs';
10
+ import { a as resolveStdinArg } from '../shared/bee.C--ZWPxf.mjs';
11
+ import 'valibot';
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 'node:stream/consumers';
16
+ import '../shared/bee.CktwmH8R.mjs';
17
+ import '../shared/bee.-8tk76YJ.mjs';
18
+ import 'open';
19
+ import 'node:fs';
20
+ import 'node:path';
21
+ import 'node:os';
22
+ import '../shared/bee.BeQSH2t0.mjs';
23
+ import 'commander';
24
+ import 'consola/utils';
25
+
26
+ const create = new BeeCommand("create").summary("Create a wiki page").description(`When input is piped, it is used as the body automatically.`).option("-p, --project <id>", "Project ID or project key").option("-n, --name <name>", "Wiki page name").option("-b, --body <text>", "Wiki page content").option("--mail-notify", "Send notification email").addOption(json()).addOption(space()).envVars([...ENV_AUTH, ENV_PROJECT]).examples([
27
+ {
28
+ description: "Create a wiki page",
29
+ command: 'bee wiki create -p PROJECT -n "Page Name" -b "Content"'
30
+ },
31
+ {
32
+ description: "Create a wiki page from stdin",
33
+ command: 'echo "Body" | bee wiki create -p PROJECT -n "Name"'
34
+ },
35
+ {
36
+ description: "Create and send notification email",
37
+ command: 'bee wiki create -p PROJECT -n "Name" -b "Content" --mail-notify'
38
+ }
39
+ ]).action(async (opts) => {
40
+ const { client, host } = await getClient(opts.space);
41
+ const project = await promptRequired("Project:", opts.project);
42
+ const name = await promptRequired("Page name:", opts.name);
43
+ const body = await resolveStdinArg(opts.body) ?? "";
44
+ const [projectId] = await resolveProjectIds(client, [project]);
45
+ const wiki = await client.postWiki({
46
+ projectId,
47
+ name,
48
+ content: body,
49
+ mailNotify: opts.mailNotify
50
+ });
51
+ outputResult(wiki, opts, (data) => {
52
+ consola.success(`Created wiki page ${data.id}: ${data.name}`);
53
+ consola.info(wikiUrl(host, data.id));
54
+ });
55
+ });
56
+
57
+ export { create as default };
@@ -0,0 +1,38 @@
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 { j as categoryUrl } from '../shared/bee.CzKcWSES.mjs';
6
+ import 'node:child_process';
7
+ import { o as outputResult } from '../shared/bee.BTBGpv4K.mjs';
8
+ import { p as promptRequired } from '../shared/bee.DVTuFf-T.mjs';
9
+ import 'node:stream/consumers';
10
+ import 'valibot';
11
+ import { B as BeeCommand, E as ENV_AUTH, a as ENV_PROJECT } from '../shared/bee.CQ3kBgas.mjs';
12
+ import { p as project, 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.-8tk76YJ.mjs';
16
+ import 'open';
17
+ import 'node:fs';
18
+ import 'node:path';
19
+ import 'node:os';
20
+ import '../shared/bee.BeQSH2t0.mjs';
21
+ import 'commander';
22
+ import 'consola/utils';
23
+
24
+ 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([
25
+ { description: "Create a category", command: 'bee category create -p PROJECT -n "Bug Report"' },
26
+ { description: "Create interactively", command: "bee category create -p PROJECT" }
27
+ ]).action(async (opts, cmd) => {
28
+ await resolveOptions(cmd);
29
+ const { client, host } = await getClient(opts.space);
30
+ const name = await promptRequired("Category name:", opts.name);
31
+ const category = await client.postCategories(opts.project, { name });
32
+ outputResult(category, opts, (data) => {
33
+ consola.success(`Created category ${data.name} (ID: ${data.id})`);
34
+ consola.info(categoryUrl(host, data.id, data.projectId));
35
+ });
36
+ });
37
+
38
+ export { create as default };
@@ -0,0 +1,46 @@
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 { m as milestoneUrl } from '../shared/bee.CzKcWSES.mjs';
6
+ import 'node:child_process';
7
+ import { o as outputResult } from '../shared/bee.BTBGpv4K.mjs';
8
+ import { p as promptRequired } from '../shared/bee.DVTuFf-T.mjs';
9
+ import 'node:stream/consumers';
10
+ import 'valibot';
11
+ import { B as BeeCommand, E as ENV_AUTH, a as ENV_PROJECT } from '../shared/bee.CQ3kBgas.mjs';
12
+ import { p as project, 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.-8tk76YJ.mjs';
16
+ import 'open';
17
+ import 'node:fs';
18
+ import 'node:path';
19
+ import 'node:os';
20
+ import '../shared/bee.BeQSH2t0.mjs';
21
+ import 'commander';
22
+ import 'consola/utils';
23
+
24
+ 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([
25
+ { description: "Create a milestone", command: 'bee milestone create -p PROJECT -n "v1.0.0"' },
26
+ {
27
+ description: "Create with dates",
28
+ command: 'bee milestone create -p PROJECT -n "v1.0.0" --start-date 2026-04-01 --release-due-date 2026-06-30'
29
+ }
30
+ ]).action(async (opts, cmd) => {
31
+ await resolveOptions(cmd);
32
+ const { client, host } = await getClient(opts.space);
33
+ const name = await promptRequired("Milestone name:", opts.name);
34
+ const milestone = await client.postVersions(opts.project, {
35
+ name,
36
+ description: opts.description,
37
+ startDate: opts.startDate,
38
+ releaseDueDate: opts.releaseDueDate
39
+ });
40
+ outputResult(milestone, opts, (data) => {
41
+ consola.success(`Created milestone ${data.name} (ID: ${data.id})`);
42
+ consola.info(milestoneUrl(host, data.id));
43
+ });
44
+ });
45
+
46
+ export { create as default };
@@ -0,0 +1,50 @@
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 { k as issueTypeUrl } from '../shared/bee.CzKcWSES.mjs';
6
+ import 'node:child_process';
7
+ import { o as outputResult } from '../shared/bee.BTBGpv4K.mjs';
8
+ import { p as promptRequired } from '../shared/bee.DVTuFf-T.mjs';
9
+ import 'node:stream/consumers';
10
+ import 'valibot';
11
+ import { B as BeeCommand, E as ENV_AUTH, a as ENV_PROJECT } from '../shared/bee.CQ3kBgas.mjs';
12
+ import { p as project, 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.-8tk76YJ.mjs';
16
+ import 'open';
17
+ import 'node:fs';
18
+ import 'node:path';
19
+ import 'node:os';
20
+ import '../shared/bee.BeQSH2t0.mjs';
21
+ import 'commander';
22
+ import 'consola/utils';
23
+
24
+ const create = new BeeCommand("create").summary("Create an issue type").description(`Omitted fields will be prompted interactively.`).addOption(project()).option("-n, --name <value>", "Issue type name").requiredOption(
25
+ "--color <value>",
26
+ "Display color {#e30000|#990000|#934981|#814fbc|#2779ca|#007e9a|#7ea800|#ff9200|#ff3265|#666665}"
27
+ ).addOption(json()).addOption(space()).envVars([...ENV_AUTH, ENV_PROJECT]).examples([
28
+ {
29
+ description: "Create an issue type",
30
+ command: 'bee issue-type create -p PROJECT -n "Enhancement" --color "#2779ca"'
31
+ },
32
+ {
33
+ description: "Create interactively",
34
+ command: 'bee issue-type create -p PROJECT --color "#2779ca"'
35
+ }
36
+ ]).action(async (opts, cmd) => {
37
+ await resolveOptions(cmd);
38
+ const { client, host } = await getClient(opts.space);
39
+ const name = await promptRequired("Issue type name:", opts.name);
40
+ const issueType = await client.postIssueType(opts.project, {
41
+ name,
42
+ color: opts.color
43
+ });
44
+ outputResult(issueType, opts, (data) => {
45
+ consola.success(`Created issue type ${data.name} (ID: ${data.id})`);
46
+ consola.info(issueTypeUrl(host, data.id, data.projectId));
47
+ });
48
+ });
49
+
50
+ export { create as default };
@@ -0,0 +1,50 @@
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 { s as statusUrl } from '../shared/bee.CzKcWSES.mjs';
6
+ import 'node:child_process';
7
+ import { o as outputResult } from '../shared/bee.BTBGpv4K.mjs';
8
+ import { p as promptRequired } from '../shared/bee.DVTuFf-T.mjs';
9
+ import 'node:stream/consumers';
10
+ import 'valibot';
11
+ import { B as BeeCommand, E as ENV_AUTH, a as ENV_PROJECT } from '../shared/bee.CQ3kBgas.mjs';
12
+ import { p as project, 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.-8tk76YJ.mjs';
16
+ import 'open';
17
+ import 'node:fs';
18
+ import 'node:path';
19
+ import 'node:os';
20
+ import '../shared/bee.BeQSH2t0.mjs';
21
+ import 'commander';
22
+ import 'consola/utils';
23
+
24
+ const create = new BeeCommand("create").summary("Create a status").description(`Omitted fields will be prompted interactively.`).addOption(project()).option("-n, --name <value>", "Status name").requiredOption(
25
+ "--color <value>",
26
+ "Display color {#ea2c00|#e87758|#e07b9a|#868cb7|#3b9dbd|#4caf93|#b0be3c|#eda62a|#f42858|#393939}"
27
+ ).addOption(json()).addOption(space()).envVars([...ENV_AUTH, ENV_PROJECT]).examples([
28
+ {
29
+ description: "Create a status",
30
+ command: 'bee status create -p PROJECT -n "In Review" --color "#3b9dbd"'
31
+ },
32
+ {
33
+ description: "Create interactively",
34
+ command: 'bee status create -p PROJECT --color "#3b9dbd"'
35
+ }
36
+ ]).action(async (opts, cmd) => {
37
+ await resolveOptions(cmd);
38
+ const { client, host } = await getClient(opts.space);
39
+ const name = await promptRequired("Status name:", opts.name);
40
+ const status = await client.postProjectStatus(opts.project, {
41
+ name,
42
+ color: opts.color
43
+ });
44
+ outputResult(status, opts, (data) => {
45
+ consola.success(`Created status ${data.name} (ID: ${data.id})`);
46
+ consola.info(statusUrl(host, opts.project, data.id));
47
+ });
48
+ });
49
+
50
+ export { create as default };
@@ -0,0 +1,85 @@
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, d as dashboardUrl } 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 printTable } from '../shared/bee.IM3QELRf.mjs';
12
+ import { B as BeeCommand, E as ENV_AUTH } from '../shared/bee.CQ3kBgas.mjs';
13
+ import { j as json, w as web, n as noBrowser, 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 dashboard = new BeeCommand("dashboard").summary("Show a summary of your Backlog activity").description(
28
+ `Displays assigned issues, unread notifications, and projects. Use \`--web\` to open in the browser.`
29
+ ).addOption(json()).addOption(web("dashboard")).addOption(noBrowser()).addOption(space()).envVars([...ENV_AUTH]).examples([
30
+ { description: "Show dashboard", command: "bee dashboard" },
31
+ { description: "Open dashboard in browser", command: "bee dashboard --web" },
32
+ { description: "Output as JSON", command: "bee dashboard --json" }
33
+ ]).action(async (opts) => {
34
+ const { client, host } = await getClient(opts.space);
35
+ if (opts.web || opts.browser === false) {
36
+ const url = dashboardUrl(host);
37
+ await openOrPrintUrl(url, opts.browser === false, consola);
38
+ return;
39
+ }
40
+ const [myself, notifications, issues, projects] = await Promise.all([
41
+ client.getMyself(),
42
+ client.getNotificationsCount({ alreadyRead: false, resourceAlreadyRead: false }),
43
+ client.getIssues({
44
+ assigneeId: [-1],
45
+ statusId: [1, 2, 3],
46
+ count: 20,
47
+ sort: "dueDate",
48
+ order: "asc"
49
+ }),
50
+ client.getProjects({ all: false })
51
+ ]);
52
+ const result = { myself, notifications, issues, projects };
53
+ const jsonVal = opts.json === true ? "" : opts.json;
54
+ outputResult(result, { json: jsonVal }, (data) => {
55
+ consola.log("");
56
+ consola.log(` ${data.myself.name} (${host})`);
57
+ if (data.notifications.count > 0) {
58
+ consola.log(` Unread notifications: ${data.notifications.count}`);
59
+ }
60
+ consola.log("");
61
+ consola.log(" Assigned Issues:");
62
+ if (data.issues.length === 0) {
63
+ consola.log(" No assigned issues.");
64
+ } else {
65
+ const issueRows = data.issues.map((issue) => [
66
+ { header: "KEY", value: issue.issueKey },
67
+ { header: "SUMMARY", value: issue.summary },
68
+ { header: "STATUS", value: issue.status?.name ?? "" },
69
+ { header: "PRIORITY", value: issue.priority?.name ?? "" },
70
+ { header: "DUE DATE", value: issue.dueDate ? formatDate(issue.dueDate) : "" }
71
+ ]);
72
+ printTable(issueRows);
73
+ }
74
+ if (data.projects.length > 0) {
75
+ consola.log("");
76
+ consola.log(" Projects:");
77
+ for (const project of data.projects) {
78
+ consola.log(` ${project.projectKey.padEnd(20)} ${project.name}`);
79
+ }
80
+ }
81
+ consola.log("");
82
+ });
83
+ });
84
+
85
+ export { dashboard as default };
@@ -0,0 +1,48 @@
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 { c as confirmOrExit } from '../shared/bee.DVTuFf-T.mjs';
9
+ import 'node:stream/consumers';
10
+ import 'valibot';
11
+ import { B as BeeCommand, E as ENV_AUTH, a as ENV_PROJECT } from '../shared/bee.CQ3kBgas.mjs';
12
+ import { 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.-8tk76YJ.mjs';
16
+ import 'node:fs';
17
+ import 'node:path';
18
+ import 'node:os';
19
+ import '../shared/bee.BeQSH2t0.mjs';
20
+ import 'commander';
21
+ import 'consola/utils';
22
+
23
+ const deleteProject = new BeeCommand("delete").summary("Delete a project").description(`This action is irreversible. Requires Administrator role.`).argument("<project>", "Project ID or project key").option("-y, --yes", "Skip confirmation prompt").addOption(json()).addOption(space()).envVars([...ENV_AUTH, ENV_PROJECT]).examples([
24
+ {
25
+ description: "Delete a project (with confirmation)",
26
+ command: "bee project delete PROJECT_KEY"
27
+ },
28
+ {
29
+ description: "Delete a project without confirmation",
30
+ command: "bee project delete PROJECT_KEY --yes"
31
+ }
32
+ ]).action(async (project, opts) => {
33
+ const confirmed = await confirmOrExit(
34
+ `Are you sure you want to delete project ${project}? This cannot be undone.`,
35
+ opts.yes
36
+ );
37
+ if (!confirmed) {
38
+ return;
39
+ }
40
+ const { client } = await getClient(opts.space);
41
+ const projectData = await client.deleteProject(project);
42
+ const jsonArg = opts.json === true ? "" : opts.json;
43
+ outputResult(projectData, { ...opts, json: jsonArg }, (data) => {
44
+ consola.success(`Deleted project ${data.projectKey}: ${data.name}`);
45
+ });
46
+ });
47
+
48
+ export { deleteProject as default };
@@ -0,0 +1,47 @@
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 { c as confirmOrExit } from '../shared/bee.DVTuFf-T.mjs';
9
+ import 'node:stream/consumers';
10
+ import 'valibot';
11
+ import { B as BeeCommand, E as ENV_AUTH } from '../shared/bee.CQ3kBgas.mjs';
12
+ import { 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.-8tk76YJ.mjs';
16
+ import 'node:fs';
17
+ import 'node:path';
18
+ import 'node:os';
19
+ import '../shared/bee.BeQSH2t0.mjs';
20
+ import 'commander';
21
+ import 'consola/utils';
22
+
23
+ const deleteIssue = new BeeCommand("delete").summary("Delete an issue").description(`This action is irreversible.`).argument("<issue>", "Issue ID or issue key").option("-y, --yes", "Skip confirmation prompt").addOption(json()).addOption(space()).envVars([...ENV_AUTH]).examples([
24
+ {
25
+ description: "Delete an issue (with confirmation)",
26
+ command: "bee issue delete PROJECT-123"
27
+ },
28
+ {
29
+ description: "Delete an issue without confirmation",
30
+ command: "bee issue delete PROJECT-123 --yes"
31
+ }
32
+ ]).action(async (issue, opts) => {
33
+ const confirmed = await confirmOrExit(
34
+ `Are you sure you want to delete issue ${issue}? This cannot be undone.`,
35
+ opts.yes
36
+ );
37
+ if (!confirmed) {
38
+ return;
39
+ }
40
+ const { client } = await getClient(opts.space);
41
+ const issueData = await client.deleteIssue(issue);
42
+ outputResult(issueData, opts, (data) => {
43
+ consola.success(`Deleted issue ${data.issueKey}: ${data.summary}`);
44
+ });
45
+ });
46
+
47
+ export { deleteIssue as default };