fmp-node-api 0.2.3 → 0.2.4-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -4
- package/dist/index.d.mts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/types-only.d.mts +1 -4749
- package/dist/types-only.d.ts +1 -4749
- package/dist/utils/validation.d.mts +1 -2
- package/dist/utils/validation.d.ts +1 -2
- package/package.json +7 -6
package/README.md
CHANGED
|
@@ -549,7 +549,7 @@ pnpm test:coverage # Generate coverage report
|
|
|
549
549
|
Run from the repo root (it builds `fmp-node-types` first so the runner uses fresh schemas):
|
|
550
550
|
|
|
551
551
|
```bash
|
|
552
|
-
pnpm test:live #
|
|
552
|
+
pnpm test:live # every manifest case (plan-locked excluded)
|
|
553
553
|
pnpm test:live --category quote,stock # only these categories
|
|
554
554
|
pnpm test:live --endpoint getQuote # cases whose name matches
|
|
555
555
|
pnpm test:live --dry-run # list cases, make NO API calls
|
|
@@ -563,9 +563,9 @@ Each result is classified:
|
|
|
563
563
|
- **SKIP** — plan-locked (HTTP 402/403) or rate/quota limited (429)
|
|
564
564
|
- **DRIFT** — extra top-level fields, or a non-nullable field came back `null`
|
|
565
565
|
|
|
566
|
-
Flags: `--delay <ms>` (default 400) paces calls; `--
|
|
566
|
+
Flags: `--delay <ms>` (default 400) paces calls; `--timeout <ms>` (default 30000) is the per-request timeout; `--sample <n>` (default 3) is how many array rows are validated per response; `--max-calls <n>` optionally caps live calls (default: no cap — every selected case runs; a retry can exceed the cap by one); `--include-locked` also runs cases marked `planLocked`; `--fail-on-drift` makes DRIFT fail the exit code. The runner is sequential and throttled to stay within limited API plans (a full run is ~120 calls in ~1–2 minutes) and retries a transient failure (network error / timeout / 5xx) once. Mark any consistently plan-locked endpoints `planLocked: true` in `scripts/live/manifest.ts` so default runs skip them. Exits non-zero when any case FAILs.
|
|
567
567
|
|
|
568
|
-
> Coverage note: the
|
|
568
|
+
> Coverage note: the manifest covers every endpoint category. The classifier logic is unit-tested in `src/__tests__/live/validate.test.ts` (no API key needed).
|
|
569
569
|
|
|
570
570
|
## Development
|
|
571
571
|
|
|
@@ -671,7 +671,7 @@ src/
|
|
|
671
671
|
scripts/
|
|
672
672
|
├── test-endpoint.ts # Manual live-API endpoint inspector (raw JSON, one endpoint)
|
|
673
673
|
└── live/ # Live-API shape-check tool (pnpm test:live)
|
|
674
|
-
├── run.ts # CLI runner (flags, throttle,
|
|
674
|
+
├── run.ts # CLI runner (flags, throttle, retry, summary)
|
|
675
675
|
├── manifest.ts # Data-driven registry of cases (endpoint + inputs + schema)
|
|
676
676
|
└── tsconfig.json # Type-checks the runner (pnpm type-check:live)
|
|
677
677
|
```
|
package/dist/index.d.mts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { FMPConfig, APIResponse, EarningsCalendar, EarningsConfirmed, DividendsCalendar, EconomicsCalendar, IPOCalendar, SplitsCalendar, CompanyProfile, ExecutiveCompensation, CompanyNotes, HistoricalEmployeeCount, SharesFloat, HistoricalSharesFloat, EarningsCallTranscript, CompanyTranscriptData, StockPeer, TreasuryRate, EconomicIndicator, ETFHoldingDates, ETFHolding, ETFHolder, ETFProfile, ETFWeighting, ETFCountryWeighting, ETFStockExposure, IncomeStatement, BalanceSheet, CashFlowStatement, KeyMetrics, FinancialRatios, EnterpriseValue, CashflowGrowth, IncomeGrowth, BalanceSheetGrowth, FinancialGrowth, EarningsHistorical, EarningsSurprises, FinancialScores, KeyMetricsTTM, FinancialRatiosTTM, RevenueProductSegmentation, RevenueGeographicSegmentation, InsiderTradingRSSResponse, InsiderTradingSearchResponse, TransactionTypesResponse, InsidersBySymbolResponse, InsiderTradeStatisticsResponse, CikMapperResponse, CikMapperBySymbolResponse, BeneficialOwnershipResponse, FailToDeliverResponse, TransactionType, Form13FResponse, InstitutionalHolderResponse, StockList, ETFList, CryptoList, ForexList, AvailableIndexesList, ExchangeMarketHours, MarketIndex, MarketPerformance, MarketSectorPerformance, IndustryPESnapshot, MutualFundHolding, Article, News, Quote, QuoteShort, HistoricalPriceResponse, IntradayPrice, ScreenerParams, Screener, AvailableExchanges, AvailableSectors, AvailableIndustries, AvailableCountries, SearchResult, AnalystEstimate, PriceTargetConsensus, PriceTargetSummary, StockGrade, GradesConsensus, DCFValuation, CompanyRating, TechnicalIndicator, RSSFeedItem, RSSFeedAllItem, RSSFeedV3Item, RSSFeed8KItem, SECFiling, IndustryClassification, IndustryClassificationCode, SenateTradingResponse, SenateHouseTradingByNameResponse, HouseTradingResponse, MarketCap, StockPriceChange, StockSplitResponse, StockDividendResponse, StockRealTimePrice, StockRealTimePriceFull, AftermarketTrade, AftermarketQuote, FMPErrorType } from '
|
|
2
|
-
export
|
|
1
|
+
import { FMPConfig, APIResponse, EarningsCalendar, EarningsConfirmed, DividendsCalendar, EconomicsCalendar, IPOCalendar, SplitsCalendar, CompanyProfile, ExecutiveCompensation, CompanyNotes, HistoricalEmployeeCount, SharesFloat, HistoricalSharesFloat, EarningsCallTranscript, CompanyTranscriptData, StockPeer, TreasuryRate, EconomicIndicator, ETFHoldingDates, ETFHolding, ETFHolder, ETFProfile, ETFWeighting, ETFCountryWeighting, ETFStockExposure, IncomeStatement, BalanceSheet, CashFlowStatement, KeyMetrics, FinancialRatios, EnterpriseValue, CashflowGrowth, IncomeGrowth, BalanceSheetGrowth, FinancialGrowth, EarningsHistorical, EarningsSurprises, FinancialScores, KeyMetricsTTM, FinancialRatiosTTM, RevenueProductSegmentation, RevenueGeographicSegmentation, InsiderTradingRSSResponse, InsiderTradingSearchResponse, TransactionTypesResponse, InsidersBySymbolResponse, InsiderTradeStatisticsResponse, CikMapperResponse, CikMapperBySymbolResponse, BeneficialOwnershipResponse, FailToDeliverResponse, TransactionType, Form13FResponse, InstitutionalHolderResponse, StockList, ETFList, CryptoList, ForexList, AvailableIndexesList, ExchangeMarketHours, MarketIndex, MarketPerformance, MarketSectorPerformance, IndustryPESnapshot, MutualFundHolding, Article, News, Quote, QuoteShort, HistoricalPriceResponse, IntradayPrice, ScreenerParams, Screener, AvailableExchanges, AvailableSectors, AvailableIndustries, AvailableCountries, SearchResult, AnalystEstimate, PriceTargetConsensus, PriceTargetSummary, StockGrade, GradesConsensus, DCFValuation, CompanyRating, TechnicalIndicator, RSSFeedItem, RSSFeedAllItem, RSSFeedV3Item, RSSFeed8KItem, SECFiling, IndustryClassification, IndustryClassificationCode, SenateTradingResponse, SenateHouseTradingByNameResponse, HouseTradingResponse, MarketCap, StockPriceChange, StockSplitResponse, StockDividendResponse, StockRealTimePrice, StockRealTimePriceFull, AftermarketTrade, AftermarketQuote, FMPErrorType } from 'fmp-node-types';
|
|
2
|
+
export type * from 'fmp-node-types';
|
|
3
3
|
export { FMPValidation } from './utils/validation.mjs';
|
|
4
|
-
import 'zod';
|
|
5
4
|
|
|
6
5
|
declare class FMPClient {
|
|
7
6
|
private v3Client;
|
|
@@ -3625,6 +3624,7 @@ declare class AftermarketEndpoints {
|
|
|
3625
3624
|
*
|
|
3626
3625
|
* Returns the most recent aftermarket trade including price, trade size, and
|
|
3627
3626
|
* timestamp. Useful for tracking price action outside regular trading hours.
|
|
3627
|
+
* `tradeSize` is `null` when FMP reports no trade size (e.g. after the post-market session closes).
|
|
3628
3628
|
*
|
|
3629
3629
|
* @param symbol - The stock symbol (e.g., 'AAPL')
|
|
3630
3630
|
*
|
|
@@ -3787,4 +3787,4 @@ declare class FMPError extends Error {
|
|
|
3787
3787
|
constructor(message: string, status?: number | undefined, code?: string | undefined);
|
|
3788
3788
|
}
|
|
3789
3789
|
|
|
3790
|
-
export {
|
|
3790
|
+
export { AftermarketEndpoints, AnalystEndpoints, CalendarEndpoints, type ClassifiedError, CompanyEndpoints, DEFAULT_LIMIT, DEFAULT_TIMEOUT, ETFEndpoints, EXCHANGES, EconomicEndpoints, FMP, FMPClient, FMPError, FinancialEndpoints, InsiderEndpoints, InstitutionalEndpoints, ListEndpoints, MAX_LIMIT, MarketEndpoints, MutualFundEndpoints, NewsEndpoints, PERIODS, QuoteEndpoints, SECEndpoints, SECTORS, ScreenerEndpoints, SearchEndpoints, SenateHouseEndpoints, StockEndpoints, TechnicalEndpoints, ValuationEndpoints, classifyError, formatCurrency, formatDate, formatLargeNumber, formatPercentage, formatVolume };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { FMPConfig, APIResponse, EarningsCalendar, EarningsConfirmed, DividendsCalendar, EconomicsCalendar, IPOCalendar, SplitsCalendar, CompanyProfile, ExecutiveCompensation, CompanyNotes, HistoricalEmployeeCount, SharesFloat, HistoricalSharesFloat, EarningsCallTranscript, CompanyTranscriptData, StockPeer, TreasuryRate, EconomicIndicator, ETFHoldingDates, ETFHolding, ETFHolder, ETFProfile, ETFWeighting, ETFCountryWeighting, ETFStockExposure, IncomeStatement, BalanceSheet, CashFlowStatement, KeyMetrics, FinancialRatios, EnterpriseValue, CashflowGrowth, IncomeGrowth, BalanceSheetGrowth, FinancialGrowth, EarningsHistorical, EarningsSurprises, FinancialScores, KeyMetricsTTM, FinancialRatiosTTM, RevenueProductSegmentation, RevenueGeographicSegmentation, InsiderTradingRSSResponse, InsiderTradingSearchResponse, TransactionTypesResponse, InsidersBySymbolResponse, InsiderTradeStatisticsResponse, CikMapperResponse, CikMapperBySymbolResponse, BeneficialOwnershipResponse, FailToDeliverResponse, TransactionType, Form13FResponse, InstitutionalHolderResponse, StockList, ETFList, CryptoList, ForexList, AvailableIndexesList, ExchangeMarketHours, MarketIndex, MarketPerformance, MarketSectorPerformance, IndustryPESnapshot, MutualFundHolding, Article, News, Quote, QuoteShort, HistoricalPriceResponse, IntradayPrice, ScreenerParams, Screener, AvailableExchanges, AvailableSectors, AvailableIndustries, AvailableCountries, SearchResult, AnalystEstimate, PriceTargetConsensus, PriceTargetSummary, StockGrade, GradesConsensus, DCFValuation, CompanyRating, TechnicalIndicator, RSSFeedItem, RSSFeedAllItem, RSSFeedV3Item, RSSFeed8KItem, SECFiling, IndustryClassification, IndustryClassificationCode, SenateTradingResponse, SenateHouseTradingByNameResponse, HouseTradingResponse, MarketCap, StockPriceChange, StockSplitResponse, StockDividendResponse, StockRealTimePrice, StockRealTimePriceFull, AftermarketTrade, AftermarketQuote, FMPErrorType } from '
|
|
2
|
-
export
|
|
1
|
+
import { FMPConfig, APIResponse, EarningsCalendar, EarningsConfirmed, DividendsCalendar, EconomicsCalendar, IPOCalendar, SplitsCalendar, CompanyProfile, ExecutiveCompensation, CompanyNotes, HistoricalEmployeeCount, SharesFloat, HistoricalSharesFloat, EarningsCallTranscript, CompanyTranscriptData, StockPeer, TreasuryRate, EconomicIndicator, ETFHoldingDates, ETFHolding, ETFHolder, ETFProfile, ETFWeighting, ETFCountryWeighting, ETFStockExposure, IncomeStatement, BalanceSheet, CashFlowStatement, KeyMetrics, FinancialRatios, EnterpriseValue, CashflowGrowth, IncomeGrowth, BalanceSheetGrowth, FinancialGrowth, EarningsHistorical, EarningsSurprises, FinancialScores, KeyMetricsTTM, FinancialRatiosTTM, RevenueProductSegmentation, RevenueGeographicSegmentation, InsiderTradingRSSResponse, InsiderTradingSearchResponse, TransactionTypesResponse, InsidersBySymbolResponse, InsiderTradeStatisticsResponse, CikMapperResponse, CikMapperBySymbolResponse, BeneficialOwnershipResponse, FailToDeliverResponse, TransactionType, Form13FResponse, InstitutionalHolderResponse, StockList, ETFList, CryptoList, ForexList, AvailableIndexesList, ExchangeMarketHours, MarketIndex, MarketPerformance, MarketSectorPerformance, IndustryPESnapshot, MutualFundHolding, Article, News, Quote, QuoteShort, HistoricalPriceResponse, IntradayPrice, ScreenerParams, Screener, AvailableExchanges, AvailableSectors, AvailableIndustries, AvailableCountries, SearchResult, AnalystEstimate, PriceTargetConsensus, PriceTargetSummary, StockGrade, GradesConsensus, DCFValuation, CompanyRating, TechnicalIndicator, RSSFeedItem, RSSFeedAllItem, RSSFeedV3Item, RSSFeed8KItem, SECFiling, IndustryClassification, IndustryClassificationCode, SenateTradingResponse, SenateHouseTradingByNameResponse, HouseTradingResponse, MarketCap, StockPriceChange, StockSplitResponse, StockDividendResponse, StockRealTimePrice, StockRealTimePriceFull, AftermarketTrade, AftermarketQuote, FMPErrorType } from 'fmp-node-types';
|
|
2
|
+
export type * from 'fmp-node-types';
|
|
3
3
|
export { FMPValidation } from './utils/validation.js';
|
|
4
|
-
import 'zod';
|
|
5
4
|
|
|
6
5
|
declare class FMPClient {
|
|
7
6
|
private v3Client;
|
|
@@ -3625,6 +3624,7 @@ declare class AftermarketEndpoints {
|
|
|
3625
3624
|
*
|
|
3626
3625
|
* Returns the most recent aftermarket trade including price, trade size, and
|
|
3627
3626
|
* timestamp. Useful for tracking price action outside regular trading hours.
|
|
3627
|
+
* `tradeSize` is `null` when FMP reports no trade size (e.g. after the post-market session closes).
|
|
3628
3628
|
*
|
|
3629
3629
|
* @param symbol - The stock symbol (e.g., 'AAPL')
|
|
3630
3630
|
*
|
|
@@ -3787,4 +3787,4 @@ declare class FMPError extends Error {
|
|
|
3787
3787
|
constructor(message: string, status?: number | undefined, code?: string | undefined);
|
|
3788
3788
|
}
|
|
3789
3789
|
|
|
3790
|
-
export {
|
|
3790
|
+
export { AftermarketEndpoints, AnalystEndpoints, CalendarEndpoints, type ClassifiedError, CompanyEndpoints, DEFAULT_LIMIT, DEFAULT_TIMEOUT, ETFEndpoints, EXCHANGES, EconomicEndpoints, FMP, FMPClient, FMPError, FinancialEndpoints, InsiderEndpoints, InstitutionalEndpoints, ListEndpoints, MAX_LIMIT, MarketEndpoints, MutualFundEndpoints, NewsEndpoints, PERIODS, QuoteEndpoints, SECEndpoints, SECTORS, ScreenerEndpoints, SearchEndpoints, SenateHouseEndpoints, StockEndpoints, TechnicalEndpoints, ValuationEndpoints, classifyError, formatCurrency, formatDate, formatLargeNumber, formatPercentage, formatVolume };
|