@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/index-frontend.cjs
CHANGED
|
@@ -249,7 +249,7 @@ const safeJSON = (text) => {
|
|
|
249
249
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
250
250
|
const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
251
251
|
|
|
252
|
-
const VERSION = '5.
|
|
252
|
+
const VERSION = '5.12.0'; // x-release-please-version
|
|
253
253
|
|
|
254
254
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
255
255
|
const isRunningInBrowser = () => {
|
|
@@ -1104,11 +1104,7 @@ class Stream {
|
|
|
1104
1104
|
done = true;
|
|
1105
1105
|
continue;
|
|
1106
1106
|
}
|
|
1107
|
-
if (sse.event === null ||
|
|
1108
|
-
sse.event.startsWith('response.') ||
|
|
1109
|
-
sse.event.startsWith('image_edit.') ||
|
|
1110
|
-
sse.event.startsWith('image_generation.') ||
|
|
1111
|
-
sse.event.startsWith('transcript.')) {
|
|
1107
|
+
if (sse.event === null || !sse.event.startsWith('thread.')) {
|
|
1112
1108
|
let data;
|
|
1113
1109
|
try {
|
|
1114
1110
|
data = JSON.parse(sse.data);
|
|
@@ -13997,11 +13993,9 @@ class AlpacaMarketDataAPI extends require$$0$3.EventEmitter {
|
|
|
13997
13993
|
hasMorePages = !!pageToken;
|
|
13998
13994
|
// Enhanced logging with date range and progress info
|
|
13999
13995
|
const dateRangeStr = earliestTimestamp && latestTimestamp
|
|
14000
|
-
? `${earliestTimestamp.toLocaleDateString('en-US', { timeZone: 'America/New_York' })} to ${latestTimestamp.toLocaleDateString('en-US', { timeZone: 'America/New_York' })}`
|
|
13996
|
+
? `${new Date(earliestTimestamp).toLocaleDateString('en-US', { timeZone: 'America/New_York' })} to ${new Date(latestTimestamp).toLocaleDateString('en-US', { timeZone: 'America/New_York' })}`
|
|
14001
13997
|
: 'unknown range';
|
|
14002
|
-
log(`Page ${pageCount}: Fetched ${pageBarsCount.toLocaleString()} bars (total: ${totalBarsCount.toLocaleString()}) for ${
|
|
14003
|
-
type: 'info',
|
|
14004
|
-
});
|
|
13998
|
+
log(`Page ${pageCount}: Fetched ${pageBarsCount.toLocaleString()} bars (total: ${totalBarsCount.toLocaleString()}) for ${symbols.length} symbols, date range: ${dateRangeStr}${hasMorePages ? ', more pages available' : ', complete'}`);
|
|
14005
13999
|
// Prevent infinite loops
|
|
14006
14000
|
if (pageCount > 1000) {
|
|
14007
14001
|
log(`Stopping pagination after ${pageCount} pages to prevent infinite loop`, { type: 'warn' });
|
|
@@ -14009,12 +14003,10 @@ class AlpacaMarketDataAPI extends require$$0$3.EventEmitter {
|
|
|
14009
14003
|
}
|
|
14010
14004
|
}
|
|
14011
14005
|
// Final summary
|
|
14012
|
-
const
|
|
14006
|
+
const symbolsJoined = Object.entries(allBars)
|
|
14013
14007
|
.map(([symbol, bars]) => `${symbol}: ${bars.length}`)
|
|
14014
14008
|
.join(', ');
|
|
14015
|
-
log(`Historical bars fetch complete: ${totalBarsCount.toLocaleString()} total bars across ${pageCount} pages
|
|
14016
|
-
type: 'info',
|
|
14017
|
-
});
|
|
14009
|
+
log(`Historical bars fetch complete: ${totalBarsCount.toLocaleString()} total bars across ${pageCount} pages for ${symbolsJoined.length} symbols'}`);
|
|
14018
14010
|
return {
|
|
14019
14011
|
bars: allBars,
|
|
14020
14012
|
next_page_token: null, // Always null since we fetch all pages
|
|
@@ -15313,6 +15305,10 @@ class AlpacaTradingAPI {
|
|
|
15313
15305
|
queryParams.append('period', params.period);
|
|
15314
15306
|
if (params.extended_hours !== undefined)
|
|
15315
15307
|
queryParams.append('extended_hours', params.extended_hours.toString());
|
|
15308
|
+
if (params.start)
|
|
15309
|
+
queryParams.append('start', params.start);
|
|
15310
|
+
if (params.end)
|
|
15311
|
+
queryParams.append('end', params.end);
|
|
15316
15312
|
if (params.date_end)
|
|
15317
15313
|
queryParams.append('date_end', params.date_end);
|
|
15318
15314
|
const response = await this.makeRequest(`/account/portfolio/history?${queryParams.toString()}`);
|