@fin.cx/opendata 3.1.0 → 3.2.0
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_ts/00_commitinfo_data.js +1 -1
- package/dist_ts/stocks/classes.baseproviderservice.d.ts +129 -0
- package/dist_ts/stocks/classes.baseproviderservice.js +204 -0
- package/dist_ts/stocks/classes.stockdataservice.d.ts +121 -0
- package/dist_ts/stocks/classes.stockdataservice.js +495 -0
- package/dist_ts/stocks/index.d.ts +3 -0
- package/dist_ts/stocks/index.js +5 -1
- package/dist_ts/stocks/interfaces/stockdata.d.ts +57 -0
- package/dist_ts/stocks/interfaces/stockdata.js +2 -0
- package/package.json +1 -1
- package/readme.md +133 -61
- package/ts/00_commitinfo_data.ts +1 -1
- package/ts/stocks/classes.baseproviderservice.ts +296 -0
- package/ts/stocks/classes.stockdataservice.ts +647 -0
- package/ts/stocks/index.ts +5 -0
- package/ts/stocks/interfaces/stockdata.ts +65 -0
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import type { IStockPrice } from './stockprice.js';
|
|
2
|
+
import type { IStockFundamentals } from './fundamentals.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Combined stock data with price and fundamentals
|
|
6
|
+
* All calculated metrics (market cap, P/E, P/B) are automatically included
|
|
7
|
+
*/
|
|
8
|
+
export interface IStockData {
|
|
9
|
+
/** Stock ticker symbol */
|
|
10
|
+
ticker: string;
|
|
11
|
+
|
|
12
|
+
/** Price information */
|
|
13
|
+
price: IStockPrice;
|
|
14
|
+
|
|
15
|
+
/** Fundamental data (optional - may not be available for all stocks) */
|
|
16
|
+
fundamentals?: IStockFundamentals;
|
|
17
|
+
|
|
18
|
+
/** When this combined data was fetched */
|
|
19
|
+
fetchedAt: Date;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Configuration for StockDataService
|
|
24
|
+
*/
|
|
25
|
+
export interface IStockDataServiceConfig {
|
|
26
|
+
/** Cache configuration */
|
|
27
|
+
cache?: {
|
|
28
|
+
/** TTL for price data (default: 24 hours) */
|
|
29
|
+
priceTTL?: number;
|
|
30
|
+
/** TTL for fundamentals data (default: 90 days) */
|
|
31
|
+
fundamentalsTTL?: number;
|
|
32
|
+
/** Max cache entries (default: 10000) */
|
|
33
|
+
maxEntries?: number;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
/** Provider timeouts */
|
|
37
|
+
timeout?: {
|
|
38
|
+
/** Timeout for price providers (default: 10000ms) */
|
|
39
|
+
price?: number;
|
|
40
|
+
/** Timeout for fundamentals providers (default: 30000ms) */
|
|
41
|
+
fundamentals?: number;
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Request type for getting complete stock data
|
|
47
|
+
*/
|
|
48
|
+
export interface ICompleteStockDataRequest {
|
|
49
|
+
ticker: string;
|
|
50
|
+
/** Whether to include fundamentals (default: true) */
|
|
51
|
+
includeFundamentals?: boolean;
|
|
52
|
+
/** Whether to enrich fundamentals with price calculations (default: true) */
|
|
53
|
+
enrichFundamentals?: boolean;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Batch request for multiple stocks
|
|
58
|
+
*/
|
|
59
|
+
export interface ICompleteStockDataBatchRequest {
|
|
60
|
+
tickers: string[];
|
|
61
|
+
/** Whether to include fundamentals (default: true) */
|
|
62
|
+
includeFundamentals?: boolean;
|
|
63
|
+
/** Whether to enrich fundamentals with price calculations (default: true) */
|
|
64
|
+
enrichFundamentals?: boolean;
|
|
65
|
+
}
|