dart-fss-cli 0.4.5 → 0.4.7
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/dist/bin.js +1 -1
- package/dist/{chunk-JYPAIE4W.js → chunk-2WVCVNX6.js} +31 -10
- package/dist/cli.js +1 -1
- package/package.json +1 -1
package/dist/bin.js
CHANGED
|
@@ -2,11 +2,12 @@
|
|
|
2
2
|
import { Command } from "commander";
|
|
3
3
|
|
|
4
4
|
// src/config.ts
|
|
5
|
-
import { homedir } from "os";
|
|
5
|
+
import { homedir as homedir2 } from "os";
|
|
6
6
|
import { join as join2 } from "path";
|
|
7
7
|
|
|
8
8
|
// src/env.ts
|
|
9
9
|
import { existsSync, readFileSync } from "fs";
|
|
10
|
+
import { homedir } from "os";
|
|
10
11
|
import { join, resolve } from "path";
|
|
11
12
|
var loaded = false;
|
|
12
13
|
function loadEnv() {
|
|
@@ -15,7 +16,8 @@ function loadEnv() {
|
|
|
15
16
|
const candidates = [
|
|
16
17
|
process.cwd(),
|
|
17
18
|
resolve(process.cwd(), ".."),
|
|
18
|
-
resolve(import.meta.dirname, "..")
|
|
19
|
+
resolve(import.meta.dirname, ".."),
|
|
20
|
+
join(homedir(), ".dart-fss")
|
|
19
21
|
];
|
|
20
22
|
for (const base of candidates) {
|
|
21
23
|
const envPath = join(base, ".env");
|
|
@@ -40,7 +42,7 @@ function loadEnv() {
|
|
|
40
42
|
// src/config.ts
|
|
41
43
|
loadEnv();
|
|
42
44
|
var DART_BASE_URL = "https://opendart.fss.or.kr/api/";
|
|
43
|
-
var CACHE_DIR = join2(
|
|
45
|
+
var CACHE_DIR = join2(homedir2(), ".dart-fss");
|
|
44
46
|
var CORP_CODE_CACHE_PATH = join2(CACHE_DIR, "corp-codes.json");
|
|
45
47
|
var CORP_CODE_CACHE_MAX_AGE_MS = 7 * 24 * 60 * 60 * 1e3;
|
|
46
48
|
function getApiKey(optionKey) {
|
|
@@ -1175,7 +1177,7 @@ function registerDisclosureCommands(program) {
|
|
|
1175
1177
|
);
|
|
1176
1178
|
group.command("list").description(
|
|
1177
1179
|
"Search DART disclosure filings. Returns paginated results with report name, filing date, receipt number.\nWithout --corp, searches ALL companies (date range limited to 3 months).\nWith --corp, searches specific company with no date limit.\nDisclosure types: A=Regular, B=Major events, C=Issuance, D=Equity, E=Other, F=Audit, G=Fund, H=ABS, I=Exchange, J=FTC"
|
|
1178
|
-
).option("--corp <name-or-code>", 'Company name (e.g. "\uC0BC\uC131\uC804\uC790") or 8-digit corp_code').option("--from <YYYYMMDD>", "Start date in YYYYMMDD format (e.g. 20240101)").option("--to <YYYYMMDD>", "End date in YYYYMMDD format (e.g. 20241231)").option("--type <code>", "Disclosure type: A=Regular, B=Major events, C=Issuance, D=Equity, E=Other, F=Audit, G=Fund, H=ABS, I=Exchange, J=FTC").option("--corp-cls <cls>", "Corp class filter: Y=KOSPI, K=KOSDAQ, N=KONEX, E=Other").option("--page <n>", "Page number, starting from 1 (default: 1)", "1").option("--count <n>", "Items per page, 1-100 (default: 10)", "10").action(async (opts) => {
|
|
1180
|
+
).option("--corp <name-or-code>", 'Company name (e.g. "\uC0BC\uC131\uC804\uC790") or 8-digit corp_code').option("--from <YYYYMMDD>", "Start date in YYYYMMDD format (e.g. 20240101)").option("--to <YYYYMMDD>", "End date in YYYYMMDD format (e.g. 20241231)").option("--type <code>", "Disclosure type: A=Regular, B=Major events, C=Issuance, D=Equity, E=Other, F=Audit, G=Fund, H=ABS, I=Exchange, J=FTC").option("--corp-cls <cls>", "Corp class filter: Y=KOSPI, K=KOSDAQ, N=KONEX, E=Other").option("--page <n>", "Page number, starting from 1 (default: 1)", "1").option("--count <n>", "Items per page, 1-100 (default: 10)", "10").addHelpText("after", '\nExamples:\n dart-fss disclosure list --corp "\uC0BC\uC131\uC804\uC790" --from 20250101 --to 20251231 --pretty\n dart-fss disclosure list --from 20250101 --to 20250131 --count 20').action(async (opts) => {
|
|
1179
1181
|
const globalOpts = getGlobalOpts(group);
|
|
1180
1182
|
const apiKey = getApiKey(globalOpts.apiKey);
|
|
1181
1183
|
if (globalOpts.json) {
|
|
@@ -1201,7 +1203,7 @@ function registerDisclosureCommands(program) {
|
|
|
1201
1203
|
});
|
|
1202
1204
|
group.command("company").description(
|
|
1203
1205
|
'Get company profile from DART. Returns corp name, CEO, address, stock code, industry code, incorporation date, fiscal month.\nAccepts company name (e.g. "\uC0BC\uC131\uC804\uC790") or 8-digit corp_code.'
|
|
1204
|
-
).requiredOption("--corp <name-or-code>", 'Company name (e.g. "\uC0BC\uC131\uC804\uC790") or 8-digit corp_code').action(async (opts) => {
|
|
1206
|
+
).requiredOption("--corp <name-or-code>", 'Company name (e.g. "\uC0BC\uC131\uC804\uC790") or 8-digit corp_code').addHelpText("after", '\nExamples:\n dart-fss disclosure company --corp "\uC0BC\uC131\uC804\uC790" --pretty\n dart-fss disclosure company --corp 00126380 --fields "corp_name,ceo_nm,adres"').action(async (opts) => {
|
|
1205
1207
|
const globalOpts = getGlobalOpts(group);
|
|
1206
1208
|
const apiKey = getApiKey(globalOpts.apiKey);
|
|
1207
1209
|
if (globalOpts.json) {
|
|
@@ -1293,7 +1295,10 @@ function registerPeriodicReportCommands(program) {
|
|
|
1293
1295
|
(ep) => ep.pattern === "periodic"
|
|
1294
1296
|
);
|
|
1295
1297
|
for (const ep of endpoints) {
|
|
1296
|
-
group.command(ep.cliName).description(ep.summary).requiredOption("--corp <name-or-code>", 'Company name (e.g. "\uC0BC\uC131\uC804\uC790") or 8-digit corp_code').requiredOption("--year <YYYY>", "Business year in YYYY format (e.g. 2024). Data from 2015 onward").requiredOption("--quarter <q1|half|q3|annual>", "Report quarter: q1 (Q1), half (semi-annual), q3 (Q3), annual (full year)").
|
|
1298
|
+
group.command(ep.cliName).description(ep.summary).requiredOption("--corp <name-or-code>", 'Company name (e.g. "\uC0BC\uC131\uC804\uC790") or 8-digit corp_code').requiredOption("--year <YYYY>", "Business year in YYYY format (e.g. 2024). Data from 2015 onward").requiredOption("--quarter <q1|half|q3|annual>", "Report quarter: q1 (Q1), half (semi-annual), q3 (Q3), annual (full year)").addHelpText("after", `
|
|
1299
|
+
Examples:
|
|
1300
|
+
dart-fss report ${ep.cliName} --corp "\uC0BC\uC131\uC804\uC790" --year 2025 --quarter annual --pretty
|
|
1301
|
+
dart-fss report ${ep.cliName} --corp "\uC0BC\uC131\uC804\uC790" --year 2025 --quarter annual --fields "corp_name,nm"`).action(async (opts) => {
|
|
1297
1302
|
const globalOpts = getGlobalOpts2(group);
|
|
1298
1303
|
const apiKey = getApiKey(globalOpts.apiKey);
|
|
1299
1304
|
if (globalOpts.json) {
|
|
@@ -1449,7 +1454,10 @@ function registerEquityDisclosureCommands(program) {
|
|
|
1449
1454
|
(ep) => ep.pattern === "corpOnly"
|
|
1450
1455
|
);
|
|
1451
1456
|
for (const ep of endpoints) {
|
|
1452
|
-
group.command(ep.cliName).description(ep.summary).requiredOption("--corp <name-or-code>", "Company name or corp_code").
|
|
1457
|
+
group.command(ep.cliName).description(ep.summary).requiredOption("--corp <name-or-code>", "Company name or corp_code").addHelpText("after", `
|
|
1458
|
+
Examples:
|
|
1459
|
+
dart-fss equity ${ep.cliName} --corp "\uC0BC\uC131\uC804\uC790" --pretty
|
|
1460
|
+
dart-fss equity ${ep.cliName} --corp "\uC0BC\uC131\uC804\uC790" --fields "repror,stkqy,stkrt"`).action(async (opts) => {
|
|
1453
1461
|
const globalOpts = getGlobalOpts4(group);
|
|
1454
1462
|
const apiKey = getApiKey(globalOpts.apiKey);
|
|
1455
1463
|
if (globalOpts.json) {
|
|
@@ -1482,7 +1490,10 @@ function registerMajorReportCommands(program) {
|
|
|
1482
1490
|
(ep) => ep.pattern === "dateRange"
|
|
1483
1491
|
);
|
|
1484
1492
|
for (const ep of endpoints) {
|
|
1485
|
-
group.command(ep.cliName).description(ep.summary).requiredOption("--corp <name-or-code>", 'Company name (e.g. "\uC0BC\uC131\uC804\uC790") or 8-digit corp_code').requiredOption("--from <YYYYMMDD>", "Start date in YYYYMMDD format (filing date). Data from 2015 onward").requiredOption("--to <YYYYMMDD>", "End date in YYYYMMDD format (filing date)").
|
|
1493
|
+
group.command(ep.cliName).description(ep.summary).requiredOption("--corp <name-or-code>", 'Company name (e.g. "\uC0BC\uC131\uC804\uC790") or 8-digit corp_code').requiredOption("--from <YYYYMMDD>", "Start date in YYYYMMDD format (filing date). Data from 2015 onward").requiredOption("--to <YYYYMMDD>", "End date in YYYYMMDD format (filing date)").addHelpText("after", `
|
|
1494
|
+
Examples:
|
|
1495
|
+
dart-fss major ${ep.cliName} --corp "\uC0BC\uC131\uC804\uC790" --from 20230101 --to 20251231 --pretty
|
|
1496
|
+
dart-fss major ${ep.cliName} --corp "\uCE74\uCE74\uC624" --from 20250101 --to 20251231`).action(async (opts) => {
|
|
1486
1497
|
const globalOpts = getGlobalOpts5(group);
|
|
1487
1498
|
const apiKey = getApiKey(globalOpts.apiKey);
|
|
1488
1499
|
if (globalOpts.json) {
|
|
@@ -1515,7 +1526,9 @@ function registerSecuritiesFilingCommands(program) {
|
|
|
1515
1526
|
(ep) => ep.pattern === "dateRange"
|
|
1516
1527
|
);
|
|
1517
1528
|
for (const ep of endpoints) {
|
|
1518
|
-
group.command(ep.cliName).description(ep.summary).requiredOption("--corp <name-or-code>", 'Company name (e.g. "\uC0BC\uC131\uC804\uC790") or 8-digit corp_code').requiredOption("--from <YYYYMMDD>", "Start date in YYYYMMDD format (filing date). Data from 2015 onward").requiredOption("--to <YYYYMMDD>", "End date in YYYYMMDD format (filing date)").
|
|
1529
|
+
group.command(ep.cliName).description(ep.summary).requiredOption("--corp <name-or-code>", 'Company name (e.g. "\uC0BC\uC131\uC804\uC790") or 8-digit corp_code').requiredOption("--from <YYYYMMDD>", "Start date in YYYYMMDD format (filing date). Data from 2015 onward").requiredOption("--to <YYYYMMDD>", "End date in YYYYMMDD format (filing date)").addHelpText("after", `
|
|
1530
|
+
Examples:
|
|
1531
|
+
dart-fss securities ${ep.cliName} --corp "\uC0BC\uC131\uC804\uC790" --from 20230101 --to 20251231 --pretty`).action(async (opts) => {
|
|
1519
1532
|
const globalOpts = getGlobalOpts6(group);
|
|
1520
1533
|
const apiKey = getApiKey(globalOpts.apiKey);
|
|
1521
1534
|
if (globalOpts.json) {
|
|
@@ -1664,7 +1677,15 @@ function createDartProgram() {
|
|
|
1664
1677
|
const program = new Command();
|
|
1665
1678
|
program.name("dart-fss").description(
|
|
1666
1679
|
'DART Open API CLI \u2014 access Korea Financial Supervisory Service (FSS) electronic disclosure system.\nProvides 83 API endpoints for company filings, financial statements, equity disclosures, and more.\nAuthentication: set DART_API_KEY env var or pass --api-key. Get a key at https://opendart.fss.or.kr\nCompanies are identified by 8-digit corp_code or company name. Use "dart-fss lookup <name>" to find corp_code.\nOutput is JSON by default (compact single-line). Use --pretty for formatted output.\nRate limit: approximately 20,000 requests per day per API key.'
|
|
1667
|
-
).version("0.4.
|
|
1680
|
+
).version("0.4.7").option("--api-key <key>", "DART API key (default: DART_API_KEY env). Get one at https://opendart.fss.or.kr").option("--pretty", "Pretty-print JSON output (default: compact single-line JSON)").option("--output <file>", "Save result to file instead of stdout").option("--json <params>", "Pass raw API parameters as JSON string, bypassing flag parsing").option("--fields <f1,f2,...>", "Comma-separated field names to include in output (reduces response size for agents)").option("--dry-run", "Validate parameters and print the resolved API request without calling the API").addHelpText("after", `
|
|
1681
|
+
Examples:
|
|
1682
|
+
dart-fss lookup "\uC0BC\uC131\uC804\uC790"
|
|
1683
|
+
dart-fss disclosure company --corp "\uC0BC\uC131\uC804\uC790" --pretty
|
|
1684
|
+
dart-fss report employee --corp "\uC0BC\uC131\uC804\uC790" --year 2025 --quarter annual --pretty
|
|
1685
|
+
dart-fss financial single-account --corp "SK\uD558\uC774\uB2C9\uC2A4" --year 2025 --quarter annual --fields "account_nm,thstrm_amount"
|
|
1686
|
+
dart-fss major lawsuit --corp "\uCE74\uCE74\uC624" --from 20230101 --to 20251231
|
|
1687
|
+
dart-fss endpoints --json-output
|
|
1688
|
+
dart-fss schema employee`);
|
|
1668
1689
|
registerDisclosureCommands(program);
|
|
1669
1690
|
registerPeriodicReportCommands(program);
|
|
1670
1691
|
registerFinancialCommands(program);
|
package/dist/cli.js
CHANGED