gangtise-openapi-cli 0.10.0 → 0.10.1
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 +1 -0
- package/dist/src/cli.js +36 -13
- package/dist/src/version.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -348,3 +348,4 @@ gangtise raw call insight.opinion.list --body '{"from":0,"size":120}'
|
|
|
348
348
|
| `999997` | 未开通接口权限 |
|
|
349
349
|
| `999999` | Gangtise 系统错误,请稍后重试 |
|
|
350
350
|
| `433007` | 不支持该数据源(`knowledge-resource-download` 需正确的 `resourceType + sourceId` 组合) |
|
|
351
|
+
| `430007` | 行情查询超出限制(日K线/分钟K线不传 `--security` 返回全市场,数据量过大;请指定证券代码或缩短日期范围) |
|
package/dist/src/cli.js
CHANGED
|
@@ -443,10 +443,17 @@ ai.command("earnings-review").requiredOption("--security-code <code>").requiredO
|
|
|
443
443
|
const delayMs = 15_000;
|
|
444
444
|
while (attempts < maxAttempts) {
|
|
445
445
|
attempts++;
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
446
|
+
try {
|
|
447
|
+
const contentResult = await client.call("ai.earnings-review.get-content", { dataId });
|
|
448
|
+
if (contentResult?.data?.content) {
|
|
449
|
+
await printData(contentResult.data, parseFormat(options.format), options.output);
|
|
450
|
+
return;
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
catch (error) {
|
|
454
|
+
if (!(error instanceof ApiError && (error.code === "410110" || error.message?.includes("生成中")))) {
|
|
455
|
+
throw error;
|
|
456
|
+
}
|
|
450
457
|
}
|
|
451
458
|
if (attempts < maxAttempts) {
|
|
452
459
|
process.stderr.write(`Attempt ${attempts}/${maxAttempts}: content not ready, retrying in 15s...\n`);
|
|
@@ -535,10 +542,17 @@ ai.command("viewpoint-debate").requiredOption("--viewpoint <text>", "Viewpoint t
|
|
|
535
542
|
const delayMs = 15_000;
|
|
536
543
|
while (attempts < maxAttempts) {
|
|
537
544
|
attempts++;
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
545
|
+
try {
|
|
546
|
+
const contentResult = await client.call("ai.viewpoint-debate.get-content", { dataId });
|
|
547
|
+
if (contentResult?.data?.content) {
|
|
548
|
+
await printData(contentResult.data, parseFormat(options.format), options.output);
|
|
549
|
+
return;
|
|
550
|
+
}
|
|
551
|
+
}
|
|
552
|
+
catch (error) {
|
|
553
|
+
if (!(error instanceof ApiError && (error.code === "410110" || error.message?.includes("生成中")))) {
|
|
554
|
+
throw error;
|
|
555
|
+
}
|
|
542
556
|
}
|
|
543
557
|
if (attempts < maxAttempts) {
|
|
544
558
|
process.stderr.write(`Attempt ${attempts}/${maxAttempts}: content not ready, retrying in 15s...\n`);
|
|
@@ -550,12 +564,21 @@ ai.command("viewpoint-debate").requiredOption("--viewpoint <text>", "Viewpoint t
|
|
|
550
564
|
});
|
|
551
565
|
ai.command("viewpoint-debate-check").requiredOption("--data-id <id>", "dataId from viewpoint-debate").option("--format <format>", "Output format", "json").option("--output <path>").action(async (options) => {
|
|
552
566
|
const client = await createClient();
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
567
|
+
try {
|
|
568
|
+
const contentResult = await client.call("ai.viewpoint-debate.get-content", { dataId: options.dataId });
|
|
569
|
+
if (contentResult?.data?.content) {
|
|
570
|
+
await printData(contentResult.data, parseFormat(options.format), options.output);
|
|
571
|
+
return;
|
|
572
|
+
}
|
|
573
|
+
process.stdout.write(`${JSON.stringify({ dataId: options.dataId, status: "pending", hint: "Content not ready yet, retry in ~2 minutes" })}\n`);
|
|
574
|
+
}
|
|
575
|
+
catch (error) {
|
|
576
|
+
if (error instanceof ApiError && (error.code === "410110" || error.message?.includes("生成中"))) {
|
|
577
|
+
process.stdout.write(`${JSON.stringify({ dataId: options.dataId, status: "pending", hint: "Content not ready yet, retry in ~2 minutes" })}\n`);
|
|
578
|
+
return;
|
|
579
|
+
}
|
|
580
|
+
throw error;
|
|
557
581
|
}
|
|
558
|
-
process.stdout.write(`${JSON.stringify({ dataId: options.dataId, status: "pending", hint: "Content not ready yet, retry in ~2 minutes" })}\n`);
|
|
559
582
|
});
|
|
560
583
|
const vault = new Command("vault").description("Vault APIs");
|
|
561
584
|
vault.command("drive-list").option("--from <number>", "Starting offset", "0").option("--size <number>", "Total rows to return; omit to fetch all").option("--start-time <datetime>").option("--end-time <datetime>").option("--keyword <text>").option("--file-type <number>", "File type", collectNumberList, []).option("--space-type <number>", "Space type", collectNumberList, []).option("--format <format>", "Output format", "table").option("--output <path>").action(async (options) => {
|
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.1";
|