@bifos/dooray-cli 0.8.0 → 0.9.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/README.md +68 -0
- package/dist/index.js +444 -156
- package/package.json +1 -1
- package/skills/dooray-cli/SKILL.md +66 -0
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
|
|
27
|
+
var import_commander48 = require("commander");
|
|
28
28
|
var import_chalk7 = __toESM(require("chalk"));
|
|
29
29
|
|
|
30
30
|
// src/commands/config.ts
|
|
@@ -205,6 +205,7 @@ var TAGS_DIR = (0, import_node_path2.join)(CACHE_DIR, "tags");
|
|
|
205
205
|
var MILESTONES_DIR = (0, import_node_path2.join)(CACHE_DIR, "milestones");
|
|
206
206
|
var MEMBER_GROUPS_DIR = (0, import_node_path2.join)(CACHE_DIR, "member-groups");
|
|
207
207
|
var WIKIS_PATH = (0, import_node_path2.join)(CACHE_DIR, "wikis.json");
|
|
208
|
+
var TEMPLATES_DIR = (0, import_node_path2.join)(CACHE_DIR, "templates");
|
|
208
209
|
async function ensureDir2(dir) {
|
|
209
210
|
await (0, import_promises2.mkdir)(dir, { recursive: true });
|
|
210
211
|
}
|
|
@@ -291,6 +292,15 @@ async function getMemberGroups(projectId) {
|
|
|
291
292
|
async function setMemberGroups(projectId, items) {
|
|
292
293
|
await writeJson(memberGroupsPath(projectId), { updatedAt: now(), data: items });
|
|
293
294
|
}
|
|
295
|
+
function templatesPath(projectId) {
|
|
296
|
+
return (0, import_node_path2.join)(TEMPLATES_DIR, `${projectId}.json`);
|
|
297
|
+
}
|
|
298
|
+
async function getTemplates(projectId) {
|
|
299
|
+
return readJson(templatesPath(projectId));
|
|
300
|
+
}
|
|
301
|
+
async function setTemplates(projectId, items) {
|
|
302
|
+
await writeJson(templatesPath(projectId), { updatedAt: now(), data: items });
|
|
303
|
+
}
|
|
294
304
|
async function getWikis() {
|
|
295
305
|
return readJson(WIKIS_PATH);
|
|
296
306
|
}
|
|
@@ -414,7 +424,7 @@ var DoorayApiClient = class {
|
|
|
414
424
|
try {
|
|
415
425
|
return await this.api.get("common/v1/members/me").json();
|
|
416
426
|
} catch (e) {
|
|
417
|
-
|
|
427
|
+
throw await toDoorayCliError(e);
|
|
418
428
|
}
|
|
419
429
|
}
|
|
420
430
|
// ─── Projects ───────────────────────────────────────
|
|
@@ -431,7 +441,7 @@ var DoorayApiClient = class {
|
|
|
431
441
|
}
|
|
432
442
|
}).json();
|
|
433
443
|
} catch (e) {
|
|
434
|
-
|
|
444
|
+
throw await toDoorayCliError(e);
|
|
435
445
|
}
|
|
436
446
|
}
|
|
437
447
|
// ─── Posts ──────────────────────────────────────────
|
|
@@ -458,42 +468,42 @@ var DoorayApiClient = class {
|
|
|
458
468
|
}
|
|
459
469
|
}).json();
|
|
460
470
|
} catch (e) {
|
|
461
|
-
|
|
471
|
+
throw await toDoorayCliError(e);
|
|
462
472
|
}
|
|
463
473
|
}
|
|
464
474
|
async getPost(projectId, postId) {
|
|
465
475
|
try {
|
|
466
476
|
return await this.api.get(`project/v1/projects/${projectId}/posts/${postId}`).json();
|
|
467
477
|
} catch (e) {
|
|
468
|
-
|
|
478
|
+
throw await toDoorayCliError(e);
|
|
469
479
|
}
|
|
470
480
|
}
|
|
471
481
|
async getPostStandalone(postId) {
|
|
472
482
|
try {
|
|
473
483
|
return await this.api.get(`project/v1/posts/${postId}`).json();
|
|
474
484
|
} catch (e) {
|
|
475
|
-
|
|
485
|
+
throw await toDoorayCliError(e);
|
|
476
486
|
}
|
|
477
487
|
}
|
|
478
488
|
async createPost(projectId, body) {
|
|
479
489
|
try {
|
|
480
490
|
return await this.api.post(`project/v1/projects/${projectId}/posts`, { json: body }).json();
|
|
481
491
|
} catch (e) {
|
|
482
|
-
|
|
492
|
+
throw await toDoorayCliError(e);
|
|
483
493
|
}
|
|
484
494
|
}
|
|
485
495
|
async updatePost(projectId, postId, body) {
|
|
486
496
|
try {
|
|
487
497
|
return await this.api.put(`project/v1/projects/${projectId}/posts/${postId}`, { json: body }).json();
|
|
488
498
|
} catch (e) {
|
|
489
|
-
|
|
499
|
+
throw await toDoorayCliError(e);
|
|
490
500
|
}
|
|
491
501
|
}
|
|
492
502
|
async setPostDone(projectId, postId) {
|
|
493
503
|
try {
|
|
494
504
|
return await this.api.post(`project/v1/projects/${projectId}/posts/${postId}/set-done`).json();
|
|
495
505
|
} catch (e) {
|
|
496
|
-
|
|
506
|
+
throw await toDoorayCliError(e);
|
|
497
507
|
}
|
|
498
508
|
}
|
|
499
509
|
async setPostWorkflow(projectId, postId, workflowId) {
|
|
@@ -502,7 +512,7 @@ var DoorayApiClient = class {
|
|
|
502
512
|
json: { workflowId }
|
|
503
513
|
}).json();
|
|
504
514
|
} catch (e) {
|
|
505
|
-
|
|
515
|
+
throw await toDoorayCliError(e);
|
|
506
516
|
}
|
|
507
517
|
}
|
|
508
518
|
async setPostParent(projectId, postId, parentPostId) {
|
|
@@ -511,7 +521,7 @@ var DoorayApiClient = class {
|
|
|
511
521
|
json: { parentPostId }
|
|
512
522
|
}).json();
|
|
513
523
|
} catch (e) {
|
|
514
|
-
|
|
524
|
+
throw await toDoorayCliError(e);
|
|
515
525
|
}
|
|
516
526
|
}
|
|
517
527
|
// ─── Post Comments ──────────────────────────────────
|
|
@@ -525,35 +535,35 @@ var DoorayApiClient = class {
|
|
|
525
535
|
}
|
|
526
536
|
}).json();
|
|
527
537
|
} catch (e) {
|
|
528
|
-
|
|
538
|
+
throw await toDoorayCliError(e);
|
|
529
539
|
}
|
|
530
540
|
}
|
|
531
541
|
async getPostComment(projectId, postId, logId) {
|
|
532
542
|
try {
|
|
533
543
|
return await this.api.get(`project/v1/projects/${projectId}/posts/${postId}/logs/${logId}`).json();
|
|
534
544
|
} catch (e) {
|
|
535
|
-
|
|
545
|
+
throw await toDoorayCliError(e);
|
|
536
546
|
}
|
|
537
547
|
}
|
|
538
548
|
async createPostComment(projectId, postId, body) {
|
|
539
549
|
try {
|
|
540
550
|
return await this.api.post(`project/v1/projects/${projectId}/posts/${postId}/logs`, { json: body }).json();
|
|
541
551
|
} catch (e) {
|
|
542
|
-
|
|
552
|
+
throw await toDoorayCliError(e);
|
|
543
553
|
}
|
|
544
554
|
}
|
|
545
555
|
async updatePostComment(projectId, postId, logId, body) {
|
|
546
556
|
try {
|
|
547
557
|
return await this.api.put(`project/v1/projects/${projectId}/posts/${postId}/logs/${logId}`, { json: body }).json();
|
|
548
558
|
} catch (e) {
|
|
549
|
-
|
|
559
|
+
throw await toDoorayCliError(e);
|
|
550
560
|
}
|
|
551
561
|
}
|
|
552
562
|
async deletePostComment(projectId, postId, logId) {
|
|
553
563
|
try {
|
|
554
564
|
return await this.api.delete(`project/v1/projects/${projectId}/posts/${postId}/logs/${logId}`).json();
|
|
555
565
|
} catch (e) {
|
|
556
|
-
|
|
566
|
+
throw await toDoorayCliError(e);
|
|
557
567
|
}
|
|
558
568
|
}
|
|
559
569
|
// ─── Members ────────────────────────────────────────
|
|
@@ -567,14 +577,14 @@ var DoorayApiClient = class {
|
|
|
567
577
|
}
|
|
568
578
|
}).json();
|
|
569
579
|
} catch (e) {
|
|
570
|
-
|
|
580
|
+
throw await toDoorayCliError(e);
|
|
571
581
|
}
|
|
572
582
|
}
|
|
573
583
|
async getMemberDetail(memberId) {
|
|
574
584
|
try {
|
|
575
585
|
return await this.api.get(`common/v1/members/${memberId}`).json();
|
|
576
586
|
} catch (e) {
|
|
577
|
-
|
|
587
|
+
throw await toDoorayCliError(e);
|
|
578
588
|
}
|
|
579
589
|
}
|
|
580
590
|
async searchMembers(params) {
|
|
@@ -591,7 +601,7 @@ var DoorayApiClient = class {
|
|
|
591
601
|
}
|
|
592
602
|
}).json();
|
|
593
603
|
} catch (e) {
|
|
594
|
-
|
|
604
|
+
throw await toDoorayCliError(e);
|
|
595
605
|
}
|
|
596
606
|
}
|
|
597
607
|
// ─── Workflows ──────────────────────────────────────
|
|
@@ -599,7 +609,7 @@ var DoorayApiClient = class {
|
|
|
599
609
|
try {
|
|
600
610
|
return await this.api.get(`project/v1/projects/${projectId}/workflows`).json();
|
|
601
611
|
} catch (e) {
|
|
602
|
-
|
|
612
|
+
throw await toDoorayCliError(e);
|
|
603
613
|
}
|
|
604
614
|
}
|
|
605
615
|
// ─── Tags ───────────────────────────────────────────
|
|
@@ -612,7 +622,7 @@ var DoorayApiClient = class {
|
|
|
612
622
|
}
|
|
613
623
|
}).json();
|
|
614
624
|
} catch (e) {
|
|
615
|
-
|
|
625
|
+
throw await toDoorayCliError(e);
|
|
616
626
|
}
|
|
617
627
|
}
|
|
618
628
|
// ─── Member Groups ──────────────────────────────────
|
|
@@ -625,7 +635,7 @@ var DoorayApiClient = class {
|
|
|
625
635
|
}
|
|
626
636
|
}).json();
|
|
627
637
|
} catch (e) {
|
|
628
|
-
|
|
638
|
+
throw await toDoorayCliError(e);
|
|
629
639
|
}
|
|
630
640
|
}
|
|
631
641
|
// ─── Milestones ─────────────────────────────────────
|
|
@@ -638,7 +648,7 @@ var DoorayApiClient = class {
|
|
|
638
648
|
}
|
|
639
649
|
}).json();
|
|
640
650
|
} catch (e) {
|
|
641
|
-
|
|
651
|
+
throw await toDoorayCliError(e);
|
|
642
652
|
}
|
|
643
653
|
}
|
|
644
654
|
// ─── Wiki ───────────────────────────────────────────
|
|
@@ -651,7 +661,7 @@ var DoorayApiClient = class {
|
|
|
651
661
|
}
|
|
652
662
|
}).json();
|
|
653
663
|
} catch (e) {
|
|
654
|
-
|
|
664
|
+
throw await toDoorayCliError(e);
|
|
655
665
|
}
|
|
656
666
|
}
|
|
657
667
|
async getWikiPages(wikiId, parentPageId) {
|
|
@@ -662,42 +672,42 @@ var DoorayApiClient = class {
|
|
|
662
672
|
}
|
|
663
673
|
}).json();
|
|
664
674
|
} catch (e) {
|
|
665
|
-
|
|
675
|
+
throw await toDoorayCliError(e);
|
|
666
676
|
}
|
|
667
677
|
}
|
|
668
678
|
async getWikiPage(wikiId, pageId) {
|
|
669
679
|
try {
|
|
670
680
|
return await this.api.get(`wiki/v1/wikis/${wikiId}/pages/${pageId}`).json();
|
|
671
681
|
} catch (e) {
|
|
672
|
-
|
|
682
|
+
throw await toDoorayCliError(e);
|
|
673
683
|
}
|
|
674
684
|
}
|
|
675
685
|
async createWikiPage(wikiId, body) {
|
|
676
686
|
try {
|
|
677
687
|
return await this.api.post(`wiki/v1/wikis/${wikiId}/pages`, { json: body }).json();
|
|
678
688
|
} catch (e) {
|
|
679
|
-
|
|
689
|
+
throw await toDoorayCliError(e);
|
|
680
690
|
}
|
|
681
691
|
}
|
|
682
692
|
async updateWikiPage(wikiId, pageId, body) {
|
|
683
693
|
try {
|
|
684
694
|
return await this.api.put(`wiki/v1/wikis/${wikiId}/pages/${pageId}`, { json: body }).json();
|
|
685
695
|
} catch (e) {
|
|
686
|
-
|
|
696
|
+
throw await toDoorayCliError(e);
|
|
687
697
|
}
|
|
688
698
|
}
|
|
689
699
|
async updateWikiPageTitle(wikiId, pageId, body) {
|
|
690
700
|
try {
|
|
691
701
|
return await this.api.put(`wiki/v1/wikis/${wikiId}/pages/${pageId}/title`, { json: body }).json();
|
|
692
702
|
} catch (e) {
|
|
693
|
-
|
|
703
|
+
throw await toDoorayCliError(e);
|
|
694
704
|
}
|
|
695
705
|
}
|
|
696
706
|
async updateWikiPageContent(wikiId, pageId, body) {
|
|
697
707
|
try {
|
|
698
708
|
return await this.api.put(`wiki/v1/wikis/${wikiId}/pages/${pageId}/content`, { json: body }).json();
|
|
699
709
|
} catch (e) {
|
|
700
|
-
|
|
710
|
+
throw await toDoorayCliError(e);
|
|
701
711
|
}
|
|
702
712
|
}
|
|
703
713
|
// ─── Post Files ─────────────────────────────────────
|
|
@@ -705,7 +715,7 @@ var DoorayApiClient = class {
|
|
|
705
715
|
try {
|
|
706
716
|
return await this.api.get(`project/v1/projects/${projectId}/posts/${postId}/files`).json();
|
|
707
717
|
} catch (e) {
|
|
708
|
-
|
|
718
|
+
throw await toDoorayCliError(e);
|
|
709
719
|
}
|
|
710
720
|
}
|
|
711
721
|
async getPostFileMeta(projectId, postId, fileId) {
|
|
@@ -714,7 +724,7 @@ var DoorayApiClient = class {
|
|
|
714
724
|
searchParams: { media: "meta" }
|
|
715
725
|
}).json();
|
|
716
726
|
} catch (e) {
|
|
717
|
-
|
|
727
|
+
throw await toDoorayCliError(e);
|
|
718
728
|
}
|
|
719
729
|
}
|
|
720
730
|
async downloadPostFile(projectId, postId, fileId) {
|
|
@@ -744,7 +754,7 @@ var DoorayApiClient = class {
|
|
|
744
754
|
return { buffer, fileName };
|
|
745
755
|
} catch (e) {
|
|
746
756
|
if (e instanceof DoorayCliError) throw e;
|
|
747
|
-
|
|
757
|
+
throw await toDoorayCliError(e);
|
|
748
758
|
}
|
|
749
759
|
}
|
|
750
760
|
async uploadPostFile(projectId, postId, filePath) {
|
|
@@ -781,14 +791,36 @@ var DoorayApiClient = class {
|
|
|
781
791
|
return await res.json();
|
|
782
792
|
} catch (e) {
|
|
783
793
|
if (e instanceof DoorayCliError) throw e;
|
|
784
|
-
|
|
794
|
+
throw await toDoorayCliError(e);
|
|
785
795
|
}
|
|
786
796
|
}
|
|
787
797
|
async deletePostFile(projectId, postId, fileId) {
|
|
788
798
|
try {
|
|
789
799
|
return await this.api.delete(`project/v1/projects/${projectId}/posts/${postId}/files/${fileId}`).json();
|
|
790
800
|
} catch (e) {
|
|
791
|
-
|
|
801
|
+
throw await toDoorayCliError(e);
|
|
802
|
+
}
|
|
803
|
+
}
|
|
804
|
+
// ─── Templates ──────────────────────────────────────
|
|
805
|
+
async getProjectTemplates(projectId, params) {
|
|
806
|
+
try {
|
|
807
|
+
return await this.api.get(`project/v1/projects/${projectId}/templates`, {
|
|
808
|
+
searchParams: {
|
|
809
|
+
...params?.page != null && { page: params.page },
|
|
810
|
+
...params?.size != null && { size: params.size }
|
|
811
|
+
}
|
|
812
|
+
}).json();
|
|
813
|
+
} catch (e) {
|
|
814
|
+
throw await toDoorayCliError(e);
|
|
815
|
+
}
|
|
816
|
+
}
|
|
817
|
+
async getProjectTemplateDetail(projectId, templateId, interpolation = true) {
|
|
818
|
+
try {
|
|
819
|
+
return await this.api.get(`project/v1/projects/${projectId}/templates/${templateId}`, {
|
|
820
|
+
searchParams: { interpolation: String(interpolation) }
|
|
821
|
+
}).json();
|
|
822
|
+
} catch (e) {
|
|
823
|
+
throw await toDoorayCliError(e);
|
|
792
824
|
}
|
|
793
825
|
}
|
|
794
826
|
};
|
|
@@ -803,6 +835,7 @@ var MILESTONES_TTL_MS = 864e5;
|
|
|
803
835
|
var RESOLVER_FETCH_PAGE_SIZE = 100;
|
|
804
836
|
var MEMBER_GROUPS_TTL_MS = 864e5;
|
|
805
837
|
var WIKIS_TTL_MS = 864e5;
|
|
838
|
+
var TEMPLATES_TTL_MS = 864e5;
|
|
806
839
|
|
|
807
840
|
// src/resolvers/me.ts
|
|
808
841
|
async function ensureMe(client) {
|
|
@@ -1182,7 +1215,7 @@ var projectListCommand = new import_commander5.Command("list").description("\uD5
|
|
|
1182
1215
|
var import_commander6 = require("commander");
|
|
1183
1216
|
|
|
1184
1217
|
// src/resolvers/match.ts
|
|
1185
|
-
function matchByName(items, input2, label, renderCandidate) {
|
|
1218
|
+
function matchByName(items, input2, label, renderCandidate, options) {
|
|
1186
1219
|
const exact = items.filter((i) => i.name === input2);
|
|
1187
1220
|
if (exact.length === 1) return exact[0];
|
|
1188
1221
|
if (exact.length > 1) {
|
|
@@ -1192,7 +1225,7 @@ function matchByName(items, input2, label, renderCandidate) {
|
|
|
1192
1225
|
EXIT_PARAM_ERROR
|
|
1193
1226
|
);
|
|
1194
1227
|
}
|
|
1195
|
-
const partial = items.filter((i) => i.name.includes(input2));
|
|
1228
|
+
const partial = items.filter((i) => !!i.name && i.name.includes(input2));
|
|
1196
1229
|
if (partial.length === 1) return partial[0];
|
|
1197
1230
|
if (partial.length > 1) {
|
|
1198
1231
|
throw new DoorayCliError(
|
|
@@ -1201,13 +1234,26 @@ function matchByName(items, input2, label, renderCandidate) {
|
|
|
1201
1234
|
EXIT_PARAM_ERROR
|
|
1202
1235
|
);
|
|
1203
1236
|
}
|
|
1237
|
+
const SAMPLE_LIMIT = 5;
|
|
1238
|
+
let counter = "";
|
|
1239
|
+
let hint = "";
|
|
1240
|
+
if (items.length > 0) {
|
|
1241
|
+
const sampleLines = items.slice(0, SAMPLE_LIMIT).map((i) => ` - ${renderCandidate(i)}`).join("\n");
|
|
1242
|
+
counter = `
|
|
1243
|
+
\uC0AC\uC6A9 \uAC00\uB2A5\uD55C ${label} (${Math.min(SAMPLE_LIMIT, items.length)}/${items.length}):
|
|
1244
|
+
${sampleLines}`;
|
|
1245
|
+
hint = options?.helpHint ? `
|
|
1246
|
+
\uC804\uCCB4 \uBAA9\uB85D: ${options.helpHint}` : "";
|
|
1247
|
+
}
|
|
1204
1248
|
throw new DoorayCliError(
|
|
1205
|
-
`${label}\uC744(\uB97C) \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4: ${input2}`,
|
|
1249
|
+
`${label}\uC744(\uB97C) \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4: ${input2}${counter}${hint}`,
|
|
1206
1250
|
EXIT_PARAM_ERROR
|
|
1207
1251
|
);
|
|
1208
1252
|
}
|
|
1209
1253
|
|
|
1210
1254
|
// src/resolvers/member.ts
|
|
1255
|
+
var MEMBER_ID_RE = /^\d{15,}$/;
|
|
1256
|
+
var EMAIL_RE = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
|
|
1211
1257
|
async function fetchAllMembers(client, projectId) {
|
|
1212
1258
|
const memberIds = [];
|
|
1213
1259
|
let page = 0;
|
|
@@ -1257,6 +1303,38 @@ async function buildMemberNameMap(client, projectId) {
|
|
|
1257
1303
|
return map;
|
|
1258
1304
|
}
|
|
1259
1305
|
async function resolveMember(client, projectId, input2) {
|
|
1306
|
+
if (MEMBER_ID_RE.test(input2)) {
|
|
1307
|
+
try {
|
|
1308
|
+
await client.getMemberDetail(input2);
|
|
1309
|
+
return input2;
|
|
1310
|
+
} catch (err) {
|
|
1311
|
+
if (err instanceof DoorayCliError && err.exitCode === EXIT_API_ERROR) {
|
|
1312
|
+
throw new DoorayCliError(
|
|
1313
|
+
`organizationMemberId \uB97C \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4: ${input2} (\uC6D0\uC778: ${err.message})`,
|
|
1314
|
+
EXIT_PARAM_ERROR
|
|
1315
|
+
);
|
|
1316
|
+
}
|
|
1317
|
+
throw err;
|
|
1318
|
+
}
|
|
1319
|
+
}
|
|
1320
|
+
if (EMAIL_RE.test(input2)) {
|
|
1321
|
+
const res = await client.searchMembers({ externalEmailAddresses: input2 });
|
|
1322
|
+
const hits = res.result;
|
|
1323
|
+
if (hits.length === 0) {
|
|
1324
|
+
throw new DoorayCliError(
|
|
1325
|
+
`\uC774\uBA54\uC77C\uB85C \uBA64\uBC84\uB97C \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4: ${input2}`,
|
|
1326
|
+
EXIT_PARAM_ERROR
|
|
1327
|
+
);
|
|
1328
|
+
}
|
|
1329
|
+
if (hits.length > 1) {
|
|
1330
|
+
throw new DoorayCliError(
|
|
1331
|
+
`\uBCF5\uC218\uC758 \uBA64\uBC84\uAC00 \uB9E4\uCE6D\uB429\uB2C8\uB2E4(\uC774\uBA54\uC77C): "${input2}"
|
|
1332
|
+
` + hits.map((m) => ` - ${m.name} (${m.id})`).join("\n"),
|
|
1333
|
+
EXIT_PARAM_ERROR
|
|
1334
|
+
);
|
|
1335
|
+
}
|
|
1336
|
+
return hits[0].id;
|
|
1337
|
+
}
|
|
1260
1338
|
const members = await ensureMembers(client, projectId);
|
|
1261
1339
|
const match = matchByName(
|
|
1262
1340
|
members,
|
|
@@ -1368,10 +1446,23 @@ async function ensureMemberGroups(client, projectId) {
|
|
|
1368
1446
|
await setMemberGroups(projectId, items);
|
|
1369
1447
|
return items;
|
|
1370
1448
|
}
|
|
1449
|
+
function hasValidCode(g) {
|
|
1450
|
+
return typeof g.code === "string" && g.code.length > 0;
|
|
1451
|
+
}
|
|
1371
1452
|
async function resolveMemberGroup(client, projectId, input2) {
|
|
1372
1453
|
const groups = await ensureMemberGroups(client, projectId);
|
|
1373
|
-
const
|
|
1374
|
-
const
|
|
1454
|
+
const valid = groups.filter(hasValidCode);
|
|
1455
|
+
const skipped = groups.length - valid.length;
|
|
1456
|
+
if (skipped > 0) {
|
|
1457
|
+
process.stderr.write(
|
|
1458
|
+
`\u26A0 ${skipped}\uAC1C \uADF8\uB8F9\uC5D0 code \uAC00 \uC5C6\uC5B4 \uB9E4\uCE6D\uC5D0\uC11C \uC81C\uC678\uD588\uC2B5\uB2C8\uB2E4 (Dooray API \uC751\uB2F5 mismatch \u2014 ADR-026).
|
|
1459
|
+
`
|
|
1460
|
+
);
|
|
1461
|
+
}
|
|
1462
|
+
const adapter = valid.map((g) => ({ name: g.code, id: g.id, code: g.code }));
|
|
1463
|
+
const match = matchByName(adapter, input2, "\uADF8\uB8F9", (g) => `${g.code} (${g.id})`, {
|
|
1464
|
+
helpHint: "dooray project groups <project>"
|
|
1465
|
+
});
|
|
1375
1466
|
return { id: match.id, code: match.code };
|
|
1376
1467
|
}
|
|
1377
1468
|
|
|
@@ -1386,7 +1477,7 @@ var projectGroupsCommand = new import_commander8.Command("groups").description("
|
|
|
1386
1477
|
stopSpinner(true, "\uBA64\uBC84 \uADF8\uB8F9 \uBAA9\uB85D \uC870\uD68C \uC644\uB8CC");
|
|
1387
1478
|
output(globalOpts, {
|
|
1388
1479
|
headers: ["ID", "Code"],
|
|
1389
|
-
rows: groups.map((g) => [g.id, g.code]),
|
|
1480
|
+
rows: groups.map((g) => [g.id, g.code ?? "-"]),
|
|
1390
1481
|
raw: groups,
|
|
1391
1482
|
ids: groups.map((g) => g.id)
|
|
1392
1483
|
});
|
|
@@ -1503,6 +1594,63 @@ async function resolveTags(client, projectId, inputs) {
|
|
|
1503
1594
|
}
|
|
1504
1595
|
return selected.map((t) => t.id);
|
|
1505
1596
|
}
|
|
1597
|
+
async function lookupTagIds(client, projectId, names) {
|
|
1598
|
+
if (names.length === 0) return [];
|
|
1599
|
+
const tags = await ensureTags(client, projectId);
|
|
1600
|
+
return names.map(
|
|
1601
|
+
(n) => matchByName(
|
|
1602
|
+
tags,
|
|
1603
|
+
n,
|
|
1604
|
+
"\uD0DC\uADF8",
|
|
1605
|
+
(t) => t.groupName ? `${t.groupName} / ${t.name} (${t.id})` : `${t.name} (${t.id})`
|
|
1606
|
+
).id
|
|
1607
|
+
);
|
|
1608
|
+
}
|
|
1609
|
+
async function validateMandatoryCoverage(client, projectId, selectedTagIds) {
|
|
1610
|
+
const tags = await ensureTags(client, projectId);
|
|
1611
|
+
const selectedSet = new Set(selectedTagIds);
|
|
1612
|
+
const mandatoryGroups = /* @__PURE__ */ new Map();
|
|
1613
|
+
for (const t of tags) {
|
|
1614
|
+
if (!t.groupMandatory || !t.groupId) continue;
|
|
1615
|
+
let group = mandatoryGroups.get(t.groupId);
|
|
1616
|
+
if (!group) {
|
|
1617
|
+
group = { groupName: t.groupName ?? `\uADF8\uB8F9 ${t.groupId}`, tagsInGroup: [] };
|
|
1618
|
+
mandatoryGroups.set(t.groupId, group);
|
|
1619
|
+
}
|
|
1620
|
+
group.tagsInGroup.push(t);
|
|
1621
|
+
}
|
|
1622
|
+
for (const [, info] of mandatoryGroups) {
|
|
1623
|
+
const covered = info.tagsInGroup.some((t) => selectedSet.has(t.id));
|
|
1624
|
+
if (!covered) {
|
|
1625
|
+
const candidates = info.tagsInGroup.map((t) => `${t.name} (${t.id})`).join(", ");
|
|
1626
|
+
throw new DoorayCliError(
|
|
1627
|
+
`\uD544\uC218 \uD0DC\uADF8 \uADF8\uB8F9 "${info.groupName}" \uC5D0\uC11C \uCD5C\uC18C 1\uAC1C \uC120\uD0DD \uD544\uC694
|
|
1628
|
+
\uD6C4\uBCF4: ${candidates}`,
|
|
1629
|
+
EXIT_PARAM_ERROR
|
|
1630
|
+
);
|
|
1631
|
+
}
|
|
1632
|
+
}
|
|
1633
|
+
const selectOneGroups = /* @__PURE__ */ new Map();
|
|
1634
|
+
for (const t of tags) {
|
|
1635
|
+
if (!t.groupSelectOne || !t.groupId || !selectedSet.has(t.id)) continue;
|
|
1636
|
+
const entry = selectOneGroups.get(t.groupId) ?? { name: t.groupName ?? `\uADF8\uB8F9 ${t.groupId}`, tags: [] };
|
|
1637
|
+
entry.tags.push(t.name);
|
|
1638
|
+
selectOneGroups.set(t.groupId, entry);
|
|
1639
|
+
}
|
|
1640
|
+
const violators = [];
|
|
1641
|
+
for (const [, info] of selectOneGroups) {
|
|
1642
|
+
if (info.tags.length > 1) {
|
|
1643
|
+
violators.push(`${info.name} (\uC120\uD0DD: ${info.tags.join(", ")})`);
|
|
1644
|
+
}
|
|
1645
|
+
}
|
|
1646
|
+
if (violators.length > 0) {
|
|
1647
|
+
throw new DoorayCliError(
|
|
1648
|
+
`\uB2E4\uC74C \uD0DC\uADF8 \uADF8\uB8F9\uC740 1\uAC1C\uB9CC \uC120\uD0DD \uAC00\uB2A5\uD569\uB2C8\uB2E4:
|
|
1649
|
+
` + violators.map((v) => ` - ${v}`).join("\n"),
|
|
1650
|
+
EXIT_PARAM_ERROR
|
|
1651
|
+
);
|
|
1652
|
+
}
|
|
1653
|
+
}
|
|
1506
1654
|
|
|
1507
1655
|
// src/commands/project/tags.ts
|
|
1508
1656
|
var projectTagsCommand = new import_commander9.Command("tags").description("\uD504\uB85C\uC81D\uD2B8 \uD0DC\uADF8 \uBAA9\uB85D \uC870\uD68C").argument("<project>", "\uD504\uB85C\uC81D\uD2B8 \uCF54\uB4DC \uB610\uB294 ID").action(async (project) => {
|
|
@@ -1527,9 +1675,70 @@ var projectTagsCommand = new import_commander9.Command("tags").description("\uD5
|
|
|
1527
1675
|
});
|
|
1528
1676
|
});
|
|
1529
1677
|
|
|
1530
|
-
// src/commands/
|
|
1678
|
+
// src/commands/project/templates.ts
|
|
1531
1679
|
var import_commander10 = require("commander");
|
|
1532
1680
|
|
|
1681
|
+
// src/resolvers/template.ts
|
|
1682
|
+
var TEMPLATE_ID_RE = /^\d{15,}$/;
|
|
1683
|
+
async function fetchAllTemplates(client, projectId) {
|
|
1684
|
+
const all = [];
|
|
1685
|
+
let page = 0;
|
|
1686
|
+
const size = RESOLVER_FETCH_PAGE_SIZE;
|
|
1687
|
+
while (true) {
|
|
1688
|
+
const res = await client.getProjectTemplates(projectId, { page, size });
|
|
1689
|
+
for (const t of res.result) {
|
|
1690
|
+
all.push({ id: t.id, templateName: t.templateName });
|
|
1691
|
+
}
|
|
1692
|
+
const total = res.totalCount ?? all.length;
|
|
1693
|
+
if (all.length >= total) break;
|
|
1694
|
+
page++;
|
|
1695
|
+
}
|
|
1696
|
+
return all;
|
|
1697
|
+
}
|
|
1698
|
+
async function ensureTemplates(client, projectId) {
|
|
1699
|
+
const entry = await getTemplates(projectId);
|
|
1700
|
+
if (entry && !isExpired(entry.updatedAt, TEMPLATES_TTL_MS)) return entry.data;
|
|
1701
|
+
const items = await fetchAllTemplates(client, projectId);
|
|
1702
|
+
await setTemplates(projectId, items);
|
|
1703
|
+
return items;
|
|
1704
|
+
}
|
|
1705
|
+
async function resolveTemplate(client, projectId, input2) {
|
|
1706
|
+
if (TEMPLATE_ID_RE.test(input2)) return input2;
|
|
1707
|
+
const templates = await ensureTemplates(client, projectId);
|
|
1708
|
+
const match = matchByName(
|
|
1709
|
+
templates.map((t) => ({ name: t.templateName, id: t.id })),
|
|
1710
|
+
input2,
|
|
1711
|
+
"\uD15C\uD50C\uB9BF",
|
|
1712
|
+
(t) => `${t.name} (${t.id})`
|
|
1713
|
+
);
|
|
1714
|
+
return match.id;
|
|
1715
|
+
}
|
|
1716
|
+
|
|
1717
|
+
// src/commands/project/templates.ts
|
|
1718
|
+
var projectTemplatesCommand = new import_commander10.Command("templates").description("\uD504\uB85C\uC81D\uD2B8 \uD15C\uD50C\uB9BF \uBAA9\uB85D \uC870\uD68C").argument("<project>", "\uD504\uB85C\uC81D\uD2B8 \uCF54\uB4DC \uB610\uB294 ID").action(async (project) => {
|
|
1719
|
+
const globalOpts = projectTemplatesCommand.optsWithGlobals();
|
|
1720
|
+
const config = await getConfigOrThrow();
|
|
1721
|
+
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
1722
|
+
startSpinner("\uD15C\uD50C\uB9BF \uBAA9\uB85D \uC870\uD68C \uC911...");
|
|
1723
|
+
try {
|
|
1724
|
+
const projectId = await resolveProject(client, project);
|
|
1725
|
+
const templates = await ensureTemplates(client, projectId);
|
|
1726
|
+
stopSpinner(true, "\uD15C\uD50C\uB9BF \uBAA9\uB85D \uC870\uD68C \uC644\uB8CC");
|
|
1727
|
+
output(globalOpts, {
|
|
1728
|
+
headers: ["ID", "Template Name"],
|
|
1729
|
+
rows: templates.map((t) => [t.id, t.templateName]),
|
|
1730
|
+
raw: templates,
|
|
1731
|
+
ids: templates.map((t) => t.id)
|
|
1732
|
+
});
|
|
1733
|
+
} catch (e) {
|
|
1734
|
+
stopSpinner(false);
|
|
1735
|
+
throw e;
|
|
1736
|
+
}
|
|
1737
|
+
});
|
|
1738
|
+
|
|
1739
|
+
// src/commands/post/list.ts
|
|
1740
|
+
var import_commander11 = require("commander");
|
|
1741
|
+
|
|
1533
1742
|
// src/formatters/post.ts
|
|
1534
1743
|
function formatPostList(posts, opts) {
|
|
1535
1744
|
output(opts, {
|
|
@@ -1579,7 +1788,7 @@ function formatCommentList(comments, opts) {
|
|
|
1579
1788
|
}
|
|
1580
1789
|
|
|
1581
1790
|
// src/commands/post/list.ts
|
|
1582
|
-
var postListCommand = new
|
|
1791
|
+
var postListCommand = new import_commander11.Command("list").description("\uC5C5\uBB34 \uBAA9\uB85D \uC870\uD68C").argument("<project>", "\uD504\uB85C\uC81D\uD2B8 \uCF54\uB4DC \uB610\uB294 ID").option("--subject <keyword>", "\uC81C\uBAA9 \uD0A4\uC6CC\uB4DC \uD544\uD130\uB9C1").option("--all", "\uC804\uCCB4 \uD398\uC774\uC9C0\uB124\uC774\uC158 (\uBAA8\uB4E0 \uACB0\uACFC \uC870\uD68C)").option("--page <number>", "\uD398\uC774\uC9C0 \uBC88\uD638", "0").option("--size <number>", "\uD398\uC774\uC9C0 \uD06C\uAE30", "20").action(async (project, opts) => {
|
|
1583
1792
|
const globalOpts = postListCommand.optsWithGlobals();
|
|
1584
1793
|
const config = await getConfigOrThrow();
|
|
1585
1794
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -1613,8 +1822,8 @@ var postListCommand = new import_commander10.Command("list").description("\uC5C5
|
|
|
1613
1822
|
});
|
|
1614
1823
|
|
|
1615
1824
|
// src/commands/post/search.ts
|
|
1616
|
-
var
|
|
1617
|
-
var postSearchCommand = new
|
|
1825
|
+
var import_commander12 = require("commander");
|
|
1826
|
+
var postSearchCommand = new import_commander12.Command("search").description("\uC5C5\uBB34 \uAC80\uC0C9 (\uC81C\uBAA9 \uD0A4\uC6CC\uB4DC)").argument("<project>", "\uD504\uB85C\uC81D\uD2B8 \uCF54\uB4DC \uB610\uB294 ID").argument("<keyword>", "\uAC80\uC0C9 \uD0A4\uC6CC\uB4DC").action(async (project, keyword) => {
|
|
1618
1827
|
const globalOpts = postSearchCommand.optsWithGlobals();
|
|
1619
1828
|
const config = await getConfigOrThrow();
|
|
1620
1829
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -1626,7 +1835,7 @@ var postSearchCommand = new import_commander11.Command("search").description("\u
|
|
|
1626
1835
|
});
|
|
1627
1836
|
|
|
1628
1837
|
// src/commands/post/get.ts
|
|
1629
|
-
var
|
|
1838
|
+
var import_commander13 = require("commander");
|
|
1630
1839
|
|
|
1631
1840
|
// src/resolvers/post.ts
|
|
1632
1841
|
async function resolvePost(client, projectId, postNumber) {
|
|
@@ -1724,7 +1933,7 @@ async function resolvePostInput(client, args) {
|
|
|
1724
1933
|
}
|
|
1725
1934
|
|
|
1726
1935
|
// src/commands/post/get.ts
|
|
1727
|
-
var postGetCommand = new
|
|
1936
|
+
var postGetCommand = new import_commander13.Command("get").description("\uC5C5\uBB34 \uC0C1\uC138 \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) => {
|
|
1728
1937
|
const globalOpts = postGetCommand.optsWithGlobals();
|
|
1729
1938
|
const config = await getConfigOrThrow();
|
|
1730
1939
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -1741,7 +1950,7 @@ var postGetCommand = new import_commander12.Command("get").description("\uC5C5\u
|
|
|
1741
1950
|
});
|
|
1742
1951
|
|
|
1743
1952
|
// src/commands/post/edit.ts
|
|
1744
|
-
var
|
|
1953
|
+
var import_commander14 = require("commander");
|
|
1745
1954
|
|
|
1746
1955
|
// src/utils/mention.ts
|
|
1747
1956
|
function buildMemberMention(m, me) {
|
|
@@ -1867,6 +2076,31 @@ async function resolveUserAdditions(client, projectId, names, groupCodes) {
|
|
|
1867
2076
|
return parseUserSpec(memberIds, groupIds);
|
|
1868
2077
|
}
|
|
1869
2078
|
|
|
2079
|
+
// src/resolvers/post-tags.ts
|
|
2080
|
+
function mergeTagIds(existing, additions, removals, clear) {
|
|
2081
|
+
const base = clear ? [] : existing;
|
|
2082
|
+
const afterRemove = removals.length > 0 ? base.filter((id) => !removals.includes(id)) : base;
|
|
2083
|
+
if (additions.length === 0) return afterRemove;
|
|
2084
|
+
return Array.from(/* @__PURE__ */ new Set([...afterRemove, ...additions]));
|
|
2085
|
+
}
|
|
2086
|
+
|
|
2087
|
+
// src/resolvers/postRef.ts
|
|
2088
|
+
async function resolvePostRef(client, ref) {
|
|
2089
|
+
if (ref.includes("/")) {
|
|
2090
|
+
const [code, numStr] = ref.split("/", 2);
|
|
2091
|
+
const num = Number(numStr);
|
|
2092
|
+
if (!code || !Number.isFinite(num) || num <= 0) {
|
|
2093
|
+
throw new DoorayCliError(
|
|
2094
|
+
`--parent \uD615\uC2DD\uC774 \uC62C\uBC14\uB974\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4: "${ref}" (\uC608: "my-project/337" \uB610\uB294 raw postId)`,
|
|
2095
|
+
EXIT_PARAM_ERROR
|
|
2096
|
+
);
|
|
2097
|
+
}
|
|
2098
|
+
const projectId = await resolveProject(client, code);
|
|
2099
|
+
return resolvePost(client, projectId, num);
|
|
2100
|
+
}
|
|
2101
|
+
return ref;
|
|
2102
|
+
}
|
|
2103
|
+
|
|
1870
2104
|
// src/editor/index.ts
|
|
1871
2105
|
var import_node_child_process = require("child_process");
|
|
1872
2106
|
var import_promises6 = __toESM(require("fs/promises"));
|
|
@@ -2100,7 +2334,7 @@ async function resolveUsers(client, projectId, names) {
|
|
|
2100
2334
|
}
|
|
2101
2335
|
return users;
|
|
2102
2336
|
}
|
|
2103
|
-
var postEditCommand = new
|
|
2337
|
+
var postEditCommand = new import_commander14.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("--parent <ref>", "\uC0C1\uC704 \uC5C5\uBB34 \uBCC0\uACBD \u2014 project/number \uB610\uB294 raw postId (post create \uC640 \uB3D9\uC77C \u2014 unset \uC740 \uBBF8\uC9C0\uC6D0, \uC6F9 UI \uC5D0\uC11C \uCC98\uB9AC)").option("--tag <name>", "\uD0DC\uADF8 \uCD94\uAC00 (\uBC18\uBCF5 \uAC00\uB2A5, \uAE30\uC874 \uD0DC\uADF8 \uC720\uC9C0 + \uC2E0\uADDC \uCD94\uAC00 + dedupe)", (v, prev) => [...prev, v], []).option("--tag-clear", "\uAE30\uC874 \uD0DC\uADF8 \uC804\uBD80 \uC81C\uAC70 \uD6C4 --tag \uB9CC \uC801\uC6A9").option("--tag-remove <name>", "\uD2B9\uC815 \uD0DC\uADF8 \uC81C\uAC70 (\uBC18\uBCF5 \uAC00\uB2A5, \uC774\uB984 \uBD80\uBD84\uC77C\uCE58)", (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)").option("--no-confirm", "\uB204\uB77D attachment \uACBD\uACE0 \uC2DC confirm \uC5C6\uC774 \uC9C4\uD589 (\uC790\uB3D9\uD654\uC6A9)").action(async (project, postNumberStr, opts) => {
|
|
2104
2338
|
const config = await getConfigOrThrow();
|
|
2105
2339
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
2106
2340
|
const mentionInputs = (opts.mention ?? []).filter((s) => s.length > 0);
|
|
@@ -2110,6 +2344,9 @@ var postEditCommand = new import_commander13.Command("edit").description("\uC5C5
|
|
|
2110
2344
|
const ccGroups = (opts.ccGroup ?? []).filter((s) => s.length > 0);
|
|
2111
2345
|
const toNames = (opts.to ?? []).filter((s) => s.length > 0);
|
|
2112
2346
|
const toGroups = (opts.toGroup ?? []).filter((s) => s.length > 0);
|
|
2347
|
+
const tagAdditions = (opts.tag ?? []).filter((s) => s.length > 0);
|
|
2348
|
+
const tagRemovals = (opts.tagRemove ?? []).filter((s) => s.length > 0);
|
|
2349
|
+
const hasTagChange = tagAdditions.length > 0 || tagRemovals.length > 0 || !!opts.tagClear;
|
|
2113
2350
|
startSpinner("\uC5C5\uBB34 \uC870\uD68C \uC911...");
|
|
2114
2351
|
const { projectId, postId, postNumber, projectCode } = await resolvePostInput(client, {
|
|
2115
2352
|
projectArg: project,
|
|
@@ -2127,7 +2364,7 @@ var postEditCommand = new import_commander13.Command("edit").description("\uC5C5
|
|
|
2127
2364
|
"\u26A0 --subject\uB294 deprecated\uC785\uB2C8\uB2E4. \uB300\uC2E0 --title\uC744 \uC0AC\uC6A9\uD574\uC8FC\uC138\uC694.\n"
|
|
2128
2365
|
);
|
|
2129
2366
|
}
|
|
2130
|
-
const nonInteractive = title || opts.body || opts.bodyFile;
|
|
2367
|
+
const nonInteractive = title || opts.body || opts.bodyFile || hasTagChange;
|
|
2131
2368
|
if (nonInteractive) {
|
|
2132
2369
|
let newBody = await readBodyInputOrNull(opts);
|
|
2133
2370
|
if (newBody != null && !opts.dryRun) {
|
|
@@ -2179,12 +2416,25 @@ var postEditCommand = new import_commander13.Command("edit").description("\uC5C5
|
|
|
2179
2416
|
const additions = await resolveUserAdditions(client, projectId, ccNames, ccGroups);
|
|
2180
2417
|
ccUsers = mergeUsers(ccUsers, additions, !!opts.ccClear);
|
|
2181
2418
|
}
|
|
2419
|
+
let finalTagIds;
|
|
2420
|
+
if (hasTagChange) {
|
|
2421
|
+
const existingTagIds = post.tags.map((t) => t.id);
|
|
2422
|
+
const additionIds = await lookupTagIds(client, projectId, tagAdditions);
|
|
2423
|
+
const removalIds = await lookupTagIds(client, projectId, tagRemovals);
|
|
2424
|
+
finalTagIds = mergeTagIds(existingTagIds, additionIds, removalIds, !!opts.tagClear);
|
|
2425
|
+
await validateMandatoryCoverage(client, projectId, finalTagIds);
|
|
2426
|
+
}
|
|
2182
2427
|
if (opts.dryRun) {
|
|
2183
2428
|
stopSpinner(false);
|
|
2184
2429
|
const globalOpts = postEditCommand.optsWithGlobals();
|
|
2185
2430
|
const previewBody = newBody ?? post.body.content;
|
|
2186
2431
|
if (globalOpts.json) {
|
|
2187
|
-
process.stdout.write(JSON.stringify({
|
|
2432
|
+
process.stdout.write(JSON.stringify({
|
|
2433
|
+
body: previewBody,
|
|
2434
|
+
users: { to: toUsers, cc: ccUsers },
|
|
2435
|
+
...finalTagIds !== void 0 && { tagIds: finalTagIds },
|
|
2436
|
+
...opts.parent && { parentChange: opts.parent }
|
|
2437
|
+
}) + "\n");
|
|
2188
2438
|
} else {
|
|
2189
2439
|
process.stdout.write(previewBody + "\n");
|
|
2190
2440
|
}
|
|
@@ -2200,9 +2450,24 @@ var postEditCommand = new import_commander13.Command("edit").description("\uC5C5
|
|
|
2200
2450
|
priority: post.priority,
|
|
2201
2451
|
dueDate: post.dueDate,
|
|
2202
2452
|
dueDateFlag: post.dueDateFlag,
|
|
2203
|
-
users: { to: toUsers, cc: ccUsers }
|
|
2453
|
+
users: { to: toUsers, cc: ccUsers },
|
|
2454
|
+
...finalTagIds !== void 0 && { tagIds: finalTagIds }
|
|
2204
2455
|
});
|
|
2205
2456
|
stopSpinner(true, "\uC5C5\uBB34 \uC218\uC815 \uC644\uB8CC");
|
|
2457
|
+
if (opts.parent) {
|
|
2458
|
+
startSpinner("\uC0C1\uC704 \uC5C5\uBB34 \uBCC0\uACBD \uC911...");
|
|
2459
|
+
try {
|
|
2460
|
+
const newParentPostId = await resolvePostRef(client, opts.parent);
|
|
2461
|
+
await client.setPostParent(projectId, postId, newParentPostId);
|
|
2462
|
+
stopSpinner(true, "\uC0C1\uC704 \uC5C5\uBB34 \uBCC0\uACBD \uC644\uB8CC");
|
|
2463
|
+
} catch (err) {
|
|
2464
|
+
stopSpinner(false, "\uC0C1\uC704 \uC5C5\uBB34 \uBCC0\uACBD \uC2E4\uD328");
|
|
2465
|
+
process.stderr.write(
|
|
2466
|
+
"\u26A0 \uBCF8\uBB38\uC740 \uC218\uC815\uB418\uC5C8\uC73C\uB098 \uC0C1\uC704 \uC5C5\uBB34 \uBCC0\uACBD\uC5D0 \uC2E4\uD328\uD588\uC2B5\uB2C8\uB2E4. \uBCF8\uBB38 \uC7AC\uC2E4\uD589 \uAE08\uC9C0 \u2014 \uC6F9 UI \uB610\uB294 dooray post edit --parent \uB2E8\uB3C5 \uC7AC\uC2DC\uB3C4 \uAD8C\uC7A5.\n"
|
|
2467
|
+
);
|
|
2468
|
+
throw err;
|
|
2469
|
+
}
|
|
2470
|
+
}
|
|
2206
2471
|
} else {
|
|
2207
2472
|
if (mentionInputs.length > 0 || groupInputs.length > 0) {
|
|
2208
2473
|
process.stderr.write(
|
|
@@ -2219,6 +2484,11 @@ var postEditCommand = new import_commander13.Command("edit").description("\uC5C5
|
|
|
2219
2484
|
"\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
2485
|
);
|
|
2221
2486
|
}
|
|
2487
|
+
if (opts.parent) {
|
|
2488
|
+
process.stderr.write(
|
|
2489
|
+
"\u26A0 --parent \uB294 --title/--body \uC640 \uD568\uAED8 \uC0AC\uC6A9 \uC2DC\uC5D0\uB9CC \uC801\uC6A9\uB429\uB2C8\uB2E4.\n"
|
|
2490
|
+
);
|
|
2491
|
+
}
|
|
2222
2492
|
const original = serializePostFrontmatter(post, members);
|
|
2223
2493
|
const edited = await openInEditor(original);
|
|
2224
2494
|
if (original === edited) {
|
|
@@ -2246,7 +2516,7 @@ var postEditCommand = new import_commander13.Command("edit").description("\uC5C5
|
|
|
2246
2516
|
});
|
|
2247
2517
|
|
|
2248
2518
|
// src/commands/post/create.ts
|
|
2249
|
-
var
|
|
2519
|
+
var import_commander15 = require("commander");
|
|
2250
2520
|
|
|
2251
2521
|
// src/resolvers/milestone.ts
|
|
2252
2522
|
async function fetchAllMilestones(client, projectId) {
|
|
@@ -2275,23 +2545,6 @@ async function resolveMilestone(client, projectId, input2) {
|
|
|
2275
2545
|
return match.id;
|
|
2276
2546
|
}
|
|
2277
2547
|
|
|
2278
|
-
// src/resolvers/postRef.ts
|
|
2279
|
-
async function resolvePostRef(client, ref) {
|
|
2280
|
-
if (ref.includes("/")) {
|
|
2281
|
-
const [code, numStr] = ref.split("/", 2);
|
|
2282
|
-
const num = Number(numStr);
|
|
2283
|
-
if (!code || !Number.isFinite(num) || num <= 0) {
|
|
2284
|
-
throw new DoorayCliError(
|
|
2285
|
-
`--parent \uD615\uC2DD\uC774 \uC62C\uBC14\uB974\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4: "${ref}" (\uC608: "tc-ocr/337" \uB610\uB294 raw postId)`,
|
|
2286
|
-
EXIT_PARAM_ERROR
|
|
2287
|
-
);
|
|
2288
|
-
}
|
|
2289
|
-
const projectId = await resolveProject(client, code);
|
|
2290
|
-
return resolvePost(client, projectId, num);
|
|
2291
|
-
}
|
|
2292
|
-
return ref;
|
|
2293
|
-
}
|
|
2294
|
-
|
|
2295
2548
|
// src/commands/post/create.ts
|
|
2296
2549
|
async function resolveUsers2(client, projectId, inputs) {
|
|
2297
2550
|
const users = [];
|
|
@@ -2301,17 +2554,18 @@ async function resolveUsers2(client, projectId, inputs) {
|
|
|
2301
2554
|
}
|
|
2302
2555
|
return users;
|
|
2303
2556
|
}
|
|
2304
|
-
|
|
2557
|
+
function postUserToCreate(u) {
|
|
2558
|
+
return {
|
|
2559
|
+
type: u.type,
|
|
2560
|
+
member: u.member,
|
|
2561
|
+
emailUser: u.emailUser,
|
|
2562
|
+
group: u.group
|
|
2563
|
+
};
|
|
2564
|
+
}
|
|
2565
|
+
var postCreateCommand = new import_commander15.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("--template <ref>", "\uD15C\uD50C\uB9BF \uC774\uB984 \uB610\uB294 ID \u2014 body/users/tags \uC790\uB3D9 \uCC44\uC6C0 (\uC0AC\uC6A9\uC790 \uC635\uC158 \uC6B0\uC120 override, ADR-027)").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) => {
|
|
2305
2566
|
const globalOpts = postCreateCommand.optsWithGlobals();
|
|
2306
2567
|
const config = await getConfigOrThrow();
|
|
2307
2568
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
2308
|
-
const subject = opts.title ?? opts.subject;
|
|
2309
|
-
if (!subject) {
|
|
2310
|
-
throw new DoorayCliError(
|
|
2311
|
-
"--title\uC774 \uD544\uC694\uD569\uB2C8\uB2E4.",
|
|
2312
|
-
EXIT_PARAM_ERROR
|
|
2313
|
-
);
|
|
2314
|
-
}
|
|
2315
2569
|
if (opts.subject && !opts.title) {
|
|
2316
2570
|
process.stderr.write(
|
|
2317
2571
|
"\u26A0 --subject\uB294 deprecated\uC785\uB2C8\uB2E4. \uB300\uC2E0 --title\uC744 \uC0AC\uC6A9\uD574\uC8FC\uC138\uC694.\n"
|
|
@@ -2320,9 +2574,35 @@ var postCreateCommand = new import_commander14.Command("create").description("\u
|
|
|
2320
2574
|
const mentionInputs = (opts.mention ?? []).filter((s) => s.length > 0);
|
|
2321
2575
|
const groupInputs = (opts.mentionGroup ?? []).filter((s) => s.length > 0);
|
|
2322
2576
|
const linkInputs = (opts.linkTask ?? []).filter((s) => s.length > 0);
|
|
2323
|
-
let bodyContent = await readBodyInput(opts);
|
|
2324
2577
|
startSpinner("\uC5C5\uBB34 \uC0DD\uC131 \uC911...");
|
|
2325
2578
|
const projectId = await resolveProject(client, project);
|
|
2579
|
+
let templateDetail = null;
|
|
2580
|
+
if (opts.template) {
|
|
2581
|
+
try {
|
|
2582
|
+
const templateId = await resolveTemplate(client, projectId, opts.template);
|
|
2583
|
+
const res2 = await client.getProjectTemplateDetail(projectId, templateId, true);
|
|
2584
|
+
templateDetail = res2.result;
|
|
2585
|
+
} catch (e) {
|
|
2586
|
+
stopSpinner(false);
|
|
2587
|
+
throw e;
|
|
2588
|
+
}
|
|
2589
|
+
}
|
|
2590
|
+
const subject = opts.title ?? opts.subject ?? templateDetail?.subject;
|
|
2591
|
+
if (!subject) {
|
|
2592
|
+
stopSpinner(false);
|
|
2593
|
+
const msg = opts.template ? `--template "${opts.template}" \uC5D0 \uC81C\uBAA9\uC774 \uC5C6\uC2B5\uB2C8\uB2E4. --title \uB85C \uC9C0\uC815\uD558\uC138\uC694.` : "--title \uB610\uB294 --template \uB458 \uC911 \uD558\uB098 \uD544\uC694\uD569\uB2C8\uB2E4.";
|
|
2594
|
+
throw new DoorayCliError(msg, EXIT_PARAM_ERROR);
|
|
2595
|
+
}
|
|
2596
|
+
let bodyContent;
|
|
2597
|
+
try {
|
|
2598
|
+
bodyContent = await readBodyInput(opts);
|
|
2599
|
+
} catch (e) {
|
|
2600
|
+
stopSpinner(false);
|
|
2601
|
+
throw e;
|
|
2602
|
+
}
|
|
2603
|
+
if (!bodyContent && templateDetail?.body) {
|
|
2604
|
+
bodyContent = templateDetail.body.content;
|
|
2605
|
+
}
|
|
2326
2606
|
let projectCode;
|
|
2327
2607
|
if (groupInputs.length > 0) {
|
|
2328
2608
|
const projects = await ensureProjects(client);
|
|
@@ -2360,7 +2640,12 @@ var postCreateCommand = new import_commander14.Command("create").description("\u
|
|
|
2360
2640
|
if (opts.dryRun) {
|
|
2361
2641
|
stopSpinner(false);
|
|
2362
2642
|
if (globalOpts.json) {
|
|
2363
|
-
process.stdout.write(
|
|
2643
|
+
process.stdout.write(
|
|
2644
|
+
JSON.stringify({
|
|
2645
|
+
body: bodyContent,
|
|
2646
|
+
...opts.template && { templateUsed: opts.template }
|
|
2647
|
+
}) + "\n"
|
|
2648
|
+
);
|
|
2364
2649
|
} else {
|
|
2365
2650
|
process.stdout.write(bodyContent + "\n");
|
|
2366
2651
|
}
|
|
@@ -2368,15 +2653,17 @@ var postCreateCommand = new import_commander14.Command("create").description("\u
|
|
|
2368
2653
|
}
|
|
2369
2654
|
const ccGroupCodes = (opts.ccGroup ?? []).filter((s) => s.length > 0);
|
|
2370
2655
|
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) : [];
|
|
2656
|
+
const toUsersMembers = opts.to ? await resolveUsers2(client, projectId, opts.to) : (templateDetail?.users?.to ?? []).map(postUserToCreate);
|
|
2657
|
+
const ccUsersMembers = opts.cc ? await resolveUsers2(client, projectId, opts.cc) : (templateDetail?.users?.cc ?? []).map(postUserToCreate);
|
|
2373
2658
|
const toUsersGroups = toGroupCodes.length > 0 ? await resolveUserAdditions(client, projectId, [], toGroupCodes) : [];
|
|
2374
2659
|
const ccUsersGroups = ccGroupCodes.length > 0 ? await resolveUserAdditions(client, projectId, [], ccGroupCodes) : [];
|
|
2375
2660
|
const toUsers = [...toUsersMembers, ...toUsersGroups];
|
|
2376
2661
|
const ccUsers = [...ccUsersMembers, ...ccUsersGroups];
|
|
2377
2662
|
const tagInputs = (opts.tag ?? []).filter((s) => s.length > 0);
|
|
2663
|
+
const templateTagNames = (templateDetail?.tags ?? []).map((t) => t.name).filter((n) => !!n);
|
|
2664
|
+
const effectiveTagInputs = tagInputs.length > 0 ? tagInputs : templateTagNames;
|
|
2378
2665
|
const [tagIds, parentPostId, milestoneId] = await Promise.all([
|
|
2379
|
-
|
|
2666
|
+
effectiveTagInputs.length > 0 ? resolveTags(client, projectId, effectiveTagInputs) : validateMandatoryTags(client, projectId).then(() => void 0),
|
|
2380
2667
|
opts.parent ? resolvePostRef(client, opts.parent) : Promise.resolve(void 0),
|
|
2381
2668
|
opts.milestone ? resolveMilestone(client, projectId, opts.milestone) : Promise.resolve(void 0)
|
|
2382
2669
|
]);
|
|
@@ -2412,8 +2699,8 @@ var postCreateCommand = new import_commander14.Command("create").description("\u
|
|
|
2412
2699
|
});
|
|
2413
2700
|
|
|
2414
2701
|
// src/commands/post/done.ts
|
|
2415
|
-
var
|
|
2416
|
-
var postDoneCommand = new
|
|
2702
|
+
var import_commander16 = require("commander");
|
|
2703
|
+
var postDoneCommand = new import_commander16.Command("done").description("\uC5C5\uBB34 \uC644\uB8CC \uCC98\uB9AC").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) => {
|
|
2417
2704
|
const config = await getConfigOrThrow();
|
|
2418
2705
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
2419
2706
|
startSpinner("\uC5C5\uBB34 \uC644\uB8CC \uCC98\uB9AC \uC911...");
|
|
@@ -2430,8 +2717,8 @@ var postDoneCommand = new import_commander15.Command("done").description("\uC5C5
|
|
|
2430
2717
|
});
|
|
2431
2718
|
|
|
2432
2719
|
// src/commands/post/workflow.ts
|
|
2433
|
-
var
|
|
2434
|
-
var postWorkflowCommand = new
|
|
2720
|
+
var import_commander17 = require("commander");
|
|
2721
|
+
var postWorkflowCommand = new import_commander17.Command("workflow").description("\uC5C5\uBB34 \uC6CC\uD06C\uD50C\uB85C\uC6B0 \uBCC0\uACBD").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)").argument("[workflow]", "\uC6CC\uD06C\uD50C\uB85C\uC6B0 \uC774\uB984 \uB610\uB294 \uD074\uB798\uC2A4 (\uB610\uB294 --workflow \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("--workflow <name>", "\uC6CC\uD06C\uD50C\uB85C\uC6B0 \uC774\uB984 (positional \uB300\uCCB4)").action(async (project, postNumber, workflowArg, opts) => {
|
|
2435
2722
|
const config = await getConfigOrThrow();
|
|
2436
2723
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
2437
2724
|
let workflowInput = opts.workflow;
|
|
@@ -2471,7 +2758,7 @@ var postWorkflowCommand = new import_commander16.Command("workflow").description
|
|
|
2471
2758
|
});
|
|
2472
2759
|
|
|
2473
2760
|
// src/commands/post/comment/list.ts
|
|
2474
|
-
var
|
|
2761
|
+
var import_commander18 = require("commander");
|
|
2475
2762
|
|
|
2476
2763
|
// src/utils/comment-enrich.ts
|
|
2477
2764
|
function enrichCommentCreators(comments, nameMap) {
|
|
@@ -2548,7 +2835,7 @@ async function fetchSince(client, projectId, postId, sinceDate) {
|
|
|
2548
2835
|
}
|
|
2549
2836
|
return collected;
|
|
2550
2837
|
}
|
|
2551
|
-
var commentListCommand = new
|
|
2838
|
+
var commentListCommand = new import_commander18.Command("list").description("\uB313\uAE00 \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)").option("--page <number>", "\uD398\uC774\uC9C0 \uBC88\uD638", PAGE_DEFAULT).option("--size <number>", "\uD398\uC774\uC9C0 \uD06C\uAE30", SIZE_DEFAULT).option("--sort <order>", "\uC815\uB82C (asc/desc), \uAE30\uBCF8 asc", "asc").option("--reverse", "--sort desc \uC758 alias").option("--latest <n>", "\uCD5C\uC2E0 N\uAC1C (--sort desc + size=N + page=0 \uB2E8\uCD95, \uCD5C\uB300 100)").option("--since <iso>", "\uC774 \uC2DC\uAC04 \uC774\uD6C4 \uB313\uAE00\uB9CC (ISO 8601 \uB610\uB294 YYYY-MM-DD)").option("--from-author <name>", "\uC791\uC131\uC790 \uC774\uB984\uC73C\uB85C \uD544\uD130 (\uBD80\uBD84\uC77C\uCE58)").action(async (project, postNumberStr, opts) => {
|
|
2552
2839
|
const globalOpts = commentListCommand.optsWithGlobals();
|
|
2553
2840
|
const config = await getConfigOrThrow();
|
|
2554
2841
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -2610,8 +2897,8 @@ var commentListCommand = new import_commander17.Command("list").description("\uB
|
|
|
2610
2897
|
});
|
|
2611
2898
|
|
|
2612
2899
|
// src/commands/post/comment/latest.ts
|
|
2613
|
-
var
|
|
2614
|
-
var commentLatestCommand = new
|
|
2900
|
+
var import_commander19 = require("commander");
|
|
2901
|
+
var commentLatestCommand = new import_commander19.Command("latest").description("\uCD5C\uC2E0 \uB313\uAE00 1\uAC1C \uC870\uD68C (= comment list --latest 1)").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("-n, --count <n>", "\uCD5C\uC2E0 N\uAC1C (\uAE30\uBCF8 1)", "1").action(async (project, postNumberStr, opts) => {
|
|
2615
2902
|
const globalOpts = commentLatestCommand.optsWithGlobals();
|
|
2616
2903
|
const config = await getConfigOrThrow();
|
|
2617
2904
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -2648,8 +2935,8 @@ var commentLatestCommand = new import_commander18.Command("latest").description(
|
|
|
2648
2935
|
});
|
|
2649
2936
|
|
|
2650
2937
|
// src/commands/post/comment/add.ts
|
|
2651
|
-
var
|
|
2652
|
-
var commentAddCommand = new
|
|
2938
|
+
var import_commander20 = require("commander");
|
|
2939
|
+
var commentAddCommand = new import_commander20.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(
|
|
2653
2940
|
"--mention <name>",
|
|
2654
2941
|
"\uBA64\uBC84 \uBA58\uC158 (\uBC18\uBCF5 \uAC00\uB2A5, \uC774\uB984 \uBD80\uBD84\uC77C\uCE58)",
|
|
2655
2942
|
(value, prev) => [...prev, value],
|
|
@@ -2728,8 +3015,8 @@ var commentAddCommand = new import_commander19.Command("add").description("\uB31
|
|
|
2728
3015
|
});
|
|
2729
3016
|
|
|
2730
3017
|
// src/commands/post/comment/edit.ts
|
|
2731
|
-
var
|
|
2732
|
-
var commentEditCommand = new
|
|
3018
|
+
var import_commander21 = require("commander");
|
|
3019
|
+
var commentEditCommand = new import_commander21.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(
|
|
2733
3020
|
"--mention <name>",
|
|
2734
3021
|
"\uBA64\uBC84 \uBA58\uC158 (\uBC18\uBCF5 \uAC00\uB2A5, \uC774\uB984 \uBD80\uBD84\uC77C\uCE58)",
|
|
2735
3022
|
(value, prev) => [...prev, value],
|
|
@@ -2857,8 +3144,8 @@ var commentEditCommand = new import_commander20.Command("edit").description("\uB
|
|
|
2857
3144
|
});
|
|
2858
3145
|
|
|
2859
3146
|
// src/commands/post/comment/delete.ts
|
|
2860
|
-
var
|
|
2861
|
-
var commentDeleteCommand = new
|
|
3147
|
+
var import_commander22 = require("commander");
|
|
3148
|
+
var commentDeleteCommand = new import_commander22.Command("delete").description("\uB313\uAE00 \uC0AD\uC81C").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)").action(async (arg1, arg2, arg3, opts) => {
|
|
2862
3149
|
const config = await getConfigOrThrow();
|
|
2863
3150
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
2864
3151
|
let projectArg;
|
|
@@ -2914,7 +3201,7 @@ var commentDeleteCommand = new import_commander21.Command("delete").description(
|
|
|
2914
3201
|
});
|
|
2915
3202
|
|
|
2916
3203
|
// src/commands/post/comment/get.ts
|
|
2917
|
-
var
|
|
3204
|
+
var import_commander23 = require("commander");
|
|
2918
3205
|
|
|
2919
3206
|
// src/formatters/comment.ts
|
|
2920
3207
|
function formatCommentDetail(comment, opts) {
|
|
@@ -2988,7 +3275,7 @@ function parseGetArgs(arg1, arg2, arg3, opts) {
|
|
|
2988
3275
|
EXIT_PARAM_ERROR
|
|
2989
3276
|
);
|
|
2990
3277
|
}
|
|
2991
|
-
var commentGetCommand = new
|
|
3278
|
+
var commentGetCommand = new import_commander23.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
3279
|
const parsed = parseGetArgs(arg1, arg2, arg3, opts);
|
|
2993
3280
|
const config = await getConfigOrThrow();
|
|
2994
3281
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -3023,10 +3310,10 @@ var commentGetCommand = new import_commander22.Command("get").description("\uB2E
|
|
|
3023
3310
|
});
|
|
3024
3311
|
|
|
3025
3312
|
// src/commands/post/comment/file/index.ts
|
|
3026
|
-
var
|
|
3313
|
+
var import_commander28 = require("commander");
|
|
3027
3314
|
|
|
3028
3315
|
// src/commands/post/comment/file/list.ts
|
|
3029
|
-
var
|
|
3316
|
+
var import_commander24 = require("commander");
|
|
3030
3317
|
|
|
3031
3318
|
// src/resolvers/comment-file-input.ts
|
|
3032
3319
|
var FILE_ID_SECONDARY_LABEL = {
|
|
@@ -3101,7 +3388,7 @@ function formatSize(bytes) {
|
|
|
3101
3388
|
if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)}KB`;
|
|
3102
3389
|
return `${(bytes / (1024 * 1024)).toFixed(1)}MB`;
|
|
3103
3390
|
}
|
|
3104
|
-
var listCommentFileCommand = new
|
|
3391
|
+
var listCommentFileCommand = new import_commander24.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
3392
|
const globalOpts = listCommentFileCommand.optsWithGlobals();
|
|
3106
3393
|
const config = await getConfigOrThrow();
|
|
3107
3394
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -3135,7 +3422,7 @@ var listCommentFileCommand = new import_commander23.Command("list").description(
|
|
|
3135
3422
|
});
|
|
3136
3423
|
|
|
3137
3424
|
// src/commands/post/comment/file/upload.ts
|
|
3138
|
-
var
|
|
3425
|
+
var import_commander25 = require("commander");
|
|
3139
3426
|
var import_node_path4 = require("path");
|
|
3140
3427
|
|
|
3141
3428
|
// src/utils/comment-files.ts
|
|
@@ -3156,7 +3443,7 @@ function removeFileReference(body, fileId) {
|
|
|
3156
3443
|
}
|
|
3157
3444
|
|
|
3158
3445
|
// src/commands/post/comment/file/upload.ts
|
|
3159
|
-
var uploadCommentFileCommand = new
|
|
3446
|
+
var uploadCommentFileCommand = new import_commander25.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) => {
|
|
3160
3447
|
const globalOpts = uploadCommentFileCommand.optsWithGlobals();
|
|
3161
3448
|
const config = await getConfigOrThrow();
|
|
3162
3449
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -3205,10 +3492,10 @@ var uploadCommentFileCommand = new import_commander24.Command("upload").descript
|
|
|
3205
3492
|
});
|
|
3206
3493
|
|
|
3207
3494
|
// src/commands/post/comment/file/download.ts
|
|
3208
|
-
var
|
|
3495
|
+
var import_commander26 = require("commander");
|
|
3209
3496
|
var import_promises8 = require("fs/promises");
|
|
3210
3497
|
var import_node_path5 = require("path");
|
|
3211
|
-
var downloadCommentFileCommand = new
|
|
3498
|
+
var downloadCommentFileCommand = new import_commander26.Command("download").description(
|
|
3212
3499
|
"\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)"
|
|
3213
3500
|
).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) => {
|
|
3214
3501
|
const config = await getConfigOrThrow();
|
|
@@ -3236,8 +3523,8 @@ var downloadCommentFileCommand = new import_commander25.Command("download").desc
|
|
|
3236
3523
|
});
|
|
3237
3524
|
|
|
3238
3525
|
// src/commands/post/comment/file/delete.ts
|
|
3239
|
-
var
|
|
3240
|
-
var deleteCommentFileCommand = new
|
|
3526
|
+
var import_commander27 = require("commander");
|
|
3527
|
+
var deleteCommentFileCommand = new import_commander27.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) => {
|
|
3241
3528
|
const config = await getConfigOrThrow();
|
|
3242
3529
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
3243
3530
|
const { projectId, postId, commentId, secondary: fileId } = await resolveCommentFileInput(client, {
|
|
@@ -3294,16 +3581,16 @@ var deleteCommentFileCommand = new import_commander26.Command("delete").descript
|
|
|
3294
3581
|
});
|
|
3295
3582
|
|
|
3296
3583
|
// src/commands/post/comment/file/index.ts
|
|
3297
|
-
var commentFileCommand = new
|
|
3584
|
+
var commentFileCommand = new import_commander28.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);
|
|
3298
3585
|
|
|
3299
3586
|
// src/commands/post/file/list.ts
|
|
3300
|
-
var
|
|
3587
|
+
var import_commander29 = require("commander");
|
|
3301
3588
|
function formatSize2(bytes) {
|
|
3302
3589
|
if (bytes < 1024) return `${bytes}B`;
|
|
3303
3590
|
if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)}KB`;
|
|
3304
3591
|
return `${(bytes / (1024 * 1024)).toFixed(1)}MB`;
|
|
3305
3592
|
}
|
|
3306
|
-
var fileListCommand = new
|
|
3593
|
+
var fileListCommand = new import_commander29.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) => {
|
|
3307
3594
|
const globalOpts = fileListCommand.optsWithGlobals();
|
|
3308
3595
|
const config = await getConfigOrThrow();
|
|
3309
3596
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -3331,10 +3618,10 @@ var fileListCommand = new import_commander28.Command("list").description("\uC5C5
|
|
|
3331
3618
|
});
|
|
3332
3619
|
|
|
3333
3620
|
// src/commands/post/file/download.ts
|
|
3334
|
-
var
|
|
3621
|
+
var import_commander30 = require("commander");
|
|
3335
3622
|
var import_promises9 = require("fs/promises");
|
|
3336
3623
|
var import_node_path6 = require("path");
|
|
3337
|
-
var fileDownloadCommand = new
|
|
3624
|
+
var fileDownloadCommand = new import_commander30.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) => {
|
|
3338
3625
|
const config = await getConfigOrThrow();
|
|
3339
3626
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
3340
3627
|
let projectArg;
|
|
@@ -3389,10 +3676,10 @@ var fileDownloadCommand = new import_commander29.Command("download").description
|
|
|
3389
3676
|
});
|
|
3390
3677
|
|
|
3391
3678
|
// src/commands/post/file/download-all.ts
|
|
3392
|
-
var
|
|
3679
|
+
var import_commander31 = require("commander");
|
|
3393
3680
|
var import_promises10 = require("fs/promises");
|
|
3394
3681
|
var import_node_path7 = require("path");
|
|
3395
|
-
var fileDownloadAllCommand = new
|
|
3682
|
+
var fileDownloadAllCommand = new import_commander31.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) => {
|
|
3396
3683
|
const config = await getConfigOrThrow();
|
|
3397
3684
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
3398
3685
|
const spinner = startSpinner("\uCCA8\uBD80\uD30C\uC77C \uBAA9\uB85D \uC870\uD68C \uC911...");
|
|
@@ -3425,9 +3712,9 @@ var fileDownloadAllCommand = new import_commander30.Command("download-all").desc
|
|
|
3425
3712
|
});
|
|
3426
3713
|
|
|
3427
3714
|
// src/commands/post/file/upload.ts
|
|
3428
|
-
var
|
|
3715
|
+
var import_commander32 = require("commander");
|
|
3429
3716
|
var import_node_path8 = require("path");
|
|
3430
|
-
var fileUploadCommand = new
|
|
3717
|
+
var fileUploadCommand = new import_commander32.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) => {
|
|
3431
3718
|
const globalOpts = fileUploadCommand.optsWithGlobals();
|
|
3432
3719
|
const config = await getConfigOrThrow();
|
|
3433
3720
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -3488,8 +3775,8 @@ var fileUploadCommand = new import_commander31.Command("upload").description("\u
|
|
|
3488
3775
|
});
|
|
3489
3776
|
|
|
3490
3777
|
// src/commands/post/file/delete.ts
|
|
3491
|
-
var
|
|
3492
|
-
var fileDeleteCommand = new
|
|
3778
|
+
var import_commander33 = require("commander");
|
|
3779
|
+
var fileDeleteCommand = new import_commander33.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) => {
|
|
3493
3780
|
const config = await getConfigOrThrow();
|
|
3494
3781
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
3495
3782
|
let projectArg;
|
|
@@ -3542,7 +3829,7 @@ var fileDeleteCommand = new import_commander32.Command("delete").description("\u
|
|
|
3542
3829
|
});
|
|
3543
3830
|
|
|
3544
3831
|
// src/commands/wiki/list.ts
|
|
3545
|
-
var
|
|
3832
|
+
var import_commander34 = require("commander");
|
|
3546
3833
|
|
|
3547
3834
|
// src/formatters/wiki.ts
|
|
3548
3835
|
function formatWikiList(wikis, opts) {
|
|
@@ -3585,7 +3872,7 @@ function formatWikiPageDetail(page, opts) {
|
|
|
3585
3872
|
}
|
|
3586
3873
|
|
|
3587
3874
|
// src/commands/wiki/list.ts
|
|
3588
|
-
var wikiListCommand = new
|
|
3875
|
+
var wikiListCommand = new import_commander34.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) => {
|
|
3589
3876
|
const globalOpts = wikiListCommand.optsWithGlobals();
|
|
3590
3877
|
const config = await getConfigOrThrow();
|
|
3591
3878
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -3599,7 +3886,7 @@ var wikiListCommand = new import_commander33.Command("list").description("\uC704
|
|
|
3599
3886
|
});
|
|
3600
3887
|
|
|
3601
3888
|
// src/commands/wiki/pages.ts
|
|
3602
|
-
var
|
|
3889
|
+
var import_commander35 = require("commander");
|
|
3603
3890
|
|
|
3604
3891
|
// src/resolvers/wiki.ts
|
|
3605
3892
|
async function resolveWiki(client, projectCode) {
|
|
@@ -3643,7 +3930,7 @@ async function resolveWikiHomePageId(client, wikiId) {
|
|
|
3643
3930
|
}
|
|
3644
3931
|
|
|
3645
3932
|
// src/commands/wiki/pages.ts
|
|
3646
|
-
var wikiPagesCommand = new
|
|
3933
|
+
var wikiPagesCommand = new import_commander35.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) => {
|
|
3647
3934
|
const globalOpts = wikiPagesCommand.optsWithGlobals();
|
|
3648
3935
|
const config = await getConfigOrThrow();
|
|
3649
3936
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -3655,8 +3942,8 @@ var wikiPagesCommand = new import_commander34.Command("pages").description("\uC7
|
|
|
3655
3942
|
});
|
|
3656
3943
|
|
|
3657
3944
|
// src/commands/wiki/page-get.ts
|
|
3658
|
-
var
|
|
3659
|
-
var wikiPageGetCommand = new
|
|
3945
|
+
var import_commander36 = require("commander");
|
|
3946
|
+
var wikiPageGetCommand = new import_commander36.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) => {
|
|
3660
3947
|
const globalOpts = wikiPageGetCommand.optsWithGlobals();
|
|
3661
3948
|
const config = await getConfigOrThrow();
|
|
3662
3949
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -3668,8 +3955,8 @@ var wikiPageGetCommand = new import_commander35.Command("get").description("\uC7
|
|
|
3668
3955
|
});
|
|
3669
3956
|
|
|
3670
3957
|
// src/commands/wiki/page-create.ts
|
|
3671
|
-
var
|
|
3672
|
-
var wikiPageCreateCommand = new
|
|
3958
|
+
var import_commander37 = require("commander");
|
|
3959
|
+
var wikiPageCreateCommand = new import_commander37.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) => {
|
|
3673
3960
|
const globalOpts = wikiPageCreateCommand.optsWithGlobals();
|
|
3674
3961
|
const config = await getConfigOrThrow();
|
|
3675
3962
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -3694,8 +3981,8 @@ var wikiPageCreateCommand = new import_commander36.Command("create").description
|
|
|
3694
3981
|
});
|
|
3695
3982
|
|
|
3696
3983
|
// src/commands/wiki/page-edit.ts
|
|
3697
|
-
var
|
|
3698
|
-
var wikiPageEditCommand = new
|
|
3984
|
+
var import_commander38 = require("commander");
|
|
3985
|
+
var wikiPageEditCommand = new import_commander38.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) => {
|
|
3699
3986
|
const config = await getConfigOrThrow();
|
|
3700
3987
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
3701
3988
|
const hasTitle = opts.title != null;
|
|
@@ -3748,10 +4035,10 @@ var wikiPageEditCommand = new import_commander37.Command("edit").description("\u
|
|
|
3748
4035
|
});
|
|
3749
4036
|
|
|
3750
4037
|
// src/commands/member/index.ts
|
|
3751
|
-
var
|
|
4038
|
+
var import_commander42 = require("commander");
|
|
3752
4039
|
|
|
3753
4040
|
// src/commands/member/get.ts
|
|
3754
|
-
var
|
|
4041
|
+
var import_commander39 = require("commander");
|
|
3755
4042
|
|
|
3756
4043
|
// src/formatters/member.ts
|
|
3757
4044
|
function formatMemberDetail(member, opts) {
|
|
@@ -3797,7 +4084,7 @@ function formatMemberSearchResults(members, opts) {
|
|
|
3797
4084
|
}
|
|
3798
4085
|
|
|
3799
4086
|
// src/commands/member/get.ts
|
|
3800
|
-
var memberGetCommand = new
|
|
4087
|
+
var memberGetCommand = new import_commander39.Command("get").description("\uBA64\uBC84 \uC0C1\uC138 \uC815\uBCF4 \uC870\uD68C (organizationMemberId)").argument("<member-id>", "\uC870\uD68C\uD560 organization member ID").action(async (memberId) => {
|
|
3801
4088
|
const globalOpts = memberGetCommand.optsWithGlobals();
|
|
3802
4089
|
const config = await getConfigOrThrow();
|
|
3803
4090
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -3806,8 +4093,8 @@ var memberGetCommand = new import_commander38.Command("get").description("\uBA64
|
|
|
3806
4093
|
});
|
|
3807
4094
|
|
|
3808
4095
|
// src/commands/member/list.ts
|
|
3809
|
-
var
|
|
3810
|
-
var memberListCommand = new
|
|
4096
|
+
var import_commander40 = require("commander");
|
|
4097
|
+
var memberListCommand = new import_commander40.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) => {
|
|
3811
4098
|
const globalOpts = memberListCommand.optsWithGlobals();
|
|
3812
4099
|
const config = await getConfigOrThrow();
|
|
3813
4100
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -3822,8 +4109,8 @@ var memberListCommand = new import_commander39.Command("list").description("\uD5
|
|
|
3822
4109
|
});
|
|
3823
4110
|
|
|
3824
4111
|
// src/commands/member/search.ts
|
|
3825
|
-
var
|
|
3826
|
-
var memberSearchCommand = new
|
|
4112
|
+
var import_commander41 = require("commander");
|
|
4113
|
+
var memberSearchCommand = new import_commander41.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) => {
|
|
3827
4114
|
const globalOpts = memberSearchCommand.optsWithGlobals();
|
|
3828
4115
|
const filterCount = [keyword, opts.email, opts.userCode, opts.userCodeExact].filter(Boolean).length;
|
|
3829
4116
|
if (filterCount === 0) {
|
|
@@ -3856,13 +4143,13 @@ var memberSearchCommand = new import_commander40.Command("search").description("
|
|
|
3856
4143
|
});
|
|
3857
4144
|
|
|
3858
4145
|
// src/commands/member/index.ts
|
|
3859
|
-
var memberCommand = new
|
|
4146
|
+
var memberCommand = new import_commander42.Command("member").description("Dooray \uBA64\uBC84 \uC870\uD68C");
|
|
3860
4147
|
memberCommand.addCommand(memberGetCommand);
|
|
3861
4148
|
memberCommand.addCommand(memberListCommand);
|
|
3862
4149
|
memberCommand.addCommand(memberSearchCommand);
|
|
3863
4150
|
|
|
3864
4151
|
// src/commands/mail/list.ts
|
|
3865
|
-
var
|
|
4152
|
+
var import_commander43 = require("commander");
|
|
3866
4153
|
|
|
3867
4154
|
// src/api/imapClient.ts
|
|
3868
4155
|
var import_imapflow = require("imapflow");
|
|
@@ -3979,7 +4266,7 @@ async function getMail(config, uid) {
|
|
|
3979
4266
|
|
|
3980
4267
|
// src/commands/mail/list.ts
|
|
3981
4268
|
var import_chalk5 = __toESM(require("chalk"));
|
|
3982
|
-
var mailListCommand = new
|
|
4269
|
+
var mailListCommand = new import_commander43.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) => {
|
|
3983
4270
|
const globalOpts = mailListCommand.optsWithGlobals();
|
|
3984
4271
|
const config = await getConfigOrThrow();
|
|
3985
4272
|
startSpinner("\uBA54\uC77C \uC870\uD68C \uC911...");
|
|
@@ -4011,9 +4298,9 @@ var mailListCommand = new import_commander42.Command("list").description("\uBA54
|
|
|
4011
4298
|
});
|
|
4012
4299
|
|
|
4013
4300
|
// src/commands/mail/get.ts
|
|
4014
|
-
var
|
|
4301
|
+
var import_commander44 = require("commander");
|
|
4015
4302
|
var import_chalk6 = __toESM(require("chalk"));
|
|
4016
|
-
var mailGetCommand = new
|
|
4303
|
+
var mailGetCommand = new import_commander44.Command("get").description("\uBA54\uC77C \uC0C1\uC138 \uC870\uD68C").argument("<uid>", "\uBA54\uC77C UID").action(async (uid) => {
|
|
4017
4304
|
const globalOpts = mailGetCommand.optsWithGlobals();
|
|
4018
4305
|
const config = await getConfigOrThrow();
|
|
4019
4306
|
startSpinner("\uBA54\uC77C \uC870\uD68C \uC911...");
|
|
@@ -4044,7 +4331,7 @@ ${mail.body}
|
|
|
4044
4331
|
});
|
|
4045
4332
|
|
|
4046
4333
|
// src/commands/mail/send.ts
|
|
4047
|
-
var
|
|
4334
|
+
var import_commander45 = require("commander");
|
|
4048
4335
|
var import_promises11 = require("fs/promises");
|
|
4049
4336
|
|
|
4050
4337
|
// src/api/smtpClient.ts
|
|
@@ -4094,7 +4381,7 @@ async function sendMail(config, opts) {
|
|
|
4094
4381
|
}
|
|
4095
4382
|
|
|
4096
4383
|
// src/commands/mail/send.ts
|
|
4097
|
-
var mailSendCommand = new
|
|
4384
|
+
var mailSendCommand = new import_commander45.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) => {
|
|
4098
4385
|
const globalOpts = mailSendCommand.optsWithGlobals();
|
|
4099
4386
|
const config = await getConfigOrThrow();
|
|
4100
4387
|
let body = opts.body ?? "";
|
|
@@ -4129,7 +4416,7 @@ var mailSendCommand = new import_commander44.Command("send").description("\uBA54
|
|
|
4129
4416
|
});
|
|
4130
4417
|
|
|
4131
4418
|
// src/commands/mail/reply.ts
|
|
4132
|
-
var
|
|
4419
|
+
var import_commander46 = require("commander");
|
|
4133
4420
|
var import_promises12 = require("fs/promises");
|
|
4134
4421
|
var import_imapflow2 = require("imapflow");
|
|
4135
4422
|
async function getMessageId(config, uid) {
|
|
@@ -4158,7 +4445,7 @@ async function getMessageId(config, uid) {
|
|
|
4158
4445
|
await client.logout();
|
|
4159
4446
|
}
|
|
4160
4447
|
}
|
|
4161
|
-
var mailReplyCommand = new
|
|
4448
|
+
var mailReplyCommand = new import_commander46.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) => {
|
|
4162
4449
|
const globalOpts = mailReplyCommand.optsWithGlobals();
|
|
4163
4450
|
const config = await getConfigOrThrow();
|
|
4164
4451
|
let body = opts.body ?? "";
|
|
@@ -4199,7 +4486,7 @@ var mailReplyCommand = new import_commander45.Command("reply").description("\uBA
|
|
|
4199
4486
|
});
|
|
4200
4487
|
|
|
4201
4488
|
// src/commands/feedback.ts
|
|
4202
|
-
var
|
|
4489
|
+
var import_commander47 = require("commander");
|
|
4203
4490
|
var import_node_child_process2 = require("child_process");
|
|
4204
4491
|
var import_node_util = require("util");
|
|
4205
4492
|
var import_promises15 = require("fs/promises");
|
|
@@ -4310,7 +4597,7 @@ async function readBody(opts) {
|
|
|
4310
4597
|
if (opts.bodyFile) return await (0, import_promises15.readFile)(opts.bodyFile, "utf-8");
|
|
4311
4598
|
return void 0;
|
|
4312
4599
|
}
|
|
4313
|
-
var feedbackCommand = new
|
|
4600
|
+
var feedbackCommand = new import_commander47.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(
|
|
4314
4601
|
"--label <name>",
|
|
4315
4602
|
"\uB77C\uBCA8 (\uBC18\uBCF5 \uAC00\uB2A5)",
|
|
4316
4603
|
(value, prev) => [...prev, value],
|
|
@@ -4473,8 +4760,8 @@ function sanitizeArgv(argv) {
|
|
|
4473
4760
|
}
|
|
4474
4761
|
|
|
4475
4762
|
// src/index.ts
|
|
4476
|
-
var program = new
|
|
4477
|
-
program.name("dooray").description("Dooray REST API CLI").version("0.
|
|
4763
|
+
var program = new import_commander48.Command();
|
|
4764
|
+
program.name("dooray").description("Dooray REST API CLI").version("0.9.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");
|
|
4478
4765
|
program.hook("preAction", () => {
|
|
4479
4766
|
const opts = program.opts();
|
|
4480
4767
|
if (opts.color === false || process.env.NO_COLOR) {
|
|
@@ -4484,13 +4771,14 @@ program.hook("preAction", () => {
|
|
|
4484
4771
|
setQuiet(true);
|
|
4485
4772
|
}
|
|
4486
4773
|
});
|
|
4487
|
-
var projectCommand = new
|
|
4774
|
+
var projectCommand = new import_commander48.Command("project").description("\uD504\uB85C\uC81D\uD2B8 \uAD00\uB828 \uBA85\uB839");
|
|
4488
4775
|
projectCommand.addCommand(projectListCommand);
|
|
4489
4776
|
projectCommand.addCommand(projectMembersCommand);
|
|
4490
4777
|
projectCommand.addCommand(projectWorkflowsCommand);
|
|
4491
4778
|
projectCommand.addCommand(projectGroupsCommand);
|
|
4492
4779
|
projectCommand.addCommand(projectTagsCommand);
|
|
4493
|
-
|
|
4780
|
+
projectCommand.addCommand(projectTemplatesCommand);
|
|
4781
|
+
var postCommand = new import_commander48.Command("post").description("\uC5C5\uBB34 \uAD00\uB828 \uBA85\uB839");
|
|
4494
4782
|
postCommand.addCommand(postListCommand);
|
|
4495
4783
|
postCommand.addCommand(postSearchCommand);
|
|
4496
4784
|
postCommand.addCommand(postGetCommand);
|
|
@@ -4498,7 +4786,7 @@ postCommand.addCommand(postEditCommand);
|
|
|
4498
4786
|
postCommand.addCommand(postCreateCommand);
|
|
4499
4787
|
postCommand.addCommand(postDoneCommand);
|
|
4500
4788
|
postCommand.addCommand(postWorkflowCommand);
|
|
4501
|
-
var commentCommand = new
|
|
4789
|
+
var commentCommand = new import_commander48.Command("comment").description("\uB313\uAE00 \uAD00\uB828 \uBA85\uB839");
|
|
4502
4790
|
commentCommand.addCommand(commentListCommand);
|
|
4503
4791
|
commentCommand.addCommand(commentLatestCommand);
|
|
4504
4792
|
commentCommand.addCommand(commentGetCommand);
|
|
@@ -4507,22 +4795,22 @@ commentCommand.addCommand(commentEditCommand);
|
|
|
4507
4795
|
commentCommand.addCommand(commentDeleteCommand);
|
|
4508
4796
|
commentCommand.addCommand(commentFileCommand);
|
|
4509
4797
|
postCommand.addCommand(commentCommand);
|
|
4510
|
-
var fileCommand = new
|
|
4798
|
+
var fileCommand = new import_commander48.Command("file").description("\uCCA8\uBD80\uD30C\uC77C \uAD00\uB828 \uBA85\uB839");
|
|
4511
4799
|
fileCommand.addCommand(fileListCommand);
|
|
4512
4800
|
fileCommand.addCommand(fileDownloadCommand);
|
|
4513
4801
|
fileCommand.addCommand(fileDownloadAllCommand);
|
|
4514
4802
|
fileCommand.addCommand(fileUploadCommand);
|
|
4515
4803
|
fileCommand.addCommand(fileDeleteCommand);
|
|
4516
4804
|
postCommand.addCommand(fileCommand);
|
|
4517
|
-
var wikiCommand = new
|
|
4805
|
+
var wikiCommand = new import_commander48.Command("wiki").description("\uC704\uD0A4 \uAD00\uB828 \uBA85\uB839");
|
|
4518
4806
|
wikiCommand.addCommand(wikiListCommand);
|
|
4519
4807
|
wikiCommand.addCommand(wikiPagesCommand);
|
|
4520
|
-
var wikiPageCommand = new
|
|
4808
|
+
var wikiPageCommand = new import_commander48.Command("page").description("\uC704\uD0A4 \uD398\uC774\uC9C0 \uAD00\uB828 \uBA85\uB839");
|
|
4521
4809
|
wikiPageCommand.addCommand(wikiPageGetCommand);
|
|
4522
4810
|
wikiPageCommand.addCommand(wikiPageCreateCommand);
|
|
4523
4811
|
wikiPageCommand.addCommand(wikiPageEditCommand);
|
|
4524
4812
|
wikiCommand.addCommand(wikiPageCommand);
|
|
4525
|
-
var mailCommand = new
|
|
4813
|
+
var mailCommand = new import_commander48.Command("mail").description("\uBA54\uC77C \uAD00\uB828 \uBA85\uB839");
|
|
4526
4814
|
mailCommand.addCommand(mailListCommand);
|
|
4527
4815
|
mailCommand.addCommand(mailGetCommand);
|
|
4528
4816
|
mailCommand.addCommand(mailSendCommand);
|