@bifos/dooray-cli 0.14.1 → 0.15.1
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 +29 -5
- package/dist/index.js +964 -235
- package/package.json +3 -2
- package/skills/dooray-cli/SKILL.md +6 -0
- package/skills/dooray-cli/references/common.md +33 -0
- package/skills/dooray-cli/references/intent-map.md +1 -1
package/dist/index.js
CHANGED
|
@@ -24,8 +24,8 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
24
24
|
));
|
|
25
25
|
|
|
26
26
|
// src/index.ts
|
|
27
|
-
var
|
|
28
|
-
var
|
|
27
|
+
var import_commander68 = require("commander");
|
|
28
|
+
var import_chalk9 = __toESM(require("chalk"));
|
|
29
29
|
|
|
30
30
|
// src/commands/config.ts
|
|
31
31
|
var import_commander = require("commander");
|
|
@@ -143,6 +143,19 @@ async function saveConfig(config) {
|
|
|
143
143
|
await ensureDir();
|
|
144
144
|
await (0, import_promises.writeFile)(CONFIG_PATH, JSON.stringify(config, null, 2) + "\n");
|
|
145
145
|
}
|
|
146
|
+
function removeMailCredentials(config) {
|
|
147
|
+
const next = { ...config };
|
|
148
|
+
delete next.imapUsername;
|
|
149
|
+
delete next.imapPassword;
|
|
150
|
+
return next;
|
|
151
|
+
}
|
|
152
|
+
async function clearMailCredentials() {
|
|
153
|
+
const config = await getConfig();
|
|
154
|
+
if (!config) return false;
|
|
155
|
+
const hadCredentials = !!(config.imapUsername || config.imapPassword);
|
|
156
|
+
await saveConfig(removeMailCredentials(config));
|
|
157
|
+
return hadCredentials;
|
|
158
|
+
}
|
|
146
159
|
|
|
147
160
|
// src/commands/config.ts
|
|
148
161
|
function maskApiKey(key) {
|
|
@@ -209,18 +222,18 @@ var TEMPLATES_DIR = (0, import_node_path2.join)(CACHE_DIR, "templates");
|
|
|
209
222
|
async function ensureDir2(dir) {
|
|
210
223
|
await (0, import_promises2.mkdir)(dir, { recursive: true });
|
|
211
224
|
}
|
|
212
|
-
async function readJson(
|
|
225
|
+
async function readJson(path6) {
|
|
213
226
|
try {
|
|
214
|
-
const raw = await (0, import_promises2.readFile)(
|
|
227
|
+
const raw = await (0, import_promises2.readFile)(path6, "utf-8");
|
|
215
228
|
return JSON.parse(raw);
|
|
216
229
|
} catch {
|
|
217
230
|
return null;
|
|
218
231
|
}
|
|
219
232
|
}
|
|
220
|
-
async function writeJson(
|
|
221
|
-
const dir = (0, import_node_path2.dirname)(
|
|
233
|
+
async function writeJson(path6, data) {
|
|
234
|
+
const dir = (0, import_node_path2.dirname)(path6);
|
|
222
235
|
await ensureDir2(dir);
|
|
223
|
-
await (0, import_promises2.writeFile)(
|
|
236
|
+
await (0, import_promises2.writeFile)(path6, JSON.stringify(data, null, 2) + "\n");
|
|
224
237
|
}
|
|
225
238
|
function isExpired(updatedAt, ttlMs) {
|
|
226
239
|
if (!updatedAt) return true;
|
|
@@ -367,10 +380,553 @@ var import_chalk3 = __toESM(require("chalk"));
|
|
|
367
380
|
var import_path = __toESM(require("path"));
|
|
368
381
|
var import_promises4 = __toESM(require("fs/promises"));
|
|
369
382
|
|
|
383
|
+
// src/skill/context.ts
|
|
384
|
+
var import_node_path3 = __toESM(require("path"));
|
|
385
|
+
var import_node_os3 = require("os");
|
|
386
|
+
|
|
387
|
+
// src/version.ts
|
|
388
|
+
var CLI_VERSION = true ? "0.15.1" : "0.0.0-dev";
|
|
389
|
+
|
|
390
|
+
// src/skill/context.ts
|
|
391
|
+
function resolveSkillDataRoot(homeDir, xdgDataHome = process.env.XDG_DATA_HOME) {
|
|
392
|
+
if (xdgDataHome != null && import_node_path3.default.isAbsolute(xdgDataHome)) {
|
|
393
|
+
return import_node_path3.default.join(xdgDataHome, "dooray-cli");
|
|
394
|
+
}
|
|
395
|
+
return import_node_path3.default.join(homeDir, ".local", "share", "dooray-cli");
|
|
396
|
+
}
|
|
397
|
+
function createSkillManagerContext() {
|
|
398
|
+
const homeDir = (0, import_node_os3.homedir)();
|
|
399
|
+
return {
|
|
400
|
+
homeDir,
|
|
401
|
+
packageRoot: import_node_path3.default.resolve(__dirname, ".."),
|
|
402
|
+
currentVersion: CLI_VERSION,
|
|
403
|
+
dataRoot: resolveSkillDataRoot(homeDir)
|
|
404
|
+
};
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
// src/skill/manager.ts
|
|
408
|
+
var fs2 = __toESM(require("fs/promises"));
|
|
409
|
+
var import_node_path5 = __toESM(require("path"));
|
|
410
|
+
|
|
411
|
+
// src/skill/manifest.ts
|
|
412
|
+
var import_node_crypto = require("crypto");
|
|
413
|
+
var fs = __toESM(require("fs/promises"));
|
|
414
|
+
var import_node_path4 = __toESM(require("path"));
|
|
415
|
+
var MANIFEST_FILE_NAME = ".dooray-skill.json";
|
|
416
|
+
var DIGEST_PREFIX = "sha256:";
|
|
417
|
+
var HASH_HEADER = Buffer.from("dooray-skill-content-v1\0", "utf8");
|
|
418
|
+
function isUtcIsoTimestamp(value) {
|
|
419
|
+
if (!/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$/.test(value)) {
|
|
420
|
+
return false;
|
|
421
|
+
}
|
|
422
|
+
const timestamp = Date.parse(value);
|
|
423
|
+
if (!Number.isFinite(timestamp)) {
|
|
424
|
+
return false;
|
|
425
|
+
}
|
|
426
|
+
return new Date(timestamp).toISOString() === value;
|
|
427
|
+
}
|
|
428
|
+
function isDooraySkillManifest(value) {
|
|
429
|
+
const installedAt = value != null && typeof value === "object" && "installedAt" in value && typeof value.installedAt === "string" ? value.installedAt : null;
|
|
430
|
+
return value != null && typeof value === "object" && "schemaVersion" in value && value.schemaVersion === 1 && "skillName" in value && value.skillName === "dooray-cli" && "packageName" in value && value.packageName === "@bifos/dooray-cli" && "packageVersion" in value && typeof value.packageVersion === "string" && value.packageVersion.length > 0 && "contentDigest" in value && typeof value.contentDigest === "string" && /^sha256:[0-9a-f]{64}$/.test(value.contentDigest) && installedAt != null && isUtcIsoTimestamp(installedAt) && "managedBy" in value && value.managedBy === "@bifos/dooray-cli";
|
|
431
|
+
}
|
|
432
|
+
async function readDooraySkillManifest(manifestPath) {
|
|
433
|
+
try {
|
|
434
|
+
const parsed = JSON.parse(await fs.readFile(manifestPath, "utf8"));
|
|
435
|
+
return isDooraySkillManifest(parsed) ? parsed : null;
|
|
436
|
+
} catch {
|
|
437
|
+
return null;
|
|
438
|
+
}
|
|
439
|
+
}
|
|
440
|
+
function createDooraySkillManifest(packageVersion, contentDigest, installedAt = (/* @__PURE__ */ new Date()).toISOString()) {
|
|
441
|
+
return {
|
|
442
|
+
schemaVersion: 1,
|
|
443
|
+
skillName: "dooray-cli",
|
|
444
|
+
packageName: "@bifos/dooray-cli",
|
|
445
|
+
packageVersion,
|
|
446
|
+
contentDigest,
|
|
447
|
+
installedAt,
|
|
448
|
+
managedBy: "@bifos/dooray-cli"
|
|
449
|
+
};
|
|
450
|
+
}
|
|
451
|
+
function getDigestHex(contentDigest) {
|
|
452
|
+
return contentDigest.slice(DIGEST_PREFIX.length);
|
|
453
|
+
}
|
|
454
|
+
function compareCodePoint(left, right) {
|
|
455
|
+
const leftPoints = Array.from(left);
|
|
456
|
+
const rightPoints = Array.from(right);
|
|
457
|
+
const length = Math.min(leftPoints.length, rightPoints.length);
|
|
458
|
+
for (let index = 0; index < length; index += 1) {
|
|
459
|
+
const leftCodePoint = leftPoints[index].codePointAt(0) ?? 0;
|
|
460
|
+
const rightCodePoint = rightPoints[index].codePointAt(0) ?? 0;
|
|
461
|
+
if (leftCodePoint !== rightCodePoint) {
|
|
462
|
+
return leftCodePoint - rightCodePoint;
|
|
463
|
+
}
|
|
464
|
+
}
|
|
465
|
+
return leftPoints.length - rightPoints.length;
|
|
466
|
+
}
|
|
467
|
+
async function assertRegularFile(filePath) {
|
|
468
|
+
const stat3 = await fs.lstat(filePath);
|
|
469
|
+
if (!stat3.isFile()) {
|
|
470
|
+
throw new DoorayCliError(
|
|
471
|
+
`\uC2A4\uD0AC \uCF58\uD150\uCE20\uB294 \uC815\uADDC \uD30C\uC77C\uB9CC \uD3EC\uD568\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4: ${filePath}`,
|
|
472
|
+
EXIT_PARAM_ERROR
|
|
473
|
+
);
|
|
474
|
+
}
|
|
475
|
+
}
|
|
476
|
+
async function collectReferenceFiles(root, current2, files) {
|
|
477
|
+
const currentStat = await fs.lstat(current2).catch((error) => {
|
|
478
|
+
if (error instanceof Error && "code" in error && error.code === "ENOENT") {
|
|
479
|
+
return null;
|
|
480
|
+
}
|
|
481
|
+
throw error;
|
|
482
|
+
});
|
|
483
|
+
if (currentStat == null) {
|
|
484
|
+
return;
|
|
485
|
+
}
|
|
486
|
+
if (!currentStat.isDirectory()) {
|
|
487
|
+
throw new DoorayCliError(
|
|
488
|
+
`\uC2A4\uD0AC references\uB294 \uB514\uB809\uD130\uB9AC\uC5EC\uC57C \uD569\uB2C8\uB2E4: ${current2}`,
|
|
489
|
+
EXIT_PARAM_ERROR
|
|
490
|
+
);
|
|
491
|
+
}
|
|
492
|
+
let entries;
|
|
493
|
+
entries = await fs.readdir(current2, { withFileTypes: true });
|
|
494
|
+
for (const entry of entries) {
|
|
495
|
+
const entryPath = import_node_path4.default.join(current2, entry.name);
|
|
496
|
+
if (entry.isDirectory()) {
|
|
497
|
+
await collectReferenceFiles(root, entryPath, files);
|
|
498
|
+
continue;
|
|
499
|
+
}
|
|
500
|
+
await assertRegularFile(entryPath);
|
|
501
|
+
files.push(import_node_path4.default.relative(root, entryPath).split(import_node_path4.default.sep).join("/"));
|
|
502
|
+
}
|
|
503
|
+
}
|
|
504
|
+
async function collectSkillContentFiles(skillDir) {
|
|
505
|
+
const files = [];
|
|
506
|
+
const skillFile = import_node_path4.default.join(skillDir, "SKILL.md");
|
|
507
|
+
await assertRegularFile(skillFile);
|
|
508
|
+
files.push("SKILL.md");
|
|
509
|
+
await collectReferenceFiles(skillDir, import_node_path4.default.join(skillDir, "references"), files);
|
|
510
|
+
return files.filter((file) => file !== MANIFEST_FILE_NAME).sort(compareCodePoint);
|
|
511
|
+
}
|
|
512
|
+
function writeUInt64BE(value) {
|
|
513
|
+
const buffer = Buffer.alloc(8);
|
|
514
|
+
buffer.writeBigUInt64BE(BigInt(value));
|
|
515
|
+
return buffer;
|
|
516
|
+
}
|
|
517
|
+
async function computeSkillContentDigest(skillDir) {
|
|
518
|
+
const hash = (0, import_node_crypto.createHash)("sha256");
|
|
519
|
+
hash.update(HASH_HEADER);
|
|
520
|
+
for (const relativePath of await collectSkillContentFiles(skillDir)) {
|
|
521
|
+
const relativePathBuffer = Buffer.from(relativePath, "utf8");
|
|
522
|
+
const content = await fs.readFile(import_node_path4.default.join(skillDir, relativePath));
|
|
523
|
+
hash.update(Buffer.from([1]));
|
|
524
|
+
hash.update(writeUInt64BE(Buffer.byteLength(relativePath, "utf8")));
|
|
525
|
+
hash.update(relativePathBuffer);
|
|
526
|
+
hash.update(writeUInt64BE(content.length));
|
|
527
|
+
hash.update(content);
|
|
528
|
+
}
|
|
529
|
+
return `sha256:${hash.digest("hex")}`;
|
|
530
|
+
}
|
|
531
|
+
|
|
532
|
+
// src/skill/manager.ts
|
|
533
|
+
var PACKAGE_NAME = "@bifos/dooray-cli";
|
|
534
|
+
var SKILL_RELATIVE_PATH = import_node_path5.default.join("skills", "dooray-cli");
|
|
535
|
+
function getSource(context) {
|
|
536
|
+
return import_node_path5.default.join(context.packageRoot, SKILL_RELATIVE_PATH);
|
|
537
|
+
}
|
|
538
|
+
function getDestination(context) {
|
|
539
|
+
return import_node_path5.default.join(context.homeDir, ".claude", "skills", "dooray-cli");
|
|
540
|
+
}
|
|
541
|
+
function getDataRoot(context) {
|
|
542
|
+
return context.dataRoot ?? import_node_path5.default.join(context.homeDir, ".local", "share", "dooray-cli");
|
|
543
|
+
}
|
|
544
|
+
function getStoreRoot(context) {
|
|
545
|
+
return import_node_path5.default.join(getDataRoot(context), "skills");
|
|
546
|
+
}
|
|
547
|
+
function getStorePath(context, contentDigest) {
|
|
548
|
+
return import_node_path5.default.join(
|
|
549
|
+
getStoreRoot(context),
|
|
550
|
+
`${context.currentVersion}-${getDigestHex(contentDigest)}`
|
|
551
|
+
);
|
|
552
|
+
}
|
|
553
|
+
function statusOf(context, status, overrides = {}) {
|
|
554
|
+
return {
|
|
555
|
+
schemaVersion: 1,
|
|
556
|
+
status,
|
|
557
|
+
destination: getDestination(context),
|
|
558
|
+
source: getSource(context),
|
|
559
|
+
currentVersion: context.currentVersion,
|
|
560
|
+
installedVersion: overrides.installedVersion ?? null,
|
|
561
|
+
linkTarget: overrides.linkTarget ?? null,
|
|
562
|
+
managed: overrides.managed ?? false
|
|
563
|
+
};
|
|
564
|
+
}
|
|
565
|
+
function isNodeError(error, code) {
|
|
566
|
+
return error instanceof Error && "code" in error && error.code === code;
|
|
567
|
+
}
|
|
568
|
+
function isPackageMetadata(value) {
|
|
569
|
+
return value != null && typeof value === "object" && "name" in value && "version" in value && typeof value.name === "string" && typeof value.version === "string";
|
|
570
|
+
}
|
|
571
|
+
async function readPackageMetadata(skillPath) {
|
|
572
|
+
const packageJsonPath = import_node_path5.default.join(skillPath, "..", "..", "package.json");
|
|
573
|
+
try {
|
|
574
|
+
const parsed = JSON.parse(
|
|
575
|
+
await fs2.readFile(packageJsonPath, "utf8")
|
|
576
|
+
);
|
|
577
|
+
if (!isPackageMetadata(parsed)) {
|
|
578
|
+
return null;
|
|
579
|
+
}
|
|
580
|
+
return parsed;
|
|
581
|
+
} catch {
|
|
582
|
+
return null;
|
|
583
|
+
}
|
|
584
|
+
}
|
|
585
|
+
function resolveLinkTarget(destination, linkTarget) {
|
|
586
|
+
return import_node_path5.default.resolve(import_node_path5.default.dirname(destination), linkTarget);
|
|
587
|
+
}
|
|
588
|
+
async function isSameEntry(left, right) {
|
|
589
|
+
try {
|
|
590
|
+
const [leftRealPath, rightRealPath] = await Promise.all([
|
|
591
|
+
fs2.realpath(left),
|
|
592
|
+
fs2.realpath(right)
|
|
593
|
+
]);
|
|
594
|
+
return leftRealPath === rightRealPath;
|
|
595
|
+
} catch {
|
|
596
|
+
return import_node_path5.default.resolve(left) === import_node_path5.default.resolve(right);
|
|
597
|
+
}
|
|
598
|
+
}
|
|
599
|
+
function isManagedSkillPath(candidate) {
|
|
600
|
+
const parts = import_node_path5.default.normalize(candidate).split(import_node_path5.default.sep).filter(Boolean);
|
|
601
|
+
const suffix = ["@bifos", "dooray-cli", "skills", "dooray-cli"];
|
|
602
|
+
if (parts.length < suffix.length) {
|
|
603
|
+
return false;
|
|
604
|
+
}
|
|
605
|
+
return suffix.every(
|
|
606
|
+
(part, index) => parts[parts.length - suffix.length + index] === part
|
|
607
|
+
);
|
|
608
|
+
}
|
|
609
|
+
function utcTimestamp() {
|
|
610
|
+
return (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-");
|
|
611
|
+
}
|
|
612
|
+
function isInsideStoreRoot(context, target) {
|
|
613
|
+
const relative = import_node_path5.default.relative(getStoreRoot(context), target);
|
|
614
|
+
return relative !== "" && !relative.startsWith("..") && !import_node_path5.default.isAbsolute(relative);
|
|
615
|
+
}
|
|
616
|
+
function parseStoreBasename(basename9) {
|
|
617
|
+
if (basename9.length < 66 || basename9[basename9.length - 65] !== "-") {
|
|
618
|
+
return null;
|
|
619
|
+
}
|
|
620
|
+
const packageVersion = basename9.slice(0, -65);
|
|
621
|
+
const digestHex = basename9.slice(-64);
|
|
622
|
+
if (!/^[0-9a-f]{64}$/.test(digestHex) || packageVersion.length === 0) {
|
|
623
|
+
return null;
|
|
624
|
+
}
|
|
625
|
+
return {
|
|
626
|
+
packageVersion,
|
|
627
|
+
contentDigest: `sha256:${digestHex}`
|
|
628
|
+
};
|
|
629
|
+
}
|
|
630
|
+
async function writeManifest(storePath, manifest) {
|
|
631
|
+
await fs2.writeFile(
|
|
632
|
+
import_node_path5.default.join(storePath, MANIFEST_FILE_NAME),
|
|
633
|
+
`${JSON.stringify(manifest, null, 2)}
|
|
634
|
+
`
|
|
635
|
+
);
|
|
636
|
+
}
|
|
637
|
+
async function copySkillContentFiles(source, destination) {
|
|
638
|
+
for (const relativePath of await collectSkillContentFiles(source)) {
|
|
639
|
+
const sourcePath = import_node_path5.default.join(source, relativePath);
|
|
640
|
+
const destinationPath = import_node_path5.default.join(destination, ...relativePath.split("/"));
|
|
641
|
+
await fs2.mkdir(import_node_path5.default.dirname(destinationPath), { recursive: true });
|
|
642
|
+
await fs2.copyFile(sourcePath, destinationPath);
|
|
643
|
+
}
|
|
644
|
+
}
|
|
645
|
+
async function verifyStore(storePath, expectedManifest) {
|
|
646
|
+
const basename9 = parseStoreBasename(import_node_path5.default.basename(storePath));
|
|
647
|
+
if (basename9 == null || basename9.packageVersion !== expectedManifest.packageVersion || basename9.contentDigest !== expectedManifest.contentDigest) {
|
|
648
|
+
return "corrupt";
|
|
649
|
+
}
|
|
650
|
+
const manifest = await readDooraySkillManifest(
|
|
651
|
+
import_node_path5.default.join(storePath, MANIFEST_FILE_NAME)
|
|
652
|
+
);
|
|
653
|
+
if (manifest == null || manifest.packageVersion !== expectedManifest.packageVersion || manifest.contentDigest !== expectedManifest.contentDigest) {
|
|
654
|
+
return "corrupt";
|
|
655
|
+
}
|
|
656
|
+
const actualDigest = await computeSkillContentDigest(storePath).catch(() => null);
|
|
657
|
+
if (actualDigest !== expectedManifest.contentDigest) {
|
|
658
|
+
return "modified";
|
|
659
|
+
}
|
|
660
|
+
return "valid";
|
|
661
|
+
}
|
|
662
|
+
async function createStagedStore(context, sourceDigest) {
|
|
663
|
+
const storeRoot = getStoreRoot(context);
|
|
664
|
+
const stagingPath = import_node_path5.default.join(
|
|
665
|
+
storeRoot,
|
|
666
|
+
`.tmp-${process.pid}-${Date.now()}-${getDigestHex(sourceDigest)}`
|
|
667
|
+
);
|
|
668
|
+
await fs2.mkdir(stagingPath, { recursive: true });
|
|
669
|
+
try {
|
|
670
|
+
await copySkillContentFiles(getSource(context), stagingPath);
|
|
671
|
+
const stagedDigest = await computeSkillContentDigest(stagingPath);
|
|
672
|
+
if (stagedDigest !== sourceDigest) {
|
|
673
|
+
throw new DoorayCliError(
|
|
674
|
+
`\uC2A4\uD0AC staging \uD574\uC2DC\uAC00 source \uD574\uC2DC\uC640 \uB2E4\uB985\uB2C8\uB2E4: ${stagedDigest}`,
|
|
675
|
+
1
|
|
676
|
+
);
|
|
677
|
+
}
|
|
678
|
+
await writeManifest(
|
|
679
|
+
stagingPath,
|
|
680
|
+
createDooraySkillManifest(context.currentVersion, sourceDigest)
|
|
681
|
+
);
|
|
682
|
+
return stagingPath;
|
|
683
|
+
} catch (error) {
|
|
684
|
+
await fs2.rm(stagingPath, { recursive: true, force: true }).catch(() => {
|
|
685
|
+
});
|
|
686
|
+
throw error;
|
|
687
|
+
}
|
|
688
|
+
}
|
|
689
|
+
async function prepareStore(context, options) {
|
|
690
|
+
const sourceDigest = await computeSkillContentDigest(getSource(context));
|
|
691
|
+
const expectedManifest = createDooraySkillManifest(
|
|
692
|
+
context.currentVersion,
|
|
693
|
+
sourceDigest
|
|
694
|
+
);
|
|
695
|
+
const storeRoot = getStoreRoot(context);
|
|
696
|
+
const storePath = getStorePath(context, sourceDigest);
|
|
697
|
+
await fs2.mkdir(storeRoot, { recursive: true });
|
|
698
|
+
const existing = await fs2.lstat(storePath).then((stat3) => stat3).catch((error) => {
|
|
699
|
+
if (isNodeError(error, "ENOENT")) {
|
|
700
|
+
return null;
|
|
701
|
+
}
|
|
702
|
+
throw error;
|
|
703
|
+
});
|
|
704
|
+
if (existing != null) {
|
|
705
|
+
if (!existing.isDirectory()) {
|
|
706
|
+
throw new DoorayCliError(
|
|
707
|
+
`\uAD00\uB9AC\uD615 \uC2A4\uD0AC \uC800\uC7A5 \uACBD\uB85C\uAC00 \uB514\uB809\uD130\uB9AC\uAC00 \uC544\uB2D9\uB2C8\uB2E4: ${storePath}`,
|
|
708
|
+
EXIT_PARAM_ERROR
|
|
709
|
+
);
|
|
710
|
+
}
|
|
711
|
+
const status = await verifyStore(storePath, expectedManifest);
|
|
712
|
+
if (status === "valid") {
|
|
713
|
+
return storePath;
|
|
714
|
+
}
|
|
715
|
+
if (options.force !== true) {
|
|
716
|
+
throw new DoorayCliError(
|
|
717
|
+
`\uAD00\uB9AC\uD615 \uC2A4\uD0AC \uC800\uC7A5\uC18C\uAC00 ${status} \uC0C1\uD0DC\uC785\uB2C8\uB2E4: ${storePath}`,
|
|
718
|
+
EXIT_PARAM_ERROR
|
|
719
|
+
);
|
|
720
|
+
}
|
|
721
|
+
}
|
|
722
|
+
const stagingPath = await createStagedStore(context, sourceDigest);
|
|
723
|
+
let quarantinePath = null;
|
|
724
|
+
try {
|
|
725
|
+
if (existing != null) {
|
|
726
|
+
quarantinePath = import_node_path5.default.join(
|
|
727
|
+
storeRoot,
|
|
728
|
+
`.backup-${utcTimestamp()}-${import_node_path5.default.basename(storePath)}`
|
|
729
|
+
);
|
|
730
|
+
await fs2.rename(storePath, quarantinePath);
|
|
731
|
+
}
|
|
732
|
+
await fs2.rename(stagingPath, storePath);
|
|
733
|
+
return storePath;
|
|
734
|
+
} catch (error) {
|
|
735
|
+
await fs2.rm(stagingPath, { recursive: true, force: true }).catch(() => {
|
|
736
|
+
});
|
|
737
|
+
if (quarantinePath != null) {
|
|
738
|
+
await fs2.rename(quarantinePath, storePath).catch(() => {
|
|
739
|
+
});
|
|
740
|
+
}
|
|
741
|
+
throw error;
|
|
742
|
+
}
|
|
743
|
+
}
|
|
744
|
+
async function assertSourceAvailable(source) {
|
|
745
|
+
const skillFile = import_node_path5.default.join(source, "SKILL.md");
|
|
746
|
+
try {
|
|
747
|
+
const [sourceStat, skillFileStat] = await Promise.all([
|
|
748
|
+
fs2.stat(source),
|
|
749
|
+
fs2.stat(skillFile)
|
|
750
|
+
]);
|
|
751
|
+
if (!sourceStat.isDirectory() || !skillFileStat.isFile()) {
|
|
752
|
+
throw new Error("invalid source shape");
|
|
753
|
+
}
|
|
754
|
+
} catch (error) {
|
|
755
|
+
const cause = error instanceof Error ? ` (${error.message})` : "";
|
|
756
|
+
throw new DoorayCliError(
|
|
757
|
+
`\uD328\uD0A4\uC9C0 \uC2A4\uD0AC \uD30C\uC77C\uC744 \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4: ${skillFile}${cause}`,
|
|
758
|
+
1
|
|
759
|
+
);
|
|
760
|
+
}
|
|
761
|
+
}
|
|
762
|
+
async function renameWithRollback(from, to, backupPath) {
|
|
763
|
+
try {
|
|
764
|
+
await fs2.rename(from, to);
|
|
765
|
+
} catch (error) {
|
|
766
|
+
if (backupPath != null) {
|
|
767
|
+
await fs2.rename(backupPath, to).catch(() => {
|
|
768
|
+
});
|
|
769
|
+
}
|
|
770
|
+
throw error;
|
|
771
|
+
}
|
|
772
|
+
}
|
|
773
|
+
async function inspectSkill(context) {
|
|
774
|
+
const destination = getDestination(context);
|
|
775
|
+
const source = getSource(context);
|
|
776
|
+
let stat3;
|
|
777
|
+
try {
|
|
778
|
+
stat3 = await fs2.lstat(destination);
|
|
779
|
+
} catch (error) {
|
|
780
|
+
if (isNodeError(error, "ENOENT")) {
|
|
781
|
+
return statusOf(context, "missing", { managed: true });
|
|
782
|
+
}
|
|
783
|
+
throw error;
|
|
784
|
+
}
|
|
785
|
+
if (!stat3.isSymbolicLink()) {
|
|
786
|
+
return statusOf(context, "unmanaged");
|
|
787
|
+
}
|
|
788
|
+
const linkTarget = await fs2.readlink(destination);
|
|
789
|
+
const absoluteTarget = resolveLinkTarget(destination, linkTarget);
|
|
790
|
+
try {
|
|
791
|
+
await fs2.stat(absoluteTarget);
|
|
792
|
+
} catch (error) {
|
|
793
|
+
if (!isNodeError(error, "ENOENT")) {
|
|
794
|
+
throw error;
|
|
795
|
+
}
|
|
796
|
+
return statusOf(context, "broken", {
|
|
797
|
+
linkTarget,
|
|
798
|
+
managed: isManagedSkillPath(absoluteTarget) || isInsideStoreRoot(context, absoluteTarget)
|
|
799
|
+
});
|
|
800
|
+
}
|
|
801
|
+
const sourceDigest = await computeSkillContentDigest(source).catch(() => null);
|
|
802
|
+
if (isInsideStoreRoot(context, absoluteTarget)) {
|
|
803
|
+
const manifest = await readDooraySkillManifest(
|
|
804
|
+
import_node_path5.default.join(absoluteTarget, MANIFEST_FILE_NAME)
|
|
805
|
+
);
|
|
806
|
+
if (manifest == null) {
|
|
807
|
+
return statusOf(context, "corrupt", { linkTarget, managed: true });
|
|
808
|
+
}
|
|
809
|
+
const basename9 = parseStoreBasename(import_node_path5.default.basename(absoluteTarget));
|
|
810
|
+
if (basename9 == null || basename9.packageVersion !== manifest.packageVersion || basename9.contentDigest !== manifest.contentDigest) {
|
|
811
|
+
return statusOf(context, "corrupt", {
|
|
812
|
+
installedVersion: manifest.packageVersion,
|
|
813
|
+
linkTarget,
|
|
814
|
+
managed: true
|
|
815
|
+
});
|
|
816
|
+
}
|
|
817
|
+
const actualDigest = await computeSkillContentDigest(absoluteTarget).catch(
|
|
818
|
+
() => null
|
|
819
|
+
);
|
|
820
|
+
if (actualDigest !== manifest.contentDigest) {
|
|
821
|
+
return statusOf(context, "modified", {
|
|
822
|
+
installedVersion: manifest.packageVersion,
|
|
823
|
+
linkTarget,
|
|
824
|
+
managed: true
|
|
825
|
+
});
|
|
826
|
+
}
|
|
827
|
+
if (manifest.packageVersion === context.currentVersion && sourceDigest === manifest.contentDigest) {
|
|
828
|
+
return statusOf(context, "current", {
|
|
829
|
+
installedVersion: manifest.packageVersion,
|
|
830
|
+
linkTarget,
|
|
831
|
+
managed: true
|
|
832
|
+
});
|
|
833
|
+
}
|
|
834
|
+
return statusOf(context, "outdated", {
|
|
835
|
+
installedVersion: manifest.packageVersion,
|
|
836
|
+
linkTarget,
|
|
837
|
+
managed: true
|
|
838
|
+
});
|
|
839
|
+
}
|
|
840
|
+
if (await isSameEntry(absoluteTarget, source)) {
|
|
841
|
+
return statusOf(context, "outdated", {
|
|
842
|
+
installedVersion: context.currentVersion,
|
|
843
|
+
linkTarget,
|
|
844
|
+
managed: true
|
|
845
|
+
});
|
|
846
|
+
}
|
|
847
|
+
const packageMetadata = await readPackageMetadata(absoluteTarget);
|
|
848
|
+
if (packageMetadata == null) {
|
|
849
|
+
return statusOf(context, "unmanaged", { linkTarget });
|
|
850
|
+
}
|
|
851
|
+
if (packageMetadata.name !== PACKAGE_NAME) {
|
|
852
|
+
return statusOf(context, "unmanaged", {
|
|
853
|
+
installedVersion: packageMetadata.version,
|
|
854
|
+
linkTarget
|
|
855
|
+
});
|
|
856
|
+
}
|
|
857
|
+
return statusOf(context, "outdated", {
|
|
858
|
+
installedVersion: packageMetadata.version,
|
|
859
|
+
linkTarget,
|
|
860
|
+
managed: true
|
|
861
|
+
});
|
|
862
|
+
}
|
|
863
|
+
async function installSkill(context, options = {}) {
|
|
864
|
+
await assertSourceAvailable(getSource(context));
|
|
865
|
+
const previous = await inspectSkill(context);
|
|
866
|
+
if (previous.status === "current") {
|
|
867
|
+
return {
|
|
868
|
+
previous,
|
|
869
|
+
current: previous,
|
|
870
|
+
changed: false,
|
|
871
|
+
backupPath: null
|
|
872
|
+
};
|
|
873
|
+
}
|
|
874
|
+
if ((previous.status === "modified" || previous.status === "corrupt") && options.force !== true) {
|
|
875
|
+
throw new DoorayCliError(
|
|
876
|
+
`Claude Code \uC2A4\uD0AC \uAD00\uB9AC \uC800\uC7A5\uC18C\uAC00 ${previous.status} \uC0C1\uD0DC\uC785\uB2C8\uB2E4. \uB0B4\uC6A9\uC744 \uD655\uC778\uD55C \uB4A4 dooray skill update --force\uB85C \uBCF5\uAD6C\uD558\uC138\uC694: ${previous.destination}`,
|
|
877
|
+
EXIT_PARAM_ERROR
|
|
878
|
+
);
|
|
879
|
+
}
|
|
880
|
+
if (!previous.managed && options.force !== true) {
|
|
881
|
+
throw new DoorayCliError(
|
|
882
|
+
`Claude Code \uC2A4\uD0AC \uACBD\uB85C\uAC00 dooray-cli\uC5D0\uC11C \uAD00\uB9AC\uD55C \uD56D\uBAA9\uC774 \uC544\uB2D9\uB2C8\uB2E4: ${previous.destination}`,
|
|
883
|
+
EXIT_PARAM_ERROR
|
|
884
|
+
);
|
|
885
|
+
}
|
|
886
|
+
const storePath = await prepareStore(context, options);
|
|
887
|
+
await fs2.mkdir(import_node_path5.default.dirname(previous.destination), { recursive: true });
|
|
888
|
+
const tempPath = `${previous.destination}.tmp-${process.pid}-${Date.now()}`;
|
|
889
|
+
let backupPath = null;
|
|
890
|
+
try {
|
|
891
|
+
await fs2.symlink(storePath, tempPath);
|
|
892
|
+
if (!previous.managed && options.force === true) {
|
|
893
|
+
backupPath = `${previous.destination}.backup-${utcTimestamp()}`;
|
|
894
|
+
await fs2.rename(previous.destination, backupPath);
|
|
895
|
+
}
|
|
896
|
+
await renameWithRollback(tempPath, previous.destination, backupPath);
|
|
897
|
+
const current2 = await inspectSkill(context);
|
|
898
|
+
if (current2.status !== "current") {
|
|
899
|
+
let recovery = "\uBC31\uC5C5 \uC5C6\uC74C, \uC0C8 \uB9C1\uD06C \uC0C1\uD0DC\uB97C \uC720\uC9C0\uD588\uC2B5\uB2C8\uB2E4";
|
|
900
|
+
if (backupPath != null) {
|
|
901
|
+
try {
|
|
902
|
+
await fs2.rename(backupPath, previous.destination);
|
|
903
|
+
recovery = `\uBC31\uC5C5 \uBCF5\uAD6C \uC644\uB8CC: ${backupPath}`;
|
|
904
|
+
} catch {
|
|
905
|
+
recovery = `\uBC31\uC5C5 \uBCF5\uAD6C \uC2E4\uD328, \uC0C8 \uB9C1\uD06C \uC720\uC9C0 \uC0C1\uD0DC\uC77C \uC218 \uC788\uC74C: ${previous.destination}`;
|
|
906
|
+
}
|
|
907
|
+
}
|
|
908
|
+
throw new DoorayCliError(
|
|
909
|
+
`Claude Code \uC2A4\uD0AC \uC124\uCE58 \uD6C4 \uC0C1\uD0DC\uAC00 current\uAC00 \uC544\uB2D9\uB2C8\uB2E4: ${current2.status} (${recovery})`,
|
|
910
|
+
1
|
|
911
|
+
);
|
|
912
|
+
}
|
|
913
|
+
return {
|
|
914
|
+
previous,
|
|
915
|
+
current: current2,
|
|
916
|
+
changed: true,
|
|
917
|
+
backupPath
|
|
918
|
+
};
|
|
919
|
+
} catch (error) {
|
|
920
|
+
await fs2.rm(tempPath, { force: true }).catch(() => {
|
|
921
|
+
});
|
|
922
|
+
throw error;
|
|
923
|
+
}
|
|
924
|
+
}
|
|
925
|
+
|
|
370
926
|
// src/api/client.ts
|
|
371
927
|
var import_ky = __toESM(require("ky"));
|
|
372
928
|
var import_promises3 = require("fs/promises");
|
|
373
|
-
var
|
|
929
|
+
var import_node_path6 = require("path");
|
|
374
930
|
|
|
375
931
|
// src/utils/dooray-message.ts
|
|
376
932
|
function normalizeDoorayMessage(raw) {
|
|
@@ -788,7 +1344,7 @@ var DoorayApiClient = class {
|
|
|
788
1344
|
}
|
|
789
1345
|
async uploadPostFile(projectId, postId, filePath) {
|
|
790
1346
|
try {
|
|
791
|
-
const fileName = (0,
|
|
1347
|
+
const fileName = (0, import_node_path6.basename)(filePath);
|
|
792
1348
|
const fileBuffer = await (0, import_promises3.readFile)(filePath);
|
|
793
1349
|
const formData = new FormData();
|
|
794
1350
|
formData.append("file", new Blob([fileBuffer]), fileName);
|
|
@@ -833,7 +1389,7 @@ var DoorayApiClient = class {
|
|
|
833
1389
|
// ─── Wiki Page Files (ADR-029) ──────────────────────
|
|
834
1390
|
async uploadWikiPageFile(wikiId, pageId, filePath, type) {
|
|
835
1391
|
try {
|
|
836
|
-
const fileName = (0,
|
|
1392
|
+
const fileName = (0, import_node_path6.basename)(filePath);
|
|
837
1393
|
const fileBuffer = await (0, import_promises3.readFile)(filePath);
|
|
838
1394
|
const buildFormData = () => {
|
|
839
1395
|
const fd = new FormData();
|
|
@@ -898,7 +1454,7 @@ var DoorayApiClient = class {
|
|
|
898
1454
|
let fileName = `file-${fileId}`;
|
|
899
1455
|
if (disposition) {
|
|
900
1456
|
const match = disposition.match(/filename\*?=(?:UTF-8''|"?)([^";]+)/i);
|
|
901
|
-
if (match) fileName = (0,
|
|
1457
|
+
if (match) fileName = (0, import_node_path6.basename)(decodeURIComponent(match[1].replace(/"/g, "")));
|
|
902
1458
|
}
|
|
903
1459
|
const buffer = await fileRes.arrayBuffer();
|
|
904
1460
|
return { buffer, fileName };
|
|
@@ -1041,6 +1597,28 @@ async function ensureMe(client) {
|
|
|
1041
1597
|
}
|
|
1042
1598
|
|
|
1043
1599
|
// src/commands/doctor.ts
|
|
1600
|
+
function formatSkillStatus(status) {
|
|
1601
|
+
switch (status.status) {
|
|
1602
|
+
case "current":
|
|
1603
|
+
return import_chalk3.default.green(`\u2705 \uCD5C\uC2E0 (${status.currentVersion})`);
|
|
1604
|
+
case "missing":
|
|
1605
|
+
return import_chalk3.default.red("\u274C \uBBF8\uC124\uCE58 \u2014 dooray skill install");
|
|
1606
|
+
case "outdated":
|
|
1607
|
+
return import_chalk3.default.yellow(
|
|
1608
|
+
`\u26A0\uFE0F \uC624\uB798\uB428 (${status.installedVersion ?? "unknown"} \u2192 ${status.currentVersion}) \u2014 dooray skill update`
|
|
1609
|
+
);
|
|
1610
|
+
case "broken":
|
|
1611
|
+
return import_chalk3.default.yellow("\u26A0\uFE0F \uB9C1\uD06C \uAE68\uC9D0 \u2014 dooray skill update");
|
|
1612
|
+
case "corrupt":
|
|
1613
|
+
return import_chalk3.default.yellow("\u26A0\uFE0F \uAD00\uB9AC \uC800\uC7A5\uC18C \uC815\uBCF4 \uC190\uC0C1 \u2014 dooray skill update --force");
|
|
1614
|
+
case "unmanaged":
|
|
1615
|
+
return import_chalk3.default.yellow(
|
|
1616
|
+
"\u26A0\uFE0F \uAD00\uB9AC\uB418\uC9C0 \uC54A\uB294 \uD56D\uBAA9 \u2014 dooray skill update --force"
|
|
1617
|
+
);
|
|
1618
|
+
case "modified":
|
|
1619
|
+
return import_chalk3.default.yellow("\u26A0\uFE0F \uC218\uC815\uB428 \u2014 dooray skill update --force");
|
|
1620
|
+
}
|
|
1621
|
+
}
|
|
1044
1622
|
var doctorCommand = new import_commander3.Command("doctor").description("\uC124\uC815 \uBC0F \uD658\uACBD \uC9C4\uB2E8").action(async () => {
|
|
1045
1623
|
console.log(import_chalk3.default.bold("\n\u{1F50D} Dooray CLI \uC9C4\uB2E8\n"));
|
|
1046
1624
|
const config = await getConfig();
|
|
@@ -1076,27 +1654,10 @@ var doctorCommand = new import_commander3.Command("doctor").description("\uC124\
|
|
|
1076
1654
|
const claudeDirExists = await import_promises4.default.access(claudeDir).then(() => true).catch(() => false);
|
|
1077
1655
|
if (claudeDirExists) {
|
|
1078
1656
|
console.log(import_chalk3.default.bold("\n\u{1F527} Claude Code \uC2A4\uD0AC\n"));
|
|
1079
|
-
const
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
const target = await import_promises4.default.readlink(skillDst);
|
|
1084
|
-
const targetExists = await import_promises4.default.access(target).then(() => true).catch(() => false);
|
|
1085
|
-
if (targetExists) {
|
|
1086
|
-
console.log(` dooray-cli: ${import_chalk3.default.green("\u2705 \uC124\uCE58\uB428 (\uC2EC\uBCFC\uB9AD \uB9C1\uD06C)")}`);
|
|
1087
|
-
} else {
|
|
1088
|
-
console.log(
|
|
1089
|
-
` dooray-cli: ${import_chalk3.default.yellow("\u26A0\uFE0F \uB9C1\uD06C \uAE68\uC9D0 \u2014 dooray setup\uC73C\uB85C \uC7AC\uC124\uCE58")}`
|
|
1090
|
-
);
|
|
1091
|
-
}
|
|
1092
|
-
} else {
|
|
1093
|
-
console.log(` dooray-cli: ${import_chalk3.default.green("\u2705 \uC124\uCE58\uB428 (\uBCF5\uC0AC\uBCF8)")}`);
|
|
1094
|
-
}
|
|
1095
|
-
} catch {
|
|
1096
|
-
console.log(
|
|
1097
|
-
` dooray-cli: ${import_chalk3.default.red("\u274C \uBBF8\uC124\uCE58 \u2014 dooray setup\uC73C\uB85C \uC124\uCE58")}`
|
|
1098
|
-
);
|
|
1099
|
-
}
|
|
1657
|
+
const skillStatus = await inspectSkill(createSkillManagerContext());
|
|
1658
|
+
console.log(` dooray-cli: ${formatSkillStatus(skillStatus)}`);
|
|
1659
|
+
console.log(` \uC124\uCE58 \uACBD\uB85C: ${skillStatus.destination}`);
|
|
1660
|
+
console.log(` \uB9C1\uD06C \uB300\uC0C1: ${skillStatus.linkTarget ?? "-"}`);
|
|
1100
1661
|
}
|
|
1101
1662
|
console.log();
|
|
1102
1663
|
if (apiKeyOk && baseUrlOk) {
|
|
@@ -1199,25 +1760,21 @@ var setupCommand = new import_commander4.Command("setup").description("\uB300\uD
|
|
|
1199
1760
|
)
|
|
1200
1761
|
);
|
|
1201
1762
|
} else {
|
|
1202
|
-
const
|
|
1763
|
+
const installSkill2 = await confirm2({
|
|
1203
1764
|
message: "Claude Code \uC2A4\uD0AC\uC744 \uC124\uCE58\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?",
|
|
1204
1765
|
default: true,
|
|
1205
1766
|
theme: { prefix: "\u{1F527}" }
|
|
1206
1767
|
});
|
|
1207
|
-
if (
|
|
1768
|
+
if (installSkill2) {
|
|
1208
1769
|
try {
|
|
1209
|
-
|
|
1210
|
-
const skillsDir = import_path2.default.join(claudeDir, "skills");
|
|
1211
|
-
const skillDst = import_path2.default.join(skillsDir, "dooray-cli");
|
|
1212
|
-
await import_promises5.default.mkdir(skillsDir, { recursive: true });
|
|
1213
|
-
await import_promises5.default.lstat(skillDst).then(() => import_promises5.default.rm(skillDst, { recursive: true, force: true })).catch(() => {
|
|
1214
|
-
});
|
|
1215
|
-
await import_promises5.default.symlink(skillSrc, skillDst);
|
|
1770
|
+
await installSkill(createSkillManagerContext());
|
|
1216
1771
|
console.log(import_chalk4.default.green(" \u2713 Claude Code \uC2A4\uD0AC \uC124\uCE58 \uC644\uB8CC"));
|
|
1217
1772
|
} catch (err) {
|
|
1773
|
+
const reason = err instanceof Error ? err.message : String(err);
|
|
1218
1774
|
console.log(
|
|
1219
1775
|
import_chalk4.default.yellow(
|
|
1220
|
-
` \u26A0 \uC2A4\uD0AC \uC124\uCE58 \uC2E4\uD328: ${
|
|
1776
|
+
` \u26A0 \uC2A4\uD0AC \uC124\uCE58 \uC2E4\uD328: ${reason}
|
|
1777
|
+
\uD544\uC694\uD558\uBA74 \uB0B4\uC6A9\uC744 \uD655\uC778\uD55C \uB4A4 dooray skill update --force\uB97C \uC2E4\uD589\uD558\uC138\uC694.`
|
|
1221
1778
|
)
|
|
1222
1779
|
);
|
|
1223
1780
|
}
|
|
@@ -1257,8 +1814,85 @@ var setupCommand = new import_commander4.Command("setup").description("\uB300\uD
|
|
|
1257
1814
|
}
|
|
1258
1815
|
});
|
|
1259
1816
|
|
|
1260
|
-
// src/commands/
|
|
1817
|
+
// src/commands/skill.ts
|
|
1261
1818
|
var import_commander5 = require("commander");
|
|
1819
|
+
var import_chalk5 = __toESM(require("chalk"));
|
|
1820
|
+
function statusHint(status) {
|
|
1821
|
+
switch (status.status) {
|
|
1822
|
+
case "current":
|
|
1823
|
+
return "\uC870\uCE58 \uC5C6\uC74C";
|
|
1824
|
+
case "missing":
|
|
1825
|
+
return "dooray skill install";
|
|
1826
|
+
case "outdated":
|
|
1827
|
+
case "broken":
|
|
1828
|
+
return "dooray skill update";
|
|
1829
|
+
case "modified":
|
|
1830
|
+
case "corrupt":
|
|
1831
|
+
case "unmanaged":
|
|
1832
|
+
return "\uB0B4\uC6A9 \uD655\uC778 \uD6C4 dooray skill update --force";
|
|
1833
|
+
}
|
|
1834
|
+
}
|
|
1835
|
+
function printStatus(status, options) {
|
|
1836
|
+
if (options.json) {
|
|
1837
|
+
console.log(JSON.stringify(status, null, 2));
|
|
1838
|
+
return;
|
|
1839
|
+
}
|
|
1840
|
+
if (options.quiet) {
|
|
1841
|
+
console.log(status.status);
|
|
1842
|
+
return;
|
|
1843
|
+
}
|
|
1844
|
+
console.log(`\uC0C1\uD0DC: ${status.status}`);
|
|
1845
|
+
console.log(`\uD604\uC7AC \uBC84\uC804: ${status.currentVersion}`);
|
|
1846
|
+
console.log(`\uC124\uCE58 \uBC84\uC804: ${status.installedVersion ?? "-"}`);
|
|
1847
|
+
console.log(`\uB9C1\uD06C \uB300\uC0C1: ${status.linkTarget ?? "-"}`);
|
|
1848
|
+
console.log(`\uC124\uCE58 \uACBD\uB85C: ${status.destination}`);
|
|
1849
|
+
console.log(`\uBCF5\uAD6C \uBC29\uBC95: ${statusHint(status)}`);
|
|
1850
|
+
}
|
|
1851
|
+
function printInstallResult(result, options) {
|
|
1852
|
+
if (options.json) {
|
|
1853
|
+
console.log(JSON.stringify(result, null, 2));
|
|
1854
|
+
return;
|
|
1855
|
+
}
|
|
1856
|
+
if (options.quiet) {
|
|
1857
|
+
console.log(result.current.status);
|
|
1858
|
+
return;
|
|
1859
|
+
}
|
|
1860
|
+
if (result.changed) {
|
|
1861
|
+
console.log(import_chalk5.default.green("\u2713 Claude Code \uC2A4\uD0AC \uC124\uCE58 \uC644\uB8CC"));
|
|
1862
|
+
} else {
|
|
1863
|
+
console.log(import_chalk5.default.green("\u2713 Claude Code \uC2A4\uD0AC\uC774 \uC774\uBBF8 \uCD5C\uC2E0\uC785\uB2C8\uB2E4"));
|
|
1864
|
+
}
|
|
1865
|
+
console.log(`\uC0C1\uD0DC: ${result.current.status}`);
|
|
1866
|
+
console.log(`\uD604\uC7AC \uBC84\uC804: ${result.current.currentVersion}`);
|
|
1867
|
+
console.log(`\uC124\uCE58 \uBC84\uC804: ${result.current.installedVersion ?? "-"}`);
|
|
1868
|
+
console.log(`\uB9C1\uD06C \uB300\uC0C1: ${result.current.linkTarget ?? "-"}`);
|
|
1869
|
+
console.log(`\uBCF5\uAD6C \uBC29\uBC95: ${statusHint(result.current)}`);
|
|
1870
|
+
if (result.backupPath != null) {
|
|
1871
|
+
console.log(`\uBC31\uC5C5 \uACBD\uB85C: ${result.backupPath}`);
|
|
1872
|
+
}
|
|
1873
|
+
}
|
|
1874
|
+
var skillCommand = new import_commander5.Command("skill").description(
|
|
1875
|
+
"Claude Code \uC2A4\uD0AC \uAD00\uB9AC"
|
|
1876
|
+
);
|
|
1877
|
+
var skillStatusCommand = skillCommand.command("status").description("Claude Code \uC2A4\uD0AC \uC124\uCE58 \uC0C1\uD0DC \uC870\uD68C").option("--json", "JSON \uD615\uC2DD\uC73C\uB85C \uCD9C\uB825").option("--quiet", "\uC0C1\uD0DC \uD1A0\uD070\uB9CC \uCD9C\uB825").action(async () => {
|
|
1878
|
+
const options = skillStatusCommand.optsWithGlobals();
|
|
1879
|
+
const status = await inspectSkill(createSkillManagerContext());
|
|
1880
|
+
printStatus(status, options);
|
|
1881
|
+
});
|
|
1882
|
+
function addInstallCommand(name, description) {
|
|
1883
|
+
const command = skillCommand.command(name).description(description).option("--force", "\uAE30\uC874 \uD56D\uBAA9 \uB610\uB294 \uC190\uC0C1\uB41C \uAD00\uB9AC \uC800\uC7A5\uC18C\uB97C \uBC31\uC5C5 \uD6C4 \uAD50\uCCB4").option("--json", "JSON \uD615\uC2DD\uC73C\uB85C \uCD9C\uB825").option("--quiet", "\uC0C1\uD0DC \uD1A0\uD070\uB9CC \uCD9C\uB825").action(async () => {
|
|
1884
|
+
const options = command.optsWithGlobals();
|
|
1885
|
+
const result = await installSkill(createSkillManagerContext(), {
|
|
1886
|
+
force: options.force
|
|
1887
|
+
});
|
|
1888
|
+
printInstallResult(result, options);
|
|
1889
|
+
});
|
|
1890
|
+
}
|
|
1891
|
+
addInstallCommand("install", "Claude Code \uC2A4\uD0AC \uC124\uCE58");
|
|
1892
|
+
addInstallCommand("update", "Claude Code \uC2A4\uD0AC\uC744 \uD604\uC7AC CLI \uBC84\uC804\uC73C\uB85C \uAC31\uC2E0");
|
|
1893
|
+
|
|
1894
|
+
// src/commands/project/list.ts
|
|
1895
|
+
var import_commander6 = require("commander");
|
|
1262
1896
|
|
|
1263
1897
|
// src/resolvers/project.ts
|
|
1264
1898
|
var PROJECT_ID_RE = /^\d{15,}$/;
|
|
@@ -1373,8 +2007,8 @@ function stopSpinner(success, text) {
|
|
|
1373
2007
|
}
|
|
1374
2008
|
|
|
1375
2009
|
// src/commands/project/list.ts
|
|
1376
|
-
var projectListCommand = new
|
|
1377
|
-
new
|
|
2010
|
+
var projectListCommand = new import_commander6.Command("list").description("\uD504\uB85C\uC81D\uD2B8 \uBAA9\uB85D \uC870\uD68C").option("-s, --search <keyword>", "code \uD544\uD130\uB9C1").addOption(
|
|
2011
|
+
new import_commander6.Option("-t, --type <type>", "\uD504\uB85C\uC81D\uD2B8 \uD0C0\uC785 \uD544\uD130").choices(["public", "private"]).default("public")
|
|
1378
2012
|
).action(async (opts) => {
|
|
1379
2013
|
const globalOpts = projectListCommand.optsWithGlobals();
|
|
1380
2014
|
const config = await getConfigOrThrow();
|
|
@@ -1397,7 +2031,7 @@ var projectListCommand = new import_commander5.Command("list").description("\uD5
|
|
|
1397
2031
|
});
|
|
1398
2032
|
|
|
1399
2033
|
// src/commands/project/members.ts
|
|
1400
|
-
var
|
|
2034
|
+
var import_commander7 = require("commander");
|
|
1401
2035
|
|
|
1402
2036
|
// src/resolvers/match.ts
|
|
1403
2037
|
function matchByName(items, input2, label, renderCandidate, options) {
|
|
@@ -1536,7 +2170,7 @@ async function resolveMember(client, projectId, input2) {
|
|
|
1536
2170
|
}
|
|
1537
2171
|
|
|
1538
2172
|
// src/commands/project/members.ts
|
|
1539
|
-
var projectMembersCommand = new
|
|
2173
|
+
var projectMembersCommand = new import_commander7.Command("members").description("\uD504\uB85C\uC81D\uD2B8 \uBA64\uBC84 \uBAA9\uB85D \uC870\uD68C").argument("<project>", "\uD504\uB85C\uC81D\uD2B8 \uCF54\uB4DC \uB610\uB294 ID").action(async (project) => {
|
|
1540
2174
|
const globalOpts = projectMembersCommand.optsWithGlobals();
|
|
1541
2175
|
const config = await getConfigOrThrow();
|
|
1542
2176
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -1556,7 +2190,7 @@ var projectMembersCommand = new import_commander6.Command("members").description
|
|
|
1556
2190
|
});
|
|
1557
2191
|
|
|
1558
2192
|
// src/commands/project/workflows.ts
|
|
1559
|
-
var
|
|
2193
|
+
var import_commander8 = require("commander");
|
|
1560
2194
|
|
|
1561
2195
|
// src/resolvers/workflow.ts
|
|
1562
2196
|
async function ensureWorkflows(client, projectId) {
|
|
@@ -1589,7 +2223,7 @@ async function resolveWorkflow(client, projectId, input2) {
|
|
|
1589
2223
|
}
|
|
1590
2224
|
|
|
1591
2225
|
// src/commands/project/workflows.ts
|
|
1592
|
-
var projectWorkflowsCommand = new
|
|
2226
|
+
var projectWorkflowsCommand = new import_commander8.Command("workflows").description("\uD504\uB85C\uC81D\uD2B8 \uC6CC\uD06C\uD50C\uB85C\uC6B0 \uBAA9\uB85D \uC870\uD68C").argument("<project>", "\uD504\uB85C\uC81D\uD2B8 \uCF54\uB4DC \uB610\uB294 ID").action(async (project) => {
|
|
1593
2227
|
const globalOpts = projectWorkflowsCommand.optsWithGlobals();
|
|
1594
2228
|
const config = await getConfigOrThrow();
|
|
1595
2229
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -1611,7 +2245,7 @@ var projectWorkflowsCommand = new import_commander7.Command("workflows").descrip
|
|
|
1611
2245
|
});
|
|
1612
2246
|
|
|
1613
2247
|
// src/commands/project/groups.ts
|
|
1614
|
-
var
|
|
2248
|
+
var import_commander9 = require("commander");
|
|
1615
2249
|
|
|
1616
2250
|
// src/resolvers/member-group.ts
|
|
1617
2251
|
var GROUP_ID_RE = /^\d{15,}$/;
|
|
@@ -1672,7 +2306,7 @@ async function resolveMemberGroup(client, projectId, input2) {
|
|
|
1672
2306
|
}
|
|
1673
2307
|
|
|
1674
2308
|
// src/commands/project/groups.ts
|
|
1675
|
-
var projectGroupsCommand = new
|
|
2309
|
+
var projectGroupsCommand = new import_commander9.Command("groups").description("\uD504\uB85C\uC81D\uD2B8 \uBA64\uBC84 \uADF8\uB8F9 \uBAA9\uB85D \uC870\uD68C").argument("<project>", "\uD504\uB85C\uC81D\uD2B8 \uCF54\uB4DC \uB610\uB294 ID").action(async (project) => {
|
|
1676
2310
|
const globalOpts = projectGroupsCommand.optsWithGlobals();
|
|
1677
2311
|
const config = await getConfigOrThrow();
|
|
1678
2312
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -1689,7 +2323,7 @@ var projectGroupsCommand = new import_commander8.Command("groups").description("
|
|
|
1689
2323
|
});
|
|
1690
2324
|
|
|
1691
2325
|
// src/commands/project/tags.ts
|
|
1692
|
-
var
|
|
2326
|
+
var import_commander10 = require("commander");
|
|
1693
2327
|
|
|
1694
2328
|
// src/resolvers/tag.ts
|
|
1695
2329
|
async function fetchAllTags(client, projectId) {
|
|
@@ -1858,7 +2492,7 @@ async function validateMandatoryCoverage(client, projectId, selectedTagIds) {
|
|
|
1858
2492
|
}
|
|
1859
2493
|
|
|
1860
2494
|
// src/commands/project/tags.ts
|
|
1861
|
-
var projectTagsCommand = new
|
|
2495
|
+
var projectTagsCommand = new import_commander10.Command("tags").description("\uD504\uB85C\uC81D\uD2B8 \uD0DC\uADF8 \uBAA9\uB85D \uC870\uD68C").argument("<project>", "\uD504\uB85C\uC81D\uD2B8 \uCF54\uB4DC \uB610\uB294 ID").action(async (project) => {
|
|
1862
2496
|
const globalOpts = projectTagsCommand.optsWithGlobals();
|
|
1863
2497
|
const config = await getConfigOrThrow();
|
|
1864
2498
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -1881,7 +2515,7 @@ var projectTagsCommand = new import_commander9.Command("tags").description("\uD5
|
|
|
1881
2515
|
});
|
|
1882
2516
|
|
|
1883
2517
|
// src/commands/project/templates.ts
|
|
1884
|
-
var
|
|
2518
|
+
var import_commander11 = require("commander");
|
|
1885
2519
|
|
|
1886
2520
|
// src/resolvers/template.ts
|
|
1887
2521
|
var TEMPLATE_ID_RE = /^\d{15,}$/;
|
|
@@ -1920,7 +2554,7 @@ async function resolveTemplate(client, projectId, input2) {
|
|
|
1920
2554
|
}
|
|
1921
2555
|
|
|
1922
2556
|
// src/commands/project/templates.ts
|
|
1923
|
-
var projectTemplatesCommand = new
|
|
2557
|
+
var projectTemplatesCommand = new import_commander11.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) => {
|
|
1924
2558
|
const globalOpts = projectTemplatesCommand.optsWithGlobals();
|
|
1925
2559
|
const config = await getConfigOrThrow();
|
|
1926
2560
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -1942,7 +2576,7 @@ var projectTemplatesCommand = new import_commander10.Command("templates").descri
|
|
|
1942
2576
|
});
|
|
1943
2577
|
|
|
1944
2578
|
// src/commands/post/list.ts
|
|
1945
|
-
var
|
|
2579
|
+
var import_commander12 = require("commander");
|
|
1946
2580
|
|
|
1947
2581
|
// src/formatters/post.ts
|
|
1948
2582
|
function formatPostList(posts, opts) {
|
|
@@ -1993,7 +2627,7 @@ function formatCommentList(comments, opts) {
|
|
|
1993
2627
|
}
|
|
1994
2628
|
|
|
1995
2629
|
// src/commands/post/list.ts
|
|
1996
|
-
var postListCommand = new
|
|
2630
|
+
var postListCommand = new import_commander12.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) => {
|
|
1997
2631
|
const globalOpts = postListCommand.optsWithGlobals();
|
|
1998
2632
|
const config = await getConfigOrThrow();
|
|
1999
2633
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -2027,8 +2661,8 @@ var postListCommand = new import_commander11.Command("list").description("\uC5C5
|
|
|
2027
2661
|
});
|
|
2028
2662
|
|
|
2029
2663
|
// src/commands/post/search.ts
|
|
2030
|
-
var
|
|
2031
|
-
var postSearchCommand = new
|
|
2664
|
+
var import_commander13 = require("commander");
|
|
2665
|
+
var postSearchCommand = new import_commander13.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) => {
|
|
2032
2666
|
const globalOpts = postSearchCommand.optsWithGlobals();
|
|
2033
2667
|
const config = await getConfigOrThrow();
|
|
2034
2668
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -2040,7 +2674,7 @@ var postSearchCommand = new import_commander12.Command("search").description("\u
|
|
|
2040
2674
|
});
|
|
2041
2675
|
|
|
2042
2676
|
// src/commands/post/get.ts
|
|
2043
|
-
var
|
|
2677
|
+
var import_commander14 = require("commander");
|
|
2044
2678
|
|
|
2045
2679
|
// src/resolvers/post.ts
|
|
2046
2680
|
async function resolvePost(client, projectId, postNumber) {
|
|
@@ -2188,7 +2822,7 @@ ${URL_FORMAT_HINT}`,
|
|
|
2188
2822
|
}
|
|
2189
2823
|
|
|
2190
2824
|
// src/commands/post/get.ts
|
|
2191
|
-
var postGetCommand = new
|
|
2825
|
+
var postGetCommand = new import_commander14.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) => {
|
|
2192
2826
|
const globalOpts = postGetCommand.optsWithGlobals();
|
|
2193
2827
|
const config = await getConfigOrThrow();
|
|
2194
2828
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -2205,7 +2839,7 @@ var postGetCommand = new import_commander13.Command("get").description("\uC5C5\u
|
|
|
2205
2839
|
});
|
|
2206
2840
|
|
|
2207
2841
|
// src/commands/post/edit.ts
|
|
2208
|
-
var
|
|
2842
|
+
var import_commander15 = require("commander");
|
|
2209
2843
|
|
|
2210
2844
|
// src/utils/mention.ts
|
|
2211
2845
|
function buildMemberMention(m, me) {
|
|
@@ -2589,7 +3223,7 @@ async function resolveUsers(client, projectId, names) {
|
|
|
2589
3223
|
}
|
|
2590
3224
|
return users;
|
|
2591
3225
|
}
|
|
2592
|
-
var postEditCommand = new
|
|
3226
|
+
var postEditCommand = new import_commander15.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) => {
|
|
2593
3227
|
const config = await getConfigOrThrow();
|
|
2594
3228
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
2595
3229
|
const mentionInputs = (opts.mention ?? []).filter((s) => s.length > 0);
|
|
@@ -2771,7 +3405,7 @@ var postEditCommand = new import_commander14.Command("edit").description("\uC5C5
|
|
|
2771
3405
|
});
|
|
2772
3406
|
|
|
2773
3407
|
// src/commands/post/create.ts
|
|
2774
|
-
var
|
|
3408
|
+
var import_commander16 = require("commander");
|
|
2775
3409
|
|
|
2776
3410
|
// src/resolvers/milestone.ts
|
|
2777
3411
|
async function fetchAllMilestones(client, projectId) {
|
|
@@ -2817,7 +3451,7 @@ function postUserToCreate(u) {
|
|
|
2817
3451
|
group: u.group
|
|
2818
3452
|
};
|
|
2819
3453
|
}
|
|
2820
|
-
var postCreateCommand = new
|
|
3454
|
+
var postCreateCommand = new import_commander16.Command("create").description("\uC5C5\uBB34 \uC0DD\uC131").argument("<project>", "\uD504\uB85C\uC81D\uD2B8 \uCF54\uB4DC \uB610\uB294 ID").option("--title <title>", "\uC5C5\uBB34 \uC81C\uBAA9").option("--subject <subject>", "--title\uC758 deprecated alias").option("--to <members...>", "\uB2F4\uB2F9\uC790 (\uC774\uB984 \uB610\uB294 \uC774\uBA54\uC77C, \uC5EC\uB7EC \uBA85 \uAC00\uB2A5)").option("--to-group <code>", "\uB2F4\uB2F9\uC790(to) \uADF8\uB8F9 \uCD94\uAC00 (\uBC18\uBCF5 \uAC00\uB2A5, \uADF8\uB8F9 \uCF54\uB4DC \uBD80\uBD84\uC77C\uCE58)", (v, prev) => [...prev, v], []).option("--cc <members...>", "\uCC38\uC870\uC790 (\uC774\uB984 \uB610\uB294 \uC774\uBA54\uC77C, \uC5EC\uB7EC \uBA85 \uAC00\uB2A5)").option("--cc-group <code>", "\uCC38\uC870\uC790(cc) \uADF8\uB8F9 \uCD94\uAC00 (\uBC18\uBCF5 \uAC00\uB2A5, \uADF8\uB8F9 \uCF54\uB4DC \uBD80\uBD84\uC77C\uCE58)", (v, prev) => [...prev, v], []).option("--body <text>", "\uBCF8\uBB38 \uD14D\uC2A4\uD2B8 (- \uC785\uB825 \uC2DC stdin\uC5D0\uC11C \uC77D\uAE30)").option("--body-file <path>", "\uBCF8\uBB38 \uD30C\uC77C \uACBD\uB85C (- \uC785\uB825 \uC2DC stdin\uC5D0\uC11C \uC77D\uAE30)").option("--priority <level>", "\uC6B0\uC120\uC21C\uC704 (highest, high, normal, low, lowest)", "normal").option("--due-date <date>", "\uB9C8\uAC10\uC77C (ISO 8601 \uD615\uC2DD)").option("--tag <name>", "\uD0DC\uADF8 \uC774\uB984 (\uBC18\uBCF5 \uAC00\uB2A5)", (value, prev) => [...prev, value], []).option("--mention <name>", "\uBA64\uBC84 \uBA58\uC158 (\uBC18\uBCF5 \uAC00\uB2A5, \uC774\uB984 \uBD80\uBD84\uC77C\uCE58)", (v, prev) => [...prev, v], []).option("--mention-group <code>", "\uADF8\uB8F9 \uBA58\uC158 (\uBC18\uBCF5 \uAC00\uB2A5, code \uBD80\uBD84\uC77C\uCE58)", (v, prev) => [...prev, v], []).option("--link-task <ref>", "\uB2E4\uB978 \uC5C5\uBB34 \uB9C1\uD06C \uCD94\uAC00 (<project>/<number> \uB610\uB294 postId, \uBC18\uBCF5 \uAC00\uB2A5)", (v, prev) => [...prev, v], []).option("--parent <ref>", "\uBD80\uBAA8 \uC5C5\uBB34 (project/number \uB610\uB294 postId)").option("--template <ref>", "\uD15C\uD50C\uB9BF \uC774\uB984 \uB610\uB294 ID \u2014 body/users/tags \uC790\uB3D9 \uCC44\uC6C0 (\uC0AC\uC6A9\uC790 \uC635\uC158 \uC6B0\uC120 override, ADR-027)").option("--workflow <name>", "\uCD08\uAE30 \uC6CC\uD06C\uD50C\uB85C\uC6B0 \uC774\uB984 \uB610\uB294 class").option("--milestone <name>", "\uB9C8\uC77C\uC2A4\uD1A4 \uC774\uB984").option("--dry-run", "API \uD638\uCD9C \uC5C6\uC774 \uD569\uC131\uB41C \uBCF8\uBB38\uB9CC stdout \uCD9C\uB825 (mention/link-task \uC801\uC6A9 \uACB0\uACFC \uBBF8\uB9AC\uBCF4\uAE30)").action(async (project, opts) => {
|
|
2821
3455
|
const globalOpts = postCreateCommand.optsWithGlobals();
|
|
2822
3456
|
const config = await getConfigOrThrow();
|
|
2823
3457
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -2954,8 +3588,8 @@ var postCreateCommand = new import_commander15.Command("create").description("\u
|
|
|
2954
3588
|
});
|
|
2955
3589
|
|
|
2956
3590
|
// src/commands/post/done.ts
|
|
2957
|
-
var
|
|
2958
|
-
var postDoneCommand = new
|
|
3591
|
+
var import_commander17 = require("commander");
|
|
3592
|
+
var postDoneCommand = new import_commander17.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) => {
|
|
2959
3593
|
const config = await getConfigOrThrow();
|
|
2960
3594
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
2961
3595
|
startSpinner("\uC5C5\uBB34 \uC644\uB8CC \uCC98\uB9AC \uC911...");
|
|
@@ -2972,8 +3606,8 @@ var postDoneCommand = new import_commander16.Command("done").description("\uC5C5
|
|
|
2972
3606
|
});
|
|
2973
3607
|
|
|
2974
3608
|
// src/commands/post/workflow.ts
|
|
2975
|
-
var
|
|
2976
|
-
var postWorkflowCommand = new
|
|
3609
|
+
var import_commander18 = require("commander");
|
|
3610
|
+
var postWorkflowCommand = new import_commander18.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) => {
|
|
2977
3611
|
const config = await getConfigOrThrow();
|
|
2978
3612
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
2979
3613
|
let workflowInput = opts.workflow;
|
|
@@ -3013,7 +3647,7 @@ var postWorkflowCommand = new import_commander17.Command("workflow").description
|
|
|
3013
3647
|
});
|
|
3014
3648
|
|
|
3015
3649
|
// src/commands/post/comment/list.ts
|
|
3016
|
-
var
|
|
3650
|
+
var import_commander19 = require("commander");
|
|
3017
3651
|
|
|
3018
3652
|
// src/utils/comment-enrich.ts
|
|
3019
3653
|
function enrichCommentCreators(comments, nameMap) {
|
|
@@ -3090,7 +3724,7 @@ async function fetchSince(client, projectId, postId, sinceDate) {
|
|
|
3090
3724
|
}
|
|
3091
3725
|
return collected;
|
|
3092
3726
|
}
|
|
3093
|
-
var commentListCommand = new
|
|
3727
|
+
var commentListCommand = new import_commander19.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) => {
|
|
3094
3728
|
const globalOpts = commentListCommand.optsWithGlobals();
|
|
3095
3729
|
const config = await getConfigOrThrow();
|
|
3096
3730
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -3152,8 +3786,8 @@ var commentListCommand = new import_commander18.Command("list").description("\uB
|
|
|
3152
3786
|
});
|
|
3153
3787
|
|
|
3154
3788
|
// src/commands/post/comment/latest.ts
|
|
3155
|
-
var
|
|
3156
|
-
var commentLatestCommand = new
|
|
3789
|
+
var import_commander20 = require("commander");
|
|
3790
|
+
var commentLatestCommand = new import_commander20.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) => {
|
|
3157
3791
|
const globalOpts = commentLatestCommand.optsWithGlobals();
|
|
3158
3792
|
const config = await getConfigOrThrow();
|
|
3159
3793
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -3190,8 +3824,8 @@ var commentLatestCommand = new import_commander19.Command("latest").description(
|
|
|
3190
3824
|
});
|
|
3191
3825
|
|
|
3192
3826
|
// src/commands/post/comment/add.ts
|
|
3193
|
-
var
|
|
3194
|
-
var commentAddCommand = new
|
|
3827
|
+
var import_commander21 = require("commander");
|
|
3828
|
+
var commentAddCommand = new import_commander21.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(
|
|
3195
3829
|
"--mention <name>",
|
|
3196
3830
|
"\uBA64\uBC84 \uBA58\uC158 (\uBC18\uBCF5 \uAC00\uB2A5, \uC774\uB984 \uBD80\uBD84\uC77C\uCE58)",
|
|
3197
3831
|
(value, prev) => [...prev, value],
|
|
@@ -3270,8 +3904,8 @@ var commentAddCommand = new import_commander20.Command("add").description("\uB31
|
|
|
3270
3904
|
});
|
|
3271
3905
|
|
|
3272
3906
|
// src/commands/post/comment/edit.ts
|
|
3273
|
-
var
|
|
3274
|
-
var commentEditCommand = new
|
|
3907
|
+
var import_commander22 = require("commander");
|
|
3908
|
+
var commentEditCommand = new import_commander22.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(
|
|
3275
3909
|
"--mention <name>",
|
|
3276
3910
|
"\uBA64\uBC84 \uBA58\uC158 (\uBC18\uBCF5 \uAC00\uB2A5, \uC774\uB984 \uBD80\uBD84\uC77C\uCE58)",
|
|
3277
3911
|
(value, prev) => [...prev, value],
|
|
@@ -3399,8 +4033,8 @@ var commentEditCommand = new import_commander21.Command("edit").description("\uB
|
|
|
3399
4033
|
});
|
|
3400
4034
|
|
|
3401
4035
|
// src/commands/post/comment/delete.ts
|
|
3402
|
-
var
|
|
3403
|
-
var commentDeleteCommand = new
|
|
4036
|
+
var import_commander23 = require("commander");
|
|
4037
|
+
var commentDeleteCommand = new import_commander23.Command("delete").description("\uB313\uAE00 \uC0AD\uC81C").argument("[arg1]", "\uD504\uB85C\uC81D\uD2B8 \uCF54\uB4DC / Dooray URL / \uB313\uAE00 ID (\uBAA8\uB4DC\uBCC4)").argument("[arg2]", "\uC5C5\uBB34 \uBC88\uD638 \uB610\uB294 \uB313\uAE00 ID (\uBAA8\uB4DC\uBCC4)").argument("[arg3]", "\uB313\uAE00 ID (positional 3\uAC1C \uBAA8\uB4DC)").option("--id <postId>", "Dooray post ID (project/post-number \uB300\uC2E0)").option("--url <url>", "Dooray \uC5C5\uBB34 URL (project/post-number \uB300\uC2E0)").option("--comment-id <commentId>", "\uB313\uAE00 ID (positional \uB300\uCCB4)").action(async (arg1, arg2, arg3, opts) => {
|
|
3404
4038
|
const config = await getConfigOrThrow();
|
|
3405
4039
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
3406
4040
|
let projectArg;
|
|
@@ -3456,7 +4090,7 @@ var commentDeleteCommand = new import_commander22.Command("delete").description(
|
|
|
3456
4090
|
});
|
|
3457
4091
|
|
|
3458
4092
|
// src/commands/post/comment/get.ts
|
|
3459
|
-
var
|
|
4093
|
+
var import_commander24 = require("commander");
|
|
3460
4094
|
|
|
3461
4095
|
// src/formatters/comment.ts
|
|
3462
4096
|
function formatCommentDetail(comment, opts) {
|
|
@@ -3530,7 +4164,7 @@ function parseGetArgs(arg1, arg2, arg3, opts) {
|
|
|
3530
4164
|
EXIT_PARAM_ERROR
|
|
3531
4165
|
);
|
|
3532
4166
|
}
|
|
3533
|
-
var commentGetCommand = new
|
|
4167
|
+
var commentGetCommand = new import_commander24.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) => {
|
|
3534
4168
|
const parsed = parseGetArgs(arg1, arg2, arg3, opts);
|
|
3535
4169
|
const config = await getConfigOrThrow();
|
|
3536
4170
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -3565,10 +4199,10 @@ var commentGetCommand = new import_commander23.Command("get").description("\uB2E
|
|
|
3565
4199
|
});
|
|
3566
4200
|
|
|
3567
4201
|
// src/commands/post/comment/file/index.ts
|
|
3568
|
-
var
|
|
4202
|
+
var import_commander29 = require("commander");
|
|
3569
4203
|
|
|
3570
4204
|
// src/commands/post/comment/file/list.ts
|
|
3571
|
-
var
|
|
4205
|
+
var import_commander25 = require("commander");
|
|
3572
4206
|
|
|
3573
4207
|
// src/resolvers/comment-file-input.ts
|
|
3574
4208
|
var FILE_ID_SECONDARY_LABEL = {
|
|
@@ -3643,7 +4277,7 @@ function formatSize(bytes) {
|
|
|
3643
4277
|
if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)}KB`;
|
|
3644
4278
|
return `${(bytes / (1024 * 1024)).toFixed(1)}MB`;
|
|
3645
4279
|
}
|
|
3646
|
-
var listCommentFileCommand = new
|
|
4280
|
+
var listCommentFileCommand = new import_commander25.Command("list").description("\uB313\uAE00 \uCCA8\uBD80 \uD30C\uC77C \uBAA9\uB85D \uC870\uD68C").argument("[arg1]", "\uD504\uB85C\uC81D\uD2B8 \uCF54\uB4DC, Dooray URL, \uB610\uB294 (`--id`/`--url` \uBAA8\uB4DC\uC77C \uB54C) \uB313\uAE00 ID").argument("[arg2]", "\uC5C5\uBB34 \uBC88\uD638 (positional \uBAA8\uB4DC)").argument("[arg3]", "\uB313\uAE00 ID (positional 3\uAC1C \uBAA8\uB4DC)").option("--id <postId>", "Dooray post ID (project/post-number \uB300\uC2E0)").option("--url <url>", "Dooray \uC5C5\uBB34 URL (project/post-number \uB300\uC2E0)").option("--comment-id <logId>", "\uB313\uAE00 ID (positional \uB300\uCCB4)").action(async (arg1, arg2, arg3, opts) => {
|
|
3647
4281
|
const globalOpts = listCommentFileCommand.optsWithGlobals();
|
|
3648
4282
|
const config = await getConfigOrThrow();
|
|
3649
4283
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -3677,8 +4311,8 @@ var listCommentFileCommand = new import_commander24.Command("list").description(
|
|
|
3677
4311
|
});
|
|
3678
4312
|
|
|
3679
4313
|
// src/commands/post/comment/file/upload.ts
|
|
3680
|
-
var
|
|
3681
|
-
var
|
|
4314
|
+
var import_commander26 = require("commander");
|
|
4315
|
+
var import_node_path7 = require("path");
|
|
3682
4316
|
|
|
3683
4317
|
// src/utils/comment-files.ts
|
|
3684
4318
|
function appendFileReference(body, fileName, fileId) {
|
|
@@ -3698,7 +4332,7 @@ function removeFileReference(body, fileId) {
|
|
|
3698
4332
|
}
|
|
3699
4333
|
|
|
3700
4334
|
// src/commands/post/comment/file/upload.ts
|
|
3701
|
-
var uploadCommentFileCommand = new
|
|
4335
|
+
var uploadCommentFileCommand = new import_commander26.Command("upload").description("\uB313\uAE00\uC5D0 \uD30C\uC77C \uC5C5\uB85C\uB4DC (post-level \uD30C\uC77C \uC5C5\uB85C\uB4DC + \uB313\uAE00 reference \uCD94\uAC00, ADR-024)").argument("[arg1]", "\uD504\uB85C\uC81D\uD2B8 \uCF54\uB4DC, Dooray URL, \uB610\uB294 (`--id`/`--url` \uBAA8\uB4DC\uC77C \uB54C) \uB313\uAE00 ID").argument("[arg2]", "\uC5C5\uBB34 \uBC88\uD638 \uB610\uB294 (`--id`/`--url` \uBAA8\uB4DC\uC77C \uB54C) \uD30C\uC77C \uACBD\uB85C").argument("[arg3]", "\uB313\uAE00 ID (positional \uBAA8\uB4DC)").argument("[arg4]", "\uD30C\uC77C \uACBD\uB85C (positional \uBAA8\uB4DC)").option("--id <postId>", "Dooray post ID (project/post-number \uB300\uC2E0)").option("--url <url>", "Dooray \uC5C5\uBB34 URL (project/post-number \uB300\uC2E0)").option("--comment-id <logId>", "\uB313\uAE00 ID (positional \uB300\uCCB4)").option("--file <path>", "\uC5C5\uB85C\uB4DC\uD560 \uD30C\uC77C \uACBD\uB85C (positional \uB300\uCCB4)").action(async (arg1, arg2, arg3, arg4, opts) => {
|
|
3702
4336
|
const globalOpts = uploadCommentFileCommand.optsWithGlobals();
|
|
3703
4337
|
const config = await getConfigOrThrow();
|
|
3704
4338
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -3717,7 +4351,7 @@ var uploadCommentFileCommand = new import_commander25.Command("upload").descript
|
|
|
3717
4351
|
startSpinner("\uD30C\uC77C \uC5C5\uB85C\uB4DC \uC911...");
|
|
3718
4352
|
const uploadRes = await client.uploadPostFile(projectId, postId, filePath);
|
|
3719
4353
|
const fileId = uploadRes.result.id;
|
|
3720
|
-
const fileName = (0,
|
|
4354
|
+
const fileName = (0, import_node_path7.basename)(filePath);
|
|
3721
4355
|
stopSpinner(true, "\uC5C5\uB85C\uB4DC \uC644\uB8CC");
|
|
3722
4356
|
startSpinner("\uB313\uAE00 reference \uCD94\uAC00 \uC911...");
|
|
3723
4357
|
try {
|
|
@@ -3747,10 +4381,10 @@ var uploadCommentFileCommand = new import_commander25.Command("upload").descript
|
|
|
3747
4381
|
});
|
|
3748
4382
|
|
|
3749
4383
|
// src/commands/post/comment/file/download.ts
|
|
3750
|
-
var
|
|
4384
|
+
var import_commander27 = require("commander");
|
|
3751
4385
|
var import_promises8 = require("fs/promises");
|
|
3752
|
-
var
|
|
3753
|
-
var downloadCommentFileCommand = new
|
|
4386
|
+
var import_node_path8 = require("path");
|
|
4387
|
+
var downloadCommentFileCommand = new import_commander27.Command("download").description(
|
|
3754
4388
|
"\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)"
|
|
3755
4389
|
).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) => {
|
|
3756
4390
|
const config = await getConfigOrThrow();
|
|
@@ -3769,8 +4403,8 @@ var downloadCommentFileCommand = new import_commander26.Command("download").desc
|
|
|
3769
4403
|
});
|
|
3770
4404
|
startSpinner("\uD30C\uC77C \uB2E4\uC6B4\uB85C\uB4DC \uC911...");
|
|
3771
4405
|
const { buffer, fileName } = await client.downloadPostFile(projectId, postId, fileId);
|
|
3772
|
-
const safeName = (0,
|
|
3773
|
-
const outputPath = (0,
|
|
4406
|
+
const safeName = (0, import_node_path8.basename)(fileName);
|
|
4407
|
+
const outputPath = (0, import_node_path8.join)(opts.out, safeName);
|
|
3774
4408
|
await (0, import_promises8.writeFile)(outputPath, Buffer.from(buffer));
|
|
3775
4409
|
stopSpinner(true, "\uB2E4\uC6B4\uB85C\uB4DC \uC644\uB8CC");
|
|
3776
4410
|
process.stdout.write(`${outputPath}
|
|
@@ -3778,8 +4412,8 @@ var downloadCommentFileCommand = new import_commander26.Command("download").desc
|
|
|
3778
4412
|
});
|
|
3779
4413
|
|
|
3780
4414
|
// src/commands/post/comment/file/delete.ts
|
|
3781
|
-
var
|
|
3782
|
-
var deleteCommentFileCommand = new
|
|
4415
|
+
var import_commander28 = require("commander");
|
|
4416
|
+
var deleteCommentFileCommand = new import_commander28.Command("delete").description("\uB313\uAE00 \uCCA8\uBD80 \uD30C\uC77C \uC0AD\uC81C (\uB313\uAE00 \uBCF8\uBB38 reference \uC81C\uAC70 + \uD30C\uC77C \uC0AD\uC81C, ADR-024)").argument("[arg1]", "\uD504\uB85C\uC81D\uD2B8 \uCF54\uB4DC, Dooray URL, \uB610\uB294 (`--id`/`--url` \uBAA8\uB4DC\uC77C \uB54C) \uB313\uAE00 ID").argument("[arg2]", "\uC5C5\uBB34 \uBC88\uD638 \uB610\uB294 (`--id`/`--url` \uBAA8\uB4DC\uC77C \uB54C) \uD30C\uC77C ID").argument("[arg3]", "\uB313\uAE00 ID (positional \uBAA8\uB4DC)").argument("[arg4]", "\uD30C\uC77C ID (positional \uBAA8\uB4DC)").option("--id <postId>", "Dooray post ID (project/post-number \uB300\uC2E0)").option("--url <url>", "Dooray \uC5C5\uBB34 URL (project/post-number \uB300\uC2E0)").option("--comment-id <logId>", "\uB313\uAE00 ID (positional \uB300\uCCB4)").option("--file-id <fileId>", "\uD30C\uC77C ID (positional \uB300\uCCB4)").option("--yes", "\uD655\uC778 \uC5C6\uC774 \uC0AD\uC81C").action(async (arg1, arg2, arg3, arg4, opts) => {
|
|
3783
4417
|
const config = await getConfigOrThrow();
|
|
3784
4418
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
3785
4419
|
const { projectId, postId, commentId, secondary: fileId } = await resolveCommentFileInput(client, {
|
|
@@ -3836,16 +4470,16 @@ var deleteCommentFileCommand = new import_commander27.Command("delete").descript
|
|
|
3836
4470
|
});
|
|
3837
4471
|
|
|
3838
4472
|
// src/commands/post/comment/file/index.ts
|
|
3839
|
-
var commentFileCommand = new
|
|
4473
|
+
var commentFileCommand = new import_commander29.Command("file").description("\uB313\uAE00 \uCCA8\uBD80 \uD30C\uC77C \uAD00\uB9AC (post-level files API + \uB313\uAE00 PUT \uD569\uC131, ADR-024)").addCommand(listCommentFileCommand).addCommand(uploadCommentFileCommand).addCommand(downloadCommentFileCommand).addCommand(deleteCommentFileCommand);
|
|
3840
4474
|
|
|
3841
4475
|
// src/commands/post/file/list.ts
|
|
3842
|
-
var
|
|
4476
|
+
var import_commander30 = require("commander");
|
|
3843
4477
|
function formatSize2(bytes) {
|
|
3844
4478
|
if (bytes < 1024) return `${bytes}B`;
|
|
3845
4479
|
if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)}KB`;
|
|
3846
4480
|
return `${(bytes / (1024 * 1024)).toFixed(1)}MB`;
|
|
3847
4481
|
}
|
|
3848
|
-
var fileListCommand = new
|
|
4482
|
+
var fileListCommand = new import_commander30.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) => {
|
|
3849
4483
|
const globalOpts = fileListCommand.optsWithGlobals();
|
|
3850
4484
|
const config = await getConfigOrThrow();
|
|
3851
4485
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -3873,9 +4507,9 @@ var fileListCommand = new import_commander29.Command("list").description("\uC5C5
|
|
|
3873
4507
|
});
|
|
3874
4508
|
|
|
3875
4509
|
// src/commands/post/file/download.ts
|
|
3876
|
-
var
|
|
4510
|
+
var import_commander31 = require("commander");
|
|
3877
4511
|
var import_promises9 = require("fs/promises");
|
|
3878
|
-
var
|
|
4512
|
+
var import_node_path9 = require("path");
|
|
3879
4513
|
|
|
3880
4514
|
// src/formatters/file-output.ts
|
|
3881
4515
|
function emitDownloadResult(globalOpts, result) {
|
|
@@ -3919,7 +4553,7 @@ function emitDeleteResult(globalOpts, result) {
|
|
|
3919
4553
|
}
|
|
3920
4554
|
|
|
3921
4555
|
// src/commands/post/file/download.ts
|
|
3922
|
-
var fileDownloadCommand = new
|
|
4556
|
+
var fileDownloadCommand = new import_commander31.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) => {
|
|
3923
4557
|
const globalOpts = fileDownloadCommand.optsWithGlobals();
|
|
3924
4558
|
const config = await getConfigOrThrow();
|
|
3925
4559
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -3967,18 +4601,18 @@ var fileDownloadCommand = new import_commander30.Command("download").description
|
|
|
3967
4601
|
urlOpt: opts.url
|
|
3968
4602
|
});
|
|
3969
4603
|
const { buffer, fileName } = await client.downloadPostFile(projectId, postId, fileId);
|
|
3970
|
-
const safeName = (0,
|
|
3971
|
-
const outputPath = (0,
|
|
4604
|
+
const safeName = (0, import_node_path9.basename)(decodeURIComponent(fileName));
|
|
4605
|
+
const outputPath = (0, import_node_path9.join)(opts.output, safeName);
|
|
3972
4606
|
await (0, import_promises9.writeFile)(outputPath, Buffer.from(buffer));
|
|
3973
4607
|
stopSpinner(true, "\uB2E4\uC6B4\uB85C\uB4DC \uC644\uB8CC");
|
|
3974
4608
|
emitDownloadResult(globalOpts, { outputPath, fileName: safeName, size: buffer.byteLength });
|
|
3975
4609
|
});
|
|
3976
4610
|
|
|
3977
4611
|
// src/commands/post/file/download-all.ts
|
|
3978
|
-
var
|
|
4612
|
+
var import_commander32 = require("commander");
|
|
3979
4613
|
var import_promises10 = require("fs/promises");
|
|
3980
|
-
var
|
|
3981
|
-
var fileDownloadAllCommand = new
|
|
4614
|
+
var import_node_path10 = require("path");
|
|
4615
|
+
var fileDownloadAllCommand = new import_commander32.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) => {
|
|
3982
4616
|
const globalOpts = fileDownloadAllCommand.optsWithGlobals();
|
|
3983
4617
|
const config = await getConfigOrThrow();
|
|
3984
4618
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -4006,8 +4640,8 @@ var fileDownloadAllCommand = new import_commander31.Command("download-all").desc
|
|
|
4006
4640
|
for (const file of res.result) {
|
|
4007
4641
|
try {
|
|
4008
4642
|
const { buffer, fileName } = await client.downloadPostFile(projectId, postId, file.id);
|
|
4009
|
-
const safeName = (0,
|
|
4010
|
-
const outputPath = (0,
|
|
4643
|
+
const safeName = (0, import_node_path10.basename)(decodeURIComponent(fileName));
|
|
4644
|
+
const outputPath = (0, import_node_path10.join)(opts.output, safeName);
|
|
4011
4645
|
await (0, import_promises10.writeFile)(outputPath, Buffer.from(buffer));
|
|
4012
4646
|
succeeded.push({ path: outputPath, fileName: safeName });
|
|
4013
4647
|
if (!globalOpts.json && !globalOpts.quiet) {
|
|
@@ -4027,9 +4661,9 @@ var fileDownloadAllCommand = new import_commander31.Command("download-all").desc
|
|
|
4027
4661
|
});
|
|
4028
4662
|
|
|
4029
4663
|
// src/commands/post/file/upload.ts
|
|
4030
|
-
var
|
|
4031
|
-
var
|
|
4032
|
-
var fileUploadCommand = new
|
|
4664
|
+
var import_commander33 = require("commander");
|
|
4665
|
+
var import_node_path11 = require("path");
|
|
4666
|
+
var fileUploadCommand = new import_commander33.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) => {
|
|
4033
4667
|
const globalOpts = fileUploadCommand.optsWithGlobals();
|
|
4034
4668
|
const config = await getConfigOrThrow();
|
|
4035
4669
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -4084,14 +4718,14 @@ var fileUploadCommand = new import_commander32.Command("upload").description("\u
|
|
|
4084
4718
|
process.stdout.write(`${res.result.id}
|
|
4085
4719
|
`);
|
|
4086
4720
|
} else {
|
|
4087
|
-
process.stdout.write(`\uD30C\uC77C \uC5C5\uB85C\uB4DC \uC644\uB8CC: ${(0,
|
|
4721
|
+
process.stdout.write(`\uD30C\uC77C \uC5C5\uB85C\uB4DC \uC644\uB8CC: ${(0, import_node_path11.basename)(filePath)} (ID: ${res.result.id})
|
|
4088
4722
|
`);
|
|
4089
4723
|
}
|
|
4090
4724
|
});
|
|
4091
4725
|
|
|
4092
4726
|
// src/commands/post/file/delete.ts
|
|
4093
|
-
var
|
|
4094
|
-
var fileDeleteCommand = new
|
|
4727
|
+
var import_commander34 = require("commander");
|
|
4728
|
+
var fileDeleteCommand = new import_commander34.Command("delete").description("\uCCA8\uBD80\uD30C\uC77C \uC0AD\uC81C").argument("[arg1]", "\uD504\uB85C\uC81D\uD2B8 \uCF54\uB4DC, Dooray URL, \uB610\uB294 (`--id`/`--url` \uBAA8\uB4DC\uC77C \uB54C) \uD30C\uC77C ID").argument("[arg2]", "\uC5C5\uBB34 \uBC88\uD638 \uB610\uB294 (`--id`/`--url` \uBAA8\uB4DC\uC77C \uB54C) \uD30C\uC77C ID").argument("[arg3]", "\uD30C\uC77C ID (positional 3\uAC1C \uBAA8\uB4DC)").option("--id <postId>", "Dooray post ID (project/post-number \uB300\uC2E0)").option("--url <url>", "Dooray \uC5C5\uBB34 URL (project/post-number \uB300\uC2E0)").option("--file-id <fileId>", "\uD30C\uC77C ID (positional \uB300\uCCB4)").action(async (arg1, arg2, arg3, opts) => {
|
|
4095
4729
|
const globalOpts = fileDeleteCommand.optsWithGlobals();
|
|
4096
4730
|
const config = await getConfigOrThrow();
|
|
4097
4731
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -4144,7 +4778,7 @@ var fileDeleteCommand = new import_commander33.Command("delete").description("\u
|
|
|
4144
4778
|
});
|
|
4145
4779
|
|
|
4146
4780
|
// src/commands/wiki/list.ts
|
|
4147
|
-
var
|
|
4781
|
+
var import_commander35 = require("commander");
|
|
4148
4782
|
|
|
4149
4783
|
// src/formatters/wiki.ts
|
|
4150
4784
|
function formatWikiList(wikis, opts) {
|
|
@@ -4236,7 +4870,7 @@ function formatWikiPageDetail(page, opts) {
|
|
|
4236
4870
|
}
|
|
4237
4871
|
|
|
4238
4872
|
// src/commands/wiki/list.ts
|
|
4239
|
-
var wikiListCommand = new
|
|
4873
|
+
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) => {
|
|
4240
4874
|
const globalOpts = wikiListCommand.optsWithGlobals();
|
|
4241
4875
|
const config = await getConfigOrThrow();
|
|
4242
4876
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -4250,7 +4884,7 @@ var wikiListCommand = new import_commander34.Command("list").description("\uC704
|
|
|
4250
4884
|
});
|
|
4251
4885
|
|
|
4252
4886
|
// src/commands/wiki/pages.ts
|
|
4253
|
-
var
|
|
4887
|
+
var import_commander36 = require("commander");
|
|
4254
4888
|
|
|
4255
4889
|
// src/resolvers/wiki.ts
|
|
4256
4890
|
async function resolveWiki(client, projectCode) {
|
|
@@ -4294,7 +4928,7 @@ async function resolveWikiHomePageId(client, wikiId) {
|
|
|
4294
4928
|
}
|
|
4295
4929
|
|
|
4296
4930
|
// src/commands/wiki/pages.ts
|
|
4297
|
-
var wikiPagesCommand = new
|
|
4931
|
+
var wikiPagesCommand = new import_commander36.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) => {
|
|
4298
4932
|
const globalOpts = wikiPagesCommand.optsWithGlobals();
|
|
4299
4933
|
const config = await getConfigOrThrow();
|
|
4300
4934
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -4306,8 +4940,8 @@ var wikiPagesCommand = new import_commander35.Command("pages").description("\uC7
|
|
|
4306
4940
|
});
|
|
4307
4941
|
|
|
4308
4942
|
// src/commands/wiki/tree.ts
|
|
4309
|
-
var
|
|
4310
|
-
var wikiTreeCommand = new
|
|
4943
|
+
var import_commander37 = require("commander");
|
|
4944
|
+
var wikiTreeCommand = new import_commander37.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) => {
|
|
4311
4945
|
const globalOpts = wikiTreeCommand.optsWithGlobals();
|
|
4312
4946
|
const config = await getConfigOrThrow();
|
|
4313
4947
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -4327,8 +4961,8 @@ var wikiTreeCommand = new import_commander36.Command("tree").description("\uC704
|
|
|
4327
4961
|
});
|
|
4328
4962
|
|
|
4329
4963
|
// src/commands/wiki/page-get.ts
|
|
4330
|
-
var
|
|
4331
|
-
var wikiPageGetCommand = new
|
|
4964
|
+
var import_commander38 = require("commander");
|
|
4965
|
+
var wikiPageGetCommand = new import_commander38.Command("get").description("\uC704\uD0A4 \uD398\uC774\uC9C0 \uC0C1\uC138 \uC870\uD68C").argument("<project>", "\uD504\uB85C\uC81D\uD2B8 \uCF54\uB4DC \uB610\uB294 ID").argument("<page-id>", "\uD398\uC774\uC9C0 ID").action(async (project, pageId) => {
|
|
4332
4966
|
const globalOpts = wikiPageGetCommand.optsWithGlobals();
|
|
4333
4967
|
const config = await getConfigOrThrow();
|
|
4334
4968
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -4340,8 +4974,8 @@ var wikiPageGetCommand = new import_commander37.Command("get").description("\uC7
|
|
|
4340
4974
|
});
|
|
4341
4975
|
|
|
4342
4976
|
// src/commands/wiki/page-create.ts
|
|
4343
|
-
var
|
|
4344
|
-
var wikiPageCreateCommand = new
|
|
4977
|
+
var import_commander39 = require("commander");
|
|
4978
|
+
var wikiPageCreateCommand = new import_commander39.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) => {
|
|
4345
4979
|
const globalOpts = wikiPageCreateCommand.optsWithGlobals();
|
|
4346
4980
|
const config = await getConfigOrThrow();
|
|
4347
4981
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -4366,8 +5000,8 @@ var wikiPageCreateCommand = new import_commander38.Command("create").description
|
|
|
4366
5000
|
});
|
|
4367
5001
|
|
|
4368
5002
|
// src/commands/wiki/page-edit.ts
|
|
4369
|
-
var
|
|
4370
|
-
var wikiPageEditCommand = new
|
|
5003
|
+
var import_commander40 = require("commander");
|
|
5004
|
+
var wikiPageEditCommand = new import_commander40.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) => {
|
|
4371
5005
|
const config = await getConfigOrThrow();
|
|
4372
5006
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
4373
5007
|
const hasTitle = opts.title != null;
|
|
@@ -4420,7 +5054,7 @@ var wikiPageEditCommand = new import_commander39.Command("edit").description("\u
|
|
|
4420
5054
|
});
|
|
4421
5055
|
|
|
4422
5056
|
// src/commands/wiki/page-delete.ts
|
|
4423
|
-
var
|
|
5057
|
+
var import_commander41 = require("commander");
|
|
4424
5058
|
|
|
4425
5059
|
// src/resolvers/wiki-page-input.ts
|
|
4426
5060
|
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 4071828729722696495\n - --id <page-id> --project <project> (\uB610\uB294 --url)\n - <Dooray URL> \uC608: https://x.dooray.com/wiki/<wikiId>/<pageId>";
|
|
@@ -4477,7 +5111,7 @@ async function resolveWikiPageInput(client, args) {
|
|
|
4477
5111
|
}
|
|
4478
5112
|
|
|
4479
5113
|
// src/commands/wiki/page-delete.ts
|
|
4480
|
-
var wikiPageDeleteCommand = new
|
|
5114
|
+
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) => {
|
|
4481
5115
|
const globalOpts = wikiPageDeleteCommand.optsWithGlobals();
|
|
4482
5116
|
const config = await getConfigOrThrow();
|
|
4483
5117
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -4523,16 +5157,16 @@ var wikiPageDeleteCommand = new import_commander40.Command("delete").description
|
|
|
4523
5157
|
});
|
|
4524
5158
|
|
|
4525
5159
|
// src/commands/wiki/page-file/index.ts
|
|
4526
|
-
var
|
|
5160
|
+
var import_commander47 = require("commander");
|
|
4527
5161
|
|
|
4528
5162
|
// src/commands/wiki/page-file/list.ts
|
|
4529
|
-
var
|
|
5163
|
+
var import_commander42 = require("commander");
|
|
4530
5164
|
function formatSize3(bytes) {
|
|
4531
5165
|
if (bytes < 1024) return `${bytes}B`;
|
|
4532
5166
|
if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)}KB`;
|
|
4533
5167
|
return `${(bytes / (1024 * 1024)).toFixed(1)}MB`;
|
|
4534
5168
|
}
|
|
4535
|
-
var wikiPageFileListCommand = new
|
|
5169
|
+
var wikiPageFileListCommand = new import_commander42.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) => {
|
|
4536
5170
|
const globalOpts = wikiPageFileListCommand.optsWithGlobals();
|
|
4537
5171
|
const config = await getConfigOrThrow();
|
|
4538
5172
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -4563,7 +5197,7 @@ var wikiPageFileListCommand = new import_commander41.Command("list").description
|
|
|
4563
5197
|
});
|
|
4564
5198
|
|
|
4565
5199
|
// src/commands/wiki/page-file/upload.ts
|
|
4566
|
-
var
|
|
5200
|
+
var import_commander43 = require("commander");
|
|
4567
5201
|
|
|
4568
5202
|
// src/utils/wiki-snippet.ts
|
|
4569
5203
|
function wikiInlineImageSnippet(wikiId, attachFileId, name) {
|
|
@@ -4571,7 +5205,7 @@ function wikiInlineImageSnippet(wikiId, attachFileId, name) {
|
|
|
4571
5205
|
}
|
|
4572
5206
|
|
|
4573
5207
|
// src/commands/wiki/page-file/upload.ts
|
|
4574
|
-
var wikiPageFileUploadCommand = new
|
|
5208
|
+
var wikiPageFileUploadCommand = new import_commander43.Command("upload").description("\uC704\uD0A4 \uD398\uC774\uC9C0 \uCCA8\uBD80\uD30C\uC77C \uC5C5\uB85C\uB4DC (multipart type \uC21C\uC11C \uAC15\uC81C, ADR-029)").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) => {
|
|
4575
5209
|
const globalOpts = wikiPageFileUploadCommand.optsWithGlobals();
|
|
4576
5210
|
const config = await getConfigOrThrow();
|
|
4577
5211
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -4666,10 +5300,10 @@ var wikiPageFileUploadCommand = new import_commander42.Command("upload").descrip
|
|
|
4666
5300
|
});
|
|
4667
5301
|
|
|
4668
5302
|
// src/commands/wiki/page-file/download.ts
|
|
4669
|
-
var
|
|
5303
|
+
var import_commander44 = require("commander");
|
|
4670
5304
|
var import_promises11 = require("fs/promises");
|
|
4671
|
-
var
|
|
4672
|
-
var wikiPageFileDownloadCommand = new
|
|
5305
|
+
var import_node_path12 = require("path");
|
|
5306
|
+
var wikiPageFileDownloadCommand = new import_commander44.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) => {
|
|
4673
5307
|
const globalOpts = wikiPageFileDownloadCommand.optsWithGlobals();
|
|
4674
5308
|
const config = await getConfigOrThrow();
|
|
4675
5309
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -4719,8 +5353,8 @@ var wikiPageFileDownloadCommand = new import_commander43.Command("download").des
|
|
|
4719
5353
|
startSpinner("\uD30C\uC77C \uB2E4\uC6B4\uB85C\uB4DC \uC911...");
|
|
4720
5354
|
try {
|
|
4721
5355
|
const { buffer, fileName } = await client.downloadWikiPageFile(wikiId, pageId, fileId);
|
|
4722
|
-
const safeName = (0,
|
|
4723
|
-
const outputPath = (0,
|
|
5356
|
+
const safeName = (0, import_node_path12.basename)(decodeURIComponent(fileName));
|
|
5357
|
+
const outputPath = (0, import_node_path12.join)(opts.output, safeName);
|
|
4724
5358
|
await (0, import_promises11.writeFile)(outputPath, Buffer.from(buffer));
|
|
4725
5359
|
stopSpinner(true, `\uB2E4\uC6B4\uB85C\uB4DC \uC644\uB8CC: ${outputPath}`);
|
|
4726
5360
|
emitDownloadResult(globalOpts, { outputPath, fileName: safeName, size: buffer.byteLength });
|
|
@@ -4731,10 +5365,10 @@ var wikiPageFileDownloadCommand = new import_commander43.Command("download").des
|
|
|
4731
5365
|
});
|
|
4732
5366
|
|
|
4733
5367
|
// src/commands/wiki/page-file/download-all.ts
|
|
4734
|
-
var
|
|
5368
|
+
var import_commander45 = require("commander");
|
|
4735
5369
|
var import_promises12 = require("fs/promises");
|
|
4736
|
-
var
|
|
4737
|
-
var wikiPageFileDownloadAllCommand = new
|
|
5370
|
+
var import_node_path13 = require("path");
|
|
5371
|
+
var wikiPageFileDownloadAllCommand = new import_commander45.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) => {
|
|
4738
5372
|
const globalOpts = wikiPageFileDownloadAllCommand.optsWithGlobals();
|
|
4739
5373
|
const config = await getConfigOrThrow();
|
|
4740
5374
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -4770,8 +5404,8 @@ var wikiPageFileDownloadAllCommand = new import_commander44.Command("download-al
|
|
|
4770
5404
|
for (const f of allFiles) {
|
|
4771
5405
|
try {
|
|
4772
5406
|
const { buffer, fileName } = await client.downloadWikiPageFile(wikiId, pageId, f.id);
|
|
4773
|
-
const safeName = (0,
|
|
4774
|
-
const outputPath = (0,
|
|
5407
|
+
const safeName = (0, import_node_path13.basename)(decodeURIComponent(fileName));
|
|
5408
|
+
const outputPath = (0, import_node_path13.join)(opts.output, safeName);
|
|
4775
5409
|
await (0, import_promises12.writeFile)(outputPath, Buffer.from(buffer));
|
|
4776
5410
|
succeeded.push({ path: outputPath, fileName: safeName });
|
|
4777
5411
|
if (!globalOpts.json && !globalOpts.quiet) {
|
|
@@ -4791,8 +5425,8 @@ var wikiPageFileDownloadAllCommand = new import_commander44.Command("download-al
|
|
|
4791
5425
|
});
|
|
4792
5426
|
|
|
4793
5427
|
// src/commands/wiki/page-file/delete.ts
|
|
4794
|
-
var
|
|
4795
|
-
var wikiPageFileDeleteCommand = new
|
|
5428
|
+
var import_commander46 = require("commander");
|
|
5429
|
+
var wikiPageFileDeleteCommand = new import_commander46.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)").action(async (arg1, arg2, arg3, opts) => {
|
|
4796
5430
|
const globalOpts = wikiPageFileDeleteCommand.optsWithGlobals();
|
|
4797
5431
|
const config = await getConfigOrThrow();
|
|
4798
5432
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -4851,7 +5485,7 @@ var wikiPageFileDeleteCommand = new import_commander45.Command("delete").descrip
|
|
|
4851
5485
|
});
|
|
4852
5486
|
|
|
4853
5487
|
// src/commands/wiki/page-file/index.ts
|
|
4854
|
-
var wikiPageFileCommand = new
|
|
5488
|
+
var wikiPageFileCommand = new import_commander47.Command("file").description("\uC704\uD0A4 \uD398\uC774\uC9C0 \uCCA8\uBD80\uD30C\uC77C \uAD00\uB828 \uBA85\uB839 (Issue #70, ADR-029)");
|
|
4855
5489
|
wikiPageFileCommand.addCommand(wikiPageFileListCommand);
|
|
4856
5490
|
wikiPageFileCommand.addCommand(wikiPageFileUploadCommand);
|
|
4857
5491
|
wikiPageFileCommand.addCommand(wikiPageFileDownloadCommand);
|
|
@@ -4859,10 +5493,10 @@ wikiPageFileCommand.addCommand(wikiPageFileDownloadAllCommand);
|
|
|
4859
5493
|
wikiPageFileCommand.addCommand(wikiPageFileDeleteCommand);
|
|
4860
5494
|
|
|
4861
5495
|
// src/commands/wiki/page-comment/index.ts
|
|
4862
|
-
var
|
|
5496
|
+
var import_commander54 = require("commander");
|
|
4863
5497
|
|
|
4864
5498
|
// src/commands/wiki/page-comment/list.ts
|
|
4865
|
-
var
|
|
5499
|
+
var import_commander48 = require("commander");
|
|
4866
5500
|
|
|
4867
5501
|
// src/formatters/wiki-comment.ts
|
|
4868
5502
|
function formatWikiCommentList(comments, opts) {
|
|
@@ -4909,7 +5543,7 @@ function truncate(s, n) {
|
|
|
4909
5543
|
}
|
|
4910
5544
|
|
|
4911
5545
|
// src/commands/wiki/page-comment/list.ts
|
|
4912
|
-
var wikiPageCommentListCommand = new
|
|
5546
|
+
var wikiPageCommentListCommand = new import_commander48.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) => {
|
|
4913
5547
|
const globalOpts = wikiPageCommentListCommand.optsWithGlobals();
|
|
4914
5548
|
const config = await getConfigOrThrow();
|
|
4915
5549
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -4934,8 +5568,8 @@ var wikiPageCommentListCommand = new import_commander47.Command("list").descript
|
|
|
4934
5568
|
});
|
|
4935
5569
|
|
|
4936
5570
|
// src/commands/wiki/page-comment/latest.ts
|
|
4937
|
-
var
|
|
4938
|
-
var wikiPageCommentLatestCommand = new
|
|
5571
|
+
var import_commander49 = require("commander");
|
|
5572
|
+
var wikiPageCommentLatestCommand = new import_commander49.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) => {
|
|
4939
5573
|
const globalOpts = wikiPageCommentLatestCommand.optsWithGlobals();
|
|
4940
5574
|
const config = await getConfigOrThrow();
|
|
4941
5575
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -4962,7 +5596,7 @@ var wikiPageCommentLatestCommand = new import_commander48.Command("latest").desc
|
|
|
4962
5596
|
});
|
|
4963
5597
|
|
|
4964
5598
|
// src/commands/wiki/page-comment/get.ts
|
|
4965
|
-
var
|
|
5599
|
+
var import_commander50 = require("commander");
|
|
4966
5600
|
|
|
4967
5601
|
// src/commands/wiki/page-comment/parse-args.ts
|
|
4968
5602
|
function parseWikiCommentArgs(arg1, arg2, arg3, opts) {
|
|
@@ -5015,7 +5649,7 @@ function parseWikiCommentArgs(arg1, arg2, arg3, opts) {
|
|
|
5015
5649
|
}
|
|
5016
5650
|
|
|
5017
5651
|
// src/commands/wiki/page-comment/get.ts
|
|
5018
|
-
var wikiPageCommentGetCommand = new
|
|
5652
|
+
var wikiPageCommentGetCommand = new import_commander50.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) => {
|
|
5019
5653
|
const parsed = parseWikiCommentArgs(arg1, arg2, arg3, opts);
|
|
5020
5654
|
const config = await getConfigOrThrow();
|
|
5021
5655
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -5039,8 +5673,8 @@ var wikiPageCommentGetCommand = new import_commander49.Command("get").descriptio
|
|
|
5039
5673
|
});
|
|
5040
5674
|
|
|
5041
5675
|
// src/commands/wiki/page-comment/add.ts
|
|
5042
|
-
var
|
|
5043
|
-
var wikiPageCommentAddCommand = new
|
|
5676
|
+
var import_commander51 = require("commander");
|
|
5677
|
+
var wikiPageCommentAddCommand = new import_commander51.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) => {
|
|
5044
5678
|
if ((opts.id || opts.url) && (project || pageIdArg)) {
|
|
5045
5679
|
throw new DoorayCliError(
|
|
5046
5680
|
"positional \uC778\uC790\uC640 --id/--url \uC635\uC158\uC740 \uB3D9\uC2DC\uC5D0 \uC0AC\uC6A9\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.",
|
|
@@ -5086,8 +5720,8 @@ var wikiPageCommentAddCommand = new import_commander50.Command("add").descriptio
|
|
|
5086
5720
|
});
|
|
5087
5721
|
|
|
5088
5722
|
// src/commands/wiki/page-comment/edit.ts
|
|
5089
|
-
var
|
|
5090
|
-
var wikiPageCommentEditCommand = new
|
|
5723
|
+
var import_commander52 = require("commander");
|
|
5724
|
+
var wikiPageCommentEditCommand = new import_commander52.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) => {
|
|
5091
5725
|
const parsed = parseWikiCommentArgs(arg1, arg2, arg3, opts);
|
|
5092
5726
|
const config = await getConfigOrThrow();
|
|
5093
5727
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -5131,8 +5765,8 @@ var wikiPageCommentEditCommand = new import_commander51.Command("edit").descript
|
|
|
5131
5765
|
});
|
|
5132
5766
|
|
|
5133
5767
|
// src/commands/wiki/page-comment/delete.ts
|
|
5134
|
-
var
|
|
5135
|
-
var wikiPageCommentDeleteCommand = new
|
|
5768
|
+
var import_commander53 = require("commander");
|
|
5769
|
+
var wikiPageCommentDeleteCommand = new import_commander53.Command("delete").description("\uC704\uD0A4 \uD398\uC774\uC9C0 \uB313\uAE00 \uC0AD\uC81C (confirm \uC5C6\uC774 \uC989\uC2DC)").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)").action(async (arg1, arg2, arg3, opts) => {
|
|
5136
5770
|
const parsed = parseWikiCommentArgs(arg1, arg2, arg3, opts);
|
|
5137
5771
|
const config = await getConfigOrThrow();
|
|
5138
5772
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -5156,7 +5790,7 @@ var wikiPageCommentDeleteCommand = new import_commander52.Command("delete").desc
|
|
|
5156
5790
|
});
|
|
5157
5791
|
|
|
5158
5792
|
// src/commands/wiki/page-comment/index.ts
|
|
5159
|
-
var wikiPageCommentCommand = new
|
|
5793
|
+
var wikiPageCommentCommand = new import_commander54.Command("comment").description("\uC704\uD0A4 \uD398\uC774\uC9C0 \uB313\uAE00 \uAD00\uB828 \uBA85\uB839");
|
|
5160
5794
|
wikiPageCommentCommand.addCommand(wikiPageCommentListCommand);
|
|
5161
5795
|
wikiPageCommentCommand.addCommand(wikiPageCommentLatestCommand);
|
|
5162
5796
|
wikiPageCommentCommand.addCommand(wikiPageCommentGetCommand);
|
|
@@ -5165,10 +5799,10 @@ wikiPageCommentCommand.addCommand(wikiPageCommentEditCommand);
|
|
|
5165
5799
|
wikiPageCommentCommand.addCommand(wikiPageCommentDeleteCommand);
|
|
5166
5800
|
|
|
5167
5801
|
// src/commands/member/index.ts
|
|
5168
|
-
var
|
|
5802
|
+
var import_commander58 = require("commander");
|
|
5169
5803
|
|
|
5170
5804
|
// src/commands/member/get.ts
|
|
5171
|
-
var
|
|
5805
|
+
var import_commander55 = require("commander");
|
|
5172
5806
|
|
|
5173
5807
|
// src/formatters/member.ts
|
|
5174
5808
|
function formatMemberDetail(member, opts) {
|
|
@@ -5214,7 +5848,7 @@ function formatMemberSearchResults(members, opts) {
|
|
|
5214
5848
|
}
|
|
5215
5849
|
|
|
5216
5850
|
// src/commands/member/get.ts
|
|
5217
|
-
var memberGetCommand = new
|
|
5851
|
+
var memberGetCommand = new import_commander55.Command("get").description("\uBA64\uBC84 \uC0C1\uC138 \uC815\uBCF4 \uC870\uD68C (organizationMemberId)").argument("<member-id>", "\uC870\uD68C\uD560 organization member ID").action(async (memberId) => {
|
|
5218
5852
|
const globalOpts = memberGetCommand.optsWithGlobals();
|
|
5219
5853
|
const config = await getConfigOrThrow();
|
|
5220
5854
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -5223,8 +5857,8 @@ var memberGetCommand = new import_commander54.Command("get").description("\uBA64
|
|
|
5223
5857
|
});
|
|
5224
5858
|
|
|
5225
5859
|
// src/commands/member/list.ts
|
|
5226
|
-
var
|
|
5227
|
-
var memberListCommand = new
|
|
5860
|
+
var import_commander56 = require("commander");
|
|
5861
|
+
var memberListCommand = new import_commander56.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) => {
|
|
5228
5862
|
const globalOpts = memberListCommand.optsWithGlobals();
|
|
5229
5863
|
const config = await getConfigOrThrow();
|
|
5230
5864
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -5239,8 +5873,8 @@ var memberListCommand = new import_commander55.Command("list").description("\uD5
|
|
|
5239
5873
|
});
|
|
5240
5874
|
|
|
5241
5875
|
// src/commands/member/search.ts
|
|
5242
|
-
var
|
|
5243
|
-
var memberSearchCommand = new
|
|
5876
|
+
var import_commander57 = require("commander");
|
|
5877
|
+
var memberSearchCommand = new import_commander57.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) => {
|
|
5244
5878
|
const globalOpts = memberSearchCommand.optsWithGlobals();
|
|
5245
5879
|
const filterCount = [keyword, opts.email, opts.userCode, opts.userCodeExact].filter(Boolean).length;
|
|
5246
5880
|
if (filterCount === 0) {
|
|
@@ -5273,17 +5907,62 @@ var memberSearchCommand = new import_commander56.Command("search").description("
|
|
|
5273
5907
|
});
|
|
5274
5908
|
|
|
5275
5909
|
// src/commands/member/index.ts
|
|
5276
|
-
var memberCommand = new
|
|
5910
|
+
var memberCommand = new import_commander58.Command("member").description("Dooray \uBA64\uBC84 \uC870\uD68C");
|
|
5277
5911
|
memberCommand.addCommand(memberGetCommand);
|
|
5278
5912
|
memberCommand.addCommand(memberListCommand);
|
|
5279
5913
|
memberCommand.addCommand(memberSearchCommand);
|
|
5280
5914
|
|
|
5281
5915
|
// src/commands/mail/list.ts
|
|
5282
|
-
var
|
|
5916
|
+
var import_commander59 = require("commander");
|
|
5283
5917
|
|
|
5284
5918
|
// src/api/imapClient.ts
|
|
5285
5919
|
var import_imapflow = require("imapflow");
|
|
5286
5920
|
var import_mailparser = require("mailparser");
|
|
5921
|
+
|
|
5922
|
+
// src/api/mailErrors.ts
|
|
5923
|
+
function getErrorField(error, key) {
|
|
5924
|
+
if (typeof error !== "object" || error === null) return void 0;
|
|
5925
|
+
return error[key];
|
|
5926
|
+
}
|
|
5927
|
+
function isAuthenticationFailure(error) {
|
|
5928
|
+
if (getErrorField(error, "authenticationFailed") === true) return true;
|
|
5929
|
+
if (getErrorField(error, "code") === "EAUTH") return true;
|
|
5930
|
+
const details = [
|
|
5931
|
+
getErrorField(error, "message"),
|
|
5932
|
+
getErrorField(error, "responseText"),
|
|
5933
|
+
getErrorField(error, "responseCode")
|
|
5934
|
+
].filter((value) => typeof value === "string").join(" ");
|
|
5935
|
+
return /auth(?:enticate|entication)?\s*(?:login\s*)?failed|invalid login|invalid credentials/i.test(
|
|
5936
|
+
details
|
|
5937
|
+
);
|
|
5938
|
+
}
|
|
5939
|
+
function isConnectionFailure(error) {
|
|
5940
|
+
const code = getErrorField(error, "code");
|
|
5941
|
+
return typeof code === "string" && [
|
|
5942
|
+
"ECONNECTION",
|
|
5943
|
+
"ECONNREFUSED",
|
|
5944
|
+
"ECONNRESET",
|
|
5945
|
+
"EHOSTUNREACH",
|
|
5946
|
+
"ENETUNREACH",
|
|
5947
|
+
"ESOCKET",
|
|
5948
|
+
"ETIMEDOUT"
|
|
5949
|
+
].includes(code);
|
|
5950
|
+
}
|
|
5951
|
+
function toMailConnectionError(protocol, host, port, error) {
|
|
5952
|
+
if (isAuthenticationFailure(error)) {
|
|
5953
|
+
return new DoorayCliError(
|
|
5954
|
+
`${protocol} \uC778\uC99D\uC5D0 \uC2E4\uD328\uD588\uC2B5\uB2C8\uB2E4. Dooray \uBA54\uC77C \uC124\uC815\uC5D0\uC11C \uC571 \uBE44\uBC00\uBC88\uD638\uB97C \uC0C8\uB85C \uBC1C\uAE09\uD55C \uB4A4 \uB2E4\uC2DC \uC800\uC7A5\uD558\uC138\uC694:
|
|
5955
|
+
dooray config set imap-password <NEW_IMAP_APP_PASSWORD>
|
|
5956
|
+
\uAE30\uC874 \uBA54\uC77C \uC778\uC99D\uC815\uBCF4 \uC81C\uAC70: dooray mail logout`,
|
|
5957
|
+
EXIT_AUTH_ERROR
|
|
5958
|
+
);
|
|
5959
|
+
}
|
|
5960
|
+
const reason = error instanceof Error && error.message ? `: ${error.message}` : "";
|
|
5961
|
+
const message = isConnectionFailure(error) ? `${protocol} \uC11C\uBC84 \uC5F0\uACB0\uC5D0 \uC2E4\uD328\uD588\uC2B5\uB2C8\uB2E4 (${host}:${port})${reason}` : `${protocol} \uCC98\uB9AC \uC911 \uC624\uB958\uAC00 \uBC1C\uC0DD\uD588\uC2B5\uB2C8\uB2E4${reason}`;
|
|
5962
|
+
return new DoorayCliError(message, EXIT_API_ERROR);
|
|
5963
|
+
}
|
|
5964
|
+
|
|
5965
|
+
// src/api/imapClient.ts
|
|
5287
5966
|
function getImapConfigOrThrow(config) {
|
|
5288
5967
|
if (!config.imapUsername || !config.imapPassword) {
|
|
5289
5968
|
throw new DoorayCliError(
|
|
@@ -5298,7 +5977,7 @@ function getImapConfigOrThrow(config) {
|
|
|
5298
5977
|
password: config.imapPassword
|
|
5299
5978
|
};
|
|
5300
5979
|
}
|
|
5301
|
-
function
|
|
5980
|
+
function createImapClient(config) {
|
|
5302
5981
|
const imap = getImapConfigOrThrow(config);
|
|
5303
5982
|
return new import_imapflow.ImapFlow({
|
|
5304
5983
|
host: imap.host,
|
|
@@ -5308,11 +5987,30 @@ function createClient(config) {
|
|
|
5308
5987
|
logger: false
|
|
5309
5988
|
});
|
|
5310
5989
|
}
|
|
5990
|
+
async function connectImapClient(client, config) {
|
|
5991
|
+
const imap = getImapConfigOrThrow(config);
|
|
5992
|
+
try {
|
|
5993
|
+
await client.connect();
|
|
5994
|
+
} catch (error) {
|
|
5995
|
+
throw toMailConnectionError("IMAP", imap.host, imap.port, error);
|
|
5996
|
+
}
|
|
5997
|
+
}
|
|
5998
|
+
async function closeImapClient(client) {
|
|
5999
|
+
if (!client.usable) {
|
|
6000
|
+
client.close();
|
|
6001
|
+
return;
|
|
6002
|
+
}
|
|
6003
|
+
try {
|
|
6004
|
+
await client.logout();
|
|
6005
|
+
} catch {
|
|
6006
|
+
client.close();
|
|
6007
|
+
}
|
|
6008
|
+
}
|
|
5311
6009
|
async function listMails(config, opts) {
|
|
5312
|
-
const client =
|
|
6010
|
+
const client = createImapClient(config);
|
|
5313
6011
|
const limit = opts.limit ?? 20;
|
|
5314
6012
|
try {
|
|
5315
|
-
await client
|
|
6013
|
+
await connectImapClient(client, config);
|
|
5316
6014
|
const lock = await client.getMailboxLock("INBOX");
|
|
5317
6015
|
try {
|
|
5318
6016
|
const query = {};
|
|
@@ -5348,13 +6046,13 @@ async function listMails(config, opts) {
|
|
|
5348
6046
|
lock.release();
|
|
5349
6047
|
}
|
|
5350
6048
|
} finally {
|
|
5351
|
-
await client
|
|
6049
|
+
await closeImapClient(client);
|
|
5352
6050
|
}
|
|
5353
6051
|
}
|
|
5354
6052
|
async function getMail(config, uid) {
|
|
5355
|
-
const client =
|
|
6053
|
+
const client = createImapClient(config);
|
|
5356
6054
|
try {
|
|
5357
|
-
await client
|
|
6055
|
+
await connectImapClient(client, config);
|
|
5358
6056
|
const lock = await client.getMailboxLock("INBOX");
|
|
5359
6057
|
try {
|
|
5360
6058
|
const msg = await client.fetchOne(String(uid), {
|
|
@@ -5390,13 +6088,13 @@ async function getMail(config, uid) {
|
|
|
5390
6088
|
lock.release();
|
|
5391
6089
|
}
|
|
5392
6090
|
} finally {
|
|
5393
|
-
await client
|
|
6091
|
+
await closeImapClient(client);
|
|
5394
6092
|
}
|
|
5395
6093
|
}
|
|
5396
6094
|
|
|
5397
6095
|
// src/commands/mail/list.ts
|
|
5398
|
-
var
|
|
5399
|
-
var mailListCommand = new
|
|
6096
|
+
var import_chalk6 = __toESM(require("chalk"));
|
|
6097
|
+
var mailListCommand = new import_commander59.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) => {
|
|
5400
6098
|
const globalOpts = mailListCommand.optsWithGlobals();
|
|
5401
6099
|
const config = await getConfigOrThrow();
|
|
5402
6100
|
startSpinner("\uBA54\uC77C \uC870\uD68C \uC911...");
|
|
@@ -5410,7 +6108,7 @@ var mailListCommand = new import_commander58.Command("list").description("\uBA54
|
|
|
5410
6108
|
headers: ["UID", "\uC77D\uC74C", "\uB0A0\uC9DC", "\uBCF4\uB0B8\uC0AC\uB78C", "\uC81C\uBAA9"],
|
|
5411
6109
|
rows: mails.map((m) => [
|
|
5412
6110
|
String(m.uid),
|
|
5413
|
-
m.isRead ? "\u2713" :
|
|
6111
|
+
m.isRead ? "\u2713" : import_chalk6.default.red("\u2717"),
|
|
5414
6112
|
m.date ? m.date.toLocaleDateString("ko-KR") : "",
|
|
5415
6113
|
m.from.replace(/<.*>/, "").trim() || m.from,
|
|
5416
6114
|
m.subject
|
|
@@ -5428,9 +6126,9 @@ var mailListCommand = new import_commander58.Command("list").description("\uBA54
|
|
|
5428
6126
|
});
|
|
5429
6127
|
|
|
5430
6128
|
// src/commands/mail/get.ts
|
|
5431
|
-
var
|
|
5432
|
-
var
|
|
5433
|
-
var mailGetCommand = new
|
|
6129
|
+
var import_commander60 = require("commander");
|
|
6130
|
+
var import_chalk7 = __toESM(require("chalk"));
|
|
6131
|
+
var mailGetCommand = new import_commander60.Command("get").description("\uBA54\uC77C \uC0C1\uC138 \uC870\uD68C").argument("<uid>", "\uBA54\uC77C UID").action(async (uid) => {
|
|
5434
6132
|
const globalOpts = mailGetCommand.optsWithGlobals();
|
|
5435
6133
|
const config = await getConfigOrThrow();
|
|
5436
6134
|
startSpinner("\uBA54\uC77C \uC870\uD68C \uC911...");
|
|
@@ -5448,11 +6146,11 @@ var mailGetCommand = new import_commander59.Command("get").description("\uBA54\u
|
|
|
5448
6146
|
});
|
|
5449
6147
|
} else {
|
|
5450
6148
|
process.stdout.write(
|
|
5451
|
-
`${
|
|
5452
|
-
${
|
|
5453
|
-
${
|
|
5454
|
-
${
|
|
5455
|
-
${
|
|
6149
|
+
`${import_chalk7.default.bold("\uC81C\uBAA9:")} ${mail.subject}
|
|
6150
|
+
${import_chalk7.default.bold("\uBCF4\uB0B8\uC0AC\uB78C:")} ${mail.from}
|
|
6151
|
+
${import_chalk7.default.bold("\uBC1B\uB294\uC0AC\uB78C:")} ${mail.to.join(", ")}
|
|
6152
|
+
${import_chalk7.default.bold("\uB0A0\uC9DC:")} ${mail.date?.toLocaleString("ko-KR") ?? ""}
|
|
6153
|
+
${import_chalk7.default.bold("\uC77D\uC74C:")} ${mail.isRead ? "\uC608" : "\uC544\uB2C8\uC624"}
|
|
5456
6154
|
|
|
5457
6155
|
${mail.body}
|
|
5458
6156
|
`
|
|
@@ -5461,7 +6159,7 @@ ${mail.body}
|
|
|
5461
6159
|
});
|
|
5462
6160
|
|
|
5463
6161
|
// src/commands/mail/send.ts
|
|
5464
|
-
var
|
|
6162
|
+
var import_commander61 = require("commander");
|
|
5465
6163
|
var import_promises13 = require("fs/promises");
|
|
5466
6164
|
|
|
5467
6165
|
// src/api/smtpClient.ts
|
|
@@ -5502,7 +6200,9 @@ async function sendMail(config, opts) {
|
|
|
5502
6200
|
} else {
|
|
5503
6201
|
mailOptions.text = opts.body;
|
|
5504
6202
|
}
|
|
5505
|
-
const info = await transporter.sendMail(mailOptions)
|
|
6203
|
+
const info = await transporter.sendMail(mailOptions).catch((error) => {
|
|
6204
|
+
throw toMailConnectionError("SMTP", smtp.host, smtp.port, error);
|
|
6205
|
+
});
|
|
5506
6206
|
return {
|
|
5507
6207
|
messageId: info.messageId,
|
|
5508
6208
|
accepted: info.accepted ?? [],
|
|
@@ -5511,7 +6211,7 @@ async function sendMail(config, opts) {
|
|
|
5511
6211
|
}
|
|
5512
6212
|
|
|
5513
6213
|
// src/commands/mail/send.ts
|
|
5514
|
-
var mailSendCommand = new
|
|
6214
|
+
var mailSendCommand = new import_commander61.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) => {
|
|
5515
6215
|
const globalOpts = mailSendCommand.optsWithGlobals();
|
|
5516
6216
|
const config = await getConfigOrThrow();
|
|
5517
6217
|
let body = opts.body ?? "";
|
|
@@ -5546,20 +6246,12 @@ var mailSendCommand = new import_commander60.Command("send").description("\uBA54
|
|
|
5546
6246
|
});
|
|
5547
6247
|
|
|
5548
6248
|
// src/commands/mail/reply.ts
|
|
5549
|
-
var
|
|
6249
|
+
var import_commander62 = require("commander");
|
|
5550
6250
|
var import_promises14 = require("fs/promises");
|
|
5551
|
-
var import_imapflow2 = require("imapflow");
|
|
5552
6251
|
async function getMessageId(config, uid) {
|
|
5553
|
-
const
|
|
5554
|
-
const client = new import_imapflow2.ImapFlow({
|
|
5555
|
-
host: imap.host,
|
|
5556
|
-
port: imap.port,
|
|
5557
|
-
secure: true,
|
|
5558
|
-
auth: { user: imap.username, pass: imap.password },
|
|
5559
|
-
logger: false
|
|
5560
|
-
});
|
|
6252
|
+
const client = createImapClient(config);
|
|
5561
6253
|
try {
|
|
5562
|
-
await client
|
|
6254
|
+
await connectImapClient(client, config);
|
|
5563
6255
|
const lock = await client.getMailboxLock("INBOX");
|
|
5564
6256
|
try {
|
|
5565
6257
|
const msg = await client.fetchOne(String(uid), {
|
|
@@ -5572,10 +6264,10 @@ async function getMessageId(config, uid) {
|
|
|
5572
6264
|
lock.release();
|
|
5573
6265
|
}
|
|
5574
6266
|
} finally {
|
|
5575
|
-
await client
|
|
6267
|
+
await closeImapClient(client);
|
|
5576
6268
|
}
|
|
5577
6269
|
}
|
|
5578
|
-
var mailReplyCommand = new
|
|
6270
|
+
var mailReplyCommand = new import_commander62.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) => {
|
|
5579
6271
|
const globalOpts = mailReplyCommand.optsWithGlobals();
|
|
5580
6272
|
const config = await getConfigOrThrow();
|
|
5581
6273
|
let body = opts.body ?? "";
|
|
@@ -5615,12 +6307,47 @@ var mailReplyCommand = new import_commander61.Command("reply").description("\uBA
|
|
|
5615
6307
|
}
|
|
5616
6308
|
});
|
|
5617
6309
|
|
|
6310
|
+
// src/commands/mail/logout.ts
|
|
6311
|
+
var import_commander63 = require("commander");
|
|
6312
|
+
var import_chalk8 = __toESM(require("chalk"));
|
|
6313
|
+
async function authorizeMailLogout(skipConfirmation, isTTY, confirmRemoval) {
|
|
6314
|
+
if (skipConfirmation) return true;
|
|
6315
|
+
if (!isTTY) {
|
|
6316
|
+
throw new DoorayCliError(
|
|
6317
|
+
"non-TTY \uD658\uACBD\uC5D0\uC11C\uB294 \uD655\uC778 \uC5C6\uC774 \uBA54\uC77C \uC778\uC99D\uC815\uBCF4\uB97C \uC81C\uAC70\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. --yes(-y) \uD50C\uB798\uADF8\uB85C \uB2E4\uC2DC \uC2E4\uD589\uD558\uC138\uC694.",
|
|
6318
|
+
EXIT_PARAM_ERROR
|
|
6319
|
+
);
|
|
6320
|
+
}
|
|
6321
|
+
return confirmRemoval();
|
|
6322
|
+
}
|
|
6323
|
+
var mailLogoutCommand = new import_commander63.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) => {
|
|
6324
|
+
const confirmed = await authorizeMailLogout(
|
|
6325
|
+
!!opts.yes,
|
|
6326
|
+
!!process.stdin.isTTY,
|
|
6327
|
+
async () => {
|
|
6328
|
+
const { confirm: confirm2 } = await import("@inquirer/prompts");
|
|
6329
|
+
return confirm2({
|
|
6330
|
+
message: "\uC800\uC7A5\uB41C IMAP \uC0AC\uC6A9\uC790\uBA85\uACFC \uC571 \uBE44\uBC00\uBC88\uD638\uB97C \uC81C\uAC70\uD560\uAE4C\uC694?",
|
|
6331
|
+
default: false
|
|
6332
|
+
});
|
|
6333
|
+
}
|
|
6334
|
+
);
|
|
6335
|
+
if (!confirmed) {
|
|
6336
|
+
process.stderr.write("\uCDE8\uC18C\uB418\uC5C8\uC2B5\uB2C8\uB2E4.\n");
|
|
6337
|
+
return;
|
|
6338
|
+
}
|
|
6339
|
+
const removed = await clearMailCredentials();
|
|
6340
|
+
process.stderr.write(
|
|
6341
|
+
removed ? 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"
|
|
6342
|
+
);
|
|
6343
|
+
});
|
|
6344
|
+
|
|
5618
6345
|
// src/commands/messenger/index.ts
|
|
5619
|
-
var
|
|
6346
|
+
var import_commander66 = require("commander");
|
|
5620
6347
|
|
|
5621
6348
|
// src/commands/messenger/send.ts
|
|
5622
|
-
var
|
|
5623
|
-
var messengerSendCommand = new
|
|
6349
|
+
var import_commander64 = require("commander");
|
|
6350
|
+
var messengerSendCommand = new import_commander64.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) => {
|
|
5624
6351
|
if (!opts.to) {
|
|
5625
6352
|
throw new DoorayCliError("--to \uC635\uC158\uC740 \uD544\uC218\uC785\uB2C8\uB2E4.", EXIT_PARAM_ERROR);
|
|
5626
6353
|
}
|
|
@@ -5660,7 +6387,7 @@ var messengerSendCommand = new import_commander62.Command("send").description("\
|
|
|
5660
6387
|
});
|
|
5661
6388
|
|
|
5662
6389
|
// src/commands/messenger/channel-send.ts
|
|
5663
|
-
var
|
|
6390
|
+
var import_commander65 = require("commander");
|
|
5664
6391
|
|
|
5665
6392
|
// src/resolvers/messenger-channel.ts
|
|
5666
6393
|
var CHANNEL_ID_RE = /^\d{15,}$/;
|
|
@@ -5678,7 +6405,7 @@ async function resolveMessengerChannel(client, input2) {
|
|
|
5678
6405
|
}
|
|
5679
6406
|
|
|
5680
6407
|
// src/commands/messenger/channel-send.ts
|
|
5681
|
-
var messengerChannelSendCommand = new
|
|
6408
|
+
var messengerChannelSendCommand = new import_commander65.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) => {
|
|
5682
6409
|
if (!opts.channel) {
|
|
5683
6410
|
throw new DoorayCliError("--channel \uC635\uC158\uC740 \uD544\uC218\uC785\uB2C8\uB2E4.", EXIT_PARAM_ERROR);
|
|
5684
6411
|
}
|
|
@@ -5712,30 +6439,30 @@ var messengerChannelSendCommand = new import_commander63.Command("channel-send")
|
|
|
5712
6439
|
});
|
|
5713
6440
|
|
|
5714
6441
|
// src/commands/messenger/index.ts
|
|
5715
|
-
var messengerCommand = new
|
|
6442
|
+
var messengerCommand = new import_commander66.Command("messenger").description("\uBA54\uC2E0\uC800 \uAD00\uB828 \uBA85\uB839");
|
|
5716
6443
|
messengerCommand.addCommand(messengerSendCommand);
|
|
5717
6444
|
messengerCommand.addCommand(messengerChannelSendCommand);
|
|
5718
6445
|
|
|
5719
6446
|
// src/commands/feedback.ts
|
|
5720
|
-
var
|
|
6447
|
+
var import_commander67 = require("commander");
|
|
5721
6448
|
var import_node_child_process2 = require("child_process");
|
|
5722
6449
|
var import_node_util = require("util");
|
|
5723
6450
|
var import_promises17 = require("fs/promises");
|
|
5724
|
-
var
|
|
5725
|
-
var
|
|
5726
|
-
var
|
|
6451
|
+
var import_node_os5 = require("os");
|
|
6452
|
+
var import_node_path16 = require("path");
|
|
6453
|
+
var import_node_crypto2 = require("crypto");
|
|
5727
6454
|
var import_prompts = require("@inquirer/prompts");
|
|
5728
6455
|
|
|
5729
6456
|
// src/utils/feedback-meta.ts
|
|
5730
6457
|
var import_promises15 = require("fs/promises");
|
|
5731
|
-
var
|
|
6458
|
+
var import_node_path14 = require("path");
|
|
5732
6459
|
async function readCliVersion() {
|
|
5733
6460
|
const entry = process.argv[1];
|
|
5734
|
-
const here = entry ? (0,
|
|
6461
|
+
const here = entry ? (0, import_node_path14.dirname)(entry) : process.cwd();
|
|
5735
6462
|
const candidates = [
|
|
5736
|
-
(0,
|
|
5737
|
-
(0,
|
|
5738
|
-
(0,
|
|
6463
|
+
(0, import_node_path14.join)(here, "package.json"),
|
|
6464
|
+
(0, import_node_path14.join)(here, "..", "package.json"),
|
|
6465
|
+
(0, import_node_path14.join)(here, "..", "..", "package.json")
|
|
5739
6466
|
];
|
|
5740
6467
|
for (const p of candidates) {
|
|
5741
6468
|
try {
|
|
@@ -5786,9 +6513,9 @@ function buildIssueBody(userBody, meta) {
|
|
|
5786
6513
|
|
|
5787
6514
|
// src/cache/last-run.ts
|
|
5788
6515
|
var import_promises16 = require("fs/promises");
|
|
5789
|
-
var
|
|
5790
|
-
var
|
|
5791
|
-
var LAST_RUN_PATH = (0,
|
|
6516
|
+
var import_node_path15 = require("path");
|
|
6517
|
+
var import_node_os4 = require("os");
|
|
6518
|
+
var LAST_RUN_PATH = (0, import_node_path15.join)((0, import_node_os4.homedir)(), ".dooray", "last-run.json");
|
|
5792
6519
|
function isLastRun(obj) {
|
|
5793
6520
|
if (typeof obj !== "object" || obj === null) return false;
|
|
5794
6521
|
const o = obj;
|
|
@@ -5804,7 +6531,7 @@ async function readLastRun() {
|
|
|
5804
6531
|
}
|
|
5805
6532
|
}
|
|
5806
6533
|
async function writeLastRun(data) {
|
|
5807
|
-
await (0, import_promises16.mkdir)((0,
|
|
6534
|
+
await (0, import_promises16.mkdir)((0, import_node_path15.join)((0, import_node_os4.homedir)(), ".dooray"), { recursive: true });
|
|
5808
6535
|
const tmp2 = LAST_RUN_PATH + ".tmp";
|
|
5809
6536
|
await (0, import_promises16.writeFile)(tmp2, JSON.stringify(data, null, 2) + "\n", { mode: 384 });
|
|
5810
6537
|
await (0, import_promises16.rename)(tmp2, LAST_RUN_PATH);
|
|
@@ -5828,7 +6555,7 @@ async function readBody(opts) {
|
|
|
5828
6555
|
if (opts.bodyFile) return await (0, import_promises17.readFile)(opts.bodyFile, "utf-8");
|
|
5829
6556
|
return void 0;
|
|
5830
6557
|
}
|
|
5831
|
-
var feedbackCommand = new
|
|
6558
|
+
var feedbackCommand = new import_commander67.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(
|
|
5832
6559
|
"--label <name>",
|
|
5833
6560
|
"\uB77C\uBCA8 (\uBC18\uBCF5 \uAC00\uB2A5)",
|
|
5834
6561
|
(value, prev) => [...prev, value],
|
|
@@ -5919,7 +6646,7 @@ var feedbackCommand = new import_commander65.Command("feedback").description("do
|
|
|
5919
6646
|
}
|
|
5920
6647
|
}
|
|
5921
6648
|
await ensureGhInstalled();
|
|
5922
|
-
const bodyFile = (0,
|
|
6649
|
+
const bodyFile = (0, import_node_path16.join)((0, import_node_os5.tmpdir)(), `dooray-feedback-${(0, import_node_crypto2.randomUUID)()}.md`);
|
|
5923
6650
|
await (0, import_promises17.writeFile)(bodyFile, issueBody);
|
|
5924
6651
|
try {
|
|
5925
6652
|
const args = [
|
|
@@ -5991,25 +6718,25 @@ function sanitizeArgv(argv) {
|
|
|
5991
6718
|
}
|
|
5992
6719
|
|
|
5993
6720
|
// src/index.ts
|
|
5994
|
-
var program = new
|
|
5995
|
-
program.name("dooray").description("Dooray REST API CLI").version(
|
|
6721
|
+
var program = new import_commander68.Command();
|
|
6722
|
+
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");
|
|
5996
6723
|
program.hook("preAction", () => {
|
|
5997
6724
|
const opts = program.opts();
|
|
5998
6725
|
if (opts.color === false || process.env.NO_COLOR) {
|
|
5999
|
-
|
|
6726
|
+
import_chalk9.default.level = 0;
|
|
6000
6727
|
}
|
|
6001
6728
|
if (opts.json || opts.quiet) {
|
|
6002
6729
|
setQuiet(true);
|
|
6003
6730
|
}
|
|
6004
6731
|
});
|
|
6005
|
-
var projectCommand = new
|
|
6732
|
+
var projectCommand = new import_commander68.Command("project").description("\uD504\uB85C\uC81D\uD2B8 \uAD00\uB828 \uBA85\uB839");
|
|
6006
6733
|
projectCommand.addCommand(projectListCommand);
|
|
6007
6734
|
projectCommand.addCommand(projectMembersCommand);
|
|
6008
6735
|
projectCommand.addCommand(projectWorkflowsCommand);
|
|
6009
6736
|
projectCommand.addCommand(projectGroupsCommand);
|
|
6010
6737
|
projectCommand.addCommand(projectTagsCommand);
|
|
6011
6738
|
projectCommand.addCommand(projectTemplatesCommand);
|
|
6012
|
-
var postCommand = new
|
|
6739
|
+
var postCommand = new import_commander68.Command("post").description("\uC5C5\uBB34 \uAD00\uB828 \uBA85\uB839");
|
|
6013
6740
|
postCommand.addCommand(postListCommand);
|
|
6014
6741
|
postCommand.addCommand(postSearchCommand);
|
|
6015
6742
|
postCommand.addCommand(postGetCommand);
|
|
@@ -6017,7 +6744,7 @@ postCommand.addCommand(postEditCommand);
|
|
|
6017
6744
|
postCommand.addCommand(postCreateCommand);
|
|
6018
6745
|
postCommand.addCommand(postDoneCommand);
|
|
6019
6746
|
postCommand.addCommand(postWorkflowCommand);
|
|
6020
|
-
var commentCommand = new
|
|
6747
|
+
var commentCommand = new import_commander68.Command("comment").description("\uB313\uAE00 \uAD00\uB828 \uBA85\uB839");
|
|
6021
6748
|
commentCommand.addCommand(commentListCommand);
|
|
6022
6749
|
commentCommand.addCommand(commentLatestCommand);
|
|
6023
6750
|
commentCommand.addCommand(commentGetCommand);
|
|
@@ -6026,18 +6753,18 @@ commentCommand.addCommand(commentEditCommand);
|
|
|
6026
6753
|
commentCommand.addCommand(commentDeleteCommand);
|
|
6027
6754
|
commentCommand.addCommand(commentFileCommand);
|
|
6028
6755
|
postCommand.addCommand(commentCommand);
|
|
6029
|
-
var fileCommand = new
|
|
6756
|
+
var fileCommand = new import_commander68.Command("file").description("\uCCA8\uBD80\uD30C\uC77C \uAD00\uB828 \uBA85\uB839");
|
|
6030
6757
|
fileCommand.addCommand(fileListCommand);
|
|
6031
6758
|
fileCommand.addCommand(fileDownloadCommand);
|
|
6032
6759
|
fileCommand.addCommand(fileDownloadAllCommand);
|
|
6033
6760
|
fileCommand.addCommand(fileUploadCommand);
|
|
6034
6761
|
fileCommand.addCommand(fileDeleteCommand);
|
|
6035
6762
|
postCommand.addCommand(fileCommand);
|
|
6036
|
-
var wikiCommand = new
|
|
6763
|
+
var wikiCommand = new import_commander68.Command("wiki").description("\uC704\uD0A4 \uAD00\uB828 \uBA85\uB839");
|
|
6037
6764
|
wikiCommand.addCommand(wikiListCommand);
|
|
6038
6765
|
wikiCommand.addCommand(wikiPagesCommand);
|
|
6039
6766
|
wikiCommand.addCommand(wikiTreeCommand);
|
|
6040
|
-
var wikiPageCommand = new
|
|
6767
|
+
var wikiPageCommand = new import_commander68.Command("page").description("\uC704\uD0A4 \uD398\uC774\uC9C0 \uAD00\uB828 \uBA85\uB839");
|
|
6041
6768
|
wikiPageCommand.addCommand(wikiPageGetCommand);
|
|
6042
6769
|
wikiPageCommand.addCommand(wikiPageCreateCommand);
|
|
6043
6770
|
wikiPageCommand.addCommand(wikiPageEditCommand);
|
|
@@ -6045,12 +6772,14 @@ wikiPageCommand.addCommand(wikiPageDeleteCommand);
|
|
|
6045
6772
|
wikiPageCommand.addCommand(wikiPageFileCommand);
|
|
6046
6773
|
wikiPageCommand.addCommand(wikiPageCommentCommand);
|
|
6047
6774
|
wikiCommand.addCommand(wikiPageCommand);
|
|
6048
|
-
var mailCommand = new
|
|
6775
|
+
var mailCommand = new import_commander68.Command("mail").description("\uBA54\uC77C \uAD00\uB828 \uBA85\uB839");
|
|
6049
6776
|
mailCommand.addCommand(mailListCommand);
|
|
6050
6777
|
mailCommand.addCommand(mailGetCommand);
|
|
6051
6778
|
mailCommand.addCommand(mailSendCommand);
|
|
6052
6779
|
mailCommand.addCommand(mailReplyCommand);
|
|
6780
|
+
mailCommand.addCommand(mailLogoutCommand);
|
|
6053
6781
|
program.addCommand(setupCommand);
|
|
6782
|
+
program.addCommand(skillCommand);
|
|
6054
6783
|
program.addCommand(configCommand);
|
|
6055
6784
|
program.addCommand(memberCommand);
|
|
6056
6785
|
program.addCommand(cacheCommand);
|
|
@@ -6079,6 +6808,6 @@ program.parseAsync().catch(async (err) => {
|
|
|
6079
6808
|
}
|
|
6080
6809
|
} catch {
|
|
6081
6810
|
}
|
|
6082
|
-
process.stderr.write(
|
|
6811
|
+
process.stderr.write(import_chalk9.default.red(`\uC624\uB958: ${errorMessage}`) + "\n");
|
|
6083
6812
|
process.exit(exitCode);
|
|
6084
6813
|
});
|