@discomedia/utils 1.0.22 → 1.0.24
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-frontend.cjs +10 -14
- package/dist/index-frontend.cjs.map +1 -1
- package/dist/index-frontend.mjs +10 -14
- package/dist/index-frontend.mjs.map +1 -1
- package/dist/index.cjs +10 -14
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +10 -14
- package/dist/index.mjs.map +1 -1
- package/dist/package.json +4 -4
- package/dist/test.js +6 -14
- package/dist/test.js.map +1 -1
- package/dist/types/alpaca-market-data-api.d.ts.map +1 -1
- package/dist/types/alpaca-trading-api.d.ts +4 -9
- package/dist/types/alpaca-trading-api.d.ts.map +1 -1
- package/dist/types/types/alpaca-types.d.ts +2 -8
- package/dist/types/types/alpaca-types.d.ts.map +1 -1
- package/dist/types-frontend/alpaca-market-data-api.d.ts.map +1 -1
- package/dist/types-frontend/alpaca-trading-api.d.ts +4 -9
- package/dist/types-frontend/alpaca-trading-api.d.ts.map +1 -1
- package/dist/types-frontend/types/alpaca-types.d.ts +2 -8
- package/dist/types-frontend/types/alpaca-types.d.ts.map +1 -1
- package/package.json +4 -4
package/dist/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
|
-
"version": "1.0.
|
|
6
|
+
"version": "1.0.24",
|
|
7
7
|
"author": "Disco Media",
|
|
8
8
|
"description": "Utility functions used in Disco Media apps",
|
|
9
9
|
"always-build-npm": true,
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"dotenv": "^17.2.1",
|
|
36
|
-
"openai": "^5.
|
|
36
|
+
"openai": "^5.12.0",
|
|
37
37
|
"p-limit": "^6.2.0",
|
|
38
38
|
"tslib": "^2.8.1",
|
|
39
39
|
"ws": "^8.18.3"
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"@rollup/plugin-typescript": "^12.1.4",
|
|
47
47
|
"@types/ws": "^8.18.1",
|
|
48
48
|
"lightweight-charts": "^5.0.8",
|
|
49
|
-
"rollup": "^4.
|
|
50
|
-
"typescript": "^5.
|
|
49
|
+
"rollup": "^4.46.2",
|
|
50
|
+
"typescript": "^5.9.2"
|
|
51
51
|
}
|
|
52
52
|
}
|
package/dist/test.js
CHANGED
|
@@ -1367,7 +1367,7 @@ const safeJSON = (text) => {
|
|
|
1367
1367
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
1368
1368
|
const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
1369
1369
|
|
|
1370
|
-
const VERSION = '5.
|
|
1370
|
+
const VERSION = '5.12.0'; // x-release-please-version
|
|
1371
1371
|
|
|
1372
1372
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
1373
1373
|
const isRunningInBrowser = () => {
|
|
@@ -2222,11 +2222,7 @@ class Stream {
|
|
|
2222
2222
|
done = true;
|
|
2223
2223
|
continue;
|
|
2224
2224
|
}
|
|
2225
|
-
if (sse.event === null ||
|
|
2226
|
-
sse.event.startsWith('response.') ||
|
|
2227
|
-
sse.event.startsWith('image_edit.') ||
|
|
2228
|
-
sse.event.startsWith('image_generation.') ||
|
|
2229
|
-
sse.event.startsWith('transcript.')) {
|
|
2225
|
+
if (sse.event === null || !sse.event.startsWith('thread.')) {
|
|
2230
2226
|
let data;
|
|
2231
2227
|
try {
|
|
2232
2228
|
data = JSON.parse(sse.data);
|
|
@@ -13620,11 +13616,9 @@ class AlpacaMarketDataAPI extends EventEmitter {
|
|
|
13620
13616
|
hasMorePages = !!pageToken;
|
|
13621
13617
|
// Enhanced logging with date range and progress info
|
|
13622
13618
|
const dateRangeStr = earliestTimestamp && latestTimestamp
|
|
13623
|
-
? `${earliestTimestamp.toLocaleDateString('en-US', { timeZone: 'America/New_York' })} to ${latestTimestamp.toLocaleDateString('en-US', { timeZone: 'America/New_York' })}`
|
|
13619
|
+
? `${new Date(earliestTimestamp).toLocaleDateString('en-US', { timeZone: 'America/New_York' })} to ${new Date(latestTimestamp).toLocaleDateString('en-US', { timeZone: 'America/New_York' })}`
|
|
13624
13620
|
: 'unknown range';
|
|
13625
|
-
log(`Page ${pageCount}: Fetched ${pageBarsCount.toLocaleString()} bars (total: ${totalBarsCount.toLocaleString()}) for ${
|
|
13626
|
-
type: 'info',
|
|
13627
|
-
});
|
|
13621
|
+
log(`Page ${pageCount}: Fetched ${pageBarsCount.toLocaleString()} bars (total: ${totalBarsCount.toLocaleString()}) for ${symbols.length} symbols, date range: ${dateRangeStr}${hasMorePages ? ', more pages available' : ', complete'}`);
|
|
13628
13622
|
// Prevent infinite loops
|
|
13629
13623
|
if (pageCount > 1000) {
|
|
13630
13624
|
log(`Stopping pagination after ${pageCount} pages to prevent infinite loop`, { type: 'warn' });
|
|
@@ -13632,12 +13626,10 @@ class AlpacaMarketDataAPI extends EventEmitter {
|
|
|
13632
13626
|
}
|
|
13633
13627
|
}
|
|
13634
13628
|
// Final summary
|
|
13635
|
-
const
|
|
13629
|
+
const symbolsJoined = Object.entries(allBars)
|
|
13636
13630
|
.map(([symbol, bars]) => `${symbol}: ${bars.length}`)
|
|
13637
13631
|
.join(', ');
|
|
13638
|
-
log(`Historical bars fetch complete: ${totalBarsCount.toLocaleString()} total bars across ${pageCount} pages
|
|
13639
|
-
type: 'info',
|
|
13640
|
-
});
|
|
13632
|
+
log(`Historical bars fetch complete: ${totalBarsCount.toLocaleString()} total bars across ${pageCount} pages for ${symbolsJoined.length} symbols'}`);
|
|
13641
13633
|
return {
|
|
13642
13634
|
bars: allBars,
|
|
13643
13635
|
next_page_token: null, // Always null since we fetch all pages
|