@nulab/bee 1.0.0 → 1.1.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 (125) hide show
  1. package/README.md +6 -3
  2. package/dist/chunks/activities.mjs +12 -29
  3. package/dist/chunks/activities2.mjs +12 -29
  4. package/dist/chunks/activities3.mjs +12 -29
  5. package/dist/chunks/add-user.mjs +9 -11
  6. package/dist/chunks/add.mjs +9 -11
  7. package/dist/chunks/add2.mjs +9 -11
  8. package/dist/chunks/api.mjs +51 -18
  9. package/dist/chunks/attachments.mjs +11 -13
  10. package/dist/chunks/attachments2.mjs +11 -13
  11. package/dist/chunks/attachments3.mjs +11 -13
  12. package/dist/chunks/browse.mjs +7 -9
  13. package/dist/chunks/clone.mjs +9 -11
  14. package/dist/chunks/close.mjs +9 -11
  15. package/dist/chunks/comment.mjs +8 -10
  16. package/dist/chunks/comment2.mjs +11 -13
  17. package/dist/chunks/comments.mjs +9 -11
  18. package/dist/chunks/completion.mjs +52 -57
  19. package/dist/chunks/count.mjs +11 -18
  20. package/dist/chunks/count2.mjs +9 -11
  21. package/dist/chunks/count3.mjs +10 -12
  22. package/dist/chunks/count4.mjs +9 -11
  23. package/dist/chunks/count5.mjs +9 -11
  24. package/dist/chunks/create.mjs +6 -8
  25. package/dist/chunks/create2.mjs +10 -12
  26. package/dist/chunks/create3.mjs +8 -10
  27. package/dist/chunks/create4.mjs +7 -9
  28. package/dist/chunks/create5.mjs +8 -10
  29. package/dist/chunks/create6.mjs +6 -8
  30. package/dist/chunks/create7.mjs +6 -8
  31. package/dist/chunks/create8.mjs +6 -8
  32. package/dist/chunks/create9.mjs +6 -8
  33. package/dist/chunks/dashboard.mjs +11 -13
  34. package/dist/chunks/delete.mjs +6 -8
  35. package/dist/chunks/delete2.mjs +6 -8
  36. package/dist/chunks/delete3.mjs +6 -8
  37. package/dist/chunks/delete4.mjs +6 -8
  38. package/dist/chunks/delete5.mjs +6 -8
  39. package/dist/chunks/delete6.mjs +6 -8
  40. package/dist/chunks/delete7.mjs +6 -8
  41. package/dist/chunks/delete8.mjs +6 -8
  42. package/dist/chunks/delete9.mjs +6 -8
  43. package/dist/chunks/edit.mjs +9 -11
  44. package/dist/chunks/edit2.mjs +10 -12
  45. package/dist/chunks/edit3.mjs +10 -12
  46. package/dist/chunks/edit4.mjs +9 -11
  47. package/dist/chunks/edit5.mjs +6 -8
  48. package/dist/chunks/edit6.mjs +9 -11
  49. package/dist/chunks/edit7.mjs +9 -11
  50. package/dist/chunks/edit8.mjs +9 -11
  51. package/dist/chunks/history.mjs +11 -13
  52. package/dist/chunks/index.mjs +1 -1
  53. package/dist/chunks/index10.mjs +1 -1
  54. package/dist/chunks/index11.mjs +1 -1
  55. package/dist/chunks/index12.mjs +1 -1
  56. package/dist/chunks/index13.mjs +1 -1
  57. package/dist/chunks/index14.mjs +1 -1
  58. package/dist/chunks/index15.mjs +1 -1
  59. package/dist/chunks/index16.mjs +1 -1
  60. package/dist/chunks/index17.mjs +1 -1
  61. package/dist/chunks/index2.mjs +1 -1
  62. package/dist/chunks/index3.mjs +1 -1
  63. package/dist/chunks/index4.mjs +1 -1
  64. package/dist/chunks/index5.mjs +1 -1
  65. package/dist/chunks/index6.mjs +1 -1
  66. package/dist/chunks/index7.mjs +1 -1
  67. package/dist/chunks/index8.mjs +1 -1
  68. package/dist/chunks/index9.mjs +1 -1
  69. package/dist/chunks/list.mjs +11 -13
  70. package/dist/chunks/list10.mjs +11 -13
  71. package/dist/chunks/list11.mjs +11 -13
  72. package/dist/chunks/list12.mjs +11 -13
  73. package/dist/chunks/list13.mjs +11 -13
  74. package/dist/chunks/list14.mjs +11 -13
  75. package/dist/chunks/list15.mjs +11 -13
  76. package/dist/chunks/list2.mjs +13 -20
  77. package/dist/chunks/list3.mjs +12 -14
  78. package/dist/chunks/list4.mjs +11 -13
  79. package/dist/chunks/list5.mjs +12 -14
  80. package/dist/chunks/list6.mjs +11 -13
  81. package/dist/chunks/list7.mjs +11 -13
  82. package/dist/chunks/list8.mjs +11 -13
  83. package/dist/chunks/list9.mjs +11 -13
  84. package/dist/chunks/login.mjs +18 -9
  85. package/dist/chunks/logout.mjs +9 -5
  86. package/dist/chunks/me.mjs +11 -13
  87. package/dist/chunks/read-all.mjs +9 -11
  88. package/dist/chunks/read.mjs +9 -11
  89. package/dist/chunks/read2.mjs +9 -11
  90. package/dist/chunks/refresh.mjs +5 -7
  91. package/dist/chunks/remove-user.mjs +9 -11
  92. package/dist/chunks/remove.mjs +9 -11
  93. package/dist/chunks/reopen.mjs +9 -11
  94. package/dist/chunks/status.mjs +9 -6
  95. package/dist/chunks/status2.mjs +9 -11
  96. package/dist/chunks/status3.mjs +9 -11
  97. package/dist/chunks/switch.mjs +8 -4
  98. package/dist/chunks/tags.mjs +9 -11
  99. package/dist/chunks/token.mjs +9 -5
  100. package/dist/chunks/tree.mjs +9 -11
  101. package/dist/chunks/users.mjs +11 -13
  102. package/dist/chunks/view.mjs +11 -13
  103. package/dist/chunks/view2.mjs +14 -15
  104. package/dist/chunks/view3.mjs +12 -14
  105. package/dist/chunks/view4.mjs +11 -13
  106. package/dist/chunks/view5.mjs +11 -13
  107. package/dist/chunks/view6.mjs +11 -13
  108. package/dist/chunks/view7.mjs +11 -13
  109. package/dist/chunks/view8.mjs +11 -13
  110. package/dist/chunks/view9.mjs +11 -13
  111. package/dist/index.mjs +37751 -37
  112. package/dist/shared/{bee.PF8hrVKn.mjs → bee.084B_7FC.mjs} +1 -1
  113. package/dist/shared/{bee.D6yQ6Pqf.mjs → bee.C4p7W8_P.mjs} +1 -1
  114. package/dist/shared/{bee.DxRKWv6n.mjs → bee.CAARNIp6.mjs} +1 -1
  115. package/dist/shared/{bee.Bt1TK6yh.mjs → bee.CHtg3F43.mjs} +46 -7
  116. package/dist/shared/{bee.CCNmDHVv.mjs → bee.CirccSk2.mjs} +19 -1
  117. package/dist/shared/{bee.Ds2l-nTJ.mjs → bee.DFnSWb6q.mjs} +101 -13
  118. package/dist/shared/{bee.bmiIlr9W.mjs → bee.KteAW2rM.mjs} +12 -2
  119. package/dist/shared/{bee.OJ0vqxJN.mjs → bee.RsR9yniy.mjs} +10 -4
  120. package/dist/shared/{bee.IM3QELRf.mjs → bee.a05kNWpn.mjs} +1 -1
  121. package/dist/shared/{bee.G4d7izLe.mjs → bee.q93n012-.mjs} +1 -1
  122. package/package.json +12 -10
  123. package/dist/shared/bee.BYqxm3yG.mjs +0 -24
  124. package/dist/shared/bee.BeQSH2t0.mjs +0 -25
  125. package/dist/shared/bee.BtxMsVL4.mjs +0 -35104
@@ -3,24 +3,22 @@ import { R as ResolutionId, I as IssueStatusId } from '../shared/bee.Btmq3TXs.mj
3
3
  import { o as outputResult } from '../shared/bee.BTBGpv4K.mjs';
4
4
  import 'node:stream/consumers';
5
5
  import 'valibot';
6
- import { p as parseArg, v as vInteger } from '../shared/bee.BYqxm3yG.mjs';
7
- import { g as getClient } from '../shared/bee.OJ0vqxJN.mjs';
6
+ import { p as parseArg, v as vInteger } from '../index.mjs';
7
+ import { g as getClient } from '../shared/bee.RsR9yniy.mjs';
8
8
  import 'backlog-js';
9
9
  import 'node:http';
10
10
  import 'open';
11
11
  import 'node:child_process';
12
- import '../shared/bee.BtxMsVL4.mjs';
13
- import { B as BeeCommand, E as ENV_AUTH } from '../shared/bee.bmiIlr9W.mjs';
14
- import { t as notify, j as json, s as space } from '../shared/bee.Bt1TK6yh.mjs';
15
- import '../shared/bee.CktwmH8R.mjs';
16
- import '../shared/bee.DxRKWv6n.mjs';
17
- import 'node:module';
18
- import 'commander';
19
- import 'consola/utils';
12
+ import { B as BeeCommand, E as ENV_AUTH } from '../shared/bee.KteAW2rM.mjs';
13
+ import { x as notify, j as json, s as space } from '../shared/bee.CHtg3F43.mjs';
20
14
  import 'node:fs';
21
15
  import 'node:path';
22
16
  import 'node:os';
23
- import '../shared/bee.BeQSH2t0.mjs';
17
+ import 'node:module';
18
+ import 'commander';
19
+ import 'consola/utils';
20
+ import '../shared/bee.CktwmH8R.mjs';
21
+ import '../shared/bee.CAARNIp6.mjs';
24
22
 
25
23
  const close = new BeeCommand("close").summary("Close an issue").description(
26
24
  `Sets the status to Closed with resolution \`Fixed\` by default. Use \`--resolution\` for a different resolution.`
@@ -1,29 +1,27 @@
1
1
  import consola from 'consola';
2
2
  import { o as outputResult } from '../shared/bee.BTBGpv4K.mjs';
3
- import { t as notify, x as attachment, j as json, s as space, d as confirmOrExit } from '../shared/bee.Bt1TK6yh.mjs';
3
+ import { x as notify, y as attachment, j as json, s as space, e as confirmOrExit } from '../shared/bee.CHtg3F43.mjs';
4
4
  import { a as resolveStdinArg } from '../shared/bee.C--ZWPxf.mjs';
5
5
  import 'valibot';
6
- import '../shared/bee.BYqxm3yG.mjs';
6
+ import '../index.mjs';
7
7
  import { f as formatDate } from '../shared/bee.n5MYN4a6.mjs';
8
- import { p as printTable } from '../shared/bee.IM3QELRf.mjs';
9
- import { g as getClient } from '../shared/bee.OJ0vqxJN.mjs';
8
+ import { p as printTable } from '../shared/bee.a05kNWpn.mjs';
9
+ import { g as getClient } from '../shared/bee.RsR9yniy.mjs';
10
10
  import 'backlog-js';
11
11
  import 'node:http';
12
12
  import 'open';
13
13
  import 'node:child_process';
14
- import '../shared/bee.BtxMsVL4.mjs';
15
- import { B as BeeCommand, E as ENV_AUTH } from '../shared/bee.bmiIlr9W.mjs';
14
+ import { B as BeeCommand, E as ENV_AUTH } from '../shared/bee.KteAW2rM.mjs';
16
15
  import 'node:fs';
17
16
  import 'node:path';
18
17
  import 'node:os';
19
18
  import 'node:stream/consumers';
20
- import '../shared/bee.BeQSH2t0.mjs';
21
19
  import 'commander';
22
- import '../shared/bee.Ds2l-nTJ.mjs';
23
- import '../shared/bee.CktwmH8R.mjs';
24
- import '../shared/bee.DxRKWv6n.mjs';
25
20
  import 'node:module';
26
21
  import 'consola/utils';
22
+ import '../shared/bee.DFnSWb6q.mjs';
23
+ import '../shared/bee.CktwmH8R.mjs';
24
+ import '../shared/bee.CAARNIp6.mjs';
27
25
 
28
26
  const comment = new BeeCommand("comment").summary("Add a comment to an issue").description(
29
27
  `When input is piped, it is used as the body automatically.
@@ -2,28 +2,26 @@ import consola from 'consola';
2
2
  import { o as outputResult } from '../shared/bee.BTBGpv4K.mjs';
3
3
  import { a as resolveStdinArg } from '../shared/bee.C--ZWPxf.mjs';
4
4
  import 'valibot';
5
- import { p as parseArg, v as vInteger } from '../shared/bee.BYqxm3yG.mjs';
5
+ import { p as parseArg, v as vInteger } from '../index.mjs';
6
6
  import { f as formatDate } from '../shared/bee.n5MYN4a6.mjs';
7
- import { p as printTable } from '../shared/bee.IM3QELRf.mjs';
8
- import { g as getClient } from '../shared/bee.OJ0vqxJN.mjs';
7
+ import { p as printTable } from '../shared/bee.a05kNWpn.mjs';
8
+ import { g as getClient } from '../shared/bee.RsR9yniy.mjs';
9
9
  import 'backlog-js';
10
10
  import 'node:http';
11
11
  import 'open';
12
12
  import 'node:child_process';
13
- import '../shared/bee.BtxMsVL4.mjs';
14
- import { B as BeeCommand, E as ENV_AUTH, a as ENV_PROJECT, b as ENV_REPO } from '../shared/bee.bmiIlr9W.mjs';
15
- import { p as project, B as repo, t as notify, j as json, s as space, r as resolveOptions } from '../shared/bee.Bt1TK6yh.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, x as notify, j as json, s as space, r as resolveOptions } from '../shared/bee.CHtg3F43.mjs';
16
15
  import 'node:stream/consumers';
17
- import '../shared/bee.Ds2l-nTJ.mjs';
18
- import '../shared/bee.CktwmH8R.mjs';
19
- import '../shared/bee.DxRKWv6n.mjs';
20
- import 'node:module';
21
- import 'commander';
22
- import 'consola/utils';
23
16
  import 'node:fs';
24
17
  import 'node:path';
25
18
  import 'node:os';
26
- import '../shared/bee.BeQSH2t0.mjs';
19
+ import 'node:module';
20
+ import 'commander';
21
+ import 'consola/utils';
22
+ import '../shared/bee.DFnSWb6q.mjs';
23
+ import '../shared/bee.CktwmH8R.mjs';
24
+ import '../shared/bee.CAARNIp6.mjs';
27
25
 
28
26
  const comment = new BeeCommand("comment").summary("Add a comment to a pull request").description(
29
27
  `When input is piped, it is used as the body automatically.
@@ -2,25 +2,23 @@ import consola from 'consola';
2
2
  import { o as outputResult } from '../shared/bee.BTBGpv4K.mjs';
3
3
  import 'node:stream/consumers';
4
4
  import * as v from 'valibot';
5
- import { p as parseArg, v as vInteger } from '../shared/bee.BYqxm3yG.mjs';
5
+ import { p as parseArg, v as vInteger } from '../index.mjs';
6
6
  import { f as formatDate } from '../shared/bee.n5MYN4a6.mjs';
7
- import { g as getClient } from '../shared/bee.OJ0vqxJN.mjs';
7
+ import { g as getClient } from '../shared/bee.RsR9yniy.mjs';
8
8
  import 'backlog-js';
9
9
  import 'node:http';
10
10
  import 'open';
11
11
  import 'node:child_process';
12
- import '../shared/bee.BtxMsVL4.mjs';
13
- import { B as BeeCommand, E as ENV_AUTH, a as ENV_PROJECT, b as ENV_REPO } from '../shared/bee.bmiIlr9W.mjs';
14
- import { p as project, B as repo, z as minId, A as maxId, f as count, o as order, j as json, s as space, r as resolveOptions } from '../shared/bee.Bt1TK6yh.mjs';
15
- import '../shared/bee.CktwmH8R.mjs';
16
- import '../shared/bee.DxRKWv6n.mjs';
17
- import 'node:module';
18
- import 'commander';
19
- import 'consola/utils';
12
+ import { B as BeeCommand, E as ENV_AUTH, a as ENV_PROJECT, b as ENV_REPO } from '../shared/bee.KteAW2rM.mjs';
13
+ 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.CHtg3F43.mjs';
20
14
  import 'node:fs';
21
15
  import 'node:path';
22
16
  import 'node:os';
23
- import '../shared/bee.BeQSH2t0.mjs';
17
+ import 'node:module';
18
+ import 'commander';
19
+ import 'consola/utils';
20
+ import '../shared/bee.CktwmH8R.mjs';
21
+ import '../shared/bee.CAARNIp6.mjs';
24
22
 
25
23
  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
24
  {
@@ -1,19 +1,34 @@
1
1
  import 'consola';
2
- import { U as UserError } from '../shared/bee.BYqxm3yG.mjs';
2
+ import { U as UserError } from '../index.mjs';
3
3
  import 'node:stream/consumers';
4
4
  import 'valibot';
5
- import { B as BeeCommand } from '../shared/bee.bmiIlr9W.mjs';
5
+ import { B as BeeCommand } from '../shared/bee.KteAW2rM.mjs';
6
+ import 'backlog-js';
7
+ import 'node:fs';
8
+ import 'node:path';
9
+ import 'node:os';
10
+ import 'node:http';
11
+ import 'open';
12
+ import 'node:child_process';
13
+ import 'node:module';
6
14
  import 'commander';
7
15
  import 'consola/utils';
8
16
 
9
- const COMPLETION_SCRIPTS = {
10
- bash: `# bash completion for bee
17
+ const isListable = (cmd) => cmd.name() !== "help";
18
+ const toEntry = (cmd) => ({
19
+ name: cmd.name(),
20
+ summary: cmd.summary() || cmd.description()
21
+ });
22
+ const commandEntries = (program) => program.commands.filter(isListable).map(toEntry);
23
+ const escapeZsh = (text) => text.replaceAll(":", String.raw`\:`);
24
+ const escapeDoubleQuoted = (text) => text.replaceAll(/(["$`\\])/g, String.raw`\$1`);
25
+ const renderBash = (entries) => `# bash completion for bee
11
26
  # Add to ~/.bashrc:
12
27
  # eval "$(bee completion bash)"
13
28
 
14
29
  _bee_completions() {
15
30
  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"
31
+ local commands="${entries.map((entry) => entry.name).join(" ")}"
17
32
 
18
33
  if [ "\${COMP_CWORD}" -eq 1 ]; then
19
34
  COMPREPLY=( $(compgen -W "\${commands}" -- "\${cur}") )
@@ -21,8 +36,10 @@ _bee_completions() {
21
36
  }
22
37
 
23
38
  complete -F _bee_completions bee
24
- `,
25
- zsh: `#compdef bee
39
+ `;
40
+ const renderZsh = (entries) => {
41
+ const pairs = entries.map((entry) => ` '${escapeZsh(entry.name)}:${escapeZsh(entry.summary)}'`).join(" \\\n");
42
+ return `#compdef bee
26
43
  # zsh completion for bee
27
44
  # Add to ~/.zshrc:
28
45
  # eval "$(bee completion zsh)"
@@ -30,27 +47,7 @@ complete -F _bee_completions bee
30
47
  _bee() {
31
48
  local -a commands
32
49
  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'
50
+ ${pairs}
54
51
  )
55
52
 
56
53
  _arguments '1: :->command' '*:: :->args'
@@ -63,34 +60,33 @@ _bee() {
63
60
  }
64
61
 
65
62
  compdef _bee bee
66
- `,
67
- fish: `# fish completion for bee
63
+ `;
64
+ };
65
+ const renderFish = (entries) => {
66
+ const lines = entries.map(
67
+ (entry) => `complete -c bee -n "__fish_use_subcommand" -a "${entry.name}" -d "${escapeDoubleQuoted(entry.summary)}"`
68
+ ).join("\n");
69
+ return `# fish completion for bee
68
70
  # Add to ~/.config/fish/completions/bee.fish:
69
71
  # bee completion fish > ~/.config/fish/completions/bee.fish
70
72
 
71
73
  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
- `
74
+ ${lines}
75
+ `;
76
+ };
77
+ const RENDERERS = Object.assign(
78
+ /* @__PURE__ */ Object.create(null),
79
+ { bash: renderBash, zsh: renderZsh, fish: renderFish }
80
+ );
81
+ const SUPPORTED_SHELLS = Object.keys(RENDERERS);
82
+ const isSupportedShell = (shell) => shell in RENDERERS;
83
+ const renderCompletionScript = (shell, program) => RENDERERS[shell](commandEntries(program));
84
+
85
+ const buildProgram = async () => {
86
+ const { loadCommands } = await import('../index.mjs').then(function (n) { return n.r; });
87
+ const program = new BeeCommand("bee");
88
+ await program.addCommands(loadCommands());
89
+ return program;
94
90
  };
95
91
  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
92
  {
@@ -105,14 +101,13 @@ const completion = new BeeCommand("completion").summary("Generate shell completi
105
101
  description: "Set up completions for fish",
106
102
  command: "bee completion fish > ~/.config/fish/completions/bee.fish"
107
103
  }
108
- ]).action((shell) => {
109
- const script = COMPLETION_SCRIPTS[shell];
110
- if (!script) {
104
+ ]).action(async (shell) => {
105
+ if (!isSupportedShell(shell)) {
111
106
  throw new UserError(
112
- `Unsupported shell: "${shell}". Supported shells: ${Object.keys(COMPLETION_SCRIPTS).join(", ")}.`
107
+ `Unsupported shell: "${shell}". Supported shells: ${SUPPORTED_SHELLS.join(", ")}.`
113
108
  );
114
109
  }
115
- process.stdout.write(script);
110
+ process.stdout.write(renderCompletionScript(shell, await buildProgram()));
116
111
  });
117
112
 
118
113
  export { completion as default };
@@ -1,28 +1,26 @@
1
1
  import consola from 'consola';
2
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.OJ0vqxJN.mjs';
3
+ import { r as resolveProjectIds } from '../shared/bee.084B_7FC.mjs';
4
+ import { r as resolveUserId } from '../shared/bee.q93n012-.mjs';
5
+ import { g as getClient } from '../shared/bee.RsR9yniy.mjs';
6
6
  import 'backlog-js';
7
7
  import 'node:http';
8
8
  import 'open';
9
9
  import 'node:child_process';
10
- import '../shared/bee.BtxMsVL4.mjs';
10
+ import '../index.mjs';
11
11
  import { o as outputResult } from '../shared/bee.BTBGpv4K.mjs';
12
12
  import 'node:stream/consumers';
13
13
  import 'valibot';
14
- import '../shared/bee.BYqxm3yG.mjs';
15
- import { Option } from 'commander';
16
- import { B as BeeCommand, E as ENV_AUTH, a as ENV_PROJECT } from '../shared/bee.bmiIlr9W.mjs';
17
- import { g as assigneeList, e as collectNum, c as collect, k as keyword, j as json, s as space } from '../shared/bee.Bt1TK6yh.mjs';
14
+ import { B as BeeCommand, E as ENV_AUTH, a as ENV_PROJECT } from '../shared/bee.KteAW2rM.mjs';
15
+ 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.CHtg3F43.mjs';
18
16
  import '../shared/bee.CktwmH8R.mjs';
19
- import '../shared/bee.DxRKWv6n.mjs';
20
- import 'node:module';
21
- import 'consola/utils';
17
+ import '../shared/bee.CAARNIp6.mjs';
22
18
  import 'node:fs';
23
19
  import 'node:path';
24
20
  import 'node:os';
25
- import '../shared/bee.BeQSH2t0.mjs';
21
+ import 'node:module';
22
+ import 'commander';
23
+ import 'consola/utils';
26
24
 
27
25
  const resolvePriorityIds = (priorities) => priorities.map((name) => {
28
26
  const id = PriorityId[name.toLowerCase()];
@@ -31,12 +29,7 @@ const resolvePriorityIds = (priorities) => priorities.map((name) => {
31
29
  }
32
30
  return id;
33
31
  });
34
- const count = new BeeCommand("count").summary("Count issues").description(`Accepts the same filter flags as \`bee issue list\`.`).addOption(
35
- new Option(
36
- "-p, --project <id>",
37
- "Project ID or project key (comma-separated for multiple)"
38
- ).env("BACKLOG_PROJECT")
39
- ).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([
32
+ 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([
40
33
  { description: "Count all issues in a project", command: "bee issue count -p PROJECT" },
41
34
  {
42
35
  description: "Count open bugs assigned to you",
@@ -2,24 +2,22 @@ import consola from 'consola';
2
2
  import { o as outputResult } from '../shared/bee.BTBGpv4K.mjs';
3
3
  import 'node:stream/consumers';
4
4
  import 'valibot';
5
- import '../shared/bee.BYqxm3yG.mjs';
6
- import { g as getClient } from '../shared/bee.OJ0vqxJN.mjs';
5
+ import '../index.mjs';
6
+ import { g as getClient } from '../shared/bee.RsR9yniy.mjs';
7
7
  import 'backlog-js';
8
8
  import 'node:http';
9
9
  import 'open';
10
10
  import 'node:child_process';
11
- import '../shared/bee.BtxMsVL4.mjs';
12
- import { B as BeeCommand, E as ENV_AUTH } from '../shared/bee.bmiIlr9W.mjs';
13
- import { j as json, s as space } from '../shared/bee.Bt1TK6yh.mjs';
14
- import '../shared/bee.CktwmH8R.mjs';
15
- import '../shared/bee.DxRKWv6n.mjs';
16
- import 'node:module';
17
- import 'commander';
18
- import 'consola/utils';
11
+ import { B as BeeCommand, E as ENV_AUTH } from '../shared/bee.KteAW2rM.mjs';
12
+ import { j as json, s as space } from '../shared/bee.CHtg3F43.mjs';
19
13
  import 'node:fs';
20
14
  import 'node:path';
21
15
  import 'node:os';
22
- import '../shared/bee.BeQSH2t0.mjs';
16
+ import 'node:module';
17
+ import 'commander';
18
+ import 'consola/utils';
19
+ import '../shared/bee.CktwmH8R.mjs';
20
+ import '../shared/bee.CAARNIp6.mjs';
23
21
 
24
22
  const parseReadFilter = (value) => {
25
23
  if (value === void 0 || value === "all") {
@@ -3,25 +3,23 @@ import { P as PrStatusName, a as PR_STATUS_NAMES } from '../shared/bee.DoTvz3uW.
3
3
  import { o as outputResult } from '../shared/bee.BTBGpv4K.mjs';
4
4
  import 'node:stream/consumers';
5
5
  import 'valibot';
6
- import '../shared/bee.BYqxm3yG.mjs';
7
- import { r as resolveUserId } from '../shared/bee.G4d7izLe.mjs';
8
- import { g as getClient } from '../shared/bee.OJ0vqxJN.mjs';
6
+ import '../index.mjs';
7
+ import { r as resolveUserId } from '../shared/bee.q93n012-.mjs';
8
+ import { g as getClient } from '../shared/bee.RsR9yniy.mjs';
9
9
  import 'backlog-js';
10
10
  import 'node:http';
11
11
  import 'open';
12
12
  import 'node:child_process';
13
- import '../shared/bee.BtxMsVL4.mjs';
14
- import { B as BeeCommand, E as ENV_AUTH, a as ENV_PROJECT, b as ENV_REPO } from '../shared/bee.bmiIlr9W.mjs';
15
- import { p as project, B as repo, c as collect, g as assigneeList, e as collectNum, j as json, s as space, r as resolveOptions } from '../shared/bee.Bt1TK6yh.mjs';
16
- import '../shared/bee.CktwmH8R.mjs';
17
- import '../shared/bee.DxRKWv6n.mjs';
18
- import 'node:module';
19
- import 'commander';
20
- import 'consola/utils';
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, c as collect, h as assigneeList, f as collectNum, j as json, s as space, r as resolveOptions } from '../shared/bee.CHtg3F43.mjs';
21
15
  import 'node:fs';
22
16
  import 'node:path';
23
17
  import 'node:os';
24
- import '../shared/bee.BeQSH2t0.mjs';
18
+ import 'node:module';
19
+ import 'commander';
20
+ import 'consola/utils';
21
+ import '../shared/bee.CktwmH8R.mjs';
22
+ import '../shared/bee.CAARNIp6.mjs';
25
23
 
26
24
  const resolveStatusIds = (statuses) => statuses.map((name) => {
27
25
  const id = PrStatusName[name.toLowerCase()];
@@ -2,24 +2,22 @@ import consola from 'consola';
2
2
  import { o as outputResult } from '../shared/bee.BTBGpv4K.mjs';
3
3
  import 'node:stream/consumers';
4
4
  import 'valibot';
5
- import '../shared/bee.BYqxm3yG.mjs';
6
- import { g as getClient } from '../shared/bee.OJ0vqxJN.mjs';
5
+ import '../index.mjs';
6
+ import { g as getClient } from '../shared/bee.RsR9yniy.mjs';
7
7
  import 'backlog-js';
8
8
  import 'node:http';
9
9
  import 'open';
10
10
  import 'node:child_process';
11
- import '../shared/bee.BtxMsVL4.mjs';
12
- import { B as BeeCommand, E as ENV_AUTH, a as ENV_PROJECT } from '../shared/bee.bmiIlr9W.mjs';
13
- import { p as project, j as json, s as space, r as resolveOptions } from '../shared/bee.Bt1TK6yh.mjs';
14
- import '../shared/bee.CktwmH8R.mjs';
15
- import '../shared/bee.DxRKWv6n.mjs';
16
- import 'node:module';
17
- import 'commander';
18
- import 'consola/utils';
11
+ import { B as BeeCommand, E as ENV_AUTH, a as ENV_PROJECT } from '../shared/bee.KteAW2rM.mjs';
12
+ import { d as project, j as json, s as space, r as resolveOptions } from '../shared/bee.CHtg3F43.mjs';
19
13
  import 'node:fs';
20
14
  import 'node:path';
21
15
  import 'node:os';
22
- import '../shared/bee.BeQSH2t0.mjs';
16
+ import 'node:module';
17
+ import 'commander';
18
+ import 'consola/utils';
19
+ import '../shared/bee.CktwmH8R.mjs';
20
+ import '../shared/bee.CAARNIp6.mjs';
23
21
 
24
22
  const count = new BeeCommand("count").summary("Count wiki pages").description(`Counts all wiki pages regardless of tag or keyword.`).addOption(project()).addOption(json()).addOption(space()).envVars([...ENV_AUTH, ENV_PROJECT]).examples([
25
23
  { description: "Count wiki pages", command: "bee wiki count -p PROJECT" },
@@ -2,24 +2,22 @@ import consola from 'consola';
2
2
  import { o as outputResult } from '../shared/bee.BTBGpv4K.mjs';
3
3
  import 'node:stream/consumers';
4
4
  import 'valibot';
5
- import { p as parseArg, v as vInteger } from '../shared/bee.BYqxm3yG.mjs';
6
- import { g as getClient } from '../shared/bee.OJ0vqxJN.mjs';
5
+ import { p as parseArg, v as vInteger } from '../index.mjs';
6
+ import { g as getClient } from '../shared/bee.RsR9yniy.mjs';
7
7
  import 'backlog-js';
8
8
  import 'node:http';
9
9
  import 'open';
10
10
  import 'node:child_process';
11
- import '../shared/bee.BtxMsVL4.mjs';
12
- import { B as BeeCommand, E as ENV_AUTH } from '../shared/bee.bmiIlr9W.mjs';
13
- import { j as json, s as space } from '../shared/bee.Bt1TK6yh.mjs';
14
- import '../shared/bee.CktwmH8R.mjs';
15
- import '../shared/bee.DxRKWv6n.mjs';
16
- import 'node:module';
17
- import 'commander';
18
- import 'consola/utils';
11
+ import { B as BeeCommand, E as ENV_AUTH } from '../shared/bee.KteAW2rM.mjs';
12
+ import { j as json, s as space } from '../shared/bee.CHtg3F43.mjs';
19
13
  import 'node:fs';
20
14
  import 'node:path';
21
15
  import 'node:os';
22
- import '../shared/bee.BeQSH2t0.mjs';
16
+ import 'node:module';
17
+ import 'commander';
18
+ import 'consola/utils';
19
+ import '../shared/bee.CktwmH8R.mjs';
20
+ import '../shared/bee.CAARNIp6.mjs';
23
21
 
24
22
  const count = new BeeCommand("count").summary("Count received stars").description(`Defaults to the authenticated user if no user ID is given.`).argument("[user]", "User ID").option("--since <yyyy-MM-dd>", "Count stars received on or after this date").option("--until <yyyy-MM-dd>", "Count stars received on or before this date").addOption(json()).addOption(space()).envVars([...ENV_AUTH]).examples([
25
23
  { description: "Count your stars", command: "bee star count" },
@@ -1,26 +1,24 @@
1
1
  import consola from 'consola';
2
2
  import { o as outputResult } from '../shared/bee.BTBGpv4K.mjs';
3
- import { j as json, s as space, a as promptRequired } from '../shared/bee.Bt1TK6yh.mjs';
3
+ import { j as json, s as space, a as promptRequired } from '../shared/bee.CHtg3F43.mjs';
4
4
  import 'node:stream/consumers';
5
5
  import 'valibot';
6
- import '../shared/bee.BYqxm3yG.mjs';
7
- import { g as getClient } from '../shared/bee.OJ0vqxJN.mjs';
6
+ import '../index.mjs';
7
+ import { g as getClient } from '../shared/bee.RsR9yniy.mjs';
8
8
  import 'backlog-js';
9
9
  import 'node:http';
10
10
  import { p as projectUrl } from '../shared/bee.CzKcWSES.mjs';
11
11
  import 'node:child_process';
12
- import '../shared/bee.BtxMsVL4.mjs';
13
- import { B as BeeCommand, E as ENV_AUTH } from '../shared/bee.bmiIlr9W.mjs';
12
+ import { B as BeeCommand, E as ENV_AUTH } from '../shared/bee.KteAW2rM.mjs';
14
13
  import 'node:fs';
15
14
  import 'node:path';
16
15
  import 'node:os';
17
- import '../shared/bee.BeQSH2t0.mjs';
18
16
  import 'commander';
19
- import '../shared/bee.CktwmH8R.mjs';
20
- import '../shared/bee.DxRKWv6n.mjs';
21
17
  import 'open';
22
18
  import 'node:module';
23
19
  import 'consola/utils';
20
+ import '../shared/bee.CktwmH8R.mjs';
21
+ import '../shared/bee.CAARNIp6.mjs';
24
22
 
25
23
  const create = new BeeCommand("create").summary("Create a project").description(
26
24
  `Project key must consist of uppercase letters, numbers, and underscores. Omitted fields will be prompted interactively.`
@@ -1,33 +1,31 @@
1
1
  import consola from 'consola';
2
2
  import { a as PRIORITY_NAMES, P as PriorityId } 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.OJ0vqxJN.mjs';
3
+ import { r as resolveProjectIds } from '../shared/bee.084B_7FC.mjs';
4
+ import { r as resolveUserId } from '../shared/bee.q93n012-.mjs';
5
+ import { g as getClient } from '../shared/bee.RsR9yniy.mjs';
6
6
  import 'backlog-js';
7
7
  import 'node:http';
8
8
  import { i as issueUrl } from '../shared/bee.CzKcWSES.mjs';
9
9
  import 'node:child_process';
10
- import '../shared/bee.BtxMsVL4.mjs';
10
+ import { p as parseArg, a as vFiniteNumber, v as vInteger } from '../index.mjs';
11
11
  import { o as outputResult } from '../shared/bee.BTBGpv4K.mjs';
12
- import { i as assignee, m as category, v as version, q as milestone, t as notify, x as attachment, j as json, s as space, a as promptRequired } from '../shared/bee.Bt1TK6yh.mjs';
12
+ import { p as projectOptional, m as assignee, q as category, v as version, t as milestone, x as notify, y as attachment, j as json, s as space, a as promptRequired } from '../shared/bee.CHtg3F43.mjs';
13
13
  import 'node:stream/consumers';
14
14
  import * as v from 'valibot';
15
- import { p as parseArg, a as vFiniteNumber, v as vInteger } from '../shared/bee.BYqxm3yG.mjs';
16
- import { Option } from 'commander';
17
- import { B as BeeCommand, E as ENV_AUTH, a as ENV_PROJECT } from '../shared/bee.bmiIlr9W.mjs';
15
+ import { B as BeeCommand, E as ENV_AUTH, a as ENV_PROJECT } from '../shared/bee.KteAW2rM.mjs';
18
16
  import '../shared/bee.CktwmH8R.mjs';
19
- import '../shared/bee.DxRKWv6n.mjs';
17
+ import '../shared/bee.CAARNIp6.mjs';
20
18
  import 'open';
21
- import 'node:module';
22
19
  import 'node:fs';
23
20
  import 'node:path';
24
21
  import 'node:os';
25
- import '../shared/bee.BeQSH2t0.mjs';
22
+ import 'node:module';
23
+ import 'commander';
26
24
  import 'consola/utils';
27
25
 
28
26
  const create = new BeeCommand("create").summary("Create an issue").description(
29
27
  `Omitted required fields will be prompted interactively. Priority accepts a name: \`high\`, \`normal\`, or \`low\`.`
30
- ).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()).addOption(category()).addOption(version()).addOption(milestone()).option("--parent-issue <id>", "Parent issue ID").option("--start-date <date>", "Start date").option("--due-date <date>", "Due date").option("--estimated-hours <n>", "Estimated hours").option("--actual-hours <n>", "Actual hours").addOption(notify()).addOption(attachment()).addOption(json()).addOption(space()).envVars([...ENV_AUTH, ENV_PROJECT]).examples([
28
+ ).addOption(projectOptional()).option("-t, --title <text>", "Issue title").option("-T, --type <id>", "Issue type ID").option("-P, --priority <name>", "Priority").option("-d, --description <text>", "Issue description").addOption(assignee()).addOption(category()).addOption(version()).addOption(milestone()).option("--parent-issue <id>", "Parent issue ID").option("--start-date <date>", "Start date").option("--due-date <date>", "Due date").option("--estimated-hours <n>", "Estimated hours").option("--actual-hours <n>", "Actual hours").addOption(notify()).addOption(attachment()).addOption(json()).addOption(space()).envVars([...ENV_AUTH, ENV_PROJECT]).examples([
31
29
  {
32
30
  description: "Create an issue with required fields",
33
31
  command: 'bee issue create -p PROJECT --type 1 --priority normal -t "Fix login bug"'