reportify-sdk 0.3.21 → 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 CHANGED
@@ -1811,6 +1811,62 @@ declare class FollowingModule {
1811
1811
  }>;
1812
1812
  }
1813
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
+
1814
1870
  /**
1815
1871
  * Reportify Client
1816
1872
  *
@@ -1847,6 +1903,7 @@ declare class Reportify {
1847
1903
  readonly timeline: TimelineModule;
1848
1904
  readonly user: UserModule;
1849
1905
  readonly following: FollowingModule;
1906
+ readonly macro: MacroModule;
1850
1907
  constructor(config: ReportifyConfig);
1851
1908
  /**
1852
1909
  * Make an HTTP request to the API
@@ -1877,4 +1934,4 @@ declare class Reportify {
1877
1934
  getBytes(path: string): Promise<ArrayBuffer>;
1878
1935
  }
1879
1936
 
1880
- 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
@@ -1811,6 +1811,62 @@ declare class FollowingModule {
1811
1811
  }>;
1812
1812
  }
1813
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
+
1814
1870
  /**
1815
1871
  * Reportify Client
1816
1872
  *
@@ -1847,6 +1903,7 @@ declare class Reportify {
1847
1903
  readonly timeline: TimelineModule;
1848
1904
  readonly user: UserModule;
1849
1905
  readonly following: FollowingModule;
1906
+ readonly macro: MacroModule;
1850
1907
  constructor(config: ReportifyConfig);
1851
1908
  /**
1852
1909
  * Make an HTTP request to the API
@@ -1877,4 +1934,4 @@ declare class Reportify {
1877
1934
  getBytes(path: string): Promise<ArrayBuffer>;
1878
1935
  }
1879
1936
 
1880
- 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,
@@ -1940,6 +1941,51 @@ var FollowingModule = class {
1940
1941
  }
1941
1942
  };
1942
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
+
1943
1989
  // src/types.ts
1944
1990
  var ReportifyError = class extends Error {
1945
1991
  statusCode;
@@ -1994,6 +2040,7 @@ var Reportify = class {
1994
2040
  timeline;
1995
2041
  user;
1996
2042
  following;
2043
+ macro;
1997
2044
  constructor(config) {
1998
2045
  if (!config.apiKey) {
1999
2046
  throw new AuthenticationError("API key is required");
@@ -2013,6 +2060,7 @@ var Reportify = class {
2013
2060
  this.timeline = new TimelineModule(this);
2014
2061
  this.user = new UserModule(this);
2015
2062
  this.following = new FollowingModule(this);
2063
+ this.macro = new MacroModule(this);
2016
2064
  }
2017
2065
  /**
2018
2066
  * Make an HTTP request to the API
@@ -2129,6 +2177,7 @@ var Reportify = class {
2129
2177
  DocsModule,
2130
2178
  FollowingModule,
2131
2179
  KBModule,
2180
+ MacroModule,
2132
2181
  NotFoundError,
2133
2182
  QuantModule,
2134
2183
  RateLimitError,
package/dist/index.mjs CHANGED
@@ -1897,6 +1897,51 @@ var FollowingModule = class {
1897
1897
  }
1898
1898
  };
1899
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
+
1900
1945
  // src/types.ts
1901
1946
  var ReportifyError = class extends Error {
1902
1947
  statusCode;
@@ -1951,6 +1996,7 @@ var Reportify = class {
1951
1996
  timeline;
1952
1997
  user;
1953
1998
  following;
1999
+ macro;
1954
2000
  constructor(config) {
1955
2001
  if (!config.apiKey) {
1956
2002
  throw new AuthenticationError("API key is required");
@@ -1970,6 +2016,7 @@ var Reportify = class {
1970
2016
  this.timeline = new TimelineModule(this);
1971
2017
  this.user = new UserModule(this);
1972
2018
  this.following = new FollowingModule(this);
2019
+ this.macro = new MacroModule(this);
1973
2020
  }
1974
2021
  /**
1975
2022
  * Make an HTTP request to the API
@@ -2085,6 +2132,7 @@ export {
2085
2132
  DocsModule,
2086
2133
  FollowingModule,
2087
2134
  KBModule,
2135
+ MacroModule,
2088
2136
  NotFoundError,
2089
2137
  QuantModule,
2090
2138
  RateLimitError,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "reportify-sdk",
3
- "version": "0.3.21",
3
+ "version": "0.3.22",
4
4
  "description": "TypeScript SDK for Reportify API - Financial data and document search",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",