reportify-sdk 0.3.20 → 0.3.22
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 +60 -1
- package/dist/index.d.ts +60 -1
- package/dist/index.js +51 -0
- package/dist/index.mjs +50 -0
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1284,10 +1284,12 @@ declare class AgentModule {
|
|
|
1284
1284
|
* @param options - Optional parameters
|
|
1285
1285
|
* @param options.title - Conversation title
|
|
1286
1286
|
* @param options.conversationType - Conversation type: "agent_chat", "task_chat", "debug_chat", "bot_chat"
|
|
1287
|
+
* @param options.meta - Metadata dict (optional)
|
|
1287
1288
|
*/
|
|
1288
1289
|
createConversation(agentId: number, options?: {
|
|
1289
1290
|
title?: string;
|
|
1290
1291
|
conversationType?: string;
|
|
1292
|
+
meta?: Record<string, unknown>;
|
|
1291
1293
|
}): Promise<AgentConversation>;
|
|
1292
1294
|
/**
|
|
1293
1295
|
* Chat with agent in a conversation
|
|
@@ -1809,6 +1811,62 @@ declare class FollowingModule {
|
|
|
1809
1811
|
}>;
|
|
1810
1812
|
}
|
|
1811
1813
|
|
|
1814
|
+
/**
|
|
1815
|
+
* Macro Module
|
|
1816
|
+
*
|
|
1817
|
+
* Provides access to macroeconomic data including commodity prices.
|
|
1818
|
+
*/
|
|
1819
|
+
|
|
1820
|
+
type CommodityType = 'oil' | 'gold' | 'gas' | 'silver' | 'platinum';
|
|
1821
|
+
interface CommodityData {
|
|
1822
|
+
date: string;
|
|
1823
|
+
/** WTI crude oil spot price (USD/barrel) - type=oil */
|
|
1824
|
+
wti_co_sp?: number;
|
|
1825
|
+
/** Brent crude oil spot price (USD/barrel) - type=oil */
|
|
1826
|
+
brent_co_sp?: number;
|
|
1827
|
+
/** Shanghai gold price (CNY) - type=gold */
|
|
1828
|
+
sge_pm_cny?: number;
|
|
1829
|
+
/** London gold LBMA PM price (USD/oz) - type=gold */
|
|
1830
|
+
lbma_pm_usd?: number;
|
|
1831
|
+
/** Henry Hub natural gas spot price (USD/MMBtu) - type=gas */
|
|
1832
|
+
hh_ng_sp?: number;
|
|
1833
|
+
/** London silver price (USD/oz) - type=silver */
|
|
1834
|
+
si_eur?: number;
|
|
1835
|
+
/** London platinum price (USD/oz) - type=platinum */
|
|
1836
|
+
pl_usd?: number;
|
|
1837
|
+
}
|
|
1838
|
+
declare class MacroModule {
|
|
1839
|
+
private client;
|
|
1840
|
+
constructor(client: Reportify);
|
|
1841
|
+
/**
|
|
1842
|
+
* Get commodity price data
|
|
1843
|
+
*
|
|
1844
|
+
* @param type - Commodity type: oil, gold, gas, silver, or platinum
|
|
1845
|
+
* @param options.startDate - Start date (YYYY-MM-DD)
|
|
1846
|
+
* @param options.endDate - End date (YYYY-MM-DD)
|
|
1847
|
+
*
|
|
1848
|
+
* @example
|
|
1849
|
+
* ```typescript
|
|
1850
|
+
* // Get oil prices
|
|
1851
|
+
* const oil = await client.macro.commodities('oil', {
|
|
1852
|
+
* startDate: '2026-02-01',
|
|
1853
|
+
* endDate: '2026-02-09',
|
|
1854
|
+
* });
|
|
1855
|
+
* console.log(oil); // [{ date: '...', wti_co_sp: 63.77, brent_co_sp: 70.45 }, ...]
|
|
1856
|
+
*
|
|
1857
|
+
* // Get gold prices
|
|
1858
|
+
* const gold = await client.macro.commodities('gold', {
|
|
1859
|
+
* startDate: '2026-02-01',
|
|
1860
|
+
* endDate: '2026-02-09',
|
|
1861
|
+
* });
|
|
1862
|
+
* ```
|
|
1863
|
+
*/
|
|
1864
|
+
commodities(type: CommodityType, options: {
|
|
1865
|
+
startDate: string;
|
|
1866
|
+
endDate: string;
|
|
1867
|
+
}): Promise<CommodityData[]>;
|
|
1868
|
+
}
|
|
1869
|
+
|
|
1812
1870
|
/**
|
|
1813
1871
|
* Reportify Client
|
|
1814
1872
|
*
|
|
@@ -1845,6 +1903,7 @@ declare class Reportify {
|
|
|
1845
1903
|
readonly timeline: TimelineModule;
|
|
1846
1904
|
readonly user: UserModule;
|
|
1847
1905
|
readonly following: FollowingModule;
|
|
1906
|
+
readonly macro: MacroModule;
|
|
1848
1907
|
constructor(config: ReportifyConfig);
|
|
1849
1908
|
/**
|
|
1850
1909
|
* Make an HTTP request to the API
|
|
@@ -1875,4 +1934,4 @@ declare class Reportify {
|
|
|
1875
1934
|
getBytes(path: string): Promise<ArrayBuffer>;
|
|
1876
1935
|
}
|
|
1877
1936
|
|
|
1878
|
-
export { APIError, type AgentConversation, type AgentMessage, AgentModule, AuthenticationError, type BacktestParams, type BacktestResult, type BatchKline1mParams, type BatchMinuteParams, 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, FollowingModule, type IPOEvent, type IPOStatus, type IndexConstituent, type IndexFund, type IndicatorComputeParams, type IndicatorData, type IndicatorMeta, type IndustryConstituent, KBModule, type KBSearchOptions, type Kline1mParams, type Market, type MinuteParams, 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 };
|
|
1937
|
+
export { APIError, type AgentConversation, type AgentMessage, AgentModule, AuthenticationError, type BacktestParams, type BacktestResult, type BatchKline1mParams, type BatchMinuteParams, type BatchOHLCVParams, type Calendar, type Channel, ChannelsModule, type ChatCompletionOptions, type ChatCompletionResponse, type ChatMode, ChatModule, type Chunk, type ChunkSearchOptions, type CommodityData, type CommodityType, 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, FollowingModule, type IPOEvent, type IPOStatus, type IndexConstituent, type IndexFund, type IndicatorComputeParams, type IndicatorData, type IndicatorMeta, type IndustryConstituent, KBModule, type KBSearchOptions, type Kline1mParams, MacroModule, type Market, type MinuteParams, 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
|
@@ -1284,10 +1284,12 @@ declare class AgentModule {
|
|
|
1284
1284
|
* @param options - Optional parameters
|
|
1285
1285
|
* @param options.title - Conversation title
|
|
1286
1286
|
* @param options.conversationType - Conversation type: "agent_chat", "task_chat", "debug_chat", "bot_chat"
|
|
1287
|
+
* @param options.meta - Metadata dict (optional)
|
|
1287
1288
|
*/
|
|
1288
1289
|
createConversation(agentId: number, options?: {
|
|
1289
1290
|
title?: string;
|
|
1290
1291
|
conversationType?: string;
|
|
1292
|
+
meta?: Record<string, unknown>;
|
|
1291
1293
|
}): Promise<AgentConversation>;
|
|
1292
1294
|
/**
|
|
1293
1295
|
* Chat with agent in a conversation
|
|
@@ -1809,6 +1811,62 @@ declare class FollowingModule {
|
|
|
1809
1811
|
}>;
|
|
1810
1812
|
}
|
|
1811
1813
|
|
|
1814
|
+
/**
|
|
1815
|
+
* Macro Module
|
|
1816
|
+
*
|
|
1817
|
+
* Provides access to macroeconomic data including commodity prices.
|
|
1818
|
+
*/
|
|
1819
|
+
|
|
1820
|
+
type CommodityType = 'oil' | 'gold' | 'gas' | 'silver' | 'platinum';
|
|
1821
|
+
interface CommodityData {
|
|
1822
|
+
date: string;
|
|
1823
|
+
/** WTI crude oil spot price (USD/barrel) - type=oil */
|
|
1824
|
+
wti_co_sp?: number;
|
|
1825
|
+
/** Brent crude oil spot price (USD/barrel) - type=oil */
|
|
1826
|
+
brent_co_sp?: number;
|
|
1827
|
+
/** Shanghai gold price (CNY) - type=gold */
|
|
1828
|
+
sge_pm_cny?: number;
|
|
1829
|
+
/** London gold LBMA PM price (USD/oz) - type=gold */
|
|
1830
|
+
lbma_pm_usd?: number;
|
|
1831
|
+
/** Henry Hub natural gas spot price (USD/MMBtu) - type=gas */
|
|
1832
|
+
hh_ng_sp?: number;
|
|
1833
|
+
/** London silver price (USD/oz) - type=silver */
|
|
1834
|
+
si_eur?: number;
|
|
1835
|
+
/** London platinum price (USD/oz) - type=platinum */
|
|
1836
|
+
pl_usd?: number;
|
|
1837
|
+
}
|
|
1838
|
+
declare class MacroModule {
|
|
1839
|
+
private client;
|
|
1840
|
+
constructor(client: Reportify);
|
|
1841
|
+
/**
|
|
1842
|
+
* Get commodity price data
|
|
1843
|
+
*
|
|
1844
|
+
* @param type - Commodity type: oil, gold, gas, silver, or platinum
|
|
1845
|
+
* @param options.startDate - Start date (YYYY-MM-DD)
|
|
1846
|
+
* @param options.endDate - End date (YYYY-MM-DD)
|
|
1847
|
+
*
|
|
1848
|
+
* @example
|
|
1849
|
+
* ```typescript
|
|
1850
|
+
* // Get oil prices
|
|
1851
|
+
* const oil = await client.macro.commodities('oil', {
|
|
1852
|
+
* startDate: '2026-02-01',
|
|
1853
|
+
* endDate: '2026-02-09',
|
|
1854
|
+
* });
|
|
1855
|
+
* console.log(oil); // [{ date: '...', wti_co_sp: 63.77, brent_co_sp: 70.45 }, ...]
|
|
1856
|
+
*
|
|
1857
|
+
* // Get gold prices
|
|
1858
|
+
* const gold = await client.macro.commodities('gold', {
|
|
1859
|
+
* startDate: '2026-02-01',
|
|
1860
|
+
* endDate: '2026-02-09',
|
|
1861
|
+
* });
|
|
1862
|
+
* ```
|
|
1863
|
+
*/
|
|
1864
|
+
commodities(type: CommodityType, options: {
|
|
1865
|
+
startDate: string;
|
|
1866
|
+
endDate: string;
|
|
1867
|
+
}): Promise<CommodityData[]>;
|
|
1868
|
+
}
|
|
1869
|
+
|
|
1812
1870
|
/**
|
|
1813
1871
|
* Reportify Client
|
|
1814
1872
|
*
|
|
@@ -1845,6 +1903,7 @@ declare class Reportify {
|
|
|
1845
1903
|
readonly timeline: TimelineModule;
|
|
1846
1904
|
readonly user: UserModule;
|
|
1847
1905
|
readonly following: FollowingModule;
|
|
1906
|
+
readonly macro: MacroModule;
|
|
1848
1907
|
constructor(config: ReportifyConfig);
|
|
1849
1908
|
/**
|
|
1850
1909
|
* Make an HTTP request to the API
|
|
@@ -1875,4 +1934,4 @@ declare class Reportify {
|
|
|
1875
1934
|
getBytes(path: string): Promise<ArrayBuffer>;
|
|
1876
1935
|
}
|
|
1877
1936
|
|
|
1878
|
-
export { APIError, type AgentConversation, type AgentMessage, AgentModule, AuthenticationError, type BacktestParams, type BacktestResult, type BatchKline1mParams, type BatchMinuteParams, 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, FollowingModule, type IPOEvent, type IPOStatus, type IndexConstituent, type IndexFund, type IndicatorComputeParams, type IndicatorData, type IndicatorMeta, type IndustryConstituent, KBModule, type KBSearchOptions, type Kline1mParams, type Market, type MinuteParams, 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 };
|
|
1937
|
+
export { APIError, type AgentConversation, type AgentMessage, AgentModule, AuthenticationError, type BacktestParams, type BacktestResult, type BatchKline1mParams, type BatchMinuteParams, type BatchOHLCVParams, type Calendar, type Channel, ChannelsModule, type ChatCompletionOptions, type ChatCompletionResponse, type ChatMode, ChatModule, type Chunk, type ChunkSearchOptions, type CommodityData, type CommodityType, 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, FollowingModule, type IPOEvent, type IPOStatus, type IndexConstituent, type IndexFund, type IndicatorComputeParams, type IndicatorData, type IndicatorMeta, type IndustryConstituent, KBModule, type KBSearchOptions, type Kline1mParams, MacroModule, type Market, type MinuteParams, 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
|
@@ -29,6 +29,7 @@ __export(index_exports, {
|
|
|
29
29
|
DocsModule: () => DocsModule,
|
|
30
30
|
FollowingModule: () => FollowingModule,
|
|
31
31
|
KBModule: () => KBModule,
|
|
32
|
+
MacroModule: () => MacroModule,
|
|
32
33
|
NotFoundError: () => NotFoundError,
|
|
33
34
|
QuantModule: () => QuantModule,
|
|
34
35
|
RateLimitError: () => RateLimitError,
|
|
@@ -1214,11 +1215,13 @@ var AgentModule = class {
|
|
|
1214
1215
|
* @param options - Optional parameters
|
|
1215
1216
|
* @param options.title - Conversation title
|
|
1216
1217
|
* @param options.conversationType - Conversation type: "agent_chat", "task_chat", "debug_chat", "bot_chat"
|
|
1218
|
+
* @param options.meta - Metadata dict (optional)
|
|
1217
1219
|
*/
|
|
1218
1220
|
async createConversation(agentId, options = {}) {
|
|
1219
1221
|
const body = { agent_id: agentId };
|
|
1220
1222
|
if (options.title) body.title = options.title;
|
|
1221
1223
|
if (options.conversationType) body.conversation_type = options.conversationType;
|
|
1224
|
+
if (options.meta) body.meta = options.meta;
|
|
1222
1225
|
const response = await this.client.post("/v1/agent/conversations", body);
|
|
1223
1226
|
return {
|
|
1224
1227
|
id: response.id,
|
|
@@ -1938,6 +1941,51 @@ var FollowingModule = class {
|
|
|
1938
1941
|
}
|
|
1939
1942
|
};
|
|
1940
1943
|
|
|
1944
|
+
// src/macro.ts
|
|
1945
|
+
var MacroModule = class {
|
|
1946
|
+
constructor(client) {
|
|
1947
|
+
this.client = client;
|
|
1948
|
+
}
|
|
1949
|
+
/**
|
|
1950
|
+
* Get commodity price data
|
|
1951
|
+
*
|
|
1952
|
+
* @param type - Commodity type: oil, gold, gas, silver, or platinum
|
|
1953
|
+
* @param options.startDate - Start date (YYYY-MM-DD)
|
|
1954
|
+
* @param options.endDate - End date (YYYY-MM-DD)
|
|
1955
|
+
*
|
|
1956
|
+
* @example
|
|
1957
|
+
* ```typescript
|
|
1958
|
+
* // Get oil prices
|
|
1959
|
+
* const oil = await client.macro.commodities('oil', {
|
|
1960
|
+
* startDate: '2026-02-01',
|
|
1961
|
+
* endDate: '2026-02-09',
|
|
1962
|
+
* });
|
|
1963
|
+
* console.log(oil); // [{ date: '...', wti_co_sp: 63.77, brent_co_sp: 70.45 }, ...]
|
|
1964
|
+
*
|
|
1965
|
+
* // Get gold prices
|
|
1966
|
+
* const gold = await client.macro.commodities('gold', {
|
|
1967
|
+
* startDate: '2026-02-01',
|
|
1968
|
+
* endDate: '2026-02-09',
|
|
1969
|
+
* });
|
|
1970
|
+
* ```
|
|
1971
|
+
*/
|
|
1972
|
+
async commodities(type, options) {
|
|
1973
|
+
const body = {
|
|
1974
|
+
type,
|
|
1975
|
+
start_date: options.startDate,
|
|
1976
|
+
end_date: options.endDate
|
|
1977
|
+
};
|
|
1978
|
+
const response = await this.client.post("/v1/stock/macro-commodities", body);
|
|
1979
|
+
if (Array.isArray(response)) {
|
|
1980
|
+
return response;
|
|
1981
|
+
}
|
|
1982
|
+
if ("data" in response && response.data && "items" in response.data) {
|
|
1983
|
+
return response.data.items;
|
|
1984
|
+
}
|
|
1985
|
+
return [];
|
|
1986
|
+
}
|
|
1987
|
+
};
|
|
1988
|
+
|
|
1941
1989
|
// src/types.ts
|
|
1942
1990
|
var ReportifyError = class extends Error {
|
|
1943
1991
|
statusCode;
|
|
@@ -1992,6 +2040,7 @@ var Reportify = class {
|
|
|
1992
2040
|
timeline;
|
|
1993
2041
|
user;
|
|
1994
2042
|
following;
|
|
2043
|
+
macro;
|
|
1995
2044
|
constructor(config) {
|
|
1996
2045
|
if (!config.apiKey) {
|
|
1997
2046
|
throw new AuthenticationError("API key is required");
|
|
@@ -2011,6 +2060,7 @@ var Reportify = class {
|
|
|
2011
2060
|
this.timeline = new TimelineModule(this);
|
|
2012
2061
|
this.user = new UserModule(this);
|
|
2013
2062
|
this.following = new FollowingModule(this);
|
|
2063
|
+
this.macro = new MacroModule(this);
|
|
2014
2064
|
}
|
|
2015
2065
|
/**
|
|
2016
2066
|
* Make an HTTP request to the API
|
|
@@ -2127,6 +2177,7 @@ var Reportify = class {
|
|
|
2127
2177
|
DocsModule,
|
|
2128
2178
|
FollowingModule,
|
|
2129
2179
|
KBModule,
|
|
2180
|
+
MacroModule,
|
|
2130
2181
|
NotFoundError,
|
|
2131
2182
|
QuantModule,
|
|
2132
2183
|
RateLimitError,
|
package/dist/index.mjs
CHANGED
|
@@ -1171,11 +1171,13 @@ var AgentModule = class {
|
|
|
1171
1171
|
* @param options - Optional parameters
|
|
1172
1172
|
* @param options.title - Conversation title
|
|
1173
1173
|
* @param options.conversationType - Conversation type: "agent_chat", "task_chat", "debug_chat", "bot_chat"
|
|
1174
|
+
* @param options.meta - Metadata dict (optional)
|
|
1174
1175
|
*/
|
|
1175
1176
|
async createConversation(agentId, options = {}) {
|
|
1176
1177
|
const body = { agent_id: agentId };
|
|
1177
1178
|
if (options.title) body.title = options.title;
|
|
1178
1179
|
if (options.conversationType) body.conversation_type = options.conversationType;
|
|
1180
|
+
if (options.meta) body.meta = options.meta;
|
|
1179
1181
|
const response = await this.client.post("/v1/agent/conversations", body);
|
|
1180
1182
|
return {
|
|
1181
1183
|
id: response.id,
|
|
@@ -1895,6 +1897,51 @@ var FollowingModule = class {
|
|
|
1895
1897
|
}
|
|
1896
1898
|
};
|
|
1897
1899
|
|
|
1900
|
+
// src/macro.ts
|
|
1901
|
+
var MacroModule = class {
|
|
1902
|
+
constructor(client) {
|
|
1903
|
+
this.client = client;
|
|
1904
|
+
}
|
|
1905
|
+
/**
|
|
1906
|
+
* Get commodity price data
|
|
1907
|
+
*
|
|
1908
|
+
* @param type - Commodity type: oil, gold, gas, silver, or platinum
|
|
1909
|
+
* @param options.startDate - Start date (YYYY-MM-DD)
|
|
1910
|
+
* @param options.endDate - End date (YYYY-MM-DD)
|
|
1911
|
+
*
|
|
1912
|
+
* @example
|
|
1913
|
+
* ```typescript
|
|
1914
|
+
* // Get oil prices
|
|
1915
|
+
* const oil = await client.macro.commodities('oil', {
|
|
1916
|
+
* startDate: '2026-02-01',
|
|
1917
|
+
* endDate: '2026-02-09',
|
|
1918
|
+
* });
|
|
1919
|
+
* console.log(oil); // [{ date: '...', wti_co_sp: 63.77, brent_co_sp: 70.45 }, ...]
|
|
1920
|
+
*
|
|
1921
|
+
* // Get gold prices
|
|
1922
|
+
* const gold = await client.macro.commodities('gold', {
|
|
1923
|
+
* startDate: '2026-02-01',
|
|
1924
|
+
* endDate: '2026-02-09',
|
|
1925
|
+
* });
|
|
1926
|
+
* ```
|
|
1927
|
+
*/
|
|
1928
|
+
async commodities(type, options) {
|
|
1929
|
+
const body = {
|
|
1930
|
+
type,
|
|
1931
|
+
start_date: options.startDate,
|
|
1932
|
+
end_date: options.endDate
|
|
1933
|
+
};
|
|
1934
|
+
const response = await this.client.post("/v1/stock/macro-commodities", body);
|
|
1935
|
+
if (Array.isArray(response)) {
|
|
1936
|
+
return response;
|
|
1937
|
+
}
|
|
1938
|
+
if ("data" in response && response.data && "items" in response.data) {
|
|
1939
|
+
return response.data.items;
|
|
1940
|
+
}
|
|
1941
|
+
return [];
|
|
1942
|
+
}
|
|
1943
|
+
};
|
|
1944
|
+
|
|
1898
1945
|
// src/types.ts
|
|
1899
1946
|
var ReportifyError = class extends Error {
|
|
1900
1947
|
statusCode;
|
|
@@ -1949,6 +1996,7 @@ var Reportify = class {
|
|
|
1949
1996
|
timeline;
|
|
1950
1997
|
user;
|
|
1951
1998
|
following;
|
|
1999
|
+
macro;
|
|
1952
2000
|
constructor(config) {
|
|
1953
2001
|
if (!config.apiKey) {
|
|
1954
2002
|
throw new AuthenticationError("API key is required");
|
|
@@ -1968,6 +2016,7 @@ var Reportify = class {
|
|
|
1968
2016
|
this.timeline = new TimelineModule(this);
|
|
1969
2017
|
this.user = new UserModule(this);
|
|
1970
2018
|
this.following = new FollowingModule(this);
|
|
2019
|
+
this.macro = new MacroModule(this);
|
|
1971
2020
|
}
|
|
1972
2021
|
/**
|
|
1973
2022
|
* Make an HTTP request to the API
|
|
@@ -2083,6 +2132,7 @@ export {
|
|
|
2083
2132
|
DocsModule,
|
|
2084
2133
|
FollowingModule,
|
|
2085
2134
|
KBModule,
|
|
2135
|
+
MacroModule,
|
|
2086
2136
|
NotFoundError,
|
|
2087
2137
|
QuantModule,
|
|
2088
2138
|
RateLimitError,
|