@nulab/bee 1.0.0-rc.1 → 1.0.0-rc.3

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 (123) hide show
  1. package/LICENSE +21 -0
  2. package/dist/chunks/activities.mjs +24 -22
  3. package/dist/chunks/activities2.mjs +19 -18
  4. package/dist/chunks/activities3.mjs +18 -17
  5. package/dist/chunks/add-user.mjs +13 -15
  6. package/dist/chunks/add.mjs +18 -15
  7. package/dist/chunks/add2.mjs +12 -11
  8. package/dist/chunks/api.mjs +17 -14
  9. package/dist/chunks/attachments.mjs +14 -13
  10. package/dist/chunks/attachments2.mjs +14 -13
  11. package/dist/chunks/attachments3.mjs +15 -14
  12. package/dist/chunks/browse.mjs +12 -11
  13. package/dist/chunks/clone.mjs +12 -11
  14. package/dist/chunks/close.mjs +13 -12
  15. package/dist/chunks/comment.mjs +18 -15
  16. package/dist/chunks/comment2.mjs +15 -14
  17. package/dist/chunks/comments.mjs +17 -16
  18. package/dist/chunks/completion.mjs +2 -2
  19. package/dist/chunks/count.mjs +10 -9
  20. package/dist/chunks/count2.mjs +12 -11
  21. package/dist/chunks/count3.mjs +13 -12
  22. package/dist/chunks/count4.mjs +18 -16
  23. package/dist/chunks/count5.mjs +13 -12
  24. package/dist/chunks/create.mjs +12 -11
  25. package/dist/chunks/create2.mjs +21 -14
  26. package/dist/chunks/create3.mjs +13 -12
  27. package/dist/chunks/create4.mjs +17 -15
  28. package/dist/chunks/create5.mjs +13 -12
  29. package/dist/chunks/create6.mjs +12 -11
  30. package/dist/chunks/create7.mjs +12 -11
  31. package/dist/chunks/create8.mjs +12 -11
  32. package/dist/chunks/create9.mjs +12 -11
  33. package/dist/chunks/dashboard.mjs +15 -14
  34. package/dist/chunks/delete.mjs +18 -16
  35. package/dist/chunks/delete2.mjs +12 -11
  36. package/dist/chunks/delete3.mjs +12 -11
  37. package/dist/chunks/delete4.mjs +16 -12
  38. package/dist/chunks/delete5.mjs +16 -12
  39. package/dist/chunks/delete6.mjs +16 -12
  40. package/dist/chunks/delete7.mjs +23 -14
  41. package/dist/chunks/delete8.mjs +14 -13
  42. package/dist/chunks/delete9.mjs +13 -12
  43. package/dist/chunks/edit.mjs +19 -17
  44. package/dist/chunks/edit2.mjs +26 -19
  45. package/dist/chunks/edit3.mjs +18 -16
  46. package/dist/chunks/edit4.mjs +13 -12
  47. package/dist/chunks/edit5.mjs +18 -11
  48. package/dist/chunks/edit6.mjs +23 -18
  49. package/dist/chunks/edit7.mjs +20 -15
  50. package/dist/chunks/edit8.mjs +20 -15
  51. package/dist/chunks/history.mjs +19 -18
  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 +14 -13
  70. package/dist/chunks/list10.mjs +20 -18
  71. package/dist/chunks/list11.mjs +20 -18
  72. package/dist/chunks/list12.mjs +20 -18
  73. package/dist/chunks/list13.mjs +20 -18
  74. package/dist/chunks/list14.mjs +15 -14
  75. package/dist/chunks/list15.mjs +14 -13
  76. package/dist/chunks/list2.mjs +32 -17
  77. package/dist/chunks/list3.mjs +22 -21
  78. package/dist/chunks/list4.mjs +18 -17
  79. package/dist/chunks/list5.mjs +18 -17
  80. package/dist/chunks/list6.mjs +20 -18
  81. package/dist/chunks/list7.mjs +17 -16
  82. package/dist/chunks/list8.mjs +14 -13
  83. package/dist/chunks/list9.mjs +21 -19
  84. package/dist/chunks/login.mjs +31 -28
  85. package/dist/chunks/logout.mjs +21 -6
  86. package/dist/chunks/me.mjs +15 -14
  87. package/dist/chunks/read-all.mjs +11 -10
  88. package/dist/chunks/read.mjs +12 -11
  89. package/dist/chunks/read2.mjs +12 -11
  90. package/dist/chunks/refresh.mjs +6 -5
  91. package/dist/chunks/remove-user.mjs +13 -15
  92. package/dist/chunks/remove.mjs +12 -11
  93. package/dist/chunks/reopen.mjs +12 -11
  94. package/dist/chunks/status.mjs +4 -5
  95. package/dist/chunks/status2.mjs +12 -11
  96. package/dist/chunks/status3.mjs +12 -11
  97. package/dist/chunks/switch.mjs +3 -4
  98. package/dist/chunks/tags.mjs +18 -16
  99. package/dist/chunks/token.mjs +4 -5
  100. package/dist/chunks/tree.mjs +18 -16
  101. package/dist/chunks/users.mjs +20 -18
  102. package/dist/chunks/view.mjs +23 -21
  103. package/dist/chunks/view2.mjs +15 -14
  104. package/dist/chunks/view3.mjs +15 -14
  105. package/dist/chunks/view4.mjs +16 -15
  106. package/dist/chunks/view5.mjs +15 -14
  107. package/dist/chunks/view6.mjs +15 -14
  108. package/dist/chunks/view7.mjs +16 -15
  109. package/dist/chunks/view8.mjs +17 -16
  110. package/dist/chunks/view9.mjs +15 -14
  111. package/dist/index.mjs +62 -4
  112. package/dist/shared/bee.BYqxm3yG.mjs +24 -0
  113. package/dist/shared/{bee.DVTuFf-T.mjs → bee.Bt1TK6yh.mjs} +55 -5
  114. package/dist/shared/bee.BtxMsVL4.mjs +35104 -0
  115. package/dist/shared/{bee.-8tk76YJ.mjs → bee.DxRKWv6n.mjs} +9 -2
  116. package/dist/shared/bee.G4d7izLe.mjs +14 -0
  117. package/dist/shared/{bee.CThuQMit.mjs → bee.OJ0vqxJN.mjs} +6 -5
  118. package/dist/shared/{bee.sHWg0IFT.mjs → bee.PF8hrVKn.mjs} +8 -3
  119. package/dist/shared/{bee.CQ3kBgas.mjs → bee.bmiIlr9W.mjs} +5 -0
  120. package/package.json +15 -16
  121. package/dist/shared/bee.ChBdZ0cH.mjs +0 -9
  122. package/dist/shared/bee.DHTPkjMh.mjs +0 -48
  123. package/dist/shared/bee.XxOB1Her.mjs +0 -8
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Nulab Inc.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -1,28 +1,29 @@
1
1
  import consola from 'consola';
2
2
  import { A as ACTIVITY_LABELS } from '../shared/bee.CCNmDHVv.mjs';
3
- import { g as getClient } from '../shared/bee.CThuQMit.mjs';
4
- import 'backlog-js';
5
- import 'node:http';
6
- import 'open';
7
- import 'node:child_process';
8
3
  import { o as outputResult } from '../shared/bee.BTBGpv4K.mjs';
9
4
  import 'node:stream/consumers';
10
- import 'valibot';
5
+ import * as v from 'valibot';
6
+ import { p as parseArg, v as vInteger } from '../shared/bee.BYqxm3yG.mjs';
11
7
  import { f as formatDate } from '../shared/bee.n5MYN4a6.mjs';
12
8
  import { p as printTable } from '../shared/bee.IM3QELRf.mjs';
13
- import { B as BeeCommand, E as ENV_AUTH, a as ENV_PROJECT } from '../shared/bee.CQ3kBgas.mjs';
14
- import { a as collectNum, b as count, o as order, j as json, s as space } from '../shared/bee.DHTPkjMh.mjs';
15
- import '../shared/bee.XxOB1Her.mjs';
9
+ import { g as getClient } from '../shared/bee.OJ0vqxJN.mjs';
10
+ import 'backlog-js';
11
+ import 'node:http';
12
+ import 'open';
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';
16
18
  import '../shared/bee.CktwmH8R.mjs';
17
- import '../shared/bee.DVTuFf-T.mjs';
19
+ import '../shared/bee.DxRKWv6n.mjs';
20
+ import 'node:module';
21
+ import 'commander';
22
+ import 'consola/utils';
18
23
  import 'node:fs';
19
24
  import 'node:path';
20
25
  import 'node:os';
21
26
  import '../shared/bee.BeQSH2t0.mjs';
22
- import '../shared/bee.-8tk76YJ.mjs';
23
- import '../shared/bee.Ds2l-nTJ.mjs';
24
- import 'commander';
25
- import 'consola/utils';
26
27
 
27
28
  const getActivitySummary = (activity) => {
28
29
  if (activity.type === 34 && activity.content.deletedStatus?.name) {
@@ -44,31 +45,32 @@ const activities = new BeeCommand("activities").summary("List project activities
44
45
 
45
46
  For activity type IDs, see:
46
47
  https://developer.nulab.com/docs/backlog/api/2/get-project-recent-updates/#response-description`
47
- ).argument("<project>", "Project ID or project key").option(
48
+ ).addOption(project()).option(
48
49
  "--activity-type <id>",
49
50
  "Filter by activity type IDs (repeatable)",
50
51
  collectNum,
51
52
  []
52
53
  ).addOption(count()).addOption(order()).addOption(json()).addOption(space()).envVars([...ENV_AUTH, ENV_PROJECT]).examples([
53
- { description: "List recent activities", command: "bee project activities PROJECT_KEY" },
54
+ { description: "List recent activities", command: "bee project activities -p PROJECT_KEY" },
54
55
  {
55
56
  description: "Show only issue-related activities",
56
- command: "bee project activities PROJECT_KEY --activity-type 1 --activity-type 2 --activity-type 3"
57
+ command: "bee project activities -p PROJECT_KEY --activity-type 1 --activity-type 2 --activity-type 3"
57
58
  },
58
59
  {
59
60
  description: "Show last 50 activities",
60
- command: "bee project activities PROJECT_KEY --count 50"
61
+ command: "bee project activities -p PROJECT_KEY --count 50"
61
62
  },
62
63
  {
63
64
  description: "Output as JSON",
64
- command: "bee project activities PROJECT_KEY --json"
65
+ command: "bee project activities -p PROJECT_KEY --json"
65
66
  }
66
- ]).action(async (project, opts) => {
67
+ ]).action(async (opts, cmd) => {
68
+ await resolveOptions(cmd);
67
69
  const { client } = await getClient(opts.space);
68
70
  const activityTypeId = opts.activityType;
69
- const activityList = await client.getProjectActivities(project, {
71
+ const activityList = await client.getProjectActivities(opts.project, {
70
72
  activityTypeId,
71
- count: opts.count ? Number(opts.count) : void 0,
73
+ count: parseArg(v.optional(vInteger), opts.count, "--count"),
72
74
  order: opts.order
73
75
  });
74
76
  const jsonArg = opts.json === true ? "" : opts.json;
@@ -1,28 +1,29 @@
1
1
  import consola from 'consola';
2
2
  import { A as ACTIVITY_LABELS } from '../shared/bee.CCNmDHVv.mjs';
3
- import { g as getClient } from '../shared/bee.CThuQMit.mjs';
4
- import 'backlog-js';
5
- import 'node:http';
6
- import 'open';
7
- import 'node:child_process';
8
3
  import { o as outputResult } from '../shared/bee.BTBGpv4K.mjs';
9
4
  import 'node:stream/consumers';
10
- import 'valibot';
5
+ import * as v from 'valibot';
6
+ import { p as parseArg, v as vInteger } from '../shared/bee.BYqxm3yG.mjs';
11
7
  import { f as formatDate } from '../shared/bee.n5MYN4a6.mjs';
12
8
  import { p as printTable } from '../shared/bee.IM3QELRf.mjs';
13
- import { B as BeeCommand, E as ENV_AUTH } from '../shared/bee.CQ3kBgas.mjs';
14
- import { a as collectNum, b as count, o as order, m as minId, l as maxId, j as json, s as space } from '../shared/bee.DHTPkjMh.mjs';
15
- import '../shared/bee.XxOB1Her.mjs';
9
+ import { g as getClient } from '../shared/bee.OJ0vqxJN.mjs';
10
+ import 'backlog-js';
11
+ import 'node:http';
12
+ import 'open';
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';
16
18
  import '../shared/bee.CktwmH8R.mjs';
17
- import '../shared/bee.DVTuFf-T.mjs';
19
+ import '../shared/bee.DxRKWv6n.mjs';
20
+ import 'node:module';
21
+ import 'commander';
22
+ import 'consola/utils';
18
23
  import 'node:fs';
19
24
  import 'node:path';
20
25
  import 'node:os';
21
26
  import '../shared/bee.BeQSH2t0.mjs';
22
- import '../shared/bee.-8tk76YJ.mjs';
23
- import '../shared/bee.Ds2l-nTJ.mjs';
24
- import 'commander';
25
- import 'consola/utils';
26
27
 
27
28
  const getActivitySummary = (activity) => {
28
29
  if (activity.type === 34 && activity.content.deletedStatus?.name) {
@@ -66,12 +67,12 @@ https://developer.nulab.com/docs/backlog/api/2/get-user-recent-updates/#response
66
67
  ]).action(async (user, opts) => {
67
68
  const { client } = await getClient(opts.space);
68
69
  const activityTypeId = opts.activityType;
69
- const activityList = await client.getUserActivities(Number(user), {
70
+ const activityList = await client.getUserActivities(parseArg(vInteger, user, "user"), {
70
71
  activityTypeId,
71
- count: opts.count ? Number(opts.count) : void 0,
72
+ count: parseArg(v.optional(vInteger), opts.count, "--count"),
72
73
  order: opts.order,
73
- minId: opts.minId ? Number(opts.minId) : void 0,
74
- maxId: opts.maxId ? Number(opts.maxId) : void 0
74
+ minId: parseArg(v.optional(vInteger), opts.minId, "--min-id"),
75
+ maxId: parseArg(v.optional(vInteger), opts.maxId, "--max-id")
75
76
  });
76
77
  outputResult(activityList, opts, (data) => {
77
78
  if (data.length === 0) {
@@ -1,28 +1,29 @@
1
1
  import consola from 'consola';
2
2
  import { A as ACTIVITY_LABELS } from '../shared/bee.CCNmDHVv.mjs';
3
- import { g as getClient } from '../shared/bee.CThuQMit.mjs';
4
- import 'backlog-js';
5
- import 'node:http';
6
- import 'open';
7
- import 'node:child_process';
8
3
  import { o as outputResult } from '../shared/bee.BTBGpv4K.mjs';
9
4
  import 'node:stream/consumers';
10
- import 'valibot';
5
+ import * as v from 'valibot';
6
+ import { p as parseArg, v as vInteger } from '../shared/bee.BYqxm3yG.mjs';
11
7
  import { f as formatDate } from '../shared/bee.n5MYN4a6.mjs';
12
8
  import { p as printTable } from '../shared/bee.IM3QELRf.mjs';
13
- import { B as BeeCommand, E as ENV_AUTH } from '../shared/bee.CQ3kBgas.mjs';
14
- import { a as collectNum, b as count, o as order, m as minId, l as maxId, j as json, s as space } from '../shared/bee.DHTPkjMh.mjs';
15
- import '../shared/bee.XxOB1Her.mjs';
9
+ import { g as getClient } from '../shared/bee.OJ0vqxJN.mjs';
10
+ import 'backlog-js';
11
+ import 'node:http';
12
+ import 'open';
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';
16
18
  import '../shared/bee.CktwmH8R.mjs';
17
- import '../shared/bee.DVTuFf-T.mjs';
19
+ import '../shared/bee.DxRKWv6n.mjs';
20
+ import 'node:module';
21
+ import 'commander';
22
+ import 'consola/utils';
18
23
  import 'node:fs';
19
24
  import 'node:path';
20
25
  import 'node:os';
21
26
  import '../shared/bee.BeQSH2t0.mjs';
22
- import '../shared/bee.-8tk76YJ.mjs';
23
- import '../shared/bee.Ds2l-nTJ.mjs';
24
- import 'commander';
25
- import 'consola/utils';
26
27
 
27
28
  const getActivitySummary = (activity) => {
28
29
  if (activity.type === 34 && activity.content.deletedStatus?.name) {
@@ -68,10 +69,10 @@ https://developer.nulab.com/docs/backlog/api/2/get-recent-updates/#response-desc
68
69
  const activityTypeId = opts.activityType;
69
70
  const activityList = await client.getSpaceActivities({
70
71
  activityTypeId,
71
- count: opts.count ? Number(opts.count) : void 0,
72
+ count: parseArg(v.optional(vInteger), opts.count, "--count"),
72
73
  order: opts.order,
73
- minId: opts.minId ? Number(opts.minId) : void 0,
74
- maxId: opts.maxId ? Number(opts.maxId) : void 0
74
+ minId: parseArg(v.optional(vInteger), opts.minId, "--min-id"),
75
+ maxId: parseArg(v.optional(vInteger), opts.maxId, "--max-id")
75
76
  });
76
77
  outputResult(activityList, opts, (data) => {
77
78
  if (data.length === 0) {
@@ -1,24 +1,25 @@
1
1
  import consola from 'consola';
2
- import { g as getClient } from '../shared/bee.CThuQMit.mjs';
2
+ import { o as outputResult } from '../shared/bee.BTBGpv4K.mjs';
3
+ import 'node:stream/consumers';
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';
3
7
  import 'backlog-js';
4
8
  import 'node:http';
5
9
  import 'open';
6
10
  import 'node:child_process';
7
- import { o as outputResult } from '../shared/bee.BTBGpv4K.mjs';
8
- import { U as UserError } from '../shared/bee.XxOB1Her.mjs';
9
- import 'node:stream/consumers';
10
- import 'valibot';
11
- import { B as BeeCommand, E as ENV_AUTH, a as ENV_PROJECT } from '../shared/bee.CQ3kBgas.mjs';
12
- import { p as project, R as RequiredOption, j as json, s as space, r as resolveOptions } from '../shared/bee.DHTPkjMh.mjs';
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';
13
14
  import '../shared/bee.CktwmH8R.mjs';
14
- import '../shared/bee.DVTuFf-T.mjs';
15
+ import '../shared/bee.DxRKWv6n.mjs';
16
+ import 'node:module';
17
+ import 'commander';
18
+ import 'consola/utils';
15
19
  import 'node:fs';
16
20
  import 'node:path';
17
21
  import 'node:os';
18
22
  import '../shared/bee.BeQSH2t0.mjs';
19
- import '../shared/bee.-8tk76YJ.mjs';
20
- import 'commander';
21
- import 'consola/utils';
22
23
 
23
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([
24
25
  {
@@ -27,10 +28,7 @@ const addUser = new BeeCommand("add-user").summary("Add a user to a project").de
27
28
  }
28
29
  ]).action(async (opts, cmd) => {
29
30
  await resolveOptions(cmd);
30
- const userId = Number(opts.userId);
31
- if (Number.isNaN(userId)) {
32
- throw new UserError("User ID must be a number.");
33
- }
31
+ const userId = parseArg(vInteger, opts.userId, "--user-id");
34
32
  const { client } = await getClient(opts.space);
35
33
  const user = await client.postProjectUser(opts.project, String(userId));
36
34
  const jsonArg = opts.json === true ? "" : opts.json;
@@ -1,23 +1,24 @@
1
1
  import consola from 'consola';
2
- import { g as getClient } from '../shared/bee.CThuQMit.mjs';
2
+ import { U as UserError, p as parseArg, v as vInteger } from '../shared/bee.BYqxm3yG.mjs';
3
+ import 'node:stream/consumers';
4
+ import 'valibot';
5
+ import { g as getClient } from '../shared/bee.OJ0vqxJN.mjs';
3
6
  import 'backlog-js';
4
7
  import 'node:http';
5
8
  import 'open';
6
9
  import 'node:child_process';
7
- import { U as UserError } from '../shared/bee.XxOB1Her.mjs';
8
- import 'node:stream/consumers';
9
- import 'valibot';
10
- import { B as BeeCommand, E as ENV_AUTH } from '../shared/bee.CQ3kBgas.mjs';
11
- import { t as issue, s as space } from '../shared/bee.DHTPkjMh.mjs';
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';
12
13
  import '../shared/bee.CktwmH8R.mjs';
13
- import '../shared/bee.DVTuFf-T.mjs';
14
+ import '../shared/bee.DxRKWv6n.mjs';
15
+ import 'node:module';
16
+ import 'commander';
17
+ import 'consola/utils';
14
18
  import 'node:fs';
15
19
  import 'node:path';
16
20
  import 'node:os';
17
21
  import '../shared/bee.BeQSH2t0.mjs';
18
- import '../shared/bee.-8tk76YJ.mjs';
19
- import 'commander';
20
- import 'consola/utils';
21
22
 
22
23
  const add = new BeeCommand("add").summary("Add a star").description(
23
24
  `Specify exactly one target: \`--issue\` (accepts key or ID), \`--comment\`, \`--wiki\`, or \`--pr-comment\`.`
@@ -29,7 +30,7 @@ const add = new BeeCommand("add").summary("Add a star").description(
29
30
  { description: "Star a pull request comment", command: "bee star add --pr-comment 222" }
30
31
  ]).action(async (opts) => {
31
32
  const flags = [opts.issue, opts.comment, opts.wiki, opts.prComment].filter(
32
- (v) => v !== void 0
33
+ (val) => val !== void 0
33
34
  );
34
35
  if (flags.length === 0) {
35
36
  throw new UserError(
@@ -43,18 +44,20 @@ const add = new BeeCommand("add").summary("Add a star").description(
43
44
  }
44
45
  const { client } = await getClient(opts.space);
45
46
  if (opts.issue) {
46
- const issue = /^\d+$/.test(opts.issue) ? { id: Number(opts.issue) } : await client.getIssue(opts.issue);
47
+ const issue = /^\d+$/.test(opts.issue) ? { id: parseArg(vInteger, opts.issue, "--issue") } : await client.getIssue(opts.issue);
47
48
  const issueId = issue.id;
48
49
  await client.postStar({ issueId });
49
50
  consola.success(`Starred issue ${opts.issue}.`);
50
51
  } else if (opts.comment) {
51
- await client.postStar({ commentId: Number(opts.comment) });
52
+ await client.postStar({ commentId: parseArg(vInteger, opts.comment, "--comment") });
52
53
  consola.success(`Starred comment ${opts.comment}.`);
53
54
  } else if (opts.wiki) {
54
- await client.postStar({ wikiId: Number(opts.wiki) });
55
+ await client.postStar({ wikiId: parseArg(vInteger, opts.wiki, "--wiki") });
55
56
  consola.success(`Starred wiki ${opts.wiki}.`);
56
57
  } else if (opts.prComment) {
57
- await client.postStar({ pullRequestCommentId: Number(opts.prComment) });
58
+ await client.postStar({
59
+ pullRequestCommentId: parseArg(vInteger, opts.prComment, "--pr-comment")
60
+ });
58
61
  consola.success(`Starred pull request comment ${opts.prComment}.`);
59
62
  }
60
63
  });
@@ -1,24 +1,25 @@
1
1
  import consola from 'consola';
2
- import { g as getClient } from '../shared/bee.CThuQMit.mjs';
2
+ import { o as outputResult } from '../shared/bee.BTBGpv4K.mjs';
3
+ import 'node:stream/consumers';
4
+ import 'valibot';
5
+ import '../shared/bee.BYqxm3yG.mjs';
6
+ import { g as getClient } from '../shared/bee.OJ0vqxJN.mjs';
3
7
  import 'backlog-js';
4
8
  import 'node:http';
5
9
  import 'open';
6
10
  import 'node:child_process';
7
- import { o as outputResult } from '../shared/bee.BTBGpv4K.mjs';
8
- import 'node:stream/consumers';
9
- import 'valibot';
10
- import { B as BeeCommand, E as ENV_AUTH } from '../shared/bee.CQ3kBgas.mjs';
11
- import { j as json, s as space } from '../shared/bee.DHTPkjMh.mjs';
12
- import '../shared/bee.XxOB1Her.mjs';
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';
13
14
  import '../shared/bee.CktwmH8R.mjs';
14
- import '../shared/bee.DVTuFf-T.mjs';
15
+ import '../shared/bee.DxRKWv6n.mjs';
16
+ import 'node:module';
17
+ import 'commander';
18
+ import 'consola/utils';
15
19
  import 'node:fs';
16
20
  import 'node:path';
17
21
  import 'node:os';
18
22
  import '../shared/bee.BeQSH2t0.mjs';
19
- import '../shared/bee.-8tk76YJ.mjs';
20
- import 'commander';
21
- import 'consola/utils';
22
23
 
23
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([
24
25
  { description: "Watch an issue", command: "bee watching add --issue PROJECT-123" },
@@ -1,24 +1,25 @@
1
1
  import 'consola';
2
- import { g as getClient } from '../shared/bee.CThuQMit.mjs';
2
+ import { o as outputResult } from '../shared/bee.BTBGpv4K.mjs';
3
+ import { U as UserError, a as vFiniteNumber } from '../shared/bee.BYqxm3yG.mjs';
4
+ import 'node:stream/consumers';
5
+ import * as v from 'valibot';
6
+ import { g as getClient } from '../shared/bee.OJ0vqxJN.mjs';
3
7
  import 'backlog-js';
4
8
  import 'node:http';
5
9
  import 'open';
6
10
  import 'node:child_process';
7
- import { o as outputResult } from '../shared/bee.BTBGpv4K.mjs';
8
- import { U as UserError } from '../shared/bee.XxOB1Her.mjs';
9
- import 'node:stream/consumers';
10
- import 'valibot';
11
- import { B as BeeCommand, E as ENV_AUTH } from '../shared/bee.CQ3kBgas.mjs';
12
- import { c as collect, s as space } from '../shared/bee.DHTPkjMh.mjs';
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';
13
14
  import '../shared/bee.CktwmH8R.mjs';
14
- import '../shared/bee.DVTuFf-T.mjs';
15
+ import '../shared/bee.DxRKWv6n.mjs';
16
+ import 'node:module';
17
+ import 'commander';
18
+ import 'consola/utils';
15
19
  import 'node:fs';
16
20
  import 'node:path';
17
21
  import 'node:os';
18
22
  import '../shared/bee.BeQSH2t0.mjs';
19
- import '../shared/bee.-8tk76YJ.mjs';
20
- import 'commander';
21
- import 'consola/utils';
22
23
 
23
24
  const api = new BeeCommand("api").summary("Make an authenticated API request").description(
24
25
  `The endpoint is a Backlog API path (e.g. \`users/myself\`). A leading \`/api/v2/\` prefix is stripped automatically.
@@ -106,9 +107,11 @@ const inferType = (value) => {
106
107
  if (value === "false") {
107
108
  return false;
108
109
  }
109
- const num = Number(value);
110
- if (value !== "" && !Number.isNaN(num)) {
111
- return num;
110
+ if (value !== "") {
111
+ const result = v.safeParse(vFiniteNumber, value);
112
+ if (result.success) {
113
+ return result.output;
114
+ }
112
115
  }
113
116
  return value;
114
117
  };
@@ -1,27 +1,28 @@
1
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
2
  import { o as outputResult } from '../shared/bee.BTBGpv4K.mjs';
8
3
  import 'node:stream/consumers';
9
4
  import 'valibot';
5
+ import '../shared/bee.BYqxm3yG.mjs';
10
6
  import { a as formatSize, f as formatDate } from '../shared/bee.n5MYN4a6.mjs';
11
7
  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, s as space } from '../shared/bee.DHTPkjMh.mjs';
14
- import '../shared/bee.XxOB1Her.mjs';
8
+ import { g as getClient } from '../shared/bee.OJ0vqxJN.mjs';
9
+ import 'backlog-js';
10
+ import 'node:http';
11
+ import 'open';
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';
15
17
  import '../shared/bee.CktwmH8R.mjs';
16
- import '../shared/bee.DVTuFf-T.mjs';
18
+ import '../shared/bee.DxRKWv6n.mjs';
19
+ import 'node:module';
20
+ import 'commander';
21
+ import 'consola/utils';
17
22
  import 'node:fs';
18
23
  import 'node:path';
19
24
  import 'node:os';
20
25
  import '../shared/bee.BeQSH2t0.mjs';
21
- import '../shared/bee.-8tk76YJ.mjs';
22
- import '../shared/bee.Ds2l-nTJ.mjs';
23
- import 'commander';
24
- import 'consola/utils';
25
26
 
26
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([
27
28
  { description: "List attachments", command: "bee issue attachments PROJECT-123" },
@@ -1,27 +1,28 @@
1
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
2
  import { o as outputResult } from '../shared/bee.BTBGpv4K.mjs';
8
3
  import 'node:stream/consumers';
9
4
  import 'valibot';
5
+ import '../shared/bee.BYqxm3yG.mjs';
10
6
  import { a as formatSize, f as formatDate } from '../shared/bee.n5MYN4a6.mjs';
11
7
  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, s as space } from '../shared/bee.DHTPkjMh.mjs';
14
- import '../shared/bee.XxOB1Her.mjs';
8
+ import { g as getClient } from '../shared/bee.OJ0vqxJN.mjs';
9
+ import 'backlog-js';
10
+ import 'node:http';
11
+ import 'open';
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';
15
17
  import '../shared/bee.CktwmH8R.mjs';
16
- import '../shared/bee.DVTuFf-T.mjs';
18
+ import '../shared/bee.DxRKWv6n.mjs';
19
+ import 'node:module';
20
+ import 'commander';
21
+ import 'consola/utils';
17
22
  import 'node:fs';
18
23
  import 'node:path';
19
24
  import 'node:os';
20
25
  import '../shared/bee.BeQSH2t0.mjs';
21
- import '../shared/bee.-8tk76YJ.mjs';
22
- import '../shared/bee.Ds2l-nTJ.mjs';
23
- import 'commander';
24
- import 'consola/utils';
25
26
 
26
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([
27
28
  { description: "List attachments", command: "bee document attachments 12345" },
@@ -1,34 +1,35 @@
1
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
2
  import { o as outputResult } from '../shared/bee.BTBGpv4K.mjs';
8
3
  import 'node:stream/consumers';
9
4
  import 'valibot';
5
+ import { p as parseArg, v as vInteger } from '../shared/bee.BYqxm3yG.mjs';
10
6
  import { f as formatDate } from '../shared/bee.n5MYN4a6.mjs';
11
7
  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, s as space } from '../shared/bee.DHTPkjMh.mjs';
14
- import '../shared/bee.XxOB1Her.mjs';
8
+ import { g as getClient } from '../shared/bee.OJ0vqxJN.mjs';
9
+ import 'backlog-js';
10
+ import 'node:http';
11
+ import 'open';
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';
15
17
  import '../shared/bee.CktwmH8R.mjs';
16
- import '../shared/bee.DVTuFf-T.mjs';
18
+ import '../shared/bee.DxRKWv6n.mjs';
19
+ import 'node:module';
20
+ import 'commander';
21
+ import 'consola/utils';
17
22
  import 'node:fs';
18
23
  import 'node:path';
19
24
  import 'node:os';
20
25
  import '../shared/bee.BeQSH2t0.mjs';
21
- import '../shared/bee.-8tk76YJ.mjs';
22
- import '../shared/bee.Ds2l-nTJ.mjs';
23
- import 'commander';
24
- import 'consola/utils';
25
26
 
26
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([
27
28
  { description: "List wiki attachments", command: "bee wiki attachments 12345" },
28
29
  { description: "Output as JSON", command: "bee wiki attachments 12345 --json" }
29
30
  ]).action(async (wiki, opts) => {
30
31
  const { client } = await getClient(opts.space);
31
- const files = await client.getWikisAttachments(Number(wiki));
32
+ const files = await client.getWikisAttachments(parseArg(vInteger, wiki, "wiki"));
32
33
  outputResult(files, opts, (data) => {
33
34
  if (data.length === 0) {
34
35
  consola.info("No attachments found.");
@@ -1,22 +1,23 @@
1
1
  import consola from 'consola';
2
- import { g as getClient } from '../shared/bee.CThuQMit.mjs';
2
+ import { p as parseArg, v as vInteger, U as UserError } from '../shared/bee.BYqxm3yG.mjs';
3
+ import 'node:stream/consumers';
4
+ import 'valibot';
5
+ import { g as getClient } from '../shared/bee.OJ0vqxJN.mjs';
3
6
  import 'backlog-js';
4
7
  import 'node:http';
5
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';
6
9
  import { execFile } from 'node:child_process';
7
- import { U as UserError } from '../shared/bee.XxOB1Her.mjs';
8
- import 'node:stream/consumers';
9
- import 'valibot';
10
- import { B as BeeCommand, E as ENV_AUTH, a as ENV_PROJECT } from '../shared/bee.CQ3kBgas.mjs';
11
- import { p as project, n as noBrowser, s as space } from '../shared/bee.DHTPkjMh.mjs';
12
- import '../shared/bee.BeQSH2t0.mjs';
13
- import '../shared/bee.CktwmH8R.mjs';
14
- import '../shared/bee.DVTuFf-T.mjs';
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';
15
13
  import 'node:fs';
16
14
  import 'node:path';
17
15
  import 'node:os';
18
- import '../shared/bee.-8tk76YJ.mjs';
16
+ import '../shared/bee.BeQSH2t0.mjs';
17
+ import '../shared/bee.CktwmH8R.mjs';
18
+ import '../shared/bee.DxRKWv6n.mjs';
19
19
  import 'open';
20
+ import 'node:module';
20
21
  import 'commander';
21
22
  import 'consola/utils';
22
23
 
@@ -207,7 +208,7 @@ const resolveFileUrl = (host, args, git) => {
207
208
  }
208
209
  const lineMatch = args.target.match(FILE_LINE_PATTERN);
209
210
  const filePath = lineMatch ? lineMatch[1] : args.target;
210
- const line = lineMatch ? Number(lineMatch[2]) : void 0;
211
+ const line = lineMatch ? parseArg(vInteger, lineMatch[2], "line") : void 0;
211
212
  const fullPath = git.repoRelativePath ? `${git.repoRelativePath}${filePath}` : filePath;
212
213
  const isDir = filePath.endsWith("/");
213
214
  if (isDir) {