gangtise-openapi-cli 0.10.1 → 0.10.3
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/src/cli.js +12 -10
- package/dist/src/version.js +1 -1
- package/package.json +1 -1
package/dist/src/cli.js
CHANGED
|
@@ -390,9 +390,11 @@ fundamental.command("valuation-analysis").requiredOption("--security-code <code>
|
|
|
390
390
|
const client = await createClient();
|
|
391
391
|
await printData(await client.call("fundamental.valuation-analysis", { securityCode: options.securityCode, indicator: options.indicator, startDate: options.startDate, endDate: options.endDate, limit: options.limit ? Number(options.limit) : undefined, fieldList: maybeArray(options.field) }), parseFormat(options.format), options.output);
|
|
392
392
|
});
|
|
393
|
-
fundamental.command("earning-forecast").requiredOption("--security-code <code>").option("--start-date <date>").option("--end-date <date>").option("--consensus <name>", "Consensus indicator: netIncome/netIncomeYoy/eps/pe/bps/pb/peg/roe/ps", collectList, []).option("--format <format>", "Output format", "table").option("--output <path>").action(async (options) => {
|
|
393
|
+
fundamental.command("earning-forecast").requiredOption("--security-code <code>").option("--start-date <date>", "Start date (default: 1 year before end-date)").option("--end-date <date>", "End date (default: today)").option("--consensus <name>", "Consensus indicator: netIncome/netIncomeYoy/eps/pe/bps/pb/peg/roe/ps", collectList, []).option("--format <format>", "Output format", "table").option("--output <path>").action(async (options) => {
|
|
394
394
|
const client = await createClient();
|
|
395
|
-
|
|
395
|
+
const endDate = options.endDate ?? new Date().toISOString().slice(0, 10);
|
|
396
|
+
const startDate = options.startDate ?? new Date(Date.now() - 365 * 24 * 60 * 60 * 1000).toISOString().slice(0, 10);
|
|
397
|
+
await printData(await client.call("fundamental.earning-forecast", { securityCode: options.securityCode, startDate, endDate, consensusList: maybeArray(options.consensus) }), parseFormat(options.format), options.output);
|
|
396
398
|
});
|
|
397
399
|
program.addCommand(fundamental);
|
|
398
400
|
const ai = new Command("ai").description("AI APIs");
|
|
@@ -445,8 +447,8 @@ ai.command("earnings-review").requiredOption("--security-code <code>").requiredO
|
|
|
445
447
|
attempts++;
|
|
446
448
|
try {
|
|
447
449
|
const contentResult = await client.call("ai.earnings-review.get-content", { dataId });
|
|
448
|
-
if (contentResult?.
|
|
449
|
-
await printData(contentResult
|
|
450
|
+
if (contentResult?.content) {
|
|
451
|
+
await printData(contentResult, parseFormat(options.format), options.output);
|
|
450
452
|
return;
|
|
451
453
|
}
|
|
452
454
|
}
|
|
@@ -467,8 +469,8 @@ ai.command("earnings-review-check").requiredOption("--data-id <id>", "dataId fro
|
|
|
467
469
|
const client = await createClient();
|
|
468
470
|
try {
|
|
469
471
|
const contentResult = await client.call("ai.earnings-review.get-content", { dataId: options.dataId });
|
|
470
|
-
if (contentResult?.
|
|
471
|
-
await printData(contentResult
|
|
472
|
+
if (contentResult?.content) {
|
|
473
|
+
await printData(contentResult, parseFormat(options.format), options.output);
|
|
472
474
|
return;
|
|
473
475
|
}
|
|
474
476
|
process.stdout.write(`${JSON.stringify({ dataId: options.dataId, status: "pending", hint: "Content not ready yet, retry in ~2 minutes" })}\n`);
|
|
@@ -544,8 +546,8 @@ ai.command("viewpoint-debate").requiredOption("--viewpoint <text>", "Viewpoint t
|
|
|
544
546
|
attempts++;
|
|
545
547
|
try {
|
|
546
548
|
const contentResult = await client.call("ai.viewpoint-debate.get-content", { dataId });
|
|
547
|
-
if (contentResult?.
|
|
548
|
-
await printData(contentResult
|
|
549
|
+
if (contentResult?.content) {
|
|
550
|
+
await printData(contentResult, parseFormat(options.format), options.output);
|
|
549
551
|
return;
|
|
550
552
|
}
|
|
551
553
|
}
|
|
@@ -566,8 +568,8 @@ ai.command("viewpoint-debate-check").requiredOption("--data-id <id>", "dataId fr
|
|
|
566
568
|
const client = await createClient();
|
|
567
569
|
try {
|
|
568
570
|
const contentResult = await client.call("ai.viewpoint-debate.get-content", { dataId: options.dataId });
|
|
569
|
-
if (contentResult?.
|
|
570
|
-
await printData(contentResult
|
|
571
|
+
if (contentResult?.content) {
|
|
572
|
+
await printData(contentResult, parseFormat(options.format), options.output);
|
|
571
573
|
return;
|
|
572
574
|
}
|
|
573
575
|
process.stdout.write(`${JSON.stringify({ dataId: options.dataId, status: "pending", hint: "Content not ready yet, retry in ~2 minutes" })}\n`);
|
package/dist/src/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// Auto-generated — DO NOT EDIT
|
|
2
|
-
export const CLI_VERSION = "0.10.
|
|
2
|
+
export const CLI_VERSION = "0.10.3";
|