fmp-node-api 0.1.1 → 0.1.3

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/README.md CHANGED
@@ -407,7 +407,7 @@ try {
407
407
 
408
408
  ## Type Safety
409
409
 
410
- The library provides full TypeScript support with comprehensive type definitions:
410
+ The library provides full TypeScript support with comprehensive type definitions included in the main package:
411
411
 
412
412
  ```typescript
413
413
  import { Quote, MarketCap, IncomeStatement } from 'fmp-node-api';
@@ -420,6 +420,8 @@ const income: APIResponse<IncomeStatement[]> = await fmp.financial.getIncomeStat
420
420
  });
421
421
  ```
422
422
 
423
+ All API responses and parameters are fully typed for complete type safety.
424
+
423
425
  ## Utilities
424
426
 
425
427
  The library includes helpful utilities for data formatting and validation:
@@ -582,23 +584,6 @@ src/
582
584
  ├── fmp.ts # Main FMP class
583
585
  ├── index.ts # Main exports
584
586
  ├── shared.ts # Shared types and utilities
585
- ├── types/ # Type definitions
586
- │ ├── index.ts
587
- │ ├── common.ts # Common types
588
- │ ├── stock.ts # Stock types
589
- │ ├── financial.ts # Financial types
590
- │ ├── quote.ts # Quote types
591
- │ ├── etf.ts # ETF types
592
- │ ├── mutual-fund.ts # Mutual fund types
593
- │ ├── economic.ts # Economic types
594
- │ ├── market.ts # Market types
595
- │ ├── list.ts # List types
596
- │ ├── calendar.ts # Calendar types
597
- │ ├── company.ts # Company types
598
- │ ├── senate-house.ts # Senate house types
599
- │ ├── institutional.ts # Institutional types
600
- │ ├── insider.ts # Insider types
601
- │ └── sec.ts # SEC types
602
587
  ├── endpoints/ # API endpoint classes
603
588
  │ ├── index.ts
604
589
  │ ├── stock.ts
@@ -635,10 +620,6 @@ src/
635
620
  │ │ ├── list.test.ts
636
621
  │ │ ├── calendar.test.ts
637
622
  │ │ └── company.test.ts
638
- │ ├── types/ # Type definition tests
639
- │ │ ├── common.test.ts
640
- │ │ ├── stock.test.ts
641
- │ │ └── financial.test.ts
642
623
  │ └── utils/ # Test utilities
643
624
  │ ├── formatting.test.ts
644
625
  │ ├── validation.test.ts
package/dist/index.d.mts CHANGED
@@ -1,7 +1,5 @@
1
- import { F as FMPConfig, A as APIResponse } from './common-COsxpVBY.mjs';
2
- export { P as PeriodParams, S as SymbolParams } from './common-COsxpVBY.mjs';
3
- import { M as MarketCap, S as StockSplitResponse, a as StockDividendResponse, b as StockRealTimePrice, c as StockRealTimePriceFull, I as IncomeStatement, B as BalanceSheet, C as CashFlowStatement, K as KeyMetrics, F as FinancialRatios, E as EnterpriseValue, d as CashflowGrowth, e as IncomeGrowth, f as BalanceSheetGrowth, g as FinancialGrowth, h as EarningsHistorical, i as EarningsSurprises, j as ETFHoldingDates, k as ETFHolding, l as ETFHolder, m as ETFProfile, n as ETFWeighting, o as ETFCountryWeighting, p as ETFStockExposure, T as TreasuryRate, q as EconomicIndicator, r as MarketHours, s as MarketPerformance, t as MarketSectorPerformance, u as MarketIndex, v as StockList, w as ETFList, x as CryptoList, y as ForexList, A as AvailableIndexesList, z as EarningsCalendar, D as EarningsConfirmed, G as DividendsCalendar, H as EconomicsCalendar, J as IPOCalendar, L as SplitsCalendar, N as CompanyProfile, O as ExecutiveCompensation, P as CompanyNotes, Q as HistoricalEmployeeCount, R as SharesFloat, U as HistoricalSharesFloat, V as EarningsCallTranscript, W as CompanyTranscriptData, X as Quote, Y as HistoricalPriceResponse, Z as HistoricalPriceData, _ as SenateTradingResponse, $ as SenateHouseTradingByNameResponse, a0 as HouseTradingResponse, a1 as Form13FResponse, a2 as InstitutionalHolderResponse, a3 as InsiderTradingRSSResponse, a4 as InsiderTradingSearchResponse, a5 as TransactionTypesResponse, a6 as InsidersBySymbolResponse, a7 as InsiderTradeStatisticsResponse, a8 as CikMapperResponse, a9 as CikMapperBySymbolResponse, aa as BeneficialOwnershipResponse, ab as FailToDeliverResponse, ac as TransactionType, ad as RSSFeedItem, ae as RSSFeedAllItem, af as RSSFeedV3Item, ag as RSSFeed8KItem, ah as SECFiling, ai as IndustryClassification, aj as IndustryClassificationCode } from './types-only-v3B1TqXe.mjs';
4
- export { al as StockDividend, ak as StockSplit } from './types-only-v3B1TqXe.mjs';
1
+ import { FMPConfig, APIResponse, MarketCap, StockSplitResponse, StockDividendResponse, StockRealTimePrice, StockRealTimePriceFull, IncomeStatement, BalanceSheet, CashFlowStatement, KeyMetrics, FinancialRatios, EnterpriseValue, CashflowGrowth, IncomeGrowth, BalanceSheetGrowth, FinancialGrowth, EarningsHistorical, EarningsSurprises, ETFHoldingDates, ETFHolding, ETFHolder, ETFProfile, ETFWeighting, ETFCountryWeighting, ETFStockExposure, TreasuryRate, EconomicIndicator, MarketHours, MarketPerformance, MarketSectorPerformance, MarketIndex, StockList, ETFList, CryptoList, ForexList, AvailableIndexesList, EarningsCalendar, EarningsConfirmed, DividendsCalendar, EconomicsCalendar, IPOCalendar, SplitsCalendar, CompanyProfile, ExecutiveCompensation, CompanyNotes, HistoricalEmployeeCount, SharesFloat, HistoricalSharesFloat, EarningsCallTranscript, CompanyTranscriptData, Quote, HistoricalPriceResponse, HistoricalPriceData, SenateTradingResponse, SenateHouseTradingByNameResponse, HouseTradingResponse, Form13FResponse, InstitutionalHolderResponse, InsiderTradingRSSResponse, InsiderTradingSearchResponse, TransactionTypesResponse, InsidersBySymbolResponse, InsiderTradeStatisticsResponse, CikMapperResponse, CikMapperBySymbolResponse, BeneficialOwnershipResponse, FailToDeliverResponse, TransactionType, RSSFeedItem, RSSFeedAllItem, RSSFeedV3Item, RSSFeed8KItem, SECFiling, IndustryClassification, IndustryClassificationCode, MutualFundHolding } from '@fmp/types';
2
+ export * from '@fmp/types';
5
3
  export { FMPValidation } from './utils/validation.mjs';
6
4
 
7
5
  declare class FMPClient {
@@ -196,7 +194,7 @@ declare class FinancialEndpoints {
196
194
  * const quarterlyIncome = await fmp.financial.getIncomeStatement({ symbol: 'MSFT', period: 'quarter', limit: 8 });
197
195
  * ```
198
196
  *
199
- * @see {@link https://site.financialmodelingprep.com/developer/docs#income-statements-financial-statements|FMP Income Statement Documentation}
197
+ * @see {@link https://site.financialmodelingprep.com/developer/docs/stable#income-statement|FMP Income Statement Documentation}
200
198
  */
201
199
  getIncomeStatement(params: {
202
200
  symbol: string;
@@ -229,7 +227,7 @@ declare class FinancialEndpoints {
229
227
  * const quarterlyBalance = await fmp.financial.getBalanceSheet({ symbol: 'MSFT', period: 'quarter', limit: 8 });
230
228
  * ```
231
229
  *
232
- * @see {@link https://site.financialmodelingprep.com/developer/docs#balance-sheet-statements-financial-statements|FMP Balance Sheet Documentation}
230
+ * @see {@link https://site.financialmodelingprep.com/developer/docs/stable#balance-sheet-statement|FMP Balance Sheet Documentation}
233
231
  */
234
232
  getBalanceSheet(params: {
235
233
  symbol: string;
@@ -262,7 +260,7 @@ declare class FinancialEndpoints {
262
260
  * const quarterlyCashFlow = await fmp.financial.getCashFlowStatement({ symbol: 'MSFT', period: 'quarter', limit: 8 });
263
261
  * ```
264
262
  *
265
- * @see {@link https://site.financialmodelingprep.com/developer/docs#cashflow-statements-financial-statements|FMP Cash Flow Statement Documentation}
263
+ * @see {@link https://site.financialmodelingprep.com/developer/docs/stable#cashflow-statement|FMP Cash Flow Statement Documentation}
266
264
  */
267
265
  getCashFlowStatement(params: {
268
266
  symbol: string;
@@ -295,7 +293,7 @@ declare class FinancialEndpoints {
295
293
  * const quarterlyMetrics = await fmp.financial.getKeyMetrics({ symbol: 'MSFT', period: 'quarter', limit: 8 });
296
294
  * ```
297
295
  *
298
- * @see {@link https://site.financialmodelingprep.com/developer/docs#key-metrics-statement-analysis|FMP Key Metrics Documentation}
296
+ * @see {@link https://site.financialmodelingprep.com/developer/docs/stable#key-metrics|FMP Key Metrics Documentation}
299
297
  */
300
298
  getKeyMetrics(params: {
301
299
  symbol: string;
@@ -328,7 +326,7 @@ declare class FinancialEndpoints {
328
326
  * const quarterlyRatios = await fmp.financial.getFinancialRatios({ symbol: 'MSFT', period: 'quarter', limit: 8 });
329
327
  * ```
330
328
  *
331
- * @see {@link https://site.financialmodelingprep.com/developer/docs#ratios-statement-analysis|FMP Financial Ratios Documentation}
329
+ * @see {@link https://site.financialmodelingprep.com/developer/docs/stable#metrics-ratios|FMP Financial Ratios Documentation}
332
330
  */
333
331
  getFinancialRatios(params: {
334
332
  symbol: string;
@@ -361,7 +359,7 @@ declare class FinancialEndpoints {
361
359
  * const quarterlyEV = await fmp.financial.getEnterpriseValue({ symbol: 'MSFT', period: 'quarter', limit: 8 });
362
360
  * ```
363
361
  *
364
- * @see {@link https://site.financialmodelingprep.com/developer/docs#enterprise-values-statement-analysis|FMP Enterprise Value Documentation}
362
+ * @see {@link https://site.financialmodelingprep.com/developer/docs/stable#enterprise-values|FMP Enterprise Value Documentation}
365
363
  */
366
364
  getEnterpriseValue(params: {
367
365
  symbol: string;
@@ -394,7 +392,7 @@ declare class FinancialEndpoints {
394
392
  * const quarterlyGrowth = await fmp.financial.getCashflowGrowth({ symbol: 'MSFT', period: 'quarter', limit: 8 });
395
393
  * ```
396
394
  *
397
- * @see {@link https://site.financialmodelingprep.com/developer/docs#cashflow-growth-statement-analysis|FMP Cash Flow Growth Documentation}
395
+ * @see {@link https://site.financialmodelingprep.com/developer/docs/stable#cashflow-statement-growth|FMP Cash Flow Growth Documentation}
398
396
  */
399
397
  getCashflowGrowth(params: {
400
398
  symbol: string;
@@ -427,7 +425,7 @@ declare class FinancialEndpoints {
427
425
  * const quarterlyGrowth = await fmp.financial.getIncomeGrowth({ symbol: 'MSFT', period: 'quarter', limit: 8 });
428
426
  * ```
429
427
  *
430
- * @see {@link https://site.financialmodelingprep.com/developer/docs#income-growth-statement-analysis|FMP Income Growth Documentation}
428
+ * @see {@link https://site.financialmodelingprep.com/developer/docs/stable#income-statement-growth|FMP Income Growth Documentation}
431
429
  */
432
430
  getIncomeGrowth(params: {
433
431
  symbol: string;
@@ -460,7 +458,7 @@ declare class FinancialEndpoints {
460
458
  * const quarterlyGrowth = await fmp.financial.getBalanceSheetGrowth({ symbol: 'MSFT', period: 'quarter', limit: 8 });
461
459
  * ```
462
460
  *
463
- * @see {@link https://site.financialmodelingprep.com/developer/docs#balance-sheet-growth-statement-analysis|FMP Balance Sheet Growth Documentation}
461
+ * @see {@link https://site.financialmodelingprep.com/developer/docs/stable#balance-sheet-statement-growth|FMP Balance Sheet Growth Documentation}
464
462
  */
465
463
  getBalanceSheetGrowth(params: {
466
464
  symbol: string;
@@ -493,7 +491,7 @@ declare class FinancialEndpoints {
493
491
  * const quarterlyGrowth = await fmp.financial.getFinancialGrowth({ symbol: 'MSFT', period: 'quarter', limit: 8 });
494
492
  * ```
495
493
  *
496
- * @see {@link https://site.financialmodelingprep.com/developer/docs#financial-growth-statement-analysis|FMP Financial Growth Documentation}
494
+ * @see {@link https://site.financialmodelingprep.com/developer/docs/stable#financial-statement-growth|FMP Financial Growth Documentation}
497
495
  */
498
496
  getFinancialGrowth(params: {
499
497
  symbol: string;
@@ -525,7 +523,7 @@ declare class FinancialEndpoints {
525
523
  * const msftEarnings = await fmp.financial.getEarningsHistorical({ symbol: 'MSFT', limit: 8 });
526
524
  * ```
527
525
  *
528
- * @see {@link https://site.financialmodelingprep.com/developer/docs#earnings-historical-earnings|FMP Earnings Historical Documentation}
526
+ * @see {@link https://site.financialmodelingprep.com/developer/docs/stable#earnings-company|FMP Earnings Historical Documentation}
529
527
  */
530
528
  getEarningsHistorical(params: {
531
529
  symbol: string;
@@ -667,7 +665,7 @@ declare class ETFEndpoints {
667
665
  * const vooProfile = await fmp.etf.getProfile('VOO');
668
666
  * ```
669
667
  *
670
- * @see {@link https://site.financialmodelingprep.com/developer/docs#etf-information-etf-holdings|FMP ETF Information Documentation}
668
+ * @see {@link https://site.financialmodelingprep.com/developer/docs/stable#information|FMP ETF Information Documentation}
671
669
  */
672
670
  getProfile(symbol: string): Promise<APIResponse<ETFProfile>>;
673
671
  /**
@@ -693,7 +691,7 @@ declare class ETFEndpoints {
693
691
  * const qqqSectors = await fmp.etf.getSectorWeighting('QQQ');
694
692
  * ```
695
693
  *
696
- * @see {@link https://site.financialmodelingprep.com/developer/docs#etf-sector-weighting-etf-holdings|FMP ETF Sector Weighting Documentation}
694
+ * @see {@link https://site.financialmodelingprep.com/developer/docs/stable#sector-weighting|FMP ETF Sector Weighting Documentation}
697
695
  */
698
696
  getSectorWeighting(symbol: string): Promise<APIResponse<ETFWeighting[]>>;
699
697
  /**
@@ -719,7 +717,7 @@ declare class ETFEndpoints {
719
717
  * const efaCountries = await fmp.etf.getCountryWeighting('EFA');
720
718
  * ```
721
719
  *
722
- * @see {@link https://site.financialmodelingprep.com/developer/docs#etf-country-weighting-etf-holdings|FMP ETF Country Weighting Documentation}
720
+ * @see {@link https://site.financialmodelingprep.com/developer/docs/stable#country-weighting|FMP ETF Country Weighting Documentation}
723
721
  */
724
722
  getCountryWeighting(symbol: string): Promise<APIResponse<ETFCountryWeighting[]>>;
725
723
  /**
@@ -784,7 +782,7 @@ declare class EconomicEndpoints {
784
782
  * });
785
783
  * ```
786
784
  *
787
- * @see {@link https://site.financialmodelingprep.com/developer/docs#treasury-rates-economics-data|FMP Treasury Rates Documentation}
785
+ * @see {@link https://site.financialmodelingprep.com/developer/docs/stable#treasury-rates|FMP Treasury Rates Documentation}
788
786
  */
789
787
  getTreasuryRates(params: {
790
788
  from?: string;
@@ -900,7 +898,7 @@ declare class MarketEndpoints {
900
898
  * console.log(`Gaining indices: ${gainers.length}, Losing indices: ${losers.length}`);
901
899
  * ```
902
900
  *
903
- * @see {@link https://site.financialmodelingprep.com/developer/docs#market-performance|FMP Market Performance Documentation}
901
+ * @see {@link https://site.financialmodelingprep.com/developer/docs#market-index-market-overview|FMP Market Performance Documentation}
904
902
  */
905
903
  getMarketPerformance(): Promise<APIResponse<MarketPerformance[]>>;
906
904
  /**
@@ -1297,8 +1295,8 @@ declare class ListEndpoints {
1297
1295
  }
1298
1296
 
1299
1297
  declare class CalendarEndpoints {
1300
- private client;
1301
- constructor(client: FMPClient);
1298
+ private _client;
1299
+ constructor(_client: FMPClient);
1302
1300
  /**
1303
1301
  * Get earnings calendar data
1304
1302
  *
@@ -1550,7 +1548,7 @@ declare class CompanyEndpoints {
1550
1548
  * const msftProfile = await fmp.company.getCompanyProfile('MSFT');
1551
1549
  * ```
1552
1550
  *
1553
- * @see {@link https://site.financialmodelingprep.com/developer/docs#company-profile-company-information|FMP Company Profile Documentation}
1551
+ * @see {@link https://site.financialmodelingprep.com/developer/docs/stable#profile-symbol|FMP Company Profile Documentation}
1554
1552
  */
1555
1553
  getCompanyProfile(symbol: string): Promise<APIResponse<CompanyProfile>>;
1556
1554
  /**
@@ -1579,7 +1577,7 @@ declare class CompanyEndpoints {
1579
1577
  * const teslaComp = await fmp.company.getExecutiveCompensation('TSLA');
1580
1578
  * ```
1581
1579
  *
1582
- * @see {@link https://site.financialmodelingprep.com/developer/docs#executive-compensation-company-information|FMP Executive Compensation Documentation}
1580
+ * @see {@link https://site.financialmodelingprep.com/developer/docs/stable#executive-compensation|FMP Executive Compensation Documentation}
1583
1581
  */
1584
1582
  getExecutiveCompensation(symbol: string): Promise<APIResponse<ExecutiveCompensation[]>>;
1585
1583
  /**
@@ -1606,7 +1604,7 @@ declare class CompanyEndpoints {
1606
1604
  * const jpmNotes = await fmp.company.getCompanyNotes('JPM');
1607
1605
  * ```
1608
1606
  *
1609
- * @see {@link https://site.financialmodelingprep.com/developer/docs#company-notes-company-information|FMP Company Notes Documentation}
1607
+ * @see {@link https://site.financialmodelingprep.com/developer/docs/stable#company-notes|FMP Company Notes Documentation}
1610
1608
  */
1611
1609
  getCompanyNotes(symbol: string): Promise<APIResponse<CompanyNotes[]>>;
1612
1610
  /**
@@ -1632,7 +1630,7 @@ declare class CompanyEndpoints {
1632
1630
  * const amazonEmployees = await fmp.company.getHistoricalEmployeeCount('AMZN');
1633
1631
  * ```
1634
1632
  *
1635
- * @see {@link https://site.financialmodelingprep.com/developer/docs#historical-employee-company-information|FMP Historical Employee Count Documentation}
1633
+ * @see {@link https://site.financialmodelingprep.com/developer/docs/stable#historical-employee-count|FMP Historical Employee Count Documentation}
1636
1634
  */
1637
1635
  getHistoricalEmployeeCount(symbol: string): Promise<APIResponse<HistoricalEmployeeCount[]>>;
1638
1636
  /**
@@ -1658,7 +1656,7 @@ declare class CompanyEndpoints {
1658
1656
  * const teslaFloat = await fmp.company.getSharesFloat('TSLA');
1659
1657
  * ```
1660
1658
  *
1661
- * @see {@link https://site.financialmodelingprep.com/developer/docs#company-share-float-share-float|FMP Shares Float Documentation}
1659
+ * @see {@link https://site.financialmodelingprep.com/developer/docs/stable#shares-float|FMP Shares Float Documentation}
1662
1660
  */
1663
1661
  getSharesFloat(symbol: string): Promise<APIResponse<SharesFloat>>;
1664
1662
  /**
@@ -1725,7 +1723,7 @@ declare class CompanyEndpoints {
1725
1723
  symbol: string;
1726
1724
  year: number;
1727
1725
  quarter: number;
1728
- }): Promise<APIResponse<EarningsCallTranscript[]>>;
1726
+ }): Promise<APIResponse<EarningsCallTranscript>>;
1729
1727
  /**
1730
1728
  * Get available earnings call transcript dates
1731
1729
  *
@@ -2828,14 +2826,6 @@ declare class SECEndpoints {
2828
2826
  }): Promise<APIResponse<IndustryClassificationCode[]>>;
2829
2827
  }
2830
2828
 
2831
- interface MutualFundHolding {
2832
- holder: string;
2833
- shares: number;
2834
- dateReported: string;
2835
- change: number;
2836
- weightPercent: number;
2837
- }
2838
-
2839
2829
  declare class MutualFundEndpoints {
2840
2830
  private client;
2841
2831
  constructor(client: FMPClient);
@@ -2996,4 +2986,4 @@ declare const SECTORS: {
2996
2986
  readonly COMMUNICATION_SERVICES: "Communication Services";
2997
2987
  };
2998
2988
 
2999
- export { APIResponse, CalendarEndpoints, CompanyEndpoints, DEFAULT_LIMIT, DEFAULT_TIMEOUT, ETFEndpoints, EXCHANGES, EconomicEndpoints, FMP, FMPClient, FinancialEndpoints, InsiderEndpoints, InstitutionalEndpoints, ListEndpoints, MAX_LIMIT, MarketCap, MarketEndpoints, MutualFundEndpoints, PERIODS, Quote, QuoteEndpoints, SECEndpoints, SECTORS, SenateHouseEndpoints, StockEndpoints, StockRealTimePrice, formatCurrency, formatDate, formatLargeNumber, formatPercentage, formatVolume };
2989
+ export { CalendarEndpoints, CompanyEndpoints, DEFAULT_LIMIT, DEFAULT_TIMEOUT, ETFEndpoints, EXCHANGES, EconomicEndpoints, FMP, FMPClient, FinancialEndpoints, InsiderEndpoints, InstitutionalEndpoints, ListEndpoints, MAX_LIMIT, MarketEndpoints, MutualFundEndpoints, PERIODS, QuoteEndpoints, SECEndpoints, SECTORS, SenateHouseEndpoints, StockEndpoints, formatCurrency, formatDate, formatLargeNumber, formatPercentage, formatVolume };
package/dist/index.d.ts CHANGED
@@ -1,7 +1,5 @@
1
- import { F as FMPConfig, A as APIResponse } from './common-COsxpVBY.js';
2
- export { P as PeriodParams, S as SymbolParams } from './common-COsxpVBY.js';
3
- import { M as MarketCap, S as StockSplitResponse, a as StockDividendResponse, b as StockRealTimePrice, c as StockRealTimePriceFull, I as IncomeStatement, B as BalanceSheet, C as CashFlowStatement, K as KeyMetrics, F as FinancialRatios, E as EnterpriseValue, d as CashflowGrowth, e as IncomeGrowth, f as BalanceSheetGrowth, g as FinancialGrowth, h as EarningsHistorical, i as EarningsSurprises, j as ETFHoldingDates, k as ETFHolding, l as ETFHolder, m as ETFProfile, n as ETFWeighting, o as ETFCountryWeighting, p as ETFStockExposure, T as TreasuryRate, q as EconomicIndicator, r as MarketHours, s as MarketPerformance, t as MarketSectorPerformance, u as MarketIndex, v as StockList, w as ETFList, x as CryptoList, y as ForexList, A as AvailableIndexesList, z as EarningsCalendar, D as EarningsConfirmed, G as DividendsCalendar, H as EconomicsCalendar, J as IPOCalendar, L as SplitsCalendar, N as CompanyProfile, O as ExecutiveCompensation, P as CompanyNotes, Q as HistoricalEmployeeCount, R as SharesFloat, U as HistoricalSharesFloat, V as EarningsCallTranscript, W as CompanyTranscriptData, X as Quote, Y as HistoricalPriceResponse, Z as HistoricalPriceData, _ as SenateTradingResponse, $ as SenateHouseTradingByNameResponse, a0 as HouseTradingResponse, a1 as Form13FResponse, a2 as InstitutionalHolderResponse, a3 as InsiderTradingRSSResponse, a4 as InsiderTradingSearchResponse, a5 as TransactionTypesResponse, a6 as InsidersBySymbolResponse, a7 as InsiderTradeStatisticsResponse, a8 as CikMapperResponse, a9 as CikMapperBySymbolResponse, aa as BeneficialOwnershipResponse, ab as FailToDeliverResponse, ac as TransactionType, ad as RSSFeedItem, ae as RSSFeedAllItem, af as RSSFeedV3Item, ag as RSSFeed8KItem, ah as SECFiling, ai as IndustryClassification, aj as IndustryClassificationCode } from './types-only-DjnrpNZm.js';
4
- export { al as StockDividend, ak as StockSplit } from './types-only-DjnrpNZm.js';
1
+ import { FMPConfig, APIResponse, MarketCap, StockSplitResponse, StockDividendResponse, StockRealTimePrice, StockRealTimePriceFull, IncomeStatement, BalanceSheet, CashFlowStatement, KeyMetrics, FinancialRatios, EnterpriseValue, CashflowGrowth, IncomeGrowth, BalanceSheetGrowth, FinancialGrowth, EarningsHistorical, EarningsSurprises, ETFHoldingDates, ETFHolding, ETFHolder, ETFProfile, ETFWeighting, ETFCountryWeighting, ETFStockExposure, TreasuryRate, EconomicIndicator, MarketHours, MarketPerformance, MarketSectorPerformance, MarketIndex, StockList, ETFList, CryptoList, ForexList, AvailableIndexesList, EarningsCalendar, EarningsConfirmed, DividendsCalendar, EconomicsCalendar, IPOCalendar, SplitsCalendar, CompanyProfile, ExecutiveCompensation, CompanyNotes, HistoricalEmployeeCount, SharesFloat, HistoricalSharesFloat, EarningsCallTranscript, CompanyTranscriptData, Quote, HistoricalPriceResponse, HistoricalPriceData, SenateTradingResponse, SenateHouseTradingByNameResponse, HouseTradingResponse, Form13FResponse, InstitutionalHolderResponse, InsiderTradingRSSResponse, InsiderTradingSearchResponse, TransactionTypesResponse, InsidersBySymbolResponse, InsiderTradeStatisticsResponse, CikMapperResponse, CikMapperBySymbolResponse, BeneficialOwnershipResponse, FailToDeliverResponse, TransactionType, RSSFeedItem, RSSFeedAllItem, RSSFeedV3Item, RSSFeed8KItem, SECFiling, IndustryClassification, IndustryClassificationCode, MutualFundHolding } from '@fmp/types';
2
+ export * from '@fmp/types';
5
3
  export { FMPValidation } from './utils/validation.js';
6
4
 
7
5
  declare class FMPClient {
@@ -196,7 +194,7 @@ declare class FinancialEndpoints {
196
194
  * const quarterlyIncome = await fmp.financial.getIncomeStatement({ symbol: 'MSFT', period: 'quarter', limit: 8 });
197
195
  * ```
198
196
  *
199
- * @see {@link https://site.financialmodelingprep.com/developer/docs#income-statements-financial-statements|FMP Income Statement Documentation}
197
+ * @see {@link https://site.financialmodelingprep.com/developer/docs/stable#income-statement|FMP Income Statement Documentation}
200
198
  */
201
199
  getIncomeStatement(params: {
202
200
  symbol: string;
@@ -229,7 +227,7 @@ declare class FinancialEndpoints {
229
227
  * const quarterlyBalance = await fmp.financial.getBalanceSheet({ symbol: 'MSFT', period: 'quarter', limit: 8 });
230
228
  * ```
231
229
  *
232
- * @see {@link https://site.financialmodelingprep.com/developer/docs#balance-sheet-statements-financial-statements|FMP Balance Sheet Documentation}
230
+ * @see {@link https://site.financialmodelingprep.com/developer/docs/stable#balance-sheet-statement|FMP Balance Sheet Documentation}
233
231
  */
234
232
  getBalanceSheet(params: {
235
233
  symbol: string;
@@ -262,7 +260,7 @@ declare class FinancialEndpoints {
262
260
  * const quarterlyCashFlow = await fmp.financial.getCashFlowStatement({ symbol: 'MSFT', period: 'quarter', limit: 8 });
263
261
  * ```
264
262
  *
265
- * @see {@link https://site.financialmodelingprep.com/developer/docs#cashflow-statements-financial-statements|FMP Cash Flow Statement Documentation}
263
+ * @see {@link https://site.financialmodelingprep.com/developer/docs/stable#cashflow-statement|FMP Cash Flow Statement Documentation}
266
264
  */
267
265
  getCashFlowStatement(params: {
268
266
  symbol: string;
@@ -295,7 +293,7 @@ declare class FinancialEndpoints {
295
293
  * const quarterlyMetrics = await fmp.financial.getKeyMetrics({ symbol: 'MSFT', period: 'quarter', limit: 8 });
296
294
  * ```
297
295
  *
298
- * @see {@link https://site.financialmodelingprep.com/developer/docs#key-metrics-statement-analysis|FMP Key Metrics Documentation}
296
+ * @see {@link https://site.financialmodelingprep.com/developer/docs/stable#key-metrics|FMP Key Metrics Documentation}
299
297
  */
300
298
  getKeyMetrics(params: {
301
299
  symbol: string;
@@ -328,7 +326,7 @@ declare class FinancialEndpoints {
328
326
  * const quarterlyRatios = await fmp.financial.getFinancialRatios({ symbol: 'MSFT', period: 'quarter', limit: 8 });
329
327
  * ```
330
328
  *
331
- * @see {@link https://site.financialmodelingprep.com/developer/docs#ratios-statement-analysis|FMP Financial Ratios Documentation}
329
+ * @see {@link https://site.financialmodelingprep.com/developer/docs/stable#metrics-ratios|FMP Financial Ratios Documentation}
332
330
  */
333
331
  getFinancialRatios(params: {
334
332
  symbol: string;
@@ -361,7 +359,7 @@ declare class FinancialEndpoints {
361
359
  * const quarterlyEV = await fmp.financial.getEnterpriseValue({ symbol: 'MSFT', period: 'quarter', limit: 8 });
362
360
  * ```
363
361
  *
364
- * @see {@link https://site.financialmodelingprep.com/developer/docs#enterprise-values-statement-analysis|FMP Enterprise Value Documentation}
362
+ * @see {@link https://site.financialmodelingprep.com/developer/docs/stable#enterprise-values|FMP Enterprise Value Documentation}
365
363
  */
366
364
  getEnterpriseValue(params: {
367
365
  symbol: string;
@@ -394,7 +392,7 @@ declare class FinancialEndpoints {
394
392
  * const quarterlyGrowth = await fmp.financial.getCashflowGrowth({ symbol: 'MSFT', period: 'quarter', limit: 8 });
395
393
  * ```
396
394
  *
397
- * @see {@link https://site.financialmodelingprep.com/developer/docs#cashflow-growth-statement-analysis|FMP Cash Flow Growth Documentation}
395
+ * @see {@link https://site.financialmodelingprep.com/developer/docs/stable#cashflow-statement-growth|FMP Cash Flow Growth Documentation}
398
396
  */
399
397
  getCashflowGrowth(params: {
400
398
  symbol: string;
@@ -427,7 +425,7 @@ declare class FinancialEndpoints {
427
425
  * const quarterlyGrowth = await fmp.financial.getIncomeGrowth({ symbol: 'MSFT', period: 'quarter', limit: 8 });
428
426
  * ```
429
427
  *
430
- * @see {@link https://site.financialmodelingprep.com/developer/docs#income-growth-statement-analysis|FMP Income Growth Documentation}
428
+ * @see {@link https://site.financialmodelingprep.com/developer/docs/stable#income-statement-growth|FMP Income Growth Documentation}
431
429
  */
432
430
  getIncomeGrowth(params: {
433
431
  symbol: string;
@@ -460,7 +458,7 @@ declare class FinancialEndpoints {
460
458
  * const quarterlyGrowth = await fmp.financial.getBalanceSheetGrowth({ symbol: 'MSFT', period: 'quarter', limit: 8 });
461
459
  * ```
462
460
  *
463
- * @see {@link https://site.financialmodelingprep.com/developer/docs#balance-sheet-growth-statement-analysis|FMP Balance Sheet Growth Documentation}
461
+ * @see {@link https://site.financialmodelingprep.com/developer/docs/stable#balance-sheet-statement-growth|FMP Balance Sheet Growth Documentation}
464
462
  */
465
463
  getBalanceSheetGrowth(params: {
466
464
  symbol: string;
@@ -493,7 +491,7 @@ declare class FinancialEndpoints {
493
491
  * const quarterlyGrowth = await fmp.financial.getFinancialGrowth({ symbol: 'MSFT', period: 'quarter', limit: 8 });
494
492
  * ```
495
493
  *
496
- * @see {@link https://site.financialmodelingprep.com/developer/docs#financial-growth-statement-analysis|FMP Financial Growth Documentation}
494
+ * @see {@link https://site.financialmodelingprep.com/developer/docs/stable#financial-statement-growth|FMP Financial Growth Documentation}
497
495
  */
498
496
  getFinancialGrowth(params: {
499
497
  symbol: string;
@@ -525,7 +523,7 @@ declare class FinancialEndpoints {
525
523
  * const msftEarnings = await fmp.financial.getEarningsHistorical({ symbol: 'MSFT', limit: 8 });
526
524
  * ```
527
525
  *
528
- * @see {@link https://site.financialmodelingprep.com/developer/docs#earnings-historical-earnings|FMP Earnings Historical Documentation}
526
+ * @see {@link https://site.financialmodelingprep.com/developer/docs/stable#earnings-company|FMP Earnings Historical Documentation}
529
527
  */
530
528
  getEarningsHistorical(params: {
531
529
  symbol: string;
@@ -667,7 +665,7 @@ declare class ETFEndpoints {
667
665
  * const vooProfile = await fmp.etf.getProfile('VOO');
668
666
  * ```
669
667
  *
670
- * @see {@link https://site.financialmodelingprep.com/developer/docs#etf-information-etf-holdings|FMP ETF Information Documentation}
668
+ * @see {@link https://site.financialmodelingprep.com/developer/docs/stable#information|FMP ETF Information Documentation}
671
669
  */
672
670
  getProfile(symbol: string): Promise<APIResponse<ETFProfile>>;
673
671
  /**
@@ -693,7 +691,7 @@ declare class ETFEndpoints {
693
691
  * const qqqSectors = await fmp.etf.getSectorWeighting('QQQ');
694
692
  * ```
695
693
  *
696
- * @see {@link https://site.financialmodelingprep.com/developer/docs#etf-sector-weighting-etf-holdings|FMP ETF Sector Weighting Documentation}
694
+ * @see {@link https://site.financialmodelingprep.com/developer/docs/stable#sector-weighting|FMP ETF Sector Weighting Documentation}
697
695
  */
698
696
  getSectorWeighting(symbol: string): Promise<APIResponse<ETFWeighting[]>>;
699
697
  /**
@@ -719,7 +717,7 @@ declare class ETFEndpoints {
719
717
  * const efaCountries = await fmp.etf.getCountryWeighting('EFA');
720
718
  * ```
721
719
  *
722
- * @see {@link https://site.financialmodelingprep.com/developer/docs#etf-country-weighting-etf-holdings|FMP ETF Country Weighting Documentation}
720
+ * @see {@link https://site.financialmodelingprep.com/developer/docs/stable#country-weighting|FMP ETF Country Weighting Documentation}
723
721
  */
724
722
  getCountryWeighting(symbol: string): Promise<APIResponse<ETFCountryWeighting[]>>;
725
723
  /**
@@ -784,7 +782,7 @@ declare class EconomicEndpoints {
784
782
  * });
785
783
  * ```
786
784
  *
787
- * @see {@link https://site.financialmodelingprep.com/developer/docs#treasury-rates-economics-data|FMP Treasury Rates Documentation}
785
+ * @see {@link https://site.financialmodelingprep.com/developer/docs/stable#treasury-rates|FMP Treasury Rates Documentation}
788
786
  */
789
787
  getTreasuryRates(params: {
790
788
  from?: string;
@@ -900,7 +898,7 @@ declare class MarketEndpoints {
900
898
  * console.log(`Gaining indices: ${gainers.length}, Losing indices: ${losers.length}`);
901
899
  * ```
902
900
  *
903
- * @see {@link https://site.financialmodelingprep.com/developer/docs#market-performance|FMP Market Performance Documentation}
901
+ * @see {@link https://site.financialmodelingprep.com/developer/docs#market-index-market-overview|FMP Market Performance Documentation}
904
902
  */
905
903
  getMarketPerformance(): Promise<APIResponse<MarketPerformance[]>>;
906
904
  /**
@@ -1297,8 +1295,8 @@ declare class ListEndpoints {
1297
1295
  }
1298
1296
 
1299
1297
  declare class CalendarEndpoints {
1300
- private client;
1301
- constructor(client: FMPClient);
1298
+ private _client;
1299
+ constructor(_client: FMPClient);
1302
1300
  /**
1303
1301
  * Get earnings calendar data
1304
1302
  *
@@ -1550,7 +1548,7 @@ declare class CompanyEndpoints {
1550
1548
  * const msftProfile = await fmp.company.getCompanyProfile('MSFT');
1551
1549
  * ```
1552
1550
  *
1553
- * @see {@link https://site.financialmodelingprep.com/developer/docs#company-profile-company-information|FMP Company Profile Documentation}
1551
+ * @see {@link https://site.financialmodelingprep.com/developer/docs/stable#profile-symbol|FMP Company Profile Documentation}
1554
1552
  */
1555
1553
  getCompanyProfile(symbol: string): Promise<APIResponse<CompanyProfile>>;
1556
1554
  /**
@@ -1579,7 +1577,7 @@ declare class CompanyEndpoints {
1579
1577
  * const teslaComp = await fmp.company.getExecutiveCompensation('TSLA');
1580
1578
  * ```
1581
1579
  *
1582
- * @see {@link https://site.financialmodelingprep.com/developer/docs#executive-compensation-company-information|FMP Executive Compensation Documentation}
1580
+ * @see {@link https://site.financialmodelingprep.com/developer/docs/stable#executive-compensation|FMP Executive Compensation Documentation}
1583
1581
  */
1584
1582
  getExecutiveCompensation(symbol: string): Promise<APIResponse<ExecutiveCompensation[]>>;
1585
1583
  /**
@@ -1606,7 +1604,7 @@ declare class CompanyEndpoints {
1606
1604
  * const jpmNotes = await fmp.company.getCompanyNotes('JPM');
1607
1605
  * ```
1608
1606
  *
1609
- * @see {@link https://site.financialmodelingprep.com/developer/docs#company-notes-company-information|FMP Company Notes Documentation}
1607
+ * @see {@link https://site.financialmodelingprep.com/developer/docs/stable#company-notes|FMP Company Notes Documentation}
1610
1608
  */
1611
1609
  getCompanyNotes(symbol: string): Promise<APIResponse<CompanyNotes[]>>;
1612
1610
  /**
@@ -1632,7 +1630,7 @@ declare class CompanyEndpoints {
1632
1630
  * const amazonEmployees = await fmp.company.getHistoricalEmployeeCount('AMZN');
1633
1631
  * ```
1634
1632
  *
1635
- * @see {@link https://site.financialmodelingprep.com/developer/docs#historical-employee-company-information|FMP Historical Employee Count Documentation}
1633
+ * @see {@link https://site.financialmodelingprep.com/developer/docs/stable#historical-employee-count|FMP Historical Employee Count Documentation}
1636
1634
  */
1637
1635
  getHistoricalEmployeeCount(symbol: string): Promise<APIResponse<HistoricalEmployeeCount[]>>;
1638
1636
  /**
@@ -1658,7 +1656,7 @@ declare class CompanyEndpoints {
1658
1656
  * const teslaFloat = await fmp.company.getSharesFloat('TSLA');
1659
1657
  * ```
1660
1658
  *
1661
- * @see {@link https://site.financialmodelingprep.com/developer/docs#company-share-float-share-float|FMP Shares Float Documentation}
1659
+ * @see {@link https://site.financialmodelingprep.com/developer/docs/stable#shares-float|FMP Shares Float Documentation}
1662
1660
  */
1663
1661
  getSharesFloat(symbol: string): Promise<APIResponse<SharesFloat>>;
1664
1662
  /**
@@ -1725,7 +1723,7 @@ declare class CompanyEndpoints {
1725
1723
  symbol: string;
1726
1724
  year: number;
1727
1725
  quarter: number;
1728
- }): Promise<APIResponse<EarningsCallTranscript[]>>;
1726
+ }): Promise<APIResponse<EarningsCallTranscript>>;
1729
1727
  /**
1730
1728
  * Get available earnings call transcript dates
1731
1729
  *
@@ -2828,14 +2826,6 @@ declare class SECEndpoints {
2828
2826
  }): Promise<APIResponse<IndustryClassificationCode[]>>;
2829
2827
  }
2830
2828
 
2831
- interface MutualFundHolding {
2832
- holder: string;
2833
- shares: number;
2834
- dateReported: string;
2835
- change: number;
2836
- weightPercent: number;
2837
- }
2838
-
2839
2829
  declare class MutualFundEndpoints {
2840
2830
  private client;
2841
2831
  constructor(client: FMPClient);
@@ -2996,4 +2986,4 @@ declare const SECTORS: {
2996
2986
  readonly COMMUNICATION_SERVICES: "Communication Services";
2997
2987
  };
2998
2988
 
2999
- export { APIResponse, CalendarEndpoints, CompanyEndpoints, DEFAULT_LIMIT, DEFAULT_TIMEOUT, ETFEndpoints, EXCHANGES, EconomicEndpoints, FMP, FMPClient, FinancialEndpoints, InsiderEndpoints, InstitutionalEndpoints, ListEndpoints, MAX_LIMIT, MarketCap, MarketEndpoints, MutualFundEndpoints, PERIODS, Quote, QuoteEndpoints, SECEndpoints, SECTORS, SenateHouseEndpoints, StockEndpoints, StockRealTimePrice, formatCurrency, formatDate, formatLargeNumber, formatPercentage, formatVolume };
2989
+ export { CalendarEndpoints, CompanyEndpoints, DEFAULT_LIMIT, DEFAULT_TIMEOUT, ETFEndpoints, EXCHANGES, EconomicEndpoints, FMP, FMPClient, FinancialEndpoints, InsiderEndpoints, InstitutionalEndpoints, ListEndpoints, MAX_LIMIT, MarketEndpoints, MutualFundEndpoints, PERIODS, QuoteEndpoints, SECEndpoints, SECTORS, SenateHouseEndpoints, StockEndpoints, formatCurrency, formatDate, formatLargeNumber, formatPercentage, formatVolume };
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
- 'use strict';var C=require('axios');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var C__default=/*#__PURE__*/_interopDefault(C);function E(i){return Array.isArray(i)&&i.length===1?i[0]:i}function v(i){return Array.isArray(i)?i:i??[]}function F(i){return i==null?{}:Array.isArray(i)&&i.length===0?{}:i}var l=class{constructor(e){if(!e.apiKey)throw new Error("API key is required for FMPClient");this.apiKey=e.apiKey,this.v3Client=C__default.default.create({baseURL:"https://financialmodelingprep.com/api/v3",timeout:e.timeout||1e4,headers:{"Content-Type":"application/json"}}),this.v4Client=C__default.default.create({baseURL:"https://financialmodelingprep.com/api/v4",timeout:e.timeout||1e4,headers:{"Content-Type":"application/json"}}),this.stableClient=C__default.default.create({baseURL:"https://financialmodelingprep.com/stable",timeout:e.timeout||1e4,headers:{"Content-Type":"application/json"}}),[this.v3Client,this.v4Client,this.stableClient].forEach(t=>{t.interceptors.request.use(r=>(r.params={...r.params,apikey:this.apiKey},r));});}async get(e,t="v3",r){let n=this.getClientForVersion(t);try{let s=await n.get(e,{params:r}),o=s.data;return (Array.isArray(o)||o==null)&&(o=v(o)),{success:!0,data:o,error:null,status:s.status}}catch(s){return {success:false,data:null,error:s.message||"Unknown error occurred",status:s.response?.status||500}}}async getSingle(e,t="v3",r){let n=this.getClientForVersion(t);try{let s=await n.get(e,{params:r});return {success:!0,data:F(E(s.data)),error:null,status:s.status}}catch(s){return {success:false,data:null,error:s.message||"Unknown error occurred",status:s.response?.status||500}}}getClientForVersion(e){switch(e){case "v3":return this.v3Client;case "v4":return this.v4Client;case "stable":return this.stableClient;default:return this.v3Client}}};var c=class{static isValidSymbol(e){return !e||typeof e!="string"?false:/^[A-Z]{1,5}$/.test(e)}static isValidCryptoSymbol(e){return !e||typeof e!="string"?false:/^[A-Z]{2,10}(USD|EUR|GBP|JPY|CAD|AUD|CHF|CNY)$/.test(e)}static isValidForexPair(e){return !e||typeof e!="string"?false:/^[A-Z]{3}[A-Z]{3}$/.test(e)}static isValidDate(e){if(!e||typeof e!="string"||!/^\d{4}-\d{2}-\d{2}$/.test(e))return false;let r=new Date(e);return !isNaN(r.getTime())&&r.toISOString().split("T")[0]===e}static isValidDateRange(e,t){if(!this.isValidDate(e)||!this.isValidDate(t))return false;let r=new Date(e),n=new Date(t);return r<=n}static isValidResponse(e){return !!(e&&typeof e=="object"&&typeof e.success=="boolean")}static isValidApiKey(e){return !e||typeof e!="string"?false:/^[a-zA-Z0-9]{32,}$/.test(e)}static isValidPeriod(e){return !e||typeof e!="string"?false:["annual","quarter","fy"].includes(e.toLowerCase())}static isValidLimit(e){return typeof e=="number"&&Number.isInteger(e)&&e>0&&e<=1e3}static validateQuoteParams(e){let t=[];return e?(e.symbol?!this.isValidSymbol(e.symbol)&&!this.isValidCryptoSymbol(e.symbol)&&!this.isValidForexPair(e.symbol)&&t.push("Invalid symbol format"):t.push("Symbol is required"),e.from&&!this.isValidDate(e.from)&&t.push("Invalid from date format (expected YYYY-MM-DD)"),e.to&&!this.isValidDate(e.to)&&t.push("Invalid to date format (expected YYYY-MM-DD)"),e.from&&e.to&&!this.isValidDateRange(e.from,e.to)&&t.push("From date must be before or equal to to date"),t):(t.push("Parameters object is required"),t)}static validateFinancialParams(e){let t=[];return e?(e.symbol?this.isValidSymbol(e.symbol)||t.push("Invalid symbol format"):t.push("Symbol is required"),e.period&&!this.isValidPeriod(e.period)&&t.push('Invalid period (must be "annual", "quarter", or "FY")'),e.limit&&!this.isValidLimit(e.limit)&&t.push("Invalid limit (must be a positive integer <= 1000)"),t):(t.push("Parameters object is required"),t)}static validateDateRangeParams(e){let t=[];return e?(e.from&&!this.isValidDate(e.from)&&t.push("Invalid from date format (expected YYYY-MM-DD)"),e.to&&!this.isValidDate(e.to)&&t.push("Invalid to date format (expected YYYY-MM-DD)"),e.from&&e.to&&!this.isValidDateRange(e.from,e.to)&&t.push("From date must be before or equal to to date"),t):(t.push("Parameters object is required"),t)}static throwIfInvalid(e,t="Validation"){if(e.length>0)throw new Error(`${t} failed: ${e.join(", ")}`)}};var m=class{constructor(e){this.client=e;}async getMarketCap(e){return this.client.getSingle(`/market-capitalization/${e}`,"v3")}async getStockSplits(e){return this.client.get(`/historical-price-full/stock_split/${e}`,"v3")}async getDividendHistory(e){return this.client.getSingle(`/historical-price-full/stock_dividend/${e}`,"v3")}async getRealTimePrice(e){let t=`stock/real-time-price/${e.join(",")}`,r=await this.client.get(t,"v3");if(r.success&&r.data&&!Array.isArray(r.data)){let s=r.data;if(typeof s=="object"&&s!==null&&"companiesPriceList"in s&&Array.isArray(s.companiesPriceList)){let o=s.companiesPriceList.filter(a=>a&&a.symbol);if(o.length>0)return {...r,data:o}}if(typeof s=="object"&&s!==null&&"stockList"in s&&Array.isArray(s.stockList)){let o=s.stockList.filter(a=>a&&a.symbol);if(o.length>0)return {...r,data:o}}return s.symbol?{...r,data:[s]}:(e.length===1&&console.warn(`No real-time price data found for symbol: ${e[0]}`),{...r,data:[]})}let n=r.data.filter(s=>s&&s.symbol);return {...r,data:n}}async getRealTimePriceForMultipleStocks(e){let t=`stock/full/real-time-price/${e.join(",")}`,r=await this.client.get(t,"v3");if(r.success&&r.data&&!Array.isArray(r.data)){let s=r.data;if(typeof s=="object"&&s!==null&&"companiesPriceList"in s&&Array.isArray(s.companiesPriceList)){let o=s.companiesPriceList.filter(a=>a&&a.symbol);if(o.length>0)return {...r,data:o}}if(typeof s=="object"&&s!==null&&"stockList"in s&&Array.isArray(s.stockList)){let o=s.stockList.filter(a=>a&&a.symbol);if(o.length>0)return {...r,data:o}}return s.symbol?{...r,data:[s]}:(e.length===1&&console.warn(`No full real-time price data found for symbol: ${e[0]}`),{...r,data:[]})}let n=r.data.filter(s=>s&&s.symbol);return {...r,data:n}}};var p=class{constructor(e){this.client=e;}async getIncomeStatement(e){let{symbol:t,period:r="annual",limit:n=5}=e;return this.client.get(`/income-statement/${t}?period=${r}&limit=${n}`,"v3")}async getBalanceSheet(e){let{symbol:t,period:r="annual",limit:n=5}=e;return this.client.get(`/balance-sheet-statement/${t}?period=${r}&limit=${n}`,"v3")}async getCashFlowStatement(e){let{symbol:t,period:r="annual",limit:n=5}=e;return this.client.get(`/cash-flow-statement/${t}?period=${r}&limit=${n}`,"v3")}async getKeyMetrics(e){let{symbol:t,period:r="annual",limit:n=5}=e;return this.client.get(`/key-metrics/${t}?period=${r}&limit=${n}`,"v3")}async getFinancialRatios(e){let{symbol:t,period:r="annual",limit:n=5}=e;return this.client.get(`/ratios/${t}?period=${r}&limit=${n}`,"v3")}async getEnterpriseValue(e){let{symbol:t,period:r="annual",limit:n=5}=e;return this.client.get(`/enterprise-value/${t}?period=${r}&limit=${n}`,"v3")}async getCashflowGrowth(e){let{symbol:t,period:r="annual",limit:n=5}=e;return this.client.get(`/cash-flow-statement-growth/${t}?period=${r}&limit=${n}`,"v3")}async getIncomeGrowth(e){let{symbol:t,period:r="annual",limit:n=5}=e;return this.client.get(`/income-statement-growth/${t}?period=${r}&limit=${n}`,"v3")}async getBalanceSheetGrowth(e){let{symbol:t,period:r="annual",limit:n=5}=e;return this.client.get(`/balance-sheet-statement-growth/${t}?period=${r}&limit=${n}`,"v3")}async getFinancialGrowth(e){let{symbol:t,period:r="annual",limit:n=5}=e;return this.client.get(`/financial-growth/${t}?period=${r}&limit=${n}`,"v3")}async getEarningsHistorical(e){let{symbol:t,limit:r=5}=e;return this.client.get(`/historical/earning_calendar/${t}?limit=${r}`,"v3")}async getEarningsSurprises(e){return this.client.get(`/earnings-surprises/${e}`,"v3")}};var u=class{constructor(e){this.client=e;}async getHoldingDates(e){return this.client.get("/etf-holdings/portfolio-date","v4",{symbol:e})}async getHoldings(e){let{symbol:t,date:r}=e,n={};return t&&(n.symbol=t),r&&(n.date=r),this.client.get("/etf-holdings","v4",n)}async getHolder(e){return this.client.get(`/etf-holder/${e}`,"v3")}async getProfile(e){return this.client.getSingle("/etf-info","v4",{symbol:e})}async getSectorWeighting(e){return this.client.get(`/etf-sector-weightings/${e}`,"v3")}async getCountryWeighting(e){return this.client.get(`/etf-country-weightings/${e}`,"v3")}async getStockExposure(e){return this.client.get(`/etf-stock-exposure/${e}`,"v3")}};var g=class{constructor(e){this.client=e;}async getTreasuryRates(e){let{from:t,to:r}=e,n={};return t&&(n.from=t),r&&(n.to=r),this.client.get("/treasury","v4",n)}async getEconomicIndicators(e){let{name:t,from:r,to:n}=e,s={name:t};return r&&(s.from=r),n&&(s.to=n),this.client.get("/economic","v4",s)}};var d=class{constructor(e){this.client=e;}async getMarketHours(){return this.client.get("/market-hours","v3")}async getMarketPerformance(){return this.client.get("/market-performance","v3")}async getGainers(){return this.client.get("/stock_market/gainers","v3")}async getLosers(){return this.client.get("/stock_market/losers","v3")}async getMostActive(){return this.client.get("/stock_market/actives","v3")}async getSectorPerformance(){return this.client.get("/sector-performance","v3")}async getMarketIndex(){return this.client.get("/quotes/index","v3")}};var f=class{constructor(e){this.client=e;}async getStockList(){return this.client.get("/stock/list")}async getETFList(){return this.client.get("/etf/list")}async getCryptoList(){return this.client.get("/symbol/available-cryptocurrencies")}async getForexList(){return this.client.get("/symbol/available-forex-currency-pairs")}async getAvailableIndexes(){return this.client.get("/symbol/available-indexes")}};var y=class{constructor(e){this.client=e;}async getEarningsCalendar(e={}){let{from:t,to:r}=e,n={};return t&&(n.from=t),r&&(n.to=r),this.client.get("/earning_calendar","v3",n)}async getEarningsConfirmed(e={}){let{from:t,to:r}=e,n={};return t&&(n.from=t),r&&(n.to=r),this.client.get("/earning-calendar-confirmed","v4",n)}async getDividendsCalendar(e={}){let{from:t,to:r}=e,n={};return t&&(n.from=t),r&&(n.to=r),this.client.get("/stock_dividend_calendar","v3",n)}async getEconomicsCalendar(e={}){let{from:t,to:r}=e,n={};return t&&(n.from=t),r&&(n.to=r),this.client.get("/economic_calendar","v3",n)}async getIPOCalendar(e={}){let{from:t,to:r}=e,n={};return t&&(n.from=t),r&&(n.to=r),this.client.get("/ipo_calendar","v3",n)}async getSplitsCalendar(e={}){let{from:t,to:r}=e,n={};return t&&(n.from=t),r&&(n.to=r),this.client.get("/stock_split_calendar","v3",n)}};var P=class{constructor(e){this.client=e;}async getCompanyProfile(e){return this.client.getSingle(`/profile/${e}`,"v3")}async getExecutiveCompensation(e){return this.client.get("/governance/executive_compensation","v4",{symbol:e})}async getCompanyNotes(e){return this.client.get("/company-notes","v4",{symbol:e})}async getHistoricalEmployeeCount(e){return this.client.get("/historical/employee_count","v4",{symbol:e})}async getSharesFloat(e){return this.client.getSingle("/shares_float","v4",{symbol:e})}async getHistoricalSharesFloat(e){return this.client.get("/historical/shares_float","v4",{symbol:e})}async getEarningsCallTranscript(e){let{symbol:t,year:r,quarter:n}=e;return this.client.getSingle(`/earning_call_transcript/${t}`,"v3",{year:r,quarter:n})}async getCompanyTranscriptData(e){return this.client.getSingle("/earning_call_transcript","v4",{symbol:e})}};var R=class{constructor(e){this.client=e;}async getQuote(e){return this.client.getSingle(`/quote/${e}`,"v3")}async getHistoricalPrice(e){let{symbol:t,from:r,to:n}=e,s={};return r&&(s.from=r),n&&(s.to=n),this.client.getSingle(`/historical-price-full/${t}`,"v3",s)}async getQuotes(e){let t=e.join(",");return this.client.get(`/quote/${t}`,"v3")}async getIntraday(e){let{symbol:t,interval:r,from:n,to:s}=e,o={};return n&&(o.from=n),s&&(o.to=s),this.client.get(`/historical-chart/${r}/${t}`,"v3",o)}};var h=class{constructor(e){this.client=e;}async getSenateTrading(e){let{symbol:t}=e;return this.client.get("/senate-trading","v4",{symbol:t})}async getSenateTradingRSSFeed(e){let{page:t}=e;return this.client.get("/senate-trading-rss-feed","v4",{page:t})}async getSenateTradingByName(e){let{name:t}=e;return this.client.get("/senate-trades-by-name","stable",{name:t})}async getHouseTrading(e){let{symbol:t}=e;return this.client.get("/senate-disclosure","v4",{symbol:t})}async getHouseTradingRSSFeed(e){let{page:t}=e;return this.client.get("/senate-disclosure-rss-feed","v4",{page:t})}async getHouseTradingByName(e){let{name:t}=e;return this.client.get("/house-trades-by-name","stable",{name:t})}};var I=class{constructor(e){this.client=e;}async getForm13F(e){let{cik:t,date:r}=e,n={};return r&&(n.date=r),this.client.get(`/form-thirteen/${t}`,"v3",n)}async getForm13FDates(e){let{cik:t}=e;return this.client.get(`/form-thirteen-date/${t}`,"v3")}async getInstitutionalHolders(e){let{symbol:t}=e;return this.client.get(`/institutional-holder/${t}`,"v3")}};var S=class{constructor(e){this.client=e;}async getInsiderTradingRSS(e){let{page:t=0}=e;return this.client.get("/insider-trading-rss-feed","v4",{page:t})}async searchInsiderTrading(e){let{symbol:t,reportingCik:r,companyCik:n,transactionType:s,page:o=0}=e,a={page:o};return t&&(a.symbol=t),r&&(a.reportingCik=r),n&&(a.companyCik=n),s&&(a.transactionType=s),this.client.get("/insider-trading","v4",a)}async getTransactionTypes(){return this.client.get("/insider-trading-transaction-type","v4")}async getInsidersBySymbol(e){let{symbol:t}=e;return this.client.get("/insider-roaster","v4",{symbol:t})}async getInsiderTradeStatistics(e){let{symbol:t}=e;return this.client.get("/insider-roaster-statistic","v4",{symbol:t})}async getCikMapper(e){let{page:t=0}=e;return this.client.get("/mapper-cik-name","v4",{page:t})}async getCikMapperByName(e){let{name:t,page:r=0}=e;return this.client.get("/mapper-cik-name","v4",{name:t,page:r})}async getCikMapperBySymbol(e){let{symbol:t}=e;return this.client.getSingle(`/mapper-cik-company/${t}`,"v4")}async getBeneficialOwnership(e){let{symbol:t}=e;return this.client.get("/insider/ownership/acquisition_of_beneficial_ownership","v4",{symbol:t})}async getFailToDeliver(e){let{symbol:t,page:r=0}=e;return this.client.get("/fail_to_deliver","v4",{symbol:t,page:r})}async getInsiderTradesBySymbol(e,t=0){return this.searchInsiderTrading({symbol:e,page:t})}async getInsiderTradesByType(e,t=0){return this.searchInsiderTrading({transactionType:e,page:t})}async getInsiderTradesByReportingCik(e,t=0){return this.searchInsiderTrading({reportingCik:e,page:t})}async getInsiderTradesByCompanyCik(e,t=0){return this.searchInsiderTrading({companyCik:e,page:t})}};var A=class{constructor(e){this.client=e;}async getRSSFeed(e){return this.client.get("/rss_feed","v4",e)}async getRSSFeedAll(e){return this.client.get("/rss_feed_all","v4",e)}async getRSSFeedV3(e){return this.client.get("/rss_feed","v3",e)}async getRSSFeed8K(e){return this.client.get("/rss_feed_8k","v4",e)}async getSECFilings({symbol:e,params:t}){return this.client.get(`/sec_filings/${e}`,"v3",t)}async getIndividualIndustryClassification(e){return this.client.getSingle("/standard_industrial_classification","v4",e)}async getAllIndustryClassifications(){return this.client.get("/standard_industrial_classification/all","v4")}async getIndustryClassificationCodes(e){return this.client.get("/standard_industrial_classification_list","v4",e)}};var b=class{constructor(e){this.client=e;}async getHolders(e){return this.client.get(`/mutual-fund-holder/${e}`,"v3")}};var T=class{constructor(e={}){let t=e.apiKey||process.env.FMP_API_KEY;if(!t)throw new Error("FMP API key is required. Please provide it in the config or set the FMP_API_KEY environment variable.");if(!c.isValidApiKey(t))throw new Error("Invalid API key format");let r=new l({...e,apiKey:t});this.stock=new m(r),this.financial=new p(r),this.etf=new u(r),this.economic=new g(r),this.market=new d(r),this.list=new f(r),this.calendar=new y(r),this.company=new P(r),this.quote=new R(r),this.senateHouse=new h(r),this.institutional=new I(r),this.insider=new S(r),this.sec=new A(r),this.mutualFund=new b(r);}getClient(){return this.stock.client}};function k(i,e="USD"){return new Intl.NumberFormat("en-US",{style:"currency",currency:e}).format(i)}function M(i,e=2){return `${i.toFixed(e)}%`}function D(i){return i>=1e12?`${(i/1e12).toFixed(2)}T`:i>=1e9?`${(i/1e9).toFixed(2)}B`:i>=1e6?`${(i/1e6).toFixed(2)}M`:i>=1e3?`${(i/1e3).toFixed(2)}K`:i.toString()}function x(i){return (typeof i=="string"?new Date(i):i).toISOString().split("T")[0]}function w(i){return i>=1e9?`${(i/1e9).toFixed(2)}B`:i>=1e6?`${(i/1e6).toFixed(2)}M`:i>=1e3?`${(i/1e3).toFixed(2)}K`:i.toString()}var L=1e4,_=100,$=1e3,N={ANNUAL:"annual",QUARTER:"quarter"},H={NYSE:"NYSE",NASDAQ:"NASDAQ",AMEX:"AMEX",TSX:"TSX",LSE:"LSE",ASX:"ASX",NSE:"NSE",BSE:"BSE"},q={TECHNOLOGY:"Technology",HEALTHCARE:"Healthcare",FINANCIAL:"Financial",CONSUMER_DISCRETIONARY:"Consumer Discretionary",CONSUMER_STAPLES:"Consumer Staples",INDUSTRIALS:"Industrials",ENERGY:"Energy",MATERIALS:"Materials",UTILITIES:"Utilities",REAL_ESTATE:"Real Estate",COMMUNICATION_SERVICES:"Communication Services"};
2
- exports.CalendarEndpoints=y;exports.CompanyEndpoints=P;exports.DEFAULT_LIMIT=_;exports.DEFAULT_TIMEOUT=L;exports.ETFEndpoints=u;exports.EXCHANGES=H;exports.EconomicEndpoints=g;exports.FMP=T;exports.FMPClient=l;exports.FMPValidation=c;exports.FinancialEndpoints=p;exports.InsiderEndpoints=S;exports.InstitutionalEndpoints=I;exports.ListEndpoints=f;exports.MAX_LIMIT=$;exports.MarketEndpoints=d;exports.MutualFundEndpoints=b;exports.PERIODS=N;exports.QuoteEndpoints=R;exports.SECEndpoints=A;exports.SECTORS=q;exports.SenateHouseEndpoints=h;exports.StockEndpoints=m;exports.formatCurrency=k;exports.formatDate=x;exports.formatLargeNumber=D;exports.formatPercentage=M;exports.formatVolume=w;
1
+ 'use strict';var C=require('axios');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var C__default=/*#__PURE__*/_interopDefault(C);function E(r){return Array.isArray(r)&&r.length===1?r[0]:r}function F(r){return Array.isArray(r)?r:r??[]}function v(r){return r==null?{}:Array.isArray(r)&&r.length===0?{}:r}var l=class{constructor(e){if(!e.apiKey)throw new Error("API key is required for FMPClient");this.apiKey=e.apiKey,this.v3Client=C__default.default.create({baseURL:"https://financialmodelingprep.com/api/v3",timeout:e.timeout||1e4,headers:{"Content-Type":"application/json"}}),this.v4Client=C__default.default.create({baseURL:"https://financialmodelingprep.com/api/v4",timeout:e.timeout||1e4,headers:{"Content-Type":"application/json"}}),this.stableClient=C__default.default.create({baseURL:"https://financialmodelingprep.com/stable",timeout:e.timeout||1e4,headers:{"Content-Type":"application/json"}}),[this.v3Client,this.v4Client,this.stableClient].forEach(t=>{t.interceptors.request.use(s=>(s.params={...s.params,apikey:this.apiKey},s));});}async get(e,t="v3",s){let n=this.getClientForVersion(t);try{let i=await n.get(e,{params:s}),o=i.data;return (Array.isArray(o)||o==null)&&(o=F(o)),{success:!0,data:o,error:null,status:i.status}}catch(i){return {success:false,data:null,error:i.message||"Unknown error occurred",status:i.response?.status||500}}}async getSingle(e,t="v3",s){let n=this.getClientForVersion(t);try{let i=await n.get(e,{params:s});return {success:!0,data:v(E(i.data)),error:null,status:i.status}}catch(i){return {success:false,data:null,error:i.message||"Unknown error occurred",status:i.response?.status||500}}}getClientForVersion(e){switch(e){case "v3":return this.v3Client;case "v4":return this.v4Client;case "stable":return this.stableClient;default:return this.v3Client}}};var c=class{static isValidSymbol(e){return !e||typeof e!="string"?false:/^[A-Z]{1,5}$/.test(e)}static isValidCryptoSymbol(e){return !e||typeof e!="string"?false:/^[A-Z]{2,10}(USD|EUR|GBP|JPY|CAD|AUD|CHF|CNY)$/.test(e)}static isValidForexPair(e){return !e||typeof e!="string"?false:/^[A-Z]{3}[A-Z]{3}$/.test(e)}static isValidDate(e){if(!e||typeof e!="string"||!/^\d{4}-\d{2}-\d{2}$/.test(e))return false;let s=new Date(e);return !isNaN(s.getTime())&&s.toISOString().split("T")[0]===e}static isValidDateRange(e,t){if(!this.isValidDate(e)||!this.isValidDate(t))return false;let s=new Date(e),n=new Date(t);return s<=n}static isValidResponse(e){return !!(e&&typeof e=="object"&&typeof e.success=="boolean")}static isValidApiKey(e){return !e||typeof e!="string"?false:/^[a-zA-Z0-9]{32,}$/.test(e)}static isValidPeriod(e){return !e||typeof e!="string"?false:["annual","quarter","fy"].includes(e.toLowerCase())}static isValidLimit(e){return typeof e=="number"&&Number.isInteger(e)&&e>0&&e<=1e3}static validateQuoteParams(e){let t=[];return e?(e.symbol?!this.isValidSymbol(e.symbol)&&!this.isValidCryptoSymbol(e.symbol)&&!this.isValidForexPair(e.symbol)&&t.push("Invalid symbol format"):t.push("Symbol is required"),e.from&&!this.isValidDate(e.from)&&t.push("Invalid from date format (expected YYYY-MM-DD)"),e.to&&!this.isValidDate(e.to)&&t.push("Invalid to date format (expected YYYY-MM-DD)"),e.from&&e.to&&!this.isValidDateRange(e.from,e.to)&&t.push("From date must be before or equal to to date"),t):(t.push("Parameters object is required"),t)}static validateFinancialParams(e){let t=[];return e?(e.symbol?this.isValidSymbol(e.symbol)||t.push("Invalid symbol format"):t.push("Symbol is required"),e.period&&!this.isValidPeriod(e.period)&&t.push('Invalid period (must be "annual", "quarter", or "FY")'),e.limit&&!this.isValidLimit(e.limit)&&t.push("Invalid limit (must be a positive integer <= 1000)"),t):(t.push("Parameters object is required"),t)}static validateDateRangeParams(e){let t=[];return e?(e.from&&!this.isValidDate(e.from)&&t.push("Invalid from date format (expected YYYY-MM-DD)"),e.to&&!this.isValidDate(e.to)&&t.push("Invalid to date format (expected YYYY-MM-DD)"),e.from&&e.to&&!this.isValidDateRange(e.from,e.to)&&t.push("From date must be before or equal to to date"),t):(t.push("Parameters object is required"),t)}static throwIfInvalid(e,t="Validation"){if(e.length>0)throw new Error(`${t} failed: ${e.join(", ")}`)}};var m=class{constructor(e){this.client=e;}async getMarketCap(e){return this.client.getSingle(`/market-capitalization/${e}`,"v3")}async getStockSplits(e){return this.client.get(`/historical-price-full/stock_split/${e}`,"v3")}async getDividendHistory(e){return this.client.getSingle(`/historical-price-full/stock_dividend/${e}`,"v3")}async getRealTimePrice(e){let t=`stock/real-time-price/${e.join(",")}`,s=await this.client.get(t,"v3");if(s.success&&s.data&&!Array.isArray(s.data)){let i=s.data;if(typeof i=="object"&&i!==null&&"companiesPriceList"in i&&Array.isArray(i.companiesPriceList)){let o=i.companiesPriceList.filter(a=>a&&a.symbol);if(o.length>0)return {...s,data:o}}if(typeof i=="object"&&i!==null&&"stockList"in i&&Array.isArray(i.stockList)){let o=i.stockList.filter(a=>a&&a.symbol);if(o.length>0)return {...s,data:o}}return i.symbol?{...s,data:[i]}:(e.length===1&&console.warn(`No real-time price data found for symbol: ${e[0]}`),{...s,data:[]})}let n=s.data.filter(i=>i&&i.symbol);return {...s,data:n}}async getRealTimePriceForMultipleStocks(e){let t=`stock/full/real-time-price/${e.join(",")}`,s=await this.client.get(t,"v3");if(s.success&&s.data&&!Array.isArray(s.data)){let i=s.data;if(typeof i=="object"&&i!==null&&"companiesPriceList"in i&&Array.isArray(i.companiesPriceList)){let o=i.companiesPriceList.filter(a=>a&&a.symbol);if(o.length>0)return {...s,data:o}}if(typeof i=="object"&&i!==null&&"stockList"in i&&Array.isArray(i.stockList)){let o=i.stockList.filter(a=>a&&a.symbol);if(o.length>0)return {...s,data:o}}return i.symbol?{...s,data:[i]}:(e.length===1&&console.warn(`No full real-time price data found for symbol: ${e[0]}`),{...s,data:[]})}let n=s.data.filter(i=>i&&i.symbol);return {...s,data:n}}};var p=class{constructor(e){this.client=e;}async getIncomeStatement(e){let{symbol:t,period:s="annual",limit:n=5}=e;return this.client.get(`/income-statement?symbol=${t}&period=${s}&limit=${n}`,"stable")}async getBalanceSheet(e){let{symbol:t,period:s="annual",limit:n=5}=e;return this.client.get(`/balance-sheet-statement?symbol=${t}&period=${s}&limit=${n}`,"stable")}async getCashFlowStatement(e){let{symbol:t,period:s="annual",limit:n=5}=e;return this.client.get(`/cash-flow-statement?symbol=${t}&period=${s}&limit=${n}`,"stable")}async getKeyMetrics(e){let{symbol:t,period:s="annual",limit:n=5}=e;return this.client.get(`/key-metrics?symbol=${t}&period=${s}&limit=${n}`,"stable")}async getFinancialRatios(e){let{symbol:t,period:s="annual",limit:n=5}=e;return this.client.get(`/ratios?symbol=${t}&period=${s}&limit=${n}`,"stable")}async getEnterpriseValue(e){let{symbol:t,period:s="annual",limit:n=5}=e;return this.client.get(`/enterprise-values?symbol=${t}&period=${s}&limit=${n}`,"stable")}async getCashflowGrowth(e){let{symbol:t,period:s="annual",limit:n=5}=e;return this.client.get(`/cash-flow-statement-growth?symbol=${t}&period=${s}&limit=${n}`,"stable")}async getIncomeGrowth(e){let{symbol:t,period:s="annual",limit:n=5}=e;return this.client.get(`/income-statement-growth?symbol=${t}&period=${s}&limit=${n}`,"stable")}async getBalanceSheetGrowth(e){let{symbol:t,period:s="annual",limit:n=5}=e;return this.client.get(`/balance-sheet-statement-growth?symbol=${t}&period=${s}&limit=${n}`,"stable")}async getFinancialGrowth(e){let{symbol:t,period:s="annual",limit:n=5}=e;return this.client.get(`/financial-growth?symbol=${t}&period=${s}&limit=${n}`,"stable")}async getEarningsHistorical(e){let{symbol:t,limit:s=5}=e;return this.client.get(`/earnings?symbol=${t}&limit=${s}`,"stable")}async getEarningsSurprises(e){return this.client.get(`/earnings-surprises/${e}`,"v3")}};var u=class{constructor(e){this.client=e;}async getHoldingDates(e){return this.client.get("/etf-holdings/portfolio-date","v4",{symbol:e})}async getHoldings(e){let{symbol:t,date:s}=e,n={};return t&&(n.symbol=t),s&&(n.date=s),this.client.get("/etf-holdings","v4",n)}async getHolder(e){return this.client.get(`/etf-holder/${e}`,"v3")}async getProfile(e){return this.client.getSingle("/etf/info","stable",{symbol:e})}async getSectorWeighting(e){return this.client.get("/etf/sector-weightings","stable",{symbol:e})}async getCountryWeighting(e){return this.client.get("/etf/country-weightings","stable",{symbol:e})}async getStockExposure(e){return this.client.get(`/etf-stock-exposure/${e}`,"v3")}};var g=class{constructor(e){this.client=e;}async getTreasuryRates(e){let{from:t,to:s}=e,n={};return t&&(n.from=t),s&&(n.to=s),this.client.get("/treasury-rates","stable",n)}async getEconomicIndicators(e){let{name:t,from:s,to:n}=e,i={name:t};return s&&(i.from=s),n&&(i.to=n),this.client.get("/economic-indicators","stable",i)}};var d=class{constructor(e){this.client=e;}async getMarketHours(){return this.client.get("/market-hours","v3")}async getMarketPerformance(){return this.client.get("/quotes/index","v3")}async getGainers(){return this.client.get("/stock_market/gainers","v3")}async getLosers(){return this.client.get("/stock_market/losers","v3")}async getMostActive(){return this.client.get("/stock_market/actives","v3")}async getSectorPerformance(){return this.client.get("/sector-performance","v3")}async getMarketIndex(){return this.client.get("/quotes/index","v3")}};var y=class{constructor(e){this.client=e;}async getStockList(){return this.client.get("/stock/list")}async getETFList(){return this.client.get("/etf/list")}async getCryptoList(){return this.client.get("/symbol/available-cryptocurrencies")}async getForexList(){return this.client.get("/symbol/available-forex-currency-pairs")}async getAvailableIndexes(){return this.client.get("/symbol/available-indexes")}};var f=class{constructor(e){this._client=e;}async getEarningsCalendar(e={}){let{from:t,to:s}=e,n={};return t&&(n.from=t),s&&(n.to=s),this._client.get("/earning_calendar","v3",n)}async getEarningsConfirmed(e={}){let{from:t,to:s}=e,n={};return t&&(n.from=t),s&&(n.to=s),this._client.get("/earning-calendar-confirmed","v4",n)}async getDividendsCalendar(e={}){let{from:t,to:s}=e,n={};return t&&(n.from=t),s&&(n.to=s),this._client.get("/stock_dividend_calendar","v3",n)}async getEconomicsCalendar(e={}){let{from:t,to:s}=e,n={};return t&&(n.from=t),s&&(n.to=s),this._client.get("/economic_calendar","v3",n)}async getIPOCalendar(e={}){let{from:t,to:s}=e,n={};return t&&(n.from=t),s&&(n.to=s),this._client.get("/ipo_calendar","v3",n)}async getSplitsCalendar(e={}){let{from:t,to:s}=e,n={};return t&&(n.from=t),s&&(n.to=s),this._client.get("/stock_split_calendar","v3",n)}};var P=class{constructor(e){this.client=e;}async getCompanyProfile(e){return this.client.getSingle("/profile","stable",{symbol:e})}async getExecutiveCompensation(e){return this.client.get("/governance-executive-compensation","stable",{symbol:e})}async getCompanyNotes(e){return this.client.get("/company-notes","stable",{symbol:e})}async getHistoricalEmployeeCount(e){return this.client.get("/historical-employee-count","stable",{symbol:e})}async getSharesFloat(e){return this.client.getSingle("/shares-float","stable",{symbol:e})}async getHistoricalSharesFloat(e){return this.client.get("/historical/shares_float","v4",{symbol:e})}async getEarningsCallTranscript(e){let{symbol:t,year:s,quarter:n}=e;return this.client.getSingle(`/earning_call_transcript/${t}`,"v3",{year:s,quarter:n})}async getCompanyTranscriptData(e){return this.client.getSingle("/earning_call_transcript","v4",{symbol:e})}};var R=class{constructor(e){this.client=e;}async getQuote(e){return this.client.getSingle(`/quote/${e}`,"v3")}async getHistoricalPrice(e){let{symbol:t,from:s,to:n}=e,i={};return s&&(i.from=s),n&&(i.to=n),this.client.getSingle(`/historical-price-full/${t}`,"v3",i)}async getQuotes(e){let t=e.join(",");return this.client.get(`/quote/${t}`,"v3")}async getIntraday(e){let{symbol:t,interval:s,from:n,to:i}=e,o={};return n&&(o.from=n),i&&(o.to=i),this.client.get(`/historical-chart/${s}/${t}`,"v3",o)}};var h=class{constructor(e){this.client=e;}async getSenateTrading(e){let{symbol:t}=e;return this.client.get("/senate-trading","v4",{symbol:t})}async getSenateTradingRSSFeed(e){let{page:t}=e;return this.client.get("/senate-trading-rss-feed","v4",{page:t})}async getSenateTradingByName(e){let{name:t}=e;return this.client.get("/senate-trades-by-name","stable",{name:t})}async getHouseTrading(e){let{symbol:t}=e;return this.client.get("/senate-disclosure","v4",{symbol:t})}async getHouseTradingRSSFeed(e){let{page:t}=e;return this.client.get("/senate-disclosure-rss-feed","v4",{page:t})}async getHouseTradingByName(e){let{name:t}=e;return this.client.get("/house-trades-by-name","stable",{name:t})}};var I=class{constructor(e){this.client=e;}async getForm13F(e){let{cik:t,date:s}=e,n={};return s&&(n.date=s),this.client.get(`/form-thirteen/${t}`,"v3",n)}async getForm13FDates(e){let{cik:t}=e;return this.client.get(`/form-thirteen-date/${t}`,"v3")}async getInstitutionalHolders(e){let{symbol:t}=e;return this.client.get(`/institutional-holder/${t}`,"v3")}};var b=class{constructor(e){this.client=e;}async getInsiderTradingRSS(e){let{page:t=0}=e;return this.client.get("/insider-trading-rss-feed","v4",{page:t})}async searchInsiderTrading(e){let{symbol:t,reportingCik:s,companyCik:n,transactionType:i,page:o=0}=e,a={page:o};return t&&(a.symbol=t),s&&(a.reportingCik=s),n&&(a.companyCik=n),i&&(a.transactionType=i),this.client.get("/insider-trading","v4",a)}async getTransactionTypes(){return this.client.get("/insider-trading-transaction-type","v4")}async getInsidersBySymbol(e){let{symbol:t}=e;return this.client.get("/insider-roaster","v4",{symbol:t})}async getInsiderTradeStatistics(e){let{symbol:t}=e;return this.client.get("/insider-roaster-statistic","v4",{symbol:t})}async getCikMapper(e){let{page:t=0}=e;return this.client.get("/mapper-cik-name","v4",{page:t})}async getCikMapperByName(e){let{name:t,page:s=0}=e;return this.client.get("/mapper-cik-name","v4",{name:t,page:s})}async getCikMapperBySymbol(e){let{symbol:t}=e;return this.client.getSingle(`/mapper-cik-company/${t}`,"v4")}async getBeneficialOwnership(e){let{symbol:t}=e;return this.client.get("/insider/ownership/acquisition_of_beneficial_ownership","v4",{symbol:t})}async getFailToDeliver(e){let{symbol:t,page:s=0}=e;return this.client.get("/fail_to_deliver","v4",{symbol:t,page:s})}async getInsiderTradesBySymbol(e,t=0){return this.searchInsiderTrading({symbol:e,page:t})}async getInsiderTradesByType(e,t=0){return this.searchInsiderTrading({transactionType:e,page:t})}async getInsiderTradesByReportingCik(e,t=0){return this.searchInsiderTrading({reportingCik:e,page:t})}async getInsiderTradesByCompanyCik(e,t=0){return this.searchInsiderTrading({companyCik:e,page:t})}};var S=class{constructor(e){this.client=e;}async getRSSFeed(e){return this.client.get("/rss_feed","v4",e)}async getRSSFeedAll(e){return this.client.get("/rss_feed_all","v4",e)}async getRSSFeedV3(e){return this.client.get("/rss_feed","v3",e)}async getRSSFeed8K(e){return this.client.get("/rss_feed_8k","v4",e)}async getSECFilings({symbol:e,params:t}){return this.client.get(`/sec_filings/${e}`,"v3",t)}async getIndividualIndustryClassification(e){return this.client.getSingle("/standard_industrial_classification","v4",e)}async getAllIndustryClassifications(){return this.client.get("/standard_industrial_classification/all","v4")}async getIndustryClassificationCodes(e){return this.client.get("/standard_industrial_classification_list","v4",e)}};var A=class{constructor(e){this.client=e;}async getHolders(e){return this.client.get(`/mutual-fund-holder/${e}`,"v3")}};var T=class{constructor(e={}){let t=e.apiKey||process.env.FMP_API_KEY;if(!t)throw new Error("FMP API key is required. Please provide it in the config or set the FMP_API_KEY environment variable.");if(!c.isValidApiKey(t))throw new Error("Invalid API key format");let s=new l({...e,apiKey:t});this.stock=new m(s),this.financial=new p(s),this.etf=new u(s),this.economic=new g(s),this.market=new d(s),this.list=new y(s),this.calendar=new f(s),this.company=new P(s),this.quote=new R(s),this.senateHouse=new h(s),this.institutional=new I(s),this.insider=new b(s),this.sec=new S(s),this.mutualFund=new A(s);}getClient(){return this.stock.client}};function k(r,e="USD"){return new Intl.NumberFormat("en-US",{style:"currency",currency:e}).format(r)}function M(r,e=2){return `${r.toFixed(e)}%`}function D(r){return r>=1e12?`${(r/1e12).toFixed(2)}T`:r>=1e9?`${(r/1e9).toFixed(2)}B`:r>=1e6?`${(r/1e6).toFixed(2)}M`:r>=1e3?`${(r/1e3).toFixed(2)}K`:r.toString()}function x(r){return (typeof r=="string"?new Date(r):r).toISOString().split("T")[0]}function w(r){return r>=1e9?`${(r/1e9).toFixed(2)}B`:r>=1e6?`${(r/1e6).toFixed(2)}M`:r>=1e3?`${(r/1e3).toFixed(2)}K`:r.toString()}var _=1e4,L=100,$=1e3,N={ANNUAL:"annual",QUARTER:"quarter"},H={NYSE:"NYSE",NASDAQ:"NASDAQ",AMEX:"AMEX",TSX:"TSX",LSE:"LSE",ASX:"ASX",NSE:"NSE",BSE:"BSE"},q={TECHNOLOGY:"Technology",HEALTHCARE:"Healthcare",FINANCIAL:"Financial",CONSUMER_DISCRETIONARY:"Consumer Discretionary",CONSUMER_STAPLES:"Consumer Staples",INDUSTRIALS:"Industrials",ENERGY:"Energy",MATERIALS:"Materials",UTILITIES:"Utilities",REAL_ESTATE:"Real Estate",COMMUNICATION_SERVICES:"Communication Services"};
2
+ exports.CalendarEndpoints=f;exports.CompanyEndpoints=P;exports.DEFAULT_LIMIT=L;exports.DEFAULT_TIMEOUT=_;exports.ETFEndpoints=u;exports.EXCHANGES=H;exports.EconomicEndpoints=g;exports.FMP=T;exports.FMPClient=l;exports.FMPValidation=c;exports.FinancialEndpoints=p;exports.InsiderEndpoints=b;exports.InstitutionalEndpoints=I;exports.ListEndpoints=y;exports.MAX_LIMIT=$;exports.MarketEndpoints=d;exports.MutualFundEndpoints=A;exports.PERIODS=N;exports.QuoteEndpoints=R;exports.SECEndpoints=S;exports.SECTORS=q;exports.SenateHouseEndpoints=h;exports.StockEndpoints=m;exports.formatCurrency=k;exports.formatDate=x;exports.formatLargeNumber=D;exports.formatPercentage=M;exports.formatVolume=w;