reportify-sdk 0.2.6 → 0.2.8
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/index.d.mts +136 -3
- package/dist/index.d.ts +136 -3
- package/dist/index.js +85 -6
- package/dist/index.mjs +84 -6
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -176,9 +176,30 @@ declare class StockModule {
|
|
|
176
176
|
/**
|
|
177
177
|
* Get company overview including business description, sector, and key metrics
|
|
178
178
|
*
|
|
179
|
-
* @param
|
|
179
|
+
* @param options - Query options
|
|
180
|
+
* @param options.symbols - Stock symbols. You can enter multiple items, separated by commas(,)
|
|
181
|
+
* @param options.names - Stock names. You can enter multiple items, separated by commas(,)
|
|
182
|
+
*
|
|
183
|
+
* @example
|
|
184
|
+
* ```typescript
|
|
185
|
+
* // Single stock by symbol
|
|
186
|
+
* const info = await client.stock.overview({ symbols: 'US:AAPL' });
|
|
187
|
+
* console.log(info.name, info.sector);
|
|
188
|
+
*
|
|
189
|
+
* // Multiple stocks by symbols
|
|
190
|
+
* const infos = await client.stock.overview({ symbols: 'US:AAPL,US:MSFT' });
|
|
191
|
+
* for (const info of infos) {
|
|
192
|
+
* console.log(info.name);
|
|
193
|
+
* }
|
|
194
|
+
*
|
|
195
|
+
* // Search by name
|
|
196
|
+
* const info = await client.stock.overview({ names: 'Apple Inc.' });
|
|
197
|
+
* ```
|
|
180
198
|
*/
|
|
181
|
-
overview(
|
|
199
|
+
overview(options: {
|
|
200
|
+
symbols?: string;
|
|
201
|
+
names?: string;
|
|
202
|
+
}): Promise<CompanyOverview | CompanyOverview[]>;
|
|
182
203
|
/**
|
|
183
204
|
* Get list of major shareholders
|
|
184
205
|
*
|
|
@@ -793,6 +814,117 @@ declare class QuantModule {
|
|
|
793
814
|
backtest(params: BacktestParams): Promise<BacktestResult>;
|
|
794
815
|
}
|
|
795
816
|
|
|
817
|
+
/**
|
|
818
|
+
* Concepts Module
|
|
819
|
+
*
|
|
820
|
+
* Provides access to concept-related data and feeds.
|
|
821
|
+
*/
|
|
822
|
+
|
|
823
|
+
/**
|
|
824
|
+
* Concept data structure
|
|
825
|
+
*/
|
|
826
|
+
interface Concept {
|
|
827
|
+
concept_name: string;
|
|
828
|
+
concept_desc?: string;
|
|
829
|
+
concept_keywords?: string[];
|
|
830
|
+
concept_events?: string[];
|
|
831
|
+
concept_score?: number;
|
|
832
|
+
trending_score?: number;
|
|
833
|
+
published_at?: number;
|
|
834
|
+
stocks?: ConceptStock[];
|
|
835
|
+
docs?: ConceptDoc[];
|
|
836
|
+
[key: string]: unknown;
|
|
837
|
+
}
|
|
838
|
+
/**
|
|
839
|
+
* Concept stock data
|
|
840
|
+
*/
|
|
841
|
+
interface ConceptStock {
|
|
842
|
+
symbol: string;
|
|
843
|
+
name: string;
|
|
844
|
+
market?: string;
|
|
845
|
+
[key: string]: unknown;
|
|
846
|
+
}
|
|
847
|
+
/**
|
|
848
|
+
* Concept document data
|
|
849
|
+
*/
|
|
850
|
+
interface ConceptDoc {
|
|
851
|
+
id: string;
|
|
852
|
+
title: string;
|
|
853
|
+
summary?: string;
|
|
854
|
+
channel_name?: string;
|
|
855
|
+
publish_at?: number;
|
|
856
|
+
[key: string]: unknown;
|
|
857
|
+
}
|
|
858
|
+
/**
|
|
859
|
+
* Concept feed data structure
|
|
860
|
+
*/
|
|
861
|
+
interface ConceptFeed {
|
|
862
|
+
concept_name: string;
|
|
863
|
+
concept_desc?: string;
|
|
864
|
+
concept_keywords?: string[];
|
|
865
|
+
gen_count?: number;
|
|
866
|
+
earliest_at?: number;
|
|
867
|
+
latest_at?: number;
|
|
868
|
+
stocks?: ConceptStock[];
|
|
869
|
+
docs?: ConceptDoc[];
|
|
870
|
+
events?: ConceptEvent[];
|
|
871
|
+
[key: string]: unknown;
|
|
872
|
+
}
|
|
873
|
+
/**
|
|
874
|
+
* Concept event data
|
|
875
|
+
*/
|
|
876
|
+
interface ConceptEvent {
|
|
877
|
+
event: string;
|
|
878
|
+
timestamp?: number;
|
|
879
|
+
[key: string]: unknown;
|
|
880
|
+
}
|
|
881
|
+
/**
|
|
882
|
+
* Concepts module for accessing concept data and feeds
|
|
883
|
+
*
|
|
884
|
+
* This module provides methods to:
|
|
885
|
+
* - Get latest concepts
|
|
886
|
+
* - Get today's concept feeds
|
|
887
|
+
*/
|
|
888
|
+
declare class ConceptsModule {
|
|
889
|
+
private client;
|
|
890
|
+
constructor(client: Reportify);
|
|
891
|
+
/**
|
|
892
|
+
* Get latest concepts
|
|
893
|
+
*
|
|
894
|
+
* @param options - Query options
|
|
895
|
+
* @param options.includeDocs - Whether to include related documents (default: true)
|
|
896
|
+
*
|
|
897
|
+
* @example
|
|
898
|
+
* ```typescript
|
|
899
|
+
* // Get latest concepts
|
|
900
|
+
* const concepts = await client.concepts.latest();
|
|
901
|
+
* for (const concept of concepts) {
|
|
902
|
+
* console.log(concept.concept_name);
|
|
903
|
+
* }
|
|
904
|
+
*
|
|
905
|
+
* // Get concepts without documents
|
|
906
|
+
* const concepts = await client.concepts.latest({ includeDocs: false });
|
|
907
|
+
* ```
|
|
908
|
+
*/
|
|
909
|
+
latest(options?: {
|
|
910
|
+
includeDocs?: boolean;
|
|
911
|
+
}): Promise<Concept[]>;
|
|
912
|
+
/**
|
|
913
|
+
* Get today's concept feeds
|
|
914
|
+
*
|
|
915
|
+
* @example
|
|
916
|
+
* ```typescript
|
|
917
|
+
* // Get today's concept feeds
|
|
918
|
+
* const feeds = await client.concepts.today();
|
|
919
|
+
* for (const feed of feeds) {
|
|
920
|
+
* console.log(`${feed.concept_name}: ${feed.gen_count} generations`);
|
|
921
|
+
* console.log(`Time range: ${feed.earliest_at} - ${feed.latest_at}`);
|
|
922
|
+
* }
|
|
923
|
+
* ```
|
|
924
|
+
*/
|
|
925
|
+
today(): Promise<ConceptFeed[]>;
|
|
926
|
+
}
|
|
927
|
+
|
|
796
928
|
/**
|
|
797
929
|
* Reportify Client
|
|
798
930
|
*
|
|
@@ -822,6 +954,7 @@ declare class Reportify {
|
|
|
822
954
|
readonly kb: KBModule;
|
|
823
955
|
readonly docs: DocsModule;
|
|
824
956
|
readonly quant: QuantModule;
|
|
957
|
+
readonly concepts: ConceptsModule;
|
|
825
958
|
constructor(config: ReportifyConfig);
|
|
826
959
|
/**
|
|
827
960
|
* Make an HTTP request to the API
|
|
@@ -870,4 +1003,4 @@ declare class Reportify {
|
|
|
870
1003
|
searchTranscripts(query: string, options?: SearchOptions): Promise<Document[]>;
|
|
871
1004
|
}
|
|
872
1005
|
|
|
873
|
-
export { APIError, AuthenticationError, type BacktestParams, type BacktestResult, type BatchOHLCVParams, type Chunk, type CompanyInfo, type CompanyOverview, DocsModule, type Document, type EarningsEvent, type FactorComputeParams, type FactorMeta, type FinancialStatement, type IPOEvent, type IPOStatus, type IndexConstituent, type IndexFund, type IndicatorComputeParams, type IndicatorData, type IndicatorMeta, type IndustryConstituent, type Interval, KBModule, type KBSearchOptions, type Market, NotFoundError, type OHLCVData, type OHLCVParams, type PaginatedResponse, type Period, type PriceAdjust, type PriceData, QuantModule, type Quote, RateLimitError, Reportify, type ReportifyConfig, ReportifyError, type ScreenParams, type ScreenedStock, type SearchOptions, type Shareholder, type StockInfo, type StockMarket, StockModule, TimelineModule, type TimelineOptions };
|
|
1006
|
+
export { APIError, AuthenticationError, type BacktestParams, type BacktestResult, type BatchOHLCVParams, type Chunk, type CompanyInfo, type CompanyOverview, type Concept, type ConceptDoc, type ConceptEvent, type ConceptFeed, type ConceptStock, ConceptsModule, DocsModule, type Document, type EarningsEvent, type FactorComputeParams, type FactorMeta, type FinancialStatement, type IPOEvent, type IPOStatus, type IndexConstituent, type IndexFund, type IndicatorComputeParams, type IndicatorData, type IndicatorMeta, type IndustryConstituent, type Interval, KBModule, type KBSearchOptions, type Market, NotFoundError, type OHLCVData, type OHLCVParams, type PaginatedResponse, type Period, type PriceAdjust, type PriceData, QuantModule, type Quote, RateLimitError, Reportify, type ReportifyConfig, ReportifyError, type ScreenParams, type ScreenedStock, type SearchOptions, type Shareholder, type StockInfo, type StockMarket, StockModule, TimelineModule, type TimelineOptions };
|
package/dist/index.d.ts
CHANGED
|
@@ -176,9 +176,30 @@ declare class StockModule {
|
|
|
176
176
|
/**
|
|
177
177
|
* Get company overview including business description, sector, and key metrics
|
|
178
178
|
*
|
|
179
|
-
* @param
|
|
179
|
+
* @param options - Query options
|
|
180
|
+
* @param options.symbols - Stock symbols. You can enter multiple items, separated by commas(,)
|
|
181
|
+
* @param options.names - Stock names. You can enter multiple items, separated by commas(,)
|
|
182
|
+
*
|
|
183
|
+
* @example
|
|
184
|
+
* ```typescript
|
|
185
|
+
* // Single stock by symbol
|
|
186
|
+
* const info = await client.stock.overview({ symbols: 'US:AAPL' });
|
|
187
|
+
* console.log(info.name, info.sector);
|
|
188
|
+
*
|
|
189
|
+
* // Multiple stocks by symbols
|
|
190
|
+
* const infos = await client.stock.overview({ symbols: 'US:AAPL,US:MSFT' });
|
|
191
|
+
* for (const info of infos) {
|
|
192
|
+
* console.log(info.name);
|
|
193
|
+
* }
|
|
194
|
+
*
|
|
195
|
+
* // Search by name
|
|
196
|
+
* const info = await client.stock.overview({ names: 'Apple Inc.' });
|
|
197
|
+
* ```
|
|
180
198
|
*/
|
|
181
|
-
overview(
|
|
199
|
+
overview(options: {
|
|
200
|
+
symbols?: string;
|
|
201
|
+
names?: string;
|
|
202
|
+
}): Promise<CompanyOverview | CompanyOverview[]>;
|
|
182
203
|
/**
|
|
183
204
|
* Get list of major shareholders
|
|
184
205
|
*
|
|
@@ -793,6 +814,117 @@ declare class QuantModule {
|
|
|
793
814
|
backtest(params: BacktestParams): Promise<BacktestResult>;
|
|
794
815
|
}
|
|
795
816
|
|
|
817
|
+
/**
|
|
818
|
+
* Concepts Module
|
|
819
|
+
*
|
|
820
|
+
* Provides access to concept-related data and feeds.
|
|
821
|
+
*/
|
|
822
|
+
|
|
823
|
+
/**
|
|
824
|
+
* Concept data structure
|
|
825
|
+
*/
|
|
826
|
+
interface Concept {
|
|
827
|
+
concept_name: string;
|
|
828
|
+
concept_desc?: string;
|
|
829
|
+
concept_keywords?: string[];
|
|
830
|
+
concept_events?: string[];
|
|
831
|
+
concept_score?: number;
|
|
832
|
+
trending_score?: number;
|
|
833
|
+
published_at?: number;
|
|
834
|
+
stocks?: ConceptStock[];
|
|
835
|
+
docs?: ConceptDoc[];
|
|
836
|
+
[key: string]: unknown;
|
|
837
|
+
}
|
|
838
|
+
/**
|
|
839
|
+
* Concept stock data
|
|
840
|
+
*/
|
|
841
|
+
interface ConceptStock {
|
|
842
|
+
symbol: string;
|
|
843
|
+
name: string;
|
|
844
|
+
market?: string;
|
|
845
|
+
[key: string]: unknown;
|
|
846
|
+
}
|
|
847
|
+
/**
|
|
848
|
+
* Concept document data
|
|
849
|
+
*/
|
|
850
|
+
interface ConceptDoc {
|
|
851
|
+
id: string;
|
|
852
|
+
title: string;
|
|
853
|
+
summary?: string;
|
|
854
|
+
channel_name?: string;
|
|
855
|
+
publish_at?: number;
|
|
856
|
+
[key: string]: unknown;
|
|
857
|
+
}
|
|
858
|
+
/**
|
|
859
|
+
* Concept feed data structure
|
|
860
|
+
*/
|
|
861
|
+
interface ConceptFeed {
|
|
862
|
+
concept_name: string;
|
|
863
|
+
concept_desc?: string;
|
|
864
|
+
concept_keywords?: string[];
|
|
865
|
+
gen_count?: number;
|
|
866
|
+
earliest_at?: number;
|
|
867
|
+
latest_at?: number;
|
|
868
|
+
stocks?: ConceptStock[];
|
|
869
|
+
docs?: ConceptDoc[];
|
|
870
|
+
events?: ConceptEvent[];
|
|
871
|
+
[key: string]: unknown;
|
|
872
|
+
}
|
|
873
|
+
/**
|
|
874
|
+
* Concept event data
|
|
875
|
+
*/
|
|
876
|
+
interface ConceptEvent {
|
|
877
|
+
event: string;
|
|
878
|
+
timestamp?: number;
|
|
879
|
+
[key: string]: unknown;
|
|
880
|
+
}
|
|
881
|
+
/**
|
|
882
|
+
* Concepts module for accessing concept data and feeds
|
|
883
|
+
*
|
|
884
|
+
* This module provides methods to:
|
|
885
|
+
* - Get latest concepts
|
|
886
|
+
* - Get today's concept feeds
|
|
887
|
+
*/
|
|
888
|
+
declare class ConceptsModule {
|
|
889
|
+
private client;
|
|
890
|
+
constructor(client: Reportify);
|
|
891
|
+
/**
|
|
892
|
+
* Get latest concepts
|
|
893
|
+
*
|
|
894
|
+
* @param options - Query options
|
|
895
|
+
* @param options.includeDocs - Whether to include related documents (default: true)
|
|
896
|
+
*
|
|
897
|
+
* @example
|
|
898
|
+
* ```typescript
|
|
899
|
+
* // Get latest concepts
|
|
900
|
+
* const concepts = await client.concepts.latest();
|
|
901
|
+
* for (const concept of concepts) {
|
|
902
|
+
* console.log(concept.concept_name);
|
|
903
|
+
* }
|
|
904
|
+
*
|
|
905
|
+
* // Get concepts without documents
|
|
906
|
+
* const concepts = await client.concepts.latest({ includeDocs: false });
|
|
907
|
+
* ```
|
|
908
|
+
*/
|
|
909
|
+
latest(options?: {
|
|
910
|
+
includeDocs?: boolean;
|
|
911
|
+
}): Promise<Concept[]>;
|
|
912
|
+
/**
|
|
913
|
+
* Get today's concept feeds
|
|
914
|
+
*
|
|
915
|
+
* @example
|
|
916
|
+
* ```typescript
|
|
917
|
+
* // Get today's concept feeds
|
|
918
|
+
* const feeds = await client.concepts.today();
|
|
919
|
+
* for (const feed of feeds) {
|
|
920
|
+
* console.log(`${feed.concept_name}: ${feed.gen_count} generations`);
|
|
921
|
+
* console.log(`Time range: ${feed.earliest_at} - ${feed.latest_at}`);
|
|
922
|
+
* }
|
|
923
|
+
* ```
|
|
924
|
+
*/
|
|
925
|
+
today(): Promise<ConceptFeed[]>;
|
|
926
|
+
}
|
|
927
|
+
|
|
796
928
|
/**
|
|
797
929
|
* Reportify Client
|
|
798
930
|
*
|
|
@@ -822,6 +954,7 @@ declare class Reportify {
|
|
|
822
954
|
readonly kb: KBModule;
|
|
823
955
|
readonly docs: DocsModule;
|
|
824
956
|
readonly quant: QuantModule;
|
|
957
|
+
readonly concepts: ConceptsModule;
|
|
825
958
|
constructor(config: ReportifyConfig);
|
|
826
959
|
/**
|
|
827
960
|
* Make an HTTP request to the API
|
|
@@ -870,4 +1003,4 @@ declare class Reportify {
|
|
|
870
1003
|
searchTranscripts(query: string, options?: SearchOptions): Promise<Document[]>;
|
|
871
1004
|
}
|
|
872
1005
|
|
|
873
|
-
export { APIError, AuthenticationError, type BacktestParams, type BacktestResult, type BatchOHLCVParams, type Chunk, type CompanyInfo, type CompanyOverview, DocsModule, type Document, type EarningsEvent, type FactorComputeParams, type FactorMeta, type FinancialStatement, type IPOEvent, type IPOStatus, type IndexConstituent, type IndexFund, type IndicatorComputeParams, type IndicatorData, type IndicatorMeta, type IndustryConstituent, type Interval, KBModule, type KBSearchOptions, type Market, NotFoundError, type OHLCVData, type OHLCVParams, type PaginatedResponse, type Period, type PriceAdjust, type PriceData, QuantModule, type Quote, RateLimitError, Reportify, type ReportifyConfig, ReportifyError, type ScreenParams, type ScreenedStock, type SearchOptions, type Shareholder, type StockInfo, type StockMarket, StockModule, TimelineModule, type TimelineOptions };
|
|
1006
|
+
export { APIError, AuthenticationError, type BacktestParams, type BacktestResult, type BatchOHLCVParams, type Chunk, type CompanyInfo, type CompanyOverview, type Concept, type ConceptDoc, type ConceptEvent, type ConceptFeed, type ConceptStock, ConceptsModule, DocsModule, type Document, type EarningsEvent, type FactorComputeParams, type FactorMeta, type FinancialStatement, type IPOEvent, type IPOStatus, type IndexConstituent, type IndexFund, type IndicatorComputeParams, type IndicatorData, type IndicatorMeta, type IndustryConstituent, type Interval, KBModule, type KBSearchOptions, type Market, NotFoundError, type OHLCVData, type OHLCVParams, type PaginatedResponse, type Period, type PriceAdjust, type PriceData, QuantModule, type Quote, RateLimitError, Reportify, type ReportifyConfig, ReportifyError, type ScreenParams, type ScreenedStock, type SearchOptions, type Shareholder, type StockInfo, type StockMarket, StockModule, TimelineModule, type TimelineOptions };
|
package/dist/index.js
CHANGED
|
@@ -22,6 +22,7 @@ var index_exports = {};
|
|
|
22
22
|
__export(index_exports, {
|
|
23
23
|
APIError: () => APIError,
|
|
24
24
|
AuthenticationError: () => AuthenticationError,
|
|
25
|
+
ConceptsModule: () => ConceptsModule,
|
|
25
26
|
DocsModule: () => DocsModule,
|
|
26
27
|
KBModule: () => KBModule,
|
|
27
28
|
NotFoundError: () => NotFoundError,
|
|
@@ -45,12 +46,37 @@ var StockModule = class {
|
|
|
45
46
|
/**
|
|
46
47
|
* Get company overview including business description, sector, and key metrics
|
|
47
48
|
*
|
|
48
|
-
* @param
|
|
49
|
+
* @param options - Query options
|
|
50
|
+
* @param options.symbols - Stock symbols. You can enter multiple items, separated by commas(,)
|
|
51
|
+
* @param options.names - Stock names. You can enter multiple items, separated by commas(,)
|
|
52
|
+
*
|
|
53
|
+
* @example
|
|
54
|
+
* ```typescript
|
|
55
|
+
* // Single stock by symbol
|
|
56
|
+
* const info = await client.stock.overview({ symbols: 'US:AAPL' });
|
|
57
|
+
* console.log(info.name, info.sector);
|
|
58
|
+
*
|
|
59
|
+
* // Multiple stocks by symbols
|
|
60
|
+
* const infos = await client.stock.overview({ symbols: 'US:AAPL,US:MSFT' });
|
|
61
|
+
* for (const info of infos) {
|
|
62
|
+
* console.log(info.name);
|
|
63
|
+
* }
|
|
64
|
+
*
|
|
65
|
+
* // Search by name
|
|
66
|
+
* const info = await client.stock.overview({ names: 'Apple Inc.' });
|
|
67
|
+
* ```
|
|
49
68
|
*/
|
|
50
|
-
async overview(
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
}
|
|
69
|
+
async overview(options) {
|
|
70
|
+
if (!options.symbols && !options.names) {
|
|
71
|
+
throw new Error("Either symbols or names must be provided");
|
|
72
|
+
}
|
|
73
|
+
const body = {};
|
|
74
|
+
if (options.symbols) body.symbols = options.symbols;
|
|
75
|
+
if (options.names) body.names = options.names;
|
|
76
|
+
return this.client.post(
|
|
77
|
+
"/v1/stock/company-overview",
|
|
78
|
+
body
|
|
79
|
+
);
|
|
54
80
|
}
|
|
55
81
|
/**
|
|
56
82
|
* Get list of major shareholders
|
|
@@ -774,6 +800,56 @@ var QuantModule = class {
|
|
|
774
800
|
}
|
|
775
801
|
};
|
|
776
802
|
|
|
803
|
+
// src/concepts.ts
|
|
804
|
+
var ConceptsModule = class {
|
|
805
|
+
constructor(client) {
|
|
806
|
+
this.client = client;
|
|
807
|
+
}
|
|
808
|
+
/**
|
|
809
|
+
* Get latest concepts
|
|
810
|
+
*
|
|
811
|
+
* @param options - Query options
|
|
812
|
+
* @param options.includeDocs - Whether to include related documents (default: true)
|
|
813
|
+
*
|
|
814
|
+
* @example
|
|
815
|
+
* ```typescript
|
|
816
|
+
* // Get latest concepts
|
|
817
|
+
* const concepts = await client.concepts.latest();
|
|
818
|
+
* for (const concept of concepts) {
|
|
819
|
+
* console.log(concept.concept_name);
|
|
820
|
+
* }
|
|
821
|
+
*
|
|
822
|
+
* // Get concepts without documents
|
|
823
|
+
* const concepts = await client.concepts.latest({ includeDocs: false });
|
|
824
|
+
* ```
|
|
825
|
+
*/
|
|
826
|
+
async latest(options = {}) {
|
|
827
|
+
const params = new URLSearchParams();
|
|
828
|
+
if (options.includeDocs !== void 0) {
|
|
829
|
+
params.append("include_docs", String(options.includeDocs));
|
|
830
|
+
}
|
|
831
|
+
const queryString = params.toString();
|
|
832
|
+
const url = `/v1/concepts/latest${queryString ? `?${queryString}` : ""}`;
|
|
833
|
+
return this.client.get(url);
|
|
834
|
+
}
|
|
835
|
+
/**
|
|
836
|
+
* Get today's concept feeds
|
|
837
|
+
*
|
|
838
|
+
* @example
|
|
839
|
+
* ```typescript
|
|
840
|
+
* // Get today's concept feeds
|
|
841
|
+
* const feeds = await client.concepts.today();
|
|
842
|
+
* for (const feed of feeds) {
|
|
843
|
+
* console.log(`${feed.concept_name}: ${feed.gen_count} generations`);
|
|
844
|
+
* console.log(`Time range: ${feed.earliest_at} - ${feed.latest_at}`);
|
|
845
|
+
* }
|
|
846
|
+
* ```
|
|
847
|
+
*/
|
|
848
|
+
async today() {
|
|
849
|
+
return this.client.get("/v1/concepts/today");
|
|
850
|
+
}
|
|
851
|
+
};
|
|
852
|
+
|
|
777
853
|
// src/types.ts
|
|
778
854
|
var ReportifyError = class extends Error {
|
|
779
855
|
statusCode;
|
|
@@ -821,6 +897,7 @@ var Reportify = class {
|
|
|
821
897
|
kb;
|
|
822
898
|
docs;
|
|
823
899
|
quant;
|
|
900
|
+
concepts;
|
|
824
901
|
constructor(config) {
|
|
825
902
|
if (!config.apiKey) {
|
|
826
903
|
throw new AuthenticationError("API key is required");
|
|
@@ -833,6 +910,7 @@ var Reportify = class {
|
|
|
833
910
|
this.kb = new KBModule(this);
|
|
834
911
|
this.docs = new DocsModule(this);
|
|
835
912
|
this.quant = new QuantModule(this);
|
|
913
|
+
this.concepts = new ConceptsModule(this);
|
|
836
914
|
}
|
|
837
915
|
/**
|
|
838
916
|
* Make an HTTP request to the API
|
|
@@ -854,7 +932,7 @@ var Reportify = class {
|
|
|
854
932
|
headers: {
|
|
855
933
|
Authorization: `Bearer ${this.apiKey}`,
|
|
856
934
|
"Content-Type": "application/json",
|
|
857
|
-
"User-Agent": "reportify-sdk-js/0.
|
|
935
|
+
"User-Agent": "reportify-sdk-js/0.2.8"
|
|
858
936
|
},
|
|
859
937
|
body: options.body ? JSON.stringify(options.body) : void 0,
|
|
860
938
|
signal: controller.signal
|
|
@@ -983,6 +1061,7 @@ var Reportify = class {
|
|
|
983
1061
|
0 && (module.exports = {
|
|
984
1062
|
APIError,
|
|
985
1063
|
AuthenticationError,
|
|
1064
|
+
ConceptsModule,
|
|
986
1065
|
DocsModule,
|
|
987
1066
|
KBModule,
|
|
988
1067
|
NotFoundError,
|
package/dist/index.mjs
CHANGED
|
@@ -9,12 +9,37 @@ var StockModule = class {
|
|
|
9
9
|
/**
|
|
10
10
|
* Get company overview including business description, sector, and key metrics
|
|
11
11
|
*
|
|
12
|
-
* @param
|
|
12
|
+
* @param options - Query options
|
|
13
|
+
* @param options.symbols - Stock symbols. You can enter multiple items, separated by commas(,)
|
|
14
|
+
* @param options.names - Stock names. You can enter multiple items, separated by commas(,)
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```typescript
|
|
18
|
+
* // Single stock by symbol
|
|
19
|
+
* const info = await client.stock.overview({ symbols: 'US:AAPL' });
|
|
20
|
+
* console.log(info.name, info.sector);
|
|
21
|
+
*
|
|
22
|
+
* // Multiple stocks by symbols
|
|
23
|
+
* const infos = await client.stock.overview({ symbols: 'US:AAPL,US:MSFT' });
|
|
24
|
+
* for (const info of infos) {
|
|
25
|
+
* console.log(info.name);
|
|
26
|
+
* }
|
|
27
|
+
*
|
|
28
|
+
* // Search by name
|
|
29
|
+
* const info = await client.stock.overview({ names: 'Apple Inc.' });
|
|
30
|
+
* ```
|
|
13
31
|
*/
|
|
14
|
-
async overview(
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
}
|
|
32
|
+
async overview(options) {
|
|
33
|
+
if (!options.symbols && !options.names) {
|
|
34
|
+
throw new Error("Either symbols or names must be provided");
|
|
35
|
+
}
|
|
36
|
+
const body = {};
|
|
37
|
+
if (options.symbols) body.symbols = options.symbols;
|
|
38
|
+
if (options.names) body.names = options.names;
|
|
39
|
+
return this.client.post(
|
|
40
|
+
"/v1/stock/company-overview",
|
|
41
|
+
body
|
|
42
|
+
);
|
|
18
43
|
}
|
|
19
44
|
/**
|
|
20
45
|
* Get list of major shareholders
|
|
@@ -738,6 +763,56 @@ var QuantModule = class {
|
|
|
738
763
|
}
|
|
739
764
|
};
|
|
740
765
|
|
|
766
|
+
// src/concepts.ts
|
|
767
|
+
var ConceptsModule = class {
|
|
768
|
+
constructor(client) {
|
|
769
|
+
this.client = client;
|
|
770
|
+
}
|
|
771
|
+
/**
|
|
772
|
+
* Get latest concepts
|
|
773
|
+
*
|
|
774
|
+
* @param options - Query options
|
|
775
|
+
* @param options.includeDocs - Whether to include related documents (default: true)
|
|
776
|
+
*
|
|
777
|
+
* @example
|
|
778
|
+
* ```typescript
|
|
779
|
+
* // Get latest concepts
|
|
780
|
+
* const concepts = await client.concepts.latest();
|
|
781
|
+
* for (const concept of concepts) {
|
|
782
|
+
* console.log(concept.concept_name);
|
|
783
|
+
* }
|
|
784
|
+
*
|
|
785
|
+
* // Get concepts without documents
|
|
786
|
+
* const concepts = await client.concepts.latest({ includeDocs: false });
|
|
787
|
+
* ```
|
|
788
|
+
*/
|
|
789
|
+
async latest(options = {}) {
|
|
790
|
+
const params = new URLSearchParams();
|
|
791
|
+
if (options.includeDocs !== void 0) {
|
|
792
|
+
params.append("include_docs", String(options.includeDocs));
|
|
793
|
+
}
|
|
794
|
+
const queryString = params.toString();
|
|
795
|
+
const url = `/v1/concepts/latest${queryString ? `?${queryString}` : ""}`;
|
|
796
|
+
return this.client.get(url);
|
|
797
|
+
}
|
|
798
|
+
/**
|
|
799
|
+
* Get today's concept feeds
|
|
800
|
+
*
|
|
801
|
+
* @example
|
|
802
|
+
* ```typescript
|
|
803
|
+
* // Get today's concept feeds
|
|
804
|
+
* const feeds = await client.concepts.today();
|
|
805
|
+
* for (const feed of feeds) {
|
|
806
|
+
* console.log(`${feed.concept_name}: ${feed.gen_count} generations`);
|
|
807
|
+
* console.log(`Time range: ${feed.earliest_at} - ${feed.latest_at}`);
|
|
808
|
+
* }
|
|
809
|
+
* ```
|
|
810
|
+
*/
|
|
811
|
+
async today() {
|
|
812
|
+
return this.client.get("/v1/concepts/today");
|
|
813
|
+
}
|
|
814
|
+
};
|
|
815
|
+
|
|
741
816
|
// src/types.ts
|
|
742
817
|
var ReportifyError = class extends Error {
|
|
743
818
|
statusCode;
|
|
@@ -785,6 +860,7 @@ var Reportify = class {
|
|
|
785
860
|
kb;
|
|
786
861
|
docs;
|
|
787
862
|
quant;
|
|
863
|
+
concepts;
|
|
788
864
|
constructor(config) {
|
|
789
865
|
if (!config.apiKey) {
|
|
790
866
|
throw new AuthenticationError("API key is required");
|
|
@@ -797,6 +873,7 @@ var Reportify = class {
|
|
|
797
873
|
this.kb = new KBModule(this);
|
|
798
874
|
this.docs = new DocsModule(this);
|
|
799
875
|
this.quant = new QuantModule(this);
|
|
876
|
+
this.concepts = new ConceptsModule(this);
|
|
800
877
|
}
|
|
801
878
|
/**
|
|
802
879
|
* Make an HTTP request to the API
|
|
@@ -818,7 +895,7 @@ var Reportify = class {
|
|
|
818
895
|
headers: {
|
|
819
896
|
Authorization: `Bearer ${this.apiKey}`,
|
|
820
897
|
"Content-Type": "application/json",
|
|
821
|
-
"User-Agent": "reportify-sdk-js/0.
|
|
898
|
+
"User-Agent": "reportify-sdk-js/0.2.8"
|
|
822
899
|
},
|
|
823
900
|
body: options.body ? JSON.stringify(options.body) : void 0,
|
|
824
901
|
signal: controller.signal
|
|
@@ -946,6 +1023,7 @@ var Reportify = class {
|
|
|
946
1023
|
export {
|
|
947
1024
|
APIError,
|
|
948
1025
|
AuthenticationError,
|
|
1026
|
+
ConceptsModule,
|
|
949
1027
|
DocsModule,
|
|
950
1028
|
KBModule,
|
|
951
1029
|
NotFoundError,
|