@gloom-sh/terminal 0.20.16 → 0.20.17
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/package.json +1 -1
- package/src/api-client/data.ts +13 -3
- package/src/api-client/types/econ.ts +3 -0
- package/src/cli/commands/fred-series.ts +3 -1
- package/src/cli/commands/overview.ts +65 -13
- package/src/cli/csv-export.ts +73 -0
- package/src/cli/desktop-pane-shot.ts +3 -2
- package/src/cli/help.ts +4 -2
- package/src/cli/pane-functions/headless.ts +7 -2
- package/src/cli/pane-functions/index.ts +2 -2
- package/src/cli/pane-functions/screenshot-bridge.ts +4 -2
- package/src/cli/report-tables.ts +17 -3
- package/src/cli/result.ts +3 -6
- package/src/components/chart/composite/legend.tsx +37 -7
- package/src/components/ui/data-table/display-columns.ts +4 -1
- package/src/components/ui/data-table/hooks.ts +2 -3
- package/src/components/ui/data-table/index.tsx +4 -1
- package/src/components/ui/data-table/types.ts +11 -4
- package/src/components/ui/data-table/visible-range.ts +11 -1
- package/src/plugins/builtin/awards/pane.tsx +6 -2
- package/src/plugins/builtin/chart-composer/pane.tsx +4 -1
- package/src/plugins/builtin/credit-conditions/series.ts +2 -2
- package/src/plugins/builtin/earnings/board-model.ts +12 -0
- package/src/plugins/builtin/earnings/board-table.ts +7 -4
- package/src/plugins/builtin/earnings/board.tsx +2 -2
- package/src/plugins/builtin/earnings/highlight.ts +1 -1
- package/src/plugins/builtin/econ/calendar-model.ts +2 -0
- package/src/plugins/builtin/econ/fred-catalog.ts +1 -256
- package/src/plugins/builtin/econ-statistics/cache.ts +1 -1
- package/src/plugins/builtin/econ-statistics/client.ts +11 -10
- package/src/plugins/builtin/econ-statistics/detail.tsx +1 -0
- package/src/plugins/builtin/econ-statistics/headless.ts +42 -6
- package/src/plugins/builtin/econ-statistics/index.tsx +1 -0
- package/src/plugins/builtin/econ-statistics/pane.tsx +7 -2
- package/src/plugins/builtin/econ-statistics/stats.ts +2 -1
- package/src/plugins/builtin/econ-statistics/view.ts +9 -3
- package/src/plugins/builtin/shared/fred-catalog.ts +256 -0
- package/src/plugins/builtin/shared/series-cache.ts +3 -0
- package/src/plugins/builtin/shared/series-detail-chart.tsx +3 -0
- package/src/plugins/builtin/short-interest/watch-pane.tsx +7 -7
- package/src/plugins/builtin/ticker-detail/adr-pair/model.ts +16 -0
- package/src/plugins/builtin/ticker-detail/adr-pair/tab.tsx +8 -4
- package/src/plugins/builtin/time-sales/headless.ts +4 -1
- package/src/plugins/builtin/time-sales/pane.tsx +2 -0
- package/src/plugins/builtin/time-sales/window.ts +12 -0
- package/src/plugins/builtin/treasury-auctions/client.ts +4 -0
- package/src/plugins/builtin/treasury-auctions/treasury-direct.ts +2 -0
- package/src/plugins/builtin/treasury-daily/client.ts +23 -11
- package/src/renderers/electrobun/view/cli-pane-shot-entry.tsx +2 -0
- package/src/sources/gloomberb-cloud/fred-publisher.ts +25 -0
- package/src/sources/gloomberb-cloud/fred-series.ts +1 -1
- package/src/time-series/base-series.ts +3 -0
- package/src/time-series/ice-credit.ts +1 -0
- package/src/time-series/types.ts +1 -0
- package/src/types/headless.ts +4 -2
- package/src/utils/throttled-fetch.ts +15 -1
|
@@ -52,6 +52,7 @@ export function unloadableSeries(spec: ChartSeriesSpec, index: number, warning:
|
|
|
52
52
|
return {
|
|
53
53
|
id: spec.id,
|
|
54
54
|
label: spec.label?.trim() || label,
|
|
55
|
+
legendContext: spec.label?.trim() ? undefined : field?.seriesLabel ?? field?.shortLabel,
|
|
55
56
|
color: spec.color ?? SERIES_COLORS[index % SERIES_COLORS.length]!,
|
|
56
57
|
unit: field?.unit ?? "",
|
|
57
58
|
unitGroup: field?.unitGroup ?? "unknown",
|
|
@@ -242,6 +243,8 @@ export function baseSecuritySeries(
|
|
|
242
243
|
id: spec.id,
|
|
243
244
|
label: spec.label?.trim() || (generic ? futuresGenericCaption(generic)
|
|
244
245
|
: `${symbol} ${field.id === "market.volume" && volumeBasis ? INDEX_MEMBERS_VOLUME_LABEL : field.seriesLabel ?? field.shortLabel}`),
|
|
246
|
+
legendContext: spec.label?.trim() || generic ? undefined
|
|
247
|
+
: field.id === "market.volume" && volumeBasis ? INDEX_MEMBERS_VOLUME_LABEL : field.seriesLabel ?? field.shortLabel,
|
|
245
248
|
color: spec.color ?? SERIES_COLORS[index % SERIES_COLORS.length]!,
|
|
246
249
|
unit,
|
|
247
250
|
unitGroup: currencyUnitGroup,
|
|
@@ -22,6 +22,7 @@ export interface IceCreditSeries {
|
|
|
22
22
|
|
|
23
23
|
/** What every surface that shows an ICE series says about how far back FRED carries it. */
|
|
24
24
|
export const ICE_HISTORY_LIMIT_NOTICE = "History limited to 3 years by the publisher.";
|
|
25
|
+
export const ICE_CREDIT_PUBLISHER = "ICE Data Indices";
|
|
25
26
|
|
|
26
27
|
const HIGH_YIELD = ["high yield", "junk"];
|
|
27
28
|
const EMERGING = ["EM", "emerging markets"];
|
package/src/time-series/types.ts
CHANGED
|
@@ -217,6 +217,7 @@ export interface ResolvedSeries {
|
|
|
217
217
|
* "8058 Close · M..." and "8031 Close · M...".
|
|
218
218
|
*/
|
|
219
219
|
compactLabel?: string;
|
|
220
|
+
legendContext?: string;
|
|
220
221
|
color: string;
|
|
221
222
|
unit: string;
|
|
222
223
|
/** Unit of rawValue, retained when presentation transforms change unit. */
|
package/src/types/headless.ts
CHANGED
|
@@ -643,6 +643,7 @@ export type HeadlessBundleSection =
|
|
|
643
643
|
* lists them all.
|
|
644
644
|
*/
|
|
645
645
|
rowSourceKey?: string;
|
|
646
|
+
appendedColumns?: number;
|
|
646
647
|
/** The symbol every row is of, where the report's own is not (a section per name): each exported row names it in `symbol_or_series`. */
|
|
647
648
|
symbol?: string;
|
|
648
649
|
/** When every row was observed (an ISO date or instant), where it is not the report's newest: each exported row names it in `as_of`. */
|
|
@@ -661,6 +662,7 @@ export type HeadlessBundleSection =
|
|
|
661
662
|
| {
|
|
662
663
|
title: string;
|
|
663
664
|
entries: HeadlessPaneEntry[];
|
|
665
|
+
source?: string;
|
|
664
666
|
/**
|
|
665
667
|
* The lines the text report prints in place of `entries`, when the pane
|
|
666
668
|
* says in one line what the exported records keep apart (a range as
|
|
@@ -683,9 +685,9 @@ export type HeadlessBundleSection =
|
|
|
683
685
|
rows?: never;
|
|
684
686
|
textColumns?: never;
|
|
685
687
|
textRows?: never;
|
|
686
|
-
unit?:
|
|
688
|
+
unit?: string;
|
|
687
689
|
rowUnitKey?: never;
|
|
688
|
-
interval?:
|
|
690
|
+
interval?: string;
|
|
689
691
|
rowIntervalKey?: never;
|
|
690
692
|
rowSourceKey?: never;
|
|
691
693
|
locked?: never;
|
|
@@ -31,6 +31,14 @@ export interface ThrottledFetchOptions {
|
|
|
31
31
|
* rate-limited feed cannot hold its callers for that long. Default: 10000
|
|
32
32
|
*/
|
|
33
33
|
maxRetryWaitMs?: number;
|
|
34
|
+
/**
|
|
35
|
+
* Whether an attempt that ran out its `timeoutMs` is tried again (default
|
|
36
|
+
* true). Off for a host that stalls rather than blips: one that has not
|
|
37
|
+
* answered in the timeout does not on the retry either, and the caller's
|
|
38
|
+
* fallback (another source, a saved copy) should not wait out every attempt.
|
|
39
|
+
* Network errors, 429s and 5xx answers are retried either way.
|
|
40
|
+
*/
|
|
41
|
+
retryTimeouts?: boolean;
|
|
34
42
|
/** Default headers applied to every request */
|
|
35
43
|
defaultHeaders?: Record<string, string>;
|
|
36
44
|
/** Share concurrent GET requests to the same URL. Default: true */
|
|
@@ -58,6 +66,7 @@ export function createThrottledFetch(
|
|
|
58
66
|
const timeoutMs = options.timeoutMs ?? DEFAULT_TIMEOUT_MS;
|
|
59
67
|
const backoffBaseMs = options.backoffBaseMs ?? BACKOFF_BASE_MS;
|
|
60
68
|
const maxRetryWaitMs = options.maxRetryWaitMs ?? DEFAULT_MAX_RETRY_WAIT_MS;
|
|
69
|
+
const retryTimeouts = options.retryTimeouts ?? true;
|
|
61
70
|
const defaultHeaders = options.defaultHeaders ?? {};
|
|
62
71
|
const dedupeGetRequests = options.dedupeGetRequests ?? true;
|
|
63
72
|
const fetchTransport =
|
|
@@ -129,6 +138,11 @@ export function createThrottledFetch(
|
|
|
129
138
|
);
|
|
130
139
|
}
|
|
131
140
|
|
|
141
|
+
/** The attempt's own timeout (the caller's abort has been ruled out by then). */
|
|
142
|
+
function isTimeoutError(error: unknown): boolean {
|
|
143
|
+
return error instanceof Error && (error.name === "TimeoutError" || error.name === "AbortError");
|
|
144
|
+
}
|
|
145
|
+
|
|
132
146
|
function abortReason(signal: AbortSignal): unknown {
|
|
133
147
|
return signal.reason ?? abortError("The operation was aborted.");
|
|
134
148
|
}
|
|
@@ -188,7 +202,7 @@ export function createThrottledFetch(
|
|
|
188
202
|
resp = await fetchTransport(url, mergedInit);
|
|
189
203
|
} catch (error) {
|
|
190
204
|
throwIfAborted(callerSignal);
|
|
191
|
-
if (retriesLeft > 0 && isRetryableFetchError(error)) {
|
|
205
|
+
if (retriesLeft > 0 && isRetryableFetchError(error) && (retryTimeouts || !isTimeoutError(error))) {
|
|
192
206
|
await wait(getBackoffMs(retriesLeft), callerSignal);
|
|
193
207
|
return executeRequest(url, init, retriesLeft - 1);
|
|
194
208
|
}
|