gloomberb 0.20.5 → 0.20.7
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/README.md +1 -1
- package/README.zh-CN.md +1 -1
- package/package.json +2 -1
- package/src/api-client/data.ts +10 -2
- package/src/api-client/fund-facts.ts +20 -4
- package/src/api-client/hk-tenders.ts +59 -0
- package/src/api-client/index.ts +1 -0
- package/src/api-client/socket.ts +4 -4
- package/src/api-client/types/econ.ts +20 -2
- package/src/app.tsx +18 -13
- package/src/architecture/floating-promise-allowlist.json +313 -0
- package/src/architecture/shortcut-labels-allowlist.json +1 -0
- package/src/cli/commands/market.ts +197 -57
- package/src/cli/commands/news-search.ts +22 -7
- package/src/cli/commands/overview.ts +12 -6
- package/src/cli/commands/search.ts +19 -3
- package/src/cli/commands/ticker.ts +3 -1
- package/src/cli/desktop-pane-shot.ts +61 -0
- package/src/cli/early-command.ts +2 -0
- package/src/cli/errors.ts +10 -1
- package/src/cli/fx-forward.ts +76 -12
- package/src/cli/fx-pair.ts +1 -1
- package/src/cli/fx-quote-rate.ts +23 -0
- package/src/cli/help.ts +1 -0
- package/src/cli/index-roots.ts +5 -4
- package/src/cli/index.ts +40 -3
- package/src/cli/known-gaps.ts +11 -8
- package/src/cli/listing-arg.ts +6 -4
- package/src/cli/options.ts +52 -3
- package/src/cli/output-file.ts +5 -3
- package/src/cli/pane-functions/catalog.ts +15 -0
- package/src/cli/pane-functions/dom.ts +4 -4
- package/src/cli/pane-functions/freshness.ts +38 -5
- package/src/cli/pane-functions/function-help.ts +4 -4
- package/src/cli/pane-functions/headless.ts +9 -4
- package/src/cli/pane-functions/index.ts +6 -4
- package/src/cli/pane-functions/resolver.ts +2 -2
- package/src/cli/pane-functions/screenshot-assessment.ts +16 -4
- package/src/cli/quote-answer.ts +57 -1
- package/src/cli/result.ts +38 -2
- package/src/cli/spreadsheet-hint.ts +7 -3
- package/src/cli/treasury-yields.ts +5 -3
- package/src/components/chart/composite/legend.tsx +40 -2
- package/src/components/command-bar/workflow/tickers.ts +2 -2
- package/src/components/data-table/view.tsx +9 -2
- package/src/components/ui/data-table/opentui/index.tsx +11 -4
- package/src/components/ui/data-table/opentui/model.ts +8 -6
- package/src/components/ui/data-table/types.ts +6 -1
- package/src/components/ui/table-layout.ts +38 -1
- package/src/docs/snapshot.json +58 -19
- package/src/i18n/es.ts +2 -0
- package/src/i18n/ja.ts +2 -0
- package/src/i18n/ko.ts +2 -0
- package/src/i18n/zh-cn.ts +2 -0
- package/src/i18n/zh-tw.ts +2 -0
- package/src/market-data/market/change-basis.ts +57 -12
- package/src/market-data/market/dated-previous-close.ts +184 -10
- package/src/market-data/market/freshness.ts +18 -6
- package/src/market-data/market/status.ts +9 -1
- package/src/market-data/published-nse-sessions.ts +16 -1
- package/src/market-data/quotes/contributions.ts +2 -0
- package/src/market-data/quotes/freshness.ts +15 -0
- package/src/market-data/quotes/listing-enterprise-value.ts +50 -0
- package/src/plugins/builtin/alerts/alert-engine.ts +15 -0
- package/src/plugins/builtin/alerts/cli.ts +22 -9
- package/src/plugins/builtin/alerts/headless.ts +1 -1
- package/src/plugins/builtin/alerts/index.tsx +5 -1
- package/src/plugins/builtin/alerts/metric-command.ts +1 -1
- package/src/plugins/builtin/alerts/metric-data.ts +15 -2
- package/src/plugins/builtin/backtest/headless.ts +1 -1
- package/src/plugins/builtin/cds/model.ts +0 -6
- package/src/plugins/builtin/chart-composer/formula.ts +16 -3
- package/src/plugins/builtin/chart-composer/headless-schema.ts +2 -0
- package/src/plugins/builtin/chart-composer/headless.ts +2 -1
- package/src/plugins/builtin/chart-composer/presets.ts +1 -0
- package/src/plugins/builtin/cloud/askg/pane.tsx +55 -13
- package/src/plugins/builtin/credit-boards/cdx-pane.tsx +20 -7
- package/src/plugins/builtin/credit-boards/client.ts +8 -0
- package/src/plugins/builtin/credit-boards/headless.ts +4 -1
- package/src/plugins/builtin/credit-boards/model.ts +58 -4
- package/src/plugins/builtin/credit-boards/series.ts +63 -6
- package/src/plugins/builtin/credit-boards/sovr-pane.tsx +3 -2
- package/src/plugins/builtin/credit-conditions/headless.ts +24 -6
- package/src/plugins/builtin/credit-conditions/index.tsx +1 -1
- package/src/plugins/builtin/credit-conditions/model.ts +12 -6
- package/src/plugins/builtin/credit-conditions/series.ts +2 -1
- package/src/plugins/builtin/econ/calendar-model.ts +41 -7
- package/src/plugins/builtin/econ/calendar-source.ts +7 -1
- package/src/plugins/builtin/econ/index.tsx +41 -8
- package/src/plugins/builtin/econ/types.ts +3 -0
- package/src/plugins/builtin/fixed-income/index.tsx +2 -0
- package/src/plugins/builtin/fx-matrix/index.tsx +44 -14
- package/src/plugins/builtin/help/keybindings-editor.tsx +6 -2
- package/src/plugins/builtin/holders/fund-holders.ts +22 -1
- package/src/plugins/builtin/holders/headless.ts +5 -4
- package/src/plugins/builtin/holders/pane.tsx +7 -3
- package/src/plugins/builtin/holders/report-header.ts +23 -0
- package/src/plugins/builtin/members/client.ts +1 -1
- package/src/plugins/builtin/members/headless.ts +2 -0
- package/src/plugins/builtin/members/model.ts +10 -8
- package/src/plugins/builtin/members/pane.tsx +4 -1
- package/src/plugins/builtin/portfolio-list/cli/portfolio-command.ts +5 -2
- package/src/plugins/builtin/portfolio-list/cli/render.ts +86 -26
- package/src/plugins/builtin/portfolio-list/cli/watchlist-command.ts +5 -1
- package/src/plugins/builtin/portfolio-list/headless.ts +2 -1
- package/src/plugins/builtin/portfolio-list/income.ts +46 -22
- package/src/plugins/builtin/portfolio-list/pane/data.ts +16 -6
- package/src/plugins/builtin/portfolio-list/pane/index.tsx +5 -4
- package/src/plugins/builtin/portfolio-list/use-throttled-ticker-order.ts +40 -3
- package/src/plugins/builtin/research/headless-schema.ts +4 -3
- package/src/plugins/builtin/research/relative-valuation-columns.ts +145 -47
- package/src/plugins/builtin/research/relative-valuation-currency.ts +31 -0
- package/src/plugins/builtin/research/relative-valuation-headless.ts +25 -8
- package/src/plugins/builtin/research/relative-valuation-model.ts +40 -9
- package/src/plugins/builtin/research/relative-valuation-pane.tsx +3 -2
- package/src/plugins/builtin/research/relative-valuation-peers.ts +2 -2
- package/src/plugins/builtin/sec/fund-facts.ts +25 -5
- package/src/plugins/builtin/shared/report-freshness.ts +15 -6
- package/src/plugins/builtin/supply-chain/model.ts +18 -6
- package/src/plugins/builtin/thirteenf/api.ts +47 -4
- package/src/plugins/builtin/ticker-detail/data-panes/historical-prices.tsx +8 -7
- package/src/plugins/builtin/ticker-detail/data-panes/history-bars.ts +8 -5
- package/src/plugins/builtin/ticker-detail/financials/model.ts +6 -2
- package/src/plugins/builtin/ticker-detail/financials/tab.tsx +1 -1
- package/src/plugins/builtin/ticker-detail/headless.ts +6 -4
- package/src/plugins/builtin/treasury-auctions/cache.ts +36 -2
- package/src/plugins/builtin/treasury-auctions/headless.ts +42 -4
- package/src/plugins/builtin/treasury-auctions/hk-headless.ts +126 -0
- package/src/plugins/builtin/treasury-auctions/hk-view.tsx +347 -0
- package/src/plugins/builtin/treasury-auctions/hk.ts +363 -0
- package/src/plugins/builtin/treasury-auctions/index.tsx +14 -1
- package/src/plugins/builtin/treasury-auctions/model.ts +16 -8
- package/src/plugins/builtin/treasury-auctions/pane.tsx +45 -21
- package/src/portfolio/collection-name.ts +22 -0
- package/src/portfolio/column-values.ts +3 -0
- package/src/portfolio/valuation-basis.ts +23 -1
- package/src/renderers/dom/data-table/frozen-column.ts +3 -1
- package/src/renderers/dom/data-table/index.tsx +27 -9
- package/src/renderers/dom/data-table/row.tsx +2 -0
- package/src/renderers/electrobun/bun/desktop/backend.ts +27 -24
- package/src/renderers/electrobun/bun/desktop/detached-windows.ts +3 -3
- package/src/renderers/electrobun/bun/desktop/snapshot-commit.ts +77 -0
- package/src/renderers/electrobun/shared/protocol.ts +4 -0
- package/src/renderers/electrobun/view/backend-rpc.ts +3 -0
- package/src/renderers/electrobun/view/desktop/window/bridge.ts +3 -0
- package/src/sources/gloomberb-cloud/normalizers.ts +9 -5
- package/src/sources/provider-router/cache.ts +3 -1
- package/src/state/hooks/quote-streaming.ts +14 -6
- package/src/sync/controller.ts +17 -2
- package/src/sync/other-window-tabs.ts +32 -1
- package/src/sync/react.ts +4 -4
- package/src/tickers/instrument-kind.ts +22 -1
- package/src/tickers/search/index.ts +5 -0
- package/src/tickers/terminal-codes.ts +17 -5
- package/src/time-series/bar-spacing.ts +33 -0
- package/src/time-series/base-series.ts +21 -3
- package/src/time-series/chart-bounds.ts +31 -0
- package/src/time-series/field-catalog.ts +17 -0
- package/src/time-series/fundamentals/current-valuation.ts +244 -0
- package/src/time-series/fundamentals/historical-valuation.ts +99 -0
- package/src/time-series/fundamentals/metric-ids.ts +61 -0
- package/src/time-series/fundamentals/period-points.ts +104 -0
- package/src/time-series/fundamentals/quarterly-ttm.ts +220 -0
- package/src/time-series/fundamentals/series.ts +164 -0
- package/src/time-series/fundamentals/source-statements.ts +177 -0
- package/src/time-series/fundamentals/statement-fields.ts +154 -0
- package/src/time-series/fundamentals/statement-merge.ts +124 -0
- package/src/time-series/fundamentals/statement.ts +114 -0
- package/src/time-series/fundamentals/valuation-multiples.ts +50 -0
- package/src/time-series/fundamentals.ts +18 -1275
- package/src/time-series/ice-credit.ts +32 -6
- package/src/time-series/resolve.ts +9 -5
- package/src/time-series/session-bar.ts +78 -9
- package/src/time-series/studies/formula.ts +53 -10
- package/src/time-series/studies/pair.ts +18 -7
- package/src/time-series/studies/units.ts +49 -2
- package/src/time-series/types.ts +12 -0
- package/src/types/desktop-window.ts +2 -0
- package/src/types/financials.ts +15 -0
- package/src/types/headless.ts +8 -0
- package/src/utils/cli-output.ts +6 -3
- package/src/utils/debug-log.ts +29 -0
- package/src/utils/ebitda.ts +128 -0
- package/src/utils/format.ts +1 -1
- package/src/utils/shell-word.ts +13 -0
package/README.md
CHANGED
|
@@ -67,6 +67,6 @@ Crash reports and usage counts can be turned off: [what is sent](docs/telemetry.
|
|
|
67
67
|
|
|
68
68
|
## Plugins and contributing
|
|
69
69
|
|
|
70
|
-
Plugins add panes, data sources, brokers and commands. Install one from GitHub with `gloom install gloom-sh/gloom-tv`, or build your own with the [plugin guide](PLUGINS.md#your-first-pane). To work on Gloom itself, read [CONTRIBUTING.md](CONTRIBUTING.md).
|
|
70
|
+
Plugins add panes, data sources, brokers and commands. Install one from GitHub with `gloom install gloom-sh/gloom-tv`, or build your own with the [plugin guide](PLUGINS.md#your-first-pane). To work on Gloom itself, clone it with `git clone --filter=blob:none https://github.com/gloom-sh/gloomberb.git` and read [CONTRIBUTING.md](CONTRIBUTING.md).
|
|
71
71
|
|
|
72
72
|
[MIT licensed](LICENSE). Built with [OpenTUI](https://opentui.com/). [Sponsor Gloom](https://gloom.sh/sponsor).
|
package/README.zh-CN.md
CHANGED
|
@@ -67,6 +67,6 @@ bun install -g @gloom-sh/terminal
|
|
|
67
67
|
|
|
68
68
|
## 插件与贡献
|
|
69
69
|
|
|
70
|
-
插件可添加面板、数据源、券商连接与命令。用 `gloom install gloom-sh/gloom-tv` 从 GitHub 安装插件,或参考[插件开发指南(英文)](PLUGINS.md#your-first-pane)自己编写。参与 Gloom
|
|
70
|
+
插件可添加面板、数据源、券商连接与命令。用 `gloom install gloom-sh/gloom-tv` 从 GitHub 安装插件,或参考[插件开发指南(英文)](PLUGINS.md#your-first-pane)自己编写。参与 Gloom 开发,请用 `git clone --filter=blob:none https://github.com/gloom-sh/gloomberb.git` 克隆源码,并阅读[贡献指南(英文)](CONTRIBUTING.md)。
|
|
71
71
|
|
|
72
72
|
采用 [MIT 许可证](LICENSE)。基于 [OpenTUI](https://opentui.com/) 构建。[赞助 Gloom](https://gloom.sh/sponsor)。
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gloomberb",
|
|
3
|
-
"version": "0.20.
|
|
3
|
+
"version": "0.20.7",
|
|
4
4
|
"packageManager": "bun@1.3.14",
|
|
5
5
|
"description": "Market research and portfolio tracker for the terminal",
|
|
6
6
|
"module": "src/public/index.ts",
|
|
@@ -88,6 +88,7 @@
|
|
|
88
88
|
"benchmark:tui:compare": "bun run scripts/benchmark-tui-compare.ts",
|
|
89
89
|
"benchmark:tui:memory": "bun run scripts/benchmark-tui-memory.ts",
|
|
90
90
|
"benchmark:startup": "bun run scripts/benchmark-startup.ts",
|
|
91
|
+
"check:floating-promises": "bun run scripts/update-floating-promise-allowlist.ts --check",
|
|
91
92
|
"check:pane-chrome": "bun run scripts/pane-chrome/checks.ts",
|
|
92
93
|
"check:chat-mentions": "bun scripts/pane-chrome/chat-mentions.ts",
|
|
93
94
|
"check:pane-screenshot": "bun run scripts/pane-chrome/screenshot.ts",
|
package/src/api-client/data.ts
CHANGED
|
@@ -36,6 +36,7 @@ import type { BitcoinNetworkPayload, CryptoMarketsPayload, DefiTvlPayload, Stabl
|
|
|
36
36
|
import type { CryptoEtfFlowAsset, CryptoEtfFlowsPayload } from "./crypto-etf-flows";
|
|
37
37
|
import type { CentralBankRatesPayload } from "./central-bank-rates";
|
|
38
38
|
import type { FxInterventionsPayload } from "./fx-interventions";
|
|
39
|
+
import type { HkTendersPayload } from "./hk-tenders";
|
|
39
40
|
import type { EstimateRevisionsPayload } from "./estimate-revisions";
|
|
40
41
|
import type { MoneyMarketsPayload } from "./money-markets";
|
|
41
42
|
import type { CloudCurveHistory, CloudCurveId, CloudCurveView, CloudWorldCurves } from "./yield-curves";
|
|
@@ -149,6 +150,7 @@ import type {
|
|
|
149
150
|
CloudRiskReportPayload,
|
|
150
151
|
CloudCorporateActionsPayload,
|
|
151
152
|
CloudEconEventPayload,
|
|
153
|
+
CloudEconCalendarFromPayload,
|
|
152
154
|
CloudShortRatesPayload,
|
|
153
155
|
CloudMacroReleaseDaysPayload,
|
|
154
156
|
CloudEquityDiagnosticMode,
|
|
@@ -828,8 +830,8 @@ export class CloudDataApi {
|
|
|
828
830
|
}
|
|
829
831
|
|
|
830
832
|
/** The calendar from a UTC day, past events included, and the first day the stored calendar holds. */
|
|
831
|
-
async getCloudEconomicCalendarFrom(from: string): Promise<
|
|
832
|
-
return this.request<
|
|
833
|
+
async getCloudEconomicCalendarFrom(from: string): Promise<CloudEconCalendarFromPayload> {
|
|
834
|
+
return this.request<CloudEconCalendarFromPayload>(`/cloud/econ/calendar/history?from=${encodeURIComponent(from)}`);
|
|
833
835
|
}
|
|
834
836
|
|
|
835
837
|
/** Each currency's short rate and its day, for forwards implied by covered interest parity. */
|
|
@@ -1198,6 +1200,12 @@ export class CloudDataApi {
|
|
|
1198
1200
|
return this.request<FxInterventionsPayload>("/cloud/econ/fx-interventions", { signal: signalWithTimeout(signal, 20_000) });
|
|
1199
1201
|
}
|
|
1200
1202
|
|
|
1203
|
+
/** Hong Kong government paper tender results from HKMA's Open API, issued on or after `from` (YYYY-MM-DD), at most `limit`. */
|
|
1204
|
+
async getCloudHkTenders(from: string, limit: number, signal?: AbortSignal): Promise<HkTendersPayload> {
|
|
1205
|
+
const query = new URLSearchParams({ from, limit: String(limit) });
|
|
1206
|
+
return this.request<HkTendersPayload>(`/cloud/econ/hk-tenders?${query}`, { signal: signalWithTimeout(signal, 20_000) });
|
|
1207
|
+
}
|
|
1208
|
+
|
|
1201
1209
|
/** A live scan's matches against Gloom Cloud's newest market-wide snapshot for this account's tier. */
|
|
1202
1210
|
getLiveScan(definition: LiveScanWireDefinition, signal?: AbortSignal) {
|
|
1203
1211
|
return this.request<LiveScanPayload>(LIVE_SCAN_PATH, {
|
|
@@ -99,6 +99,16 @@ export interface FundFlows {
|
|
|
99
99
|
*/
|
|
100
100
|
type FundFactsStatus = "covered" | "not-collected-yet" | "not-published" | "not-a-fund";
|
|
101
101
|
|
|
102
|
+
/**
|
|
103
|
+
* What a counter's computed premium is from when its own close is nominal:
|
|
104
|
+
* another counter's traded close (`3042:HKEX` at HK$9.18) converted at the
|
|
105
|
+
* rate between the two counters' NAVs, or the nominal close itself when no
|
|
106
|
+
* counter traded.
|
|
107
|
+
*/
|
|
108
|
+
type FundPremiumPrice =
|
|
109
|
+
| { kind: "counter"; ticker: string; close: number; currency: string }
|
|
110
|
+
| { kind: "nominal" };
|
|
111
|
+
|
|
102
112
|
/** GET /cloud/fund-facts/:ticker. Percent fields are in percent (0.03 is 0.03%). */
|
|
103
113
|
export interface FundFactsPayload {
|
|
104
114
|
ticker: string;
|
|
@@ -120,14 +130,20 @@ export interface FundFactsPayload {
|
|
|
120
130
|
nav: (FundFact<number> & { period?: "day" | "month-end"; estimate?: { low: number; high: number } }) | null;
|
|
121
131
|
/** Why a covered fund has no NAV, in one line. Absent when it has one, and from servers before it. */
|
|
122
132
|
navReason?: string;
|
|
123
|
-
/**
|
|
124
|
-
|
|
133
|
+
/**
|
|
134
|
+
* Dated by its own session: a month end on a weekend is priced at the Friday
|
|
135
|
+
* before it. `nominal`: nothing traded in that session (a Hong Kong fund's
|
|
136
|
+
* USD or RMB counter on a quiet day), so the close is the exchange's
|
|
137
|
+
* nominal price; absent from servers before it.
|
|
138
|
+
*/
|
|
139
|
+
closingPrice: (FundFact<number> & { nominal?: true }) | null;
|
|
125
140
|
/**
|
|
126
141
|
* `published` by the sponsor, or `computed` from the closing price against
|
|
127
142
|
* the NAV, dated by the NAV. `estimate`: computed against the midpoint of a
|
|
128
|
-
* NAV estimate, so an estimate too; absent from servers before it.
|
|
143
|
+
* NAV estimate, so an estimate too; absent from servers before it. `price`:
|
|
144
|
+
* what a computed premium is from when not the closing price as traded.
|
|
129
145
|
*/
|
|
130
|
-
premiumDiscount: (FundFact<number> & { basis: "published" | "computed"; estimate?: true }) | null;
|
|
146
|
+
premiumDiscount: (FundFact<number> & { basis: "published" | "computed"; estimate?: true; price?: FundPremiumPrice }) | null;
|
|
131
147
|
/**
|
|
132
148
|
* `period`: a `day`'s figure, or the last `month-end`'s (Vanguard and ARK
|
|
133
149
|
* ETFs, N-PORT), which is not today's. `document`: the fund's N-PORT report
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/** EF Bills, EF Notes, an HKSAR institutional Government Bond, or its HONIA-indexed floating rate note. */
|
|
2
|
+
type HkTenderPaper = "efb" | "efn" | "hkgb" | "hkgb-frn";
|
|
3
|
+
|
|
4
|
+
/** One tender's result, as the Hong Kong Monetary Authority's Open API states it. */
|
|
5
|
+
export interface HkTender {
|
|
6
|
+
/** The issue day (YYYY-MM-DD), the business day after the tender; Government Bonds give only the month (YYYY-MM). */
|
|
7
|
+
date: string;
|
|
8
|
+
paper: HkTenderPaper;
|
|
9
|
+
/** A Government Bond's issue number (10GB3507001); HKMA's EF figures name none. */
|
|
10
|
+
issue: string | null;
|
|
11
|
+
/** A re-opening of an issue already outstanding; null for EF paper. */
|
|
12
|
+
reopening: boolean | null;
|
|
13
|
+
/** HKD, or CNH for an RMB Government Bond. */
|
|
14
|
+
currency: "HKD" | "CNH";
|
|
15
|
+
/** A Government Bond's expected maturity (YYYY-MM). */
|
|
16
|
+
maturity: string | null;
|
|
17
|
+
/** "3-Month" for a bill, "2-Year" for a note, a bond's original tenor by its issue number. */
|
|
18
|
+
term: string;
|
|
19
|
+
/** Annual coupon in percent; null for a bill or a floating rate note. */
|
|
20
|
+
coupon: number | null;
|
|
21
|
+
/** The average accepted yield in percent (an RMB bond's annualised one); null for a floating rate note. */
|
|
22
|
+
averageYield: number | null;
|
|
23
|
+
/** An RMB bond's average accepted yield, semi-annualised. */
|
|
24
|
+
averageYieldSemiAnnual: number | null;
|
|
25
|
+
/** A floating rate note's spread over HONIA, in percent. */
|
|
26
|
+
spread: number | null;
|
|
27
|
+
/** Applications, in units of `currency`. */
|
|
28
|
+
applied: number;
|
|
29
|
+
/** The amount allotted: stated for Government Bonds only. */
|
|
30
|
+
allotted: number | null;
|
|
31
|
+
/** EF paper: applications over the amount offered, less one. */
|
|
32
|
+
overSubscription: number | null;
|
|
33
|
+
/** Applications over the amount allotted (bonds) or offered (EF paper). */
|
|
34
|
+
bidToCover: number;
|
|
35
|
+
/** EF paper's amount offered, worked out from the amount applied and the over-subscription, to three figures. */
|
|
36
|
+
offered: number | null;
|
|
37
|
+
/** The HKMA dataset it came from: `efb-91day`, `hkgb-rmb`. */
|
|
38
|
+
dataset: string;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/** `GET /cloud/econ/hk-tenders`: Hong Kong government paper tender results from HKMA's Open API. */
|
|
42
|
+
export interface HkTendersPayload {
|
|
43
|
+
authority: string;
|
|
44
|
+
/** The attribution HKMA's terms ask for: "Source: HKMA". */
|
|
45
|
+
credit: string;
|
|
46
|
+
status: "available" | "unavailable";
|
|
47
|
+
/** Newest first, issued on or after `from`, at most `limit`. */
|
|
48
|
+
tenders: HkTender[];
|
|
49
|
+
from: string;
|
|
50
|
+
limit: number;
|
|
51
|
+
truncated: boolean;
|
|
52
|
+
/** The first and last issue the record holds. */
|
|
53
|
+
firstTender: string | null;
|
|
54
|
+
latestTender: string | null;
|
|
55
|
+
/** The newest issue HKMA's figures hold, per paper: HKMA publishes them monthly. */
|
|
56
|
+
runsTo: { efb: string | null; efn: string | null; hkgb: string | null };
|
|
57
|
+
fetchedAt: string | null;
|
|
58
|
+
stale: boolean;
|
|
59
|
+
}
|
package/src/api-client/index.ts
CHANGED
|
@@ -977,6 +977,7 @@ class GloomApiClient {
|
|
|
977
977
|
getCloudBitcoinNetwork = this.data.getCloudBitcoinNetwork.bind(this.data);
|
|
978
978
|
getCloudCentralBankRates = this.data.getCloudCentralBankRates.bind(this.data);
|
|
979
979
|
getCloudFxInterventions = this.data.getCloudFxInterventions.bind(this.data);
|
|
980
|
+
getCloudHkTenders = this.data.getCloudHkTenders.bind(this.data);
|
|
980
981
|
getMobileAlertHistory = this.data.getMobileAlertHistory.bind(this.data);
|
|
981
982
|
getScannerFlowHistory = this.data.getScannerFlowHistory.bind(this.data);
|
|
982
983
|
getScannerFlowSession = this.data.getScannerFlowSession.bind(this.data);
|
package/src/api-client/socket.ts
CHANGED
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
normalizeChatReactions,
|
|
20
20
|
normalizeTeamNotification,
|
|
21
21
|
} from "./normalizers";
|
|
22
|
-
import { debugLog } from "../utils/debug-log";
|
|
22
|
+
import { debugLog, previewList, previewLongLists } from "../utils/debug-log";
|
|
23
23
|
import { canonicalExchange, normalizeSymbol } from "../utils/exchanges";
|
|
24
24
|
import { mergeQuoteSubscriptionTargets } from "../market-data/quote-subscription-target";
|
|
25
25
|
import { recordServerClockSample } from "../market-data/quotes/clock";
|
|
@@ -520,7 +520,7 @@ export class CloudApiSocket {
|
|
|
520
520
|
if (subscriptionsToSend.length > 0) {
|
|
521
521
|
cloudApiLog.info("register quote listeners", {
|
|
522
522
|
count: subscriptionsToSend.length,
|
|
523
|
-
symbols: subscriptionsToSend
|
|
523
|
+
symbols: previewList(subscriptionsToSend, (target) =>
|
|
524
524
|
marketKey(target.symbol, target.exchange),
|
|
525
525
|
),
|
|
526
526
|
});
|
|
@@ -562,7 +562,7 @@ export class CloudApiSocket {
|
|
|
562
562
|
if (removedTargets.length > 0) {
|
|
563
563
|
cloudApiLog.info("remove quote listeners", {
|
|
564
564
|
count: removedTargets.length,
|
|
565
|
-
symbols: removedTargets
|
|
565
|
+
symbols: previewList(removedTargets, (target) =>
|
|
566
566
|
marketKey(target.symbol, target.exchange),
|
|
567
567
|
),
|
|
568
568
|
});
|
|
@@ -1062,7 +1062,7 @@ export class CloudApiSocket {
|
|
|
1062
1062
|
type === "scanner.subscribe" ||
|
|
1063
1063
|
type === "scanner.unsubscribe"
|
|
1064
1064
|
) {
|
|
1065
|
-
cloudApiLog.info("send websocket message", payload);
|
|
1065
|
+
cloudApiLog.info("send websocket message", previewLongLists(payload as Record<string, unknown>));
|
|
1066
1066
|
}
|
|
1067
1067
|
}
|
|
1068
1068
|
this.ws.send(JSON.stringify(payload));
|
|
@@ -35,6 +35,22 @@ export interface CloudEconEventPayload {
|
|
|
35
35
|
* forecast and on one kept before the read was recorded.
|
|
36
36
|
*/
|
|
37
37
|
consensus?: { source: string; readAt: string } | null;
|
|
38
|
+
/**
|
|
39
|
+
* A central bank's next decision listed past the end of the calendar's
|
|
40
|
+
* listing: no release is listed after `listedThrough`, the listing's last
|
|
41
|
+
* UTC day. Absent from an older server.
|
|
42
|
+
*/
|
|
43
|
+
pastListing?: boolean;
|
|
44
|
+
listedThrough?: string;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/** The calendar from a day, as GET /cloud/econ/calendar/history serves it. */
|
|
48
|
+
export interface CloudEconCalendarFromPayload {
|
|
49
|
+
events: CloudEconEventPayload[];
|
|
50
|
+
/** The first UTC day the stored calendar holds; null when it holds nothing. */
|
|
51
|
+
storedFrom: string | null;
|
|
52
|
+
/** The last UTC day the calendar lists releases for; absent from an older server. */
|
|
53
|
+
listedThrough?: string;
|
|
38
54
|
}
|
|
39
55
|
|
|
40
56
|
/** One currency's short-term rate, as GET /cloud/econ/short-rates serves it. */
|
|
@@ -50,9 +66,11 @@ export interface CloudShortRate {
|
|
|
50
66
|
/**
|
|
51
67
|
* "business-252": compounded over 252 business days a year (Brazil's CDI),
|
|
52
68
|
* grown as (1 + r)^(days / 365), business days taken as 252/365 of the
|
|
53
|
-
* calendar days.
|
|
69
|
+
* calendar days. "daily-365": compounded each calendar day on ACT/365
|
|
70
|
+
* (ZARONIA), grown as (1 + r / 365)^days. Absent: simple interest on
|
|
71
|
+
* `dayCountBasis`.
|
|
54
72
|
*/
|
|
55
|
-
compounding?: "business-252" | null;
|
|
73
|
+
compounding?: "business-252" | "daily-365" | null;
|
|
56
74
|
publisher: string;
|
|
57
75
|
sourceUrl: string;
|
|
58
76
|
/** Percent a year; null when it could not be read. */
|
package/src/app.tsx
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Box, ContextMenuProvider, useNativeRenderer, useRendererHost, useUiHost } from "./ui";
|
|
2
2
|
import { ToastViewport, useToastHost } from "./ui/toast";
|
|
3
|
-
import { useState, useEffect, useCallback, useRef, useMemo, useSyncExternalStore, type
|
|
3
|
+
import { useState, useEffect, useCallback, useRef, useMemo, useSyncExternalStore, type ReactNode } from "react";
|
|
4
4
|
import {
|
|
5
5
|
AppProvider,
|
|
6
6
|
getFocusedTickerSymbol,
|
|
@@ -9,7 +9,6 @@ import {
|
|
|
9
9
|
useAppStateRef,
|
|
10
10
|
type AppState,
|
|
11
11
|
} from "./state/app/context";
|
|
12
|
-
import type { AppAction } from "./core/state/app/state";
|
|
13
12
|
import { bindAppActivity, isAppVisible, subscribeAppVisibility, useAppActive, useAppVisible } from "./state/app/activity";
|
|
14
13
|
import { Header } from "./components/layout/header";
|
|
15
14
|
import { StatusBar } from "./components/layout/status-bar";
|
|
@@ -57,7 +56,7 @@ import { useAppUpdateRuntime } from "./app/runtime/update";
|
|
|
57
56
|
import { resolveUpdateChannel } from "./updater/channel";
|
|
58
57
|
import { createCoreSyncContributors } from "./sync/core-contributors";
|
|
59
58
|
import { useCloudSyncRuntime } from "./sync/react";
|
|
60
|
-
import {
|
|
59
|
+
import { createSyncConfigDispatch, withOtherWindowTabs } from "./sync/other-window-tabs";
|
|
61
60
|
import { getDesktopWindows } from "./state/desktop-windows";
|
|
62
61
|
import type { OtherWindowTab } from "./types/desktop-window";
|
|
63
62
|
import { RemoteControlHost, type RemoteControlAdapter } from "./remote/app-host";
|
|
@@ -67,10 +66,11 @@ import {
|
|
|
67
66
|
resolveCliLaunchConfig,
|
|
68
67
|
resolveInitialAppConfig,
|
|
69
68
|
} from "./app/app-bootstrap-state";
|
|
70
|
-
import {
|
|
69
|
+
import { scheduleConfigSave } from "./state/config-save-scheduler";
|
|
71
70
|
import { LOW_PRIORITY_CONFIG_SAVE_DEBOUNCE_MS } from "./state/persist-scheduler";
|
|
72
71
|
import { savedLayoutsDifferOnlyInMirror } from "./core/state/app/layout";
|
|
73
72
|
import { measurePerf } from "./utils/perf-marks";
|
|
73
|
+
import { t } from "./i18n";
|
|
74
74
|
import { useAppLanguage } from "./i18n/react";
|
|
75
75
|
import { AppLanguageConfigObserver } from "./app/language-observer";
|
|
76
76
|
import { isPaneShareHandoff } from "./shares/location";
|
|
@@ -207,15 +207,12 @@ function AppInner({
|
|
|
207
207
|
otherWindowTabsRef.current = otherWindowTabs;
|
|
208
208
|
const syncState = useMemo(() => withOtherWindowTabs(state, otherWindowTabs), [state, otherWindowTabs]);
|
|
209
209
|
const getSyncState = useCallback(() => withOtherWindowTabs(stateRef.current, otherWindowTabsRef.current), [stateRef]);
|
|
210
|
-
const syncDispatch =
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
if (changesOtherWindowTabs(action.config, others)) void saveConfigImmediately(action.config);
|
|
217
|
-
dispatch({ ...action, config: withoutOtherWindowTabs(action.config, others, stateRef.current.config) });
|
|
218
|
-
}, [dispatch, stateRef]);
|
|
210
|
+
const syncDispatch = useMemo(() => createSyncConfigDispatch({
|
|
211
|
+
dispatch,
|
|
212
|
+
otherWindowTabs: () => otherWindowTabsRef.current,
|
|
213
|
+
currentConfig: () => stateRef.current.config,
|
|
214
|
+
onSaveFailure: () => pluginRegistry.notify({ type: "error", body: t("Could not save the tabs synced to your other windows.") }),
|
|
215
|
+
}), [dispatch, pluginRegistry, stateRef]);
|
|
219
216
|
const appActive = useAppActive();
|
|
220
217
|
const appVisible = useAppVisible();
|
|
221
218
|
const appActiveRef = useRef(appActive);
|
|
@@ -297,6 +294,14 @@ function AppInner({
|
|
|
297
294
|
});
|
|
298
295
|
}, [desktopWindowBridge, pluginRegistry, stateRef]);
|
|
299
296
|
|
|
297
|
+
// A window change the desktop app could not save: a window or popped-out pane closed, a pane docked or moved.
|
|
298
|
+
useEffect(() => {
|
|
299
|
+
if (desktopWindowBridge?.kind !== "main" || appWideWorkElsewhere || !desktopWindowBridge.subscribeSaveFailures) return;
|
|
300
|
+
return desktopWindowBridge.subscribeSaveFailures(() => {
|
|
301
|
+
pluginRegistry.notify({ type: "error", body: t("Could not save your window layout.") });
|
|
302
|
+
});
|
|
303
|
+
}, [appWideWorkElsewhere, desktopWindowBridge, pluginRegistry]);
|
|
304
|
+
|
|
300
305
|
useEffect(() => {
|
|
301
306
|
const disposers = createCoreSyncContributors().map((contributor) => (
|
|
302
307
|
pluginRegistry.registerSyncContributorForPlugin("core", contributor)
|