@bifos/dooray-cli 0.6.0 → 0.8.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.
package/dist/index.js CHANGED
@@ -24,7 +24,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
24
24
  ));
25
25
 
26
26
  // src/index.ts
27
- var import_commander46 = require("commander");
27
+ var import_commander47 = require("commander");
28
28
  var import_chalk7 = __toESM(require("chalk"));
29
29
 
30
30
  // src/commands/config.ts
@@ -414,7 +414,7 @@ var DoorayApiClient = class {
414
414
  try {
415
415
  return await this.api.get("common/v1/members/me").json();
416
416
  } catch (e) {
417
- return toDoorayCliError(e);
417
+ return await toDoorayCliError(e);
418
418
  }
419
419
  }
420
420
  // ─── Projects ───────────────────────────────────────
@@ -431,7 +431,7 @@ var DoorayApiClient = class {
431
431
  }
432
432
  }).json();
433
433
  } catch (e) {
434
- return toDoorayCliError(e);
434
+ return await toDoorayCliError(e);
435
435
  }
436
436
  }
437
437
  // ─── Posts ──────────────────────────────────────────
@@ -458,42 +458,42 @@ var DoorayApiClient = class {
458
458
  }
459
459
  }).json();
460
460
  } catch (e) {
461
- return toDoorayCliError(e);
461
+ return await toDoorayCliError(e);
462
462
  }
463
463
  }
464
464
  async getPost(projectId, postId) {
465
465
  try {
466
466
  return await this.api.get(`project/v1/projects/${projectId}/posts/${postId}`).json();
467
467
  } catch (e) {
468
- return toDoorayCliError(e);
468
+ return await toDoorayCliError(e);
469
469
  }
470
470
  }
471
471
  async getPostStandalone(postId) {
472
472
  try {
473
473
  return await this.api.get(`project/v1/posts/${postId}`).json();
474
474
  } catch (e) {
475
- return toDoorayCliError(e);
475
+ return await toDoorayCliError(e);
476
476
  }
477
477
  }
478
478
  async createPost(projectId, body) {
479
479
  try {
480
480
  return await this.api.post(`project/v1/projects/${projectId}/posts`, { json: body }).json();
481
481
  } catch (e) {
482
- return toDoorayCliError(e);
482
+ return await toDoorayCliError(e);
483
483
  }
484
484
  }
485
485
  async updatePost(projectId, postId, body) {
486
486
  try {
487
487
  return await this.api.put(`project/v1/projects/${projectId}/posts/${postId}`, { json: body }).json();
488
488
  } catch (e) {
489
- return toDoorayCliError(e);
489
+ return await toDoorayCliError(e);
490
490
  }
491
491
  }
492
492
  async setPostDone(projectId, postId) {
493
493
  try {
494
494
  return await this.api.post(`project/v1/projects/${projectId}/posts/${postId}/set-done`).json();
495
495
  } catch (e) {
496
- return toDoorayCliError(e);
496
+ return await toDoorayCliError(e);
497
497
  }
498
498
  }
499
499
  async setPostWorkflow(projectId, postId, workflowId) {
@@ -502,7 +502,7 @@ var DoorayApiClient = class {
502
502
  json: { workflowId }
503
503
  }).json();
504
504
  } catch (e) {
505
- return toDoorayCliError(e);
505
+ return await toDoorayCliError(e);
506
506
  }
507
507
  }
508
508
  async setPostParent(projectId, postId, parentPostId) {
@@ -511,7 +511,7 @@ var DoorayApiClient = class {
511
511
  json: { parentPostId }
512
512
  }).json();
513
513
  } catch (e) {
514
- return toDoorayCliError(e);
514
+ return await toDoorayCliError(e);
515
515
  }
516
516
  }
517
517
  // ─── Post Comments ──────────────────────────────────
@@ -525,35 +525,35 @@ var DoorayApiClient = class {
525
525
  }
526
526
  }).json();
527
527
  } catch (e) {
528
- return toDoorayCliError(e);
528
+ return await toDoorayCliError(e);
529
529
  }
530
530
  }
531
531
  async getPostComment(projectId, postId, logId) {
532
532
  try {
533
533
  return await this.api.get(`project/v1/projects/${projectId}/posts/${postId}/logs/${logId}`).json();
534
534
  } catch (e) {
535
- return toDoorayCliError(e);
535
+ return await toDoorayCliError(e);
536
536
  }
537
537
  }
538
538
  async createPostComment(projectId, postId, body) {
539
539
  try {
540
540
  return await this.api.post(`project/v1/projects/${projectId}/posts/${postId}/logs`, { json: body }).json();
541
541
  } catch (e) {
542
- return toDoorayCliError(e);
542
+ return await toDoorayCliError(e);
543
543
  }
544
544
  }
545
545
  async updatePostComment(projectId, postId, logId, body) {
546
546
  try {
547
547
  return await this.api.put(`project/v1/projects/${projectId}/posts/${postId}/logs/${logId}`, { json: body }).json();
548
548
  } catch (e) {
549
- return toDoorayCliError(e);
549
+ return await toDoorayCliError(e);
550
550
  }
551
551
  }
552
552
  async deletePostComment(projectId, postId, logId) {
553
553
  try {
554
554
  return await this.api.delete(`project/v1/projects/${projectId}/posts/${postId}/logs/${logId}`).json();
555
555
  } catch (e) {
556
- return toDoorayCliError(e);
556
+ return await toDoorayCliError(e);
557
557
  }
558
558
  }
559
559
  // ─── Members ────────────────────────────────────────
@@ -567,14 +567,14 @@ var DoorayApiClient = class {
567
567
  }
568
568
  }).json();
569
569
  } catch (e) {
570
- return toDoorayCliError(e);
570
+ return await toDoorayCliError(e);
571
571
  }
572
572
  }
573
573
  async getMemberDetail(memberId) {
574
574
  try {
575
575
  return await this.api.get(`common/v1/members/${memberId}`).json();
576
576
  } catch (e) {
577
- return toDoorayCliError(e);
577
+ return await toDoorayCliError(e);
578
578
  }
579
579
  }
580
580
  async searchMembers(params) {
@@ -591,7 +591,7 @@ var DoorayApiClient = class {
591
591
  }
592
592
  }).json();
593
593
  } catch (e) {
594
- return toDoorayCliError(e);
594
+ return await toDoorayCliError(e);
595
595
  }
596
596
  }
597
597
  // ─── Workflows ──────────────────────────────────────
@@ -599,7 +599,7 @@ var DoorayApiClient = class {
599
599
  try {
600
600
  return await this.api.get(`project/v1/projects/${projectId}/workflows`).json();
601
601
  } catch (e) {
602
- return toDoorayCliError(e);
602
+ return await toDoorayCliError(e);
603
603
  }
604
604
  }
605
605
  // ─── Tags ───────────────────────────────────────────
@@ -612,7 +612,7 @@ var DoorayApiClient = class {
612
612
  }
613
613
  }).json();
614
614
  } catch (e) {
615
- return toDoorayCliError(e);
615
+ return await toDoorayCliError(e);
616
616
  }
617
617
  }
618
618
  // ─── Member Groups ──────────────────────────────────
@@ -625,7 +625,7 @@ var DoorayApiClient = class {
625
625
  }
626
626
  }).json();
627
627
  } catch (e) {
628
- return toDoorayCliError(e);
628
+ return await toDoorayCliError(e);
629
629
  }
630
630
  }
631
631
  // ─── Milestones ─────────────────────────────────────
@@ -638,7 +638,7 @@ var DoorayApiClient = class {
638
638
  }
639
639
  }).json();
640
640
  } catch (e) {
641
- return toDoorayCliError(e);
641
+ return await toDoorayCliError(e);
642
642
  }
643
643
  }
644
644
  // ─── Wiki ───────────────────────────────────────────
@@ -651,7 +651,7 @@ var DoorayApiClient = class {
651
651
  }
652
652
  }).json();
653
653
  } catch (e) {
654
- return toDoorayCliError(e);
654
+ return await toDoorayCliError(e);
655
655
  }
656
656
  }
657
657
  async getWikiPages(wikiId, parentPageId) {
@@ -662,42 +662,42 @@ var DoorayApiClient = class {
662
662
  }
663
663
  }).json();
664
664
  } catch (e) {
665
- return toDoorayCliError(e);
665
+ return await toDoorayCliError(e);
666
666
  }
667
667
  }
668
668
  async getWikiPage(wikiId, pageId) {
669
669
  try {
670
670
  return await this.api.get(`wiki/v1/wikis/${wikiId}/pages/${pageId}`).json();
671
671
  } catch (e) {
672
- return toDoorayCliError(e);
672
+ return await toDoorayCliError(e);
673
673
  }
674
674
  }
675
675
  async createWikiPage(wikiId, body) {
676
676
  try {
677
677
  return await this.api.post(`wiki/v1/wikis/${wikiId}/pages`, { json: body }).json();
678
678
  } catch (e) {
679
- return toDoorayCliError(e);
679
+ return await toDoorayCliError(e);
680
680
  }
681
681
  }
682
682
  async updateWikiPage(wikiId, pageId, body) {
683
683
  try {
684
684
  return await this.api.put(`wiki/v1/wikis/${wikiId}/pages/${pageId}`, { json: body }).json();
685
685
  } catch (e) {
686
- return toDoorayCliError(e);
686
+ return await toDoorayCliError(e);
687
687
  }
688
688
  }
689
689
  async updateWikiPageTitle(wikiId, pageId, body) {
690
690
  try {
691
691
  return await this.api.put(`wiki/v1/wikis/${wikiId}/pages/${pageId}/title`, { json: body }).json();
692
692
  } catch (e) {
693
- return toDoorayCliError(e);
693
+ return await toDoorayCliError(e);
694
694
  }
695
695
  }
696
696
  async updateWikiPageContent(wikiId, pageId, body) {
697
697
  try {
698
698
  return await this.api.put(`wiki/v1/wikis/${wikiId}/pages/${pageId}/content`, { json: body }).json();
699
699
  } catch (e) {
700
- return toDoorayCliError(e);
700
+ return await toDoorayCliError(e);
701
701
  }
702
702
  }
703
703
  // ─── Post Files ─────────────────────────────────────
@@ -705,7 +705,7 @@ var DoorayApiClient = class {
705
705
  try {
706
706
  return await this.api.get(`project/v1/projects/${projectId}/posts/${postId}/files`).json();
707
707
  } catch (e) {
708
- return toDoorayCliError(e);
708
+ return await toDoorayCliError(e);
709
709
  }
710
710
  }
711
711
  async getPostFileMeta(projectId, postId, fileId) {
@@ -714,7 +714,7 @@ var DoorayApiClient = class {
714
714
  searchParams: { media: "meta" }
715
715
  }).json();
716
716
  } catch (e) {
717
- return toDoorayCliError(e);
717
+ return await toDoorayCliError(e);
718
718
  }
719
719
  }
720
720
  async downloadPostFile(projectId, postId, fileId) {
@@ -744,7 +744,7 @@ var DoorayApiClient = class {
744
744
  return { buffer, fileName };
745
745
  } catch (e) {
746
746
  if (e instanceof DoorayCliError) throw e;
747
- return toDoorayCliError(e);
747
+ return await toDoorayCliError(e);
748
748
  }
749
749
  }
750
750
  async uploadPostFile(projectId, postId, filePath) {
@@ -781,14 +781,14 @@ var DoorayApiClient = class {
781
781
  return await res.json();
782
782
  } catch (e) {
783
783
  if (e instanceof DoorayCliError) throw e;
784
- return toDoorayCliError(e);
784
+ return await toDoorayCliError(e);
785
785
  }
786
786
  }
787
787
  async deletePostFile(projectId, postId, fileId) {
788
788
  try {
789
789
  return await this.api.delete(`project/v1/projects/${projectId}/posts/${postId}/files/${fileId}`).json();
790
790
  } catch (e) {
791
- return toDoorayCliError(e);
791
+ return await toDoorayCliError(e);
792
792
  }
793
793
  }
794
794
  };
@@ -1743,6 +1743,130 @@ var postGetCommand = new import_commander12.Command("get").description("\uC5C5\u
1743
1743
  // src/commands/post/edit.ts
1744
1744
  var import_commander13 = require("commander");
1745
1745
 
1746
+ // src/utils/mention.ts
1747
+ function buildMemberMention(m, me) {
1748
+ const title = m.memberId === me.id ? "me" : "member";
1749
+ return `[@${m.name}](dooray://${me.orgId}/members/${m.memberId} "${title}")`;
1750
+ }
1751
+ function buildGroupMention(g, me) {
1752
+ return `[@${g.projectCode}/${g.code}](dooray://${me.orgId}/member-groups/${g.groupId})`;
1753
+ }
1754
+ function prependMentions(body, members, groups, me) {
1755
+ const parts = [];
1756
+ for (const m of members) parts.push(buildMemberMention(m, me));
1757
+ for (const g of groups) parts.push(buildGroupMention(g, me));
1758
+ if (parts.length === 0) return body;
1759
+ return parts.join(" ") + " " + body;
1760
+ }
1761
+
1762
+ // src/utils/task-link.ts
1763
+ function escapeLinkText(text) {
1764
+ return text.replace(/&/g, "&").replace(/\[/g, "[").replace(/\]/g, "]").replace(/—/g, "—");
1765
+ }
1766
+ function buildTaskLink(t, me) {
1767
+ const text = `${t.projectCode}/${t.number} ${escapeLinkText(t.subject)}`;
1768
+ const url = `dooray://${me.orgId}/tasks/${t.postId}`;
1769
+ if (t.workflowClass) {
1770
+ const safeClass = t.workflowClass.replace(/"/g, """);
1771
+ return `[${text}](${url} "${safeClass}")`;
1772
+ }
1773
+ return `[${text}](${url})`;
1774
+ }
1775
+ function parseLinkRef(ref) {
1776
+ if (/^[0-9]{15,}$/.test(ref)) return { idOpt: ref };
1777
+ if (ref.includes("/")) {
1778
+ const [p, n] = ref.split("/");
1779
+ if (!p || !n) {
1780
+ throw new DoorayCliError(
1781
+ `--link-task \uD615\uC2DD\uC774 \uC62C\uBC14\uB974\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4: "${ref}". <project>/<number> \uB610\uB294 postId\uB97C \uC785\uB825\uD558\uC138\uC694.`,
1782
+ EXIT_PARAM_ERROR
1783
+ );
1784
+ }
1785
+ return { projectArg: p, postNumberArg: n };
1786
+ }
1787
+ throw new DoorayCliError(
1788
+ `--link-task \uD615\uC2DD\uC774 \uC62C\uBC14\uB974\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4: "${ref}". <project>/<number> \uB610\uB294 postId\uB97C \uC785\uB825\uD558\uC138\uC694.`,
1789
+ EXIT_PARAM_ERROR
1790
+ );
1791
+ }
1792
+ function appendTaskLinks(body, links, me) {
1793
+ if (links.length === 0) return body;
1794
+ const rendered = links.map((l) => buildTaskLink(l, me)).join("\n");
1795
+ if (!body) return rendered;
1796
+ return body.replace(/\n*$/, "") + "\n\n" + rendered;
1797
+ }
1798
+
1799
+ // src/resolvers/task-link.ts
1800
+ async function resolveTaskLinks(client, linkInputs) {
1801
+ return Promise.all(
1802
+ linkInputs.map(async (ref) => {
1803
+ const { projectArg, postNumberArg, idOpt } = parseLinkRef(ref);
1804
+ const { projectId, postId, projectCode, postNumber } = await resolvePostInput(
1805
+ client,
1806
+ { projectArg, postNumberArg, idOpt }
1807
+ );
1808
+ const detail = await client.getPost(projectId, postId);
1809
+ return {
1810
+ projectCode,
1811
+ number: postNumber,
1812
+ postId,
1813
+ subject: detail.result.subject,
1814
+ workflowClass: detail.result.workflowClass
1815
+ };
1816
+ })
1817
+ );
1818
+ }
1819
+
1820
+ // src/resolvers/post-users.ts
1821
+ function parseUserSpec(memberIds, groupIds) {
1822
+ const users = [];
1823
+ for (const id of memberIds) {
1824
+ users.push({ type: "member", member: { organizationMemberId: id } });
1825
+ }
1826
+ for (const gid of groupIds) {
1827
+ users.push({ type: "group", group: { projectMemberGroupId: gid, members: [] } });
1828
+ }
1829
+ return users;
1830
+ }
1831
+ function mergeUsers(existing, additions, clear) {
1832
+ const base = clear ? [] : existing;
1833
+ const seen = /* @__PURE__ */ new Set();
1834
+ const result = [];
1835
+ for (const u of [...base, ...additions]) {
1836
+ const key = userKey(u);
1837
+ if (key && seen.has(key)) continue;
1838
+ if (key) seen.add(key);
1839
+ result.push(u);
1840
+ }
1841
+ return result;
1842
+ }
1843
+ function userKey(u) {
1844
+ if (u.member?.organizationMemberId) return `m:${u.member.organizationMemberId}`;
1845
+ if (u.group?.projectMemberGroupId) return `g:${u.group.projectMemberGroupId}`;
1846
+ if (u.emailUser?.emailAddress) return `e:${u.emailUser.emailAddress}`;
1847
+ return null;
1848
+ }
1849
+ async function resolveUserAdditions(client, projectId, names, groupCodes) {
1850
+ const memberIds = await Promise.all(
1851
+ names.map(
1852
+ (n) => resolveMember(client, projectId, n).catch((err) => {
1853
+ const msg = err instanceof Error ? err.message : String(err);
1854
+ throw new Error(`\uBA64\uBC84 '${n}' \uC870\uD68C \uC2E4\uD328: ${msg}`);
1855
+ })
1856
+ )
1857
+ );
1858
+ const groups = await Promise.all(
1859
+ groupCodes.map(
1860
+ (c) => resolveMemberGroup(client, projectId, c).catch((err) => {
1861
+ const msg = err instanceof Error ? err.message : String(err);
1862
+ throw new Error(`\uADF8\uB8F9 '${c}' \uC870\uD68C \uC2E4\uD328: ${msg}`);
1863
+ })
1864
+ )
1865
+ );
1866
+ const groupIds = groups.map((g) => g.id);
1867
+ return parseUserSpec(memberIds, groupIds);
1868
+ }
1869
+
1746
1870
  // src/editor/index.ts
1747
1871
  var import_node_child_process = require("child_process");
1748
1872
  var import_promises6 = __toESM(require("fs/promises"));
@@ -1789,11 +1913,11 @@ function openInEditor(content) {
1789
1913
  }
1790
1914
  });
1791
1915
  }
1792
- function memberIdToEmail(memberId, members) {
1916
+ function memberIdToName(memberId, members) {
1793
1917
  const member = members.find(
1794
1918
  (m) => m.organizationMemberId === memberId
1795
1919
  );
1796
- return member?.emailAddress ?? memberId;
1920
+ return member?.name ?? memberId;
1797
1921
  }
1798
1922
  function serializePostFrontmatter(post, members) {
1799
1923
  const frontmatter = {
@@ -1801,12 +1925,12 @@ function serializePostFrontmatter(post, members) {
1801
1925
  priority: post.priority,
1802
1926
  due_date: post.dueDate ?? null,
1803
1927
  to: post.users.to.map((u) => {
1804
- if (u.member) return memberIdToEmail(u.member.organizationMemberId, members);
1928
+ if (u.member) return memberIdToName(u.member.organizationMemberId, members);
1805
1929
  if (u.emailUser) return u.emailUser.emailAddress;
1806
1930
  return "";
1807
1931
  }).filter(Boolean),
1808
1932
  cc: post.users.cc.map((u) => {
1809
- if (u.member) return memberIdToEmail(u.member.organizationMemberId, members);
1933
+ if (u.member) return memberIdToName(u.member.organizationMemberId, members);
1810
1934
  if (u.emailUser) return u.emailUser.emailAddress;
1811
1935
  return "";
1812
1936
  }).filter(Boolean)
@@ -1902,20 +2026,92 @@ async function readStdin() {
1902
2026
  return Buffer.concat(chunks).toString("utf-8");
1903
2027
  }
1904
2028
 
2029
+ // src/utils/attachment-check.ts
2030
+ var import_node_readline = __toESM(require("readline"));
2031
+ function extractAttachmentFileIds(body) {
2032
+ const ids = /* @__PURE__ */ new Set();
2033
+ const re = /!?\[[^\]]*\]\(\/files\/([^\s)?#]+)/g;
2034
+ let m;
2035
+ while ((m = re.exec(body)) !== null) {
2036
+ ids.add(m[1]);
2037
+ }
2038
+ return ids;
2039
+ }
2040
+ function findDroppedAttachments(oldBody, newBody, attachments) {
2041
+ const oldIds = extractAttachmentFileIds(oldBody);
2042
+ const newIds = extractAttachmentFileIds(newBody);
2043
+ const dropped = [];
2044
+ for (const att of attachments) {
2045
+ if (oldIds.has(att.id) && !newIds.has(att.id)) {
2046
+ dropped.push({ id: att.id, name: att.name });
2047
+ }
2048
+ }
2049
+ return dropped;
2050
+ }
2051
+ function sanitizeFileName(name) {
2052
+ return name.replace(/[\x00-\x1F\x7F]/g, "?");
2053
+ }
2054
+ function printDroppedWarning(dropped) {
2055
+ process.stderr.write(`\u26A0 \uC0C8 \uBCF8\uBB38\uC5D0\uC11C ${dropped.length}\uAC1C attachment reference \uAC00 \uBE60\uC9D1\uB2C8\uB2E4:
2056
+ `);
2057
+ for (const a of dropped) {
2058
+ const safe = a.name ? sanitizeFileName(a.name) : void 0;
2059
+ process.stderr.write(` - /files/${a.id} ${safe ? "\u2190 " + safe : ""}
2060
+ `);
2061
+ }
2062
+ process.stderr.write(` (attachment \uC790\uCCB4\uB294 \uC11C\uBC84\uC5D0 \uB0A8\uC9C0\uB9CC \uBCF8\uBB38\uC5D0\uC11C \uC0AC\uB77C\uC838 \uBCF4\uC785\uB2C8\uB2E4.)
2063
+ `);
2064
+ }
2065
+ async function confirmDropped() {
2066
+ const rl = import_node_readline.default.createInterface({ input: process.stdin, output: process.stderr });
2067
+ const answer = await new Promise((resolve) => {
2068
+ rl.question("\uACC4\uC18D \uC9C4\uD589\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C? (y/N) ", resolve);
2069
+ });
2070
+ rl.close();
2071
+ return /^y(es)?$/i.test(answer.trim());
2072
+ }
2073
+ async function checkAndGuardDropped(oldBody, newBody, attachments, noConfirm) {
2074
+ const dropped = findDroppedAttachments(oldBody, newBody, attachments);
2075
+ if (dropped.length === 0) return;
2076
+ printDroppedWarning(dropped);
2077
+ if (noConfirm) {
2078
+ process.stderr.write(` --no-confirm \uD50C\uB798\uADF8\uB85C \uADF8\uB300\uB85C \uC9C4\uD589\uD569\uB2C8\uB2E4.
2079
+ `);
2080
+ return;
2081
+ }
2082
+ if (!process.stdin.isTTY) {
2083
+ throw new DoorayCliError(
2084
+ "non-TTY \uD658\uACBD\uC5D0\uC11C \uB204\uB77D attachment \uAC00 \uAC10\uC9C0\uB418\uC5C8\uC2B5\uB2C8\uB2E4. \uC758\uB3C4\uD55C \uBCC0\uACBD\uC774\uBA74 --no-confirm \uD50C\uB798\uADF8\uB85C \uB2E4\uC2DC \uC2E4\uD589\uD558\uC138\uC694.",
2085
+ EXIT_PARAM_ERROR
2086
+ );
2087
+ }
2088
+ const confirmed = await confirmDropped();
2089
+ if (!confirmed) {
2090
+ throw new DoorayCliError("\uCDE8\uC18C\uB418\uC5C8\uC2B5\uB2C8\uB2E4.", EXIT_PARAM_ERROR);
2091
+ }
2092
+ }
2093
+
1905
2094
  // src/commands/post/edit.ts
1906
- async function resolveUsers(client, projectId, emails) {
2095
+ async function resolveUsers(client, projectId, names) {
1907
2096
  const users = [];
1908
- for (const email of emails) {
1909
- const memberId = await resolveMember(client, projectId, email);
2097
+ for (const name of names) {
2098
+ const memberId = await resolveMember(client, projectId, name);
1910
2099
  users.push({ type: "member", member: { organizationMemberId: memberId } });
1911
2100
  }
1912
2101
  return users;
1913
2102
  }
1914
- var postEditCommand = new import_commander13.Command("edit").description("\uC5C5\uBB34 \uC218\uC815 ($EDITOR \uB610\uB294 --title/--body \uC635\uC158)").argument("[project]", "\uD504\uB85C\uC81D\uD2B8 \uCF54\uB4DC (\uB610\uB294 \uCCAB \uC778\uC790\uC5D0 Dooray URL)").argument("[post-number]", "\uC5C5\uBB34 \uBC88\uD638 (project\uC640 \uD568\uAED8 \uC0AC\uC6A9)").option("--id <postId>", "Dooray post ID (project/post-number \uB300\uC2E0)").option("--url <url>", "Dooray \uC5C5\uBB34 URL (project/post-number \uB300\uC2E0)").option("--title <title>", "\uC81C\uBAA9 \uBCC0\uACBD (non-interactive)").option("--subject <subject>", "--title\uC758 deprecated alias").option("--body <text>", "\uBCF8\uBB38 \uBCC0\uACBD (- \uC785\uB825 \uC2DC stdin, non-interactive)").option("--body-file <path>", "\uBCF8\uBB38 \uD30C\uC77C \uACBD\uB85C (- \uC785\uB825 \uC2DC stdin, non-interactive)").action(async (project, postNumberStr, opts) => {
2103
+ var postEditCommand = new import_commander13.Command("edit").description("\uC5C5\uBB34 \uC218\uC815 ($EDITOR \uB610\uB294 --title/--body \uC635\uC158)").argument("[project]", "\uD504\uB85C\uC81D\uD2B8 \uCF54\uB4DC (\uB610\uB294 \uCCAB \uC778\uC790\uC5D0 Dooray URL)").argument("[post-number]", "\uC5C5\uBB34 \uBC88\uD638 (project\uC640 \uD568\uAED8 \uC0AC\uC6A9)").option("--id <postId>", "Dooray post ID (project/post-number \uB300\uC2E0)").option("--url <url>", "Dooray \uC5C5\uBB34 URL (project/post-number \uB300\uC2E0)").option("--title <title>", "\uC81C\uBAA9 \uBCC0\uACBD (non-interactive)").option("--subject <subject>", "--title\uC758 deprecated alias").option("--body <text>", "\uBCF8\uBB38 \uBCC0\uACBD (- \uC785\uB825 \uC2DC stdin, non-interactive)").option("--body-file <path>", "\uBCF8\uBB38 \uD30C\uC77C \uACBD\uB85C (- \uC785\uB825 \uC2DC stdin, non-interactive)").option("--mention <name>", "\uBA64\uBC84 \uBA58\uC158 (\uBC18\uBCF5 \uAC00\uB2A5, \uC774\uB984 \uBD80\uBD84\uC77C\uCE58)", (v, prev) => [...prev, v], []).option("--mention-group <code>", "\uADF8\uB8F9 \uBA58\uC158 (\uBC18\uBCF5 \uAC00\uB2A5, code \uBD80\uBD84\uC77C\uCE58)", (v, prev) => [...prev, v], []).option("--link-task <ref>", "\uB2E4\uB978 \uC5C5\uBB34 \uB9C1\uD06C \uCD94\uAC00 (<project>/<number> \uB610\uB294 postId, \uBC18\uBCF5 \uAC00\uB2A5)", (v, prev) => [...prev, v], []).option("--cc <name>", "\uCC38\uC870\uC790(cc) \uBA64\uBC84 \uCD94\uAC00 (\uBC18\uBCF5 \uAC00\uB2A5, \uC774\uB984 \uBD80\uBD84\uC77C\uCE58)", (v, prev) => [...prev, v], []).option("--cc-group <code>", "\uCC38\uC870\uC790(cc) \uADF8\uB8F9 \uCD94\uAC00 (\uBC18\uBCF5 \uAC00\uB2A5, \uADF8\uB8F9 \uCF54\uB4DC \uBD80\uBD84\uC77C\uCE58)", (v, prev) => [...prev, v], []).option("--cc-clear", "\uAE30\uC874 \uCC38\uC870\uC790 \uC804\uBD80 \uC81C\uAC70 \uD6C4 \uC2E0\uADDC\uB9CC \uC801\uC6A9 (--cc/--cc-group \uC640 \uC870\uD569 \uAC00\uB2A5)").option("--to <name>", "\uB2F4\uB2F9\uC790(to) \uBA64\uBC84 \uCD94\uAC00 (\uBC18\uBCF5 \uAC00\uB2A5, \uC774\uB984 \uBD80\uBD84\uC77C\uCE58)", (v, prev) => [...prev, v], []).option("--to-group <code>", "\uB2F4\uB2F9\uC790(to) \uADF8\uB8F9 \uCD94\uAC00 (\uBC18\uBCF5 \uAC00\uB2A5, \uADF8\uB8F9 \uCF54\uB4DC \uBD80\uBD84\uC77C\uCE58)", (v, prev) => [...prev, v], []).option("--to-clear", "\uAE30\uC874 \uB2F4\uB2F9\uC790 \uC804\uBD80 \uC81C\uAC70 \uD6C4 \uC2E0\uADDC\uB9CC \uC801\uC6A9").option("--dry-run", "API \uD638\uCD9C \uC5C6\uC774 \uD569\uC131\uB41C \uBCF8\uBB38\uB9CC stdout \uCD9C\uB825 (mention/link-task \uC801\uC6A9 \uACB0\uACFC \uBBF8\uB9AC\uBCF4\uAE30)").option("--no-confirm", "\uB204\uB77D attachment \uACBD\uACE0 \uC2DC confirm \uC5C6\uC774 \uC9C4\uD589 (\uC790\uB3D9\uD654\uC6A9)").action(async (project, postNumberStr, opts) => {
1915
2104
  const config = await getConfigOrThrow();
1916
2105
  const client = new DoorayApiClient(config.apiKey, config.baseUrl);
2106
+ const mentionInputs = (opts.mention ?? []).filter((s) => s.length > 0);
2107
+ const groupInputs = (opts.mentionGroup ?? []).filter((s) => s.length > 0);
2108
+ const linkInputs = (opts.linkTask ?? []).filter((s) => s.length > 0);
2109
+ const ccNames = (opts.cc ?? []).filter((s) => s.length > 0);
2110
+ const ccGroups = (opts.ccGroup ?? []).filter((s) => s.length > 0);
2111
+ const toNames = (opts.to ?? []).filter((s) => s.length > 0);
2112
+ const toGroups = (opts.toGroup ?? []).filter((s) => s.length > 0);
1917
2113
  startSpinner("\uC5C5\uBB34 \uC870\uD68C \uC911...");
1918
- const { projectId, postId, postNumber } = await resolvePostInput(client, {
2114
+ const { projectId, postId, postNumber, projectCode } = await resolvePostInput(client, {
1919
2115
  projectArg: project,
1920
2116
  postNumberArg: postNumberStr,
1921
2117
  idOpt: opts.id,
@@ -1933,20 +2129,68 @@ var postEditCommand = new import_commander13.Command("edit").description("\uC5C5
1933
2129
  }
1934
2130
  const nonInteractive = title || opts.body || opts.bodyFile;
1935
2131
  if (nonInteractive) {
1936
- const newBody = await readBodyInputOrNull(opts);
1937
- startSpinner("\uC5C5\uBB34 \uC218\uC815 \uC911...");
1938
- const toUsers = post.users.to.map((u) => ({
2132
+ let newBody = await readBodyInputOrNull(opts);
2133
+ if (newBody != null && !opts.dryRun) {
2134
+ const attachments = (post.files ?? []).map((f) => ({ id: f.id, name: f.name }));
2135
+ await checkAndGuardDropped(post.body.content, newBody, attachments, !opts.confirm);
2136
+ }
2137
+ if (mentionInputs.length > 0 || groupInputs.length > 0) {
2138
+ const effectiveBody = newBody ?? post.body.content;
2139
+ const me = await ensureMe(client);
2140
+ const memberIds = await Promise.all(
2141
+ mentionInputs.map((name) => resolveMember(client, projectId, name))
2142
+ );
2143
+ const nameMap = await buildMemberNameMap(client, projectId);
2144
+ const members2 = memberIds.map((memberId) => ({
2145
+ memberId,
2146
+ name: nameMap.get(memberId) ?? memberId
2147
+ }));
2148
+ const groups = await Promise.all(
2149
+ groupInputs.map(async (code) => {
2150
+ const g = await resolveMemberGroup(client, projectId, code);
2151
+ return { groupId: g.id, code: g.code, projectCode };
2152
+ })
2153
+ );
2154
+ newBody = prependMentions(effectiveBody, members2, groups, me);
2155
+ }
2156
+ if (linkInputs.length > 0) {
2157
+ const effectiveBody = newBody ?? post.body.content;
2158
+ const me = await ensureMe(client);
2159
+ const links = await resolveTaskLinks(client, linkInputs);
2160
+ newBody = appendTaskLinks(effectiveBody, links, me);
2161
+ }
2162
+ let toUsers = post.users.to.map((u) => ({
1939
2163
  type: u.type,
1940
2164
  member: u.member,
1941
2165
  emailUser: u.emailUser,
1942
2166
  group: u.group
1943
2167
  }));
1944
- const ccUsers = post.users.cc.map((u) => ({
2168
+ let ccUsers = post.users.cc.map((u) => ({
1945
2169
  type: u.type,
1946
2170
  member: u.member,
1947
2171
  emailUser: u.emailUser,
1948
2172
  group: u.group
1949
2173
  }));
2174
+ if (toNames.length > 0 || toGroups.length > 0 || opts.toClear) {
2175
+ const additions = await resolveUserAdditions(client, projectId, toNames, toGroups);
2176
+ toUsers = mergeUsers(toUsers, additions, !!opts.toClear);
2177
+ }
2178
+ if (ccNames.length > 0 || ccGroups.length > 0 || opts.ccClear) {
2179
+ const additions = await resolveUserAdditions(client, projectId, ccNames, ccGroups);
2180
+ ccUsers = mergeUsers(ccUsers, additions, !!opts.ccClear);
2181
+ }
2182
+ if (opts.dryRun) {
2183
+ stopSpinner(false);
2184
+ const globalOpts = postEditCommand.optsWithGlobals();
2185
+ const previewBody = newBody ?? post.body.content;
2186
+ if (globalOpts.json) {
2187
+ process.stdout.write(JSON.stringify({ body: previewBody, users: { to: toUsers, cc: ccUsers } }) + "\n");
2188
+ } else {
2189
+ process.stdout.write(previewBody + "\n");
2190
+ }
2191
+ return;
2192
+ }
2193
+ startSpinner("\uC5C5\uBB34 \uC218\uC815 \uC911...");
1950
2194
  await client.updatePost(projectId, postId, {
1951
2195
  subject: title ?? post.subject,
1952
2196
  body: {
@@ -1960,6 +2204,21 @@ var postEditCommand = new import_commander13.Command("edit").description("\uC5C5
1960
2204
  });
1961
2205
  stopSpinner(true, "\uC5C5\uBB34 \uC218\uC815 \uC644\uB8CC");
1962
2206
  } else {
2207
+ if (mentionInputs.length > 0 || groupInputs.length > 0) {
2208
+ process.stderr.write(
2209
+ "\u26A0 --mention/--mention-group \uC740 --title/--body \uC640 \uD568\uAED8 \uC0AC\uC6A9 \uC2DC\uC5D0\uB9CC \uC801\uC6A9\uB429\uB2C8\uB2E4.\n"
2210
+ );
2211
+ }
2212
+ if (linkInputs.length > 0) {
2213
+ process.stderr.write(
2214
+ "\u26A0 --link-task \uB294 --title/--body \uC640 \uD568\uAED8 \uC0AC\uC6A9 \uC2DC\uC5D0\uB9CC \uC801\uC6A9\uB429\uB2C8\uB2E4.\n"
2215
+ );
2216
+ }
2217
+ if (ccNames.length > 0 || ccGroups.length > 0 || opts.ccClear || toNames.length > 0 || toGroups.length > 0 || opts.toClear) {
2218
+ process.stderr.write(
2219
+ "\u26A0 --cc/--cc-group/--cc-clear/--to/--to-group/--to-clear \uB294 --title/--body \uC640 \uD568\uAED8 \uC0AC\uC6A9 \uC2DC\uC5D0\uB9CC \uC801\uC6A9\uB429\uB2C8\uB2E4.\n"
2220
+ );
2221
+ }
1963
2222
  const original = serializePostFrontmatter(post, members);
1964
2223
  const edited = await openInEditor(original);
1965
2224
  if (original === edited) {
@@ -1967,6 +2226,8 @@ var postEditCommand = new import_commander13.Command("edit").description("\uC5C5
1967
2226
  return;
1968
2227
  }
1969
2228
  const parsed = parsePostFrontmatter(edited);
2229
+ const attachmentsInteractive = (post.files ?? []).map((f) => ({ id: f.id, name: f.name }));
2230
+ await checkAndGuardDropped(post.body.content, parsed.body, attachmentsInteractive, !opts.confirm);
1970
2231
  startSpinner("\uC5C5\uBB34 \uC218\uC815 \uC911...");
1971
2232
  const toUsers = await resolveUsers(client, projectId, parsed.to);
1972
2233
  const ccUsers = await resolveUsers(client, projectId, parsed.cc);
@@ -2040,7 +2301,7 @@ async function resolveUsers2(client, projectId, inputs) {
2040
2301
  }
2041
2302
  return users;
2042
2303
  }
2043
- var postCreateCommand = new import_commander14.Command("create").description("\uC5C5\uBB34 \uC0DD\uC131").argument("<project>", "\uD504\uB85C\uC81D\uD2B8 \uCF54\uB4DC \uB610\uB294 ID").option("--title <title>", "\uC5C5\uBB34 \uC81C\uBAA9").option("--subject <subject>", "--title\uC758 deprecated alias").option("--to <members...>", "\uB2F4\uB2F9\uC790 (\uC774\uB984 \uB610\uB294 \uC774\uBA54\uC77C, \uC5EC\uB7EC \uBA85 \uAC00\uB2A5)").option("--cc <members...>", "\uCC38\uC870\uC790 (\uC774\uB984 \uB610\uB294 \uC774\uBA54\uC77C, \uC5EC\uB7EC \uBA85 \uAC00\uB2A5)").option("--body <text>", "\uBCF8\uBB38 \uD14D\uC2A4\uD2B8 (- \uC785\uB825 \uC2DC stdin\uC5D0\uC11C \uC77D\uAE30)").option("--body-file <path>", "\uBCF8\uBB38 \uD30C\uC77C \uACBD\uB85C (- \uC785\uB825 \uC2DC stdin\uC5D0\uC11C \uC77D\uAE30)").option("--priority <level>", "\uC6B0\uC120\uC21C\uC704 (highest, high, normal, low, lowest)", "normal").option("--due-date <date>", "\uB9C8\uAC10\uC77C (ISO 8601 \uD615\uC2DD)").option("--tag <name>", "\uD0DC\uADF8 \uC774\uB984 (\uBC18\uBCF5 \uAC00\uB2A5)", (value, prev) => [...prev, value], []).option("--parent <ref>", "\uBD80\uBAA8 \uC5C5\uBB34 (project/number \uB610\uB294 postId)").option("--workflow <name>", "\uCD08\uAE30 \uC6CC\uD06C\uD50C\uB85C\uC6B0 \uC774\uB984 \uB610\uB294 class").option("--milestone <name>", "\uB9C8\uC77C\uC2A4\uD1A4 \uC774\uB984").action(async (project, opts) => {
2304
+ var postCreateCommand = new import_commander14.Command("create").description("\uC5C5\uBB34 \uC0DD\uC131").argument("<project>", "\uD504\uB85C\uC81D\uD2B8 \uCF54\uB4DC \uB610\uB294 ID").option("--title <title>", "\uC5C5\uBB34 \uC81C\uBAA9").option("--subject <subject>", "--title\uC758 deprecated alias").option("--to <members...>", "\uB2F4\uB2F9\uC790 (\uC774\uB984 \uB610\uB294 \uC774\uBA54\uC77C, \uC5EC\uB7EC \uBA85 \uAC00\uB2A5)").option("--to-group <code>", "\uB2F4\uB2F9\uC790(to) \uADF8\uB8F9 \uCD94\uAC00 (\uBC18\uBCF5 \uAC00\uB2A5, \uADF8\uB8F9 \uCF54\uB4DC \uBD80\uBD84\uC77C\uCE58)", (v, prev) => [...prev, v], []).option("--cc <members...>", "\uCC38\uC870\uC790 (\uC774\uB984 \uB610\uB294 \uC774\uBA54\uC77C, \uC5EC\uB7EC \uBA85 \uAC00\uB2A5)").option("--cc-group <code>", "\uCC38\uC870\uC790(cc) \uADF8\uB8F9 \uCD94\uAC00 (\uBC18\uBCF5 \uAC00\uB2A5, \uADF8\uB8F9 \uCF54\uB4DC \uBD80\uBD84\uC77C\uCE58)", (v, prev) => [...prev, v], []).option("--body <text>", "\uBCF8\uBB38 \uD14D\uC2A4\uD2B8 (- \uC785\uB825 \uC2DC stdin\uC5D0\uC11C \uC77D\uAE30)").option("--body-file <path>", "\uBCF8\uBB38 \uD30C\uC77C \uACBD\uB85C (- \uC785\uB825 \uC2DC stdin\uC5D0\uC11C \uC77D\uAE30)").option("--priority <level>", "\uC6B0\uC120\uC21C\uC704 (highest, high, normal, low, lowest)", "normal").option("--due-date <date>", "\uB9C8\uAC10\uC77C (ISO 8601 \uD615\uC2DD)").option("--tag <name>", "\uD0DC\uADF8 \uC774\uB984 (\uBC18\uBCF5 \uAC00\uB2A5)", (value, prev) => [...prev, value], []).option("--mention <name>", "\uBA64\uBC84 \uBA58\uC158 (\uBC18\uBCF5 \uAC00\uB2A5, \uC774\uB984 \uBD80\uBD84\uC77C\uCE58)", (v, prev) => [...prev, v], []).option("--mention-group <code>", "\uADF8\uB8F9 \uBA58\uC158 (\uBC18\uBCF5 \uAC00\uB2A5, code \uBD80\uBD84\uC77C\uCE58)", (v, prev) => [...prev, v], []).option("--link-task <ref>", "\uB2E4\uB978 \uC5C5\uBB34 \uB9C1\uD06C \uCD94\uAC00 (<project>/<number> \uB610\uB294 postId, \uBC18\uBCF5 \uAC00\uB2A5)", (v, prev) => [...prev, v], []).option("--parent <ref>", "\uBD80\uBAA8 \uC5C5\uBB34 (project/number \uB610\uB294 postId)").option("--workflow <name>", "\uCD08\uAE30 \uC6CC\uD06C\uD50C\uB85C\uC6B0 \uC774\uB984 \uB610\uB294 class").option("--milestone <name>", "\uB9C8\uC77C\uC2A4\uD1A4 \uC774\uB984").option("--dry-run", "API \uD638\uCD9C \uC5C6\uC774 \uD569\uC131\uB41C \uBCF8\uBB38\uB9CC stdout \uCD9C\uB825 (mention/link-task \uC801\uC6A9 \uACB0\uACFC \uBBF8\uB9AC\uBCF4\uAE30)").action(async (project, opts) => {
2044
2305
  const globalOpts = postCreateCommand.optsWithGlobals();
2045
2306
  const config = await getConfigOrThrow();
2046
2307
  const client = new DoorayApiClient(config.apiKey, config.baseUrl);
@@ -2056,11 +2317,63 @@ var postCreateCommand = new import_commander14.Command("create").description("\u
2056
2317
  "\u26A0 --subject\uB294 deprecated\uC785\uB2C8\uB2E4. \uB300\uC2E0 --title\uC744 \uC0AC\uC6A9\uD574\uC8FC\uC138\uC694.\n"
2057
2318
  );
2058
2319
  }
2059
- const bodyContent = await readBodyInput(opts);
2320
+ const mentionInputs = (opts.mention ?? []).filter((s) => s.length > 0);
2321
+ const groupInputs = (opts.mentionGroup ?? []).filter((s) => s.length > 0);
2322
+ const linkInputs = (opts.linkTask ?? []).filter((s) => s.length > 0);
2323
+ let bodyContent = await readBodyInput(opts);
2060
2324
  startSpinner("\uC5C5\uBB34 \uC0DD\uC131 \uC911...");
2061
2325
  const projectId = await resolveProject(client, project);
2062
- const toUsers = opts.to ? await resolveUsers2(client, projectId, opts.to) : [];
2063
- const ccUsers = opts.cc ? await resolveUsers2(client, projectId, opts.cc) : [];
2326
+ let projectCode;
2327
+ if (groupInputs.length > 0) {
2328
+ const projects = await ensureProjects(client);
2329
+ projectCode = projects.find((p) => p.id === projectId)?.code;
2330
+ if (!projectCode) {
2331
+ throw new DoorayCliError(
2332
+ `--mention-group \uC740 \uACF5\uAC1C \uD504\uB85C\uC81D\uD2B8\uC5D0\uC11C\uB9CC \uC9C0\uC6D0\uB429\uB2C8\uB2E4. dooray project list \uB85C \uCE90\uC2DC \uAC31\uC2E0 \uD6C4 \uC7AC\uC2DC\uB3C4\uD558\uC138\uC694.`,
2333
+ EXIT_PARAM_ERROR
2334
+ );
2335
+ }
2336
+ }
2337
+ if (mentionInputs.length > 0 || groupInputs.length > 0) {
2338
+ const me = await ensureMe(client);
2339
+ const memberIds = await Promise.all(
2340
+ mentionInputs.map((name) => resolveMember(client, projectId, name))
2341
+ );
2342
+ const nameMap = await buildMemberNameMap(client, projectId);
2343
+ const members = memberIds.map((memberId) => ({
2344
+ memberId,
2345
+ name: nameMap.get(memberId) ?? memberId
2346
+ }));
2347
+ const groups = await Promise.all(
2348
+ groupInputs.map(async (code) => {
2349
+ const g = await resolveMemberGroup(client, projectId, code);
2350
+ return { groupId: g.id, code: g.code, projectCode: projectCode ?? "" };
2351
+ })
2352
+ );
2353
+ bodyContent = prependMentions(bodyContent, members, groups, me);
2354
+ }
2355
+ if (linkInputs.length > 0) {
2356
+ const me = await ensureMe(client);
2357
+ const links = await resolveTaskLinks(client, linkInputs);
2358
+ bodyContent = appendTaskLinks(bodyContent, links, me);
2359
+ }
2360
+ if (opts.dryRun) {
2361
+ stopSpinner(false);
2362
+ if (globalOpts.json) {
2363
+ process.stdout.write(JSON.stringify({ body: bodyContent }) + "\n");
2364
+ } else {
2365
+ process.stdout.write(bodyContent + "\n");
2366
+ }
2367
+ return;
2368
+ }
2369
+ const ccGroupCodes = (opts.ccGroup ?? []).filter((s) => s.length > 0);
2370
+ const toGroupCodes = (opts.toGroup ?? []).filter((s) => s.length > 0);
2371
+ const toUsersMembers = opts.to ? await resolveUsers2(client, projectId, opts.to) : [];
2372
+ const ccUsersMembers = opts.cc ? await resolveUsers2(client, projectId, opts.cc) : [];
2373
+ const toUsersGroups = toGroupCodes.length > 0 ? await resolveUserAdditions(client, projectId, [], toGroupCodes) : [];
2374
+ const ccUsersGroups = ccGroupCodes.length > 0 ? await resolveUserAdditions(client, projectId, [], ccGroupCodes) : [];
2375
+ const toUsers = [...toUsersMembers, ...toUsersGroups];
2376
+ const ccUsers = [...ccUsersMembers, ...ccUsersGroups];
2064
2377
  const tagInputs = (opts.tag ?? []).filter((s) => s.length > 0);
2065
2378
  const [tagIds, parentPostId, milestoneId] = await Promise.all([
2066
2379
  tagInputs.length > 0 ? resolveTags(client, projectId, tagInputs) : validateMandatoryTags(client, projectId).then(() => void 0),
@@ -2336,24 +2649,6 @@ var commentLatestCommand = new import_commander18.Command("latest").description(
2336
2649
 
2337
2650
  // src/commands/post/comment/add.ts
2338
2651
  var import_commander19 = require("commander");
2339
-
2340
- // src/utils/mention.ts
2341
- function buildMemberMention(m, me) {
2342
- const title = m.memberId === me.id ? "me" : "member";
2343
- return `[@${m.name}](dooray://${me.orgId}/members/${m.memberId} "${title}")`;
2344
- }
2345
- function buildGroupMention(g, me) {
2346
- return `[@${g.projectCode}/${g.code}](dooray://${me.orgId}/member-groups/${g.groupId})`;
2347
- }
2348
- function prependMentions(body, members, groups, me) {
2349
- const parts = [];
2350
- for (const m of members) parts.push(buildMemberMention(m, me));
2351
- for (const g of groups) parts.push(buildGroupMention(g, me));
2352
- if (parts.length === 0) return body;
2353
- return parts.join(" ") + " " + body;
2354
- }
2355
-
2356
- // src/commands/post/comment/add.ts
2357
2652
  var commentAddCommand = new import_commander19.Command("add").description("\uB313\uAE00 \uCD94\uAC00").argument("[project]", "\uD504\uB85C\uC81D\uD2B8 \uCF54\uB4DC (\uB610\uB294 \uCCAB \uC778\uC790\uC5D0 Dooray URL)").argument("[post-number]", "\uC5C5\uBB34 \uBC88\uD638 (project\uC640 \uD568\uAED8 \uC0AC\uC6A9)").option("--id <postId>", "Dooray post ID (project/post-number \uB300\uC2E0)").option("--url <url>", "Dooray \uC5C5\uBB34 URL (project/post-number \uB300\uC2E0)").option("--body <text>", "\uB313\uAE00 \uBCF8\uBB38 (- \uC785\uB825 \uC2DC stdin\uC5D0\uC11C \uC77D\uAE30)").option("--body-file <path>", "\uBCF8\uBB38 \uD30C\uC77C \uACBD\uB85C (- \uC785\uB825 \uC2DC stdin\uC5D0\uC11C \uC77D\uAE30)").option(
2358
2653
  "--mention <name>",
2359
2654
  "\uBA64\uBC84 \uBA58\uC158 (\uBC18\uBCF5 \uAC00\uB2A5, \uC774\uB984 \uBD80\uBD84\uC77C\uCE58)",
@@ -2364,7 +2659,7 @@ var commentAddCommand = new import_commander19.Command("add").description("\uB31
2364
2659
  "\uADF8\uB8F9 \uBA58\uC158 (\uBC18\uBCF5 \uAC00\uB2A5, code \uBD80\uBD84\uC77C\uCE58)",
2365
2660
  (value, prev) => [...prev, value],
2366
2661
  []
2367
- ).action(async (project, postNumberStr, opts) => {
2662
+ ).option("--link-task <ref>", "\uB2E4\uB978 \uC5C5\uBB34 \uB9C1\uD06C \uCD94\uAC00 (<project>/<number> \uB610\uB294 postId, \uBC18\uBCF5 \uAC00\uB2A5)", (v, prev) => [...prev, v], []).option("--dry-run", "API \uD638\uCD9C \uC5C6\uC774 \uD569\uC131\uB41C \uBCF8\uBB38\uB9CC stdout \uCD9C\uB825 (mention/link-task \uC801\uC6A9 \uACB0\uACFC \uBBF8\uB9AC\uBCF4\uAE30)").action(async (project, postNumberStr, opts) => {
2368
2663
  const globalOpts = commentAddCommand.optsWithGlobals();
2369
2664
  const config = await getConfigOrThrow();
2370
2665
  const client = new DoorayApiClient(config.apiKey, config.baseUrl);
@@ -2385,6 +2680,7 @@ var commentAddCommand = new import_commander19.Command("add").description("\uB31
2385
2680
  });
2386
2681
  const mentionInputs = (opts.mention ?? []).filter((s) => s.length > 0);
2387
2682
  const groupInputs = (opts.mentionGroup ?? []).filter((s) => s.length > 0);
2683
+ const linkInputs = (opts.linkTask ?? []).filter((s) => s.length > 0);
2388
2684
  if (mentionInputs.length > 0 || groupInputs.length > 0) {
2389
2685
  const me = await ensureMe(client);
2390
2686
  const memberIds = await Promise.all(
@@ -2403,6 +2699,20 @@ var commentAddCommand = new import_commander19.Command("add").description("\uB31
2403
2699
  );
2404
2700
  bodyContent = prependMentions(bodyContent, members, groups, me);
2405
2701
  }
2702
+ if (linkInputs.length > 0) {
2703
+ const me = await ensureMe(client);
2704
+ const links = await resolveTaskLinks(client, linkInputs);
2705
+ bodyContent = appendTaskLinks(bodyContent, links, me);
2706
+ }
2707
+ if (opts.dryRun) {
2708
+ stopSpinner(false);
2709
+ if (globalOpts.json) {
2710
+ process.stdout.write(JSON.stringify({ body: bodyContent }) + "\n");
2711
+ } else {
2712
+ process.stdout.write(bodyContent + "\n");
2713
+ }
2714
+ return;
2715
+ }
2406
2716
  const res = await client.createPostComment(projectId, postId, {
2407
2717
  body: { mimeType: "text/x-markdown", content: bodyContent }
2408
2718
  });
@@ -2419,7 +2729,7 @@ var commentAddCommand = new import_commander19.Command("add").description("\uB31
2419
2729
 
2420
2730
  // src/commands/post/comment/edit.ts
2421
2731
  var import_commander20 = require("commander");
2422
- var commentEditCommand = new import_commander20.Command("edit").description("\uB313\uAE00 \uC218\uC815 ($EDITOR \uB610\uB294 --body \uC635\uC158)").argument("[arg1]", "\uD504\uB85C\uC81D\uD2B8 \uCF54\uB4DC / Dooray URL / \uB313\uAE00 ID (\uBAA8\uB4DC\uBCC4)").argument("[arg2]", "\uC5C5\uBB34 \uBC88\uD638 \uB610\uB294 \uB313\uAE00 ID (\uBAA8\uB4DC\uBCC4)").argument("[arg3]", "\uB313\uAE00 ID (positional 3\uAC1C \uBAA8\uB4DC)").option("--id <postId>", "Dooray post ID (project/post-number \uB300\uC2E0)").option("--url <url>", "Dooray \uC5C5\uBB34 URL (project/post-number \uB300\uC2E0)").option("--comment-id <commentId>", "\uB313\uAE00 ID (positional \uB300\uCCB4)").option("--body <text>", "\uB313\uAE00 \uBCF8\uBB38 \uBCC0\uACBD (- \uC785\uB825 \uC2DC stdin, non-interactive)").option("--body-file <path>", "\uBCF8\uBB38 \uD30C\uC77C \uACBD\uB85C (- \uC785\uB825 \uC2DC stdin, non-interactive)").option(
2732
+ var commentEditCommand = new import_commander20.Command("edit").description("\uB313\uAE00 \uC218\uC815 ($EDITOR \uB610\uB294 --body \uC635\uC158)").argument("[arg1]", "\uD504\uB85C\uC81D\uD2B8 \uCF54\uB4DC / Dooray URL / \uB313\uAE00 ID (\uBAA8\uB4DC\uBCC4)").argument("[arg2]", "\uC5C5\uBB34 \uBC88\uD638 \uB610\uB294 \uB313\uAE00 ID (\uBAA8\uB4DC\uBCC4)").argument("[arg3]", "\uB313\uAE00 ID (positional 3\uAC1C \uBAA8\uB4DC)").option("--id <postId>", "Dooray post ID (project/post-number \uB300\uC2E0)").option("--url <url>", "Dooray \uC5C5\uBB34 URL (project/post-number \uB300\uC2E0)").option("--comment-id <commentId>", "\uB313\uAE00 ID (positional \uB300\uCCB4)").option("--body <text>", "\uB313\uAE00 \uBCF8\uBB38 \uBCC0\uACBD (- \uC785\uB825 \uC2DC stdin, non-interactive)").option("--body-file <path>", "\uBCF8\uBB38 \uD30C\uC77C \uACBD\uB85C (- \uC785\uB825 \uC2DC stdin, non-interactive)").option("--no-confirm", "\uB204\uB77D attachment \uACBD\uACE0 \uC2DC confirm \uC5C6\uC774 \uC9C4\uD589 (\uC790\uB3D9\uD654\uC6A9)").option(
2423
2733
  "--mention <name>",
2424
2734
  "\uBA64\uBC84 \uBA58\uC158 (\uBC18\uBCF5 \uAC00\uB2A5, \uC774\uB984 \uBD80\uBD84\uC77C\uCE58)",
2425
2735
  (value, prev) => [...prev, value],
@@ -2429,7 +2739,7 @@ var commentEditCommand = new import_commander20.Command("edit").description("\uB
2429
2739
  "\uADF8\uB8F9 \uBA58\uC158 (\uBC18\uBCF5 \uAC00\uB2A5, code \uBD80\uBD84\uC77C\uCE58)",
2430
2740
  (value, prev) => [...prev, value],
2431
2741
  []
2432
- ).action(async (arg1, arg2, arg3, opts) => {
2742
+ ).option("--link-task <ref>", "\uB2E4\uB978 \uC5C5\uBB34 \uB9C1\uD06C \uCD94\uAC00 (<project>/<number> \uB610\uB294 postId, \uBC18\uBCF5 \uAC00\uB2A5)", (v, prev) => [...prev, v], []).option("--dry-run", "API \uD638\uCD9C \uC5C6\uC774 \uD569\uC131\uB41C \uBCF8\uBB38\uB9CC stdout \uCD9C\uB825 (mention/link-task \uC801\uC6A9 \uACB0\uACFC \uBBF8\uB9AC\uBCF4\uAE30)").action(async (arg1, arg2, arg3, opts) => {
2433
2743
  const config = await getConfigOrThrow();
2434
2744
  const client = new DoorayApiClient(config.apiKey, config.baseUrl);
2435
2745
  let projectArg;
@@ -2488,6 +2798,7 @@ var commentEditCommand = new import_commander20.Command("edit").description("\uB
2488
2798
  }
2489
2799
  const mentionInputs = (opts.mention ?? []).filter((s) => s.length > 0);
2490
2800
  const groupInputs = (opts.mentionGroup ?? []).filter((s) => s.length > 0);
2801
+ const linkInputs = (opts.linkTask ?? []).filter((s) => s.length > 0);
2491
2802
  let mentionPrefix = "";
2492
2803
  if (mentionInputs.length > 0 || groupInputs.length > 0) {
2493
2804
  const me = await ensureMe(client);
@@ -2519,6 +2830,23 @@ var commentEditCommand = new import_commander20.Command("edit").description("\uB
2519
2830
  } else if (mentionPrefix) {
2520
2831
  edited = mentionPrefix + " " + edited;
2521
2832
  }
2833
+ if (linkInputs.length > 0) {
2834
+ const me = await ensureMe(client);
2835
+ const links = await resolveTaskLinks(client, linkInputs);
2836
+ edited = appendTaskLinks(edited, links, me);
2837
+ }
2838
+ if (opts.dryRun) {
2839
+ stopSpinner(false);
2840
+ const globalOpts = commentEditCommand.optsWithGlobals();
2841
+ if (globalOpts.json) {
2842
+ process.stdout.write(JSON.stringify({ body: edited }) + "\n");
2843
+ } else {
2844
+ process.stdout.write(edited + "\n");
2845
+ }
2846
+ return;
2847
+ }
2848
+ const attachments = (comment.files ?? []).map((f) => ({ id: f.id, name: f.name }));
2849
+ await checkAndGuardDropped(comment.body.content, edited, attachments, !opts.confirm);
2522
2850
  startSpinner("\uB313\uAE00 \uC218\uC815 \uC911...");
2523
2851
  await client.updatePostComment(projectId, postId, commentId, {
2524
2852
  body: { mimeType: "text/x-markdown", content: edited }
@@ -2585,64 +2913,209 @@ var commentDeleteCommand = new import_commander21.Command("delete").description(
2585
2913
  `);
2586
2914
  });
2587
2915
 
2588
- // src/commands/post/comment/file/index.ts
2589
- var import_commander26 = require("commander");
2590
-
2591
- // src/commands/post/comment/file/list.ts
2916
+ // src/commands/post/comment/get.ts
2592
2917
  var import_commander22 = require("commander");
2593
- function formatSize(bytes) {
2594
- if (bytes < 1024) return `${bytes}B`;
2595
- if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)}KB`;
2596
- return `${(bytes / (1024 * 1024)).toFixed(1)}MB`;
2918
+
2919
+ // src/formatters/comment.ts
2920
+ function formatCommentDetail(comment, opts) {
2921
+ if (opts.json) {
2922
+ printJson(comment);
2923
+ return;
2924
+ }
2925
+ if (opts.quiet) {
2926
+ process.stdout.write(comment.id + "\n");
2927
+ return;
2928
+ }
2929
+ const metaRows = [
2930
+ ["ID", comment.id],
2931
+ ["\uC791\uC131\uC790", comment.creator.member?.name ?? ""],
2932
+ ["\uC0DD\uC131", comment.createdAt],
2933
+ ...comment.modifiedAt ? [["\uC218\uC815", comment.modifiedAt]] : [],
2934
+ ["mimeType", comment.body.mimeType]
2935
+ ];
2936
+ printTable(["Field", "Value"], metaRows);
2937
+ process.stdout.write("\n" + comment.body.content + "\n");
2938
+ if (comment.files && comment.files.length > 0) {
2939
+ process.stdout.write("\n[Attachments]\n");
2940
+ printTable(
2941
+ ["Name", "Size", "ID"],
2942
+ comment.files.map((f) => [f.name, String(f.size), f.id])
2943
+ );
2944
+ }
2597
2945
  }
2598
- var listCommentFileCommand = new import_commander22.Command("list").description("\uB313\uAE00 \uCCA8\uBD80 \uD30C\uC77C \uBAA9\uB85D \uC870\uD68C").argument("[arg1]", "\uD504\uB85C\uC81D\uD2B8 \uCF54\uB4DC, Dooray URL, \uB610\uB294 (`--id`/`--url` \uBAA8\uB4DC\uC77C \uB54C) \uB313\uAE00 ID").argument("[arg2]", "\uC5C5\uBB34 \uBC88\uD638 (positional \uBAA8\uB4DC)").argument("[arg3]", "\uB313\uAE00 ID (positional 3\uAC1C \uBAA8\uB4DC)").option("--id <postId>", "Dooray post ID (project/post-number \uB300\uC2E0)").option("--url <url>", "Dooray \uC5C5\uBB34 URL (project/post-number \uB300\uC2E0)").option("--comment-id <logId>", "\uB313\uAE00 ID (positional \uB300\uCCB4)").action(async (arg1, arg2, arg3, opts) => {
2599
- const globalOpts = listCommentFileCommand.optsWithGlobals();
2600
- const config = await getConfigOrThrow();
2601
- const client = new DoorayApiClient(config.apiKey, config.baseUrl);
2602
- let projectArg;
2603
- let postNumberArg;
2604
- let logId = opts.commentId;
2605
- if (opts.id || opts.url) {
2606
- if (arg2 || arg3) {
2946
+
2947
+ // src/commands/post/comment/get.ts
2948
+ function parseGetArgs(arg1, arg2, arg3, opts) {
2949
+ const hasPositional = arg1 !== void 0 || arg2 !== void 0 || arg3 !== void 0;
2950
+ const hasIdUrl = !!(opts.id || opts.url);
2951
+ if (hasPositional && hasIdUrl) {
2952
+ throw new DoorayCliError(
2953
+ "positional \uC778\uC790\uC640 --id/--url \uC635\uC158\uC740 \uB3D9\uC2DC\uC5D0 \uC0AC\uC6A9\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.",
2954
+ EXIT_PARAM_ERROR
2955
+ );
2956
+ }
2957
+ if (hasIdUrl) {
2958
+ if (!opts.commentId) {
2607
2959
  throw new DoorayCliError(
2608
- "--id/--url \uBAA8\uB4DC\uC5D0\uC11C\uB294 \uB313\uAE00 ID \uC678 \uCD94\uAC00 positional \uC778\uC790\uB97C \uBC1B\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4. --comment-id \uC635\uC158 \uC0AC\uC6A9\uC744 \uAD8C\uC7A5\uD569\uB2C8\uB2E4.",
2960
+ "--id/--url \uBAA8\uB4DC\uC5D0\uC11C\uB294 --comment-id \uC635\uC158\uC774 \uD544\uC694\uD569\uB2C8\uB2E4.",
2609
2961
  EXIT_PARAM_ERROR
2610
2962
  );
2611
2963
  }
2612
- logId = logId ?? arg1;
2613
- } else if (arg3) {
2614
- projectArg = arg1;
2615
- postNumberArg = arg2;
2616
- logId = logId ?? arg3;
2617
- } else if (arg1 && !arg2) {
2618
- projectArg = arg1;
2619
- if (!logId) {
2964
+ return { commentId: opts.commentId, idOpt: opts.id, urlOpt: opts.url };
2965
+ }
2966
+ if (arg3) {
2967
+ if (opts.commentId) {
2620
2968
  throw new DoorayCliError(
2621
- "URL/--id \uBAA8\uB4DC\uC5D0\uC11C\uB294 --comment-id \uC635\uC158\uC774 \uD544\uC694\uD569\uB2C8\uB2E4.",
2969
+ "positional \uB313\uAE00 ID \uC640 --comment-id \uC635\uC158\uC740 \uB3D9\uC2DC\uC5D0 \uC0AC\uC6A9\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.",
2622
2970
  EXIT_PARAM_ERROR
2623
2971
  );
2624
2972
  }
2625
- } else {
2626
- projectArg = arg1;
2627
- postNumberArg = arg2;
2628
- if (!logId) {
2973
+ return {
2974
+ projectArg: arg1,
2975
+ postNumberArg: arg2,
2976
+ commentId: arg3
2977
+ };
2978
+ }
2979
+ if (arg1 && arg2 && opts.commentId) {
2980
+ return {
2981
+ projectArg: arg1,
2982
+ postNumberArg: arg2,
2983
+ commentId: opts.commentId
2984
+ };
2985
+ }
2986
+ throw new DoorayCliError(
2987
+ "<comment-id>\uAC00 \uD544\uC694\uD569\uB2C8\uB2E4. positional 3\uBC88\uC9F8 \uB610\uB294 --comment-id \uC635\uC158\uC744 \uC0AC\uC6A9\uD558\uC138\uC694.",
2988
+ EXIT_PARAM_ERROR
2989
+ );
2990
+ }
2991
+ var commentGetCommand = new import_commander22.Command("get").description("\uB2E8\uC77C \uB313\uAE00 \uBCF8\uBB38 + \uBA54\uD0C0 + attachments \uC870\uD68C").argument("[arg1]", "\uD504\uB85C\uC81D\uD2B8 \uCF54\uB4DC / Dooray URL (\uBAA8\uB4DC\uBCC4)").argument("[arg2]", "\uC5C5\uBB34 \uBC88\uD638 (\uBAA8\uB4DC\uBCC4)").argument("[arg3]", "\uB313\uAE00 ID (positional 3\uAC1C \uBAA8\uB4DC)").option("--id <postId>", "Dooray post ID (positional \uB300\uC2E0)").option("--url <url>", "Dooray \uC5C5\uBB34 URL (positional \uB300\uC2E0)").option("--comment-id <id>", "\uB313\uAE00 ID (arg3 \uB300\uC2E0)").action(async (arg1, arg2, arg3, opts) => {
2992
+ const parsed = parseGetArgs(arg1, arg2, arg3, opts);
2993
+ const config = await getConfigOrThrow();
2994
+ const client = new DoorayApiClient(config.apiKey, config.baseUrl);
2995
+ const globalOpts = commentGetCommand.optsWithGlobals();
2996
+ startSpinner("\uB313\uAE00 \uC870\uD68C \uC911...");
2997
+ let projectId;
2998
+ let comment;
2999
+ try {
3000
+ const resolved = await resolvePostInput(client, {
3001
+ projectArg: parsed.projectArg,
3002
+ postNumberArg: parsed.postNumberArg,
3003
+ idOpt: parsed.idOpt,
3004
+ urlOpt: parsed.urlOpt
3005
+ });
3006
+ projectId = resolved.projectId;
3007
+ const detail = await client.getPostComment(resolved.projectId, resolved.postId, parsed.commentId);
3008
+ comment = detail.result;
3009
+ stopSpinner(true, "\uB313\uAE00 \uC870\uD68C \uC644\uB8CC");
3010
+ } catch (e) {
3011
+ stopSpinner(false);
3012
+ throw e;
3013
+ }
3014
+ if (!globalOpts.json) {
3015
+ let nameMap = /* @__PURE__ */ new Map();
3016
+ try {
3017
+ nameMap = await buildMemberNameMap(client, projectId);
3018
+ } catch {
3019
+ }
3020
+ comment = enrichCommentCreators([comment], nameMap)[0];
3021
+ }
3022
+ formatCommentDetail(comment, globalOpts);
3023
+ });
3024
+
3025
+ // src/commands/post/comment/file/index.ts
3026
+ var import_commander27 = require("commander");
3027
+
3028
+ // src/commands/post/comment/file/list.ts
3029
+ var import_commander23 = require("commander");
3030
+
3031
+ // src/resolvers/comment-file-input.ts
3032
+ var FILE_ID_SECONDARY_LABEL = {
3033
+ positional: "4\uBC88\uC9F8",
3034
+ option: "--file-id",
3035
+ identifier: "<fileId>"
3036
+ };
3037
+ function assertNonEmpty(value, fieldName) {
3038
+ if (value.trim() === "") {
3039
+ throw new DoorayCliError(
3040
+ `${fieldName} \uAC00 \uBE44\uC5B4 \uC788\uC2B5\uB2C8\uB2E4.`,
3041
+ EXIT_PARAM_ERROR
3042
+ );
3043
+ }
3044
+ }
3045
+ function parseImpl(args) {
3046
+ const isOptionMode = !!(args.idOpt || args.urlOpt);
3047
+ let projectArg;
3048
+ let postNumberArg;
3049
+ let commentId = args.commentIdOpt;
3050
+ let secondary = args.secondaryOpt;
3051
+ if (isOptionMode) {
3052
+ if (!commentId) commentId = args.arg1;
3053
+ if (!secondary) secondary = args.arg2;
3054
+ if (args.arg3 || args.arg4) {
2629
3055
  throw new DoorayCliError(
2630
- "<comment-id>\uAC00 \uD544\uC694\uD569\uB2C8\uB2E4. positional 3\uBC88\uC9F8 \uB610\uB294 --comment-id \uC635\uC158\uC744 \uC0AC\uC6A9\uD558\uC138\uC694.",
3056
+ "--id/--url \uBAA8\uB4DC\uC5D0\uC11C\uB294 \uCD94\uAC00 positional \uC778\uC790\uAC00 \uD5C8\uC6A9\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.",
2631
3057
  EXIT_PARAM_ERROR
2632
3058
  );
2633
3059
  }
3060
+ } else {
3061
+ projectArg = args.arg1;
3062
+ postNumberArg = args.arg2;
3063
+ if (!commentId) commentId = args.arg3;
3064
+ if (!secondary) secondary = args.arg4;
2634
3065
  }
2635
- if (!logId) {
2636
- throw new DoorayCliError("<comment-id>\uAC00 \uD544\uC694\uD569\uB2C8\uB2E4.", EXIT_PARAM_ERROR);
3066
+ if (!commentId) {
3067
+ throw new DoorayCliError(
3068
+ "<comment-id> \uAC00 \uD544\uC694\uD569\uB2C8\uB2E4. positional 3\uBC88\uC9F8 \uB610\uB294 --comment-id \uC635\uC158\uC744 \uC0AC\uC6A9\uD558\uC138\uC694.",
3069
+ EXIT_PARAM_ERROR
3070
+ );
2637
3071
  }
2638
- startSpinner("\uB313\uAE00 \uCCA8\uBD80 \uD30C\uC77C \uBAA9\uB85D \uC870\uD68C \uC911...");
3072
+ assertNonEmpty(commentId, "<comment-id>");
3073
+ if (args.requireSecondary) {
3074
+ if (!secondary) {
3075
+ const { identifier, positional, option } = args.secondaryLabel;
3076
+ throw new DoorayCliError(
3077
+ `${identifier} \uAC00 \uD544\uC694\uD569\uB2C8\uB2E4. positional ${positional} \uB610\uB294 ${option} \uC635\uC158\uC744 \uC0AC\uC6A9\uD558\uC138\uC694.`,
3078
+ EXIT_PARAM_ERROR
3079
+ );
3080
+ }
3081
+ assertNonEmpty(secondary, args.secondaryLabel.identifier);
3082
+ } else if (secondary !== void 0) {
3083
+ assertNonEmpty(secondary, "<secondary>");
3084
+ }
3085
+ return { projectArg, postNumberArg, commentId, secondary };
3086
+ }
3087
+ async function resolveCommentFileInput(client, args) {
3088
+ const { projectArg, postNumberArg, commentId, secondary } = parseImpl(args);
2639
3089
  const { projectId, postId } = await resolvePostInput(client, {
2640
3090
  projectArg,
2641
3091
  postNumberArg,
3092
+ idOpt: args.idOpt,
3093
+ urlOpt: args.urlOpt
3094
+ });
3095
+ return { projectId, postId, commentId, secondary };
3096
+ }
3097
+
3098
+ // src/commands/post/comment/file/list.ts
3099
+ function formatSize(bytes) {
3100
+ if (bytes < 1024) return `${bytes}B`;
3101
+ if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)}KB`;
3102
+ return `${(bytes / (1024 * 1024)).toFixed(1)}MB`;
3103
+ }
3104
+ var listCommentFileCommand = new import_commander23.Command("list").description("\uB313\uAE00 \uCCA8\uBD80 \uD30C\uC77C \uBAA9\uB85D \uC870\uD68C").argument("[arg1]", "\uD504\uB85C\uC81D\uD2B8 \uCF54\uB4DC, Dooray URL, \uB610\uB294 (`--id`/`--url` \uBAA8\uB4DC\uC77C \uB54C) \uB313\uAE00 ID").argument("[arg2]", "\uC5C5\uBB34 \uBC88\uD638 (positional \uBAA8\uB4DC)").argument("[arg3]", "\uB313\uAE00 ID (positional 3\uAC1C \uBAA8\uB4DC)").option("--id <postId>", "Dooray post ID (project/post-number \uB300\uC2E0)").option("--url <url>", "Dooray \uC5C5\uBB34 URL (project/post-number \uB300\uC2E0)").option("--comment-id <logId>", "\uB313\uAE00 ID (positional \uB300\uCCB4)").action(async (arg1, arg2, arg3, opts) => {
3105
+ const globalOpts = listCommentFileCommand.optsWithGlobals();
3106
+ const config = await getConfigOrThrow();
3107
+ const client = new DoorayApiClient(config.apiKey, config.baseUrl);
3108
+ const { projectId, postId, commentId } = await resolveCommentFileInput(client, {
3109
+ arg1,
3110
+ arg2,
3111
+ arg3,
2642
3112
  idOpt: opts.id,
2643
- urlOpt: opts.url
3113
+ urlOpt: opts.url,
3114
+ commentIdOpt: opts.commentId,
3115
+ requireSecondary: false
2644
3116
  });
2645
- const res = await client.getPostComment(projectId, postId, logId);
3117
+ startSpinner("\uB313\uAE00 \uCCA8\uBD80 \uD30C\uC77C \uBAA9\uB85D \uC870\uD68C \uC911...");
3118
+ const res = await client.getPostComment(projectId, postId, commentId);
2646
3119
  const files = res.result.files ?? [];
2647
3120
  stopSpinner(true, `\uCCA8\uBD80 \uD30C\uC77C ${files.length}\uAC1C`);
2648
3121
  if (files.length === 0) {
@@ -2662,7 +3135,7 @@ var listCommentFileCommand = new import_commander22.Command("list").description(
2662
3135
  });
2663
3136
 
2664
3137
  // src/commands/post/comment/file/upload.ts
2665
- var import_commander23 = require("commander");
3138
+ var import_commander24 = require("commander");
2666
3139
  var import_node_path4 = require("path");
2667
3140
 
2668
3141
  // src/utils/comment-files.ts
@@ -2683,55 +3156,21 @@ function removeFileReference(body, fileId) {
2683
3156
  }
2684
3157
 
2685
3158
  // src/commands/post/comment/file/upload.ts
2686
- var uploadCommentFileCommand = new import_commander23.Command("upload").description("\uB313\uAE00\uC5D0 \uD30C\uC77C \uC5C5\uB85C\uB4DC (post-level \uD30C\uC77C \uC5C5\uB85C\uB4DC + \uB313\uAE00 reference \uCD94\uAC00, ADR-024)").argument("[arg1]", "\uD504\uB85C\uC81D\uD2B8 \uCF54\uB4DC, Dooray URL, \uB610\uB294 (`--id`/`--url` \uBAA8\uB4DC\uC77C \uB54C) \uB313\uAE00 ID").argument("[arg2]", "\uC5C5\uBB34 \uBC88\uD638 \uB610\uB294 (`--id`/`--url` \uBAA8\uB4DC\uC77C \uB54C) \uD30C\uC77C \uACBD\uB85C").argument("[arg3]", "\uB313\uAE00 ID (positional \uBAA8\uB4DC)").argument("[arg4]", "\uD30C\uC77C \uACBD\uB85C (positional \uBAA8\uB4DC)").option("--id <postId>", "Dooray post ID (project/post-number \uB300\uC2E0)").option("--url <url>", "Dooray \uC5C5\uBB34 URL (project/post-number \uB300\uC2E0)").option("--comment-id <logId>", "\uB313\uAE00 ID (positional \uB300\uCCB4)").option("--file <path>", "\uC5C5\uB85C\uB4DC\uD560 \uD30C\uC77C \uACBD\uB85C (positional \uB300\uCCB4)").action(async (arg1, arg2, arg3, arg4, opts) => {
3159
+ var uploadCommentFileCommand = new import_commander24.Command("upload").description("\uB313\uAE00\uC5D0 \uD30C\uC77C \uC5C5\uB85C\uB4DC (post-level \uD30C\uC77C \uC5C5\uB85C\uB4DC + \uB313\uAE00 reference \uCD94\uAC00, ADR-024)").argument("[arg1]", "\uD504\uB85C\uC81D\uD2B8 \uCF54\uB4DC, Dooray URL, \uB610\uB294 (`--id`/`--url` \uBAA8\uB4DC\uC77C \uB54C) \uB313\uAE00 ID").argument("[arg2]", "\uC5C5\uBB34 \uBC88\uD638 \uB610\uB294 (`--id`/`--url` \uBAA8\uB4DC\uC77C \uB54C) \uD30C\uC77C \uACBD\uB85C").argument("[arg3]", "\uB313\uAE00 ID (positional \uBAA8\uB4DC)").argument("[arg4]", "\uD30C\uC77C \uACBD\uB85C (positional \uBAA8\uB4DC)").option("--id <postId>", "Dooray post ID (project/post-number \uB300\uC2E0)").option("--url <url>", "Dooray \uC5C5\uBB34 URL (project/post-number \uB300\uC2E0)").option("--comment-id <logId>", "\uB313\uAE00 ID (positional \uB300\uCCB4)").option("--file <path>", "\uC5C5\uB85C\uB4DC\uD560 \uD30C\uC77C \uACBD\uB85C (positional \uB300\uCCB4)").action(async (arg1, arg2, arg3, arg4, opts) => {
2687
3160
  const globalOpts = uploadCommentFileCommand.optsWithGlobals();
2688
3161
  const config = await getConfigOrThrow();
2689
3162
  const client = new DoorayApiClient(config.apiKey, config.baseUrl);
2690
- let projectArg;
2691
- let postNumberArg;
2692
- let logId = opts.commentId;
2693
- let filePath = opts.file;
2694
- if (opts.id || opts.url) {
2695
- if (arg3 || arg4) {
2696
- throw new DoorayCliError(
2697
- "--id/--url \uBAA8\uB4DC\uC5D0\uC11C\uB294 \uB313\uAE00 ID \uC640 \uD30C\uC77C \uACBD\uB85C \uC678 \uCD94\uAC00 positional \uC778\uC790\uB97C \uBC1B\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.",
2698
- EXIT_PARAM_ERROR
2699
- );
2700
- }
2701
- logId = logId ?? arg1;
2702
- filePath = filePath ?? arg2;
2703
- } else if (arg4) {
2704
- projectArg = arg1;
2705
- postNumberArg = arg2;
2706
- logId = logId ?? arg3;
2707
- filePath = filePath ?? arg4;
2708
- } else if (arg3) {
2709
- projectArg = arg1;
2710
- postNumberArg = arg2;
2711
- logId = logId ?? arg3;
2712
- } else if (arg1 && !arg2) {
2713
- projectArg = arg1;
2714
- } else {
2715
- projectArg = arg1;
2716
- postNumberArg = arg2;
2717
- }
2718
- if (!logId) {
2719
- throw new DoorayCliError(
2720
- "<comment-id>\uAC00 \uD544\uC694\uD569\uB2C8\uB2E4. positional 3\uBC88\uC9F8 \uB610\uB294 --comment-id \uC635\uC158\uC744 \uC0AC\uC6A9\uD558\uC138\uC694.",
2721
- EXIT_PARAM_ERROR
2722
- );
2723
- }
2724
- if (!filePath) {
2725
- throw new DoorayCliError(
2726
- "<path>\uAC00 \uD544\uC694\uD569\uB2C8\uB2E4. positional 4\uBC88\uC9F8 \uB610\uB294 --file \uC635\uC158\uC744 \uC0AC\uC6A9\uD558\uC138\uC694.",
2727
- EXIT_PARAM_ERROR
2728
- );
2729
- }
2730
- const { projectId, postId } = await resolvePostInput(client, {
2731
- projectArg,
2732
- postNumberArg,
3163
+ const { projectId, postId, commentId, secondary: filePath } = await resolveCommentFileInput(client, {
3164
+ arg1,
3165
+ arg2,
3166
+ arg3,
3167
+ arg4,
2733
3168
  idOpt: opts.id,
2734
- urlOpt: opts.url
3169
+ urlOpt: opts.url,
3170
+ commentIdOpt: opts.commentId,
3171
+ secondaryOpt: opts.file,
3172
+ requireSecondary: true,
3173
+ secondaryLabel: { positional: "4\uBC88\uC9F8", option: "--file", identifier: "<path>" }
2735
3174
  });
2736
3175
  startSpinner("\uD30C\uC77C \uC5C5\uB85C\uB4DC \uC911...");
2737
3176
  const uploadRes = await client.uploadPostFile(projectId, postId, filePath);
@@ -2740,10 +3179,10 @@ var uploadCommentFileCommand = new import_commander23.Command("upload").descript
2740
3179
  stopSpinner(true, "\uC5C5\uB85C\uB4DC \uC644\uB8CC");
2741
3180
  startSpinner("\uB313\uAE00 reference \uCD94\uAC00 \uC911...");
2742
3181
  try {
2743
- const commentRes = await client.getPostComment(projectId, postId, logId);
3182
+ const commentRes = await client.getPostComment(projectId, postId, commentId);
2744
3183
  const currentBody = commentRes.result.body.content;
2745
3184
  const newBody = appendFileReference(currentBody, fileName, fileId);
2746
- await client.updatePostComment(projectId, postId, logId, {
3185
+ await client.updatePostComment(projectId, postId, commentId, {
2747
3186
  body: { mimeType: "text/x-markdown", content: newBody }
2748
3187
  });
2749
3188
  stopSpinner(true, "reference \uCD94\uAC00 \uC644\uB8CC");
@@ -2755,7 +3194,7 @@ var uploadCommentFileCommand = new import_commander23.Command("upload").descript
2755
3194
  );
2756
3195
  }
2757
3196
  if (globalOpts.json) {
2758
- printJson({ fileId, fileName, commentId: logId });
3197
+ printJson({ fileId, fileName, commentId });
2759
3198
  } else if (globalOpts.quiet) {
2760
3199
  process.stdout.write(`${fileId}
2761
3200
  `);
@@ -2766,55 +3205,27 @@ var uploadCommentFileCommand = new import_commander23.Command("upload").descript
2766
3205
  });
2767
3206
 
2768
3207
  // src/commands/post/comment/file/download.ts
2769
- var import_commander24 = require("commander");
3208
+ var import_commander25 = require("commander");
2770
3209
  var import_promises8 = require("fs/promises");
2771
3210
  var import_node_path5 = require("path");
2772
- var downloadCommentFileCommand = new import_commander24.Command("download").description(
3211
+ var downloadCommentFileCommand = new import_commander25.Command("download").description(
2773
3212
  "\uB313\uAE00\uC5D0 \uCCA8\uBD80\uB41C \uD30C\uC77C \uB2E4\uC6B4\uB85C\uB4DC (\uD604\uC7AC comment-id \uB294 \uBBF8\uC0AC\uC6A9 \u2014 \uBA58\uD0C8 \uBAA8\uB378 \uC77C\uAD00\uC131, \uBBF8\uB798 \uB313\uAE00 \uB2E8\uC704 \uAD8C\uD55C \uD638\uD658\uC6A9)"
2774
3213
  ).argument("[arg1]", "\uD504\uB85C\uC81D\uD2B8 \uCF54\uB4DC, Dooray URL, \uB610\uB294 (`--id`/`--url` \uBAA8\uB4DC\uC77C \uB54C) \uB313\uAE00 ID").argument("[arg2]", "\uC5C5\uBB34 \uBC88\uD638 \uB610\uB294 (`--id`/`--url` \uBAA8\uB4DC\uC77C \uB54C) \uD30C\uC77C ID").argument("[arg3]", "\uB313\uAE00 ID (positional \uBAA8\uB4DC)").argument("[arg4]", "\uD30C\uC77C ID (positional \uBAA8\uB4DC)").option("--id <postId>", "Dooray post ID (project/post-number \uB300\uC2E0)").option("--url <url>", "Dooray \uC5C5\uBB34 URL (project/post-number \uB300\uC2E0)").option("--comment-id <logId>", "\uB313\uAE00 ID (positional \uB300\uCCB4)").option("--file-id <fileId>", "\uD30C\uC77C ID (positional \uB300\uCCB4)").option("--out <path>", "\uC800\uC7A5 \uACBD\uB85C (\uBBF8\uC9C0\uC815 \uC2DC \uD604\uC7AC \uB514\uB809\uD1A0\uB9AC\uC5D0 \uC6D0\uBCF8 \uD30C\uC77C\uBA85\uC73C\uB85C \uC800\uC7A5)", ".").action(async (arg1, arg2, arg3, arg4, opts) => {
2775
3214
  const config = await getConfigOrThrow();
2776
3215
  const client = new DoorayApiClient(config.apiKey, config.baseUrl);
2777
- let projectArg;
2778
- let postNumberArg;
2779
- let _commentId = opts.commentId;
2780
- let fileId = opts.fileId;
2781
- if (opts.id || opts.url) {
2782
- if (arg3 || arg4) {
2783
- throw new DoorayCliError(
2784
- "--id/--url \uBAA8\uB4DC\uC5D0\uC11C\uB294 \uB313\uAE00 ID \uC640 \uD30C\uC77C ID \uC678 \uCD94\uAC00 positional \uC778\uC790\uB97C \uBC1B\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.",
2785
- EXIT_PARAM_ERROR
2786
- );
2787
- }
2788
- _commentId = _commentId ?? arg1;
2789
- fileId = fileId ?? arg2;
2790
- } else if (arg4) {
2791
- projectArg = arg1;
2792
- postNumberArg = arg2;
2793
- _commentId = _commentId ?? arg3;
2794
- fileId = fileId ?? arg4;
2795
- } else if (arg3) {
2796
- projectArg = arg1;
2797
- postNumberArg = arg2;
2798
- _commentId = _commentId ?? arg3;
2799
- } else if (arg1 && !arg2) {
2800
- projectArg = arg1;
2801
- } else {
2802
- projectArg = arg1;
2803
- postNumberArg = arg2;
2804
- }
2805
- if (!fileId) {
2806
- throw new DoorayCliError(
2807
- "<file-id>\uAC00 \uD544\uC694\uD569\uB2C8\uB2E4. positional 4\uBC88\uC9F8 \uB610\uB294 --file-id \uC635\uC158\uC744 \uC0AC\uC6A9\uD558\uC138\uC694.",
2808
- EXIT_PARAM_ERROR
2809
- );
2810
- }
2811
- startSpinner("\uD30C\uC77C \uB2E4\uC6B4\uB85C\uB4DC \uC911...");
2812
- const { projectId, postId } = await resolvePostInput(client, {
2813
- projectArg,
2814
- postNumberArg,
3216
+ const { projectId, postId, secondary: fileId } = await resolveCommentFileInput(client, {
3217
+ arg1,
3218
+ arg2,
3219
+ arg3,
3220
+ arg4,
2815
3221
  idOpt: opts.id,
2816
- urlOpt: opts.url
3222
+ urlOpt: opts.url,
3223
+ commentIdOpt: opts.commentId,
3224
+ secondaryOpt: opts.fileId,
3225
+ requireSecondary: true,
3226
+ secondaryLabel: FILE_ID_SECONDARY_LABEL
2817
3227
  });
3228
+ startSpinner("\uD30C\uC77C \uB2E4\uC6B4\uB85C\uB4DC \uC911...");
2818
3229
  const { buffer, fileName } = await client.downloadPostFile(projectId, postId, fileId);
2819
3230
  const safeName = (0, import_node_path5.basename)(fileName);
2820
3231
  const outputPath = (0, import_node_path5.join)(opts.out, safeName);
@@ -2825,50 +3236,22 @@ var downloadCommentFileCommand = new import_commander24.Command("download").desc
2825
3236
  });
2826
3237
 
2827
3238
  // src/commands/post/comment/file/delete.ts
2828
- var import_commander25 = require("commander");
2829
- var deleteCommentFileCommand = new import_commander25.Command("delete").description("\uB313\uAE00 \uCCA8\uBD80 \uD30C\uC77C \uC0AD\uC81C (\uB313\uAE00 \uBCF8\uBB38 reference \uC81C\uAC70 + \uD30C\uC77C \uC0AD\uC81C, ADR-024)").argument("[arg1]", "\uD504\uB85C\uC81D\uD2B8 \uCF54\uB4DC, Dooray URL, \uB610\uB294 (`--id`/`--url` \uBAA8\uB4DC\uC77C \uB54C) \uB313\uAE00 ID").argument("[arg2]", "\uC5C5\uBB34 \uBC88\uD638 \uB610\uB294 (`--id`/`--url` \uBAA8\uB4DC\uC77C \uB54C) \uD30C\uC77C ID").argument("[arg3]", "\uB313\uAE00 ID (positional \uBAA8\uB4DC)").argument("[arg4]", "\uD30C\uC77C ID (positional \uBAA8\uB4DC)").option("--id <postId>", "Dooray post ID (project/post-number \uB300\uC2E0)").option("--url <url>", "Dooray \uC5C5\uBB34 URL (project/post-number \uB300\uC2E0)").option("--comment-id <logId>", "\uB313\uAE00 ID (positional \uB300\uCCB4)").option("--file-id <fileId>", "\uD30C\uC77C ID (positional \uB300\uCCB4)").option("--yes", "\uD655\uC778 \uC5C6\uC774 \uC0AD\uC81C").action(async (arg1, arg2, arg3, arg4, opts) => {
3239
+ var import_commander26 = require("commander");
3240
+ var deleteCommentFileCommand = new import_commander26.Command("delete").description("\uB313\uAE00 \uCCA8\uBD80 \uD30C\uC77C \uC0AD\uC81C (\uB313\uAE00 \uBCF8\uBB38 reference \uC81C\uAC70 + \uD30C\uC77C \uC0AD\uC81C, ADR-024)").argument("[arg1]", "\uD504\uB85C\uC81D\uD2B8 \uCF54\uB4DC, Dooray URL, \uB610\uB294 (`--id`/`--url` \uBAA8\uB4DC\uC77C \uB54C) \uB313\uAE00 ID").argument("[arg2]", "\uC5C5\uBB34 \uBC88\uD638 \uB610\uB294 (`--id`/`--url` \uBAA8\uB4DC\uC77C \uB54C) \uD30C\uC77C ID").argument("[arg3]", "\uB313\uAE00 ID (positional \uBAA8\uB4DC)").argument("[arg4]", "\uD30C\uC77C ID (positional \uBAA8\uB4DC)").option("--id <postId>", "Dooray post ID (project/post-number \uB300\uC2E0)").option("--url <url>", "Dooray \uC5C5\uBB34 URL (project/post-number \uB300\uC2E0)").option("--comment-id <logId>", "\uB313\uAE00 ID (positional \uB300\uCCB4)").option("--file-id <fileId>", "\uD30C\uC77C ID (positional \uB300\uCCB4)").option("--yes", "\uD655\uC778 \uC5C6\uC774 \uC0AD\uC81C").action(async (arg1, arg2, arg3, arg4, opts) => {
2830
3241
  const config = await getConfigOrThrow();
2831
3242
  const client = new DoorayApiClient(config.apiKey, config.baseUrl);
2832
- let projectArg;
2833
- let postNumberArg;
2834
- let logId = opts.commentId;
2835
- let fileId = opts.fileId;
2836
- if (opts.id || opts.url) {
2837
- if (arg3 || arg4) {
2838
- throw new DoorayCliError(
2839
- "--id/--url \uBAA8\uB4DC\uC5D0\uC11C\uB294 \uB313\uAE00 ID \uC640 \uD30C\uC77C ID \uC678 \uCD94\uAC00 positional \uC778\uC790\uB97C \uBC1B\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.",
2840
- EXIT_PARAM_ERROR
2841
- );
2842
- }
2843
- logId = logId ?? arg1;
2844
- fileId = fileId ?? arg2;
2845
- } else if (arg4) {
2846
- projectArg = arg1;
2847
- postNumberArg = arg2;
2848
- logId = logId ?? arg3;
2849
- fileId = fileId ?? arg4;
2850
- } else if (arg3) {
2851
- projectArg = arg1;
2852
- postNumberArg = arg2;
2853
- logId = logId ?? arg3;
2854
- } else if (arg1 && !arg2) {
2855
- projectArg = arg1;
2856
- } else {
2857
- projectArg = arg1;
2858
- postNumberArg = arg2;
2859
- }
2860
- if (!logId) {
2861
- throw new DoorayCliError(
2862
- "<comment-id>\uAC00 \uD544\uC694\uD569\uB2C8\uB2E4. positional 3\uBC88\uC9F8 \uB610\uB294 --comment-id \uC635\uC158\uC744 \uC0AC\uC6A9\uD558\uC138\uC694.",
2863
- EXIT_PARAM_ERROR
2864
- );
2865
- }
2866
- if (!fileId) {
2867
- throw new DoorayCliError(
2868
- "<file-id>\uAC00 \uD544\uC694\uD569\uB2C8\uB2E4. positional 4\uBC88\uC9F8 \uB610\uB294 --file-id \uC635\uC158\uC744 \uC0AC\uC6A9\uD558\uC138\uC694.",
2869
- EXIT_PARAM_ERROR
2870
- );
2871
- }
3243
+ const { projectId, postId, commentId, secondary: fileId } = await resolveCommentFileInput(client, {
3244
+ arg1,
3245
+ arg2,
3246
+ arg3,
3247
+ arg4,
3248
+ idOpt: opts.id,
3249
+ urlOpt: opts.url,
3250
+ commentIdOpt: opts.commentId,
3251
+ secondaryOpt: opts.fileId,
3252
+ requireSecondary: true,
3253
+ secondaryLabel: FILE_ID_SECONDARY_LABEL
3254
+ });
2872
3255
  if (!opts.yes) {
2873
3256
  const { confirm: confirm2 } = await import("@inquirer/prompts");
2874
3257
  const ok = await confirm2({
@@ -2879,18 +3262,12 @@ var deleteCommentFileCommand = new import_commander25.Command("delete").descript
2879
3262
  return;
2880
3263
  }
2881
3264
  }
2882
- const { projectId, postId } = await resolvePostInput(client, {
2883
- projectArg,
2884
- postNumberArg,
2885
- idOpt: opts.id,
2886
- urlOpt: opts.url
2887
- });
2888
3265
  startSpinner("\uB313\uAE00 \uBCF8\uBB38 reference \uC81C\uAC70 \uC911...");
2889
3266
  try {
2890
- const commentRes = await client.getPostComment(projectId, postId, logId);
3267
+ const commentRes = await client.getPostComment(projectId, postId, commentId);
2891
3268
  const currentBody = commentRes.result.body.content;
2892
3269
  const newBody = removeFileReference(currentBody, fileId);
2893
- await client.updatePostComment(projectId, postId, logId, {
3270
+ await client.updatePostComment(projectId, postId, commentId, {
2894
3271
  body: { mimeType: "text/x-markdown", content: newBody }
2895
3272
  });
2896
3273
  stopSpinner(true, "reference \uC81C\uAC70 \uC644\uB8CC");
@@ -2912,21 +3289,21 @@ var deleteCommentFileCommand = new import_commander25.Command("delete").descript
2912
3289
  EXIT_API_ERROR
2913
3290
  );
2914
3291
  }
2915
- process.stdout.write(`\uD30C\uC77C(${fileId})\uC774 \uB313\uAE00(${logId})\uC5D0\uC11C \uC0AD\uC81C\uB418\uC5C8\uC2B5\uB2C8\uB2E4.
3292
+ process.stdout.write(`\uD30C\uC77C(${fileId})\uC774 \uB313\uAE00(${commentId})\uC5D0\uC11C \uC0AD\uC81C\uB418\uC5C8\uC2B5\uB2C8\uB2E4.
2916
3293
  `);
2917
3294
  });
2918
3295
 
2919
3296
  // src/commands/post/comment/file/index.ts
2920
- var commentFileCommand = new import_commander26.Command("file").description("\uB313\uAE00 \uCCA8\uBD80 \uD30C\uC77C \uAD00\uB9AC (post-level files API + \uB313\uAE00 PUT \uD569\uC131, ADR-024)").addCommand(listCommentFileCommand).addCommand(uploadCommentFileCommand).addCommand(downloadCommentFileCommand).addCommand(deleteCommentFileCommand);
3297
+ var commentFileCommand = new import_commander27.Command("file").description("\uB313\uAE00 \uCCA8\uBD80 \uD30C\uC77C \uAD00\uB9AC (post-level files API + \uB313\uAE00 PUT \uD569\uC131, ADR-024)").addCommand(listCommentFileCommand).addCommand(uploadCommentFileCommand).addCommand(downloadCommentFileCommand).addCommand(deleteCommentFileCommand);
2921
3298
 
2922
3299
  // src/commands/post/file/list.ts
2923
- var import_commander27 = require("commander");
3300
+ var import_commander28 = require("commander");
2924
3301
  function formatSize2(bytes) {
2925
3302
  if (bytes < 1024) return `${bytes}B`;
2926
3303
  if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)}KB`;
2927
3304
  return `${(bytes / (1024 * 1024)).toFixed(1)}MB`;
2928
3305
  }
2929
- var fileListCommand = new import_commander27.Command("list").description("\uC5C5\uBB34 \uCCA8\uBD80\uD30C\uC77C \uBAA9\uB85D \uC870\uD68C").argument("[project]", "\uD504\uB85C\uC81D\uD2B8 \uCF54\uB4DC (\uB610\uB294 \uCCAB \uC778\uC790\uC5D0 Dooray URL)").argument("[post-number]", "\uC5C5\uBB34 \uBC88\uD638 (project\uC640 \uD568\uAED8 \uC0AC\uC6A9)").option("--id <postId>", "Dooray post ID (project/post-number \uB300\uC2E0)").option("--url <url>", "Dooray \uC5C5\uBB34 URL (project/post-number \uB300\uC2E0)").action(async (project, postNumberStr, opts) => {
3306
+ var fileListCommand = new import_commander28.Command("list").description("\uC5C5\uBB34 \uCCA8\uBD80\uD30C\uC77C \uBAA9\uB85D \uC870\uD68C").argument("[project]", "\uD504\uB85C\uC81D\uD2B8 \uCF54\uB4DC (\uB610\uB294 \uCCAB \uC778\uC790\uC5D0 Dooray URL)").argument("[post-number]", "\uC5C5\uBB34 \uBC88\uD638 (project\uC640 \uD568\uAED8 \uC0AC\uC6A9)").option("--id <postId>", "Dooray post ID (project/post-number \uB300\uC2E0)").option("--url <url>", "Dooray \uC5C5\uBB34 URL (project/post-number \uB300\uC2E0)").action(async (project, postNumberStr, opts) => {
2930
3307
  const globalOpts = fileListCommand.optsWithGlobals();
2931
3308
  const config = await getConfigOrThrow();
2932
3309
  const client = new DoorayApiClient(config.apiKey, config.baseUrl);
@@ -2954,10 +3331,10 @@ var fileListCommand = new import_commander27.Command("list").description("\uC5C5
2954
3331
  });
2955
3332
 
2956
3333
  // src/commands/post/file/download.ts
2957
- var import_commander28 = require("commander");
3334
+ var import_commander29 = require("commander");
2958
3335
  var import_promises9 = require("fs/promises");
2959
3336
  var import_node_path6 = require("path");
2960
- var fileDownloadCommand = new import_commander28.Command("download").description("\uCCA8\uBD80\uD30C\uC77C \uB2E4\uC6B4\uB85C\uB4DC").argument("[arg1]", "\uD504\uB85C\uC81D\uD2B8 \uCF54\uB4DC, Dooray URL, \uB610\uB294 (`--id`/`--url` \uBAA8\uB4DC\uC77C \uB54C) \uD30C\uC77C ID").argument("[arg2]", "\uC5C5\uBB34 \uBC88\uD638 \uB610\uB294 (`--id`/`--url` \uBAA8\uB4DC\uC77C \uB54C) \uD30C\uC77C ID").argument("[arg3]", "\uD30C\uC77C ID (positional \uBAA8\uB4DC)").option("--id <postId>", "Dooray post ID (project/post-number \uB300\uC2E0)").option("--url <url>", "Dooray \uC5C5\uBB34 URL (project/post-number \uB300\uC2E0)").option("--file-id <fileId>", "\uD30C\uC77C ID (positional \uB300\uCCB4)").option("-o, --output <dir>", "\uC800\uC7A5 \uB514\uB809\uD1A0\uB9AC", ".").action(async (arg1, arg2, arg3, opts) => {
3337
+ var fileDownloadCommand = new import_commander29.Command("download").description("\uCCA8\uBD80\uD30C\uC77C \uB2E4\uC6B4\uB85C\uB4DC").argument("[arg1]", "\uD504\uB85C\uC81D\uD2B8 \uCF54\uB4DC, Dooray URL, \uB610\uB294 (`--id`/`--url` \uBAA8\uB4DC\uC77C \uB54C) \uD30C\uC77C ID").argument("[arg2]", "\uC5C5\uBB34 \uBC88\uD638 \uB610\uB294 (`--id`/`--url` \uBAA8\uB4DC\uC77C \uB54C) \uD30C\uC77C ID").argument("[arg3]", "\uD30C\uC77C ID (positional \uBAA8\uB4DC)").option("--id <postId>", "Dooray post ID (project/post-number \uB300\uC2E0)").option("--url <url>", "Dooray \uC5C5\uBB34 URL (project/post-number \uB300\uC2E0)").option("--file-id <fileId>", "\uD30C\uC77C ID (positional \uB300\uCCB4)").option("-o, --output <dir>", "\uC800\uC7A5 \uB514\uB809\uD1A0\uB9AC", ".").action(async (arg1, arg2, arg3, opts) => {
2961
3338
  const config = await getConfigOrThrow();
2962
3339
  const client = new DoorayApiClient(config.apiKey, config.baseUrl);
2963
3340
  let projectArg;
@@ -3012,10 +3389,10 @@ var fileDownloadCommand = new import_commander28.Command("download").description
3012
3389
  });
3013
3390
 
3014
3391
  // src/commands/post/file/download-all.ts
3015
- var import_commander29 = require("commander");
3392
+ var import_commander30 = require("commander");
3016
3393
  var import_promises10 = require("fs/promises");
3017
3394
  var import_node_path7 = require("path");
3018
- var fileDownloadAllCommand = new import_commander29.Command("download-all").description("\uC5C5\uBB34\uC758 \uBAA8\uB4E0 \uCCA8\uBD80\uD30C\uC77C \uB2E4\uC6B4\uB85C\uB4DC").argument("[project]", "\uD504\uB85C\uC81D\uD2B8 \uCF54\uB4DC (\uB610\uB294 \uCCAB \uC778\uC790\uC5D0 Dooray URL)").argument("[post-number]", "\uC5C5\uBB34 \uBC88\uD638 (project\uC640 \uD568\uAED8 \uC0AC\uC6A9)").option("--id <postId>", "Dooray post ID (project/post-number \uB300\uC2E0)").option("--url <url>", "Dooray \uC5C5\uBB34 URL (project/post-number \uB300\uC2E0)").option("-o, --output <dir>", "\uC800\uC7A5 \uB514\uB809\uD1A0\uB9AC", ".").action(async (project, postNumberStr, opts) => {
3395
+ var fileDownloadAllCommand = new import_commander30.Command("download-all").description("\uC5C5\uBB34\uC758 \uBAA8\uB4E0 \uCCA8\uBD80\uD30C\uC77C \uB2E4\uC6B4\uB85C\uB4DC").argument("[project]", "\uD504\uB85C\uC81D\uD2B8 \uCF54\uB4DC (\uB610\uB294 \uCCAB \uC778\uC790\uC5D0 Dooray URL)").argument("[post-number]", "\uC5C5\uBB34 \uBC88\uD638 (project\uC640 \uD568\uAED8 \uC0AC\uC6A9)").option("--id <postId>", "Dooray post ID (project/post-number \uB300\uC2E0)").option("--url <url>", "Dooray \uC5C5\uBB34 URL (project/post-number \uB300\uC2E0)").option("-o, --output <dir>", "\uC800\uC7A5 \uB514\uB809\uD1A0\uB9AC", ".").action(async (project, postNumberStr, opts) => {
3019
3396
  const config = await getConfigOrThrow();
3020
3397
  const client = new DoorayApiClient(config.apiKey, config.baseUrl);
3021
3398
  const spinner = startSpinner("\uCCA8\uBD80\uD30C\uC77C \uBAA9\uB85D \uC870\uD68C \uC911...");
@@ -3048,9 +3425,9 @@ var fileDownloadAllCommand = new import_commander29.Command("download-all").desc
3048
3425
  });
3049
3426
 
3050
3427
  // src/commands/post/file/upload.ts
3051
- var import_commander30 = require("commander");
3428
+ var import_commander31 = require("commander");
3052
3429
  var import_node_path8 = require("path");
3053
- var fileUploadCommand = new import_commander30.Command("upload").description("\uCCA8\uBD80\uD30C\uC77C \uC5C5\uB85C\uB4DC").argument("[arg1]", "\uD504\uB85C\uC81D\uD2B8 \uCF54\uB4DC, Dooray URL, \uB610\uB294 (`--id`/`--url` \uBAA8\uB4DC\uC77C \uB54C) \uD30C\uC77C \uACBD\uB85C").argument("[arg2]", "\uC5C5\uBB34 \uBC88\uD638 \uB610\uB294 (`--id`/`--url` \uBAA8\uB4DC\uC77C \uB54C) \uD30C\uC77C \uACBD\uB85C").argument("[arg3]", "\uD30C\uC77C \uACBD\uB85C (positional \uBAA8\uB4DC)").option("--id <postId>", "Dooray post ID (project/post-number \uB300\uC2E0)").option("--url <url>", "Dooray \uC5C5\uBB34 URL (project/post-number \uB300\uC2E0)").option("--file <path>", "\uC5C5\uB85C\uB4DC\uD560 \uD30C\uC77C \uACBD\uB85C (positional \uB300\uCCB4)").action(async (arg1, arg2, arg3, opts) => {
3430
+ var fileUploadCommand = new import_commander31.Command("upload").description("\uCCA8\uBD80\uD30C\uC77C \uC5C5\uB85C\uB4DC").argument("[arg1]", "\uD504\uB85C\uC81D\uD2B8 \uCF54\uB4DC, Dooray URL, \uB610\uB294 (`--id`/`--url` \uBAA8\uB4DC\uC77C \uB54C) \uD30C\uC77C \uACBD\uB85C").argument("[arg2]", "\uC5C5\uBB34 \uBC88\uD638 \uB610\uB294 (`--id`/`--url` \uBAA8\uB4DC\uC77C \uB54C) \uD30C\uC77C \uACBD\uB85C").argument("[arg3]", "\uD30C\uC77C \uACBD\uB85C (positional \uBAA8\uB4DC)").option("--id <postId>", "Dooray post ID (project/post-number \uB300\uC2E0)").option("--url <url>", "Dooray \uC5C5\uBB34 URL (project/post-number \uB300\uC2E0)").option("--file <path>", "\uC5C5\uB85C\uB4DC\uD560 \uD30C\uC77C \uACBD\uB85C (positional \uB300\uCCB4)").action(async (arg1, arg2, arg3, opts) => {
3054
3431
  const globalOpts = fileUploadCommand.optsWithGlobals();
3055
3432
  const config = await getConfigOrThrow();
3056
3433
  const client = new DoorayApiClient(config.apiKey, config.baseUrl);
@@ -3111,8 +3488,8 @@ var fileUploadCommand = new import_commander30.Command("upload").description("\u
3111
3488
  });
3112
3489
 
3113
3490
  // src/commands/post/file/delete.ts
3114
- var import_commander31 = require("commander");
3115
- var fileDeleteCommand = new import_commander31.Command("delete").description("\uCCA8\uBD80\uD30C\uC77C \uC0AD\uC81C").argument("[arg1]", "\uD504\uB85C\uC81D\uD2B8 \uCF54\uB4DC, Dooray URL, \uB610\uB294 (`--id`/`--url` \uBAA8\uB4DC\uC77C \uB54C) \uD30C\uC77C ID").argument("[arg2]", "\uC5C5\uBB34 \uBC88\uD638 \uB610\uB294 (`--id`/`--url` \uBAA8\uB4DC\uC77C \uB54C) \uD30C\uC77C ID").argument("[arg3]", "\uD30C\uC77C ID (positional 3\uAC1C \uBAA8\uB4DC)").option("--id <postId>", "Dooray post ID (project/post-number \uB300\uC2E0)").option("--url <url>", "Dooray \uC5C5\uBB34 URL (project/post-number \uB300\uC2E0)").option("--file-id <fileId>", "\uD30C\uC77C ID (positional \uB300\uCCB4)").action(async (arg1, arg2, arg3, opts) => {
3491
+ var import_commander32 = require("commander");
3492
+ var fileDeleteCommand = new import_commander32.Command("delete").description("\uCCA8\uBD80\uD30C\uC77C \uC0AD\uC81C").argument("[arg1]", "\uD504\uB85C\uC81D\uD2B8 \uCF54\uB4DC, Dooray URL, \uB610\uB294 (`--id`/`--url` \uBAA8\uB4DC\uC77C \uB54C) \uD30C\uC77C ID").argument("[arg2]", "\uC5C5\uBB34 \uBC88\uD638 \uB610\uB294 (`--id`/`--url` \uBAA8\uB4DC\uC77C \uB54C) \uD30C\uC77C ID").argument("[arg3]", "\uD30C\uC77C ID (positional 3\uAC1C \uBAA8\uB4DC)").option("--id <postId>", "Dooray post ID (project/post-number \uB300\uC2E0)").option("--url <url>", "Dooray \uC5C5\uBB34 URL (project/post-number \uB300\uC2E0)").option("--file-id <fileId>", "\uD30C\uC77C ID (positional \uB300\uCCB4)").action(async (arg1, arg2, arg3, opts) => {
3116
3493
  const config = await getConfigOrThrow();
3117
3494
  const client = new DoorayApiClient(config.apiKey, config.baseUrl);
3118
3495
  let projectArg;
@@ -3165,7 +3542,7 @@ var fileDeleteCommand = new import_commander31.Command("delete").description("\u
3165
3542
  });
3166
3543
 
3167
3544
  // src/commands/wiki/list.ts
3168
- var import_commander32 = require("commander");
3545
+ var import_commander33 = require("commander");
3169
3546
 
3170
3547
  // src/formatters/wiki.ts
3171
3548
  function formatWikiList(wikis, opts) {
@@ -3208,7 +3585,7 @@ function formatWikiPageDetail(page, opts) {
3208
3585
  }
3209
3586
 
3210
3587
  // src/commands/wiki/list.ts
3211
- var wikiListCommand = new import_commander32.Command("list").description("\uC704\uD0A4 \uBAA9\uB85D \uC870\uD68C").option("--page <number>", "\uD398\uC774\uC9C0 \uBC88\uD638", "0").option("--size <number>", "\uD398\uC774\uC9C0 \uD06C\uAE30", "20").action(async (opts) => {
3588
+ var wikiListCommand = new import_commander33.Command("list").description("\uC704\uD0A4 \uBAA9\uB85D \uC870\uD68C").option("--page <number>", "\uD398\uC774\uC9C0 \uBC88\uD638", "0").option("--size <number>", "\uD398\uC774\uC9C0 \uD06C\uAE30", "20").action(async (opts) => {
3212
3589
  const globalOpts = wikiListCommand.optsWithGlobals();
3213
3590
  const config = await getConfigOrThrow();
3214
3591
  const client = new DoorayApiClient(config.apiKey, config.baseUrl);
@@ -3222,7 +3599,7 @@ var wikiListCommand = new import_commander32.Command("list").description("\uC704
3222
3599
  });
3223
3600
 
3224
3601
  // src/commands/wiki/pages.ts
3225
- var import_commander33 = require("commander");
3602
+ var import_commander34 = require("commander");
3226
3603
 
3227
3604
  // src/resolvers/wiki.ts
3228
3605
  async function resolveWiki(client, projectCode) {
@@ -3266,7 +3643,7 @@ async function resolveWikiHomePageId(client, wikiId) {
3266
3643
  }
3267
3644
 
3268
3645
  // src/commands/wiki/pages.ts
3269
- var wikiPagesCommand = new import_commander33.Command("pages").description("\uC704\uD0A4 \uD398\uC774\uC9C0 \uBAA9\uB85D \uC870\uD68C").argument("<project>", "\uD504\uB85C\uC81D\uD2B8 \uCF54\uB4DC \uB610\uB294 ID").option("--parent <page-id>", "\uBD80\uBAA8 \uD398\uC774\uC9C0 ID").action(async (project, opts) => {
3646
+ var wikiPagesCommand = new import_commander34.Command("pages").description("\uC704\uD0A4 \uD398\uC774\uC9C0 \uBAA9\uB85D \uC870\uD68C").argument("<project>", "\uD504\uB85C\uC81D\uD2B8 \uCF54\uB4DC \uB610\uB294 ID").option("--parent <page-id>", "\uBD80\uBAA8 \uD398\uC774\uC9C0 ID").action(async (project, opts) => {
3270
3647
  const globalOpts = wikiPagesCommand.optsWithGlobals();
3271
3648
  const config = await getConfigOrThrow();
3272
3649
  const client = new DoorayApiClient(config.apiKey, config.baseUrl);
@@ -3278,8 +3655,8 @@ var wikiPagesCommand = new import_commander33.Command("pages").description("\uC7
3278
3655
  });
3279
3656
 
3280
3657
  // src/commands/wiki/page-get.ts
3281
- var import_commander34 = require("commander");
3282
- var wikiPageGetCommand = new import_commander34.Command("get").description("\uC704\uD0A4 \uD398\uC774\uC9C0 \uC0C1\uC138 \uC870\uD68C").argument("<project>", "\uD504\uB85C\uC81D\uD2B8 \uCF54\uB4DC \uB610\uB294 ID").argument("<page-id>", "\uD398\uC774\uC9C0 ID").action(async (project, pageId) => {
3658
+ var import_commander35 = require("commander");
3659
+ var wikiPageGetCommand = new import_commander35.Command("get").description("\uC704\uD0A4 \uD398\uC774\uC9C0 \uC0C1\uC138 \uC870\uD68C").argument("<project>", "\uD504\uB85C\uC81D\uD2B8 \uCF54\uB4DC \uB610\uB294 ID").argument("<page-id>", "\uD398\uC774\uC9C0 ID").action(async (project, pageId) => {
3283
3660
  const globalOpts = wikiPageGetCommand.optsWithGlobals();
3284
3661
  const config = await getConfigOrThrow();
3285
3662
  const client = new DoorayApiClient(config.apiKey, config.baseUrl);
@@ -3291,8 +3668,8 @@ var wikiPageGetCommand = new import_commander34.Command("get").description("\uC7
3291
3668
  });
3292
3669
 
3293
3670
  // src/commands/wiki/page-create.ts
3294
- var import_commander35 = require("commander");
3295
- var wikiPageCreateCommand = new import_commander35.Command("create").description("\uC704\uD0A4 \uD398\uC774\uC9C0 \uC0DD\uC131").argument("<project>", "\uD504\uB85C\uC81D\uD2B8 \uCF54\uB4DC \uB610\uB294 ID").requiredOption("--title <title>", "\uD398\uC774\uC9C0 \uC81C\uBAA9").option("--parent <page-id>", "\uBD80\uBAA8 \uD398\uC774\uC9C0 ID").option("--body <text>", "\uBCF8\uBB38 \uD14D\uC2A4\uD2B8 (- \uC785\uB825 \uC2DC stdin\uC5D0\uC11C \uC77D\uAE30)").option("--body-file <path>", "\uBCF8\uBB38 \uD30C\uC77C \uACBD\uB85C (- \uC785\uB825 \uC2DC stdin\uC5D0\uC11C \uC77D\uAE30)").action(async (project, opts) => {
3671
+ var import_commander36 = require("commander");
3672
+ var wikiPageCreateCommand = new import_commander36.Command("create").description("\uC704\uD0A4 \uD398\uC774\uC9C0 \uC0DD\uC131").argument("<project>", "\uD504\uB85C\uC81D\uD2B8 \uCF54\uB4DC \uB610\uB294 ID").requiredOption("--title <title>", "\uD398\uC774\uC9C0 \uC81C\uBAA9").option("--parent <page-id>", "\uBD80\uBAA8 \uD398\uC774\uC9C0 ID").option("--body <text>", "\uBCF8\uBB38 \uD14D\uC2A4\uD2B8 (- \uC785\uB825 \uC2DC stdin\uC5D0\uC11C \uC77D\uAE30)").option("--body-file <path>", "\uBCF8\uBB38 \uD30C\uC77C \uACBD\uB85C (- \uC785\uB825 \uC2DC stdin\uC5D0\uC11C \uC77D\uAE30)").action(async (project, opts) => {
3296
3673
  const globalOpts = wikiPageCreateCommand.optsWithGlobals();
3297
3674
  const config = await getConfigOrThrow();
3298
3675
  const client = new DoorayApiClient(config.apiKey, config.baseUrl);
@@ -3317,8 +3694,8 @@ var wikiPageCreateCommand = new import_commander35.Command("create").description
3317
3694
  });
3318
3695
 
3319
3696
  // src/commands/wiki/page-edit.ts
3320
- var import_commander36 = require("commander");
3321
- var wikiPageEditCommand = new import_commander36.Command("edit").description("\uC704\uD0A4 \uD398\uC774\uC9C0 \uC218\uC815 (\uD50C\uB798\uADF8 \uC5C6\uC73C\uBA74 $EDITOR)").argument("<project>", "\uD504\uB85C\uC81D\uD2B8 \uCF54\uB4DC \uB610\uB294 ID").argument("<page-id>", "\uD398\uC774\uC9C0 ID").option("--title <title>", "\uD398\uC774\uC9C0 \uC81C\uBAA9 (\uC9C0\uC815 \uC2DC $EDITOR \uC0DD\uB7B5)").option("--body <text>", "\uBCF8\uBB38 \uD14D\uC2A4\uD2B8 (- \uC785\uB825 \uC2DC stdin\uC5D0\uC11C \uC77D\uAE30)").option("--body-file <path>", "\uBCF8\uBB38 \uD30C\uC77C \uACBD\uB85C (- \uC785\uB825 \uC2DC stdin\uC5D0\uC11C \uC77D\uAE30)").action(async (project, pageId, opts) => {
3697
+ var import_commander37 = require("commander");
3698
+ var wikiPageEditCommand = new import_commander37.Command("edit").description("\uC704\uD0A4 \uD398\uC774\uC9C0 \uC218\uC815 (\uD50C\uB798\uADF8 \uC5C6\uC73C\uBA74 $EDITOR)").argument("<project>", "\uD504\uB85C\uC81D\uD2B8 \uCF54\uB4DC \uB610\uB294 ID").argument("<page-id>", "\uD398\uC774\uC9C0 ID").option("--title <title>", "\uD398\uC774\uC9C0 \uC81C\uBAA9 (\uC9C0\uC815 \uC2DC $EDITOR \uC0DD\uB7B5)").option("--body <text>", "\uBCF8\uBB38 \uD14D\uC2A4\uD2B8 (- \uC785\uB825 \uC2DC stdin\uC5D0\uC11C \uC77D\uAE30)").option("--body-file <path>", "\uBCF8\uBB38 \uD30C\uC77C \uACBD\uB85C (- \uC785\uB825 \uC2DC stdin\uC5D0\uC11C \uC77D\uAE30)").action(async (project, pageId, opts) => {
3322
3699
  const config = await getConfigOrThrow();
3323
3700
  const client = new DoorayApiClient(config.apiKey, config.baseUrl);
3324
3701
  const hasTitle = opts.title != null;
@@ -3371,10 +3748,10 @@ var wikiPageEditCommand = new import_commander36.Command("edit").description("\u
3371
3748
  });
3372
3749
 
3373
3750
  // src/commands/member/index.ts
3374
- var import_commander40 = require("commander");
3751
+ var import_commander41 = require("commander");
3375
3752
 
3376
3753
  // src/commands/member/get.ts
3377
- var import_commander37 = require("commander");
3754
+ var import_commander38 = require("commander");
3378
3755
 
3379
3756
  // src/formatters/member.ts
3380
3757
  function formatMemberDetail(member, opts) {
@@ -3420,7 +3797,7 @@ function formatMemberSearchResults(members, opts) {
3420
3797
  }
3421
3798
 
3422
3799
  // src/commands/member/get.ts
3423
- var memberGetCommand = new import_commander37.Command("get").description("\uBA64\uBC84 \uC0C1\uC138 \uC815\uBCF4 \uC870\uD68C (organizationMemberId)").argument("<member-id>", "\uC870\uD68C\uD560 organization member ID").action(async (memberId) => {
3800
+ var memberGetCommand = new import_commander38.Command("get").description("\uBA64\uBC84 \uC0C1\uC138 \uC815\uBCF4 \uC870\uD68C (organizationMemberId)").argument("<member-id>", "\uC870\uD68C\uD560 organization member ID").action(async (memberId) => {
3424
3801
  const globalOpts = memberGetCommand.optsWithGlobals();
3425
3802
  const config = await getConfigOrThrow();
3426
3803
  const client = new DoorayApiClient(config.apiKey, config.baseUrl);
@@ -3429,8 +3806,8 @@ var memberGetCommand = new import_commander37.Command("get").description("\uBA64
3429
3806
  });
3430
3807
 
3431
3808
  // src/commands/member/list.ts
3432
- var import_commander38 = require("commander");
3433
- var memberListCommand = new import_commander38.Command("list").description("\uD504\uB85C\uC81D\uD2B8 \uBA64\uBC84 \uBAA9\uB85D").argument("<project>", "\uD504\uB85C\uC81D\uD2B8 \uCF54\uB4DC \uB610\uB294 ID").action(async (project) => {
3809
+ var import_commander39 = require("commander");
3810
+ var memberListCommand = new import_commander39.Command("list").description("\uD504\uB85C\uC81D\uD2B8 \uBA64\uBC84 \uBAA9\uB85D").argument("<project>", "\uD504\uB85C\uC81D\uD2B8 \uCF54\uB4DC \uB610\uB294 ID").action(async (project) => {
3434
3811
  const globalOpts = memberListCommand.optsWithGlobals();
3435
3812
  const config = await getConfigOrThrow();
3436
3813
  const client = new DoorayApiClient(config.apiKey, config.baseUrl);
@@ -3445,8 +3822,8 @@ var memberListCommand = new import_commander38.Command("list").description("\uD5
3445
3822
  });
3446
3823
 
3447
3824
  // src/commands/member/search.ts
3448
- var import_commander39 = require("commander");
3449
- var memberSearchCommand = new import_commander39.Command("search").description("organization \uC804\uCCB4\uC5D0\uC11C \uBA64\uBC84 \uAC80\uC0C9").argument("[keyword]", "\uC774\uB984 \uAC80\uC0C9\uC5B4 (--email/--user-code \uBBF8\uC9C0\uC815 \uC2DC name\uC73C\uB85C \uAC80\uC0C9)").option("--email <email>", "\uC678\uBD80 \uC774\uBA54\uC77C (\uCF64\uB9C8 \uAD6C\uBD84 \uAC00\uB2A5, exact match)").option("--user-code <code>", "\uC0AC\uBC88 like \uAC80\uC0C9").option("--user-code-exact <code>", "\uC0AC\uBC88 exact match").option("--page <n>", "\uD398\uC774\uC9C0 (\uAE30\uBCF8 0)", "0").option("--size <n>", "\uD398\uC774\uC9C0 \uD06C\uAE30 (\uAE30\uBCF8 20, max 100)", "20").action(async (keyword, opts) => {
3825
+ var import_commander40 = require("commander");
3826
+ var memberSearchCommand = new import_commander40.Command("search").description("organization \uC804\uCCB4\uC5D0\uC11C \uBA64\uBC84 \uAC80\uC0C9").argument("[keyword]", "\uC774\uB984 \uAC80\uC0C9\uC5B4 (--email/--user-code \uBBF8\uC9C0\uC815 \uC2DC name\uC73C\uB85C \uAC80\uC0C9)").option("--email <email>", "\uC678\uBD80 \uC774\uBA54\uC77C (\uCF64\uB9C8 \uAD6C\uBD84 \uAC00\uB2A5, exact match)").option("--user-code <code>", "\uC0AC\uBC88 like \uAC80\uC0C9").option("--user-code-exact <code>", "\uC0AC\uBC88 exact match").option("--page <n>", "\uD398\uC774\uC9C0 (\uAE30\uBCF8 0)", "0").option("--size <n>", "\uD398\uC774\uC9C0 \uD06C\uAE30 (\uAE30\uBCF8 20, max 100)", "20").action(async (keyword, opts) => {
3450
3827
  const globalOpts = memberSearchCommand.optsWithGlobals();
3451
3828
  const filterCount = [keyword, opts.email, opts.userCode, opts.userCodeExact].filter(Boolean).length;
3452
3829
  if (filterCount === 0) {
@@ -3479,13 +3856,13 @@ var memberSearchCommand = new import_commander39.Command("search").description("
3479
3856
  });
3480
3857
 
3481
3858
  // src/commands/member/index.ts
3482
- var memberCommand = new import_commander40.Command("member").description("Dooray \uBA64\uBC84 \uC870\uD68C");
3859
+ var memberCommand = new import_commander41.Command("member").description("Dooray \uBA64\uBC84 \uC870\uD68C");
3483
3860
  memberCommand.addCommand(memberGetCommand);
3484
3861
  memberCommand.addCommand(memberListCommand);
3485
3862
  memberCommand.addCommand(memberSearchCommand);
3486
3863
 
3487
3864
  // src/commands/mail/list.ts
3488
- var import_commander41 = require("commander");
3865
+ var import_commander42 = require("commander");
3489
3866
 
3490
3867
  // src/api/imapClient.ts
3491
3868
  var import_imapflow = require("imapflow");
@@ -3526,7 +3903,7 @@ async function listMails(config, opts) {
3526
3903
  if (opts.search) query.subject = opts.search;
3527
3904
  if (Object.keys(query).length === 0) query.all = true;
3528
3905
  const uids = await client.search(query, { uid: true });
3529
- if (uids.length === 0) return [];
3906
+ if (!Array.isArray(uids) || uids.length === 0) return [];
3530
3907
  const sorted = uids.sort((a, b) => b - a).slice(0, limit);
3531
3908
  const uidSet = sorted.join(",");
3532
3909
  const messages = [];
@@ -3535,15 +3912,17 @@ async function listMails(config, opts) {
3535
3912
  flags: true,
3536
3913
  envelope: true
3537
3914
  }, { uid: true })) {
3915
+ const { envelope, flags } = msg;
3916
+ if (!envelope || !flags) continue;
3538
3917
  messages.push({
3539
3918
  uid: msg.uid,
3540
- subject: msg.envelope.subject ?? "(\uC81C\uBAA9 \uC5C6\uC74C)",
3541
- from: msg.envelope.from?.[0] ? `${msg.envelope.from[0].name || ""} <${msg.envelope.from[0].address || ""}>` : "(unknown)",
3542
- to: (msg.envelope.to ?? []).map(
3919
+ subject: envelope.subject ?? "(\uC81C\uBAA9 \uC5C6\uC74C)",
3920
+ from: envelope.from?.[0] ? `${envelope.from[0].name || ""} <${envelope.from[0].address || ""}>` : "(unknown)",
3921
+ to: (envelope.to ?? []).map(
3543
3922
  (t) => `${t.name || ""} <${t.address || ""}>`
3544
3923
  ),
3545
- date: msg.envelope.date ?? null,
3546
- isRead: msg.flags.has("\\Seen")
3924
+ date: envelope.date ?? null,
3925
+ isRead: flags.has("\\Seen")
3547
3926
  });
3548
3927
  }
3549
3928
  messages.sort((a, b) => b.uid - a.uid);
@@ -3570,17 +3949,24 @@ async function getMail(config, uid) {
3570
3949
  if (!msg) {
3571
3950
  throw new DoorayCliError(`\uBA54\uC77C\uC744 \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4: UID ${uid}`, 1);
3572
3951
  }
3573
- const parsed = await (0, import_mailparser.simpleParser)(msg.source);
3574
- const body = parsed.text ?? parsed.html ?? "(\uBCF8\uBB38 \uC5C6\uC74C)";
3952
+ const { envelope, flags, source } = msg;
3953
+ if (!envelope || !flags || !source) {
3954
+ throw new DoorayCliError(
3955
+ `\uBA54\uC77C \uBA54\uD0C0\uB370\uC774\uD130\uAC00 \uBD88\uC644\uC804\uD569\uB2C8\uB2E4 (UID ${uid}): envelope/flags/source \uB204\uB77D`,
3956
+ 1
3957
+ );
3958
+ }
3959
+ const parsed = await (0, import_mailparser.simpleParser)(source);
3960
+ const body = parsed.text || (parsed.html || "") || "(\uBCF8\uBB38 \uC5C6\uC74C)";
3575
3961
  return {
3576
3962
  uid: msg.uid,
3577
- subject: msg.envelope.subject ?? "(\uC81C\uBAA9 \uC5C6\uC74C)",
3578
- from: msg.envelope.from?.[0] ? `${msg.envelope.from[0].name || ""} <${msg.envelope.from[0].address || ""}>` : "(unknown)",
3579
- to: (msg.envelope.to ?? []).map(
3963
+ subject: envelope.subject ?? "(\uC81C\uBAA9 \uC5C6\uC74C)",
3964
+ from: envelope.from?.[0] ? `${envelope.from[0].name || ""} <${envelope.from[0].address || ""}>` : "(unknown)",
3965
+ to: (envelope.to ?? []).map(
3580
3966
  (t) => `${t.name || ""} <${t.address || ""}>`
3581
3967
  ),
3582
- date: msg.envelope.date ?? null,
3583
- isRead: msg.flags.has("\\Seen"),
3968
+ date: envelope.date ?? null,
3969
+ isRead: flags.has("\\Seen"),
3584
3970
  body
3585
3971
  };
3586
3972
  } finally {
@@ -3593,7 +3979,7 @@ async function getMail(config, uid) {
3593
3979
 
3594
3980
  // src/commands/mail/list.ts
3595
3981
  var import_chalk5 = __toESM(require("chalk"));
3596
- var mailListCommand = new import_commander41.Command("list").description("\uBA54\uC77C \uBAA9\uB85D \uC870\uD68C").option("--unread", "\uC548\uC77D\uC740 \uBA54\uC77C\uB9CC").option("--search <keyword>", "\uC81C\uBAA9 \uAC80\uC0C9").option("--size <number>", "\uC870\uD68C \uAC1C\uC218", "20").action(async (opts) => {
3982
+ var mailListCommand = new import_commander42.Command("list").description("\uBA54\uC77C \uBAA9\uB85D \uC870\uD68C").option("--unread", "\uC548\uC77D\uC740 \uBA54\uC77C\uB9CC").option("--search <keyword>", "\uC81C\uBAA9 \uAC80\uC0C9").option("--size <number>", "\uC870\uD68C \uAC1C\uC218", "20").action(async (opts) => {
3597
3983
  const globalOpts = mailListCommand.optsWithGlobals();
3598
3984
  const config = await getConfigOrThrow();
3599
3985
  startSpinner("\uBA54\uC77C \uC870\uD68C \uC911...");
@@ -3625,9 +4011,9 @@ var mailListCommand = new import_commander41.Command("list").description("\uBA54
3625
4011
  });
3626
4012
 
3627
4013
  // src/commands/mail/get.ts
3628
- var import_commander42 = require("commander");
4014
+ var import_commander43 = require("commander");
3629
4015
  var import_chalk6 = __toESM(require("chalk"));
3630
- var mailGetCommand = new import_commander42.Command("get").description("\uBA54\uC77C \uC0C1\uC138 \uC870\uD68C").argument("<uid>", "\uBA54\uC77C UID").action(async (uid) => {
4016
+ var mailGetCommand = new import_commander43.Command("get").description("\uBA54\uC77C \uC0C1\uC138 \uC870\uD68C").argument("<uid>", "\uBA54\uC77C UID").action(async (uid) => {
3631
4017
  const globalOpts = mailGetCommand.optsWithGlobals();
3632
4018
  const config = await getConfigOrThrow();
3633
4019
  startSpinner("\uBA54\uC77C \uC870\uD68C \uC911...");
@@ -3658,7 +4044,7 @@ ${mail.body}
3658
4044
  });
3659
4045
 
3660
4046
  // src/commands/mail/send.ts
3661
- var import_commander43 = require("commander");
4047
+ var import_commander44 = require("commander");
3662
4048
  var import_promises11 = require("fs/promises");
3663
4049
 
3664
4050
  // src/api/smtpClient.ts
@@ -3708,7 +4094,7 @@ async function sendMail(config, opts) {
3708
4094
  }
3709
4095
 
3710
4096
  // src/commands/mail/send.ts
3711
- var mailSendCommand = new import_commander43.Command("send").description("\uBA54\uC77C \uBC1C\uC1A1").requiredOption("--to <addresses...>", "\uBC1B\uB294\uC0AC\uB78C \uC774\uBA54\uC77C (\uBCF5\uC218 \uAC00\uB2A5)").requiredOption("--subject <title>", "\uC81C\uBAA9").option("--body <text>", "\uBCF8\uBB38").option("--body-file <path>", "\uBCF8\uBB38 \uD30C\uC77C \uACBD\uB85C").option("--cc <addresses...>", "\uCC38\uC870").option("--bcc <addresses...>", "\uC228\uC740\uCC38\uC870").option("--html", "\uBCF8\uBB38\uC744 HTML\uB85C \uC804\uC1A1").action(async (opts) => {
4097
+ var mailSendCommand = new import_commander44.Command("send").description("\uBA54\uC77C \uBC1C\uC1A1").requiredOption("--to <addresses...>", "\uBC1B\uB294\uC0AC\uB78C \uC774\uBA54\uC77C (\uBCF5\uC218 \uAC00\uB2A5)").requiredOption("--subject <title>", "\uC81C\uBAA9").option("--body <text>", "\uBCF8\uBB38").option("--body-file <path>", "\uBCF8\uBB38 \uD30C\uC77C \uACBD\uB85C").option("--cc <addresses...>", "\uCC38\uC870").option("--bcc <addresses...>", "\uC228\uC740\uCC38\uC870").option("--html", "\uBCF8\uBB38\uC744 HTML\uB85C \uC804\uC1A1").action(async (opts) => {
3712
4098
  const globalOpts = mailSendCommand.optsWithGlobals();
3713
4099
  const config = await getConfigOrThrow();
3714
4100
  let body = opts.body ?? "";
@@ -3743,7 +4129,7 @@ var mailSendCommand = new import_commander43.Command("send").description("\uBA54
3743
4129
  });
3744
4130
 
3745
4131
  // src/commands/mail/reply.ts
3746
- var import_commander44 = require("commander");
4132
+ var import_commander45 = require("commander");
3747
4133
  var import_promises12 = require("fs/promises");
3748
4134
  var import_imapflow2 = require("imapflow");
3749
4135
  async function getMessageId(config, uid) {
@@ -3763,7 +4149,8 @@ async function getMessageId(config, uid) {
3763
4149
  uid: true,
3764
4150
  envelope: true
3765
4151
  }, { uid: true });
3766
- return msg?.envelope.messageId ?? null;
4152
+ if (!msg) return null;
4153
+ return msg.envelope?.messageId ?? null;
3767
4154
  } finally {
3768
4155
  lock.release();
3769
4156
  }
@@ -3771,7 +4158,7 @@ async function getMessageId(config, uid) {
3771
4158
  await client.logout();
3772
4159
  }
3773
4160
  }
3774
- var mailReplyCommand = new import_commander44.Command("reply").description("\uBA54\uC77C \uB2F5\uC7A5").argument("<uid>", "\uC6D0\uBCF8 \uBA54\uC77C UID").option("--body <text>", "\uB2F5\uC7A5 \uBCF8\uBB38").option("--body-file <path>", "\uB2F5\uC7A5 \uBCF8\uBB38 \uD30C\uC77C \uACBD\uB85C").option("--cc <addresses...>", "\uCC38\uC870").option("--html", "\uBCF8\uBB38\uC744 HTML\uB85C \uC804\uC1A1").action(async (uid, opts) => {
4161
+ var mailReplyCommand = new import_commander45.Command("reply").description("\uBA54\uC77C \uB2F5\uC7A5").argument("<uid>", "\uC6D0\uBCF8 \uBA54\uC77C UID").option("--body <text>", "\uB2F5\uC7A5 \uBCF8\uBB38").option("--body-file <path>", "\uB2F5\uC7A5 \uBCF8\uBB38 \uD30C\uC77C \uACBD\uB85C").option("--cc <addresses...>", "\uCC38\uC870").option("--html", "\uBCF8\uBB38\uC744 HTML\uB85C \uC804\uC1A1").action(async (uid, opts) => {
3775
4162
  const globalOpts = mailReplyCommand.optsWithGlobals();
3776
4163
  const config = await getConfigOrThrow();
3777
4164
  let body = opts.body ?? "";
@@ -3812,7 +4199,7 @@ var mailReplyCommand = new import_commander44.Command("reply").description("\uBA
3812
4199
  });
3813
4200
 
3814
4201
  // src/commands/feedback.ts
3815
- var import_commander45 = require("commander");
4202
+ var import_commander46 = require("commander");
3816
4203
  var import_node_child_process2 = require("child_process");
3817
4204
  var import_node_util = require("util");
3818
4205
  var import_promises15 = require("fs/promises");
@@ -3923,7 +4310,7 @@ async function readBody(opts) {
3923
4310
  if (opts.bodyFile) return await (0, import_promises15.readFile)(opts.bodyFile, "utf-8");
3924
4311
  return void 0;
3925
4312
  }
3926
- var feedbackCommand = new import_commander45.Command("feedback").description("dooray-cli\uC5D0 \uB300\uD55C GitHub issue \uB4F1\uB85D (gh CLI \uC704\uC784)").option("--title <text>", "\uC774\uC288 \uC81C\uBAA9 (\uC5C6\uC73C\uBA74 \uC778\uD130\uB799\uD2F0\uBE0C)").option("--body <text>", "\uC774\uC288 \uBCF8\uBB38").option("--body-file <path>", "\uBCF8\uBB38 \uD30C\uC77C \uACBD\uB85C").option(
4313
+ var feedbackCommand = new import_commander46.Command("feedback").description("dooray-cli\uC5D0 \uB300\uD55C GitHub issue \uB4F1\uB85D (gh CLI \uC704\uC784)").option("--title <text>", "\uC774\uC288 \uC81C\uBAA9 (\uC5C6\uC73C\uBA74 \uC778\uD130\uB799\uD2F0\uBE0C)").option("--body <text>", "\uC774\uC288 \uBCF8\uBB38").option("--body-file <path>", "\uBCF8\uBB38 \uD30C\uC77C \uACBD\uB85C").option(
3927
4314
  "--label <name>",
3928
4315
  "\uB77C\uBCA8 (\uBC18\uBCF5 \uAC00\uB2A5)",
3929
4316
  (value, prev) => [...prev, value],
@@ -4086,8 +4473,8 @@ function sanitizeArgv(argv) {
4086
4473
  }
4087
4474
 
4088
4475
  // src/index.ts
4089
- var program = new import_commander46.Command();
4090
- program.name("dooray").description("Dooray REST API CLI").version("0.6.0").option("--json", "JSON \uD615\uC2DD\uC73C\uB85C \uCD9C\uB825").option("--quiet", "ID\uB9CC \uCD9C\uB825").option("--no-color", "\uC0C9\uC0C1 \uBE44\uD65C\uC131\uD654");
4476
+ var program = new import_commander47.Command();
4477
+ program.name("dooray").description("Dooray REST API CLI").version("0.8.0").option("--json", "JSON \uD615\uC2DD\uC73C\uB85C \uCD9C\uB825").option("--quiet", "ID\uB9CC \uCD9C\uB825").option("--no-color", "\uC0C9\uC0C1 \uBE44\uD65C\uC131\uD654");
4091
4478
  program.hook("preAction", () => {
4092
4479
  const opts = program.opts();
4093
4480
  if (opts.color === false || process.env.NO_COLOR) {
@@ -4097,13 +4484,13 @@ program.hook("preAction", () => {
4097
4484
  setQuiet(true);
4098
4485
  }
4099
4486
  });
4100
- var projectCommand = new import_commander46.Command("project").description("\uD504\uB85C\uC81D\uD2B8 \uAD00\uB828 \uBA85\uB839");
4487
+ var projectCommand = new import_commander47.Command("project").description("\uD504\uB85C\uC81D\uD2B8 \uAD00\uB828 \uBA85\uB839");
4101
4488
  projectCommand.addCommand(projectListCommand);
4102
4489
  projectCommand.addCommand(projectMembersCommand);
4103
4490
  projectCommand.addCommand(projectWorkflowsCommand);
4104
4491
  projectCommand.addCommand(projectGroupsCommand);
4105
4492
  projectCommand.addCommand(projectTagsCommand);
4106
- var postCommand = new import_commander46.Command("post").description("\uC5C5\uBB34 \uAD00\uB828 \uBA85\uB839");
4493
+ var postCommand = new import_commander47.Command("post").description("\uC5C5\uBB34 \uAD00\uB828 \uBA85\uB839");
4107
4494
  postCommand.addCommand(postListCommand);
4108
4495
  postCommand.addCommand(postSearchCommand);
4109
4496
  postCommand.addCommand(postGetCommand);
@@ -4111,30 +4498,31 @@ postCommand.addCommand(postEditCommand);
4111
4498
  postCommand.addCommand(postCreateCommand);
4112
4499
  postCommand.addCommand(postDoneCommand);
4113
4500
  postCommand.addCommand(postWorkflowCommand);
4114
- var commentCommand = new import_commander46.Command("comment").description("\uB313\uAE00 \uAD00\uB828 \uBA85\uB839");
4501
+ var commentCommand = new import_commander47.Command("comment").description("\uB313\uAE00 \uAD00\uB828 \uBA85\uB839");
4115
4502
  commentCommand.addCommand(commentListCommand);
4116
4503
  commentCommand.addCommand(commentLatestCommand);
4504
+ commentCommand.addCommand(commentGetCommand);
4117
4505
  commentCommand.addCommand(commentAddCommand);
4118
4506
  commentCommand.addCommand(commentEditCommand);
4119
4507
  commentCommand.addCommand(commentDeleteCommand);
4120
4508
  commentCommand.addCommand(commentFileCommand);
4121
4509
  postCommand.addCommand(commentCommand);
4122
- var fileCommand = new import_commander46.Command("file").description("\uCCA8\uBD80\uD30C\uC77C \uAD00\uB828 \uBA85\uB839");
4510
+ var fileCommand = new import_commander47.Command("file").description("\uCCA8\uBD80\uD30C\uC77C \uAD00\uB828 \uBA85\uB839");
4123
4511
  fileCommand.addCommand(fileListCommand);
4124
4512
  fileCommand.addCommand(fileDownloadCommand);
4125
4513
  fileCommand.addCommand(fileDownloadAllCommand);
4126
4514
  fileCommand.addCommand(fileUploadCommand);
4127
4515
  fileCommand.addCommand(fileDeleteCommand);
4128
4516
  postCommand.addCommand(fileCommand);
4129
- var wikiCommand = new import_commander46.Command("wiki").description("\uC704\uD0A4 \uAD00\uB828 \uBA85\uB839");
4517
+ var wikiCommand = new import_commander47.Command("wiki").description("\uC704\uD0A4 \uAD00\uB828 \uBA85\uB839");
4130
4518
  wikiCommand.addCommand(wikiListCommand);
4131
4519
  wikiCommand.addCommand(wikiPagesCommand);
4132
- var wikiPageCommand = new import_commander46.Command("page").description("\uC704\uD0A4 \uD398\uC774\uC9C0 \uAD00\uB828 \uBA85\uB839");
4520
+ var wikiPageCommand = new import_commander47.Command("page").description("\uC704\uD0A4 \uD398\uC774\uC9C0 \uAD00\uB828 \uBA85\uB839");
4133
4521
  wikiPageCommand.addCommand(wikiPageGetCommand);
4134
4522
  wikiPageCommand.addCommand(wikiPageCreateCommand);
4135
4523
  wikiPageCommand.addCommand(wikiPageEditCommand);
4136
4524
  wikiCommand.addCommand(wikiPageCommand);
4137
- var mailCommand = new import_commander46.Command("mail").description("\uBA54\uC77C \uAD00\uB828 \uBA85\uB839");
4525
+ var mailCommand = new import_commander47.Command("mail").description("\uBA54\uC77C \uAD00\uB828 \uBA85\uB839");
4138
4526
  mailCommand.addCommand(mailListCommand);
4139
4527
  mailCommand.addCommand(mailGetCommand);
4140
4528
  mailCommand.addCommand(mailSendCommand);