gangtise-openapi-cli 0.27.0 → 0.28.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 +84 -18
- package/dist/src/cli.js +32 -29
- package/dist/src/core/args.js +135 -19
- package/dist/src/core/asyncContent.js +32 -5
- package/dist/src/core/client.js +19 -10
- package/dist/src/core/errors.js +116 -18
- package/dist/src/core/indicatorMatrix.js +5 -1
- package/dist/src/core/transport.js +15 -0
- package/dist/src/version.js +1 -1
- package/gangtise-openapi/SKILL.md +94 -47
- package/gangtise-openapi/references/commands/ai.md +4 -4
- package/gangtise-openapi/references/commands/fundamental.md +6 -4
- package/gangtise-openapi/references/commands/indicator.md +48 -37
- package/gangtise-openapi/references/commands/insight.md +1 -0
- package/gangtise-openapi/references/commands/quote.md +1 -1
- package/gangtise-openapi/references/examples.md +37 -32
- package/gangtise-openapi/references/response-schema.md +3 -3
- package/package.json +1 -1
|
@@ -182,7 +182,7 @@
|
|
|
182
182
|
gangtise ai earnings-review-check --data-id xxx --format json
|
|
183
183
|
- 若 {status: "pending"} → 再等再 check(最多 3 次)
|
|
184
184
|
- 若 {date, content} → 取 content 呈现
|
|
185
|
-
- 若 410111
|
|
185
|
+
- 若 410111(新码 140002)→ 终态失败,**不要重提同一任务**(会再扣 50 积分且结果相同);改参数后再提交,或直接告知用户该期数据暂不可用
|
|
186
186
|
```
|
|
187
187
|
|
|
188
188
|
## 例 13:题材画像 + 成分股(先查 ID 再拉两接口)
|
|
@@ -222,37 +222,42 @@
|
|
|
222
222
|
5. 呈现:total + 前 20 只列表
|
|
223
223
|
```
|
|
224
224
|
|
|
225
|
-
## 例 15
|
|
226
|
-
|
|
227
|
-
**用户**:"
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
gangtise indicator cross-section --indicator
|
|
252
|
-
--
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
225
|
+
## 例 15:多证券已实现财务 / 估值指标(EDE 多截面,按日期语义拆分)
|
|
226
|
+
|
|
227
|
+
**用户**:"把茅台、五粮液、宁德时代 2025 年营收和已实现 EPS,与最新 PE/PB 做成一张表"
|
|
228
|
+
|
|
229
|
+
> 示例日期为**截至 2026-07-23 的实测快照**:`2026-07-22`=当时最新交易日、`2026-03-31`=当时最近有 PB 的报告期末;实跑时替换为当下的最新交易日 / 最近报告期末。
|
|
230
|
+
|
|
231
|
+
```
|
|
232
|
+
1. 路由 → indicator:多证券批量取一组已实现财务 / 估值指标;不是逐只 fundamental,也不是 EDB。
|
|
233
|
+
若改成单票、盈利预测/一致预期、估值历史分位、完整报表或 OHLCV/K 线,则分别走 fundamental / quote 专用命令。
|
|
234
|
+
2. 每个概念都先 search --format json(绝不猜 code,也不能只取第一条):
|
|
235
|
+
gangtise indicator search --keyword 营业收入 --limit 10 --format json
|
|
236
|
+
gangtise indicator search --keyword 基本每股收益 --limit 10 --format json
|
|
237
|
+
gangtise indicator search --keyword 市盈率 --limit 10 --format json
|
|
238
|
+
gangtise indicator search --keyword 市净率 --limit 10 --format json
|
|
239
|
+
对每个候选同时核对:
|
|
240
|
+
- indicatorName + description:累计/单季、营业收入/营业总收入、已实现/预测等语义准确
|
|
241
|
+
- scopeList:覆盖全部三只 A 股;缺失/null/空也视为不通过
|
|
242
|
+
- parameterList:补 required 参数并核对枚举
|
|
243
|
+
任一不符 → 回退相应专用接口。
|
|
244
|
+
3. 三类指标日期语义不同 → 拆三次截面(省略 reportType 即取合并口径;⚠️ 该枚举 label 与实测不符、value=2/4 会 999999,需指定报表口径改用 fundamental income-statement --report-type):
|
|
245
|
+
a) 财务(营收/EPS)用报告期末 2025-12-31:
|
|
246
|
+
gangtise indicator cross-section \
|
|
247
|
+
--indicator is_op_rev --indicator is_eps_bas \
|
|
248
|
+
--security 600519.SH --security 000858.SZ --security 300750.SZ \
|
|
249
|
+
--date 2025-12-31 --format json
|
|
250
|
+
b) PE 日频,用最新交易日 2026-07-22(此日 PB 为 null,勿并入):
|
|
251
|
+
gangtise indicator cross-section --indicator finc_pe_ttm \
|
|
252
|
+
--security 600519.SH --security 000858.SZ --security 300750.SZ \
|
|
253
|
+
--date 2026-07-22 --format json
|
|
254
|
+
c) PB(MRQ) 只在报告期末打值,用最近报告期末 2026-03-31:
|
|
255
|
+
gangtise indicator cross-section --indicator finc_pb_mrq \
|
|
256
|
+
--security 600519.SH --security 000858.SZ --security 300750.SZ \
|
|
257
|
+
--date 2026-03-31 --format json
|
|
258
|
+
4. 按 security 合并三张宽表(各取所需日期的值);不要把不同日期语义的指标塞进同一个 --date。
|
|
259
|
+
5. 计费:search 免费;三次取数各按请求单元格数量计费,每次不足 100 单元格按 100 计。
|
|
260
|
+
6. 无数据:单元格缺值返回 null 且不丢证券行;整个查询无数据仍可能报 999999,先核对日期语义、scopeList、公司类型和指标参数。
|
|
256
261
|
```
|
|
257
262
|
|
|
258
263
|
## 例 16:A 股资金流向(个股 vs 全市场按日分片)
|
|
@@ -55,8 +55,8 @@ CLI 自动处理 envelope:`{code, msg, data}` 信封会按 `code === "000000"`
|
|
|
55
55
|
| quote fund-flow | `{fieldList, list, total}` 列式 → 规范化后 `{list: [{...}], total}` 宽表 | `securityCode` / `tradeDate` + 请求的字段(`mainNetInflow` / `largeInflow` / `xlargeOutflow` / …) |
|
|
56
56
|
| fundamental income-statement / balance-sheet / cash-flow(含 quarterly / -hk / -us) | `{total, list: [{...}]}` | `fiscalYear` / `period` / `endDate` / `companyName` / `companyType`(企业类型名称,如 `一般企业`/`银行`)+ 各 `--field` 字段;港股/美股另含 `timeCovered`(不规则跨度) |
|
|
57
57
|
| fundamental main-business | `{list: [{...}]}` | `endDate` / `breakdownName` / `revenue` / `revenueRatio` / `grossProfitRatio` |
|
|
58
|
-
| fundamental valuation-analysis | `{list: [{...}]}` | `tradeDate` / `value` / `percentileRank` |
|
|
59
|
-
| fundamental earning-forecast | `{securityCode, securityName, updateList: [...]}` | `updateList[].date` / `updateList[].fieldList[].forecastYear` + 各 consensus 指标 |
|
|
58
|
+
| fundamental valuation-analysis(仅 A 股) | `{list: [{...}]}` | `tradeDate` / `value` / `percentileRank` |
|
|
59
|
+
| fundamental earning-forecast(仅 A 股) | `{securityCode, securityName, updateList: [...]}` | `updateList[].date` / `updateList[].fieldList[].forecastYear` + 各 consensus 指标 |
|
|
60
60
|
| fundamental top-holders | `{holderType, list: [{...}]}` | `reportPeriod` / `rank` / `shareholderName` / `holdingNum` / `holdingPct` / `chgNum` / `chgPct` |
|
|
61
61
|
| ai knowledge-batch | `{list: [{...}]}` | `list[].resourceType` / `list[].sourceId` / `list[].title` / `list[].summary` |
|
|
62
62
|
| ai security-clue | `{list, total}` | `list[].securityCode` / `list[].title` / `list[].clueType` / `list[].clueDate` |
|
|
@@ -79,7 +79,7 @@ CLI 自动处理 envelope:`{code, msg, data}` 信封会按 `code === "000000"`
|
|
|
79
79
|
| alternative edb-data | 列表,每行 `{date, <indicatorId>: value, ...}` 宽表 | `date` + 每个 `--indicator-id` 一列(该日指标值) |
|
|
80
80
|
| alternative concept-info | `{conceptId, conceptName, ...}`(单对象,**非列表**) | `conceptName` / `definition` / `investmentLogic` / `industrySpace` / `competitiveLandscape` / `keyEvents[].date` / `keyEvents[].content`;文本字段未配置为 `null` |
|
|
81
81
|
| alternative concept-securities | `{conceptId, conceptName, securityCount, securityDetail}`(单对象,分组) | `securityCount` / `securityDetail[].groupName` / `securityDetail[].securityList[].securityCode` / `.securityName` / `.isKey` / `.inclusionReason`;无成分股时 `securityDetail` 为 `null` |
|
|
82
|
-
| indicator search | `[{indicatorCode, indicatorName, ...}]`(列表) | `indicatorCode` / `indicatorName` / `description` / `
|
|
82
|
+
| indicator search | `[{indicatorCode, indicatorName, ...}]`(列表) | `indicatorCode` / `indicatorName` / `description` / `scopeList[].market` / `scopeList[].securityType` / `parameterList[].paramKey` / `.enumList[].value`(专属参数及枚举) / `score` |
|
|
83
83
|
| indicator cross-section | CLI 拍平为宽表 `{list, total}` | `list[].date` / `list[].security` / `list[].name` + 每个指标名一列;**单日多指标 × 多证券**,每行一只证券 |
|
|
84
84
|
| indicator time-series | CLI 拍平为宽表 `{list, total}` | `list[].date` + 序列列:单证券时列=各指标、多证券时列=各证券;每行一个日期 |
|
|
85
85
|
| lookup broker-org / meeting-org list | `[...]` | `[].id` / `[].name` |
|