@bifos/dooray-cli 0.3.0 → 0.4.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 +16 -4
- package/dist/index.js +198 -82
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -12,14 +12,23 @@ npm install -g @bifos/dooray-cli
|
|
|
12
12
|
|
|
13
13
|
## 초기 설정 (Setup)
|
|
14
14
|
|
|
15
|
+
대화형 마법사로 한 번에 설정할 수 있습니다:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
dooray setup
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
API Endpoint 선택 → API Key 입력 → 연결 테스트 → 메일 설정(선택)을 순서대로 진행합니다.
|
|
22
|
+
API 토큰은 `https://{tenant}.dooray.com/setting/api/token`에서 발급할 수 있습니다.
|
|
23
|
+
|
|
24
|
+
수동 설정도 가능합니다:
|
|
25
|
+
|
|
15
26
|
```bash
|
|
16
27
|
dooray config set base-url https://api.dooray.com
|
|
17
28
|
dooray config set api-key <YOUR_API_TOKEN>
|
|
18
29
|
dooray doctor
|
|
19
30
|
```
|
|
20
31
|
|
|
21
|
-
API 토큰은 `https://{org}.dooray.com/setting/api/token`에서 발급할 수 있습니다.
|
|
22
|
-
|
|
23
32
|
## 사용법 (Usage)
|
|
24
33
|
|
|
25
34
|
### 프로젝트
|
|
@@ -80,14 +89,16 @@ dooray post workflow tc-ocr 42 "진행 중" # 워크플로우 변경
|
|
|
80
89
|
dooray wiki list # 위키 목록
|
|
81
90
|
dooray wiki pages tc-ocr # 페이지 목록
|
|
82
91
|
dooray wiki page get tc-ocr <page-id> # 페이지 상세
|
|
92
|
+
dooray wiki page create tc-ocr # 페이지 생성 ($EDITOR)
|
|
93
|
+
dooray wiki page edit tc-ocr <page-id> # 페이지 수정 ($EDITOR)
|
|
83
94
|
```
|
|
84
95
|
|
|
85
96
|
### 메일
|
|
86
97
|
|
|
87
|
-
IMAP을 통해 Dooray 메일을 조회할 수 있습니다.
|
|
98
|
+
IMAP을 통해 Dooray 메일을 조회할 수 있습니다. 메일 설정은 `dooray setup`에서 한 번에 진행하거나, 수동으로 설정할 수 있습니다.
|
|
88
99
|
|
|
89
100
|
```bash
|
|
90
|
-
#
|
|
101
|
+
# 수동 설정 (dooray setup 사용 시 불필요)
|
|
91
102
|
dooray config set imap-username your@email.com
|
|
92
103
|
dooray config set imap-password <IMAP_APP_PASSWORD>
|
|
93
104
|
|
|
@@ -166,6 +177,7 @@ dooray doctor # 캐시 상태 확인
|
|
|
166
177
|
|
|
167
178
|
- TypeScript + Commander.js
|
|
168
179
|
- ky (fetch 기반 HTTP 클라이언트)
|
|
180
|
+
- @inquirer/prompts (대화형 설정 마법사)
|
|
169
181
|
- tsup (esbuild 번들러)
|
|
170
182
|
- chalk + cli-table3 (출력 포맷)
|
|
171
183
|
|
package/dist/index.js
CHANGED
|
@@ -24,8 +24,8 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
24
24
|
));
|
|
25
25
|
|
|
26
26
|
// src/index.ts
|
|
27
|
-
var
|
|
28
|
-
var
|
|
27
|
+
var import_commander33 = require("commander");
|
|
28
|
+
var import_chalk7 = __toESM(require("chalk"));
|
|
29
29
|
|
|
30
30
|
// src/commands/config.ts
|
|
31
31
|
var import_commander = require("commander");
|
|
@@ -53,8 +53,15 @@ var EXIT_PARAM_ERROR = 3;
|
|
|
53
53
|
var EXIT_CONFIG_ERROR = 4;
|
|
54
54
|
|
|
55
55
|
// src/config/types.ts
|
|
56
|
+
var API_ENDPOINTS = {
|
|
57
|
+
"\uBBFC\uAC04 \uD074\uB77C\uC6B0\uB4DC": "https://api.dooray.com",
|
|
58
|
+
"\uACF5\uACF5 \uD074\uB77C\uC6B0\uB4DC": "https://api.gov-dooray.com",
|
|
59
|
+
"\uACF5\uACF5 \uC5C5\uBB34\uB9DD \uD074\uB77C\uC6B0\uB4DC": "https://api.gov-dooray.co.kr",
|
|
60
|
+
"\uAE08\uC735 \uD074\uB77C\uC6B0\uB4DC": "https://api.dooray.co.kr"
|
|
61
|
+
};
|
|
56
62
|
var DEFAULTS = {
|
|
57
63
|
baseUrl: "https://api.dooray.com",
|
|
64
|
+
tenantName: "nhnent",
|
|
58
65
|
imapHost: "imap.dooray.com",
|
|
59
66
|
imapPort: 993,
|
|
60
67
|
smtpHost: "smtp.dooray.com",
|
|
@@ -79,7 +86,7 @@ async function getConfigOrThrow() {
|
|
|
79
86
|
const config = await getConfig();
|
|
80
87
|
if (!config || !config.apiKey || !config.baseUrl) {
|
|
81
88
|
throw new DoorayCliError(
|
|
82
|
-
"\uC124\uC815\uC774 \uC644\uB8CC\uB418\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4. \uBA3C\uC800 \uC124\uC815\uC744 \uC9C4\uD589\uD558\uC138\uC694:\n dooray
|
|
89
|
+
"\uC124\uC815\uC774 \uC644\uB8CC\uB418\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4. \uBA3C\uC800 \uCD08\uAE30 \uC124\uC815\uC744 \uC9C4\uD589\uD558\uC138\uC694:\n dooray setup",
|
|
83
90
|
EXIT_CONFIG_ERROR
|
|
84
91
|
);
|
|
85
92
|
}
|
|
@@ -114,18 +121,25 @@ async function setConfigValue(key, value) {
|
|
|
114
121
|
case "smtp-host":
|
|
115
122
|
config.smtpHost = value;
|
|
116
123
|
break;
|
|
124
|
+
case "tenant-name":
|
|
125
|
+
config.tenantName = value;
|
|
126
|
+
break;
|
|
117
127
|
case "smtp-port":
|
|
118
128
|
config.smtpPort = parseInt(value, 10);
|
|
119
129
|
break;
|
|
120
130
|
default:
|
|
121
131
|
throw new DoorayCliError(
|
|
122
132
|
`\uC54C \uC218 \uC5C6\uB294 \uC124\uC815 \uD0A4: ${key}
|
|
123
|
-
\uC0AC\uC6A9 \uAC00\uB2A5\uD55C \uD0A4: api-key, base-url, imap-host, imap-port, imap-username, imap-password, smtp-host, smtp-port`,
|
|
133
|
+
\uC0AC\uC6A9 \uAC00\uB2A5\uD55C \uD0A4: api-key, base-url, tenant-name, imap-host, imap-port, imap-username, imap-password, smtp-host, smtp-port`,
|
|
124
134
|
EXIT_CONFIG_ERROR
|
|
125
135
|
);
|
|
126
136
|
}
|
|
127
137
|
await (0, import_promises.writeFile)(CONFIG_PATH, JSON.stringify(config, null, 2) + "\n");
|
|
128
138
|
}
|
|
139
|
+
async function saveConfig(config) {
|
|
140
|
+
await ensureDir();
|
|
141
|
+
await (0, import_promises.writeFile)(CONFIG_PATH, JSON.stringify(config, null, 2) + "\n");
|
|
142
|
+
}
|
|
129
143
|
|
|
130
144
|
// src/commands/config.ts
|
|
131
145
|
function maskApiKey(key) {
|
|
@@ -666,14 +680,115 @@ var doctorCommand = new import_commander3.Command("doctor").description("\uC124\
|
|
|
666
680
|
console.log(import_chalk3.default.green("\u2713 \uAE30\uBCF8 \uC124\uC815\uC774 \uC644\uB8CC\uB418\uC5C8\uC2B5\uB2C8\uB2E4."));
|
|
667
681
|
} else {
|
|
668
682
|
console.log(import_chalk3.default.yellow("\u26A0 \uC124\uC815\uC774 \uD544\uC694\uD569\uB2C8\uB2E4:"));
|
|
669
|
-
|
|
670
|
-
if (!baseUrlOk) console.log(import_chalk3.default.yellow(" dooray config set base-url <YOUR_BASE_URL>"));
|
|
683
|
+
console.log(import_chalk3.default.yellow(" dooray setup"));
|
|
671
684
|
}
|
|
672
685
|
console.log();
|
|
673
686
|
});
|
|
674
687
|
|
|
675
|
-
// src/commands/
|
|
688
|
+
// src/commands/setup.ts
|
|
676
689
|
var import_commander4 = require("commander");
|
|
690
|
+
var import_chalk4 = __toESM(require("chalk"));
|
|
691
|
+
var setupCommand = new import_commander4.Command("setup").description("\uB300\uD654\uD615 \uCD08\uAE30 \uC124\uC815 \uB9C8\uBC95\uC0AC").action(async () => {
|
|
692
|
+
const { input, select, password, confirm } = await import("@inquirer/prompts");
|
|
693
|
+
const existing = await getConfig();
|
|
694
|
+
try {
|
|
695
|
+
const tenantName = await input({
|
|
696
|
+
message: "\uD14C\uB10C\uD2B8\uBA85\uC744 \uC785\uB825\uD558\uC138\uC694",
|
|
697
|
+
default: existing?.tenantName ?? DEFAULTS.tenantName,
|
|
698
|
+
theme: { prefix: "\u{1F3E2}" }
|
|
699
|
+
});
|
|
700
|
+
console.log(
|
|
701
|
+
import_chalk4.default.gray(
|
|
702
|
+
` \uC811\uC18D URL: https://${tenantName}.dooray.com`
|
|
703
|
+
)
|
|
704
|
+
);
|
|
705
|
+
const endpointChoices = Object.entries(API_ENDPOINTS).map(
|
|
706
|
+
([name, url]) => ({
|
|
707
|
+
name: `${name} (${url})`,
|
|
708
|
+
value: url
|
|
709
|
+
})
|
|
710
|
+
);
|
|
711
|
+
const defaultEndpoint = existing?.baseUrl ?? API_ENDPOINTS["\uBBFC\uAC04 \uD074\uB77C\uC6B0\uB4DC"];
|
|
712
|
+
const baseUrl = await select({
|
|
713
|
+
message: "API Endpoint\uB97C \uC120\uD0DD\uD558\uC138\uC694",
|
|
714
|
+
choices: endpointChoices,
|
|
715
|
+
default: defaultEndpoint,
|
|
716
|
+
theme: { prefix: "\u{1F310}" }
|
|
717
|
+
});
|
|
718
|
+
let apiKey = "";
|
|
719
|
+
let meName = "";
|
|
720
|
+
let verified = false;
|
|
721
|
+
while (!verified) {
|
|
722
|
+
apiKey = await password({
|
|
723
|
+
message: `API Key\uB97C \uC785\uB825\uD558\uC138\uC694 (\uBC1C\uAE09: https://${tenantName}.dooray.com/setting/api/token)`,
|
|
724
|
+
mask: "*",
|
|
725
|
+
theme: { prefix: "\u{1F511}" }
|
|
726
|
+
});
|
|
727
|
+
if (!apiKey) {
|
|
728
|
+
console.log(import_chalk4.default.red(" \u2717 API Key\uB294 \uD544\uC218\uC785\uB2C8\uB2E4."));
|
|
729
|
+
continue;
|
|
730
|
+
}
|
|
731
|
+
try {
|
|
732
|
+
const client = new DoorayApiClient(apiKey, baseUrl);
|
|
733
|
+
await client.getProjects({ page: 0, size: 1 });
|
|
734
|
+
const me = await ensureMe(client);
|
|
735
|
+
meName = me.name;
|
|
736
|
+
console.log(import_chalk4.default.green(` \u2713 API \uC5F0\uACB0 \uC131\uACF5 (${meName})`));
|
|
737
|
+
verified = true;
|
|
738
|
+
} catch {
|
|
739
|
+
console.log(
|
|
740
|
+
import_chalk4.default.red(" \u2717 \uC5F0\uACB0 \uC2E4\uD328 \u2014 API Key\uB97C \uD655\uC778\uD574\uC8FC\uC138\uC694")
|
|
741
|
+
);
|
|
742
|
+
}
|
|
743
|
+
}
|
|
744
|
+
const useMail = await confirm({
|
|
745
|
+
message: "\uBA54\uC77C \uAE30\uB2A5\uC744 \uC0AC\uC6A9\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?",
|
|
746
|
+
default: !!existing?.imapUsername,
|
|
747
|
+
theme: { prefix: "\u{1F4E7}" }
|
|
748
|
+
});
|
|
749
|
+
let imapUsername;
|
|
750
|
+
let imapPassword;
|
|
751
|
+
if (useMail) {
|
|
752
|
+
imapUsername = await input({
|
|
753
|
+
message: `IMAP \uC0AC\uC6A9\uC790 \uC774\uBA54\uC77C (\uD655\uC778: https://${tenantName}.dooray.com/setting/mail/general/read)`,
|
|
754
|
+
default: existing?.imapUsername,
|
|
755
|
+
theme: { prefix: "\u{1F4E8}" }
|
|
756
|
+
});
|
|
757
|
+
imapPassword = await password({
|
|
758
|
+
message: "IMAP \uBE44\uBC00\uBC88\uD638",
|
|
759
|
+
mask: "*",
|
|
760
|
+
theme: { prefix: "\u{1F512}" }
|
|
761
|
+
});
|
|
762
|
+
}
|
|
763
|
+
const config = {
|
|
764
|
+
version: 1,
|
|
765
|
+
apiKey,
|
|
766
|
+
baseUrl,
|
|
767
|
+
tenantName,
|
|
768
|
+
imapHost: useMail ? DEFAULTS.imapHost : existing?.imapHost,
|
|
769
|
+
imapPort: useMail ? DEFAULTS.imapPort : existing?.imapPort,
|
|
770
|
+
imapUsername: imapUsername ?? existing?.imapUsername,
|
|
771
|
+
imapPassword: imapPassword ?? existing?.imapPassword,
|
|
772
|
+
smtpHost: useMail ? DEFAULTS.smtpHost : existing?.smtpHost,
|
|
773
|
+
smtpPort: useMail ? DEFAULTS.smtpPort : existing?.smtpPort
|
|
774
|
+
};
|
|
775
|
+
await saveConfig(config);
|
|
776
|
+
console.log(
|
|
777
|
+
import_chalk4.default.green(
|
|
778
|
+
"\n\u2713 \uC124\uC815 \uC644\uB8CC. dooray doctor\uB85C \uC0C1\uD0DC\uB97C \uD655\uC778\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4."
|
|
779
|
+
)
|
|
780
|
+
);
|
|
781
|
+
} catch (err) {
|
|
782
|
+
if (err != null && typeof err === "object" && "name" in err && err.name === "ExitPromptError") {
|
|
783
|
+
console.log(import_chalk4.default.yellow("\n\uC124\uC815\uC774 \uCDE8\uC18C\uB418\uC5C8\uC2B5\uB2C8\uB2E4."));
|
|
784
|
+
return;
|
|
785
|
+
}
|
|
786
|
+
throw err;
|
|
787
|
+
}
|
|
788
|
+
});
|
|
789
|
+
|
|
790
|
+
// src/commands/project/list.ts
|
|
791
|
+
var import_commander5 = require("commander");
|
|
677
792
|
|
|
678
793
|
// src/resolvers/project.ts
|
|
679
794
|
async function fetchAllProjects(client) {
|
|
@@ -756,7 +871,7 @@ function stopSpinner(success, text) {
|
|
|
756
871
|
}
|
|
757
872
|
|
|
758
873
|
// src/commands/project/list.ts
|
|
759
|
-
var projectListCommand = new
|
|
874
|
+
var projectListCommand = new import_commander5.Command("list").description("\uD504\uB85C\uC81D\uD2B8 \uBAA9\uB85D \uC870\uD68C").option("-s, --search <keyword>", "code \uD544\uD130\uB9C1").action(async (opts) => {
|
|
760
875
|
const globalOpts = projectListCommand.optsWithGlobals();
|
|
761
876
|
const config = await getConfigOrThrow();
|
|
762
877
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -777,7 +892,7 @@ var projectListCommand = new import_commander4.Command("list").description("\uD5
|
|
|
777
892
|
});
|
|
778
893
|
|
|
779
894
|
// src/commands/project/members.ts
|
|
780
|
-
var
|
|
895
|
+
var import_commander6 = require("commander");
|
|
781
896
|
|
|
782
897
|
// src/resolvers/member.ts
|
|
783
898
|
async function fetchAllMembers(client, projectId) {
|
|
@@ -839,7 +954,7 @@ ${candidates}`,
|
|
|
839
954
|
}
|
|
840
955
|
|
|
841
956
|
// src/commands/project/members.ts
|
|
842
|
-
var projectMembersCommand = new
|
|
957
|
+
var projectMembersCommand = new import_commander6.Command("members").description("\uD504\uB85C\uC81D\uD2B8 \uBA64\uBC84 \uBAA9\uB85D \uC870\uD68C").argument("<project>", "\uD504\uB85C\uC81D\uD2B8 \uCF54\uB4DC \uB610\uB294 ID").action(async (project) => {
|
|
843
958
|
const globalOpts = projectMembersCommand.optsWithGlobals();
|
|
844
959
|
const config = await getConfigOrThrow();
|
|
845
960
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -859,7 +974,7 @@ var projectMembersCommand = new import_commander5.Command("members").description
|
|
|
859
974
|
});
|
|
860
975
|
|
|
861
976
|
// src/commands/project/workflows.ts
|
|
862
|
-
var
|
|
977
|
+
var import_commander7 = require("commander");
|
|
863
978
|
|
|
864
979
|
// src/resolvers/workflow.ts
|
|
865
980
|
async function ensureWorkflows(client, projectId) {
|
|
@@ -888,7 +1003,7 @@ async function resolveWorkflow(client, projectId, input) {
|
|
|
888
1003
|
}
|
|
889
1004
|
|
|
890
1005
|
// src/commands/project/workflows.ts
|
|
891
|
-
var projectWorkflowsCommand = new
|
|
1006
|
+
var projectWorkflowsCommand = new import_commander7.Command("workflows").description("\uD504\uB85C\uC81D\uD2B8 \uC6CC\uD06C\uD50C\uB85C\uC6B0 \uBAA9\uB85D \uC870\uD68C").argument("<project>", "\uD504\uB85C\uC81D\uD2B8 \uCF54\uB4DC \uB610\uB294 ID").action(async (project) => {
|
|
892
1007
|
const globalOpts = projectWorkflowsCommand.optsWithGlobals();
|
|
893
1008
|
const config = await getConfigOrThrow();
|
|
894
1009
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -910,7 +1025,7 @@ var projectWorkflowsCommand = new import_commander6.Command("workflows").descrip
|
|
|
910
1025
|
});
|
|
911
1026
|
|
|
912
1027
|
// src/commands/post/list.ts
|
|
913
|
-
var
|
|
1028
|
+
var import_commander8 = require("commander");
|
|
914
1029
|
|
|
915
1030
|
// src/formatters/post.ts
|
|
916
1031
|
function formatPostList(posts, opts) {
|
|
@@ -961,7 +1076,7 @@ function formatCommentList(comments, opts) {
|
|
|
961
1076
|
}
|
|
962
1077
|
|
|
963
1078
|
// src/commands/post/list.ts
|
|
964
|
-
var postListCommand = new
|
|
1079
|
+
var postListCommand = new import_commander8.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) => {
|
|
965
1080
|
const globalOpts = postListCommand.optsWithGlobals();
|
|
966
1081
|
const config = await getConfigOrThrow();
|
|
967
1082
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -995,8 +1110,8 @@ var postListCommand = new import_commander7.Command("list").description("\uC5C5\
|
|
|
995
1110
|
});
|
|
996
1111
|
|
|
997
1112
|
// src/commands/post/search.ts
|
|
998
|
-
var
|
|
999
|
-
var postSearchCommand = new
|
|
1113
|
+
var import_commander9 = require("commander");
|
|
1114
|
+
var postSearchCommand = new import_commander9.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) => {
|
|
1000
1115
|
const globalOpts = postSearchCommand.optsWithGlobals();
|
|
1001
1116
|
const config = await getConfigOrThrow();
|
|
1002
1117
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -1008,7 +1123,7 @@ var postSearchCommand = new import_commander8.Command("search").description("\uC
|
|
|
1008
1123
|
});
|
|
1009
1124
|
|
|
1010
1125
|
// src/commands/post/get.ts
|
|
1011
|
-
var
|
|
1126
|
+
var import_commander10 = require("commander");
|
|
1012
1127
|
|
|
1013
1128
|
// src/resolvers/post.ts
|
|
1014
1129
|
async function resolvePost(client, projectId, postNumber) {
|
|
@@ -1025,7 +1140,7 @@ async function resolvePost(client, projectId, postNumber) {
|
|
|
1025
1140
|
}
|
|
1026
1141
|
|
|
1027
1142
|
// src/commands/post/get.ts
|
|
1028
|
-
var postGetCommand = new
|
|
1143
|
+
var postGetCommand = new import_commander10.Command("get").description("\uC5C5\uBB34 \uC0C1\uC138 \uC870\uD68C").argument("<project>", "\uD504\uB85C\uC81D\uD2B8 \uCF54\uB4DC \uB610\uB294 ID").argument("<post-number>", "\uC5C5\uBB34 \uBC88\uD638").action(async (project, postNumberStr) => {
|
|
1029
1144
|
const globalOpts = postGetCommand.optsWithGlobals();
|
|
1030
1145
|
const config = await getConfigOrThrow();
|
|
1031
1146
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -1038,7 +1153,7 @@ var postGetCommand = new import_commander9.Command("get").description("\uC5C5\uB
|
|
|
1038
1153
|
});
|
|
1039
1154
|
|
|
1040
1155
|
// src/commands/post/edit.ts
|
|
1041
|
-
var
|
|
1156
|
+
var import_commander11 = require("commander");
|
|
1042
1157
|
var import_promises5 = __toESM(require("fs/promises"));
|
|
1043
1158
|
|
|
1044
1159
|
// src/editor/index.ts
|
|
@@ -1199,7 +1314,7 @@ async function resolveBody(opts) {
|
|
|
1199
1314
|
}
|
|
1200
1315
|
return null;
|
|
1201
1316
|
}
|
|
1202
|
-
var postEditCommand = new
|
|
1317
|
+
var postEditCommand = new import_commander11.Command("edit").description("\uC5C5\uBB34 \uC218\uC815 ($EDITOR \uB610\uB294 --subject/--body \uC635\uC158)").argument("<project>", "\uD504\uB85C\uC81D\uD2B8 \uCF54\uB4DC \uB610\uB294 ID").argument("<post-number>", "\uC5C5\uBB34 \uBC88\uD638").option("--subject <title>", "\uC81C\uBAA9 \uBCC0\uACBD (non-interactive)").option("--body <text>", "\uBCF8\uBB38 \uBCC0\uACBD (- \uC785\uB825 \uC2DC stdin, non-interactive)").option("--body-file <path>", "\uBCF8\uBB38 \uD30C\uC77C \uACBD\uB85C (- \uC785\uB825 \uC2DC stdin, non-interactive)").action(async (project, postNumberStr, opts) => {
|
|
1203
1318
|
const config = await getConfigOrThrow();
|
|
1204
1319
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
1205
1320
|
startSpinner("\uC5C5\uBB34 \uC870\uD68C \uC911...");
|
|
@@ -1263,7 +1378,7 @@ var postEditCommand = new import_commander10.Command("edit").description("\uC5C5
|
|
|
1263
1378
|
});
|
|
1264
1379
|
|
|
1265
1380
|
// src/commands/post/create.ts
|
|
1266
|
-
var
|
|
1381
|
+
var import_commander12 = require("commander");
|
|
1267
1382
|
var import_promises6 = __toESM(require("fs/promises"));
|
|
1268
1383
|
async function readBody(opts) {
|
|
1269
1384
|
if (opts.bodyFile) {
|
|
@@ -1298,7 +1413,7 @@ async function resolveUsers2(client, projectId, inputs) {
|
|
|
1298
1413
|
}
|
|
1299
1414
|
return users;
|
|
1300
1415
|
}
|
|
1301
|
-
var postCreateCommand = new
|
|
1416
|
+
var postCreateCommand = new import_commander12.Command("create").description("\uC5C5\uBB34 \uC0DD\uC131").argument("<project>", "\uD504\uB85C\uC81D\uD2B8 \uCF54\uB4DC \uB610\uB294 ID").requiredOption("--subject <title>", "\uC5C5\uBB34 \uC81C\uBAA9").option("--to <members...>", "\uB2F4\uB2F9\uC790 (\uC774\uB984 \uB610\uB294 \uC774\uBA54\uC77C, \uC5EC\uB7EC \uBA85 \uAC00\uB2A5)").option("--cc <members...>", "\uCC38\uC870\uC790 (\uC774\uB984 \uB610\uB294 \uC774\uBA54\uC77C, \uC5EC\uB7EC \uBA85 \uAC00\uB2A5)").option("--body <text>", "\uBCF8\uBB38 \uD14D\uC2A4\uD2B8 (- \uC785\uB825 \uC2DC stdin\uC5D0\uC11C \uC77D\uAE30)").option("--body-file <path>", "\uBCF8\uBB38 \uD30C\uC77C \uACBD\uB85C (- \uC785\uB825 \uC2DC stdin\uC5D0\uC11C \uC77D\uAE30)").option("--priority <level>", "\uC6B0\uC120\uC21C\uC704 (highest, high, normal, low, lowest)", "normal").option("--due-date <date>", "\uB9C8\uAC10\uC77C (ISO 8601 \uD615\uC2DD)").action(async (project, opts) => {
|
|
1302
1417
|
const globalOpts = postCreateCommand.optsWithGlobals();
|
|
1303
1418
|
const config = await getConfigOrThrow();
|
|
1304
1419
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -1326,8 +1441,8 @@ var postCreateCommand = new import_commander11.Command("create").description("\u
|
|
|
1326
1441
|
});
|
|
1327
1442
|
|
|
1328
1443
|
// src/commands/post/done.ts
|
|
1329
|
-
var
|
|
1330
|
-
var postDoneCommand = new
|
|
1444
|
+
var import_commander13 = require("commander");
|
|
1445
|
+
var postDoneCommand = new import_commander13.Command("done").description("\uC5C5\uBB34 \uC644\uB8CC \uCC98\uB9AC").argument("<project>", "\uD504\uB85C\uC81D\uD2B8 \uCF54\uB4DC \uB610\uB294 ID").argument("<post-number>", "\uC5C5\uBB34 \uBC88\uD638").action(async (project, postNumberStr) => {
|
|
1331
1446
|
const config = await getConfigOrThrow();
|
|
1332
1447
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
1333
1448
|
startSpinner("\uC5C5\uBB34 \uC644\uB8CC \uCC98\uB9AC \uC911...");
|
|
@@ -1340,8 +1455,8 @@ var postDoneCommand = new import_commander12.Command("done").description("\uC5C5
|
|
|
1340
1455
|
});
|
|
1341
1456
|
|
|
1342
1457
|
// src/commands/post/workflow.ts
|
|
1343
|
-
var
|
|
1344
|
-
var postWorkflowCommand = new
|
|
1458
|
+
var import_commander14 = require("commander");
|
|
1459
|
+
var postWorkflowCommand = new import_commander14.Command("workflow").description("\uC5C5\uBB34 \uC6CC\uD06C\uD50C\uB85C\uC6B0 \uBCC0\uACBD").argument("<project>", "\uD504\uB85C\uC81D\uD2B8 \uCF54\uB4DC \uB610\uB294 ID").argument("<post-number>", "\uC5C5\uBB34 \uBC88\uD638").argument("<workflow>", "\uC6CC\uD06C\uD50C\uB85C\uC6B0 \uC774\uB984 \uB610\uB294 \uD074\uB798\uC2A4").action(async (project, postNumberStr, workflow) => {
|
|
1345
1460
|
const config = await getConfigOrThrow();
|
|
1346
1461
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
1347
1462
|
startSpinner("\uC6CC\uD06C\uD50C\uB85C\uC6B0 \uBCC0\uACBD \uC911...");
|
|
@@ -1355,8 +1470,8 @@ var postWorkflowCommand = new import_commander13.Command("workflow").description
|
|
|
1355
1470
|
});
|
|
1356
1471
|
|
|
1357
1472
|
// src/commands/post/comment/list.ts
|
|
1358
|
-
var
|
|
1359
|
-
var commentListCommand = new
|
|
1473
|
+
var import_commander15 = require("commander");
|
|
1474
|
+
var commentListCommand = new import_commander15.Command("list").description("\uB313\uAE00 \uBAA9\uB85D \uC870\uD68C").argument("<project>", "\uD504\uB85C\uC81D\uD2B8 \uCF54\uB4DC \uB610\uB294 ID").argument("<post-number>", "\uC5C5\uBB34 \uBC88\uD638").option("--page <number>", "\uD398\uC774\uC9C0 \uBC88\uD638", "0").option("--size <number>", "\uD398\uC774\uC9C0 \uD06C\uAE30", "20").action(async (project, postNumberStr, opts) => {
|
|
1360
1475
|
const globalOpts = commentListCommand.optsWithGlobals();
|
|
1361
1476
|
const config = await getConfigOrThrow();
|
|
1362
1477
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -1372,7 +1487,7 @@ var commentListCommand = new import_commander14.Command("list").description("\uB
|
|
|
1372
1487
|
});
|
|
1373
1488
|
|
|
1374
1489
|
// src/commands/post/comment/add.ts
|
|
1375
|
-
var
|
|
1490
|
+
var import_commander16 = require("commander");
|
|
1376
1491
|
var import_promises7 = __toESM(require("fs/promises"));
|
|
1377
1492
|
async function readStdin3() {
|
|
1378
1493
|
if (process.stdin.isTTY) {
|
|
@@ -1398,7 +1513,7 @@ async function resolveBody2(opts) {
|
|
|
1398
1513
|
}
|
|
1399
1514
|
return null;
|
|
1400
1515
|
}
|
|
1401
|
-
var commentAddCommand = new
|
|
1516
|
+
var commentAddCommand = new import_commander16.Command("add").description("\uB313\uAE00 \uCD94\uAC00").argument("<project>", "\uD504\uB85C\uC81D\uD2B8 \uCF54\uB4DC \uB610\uB294 ID").argument("<post-number>", "\uC5C5\uBB34 \uBC88\uD638").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)").action(async (project, postNumberStr, opts) => {
|
|
1402
1517
|
const globalOpts = commentAddCommand.optsWithGlobals();
|
|
1403
1518
|
const config = await getConfigOrThrow();
|
|
1404
1519
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -1428,7 +1543,7 @@ var commentAddCommand = new import_commander15.Command("add").description("\uB31
|
|
|
1428
1543
|
});
|
|
1429
1544
|
|
|
1430
1545
|
// src/commands/post/comment/edit.ts
|
|
1431
|
-
var
|
|
1546
|
+
var import_commander17 = require("commander");
|
|
1432
1547
|
var import_promises8 = __toESM(require("fs/promises"));
|
|
1433
1548
|
async function readStdin4() {
|
|
1434
1549
|
if (process.stdin.isTTY) {
|
|
@@ -1454,7 +1569,7 @@ async function resolveBody3(opts) {
|
|
|
1454
1569
|
}
|
|
1455
1570
|
return null;
|
|
1456
1571
|
}
|
|
1457
|
-
var commentEditCommand = new
|
|
1572
|
+
var commentEditCommand = new import_commander17.Command("edit").description("\uB313\uAE00 \uC218\uC815 ($EDITOR \uB610\uB294 --body \uC635\uC158)").argument("<project>", "\uD504\uB85C\uC81D\uD2B8 \uCF54\uB4DC \uB610\uB294 ID").argument("<post-number>", "\uC5C5\uBB34 \uBC88\uD638").argument("<comment-id>", "\uB313\uAE00 ID").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)").action(async (project, postNumberStr, commentId, opts) => {
|
|
1458
1573
|
const config = await getConfigOrThrow();
|
|
1459
1574
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
1460
1575
|
startSpinner("\uB313\uAE00 \uC870\uD68C \uC911...");
|
|
@@ -1487,8 +1602,8 @@ var commentEditCommand = new import_commander16.Command("edit").description("\uB
|
|
|
1487
1602
|
});
|
|
1488
1603
|
|
|
1489
1604
|
// src/commands/post/comment/delete.ts
|
|
1490
|
-
var
|
|
1491
|
-
var commentDeleteCommand = new
|
|
1605
|
+
var import_commander18 = require("commander");
|
|
1606
|
+
var commentDeleteCommand = new import_commander18.Command("delete").description("\uB313\uAE00 \uC0AD\uC81C").argument("<project>", "\uD504\uB85C\uC81D\uD2B8 \uCF54\uB4DC \uB610\uB294 ID").argument("<post-number>", "\uC5C5\uBB34 \uBC88\uD638").argument("<comment-id>", "\uB313\uAE00 ID").action(async (project, postNumberStr, commentId) => {
|
|
1492
1607
|
const config = await getConfigOrThrow();
|
|
1493
1608
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
1494
1609
|
startSpinner("\uB313\uAE00 \uC0AD\uC81C \uC911...");
|
|
@@ -1501,13 +1616,13 @@ var commentDeleteCommand = new import_commander17.Command("delete").description(
|
|
|
1501
1616
|
});
|
|
1502
1617
|
|
|
1503
1618
|
// src/commands/post/file/list.ts
|
|
1504
|
-
var
|
|
1619
|
+
var import_commander19 = require("commander");
|
|
1505
1620
|
function formatSize(bytes) {
|
|
1506
1621
|
if (bytes < 1024) return `${bytes}B`;
|
|
1507
1622
|
if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)}KB`;
|
|
1508
1623
|
return `${(bytes / (1024 * 1024)).toFixed(1)}MB`;
|
|
1509
1624
|
}
|
|
1510
|
-
var fileListCommand = new
|
|
1625
|
+
var fileListCommand = new import_commander19.Command("list").description("\uC5C5\uBB34 \uCCA8\uBD80\uD30C\uC77C \uBAA9\uB85D \uC870\uD68C").argument("<project>", "\uD504\uB85C\uC81D\uD2B8 \uCF54\uB4DC \uB610\uB294 ID").argument("<post-number>", "\uC5C5\uBB34 \uBC88\uD638").action(async (project, postNumberStr) => {
|
|
1511
1626
|
const globalOpts = fileListCommand.optsWithGlobals();
|
|
1512
1627
|
const config = await getConfigOrThrow();
|
|
1513
1628
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -1531,10 +1646,10 @@ var fileListCommand = new import_commander18.Command("list").description("\uC5C5
|
|
|
1531
1646
|
});
|
|
1532
1647
|
|
|
1533
1648
|
// src/commands/post/file/download.ts
|
|
1534
|
-
var
|
|
1649
|
+
var import_commander20 = require("commander");
|
|
1535
1650
|
var import_promises9 = require("fs/promises");
|
|
1536
1651
|
var import_node_path4 = require("path");
|
|
1537
|
-
var fileDownloadCommand = new
|
|
1652
|
+
var fileDownloadCommand = new import_commander20.Command("download").description("\uCCA8\uBD80\uD30C\uC77C \uB2E4\uC6B4\uB85C\uB4DC").argument("<project>", "\uD504\uB85C\uC81D\uD2B8 \uCF54\uB4DC \uB610\uB294 ID").argument("<post-number>", "\uC5C5\uBB34 \uBC88\uD638").argument("<file-id>", "\uD30C\uC77C ID").option("-o, --output <dir>", "\uC800\uC7A5 \uB514\uB809\uD1A0\uB9AC", ".").action(async (project, postNumberStr, fileId, opts) => {
|
|
1538
1653
|
const config = await getConfigOrThrow();
|
|
1539
1654
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
1540
1655
|
startSpinner("\uD30C\uC77C \uB2E4\uC6B4\uB85C\uB4DC \uC911...");
|
|
@@ -1549,10 +1664,10 @@ var fileDownloadCommand = new import_commander19.Command("download").description
|
|
|
1549
1664
|
});
|
|
1550
1665
|
|
|
1551
1666
|
// src/commands/post/file/download-all.ts
|
|
1552
|
-
var
|
|
1667
|
+
var import_commander21 = require("commander");
|
|
1553
1668
|
var import_promises10 = require("fs/promises");
|
|
1554
1669
|
var import_node_path5 = require("path");
|
|
1555
|
-
var fileDownloadAllCommand = new
|
|
1670
|
+
var fileDownloadAllCommand = new import_commander21.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 ID").argument("<post-number>", "\uC5C5\uBB34 \uBC88\uD638").option("-o, --output <dir>", "\uC800\uC7A5 \uB514\uB809\uD1A0\uB9AC", ".").action(async (project, postNumberStr, opts) => {
|
|
1556
1671
|
const config = await getConfigOrThrow();
|
|
1557
1672
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
1558
1673
|
const spinner = startSpinner("\uCCA8\uBD80\uD30C\uC77C \uBAA9\uB85D \uC870\uD68C \uC911...");
|
|
@@ -1581,9 +1696,9 @@ var fileDownloadAllCommand = new import_commander20.Command("download-all").desc
|
|
|
1581
1696
|
});
|
|
1582
1697
|
|
|
1583
1698
|
// src/commands/post/file/upload.ts
|
|
1584
|
-
var
|
|
1699
|
+
var import_commander22 = require("commander");
|
|
1585
1700
|
var import_node_path6 = require("path");
|
|
1586
|
-
var fileUploadCommand = new
|
|
1701
|
+
var fileUploadCommand = new import_commander22.Command("upload").description("\uCCA8\uBD80\uD30C\uC77C \uC5C5\uB85C\uB4DC").argument("<project>", "\uD504\uB85C\uC81D\uD2B8 \uCF54\uB4DC \uB610\uB294 ID").argument("<post-number>", "\uC5C5\uBB34 \uBC88\uD638").argument("<file-path>", "\uC5C5\uB85C\uB4DC\uD560 \uD30C\uC77C \uACBD\uB85C").action(async (project, postNumberStr, filePath) => {
|
|
1587
1702
|
const globalOpts = fileUploadCommand.optsWithGlobals();
|
|
1588
1703
|
const config = await getConfigOrThrow();
|
|
1589
1704
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -1604,8 +1719,8 @@ var fileUploadCommand = new import_commander21.Command("upload").description("\u
|
|
|
1604
1719
|
});
|
|
1605
1720
|
|
|
1606
1721
|
// src/commands/post/file/delete.ts
|
|
1607
|
-
var
|
|
1608
|
-
var fileDeleteCommand = new
|
|
1722
|
+
var import_commander23 = require("commander");
|
|
1723
|
+
var fileDeleteCommand = new import_commander23.Command("delete").description("\uCCA8\uBD80\uD30C\uC77C \uC0AD\uC81C").argument("<project>", "\uD504\uB85C\uC81D\uD2B8 \uCF54\uB4DC \uB610\uB294 ID").argument("<post-number>", "\uC5C5\uBB34 \uBC88\uD638").argument("<file-id>", "\uD30C\uC77C ID").action(async (project, postNumberStr, fileId) => {
|
|
1609
1724
|
const config = await getConfigOrThrow();
|
|
1610
1725
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
1611
1726
|
startSpinner("\uD30C\uC77C \uC0AD\uC81C \uC911...");
|
|
@@ -1618,7 +1733,7 @@ var fileDeleteCommand = new import_commander22.Command("delete").description("\u
|
|
|
1618
1733
|
});
|
|
1619
1734
|
|
|
1620
1735
|
// src/commands/wiki/list.ts
|
|
1621
|
-
var
|
|
1736
|
+
var import_commander24 = require("commander");
|
|
1622
1737
|
|
|
1623
1738
|
// src/formatters/wiki.ts
|
|
1624
1739
|
function formatWikiList(wikis, opts) {
|
|
@@ -1661,7 +1776,7 @@ function formatWikiPageDetail(page, opts) {
|
|
|
1661
1776
|
}
|
|
1662
1777
|
|
|
1663
1778
|
// src/commands/wiki/list.ts
|
|
1664
|
-
var wikiListCommand = new
|
|
1779
|
+
var wikiListCommand = new import_commander24.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) => {
|
|
1665
1780
|
const globalOpts = wikiListCommand.optsWithGlobals();
|
|
1666
1781
|
const config = await getConfigOrThrow();
|
|
1667
1782
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -1675,7 +1790,7 @@ var wikiListCommand = new import_commander23.Command("list").description("\uC704
|
|
|
1675
1790
|
});
|
|
1676
1791
|
|
|
1677
1792
|
// src/commands/wiki/pages.ts
|
|
1678
|
-
var
|
|
1793
|
+
var import_commander25 = require("commander");
|
|
1679
1794
|
|
|
1680
1795
|
// src/resolvers/wiki.ts
|
|
1681
1796
|
async function resolveWiki(client, projectCode) {
|
|
@@ -1694,7 +1809,7 @@ async function resolveWiki(client, projectCode) {
|
|
|
1694
1809
|
}
|
|
1695
1810
|
|
|
1696
1811
|
// src/commands/wiki/pages.ts
|
|
1697
|
-
var wikiPagesCommand = new
|
|
1812
|
+
var wikiPagesCommand = new import_commander25.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) => {
|
|
1698
1813
|
const globalOpts = wikiPagesCommand.optsWithGlobals();
|
|
1699
1814
|
const config = await getConfigOrThrow();
|
|
1700
1815
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -1706,8 +1821,8 @@ var wikiPagesCommand = new import_commander24.Command("pages").description("\uC7
|
|
|
1706
1821
|
});
|
|
1707
1822
|
|
|
1708
1823
|
// src/commands/wiki/page-get.ts
|
|
1709
|
-
var
|
|
1710
|
-
var wikiPageGetCommand = new
|
|
1824
|
+
var import_commander26 = require("commander");
|
|
1825
|
+
var wikiPageGetCommand = new import_commander26.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) => {
|
|
1711
1826
|
const globalOpts = wikiPageGetCommand.optsWithGlobals();
|
|
1712
1827
|
const config = await getConfigOrThrow();
|
|
1713
1828
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -1719,7 +1834,7 @@ var wikiPageGetCommand = new import_commander25.Command("get").description("\uC7
|
|
|
1719
1834
|
});
|
|
1720
1835
|
|
|
1721
1836
|
// src/commands/wiki/page-create.ts
|
|
1722
|
-
var
|
|
1837
|
+
var import_commander27 = require("commander");
|
|
1723
1838
|
var import_promises11 = __toESM(require("fs/promises"));
|
|
1724
1839
|
async function readBody2(opts) {
|
|
1725
1840
|
if (opts.bodyFile) {
|
|
@@ -1746,7 +1861,7 @@ async function readStdin5() {
|
|
|
1746
1861
|
}
|
|
1747
1862
|
return Buffer.concat(chunks).toString("utf-8");
|
|
1748
1863
|
}
|
|
1749
|
-
var wikiPageCreateCommand = new
|
|
1864
|
+
var wikiPageCreateCommand = new import_commander27.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) => {
|
|
1750
1865
|
const globalOpts = wikiPageCreateCommand.optsWithGlobals();
|
|
1751
1866
|
const config = await getConfigOrThrow();
|
|
1752
1867
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -1770,8 +1885,8 @@ var wikiPageCreateCommand = new import_commander26.Command("create").description
|
|
|
1770
1885
|
});
|
|
1771
1886
|
|
|
1772
1887
|
// src/commands/wiki/page-edit.ts
|
|
1773
|
-
var
|
|
1774
|
-
var wikiPageEditCommand = new
|
|
1888
|
+
var import_commander28 = require("commander");
|
|
1889
|
+
var wikiPageEditCommand = new import_commander28.Command("edit").description("\uC704\uD0A4 \uD398\uC774\uC9C0 \uC218\uC815 ($EDITOR)").argument("<project>", "\uD504\uB85C\uC81D\uD2B8 \uCF54\uB4DC \uB610\uB294 ID").argument("<page-id>", "\uD398\uC774\uC9C0 ID").action(async (project, pageId) => {
|
|
1775
1890
|
const config = await getConfigOrThrow();
|
|
1776
1891
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
1777
1892
|
startSpinner("\uC704\uD0A4 \uD398\uC774\uC9C0 \uC870\uD68C \uC911...");
|
|
@@ -1797,7 +1912,7 @@ var wikiPageEditCommand = new import_commander27.Command("edit").description("\u
|
|
|
1797
1912
|
});
|
|
1798
1913
|
|
|
1799
1914
|
// src/commands/mail/list.ts
|
|
1800
|
-
var
|
|
1915
|
+
var import_commander29 = require("commander");
|
|
1801
1916
|
|
|
1802
1917
|
// src/api/imapClient.ts
|
|
1803
1918
|
var import_imapflow = require("imapflow");
|
|
@@ -1904,8 +2019,8 @@ async function getMail(config, uid) {
|
|
|
1904
2019
|
}
|
|
1905
2020
|
|
|
1906
2021
|
// src/commands/mail/list.ts
|
|
1907
|
-
var
|
|
1908
|
-
var mailListCommand = new
|
|
2022
|
+
var import_chalk5 = __toESM(require("chalk"));
|
|
2023
|
+
var mailListCommand = new import_commander29.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) => {
|
|
1909
2024
|
const globalOpts = mailListCommand.optsWithGlobals();
|
|
1910
2025
|
const config = await getConfigOrThrow();
|
|
1911
2026
|
startSpinner("\uBA54\uC77C \uC870\uD68C \uC911...");
|
|
@@ -1919,7 +2034,7 @@ var mailListCommand = new import_commander28.Command("list").description("\uBA54
|
|
|
1919
2034
|
headers: ["UID", "\uC77D\uC74C", "\uB0A0\uC9DC", "\uBCF4\uB0B8\uC0AC\uB78C", "\uC81C\uBAA9"],
|
|
1920
2035
|
rows: mails.map((m) => [
|
|
1921
2036
|
String(m.uid),
|
|
1922
|
-
m.isRead ? "\u2713" :
|
|
2037
|
+
m.isRead ? "\u2713" : import_chalk5.default.red("\u2717"),
|
|
1923
2038
|
m.date ? m.date.toLocaleDateString("ko-KR") : "",
|
|
1924
2039
|
m.from.replace(/<.*>/, "").trim() || m.from,
|
|
1925
2040
|
m.subject
|
|
@@ -1937,9 +2052,9 @@ var mailListCommand = new import_commander28.Command("list").description("\uBA54
|
|
|
1937
2052
|
});
|
|
1938
2053
|
|
|
1939
2054
|
// src/commands/mail/get.ts
|
|
1940
|
-
var
|
|
1941
|
-
var
|
|
1942
|
-
var mailGetCommand = new
|
|
2055
|
+
var import_commander30 = require("commander");
|
|
2056
|
+
var import_chalk6 = __toESM(require("chalk"));
|
|
2057
|
+
var mailGetCommand = new import_commander30.Command("get").description("\uBA54\uC77C \uC0C1\uC138 \uC870\uD68C").argument("<uid>", "\uBA54\uC77C UID").action(async (uid) => {
|
|
1943
2058
|
const globalOpts = mailGetCommand.optsWithGlobals();
|
|
1944
2059
|
const config = await getConfigOrThrow();
|
|
1945
2060
|
startSpinner("\uBA54\uC77C \uC870\uD68C \uC911...");
|
|
@@ -1957,11 +2072,11 @@ var mailGetCommand = new import_commander29.Command("get").description("\uBA54\u
|
|
|
1957
2072
|
});
|
|
1958
2073
|
} else {
|
|
1959
2074
|
process.stdout.write(
|
|
1960
|
-
`${
|
|
1961
|
-
${
|
|
1962
|
-
${
|
|
1963
|
-
${
|
|
1964
|
-
${
|
|
2075
|
+
`${import_chalk6.default.bold("\uC81C\uBAA9:")} ${mail.subject}
|
|
2076
|
+
${import_chalk6.default.bold("\uBCF4\uB0B8\uC0AC\uB78C:")} ${mail.from}
|
|
2077
|
+
${import_chalk6.default.bold("\uBC1B\uB294\uC0AC\uB78C:")} ${mail.to.join(", ")}
|
|
2078
|
+
${import_chalk6.default.bold("\uB0A0\uC9DC:")} ${mail.date?.toLocaleString("ko-KR") ?? ""}
|
|
2079
|
+
${import_chalk6.default.bold("\uC77D\uC74C:")} ${mail.isRead ? "\uC608" : "\uC544\uB2C8\uC624"}
|
|
1965
2080
|
|
|
1966
2081
|
${mail.body}
|
|
1967
2082
|
`
|
|
@@ -1970,7 +2085,7 @@ ${mail.body}
|
|
|
1970
2085
|
});
|
|
1971
2086
|
|
|
1972
2087
|
// src/commands/mail/send.ts
|
|
1973
|
-
var
|
|
2088
|
+
var import_commander31 = require("commander");
|
|
1974
2089
|
var import_promises12 = require("fs/promises");
|
|
1975
2090
|
|
|
1976
2091
|
// src/api/smtpClient.ts
|
|
@@ -2020,7 +2135,7 @@ async function sendMail(config, opts) {
|
|
|
2020
2135
|
}
|
|
2021
2136
|
|
|
2022
2137
|
// src/commands/mail/send.ts
|
|
2023
|
-
var mailSendCommand = new
|
|
2138
|
+
var mailSendCommand = new import_commander31.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) => {
|
|
2024
2139
|
const globalOpts = mailSendCommand.optsWithGlobals();
|
|
2025
2140
|
const config = await getConfigOrThrow();
|
|
2026
2141
|
let body = opts.body ?? "";
|
|
@@ -2055,7 +2170,7 @@ var mailSendCommand = new import_commander30.Command("send").description("\uBA54
|
|
|
2055
2170
|
});
|
|
2056
2171
|
|
|
2057
2172
|
// src/commands/mail/reply.ts
|
|
2058
|
-
var
|
|
2173
|
+
var import_commander32 = require("commander");
|
|
2059
2174
|
var import_promises13 = require("fs/promises");
|
|
2060
2175
|
var import_imapflow2 = require("imapflow");
|
|
2061
2176
|
async function getMessageId(config, uid) {
|
|
@@ -2083,7 +2198,7 @@ async function getMessageId(config, uid) {
|
|
|
2083
2198
|
await client.logout();
|
|
2084
2199
|
}
|
|
2085
2200
|
}
|
|
2086
|
-
var mailReplyCommand = new
|
|
2201
|
+
var mailReplyCommand = new import_commander32.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) => {
|
|
2087
2202
|
const globalOpts = mailReplyCommand.optsWithGlobals();
|
|
2088
2203
|
const config = await getConfigOrThrow();
|
|
2089
2204
|
let body = opts.body ?? "";
|
|
@@ -2124,19 +2239,19 @@ var mailReplyCommand = new import_commander31.Command("reply").description("\uBA
|
|
|
2124
2239
|
});
|
|
2125
2240
|
|
|
2126
2241
|
// src/index.ts
|
|
2127
|
-
var program = new
|
|
2128
|
-
program.name("dooray").description("Dooray REST API CLI").version("0.
|
|
2242
|
+
var program = new import_commander33.Command();
|
|
2243
|
+
program.name("dooray").description("Dooray REST API CLI").version("0.4.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");
|
|
2129
2244
|
program.hook("preAction", () => {
|
|
2130
2245
|
const opts = program.opts();
|
|
2131
2246
|
if (opts.color === false || process.env.NO_COLOR) {
|
|
2132
|
-
|
|
2247
|
+
import_chalk7.default.level = 0;
|
|
2133
2248
|
}
|
|
2134
2249
|
});
|
|
2135
|
-
var projectCommand = new
|
|
2250
|
+
var projectCommand = new import_commander33.Command("project").description("\uD504\uB85C\uC81D\uD2B8 \uAD00\uB828 \uBA85\uB839");
|
|
2136
2251
|
projectCommand.addCommand(projectListCommand);
|
|
2137
2252
|
projectCommand.addCommand(projectMembersCommand);
|
|
2138
2253
|
projectCommand.addCommand(projectWorkflowsCommand);
|
|
2139
|
-
var postCommand = new
|
|
2254
|
+
var postCommand = new import_commander33.Command("post").description("\uC5C5\uBB34 \uAD00\uB828 \uBA85\uB839");
|
|
2140
2255
|
postCommand.addCommand(postListCommand);
|
|
2141
2256
|
postCommand.addCommand(postSearchCommand);
|
|
2142
2257
|
postCommand.addCommand(postGetCommand);
|
|
@@ -2144,32 +2259,33 @@ postCommand.addCommand(postEditCommand);
|
|
|
2144
2259
|
postCommand.addCommand(postCreateCommand);
|
|
2145
2260
|
postCommand.addCommand(postDoneCommand);
|
|
2146
2261
|
postCommand.addCommand(postWorkflowCommand);
|
|
2147
|
-
var commentCommand = new
|
|
2262
|
+
var commentCommand = new import_commander33.Command("comment").description("\uB313\uAE00 \uAD00\uB828 \uBA85\uB839");
|
|
2148
2263
|
commentCommand.addCommand(commentListCommand);
|
|
2149
2264
|
commentCommand.addCommand(commentAddCommand);
|
|
2150
2265
|
commentCommand.addCommand(commentEditCommand);
|
|
2151
2266
|
commentCommand.addCommand(commentDeleteCommand);
|
|
2152
2267
|
postCommand.addCommand(commentCommand);
|
|
2153
|
-
var fileCommand = new
|
|
2268
|
+
var fileCommand = new import_commander33.Command("file").description("\uCCA8\uBD80\uD30C\uC77C \uAD00\uB828 \uBA85\uB839");
|
|
2154
2269
|
fileCommand.addCommand(fileListCommand);
|
|
2155
2270
|
fileCommand.addCommand(fileDownloadCommand);
|
|
2156
2271
|
fileCommand.addCommand(fileDownloadAllCommand);
|
|
2157
2272
|
fileCommand.addCommand(fileUploadCommand);
|
|
2158
2273
|
fileCommand.addCommand(fileDeleteCommand);
|
|
2159
2274
|
postCommand.addCommand(fileCommand);
|
|
2160
|
-
var wikiCommand = new
|
|
2275
|
+
var wikiCommand = new import_commander33.Command("wiki").description("\uC704\uD0A4 \uAD00\uB828 \uBA85\uB839");
|
|
2161
2276
|
wikiCommand.addCommand(wikiListCommand);
|
|
2162
2277
|
wikiCommand.addCommand(wikiPagesCommand);
|
|
2163
|
-
var wikiPageCommand = new
|
|
2278
|
+
var wikiPageCommand = new import_commander33.Command("page").description("\uC704\uD0A4 \uD398\uC774\uC9C0 \uAD00\uB828 \uBA85\uB839");
|
|
2164
2279
|
wikiPageCommand.addCommand(wikiPageGetCommand);
|
|
2165
2280
|
wikiPageCommand.addCommand(wikiPageCreateCommand);
|
|
2166
2281
|
wikiPageCommand.addCommand(wikiPageEditCommand);
|
|
2167
2282
|
wikiCommand.addCommand(wikiPageCommand);
|
|
2168
|
-
var mailCommand = new
|
|
2283
|
+
var mailCommand = new import_commander33.Command("mail").description("\uBA54\uC77C \uAD00\uB828 \uBA85\uB839");
|
|
2169
2284
|
mailCommand.addCommand(mailListCommand);
|
|
2170
2285
|
mailCommand.addCommand(mailGetCommand);
|
|
2171
2286
|
mailCommand.addCommand(mailSendCommand);
|
|
2172
2287
|
mailCommand.addCommand(mailReplyCommand);
|
|
2288
|
+
program.addCommand(setupCommand);
|
|
2173
2289
|
program.addCommand(configCommand);
|
|
2174
2290
|
program.addCommand(cacheCommand);
|
|
2175
2291
|
program.addCommand(doctorCommand);
|
|
@@ -2179,9 +2295,9 @@ program.addCommand(wikiCommand);
|
|
|
2179
2295
|
program.addCommand(mailCommand);
|
|
2180
2296
|
program.parseAsync().catch((err) => {
|
|
2181
2297
|
if (err instanceof DoorayCliError) {
|
|
2182
|
-
process.stderr.write(
|
|
2298
|
+
process.stderr.write(import_chalk7.default.red(`\uC624\uB958: ${err.message}`) + "\n");
|
|
2183
2299
|
process.exit(err.exitCode);
|
|
2184
2300
|
}
|
|
2185
|
-
process.stderr.write(
|
|
2301
|
+
process.stderr.write(import_chalk7.default.red(`\uC624\uB958: ${err.message}`) + "\n");
|
|
2186
2302
|
process.exit(1);
|
|
2187
2303
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bifos/dooray-cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "CLI tool for Dooray project management — AI agent & terminal friendly",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"dooray",
|
|
@@ -33,6 +33,7 @@
|
|
|
33
33
|
},
|
|
34
34
|
"license": "MIT",
|
|
35
35
|
"dependencies": {
|
|
36
|
+
"@inquirer/prompts": "^8.3.2",
|
|
36
37
|
"chalk": "^5.6.2",
|
|
37
38
|
"cli-table3": "^0.6.5",
|
|
38
39
|
"commander": "^14.0.3",
|