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

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 (103) hide show
  1. package/dist/chunks/activities.mjs +13 -14
  2. package/dist/chunks/activities2.mjs +16 -17
  3. package/dist/chunks/activities3.mjs +15 -16
  4. package/dist/chunks/add-user.mjs +10 -14
  5. package/dist/chunks/add.mjs +15 -14
  6. package/dist/chunks/add2.mjs +9 -10
  7. package/dist/chunks/api.mjs +14 -13
  8. package/dist/chunks/attachments.mjs +11 -12
  9. package/dist/chunks/attachments2.mjs +11 -12
  10. package/dist/chunks/attachments3.mjs +12 -13
  11. package/dist/chunks/browse.mjs +10 -11
  12. package/dist/chunks/clone.mjs +9 -10
  13. package/dist/chunks/close.mjs +10 -11
  14. package/dist/chunks/comment.mjs +14 -13
  15. package/dist/chunks/comment2.mjs +12 -13
  16. package/dist/chunks/comments.mjs +14 -15
  17. package/dist/chunks/completion.mjs +1 -1
  18. package/dist/chunks/count.mjs +7 -8
  19. package/dist/chunks/count2.mjs +9 -10
  20. package/dist/chunks/count3.mjs +10 -11
  21. package/dist/chunks/count4.mjs +9 -10
  22. package/dist/chunks/count5.mjs +10 -11
  23. package/dist/chunks/create.mjs +9 -10
  24. package/dist/chunks/create2.mjs +18 -13
  25. package/dist/chunks/create3.mjs +10 -11
  26. package/dist/chunks/create4.mjs +14 -14
  27. package/dist/chunks/create5.mjs +10 -11
  28. package/dist/chunks/create6.mjs +9 -10
  29. package/dist/chunks/create7.mjs +9 -10
  30. package/dist/chunks/create8.mjs +9 -10
  31. package/dist/chunks/create9.mjs +9 -10
  32. package/dist/chunks/dashboard.mjs +12 -13
  33. package/dist/chunks/delete.mjs +8 -9
  34. package/dist/chunks/delete2.mjs +8 -9
  35. package/dist/chunks/delete3.mjs +8 -9
  36. package/dist/chunks/delete4.mjs +12 -10
  37. package/dist/chunks/delete5.mjs +12 -10
  38. package/dist/chunks/delete6.mjs +12 -10
  39. package/dist/chunks/delete7.mjs +19 -12
  40. package/dist/chunks/delete8.mjs +10 -11
  41. package/dist/chunks/delete9.mjs +9 -10
  42. package/dist/chunks/edit.mjs +9 -10
  43. package/dist/chunks/edit2.mjs +23 -18
  44. package/dist/chunks/edit3.mjs +15 -15
  45. package/dist/chunks/edit4.mjs +10 -11
  46. package/dist/chunks/edit5.mjs +15 -10
  47. package/dist/chunks/edit6.mjs +20 -17
  48. package/dist/chunks/edit7.mjs +17 -14
  49. package/dist/chunks/edit8.mjs +17 -14
  50. package/dist/chunks/history.mjs +16 -17
  51. package/dist/chunks/list.mjs +11 -12
  52. package/dist/chunks/list10.mjs +11 -12
  53. package/dist/chunks/list11.mjs +11 -12
  54. package/dist/chunks/list12.mjs +11 -12
  55. package/dist/chunks/list13.mjs +11 -12
  56. package/dist/chunks/list14.mjs +12 -13
  57. package/dist/chunks/list15.mjs +11 -12
  58. package/dist/chunks/list2.mjs +29 -16
  59. package/dist/chunks/list3.mjs +19 -20
  60. package/dist/chunks/list4.mjs +15 -16
  61. package/dist/chunks/list5.mjs +15 -16
  62. package/dist/chunks/list6.mjs +11 -12
  63. package/dist/chunks/list7.mjs +14 -15
  64. package/dist/chunks/list8.mjs +11 -12
  65. package/dist/chunks/list9.mjs +11 -12
  66. package/dist/chunks/login.mjs +27 -26
  67. package/dist/chunks/logout.mjs +3 -4
  68. package/dist/chunks/me.mjs +12 -13
  69. package/dist/chunks/read-all.mjs +8 -9
  70. package/dist/chunks/read.mjs +9 -10
  71. package/dist/chunks/read2.mjs +9 -10
  72. package/dist/chunks/refresh.mjs +3 -4
  73. package/dist/chunks/remove-user.mjs +10 -14
  74. package/dist/chunks/remove.mjs +9 -10
  75. package/dist/chunks/reopen.mjs +9 -10
  76. package/dist/chunks/status.mjs +3 -4
  77. package/dist/chunks/status2.mjs +9 -10
  78. package/dist/chunks/status3.mjs +9 -10
  79. package/dist/chunks/switch.mjs +2 -3
  80. package/dist/chunks/tags.mjs +9 -10
  81. package/dist/chunks/token.mjs +3 -4
  82. package/dist/chunks/tree.mjs +9 -10
  83. package/dist/chunks/users.mjs +11 -12
  84. package/dist/chunks/view.mjs +12 -13
  85. package/dist/chunks/view2.mjs +12 -13
  86. package/dist/chunks/view3.mjs +12 -13
  87. package/dist/chunks/view4.mjs +13 -14
  88. package/dist/chunks/view5.mjs +12 -13
  89. package/dist/chunks/view6.mjs +12 -13
  90. package/dist/chunks/view7.mjs +13 -14
  91. package/dist/chunks/view8.mjs +14 -15
  92. package/dist/chunks/view9.mjs +12 -13
  93. package/dist/index.mjs +4 -3
  94. package/dist/shared/{bee.DVTuFf-T.mjs → bee.B4OxR0DJ.mjs} +50 -2
  95. package/dist/shared/{bee.CThuQMit.mjs → bee.BCBBmkOy.mjs} +6 -5
  96. package/dist/shared/bee.BYqxm3yG.mjs +24 -0
  97. package/dist/shared/bee.G4d7izLe.mjs +14 -0
  98. package/dist/shared/{bee.sHWg0IFT.mjs → bee.PF8hrVKn.mjs} +8 -3
  99. package/dist/shared/{bee.-8tk76YJ.mjs → bee.riolf-_Y.mjs} +1 -1
  100. package/package.json +1 -2
  101. package/dist/shared/bee.ChBdZ0cH.mjs +0 -9
  102. package/dist/shared/bee.DHTPkjMh.mjs +0 -48
  103. package/dist/shared/bee.XxOB1Her.mjs +0 -8
@@ -1,28 +1,27 @@
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';
9
+ import { g as getClient } from '../shared/bee.BCBBmkOy.mjs';
10
+ import 'backlog-js';
11
+ import 'node:http';
12
+ import 'open';
13
+ import 'node:child_process';
13
14
  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';
15
+ import { e as collectNum, f as count, o as order, j as json, s as space } from '../shared/bee.B4OxR0DJ.mjs';
16
+ import '../shared/bee.Ds2l-nTJ.mjs';
16
17
  import '../shared/bee.CktwmH8R.mjs';
17
- import '../shared/bee.DVTuFf-T.mjs';
18
+ import '../shared/bee.riolf-_Y.mjs';
19
+ import 'commander';
20
+ import 'consola/utils';
18
21
  import 'node:fs';
19
22
  import 'node:path';
20
23
  import 'node:os';
21
24
  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
25
 
27
26
  const getActivitySummary = (activity) => {
28
27
  if (activity.type === 34 && activity.content.deletedStatus?.name) {
@@ -68,7 +67,7 @@ https://developer.nulab.com/docs/backlog/api/2/get-project-recent-updates/#respo
68
67
  const activityTypeId = opts.activityType;
69
68
  const activityList = await client.getProjectActivities(project, {
70
69
  activityTypeId,
71
- count: opts.count ? Number(opts.count) : void 0,
70
+ count: parseArg(v.optional(vInteger), opts.count, "--count"),
72
71
  order: opts.order
73
72
  });
74
73
  const jsonArg = opts.json === true ? "" : opts.json;
@@ -1,28 +1,27 @@
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';
9
+ import { g as getClient } from '../shared/bee.BCBBmkOy.mjs';
10
+ import 'backlog-js';
11
+ import 'node:http';
12
+ import 'open';
13
+ import 'node:child_process';
13
14
  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';
15
+ 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.B4OxR0DJ.mjs';
16
+ import '../shared/bee.Ds2l-nTJ.mjs';
16
17
  import '../shared/bee.CktwmH8R.mjs';
17
- import '../shared/bee.DVTuFf-T.mjs';
18
+ import '../shared/bee.riolf-_Y.mjs';
19
+ import 'commander';
20
+ import 'consola/utils';
18
21
  import 'node:fs';
19
22
  import 'node:path';
20
23
  import 'node:os';
21
24
  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
25
 
27
26
  const getActivitySummary = (activity) => {
28
27
  if (activity.type === 34 && activity.content.deletedStatus?.name) {
@@ -66,12 +65,12 @@ https://developer.nulab.com/docs/backlog/api/2/get-user-recent-updates/#response
66
65
  ]).action(async (user, opts) => {
67
66
  const { client } = await getClient(opts.space);
68
67
  const activityTypeId = opts.activityType;
69
- const activityList = await client.getUserActivities(Number(user), {
68
+ const activityList = await client.getUserActivities(parseArg(vInteger, user, "user"), {
70
69
  activityTypeId,
71
- count: opts.count ? Number(opts.count) : void 0,
70
+ count: parseArg(v.optional(vInteger), opts.count, "--count"),
72
71
  order: opts.order,
73
- minId: opts.minId ? Number(opts.minId) : void 0,
74
- maxId: opts.maxId ? Number(opts.maxId) : void 0
72
+ minId: parseArg(v.optional(vInteger), opts.minId, "--min-id"),
73
+ maxId: parseArg(v.optional(vInteger), opts.maxId, "--max-id")
75
74
  });
76
75
  outputResult(activityList, opts, (data) => {
77
76
  if (data.length === 0) {
@@ -1,28 +1,27 @@
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';
9
+ import { g as getClient } from '../shared/bee.BCBBmkOy.mjs';
10
+ import 'backlog-js';
11
+ import 'node:http';
12
+ import 'open';
13
+ import 'node:child_process';
13
14
  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';
15
+ 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.B4OxR0DJ.mjs';
16
+ import '../shared/bee.Ds2l-nTJ.mjs';
16
17
  import '../shared/bee.CktwmH8R.mjs';
17
- import '../shared/bee.DVTuFf-T.mjs';
18
+ import '../shared/bee.riolf-_Y.mjs';
19
+ import 'commander';
20
+ import 'consola/utils';
18
21
  import 'node:fs';
19
22
  import 'node:path';
20
23
  import 'node:os';
21
24
  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
25
 
27
26
  const getActivitySummary = (activity) => {
28
27
  if (activity.type === 34 && activity.content.deletedStatus?.name) {
@@ -68,10 +67,10 @@ https://developer.nulab.com/docs/backlog/api/2/get-recent-updates/#response-desc
68
67
  const activityTypeId = opts.activityType;
69
68
  const activityList = await client.getSpaceActivities({
70
69
  activityTypeId,
71
- count: opts.count ? Number(opts.count) : void 0,
70
+ count: parseArg(v.optional(vInteger), opts.count, "--count"),
72
71
  order: opts.order,
73
- minId: opts.minId ? Number(opts.minId) : void 0,
74
- maxId: opts.maxId ? Number(opts.maxId) : void 0
72
+ minId: parseArg(v.optional(vInteger), opts.minId, "--min-id"),
73
+ maxId: parseArg(v.optional(vInteger), opts.maxId, "--max-id")
75
74
  });
76
75
  outputResult(activityList, opts, (data) => {
77
76
  if (data.length === 0) {
@@ -1,24 +1,23 @@
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.BCBBmkOy.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
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';
12
+ import { p as project, R as RequiredOption, j as json, s as space, r as resolveOptions } from '../shared/bee.B4OxR0DJ.mjs';
13
13
  import '../shared/bee.CktwmH8R.mjs';
14
- import '../shared/bee.DVTuFf-T.mjs';
14
+ import '../shared/bee.riolf-_Y.mjs';
15
+ import 'commander';
16
+ import 'consola/utils';
15
17
  import 'node:fs';
16
18
  import 'node:path';
17
19
  import 'node:os';
18
20
  import '../shared/bee.BeQSH2t0.mjs';
19
- import '../shared/bee.-8tk76YJ.mjs';
20
- import 'commander';
21
- import 'consola/utils';
22
21
 
23
22
  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
23
  {
@@ -27,10 +26,7 @@ const addUser = new BeeCommand("add-user").summary("Add a user to a project").de
27
26
  }
28
27
  ]).action(async (opts, cmd) => {
29
28
  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
- }
29
+ const userId = parseArg(vInteger, opts.userId, "--user-id");
34
30
  const { client } = await getClient(opts.space);
35
31
  const user = await client.postProjectUser(opts.project, String(userId));
36
32
  const jsonArg = opts.json === true ? "" : opts.json;
@@ -1,23 +1,22 @@
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.BCBBmkOy.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
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';
11
+ import { C as issue, s as space } from '../shared/bee.B4OxR0DJ.mjs';
12
12
  import '../shared/bee.CktwmH8R.mjs';
13
- import '../shared/bee.DVTuFf-T.mjs';
13
+ import '../shared/bee.riolf-_Y.mjs';
14
+ import 'commander';
15
+ import 'consola/utils';
14
16
  import 'node:fs';
15
17
  import 'node:path';
16
18
  import 'node:os';
17
19
  import '../shared/bee.BeQSH2t0.mjs';
18
- import '../shared/bee.-8tk76YJ.mjs';
19
- import 'commander';
20
- import 'consola/utils';
21
20
 
22
21
  const add = new BeeCommand("add").summary("Add a star").description(
23
22
  `Specify exactly one target: \`--issue\` (accepts key or ID), \`--comment\`, \`--wiki\`, or \`--pr-comment\`.`
@@ -29,7 +28,7 @@ const add = new BeeCommand("add").summary("Add a star").description(
29
28
  { description: "Star a pull request comment", command: "bee star add --pr-comment 222" }
30
29
  ]).action(async (opts) => {
31
30
  const flags = [opts.issue, opts.comment, opts.wiki, opts.prComment].filter(
32
- (v) => v !== void 0
31
+ (val) => val !== void 0
33
32
  );
34
33
  if (flags.length === 0) {
35
34
  throw new UserError(
@@ -43,18 +42,20 @@ const add = new BeeCommand("add").summary("Add a star").description(
43
42
  }
44
43
  const { client } = await getClient(opts.space);
45
44
  if (opts.issue) {
46
- const issue = /^\d+$/.test(opts.issue) ? { id: Number(opts.issue) } : await client.getIssue(opts.issue);
45
+ const issue = /^\d+$/.test(opts.issue) ? { id: parseArg(vInteger, opts.issue, "--issue") } : await client.getIssue(opts.issue);
47
46
  const issueId = issue.id;
48
47
  await client.postStar({ issueId });
49
48
  consola.success(`Starred issue ${opts.issue}.`);
50
49
  } else if (opts.comment) {
51
- await client.postStar({ commentId: Number(opts.comment) });
50
+ await client.postStar({ commentId: parseArg(vInteger, opts.comment, "--comment") });
52
51
  consola.success(`Starred comment ${opts.comment}.`);
53
52
  } else if (opts.wiki) {
54
- await client.postStar({ wikiId: Number(opts.wiki) });
53
+ await client.postStar({ wikiId: parseArg(vInteger, opts.wiki, "--wiki") });
55
54
  consola.success(`Starred wiki ${opts.wiki}.`);
56
55
  } else if (opts.prComment) {
57
- await client.postStar({ pullRequestCommentId: Number(opts.prComment) });
56
+ await client.postStar({
57
+ pullRequestCommentId: parseArg(vInteger, opts.prComment, "--pr-comment")
58
+ });
58
59
  consola.success(`Starred pull request comment ${opts.prComment}.`);
59
60
  }
60
61
  });
@@ -1,24 +1,23 @@
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.BCBBmkOy.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
11
  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';
12
+ import { j as json, s as space } from '../shared/bee.B4OxR0DJ.mjs';
13
13
  import '../shared/bee.CktwmH8R.mjs';
14
- import '../shared/bee.DVTuFf-T.mjs';
14
+ import '../shared/bee.riolf-_Y.mjs';
15
+ import 'commander';
16
+ import 'consola/utils';
15
17
  import 'node:fs';
16
18
  import 'node:path';
17
19
  import 'node:os';
18
20
  import '../shared/bee.BeQSH2t0.mjs';
19
- import '../shared/bee.-8tk76YJ.mjs';
20
- import 'commander';
21
- import 'consola/utils';
22
21
 
23
22
  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
23
  { description: "Watch an issue", command: "bee watching add --issue PROJECT-123" },
@@ -1,24 +1,23 @@
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.BCBBmkOy.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
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';
12
+ import { c as collect, s as space } from '../shared/bee.B4OxR0DJ.mjs';
13
13
  import '../shared/bee.CktwmH8R.mjs';
14
- import '../shared/bee.DVTuFf-T.mjs';
14
+ import '../shared/bee.riolf-_Y.mjs';
15
+ import 'commander';
16
+ import 'consola/utils';
15
17
  import 'node:fs';
16
18
  import 'node:path';
17
19
  import 'node:os';
18
20
  import '../shared/bee.BeQSH2t0.mjs';
19
- import '../shared/bee.-8tk76YJ.mjs';
20
- import 'commander';
21
- import 'consola/utils';
22
21
 
23
22
  const api = new BeeCommand("api").summary("Make an authenticated API request").description(
24
23
  `The endpoint is a Backlog API path (e.g. \`users/myself\`). A leading \`/api/v2/\` prefix is stripped automatically.
@@ -106,9 +105,11 @@ const inferType = (value) => {
106
105
  if (value === "false") {
107
106
  return false;
108
107
  }
109
- const num = Number(value);
110
- if (value !== "" && !Number.isNaN(num)) {
111
- return num;
108
+ if (value !== "") {
109
+ const result = v.safeParse(vFiniteNumber, value);
110
+ if (result.success) {
111
+ return result.output;
112
+ }
112
113
  }
113
114
  return value;
114
115
  };
@@ -1,27 +1,26 @@
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';
8
+ import { g as getClient } from '../shared/bee.BCBBmkOy.mjs';
9
+ import 'backlog-js';
10
+ import 'node:http';
11
+ import 'open';
12
+ import 'node:child_process';
12
13
  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';
14
+ import { j as json, s as space } from '../shared/bee.B4OxR0DJ.mjs';
15
+ import '../shared/bee.Ds2l-nTJ.mjs';
15
16
  import '../shared/bee.CktwmH8R.mjs';
16
- import '../shared/bee.DVTuFf-T.mjs';
17
+ import '../shared/bee.riolf-_Y.mjs';
18
+ import 'commander';
19
+ import 'consola/utils';
17
20
  import 'node:fs';
18
21
  import 'node:path';
19
22
  import 'node:os';
20
23
  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
24
 
26
25
  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
26
  { description: "List attachments", command: "bee issue attachments PROJECT-123" },
@@ -1,27 +1,26 @@
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';
8
+ import { g as getClient } from '../shared/bee.BCBBmkOy.mjs';
9
+ import 'backlog-js';
10
+ import 'node:http';
11
+ import 'open';
12
+ import 'node:child_process';
12
13
  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';
14
+ import { j as json, s as space } from '../shared/bee.B4OxR0DJ.mjs';
15
+ import '../shared/bee.Ds2l-nTJ.mjs';
15
16
  import '../shared/bee.CktwmH8R.mjs';
16
- import '../shared/bee.DVTuFf-T.mjs';
17
+ import '../shared/bee.riolf-_Y.mjs';
18
+ import 'commander';
19
+ import 'consola/utils';
17
20
  import 'node:fs';
18
21
  import 'node:path';
19
22
  import 'node:os';
20
23
  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
24
 
26
25
  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
26
  { description: "List attachments", command: "bee document attachments 12345" },
@@ -1,34 +1,33 @@
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';
8
+ import { g as getClient } from '../shared/bee.BCBBmkOy.mjs';
9
+ import 'backlog-js';
10
+ import 'node:http';
11
+ import 'open';
12
+ import 'node:child_process';
12
13
  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';
14
+ import { j as json, s as space } from '../shared/bee.B4OxR0DJ.mjs';
15
+ import '../shared/bee.Ds2l-nTJ.mjs';
15
16
  import '../shared/bee.CktwmH8R.mjs';
16
- import '../shared/bee.DVTuFf-T.mjs';
17
+ import '../shared/bee.riolf-_Y.mjs';
18
+ import 'commander';
19
+ import 'consola/utils';
17
20
  import 'node:fs';
18
21
  import 'node:path';
19
22
  import 'node:os';
20
23
  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
24
 
26
25
  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
26
  { description: "List wiki attachments", command: "bee wiki attachments 12345" },
28
27
  { description: "Output as JSON", command: "bee wiki attachments 12345 --json" }
29
28
  ]).action(async (wiki, opts) => {
30
29
  const { client } = await getClient(opts.space);
31
- const files = await client.getWikisAttachments(Number(wiki));
30
+ const files = await client.getWikisAttachments(parseArg(vInteger, wiki, "wiki"));
32
31
  outputResult(files, opts, (data) => {
33
32
  if (data.length === 0) {
34
33
  consola.info("No attachments found.");
@@ -1,24 +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.BCBBmkOy.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
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';
11
+ import { p as project, n as noBrowser, s as space } from '../shared/bee.B4OxR0DJ.mjs';
12
12
  import '../shared/bee.BeQSH2t0.mjs';
13
13
  import '../shared/bee.CktwmH8R.mjs';
14
- import '../shared/bee.DVTuFf-T.mjs';
15
- import 'node:fs';
16
- import 'node:path';
17
- import 'node:os';
18
- import '../shared/bee.-8tk76YJ.mjs';
14
+ import '../shared/bee.riolf-_Y.mjs';
19
15
  import 'open';
20
16
  import 'commander';
21
17
  import 'consola/utils';
18
+ import 'node:fs';
19
+ import 'node:path';
20
+ import 'node:os';
22
21
 
23
22
  const parseBacklogRemoteUrl = (url) => {
24
23
  const sshUrlMatch = url.match(
@@ -207,7 +206,7 @@ const resolveFileUrl = (host, args, git) => {
207
206
  }
208
207
  const lineMatch = args.target.match(FILE_LINE_PATTERN);
209
208
  const filePath = lineMatch ? lineMatch[1] : args.target;
210
- const line = lineMatch ? Number(lineMatch[2]) : void 0;
209
+ const line = lineMatch ? parseArg(vInteger, lineMatch[2], "line") : void 0;
211
210
  const fullPath = git.repoRelativePath ? `${git.repoRelativePath}${filePath}` : filePath;
212
211
  const isDir = filePath.endsWith("/");
213
212
  if (isDir) {
@@ -1,24 +1,23 @@
1
1
  import { spawn } from 'node:child_process';
2
2
  import consola from 'consola';
3
- import { g as getClient } from '../shared/bee.CThuQMit.mjs';
4
- import 'backlog-js';
5
- import 'node:http';
6
- import 'open';
7
3
  import { o as outputResult } from '../shared/bee.BTBGpv4K.mjs';
8
4
  import 'node:stream/consumers';
9
5
  import 'valibot';
6
+ import '../shared/bee.BYqxm3yG.mjs';
7
+ import { g as getClient } from '../shared/bee.BCBBmkOy.mjs';
8
+ import 'backlog-js';
9
+ import 'node:http';
10
+ import 'open';
10
11
  import { B as BeeCommand, E as ENV_AUTH, a as ENV_PROJECT } from '../shared/bee.CQ3kBgas.mjs';
11
- import { p as project, j as json, s as space, r as resolveOptions } from '../shared/bee.DHTPkjMh.mjs';
12
- import '../shared/bee.XxOB1Her.mjs';
12
+ import { p as project, j as json, s as space, r as resolveOptions } from '../shared/bee.B4OxR0DJ.mjs';
13
13
  import '../shared/bee.CktwmH8R.mjs';
14
- import '../shared/bee.DVTuFf-T.mjs';
14
+ import '../shared/bee.riolf-_Y.mjs';
15
+ import 'commander';
16
+ import 'consola/utils';
15
17
  import 'node:fs';
16
18
  import 'node:path';
17
19
  import 'node:os';
18
20
  import '../shared/bee.BeQSH2t0.mjs';
19
- import '../shared/bee.-8tk76YJ.mjs';
20
- import 'commander';
21
- import 'consola/utils';
22
21
 
23
22
  const gitClone = (gitArgs) => new Promise((resolve, reject) => {
24
23
  const child = spawn("git", gitArgs, { stdio: "inherit" });
@@ -1,25 +1,24 @@
1
1
  import consola from 'consola';
2
2
  import { R as ResolutionId, I as IssueStatusId } from '../shared/bee.Btmq3TXs.mjs';
3
- import { g as getClient } from '../shared/bee.CThuQMit.mjs';
3
+ import { o as outputResult } from '../shared/bee.BTBGpv4K.mjs';
4
+ import 'node:stream/consumers';
5
+ import 'valibot';
6
+ import { p as parseArg, v as vInteger } from '../shared/bee.BYqxm3yG.mjs';
7
+ import { g as getClient } from '../shared/bee.BCBBmkOy.mjs';
4
8
  import 'backlog-js';
5
9
  import 'node:http';
6
10
  import 'open';
7
11
  import 'node:child_process';
8
- import { o as outputResult } from '../shared/bee.BTBGpv4K.mjs';
9
- import 'node:stream/consumers';
10
- import 'valibot';
11
12
  import { B as BeeCommand, E as ENV_AUTH } from '../shared/bee.CQ3kBgas.mjs';
12
- import { g as notify, j as json, s as space } from '../shared/bee.DHTPkjMh.mjs';
13
- import '../shared/bee.XxOB1Her.mjs';
13
+ import { t as notify, j as json, s as space } from '../shared/bee.B4OxR0DJ.mjs';
14
14
  import '../shared/bee.CktwmH8R.mjs';
15
- import '../shared/bee.DVTuFf-T.mjs';
15
+ import '../shared/bee.riolf-_Y.mjs';
16
+ import 'commander';
17
+ import 'consola/utils';
16
18
  import 'node:fs';
17
19
  import 'node:path';
18
20
  import 'node:os';
19
21
  import '../shared/bee.BeQSH2t0.mjs';
20
- import '../shared/bee.-8tk76YJ.mjs';
21
- import 'commander';
22
- import 'consola/utils';
23
22
 
24
23
  const close = new BeeCommand("close").summary("Close an issue").description(
25
24
  `Sets the status to Closed with resolution \`Fixed\` by default. Use \`--resolution\` for a different resolution.`
@@ -35,7 +34,7 @@ const close = new BeeCommand("close").summary("Close an issue").description(
35
34
  }
36
35
  ]).action(async (issue, opts) => {
37
36
  const { client } = await getClient(opts.space);
38
- const resolutionId = opts.resolution ? ResolutionId[opts.resolution] ?? Number(opts.resolution) : ResolutionId.fixed;
37
+ const resolutionId = opts.resolution ? ResolutionId[opts.resolution] ?? parseArg(vInteger, opts.resolution, "--resolution") : ResolutionId.fixed;
39
38
  const notifiedUserId = opts.notify ?? [];
40
39
  const issueData = await client.patchIssue(issue, {
41
40
  statusId: IssueStatusId.Closed,