gangtise-openapi-cli 0.10.10 → 0.11.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 +9 -0
- package/dist/src/cli.js +15 -2
- package/dist/src/core/commandBodies.js +30 -0
- package/dist/src/core/endpoints.js +22 -0
- package/dist/src/core/normalize.js +5 -0
- package/dist/src/version.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -112,6 +112,7 @@ cp -r gangtise-openapi ~/.hermes/skills/gangtise-openapi
|
|
|
112
112
|
| | `foreign-report list` / `download` | 外资研报(含中文翻译下载) |
|
|
113
113
|
| | `announcement list` / `download` | 公告(含 Markdown 下载) |
|
|
114
114
|
| **Quote** | `day-kline` / `day-kline-hk` | A股/港股日K线 |
|
|
115
|
+
| | `index-day-kline` | 沪深京指数日K线 |
|
|
115
116
|
| | `minute-kline` | A股分钟K线 |
|
|
116
117
|
| **Fundamental** | `income-statement` / `balance-sheet` / `cash-flow` | 三大财务报表(累计) |
|
|
117
118
|
| | `income-statement-quarterly` / `cash-flow-quarterly` | 利润表/现金流量表(单季度) |
|
|
@@ -135,6 +136,7 @@ cp -r gangtise-openapi ~/.hermes/skills/gangtise-openapi
|
|
|
135
136
|
| **Vault** | `drive-list` / `drive-download` | 云盘文件列表与下载 |
|
|
136
137
|
| | `record-list` / `record-download` | 录音速记列表与下载 |
|
|
137
138
|
| | `my-conference-list` / `my-conference-download` | 我的会议列表与下载 |
|
|
139
|
+
| | `wechat-message-list` / `wechat-chatroom-list` | 群消息列表与群ID查询 |
|
|
138
140
|
| **Raw** | `call` | 原始接口调用(可访问任意 endpoint) |
|
|
139
141
|
|
|
140
142
|
## 命令概览
|
|
@@ -187,6 +189,7 @@ gangtise ai knowledge-batch --query 比亚迪 --query 最近热门概念
|
|
|
187
189
|
- `vault drive-list`
|
|
188
190
|
- `vault record-list`
|
|
189
191
|
- `vault my-conference-list`
|
|
192
|
+
- `vault wechat-message-list`
|
|
190
193
|
- `ai hot-topic`
|
|
191
194
|
|
|
192
195
|
规则:
|
|
@@ -260,6 +263,8 @@ gangtise quote day-kline --security all --start-date 2026-04-01 --end-date 2026-
|
|
|
260
263
|
gangtise quote day-kline-hk --security 00700.HK --start-date 2026-03-01 --end-date 2026-03-31
|
|
261
264
|
# 港股全市场
|
|
262
265
|
gangtise quote day-kline-hk --security all --start-date 2026-04-01 --end-date 2026-04-01 --limit 100 --format json
|
|
266
|
+
# 沪深京指数日K线
|
|
267
|
+
gangtise quote index-day-kline --security 000001.SH --security 399001.SZ --start-date 2024-05-01 --end-date 2024-05-20 --field securityCode --field tradeDate --field close --field volume
|
|
263
268
|
# A股分钟K线
|
|
264
269
|
gangtise quote minute-kline --security 600519.SH --start-time "2026-04-15 09:30:00" --end-time "2026-04-15 15:00:00" --field open --field close --field volume
|
|
265
270
|
```
|
|
@@ -341,6 +346,10 @@ gangtise vault record-download --record-id 49412 --content-type summary
|
|
|
341
346
|
gangtise vault my-conference-list --keyword AI --category earningsCall --institution C100000027
|
|
342
347
|
# 我的会议下载(--content-type: asr/summary)
|
|
343
348
|
gangtise vault my-conference-download --conference-id 43319 --content-type asr
|
|
349
|
+
|
|
350
|
+
# 群消息:先按群名称查群ID,再按群ID查消息
|
|
351
|
+
gangtise vault wechat-chatroom-list --room-name "AI学习群,投研分享群" --size 50
|
|
352
|
+
gangtise vault wechat-message-list --keyword AI应用 --wechat-group-id ueKEGyhdjFGkjyebh --category text --category url --tag roadShow --tag meetingSummary --size 50
|
|
344
353
|
```
|
|
345
354
|
|
|
346
355
|
### Raw
|
package/dist/src/cli.js
CHANGED
|
@@ -3,6 +3,7 @@ import { Command, Option } from "commander";
|
|
|
3
3
|
import { checkAsyncContent, pollAsyncContent, POLL_MAX_ATTEMPTS } from "./core/asyncContent.js";
|
|
4
4
|
import { readTokenCache } from "./core/auth.js";
|
|
5
5
|
import { collectKeyValue, collectList, collectNumberList, maybeArray, parseFrom, parseNumberOption, parseOptionalNumberOption, parseSize, parseTimestamp13 } from "./core/args.js";
|
|
6
|
+
import { buildQuoteKlineBody, buildWechatChatroomListBody, buildWechatMessageListBody } from "./core/commandBodies.js";
|
|
6
7
|
import { loadConfig } from "./core/config.js";
|
|
7
8
|
import { resolveTitle, saveDownloadResult } from "./core/download.js";
|
|
8
9
|
import { ApiError, ConfigError } from "./core/errors.js";
|
|
@@ -185,11 +186,15 @@ program.addCommand(insight);
|
|
|
185
186
|
const quote = new Command("quote").description("Quote APIs");
|
|
186
187
|
quote.command("day-kline").option("--security <code>", "Security code (A-share: .SH/.SZ/.BJ, or 'all' for full market)", collectList, []).option("--start-date <date>", "Start date (default: 1 year before end-date)").option("--end-date <date>", "End date (default: latest)").option("--limit <number>", "Max rows per request (default: 6000, max: 10000)").option("--field <field>", "Field", collectList, []).option("--format <format>", "Output format", "table").option("--output <path>").action(async (options) => {
|
|
187
188
|
const client = await createClient();
|
|
188
|
-
await printData(await client.call("quote.day-kline",
|
|
189
|
+
await printData(await client.call("quote.day-kline", buildQuoteKlineBody(options)), parseOutputFormat(options.format), options.output);
|
|
189
190
|
});
|
|
190
191
|
quote.command("day-kline-hk").option("--security <code>", "Security code (HK stock: .HK, or 'all' for full market)", collectList, []).option("--start-date <date>", "Start date (default: 1 year before end-date)").option("--end-date <date>", "End date (default: latest)").option("--limit <number>", "Max rows per request (default: 6000, max: 10000)").option("--field <field>", "Field", collectList, []).option("--format <format>", "Output format", "table").option("--output <path>").action(async (options) => {
|
|
191
192
|
const client = await createClient();
|
|
192
|
-
await printData(await client.call("quote.day-kline-hk",
|
|
193
|
+
await printData(await client.call("quote.day-kline-hk", buildQuoteKlineBody(options)), parseOutputFormat(options.format), options.output);
|
|
194
|
+
});
|
|
195
|
+
quote.command("index-day-kline").option("--security <code>", "Index code (.SH/.SZ/.BJ, or 'all' for full market)", collectList, []).option("--start-date <date>", "Start date (default: 1 year before end-date)").option("--end-date <date>", "End date (default: latest)").option("--limit <number>", "Max rows per request (default: 6000, max: 10000)").option("--field <field>", "Field", collectList, []).option("--format <format>", "Output format", "table").option("--output <path>").action(async (options) => {
|
|
196
|
+
const client = await createClient();
|
|
197
|
+
await printData(await client.call("quote.index-day-kline", buildQuoteKlineBody(options)), parseOutputFormat(options.format), options.output);
|
|
193
198
|
});
|
|
194
199
|
quote.command("minute-kline").option("--security <code>", "Security code (A-share only: .SH/.SZ/.BJ)").option("--start-time <datetime>", "Start time (yyyy-MM-dd HH:mm:ss)").option("--end-time <datetime>", "End time (yyyy-MM-dd HH:mm:ss)").option("--limit <number>", "Max rows per request (default: 5000, max: 10000)").option("--field <field>", "Field", collectList, []).option("--format <format>", "Output format", "table").option("--output <path>").action(async (options) => {
|
|
195
200
|
const client = await createClient();
|
|
@@ -394,6 +399,14 @@ vault.command("my-conference-download").requiredOption("--conference-id <id>").r
|
|
|
394
399
|
const title = options.output ? undefined : await resolveTitle(client, result, "vault.my-conference.list", "conferenceId", options.conferenceId);
|
|
395
400
|
await saveDownloadResult(result, `conference-${options.conferenceId}`, options.output ?? title);
|
|
396
401
|
});
|
|
402
|
+
vault.command("wechat-message-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("--wechat-group-id <id>", "WeChat group ID", collectList, []).option("--industry <id>", "Industry ID", collectList, []).option("--category <name>", "Message type: text/image/documents/url", collectList, []).option("--tag <name>", "Tag: roadShow/research/strategyMeeting/meetingSummary/industryComment/companyComment/earningsReview", collectList, []).option("--format <format>", "Output format", "table").option("--output <path>").action(async (options) => {
|
|
403
|
+
const client = await createClient();
|
|
404
|
+
await printData(await client.call("vault.wechat-message.list", buildWechatMessageListBody(options)), parseOutputFormat(options.format), options.output);
|
|
405
|
+
});
|
|
406
|
+
vault.command("wechat-chatroom-list").option("--from <number>", "Starting offset", "0").option("--size <number>", "Rows to return", "20").option("--room-name <name>", "WeChat group name; repeat or comma-separate for multiple names", collectList, []).option("--format <format>", "Output format", "table").option("--output <path>").action(async (options) => {
|
|
407
|
+
const client = await createClient();
|
|
408
|
+
await printData(await client.call("vault.wechat-chatroom.list", buildWechatChatroomListBody(options)), parseOutputFormat(options.format), options.output);
|
|
409
|
+
});
|
|
397
410
|
program.addCommand(vault);
|
|
398
411
|
program.addCommand(ai);
|
|
399
412
|
program.command("raw").description("Raw API calls").addCommand(new Command("call").argument("<endpointKey>").option("--body <json>").option("--query <key=value>", "Query string pair", collectKeyValue, {}).option("--format <format>", "Output format", "json").option("--output <path>").action(async (endpointKey, options) => {
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { maybeArray, parseFrom, parseOptionalNumberOption, parseSize } from "./args.js";
|
|
2
|
+
export function buildQuoteKlineBody(options) {
|
|
3
|
+
return {
|
|
4
|
+
securityList: maybeArray(options.security),
|
|
5
|
+
startDate: options.startDate,
|
|
6
|
+
endDate: options.endDate,
|
|
7
|
+
limit: parseOptionalNumberOption(options.limit, "--limit", { integer: true, min: 1 }),
|
|
8
|
+
fieldList: maybeArray(options.field),
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
export function buildWechatMessageListBody(options) {
|
|
12
|
+
return {
|
|
13
|
+
from: parseFrom(options.from),
|
|
14
|
+
size: parseSize(options.size),
|
|
15
|
+
startTime: options.startTime,
|
|
16
|
+
endTime: options.endTime,
|
|
17
|
+
keyword: options.keyword,
|
|
18
|
+
wechatGroupIdList: maybeArray(options.wechatGroupId),
|
|
19
|
+
industryIdList: maybeArray(options.industry),
|
|
20
|
+
categoryList: maybeArray(options.category),
|
|
21
|
+
tagList: maybeArray(options.tag),
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
export function buildWechatChatroomListBody(options) {
|
|
25
|
+
return {
|
|
26
|
+
from: parseFrom(options.from),
|
|
27
|
+
size: parseSize(options.size),
|
|
28
|
+
roomName: options.roomName.length > 0 ? options.roomName.join(",") : undefined,
|
|
29
|
+
};
|
|
30
|
+
}
|
|
@@ -176,6 +176,13 @@ export const ENDPOINTS = {
|
|
|
176
176
|
kind: "json",
|
|
177
177
|
description: "Query HK stock daily kline (HK)",
|
|
178
178
|
},
|
|
179
|
+
quoteIndexDayKline: {
|
|
180
|
+
key: "quote.index-day-kline",
|
|
181
|
+
method: "POST",
|
|
182
|
+
path: "/application/open-quote/index/kline/daily",
|
|
183
|
+
kind: "json",
|
|
184
|
+
description: "Query SH/SZ/BJ index daily kline",
|
|
185
|
+
},
|
|
179
186
|
fundamentalIncomeStatement: {
|
|
180
187
|
key: "fundamental.income-statement",
|
|
181
188
|
method: "POST",
|
|
@@ -398,6 +405,21 @@ export const ENDPOINTS = {
|
|
|
398
405
|
kind: "download",
|
|
399
406
|
description: "Download my conference resource",
|
|
400
407
|
},
|
|
408
|
+
vaultWechatMessageList: {
|
|
409
|
+
key: "vault.wechat-message.list",
|
|
410
|
+
method: "POST",
|
|
411
|
+
path: "/application/open-vault/wechatgroupmsg/list",
|
|
412
|
+
kind: "json",
|
|
413
|
+
description: "List WeChat group messages",
|
|
414
|
+
pagination: { enabled: true, maxPageSize: 50 },
|
|
415
|
+
},
|
|
416
|
+
vaultWechatChatroomList: {
|
|
417
|
+
key: "vault.wechat-chatroom.list",
|
|
418
|
+
method: "POST",
|
|
419
|
+
path: "/application/open-vault/wechatgroupmsg/chatroomId",
|
|
420
|
+
kind: "json",
|
|
421
|
+
description: "List WeChat group chatroom IDs",
|
|
422
|
+
},
|
|
401
423
|
};
|
|
402
424
|
export const ENDPOINT_REGISTRY = Object.values(ENDPOINTS).reduce((accumulator, endpoint) => {
|
|
403
425
|
accumulator[endpoint.key] = endpoint;
|
|
@@ -24,5 +24,10 @@ export function normalizeRows(value) {
|
|
|
24
24
|
const hasMeta = Object.keys(meta).length > 0;
|
|
25
25
|
return hasMeta ? { ...meta, list } : list;
|
|
26
26
|
}
|
|
27
|
+
if (Array.isArray(record.chatRoomList)) {
|
|
28
|
+
const { chatRoomList, ...meta } = record;
|
|
29
|
+
const hasMeta = Object.keys(meta).length > 0;
|
|
30
|
+
return hasMeta ? { ...meta, list: chatRoomList } : chatRoomList;
|
|
31
|
+
}
|
|
27
32
|
return value;
|
|
28
33
|
}
|
package/dist/src/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// Auto-generated — DO NOT EDIT
|
|
2
|
-
export const CLI_VERSION = "0.
|
|
2
|
+
export const CLI_VERSION = "0.11.0";
|