@fin.cx/opendata 1.4.5 → 1.5.4

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/npmextra.json CHANGED
@@ -5,25 +5,26 @@
5
5
  "githost": "gitlab.com",
6
6
  "gitscope": "fin.cx",
7
7
  "gitrepo": "opendata",
8
- "description": "A TypeScript library for accessing, managing, and updating open business data, focused on German companies and integrating with MongoDB.",
8
+ "description": "A comprehensive TypeScript library that manages open business data for German companies by integrating MongoDB, processing JSONL bulk data, and automating browser interactions for Handelsregister data retrieval.",
9
9
  "npmPackagename": "@fin.cx/opendata",
10
10
  "license": "MIT",
11
11
  "projectDomain": "fin.cx",
12
12
  "keywords": [
13
13
  "TypeScript",
14
14
  "open data",
15
- "business data",
16
15
  "German companies",
17
- "data management",
18
- "business registry",
19
- "npm package",
16
+ "business data",
20
17
  "MongoDB",
18
+ "JSONL",
19
+ "bulk processing",
20
+ "data management",
21
21
  "automation",
22
- "data integration",
23
- "database",
24
- "data processing",
25
- "data retrieval",
26
- "data update"
22
+ "browser automation",
23
+ "Handelsregister",
24
+ "web scraping",
25
+ "file processing",
26
+ "business registry",
27
+ "data retrieval"
27
28
  ]
28
29
  }
29
30
  },
package/package.json CHANGED
@@ -1,37 +1,37 @@
1
1
  {
2
2
  "name": "@fin.cx/opendata",
3
- "version": "1.4.5",
3
+ "version": "1.5.4",
4
4
  "private": false,
5
- "description": "A TypeScript library for accessing, managing, and updating open business data, focused on German companies and integrating with MongoDB.",
5
+ "description": "A comprehensive TypeScript library that manages open business data for German companies by integrating MongoDB, processing JSONL bulk data, and automating browser interactions for Handelsregister data retrieval.",
6
6
  "main": "dist_ts/index.js",
7
7
  "typings": "dist_ts/index.d.ts",
8
8
  "type": "module",
9
9
  "author": "Task Venture Capital GmbH",
10
10
  "license": "MIT",
11
11
  "devDependencies": {
12
- "@git.zone/tsbuild": "^2.3.2",
13
- "@git.zone/tsbundle": "^2.2.5",
12
+ "@git.zone/tsbuild": "^2.6.4",
13
+ "@git.zone/tsbundle": "^2.5.1",
14
14
  "@git.zone/tsrun": "^1.3.3",
15
- "@git.zone/tstest": "^1.0.96",
16
- "@push.rocks/tapbundle": "^5.6.2",
15
+ "@git.zone/tstest": "^2.3.1",
17
16
  "@types/node": "^22.14.0"
18
17
  },
19
18
  "dependencies": {
20
- "@push.rocks/lik": "^6.1.0",
19
+ "@push.rocks/lik": "^6.2.2",
21
20
  "@push.rocks/qenv": "^6.1.0",
22
21
  "@push.rocks/smartarchive": "^4.0.39",
23
22
  "@push.rocks/smartarray": "^1.1.0",
24
23
  "@push.rocks/smartbrowser": "^2.0.8",
25
- "@push.rocks/smartdata": "^5.2.12",
24
+ "@push.rocks/smartdata": "^5.15.1",
26
25
  "@push.rocks/smartdelay": "^3.0.5",
27
- "@push.rocks/smartfile": "^11.2.0",
26
+ "@push.rocks/smartfile": "^11.2.5",
27
+ "@push.rocks/smartlog": "^3.1.8",
28
28
  "@push.rocks/smartpath": "^5.0.18",
29
29
  "@push.rocks/smartpromise": "^4.2.3",
30
30
  "@push.rocks/smartrequest": "^2.1.0",
31
31
  "@push.rocks/smartstream": "^3.2.5",
32
32
  "@push.rocks/smartunique": "^3.0.9",
33
33
  "@push.rocks/smartxml": "^1.1.1",
34
- "@tsclass/tsclass": "^8.2.0"
34
+ "@tsclass/tsclass": "^9.2.0"
35
35
  },
36
36
  "repository": {
37
37
  "type": "git",
@@ -59,21 +59,22 @@
59
59
  "keywords": [
60
60
  "TypeScript",
61
61
  "open data",
62
- "business data",
63
62
  "German companies",
64
- "data management",
65
- "business registry",
66
- "npm package",
63
+ "business data",
67
64
  "MongoDB",
65
+ "JSONL",
66
+ "bulk processing",
67
+ "data management",
68
68
  "automation",
69
- "data integration",
70
- "database",
71
- "data processing",
72
- "data retrieval",
73
- "data update"
69
+ "browser automation",
70
+ "Handelsregister",
71
+ "web scraping",
72
+ "file processing",
73
+ "business registry",
74
+ "data retrieval"
74
75
  ],
75
76
  "scripts": {
76
- "test": "(tstest test/ --web)",
77
+ "test": "(tstest test/ --verbose)",
77
78
  "build": "(tsbuild --web --allowimplicitany)",
78
79
  "buildDocs": "(tsdoc)"
79
80
  }
package/readme.hints.md CHANGED
@@ -0,0 +1,45 @@
1
+ # OpenData Project Hints
2
+
3
+ ## Stocks Module
4
+
5
+ ### Overview
6
+ The stocks module provides real-time stock price data through various provider implementations. Currently supports Yahoo Finance with an extensible architecture for additional providers.
7
+
8
+ ### Architecture
9
+ - **Provider Pattern**: Each stock data source implements the `IStockProvider` interface
10
+ - **Service Registry**: `StockPriceService` manages providers with priority-based selection
11
+ - **Caching**: Built-in cache with configurable TTL to reduce API calls
12
+ - **Fallback Logic**: Automatic failover between providers if one fails
13
+
14
+ ### Yahoo Finance Provider Notes
15
+ - Uses public API endpoints (no authentication required)
16
+ - Two main endpoints:
17
+ - `/v8/finance/chart/{ticker}` - Single ticker with full data
18
+ - `/v8/finance/spark?symbols={tickers}` - Multiple tickers with basic data
19
+ - Response data is in `response.body` when using smartrequest
20
+ - Requires User-Agent header to avoid rate limiting
21
+
22
+ ### Usage Example
23
+ ```typescript
24
+ import { StockPriceService, YahooFinanceProvider } from '@fin.cx/opendata';
25
+
26
+ const stockService = new StockPriceService({ ttl: 60000 });
27
+ const yahooProvider = new YahooFinanceProvider();
28
+ stockService.register(yahooProvider);
29
+
30
+ const price = await stockService.getPrice({ ticker: 'AAPL' });
31
+ console.log(`${price.ticker}: $${price.price}`);
32
+ ```
33
+
34
+ ### Testing
35
+ - Tests use real API calls (be mindful of rate limits)
36
+ - Mock invalid ticker 'INVALID_TICKER_XYZ' for error testing
37
+ - Clear cache between tests to ensure fresh data
38
+ - The spark endpoint may return fewer results than requested
39
+
40
+ ### Future Providers
41
+ To add a new provider:
42
+ 1. Create `ts/stocks/providers/provider.{name}.ts`
43
+ 2. Implement the `IStockProvider` interface
44
+ 3. Register with `StockPriceService`
45
+ 4. No changes needed to existing code