reportify-sdk 0.3.0 → 0.3.1
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 +45 -1
- package/dist/index.d.ts +45 -1
- package/dist/index.js +47 -2
- package/dist/index.mjs +47 -2
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -744,6 +744,19 @@ interface OHLCVData {
|
|
|
744
744
|
volume: number;
|
|
745
745
|
[key: string]: unknown;
|
|
746
746
|
}
|
|
747
|
+
type FinancialType = 'income' | 'cashflow' | 'balancesheet' | 'equity';
|
|
748
|
+
interface FinancialsParams {
|
|
749
|
+
financialType: FinancialType;
|
|
750
|
+
symbol: string;
|
|
751
|
+
market?: StockMarket;
|
|
752
|
+
startYear?: number;
|
|
753
|
+
endYear?: number;
|
|
754
|
+
}
|
|
755
|
+
interface FinancialData {
|
|
756
|
+
symbol: string;
|
|
757
|
+
report_period: string;
|
|
758
|
+
[key: string]: unknown;
|
|
759
|
+
}
|
|
747
760
|
interface BacktestParams {
|
|
748
761
|
startDate: string;
|
|
749
762
|
endDate: string;
|
|
@@ -925,6 +938,37 @@ declare class QuantModule {
|
|
|
925
938
|
* ```
|
|
926
939
|
*/
|
|
927
940
|
ohlcvBatch(params: BatchOHLCVParams): Promise<OHLCVData[]>;
|
|
941
|
+
/**
|
|
942
|
+
* Get historical financial statement data for a single symbol
|
|
943
|
+
*
|
|
944
|
+
* @param params - Financials parameters
|
|
945
|
+
* @returns Array of financial data sorted by report period
|
|
946
|
+
*
|
|
947
|
+
* @example
|
|
948
|
+
* ```typescript
|
|
949
|
+
* // Get income statement
|
|
950
|
+
* const data = await client.quant.financials({
|
|
951
|
+
* financialType: 'income',
|
|
952
|
+
* symbol: '000001'
|
|
953
|
+
* });
|
|
954
|
+
*
|
|
955
|
+
* // Get balance sheet for specific years
|
|
956
|
+
* const data = await client.quant.financials({
|
|
957
|
+
* financialType: 'balancesheet',
|
|
958
|
+
* symbol: '600519',
|
|
959
|
+
* startYear: 2020,
|
|
960
|
+
* endYear: 2024
|
|
961
|
+
* });
|
|
962
|
+
*
|
|
963
|
+
* // Get cash flow statement for HK stock
|
|
964
|
+
* const data = await client.quant.financials({
|
|
965
|
+
* financialType: 'cashflow',
|
|
966
|
+
* symbol: '00700',
|
|
967
|
+
* market: 'hk'
|
|
968
|
+
* });
|
|
969
|
+
* ```
|
|
970
|
+
*/
|
|
971
|
+
financials(params: FinancialsParams): Promise<FinancialData[]>;
|
|
928
972
|
/**
|
|
929
973
|
* Execute strategy backtest
|
|
930
974
|
*
|
|
@@ -1504,4 +1548,4 @@ declare class Reportify {
|
|
|
1504
1548
|
getBytes(path: string): Promise<ArrayBuffer>;
|
|
1505
1549
|
}
|
|
1506
1550
|
|
|
1507
|
-
export { APIError, type AgentConversation, type AgentMessage, AgentModule, AuthenticationError, type BacktestParams, type BacktestResult, type BatchOHLCVParams, type Calendar, type Channel, ChannelsModule, type ChatCompletionOptions, type ChatCompletionResponse, type ChatMode, ChatModule, type Chunk, type ChunkSearchOptions, type CompanyInfo, type CompanyOverview, type Concept, type ConceptDoc, type ConceptEvent, type ConceptFeed, type ConceptStock, ConceptsModule, type DocsListOptions, DocsModule, type Document, type DocumentInput, type EarningsEvent, type EarningsSearchOptions, type FactorComputeParams, type FactorMeta, type FinancialStatement, type FollowedCompany, type IPOEvent, type IPOStatus, type IndexConstituent, type IndexFund, type IndicatorComputeParams, type IndicatorData, type IndicatorMeta, type IndustryConstituent, KBModule, type KBSearchOptions, type Market, NotFoundError, type OHLCVData, type OHLCVParams, type PaginatedResponse, type Period, type PriceData, QuantModule, type Quote, RateLimitError, Reportify, type ReportifyConfig, ReportifyError, type ScreenParams, type ScreenedStock, SearchModule, type SearchOptions, type Shareholder, type ShareholderType, type StockInfo, type StockMarket, StockModule, TimelineModule, type TimelineOptions, type UploadDocRequest, UserModule };
|
|
1551
|
+
export { APIError, type AgentConversation, type AgentMessage, AgentModule, AuthenticationError, type BacktestParams, type BacktestResult, type BatchOHLCVParams, type Calendar, type Channel, ChannelsModule, type ChatCompletionOptions, type ChatCompletionResponse, type ChatMode, ChatModule, type Chunk, type ChunkSearchOptions, type CompanyInfo, type CompanyOverview, type Concept, type ConceptDoc, type ConceptEvent, type ConceptFeed, type ConceptStock, ConceptsModule, type DocsListOptions, DocsModule, type Document, type DocumentInput, type EarningsEvent, type EarningsSearchOptions, type FactorComputeParams, type FactorMeta, type FinancialData, type FinancialStatement, type FinancialType, type FinancialsParams, type FollowedCompany, type IPOEvent, type IPOStatus, type IndexConstituent, type IndexFund, type IndicatorComputeParams, type IndicatorData, type IndicatorMeta, type IndustryConstituent, KBModule, type KBSearchOptions, type Market, NotFoundError, type OHLCVData, type OHLCVParams, type PaginatedResponse, type Period, type PriceData, QuantModule, type Quote, RateLimitError, Reportify, type ReportifyConfig, ReportifyError, type ScreenParams, type ScreenedStock, SearchModule, type SearchOptions, type Shareholder, type ShareholderType, type StockInfo, type StockMarket, StockModule, TimelineModule, type TimelineOptions, type UploadDocRequest, UserModule };
|
package/dist/index.d.ts
CHANGED
|
@@ -744,6 +744,19 @@ interface OHLCVData {
|
|
|
744
744
|
volume: number;
|
|
745
745
|
[key: string]: unknown;
|
|
746
746
|
}
|
|
747
|
+
type FinancialType = 'income' | 'cashflow' | 'balancesheet' | 'equity';
|
|
748
|
+
interface FinancialsParams {
|
|
749
|
+
financialType: FinancialType;
|
|
750
|
+
symbol: string;
|
|
751
|
+
market?: StockMarket;
|
|
752
|
+
startYear?: number;
|
|
753
|
+
endYear?: number;
|
|
754
|
+
}
|
|
755
|
+
interface FinancialData {
|
|
756
|
+
symbol: string;
|
|
757
|
+
report_period: string;
|
|
758
|
+
[key: string]: unknown;
|
|
759
|
+
}
|
|
747
760
|
interface BacktestParams {
|
|
748
761
|
startDate: string;
|
|
749
762
|
endDate: string;
|
|
@@ -925,6 +938,37 @@ declare class QuantModule {
|
|
|
925
938
|
* ```
|
|
926
939
|
*/
|
|
927
940
|
ohlcvBatch(params: BatchOHLCVParams): Promise<OHLCVData[]>;
|
|
941
|
+
/**
|
|
942
|
+
* Get historical financial statement data for a single symbol
|
|
943
|
+
*
|
|
944
|
+
* @param params - Financials parameters
|
|
945
|
+
* @returns Array of financial data sorted by report period
|
|
946
|
+
*
|
|
947
|
+
* @example
|
|
948
|
+
* ```typescript
|
|
949
|
+
* // Get income statement
|
|
950
|
+
* const data = await client.quant.financials({
|
|
951
|
+
* financialType: 'income',
|
|
952
|
+
* symbol: '000001'
|
|
953
|
+
* });
|
|
954
|
+
*
|
|
955
|
+
* // Get balance sheet for specific years
|
|
956
|
+
* const data = await client.quant.financials({
|
|
957
|
+
* financialType: 'balancesheet',
|
|
958
|
+
* symbol: '600519',
|
|
959
|
+
* startYear: 2020,
|
|
960
|
+
* endYear: 2024
|
|
961
|
+
* });
|
|
962
|
+
*
|
|
963
|
+
* // Get cash flow statement for HK stock
|
|
964
|
+
* const data = await client.quant.financials({
|
|
965
|
+
* financialType: 'cashflow',
|
|
966
|
+
* symbol: '00700',
|
|
967
|
+
* market: 'hk'
|
|
968
|
+
* });
|
|
969
|
+
* ```
|
|
970
|
+
*/
|
|
971
|
+
financials(params: FinancialsParams): Promise<FinancialData[]>;
|
|
928
972
|
/**
|
|
929
973
|
* Execute strategy backtest
|
|
930
974
|
*
|
|
@@ -1504,4 +1548,4 @@ declare class Reportify {
|
|
|
1504
1548
|
getBytes(path: string): Promise<ArrayBuffer>;
|
|
1505
1549
|
}
|
|
1506
1550
|
|
|
1507
|
-
export { APIError, type AgentConversation, type AgentMessage, AgentModule, AuthenticationError, type BacktestParams, type BacktestResult, type BatchOHLCVParams, type Calendar, type Channel, ChannelsModule, type ChatCompletionOptions, type ChatCompletionResponse, type ChatMode, ChatModule, type Chunk, type ChunkSearchOptions, type CompanyInfo, type CompanyOverview, type Concept, type ConceptDoc, type ConceptEvent, type ConceptFeed, type ConceptStock, ConceptsModule, type DocsListOptions, DocsModule, type Document, type DocumentInput, type EarningsEvent, type EarningsSearchOptions, type FactorComputeParams, type FactorMeta, type FinancialStatement, type FollowedCompany, type IPOEvent, type IPOStatus, type IndexConstituent, type IndexFund, type IndicatorComputeParams, type IndicatorData, type IndicatorMeta, type IndustryConstituent, KBModule, type KBSearchOptions, type Market, NotFoundError, type OHLCVData, type OHLCVParams, type PaginatedResponse, type Period, type PriceData, QuantModule, type Quote, RateLimitError, Reportify, type ReportifyConfig, ReportifyError, type ScreenParams, type ScreenedStock, SearchModule, type SearchOptions, type Shareholder, type ShareholderType, type StockInfo, type StockMarket, StockModule, TimelineModule, type TimelineOptions, type UploadDocRequest, UserModule };
|
|
1551
|
+
export { APIError, type AgentConversation, type AgentMessage, AgentModule, AuthenticationError, type BacktestParams, type BacktestResult, type BatchOHLCVParams, type Calendar, type Channel, ChannelsModule, type ChatCompletionOptions, type ChatCompletionResponse, type ChatMode, ChatModule, type Chunk, type ChunkSearchOptions, type CompanyInfo, type CompanyOverview, type Concept, type ConceptDoc, type ConceptEvent, type ConceptFeed, type ConceptStock, ConceptsModule, type DocsListOptions, DocsModule, type Document, type DocumentInput, type EarningsEvent, type EarningsSearchOptions, type FactorComputeParams, type FactorMeta, type FinancialData, type FinancialStatement, type FinancialType, type FinancialsParams, type FollowedCompany, type IPOEvent, type IPOStatus, type IndexConstituent, type IndexFund, type IndicatorComputeParams, type IndicatorData, type IndicatorMeta, type IndustryConstituent, KBModule, type KBSearchOptions, type Market, NotFoundError, type OHLCVData, type OHLCVParams, type PaginatedResponse, type Period, type PriceData, QuantModule, type Quote, RateLimitError, Reportify, type ReportifyConfig, ReportifyError, type ScreenParams, type ScreenedStock, SearchModule, type SearchOptions, type Shareholder, type ShareholderType, type StockInfo, type StockMarket, StockModule, TimelineModule, type TimelineOptions, type UploadDocRequest, UserModule };
|
package/dist/index.js
CHANGED
|
@@ -841,6 +841,51 @@ var QuantModule = class {
|
|
|
841
841
|
return response.datas || [];
|
|
842
842
|
}
|
|
843
843
|
// ===========================================================================
|
|
844
|
+
// Financials
|
|
845
|
+
// ===========================================================================
|
|
846
|
+
/**
|
|
847
|
+
* Get historical financial statement data for a single symbol
|
|
848
|
+
*
|
|
849
|
+
* @param params - Financials parameters
|
|
850
|
+
* @returns Array of financial data sorted by report period
|
|
851
|
+
*
|
|
852
|
+
* @example
|
|
853
|
+
* ```typescript
|
|
854
|
+
* // Get income statement
|
|
855
|
+
* const data = await client.quant.financials({
|
|
856
|
+
* financialType: 'income',
|
|
857
|
+
* symbol: '000001'
|
|
858
|
+
* });
|
|
859
|
+
*
|
|
860
|
+
* // Get balance sheet for specific years
|
|
861
|
+
* const data = await client.quant.financials({
|
|
862
|
+
* financialType: 'balancesheet',
|
|
863
|
+
* symbol: '600519',
|
|
864
|
+
* startYear: 2020,
|
|
865
|
+
* endYear: 2024
|
|
866
|
+
* });
|
|
867
|
+
*
|
|
868
|
+
* // Get cash flow statement for HK stock
|
|
869
|
+
* const data = await client.quant.financials({
|
|
870
|
+
* financialType: 'cashflow',
|
|
871
|
+
* symbol: '00700',
|
|
872
|
+
* market: 'hk'
|
|
873
|
+
* });
|
|
874
|
+
* ```
|
|
875
|
+
*/
|
|
876
|
+
async financials(params) {
|
|
877
|
+
const response = await this.client.get(
|
|
878
|
+
`/v1/quant/financials/${params.financialType}`,
|
|
879
|
+
{
|
|
880
|
+
symbol: params.symbol,
|
|
881
|
+
market: params.market || "cn",
|
|
882
|
+
start_year: params.startYear,
|
|
883
|
+
end_year: params.endYear
|
|
884
|
+
}
|
|
885
|
+
);
|
|
886
|
+
return response.datas || [];
|
|
887
|
+
}
|
|
888
|
+
// ===========================================================================
|
|
844
889
|
// Backtest
|
|
845
890
|
// ===========================================================================
|
|
846
891
|
/**
|
|
@@ -1664,7 +1709,7 @@ var Reportify = class {
|
|
|
1664
1709
|
headers: {
|
|
1665
1710
|
Authorization: `Bearer ${this.apiKey}`,
|
|
1666
1711
|
"Content-Type": "application/json",
|
|
1667
|
-
"User-Agent": "reportify-sdk-js/0.3.
|
|
1712
|
+
"User-Agent": "reportify-sdk-js/0.3.1"
|
|
1668
1713
|
},
|
|
1669
1714
|
body: options.body ? JSON.stringify(options.body) : void 0,
|
|
1670
1715
|
signal: controller.signal
|
|
@@ -1725,7 +1770,7 @@ var Reportify = class {
|
|
|
1725
1770
|
headers: {
|
|
1726
1771
|
Authorization: `Bearer ${this.apiKey}`,
|
|
1727
1772
|
"Content-Type": "application/json",
|
|
1728
|
-
"User-Agent": "reportify-sdk-typescript/0.3.
|
|
1773
|
+
"User-Agent": "reportify-sdk-typescript/0.3.1"
|
|
1729
1774
|
}
|
|
1730
1775
|
});
|
|
1731
1776
|
if (!response.ok) {
|
package/dist/index.mjs
CHANGED
|
@@ -799,6 +799,51 @@ var QuantModule = class {
|
|
|
799
799
|
return response.datas || [];
|
|
800
800
|
}
|
|
801
801
|
// ===========================================================================
|
|
802
|
+
// Financials
|
|
803
|
+
// ===========================================================================
|
|
804
|
+
/**
|
|
805
|
+
* Get historical financial statement data for a single symbol
|
|
806
|
+
*
|
|
807
|
+
* @param params - Financials parameters
|
|
808
|
+
* @returns Array of financial data sorted by report period
|
|
809
|
+
*
|
|
810
|
+
* @example
|
|
811
|
+
* ```typescript
|
|
812
|
+
* // Get income statement
|
|
813
|
+
* const data = await client.quant.financials({
|
|
814
|
+
* financialType: 'income',
|
|
815
|
+
* symbol: '000001'
|
|
816
|
+
* });
|
|
817
|
+
*
|
|
818
|
+
* // Get balance sheet for specific years
|
|
819
|
+
* const data = await client.quant.financials({
|
|
820
|
+
* financialType: 'balancesheet',
|
|
821
|
+
* symbol: '600519',
|
|
822
|
+
* startYear: 2020,
|
|
823
|
+
* endYear: 2024
|
|
824
|
+
* });
|
|
825
|
+
*
|
|
826
|
+
* // Get cash flow statement for HK stock
|
|
827
|
+
* const data = await client.quant.financials({
|
|
828
|
+
* financialType: 'cashflow',
|
|
829
|
+
* symbol: '00700',
|
|
830
|
+
* market: 'hk'
|
|
831
|
+
* });
|
|
832
|
+
* ```
|
|
833
|
+
*/
|
|
834
|
+
async financials(params) {
|
|
835
|
+
const response = await this.client.get(
|
|
836
|
+
`/v1/quant/financials/${params.financialType}`,
|
|
837
|
+
{
|
|
838
|
+
symbol: params.symbol,
|
|
839
|
+
market: params.market || "cn",
|
|
840
|
+
start_year: params.startYear,
|
|
841
|
+
end_year: params.endYear
|
|
842
|
+
}
|
|
843
|
+
);
|
|
844
|
+
return response.datas || [];
|
|
845
|
+
}
|
|
846
|
+
// ===========================================================================
|
|
802
847
|
// Backtest
|
|
803
848
|
// ===========================================================================
|
|
804
849
|
/**
|
|
@@ -1622,7 +1667,7 @@ var Reportify = class {
|
|
|
1622
1667
|
headers: {
|
|
1623
1668
|
Authorization: `Bearer ${this.apiKey}`,
|
|
1624
1669
|
"Content-Type": "application/json",
|
|
1625
|
-
"User-Agent": "reportify-sdk-js/0.3.
|
|
1670
|
+
"User-Agent": "reportify-sdk-js/0.3.1"
|
|
1626
1671
|
},
|
|
1627
1672
|
body: options.body ? JSON.stringify(options.body) : void 0,
|
|
1628
1673
|
signal: controller.signal
|
|
@@ -1683,7 +1728,7 @@ var Reportify = class {
|
|
|
1683
1728
|
headers: {
|
|
1684
1729
|
Authorization: `Bearer ${this.apiKey}`,
|
|
1685
1730
|
"Content-Type": "application/json",
|
|
1686
|
-
"User-Agent": "reportify-sdk-typescript/0.3.
|
|
1731
|
+
"User-Agent": "reportify-sdk-typescript/0.3.1"
|
|
1687
1732
|
}
|
|
1688
1733
|
});
|
|
1689
1734
|
if (!response.ok) {
|