@nulab/bee 1.0.0 → 1.1.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.
Files changed (121) hide show
  1. package/dist/chunks/activities.mjs +9 -24
  2. package/dist/chunks/activities2.mjs +9 -24
  3. package/dist/chunks/activities3.mjs +9 -24
  4. package/dist/chunks/add-user.mjs +6 -6
  5. package/dist/chunks/add.mjs +6 -6
  6. package/dist/chunks/add2.mjs +6 -6
  7. package/dist/chunks/api.mjs +48 -13
  8. package/dist/chunks/attachments.mjs +8 -8
  9. package/dist/chunks/attachments2.mjs +8 -8
  10. package/dist/chunks/attachments3.mjs +8 -8
  11. package/dist/chunks/browse.mjs +7 -7
  12. package/dist/chunks/clone.mjs +6 -6
  13. package/dist/chunks/close.mjs +6 -6
  14. package/dist/chunks/comment.mjs +8 -8
  15. package/dist/chunks/comment2.mjs +8 -8
  16. package/dist/chunks/comments.mjs +6 -6
  17. package/dist/chunks/completion.mjs +1 -1
  18. package/dist/chunks/count.mjs +8 -13
  19. package/dist/chunks/count2.mjs +6 -6
  20. package/dist/chunks/count3.mjs +6 -6
  21. package/dist/chunks/count4.mjs +6 -6
  22. package/dist/chunks/count5.mjs +6 -6
  23. package/dist/chunks/create.mjs +6 -6
  24. package/dist/chunks/create2.mjs +8 -8
  25. package/dist/chunks/create3.mjs +7 -7
  26. package/dist/chunks/create4.mjs +6 -6
  27. package/dist/chunks/create5.mjs +7 -7
  28. package/dist/chunks/create6.mjs +6 -6
  29. package/dist/chunks/create7.mjs +6 -6
  30. package/dist/chunks/create8.mjs +6 -6
  31. package/dist/chunks/create9.mjs +6 -6
  32. package/dist/chunks/dashboard.mjs +8 -8
  33. package/dist/chunks/delete.mjs +6 -6
  34. package/dist/chunks/delete2.mjs +6 -6
  35. package/dist/chunks/delete3.mjs +6 -6
  36. package/dist/chunks/delete4.mjs +6 -6
  37. package/dist/chunks/delete5.mjs +6 -6
  38. package/dist/chunks/delete6.mjs +6 -6
  39. package/dist/chunks/delete7.mjs +6 -6
  40. package/dist/chunks/delete8.mjs +6 -6
  41. package/dist/chunks/delete9.mjs +6 -6
  42. package/dist/chunks/edit.mjs +6 -6
  43. package/dist/chunks/edit2.mjs +6 -6
  44. package/dist/chunks/edit3.mjs +6 -6
  45. package/dist/chunks/edit4.mjs +6 -6
  46. package/dist/chunks/edit5.mjs +6 -6
  47. package/dist/chunks/edit6.mjs +6 -6
  48. package/dist/chunks/edit7.mjs +6 -6
  49. package/dist/chunks/edit8.mjs +6 -6
  50. package/dist/chunks/history.mjs +8 -8
  51. package/dist/chunks/index.mjs +1 -1
  52. package/dist/chunks/index10.mjs +1 -1
  53. package/dist/chunks/index11.mjs +1 -1
  54. package/dist/chunks/index12.mjs +1 -1
  55. package/dist/chunks/index13.mjs +1 -1
  56. package/dist/chunks/index14.mjs +1 -1
  57. package/dist/chunks/index15.mjs +1 -1
  58. package/dist/chunks/index16.mjs +1 -1
  59. package/dist/chunks/index17.mjs +1 -1
  60. package/dist/chunks/index2.mjs +1 -1
  61. package/dist/chunks/index3.mjs +1 -1
  62. package/dist/chunks/index4.mjs +1 -1
  63. package/dist/chunks/index5.mjs +1 -1
  64. package/dist/chunks/index6.mjs +1 -1
  65. package/dist/chunks/index7.mjs +1 -1
  66. package/dist/chunks/index8.mjs +1 -1
  67. package/dist/chunks/index9.mjs +1 -1
  68. package/dist/chunks/list.mjs +8 -8
  69. package/dist/chunks/list10.mjs +8 -8
  70. package/dist/chunks/list11.mjs +8 -8
  71. package/dist/chunks/list12.mjs +8 -8
  72. package/dist/chunks/list13.mjs +8 -8
  73. package/dist/chunks/list14.mjs +8 -8
  74. package/dist/chunks/list15.mjs +8 -8
  75. package/dist/chunks/list2.mjs +10 -15
  76. package/dist/chunks/list3.mjs +8 -8
  77. package/dist/chunks/list4.mjs +8 -8
  78. package/dist/chunks/list5.mjs +8 -8
  79. package/dist/chunks/list6.mjs +8 -8
  80. package/dist/chunks/list7.mjs +8 -8
  81. package/dist/chunks/list8.mjs +8 -8
  82. package/dist/chunks/list9.mjs +8 -8
  83. package/dist/chunks/login.mjs +19 -8
  84. package/dist/chunks/logout.mjs +4 -4
  85. package/dist/chunks/me.mjs +8 -8
  86. package/dist/chunks/read-all.mjs +6 -6
  87. package/dist/chunks/read.mjs +6 -6
  88. package/dist/chunks/read2.mjs +6 -6
  89. package/dist/chunks/refresh.mjs +5 -5
  90. package/dist/chunks/remove-user.mjs +6 -6
  91. package/dist/chunks/remove.mjs +6 -6
  92. package/dist/chunks/reopen.mjs +6 -6
  93. package/dist/chunks/status.mjs +5 -5
  94. package/dist/chunks/status2.mjs +6 -6
  95. package/dist/chunks/status3.mjs +6 -6
  96. package/dist/chunks/switch.mjs +3 -3
  97. package/dist/chunks/tags.mjs +6 -6
  98. package/dist/chunks/token.mjs +4 -4
  99. package/dist/chunks/tree.mjs +6 -6
  100. package/dist/chunks/users.mjs +8 -8
  101. package/dist/chunks/view.mjs +8 -8
  102. package/dist/chunks/view2.mjs +8 -8
  103. package/dist/chunks/view3.mjs +9 -9
  104. package/dist/chunks/view4.mjs +8 -8
  105. package/dist/chunks/view5.mjs +8 -8
  106. package/dist/chunks/view6.mjs +8 -8
  107. package/dist/chunks/view7.mjs +8 -8
  108. package/dist/chunks/view8.mjs +8 -8
  109. package/dist/chunks/view9.mjs +8 -8
  110. package/dist/index.mjs +8 -7
  111. package/dist/shared/{bee.Bt1TK6yh.mjs → bee.B3N0WBdU.mjs} +46 -6
  112. package/dist/shared/{bee.BeQSH2t0.mjs → bee.BImw1HZl.mjs} +6 -3
  113. package/dist/shared/{bee.D6yQ6Pqf.mjs → bee.C4p7W8_P.mjs} +1 -1
  114. package/dist/shared/{bee.CCNmDHVv.mjs → bee.CirccSk2.mjs} +19 -1
  115. package/dist/shared/{bee.Ds2l-nTJ.mjs → bee.DFnSWb6q.mjs} +101 -13
  116. package/dist/shared/{bee.OJ0vqxJN.mjs → bee.DessOtkV.mjs} +10 -3
  117. package/dist/shared/{bee.DxRKWv6n.mjs → bee.DfqnFet4.mjs} +1 -1
  118. package/dist/shared/{bee.bmiIlr9W.mjs → bee.KteAW2rM.mjs} +12 -2
  119. package/dist/shared/{bee.IM3QELRf.mjs → bee.a05kNWpn.mjs} +1 -1
  120. package/dist/shared/{bee.BtxMsVL4.mjs → bee.x-FvgDW2.mjs} +3230 -674
  121. package/package.json +9 -9
@@ -1,45 +1,30 @@
1
1
  import consola from 'consola';
2
- import { A as ACTIVITY_LABELS } from '../shared/bee.CCNmDHVv.mjs';
2
+ import { A as ACTIVITY_LABELS, g as getActivitySummary } from '../shared/bee.CirccSk2.mjs';
3
3
  import { o as outputResult } from '../shared/bee.BTBGpv4K.mjs';
4
4
  import 'node:stream/consumers';
5
5
  import * as v from 'valibot';
6
6
  import { p as parseArg, v as vInteger } from '../shared/bee.BYqxm3yG.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.DessOtkV.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, a as ENV_PROJECT } from '../shared/bee.bmiIlr9W.mjs';
16
- import { p as project, e as collectNum, f as count, o as order, j as json, s as space, r as resolveOptions } from '../shared/bee.Bt1TK6yh.mjs';
17
- import '../shared/bee.Ds2l-nTJ.mjs';
14
+ import '../shared/bee.x-FvgDW2.mjs';
15
+ import { B as BeeCommand, E as ENV_AUTH, a as ENV_PROJECT } from '../shared/bee.KteAW2rM.mjs';
16
+ import { d as project, f as collectNum, g as count, o as order, j as json, s as space, r as resolveOptions } from '../shared/bee.B3N0WBdU.mjs';
17
+ import '../shared/bee.DFnSWb6q.mjs';
18
18
  import '../shared/bee.CktwmH8R.mjs';
19
- import '../shared/bee.DxRKWv6n.mjs';
19
+ import '../shared/bee.DfqnFet4.mjs';
20
+ import '../shared/bee.BImw1HZl.mjs';
20
21
  import 'node:module';
21
22
  import 'commander';
22
23
  import 'consola/utils';
23
24
  import 'node:fs';
24
25
  import 'node:path';
25
26
  import 'node:os';
26
- import '../shared/bee.BeQSH2t0.mjs';
27
27
 
28
- const getActivitySummary = (activity) => {
29
- if (activity.type === 34 && activity.content.deletedStatus?.name) {
30
- return activity.content.deletedStatus.name;
31
- }
32
- if (activity.content.summary) {
33
- return activity.content.summary;
34
- }
35
- if (activity.content.link && activity.content.link.length > 0) {
36
- return activity.content.link.map((item) => item.key_id ? `#${item.key_id}` : item.title ?? "").filter(Boolean).join(", ");
37
- }
38
- if (activity.content.key_id) {
39
- return `#${activity.content.key_id}`;
40
- }
41
- return "";
42
- };
43
28
  const activities = new BeeCommand("activities").summary("List project activities").description(
44
29
  `Results are ordered by most recent first. Use \`--activity-type\` to filter by type.
45
30
 
@@ -1,45 +1,30 @@
1
1
  import consola from 'consola';
2
- import { A as ACTIVITY_LABELS } from '../shared/bee.CCNmDHVv.mjs';
2
+ import { A as ACTIVITY_LABELS, g as getActivitySummary } from '../shared/bee.CirccSk2.mjs';
3
3
  import { o as outputResult } from '../shared/bee.BTBGpv4K.mjs';
4
4
  import 'node:stream/consumers';
5
5
  import * as v from 'valibot';
6
6
  import { p as parseArg, v as vInteger } from '../shared/bee.BYqxm3yG.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.DessOtkV.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';
16
- import { e as collectNum, f as count, o as order, z as minId, A as maxId, j as json, s as space } from '../shared/bee.Bt1TK6yh.mjs';
17
- import '../shared/bee.Ds2l-nTJ.mjs';
14
+ import '../shared/bee.x-FvgDW2.mjs';
15
+ import { B as BeeCommand, E as ENV_AUTH } from '../shared/bee.KteAW2rM.mjs';
16
+ import { f as collectNum, g as count, o as order, A as minId, B as maxId, j as json, s as space } from '../shared/bee.B3N0WBdU.mjs';
17
+ import '../shared/bee.DFnSWb6q.mjs';
18
18
  import '../shared/bee.CktwmH8R.mjs';
19
- import '../shared/bee.DxRKWv6n.mjs';
19
+ import '../shared/bee.DfqnFet4.mjs';
20
+ import '../shared/bee.BImw1HZl.mjs';
20
21
  import 'node:module';
21
22
  import 'commander';
22
23
  import 'consola/utils';
23
24
  import 'node:fs';
24
25
  import 'node:path';
25
26
  import 'node:os';
26
- import '../shared/bee.BeQSH2t0.mjs';
27
27
 
28
- const getActivitySummary = (activity) => {
29
- if (activity.type === 34 && activity.content.deletedStatus?.name) {
30
- return activity.content.deletedStatus.name;
31
- }
32
- if (activity.content.summary) {
33
- return activity.content.summary;
34
- }
35
- if (activity.content.link && activity.content.link.length > 0) {
36
- return activity.content.link.map((item) => item.key_id ? `#${item.key_id}` : item.title ?? "").filter(Boolean).join(", ");
37
- }
38
- if (activity.content.key_id) {
39
- return `#${activity.content.key_id}`;
40
- }
41
- return "";
42
- };
43
28
  const activities = new BeeCommand("activities").summary("List user activities").description(
44
29
  `Results are ordered by most recent first. Use \`--activity-type\` to filter by type.
45
30
 
@@ -1,45 +1,30 @@
1
1
  import consola from 'consola';
2
- import { A as ACTIVITY_LABELS } from '../shared/bee.CCNmDHVv.mjs';
2
+ import { A as ACTIVITY_LABELS, g as getActivitySummary } from '../shared/bee.CirccSk2.mjs';
3
3
  import { o as outputResult } from '../shared/bee.BTBGpv4K.mjs';
4
4
  import 'node:stream/consumers';
5
5
  import * as v from 'valibot';
6
6
  import { p as parseArg, v as vInteger } from '../shared/bee.BYqxm3yG.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.DessOtkV.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';
16
- import { e as collectNum, f as count, o as order, z as minId, A as maxId, j as json, s as space } from '../shared/bee.Bt1TK6yh.mjs';
17
- import '../shared/bee.Ds2l-nTJ.mjs';
14
+ import '../shared/bee.x-FvgDW2.mjs';
15
+ import { B as BeeCommand, E as ENV_AUTH } from '../shared/bee.KteAW2rM.mjs';
16
+ import { f as collectNum, g as count, o as order, A as minId, B as maxId, j as json, s as space } from '../shared/bee.B3N0WBdU.mjs';
17
+ import '../shared/bee.DFnSWb6q.mjs';
18
18
  import '../shared/bee.CktwmH8R.mjs';
19
- import '../shared/bee.DxRKWv6n.mjs';
19
+ import '../shared/bee.DfqnFet4.mjs';
20
+ import '../shared/bee.BImw1HZl.mjs';
20
21
  import 'node:module';
21
22
  import 'commander';
22
23
  import 'consola/utils';
23
24
  import 'node:fs';
24
25
  import 'node:path';
25
26
  import 'node:os';
26
- import '../shared/bee.BeQSH2t0.mjs';
27
27
 
28
- const getActivitySummary = (activity) => {
29
- if (activity.type === 34 && activity.content.deletedStatus?.name) {
30
- return activity.content.deletedStatus.name;
31
- }
32
- if (activity.content.summary) {
33
- return activity.content.summary;
34
- }
35
- if (activity.content.link && activity.content.link.length > 0) {
36
- return activity.content.link.map((item) => item.key_id ? `#${item.key_id}` : item.title ?? "").filter(Boolean).join(", ");
37
- }
38
- if (activity.content.key_id) {
39
- return `#${activity.content.key_id}`;
40
- }
41
- return "";
42
- };
43
28
  const activities = new BeeCommand("activities").summary("List space activities").description(
44
29
  `Results are ordered by most recent first. Use \`--activity-type\` to filter by type.
45
30
 
@@ -3,23 +3,23 @@ import { o as outputResult } from '../shared/bee.BTBGpv4K.mjs';
3
3
  import 'node:stream/consumers';
4
4
  import 'valibot';
5
5
  import { p as parseArg, v as vInteger } from '../shared/bee.BYqxm3yG.mjs';
6
- import { g as getClient } from '../shared/bee.OJ0vqxJN.mjs';
6
+ import { g as getClient } from '../shared/bee.DessOtkV.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, R as RequiredOption, j as json, s as space, r as resolveOptions } from '../shared/bee.Bt1TK6yh.mjs';
11
+ import '../shared/bee.x-FvgDW2.mjs';
12
+ import { B as BeeCommand, E as ENV_AUTH, a as ENV_PROJECT } from '../shared/bee.KteAW2rM.mjs';
13
+ import { d as project, R as RequiredOption, j as json, s as space, r as resolveOptions } from '../shared/bee.B3N0WBdU.mjs';
14
14
  import '../shared/bee.CktwmH8R.mjs';
15
- import '../shared/bee.DxRKWv6n.mjs';
15
+ import '../shared/bee.DfqnFet4.mjs';
16
+ import '../shared/bee.BImw1HZl.mjs';
16
17
  import 'node:module';
17
18
  import 'commander';
18
19
  import 'consola/utils';
19
20
  import 'node:fs';
20
21
  import 'node:path';
21
22
  import 'node:os';
22
- import '../shared/bee.BeQSH2t0.mjs';
23
23
 
24
24
  const addUser = new BeeCommand("add-user").summary("Add a user to a project").description(`Use \`bee project users\` to look up user IDs.`).addOption(project()).addOption(new RequiredOption("--user-id <id>", "User ID")).addOption(json()).addOption(space()).envVars([...ENV_AUTH, ENV_PROJECT]).examples([
25
25
  {
@@ -2,23 +2,23 @@ import consola from 'consola';
2
2
  import { U as UserError, p as parseArg, v as vInteger } from '../shared/bee.BYqxm3yG.mjs';
3
3
  import 'node:stream/consumers';
4
4
  import 'valibot';
5
- import { g as getClient } from '../shared/bee.OJ0vqxJN.mjs';
5
+ import { g as getClient } from '../shared/bee.DessOtkV.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';
11
- import { B as BeeCommand, E as ENV_AUTH } from '../shared/bee.bmiIlr9W.mjs';
12
- import { C as issue, s as space } from '../shared/bee.Bt1TK6yh.mjs';
10
+ import '../shared/bee.x-FvgDW2.mjs';
11
+ import { B as BeeCommand, E as ENV_AUTH } from '../shared/bee.KteAW2rM.mjs';
12
+ import { D as issue, s as space } from '../shared/bee.B3N0WBdU.mjs';
13
13
  import '../shared/bee.CktwmH8R.mjs';
14
- import '../shared/bee.DxRKWv6n.mjs';
14
+ import '../shared/bee.DfqnFet4.mjs';
15
+ import '../shared/bee.BImw1HZl.mjs';
15
16
  import 'node:module';
16
17
  import 'commander';
17
18
  import 'consola/utils';
18
19
  import 'node:fs';
19
20
  import 'node:path';
20
21
  import 'node:os';
21
- import '../shared/bee.BeQSH2t0.mjs';
22
22
 
23
23
  const add = new BeeCommand("add").summary("Add a star").description(
24
24
  `Specify exactly one target: \`--issue\` (accepts key or ID), \`--comment\`, \`--wiki\`, or \`--pr-comment\`.`
@@ -3,23 +3,23 @@ import { o as outputResult } from '../shared/bee.BTBGpv4K.mjs';
3
3
  import 'node:stream/consumers';
4
4
  import 'valibot';
5
5
  import '../shared/bee.BYqxm3yG.mjs';
6
- import { g as getClient } from '../shared/bee.OJ0vqxJN.mjs';
6
+ import { g as getClient } from '../shared/bee.DessOtkV.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';
11
+ import '../shared/bee.x-FvgDW2.mjs';
12
+ import { B as BeeCommand, E as ENV_AUTH } from '../shared/bee.KteAW2rM.mjs';
13
+ import { j as json, s as space } from '../shared/bee.B3N0WBdU.mjs';
14
14
  import '../shared/bee.CktwmH8R.mjs';
15
- import '../shared/bee.DxRKWv6n.mjs';
15
+ import '../shared/bee.DfqnFet4.mjs';
16
+ import '../shared/bee.BImw1HZl.mjs';
16
17
  import 'node:module';
17
18
  import 'commander';
18
19
  import 'consola/utils';
19
20
  import 'node:fs';
20
21
  import 'node:path';
21
22
  import 'node:os';
22
- import '../shared/bee.BeQSH2t0.mjs';
23
23
 
24
24
  const add = new BeeCommand("add").summary("Add a watching item").description(`Subscribe to an issue to receive update notifications.`).requiredOption("--issue <key>", "Issue ID or issue key").option("--note <text>", "Note to attach to the watching item").addOption(json()).addOption(space()).envVars([...ENV_AUTH]).examples([
25
25
  { description: "Watch an issue", command: "bee watching add --issue PROJECT-123" },
@@ -1,35 +1,38 @@
1
+ import { readFile } from 'node:fs/promises';
2
+ import { text } from 'node:stream/consumers';
1
3
  import 'consola';
2
4
  import { o as outputResult } from '../shared/bee.BTBGpv4K.mjs';
3
5
  import { U as UserError, a as vFiniteNumber } from '../shared/bee.BYqxm3yG.mjs';
4
- import 'node:stream/consumers';
5
6
  import * as v from 'valibot';
6
- import { g as getClient } from '../shared/bee.OJ0vqxJN.mjs';
7
+ import { g as getClient } from '../shared/bee.DessOtkV.mjs';
7
8
  import 'backlog-js';
8
9
  import 'node:http';
9
10
  import 'open';
10
11
  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 { c as collect, s as space } from '../shared/bee.Bt1TK6yh.mjs';
12
+ import '../shared/bee.x-FvgDW2.mjs';
13
+ import { B as BeeCommand, E as ENV_AUTH } from '../shared/bee.KteAW2rM.mjs';
14
+ import { c as collect, s as space } from '../shared/bee.B3N0WBdU.mjs';
14
15
  import '../shared/bee.CktwmH8R.mjs';
15
- import '../shared/bee.DxRKWv6n.mjs';
16
+ import '../shared/bee.DfqnFet4.mjs';
17
+ import '../shared/bee.BImw1HZl.mjs';
16
18
  import 'node:module';
17
19
  import 'commander';
18
20
  import 'consola/utils';
19
21
  import 'node:fs';
20
22
  import 'node:path';
21
23
  import 'node:os';
22
- import '../shared/bee.BeQSH2t0.mjs';
23
24
 
24
25
  const api = new BeeCommand("api").summary("Make an authenticated API request").description(
25
26
  `The endpoint is a Backlog API path (e.g. \`users/myself\`). A leading \`/api/v2/\` prefix is stripped automatically.
26
27
 
27
- \`-f\` infers types (number, boolean, string); \`-F\` always sends strings. Repeated keys become arrays. Append \`[]\` for a single-element array (e.g. \`-f projectId[]=12345\`).
28
+ \`-f\` infers types (number, boolean, string); \`-F\` always sends strings. A value is only inferred as a number when the number prints back identically, so \`1.0\`, \`0042\` and \`0x10\` stay strings. Repeated keys become arrays. Append \`[]\` for a single-element array (e.g. \`-f projectId[]=12345\`).
29
+
30
+ If a \`-f\` value starts with \`@\`, the rest of the value is interpreted as a filename to read the value from. Pass \`-\` to read from standard input (e.g. \`-f 'key=@-'\`). File and stdin content is always sent as a string, without type inference.
28
31
 
29
32
  For GET, fields are query parameters. For POST/PUT/PATCH/DELETE, fields are the request body.`
30
33
  ).argument("<endpoint>", "API endpoint path").option("-X, --method <method>", "HTTP method", "GET").option(
31
34
  "-f, --field <key=value>",
32
- "Add a parameter with type inference (key=value, repeatable)",
35
+ 'Add a typed parameter (use "@<path>" or "@-" to read value from file or stdin)',
33
36
  collect,
34
37
  []
35
38
  ).option(
@@ -51,6 +54,14 @@ For GET, fields are query parameters. For POST/PUT/PATCH/DELETE, fields are the
51
54
  description: "Create an issue",
52
55
  command: 'bee api issues -X POST -f projectId=12345 -f summary="Test issue" -f issueTypeId=1 -f priorityId=3'
53
56
  },
57
+ {
58
+ description: "Set a field value from a file",
59
+ command: "bee api issues/PROJECT-1 -X PATCH -f 'description=@desc.md'"
60
+ },
61
+ {
62
+ description: "Pipe content from stdin",
63
+ command: "echo 'Hello' | bee api issues/PROJECT-1/comments -X POST -f 'content=@-'"
64
+ },
54
65
  {
55
66
  description: "Select specific fields",
56
67
  command: "bee api users/myself --json id,name,mailAddress"
@@ -59,7 +70,7 @@ For GET, fields are query parameters. For POST/PUT/PATCH/DELETE, fields are the
59
70
  const { client } = await getClient(opts.space);
60
71
  const method = opts.method.toUpperCase();
61
72
  const normalizedEndpoint = normalizeEndpoint(endpoint);
62
- const params = buildParams(opts.field, opts.rawField);
73
+ const params = await buildParams(opts.field, opts.rawField);
63
74
  const data = await makeRequest(client, method, normalizedEndpoint, params);
64
75
  if (opts.silent) {
65
76
  return;
@@ -72,7 +83,29 @@ const normalizeEndpoint = (endpoint) => {
72
83
  const stripped = endpoint.replace(/^\/?(api\/v2\/?)/, "");
73
84
  return stripped;
74
85
  };
75
- const buildParams = (fields, rawFields) => {
86
+ const readFieldValue = async (ref) => {
87
+ if (ref === "-") {
88
+ return text(process.stdin);
89
+ }
90
+ if (ref === "") {
91
+ throw new UserError(
92
+ 'Invalid file reference: "@". Provide a file path after @ or use @- for stdin.'
93
+ );
94
+ }
95
+ try {
96
+ return await readFile(ref, "utf8");
97
+ } catch (error) {
98
+ const { code } = error;
99
+ if (code === "ENOENT") {
100
+ throw new UserError(`File not found: ${ref}`);
101
+ }
102
+ if (code === "EISDIR") {
103
+ throw new UserError(`Expected a file but got a directory: ${ref}`);
104
+ }
105
+ throw error;
106
+ }
107
+ };
108
+ const buildParams = async (fields, rawFields) => {
76
109
  const params = {};
77
110
  const addParam = (rawKey, value) => {
78
111
  const isArray = rawKey.endsWith("[]");
@@ -89,7 +122,9 @@ const buildParams = (fields, rawFields) => {
89
122
  if (eqIndex === -1) {
90
123
  throw new UserError(`Invalid field format: "${pair}". Expected key=value.`);
91
124
  }
92
- addParam(pair.slice(0, eqIndex), inferType(pair.slice(eqIndex + 1)));
125
+ const rawValue = pair.slice(eqIndex + 1);
126
+ const value = rawValue.startsWith("@") ? await readFieldValue(rawValue.slice(1)) : inferType(rawValue);
127
+ addParam(pair.slice(0, eqIndex), value);
93
128
  }
94
129
  for (const pair of rawFields) {
95
130
  const eqIndex = pair.indexOf("=");
@@ -109,7 +144,7 @@ const inferType = (value) => {
109
144
  }
110
145
  if (value !== "") {
111
146
  const result = v.safeParse(vFiniteNumber, value);
112
- if (result.success) {
147
+ if (result.success && String(result.output) === value) {
113
148
  return result.output;
114
149
  }
115
150
  }
@@ -4,25 +4,25 @@ import 'node:stream/consumers';
4
4
  import 'valibot';
5
5
  import '../shared/bee.BYqxm3yG.mjs';
6
6
  import { a as formatSize, 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.DessOtkV.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 } from '../shared/bee.bmiIlr9W.mjs';
15
- import { j as json, s as space } from '../shared/bee.Bt1TK6yh.mjs';
16
- import '../shared/bee.Ds2l-nTJ.mjs';
13
+ import '../shared/bee.x-FvgDW2.mjs';
14
+ import { B as BeeCommand, E as ENV_AUTH } from '../shared/bee.KteAW2rM.mjs';
15
+ import { j as json, s as space } from '../shared/bee.B3N0WBdU.mjs';
16
+ import '../shared/bee.DFnSWb6q.mjs';
17
17
  import '../shared/bee.CktwmH8R.mjs';
18
- import '../shared/bee.DxRKWv6n.mjs';
18
+ import '../shared/bee.DfqnFet4.mjs';
19
+ import '../shared/bee.BImw1HZl.mjs';
19
20
  import 'node:module';
20
21
  import 'commander';
21
22
  import 'consola/utils';
22
23
  import 'node:fs';
23
24
  import 'node:path';
24
25
  import 'node:os';
25
- import '../shared/bee.BeQSH2t0.mjs';
26
26
 
27
27
  const attachments = new BeeCommand("attachments").summary("List issue attachments").description(`Shows file name, size, creator, and creation date.`).argument("<issue>", "Issue ID or issue key").addOption(json()).addOption(space()).envVars([...ENV_AUTH]).examples([
28
28
  { description: "List attachments", command: "bee issue attachments PROJECT-123" },
@@ -4,25 +4,25 @@ import 'node:stream/consumers';
4
4
  import 'valibot';
5
5
  import '../shared/bee.BYqxm3yG.mjs';
6
6
  import { a as formatSize, 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.DessOtkV.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 } from '../shared/bee.bmiIlr9W.mjs';
15
- import { j as json, s as space } from '../shared/bee.Bt1TK6yh.mjs';
16
- import '../shared/bee.Ds2l-nTJ.mjs';
13
+ import '../shared/bee.x-FvgDW2.mjs';
14
+ import { B as BeeCommand, E as ENV_AUTH } from '../shared/bee.KteAW2rM.mjs';
15
+ import { j as json, s as space } from '../shared/bee.B3N0WBdU.mjs';
16
+ import '../shared/bee.DFnSWb6q.mjs';
17
17
  import '../shared/bee.CktwmH8R.mjs';
18
- import '../shared/bee.DxRKWv6n.mjs';
18
+ import '../shared/bee.DfqnFet4.mjs';
19
+ import '../shared/bee.BImw1HZl.mjs';
19
20
  import 'node:module';
20
21
  import 'commander';
21
22
  import 'consola/utils';
22
23
  import 'node:fs';
23
24
  import 'node:path';
24
25
  import 'node:os';
25
- import '../shared/bee.BeQSH2t0.mjs';
26
26
 
27
27
  const attachments = new BeeCommand("attachments").summary("List document attachments").description(`Shows file name, size, creator, and creation date.`).argument("<document>", "Document ID").addOption(json()).addOption(space()).envVars([...ENV_AUTH]).examples([
28
28
  { description: "List attachments", command: "bee document attachments 12345" },
@@ -4,25 +4,25 @@ import 'node:stream/consumers';
4
4
  import 'valibot';
5
5
  import { p as parseArg, v as vInteger } from '../shared/bee.BYqxm3yG.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.DessOtkV.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 } from '../shared/bee.bmiIlr9W.mjs';
15
- import { j as json, s as space } from '../shared/bee.Bt1TK6yh.mjs';
16
- import '../shared/bee.Ds2l-nTJ.mjs';
13
+ import '../shared/bee.x-FvgDW2.mjs';
14
+ import { B as BeeCommand, E as ENV_AUTH } from '../shared/bee.KteAW2rM.mjs';
15
+ import { j as json, s as space } from '../shared/bee.B3N0WBdU.mjs';
16
+ import '../shared/bee.DFnSWb6q.mjs';
17
17
  import '../shared/bee.CktwmH8R.mjs';
18
- import '../shared/bee.DxRKWv6n.mjs';
18
+ import '../shared/bee.DfqnFet4.mjs';
19
+ import '../shared/bee.BImw1HZl.mjs';
19
20
  import 'node:module';
20
21
  import 'commander';
21
22
  import 'consola/utils';
22
23
  import 'node:fs';
23
24
  import 'node:path';
24
25
  import 'node:os';
25
- import '../shared/bee.BeQSH2t0.mjs';
26
26
 
27
27
  const attachments = new BeeCommand("attachments").summary("List wiki page attachments").description(`Shows file name, size, creator, and creation date.`).argument("<wiki>", "Wiki page ID").addOption(json()).addOption(space()).envVars([...ENV_AUTH]).examples([
28
28
  { description: "List wiki attachments", command: "bee wiki attachments 12345" },
@@ -2,20 +2,20 @@ import consola from 'consola';
2
2
  import { p as parseArg, v as vInteger, U as UserError } from '../shared/bee.BYqxm3yG.mjs';
3
3
  import 'node:stream/consumers';
4
4
  import 'valibot';
5
- import { g as getClient } from '../shared/bee.OJ0vqxJN.mjs';
5
+ import { g as getClient } from '../shared/bee.DessOtkV.mjs';
6
6
  import 'backlog-js';
7
7
  import 'node:http';
8
8
  import { i as issueUrl, b as buildBacklogUrl, p as projectUrl, r as repositoryUrl, d as dashboardUrl, g as gitCommitUrl, a as gitTreeUrl, c as gitBlobUrl, o as openOrPrintUrl } from '../shared/bee.CzKcWSES.mjs';
9
9
  import { execFile } from 'node:child_process';
10
- import '../shared/bee.BtxMsVL4.mjs';
11
- import { B as BeeCommand, E as ENV_AUTH, a as ENV_PROJECT } from '../shared/bee.bmiIlr9W.mjs';
12
- import { p as project, n as noBrowser, s as space } from '../shared/bee.Bt1TK6yh.mjs';
10
+ import '../shared/bee.x-FvgDW2.mjs';
11
+ import { B as BeeCommand, E as ENV_AUTH, a as ENV_PROJECT } from '../shared/bee.KteAW2rM.mjs';
12
+ import { p as projectOptional, n as noBrowser, s as space } from '../shared/bee.B3N0WBdU.mjs';
13
13
  import 'node:fs';
14
14
  import 'node:path';
15
15
  import 'node:os';
16
- import '../shared/bee.BeQSH2t0.mjs';
16
+ import '../shared/bee.BImw1HZl.mjs';
17
17
  import '../shared/bee.CktwmH8R.mjs';
18
- import '../shared/bee.DxRKWv6n.mjs';
18
+ import '../shared/bee.DfqnFet4.mjs';
19
19
  import 'open';
20
20
  import 'node:module';
21
21
  import 'commander';
@@ -233,7 +233,7 @@ const browse = new BeeCommand("browse").summary("Open a Backlog page in the brow
233
233
  `With no arguments, opens the repository page (inside a Backlog repo) or the dashboard.
234
234
 
235
235
  Accepts an issue key (\`PROJECT-123\`), bare number (\`123\`, project inferred from Git remote), file path (\`src/main.ts\`), or path with line (\`src/main.ts:42\`). Paths ending with \`/\` open the directory tree. Use \`--project\` with section flags (e.g. \`--issues\`, \`--board\`) for project pages.`
236
- ).argument("[target]", "Issue key, issue number, file path, or project key").addOption(project().makeOptionMandatory(false).default(void 0)).option("-b, --branch <name>", "View file at a specific branch").option("-c, --commit", "View file at the latest commit").addOption(noBrowser()).option("--issues", "Open the issues page").option("--board", "Open the board page").option("--gantt", "Open the Gantt chart page").option("--wiki", "Open the wiki page").option("--documents", "Open the documents page").option("--files", "Open the shared files page").option("--git", "Open the git repositories page").option("--svn", "Open the Subversion page").option("--settings", "Open the project settings page").addOption(space()).envVars([...ENV_AUTH, ENV_PROJECT]).examples([
236
+ ).argument("[target]", "Issue key, issue number, file path, or project key").addOption(projectOptional()).option("-b, --branch <name>", "View file at a specific branch").option("-c, --commit", "View file at the latest commit").addOption(noBrowser()).option("--issues", "Open the issues page").option("--board", "Open the board page").option("--gantt", "Open the Gantt chart page").option("--wiki", "Open the wiki page").option("--documents", "Open the documents page").option("--files", "Open the shared files page").option("--git", "Open the git repositories page").option("--svn", "Open the Subversion page").option("--settings", "Open the project settings page").addOption(space()).envVars([...ENV_AUTH, ENV_PROJECT]).examples([
237
237
  { description: "Open repository page (in a Backlog repo)", command: "bee browse" },
238
238
  { description: "Open dashboard (outside a Backlog repo)", command: "bee browse" },
239
239
  { description: "Open an issue", command: "bee browse PROJECT-123" },
@@ -4,22 +4,22 @@ import { o as outputResult } from '../shared/bee.BTBGpv4K.mjs';
4
4
  import 'node:stream/consumers';
5
5
  import 'valibot';
6
6
  import '../shared/bee.BYqxm3yG.mjs';
7
- import { g as getClient } from '../shared/bee.OJ0vqxJN.mjs';
7
+ import { g as getClient } from '../shared/bee.DessOtkV.mjs';
8
8
  import 'backlog-js';
9
9
  import 'node:http';
10
10
  import 'open';
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';
11
+ import '../shared/bee.x-FvgDW2.mjs';
12
+ import { B as BeeCommand, E as ENV_AUTH, a as ENV_PROJECT } from '../shared/bee.KteAW2rM.mjs';
13
+ import { d as project, j as json, s as space, r as resolveOptions } from '../shared/bee.B3N0WBdU.mjs';
14
14
  import '../shared/bee.CktwmH8R.mjs';
15
- import '../shared/bee.DxRKWv6n.mjs';
15
+ import '../shared/bee.DfqnFet4.mjs';
16
+ import '../shared/bee.BImw1HZl.mjs';
16
17
  import 'node:module';
17
18
  import 'commander';
18
19
  import 'consola/utils';
19
20
  import 'node:fs';
20
21
  import 'node:path';
21
22
  import 'node:os';
22
- import '../shared/bee.BeQSH2t0.mjs';
23
23
 
24
24
  const gitClone = (gitArgs) => new Promise((resolve, reject) => {
25
25
  const child = spawn("git", gitArgs, { stdio: "inherit" });
@@ -4,23 +4,23 @@ import { o as outputResult } from '../shared/bee.BTBGpv4K.mjs';
4
4
  import 'node:stream/consumers';
5
5
  import 'valibot';
6
6
  import { p as parseArg, v as vInteger } from '../shared/bee.BYqxm3yG.mjs';
7
- import { g as getClient } from '../shared/bee.OJ0vqxJN.mjs';
7
+ import { g as getClient } from '../shared/bee.DessOtkV.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';
12
+ import '../shared/bee.x-FvgDW2.mjs';
13
+ import { B as BeeCommand, E as ENV_AUTH } from '../shared/bee.KteAW2rM.mjs';
14
+ import { x as notify, j as json, s as space } from '../shared/bee.B3N0WBdU.mjs';
15
15
  import '../shared/bee.CktwmH8R.mjs';
16
- import '../shared/bee.DxRKWv6n.mjs';
16
+ import '../shared/bee.DfqnFet4.mjs';
17
+ import '../shared/bee.BImw1HZl.mjs';
17
18
  import 'node:module';
18
19
  import 'commander';
19
20
  import 'consola/utils';
20
21
  import 'node:fs';
21
22
  import 'node:path';
22
23
  import 'node:os';
23
- import '../shared/bee.BeQSH2t0.mjs';
24
24
 
25
25
  const close = new BeeCommand("close").summary("Close an issue").description(
26
26
  `Sets the status to Closed with resolution \`Fixed\` by default. Use \`--resolution\` for a different resolution.`
@@ -1,27 +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.B3N0WBdU.mjs';
4
4
  import { a as resolveStdinArg } from '../shared/bee.C--ZWPxf.mjs';
5
5
  import 'valibot';
6
6
  import '../shared/bee.BYqxm3yG.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.DessOtkV.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 '../shared/bee.x-FvgDW2.mjs';
15
+ import { B as BeeCommand, E as ENV_AUTH } from '../shared/bee.KteAW2rM.mjs';
16
16
  import 'node:fs';
17
17
  import 'node:path';
18
18
  import 'node:os';
19
19
  import 'node:stream/consumers';
20
- import '../shared/bee.BeQSH2t0.mjs';
20
+ import '../shared/bee.BImw1HZl.mjs';
21
21
  import 'commander';
22
- import '../shared/bee.Ds2l-nTJ.mjs';
22
+ import '../shared/bee.DFnSWb6q.mjs';
23
23
  import '../shared/bee.CktwmH8R.mjs';
24
- import '../shared/bee.DxRKWv6n.mjs';
24
+ import '../shared/bee.DfqnFet4.mjs';
25
25
  import 'node:module';
26
26
  import 'consola/utils';
27
27