@bifos/dooray-cli 0.7.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 +91 -0
- package/dist/index.js +529 -168
- package/package.json +1 -1
- package/skills/dooray-cli/SKILL.md +110 -1
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) {
|
|
@@ -1817,6 +2026,81 @@ async function resolveTaskLinks(client, linkInputs) {
|
|
|
1817
2026
|
);
|
|
1818
2027
|
}
|
|
1819
2028
|
|
|
2029
|
+
// src/resolvers/post-users.ts
|
|
2030
|
+
function parseUserSpec(memberIds, groupIds) {
|
|
2031
|
+
const users = [];
|
|
2032
|
+
for (const id of memberIds) {
|
|
2033
|
+
users.push({ type: "member", member: { organizationMemberId: id } });
|
|
2034
|
+
}
|
|
2035
|
+
for (const gid of groupIds) {
|
|
2036
|
+
users.push({ type: "group", group: { projectMemberGroupId: gid, members: [] } });
|
|
2037
|
+
}
|
|
2038
|
+
return users;
|
|
2039
|
+
}
|
|
2040
|
+
function mergeUsers(existing, additions, clear) {
|
|
2041
|
+
const base = clear ? [] : existing;
|
|
2042
|
+
const seen = /* @__PURE__ */ new Set();
|
|
2043
|
+
const result = [];
|
|
2044
|
+
for (const u of [...base, ...additions]) {
|
|
2045
|
+
const key = userKey(u);
|
|
2046
|
+
if (key && seen.has(key)) continue;
|
|
2047
|
+
if (key) seen.add(key);
|
|
2048
|
+
result.push(u);
|
|
2049
|
+
}
|
|
2050
|
+
return result;
|
|
2051
|
+
}
|
|
2052
|
+
function userKey(u) {
|
|
2053
|
+
if (u.member?.organizationMemberId) return `m:${u.member.organizationMemberId}`;
|
|
2054
|
+
if (u.group?.projectMemberGroupId) return `g:${u.group.projectMemberGroupId}`;
|
|
2055
|
+
if (u.emailUser?.emailAddress) return `e:${u.emailUser.emailAddress}`;
|
|
2056
|
+
return null;
|
|
2057
|
+
}
|
|
2058
|
+
async function resolveUserAdditions(client, projectId, names, groupCodes) {
|
|
2059
|
+
const memberIds = await Promise.all(
|
|
2060
|
+
names.map(
|
|
2061
|
+
(n) => resolveMember(client, projectId, n).catch((err) => {
|
|
2062
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
2063
|
+
throw new Error(`\uBA64\uBC84 '${n}' \uC870\uD68C \uC2E4\uD328: ${msg}`);
|
|
2064
|
+
})
|
|
2065
|
+
)
|
|
2066
|
+
);
|
|
2067
|
+
const groups = await Promise.all(
|
|
2068
|
+
groupCodes.map(
|
|
2069
|
+
(c) => resolveMemberGroup(client, projectId, c).catch((err) => {
|
|
2070
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
2071
|
+
throw new Error(`\uADF8\uB8F9 '${c}' \uC870\uD68C \uC2E4\uD328: ${msg}`);
|
|
2072
|
+
})
|
|
2073
|
+
)
|
|
2074
|
+
);
|
|
2075
|
+
const groupIds = groups.map((g) => g.id);
|
|
2076
|
+
return parseUserSpec(memberIds, groupIds);
|
|
2077
|
+
}
|
|
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
|
+
|
|
1820
2104
|
// src/editor/index.ts
|
|
1821
2105
|
var import_node_child_process = require("child_process");
|
|
1822
2106
|
var import_promises6 = __toESM(require("fs/promises"));
|
|
@@ -2050,12 +2334,19 @@ async function resolveUsers(client, projectId, names) {
|
|
|
2050
2334
|
}
|
|
2051
2335
|
return users;
|
|
2052
2336
|
}
|
|
2053
|
-
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) => {
|
|
2054
2338
|
const config = await getConfigOrThrow();
|
|
2055
2339
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
2056
2340
|
const mentionInputs = (opts.mention ?? []).filter((s) => s.length > 0);
|
|
2057
2341
|
const groupInputs = (opts.mentionGroup ?? []).filter((s) => s.length > 0);
|
|
2058
2342
|
const linkInputs = (opts.linkTask ?? []).filter((s) => s.length > 0);
|
|
2343
|
+
const ccNames = (opts.cc ?? []).filter((s) => s.length > 0);
|
|
2344
|
+
const ccGroups = (opts.ccGroup ?? []).filter((s) => s.length > 0);
|
|
2345
|
+
const toNames = (opts.to ?? []).filter((s) => s.length > 0);
|
|
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;
|
|
2059
2350
|
startSpinner("\uC5C5\uBB34 \uC870\uD68C \uC911...");
|
|
2060
2351
|
const { projectId, postId, postNumber, projectCode } = await resolvePostInput(client, {
|
|
2061
2352
|
projectArg: project,
|
|
@@ -2073,7 +2364,7 @@ var postEditCommand = new import_commander13.Command("edit").description("\uC5C5
|
|
|
2073
2364
|
"\u26A0 --subject\uB294 deprecated\uC785\uB2C8\uB2E4. \uB300\uC2E0 --title\uC744 \uC0AC\uC6A9\uD574\uC8FC\uC138\uC694.\n"
|
|
2074
2365
|
);
|
|
2075
2366
|
}
|
|
2076
|
-
const nonInteractive = title || opts.body || opts.bodyFile;
|
|
2367
|
+
const nonInteractive = title || opts.body || opts.bodyFile || hasTagChange;
|
|
2077
2368
|
if (nonInteractive) {
|
|
2078
2369
|
let newBody = await readBodyInputOrNull(opts);
|
|
2079
2370
|
if (newBody != null && !opts.dryRun) {
|
|
@@ -2105,30 +2396,51 @@ var postEditCommand = new import_commander13.Command("edit").description("\uC5C5
|
|
|
2105
2396
|
const links = await resolveTaskLinks(client, linkInputs);
|
|
2106
2397
|
newBody = appendTaskLinks(effectiveBody, links, me);
|
|
2107
2398
|
}
|
|
2399
|
+
let toUsers = post.users.to.map((u) => ({
|
|
2400
|
+
type: u.type,
|
|
2401
|
+
member: u.member,
|
|
2402
|
+
emailUser: u.emailUser,
|
|
2403
|
+
group: u.group
|
|
2404
|
+
}));
|
|
2405
|
+
let ccUsers = post.users.cc.map((u) => ({
|
|
2406
|
+
type: u.type,
|
|
2407
|
+
member: u.member,
|
|
2408
|
+
emailUser: u.emailUser,
|
|
2409
|
+
group: u.group
|
|
2410
|
+
}));
|
|
2411
|
+
if (toNames.length > 0 || toGroups.length > 0 || opts.toClear) {
|
|
2412
|
+
const additions = await resolveUserAdditions(client, projectId, toNames, toGroups);
|
|
2413
|
+
toUsers = mergeUsers(toUsers, additions, !!opts.toClear);
|
|
2414
|
+
}
|
|
2415
|
+
if (ccNames.length > 0 || ccGroups.length > 0 || opts.ccClear) {
|
|
2416
|
+
const additions = await resolveUserAdditions(client, projectId, ccNames, ccGroups);
|
|
2417
|
+
ccUsers = mergeUsers(ccUsers, additions, !!opts.ccClear);
|
|
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
|
+
}
|
|
2108
2427
|
if (opts.dryRun) {
|
|
2109
2428
|
stopSpinner(false);
|
|
2110
2429
|
const globalOpts = postEditCommand.optsWithGlobals();
|
|
2111
2430
|
const previewBody = newBody ?? post.body.content;
|
|
2112
2431
|
if (globalOpts.json) {
|
|
2113
|
-
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");
|
|
2114
2438
|
} else {
|
|
2115
2439
|
process.stdout.write(previewBody + "\n");
|
|
2116
2440
|
}
|
|
2117
2441
|
return;
|
|
2118
2442
|
}
|
|
2119
2443
|
startSpinner("\uC5C5\uBB34 \uC218\uC815 \uC911...");
|
|
2120
|
-
const toUsers = post.users.to.map((u) => ({
|
|
2121
|
-
type: u.type,
|
|
2122
|
-
member: u.member,
|
|
2123
|
-
emailUser: u.emailUser,
|
|
2124
|
-
group: u.group
|
|
2125
|
-
}));
|
|
2126
|
-
const ccUsers = post.users.cc.map((u) => ({
|
|
2127
|
-
type: u.type,
|
|
2128
|
-
member: u.member,
|
|
2129
|
-
emailUser: u.emailUser,
|
|
2130
|
-
group: u.group
|
|
2131
|
-
}));
|
|
2132
2444
|
await client.updatePost(projectId, postId, {
|
|
2133
2445
|
subject: title ?? post.subject,
|
|
2134
2446
|
body: {
|
|
@@ -2138,9 +2450,24 @@ var postEditCommand = new import_commander13.Command("edit").description("\uC5C5
|
|
|
2138
2450
|
priority: post.priority,
|
|
2139
2451
|
dueDate: post.dueDate,
|
|
2140
2452
|
dueDateFlag: post.dueDateFlag,
|
|
2141
|
-
users: { to: toUsers, cc: ccUsers }
|
|
2453
|
+
users: { to: toUsers, cc: ccUsers },
|
|
2454
|
+
...finalTagIds !== void 0 && { tagIds: finalTagIds }
|
|
2142
2455
|
});
|
|
2143
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
|
+
}
|
|
2144
2471
|
} else {
|
|
2145
2472
|
if (mentionInputs.length > 0 || groupInputs.length > 0) {
|
|
2146
2473
|
process.stderr.write(
|
|
@@ -2152,6 +2479,16 @@ var postEditCommand = new import_commander13.Command("edit").description("\uC5C5
|
|
|
2152
2479
|
"\u26A0 --link-task \uB294 --title/--body \uC640 \uD568\uAED8 \uC0AC\uC6A9 \uC2DC\uC5D0\uB9CC \uC801\uC6A9\uB429\uB2C8\uB2E4.\n"
|
|
2153
2480
|
);
|
|
2154
2481
|
}
|
|
2482
|
+
if (ccNames.length > 0 || ccGroups.length > 0 || opts.ccClear || toNames.length > 0 || toGroups.length > 0 || opts.toClear) {
|
|
2483
|
+
process.stderr.write(
|
|
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"
|
|
2485
|
+
);
|
|
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
|
+
}
|
|
2155
2492
|
const original = serializePostFrontmatter(post, members);
|
|
2156
2493
|
const edited = await openInEditor(original);
|
|
2157
2494
|
if (original === edited) {
|
|
@@ -2179,7 +2516,7 @@ var postEditCommand = new import_commander13.Command("edit").description("\uC5C5
|
|
|
2179
2516
|
});
|
|
2180
2517
|
|
|
2181
2518
|
// src/commands/post/create.ts
|
|
2182
|
-
var
|
|
2519
|
+
var import_commander15 = require("commander");
|
|
2183
2520
|
|
|
2184
2521
|
// src/resolvers/milestone.ts
|
|
2185
2522
|
async function fetchAllMilestones(client, projectId) {
|
|
@@ -2208,23 +2545,6 @@ async function resolveMilestone(client, projectId, input2) {
|
|
|
2208
2545
|
return match.id;
|
|
2209
2546
|
}
|
|
2210
2547
|
|
|
2211
|
-
// src/resolvers/postRef.ts
|
|
2212
|
-
async function resolvePostRef(client, ref) {
|
|
2213
|
-
if (ref.includes("/")) {
|
|
2214
|
-
const [code, numStr] = ref.split("/", 2);
|
|
2215
|
-
const num = Number(numStr);
|
|
2216
|
-
if (!code || !Number.isFinite(num) || num <= 0) {
|
|
2217
|
-
throw new DoorayCliError(
|
|
2218
|
-
`--parent \uD615\uC2DD\uC774 \uC62C\uBC14\uB974\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4: "${ref}" (\uC608: "tc-ocr/337" \uB610\uB294 raw postId)`,
|
|
2219
|
-
EXIT_PARAM_ERROR
|
|
2220
|
-
);
|
|
2221
|
-
}
|
|
2222
|
-
const projectId = await resolveProject(client, code);
|
|
2223
|
-
return resolvePost(client, projectId, num);
|
|
2224
|
-
}
|
|
2225
|
-
return ref;
|
|
2226
|
-
}
|
|
2227
|
-
|
|
2228
2548
|
// src/commands/post/create.ts
|
|
2229
2549
|
async function resolveUsers2(client, projectId, inputs) {
|
|
2230
2550
|
const users = [];
|
|
@@ -2234,17 +2554,18 @@ async function resolveUsers2(client, projectId, inputs) {
|
|
|
2234
2554
|
}
|
|
2235
2555
|
return users;
|
|
2236
2556
|
}
|
|
2237
|
-
|
|
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) => {
|
|
2238
2566
|
const globalOpts = postCreateCommand.optsWithGlobals();
|
|
2239
2567
|
const config = await getConfigOrThrow();
|
|
2240
2568
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
2241
|
-
const subject = opts.title ?? opts.subject;
|
|
2242
|
-
if (!subject) {
|
|
2243
|
-
throw new DoorayCliError(
|
|
2244
|
-
"--title\uC774 \uD544\uC694\uD569\uB2C8\uB2E4.",
|
|
2245
|
-
EXIT_PARAM_ERROR
|
|
2246
|
-
);
|
|
2247
|
-
}
|
|
2248
2569
|
if (opts.subject && !opts.title) {
|
|
2249
2570
|
process.stderr.write(
|
|
2250
2571
|
"\u26A0 --subject\uB294 deprecated\uC785\uB2C8\uB2E4. \uB300\uC2E0 --title\uC744 \uC0AC\uC6A9\uD574\uC8FC\uC138\uC694.\n"
|
|
@@ -2253,9 +2574,35 @@ var postCreateCommand = new import_commander14.Command("create").description("\u
|
|
|
2253
2574
|
const mentionInputs = (opts.mention ?? []).filter((s) => s.length > 0);
|
|
2254
2575
|
const groupInputs = (opts.mentionGroup ?? []).filter((s) => s.length > 0);
|
|
2255
2576
|
const linkInputs = (opts.linkTask ?? []).filter((s) => s.length > 0);
|
|
2256
|
-
let bodyContent = await readBodyInput(opts);
|
|
2257
2577
|
startSpinner("\uC5C5\uBB34 \uC0DD\uC131 \uC911...");
|
|
2258
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
|
+
}
|
|
2259
2606
|
let projectCode;
|
|
2260
2607
|
if (groupInputs.length > 0) {
|
|
2261
2608
|
const projects = await ensureProjects(client);
|
|
@@ -2293,17 +2640,30 @@ var postCreateCommand = new import_commander14.Command("create").description("\u
|
|
|
2293
2640
|
if (opts.dryRun) {
|
|
2294
2641
|
stopSpinner(false);
|
|
2295
2642
|
if (globalOpts.json) {
|
|
2296
|
-
process.stdout.write(
|
|
2643
|
+
process.stdout.write(
|
|
2644
|
+
JSON.stringify({
|
|
2645
|
+
body: bodyContent,
|
|
2646
|
+
...opts.template && { templateUsed: opts.template }
|
|
2647
|
+
}) + "\n"
|
|
2648
|
+
);
|
|
2297
2649
|
} else {
|
|
2298
2650
|
process.stdout.write(bodyContent + "\n");
|
|
2299
2651
|
}
|
|
2300
2652
|
return;
|
|
2301
2653
|
}
|
|
2302
|
-
const
|
|
2303
|
-
const
|
|
2654
|
+
const ccGroupCodes = (opts.ccGroup ?? []).filter((s) => s.length > 0);
|
|
2655
|
+
const toGroupCodes = (opts.toGroup ?? []).filter((s) => s.length > 0);
|
|
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);
|
|
2658
|
+
const toUsersGroups = toGroupCodes.length > 0 ? await resolveUserAdditions(client, projectId, [], toGroupCodes) : [];
|
|
2659
|
+
const ccUsersGroups = ccGroupCodes.length > 0 ? await resolveUserAdditions(client, projectId, [], ccGroupCodes) : [];
|
|
2660
|
+
const toUsers = [...toUsersMembers, ...toUsersGroups];
|
|
2661
|
+
const ccUsers = [...ccUsersMembers, ...ccUsersGroups];
|
|
2304
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;
|
|
2305
2665
|
const [tagIds, parentPostId, milestoneId] = await Promise.all([
|
|
2306
|
-
|
|
2666
|
+
effectiveTagInputs.length > 0 ? resolveTags(client, projectId, effectiveTagInputs) : validateMandatoryTags(client, projectId).then(() => void 0),
|
|
2307
2667
|
opts.parent ? resolvePostRef(client, opts.parent) : Promise.resolve(void 0),
|
|
2308
2668
|
opts.milestone ? resolveMilestone(client, projectId, opts.milestone) : Promise.resolve(void 0)
|
|
2309
2669
|
]);
|
|
@@ -2339,8 +2699,8 @@ var postCreateCommand = new import_commander14.Command("create").description("\u
|
|
|
2339
2699
|
});
|
|
2340
2700
|
|
|
2341
2701
|
// src/commands/post/done.ts
|
|
2342
|
-
var
|
|
2343
|
-
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) => {
|
|
2344
2704
|
const config = await getConfigOrThrow();
|
|
2345
2705
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
2346
2706
|
startSpinner("\uC5C5\uBB34 \uC644\uB8CC \uCC98\uB9AC \uC911...");
|
|
@@ -2357,8 +2717,8 @@ var postDoneCommand = new import_commander15.Command("done").description("\uC5C5
|
|
|
2357
2717
|
});
|
|
2358
2718
|
|
|
2359
2719
|
// src/commands/post/workflow.ts
|
|
2360
|
-
var
|
|
2361
|
-
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) => {
|
|
2362
2722
|
const config = await getConfigOrThrow();
|
|
2363
2723
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
2364
2724
|
let workflowInput = opts.workflow;
|
|
@@ -2398,7 +2758,7 @@ var postWorkflowCommand = new import_commander16.Command("workflow").description
|
|
|
2398
2758
|
});
|
|
2399
2759
|
|
|
2400
2760
|
// src/commands/post/comment/list.ts
|
|
2401
|
-
var
|
|
2761
|
+
var import_commander18 = require("commander");
|
|
2402
2762
|
|
|
2403
2763
|
// src/utils/comment-enrich.ts
|
|
2404
2764
|
function enrichCommentCreators(comments, nameMap) {
|
|
@@ -2475,7 +2835,7 @@ async function fetchSince(client, projectId, postId, sinceDate) {
|
|
|
2475
2835
|
}
|
|
2476
2836
|
return collected;
|
|
2477
2837
|
}
|
|
2478
|
-
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) => {
|
|
2479
2839
|
const globalOpts = commentListCommand.optsWithGlobals();
|
|
2480
2840
|
const config = await getConfigOrThrow();
|
|
2481
2841
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -2537,8 +2897,8 @@ var commentListCommand = new import_commander17.Command("list").description("\uB
|
|
|
2537
2897
|
});
|
|
2538
2898
|
|
|
2539
2899
|
// src/commands/post/comment/latest.ts
|
|
2540
|
-
var
|
|
2541
|
-
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) => {
|
|
2542
2902
|
const globalOpts = commentLatestCommand.optsWithGlobals();
|
|
2543
2903
|
const config = await getConfigOrThrow();
|
|
2544
2904
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -2575,8 +2935,8 @@ var commentLatestCommand = new import_commander18.Command("latest").description(
|
|
|
2575
2935
|
});
|
|
2576
2936
|
|
|
2577
2937
|
// src/commands/post/comment/add.ts
|
|
2578
|
-
var
|
|
2579
|
-
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(
|
|
2580
2940
|
"--mention <name>",
|
|
2581
2941
|
"\uBA64\uBC84 \uBA58\uC158 (\uBC18\uBCF5 \uAC00\uB2A5, \uC774\uB984 \uBD80\uBD84\uC77C\uCE58)",
|
|
2582
2942
|
(value, prev) => [...prev, value],
|
|
@@ -2655,8 +3015,8 @@ var commentAddCommand = new import_commander19.Command("add").description("\uB31
|
|
|
2655
3015
|
});
|
|
2656
3016
|
|
|
2657
3017
|
// src/commands/post/comment/edit.ts
|
|
2658
|
-
var
|
|
2659
|
-
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(
|
|
2660
3020
|
"--mention <name>",
|
|
2661
3021
|
"\uBA64\uBC84 \uBA58\uC158 (\uBC18\uBCF5 \uAC00\uB2A5, \uC774\uB984 \uBD80\uBD84\uC77C\uCE58)",
|
|
2662
3022
|
(value, prev) => [...prev, value],
|
|
@@ -2784,8 +3144,8 @@ var commentEditCommand = new import_commander20.Command("edit").description("\uB
|
|
|
2784
3144
|
});
|
|
2785
3145
|
|
|
2786
3146
|
// src/commands/post/comment/delete.ts
|
|
2787
|
-
var
|
|
2788
|
-
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) => {
|
|
2789
3149
|
const config = await getConfigOrThrow();
|
|
2790
3150
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
2791
3151
|
let projectArg;
|
|
@@ -2841,7 +3201,7 @@ var commentDeleteCommand = new import_commander21.Command("delete").description(
|
|
|
2841
3201
|
});
|
|
2842
3202
|
|
|
2843
3203
|
// src/commands/post/comment/get.ts
|
|
2844
|
-
var
|
|
3204
|
+
var import_commander23 = require("commander");
|
|
2845
3205
|
|
|
2846
3206
|
// src/formatters/comment.ts
|
|
2847
3207
|
function formatCommentDetail(comment, opts) {
|
|
@@ -2915,7 +3275,7 @@ function parseGetArgs(arg1, arg2, arg3, opts) {
|
|
|
2915
3275
|
EXIT_PARAM_ERROR
|
|
2916
3276
|
);
|
|
2917
3277
|
}
|
|
2918
|
-
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) => {
|
|
2919
3279
|
const parsed = parseGetArgs(arg1, arg2, arg3, opts);
|
|
2920
3280
|
const config = await getConfigOrThrow();
|
|
2921
3281
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -2950,10 +3310,10 @@ var commentGetCommand = new import_commander22.Command("get").description("\uB2E
|
|
|
2950
3310
|
});
|
|
2951
3311
|
|
|
2952
3312
|
// src/commands/post/comment/file/index.ts
|
|
2953
|
-
var
|
|
3313
|
+
var import_commander28 = require("commander");
|
|
2954
3314
|
|
|
2955
3315
|
// src/commands/post/comment/file/list.ts
|
|
2956
|
-
var
|
|
3316
|
+
var import_commander24 = require("commander");
|
|
2957
3317
|
|
|
2958
3318
|
// src/resolvers/comment-file-input.ts
|
|
2959
3319
|
var FILE_ID_SECONDARY_LABEL = {
|
|
@@ -3028,7 +3388,7 @@ function formatSize(bytes) {
|
|
|
3028
3388
|
if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)}KB`;
|
|
3029
3389
|
return `${(bytes / (1024 * 1024)).toFixed(1)}MB`;
|
|
3030
3390
|
}
|
|
3031
|
-
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) => {
|
|
3032
3392
|
const globalOpts = listCommentFileCommand.optsWithGlobals();
|
|
3033
3393
|
const config = await getConfigOrThrow();
|
|
3034
3394
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -3062,7 +3422,7 @@ var listCommentFileCommand = new import_commander23.Command("list").description(
|
|
|
3062
3422
|
});
|
|
3063
3423
|
|
|
3064
3424
|
// src/commands/post/comment/file/upload.ts
|
|
3065
|
-
var
|
|
3425
|
+
var import_commander25 = require("commander");
|
|
3066
3426
|
var import_node_path4 = require("path");
|
|
3067
3427
|
|
|
3068
3428
|
// src/utils/comment-files.ts
|
|
@@ -3083,7 +3443,7 @@ function removeFileReference(body, fileId) {
|
|
|
3083
3443
|
}
|
|
3084
3444
|
|
|
3085
3445
|
// src/commands/post/comment/file/upload.ts
|
|
3086
|
-
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) => {
|
|
3087
3447
|
const globalOpts = uploadCommentFileCommand.optsWithGlobals();
|
|
3088
3448
|
const config = await getConfigOrThrow();
|
|
3089
3449
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -3132,10 +3492,10 @@ var uploadCommentFileCommand = new import_commander24.Command("upload").descript
|
|
|
3132
3492
|
});
|
|
3133
3493
|
|
|
3134
3494
|
// src/commands/post/comment/file/download.ts
|
|
3135
|
-
var
|
|
3495
|
+
var import_commander26 = require("commander");
|
|
3136
3496
|
var import_promises8 = require("fs/promises");
|
|
3137
3497
|
var import_node_path5 = require("path");
|
|
3138
|
-
var downloadCommentFileCommand = new
|
|
3498
|
+
var downloadCommentFileCommand = new import_commander26.Command("download").description(
|
|
3139
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)"
|
|
3140
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) => {
|
|
3141
3501
|
const config = await getConfigOrThrow();
|
|
@@ -3163,8 +3523,8 @@ var downloadCommentFileCommand = new import_commander25.Command("download").desc
|
|
|
3163
3523
|
});
|
|
3164
3524
|
|
|
3165
3525
|
// src/commands/post/comment/file/delete.ts
|
|
3166
|
-
var
|
|
3167
|
-
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) => {
|
|
3168
3528
|
const config = await getConfigOrThrow();
|
|
3169
3529
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
3170
3530
|
const { projectId, postId, commentId, secondary: fileId } = await resolveCommentFileInput(client, {
|
|
@@ -3221,16 +3581,16 @@ var deleteCommentFileCommand = new import_commander26.Command("delete").descript
|
|
|
3221
3581
|
});
|
|
3222
3582
|
|
|
3223
3583
|
// src/commands/post/comment/file/index.ts
|
|
3224
|
-
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);
|
|
3225
3585
|
|
|
3226
3586
|
// src/commands/post/file/list.ts
|
|
3227
|
-
var
|
|
3587
|
+
var import_commander29 = require("commander");
|
|
3228
3588
|
function formatSize2(bytes) {
|
|
3229
3589
|
if (bytes < 1024) return `${bytes}B`;
|
|
3230
3590
|
if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)}KB`;
|
|
3231
3591
|
return `${(bytes / (1024 * 1024)).toFixed(1)}MB`;
|
|
3232
3592
|
}
|
|
3233
|
-
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) => {
|
|
3234
3594
|
const globalOpts = fileListCommand.optsWithGlobals();
|
|
3235
3595
|
const config = await getConfigOrThrow();
|
|
3236
3596
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -3258,10 +3618,10 @@ var fileListCommand = new import_commander28.Command("list").description("\uC5C5
|
|
|
3258
3618
|
});
|
|
3259
3619
|
|
|
3260
3620
|
// src/commands/post/file/download.ts
|
|
3261
|
-
var
|
|
3621
|
+
var import_commander30 = require("commander");
|
|
3262
3622
|
var import_promises9 = require("fs/promises");
|
|
3263
3623
|
var import_node_path6 = require("path");
|
|
3264
|
-
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) => {
|
|
3265
3625
|
const config = await getConfigOrThrow();
|
|
3266
3626
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
3267
3627
|
let projectArg;
|
|
@@ -3316,10 +3676,10 @@ var fileDownloadCommand = new import_commander29.Command("download").description
|
|
|
3316
3676
|
});
|
|
3317
3677
|
|
|
3318
3678
|
// src/commands/post/file/download-all.ts
|
|
3319
|
-
var
|
|
3679
|
+
var import_commander31 = require("commander");
|
|
3320
3680
|
var import_promises10 = require("fs/promises");
|
|
3321
3681
|
var import_node_path7 = require("path");
|
|
3322
|
-
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) => {
|
|
3323
3683
|
const config = await getConfigOrThrow();
|
|
3324
3684
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
3325
3685
|
const spinner = startSpinner("\uCCA8\uBD80\uD30C\uC77C \uBAA9\uB85D \uC870\uD68C \uC911...");
|
|
@@ -3352,9 +3712,9 @@ var fileDownloadAllCommand = new import_commander30.Command("download-all").desc
|
|
|
3352
3712
|
});
|
|
3353
3713
|
|
|
3354
3714
|
// src/commands/post/file/upload.ts
|
|
3355
|
-
var
|
|
3715
|
+
var import_commander32 = require("commander");
|
|
3356
3716
|
var import_node_path8 = require("path");
|
|
3357
|
-
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) => {
|
|
3358
3718
|
const globalOpts = fileUploadCommand.optsWithGlobals();
|
|
3359
3719
|
const config = await getConfigOrThrow();
|
|
3360
3720
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -3415,8 +3775,8 @@ var fileUploadCommand = new import_commander31.Command("upload").description("\u
|
|
|
3415
3775
|
});
|
|
3416
3776
|
|
|
3417
3777
|
// src/commands/post/file/delete.ts
|
|
3418
|
-
var
|
|
3419
|
-
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) => {
|
|
3420
3780
|
const config = await getConfigOrThrow();
|
|
3421
3781
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
3422
3782
|
let projectArg;
|
|
@@ -3469,7 +3829,7 @@ var fileDeleteCommand = new import_commander32.Command("delete").description("\u
|
|
|
3469
3829
|
});
|
|
3470
3830
|
|
|
3471
3831
|
// src/commands/wiki/list.ts
|
|
3472
|
-
var
|
|
3832
|
+
var import_commander34 = require("commander");
|
|
3473
3833
|
|
|
3474
3834
|
// src/formatters/wiki.ts
|
|
3475
3835
|
function formatWikiList(wikis, opts) {
|
|
@@ -3512,7 +3872,7 @@ function formatWikiPageDetail(page, opts) {
|
|
|
3512
3872
|
}
|
|
3513
3873
|
|
|
3514
3874
|
// src/commands/wiki/list.ts
|
|
3515
|
-
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) => {
|
|
3516
3876
|
const globalOpts = wikiListCommand.optsWithGlobals();
|
|
3517
3877
|
const config = await getConfigOrThrow();
|
|
3518
3878
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -3526,7 +3886,7 @@ var wikiListCommand = new import_commander33.Command("list").description("\uC704
|
|
|
3526
3886
|
});
|
|
3527
3887
|
|
|
3528
3888
|
// src/commands/wiki/pages.ts
|
|
3529
|
-
var
|
|
3889
|
+
var import_commander35 = require("commander");
|
|
3530
3890
|
|
|
3531
3891
|
// src/resolvers/wiki.ts
|
|
3532
3892
|
async function resolveWiki(client, projectCode) {
|
|
@@ -3570,7 +3930,7 @@ async function resolveWikiHomePageId(client, wikiId) {
|
|
|
3570
3930
|
}
|
|
3571
3931
|
|
|
3572
3932
|
// src/commands/wiki/pages.ts
|
|
3573
|
-
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) => {
|
|
3574
3934
|
const globalOpts = wikiPagesCommand.optsWithGlobals();
|
|
3575
3935
|
const config = await getConfigOrThrow();
|
|
3576
3936
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -3582,8 +3942,8 @@ var wikiPagesCommand = new import_commander34.Command("pages").description("\uC7
|
|
|
3582
3942
|
});
|
|
3583
3943
|
|
|
3584
3944
|
// src/commands/wiki/page-get.ts
|
|
3585
|
-
var
|
|
3586
|
-
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) => {
|
|
3587
3947
|
const globalOpts = wikiPageGetCommand.optsWithGlobals();
|
|
3588
3948
|
const config = await getConfigOrThrow();
|
|
3589
3949
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -3595,8 +3955,8 @@ var wikiPageGetCommand = new import_commander35.Command("get").description("\uC7
|
|
|
3595
3955
|
});
|
|
3596
3956
|
|
|
3597
3957
|
// src/commands/wiki/page-create.ts
|
|
3598
|
-
var
|
|
3599
|
-
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) => {
|
|
3600
3960
|
const globalOpts = wikiPageCreateCommand.optsWithGlobals();
|
|
3601
3961
|
const config = await getConfigOrThrow();
|
|
3602
3962
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -3621,8 +3981,8 @@ var wikiPageCreateCommand = new import_commander36.Command("create").description
|
|
|
3621
3981
|
});
|
|
3622
3982
|
|
|
3623
3983
|
// src/commands/wiki/page-edit.ts
|
|
3624
|
-
var
|
|
3625
|
-
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) => {
|
|
3626
3986
|
const config = await getConfigOrThrow();
|
|
3627
3987
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
3628
3988
|
const hasTitle = opts.title != null;
|
|
@@ -3675,10 +4035,10 @@ var wikiPageEditCommand = new import_commander37.Command("edit").description("\u
|
|
|
3675
4035
|
});
|
|
3676
4036
|
|
|
3677
4037
|
// src/commands/member/index.ts
|
|
3678
|
-
var
|
|
4038
|
+
var import_commander42 = require("commander");
|
|
3679
4039
|
|
|
3680
4040
|
// src/commands/member/get.ts
|
|
3681
|
-
var
|
|
4041
|
+
var import_commander39 = require("commander");
|
|
3682
4042
|
|
|
3683
4043
|
// src/formatters/member.ts
|
|
3684
4044
|
function formatMemberDetail(member, opts) {
|
|
@@ -3724,7 +4084,7 @@ function formatMemberSearchResults(members, opts) {
|
|
|
3724
4084
|
}
|
|
3725
4085
|
|
|
3726
4086
|
// src/commands/member/get.ts
|
|
3727
|
-
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) => {
|
|
3728
4088
|
const globalOpts = memberGetCommand.optsWithGlobals();
|
|
3729
4089
|
const config = await getConfigOrThrow();
|
|
3730
4090
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -3733,8 +4093,8 @@ var memberGetCommand = new import_commander38.Command("get").description("\uBA64
|
|
|
3733
4093
|
});
|
|
3734
4094
|
|
|
3735
4095
|
// src/commands/member/list.ts
|
|
3736
|
-
var
|
|
3737
|
-
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) => {
|
|
3738
4098
|
const globalOpts = memberListCommand.optsWithGlobals();
|
|
3739
4099
|
const config = await getConfigOrThrow();
|
|
3740
4100
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -3749,8 +4109,8 @@ var memberListCommand = new import_commander39.Command("list").description("\uD5
|
|
|
3749
4109
|
});
|
|
3750
4110
|
|
|
3751
4111
|
// src/commands/member/search.ts
|
|
3752
|
-
var
|
|
3753
|
-
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) => {
|
|
3754
4114
|
const globalOpts = memberSearchCommand.optsWithGlobals();
|
|
3755
4115
|
const filterCount = [keyword, opts.email, opts.userCode, opts.userCodeExact].filter(Boolean).length;
|
|
3756
4116
|
if (filterCount === 0) {
|
|
@@ -3783,13 +4143,13 @@ var memberSearchCommand = new import_commander40.Command("search").description("
|
|
|
3783
4143
|
});
|
|
3784
4144
|
|
|
3785
4145
|
// src/commands/member/index.ts
|
|
3786
|
-
var memberCommand = new
|
|
4146
|
+
var memberCommand = new import_commander42.Command("member").description("Dooray \uBA64\uBC84 \uC870\uD68C");
|
|
3787
4147
|
memberCommand.addCommand(memberGetCommand);
|
|
3788
4148
|
memberCommand.addCommand(memberListCommand);
|
|
3789
4149
|
memberCommand.addCommand(memberSearchCommand);
|
|
3790
4150
|
|
|
3791
4151
|
// src/commands/mail/list.ts
|
|
3792
|
-
var
|
|
4152
|
+
var import_commander43 = require("commander");
|
|
3793
4153
|
|
|
3794
4154
|
// src/api/imapClient.ts
|
|
3795
4155
|
var import_imapflow = require("imapflow");
|
|
@@ -3906,7 +4266,7 @@ async function getMail(config, uid) {
|
|
|
3906
4266
|
|
|
3907
4267
|
// src/commands/mail/list.ts
|
|
3908
4268
|
var import_chalk5 = __toESM(require("chalk"));
|
|
3909
|
-
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) => {
|
|
3910
4270
|
const globalOpts = mailListCommand.optsWithGlobals();
|
|
3911
4271
|
const config = await getConfigOrThrow();
|
|
3912
4272
|
startSpinner("\uBA54\uC77C \uC870\uD68C \uC911...");
|
|
@@ -3938,9 +4298,9 @@ var mailListCommand = new import_commander42.Command("list").description("\uBA54
|
|
|
3938
4298
|
});
|
|
3939
4299
|
|
|
3940
4300
|
// src/commands/mail/get.ts
|
|
3941
|
-
var
|
|
4301
|
+
var import_commander44 = require("commander");
|
|
3942
4302
|
var import_chalk6 = __toESM(require("chalk"));
|
|
3943
|
-
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) => {
|
|
3944
4304
|
const globalOpts = mailGetCommand.optsWithGlobals();
|
|
3945
4305
|
const config = await getConfigOrThrow();
|
|
3946
4306
|
startSpinner("\uBA54\uC77C \uC870\uD68C \uC911...");
|
|
@@ -3971,7 +4331,7 @@ ${mail.body}
|
|
|
3971
4331
|
});
|
|
3972
4332
|
|
|
3973
4333
|
// src/commands/mail/send.ts
|
|
3974
|
-
var
|
|
4334
|
+
var import_commander45 = require("commander");
|
|
3975
4335
|
var import_promises11 = require("fs/promises");
|
|
3976
4336
|
|
|
3977
4337
|
// src/api/smtpClient.ts
|
|
@@ -4021,7 +4381,7 @@ async function sendMail(config, opts) {
|
|
|
4021
4381
|
}
|
|
4022
4382
|
|
|
4023
4383
|
// src/commands/mail/send.ts
|
|
4024
|
-
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) => {
|
|
4025
4385
|
const globalOpts = mailSendCommand.optsWithGlobals();
|
|
4026
4386
|
const config = await getConfigOrThrow();
|
|
4027
4387
|
let body = opts.body ?? "";
|
|
@@ -4056,7 +4416,7 @@ var mailSendCommand = new import_commander44.Command("send").description("\uBA54
|
|
|
4056
4416
|
});
|
|
4057
4417
|
|
|
4058
4418
|
// src/commands/mail/reply.ts
|
|
4059
|
-
var
|
|
4419
|
+
var import_commander46 = require("commander");
|
|
4060
4420
|
var import_promises12 = require("fs/promises");
|
|
4061
4421
|
var import_imapflow2 = require("imapflow");
|
|
4062
4422
|
async function getMessageId(config, uid) {
|
|
@@ -4085,7 +4445,7 @@ async function getMessageId(config, uid) {
|
|
|
4085
4445
|
await client.logout();
|
|
4086
4446
|
}
|
|
4087
4447
|
}
|
|
4088
|
-
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) => {
|
|
4089
4449
|
const globalOpts = mailReplyCommand.optsWithGlobals();
|
|
4090
4450
|
const config = await getConfigOrThrow();
|
|
4091
4451
|
let body = opts.body ?? "";
|
|
@@ -4126,7 +4486,7 @@ var mailReplyCommand = new import_commander45.Command("reply").description("\uBA
|
|
|
4126
4486
|
});
|
|
4127
4487
|
|
|
4128
4488
|
// src/commands/feedback.ts
|
|
4129
|
-
var
|
|
4489
|
+
var import_commander47 = require("commander");
|
|
4130
4490
|
var import_node_child_process2 = require("child_process");
|
|
4131
4491
|
var import_node_util = require("util");
|
|
4132
4492
|
var import_promises15 = require("fs/promises");
|
|
@@ -4237,7 +4597,7 @@ async function readBody(opts) {
|
|
|
4237
4597
|
if (opts.bodyFile) return await (0, import_promises15.readFile)(opts.bodyFile, "utf-8");
|
|
4238
4598
|
return void 0;
|
|
4239
4599
|
}
|
|
4240
|
-
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(
|
|
4241
4601
|
"--label <name>",
|
|
4242
4602
|
"\uB77C\uBCA8 (\uBC18\uBCF5 \uAC00\uB2A5)",
|
|
4243
4603
|
(value, prev) => [...prev, value],
|
|
@@ -4400,8 +4760,8 @@ function sanitizeArgv(argv) {
|
|
|
4400
4760
|
}
|
|
4401
4761
|
|
|
4402
4762
|
// src/index.ts
|
|
4403
|
-
var program = new
|
|
4404
|
-
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");
|
|
4405
4765
|
program.hook("preAction", () => {
|
|
4406
4766
|
const opts = program.opts();
|
|
4407
4767
|
if (opts.color === false || process.env.NO_COLOR) {
|
|
@@ -4411,13 +4771,14 @@ program.hook("preAction", () => {
|
|
|
4411
4771
|
setQuiet(true);
|
|
4412
4772
|
}
|
|
4413
4773
|
});
|
|
4414
|
-
var projectCommand = new
|
|
4774
|
+
var projectCommand = new import_commander48.Command("project").description("\uD504\uB85C\uC81D\uD2B8 \uAD00\uB828 \uBA85\uB839");
|
|
4415
4775
|
projectCommand.addCommand(projectListCommand);
|
|
4416
4776
|
projectCommand.addCommand(projectMembersCommand);
|
|
4417
4777
|
projectCommand.addCommand(projectWorkflowsCommand);
|
|
4418
4778
|
projectCommand.addCommand(projectGroupsCommand);
|
|
4419
4779
|
projectCommand.addCommand(projectTagsCommand);
|
|
4420
|
-
|
|
4780
|
+
projectCommand.addCommand(projectTemplatesCommand);
|
|
4781
|
+
var postCommand = new import_commander48.Command("post").description("\uC5C5\uBB34 \uAD00\uB828 \uBA85\uB839");
|
|
4421
4782
|
postCommand.addCommand(postListCommand);
|
|
4422
4783
|
postCommand.addCommand(postSearchCommand);
|
|
4423
4784
|
postCommand.addCommand(postGetCommand);
|
|
@@ -4425,7 +4786,7 @@ postCommand.addCommand(postEditCommand);
|
|
|
4425
4786
|
postCommand.addCommand(postCreateCommand);
|
|
4426
4787
|
postCommand.addCommand(postDoneCommand);
|
|
4427
4788
|
postCommand.addCommand(postWorkflowCommand);
|
|
4428
|
-
var commentCommand = new
|
|
4789
|
+
var commentCommand = new import_commander48.Command("comment").description("\uB313\uAE00 \uAD00\uB828 \uBA85\uB839");
|
|
4429
4790
|
commentCommand.addCommand(commentListCommand);
|
|
4430
4791
|
commentCommand.addCommand(commentLatestCommand);
|
|
4431
4792
|
commentCommand.addCommand(commentGetCommand);
|
|
@@ -4434,22 +4795,22 @@ commentCommand.addCommand(commentEditCommand);
|
|
|
4434
4795
|
commentCommand.addCommand(commentDeleteCommand);
|
|
4435
4796
|
commentCommand.addCommand(commentFileCommand);
|
|
4436
4797
|
postCommand.addCommand(commentCommand);
|
|
4437
|
-
var fileCommand = new
|
|
4798
|
+
var fileCommand = new import_commander48.Command("file").description("\uCCA8\uBD80\uD30C\uC77C \uAD00\uB828 \uBA85\uB839");
|
|
4438
4799
|
fileCommand.addCommand(fileListCommand);
|
|
4439
4800
|
fileCommand.addCommand(fileDownloadCommand);
|
|
4440
4801
|
fileCommand.addCommand(fileDownloadAllCommand);
|
|
4441
4802
|
fileCommand.addCommand(fileUploadCommand);
|
|
4442
4803
|
fileCommand.addCommand(fileDeleteCommand);
|
|
4443
4804
|
postCommand.addCommand(fileCommand);
|
|
4444
|
-
var wikiCommand = new
|
|
4805
|
+
var wikiCommand = new import_commander48.Command("wiki").description("\uC704\uD0A4 \uAD00\uB828 \uBA85\uB839");
|
|
4445
4806
|
wikiCommand.addCommand(wikiListCommand);
|
|
4446
4807
|
wikiCommand.addCommand(wikiPagesCommand);
|
|
4447
|
-
var wikiPageCommand = new
|
|
4808
|
+
var wikiPageCommand = new import_commander48.Command("page").description("\uC704\uD0A4 \uD398\uC774\uC9C0 \uAD00\uB828 \uBA85\uB839");
|
|
4448
4809
|
wikiPageCommand.addCommand(wikiPageGetCommand);
|
|
4449
4810
|
wikiPageCommand.addCommand(wikiPageCreateCommand);
|
|
4450
4811
|
wikiPageCommand.addCommand(wikiPageEditCommand);
|
|
4451
4812
|
wikiCommand.addCommand(wikiPageCommand);
|
|
4452
|
-
var mailCommand = new
|
|
4813
|
+
var mailCommand = new import_commander48.Command("mail").description("\uBA54\uC77C \uAD00\uB828 \uBA85\uB839");
|
|
4453
4814
|
mailCommand.addCommand(mailListCommand);
|
|
4454
4815
|
mailCommand.addCommand(mailGetCommand);
|
|
4455
4816
|
mailCommand.addCommand(mailSendCommand);
|