gangtise-openapi-cli 0.17.2 → 0.18.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/dist/src/cli.js +12 -0
- package/dist/src/core/endpoints.js +15 -0
- package/dist/src/version.js +1 -1
- package/package.json +1 -1
package/dist/src/cli.js
CHANGED
|
@@ -131,6 +131,7 @@ const announcement = new Command("announcement");
|
|
|
131
131
|
const announcementHk = new Command("announcement-hk");
|
|
132
132
|
const foreignOpinion = new Command("foreign-opinion");
|
|
133
133
|
const independentOpinion = new Command("independent-opinion");
|
|
134
|
+
const officialAccount = new Command("official-account");
|
|
134
135
|
addTimeFilters(opinion.command("list").option("--rank-type <number>", "Rank type", "1").option("--research-area <id>", "Research area ID", collectList, []).option("--chief <id>", "Chief ID", collectList, []).option("--security <code>", "Security code", collectList, []).option("--broker <id>", "Broker ID", collectList, []).option("--industry <id>", "Industry ID", collectList, []).option("--concept <id>", "Concept ID", collectList, []).option("--llm-tag <tag>", "Semantic tag", collectList, []).option("--source <source>", "Source", collectList, []).option("--format <format>", "Output format", "table").option("--output <path>", "Output path")).action((options) => emit(options, (client) => client.call("insight.opinion.list", {
|
|
135
136
|
from: parseFrom(options.from), size: parseSize(options.size), startTime: options.startTime, endTime: options.endTime,
|
|
136
137
|
rankType: parseNumberOption(options.rankType, "--rank-type", { integer: true, min: 1 }), keyword: options.keyword, researchAreaList: maybeArray(options.researchArea), chiefList: maybeArray(options.chief),
|
|
@@ -247,6 +248,16 @@ addTimeFilters(independentOpinion.command("list").option("--rank-type <number>",
|
|
|
247
248
|
ratingList: maybeArray(options.rating), ratingChangeList: maybeArray(options.ratingChange),
|
|
248
249
|
})));
|
|
249
250
|
addDownloadCommand(independentOpinion, { endpointKey: "insight.independent-opinion.download", idOption: "--independent-opinion-id", idField: "independentOpinionId", fallbackPrefix: "independent-opinion", fileType: { description: "File type: 1=original HTML 2=CN-translated HTML", required: true } });
|
|
251
|
+
addTimeFilters(officialAccount.command("list").option("--search-type <number>", "Search type: 1=title 2=fulltext", "1").option("--rank-type <number>", "Rank type: 1=composite 2=time desc", "1").option("--account-id <id>", "Official account ID", collectList, []).option("--security <code>", "Security code (e.g. 000001.SZ)", collectList, []).option("--category <type>", "Article type: news/law/report/view/data/event/meeting/notice/recruit/investEdu/brand/notes/other", collectList, []).option("--industry <id>", "Industry ID (constant-list citicIndustry/swIndustry)", collectList, []).option("--format <format>", "Output format", "table").option("--output <path>", "Output path")).action((options) => emit(options, (client) => client.call("insight.official-account.list", {
|
|
252
|
+
from: parseFrom(options.from), size: parseSize(options.size),
|
|
253
|
+
startTime: options.startTime, endTime: options.endTime,
|
|
254
|
+
searchType: parseNumberOption(options.searchType, "--search-type", { integer: true, min: 1 }),
|
|
255
|
+
rankType: parseNumberOption(options.rankType, "--rank-type", { integer: true, min: 1 }),
|
|
256
|
+
keyword: options.keyword,
|
|
257
|
+
accountIdList: maybeArray(options.accountId), securityList: maybeArray(options.security),
|
|
258
|
+
categoryList: maybeArray(options.category), industryList: maybeArray(options.industry),
|
|
259
|
+
}), { endpointKey: "insight.official-account.list", idField: "articleId" }));
|
|
260
|
+
addDownloadCommand(officialAccount, { endpointKey: "insight.official-account.download", idOption: "--article-id", idField: "articleId", fallbackPrefix: "official-account", fileType: { description: "File type: 1=txt(default) 2=HTML", default: "1" }, titleListEndpoint: "insight.official-account.list" });
|
|
250
261
|
insight.addCommand(opinion);
|
|
251
262
|
insight.addCommand(summary);
|
|
252
263
|
insight.addCommand(roadshow);
|
|
@@ -259,6 +270,7 @@ insight.addCommand(announcement);
|
|
|
259
270
|
insight.addCommand(announcementHk);
|
|
260
271
|
insight.addCommand(foreignOpinion);
|
|
261
272
|
insight.addCommand(independentOpinion);
|
|
273
|
+
insight.addCommand(officialAccount);
|
|
262
274
|
program.addCommand(insight);
|
|
263
275
|
const quote = new Command("quote").description("Quote APIs");
|
|
264
276
|
const addKlineCommand = (name, endpointKey, securityHelp, shardDays) => quote.command(name)
|
|
@@ -161,6 +161,21 @@ export const ENDPOINTS = {
|
|
|
161
161
|
kind: "download",
|
|
162
162
|
description: "Download foreign independent opinion file",
|
|
163
163
|
},
|
|
164
|
+
"insight.official-account.list": {
|
|
165
|
+
key: "insight.official-account.list",
|
|
166
|
+
method: "POST",
|
|
167
|
+
path: "/application/open-insight/officialAccount/getList",
|
|
168
|
+
kind: "json",
|
|
169
|
+
description: "List WeChat official account articles",
|
|
170
|
+
pagination: { enabled: true, maxPageSize: 50 },
|
|
171
|
+
},
|
|
172
|
+
"insight.official-account.download": {
|
|
173
|
+
key: "insight.official-account.download",
|
|
174
|
+
method: "GET",
|
|
175
|
+
path: "/application/open-insight/officialAccount/download/file",
|
|
176
|
+
kind: "download",
|
|
177
|
+
description: "Download WeChat official account article (txt/HTML)",
|
|
178
|
+
},
|
|
164
179
|
// ─── reference ───
|
|
165
180
|
"reference.securities-search": {
|
|
166
181
|
key: "reference.securities-search",
|
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.18.0";
|