@bifos/dooray-cli 0.17.0 → 0.19.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 +85 -3
- package/dist/index.js +1137 -365
- package/package.json +5 -2
- package/skills/dooray-cli/SKILL.md +14 -5
- package/skills/dooray-cli/references/common.md +19 -1
- package/skills/dooray-cli/references/mention-link.md +30 -1
- package/skills/dooray-cli/references/post.md +18 -2
- package/skills/dooray-cli/references/wiki.md +78 -7
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_commander71 = require("commander");
|
|
28
28
|
var import_chalk9 = __toESM(require("chalk"));
|
|
29
29
|
|
|
30
30
|
// src/commands/config.ts
|
|
@@ -51,6 +51,7 @@ var EXIT_API_ERROR = 1;
|
|
|
51
51
|
var EXIT_AUTH_ERROR = 2;
|
|
52
52
|
var EXIT_PARAM_ERROR = 3;
|
|
53
53
|
var EXIT_CONFIG_ERROR = 4;
|
|
54
|
+
var EXIT_IO_ERROR = 5;
|
|
54
55
|
|
|
55
56
|
// src/config/types.ts
|
|
56
57
|
var API_ENDPOINTS = {
|
|
@@ -74,27 +75,96 @@ var CONFIG_PATH = (0, import_node_path.join)(DOORAY_DIR, "config.json");
|
|
|
74
75
|
async function ensureDir() {
|
|
75
76
|
await (0, import_promises.mkdir)(DOORAY_DIR, { recursive: true });
|
|
76
77
|
}
|
|
78
|
+
function reasonOf(err) {
|
|
79
|
+
return err instanceof Error ? err.message : String(err);
|
|
80
|
+
}
|
|
81
|
+
function isNodeError(err) {
|
|
82
|
+
return err instanceof Error && "code" in err;
|
|
83
|
+
}
|
|
84
|
+
function invalidConfigReason(value) {
|
|
85
|
+
if (value === null || typeof value !== "object" || Array.isArray(value)) {
|
|
86
|
+
return "\uC124\uC815 \uD30C\uC77C\uC740 \uAC1D\uCCB4\uC5EC\uC57C \uD569\uB2C8\uB2E4.";
|
|
87
|
+
}
|
|
88
|
+
const config = value;
|
|
89
|
+
if (config.version !== 1) return "version \uD544\uB4DC\uB294 1\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4.";
|
|
90
|
+
if (typeof config.apiKey !== "string") {
|
|
91
|
+
return "apiKey \uD544\uB4DC\uB294 \uBB38\uC790\uC5F4\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4.";
|
|
92
|
+
}
|
|
93
|
+
if (typeof config.baseUrl !== "string") {
|
|
94
|
+
return "baseUrl \uD544\uB4DC\uB294 \uBB38\uC790\uC5F4\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4.";
|
|
95
|
+
}
|
|
96
|
+
const optionalStringFields = [
|
|
97
|
+
"tenantName",
|
|
98
|
+
"imapHost",
|
|
99
|
+
"imapUsername",
|
|
100
|
+
"imapPassword",
|
|
101
|
+
"smtpHost"
|
|
102
|
+
];
|
|
103
|
+
for (const field of optionalStringFields) {
|
|
104
|
+
if (config[field] !== void 0 && typeof config[field] !== "string") {
|
|
105
|
+
return `${field} \uD544\uB4DC\uB294 \uBB38\uC790\uC5F4\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4.`;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
for (const field of ["imapPort", "smtpPort"]) {
|
|
109
|
+
if (config[field] !== void 0 && typeof config[field] !== "number") {
|
|
110
|
+
return `${field} \uD544\uB4DC\uB294 \uC22B\uC790\uC5EC\uC57C \uD569\uB2C8\uB2E4.`;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
if (config.trackLastRun !== void 0 && typeof config.trackLastRun !== "boolean") {
|
|
114
|
+
return "trackLastRun \uD544\uB4DC\uB294 boolean\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4.";
|
|
115
|
+
}
|
|
116
|
+
return null;
|
|
117
|
+
}
|
|
118
|
+
function isConfig(value) {
|
|
119
|
+
return invalidConfigReason(value) === null;
|
|
120
|
+
}
|
|
121
|
+
function configReadErrorMessage(result) {
|
|
122
|
+
if (result.state === "invalid") {
|
|
123
|
+
return `\uC124\uC815 \uD30C\uC77C\uC774 \uC190\uC0C1\uB418\uC5C8\uC2B5\uB2C8\uB2E4: ${CONFIG_PATH}
|
|
124
|
+
\uC774\uC720: ${result.reason}`;
|
|
125
|
+
}
|
|
126
|
+
return `\uC124\uC815 \uD30C\uC77C\uC744 \uC77D\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4: ${CONFIG_PATH}
|
|
127
|
+
\uC774\uC720: ${result.reason}
|
|
128
|
+
\uD30C\uC77C \uAD8C\uD55C\uC744 \uD655\uC778\uD558\uC138\uC694.`;
|
|
129
|
+
}
|
|
77
130
|
async function getConfig() {
|
|
78
131
|
try {
|
|
79
132
|
const raw = await (0, import_promises.readFile)(CONFIG_PATH, "utf-8");
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
133
|
+
try {
|
|
134
|
+
const parsed = JSON.parse(raw);
|
|
135
|
+
if (!isConfig(parsed)) {
|
|
136
|
+
const invalidReason = invalidConfigReason(parsed) ?? "\uC124\uC815 \uD30C\uC77C \uD615\uC2DD\uC774 \uC62C\uBC14\uB974\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.";
|
|
137
|
+
return { state: "invalid", reason: invalidReason };
|
|
138
|
+
}
|
|
139
|
+
return { state: "ok", config: parsed };
|
|
140
|
+
} catch (err) {
|
|
141
|
+
return { state: "invalid", reason: reasonOf(err) };
|
|
142
|
+
}
|
|
143
|
+
} catch (err) {
|
|
144
|
+
if (isNodeError(err) && err.code === "ENOENT") return { state: "absent" };
|
|
145
|
+
return { state: "unreadable", reason: reasonOf(err) };
|
|
83
146
|
}
|
|
84
147
|
}
|
|
85
148
|
async function getConfigOrThrow() {
|
|
86
|
-
const
|
|
87
|
-
if (
|
|
149
|
+
const result = await getConfig();
|
|
150
|
+
if (result.state === "invalid" || result.state === "unreadable") {
|
|
151
|
+
throw new DoorayCliError(configReadErrorMessage(result), EXIT_CONFIG_ERROR);
|
|
152
|
+
}
|
|
153
|
+
if (result.state === "absent" || !result.config.apiKey || !result.config.baseUrl) {
|
|
88
154
|
throw new DoorayCliError(
|
|
89
155
|
"\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",
|
|
90
156
|
EXIT_CONFIG_ERROR
|
|
91
157
|
);
|
|
92
158
|
}
|
|
93
|
-
return config;
|
|
159
|
+
return result.config;
|
|
94
160
|
}
|
|
95
161
|
async function setConfigValue(key, value) {
|
|
96
162
|
await ensureDir();
|
|
97
|
-
const
|
|
163
|
+
const result = await getConfig();
|
|
164
|
+
if (result.state === "invalid" || result.state === "unreadable") {
|
|
165
|
+
throw new DoorayCliError(configReadErrorMessage(result), EXIT_CONFIG_ERROR);
|
|
166
|
+
}
|
|
167
|
+
const config = result.state === "ok" ? result.config : {
|
|
98
168
|
version: 1,
|
|
99
169
|
apiKey: "",
|
|
100
170
|
baseUrl: DEFAULTS.baseUrl
|
|
@@ -150,59 +220,15 @@ function removeMailCredentials(config) {
|
|
|
150
220
|
return next;
|
|
151
221
|
}
|
|
152
222
|
async function clearMailCredentials() {
|
|
153
|
-
const
|
|
154
|
-
if (
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
return hadCredentials;
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
// src/commands/config.ts
|
|
161
|
-
function maskApiKey(key) {
|
|
162
|
-
if (key.length <= 8) return "****";
|
|
163
|
-
return key.slice(0, 4) + "****" + key.slice(-4);
|
|
164
|
-
}
|
|
165
|
-
var configCommand = new import_commander.Command("config").description("CLI \uC124\uC815 \uAD00\uB9AC");
|
|
166
|
-
configCommand.command("set").description("\uC124\uC815 \uAC12 \uC800\uC7A5").argument("<key>", "\uC124\uC815 \uD0A4 (api-key, base-url)").argument("<value>", "\uC124\uC815 \uAC12").action(async (key, value) => {
|
|
167
|
-
try {
|
|
168
|
-
await setConfigValue(key, value);
|
|
169
|
-
console.log(import_chalk.default.green(`\u2713 ${key} \uC124\uC815 \uC644\uB8CC`));
|
|
170
|
-
} catch (err) {
|
|
171
|
-
if (err instanceof DoorayCliError) {
|
|
172
|
-
console.error(import_chalk.default.red(err.message));
|
|
173
|
-
process.exit(err.exitCode);
|
|
174
|
-
}
|
|
175
|
-
throw err;
|
|
176
|
-
}
|
|
177
|
-
});
|
|
178
|
-
configCommand.command("get").description("\uC124\uC815 \uAC12 \uC870\uD68C").argument("[key]", "\uC124\uC815 \uD0A4 (\uC0DD\uB7B5 \uC2DC \uC804\uCCB4 \uCD9C\uB825)").action(async (key) => {
|
|
179
|
-
const config = await getConfig();
|
|
180
|
-
if (!config) {
|
|
181
|
-
console.error(import_chalk.default.red("\uC124\uC815 \uD30C\uC77C\uC774 \uC5C6\uC2B5\uB2C8\uB2E4. dooray config set \uC73C\uB85C \uC124\uC815\uD558\uC138\uC694."));
|
|
182
|
-
process.exit(EXIT_CONFIG_ERROR);
|
|
183
|
-
}
|
|
184
|
-
const display = {
|
|
185
|
-
"api-key": config.apiKey ? maskApiKey(config.apiKey) : "(\uBBF8\uC124\uC815)",
|
|
186
|
-
"base-url": config.baseUrl || "(\uBBF8\uC124\uC815)"
|
|
187
|
-
};
|
|
188
|
-
if (key) {
|
|
189
|
-
const val = display[key];
|
|
190
|
-
if (val === void 0) {
|
|
191
|
-
console.error(import_chalk.default.red(`\uC54C \uC218 \uC5C6\uB294 \uC124\uC815 \uD0A4: ${key}
|
|
192
|
-
\uC0AC\uC6A9 \uAC00\uB2A5\uD55C \uD0A4: api-key, base-url`));
|
|
193
|
-
process.exit(EXIT_CONFIG_ERROR);
|
|
194
|
-
}
|
|
195
|
-
console.log(`${key}: ${val}`);
|
|
196
|
-
} else {
|
|
197
|
-
for (const [k, v] of Object.entries(display)) {
|
|
198
|
-
console.log(`${k}: ${v}`);
|
|
199
|
-
}
|
|
223
|
+
const result = await getConfig();
|
|
224
|
+
if (result.state === "absent") return { state: "absent" };
|
|
225
|
+
if (result.state === "invalid" || result.state === "unreadable") {
|
|
226
|
+
return { state: "failed", reason: configReadErrorMessage(result) };
|
|
200
227
|
}
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
var import_chalk2 = __toESM(require("chalk"));
|
|
228
|
+
const hadCredentials = !!(result.config.imapUsername || result.config.imapPassword);
|
|
229
|
+
await saveConfig(removeMailCredentials(result.config));
|
|
230
|
+
return { state: "cleared", hadCredentials };
|
|
231
|
+
}
|
|
206
232
|
|
|
207
233
|
// src/cache/store.ts
|
|
208
234
|
var import_promises2 = require("fs/promises");
|
|
@@ -287,6 +313,9 @@ async function getTags(projectId) {
|
|
|
287
313
|
async function setTags(projectId, items) {
|
|
288
314
|
await writeJson(tagsPath(projectId), { updatedAt: now(), data: items });
|
|
289
315
|
}
|
|
316
|
+
async function clearTags(projectId) {
|
|
317
|
+
await (0, import_promises2.rm)(tagsPath(projectId), { force: true });
|
|
318
|
+
}
|
|
290
319
|
function milestonesPath(projectId) {
|
|
291
320
|
return (0, import_node_path2.join)(MILESTONES_DIR, `${projectId}.json`);
|
|
292
321
|
}
|
|
@@ -321,9 +350,17 @@ async function setWikis(items) {
|
|
|
321
350
|
await writeJson(WIKIS_PATH, { updatedAt: now(), data: items });
|
|
322
351
|
}
|
|
323
352
|
async function clearCache() {
|
|
353
|
+
const existed = await cacheDirExists();
|
|
354
|
+
await (0, import_promises2.rm)(CACHE_DIR, { recursive: true, force: true });
|
|
355
|
+
return existed;
|
|
356
|
+
}
|
|
357
|
+
async function cacheDirExists() {
|
|
324
358
|
try {
|
|
325
|
-
await (0, import_promises2.
|
|
326
|
-
|
|
359
|
+
await (0, import_promises2.stat)(CACHE_DIR);
|
|
360
|
+
return true;
|
|
361
|
+
} catch (e) {
|
|
362
|
+
if (e.code === "ENOENT") return false;
|
|
363
|
+
throw e;
|
|
327
364
|
}
|
|
328
365
|
}
|
|
329
366
|
async function getCacheStats() {
|
|
@@ -363,29 +400,208 @@ async function getCacheStats() {
|
|
|
363
400
|
return { projectCount, memberProjectCount, workflowProjectCount, tagProjectCount, milestoneProjectCount, memberGroupProjectCount, me: me?.data ?? null };
|
|
364
401
|
}
|
|
365
402
|
|
|
403
|
+
// src/services/config.ts
|
|
404
|
+
function shouldInvalidateCache(prev, next) {
|
|
405
|
+
if (prev === null) return false;
|
|
406
|
+
return prev.apiKey !== next.apiKey || prev.baseUrl !== next.baseUrl;
|
|
407
|
+
}
|
|
408
|
+
async function invalidateAllCache() {
|
|
409
|
+
try {
|
|
410
|
+
return await clearCache();
|
|
411
|
+
} catch (e) {
|
|
412
|
+
const msg = e instanceof Error ? e.message : String(e);
|
|
413
|
+
process.stderr.write(
|
|
414
|
+
`\u26A0 \uCE90\uC2DC \uC0AD\uC81C \uC2E4\uD328 (\uC124\uC815 \uBCC0\uACBD\uC740 \uBC18\uC601\uB428): ${msg}
|
|
415
|
+
\uC774\uC804 \uACC4\uC815\xB7\uD658\uACBD\uC758 \uB370\uC774\uD130\uAC00 \uB0A8\uC544 \uC788\uC744 \uC218 \uC788\uC2B5\uB2C8\uB2E4: dooray cache clear
|
|
416
|
+
`
|
|
417
|
+
);
|
|
418
|
+
return false;
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
async function invalidateCacheForUnknownPreviousConfig(prev) {
|
|
422
|
+
process.stderr.write(
|
|
423
|
+
`\u26A0 \uC774\uC804 \uC124\uC815\uC744 \uC77D\uC9C0 \uBABB\uD574 \uCE90\uC2DC\uB97C \uBE44\uC6C1\uB2C8\uB2E4: ${prev.reason}
|
|
424
|
+
\uC774\uC804 \uACC4\uC815\xB7\uD658\uACBD\uC758 \uB370\uC774\uD130\uAC00 \uB0A8\uC544 \uC788\uC744 \uC218 \uC788\uC2B5\uB2C8\uB2E4.
|
|
425
|
+
`
|
|
426
|
+
);
|
|
427
|
+
return invalidateAllCache();
|
|
428
|
+
}
|
|
429
|
+
async function updateConfigValue(key, value) {
|
|
430
|
+
const prev = await getConfig();
|
|
431
|
+
await setConfigValue(key, value);
|
|
432
|
+
const next = await getConfig();
|
|
433
|
+
if (next.state !== "ok") {
|
|
434
|
+
process.stderr.write(
|
|
435
|
+
"\u26A0 \uC800\uC7A5\uD55C \uC124\uC815\uC744 \uB418\uC77D\uC9C0 \uBABB\uD574 \uCE90\uC2DC \uBB34\uD6A8\uD654 \uD310\uC815\uC744 \uAC74\uB108\uB701\uB2C8\uB2E4.\n \uC774\uC804 \uACC4\uC815\xB7\uD658\uACBD\uC758 \uB370\uC774\uD130\uAC00 \uB0A8\uC544 \uC788\uC744 \uC218 \uC788\uC2B5\uB2C8\uB2E4: dooray cache clear\n"
|
|
436
|
+
);
|
|
437
|
+
return { cacheCleared: false };
|
|
438
|
+
}
|
|
439
|
+
if (prev.state === "absent") return { cacheCleared: false };
|
|
440
|
+
if (prev.state === "invalid" || prev.state === "unreadable") {
|
|
441
|
+
return {
|
|
442
|
+
cacheCleared: await invalidateCacheForUnknownPreviousConfig(prev)
|
|
443
|
+
};
|
|
444
|
+
}
|
|
445
|
+
if (!shouldInvalidateCache(prev.config, next.config)) {
|
|
446
|
+
return { cacheCleared: false };
|
|
447
|
+
}
|
|
448
|
+
return { cacheCleared: await invalidateAllCache() };
|
|
449
|
+
}
|
|
450
|
+
async function replaceConfig(next) {
|
|
451
|
+
const prev = await getConfig();
|
|
452
|
+
await saveConfig(next);
|
|
453
|
+
if (prev.state === "absent") return { cacheCleared: false };
|
|
454
|
+
if (prev.state === "invalid" || prev.state === "unreadable") {
|
|
455
|
+
return {
|
|
456
|
+
cacheCleared: await invalidateCacheForUnknownPreviousConfig(prev)
|
|
457
|
+
};
|
|
458
|
+
}
|
|
459
|
+
if (!shouldInvalidateCache(prev.config, next)) return { cacheCleared: false };
|
|
460
|
+
return { cacheCleared: await invalidateAllCache() };
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
// src/utils/body-input.ts
|
|
464
|
+
var import_promises3 = require("fs/promises");
|
|
465
|
+
async function readBodyInput(opts) {
|
|
466
|
+
if (opts.body != null && opts.bodyFile != null) {
|
|
467
|
+
throw new DoorayCliError(
|
|
468
|
+
"--body\uC640 --body-file\uC740 \uD568\uAED8 \uC0AC\uC6A9\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.",
|
|
469
|
+
EXIT_PARAM_ERROR
|
|
470
|
+
);
|
|
471
|
+
}
|
|
472
|
+
if (opts.bodyFile) {
|
|
473
|
+
if (opts.bodyFile === "-") return readStdin();
|
|
474
|
+
return (0, import_promises3.readFile)(opts.bodyFile, "utf-8");
|
|
475
|
+
}
|
|
476
|
+
if (opts.body === "-") return readStdin();
|
|
477
|
+
return opts.body ?? "";
|
|
478
|
+
}
|
|
479
|
+
async function readBodyInputOrNull(opts) {
|
|
480
|
+
if (opts.body == null && opts.bodyFile == null) return null;
|
|
481
|
+
return readBodyInput(opts);
|
|
482
|
+
}
|
|
483
|
+
async function readStdin() {
|
|
484
|
+
if (process.stdin.isTTY) {
|
|
485
|
+
throw new DoorayCliError(
|
|
486
|
+
"stdin\uC5D0\uC11C \uC77D\uC73C\uB824\uBA74 \uD30C\uC774\uD504\uB85C \uB370\uC774\uD130\uB97C \uC804\uB2EC\uD574\uC8FC\uC138\uC694.",
|
|
487
|
+
EXIT_PARAM_ERROR
|
|
488
|
+
);
|
|
489
|
+
}
|
|
490
|
+
const chunks = [];
|
|
491
|
+
for await (const chunk of process.stdin) {
|
|
492
|
+
chunks.push(chunk);
|
|
493
|
+
}
|
|
494
|
+
return Buffer.concat(chunks).toString("utf-8");
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
// src/utils/config-value.ts
|
|
498
|
+
async function resolveConfigValue(raw, read = readStdin) {
|
|
499
|
+
if (raw !== "-") return raw;
|
|
500
|
+
const value = (await read()).trim();
|
|
501
|
+
if (value === "") {
|
|
502
|
+
throw new DoorayCliError(
|
|
503
|
+
"stdin \uC73C\uB85C \uBC1B\uC740 \uAC12\uC774 \uBE44\uC5B4 \uC788\uC2B5\uB2C8\uB2E4.",
|
|
504
|
+
EXIT_PARAM_ERROR
|
|
505
|
+
);
|
|
506
|
+
}
|
|
507
|
+
return value;
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
// src/commands/config.ts
|
|
511
|
+
function cacheClearedNotice(key) {
|
|
512
|
+
const reason = key === "api-key" ? "\uACC4\uC815\uC774 \uBC14\uB00C\uC5C8\uC744 \uC218 \uC788\uC5B4" : "\uC811\uC18D \uD658\uACBD\uC774 \uBC14\uB00C\uC5C8\uC744 \uC218 \uC788\uC5B4";
|
|
513
|
+
return ` ${reason} \uCE90\uC2DC\uB97C \uBE44\uC6E0\uC2B5\uB2C8\uB2E4. \uB2E4\uC74C \uC870\uD68C\uAC00 API \uB97C \uB2E4\uC2DC \uD638\uCD9C\uD569\uB2C8\uB2E4.`;
|
|
514
|
+
}
|
|
515
|
+
function maskApiKey(key) {
|
|
516
|
+
if (key.length <= 8) return "****";
|
|
517
|
+
return key.slice(0, 4) + "****" + key.slice(-4);
|
|
518
|
+
}
|
|
519
|
+
var configCommand = new import_commander.Command("config").description("CLI \uC124\uC815 \uAD00\uB9AC");
|
|
520
|
+
configCommand.command("set").description("\uC124\uC815 \uAC12 \uC800\uC7A5").argument("<key>", "\uC124\uC815 \uD0A4 (api-key, base-url)").argument("<value>", "\uC124\uC815 \uAC12 (`-` \uC774\uBA74 stdin \uC5D0\uC11C \uC77D\uC74C)").action(async (key, value) => {
|
|
521
|
+
try {
|
|
522
|
+
const { cacheCleared } = await updateConfigValue(
|
|
523
|
+
key,
|
|
524
|
+
await resolveConfigValue(value)
|
|
525
|
+
);
|
|
526
|
+
console.log(import_chalk.default.green(`\u2713 ${key} \uC124\uC815 \uC644\uB8CC`));
|
|
527
|
+
if (cacheCleared) console.log(import_chalk.default.gray(cacheClearedNotice(key)));
|
|
528
|
+
} catch (err) {
|
|
529
|
+
if (err instanceof DoorayCliError) {
|
|
530
|
+
console.error(import_chalk.default.red(err.message));
|
|
531
|
+
process.exit(err.exitCode);
|
|
532
|
+
}
|
|
533
|
+
throw err;
|
|
534
|
+
}
|
|
535
|
+
});
|
|
536
|
+
configCommand.command("get").description("\uC124\uC815 \uAC12 \uC870\uD68C").argument("[key]", "\uC124\uC815 \uD0A4 (\uC0DD\uB7B5 \uC2DC \uC804\uCCB4 \uCD9C\uB825)").action(async (key) => {
|
|
537
|
+
const result = await getConfig();
|
|
538
|
+
if (result.state !== "ok") {
|
|
539
|
+
console.error(import_chalk.default.red("\uC124\uC815 \uD30C\uC77C\uC774 \uC5C6\uC2B5\uB2C8\uB2E4. dooray config set \uC73C\uB85C \uC124\uC815\uD558\uC138\uC694."));
|
|
540
|
+
process.exit(EXIT_CONFIG_ERROR);
|
|
541
|
+
}
|
|
542
|
+
const config = result.config;
|
|
543
|
+
const display = {
|
|
544
|
+
"api-key": config.apiKey ? maskApiKey(config.apiKey) : "(\uBBF8\uC124\uC815)",
|
|
545
|
+
"base-url": config.baseUrl || "(\uBBF8\uC124\uC815)"
|
|
546
|
+
};
|
|
547
|
+
if (key) {
|
|
548
|
+
const val = display[key];
|
|
549
|
+
if (val === void 0) {
|
|
550
|
+
console.error(import_chalk.default.red(`\uC54C \uC218 \uC5C6\uB294 \uC124\uC815 \uD0A4: ${key}
|
|
551
|
+
\uC0AC\uC6A9 \uAC00\uB2A5\uD55C \uD0A4: api-key, base-url`));
|
|
552
|
+
process.exit(EXIT_CONFIG_ERROR);
|
|
553
|
+
}
|
|
554
|
+
console.log(`${key}: ${val}`);
|
|
555
|
+
} else {
|
|
556
|
+
for (const [k, v] of Object.entries(display)) {
|
|
557
|
+
console.log(`${k}: ${v}`);
|
|
558
|
+
}
|
|
559
|
+
}
|
|
560
|
+
});
|
|
561
|
+
|
|
366
562
|
// src/commands/cache.ts
|
|
563
|
+
var import_commander2 = require("commander");
|
|
564
|
+
var import_chalk2 = __toESM(require("chalk"));
|
|
565
|
+
async function clearOrThrow() {
|
|
566
|
+
try {
|
|
567
|
+
return await clearCache();
|
|
568
|
+
} catch (e) {
|
|
569
|
+
const msg = e instanceof Error ? e.message : String(e);
|
|
570
|
+
throw new DoorayCliError(
|
|
571
|
+
`\uCE90\uC2DC\uB97C \uC0AD\uC81C\uD558\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4: ${msg}
|
|
572
|
+
\uACBD\uB85C: ${CACHE_DIR}`,
|
|
573
|
+
EXIT_IO_ERROR
|
|
574
|
+
);
|
|
575
|
+
}
|
|
576
|
+
}
|
|
367
577
|
var cacheCommand = new import_commander2.Command("cache").description("\uCE90\uC2DC \uAD00\uB9AC");
|
|
368
578
|
cacheCommand.command("clear").description("\uCE90\uC2DC \uC804\uCCB4 \uC0AD\uC81C").action(async () => {
|
|
369
|
-
await
|
|
370
|
-
console.log(
|
|
579
|
+
const cleared = await clearOrThrow();
|
|
580
|
+
console.log(
|
|
581
|
+
cleared ? import_chalk2.default.green("\u2713 \uCE90\uC2DC\uAC00 \uC0AD\uC81C\uB418\uC5C8\uC2B5\uB2C8\uB2E4.") : import_chalk2.default.gray("\uC9C0\uC6B8 \uCE90\uC2DC\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.")
|
|
582
|
+
);
|
|
371
583
|
});
|
|
372
584
|
cacheCommand.command("refresh").description("\uCE90\uC2DC \uAC31\uC2E0 (API \uD074\uB77C\uC774\uC5B8\uD2B8 \uC5F0\uB3D9 \uD6C4 \uC9C0\uC6D0 \uC608\uC815)").action(async () => {
|
|
373
|
-
await
|
|
374
|
-
console.log(
|
|
585
|
+
const cleared = await clearOrThrow();
|
|
586
|
+
console.log(
|
|
587
|
+
import_chalk2.default.yellow(
|
|
588
|
+
cleared ? "\uCE90\uC2DC\uB97C \uC0AD\uC81C\uD588\uC2B5\uB2C8\uB2E4. API \uD074\uB77C\uC774\uC5B8\uD2B8 \uC5F0\uB3D9 \uD6C4 \uC790\uB3D9 \uAC31\uC2E0\uC774 \uC9C0\uC6D0\uB429\uB2C8\uB2E4." : "\uC9C0\uC6B8 \uCE90\uC2DC\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4. API \uD074\uB77C\uC774\uC5B8\uD2B8 \uC5F0\uB3D9 \uD6C4 \uC790\uB3D9 \uAC31\uC2E0\uC774 \uC9C0\uC6D0\uB429\uB2C8\uB2E4."
|
|
589
|
+
)
|
|
590
|
+
);
|
|
375
591
|
});
|
|
376
592
|
|
|
377
593
|
// src/commands/doctor.ts
|
|
378
594
|
var import_commander3 = require("commander");
|
|
379
595
|
var import_chalk3 = __toESM(require("chalk"));
|
|
380
596
|
var import_path = __toESM(require("path"));
|
|
381
|
-
var
|
|
597
|
+
var import_promises5 = __toESM(require("fs/promises"));
|
|
382
598
|
|
|
383
599
|
// src/skill/context.ts
|
|
384
600
|
var import_node_path3 = __toESM(require("path"));
|
|
385
601
|
var import_node_os3 = require("os");
|
|
386
602
|
|
|
387
603
|
// src/version.ts
|
|
388
|
-
var CLI_VERSION = true ? "0.
|
|
604
|
+
var CLI_VERSION = true ? "0.19.0" : "0.0.0-dev";
|
|
389
605
|
|
|
390
606
|
// src/skill/context.ts
|
|
391
607
|
function resolveSkillDataRoot(homeDir, xdgDataHome = process.env.XDG_DATA_HOME) {
|
|
@@ -465,8 +681,8 @@ function compareCodePoint(left, right) {
|
|
|
465
681
|
return leftPoints.length - rightPoints.length;
|
|
466
682
|
}
|
|
467
683
|
async function assertRegularFile(filePath) {
|
|
468
|
-
const
|
|
469
|
-
if (!
|
|
684
|
+
const stat4 = await fs.lstat(filePath);
|
|
685
|
+
if (!stat4.isFile()) {
|
|
470
686
|
throw new DoorayCliError(
|
|
471
687
|
`\uC2A4\uD0AC \uCF58\uD150\uCE20\uB294 \uC815\uADDC \uD30C\uC77C\uB9CC \uD3EC\uD568\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4: ${filePath}`,
|
|
472
688
|
EXIT_PARAM_ERROR
|
|
@@ -562,7 +778,7 @@ function statusOf(context, status, overrides = {}) {
|
|
|
562
778
|
managed: overrides.managed ?? false
|
|
563
779
|
};
|
|
564
780
|
}
|
|
565
|
-
function
|
|
781
|
+
function isNodeError2(error, code) {
|
|
566
782
|
return error instanceof Error && "code" in error && error.code === code;
|
|
567
783
|
}
|
|
568
784
|
function isPackageMetadata(value) {
|
|
@@ -695,8 +911,8 @@ async function prepareStore(context, options) {
|
|
|
695
911
|
const storeRoot = getStoreRoot(context);
|
|
696
912
|
const storePath = getStorePath(context, sourceDigest);
|
|
697
913
|
await fs2.mkdir(storeRoot, { recursive: true });
|
|
698
|
-
const existing = await fs2.lstat(storePath).then((
|
|
699
|
-
if (
|
|
914
|
+
const existing = await fs2.lstat(storePath).then((stat4) => stat4).catch((error) => {
|
|
915
|
+
if (isNodeError2(error, "ENOENT")) {
|
|
700
916
|
return null;
|
|
701
917
|
}
|
|
702
918
|
throw error;
|
|
@@ -773,16 +989,16 @@ async function renameWithRollback(from, to, backupPath) {
|
|
|
773
989
|
async function inspectSkill(context) {
|
|
774
990
|
const destination = getDestination(context);
|
|
775
991
|
const source = getSource(context);
|
|
776
|
-
let
|
|
992
|
+
let stat4;
|
|
777
993
|
try {
|
|
778
|
-
|
|
994
|
+
stat4 = await fs2.lstat(destination);
|
|
779
995
|
} catch (error) {
|
|
780
|
-
if (
|
|
996
|
+
if (isNodeError2(error, "ENOENT")) {
|
|
781
997
|
return statusOf(context, "missing", { managed: true });
|
|
782
998
|
}
|
|
783
999
|
throw error;
|
|
784
1000
|
}
|
|
785
|
-
if (!
|
|
1001
|
+
if (!stat4.isSymbolicLink()) {
|
|
786
1002
|
return statusOf(context, "unmanaged");
|
|
787
1003
|
}
|
|
788
1004
|
const linkTarget = await fs2.readlink(destination);
|
|
@@ -790,7 +1006,7 @@ async function inspectSkill(context) {
|
|
|
790
1006
|
try {
|
|
791
1007
|
await fs2.stat(absoluteTarget);
|
|
792
1008
|
} catch (error) {
|
|
793
|
-
if (!
|
|
1009
|
+
if (!isNodeError2(error, "ENOENT")) {
|
|
794
1010
|
throw error;
|
|
795
1011
|
}
|
|
796
1012
|
return statusOf(context, "broken", {
|
|
@@ -925,7 +1141,7 @@ async function installSkill(context, options = {}) {
|
|
|
925
1141
|
|
|
926
1142
|
// src/api/client.ts
|
|
927
1143
|
var import_ky = __toESM(require("ky"));
|
|
928
|
-
var
|
|
1144
|
+
var import_promises4 = require("fs/promises");
|
|
929
1145
|
var import_node_path6 = require("path");
|
|
930
1146
|
|
|
931
1147
|
// src/utils/dooray-message.ts
|
|
@@ -937,6 +1153,87 @@ function normalizeDoorayMessage(raw) {
|
|
|
937
1153
|
}
|
|
938
1154
|
}
|
|
939
1155
|
|
|
1156
|
+
// src/api/rate-limiter.ts
|
|
1157
|
+
var DEFAULT_BURST_CAPACITY = 20;
|
|
1158
|
+
var DEFAULT_REPLENISH_RATE = 5;
|
|
1159
|
+
function defaultSleep(ms) {
|
|
1160
|
+
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
1161
|
+
}
|
|
1162
|
+
function parseRateLimitHeaders(headers) {
|
|
1163
|
+
const read = (name) => {
|
|
1164
|
+
const raw = headers.get(name);
|
|
1165
|
+
if (raw == null) return void 0;
|
|
1166
|
+
const value = Number(raw);
|
|
1167
|
+
return Number.isFinite(value) && value >= 0 ? value : void 0;
|
|
1168
|
+
};
|
|
1169
|
+
return {
|
|
1170
|
+
remaining: read("x-ratelimit-remaining"),
|
|
1171
|
+
burstCapacity: read("x-ratelimit-burst-capacity"),
|
|
1172
|
+
replenishRate: read("x-ratelimit-replenish-rate")
|
|
1173
|
+
};
|
|
1174
|
+
}
|
|
1175
|
+
function createTokenBucket(options = {}) {
|
|
1176
|
+
const now2 = options.now ?? (() => Date.now());
|
|
1177
|
+
const sleep = options.sleep ?? defaultSleep;
|
|
1178
|
+
const positiveOr = (value, fallback) => value != null && value > 0 ? value : fallback;
|
|
1179
|
+
let capacity = positiveOr(options.capacity, DEFAULT_BURST_CAPACITY);
|
|
1180
|
+
let replenishRate = positiveOr(options.replenishRate, DEFAULT_REPLENISH_RATE);
|
|
1181
|
+
let tokens = capacity;
|
|
1182
|
+
let updatedAt = now2();
|
|
1183
|
+
let queue = Promise.resolve();
|
|
1184
|
+
function projected(at) {
|
|
1185
|
+
const elapsed = Math.max(0, at - updatedAt);
|
|
1186
|
+
return Math.min(capacity, tokens + elapsed / 1e3 * replenishRate);
|
|
1187
|
+
}
|
|
1188
|
+
function refill() {
|
|
1189
|
+
const at = now2();
|
|
1190
|
+
if (at <= updatedAt) return;
|
|
1191
|
+
tokens = projected(at);
|
|
1192
|
+
updatedAt = at;
|
|
1193
|
+
}
|
|
1194
|
+
async function take() {
|
|
1195
|
+
for (; ; ) {
|
|
1196
|
+
refill();
|
|
1197
|
+
if (tokens >= 1) {
|
|
1198
|
+
tokens -= 1;
|
|
1199
|
+
return;
|
|
1200
|
+
}
|
|
1201
|
+
const waitMs = Math.max((1 - tokens) / replenishRate * 1e3, 10);
|
|
1202
|
+
await sleep(waitMs);
|
|
1203
|
+
}
|
|
1204
|
+
}
|
|
1205
|
+
return {
|
|
1206
|
+
acquire() {
|
|
1207
|
+
const next = queue.then(take);
|
|
1208
|
+
queue = next.then(
|
|
1209
|
+
() => void 0,
|
|
1210
|
+
() => void 0
|
|
1211
|
+
);
|
|
1212
|
+
return next;
|
|
1213
|
+
},
|
|
1214
|
+
sync(snapshot) {
|
|
1215
|
+
if (snapshot.burstCapacity != null && snapshot.burstCapacity > 0) {
|
|
1216
|
+
capacity = snapshot.burstCapacity;
|
|
1217
|
+
}
|
|
1218
|
+
if (snapshot.replenishRate != null && snapshot.replenishRate > 0) {
|
|
1219
|
+
replenishRate = snapshot.replenishRate;
|
|
1220
|
+
}
|
|
1221
|
+
if (snapshot.remaining != null) {
|
|
1222
|
+
refill();
|
|
1223
|
+
tokens = Math.min(tokens, Math.min(snapshot.remaining, capacity));
|
|
1224
|
+
updatedAt = now2();
|
|
1225
|
+
}
|
|
1226
|
+
},
|
|
1227
|
+
drain() {
|
|
1228
|
+
tokens = 0;
|
|
1229
|
+
updatedAt = now2();
|
|
1230
|
+
},
|
|
1231
|
+
get available() {
|
|
1232
|
+
return projected(now2());
|
|
1233
|
+
}
|
|
1234
|
+
};
|
|
1235
|
+
}
|
|
1236
|
+
|
|
940
1237
|
// src/api/client.ts
|
|
941
1238
|
function joinIds(ids) {
|
|
942
1239
|
return ids && ids.length > 0 ? ids.join(",") : void 0;
|
|
@@ -968,10 +1265,42 @@ var DoorayApiClient = class {
|
|
|
968
1265
|
constructor(apiKey, baseUrl) {
|
|
969
1266
|
this.authHeader = `dooray-api ${apiKey}`;
|
|
970
1267
|
this.baseUrl = baseUrl.endsWith("/") ? baseUrl : `${baseUrl}/`;
|
|
1268
|
+
const bucket = createTokenBucket();
|
|
971
1269
|
this.api = import_ky.default.create({
|
|
972
1270
|
prefix: baseUrl,
|
|
973
1271
|
headers: {
|
|
974
1272
|
Authorization: this.authHeader
|
|
1273
|
+
},
|
|
1274
|
+
// 429 는 재시도할 가치가 있지만, 동시 요청이 한꺼번에 재시도하면 같은 결과가 반복된다.
|
|
1275
|
+
// jitter 로 재시도 시점을 흩고, 아래 훅이 재시도분도 버킷을 거치게 한다.
|
|
1276
|
+
retry: {
|
|
1277
|
+
limit: 3,
|
|
1278
|
+
statusCodes: [408, 413, 429, 500, 502, 503, 504],
|
|
1279
|
+
backoffLimit: 8e3,
|
|
1280
|
+
jitter: true
|
|
1281
|
+
},
|
|
1282
|
+
hooks: {
|
|
1283
|
+
// 훅 순서는 실측했다 — beforeRequest → afterResponse → beforeRetry → afterResponse.
|
|
1284
|
+
// beforeRequest 는 첫 요청에만 돌고 재시도에는 돌지 않으므로,
|
|
1285
|
+
// beforeRetry 에서도 토큰을 받아야 재시도가 버킷을 우회하지 않는다.
|
|
1286
|
+
beforeRequest: [
|
|
1287
|
+
async () => {
|
|
1288
|
+
await bucket.acquire();
|
|
1289
|
+
}
|
|
1290
|
+
],
|
|
1291
|
+
beforeRetry: [
|
|
1292
|
+
async ({ error }) => {
|
|
1293
|
+
if (error instanceof import_ky.HTTPError && error.response.status === 429) {
|
|
1294
|
+
bucket.drain();
|
|
1295
|
+
}
|
|
1296
|
+
await bucket.acquire();
|
|
1297
|
+
}
|
|
1298
|
+
],
|
|
1299
|
+
afterResponse: [
|
|
1300
|
+
({ response }) => {
|
|
1301
|
+
bucket.sync(parseRateLimitHeaders(response.headers));
|
|
1302
|
+
}
|
|
1303
|
+
]
|
|
975
1304
|
}
|
|
976
1305
|
});
|
|
977
1306
|
}
|
|
@@ -1181,6 +1510,20 @@ var DoorayApiClient = class {
|
|
|
1181
1510
|
throw await toDoorayCliError(e);
|
|
1182
1511
|
}
|
|
1183
1512
|
}
|
|
1513
|
+
async createProjectTag(projectId, body) {
|
|
1514
|
+
try {
|
|
1515
|
+
return await this.api.post(`project/v1/projects/${projectId}/tags`, { json: body }).json();
|
|
1516
|
+
} catch (e) {
|
|
1517
|
+
throw await toDoorayCliError(e);
|
|
1518
|
+
}
|
|
1519
|
+
}
|
|
1520
|
+
async updateProjectTagGroup(projectId, tagGroupId, body) {
|
|
1521
|
+
try {
|
|
1522
|
+
return await this.api.put(`project/v1/projects/${projectId}/tag-groups/${tagGroupId}`, { json: body }).json();
|
|
1523
|
+
} catch (e) {
|
|
1524
|
+
throw await toDoorayCliError(e);
|
|
1525
|
+
}
|
|
1526
|
+
}
|
|
1184
1527
|
// ─── Member Groups ──────────────────────────────────
|
|
1185
1528
|
async getProjectMemberGroups(projectId, params) {
|
|
1186
1529
|
try {
|
|
@@ -1259,6 +1602,13 @@ var DoorayApiClient = class {
|
|
|
1259
1602
|
throw await toDoorayCliError(e);
|
|
1260
1603
|
}
|
|
1261
1604
|
}
|
|
1605
|
+
async getWikiPageStandalone(pageId) {
|
|
1606
|
+
try {
|
|
1607
|
+
return await this.api.get(`wiki/v1/pages/${pageId}`).json();
|
|
1608
|
+
} catch (e) {
|
|
1609
|
+
throw await toDoorayCliError(e);
|
|
1610
|
+
}
|
|
1611
|
+
}
|
|
1262
1612
|
async createWikiPage(wikiId, body) {
|
|
1263
1613
|
try {
|
|
1264
1614
|
return await this.api.post(`wiki/v1/wikis/${wikiId}/pages`, { json: body }).json();
|
|
@@ -1287,7 +1637,7 @@ var DoorayApiClient = class {
|
|
|
1287
1637
|
throw await toDoorayCliError(e);
|
|
1288
1638
|
}
|
|
1289
1639
|
}
|
|
1290
|
-
//
|
|
1640
|
+
// Dooray 공식 API 문서에 있는 endpoint 다 (ADR-032)
|
|
1291
1641
|
async deleteWikiPage(wikiId, pageId) {
|
|
1292
1642
|
try {
|
|
1293
1643
|
return await this.api.delete(`wiki/v1/wikis/${wikiId}/pages/${pageId}`).json();
|
|
@@ -1295,6 +1645,13 @@ var DoorayApiClient = class {
|
|
|
1295
1645
|
throw await toDoorayCliError(e);
|
|
1296
1646
|
}
|
|
1297
1647
|
}
|
|
1648
|
+
async moveWikiPage(wikiId, pageId, body) {
|
|
1649
|
+
try {
|
|
1650
|
+
return await this.api.post(`wiki/v1/wikis/${wikiId}/pages/${pageId}/move`, { json: body }).json();
|
|
1651
|
+
} catch (e) {
|
|
1652
|
+
throw await toDoorayCliError(e);
|
|
1653
|
+
}
|
|
1654
|
+
}
|
|
1298
1655
|
// ─── Post Files ─────────────────────────────────────
|
|
1299
1656
|
async getPostFiles(projectId, postId) {
|
|
1300
1657
|
try {
|
|
@@ -1345,7 +1702,7 @@ var DoorayApiClient = class {
|
|
|
1345
1702
|
async uploadPostFile(projectId, postId, filePath) {
|
|
1346
1703
|
try {
|
|
1347
1704
|
const fileName = (0, import_node_path6.basename)(filePath);
|
|
1348
|
-
const fileBuffer = await (0,
|
|
1705
|
+
const fileBuffer = await (0, import_promises4.readFile)(filePath);
|
|
1349
1706
|
const formData = new FormData();
|
|
1350
1707
|
formData.append("file", new Blob([fileBuffer]), fileName);
|
|
1351
1708
|
const url = `${this.baseUrl}project/v1/projects/${projectId}/posts/${postId}/files`;
|
|
@@ -1390,7 +1747,7 @@ var DoorayApiClient = class {
|
|
|
1390
1747
|
async uploadWikiPageFile(wikiId, pageId, filePath, type) {
|
|
1391
1748
|
try {
|
|
1392
1749
|
const fileName = (0, import_node_path6.basename)(filePath);
|
|
1393
|
-
const fileBuffer = await (0,
|
|
1750
|
+
const fileBuffer = await (0, import_promises4.readFile)(filePath);
|
|
1394
1751
|
const buildFormData = () => {
|
|
1395
1752
|
const fd = new FormData();
|
|
1396
1753
|
fd.append("type", type);
|
|
@@ -1619,22 +1976,56 @@ function formatSkillStatus(status) {
|
|
|
1619
1976
|
return import_chalk3.default.yellow("\u26A0\uFE0F \uC218\uC815\uB428 \u2014 dooray skill update --force");
|
|
1620
1977
|
}
|
|
1621
1978
|
}
|
|
1622
|
-
|
|
1623
|
-
|
|
1979
|
+
async function probeApiConnection() {
|
|
1980
|
+
try {
|
|
1981
|
+
const validConfig = await getConfigOrThrow();
|
|
1982
|
+
const client = new DoorayApiClient(validConfig.apiKey, validConfig.baseUrl);
|
|
1983
|
+
await client.getProjects({ page: 0, size: 1 });
|
|
1984
|
+
await ensureMe(client);
|
|
1985
|
+
return "ok";
|
|
1986
|
+
} catch {
|
|
1987
|
+
return "failed";
|
|
1988
|
+
}
|
|
1989
|
+
}
|
|
1990
|
+
var doctorCommand = new import_commander3.Command("doctor").description("\uC124\uC815 \uBC0F \uD658\uACBD \uC9C4\uB2E8").option("--json", "JSON \uD615\uC2DD\uC73C\uB85C \uCD9C\uB825").action(async (opts, command) => {
|
|
1624
1991
|
const config = await getConfig();
|
|
1625
|
-
const apiKeyOk = !!config
|
|
1626
|
-
const baseUrlOk = !!config
|
|
1627
|
-
|
|
1628
|
-
|
|
1992
|
+
const apiKeyOk = config.state === "ok" && !!config.config.apiKey;
|
|
1993
|
+
const baseUrlOk = config.state === "ok" && !!config.config.baseUrl;
|
|
1994
|
+
const json = opts.json || !!command.parent?.opts().json;
|
|
1995
|
+
if (json) {
|
|
1996
|
+
const payload = {
|
|
1997
|
+
configState: config.state,
|
|
1998
|
+
apiKeyOk,
|
|
1999
|
+
baseUrlOk
|
|
2000
|
+
};
|
|
2001
|
+
if (config.state === "invalid" || config.state === "unreadable") {
|
|
2002
|
+
payload.reason = config.reason;
|
|
2003
|
+
}
|
|
2004
|
+
payload.apiConnection = apiKeyOk && baseUrlOk ? await probeApiConnection() : "skipped";
|
|
2005
|
+
console.log(JSON.stringify(payload, null, 2));
|
|
2006
|
+
return;
|
|
2007
|
+
}
|
|
2008
|
+
console.log(import_chalk3.default.bold("\n\u{1F50D} Dooray CLI \uC9C4\uB2E8\n"));
|
|
2009
|
+
if (config.state === "invalid") {
|
|
2010
|
+
console.log(` \uC124\uC815 \uD30C\uC77C: ${import_chalk3.default.red("\u274C \uC190\uC0C1")}`);
|
|
2011
|
+
console.log(` \uC774\uC720: ${config.reason}`);
|
|
2012
|
+
} else if (config.state === "unreadable") {
|
|
2013
|
+
console.log(` \uC124\uC815 \uD30C\uC77C: ${import_chalk3.default.red("\u274C \uC77D\uAE30 \uC2E4\uD328")}`);
|
|
2014
|
+
console.log(` \uC774\uC720: ${config.reason}`);
|
|
2015
|
+
console.log(" \uD30C\uC77C \uAD8C\uD55C\uC744 \uD655\uC778\uD558\uC138\uC694.");
|
|
2016
|
+
} else {
|
|
2017
|
+
const okConfig = config.state === "ok" ? config.config : void 0;
|
|
2018
|
+
console.log(` API Key: ${apiKeyOk ? import_chalk3.default.green("\u2705 \uC124\uC815\uB428") : import_chalk3.default.red("\u274C \uBBF8\uC124\uC815")}`);
|
|
2019
|
+
console.log(` Base URL: ${okConfig?.baseUrl ? import_chalk3.default.green(`\u2705 ${okConfig.baseUrl}`) : import_chalk3.default.red("\u274C \uBBF8\uC124\uC815")}`);
|
|
2020
|
+
}
|
|
1629
2021
|
if (apiKeyOk && baseUrlOk) {
|
|
1630
2022
|
console.log(import_chalk3.default.bold("\n\u{1F310} API \uC5F0\uACB0 \uD14C\uC2A4\uD2B8\n"));
|
|
1631
|
-
|
|
2023
|
+
if (await probeApiConnection() === "ok") {
|
|
1632
2024
|
const validConfig = await getConfigOrThrow();
|
|
1633
2025
|
const client = new DoorayApiClient(validConfig.apiKey, validConfig.baseUrl);
|
|
1634
|
-
await client.getProjects({ page: 0, size: 1 });
|
|
1635
2026
|
const me = await ensureMe(client);
|
|
1636
2027
|
console.log(` \uC5F0\uACB0: ${import_chalk3.default.green("\u2705 \uC131\uACF5")} (${me.name})`);
|
|
1637
|
-
}
|
|
2028
|
+
} else {
|
|
1638
2029
|
console.log(` \uC5F0\uACB0: ${import_chalk3.default.red("\u274C \uC2E4\uD328 \u2014 API \uD0A4 \uB610\uB294 URL\uC744 \uD655\uC778\uD558\uC138\uC694")}`);
|
|
1639
2030
|
}
|
|
1640
2031
|
}
|
|
@@ -1651,7 +2042,7 @@ var doctorCommand = new import_commander3.Command("doctor").description("\uC124\
|
|
|
1651
2042
|
process.env.HOME ?? process.env.USERPROFILE ?? "",
|
|
1652
2043
|
".claude"
|
|
1653
2044
|
);
|
|
1654
|
-
const claudeDirExists = await
|
|
2045
|
+
const claudeDirExists = await import_promises5.default.access(claudeDir).then(() => true).catch(() => false);
|
|
1655
2046
|
if (claudeDirExists) {
|
|
1656
2047
|
console.log(import_chalk3.default.bold("\n\u{1F527} Claude Code \uC2A4\uD0AC\n"));
|
|
1657
2048
|
const skillStatus = await inspectSkill(createSkillManagerContext());
|
|
@@ -1662,6 +2053,10 @@ var doctorCommand = new import_commander3.Command("doctor").description("\uC124\
|
|
|
1662
2053
|
console.log();
|
|
1663
2054
|
if (apiKeyOk && baseUrlOk) {
|
|
1664
2055
|
console.log(import_chalk3.default.green("\u2713 \uAE30\uBCF8 \uC124\uC815\uC774 \uC644\uB8CC\uB418\uC5C8\uC2B5\uB2C8\uB2E4."));
|
|
2056
|
+
} else if (config.state === "invalid") {
|
|
2057
|
+
console.log(import_chalk3.default.yellow("\u26A0 \uC124\uC815 \uD30C\uC77C\uC774 \uC190\uC0C1\uB418\uC5C8\uC2B5\uB2C8\uB2E4."));
|
|
2058
|
+
} else if (config.state === "unreadable") {
|
|
2059
|
+
console.log(import_chalk3.default.yellow("\u26A0 \uC124\uC815 \uD30C\uC77C\uC744 \uC77D\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4."));
|
|
1665
2060
|
} else {
|
|
1666
2061
|
console.log(import_chalk3.default.yellow("\u26A0 \uC124\uC815\uC774 \uD544\uC694\uD569\uB2C8\uB2E4:"));
|
|
1667
2062
|
console.log(import_chalk3.default.yellow(" dooray setup"));
|
|
@@ -1673,10 +2068,24 @@ var doctorCommand = new import_commander3.Command("doctor").description("\uC124\
|
|
|
1673
2068
|
var import_commander4 = require("commander");
|
|
1674
2069
|
var import_chalk4 = __toESM(require("chalk"));
|
|
1675
2070
|
var import_path2 = __toESM(require("path"));
|
|
1676
|
-
var
|
|
2071
|
+
var import_promises6 = __toESM(require("fs/promises"));
|
|
1677
2072
|
var setupCommand = new import_commander4.Command("setup").description("\uB300\uD654\uD615 \uCD08\uAE30 \uC124\uC815 \uB9C8\uBC95\uC0AC").action(async () => {
|
|
1678
2073
|
const { input: input2, select, password, confirm: confirm2 } = await import("@inquirer/prompts");
|
|
1679
|
-
const
|
|
2074
|
+
const existingResult = await getConfig();
|
|
2075
|
+
const existing = existingResult.state === "ok" ? existingResult.config : void 0;
|
|
2076
|
+
if (existingResult.state === "unreadable") {
|
|
2077
|
+
console.log(
|
|
2078
|
+
import_chalk4.default.yellow(
|
|
2079
|
+
` \u26A0 \uAE30\uC874 \uC124\uC815 \uD30C\uC77C\uC744 \uC77D\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4. \uC800\uC7A5\uB3C4 \uC2E4\uD328\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4: ${existingResult.reason}`
|
|
2080
|
+
)
|
|
2081
|
+
);
|
|
2082
|
+
} else if (existingResult.state === "invalid") {
|
|
2083
|
+
console.log(
|
|
2084
|
+
import_chalk4.default.yellow(
|
|
2085
|
+
` \u26A0 \uAE30\uC874 \uC124\uC815 \uD30C\uC77C\uC774 \uC190\uC0C1\uB418\uC5B4 \uAE30\uBCF8\uAC12\uC73C\uB85C \uC4F0\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4: ${existingResult.reason}`
|
|
2086
|
+
)
|
|
2087
|
+
);
|
|
2088
|
+
}
|
|
1680
2089
|
try {
|
|
1681
2090
|
const tenantName = await input2({
|
|
1682
2091
|
message: "\uD14C\uB10C\uD2B8\uBA85\uC744 \uC785\uB825\uD558\uC138\uC694",
|
|
@@ -1750,7 +2159,7 @@ var setupCommand = new import_commander4.Command("setup").description("\uB300\uD
|
|
|
1750
2159
|
process.env.HOME ?? process.env.USERPROFILE ?? "",
|
|
1751
2160
|
".claude"
|
|
1752
2161
|
);
|
|
1753
|
-
const claudeDirExists = await
|
|
2162
|
+
const claudeDirExists = await import_promises6.default.access(claudeDir).then(() => true).catch(() => false);
|
|
1754
2163
|
if (claudeDirExists) {
|
|
1755
2164
|
const isNpx = /_npx[/\\]/.test(__dirname) || /\.npm[/\\]_npx/.test(__dirname) || /npx-/.test(__dirname);
|
|
1756
2165
|
if (isNpx) {
|
|
@@ -1799,12 +2208,19 @@ var setupCommand = new import_commander4.Command("setup").description("\uB300\uD
|
|
|
1799
2208
|
smtpPort: useMail ? DEFAULTS.smtpPort : existing?.smtpPort
|
|
1800
2209
|
};
|
|
1801
2210
|
config.trackLastRun = trackLastRun;
|
|
1802
|
-
await
|
|
2211
|
+
const { cacheCleared } = await replaceConfig(config);
|
|
1803
2212
|
console.log(
|
|
1804
2213
|
import_chalk4.default.green(
|
|
1805
2214
|
"\n\u2713 \uC124\uC815 \uC644\uB8CC. dooray doctor\uB85C \uC0C1\uD0DC\uB97C \uD655\uC778\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4."
|
|
1806
2215
|
)
|
|
1807
2216
|
);
|
|
2217
|
+
if (cacheCleared) {
|
|
2218
|
+
console.log(
|
|
2219
|
+
import_chalk4.default.gray(
|
|
2220
|
+
" \uACC4\uC815\uC774\uB098 \uC811\uC18D \uD658\uACBD\uC774 \uBC14\uB00C\uC5B4 \uCE90\uC2DC\uB97C \uBE44\uC6E0\uC2B5\uB2C8\uB2E4. \uB2E4\uC74C \uC870\uD68C\uAC00 API \uB97C \uB2E4\uC2DC \uD638\uCD9C\uD569\uB2C8\uB2E4."
|
|
2221
|
+
)
|
|
2222
|
+
);
|
|
2223
|
+
}
|
|
1808
2224
|
} catch (err) {
|
|
1809
2225
|
if (err != null && typeof err === "object" && "name" in err && err.name === "ExitPromptError") {
|
|
1810
2226
|
console.log(import_chalk4.default.yellow("\n\uC124\uC815\uC774 \uCDE8\uC18C\uB418\uC5C8\uC2B5\uB2C8\uB2E4."));
|
|
@@ -1932,6 +2348,20 @@ async function ensurePrivateProjects(client) {
|
|
|
1932
2348
|
await setPrivateProjects(items);
|
|
1933
2349
|
return items;
|
|
1934
2350
|
}
|
|
2351
|
+
async function buildProjectCodeMap(client) {
|
|
2352
|
+
const map = /* @__PURE__ */ new Map();
|
|
2353
|
+
const projects = await ensureProjects(client);
|
|
2354
|
+
for (const p of projects) {
|
|
2355
|
+
map.set(p.id, p.code);
|
|
2356
|
+
}
|
|
2357
|
+
const privateCached = await getPrivateProjects();
|
|
2358
|
+
if (privateCached && !isExpired(privateCached.updatedAt, PROJECTS_TTL_MS)) {
|
|
2359
|
+
for (const p of privateCached.data) {
|
|
2360
|
+
map.set(p.id, p.code);
|
|
2361
|
+
}
|
|
2362
|
+
}
|
|
2363
|
+
return map;
|
|
2364
|
+
}
|
|
1935
2365
|
async function resolveProject(client, input2) {
|
|
1936
2366
|
if (PROJECT_ID_RE.test(input2)) {
|
|
1937
2367
|
return input2;
|
|
@@ -1946,8 +2376,8 @@ async function resolveProject(client, input2) {
|
|
|
1946
2376
|
}
|
|
1947
2377
|
throw new DoorayCliError(
|
|
1948
2378
|
`\uD504\uB85C\uC81D\uD2B8\uB97C \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4: ${input2}
|
|
1949
|
-
\uAC1C\uC778 \uD504\uB85C\uC81D\uD2B8\uB77C\uBA74
|
|
1950
|
-
|
|
2379
|
+
\uAC1C\uC778 \uD504\uB85C\uC81D\uD2B8\uB77C\uBA74 \uCE90\uC2DC\uB97C \uAC31\uC2E0\uD558\uC138\uC694: dooray project list --type private
|
|
2380
|
+
\uBAA9\uB85D\uC5D0 \uC5C6\uB294 \uD504\uB85C\uC81D\uD2B8\uB294 projectId \uB97C \uC9C1\uC811 \uB123\uC73C\uBA74 \uB429\uB2C8\uB2E4 (15\uC790\uB9AC \uC774\uC0C1 \uC22B\uC790)`,
|
|
1951
2381
|
EXIT_PARAM_ERROR
|
|
1952
2382
|
);
|
|
1953
2383
|
}
|
|
@@ -2292,8 +2722,8 @@ async function resolveMemberGroup(client, projectId, input2) {
|
|
|
2292
2722
|
const skipped = groups.length - valid.length;
|
|
2293
2723
|
if (skipped > 0) {
|
|
2294
2724
|
process.stderr.write(
|
|
2295
|
-
//
|
|
2296
|
-
`\u26A0 ${skipped}\uAC1C \uADF8\uB8F9\uC5D0 code \uAC00 \uC5C6\uC5B4 \uB9E4\uCE6D\uC5D0\uC11C \uC81C\uC678\uD588\uC2B5\uB2C8\uB2E4
|
|
2725
|
+
// code 누락 그룹 제외 근거는 ADR-028 이다.
|
|
2726
|
+
`\u26A0 ${skipped}\uAC1C \uADF8\uB8F9\uC5D0 code \uAC00 \uC5C6\uC5B4 \uB9E4\uCE6D\uC5D0\uC11C \uC81C\uC678\uD588\uC2B5\uB2C8\uB2E4.
|
|
2297
2727
|
id \uC9C1\uC811 \uC785\uB825 (15+\uC790\uB9AC numeric) \uB610\uB294 UI \uC218\uB3D9 cc / \`--cc <member>\` \uC6B0\uD68C \uAC00\uB2A5.
|
|
2298
2728
|
`
|
|
2299
2729
|
);
|
|
@@ -2490,17 +2920,50 @@ async function validateMandatoryCoverage(client, projectId, selectedTagIds) {
|
|
|
2490
2920
|
);
|
|
2491
2921
|
}
|
|
2492
2922
|
}
|
|
2923
|
+
async function resolveTagGroup(client, projectId, input2) {
|
|
2924
|
+
const name = input2.trim();
|
|
2925
|
+
if (!name) {
|
|
2926
|
+
throw new DoorayCliError("\uD0DC\uADF8 \uADF8\uB8F9 \uC774\uB984\uC774 \uBE44\uC5B4 \uC788\uC2B5\uB2C8\uB2E4", EXIT_PARAM_ERROR);
|
|
2927
|
+
}
|
|
2928
|
+
const tags = await ensureTags(client, projectId);
|
|
2929
|
+
const groups = [];
|
|
2930
|
+
const seen = /* @__PURE__ */ new Set();
|
|
2931
|
+
for (const t of tags) {
|
|
2932
|
+
if (!t.groupId || seen.has(t.groupId)) continue;
|
|
2933
|
+
seen.add(t.groupId);
|
|
2934
|
+
groups.push({
|
|
2935
|
+
id: t.groupId,
|
|
2936
|
+
name: t.groupName ?? "",
|
|
2937
|
+
mandatory: t.groupMandatory,
|
|
2938
|
+
selectOne: t.groupSelectOne
|
|
2939
|
+
});
|
|
2940
|
+
}
|
|
2941
|
+
if (groups.length === 0) {
|
|
2942
|
+
throw new DoorayCliError(
|
|
2943
|
+
`\uC774 \uD504\uB85C\uC81D\uD2B8\uC5D0\uB294 \uD0DC\uADF8 \uADF8\uB8F9\uC774 \uC5C6\uC2B5\uB2C8\uB2E4.
|
|
2944
|
+
\uADF8\uB8F9\uC740 \uD0DC\uADF8 \uBAA9\uB85D\uC5D0\uC11C \uD30C\uC0DD\uD558\uBBC0\uB85C \uD0DC\uADF8\uAC00 \uD558\uB098\uB3C4 \uC5C6\uC73C\uBA74 \uC54C \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.
|
|
2945
|
+
\uBA3C\uC800 \uD0DC\uADF8\uB97C \uB9CC\uB4DC\uC138\uC694: dooray project tags create <project> --name "${name}:<\uD0DC\uADF8>"`,
|
|
2946
|
+
EXIT_PARAM_ERROR
|
|
2947
|
+
);
|
|
2948
|
+
}
|
|
2949
|
+
return matchByName(groups, name, "\uD0DC\uADF8 \uADF8\uB8F9", (g) => `${g.name} (${g.id})`);
|
|
2950
|
+
}
|
|
2493
2951
|
|
|
2494
2952
|
// src/commands/project/tags.ts
|
|
2495
|
-
|
|
2496
|
-
const globalOpts = projectTagsCommand.optsWithGlobals();
|
|
2953
|
+
async function runTagsList(project, opts) {
|
|
2497
2954
|
const config = await getConfigOrThrow();
|
|
2498
2955
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
2499
2956
|
startSpinner("\uD0DC\uADF8 \uBAA9\uB85D \uC870\uD68C \uC911...");
|
|
2500
|
-
|
|
2501
|
-
|
|
2957
|
+
let tags;
|
|
2958
|
+
try {
|
|
2959
|
+
const projectId = await resolveProject(client, project);
|
|
2960
|
+
tags = await ensureTags(client, projectId);
|
|
2961
|
+
} catch (e) {
|
|
2962
|
+
stopSpinner(false, "\uD0DC\uADF8 \uBAA9\uB85D \uC870\uD68C \uC2E4\uD328");
|
|
2963
|
+
throw e;
|
|
2964
|
+
}
|
|
2502
2965
|
stopSpinner(true, "\uD0DC\uADF8 \uBAA9\uB85D \uC870\uD68C \uC644\uB8CC");
|
|
2503
|
-
output(
|
|
2966
|
+
output(opts, {
|
|
2504
2967
|
headers: ["ID", "Color", "Name", "Group", "Mandatory"],
|
|
2505
2968
|
rows: tags.map((t) => [
|
|
2506
2969
|
t.id,
|
|
@@ -2512,11 +2975,136 @@ var projectTagsCommand = new import_commander10.Command("tags").description("\uD
|
|
|
2512
2975
|
raw: tags,
|
|
2513
2976
|
ids: tags.map((t) => t.id)
|
|
2514
2977
|
});
|
|
2978
|
+
}
|
|
2979
|
+
var projectTagsCommand = new import_commander10.Command("tags").description("\uD504\uB85C\uC81D\uD2B8 \uD0DC\uADF8 \uC870\uD68C\xB7\uC0DD\uC131\xB7\uADF8\uB8F9 \uBCC0\uACBD").argument("[project]", "\uD504\uB85C\uC81D\uD2B8 \uCF54\uB4DC \uB610\uB294 ID (\uC0DD\uB7B5\uD558\uBA74 \uB3C4\uC6C0\uB9D0)").action(async (project) => {
|
|
2980
|
+
if (!project) {
|
|
2981
|
+
projectTagsCommand.help({ error: true });
|
|
2982
|
+
return;
|
|
2983
|
+
}
|
|
2984
|
+
await runTagsList(project, projectTagsCommand.optsWithGlobals());
|
|
2985
|
+
});
|
|
2986
|
+
var projectTagsListCommand = new import_commander10.Command("list").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) => {
|
|
2987
|
+
await runTagsList(project, projectTagsListCommand.optsWithGlobals());
|
|
2515
2988
|
});
|
|
2516
2989
|
|
|
2517
|
-
// src/commands/project/
|
|
2990
|
+
// src/commands/project/tags-create.ts
|
|
2518
2991
|
var import_commander11 = require("commander");
|
|
2519
2992
|
|
|
2993
|
+
// src/services/tag.ts
|
|
2994
|
+
async function invalidateTags(projectId) {
|
|
2995
|
+
try {
|
|
2996
|
+
await clearTags(projectId);
|
|
2997
|
+
} catch (e) {
|
|
2998
|
+
const msg = e instanceof Error ? e.message : String(e);
|
|
2999
|
+
process.stderr.write(
|
|
3000
|
+
`\u26A0 \uD0DC\uADF8 \uCE90\uC2DC \uC0AD\uC81C \uC2E4\uD328 (\uBCC0\uACBD\uC740 \uBC18\uC601\uB428): ${msg}
|
|
3001
|
+
\uCD5C\uC2E0 \uD0DC\uADF8\uAC00 \uC548 \uBCF4\uC774\uBA74: dooray cache clear
|
|
3002
|
+
`
|
|
3003
|
+
);
|
|
3004
|
+
}
|
|
3005
|
+
}
|
|
3006
|
+
async function createTag(client, projectId, body) {
|
|
3007
|
+
const res = await client.createProjectTag(projectId, body);
|
|
3008
|
+
await invalidateTags(projectId);
|
|
3009
|
+
return res.result.id;
|
|
3010
|
+
}
|
|
3011
|
+
async function updateTagGroup(client, projectId, tagGroupId, body) {
|
|
3012
|
+
await client.updateProjectTagGroup(projectId, tagGroupId, body);
|
|
3013
|
+
await invalidateTags(projectId);
|
|
3014
|
+
}
|
|
3015
|
+
|
|
3016
|
+
// src/commands/project/tags-create.ts
|
|
3017
|
+
var DEFAULT_TAG_COLOR = "e0e0e0";
|
|
3018
|
+
function normalizeTagColor(input2) {
|
|
3019
|
+
if (input2 === void 0) return DEFAULT_TAG_COLOR;
|
|
3020
|
+
const trimmed = input2.trim();
|
|
3021
|
+
if (!trimmed) return DEFAULT_TAG_COLOR;
|
|
3022
|
+
const stripped = trimmed.startsWith("#") ? trimmed.slice(1) : trimmed;
|
|
3023
|
+
if (!/^[0-9a-fA-F]{6}$/.test(stripped)) {
|
|
3024
|
+
throw new DoorayCliError(
|
|
3025
|
+
`\uC0C9\uC0C1 \uD615\uC2DD\uC774 \uC62C\uBC14\uB974\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4: "${input2}"
|
|
3026
|
+
6\uC790\uB9AC hex \uB97C \uC9C0\uC815\uD558\uC138\uC694 (\uC608: c6eab3 \uB610\uB294 #c6eab3)`,
|
|
3027
|
+
EXIT_PARAM_ERROR
|
|
3028
|
+
);
|
|
3029
|
+
}
|
|
3030
|
+
return stripped.toLowerCase();
|
|
3031
|
+
}
|
|
3032
|
+
var projectTagsCreateCommand = new import_commander11.Command("create").description("\uD504\uB85C\uC81D\uD2B8 \uD0DC\uADF8 \uC0DD\uC131").argument("<project>", "\uD504\uB85C\uC81D\uD2B8 \uCF54\uB4DC \uB610\uB294 ID").option("--name <name>", '\uD0DC\uADF8 \uC774\uB984 ("<\uADF8\uB8F9>:<\uD0DC\uADF8>" \uD615\uC2DD, \uADF8\uB8F9 \uC0DD\uB7B5 \uAC00\uB2A5) \u2014 \uD544\uC218').option("--color <hex>", `\uD0DC\uADF8 \uC0C9\uC0C1 (6\uC790\uB9AC hex, \uAE30\uBCF8\uAC12 ${DEFAULT_TAG_COLOR})`).action(async (project) => {
|
|
3033
|
+
const opts = projectTagsCreateCommand.opts();
|
|
3034
|
+
const globalOpts = projectTagsCreateCommand.optsWithGlobals();
|
|
3035
|
+
const name = (opts.name ?? "").trim();
|
|
3036
|
+
if (!name) {
|
|
3037
|
+
throw new DoorayCliError(
|
|
3038
|
+
'--name \uC774 \uD544\uC694\uD569\uB2C8\uB2E4 (\uC608: --name "\uBC30\uD3EC\uD658\uACBD:staging")',
|
|
3039
|
+
EXIT_PARAM_ERROR
|
|
3040
|
+
);
|
|
3041
|
+
}
|
|
3042
|
+
const color = normalizeTagColor(opts.color);
|
|
3043
|
+
const config = await getConfigOrThrow();
|
|
3044
|
+
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
3045
|
+
startSpinner("\uD0DC\uADF8 \uC0DD\uC131 \uC911...");
|
|
3046
|
+
let tagId;
|
|
3047
|
+
try {
|
|
3048
|
+
const projectId = await resolveProject(client, project);
|
|
3049
|
+
tagId = await createTag(client, projectId, { name, color });
|
|
3050
|
+
} catch (e) {
|
|
3051
|
+
stopSpinner(false, "\uD0DC\uADF8 \uC0DD\uC131 \uC2E4\uD328");
|
|
3052
|
+
throw e;
|
|
3053
|
+
}
|
|
3054
|
+
stopSpinner(true, "\uD0DC\uADF8 \uC0DD\uC131 \uC644\uB8CC");
|
|
3055
|
+
if (globalOpts.json) {
|
|
3056
|
+
printJson({ id: tagId, name, color });
|
|
3057
|
+
} else if (globalOpts.quiet) {
|
|
3058
|
+
printQuiet([tagId]);
|
|
3059
|
+
} else {
|
|
3060
|
+
process.stdout.write(`\uD0DC\uADF8\uAC00 \uC0DD\uC131\uB418\uC5C8\uC2B5\uB2C8\uB2E4: ${name} (${tagId})
|
|
3061
|
+
`);
|
|
3062
|
+
}
|
|
3063
|
+
});
|
|
3064
|
+
|
|
3065
|
+
// src/commands/project/tags-group.ts
|
|
3066
|
+
var import_commander12 = require("commander");
|
|
3067
|
+
var projectTagsGroupCommand = new import_commander12.Command("group").description("\uD0DC\uADF8 \uADF8\uB8F9 \uC18D\uC131 \uBCC0\uACBD").argument("<project>", "\uD504\uB85C\uC81D\uD2B8 \uCF54\uB4DC \uB610\uB294 ID").argument("<group>", "\uD0DC\uADF8 \uADF8\uB8F9 \uC774\uB984").option("--mandatory", "\uC774 \uADF8\uB8F9\uC5D0\uC11C \uD0DC\uADF8\uB97C \uBC18\uB4DC\uC2DC \uD558\uB098 \uACE0\uB974\uAC8C \uD55C\uB2E4").option("--no-mandatory", "\uD544\uC218 \uC9C0\uC815\uC744 \uD574\uC81C\uD55C\uB2E4").option("--select-one", "\uC774 \uADF8\uB8F9\uC5D0\uC11C \uD0DC\uADF8\uB97C \uD558\uB098\uB9CC \uACE0\uB974\uAC8C \uD55C\uB2E4").option("--no-select-one", "\uB2E8\uC77C \uC120\uD0DD\uC744 \uD574\uC81C\uD55C\uB2E4").action(async (project, group) => {
|
|
3068
|
+
const opts = projectTagsGroupCommand.opts();
|
|
3069
|
+
const globalOpts = projectTagsGroupCommand.optsWithGlobals();
|
|
3070
|
+
if (opts.mandatory === void 0 && opts.selectOne === void 0) {
|
|
3071
|
+
throw new DoorayCliError(
|
|
3072
|
+
"\uBC14\uAFC0 \uC18D\uC131\uC744 \uC9C0\uC815\uD558\uC138\uC694: --mandatory / --no-mandatory / --select-one / --no-select-one",
|
|
3073
|
+
EXIT_PARAM_ERROR
|
|
3074
|
+
);
|
|
3075
|
+
}
|
|
3076
|
+
const config = await getConfigOrThrow();
|
|
3077
|
+
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
3078
|
+
startSpinner("\uD0DC\uADF8 \uADF8\uB8F9 \uBCC0\uACBD \uC911...");
|
|
3079
|
+
let resolved;
|
|
3080
|
+
let mandatory;
|
|
3081
|
+
let selectOne;
|
|
3082
|
+
try {
|
|
3083
|
+
const projectId = await resolveProject(client, project);
|
|
3084
|
+
resolved = await resolveTagGroup(client, projectId, group);
|
|
3085
|
+
mandatory = opts.mandatory ?? resolved.mandatory;
|
|
3086
|
+
selectOne = opts.selectOne ?? resolved.selectOne;
|
|
3087
|
+
await updateTagGroup(client, projectId, resolved.id, { mandatory, selectOne });
|
|
3088
|
+
} catch (e) {
|
|
3089
|
+
stopSpinner(false, "\uD0DC\uADF8 \uADF8\uB8F9 \uBCC0\uACBD \uC2E4\uD328");
|
|
3090
|
+
throw e;
|
|
3091
|
+
}
|
|
3092
|
+
stopSpinner(true, "\uD0DC\uADF8 \uADF8\uB8F9 \uBCC0\uACBD \uC644\uB8CC");
|
|
3093
|
+
if (globalOpts.json) {
|
|
3094
|
+
printJson({ id: resolved.id, name: resolved.name, mandatory, selectOne });
|
|
3095
|
+
} else if (globalOpts.quiet) {
|
|
3096
|
+
printQuiet([resolved.id]);
|
|
3097
|
+
} else {
|
|
3098
|
+
process.stdout.write(
|
|
3099
|
+
`\uD0DC\uADF8 \uADF8\uB8F9\uC774 \uBCC0\uACBD\uB418\uC5C8\uC2B5\uB2C8\uB2E4: ${resolved.name} (\uD544\uC218 ${mandatory ? "Y" : "N"}, \uB2E8\uC77C \uC120\uD0DD ${selectOne ? "Y" : "N"})
|
|
3100
|
+
`
|
|
3101
|
+
);
|
|
3102
|
+
}
|
|
3103
|
+
});
|
|
3104
|
+
|
|
3105
|
+
// src/commands/project/templates.ts
|
|
3106
|
+
var import_commander13 = require("commander");
|
|
3107
|
+
|
|
2520
3108
|
// src/resolvers/template.ts
|
|
2521
3109
|
var TEMPLATE_ID_RE = /^\d{15,}$/;
|
|
2522
3110
|
async function fetchAllTemplates(client, projectId) {
|
|
@@ -2554,7 +3142,7 @@ async function resolveTemplate(client, projectId, input2) {
|
|
|
2554
3142
|
}
|
|
2555
3143
|
|
|
2556
3144
|
// src/commands/project/templates.ts
|
|
2557
|
-
var projectTemplatesCommand = new
|
|
3145
|
+
var projectTemplatesCommand = new import_commander13.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) => {
|
|
2558
3146
|
const globalOpts = projectTemplatesCommand.optsWithGlobals();
|
|
2559
3147
|
const config = await getConfigOrThrow();
|
|
2560
3148
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -2576,7 +3164,7 @@ var projectTemplatesCommand = new import_commander11.Command("templates").descri
|
|
|
2576
3164
|
});
|
|
2577
3165
|
|
|
2578
3166
|
// src/commands/post/list.ts
|
|
2579
|
-
var
|
|
3167
|
+
var import_commander14 = require("commander");
|
|
2580
3168
|
|
|
2581
3169
|
// src/formatters/post.ts
|
|
2582
3170
|
function formatPostList(posts, opts) {
|
|
@@ -2627,7 +3215,7 @@ function formatCommentList(comments, opts) {
|
|
|
2627
3215
|
}
|
|
2628
3216
|
|
|
2629
3217
|
// src/commands/post/list.ts
|
|
2630
|
-
var postListCommand = new
|
|
3218
|
+
var postListCommand = new import_commander14.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) => {
|
|
2631
3219
|
const globalOpts = postListCommand.optsWithGlobals();
|
|
2632
3220
|
const config = await getConfigOrThrow();
|
|
2633
3221
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -2661,8 +3249,8 @@ var postListCommand = new import_commander12.Command("list").description("\uC5C5
|
|
|
2661
3249
|
});
|
|
2662
3250
|
|
|
2663
3251
|
// src/commands/post/search.ts
|
|
2664
|
-
var
|
|
2665
|
-
var postSearchCommand = new
|
|
3252
|
+
var import_commander15 = require("commander");
|
|
3253
|
+
var postSearchCommand = new import_commander15.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) => {
|
|
2666
3254
|
const globalOpts = postSearchCommand.optsWithGlobals();
|
|
2667
3255
|
const config = await getConfigOrThrow();
|
|
2668
3256
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -2674,7 +3262,7 @@ var postSearchCommand = new import_commander13.Command("search").description("\u
|
|
|
2674
3262
|
});
|
|
2675
3263
|
|
|
2676
3264
|
// src/commands/post/get.ts
|
|
2677
|
-
var
|
|
3265
|
+
var import_commander16 = require("commander");
|
|
2678
3266
|
|
|
2679
3267
|
// src/resolvers/post.ts
|
|
2680
3268
|
async function resolvePost(client, projectId, postNumber) {
|
|
@@ -2713,6 +3301,38 @@ function isLikelyDoorayUrl(input2) {
|
|
|
2713
3301
|
return /^https?:\/\//.test(input2);
|
|
2714
3302
|
}
|
|
2715
3303
|
|
|
3304
|
+
// src/utils/command-hint.ts
|
|
3305
|
+
var SHELL_SAFE = /^[A-Za-z0-9._/:@=-]+$/;
|
|
3306
|
+
function shellQuote(token) {
|
|
3307
|
+
if (SHELL_SAFE.test(token)) return token;
|
|
3308
|
+
return `'${token.replace(/'/g, "'\\''")}'`;
|
|
3309
|
+
}
|
|
3310
|
+
function buildIdModeCommand(argv, positionals, postId) {
|
|
3311
|
+
const pending = [...positionals];
|
|
3312
|
+
const kept = [];
|
|
3313
|
+
for (let i = 0; i < argv.length; i++) {
|
|
3314
|
+
const token = argv[i];
|
|
3315
|
+
if (token.startsWith("--")) {
|
|
3316
|
+
kept.push(token);
|
|
3317
|
+
if (token.includes("=")) continue;
|
|
3318
|
+
const next = argv[i + 1];
|
|
3319
|
+
if (next === void 0) continue;
|
|
3320
|
+
if (next.startsWith("--") || pending.includes(next)) continue;
|
|
3321
|
+
kept.push(next);
|
|
3322
|
+
i++;
|
|
3323
|
+
continue;
|
|
3324
|
+
}
|
|
3325
|
+
const at = pending.indexOf(token);
|
|
3326
|
+
if (at >= 0) {
|
|
3327
|
+
pending.splice(at, 1);
|
|
3328
|
+
continue;
|
|
3329
|
+
}
|
|
3330
|
+
kept.push(token);
|
|
3331
|
+
}
|
|
3332
|
+
kept.push("--id", postId);
|
|
3333
|
+
return `dooray ${kept.map(shellQuote).join(" ")}`;
|
|
3334
|
+
}
|
|
3335
|
+
|
|
2716
3336
|
// src/resolvers/post-input.ts
|
|
2717
3337
|
function classifyPostInputToken(token) {
|
|
2718
3338
|
if (/^https?:\/\//.test(token)) return "url";
|
|
@@ -2737,7 +3357,7 @@ async function resolveByPostId(client, postId) {
|
|
|
2737
3357
|
};
|
|
2738
3358
|
}
|
|
2739
3359
|
async function resolvePostInput(client, args) {
|
|
2740
|
-
const { projectArg, postNumberArg, idOpt, urlOpt } = args;
|
|
3360
|
+
const { projectArg, postNumberArg, idOpt, urlOpt, argv } = args;
|
|
2741
3361
|
const hasPositional = !!projectArg || !!postNumberArg;
|
|
2742
3362
|
if (idOpt && urlOpt) {
|
|
2743
3363
|
throw new DoorayCliError(
|
|
@@ -2794,10 +3414,23 @@ ${URL_FORMAT_HINT}`,
|
|
|
2794
3414
|
if (projectArg && postNumberArg) {
|
|
2795
3415
|
const numType = classifyPostInputToken(postNumberArg);
|
|
2796
3416
|
if (numType === "postId") {
|
|
2797
|
-
|
|
2798
|
-
|
|
2799
|
-
|
|
3417
|
+
const lead = `"${postNumberArg}" \uB294 \uB0B4\uBD80 ID(postId)\uB85C \uBCF4\uC785\uB2C8\uB2E4.
|
|
3418
|
+
`;
|
|
3419
|
+
if (!argv || argv.length === 0) {
|
|
3420
|
+
throw new DoorayCliError(
|
|
3421
|
+
lead + `\uC5C5\uBB34 \uBC88\uD638(#N)\uAC00 \uC544\uB2CC \uB0B4\uBD80 ID \uB85C \uC870\uD68C\uD558\uB824\uBA74 --id \uC635\uC158\uC744 \uC0AC\uC6A9\uD558\uC138\uC694:
|
|
2800
3422
|
dooray post get --id ${postNumberArg}`,
|
|
3423
|
+
EXIT_PARAM_ERROR
|
|
3424
|
+
);
|
|
3425
|
+
}
|
|
3426
|
+
const completed = buildIdModeCommand(
|
|
3427
|
+
argv,
|
|
3428
|
+
[projectArg, postNumberArg],
|
|
3429
|
+
postNumberArg
|
|
3430
|
+
);
|
|
3431
|
+
throw new DoorayCliError(
|
|
3432
|
+
lead + `\uC5C5\uBB34 \uBC88\uD638(#N)\uAC00 \uC544\uB2CC \uB0B4\uBD80 ID \uB85C \uC9C0\uC815\uD558\uB824\uBA74 <project> \uB97C \uBE7C\uACE0 --id \uB97C \uC501\uB2C8\uB2E4:
|
|
3433
|
+
${completed}`,
|
|
2801
3434
|
EXIT_PARAM_ERROR
|
|
2802
3435
|
);
|
|
2803
3436
|
}
|
|
@@ -2822,7 +3455,7 @@ ${URL_FORMAT_HINT}`,
|
|
|
2822
3455
|
}
|
|
2823
3456
|
|
|
2824
3457
|
// src/commands/post/get.ts
|
|
2825
|
-
var postGetCommand = new
|
|
3458
|
+
var postGetCommand = new import_commander16.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) => {
|
|
2826
3459
|
const globalOpts = postGetCommand.optsWithGlobals();
|
|
2827
3460
|
const config = await getConfigOrThrow();
|
|
2828
3461
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -2831,7 +3464,8 @@ var postGetCommand = new import_commander14.Command("get").description("\uC5C5\u
|
|
|
2831
3464
|
projectArg: project,
|
|
2832
3465
|
postNumberArg: postNumberStr,
|
|
2833
3466
|
idOpt: opts.id,
|
|
2834
|
-
urlOpt: opts.url
|
|
3467
|
+
urlOpt: opts.url,
|
|
3468
|
+
argv: process.argv.slice(2)
|
|
2835
3469
|
});
|
|
2836
3470
|
const res = await client.getPost(projectId, postId);
|
|
2837
3471
|
stopSpinner(true, "\uC5C5\uBB34 \uC870\uD68C \uC644\uB8CC");
|
|
@@ -2839,7 +3473,7 @@ var postGetCommand = new import_commander14.Command("get").description("\uC5C5\u
|
|
|
2839
3473
|
});
|
|
2840
3474
|
|
|
2841
3475
|
// src/commands/post/edit.ts
|
|
2842
|
-
var
|
|
3476
|
+
var import_commander17 = require("commander");
|
|
2843
3477
|
|
|
2844
3478
|
// src/utils/mention.ts
|
|
2845
3479
|
function buildMemberMention(m, me) {
|
|
@@ -2992,7 +3626,7 @@ async function resolvePostRef(client, ref) {
|
|
|
2992
3626
|
|
|
2993
3627
|
// src/editor/index.ts
|
|
2994
3628
|
var import_node_child_process = require("child_process");
|
|
2995
|
-
var
|
|
3629
|
+
var import_promises7 = __toESM(require("fs/promises"));
|
|
2996
3630
|
var import_tmp = __toESM(require("tmp"));
|
|
2997
3631
|
var import_js_yaml = require("js-yaml");
|
|
2998
3632
|
function openInEditor(content) {
|
|
@@ -3006,7 +3640,7 @@ function openInEditor(content) {
|
|
|
3006
3640
|
const tmpFile = import_tmp.default.fileSync({ prefix: "dooray-", postfix: ".md" });
|
|
3007
3641
|
return new Promise(async (resolve, reject) => {
|
|
3008
3642
|
try {
|
|
3009
|
-
await
|
|
3643
|
+
await import_promises7.default.writeFile(tmpFile.name, content, "utf-8");
|
|
3010
3644
|
const child = (0, import_node_child_process.spawn)(editor2, [tmpFile.name], {
|
|
3011
3645
|
stdio: "inherit"
|
|
3012
3646
|
});
|
|
@@ -3022,7 +3656,7 @@ function openInEditor(content) {
|
|
|
3022
3656
|
EXIT_PARAM_ERROR
|
|
3023
3657
|
);
|
|
3024
3658
|
}
|
|
3025
|
-
const result = await
|
|
3659
|
+
const result = await import_promises7.default.readFile(tmpFile.name, "utf-8");
|
|
3026
3660
|
resolve(result);
|
|
3027
3661
|
} catch (e) {
|
|
3028
3662
|
reject(e);
|
|
@@ -3115,40 +3749,6 @@ function parseWikiFrontmatter(content) {
|
|
|
3115
3749
|
};
|
|
3116
3750
|
}
|
|
3117
3751
|
|
|
3118
|
-
// src/utils/body-input.ts
|
|
3119
|
-
var import_promises7 = require("fs/promises");
|
|
3120
|
-
async function readBodyInput(opts) {
|
|
3121
|
-
if (opts.body != null && opts.bodyFile != null) {
|
|
3122
|
-
throw new DoorayCliError(
|
|
3123
|
-
"--body\uC640 --body-file\uC740 \uD568\uAED8 \uC0AC\uC6A9\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.",
|
|
3124
|
-
EXIT_PARAM_ERROR
|
|
3125
|
-
);
|
|
3126
|
-
}
|
|
3127
|
-
if (opts.bodyFile) {
|
|
3128
|
-
if (opts.bodyFile === "-") return readStdin();
|
|
3129
|
-
return (0, import_promises7.readFile)(opts.bodyFile, "utf-8");
|
|
3130
|
-
}
|
|
3131
|
-
if (opts.body === "-") return readStdin();
|
|
3132
|
-
return opts.body ?? "";
|
|
3133
|
-
}
|
|
3134
|
-
async function readBodyInputOrNull(opts) {
|
|
3135
|
-
if (opts.body == null && opts.bodyFile == null) return null;
|
|
3136
|
-
return readBodyInput(opts);
|
|
3137
|
-
}
|
|
3138
|
-
async function readStdin() {
|
|
3139
|
-
if (process.stdin.isTTY) {
|
|
3140
|
-
throw new DoorayCliError(
|
|
3141
|
-
"stdin\uC5D0\uC11C \uC77D\uC73C\uB824\uBA74 \uD30C\uC774\uD504\uB85C \uB370\uC774\uD130\uB97C \uC804\uB2EC\uD574\uC8FC\uC138\uC694.",
|
|
3142
|
-
EXIT_PARAM_ERROR
|
|
3143
|
-
);
|
|
3144
|
-
}
|
|
3145
|
-
const chunks = [];
|
|
3146
|
-
for await (const chunk of process.stdin) {
|
|
3147
|
-
chunks.push(chunk);
|
|
3148
|
-
}
|
|
3149
|
-
return Buffer.concat(chunks).toString("utf-8");
|
|
3150
|
-
}
|
|
3151
|
-
|
|
3152
3752
|
// src/utils/attachment-check.ts
|
|
3153
3753
|
var import_node_readline = __toESM(require("readline"));
|
|
3154
3754
|
function extractAttachmentReferences(body) {
|
|
@@ -3230,7 +3830,7 @@ async function resolveUsers(client, projectId, names) {
|
|
|
3230
3830
|
}
|
|
3231
3831
|
return users;
|
|
3232
3832
|
}
|
|
3233
|
-
var postEditCommand = new
|
|
3833
|
+
var postEditCommand = new import_commander17.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) => {
|
|
3234
3834
|
const config = await getConfigOrThrow();
|
|
3235
3835
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
3236
3836
|
const mentionInputs = (opts.mention ?? []).filter((s) => s.length > 0);
|
|
@@ -3249,7 +3849,8 @@ var postEditCommand = new import_commander15.Command("edit").description("\uC5C5
|
|
|
3249
3849
|
projectArg: project,
|
|
3250
3850
|
postNumberArg: postNumberStr,
|
|
3251
3851
|
idOpt: opts.id,
|
|
3252
|
-
urlOpt: opts.url
|
|
3852
|
+
urlOpt: opts.url,
|
|
3853
|
+
argv: process.argv.slice(2)
|
|
3253
3854
|
});
|
|
3254
3855
|
const res = await client.getPost(projectId, postId);
|
|
3255
3856
|
const post = res.result;
|
|
@@ -3408,7 +4009,7 @@ var postEditCommand = new import_commander15.Command("edit").description("\uC5C5
|
|
|
3408
4009
|
});
|
|
3409
4010
|
|
|
3410
4011
|
// src/commands/post/create.ts
|
|
3411
|
-
var
|
|
4012
|
+
var import_commander18 = require("commander");
|
|
3412
4013
|
|
|
3413
4014
|
// src/resolvers/milestone.ts
|
|
3414
4015
|
async function fetchAllMilestones(client, projectId) {
|
|
@@ -3454,7 +4055,7 @@ function postUserToCreate(u) {
|
|
|
3454
4055
|
group: u.group
|
|
3455
4056
|
};
|
|
3456
4057
|
}
|
|
3457
|
-
var postCreateCommand = new
|
|
4058
|
+
var postCreateCommand = new import_commander18.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)").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) => {
|
|
3458
4059
|
const globalOpts = postCreateCommand.optsWithGlobals();
|
|
3459
4060
|
const config = await getConfigOrThrow();
|
|
3460
4061
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -3591,8 +4192,8 @@ var postCreateCommand = new import_commander16.Command("create").description("\u
|
|
|
3591
4192
|
});
|
|
3592
4193
|
|
|
3593
4194
|
// src/commands/post/done.ts
|
|
3594
|
-
var
|
|
3595
|
-
var postDoneCommand = new
|
|
4195
|
+
var import_commander19 = require("commander");
|
|
4196
|
+
var postDoneCommand = new import_commander19.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) => {
|
|
3596
4197
|
const config = await getConfigOrThrow();
|
|
3597
4198
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
3598
4199
|
startSpinner("\uC5C5\uBB34 \uC644\uB8CC \uCC98\uB9AC \uC911...");
|
|
@@ -3600,7 +4201,8 @@ var postDoneCommand = new import_commander17.Command("done").description("\uC5C5
|
|
|
3600
4201
|
projectArg: project,
|
|
3601
4202
|
postNumberArg: postNumberStr,
|
|
3602
4203
|
idOpt: opts.id,
|
|
3603
|
-
urlOpt: opts.url
|
|
4204
|
+
urlOpt: opts.url,
|
|
4205
|
+
argv: process.argv.slice(2)
|
|
3604
4206
|
});
|
|
3605
4207
|
await client.setPostDone(projectId, postId);
|
|
3606
4208
|
stopSpinner(true, "\uC5C5\uBB34 \uC644\uB8CC \uCC98\uB9AC \uC644\uB8CC");
|
|
@@ -3609,8 +4211,8 @@ var postDoneCommand = new import_commander17.Command("done").description("\uC5C5
|
|
|
3609
4211
|
});
|
|
3610
4212
|
|
|
3611
4213
|
// src/commands/post/workflow.ts
|
|
3612
|
-
var
|
|
3613
|
-
var postWorkflowCommand = new
|
|
4214
|
+
var import_commander20 = require("commander");
|
|
4215
|
+
var postWorkflowCommand = new import_commander20.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) => {
|
|
3614
4216
|
const config = await getConfigOrThrow();
|
|
3615
4217
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
3616
4218
|
let workflowInput = opts.workflow;
|
|
@@ -3640,7 +4242,8 @@ var postWorkflowCommand = new import_commander18.Command("workflow").description
|
|
|
3640
4242
|
projectArg,
|
|
3641
4243
|
postNumberArg,
|
|
3642
4244
|
idOpt: opts.id,
|
|
3643
|
-
urlOpt: opts.url
|
|
4245
|
+
urlOpt: opts.url,
|
|
4246
|
+
argv: process.argv.slice(2)
|
|
3644
4247
|
});
|
|
3645
4248
|
const workflowId = await resolveWorkflow(client, projectId, workflowInput);
|
|
3646
4249
|
await client.setPostWorkflow(projectId, postId, workflowId);
|
|
@@ -3650,7 +4253,7 @@ var postWorkflowCommand = new import_commander18.Command("workflow").description
|
|
|
3650
4253
|
});
|
|
3651
4254
|
|
|
3652
4255
|
// src/commands/post/comment/list.ts
|
|
3653
|
-
var
|
|
4256
|
+
var import_commander21 = require("commander");
|
|
3654
4257
|
|
|
3655
4258
|
// src/utils/comment-enrich.ts
|
|
3656
4259
|
function enrichCommentCreators(comments, nameMap) {
|
|
@@ -3727,7 +4330,7 @@ async function fetchSince(client, projectId, postId, sinceDate) {
|
|
|
3727
4330
|
}
|
|
3728
4331
|
return collected;
|
|
3729
4332
|
}
|
|
3730
|
-
var commentListCommand = new
|
|
4333
|
+
var commentListCommand = new import_commander21.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) => {
|
|
3731
4334
|
const globalOpts = commentListCommand.optsWithGlobals();
|
|
3732
4335
|
const config = await getConfigOrThrow();
|
|
3733
4336
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -3747,7 +4350,8 @@ var commentListCommand = new import_commander19.Command("list").description("\uB
|
|
|
3747
4350
|
projectArg: project,
|
|
3748
4351
|
postNumberArg: postNumberStr,
|
|
3749
4352
|
idOpt: opts.id,
|
|
3750
|
-
urlOpt: opts.url
|
|
4353
|
+
urlOpt: opts.url,
|
|
4354
|
+
argv: process.argv.slice(2)
|
|
3751
4355
|
});
|
|
3752
4356
|
const order = resolveOrder(opts);
|
|
3753
4357
|
let comments;
|
|
@@ -3789,8 +4393,8 @@ var commentListCommand = new import_commander19.Command("list").description("\uB
|
|
|
3789
4393
|
});
|
|
3790
4394
|
|
|
3791
4395
|
// src/commands/post/comment/latest.ts
|
|
3792
|
-
var
|
|
3793
|
-
var commentLatestCommand = new
|
|
4396
|
+
var import_commander22 = require("commander");
|
|
4397
|
+
var commentLatestCommand = new import_commander22.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) => {
|
|
3794
4398
|
const globalOpts = commentLatestCommand.optsWithGlobals();
|
|
3795
4399
|
const config = await getConfigOrThrow();
|
|
3796
4400
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -3806,7 +4410,8 @@ var commentLatestCommand = new import_commander20.Command("latest").description(
|
|
|
3806
4410
|
projectArg: project,
|
|
3807
4411
|
postNumberArg: postNumberStr,
|
|
3808
4412
|
idOpt: opts.id,
|
|
3809
|
-
urlOpt: opts.url
|
|
4413
|
+
urlOpt: opts.url,
|
|
4414
|
+
argv: process.argv.slice(2)
|
|
3810
4415
|
});
|
|
3811
4416
|
const res = await client.getPostComments(projectId, postId, {
|
|
3812
4417
|
page: 0,
|
|
@@ -3827,8 +4432,8 @@ var commentLatestCommand = new import_commander20.Command("latest").description(
|
|
|
3827
4432
|
});
|
|
3828
4433
|
|
|
3829
4434
|
// src/commands/post/comment/add.ts
|
|
3830
|
-
var
|
|
3831
|
-
var commentAddCommand = new
|
|
4435
|
+
var import_commander23 = require("commander");
|
|
4436
|
+
var commentAddCommand = new import_commander23.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(
|
|
3832
4437
|
"--mention <name>",
|
|
3833
4438
|
"\uBA64\uBC84 \uBA58\uC158 (\uBC18\uBCF5 \uAC00\uB2A5, \uC774\uB984 \uBD80\uBD84\uC77C\uCE58)",
|
|
3834
4439
|
(value, prev) => [...prev, value],
|
|
@@ -3855,7 +4460,8 @@ var commentAddCommand = new import_commander21.Command("add").description("\uB31
|
|
|
3855
4460
|
projectArg: project,
|
|
3856
4461
|
postNumberArg: postNumberStr,
|
|
3857
4462
|
idOpt: opts.id,
|
|
3858
|
-
urlOpt: opts.url
|
|
4463
|
+
urlOpt: opts.url,
|
|
4464
|
+
argv: process.argv.slice(2)
|
|
3859
4465
|
});
|
|
3860
4466
|
const mentionInputs = (opts.mention ?? []).filter((s) => s.length > 0);
|
|
3861
4467
|
const groupInputs = (opts.mentionGroup ?? []).filter((s) => s.length > 0);
|
|
@@ -3907,8 +4513,8 @@ var commentAddCommand = new import_commander21.Command("add").description("\uB31
|
|
|
3907
4513
|
});
|
|
3908
4514
|
|
|
3909
4515
|
// src/commands/post/comment/edit.ts
|
|
3910
|
-
var
|
|
3911
|
-
var commentEditCommand = new
|
|
4516
|
+
var import_commander24 = require("commander");
|
|
4517
|
+
var commentEditCommand = new import_commander24.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(
|
|
3912
4518
|
"--mention <name>",
|
|
3913
4519
|
"\uBA64\uBC84 \uBA58\uC158 (\uBC18\uBCF5 \uAC00\uB2A5, \uC774\uB984 \uBD80\uBD84\uC77C\uCE58)",
|
|
3914
4520
|
(value, prev) => [...prev, value],
|
|
@@ -3965,7 +4571,8 @@ var commentEditCommand = new import_commander22.Command("edit").description("\uB
|
|
|
3965
4571
|
projectArg,
|
|
3966
4572
|
postNumberArg,
|
|
3967
4573
|
idOpt: opts.id,
|
|
3968
|
-
urlOpt: opts.url
|
|
4574
|
+
urlOpt: opts.url,
|
|
4575
|
+
argv: process.argv.slice(2)
|
|
3969
4576
|
});
|
|
3970
4577
|
const comments = await client.getPostComments(projectId, postId);
|
|
3971
4578
|
const comment = comments.result.find((c) => c.id === commentId);
|
|
@@ -4036,7 +4643,7 @@ var commentEditCommand = new import_commander22.Command("edit").description("\uB
|
|
|
4036
4643
|
});
|
|
4037
4644
|
|
|
4038
4645
|
// src/commands/post/comment/delete.ts
|
|
4039
|
-
var
|
|
4646
|
+
var import_commander25 = require("commander");
|
|
4040
4647
|
|
|
4041
4648
|
// src/utils/delete-confirmation.ts
|
|
4042
4649
|
async function authorizeDeletion(skipConfirmation, isTTY, confirmDeletion) {
|
|
@@ -4057,7 +4664,7 @@ async function promptDeletion(message) {
|
|
|
4057
4664
|
}
|
|
4058
4665
|
|
|
4059
4666
|
// src/commands/post/comment/delete.ts
|
|
4060
|
-
var commentDeleteCommand = new
|
|
4667
|
+
var commentDeleteCommand = new import_commander25.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)").option("-y, --yes", "\uD655\uC778 \uC5C6\uC774 \uC0AD\uC81C (\uC790\uB3D9\uD654\uC6A9)").action(async (arg1, arg2, arg3, opts) => {
|
|
4061
4668
|
const confirmed = await authorizeDeletion(
|
|
4062
4669
|
!!opts.yes,
|
|
4063
4670
|
!!process.stdin.isTTY,
|
|
@@ -4113,7 +4720,8 @@ var commentDeleteCommand = new import_commander23.Command("delete").description(
|
|
|
4113
4720
|
projectArg,
|
|
4114
4721
|
postNumberArg,
|
|
4115
4722
|
idOpt: opts.id,
|
|
4116
|
-
urlOpt: opts.url
|
|
4723
|
+
urlOpt: opts.url,
|
|
4724
|
+
argv: process.argv.slice(2)
|
|
4117
4725
|
});
|
|
4118
4726
|
await client.deletePostComment(projectId, postId, commentId);
|
|
4119
4727
|
stopSpinner(true, "\uB313\uAE00 \uC0AD\uC81C \uC644\uB8CC");
|
|
@@ -4122,7 +4730,7 @@ var commentDeleteCommand = new import_commander23.Command("delete").description(
|
|
|
4122
4730
|
});
|
|
4123
4731
|
|
|
4124
4732
|
// src/commands/post/comment/get.ts
|
|
4125
|
-
var
|
|
4733
|
+
var import_commander26 = require("commander");
|
|
4126
4734
|
|
|
4127
4735
|
// src/utils/format-size.ts
|
|
4128
4736
|
function formatSize(bytes) {
|
|
@@ -4204,7 +4812,7 @@ function parseGetArgs(arg1, arg2, arg3, opts) {
|
|
|
4204
4812
|
EXIT_PARAM_ERROR
|
|
4205
4813
|
);
|
|
4206
4814
|
}
|
|
4207
|
-
var commentGetCommand = new
|
|
4815
|
+
var commentGetCommand = new import_commander26.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) => {
|
|
4208
4816
|
const parsed = parseGetArgs(arg1, arg2, arg3, opts);
|
|
4209
4817
|
const config = await getConfigOrThrow();
|
|
4210
4818
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -4217,7 +4825,8 @@ var commentGetCommand = new import_commander24.Command("get").description("\uB2E
|
|
|
4217
4825
|
projectArg: parsed.projectArg,
|
|
4218
4826
|
postNumberArg: parsed.postNumberArg,
|
|
4219
4827
|
idOpt: parsed.idOpt,
|
|
4220
|
-
urlOpt: parsed.urlOpt
|
|
4828
|
+
urlOpt: parsed.urlOpt,
|
|
4829
|
+
argv: process.argv.slice(2)
|
|
4221
4830
|
});
|
|
4222
4831
|
projectId = resolved.projectId;
|
|
4223
4832
|
const detail = await client.getPostComment(resolved.projectId, resolved.postId, parsed.commentId);
|
|
@@ -4239,10 +4848,10 @@ var commentGetCommand = new import_commander24.Command("get").description("\uB2E
|
|
|
4239
4848
|
});
|
|
4240
4849
|
|
|
4241
4850
|
// src/commands/post/comment/file/index.ts
|
|
4242
|
-
var
|
|
4851
|
+
var import_commander31 = require("commander");
|
|
4243
4852
|
|
|
4244
4853
|
// src/commands/post/comment/file/list.ts
|
|
4245
|
-
var
|
|
4854
|
+
var import_commander27 = require("commander");
|
|
4246
4855
|
|
|
4247
4856
|
// src/resolvers/comment-file-input.ts
|
|
4248
4857
|
var FILE_ID_SECONDARY_LABEL = {
|
|
@@ -4306,7 +4915,8 @@ async function resolveCommentFileInput(client, args) {
|
|
|
4306
4915
|
projectArg,
|
|
4307
4916
|
postNumberArg,
|
|
4308
4917
|
idOpt: args.idOpt,
|
|
4309
|
-
urlOpt: args.urlOpt
|
|
4918
|
+
urlOpt: args.urlOpt,
|
|
4919
|
+
argv: args.argv
|
|
4310
4920
|
});
|
|
4311
4921
|
return { projectId, postId, commentId, secondary };
|
|
4312
4922
|
}
|
|
@@ -4358,7 +4968,7 @@ function formatSource(source) {
|
|
|
4358
4968
|
if (source === "body-link") return "\uBCF8\uBB38 \uB9C1\uD06C";
|
|
4359
4969
|
return "\uB458 \uB2E4";
|
|
4360
4970
|
}
|
|
4361
|
-
var listCommentFileCommand = new
|
|
4971
|
+
var listCommentFileCommand = new import_commander27.Command("list").description("\uB313\uAE00 \uCCA8\uBD80 \uD30C\uC77C\uACFC \uBCF8\uBB38 \uD30C\uC77C \uB9C1\uD06C \uBAA9\uB85D \uD1B5\uD569 \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) => {
|
|
4362
4972
|
const globalOpts = listCommentFileCommand.optsWithGlobals();
|
|
4363
4973
|
const config = await getConfigOrThrow();
|
|
4364
4974
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -4368,6 +4978,7 @@ var listCommentFileCommand = new import_commander25.Command("list").description(
|
|
|
4368
4978
|
arg3,
|
|
4369
4979
|
idOpt: opts.id,
|
|
4370
4980
|
urlOpt: opts.url,
|
|
4981
|
+
argv: process.argv.slice(2),
|
|
4371
4982
|
commentIdOpt: opts.commentId,
|
|
4372
4983
|
requireSecondary: false
|
|
4373
4984
|
});
|
|
@@ -4419,7 +5030,7 @@ var listCommentFileCommand = new import_commander25.Command("list").description(
|
|
|
4419
5030
|
});
|
|
4420
5031
|
|
|
4421
5032
|
// src/commands/post/comment/file/upload.ts
|
|
4422
|
-
var
|
|
5033
|
+
var import_commander28 = require("commander");
|
|
4423
5034
|
var import_node_path7 = require("path");
|
|
4424
5035
|
|
|
4425
5036
|
// src/utils/comment-files.ts
|
|
@@ -4442,7 +5053,7 @@ function removeFileReference(body, fileId) {
|
|
|
4442
5053
|
}
|
|
4443
5054
|
|
|
4444
5055
|
// src/commands/post/comment/file/upload.ts
|
|
4445
|
-
var uploadCommentFileCommand = new
|
|
5056
|
+
var uploadCommentFileCommand = new import_commander28.Command("upload").description("\uB313\uAE00\uC5D0 \uD30C\uC77C \uC5C5\uB85C\uB4DC (\uCCA8\uBD80 \uCE74\uB4DC\uAC00 \uC544\uB2CC \uBCF8\uBB38 \uB9C1\uD06C\uB85C \uD45C\uC2DC)").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) => {
|
|
4446
5057
|
const globalOpts = uploadCommentFileCommand.optsWithGlobals();
|
|
4447
5058
|
const config = await getConfigOrThrow();
|
|
4448
5059
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -4453,6 +5064,7 @@ var uploadCommentFileCommand = new import_commander26.Command("upload").descript
|
|
|
4453
5064
|
arg4,
|
|
4454
5065
|
idOpt: opts.id,
|
|
4455
5066
|
urlOpt: opts.url,
|
|
5067
|
+
argv: process.argv.slice(2),
|
|
4456
5068
|
commentIdOpt: opts.commentId,
|
|
4457
5069
|
secondaryOpt: opts.file,
|
|
4458
5070
|
requireSecondary: true,
|
|
@@ -4491,10 +5103,10 @@ var uploadCommentFileCommand = new import_commander26.Command("upload").descript
|
|
|
4491
5103
|
});
|
|
4492
5104
|
|
|
4493
5105
|
// src/commands/post/comment/file/download.ts
|
|
4494
|
-
var
|
|
5106
|
+
var import_commander29 = require("commander");
|
|
4495
5107
|
var import_promises8 = require("fs/promises");
|
|
4496
5108
|
var import_node_path8 = require("path");
|
|
4497
|
-
var downloadCommentFileCommand = new
|
|
5109
|
+
var downloadCommentFileCommand = new import_commander29.Command("download").description(
|
|
4498
5110
|
"\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)"
|
|
4499
5111
|
).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) => {
|
|
4500
5112
|
const config = await getConfigOrThrow();
|
|
@@ -4506,6 +5118,7 @@ var downloadCommentFileCommand = new import_commander27.Command("download").desc
|
|
|
4506
5118
|
arg4,
|
|
4507
5119
|
idOpt: opts.id,
|
|
4508
5120
|
urlOpt: opts.url,
|
|
5121
|
+
argv: process.argv.slice(2),
|
|
4509
5122
|
commentIdOpt: opts.commentId,
|
|
4510
5123
|
secondaryOpt: opts.fileId,
|
|
4511
5124
|
requireSecondary: true,
|
|
@@ -4522,8 +5135,8 @@ var downloadCommentFileCommand = new import_commander27.Command("download").desc
|
|
|
4522
5135
|
});
|
|
4523
5136
|
|
|
4524
5137
|
// src/commands/post/comment/file/delete.ts
|
|
4525
|
-
var
|
|
4526
|
-
var deleteCommentFileCommand = new
|
|
5138
|
+
var import_commander30 = require("commander");
|
|
5139
|
+
var deleteCommentFileCommand = new import_commander30.Command("delete").description("\uB313\uAE00 \uCCA8\uBD80 \uD30C\uC77C \uC0AD\uC81C (\uBCF8\uBB38 reference \uC81C\uAC70\uC640 \uD30C\uC77C \uC0AD\uC81C\uB97C \uD568\uAED8 \uC218\uD589)").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("-y, --yes", "\uD655\uC778 \uC5C6\uC774 \uC0AD\uC81C (\uC790\uB3D9\uD654\uC6A9)").action(async (arg1, arg2, arg3, arg4, opts) => {
|
|
4527
5140
|
const confirmed = await authorizeDeletion(
|
|
4528
5141
|
!!opts.yes,
|
|
4529
5142
|
!!process.stdin.isTTY,
|
|
@@ -4544,6 +5157,7 @@ var deleteCommentFileCommand = new import_commander28.Command("delete").descript
|
|
|
4544
5157
|
arg4,
|
|
4545
5158
|
idOpt: opts.id,
|
|
4546
5159
|
urlOpt: opts.url,
|
|
5160
|
+
argv: process.argv.slice(2),
|
|
4547
5161
|
commentIdOpt: opts.commentId,
|
|
4548
5162
|
secondaryOpt: opts.fileId,
|
|
4549
5163
|
requireSecondary: true,
|
|
@@ -4581,11 +5195,11 @@ var deleteCommentFileCommand = new import_commander28.Command("delete").descript
|
|
|
4581
5195
|
});
|
|
4582
5196
|
|
|
4583
5197
|
// src/commands/post/comment/file/index.ts
|
|
4584
|
-
var commentFileCommand = new
|
|
5198
|
+
var commentFileCommand = new import_commander31.Command("file").description("\uB313\uAE00 \uCCA8\uBD80 \uD30C\uC77C \uAD00\uB9AC").addCommand(listCommentFileCommand).addCommand(uploadCommentFileCommand).addCommand(downloadCommentFileCommand).addCommand(deleteCommentFileCommand);
|
|
4585
5199
|
|
|
4586
5200
|
// src/commands/post/file/list.ts
|
|
4587
|
-
var
|
|
4588
|
-
var fileListCommand = new
|
|
5201
|
+
var import_commander32 = require("commander");
|
|
5202
|
+
var fileListCommand = new import_commander32.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) => {
|
|
4589
5203
|
const globalOpts = fileListCommand.optsWithGlobals();
|
|
4590
5204
|
const config = await getConfigOrThrow();
|
|
4591
5205
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -4594,7 +5208,8 @@ var fileListCommand = new import_commander30.Command("list").description("\uC5C5
|
|
|
4594
5208
|
projectArg: project,
|
|
4595
5209
|
postNumberArg: postNumberStr,
|
|
4596
5210
|
idOpt: opts.id,
|
|
4597
|
-
urlOpt: opts.url
|
|
5211
|
+
urlOpt: opts.url,
|
|
5212
|
+
argv: process.argv.slice(2)
|
|
4598
5213
|
});
|
|
4599
5214
|
const res = await client.getPostFiles(projectId, postId);
|
|
4600
5215
|
stopSpinner(true, `\uCCA8\uBD80\uD30C\uC77C ${res.result.length}\uAC1C`);
|
|
@@ -4613,7 +5228,7 @@ var fileListCommand = new import_commander30.Command("list").description("\uC5C5
|
|
|
4613
5228
|
});
|
|
4614
5229
|
|
|
4615
5230
|
// src/commands/post/file/download.ts
|
|
4616
|
-
var
|
|
5231
|
+
var import_commander33 = require("commander");
|
|
4617
5232
|
var import_promises9 = require("fs/promises");
|
|
4618
5233
|
var import_node_path9 = require("path");
|
|
4619
5234
|
|
|
@@ -4659,7 +5274,7 @@ function emitDeleteResult(globalOpts, result) {
|
|
|
4659
5274
|
}
|
|
4660
5275
|
|
|
4661
5276
|
// src/commands/post/file/download.ts
|
|
4662
|
-
var fileDownloadCommand = new
|
|
5277
|
+
var fileDownloadCommand = new import_commander33.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) => {
|
|
4663
5278
|
const globalOpts = fileDownloadCommand.optsWithGlobals();
|
|
4664
5279
|
const config = await getConfigOrThrow();
|
|
4665
5280
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -4704,7 +5319,8 @@ var fileDownloadCommand = new import_commander31.Command("download").description
|
|
|
4704
5319
|
projectArg,
|
|
4705
5320
|
postNumberArg,
|
|
4706
5321
|
idOpt: opts.id,
|
|
4707
|
-
urlOpt: opts.url
|
|
5322
|
+
urlOpt: opts.url,
|
|
5323
|
+
argv: process.argv.slice(2)
|
|
4708
5324
|
});
|
|
4709
5325
|
const { buffer, fileName } = await client.downloadPostFile(projectId, postId, fileId);
|
|
4710
5326
|
const safeName = (0, import_node_path9.basename)(decodeURIComponent(fileName));
|
|
@@ -4715,10 +5331,10 @@ var fileDownloadCommand = new import_commander31.Command("download").description
|
|
|
4715
5331
|
});
|
|
4716
5332
|
|
|
4717
5333
|
// src/commands/post/file/download-all.ts
|
|
4718
|
-
var
|
|
5334
|
+
var import_commander34 = require("commander");
|
|
4719
5335
|
var import_promises10 = require("fs/promises");
|
|
4720
5336
|
var import_node_path10 = require("path");
|
|
4721
|
-
var fileDownloadAllCommand = new
|
|
5337
|
+
var fileDownloadAllCommand = new import_commander34.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) => {
|
|
4722
5338
|
const globalOpts = fileDownloadAllCommand.optsWithGlobals();
|
|
4723
5339
|
const config = await getConfigOrThrow();
|
|
4724
5340
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -4727,7 +5343,8 @@ var fileDownloadAllCommand = new import_commander32.Command("download-all").desc
|
|
|
4727
5343
|
projectArg: project,
|
|
4728
5344
|
postNumberArg: postNumberStr,
|
|
4729
5345
|
idOpt: opts.id,
|
|
4730
|
-
urlOpt: opts.url
|
|
5346
|
+
urlOpt: opts.url,
|
|
5347
|
+
argv: process.argv.slice(2)
|
|
4731
5348
|
});
|
|
4732
5349
|
const res = await client.getPostFiles(projectId, postId);
|
|
4733
5350
|
if (res.result.length === 0) {
|
|
@@ -4767,9 +5384,9 @@ var fileDownloadAllCommand = new import_commander32.Command("download-all").desc
|
|
|
4767
5384
|
});
|
|
4768
5385
|
|
|
4769
5386
|
// src/commands/post/file/upload.ts
|
|
4770
|
-
var
|
|
5387
|
+
var import_commander35 = require("commander");
|
|
4771
5388
|
var import_node_path11 = require("path");
|
|
4772
|
-
var fileUploadCommand = new
|
|
5389
|
+
var fileUploadCommand = new import_commander35.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) => {
|
|
4773
5390
|
const globalOpts = fileUploadCommand.optsWithGlobals();
|
|
4774
5391
|
const config = await getConfigOrThrow();
|
|
4775
5392
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -4814,7 +5431,8 @@ var fileUploadCommand = new import_commander33.Command("upload").description("\u
|
|
|
4814
5431
|
projectArg,
|
|
4815
5432
|
postNumberArg,
|
|
4816
5433
|
idOpt: opts.id,
|
|
4817
|
-
urlOpt: opts.url
|
|
5434
|
+
urlOpt: opts.url,
|
|
5435
|
+
argv: process.argv.slice(2)
|
|
4818
5436
|
});
|
|
4819
5437
|
const res = await client.uploadPostFile(projectId, postId, filePath);
|
|
4820
5438
|
stopSpinner(true, "\uC5C5\uB85C\uB4DC \uC644\uB8CC");
|
|
@@ -4830,8 +5448,8 @@ var fileUploadCommand = new import_commander33.Command("upload").description("\u
|
|
|
4830
5448
|
});
|
|
4831
5449
|
|
|
4832
5450
|
// src/commands/post/file/delete.ts
|
|
4833
|
-
var
|
|
4834
|
-
var fileDeleteCommand = new
|
|
5451
|
+
var import_commander36 = require("commander");
|
|
5452
|
+
var fileDeleteCommand = new import_commander36.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)").option("-y, --yes", "\uD655\uC778 \uC5C6\uC774 \uC0AD\uC81C (\uC790\uB3D9\uD654\uC6A9)").action(async (arg1, arg2, arg3, opts) => {
|
|
4835
5453
|
const confirmed = await authorizeDeletion(
|
|
4836
5454
|
!!opts.yes,
|
|
4837
5455
|
!!process.stdin.isTTY,
|
|
@@ -4885,7 +5503,8 @@ var fileDeleteCommand = new import_commander34.Command("delete").description("\u
|
|
|
4885
5503
|
projectArg,
|
|
4886
5504
|
postNumberArg,
|
|
4887
5505
|
idOpt: opts.id,
|
|
4888
|
-
urlOpt: opts.url
|
|
5506
|
+
urlOpt: opts.url,
|
|
5507
|
+
argv: process.argv.slice(2)
|
|
4889
5508
|
});
|
|
4890
5509
|
await client.deletePostFile(projectId, postId, fileId);
|
|
4891
5510
|
stopSpinner(true, "\uC0AD\uC81C \uC644\uB8CC");
|
|
@@ -4893,13 +5512,18 @@ var fileDeleteCommand = new import_commander34.Command("delete").description("\u
|
|
|
4893
5512
|
});
|
|
4894
5513
|
|
|
4895
5514
|
// src/commands/wiki/list.ts
|
|
4896
|
-
var
|
|
5515
|
+
var import_commander37 = require("commander");
|
|
4897
5516
|
|
|
4898
5517
|
// src/formatters/wiki.ts
|
|
4899
|
-
function formatWikiList(wikis, opts) {
|
|
5518
|
+
function formatWikiList(wikis, opts, codeByProjectId) {
|
|
4900
5519
|
output(opts, {
|
|
4901
|
-
headers: ["ID", "Name", "Type"],
|
|
4902
|
-
rows: wikis.map((w) => [
|
|
5520
|
+
headers: ["ID", "Name", "Project", "Type"],
|
|
5521
|
+
rows: wikis.map((w) => [
|
|
5522
|
+
w.id,
|
|
5523
|
+
w.name,
|
|
5524
|
+
codeByProjectId.get(w.project.id) ?? w.project.id,
|
|
5525
|
+
w.type
|
|
5526
|
+
]),
|
|
4903
5527
|
raw: wikis,
|
|
4904
5528
|
ids: wikis.map((w) => w.id)
|
|
4905
5529
|
});
|
|
@@ -4984,24 +5608,25 @@ function formatWikiPageDetail(page, opts) {
|
|
|
4984
5608
|
process.stdout.write(lines.join("\n") + "\n");
|
|
4985
5609
|
}
|
|
4986
5610
|
|
|
4987
|
-
// src/commands/wiki/list.ts
|
|
4988
|
-
var wikiListCommand = new import_commander35.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) => {
|
|
4989
|
-
const globalOpts = wikiListCommand.optsWithGlobals();
|
|
4990
|
-
const config = await getConfigOrThrow();
|
|
4991
|
-
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
4992
|
-
startSpinner("\uC704\uD0A4 \uBAA9\uB85D \uC870\uD68C \uC911...");
|
|
4993
|
-
const res = await client.getWikis({
|
|
4994
|
-
page: Number(opts.page),
|
|
4995
|
-
size: Number(opts.size)
|
|
4996
|
-
});
|
|
4997
|
-
stopSpinner(true, "\uC704\uD0A4 \uBAA9\uB85D \uC870\uD68C \uC644\uB8CC");
|
|
4998
|
-
formatWikiList(res.result, globalOpts);
|
|
4999
|
-
});
|
|
5000
|
-
|
|
5001
|
-
// src/commands/wiki/pages.ts
|
|
5002
|
-
var import_commander36 = require("commander");
|
|
5003
|
-
|
|
5004
5611
|
// src/resolvers/wiki.ts
|
|
5612
|
+
async function fetchAllWikis(client) {
|
|
5613
|
+
const all = [];
|
|
5614
|
+
let page = 0;
|
|
5615
|
+
const size = 100;
|
|
5616
|
+
while (true) {
|
|
5617
|
+
const res = await client.getWikis({ page, size });
|
|
5618
|
+
if (res.result.length === 0) break;
|
|
5619
|
+
all.push(...res.result);
|
|
5620
|
+
if (all.length >= res.totalCount) break;
|
|
5621
|
+
page++;
|
|
5622
|
+
}
|
|
5623
|
+
return all;
|
|
5624
|
+
}
|
|
5625
|
+
function filterWikisByName(wikis, keyword) {
|
|
5626
|
+
if (keyword === "") return wikis;
|
|
5627
|
+
const lowerKeyword = keyword.toLowerCase();
|
|
5628
|
+
return wikis.filter((w) => w.name.toLowerCase().includes(lowerKeyword));
|
|
5629
|
+
}
|
|
5005
5630
|
async function resolveWiki(client, projectCode) {
|
|
5006
5631
|
await resolveProject(client, projectCode);
|
|
5007
5632
|
const entry = await getProjects();
|
|
@@ -5009,8 +5634,9 @@ async function resolveWiki(client, projectCode) {
|
|
|
5009
5634
|
(p) => p.code === projectCode || p.id === projectCode
|
|
5010
5635
|
);
|
|
5011
5636
|
if (!project?.wikiId) {
|
|
5637
|
+
const orgIdHint = PROJECT_ID_RE.test(projectCode) ? "\n \uC704\uD0A4 \uBCF8\uBB38\uC758 \uD398\uC774\uC9C0 \uB9C1\uD06C\uB294 dooray://<orgId>/pages/<pageId> \uD615\uD0DC\uC774\uACE0, \uC55E \uC22B\uC790\uB294 orgId \uC785\uB2C8\uB2E4.\n orgId \uB294 project \uB3C4 \uC704\uD0A4 ID \uB3C4 \uC544\uB2C8\uBBC0\uB85C project \uC790\uB9AC\uC5D0 \uB123\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.\n \uADF8 \uB9C1\uD06C\uC758 \uB4A4 \uC22B\uC790\uAC00 \uD398\uC774\uC9C0 ID \uC774\uBBC0\uB85C project \uC5C6\uC774 \uC870\uD68C\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4:\n dooray wiki page get --id <\uD398\uC774\uC9C0 ID>" : "";
|
|
5012
5638
|
throw new DoorayCliError(
|
|
5013
|
-
`\uD504\uB85C\uC81D\uD2B8\uC5D0 \uC704\uD0A4\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4: ${projectCode}`,
|
|
5639
|
+
`\uD504\uB85C\uC81D\uD2B8\uC5D0 \uC704\uD0A4\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4: ${projectCode}${orgIdHint}`,
|
|
5014
5640
|
EXIT_PARAM_ERROR
|
|
5015
5641
|
);
|
|
5016
5642
|
}
|
|
@@ -5023,8 +5649,8 @@ async function resolveWikiHomePageId(client, wikiId) {
|
|
|
5023
5649
|
if (fresh) {
|
|
5024
5650
|
wikis = cached.data;
|
|
5025
5651
|
} else {
|
|
5026
|
-
const
|
|
5027
|
-
wikis =
|
|
5652
|
+
const all = await fetchAllWikis(client);
|
|
5653
|
+
wikis = all.map((w) => ({
|
|
5028
5654
|
id: w.id,
|
|
5029
5655
|
projectId: w.project.id,
|
|
5030
5656
|
name: w.name,
|
|
@@ -5042,8 +5668,55 @@ async function resolveWikiHomePageId(client, wikiId) {
|
|
|
5042
5668
|
return wiki.homePageId;
|
|
5043
5669
|
}
|
|
5044
5670
|
|
|
5671
|
+
// src/commands/wiki/list.ts
|
|
5672
|
+
var wikiListCommand = new import_commander37.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").option("--search <keyword>", "\uC704\uD0A4 \uC774\uB984 \uBD80\uBD84 \uC77C\uCE58 \uAC80\uC0C9 (\uB300\uC18C\uBB38\uC790 \uBB34\uC2DC)").action(async (opts) => {
|
|
5673
|
+
const globalOpts = wikiListCommand.optsWithGlobals();
|
|
5674
|
+
const config = await getConfigOrThrow();
|
|
5675
|
+
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
5676
|
+
const projectCodeMapPromise = buildProjectCodeMap(client).catch(
|
|
5677
|
+
() => /* @__PURE__ */ new Map()
|
|
5678
|
+
);
|
|
5679
|
+
if (opts.search != null && opts.search.trim() === "") {
|
|
5680
|
+
throw new DoorayCliError(
|
|
5681
|
+
"--search \uC5D0 \uBE48 \uAC12\uC744 \uC904 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. \uCC3E\uC744 \uC774\uB984\uC758 \uC77C\uBD80\uB97C \uC785\uB825\uD558\uC138\uC694.",
|
|
5682
|
+
EXIT_PARAM_ERROR
|
|
5683
|
+
);
|
|
5684
|
+
}
|
|
5685
|
+
let wikis;
|
|
5686
|
+
if (opts.search) {
|
|
5687
|
+
const pageGivenExplicitly = wikiListCommand.getOptionValueSource("page") === "cli";
|
|
5688
|
+
const sizeGivenExplicitly = wikiListCommand.getOptionValueSource("size") === "cli";
|
|
5689
|
+
if (pageGivenExplicitly || sizeGivenExplicitly) {
|
|
5690
|
+
process.stderr.write(
|
|
5691
|
+
"--search \uB294 \uC804\uCCB4 \uBAA9\uB85D\uC5D0\uC11C \uCC3E\uC73C\uBBC0\uB85C --page \uC640 --size \uB97C \uBB34\uC2DC\uD569\uB2C8\uB2E4.\n"
|
|
5692
|
+
);
|
|
5693
|
+
}
|
|
5694
|
+
startSpinner("\uC704\uD0A4 \uBAA9\uB85D \uC804\uCCB4 \uC870\uD68C \uC911...");
|
|
5695
|
+
const all = await fetchAllWikis(client);
|
|
5696
|
+
stopSpinner(true, "\uC704\uD0A4 \uBAA9\uB85D \uC870\uD68C \uC644\uB8CC");
|
|
5697
|
+
wikis = filterWikisByName(all, opts.search);
|
|
5698
|
+
if (wikis.length === 0) {
|
|
5699
|
+
process.stderr.write(
|
|
5700
|
+
`"${opts.search}" \uC640 \uC774\uB984\uC774 \uBD80\uBD84 \uC77C\uCE58\uD558\uB294 \uC704\uD0A4\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4. \uB300\uC18C\uBB38\uC790\uB294 \uAD6C\uBD84\uD558\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4.
|
|
5701
|
+
`
|
|
5702
|
+
);
|
|
5703
|
+
}
|
|
5704
|
+
} else {
|
|
5705
|
+
startSpinner("\uC704\uD0A4 \uBAA9\uB85D \uC870\uD68C \uC911...");
|
|
5706
|
+
const res = await client.getWikis({
|
|
5707
|
+
page: Number(opts.page),
|
|
5708
|
+
size: Number(opts.size)
|
|
5709
|
+
});
|
|
5710
|
+
stopSpinner(true, "\uC704\uD0A4 \uBAA9\uB85D \uC870\uD68C \uC644\uB8CC");
|
|
5711
|
+
wikis = res.result;
|
|
5712
|
+
}
|
|
5713
|
+
const projectCodeMap = await projectCodeMapPromise;
|
|
5714
|
+
formatWikiList(wikis, globalOpts, projectCodeMap);
|
|
5715
|
+
});
|
|
5716
|
+
|
|
5045
5717
|
// src/commands/wiki/pages.ts
|
|
5046
|
-
var
|
|
5718
|
+
var import_commander38 = require("commander");
|
|
5719
|
+
var wikiPagesCommand = new import_commander38.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) => {
|
|
5047
5720
|
const globalOpts = wikiPagesCommand.optsWithGlobals();
|
|
5048
5721
|
const config = await getConfigOrThrow();
|
|
5049
5722
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -5055,8 +5728,8 @@ var wikiPagesCommand = new import_commander36.Command("pages").description("\uC7
|
|
|
5055
5728
|
});
|
|
5056
5729
|
|
|
5057
5730
|
// src/commands/wiki/tree.ts
|
|
5058
|
-
var
|
|
5059
|
-
var wikiTreeCommand = new
|
|
5731
|
+
var import_commander39 = require("commander");
|
|
5732
|
+
var wikiTreeCommand = new import_commander39.Command("tree").description("\uC704\uD0A4 \uD398\uC774\uC9C0 \uACC4\uCE35 \uD2B8\uB9AC \uC870\uD68C").argument("<project>", "\uD504\uB85C\uC81D\uD2B8 \uCF54\uB4DC \uB610\uB294 ID").option("--depth <n>", "\uC7AC\uADC0 \uCD5C\uB300 \uAE4A\uC774 (root=1, \uBBF8\uC9C0\uC815 \uC2DC \uC804\uCCB4)").action(async (project, opts) => {
|
|
5060
5733
|
const globalOpts = wikiTreeCommand.optsWithGlobals();
|
|
5061
5734
|
const config = await getConfigOrThrow();
|
|
5062
5735
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -5076,21 +5749,87 @@ var wikiTreeCommand = new import_commander37.Command("tree").description("\uC704
|
|
|
5076
5749
|
});
|
|
5077
5750
|
|
|
5078
5751
|
// src/commands/wiki/page-get.ts
|
|
5079
|
-
var
|
|
5080
|
-
|
|
5752
|
+
var import_commander40 = require("commander");
|
|
5753
|
+
|
|
5754
|
+
// src/resolvers/wiki-page-input.ts
|
|
5755
|
+
var INPUT_HELP2 = "\uC704\uD0A4 \uD398\uC774\uC9C0\uB97C \uC2DD\uBCC4\uD560 \uC815\uBCF4\uAC00 \uBD80\uC871\uD569\uB2C8\uB2E4. \uB2E4\uC74C \uC911 \uD558\uB098\uB97C \uC785\uB825\uD558\uC138\uC694:\n - --id <page-id> \uC608: --id 1234567890123456789\n - <project> <page-id> \uC608: my-project 1234567890123456789\n - <Dooray URL> \uC608: https://x.dooray.com/wiki/<wikiId>/<pageId>\n \uC704\uD0A4\uB97C \uC774\uB984\uC73C\uB85C \uCC3E\uC73C\uB824\uBA74: dooray wiki list --search <\uC704\uD0A4 \uC774\uB984 \uC77C\uBD80>\n --project \uB294 \uC120\uD0DD\uC785\uB2C8\uB2E4. \uD568\uAED8 \uC8FC\uBA74 wikiId \uD574\uC11D \uD638\uCD9C\uC744 \uC544\uB08D\uB2C8\uB2E4.";
|
|
5756
|
+
async function resolveWikiPageInput(client, args) {
|
|
5757
|
+
const { projectArg, pageIdArg, idOpt, urlOpt, project } = args;
|
|
5758
|
+
const hasPositional = !!projectArg || !!pageIdArg;
|
|
5759
|
+
if (idOpt && urlOpt) {
|
|
5760
|
+
throw new DoorayCliError("--id\uC640 --url\uC740 \uB3D9\uC2DC\uC5D0 \uC0AC\uC6A9\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.", EXIT_PARAM_ERROR);
|
|
5761
|
+
}
|
|
5762
|
+
if ((idOpt || urlOpt) && hasPositional) {
|
|
5763
|
+
throw new DoorayCliError(
|
|
5764
|
+
"--id/--url\uACFC positional \uC778\uC790(<project> <page-id>)\uB294 \uB3D9\uC2DC\uC5D0 \uC0AC\uC6A9\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.",
|
|
5765
|
+
EXIT_PARAM_ERROR
|
|
5766
|
+
);
|
|
5767
|
+
}
|
|
5768
|
+
if (urlOpt) {
|
|
5769
|
+
const parsed = parseDoorayWikiUrl(urlOpt);
|
|
5770
|
+
if (!parsed) {
|
|
5771
|
+
throw new DoorayCliError(
|
|
5772
|
+
`--url \uD615\uC2DD\uC774 \uC62C\uBC14\uB974\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4: "${urlOpt}"
|
|
5773
|
+
\uC608: https://x.dooray.com/wiki/<wikiId>/<pageId>`,
|
|
5774
|
+
EXIT_PARAM_ERROR
|
|
5775
|
+
);
|
|
5776
|
+
}
|
|
5777
|
+
return parsed;
|
|
5778
|
+
}
|
|
5779
|
+
if (projectArg && !pageIdArg && isLikelyDoorayUrl(projectArg)) {
|
|
5780
|
+
const parsed = parseDoorayWikiUrl(projectArg);
|
|
5781
|
+
if (!parsed) {
|
|
5782
|
+
throw new DoorayCliError(
|
|
5783
|
+
`Dooray Wiki URL \uD615\uC2DD\uC774 \uC62C\uBC14\uB974\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4: "${projectArg}"
|
|
5784
|
+
\uC608: https://x.dooray.com/wiki/<wikiId>/<pageId>`,
|
|
5785
|
+
EXIT_PARAM_ERROR
|
|
5786
|
+
);
|
|
5787
|
+
}
|
|
5788
|
+
return parsed;
|
|
5789
|
+
}
|
|
5790
|
+
if (idOpt) {
|
|
5791
|
+
if (project) {
|
|
5792
|
+
const wikiId2 = await resolveWiki(client, project);
|
|
5793
|
+
return { wikiId: wikiId2, pageId: idOpt };
|
|
5794
|
+
}
|
|
5795
|
+
const res = await client.getWikiPageStandalone(idOpt);
|
|
5796
|
+
const wikiId = res.result.wikiId;
|
|
5797
|
+
if (!wikiId) {
|
|
5798
|
+
throw new DoorayCliError(
|
|
5799
|
+
`\uD398\uC774\uC9C0 \uC751\uB2F5\uC5D0 wikiId \uAC00 \uC5C6\uC2B5\uB2C8\uB2E4 (pageId: ${idOpt})`,
|
|
5800
|
+
EXIT_API_ERROR
|
|
5801
|
+
);
|
|
5802
|
+
}
|
|
5803
|
+
return { wikiId, pageId: idOpt };
|
|
5804
|
+
}
|
|
5805
|
+
if (projectArg && pageIdArg) {
|
|
5806
|
+
const wikiId = await resolveWiki(client, projectArg);
|
|
5807
|
+
return { wikiId, pageId: pageIdArg };
|
|
5808
|
+
}
|
|
5809
|
+
throw new DoorayCliError(INPUT_HELP2, EXIT_PARAM_ERROR);
|
|
5810
|
+
}
|
|
5811
|
+
|
|
5812
|
+
// src/commands/wiki/page-get.ts
|
|
5813
|
+
var wikiPageGetCommand = new import_commander40.Command("get").description("\uC704\uD0A4 \uD398\uC774\uC9C0 \uC0C1\uC138 \uC870\uD68C").argument("[arg1]", "\uD504\uB85C\uC81D\uD2B8 \uCF54\uB4DC \uB610\uB294 Dooray Wiki URL").argument("[arg2]", "page-id (positional 2\uAC1C \uBAA8\uB4DC)").option("--id <pageId>", "\uC704\uD0A4 \uD398\uC774\uC9C0 ID (project \uC5C6\uC774 \uC870\uD68C)").option("--url <url>", "Dooray Wiki URL").option("--project <code>", "\uD504\uB85C\uC81D\uD2B8 \uCF54\uB4DC (\uC120\uD0DD, \uC8FC\uBA74 wikiId \uD574\uC11D \uD638\uCD9C\uC744 \uC544\uB080\uB2E4)").action(async (arg1, arg2, opts) => {
|
|
5081
5814
|
const globalOpts = wikiPageGetCommand.optsWithGlobals();
|
|
5082
5815
|
const config = await getConfigOrThrow();
|
|
5083
5816
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
5817
|
+
const { wikiId, pageId } = await resolveWikiPageInput(client, {
|
|
5818
|
+
projectArg: arg1,
|
|
5819
|
+
pageIdArg: arg2,
|
|
5820
|
+
idOpt: opts.id,
|
|
5821
|
+
urlOpt: opts.url,
|
|
5822
|
+
project: opts.project
|
|
5823
|
+
});
|
|
5084
5824
|
startSpinner("\uC704\uD0A4 \uD398\uC774\uC9C0 \uC870\uD68C \uC911...");
|
|
5085
|
-
const wikiId = await resolveWiki(client, project);
|
|
5086
5825
|
const res = await client.getWikiPage(wikiId, pageId);
|
|
5087
5826
|
stopSpinner(true, "\uC704\uD0A4 \uD398\uC774\uC9C0 \uC870\uD68C \uC644\uB8CC");
|
|
5088
5827
|
formatWikiPageDetail(res.result, globalOpts);
|
|
5089
5828
|
});
|
|
5090
5829
|
|
|
5091
5830
|
// src/commands/wiki/page-create.ts
|
|
5092
|
-
var
|
|
5093
|
-
var wikiPageCreateCommand = new
|
|
5831
|
+
var import_commander41 = require("commander");
|
|
5832
|
+
var wikiPageCreateCommand = new import_commander41.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) => {
|
|
5094
5833
|
const globalOpts = wikiPageCreateCommand.optsWithGlobals();
|
|
5095
5834
|
const config = await getConfigOrThrow();
|
|
5096
5835
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -5115,8 +5854,8 @@ var wikiPageCreateCommand = new import_commander39.Command("create").description
|
|
|
5115
5854
|
});
|
|
5116
5855
|
|
|
5117
5856
|
// src/commands/wiki/page-edit.ts
|
|
5118
|
-
var
|
|
5119
|
-
var wikiPageEditCommand = new
|
|
5857
|
+
var import_commander42 = require("commander");
|
|
5858
|
+
var wikiPageEditCommand = new import_commander42.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) => {
|
|
5120
5859
|
const config = await getConfigOrThrow();
|
|
5121
5860
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
5122
5861
|
const hasTitle = opts.title != null;
|
|
@@ -5169,64 +5908,8 @@ var wikiPageEditCommand = new import_commander40.Command("edit").description("\u
|
|
|
5169
5908
|
});
|
|
5170
5909
|
|
|
5171
5910
|
// src/commands/wiki/page-delete.ts
|
|
5172
|
-
var
|
|
5173
|
-
|
|
5174
|
-
// src/resolvers/wiki-page-input.ts
|
|
5175
|
-
var INPUT_HELP2 = "\uC704\uD0A4 \uD398\uC774\uC9C0\uB97C \uC2DD\uBCC4\uD560 \uC815\uBCF4\uAC00 \uBD80\uC871\uD569\uB2C8\uB2E4. \uB2E4\uC74C \uC911 \uD558\uB098\uB97C \uC785\uB825\uD558\uC138\uC694:\n - <project> <page-id> \uC608: my-project 9876543210987654321\n - --id <page-id> --project <project> (\uB610\uB294 --url)\n - <Dooray URL> \uC608: https://x.dooray.com/wiki/<wikiId>/<pageId>";
|
|
5176
|
-
async function resolveWikiPageInput(client, args) {
|
|
5177
|
-
const { projectArg, pageIdArg, idOpt, urlOpt, project } = args;
|
|
5178
|
-
const hasPositional = !!projectArg || !!pageIdArg;
|
|
5179
|
-
if (idOpt && urlOpt) {
|
|
5180
|
-
throw new DoorayCliError("--id\uC640 --url\uC740 \uB3D9\uC2DC\uC5D0 \uC0AC\uC6A9\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.", EXIT_PARAM_ERROR);
|
|
5181
|
-
}
|
|
5182
|
-
if ((idOpt || urlOpt) && hasPositional) {
|
|
5183
|
-
throw new DoorayCliError(
|
|
5184
|
-
"--id/--url\uACFC positional \uC778\uC790(<project> <page-id>)\uB294 \uB3D9\uC2DC\uC5D0 \uC0AC\uC6A9\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.",
|
|
5185
|
-
EXIT_PARAM_ERROR
|
|
5186
|
-
);
|
|
5187
|
-
}
|
|
5188
|
-
if (urlOpt) {
|
|
5189
|
-
const parsed = parseDoorayWikiUrl(urlOpt);
|
|
5190
|
-
if (!parsed) {
|
|
5191
|
-
throw new DoorayCliError(
|
|
5192
|
-
`--url \uD615\uC2DD\uC774 \uC62C\uBC14\uB974\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4: "${urlOpt}"
|
|
5193
|
-
\uC608: https://x.dooray.com/wiki/<wikiId>/<pageId>`,
|
|
5194
|
-
EXIT_PARAM_ERROR
|
|
5195
|
-
);
|
|
5196
|
-
}
|
|
5197
|
-
return parsed;
|
|
5198
|
-
}
|
|
5199
|
-
if (projectArg && !pageIdArg && isLikelyDoorayUrl(projectArg)) {
|
|
5200
|
-
const parsed = parseDoorayWikiUrl(projectArg);
|
|
5201
|
-
if (!parsed) {
|
|
5202
|
-
throw new DoorayCliError(
|
|
5203
|
-
`Dooray Wiki URL \uD615\uC2DD\uC774 \uC62C\uBC14\uB974\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4: "${projectArg}"
|
|
5204
|
-
\uC608: https://x.dooray.com/wiki/<wikiId>/<pageId>`,
|
|
5205
|
-
EXIT_PARAM_ERROR
|
|
5206
|
-
);
|
|
5207
|
-
}
|
|
5208
|
-
return parsed;
|
|
5209
|
-
}
|
|
5210
|
-
if (idOpt) {
|
|
5211
|
-
const projectCode = project ?? projectArg;
|
|
5212
|
-
if (!projectCode) {
|
|
5213
|
-
throw new DoorayCliError(
|
|
5214
|
-
"--id \uBAA8\uB4DC\uB294 --project <code> \uAC00 \uD544\uC694\uD569\uB2C8\uB2E4 (\uB610\uB294 \uCCAB positional \uC5D0 project code).",
|
|
5215
|
-
EXIT_PARAM_ERROR
|
|
5216
|
-
);
|
|
5217
|
-
}
|
|
5218
|
-
const wikiId = await resolveWiki(client, projectCode);
|
|
5219
|
-
return { wikiId, pageId: idOpt };
|
|
5220
|
-
}
|
|
5221
|
-
if (projectArg && pageIdArg) {
|
|
5222
|
-
const wikiId = await resolveWiki(client, projectArg);
|
|
5223
|
-
return { wikiId, pageId: pageIdArg };
|
|
5224
|
-
}
|
|
5225
|
-
throw new DoorayCliError(INPUT_HELP2, EXIT_PARAM_ERROR);
|
|
5226
|
-
}
|
|
5227
|
-
|
|
5228
|
-
// src/commands/wiki/page-delete.ts
|
|
5229
|
-
var wikiPageDeleteCommand = new import_commander41.Command("delete").description("\uC704\uD0A4 \uD398\uC774\uC9C0 \uC0AD\uC81C (\uBE44\uACF5\uC2DD endpoint)").argument("[arg1]", "\uD504\uB85C\uC81D\uD2B8 \uCF54\uB4DC, Dooray Wiki URL, \uB610\uB294 (`--id`/`--url` \uBAA8\uB4DC\uC77C \uB54C) \uBBF8\uC0AC\uC6A9").argument("[arg2]", "page-id (positional 2\uAC1C \uBAA8\uB4DC)").option("--id <pageId>", "\uC704\uD0A4 \uD398\uC774\uC9C0 ID").option("--url <url>", "Dooray Wiki URL").option("--project <code>", "\uD504\uB85C\uC81D\uD2B8 \uCF54\uB4DC (--id \uBAA8\uB4DC\uC5D0\uC11C wikiId \uD574\uC11D\uC6A9)").option("-y, --yes", "\uD655\uC778 \uC5C6\uC774 \uC0AD\uC81C (\uC790\uB3D9\uD654\uC6A9)").action(async (arg1, arg2, opts) => {
|
|
5911
|
+
var import_commander43 = require("commander");
|
|
5912
|
+
var wikiPageDeleteCommand = new import_commander43.Command("delete").description("\uC704\uD0A4 \uD398\uC774\uC9C0 \uC0AD\uC81C").argument("[arg1]", "\uD504\uB85C\uC81D\uD2B8 \uCF54\uB4DC, Dooray Wiki URL, \uB610\uB294 (`--id`/`--url` \uBAA8\uB4DC\uC77C \uB54C) \uBBF8\uC0AC\uC6A9").argument("[arg2]", "page-id (positional 2\uAC1C \uBAA8\uB4DC)").option("--id <pageId>", "\uC704\uD0A4 \uD398\uC774\uC9C0 ID").option("--url <url>", "Dooray Wiki URL").option("--project <code>", "\uD504\uB85C\uC81D\uD2B8 \uCF54\uB4DC (--id \uBAA8\uB4DC\uC5D0\uC11C wikiId \uD574\uC11D\uC6A9)").option("-y, --yes", "\uD655\uC778 \uC5C6\uC774 \uC0AD\uC81C (\uC790\uB3D9\uD654\uC6A9)").action(async (arg1, arg2, opts) => {
|
|
5230
5913
|
const confirmed = await authorizeDeletion(
|
|
5231
5914
|
!!opts.yes,
|
|
5232
5915
|
!!process.stdin.isTTY,
|
|
@@ -5263,12 +5946,94 @@ var wikiPageDeleteCommand = new import_commander41.Command("delete").description
|
|
|
5263
5946
|
}
|
|
5264
5947
|
});
|
|
5265
5948
|
|
|
5949
|
+
// src/commands/wiki/page-move.ts
|
|
5950
|
+
var import_commander44 = require("commander");
|
|
5951
|
+
function validateMoveOptions(opts) {
|
|
5952
|
+
if (!opts.parent) {
|
|
5953
|
+
throw new DoorayCliError(
|
|
5954
|
+
"--parent \uB294 \uD544\uC218\uC785\uB2C8\uB2E4. \uC774\uB3D9 \uB300\uC0C1 \uBD80\uBAA8 \uD398\uC774\uC9C0 ID \uB97C \uC9C0\uC815\uD558\uC138\uC694.",
|
|
5955
|
+
EXIT_PARAM_ERROR
|
|
5956
|
+
);
|
|
5957
|
+
}
|
|
5958
|
+
if (opts.before && opts.first) {
|
|
5959
|
+
throw new DoorayCliError(
|
|
5960
|
+
"--before \uC640 --first \uB294 \uB3D9\uC2DC\uC5D0 \uC0AC\uC6A9\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.",
|
|
5961
|
+
EXIT_PARAM_ERROR
|
|
5962
|
+
);
|
|
5963
|
+
}
|
|
5964
|
+
}
|
|
5965
|
+
function buildMoveBody(opts, resolvedTargetWikiId) {
|
|
5966
|
+
const body = {
|
|
5967
|
+
targetParentPageId: opts.parent
|
|
5968
|
+
};
|
|
5969
|
+
if (resolvedTargetWikiId) {
|
|
5970
|
+
body.targetWikiId = resolvedTargetWikiId;
|
|
5971
|
+
}
|
|
5972
|
+
if (opts.children === false) {
|
|
5973
|
+
body.withChildren = false;
|
|
5974
|
+
}
|
|
5975
|
+
if (opts.first) {
|
|
5976
|
+
body.beforePageId = "0";
|
|
5977
|
+
} else if (opts.before) {
|
|
5978
|
+
body.beforePageId = opts.before;
|
|
5979
|
+
}
|
|
5980
|
+
return body;
|
|
5981
|
+
}
|
|
5982
|
+
function emitMoveResult(globalOpts, pageId, body) {
|
|
5983
|
+
if (globalOpts.json) {
|
|
5984
|
+
printJson({ pageId, ...body, status: "moved" });
|
|
5985
|
+
} else if (globalOpts.quiet) {
|
|
5986
|
+
process.stdout.write(`${pageId}
|
|
5987
|
+
`);
|
|
5988
|
+
} else {
|
|
5989
|
+
process.stdout.write(
|
|
5990
|
+
`\uD398\uC774\uC9C0(${pageId})\uAC00 \uBD80\uBAA8 \uD398\uC774\uC9C0(${body.targetParentPageId}) \uC544\uB798\uB85C \uC774\uB3D9\uB418\uC5C8\uC2B5\uB2C8\uB2E4.
|
|
5991
|
+
`
|
|
5992
|
+
);
|
|
5993
|
+
process.stdout.write(
|
|
5994
|
+
body.withChildren === false ? "\uD558\uC704 \uD398\uC774\uC9C0\uB294 \uD568\uAED8 \uC774\uB3D9\uD558\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4.\n" : "\uD558\uC704 \uD398\uC774\uC9C0\uB3C4 \uD568\uAED8 \uC774\uB3D9\uD588\uC2B5\uB2C8\uB2E4.\n"
|
|
5995
|
+
);
|
|
5996
|
+
const orderMessage = describeOrderChange(body.beforePageId);
|
|
5997
|
+
if (orderMessage) process.stdout.write(orderMessage);
|
|
5998
|
+
}
|
|
5999
|
+
}
|
|
6000
|
+
function describeOrderChange(beforePageId) {
|
|
6001
|
+
if (beforePageId == null) return null;
|
|
6002
|
+
if (beforePageId === "0") return "\uD615\uC81C \uC911 \uB9E8 \uC55E\uC73C\uB85C \uC815\uB82C\uB418\uC5C8\uC2B5\uB2C8\uB2E4.\n";
|
|
6003
|
+
return `\uD615\uC81C \uD398\uC774\uC9C0(${beforePageId}) \uBC14\uB85C \uB4A4\uB85C \uC815\uB82C\uB418\uC5C8\uC2B5\uB2C8\uB2E4.
|
|
6004
|
+
`;
|
|
6005
|
+
}
|
|
6006
|
+
var wikiPageMoveCommand = new import_commander44.Command("move").description("\uC704\uD0A4 \uD398\uC774\uC9C0 \uC774\uB3D9 (\uBD80\uBAA8 \uBCC0\uACBD, \uC815\uB82C \uBCC0\uACBD, \uC704\uD0A4 \uAC04 \uC774\uB3D9)").argument("[arg1]", "\uD504\uB85C\uC81D\uD2B8 \uCF54\uB4DC, Dooray Wiki URL, \uB610\uB294 (`--id`/`--url` \uBAA8\uB4DC\uC77C \uB54C) \uBBF8\uC0AC\uC6A9").argument("[arg2]", "page-id (positional 2\uAC1C \uBAA8\uB4DC)").option("--id <pageId>", "\uC704\uD0A4 \uD398\uC774\uC9C0 ID").option("--url <url>", "Dooray Wiki URL").option("--project <code>", "\uD504\uB85C\uC81D\uD2B8 \uCF54\uB4DC (--id \uBAA8\uB4DC\uC5D0\uC11C wikiId \uD574\uC11D \uD638\uCD9C \uC808\uC57D)").option("--parent <page-id>", "\uC774\uB3D9 \uB300\uC0C1 \uBD80\uBAA8 \uD398\uC774\uC9C0 ID (\uD544\uC218)").option("--to-wiki <project|wikiId>", "\uC774\uB3D9 \uB300\uC0C1 \uC704\uD0A4 (\uD504\uB85C\uC81D\uD2B8 \uCF54\uB4DC \uB610\uB294 \uC704\uD0A4 ID)").option("--before <page-id>", "\uC774 \uD398\uC774\uC9C0 \uBC14\uB85C \uB4A4\uC5D0 \uC704\uCE58").option("--first", "\uD615\uC81C \uC911 \uB9E8 \uC55E\uC73C\uB85C \uC774\uB3D9").option("--no-children", "\uD558\uC704 \uD398\uC774\uC9C0\uB97C \uD568\uAED8 \uC62E\uAE30\uC9C0 \uC54A\uB294\uB2E4 (\uAE30\uBCF8\uC740 \uD568\uAED8 \uC774\uB3D9)").action(async (arg1, arg2, opts) => {
|
|
6007
|
+
validateMoveOptions(opts);
|
|
6008
|
+
const globalOpts = wikiPageMoveCommand.optsWithGlobals();
|
|
6009
|
+
const config = await getConfigOrThrow();
|
|
6010
|
+
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
6011
|
+
const { wikiId, pageId } = await resolveWikiPageInput(client, {
|
|
6012
|
+
projectArg: arg1,
|
|
6013
|
+
pageIdArg: arg2,
|
|
6014
|
+
idOpt: opts.id,
|
|
6015
|
+
urlOpt: opts.url,
|
|
6016
|
+
project: opts.project
|
|
6017
|
+
});
|
|
6018
|
+
const targetWikiId = opts.toWiki ? PROJECT_ID_RE.test(opts.toWiki) ? opts.toWiki : await resolveWiki(client, opts.toWiki) : void 0;
|
|
6019
|
+
const body = buildMoveBody(opts, targetWikiId);
|
|
6020
|
+
startSpinner("\uC704\uD0A4 \uD398\uC774\uC9C0 \uC774\uB3D9 \uC911...");
|
|
6021
|
+
try {
|
|
6022
|
+
await client.moveWikiPage(wikiId, pageId, body);
|
|
6023
|
+
stopSpinner(true, "\uC704\uD0A4 \uD398\uC774\uC9C0 \uC774\uB3D9 \uC644\uB8CC");
|
|
6024
|
+
emitMoveResult(globalOpts, pageId, body);
|
|
6025
|
+
} catch (e) {
|
|
6026
|
+
stopSpinner(false);
|
|
6027
|
+
throw e;
|
|
6028
|
+
}
|
|
6029
|
+
});
|
|
6030
|
+
|
|
5266
6031
|
// src/commands/wiki/page-file/index.ts
|
|
5267
|
-
var
|
|
6032
|
+
var import_commander50 = require("commander");
|
|
5268
6033
|
|
|
5269
6034
|
// src/commands/wiki/page-file/list.ts
|
|
5270
|
-
var
|
|
5271
|
-
var wikiPageFileListCommand = new
|
|
6035
|
+
var import_commander45 = require("commander");
|
|
6036
|
+
var wikiPageFileListCommand = new import_commander45.Command("list").description("\uC704\uD0A4 \uD398\uC774\uC9C0 \uCCA8\uBD80\uD30C\uC77C \uBAA9\uB85D \uC870\uD68C (general + inline image)").argument("[project]", "\uD504\uB85C\uC81D\uD2B8 \uCF54\uB4DC (\uB610\uB294 \uCCAB \uC778\uC790\uC5D0 Dooray Wiki URL)").argument("[page-id]", "\uC704\uD0A4 \uD398\uC774\uC9C0 ID (project\uC640 \uD568\uAED8 \uC0AC\uC6A9)").option("--id <pageId>", "\uC704\uD0A4 \uD398\uC774\uC9C0 ID (--project \uB3D9\uBC18 \uD544\uC694)").option("--url <url>", "Dooray Wiki URL").option("--project <code>", "\uD504\uB85C\uC81D\uD2B8 \uCF54\uB4DC (--id \uBAA8\uB4DC\uC5D0\uC11C wikiId \uD574\uC11D\uC6A9)").action(async (project, pageIdArg, opts) => {
|
|
5272
6037
|
const globalOpts = wikiPageFileListCommand.optsWithGlobals();
|
|
5273
6038
|
const config = await getConfigOrThrow();
|
|
5274
6039
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -5299,7 +6064,7 @@ var wikiPageFileListCommand = new import_commander42.Command("list").description
|
|
|
5299
6064
|
});
|
|
5300
6065
|
|
|
5301
6066
|
// src/commands/wiki/page-file/upload.ts
|
|
5302
|
-
var
|
|
6067
|
+
var import_commander46 = require("commander");
|
|
5303
6068
|
|
|
5304
6069
|
// src/utils/wiki-snippet.ts
|
|
5305
6070
|
function wikiInlineImageSnippet(wikiId, attachFileId, name) {
|
|
@@ -5307,7 +6072,7 @@ function wikiInlineImageSnippet(wikiId, attachFileId, name) {
|
|
|
5307
6072
|
}
|
|
5308
6073
|
|
|
5309
6074
|
// src/commands/wiki/page-file/upload.ts
|
|
5310
|
-
var wikiPageFileUploadCommand = new
|
|
6075
|
+
var wikiPageFileUploadCommand = new import_commander46.Command("upload").description("\uC704\uD0A4 \uD398\uC774\uC9C0 \uCCA8\uBD80\uD30C\uC77C \uC5C5\uB85C\uB4DC").argument("[arg1]", "\uD504\uB85C\uC81D\uD2B8 \uCF54\uB4DC, Dooray Wiki URL, \uB610\uB294 (`--id`/`--url` \uBAA8\uB4DC\uC77C \uB54C) \uD30C\uC77C \uACBD\uB85C").argument("[arg2]", "page-id \uB610\uB294 (`--id`/`--url` \uBAA8\uB4DC\uC77C \uB54C) \uD30C\uC77C \uACBD\uB85C").argument("[arg3]", "\uD30C\uC77C \uACBD\uB85C (positional 3\uAC1C \uBAA8\uB4DC)").option("--id <pageId>", "\uC704\uD0A4 \uD398\uC774\uC9C0 ID").option("--url <url>", "Dooray Wiki URL").option("--project <code>", "\uD504\uB85C\uC81D\uD2B8 \uCF54\uB4DC (--id \uBAA8\uB4DC\uC5D0\uC11C wikiId \uD574\uC11D\uC6A9)").option("--file <path>", "\uC5C5\uB85C\uB4DC\uD560 \uD30C\uC77C \uACBD\uB85C (positional \uB300\uCCB4)").option("--type <type>", "\uD30C\uC77C \uD0C0\uC785: general | inline_image (\uAE30\uBCF8 general)", "general").action(async (arg1, arg2, arg3, opts) => {
|
|
5311
6076
|
const globalOpts = wikiPageFileUploadCommand.optsWithGlobals();
|
|
5312
6077
|
const config = await getConfigOrThrow();
|
|
5313
6078
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -5402,10 +6167,10 @@ var wikiPageFileUploadCommand = new import_commander43.Command("upload").descrip
|
|
|
5402
6167
|
});
|
|
5403
6168
|
|
|
5404
6169
|
// src/commands/wiki/page-file/download.ts
|
|
5405
|
-
var
|
|
6170
|
+
var import_commander47 = require("commander");
|
|
5406
6171
|
var import_promises11 = require("fs/promises");
|
|
5407
6172
|
var import_node_path12 = require("path");
|
|
5408
|
-
var wikiPageFileDownloadCommand = new
|
|
6173
|
+
var wikiPageFileDownloadCommand = new import_commander47.Command("download").description("\uC704\uD0A4 \uD398\uC774\uC9C0 \uCCA8\uBD80\uD30C\uC77C \uB2E4\uC6B4\uB85C\uB4DC").argument("[arg1]", "\uD504\uB85C\uC81D\uD2B8 \uCF54\uB4DC, Dooray Wiki URL, \uB610\uB294 (`--id`/`--url` \uBAA8\uB4DC\uC77C \uB54C) \uD30C\uC77C ID").argument("[arg2]", "page-id \uB610\uB294 (`--id`/`--url` \uBAA8\uB4DC\uC77C \uB54C) \uD30C\uC77C ID").argument("[arg3]", "\uD30C\uC77C ID (positional 3\uAC1C \uBAA8\uB4DC)").option("--id <pageId>", "\uC704\uD0A4 \uD398\uC774\uC9C0 ID").option("--url <url>", "Dooray Wiki URL").option("--project <code>", "\uD504\uB85C\uC81D\uD2B8 \uCF54\uB4DC (--id \uBAA8\uB4DC\uC5D0\uC11C wikiId \uD574\uC11D\uC6A9)").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) => {
|
|
5409
6174
|
const globalOpts = wikiPageFileDownloadCommand.optsWithGlobals();
|
|
5410
6175
|
const config = await getConfigOrThrow();
|
|
5411
6176
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -5467,10 +6232,10 @@ var wikiPageFileDownloadCommand = new import_commander44.Command("download").des
|
|
|
5467
6232
|
});
|
|
5468
6233
|
|
|
5469
6234
|
// src/commands/wiki/page-file/download-all.ts
|
|
5470
|
-
var
|
|
6235
|
+
var import_commander48 = require("commander");
|
|
5471
6236
|
var import_promises12 = require("fs/promises");
|
|
5472
6237
|
var import_node_path13 = require("path");
|
|
5473
|
-
var wikiPageFileDownloadAllCommand = new
|
|
6238
|
+
var wikiPageFileDownloadAllCommand = new import_commander48.Command("download-all").description("\uC704\uD0A4 \uD398\uC774\uC9C0\uC758 \uBAA8\uB4E0 \uCCA8\uBD80\uD30C\uC77C \uB2E4\uC6B4\uB85C\uB4DC (general + inline image)").argument("[project]", "\uD504\uB85C\uC81D\uD2B8 \uCF54\uB4DC (\uB610\uB294 \uCCAB \uC778\uC790\uC5D0 Dooray Wiki URL)").argument("[page-id]", "\uC704\uD0A4 \uD398\uC774\uC9C0 ID (project\uC640 \uD568\uAED8 \uC0AC\uC6A9)").option("--id <pageId>", "\uC704\uD0A4 \uD398\uC774\uC9C0 ID (--project \uB3D9\uBC18 \uD544\uC694)").option("--url <url>", "Dooray Wiki URL").option("--project <code>", "\uD504\uB85C\uC81D\uD2B8 \uCF54\uB4DC (--id \uBAA8\uB4DC\uC5D0\uC11C wikiId \uD574\uC11D\uC6A9)").option("-o, --output <dir>", "\uC800\uC7A5 \uB514\uB809\uD1A0\uB9AC", ".").action(async (project, pageIdArg, opts) => {
|
|
5474
6239
|
const globalOpts = wikiPageFileDownloadAllCommand.optsWithGlobals();
|
|
5475
6240
|
const config = await getConfigOrThrow();
|
|
5476
6241
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -5527,8 +6292,8 @@ var wikiPageFileDownloadAllCommand = new import_commander45.Command("download-al
|
|
|
5527
6292
|
});
|
|
5528
6293
|
|
|
5529
6294
|
// src/commands/wiki/page-file/delete.ts
|
|
5530
|
-
var
|
|
5531
|
-
var wikiPageFileDeleteCommand = new
|
|
6295
|
+
var import_commander49 = require("commander");
|
|
6296
|
+
var wikiPageFileDeleteCommand = new import_commander49.Command("delete").description("\uC704\uD0A4 \uD398\uC774\uC9C0 \uCCA8\uBD80\uD30C\uC77C \uC0AD\uC81C").argument("[arg1]", "\uD504\uB85C\uC81D\uD2B8 \uCF54\uB4DC, Dooray Wiki URL, \uB610\uB294 (`--id`/`--url` \uBAA8\uB4DC\uC77C \uB54C) \uD30C\uC77C ID").argument("[arg2]", "page-id \uB610\uB294 (`--id`/`--url` \uBAA8\uB4DC\uC77C \uB54C) \uD30C\uC77C ID").argument("[arg3]", "\uD30C\uC77C ID (positional 3\uAC1C \uBAA8\uB4DC)").option("--id <pageId>", "\uC704\uD0A4 \uD398\uC774\uC9C0 ID").option("--url <url>", "Dooray Wiki URL").option("--project <code>", "\uD504\uB85C\uC81D\uD2B8 \uCF54\uB4DC (--id \uBAA8\uB4DC\uC5D0\uC11C wikiId \uD574\uC11D\uC6A9)").option("--file-id <fileId>", "\uD30C\uC77C ID (positional \uB300\uCCB4)").option("-y, --yes", "\uD655\uC778 \uC5C6\uC774 \uC0AD\uC81C (\uC790\uB3D9\uD654\uC6A9)").action(async (arg1, arg2, arg3, opts) => {
|
|
5532
6297
|
const confirmed = await authorizeDeletion(
|
|
5533
6298
|
!!opts.yes,
|
|
5534
6299
|
!!process.stdin.isTTY,
|
|
@@ -5596,7 +6361,7 @@ var wikiPageFileDeleteCommand = new import_commander46.Command("delete").descrip
|
|
|
5596
6361
|
});
|
|
5597
6362
|
|
|
5598
6363
|
// src/commands/wiki/page-file/index.ts
|
|
5599
|
-
var wikiPageFileCommand = new
|
|
6364
|
+
var wikiPageFileCommand = new import_commander50.Command("file").description("\uC704\uD0A4 \uD398\uC774\uC9C0 \uCCA8\uBD80\uD30C\uC77C \uAD00\uB828 \uBA85\uB839");
|
|
5600
6365
|
wikiPageFileCommand.addCommand(wikiPageFileListCommand);
|
|
5601
6366
|
wikiPageFileCommand.addCommand(wikiPageFileUploadCommand);
|
|
5602
6367
|
wikiPageFileCommand.addCommand(wikiPageFileDownloadCommand);
|
|
@@ -5604,10 +6369,10 @@ wikiPageFileCommand.addCommand(wikiPageFileDownloadAllCommand);
|
|
|
5604
6369
|
wikiPageFileCommand.addCommand(wikiPageFileDeleteCommand);
|
|
5605
6370
|
|
|
5606
6371
|
// src/commands/wiki/page-comment/index.ts
|
|
5607
|
-
var
|
|
6372
|
+
var import_commander57 = require("commander");
|
|
5608
6373
|
|
|
5609
6374
|
// src/commands/wiki/page-comment/list.ts
|
|
5610
|
-
var
|
|
6375
|
+
var import_commander51 = require("commander");
|
|
5611
6376
|
|
|
5612
6377
|
// src/formatters/wiki-comment.ts
|
|
5613
6378
|
function formatWikiCommentList(comments, opts) {
|
|
@@ -5654,7 +6419,7 @@ function truncate(s, n) {
|
|
|
5654
6419
|
}
|
|
5655
6420
|
|
|
5656
6421
|
// src/commands/wiki/page-comment/list.ts
|
|
5657
|
-
var wikiPageCommentListCommand = new
|
|
6422
|
+
var wikiPageCommentListCommand = new import_commander51.Command("list").description("\uC704\uD0A4 \uD398\uC774\uC9C0 \uB313\uAE00 \uBAA9\uB85D \uC870\uD68C (\uCD5C\uC2E0\uC21C)").argument("[project]", "\uD504\uB85C\uC81D\uD2B8 \uCF54\uB4DC (\uB610\uB294 \uCCAB \uC778\uC790\uC5D0 Dooray Wiki URL)").argument("[page-id]", "\uC704\uD0A4 \uD398\uC774\uC9C0 ID").option("--id <pageId>", "\uC704\uD0A4 \uD398\uC774\uC9C0 ID (--project \uB3D9\uBC18)").option("--url <url>", "Dooray Wiki URL").option("--project <code>", "\uD504\uB85C\uC81D\uD2B8 \uCF54\uB4DC (--id \uBAA8\uB4DC\uC6A9)").option("--size <n>", "\uD398\uC774\uC9C0 \uD06C\uAE30 (\uAE30\uBCF8 20, \uCD5C\uB300 100)", (v) => parseInt(v, 10)).option("--page <n>", "\uD398\uC774\uC9C0 \uBC88\uD638 (0\uBD80\uD130)", (v) => parseInt(v, 10)).option("--latest <n>", "\uCD5C\uC2E0 N\uAC1C\uB9CC (size \uB300\uC2E0 \uC0AC\uC6A9)", (v) => parseInt(v, 10)).action(async (project, pageIdArg, opts) => {
|
|
5658
6423
|
const globalOpts = wikiPageCommentListCommand.optsWithGlobals();
|
|
5659
6424
|
const config = await getConfigOrThrow();
|
|
5660
6425
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -5679,8 +6444,8 @@ var wikiPageCommentListCommand = new import_commander48.Command("list").descript
|
|
|
5679
6444
|
});
|
|
5680
6445
|
|
|
5681
6446
|
// src/commands/wiki/page-comment/latest.ts
|
|
5682
|
-
var
|
|
5683
|
-
var wikiPageCommentLatestCommand = new
|
|
6447
|
+
var import_commander52 = require("commander");
|
|
6448
|
+
var wikiPageCommentLatestCommand = new import_commander52.Command("latest").description("\uCD5C\uC2E0 \uB313\uAE00 1\uAC74 \uC870\uD68C (= comment list --latest 1)").argument("[project]", "\uD504\uB85C\uC81D\uD2B8 \uCF54\uB4DC (\uB610\uB294 \uCCAB \uC778\uC790\uC5D0 Dooray Wiki URL)").argument("[page-id]", "\uC704\uD0A4 \uD398\uC774\uC9C0 ID").option("--id <pageId>", "\uC704\uD0A4 \uD398\uC774\uC9C0 ID (--project \uB3D9\uBC18)").option("--url <url>", "Dooray Wiki URL").option("--project <code>", "\uD504\uB85C\uC81D\uD2B8 \uCF54\uB4DC (--id \uBAA8\uB4DC\uC6A9)").action(async (project, pageIdArg, opts) => {
|
|
5684
6449
|
const globalOpts = wikiPageCommentLatestCommand.optsWithGlobals();
|
|
5685
6450
|
const config = await getConfigOrThrow();
|
|
5686
6451
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -5707,7 +6472,7 @@ var wikiPageCommentLatestCommand = new import_commander49.Command("latest").desc
|
|
|
5707
6472
|
});
|
|
5708
6473
|
|
|
5709
6474
|
// src/commands/wiki/page-comment/get.ts
|
|
5710
|
-
var
|
|
6475
|
+
var import_commander53 = require("commander");
|
|
5711
6476
|
|
|
5712
6477
|
// src/commands/wiki/page-comment/parse-args.ts
|
|
5713
6478
|
function parseWikiCommentArgs(arg1, arg2, arg3, opts) {
|
|
@@ -5760,7 +6525,7 @@ function parseWikiCommentArgs(arg1, arg2, arg3, opts) {
|
|
|
5760
6525
|
}
|
|
5761
6526
|
|
|
5762
6527
|
// src/commands/wiki/page-comment/get.ts
|
|
5763
|
-
var wikiPageCommentGetCommand = new
|
|
6528
|
+
var wikiPageCommentGetCommand = new import_commander53.Command("get").description("\uB2E8\uC77C \uB313\uAE00 \uC870\uD68C").argument("[arg1]", "\uD504\uB85C\uC81D\uD2B8 \uCF54\uB4DC / Dooray Wiki URL (\uBAA8\uB4DC\uBCC4)").argument("[arg2]", "\uC704\uD0A4 \uD398\uC774\uC9C0 ID (\uBAA8\uB4DC\uBCC4)").argument("[arg3]", "\uB313\uAE00 ID (positional 3\uAC1C \uBAA8\uB4DC)").option("--id <pageId>", "\uC704\uD0A4 \uD398\uC774\uC9C0 ID (positional \uB300\uC2E0)").option("--url <url>", "Dooray Wiki URL (positional \uB300\uC2E0)").option("--project <code>", "\uD504\uB85C\uC81D\uD2B8 \uCF54\uB4DC (--id \uBAA8\uB4DC\uC6A9)").option("--comment-id <id>", "\uB313\uAE00 ID (arg3 \uB300\uC2E0)").action(async (arg1, arg2, arg3, opts) => {
|
|
5764
6529
|
const parsed = parseWikiCommentArgs(arg1, arg2, arg3, opts);
|
|
5765
6530
|
const config = await getConfigOrThrow();
|
|
5766
6531
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -5784,8 +6549,8 @@ var wikiPageCommentGetCommand = new import_commander50.Command("get").descriptio
|
|
|
5784
6549
|
});
|
|
5785
6550
|
|
|
5786
6551
|
// src/commands/wiki/page-comment/add.ts
|
|
5787
|
-
var
|
|
5788
|
-
var wikiPageCommentAddCommand = new
|
|
6552
|
+
var import_commander54 = require("commander");
|
|
6553
|
+
var wikiPageCommentAddCommand = new import_commander54.Command("add").description("\uC704\uD0A4 \uD398\uC774\uC9C0 \uB313\uAE00 \uCD94\uAC00 (--body \uC5C6\uC73C\uBA74 $EDITOR)").argument("[project]", "\uD504\uB85C\uC81D\uD2B8 \uCF54\uB4DC (\uB610\uB294 \uCCAB \uC778\uC790\uC5D0 Dooray Wiki URL)").argument("[page-id]", "\uC704\uD0A4 \uD398\uC774\uC9C0 ID").option("--id <pageId>", "\uC704\uD0A4 \uD398\uC774\uC9C0 ID (--project \uB3D9\uBC18)").option("--url <url>", "Dooray Wiki URL").option("--project <code>", "\uD504\uB85C\uC81D\uD2B8 \uCF54\uB4DC (--id \uBAA8\uB4DC\uC6A9)").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, pageIdArg, opts) => {
|
|
5789
6554
|
if ((opts.id || opts.url) && (project || pageIdArg)) {
|
|
5790
6555
|
throw new DoorayCliError(
|
|
5791
6556
|
"positional \uC778\uC790\uC640 --id/--url \uC635\uC158\uC740 \uB3D9\uC2DC\uC5D0 \uC0AC\uC6A9\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.",
|
|
@@ -5831,8 +6596,8 @@ var wikiPageCommentAddCommand = new import_commander51.Command("add").descriptio
|
|
|
5831
6596
|
});
|
|
5832
6597
|
|
|
5833
6598
|
// src/commands/wiki/page-comment/edit.ts
|
|
5834
|
-
var
|
|
5835
|
-
var wikiPageCommentEditCommand = new
|
|
6599
|
+
var import_commander55 = require("commander");
|
|
6600
|
+
var wikiPageCommentEditCommand = new import_commander55.Command("edit").description("\uC704\uD0A4 \uD398\uC774\uC9C0 \uB313\uAE00 \uC218\uC815 ($EDITOR \uB610\uB294 --body \uC635\uC158)").argument("[arg1]", "\uD504\uB85C\uC81D\uD2B8 \uCF54\uB4DC / Dooray Wiki URL (\uBAA8\uB4DC\uBCC4)").argument("[arg2]", "\uC704\uD0A4 \uD398\uC774\uC9C0 ID (\uBAA8\uB4DC\uBCC4)").argument("[arg3]", "\uB313\uAE00 ID (positional 3\uAC1C \uBAA8\uB4DC)").option("--id <pageId>", "\uC704\uD0A4 \uD398\uC774\uC9C0 ID (positional \uB300\uC2E0)").option("--url <url>", "Dooray Wiki URL (positional \uB300\uC2E0)").option("--project <code>", "\uD504\uB85C\uC81D\uD2B8 \uCF54\uB4DC (--id \uBAA8\uB4DC\uC6A9)").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)").action(async (arg1, arg2, arg3, opts) => {
|
|
5836
6601
|
const parsed = parseWikiCommentArgs(arg1, arg2, arg3, opts);
|
|
5837
6602
|
const config = await getConfigOrThrow();
|
|
5838
6603
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -5876,8 +6641,8 @@ var wikiPageCommentEditCommand = new import_commander52.Command("edit").descript
|
|
|
5876
6641
|
});
|
|
5877
6642
|
|
|
5878
6643
|
// src/commands/wiki/page-comment/delete.ts
|
|
5879
|
-
var
|
|
5880
|
-
var wikiPageCommentDeleteCommand = new
|
|
6644
|
+
var import_commander56 = require("commander");
|
|
6645
|
+
var wikiPageCommentDeleteCommand = new import_commander56.Command("delete").description("\uC704\uD0A4 \uD398\uC774\uC9C0 \uB313\uAE00 \uC0AD\uC81C").argument("[arg1]", "\uD504\uB85C\uC81D\uD2B8 \uCF54\uB4DC / Dooray Wiki URL (\uBAA8\uB4DC\uBCC4)").argument("[arg2]", "\uC704\uD0A4 \uD398\uC774\uC9C0 ID (\uBAA8\uB4DC\uBCC4)").argument("[arg3]", "\uB313\uAE00 ID (positional 3\uAC1C \uBAA8\uB4DC)").option("--id <pageId>", "\uC704\uD0A4 \uD398\uC774\uC9C0 ID (positional \uB300\uC2E0)").option("--url <url>", "Dooray Wiki URL (positional \uB300\uC2E0)").option("--project <code>", "\uD504\uB85C\uC81D\uD2B8 \uCF54\uB4DC (--id \uBAA8\uB4DC\uC6A9)").option("--comment-id <commentId>", "\uB313\uAE00 ID (positional \uB300\uCCB4)").option("-y, --yes", "\uD655\uC778 \uC5C6\uC774 \uC0AD\uC81C (\uC790\uB3D9\uD654\uC6A9)").action(async (arg1, arg2, arg3, opts) => {
|
|
5881
6646
|
const confirmed = await authorizeDeletion(
|
|
5882
6647
|
!!opts.yes,
|
|
5883
6648
|
!!process.stdin.isTTY,
|
|
@@ -5910,7 +6675,7 @@ var wikiPageCommentDeleteCommand = new import_commander53.Command("delete").desc
|
|
|
5910
6675
|
});
|
|
5911
6676
|
|
|
5912
6677
|
// src/commands/wiki/page-comment/index.ts
|
|
5913
|
-
var wikiPageCommentCommand = new
|
|
6678
|
+
var wikiPageCommentCommand = new import_commander57.Command("comment").description("\uC704\uD0A4 \uD398\uC774\uC9C0 \uB313\uAE00 \uAD00\uB828 \uBA85\uB839");
|
|
5914
6679
|
wikiPageCommentCommand.addCommand(wikiPageCommentListCommand);
|
|
5915
6680
|
wikiPageCommentCommand.addCommand(wikiPageCommentLatestCommand);
|
|
5916
6681
|
wikiPageCommentCommand.addCommand(wikiPageCommentGetCommand);
|
|
@@ -5919,10 +6684,10 @@ wikiPageCommentCommand.addCommand(wikiPageCommentEditCommand);
|
|
|
5919
6684
|
wikiPageCommentCommand.addCommand(wikiPageCommentDeleteCommand);
|
|
5920
6685
|
|
|
5921
6686
|
// src/commands/member/index.ts
|
|
5922
|
-
var
|
|
6687
|
+
var import_commander61 = require("commander");
|
|
5923
6688
|
|
|
5924
6689
|
// src/commands/member/get.ts
|
|
5925
|
-
var
|
|
6690
|
+
var import_commander58 = require("commander");
|
|
5926
6691
|
|
|
5927
6692
|
// src/formatters/member.ts
|
|
5928
6693
|
function formatMemberDetail(member, opts) {
|
|
@@ -5968,7 +6733,7 @@ function formatMemberSearchResults(members, opts) {
|
|
|
5968
6733
|
}
|
|
5969
6734
|
|
|
5970
6735
|
// src/commands/member/get.ts
|
|
5971
|
-
var memberGetCommand = new
|
|
6736
|
+
var memberGetCommand = new import_commander58.Command("get").description("\uBA64\uBC84 \uC0C1\uC138 \uC815\uBCF4 \uC870\uD68C (organizationMemberId)").argument("<member-id>", "\uC870\uD68C\uD560 organization member ID").action(async (memberId) => {
|
|
5972
6737
|
const globalOpts = memberGetCommand.optsWithGlobals();
|
|
5973
6738
|
const config = await getConfigOrThrow();
|
|
5974
6739
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -5977,8 +6742,8 @@ var memberGetCommand = new import_commander55.Command("get").description("\uBA64
|
|
|
5977
6742
|
});
|
|
5978
6743
|
|
|
5979
6744
|
// src/commands/member/list.ts
|
|
5980
|
-
var
|
|
5981
|
-
var memberListCommand = new
|
|
6745
|
+
var import_commander59 = require("commander");
|
|
6746
|
+
var memberListCommand = new import_commander59.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) => {
|
|
5982
6747
|
const globalOpts = memberListCommand.optsWithGlobals();
|
|
5983
6748
|
const config = await getConfigOrThrow();
|
|
5984
6749
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -5993,8 +6758,8 @@ var memberListCommand = new import_commander56.Command("list").description("\uD5
|
|
|
5993
6758
|
});
|
|
5994
6759
|
|
|
5995
6760
|
// src/commands/member/search.ts
|
|
5996
|
-
var
|
|
5997
|
-
var memberSearchCommand = new
|
|
6761
|
+
var import_commander60 = require("commander");
|
|
6762
|
+
var memberSearchCommand = new import_commander60.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) => {
|
|
5998
6763
|
const globalOpts = memberSearchCommand.optsWithGlobals();
|
|
5999
6764
|
const filterCount = [keyword, opts.email, opts.userCode, opts.userCodeExact].filter(Boolean).length;
|
|
6000
6765
|
if (filterCount === 0) {
|
|
@@ -6027,13 +6792,13 @@ var memberSearchCommand = new import_commander57.Command("search").description("
|
|
|
6027
6792
|
});
|
|
6028
6793
|
|
|
6029
6794
|
// src/commands/member/index.ts
|
|
6030
|
-
var memberCommand = new
|
|
6795
|
+
var memberCommand = new import_commander61.Command("member").description("Dooray \uBA64\uBC84 \uC870\uD68C");
|
|
6031
6796
|
memberCommand.addCommand(memberGetCommand);
|
|
6032
6797
|
memberCommand.addCommand(memberListCommand);
|
|
6033
6798
|
memberCommand.addCommand(memberSearchCommand);
|
|
6034
6799
|
|
|
6035
6800
|
// src/commands/mail/list.ts
|
|
6036
|
-
var
|
|
6801
|
+
var import_commander62 = require("commander");
|
|
6037
6802
|
|
|
6038
6803
|
// src/api/imapClient.ts
|
|
6039
6804
|
var import_imapflow = require("imapflow");
|
|
@@ -6214,7 +6979,7 @@ async function getMail(config, uid) {
|
|
|
6214
6979
|
|
|
6215
6980
|
// src/commands/mail/list.ts
|
|
6216
6981
|
var import_chalk6 = __toESM(require("chalk"));
|
|
6217
|
-
var mailListCommand = new
|
|
6982
|
+
var mailListCommand = new import_commander62.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) => {
|
|
6218
6983
|
const globalOpts = mailListCommand.optsWithGlobals();
|
|
6219
6984
|
const config = await getConfigOrThrow();
|
|
6220
6985
|
startSpinner("\uBA54\uC77C \uC870\uD68C \uC911...");
|
|
@@ -6246,9 +7011,9 @@ var mailListCommand = new import_commander59.Command("list").description("\uBA54
|
|
|
6246
7011
|
});
|
|
6247
7012
|
|
|
6248
7013
|
// src/commands/mail/get.ts
|
|
6249
|
-
var
|
|
7014
|
+
var import_commander63 = require("commander");
|
|
6250
7015
|
var import_chalk7 = __toESM(require("chalk"));
|
|
6251
|
-
var mailGetCommand = new
|
|
7016
|
+
var mailGetCommand = new import_commander63.Command("get").description("\uBA54\uC77C \uC0C1\uC138 \uC870\uD68C").argument("<uid>", "\uBA54\uC77C UID").action(async (uid) => {
|
|
6252
7017
|
const globalOpts = mailGetCommand.optsWithGlobals();
|
|
6253
7018
|
const config = await getConfigOrThrow();
|
|
6254
7019
|
startSpinner("\uBA54\uC77C \uC870\uD68C \uC911...");
|
|
@@ -6279,7 +7044,7 @@ ${mail.body}
|
|
|
6279
7044
|
});
|
|
6280
7045
|
|
|
6281
7046
|
// src/commands/mail/send.ts
|
|
6282
|
-
var
|
|
7047
|
+
var import_commander64 = require("commander");
|
|
6283
7048
|
var import_promises13 = require("fs/promises");
|
|
6284
7049
|
|
|
6285
7050
|
// src/api/smtpClient.ts
|
|
@@ -6331,7 +7096,7 @@ async function sendMail(config, opts) {
|
|
|
6331
7096
|
}
|
|
6332
7097
|
|
|
6333
7098
|
// src/commands/mail/send.ts
|
|
6334
|
-
var mailSendCommand = new
|
|
7099
|
+
var mailSendCommand = new import_commander64.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) => {
|
|
6335
7100
|
const globalOpts = mailSendCommand.optsWithGlobals();
|
|
6336
7101
|
const config = await getConfigOrThrow();
|
|
6337
7102
|
let body = opts.body ?? "";
|
|
@@ -6366,7 +7131,7 @@ var mailSendCommand = new import_commander61.Command("send").description("\uBA54
|
|
|
6366
7131
|
});
|
|
6367
7132
|
|
|
6368
7133
|
// src/commands/mail/reply.ts
|
|
6369
|
-
var
|
|
7134
|
+
var import_commander65 = require("commander");
|
|
6370
7135
|
var import_promises14 = require("fs/promises");
|
|
6371
7136
|
async function getMessageId(config, uid) {
|
|
6372
7137
|
const client = createImapClient(config);
|
|
@@ -6387,7 +7152,7 @@ async function getMessageId(config, uid) {
|
|
|
6387
7152
|
await closeImapClient(client);
|
|
6388
7153
|
}
|
|
6389
7154
|
}
|
|
6390
|
-
var mailReplyCommand = new
|
|
7155
|
+
var mailReplyCommand = new import_commander65.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) => {
|
|
6391
7156
|
const globalOpts = mailReplyCommand.optsWithGlobals();
|
|
6392
7157
|
const config = await getConfigOrThrow();
|
|
6393
7158
|
let body = opts.body ?? "";
|
|
@@ -6428,7 +7193,7 @@ var mailReplyCommand = new import_commander62.Command("reply").description("\uBA
|
|
|
6428
7193
|
});
|
|
6429
7194
|
|
|
6430
7195
|
// src/commands/mail/logout.ts
|
|
6431
|
-
var
|
|
7196
|
+
var import_commander66 = require("commander");
|
|
6432
7197
|
var import_chalk8 = __toESM(require("chalk"));
|
|
6433
7198
|
async function authorizeMailLogout(skipConfirmation, isTTY, confirmRemoval) {
|
|
6434
7199
|
if (skipConfirmation) return true;
|
|
@@ -6440,7 +7205,7 @@ async function authorizeMailLogout(skipConfirmation, isTTY, confirmRemoval) {
|
|
|
6440
7205
|
}
|
|
6441
7206
|
return confirmRemoval();
|
|
6442
7207
|
}
|
|
6443
|
-
var mailLogoutCommand = new
|
|
7208
|
+
var mailLogoutCommand = new import_commander66.Command("logout").description("\uC800\uC7A5\uB41C \uBA54\uC77C \uC778\uC99D\uC815\uBCF4 \uC81C\uAC70").option("-y, --yes", "\uD655\uC778 \uC5C6\uC774 \uC778\uC99D\uC815\uBCF4 \uC81C\uAC70 (\uC790\uB3D9\uD654\uC6A9)").action(async (opts) => {
|
|
6444
7209
|
const confirmed = await authorizeMailLogout(
|
|
6445
7210
|
!!opts.yes,
|
|
6446
7211
|
!!process.stdin.isTTY,
|
|
@@ -6456,18 +7221,21 @@ var mailLogoutCommand = new import_commander63.Command("logout").description("\u
|
|
|
6456
7221
|
process.stderr.write("\uCDE8\uC18C\uB418\uC5C8\uC2B5\uB2C8\uB2E4.\n");
|
|
6457
7222
|
return;
|
|
6458
7223
|
}
|
|
6459
|
-
const
|
|
7224
|
+
const result = await clearMailCredentials();
|
|
7225
|
+
if (result.state === "failed") {
|
|
7226
|
+
throw new DoorayCliError(result.reason, EXIT_CONFIG_ERROR);
|
|
7227
|
+
}
|
|
6460
7228
|
process.stderr.write(
|
|
6461
|
-
|
|
7229
|
+
result.state === "cleared" && result.hadCredentials ? import_chalk8.default.green("\u2713 \uBA54\uC77C \uC778\uC99D\uC815\uBCF4\uB97C \uC81C\uAC70\uD588\uC2B5\uB2C8\uB2E4.\n") : "\uC800\uC7A5\uB41C \uBA54\uC77C \uC778\uC99D\uC815\uBCF4\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.\n"
|
|
6462
7230
|
);
|
|
6463
7231
|
});
|
|
6464
7232
|
|
|
6465
7233
|
// src/commands/messenger/index.ts
|
|
6466
|
-
var
|
|
7234
|
+
var import_commander69 = require("commander");
|
|
6467
7235
|
|
|
6468
7236
|
// src/commands/messenger/send.ts
|
|
6469
|
-
var
|
|
6470
|
-
var messengerSendCommand = new
|
|
7237
|
+
var import_commander67 = require("commander");
|
|
7238
|
+
var messengerSendCommand = new import_commander67.Command("send").description("\uBA54\uC2E0\uC800 1:1 \uB2E4\uC774\uB809\uD2B8 \uBA54\uC2DC\uC9C0 \uC804\uC1A1 (--body \uC5C6\uC73C\uBA74 $EDITOR)").option("--to <id|email>", "\uBC1B\uB294 \uC0AC\uB78C (organizationMemberId \uB610\uB294 \uC774\uBA54\uC77C \u2014 \uC774\uB984 \uBBF8\uC9C0\uC6D0)").option("--body <text>", "\uBA54\uC2DC\uC9C0 \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 (opts) => {
|
|
6471
7239
|
if (!opts.to) {
|
|
6472
7240
|
throw new DoorayCliError("--to \uC635\uC158\uC740 \uD544\uC218\uC785\uB2C8\uB2E4.", EXIT_PARAM_ERROR);
|
|
6473
7241
|
}
|
|
@@ -6507,7 +7275,7 @@ var messengerSendCommand = new import_commander64.Command("send").description("\
|
|
|
6507
7275
|
});
|
|
6508
7276
|
|
|
6509
7277
|
// src/commands/messenger/channel-send.ts
|
|
6510
|
-
var
|
|
7278
|
+
var import_commander68 = require("commander");
|
|
6511
7279
|
|
|
6512
7280
|
// src/resolvers/messenger-channel.ts
|
|
6513
7281
|
var CHANNEL_ID_RE = /^\d{15,}$/;
|
|
@@ -6525,7 +7293,7 @@ async function resolveMessengerChannel(client, input2) {
|
|
|
6525
7293
|
}
|
|
6526
7294
|
|
|
6527
7295
|
// src/commands/messenger/channel-send.ts
|
|
6528
|
-
var messengerChannelSendCommand = new
|
|
7296
|
+
var messengerChannelSendCommand = new import_commander68.Command("channel-send").description("\uBA54\uC2E0\uC800 \uB300\uD654\uBC29 \uBA54\uC2DC\uC9C0 \uC804\uC1A1 (--body \uC5C6\uC73C\uBA74 $EDITOR)").option("--channel <channelId|\uC774\uB984>", "\uB300\uD654\uBC29 channelId \uB610\uB294 \uC774\uB984 (\uBD80\uBD84\uC77C\uCE58)").option("--body <text>", "\uBA54\uC2DC\uC9C0 \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 (opts) => {
|
|
6529
7297
|
if (!opts.channel) {
|
|
6530
7298
|
throw new DoorayCliError("--channel \uC635\uC158\uC740 \uD544\uC218\uC785\uB2C8\uB2E4.", EXIT_PARAM_ERROR);
|
|
6531
7299
|
}
|
|
@@ -6559,12 +7327,12 @@ var messengerChannelSendCommand = new import_commander65.Command("channel-send")
|
|
|
6559
7327
|
});
|
|
6560
7328
|
|
|
6561
7329
|
// src/commands/messenger/index.ts
|
|
6562
|
-
var messengerCommand = new
|
|
7330
|
+
var messengerCommand = new import_commander69.Command("messenger").description("\uBA54\uC2E0\uC800 \uAD00\uB828 \uBA85\uB839");
|
|
6563
7331
|
messengerCommand.addCommand(messengerSendCommand);
|
|
6564
7332
|
messengerCommand.addCommand(messengerChannelSendCommand);
|
|
6565
7333
|
|
|
6566
7334
|
// src/commands/feedback.ts
|
|
6567
|
-
var
|
|
7335
|
+
var import_commander70 = require("commander");
|
|
6568
7336
|
var import_node_child_process2 = require("child_process");
|
|
6569
7337
|
var import_node_util = require("util");
|
|
6570
7338
|
var import_promises17 = require("fs/promises");
|
|
@@ -6675,7 +7443,7 @@ async function readBody(opts) {
|
|
|
6675
7443
|
if (opts.bodyFile) return await (0, import_promises17.readFile)(opts.bodyFile, "utf-8");
|
|
6676
7444
|
return void 0;
|
|
6677
7445
|
}
|
|
6678
|
-
var feedbackCommand = new
|
|
7446
|
+
var feedbackCommand = new import_commander70.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(
|
|
6679
7447
|
"--label <name>",
|
|
6680
7448
|
"\uB77C\uBCA8 (\uBC18\uBCF5 \uAC00\uB2A5)",
|
|
6681
7449
|
(value, prev) => [...prev, value],
|
|
@@ -6838,7 +7606,7 @@ function sanitizeArgv(argv) {
|
|
|
6838
7606
|
}
|
|
6839
7607
|
|
|
6840
7608
|
// src/index.ts
|
|
6841
|
-
var program = new
|
|
7609
|
+
var program = new import_commander71.Command();
|
|
6842
7610
|
program.name("dooray").description("Dooray REST API CLI").version(CLI_VERSION).option("--json", "JSON \uD615\uC2DD\uC73C\uB85C \uCD9C\uB825").option("--quiet", "ID\uB9CC \uCD9C\uB825").option("--no-color", "\uC0C9\uC0C1 \uBE44\uD65C\uC131\uD654");
|
|
6843
7611
|
program.hook("preAction", () => {
|
|
6844
7612
|
const opts = program.opts();
|
|
@@ -6849,14 +7617,17 @@ program.hook("preAction", () => {
|
|
|
6849
7617
|
setQuiet(true);
|
|
6850
7618
|
}
|
|
6851
7619
|
});
|
|
6852
|
-
var projectCommand = new
|
|
7620
|
+
var projectCommand = new import_commander71.Command("project").description("\uD504\uB85C\uC81D\uD2B8 \uAD00\uB828 \uBA85\uB839");
|
|
6853
7621
|
projectCommand.addCommand(projectListCommand);
|
|
6854
7622
|
projectCommand.addCommand(projectMembersCommand);
|
|
6855
7623
|
projectCommand.addCommand(projectWorkflowsCommand);
|
|
6856
7624
|
projectCommand.addCommand(projectGroupsCommand);
|
|
6857
7625
|
projectCommand.addCommand(projectTagsCommand);
|
|
6858
7626
|
projectCommand.addCommand(projectTemplatesCommand);
|
|
6859
|
-
|
|
7627
|
+
projectTagsCommand.addCommand(projectTagsListCommand);
|
|
7628
|
+
projectTagsCommand.addCommand(projectTagsCreateCommand);
|
|
7629
|
+
projectTagsCommand.addCommand(projectTagsGroupCommand);
|
|
7630
|
+
var postCommand = new import_commander71.Command("post").description("\uC5C5\uBB34 \uAD00\uB828 \uBA85\uB839");
|
|
6860
7631
|
postCommand.addCommand(postListCommand);
|
|
6861
7632
|
postCommand.addCommand(postSearchCommand);
|
|
6862
7633
|
postCommand.addCommand(postGetCommand);
|
|
@@ -6864,7 +7635,7 @@ postCommand.addCommand(postEditCommand);
|
|
|
6864
7635
|
postCommand.addCommand(postCreateCommand);
|
|
6865
7636
|
postCommand.addCommand(postDoneCommand);
|
|
6866
7637
|
postCommand.addCommand(postWorkflowCommand);
|
|
6867
|
-
var commentCommand = new
|
|
7638
|
+
var commentCommand = new import_commander71.Command("comment").description("\uB313\uAE00 \uAD00\uB828 \uBA85\uB839");
|
|
6868
7639
|
commentCommand.addCommand(commentListCommand);
|
|
6869
7640
|
commentCommand.addCommand(commentLatestCommand);
|
|
6870
7641
|
commentCommand.addCommand(commentGetCommand);
|
|
@@ -6873,26 +7644,27 @@ commentCommand.addCommand(commentEditCommand);
|
|
|
6873
7644
|
commentCommand.addCommand(commentDeleteCommand);
|
|
6874
7645
|
commentCommand.addCommand(commentFileCommand);
|
|
6875
7646
|
postCommand.addCommand(commentCommand);
|
|
6876
|
-
var fileCommand = new
|
|
7647
|
+
var fileCommand = new import_commander71.Command("file").description("\uCCA8\uBD80\uD30C\uC77C \uAD00\uB828 \uBA85\uB839");
|
|
6877
7648
|
fileCommand.addCommand(fileListCommand);
|
|
6878
7649
|
fileCommand.addCommand(fileDownloadCommand);
|
|
6879
7650
|
fileCommand.addCommand(fileDownloadAllCommand);
|
|
6880
7651
|
fileCommand.addCommand(fileUploadCommand);
|
|
6881
7652
|
fileCommand.addCommand(fileDeleteCommand);
|
|
6882
7653
|
postCommand.addCommand(fileCommand);
|
|
6883
|
-
var wikiCommand = new
|
|
7654
|
+
var wikiCommand = new import_commander71.Command("wiki").description("\uC704\uD0A4 \uAD00\uB828 \uBA85\uB839");
|
|
6884
7655
|
wikiCommand.addCommand(wikiListCommand);
|
|
6885
7656
|
wikiCommand.addCommand(wikiPagesCommand);
|
|
6886
7657
|
wikiCommand.addCommand(wikiTreeCommand);
|
|
6887
|
-
var wikiPageCommand = new
|
|
7658
|
+
var wikiPageCommand = new import_commander71.Command("page").description("\uC704\uD0A4 \uD398\uC774\uC9C0 \uAD00\uB828 \uBA85\uB839");
|
|
6888
7659
|
wikiPageCommand.addCommand(wikiPageGetCommand);
|
|
6889
7660
|
wikiPageCommand.addCommand(wikiPageCreateCommand);
|
|
6890
7661
|
wikiPageCommand.addCommand(wikiPageEditCommand);
|
|
6891
7662
|
wikiPageCommand.addCommand(wikiPageDeleteCommand);
|
|
7663
|
+
wikiPageCommand.addCommand(wikiPageMoveCommand);
|
|
6892
7664
|
wikiPageCommand.addCommand(wikiPageFileCommand);
|
|
6893
7665
|
wikiPageCommand.addCommand(wikiPageCommentCommand);
|
|
6894
7666
|
wikiCommand.addCommand(wikiPageCommand);
|
|
6895
|
-
var mailCommand = new
|
|
7667
|
+
var mailCommand = new import_commander71.Command("mail").description("\uBA54\uC77C \uAD00\uB828 \uBA85\uB839");
|
|
6896
7668
|
mailCommand.addCommand(mailListCommand);
|
|
6897
7669
|
mailCommand.addCommand(mailGetCommand);
|
|
6898
7670
|
mailCommand.addCommand(mailSendCommand);
|
|
@@ -6918,7 +7690,7 @@ program.parseAsync().catch(async (err) => {
|
|
|
6918
7690
|
const sanitized = sanitizeArgv(process.argv.slice(2));
|
|
6919
7691
|
const firstNonFlag = sanitized.find((a) => !a.startsWith("-"));
|
|
6920
7692
|
const isFeedbackCommand = firstNonFlag === "feedback";
|
|
6921
|
-
if (config
|
|
7693
|
+
if (config.state === "ok" && config.config.trackLastRun && !isFeedbackCommand) {
|
|
6922
7694
|
await writeLastRun({
|
|
6923
7695
|
argv: ["dooray", ...sanitized],
|
|
6924
7696
|
exitCode,
|