@bifos/dooray-cli 0.14.0 → 0.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +44 -17
- package/dist/index.js +838 -216
- package/package.json +3 -2
- package/skills/dooray-cli/SKILL.md +7 -1
- package/skills/dooray-cli/references/common.md +33 -0
- package/skills/dooray-cli/references/wiki.md +18 -0
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_commander67 = require("commander");
|
|
28
|
+
var import_chalk8 = __toESM(require("chalk"));
|
|
29
29
|
|
|
30
30
|
// src/commands/config.ts
|
|
31
31
|
var import_commander = require("commander");
|
|
@@ -209,18 +209,18 @@ var TEMPLATES_DIR = (0, import_node_path2.join)(CACHE_DIR, "templates");
|
|
|
209
209
|
async function ensureDir2(dir) {
|
|
210
210
|
await (0, import_promises2.mkdir)(dir, { recursive: true });
|
|
211
211
|
}
|
|
212
|
-
async function readJson(
|
|
212
|
+
async function readJson(path6) {
|
|
213
213
|
try {
|
|
214
|
-
const raw = await (0, import_promises2.readFile)(
|
|
214
|
+
const raw = await (0, import_promises2.readFile)(path6, "utf-8");
|
|
215
215
|
return JSON.parse(raw);
|
|
216
216
|
} catch {
|
|
217
217
|
return null;
|
|
218
218
|
}
|
|
219
219
|
}
|
|
220
|
-
async function writeJson(
|
|
221
|
-
const dir = (0, import_node_path2.dirname)(
|
|
220
|
+
async function writeJson(path6, data) {
|
|
221
|
+
const dir = (0, import_node_path2.dirname)(path6);
|
|
222
222
|
await ensureDir2(dir);
|
|
223
|
-
await (0, import_promises2.writeFile)(
|
|
223
|
+
await (0, import_promises2.writeFile)(path6, JSON.stringify(data, null, 2) + "\n");
|
|
224
224
|
}
|
|
225
225
|
function isExpired(updatedAt, ttlMs) {
|
|
226
226
|
if (!updatedAt) return true;
|
|
@@ -367,10 +367,553 @@ var import_chalk3 = __toESM(require("chalk"));
|
|
|
367
367
|
var import_path = __toESM(require("path"));
|
|
368
368
|
var import_promises4 = __toESM(require("fs/promises"));
|
|
369
369
|
|
|
370
|
+
// src/skill/context.ts
|
|
371
|
+
var import_node_path3 = __toESM(require("path"));
|
|
372
|
+
var import_node_os3 = require("os");
|
|
373
|
+
|
|
374
|
+
// src/version.ts
|
|
375
|
+
var CLI_VERSION = true ? "0.15.0" : "0.0.0-dev";
|
|
376
|
+
|
|
377
|
+
// src/skill/context.ts
|
|
378
|
+
function resolveSkillDataRoot(homeDir, xdgDataHome = process.env.XDG_DATA_HOME) {
|
|
379
|
+
if (xdgDataHome != null && import_node_path3.default.isAbsolute(xdgDataHome)) {
|
|
380
|
+
return import_node_path3.default.join(xdgDataHome, "dooray-cli");
|
|
381
|
+
}
|
|
382
|
+
return import_node_path3.default.join(homeDir, ".local", "share", "dooray-cli");
|
|
383
|
+
}
|
|
384
|
+
function createSkillManagerContext() {
|
|
385
|
+
const homeDir = (0, import_node_os3.homedir)();
|
|
386
|
+
return {
|
|
387
|
+
homeDir,
|
|
388
|
+
packageRoot: import_node_path3.default.resolve(__dirname, ".."),
|
|
389
|
+
currentVersion: CLI_VERSION,
|
|
390
|
+
dataRoot: resolveSkillDataRoot(homeDir)
|
|
391
|
+
};
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
// src/skill/manager.ts
|
|
395
|
+
var fs2 = __toESM(require("fs/promises"));
|
|
396
|
+
var import_node_path5 = __toESM(require("path"));
|
|
397
|
+
|
|
398
|
+
// src/skill/manifest.ts
|
|
399
|
+
var import_node_crypto = require("crypto");
|
|
400
|
+
var fs = __toESM(require("fs/promises"));
|
|
401
|
+
var import_node_path4 = __toESM(require("path"));
|
|
402
|
+
var MANIFEST_FILE_NAME = ".dooray-skill.json";
|
|
403
|
+
var DIGEST_PREFIX = "sha256:";
|
|
404
|
+
var HASH_HEADER = Buffer.from("dooray-skill-content-v1\0", "utf8");
|
|
405
|
+
function isUtcIsoTimestamp(value) {
|
|
406
|
+
if (!/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$/.test(value)) {
|
|
407
|
+
return false;
|
|
408
|
+
}
|
|
409
|
+
const timestamp = Date.parse(value);
|
|
410
|
+
if (!Number.isFinite(timestamp)) {
|
|
411
|
+
return false;
|
|
412
|
+
}
|
|
413
|
+
return new Date(timestamp).toISOString() === value;
|
|
414
|
+
}
|
|
415
|
+
function isDooraySkillManifest(value) {
|
|
416
|
+
const installedAt = value != null && typeof value === "object" && "installedAt" in value && typeof value.installedAt === "string" ? value.installedAt : null;
|
|
417
|
+
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";
|
|
418
|
+
}
|
|
419
|
+
async function readDooraySkillManifest(manifestPath) {
|
|
420
|
+
try {
|
|
421
|
+
const parsed = JSON.parse(await fs.readFile(manifestPath, "utf8"));
|
|
422
|
+
return isDooraySkillManifest(parsed) ? parsed : null;
|
|
423
|
+
} catch {
|
|
424
|
+
return null;
|
|
425
|
+
}
|
|
426
|
+
}
|
|
427
|
+
function createDooraySkillManifest(packageVersion, contentDigest, installedAt = (/* @__PURE__ */ new Date()).toISOString()) {
|
|
428
|
+
return {
|
|
429
|
+
schemaVersion: 1,
|
|
430
|
+
skillName: "dooray-cli",
|
|
431
|
+
packageName: "@bifos/dooray-cli",
|
|
432
|
+
packageVersion,
|
|
433
|
+
contentDigest,
|
|
434
|
+
installedAt,
|
|
435
|
+
managedBy: "@bifos/dooray-cli"
|
|
436
|
+
};
|
|
437
|
+
}
|
|
438
|
+
function getDigestHex(contentDigest) {
|
|
439
|
+
return contentDigest.slice(DIGEST_PREFIX.length);
|
|
440
|
+
}
|
|
441
|
+
function compareCodePoint(left, right) {
|
|
442
|
+
const leftPoints = Array.from(left);
|
|
443
|
+
const rightPoints = Array.from(right);
|
|
444
|
+
const length = Math.min(leftPoints.length, rightPoints.length);
|
|
445
|
+
for (let index = 0; index < length; index += 1) {
|
|
446
|
+
const leftCodePoint = leftPoints[index].codePointAt(0) ?? 0;
|
|
447
|
+
const rightCodePoint = rightPoints[index].codePointAt(0) ?? 0;
|
|
448
|
+
if (leftCodePoint !== rightCodePoint) {
|
|
449
|
+
return leftCodePoint - rightCodePoint;
|
|
450
|
+
}
|
|
451
|
+
}
|
|
452
|
+
return leftPoints.length - rightPoints.length;
|
|
453
|
+
}
|
|
454
|
+
async function assertRegularFile(filePath) {
|
|
455
|
+
const stat3 = await fs.lstat(filePath);
|
|
456
|
+
if (!stat3.isFile()) {
|
|
457
|
+
throw new DoorayCliError(
|
|
458
|
+
`\uC2A4\uD0AC \uCF58\uD150\uCE20\uB294 \uC815\uADDC \uD30C\uC77C\uB9CC \uD3EC\uD568\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4: ${filePath}`,
|
|
459
|
+
EXIT_PARAM_ERROR
|
|
460
|
+
);
|
|
461
|
+
}
|
|
462
|
+
}
|
|
463
|
+
async function collectReferenceFiles(root, current2, files) {
|
|
464
|
+
const currentStat = await fs.lstat(current2).catch((error) => {
|
|
465
|
+
if (error instanceof Error && "code" in error && error.code === "ENOENT") {
|
|
466
|
+
return null;
|
|
467
|
+
}
|
|
468
|
+
throw error;
|
|
469
|
+
});
|
|
470
|
+
if (currentStat == null) {
|
|
471
|
+
return;
|
|
472
|
+
}
|
|
473
|
+
if (!currentStat.isDirectory()) {
|
|
474
|
+
throw new DoorayCliError(
|
|
475
|
+
`\uC2A4\uD0AC references\uB294 \uB514\uB809\uD130\uB9AC\uC5EC\uC57C \uD569\uB2C8\uB2E4: ${current2}`,
|
|
476
|
+
EXIT_PARAM_ERROR
|
|
477
|
+
);
|
|
478
|
+
}
|
|
479
|
+
let entries;
|
|
480
|
+
entries = await fs.readdir(current2, { withFileTypes: true });
|
|
481
|
+
for (const entry of entries) {
|
|
482
|
+
const entryPath = import_node_path4.default.join(current2, entry.name);
|
|
483
|
+
if (entry.isDirectory()) {
|
|
484
|
+
await collectReferenceFiles(root, entryPath, files);
|
|
485
|
+
continue;
|
|
486
|
+
}
|
|
487
|
+
await assertRegularFile(entryPath);
|
|
488
|
+
files.push(import_node_path4.default.relative(root, entryPath).split(import_node_path4.default.sep).join("/"));
|
|
489
|
+
}
|
|
490
|
+
}
|
|
491
|
+
async function collectSkillContentFiles(skillDir) {
|
|
492
|
+
const files = [];
|
|
493
|
+
const skillFile = import_node_path4.default.join(skillDir, "SKILL.md");
|
|
494
|
+
await assertRegularFile(skillFile);
|
|
495
|
+
files.push("SKILL.md");
|
|
496
|
+
await collectReferenceFiles(skillDir, import_node_path4.default.join(skillDir, "references"), files);
|
|
497
|
+
return files.filter((file) => file !== MANIFEST_FILE_NAME).sort(compareCodePoint);
|
|
498
|
+
}
|
|
499
|
+
function writeUInt64BE(value) {
|
|
500
|
+
const buffer = Buffer.alloc(8);
|
|
501
|
+
buffer.writeBigUInt64BE(BigInt(value));
|
|
502
|
+
return buffer;
|
|
503
|
+
}
|
|
504
|
+
async function computeSkillContentDigest(skillDir) {
|
|
505
|
+
const hash = (0, import_node_crypto.createHash)("sha256");
|
|
506
|
+
hash.update(HASH_HEADER);
|
|
507
|
+
for (const relativePath of await collectSkillContentFiles(skillDir)) {
|
|
508
|
+
const relativePathBuffer = Buffer.from(relativePath, "utf8");
|
|
509
|
+
const content = await fs.readFile(import_node_path4.default.join(skillDir, relativePath));
|
|
510
|
+
hash.update(Buffer.from([1]));
|
|
511
|
+
hash.update(writeUInt64BE(Buffer.byteLength(relativePath, "utf8")));
|
|
512
|
+
hash.update(relativePathBuffer);
|
|
513
|
+
hash.update(writeUInt64BE(content.length));
|
|
514
|
+
hash.update(content);
|
|
515
|
+
}
|
|
516
|
+
return `sha256:${hash.digest("hex")}`;
|
|
517
|
+
}
|
|
518
|
+
|
|
519
|
+
// src/skill/manager.ts
|
|
520
|
+
var PACKAGE_NAME = "@bifos/dooray-cli";
|
|
521
|
+
var SKILL_RELATIVE_PATH = import_node_path5.default.join("skills", "dooray-cli");
|
|
522
|
+
function getSource(context) {
|
|
523
|
+
return import_node_path5.default.join(context.packageRoot, SKILL_RELATIVE_PATH);
|
|
524
|
+
}
|
|
525
|
+
function getDestination(context) {
|
|
526
|
+
return import_node_path5.default.join(context.homeDir, ".claude", "skills", "dooray-cli");
|
|
527
|
+
}
|
|
528
|
+
function getDataRoot(context) {
|
|
529
|
+
return context.dataRoot ?? import_node_path5.default.join(context.homeDir, ".local", "share", "dooray-cli");
|
|
530
|
+
}
|
|
531
|
+
function getStoreRoot(context) {
|
|
532
|
+
return import_node_path5.default.join(getDataRoot(context), "skills");
|
|
533
|
+
}
|
|
534
|
+
function getStorePath(context, contentDigest) {
|
|
535
|
+
return import_node_path5.default.join(
|
|
536
|
+
getStoreRoot(context),
|
|
537
|
+
`${context.currentVersion}-${getDigestHex(contentDigest)}`
|
|
538
|
+
);
|
|
539
|
+
}
|
|
540
|
+
function statusOf(context, status, overrides = {}) {
|
|
541
|
+
return {
|
|
542
|
+
schemaVersion: 1,
|
|
543
|
+
status,
|
|
544
|
+
destination: getDestination(context),
|
|
545
|
+
source: getSource(context),
|
|
546
|
+
currentVersion: context.currentVersion,
|
|
547
|
+
installedVersion: overrides.installedVersion ?? null,
|
|
548
|
+
linkTarget: overrides.linkTarget ?? null,
|
|
549
|
+
managed: overrides.managed ?? false
|
|
550
|
+
};
|
|
551
|
+
}
|
|
552
|
+
function isNodeError(error, code) {
|
|
553
|
+
return error instanceof Error && "code" in error && error.code === code;
|
|
554
|
+
}
|
|
555
|
+
function isPackageMetadata(value) {
|
|
556
|
+
return value != null && typeof value === "object" && "name" in value && "version" in value && typeof value.name === "string" && typeof value.version === "string";
|
|
557
|
+
}
|
|
558
|
+
async function readPackageMetadata(skillPath) {
|
|
559
|
+
const packageJsonPath = import_node_path5.default.join(skillPath, "..", "..", "package.json");
|
|
560
|
+
try {
|
|
561
|
+
const parsed = JSON.parse(
|
|
562
|
+
await fs2.readFile(packageJsonPath, "utf8")
|
|
563
|
+
);
|
|
564
|
+
if (!isPackageMetadata(parsed)) {
|
|
565
|
+
return null;
|
|
566
|
+
}
|
|
567
|
+
return parsed;
|
|
568
|
+
} catch {
|
|
569
|
+
return null;
|
|
570
|
+
}
|
|
571
|
+
}
|
|
572
|
+
function resolveLinkTarget(destination, linkTarget) {
|
|
573
|
+
return import_node_path5.default.resolve(import_node_path5.default.dirname(destination), linkTarget);
|
|
574
|
+
}
|
|
575
|
+
async function isSameEntry(left, right) {
|
|
576
|
+
try {
|
|
577
|
+
const [leftRealPath, rightRealPath] = await Promise.all([
|
|
578
|
+
fs2.realpath(left),
|
|
579
|
+
fs2.realpath(right)
|
|
580
|
+
]);
|
|
581
|
+
return leftRealPath === rightRealPath;
|
|
582
|
+
} catch {
|
|
583
|
+
return import_node_path5.default.resolve(left) === import_node_path5.default.resolve(right);
|
|
584
|
+
}
|
|
585
|
+
}
|
|
586
|
+
function isManagedSkillPath(candidate) {
|
|
587
|
+
const parts = import_node_path5.default.normalize(candidate).split(import_node_path5.default.sep).filter(Boolean);
|
|
588
|
+
const suffix = ["@bifos", "dooray-cli", "skills", "dooray-cli"];
|
|
589
|
+
if (parts.length < suffix.length) {
|
|
590
|
+
return false;
|
|
591
|
+
}
|
|
592
|
+
return suffix.every(
|
|
593
|
+
(part, index) => parts[parts.length - suffix.length + index] === part
|
|
594
|
+
);
|
|
595
|
+
}
|
|
596
|
+
function utcTimestamp() {
|
|
597
|
+
return (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-");
|
|
598
|
+
}
|
|
599
|
+
function isInsideStoreRoot(context, target) {
|
|
600
|
+
const relative = import_node_path5.default.relative(getStoreRoot(context), target);
|
|
601
|
+
return relative !== "" && !relative.startsWith("..") && !import_node_path5.default.isAbsolute(relative);
|
|
602
|
+
}
|
|
603
|
+
function parseStoreBasename(basename9) {
|
|
604
|
+
if (basename9.length < 66 || basename9[basename9.length - 65] !== "-") {
|
|
605
|
+
return null;
|
|
606
|
+
}
|
|
607
|
+
const packageVersion = basename9.slice(0, -65);
|
|
608
|
+
const digestHex = basename9.slice(-64);
|
|
609
|
+
if (!/^[0-9a-f]{64}$/.test(digestHex) || packageVersion.length === 0) {
|
|
610
|
+
return null;
|
|
611
|
+
}
|
|
612
|
+
return {
|
|
613
|
+
packageVersion,
|
|
614
|
+
contentDigest: `sha256:${digestHex}`
|
|
615
|
+
};
|
|
616
|
+
}
|
|
617
|
+
async function writeManifest(storePath, manifest) {
|
|
618
|
+
await fs2.writeFile(
|
|
619
|
+
import_node_path5.default.join(storePath, MANIFEST_FILE_NAME),
|
|
620
|
+
`${JSON.stringify(manifest, null, 2)}
|
|
621
|
+
`
|
|
622
|
+
);
|
|
623
|
+
}
|
|
624
|
+
async function copySkillContentFiles(source, destination) {
|
|
625
|
+
for (const relativePath of await collectSkillContentFiles(source)) {
|
|
626
|
+
const sourcePath = import_node_path5.default.join(source, relativePath);
|
|
627
|
+
const destinationPath = import_node_path5.default.join(destination, ...relativePath.split("/"));
|
|
628
|
+
await fs2.mkdir(import_node_path5.default.dirname(destinationPath), { recursive: true });
|
|
629
|
+
await fs2.copyFile(sourcePath, destinationPath);
|
|
630
|
+
}
|
|
631
|
+
}
|
|
632
|
+
async function verifyStore(storePath, expectedManifest) {
|
|
633
|
+
const basename9 = parseStoreBasename(import_node_path5.default.basename(storePath));
|
|
634
|
+
if (basename9 == null || basename9.packageVersion !== expectedManifest.packageVersion || basename9.contentDigest !== expectedManifest.contentDigest) {
|
|
635
|
+
return "corrupt";
|
|
636
|
+
}
|
|
637
|
+
const manifest = await readDooraySkillManifest(
|
|
638
|
+
import_node_path5.default.join(storePath, MANIFEST_FILE_NAME)
|
|
639
|
+
);
|
|
640
|
+
if (manifest == null || manifest.packageVersion !== expectedManifest.packageVersion || manifest.contentDigest !== expectedManifest.contentDigest) {
|
|
641
|
+
return "corrupt";
|
|
642
|
+
}
|
|
643
|
+
const actualDigest = await computeSkillContentDigest(storePath).catch(() => null);
|
|
644
|
+
if (actualDigest !== expectedManifest.contentDigest) {
|
|
645
|
+
return "modified";
|
|
646
|
+
}
|
|
647
|
+
return "valid";
|
|
648
|
+
}
|
|
649
|
+
async function createStagedStore(context, sourceDigest) {
|
|
650
|
+
const storeRoot = getStoreRoot(context);
|
|
651
|
+
const stagingPath = import_node_path5.default.join(
|
|
652
|
+
storeRoot,
|
|
653
|
+
`.tmp-${process.pid}-${Date.now()}-${getDigestHex(sourceDigest)}`
|
|
654
|
+
);
|
|
655
|
+
await fs2.mkdir(stagingPath, { recursive: true });
|
|
656
|
+
try {
|
|
657
|
+
await copySkillContentFiles(getSource(context), stagingPath);
|
|
658
|
+
const stagedDigest = await computeSkillContentDigest(stagingPath);
|
|
659
|
+
if (stagedDigest !== sourceDigest) {
|
|
660
|
+
throw new DoorayCliError(
|
|
661
|
+
`\uC2A4\uD0AC staging \uD574\uC2DC\uAC00 source \uD574\uC2DC\uC640 \uB2E4\uB985\uB2C8\uB2E4: ${stagedDigest}`,
|
|
662
|
+
1
|
|
663
|
+
);
|
|
664
|
+
}
|
|
665
|
+
await writeManifest(
|
|
666
|
+
stagingPath,
|
|
667
|
+
createDooraySkillManifest(context.currentVersion, sourceDigest)
|
|
668
|
+
);
|
|
669
|
+
return stagingPath;
|
|
670
|
+
} catch (error) {
|
|
671
|
+
await fs2.rm(stagingPath, { recursive: true, force: true }).catch(() => {
|
|
672
|
+
});
|
|
673
|
+
throw error;
|
|
674
|
+
}
|
|
675
|
+
}
|
|
676
|
+
async function prepareStore(context, options) {
|
|
677
|
+
const sourceDigest = await computeSkillContentDigest(getSource(context));
|
|
678
|
+
const expectedManifest = createDooraySkillManifest(
|
|
679
|
+
context.currentVersion,
|
|
680
|
+
sourceDigest
|
|
681
|
+
);
|
|
682
|
+
const storeRoot = getStoreRoot(context);
|
|
683
|
+
const storePath = getStorePath(context, sourceDigest);
|
|
684
|
+
await fs2.mkdir(storeRoot, { recursive: true });
|
|
685
|
+
const existing = await fs2.lstat(storePath).then((stat3) => stat3).catch((error) => {
|
|
686
|
+
if (isNodeError(error, "ENOENT")) {
|
|
687
|
+
return null;
|
|
688
|
+
}
|
|
689
|
+
throw error;
|
|
690
|
+
});
|
|
691
|
+
if (existing != null) {
|
|
692
|
+
if (!existing.isDirectory()) {
|
|
693
|
+
throw new DoorayCliError(
|
|
694
|
+
`\uAD00\uB9AC\uD615 \uC2A4\uD0AC \uC800\uC7A5 \uACBD\uB85C\uAC00 \uB514\uB809\uD130\uB9AC\uAC00 \uC544\uB2D9\uB2C8\uB2E4: ${storePath}`,
|
|
695
|
+
EXIT_PARAM_ERROR
|
|
696
|
+
);
|
|
697
|
+
}
|
|
698
|
+
const status = await verifyStore(storePath, expectedManifest);
|
|
699
|
+
if (status === "valid") {
|
|
700
|
+
return storePath;
|
|
701
|
+
}
|
|
702
|
+
if (options.force !== true) {
|
|
703
|
+
throw new DoorayCliError(
|
|
704
|
+
`\uAD00\uB9AC\uD615 \uC2A4\uD0AC \uC800\uC7A5\uC18C\uAC00 ${status} \uC0C1\uD0DC\uC785\uB2C8\uB2E4: ${storePath}`,
|
|
705
|
+
EXIT_PARAM_ERROR
|
|
706
|
+
);
|
|
707
|
+
}
|
|
708
|
+
}
|
|
709
|
+
const stagingPath = await createStagedStore(context, sourceDigest);
|
|
710
|
+
let quarantinePath = null;
|
|
711
|
+
try {
|
|
712
|
+
if (existing != null) {
|
|
713
|
+
quarantinePath = import_node_path5.default.join(
|
|
714
|
+
storeRoot,
|
|
715
|
+
`.backup-${utcTimestamp()}-${import_node_path5.default.basename(storePath)}`
|
|
716
|
+
);
|
|
717
|
+
await fs2.rename(storePath, quarantinePath);
|
|
718
|
+
}
|
|
719
|
+
await fs2.rename(stagingPath, storePath);
|
|
720
|
+
return storePath;
|
|
721
|
+
} catch (error) {
|
|
722
|
+
await fs2.rm(stagingPath, { recursive: true, force: true }).catch(() => {
|
|
723
|
+
});
|
|
724
|
+
if (quarantinePath != null) {
|
|
725
|
+
await fs2.rename(quarantinePath, storePath).catch(() => {
|
|
726
|
+
});
|
|
727
|
+
}
|
|
728
|
+
throw error;
|
|
729
|
+
}
|
|
730
|
+
}
|
|
731
|
+
async function assertSourceAvailable(source) {
|
|
732
|
+
const skillFile = import_node_path5.default.join(source, "SKILL.md");
|
|
733
|
+
try {
|
|
734
|
+
const [sourceStat, skillFileStat] = await Promise.all([
|
|
735
|
+
fs2.stat(source),
|
|
736
|
+
fs2.stat(skillFile)
|
|
737
|
+
]);
|
|
738
|
+
if (!sourceStat.isDirectory() || !skillFileStat.isFile()) {
|
|
739
|
+
throw new Error("invalid source shape");
|
|
740
|
+
}
|
|
741
|
+
} catch (error) {
|
|
742
|
+
const cause = error instanceof Error ? ` (${error.message})` : "";
|
|
743
|
+
throw new DoorayCliError(
|
|
744
|
+
`\uD328\uD0A4\uC9C0 \uC2A4\uD0AC \uD30C\uC77C\uC744 \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4: ${skillFile}${cause}`,
|
|
745
|
+
1
|
|
746
|
+
);
|
|
747
|
+
}
|
|
748
|
+
}
|
|
749
|
+
async function renameWithRollback(from, to, backupPath) {
|
|
750
|
+
try {
|
|
751
|
+
await fs2.rename(from, to);
|
|
752
|
+
} catch (error) {
|
|
753
|
+
if (backupPath != null) {
|
|
754
|
+
await fs2.rename(backupPath, to).catch(() => {
|
|
755
|
+
});
|
|
756
|
+
}
|
|
757
|
+
throw error;
|
|
758
|
+
}
|
|
759
|
+
}
|
|
760
|
+
async function inspectSkill(context) {
|
|
761
|
+
const destination = getDestination(context);
|
|
762
|
+
const source = getSource(context);
|
|
763
|
+
let stat3;
|
|
764
|
+
try {
|
|
765
|
+
stat3 = await fs2.lstat(destination);
|
|
766
|
+
} catch (error) {
|
|
767
|
+
if (isNodeError(error, "ENOENT")) {
|
|
768
|
+
return statusOf(context, "missing", { managed: true });
|
|
769
|
+
}
|
|
770
|
+
throw error;
|
|
771
|
+
}
|
|
772
|
+
if (!stat3.isSymbolicLink()) {
|
|
773
|
+
return statusOf(context, "unmanaged");
|
|
774
|
+
}
|
|
775
|
+
const linkTarget = await fs2.readlink(destination);
|
|
776
|
+
const absoluteTarget = resolveLinkTarget(destination, linkTarget);
|
|
777
|
+
try {
|
|
778
|
+
await fs2.stat(absoluteTarget);
|
|
779
|
+
} catch (error) {
|
|
780
|
+
if (!isNodeError(error, "ENOENT")) {
|
|
781
|
+
throw error;
|
|
782
|
+
}
|
|
783
|
+
return statusOf(context, "broken", {
|
|
784
|
+
linkTarget,
|
|
785
|
+
managed: isManagedSkillPath(absoluteTarget) || isInsideStoreRoot(context, absoluteTarget)
|
|
786
|
+
});
|
|
787
|
+
}
|
|
788
|
+
const sourceDigest = await computeSkillContentDigest(source).catch(() => null);
|
|
789
|
+
if (isInsideStoreRoot(context, absoluteTarget)) {
|
|
790
|
+
const manifest = await readDooraySkillManifest(
|
|
791
|
+
import_node_path5.default.join(absoluteTarget, MANIFEST_FILE_NAME)
|
|
792
|
+
);
|
|
793
|
+
if (manifest == null) {
|
|
794
|
+
return statusOf(context, "corrupt", { linkTarget, managed: true });
|
|
795
|
+
}
|
|
796
|
+
const basename9 = parseStoreBasename(import_node_path5.default.basename(absoluteTarget));
|
|
797
|
+
if (basename9 == null || basename9.packageVersion !== manifest.packageVersion || basename9.contentDigest !== manifest.contentDigest) {
|
|
798
|
+
return statusOf(context, "corrupt", {
|
|
799
|
+
installedVersion: manifest.packageVersion,
|
|
800
|
+
linkTarget,
|
|
801
|
+
managed: true
|
|
802
|
+
});
|
|
803
|
+
}
|
|
804
|
+
const actualDigest = await computeSkillContentDigest(absoluteTarget).catch(
|
|
805
|
+
() => null
|
|
806
|
+
);
|
|
807
|
+
if (actualDigest !== manifest.contentDigest) {
|
|
808
|
+
return statusOf(context, "modified", {
|
|
809
|
+
installedVersion: manifest.packageVersion,
|
|
810
|
+
linkTarget,
|
|
811
|
+
managed: true
|
|
812
|
+
});
|
|
813
|
+
}
|
|
814
|
+
if (manifest.packageVersion === context.currentVersion && sourceDigest === manifest.contentDigest) {
|
|
815
|
+
return statusOf(context, "current", {
|
|
816
|
+
installedVersion: manifest.packageVersion,
|
|
817
|
+
linkTarget,
|
|
818
|
+
managed: true
|
|
819
|
+
});
|
|
820
|
+
}
|
|
821
|
+
return statusOf(context, "outdated", {
|
|
822
|
+
installedVersion: manifest.packageVersion,
|
|
823
|
+
linkTarget,
|
|
824
|
+
managed: true
|
|
825
|
+
});
|
|
826
|
+
}
|
|
827
|
+
if (await isSameEntry(absoluteTarget, source)) {
|
|
828
|
+
return statusOf(context, "outdated", {
|
|
829
|
+
installedVersion: context.currentVersion,
|
|
830
|
+
linkTarget,
|
|
831
|
+
managed: true
|
|
832
|
+
});
|
|
833
|
+
}
|
|
834
|
+
const packageMetadata = await readPackageMetadata(absoluteTarget);
|
|
835
|
+
if (packageMetadata == null) {
|
|
836
|
+
return statusOf(context, "unmanaged", { linkTarget });
|
|
837
|
+
}
|
|
838
|
+
if (packageMetadata.name !== PACKAGE_NAME) {
|
|
839
|
+
return statusOf(context, "unmanaged", {
|
|
840
|
+
installedVersion: packageMetadata.version,
|
|
841
|
+
linkTarget
|
|
842
|
+
});
|
|
843
|
+
}
|
|
844
|
+
return statusOf(context, "outdated", {
|
|
845
|
+
installedVersion: packageMetadata.version,
|
|
846
|
+
linkTarget,
|
|
847
|
+
managed: true
|
|
848
|
+
});
|
|
849
|
+
}
|
|
850
|
+
async function installSkill(context, options = {}) {
|
|
851
|
+
await assertSourceAvailable(getSource(context));
|
|
852
|
+
const previous = await inspectSkill(context);
|
|
853
|
+
if (previous.status === "current") {
|
|
854
|
+
return {
|
|
855
|
+
previous,
|
|
856
|
+
current: previous,
|
|
857
|
+
changed: false,
|
|
858
|
+
backupPath: null
|
|
859
|
+
};
|
|
860
|
+
}
|
|
861
|
+
if ((previous.status === "modified" || previous.status === "corrupt") && options.force !== true) {
|
|
862
|
+
throw new DoorayCliError(
|
|
863
|
+
`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}`,
|
|
864
|
+
EXIT_PARAM_ERROR
|
|
865
|
+
);
|
|
866
|
+
}
|
|
867
|
+
if (!previous.managed && options.force !== true) {
|
|
868
|
+
throw new DoorayCliError(
|
|
869
|
+
`Claude Code \uC2A4\uD0AC \uACBD\uB85C\uAC00 dooray-cli\uC5D0\uC11C \uAD00\uB9AC\uD55C \uD56D\uBAA9\uC774 \uC544\uB2D9\uB2C8\uB2E4: ${previous.destination}`,
|
|
870
|
+
EXIT_PARAM_ERROR
|
|
871
|
+
);
|
|
872
|
+
}
|
|
873
|
+
const storePath = await prepareStore(context, options);
|
|
874
|
+
await fs2.mkdir(import_node_path5.default.dirname(previous.destination), { recursive: true });
|
|
875
|
+
const tempPath = `${previous.destination}.tmp-${process.pid}-${Date.now()}`;
|
|
876
|
+
let backupPath = null;
|
|
877
|
+
try {
|
|
878
|
+
await fs2.symlink(storePath, tempPath);
|
|
879
|
+
if (!previous.managed && options.force === true) {
|
|
880
|
+
backupPath = `${previous.destination}.backup-${utcTimestamp()}`;
|
|
881
|
+
await fs2.rename(previous.destination, backupPath);
|
|
882
|
+
}
|
|
883
|
+
await renameWithRollback(tempPath, previous.destination, backupPath);
|
|
884
|
+
const current2 = await inspectSkill(context);
|
|
885
|
+
if (current2.status !== "current") {
|
|
886
|
+
let recovery = "\uBC31\uC5C5 \uC5C6\uC74C, \uC0C8 \uB9C1\uD06C \uC0C1\uD0DC\uB97C \uC720\uC9C0\uD588\uC2B5\uB2C8\uB2E4";
|
|
887
|
+
if (backupPath != null) {
|
|
888
|
+
try {
|
|
889
|
+
await fs2.rename(backupPath, previous.destination);
|
|
890
|
+
recovery = `\uBC31\uC5C5 \uBCF5\uAD6C \uC644\uB8CC: ${backupPath}`;
|
|
891
|
+
} catch {
|
|
892
|
+
recovery = `\uBC31\uC5C5 \uBCF5\uAD6C \uC2E4\uD328, \uC0C8 \uB9C1\uD06C \uC720\uC9C0 \uC0C1\uD0DC\uC77C \uC218 \uC788\uC74C: ${previous.destination}`;
|
|
893
|
+
}
|
|
894
|
+
}
|
|
895
|
+
throw new DoorayCliError(
|
|
896
|
+
`Claude Code \uC2A4\uD0AC \uC124\uCE58 \uD6C4 \uC0C1\uD0DC\uAC00 current\uAC00 \uC544\uB2D9\uB2C8\uB2E4: ${current2.status} (${recovery})`,
|
|
897
|
+
1
|
|
898
|
+
);
|
|
899
|
+
}
|
|
900
|
+
return {
|
|
901
|
+
previous,
|
|
902
|
+
current: current2,
|
|
903
|
+
changed: true,
|
|
904
|
+
backupPath
|
|
905
|
+
};
|
|
906
|
+
} catch (error) {
|
|
907
|
+
await fs2.rm(tempPath, { force: true }).catch(() => {
|
|
908
|
+
});
|
|
909
|
+
throw error;
|
|
910
|
+
}
|
|
911
|
+
}
|
|
912
|
+
|
|
370
913
|
// src/api/client.ts
|
|
371
914
|
var import_ky = __toESM(require("ky"));
|
|
372
915
|
var import_promises3 = require("fs/promises");
|
|
373
|
-
var
|
|
916
|
+
var import_node_path6 = require("path");
|
|
374
917
|
|
|
375
918
|
// src/utils/dooray-message.ts
|
|
376
919
|
function normalizeDoorayMessage(raw) {
|
|
@@ -788,7 +1331,7 @@ var DoorayApiClient = class {
|
|
|
788
1331
|
}
|
|
789
1332
|
async uploadPostFile(projectId, postId, filePath) {
|
|
790
1333
|
try {
|
|
791
|
-
const fileName = (0,
|
|
1334
|
+
const fileName = (0, import_node_path6.basename)(filePath);
|
|
792
1335
|
const fileBuffer = await (0, import_promises3.readFile)(filePath);
|
|
793
1336
|
const formData = new FormData();
|
|
794
1337
|
formData.append("file", new Blob([fileBuffer]), fileName);
|
|
@@ -833,7 +1376,7 @@ var DoorayApiClient = class {
|
|
|
833
1376
|
// ─── Wiki Page Files (ADR-029) ──────────────────────
|
|
834
1377
|
async uploadWikiPageFile(wikiId, pageId, filePath, type) {
|
|
835
1378
|
try {
|
|
836
|
-
const fileName = (0,
|
|
1379
|
+
const fileName = (0, import_node_path6.basename)(filePath);
|
|
837
1380
|
const fileBuffer = await (0, import_promises3.readFile)(filePath);
|
|
838
1381
|
const buildFormData = () => {
|
|
839
1382
|
const fd = new FormData();
|
|
@@ -898,7 +1441,7 @@ var DoorayApiClient = class {
|
|
|
898
1441
|
let fileName = `file-${fileId}`;
|
|
899
1442
|
if (disposition) {
|
|
900
1443
|
const match = disposition.match(/filename\*?=(?:UTF-8''|"?)([^";]+)/i);
|
|
901
|
-
if (match) fileName = (0,
|
|
1444
|
+
if (match) fileName = (0, import_node_path6.basename)(decodeURIComponent(match[1].replace(/"/g, "")));
|
|
902
1445
|
}
|
|
903
1446
|
const buffer = await fileRes.arrayBuffer();
|
|
904
1447
|
return { buffer, fileName };
|
|
@@ -1041,6 +1584,28 @@ async function ensureMe(client) {
|
|
|
1041
1584
|
}
|
|
1042
1585
|
|
|
1043
1586
|
// src/commands/doctor.ts
|
|
1587
|
+
function formatSkillStatus(status) {
|
|
1588
|
+
switch (status.status) {
|
|
1589
|
+
case "current":
|
|
1590
|
+
return import_chalk3.default.green(`\u2705 \uCD5C\uC2E0 (${status.currentVersion})`);
|
|
1591
|
+
case "missing":
|
|
1592
|
+
return import_chalk3.default.red("\u274C \uBBF8\uC124\uCE58 \u2014 dooray skill install");
|
|
1593
|
+
case "outdated":
|
|
1594
|
+
return import_chalk3.default.yellow(
|
|
1595
|
+
`\u26A0\uFE0F \uC624\uB798\uB428 (${status.installedVersion ?? "unknown"} \u2192 ${status.currentVersion}) \u2014 dooray skill update`
|
|
1596
|
+
);
|
|
1597
|
+
case "broken":
|
|
1598
|
+
return import_chalk3.default.yellow("\u26A0\uFE0F \uB9C1\uD06C \uAE68\uC9D0 \u2014 dooray skill update");
|
|
1599
|
+
case "corrupt":
|
|
1600
|
+
return import_chalk3.default.yellow("\u26A0\uFE0F \uAD00\uB9AC \uC800\uC7A5\uC18C \uC815\uBCF4 \uC190\uC0C1 \u2014 dooray skill update --force");
|
|
1601
|
+
case "unmanaged":
|
|
1602
|
+
return import_chalk3.default.yellow(
|
|
1603
|
+
"\u26A0\uFE0F \uAD00\uB9AC\uB418\uC9C0 \uC54A\uB294 \uD56D\uBAA9 \u2014 dooray skill update --force"
|
|
1604
|
+
);
|
|
1605
|
+
case "modified":
|
|
1606
|
+
return import_chalk3.default.yellow("\u26A0\uFE0F \uC218\uC815\uB428 \u2014 dooray skill update --force");
|
|
1607
|
+
}
|
|
1608
|
+
}
|
|
1044
1609
|
var doctorCommand = new import_commander3.Command("doctor").description("\uC124\uC815 \uBC0F \uD658\uACBD \uC9C4\uB2E8").action(async () => {
|
|
1045
1610
|
console.log(import_chalk3.default.bold("\n\u{1F50D} Dooray CLI \uC9C4\uB2E8\n"));
|
|
1046
1611
|
const config = await getConfig();
|
|
@@ -1076,27 +1641,10 @@ var doctorCommand = new import_commander3.Command("doctor").description("\uC124\
|
|
|
1076
1641
|
const claudeDirExists = await import_promises4.default.access(claudeDir).then(() => true).catch(() => false);
|
|
1077
1642
|
if (claudeDirExists) {
|
|
1078
1643
|
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
|
-
}
|
|
1644
|
+
const skillStatus = await inspectSkill(createSkillManagerContext());
|
|
1645
|
+
console.log(` dooray-cli: ${formatSkillStatus(skillStatus)}`);
|
|
1646
|
+
console.log(` \uC124\uCE58 \uACBD\uB85C: ${skillStatus.destination}`);
|
|
1647
|
+
console.log(` \uB9C1\uD06C \uB300\uC0C1: ${skillStatus.linkTarget ?? "-"}`);
|
|
1100
1648
|
}
|
|
1101
1649
|
console.log();
|
|
1102
1650
|
if (apiKeyOk && baseUrlOk) {
|
|
@@ -1199,25 +1747,21 @@ var setupCommand = new import_commander4.Command("setup").description("\uB300\uD
|
|
|
1199
1747
|
)
|
|
1200
1748
|
);
|
|
1201
1749
|
} else {
|
|
1202
|
-
const
|
|
1750
|
+
const installSkill2 = await confirm2({
|
|
1203
1751
|
message: "Claude Code \uC2A4\uD0AC\uC744 \uC124\uCE58\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C?",
|
|
1204
1752
|
default: true,
|
|
1205
1753
|
theme: { prefix: "\u{1F527}" }
|
|
1206
1754
|
});
|
|
1207
|
-
if (
|
|
1755
|
+
if (installSkill2) {
|
|
1208
1756
|
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);
|
|
1757
|
+
await installSkill(createSkillManagerContext());
|
|
1216
1758
|
console.log(import_chalk4.default.green(" \u2713 Claude Code \uC2A4\uD0AC \uC124\uCE58 \uC644\uB8CC"));
|
|
1217
1759
|
} catch (err) {
|
|
1760
|
+
const reason = err instanceof Error ? err.message : String(err);
|
|
1218
1761
|
console.log(
|
|
1219
1762
|
import_chalk4.default.yellow(
|
|
1220
|
-
` \u26A0 \uC2A4\uD0AC \uC124\uCE58 \uC2E4\uD328: ${
|
|
1763
|
+
` \u26A0 \uC2A4\uD0AC \uC124\uCE58 \uC2E4\uD328: ${reason}
|
|
1764
|
+
\uD544\uC694\uD558\uBA74 \uB0B4\uC6A9\uC744 \uD655\uC778\uD55C \uB4A4 dooray skill update --force\uB97C \uC2E4\uD589\uD558\uC138\uC694.`
|
|
1221
1765
|
)
|
|
1222
1766
|
);
|
|
1223
1767
|
}
|
|
@@ -1257,8 +1801,85 @@ var setupCommand = new import_commander4.Command("setup").description("\uB300\uD
|
|
|
1257
1801
|
}
|
|
1258
1802
|
});
|
|
1259
1803
|
|
|
1260
|
-
// src/commands/
|
|
1804
|
+
// src/commands/skill.ts
|
|
1261
1805
|
var import_commander5 = require("commander");
|
|
1806
|
+
var import_chalk5 = __toESM(require("chalk"));
|
|
1807
|
+
function statusHint(status) {
|
|
1808
|
+
switch (status.status) {
|
|
1809
|
+
case "current":
|
|
1810
|
+
return "\uC870\uCE58 \uC5C6\uC74C";
|
|
1811
|
+
case "missing":
|
|
1812
|
+
return "dooray skill install";
|
|
1813
|
+
case "outdated":
|
|
1814
|
+
case "broken":
|
|
1815
|
+
return "dooray skill update";
|
|
1816
|
+
case "modified":
|
|
1817
|
+
case "corrupt":
|
|
1818
|
+
case "unmanaged":
|
|
1819
|
+
return "\uB0B4\uC6A9 \uD655\uC778 \uD6C4 dooray skill update --force";
|
|
1820
|
+
}
|
|
1821
|
+
}
|
|
1822
|
+
function printStatus(status, options) {
|
|
1823
|
+
if (options.json) {
|
|
1824
|
+
console.log(JSON.stringify(status, null, 2));
|
|
1825
|
+
return;
|
|
1826
|
+
}
|
|
1827
|
+
if (options.quiet) {
|
|
1828
|
+
console.log(status.status);
|
|
1829
|
+
return;
|
|
1830
|
+
}
|
|
1831
|
+
console.log(`\uC0C1\uD0DC: ${status.status}`);
|
|
1832
|
+
console.log(`\uD604\uC7AC \uBC84\uC804: ${status.currentVersion}`);
|
|
1833
|
+
console.log(`\uC124\uCE58 \uBC84\uC804: ${status.installedVersion ?? "-"}`);
|
|
1834
|
+
console.log(`\uB9C1\uD06C \uB300\uC0C1: ${status.linkTarget ?? "-"}`);
|
|
1835
|
+
console.log(`\uC124\uCE58 \uACBD\uB85C: ${status.destination}`);
|
|
1836
|
+
console.log(`\uBCF5\uAD6C \uBC29\uBC95: ${statusHint(status)}`);
|
|
1837
|
+
}
|
|
1838
|
+
function printInstallResult(result, options) {
|
|
1839
|
+
if (options.json) {
|
|
1840
|
+
console.log(JSON.stringify(result, null, 2));
|
|
1841
|
+
return;
|
|
1842
|
+
}
|
|
1843
|
+
if (options.quiet) {
|
|
1844
|
+
console.log(result.current.status);
|
|
1845
|
+
return;
|
|
1846
|
+
}
|
|
1847
|
+
if (result.changed) {
|
|
1848
|
+
console.log(import_chalk5.default.green("\u2713 Claude Code \uC2A4\uD0AC \uC124\uCE58 \uC644\uB8CC"));
|
|
1849
|
+
} else {
|
|
1850
|
+
console.log(import_chalk5.default.green("\u2713 Claude Code \uC2A4\uD0AC\uC774 \uC774\uBBF8 \uCD5C\uC2E0\uC785\uB2C8\uB2E4"));
|
|
1851
|
+
}
|
|
1852
|
+
console.log(`\uC0C1\uD0DC: ${result.current.status}`);
|
|
1853
|
+
console.log(`\uD604\uC7AC \uBC84\uC804: ${result.current.currentVersion}`);
|
|
1854
|
+
console.log(`\uC124\uCE58 \uBC84\uC804: ${result.current.installedVersion ?? "-"}`);
|
|
1855
|
+
console.log(`\uB9C1\uD06C \uB300\uC0C1: ${result.current.linkTarget ?? "-"}`);
|
|
1856
|
+
console.log(`\uBCF5\uAD6C \uBC29\uBC95: ${statusHint(result.current)}`);
|
|
1857
|
+
if (result.backupPath != null) {
|
|
1858
|
+
console.log(`\uBC31\uC5C5 \uACBD\uB85C: ${result.backupPath}`);
|
|
1859
|
+
}
|
|
1860
|
+
}
|
|
1861
|
+
var skillCommand = new import_commander5.Command("skill").description(
|
|
1862
|
+
"Claude Code \uC2A4\uD0AC \uAD00\uB9AC"
|
|
1863
|
+
);
|
|
1864
|
+
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 () => {
|
|
1865
|
+
const options = skillStatusCommand.optsWithGlobals();
|
|
1866
|
+
const status = await inspectSkill(createSkillManagerContext());
|
|
1867
|
+
printStatus(status, options);
|
|
1868
|
+
});
|
|
1869
|
+
function addInstallCommand(name, description) {
|
|
1870
|
+
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 () => {
|
|
1871
|
+
const options = command.optsWithGlobals();
|
|
1872
|
+
const result = await installSkill(createSkillManagerContext(), {
|
|
1873
|
+
force: options.force
|
|
1874
|
+
});
|
|
1875
|
+
printInstallResult(result, options);
|
|
1876
|
+
});
|
|
1877
|
+
}
|
|
1878
|
+
addInstallCommand("install", "Claude Code \uC2A4\uD0AC \uC124\uCE58");
|
|
1879
|
+
addInstallCommand("update", "Claude Code \uC2A4\uD0AC\uC744 \uD604\uC7AC CLI \uBC84\uC804\uC73C\uB85C \uAC31\uC2E0");
|
|
1880
|
+
|
|
1881
|
+
// src/commands/project/list.ts
|
|
1882
|
+
var import_commander6 = require("commander");
|
|
1262
1883
|
|
|
1263
1884
|
// src/resolvers/project.ts
|
|
1264
1885
|
var PROJECT_ID_RE = /^\d{15,}$/;
|
|
@@ -1373,8 +1994,8 @@ function stopSpinner(success, text) {
|
|
|
1373
1994
|
}
|
|
1374
1995
|
|
|
1375
1996
|
// src/commands/project/list.ts
|
|
1376
|
-
var projectListCommand = new
|
|
1377
|
-
new
|
|
1997
|
+
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(
|
|
1998
|
+
new import_commander6.Option("-t, --type <type>", "\uD504\uB85C\uC81D\uD2B8 \uD0C0\uC785 \uD544\uD130").choices(["public", "private"]).default("public")
|
|
1378
1999
|
).action(async (opts) => {
|
|
1379
2000
|
const globalOpts = projectListCommand.optsWithGlobals();
|
|
1380
2001
|
const config = await getConfigOrThrow();
|
|
@@ -1397,7 +2018,7 @@ var projectListCommand = new import_commander5.Command("list").description("\uD5
|
|
|
1397
2018
|
});
|
|
1398
2019
|
|
|
1399
2020
|
// src/commands/project/members.ts
|
|
1400
|
-
var
|
|
2021
|
+
var import_commander7 = require("commander");
|
|
1401
2022
|
|
|
1402
2023
|
// src/resolvers/match.ts
|
|
1403
2024
|
function matchByName(items, input2, label, renderCandidate, options) {
|
|
@@ -1536,7 +2157,7 @@ async function resolveMember(client, projectId, input2) {
|
|
|
1536
2157
|
}
|
|
1537
2158
|
|
|
1538
2159
|
// src/commands/project/members.ts
|
|
1539
|
-
var projectMembersCommand = new
|
|
2160
|
+
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
2161
|
const globalOpts = projectMembersCommand.optsWithGlobals();
|
|
1541
2162
|
const config = await getConfigOrThrow();
|
|
1542
2163
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -1556,7 +2177,7 @@ var projectMembersCommand = new import_commander6.Command("members").description
|
|
|
1556
2177
|
});
|
|
1557
2178
|
|
|
1558
2179
|
// src/commands/project/workflows.ts
|
|
1559
|
-
var
|
|
2180
|
+
var import_commander8 = require("commander");
|
|
1560
2181
|
|
|
1561
2182
|
// src/resolvers/workflow.ts
|
|
1562
2183
|
async function ensureWorkflows(client, projectId) {
|
|
@@ -1589,7 +2210,7 @@ async function resolveWorkflow(client, projectId, input2) {
|
|
|
1589
2210
|
}
|
|
1590
2211
|
|
|
1591
2212
|
// src/commands/project/workflows.ts
|
|
1592
|
-
var projectWorkflowsCommand = new
|
|
2213
|
+
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
2214
|
const globalOpts = projectWorkflowsCommand.optsWithGlobals();
|
|
1594
2215
|
const config = await getConfigOrThrow();
|
|
1595
2216
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -1611,7 +2232,7 @@ var projectWorkflowsCommand = new import_commander7.Command("workflows").descrip
|
|
|
1611
2232
|
});
|
|
1612
2233
|
|
|
1613
2234
|
// src/commands/project/groups.ts
|
|
1614
|
-
var
|
|
2235
|
+
var import_commander9 = require("commander");
|
|
1615
2236
|
|
|
1616
2237
|
// src/resolvers/member-group.ts
|
|
1617
2238
|
var GROUP_ID_RE = /^\d{15,}$/;
|
|
@@ -1672,7 +2293,7 @@ async function resolveMemberGroup(client, projectId, input2) {
|
|
|
1672
2293
|
}
|
|
1673
2294
|
|
|
1674
2295
|
// src/commands/project/groups.ts
|
|
1675
|
-
var projectGroupsCommand = new
|
|
2296
|
+
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
2297
|
const globalOpts = projectGroupsCommand.optsWithGlobals();
|
|
1677
2298
|
const config = await getConfigOrThrow();
|
|
1678
2299
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -1689,7 +2310,7 @@ var projectGroupsCommand = new import_commander8.Command("groups").description("
|
|
|
1689
2310
|
});
|
|
1690
2311
|
|
|
1691
2312
|
// src/commands/project/tags.ts
|
|
1692
|
-
var
|
|
2313
|
+
var import_commander10 = require("commander");
|
|
1693
2314
|
|
|
1694
2315
|
// src/resolvers/tag.ts
|
|
1695
2316
|
async function fetchAllTags(client, projectId) {
|
|
@@ -1858,7 +2479,7 @@ async function validateMandatoryCoverage(client, projectId, selectedTagIds) {
|
|
|
1858
2479
|
}
|
|
1859
2480
|
|
|
1860
2481
|
// src/commands/project/tags.ts
|
|
1861
|
-
var projectTagsCommand = new
|
|
2482
|
+
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
2483
|
const globalOpts = projectTagsCommand.optsWithGlobals();
|
|
1863
2484
|
const config = await getConfigOrThrow();
|
|
1864
2485
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -1881,7 +2502,7 @@ var projectTagsCommand = new import_commander9.Command("tags").description("\uD5
|
|
|
1881
2502
|
});
|
|
1882
2503
|
|
|
1883
2504
|
// src/commands/project/templates.ts
|
|
1884
|
-
var
|
|
2505
|
+
var import_commander11 = require("commander");
|
|
1885
2506
|
|
|
1886
2507
|
// src/resolvers/template.ts
|
|
1887
2508
|
var TEMPLATE_ID_RE = /^\d{15,}$/;
|
|
@@ -1920,7 +2541,7 @@ async function resolveTemplate(client, projectId, input2) {
|
|
|
1920
2541
|
}
|
|
1921
2542
|
|
|
1922
2543
|
// src/commands/project/templates.ts
|
|
1923
|
-
var projectTemplatesCommand = new
|
|
2544
|
+
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
2545
|
const globalOpts = projectTemplatesCommand.optsWithGlobals();
|
|
1925
2546
|
const config = await getConfigOrThrow();
|
|
1926
2547
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -1942,7 +2563,7 @@ var projectTemplatesCommand = new import_commander10.Command("templates").descri
|
|
|
1942
2563
|
});
|
|
1943
2564
|
|
|
1944
2565
|
// src/commands/post/list.ts
|
|
1945
|
-
var
|
|
2566
|
+
var import_commander12 = require("commander");
|
|
1946
2567
|
|
|
1947
2568
|
// src/formatters/post.ts
|
|
1948
2569
|
function formatPostList(posts, opts) {
|
|
@@ -1993,7 +2614,7 @@ function formatCommentList(comments, opts) {
|
|
|
1993
2614
|
}
|
|
1994
2615
|
|
|
1995
2616
|
// src/commands/post/list.ts
|
|
1996
|
-
var postListCommand = new
|
|
2617
|
+
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
2618
|
const globalOpts = postListCommand.optsWithGlobals();
|
|
1998
2619
|
const config = await getConfigOrThrow();
|
|
1999
2620
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -2027,8 +2648,8 @@ var postListCommand = new import_commander11.Command("list").description("\uC5C5
|
|
|
2027
2648
|
});
|
|
2028
2649
|
|
|
2029
2650
|
// src/commands/post/search.ts
|
|
2030
|
-
var
|
|
2031
|
-
var postSearchCommand = new
|
|
2651
|
+
var import_commander13 = require("commander");
|
|
2652
|
+
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
2653
|
const globalOpts = postSearchCommand.optsWithGlobals();
|
|
2033
2654
|
const config = await getConfigOrThrow();
|
|
2034
2655
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -2040,7 +2661,7 @@ var postSearchCommand = new import_commander12.Command("search").description("\u
|
|
|
2040
2661
|
});
|
|
2041
2662
|
|
|
2042
2663
|
// src/commands/post/get.ts
|
|
2043
|
-
var
|
|
2664
|
+
var import_commander14 = require("commander");
|
|
2044
2665
|
|
|
2045
2666
|
// src/resolvers/post.ts
|
|
2046
2667
|
async function resolvePost(client, projectId, postNumber) {
|
|
@@ -2188,7 +2809,7 @@ ${URL_FORMAT_HINT}`,
|
|
|
2188
2809
|
}
|
|
2189
2810
|
|
|
2190
2811
|
// src/commands/post/get.ts
|
|
2191
|
-
var postGetCommand = new
|
|
2812
|
+
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
2813
|
const globalOpts = postGetCommand.optsWithGlobals();
|
|
2193
2814
|
const config = await getConfigOrThrow();
|
|
2194
2815
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -2205,7 +2826,7 @@ var postGetCommand = new import_commander13.Command("get").description("\uC5C5\u
|
|
|
2205
2826
|
});
|
|
2206
2827
|
|
|
2207
2828
|
// src/commands/post/edit.ts
|
|
2208
|
-
var
|
|
2829
|
+
var import_commander15 = require("commander");
|
|
2209
2830
|
|
|
2210
2831
|
// src/utils/mention.ts
|
|
2211
2832
|
function buildMemberMention(m, me) {
|
|
@@ -2589,7 +3210,7 @@ async function resolveUsers(client, projectId, names) {
|
|
|
2589
3210
|
}
|
|
2590
3211
|
return users;
|
|
2591
3212
|
}
|
|
2592
|
-
var postEditCommand = new
|
|
3213
|
+
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
3214
|
const config = await getConfigOrThrow();
|
|
2594
3215
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
2595
3216
|
const mentionInputs = (opts.mention ?? []).filter((s) => s.length > 0);
|
|
@@ -2771,7 +3392,7 @@ var postEditCommand = new import_commander14.Command("edit").description("\uC5C5
|
|
|
2771
3392
|
});
|
|
2772
3393
|
|
|
2773
3394
|
// src/commands/post/create.ts
|
|
2774
|
-
var
|
|
3395
|
+
var import_commander16 = require("commander");
|
|
2775
3396
|
|
|
2776
3397
|
// src/resolvers/milestone.ts
|
|
2777
3398
|
async function fetchAllMilestones(client, projectId) {
|
|
@@ -2817,7 +3438,7 @@ function postUserToCreate(u) {
|
|
|
2817
3438
|
group: u.group
|
|
2818
3439
|
};
|
|
2819
3440
|
}
|
|
2820
|
-
var postCreateCommand = new
|
|
3441
|
+
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
3442
|
const globalOpts = postCreateCommand.optsWithGlobals();
|
|
2822
3443
|
const config = await getConfigOrThrow();
|
|
2823
3444
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -2954,8 +3575,8 @@ var postCreateCommand = new import_commander15.Command("create").description("\u
|
|
|
2954
3575
|
});
|
|
2955
3576
|
|
|
2956
3577
|
// src/commands/post/done.ts
|
|
2957
|
-
var
|
|
2958
|
-
var postDoneCommand = new
|
|
3578
|
+
var import_commander17 = require("commander");
|
|
3579
|
+
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
3580
|
const config = await getConfigOrThrow();
|
|
2960
3581
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
2961
3582
|
startSpinner("\uC5C5\uBB34 \uC644\uB8CC \uCC98\uB9AC \uC911...");
|
|
@@ -2972,8 +3593,8 @@ var postDoneCommand = new import_commander16.Command("done").description("\uC5C5
|
|
|
2972
3593
|
});
|
|
2973
3594
|
|
|
2974
3595
|
// src/commands/post/workflow.ts
|
|
2975
|
-
var
|
|
2976
|
-
var postWorkflowCommand = new
|
|
3596
|
+
var import_commander18 = require("commander");
|
|
3597
|
+
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
3598
|
const config = await getConfigOrThrow();
|
|
2978
3599
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
2979
3600
|
let workflowInput = opts.workflow;
|
|
@@ -3013,7 +3634,7 @@ var postWorkflowCommand = new import_commander17.Command("workflow").description
|
|
|
3013
3634
|
});
|
|
3014
3635
|
|
|
3015
3636
|
// src/commands/post/comment/list.ts
|
|
3016
|
-
var
|
|
3637
|
+
var import_commander19 = require("commander");
|
|
3017
3638
|
|
|
3018
3639
|
// src/utils/comment-enrich.ts
|
|
3019
3640
|
function enrichCommentCreators(comments, nameMap) {
|
|
@@ -3090,7 +3711,7 @@ async function fetchSince(client, projectId, postId, sinceDate) {
|
|
|
3090
3711
|
}
|
|
3091
3712
|
return collected;
|
|
3092
3713
|
}
|
|
3093
|
-
var commentListCommand = new
|
|
3714
|
+
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
3715
|
const globalOpts = commentListCommand.optsWithGlobals();
|
|
3095
3716
|
const config = await getConfigOrThrow();
|
|
3096
3717
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -3152,8 +3773,8 @@ var commentListCommand = new import_commander18.Command("list").description("\uB
|
|
|
3152
3773
|
});
|
|
3153
3774
|
|
|
3154
3775
|
// src/commands/post/comment/latest.ts
|
|
3155
|
-
var
|
|
3156
|
-
var commentLatestCommand = new
|
|
3776
|
+
var import_commander20 = require("commander");
|
|
3777
|
+
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
3778
|
const globalOpts = commentLatestCommand.optsWithGlobals();
|
|
3158
3779
|
const config = await getConfigOrThrow();
|
|
3159
3780
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -3190,8 +3811,8 @@ var commentLatestCommand = new import_commander19.Command("latest").description(
|
|
|
3190
3811
|
});
|
|
3191
3812
|
|
|
3192
3813
|
// src/commands/post/comment/add.ts
|
|
3193
|
-
var
|
|
3194
|
-
var commentAddCommand = new
|
|
3814
|
+
var import_commander21 = require("commander");
|
|
3815
|
+
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
3816
|
"--mention <name>",
|
|
3196
3817
|
"\uBA64\uBC84 \uBA58\uC158 (\uBC18\uBCF5 \uAC00\uB2A5, \uC774\uB984 \uBD80\uBD84\uC77C\uCE58)",
|
|
3197
3818
|
(value, prev) => [...prev, value],
|
|
@@ -3270,8 +3891,8 @@ var commentAddCommand = new import_commander20.Command("add").description("\uB31
|
|
|
3270
3891
|
});
|
|
3271
3892
|
|
|
3272
3893
|
// src/commands/post/comment/edit.ts
|
|
3273
|
-
var
|
|
3274
|
-
var commentEditCommand = new
|
|
3894
|
+
var import_commander22 = require("commander");
|
|
3895
|
+
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
3896
|
"--mention <name>",
|
|
3276
3897
|
"\uBA64\uBC84 \uBA58\uC158 (\uBC18\uBCF5 \uAC00\uB2A5, \uC774\uB984 \uBD80\uBD84\uC77C\uCE58)",
|
|
3277
3898
|
(value, prev) => [...prev, value],
|
|
@@ -3399,8 +4020,8 @@ var commentEditCommand = new import_commander21.Command("edit").description("\uB
|
|
|
3399
4020
|
});
|
|
3400
4021
|
|
|
3401
4022
|
// src/commands/post/comment/delete.ts
|
|
3402
|
-
var
|
|
3403
|
-
var commentDeleteCommand = new
|
|
4023
|
+
var import_commander23 = require("commander");
|
|
4024
|
+
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
4025
|
const config = await getConfigOrThrow();
|
|
3405
4026
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
3406
4027
|
let projectArg;
|
|
@@ -3456,7 +4077,7 @@ var commentDeleteCommand = new import_commander22.Command("delete").description(
|
|
|
3456
4077
|
});
|
|
3457
4078
|
|
|
3458
4079
|
// src/commands/post/comment/get.ts
|
|
3459
|
-
var
|
|
4080
|
+
var import_commander24 = require("commander");
|
|
3460
4081
|
|
|
3461
4082
|
// src/formatters/comment.ts
|
|
3462
4083
|
function formatCommentDetail(comment, opts) {
|
|
@@ -3530,7 +4151,7 @@ function parseGetArgs(arg1, arg2, arg3, opts) {
|
|
|
3530
4151
|
EXIT_PARAM_ERROR
|
|
3531
4152
|
);
|
|
3532
4153
|
}
|
|
3533
|
-
var commentGetCommand = new
|
|
4154
|
+
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
4155
|
const parsed = parseGetArgs(arg1, arg2, arg3, opts);
|
|
3535
4156
|
const config = await getConfigOrThrow();
|
|
3536
4157
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -3565,10 +4186,10 @@ var commentGetCommand = new import_commander23.Command("get").description("\uB2E
|
|
|
3565
4186
|
});
|
|
3566
4187
|
|
|
3567
4188
|
// src/commands/post/comment/file/index.ts
|
|
3568
|
-
var
|
|
4189
|
+
var import_commander29 = require("commander");
|
|
3569
4190
|
|
|
3570
4191
|
// src/commands/post/comment/file/list.ts
|
|
3571
|
-
var
|
|
4192
|
+
var import_commander25 = require("commander");
|
|
3572
4193
|
|
|
3573
4194
|
// src/resolvers/comment-file-input.ts
|
|
3574
4195
|
var FILE_ID_SECONDARY_LABEL = {
|
|
@@ -3643,7 +4264,7 @@ function formatSize(bytes) {
|
|
|
3643
4264
|
if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)}KB`;
|
|
3644
4265
|
return `${(bytes / (1024 * 1024)).toFixed(1)}MB`;
|
|
3645
4266
|
}
|
|
3646
|
-
var listCommentFileCommand = new
|
|
4267
|
+
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
4268
|
const globalOpts = listCommentFileCommand.optsWithGlobals();
|
|
3648
4269
|
const config = await getConfigOrThrow();
|
|
3649
4270
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -3677,8 +4298,8 @@ var listCommentFileCommand = new import_commander24.Command("list").description(
|
|
|
3677
4298
|
});
|
|
3678
4299
|
|
|
3679
4300
|
// src/commands/post/comment/file/upload.ts
|
|
3680
|
-
var
|
|
3681
|
-
var
|
|
4301
|
+
var import_commander26 = require("commander");
|
|
4302
|
+
var import_node_path7 = require("path");
|
|
3682
4303
|
|
|
3683
4304
|
// src/utils/comment-files.ts
|
|
3684
4305
|
function appendFileReference(body, fileName, fileId) {
|
|
@@ -3698,7 +4319,7 @@ function removeFileReference(body, fileId) {
|
|
|
3698
4319
|
}
|
|
3699
4320
|
|
|
3700
4321
|
// src/commands/post/comment/file/upload.ts
|
|
3701
|
-
var uploadCommentFileCommand = new
|
|
4322
|
+
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
4323
|
const globalOpts = uploadCommentFileCommand.optsWithGlobals();
|
|
3703
4324
|
const config = await getConfigOrThrow();
|
|
3704
4325
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -3717,7 +4338,7 @@ var uploadCommentFileCommand = new import_commander25.Command("upload").descript
|
|
|
3717
4338
|
startSpinner("\uD30C\uC77C \uC5C5\uB85C\uB4DC \uC911...");
|
|
3718
4339
|
const uploadRes = await client.uploadPostFile(projectId, postId, filePath);
|
|
3719
4340
|
const fileId = uploadRes.result.id;
|
|
3720
|
-
const fileName = (0,
|
|
4341
|
+
const fileName = (0, import_node_path7.basename)(filePath);
|
|
3721
4342
|
stopSpinner(true, "\uC5C5\uB85C\uB4DC \uC644\uB8CC");
|
|
3722
4343
|
startSpinner("\uB313\uAE00 reference \uCD94\uAC00 \uC911...");
|
|
3723
4344
|
try {
|
|
@@ -3747,10 +4368,10 @@ var uploadCommentFileCommand = new import_commander25.Command("upload").descript
|
|
|
3747
4368
|
});
|
|
3748
4369
|
|
|
3749
4370
|
// src/commands/post/comment/file/download.ts
|
|
3750
|
-
var
|
|
4371
|
+
var import_commander27 = require("commander");
|
|
3751
4372
|
var import_promises8 = require("fs/promises");
|
|
3752
|
-
var
|
|
3753
|
-
var downloadCommentFileCommand = new
|
|
4373
|
+
var import_node_path8 = require("path");
|
|
4374
|
+
var downloadCommentFileCommand = new import_commander27.Command("download").description(
|
|
3754
4375
|
"\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
4376
|
).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
4377
|
const config = await getConfigOrThrow();
|
|
@@ -3769,8 +4390,8 @@ var downloadCommentFileCommand = new import_commander26.Command("download").desc
|
|
|
3769
4390
|
});
|
|
3770
4391
|
startSpinner("\uD30C\uC77C \uB2E4\uC6B4\uB85C\uB4DC \uC911...");
|
|
3771
4392
|
const { buffer, fileName } = await client.downloadPostFile(projectId, postId, fileId);
|
|
3772
|
-
const safeName = (0,
|
|
3773
|
-
const outputPath = (0,
|
|
4393
|
+
const safeName = (0, import_node_path8.basename)(fileName);
|
|
4394
|
+
const outputPath = (0, import_node_path8.join)(opts.out, safeName);
|
|
3774
4395
|
await (0, import_promises8.writeFile)(outputPath, Buffer.from(buffer));
|
|
3775
4396
|
stopSpinner(true, "\uB2E4\uC6B4\uB85C\uB4DC \uC644\uB8CC");
|
|
3776
4397
|
process.stdout.write(`${outputPath}
|
|
@@ -3778,8 +4399,8 @@ var downloadCommentFileCommand = new import_commander26.Command("download").desc
|
|
|
3778
4399
|
});
|
|
3779
4400
|
|
|
3780
4401
|
// src/commands/post/comment/file/delete.ts
|
|
3781
|
-
var
|
|
3782
|
-
var deleteCommentFileCommand = new
|
|
4402
|
+
var import_commander28 = require("commander");
|
|
4403
|
+
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
4404
|
const config = await getConfigOrThrow();
|
|
3784
4405
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
3785
4406
|
const { projectId, postId, commentId, secondary: fileId } = await resolveCommentFileInput(client, {
|
|
@@ -3836,16 +4457,16 @@ var deleteCommentFileCommand = new import_commander27.Command("delete").descript
|
|
|
3836
4457
|
});
|
|
3837
4458
|
|
|
3838
4459
|
// src/commands/post/comment/file/index.ts
|
|
3839
|
-
var commentFileCommand = new
|
|
4460
|
+
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
4461
|
|
|
3841
4462
|
// src/commands/post/file/list.ts
|
|
3842
|
-
var
|
|
4463
|
+
var import_commander30 = require("commander");
|
|
3843
4464
|
function formatSize2(bytes) {
|
|
3844
4465
|
if (bytes < 1024) return `${bytes}B`;
|
|
3845
4466
|
if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)}KB`;
|
|
3846
4467
|
return `${(bytes / (1024 * 1024)).toFixed(1)}MB`;
|
|
3847
4468
|
}
|
|
3848
|
-
var fileListCommand = new
|
|
4469
|
+
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
4470
|
const globalOpts = fileListCommand.optsWithGlobals();
|
|
3850
4471
|
const config = await getConfigOrThrow();
|
|
3851
4472
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -3873,9 +4494,9 @@ var fileListCommand = new import_commander29.Command("list").description("\uC5C5
|
|
|
3873
4494
|
});
|
|
3874
4495
|
|
|
3875
4496
|
// src/commands/post/file/download.ts
|
|
3876
|
-
var
|
|
4497
|
+
var import_commander31 = require("commander");
|
|
3877
4498
|
var import_promises9 = require("fs/promises");
|
|
3878
|
-
var
|
|
4499
|
+
var import_node_path9 = require("path");
|
|
3879
4500
|
|
|
3880
4501
|
// src/formatters/file-output.ts
|
|
3881
4502
|
function emitDownloadResult(globalOpts, result) {
|
|
@@ -3919,7 +4540,7 @@ function emitDeleteResult(globalOpts, result) {
|
|
|
3919
4540
|
}
|
|
3920
4541
|
|
|
3921
4542
|
// src/commands/post/file/download.ts
|
|
3922
|
-
var fileDownloadCommand = new
|
|
4543
|
+
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
4544
|
const globalOpts = fileDownloadCommand.optsWithGlobals();
|
|
3924
4545
|
const config = await getConfigOrThrow();
|
|
3925
4546
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -3967,18 +4588,18 @@ var fileDownloadCommand = new import_commander30.Command("download").description
|
|
|
3967
4588
|
urlOpt: opts.url
|
|
3968
4589
|
});
|
|
3969
4590
|
const { buffer, fileName } = await client.downloadPostFile(projectId, postId, fileId);
|
|
3970
|
-
const safeName = (0,
|
|
3971
|
-
const outputPath = (0,
|
|
4591
|
+
const safeName = (0, import_node_path9.basename)(decodeURIComponent(fileName));
|
|
4592
|
+
const outputPath = (0, import_node_path9.join)(opts.output, safeName);
|
|
3972
4593
|
await (0, import_promises9.writeFile)(outputPath, Buffer.from(buffer));
|
|
3973
4594
|
stopSpinner(true, "\uB2E4\uC6B4\uB85C\uB4DC \uC644\uB8CC");
|
|
3974
4595
|
emitDownloadResult(globalOpts, { outputPath, fileName: safeName, size: buffer.byteLength });
|
|
3975
4596
|
});
|
|
3976
4597
|
|
|
3977
4598
|
// src/commands/post/file/download-all.ts
|
|
3978
|
-
var
|
|
4599
|
+
var import_commander32 = require("commander");
|
|
3979
4600
|
var import_promises10 = require("fs/promises");
|
|
3980
|
-
var
|
|
3981
|
-
var fileDownloadAllCommand = new
|
|
4601
|
+
var import_node_path10 = require("path");
|
|
4602
|
+
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
4603
|
const globalOpts = fileDownloadAllCommand.optsWithGlobals();
|
|
3983
4604
|
const config = await getConfigOrThrow();
|
|
3984
4605
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -4006,8 +4627,8 @@ var fileDownloadAllCommand = new import_commander31.Command("download-all").desc
|
|
|
4006
4627
|
for (const file of res.result) {
|
|
4007
4628
|
try {
|
|
4008
4629
|
const { buffer, fileName } = await client.downloadPostFile(projectId, postId, file.id);
|
|
4009
|
-
const safeName = (0,
|
|
4010
|
-
const outputPath = (0,
|
|
4630
|
+
const safeName = (0, import_node_path10.basename)(decodeURIComponent(fileName));
|
|
4631
|
+
const outputPath = (0, import_node_path10.join)(opts.output, safeName);
|
|
4011
4632
|
await (0, import_promises10.writeFile)(outputPath, Buffer.from(buffer));
|
|
4012
4633
|
succeeded.push({ path: outputPath, fileName: safeName });
|
|
4013
4634
|
if (!globalOpts.json && !globalOpts.quiet) {
|
|
@@ -4027,9 +4648,9 @@ var fileDownloadAllCommand = new import_commander31.Command("download-all").desc
|
|
|
4027
4648
|
});
|
|
4028
4649
|
|
|
4029
4650
|
// src/commands/post/file/upload.ts
|
|
4030
|
-
var
|
|
4031
|
-
var
|
|
4032
|
-
var fileUploadCommand = new
|
|
4651
|
+
var import_commander33 = require("commander");
|
|
4652
|
+
var import_node_path11 = require("path");
|
|
4653
|
+
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
4654
|
const globalOpts = fileUploadCommand.optsWithGlobals();
|
|
4034
4655
|
const config = await getConfigOrThrow();
|
|
4035
4656
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -4084,14 +4705,14 @@ var fileUploadCommand = new import_commander32.Command("upload").description("\u
|
|
|
4084
4705
|
process.stdout.write(`${res.result.id}
|
|
4085
4706
|
`);
|
|
4086
4707
|
} else {
|
|
4087
|
-
process.stdout.write(`\uD30C\uC77C \uC5C5\uB85C\uB4DC \uC644\uB8CC: ${(0,
|
|
4708
|
+
process.stdout.write(`\uD30C\uC77C \uC5C5\uB85C\uB4DC \uC644\uB8CC: ${(0, import_node_path11.basename)(filePath)} (ID: ${res.result.id})
|
|
4088
4709
|
`);
|
|
4089
4710
|
}
|
|
4090
4711
|
});
|
|
4091
4712
|
|
|
4092
4713
|
// src/commands/post/file/delete.ts
|
|
4093
|
-
var
|
|
4094
|
-
var fileDeleteCommand = new
|
|
4714
|
+
var import_commander34 = require("commander");
|
|
4715
|
+
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
4716
|
const globalOpts = fileDeleteCommand.optsWithGlobals();
|
|
4096
4717
|
const config = await getConfigOrThrow();
|
|
4097
4718
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -4144,7 +4765,7 @@ var fileDeleteCommand = new import_commander33.Command("delete").description("\u
|
|
|
4144
4765
|
});
|
|
4145
4766
|
|
|
4146
4767
|
// src/commands/wiki/list.ts
|
|
4147
|
-
var
|
|
4768
|
+
var import_commander35 = require("commander");
|
|
4148
4769
|
|
|
4149
4770
|
// src/formatters/wiki.ts
|
|
4150
4771
|
function formatWikiList(wikis, opts) {
|
|
@@ -4236,7 +4857,7 @@ function formatWikiPageDetail(page, opts) {
|
|
|
4236
4857
|
}
|
|
4237
4858
|
|
|
4238
4859
|
// src/commands/wiki/list.ts
|
|
4239
|
-
var wikiListCommand = new
|
|
4860
|
+
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
4861
|
const globalOpts = wikiListCommand.optsWithGlobals();
|
|
4241
4862
|
const config = await getConfigOrThrow();
|
|
4242
4863
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -4250,7 +4871,7 @@ var wikiListCommand = new import_commander34.Command("list").description("\uC704
|
|
|
4250
4871
|
});
|
|
4251
4872
|
|
|
4252
4873
|
// src/commands/wiki/pages.ts
|
|
4253
|
-
var
|
|
4874
|
+
var import_commander36 = require("commander");
|
|
4254
4875
|
|
|
4255
4876
|
// src/resolvers/wiki.ts
|
|
4256
4877
|
async function resolveWiki(client, projectCode) {
|
|
@@ -4294,7 +4915,7 @@ async function resolveWikiHomePageId(client, wikiId) {
|
|
|
4294
4915
|
}
|
|
4295
4916
|
|
|
4296
4917
|
// src/commands/wiki/pages.ts
|
|
4297
|
-
var wikiPagesCommand = new
|
|
4918
|
+
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
4919
|
const globalOpts = wikiPagesCommand.optsWithGlobals();
|
|
4299
4920
|
const config = await getConfigOrThrow();
|
|
4300
4921
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -4306,8 +4927,8 @@ var wikiPagesCommand = new import_commander35.Command("pages").description("\uC7
|
|
|
4306
4927
|
});
|
|
4307
4928
|
|
|
4308
4929
|
// src/commands/wiki/tree.ts
|
|
4309
|
-
var
|
|
4310
|
-
var wikiTreeCommand = new
|
|
4930
|
+
var import_commander37 = require("commander");
|
|
4931
|
+
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
4932
|
const globalOpts = wikiTreeCommand.optsWithGlobals();
|
|
4312
4933
|
const config = await getConfigOrThrow();
|
|
4313
4934
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -4327,8 +4948,8 @@ var wikiTreeCommand = new import_commander36.Command("tree").description("\uC704
|
|
|
4327
4948
|
});
|
|
4328
4949
|
|
|
4329
4950
|
// src/commands/wiki/page-get.ts
|
|
4330
|
-
var
|
|
4331
|
-
var wikiPageGetCommand = new
|
|
4951
|
+
var import_commander38 = require("commander");
|
|
4952
|
+
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
4953
|
const globalOpts = wikiPageGetCommand.optsWithGlobals();
|
|
4333
4954
|
const config = await getConfigOrThrow();
|
|
4334
4955
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -4340,8 +4961,8 @@ var wikiPageGetCommand = new import_commander37.Command("get").description("\uC7
|
|
|
4340
4961
|
});
|
|
4341
4962
|
|
|
4342
4963
|
// src/commands/wiki/page-create.ts
|
|
4343
|
-
var
|
|
4344
|
-
var wikiPageCreateCommand = new
|
|
4964
|
+
var import_commander39 = require("commander");
|
|
4965
|
+
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
4966
|
const globalOpts = wikiPageCreateCommand.optsWithGlobals();
|
|
4346
4967
|
const config = await getConfigOrThrow();
|
|
4347
4968
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -4366,8 +4987,8 @@ var wikiPageCreateCommand = new import_commander38.Command("create").description
|
|
|
4366
4987
|
});
|
|
4367
4988
|
|
|
4368
4989
|
// src/commands/wiki/page-edit.ts
|
|
4369
|
-
var
|
|
4370
|
-
var wikiPageEditCommand = new
|
|
4990
|
+
var import_commander40 = require("commander");
|
|
4991
|
+
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
4992
|
const config = await getConfigOrThrow();
|
|
4372
4993
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
4373
4994
|
const hasTitle = opts.title != null;
|
|
@@ -4420,7 +5041,7 @@ var wikiPageEditCommand = new import_commander39.Command("edit").description("\u
|
|
|
4420
5041
|
});
|
|
4421
5042
|
|
|
4422
5043
|
// src/commands/wiki/page-delete.ts
|
|
4423
|
-
var
|
|
5044
|
+
var import_commander41 = require("commander");
|
|
4424
5045
|
|
|
4425
5046
|
// src/resolvers/wiki-page-input.ts
|
|
4426
5047
|
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 +5098,7 @@ async function resolveWikiPageInput(client, args) {
|
|
|
4477
5098
|
}
|
|
4478
5099
|
|
|
4479
5100
|
// src/commands/wiki/page-delete.ts
|
|
4480
|
-
var wikiPageDeleteCommand = new
|
|
5101
|
+
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
5102
|
const globalOpts = wikiPageDeleteCommand.optsWithGlobals();
|
|
4482
5103
|
const config = await getConfigOrThrow();
|
|
4483
5104
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -4523,16 +5144,16 @@ var wikiPageDeleteCommand = new import_commander40.Command("delete").description
|
|
|
4523
5144
|
});
|
|
4524
5145
|
|
|
4525
5146
|
// src/commands/wiki/page-file/index.ts
|
|
4526
|
-
var
|
|
5147
|
+
var import_commander47 = require("commander");
|
|
4527
5148
|
|
|
4528
5149
|
// src/commands/wiki/page-file/list.ts
|
|
4529
|
-
var
|
|
5150
|
+
var import_commander42 = require("commander");
|
|
4530
5151
|
function formatSize3(bytes) {
|
|
4531
5152
|
if (bytes < 1024) return `${bytes}B`;
|
|
4532
5153
|
if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)}KB`;
|
|
4533
5154
|
return `${(bytes / (1024 * 1024)).toFixed(1)}MB`;
|
|
4534
5155
|
}
|
|
4535
|
-
var wikiPageFileListCommand = new
|
|
5156
|
+
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
5157
|
const globalOpts = wikiPageFileListCommand.optsWithGlobals();
|
|
4537
5158
|
const config = await getConfigOrThrow();
|
|
4538
5159
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -4563,7 +5184,7 @@ var wikiPageFileListCommand = new import_commander41.Command("list").description
|
|
|
4563
5184
|
});
|
|
4564
5185
|
|
|
4565
5186
|
// src/commands/wiki/page-file/upload.ts
|
|
4566
|
-
var
|
|
5187
|
+
var import_commander43 = require("commander");
|
|
4567
5188
|
|
|
4568
5189
|
// src/utils/wiki-snippet.ts
|
|
4569
5190
|
function wikiInlineImageSnippet(wikiId, attachFileId, name) {
|
|
@@ -4571,7 +5192,7 @@ function wikiInlineImageSnippet(wikiId, attachFileId, name) {
|
|
|
4571
5192
|
}
|
|
4572
5193
|
|
|
4573
5194
|
// src/commands/wiki/page-file/upload.ts
|
|
4574
|
-
var wikiPageFileUploadCommand = new
|
|
5195
|
+
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
5196
|
const globalOpts = wikiPageFileUploadCommand.optsWithGlobals();
|
|
4576
5197
|
const config = await getConfigOrThrow();
|
|
4577
5198
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -4666,10 +5287,10 @@ var wikiPageFileUploadCommand = new import_commander42.Command("upload").descrip
|
|
|
4666
5287
|
});
|
|
4667
5288
|
|
|
4668
5289
|
// src/commands/wiki/page-file/download.ts
|
|
4669
|
-
var
|
|
5290
|
+
var import_commander44 = require("commander");
|
|
4670
5291
|
var import_promises11 = require("fs/promises");
|
|
4671
|
-
var
|
|
4672
|
-
var wikiPageFileDownloadCommand = new
|
|
5292
|
+
var import_node_path12 = require("path");
|
|
5293
|
+
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
5294
|
const globalOpts = wikiPageFileDownloadCommand.optsWithGlobals();
|
|
4674
5295
|
const config = await getConfigOrThrow();
|
|
4675
5296
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -4719,8 +5340,8 @@ var wikiPageFileDownloadCommand = new import_commander43.Command("download").des
|
|
|
4719
5340
|
startSpinner("\uD30C\uC77C \uB2E4\uC6B4\uB85C\uB4DC \uC911...");
|
|
4720
5341
|
try {
|
|
4721
5342
|
const { buffer, fileName } = await client.downloadWikiPageFile(wikiId, pageId, fileId);
|
|
4722
|
-
const safeName = (0,
|
|
4723
|
-
const outputPath = (0,
|
|
5343
|
+
const safeName = (0, import_node_path12.basename)(decodeURIComponent(fileName));
|
|
5344
|
+
const outputPath = (0, import_node_path12.join)(opts.output, safeName);
|
|
4724
5345
|
await (0, import_promises11.writeFile)(outputPath, Buffer.from(buffer));
|
|
4725
5346
|
stopSpinner(true, `\uB2E4\uC6B4\uB85C\uB4DC \uC644\uB8CC: ${outputPath}`);
|
|
4726
5347
|
emitDownloadResult(globalOpts, { outputPath, fileName: safeName, size: buffer.byteLength });
|
|
@@ -4731,10 +5352,10 @@ var wikiPageFileDownloadCommand = new import_commander43.Command("download").des
|
|
|
4731
5352
|
});
|
|
4732
5353
|
|
|
4733
5354
|
// src/commands/wiki/page-file/download-all.ts
|
|
4734
|
-
var
|
|
5355
|
+
var import_commander45 = require("commander");
|
|
4735
5356
|
var import_promises12 = require("fs/promises");
|
|
4736
|
-
var
|
|
4737
|
-
var wikiPageFileDownloadAllCommand = new
|
|
5357
|
+
var import_node_path13 = require("path");
|
|
5358
|
+
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
5359
|
const globalOpts = wikiPageFileDownloadAllCommand.optsWithGlobals();
|
|
4739
5360
|
const config = await getConfigOrThrow();
|
|
4740
5361
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -4770,8 +5391,8 @@ var wikiPageFileDownloadAllCommand = new import_commander44.Command("download-al
|
|
|
4770
5391
|
for (const f of allFiles) {
|
|
4771
5392
|
try {
|
|
4772
5393
|
const { buffer, fileName } = await client.downloadWikiPageFile(wikiId, pageId, f.id);
|
|
4773
|
-
const safeName = (0,
|
|
4774
|
-
const outputPath = (0,
|
|
5394
|
+
const safeName = (0, import_node_path13.basename)(decodeURIComponent(fileName));
|
|
5395
|
+
const outputPath = (0, import_node_path13.join)(opts.output, safeName);
|
|
4775
5396
|
await (0, import_promises12.writeFile)(outputPath, Buffer.from(buffer));
|
|
4776
5397
|
succeeded.push({ path: outputPath, fileName: safeName });
|
|
4777
5398
|
if (!globalOpts.json && !globalOpts.quiet) {
|
|
@@ -4791,8 +5412,8 @@ var wikiPageFileDownloadAllCommand = new import_commander44.Command("download-al
|
|
|
4791
5412
|
});
|
|
4792
5413
|
|
|
4793
5414
|
// src/commands/wiki/page-file/delete.ts
|
|
4794
|
-
var
|
|
4795
|
-
var wikiPageFileDeleteCommand = new
|
|
5415
|
+
var import_commander46 = require("commander");
|
|
5416
|
+
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
5417
|
const globalOpts = wikiPageFileDeleteCommand.optsWithGlobals();
|
|
4797
5418
|
const config = await getConfigOrThrow();
|
|
4798
5419
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -4851,7 +5472,7 @@ var wikiPageFileDeleteCommand = new import_commander45.Command("delete").descrip
|
|
|
4851
5472
|
});
|
|
4852
5473
|
|
|
4853
5474
|
// src/commands/wiki/page-file/index.ts
|
|
4854
|
-
var wikiPageFileCommand = new
|
|
5475
|
+
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
5476
|
wikiPageFileCommand.addCommand(wikiPageFileListCommand);
|
|
4856
5477
|
wikiPageFileCommand.addCommand(wikiPageFileUploadCommand);
|
|
4857
5478
|
wikiPageFileCommand.addCommand(wikiPageFileDownloadCommand);
|
|
@@ -4859,10 +5480,10 @@ wikiPageFileCommand.addCommand(wikiPageFileDownloadAllCommand);
|
|
|
4859
5480
|
wikiPageFileCommand.addCommand(wikiPageFileDeleteCommand);
|
|
4860
5481
|
|
|
4861
5482
|
// src/commands/wiki/page-comment/index.ts
|
|
4862
|
-
var
|
|
5483
|
+
var import_commander54 = require("commander");
|
|
4863
5484
|
|
|
4864
5485
|
// src/commands/wiki/page-comment/list.ts
|
|
4865
|
-
var
|
|
5486
|
+
var import_commander48 = require("commander");
|
|
4866
5487
|
|
|
4867
5488
|
// src/formatters/wiki-comment.ts
|
|
4868
5489
|
function formatWikiCommentList(comments, opts) {
|
|
@@ -4909,7 +5530,7 @@ function truncate(s, n) {
|
|
|
4909
5530
|
}
|
|
4910
5531
|
|
|
4911
5532
|
// src/commands/wiki/page-comment/list.ts
|
|
4912
|
-
var wikiPageCommentListCommand = new
|
|
5533
|
+
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
5534
|
const globalOpts = wikiPageCommentListCommand.optsWithGlobals();
|
|
4914
5535
|
const config = await getConfigOrThrow();
|
|
4915
5536
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -4934,8 +5555,8 @@ var wikiPageCommentListCommand = new import_commander47.Command("list").descript
|
|
|
4934
5555
|
});
|
|
4935
5556
|
|
|
4936
5557
|
// src/commands/wiki/page-comment/latest.ts
|
|
4937
|
-
var
|
|
4938
|
-
var wikiPageCommentLatestCommand = new
|
|
5558
|
+
var import_commander49 = require("commander");
|
|
5559
|
+
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
5560
|
const globalOpts = wikiPageCommentLatestCommand.optsWithGlobals();
|
|
4940
5561
|
const config = await getConfigOrThrow();
|
|
4941
5562
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -4962,7 +5583,7 @@ var wikiPageCommentLatestCommand = new import_commander48.Command("latest").desc
|
|
|
4962
5583
|
});
|
|
4963
5584
|
|
|
4964
5585
|
// src/commands/wiki/page-comment/get.ts
|
|
4965
|
-
var
|
|
5586
|
+
var import_commander50 = require("commander");
|
|
4966
5587
|
|
|
4967
5588
|
// src/commands/wiki/page-comment/parse-args.ts
|
|
4968
5589
|
function parseWikiCommentArgs(arg1, arg2, arg3, opts) {
|
|
@@ -5015,7 +5636,7 @@ function parseWikiCommentArgs(arg1, arg2, arg3, opts) {
|
|
|
5015
5636
|
}
|
|
5016
5637
|
|
|
5017
5638
|
// src/commands/wiki/page-comment/get.ts
|
|
5018
|
-
var wikiPageCommentGetCommand = new
|
|
5639
|
+
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
5640
|
const parsed = parseWikiCommentArgs(arg1, arg2, arg3, opts);
|
|
5020
5641
|
const config = await getConfigOrThrow();
|
|
5021
5642
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -5039,8 +5660,8 @@ var wikiPageCommentGetCommand = new import_commander49.Command("get").descriptio
|
|
|
5039
5660
|
});
|
|
5040
5661
|
|
|
5041
5662
|
// src/commands/wiki/page-comment/add.ts
|
|
5042
|
-
var
|
|
5043
|
-
var wikiPageCommentAddCommand = new
|
|
5663
|
+
var import_commander51 = require("commander");
|
|
5664
|
+
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
5665
|
if ((opts.id || opts.url) && (project || pageIdArg)) {
|
|
5045
5666
|
throw new DoorayCliError(
|
|
5046
5667
|
"positional \uC778\uC790\uC640 --id/--url \uC635\uC158\uC740 \uB3D9\uC2DC\uC5D0 \uC0AC\uC6A9\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.",
|
|
@@ -5086,8 +5707,8 @@ var wikiPageCommentAddCommand = new import_commander50.Command("add").descriptio
|
|
|
5086
5707
|
});
|
|
5087
5708
|
|
|
5088
5709
|
// src/commands/wiki/page-comment/edit.ts
|
|
5089
|
-
var
|
|
5090
|
-
var wikiPageCommentEditCommand = new
|
|
5710
|
+
var import_commander52 = require("commander");
|
|
5711
|
+
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
5712
|
const parsed = parseWikiCommentArgs(arg1, arg2, arg3, opts);
|
|
5092
5713
|
const config = await getConfigOrThrow();
|
|
5093
5714
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -5131,8 +5752,8 @@ var wikiPageCommentEditCommand = new import_commander51.Command("edit").descript
|
|
|
5131
5752
|
});
|
|
5132
5753
|
|
|
5133
5754
|
// src/commands/wiki/page-comment/delete.ts
|
|
5134
|
-
var
|
|
5135
|
-
var wikiPageCommentDeleteCommand = new
|
|
5755
|
+
var import_commander53 = require("commander");
|
|
5756
|
+
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
5757
|
const parsed = parseWikiCommentArgs(arg1, arg2, arg3, opts);
|
|
5137
5758
|
const config = await getConfigOrThrow();
|
|
5138
5759
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -5156,7 +5777,7 @@ var wikiPageCommentDeleteCommand = new import_commander52.Command("delete").desc
|
|
|
5156
5777
|
});
|
|
5157
5778
|
|
|
5158
5779
|
// src/commands/wiki/page-comment/index.ts
|
|
5159
|
-
var wikiPageCommentCommand = new
|
|
5780
|
+
var wikiPageCommentCommand = new import_commander54.Command("comment").description("\uC704\uD0A4 \uD398\uC774\uC9C0 \uB313\uAE00 \uAD00\uB828 \uBA85\uB839");
|
|
5160
5781
|
wikiPageCommentCommand.addCommand(wikiPageCommentListCommand);
|
|
5161
5782
|
wikiPageCommentCommand.addCommand(wikiPageCommentLatestCommand);
|
|
5162
5783
|
wikiPageCommentCommand.addCommand(wikiPageCommentGetCommand);
|
|
@@ -5165,10 +5786,10 @@ wikiPageCommentCommand.addCommand(wikiPageCommentEditCommand);
|
|
|
5165
5786
|
wikiPageCommentCommand.addCommand(wikiPageCommentDeleteCommand);
|
|
5166
5787
|
|
|
5167
5788
|
// src/commands/member/index.ts
|
|
5168
|
-
var
|
|
5789
|
+
var import_commander58 = require("commander");
|
|
5169
5790
|
|
|
5170
5791
|
// src/commands/member/get.ts
|
|
5171
|
-
var
|
|
5792
|
+
var import_commander55 = require("commander");
|
|
5172
5793
|
|
|
5173
5794
|
// src/formatters/member.ts
|
|
5174
5795
|
function formatMemberDetail(member, opts) {
|
|
@@ -5214,7 +5835,7 @@ function formatMemberSearchResults(members, opts) {
|
|
|
5214
5835
|
}
|
|
5215
5836
|
|
|
5216
5837
|
// src/commands/member/get.ts
|
|
5217
|
-
var memberGetCommand = new
|
|
5838
|
+
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
5839
|
const globalOpts = memberGetCommand.optsWithGlobals();
|
|
5219
5840
|
const config = await getConfigOrThrow();
|
|
5220
5841
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -5223,8 +5844,8 @@ var memberGetCommand = new import_commander54.Command("get").description("\uBA64
|
|
|
5223
5844
|
});
|
|
5224
5845
|
|
|
5225
5846
|
// src/commands/member/list.ts
|
|
5226
|
-
var
|
|
5227
|
-
var memberListCommand = new
|
|
5847
|
+
var import_commander56 = require("commander");
|
|
5848
|
+
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
5849
|
const globalOpts = memberListCommand.optsWithGlobals();
|
|
5229
5850
|
const config = await getConfigOrThrow();
|
|
5230
5851
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -5239,8 +5860,8 @@ var memberListCommand = new import_commander55.Command("list").description("\uD5
|
|
|
5239
5860
|
});
|
|
5240
5861
|
|
|
5241
5862
|
// src/commands/member/search.ts
|
|
5242
|
-
var
|
|
5243
|
-
var memberSearchCommand = new
|
|
5863
|
+
var import_commander57 = require("commander");
|
|
5864
|
+
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
5865
|
const globalOpts = memberSearchCommand.optsWithGlobals();
|
|
5245
5866
|
const filterCount = [keyword, opts.email, opts.userCode, opts.userCodeExact].filter(Boolean).length;
|
|
5246
5867
|
if (filterCount === 0) {
|
|
@@ -5273,13 +5894,13 @@ var memberSearchCommand = new import_commander56.Command("search").description("
|
|
|
5273
5894
|
});
|
|
5274
5895
|
|
|
5275
5896
|
// src/commands/member/index.ts
|
|
5276
|
-
var memberCommand = new
|
|
5897
|
+
var memberCommand = new import_commander58.Command("member").description("Dooray \uBA64\uBC84 \uC870\uD68C");
|
|
5277
5898
|
memberCommand.addCommand(memberGetCommand);
|
|
5278
5899
|
memberCommand.addCommand(memberListCommand);
|
|
5279
5900
|
memberCommand.addCommand(memberSearchCommand);
|
|
5280
5901
|
|
|
5281
5902
|
// src/commands/mail/list.ts
|
|
5282
|
-
var
|
|
5903
|
+
var import_commander59 = require("commander");
|
|
5283
5904
|
|
|
5284
5905
|
// src/api/imapClient.ts
|
|
5285
5906
|
var import_imapflow = require("imapflow");
|
|
@@ -5395,8 +6016,8 @@ async function getMail(config, uid) {
|
|
|
5395
6016
|
}
|
|
5396
6017
|
|
|
5397
6018
|
// src/commands/mail/list.ts
|
|
5398
|
-
var
|
|
5399
|
-
var mailListCommand = new
|
|
6019
|
+
var import_chalk6 = __toESM(require("chalk"));
|
|
6020
|
+
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
6021
|
const globalOpts = mailListCommand.optsWithGlobals();
|
|
5401
6022
|
const config = await getConfigOrThrow();
|
|
5402
6023
|
startSpinner("\uBA54\uC77C \uC870\uD68C \uC911...");
|
|
@@ -5410,7 +6031,7 @@ var mailListCommand = new import_commander58.Command("list").description("\uBA54
|
|
|
5410
6031
|
headers: ["UID", "\uC77D\uC74C", "\uB0A0\uC9DC", "\uBCF4\uB0B8\uC0AC\uB78C", "\uC81C\uBAA9"],
|
|
5411
6032
|
rows: mails.map((m) => [
|
|
5412
6033
|
String(m.uid),
|
|
5413
|
-
m.isRead ? "\u2713" :
|
|
6034
|
+
m.isRead ? "\u2713" : import_chalk6.default.red("\u2717"),
|
|
5414
6035
|
m.date ? m.date.toLocaleDateString("ko-KR") : "",
|
|
5415
6036
|
m.from.replace(/<.*>/, "").trim() || m.from,
|
|
5416
6037
|
m.subject
|
|
@@ -5428,9 +6049,9 @@ var mailListCommand = new import_commander58.Command("list").description("\uBA54
|
|
|
5428
6049
|
});
|
|
5429
6050
|
|
|
5430
6051
|
// src/commands/mail/get.ts
|
|
5431
|
-
var
|
|
5432
|
-
var
|
|
5433
|
-
var mailGetCommand = new
|
|
6052
|
+
var import_commander60 = require("commander");
|
|
6053
|
+
var import_chalk7 = __toESM(require("chalk"));
|
|
6054
|
+
var mailGetCommand = new import_commander60.Command("get").description("\uBA54\uC77C \uC0C1\uC138 \uC870\uD68C").argument("<uid>", "\uBA54\uC77C UID").action(async (uid) => {
|
|
5434
6055
|
const globalOpts = mailGetCommand.optsWithGlobals();
|
|
5435
6056
|
const config = await getConfigOrThrow();
|
|
5436
6057
|
startSpinner("\uBA54\uC77C \uC870\uD68C \uC911...");
|
|
@@ -5448,11 +6069,11 @@ var mailGetCommand = new import_commander59.Command("get").description("\uBA54\u
|
|
|
5448
6069
|
});
|
|
5449
6070
|
} else {
|
|
5450
6071
|
process.stdout.write(
|
|
5451
|
-
`${
|
|
5452
|
-
${
|
|
5453
|
-
${
|
|
5454
|
-
${
|
|
5455
|
-
${
|
|
6072
|
+
`${import_chalk7.default.bold("\uC81C\uBAA9:")} ${mail.subject}
|
|
6073
|
+
${import_chalk7.default.bold("\uBCF4\uB0B8\uC0AC\uB78C:")} ${mail.from}
|
|
6074
|
+
${import_chalk7.default.bold("\uBC1B\uB294\uC0AC\uB78C:")} ${mail.to.join(", ")}
|
|
6075
|
+
${import_chalk7.default.bold("\uB0A0\uC9DC:")} ${mail.date?.toLocaleString("ko-KR") ?? ""}
|
|
6076
|
+
${import_chalk7.default.bold("\uC77D\uC74C:")} ${mail.isRead ? "\uC608" : "\uC544\uB2C8\uC624"}
|
|
5456
6077
|
|
|
5457
6078
|
${mail.body}
|
|
5458
6079
|
`
|
|
@@ -5461,7 +6082,7 @@ ${mail.body}
|
|
|
5461
6082
|
});
|
|
5462
6083
|
|
|
5463
6084
|
// src/commands/mail/send.ts
|
|
5464
|
-
var
|
|
6085
|
+
var import_commander61 = require("commander");
|
|
5465
6086
|
var import_promises13 = require("fs/promises");
|
|
5466
6087
|
|
|
5467
6088
|
// src/api/smtpClient.ts
|
|
@@ -5511,7 +6132,7 @@ async function sendMail(config, opts) {
|
|
|
5511
6132
|
}
|
|
5512
6133
|
|
|
5513
6134
|
// src/commands/mail/send.ts
|
|
5514
|
-
var mailSendCommand = new
|
|
6135
|
+
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
6136
|
const globalOpts = mailSendCommand.optsWithGlobals();
|
|
5516
6137
|
const config = await getConfigOrThrow();
|
|
5517
6138
|
let body = opts.body ?? "";
|
|
@@ -5546,7 +6167,7 @@ var mailSendCommand = new import_commander60.Command("send").description("\uBA54
|
|
|
5546
6167
|
});
|
|
5547
6168
|
|
|
5548
6169
|
// src/commands/mail/reply.ts
|
|
5549
|
-
var
|
|
6170
|
+
var import_commander62 = require("commander");
|
|
5550
6171
|
var import_promises14 = require("fs/promises");
|
|
5551
6172
|
var import_imapflow2 = require("imapflow");
|
|
5552
6173
|
async function getMessageId(config, uid) {
|
|
@@ -5575,7 +6196,7 @@ async function getMessageId(config, uid) {
|
|
|
5575
6196
|
await client.logout();
|
|
5576
6197
|
}
|
|
5577
6198
|
}
|
|
5578
|
-
var mailReplyCommand = new
|
|
6199
|
+
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
6200
|
const globalOpts = mailReplyCommand.optsWithGlobals();
|
|
5580
6201
|
const config = await getConfigOrThrow();
|
|
5581
6202
|
let body = opts.body ?? "";
|
|
@@ -5616,11 +6237,11 @@ var mailReplyCommand = new import_commander61.Command("reply").description("\uBA
|
|
|
5616
6237
|
});
|
|
5617
6238
|
|
|
5618
6239
|
// src/commands/messenger/index.ts
|
|
5619
|
-
var
|
|
6240
|
+
var import_commander65 = require("commander");
|
|
5620
6241
|
|
|
5621
6242
|
// src/commands/messenger/send.ts
|
|
5622
|
-
var
|
|
5623
|
-
var messengerSendCommand = new
|
|
6243
|
+
var import_commander63 = require("commander");
|
|
6244
|
+
var messengerSendCommand = new import_commander63.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
6245
|
if (!opts.to) {
|
|
5625
6246
|
throw new DoorayCliError("--to \uC635\uC158\uC740 \uD544\uC218\uC785\uB2C8\uB2E4.", EXIT_PARAM_ERROR);
|
|
5626
6247
|
}
|
|
@@ -5660,7 +6281,7 @@ var messengerSendCommand = new import_commander62.Command("send").description("\
|
|
|
5660
6281
|
});
|
|
5661
6282
|
|
|
5662
6283
|
// src/commands/messenger/channel-send.ts
|
|
5663
|
-
var
|
|
6284
|
+
var import_commander64 = require("commander");
|
|
5664
6285
|
|
|
5665
6286
|
// src/resolvers/messenger-channel.ts
|
|
5666
6287
|
var CHANNEL_ID_RE = /^\d{15,}$/;
|
|
@@ -5678,7 +6299,7 @@ async function resolveMessengerChannel(client, input2) {
|
|
|
5678
6299
|
}
|
|
5679
6300
|
|
|
5680
6301
|
// src/commands/messenger/channel-send.ts
|
|
5681
|
-
var messengerChannelSendCommand = new
|
|
6302
|
+
var messengerChannelSendCommand = new import_commander64.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
6303
|
if (!opts.channel) {
|
|
5683
6304
|
throw new DoorayCliError("--channel \uC635\uC158\uC740 \uD544\uC218\uC785\uB2C8\uB2E4.", EXIT_PARAM_ERROR);
|
|
5684
6305
|
}
|
|
@@ -5712,30 +6333,30 @@ var messengerChannelSendCommand = new import_commander63.Command("channel-send")
|
|
|
5712
6333
|
});
|
|
5713
6334
|
|
|
5714
6335
|
// src/commands/messenger/index.ts
|
|
5715
|
-
var messengerCommand = new
|
|
6336
|
+
var messengerCommand = new import_commander65.Command("messenger").description("\uBA54\uC2E0\uC800 \uAD00\uB828 \uBA85\uB839");
|
|
5716
6337
|
messengerCommand.addCommand(messengerSendCommand);
|
|
5717
6338
|
messengerCommand.addCommand(messengerChannelSendCommand);
|
|
5718
6339
|
|
|
5719
6340
|
// src/commands/feedback.ts
|
|
5720
|
-
var
|
|
6341
|
+
var import_commander66 = require("commander");
|
|
5721
6342
|
var import_node_child_process2 = require("child_process");
|
|
5722
6343
|
var import_node_util = require("util");
|
|
5723
6344
|
var import_promises17 = require("fs/promises");
|
|
5724
|
-
var
|
|
5725
|
-
var
|
|
5726
|
-
var
|
|
6345
|
+
var import_node_os5 = require("os");
|
|
6346
|
+
var import_node_path16 = require("path");
|
|
6347
|
+
var import_node_crypto2 = require("crypto");
|
|
5727
6348
|
var import_prompts = require("@inquirer/prompts");
|
|
5728
6349
|
|
|
5729
6350
|
// src/utils/feedback-meta.ts
|
|
5730
6351
|
var import_promises15 = require("fs/promises");
|
|
5731
|
-
var
|
|
6352
|
+
var import_node_path14 = require("path");
|
|
5732
6353
|
async function readCliVersion() {
|
|
5733
6354
|
const entry = process.argv[1];
|
|
5734
|
-
const here = entry ? (0,
|
|
6355
|
+
const here = entry ? (0, import_node_path14.dirname)(entry) : process.cwd();
|
|
5735
6356
|
const candidates = [
|
|
5736
|
-
(0,
|
|
5737
|
-
(0,
|
|
5738
|
-
(0,
|
|
6357
|
+
(0, import_node_path14.join)(here, "package.json"),
|
|
6358
|
+
(0, import_node_path14.join)(here, "..", "package.json"),
|
|
6359
|
+
(0, import_node_path14.join)(here, "..", "..", "package.json")
|
|
5739
6360
|
];
|
|
5740
6361
|
for (const p of candidates) {
|
|
5741
6362
|
try {
|
|
@@ -5786,9 +6407,9 @@ function buildIssueBody(userBody, meta) {
|
|
|
5786
6407
|
|
|
5787
6408
|
// src/cache/last-run.ts
|
|
5788
6409
|
var import_promises16 = require("fs/promises");
|
|
5789
|
-
var
|
|
5790
|
-
var
|
|
5791
|
-
var LAST_RUN_PATH = (0,
|
|
6410
|
+
var import_node_path15 = require("path");
|
|
6411
|
+
var import_node_os4 = require("os");
|
|
6412
|
+
var LAST_RUN_PATH = (0, import_node_path15.join)((0, import_node_os4.homedir)(), ".dooray", "last-run.json");
|
|
5792
6413
|
function isLastRun(obj) {
|
|
5793
6414
|
if (typeof obj !== "object" || obj === null) return false;
|
|
5794
6415
|
const o = obj;
|
|
@@ -5804,7 +6425,7 @@ async function readLastRun() {
|
|
|
5804
6425
|
}
|
|
5805
6426
|
}
|
|
5806
6427
|
async function writeLastRun(data) {
|
|
5807
|
-
await (0, import_promises16.mkdir)((0,
|
|
6428
|
+
await (0, import_promises16.mkdir)((0, import_node_path15.join)((0, import_node_os4.homedir)(), ".dooray"), { recursive: true });
|
|
5808
6429
|
const tmp2 = LAST_RUN_PATH + ".tmp";
|
|
5809
6430
|
await (0, import_promises16.writeFile)(tmp2, JSON.stringify(data, null, 2) + "\n", { mode: 384 });
|
|
5810
6431
|
await (0, import_promises16.rename)(tmp2, LAST_RUN_PATH);
|
|
@@ -5828,7 +6449,7 @@ async function readBody(opts) {
|
|
|
5828
6449
|
if (opts.bodyFile) return await (0, import_promises17.readFile)(opts.bodyFile, "utf-8");
|
|
5829
6450
|
return void 0;
|
|
5830
6451
|
}
|
|
5831
|
-
var feedbackCommand = new
|
|
6452
|
+
var feedbackCommand = new import_commander66.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
6453
|
"--label <name>",
|
|
5833
6454
|
"\uB77C\uBCA8 (\uBC18\uBCF5 \uAC00\uB2A5)",
|
|
5834
6455
|
(value, prev) => [...prev, value],
|
|
@@ -5919,7 +6540,7 @@ var feedbackCommand = new import_commander65.Command("feedback").description("do
|
|
|
5919
6540
|
}
|
|
5920
6541
|
}
|
|
5921
6542
|
await ensureGhInstalled();
|
|
5922
|
-
const bodyFile = (0,
|
|
6543
|
+
const bodyFile = (0, import_node_path16.join)((0, import_node_os5.tmpdir)(), `dooray-feedback-${(0, import_node_crypto2.randomUUID)()}.md`);
|
|
5923
6544
|
await (0, import_promises17.writeFile)(bodyFile, issueBody);
|
|
5924
6545
|
try {
|
|
5925
6546
|
const args = [
|
|
@@ -5991,25 +6612,25 @@ function sanitizeArgv(argv) {
|
|
|
5991
6612
|
}
|
|
5992
6613
|
|
|
5993
6614
|
// src/index.ts
|
|
5994
|
-
var program = new
|
|
5995
|
-
program.name("dooray").description("Dooray REST API CLI").version(
|
|
6615
|
+
var program = new import_commander67.Command();
|
|
6616
|
+
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
6617
|
program.hook("preAction", () => {
|
|
5997
6618
|
const opts = program.opts();
|
|
5998
6619
|
if (opts.color === false || process.env.NO_COLOR) {
|
|
5999
|
-
|
|
6620
|
+
import_chalk8.default.level = 0;
|
|
6000
6621
|
}
|
|
6001
6622
|
if (opts.json || opts.quiet) {
|
|
6002
6623
|
setQuiet(true);
|
|
6003
6624
|
}
|
|
6004
6625
|
});
|
|
6005
|
-
var projectCommand = new
|
|
6626
|
+
var projectCommand = new import_commander67.Command("project").description("\uD504\uB85C\uC81D\uD2B8 \uAD00\uB828 \uBA85\uB839");
|
|
6006
6627
|
projectCommand.addCommand(projectListCommand);
|
|
6007
6628
|
projectCommand.addCommand(projectMembersCommand);
|
|
6008
6629
|
projectCommand.addCommand(projectWorkflowsCommand);
|
|
6009
6630
|
projectCommand.addCommand(projectGroupsCommand);
|
|
6010
6631
|
projectCommand.addCommand(projectTagsCommand);
|
|
6011
6632
|
projectCommand.addCommand(projectTemplatesCommand);
|
|
6012
|
-
var postCommand = new
|
|
6633
|
+
var postCommand = new import_commander67.Command("post").description("\uC5C5\uBB34 \uAD00\uB828 \uBA85\uB839");
|
|
6013
6634
|
postCommand.addCommand(postListCommand);
|
|
6014
6635
|
postCommand.addCommand(postSearchCommand);
|
|
6015
6636
|
postCommand.addCommand(postGetCommand);
|
|
@@ -6017,7 +6638,7 @@ postCommand.addCommand(postEditCommand);
|
|
|
6017
6638
|
postCommand.addCommand(postCreateCommand);
|
|
6018
6639
|
postCommand.addCommand(postDoneCommand);
|
|
6019
6640
|
postCommand.addCommand(postWorkflowCommand);
|
|
6020
|
-
var commentCommand = new
|
|
6641
|
+
var commentCommand = new import_commander67.Command("comment").description("\uB313\uAE00 \uAD00\uB828 \uBA85\uB839");
|
|
6021
6642
|
commentCommand.addCommand(commentListCommand);
|
|
6022
6643
|
commentCommand.addCommand(commentLatestCommand);
|
|
6023
6644
|
commentCommand.addCommand(commentGetCommand);
|
|
@@ -6026,18 +6647,18 @@ commentCommand.addCommand(commentEditCommand);
|
|
|
6026
6647
|
commentCommand.addCommand(commentDeleteCommand);
|
|
6027
6648
|
commentCommand.addCommand(commentFileCommand);
|
|
6028
6649
|
postCommand.addCommand(commentCommand);
|
|
6029
|
-
var fileCommand = new
|
|
6650
|
+
var fileCommand = new import_commander67.Command("file").description("\uCCA8\uBD80\uD30C\uC77C \uAD00\uB828 \uBA85\uB839");
|
|
6030
6651
|
fileCommand.addCommand(fileListCommand);
|
|
6031
6652
|
fileCommand.addCommand(fileDownloadCommand);
|
|
6032
6653
|
fileCommand.addCommand(fileDownloadAllCommand);
|
|
6033
6654
|
fileCommand.addCommand(fileUploadCommand);
|
|
6034
6655
|
fileCommand.addCommand(fileDeleteCommand);
|
|
6035
6656
|
postCommand.addCommand(fileCommand);
|
|
6036
|
-
var wikiCommand = new
|
|
6657
|
+
var wikiCommand = new import_commander67.Command("wiki").description("\uC704\uD0A4 \uAD00\uB828 \uBA85\uB839");
|
|
6037
6658
|
wikiCommand.addCommand(wikiListCommand);
|
|
6038
6659
|
wikiCommand.addCommand(wikiPagesCommand);
|
|
6039
6660
|
wikiCommand.addCommand(wikiTreeCommand);
|
|
6040
|
-
var wikiPageCommand = new
|
|
6661
|
+
var wikiPageCommand = new import_commander67.Command("page").description("\uC704\uD0A4 \uD398\uC774\uC9C0 \uAD00\uB828 \uBA85\uB839");
|
|
6041
6662
|
wikiPageCommand.addCommand(wikiPageGetCommand);
|
|
6042
6663
|
wikiPageCommand.addCommand(wikiPageCreateCommand);
|
|
6043
6664
|
wikiPageCommand.addCommand(wikiPageEditCommand);
|
|
@@ -6045,12 +6666,13 @@ wikiPageCommand.addCommand(wikiPageDeleteCommand);
|
|
|
6045
6666
|
wikiPageCommand.addCommand(wikiPageFileCommand);
|
|
6046
6667
|
wikiPageCommand.addCommand(wikiPageCommentCommand);
|
|
6047
6668
|
wikiCommand.addCommand(wikiPageCommand);
|
|
6048
|
-
var mailCommand = new
|
|
6669
|
+
var mailCommand = new import_commander67.Command("mail").description("\uBA54\uC77C \uAD00\uB828 \uBA85\uB839");
|
|
6049
6670
|
mailCommand.addCommand(mailListCommand);
|
|
6050
6671
|
mailCommand.addCommand(mailGetCommand);
|
|
6051
6672
|
mailCommand.addCommand(mailSendCommand);
|
|
6052
6673
|
mailCommand.addCommand(mailReplyCommand);
|
|
6053
6674
|
program.addCommand(setupCommand);
|
|
6675
|
+
program.addCommand(skillCommand);
|
|
6054
6676
|
program.addCommand(configCommand);
|
|
6055
6677
|
program.addCommand(memberCommand);
|
|
6056
6678
|
program.addCommand(cacheCommand);
|
|
@@ -6079,6 +6701,6 @@ program.parseAsync().catch(async (err) => {
|
|
|
6079
6701
|
}
|
|
6080
6702
|
} catch {
|
|
6081
6703
|
}
|
|
6082
|
-
process.stderr.write(
|
|
6704
|
+
process.stderr.write(import_chalk8.default.red(`\uC624\uB958: ${errorMessage}`) + "\n");
|
|
6083
6705
|
process.exit(exitCode);
|
|
6084
6706
|
});
|