@bifos/dooray-cli 0.12.0 → 0.14.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 +28 -0
- package/dist/index.js +362 -79
- package/package.json +15 -15
- package/skills/dooray-cli/SKILL.md +31 -652
- package/skills/dooray-cli/references/comment.md +39 -0
- package/skills/dooray-cli/references/common.md +111 -0
- package/skills/dooray-cli/references/intent-map.md +92 -0
- package/skills/dooray-cli/references/mention-link.md +104 -0
- package/skills/dooray-cli/references/post.md +218 -0
- package/skills/dooray-cli/references/wiki.md +77 -0
- package/skills/dooray-cli/references/workflow.md +106 -0
package/dist/index.js
CHANGED
|
@@ -24,7 +24,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
24
24
|
));
|
|
25
25
|
|
|
26
26
|
// src/index.ts
|
|
27
|
-
var
|
|
27
|
+
var import_commander66 = require("commander");
|
|
28
28
|
var import_chalk7 = __toESM(require("chalk"));
|
|
29
29
|
|
|
30
30
|
// src/commands/config.ts
|
|
@@ -61,7 +61,7 @@ var API_ENDPOINTS = {
|
|
|
61
61
|
};
|
|
62
62
|
var DEFAULTS = {
|
|
63
63
|
baseUrl: "https://api.dooray.com",
|
|
64
|
-
tenantName: "
|
|
64
|
+
tenantName: "example",
|
|
65
65
|
imapHost: "imap.dooray.com",
|
|
66
66
|
imapPort: 993,
|
|
67
67
|
smtpHost: "smtp.dooray.com",
|
|
@@ -218,7 +218,7 @@ async function readJson(path3) {
|
|
|
218
218
|
}
|
|
219
219
|
}
|
|
220
220
|
async function writeJson(path3, data) {
|
|
221
|
-
const dir =
|
|
221
|
+
const dir = (0, import_node_path2.dirname)(path3);
|
|
222
222
|
await ensureDir2(dir);
|
|
223
223
|
await (0, import_promises2.writeFile)(path3, JSON.stringify(data, null, 2) + "\n");
|
|
224
224
|
}
|
|
@@ -413,7 +413,7 @@ var DoorayApiClient = class {
|
|
|
413
413
|
this.authHeader = `dooray-api ${apiKey}`;
|
|
414
414
|
this.baseUrl = baseUrl.endsWith("/") ? baseUrl : `${baseUrl}/`;
|
|
415
415
|
this.api = import_ky.default.create({
|
|
416
|
-
|
|
416
|
+
prefix: baseUrl,
|
|
417
417
|
headers: {
|
|
418
418
|
Authorization: this.authHeader
|
|
419
419
|
}
|
|
@@ -675,6 +675,27 @@ var DoorayApiClient = class {
|
|
|
675
675
|
throw await toDoorayCliError(e);
|
|
676
676
|
}
|
|
677
677
|
}
|
|
678
|
+
async getAllWikiPages(wikiId, maxDepth) {
|
|
679
|
+
const CONCURRENCY = 10;
|
|
680
|
+
const all = [];
|
|
681
|
+
let level = (await this.getWikiPages(wikiId)).result;
|
|
682
|
+
let depth = 1;
|
|
683
|
+
while (level.length > 0) {
|
|
684
|
+
all.push(...level);
|
|
685
|
+
if (maxDepth !== void 0 && depth >= maxDepth) break;
|
|
686
|
+
const next = [];
|
|
687
|
+
for (let i = 0; i < level.length; i += CONCURRENCY) {
|
|
688
|
+
const chunk = level.slice(i, i + CONCURRENCY);
|
|
689
|
+
const batches = await Promise.all(
|
|
690
|
+
chunk.map((p) => this.getWikiPages(wikiId, p.id).then((r) => r.result))
|
|
691
|
+
);
|
|
692
|
+
next.push(...batches.flat());
|
|
693
|
+
}
|
|
694
|
+
level = next;
|
|
695
|
+
depth++;
|
|
696
|
+
}
|
|
697
|
+
return all;
|
|
698
|
+
}
|
|
678
699
|
async getWikiPage(wikiId, pageId) {
|
|
679
700
|
try {
|
|
680
701
|
return await this.api.get(`wiki/v1/wikis/${wikiId}/pages/${pageId}`).json();
|
|
@@ -710,6 +731,14 @@ var DoorayApiClient = class {
|
|
|
710
731
|
throw await toDoorayCliError(e);
|
|
711
732
|
}
|
|
712
733
|
}
|
|
734
|
+
// 비공식(미문서화) endpoint — Dooray 공식 API 문서에 없으나 실측 확인 (ADR-032)
|
|
735
|
+
async deleteWikiPage(wikiId, pageId) {
|
|
736
|
+
try {
|
|
737
|
+
return await this.api.delete(`wiki/v1/wikis/${wikiId}/pages/${pageId}`).json();
|
|
738
|
+
} catch (e) {
|
|
739
|
+
throw await toDoorayCliError(e);
|
|
740
|
+
}
|
|
741
|
+
}
|
|
713
742
|
// ─── Post Files ─────────────────────────────────────
|
|
714
743
|
async getPostFiles(projectId, postId) {
|
|
715
744
|
try {
|
|
@@ -948,6 +977,32 @@ var DoorayApiClient = class {
|
|
|
948
977
|
throw await toDoorayCliError(e);
|
|
949
978
|
}
|
|
950
979
|
}
|
|
980
|
+
// ─── Messenger (ADR-033) ────────────────────────────
|
|
981
|
+
async sendDirectMessage(organizationMemberId, text) {
|
|
982
|
+
try {
|
|
983
|
+
return await this.api.post("messenger/v1/channels/direct-send", {
|
|
984
|
+
json: { text, organizationMemberId }
|
|
985
|
+
}).json();
|
|
986
|
+
} catch (e) {
|
|
987
|
+
throw await toDoorayCliError(e);
|
|
988
|
+
}
|
|
989
|
+
}
|
|
990
|
+
async sendChannelMessage(channelId, text) {
|
|
991
|
+
try {
|
|
992
|
+
return await this.api.post(`messenger/v1/channels/${channelId}/logs`, {
|
|
993
|
+
json: { text }
|
|
994
|
+
}).json();
|
|
995
|
+
} catch (e) {
|
|
996
|
+
throw await toDoorayCliError(e);
|
|
997
|
+
}
|
|
998
|
+
}
|
|
999
|
+
async getMessengerChannels() {
|
|
1000
|
+
try {
|
|
1001
|
+
return await this.api.get("messenger/v1/channels").json();
|
|
1002
|
+
} catch (e) {
|
|
1003
|
+
throw await toDoorayCliError(e);
|
|
1004
|
+
}
|
|
1005
|
+
}
|
|
951
1006
|
};
|
|
952
1007
|
|
|
953
1008
|
// src/cache/types.ts
|
|
@@ -1432,7 +1487,7 @@ async function buildMemberNameMap(client, projectId) {
|
|
|
1432
1487
|
}
|
|
1433
1488
|
return map;
|
|
1434
1489
|
}
|
|
1435
|
-
async function
|
|
1490
|
+
async function resolveMemberByIdOrEmail(client, input2) {
|
|
1436
1491
|
if (MEMBER_ID_RE.test(input2)) {
|
|
1437
1492
|
try {
|
|
1438
1493
|
await client.getMemberDetail(input2);
|
|
@@ -1465,6 +1520,11 @@ async function resolveMember(client, projectId, input2) {
|
|
|
1465
1520
|
}
|
|
1466
1521
|
return hits[0].id;
|
|
1467
1522
|
}
|
|
1523
|
+
return null;
|
|
1524
|
+
}
|
|
1525
|
+
async function resolveMember(client, projectId, input2) {
|
|
1526
|
+
const byIdOrEmail = await resolveMemberByIdOrEmail(client, input2);
|
|
1527
|
+
if (byIdOrEmail !== null) return byIdOrEmail;
|
|
1468
1528
|
const members = await ensureMembers(client, projectId);
|
|
1469
1529
|
const match = matchByName(
|
|
1470
1530
|
members,
|
|
@@ -2300,7 +2360,7 @@ async function resolvePostRef(client, ref) {
|
|
|
2300
2360
|
var import_node_child_process = require("child_process");
|
|
2301
2361
|
var import_promises6 = __toESM(require("fs/promises"));
|
|
2302
2362
|
var import_tmp = __toESM(require("tmp"));
|
|
2303
|
-
var import_js_yaml =
|
|
2363
|
+
var import_js_yaml = require("js-yaml");
|
|
2304
2364
|
function openInEditor(content) {
|
|
2305
2365
|
const editor2 = process.env.EDITOR;
|
|
2306
2366
|
if (!editor2) {
|
|
@@ -2364,8 +2424,8 @@ function serializePostFrontmatter(post, members) {
|
|
|
2364
2424
|
return "";
|
|
2365
2425
|
}).filter(Boolean)
|
|
2366
2426
|
};
|
|
2367
|
-
const yamlStr = import_js_yaml.
|
|
2368
|
-
|
|
2427
|
+
const yamlStr = (0, import_js_yaml.dump)(frontmatter, {
|
|
2428
|
+
quoteStyle: "double",
|
|
2369
2429
|
forceQuotes: false,
|
|
2370
2430
|
lineWidth: -1
|
|
2371
2431
|
});
|
|
@@ -2381,7 +2441,7 @@ function parsePostFrontmatter(content) {
|
|
|
2381
2441
|
EXIT_PARAM_ERROR
|
|
2382
2442
|
);
|
|
2383
2443
|
}
|
|
2384
|
-
const frontmatter = import_js_yaml.
|
|
2444
|
+
const frontmatter = (0, import_js_yaml.load)(match[1]);
|
|
2385
2445
|
const body = match[2];
|
|
2386
2446
|
return {
|
|
2387
2447
|
subject: frontmatter.subject ?? "",
|
|
@@ -2396,8 +2456,8 @@ function serializeWikiFrontmatter(page) {
|
|
|
2396
2456
|
const frontmatter = {
|
|
2397
2457
|
title: page.subject
|
|
2398
2458
|
};
|
|
2399
|
-
const yamlStr = import_js_yaml.
|
|
2400
|
-
|
|
2459
|
+
const yamlStr = (0, import_js_yaml.dump)(frontmatter, {
|
|
2460
|
+
quoteStyle: "double",
|
|
2401
2461
|
forceQuotes: false,
|
|
2402
2462
|
lineWidth: -1
|
|
2403
2463
|
});
|
|
@@ -2413,7 +2473,7 @@ function parseWikiFrontmatter(content) {
|
|
|
2413
2473
|
EXIT_PARAM_ERROR
|
|
2414
2474
|
);
|
|
2415
2475
|
}
|
|
2416
|
-
const frontmatter = import_js_yaml.
|
|
2476
|
+
const frontmatter = (0, import_js_yaml.load)(match[1]);
|
|
2417
2477
|
const body = match[2];
|
|
2418
2478
|
return {
|
|
2419
2479
|
title: frontmatter.title ?? "",
|
|
@@ -3845,13 +3905,15 @@ function emitDownloadAllResult(globalOpts, data) {
|
|
|
3845
3905
|
}
|
|
3846
3906
|
}
|
|
3847
3907
|
function emitDeleteResult(globalOpts, result) {
|
|
3908
|
+
const jsonKey = result.jsonKey ?? "fileId";
|
|
3909
|
+
const message = result.message ?? `\uD30C\uC77C(${result.id})\uC774 \uC0AD\uC81C\uB418\uC5C8\uC2B5\uB2C8\uB2E4.`;
|
|
3848
3910
|
if (globalOpts.json) {
|
|
3849
|
-
printJson({
|
|
3911
|
+
printJson({ [jsonKey]: result.id, status: "deleted" });
|
|
3850
3912
|
} else if (globalOpts.quiet) {
|
|
3851
|
-
process.stdout.write(`${result.
|
|
3913
|
+
process.stdout.write(`${result.id}
|
|
3852
3914
|
`);
|
|
3853
3915
|
} else {
|
|
3854
|
-
process.stdout.write(
|
|
3916
|
+
process.stdout.write(`${message}
|
|
3855
3917
|
`);
|
|
3856
3918
|
}
|
|
3857
3919
|
}
|
|
@@ -4078,7 +4140,7 @@ var fileDeleteCommand = new import_commander33.Command("delete").description("\u
|
|
|
4078
4140
|
});
|
|
4079
4141
|
await client.deletePostFile(projectId, postId, fileId);
|
|
4080
4142
|
stopSpinner(true, "\uC0AD\uC81C \uC644\uB8CC");
|
|
4081
|
-
emitDeleteResult(globalOpts, { fileId });
|
|
4143
|
+
emitDeleteResult(globalOpts, { id: fileId });
|
|
4082
4144
|
});
|
|
4083
4145
|
|
|
4084
4146
|
// src/commands/wiki/list.ts
|
|
@@ -4105,6 +4167,55 @@ function formatWikiPages(pages, opts) {
|
|
|
4105
4167
|
ids: pages.map((p) => p.id)
|
|
4106
4168
|
});
|
|
4107
4169
|
}
|
|
4170
|
+
function buildWikiTree(pages) {
|
|
4171
|
+
const ids = new Set(pages.map((p) => p.id));
|
|
4172
|
+
const childrenByParent = /* @__PURE__ */ new Map();
|
|
4173
|
+
const roots = [];
|
|
4174
|
+
for (const page of pages) {
|
|
4175
|
+
const parentId = page.parentPageId;
|
|
4176
|
+
const isRoot = page.root === true || !parentId || !ids.has(parentId);
|
|
4177
|
+
if (isRoot) {
|
|
4178
|
+
roots.push(page);
|
|
4179
|
+
continue;
|
|
4180
|
+
}
|
|
4181
|
+
const siblings = childrenByParent.get(parentId) ?? [];
|
|
4182
|
+
siblings.push(page);
|
|
4183
|
+
childrenByParent.set(parentId, siblings);
|
|
4184
|
+
}
|
|
4185
|
+
const toNode = (page) => ({
|
|
4186
|
+
page,
|
|
4187
|
+
children: (childrenByParent.get(page.id) ?? []).map(toNode)
|
|
4188
|
+
});
|
|
4189
|
+
return roots.map(toNode);
|
|
4190
|
+
}
|
|
4191
|
+
function normalizeSubject(subject) {
|
|
4192
|
+
return subject.replace(/[\r\n]+/g, " ");
|
|
4193
|
+
}
|
|
4194
|
+
function renderWikiTree(nodes, prefix = "") {
|
|
4195
|
+
const lines = [];
|
|
4196
|
+
nodes.forEach((node, index) => {
|
|
4197
|
+
const isLast = index === nodes.length - 1;
|
|
4198
|
+
const connector = isLast ? "\u2514\u2500" : "\u251C\u2500";
|
|
4199
|
+
const subject = normalizeSubject(node.page.subject);
|
|
4200
|
+
lines.push(`${prefix}${connector}${subject} (${node.page.id})`);
|
|
4201
|
+
if (node.children.length > 0) {
|
|
4202
|
+
const childPrefix = prefix + (isLast ? " " : "\u2502 ");
|
|
4203
|
+
lines.push(renderWikiTree(node.children, childPrefix));
|
|
4204
|
+
}
|
|
4205
|
+
});
|
|
4206
|
+
return lines.join("\n");
|
|
4207
|
+
}
|
|
4208
|
+
function formatWikiTree(pages, opts) {
|
|
4209
|
+
if (opts.json) {
|
|
4210
|
+
printJson(pages);
|
|
4211
|
+
return;
|
|
4212
|
+
}
|
|
4213
|
+
if (opts.quiet) {
|
|
4214
|
+
printQuiet(pages.map((p) => p.id));
|
|
4215
|
+
return;
|
|
4216
|
+
}
|
|
4217
|
+
process.stdout.write(renderWikiTree(buildWikiTree(pages)) + "\n");
|
|
4218
|
+
}
|
|
4108
4219
|
function formatWikiPageDetail(page, opts) {
|
|
4109
4220
|
if (opts.json) {
|
|
4110
4221
|
printJson(page);
|
|
@@ -4194,9 +4305,30 @@ var wikiPagesCommand = new import_commander35.Command("pages").description("\uC7
|
|
|
4194
4305
|
formatWikiPages(res.result, globalOpts);
|
|
4195
4306
|
});
|
|
4196
4307
|
|
|
4197
|
-
// src/commands/wiki/
|
|
4308
|
+
// src/commands/wiki/tree.ts
|
|
4198
4309
|
var import_commander36 = require("commander");
|
|
4199
|
-
var
|
|
4310
|
+
var wikiTreeCommand = new import_commander36.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
|
+
const globalOpts = wikiTreeCommand.optsWithGlobals();
|
|
4312
|
+
const config = await getConfigOrThrow();
|
|
4313
|
+
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
4314
|
+
let maxDepth;
|
|
4315
|
+
if (opts.depth !== void 0) {
|
|
4316
|
+
const parsed = Number(opts.depth);
|
|
4317
|
+
if (!Number.isInteger(parsed) || parsed < 1) {
|
|
4318
|
+
throw new DoorayCliError("--depth \uB294 1 \uC774\uC0C1\uC758 \uC815\uC218\uC5EC\uC57C \uD569\uB2C8\uB2E4", EXIT_PARAM_ERROR);
|
|
4319
|
+
}
|
|
4320
|
+
maxDepth = parsed;
|
|
4321
|
+
}
|
|
4322
|
+
startSpinner("\uC704\uD0A4 \uD398\uC774\uC9C0 \uD2B8\uB9AC \uC870\uD68C \uC911...");
|
|
4323
|
+
const wikiId = await resolveWiki(client, project);
|
|
4324
|
+
const pages = await client.getAllWikiPages(wikiId, maxDepth);
|
|
4325
|
+
stopSpinner(true, "\uC704\uD0A4 \uD398\uC774\uC9C0 \uD2B8\uB9AC \uC870\uD68C \uC644\uB8CC");
|
|
4326
|
+
formatWikiTree(pages, globalOpts);
|
|
4327
|
+
});
|
|
4328
|
+
|
|
4329
|
+
// src/commands/wiki/page-get.ts
|
|
4330
|
+
var import_commander37 = require("commander");
|
|
4331
|
+
var wikiPageGetCommand = new import_commander37.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) => {
|
|
4200
4332
|
const globalOpts = wikiPageGetCommand.optsWithGlobals();
|
|
4201
4333
|
const config = await getConfigOrThrow();
|
|
4202
4334
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -4208,8 +4340,8 @@ var wikiPageGetCommand = new import_commander36.Command("get").description("\uC7
|
|
|
4208
4340
|
});
|
|
4209
4341
|
|
|
4210
4342
|
// src/commands/wiki/page-create.ts
|
|
4211
|
-
var
|
|
4212
|
-
var wikiPageCreateCommand = new
|
|
4343
|
+
var import_commander38 = require("commander");
|
|
4344
|
+
var wikiPageCreateCommand = new import_commander38.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) => {
|
|
4213
4345
|
const globalOpts = wikiPageCreateCommand.optsWithGlobals();
|
|
4214
4346
|
const config = await getConfigOrThrow();
|
|
4215
4347
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -4234,8 +4366,8 @@ var wikiPageCreateCommand = new import_commander37.Command("create").description
|
|
|
4234
4366
|
});
|
|
4235
4367
|
|
|
4236
4368
|
// src/commands/wiki/page-edit.ts
|
|
4237
|
-
var
|
|
4238
|
-
var wikiPageEditCommand = new
|
|
4369
|
+
var import_commander39 = require("commander");
|
|
4370
|
+
var wikiPageEditCommand = new import_commander39.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) => {
|
|
4239
4371
|
const config = await getConfigOrThrow();
|
|
4240
4372
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
4241
4373
|
const hasTitle = opts.title != null;
|
|
@@ -4287,11 +4419,8 @@ var wikiPageEditCommand = new import_commander38.Command("edit").description("\u
|
|
|
4287
4419
|
`);
|
|
4288
4420
|
});
|
|
4289
4421
|
|
|
4290
|
-
// src/commands/wiki/page-
|
|
4291
|
-
var
|
|
4292
|
-
|
|
4293
|
-
// src/commands/wiki/page-file/list.ts
|
|
4294
|
-
var import_commander39 = require("commander");
|
|
4422
|
+
// src/commands/wiki/page-delete.ts
|
|
4423
|
+
var import_commander40 = require("commander");
|
|
4295
4424
|
|
|
4296
4425
|
// src/resolvers/wiki-page-input.ts
|
|
4297
4426
|
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>";
|
|
@@ -4347,13 +4476,63 @@ async function resolveWikiPageInput(client, args) {
|
|
|
4347
4476
|
throw new DoorayCliError(INPUT_HELP2, EXIT_PARAM_ERROR);
|
|
4348
4477
|
}
|
|
4349
4478
|
|
|
4479
|
+
// src/commands/wiki/page-delete.ts
|
|
4480
|
+
var wikiPageDeleteCommand = new import_commander40.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
|
+
const globalOpts = wikiPageDeleteCommand.optsWithGlobals();
|
|
4482
|
+
const config = await getConfigOrThrow();
|
|
4483
|
+
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
4484
|
+
const { wikiId, pageId } = await resolveWikiPageInput(client, {
|
|
4485
|
+
projectArg: arg1,
|
|
4486
|
+
pageIdArg: arg2,
|
|
4487
|
+
idOpt: opts.id,
|
|
4488
|
+
urlOpt: opts.url,
|
|
4489
|
+
project: opts.project
|
|
4490
|
+
});
|
|
4491
|
+
if (!opts.yes) {
|
|
4492
|
+
if (!process.stdin.isTTY) {
|
|
4493
|
+
throw new DoorayCliError(
|
|
4494
|
+
"non-TTY \uD658\uACBD\uC5D0\uC11C\uB294 \uD655\uC778 \uC5C6\uC774 \uC0AD\uC81C\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. --yes(-y) \uD50C\uB798\uADF8\uB85C \uB2E4\uC2DC \uC2E4\uD589\uD558\uC138\uC694.",
|
|
4495
|
+
EXIT_PARAM_ERROR
|
|
4496
|
+
);
|
|
4497
|
+
}
|
|
4498
|
+
const { confirm: confirm2 } = await import("@inquirer/prompts");
|
|
4499
|
+
const ok = await confirm2({
|
|
4500
|
+
message: `\uD398\uC774\uC9C0(${pageId})\uB97C \uC0AD\uC81C\uD560\uAE4C\uC694? \uD558\uC704 \uD398\uC774\uC9C0\uAC00 \uC788\uC73C\uBA74 \uC0C1\uC704 \uD398\uC774\uC9C0\uB85C \uC7AC\uBD80\uCC29\uB429\uB2C8\uB2E4.`,
|
|
4501
|
+
default: false
|
|
4502
|
+
});
|
|
4503
|
+
if (!ok) {
|
|
4504
|
+
if (!globalOpts.json && !globalOpts.quiet) {
|
|
4505
|
+
process.stdout.write("\uCDE8\uC18C\uB418\uC5C8\uC2B5\uB2C8\uB2E4.\n");
|
|
4506
|
+
}
|
|
4507
|
+
return;
|
|
4508
|
+
}
|
|
4509
|
+
}
|
|
4510
|
+
startSpinner("\uD398\uC774\uC9C0 \uC0AD\uC81C \uC911...");
|
|
4511
|
+
try {
|
|
4512
|
+
await client.deleteWikiPage(wikiId, pageId);
|
|
4513
|
+
stopSpinner(true, "\uC0AD\uC81C \uC644\uB8CC");
|
|
4514
|
+
emitDeleteResult(globalOpts, {
|
|
4515
|
+
id: pageId,
|
|
4516
|
+
jsonKey: "pageId",
|
|
4517
|
+
message: `\uD398\uC774\uC9C0(${pageId})\uAC00 \uC0AD\uC81C\uB418\uC5C8\uC2B5\uB2C8\uB2E4.`
|
|
4518
|
+
});
|
|
4519
|
+
} catch (e) {
|
|
4520
|
+
stopSpinner(false);
|
|
4521
|
+
throw e;
|
|
4522
|
+
}
|
|
4523
|
+
});
|
|
4524
|
+
|
|
4525
|
+
// src/commands/wiki/page-file/index.ts
|
|
4526
|
+
var import_commander46 = require("commander");
|
|
4527
|
+
|
|
4350
4528
|
// src/commands/wiki/page-file/list.ts
|
|
4529
|
+
var import_commander41 = require("commander");
|
|
4351
4530
|
function formatSize3(bytes) {
|
|
4352
4531
|
if (bytes < 1024) return `${bytes}B`;
|
|
4353
4532
|
if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)}KB`;
|
|
4354
4533
|
return `${(bytes / (1024 * 1024)).toFixed(1)}MB`;
|
|
4355
4534
|
}
|
|
4356
|
-
var wikiPageFileListCommand = new
|
|
4535
|
+
var wikiPageFileListCommand = new import_commander41.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) => {
|
|
4357
4536
|
const globalOpts = wikiPageFileListCommand.optsWithGlobals();
|
|
4358
4537
|
const config = await getConfigOrThrow();
|
|
4359
4538
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -4384,7 +4563,7 @@ var wikiPageFileListCommand = new import_commander39.Command("list").description
|
|
|
4384
4563
|
});
|
|
4385
4564
|
|
|
4386
4565
|
// src/commands/wiki/page-file/upload.ts
|
|
4387
|
-
var
|
|
4566
|
+
var import_commander42 = require("commander");
|
|
4388
4567
|
|
|
4389
4568
|
// src/utils/wiki-snippet.ts
|
|
4390
4569
|
function wikiInlineImageSnippet(wikiId, attachFileId, name) {
|
|
@@ -4392,7 +4571,7 @@ function wikiInlineImageSnippet(wikiId, attachFileId, name) {
|
|
|
4392
4571
|
}
|
|
4393
4572
|
|
|
4394
4573
|
// src/commands/wiki/page-file/upload.ts
|
|
4395
|
-
var wikiPageFileUploadCommand = new
|
|
4574
|
+
var wikiPageFileUploadCommand = new import_commander42.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) => {
|
|
4396
4575
|
const globalOpts = wikiPageFileUploadCommand.optsWithGlobals();
|
|
4397
4576
|
const config = await getConfigOrThrow();
|
|
4398
4577
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -4487,10 +4666,10 @@ var wikiPageFileUploadCommand = new import_commander40.Command("upload").descrip
|
|
|
4487
4666
|
});
|
|
4488
4667
|
|
|
4489
4668
|
// src/commands/wiki/page-file/download.ts
|
|
4490
|
-
var
|
|
4669
|
+
var import_commander43 = require("commander");
|
|
4491
4670
|
var import_promises11 = require("fs/promises");
|
|
4492
4671
|
var import_node_path9 = require("path");
|
|
4493
|
-
var wikiPageFileDownloadCommand = new
|
|
4672
|
+
var wikiPageFileDownloadCommand = new import_commander43.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) => {
|
|
4494
4673
|
const globalOpts = wikiPageFileDownloadCommand.optsWithGlobals();
|
|
4495
4674
|
const config = await getConfigOrThrow();
|
|
4496
4675
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -4552,10 +4731,10 @@ var wikiPageFileDownloadCommand = new import_commander41.Command("download").des
|
|
|
4552
4731
|
});
|
|
4553
4732
|
|
|
4554
4733
|
// src/commands/wiki/page-file/download-all.ts
|
|
4555
|
-
var
|
|
4734
|
+
var import_commander44 = require("commander");
|
|
4556
4735
|
var import_promises12 = require("fs/promises");
|
|
4557
4736
|
var import_node_path10 = require("path");
|
|
4558
|
-
var wikiPageFileDownloadAllCommand = new
|
|
4737
|
+
var wikiPageFileDownloadAllCommand = new import_commander44.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) => {
|
|
4559
4738
|
const globalOpts = wikiPageFileDownloadAllCommand.optsWithGlobals();
|
|
4560
4739
|
const config = await getConfigOrThrow();
|
|
4561
4740
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -4612,8 +4791,8 @@ var wikiPageFileDownloadAllCommand = new import_commander42.Command("download-al
|
|
|
4612
4791
|
});
|
|
4613
4792
|
|
|
4614
4793
|
// src/commands/wiki/page-file/delete.ts
|
|
4615
|
-
var
|
|
4616
|
-
var wikiPageFileDeleteCommand = new
|
|
4794
|
+
var import_commander45 = require("commander");
|
|
4795
|
+
var wikiPageFileDeleteCommand = new import_commander45.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) => {
|
|
4617
4796
|
const globalOpts = wikiPageFileDeleteCommand.optsWithGlobals();
|
|
4618
4797
|
const config = await getConfigOrThrow();
|
|
4619
4798
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -4664,7 +4843,7 @@ var wikiPageFileDeleteCommand = new import_commander43.Command("delete").descrip
|
|
|
4664
4843
|
try {
|
|
4665
4844
|
await client.deleteWikiPageFile(wikiId, pageId, fileId);
|
|
4666
4845
|
stopSpinner(true, "\uC0AD\uC81C \uC644\uB8CC");
|
|
4667
|
-
emitDeleteResult(globalOpts, { fileId });
|
|
4846
|
+
emitDeleteResult(globalOpts, { id: fileId });
|
|
4668
4847
|
} catch (e) {
|
|
4669
4848
|
stopSpinner(false);
|
|
4670
4849
|
throw e;
|
|
@@ -4672,7 +4851,7 @@ var wikiPageFileDeleteCommand = new import_commander43.Command("delete").descrip
|
|
|
4672
4851
|
});
|
|
4673
4852
|
|
|
4674
4853
|
// src/commands/wiki/page-file/index.ts
|
|
4675
|
-
var wikiPageFileCommand = new
|
|
4854
|
+
var wikiPageFileCommand = new import_commander46.Command("file").description("\uC704\uD0A4 \uD398\uC774\uC9C0 \uCCA8\uBD80\uD30C\uC77C \uAD00\uB828 \uBA85\uB839 (Issue #70, ADR-029)");
|
|
4676
4855
|
wikiPageFileCommand.addCommand(wikiPageFileListCommand);
|
|
4677
4856
|
wikiPageFileCommand.addCommand(wikiPageFileUploadCommand);
|
|
4678
4857
|
wikiPageFileCommand.addCommand(wikiPageFileDownloadCommand);
|
|
@@ -4680,10 +4859,10 @@ wikiPageFileCommand.addCommand(wikiPageFileDownloadAllCommand);
|
|
|
4680
4859
|
wikiPageFileCommand.addCommand(wikiPageFileDeleteCommand);
|
|
4681
4860
|
|
|
4682
4861
|
// src/commands/wiki/page-comment/index.ts
|
|
4683
|
-
var
|
|
4862
|
+
var import_commander53 = require("commander");
|
|
4684
4863
|
|
|
4685
4864
|
// src/commands/wiki/page-comment/list.ts
|
|
4686
|
-
var
|
|
4865
|
+
var import_commander47 = require("commander");
|
|
4687
4866
|
|
|
4688
4867
|
// src/formatters/wiki-comment.ts
|
|
4689
4868
|
function formatWikiCommentList(comments, opts) {
|
|
@@ -4730,7 +4909,7 @@ function truncate(s, n) {
|
|
|
4730
4909
|
}
|
|
4731
4910
|
|
|
4732
4911
|
// src/commands/wiki/page-comment/list.ts
|
|
4733
|
-
var wikiPageCommentListCommand = new
|
|
4912
|
+
var wikiPageCommentListCommand = new import_commander47.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) => {
|
|
4734
4913
|
const globalOpts = wikiPageCommentListCommand.optsWithGlobals();
|
|
4735
4914
|
const config = await getConfigOrThrow();
|
|
4736
4915
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -4755,8 +4934,8 @@ var wikiPageCommentListCommand = new import_commander45.Command("list").descript
|
|
|
4755
4934
|
});
|
|
4756
4935
|
|
|
4757
4936
|
// src/commands/wiki/page-comment/latest.ts
|
|
4758
|
-
var
|
|
4759
|
-
var wikiPageCommentLatestCommand = new
|
|
4937
|
+
var import_commander48 = require("commander");
|
|
4938
|
+
var wikiPageCommentLatestCommand = new import_commander48.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) => {
|
|
4760
4939
|
const globalOpts = wikiPageCommentLatestCommand.optsWithGlobals();
|
|
4761
4940
|
const config = await getConfigOrThrow();
|
|
4762
4941
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -4783,7 +4962,7 @@ var wikiPageCommentLatestCommand = new import_commander46.Command("latest").desc
|
|
|
4783
4962
|
});
|
|
4784
4963
|
|
|
4785
4964
|
// src/commands/wiki/page-comment/get.ts
|
|
4786
|
-
var
|
|
4965
|
+
var import_commander49 = require("commander");
|
|
4787
4966
|
|
|
4788
4967
|
// src/commands/wiki/page-comment/parse-args.ts
|
|
4789
4968
|
function parseWikiCommentArgs(arg1, arg2, arg3, opts) {
|
|
@@ -4836,7 +5015,7 @@ function parseWikiCommentArgs(arg1, arg2, arg3, opts) {
|
|
|
4836
5015
|
}
|
|
4837
5016
|
|
|
4838
5017
|
// src/commands/wiki/page-comment/get.ts
|
|
4839
|
-
var wikiPageCommentGetCommand = new
|
|
5018
|
+
var wikiPageCommentGetCommand = new import_commander49.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) => {
|
|
4840
5019
|
const parsed = parseWikiCommentArgs(arg1, arg2, arg3, opts);
|
|
4841
5020
|
const config = await getConfigOrThrow();
|
|
4842
5021
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -4860,8 +5039,8 @@ var wikiPageCommentGetCommand = new import_commander47.Command("get").descriptio
|
|
|
4860
5039
|
});
|
|
4861
5040
|
|
|
4862
5041
|
// src/commands/wiki/page-comment/add.ts
|
|
4863
|
-
var
|
|
4864
|
-
var wikiPageCommentAddCommand = new
|
|
5042
|
+
var import_commander50 = require("commander");
|
|
5043
|
+
var wikiPageCommentAddCommand = new import_commander50.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) => {
|
|
4865
5044
|
if ((opts.id || opts.url) && (project || pageIdArg)) {
|
|
4866
5045
|
throw new DoorayCliError(
|
|
4867
5046
|
"positional \uC778\uC790\uC640 --id/--url \uC635\uC158\uC740 \uB3D9\uC2DC\uC5D0 \uC0AC\uC6A9\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.",
|
|
@@ -4907,8 +5086,8 @@ var wikiPageCommentAddCommand = new import_commander48.Command("add").descriptio
|
|
|
4907
5086
|
});
|
|
4908
5087
|
|
|
4909
5088
|
// src/commands/wiki/page-comment/edit.ts
|
|
4910
|
-
var
|
|
4911
|
-
var wikiPageCommentEditCommand = new
|
|
5089
|
+
var import_commander51 = require("commander");
|
|
5090
|
+
var wikiPageCommentEditCommand = new import_commander51.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) => {
|
|
4912
5091
|
const parsed = parseWikiCommentArgs(arg1, arg2, arg3, opts);
|
|
4913
5092
|
const config = await getConfigOrThrow();
|
|
4914
5093
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -4952,8 +5131,8 @@ var wikiPageCommentEditCommand = new import_commander49.Command("edit").descript
|
|
|
4952
5131
|
});
|
|
4953
5132
|
|
|
4954
5133
|
// src/commands/wiki/page-comment/delete.ts
|
|
4955
|
-
var
|
|
4956
|
-
var wikiPageCommentDeleteCommand = new
|
|
5134
|
+
var import_commander52 = require("commander");
|
|
5135
|
+
var wikiPageCommentDeleteCommand = new import_commander52.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) => {
|
|
4957
5136
|
const parsed = parseWikiCommentArgs(arg1, arg2, arg3, opts);
|
|
4958
5137
|
const config = await getConfigOrThrow();
|
|
4959
5138
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -4977,7 +5156,7 @@ var wikiPageCommentDeleteCommand = new import_commander50.Command("delete").desc
|
|
|
4977
5156
|
});
|
|
4978
5157
|
|
|
4979
5158
|
// src/commands/wiki/page-comment/index.ts
|
|
4980
|
-
var wikiPageCommentCommand = new
|
|
5159
|
+
var wikiPageCommentCommand = new import_commander53.Command("comment").description("\uC704\uD0A4 \uD398\uC774\uC9C0 \uB313\uAE00 \uAD00\uB828 \uBA85\uB839");
|
|
4981
5160
|
wikiPageCommentCommand.addCommand(wikiPageCommentListCommand);
|
|
4982
5161
|
wikiPageCommentCommand.addCommand(wikiPageCommentLatestCommand);
|
|
4983
5162
|
wikiPageCommentCommand.addCommand(wikiPageCommentGetCommand);
|
|
@@ -4986,10 +5165,10 @@ wikiPageCommentCommand.addCommand(wikiPageCommentEditCommand);
|
|
|
4986
5165
|
wikiPageCommentCommand.addCommand(wikiPageCommentDeleteCommand);
|
|
4987
5166
|
|
|
4988
5167
|
// src/commands/member/index.ts
|
|
4989
|
-
var
|
|
5168
|
+
var import_commander57 = require("commander");
|
|
4990
5169
|
|
|
4991
5170
|
// src/commands/member/get.ts
|
|
4992
|
-
var
|
|
5171
|
+
var import_commander54 = require("commander");
|
|
4993
5172
|
|
|
4994
5173
|
// src/formatters/member.ts
|
|
4995
5174
|
function formatMemberDetail(member, opts) {
|
|
@@ -5035,7 +5214,7 @@ function formatMemberSearchResults(members, opts) {
|
|
|
5035
5214
|
}
|
|
5036
5215
|
|
|
5037
5216
|
// src/commands/member/get.ts
|
|
5038
|
-
var memberGetCommand = new
|
|
5217
|
+
var memberGetCommand = new import_commander54.Command("get").description("\uBA64\uBC84 \uC0C1\uC138 \uC815\uBCF4 \uC870\uD68C (organizationMemberId)").argument("<member-id>", "\uC870\uD68C\uD560 organization member ID").action(async (memberId) => {
|
|
5039
5218
|
const globalOpts = memberGetCommand.optsWithGlobals();
|
|
5040
5219
|
const config = await getConfigOrThrow();
|
|
5041
5220
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -5044,8 +5223,8 @@ var memberGetCommand = new import_commander52.Command("get").description("\uBA64
|
|
|
5044
5223
|
});
|
|
5045
5224
|
|
|
5046
5225
|
// src/commands/member/list.ts
|
|
5047
|
-
var
|
|
5048
|
-
var memberListCommand = new
|
|
5226
|
+
var import_commander55 = require("commander");
|
|
5227
|
+
var memberListCommand = new import_commander55.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) => {
|
|
5049
5228
|
const globalOpts = memberListCommand.optsWithGlobals();
|
|
5050
5229
|
const config = await getConfigOrThrow();
|
|
5051
5230
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -5060,8 +5239,8 @@ var memberListCommand = new import_commander53.Command("list").description("\uD5
|
|
|
5060
5239
|
});
|
|
5061
5240
|
|
|
5062
5241
|
// src/commands/member/search.ts
|
|
5063
|
-
var
|
|
5064
|
-
var memberSearchCommand = new
|
|
5242
|
+
var import_commander56 = require("commander");
|
|
5243
|
+
var memberSearchCommand = new import_commander56.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) => {
|
|
5065
5244
|
const globalOpts = memberSearchCommand.optsWithGlobals();
|
|
5066
5245
|
const filterCount = [keyword, opts.email, opts.userCode, opts.userCodeExact].filter(Boolean).length;
|
|
5067
5246
|
if (filterCount === 0) {
|
|
@@ -5094,13 +5273,13 @@ var memberSearchCommand = new import_commander54.Command("search").description("
|
|
|
5094
5273
|
});
|
|
5095
5274
|
|
|
5096
5275
|
// src/commands/member/index.ts
|
|
5097
|
-
var memberCommand = new
|
|
5276
|
+
var memberCommand = new import_commander57.Command("member").description("Dooray \uBA64\uBC84 \uC870\uD68C");
|
|
5098
5277
|
memberCommand.addCommand(memberGetCommand);
|
|
5099
5278
|
memberCommand.addCommand(memberListCommand);
|
|
5100
5279
|
memberCommand.addCommand(memberSearchCommand);
|
|
5101
5280
|
|
|
5102
5281
|
// src/commands/mail/list.ts
|
|
5103
|
-
var
|
|
5282
|
+
var import_commander58 = require("commander");
|
|
5104
5283
|
|
|
5105
5284
|
// src/api/imapClient.ts
|
|
5106
5285
|
var import_imapflow = require("imapflow");
|
|
@@ -5217,7 +5396,7 @@ async function getMail(config, uid) {
|
|
|
5217
5396
|
|
|
5218
5397
|
// src/commands/mail/list.ts
|
|
5219
5398
|
var import_chalk5 = __toESM(require("chalk"));
|
|
5220
|
-
var mailListCommand = new
|
|
5399
|
+
var mailListCommand = new import_commander58.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) => {
|
|
5221
5400
|
const globalOpts = mailListCommand.optsWithGlobals();
|
|
5222
5401
|
const config = await getConfigOrThrow();
|
|
5223
5402
|
startSpinner("\uBA54\uC77C \uC870\uD68C \uC911...");
|
|
@@ -5249,9 +5428,9 @@ var mailListCommand = new import_commander56.Command("list").description("\uBA54
|
|
|
5249
5428
|
});
|
|
5250
5429
|
|
|
5251
5430
|
// src/commands/mail/get.ts
|
|
5252
|
-
var
|
|
5431
|
+
var import_commander59 = require("commander");
|
|
5253
5432
|
var import_chalk6 = __toESM(require("chalk"));
|
|
5254
|
-
var mailGetCommand = new
|
|
5433
|
+
var mailGetCommand = new import_commander59.Command("get").description("\uBA54\uC77C \uC0C1\uC138 \uC870\uD68C").argument("<uid>", "\uBA54\uC77C UID").action(async (uid) => {
|
|
5255
5434
|
const globalOpts = mailGetCommand.optsWithGlobals();
|
|
5256
5435
|
const config = await getConfigOrThrow();
|
|
5257
5436
|
startSpinner("\uBA54\uC77C \uC870\uD68C \uC911...");
|
|
@@ -5282,7 +5461,7 @@ ${mail.body}
|
|
|
5282
5461
|
});
|
|
5283
5462
|
|
|
5284
5463
|
// src/commands/mail/send.ts
|
|
5285
|
-
var
|
|
5464
|
+
var import_commander60 = require("commander");
|
|
5286
5465
|
var import_promises13 = require("fs/promises");
|
|
5287
5466
|
|
|
5288
5467
|
// src/api/smtpClient.ts
|
|
@@ -5332,7 +5511,7 @@ async function sendMail(config, opts) {
|
|
|
5332
5511
|
}
|
|
5333
5512
|
|
|
5334
5513
|
// src/commands/mail/send.ts
|
|
5335
|
-
var mailSendCommand = new
|
|
5514
|
+
var mailSendCommand = new import_commander60.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) => {
|
|
5336
5515
|
const globalOpts = mailSendCommand.optsWithGlobals();
|
|
5337
5516
|
const config = await getConfigOrThrow();
|
|
5338
5517
|
let body = opts.body ?? "";
|
|
@@ -5367,7 +5546,7 @@ var mailSendCommand = new import_commander58.Command("send").description("\uBA54
|
|
|
5367
5546
|
});
|
|
5368
5547
|
|
|
5369
5548
|
// src/commands/mail/reply.ts
|
|
5370
|
-
var
|
|
5549
|
+
var import_commander61 = require("commander");
|
|
5371
5550
|
var import_promises14 = require("fs/promises");
|
|
5372
5551
|
var import_imapflow2 = require("imapflow");
|
|
5373
5552
|
async function getMessageId(config, uid) {
|
|
@@ -5396,7 +5575,7 @@ async function getMessageId(config, uid) {
|
|
|
5396
5575
|
await client.logout();
|
|
5397
5576
|
}
|
|
5398
5577
|
}
|
|
5399
|
-
var mailReplyCommand = new
|
|
5578
|
+
var mailReplyCommand = new import_commander61.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) => {
|
|
5400
5579
|
const globalOpts = mailReplyCommand.optsWithGlobals();
|
|
5401
5580
|
const config = await getConfigOrThrow();
|
|
5402
5581
|
let body = opts.body ?? "";
|
|
@@ -5436,8 +5615,109 @@ var mailReplyCommand = new import_commander59.Command("reply").description("\uBA
|
|
|
5436
5615
|
}
|
|
5437
5616
|
});
|
|
5438
5617
|
|
|
5618
|
+
// src/commands/messenger/index.ts
|
|
5619
|
+
var import_commander64 = require("commander");
|
|
5620
|
+
|
|
5621
|
+
// src/commands/messenger/send.ts
|
|
5622
|
+
var import_commander62 = require("commander");
|
|
5623
|
+
var messengerSendCommand = new import_commander62.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
|
+
if (!opts.to) {
|
|
5625
|
+
throw new DoorayCliError("--to \uC635\uC158\uC740 \uD544\uC218\uC785\uB2C8\uB2E4.", EXIT_PARAM_ERROR);
|
|
5626
|
+
}
|
|
5627
|
+
const globalOpts = messengerSendCommand.optsWithGlobals();
|
|
5628
|
+
const config = await getConfigOrThrow();
|
|
5629
|
+
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
5630
|
+
const memberId = await resolveMemberByIdOrEmail(client, opts.to);
|
|
5631
|
+
if (memberId == null) {
|
|
5632
|
+
throw new DoorayCliError(
|
|
5633
|
+
`--to \uB294 organizationMemberId \uB610\uB294 \uC774\uBA54\uC77C\uB9CC \uC9C0\uC6D0\uD569\uB2C8\uB2E4 (\uC774\uB984 \uBBF8\uC9C0\uC6D0): "${opts.to}"`,
|
|
5634
|
+
EXIT_PARAM_ERROR
|
|
5635
|
+
);
|
|
5636
|
+
}
|
|
5637
|
+
let bodyContent = await readBodyInputOrNull(opts);
|
|
5638
|
+
if (bodyContent == null) {
|
|
5639
|
+
bodyContent = await openInEditor("");
|
|
5640
|
+
}
|
|
5641
|
+
if (!bodyContent.trim()) {
|
|
5642
|
+
throw new DoorayCliError("\uBE48 \uBA54\uC2DC\uC9C0\uB294 \uC804\uC1A1\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.", EXIT_PARAM_ERROR);
|
|
5643
|
+
}
|
|
5644
|
+
startSpinner("\uBA54\uC2DC\uC9C0 \uC804\uC1A1 \uC911...");
|
|
5645
|
+
try {
|
|
5646
|
+
const res = await client.sendDirectMessage(memberId, bodyContent);
|
|
5647
|
+
stopSpinner(true, `\uBA54\uC2DC\uC9C0\uB97C \uC804\uC1A1\uD588\uC2B5\uB2C8\uB2E4 (log-id: ${res.result.id})`);
|
|
5648
|
+
if (globalOpts.json) {
|
|
5649
|
+
printJson(res.result);
|
|
5650
|
+
} else if (globalOpts.quiet) {
|
|
5651
|
+
printQuiet([res.result.id]);
|
|
5652
|
+
} else {
|
|
5653
|
+
process.stdout.write(`\uBA54\uC2DC\uC9C0\uB97C \uC804\uC1A1\uD588\uC2B5\uB2C8\uB2E4 (log-id: ${res.result.id})
|
|
5654
|
+
`);
|
|
5655
|
+
}
|
|
5656
|
+
} catch (e) {
|
|
5657
|
+
stopSpinner(false);
|
|
5658
|
+
throw e;
|
|
5659
|
+
}
|
|
5660
|
+
});
|
|
5661
|
+
|
|
5662
|
+
// src/commands/messenger/channel-send.ts
|
|
5663
|
+
var import_commander63 = require("commander");
|
|
5664
|
+
|
|
5665
|
+
// src/resolvers/messenger-channel.ts
|
|
5666
|
+
var CHANNEL_ID_RE = /^\d{15,}$/;
|
|
5667
|
+
async function resolveMessengerChannel(client, input2) {
|
|
5668
|
+
if (CHANNEL_ID_RE.test(input2)) {
|
|
5669
|
+
return input2;
|
|
5670
|
+
}
|
|
5671
|
+
const res = await client.getMessengerChannels();
|
|
5672
|
+
const named = res.result.filter((ch) => !!ch.title);
|
|
5673
|
+
const adapter = named.map((ch) => ({ name: ch.title, id: ch.id }));
|
|
5674
|
+
const match = matchByName(adapter, input2, "\uB300\uD654\uBC29", (ch) => `${ch.name} (${ch.id})`, {
|
|
5675
|
+
helpHint: "channelId \uC9C1\uC811 \uC785\uB825 (15+\uC790\uB9AC numeric) \uB610\uB294 Dooray \uBA54\uC2E0\uC800\uC5D0\uC11C \uBC29 \uD655\uC778"
|
|
5676
|
+
});
|
|
5677
|
+
return match.id;
|
|
5678
|
+
}
|
|
5679
|
+
|
|
5680
|
+
// src/commands/messenger/channel-send.ts
|
|
5681
|
+
var messengerChannelSendCommand = new import_commander63.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
|
+
if (!opts.channel) {
|
|
5683
|
+
throw new DoorayCliError("--channel \uC635\uC158\uC740 \uD544\uC218\uC785\uB2C8\uB2E4.", EXIT_PARAM_ERROR);
|
|
5684
|
+
}
|
|
5685
|
+
const globalOpts = messengerChannelSendCommand.optsWithGlobals();
|
|
5686
|
+
const config = await getConfigOrThrow();
|
|
5687
|
+
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
5688
|
+
const channelId = await resolveMessengerChannel(client, opts.channel);
|
|
5689
|
+
let bodyContent = await readBodyInputOrNull(opts);
|
|
5690
|
+
if (bodyContent == null) {
|
|
5691
|
+
bodyContent = await openInEditor("");
|
|
5692
|
+
}
|
|
5693
|
+
if (!bodyContent.trim()) {
|
|
5694
|
+
throw new DoorayCliError("\uBE48 \uBA54\uC2DC\uC9C0\uB294 \uC804\uC1A1\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.", EXIT_PARAM_ERROR);
|
|
5695
|
+
}
|
|
5696
|
+
startSpinner("\uBA54\uC2DC\uC9C0 \uC804\uC1A1 \uC911...");
|
|
5697
|
+
try {
|
|
5698
|
+
const res = await client.sendChannelMessage(channelId, bodyContent);
|
|
5699
|
+
stopSpinner(true, `\uBA54\uC2DC\uC9C0\uB97C \uC804\uC1A1\uD588\uC2B5\uB2C8\uB2E4 (log-id: ${res.result.id})`);
|
|
5700
|
+
if (globalOpts.json) {
|
|
5701
|
+
printJson(res.result);
|
|
5702
|
+
} else if (globalOpts.quiet) {
|
|
5703
|
+
printQuiet([res.result.id]);
|
|
5704
|
+
} else {
|
|
5705
|
+
process.stdout.write(`\uBA54\uC2DC\uC9C0\uB97C \uC804\uC1A1\uD588\uC2B5\uB2C8\uB2E4 (log-id: ${res.result.id})
|
|
5706
|
+
`);
|
|
5707
|
+
}
|
|
5708
|
+
} catch (e) {
|
|
5709
|
+
stopSpinner(false);
|
|
5710
|
+
throw e;
|
|
5711
|
+
}
|
|
5712
|
+
});
|
|
5713
|
+
|
|
5714
|
+
// src/commands/messenger/index.ts
|
|
5715
|
+
var messengerCommand = new import_commander64.Command("messenger").description("\uBA54\uC2E0\uC800 \uAD00\uB828 \uBA85\uB839");
|
|
5716
|
+
messengerCommand.addCommand(messengerSendCommand);
|
|
5717
|
+
messengerCommand.addCommand(messengerChannelSendCommand);
|
|
5718
|
+
|
|
5439
5719
|
// src/commands/feedback.ts
|
|
5440
|
-
var
|
|
5720
|
+
var import_commander65 = require("commander");
|
|
5441
5721
|
var import_node_child_process2 = require("child_process");
|
|
5442
5722
|
var import_node_util = require("util");
|
|
5443
5723
|
var import_promises17 = require("fs/promises");
|
|
@@ -5548,7 +5828,7 @@ async function readBody(opts) {
|
|
|
5548
5828
|
if (opts.bodyFile) return await (0, import_promises17.readFile)(opts.bodyFile, "utf-8");
|
|
5549
5829
|
return void 0;
|
|
5550
5830
|
}
|
|
5551
|
-
var feedbackCommand = new
|
|
5831
|
+
var feedbackCommand = new import_commander65.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(
|
|
5552
5832
|
"--label <name>",
|
|
5553
5833
|
"\uB77C\uBCA8 (\uBC18\uBCF5 \uAC00\uB2A5)",
|
|
5554
5834
|
(value, prev) => [...prev, value],
|
|
@@ -5711,8 +5991,8 @@ function sanitizeArgv(argv) {
|
|
|
5711
5991
|
}
|
|
5712
5992
|
|
|
5713
5993
|
// src/index.ts
|
|
5714
|
-
var program = new
|
|
5715
|
-
program.name("dooray").description("Dooray REST API CLI").version("0.
|
|
5994
|
+
var program = new import_commander66.Command();
|
|
5995
|
+
program.name("dooray").description("Dooray REST API CLI").version("0.14.0").option("--json", "JSON \uD615\uC2DD\uC73C\uB85C \uCD9C\uB825").option("--quiet", "ID\uB9CC \uCD9C\uB825").option("--no-color", "\uC0C9\uC0C1 \uBE44\uD65C\uC131\uD654");
|
|
5716
5996
|
program.hook("preAction", () => {
|
|
5717
5997
|
const opts = program.opts();
|
|
5718
5998
|
if (opts.color === false || process.env.NO_COLOR) {
|
|
@@ -5722,14 +6002,14 @@ program.hook("preAction", () => {
|
|
|
5722
6002
|
setQuiet(true);
|
|
5723
6003
|
}
|
|
5724
6004
|
});
|
|
5725
|
-
var projectCommand = new
|
|
6005
|
+
var projectCommand = new import_commander66.Command("project").description("\uD504\uB85C\uC81D\uD2B8 \uAD00\uB828 \uBA85\uB839");
|
|
5726
6006
|
projectCommand.addCommand(projectListCommand);
|
|
5727
6007
|
projectCommand.addCommand(projectMembersCommand);
|
|
5728
6008
|
projectCommand.addCommand(projectWorkflowsCommand);
|
|
5729
6009
|
projectCommand.addCommand(projectGroupsCommand);
|
|
5730
6010
|
projectCommand.addCommand(projectTagsCommand);
|
|
5731
6011
|
projectCommand.addCommand(projectTemplatesCommand);
|
|
5732
|
-
var postCommand = new
|
|
6012
|
+
var postCommand = new import_commander66.Command("post").description("\uC5C5\uBB34 \uAD00\uB828 \uBA85\uB839");
|
|
5733
6013
|
postCommand.addCommand(postListCommand);
|
|
5734
6014
|
postCommand.addCommand(postSearchCommand);
|
|
5735
6015
|
postCommand.addCommand(postGetCommand);
|
|
@@ -5737,7 +6017,7 @@ postCommand.addCommand(postEditCommand);
|
|
|
5737
6017
|
postCommand.addCommand(postCreateCommand);
|
|
5738
6018
|
postCommand.addCommand(postDoneCommand);
|
|
5739
6019
|
postCommand.addCommand(postWorkflowCommand);
|
|
5740
|
-
var commentCommand = new
|
|
6020
|
+
var commentCommand = new import_commander66.Command("comment").description("\uB313\uAE00 \uAD00\uB828 \uBA85\uB839");
|
|
5741
6021
|
commentCommand.addCommand(commentListCommand);
|
|
5742
6022
|
commentCommand.addCommand(commentLatestCommand);
|
|
5743
6023
|
commentCommand.addCommand(commentGetCommand);
|
|
@@ -5746,24 +6026,26 @@ commentCommand.addCommand(commentEditCommand);
|
|
|
5746
6026
|
commentCommand.addCommand(commentDeleteCommand);
|
|
5747
6027
|
commentCommand.addCommand(commentFileCommand);
|
|
5748
6028
|
postCommand.addCommand(commentCommand);
|
|
5749
|
-
var fileCommand = new
|
|
6029
|
+
var fileCommand = new import_commander66.Command("file").description("\uCCA8\uBD80\uD30C\uC77C \uAD00\uB828 \uBA85\uB839");
|
|
5750
6030
|
fileCommand.addCommand(fileListCommand);
|
|
5751
6031
|
fileCommand.addCommand(fileDownloadCommand);
|
|
5752
6032
|
fileCommand.addCommand(fileDownloadAllCommand);
|
|
5753
6033
|
fileCommand.addCommand(fileUploadCommand);
|
|
5754
6034
|
fileCommand.addCommand(fileDeleteCommand);
|
|
5755
6035
|
postCommand.addCommand(fileCommand);
|
|
5756
|
-
var wikiCommand = new
|
|
6036
|
+
var wikiCommand = new import_commander66.Command("wiki").description("\uC704\uD0A4 \uAD00\uB828 \uBA85\uB839");
|
|
5757
6037
|
wikiCommand.addCommand(wikiListCommand);
|
|
5758
6038
|
wikiCommand.addCommand(wikiPagesCommand);
|
|
5759
|
-
|
|
6039
|
+
wikiCommand.addCommand(wikiTreeCommand);
|
|
6040
|
+
var wikiPageCommand = new import_commander66.Command("page").description("\uC704\uD0A4 \uD398\uC774\uC9C0 \uAD00\uB828 \uBA85\uB839");
|
|
5760
6041
|
wikiPageCommand.addCommand(wikiPageGetCommand);
|
|
5761
6042
|
wikiPageCommand.addCommand(wikiPageCreateCommand);
|
|
5762
6043
|
wikiPageCommand.addCommand(wikiPageEditCommand);
|
|
6044
|
+
wikiPageCommand.addCommand(wikiPageDeleteCommand);
|
|
5763
6045
|
wikiPageCommand.addCommand(wikiPageFileCommand);
|
|
5764
6046
|
wikiPageCommand.addCommand(wikiPageCommentCommand);
|
|
5765
6047
|
wikiCommand.addCommand(wikiPageCommand);
|
|
5766
|
-
var mailCommand = new
|
|
6048
|
+
var mailCommand = new import_commander66.Command("mail").description("\uBA54\uC77C \uAD00\uB828 \uBA85\uB839");
|
|
5767
6049
|
mailCommand.addCommand(mailListCommand);
|
|
5768
6050
|
mailCommand.addCommand(mailGetCommand);
|
|
5769
6051
|
mailCommand.addCommand(mailSendCommand);
|
|
@@ -5777,6 +6059,7 @@ program.addCommand(projectCommand);
|
|
|
5777
6059
|
program.addCommand(postCommand);
|
|
5778
6060
|
program.addCommand(wikiCommand);
|
|
5779
6061
|
program.addCommand(mailCommand);
|
|
6062
|
+
program.addCommand(messengerCommand);
|
|
5780
6063
|
program.addCommand(feedbackCommand);
|
|
5781
6064
|
program.parseAsync().catch(async (err) => {
|
|
5782
6065
|
const errorMessage = err instanceof Error ? err.message : String(err);
|