@bifos/dooray-cli 0.11.0 → 0.13.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 +81 -24
- package/dist/index.js +330 -78
- package/package.json +17 -17
- package/skills/dooray-cli/SKILL.md +96 -33
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_commander65 = 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
|
}
|
|
@@ -710,6 +710,14 @@ var DoorayApiClient = class {
|
|
|
710
710
|
throw await toDoorayCliError(e);
|
|
711
711
|
}
|
|
712
712
|
}
|
|
713
|
+
// 비공식(미문서화) endpoint — Dooray 공식 API 문서에 없으나 실측 확인 (ADR-032)
|
|
714
|
+
async deleteWikiPage(wikiId, pageId) {
|
|
715
|
+
try {
|
|
716
|
+
return await this.api.delete(`wiki/v1/wikis/${wikiId}/pages/${pageId}`).json();
|
|
717
|
+
} catch (e) {
|
|
718
|
+
throw await toDoorayCliError(e);
|
|
719
|
+
}
|
|
720
|
+
}
|
|
713
721
|
// ─── Post Files ─────────────────────────────────────
|
|
714
722
|
async getPostFiles(projectId, postId) {
|
|
715
723
|
try {
|
|
@@ -948,6 +956,32 @@ var DoorayApiClient = class {
|
|
|
948
956
|
throw await toDoorayCliError(e);
|
|
949
957
|
}
|
|
950
958
|
}
|
|
959
|
+
// ─── Messenger (ADR-033) ────────────────────────────
|
|
960
|
+
async sendDirectMessage(organizationMemberId, text) {
|
|
961
|
+
try {
|
|
962
|
+
return await this.api.post("messenger/v1/channels/direct-send", {
|
|
963
|
+
json: { text, organizationMemberId }
|
|
964
|
+
}).json();
|
|
965
|
+
} catch (e) {
|
|
966
|
+
throw await toDoorayCliError(e);
|
|
967
|
+
}
|
|
968
|
+
}
|
|
969
|
+
async sendChannelMessage(channelId, text) {
|
|
970
|
+
try {
|
|
971
|
+
return await this.api.post(`messenger/v1/channels/${channelId}/logs`, {
|
|
972
|
+
json: { text }
|
|
973
|
+
}).json();
|
|
974
|
+
} catch (e) {
|
|
975
|
+
throw await toDoorayCliError(e);
|
|
976
|
+
}
|
|
977
|
+
}
|
|
978
|
+
async getMessengerChannels() {
|
|
979
|
+
try {
|
|
980
|
+
return await this.api.get("messenger/v1/channels").json();
|
|
981
|
+
} catch (e) {
|
|
982
|
+
throw await toDoorayCliError(e);
|
|
983
|
+
}
|
|
984
|
+
}
|
|
951
985
|
};
|
|
952
986
|
|
|
953
987
|
// src/cache/types.ts
|
|
@@ -1432,7 +1466,7 @@ async function buildMemberNameMap(client, projectId) {
|
|
|
1432
1466
|
}
|
|
1433
1467
|
return map;
|
|
1434
1468
|
}
|
|
1435
|
-
async function
|
|
1469
|
+
async function resolveMemberByIdOrEmail(client, input2) {
|
|
1436
1470
|
if (MEMBER_ID_RE.test(input2)) {
|
|
1437
1471
|
try {
|
|
1438
1472
|
await client.getMemberDetail(input2);
|
|
@@ -1465,6 +1499,11 @@ async function resolveMember(client, projectId, input2) {
|
|
|
1465
1499
|
}
|
|
1466
1500
|
return hits[0].id;
|
|
1467
1501
|
}
|
|
1502
|
+
return null;
|
|
1503
|
+
}
|
|
1504
|
+
async function resolveMember(client, projectId, input2) {
|
|
1505
|
+
const byIdOrEmail = await resolveMemberByIdOrEmail(client, input2);
|
|
1506
|
+
if (byIdOrEmail !== null) return byIdOrEmail;
|
|
1468
1507
|
const members = await ensureMembers(client, projectId);
|
|
1469
1508
|
const match = matchByName(
|
|
1470
1509
|
members,
|
|
@@ -1999,12 +2038,15 @@ async function resolvePost(client, projectId, postNumber) {
|
|
|
1999
2038
|
// src/utils/dooray-url.ts
|
|
2000
2039
|
var TASK_URL_RE = /^https?:\/\/[\w.-]+\.dooray\.com\/task\/to\/(\d+)(?:[/?#].*)?$/;
|
|
2001
2040
|
var TASK_URL_ALT_RE = /^https?:\/\/[\w.-]+\.dooray\.com\/task\/(?:\d+)\/(\d+)(?:[/?#].*)?$/;
|
|
2041
|
+
var TASK_PROJECT_TASKS_RE = /^https?:\/\/[\w.-]+\.dooray\.com\/project\/tasks\/(\d+)(?:[/?#].*)?$/;
|
|
2002
2042
|
var WIKI_URL_RE = /^https?:\/\/[\w.-]+\.dooray\.com\/wiki\/(\d+)\/(\d+)(?:[/?#].*)?$/;
|
|
2003
2043
|
function parseDoorayTaskUrl(input2) {
|
|
2004
2044
|
const m1 = TASK_URL_RE.exec(input2);
|
|
2005
2045
|
if (m1) return m1[1];
|
|
2006
2046
|
const m2 = TASK_URL_ALT_RE.exec(input2);
|
|
2007
2047
|
if (m2) return m2[1];
|
|
2048
|
+
const m3 = TASK_PROJECT_TASKS_RE.exec(input2);
|
|
2049
|
+
if (m3) return m3[1];
|
|
2008
2050
|
return null;
|
|
2009
2051
|
}
|
|
2010
2052
|
function parseDoorayWikiUrl(input2) {
|
|
@@ -2017,7 +2059,18 @@ function isLikelyDoorayUrl(input2) {
|
|
|
2017
2059
|
}
|
|
2018
2060
|
|
|
2019
2061
|
// src/resolvers/post-input.ts
|
|
2020
|
-
|
|
2062
|
+
function classifyPostInputToken(token) {
|
|
2063
|
+
if (/^https?:\/\//.test(token)) return "url";
|
|
2064
|
+
if (/^\d{15,}$/.test(token)) return "postId";
|
|
2065
|
+
if (/^\d+$/.test(token)) return "postNumber";
|
|
2066
|
+
return "project";
|
|
2067
|
+
}
|
|
2068
|
+
var URL_FORMAT_HINT = "\uC9C0\uC6D0 \uD615\uC2DD:\n https://x.dooray.com/task/to/{postId}\n https://x.dooray.com/task/{projectId}/{postId}\n https://x.dooray.com/project/tasks/{postId}";
|
|
2069
|
+
var INPUT_HELP = `\uC5C5\uBB34\uB97C \uC2DD\uBCC4\uD560 \uC815\uBCF4\uAC00 \uBD80\uC871\uD569\uB2C8\uB2E4. \uB2E4\uC74C \uC911 \uD558\uB098\uB97C \uC785\uB825\uD558\uC138\uC694:
|
|
2070
|
+
- <project> <post-number> \uC608: my-project 337
|
|
2071
|
+
- --id <postId> \uC608: --id 1234567890123456789
|
|
2072
|
+
- <Dooray URL>
|
|
2073
|
+
${URL_FORMAT_HINT}`;
|
|
2021
2074
|
async function resolveByPostId(client, postId) {
|
|
2022
2075
|
const res = await client.getPostStandalone(postId);
|
|
2023
2076
|
const d = res.result;
|
|
@@ -2048,13 +2101,28 @@ async function resolvePostInput(client, args) {
|
|
|
2048
2101
|
if (!postId) {
|
|
2049
2102
|
throw new DoorayCliError(
|
|
2050
2103
|
`--url \uD615\uC2DD\uC774 \uC62C\uBC14\uB974\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4: "${urlOpt}"
|
|
2051
|
-
|
|
2104
|
+
${URL_FORMAT_HINT}`,
|
|
2052
2105
|
EXIT_PARAM_ERROR
|
|
2053
2106
|
);
|
|
2054
2107
|
}
|
|
2055
2108
|
return resolveByPostId(client, postId);
|
|
2056
2109
|
}
|
|
2057
2110
|
if (idOpt) {
|
|
2111
|
+
const idType = classifyPostInputToken(idOpt);
|
|
2112
|
+
if (idType === "postNumber") {
|
|
2113
|
+
throw new DoorayCliError(
|
|
2114
|
+
`"${idOpt}" \uB294 \uC5C5\uBB34 \uBC88\uD638\uB85C \uBCF4\uC785\uB2C8\uB2E4. <project> <post-number> \uD615\uC2DD\uC744 \uC4F0\uC138\uC694:
|
|
2115
|
+
dooray post get <project> ${idOpt}`,
|
|
2116
|
+
EXIT_PARAM_ERROR
|
|
2117
|
+
);
|
|
2118
|
+
}
|
|
2119
|
+
if (idType === "url") {
|
|
2120
|
+
throw new DoorayCliError(
|
|
2121
|
+
`"${idOpt}" \uB294 URL \uD615\uC2DD\uC785\uB2C8\uB2E4. --url \uC635\uC158\uC744 \uC4F0\uC138\uC694:
|
|
2122
|
+
dooray post get --url "${idOpt}"`,
|
|
2123
|
+
EXIT_PARAM_ERROR
|
|
2124
|
+
);
|
|
2125
|
+
}
|
|
2058
2126
|
return resolveByPostId(client, idOpt);
|
|
2059
2127
|
}
|
|
2060
2128
|
if (projectArg && !postNumberArg && isLikelyDoorayUrl(projectArg)) {
|
|
@@ -2062,13 +2130,28 @@ async function resolvePostInput(client, args) {
|
|
|
2062
2130
|
if (!postId) {
|
|
2063
2131
|
throw new DoorayCliError(
|
|
2064
2132
|
`Dooray URL \uD615\uC2DD\uC774 \uC62C\uBC14\uB974\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4: "${projectArg}"
|
|
2065
|
-
|
|
2133
|
+
${URL_FORMAT_HINT}`,
|
|
2066
2134
|
EXIT_PARAM_ERROR
|
|
2067
2135
|
);
|
|
2068
2136
|
}
|
|
2069
2137
|
return resolveByPostId(client, postId);
|
|
2070
2138
|
}
|
|
2071
2139
|
if (projectArg && postNumberArg) {
|
|
2140
|
+
const numType = classifyPostInputToken(postNumberArg);
|
|
2141
|
+
if (numType === "postId") {
|
|
2142
|
+
throw new DoorayCliError(
|
|
2143
|
+
`"${postNumberArg}" \uB294 \uB0B4\uBD80 ID(postId)\uB85C \uBCF4\uC785\uB2C8\uB2E4.
|
|
2144
|
+
\uC5C5\uBB34 \uBC88\uD638(#N)\uAC00 \uC544\uB2CC \uB0B4\uBD80 ID \uB85C \uC870\uD68C\uD558\uB824\uBA74 --id \uC635\uC158\uC744 \uC0AC\uC6A9\uD558\uC138\uC694:
|
|
2145
|
+
dooray post get --id ${postNumberArg}`,
|
|
2146
|
+
EXIT_PARAM_ERROR
|
|
2147
|
+
);
|
|
2148
|
+
}
|
|
2149
|
+
if (numType !== "postNumber") {
|
|
2150
|
+
throw new DoorayCliError(
|
|
2151
|
+
`<post-number>\uAC00 \uC62C\uBC14\uB974\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4: "${postNumberArg}"`,
|
|
2152
|
+
EXIT_PARAM_ERROR
|
|
2153
|
+
);
|
|
2154
|
+
}
|
|
2072
2155
|
const projectId = await resolveProject(client, projectArg);
|
|
2073
2156
|
const num = Number(postNumberArg);
|
|
2074
2157
|
if (!Number.isFinite(num) || num <= 0) {
|
|
@@ -2256,7 +2339,7 @@ async function resolvePostRef(client, ref) {
|
|
|
2256
2339
|
var import_node_child_process = require("child_process");
|
|
2257
2340
|
var import_promises6 = __toESM(require("fs/promises"));
|
|
2258
2341
|
var import_tmp = __toESM(require("tmp"));
|
|
2259
|
-
var import_js_yaml =
|
|
2342
|
+
var import_js_yaml = require("js-yaml");
|
|
2260
2343
|
function openInEditor(content) {
|
|
2261
2344
|
const editor2 = process.env.EDITOR;
|
|
2262
2345
|
if (!editor2) {
|
|
@@ -2320,8 +2403,8 @@ function serializePostFrontmatter(post, members) {
|
|
|
2320
2403
|
return "";
|
|
2321
2404
|
}).filter(Boolean)
|
|
2322
2405
|
};
|
|
2323
|
-
const yamlStr = import_js_yaml.
|
|
2324
|
-
|
|
2406
|
+
const yamlStr = (0, import_js_yaml.dump)(frontmatter, {
|
|
2407
|
+
quoteStyle: "double",
|
|
2325
2408
|
forceQuotes: false,
|
|
2326
2409
|
lineWidth: -1
|
|
2327
2410
|
});
|
|
@@ -2337,7 +2420,7 @@ function parsePostFrontmatter(content) {
|
|
|
2337
2420
|
EXIT_PARAM_ERROR
|
|
2338
2421
|
);
|
|
2339
2422
|
}
|
|
2340
|
-
const frontmatter = import_js_yaml.
|
|
2423
|
+
const frontmatter = (0, import_js_yaml.load)(match[1]);
|
|
2341
2424
|
const body = match[2];
|
|
2342
2425
|
return {
|
|
2343
2426
|
subject: frontmatter.subject ?? "",
|
|
@@ -2352,8 +2435,8 @@ function serializeWikiFrontmatter(page) {
|
|
|
2352
2435
|
const frontmatter = {
|
|
2353
2436
|
title: page.subject
|
|
2354
2437
|
};
|
|
2355
|
-
const yamlStr = import_js_yaml.
|
|
2356
|
-
|
|
2438
|
+
const yamlStr = (0, import_js_yaml.dump)(frontmatter, {
|
|
2439
|
+
quoteStyle: "double",
|
|
2357
2440
|
forceQuotes: false,
|
|
2358
2441
|
lineWidth: -1
|
|
2359
2442
|
});
|
|
@@ -2369,7 +2452,7 @@ function parseWikiFrontmatter(content) {
|
|
|
2369
2452
|
EXIT_PARAM_ERROR
|
|
2370
2453
|
);
|
|
2371
2454
|
}
|
|
2372
|
-
const frontmatter = import_js_yaml.
|
|
2455
|
+
const frontmatter = (0, import_js_yaml.load)(match[1]);
|
|
2373
2456
|
const body = match[2];
|
|
2374
2457
|
return {
|
|
2375
2458
|
title: frontmatter.title ?? "",
|
|
@@ -3801,13 +3884,15 @@ function emitDownloadAllResult(globalOpts, data) {
|
|
|
3801
3884
|
}
|
|
3802
3885
|
}
|
|
3803
3886
|
function emitDeleteResult(globalOpts, result) {
|
|
3887
|
+
const jsonKey = result.jsonKey ?? "fileId";
|
|
3888
|
+
const message = result.message ?? `\uD30C\uC77C(${result.id})\uC774 \uC0AD\uC81C\uB418\uC5C8\uC2B5\uB2C8\uB2E4.`;
|
|
3804
3889
|
if (globalOpts.json) {
|
|
3805
|
-
printJson({
|
|
3890
|
+
printJson({ [jsonKey]: result.id, status: "deleted" });
|
|
3806
3891
|
} else if (globalOpts.quiet) {
|
|
3807
|
-
process.stdout.write(`${result.
|
|
3892
|
+
process.stdout.write(`${result.id}
|
|
3808
3893
|
`);
|
|
3809
3894
|
} else {
|
|
3810
|
-
process.stdout.write(
|
|
3895
|
+
process.stdout.write(`${message}
|
|
3811
3896
|
`);
|
|
3812
3897
|
}
|
|
3813
3898
|
}
|
|
@@ -4034,7 +4119,7 @@ var fileDeleteCommand = new import_commander33.Command("delete").description("\u
|
|
|
4034
4119
|
});
|
|
4035
4120
|
await client.deletePostFile(projectId, postId, fileId);
|
|
4036
4121
|
stopSpinner(true, "\uC0AD\uC81C \uC644\uB8CC");
|
|
4037
|
-
emitDeleteResult(globalOpts, { fileId });
|
|
4122
|
+
emitDeleteResult(globalOpts, { id: fileId });
|
|
4038
4123
|
});
|
|
4039
4124
|
|
|
4040
4125
|
// src/commands/wiki/list.ts
|
|
@@ -4243,10 +4328,7 @@ var wikiPageEditCommand = new import_commander38.Command("edit").description("\u
|
|
|
4243
4328
|
`);
|
|
4244
4329
|
});
|
|
4245
4330
|
|
|
4246
|
-
// src/commands/wiki/page-
|
|
4247
|
-
var import_commander44 = require("commander");
|
|
4248
|
-
|
|
4249
|
-
// src/commands/wiki/page-file/list.ts
|
|
4331
|
+
// src/commands/wiki/page-delete.ts
|
|
4250
4332
|
var import_commander39 = require("commander");
|
|
4251
4333
|
|
|
4252
4334
|
// src/resolvers/wiki-page-input.ts
|
|
@@ -4303,13 +4385,63 @@ async function resolveWikiPageInput(client, args) {
|
|
|
4303
4385
|
throw new DoorayCliError(INPUT_HELP2, EXIT_PARAM_ERROR);
|
|
4304
4386
|
}
|
|
4305
4387
|
|
|
4388
|
+
// src/commands/wiki/page-delete.ts
|
|
4389
|
+
var wikiPageDeleteCommand = new import_commander39.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) => {
|
|
4390
|
+
const globalOpts = wikiPageDeleteCommand.optsWithGlobals();
|
|
4391
|
+
const config = await getConfigOrThrow();
|
|
4392
|
+
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
4393
|
+
const { wikiId, pageId } = await resolveWikiPageInput(client, {
|
|
4394
|
+
projectArg: arg1,
|
|
4395
|
+
pageIdArg: arg2,
|
|
4396
|
+
idOpt: opts.id,
|
|
4397
|
+
urlOpt: opts.url,
|
|
4398
|
+
project: opts.project
|
|
4399
|
+
});
|
|
4400
|
+
if (!opts.yes) {
|
|
4401
|
+
if (!process.stdin.isTTY) {
|
|
4402
|
+
throw new DoorayCliError(
|
|
4403
|
+
"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.",
|
|
4404
|
+
EXIT_PARAM_ERROR
|
|
4405
|
+
);
|
|
4406
|
+
}
|
|
4407
|
+
const { confirm: confirm2 } = await import("@inquirer/prompts");
|
|
4408
|
+
const ok = await confirm2({
|
|
4409
|
+
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.`,
|
|
4410
|
+
default: false
|
|
4411
|
+
});
|
|
4412
|
+
if (!ok) {
|
|
4413
|
+
if (!globalOpts.json && !globalOpts.quiet) {
|
|
4414
|
+
process.stdout.write("\uCDE8\uC18C\uB418\uC5C8\uC2B5\uB2C8\uB2E4.\n");
|
|
4415
|
+
}
|
|
4416
|
+
return;
|
|
4417
|
+
}
|
|
4418
|
+
}
|
|
4419
|
+
startSpinner("\uD398\uC774\uC9C0 \uC0AD\uC81C \uC911...");
|
|
4420
|
+
try {
|
|
4421
|
+
await client.deleteWikiPage(wikiId, pageId);
|
|
4422
|
+
stopSpinner(true, "\uC0AD\uC81C \uC644\uB8CC");
|
|
4423
|
+
emitDeleteResult(globalOpts, {
|
|
4424
|
+
id: pageId,
|
|
4425
|
+
jsonKey: "pageId",
|
|
4426
|
+
message: `\uD398\uC774\uC9C0(${pageId})\uAC00 \uC0AD\uC81C\uB418\uC5C8\uC2B5\uB2C8\uB2E4.`
|
|
4427
|
+
});
|
|
4428
|
+
} catch (e) {
|
|
4429
|
+
stopSpinner(false);
|
|
4430
|
+
throw e;
|
|
4431
|
+
}
|
|
4432
|
+
});
|
|
4433
|
+
|
|
4434
|
+
// src/commands/wiki/page-file/index.ts
|
|
4435
|
+
var import_commander45 = require("commander");
|
|
4436
|
+
|
|
4306
4437
|
// src/commands/wiki/page-file/list.ts
|
|
4438
|
+
var import_commander40 = require("commander");
|
|
4307
4439
|
function formatSize3(bytes) {
|
|
4308
4440
|
if (bytes < 1024) return `${bytes}B`;
|
|
4309
4441
|
if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)}KB`;
|
|
4310
4442
|
return `${(bytes / (1024 * 1024)).toFixed(1)}MB`;
|
|
4311
4443
|
}
|
|
4312
|
-
var wikiPageFileListCommand = new
|
|
4444
|
+
var wikiPageFileListCommand = new import_commander40.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) => {
|
|
4313
4445
|
const globalOpts = wikiPageFileListCommand.optsWithGlobals();
|
|
4314
4446
|
const config = await getConfigOrThrow();
|
|
4315
4447
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -4340,8 +4472,15 @@ var wikiPageFileListCommand = new import_commander39.Command("list").description
|
|
|
4340
4472
|
});
|
|
4341
4473
|
|
|
4342
4474
|
// src/commands/wiki/page-file/upload.ts
|
|
4343
|
-
var
|
|
4344
|
-
|
|
4475
|
+
var import_commander41 = require("commander");
|
|
4476
|
+
|
|
4477
|
+
// src/utils/wiki-snippet.ts
|
|
4478
|
+
function wikiInlineImageSnippet(wikiId, attachFileId, name) {
|
|
4479
|
+
return ``;
|
|
4480
|
+
}
|
|
4481
|
+
|
|
4482
|
+
// src/commands/wiki/page-file/upload.ts
|
|
4483
|
+
var wikiPageFileUploadCommand = new import_commander41.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) => {
|
|
4345
4484
|
const globalOpts = wikiPageFileUploadCommand.optsWithGlobals();
|
|
4346
4485
|
const config = await getConfigOrThrow();
|
|
4347
4486
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -4400,7 +4539,15 @@ var wikiPageFileUploadCommand = new import_commander40.Command("upload").descrip
|
|
|
4400
4539
|
const res = await client.uploadWikiPageFile(wikiId, pageId, filePath, fileType);
|
|
4401
4540
|
stopSpinner(true, "\uC5C5\uB85C\uB4DC \uC644\uB8CC");
|
|
4402
4541
|
if (globalOpts.json) {
|
|
4403
|
-
|
|
4542
|
+
const payload = fileType === "inline_image" ? {
|
|
4543
|
+
...res.result,
|
|
4544
|
+
markdownSnippet: wikiInlineImageSnippet(
|
|
4545
|
+
wikiId,
|
|
4546
|
+
res.result.attachFileId,
|
|
4547
|
+
res.result.name
|
|
4548
|
+
)
|
|
4549
|
+
} : res.result;
|
|
4550
|
+
printJson(payload);
|
|
4404
4551
|
} else if (globalOpts.quiet) {
|
|
4405
4552
|
process.stdout.write(`${res.result.id}
|
|
4406
4553
|
`);
|
|
@@ -4415,8 +4562,10 @@ var wikiPageFileUploadCommand = new import_commander40.Command("upload").descrip
|
|
|
4415
4562
|
`);
|
|
4416
4563
|
if (fileType === "inline_image") {
|
|
4417
4564
|
process.stdout.write("\n\uBCF8\uBB38 \uC0BD\uC785\uC6A9 markdown snippet (\uC9C1\uC811 wiki page edit \uC73C\uB85C \uBCF8\uBB38\uC5D0 \uBC15\uC73C\uC138\uC694):\n");
|
|
4418
|
-
process.stdout.write(
|
|
4419
|
-
`)
|
|
4565
|
+
process.stdout.write(
|
|
4566
|
+
` ${wikiInlineImageSnippet(wikiId, res.result.attachFileId, res.result.name)}
|
|
4567
|
+
`
|
|
4568
|
+
);
|
|
4420
4569
|
}
|
|
4421
4570
|
}
|
|
4422
4571
|
} catch (e) {
|
|
@@ -4426,10 +4575,10 @@ var wikiPageFileUploadCommand = new import_commander40.Command("upload").descrip
|
|
|
4426
4575
|
});
|
|
4427
4576
|
|
|
4428
4577
|
// src/commands/wiki/page-file/download.ts
|
|
4429
|
-
var
|
|
4578
|
+
var import_commander42 = require("commander");
|
|
4430
4579
|
var import_promises11 = require("fs/promises");
|
|
4431
4580
|
var import_node_path9 = require("path");
|
|
4432
|
-
var wikiPageFileDownloadCommand = new
|
|
4581
|
+
var wikiPageFileDownloadCommand = new import_commander42.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) => {
|
|
4433
4582
|
const globalOpts = wikiPageFileDownloadCommand.optsWithGlobals();
|
|
4434
4583
|
const config = await getConfigOrThrow();
|
|
4435
4584
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -4491,10 +4640,10 @@ var wikiPageFileDownloadCommand = new import_commander41.Command("download").des
|
|
|
4491
4640
|
});
|
|
4492
4641
|
|
|
4493
4642
|
// src/commands/wiki/page-file/download-all.ts
|
|
4494
|
-
var
|
|
4643
|
+
var import_commander43 = require("commander");
|
|
4495
4644
|
var import_promises12 = require("fs/promises");
|
|
4496
4645
|
var import_node_path10 = require("path");
|
|
4497
|
-
var wikiPageFileDownloadAllCommand = new
|
|
4646
|
+
var wikiPageFileDownloadAllCommand = new import_commander43.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) => {
|
|
4498
4647
|
const globalOpts = wikiPageFileDownloadAllCommand.optsWithGlobals();
|
|
4499
4648
|
const config = await getConfigOrThrow();
|
|
4500
4649
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -4551,8 +4700,8 @@ var wikiPageFileDownloadAllCommand = new import_commander42.Command("download-al
|
|
|
4551
4700
|
});
|
|
4552
4701
|
|
|
4553
4702
|
// src/commands/wiki/page-file/delete.ts
|
|
4554
|
-
var
|
|
4555
|
-
var wikiPageFileDeleteCommand = new
|
|
4703
|
+
var import_commander44 = require("commander");
|
|
4704
|
+
var wikiPageFileDeleteCommand = new import_commander44.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) => {
|
|
4556
4705
|
const globalOpts = wikiPageFileDeleteCommand.optsWithGlobals();
|
|
4557
4706
|
const config = await getConfigOrThrow();
|
|
4558
4707
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -4603,7 +4752,7 @@ var wikiPageFileDeleteCommand = new import_commander43.Command("delete").descrip
|
|
|
4603
4752
|
try {
|
|
4604
4753
|
await client.deleteWikiPageFile(wikiId, pageId, fileId);
|
|
4605
4754
|
stopSpinner(true, "\uC0AD\uC81C \uC644\uB8CC");
|
|
4606
|
-
emitDeleteResult(globalOpts, { fileId });
|
|
4755
|
+
emitDeleteResult(globalOpts, { id: fileId });
|
|
4607
4756
|
} catch (e) {
|
|
4608
4757
|
stopSpinner(false);
|
|
4609
4758
|
throw e;
|
|
@@ -4611,7 +4760,7 @@ var wikiPageFileDeleteCommand = new import_commander43.Command("delete").descrip
|
|
|
4611
4760
|
});
|
|
4612
4761
|
|
|
4613
4762
|
// src/commands/wiki/page-file/index.ts
|
|
4614
|
-
var wikiPageFileCommand = new
|
|
4763
|
+
var wikiPageFileCommand = new import_commander45.Command("file").description("\uC704\uD0A4 \uD398\uC774\uC9C0 \uCCA8\uBD80\uD30C\uC77C \uAD00\uB828 \uBA85\uB839 (Issue #70, ADR-029)");
|
|
4615
4764
|
wikiPageFileCommand.addCommand(wikiPageFileListCommand);
|
|
4616
4765
|
wikiPageFileCommand.addCommand(wikiPageFileUploadCommand);
|
|
4617
4766
|
wikiPageFileCommand.addCommand(wikiPageFileDownloadCommand);
|
|
@@ -4619,10 +4768,10 @@ wikiPageFileCommand.addCommand(wikiPageFileDownloadAllCommand);
|
|
|
4619
4768
|
wikiPageFileCommand.addCommand(wikiPageFileDeleteCommand);
|
|
4620
4769
|
|
|
4621
4770
|
// src/commands/wiki/page-comment/index.ts
|
|
4622
|
-
var
|
|
4771
|
+
var import_commander52 = require("commander");
|
|
4623
4772
|
|
|
4624
4773
|
// src/commands/wiki/page-comment/list.ts
|
|
4625
|
-
var
|
|
4774
|
+
var import_commander46 = require("commander");
|
|
4626
4775
|
|
|
4627
4776
|
// src/formatters/wiki-comment.ts
|
|
4628
4777
|
function formatWikiCommentList(comments, opts) {
|
|
@@ -4669,7 +4818,7 @@ function truncate(s, n) {
|
|
|
4669
4818
|
}
|
|
4670
4819
|
|
|
4671
4820
|
// src/commands/wiki/page-comment/list.ts
|
|
4672
|
-
var wikiPageCommentListCommand = new
|
|
4821
|
+
var wikiPageCommentListCommand = new import_commander46.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) => {
|
|
4673
4822
|
const globalOpts = wikiPageCommentListCommand.optsWithGlobals();
|
|
4674
4823
|
const config = await getConfigOrThrow();
|
|
4675
4824
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -4694,8 +4843,8 @@ var wikiPageCommentListCommand = new import_commander45.Command("list").descript
|
|
|
4694
4843
|
});
|
|
4695
4844
|
|
|
4696
4845
|
// src/commands/wiki/page-comment/latest.ts
|
|
4697
|
-
var
|
|
4698
|
-
var wikiPageCommentLatestCommand = new
|
|
4846
|
+
var import_commander47 = require("commander");
|
|
4847
|
+
var wikiPageCommentLatestCommand = new import_commander47.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) => {
|
|
4699
4848
|
const globalOpts = wikiPageCommentLatestCommand.optsWithGlobals();
|
|
4700
4849
|
const config = await getConfigOrThrow();
|
|
4701
4850
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -4722,7 +4871,7 @@ var wikiPageCommentLatestCommand = new import_commander46.Command("latest").desc
|
|
|
4722
4871
|
});
|
|
4723
4872
|
|
|
4724
4873
|
// src/commands/wiki/page-comment/get.ts
|
|
4725
|
-
var
|
|
4874
|
+
var import_commander48 = require("commander");
|
|
4726
4875
|
|
|
4727
4876
|
// src/commands/wiki/page-comment/parse-args.ts
|
|
4728
4877
|
function parseWikiCommentArgs(arg1, arg2, arg3, opts) {
|
|
@@ -4775,7 +4924,7 @@ function parseWikiCommentArgs(arg1, arg2, arg3, opts) {
|
|
|
4775
4924
|
}
|
|
4776
4925
|
|
|
4777
4926
|
// src/commands/wiki/page-comment/get.ts
|
|
4778
|
-
var wikiPageCommentGetCommand = new
|
|
4927
|
+
var wikiPageCommentGetCommand = new import_commander48.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) => {
|
|
4779
4928
|
const parsed = parseWikiCommentArgs(arg1, arg2, arg3, opts);
|
|
4780
4929
|
const config = await getConfigOrThrow();
|
|
4781
4930
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -4799,8 +4948,8 @@ var wikiPageCommentGetCommand = new import_commander47.Command("get").descriptio
|
|
|
4799
4948
|
});
|
|
4800
4949
|
|
|
4801
4950
|
// src/commands/wiki/page-comment/add.ts
|
|
4802
|
-
var
|
|
4803
|
-
var wikiPageCommentAddCommand = new
|
|
4951
|
+
var import_commander49 = require("commander");
|
|
4952
|
+
var wikiPageCommentAddCommand = new import_commander49.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) => {
|
|
4804
4953
|
if ((opts.id || opts.url) && (project || pageIdArg)) {
|
|
4805
4954
|
throw new DoorayCliError(
|
|
4806
4955
|
"positional \uC778\uC790\uC640 --id/--url \uC635\uC158\uC740 \uB3D9\uC2DC\uC5D0 \uC0AC\uC6A9\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.",
|
|
@@ -4846,8 +4995,8 @@ var wikiPageCommentAddCommand = new import_commander48.Command("add").descriptio
|
|
|
4846
4995
|
});
|
|
4847
4996
|
|
|
4848
4997
|
// src/commands/wiki/page-comment/edit.ts
|
|
4849
|
-
var
|
|
4850
|
-
var wikiPageCommentEditCommand = new
|
|
4998
|
+
var import_commander50 = require("commander");
|
|
4999
|
+
var wikiPageCommentEditCommand = new import_commander50.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) => {
|
|
4851
5000
|
const parsed = parseWikiCommentArgs(arg1, arg2, arg3, opts);
|
|
4852
5001
|
const config = await getConfigOrThrow();
|
|
4853
5002
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -4891,8 +5040,8 @@ var wikiPageCommentEditCommand = new import_commander49.Command("edit").descript
|
|
|
4891
5040
|
});
|
|
4892
5041
|
|
|
4893
5042
|
// src/commands/wiki/page-comment/delete.ts
|
|
4894
|
-
var
|
|
4895
|
-
var wikiPageCommentDeleteCommand = new
|
|
5043
|
+
var import_commander51 = require("commander");
|
|
5044
|
+
var wikiPageCommentDeleteCommand = new import_commander51.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) => {
|
|
4896
5045
|
const parsed = parseWikiCommentArgs(arg1, arg2, arg3, opts);
|
|
4897
5046
|
const config = await getConfigOrThrow();
|
|
4898
5047
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -4916,7 +5065,7 @@ var wikiPageCommentDeleteCommand = new import_commander50.Command("delete").desc
|
|
|
4916
5065
|
});
|
|
4917
5066
|
|
|
4918
5067
|
// src/commands/wiki/page-comment/index.ts
|
|
4919
|
-
var wikiPageCommentCommand = new
|
|
5068
|
+
var wikiPageCommentCommand = new import_commander52.Command("comment").description("\uC704\uD0A4 \uD398\uC774\uC9C0 \uB313\uAE00 \uAD00\uB828 \uBA85\uB839");
|
|
4920
5069
|
wikiPageCommentCommand.addCommand(wikiPageCommentListCommand);
|
|
4921
5070
|
wikiPageCommentCommand.addCommand(wikiPageCommentLatestCommand);
|
|
4922
5071
|
wikiPageCommentCommand.addCommand(wikiPageCommentGetCommand);
|
|
@@ -4925,10 +5074,10 @@ wikiPageCommentCommand.addCommand(wikiPageCommentEditCommand);
|
|
|
4925
5074
|
wikiPageCommentCommand.addCommand(wikiPageCommentDeleteCommand);
|
|
4926
5075
|
|
|
4927
5076
|
// src/commands/member/index.ts
|
|
4928
|
-
var
|
|
5077
|
+
var import_commander56 = require("commander");
|
|
4929
5078
|
|
|
4930
5079
|
// src/commands/member/get.ts
|
|
4931
|
-
var
|
|
5080
|
+
var import_commander53 = require("commander");
|
|
4932
5081
|
|
|
4933
5082
|
// src/formatters/member.ts
|
|
4934
5083
|
function formatMemberDetail(member, opts) {
|
|
@@ -4974,7 +5123,7 @@ function formatMemberSearchResults(members, opts) {
|
|
|
4974
5123
|
}
|
|
4975
5124
|
|
|
4976
5125
|
// src/commands/member/get.ts
|
|
4977
|
-
var memberGetCommand = new
|
|
5126
|
+
var memberGetCommand = new import_commander53.Command("get").description("\uBA64\uBC84 \uC0C1\uC138 \uC815\uBCF4 \uC870\uD68C (organizationMemberId)").argument("<member-id>", "\uC870\uD68C\uD560 organization member ID").action(async (memberId) => {
|
|
4978
5127
|
const globalOpts = memberGetCommand.optsWithGlobals();
|
|
4979
5128
|
const config = await getConfigOrThrow();
|
|
4980
5129
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -4983,8 +5132,8 @@ var memberGetCommand = new import_commander52.Command("get").description("\uBA64
|
|
|
4983
5132
|
});
|
|
4984
5133
|
|
|
4985
5134
|
// src/commands/member/list.ts
|
|
4986
|
-
var
|
|
4987
|
-
var memberListCommand = new
|
|
5135
|
+
var import_commander54 = require("commander");
|
|
5136
|
+
var memberListCommand = new import_commander54.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) => {
|
|
4988
5137
|
const globalOpts = memberListCommand.optsWithGlobals();
|
|
4989
5138
|
const config = await getConfigOrThrow();
|
|
4990
5139
|
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
@@ -4999,8 +5148,8 @@ var memberListCommand = new import_commander53.Command("list").description("\uD5
|
|
|
4999
5148
|
});
|
|
5000
5149
|
|
|
5001
5150
|
// src/commands/member/search.ts
|
|
5002
|
-
var
|
|
5003
|
-
var memberSearchCommand = new
|
|
5151
|
+
var import_commander55 = require("commander");
|
|
5152
|
+
var memberSearchCommand = new import_commander55.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) => {
|
|
5004
5153
|
const globalOpts = memberSearchCommand.optsWithGlobals();
|
|
5005
5154
|
const filterCount = [keyword, opts.email, opts.userCode, opts.userCodeExact].filter(Boolean).length;
|
|
5006
5155
|
if (filterCount === 0) {
|
|
@@ -5033,13 +5182,13 @@ var memberSearchCommand = new import_commander54.Command("search").description("
|
|
|
5033
5182
|
});
|
|
5034
5183
|
|
|
5035
5184
|
// src/commands/member/index.ts
|
|
5036
|
-
var memberCommand = new
|
|
5185
|
+
var memberCommand = new import_commander56.Command("member").description("Dooray \uBA64\uBC84 \uC870\uD68C");
|
|
5037
5186
|
memberCommand.addCommand(memberGetCommand);
|
|
5038
5187
|
memberCommand.addCommand(memberListCommand);
|
|
5039
5188
|
memberCommand.addCommand(memberSearchCommand);
|
|
5040
5189
|
|
|
5041
5190
|
// src/commands/mail/list.ts
|
|
5042
|
-
var
|
|
5191
|
+
var import_commander57 = require("commander");
|
|
5043
5192
|
|
|
5044
5193
|
// src/api/imapClient.ts
|
|
5045
5194
|
var import_imapflow = require("imapflow");
|
|
@@ -5156,7 +5305,7 @@ async function getMail(config, uid) {
|
|
|
5156
5305
|
|
|
5157
5306
|
// src/commands/mail/list.ts
|
|
5158
5307
|
var import_chalk5 = __toESM(require("chalk"));
|
|
5159
|
-
var mailListCommand = new
|
|
5308
|
+
var mailListCommand = new import_commander57.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) => {
|
|
5160
5309
|
const globalOpts = mailListCommand.optsWithGlobals();
|
|
5161
5310
|
const config = await getConfigOrThrow();
|
|
5162
5311
|
startSpinner("\uBA54\uC77C \uC870\uD68C \uC911...");
|
|
@@ -5188,9 +5337,9 @@ var mailListCommand = new import_commander56.Command("list").description("\uBA54
|
|
|
5188
5337
|
});
|
|
5189
5338
|
|
|
5190
5339
|
// src/commands/mail/get.ts
|
|
5191
|
-
var
|
|
5340
|
+
var import_commander58 = require("commander");
|
|
5192
5341
|
var import_chalk6 = __toESM(require("chalk"));
|
|
5193
|
-
var mailGetCommand = new
|
|
5342
|
+
var mailGetCommand = new import_commander58.Command("get").description("\uBA54\uC77C \uC0C1\uC138 \uC870\uD68C").argument("<uid>", "\uBA54\uC77C UID").action(async (uid) => {
|
|
5194
5343
|
const globalOpts = mailGetCommand.optsWithGlobals();
|
|
5195
5344
|
const config = await getConfigOrThrow();
|
|
5196
5345
|
startSpinner("\uBA54\uC77C \uC870\uD68C \uC911...");
|
|
@@ -5221,7 +5370,7 @@ ${mail.body}
|
|
|
5221
5370
|
});
|
|
5222
5371
|
|
|
5223
5372
|
// src/commands/mail/send.ts
|
|
5224
|
-
var
|
|
5373
|
+
var import_commander59 = require("commander");
|
|
5225
5374
|
var import_promises13 = require("fs/promises");
|
|
5226
5375
|
|
|
5227
5376
|
// src/api/smtpClient.ts
|
|
@@ -5271,7 +5420,7 @@ async function sendMail(config, opts) {
|
|
|
5271
5420
|
}
|
|
5272
5421
|
|
|
5273
5422
|
// src/commands/mail/send.ts
|
|
5274
|
-
var mailSendCommand = new
|
|
5423
|
+
var mailSendCommand = new import_commander59.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) => {
|
|
5275
5424
|
const globalOpts = mailSendCommand.optsWithGlobals();
|
|
5276
5425
|
const config = await getConfigOrThrow();
|
|
5277
5426
|
let body = opts.body ?? "";
|
|
@@ -5306,7 +5455,7 @@ var mailSendCommand = new import_commander58.Command("send").description("\uBA54
|
|
|
5306
5455
|
});
|
|
5307
5456
|
|
|
5308
5457
|
// src/commands/mail/reply.ts
|
|
5309
|
-
var
|
|
5458
|
+
var import_commander60 = require("commander");
|
|
5310
5459
|
var import_promises14 = require("fs/promises");
|
|
5311
5460
|
var import_imapflow2 = require("imapflow");
|
|
5312
5461
|
async function getMessageId(config, uid) {
|
|
@@ -5335,7 +5484,7 @@ async function getMessageId(config, uid) {
|
|
|
5335
5484
|
await client.logout();
|
|
5336
5485
|
}
|
|
5337
5486
|
}
|
|
5338
|
-
var mailReplyCommand = new
|
|
5487
|
+
var mailReplyCommand = new import_commander60.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) => {
|
|
5339
5488
|
const globalOpts = mailReplyCommand.optsWithGlobals();
|
|
5340
5489
|
const config = await getConfigOrThrow();
|
|
5341
5490
|
let body = opts.body ?? "";
|
|
@@ -5375,8 +5524,109 @@ var mailReplyCommand = new import_commander59.Command("reply").description("\uBA
|
|
|
5375
5524
|
}
|
|
5376
5525
|
});
|
|
5377
5526
|
|
|
5527
|
+
// src/commands/messenger/index.ts
|
|
5528
|
+
var import_commander63 = require("commander");
|
|
5529
|
+
|
|
5530
|
+
// src/commands/messenger/send.ts
|
|
5531
|
+
var import_commander61 = require("commander");
|
|
5532
|
+
var messengerSendCommand = new import_commander61.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) => {
|
|
5533
|
+
if (!opts.to) {
|
|
5534
|
+
throw new DoorayCliError("--to \uC635\uC158\uC740 \uD544\uC218\uC785\uB2C8\uB2E4.", EXIT_PARAM_ERROR);
|
|
5535
|
+
}
|
|
5536
|
+
const globalOpts = messengerSendCommand.optsWithGlobals();
|
|
5537
|
+
const config = await getConfigOrThrow();
|
|
5538
|
+
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
5539
|
+
const memberId = await resolveMemberByIdOrEmail(client, opts.to);
|
|
5540
|
+
if (memberId == null) {
|
|
5541
|
+
throw new DoorayCliError(
|
|
5542
|
+
`--to \uB294 organizationMemberId \uB610\uB294 \uC774\uBA54\uC77C\uB9CC \uC9C0\uC6D0\uD569\uB2C8\uB2E4 (\uC774\uB984 \uBBF8\uC9C0\uC6D0): "${opts.to}"`,
|
|
5543
|
+
EXIT_PARAM_ERROR
|
|
5544
|
+
);
|
|
5545
|
+
}
|
|
5546
|
+
let bodyContent = await readBodyInputOrNull(opts);
|
|
5547
|
+
if (bodyContent == null) {
|
|
5548
|
+
bodyContent = await openInEditor("");
|
|
5549
|
+
}
|
|
5550
|
+
if (!bodyContent.trim()) {
|
|
5551
|
+
throw new DoorayCliError("\uBE48 \uBA54\uC2DC\uC9C0\uB294 \uC804\uC1A1\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.", EXIT_PARAM_ERROR);
|
|
5552
|
+
}
|
|
5553
|
+
startSpinner("\uBA54\uC2DC\uC9C0 \uC804\uC1A1 \uC911...");
|
|
5554
|
+
try {
|
|
5555
|
+
const res = await client.sendDirectMessage(memberId, bodyContent);
|
|
5556
|
+
stopSpinner(true, `\uBA54\uC2DC\uC9C0\uB97C \uC804\uC1A1\uD588\uC2B5\uB2C8\uB2E4 (log-id: ${res.result.id})`);
|
|
5557
|
+
if (globalOpts.json) {
|
|
5558
|
+
printJson(res.result);
|
|
5559
|
+
} else if (globalOpts.quiet) {
|
|
5560
|
+
printQuiet([res.result.id]);
|
|
5561
|
+
} else {
|
|
5562
|
+
process.stdout.write(`\uBA54\uC2DC\uC9C0\uB97C \uC804\uC1A1\uD588\uC2B5\uB2C8\uB2E4 (log-id: ${res.result.id})
|
|
5563
|
+
`);
|
|
5564
|
+
}
|
|
5565
|
+
} catch (e) {
|
|
5566
|
+
stopSpinner(false);
|
|
5567
|
+
throw e;
|
|
5568
|
+
}
|
|
5569
|
+
});
|
|
5570
|
+
|
|
5571
|
+
// src/commands/messenger/channel-send.ts
|
|
5572
|
+
var import_commander62 = require("commander");
|
|
5573
|
+
|
|
5574
|
+
// src/resolvers/messenger-channel.ts
|
|
5575
|
+
var CHANNEL_ID_RE = /^\d{15,}$/;
|
|
5576
|
+
async function resolveMessengerChannel(client, input2) {
|
|
5577
|
+
if (CHANNEL_ID_RE.test(input2)) {
|
|
5578
|
+
return input2;
|
|
5579
|
+
}
|
|
5580
|
+
const res = await client.getMessengerChannels();
|
|
5581
|
+
const named = res.result.filter((ch) => !!ch.title);
|
|
5582
|
+
const adapter = named.map((ch) => ({ name: ch.title, id: ch.id }));
|
|
5583
|
+
const match = matchByName(adapter, input2, "\uB300\uD654\uBC29", (ch) => `${ch.name} (${ch.id})`, {
|
|
5584
|
+
helpHint: "channelId \uC9C1\uC811 \uC785\uB825 (15+\uC790\uB9AC numeric) \uB610\uB294 Dooray \uBA54\uC2E0\uC800\uC5D0\uC11C \uBC29 \uD655\uC778"
|
|
5585
|
+
});
|
|
5586
|
+
return match.id;
|
|
5587
|
+
}
|
|
5588
|
+
|
|
5589
|
+
// src/commands/messenger/channel-send.ts
|
|
5590
|
+
var messengerChannelSendCommand = new import_commander62.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) => {
|
|
5591
|
+
if (!opts.channel) {
|
|
5592
|
+
throw new DoorayCliError("--channel \uC635\uC158\uC740 \uD544\uC218\uC785\uB2C8\uB2E4.", EXIT_PARAM_ERROR);
|
|
5593
|
+
}
|
|
5594
|
+
const globalOpts = messengerChannelSendCommand.optsWithGlobals();
|
|
5595
|
+
const config = await getConfigOrThrow();
|
|
5596
|
+
const client = new DoorayApiClient(config.apiKey, config.baseUrl);
|
|
5597
|
+
const channelId = await resolveMessengerChannel(client, opts.channel);
|
|
5598
|
+
let bodyContent = await readBodyInputOrNull(opts);
|
|
5599
|
+
if (bodyContent == null) {
|
|
5600
|
+
bodyContent = await openInEditor("");
|
|
5601
|
+
}
|
|
5602
|
+
if (!bodyContent.trim()) {
|
|
5603
|
+
throw new DoorayCliError("\uBE48 \uBA54\uC2DC\uC9C0\uB294 \uC804\uC1A1\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.", EXIT_PARAM_ERROR);
|
|
5604
|
+
}
|
|
5605
|
+
startSpinner("\uBA54\uC2DC\uC9C0 \uC804\uC1A1 \uC911...");
|
|
5606
|
+
try {
|
|
5607
|
+
const res = await client.sendChannelMessage(channelId, bodyContent);
|
|
5608
|
+
stopSpinner(true, `\uBA54\uC2DC\uC9C0\uB97C \uC804\uC1A1\uD588\uC2B5\uB2C8\uB2E4 (log-id: ${res.result.id})`);
|
|
5609
|
+
if (globalOpts.json) {
|
|
5610
|
+
printJson(res.result);
|
|
5611
|
+
} else if (globalOpts.quiet) {
|
|
5612
|
+
printQuiet([res.result.id]);
|
|
5613
|
+
} else {
|
|
5614
|
+
process.stdout.write(`\uBA54\uC2DC\uC9C0\uB97C \uC804\uC1A1\uD588\uC2B5\uB2C8\uB2E4 (log-id: ${res.result.id})
|
|
5615
|
+
`);
|
|
5616
|
+
}
|
|
5617
|
+
} catch (e) {
|
|
5618
|
+
stopSpinner(false);
|
|
5619
|
+
throw e;
|
|
5620
|
+
}
|
|
5621
|
+
});
|
|
5622
|
+
|
|
5623
|
+
// src/commands/messenger/index.ts
|
|
5624
|
+
var messengerCommand = new import_commander63.Command("messenger").description("\uBA54\uC2E0\uC800 \uAD00\uB828 \uBA85\uB839");
|
|
5625
|
+
messengerCommand.addCommand(messengerSendCommand);
|
|
5626
|
+
messengerCommand.addCommand(messengerChannelSendCommand);
|
|
5627
|
+
|
|
5378
5628
|
// src/commands/feedback.ts
|
|
5379
|
-
var
|
|
5629
|
+
var import_commander64 = require("commander");
|
|
5380
5630
|
var import_node_child_process2 = require("child_process");
|
|
5381
5631
|
var import_node_util = require("util");
|
|
5382
5632
|
var import_promises17 = require("fs/promises");
|
|
@@ -5487,7 +5737,7 @@ async function readBody(opts) {
|
|
|
5487
5737
|
if (opts.bodyFile) return await (0, import_promises17.readFile)(opts.bodyFile, "utf-8");
|
|
5488
5738
|
return void 0;
|
|
5489
5739
|
}
|
|
5490
|
-
var feedbackCommand = new
|
|
5740
|
+
var feedbackCommand = new import_commander64.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(
|
|
5491
5741
|
"--label <name>",
|
|
5492
5742
|
"\uB77C\uBCA8 (\uBC18\uBCF5 \uAC00\uB2A5)",
|
|
5493
5743
|
(value, prev) => [...prev, value],
|
|
@@ -5650,8 +5900,8 @@ function sanitizeArgv(argv) {
|
|
|
5650
5900
|
}
|
|
5651
5901
|
|
|
5652
5902
|
// src/index.ts
|
|
5653
|
-
var program = new
|
|
5654
|
-
program.name("dooray").description("Dooray REST API CLI").version("0.
|
|
5903
|
+
var program = new import_commander65.Command();
|
|
5904
|
+
program.name("dooray").description("Dooray REST API CLI").version("0.13.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");
|
|
5655
5905
|
program.hook("preAction", () => {
|
|
5656
5906
|
const opts = program.opts();
|
|
5657
5907
|
if (opts.color === false || process.env.NO_COLOR) {
|
|
@@ -5661,14 +5911,14 @@ program.hook("preAction", () => {
|
|
|
5661
5911
|
setQuiet(true);
|
|
5662
5912
|
}
|
|
5663
5913
|
});
|
|
5664
|
-
var projectCommand = new
|
|
5914
|
+
var projectCommand = new import_commander65.Command("project").description("\uD504\uB85C\uC81D\uD2B8 \uAD00\uB828 \uBA85\uB839");
|
|
5665
5915
|
projectCommand.addCommand(projectListCommand);
|
|
5666
5916
|
projectCommand.addCommand(projectMembersCommand);
|
|
5667
5917
|
projectCommand.addCommand(projectWorkflowsCommand);
|
|
5668
5918
|
projectCommand.addCommand(projectGroupsCommand);
|
|
5669
5919
|
projectCommand.addCommand(projectTagsCommand);
|
|
5670
5920
|
projectCommand.addCommand(projectTemplatesCommand);
|
|
5671
|
-
var postCommand = new
|
|
5921
|
+
var postCommand = new import_commander65.Command("post").description("\uC5C5\uBB34 \uAD00\uB828 \uBA85\uB839");
|
|
5672
5922
|
postCommand.addCommand(postListCommand);
|
|
5673
5923
|
postCommand.addCommand(postSearchCommand);
|
|
5674
5924
|
postCommand.addCommand(postGetCommand);
|
|
@@ -5676,7 +5926,7 @@ postCommand.addCommand(postEditCommand);
|
|
|
5676
5926
|
postCommand.addCommand(postCreateCommand);
|
|
5677
5927
|
postCommand.addCommand(postDoneCommand);
|
|
5678
5928
|
postCommand.addCommand(postWorkflowCommand);
|
|
5679
|
-
var commentCommand = new
|
|
5929
|
+
var commentCommand = new import_commander65.Command("comment").description("\uB313\uAE00 \uAD00\uB828 \uBA85\uB839");
|
|
5680
5930
|
commentCommand.addCommand(commentListCommand);
|
|
5681
5931
|
commentCommand.addCommand(commentLatestCommand);
|
|
5682
5932
|
commentCommand.addCommand(commentGetCommand);
|
|
@@ -5685,24 +5935,25 @@ commentCommand.addCommand(commentEditCommand);
|
|
|
5685
5935
|
commentCommand.addCommand(commentDeleteCommand);
|
|
5686
5936
|
commentCommand.addCommand(commentFileCommand);
|
|
5687
5937
|
postCommand.addCommand(commentCommand);
|
|
5688
|
-
var fileCommand = new
|
|
5938
|
+
var fileCommand = new import_commander65.Command("file").description("\uCCA8\uBD80\uD30C\uC77C \uAD00\uB828 \uBA85\uB839");
|
|
5689
5939
|
fileCommand.addCommand(fileListCommand);
|
|
5690
5940
|
fileCommand.addCommand(fileDownloadCommand);
|
|
5691
5941
|
fileCommand.addCommand(fileDownloadAllCommand);
|
|
5692
5942
|
fileCommand.addCommand(fileUploadCommand);
|
|
5693
5943
|
fileCommand.addCommand(fileDeleteCommand);
|
|
5694
5944
|
postCommand.addCommand(fileCommand);
|
|
5695
|
-
var wikiCommand = new
|
|
5945
|
+
var wikiCommand = new import_commander65.Command("wiki").description("\uC704\uD0A4 \uAD00\uB828 \uBA85\uB839");
|
|
5696
5946
|
wikiCommand.addCommand(wikiListCommand);
|
|
5697
5947
|
wikiCommand.addCommand(wikiPagesCommand);
|
|
5698
|
-
var wikiPageCommand = new
|
|
5948
|
+
var wikiPageCommand = new import_commander65.Command("page").description("\uC704\uD0A4 \uD398\uC774\uC9C0 \uAD00\uB828 \uBA85\uB839");
|
|
5699
5949
|
wikiPageCommand.addCommand(wikiPageGetCommand);
|
|
5700
5950
|
wikiPageCommand.addCommand(wikiPageCreateCommand);
|
|
5701
5951
|
wikiPageCommand.addCommand(wikiPageEditCommand);
|
|
5952
|
+
wikiPageCommand.addCommand(wikiPageDeleteCommand);
|
|
5702
5953
|
wikiPageCommand.addCommand(wikiPageFileCommand);
|
|
5703
5954
|
wikiPageCommand.addCommand(wikiPageCommentCommand);
|
|
5704
5955
|
wikiCommand.addCommand(wikiPageCommand);
|
|
5705
|
-
var mailCommand = new
|
|
5956
|
+
var mailCommand = new import_commander65.Command("mail").description("\uBA54\uC77C \uAD00\uB828 \uBA85\uB839");
|
|
5706
5957
|
mailCommand.addCommand(mailListCommand);
|
|
5707
5958
|
mailCommand.addCommand(mailGetCommand);
|
|
5708
5959
|
mailCommand.addCommand(mailSendCommand);
|
|
@@ -5716,6 +5967,7 @@ program.addCommand(projectCommand);
|
|
|
5716
5967
|
program.addCommand(postCommand);
|
|
5717
5968
|
program.addCommand(wikiCommand);
|
|
5718
5969
|
program.addCommand(mailCommand);
|
|
5970
|
+
program.addCommand(messengerCommand);
|
|
5719
5971
|
program.addCommand(feedbackCommand);
|
|
5720
5972
|
program.parseAsync().catch(async (err) => {
|
|
5721
5973
|
const errorMessage = err instanceof Error ? err.message : String(err);
|