gloomberb 0.13.2 → 0.14.0
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 +37 -302
- package/README.zh-CN.md +47 -239
- package/package.json +16 -8
- package/src/api-client/askg.test.ts +256 -0
- package/src/api-client/askg.ts +544 -0
- package/src/api-client/auth.ts +110 -50
- package/src/api-client/chat.ts +58 -24
- package/src/api-client/collections.ts +53 -0
- package/src/api-client/data.ts +260 -69
- package/src/api-client/errors.ts +31 -4
- package/src/api-client/index.test.ts +568 -303
- package/src/api-client/index.ts +374 -476
- package/src/api-client/normalizers.ts +43 -13
- package/src/api-client/notes.ts +89 -0
- package/src/api-client/paths.test.ts +32 -0
- package/src/api-client/paths.ts +169 -36
- package/src/api-client/request.test.ts +35 -18
- package/src/api-client/request.ts +170 -34
- package/src/api-client/research-activity.test.ts +316 -0
- package/src/api-client/research-activity.ts +339 -32
- package/src/api-client/session-request-lifetime.test.ts +184 -0
- package/src/api-client/socket-health.test.ts +18 -12
- package/src/api-client/socket-lifetime.test.ts +76 -0
- package/src/api-client/socket.ts +279 -75
- package/src/api-client/teams.test.ts +270 -0
- package/src/api-client/teams.ts +241 -0
- package/src/api-client/theses.ts +177 -0
- package/src/api-client/types.ts +757 -10
- package/src/api-client/views.ts +125 -0
- package/src/app/global-shortcuts.test.tsx +5 -37
- package/src/app/pane-runtime/plugin-bindings.ts +125 -6
- package/src/app/pane-runtime/ticker-navigation-runtime.test.ts +144 -0
- package/src/app/pane-runtime/ticker-open-runtime.test.tsx +170 -0
- package/src/app/pane-runtime/ticker-open-runtime.ts +68 -12
- package/src/app/runtime/desktop-deeplink.test.ts +44 -1
- package/src/app/runtime/desktop-deeplink.ts +22 -11
- package/src/app/runtime/layout-warmup.test.ts +73 -0
- package/src/app/runtime/layout-warmup.ts +118 -0
- package/src/app/runtime/startup.ts +47 -2
- package/src/app/runtime/ticker-refresh.test.tsx +115 -0
- package/src/app/runtime/ticker-refresh.ts +109 -157
- package/src/app.tsx +32 -6
- package/src/architecture/browser-entry-graph.test.ts +1 -0
- package/src/architecture/import-boundaries.test.ts +14 -0
- package/src/brokers/bond-price-basis.test.ts +35 -0
- package/src/brokers/broker-ticker-sync.ts +6 -2
- package/src/brokers/legacy-contract.test.ts +51 -0
- package/src/brokers/sync-broker-instance.test.ts +70 -0
- package/src/capabilities/factories.ts +4 -0
- package/src/capabilities/index.ts +1 -0
- package/src/capabilities/service-capabilities.ts +43 -3
- package/src/capabilities/stream-client.ts +39 -0
- package/src/cli/base-converter.test.ts +16 -0
- package/src/cli/base-converter.ts +5 -4
- package/src/cli/commands/automation.ts +1 -147
- package/src/cli/commands/futures-price-precision.test.tsx +65 -0
- package/src/cli/commands/market-fx.test.ts +59 -0
- package/src/cli/commands/market.ts +10 -5
- package/src/cli/commands/overview.ts +1 -32
- package/src/cli/commands/plugins.ts +461 -79
- package/src/cli/commands/quote-price-basis.test.ts +82 -0
- package/src/cli/commands/system.ts +83 -5
- package/src/cli/commands/ticker-financial-units.test.ts +43 -0
- package/src/cli/commands/ticker-period.test.ts +62 -0
- package/src/cli/commands/ticker.ts +170 -106
- package/src/cli/desktop-pane-shot.ts +98 -7
- package/src/cli/entry.test.ts +55 -0
- package/src/cli/entry.ts +13 -6
- package/src/cli/helpers.ts +5 -3
- package/src/cli/index.ts +6 -3
- package/src/cli/native-smoke.ts +16 -0
- package/src/cli/pane-functions/capabilities.ts +9 -383
- package/src/cli/pane-functions/catalog.ts +6 -5
- package/src/cli/pane-functions/cloud-session.test.ts +23 -0
- package/src/cli/pane-functions/cloud-session.ts +9 -0
- package/src/cli/pane-functions/data.ts +0 -6
- package/src/cli/pane-functions/discovery.test.ts +36 -0
- package/src/cli/pane-functions/discovery.ts +30 -18
- package/src/cli/pane-functions/headless.test.ts +67 -0
- package/src/cli/pane-functions/headless.ts +24 -6
- package/src/cli/pane-functions/index.test.ts +29 -0
- package/src/cli/pane-functions/index.ts +1 -1
- package/src/cli/pane-functions/intraday-shot.test.ts +84 -20
- package/src/cli/pane-functions/options.ts +5 -2
- package/src/cli/pane-functions/report.test.ts +6 -3
- package/src/cli/pane-functions/report.ts +5 -857
- package/src/cli/pane-functions/resolver.ts +1 -1
- package/src/cli/pane-functions/screenshot.test.ts +27 -6
- package/src/cli/pane-functions/screenshot.ts +179 -135
- package/src/cli/registry.test.ts +24 -50
- package/src/cli/result.test.ts +18 -0
- package/src/cli/result.ts +3 -1
- package/src/cli.test.ts +14 -5
- package/src/components/chart/composite/axis-overlays.tsx +4 -2
- package/src/components/chart/composite/column-layout.ts +2 -2
- package/src/components/chart/composite/composite-chart.test.tsx +164 -7
- package/src/components/chart/composite/composite-chart.tsx +131 -30
- package/src/components/chart/composite/format.test.ts +74 -0
- package/src/components/chart/composite/format.ts +85 -12
- package/src/components/chart/composite/fx-precision.test.ts +92 -0
- package/src/components/chart/composite/interactions.test.ts +13 -0
- package/src/components/chart/composite/interactions.ts +3 -1
- package/src/components/chart/composite/panel-series.ts +2 -0
- package/src/components/chart/composite/price-axis-labels.test.ts +8 -0
- package/src/components/chart/composite/price-axis-labels.tsx +3 -1
- package/src/components/chart/composite/price-series.ts +18 -11
- package/src/components/chart/composite/renderers.test.ts +5 -5
- package/src/components/chart/composite/scene-market-cursor.test.ts +148 -0
- package/src/components/chart/composite/scene.test.ts +166 -0
- package/src/components/chart/composite/scene.ts +57 -21
- package/src/{plugins/prediction-markets/chart.test.tsx → components/chart/composite/scroll-surface.test.tsx} +34 -22
- package/src/components/chart/composite/text-renderer.ts +5 -2
- package/src/components/chart/composite/time-axis.test.ts +11 -2
- package/src/components/chart/composite/time-axis.ts +8 -5
- package/src/components/chart/composite/types.ts +9 -0
- package/src/components/chart/native/kitty/index.test.ts +4 -79
- package/src/components/chart/static/chart-surface.test.tsx +13 -0
- package/src/components/chart/static/chart-surface.tsx +19 -11
- package/src/components/chart/static/series.ts +3 -3
- package/src/components/command-bar/assist/model.test.ts +66 -0
- package/src/components/command-bar/assist/model.ts +82 -7
- package/src/components/command-bar/commands/collection.ts +27 -7
- package/src/components/command-bar/commands/direct/runtime.ts +7 -2
- package/src/components/command-bar/list/model.ts +9 -0
- package/src/components/command-bar/list/view.tsx +25 -83
- package/src/components/command-bar/multi-select-picker.tsx +6 -8
- package/src/components/command-bar/pane-actions.ts +13 -7
- package/src/components/command-bar/pane-templates/workflow.ts +28 -3
- package/src/components/command-bar/panel/index.tsx +189 -76
- package/src/components/command-bar/panel/layout.test.ts +32 -0
- package/src/components/command-bar/panel/layout.ts +9 -1
- package/src/components/command-bar/panel/palette.ts +28 -0
- package/src/components/command-bar/panel/state.ts +6 -0
- package/src/components/command-bar/panel/types.ts +1 -14
- package/src/components/command-bar/routes/ticker-search/actions.ts +33 -12
- package/src/components/command-bar/routes/ticker-search/results.test.ts +42 -1
- package/src/components/command-bar/routes/ticker-search/results.ts +14 -11
- package/src/components/command-bar/routing/actions.ts +9 -8
- package/src/components/command-bar/surface/index.tsx +20 -1
- package/src/components/command-bar/surface/listing-selection.test.tsx +84 -0
- package/src/components/command-bar/surface/test-harness.tsx +11 -93
- package/src/components/command-bar/theme-picker.tsx +12 -27
- package/src/components/command-bar/workflow/body.tsx +8 -35
- package/src/components/command-bar/workflow/builtin.ts +55 -14
- package/src/components/command-bar/workflow/collection-actions.test.ts +11 -0
- package/src/components/command-bar/workflow/collection-actions.ts +50 -11
- package/src/components/command-bar/workflow/collection-identity.test.ts +180 -0
- package/src/components/command-bar/workflow/collection-ticker.ts +65 -0
- package/src/components/command-bar/workflow/coordinator.ts +0 -1
- package/src/components/command-bar/workflow/field-row.tsx +20 -35
- package/src/components/command-bar/workflow/ops.test.ts +167 -1
- package/src/components/command-bar/workflow/ops.ts +59 -3
- package/src/components/command-bar/workflow/runtime.ts +13 -0
- package/src/components/command-bar/workflow/submit.ts +9 -2
- package/src/components/command-bar/workflow/ticker-listing-picker.test.ts +41 -0
- package/src/components/command-bar/workflow/ticker-listing-picker.ts +35 -0
- package/src/components/command-bar/workflow/tickers.ts +42 -11
- package/src/components/data-table/export.ts +4 -1
- package/src/components/data-table/frozen-column.test.tsx +114 -0
- package/src/components/data-table/horizontal-navigation.test.tsx +154 -0
- package/src/components/data-table/stack-view.test.tsx +23 -18
- package/src/components/data-table/stack-view.tsx +37 -1
- package/src/components/data-table/view.test.tsx +107 -63
- package/src/components/data-table/view.tsx +40 -3
- package/src/components/feed-data-table/stack-view.tsx +20 -5
- package/src/components/index.ts +40 -15
- package/src/components/layout/detached-pane-shell.tsx +71 -17
- package/src/components/layout/floating-pane.tsx +7 -0
- package/src/components/layout/header.tsx +3 -0
- package/src/components/layout/market-summary.ts +1 -1
- package/src/components/layout/missing-pane.tsx +111 -0
- package/src/components/layout/pane/content.tsx +29 -9
- package/src/components/layout/pane/footer/current-actions.test.tsx +108 -0
- package/src/components/layout/pane/footer/index.tsx +44 -3
- package/src/components/layout/pane/footer/model.ts +11 -0
- package/src/components/layout/pane/footer/notice.desktop.test.tsx +56 -0
- package/src/components/layout/pane/footer/registration.tsx +32 -1
- package/src/components/layout/pane/header.tsx +31 -1
- package/src/components/layout/pane/index.tsx +3 -0
- package/src/components/layout/pane/sizing.test.ts +1 -0
- package/src/components/layout/pane/sizing.ts +4 -1
- package/src/components/layout/shell/chrome.ts +7 -2
- package/src/components/layout/shell/index.test.tsx +117 -34
- package/src/components/layout/shell/index.tsx +42 -22
- package/src/components/layout/shell/menu.test.ts +34 -0
- package/src/components/layout/shell/menu.ts +9 -0
- package/src/components/layout/shell/pane/actions.ts +20 -3
- package/src/components/layout/shell/pane/layers.tsx +26 -0
- package/src/components/layout/shell/pane-occlusion.test.ts +52 -0
- package/src/components/layout/shell/pane-occlusion.ts +63 -0
- package/src/components/layout/status-bar-groups.test.ts +92 -0
- package/src/components/layout/status-bar-groups.ts +85 -0
- package/src/components/layout/status-bar.test.tsx +6 -6
- package/src/components/layout/status-bar.tsx +140 -31
- package/src/components/layout/titlebar-overlay.ts +11 -1
- package/src/components/layout/window-fullscreen.ts +32 -0
- package/src/components/onboarding/account-step/form-panel.tsx +13 -32
- package/src/components/onboarding/account-step/index.tsx +13 -29
- package/src/components/onboarding/first-run-workspace.test.ts +81 -0
- package/src/components/onboarding/first-run-workspace.ts +215 -0
- package/src/components/onboarding/onboarding-frame.tsx +109 -35
- package/src/components/onboarding/onboarding-wizard.test.tsx +389 -202
- package/src/components/onboarding/onboarding-wizard.tsx +379 -303
- package/src/components/onboarding/portfolio-step/index.tsx +13 -0
- package/src/components/onboarding/portfolio-step/positions-panel.tsx +292 -0
- package/src/components/onboarding/portfolio-step/types.ts +7 -1
- package/src/components/onboarding/wizard-account.ts +38 -18
- package/src/components/onboarding/wizard-model.test.ts +67 -0
- package/src/components/onboarding/wizard-model.ts +99 -3
- package/src/components/onboarding/wizard-positions.ts +327 -0
- package/src/components/price-performance.tsx +1 -1
- package/src/components/sign-in-gate.test.tsx +10 -78
- package/src/components/table-view-shared.tsx +4 -3
- package/src/components/ticker/badge/format.test.ts +66 -0
- package/src/components/ticker/badge/format.ts +51 -19
- package/src/components/ticker/badge/index.tsx +12 -5
- package/src/components/ticker/badge/list.test.tsx +84 -0
- package/src/components/ticker/badge/list.tsx +69 -6
- package/src/components/ticker/list-table-view.tsx +8 -0
- package/src/components/ui/action-row.tsx +36 -0
- package/src/components/ui/button.tsx +44 -11
- package/src/components/ui/checkbox.tsx +5 -2
- package/src/components/ui/choice-dialog.tsx +15 -6
- package/src/components/ui/data-table/opentui/index.tsx +101 -33
- package/src/components/ui/data-table/stable-columns.ts +34 -0
- package/src/components/ui/data-table/types.ts +6 -1
- package/src/components/ui/display.desktop.test.tsx +55 -0
- package/src/components/ui/display.test.tsx +36 -0
- package/src/components/ui/display.tsx +124 -0
- package/src/components/ui/external-link.test.tsx +25 -0
- package/src/components/ui/external-link.tsx +11 -3
- package/src/components/ui/fields.tsx +17 -4
- package/src/components/ui/index.ts +19 -3
- package/src/components/ui/list-view.tsx +32 -16
- package/src/components/ui/loading.tsx +5 -4
- package/src/components/ui/native-select.tsx +14 -5
- package/src/components/ui/prose.tsx +110 -0
- package/src/components/ui/select-button.tsx +49 -18
- package/src/components/ui/status.tsx +63 -54
- package/src/components/ui/tabs.tsx +3 -1
- package/src/components/ui/toggle.tsx +22 -1
- package/src/components/ui/ui.test.tsx +62 -26
- package/src/components/use-pane-notice-footer.test.tsx +116 -0
- package/src/components/use-pane-notice-footer.tsx +128 -0
- package/src/core/app-runtime.test.ts +113 -0
- package/src/core/app-runtime.ts +97 -0
- package/src/core/app-services.ts +35 -103
- package/src/core/state/app/instrument.ts +77 -0
- package/src/core/state/app/layout-reducer.ts +60 -0
- package/src/core/state/app/layout.ts +149 -19
- package/src/core/state/app/state.ts +2 -2
- package/src/core/state/app/types.ts +14 -1
- package/src/core/state/session-persistence.ts +18 -48
- package/src/data/cached-query.test.ts +95 -0
- package/src/data/cached-query.ts +106 -0
- package/src/data/config/layout.ts +35 -1
- package/src/data/config/store/index.test.ts +41 -0
- package/src/data/config/store/normalize.ts +65 -7
- package/src/data/fred-series.ts +22 -66
- package/src/{renderers/browser/persistence.ts → data/json-persistence.ts} +8 -8
- package/src/{renderers/browser/storage.ts → data/json-storage.ts} +5 -5
- package/src/{renderers/browser/ticker-repository.ts → data/json-ticker-repository.ts} +7 -7
- package/src/data/memory-resource-store.test.ts +24 -0
- package/src/{renderers/electrobun/view/resource-store.ts → data/memory-resource-store.ts} +2 -2
- package/src/data/plugin-cache.test.ts +46 -0
- package/src/data/plugin-cache.ts +89 -0
- package/src/data/response-sequence.ts +6 -0
- package/src/i18n/es.ts +84 -3
- package/src/i18n/ja.ts +84 -3
- package/src/i18n/ko.ts +84 -3
- package/src/i18n/zh-cn.ts +84 -3
- package/src/i18n/zh-tw.ts +84 -3
- package/src/layout-marketplace/cloud.test.ts +154 -0
- package/src/layout-marketplace/cloud.ts +215 -0
- package/src/layout-marketplace/gallery-desktop.test.tsx +19 -74
- package/src/layout-marketplace/gallery-desktop.tsx +65 -3
- package/src/layout-marketplace/gallery-terminal.tsx +83 -5
- package/src/layout-marketplace/gallery.tsx +254 -18
- package/src/layout-marketplace/linked-sync.ts +104 -0
- package/src/layout-marketplace/linked.ts +119 -0
- package/src/layout-marketplace/mini-workspace.test.tsx +9 -62
- package/src/layout-marketplace/model.ts +71 -19
- package/src/layout-marketplace/payload.test.ts +156 -0
- package/src/layout-marketplace/payload.ts +77 -16
- package/src/layout-marketplace/use-marketplace.ts +68 -1
- package/src/market-data/coordinator/auxiliary.ts +40 -11
- package/src/market-data/coordinator/entries.ts +11 -1
- package/src/market-data/coordinator/events.test.ts +33 -3
- package/src/market-data/coordinator/events.ts +25 -1
- package/src/market-data/coordinator/financials.ts +2 -61
- package/src/market-data/coordinator/fx-refresh.test.ts +61 -0
- package/src/market-data/coordinator/index.test.ts +25 -0
- package/src/market-data/coordinator/index.ts +129 -27
- package/src/market-data/coordinator/quotes.ts +1 -0
- package/src/market-data/coordinator/subscriptions.test.ts +12 -5
- package/src/market-data/hooks.tsx +8 -13
- package/src/market-data/legacy-contract-hooks.test.tsx +49 -0
- package/src/market-data/legacy-contract.test.ts +99 -0
- package/src/market-data/market/format.test.ts +77 -1
- package/src/market-data/market/format.ts +100 -6
- package/src/market-data/market/freshness.ts +13 -1
- package/src/market-data/market/price-basis.ts +9 -0
- package/src/market-data/market/status.test.ts +15 -1
- package/src/market-data/market/status.ts +18 -22
- package/src/market-data/performance.ts +21 -6
- package/src/market-data/portfolio-financials.ts +27 -0
- package/src/market-data/portfolio-instrument.test.ts +80 -0
- package/src/market-data/quotes/contributions.ts +32 -9
- package/src/market-data/quotes/day-range.test.ts +84 -0
- package/src/market-data/quotes/day-range.ts +95 -0
- package/src/market-data/quotes/freshness.test.ts +63 -0
- package/src/market-data/quotes/freshness.ts +17 -11
- package/src/market-data/quotes/metadata.ts +55 -0
- package/src/market-data/quotes/observation-time.test.ts +74 -0
- package/src/market-data/quotes/price-basis.test.ts +44 -0
- package/src/market-data/quotes/resolution.test.ts +137 -0
- package/src/market-data/quotes/resolution.ts +57 -11
- package/src/market-data/request-types.ts +27 -13
- package/src/market-data/result-types.ts +3 -0
- package/src/market-data/selectors.ts +2 -23
- package/src/market-data/snapshot-contract.test.ts +110 -0
- package/src/market-data/snapshot-provider.test.ts +93 -0
- package/src/market-data/snapshot-provider.ts +175 -0
- package/src/market-data/ticker-price-returns.test.ts +26 -0
- package/src/market-data/ticker-price-returns.ts +18 -0
- package/src/news/aggregator.test.ts +20 -4
- package/src/news/aggregator.ts +40 -10
- package/src/news/news-model.ts +33 -2
- package/src/news/types.ts +2 -0
- package/src/pane-settings.ts +24 -0
- package/src/plugins/builtin/account-management/form-components.tsx +22 -94
- package/src/plugins/builtin/account-management/model.ts +26 -12
- package/src/plugins/builtin/account-management/navigation.ts +1 -1
- package/src/plugins/builtin/account-management/pane.tsx +31 -54
- package/src/plugins/builtin/alerts/index.test.tsx +52 -42
- package/src/plugins/builtin/alerts/index.tsx +7 -2
- package/src/plugins/builtin/alerts/quotes.ts +2 -2
- package/src/plugins/builtin/analytics/broker-performance.test.ts +79 -0
- package/src/plugins/builtin/analytics/broker-performance.ts +57 -70
- package/src/plugins/builtin/analytics/display.ts +6 -3
- package/src/plugins/builtin/analytics/index.test.tsx +262 -53
- package/src/plugins/builtin/analytics/index.tsx +85 -51
- package/src/plugins/builtin/analytics/metrics.test.ts +23 -6
- package/src/plugins/builtin/analytics/metrics.ts +97 -49
- package/src/plugins/builtin/analytics/pane-model.test.ts +191 -0
- package/src/plugins/builtin/analytics/pane-model.ts +194 -100
- package/src/plugins/builtin/analytics/portfolio-identity.test.tsx +272 -0
- package/src/plugins/builtin/analytics/return-window.test.ts +72 -0
- package/src/plugins/builtin/analytics/sector-model.test.ts +56 -0
- package/src/plugins/builtin/analytics/sector-model.ts +38 -23
- package/src/plugins/builtin/analytics/sharpe-cadence.test.ts +111 -0
- package/src/plugins/builtin/analytics/sharpe-cadence.ts +161 -0
- package/src/plugins/builtin/analytics/view.tsx +61 -66
- package/src/plugins/builtin/broker-manager/index.test.tsx +5 -9
- package/src/plugins/builtin/broker-manager/index.tsx +11 -12
- package/src/plugins/builtin/buildout/cells.test.tsx +31 -0
- package/src/plugins/builtin/buildout/cells.tsx +2 -12
- package/src/plugins/builtin/buildout/detail/company.tsx +23 -42
- package/src/plugins/builtin/buildout/detail/index.tsx +0 -1
- package/src/plugins/builtin/buildout/detail/intel.tsx +5 -10
- package/src/plugins/builtin/buildout/detail/site.tsx +15 -33
- package/src/plugins/builtin/buildout/detail/ui.tsx +17 -56
- package/src/plugins/builtin/buildout/pane/header.tsx +3 -11
- package/src/plugins/builtin/buildout/pane/status.tsx +3 -18
- package/src/plugins/builtin/cds/headless.test.ts +20 -2
- package/src/plugins/builtin/cds/model.test.ts +10 -0
- package/src/plugins/builtin/cds/model.ts +18 -8
- package/src/plugins/builtin/cds/pane.test.tsx +2 -2
- package/src/plugins/builtin/cds/pane.tsx +32 -41
- package/src/plugins/builtin/chart-composer/catalog-inventory.test.ts +17 -0
- package/src/plugins/builtin/chart-composer/catalog-inventory.ts +57 -16
- package/src/plugins/builtin/chart-composer/cli-options.ts +7 -4
- package/src/plugins/builtin/chart-composer/data-catalog-pane.tsx +24 -2
- package/src/plugins/builtin/chart-composer/editor/controller.ts +7 -1
- package/src/plugins/builtin/chart-composer/editor/opentui-view.tsx +2 -0
- package/src/plugins/builtin/chart-composer/editor.test.tsx +32 -23
- package/src/plugins/builtin/chart-composer/editor.tsx +3 -6
- package/src/plugins/builtin/chart-composer/financial-periods.fixture.json +225 -0
- package/src/plugins/builtin/chart-composer/headless-schema.ts +221 -0
- package/src/plugins/builtin/chart-composer/headless.test.ts +158 -0
- package/src/plugins/builtin/chart-composer/headless.ts +225 -0
- package/src/plugins/builtin/chart-composer/index.tsx +90 -8
- package/src/plugins/builtin/chart-composer/loading.test.tsx +134 -0
- package/src/plugins/builtin/chart-composer/pane-share.test.ts +74 -1
- package/src/plugins/builtin/chart-composer/pane.tsx +125 -134
- package/src/plugins/builtin/chart-composer/presets.test.ts +46 -0
- package/src/plugins/builtin/chart-composer/presets.ts +41 -13
- package/src/plugins/builtin/chart-composer/quick-add.tsx +7 -1
- package/src/plugins/builtin/chart-composer/quote-metadata.test.ts +176 -0
- package/src/plugins/builtin/chart-composer/semantic.ts +1 -0
- package/src/plugins/builtin/chart-composer/settings.test.ts +30 -0
- package/src/plugins/builtin/chart-composer/settings.ts +1 -1
- package/src/plugins/builtin/chart-composer/use-series-catalog.test.tsx +94 -0
- package/src/plugins/builtin/chart-composer/use-series-catalog.ts +7 -2
- package/src/plugins/builtin/chat/channel-labels.ts +13 -0
- package/src/plugins/builtin/chat/channels.ts +2 -0
- package/src/plugins/builtin/chat/content/channel-navigation.ts +16 -3
- package/src/plugins/builtin/chat/content/composer.tsx +13 -46
- package/src/plugins/builtin/chat/content/index.tsx +3 -1
- package/src/plugins/builtin/chat/content/new-dm-dialog.tsx +10 -15
- package/src/plugins/builtin/chat/controller/channels.ts +5 -1
- package/src/plugins/builtin/chat/controller/index.ts +17 -4
- package/src/plugins/builtin/chat/controller/session-lifetime.test.ts +182 -0
- package/src/plugins/builtin/chat/controller/session-runtime.ts +16 -4
- package/src/plugins/builtin/chat/controller.test.ts +173 -296
- package/src/plugins/builtin/chat/message/desktop.tsx +9 -9
- package/src/plugins/builtin/chat/message/profile-popover.tsx +3 -23
- package/src/plugins/builtin/chat/message/terminal.tsx +9 -9
- package/src/plugins/builtin/chat/sidebar.test.tsx +107 -0
- package/src/plugins/builtin/chat/sidebar.tsx +71 -18
- package/src/plugins/builtin/chat/status-widget.tsx +6 -12
- package/src/plugins/builtin/chat/test-harness.test.ts +46 -0
- package/src/plugins/builtin/chat/test-harness.tsx +12 -6
- package/src/plugins/builtin/cloud/askg/controller.test.ts +275 -0
- package/src/plugins/builtin/cloud/askg/controller.ts +440 -0
- package/src/plugins/builtin/cloud/askg/host.ts +87 -0
- package/src/plugins/builtin/cloud/askg/model.test.ts +222 -0
- package/src/plugins/builtin/cloud/askg/model.ts +623 -0
- package/src/plugins/builtin/cloud/askg/pane.tsx +734 -0
- package/src/plugins/builtin/cloud/askg/pending-question.ts +38 -0
- package/src/plugins/builtin/cloud/askg/protocol.ts +11 -0
- package/src/plugins/builtin/cloud/auth-actions.tsx +49 -51
- package/src/plugins/builtin/cloud/auth-form.tsx +5 -7
- package/src/plugins/builtin/cloud/auth-model.ts +8 -6
- package/src/plugins/builtin/cloud/plugin.tsx +57 -3
- package/src/plugins/builtin/cloud/team/acm-tab.tsx +127 -0
- package/src/plugins/builtin/cloud/team/capability.ts +71 -0
- package/src/plugins/builtin/cloud/team/collections-sync.ts +222 -0
- package/src/plugins/builtin/cloud/team/collections.test.ts +126 -0
- package/src/plugins/builtin/cloud/team/collections.ts +181 -0
- package/src/plugins/builtin/cloud/team/command.ts +313 -0
- package/src/plugins/builtin/cloud/team/model.test.ts +174 -0
- package/src/plugins/builtin/cloud/team/model.ts +209 -0
- package/src/plugins/builtin/cloud/team/module.tsx +78 -0
- package/src/plugins/builtin/cloud/team/pane-model.test.ts +100 -0
- package/src/plugins/builtin/cloud/team/pane-model.ts +156 -0
- package/src/plugins/builtin/cloud/team/pane-request.ts +47 -0
- package/src/plugins/builtin/cloud/team/pane-sections.tsx +509 -0
- package/src/plugins/builtin/cloud/team/pane-ui.tsx +325 -0
- package/src/plugins/builtin/cloud/team/pane.test.tsx +196 -0
- package/src/plugins/builtin/cloud/team/pane.tsx +712 -0
- package/src/plugins/builtin/cloud/team/status-widget.tsx +75 -0
- package/src/plugins/builtin/cloud/team/store.test.ts +231 -0
- package/src/plugins/builtin/cloud/team/store.ts +318 -0
- package/src/plugins/builtin/cloud/team/team-state-host.ts +70 -0
- package/src/plugins/builtin/cloud/team/views.ts +185 -0
- package/src/plugins/builtin/cloud/thesis/board-pane.test.tsx +239 -0
- package/src/plugins/builtin/cloud/thesis/board-pane.tsx +471 -0
- package/src/plugins/builtin/cloud/thesis/detail.tsx +522 -0
- package/src/plugins/builtin/cloud/thesis/exposure.ts +119 -0
- package/src/plugins/builtin/cloud/thesis/flows.ts +552 -0
- package/src/plugins/builtin/cloud/thesis/model.test.ts +171 -0
- package/src/plugins/builtin/cloud/thesis/model.ts +406 -0
- package/src/plugins/builtin/cloud/thesis/module.tsx +63 -0
- package/src/plugins/builtin/cloud/thesis/pane-request.ts +47 -0
- package/src/plugins/builtin/cloud/thesis/prompts.tsx +214 -0
- package/src/plugins/builtin/cloud/thesis/store.ts +279 -0
- package/src/plugins/builtin/cloud/thesis/ticker-tab.tsx +131 -0
- package/src/plugins/builtin/cloud/upgrade-status-widget.tsx +2 -15
- package/src/plugins/builtin/cloud/verification-status-widget.tsx +72 -0
- package/src/plugins/builtin/cloud-tweets/model.ts +13 -0
- package/src/plugins/builtin/cloud-tweets/pane.tsx +4 -2
- package/src/plugins/builtin/cloud-tweets/table.test.tsx +125 -0
- package/src/plugins/builtin/cloud-tweets/table.tsx +66 -20
- package/src/plugins/builtin/composite-plugins.ts +2 -12
- package/src/plugins/builtin/congress-trades/detail.tsx +42 -7
- package/src/plugins/builtin/congress-trades/footer.ts +23 -7
- package/src/plugins/builtin/congress-trades/keyboard.ts +10 -1
- package/src/plugins/builtin/congress-trades/model.test.ts +29 -10
- package/src/plugins/builtin/congress-trades/model.ts +28 -3
- package/src/plugins/builtin/congress-trades/pane.tsx +24 -6
- package/src/plugins/builtin/congress-trades/table.tsx +0 -1
- package/src/plugins/builtin/connections/pane.test.tsx +12 -16
- package/src/plugins/builtin/connections/pane.tsx +18 -30
- package/src/plugins/builtin/correlation/compute.test.ts +53 -86
- package/src/plugins/builtin/correlation/compute.ts +54 -60
- package/src/plugins/builtin/correlation/headless-schema.ts +69 -0
- package/src/plugins/builtin/correlation/headless.test.ts +147 -0
- package/src/plugins/builtin/correlation/headless.ts +110 -0
- package/src/plugins/builtin/correlation/history.ts +16 -0
- package/src/plugins/builtin/correlation/index.test.tsx +27 -55
- package/src/plugins/builtin/correlation/index.tsx +31 -13
- package/src/plugins/builtin/correlation/matrix/model.ts +38 -21
- package/src/plugins/builtin/correlation/relationship/controls.tsx +0 -30
- package/src/plugins/builtin/correlation/relationship/history.test.tsx +62 -0
- package/src/plugins/builtin/correlation/relationship/history.ts +31 -57
- package/src/plugins/builtin/correlation/relationship/model.ts +29 -62
- package/src/plugins/builtin/correlation/relationship/pane.tsx +47 -38
- package/src/plugins/builtin/credit-conditions/client.test.ts +43 -1
- package/src/plugins/builtin/credit-conditions/client.ts +17 -6
- package/src/plugins/builtin/credit-conditions/index.test.tsx +59 -38
- package/src/plugins/builtin/credit-conditions/index.tsx +35 -60
- package/src/plugins/builtin/credit-conditions/model.test.ts +1 -0
- package/src/plugins/builtin/credit-conditions/model.ts +1 -0
- package/src/plugins/builtin/custom-view/index.tsx +69 -0
- package/src/plugins/builtin/custom-view/loader.ts +107 -0
- package/src/plugins/builtin/custom-view/pane.tsx +308 -0
- package/src/plugins/builtin/custom-view/view-spec.test.ts +107 -0
- package/src/plugins/builtin/custom-view/view-spec.ts +347 -0
- package/src/plugins/builtin/debug/index.tsx +65 -46
- package/src/plugins/builtin/debug/template.ts +8 -0
- package/src/plugins/builtin/dividend-yield/browser.tsx +26 -0
- package/src/plugins/builtin/dividend-yield/calendar.ts +9 -0
- package/src/plugins/builtin/dividend-yield/client.test.ts +204 -2
- package/src/plugins/builtin/dividend-yield/client.ts +148 -96
- package/src/plugins/builtin/dividend-yield/dividend-source-integrity.test.ts +232 -0
- package/src/plugins/builtin/dividend-yield/headless.test.ts +35 -1
- package/src/plugins/builtin/dividend-yield/headless.ts +48 -11
- package/src/plugins/builtin/dividend-yield/index.tsx +64 -51
- package/src/plugins/builtin/dividend-yield/pane.test.tsx +349 -0
- package/src/plugins/builtin/dividend-yield/pane.tsx +118 -117
- package/src/plugins/builtin/dividend-yield/provider-client.test.ts +61 -0
- package/src/plugins/builtin/dividend-yield/provider-client.ts +44 -0
- package/src/plugins/builtin/dividend-yield/reference-price.test.ts +115 -0
- package/src/plugins/builtin/dividend-yield/reference-price.ts +27 -0
- package/src/plugins/builtin/dividend-yield/view.test.ts +58 -0
- package/src/plugins/builtin/dividend-yield/view.ts +35 -0
- package/src/plugins/builtin/earnings/data/cache.test.ts +21 -1
- package/src/plugins/builtin/earnings/data/cache.ts +11 -86
- package/src/plugins/builtin/earnings/detail-model.test.ts +103 -0
- package/src/plugins/builtin/earnings/detail-model.ts +165 -0
- package/src/plugins/builtin/earnings/detail-view.tsx +131 -0
- package/src/plugins/builtin/earnings/estimate-basis.test.ts +158 -0
- package/src/plugins/builtin/earnings/estimate-basis.ts +76 -0
- package/src/plugins/builtin/earnings/estimate-fixtures.test-data.ts +327 -0
- package/src/plugins/builtin/earnings/headless.ts +29 -18
- package/src/plugins/builtin/earnings/index.tsx +114 -63
- package/src/plugins/builtin/earnings/model.test.ts +29 -1
- package/src/plugins/builtin/earnings/table.test.ts +60 -0
- package/src/plugins/builtin/earnings/table.ts +46 -36
- package/src/plugins/builtin/earnings-calls/data.test.ts +252 -0
- package/src/plugins/builtin/earnings-calls/data.ts +66 -28
- package/src/plugins/builtin/earnings-calls/headless-freshness.test.ts +41 -0
- package/src/plugins/builtin/earnings-calls/headless.test.ts +69 -3
- package/src/plugins/builtin/earnings-calls/headless.ts +82 -89
- package/src/plugins/builtin/earnings-calls/index.tsx +22 -22
- package/src/plugins/builtin/earnings-calls/model.ts +1 -0
- package/src/plugins/builtin/earnings-calls/pane.test.tsx +466 -0
- package/src/plugins/builtin/earnings-calls/pane.tsx +225 -65
- package/src/plugins/builtin/earnings-calls/prose.test.ts +16 -1
- package/src/plugins/builtin/earnings-calls/prose.ts +33 -30
- package/src/plugins/builtin/earnings-calls/transcript-view.tsx +138 -115
- package/src/plugins/builtin/econ/calendar-model.ts +10 -61
- package/src/plugins/builtin/econ/detail-view.tsx +35 -81
- package/src/plugins/builtin/econ/fred-cache.test.ts +39 -1
- package/src/plugins/builtin/econ/fred-client.test.ts +34 -7
- package/src/plugins/builtin/econ/fred-series-map.ts +57 -36
- package/src/plugins/builtin/econ/index.test.tsx +10 -13
- package/src/plugins/builtin/econ-statistics/client.test.ts +108 -0
- package/src/plugins/builtin/econ-statistics/client.ts +42 -13
- package/src/plugins/builtin/econ-statistics/defs.ts +3 -0
- package/src/plugins/builtin/econ-statistics/detail.tsx +12 -13
- package/src/plugins/builtin/econ-statistics/headless.test.ts +1 -1
- package/src/plugins/builtin/econ-statistics/headless.ts +6 -1
- package/src/plugins/builtin/econ-statistics/pane.test.tsx +69 -0
- package/src/plugins/builtin/econ-statistics/pane.tsx +52 -87
- package/src/plugins/builtin/econ-statistics/stats.ts +30 -11
- package/src/plugins/builtin/econ-statistics/transform.test.ts +23 -0
- package/src/plugins/builtin/econ-statistics/transform.ts +13 -4
- package/src/plugins/builtin/econ-statistics/view.test.ts +27 -0
- package/src/plugins/builtin/econ-statistics/view.ts +20 -1
- package/src/plugins/builtin/executives/data.ts +126 -0
- package/src/plugins/builtin/executives/format.test.ts +23 -0
- package/src/plugins/builtin/executives/format.ts +58 -0
- package/src/plugins/builtin/executives/index.tsx +61 -0
- package/src/plugins/builtin/executives/pane.test.tsx +335 -0
- package/src/plugins/builtin/executives/pane.tsx +467 -0
- package/src/plugins/builtin/filing-events/feed.test.ts +146 -0
- package/src/plugins/builtin/filing-events/feed.ts +189 -0
- package/src/plugins/builtin/filing-events/index.tsx +50 -0
- package/src/plugins/builtin/filing-events/pane.test.tsx +107 -0
- package/src/plugins/builtin/filing-events/pane.tsx +253 -0
- package/src/plugins/builtin/futures/index.tsx +15 -8
- package/src/plugins/builtin/futures/model.test.ts +25 -0
- package/src/plugins/builtin/futures/model.ts +12 -3
- package/src/plugins/builtin/futures/pane.test.tsx +8 -28
- package/src/plugins/builtin/futures/table.tsx +2 -2
- package/src/plugins/builtin/fx-matrix/export.test.ts +30 -0
- package/src/plugins/builtin/fx-matrix/export.ts +32 -0
- package/src/plugins/builtin/fx-matrix/index.tsx +24 -41
- package/src/plugins/builtin/fx-matrix/pairs.test.ts +11 -0
- package/src/plugins/builtin/fx-matrix/pairs.ts +3 -2
- package/src/plugins/builtin/fx-matrix/pane.test.tsx +6 -9
- package/src/plugins/builtin/fx-matrix/refresh.test.tsx +69 -0
- package/src/plugins/builtin/help/components.tsx +6 -26
- package/src/plugins/builtin/help/index.tsx +34 -44
- package/src/plugins/builtin/holders/headless.ts +8 -0
- package/src/plugins/builtin/insider/amendments.test.ts +112 -0
- package/src/plugins/builtin/insider/amendments.ts +65 -0
- package/src/plugins/builtin/insider/client.ts +4 -8
- package/src/plugins/builtin/insider/headless.test.ts +14 -0
- package/src/plugins/builtin/insider/headless.ts +27 -5
- package/src/plugins/builtin/insider/index.tsx +70 -36
- package/src/plugins/builtin/insider/insider-data.test.ts +50 -37
- package/src/plugins/builtin/insider/insider-data.ts +100 -31
- package/src/plugins/builtin/insider/model.ts +102 -55
- package/src/plugins/builtin/insider/pane.test.tsx +87 -0
- package/src/plugins/builtin/jobs/client.ts +85 -0
- package/src/plugins/builtin/jobs/headless.ts +215 -0
- package/src/plugins/builtin/jobs/index.tsx +83 -0
- package/src/plugins/builtin/jobs/model.test.ts +119 -0
- package/src/plugins/builtin/jobs/model.ts +350 -0
- package/src/plugins/builtin/jobs/pages.test.tsx +103 -0
- package/src/plugins/builtin/jobs/pages.ts +48 -0
- package/src/plugins/builtin/jobs/pane.tsx +710 -0
- package/src/plugins/builtin/jobs/share-bars.tsx +93 -0
- package/src/plugins/builtin/kelly-sizer/model.test.ts +6 -0
- package/src/plugins/builtin/kelly-sizer/model.ts +2 -2
- package/src/plugins/builtin/kelly-sizer/pane.tsx +21 -13
- package/src/plugins/builtin/kelly-sizer/portfolio.ts +9 -11
- package/src/plugins/builtin/kelly-sizer/sections.tsx +17 -23
- package/src/plugins/builtin/kelly-sizer/view.test.tsx +11 -0
- package/src/plugins/builtin/kelly-sizer/view.tsx +20 -58
- package/src/plugins/builtin/market-movers/headless.ts +9 -8
- package/src/plugins/builtin/market-movers/index.tsx +26 -21
- package/src/plugins/builtin/market-movers/integrity.test.ts +119 -0
- package/src/plugins/builtin/market-movers/model.ts +44 -10
- package/src/plugins/builtin/market-movers/pane-research.test.tsx +138 -0
- package/src/plugins/builtin/market-movers/screener.ts +77 -51
- package/src/plugins/builtin/market-movers/table.ts +12 -12
- package/src/plugins/builtin/market-valuation/align.ts +28 -17
- package/src/plugins/builtin/market-valuation/cache.ts +9 -1
- package/src/plugins/builtin/market-valuation/chart-projection.ts +11 -9
- package/src/plugins/builtin/market-valuation/chart-series.ts +14 -4
- package/src/plugins/builtin/market-valuation/client.test.ts +160 -21
- package/src/plugins/builtin/market-valuation/client.ts +54 -16
- package/src/plugins/builtin/market-valuation/defs.ts +13 -1
- package/src/plugins/builtin/market-valuation/detail.tsx +25 -43
- package/src/plugins/builtin/market-valuation/headless.test.ts +19 -2
- package/src/plugins/builtin/market-valuation/headless.ts +11 -6
- package/src/plugins/builtin/market-valuation/indicators.ts +51 -84
- package/src/plugins/builtin/market-valuation/model.test.ts +79 -43
- package/src/plugins/builtin/market-valuation/pane.test.tsx +47 -53
- package/src/plugins/builtin/market-valuation/pane.tsx +87 -100
- package/src/plugins/builtin/market-valuation/series.ts +18 -1
- package/src/plugins/builtin/market-valuation/sources.ts +74 -10
- package/src/plugins/builtin/market-valuation/trend.ts +2 -4
- package/src/plugins/builtin/market-valuation/view.ts +26 -23
- package/src/plugins/builtin/news/index.tsx +8 -3
- package/src/plugins/builtin/news/wire/breaking/pane.test.tsx +13 -41
- package/src/plugins/builtin/news/wire/breaking/pane.tsx +7 -3
- package/src/plugins/builtin/news/wire/index.tsx +30 -9
- package/src/plugins/builtin/news/wire/industry-pane.tsx +7 -3
- package/src/plugins/builtin/news/wire/news/detail-view.test.tsx +279 -0
- package/src/plugins/builtin/news/wire/news/detail-view.tsx +91 -47
- package/src/plugins/builtin/news/wire/news/footer.ts +17 -22
- package/src/plugins/builtin/news/wire/news/preset-pane.tsx +7 -3
- package/src/plugins/builtin/news/wire/news/table.tsx +11 -1
- package/src/plugins/builtin/news/wire/persisted-articles.ts +23 -2
- package/src/plugins/builtin/news/wire/rss/feed-xml.ts +104 -0
- package/src/plugins/builtin/news/wire/rss/parser.test.ts +63 -1
- package/src/plugins/builtin/news/wire/rss/parser.ts +70 -96
- package/src/plugins/builtin/news/wire/rss/source.test.ts +38 -1
- package/src/plugins/builtin/news/wire/rss/source.ts +26 -25
- package/src/plugins/builtin/notes/export.ts +57 -0
- package/src/plugins/builtin/notes/files.ts +6 -1
- package/src/plugins/builtin/notes/index.tsx +85 -10
- package/src/plugins/builtin/notes/migration.ts +80 -0
- package/src/plugins/builtin/notes/owner.tsx +129 -0
- package/src/plugins/builtin/notes/quick-notes-pane.test.tsx +10 -2
- package/src/plugins/builtin/notes/quick-notes-pane.tsx +130 -42
- package/src/plugins/builtin/notes/store.test.ts +245 -0
- package/src/plugins/builtin/notes/store.ts +304 -0
- package/src/plugins/builtin/notes/ticker-notes-tab.test.tsx +38 -68
- package/src/plugins/builtin/notes/ticker-notes-tab.tsx +60 -13
- package/src/plugins/builtin/options/analytics.test.ts +65 -0
- package/src/plugins/builtin/options/analytics.ts +62 -23
- package/src/plugins/builtin/options/calc-seed.test.ts +15 -3
- package/src/plugins/builtin/options/calc-seed.ts +18 -6
- package/src/plugins/builtin/options/chain-integrity.test.tsx +251 -0
- package/src/plugins/builtin/options/expiry-catalogue.ts +43 -0
- package/src/plugins/builtin/options/expiry-selection.test.tsx +317 -0
- package/src/plugins/builtin/options/footer.test.ts +38 -1
- package/src/plugins/builtin/options/footer.ts +69 -3
- package/src/plugins/builtin/options/live-quotes.test.ts +18 -4
- package/src/plugins/builtin/options/live-quotes.ts +7 -2
- package/src/plugins/builtin/options/market-reference.test.ts +36 -0
- package/src/plugins/builtin/options/market-reference.ts +70 -0
- package/src/plugins/builtin/options/quote-context.tsx +29 -0
- package/src/plugins/builtin/options/table.test.ts +100 -0
- package/src/plugins/builtin/options/table.ts +41 -11
- package/src/plugins/builtin/options/types.ts +1 -0
- package/src/plugins/builtin/options/view.test.tsx +271 -43
- package/src/plugins/builtin/options/view.tsx +137 -65
- package/src/plugins/builtin/options-calculator/boundary-integrity.test.tsx +112 -0
- package/src/plugins/builtin/options-calculator/index.tsx +1 -1
- package/src/plugins/builtin/options-calculator/model.test.ts +70 -0
- package/src/plugins/builtin/options-calculator/model.ts +52 -6
- package/src/plugins/builtin/options-calculator/pane.test.tsx +44 -12
- package/src/plugins/builtin/options-calculator/pane.tsx +59 -61
- package/src/plugins/builtin/plugin-marketplace/ids.ts +2 -0
- package/src/plugins/builtin/plugin-marketplace/model.test.ts +238 -19
- package/src/plugins/builtin/plugin-marketplace/model.ts +219 -17
- package/src/plugins/builtin/plugin-marketplace/pane.tsx +426 -198
- package/src/plugins/builtin/plugin-marketplace/store.ts +56 -6
- package/src/plugins/builtin/plugin-module.ts +9 -6
- package/src/plugins/builtin/portfolio-list/account-metrics.test.ts +20 -0
- package/src/plugins/builtin/portfolio-list/account-metrics.ts +3 -4
- package/src/plugins/builtin/portfolio-list/bond-price-basis.test.ts +120 -0
- package/src/plugins/builtin/portfolio-list/cli/portfolio-command.ts +1 -1
- package/src/plugins/builtin/portfolio-list/cli/render.test.ts +261 -0
- package/src/plugins/builtin/portfolio-list/cli/render.ts +81 -27
- package/src/plugins/builtin/portfolio-list/cli/shared.ts +1 -1
- package/src/plugins/builtin/portfolio-list/column-values.ts +87 -123
- package/src/plugins/builtin/portfolio-list/command-bar.ts +1 -1
- package/src/plugins/builtin/portfolio-list/grid.tsx +3 -1
- package/src/plugins/builtin/portfolio-list/header.tsx +7 -41
- package/src/plugins/builtin/portfolio-list/metrics.test.ts +133 -1
- package/src/plugins/builtin/portfolio-list/mutations.test.ts +13 -0
- package/src/plugins/builtin/portfolio-list/mutations.ts +7 -1
- package/src/plugins/builtin/portfolio-list/pane/data.ts +4 -0
- package/src/plugins/builtin/portfolio-list/pane/index.test.tsx +153 -88
- package/src/plugins/builtin/portfolio-list/pane/index.tsx +43 -10
- package/src/plugins/builtin/portfolio-list/pane/streaming.ts +22 -8
- package/src/plugins/builtin/portfolio-list/position-cost-integrity.test.ts +101 -0
- package/src/plugins/builtin/portfolio-list/position-metrics.ts +166 -90
- package/src/plugins/builtin/portfolio-list/summary/index.tsx +31 -3
- package/src/plugins/builtin/portfolio-list/summary/totals.ts +71 -31
- package/src/plugins/builtin/portfolio-list/table.tsx +15 -1
- package/src/plugins/builtin/portfolio-list/use-cursor-neighbor-prefetch.test.tsx +96 -0
- package/src/plugins/builtin/portfolio-list/use-cursor-neighbor-prefetch.ts +87 -0
- package/src/plugins/builtin/portfolio-list/use-throttled-cursor-symbol.test.tsx +8 -5
- package/src/plugins/builtin/portfolio-list/use-throttled-cursor-symbol.ts +4 -1
- package/src/plugins/builtin/research/analyst-headless.test.ts +28 -0
- package/src/plugins/builtin/research/analyst-headless.ts +26 -22
- package/src/plugins/builtin/research/analyst-model.test.ts +36 -0
- package/src/plugins/builtin/research/analyst-model.ts +61 -17
- package/src/plugins/builtin/research/analyst-pane.test.tsx +120 -0
- package/src/plugins/builtin/research/analyst-pane.tsx +15 -7
- package/src/plugins/builtin/research/corporate-actions-pane.test.tsx +68 -0
- package/src/plugins/builtin/research/corporate-actions-pane.tsx +122 -29
- package/src/plugins/builtin/research/equity-diagnostic-pane.test.tsx +17 -46
- package/src/plugins/builtin/research/equity-diagnostic-pane.tsx +13 -24
- package/src/plugins/builtin/research/event-model.test.ts +137 -0
- package/src/plugins/builtin/research/event-model.ts +173 -33
- package/src/plugins/builtin/research/events-headless.test.ts +11 -0
- package/src/plugins/builtin/research/events-headless.ts +36 -19
- package/src/plugins/builtin/research/headless-schema.ts +16 -0
- package/src/plugins/builtin/research/headless.test.ts +18 -0
- package/src/plugins/builtin/research/headless.ts +19 -8
- package/src/plugins/builtin/research/index.test.ts +73 -5
- package/src/plugins/builtin/research/index.tsx +3 -0
- package/src/plugins/builtin/research/relative-valuation-headless.test.ts +192 -0
- package/src/plugins/builtin/research/relative-valuation-headless.ts +51 -0
- package/src/plugins/builtin/research/relative-valuation-model.ts +54 -0
- package/src/plugins/builtin/research/relative-valuation-pane.test.tsx +98 -0
- package/src/plugins/builtin/research/relative-valuation-pane.tsx +72 -71
- package/src/plugins/builtin/research-search/document-view.tsx +15 -28
- package/src/plugins/builtin/research-search/pane.test.tsx +11 -20
- package/src/plugins/builtin/research-search/pane.tsx +5 -9
- package/src/plugins/builtin/risk-factors/data.test.ts +53 -0
- package/src/plugins/builtin/risk-factors/data.ts +117 -0
- package/src/plugins/builtin/risk-factors/headless.test.ts +40 -0
- package/src/plugins/builtin/risk-factors/headless.ts +70 -0
- package/src/plugins/builtin/risk-factors/index.tsx +63 -0
- package/src/plugins/builtin/risk-factors/pane.test.tsx +52 -0
- package/src/plugins/builtin/risk-factors/pane.tsx +310 -0
- package/src/plugins/builtin/risk-factors/test-fixtures.ts +4 -0
- package/src/plugins/builtin/scanner/denied.tsx +7 -7
- package/src/plugins/builtin/scanner/feed.ts +2 -2
- package/src/plugins/builtin/scanner/flow-pane.tsx +17 -8
- package/src/plugins/builtin/scanner/hilo-pane.tsx +21 -7
- package/src/plugins/builtin/sec/filing-content.test.ts +16 -0
- package/src/plugins/builtin/sec/filing-content.ts +46 -5
- package/src/plugins/builtin/sec/filing-display.tsx +13 -7
- package/src/plugins/builtin/sec/filing-documents.ts +10 -0
- package/src/plugins/builtin/sec/headless.test.ts +27 -0
- package/src/plugins/builtin/sec/headless.ts +4 -2
- package/src/plugins/builtin/sec/index.tsx +125 -29
- package/src/plugins/builtin/sec/model.ts +41 -3
- package/src/plugins/builtin/sec/pane.test.tsx +152 -0
- package/src/plugins/builtin/sectors/client.test.ts +211 -0
- package/src/plugins/builtin/sectors/client.ts +89 -18
- package/src/plugins/builtin/sectors/headless.test.ts +59 -0
- package/src/plugins/builtin/sectors/headless.ts +20 -1
- package/src/plugins/builtin/sectors/index.tsx +21 -22
- package/src/plugins/builtin/sectors/pane-cache.test.tsx +78 -0
- package/src/plugins/builtin/sectors/sector-model.test.ts +59 -0
- package/src/plugins/builtin/sectors/sector-model.ts +89 -24
- package/src/plugins/builtin/shared/cloud-upgrade.ts +49 -15
- package/src/plugins/builtin/shared/headless-market-data.ts +40 -0
- package/src/plugins/builtin/shared/headless-options.ts +33 -0
- package/src/plugins/builtin/shared/pane-footer.ts +4 -6
- package/src/plugins/builtin/shared/research-cloud-session.test.tsx +143 -0
- package/src/plugins/builtin/shared/research-cloud-session.ts +16 -0
- package/src/plugins/builtin/shared/screener-live-quotes.test.ts +13 -0
- package/src/plugins/builtin/shared/screener-live-quotes.ts +10 -9
- package/src/plugins/builtin/shared/series-cache.test.ts +106 -0
- package/src/plugins/builtin/shared/series-cache.ts +94 -49
- package/src/plugins/builtin/shared/table-pane.ts +4 -1
- package/src/plugins/builtin/shared/ticker-request.test.tsx +137 -0
- package/src/plugins/builtin/shared/ticker-request.ts +11 -46
- package/src/plugins/builtin/shared/ticker-surface.test.ts +1 -1
- package/src/plugins/builtin/shared/ticker-surface.ts +4 -3
- package/src/plugins/builtin/shared/use-quote-board.test.tsx +73 -6
- package/src/plugins/builtin/shared/use-quote-board.ts +18 -10
- package/src/plugins/builtin/short-interest/client.test.ts +47 -0
- package/src/plugins/builtin/short-interest/client.ts +5 -10
- package/src/plugins/builtin/short-interest/model.ts +13 -4
- package/src/plugins/builtin/short-interest/pane.test.tsx +57 -0
- package/src/plugins/builtin/short-interest/pane.tsx +21 -69
- package/src/plugins/builtin/thirteenf/api.test.ts +91 -0
- package/src/plugins/builtin/thirteenf/api.ts +78 -88
- package/src/plugins/builtin/thirteenf/data.test.ts +177 -1
- package/src/plugins/builtin/thirteenf/data.ts +118 -38
- package/src/plugins/builtin/thirteenf/format.ts +2 -0
- package/src/plugins/builtin/thirteenf/headless.test.ts +36 -0
- package/src/plugins/builtin/thirteenf/headless.ts +27 -8
- package/src/plugins/builtin/thirteenf/model.test.ts +90 -24
- package/src/plugins/builtin/thirteenf/model.ts +129 -82
- package/src/plugins/builtin/thirteenf/pane.test.tsx +27 -92
- package/src/plugins/builtin/thirteenf/pane.tsx +55 -33
- package/src/plugins/builtin/thirteenf/table.ts +2 -3
- package/src/plugins/builtin/thirteenf/types.ts +13 -1
- package/src/plugins/builtin/ticker-detail/chart-tab-switch.test.tsx +17 -50
- package/src/plugins/builtin/ticker-detail/data-panes/historical-price-precision.test.tsx +120 -0
- package/src/plugins/builtin/ticker-detail/data-panes/historical-prices.test.tsx +41 -0
- package/src/plugins/builtin/ticker-detail/data-panes/historical-prices.tsx +36 -13
- package/src/plugins/builtin/ticker-detail/financials/aggregation.test.ts +79 -0
- package/src/plugins/builtin/ticker-detail/financials/aggregation.ts +90 -13
- package/src/plugins/builtin/ticker-detail/financials/model.test.ts +152 -0
- package/src/plugins/builtin/ticker-detail/financials/model.ts +139 -22
- package/src/plugins/builtin/ticker-detail/financials/period-integrity.test.tsx +77 -0
- package/src/plugins/builtin/ticker-detail/financials/schema.ts +3 -3
- package/src/plugins/builtin/ticker-detail/financials/tab.tsx +71 -49
- package/src/plugins/builtin/ticker-detail/fund-profile.test.tsx +118 -0
- package/src/plugins/builtin/ticker-detail/headless-schema.ts +59 -0
- package/src/plugins/builtin/ticker-detail/headless.test.ts +165 -0
- package/src/plugins/builtin/ticker-detail/headless.ts +150 -0
- package/src/plugins/builtin/ticker-detail/index.tsx +34 -22
- package/src/plugins/builtin/ticker-detail/overview/components.tsx +21 -22
- package/src/plugins/builtin/ticker-detail/overview/model.test.ts +118 -0
- package/src/plugins/builtin/ticker-detail/overview/model.ts +65 -43
- package/src/plugins/builtin/ticker-detail/overview/pane.tsx +2 -1
- package/src/plugins/builtin/ticker-detail/overview/types.ts +2 -0
- package/src/plugins/builtin/ticker-detail/overview-return-coverage.test.tsx +71 -0
- package/src/plugins/builtin/ticker-detail/overview-tab.tsx +92 -80
- package/src/plugins/builtin/ticker-detail/pane.tsx +42 -19
- package/src/plugins/builtin/ticker-detail/quote-footer.ts +28 -0
- package/src/plugins/builtin/ticker-detail/quote-monitor/card.tsx +18 -9
- package/src/plugins/builtin/ticker-detail/quote-monitor/index.test.tsx +21 -29
- package/src/plugins/builtin/ticker-detail/quote-monitor/retained-status.test.tsx +134 -0
- package/src/plugins/builtin/ticker-detail/quote-status.test.tsx +116 -0
- package/src/plugins/builtin/ticker-detail/quote-time-integrity.test.ts +42 -0
- package/src/plugins/builtin/ticker-research-plugin.ts +8 -0
- package/src/plugins/builtin/treasury-auctions/cache.test.ts +43 -1
- package/src/plugins/builtin/treasury-auctions/cache.ts +29 -67
- package/src/plugins/builtin/treasury-auctions/client.test.ts +26 -8
- package/src/plugins/builtin/treasury-auctions/client.ts +28 -4
- package/src/plugins/builtin/treasury-auctions/headless.ts +2 -0
- package/src/plugins/builtin/treasury-auctions/model.test.ts +22 -0
- package/src/plugins/builtin/treasury-auctions/model.ts +28 -25
- package/src/plugins/builtin/treasury-auctions/pane.test.tsx +7 -22
- package/src/plugins/builtin/treasury-auctions/pane.tsx +32 -37
- package/src/plugins/builtin/treasury-auctions/types.ts +2 -2
- package/src/plugins/builtin/volatility/index.tsx +18 -47
- package/src/plugins/builtin/world-indices/headless.ts +4 -3
- package/src/plugins/builtin/world-indices/index.tsx +12 -5
- package/src/plugins/builtin/world-indices/pane.test.tsx +55 -15
- package/src/plugins/builtin/world-indices/table.tsx +3 -3
- package/src/plugins/builtin/world-venue-map/map.desktop.test.tsx +12 -73
- package/src/plugins/builtin/world-venue-map/pane.tsx +5 -7
- package/src/plugins/builtin/yield-curve/chart.test.ts +32 -0
- package/src/plugins/builtin/yield-curve/chart.ts +37 -0
- package/src/plugins/builtin/yield-curve/headless.test.ts +23 -7
- package/src/plugins/builtin/yield-curve/headless.ts +24 -7
- package/src/plugins/builtin/yield-curve/history.test.ts +124 -0
- package/src/plugins/builtin/yield-curve/history.ts +89 -0
- package/src/plugins/builtin/yield-curve/index.tsx +112 -97
- package/src/plugins/builtin/yield-curve/pane.test.tsx +137 -0
- package/src/plugins/builtin/yield-curve/treasury-data.test.ts +15 -5
- package/src/plugins/builtin/yield-curve/treasury-data.ts +25 -17
- package/src/plugins/bundle.test.ts +44 -1
- package/src/plugins/bundle.ts +59 -7
- package/src/plugins/catalog-backend.test.ts +1 -1
- package/src/plugins/catalog-backend.ts +0 -2
- package/src/plugins/catalog-browser.test.ts +9 -3
- package/src/plugins/catalog-browser.ts +37 -2
- package/src/plugins/catalog-manifest.ts +1 -3
- package/src/plugins/catalog-ui.ts +2 -6
- package/src/plugins/current-target.ts +17 -0
- package/src/plugins/external-runtime.ts +70 -0
- package/src/plugins/health.ts +21 -0
- package/src/plugins/host-contract.ts +26 -0
- package/src/plugins/host-link.test.ts +133 -0
- package/src/plugins/host-link.ts +49 -10
- package/src/plugins/host-module-imports.test.ts +94 -0
- package/src/plugins/host-module-imports.ts +73 -0
- package/src/plugins/host-modules.ts +2 -51
- package/src/plugins/host-resolver.test.ts +96 -0
- package/src/plugins/host-resolver.ts +102 -0
- package/src/plugins/host-smoke.ts +103 -0
- package/src/plugins/launch-layout.test.ts +131 -0
- package/src/plugins/launch-layout.ts +148 -0
- package/src/plugins/loader.test.ts +54 -0
- package/src/plugins/loader.ts +138 -36
- package/src/plugins/manager-node.ts +41 -0
- package/src/plugins/ownership.ts +4 -3
- package/src/plugins/pane-manager/dock-tree.ts +4 -2
- package/src/plugins/pane-manager/layout-state.ts +11 -4
- package/src/plugins/pane-manager/queries.ts +5 -4
- package/src/plugins/pane-manager.test.ts +22 -0
- package/src/plugins/pane-state.ts +48 -0
- package/src/plugins/plugin-names.ts +32 -0
- package/src/plugins/registry/contributions.ts +65 -126
- package/src/plugins/registry/index.test.ts +71 -5
- package/src/plugins/registry/index.ts +181 -102
- package/src/plugins/registry/pane-settings.ts +20 -14
- package/src/plugins/registry/plugin-state.ts +5 -20
- package/src/plugins/registry/setup-command.test.ts +62 -0
- package/src/plugins/registry/setup-command.ts +93 -0
- package/src/plugins/registry/shared.ts +1 -3
- package/src/plugins/registry/slots.ts +1 -1
- package/src/plugins/runtime/context.tsx +1 -0
- package/src/plugins/runtime/index.tsx +15 -49
- package/src/plugins/runtime/state.ts +28 -47
- package/src/plugins/seed.test.ts +57 -4
- package/src/plugins/seed.ts +28 -9
- package/src/plugins/team-state.ts +70 -0
- package/src/plugins/ticker-navigation.ts +5 -0
- package/src/plugins/web-bundled.ts +42 -0
- package/src/public/i18n.ts +17 -0
- package/src/public/layout.ts +12 -0
- package/src/public/market-data.ts +19 -0
- package/src/public/pane-hooks.ts +8 -1
- package/src/public/public-api.test.ts +39 -282
- package/src/public/quotes.ts +50 -0
- package/src/public/react.ts +44 -0
- package/src/public/remote.ts +23 -0
- package/src/public/test-support.ts +46 -1
- package/src/public/tickers.ts +40 -0
- package/src/public/time-series.ts +5 -0
- package/src/public/utils.ts +38 -2
- package/src/react/async-resource.test.tsx +106 -0
- package/src/react/async-resource.ts +65 -0
- package/src/react/plugins/plugin-slot.tsx +2 -10
- package/src/react/use-throttled-commit-value.ts +18 -1
- package/src/remote/app-host.tsx +17 -2
- package/src/remote/controller.test.ts +109 -3
- package/src/remote/controller.ts +44 -2
- package/src/remote/schema.ts +15 -0
- package/src/remote/semantic-tree.tsx +15 -7
- package/src/renderers/browser/app-services.ts +19 -52
- package/src/renderers/browser/bundled-plugins.test.ts +41 -0
- package/src/renderers/browser/bundled-plugins.ts +60 -0
- package/src/renderers/browser/cloud-transport.ts +8 -2
- package/src/renderers/browser/config-host.test.ts +70 -0
- package/src/renderers/browser/config-host.ts +75 -11
- package/src/renderers/browser/deeplink-bridge.test.ts +8 -4
- package/src/renderers/browser/deeplink-bridge.ts +18 -0
- package/src/renderers/browser/http-proxy-transport.test.ts +98 -0
- package/src/renderers/browser/http-proxy-transport.ts +83 -0
- package/src/renderers/browser/main.tsx +18 -2
- package/src/renderers/browser/research-entry.test.ts +24 -0
- package/src/renderers/browser/research-entry.ts +16 -2
- package/src/renderers/browser/storage.test.ts +7 -7
- package/src/renderers/cloudflare/http-proxy.test.ts +122 -0
- package/src/renderers/cloudflare/http-proxy.ts +197 -0
- package/src/renderers/cloudflare/worker.ts +7 -0
- package/src/renderers/electrobun/bun/core-capabilities.ts +0 -160
- package/src/renderers/electrobun/bun/desktop/host-requests.ts +4 -0
- package/src/renderers/electrobun/bun/external-plugins.ts +178 -63
- package/src/renderers/electrobun/bun/index.ts +49 -9
- package/src/renderers/electrobun/shared/protocol.ts +40 -4
- package/src/renderers/electrobun/view/app-services.ts +36 -90
- package/src/renderers/electrobun/view/backend-rpc.ts +12 -2
- package/src/renderers/electrobun/view/build-assets.ts +0 -1
- package/src/renderers/electrobun/view/capability-stream-client.ts +51 -0
- package/src/renderers/electrobun/view/cli-pane-shot-entry.tsx +232 -416
- package/src/renderers/electrobun/view/cli-pane-shot-frame.test.tsx +67 -0
- package/src/renderers/electrobun/view/cli-pane-shot-frame.tsx +39 -0
- package/src/renderers/electrobun/view/data-table/dom.ts +3 -0
- package/src/renderers/electrobun/view/data-table/frozen-column.test.tsx +73 -0
- package/src/renderers/electrobun/view/data-table/frozen-column.ts +22 -0
- package/src/renderers/electrobun/view/data-table/horizontal-navigation.test.tsx +77 -0
- package/src/renderers/electrobun/view/data-table/index.test.tsx +125 -0
- package/src/renderers/electrobun/view/data-table/index.tsx +48 -6
- package/src/renderers/electrobun/view/data-table/row.tsx +32 -3
- package/src/renderers/electrobun/view/desktop/control-styles.ts +7 -0
- package/src/renderers/electrobun/view/desktop/controls.test.tsx +141 -48
- package/src/renderers/electrobun/view/desktop/controls.tsx +86 -39
- package/src/renderers/electrobun/view/desktop/list-view.tsx +44 -9
- package/src/renderers/electrobun/view/dom-ui-host.tsx +4 -2
- package/src/renderers/electrobun/view/external-plugins.test.ts +13 -1
- package/src/renderers/electrobun/view/external-plugins.ts +47 -35
- package/src/renderers/electrobun/view/host/block-glyph-canvas.tsx +115 -0
- package/src/renderers/electrobun/view/host/box.test.tsx +50 -89
- package/src/renderers/electrobun/view/host/input.tsx +7 -1
- package/src/renderers/electrobun/view/host/media-surface.tsx +1 -2
- package/src/renderers/electrobun/view/host/scroll-box.desktop.test.tsx +26 -0
- package/src/renderers/electrobun/view/host/scroll-box.tsx +14 -6
- package/src/renderers/electrobun/view/host/text.tsx +28 -0
- package/src/renderers/electrobun/view/http-fetch.ts +3 -14
- package/src/renderers/electrobun/view/input-host.test.tsx +11 -47
- package/src/renderers/electrobun/view/input-host.tsx +1 -1
- package/src/renderers/electrobun/view/main.tsx +38 -6
- package/src/renderers/electrobun/view/native-stubs/native-stubs.test.ts +2 -7
- package/src/renderers/electrobun/view/remote/asset-data-client.ts +2 -0
- package/src/renderers/electrobun/view/remote/persistence.ts +2 -2
- package/src/renderers/electrobun/view/remote/quote-subscription-registry.ts +6 -1
- package/src/renderers/electrobun/view/rpc-codec.test.ts +64 -0
- package/src/renderers/electrobun/view/rpc-codec.ts +35 -0
- package/src/renderers/electrobun/view/screenshot-watermark.test.ts +48 -0
- package/src/renderers/electrobun/view/screenshot-watermark.ts +105 -0
- package/src/renderers/electrobun/view/styles.css +16 -0
- package/src/renderers/electrobun/view/test-utils.tsx +76 -0
- package/src/renderers/electrobun/view/toast-host.test.tsx +8 -25
- package/src/renderers/electrobun/view/ui-host.tsx +0 -3
- package/src/renderers/electrobun/view/window-fullscreen.ts +57 -0
- package/src/renderers/opentui/interaction-performance.ts +29 -3
- package/src/renderers/opentui/scrollbox-layout.ts +35 -0
- package/src/renderers/opentui/start.tsx +7 -40
- package/src/renderers/opentui/test-utils.tsx +117 -6
- package/src/renderers/opentui/ui-host.tsx +1 -1
- package/src/renderers/share/chart.test.ts +52 -0
- package/src/renderers/share/chart.ts +74 -0
- package/src/renderers/share/main.tsx +10 -2
- package/src/renderers/share/styles.css +29 -0
- package/src/renderers/share/view.test.tsx +20 -0
- package/src/renderers/share/view.tsx +24 -15
- package/src/shares/api.test.ts +15 -0
- package/src/shares/live.ts +27 -0
- package/src/shares/pane.ts +3 -0
- package/src/shares/payload.ts +35 -3
- package/src/sources/gloomberb-cloud/history-coverage.test.ts +119 -0
- package/src/sources/gloomberb-cloud/index.test.ts +307 -20
- package/src/sources/gloomberb-cloud/index.ts +176 -62
- package/src/sources/gloomberb-cloud/news.ts +11 -3
- package/src/sources/gloomberb-cloud/normalizers.test.ts +27 -1
- package/src/sources/gloomberb-cloud/normalizers.ts +29 -8
- package/src/sources/gloomberb-cloud/quote-metadata.test.ts +50 -0
- package/src/sources/gloomberb-cloud/valuation-observations.ts +29 -0
- package/src/sources/history-coverage.test.ts +40 -0
- package/src/sources/history-coverage.ts +97 -0
- package/src/sources/listing-history.ts +52 -0
- package/src/sources/listing-target.ts +41 -0
- package/src/sources/provider-router/arca-cache.test.ts +97 -0
- package/src/sources/provider-router/batches.ts +21 -5
- package/src/sources/provider-router/broker-session.test.ts +52 -0
- package/src/sources/provider-router/brokers.ts +1 -0
- package/src/sources/provider-router/cache.test.ts +133 -0
- package/src/sources/provider-router/cache.ts +113 -8
- package/src/sources/provider-router/cached-financials.test.ts +104 -14
- package/src/sources/provider-router/cached-routes.test.ts +212 -0
- package/src/sources/provider-router/cached-routes.ts +223 -0
- package/src/sources/provider-router/connection-health.ts +1 -0
- package/src/sources/provider-router/financial-routes.ts +90 -26
- package/src/sources/provider-router/financials.test.ts +97 -1
- package/src/sources/provider-router/financials.ts +217 -44
- package/src/sources/provider-router/fixtures/quarterly-source-disagreements.json +438 -0
- package/src/sources/provider-router/history-boundary-cache.test.ts +72 -0
- package/src/sources/provider-router/history-gap-cache.test.ts +84 -0
- package/src/sources/provider-router/history-gaps.test.ts +141 -0
- package/src/sources/provider-router/history.test.ts +124 -3
- package/src/sources/provider-router/history.ts +156 -46
- package/src/sources/provider-router/index.test.ts +19 -13
- package/src/sources/provider-router/index.ts +83 -18
- package/src/sources/provider-router/listing-history.test.ts +139 -0
- package/src/sources/provider-router/listing-identity.test.ts +128 -0
- package/src/sources/provider-router/non-company-metadata.test.ts +95 -0
- package/src/sources/provider-router/o-income-basis.test.ts +64 -0
- package/src/sources/provider-router/primary.ts +44 -8
- package/src/sources/provider-router/profile-enrichment.test.ts +171 -0
- package/src/sources/provider-router/quote-completion.test.ts +62 -0
- package/src/sources/provider-router/quote-domain.test.ts +92 -0
- package/src/sources/provider-router/routing.ts +2 -30
- package/src/sources/provider-router/search.ts +2 -11
- package/src/sources/provider-router/shell-history-cache.test.ts +131 -0
- package/src/sources/provider-router/statement-history.test.ts +71 -0
- package/src/sources/provider-router/statement-history.ts +15 -0
- package/src/sources/provider-router/statement-observations.test.ts +126 -0
- package/src/sources/provider-router/streaming.ts +1 -1
- package/src/sources/provider-router/supplemental.ts +2 -389
- package/src/sources/provider-router/valuation-retractions.test.ts +280 -0
- package/src/sources/sec-edgar-shares.fixture.json +188 -0
- package/src/sources/sec-edgar-shares.test.ts +66 -0
- package/src/sources/sec-edgar.test.ts +146 -0
- package/src/sources/sec-edgar.ts +136 -37
- package/src/sources/sec-income-attribution.test.ts +93 -0
- package/src/sources/yahoo-finance/financials.ts +23 -23
- package/src/sources/yahoo-finance/mappers.test.ts +95 -1
- package/src/sources/yahoo-finance/mappers.ts +104 -43
- package/src/sources/yahoo-finance/options.test.ts +13 -0
- package/src/sources/yahoo-finance/options.ts +4 -2
- package/src/sources/yahoo-finance/quote-summary.ts +25 -12
- package/src/sources/yahoo-finance/requests.test.ts +37 -0
- package/src/sources/yahoo-finance/requests.ts +9 -2
- package/src/sources/yahoo-finance/snapshots.test.ts +140 -0
- package/src/sources/yahoo-finance/snapshots.ts +21 -11
- package/src/sources/yahoo-finance/symbols.test.ts +8 -0
- package/src/sources/yahoo-finance/symbols.ts +60 -11
- package/src/sources/yahoo-finance/types.ts +8 -0
- package/src/sources/yahoo-finance/yahoo-chart-interval.ts +18 -0
- package/src/sources/yahoo-finance.test.ts +20 -0
- package/src/sources/yahoo-finance.ts +54 -20
- package/src/state/app/bootstrap.test.ts +124 -0
- package/src/state/app/bootstrap.ts +106 -130
- package/src/state/app/context/index.test.tsx +56 -0
- package/src/state/app/context/index.tsx +101 -31
- package/src/state/app/context/selector.test.tsx +38 -2
- package/src/state/config-save-scheduler.ts +16 -4
- package/src/state/hooks/inline-ticker-failures.test.ts +77 -0
- package/src/state/hooks/inline-ticker-failures.ts +100 -0
- package/src/state/hooks/inline-tickers.test.tsx +47 -11
- package/src/state/hooks/inline-tickers.ts +254 -85
- package/src/state/hooks/quote-streaming.ts +6 -13
- package/src/state/hooks/session-snapshot.ts +9 -5
- package/src/state/persist-scheduler.test.ts +54 -1
- package/src/state/persist-scheduler.ts +36 -3
- package/src/state/session-persistence.test.ts +46 -0
- package/src/sync/core-contributors.test.ts +35 -6
- package/src/sync/core-contributors.ts +30 -27
- package/src/test-support/market-session.ts +12 -0
- package/src/test-support/pane.tsx +52 -0
- package/src/test-support/plugin-runtime.ts +5 -0
- package/src/theme/color-utils.ts +90 -33
- package/src/tickers/instrument-label.ts +10 -0
- package/src/tickers/list.test.ts +1 -0
- package/src/tickers/list.ts +1 -1
- package/src/tickers/metadata.ts +4 -1
- package/src/tickers/open-target.test.ts +86 -0
- package/src/tickers/open-target.ts +48 -9
- package/src/tickers/search/identity.ts +19 -0
- package/src/tickers/search/index.test.ts +263 -8
- package/src/tickers/search/index.ts +164 -29
- package/src/tickers/search/ranking.ts +85 -9
- package/src/tickers/search/types.ts +5 -1
- package/src/tickers/search/upsert.ts +14 -6
- package/src/tickers/search-contract-context.test.tsx +161 -0
- package/src/tickers/search-contract-templates.test.ts +83 -0
- package/src/tickers/selection.ts +21 -0
- package/src/time-series/alignment.ts +11 -3
- package/src/time-series/bond-price-history.test.ts +52 -0
- package/src/time-series/chart-data.test.ts +44 -12
- package/src/time-series/chart-data.ts +36 -8
- package/src/time-series/economic.test.ts +44 -0
- package/src/time-series/economic.ts +42 -0
- package/src/time-series/field-catalog.ts +3 -2
- package/src/time-series/financial-history-request.test.ts +20 -0
- package/src/time-series/financial-period-coverage.test.ts +37 -0
- package/src/time-series/financial-period-coverage.ts +59 -0
- package/src/time-series/financial-period-gaps.test.ts +128 -0
- package/src/time-series/fixtures/q4-reported-common-income.json +394 -0
- package/src/time-series/fixtures/q4-reported-per-share.json +305 -0
- package/src/time-series/forward-valuation.test.ts +131 -0
- package/src/time-series/forward-valuation.ts +247 -0
- package/src/time-series/fundamentals.test.ts +111 -24
- package/src/time-series/fundamentals.ts +260 -131
- package/src/time-series/hooks.ts +7 -3
- package/src/time-series/legacy-contract-live.test.ts +23 -0
- package/src/time-series/live-quotes.test.ts +5 -2
- package/src/time-series/live-quotes.ts +23 -29
- package/src/time-series/market-price-units.test.ts +75 -0
- package/src/time-series/market.ts +55 -15
- package/src/time-series/price-comparison.test.ts +233 -0
- package/src/time-series/price-comparison.ts +133 -0
- package/src/time-series/price-history-integrity-window.test.ts +137 -0
- package/src/time-series/price-history-integrity.test.ts +195 -0
- package/src/time-series/q4-common-income.test.ts +63 -0
- package/src/time-series/q4-per-share.test.ts +144 -0
- package/src/time-series/reporting-currency.test.ts +99 -0
- package/src/time-series/reporting-currency.ts +37 -0
- package/src/time-series/reporting.ts +38 -2
- package/src/time-series/resolve.test.ts +528 -366
- package/src/time-series/resolve.ts +322 -76
- package/src/time-series/sec-eps-research.test.ts +55 -0
- package/src/time-series/session-history-domain.test.ts +160 -0
- package/src/{cli/pane-functions/intraday-shot.ts → time-series/session-history.ts} +96 -42
- package/src/time-series/spec-studies.test.ts +177 -6
- package/src/time-series/studies.ts +173 -38
- package/src/time-series/transforms.test.ts +38 -2
- package/src/time-series/transforms.ts +5 -1
- package/src/time-series/types.ts +30 -0
- package/src/time-series/use-chart-resolution.test.tsx +72 -4
- package/src/time-series/use-chart-resolution.ts +45 -28
- package/src/time-series/valuation-currency.test.ts +127 -0
- package/src/time-series/valuation-currency.ts +46 -0
- package/src/time-series/valuation-denominator.test.ts +240 -0
- package/src/time-series/valuation-live-status.test.ts +63 -0
- package/src/time-series/valuation-price.test.ts +264 -0
- package/src/time-series/valuation-price.ts +68 -0
- package/src/types/broker.ts +2 -1
- package/src/types/config.test.ts +31 -0
- package/src/types/config.ts +49 -10
- package/src/types/data-provider.ts +43 -0
- package/src/types/exchange-rate.ts +13 -0
- package/src/types/financials.ts +164 -2
- package/src/types/headless.ts +23 -0
- package/src/types/instrument.ts +11 -0
- package/src/types/plugin.ts +108 -2
- package/src/types/ticker.ts +10 -2
- package/src/ui/context-menu.test.ts +2 -1
- package/src/ui/context-menu.tsx +3 -3
- package/src/ui/host.tsx +6 -2
- package/src/ui/index.tsx +3 -4
- package/src/updater.test.ts +17 -1
- package/src/updater.ts +4 -2
- package/src/utils/dom-screenshot.test.ts +52 -0
- package/src/utils/dom-screenshot.ts +70 -15
- package/src/utils/exchange-rate-snapshot.test.ts +22 -0
- package/src/utils/exchange-rate-snapshot.ts +62 -0
- package/src/utils/exchanges.test.ts +24 -0
- package/src/utils/exchanges.ts +22 -11
- package/src/utils/financial-statements.test.ts +74 -1
- package/src/utils/financial-statements.ts +119 -14
- package/src/utils/format.test.ts +21 -1
- package/src/utils/format.ts +56 -23
- package/src/utils/fundamentals.ts +15 -0
- package/src/utils/fx-status.test.ts +16 -0
- package/src/utils/fx-status.ts +46 -0
- package/src/utils/http-proxy-response.ts +44 -0
- package/src/utils/http-transport.ts +21 -1
- package/src/utils/income-statement.ts +46 -0
- package/src/utils/instrument-identity.test.ts +26 -0
- package/src/utils/instrument-identity.ts +35 -0
- package/src/utils/latest-financial-period.test.ts +19 -0
- package/src/utils/latest-financial-period.ts +26 -0
- package/src/utils/market-capitalization-consumers.test.ts +59 -0
- package/src/utils/market-capitalization.test.ts +38 -0
- package/src/utils/market-capitalization.ts +58 -0
- package/src/utils/options.test.ts +20 -0
- package/src/utils/options.ts +4 -4
- package/src/utils/perf-marks.ts +26 -0
- package/src/utils/plugin-proxy-hosts.json +16 -0
- package/src/utils/plugin-proxy-hosts.ts +25 -0
- package/src/utils/price-earnings.test.ts +39 -0
- package/src/utils/price-earnings.ts +13 -0
- package/src/utils/price-history-integrity.ts +61 -0
- package/src/utils/price-history.test.ts +41 -3
- package/src/utils/price-history.ts +90 -6
- package/src/utils/reported-money.test.ts +25 -0
- package/src/utils/reported-money.ts +31 -0
- package/src/utils/screenshot-watermark.ts +27 -0
- package/src/utils/sec-eps-basis.test.ts +82 -0
- package/src/utils/sec-eps-basis.ts +152 -0
- package/src/utils/sec.test.ts +12 -10
- package/src/utils/sec.ts +4 -3
- package/src/utils/semver.test.ts +31 -0
- package/src/utils/semver.ts +48 -0
- package/src/utils/sort-values.test.ts +11 -0
- package/src/utils/sort-values.ts +2 -0
- package/src/utils/statement-observations.ts +121 -0
- package/src/cli/commands/automation.test.ts +0 -211
- package/src/components/chart/native/surface/sync.ts +0 -34
- package/src/components/command-bar/panel/body.tsx +0 -301
- package/src/components/onboarding/account-step/chooser-panel.tsx +0 -51
- package/src/plugins/builtin/ai/agent-history.ts +0 -143
- package/src/plugins/builtin/ai/ask-ai-detail-tab.tsx +0 -466
- package/src/plugins/builtin/ai/ask-ai.test.tsx +0 -365
- package/src/plugins/builtin/ai/index.test.ts +0 -302
- package/src/plugins/builtin/ai/index.tsx +0 -440
- package/src/plugins/builtin/ai/pane-settings.test.ts +0 -155
- package/src/plugins/builtin/ai/pane-settings.ts +0 -319
- package/src/plugins/builtin/ai/pi/credential-store.test.ts +0 -80
- package/src/plugins/builtin/ai/pi/credential-store.ts +0 -138
- package/src/plugins/builtin/ai/pi/file-store.ts +0 -138
- package/src/plugins/builtin/ai/pi/host.test.ts +0 -500
- package/src/plugins/builtin/ai/pi/host.ts +0 -565
- package/src/plugins/builtin/ai/pi/index.ts +0 -5
- package/src/plugins/builtin/ai/pi/models-store.test.ts +0 -44
- package/src/plugins/builtin/ai/pi/models-store.ts +0 -141
- package/src/plugins/builtin/ai/pi/providers.ts +0 -68
- package/src/plugins/builtin/ai/pi/runtime.test.ts +0 -240
- package/src/plugins/builtin/ai/pi/runtime.ts +0 -636
- package/src/plugins/builtin/ai/providers.test.ts +0 -68
- package/src/plugins/builtin/ai/providers.ts +0 -191
- package/src/plugins/builtin/ai/runner-selection.test.ts +0 -174
- package/src/plugins/builtin/ai/runner-selection.ts +0 -193
- package/src/plugins/builtin/ai/runner-selector.tsx +0 -153
- package/src/plugins/builtin/ai/runner.test.ts +0 -198
- package/src/plugins/builtin/ai/runner.ts +0 -316
- package/src/plugins/builtin/ai/screener/contract.test.ts +0 -70
- package/src/plugins/builtin/ai/screener/contract.ts +0 -136
- package/src/plugins/builtin/ai/screener/editor-runtime.ts +0 -160
- package/src/plugins/builtin/ai/screener/editor.tsx +0 -131
- package/src/plugins/builtin/ai/screener/footer.ts +0 -104
- package/src/plugins/builtin/ai/screener/keyboard.ts +0 -106
- package/src/plugins/builtin/ai/screener/market-runtime.ts +0 -101
- package/src/plugins/builtin/ai/screener/model.test.ts +0 -24
- package/src/plugins/builtin/ai/screener/model.ts +0 -113
- package/src/plugins/builtin/ai/screener/pane.test.tsx +0 -479
- package/src/plugins/builtin/ai/screener/pane.tsx +0 -438
- package/src/plugins/builtin/ai/screener/results-view.tsx +0 -144
- package/src/plugins/builtin/ai/screener/results.ts +0 -139
- package/src/plugins/builtin/ai/screener/runner.ts +0 -164
- package/src/plugins/builtin/ai/screener/tabs-bar.tsx +0 -65
- package/src/plugins/builtin/ai/settings.ts +0 -81
- package/src/plugins/builtin/ai/ticker-context.ts +0 -65
- package/src/plugins/builtin/ai/use-runtime-providers.ts +0 -28
- package/src/plugins/builtin/ai/workspace/model.test.ts +0 -227
- package/src/plugins/builtin/ai/workspace/model.ts +0 -283
- package/src/plugins/builtin/ai/workspace/pane.test.tsx +0 -197
- package/src/plugins/builtin/ai/workspace/pane.tsx +0 -907
- package/src/plugins/builtin/chat/message/action-chip.tsx +0 -39
- package/src/plugins/builtin/cloud/askg/verify.ts +0 -130
- package/src/plugins/builtin/earnings/data/data.test.ts +0 -90
- package/src/plugins/builtin/earnings/data/data.ts +0 -115
- package/src/plugins/builtin/fear-greed/cache.test.ts +0 -90
- package/src/plugins/builtin/fear-greed/cache.ts +0 -154
- package/src/plugins/builtin/fear-greed/charts.tsx +0 -305
- package/src/plugins/builtin/fear-greed/data.test.ts +0 -72
- package/src/plugins/builtin/fear-greed/data.ts +0 -375
- package/src/plugins/builtin/fear-greed/format.ts +0 -87
- package/src/plugins/builtin/fear-greed/headless.test.ts +0 -53
- package/src/plugins/builtin/fear-greed/headless.ts +0 -84
- package/src/plugins/builtin/fear-greed/index.tsx +0 -43
- package/src/plugins/builtin/fear-greed/pane.tsx +0 -169
- package/src/plugins/builtin/ipo-calendar/cache.ts +0 -101
- package/src/plugins/builtin/ipo-calendar/client.test.ts +0 -31
- package/src/plugins/builtin/ipo-calendar/client.ts +0 -311
- package/src/plugins/builtin/ipo-calendar/headless.test.ts +0 -89
- package/src/plugins/builtin/ipo-calendar/headless.ts +0 -127
- package/src/plugins/builtin/ipo-calendar/index.tsx +0 -68
- package/src/plugins/builtin/ipo-calendar/model.ts +0 -133
- package/src/plugins/builtin/ipo-calendar/pane.tsx +0 -328
- package/src/plugins/builtin/ipo-calendar/types.ts +0 -19
- package/src/plugins/builtin/market-halts/client.ts +0 -114
- package/src/plugins/builtin/market-halts/index.tsx +0 -30
- package/src/plugins/builtin/market-halts/model.test.ts +0 -187
- package/src/plugins/builtin/market-halts/model.ts +0 -291
- package/src/plugins/builtin/market-halts/pane.tsx +0 -256
- package/src/plugins/builtin/market-heatmap/data.test.ts +0 -122
- package/src/plugins/builtin/market-heatmap/data.ts +0 -305
- package/src/plugins/builtin/market-heatmap/index.tsx +0 -400
- package/src/plugins/builtin/market-valuation/model.ts +0 -8
- package/src/plugins/builtin/notes/sync.test.ts +0 -49
- package/src/plugins/builtin/notes/sync.ts +0 -98
- package/src/plugins/builtin/polls/client.ts +0 -57
- package/src/plugins/builtin/polls/hooks.ts +0 -20
- package/src/plugins/builtin/polls/index.tsx +0 -35
- package/src/plugins/builtin/polls/normalize.test.ts +0 -230
- package/src/plugins/builtin/polls/normalize.ts +0 -319
- package/src/plugins/builtin/polls/pane.tsx +0 -722
- package/src/plugins/builtin/polls/types.ts +0 -77
- package/src/plugins/builtin/scanner/waiting.tsx +0 -11
- package/src/plugins/builtin/shared/public-share.ts +0 -23
- package/src/plugins/builtin/tv/channels.ts +0 -27
- package/src/plugins/builtin/tv/index.tsx +0 -40
- package/src/plugins/builtin/tv/pane.tsx +0 -346
- package/src/plugins/builtin/tv/youtube-embed.test.ts +0 -84
- package/src/plugins/builtin/tv/youtube-embed.ts +0 -173
- package/src/plugins/builtin/tv/youtube-stream.ts +0 -125
- package/src/plugins/catalog-manifest.test.ts +0 -58
- package/src/plugins/prediction-markets/backend-plugin.ts +0 -21
- package/src/plugins/prediction-markets/cache.ts +0 -163
- package/src/plugins/prediction-markets/capability.test.ts +0 -281
- package/src/plugins/prediction-markets/capability.ts +0 -171
- package/src/plugins/prediction-markets/categories.ts +0 -213
- package/src/plugins/prediction-markets/chart.tsx +0 -158
- package/src/plugins/prediction-markets/cli.ts +0 -28
- package/src/plugins/prediction-markets/columns.ts +0 -134
- package/src/plugins/prediction-markets/controller/catalog.ts +0 -395
- package/src/plugins/prediction-markets/controller/data.ts +0 -177
- package/src/plugins/prediction-markets/controller/detail.ts +0 -247
- package/src/plugins/prediction-markets/controller/effects.ts +0 -253
- package/src/plugins/prediction-markets/controller/index.ts +0 -368
- package/src/plugins/prediction-markets/controller/keyboard.ts +0 -245
- package/src/plugins/prediction-markets/controller/live-updates.ts +0 -86
- package/src/plugins/prediction-markets/controller/selection.ts +0 -59
- package/src/plugins/prediction-markets/controller/status.ts +0 -104
- package/src/plugins/prediction-markets/detail/book.tsx +0 -144
- package/src/plugins/prediction-markets/detail/outcomes.tsx +0 -101
- package/src/plugins/prediction-markets/detail/overview.tsx +0 -84
- package/src/plugins/prediction-markets/detail/pane.tsx +0 -344
- package/src/plugins/prediction-markets/detail/rules.tsx +0 -31
- package/src/plugins/prediction-markets/detail/shared.tsx +0 -49
- package/src/plugins/prediction-markets/detail/trades.tsx +0 -101
- package/src/plugins/prediction-markets/detail.test.tsx +0 -94
- package/src/plugins/prediction-markets/headless.test.ts +0 -119
- package/src/plugins/prediction-markets/headless.ts +0 -255
- package/src/plugins/prediction-markets/index.tsx +0 -117
- package/src/plugins/prediction-markets/keyboard.ts +0 -65
- package/src/plugins/prediction-markets/launch.test.ts +0 -126
- package/src/plugins/prediction-markets/launch.ts +0 -275
- package/src/plugins/prediction-markets/metrics.ts +0 -328
- package/src/plugins/prediction-markets/navigation.ts +0 -77
- package/src/plugins/prediction-markets/outcome-order.ts +0 -19
- package/src/plugins/prediction-markets/pane.test.tsx +0 -562
- package/src/plugins/prediction-markets/pane.tsx +0 -347
- package/src/plugins/prediction-markets/plugin.test.tsx +0 -645
- package/src/plugins/prediction-markets/rows.ts +0 -229
- package/src/plugins/prediction-markets/services/fetch.ts +0 -121
- package/src/plugins/prediction-markets/services/kalshi/adapter.ts +0 -398
- package/src/plugins/prediction-markets/services/kalshi/normalize.ts +0 -211
- package/src/plugins/prediction-markets/services/kalshi/types.ts +0 -103
- package/src/plugins/prediction-markets/services/polymarket/adapter.ts +0 -177
- package/src/plugins/prediction-markets/services/polymarket/detail.ts +0 -356
- package/src/plugins/prediction-markets/services/polymarket/normalize.ts +0 -239
- package/src/plugins/prediction-markets/services/polymarket/types.ts +0 -66
- package/src/plugins/prediction-markets/services/polymarket/ws.ts +0 -128
- package/src/plugins/prediction-markets/settings.ts +0 -163
- package/src/plugins/prediction-markets/test-helpers.tsx +0 -591
- package/src/plugins/prediction-markets/types.ts +0 -179
- package/src/plugins/registry/context.ts +0 -218
- package/src/renderers/electrobun/bun/desktop/media.ts +0 -17
- package/src/renderers/electrobun/view/ai-host.ts +0 -198
- package/src/renderers/electrobun/view/native-stubs/chart/surface-sync.ts +0 -1
- package/src/renderers/electrobun/view/resource-store.test.ts +0 -44
- package/src/shares/chart-snapshot.test.ts +0 -34
- package/src/shares/chart-snapshot.ts +0 -28
- package/src/sources/provider-router/document-routes.ts +0 -203
- package/src/types/media.ts +0 -19
|
@@ -4,6 +4,9 @@ import { apiClient, setCloudApiFetchTransport } from "./index";
|
|
|
4
4
|
import { publishableMarketplaceLayout } from "../layout-marketplace/payload";
|
|
5
5
|
import { createDefaultConfig } from "../types/config";
|
|
6
6
|
import type { PaneDef } from "../types/plugin";
|
|
7
|
+
import { GloomberbCloudProvider } from "../sources/gloomberb-cloud";
|
|
8
|
+
import type { Quote } from "../types/financials";
|
|
9
|
+
import { getActiveQuoteDisplay } from "../market-data/market/status";
|
|
7
10
|
|
|
8
11
|
const originalFetch = globalThis.fetch;
|
|
9
12
|
const originalWebSocket = globalThis.WebSocket;
|
|
@@ -19,7 +22,10 @@ const verifiedUser: AuthUser = {
|
|
|
19
22
|
updatedAt: "2026-03-30T00:00:00.000Z",
|
|
20
23
|
};
|
|
21
24
|
|
|
22
|
-
function createResponse(
|
|
25
|
+
function createResponse(
|
|
26
|
+
body: unknown,
|
|
27
|
+
options: { status?: number; cookies?: string[] } = {},
|
|
28
|
+
): Response {
|
|
23
29
|
const headers = {
|
|
24
30
|
getSetCookie: () => options.cookies ?? [],
|
|
25
31
|
get: (name: string) => {
|
|
@@ -36,7 +42,12 @@ function createResponse(body: unknown, options: { status?: number; cookies?: str
|
|
|
36
42
|
} as Response;
|
|
37
43
|
}
|
|
38
44
|
|
|
39
|
-
function mockFetch(
|
|
45
|
+
function mockFetch(
|
|
46
|
+
handler: (
|
|
47
|
+
input: Request | string | URL,
|
|
48
|
+
init?: RequestInit,
|
|
49
|
+
) => Response | Promise<Response>,
|
|
50
|
+
): typeof fetch {
|
|
40
51
|
return handler as unknown as typeof fetch;
|
|
41
52
|
}
|
|
42
53
|
|
|
@@ -111,15 +122,70 @@ afterEach(() => {
|
|
|
111
122
|
jest.useRealTimers();
|
|
112
123
|
});
|
|
113
124
|
|
|
125
|
+
test("normalizes unavailable JSON changes through REST, embedded financials, batches and quote streams", async () => {
|
|
126
|
+
const sockets = installTestWebSocket();
|
|
127
|
+
apiClient.setSessionToken("quote-wire-session");
|
|
128
|
+
apiClient.restoreCachedUser(verifiedUser);
|
|
129
|
+
const provider = new GloomberbCloudProvider();
|
|
130
|
+
const target = { symbol: "AAPL", exchange: "NASDAQ" };
|
|
131
|
+
let quote = {
|
|
132
|
+
...target, price: 100, currency: "USD", providerId: "gloomberb-cloud",
|
|
133
|
+
dataSource: "live", lastUpdated: Date.parse("2026-09-16T14:00:00Z"),
|
|
134
|
+
marketState: "REGULAR", change: Number.NaN, changePercent: Number.NaN,
|
|
135
|
+
};
|
|
136
|
+
setCloudApiFetchTransport(mockFetch((input) => {
|
|
137
|
+
const path = new URL(String(input)).pathname;
|
|
138
|
+
if (path.endsWith("/auth/session")) return createResponse({ user: verifiedUser });
|
|
139
|
+
const data = path.includes("/financials")
|
|
140
|
+
? { quote, annualStatements: [], quarterlyStatements: [], priceHistory: [] }
|
|
141
|
+
: quote;
|
|
142
|
+
return createResponse({ status: "success", data: path.endsWith("/batch")
|
|
143
|
+
? { items: [{ ...target, status: "success", data }] } : data });
|
|
144
|
+
}));
|
|
145
|
+
const seen: Quote[] = [];
|
|
146
|
+
const unsubscribe = provider.subscribeQuotes([target], (_target, value) => seen.push(value));
|
|
147
|
+
const socket = sockets[0]!;
|
|
148
|
+
socket.open();
|
|
149
|
+
try {
|
|
150
|
+
for (const [index, change] of [Number.NaN, 0, 2].entries()) {
|
|
151
|
+
quote = { ...quote, price: Number.isFinite(change) ? 100 + change : 100, change, changePercent: change };
|
|
152
|
+
// Both transports serialize NaN to null before the real client parses it.
|
|
153
|
+
socket.receive({ type: "market.quote", ...target, quote });
|
|
154
|
+
const values = [
|
|
155
|
+
await provider.getQuote(target.symbol, target.exchange),
|
|
156
|
+
(await provider.getTickerFinancials(target.symbol, target.exchange)).quote,
|
|
157
|
+
(await provider.getQuotesBatch([target]))[0]?.quote,
|
|
158
|
+
(await provider.getTickerFinancialsBatch([target]))[0]?.financials?.quote,
|
|
159
|
+
seen.at(-1),
|
|
160
|
+
];
|
|
161
|
+
expect(seen).toHaveLength(index + 1);
|
|
162
|
+
for (const value of values) {
|
|
163
|
+
expect(value).toBeDefined();
|
|
164
|
+
expect(value?.change).toBe(change);
|
|
165
|
+
expect(value?.changePercent).toBe(change);
|
|
166
|
+
expect(getActiveQuoteDisplay(value)?.change).toBe(change);
|
|
167
|
+
expect(getActiveQuoteDisplay(value)?.changePercent).toBe(change);
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
} finally {
|
|
171
|
+
unsubscribe();
|
|
172
|
+
}
|
|
173
|
+
});
|
|
174
|
+
|
|
114
175
|
describe("apiClient layout marketplace", () => {
|
|
115
176
|
test("lists and publishes validated layouts through authenticated transport", async () => {
|
|
116
177
|
const config = createDefaultConfig("/tmp/api-layout-marketplace-test");
|
|
117
|
-
const panes = new Map(
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
178
|
+
const panes = new Map(
|
|
179
|
+
config.layout.instances.map((instance) => [
|
|
180
|
+
instance.paneId,
|
|
181
|
+
{
|
|
182
|
+
id: instance.paneId,
|
|
183
|
+
name: instance.paneId,
|
|
184
|
+
component: () => null,
|
|
185
|
+
defaultPosition: "right" as const,
|
|
186
|
+
} satisfies PaneDef,
|
|
187
|
+
]),
|
|
188
|
+
);
|
|
123
189
|
const payload = publishableMarketplaceLayout(config.layout, {}, panes);
|
|
124
190
|
const entry = {
|
|
125
191
|
id: "0123456789abcdef0123456789abcdef",
|
|
@@ -134,40 +200,60 @@ describe("apiClient layout marketplace", () => {
|
|
|
134
200
|
calls.push({
|
|
135
201
|
url,
|
|
136
202
|
method: init?.method ?? "GET",
|
|
137
|
-
...(typeof init?.body === "string"
|
|
203
|
+
...(typeof init?.body === "string"
|
|
204
|
+
? { body: JSON.parse(init.body) }
|
|
205
|
+
: {}),
|
|
138
206
|
});
|
|
139
207
|
const path = new URL(url).pathname;
|
|
140
|
-
return createResponse(
|
|
141
|
-
|
|
142
|
-
|
|
208
|
+
return createResponse(
|
|
209
|
+
path === `/layouts/${entry.id}` || init?.method === "POST"
|
|
210
|
+
? entry
|
|
211
|
+
: { items: [entry] },
|
|
212
|
+
);
|
|
143
213
|
});
|
|
144
214
|
|
|
145
215
|
await expect(apiClient.listMarketplaceLayouts()).resolves.toEqual([entry]);
|
|
146
|
-
await expect(apiClient.getMarketplaceLayout(entry.id)).resolves.toEqual(
|
|
147
|
-
|
|
216
|
+
await expect(apiClient.getMarketplaceLayout(entry.id)).resolves.toEqual(
|
|
217
|
+
entry,
|
|
218
|
+
);
|
|
219
|
+
await expect(
|
|
220
|
+
apiClient.publishMarketplaceLayout(entry.name, payload),
|
|
221
|
+
).resolves.toEqual(entry);
|
|
148
222
|
|
|
149
|
-
expect(
|
|
223
|
+
expect(
|
|
224
|
+
calls.map((call) => [new URL(call.url).pathname, call.method]),
|
|
225
|
+
).toEqual([
|
|
150
226
|
["/layouts", "GET"],
|
|
151
227
|
[`/layouts/${entry.id}`, "GET"],
|
|
152
228
|
["/layouts", "POST"],
|
|
153
229
|
]);
|
|
154
|
-
expect(calls[2]?.body).toMatchObject({
|
|
230
|
+
expect(calls[2]?.body).toMatchObject({
|
|
231
|
+
name: "Research Desk",
|
|
232
|
+
schemaVersion: 2,
|
|
233
|
+
paneState: {},
|
|
234
|
+
});
|
|
155
235
|
});
|
|
156
236
|
});
|
|
157
237
|
|
|
158
238
|
describe("apiClient auth cookies", () => {
|
|
159
239
|
test("accepts a browser-managed api.gloom.sh cookie without exposing its value", async () => {
|
|
160
240
|
apiClient.setCookieSessionMode(true);
|
|
161
|
-
setCloudApiFetchTransport(
|
|
241
|
+
setCloudApiFetchTransport(
|
|
242
|
+
mockFetch(() => createResponse({ user: verifiedUser })),
|
|
243
|
+
);
|
|
162
244
|
|
|
163
|
-
await expect(
|
|
245
|
+
await expect(
|
|
246
|
+
apiClient.signIn("test@example.com", "password"),
|
|
247
|
+
).resolves.toEqual(verifiedUser);
|
|
164
248
|
expect(apiClient.getSessionToken()).toBeNull();
|
|
165
249
|
expect(apiClient.isVerified()).toBe(true);
|
|
166
250
|
});
|
|
167
251
|
|
|
168
252
|
test("reports signed-in from the restored user when the cookie hides the raw token", async () => {
|
|
169
253
|
apiClient.setCookieSessionMode(true);
|
|
170
|
-
setCloudApiFetchTransport(
|
|
254
|
+
setCloudApiFetchTransport(
|
|
255
|
+
mockFetch(() => createResponse({ user: verifiedUser })),
|
|
256
|
+
);
|
|
171
257
|
|
|
172
258
|
expect(apiClient.isSignedIn()).toBe(false);
|
|
173
259
|
await apiClient.signIn("test@example.com", "password");
|
|
@@ -181,7 +267,9 @@ describe("apiClient auth cookies", () => {
|
|
|
181
267
|
let finishRequest!: () => void;
|
|
182
268
|
setCloudApiFetchTransport(async () => {
|
|
183
269
|
requests += 1;
|
|
184
|
-
await new Promise<void>((resolve) => {
|
|
270
|
+
await new Promise<void>((resolve) => {
|
|
271
|
+
finishRequest = resolve;
|
|
272
|
+
});
|
|
185
273
|
return createResponse({ user: null });
|
|
186
274
|
});
|
|
187
275
|
|
|
@@ -211,7 +299,9 @@ describe("apiClient auth cookies", () => {
|
|
|
211
299
|
const cookie = new Headers(init?.headers).get("cookie");
|
|
212
300
|
seen.push(cookie);
|
|
213
301
|
if (seen.length === 1) {
|
|
214
|
-
await new Promise<void>((resolve) => {
|
|
302
|
+
await new Promise<void>((resolve) => {
|
|
303
|
+
releaseFirst = resolve;
|
|
304
|
+
});
|
|
215
305
|
return createResponse({ user: null });
|
|
216
306
|
}
|
|
217
307
|
return createResponse({ user: verifiedUser });
|
|
@@ -239,19 +329,25 @@ describe("apiClient auth cookies", () => {
|
|
|
239
329
|
test("captures secure session cookies after login and reuses them on session refresh", async () => {
|
|
240
330
|
const seenCookies: Array<string | null> = [];
|
|
241
331
|
|
|
242
|
-
globalThis.fetch = mockFetch(
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
332
|
+
globalThis.fetch = mockFetch(
|
|
333
|
+
async (_input: Request | string | URL, init?: RequestInit) => {
|
|
334
|
+
const headers = new Headers(init?.headers);
|
|
335
|
+
seenCookies.push(headers.get("Cookie"));
|
|
336
|
+
|
|
337
|
+
if (seenCookies.length === 1) {
|
|
338
|
+
return createResponse(
|
|
339
|
+
{ token: "ws-token", user: verifiedUser },
|
|
340
|
+
{
|
|
341
|
+
cookies: [
|
|
342
|
+
"__Secure-gloomberb.session_token=signed-token.value; Path=/; HttpOnly; Secure; SameSite=Lax",
|
|
343
|
+
],
|
|
344
|
+
},
|
|
345
|
+
);
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
return createResponse({ user: verifiedUser });
|
|
349
|
+
},
|
|
350
|
+
);
|
|
255
351
|
|
|
256
352
|
await apiClient.signIn("test@example.com", "password");
|
|
257
353
|
await apiClient.getSession();
|
|
@@ -277,16 +373,19 @@ describe("apiClient auth cookies", () => {
|
|
|
277
373
|
await new Promise<void>((resolve) => {
|
|
278
374
|
releaseResponse = resolve;
|
|
279
375
|
});
|
|
280
|
-
return createResponse(
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
376
|
+
return createResponse(
|
|
377
|
+
{
|
|
378
|
+
channels: [],
|
|
379
|
+
onlineCount: 0,
|
|
380
|
+
channelStates: [],
|
|
381
|
+
notifications: [],
|
|
382
|
+
},
|
|
383
|
+
{
|
|
384
|
+
cookies: [
|
|
385
|
+
"__Secure-gloomberb.session_token=old-session.value; Path=/; HttpOnly; Secure; SameSite=None",
|
|
386
|
+
],
|
|
387
|
+
},
|
|
388
|
+
);
|
|
290
389
|
});
|
|
291
390
|
|
|
292
391
|
const staleRequest = apiClient.getChatState();
|
|
@@ -308,7 +407,11 @@ describe("apiClient auth cookies", () => {
|
|
|
308
407
|
seenCookies.push(headers.get("Cookie"));
|
|
309
408
|
return createResponse(
|
|
310
409
|
{ token: "ws-token", user: verifiedUser },
|
|
311
|
-
{
|
|
410
|
+
{
|
|
411
|
+
cookies: [
|
|
412
|
+
"gloomberb.session_token=signed-token.value; Path=/; HttpOnly; SameSite=Lax",
|
|
413
|
+
],
|
|
414
|
+
},
|
|
312
415
|
);
|
|
313
416
|
});
|
|
314
417
|
|
|
@@ -320,11 +423,13 @@ describe("apiClient auth cookies", () => {
|
|
|
320
423
|
});
|
|
321
424
|
|
|
322
425
|
test("rejects login success without a captured session cookie", async () => {
|
|
323
|
-
globalThis.fetch = mockFetch(async () =>
|
|
324
|
-
|
|
325
|
-
await expect(apiClient.signIn("test@example.com", "password")).rejects.toThrow(
|
|
326
|
-
"could not save the login session",
|
|
426
|
+
globalThis.fetch = mockFetch(async () =>
|
|
427
|
+
createResponse({ token: "raw-session-token", user: verifiedUser }),
|
|
327
428
|
);
|
|
429
|
+
|
|
430
|
+
await expect(
|
|
431
|
+
apiClient.signIn("test@example.com", "password"),
|
|
432
|
+
).rejects.toThrow("could not save the login session");
|
|
328
433
|
expect(apiClient.getSessionToken()).toBeNull();
|
|
329
434
|
expect(apiClient.getWebSocketToken()).toBeNull();
|
|
330
435
|
expect(apiClient.getCurrentUser()).toBeNull();
|
|
@@ -334,11 +439,13 @@ describe("apiClient auth cookies", () => {
|
|
|
334
439
|
const seenCookies: Array<string | null> = [];
|
|
335
440
|
apiClient.setSessionToken("persisted-token.value");
|
|
336
441
|
|
|
337
|
-
globalThis.fetch = mockFetch(
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
442
|
+
globalThis.fetch = mockFetch(
|
|
443
|
+
async (_input: Request | string | URL, init?: RequestInit) => {
|
|
444
|
+
const headers = new Headers(init?.headers);
|
|
445
|
+
seenCookies.push(headers.get("Cookie"));
|
|
446
|
+
return createResponse({ user: verifiedUser });
|
|
447
|
+
},
|
|
448
|
+
);
|
|
342
449
|
|
|
343
450
|
await apiClient.getSession();
|
|
344
451
|
|
|
@@ -351,13 +458,15 @@ describe("apiClient auth cookies", () => {
|
|
|
351
458
|
let requestedUrl = "";
|
|
352
459
|
let requestedCookie: string | null = null;
|
|
353
460
|
apiClient.setSessionToken("desktop-session-token");
|
|
354
|
-
globalThis.fetch = mockFetch(
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
461
|
+
globalThis.fetch = mockFetch(
|
|
462
|
+
async (input: Request | string | URL, init?: RequestInit) => {
|
|
463
|
+
requestedUrl = String(input);
|
|
464
|
+
requestedCookie = new Headers(init?.headers).get("Cookie");
|
|
465
|
+
return createResponse({
|
|
466
|
+
url: "https://api.gloom.sh/cloud/auth/browser-handoff?token=opaque-one-time-token",
|
|
467
|
+
});
|
|
468
|
+
},
|
|
469
|
+
);
|
|
361
470
|
|
|
362
471
|
const handoff = await apiClient.createBrowserHandoff();
|
|
363
472
|
|
|
@@ -373,7 +482,9 @@ describe("apiClient auth cookies", () => {
|
|
|
373
482
|
apiClient.setSessionToken("persisted-token.value");
|
|
374
483
|
apiClient.restoreCachedUser(verifiedUser);
|
|
375
484
|
|
|
376
|
-
globalThis.fetch = mockFetch(async () =>
|
|
485
|
+
globalThis.fetch = mockFetch(async () =>
|
|
486
|
+
createResponse({ message: "Unauthorized" }, { status: 401 }),
|
|
487
|
+
);
|
|
377
488
|
|
|
378
489
|
await expect(apiClient.getSession()).rejects.toThrow("Unauthorized");
|
|
379
490
|
expect(apiClient.getSessionToken()).toBe("persisted-token.value");
|
|
@@ -389,7 +500,9 @@ describe("apiClient auth cookies", () => {
|
|
|
389
500
|
apiClient.setWebSocketToken("ws-token");
|
|
390
501
|
apiClient.restoreCachedUser(verifiedUser);
|
|
391
502
|
|
|
392
|
-
globalThis.fetch = mockFetch(async () =>
|
|
503
|
+
globalThis.fetch = mockFetch(async () =>
|
|
504
|
+
createResponse({ code: "USER_NOT_FOUND" }, { status: 403 }),
|
|
505
|
+
);
|
|
393
506
|
|
|
394
507
|
await expect(apiClient.getSession()).resolves.toBeNull();
|
|
395
508
|
expect(apiClient.getSessionToken()).toBeNull();
|
|
@@ -402,7 +515,9 @@ describe("apiClient auth cookies", () => {
|
|
|
402
515
|
apiClient.setWebSocketToken("ws-token");
|
|
403
516
|
apiClient.restoreCachedUser(verifiedUser);
|
|
404
517
|
|
|
405
|
-
globalThis.fetch = mockFetch(async () =>
|
|
518
|
+
globalThis.fetch = mockFetch(async () =>
|
|
519
|
+
createResponse({ message: "server unavailable" }, { status: 503 }),
|
|
520
|
+
);
|
|
406
521
|
|
|
407
522
|
await expect(apiClient.signOut()).rejects.toThrow("server unavailable");
|
|
408
523
|
expect(apiClient.getSessionToken()).toBeNull();
|
|
@@ -418,7 +533,10 @@ describe("apiClient quote socket", () => {
|
|
|
418
533
|
apiClient.setWebSocketToken("stale-ws-token");
|
|
419
534
|
apiClient.restoreCachedUser(verifiedUser);
|
|
420
535
|
|
|
421
|
-
const unsubscribe = apiClient.subscribeQuotes(
|
|
536
|
+
const unsubscribe = apiClient.subscribeQuotes(
|
|
537
|
+
[{ symbol: "AAPL" }],
|
|
538
|
+
() => {},
|
|
539
|
+
);
|
|
422
540
|
|
|
423
541
|
expect(sockets).toHaveLength(1);
|
|
424
542
|
expect(sockets[0]!.url).toContain("token=stale-ws-token");
|
|
@@ -434,28 +552,35 @@ describe("apiClient quote socket", () => {
|
|
|
434
552
|
test("opens an anonymous market websocket and sends quote priority hints", () => {
|
|
435
553
|
const sockets = installTestWebSocket();
|
|
436
554
|
|
|
437
|
-
const unsubscribe = apiClient.subscribeQuotes(
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
555
|
+
const unsubscribe = apiClient.subscribeQuotes(
|
|
556
|
+
[
|
|
557
|
+
{
|
|
558
|
+
symbol: "AAPL",
|
|
559
|
+
exchange: "NASDAQ",
|
|
560
|
+
surface: "portfolio",
|
|
561
|
+
visible: true,
|
|
562
|
+
selected: true,
|
|
563
|
+
weight: 100,
|
|
564
|
+
},
|
|
565
|
+
],
|
|
566
|
+
() => {},
|
|
567
|
+
);
|
|
445
568
|
sockets[0]!.open();
|
|
446
569
|
|
|
447
570
|
expect(sockets).toHaveLength(1);
|
|
448
571
|
expect(sockets[0]!.url).toBe("wss://api.gloom.sh/cloud/ws");
|
|
449
572
|
expect(sockets[0]!.sent).toContainEqual({
|
|
450
573
|
type: "market.subscribe",
|
|
451
|
-
symbols: [
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
574
|
+
symbols: [
|
|
575
|
+
{
|
|
576
|
+
symbol: "AAPL",
|
|
577
|
+
exchange: "NASDAQ",
|
|
578
|
+
surface: "portfolio",
|
|
579
|
+
visible: true,
|
|
580
|
+
selected: true,
|
|
581
|
+
weight: 100,
|
|
582
|
+
},
|
|
583
|
+
],
|
|
459
584
|
});
|
|
460
585
|
|
|
461
586
|
unsubscribe();
|
|
@@ -584,7 +709,10 @@ describe("apiClient quote socket", () => {
|
|
|
584
709
|
test("does not invent quote priority hints when opening a socket", () => {
|
|
585
710
|
const sockets = installTestWebSocket();
|
|
586
711
|
|
|
587
|
-
const unsubscribe = apiClient.subscribeQuotes(
|
|
712
|
+
const unsubscribe = apiClient.subscribeQuotes(
|
|
713
|
+
[{ symbol: "AAPL", exchange: "NASDAQ" }],
|
|
714
|
+
() => {},
|
|
715
|
+
);
|
|
588
716
|
sockets[0]!.open();
|
|
589
717
|
|
|
590
718
|
expect(sockets[0]!.sent).toContainEqual({
|
|
@@ -599,41 +727,53 @@ describe("apiClient quote socket", () => {
|
|
|
599
727
|
jest.useFakeTimers();
|
|
600
728
|
const sockets = installTestWebSocket();
|
|
601
729
|
const deliveredSurfaces: string[] = [];
|
|
602
|
-
const unsubscribeInline = apiClient.subscribeQuotes(
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
730
|
+
const unsubscribeInline = apiClient.subscribeQuotes(
|
|
731
|
+
[
|
|
732
|
+
{
|
|
733
|
+
symbol: "AAPL",
|
|
734
|
+
exchange: "NASDAQ",
|
|
735
|
+
surface: "inline",
|
|
736
|
+
weight: 1,
|
|
737
|
+
},
|
|
738
|
+
],
|
|
739
|
+
(target) => {
|
|
740
|
+
deliveredSurfaces.push(target.surface ?? "unknown");
|
|
741
|
+
},
|
|
742
|
+
);
|
|
610
743
|
const socket = sockets[0]!;
|
|
611
744
|
socket.open();
|
|
612
745
|
flushQuoteSubscriptionUpdates();
|
|
613
746
|
socket.sent.length = 0;
|
|
614
747
|
|
|
615
|
-
const unsubscribeDetail = apiClient.subscribeQuotes(
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
748
|
+
const unsubscribeDetail = apiClient.subscribeQuotes(
|
|
749
|
+
[
|
|
750
|
+
{
|
|
751
|
+
symbol: "AAPL",
|
|
752
|
+
exchange: "NASDAQ",
|
|
753
|
+
surface: "detail",
|
|
754
|
+
visible: true,
|
|
755
|
+
selected: true,
|
|
756
|
+
weight: 50,
|
|
757
|
+
},
|
|
758
|
+
],
|
|
759
|
+
(target) => {
|
|
760
|
+
deliveredSurfaces.push(target.surface ?? "unknown");
|
|
761
|
+
},
|
|
762
|
+
);
|
|
625
763
|
flushQuoteSubscriptionUpdates();
|
|
626
764
|
|
|
627
765
|
expect(socket.sent.at(-1)).toEqual({
|
|
628
766
|
type: "market.subscribe",
|
|
629
|
-
symbols: [
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
767
|
+
symbols: [
|
|
768
|
+
{
|
|
769
|
+
symbol: "AAPL",
|
|
770
|
+
exchange: "NASDAQ",
|
|
771
|
+
surface: "detail",
|
|
772
|
+
visible: true,
|
|
773
|
+
selected: true,
|
|
774
|
+
weight: 50,
|
|
775
|
+
},
|
|
776
|
+
],
|
|
637
777
|
});
|
|
638
778
|
|
|
639
779
|
socket.receive({
|
|
@@ -648,12 +788,14 @@ describe("apiClient quote socket", () => {
|
|
|
648
788
|
flushQuoteSubscriptionUpdates();
|
|
649
789
|
expect(socket.sent.at(-1)).toEqual({
|
|
650
790
|
type: "market.subscribe",
|
|
651
|
-
symbols: [
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
791
|
+
symbols: [
|
|
792
|
+
{
|
|
793
|
+
symbol: "AAPL",
|
|
794
|
+
exchange: "NASDAQ",
|
|
795
|
+
surface: "inline",
|
|
796
|
+
weight: 1,
|
|
797
|
+
},
|
|
798
|
+
],
|
|
657
799
|
});
|
|
658
800
|
|
|
659
801
|
unsubscribeInline();
|
|
@@ -662,40 +804,59 @@ describe("apiClient quote socket", () => {
|
|
|
662
804
|
test("unsubscribes a server-side quote when queued priority updates are removed", () => {
|
|
663
805
|
jest.useFakeTimers();
|
|
664
806
|
const sockets = installTestWebSocket();
|
|
665
|
-
const unsubscribeMsft = apiClient.subscribeQuotes(
|
|
807
|
+
const unsubscribeMsft = apiClient.subscribeQuotes(
|
|
808
|
+
[{ symbol: "MSFT", exchange: "NASDAQ" }],
|
|
809
|
+
() => {},
|
|
810
|
+
);
|
|
666
811
|
const socket = sockets[0]!;
|
|
667
812
|
socket.open();
|
|
668
813
|
flushQuoteSubscriptionUpdates();
|
|
669
814
|
|
|
670
|
-
const unsubscribeInline = apiClient.subscribeQuotes(
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
815
|
+
const unsubscribeInline = apiClient.subscribeQuotes(
|
|
816
|
+
[
|
|
817
|
+
{
|
|
818
|
+
symbol: "AAPL",
|
|
819
|
+
exchange: "NASDAQ",
|
|
820
|
+
surface: "inline",
|
|
821
|
+
weight: 1,
|
|
822
|
+
},
|
|
823
|
+
],
|
|
824
|
+
() => {},
|
|
825
|
+
);
|
|
676
826
|
flushQuoteSubscriptionUpdates();
|
|
677
827
|
expect(socket.sent.at(-1)).toEqual({
|
|
678
828
|
type: "market.subscribe",
|
|
679
|
-
symbols: [
|
|
829
|
+
symbols: [
|
|
830
|
+
{ symbol: "AAPL", exchange: "NASDAQ", surface: "inline", weight: 1 },
|
|
831
|
+
],
|
|
680
832
|
});
|
|
681
833
|
|
|
682
834
|
socket.sent.length = 0;
|
|
683
|
-
const unsubscribeDetail = apiClient.subscribeQuotes(
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
835
|
+
const unsubscribeDetail = apiClient.subscribeQuotes(
|
|
836
|
+
[
|
|
837
|
+
{
|
|
838
|
+
symbol: "AAPL",
|
|
839
|
+
exchange: "NASDAQ",
|
|
840
|
+
surface: "detail",
|
|
841
|
+
visible: true,
|
|
842
|
+
selected: true,
|
|
843
|
+
weight: 50,
|
|
844
|
+
},
|
|
845
|
+
],
|
|
846
|
+
() => {},
|
|
847
|
+
);
|
|
691
848
|
unsubscribeDetail();
|
|
692
849
|
unsubscribeInline();
|
|
693
850
|
flushQuoteSubscriptionUpdates();
|
|
694
851
|
|
|
695
|
-
expect(socket.sent).toEqual([
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
852
|
+
expect(socket.sent).toEqual([
|
|
853
|
+
{
|
|
854
|
+
type: "market.unsubscribe",
|
|
855
|
+
symbols: [
|
|
856
|
+
{ symbol: "AAPL", exchange: "NASDAQ", surface: "inline", weight: 1 },
|
|
857
|
+
],
|
|
858
|
+
},
|
|
859
|
+
]);
|
|
699
860
|
unsubscribeMsft();
|
|
700
861
|
});
|
|
701
862
|
|
|
@@ -720,10 +881,9 @@ describe("apiClient quote socket", () => {
|
|
|
720
881
|
unsubscribeOld();
|
|
721
882
|
flushQuoteSubscriptionUpdates();
|
|
722
883
|
|
|
723
|
-
expect(
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
]);
|
|
884
|
+
expect(
|
|
885
|
+
socket.sent.map((message) => (message as { type: string }).type),
|
|
886
|
+
).toEqual(["market.unsubscribe", "market.subscribe"]);
|
|
727
887
|
expect(socket.sent[0]).toMatchObject({
|
|
728
888
|
symbols: [{ symbol: "OPT0" }, { symbol: "OPT1" }],
|
|
729
889
|
});
|
|
@@ -738,9 +898,12 @@ describe("apiClient quote socket", () => {
|
|
|
738
898
|
const seenPrices: number[] = [];
|
|
739
899
|
const sockets = installTestWebSocket();
|
|
740
900
|
|
|
741
|
-
const unsubscribe = apiClient.subscribeQuotes(
|
|
742
|
-
|
|
743
|
-
|
|
901
|
+
const unsubscribe = apiClient.subscribeQuotes(
|
|
902
|
+
[{ symbol: "AAPL" }],
|
|
903
|
+
(_target, quote) => {
|
|
904
|
+
seenPrices.push(quote.price);
|
|
905
|
+
},
|
|
906
|
+
);
|
|
744
907
|
const socket = sockets[0]!;
|
|
745
908
|
socket.open();
|
|
746
909
|
socket.receive({ type: "auth.unverified" });
|
|
@@ -773,15 +936,24 @@ describe("apiClient scanner subscriptions", () => {
|
|
|
773
936
|
const first: unknown[] = [];
|
|
774
937
|
const second: unknown[] = [];
|
|
775
938
|
|
|
776
|
-
const unsubscribeFirst = apiClient.subscribeScanner("hilo", (event) =>
|
|
939
|
+
const unsubscribeFirst = apiClient.subscribeScanner("hilo", (event) =>
|
|
940
|
+
first.push(event),
|
|
941
|
+
);
|
|
777
942
|
const socket = sockets[0]!;
|
|
778
943
|
socket.open();
|
|
779
|
-
expect(socket.sent).toContainEqual({
|
|
944
|
+
expect(socket.sent).toContainEqual({
|
|
945
|
+
type: "scanner.subscribe",
|
|
946
|
+
scanner: "hilo",
|
|
947
|
+
});
|
|
780
948
|
|
|
781
949
|
const payload = {
|
|
782
950
|
status: "live",
|
|
783
951
|
asOf: 1,
|
|
784
|
-
windows: {
|
|
952
|
+
windows: {
|
|
953
|
+
s30: { highs: 1, lows: 0 },
|
|
954
|
+
m1: { highs: 2, lows: 1 },
|
|
955
|
+
m5: { highs: 3, lows: 2 },
|
|
956
|
+
},
|
|
785
957
|
highs: [],
|
|
786
958
|
lows: [],
|
|
787
959
|
};
|
|
@@ -789,9 +961,13 @@ describe("apiClient scanner subscriptions", () => {
|
|
|
789
961
|
|
|
790
962
|
// A second pane must not open a second upstream subscription, and must not
|
|
791
963
|
// wait a tick for its first frame.
|
|
792
|
-
const subscribeCount = () =>
|
|
964
|
+
const subscribeCount = () =>
|
|
965
|
+
socket.sent.filter((message: any) => message.type === "scanner.subscribe")
|
|
966
|
+
.length;
|
|
793
967
|
const before = subscribeCount();
|
|
794
|
-
const unsubscribeSecond = apiClient.subscribeScanner("hilo", (event) =>
|
|
968
|
+
const unsubscribeSecond = apiClient.subscribeScanner("hilo", (event) =>
|
|
969
|
+
second.push(event),
|
|
970
|
+
);
|
|
795
971
|
expect(subscribeCount()).toBe(before);
|
|
796
972
|
expect(second).toEqual([{ type: "data", payload }]);
|
|
797
973
|
|
|
@@ -800,19 +976,31 @@ describe("apiClient scanner subscriptions", () => {
|
|
|
800
976
|
expect(second).toHaveLength(2);
|
|
801
977
|
|
|
802
978
|
unsubscribeFirst();
|
|
803
|
-
expect(socket.sent).not.toContainEqual({
|
|
979
|
+
expect(socket.sent).not.toContainEqual({
|
|
980
|
+
type: "scanner.unsubscribe",
|
|
981
|
+
scanner: "hilo",
|
|
982
|
+
});
|
|
804
983
|
unsubscribeSecond();
|
|
805
|
-
expect(socket.sent).toContainEqual({
|
|
984
|
+
expect(socket.sent).toContainEqual({
|
|
985
|
+
type: "scanner.unsubscribe",
|
|
986
|
+
scanner: "hilo",
|
|
987
|
+
});
|
|
806
988
|
});
|
|
807
989
|
|
|
808
990
|
test("replays scanner subscriptions after a reconnect and surfaces denials", () => {
|
|
809
991
|
const sockets = installTestWebSocket();
|
|
810
992
|
const seen: unknown[] = [];
|
|
811
|
-
const unsubscribe = apiClient.subscribeScanner("flow", (event) =>
|
|
993
|
+
const unsubscribe = apiClient.subscribeScanner("flow", (event) =>
|
|
994
|
+
seen.push(event),
|
|
995
|
+
);
|
|
812
996
|
|
|
813
997
|
const socket = sockets[0]!;
|
|
814
998
|
socket.open();
|
|
815
|
-
socket.receive({
|
|
999
|
+
socket.receive({
|
|
1000
|
+
type: "scanner.denied",
|
|
1001
|
+
scanner: "flow",
|
|
1002
|
+
reason: "pro_required",
|
|
1003
|
+
});
|
|
816
1004
|
expect(seen).toEqual([{ type: "denied", reason: "pro_required" }]);
|
|
817
1005
|
|
|
818
1006
|
jest.useFakeTimers();
|
|
@@ -820,7 +1008,10 @@ describe("apiClient scanner subscriptions", () => {
|
|
|
820
1008
|
jest.runAllTimers();
|
|
821
1009
|
const reconnected = sockets[1]!;
|
|
822
1010
|
reconnected.open();
|
|
823
|
-
expect(reconnected.sent).toContainEqual({
|
|
1011
|
+
expect(reconnected.sent).toContainEqual({
|
|
1012
|
+
type: "scanner.subscribe",
|
|
1013
|
+
scanner: "flow",
|
|
1014
|
+
});
|
|
824
1015
|
|
|
825
1016
|
unsubscribe();
|
|
826
1017
|
});
|
|
@@ -844,15 +1035,17 @@ describe("apiClient chat timestamps", () => {
|
|
|
844
1035
|
|
|
845
1036
|
test("normalizes transcript and send-response timestamps to UTC ISO strings", async () => {
|
|
846
1037
|
const responses = [
|
|
847
|
-
createResponse([
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
1038
|
+
createResponse([
|
|
1039
|
+
{
|
|
1040
|
+
id: "m1",
|
|
1041
|
+
channelId: "everyone",
|
|
1042
|
+
content: "older",
|
|
1043
|
+
replyToId: null,
|
|
1044
|
+
createdAt: "2026-04-08 07:28:27.625",
|
|
1045
|
+
user: { id: "u1", username: "alice", displayName: "Alice" },
|
|
1046
|
+
replyTo: null,
|
|
1047
|
+
},
|
|
1048
|
+
]),
|
|
856
1049
|
createResponse({
|
|
857
1050
|
id: "m2",
|
|
858
1051
|
channelId: "everyone",
|
|
@@ -875,31 +1068,39 @@ describe("apiClient chat timestamps", () => {
|
|
|
875
1068
|
|
|
876
1069
|
test("edits a chat message and normalizes the edit timestamp", async () => {
|
|
877
1070
|
const requests: Array<{ path: string; method: string; body: unknown }> = [];
|
|
878
|
-
globalThis.fetch = mockFetch(
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
1071
|
+
globalThis.fetch = mockFetch(
|
|
1072
|
+
async (input: Request | string | URL, init?: RequestInit) => {
|
|
1073
|
+
requests.push({
|
|
1074
|
+
path: new URL(String(input)).pathname,
|
|
1075
|
+
method: init?.method ?? "GET",
|
|
1076
|
+
body: init?.body ? JSON.parse(String(init.body)) : null,
|
|
1077
|
+
});
|
|
1078
|
+
return createResponse({
|
|
1079
|
+
id: "m2",
|
|
1080
|
+
channelId: "everyone",
|
|
1081
|
+
content: "hello edited",
|
|
1082
|
+
replyToId: null,
|
|
1083
|
+
createdAt: "2026-04-08 07:29:27.625",
|
|
1084
|
+
editedAt: "2026-04-08 07:30:27.625",
|
|
1085
|
+
user: { id: "u1", username: "alice", displayName: "Alice" },
|
|
1086
|
+
replyTo: null,
|
|
1087
|
+
});
|
|
1088
|
+
},
|
|
1089
|
+
);
|
|
895
1090
|
|
|
896
|
-
const editedMessage = await apiClient.editMessage(
|
|
1091
|
+
const editedMessage = await apiClient.editMessage(
|
|
1092
|
+
"everyone",
|
|
1093
|
+
"m2",
|
|
1094
|
+
"hello edited",
|
|
1095
|
+
);
|
|
897
1096
|
|
|
898
|
-
expect(requests).toEqual([
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
1097
|
+
expect(requests).toEqual([
|
|
1098
|
+
{
|
|
1099
|
+
path: "/chat/channels/everyone/messages/m2",
|
|
1100
|
+
method: "PATCH",
|
|
1101
|
+
body: { content: "hello edited" },
|
|
1102
|
+
},
|
|
1103
|
+
]);
|
|
903
1104
|
expect(editedMessage.editedAt).toBe("2026-04-08T07:30:27.625Z");
|
|
904
1105
|
});
|
|
905
1106
|
|
|
@@ -909,19 +1110,21 @@ describe("apiClient chat timestamps", () => {
|
|
|
909
1110
|
seenCreatedAts.push(message.createdAt);
|
|
910
1111
|
});
|
|
911
1112
|
|
|
912
|
-
await (apiClient as any).socket.handleSocketMessage(
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
data: {
|
|
916
|
-
id: "m1",
|
|
1113
|
+
await (apiClient as any).socket.handleSocketMessage(
|
|
1114
|
+
JSON.stringify({
|
|
1115
|
+
type: "chat.message",
|
|
917
1116
|
channelId: "everyone",
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
1117
|
+
data: {
|
|
1118
|
+
id: "m1",
|
|
1119
|
+
channelId: "everyone",
|
|
1120
|
+
content: "hello",
|
|
1121
|
+
replyToId: null,
|
|
1122
|
+
createdAt: "2026-04-08 07:28:27.625",
|
|
1123
|
+
user: { id: "u1", username: "alice", displayName: "Alice" },
|
|
1124
|
+
replyTo: null,
|
|
1125
|
+
},
|
|
1126
|
+
}),
|
|
1127
|
+
);
|
|
925
1128
|
|
|
926
1129
|
expect(seenCreatedAts).toEqual(["2026-04-08T07:28:27.625Z"]);
|
|
927
1130
|
channel.close();
|
|
@@ -932,30 +1135,43 @@ describe("apiClient chat timestamps", () => {
|
|
|
932
1135
|
globalThis.fetch = mockFetch(async (input: Request | string | URL) => {
|
|
933
1136
|
requestedUrl = String(input);
|
|
934
1137
|
return createResponse({
|
|
935
|
-
channels: [
|
|
1138
|
+
channels: [
|
|
1139
|
+
{
|
|
1140
|
+
id: "everyone",
|
|
1141
|
+
name: "everyone",
|
|
1142
|
+
created_at: "2026-04-08T07:00:00.000Z",
|
|
1143
|
+
},
|
|
1144
|
+
],
|
|
936
1145
|
onlineCount: 2,
|
|
937
|
-
channelStates: [
|
|
938
|
-
|
|
939
|
-
notificationsEnabled: true,
|
|
940
|
-
lastReadMessageId: "m1",
|
|
941
|
-
unreadCount: 1,
|
|
942
|
-
}],
|
|
943
|
-
notifications: [{
|
|
944
|
-
id: "n1",
|
|
945
|
-
type: "reply",
|
|
946
|
-
channelId: "everyone",
|
|
947
|
-
messageId: "m2",
|
|
948
|
-
createdAt: "2026-04-08 07:30:00.000",
|
|
949
|
-
message: {
|
|
950
|
-
id: "m2",
|
|
1146
|
+
channelStates: [
|
|
1147
|
+
{
|
|
951
1148
|
channelId: "everyone",
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
1149
|
+
notificationsEnabled: true,
|
|
1150
|
+
lastReadMessageId: "m1",
|
|
1151
|
+
unreadCount: 1,
|
|
1152
|
+
},
|
|
1153
|
+
],
|
|
1154
|
+
notifications: [
|
|
1155
|
+
{
|
|
1156
|
+
id: "n1",
|
|
1157
|
+
type: "reply",
|
|
1158
|
+
channelId: "everyone",
|
|
1159
|
+
messageId: "m2",
|
|
1160
|
+
createdAt: "2026-04-08 07:30:00.000",
|
|
1161
|
+
message: {
|
|
1162
|
+
id: "m2",
|
|
1163
|
+
channelId: "everyone",
|
|
1164
|
+
content: "reply",
|
|
1165
|
+
replyToId: "m1",
|
|
1166
|
+
createdAt: "2026-04-08 07:29:00.000",
|
|
1167
|
+
user: { id: "u2", username: "bob", displayName: "Bob" },
|
|
1168
|
+
replyTo: {
|
|
1169
|
+
content: "parent",
|
|
1170
|
+
user: { id: "u1", username: "vince" },
|
|
1171
|
+
},
|
|
1172
|
+
},
|
|
957
1173
|
},
|
|
958
|
-
|
|
1174
|
+
],
|
|
959
1175
|
});
|
|
960
1176
|
});
|
|
961
1177
|
|
|
@@ -964,7 +1180,9 @@ describe("apiClient chat timestamps", () => {
|
|
|
964
1180
|
expect(new URL(requestedUrl).pathname).toBe("/chat/state");
|
|
965
1181
|
expect(state.onlineCount).toBe(2);
|
|
966
1182
|
expect(state.notifications[0]?.createdAt).toBe("2026-04-08T07:30:00.000Z");
|
|
967
|
-
expect(state.notifications[0]?.message.createdAt).toBe(
|
|
1183
|
+
expect(state.notifications[0]?.message.createdAt).toBe(
|
|
1184
|
+
"2026-04-08T07:29:00.000Z",
|
|
1185
|
+
);
|
|
968
1186
|
});
|
|
969
1187
|
|
|
970
1188
|
test("updates chat channel state and marks notifications delivered", async () => {
|
|
@@ -979,14 +1197,16 @@ describe("apiClient chat timestamps", () => {
|
|
|
979
1197
|
createResponse({ delivered: 2 }),
|
|
980
1198
|
createResponse({ onlineCount: 4 }),
|
|
981
1199
|
];
|
|
982
|
-
globalThis.fetch = mockFetch(
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
1200
|
+
globalThis.fetch = mockFetch(
|
|
1201
|
+
async (input: Request | string | URL, init?: RequestInit) => {
|
|
1202
|
+
requests.push({
|
|
1203
|
+
path: new URL(String(input)).pathname,
|
|
1204
|
+
method: init?.method ?? "GET",
|
|
1205
|
+
body: init?.body ? JSON.parse(String(init.body)) : null,
|
|
1206
|
+
});
|
|
1207
|
+
return responses.shift() as Response;
|
|
1208
|
+
},
|
|
1209
|
+
);
|
|
990
1210
|
|
|
991
1211
|
await apiClient.updateChatChannelState("everyone", {
|
|
992
1212
|
notificationsEnabled: true,
|
|
@@ -1018,36 +1238,49 @@ describe("apiClient chat timestamps", () => {
|
|
|
1018
1238
|
test("emits websocket chat presence and notification events", async () => {
|
|
1019
1239
|
const seenPresence: number[] = [];
|
|
1020
1240
|
const seenNotifications: string[] = [];
|
|
1021
|
-
const unsubscribePresence = apiClient.subscribeChatPresence(
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1241
|
+
const unsubscribePresence = apiClient.subscribeChatPresence(
|
|
1242
|
+
(onlineCount) => {
|
|
1243
|
+
seenPresence.push(onlineCount);
|
|
1244
|
+
},
|
|
1245
|
+
);
|
|
1246
|
+
const unsubscribeNotifications = apiClient.subscribeChatNotifications(
|
|
1247
|
+
(notification) => {
|
|
1248
|
+
seenNotifications.push(
|
|
1249
|
+
`${notification.id}:${notification.message.createdAt}`,
|
|
1250
|
+
);
|
|
1251
|
+
},
|
|
1252
|
+
);
|
|
1027
1253
|
|
|
1028
|
-
await (apiClient as any).socket.handleSocketMessage(
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
type: "
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
message: {
|
|
1041
|
-
id: "m2",
|
|
1254
|
+
await (apiClient as any).socket.handleSocketMessage(
|
|
1255
|
+
JSON.stringify({
|
|
1256
|
+
type: "chat.presence",
|
|
1257
|
+
onlineCount: 5,
|
|
1258
|
+
}),
|
|
1259
|
+
);
|
|
1260
|
+
await (apiClient as any).socket.handleSocketMessage(
|
|
1261
|
+
JSON.stringify({
|
|
1262
|
+
type: "chat.notification",
|
|
1263
|
+
data: {
|
|
1264
|
+
id: "n1",
|
|
1265
|
+
type: "reply",
|
|
1042
1266
|
channelId: "everyone",
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1267
|
+
messageId: "m2",
|
|
1268
|
+
createdAt: "2026-04-08 07:30:00.000",
|
|
1269
|
+
message: {
|
|
1270
|
+
id: "m2",
|
|
1271
|
+
channelId: "everyone",
|
|
1272
|
+
content: "reply",
|
|
1273
|
+
replyToId: "m1",
|
|
1274
|
+
createdAt: "2026-04-08 07:29:00.000",
|
|
1275
|
+
user: { id: "u2", username: "bob", displayName: "Bob" },
|
|
1276
|
+
replyTo: {
|
|
1277
|
+
content: "parent",
|
|
1278
|
+
user: { id: "u1", username: "vince" },
|
|
1279
|
+
},
|
|
1280
|
+
},
|
|
1048
1281
|
},
|
|
1049
|
-
},
|
|
1050
|
-
|
|
1282
|
+
}),
|
|
1283
|
+
);
|
|
1051
1284
|
|
|
1052
1285
|
expect(seenPresence).toEqual([5]);
|
|
1053
1286
|
expect(seenNotifications).toEqual(["n1:2026-04-08T07:29:00.000Z"]);
|
|
@@ -1062,30 +1295,32 @@ describe("apiClient account profile", () => {
|
|
|
1062
1295
|
let requestedBody = "";
|
|
1063
1296
|
apiClient.setSessionToken("session-token");
|
|
1064
1297
|
apiClient.restoreCachedUser(verifiedUser);
|
|
1065
|
-
globalThis.fetch = mockFetch(
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1298
|
+
globalThis.fetch = mockFetch(
|
|
1299
|
+
async (input: Request | string | URL, init?: RequestInit) => {
|
|
1300
|
+
requestedUrl = String(input);
|
|
1301
|
+
requestedBody = String(init?.body ?? "");
|
|
1302
|
+
return createResponse({
|
|
1303
|
+
profile: {
|
|
1304
|
+
id: verifiedUser.id,
|
|
1305
|
+
email: verifiedUser.email,
|
|
1306
|
+
emailVerified: true,
|
|
1307
|
+
plan: "pro",
|
|
1308
|
+
username: "renamed",
|
|
1309
|
+
name: "Renamed User",
|
|
1310
|
+
company: "Gloomberb",
|
|
1311
|
+
title: "Founder",
|
|
1312
|
+
bio: "Markets.",
|
|
1313
|
+
profilePublic: true,
|
|
1314
|
+
publicEmail: "public@example.com",
|
|
1315
|
+
xAccount: "vincelwt",
|
|
1316
|
+
sharedPortfolioId: "main",
|
|
1317
|
+
acceptUnknownDms: true,
|
|
1318
|
+
chatEmailNotificationsEnabled: false,
|
|
1319
|
+
updatedAt: "2026-04-01T00:00:00.000Z",
|
|
1320
|
+
},
|
|
1321
|
+
});
|
|
1322
|
+
},
|
|
1323
|
+
);
|
|
1089
1324
|
|
|
1090
1325
|
const profile = await apiClient.updateAccountProfile({
|
|
1091
1326
|
username: "renamed",
|
|
@@ -1108,18 +1343,22 @@ describe("apiClient account profile", () => {
|
|
|
1108
1343
|
expect(profile.username).toBe("renamed");
|
|
1109
1344
|
expect(apiClient.getCurrentUser()?.username).toBe("renamed");
|
|
1110
1345
|
expect(apiClient.getCurrentUser()?.plan).toBe("pro");
|
|
1111
|
-
expect(apiClient.getCurrentUser()?.chatEmailNotificationsEnabled).toBe(
|
|
1346
|
+
expect(apiClient.getCurrentUser()?.chatEmailNotificationsEnabled).toBe(
|
|
1347
|
+
false,
|
|
1348
|
+
);
|
|
1112
1349
|
});
|
|
1113
1350
|
|
|
1114
1351
|
test("changes password through Better Auth", async () => {
|
|
1115
1352
|
let requestedUrl = "";
|
|
1116
1353
|
let requestedBody = "";
|
|
1117
1354
|
apiClient.setSessionToken("session-token");
|
|
1118
|
-
globalThis.fetch = mockFetch(
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1355
|
+
globalThis.fetch = mockFetch(
|
|
1356
|
+
async (input: Request | string | URL, init?: RequestInit) => {
|
|
1357
|
+
requestedUrl = String(input);
|
|
1358
|
+
requestedBody = String(init?.body ?? "");
|
|
1359
|
+
return createResponse({ status: true });
|
|
1360
|
+
},
|
|
1361
|
+
);
|
|
1123
1362
|
|
|
1124
1363
|
await apiClient.changePassword("old-password", "new-password");
|
|
1125
1364
|
|
|
@@ -1206,11 +1445,13 @@ describe("apiClient equity diagnostic", () => {
|
|
|
1206
1445
|
test("posts the symbol, exchange, and cache mode to the research route", async () => {
|
|
1207
1446
|
let seenUrl = "";
|
|
1208
1447
|
let seenInit: RequestInit | undefined;
|
|
1209
|
-
globalThis.fetch = mockFetch(
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1448
|
+
globalThis.fetch = mockFetch(
|
|
1449
|
+
async (input: Request | string | URL, init?: RequestInit) => {
|
|
1450
|
+
seenUrl = String(input);
|
|
1451
|
+
seenInit = init;
|
|
1452
|
+
return createResponse({ symbol: "AAPL", status: "complete" });
|
|
1453
|
+
},
|
|
1454
|
+
);
|
|
1214
1455
|
|
|
1215
1456
|
await apiClient.getCloudEquityDiagnostic(" aapl ", "NASDAQ", "refresh");
|
|
1216
1457
|
|
|
@@ -1225,14 +1466,19 @@ describe("apiClient equity diagnostic", () => {
|
|
|
1225
1466
|
|
|
1226
1467
|
test("omits an unknown exchange and defaults to the cached answer", async () => {
|
|
1227
1468
|
let seenInit: RequestInit | undefined;
|
|
1228
|
-
globalThis.fetch = mockFetch(
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1469
|
+
globalThis.fetch = mockFetch(
|
|
1470
|
+
async (_input: Request | string | URL, init?: RequestInit) => {
|
|
1471
|
+
seenInit = init;
|
|
1472
|
+
return createResponse({ symbol: "AAPL", status: "complete" });
|
|
1473
|
+
},
|
|
1474
|
+
);
|
|
1232
1475
|
|
|
1233
1476
|
await apiClient.getCloudEquityDiagnostic("AAPL");
|
|
1234
1477
|
|
|
1235
|
-
expect(JSON.parse(String(seenInit?.body))).toEqual({
|
|
1478
|
+
expect(JSON.parse(String(seenInit?.body))).toEqual({
|
|
1479
|
+
symbol: "AAPL",
|
|
1480
|
+
mode: "cache-first",
|
|
1481
|
+
});
|
|
1236
1482
|
});
|
|
1237
1483
|
});
|
|
1238
1484
|
|
|
@@ -1277,7 +1523,11 @@ describe("apiClient document search", () => {
|
|
|
1277
1523
|
// Counting is the server default, so only opting out travels.
|
|
1278
1524
|
expect(url.searchParams.has("count")).toBe(false);
|
|
1279
1525
|
|
|
1280
|
-
await apiClient.searchCloudDocuments({
|
|
1526
|
+
await apiClient.searchCloudDocuments({
|
|
1527
|
+
query: "margin",
|
|
1528
|
+
limit: 3,
|
|
1529
|
+
count: false,
|
|
1530
|
+
});
|
|
1281
1531
|
expect(new URL(seenUrl).searchParams.get("count")).toBe("false");
|
|
1282
1532
|
});
|
|
1283
1533
|
|
|
@@ -1288,7 +1538,10 @@ describe("apiClient document search", () => {
|
|
|
1288
1538
|
return createResponse({ document: { chunks: [] } });
|
|
1289
1539
|
});
|
|
1290
1540
|
|
|
1291
|
-
await apiClient.getCloudSearchDocument(
|
|
1541
|
+
await apiClient.getCloudSearchDocument(
|
|
1542
|
+
"filing",
|
|
1543
|
+
"0000320193-26-000042/a b",
|
|
1544
|
+
);
|
|
1292
1545
|
|
|
1293
1546
|
expect(new URL(seenUrl).pathname).toBe(
|
|
1294
1547
|
"/cloud/search/documents/filing/0000320193-26-000042%2Fa%20b",
|
|
@@ -1309,18 +1562,30 @@ describe("apiClient document search", () => {
|
|
|
1309
1562
|
createdAt: "2026-05-01T00:00:00.000Z",
|
|
1310
1563
|
};
|
|
1311
1564
|
|
|
1312
|
-
globalThis.fetch = mockFetch(async () =>
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1565
|
+
globalThis.fetch = mockFetch(async () =>
|
|
1566
|
+
createResponse({ search: record }),
|
|
1567
|
+
);
|
|
1568
|
+
expect(
|
|
1569
|
+
(
|
|
1570
|
+
await apiClient.createCloudSavedSearch({
|
|
1571
|
+
name: record.name,
|
|
1572
|
+
query: record.query,
|
|
1573
|
+
})
|
|
1574
|
+
).id,
|
|
1575
|
+
).toBe("saved-1");
|
|
1317
1576
|
|
|
1318
1577
|
globalThis.fetch = mockFetch(async () => createResponse(record));
|
|
1319
|
-
expect(
|
|
1320
|
-
|
|
1578
|
+
expect(
|
|
1579
|
+
(
|
|
1580
|
+
await apiClient.updateCloudSavedSearch("saved-1", {
|
|
1581
|
+
alertEnabled: false,
|
|
1582
|
+
})
|
|
1583
|
+
).id,
|
|
1584
|
+
).toBe("saved-1");
|
|
1321
1585
|
|
|
1322
1586
|
globalThis.fetch = mockFetch(async () => createResponse({}));
|
|
1323
|
-
await expect(
|
|
1324
|
-
.
|
|
1587
|
+
await expect(
|
|
1588
|
+
apiClient.updateCloudSavedSearch("saved-1", { alertEnabled: false }),
|
|
1589
|
+
).rejects.toThrow("missing a record");
|
|
1325
1590
|
});
|
|
1326
1591
|
});
|