gangtise-openapi-cli 0.5.1 → 0.7.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.
@@ -2,7 +2,7 @@ import { request } from "undici";
2
2
  import { normalizeToken, readTokenCache, requireAccessCredentials, writeTokenCache } from "./auth.js";
3
3
  import { ApiError, ValidationError } from "./errors.js";
4
4
  import { ENDPOINTS, ENDPOINT_REGISTRY } from "./endpoints.js";
5
- import { ANNOUNCEMENT_CATEGORIES, BROKER_ORGS, INDUSTRIES, INDUSTRY_CODES, MEETING_ORGS, REGIONS, RESEARCH_AREAS } from "./lookupData.js";
5
+ import { getLookupData } from "./lookupData/index.js";
6
6
  export class GangtiseClient {
7
7
  config;
8
8
  constructor(config) {
@@ -47,26 +47,19 @@ export class GangtiseClient {
47
47
  return parsed;
48
48
  }
49
49
  async readLocalLookup(endpoint) {
50
- if (endpoint.key === "lookup.research-areas.list") {
51
- return RESEARCH_AREAS;
52
- }
53
- if (endpoint.key === "lookup.broker-orgs.list") {
54
- return BROKER_ORGS;
55
- }
56
- if (endpoint.key === "lookup.meeting-orgs.list") {
57
- return MEETING_ORGS;
58
- }
59
- if (endpoint.key === "lookup.industries.list") {
60
- return INDUSTRIES;
61
- }
62
- if (endpoint.key === "lookup.regions.list") {
63
- return REGIONS;
64
- }
65
- if (endpoint.key === "lookup.announcement-categories.list") {
66
- return ANNOUNCEMENT_CATEGORIES;
67
- }
68
- if (endpoint.key === "lookup.industry-codes.list") {
69
- return INDUSTRY_CODES;
50
+ const keyMapping = {
51
+ "lookup.research-areas.list": "research-areas",
52
+ "lookup.broker-orgs.list": "broker-orgs",
53
+ "lookup.meeting-orgs.list": "meeting-orgs",
54
+ "lookup.industries.list": "industries",
55
+ "lookup.regions.list": "regions",
56
+ "lookup.announcement-categories.list": "announcement-categories",
57
+ "lookup.industry-codes.list": "industry-codes",
58
+ "lookup.theme-ids.list": "theme-ids",
59
+ };
60
+ const lookupKey = keyMapping[endpoint.key];
61
+ if (lookupKey) {
62
+ return getLookupData(lookupKey);
70
63
  }
71
64
  throw new ApiError(`Unsupported local lookup endpoint: ${endpoint.key}`);
72
65
  }
@@ -253,4 +246,3 @@ export class GangtiseClient {
253
246
  return this.requestJson(endpoint, body);
254
247
  }
255
248
  }
256
- //# sourceMappingURL=client.js.map
@@ -15,4 +15,3 @@ export function loadConfig() {
15
15
  tokenCachePath: process.env.GANGTISE_TOKEN_CACHE_PATH ?? DEFAULT_TOKEN_CACHE_PATH,
16
16
  };
17
17
  }
18
- //# sourceMappingURL=config.js.map
@@ -55,6 +55,13 @@ export const ENDPOINTS = {
55
55
  kind: "json",
56
56
  description: "List Shenwan industry codes from local docs",
57
57
  },
58
+ lookupThemeIds: {
59
+ key: "lookup.theme-ids.list",
60
+ method: "GET",
61
+ path: "/guide/theme-ids-local",
62
+ kind: "json",
63
+ description: "List theme IDs from local docs",
64
+ },
58
65
  insightOpinionList: {
59
66
  key: "insight.opinion.list",
60
67
  method: "POST",
@@ -160,14 +167,35 @@ export const ENDPOINTS = {
160
167
  method: "POST",
161
168
  path: "/application/open-quote/kline/daily",
162
169
  kind: "json",
163
- description: "Query daily kline",
170
+ description: "Query A-share daily kline (SH/SZ/BJ)",
171
+ },
172
+ quoteDayKlineHk: {
173
+ key: "quote.day-kline-hk",
174
+ method: "POST",
175
+ path: "/application/open-quote/kline-hk/daily",
176
+ kind: "json",
177
+ description: "Query HK stock daily kline (HK)",
164
178
  },
165
179
  fundamentalIncomeStatement: {
166
180
  key: "fundamental.income-statement",
167
181
  method: "POST",
168
- path: "/application/open-fundamental/financial-report/income-statement",
182
+ path: "/application/open-fundamental/financial-report/income-statement/accumulated",
183
+ kind: "json",
184
+ description: "Query income statement (accumulated)",
185
+ },
186
+ fundamentalBalanceSheet: {
187
+ key: "fundamental.balance-sheet",
188
+ method: "POST",
189
+ path: "/application/open-fundamental/financial-report/balance-sheet/accumulated",
190
+ kind: "json",
191
+ description: "Query balance sheet (accumulated)",
192
+ },
193
+ fundamentalCashFlow: {
194
+ key: "fundamental.cash-flow",
195
+ method: "POST",
196
+ path: "/application/open-fundamental/financial-report/cash-flow-statement/accumulated",
169
197
  kind: "json",
170
- description: "Query income statement",
198
+ description: "Query cash flow statement (accumulated)",
171
199
  },
172
200
  fundamentalMainBusiness: {
173
201
  key: "fundamental.main-business",
@@ -226,24 +254,51 @@ export const ENDPOINTS = {
226
254
  kind: "json",
227
255
  description: "Generate peer comparison",
228
256
  },
229
- aiCloudDiskList: {
230
- key: "ai.cloud-disk.list",
257
+ aiEarningsReviewGetId: {
258
+ key: "ai.earnings-review.get-id",
259
+ method: "POST",
260
+ path: "/application/open-ai/agent/earnings-review-getid",
261
+ kind: "json",
262
+ description: "Get earnings review ID",
263
+ },
264
+ aiEarningsReviewGetContent: {
265
+ key: "ai.earnings-review.get-content",
266
+ method: "POST",
267
+ path: "/application/open-ai/agent/earnings-review-getcontent",
268
+ kind: "json",
269
+ description: "Get earnings review content",
270
+ },
271
+ aiThemeTracking: {
272
+ key: "ai.theme-tracking",
273
+ method: "POST",
274
+ path: "/application/open-ai/agent/theme-tracking",
275
+ kind: "json",
276
+ description: "Get theme tracking daily report",
277
+ },
278
+ aiResearchOutline: {
279
+ key: "ai.research-outline",
280
+ method: "POST",
281
+ path: "/application/open-ai/agent/research-outline",
282
+ kind: "json",
283
+ description: "Get company research outline",
284
+ },
285
+ vaultDriveList: {
286
+ key: "vault.drive.list",
231
287
  method: "POST",
232
- path: "/application/open-ai/drive/getList",
288
+ path: "/application/open-vault/drive/getList",
233
289
  kind: "json",
234
- description: "List AI cloud disk files",
290
+ description: "List vault drive files",
235
291
  pagination: { enabled: true, maxPageSize: 50 },
236
292
  },
237
- aiCloudDiskDownload: {
238
- key: "ai.cloud-disk.download",
293
+ vaultDriveDownload: {
294
+ key: "vault.drive.download",
239
295
  method: "GET",
240
- path: "/application/open-ai/drive/download/file",
296
+ path: "/application/open-vault/drive/download/file",
241
297
  kind: "download",
242
- description: "Download AI cloud disk file",
298
+ description: "Download vault drive file",
243
299
  },
244
300
  };
245
301
  export const ENDPOINT_REGISTRY = Object.values(ENDPOINTS).reduce((accumulator, endpoint) => {
246
302
  accumulator[endpoint.key] = endpoint;
247
303
  return accumulator;
248
304
  }, {});
249
- //# sourceMappingURL=endpoints.js.map
@@ -35,4 +35,3 @@ export class ApiError extends CliError {
35
35
  this.hint = code ? ERROR_HINTS[code] : undefined;
36
36
  }
37
37
  }
38
- //# sourceMappingURL=errors.js.map