fmp-node-api 0.1.1 → 0.1.2

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
@@ -1,7 +1,7 @@
1
1
  import { F as FMPConfig, A as APIResponse } from './common-COsxpVBY.mjs';
2
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';
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, ak as MutualFundHolding } from './types-only-BhmQjuTn.mjs';
4
+ export { ao as EconomicIndicatorName, an as MarketHoliday, am as StockDividend, al as StockSplit } from './types-only-BhmQjuTn.mjs';
5
5
  export { FMPValidation } from './utils/validation.mjs';
6
6
 
7
7
  declare class FMPClient {
@@ -2828,14 +2828,6 @@ declare class SECEndpoints {
2828
2828
  }): Promise<APIResponse<IndustryClassificationCode[]>>;
2829
2829
  }
2830
2830
 
2831
- interface MutualFundHolding {
2832
- holder: string;
2833
- shares: number;
2834
- dateReported: string;
2835
- change: number;
2836
- weightPercent: number;
2837
- }
2838
-
2839
2831
  declare class MutualFundEndpoints {
2840
2832
  private client;
2841
2833
  constructor(client: FMPClient);
@@ -2996,4 +2988,4 @@ declare const SECTORS: {
2996
2988
  readonly COMMUNICATION_SERVICES: "Communication Services";
2997
2989
  };
2998
2990
 
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 };
2991
+ export { APIResponse, AvailableIndexesList, BalanceSheet, BalanceSheetGrowth, CalendarEndpoints, CashFlowStatement, CashflowGrowth, CompanyEndpoints, CompanyNotes, CompanyProfile, CompanyTranscriptData, CryptoList, DEFAULT_LIMIT, DEFAULT_TIMEOUT, DividendsCalendar, ETFCountryWeighting, ETFEndpoints, ETFHolder, ETFHolding, ETFHoldingDates, ETFList, ETFProfile, ETFStockExposure, ETFWeighting, EXCHANGES, EarningsCalendar, EarningsCallTranscript, EarningsConfirmed, EarningsHistorical, EarningsSurprises, EconomicEndpoints, EconomicIndicator, EconomicsCalendar, EnterpriseValue, ExecutiveCompensation, FMP, FMPClient, FinancialEndpoints, FinancialGrowth, FinancialRatios, ForexList, Form13FResponse, HistoricalEmployeeCount, HistoricalSharesFloat, HouseTradingResponse, IPOCalendar, IncomeGrowth, IncomeStatement, InsiderEndpoints, InsiderTradingSearchResponse, InstitutionalEndpoints, InstitutionalHolderResponse, KeyMetrics, ListEndpoints, MAX_LIMIT, MarketCap, MarketEndpoints, MarketHours, MarketIndex, MarketPerformance, MarketSectorPerformance, MutualFundEndpoints, MutualFundHolding, PERIODS, Quote, QuoteEndpoints, RSSFeedItem, SECEndpoints, SECTORS, SenateHouseEndpoints, SenateTradingResponse, SharesFloat, SplitsCalendar, StockEndpoints, StockList, StockRealTimePrice, StockRealTimePriceFull, TreasuryRate, formatCurrency, formatDate, formatLargeNumber, formatPercentage, formatVolume };
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { F as FMPConfig, A as APIResponse } from './common-COsxpVBY.js';
2
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';
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, ak as MutualFundHolding } from './types-only-B5pGirUZ.js';
4
+ export { ao as EconomicIndicatorName, an as MarketHoliday, am as StockDividend, al as StockSplit } from './types-only-B5pGirUZ.js';
5
5
  export { FMPValidation } from './utils/validation.js';
6
6
 
7
7
  declare class FMPClient {
@@ -2828,14 +2828,6 @@ declare class SECEndpoints {
2828
2828
  }): Promise<APIResponse<IndustryClassificationCode[]>>;
2829
2829
  }
2830
2830
 
2831
- interface MutualFundHolding {
2832
- holder: string;
2833
- shares: number;
2834
- dateReported: string;
2835
- change: number;
2836
- weightPercent: number;
2837
- }
2838
-
2839
2831
  declare class MutualFundEndpoints {
2840
2832
  private client;
2841
2833
  constructor(client: FMPClient);
@@ -2996,4 +2988,4 @@ declare const SECTORS: {
2996
2988
  readonly COMMUNICATION_SERVICES: "Communication Services";
2997
2989
  };
2998
2990
 
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 };
2991
+ export { APIResponse, AvailableIndexesList, BalanceSheet, BalanceSheetGrowth, CalendarEndpoints, CashFlowStatement, CashflowGrowth, CompanyEndpoints, CompanyNotes, CompanyProfile, CompanyTranscriptData, CryptoList, DEFAULT_LIMIT, DEFAULT_TIMEOUT, DividendsCalendar, ETFCountryWeighting, ETFEndpoints, ETFHolder, ETFHolding, ETFHoldingDates, ETFList, ETFProfile, ETFStockExposure, ETFWeighting, EXCHANGES, EarningsCalendar, EarningsCallTranscript, EarningsConfirmed, EarningsHistorical, EarningsSurprises, EconomicEndpoints, EconomicIndicator, EconomicsCalendar, EnterpriseValue, ExecutiveCompensation, FMP, FMPClient, FinancialEndpoints, FinancialGrowth, FinancialRatios, ForexList, Form13FResponse, HistoricalEmployeeCount, HistoricalSharesFloat, HouseTradingResponse, IPOCalendar, IncomeGrowth, IncomeStatement, InsiderEndpoints, InsiderTradingSearchResponse, InstitutionalEndpoints, InstitutionalHolderResponse, KeyMetrics, ListEndpoints, MAX_LIMIT, MarketCap, MarketEndpoints, MarketHours, MarketIndex, MarketPerformance, MarketSectorPerformance, MutualFundEndpoints, MutualFundHolding, PERIODS, Quote, QuoteEndpoints, RSSFeedItem, SECEndpoints, SECTORS, SenateHouseEndpoints, SenateTradingResponse, SharesFloat, SplitsCalendar, StockEndpoints, StockList, StockRealTimePrice, StockRealTimePriceFull, TreasuryRate, 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 T(i){return Array.isArray(i)&&i.length===1?i[0]:i}function F(i){return Array.isArray(i)?i:i??[]}function v(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=F(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:v(T(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 E=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 x(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 D(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,H={ANNUAL:"annual",QUARTER:"quarter"},N={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=N;exports.EconomicEndpoints=g;exports.FMP=E;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=H;exports.QuoteEndpoints=R;exports.SECEndpoints=A;exports.SECTORS=q;exports.SenateHouseEndpoints=h;exports.StockEndpoints=m;exports.formatCurrency=k;exports.formatDate=D;exports.formatLargeNumber=x;exports.formatPercentage=M;exports.formatVolume=w;
package/dist/index.mjs CHANGED
@@ -1,2 +1,2 @@
1
- import {a}from'./chunk-RM7ETDL3.mjs';export{a as FMPValidation}from'./chunk-RM7ETDL3.mjs';import b from'axios';function E(i){return Array.isArray(i)&&i.length===1?i[0]:i}function F(i){return Array.isArray(i)?i:i??[]}function v(i){return i==null?{}:Array.isArray(i)&&i.length===0?{}:i}var c=class{constructor(e){if(!e.apiKey)throw new Error("API key is required for FMPClient");this.apiKey=e.apiKey,this.v3Client=b.create({baseURL:"https://financialmodelingprep.com/api/v3",timeout:e.timeout||1e4,headers:{"Content-Type":"application/json"}}),this.v4Client=b.create({baseURL:"https://financialmodelingprep.com/api/v4",timeout:e.timeout||1e4,headers:{"Content-Type":"application/json"}}),this.stableClient=b.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=F(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:v(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 l=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 m=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 p=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 u=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 d=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 f=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 R=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 h=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 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(!a.isValidApiKey(t))throw new Error("Invalid API key format");let r=new c({...e,apiKey:t});this.stock=new l(r),this.financial=new m(r),this.etf=new p(r),this.economic=new g(r),this.market=new u(r),this.list=new d(r),this.calendar=new y(r),this.company=new P(r),this.quote=new f(r),this.senateHouse=new R(r),this.institutional=new I(r),this.insider=new h(r),this.sec=new S(r),this.mutualFund=new A(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 x(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 D(i){return (typeof i=="string"?new Date(i):i).toISOString().split("T")[0]}function _(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,w=100,$=1e3,H={ANNUAL:"annual",QUARTER:"quarter"},N={NYSE:"NYSE",NASDAQ:"NASDAQ",AMEX:"AMEX",TSX:"TSX",LSE:"LSE",ASX:"ASX",NSE:"NSE",BSE:"BSE"},U={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
- export{y as CalendarEndpoints,P as CompanyEndpoints,w as DEFAULT_LIMIT,L as DEFAULT_TIMEOUT,p as ETFEndpoints,N as EXCHANGES,g as EconomicEndpoints,T as FMP,c as FMPClient,m as FinancialEndpoints,h as InsiderEndpoints,I as InstitutionalEndpoints,d as ListEndpoints,$ as MAX_LIMIT,u as MarketEndpoints,A as MutualFundEndpoints,H as PERIODS,f as QuoteEndpoints,S as SECEndpoints,U as SECTORS,R as SenateHouseEndpoints,l as StockEndpoints,k as formatCurrency,D as formatDate,x as formatLargeNumber,M as formatPercentage,_ as formatVolume};
1
+ import {a}from'./chunk-RM7ETDL3.mjs';export{a as FMPValidation}from'./chunk-RM7ETDL3.mjs';import E from'axios';function b(i){return Array.isArray(i)&&i.length===1?i[0]:i}function F(i){return Array.isArray(i)?i:i??[]}function v(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=E.create({baseURL:"https://financialmodelingprep.com/api/v3",timeout:e.timeout||1e4,headers:{"Content-Type":"application/json"}}),this.v4Client=E.create({baseURL:"https://financialmodelingprep.com/api/v4",timeout:e.timeout||1e4,headers:{"Content-Type":"application/json"}}),this.stableClient=E.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=F(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:v(b(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{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 m=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 p=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 u=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 d=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 f=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 P=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 R=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 h=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 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(!a.isValidApiKey(t))throw new Error("Invalid API key format");let r=new l({...e,apiKey:t});this.stock=new c(r),this.financial=new m(r),this.etf=new p(r),this.economic=new g(r),this.market=new u(r),this.list=new d(r),this.calendar=new y(r),this.company=new f(r),this.quote=new P(r),this.senateHouse=new R(r),this.institutional=new I(r),this.insider=new h(r),this.sec=new S(r),this.mutualFund=new A(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 x(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 D(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,H=1e3,$={ANNUAL:"annual",QUARTER:"quarter"},N={NYSE:"NYSE",NASDAQ:"NASDAQ",AMEX:"AMEX",TSX:"TSX",LSE:"LSE",ASX:"ASX",NSE:"NSE",BSE:"BSE"},U={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
+ export{y as CalendarEndpoints,f as CompanyEndpoints,_ as DEFAULT_LIMIT,L as DEFAULT_TIMEOUT,p as ETFEndpoints,N as EXCHANGES,g as EconomicEndpoints,T as FMP,l as FMPClient,m as FinancialEndpoints,h as InsiderEndpoints,I as InstitutionalEndpoints,d as ListEndpoints,H as MAX_LIMIT,u as MarketEndpoints,A as MutualFundEndpoints,$ as PERIODS,P as QuoteEndpoints,S as SECEndpoints,U as SECTORS,R as SenateHouseEndpoints,c as StockEndpoints,k as formatCurrency,D as formatDate,x as formatLargeNumber,M as formatPercentage,w as formatVolume};
@@ -553,6 +553,7 @@ interface TreasuryRate {
553
553
  year20: number;
554
554
  year30: number;
555
555
  }
556
+ type EconomicIndicatorName = 'GDP' | 'realGDP' | 'nominalPotentialGDP' | 'realGDPPerCapita' | 'federalFunds' | 'CPI' | 'inflationRate' | 'inflation' | 'retailSales' | 'consumerSentiment' | 'durableGoods' | 'unemploymentRate' | 'totalNonfarmPayroll' | 'initialClaims' | 'industrialProductionTotalIndex' | 'newPrivatelyOwnedHousingUnitsStartedTotalUnits' | 'totalVehicleSales' | 'retailMoneyFunds' | 'smoothedUSRecessionProbabilities' | '3MonthOr90DayRatesAndYieldsCertificatesOfDeposit' | 'commercialBankInterestRateOnCreditCardPlansAllAccounts' | '30YearFixedRateMortgageAverage' | '15YearFixedRateMortgageAverage';
556
557
 
557
558
  interface MarketHours {
558
559
  stockExchangeName: string;
@@ -1083,4 +1084,12 @@ interface RSSFeedAllItem {
1083
1084
  finalLink: string;
1084
1085
  }
1085
1086
 
1086
- export { type SenateHouseTradingByNameResponse as $, type AvailableIndexesList as A, type BalanceSheet as B, type CashFlowStatement as C, type EarningsConfirmed as D, type EnterpriseValue as E, type FinancialRatios as F, type DividendsCalendar as G, type EconomicsCalendar as H, type IncomeStatement as I, type IPOCalendar as J, type KeyMetrics as K, type SplitsCalendar as L, type MarketCap as M, type CompanyProfile as N, type ExecutiveCompensation as O, type CompanyNotes as P, type HistoricalEmployeeCount as Q, type SharesFloat as R, type StockSplitResponse as S, type TreasuryRate as T, type HistoricalSharesFloat as U, type EarningsCallTranscript as V, type CompanyTranscriptData as W, type Quote as X, type HistoricalPriceResponse as Y, type HistoricalPriceData as Z, type SenateTradingResponse as _, type StockDividendResponse as a, type HouseTradingResponse as a0, type Form13FResponse as a1, type InstitutionalHolderResponse as a2, type InsiderTradingRSSResponse as a3, type InsiderTradingSearchResponse as a4, type TransactionTypesResponse as a5, type InsidersBySymbolResponse as a6, type InsiderTradeStatisticsResponse as a7, type CikMapperResponse as a8, type CikMapperBySymbolResponse as a9, type BeneficialOwnershipResponse as aa, type FailToDeliverResponse as ab, TransactionType as ac, type RSSFeedItem as ad, type RSSFeedAllItem as ae, type RSSFeedV3Item as af, type RSSFeed8KItem as ag, type SECFiling as ah, type IndustryClassification as ai, type IndustryClassificationCode as aj, type StockSplit as ak, type StockDividend as al, type StockRealTimePrice as b, type StockRealTimePriceFull as c, type CashflowGrowth as d, type IncomeGrowth as e, type BalanceSheetGrowth as f, type FinancialGrowth as g, type EarningsHistorical as h, type EarningsSurprises as i, type ETFHoldingDates as j, type ETFHolding as k, type ETFHolder as l, type ETFProfile as m, type ETFWeighting as n, type ETFCountryWeighting as o, type ETFStockExposure as p, type EconomicIndicator as q, type MarketHours as r, type MarketPerformance as s, type MarketSectorPerformance as t, type MarketIndex as u, type StockList as v, type ETFList as w, type CryptoList as x, type ForexList as y, type EarningsCalendar as z };
1087
+ interface MutualFundHolding {
1088
+ holder: string;
1089
+ shares: number;
1090
+ dateReported: string;
1091
+ change: number;
1092
+ weightPercent: number;
1093
+ }
1094
+
1095
+ export { type SenateHouseTradingByNameResponse as $, type AvailableIndexesList as A, type BalanceSheet as B, type CashFlowStatement as C, type EarningsConfirmed as D, type EnterpriseValue as E, type FinancialRatios as F, type DividendsCalendar as G, type EconomicsCalendar as H, type IncomeStatement as I, type IPOCalendar as J, type KeyMetrics as K, type SplitsCalendar as L, type MarketCap as M, type CompanyProfile as N, type ExecutiveCompensation as O, type CompanyNotes as P, type HistoricalEmployeeCount as Q, type SharesFloat as R, type StockSplitResponse as S, type TreasuryRate as T, type HistoricalSharesFloat as U, type EarningsCallTranscript as V, type CompanyTranscriptData as W, type Quote as X, type HistoricalPriceResponse as Y, type HistoricalPriceData as Z, type SenateTradingResponse as _, type StockDividendResponse as a, type HouseTradingResponse as a0, type Form13FResponse as a1, type InstitutionalHolderResponse as a2, type InsiderTradingRSSResponse as a3, type InsiderTradingSearchResponse as a4, type TransactionTypesResponse as a5, type InsidersBySymbolResponse as a6, type InsiderTradeStatisticsResponse as a7, type CikMapperResponse as a8, type CikMapperBySymbolResponse as a9, type BeneficialOwnershipResponse as aa, type FailToDeliverResponse as ab, TransactionType as ac, type RSSFeedItem as ad, type RSSFeedAllItem as ae, type RSSFeedV3Item as af, type RSSFeed8KItem as ag, type SECFiling as ah, type IndustryClassification as ai, type IndustryClassificationCode as aj, type MutualFundHolding as ak, type StockSplit as al, type StockDividend as am, type MarketHoliday as an, type EconomicIndicatorName as ao, type StockRealTimePrice as b, type StockRealTimePriceFull as c, type CashflowGrowth as d, type IncomeGrowth as e, type BalanceSheetGrowth as f, type FinancialGrowth as g, type EarningsHistorical as h, type EarningsSurprises as i, type ETFHoldingDates as j, type ETFHolding as k, type ETFHolder as l, type ETFProfile as m, type ETFWeighting as n, type ETFCountryWeighting as o, type ETFStockExposure as p, type EconomicIndicator as q, type MarketHours as r, type MarketPerformance as s, type MarketSectorPerformance as t, type MarketIndex as u, type StockList as v, type ETFList as w, type CryptoList as x, type ForexList as y, type EarningsCalendar as z };
@@ -553,6 +553,7 @@ interface TreasuryRate {
553
553
  year20: number;
554
554
  year30: number;
555
555
  }
556
+ type EconomicIndicatorName = 'GDP' | 'realGDP' | 'nominalPotentialGDP' | 'realGDPPerCapita' | 'federalFunds' | 'CPI' | 'inflationRate' | 'inflation' | 'retailSales' | 'consumerSentiment' | 'durableGoods' | 'unemploymentRate' | 'totalNonfarmPayroll' | 'initialClaims' | 'industrialProductionTotalIndex' | 'newPrivatelyOwnedHousingUnitsStartedTotalUnits' | 'totalVehicleSales' | 'retailMoneyFunds' | 'smoothedUSRecessionProbabilities' | '3MonthOr90DayRatesAndYieldsCertificatesOfDeposit' | 'commercialBankInterestRateOnCreditCardPlansAllAccounts' | '30YearFixedRateMortgageAverage' | '15YearFixedRateMortgageAverage';
556
557
 
557
558
  interface MarketHours {
558
559
  stockExchangeName: string;
@@ -1083,4 +1084,12 @@ interface RSSFeedAllItem {
1083
1084
  finalLink: string;
1084
1085
  }
1085
1086
 
1086
- export { type SenateHouseTradingByNameResponse as $, type AvailableIndexesList as A, type BalanceSheet as B, type CashFlowStatement as C, type EarningsConfirmed as D, type EnterpriseValue as E, type FinancialRatios as F, type DividendsCalendar as G, type EconomicsCalendar as H, type IncomeStatement as I, type IPOCalendar as J, type KeyMetrics as K, type SplitsCalendar as L, type MarketCap as M, type CompanyProfile as N, type ExecutiveCompensation as O, type CompanyNotes as P, type HistoricalEmployeeCount as Q, type SharesFloat as R, type StockSplitResponse as S, type TreasuryRate as T, type HistoricalSharesFloat as U, type EarningsCallTranscript as V, type CompanyTranscriptData as W, type Quote as X, type HistoricalPriceResponse as Y, type HistoricalPriceData as Z, type SenateTradingResponse as _, type StockDividendResponse as a, type HouseTradingResponse as a0, type Form13FResponse as a1, type InstitutionalHolderResponse as a2, type InsiderTradingRSSResponse as a3, type InsiderTradingSearchResponse as a4, type TransactionTypesResponse as a5, type InsidersBySymbolResponse as a6, type InsiderTradeStatisticsResponse as a7, type CikMapperResponse as a8, type CikMapperBySymbolResponse as a9, type BeneficialOwnershipResponse as aa, type FailToDeliverResponse as ab, TransactionType as ac, type RSSFeedItem as ad, type RSSFeedAllItem as ae, type RSSFeedV3Item as af, type RSSFeed8KItem as ag, type SECFiling as ah, type IndustryClassification as ai, type IndustryClassificationCode as aj, type StockSplit as ak, type StockDividend as al, type StockRealTimePrice as b, type StockRealTimePriceFull as c, type CashflowGrowth as d, type IncomeGrowth as e, type BalanceSheetGrowth as f, type FinancialGrowth as g, type EarningsHistorical as h, type EarningsSurprises as i, type ETFHoldingDates as j, type ETFHolding as k, type ETFHolder as l, type ETFProfile as m, type ETFWeighting as n, type ETFCountryWeighting as o, type ETFStockExposure as p, type EconomicIndicator as q, type MarketHours as r, type MarketPerformance as s, type MarketSectorPerformance as t, type MarketIndex as u, type StockList as v, type ETFList as w, type CryptoList as x, type ForexList as y, type EarningsCalendar as z };
1087
+ interface MutualFundHolding {
1088
+ holder: string;
1089
+ shares: number;
1090
+ dateReported: string;
1091
+ change: number;
1092
+ weightPercent: number;
1093
+ }
1094
+
1095
+ export { type SenateHouseTradingByNameResponse as $, type AvailableIndexesList as A, type BalanceSheet as B, type CashFlowStatement as C, type EarningsConfirmed as D, type EnterpriseValue as E, type FinancialRatios as F, type DividendsCalendar as G, type EconomicsCalendar as H, type IncomeStatement as I, type IPOCalendar as J, type KeyMetrics as K, type SplitsCalendar as L, type MarketCap as M, type CompanyProfile as N, type ExecutiveCompensation as O, type CompanyNotes as P, type HistoricalEmployeeCount as Q, type SharesFloat as R, type StockSplitResponse as S, type TreasuryRate as T, type HistoricalSharesFloat as U, type EarningsCallTranscript as V, type CompanyTranscriptData as W, type Quote as X, type HistoricalPriceResponse as Y, type HistoricalPriceData as Z, type SenateTradingResponse as _, type StockDividendResponse as a, type HouseTradingResponse as a0, type Form13FResponse as a1, type InstitutionalHolderResponse as a2, type InsiderTradingRSSResponse as a3, type InsiderTradingSearchResponse as a4, type TransactionTypesResponse as a5, type InsidersBySymbolResponse as a6, type InsiderTradeStatisticsResponse as a7, type CikMapperResponse as a8, type CikMapperBySymbolResponse as a9, type BeneficialOwnershipResponse as aa, type FailToDeliverResponse as ab, TransactionType as ac, type RSSFeedItem as ad, type RSSFeedAllItem as ae, type RSSFeedV3Item as af, type RSSFeed8KItem as ag, type SECFiling as ah, type IndustryClassification as ai, type IndustryClassificationCode as aj, type MutualFundHolding as ak, type StockSplit as al, type StockDividend as am, type MarketHoliday as an, type EconomicIndicatorName as ao, type StockRealTimePrice as b, type StockRealTimePriceFull as c, type CashflowGrowth as d, type IncomeGrowth as e, type BalanceSheetGrowth as f, type FinancialGrowth as g, type EarningsHistorical as h, type EarningsSurprises as i, type ETFHoldingDates as j, type ETFHolding as k, type ETFHolder as l, type ETFProfile as m, type ETFWeighting as n, type ETFCountryWeighting as o, type ETFStockExposure as p, type EconomicIndicator as q, type MarketHours as r, type MarketPerformance as s, type MarketSectorPerformance as t, type MarketIndex as u, type StockList as v, type ETFList as w, type CryptoList as x, type ForexList as y, type EarningsCalendar as z };
@@ -1,2 +1,2 @@
1
1
  export { A as APIResponse, P as PeriodParams, S as SymbolParams } from './common-COsxpVBY.mjs';
2
- export { B as BalanceSheet, C as CashFlowStatement, N as CompanyProfile, l as ETFHolder, k as ETFHolding, m as ETFProfile, z as EarningsCalendar, q as EconomicIndicator, F as FinancialRatios, a1 as Form13FResponse, a0 as HouseTradingResponse, I as IncomeStatement, a4 as InsiderTradingSearchResponse, a2 as InstitutionalHolderResponse, K as KeyMetrics, M as MarketCap, r as MarketHours, u as MarketIndex, X as Quote, ad as RSSFeedItem, _ as SenateTradingResponse, al as StockDividend, v as StockList, b as StockRealTimePrice, c as StockRealTimePriceFull, ak as StockSplit } from './types-only-v3B1TqXe.mjs';
2
+ export { A as AvailableIndexesList, B as BalanceSheet, f as BalanceSheetGrowth, C as CashFlowStatement, d as CashflowGrowth, P as CompanyNotes, N as CompanyProfile, W as CompanyTranscriptData, x as CryptoList, G as DividendsCalendar, o as ETFCountryWeighting, l as ETFHolder, k as ETFHolding, j as ETFHoldingDates, w as ETFList, m as ETFProfile, p as ETFStockExposure, n as ETFWeighting, z as EarningsCalendar, V as EarningsCallTranscript, D as EarningsConfirmed, h as EarningsHistorical, i as EarningsSurprises, q as EconomicIndicator, ao as EconomicIndicatorName, H as EconomicsCalendar, E as EnterpriseValue, O as ExecutiveCompensation, g as FinancialGrowth, F as FinancialRatios, y as ForexList, a1 as Form13FResponse, Q as HistoricalEmployeeCount, U as HistoricalSharesFloat, a0 as HouseTradingResponse, J as IPOCalendar, e as IncomeGrowth, I as IncomeStatement, a4 as InsiderTradingSearchResponse, a2 as InstitutionalHolderResponse, K as KeyMetrics, M as MarketCap, an as MarketHoliday, r as MarketHours, u as MarketIndex, s as MarketPerformance, t as MarketSectorPerformance, ak as MutualFundHolding, X as Quote, ad as RSSFeedItem, _ as SenateTradingResponse, R as SharesFloat, L as SplitsCalendar, am as StockDividend, v as StockList, b as StockRealTimePrice, c as StockRealTimePriceFull, al as StockSplit, T as TreasuryRate } from './types-only-BhmQjuTn.mjs';
@@ -1,2 +1,2 @@
1
1
  export { A as APIResponse, P as PeriodParams, S as SymbolParams } from './common-COsxpVBY.js';
2
- export { B as BalanceSheet, C as CashFlowStatement, N as CompanyProfile, l as ETFHolder, k as ETFHolding, m as ETFProfile, z as EarningsCalendar, q as EconomicIndicator, F as FinancialRatios, a1 as Form13FResponse, a0 as HouseTradingResponse, I as IncomeStatement, a4 as InsiderTradingSearchResponse, a2 as InstitutionalHolderResponse, K as KeyMetrics, M as MarketCap, r as MarketHours, u as MarketIndex, X as Quote, ad as RSSFeedItem, _ as SenateTradingResponse, al as StockDividend, v as StockList, b as StockRealTimePrice, c as StockRealTimePriceFull, ak as StockSplit } from './types-only-DjnrpNZm.js';
2
+ export { A as AvailableIndexesList, B as BalanceSheet, f as BalanceSheetGrowth, C as CashFlowStatement, d as CashflowGrowth, P as CompanyNotes, N as CompanyProfile, W as CompanyTranscriptData, x as CryptoList, G as DividendsCalendar, o as ETFCountryWeighting, l as ETFHolder, k as ETFHolding, j as ETFHoldingDates, w as ETFList, m as ETFProfile, p as ETFStockExposure, n as ETFWeighting, z as EarningsCalendar, V as EarningsCallTranscript, D as EarningsConfirmed, h as EarningsHistorical, i as EarningsSurprises, q as EconomicIndicator, ao as EconomicIndicatorName, H as EconomicsCalendar, E as EnterpriseValue, O as ExecutiveCompensation, g as FinancialGrowth, F as FinancialRatios, y as ForexList, a1 as Form13FResponse, Q as HistoricalEmployeeCount, U as HistoricalSharesFloat, a0 as HouseTradingResponse, J as IPOCalendar, e as IncomeGrowth, I as IncomeStatement, a4 as InsiderTradingSearchResponse, a2 as InstitutionalHolderResponse, K as KeyMetrics, M as MarketCap, an as MarketHoliday, r as MarketHours, u as MarketIndex, s as MarketPerformance, t as MarketSectorPerformance, ak as MutualFundHolding, X as Quote, ad as RSSFeedItem, _ as SenateTradingResponse, R as SharesFloat, L as SplitsCalendar, am as StockDividend, v as StockList, b as StockRealTimePrice, c as StockRealTimePriceFull, al as StockSplit, T as TreasuryRate } from './types-only-B5pGirUZ.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fmp-node-api",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "A comprehensive Node.js wrapper for Financial Modeling Prep API",
5
5
  "disclaimer": "This package is not affiliated with, endorsed by, or sponsored by Financial Modeling Prep (FMP). This is an independent, community-developed wrapper.",
6
6
  "main": "./dist/index.js",