gangtise-openapi-cli 0.31.0 → 0.33.0
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 +22 -11
- package/dist/src/cli.js +79 -62
- package/dist/src/core/args.js +0 -22
- package/dist/src/core/client.js +55 -8
- package/dist/src/core/commandBodies.js +11 -6
- package/dist/src/core/endpoints.js +18 -0
- package/dist/src/core/errors.js +7 -2
- package/dist/src/core/indicatorMatrix.js +31 -22
- package/dist/src/core/output.js +8 -0
- package/dist/src/core/printer.js +13 -11
- package/dist/src/version.js +1 -1
- package/gangtise-openapi/SKILL.md +45 -22
- package/gangtise-openapi/references/commands/indicator.md +135 -44
- package/gangtise-openapi/references/commands/insight.md +59 -5
- package/gangtise-openapi/references/commands/reference-and-lookup.md +22 -7
- package/gangtise-openapi/references/commands/vault.md +3 -3
- package/gangtise-openapi/references/examples.md +29 -3
- package/gangtise-openapi/references/lookup-ids.md +7 -5
- package/gangtise-openapi/references/response-schema.md +4 -2
- 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`(30 条)。**`--industry` 全命令通用首选用这套(`1008001xx`)**——opinion / research / foreign-report / official-account 都正确过滤(⚠️ 三个例外:`insight foreign-opinion` / `independent-opinion` 传了 `--industry` 拿不到数据、且 **payload 是字面 `null` 不是空 list**;`vault wechat-message-list` 的 `--industry` 两套码都不生效、连乱码也返全量);这套 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`(31 条)。⚠️ 申万码(`104xx0000`)只在**部分** insight list 上可作 `--industry` 使用,且**与中信码不等效**——两套码行业成分不同,实测 opinion 与 official-account 上取回的结果集就对不上(同一行业相差约 2%–5%),别混用;用于 `--research-area` 时**只有 `summary` / `pamirs-summary` 认,其余端点返 0**(不报错,与传乱码表现一致)。`vault wechat-message-list` 的 `--industry` **两套码都不生效**(连不存在的码也返全量,该过滤整个被忽略)——哪套码用于哪些命令的**权威口径见 `references/commands/reference-and-lookup.md`「行业 / 研究方向过滤——选哪套 category」**(含逐端点实测矩阵),勿在此重复枚举。拿不准就统一用上方中信码。
|
|
34
34
|
|
|
35
35
|
| ID | 行业 | ID | 行业 | ID | 行业 |
|
|
36
36
|
|----|------|----|------|----|------|
|
|
@@ -109,9 +109,11 @@
|
|
|
109
109
|
|
|
110
110
|
## 常用研究方向(--research-area 参数)
|
|
111
111
|
|
|
112
|
-
`--research-area`
|
|
112
|
+
`--research-area` 吃两个维度:**行业**用上方「中信行业分类」表的 `1008001xx`(category `citicIndustry`),**方向**用下表的 `122000xxx`(category `gangtiseIndustry`)。适用 opinion / summary / pamirs-summary / roadshow / site-visit / forum / my-conference(strategy 无此参数)。
|
|
113
113
|
|
|
114
|
-
|
|
114
|
+
⚠️ **`gangtiseIndustry` 里只有下面这 6 条方向码,不含任何行业码**——`constant-list --category gangtiseIndustry` 返回的就是 6 条,去它那里找「食品饮料」找不到,行业码要查 `citicIndustry`。
|
|
115
|
+
|
|
116
|
+
**6 个研究方向(citicIndustry 没有,已实测正确过滤):**
|
|
115
117
|
|
|
116
118
|
| ID | 方向 | ID | 方向 |
|
|
117
119
|
|----|------|----|------|
|
|
@@ -119,7 +121,7 @@
|
|
|
119
121
|
| 122000003 | 固收 | 122000004 | 金工 |
|
|
120
122
|
| 122000005 | 海外 | 122000007 | 其他 |
|
|
121
123
|
|
|
122
|
-
|
|
124
|
+
行业维度的 ID 直接用上方「中信行业分类」表(`1008001xx`),这是唯一在全部 7 个端点上都生效的一套。⚠️ **申万码 `104xx0000` 用于 `--research-area` 只有 `summary` / `pamirs-summary` 认**,opinion / roadshow / site-visit / forum / my-conference 一律返 0(与传乱码表现一致,不报错)。反过来方向码 `122000xxx` 在 `pamirs-summary` 上返 0。完整实测矩阵见 `commands/reference-and-lookup.md`。
|
|
123
125
|
|
|
124
126
|
---
|
|
125
127
|
|
|
@@ -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}`)。内层字段名 2026-08-01 起为 `securityCodeList` / `securityNameList` / `indicatorList[{code,name,dataType}]`(screener 另带 `field`),`values` 是 2D 矩阵:**截面与 screener 为 `[证券][指标]`**(该版转置过,此前是 `[指标][证券]`)、时序仍为 `[序列][日期]`。
|
|
6
6
|
>
|
|
7
|
-
>
|
|
7
|
+
> **缺数据 vs 代码写错**(2026-08-08 实测):无数据 / 无覆盖一律保留行列并给占位单元格——**多数指标是 `null`,个别(如 `is_dnrpnp`)是 `0`,`0` 会穿过比较与聚合,详见 `commands/indicator.md`**。仍会整列 / 整行消失的只有**服务端解析不了的 code**——指标 code 拼错,或证券 code 后缀错(美股是 `.O`/`.N`,`AAPL.US` 会整行消失)。请求里没有任何可解析 code 时才是全空数组。CLI 的 `indicator` 子命令已二次解包、拍平成宽表,并在整列/整行被略过时标 `partial` + `omittedIndicators`/`omittedSecurities` + 退出码 3——**这个信号现在读作「有 code 写错了」**。**`screener` 例外**:把缺列的变量当作无法求值,按表达式的**布尔结构**判断是否还有分支能成立(`A && B` 要两边、`A || B` 只要一边)。一条都不剩 → **退出码 1 且不输出**(那些行以「通过了该条件」的名义呈现,而条件根本无法证明被执行过);仍有分支可求值、或缺的只是输出用的辅助变量 → `partial` + 退出码 3。直接 `raw call indicator.*` 只会剥外层,内层需自行处理。
|
|
8
8
|
|
|
9
9
|
## 通用模式(5 类)
|
|
10
10
|
|
|
@@ -23,6 +23,8 @@ CLI 自动处理 envelope:`{code, msg, data}` 信封会按 `code === "000000"`
|
|
|
23
23
|
| insight opinion list | `{list, total}` | `list[].id` / `list[].title` / `list[].publishDate` / `list[].chiefName` / `list[].securityCode` / `list[].institutionName` |
|
|
24
24
|
| insight summary list | `{list, total}` | `list[].summaryId` / `list[].title` / `list[].publishTime` |
|
|
25
25
|
| insight summary download | 文件路径(stdout) | — |
|
|
26
|
+
| insight pamirs-summary list | `{list, total}` | `list[].summaryId` / `list[].title` / `list[].brief` / `list[].summaryTime`(纪要生成时间)/ `list[].publishTime`(发布时间)/ `list[].securityList[]{securityCode, securityName}` / `list[].researchAreaList[]{researchAreaId, researchAreaName}` / `list[].conceptList[]{conceptId, conceptName}` / `list[].categoryList` / `list[].marketList`。⚠️ 标签字段大面积不回填:`conceptList` **在所有查法下恒为空**(接口也没有 concept 过滤参数,拿不到);`categoryList` 与 `marketList` **只在用 `--category` 或 `--market` 任一过滤时才回填**(两者绑定,一起有或一起没有)。拉全量再本地分组会丢标签 |
|
|
27
|
+
| insight pamirs-summary download | 文件路径(stdout) | — |
|
|
26
28
|
| insight roadshow / site-visit / strategy / forum list | `{list, total}` | `list[].id` / `list[].title` / `list[].publishTime` / `list[].institution.institutionName` |
|
|
27
29
|
| insight research list | `{list, total}` | `list[].reportId` / `list[].title` / `list[].brief`(全文摘要) / `list[].publishTime` / `list[].publisher.brokerName` / `list[].securityList[].rating` |
|
|
28
30
|
| insight research download | 文件路径(stdout) | — |
|
|
@@ -78,7 +80,7 @@ CLI 自动处理 envelope:`{code, msg, data}` 信封会按 `code === "000000"`
|
|
|
78
80
|
| vault record-download | 文件路径(stdout) | — |
|
|
79
81
|
| vault my-conference-list | `{list, total}` | `list[].conferenceId` / `list[].title` / `list[].category` / `list[].institution.institutionName` / `list[].publishTime` |
|
|
80
82
|
| vault my-conference-download | 文件路径(stdout) | — |
|
|
81
|
-
| vault wechat-message-list | `{list, total}` | `list[].msgId` / `list[].content`(正文)/ `list[].url` / `list[].msgTime` / `list[].wechatGroupName` / `list[].speakerName` / `list[].category` / `list[].tagList[].tagCode` / `list[].securityList[].securityCode` / `list[].quoteMsg.quoteContent`(引用消息,无引用为 `null
|
|
83
|
+
| vault wechat-message-list | `{list, total}` | `list[].msgId` / `list[].content`(正文)/ `list[].url` / `list[].msgTime` / `list[].wechatGroupName` / `list[].speakerName` / `list[].category` / `list[].tagList[].tagCode` / `list[].securityList[].securityCode` / `list[].quoteMsg.quoteContent`(引用消息,无引用为 `null`)。**字段名是 `content` / `url`**,不是 `msgContent` / `contentUrl`(实测 2026-07-25) |
|
|
82
84
|
| vault wechat-chatroom-list | `{list, total}` | `list[].chatroomName` / `list[].chatroomId` |
|
|
83
85
|
| alternative edb-search | `{list: [...]}` 指标列表 | `indicatorId` / `indicatorName` / `dataSource` / `frequency` / `unit` |
|
|
84
86
|
| alternative edb-data | 列表,每行 `{date, <indicatorId>: value, ...}` 宽表 | `date` + 每个 `--indicator-id` 一列(该日指标值) |
|