gangtise-openapi-cli 0.42.0 → 0.43.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 +43 -36
- package/dist/src/cli.js +29 -11
- package/dist/src/commands/ai.js +7 -6
- package/dist/src/commands/fundamental.js +3 -3
- package/dist/src/commands/indicator.js +3 -3
- package/dist/src/commands/insight.js +5 -4
- package/dist/src/commands/quote.js +46 -12
- package/dist/src/commands/raw.js +2 -2
- package/dist/src/commands/shared.js +60 -8
- package/dist/src/commands/vault.js +2 -2
- package/dist/src/core/args.js +6 -5
- package/dist/src/core/auth.js +3 -2
- package/dist/src/core/client.js +114 -11
- package/dist/src/core/commandBodies.js +2 -1
- package/dist/src/core/download.js +9 -5
- package/dist/src/core/endpoints.js +103 -1
- package/dist/src/core/opinionDetail.js +16 -6
- package/dist/src/core/output.js +37 -8
- package/dist/src/core/perSecurity.js +29 -11
- package/dist/src/core/quoteSharding.js +19 -15
- package/dist/src/core/rowSink.js +21 -0
- package/dist/src/core/titleCache.js +28 -2
- package/dist/src/core/transport.js +3 -1
- package/dist/src/core/updateCheck.js +51 -0
- package/dist/src/version.js +19 -1
- package/gangtise-openapi/SKILL.md +50 -49
- package/gangtise-openapi/references/commands/ai.md +34 -15
- package/gangtise-openapi/references/commands/alternative.md +2 -2
- package/gangtise-openapi/references/commands/bond.md +1 -1
- package/gangtise-openapi/references/commands/fundamental.md +4 -4
- package/gangtise-openapi/references/commands/indicator.md +31 -29
- package/gangtise-openapi/references/commands/insight.md +40 -32
- package/gangtise-openapi/references/commands/quote.md +19 -19
- package/gangtise-openapi/references/commands/reference-and-lookup.md +18 -15
- package/gangtise-openapi/references/commands/vault.md +10 -7
- package/gangtise-openapi/references/errors.md +22 -23
- package/gangtise-openapi/references/examples.md +36 -34
- package/gangtise-openapi/references/fields.md +8 -6
- package/gangtise-openapi/references/lookup-ids.md +10 -8
- package/gangtise-openapi/references/response-schema.md +7 -7
- package/package.json +1 -1
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
## 中信行业分类(--industry 参数)
|
|
8
8
|
|
|
9
|
-
完整列表用 `reference constant-list --category citicIndustry
|
|
9
|
+
完整列表用 `reference constant-list --category citicIndustry`。**`--industry` 全命令通用首选用这套(`1008001xx`)**——opinion / research / foreign-report / official-account 都正确过滤,`vault wechat-message-list` 也认这一套(⚠️ 两个例外:`insight foreign-opinion` / `independent-opinion` 的 `--industry` **只认申万码 `104xx0000`,传中信码报 `100005`**);这套 ID 同时也是 `--research-area` **行业维度唯一全端点通吃的一套**(见下方研究方向)。
|
|
10
10
|
|
|
11
11
|
| ID | 行业 | ID | 行业 |
|
|
12
12
|
|----|------|----|------|
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
|
|
31
31
|
## 申万行业(--industry 参数)
|
|
32
32
|
|
|
33
|
-
完整列表用 `reference constant-list --category swIndustry
|
|
33
|
+
完整列表用 `reference constant-list --category swIndustry`。⚠️ 申万码(`104xx0000`)只在**部分** insight list 上可作 `--industry` 使用,且**与中信码不等效**——两套码行业成分不同,opinion 与 official-account 上取回的结果集就对不上,别混用;用于 `--research-area` 时**只有 `summary` / `pamirs-summary` 认,其余端点返 0**(不报错,与传乱码表现一致)。`vault wechat-message-list` 的 `--industry` **只认中信码**,传申万码报 `100005`——哪套码用于哪些命令的**权威口径见 `references/commands/reference-and-lookup.md`「行业 / 研究方向过滤——选哪套 category」**(含逐端点对照矩阵)。拿不准就统一用上方中信码。
|
|
34
34
|
|
|
35
35
|
| ID | 行业 | ID | 行业 | ID | 行业 |
|
|
36
36
|
|----|------|----|------|----|------|
|
|
@@ -105,15 +105,17 @@
|
|
|
105
105
|
| C800022831 | 里昂证券 | C800096075 | 海通国际 |
|
|
106
106
|
| C801303042 | 杰富瑞集团 | C800044779 | 加拿大皇家银行 |
|
|
107
107
|
|
|
108
|
+
同一家机构可能对应多个 ID(如高盛有三个)。拿不准用哪个时,用 `reference institution-search --keyword <名称>` 查,按返回的 `usageScopes` 选能喂给目标参数的那个。
|
|
109
|
+
|
|
108
110
|
---
|
|
109
111
|
|
|
110
112
|
## 常用研究方向(--research-area 参数)
|
|
111
113
|
|
|
112
|
-
`--research-area` 吃两个维度:**行业**用上方「中信行业分类」表的 `1008001xx`(category `citicIndustry`),**方向**用下表的 `122000xxx`(category `gangtiseIndustry`)。适用 opinion / summary / pamirs-summary / roadshow / site-visit / forum / my-conference(strategy
|
|
114
|
+
`--research-area` 吃两个维度:**行业**用上方「中信行业分类」表的 `1008001xx`(category `citicIndustry`),**方向**用下表的 `122000xxx`(category `gangtiseIndustry`)。适用 opinion / summary / pamirs-summary / roadshow / site-visit / forum / my-conference / highlight(strategy 无此参数;highlight 不接受申万码)。
|
|
113
115
|
|
|
114
|
-
⚠️ **`gangtiseIndustry`
|
|
116
|
+
⚠️ **`gangtiseIndustry` 里只有下表这些方向码,不含任何行业码**——去它那里找「食品饮料」找不到,行业码要查 `citicIndustry`。
|
|
115
117
|
|
|
116
|
-
|
|
118
|
+
**研究方向(citicIndustry 没有):**
|
|
117
119
|
|
|
118
120
|
| ID | 方向 | ID | 方向 |
|
|
119
121
|
|----|------|----|------|
|
|
@@ -121,7 +123,7 @@
|
|
|
121
123
|
| 122000003 | 固收 | 122000004 | 金工 |
|
|
122
124
|
| 122000005 | 海外 | 122000007 | 其他 |
|
|
123
125
|
|
|
124
|
-
行业维度的 ID 直接用上方「中信行业分类」表(`1008001xx
|
|
126
|
+
行业维度的 ID 直接用上方「中信行业分类」表(`1008001xx`),这是在所有带 `--research-area` 的端点上都生效的一套。⚠️ **申万码 `104xx0000` 用于 `--research-area` 只有 `summary` / `pamirs-summary` 认**,opinion / roadshow / site-visit / forum / my-conference 一律返 0(与传乱码表现一致,不报错)。反过来方向码 `122000xxx` 在 `pamirs-summary` 上返 0。完整对照矩阵见 `commands/reference-and-lookup.md`。
|
|
125
127
|
|
|
126
128
|
---
|
|
127
129
|
|
|
@@ -149,7 +151,7 @@
|
|
|
149
151
|
|
|
150
152
|
## 外资研报区域(--region 参数)
|
|
151
153
|
|
|
152
|
-
完整列表用 `reference constant-list --category regionCategory`
|
|
154
|
+
完整列表用 `reference constant-list --category regionCategory`。⚠️ `insight foreign-opinion list --region` 只收其中 6 个:`cn` / `cnHk` / `cnTw` / `us` / `jp` / `uk`
|
|
153
155
|
|
|
154
156
|
| ID | 区域 | ID | 区域 | ID | 区域 |
|
|
155
157
|
|----|------|----|------|----|------|
|
|
@@ -165,7 +167,7 @@
|
|
|
165
167
|
|
|
166
168
|
## 公告分类
|
|
167
169
|
|
|
168
|
-
|
|
170
|
+
用于 `insight announcement list` / `announcement-hk list` 的 `--category`。完整列表用 `reference constant-list --category aShareAnnouncementCategory`(港股用 `hkShareAnnouncementCategory`,美股用 `usShareAnnouncementCategory`,`103980xxx` 段),树形结构含一级和二级分类。
|
|
169
171
|
|
|
170
172
|
### 一级分类
|
|
171
173
|
|
|
@@ -4,7 +4,7 @@ CLI 自动处理 envelope:`{code, msg, data}` 信封会按 `code === "000000"`
|
|
|
4
4
|
|
|
5
5
|
> 例外:`indicator`(EDE)四个接口(`search` / `cross-section` / `time-series` / `screener`)成功时**双层信封**(`data` 里再裹一层 `{code, status, data}`)。内层字段名为 `securityCodeList` / `securityNameList` / `indicatorList[{code,name,dataType}]`(screener 另带 `field`),`values` 是 2D 矩阵:**截面与 screener 为 `[证券][指标]`**、时序为 `[序列][日期]`。
|
|
6
6
|
>
|
|
7
|
-
> **缺数据 vs 代码写错**:无数据 / 无覆盖一律保留行列并给占位单元格——**占位值统一为 `null`**;⚠️ 报告期类指标(`is_*`)的时序只有报告期末那几行是真值,其余全是 `null`,详见 `commands/indicator.md`。**代码写错则直接报 `100003` 并点名**(指标 code 拼错 →「指标 xxx 不存在」;证券 code 后缀错 →「xxx 不是有效证券或者板块ID」,美股是 `.O`/`.N` 不是 `.US`),**无论同批有没有正确的 code 都会报**。CLI 的 `indicator`
|
|
7
|
+
> **缺数据 vs 代码写错**:无数据 / 无覆盖一律保留行列并给占位单元格——**占位值统一为 `null`**;⚠️ 报告期类指标(`is_*`)的时序只有报告期末那几行是真值,其余全是 `null`,详见 `commands/indicator.md`。**代码写错则直接报 `100003` 并点名**(指标 code 拼错 →「指标 xxx 不存在」;证券 code 后缀错 →「xxx 不是有效证券或者板块ID」,美股是 `.O`/`.N` 不是 `.US`),**无论同批有没有正确的 code 都会报**。CLI 的 `indicator` 子命令已二次解包、拍平成宽表;服务端没有返回请求里的某个指标或证券时标 `partial` + `omittedIndicators` / `omittedSecurities`、退出码 3(写错的 code 会直接报 `100003`,所以这种情况很少出现)。**`screener` 例外**:把缺列的变量当作无法求值,按表达式的**布尔结构**判断是否还有分支能成立(`A && B` 要两边、`A || B` 只要一边)。一条都不剩 → **退出码 1 且不输出**(那些行以「通过了该条件」的名义呈现,而条件根本无法证明被执行过);仍有分支可求值、或缺的只是输出用的辅助变量 → `partial` + 退出码 3。直接 `raw call indicator.*` 只会剥外层,内层需自行处理。
|
|
8
8
|
|
|
9
9
|
## 通用模式(5 类)
|
|
10
10
|
|
|
@@ -14,7 +14,7 @@ CLI 自动处理 envelope:`{code, msg, data}` 信封会按 `code === "000000"`
|
|
|
14
14
|
| 下载 | stdout = 文件路径字符串 | 直接读取整行 |
|
|
15
15
|
| AI 内容 | `{content: "markdown文本"}` | 直接呈现 `content` |
|
|
16
16
|
| 列式 K 线 | `{fieldList: [...], list: [[...], ...]}` 或 `{list: [{...}]}` | CLI 已规范化为对象 list |
|
|
17
|
-
| 异步任务 | 提交:`{dataId}
|
|
17
|
+
| 异步任务 | 提交:`{dataId, status, hint}`;查询:仍在生成 `{dataId, status:"pending", hint}`(退出 0),完成 `{date, content}`,终态失败 stderr 报错、退出 1 | 详见 `commands/ai.md` |
|
|
18
18
|
|
|
19
19
|
## 全命令字段对照
|
|
20
20
|
|
|
@@ -61,23 +61,23 @@ CLI 自动处理 envelope:`{code, msg, data}` 信封会按 `code === "000000"`
|
|
|
61
61
|
| reference concept-search | `{returnedCount, list}` | `list[].conceptId` / `list[].conceptName` / `list[].matchScore` |
|
|
62
62
|
| reference sector-search | `{returnedCount, list}` | `list[].sectorId` / `list[].sectorName` / `list[].hierarchy`(层级路径) / `list[].matchScore` |
|
|
63
63
|
| reference sector-constituents | `{total, list}` | `list[].gtsCode` / `list[].gtsName`;total=0 说明 sectorId 不对(先 sector-search 确认) |
|
|
64
|
-
| quote day-kline
|
|
64
|
+
| quote day-kline(及已弃用的 day-kline-hk / day-kline-us / index-day-kline) | `{fieldList, list}` 或规范化后 `{list: [{...}]}` | `tradeDate` / `securityCode` / `open` / `close` / `pctChange` / `volume` / `amount`(全球指数为 `null`)/ `adjustFactor`(指数为 `null`,ETF 有值);四者字段相同,均不含指数名称 |
|
|
65
65
|
| quote minute-kline | `{list: [{...}]}` | `tradeTime` / `open` / `close` / `volume` |
|
|
66
66
|
| quote realtime | `{fieldList, list, total}` 或规范化后 `{list: [{...}]}` | `securityCode` / `exchange` / `tradeDate` / `tradeTime` / `tradeStatus` / `open` / `high` / `low` / `latestPrice` / `preClose` / `change` / `pctChange` / `volume` / `amount` / `amplitude`(共 15 个,**无 `close`、无市值、无 `turnoverRate` / `volumeRatio`**;美股 `amount`、全球指数 `volume` / `amount` / `amplitude` 为 `null`) |
|
|
67
67
|
| quote fund-flow | `{fieldList, list, total}` 列式 → 规范化后 `{list: [{...}], total}` 宽表 | `securityCode` / `tradeDate` + 请求的字段(`mainNetInflow` / `largeInflow` / `xlargeOutflow` / …) |
|
|
68
68
|
| fundamental income-statement / balance-sheet / cash-flow(含 quarterly / -hk / -us) | `{total, list: [{...}]}` | `fiscalYear` / `period` / `endDate` / `companyName` / `companyType` / `currency` / `unit` + 各 `--field` 字段;港股/美股另含 `timeCovered`(不规则跨度)。⚠️ A 股 `*-quarterly` 单季表的 `companyType` 返回未映射的数字码(如 `102119999`),`currency` 正常;累计口径的三张表两列均正确。科目数字不受影响 |
|
|
69
69
|
| fundamental main-business | `{fieldList, list}` 列式 → 规范化后 `{list: [{...}]}` | 前 3 列恒定:`periodName` / `periodEndDate` / `categoryName`(分项名,随 `--breakdown` 变)+ `opRevenue` / `opRevenueYoy` / `opRevenueRatio` / `opCost` / `opCostYoy` / `opCostRatio` / `grossProfit` / `grossProfitYoy` / `grossProfitRatio` / `grossMargin` / `grossMarginYoy` / `grossMarginRatio`(共 15 个)。`--field` 只能从后 12 个里选 |
|
|
70
|
-
| fundamental valuation-analysis(仅 A 股) | `{fieldList, list}` 列式 → 规范化后 `{list: [{...}]}` | `tradeDate` / `value` / `percentileRank` / `average` / `median` / `upper1Std` / `lower1Std`(共 7 个);**无 `securityCode
|
|
70
|
+
| fundamental valuation-analysis(仅 A 股) | `{fieldList, list}` 列式 → 规范化后 `{list: [{...}]}` | `tradeDate` / `value` / `percentileRank` / `average` / `median` / `upper1Std` / `lower1Std`(共 7 个);**无 `securityCode`**——`--field` 只传不存在的名字(含 `securityCode`)时接口返回 0 行、不报错,与数值列混传时 CLI 报错退出 1 |
|
|
71
71
|
| fundamental earning-forecast(仅 A 股) | `{securityCode, securityName, updateList: [...]}` | `updateList[].date` / `updateList[].fieldList[].forecastYear` + 各 consensus 指标 |
|
|
72
|
-
| fundamental top-holders | `{holderType, list: [{...}]}` | `reportPeriod` / `rank` / `shareholderName` / `holdingNum` / `holdingPct` / `chgNum` / `chgPct` |
|
|
72
|
+
| fundamental top-holders | `{holderType, list: [{...}]}` | `reportPeriod` / `rank` / `shareholderName` / `shareholderType` / `holdingNum` / `holdingPct` / `chgNum` / `chgPct` / `shareCategory` |
|
|
73
73
|
| ai knowledge-batch | `{list: [{...}]}` | `list[].resourceType` / `list[].sourceId` / `list[].title` / `list[].summary` |
|
|
74
74
|
| ai security-clue | `{list, total}` | `list[].securityCode` / `list[].title` / `list[].clueType` / `list[].clueDate` |
|
|
75
75
|
| ai stock-summary | `{list, total}` | `list[].securityCode` / `list[].securityName` / `list[].summary` / `list[].date`;无看点的证券不在 list 中 |
|
|
76
|
-
| ai one-pager / investment-logic / peer-comparison / research-outline | `{content}` | `content` 直接呈现(Markdown) |
|
|
76
|
+
| ai one-pager / investment-logic / peer-comparison / research-outline | `{content}`(one-pager 另带 `date`:生成日期 `yyyy-MM-dd`) | `content` 直接呈现(Markdown) |
|
|
77
77
|
| ai theme-tracking | `[{type, date, content}, ...]`(列表,每元素一份报告) | 遍历筛选 `type === "morning" / "night"`;某主题在该日期可能只有一种类型,或两种都没(空列表) |
|
|
78
78
|
| ai hot-topic | `{list, total}` | `list[].title` / `list[].reportDate` / `list[].category` / `list[].topics[].topicTitle` / `list[].topics[].driverEvent` / `list[].topics[].investLogic` |
|
|
79
79
|
| ai management-discuss-* | `{securityCode, reportDate, discussionDimension, content}` | `content` 为字符串(业绩会)或字符串数组(财报) |
|
|
80
|
-
| ai earnings-review | `{dataId}`(提交)/ `{status:"pending"}` 或 `{date, content}`(check) | `dataId` 用于轮询;最终 `content` 直接呈现 |
|
|
80
|
+
| ai earnings-review | `{dataId, status, hint}`(提交)/ `{dataId, status:"pending", hint}` 或 `{date, content}`(check) | `dataId` 用于轮询;最终 `content` 直接呈现 |
|
|
81
81
|
| ai viewpoint-debate | 同 earnings-review | — |
|
|
82
82
|
| vault drive-list | `{list, total}` | `list[].fileId`(下载用 `--file-id`)/ `list[].title` / `list[].fileType` / `list[].uploadTime` |
|
|
83
83
|
| vault drive-download | 文件路径(stdout) | — |
|