gloomberb 0.15.2 → 0.15.3
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 +31 -2
- package/README.zh-CN.md +12 -2
- package/package.json +20 -21
- package/src/api-client/auth.ts +7 -1
- package/src/api-client/chat.ts +1 -2
- package/src/api-client/collections.ts +1 -13
- package/src/api-client/credit-boards.ts +67 -0
- package/src/api-client/data.ts +93 -57
- package/src/api-client/earnings.ts +80 -0
- package/src/api-client/equity-screener.ts +25 -0
- package/src/api-client/errors.ts +42 -0
- package/src/api-client/feedback.ts +1 -2
- package/src/api-client/futures-curve.ts +30 -0
- package/src/api-client/index.ts +108 -100
- package/src/api-client/ipo.ts +99 -0
- package/src/api-client/market-movers.ts +60 -0
- package/src/api-client/mna.ts +118 -0
- package/src/api-client/normalizers.ts +0 -7
- package/src/api-client/notes.ts +20 -34
- package/src/api-client/paths.ts +21 -19
- package/src/api-client/plan-access.ts +27 -0
- package/src/api-client/plan-rules.ts +87 -0
- package/src/api-client/request.ts +40 -4
- package/src/api-client/research-activity.ts +17 -1
- package/src/api-client/revenue-breakdown.ts +36 -0
- package/src/api-client/session-cookie.ts +6 -0
- package/src/api-client/social-mentions.ts +63 -0
- package/src/api-client/teams.ts +1 -26
- package/src/api-client/telemetry.ts +180 -0
- package/src/api-client/theses.ts +9 -36
- package/src/api-client/types.ts +66 -61
- package/src/api-client/views.ts +22 -49
- package/src/app/app-bootstrap-state.ts +3 -14
- package/src/app/pane-runtime/plugin-bindings.ts +21 -1
- package/src/app/runtime/broker-import.ts +5 -1
- package/src/app/runtime/desktop-menu.ts +23 -12
- package/src/app/runtime/layout-warmup.ts +2 -2
- package/src/app/runtime/plugin-bindings.ts +27 -7
- package/src/app/runtime/startup.ts +55 -1
- package/src/app/runtime/ticker-refresh.ts +6 -6
- package/src/app/runtime/update.ts +4 -2
- package/src/app.tsx +15 -1
- package/src/assets/gloomberb-logo-windows.ico +0 -0
- package/src/assets/gloomberb-logo-windows.png +0 -0
- package/src/assets/gloomberb-logo.svg +1 -73
- package/src/assets/gloomberb-mark.ico +0 -0
- package/src/assets/gloomberb-mark.svg +1 -0
- package/src/brokers/broker-portfolio-sync.ts +75 -6
- package/src/brokers/broker-ticker-sync.ts +3 -1
- package/src/brokers/cloud-broker-link.ts +26 -0
- package/src/brokers/directory.ts +56 -0
- package/src/brokers/remote-broker-adapter.ts +4 -1
- package/src/brokers/signed-in/adapter.ts +259 -0
- package/src/brokers/signed-in/catalog.ts +129 -0
- package/src/brokers/signed-in/client.ts +54 -0
- package/src/brokers/signed-in/connect.ts +69 -0
- package/src/brokers/signed-in/profile.ts +18 -0
- package/src/brokers/signed-in/sign-in-dialog.tsx +187 -0
- package/src/brokers/signed-in/sign-in.ts +178 -0
- package/src/brokers/sync-broker-instance.ts +42 -24
- package/src/capabilities/index.ts +42 -6
- package/src/cli/commands/broker.ts +49 -0
- package/src/cli/commands/market.ts +5 -0
- package/src/cli/commands/overview.ts +2 -5
- package/src/cli/commands/plugins.ts +112 -428
- package/src/cli/commands/system.ts +26 -354
- package/src/cli/commands/ticker.ts +11 -34
- package/src/cli/desktop-pane-shot-routes.ts +7 -0
- package/src/cli/desktop-pane-shot.ts +7 -27
- package/src/cli/entry.ts +20 -23
- package/src/cli/helpers.ts +5 -19
- package/src/cli/index.ts +17 -23
- package/src/cli/pane-functions/capabilities.ts +0 -4
- package/src/cli/pane-functions/catalog.ts +30 -4
- package/src/cli/pane-functions/headless.ts +1 -4
- package/src/cli/pane-functions/index.ts +0 -23
- package/src/cli/pane-functions/options.ts +8 -5
- package/src/cli/pane-functions/screenshot-evidence.ts +106 -0
- package/src/cli/pane-functions/screenshot.ts +48 -291
- package/src/cli/restore-plugins.ts +10 -2
- package/src/components/chart/composite/axis-overlays.tsx +87 -22
- package/src/components/chart/composite/composite-chart.tsx +5 -6
- package/src/components/chart/composite/downsample.ts +4 -7
- package/src/components/chart/composite/format.ts +39 -3
- package/src/components/chart/composite/interactions.ts +1 -29
- package/src/components/chart/composite/price-axis-labels.tsx +1 -4
- package/src/components/chart/composite/rasterizer.ts +1 -19
- package/src/components/chart/composite/scene.ts +7 -10
- package/src/components/chart/composite/text-renderer.ts +5 -21
- package/src/components/chart/composite/time-axis.ts +1 -4
- package/src/components/chart/composite/tools.ts +2 -1
- package/src/components/chart/core/pointer.ts +1 -4
- package/src/components/chart/curve/curve-surface.tsx +180 -48
- package/src/components/chart/curve/index.ts +3 -2
- package/src/components/chart/curve/model.ts +200 -31
- package/src/components/chart/native/chart-rasterizer.ts +1 -0
- package/src/components/chart/native/kitty/protocol.ts +1 -1
- package/src/components/chart/native/raster/crosshair.ts +1 -2
- package/src/components/chart/native/raster/placement.ts +6 -0
- package/src/components/chart/native/raster/primitives.ts +5 -9
- package/src/components/chart/native/raster/types.ts +0 -7
- package/src/components/chart/native/renderer-selection.ts +4 -4
- package/src/components/chart/native/surface/manager.ts +7 -12
- package/src/components/chart/static/chart-surface.tsx +4 -7
- package/src/components/chart/static/index.ts +0 -1
- package/src/components/chart/static/trail-chart-surface.tsx +393 -66
- package/src/components/chart/surface3d/model.ts +2 -2
- package/src/components/chart/surface3d/software.ts +2 -1
- package/src/components/chart-table/axis.ts +29 -0
- package/src/components/chart-table/header.tsx +264 -0
- package/src/components/chart-table/index.ts +14 -0
- package/src/components/chart-table/layout.ts +139 -0
- package/src/components/chart-table/selection.ts +145 -0
- package/src/components/command-bar/action-runtime.ts +1 -2
- package/src/components/command-bar/assist/inventory.ts +83 -30
- package/src/components/command-bar/assist/model.ts +4 -0
- package/src/components/command-bar/assist/runtime.ts +79 -26
- package/src/components/command-bar/commands/collection.ts +1 -6
- package/src/components/command-bar/commands/direct/index.ts +26 -2
- package/src/components/command-bar/commands/direct/runtime.ts +1 -1
- package/src/components/command-bar/commands/plugin/actions.ts +2 -1
- package/src/components/command-bar/commands/plugin/items.ts +10 -0
- package/src/components/command-bar/commands/registry.ts +23 -0
- package/src/components/command-bar/helpers.ts +0 -1
- package/src/components/command-bar/layout-items/current-layout.ts +11 -9
- package/src/components/command-bar/layout-items/types.ts +0 -1
- package/src/components/command-bar/layout-items.ts +0 -3
- package/src/components/command-bar/list/model.ts +5 -0
- package/src/components/command-bar/list/navigation.ts +2 -5
- package/src/components/command-bar/list/view.tsx +7 -7
- package/src/components/command-bar/pane-actions.ts +3 -8
- package/src/components/command-bar/pane-templates/workflow.ts +5 -1
- package/src/components/command-bar/panel/index.tsx +5 -5
- package/src/components/command-bar/panel/runtime.ts +4 -1
- package/src/components/command-bar/picker-activation.ts +14 -4
- package/src/components/command-bar/routes/root/command-items.ts +19 -1
- package/src/components/command-bar/routes/root/plugin-install.ts +304 -0
- package/src/components/command-bar/routes/root/results.ts +10 -1
- package/src/components/command-bar/routes/root/runtime.ts +12 -8
- package/src/components/command-bar/routes/root/search-report.ts +246 -0
- package/src/components/command-bar/routes/root/selection.ts +14 -5
- package/src/components/command-bar/routes/root/shortcut-items.ts +2 -0
- package/src/components/command-bar/routing/actions.ts +2 -8
- package/src/components/command-bar/routing/confirm.ts +6 -1
- package/src/components/command-bar/routing/launch-request.ts +7 -0
- package/src/components/command-bar/routing/navigation-state.ts +24 -0
- package/src/components/command-bar/selection-runtime.ts +110 -65
- package/src/components/command-bar/surface/index.tsx +116 -19
- package/src/components/command-bar/theme-picker.tsx +11 -10
- package/src/components/command-bar/view-model.ts +10 -6
- package/src/components/command-bar/workflow/body.tsx +6 -5
- package/src/components/command-bar/workflow/broker.ts +113 -76
- package/src/components/command-bar/workflow/collection-actions.ts +39 -8
- package/src/components/command-bar/workflow/coordinator.ts +19 -10
- package/src/components/command-bar/workflow/field-row.tsx +3 -3
- package/src/components/command-bar/workflow/fields.ts +14 -5
- package/src/components/command-bar/workflow/ops.ts +14 -1
- package/src/components/command-bar/workflow/submit.ts +23 -9
- package/src/components/command-bar/workflow/types.ts +3 -0
- package/src/components/data-table/export.ts +103 -6
- package/src/components/data-table/stack-view.tsx +22 -2
- package/src/components/data-table/table-pane.ts +45 -0
- package/src/components/data-table/view.tsx +24 -10
- package/src/components/feed-data-table/stack-view.tsx +47 -130
- package/src/components/index.ts +49 -5
- package/src/components/layout/header.tsx +5 -12
- package/src/components/layout/market-summary.ts +1 -2
- package/src/components/layout/missing-pane.tsx +2 -7
- package/src/components/layout/pane/header-tabs.tsx +2 -1
- package/src/components/layout/pane/header.tsx +2 -6
- package/src/components/layout/pane/pane-tabs.tsx +41 -0
- package/src/components/layout/pane/status-footer.ts +92 -0
- package/src/components/layout/shell/action-menu-overlay.tsx +3 -3
- package/src/components/layout/shell/index.tsx +6 -10
- package/src/components/layout/shell/menu.ts +1 -5
- package/src/components/layout/shell/native/surfaces.ts +3 -4
- package/src/components/layout/shell/pane/actions.ts +8 -9
- package/src/components/layout/shell/shortcuts.ts +4 -1
- package/src/components/layout/shell/window-mode/overlays.tsx +3 -2
- package/src/components/layout/status-bar.tsx +34 -47
- package/src/components/layout/titlebar-overlay.ts +3 -14
- package/src/components/layout/window-edit/status.tsx +3 -9
- package/src/components/markdown-text.tsx +306 -2
- package/src/components/market-board/index.tsx +60 -16
- package/src/components/onboarding/account-step/form-panel.tsx +2 -2
- package/src/components/onboarding/account-step/qr-panel.tsx +13 -30
- package/src/components/onboarding/account-step/signed-in-panel.tsx +2 -2
- package/src/components/onboarding/first-run-workspace.ts +8 -6
- package/src/components/onboarding/onboarding-frame.tsx +11 -15
- package/src/components/onboarding/onboarding-wizard.tsx +51 -30
- package/src/components/onboarding/portfolio-step/broker-fields-panel.tsx +2 -2
- package/src/components/onboarding/portfolio-step/broker-setup-panel.tsx +2 -2
- package/src/components/onboarding/portfolio-step/broker-sync-panel.tsx +2 -2
- package/src/components/onboarding/portfolio-step/choose-panel.tsx +2 -2
- package/src/components/onboarding/portfolio-step/positions-panel.tsx +2 -2
- package/src/components/onboarding/wizard-broker-sync.ts +122 -51
- package/src/components/onboarding/wizard-model.ts +20 -7
- package/src/components/onboarding/wizard-positions.ts +1 -1
- package/src/components/paged-rows.ts +217 -0
- package/src/components/pane-settings-dialog/field-dialogs.tsx +2 -2
- package/src/components/pane-settings-dialog.tsx +2 -2
- package/src/components/price-sparkline/model.ts +11 -8
- package/src/components/price-sparkline/view.tsx +10 -7
- package/src/components/sign-in-code-panel.tsx +128 -0
- package/src/components/sign-in-gate.tsx +8 -22
- package/src/components/speedometer-gauge/index.tsx +2 -2
- package/src/components/speedometer-gauge/model.ts +1 -4
- package/src/components/table-view-shared.tsx +0 -44
- package/src/components/ticker/badge/format.ts +0 -4
- package/src/components/ticker/list-table-view.tsx +6 -37
- package/src/components/toggle-list.tsx +2 -2
- package/src/components/ui/choice-dialog.tsx +4 -8
- package/src/components/ui/confirm-dialog.tsx +21 -1
- package/src/components/ui/data-table/hooks.ts +46 -0
- package/src/components/ui/data-table/opentui/index.tsx +21 -30
- package/src/components/ui/data-table/opentui/model.ts +0 -21
- package/src/components/ui/data-table/types.ts +20 -0
- package/src/components/ui/data-table/visible-range.ts +26 -2
- package/src/components/ui/detail-scroll-body.tsx +48 -0
- package/src/components/ui/disclosure-marker.tsx +2 -2
- package/src/components/ui/display.tsx +8 -4
- package/src/components/ui/field-grid.tsx +26 -2
- package/src/components/ui/field-ring.ts +125 -0
- package/src/components/ui/fields.tsx +65 -3
- package/src/components/ui/index.ts +18 -7
- package/src/components/ui/multi-select/dialog.tsx +3 -3
- package/src/components/ui/page-stack-view.tsx +2 -0
- package/src/components/ui/prose.tsx +52 -0
- package/src/components/ui/query-bar.tsx +37 -9
- package/src/components/ui/reveal-in-scroll-box.ts +34 -0
- package/src/components/ui/select-button.tsx +2 -2
- package/src/components/ui/split-bar.tsx +69 -0
- package/src/components/ui/stat-grid.tsx +38 -14
- package/src/components/ui/status.tsx +2 -0
- package/src/components/ui/text-prompt-dialog.tsx +128 -0
- package/src/core/app-runtime.ts +5 -0
- package/src/core/connection-health.ts +2 -4
- package/src/core/state/app/layout.ts +13 -0
- package/src/core/state/app/types.ts +16 -0
- package/src/core/state/session-persistence.ts +8 -14
- package/src/data/cached-query.ts +5 -0
- package/src/data/config/chart-settings.ts +14 -21
- package/src/data/config/layout.ts +0 -8
- package/src/data/config/store/migrations.ts +74 -141
- package/src/data/config/store/node.ts +29 -3
- package/src/data/config/store/normalize.ts +35 -63
- package/src/data/config/store/pane-state.ts +47 -0
- package/src/data/fred-series.ts +7 -18
- package/src/data/json-persistence.ts +1 -4
- package/src/data/json-ticker-repository.ts +1 -4
- package/src/i18n/es.ts +26 -5
- package/src/i18n/ja.ts +26 -5
- package/src/i18n/ko.ts +26 -5
- package/src/i18n/languages.ts +18 -0
- package/src/i18n/zh-cn.ts +26 -5
- package/src/i18n/zh-tw.ts +26 -5
- package/src/layout-marketplace/cloud.ts +11 -54
- package/src/layout-marketplace/gallery.tsx +32 -46
- package/src/layout-marketplace/linked-sync.ts +1 -2
- package/src/layout-marketplace/payload.ts +16 -19
- package/src/market-data/coordinator/chart.ts +5 -4
- package/src/market-data/coordinator/events.ts +15 -2
- package/src/market-data/coordinator/index.ts +37 -9
- package/src/market-data/coordinator/quotes.ts +2 -9
- package/src/market-data/history-session.ts +2 -9
- package/src/market-data/hooks.tsx +3 -3
- package/src/market-data/market/format.ts +26 -0
- package/src/market-data/market/freshness.ts +5 -34
- package/src/market-data/market/price-basis.ts +1 -1
- package/src/market-data/market/status.ts +1 -1
- package/src/market-data/query-store.ts +37 -31
- package/src/market-data/quotes/day-range.ts +2 -8
- package/src/market-data/quotes/freshness.ts +2 -4
- package/src/market-data/quotes/screener-live-quotes.ts +162 -0
- package/src/market-data/realized-volatility.ts +292 -0
- package/src/market-data/selectors.ts +27 -10
- package/src/market-data/snapshot-provider.ts +3 -2
- package/src/news/aggregator.ts +0 -35
- package/src/news/source-label.ts +22 -0
- package/src/news/types.ts +1 -0
- package/src/pane-settings.ts +0 -8
- package/src/plugins/absorbed.ts +33 -0
- package/src/plugins/auto-update-node.ts +113 -0
- package/src/plugins/auto-update.ts +281 -0
- package/src/plugins/builtin/account-management/form-components.tsx +8 -83
- package/src/plugins/builtin/account-management/index.tsx +26 -0
- package/src/plugins/builtin/account-management/keyboard.ts +50 -98
- package/src/plugins/builtin/account-management/model.ts +19 -53
- package/src/plugins/builtin/account-management/navigation.ts +6 -21
- package/src/plugins/builtin/account-management/pane.tsx +76 -187
- package/src/plugins/builtin/account-management/password-dialog.tsx +10 -8
- package/src/plugins/builtin/alerts/cli.ts +96 -0
- package/src/plugins/builtin/alerts/events-pane.tsx +22 -50
- package/src/plugins/builtin/alerts/history-pane.tsx +20 -59
- package/src/plugins/builtin/alerts/history.ts +1 -1
- package/src/plugins/builtin/alerts/index.tsx +2 -0
- package/src/plugins/builtin/alerts/pane.tsx +27 -65
- package/src/plugins/builtin/alerts/research-rules.ts +8 -3
- package/src/plugins/builtin/analytics/account-returns.ts +109 -0
- package/src/plugins/builtin/analytics/broker-performance.ts +4 -2
- package/src/plugins/builtin/analytics/display.ts +0 -32
- package/src/plugins/builtin/analytics/index.tsx +119 -88
- package/src/plugins/builtin/analytics/metrics.ts +0 -26
- package/src/plugins/builtin/analytics/pane-model.ts +25 -17
- package/src/plugins/builtin/analytics/risk-client.ts +11 -14
- package/src/plugins/builtin/analytics/risk-evidence.ts +45 -15
- package/src/plugins/builtin/analytics/risk-pane.tsx +134 -139
- package/src/plugins/builtin/analytics/sector-model.ts +0 -11
- package/src/plugins/builtin/analytics/view.tsx +92 -111
- package/src/plugins/builtin/backtest/client.ts +5 -6
- package/src/plugins/builtin/backtest/pane.tsx +35 -41
- package/src/plugins/builtin/backtest/rules.ts +0 -8
- package/src/plugins/builtin/bond-calculator/model.ts +0 -1
- package/src/plugins/builtin/bond-calculator/pane.tsx +8 -15
- package/src/plugins/builtin/broker-manager/detail.tsx +39 -76
- package/src/plugins/builtin/broker-manager/footer.ts +3 -3
- package/src/plugins/builtin/broker-manager/index.tsx +24 -4
- package/src/plugins/builtin/broker-manager/keyboard.ts +7 -30
- package/src/plugins/builtin/broker-manager/model.ts +4 -7
- package/src/plugins/builtin/broker-manager/pane-actions.tsx +74 -34
- package/src/plugins/builtin/broker-manager/table.ts +3 -12
- package/src/plugins/builtin/buildout/cells.tsx +34 -36
- package/src/plugins/builtin/buildout/detail/company.tsx +5 -4
- package/src/plugins/builtin/buildout/detail/site.tsx +6 -5
- package/src/plugins/builtin/buildout/detail/ui.tsx +10 -9
- package/src/plugins/builtin/buildout/format.ts +3 -8
- package/src/plugins/builtin/buildout/index.tsx +23 -0
- package/src/plugins/builtin/buildout/model/types.ts +0 -1
- package/src/plugins/builtin/buildout/pane/index.tsx +18 -40
- package/src/plugins/builtin/buildout/table-model.ts +1 -1
- package/src/plugins/builtin/builtin-plugin-meta.ts +51 -0
- package/src/plugins/builtin/cds/client.ts +33 -1
- package/src/plugins/builtin/cds/index.tsx +4 -4
- package/src/plugins/builtin/cds/model.ts +56 -10
- package/src/plugins/builtin/cds/pane.tsx +139 -49
- package/src/plugins/builtin/central-bank-rates/client.ts +5 -17
- package/src/plugins/builtin/central-bank-rates/headless.ts +1 -1
- package/src/plugins/builtin/central-bank-rates/index.tsx +1 -1
- package/src/plugins/builtin/central-bank-rates/pane.tsx +15 -20
- package/src/plugins/builtin/changelog/index.tsx +23 -105
- package/src/plugins/builtin/changelog/model.ts +2 -12
- package/src/plugins/builtin/chart-composer/catalog-inventory.ts +3 -2
- package/src/plugins/builtin/chart-composer/chart-spec.ts +1 -4
- package/src/plugins/builtin/chart-composer/data-catalog-pane.tsx +20 -71
- package/src/plugins/builtin/chart-composer/editor/controller.ts +8 -12
- package/src/plugins/builtin/chart-composer/editor.tsx +2 -2
- package/src/plugins/builtin/chart-composer/follow-binding.ts +6 -1
- package/src/plugins/builtin/chart-composer/index.tsx +6 -9
- package/src/plugins/builtin/chart-composer/pane.tsx +50 -3
- package/src/plugins/builtin/chart-composer/presets.ts +34 -0
- package/src/plugins/builtin/chart-composer/quick-add.tsx +17 -23
- package/src/plugins/builtin/chart-composer/semantic.ts +1 -0
- package/src/plugins/builtin/chart-composer/settings.ts +1 -1
- package/src/plugins/builtin/chat/channels.ts +0 -2
- package/src/plugins/builtin/chat/content/index.tsx +1 -1
- package/src/plugins/builtin/chat/content/layout-metrics.ts +3 -6
- package/src/plugins/builtin/chat/controller/fetch.ts +1 -14
- package/src/plugins/builtin/chat/controller/state.ts +4 -2
- package/src/plugins/builtin/chat/controller/utils.ts +0 -14
- package/src/plugins/builtin/chat/index.tsx +105 -0
- package/src/plugins/builtin/chat/message/desktop.tsx +22 -94
- package/src/plugins/builtin/chat/message/header.tsx +83 -0
- package/src/plugins/builtin/chat/message/profile-popover.tsx +1 -1
- package/src/plugins/builtin/chat/message/render-state.ts +10 -2
- package/src/plugins/builtin/chat/message/terminal.tsx +22 -78
- package/src/plugins/builtin/chat/pane.tsx +112 -124
- package/src/plugins/builtin/chat/sidebar.tsx +2 -18
- package/src/plugins/builtin/chat/status-widget.tsx +0 -3
- package/src/plugins/builtin/cloud/askg/executor.ts +14 -39
- package/src/plugins/builtin/cloud/askg/json.ts +31 -0
- package/src/plugins/builtin/cloud/askg/manifest.ts +1 -1
- package/src/plugins/builtin/cloud/askg/pane.tsx +10 -16
- package/src/plugins/builtin/cloud/askg/pending-question.ts +5 -27
- package/src/plugins/builtin/cloud/askg/protocol.ts +1 -15
- package/src/plugins/builtin/cloud/askg/undo.ts +4 -29
- package/src/plugins/builtin/cloud/auth-actions.tsx +28 -1
- package/src/plugins/builtin/cloud/browser.tsx +1 -7
- package/src/plugins/builtin/cloud/device-signin-dialog.tsx +64 -147
- package/src/plugins/builtin/cloud/index.tsx +2 -11
- package/src/plugins/builtin/cloud/plugin.tsx +13 -151
- package/src/plugins/builtin/cloud/team/collections-sync.ts +4 -2
- package/src/plugins/builtin/cloud/team/collections.ts +0 -4
- package/src/plugins/builtin/cloud/team/model.ts +0 -4
- package/src/plugins/builtin/cloud/team/module.tsx +0 -3
- package/src/plugins/builtin/cloud/team/pane-model.ts +0 -7
- package/src/plugins/builtin/cloud/team/pane-request.ts +5 -22
- package/src/plugins/builtin/cloud/team/pane-sections.tsx +1 -1
- package/src/plugins/builtin/cloud/team/pane-ui.tsx +15 -24
- package/src/plugins/builtin/cloud/team/pane.tsx +21 -58
- package/src/plugins/builtin/cloud/thesis/board-pane.tsx +31 -50
- package/src/plugins/builtin/cloud/thesis/detail.tsx +1 -1
- package/src/plugins/builtin/cloud/thesis/exposure.ts +1 -4
- package/src/plugins/builtin/cloud/thesis/flows.ts +8 -7
- package/src/plugins/builtin/cloud/thesis/model.ts +0 -7
- package/src/plugins/builtin/cloud/thesis/pane-request.ts +5 -22
- package/src/plugins/builtin/cloud/thesis/prompts.tsx +13 -125
- package/src/plugins/builtin/cloud/thesis/ticker-tab.tsx +1 -1
- package/src/plugins/builtin/cloud/upgrade-command.ts +1 -1
- package/src/plugins/builtin/cloud/upgrade-dialog.tsx +231 -0
- package/src/plugins/builtin/cloud/upgrade-status-widget.tsx +2 -4
- package/src/plugins/builtin/cloud/verification-status-widget.tsx +2 -4
- package/src/plugins/builtin/cloud-tweets/footer.ts +2 -2
- package/src/plugins/builtin/cloud-tweets/index.ts +6 -0
- package/src/plugins/builtin/cloud-tweets/keyboard.ts +1 -32
- package/src/plugins/builtin/cloud-tweets/model.ts +1 -5
- package/src/plugins/builtin/cloud-tweets/pane.tsx +10 -43
- package/src/plugins/builtin/cloud-tweets/registration.ts +5 -8
- package/src/plugins/builtin/cloud-tweets/search-bar.tsx +5 -20
- package/src/plugins/builtin/cloud-tweets/table.tsx +16 -23
- package/src/plugins/builtin/composite-plugins.ts +77 -37
- package/src/plugins/builtin/congress-trades/detail.tsx +28 -81
- package/src/plugins/builtin/congress-trades/footer.ts +1 -1
- package/src/plugins/builtin/congress-trades/headless.ts +22 -45
- package/src/plugins/builtin/congress-trades/keyboard.ts +9 -78
- package/src/plugins/builtin/congress-trades/model.ts +4 -27
- package/src/plugins/builtin/congress-trades/pane.tsx +17 -38
- package/src/plugins/builtin/congress-trades/table.tsx +29 -34
- package/src/plugins/builtin/connections/pane.tsx +5 -12
- package/src/plugins/builtin/correlation/index.tsx +3 -5
- package/src/plugins/builtin/correlation/relationship/pane.tsx +6 -7
- package/src/plugins/builtin/correlation/relationship/view-model.ts +7 -18
- package/src/plugins/builtin/cot/client.ts +14 -18
- package/src/plugins/builtin/cot/index.tsx +3 -2
- package/src/plugins/builtin/cot/model.ts +13 -10
- package/src/plugins/builtin/cot/pane.tsx +70 -45
- package/src/plugins/builtin/credit-boards/cdx-pane.tsx +140 -0
- package/src/plugins/builtin/credit-boards/client.ts +108 -0
- package/src/plugins/builtin/credit-boards/headless.ts +73 -0
- package/src/plugins/builtin/credit-boards/index.tsx +62 -0
- package/src/plugins/builtin/credit-boards/model.ts +221 -0
- package/src/plugins/builtin/credit-boards/sovr-pane.tsx +144 -0
- package/src/plugins/builtin/credit-conditions/index.tsx +33 -33
- package/src/plugins/builtin/crypto-board/client.ts +11 -34
- package/src/plugins/builtin/crypto-board/index.tsx +1 -1
- package/src/plugins/builtin/crypto-board/model.ts +14 -16
- package/src/plugins/builtin/crypto-board/pane.tsx +24 -50
- package/src/plugins/builtin/custom-view/index.tsx +1 -1
- package/src/plugins/builtin/custom-view/pane.tsx +1 -1
- package/src/plugins/builtin/custom-view/view-spec.ts +9 -12
- package/src/plugins/builtin/debt-maturities/client.ts +15 -42
- package/src/plugins/builtin/debt-maturities/model.ts +96 -31
- package/src/plugins/builtin/debt-maturities/pane.tsx +196 -223
- package/src/plugins/builtin/debt-maturities/wall-bar.tsx +63 -0
- package/src/plugins/builtin/debug/index.tsx +17 -46
- package/src/plugins/builtin/dividend-yield/client.ts +13 -33
- package/src/plugins/builtin/dividend-yield/model.ts +10 -22
- package/src/plugins/builtin/dividend-yield/pane.tsx +97 -143
- package/src/plugins/builtin/dividend-yield/trailing-cash.ts +3 -3
- package/src/plugins/builtin/dividend-yield/view.ts +2 -2
- package/src/plugins/builtin/earnings/board-model.ts +197 -0
- package/src/plugins/builtin/earnings/board-table.ts +84 -0
- package/src/plugins/builtin/earnings/board.tsx +236 -0
- package/src/plugins/builtin/earnings/client.ts +97 -0
- package/src/plugins/builtin/earnings/format.ts +62 -0
- package/src/plugins/builtin/earnings/headless.ts +134 -138
- package/src/plugins/builtin/earnings/history-model.ts +174 -0
- package/src/plugins/builtin/earnings/history-table.ts +84 -0
- package/src/plugins/builtin/earnings/history.tsx +107 -0
- package/src/plugins/builtin/earnings/index.tsx +70 -270
- package/src/plugins/builtin/earnings/model.ts +0 -99
- package/src/plugins/builtin/earnings-calls/data.ts +0 -5
- package/src/plugins/builtin/earnings-calls/format.ts +2 -8
- package/src/plugins/builtin/earnings-calls/index.tsx +0 -1
- package/src/plugins/builtin/earnings-calls/pane.tsx +16 -63
- package/src/plugins/builtin/earnings-calls/transcript-view.tsx +18 -61
- package/src/plugins/builtin/econ/calendar-model.ts +34 -1
- package/src/plugins/builtin/econ/detail-view.tsx +124 -139
- package/src/plugins/builtin/econ/fred-series-map.ts +1 -5
- package/src/plugins/builtin/econ/index.tsx +51 -90
- package/src/plugins/builtin/econ-statistics/client.ts +5 -4
- package/src/plugins/builtin/econ-statistics/defs.ts +1 -1
- package/src/plugins/builtin/econ-statistics/detail.tsx +32 -104
- package/src/plugins/builtin/econ-statistics/headless.ts +28 -50
- package/src/plugins/builtin/econ-statistics/index.tsx +1 -1
- package/src/plugins/builtin/econ-statistics/pane.tsx +36 -152
- package/src/plugins/builtin/econ-statistics/stats.ts +0 -5
- package/src/plugins/builtin/econ-statistics/view.ts +2 -4
- package/src/plugins/builtin/equity-screener/client.ts +2 -2
- package/src/plugins/builtin/equity-screener/live.ts +7 -9
- package/src/plugins/builtin/equity-screener/model.ts +67 -9
- package/src/plugins/builtin/equity-screener/pane.tsx +39 -58
- package/src/plugins/builtin/equity-screener/results.ts +2 -4
- package/src/plugins/builtin/estimate-revisions/client.ts +20 -49
- package/src/plugins/builtin/estimate-revisions/pane.tsx +71 -104
- package/src/plugins/builtin/executives/data.ts +3 -8
- package/src/plugins/builtin/executives/format.ts +3 -17
- package/src/plugins/builtin/executives/pane.tsx +33 -186
- package/src/plugins/builtin/fear-greed/cache.ts +100 -0
- package/src/plugins/builtin/fear-greed/charts.tsx +258 -0
- package/src/plugins/builtin/fear-greed/data.ts +376 -0
- package/src/plugins/builtin/fear-greed/format.ts +87 -0
- package/src/plugins/builtin/fear-greed/headless.ts +85 -0
- package/src/plugins/builtin/fear-greed/index.tsx +89 -0
- package/src/plugins/builtin/fear-greed/pane.tsx +112 -0
- package/src/plugins/builtin/filing-events/feed.ts +4 -14
- package/src/plugins/builtin/filing-events/pane.tsx +7 -21
- package/src/plugins/builtin/futures/contracts.ts +55 -33
- package/src/plugins/builtin/futures/index.tsx +61 -47
- package/src/plugins/builtin/futures/model.ts +39 -17
- package/src/plugins/builtin/futures/returns.ts +132 -0
- package/src/plugins/builtin/futures/table.tsx +72 -63
- package/src/plugins/builtin/futures/use-front-returns.ts +119 -0
- package/src/plugins/builtin/futures-curve/client.ts +30 -15
- package/src/plugins/builtin/futures-curve/headless.ts +10 -4
- package/src/plugins/builtin/futures-curve/index.tsx +2 -1
- package/src/plugins/builtin/futures-curve/model.ts +133 -18
- package/src/plugins/builtin/futures-curve/pane.tsx +141 -45
- package/src/plugins/builtin/fx-matrix/index.tsx +9 -17
- package/src/plugins/builtin/help/functions-table.tsx +2 -19
- package/src/plugins/builtin/help/index.tsx +6 -26
- package/src/plugins/builtin/help/shortcut-model.ts +7 -1
- package/src/plugins/builtin/holders/headless.ts +2 -2
- package/src/plugins/builtin/holders/index.tsx +0 -1
- package/src/plugins/builtin/holders/pane.tsx +43 -83
- package/src/plugins/builtin/holders/table-model.ts +1 -15
- package/src/plugins/builtin/holders/thirteenf-match.ts +4 -3
- package/src/plugins/builtin/holders/types.ts +1 -1
- package/src/plugins/builtin/insider/index.tsx +0 -1
- package/src/plugins/builtin/ipo-calendar/client.ts +93 -0
- package/src/plugins/builtin/ipo-calendar/headless.ts +159 -0
- package/src/plugins/builtin/ipo-calendar/index.tsx +47 -0
- package/src/plugins/builtin/ipo-calendar/model.ts +341 -0
- package/src/plugins/builtin/ipo-calendar/pane.tsx +233 -0
- package/src/plugins/builtin/iv-history/index.tsx +0 -1
- package/src/plugins/builtin/iv-history/pane.tsx +7 -4
- package/src/plugins/builtin/iv-history/rank.ts +0 -7
- package/src/plugins/builtin/iv-history/screen-pane.tsx +7 -12
- package/src/plugins/builtin/jobs/headless.ts +58 -76
- package/src/plugins/builtin/jobs/index.tsx +0 -1
- package/src/plugins/builtin/jobs/model.ts +7 -15
- package/src/plugins/builtin/jobs/pane.tsx +190 -154
- package/src/plugins/builtin/jobs/share-bars.tsx +2 -2
- package/src/plugins/builtin/kelly-sizer/fields.ts +1 -1
- package/src/plugins/builtin/kelly-sizer/model.ts +1 -26
- package/src/plugins/builtin/kelly-sizer/pane.tsx +22 -67
- package/src/plugins/builtin/kelly-sizer/sections.tsx +1 -1
- package/src/plugins/builtin/kelly-sizer/state.ts +2 -2
- package/src/plugins/builtin/kelly-sizer/test-support.tsx +18 -27
- package/src/plugins/builtin/layout-manager/index.tsx +13 -50
- package/src/plugins/builtin/macro-resources.ts +15 -0
- package/src/plugins/builtin/market-halts/client.ts +114 -0
- package/src/plugins/builtin/market-halts/index.tsx +41 -0
- package/src/plugins/builtin/market-halts/model.ts +323 -0
- package/src/plugins/builtin/market-halts/pane.tsx +239 -0
- package/src/plugins/builtin/market-heatmap/data.ts +305 -0
- package/src/plugins/builtin/market-heatmap/index.tsx +447 -0
- package/src/plugins/builtin/market-movers/client.ts +30 -3
- package/src/plugins/builtin/market-movers/footer.ts +19 -0
- package/src/plugins/builtin/market-movers/headless.ts +71 -5
- package/src/plugins/builtin/market-movers/index.tsx +135 -101
- package/src/plugins/builtin/market-movers/model.ts +11 -17
- package/src/plugins/builtin/market-movers/screener.ts +2 -8
- package/src/plugins/builtin/market-movers/session-body.tsx +237 -0
- package/src/plugins/builtin/market-movers/session-table.ts +96 -0
- package/src/plugins/builtin/market-movers/session.ts +233 -0
- package/src/plugins/builtin/market-movers/table.ts +15 -15
- package/src/plugins/builtin/market-valuation/cache.ts +2 -39
- package/src/plugins/builtin/market-valuation/chart-projection.ts +11 -34
- package/src/plugins/builtin/market-valuation/client.ts +4 -5
- package/src/plugins/builtin/market-valuation/defs.ts +0 -9
- package/src/plugins/builtin/market-valuation/detail.tsx +32 -89
- package/src/plugins/builtin/market-valuation/headless.ts +31 -51
- package/src/plugins/builtin/market-valuation/index.tsx +11 -1
- package/src/plugins/builtin/market-valuation/pane.tsx +37 -179
- package/src/plugins/builtin/market-valuation/view.ts +6 -7
- package/src/plugins/builtin/market-valuation/zone-scale/index.tsx +2 -2
- package/src/plugins/builtin/mna/client.ts +143 -0
- package/src/plugins/builtin/mna/detail.tsx +297 -0
- package/src/plugins/builtin/mna/headless.ts +82 -0
- package/src/plugins/builtin/mna/index.tsx +55 -0
- package/src/plugins/builtin/mna/model.ts +208 -0
- package/src/plugins/builtin/mna/pane.tsx +432 -0
- package/src/plugins/builtin/money-markets/client.ts +5 -17
- package/src/plugins/builtin/money-markets/model.ts +20 -0
- package/src/plugins/builtin/money-markets/pane.tsx +79 -46
- package/src/plugins/builtin/news/index.tsx +13 -14
- package/src/plugins/builtin/news/wire/categories.ts +35 -12
- package/src/plugins/builtin/news/wire/feed-config.ts +4 -13
- package/src/plugins/builtin/news/wire/index.tsx +43 -27
- package/src/plugins/builtin/news/wire/industry-pane.tsx +110 -105
- package/src/plugins/builtin/news/wire/news/detail-view.tsx +8 -25
- package/src/plugins/builtin/news/wire/news/footer.ts +2 -2
- package/src/plugins/builtin/news/wire/news/preset-pane.tsx +111 -61
- package/src/plugins/builtin/news/wire/news/query-presets.ts +66 -1
- package/src/plugins/builtin/news/wire/news/table.tsx +19 -62
- package/src/plugins/builtin/news/wire/read-state.ts +3 -17
- package/src/plugins/builtin/news/wire/rss/cli.ts +47 -0
- package/src/plugins/builtin/news/wire/rss/parser.ts +0 -4
- package/src/plugins/builtin/news/wire/rss/source.ts +2 -2
- package/src/plugins/builtin/notes/cli.ts +95 -0
- package/src/plugins/builtin/notes/files.ts +145 -88
- package/src/plugins/builtin/notes/index.tsx +4 -2
- package/src/plugins/builtin/notes/migration.ts +3 -1
- package/src/plugins/builtin/notes/quick-notes-pane.tsx +24 -40
- package/src/plugins/builtin/notes/ticker-notes-tab.tsx +4 -1
- package/src/plugins/builtin/options/analytics.ts +5 -7
- package/src/plugins/builtin/options/calc-seed.ts +2 -1
- package/src/plugins/builtin/options/enrichment-client.ts +10 -19
- package/src/plugins/builtin/options/enrichment-model.ts +1 -2
- package/src/plugins/builtin/options/footer.ts +2 -2
- package/src/plugins/builtin/options/index.tsx +1 -1
- package/src/plugins/builtin/options/live-quotes.ts +1 -4
- package/src/plugins/builtin/options/table.ts +15 -15
- package/src/plugins/builtin/options/types.ts +1 -1
- package/src/plugins/builtin/options/view.tsx +31 -9
- package/src/plugins/builtin/options-calculator/binomial.ts +17 -16
- package/src/plugins/builtin/options-calculator/evidence.ts +90 -24
- package/src/plugins/builtin/options-calculator/headless.ts +2 -1
- package/src/plugins/builtin/options-calculator/model.ts +2 -207
- package/src/plugins/builtin/options-calculator/pane.tsx +11 -39
- package/src/plugins/builtin/options-calculator/surface.ts +11 -21
- package/src/plugins/builtin/options-scenario/client.ts +9 -20
- package/src/plugins/builtin/options-scenario/evidence.ts +64 -8
- package/src/plugins/builtin/options-scenario/live.ts +2 -2
- package/src/plugins/builtin/options-scenario/model.ts +18 -28
- package/src/plugins/builtin/options-scenario/pane.tsx +18 -19
- package/src/plugins/builtin/plugin-marketplace/activation.ts +70 -0
- package/src/plugins/builtin/plugin-marketplace/feed.ts +12 -0
- package/src/plugins/builtin/plugin-marketplace/index.tsx +16 -4
- package/src/plugins/builtin/plugin-marketplace/model.ts +67 -9
- package/src/plugins/builtin/plugin-marketplace/pane.tsx +67 -101
- package/src/plugins/builtin/plugin-marketplace/store.ts +19 -1
- package/src/plugins/builtin/plugin-module.ts +4 -11
- package/src/plugins/builtin/portfolio-list/account-metrics.ts +17 -15
- package/src/plugins/builtin/portfolio-list/cli/render.ts +3 -4
- package/src/plugins/builtin/portfolio-list/cli/watchlist-command.ts +2 -1
- package/src/plugins/builtin/portfolio-list/column-values.ts +23 -34
- package/src/plugins/builtin/portfolio-list/index.tsx +1 -1
- package/src/plugins/builtin/portfolio-list/pane/index.tsx +19 -38
- package/src/plugins/builtin/portfolio-list/position-metrics.ts +0 -8
- package/src/plugins/builtin/portfolio-list/summary/index.tsx +20 -16
- package/src/plugins/builtin/rate-path/client.ts +7 -16
- package/src/plugins/builtin/rate-path/headless.ts +13 -9
- package/src/plugins/builtin/rate-path/model.ts +74 -17
- package/src/plugins/builtin/rate-path/pane.tsx +128 -63
- package/src/plugins/builtin/realized-vol/client.ts +13 -23
- package/src/plugins/builtin/realized-vol/evidence.ts +43 -20
- package/src/plugins/builtin/realized-vol/pane.tsx +13 -19
- package/src/plugins/builtin/relative-rotation/client.ts +9 -35
- package/src/plugins/builtin/relative-rotation/pane.tsx +46 -65
- package/src/plugins/builtin/research/analyst-model.ts +35 -32
- package/src/plugins/builtin/research/analyst-pane.tsx +124 -128
- package/src/plugins/builtin/research/corporate-actions-pane.tsx +23 -70
- package/src/plugins/builtin/research/equity-diagnostic-pane.tsx +7 -11
- package/src/plugins/builtin/research/event-sources.ts +64 -0
- package/src/plugins/builtin/research/events-headless.ts +7 -32
- package/src/plugins/builtin/research/headless.ts +11 -51
- package/src/plugins/builtin/research/index.tsx +0 -3
- package/src/plugins/builtin/research/relative-valuation-model.ts +0 -1
- package/src/plugins/builtin/research/relative-valuation-pane.tsx +50 -86
- package/src/plugins/builtin/research-search/data.ts +0 -4
- package/src/plugins/builtin/research-search/document-view.tsx +3 -9
- package/src/plugins/builtin/research-search/index.tsx +1 -0
- package/src/plugins/builtin/research-search/model.ts +4 -20
- package/src/plugins/builtin/research-search/pane.tsx +44 -131
- package/src/plugins/builtin/research-search/saved-view.tsx +10 -13
- package/src/plugins/builtin/revenue-breakdown/bars.tsx +113 -0
- package/src/plugins/builtin/revenue-breakdown/client.ts +114 -0
- package/src/plugins/builtin/revenue-breakdown/headless.ts +72 -0
- package/src/plugins/builtin/revenue-breakdown/index.tsx +58 -0
- package/src/plugins/builtin/revenue-breakdown/model.ts +157 -0
- package/src/plugins/builtin/revenue-breakdown/pane.tsx +290 -0
- package/src/plugins/builtin/risk-factors/data.ts +3 -8
- package/src/plugins/builtin/risk-factors/index.tsx +0 -1
- package/src/plugins/builtin/risk-factors/pane.tsx +29 -107
- package/src/plugins/builtin/scanner/denied.tsx +4 -16
- package/src/plugins/builtin/scanner/feed.ts +2 -2
- package/src/plugins/builtin/scanner/flow-pane.tsx +11 -18
- package/src/plugins/builtin/scanner/hilo-bars.tsx +31 -16
- package/src/plugins/builtin/scanner/hilo-model.ts +33 -0
- package/src/plugins/builtin/scanner/hilo-pane.tsx +8 -11
- package/src/plugins/builtin/scanner/index.ts +2 -3
- package/src/plugins/builtin/sec/filing-display.tsx +2 -6
- package/src/plugins/builtin/sec/index.tsx +2 -1
- package/src/plugins/builtin/sec/model.ts +8 -4
- package/src/plugins/builtin/sectors/index.tsx +19 -40
- package/src/plugins/builtin/sectors/move-bar.tsx +2 -2
- package/src/plugins/builtin/sectors/sector-model.ts +0 -5
- package/src/plugins/builtin/shared/cloud-resource.ts +56 -0
- package/src/plugins/builtin/shared/cloud-upgrade.ts +46 -11
- package/src/plugins/builtin/shared/filing-year-reader.tsx +123 -0
- package/src/plugins/builtin/shared/locked-rows.tsx +56 -0
- package/src/plugins/builtin/shared/pane-request.ts +35 -0
- package/src/plugins/builtin/shared/research-cloud-session.ts +1 -1
- package/src/plugins/builtin/shared/series-detail-chart.tsx +168 -0
- package/src/plugins/builtin/shared/series-list-detail.tsx +208 -0
- package/src/plugins/builtin/shared/stat-transform.ts +94 -0
- package/src/plugins/builtin/shared/ticker-request.ts +0 -6
- package/src/plugins/builtin/shared/trend.ts +81 -0
- package/src/plugins/builtin/shared/use-quote-board.ts +130 -4
- package/src/plugins/builtin/shared/volatility/index.ts +2 -1
- package/src/plugins/builtin/shared/volatility/options.ts +3 -3
- package/src/plugins/builtin/shared/volatility/pricing.ts +211 -0
- package/src/plugins/builtin/short-interest/client.ts +3 -12
- package/src/plugins/builtin/short-interest/index.tsx +0 -1
- package/src/plugins/builtin/short-interest/model.ts +51 -18
- package/src/plugins/builtin/short-interest/pane.tsx +64 -108
- package/src/plugins/builtin/short-interest/surface.tsx +9 -9
- package/src/plugins/builtin/short-interest/types.ts +0 -2
- package/src/plugins/builtin/short-volume/client.ts +8 -17
- package/src/plugins/builtin/short-volume/pane.tsx +28 -29
- package/src/plugins/builtin/social-mentions/client.ts +85 -0
- package/src/plugins/builtin/social-mentions/headless.ts +28 -0
- package/src/plugins/builtin/social-mentions/index.tsx +21 -0
- package/src/plugins/builtin/social-mentions/model.ts +92 -0
- package/src/plugins/builtin/social-mentions/pane.tsx +156 -0
- package/src/plugins/builtin/thirteenf/api.ts +13 -23
- package/src/plugins/builtin/thirteenf/data.ts +6 -8
- package/src/plugins/builtin/thirteenf/format.ts +3 -10
- package/src/plugins/builtin/thirteenf/headless.ts +9 -8
- package/src/plugins/builtin/thirteenf/index.tsx +0 -1
- package/src/plugins/builtin/thirteenf/model.ts +0 -31
- package/src/plugins/builtin/thirteenf/overlap-pane.tsx +12 -16
- package/src/plugins/builtin/thirteenf/pane.tsx +65 -255
- package/src/plugins/builtin/thirteenf/signals-pane.tsx +23 -44
- package/src/plugins/builtin/thirteenf/table.ts +58 -73
- package/src/plugins/builtin/thirteenf/types.ts +1 -1
- package/src/plugins/builtin/ticker-detail/data-panes/historical-prices.tsx +25 -17
- package/src/plugins/builtin/ticker-detail/financials/aggregation.ts +3 -7
- package/src/plugins/builtin/ticker-detail/financials/model.ts +121 -25
- package/src/plugins/builtin/ticker-detail/financials/period-end-history.ts +41 -0
- package/src/plugins/builtin/ticker-detail/financials/ratio-table.tsx +175 -0
- package/src/plugins/builtin/ticker-detail/financials/ratios.ts +669 -0
- package/src/plugins/builtin/ticker-detail/financials/tab.tsx +198 -111
- package/src/plugins/builtin/ticker-detail/headless-schema.ts +7 -2
- package/src/plugins/builtin/ticker-detail/headless.ts +86 -9
- package/src/plugins/builtin/ticker-detail/index.tsx +1 -1
- package/src/plugins/builtin/ticker-detail/overview/components.tsx +2 -2
- package/src/plugins/builtin/ticker-detail/overview-tab.tsx +2 -5
- package/src/plugins/builtin/ticker-detail/pane.tsx +45 -15
- package/src/plugins/builtin/ticker-detail/quote-monitor/card.tsx +3 -1
- package/src/plugins/builtin/ticker-detail/quote-monitor/index.tsx +1 -1
- package/src/plugins/builtin/time-sales/client.ts +5 -5
- package/src/plugins/builtin/time-sales/model.ts +52 -0
- package/src/plugins/builtin/time-sales/pane.tsx +24 -19
- package/src/plugins/builtin/treasury-auctions/index.tsx +0 -1
- package/src/plugins/builtin/treasury-auctions/model.ts +3 -10
- package/src/plugins/builtin/treasury-auctions/pane.tsx +42 -101
- package/src/plugins/builtin/treasury-auctions/types.ts +0 -2
- package/src/plugins/builtin/vol-surface/client.ts +8 -22
- package/src/plugins/builtin/vol-surface/evidence.ts +45 -17
- package/src/plugins/builtin/vol-surface/model.ts +5 -8
- package/src/plugins/builtin/vol-surface/pane.tsx +24 -23
- package/src/plugins/builtin/vol-surface/raster.ts +1 -9
- package/src/plugins/builtin/vol-surface/stored.ts +3 -4
- package/src/plugins/builtin/vol-surface/surface.tsx +4 -3
- package/src/plugins/builtin/volatility/chart-model.ts +36 -0
- package/src/plugins/builtin/volatility/charts.tsx +3 -20
- package/src/plugins/builtin/volatility/client.ts +8 -16
- package/src/plugins/builtin/volatility/evidence.ts +37 -21
- package/src/plugins/builtin/volatility/index.tsx +0 -2
- package/src/plugins/builtin/volatility/model.ts +55 -0
- package/src/plugins/builtin/volatility/pane.tsx +71 -37
- package/src/plugins/builtin/world-indices/client.ts +1 -4
- package/src/plugins/builtin/world-indices/footer.ts +3 -26
- package/src/plugins/builtin/world-indices/index.tsx +8 -9
- package/src/plugins/builtin/world-indices/model.ts +0 -14
- package/src/plugins/builtin/world-indices/table.tsx +15 -73
- package/src/plugins/builtin/world-venue-map/map.tsx +2 -2
- package/src/plugins/builtin/world-venue-map/model.ts +1 -4
- package/src/plugins/builtin/world-venue-map/pane.tsx +21 -87
- package/src/plugins/builtin/yahoo/index.ts +4 -38
- package/src/plugins/builtin/yield-curve/chart.ts +100 -1
- package/src/plugins/builtin/yield-curve/headless.ts +2 -0
- package/src/plugins/builtin/yield-curve/history.ts +86 -12
- package/src/plugins/builtin/yield-curve/index.tsx +102 -27
- package/src/plugins/builtin/yield-curve/treasury-data.ts +12 -12
- package/src/plugins/bundle.ts +41 -41
- package/src/plugins/catalog-backend.ts +4 -1
- package/src/plugins/catalog-browser.ts +34 -53
- package/src/plugins/catalog-manifest.ts +10 -0
- package/src/plugins/catalog-ui.ts +9 -5
- package/src/plugins/compat.ts +216 -0
- package/src/plugins/current-target.ts +3 -9
- package/src/plugins/event-bus.ts +8 -3
- package/src/plugins/external-runtime.ts +0 -21
- package/src/plugins/host-link.ts +78 -45
- package/src/plugins/host-modules.ts +117 -3
- package/src/plugins/host-resolver.ts +1 -6
- package/src/plugins/installer.ts +566 -0
- package/src/plugins/loader.ts +120 -16
- package/src/plugins/manager-node.ts +28 -28
- package/src/plugins/ownership.ts +11 -12
- package/src/plugins/pane-manager/gridlock.ts +25 -8
- package/src/plugins/pane-manager.ts +1 -0
- package/src/plugins/plugin-export.ts +24 -0
- package/src/plugins/registry/contributions.ts +10 -4
- package/src/plugins/registry/index.ts +13 -12
- package/src/plugins/registry/pane-settings.ts +6 -3
- package/src/plugins/registry/shared.ts +0 -4
- package/src/plugins/registry/slots.ts +10 -13
- package/src/plugins/runtime/context.tsx +12 -34
- package/src/plugins/runtime/index.tsx +9 -9
- package/src/plugins/seed.ts +3 -7
- package/src/plugins/web-bundled.ts +3 -12
- package/src/public/__snapshots__/public-api.test.ts.snap +519 -0
- package/src/public/broker.ts +14 -9
- package/src/public/index.ts +3 -0
- package/src/public/market-data.ts +19 -2
- package/src/public/quotes.ts +4 -4
- package/src/public/react.ts +11 -6
- package/src/public/test-support.ts +10 -2
- package/src/public/time-series.ts +30 -3
- package/src/public/utils.ts +3 -4
- package/src/react/assign-ref.ts +10 -0
- package/src/react/async-resource.ts +16 -5
- package/src/react/auto-refresh.ts +97 -0
- package/src/react/plugins/plugin-slot.tsx +4 -1
- package/src/react/read-state.ts +104 -0
- package/src/react/ticker-source.ts +32 -0
- package/src/remote/controller-utils.ts +0 -4
- package/src/remote/controller.ts +18 -14
- package/src/remote/layout-helpers.ts +4 -9
- package/src/remote/resources.ts +34 -0
- package/src/remote/revision.ts +2 -15
- package/src/remote/schema.ts +1 -0
- package/src/renderers/browser/app-services.ts +1 -1
- package/src/renderers/browser/bundled-plugins.ts +8 -7
- package/src/renderers/browser/cloud-transport.ts +3 -11
- package/src/renderers/browser/config-host.ts +13 -8
- package/src/renderers/browser/http-proxy-transport.ts +17 -45
- package/src/renderers/browser/main.tsx +52 -25
- package/src/renderers/cloudflare/http-proxy.ts +14 -54
- package/src/renderers/cloudflare/worker.ts +25 -6
- package/src/renderers/electrobun/bun/application-menu/click.ts +8 -20
- package/src/renderers/electrobun/bun/application-menu/index.ts +3 -4
- package/src/renderers/electrobun/bun/context-menu/click.ts +7 -26
- package/src/renderers/electrobun/bun/context-menu/normalize.ts +4 -9
- package/src/renderers/electrobun/bun/core-capabilities.ts +16 -64
- package/src/renderers/electrobun/bun/desktop/detached-windows.ts +6 -35
- package/src/renderers/electrobun/bun/desktop/host-requests.ts +0 -9
- package/src/renderers/electrobun/bun/desktop/http-fetch.ts +15 -63
- package/src/renderers/electrobun/bun/desktop/http-stream.ts +6 -19
- package/src/renderers/electrobun/bun/desktop/initialization.ts +9 -0
- package/src/renderers/electrobun/bun/desktop/macos-dock-icon.ts +91 -0
- package/src/renderers/electrobun/bun/desktop/plugin-state.ts +0 -7
- package/src/renderers/electrobun/bun/external-plugins.ts +35 -95
- package/src/renderers/electrobun/bun/index.ts +57 -45
- package/src/renderers/electrobun/bun/menu-event.ts +17 -0
- package/src/renderers/electrobun/bun/window/controls.ts +69 -0
- package/src/renderers/electrobun/bun/window/create.ts +84 -0
- package/src/renderers/electrobun/bun/window/events.ts +49 -0
- package/src/renderers/electrobun/bun/window/windows-custom-chrome.ts +43 -0
- package/src/renderers/electrobun/bun/window/windows-icons.ts +55 -0
- package/src/renderers/electrobun/bun/window/windows-native.ts +96 -0
- package/src/renderers/electrobun/shared/protocol.ts +35 -48
- package/src/renderers/electrobun/shared/quote-event-batch.ts +3 -3
- package/src/renderers/electrobun/view/app-services.ts +1 -1
- package/src/renderers/electrobun/view/backend-rpc.ts +74 -141
- package/src/renderers/electrobun/view/broker-remote-client.ts +32 -46
- package/src/renderers/electrobun/view/build-assets.ts +61 -49
- package/src/renderers/electrobun/view/capability-stream-client.ts +5 -25
- package/src/renderers/electrobun/view/capability-subscription.ts +50 -0
- package/src/renderers/electrobun/view/cli-pane-shot-entry.tsx +35 -93
- package/src/renderers/electrobun/view/context-menu.ts +6 -7
- package/src/renderers/electrobun/view/data-table/dom.ts +1 -2
- package/src/renderers/electrobun/view/data-table/index.tsx +17 -35
- package/src/renderers/electrobun/view/data-table/row.tsx +6 -2
- package/src/renderers/electrobun/view/desktop/controls.tsx +1 -1
- package/src/renderers/electrobun/view/desktop/popover.tsx +23 -0
- package/src/renderers/electrobun/view/desktop/window/bridge.ts +4 -4
- package/src/renderers/electrobun/view/dialog-host.tsx +21 -58
- package/src/renderers/electrobun/view/dom-host-providers.tsx +64 -0
- package/src/renderers/electrobun/view/dom-ui-host.tsx +5 -21
- package/src/renderers/electrobun/view/external-plugins.ts +17 -5
- package/src/renderers/electrobun/view/fatal-screen.tsx +1 -42
- package/src/renderers/electrobun/view/host/ascii-text.ts +6 -29
- package/src/renderers/electrobun/view/host/block-glyph-canvas.tsx +1 -1
- package/src/renderers/electrobun/view/host/focus-scope.ts +1 -1
- package/src/renderers/electrobun/view/host/input.tsx +95 -163
- package/src/renderers/electrobun/view/host/mouse.ts +1 -1
- package/src/renderers/electrobun/view/host/native.ts +2 -2
- package/src/renderers/electrobun/view/host/scroll-box.tsx +1 -1
- package/src/renderers/electrobun/view/host/style.ts +1 -1
- package/src/renderers/electrobun/view/host/surface-3d.tsx +2 -2
- package/src/renderers/electrobun/view/host/tabs.tsx +1 -1
- package/src/renderers/electrobun/view/host/text.tsx +1 -1
- package/src/renderers/electrobun/view/http-fetch.ts +13 -64
- package/src/renderers/electrobun/view/input-host.tsx +20 -35
- package/src/renderers/electrobun/view/key-event.ts +7 -5
- package/src/renderers/electrobun/view/main.tsx +76 -34
- package/src/renderers/electrobun/view/native-renderer.ts +6 -1
- package/src/renderers/electrobun/view/native-stubs/backend-rpc.ts +3 -58
- package/src/renderers/electrobun/view/remote/asset-data-client.ts +3 -6
- package/src/renderers/electrobun/view/remote/backend-quote-subscription.ts +34 -38
- package/src/renderers/electrobun/view/remote/connection-health.ts +14 -32
- package/src/renderers/electrobun/view/remote/persistence.ts +32 -63
- package/src/renderers/electrobun/view/remote/quote-subscription-registry.ts +2 -5
- package/src/renderers/electrobun/view/rpc-codec.ts +18 -20
- package/src/renderers/electrobun/view/screenshot-watermark.ts +1 -1
- package/src/renderers/electrobun/view/test-utils.tsx +4 -11
- package/src/renderers/electrobun/view/toast-host.tsx +29 -87
- package/src/renderers/electrobun/view/ui-host.tsx +8 -1
- package/src/renderers/electrobun/view/update-host.ts +2 -2
- package/src/renderers/opentui/chart-surface.tsx +11 -124
- package/src/renderers/opentui/dialog-host.tsx +45 -130
- package/src/renderers/opentui/host.tsx +3 -2
- package/src/renderers/opentui/image/surface.tsx +15 -174
- package/src/renderers/opentui/kitty-services.ts +15 -0
- package/src/renderers/opentui/native-surface.ts +176 -0
- package/src/renderers/opentui/start.tsx +57 -42
- package/src/renderers/opentui/test-utils.tsx +4 -20
- package/src/renderers/opentui/toast-host.tsx +7 -95
- package/src/renderers/opentui/ui-host.tsx +87 -2
- package/src/renderers/share/chart.ts +1 -1
- package/src/renderers/share/layout-view.tsx +2 -2
- package/src/shares/api.ts +0 -5
- package/src/shares/payload.ts +13 -16
- package/src/sources/gloomberb-cloud/index.ts +14 -15
- package/src/sources/gloomberb-cloud/news.ts +8 -4
- package/src/sources/gloomberb-cloud/normalizers.ts +34 -76
- package/src/sources/history-coverage.ts +25 -84
- package/src/sources/history-result.ts +2 -0
- package/src/sources/history-retention.ts +9 -11
- package/src/sources/provider-router/batches.ts +0 -4
- package/src/sources/provider-router/brokers.ts +2 -13
- package/src/sources/provider-router/cache.ts +38 -159
- package/src/sources/provider-router/cached-routes.ts +26 -1
- package/src/sources/provider-router/financial-routes.ts +3 -10
- package/src/sources/provider-router/financials.ts +2 -3
- package/src/sources/provider-router/history.ts +20 -70
- package/src/sources/provider-router/index.ts +8 -2
- package/src/sources/provider-router/news.ts +2 -1
- package/src/sources/provider-router/primary.ts +0 -8
- package/src/sources/provider-router/quote-route.ts +2 -2
- package/src/sources/provider-router/realtime-access.ts +10 -29
- package/src/sources/provider-router/search.ts +3 -12
- package/src/sources/provider-router/test-support.ts +0 -89
- package/src/sources/sec-edgar/acceptance-time.ts +11 -0
- package/src/sources/sec-edgar/fourth-quarter.ts +179 -0
- package/src/sources/sec-edgar.ts +47 -228
- package/src/sources/yahoo-finance/financials.ts +35 -13
- package/src/sources/yahoo-finance/history.ts +22 -58
- package/src/sources/yahoo-finance/http.ts +17 -25
- package/src/sources/yahoo-finance/mappers.ts +0 -23
- package/src/sources/yahoo-finance/options.ts +36 -44
- package/src/sources/yahoo-finance/quote-summary.ts +90 -141
- package/src/sources/yahoo-finance/requests.ts +22 -12
- package/src/sources/yahoo-finance/snapshots.ts +4 -6
- package/src/sources/yahoo-finance/symbols.ts +25 -0
- package/src/sources/yahoo-finance/yahoo-chart-interval.ts +1 -1
- package/src/sources/yahoo-finance.ts +80 -188
- package/src/state/app/bootstrap.ts +5 -5
- package/src/state/app/context/index.tsx +10 -13
- package/src/state/hooks/live-streaming.ts +60 -0
- package/src/state/hooks/quote-streaming.ts +16 -57
- package/src/state/hooks/session-snapshot.ts +0 -1
- package/src/state/pane-scroll-registry.tsx +9 -0
- package/src/sync/controller.ts +3 -1
- package/src/sync/core-contributors.ts +69 -37
- package/src/sync/profile-analytics.ts +5 -2
- package/src/telemetry/crash-reports-dom.ts +74 -0
- package/src/telemetry/crash-reports-node.ts +170 -0
- package/src/telemetry/crash-reports.ts +353 -0
- package/src/telemetry/live-config.ts +19 -0
- package/src/telemetry/usage-counts-dom.ts +22 -0
- package/src/telemetry/usage-counts.ts +391 -0
- package/src/test-support/app-store.ts +21 -0
- package/src/test-support/broker.ts +80 -0
- package/src/test-support/cli-context.ts +28 -0
- package/src/test-support/cloud-api.ts +85 -0
- package/src/test-support/console.ts +40 -0
- package/src/test-support/data-provider.ts +30 -0
- package/src/test-support/headless.ts +32 -0
- package/src/test-support/network-guard.ts +35 -0
- package/src/test-support/news.ts +21 -0
- package/src/test-support/pane.tsx +42 -22
- package/src/test-support/quote-store.ts +49 -0
- package/src/test-support/renderer-host.ts +10 -0
- package/src/test-support/rpc-loopback.ts +22 -0
- package/src/test-support/temp-db.ts +19 -0
- package/src/test-support/ticker.ts +15 -0
- package/src/test-support/time-series.ts +27 -0
- package/src/theme/app-icon.ts +127 -0
- package/src/theme/color-utils.ts +2 -1
- package/src/theme/themes.ts +3 -1
- package/src/time-series/alignment.ts +4 -7
- package/src/time-series/chart-data.ts +2 -3
- package/src/time-series/forward-valuation.ts +6 -9
- package/src/time-series/fundamentals.ts +34 -96
- package/src/time-series/live-bars.ts +12 -15
- package/src/time-series/live-quotes.ts +4 -26
- package/src/time-series/market.ts +6 -9
- package/src/time-series/parsed-history-cache.ts +0 -4
- package/src/time-series/resolution.ts +35 -1
- package/src/time-series/resolve.ts +28 -20
- package/src/time-series/session-history.ts +4 -23
- package/src/time-series/spec.ts +11 -16
- package/src/time-series/studies.ts +26 -15
- package/src/time-series/transforms.ts +6 -9
- package/src/time-series/types.ts +6 -3
- package/src/types/broker.ts +10 -0
- package/src/types/config.ts +24 -2
- package/src/types/data-provider.ts +13 -1
- package/src/types/desktop-menu.ts +3 -1
- package/src/types/financials.ts +71 -20
- package/src/types/instrument.ts +2 -1
- package/src/types/plugin.ts +30 -0
- package/src/types/price-history.ts +2 -0
- package/src/types/trading.ts +21 -2
- package/src/ui/dialog-stack.ts +80 -0
- package/src/ui/dialog.tsx +33 -2
- package/src/ui/host.tsx +17 -0
- package/src/ui/index.tsx +3 -10
- package/src/ui/toast.tsx +95 -0
- package/src/updater/index.ts +472 -0
- package/src/utils/async-deadline.ts +34 -0
- package/src/utils/calendar-date.ts +20 -0
- package/src/utils/csv.ts +19 -2
- package/src/utils/datetime-format.ts +103 -6
- package/src/utils/double-escape-close.ts +1 -23
- package/src/utils/errors.ts +4 -0
- package/src/utils/exchanges.ts +10 -0
- package/src/utils/financial-statements.ts +6 -25
- package/src/utils/format.ts +6 -17
- package/src/utils/futures-generic.ts +159 -0
- package/src/utils/guards.ts +37 -0
- package/src/utils/hash.ts +17 -2
- package/src/utils/http-proxy-response.ts +122 -4
- package/src/utils/math.ts +12 -0
- package/src/utils/platform.ts +34 -0
- package/src/utils/plugin-proxy-hosts.json +1 -2
- package/src/utils/plugin-proxy-hosts.ts +3 -0
- package/src/utils/price-history-integrity.ts +5 -8
- package/src/utils/price-history.ts +36 -11
- package/src/utils/sec.ts +3 -8
- package/src/utils/semver.ts +15 -0
- package/src/utils/shortcut-labels.ts +4 -29
- package/src/utils/sort-values.ts +28 -0
- package/src/utils/statement-gaps.ts +94 -0
- package/src/utils/zoned-date-time.ts +12 -0
- package/src/api-client/askg.test.ts +0 -256
- package/src/api-client/errors.test.ts +0 -11
- package/src/api-client/index.test.ts +0 -1591
- package/src/api-client/paths.test.ts +0 -32
- package/src/api-client/request.test.ts +0 -153
- package/src/api-client/research-activity.test.ts +0 -316
- package/src/api-client/session-request-lifetime.test.ts +0 -184
- package/src/api-client/socket-health.test.ts +0 -86
- package/src/api-client/socket-lifetime.test.ts +0 -76
- package/src/api-client/socket-protocol.test.ts +0 -90
- package/src/api-client/tape-socket.test.ts +0 -44
- package/src/api-client/teams.test.ts +0 -270
- package/src/app/app-bootstrap-state.test.ts +0 -157
- package/src/app/global-shortcuts.test.tsx +0 -468
- package/src/app/keybindings/chord.test.ts +0 -131
- package/src/app/keybindings/resolve.test.ts +0 -103
- package/src/app/language-observer.test.tsx +0 -82
- package/src/app/pane-runtime/layout-placement.test.ts +0 -27
- package/src/app/pane-runtime/plugin-bindings.test.ts +0 -117
- package/src/app/pane-runtime/ticker-navigation-runtime.test.ts +0 -144
- package/src/app/pane-runtime/ticker-open-runtime.test.tsx +0 -170
- package/src/app/pane-template-dialog-wizard.test.tsx +0 -36
- package/src/app/runtime/broker-import.test.tsx +0 -89
- package/src/app/runtime/desktop-deeplink.test.ts +0 -169
- package/src/app/runtime/layout-warmup.test.ts +0 -73
- package/src/app/runtime/ticker-refresh.test.tsx +0 -115
- package/src/architecture/browser-entry-graph.test.ts +0 -97
- package/src/architecture/import-boundaries.test.ts +0 -136
- package/src/assets/gloomberb-logo.ico +0 -0
- package/src/assets/gloomberb-logo.png +0 -0
- package/src/brokers/bond-price-basis.test.ts +0 -35
- package/src/brokers/legacy-contract.test.ts +0 -51
- package/src/brokers/profile-form.test.ts +0 -71
- package/src/brokers/sync-broker-instance.test.ts +0 -599
- package/src/brokers/test-broker.ts +0 -68
- package/src/capabilities/registry.test.ts +0 -297
- package/src/cli/base-converter.test.ts +0 -16
- package/src/cli/commands/automation.ts +0 -98
- package/src/cli/commands/futures-price-precision.test.tsx +0 -65
- package/src/cli/commands/keybindings.test.ts +0 -48
- package/src/cli/commands/market-fx.test.ts +0 -77
- package/src/cli/commands/market-options.test.ts +0 -44
- package/src/cli/commands/plugins.test.ts +0 -29
- package/src/cli/commands/quote-price-basis.test.ts +0 -88
- package/src/cli/commands/ticker-financial-units.test.ts +0 -78
- package/src/cli/commands/ticker-period.test.ts +0 -62
- package/src/cli/context.test.ts +0 -63
- package/src/cli/entry.test.ts +0 -58
- package/src/cli/history-rows.test.ts +0 -47
- package/src/cli/options.test.ts +0 -45
- package/src/cli/pane-functions/cloud-session.test.ts +0 -77
- package/src/cli/pane-functions/data.test.ts +0 -17
- package/src/cli/pane-functions/discovery.test.ts +0 -36
- package/src/cli/pane-functions/dom.test.ts +0 -69
- package/src/cli/pane-functions/headless.test.ts +0 -314
- package/src/cli/pane-functions/index.test.ts +0 -266
- package/src/cli/pane-functions/intraday-shot.test.ts +0 -399
- package/src/cli/pane-functions/report.test.ts +0 -107
- package/src/cli/pane-functions/screenshot.test.ts +0 -927
- package/src/cli/registry.test.ts +0 -256
- package/src/cli/result.test.ts +0 -133
- package/src/cli/ticker-resolution.test.ts +0 -39
- package/src/cli/visible-key-values.test.ts +0 -23
- package/src/cli.test.ts +0 -437
- package/src/components/chart/composite/axis-overlays.test.tsx +0 -80
- package/src/components/chart/composite/composite-chart.test.tsx +0 -2019
- package/src/components/chart/composite/downsample.test.ts +0 -136
- package/src/components/chart/composite/format.test.ts +0 -258
- package/src/components/chart/composite/fx-precision.test.ts +0 -111
- package/src/components/chart/composite/interactions.test.ts +0 -231
- package/src/components/chart/composite/panel-series.test.ts +0 -66
- package/src/components/chart/composite/price-axis-labels.test.ts +0 -50
- package/src/components/chart/composite/price-series.test.ts +0 -39
- package/src/components/chart/composite/renderers.test.ts +0 -823
- package/src/components/chart/composite/scene-market-cursor.test.ts +0 -148
- package/src/components/chart/composite/scene.test.ts +0 -845
- package/src/components/chart/composite/scroll-surface.test.tsx +0 -153
- package/src/components/chart/composite/time-axis.test.ts +0 -281
- package/src/components/chart/composite/time-scale.test.ts +0 -88
- package/src/components/chart/composite/tools.test.ts +0 -371
- package/src/components/chart/curve/curve-surface.test.tsx +0 -53
- package/src/components/chart/curve/model.test.ts +0 -115
- package/src/components/chart/native/bitmap-support.test.ts +0 -27
- package/src/components/chart/native/kitty/index.test.ts +0 -537
- package/src/components/chart/static/chart-surface.test.tsx +0 -159
- package/src/components/chart/static/multi-line-chart-surface.tsx +0 -105
- package/src/components/chart/static/scatter-chart-surface.test.ts +0 -30
- package/src/components/chart/static/trail-chart-model.test.ts +0 -36
- package/src/components/chart/surface3d/model.test.ts +0 -117
- package/src/components/chart/surface3d/software.test.ts +0 -32
- package/src/components/command-bar/assist/inventory.test.ts +0 -93
- package/src/components/command-bar/assist/model.test.ts +0 -185
- package/src/components/command-bar/helpers.test.ts +0 -162
- package/src/components/command-bar/layout-items/current-layout.test.ts +0 -165
- package/src/components/command-bar/list/badge.test.ts +0 -54
- package/src/components/command-bar/list/model.test.ts +0 -129
- package/src/components/command-bar/list/view.test.tsx +0 -113
- package/src/components/command-bar/pane-settings.test.ts +0 -141
- package/src/components/command-bar/panel/layout.test.ts +0 -171
- package/src/components/command-bar/routes/root/results.test.ts +0 -161
- package/src/components/command-bar/routes/root/search-providers.test.tsx +0 -224
- package/src/components/command-bar/routes/root/selection.test.ts +0 -54
- package/src/components/command-bar/routes/root/shortcuts.test.ts +0 -193
- package/src/components/command-bar/routes/ticker-search/results.test.ts +0 -128
- package/src/components/command-bar/surface/assist.test.tsx +0 -341
- package/src/components/command-bar/surface/index.test.tsx +0 -1208
- package/src/components/command-bar/surface/listing-selection.test.tsx +0 -84
- package/src/components/command-bar/surface/pane.test.tsx +0 -937
- package/src/components/command-bar/surface/portfolio.test.tsx +0 -453
- package/src/components/command-bar/surface/test-harness.tsx +0 -353
- package/src/components/command-bar/view-model.test.ts +0 -228
- package/src/components/command-bar/workflow/broker.test.ts +0 -22
- package/src/components/command-bar/workflow/collection-actions.test.ts +0 -105
- package/src/components/command-bar/workflow/collection-identity.test.ts +0 -180
- package/src/components/command-bar/workflow/ops.test.ts +0 -804
- package/src/components/command-bar/workflow/route-actions.test.ts +0 -34
- package/src/components/command-bar/workflow/ticker-listing-picker.test.ts +0 -41
- package/src/components/company-logo.test.ts +0 -19
- package/src/components/data-table/export.test.ts +0 -21
- package/src/components/data-table/frozen-column.test.tsx +0 -114
- package/src/components/data-table/horizontal-navigation.test.tsx +0 -181
- package/src/components/data-table/stack-view.test.tsx +0 -226
- package/src/components/data-table/view.test.tsx +0 -343
- package/src/components/feed-data-table/stack-view.test.tsx +0 -46
- package/src/components/input-search-bar.test.tsx +0 -137
- package/src/components/layout/header.test.tsx +0 -82
- package/src/components/layout/market-summary.test.ts +0 -81
- package/src/components/layout/pane/content.test.tsx +0 -103
- package/src/components/layout/pane/cycle-order.test.ts +0 -29
- package/src/components/layout/pane/footer/current-actions.test.tsx +0 -108
- package/src/components/layout/pane/footer/index.test.tsx +0 -199
- package/src/components/layout/pane/footer/keyboard.test.ts +0 -57
- package/src/components/layout/pane/footer/notice.desktop.test.tsx +0 -57
- package/src/components/layout/pane/keyboard-scroll.test.tsx +0 -146
- package/src/components/layout/pane/sidebar.test.tsx +0 -187
- package/src/components/layout/pane/sizing.test.ts +0 -46
- package/src/components/layout/shell/index.test.tsx +0 -1377
- package/src/components/layout/shell/layout-state.test.ts +0 -33
- package/src/components/layout/shell/menu.test.ts +0 -89
- package/src/components/layout/shell/pane-occlusion.test.ts +0 -52
- package/src/components/layout/shell/ticker-link-menu.test.ts +0 -82
- package/src/components/layout/status-bar-groups.test.ts +0 -92
- package/src/components/layout/status-bar.test.tsx +0 -306
- package/src/components/layout/window-edit/mode.test.ts +0 -167
- package/src/components/metric-treemap/layout.test.ts +0 -77
- package/src/components/metric-treemap/surface.test.tsx +0 -62
- package/src/components/onboarding/first-run-workspace.test.ts +0 -81
- package/src/components/onboarding/onboarding-wizard.test.tsx +0 -1097
- package/src/components/onboarding/wizard-model.test.ts +0 -67
- package/src/components/pane-settings-dialog.test.tsx +0 -278
- package/src/components/pane-template-wizard.test.tsx +0 -51
- package/src/components/price-sparkline/model.test.ts +0 -27
- package/src/components/quote-flash.test.ts +0 -30
- package/src/components/sign-in-gate.test.tsx +0 -60
- package/src/components/table-view-shared.test.ts +0 -11
- package/src/components/ticker/badge/format.test.ts +0 -66
- package/src/components/ticker/badge/list.test.tsx +0 -84
- package/src/components/ticker/badge/text.test.tsx +0 -223
- package/src/components/ticker/list-table.test.tsx +0 -281
- package/src/components/ui/data-table/opentui/model.test.ts +0 -47
- package/src/components/ui/data-table/visible-range.test.ts +0 -29
- package/src/components/ui/display.desktop.test.tsx +0 -55
- package/src/components/ui/display.test.tsx +0 -36
- package/src/components/ui/external-link.test.tsx +0 -54
- package/src/components/ui/message-composer.test.tsx +0 -81
- package/src/components/ui/page-stack-view.test.tsx +0 -126
- package/src/components/ui/prose.desktop.test.tsx +0 -50
- package/src/components/ui/prose.test.ts +0 -22
- package/src/components/ui/row-value-cache.test.ts +0 -17
- package/src/components/ui/table-layout.test.ts +0 -108
- package/src/components/ui/tabs.test.tsx +0 -114
- package/src/components/ui/ui.test.tsx +0 -984
- package/src/components/use-pane-notice-footer.test.tsx +0 -116
- package/src/core/app-runtime.test.ts +0 -144
- package/src/core/app-services.test.ts +0 -66
- package/src/core/connection-health.test.ts +0 -143
- package/src/data/cached-query.test.ts +0 -95
- package/src/data/config/home.test.ts +0 -70
- package/src/data/config/store/index.test.ts +0 -1241
- package/src/data/memory-resource-store.test.ts +0 -24
- package/src/data/plugin-cache.test.ts +0 -46
- package/src/data/sqlite/cache.test.ts +0 -330
- package/src/data/sqlite/retry.test.ts +0 -84
- package/src/feedback/diagnostics.test.ts +0 -30
- package/src/feedback/redact.test.ts +0 -50
- package/src/feedback/screenshot.test.ts +0 -22
- package/src/i18n/index.test.ts +0 -134
- package/src/i18n/languages.test.ts +0 -34
- package/src/index.tsx +0 -6
- package/src/layout-marketplace/api.test.ts +0 -54
- package/src/layout-marketplace/cloud.test.ts +0 -154
- package/src/layout-marketplace/gallery-desktop.test.tsx +0 -216
- package/src/layout-marketplace/gallery.test.tsx +0 -149
- package/src/layout-marketplace/geometry.test.ts +0 -47
- package/src/layout-marketplace/mini-workspace.test.tsx +0 -69
- package/src/layout-marketplace/model.test.ts +0 -118
- package/src/layout-marketplace/name-dialog.tsx +0 -60
- package/src/layout-marketplace/payload.test.ts +0 -419
- package/src/market-data/coordinator/chart-session.test.ts +0 -152
- package/src/market-data/coordinator/events.test.ts +0 -68
- package/src/market-data/coordinator/fx-refresh.test.ts +0 -199
- package/src/market-data/coordinator/index.test.ts +0 -1174
- package/src/market-data/coordinator/options-sharing.test.ts +0 -79
- package/src/market-data/coordinator/subscriptions.test.ts +0 -652
- package/src/market-data/frame-scheduler.test.ts +0 -82
- package/src/market-data/history-session.test.ts +0 -151
- package/src/market-data/hooks.test.tsx +0 -263
- package/src/market-data/legacy-contract-hooks.test.tsx +0 -49
- package/src/market-data/legacy-contract.test.ts +0 -99
- package/src/market-data/market/format.test.ts +0 -284
- package/src/market-data/market/status.test.ts +0 -26
- package/src/market-data/performance.test.ts +0 -83
- package/src/market-data/portfolio-instrument.test.ts +0 -80
- package/src/market-data/published-us-sessions.test.ts +0 -65
- package/src/market-data/query-store.test.ts +0 -87
- package/src/market-data/quote-subscription-target.test.ts +0 -56
- package/src/market-data/quotes/day-range.test.ts +0 -84
- package/src/market-data/quotes/freshness.test.ts +0 -277
- package/src/market-data/quotes/observation-time.test.ts +0 -98
- package/src/market-data/quotes/price-basis.test.ts +0 -44
- package/src/market-data/quotes/resolution.test.ts +0 -612
- package/src/market-data/quotes/time.test.ts +0 -41
- package/src/market-data/request-types.test.ts +0 -110
- package/src/market-data/snapshot-contract.test.ts +0 -110
- package/src/market-data/snapshot-provider.test.ts +0 -251
- package/src/market-data/ticker-price-returns.test.ts +0 -26
- package/src/news/aggregator.test.ts +0 -596
- package/src/news/hooks.test.tsx +0 -66
- package/src/notifications/app-notifier.test.ts +0 -199
- package/src/pane-settings.test.ts +0 -38
- package/src/plugins/builtin/account-management/model.test.ts +0 -149
- package/src/plugins/builtin/account-management/navigation.test.ts +0 -27
- package/src/plugins/builtin/alerts/alert-engine.test.ts +0 -105
- package/src/plugins/builtin/alerts/events.test.ts +0 -28
- package/src/plugins/builtin/alerts/index.test.tsx +0 -459
- package/src/plugins/builtin/alerts/research.test.ts +0 -75
- package/src/plugins/builtin/analytics/broker-performance.test.ts +0 -79
- package/src/plugins/builtin/analytics/index.test.tsx +0 -657
- package/src/plugins/builtin/analytics/metrics.test.ts +0 -138
- package/src/plugins/builtin/analytics/pane-model.test.ts +0 -191
- package/src/plugins/builtin/analytics/portfolio-identity.test.tsx +0 -272
- package/src/plugins/builtin/analytics/return-window.test.ts +0 -72
- package/src/plugins/builtin/analytics/risk-client.test.ts +0 -100
- package/src/plugins/builtin/analytics/risk-evidence.test.ts +0 -123
- package/src/plugins/builtin/analytics/risk-headless.test.ts +0 -27
- package/src/plugins/builtin/analytics/risk-math.test.ts +0 -95
- package/src/plugins/builtin/analytics/risk-model.test.ts +0 -284
- package/src/plugins/builtin/analytics/sector-model.test.ts +0 -56
- package/src/plugins/builtin/analytics/sharpe-cadence.test.ts +0 -111
- package/src/plugins/builtin/backtest/engine.test.ts +0 -71
- package/src/plugins/builtin/bond-calculator/math.test.ts +0 -97
- package/src/plugins/builtin/bond-calculator/model.test.ts +0 -56
- package/src/plugins/builtin/bond-calculator/pane.test.tsx +0 -84
- package/src/plugins/builtin/broker-manager/index.test.tsx +0 -173
- package/src/plugins/builtin/broker-manager/model.test.ts +0 -145
- package/src/plugins/builtin/buildout/cells.test.tsx +0 -31
- package/src/plugins/builtin/buildout/pane/header.tsx +0 -30
- package/src/plugins/builtin/cds/client.test.ts +0 -103
- package/src/plugins/builtin/cds/headless.test.ts +0 -48
- package/src/plugins/builtin/cds/model.test.ts +0 -242
- package/src/plugins/builtin/cds/pane.test.tsx +0 -139
- package/src/plugins/builtin/central-bank-rates/model.test.ts +0 -84
- package/src/plugins/builtin/changelog/model.test.ts +0 -77
- package/src/plugins/builtin/chart-composer/catalog-inventory.test.ts +0 -105
- package/src/plugins/builtin/chart-composer/editor/model.test.ts +0 -85
- package/src/plugins/builtin/chart-composer/editor.test.tsx +0 -341
- package/src/plugins/builtin/chart-composer/financial-periods.fixture.json +0 -225
- package/src/plugins/builtin/chart-composer/follow-binding.test.tsx +0 -253
- package/src/plugins/builtin/chart-composer/headless.test.ts +0 -158
- package/src/plugins/builtin/chart-composer/loading.test.tsx +0 -134
- package/src/plugins/builtin/chart-composer/pane-share.test.ts +0 -144
- package/src/plugins/builtin/chart-composer/presets.test.ts +0 -672
- package/src/plugins/builtin/chart-composer/quick-add.test.tsx +0 -245
- package/src/plugins/builtin/chart-composer/quote-metadata.test.ts +0 -176
- package/src/plugins/builtin/chart-composer/series-catalog.test.ts +0 -104
- package/src/plugins/builtin/chart-composer/served-cadence-snapshot.test.ts +0 -161
- package/src/plugins/builtin/chart-composer/settings.test.ts +0 -200
- package/src/plugins/builtin/chart-composer/shortcuts.test.ts +0 -44
- package/src/plugins/builtin/chart-composer/use-series-catalog.test.tsx +0 -94
- package/src/plugins/builtin/chart-composer/viewport-labels.test.ts +0 -13
- package/src/plugins/builtin/chat/chat.test.tsx +0 -1481
- package/src/plugins/builtin/chat/composer-commands.test.ts +0 -30
- package/src/plugins/builtin/chat/content/composer-runtime.test.tsx +0 -144
- package/src/plugins/builtin/chat/content/mentions.test.ts +0 -74
- package/src/plugins/builtin/chat/controller/session-lifetime.test.ts +0 -182
- package/src/plugins/builtin/chat/controller/session.test.ts +0 -25
- package/src/plugins/builtin/chat/controller.test.ts +0 -1894
- package/src/plugins/builtin/chat/message/desktop.test.tsx +0 -88
- package/src/plugins/builtin/chat/message/profile-popover.test.tsx +0 -127
- package/src/plugins/builtin/chat/pane-state.test.ts +0 -31
- package/src/plugins/builtin/chat/sidebar.test.tsx +0 -830
- package/src/plugins/builtin/chat/test-harness.test.ts +0 -46
- package/src/plugins/builtin/chat/test-harness.tsx +0 -267
- package/src/plugins/builtin/cloud/askg/controller.test.ts +0 -525
- package/src/plugins/builtin/cloud/askg/conversation-store.test.ts +0 -230
- package/src/plugins/builtin/cloud/askg/executor.test.ts +0 -160
- package/src/plugins/builtin/cloud/askg/manifest.test.ts +0 -153
- package/src/plugins/builtin/cloud/askg/model.test.ts +0 -349
- package/src/plugins/builtin/cloud/askg/pane.test.tsx +0 -356
- package/src/plugins/builtin/cloud/askg/protocol.test.ts +0 -190
- package/src/plugins/builtin/cloud/askg/undo.test.ts +0 -44
- package/src/plugins/builtin/cloud/auth-model.test.ts +0 -67
- package/src/plugins/builtin/cloud/buildout-module.tsx +0 -23
- package/src/plugins/builtin/cloud/device-signin.test.ts +0 -217
- package/src/plugins/builtin/cloud/reveal-in-scroll-box.ts +0 -34
- package/src/plugins/builtin/cloud/team/collections.test.ts +0 -126
- package/src/plugins/builtin/cloud/team/model.test.ts +0 -174
- package/src/plugins/builtin/cloud/team/pane-model.test.ts +0 -114
- package/src/plugins/builtin/cloud/team/pane.test.tsx +0 -234
- package/src/plugins/builtin/cloud/team/store.test.ts +0 -231
- package/src/plugins/builtin/cloud/thesis/board-pane.test.tsx +0 -266
- package/src/plugins/builtin/cloud/thesis/model.test.ts +0 -171
- package/src/plugins/builtin/cloud-tweets/pane-share.test.ts +0 -56
- package/src/plugins/builtin/cloud-tweets/table.test.tsx +0 -125
- package/src/plugins/builtin/congress-trades/aggregates.test.ts +0 -27
- package/src/plugins/builtin/congress-trades/headless.test.ts +0 -113
- package/src/plugins/builtin/congress-trades/model.test.ts +0 -129
- package/src/plugins/builtin/connections/pane.test.tsx +0 -84
- package/src/plugins/builtin/correlation/colors.test.ts +0 -39
- package/src/plugins/builtin/correlation/compute.test.ts +0 -97
- package/src/plugins/builtin/correlation/headless.test.ts +0 -147
- package/src/plugins/builtin/correlation/index.test.tsx +0 -155
- package/src/plugins/builtin/correlation/relationship/history.test.tsx +0 -62
- package/src/plugins/builtin/correlation/relationship/layout.test.ts +0 -17
- package/src/plugins/builtin/cot/model.test.ts +0 -89
- package/src/plugins/builtin/credit-conditions/client.test.ts +0 -122
- package/src/plugins/builtin/credit-conditions/headless.test.ts +0 -35
- package/src/plugins/builtin/credit-conditions/index.test.tsx +0 -136
- package/src/plugins/builtin/credit-conditions/model.test.ts +0 -56
- package/src/plugins/builtin/crypto-board/client.test.ts +0 -51
- package/src/plugins/builtin/crypto-board/model.test.ts +0 -111
- package/src/plugins/builtin/crypto-board/pane.test.tsx +0 -130
- package/src/plugins/builtin/crypto-board/test-fixture.ts +0 -80
- package/src/plugins/builtin/custom-view/live-quotes.test.ts +0 -53
- package/src/plugins/builtin/custom-view/view-spec.test.ts +0 -134
- package/src/plugins/builtin/debt-maturities/debt-maturities.test.ts +0 -317
- package/src/plugins/builtin/dividend-yield/calendar.ts +0 -9
- package/src/plugins/builtin/dividend-yield/client.test.ts +0 -260
- package/src/plugins/builtin/dividend-yield/dividend-source-integrity.test.ts +0 -233
- package/src/plugins/builtin/dividend-yield/headless.test.ts +0 -123
- package/src/plugins/builtin/dividend-yield/pane.test.tsx +0 -351
- package/src/plugins/builtin/dividend-yield/provider-client.test.ts +0 -61
- package/src/plugins/builtin/dividend-yield/reference-price.test.ts +0 -115
- package/src/plugins/builtin/dividend-yield/view.test.ts +0 -81
- package/src/plugins/builtin/earnings/data/cache.test.ts +0 -117
- package/src/plugins/builtin/earnings/detail-model.test.ts +0 -103
- package/src/plugins/builtin/earnings/detail-model.ts +0 -165
- package/src/plugins/builtin/earnings/detail-view.tsx +0 -136
- package/src/plugins/builtin/earnings/estimate-basis.test.ts +0 -184
- package/src/plugins/builtin/earnings/estimate-fixtures.test-data.ts +0 -327
- package/src/plugins/builtin/earnings/headless.test.ts +0 -82
- package/src/plugins/builtin/earnings/model.test.ts +0 -98
- package/src/plugins/builtin/earnings/table.test.ts +0 -76
- package/src/plugins/builtin/earnings/table.ts +0 -246
- package/src/plugins/builtin/earnings-calls/data.test.ts +0 -252
- package/src/plugins/builtin/earnings-calls/headless-freshness.test.ts +0 -41
- package/src/plugins/builtin/earnings-calls/headless.test.ts +0 -258
- package/src/plugins/builtin/earnings-calls/pane.test.tsx +0 -520
- package/src/plugins/builtin/earnings-calls/prose.test.ts +0 -51
- package/src/plugins/builtin/econ/calendar-model.test.ts +0 -82
- package/src/plugins/builtin/econ/fred-cache.test.ts +0 -188
- package/src/plugins/builtin/econ/fred-client.test.ts +0 -79
- package/src/plugins/builtin/econ/index.test.tsx +0 -144
- package/src/plugins/builtin/econ-statistics/client.test.ts +0 -122
- package/src/plugins/builtin/econ-statistics/headless.test.ts +0 -54
- package/src/plugins/builtin/econ-statistics/pane.test.tsx +0 -69
- package/src/plugins/builtin/econ-statistics/transform.test.ts +0 -109
- package/src/plugins/builtin/econ-statistics/transform.ts +0 -94
- package/src/plugins/builtin/econ-statistics/trend.ts +0 -57
- package/src/plugins/builtin/econ-statistics/view.test.ts +0 -43
- package/src/plugins/builtin/equity-screener/headless.test.ts +0 -22
- package/src/plugins/builtin/equity-screener/model.test.ts +0 -116
- package/src/plugins/builtin/equity-screener/results.test.tsx +0 -44
- package/src/plugins/builtin/equity-screener/test-fixture.ts +0 -63
- package/src/plugins/builtin/estimate-revisions/model.test.ts +0 -253
- package/src/plugins/builtin/estimate-revisions/sorting.test.ts +0 -91
- package/src/plugins/builtin/executives/format.test.ts +0 -23
- package/src/plugins/builtin/executives/pane.test.tsx +0 -339
- package/src/plugins/builtin/filing-events/feed.test.ts +0 -143
- package/src/plugins/builtin/filing-events/pane.test.tsx +0 -125
- package/src/plugins/builtin/futures/model.test.ts +0 -151
- package/src/plugins/builtin/futures/pane.test.tsx +0 -219
- package/src/plugins/builtin/futures/table.test.ts +0 -155
- package/src/plugins/builtin/futures-curve/model.test.ts +0 -90
- package/src/plugins/builtin/fx-matrix/export.test.ts +0 -30
- package/src/plugins/builtin/fx-matrix/pairs.test.ts +0 -16
- package/src/plugins/builtin/fx-matrix/pane.test.tsx +0 -109
- package/src/plugins/builtin/fx-matrix/refresh.test.tsx +0 -69
- package/src/plugins/builtin/help/components.tsx +0 -44
- package/src/plugins/builtin/help/keybindings-editor.test.tsx +0 -164
- package/src/plugins/builtin/holders/headless.test.ts +0 -58
- package/src/plugins/builtin/holders/index.test.ts +0 -12
- package/src/plugins/builtin/holders/thirteenf-match.test.ts +0 -30
- package/src/plugins/builtin/insider/amendments.test.ts +0 -112
- package/src/plugins/builtin/insider/headless.test.ts +0 -136
- package/src/plugins/builtin/insider/insider-data.test.ts +0 -66
- package/src/plugins/builtin/insider/pane.test.tsx +0 -112
- package/src/plugins/builtin/iv-history/client.test.ts +0 -18
- package/src/plugins/builtin/iv-history/model.test.ts +0 -87
- package/src/plugins/builtin/jobs/model.test.ts +0 -119
- package/src/plugins/builtin/jobs/pages.test.tsx +0 -103
- package/src/plugins/builtin/kelly-sizer/index.test.tsx +0 -202
- package/src/plugins/builtin/kelly-sizer/model.test.ts +0 -158
- package/src/plugins/builtin/kelly-sizer/view.test.tsx +0 -88
- package/src/plugins/builtin/market-movers/headless.test.ts +0 -34
- package/src/plugins/builtin/market-movers/integrity.test.ts +0 -119
- package/src/plugins/builtin/market-movers/pane-research.test.tsx +0 -138
- package/src/plugins/builtin/market-movers/screener.test.ts +0 -333
- package/src/plugins/builtin/market-valuation/client.test.ts +0 -283
- package/src/plugins/builtin/market-valuation/headless.test.ts +0 -75
- package/src/plugins/builtin/market-valuation/model.test.ts +0 -405
- package/src/plugins/builtin/market-valuation/pane.test.tsx +0 -235
- package/src/plugins/builtin/market-valuation/trend.ts +0 -87
- package/src/plugins/builtin/money-markets/model.test.ts +0 -61
- package/src/plugins/builtin/news/headless.test.ts +0 -149
- package/src/plugins/builtin/news/wire/breaking/filters.test.ts +0 -99
- package/src/plugins/builtin/news/wire/breaking/notifications.test.ts +0 -204
- package/src/plugins/builtin/news/wire/breaking/pane.test.tsx +0 -128
- package/src/plugins/builtin/news/wire/breaking/pane.tsx +0 -89
- package/src/plugins/builtin/news/wire/feed-config.test.ts +0 -109
- package/src/plugins/builtin/news/wire/news/detail-view.test.tsx +0 -279
- package/src/plugins/builtin/news/wire/news/table.test.tsx +0 -223
- package/src/plugins/builtin/news/wire/read-state.test.ts +0 -37
- package/src/plugins/builtin/news/wire/rss/parser.test.ts +0 -178
- package/src/plugins/builtin/news/wire/rss/source.test.ts +0 -153
- package/src/plugins/builtin/notes/files.test.ts +0 -18
- package/src/plugins/builtin/notes/quick-notes-pane.test.tsx +0 -209
- package/src/plugins/builtin/notes/store.test.ts +0 -245
- package/src/plugins/builtin/notes/ticker-notes-tab.test.tsx +0 -350
- package/src/plugins/builtin/options/analytics.test.ts +0 -234
- package/src/plugins/builtin/options/calc-seed.test.ts +0 -130
- package/src/plugins/builtin/options/chain-integrity.test.tsx +0 -284
- package/src/plugins/builtin/options/enrichment-hook.test.tsx +0 -149
- package/src/plugins/builtin/options/enrichment.test.ts +0 -257
- package/src/plugins/builtin/options/expiry-selection.test.tsx +0 -370
- package/src/plugins/builtin/options/footer.test.ts +0 -60
- package/src/plugins/builtin/options/live-quotes.test.ts +0 -421
- package/src/plugins/builtin/options/market-reference.test.ts +0 -36
- package/src/plugins/builtin/options/table.test.ts +0 -100
- package/src/plugins/builtin/options/view.test.tsx +0 -657
- package/src/plugins/builtin/options-calculator/binomial.test.ts +0 -264
- package/src/plugins/builtin/options-calculator/boundary-integrity.test.tsx +0 -114
- package/src/plugins/builtin/options-calculator/evidence.test.ts +0 -138
- package/src/plugins/builtin/options-calculator/headless.test.ts +0 -39
- package/src/plugins/builtin/options-calculator/inputs.test.ts +0 -24
- package/src/plugins/builtin/options-calculator/model.test.ts +0 -242
- package/src/plugins/builtin/options-calculator/pane.test.tsx +0 -305
- package/src/plugins/builtin/options-calculator/surface.test.ts +0 -164
- package/src/plugins/builtin/options-scenario/client.test.ts +0 -143
- package/src/plugins/builtin/options-scenario/evidence.test.ts +0 -34
- package/src/plugins/builtin/options-scenario/live.test.ts +0 -34
- package/src/plugins/builtin/options-scenario/model.test.ts +0 -222
- package/src/plugins/builtin/options-scenario/pane.test.tsx +0 -195
- package/src/plugins/builtin/options-scenario/state.test.ts +0 -62
- package/src/plugins/builtin/plugin-marketplace/model.test.ts +0 -493
- package/src/plugins/builtin/plugin-module.test.ts +0 -101
- package/src/plugins/builtin/portfolio-list/account-metrics.test.ts +0 -243
- package/src/plugins/builtin/portfolio-list/bond-price-basis.test.ts +0 -120
- package/src/plugins/builtin/portfolio-list/cell-version.test.ts +0 -89
- package/src/plugins/builtin/portfolio-list/cli/render.test.ts +0 -261
- package/src/plugins/builtin/portfolio-list/index.test.ts +0 -248
- package/src/plugins/builtin/portfolio-list/live-valuation.test.ts +0 -94
- package/src/plugins/builtin/portfolio-list/metrics.test.ts +0 -562
- package/src/plugins/builtin/portfolio-list/mutations.test.ts +0 -200
- package/src/plugins/builtin/portfolio-list/pane/data.test.ts +0 -54
- package/src/plugins/builtin/portfolio-list/pane/index.test.tsx +0 -1835
- package/src/plugins/builtin/portfolio-list/position-cost-integrity.test.ts +0 -101
- package/src/plugins/builtin/portfolio-list/summary/index.test.ts +0 -184
- package/src/plugins/builtin/portfolio-list/summary/live-accounts.test.tsx +0 -90
- package/src/plugins/builtin/portfolio-list/use-cursor-neighbor-prefetch.test.tsx +0 -96
- package/src/plugins/builtin/portfolio-list/use-throttled-cursor-symbol.test.tsx +0 -166
- package/src/plugins/builtin/portfolio-list/use-throttled-ticker-order.test.tsx +0 -76
- package/src/plugins/builtin/rate-path/model.test.ts +0 -50
- package/src/plugins/builtin/realized-vol/chart-model.test.ts +0 -24
- package/src/plugins/builtin/realized-vol/client.test.ts +0 -193
- package/src/plugins/builtin/realized-vol/model.test.ts +0 -155
- package/src/plugins/builtin/relative-rotation/model.test.ts +0 -194
- package/src/plugins/builtin/research/analyst-headless.test.ts +0 -88
- package/src/plugins/builtin/research/analyst-model.test.ts +0 -125
- package/src/plugins/builtin/research/analyst-pane.test.tsx +0 -162
- package/src/plugins/builtin/research/corporate-actions-pane.test.tsx +0 -77
- package/src/plugins/builtin/research/equity-diagnostic-pane.test.tsx +0 -303
- package/src/plugins/builtin/research/event-model.test.ts +0 -165
- package/src/plugins/builtin/research/events-headless.test.ts +0 -43
- package/src/plugins/builtin/research/headless.test.ts +0 -111
- package/src/plugins/builtin/research/index.test.ts +0 -442
- package/src/plugins/builtin/research/relative-valuation-headless.test.ts +0 -192
- package/src/plugins/builtin/research/relative-valuation-model.test.ts +0 -49
- package/src/plugins/builtin/research/relative-valuation-pane.test.tsx +0 -99
- package/src/plugins/builtin/research-search/command-bar-search.test.ts +0 -81
- package/src/plugins/builtin/research-search/document-view.test.tsx +0 -75
- package/src/plugins/builtin/research-search/model.test.ts +0 -40
- package/src/plugins/builtin/research-search/pane.test.tsx +0 -256
- package/src/plugins/builtin/research-search/snippet.test.ts +0 -78
- package/src/plugins/builtin/risk-factors/data.test.ts +0 -63
- package/src/plugins/builtin/risk-factors/headless.test.ts +0 -40
- package/src/plugins/builtin/risk-factors/pane.test.tsx +0 -56
- package/src/plugins/builtin/risk-factors/test-fixtures.ts +0 -4
- package/src/plugins/builtin/scanner/flow-history.test.tsx +0 -138
- package/src/plugins/builtin/scanner/flow-model.test.ts +0 -180
- package/src/plugins/builtin/scanner/flow-pane.test.tsx +0 -159
- package/src/plugins/builtin/scanner/headless.test.ts +0 -121
- package/src/plugins/builtin/scanner/hilo-model.test.ts +0 -44
- package/src/plugins/builtin/sec/filing-content.test.ts +0 -57
- package/src/plugins/builtin/sec/headless.test.ts +0 -99
- package/src/plugins/builtin/sec/pane.test.tsx +0 -152
- package/src/plugins/builtin/sectors/client.test.ts +0 -228
- package/src/plugins/builtin/sectors/headless.test.ts +0 -87
- package/src/plugins/builtin/sectors/pane-cache.test.tsx +0 -78
- package/src/plugins/builtin/sectors/sector-model.test.ts +0 -119
- package/src/plugins/builtin/shared/auto-refresh.test.tsx +0 -95
- package/src/plugins/builtin/shared/auto-refresh.ts +0 -97
- package/src/plugins/builtin/shared/live-streaming.ts +0 -60
- package/src/plugins/builtin/shared/pane-footer.ts +0 -93
- package/src/plugins/builtin/shared/plan-access.test.ts +0 -69
- package/src/plugins/builtin/shared/plan-access.ts +0 -109
- package/src/plugins/builtin/shared/public-pane.test.ts +0 -12
- package/src/plugins/builtin/shared/read-state.ts +0 -104
- package/src/plugins/builtin/shared/research-cloud-session.test.tsx +0 -143
- package/src/plugins/builtin/shared/screener-live-quotes.test.ts +0 -111
- package/src/plugins/builtin/shared/screener-live-quotes.ts +0 -165
- package/src/plugins/builtin/shared/series-cache.test.ts +0 -106
- package/src/plugins/builtin/shared/table-pane.ts +0 -32
- package/src/plugins/builtin/shared/ticker-request.test.ts +0 -18
- package/src/plugins/builtin/shared/ticker-request.test.tsx +0 -137
- package/src/plugins/builtin/shared/ticker-source.ts +0 -32
- package/src/plugins/builtin/shared/ticker-surface.test.ts +0 -84
- package/src/plugins/builtin/shared/use-quote-board.test.tsx +0 -325
- package/src/plugins/builtin/shared/volatility/live-session.test.ts +0 -91
- package/src/plugins/builtin/shared/volatility/options.test.ts +0 -127
- package/src/plugins/builtin/shared/volatility/realized.test.ts +0 -201
- package/src/plugins/builtin/shared/volatility/realized.ts +0 -292
- package/src/plugins/builtin/shared/volatility/smile.test.ts +0 -209
- package/src/plugins/builtin/short-interest/client.test.ts +0 -55
- package/src/plugins/builtin/short-interest/headless.test.ts +0 -96
- package/src/plugins/builtin/short-interest/pane.test.tsx +0 -57
- package/src/plugins/builtin/short-volume/model.test.ts +0 -39
- package/src/plugins/builtin/thirteenf/api.test.ts +0 -149
- package/src/plugins/builtin/thirteenf/data.test.ts +0 -291
- package/src/plugins/builtin/thirteenf/headless.test.ts +0 -182
- package/src/plugins/builtin/thirteenf/model.test.ts +0 -230
- package/src/plugins/builtin/thirteenf/overlap.test.ts +0 -29
- package/src/plugins/builtin/thirteenf/pane.test.tsx +0 -407
- package/src/plugins/builtin/thirteenf/signals.test.ts +0 -16
- package/src/plugins/builtin/ticker-detail/chart-tab-switch.test.tsx +0 -275
- package/src/plugins/builtin/ticker-detail/data-panes/historical-price-precision.test.tsx +0 -120
- package/src/plugins/builtin/ticker-detail/data-panes/historical-prices.test.tsx +0 -41
- package/src/plugins/builtin/ticker-detail/financials/aggregation.test.ts +0 -79
- package/src/plugins/builtin/ticker-detail/financials/model.test.ts +0 -276
- package/src/plugins/builtin/ticker-detail/financials/period-integrity.test.tsx +0 -78
- package/src/plugins/builtin/ticker-detail/fund-profile.test.tsx +0 -118
- package/src/plugins/builtin/ticker-detail/headless.test.ts +0 -165
- package/src/plugins/builtin/ticker-detail/index.test.tsx +0 -850
- package/src/plugins/builtin/ticker-detail/overview/model.test.ts +0 -118
- package/src/plugins/builtin/ticker-detail/overview-return-coverage.test.tsx +0 -71
- package/src/plugins/builtin/ticker-detail/quote-monitor/card.test.tsx +0 -70
- package/src/plugins/builtin/ticker-detail/quote-monitor/index.test.tsx +0 -261
- package/src/plugins/builtin/ticker-detail/quote-monitor/retained-status.test.tsx +0 -134
- package/src/plugins/builtin/ticker-detail/quote-status.test.tsx +0 -116
- package/src/plugins/builtin/ticker-detail/quote-time-integrity.test.ts +0 -42
- package/src/plugins/builtin/ticker-research-backend-plugin.ts +0 -10
- package/src/plugins/builtin/ticker-research-plugin.ts +0 -61
- package/src/plugins/builtin/time-sales/model.test.ts +0 -83
- package/src/plugins/builtin/time-sales/snapshot-client.test.ts +0 -31
- package/src/plugins/builtin/time-sales/test-fixture.ts +0 -12
- package/src/plugins/builtin/time-sales/use-tape.test.tsx +0 -115
- package/src/plugins/builtin/treasury-auctions/cache.test.ts +0 -215
- package/src/plugins/builtin/treasury-auctions/client.test.ts +0 -207
- package/src/plugins/builtin/treasury-auctions/headless.test.ts +0 -34
- package/src/plugins/builtin/treasury-auctions/model.test.ts +0 -187
- package/src/plugins/builtin/treasury-auctions/pane.test.tsx +0 -174
- package/src/plugins/builtin/vol-surface/client.test.ts +0 -179
- package/src/plugins/builtin/vol-surface/evidence.test.ts +0 -73
- package/src/plugins/builtin/vol-surface/live.test.ts +0 -95
- package/src/plugins/builtin/vol-surface/model.test.ts +0 -243
- package/src/plugins/builtin/vol-surface/pane.test.tsx +0 -265
- package/src/plugins/builtin/vol-surface/raster.test.ts +0 -28
- package/src/plugins/builtin/vol-surface/stored.test.ts +0 -62
- package/src/plugins/builtin/volatility/chart-model.test.ts +0 -61
- package/src/plugins/builtin/volatility/client.test.ts +0 -207
- package/src/plugins/builtin/volatility/evidence.test.ts +0 -49
- package/src/plugins/builtin/volatility/headless.test.ts +0 -52
- package/src/plugins/builtin/volatility/model.test.ts +0 -152
- package/src/plugins/builtin/world-indices/headless.test.ts +0 -32
- package/src/plugins/builtin/world-indices/pane.test.tsx +0 -156
- package/src/plugins/builtin/world-venue-map/map.desktop.test.tsx +0 -45
- package/src/plugins/builtin/world-venue-map/model.test.ts +0 -85
- package/src/plugins/builtin/yield-curve/chart.test.ts +0 -23
- package/src/plugins/builtin/yield-curve/headless.test.ts +0 -40
- package/src/plugins/builtin/yield-curve/history.test.ts +0 -124
- package/src/plugins/builtin/yield-curve/pane.test.tsx +0 -140
- package/src/plugins/builtin/yield-curve/treasury-data.test.ts +0 -35
- package/src/plugins/bundle.test.ts +0 -209
- package/src/plugins/catalog-backend.test.ts +0 -47
- package/src/plugins/catalog-browser.test.ts +0 -72
- package/src/plugins/gridlock-notification.ts +0 -16
- package/src/plugins/host-contract.ts +0 -72
- package/src/plugins/host-link.test.ts +0 -133
- package/src/plugins/host-module-imports.test.ts +0 -94
- package/src/plugins/host-module-imports.ts +0 -73
- package/src/plugins/host-resolver.test.ts +0 -96
- package/src/plugins/launch-layout.test.ts +0 -131
- package/src/plugins/loader.test.ts +0 -54
- package/src/plugins/pane-manager.test.ts +0 -309
- package/src/plugins/registry/index.test.ts +0 -601
- package/src/plugins/registry/pane-settings.test.ts +0 -98
- package/src/plugins/registry/setup-command.test.ts +0 -62
- package/src/plugins/runtime/index.test.tsx +0 -328
- package/src/plugins/seed.test.ts +0 -136
- package/src/plugins/ticker-navigation.test.ts +0 -141
- package/src/public/public-api.test.ts +0 -42
- package/src/react/async-resource.test.tsx +0 -124
- package/src/react/input.test.ts +0 -182
- package/src/remote/controller.test.ts +0 -585
- package/src/remote/json-patch.test.ts +0 -31
- package/src/remote/schema.test.ts +0 -65
- package/src/remote/semantic-tree.test.tsx +0 -105
- package/src/remote/server.test.ts +0 -50
- package/src/renderers/browser/bundled-plugins.test.ts +0 -41
- package/src/renderers/browser/cloud-transport.test.ts +0 -68
- package/src/renderers/browser/config-host.test.ts +0 -70
- package/src/renderers/browser/deeplink-bridge.test.ts +0 -56
- package/src/renderers/browser/error-boundary.tsx +0 -23
- package/src/renderers/browser/http-proxy-transport.test.ts +0 -98
- package/src/renderers/browser/research-entry.test.ts +0 -32
- package/src/renderers/browser/storage.test.ts +0 -66
- package/src/renderers/cloudflare/http-proxy.test.ts +0 -122
- package/src/renderers/cloudflare/worker.test.ts +0 -155
- package/src/renderers/electrobun/bun/application-menu/click.test.ts +0 -55
- package/src/renderers/electrobun/bun/context-menu/click.test.ts +0 -67
- package/src/renderers/electrobun/bun/context-menu/normalize.test.ts +0 -52
- package/src/renderers/electrobun/bun/desktop/capability-bridge.test.ts +0 -112
- package/src/renderers/electrobun/bun/desktop/http-fetch.test.ts +0 -89
- package/src/renderers/electrobun/bun/desktop/http-stream.test.ts +0 -200
- package/src/renderers/electrobun/bun/desktop/initialization.test.ts +0 -27
- package/src/renderers/electrobun/bun/desktop/window-controls.test.ts +0 -53
- package/src/renderers/electrobun/bun/desktop/window-controls.ts +0 -75
- package/src/renderers/electrobun/bun/desktop/window-events.ts +0 -49
- package/src/renderers/electrobun/bun/desktop/window-style.ts +0 -34
- package/src/renderers/electrobun/bun/desktop/windows-custom-chrome.ts +0 -58
- package/src/renderers/electrobun/bun/desktop/windows-icons.ts +0 -70
- package/src/renderers/electrobun/bun/desktop/windows-native.ts +0 -75
- package/src/renderers/electrobun/bun/desktop/workspace/index.test.ts +0 -147
- package/src/renderers/electrobun/bun/window/frame.test.ts +0 -47
- package/src/renderers/electrobun/view/application-menu-bridge.ts +0 -12
- package/src/renderers/electrobun/view/cli-pane-shot-frame.test.tsx +0 -76
- package/src/renderers/electrobun/view/cli-pane-shot-health.test.ts +0 -25
- package/src/renderers/electrobun/view/context-menu.test.ts +0 -146
- package/src/renderers/electrobun/view/data-table/frozen-column.test.tsx +0 -73
- package/src/renderers/electrobun/view/data-table/horizontal-navigation.test.tsx +0 -82
- package/src/renderers/electrobun/view/data-table/index.test.tsx +0 -127
- package/src/renderers/electrobun/view/desktop/controls.test.tsx +0 -161
- package/src/renderers/electrobun/view/desktop/list-view.test.tsx +0 -37
- package/src/renderers/electrobun/view/desktop/window/snapshot.test.ts +0 -57
- package/src/renderers/electrobun/view/desktop-deeplink-bridge.ts +0 -10
- package/src/renderers/electrobun/view/dialog-host.test.ts +0 -25
- package/src/renderers/electrobun/view/dialog-stack.test.tsx +0 -73
- package/src/renderers/electrobun/view/external-plugins.test.ts +0 -57
- package/src/renderers/electrobun/view/history-metadata-rpc.test.ts +0 -62
- package/src/renderers/electrobun/view/host/ascii-text.test.ts +0 -48
- package/src/renderers/electrobun/view/host/box.test.tsx +0 -171
- package/src/renderers/electrobun/view/host/focus-scope.test.ts +0 -37
- package/src/renderers/electrobun/view/host/scroll-box.desktop.test.tsx +0 -46
- package/src/renderers/electrobun/view/host/style.test.ts +0 -15
- package/src/renderers/electrobun/view/host/surface-3d.test.ts +0 -33
- package/src/renderers/electrobun/view/input-host.test.tsx +0 -104
- package/src/renderers/electrobun/view/key-event.test.ts +0 -34
- package/src/renderers/electrobun/view/native-stubs/chart/kitty-support.ts +0 -19
- package/src/renderers/electrobun/view/native-stubs/chart/surface-manager.ts +0 -36
- package/src/renderers/electrobun/view/native-stubs/ibkr-native-loader.ts +0 -3
- package/src/renderers/electrobun/view/native-stubs/native-stubs.test.ts +0 -42
- package/src/renderers/electrobun/view/notes-files.ts +0 -56
- package/src/renderers/electrobun/view/remote/backend-quote-subscription.test.ts +0 -87
- package/src/renderers/electrobun/view/remote/capability-invoker.test.ts +0 -96
- package/src/renderers/electrobun/view/remote/connection-health-backend.ts +0 -19
- package/src/renderers/electrobun/view/remote/connection-health.test.ts +0 -44
- package/src/renderers/electrobun/view/remote/quote-subscription-registry.test.ts +0 -86
- package/src/renderers/electrobun/view/rpc-codec.test.ts +0 -112
- package/src/renderers/electrobun/view/screenshot-watermark.test.ts +0 -48
- package/src/renderers/electrobun/view/toast-host.test.tsx +0 -61
- package/src/renderers/opentui/chart-surface.test.tsx +0 -147
- package/src/renderers/opentui/image/loader.test.ts +0 -25
- package/src/renderers/opentui/interaction-performance.test.ts +0 -79
- package/src/renderers/opentui/terminal-media.test.ts +0 -173
- package/src/renderers/share/chart.test.ts +0 -52
- package/src/renderers/share/layout-view.test.tsx +0 -58
- package/src/renderers/share/view.test.tsx +0 -120
- package/src/shares/api.test.ts +0 -120
- package/src/shares/location.test.ts +0 -19
- package/src/shares/pane.test.ts +0 -110
- package/src/sources/asml-earnings.test.ts +0 -197
- package/src/sources/fixtures/sec-operating-expenses.json +0 -163
- package/src/sources/fixtures/shop-20251231-quarterly-summary.html +0 -1
- package/src/sources/fixtures/shop-20260630-quarterly-summary.html +0 -1
- package/src/sources/fixtures/shop-operating-provider.json +0 -141
- package/src/sources/fixtures/shop-quarterly-summary-provenance.json +0 -24
- package/src/sources/fixtures/shop-submissions-20260922.json +0 -31
- package/src/sources/gloomberb-cloud/history-coverage.test.ts +0 -119
- package/src/sources/gloomberb-cloud/history-retention.test.ts +0 -207
- package/src/sources/gloomberb-cloud/history-session.test.ts +0 -76
- package/src/sources/gloomberb-cloud/index.test.ts +0 -1116
- package/src/sources/gloomberb-cloud/normalizers.test.ts +0 -135
- package/src/sources/gloomberb-cloud/quote-metadata.test.ts +0 -50
- package/src/sources/gloomberb-cloud/valuation-observations.ts +0 -29
- package/src/sources/history-coverage.test.ts +0 -40
- package/src/sources/listing-history.ts +0 -52
- package/src/sources/provider-router/arca-cache.test.ts +0 -97
- package/src/sources/provider-router/asml-earnings-cache.test.ts +0 -158
- package/src/sources/provider-router/broker-session.test.ts +0 -52
- package/src/sources/provider-router/cache.test.ts +0 -133
- package/src/sources/provider-router/cached-financials.test.ts +0 -711
- package/src/sources/provider-router/cached-listing-identity.test.ts +0 -159
- package/src/sources/provider-router/cached-routes.test.ts +0 -232
- package/src/sources/provider-router/connection-health.test.ts +0 -28
- package/src/sources/provider-router/financials.test.ts +0 -209
- package/src/sources/provider-router/fixtures/quarterly-source-disagreements.json +0 -438
- package/src/sources/provider-router/fixtures/shop-nasdaqgs.json +0 -137
- package/src/sources/provider-router/history-boundary-cache.test.ts +0 -72
- package/src/sources/provider-router/history-calendar-cache.test.ts +0 -301
- package/src/sources/provider-router/history-exact-window.test.ts +0 -187
- package/src/sources/provider-router/history-gap-cache.test.ts +0 -84
- package/src/sources/provider-router/history-gaps.test.ts +0 -141
- package/src/sources/provider-router/history-retention.test.ts +0 -239
- package/src/sources/provider-router/history-session.test.ts +0 -138
- package/src/sources/provider-router/history.test.ts +0 -780
- package/src/sources/provider-router/index.test.ts +0 -1990
- package/src/sources/provider-router/listing-history.test.ts +0 -139
- package/src/sources/provider-router/listing-identity.test.ts +0 -128
- package/src/sources/provider-router/nasdaqgs-listing.test.ts +0 -78
- package/src/sources/provider-router/news.test.ts +0 -34
- package/src/sources/provider-router/non-company-metadata.test.ts +0 -95
- package/src/sources/provider-router/o-income-basis.test.ts +0 -64
- package/src/sources/provider-router/operating-result-cache.test.ts +0 -44
- package/src/sources/provider-router/operating-result-retry.test.ts +0 -221
- package/src/sources/provider-router/profile-enrichment.test.ts +0 -168
- package/src/sources/provider-router/quote-completion.test.ts +0 -62
- package/src/sources/provider-router/quote-domain.test.ts +0 -92
- package/src/sources/provider-router/quote-route.test.ts +0 -255
- package/src/sources/provider-router/realtime-access.test.ts +0 -22
- package/src/sources/provider-router/routing.test.ts +0 -39
- package/src/sources/provider-router/search.test.ts +0 -191
- package/src/sources/provider-router/shell-history-cache.test.ts +0 -131
- package/src/sources/provider-router/statement-history.test.ts +0 -71
- package/src/sources/provider-router/statement-observations.test.ts +0 -162
- package/src/sources/provider-router/valuation-retractions.test.ts +0 -280
- package/src/sources/reported-operating-results.test.ts +0 -286
- package/src/sources/sec-bank-revenue.test.ts +0 -79
- package/src/sources/sec-edgar-shares.fixture.json +0 -188
- package/src/sources/sec-edgar-shares.test.ts +0 -66
- package/src/sources/sec-edgar.test.ts +0 -924
- package/src/sources/sec-income-attribution.test.ts +0 -93
- package/src/sources/sec-operating-expenses.test.ts +0 -42
- package/src/sources/yahoo-finance/fixtures/aapl-final-observation.json +0 -20
- package/src/sources/yahoo-finance/history-session.test.ts +0 -120
- package/src/sources/yahoo-finance/history.test.ts +0 -47
- package/src/sources/yahoo-finance/mappers.test.ts +0 -176
- package/src/sources/yahoo-finance/options.test.ts +0 -23
- package/src/sources/yahoo-finance/requests.test.ts +0 -119
- package/src/sources/yahoo-finance/snapshots.test.ts +0 -225
- package/src/sources/yahoo-finance/symbols.test.ts +0 -18
- package/src/sources/yahoo-finance.test.ts +0 -330
- package/src/state/app/activity.test.ts +0 -54
- package/src/state/app/bootstrap.test.ts +0 -664
- package/src/state/app/context/index.test.ts +0 -604
- package/src/state/app/context/index.test.tsx +0 -347
- package/src/state/app/context/selector.test.tsx +0 -424
- package/src/state/hooks/inline-ticker-failures.test.ts +0 -77
- package/src/state/hooks/inline-tickers.test.tsx +0 -253
- package/src/state/hooks/live-ticker-financials.test.tsx +0 -120
- package/src/state/hooks/quote-streaming.test.ts +0 -44
- package/src/state/hooks/quote-streaming.test.tsx +0 -442
- package/src/state/persist-scheduler.test.ts +0 -151
- package/src/state/selectors-ui.ts +0 -47
- package/src/state/selectors.ts +0 -27
- package/src/state/session-persistence.test.ts +0 -187
- package/src/state/ticker-refresh-queue.test.ts +0 -46
- package/src/sync/auth-transition.test.ts +0 -36
- package/src/sync/controller.test.ts +0 -527
- package/src/sync/core-contributors.test.ts +0 -643
- package/src/test-support/fixtures/asml-earnings.json +0 -993
- package/src/theme/colors.test.ts +0 -85
- package/src/theme/font-scale.test.ts +0 -14
- package/src/theme/theme-context.test.tsx +0 -67
- package/src/theme/themes.test.ts +0 -100
- package/src/tickers/instrument-kind.test.ts +0 -21
- package/src/tickers/instrument-label.test.ts +0 -13
- package/src/tickers/list.test.ts +0 -17
- package/src/tickers/open-target.test.ts +0 -86
- package/src/tickers/search/index.test.ts +0 -950
- package/src/tickers/search-contract-context.test.tsx +0 -161
- package/src/tickers/search-contract-templates.test.ts +0 -83
- package/src/tickers/search-issuer-grouping.test.ts +0 -74
- package/src/tickers/search-listing-ranking.test.tsx +0 -122
- package/src/tickers/tokenizer.test.ts +0 -31
- package/src/time-series/bond-price-history.test.ts +0 -52
- package/src/time-series/calendar-month-end-resolution.test.ts +0 -106
- package/src/time-series/calendar-window-resolution.test.ts +0 -133
- package/src/time-series/chart-data.test.ts +0 -288
- package/src/time-series/date-window.test.ts +0 -113
- package/src/time-series/economic.test.ts +0 -44
- package/src/time-series/financial-history-request.test.ts +0 -20
- package/src/time-series/financial-period-coverage.test.ts +0 -37
- package/src/time-series/financial-period-gaps.test.ts +0 -128
- package/src/time-series/fixtures/q4-reported-common-income.json +0 -394
- package/src/time-series/fixtures/q4-reported-per-share.json +0 -305
- package/src/time-series/fixtures/quote-store.ts +0 -55
- package/src/time-series/forward-valuation.test.ts +0 -131
- package/src/time-series/fundamentals.test.ts +0 -592
- package/src/time-series/history-retention.test.ts +0 -141
- package/src/time-series/history-session-cache.test.ts +0 -250
- package/src/time-series/hooks.test.ts +0 -59
- package/src/time-series/legacy-contract-live.test.ts +0 -22
- package/src/time-series/live-bars.test.ts +0 -290
- package/src/time-series/live-quotes.test.ts +0 -208
- package/src/time-series/market-price-units.test.ts +0 -75
- package/src/time-series/parsed-history-identity.test.tsx +0 -142
- package/src/time-series/price-comparison.test.ts +0 -233
- package/src/time-series/price-history-integrity-window.test.ts +0 -137
- package/src/time-series/price-history-integrity.test.ts +0 -195
- package/src/time-series/q4-common-income.test.ts +0 -63
- package/src/time-series/q4-per-share.test.ts +0 -144
- package/src/time-series/realized-vol-study.test.ts +0 -189
- package/src/time-series/reporting-currency.test.ts +0 -99
- package/src/time-series/resolution.test.ts +0 -132
- package/src/time-series/resolve.test.ts +0 -2471
- package/src/time-series/sec-eps-research.test.ts +0 -55
- package/src/time-series/seed-cadence.test.tsx +0 -219
- package/src/time-series/served-cadence-consumers.test.ts +0 -52
- package/src/time-series/session-history-domain.test.ts +0 -160
- package/src/time-series/spec-studies.test.ts +0 -619
- package/src/time-series/transforms.test.ts +0 -216
- package/src/time-series/use-chart-resolution.test.tsx +0 -632
- package/src/time-series/valuation-currency.test.ts +0 -129
- package/src/time-series/valuation-denominator.test.ts +0 -240
- package/src/time-series/valuation-live-status.test.ts +0 -64
- package/src/time-series/valuation-price.test.ts +0 -267
- package/src/types/config.test.ts +0 -161
- package/src/ui/context-menu.test.ts +0 -95
- package/src/ui/qr.test.ts +0 -79
- package/src/updater/github-releases.test.ts +0 -41
- package/src/updater.test.ts +0 -561
- package/src/updater.ts +0 -480
- package/src/utils/calendar-date.test.ts +0 -18
- package/src/utils/cli-output.test.ts +0 -43
- package/src/utils/csv.test.ts +0 -13
- package/src/utils/currency-units.test.ts +0 -66
- package/src/utils/dom-screenshot.test.ts +0 -52
- package/src/utils/double-escape-close.test.ts +0 -33
- package/src/utils/earnings-result.ts +0 -35
- package/src/utils/exchange-rate-map.ts +0 -9
- package/src/utils/exchange-rate-snapshot.test.ts +0 -33
- package/src/utils/exchanges.test.ts +0 -62
- package/src/utils/external-url.test.ts +0 -32
- package/src/utils/financial-statements.test.ts +0 -211
- package/src/utils/format.test.ts +0 -61
- package/src/utils/fuzzy-search.test.ts +0 -94
- package/src/utils/fx-market-hours.test.ts +0 -28
- package/src/utils/fx-status.test.ts +0 -16
- package/src/utils/html-entities.test.ts +0 -8
- package/src/utils/inline-content-tokenizer.test.ts +0 -31
- package/src/utils/instrument-identity.test.ts +0 -26
- package/src/utils/latest-financial-period.test.ts +0 -19
- package/src/utils/link-tokenizer.test.ts +0 -27
- package/src/utils/main-thread-monitor.ts +0 -127
- package/src/utils/main-thread-stall.test.ts +0 -59
- package/src/utils/market-capitalization-consumers.test.ts +0 -59
- package/src/utils/market-capitalization.test.ts +0 -38
- package/src/utils/operating-result-aggregation.ts +0 -106
- package/src/utils/operating-result-consumers.test.ts +0 -212
- package/src/utils/operating-result.ts +0 -100
- package/src/utils/options.test.ts +0 -20
- package/src/utils/price-earnings.test.ts +0 -39
- package/src/utils/price-history.test.ts +0 -230
- package/src/utils/relative-time.ts +0 -8
- package/src/utils/reported-earnings-result.ts +0 -336
- package/src/utils/reported-money.test.ts +0 -25
- package/src/utils/reported-operating-result.ts +0 -271
- package/src/utils/save-text-file.test.ts +0 -24
- package/src/utils/sec-eps-basis.test.ts +0 -82
- package/src/utils/sec.test.ts +0 -60
- package/src/utils/semver.test.ts +0 -31
- package/src/utils/shop-operating-table.ts +0 -230
- package/src/utils/shortcut-labels.test.ts +0 -20
- package/src/utils/sort-values.test.ts +0 -11
- package/src/utils/statement-observations.ts +0 -129
- package/src/utils/throttled-fetch.test.ts +0 -186
- package/src/utils/tweet-text.test.ts +0 -13
|
@@ -1,2471 +0,0 @@
|
|
|
1
|
-
import { FINANCIAL_VINTAGE_NOTICE } from "../utils/financial-statements";
|
|
2
|
-
import { describe, expect, spyOn, test } from "bun:test";
|
|
3
|
-
import { chartSeriesSourceKey } from "../capabilities";
|
|
4
|
-
import type { FredSeriesData, FredSeriesLoadResult } from "../data/fred-series";
|
|
5
|
-
import { buildCustomChartPreset } from "../plugins/builtin/chart-composer/presets";
|
|
6
|
-
import { createTestDataProvider } from "../test-support/data-provider";
|
|
7
|
-
import type { TickerFinancials } from "../types/financials";
|
|
8
|
-
import { chartQuoteOverrideKeyForSource } from "./live-quotes";
|
|
9
|
-
import {
|
|
10
|
-
ChartResolveCache,
|
|
11
|
-
mergePriceHistoryWindows,
|
|
12
|
-
resolveChartSpecData,
|
|
13
|
-
seedChartResolutionResult,
|
|
14
|
-
} from "./resolve";
|
|
15
|
-
import { CHART_SPEC_VERSION, type ChartSeriesSpec, type ChartSpec } from "./types";
|
|
16
|
-
|
|
17
|
-
function chartSeries(input: Pick<ChartSeriesSpec, "source"> & Partial<ChartSeriesSpec>): ChartSeriesSpec {
|
|
18
|
-
return { id: "price", style: "line", transform: "raw", axis: "left", panelId: "main", interpolation: "none", ...input };
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
function chartSpec(input: Pick<ChartSpec, "viewport" | "series"> & Partial<ChartSpec>): ChartSpec {
|
|
22
|
-
return { version: CHART_SPEC_VERSION, panels: [{ id: "main" }], studies: [], ...input };
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
const emptyFinancials = (): TickerFinancials => ({
|
|
26
|
-
annualStatements: [],
|
|
27
|
-
quarterlyStatements: [],
|
|
28
|
-
priceHistory: [],
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
const fredLoad = (
|
|
32
|
-
data: FredSeriesData = { observations: [], info: null },
|
|
33
|
-
overrides: Partial<FredSeriesLoadResult> = {},
|
|
34
|
-
): FredSeriesLoadResult => ({
|
|
35
|
-
data,
|
|
36
|
-
fetchedAt: Date.parse("2026-03-01T00:00:00Z"),
|
|
37
|
-
stale: false,
|
|
38
|
-
source: "network",
|
|
39
|
-
...overrides,
|
|
40
|
-
});
|
|
41
|
-
|
|
42
|
-
describe("resolveChartSpecData", () => {
|
|
43
|
-
test("credit stress windows disclose source coverage without clipping buffers or scaling effective yields", async () => {
|
|
44
|
-
const spec = buildCustomChartPreset("FRED:BAMLC0A0CM,FRED:BAMLC0A0CMEY");
|
|
45
|
-
const requests: string[] = [];
|
|
46
|
-
const sources = {
|
|
47
|
-
now: new Date("2026-09-11"),
|
|
48
|
-
loadFredSeries: async (request: { seriesId: string; startDate?: string }) => {
|
|
49
|
-
requests.push(request.startDate!);
|
|
50
|
-
const yieldSeries = request.seriesId.endsWith("EY");
|
|
51
|
-
return fredLoad({
|
|
52
|
-
observations: [
|
|
53
|
-
{ date: "2023-09-12", value: yieldSeries ? 5.82 : 1.23 },
|
|
54
|
-
{ date: "2025-04-09", value: yieldSeries ? 5.5 : 1.21 },
|
|
55
|
-
{ date: "2026-09-10", value: yieldSeries ? 5.68 : 0.8 },
|
|
56
|
-
],
|
|
57
|
-
info: { id: request.seriesId, title: yieldSeries ? "IG effective yield" : "IG OAS", units: "Percent",
|
|
58
|
-
frequency: "Daily, Close", seasonalAdjustment: "Not Seasonally Adjusted", source: "FRED", notes: "",
|
|
59
|
-
observationStart: "2023-09-12", observationEnd: "2026-09-10" },
|
|
60
|
-
});
|
|
61
|
-
},
|
|
62
|
-
};
|
|
63
|
-
const fiveYear = await resolveChartSpecData(spec, sources);
|
|
64
|
-
expect(fiveYear.warnings.filter((warning) => warning.includes("FRED coverage"))).toHaveLength(2);
|
|
65
|
-
expect(fiveYear.warnings.some((warning) => warning.includes("vintage dates"))).toBe(true);
|
|
66
|
-
expect(fiveYear.series.map((series) => series.points.at(-1)?.value)).toEqual([0.8, 5.68]);
|
|
67
|
-
expect(fiveYear.series.map((series) => series.unit)).toEqual(["%", "%"]);
|
|
68
|
-
const recent = await resolveChartSpecData({ ...spec, viewport: { ...spec.viewport, range: "1Y" } }, sources);
|
|
69
|
-
expect(requests.at(-1)! < "2023-09-12").toBe(true); // Calculation buffer predates the visible window.
|
|
70
|
-
expect(recent.warnings.some((warning) => warning.includes("FRED coverage"))).toBe(false);
|
|
71
|
-
const old = await resolveChartSpecData({ ...spec, viewport: { ...spec.viewport,
|
|
72
|
-
dateWindow: { start: "2020-01-01", end: "2020-06-30" } } }, sources);
|
|
73
|
-
expect(old.series.every((series) => series.points.length === 0)).toBe(true);
|
|
74
|
-
expect(old.warnings.filter((warning) => warning.includes("Earlier dates are unavailable"))).toHaveLength(2);
|
|
75
|
-
expect(old.viewport.start?.toISOString().slice(0, 10)).toBe("2020-01-01");
|
|
76
|
-
});
|
|
77
|
-
|
|
78
|
-
test("credit history keeps newer observations when source coverage metadata lags", async () => {
|
|
79
|
-
const spec = buildCustomChartPreset("FRED:BAMLC0A0CM");
|
|
80
|
-
spec.viewport.dateWindow = { start: "2021-09-16", end: "2026-09-16" };
|
|
81
|
-
const data: FredSeriesData = {
|
|
82
|
-
observations: [{ date: "2023-09-18", value: 1.22 }, { date: "2026-09-14", value: 0.8 }],
|
|
83
|
-
info: { id: "BAMLC0A0CM", title: "IG OAS", units: "Percent", frequency: "Daily, Close",
|
|
84
|
-
seasonalAdjustment: "Not Seasonally Adjusted", source: "FRED", notes: "",
|
|
85
|
-
observationStart: "2023-09-12", observationEnd: "2026-09-10" },
|
|
86
|
-
};
|
|
87
|
-
const sources = { loadFredSeries: async () => fredLoad(data) };
|
|
88
|
-
const before = await resolveChartSpecData(spec, sources);
|
|
89
|
-
expect(before.series[0]?.points.at(-1)?.value).toBe(0.8);
|
|
90
|
-
expect(before.series[0]?.points.at(-1)?.date.toISOString()).toBe("2026-09-14T00:00:00.000Z");
|
|
91
|
-
expect(before.warnings.some((warning) => warning.includes("exact coverage dates are unavailable"))).toBe(true);
|
|
92
|
-
expect(before.warnings.some((warning) => warning.includes("2026-09-10"))).toBe(false);
|
|
93
|
-
data.info = { ...data.info!, observationStart: "2023-09-18", observationEnd: "2026-09-14" };
|
|
94
|
-
const recovered = await resolveChartSpecData(spec, sources);
|
|
95
|
-
expect(recovered.series[0]?.points).toEqual(before.series[0]?.points);
|
|
96
|
-
expect(recovered.warnings.some((warning) => warning.includes("2023-09-18 to 2026-09-14"))).toBe(true);
|
|
97
|
-
expect(recovered.warnings.some((warning) => warning.includes("exact coverage dates are unavailable"))).toBe(false);
|
|
98
|
-
});
|
|
99
|
-
|
|
100
|
-
test("qualified price charts retain quote metadata without injecting the fetched snapshot into history", async () => {
|
|
101
|
-
let quoteCalls = 0;
|
|
102
|
-
let financialCalls = 0;
|
|
103
|
-
const history = [{ date: new Date("2026-01-15"), close: 77.53, volume: 1234 }];
|
|
104
|
-
const provider = createTestDataProvider({
|
|
105
|
-
getQuote: async () => { quoteCalls++; return { symbol: "NESN", listingExchangeName: "SWX", currency: "CHF", instrumentType: "EQUITY", price: 999, change: 0, changePercent: 0, lastUpdated: Date.parse("2026-01-16") }; },
|
|
106
|
-
getTickerFinancials: async () => { financialCalls++; return emptyFinancials(); },
|
|
107
|
-
getPriceHistory: async () => history,
|
|
108
|
-
getPriceHistoryForResolution: async () => history,
|
|
109
|
-
});
|
|
110
|
-
const spec = chartSpec({ viewport: { range: "1M", resolution: "1d" }, series: [chartSeries({ source: { kind: "security", instrument: { symbol: "NESN", exchange: "SWX" }, fieldId: "market.close" } })] });
|
|
111
|
-
const cache = new ChartResolveCache();
|
|
112
|
-
const sources = { dataProvider: provider, loadFredSeries: async () => fredLoad(), now: new Date("2026-01-16") };
|
|
113
|
-
const result = await resolveChartSpecData(spec, sources, cache);
|
|
114
|
-
expect(result.series[0]).toMatchObject({ unit: "CHF/share", unitGroup: "price:CHF", volumeUnit: "shares" });
|
|
115
|
-
expect(result.series[0]?.points.map((point) => point.value)).toEqual([77.53]);
|
|
116
|
-
await resolveChartSpecData(spec, sources, cache);
|
|
117
|
-
expect(quoteCalls).toBe(1);
|
|
118
|
-
expect(financialCalls).toBe(0);
|
|
119
|
-
|
|
120
|
-
const unavailable = createTestDataProvider({
|
|
121
|
-
// Optional metadata can also fail synchronously in a provider adapter.
|
|
122
|
-
getQuote: () => { throw new Error("Quote temporarily unavailable"); },
|
|
123
|
-
getPriceHistory: async () => history,
|
|
124
|
-
getPriceHistoryForResolution: async () => history,
|
|
125
|
-
});
|
|
126
|
-
const withoutMetadata = await resolveChartSpecData(spec, { ...sources, dataProvider: unavailable });
|
|
127
|
-
expect(withoutMetadata.errors).toEqual([]);
|
|
128
|
-
expect(withoutMetadata.series[0]?.points.map((point) => point.value)).toEqual([77.53]);
|
|
129
|
-
expect(withoutMetadata.series[0]?.unit).toBe("currency");
|
|
130
|
-
});
|
|
131
|
-
|
|
132
|
-
test("seeds study series so their panels survive the wait for real data", async () => {
|
|
133
|
-
const date = new Date("2026-01-05T00:00:00.000Z");
|
|
134
|
-
const seeded = seedChartResolutionResult(
|
|
135
|
-
chartSpec({
|
|
136
|
-
viewport: { range: "1M", resolution: "auto" },
|
|
137
|
-
panels: [{ id: "main" }, { id: "volume" }],
|
|
138
|
-
series: [chartSeries({
|
|
139
|
-
source: {
|
|
140
|
-
kind: "security",
|
|
141
|
-
instrument: { symbol: "TEST", exchange: "NASDAQ" },
|
|
142
|
-
fieldId: "market.ohlcv",
|
|
143
|
-
},
|
|
144
|
-
style: "candles",
|
|
145
|
-
})],
|
|
146
|
-
studies: [{
|
|
147
|
-
id: "volume",
|
|
148
|
-
kind: "volume",
|
|
149
|
-
inputSeriesIds: ["price"],
|
|
150
|
-
parameters: {},
|
|
151
|
-
panelId: "volume",
|
|
152
|
-
axis: "left",
|
|
153
|
-
}],
|
|
154
|
-
}),
|
|
155
|
-
new Map([[
|
|
156
|
-
chartQuoteOverrideKeyForSource({
|
|
157
|
-
kind: "security",
|
|
158
|
-
instrument: { symbol: "TEST", exchange: "NASDAQ" },
|
|
159
|
-
fieldId: "market.ohlcv",
|
|
160
|
-
}),
|
|
161
|
-
[{ date, open: 10, high: 12, low: 9, close: 11, volume: 5_000 }],
|
|
162
|
-
]]),
|
|
163
|
-
);
|
|
164
|
-
|
|
165
|
-
const volume = seeded?.series.find((entry) => entry.panelId === "volume");
|
|
166
|
-
expect(volume?.points.map((point) => point.value)).toEqual([5_000]);
|
|
167
|
-
expect(seeded?.bufferedSeries?.find((entry) => entry.panelId === "volume")?.points).toHaveLength(1);
|
|
168
|
-
});
|
|
169
|
-
|
|
170
|
-
test("a currency-only live quote still loads security type without replacing its price", async () => {
|
|
171
|
-
let quoteCalls = 0;
|
|
172
|
-
let financialCalls = 0;
|
|
173
|
-
const source = { kind: "security" as const, instrument: { symbol: "NVDA", exchange: "XNAS" }, fieldId: "market.close" };
|
|
174
|
-
const history = [{ date: new Date("2026-01-15T14:30:00Z"), close: 77.53, volume: 1234 }];
|
|
175
|
-
const provider = createTestDataProvider({
|
|
176
|
-
getQuote: async () => { quoteCalls++; return { symbol: "NVDA", listingExchangeName: "NASDAQ", currency: "USD", instrumentType: "Common Stock", price: 999, change: 0, changePercent: 0, lastUpdated: Date.parse("2026-01-16T16:00:00Z") }; },
|
|
177
|
-
getTickerFinancials: async () => { financialCalls++; return emptyFinancials(); },
|
|
178
|
-
getPriceHistory: async () => history,
|
|
179
|
-
getPriceHistoryForResolution: async () => history,
|
|
180
|
-
});
|
|
181
|
-
const spec = chartSpec({ viewport: { range: "1M", resolution: "1d" }, series: [chartSeries({ source })],
|
|
182
|
-
studies: [{ id: "volume", kind: "volume", inputSeriesIds: ["price"], parameters: {}, panelId: "main", axis: "left" }] });
|
|
183
|
-
const sources = { dataProvider: provider, loadFredSeries: async () => fredLoad(), now: new Date("2026-01-16T16:00:00Z"),
|
|
184
|
-
quoteOverrides: new Map([[chartQuoteOverrideKeyForSource(source), { symbol: "NVDA", currency: "USD", price: 78, change: 0, changePercent: 0, lastUpdated: Date.parse("2026-01-16T16:00:00Z") }]]) };
|
|
185
|
-
const cache = new ChartResolveCache();
|
|
186
|
-
const result = await resolveChartSpecData(spec, sources, cache);
|
|
187
|
-
expect(result.series[0]).toMatchObject({ unit: "USD/share", volumeUnit: "shares" });
|
|
188
|
-
expect(result.series.find((series) => series.id === "volume")?.unit).toBe("shares");
|
|
189
|
-
expect(result.series[0]?.points.map((point) => point.value)).toEqual([77.53, 78]);
|
|
190
|
-
expect(result.warnings.some((warning) => warning.includes("Volume unit unknown"))).toBe(false);
|
|
191
|
-
await resolveChartSpecData(spec, sources, cache);
|
|
192
|
-
expect(quoteCalls).toBe(1);
|
|
193
|
-
expect(financialCalls).toBe(0);
|
|
194
|
-
});
|
|
195
|
-
|
|
196
|
-
test("direct volume fields and volume studies retain established units without labeling crypto volume as shares", async () => {
|
|
197
|
-
for (const [instrumentType, expectedUnit] of [["EQUITY", "shares"], ["Common Stock", "shares"], ["FUTURE", "contracts"], ["CRYPTOCURRENCY", ""], [undefined, ""]] as const) {
|
|
198
|
-
const history = [{ date: new Date("2026-01-15"), close: 1, volume: 1234 }];
|
|
199
|
-
const financials = { ...emptyFinancials(), quote: { symbol: "TEST", currency: "USD", price: 1, change: 0, changePercent: 0, lastUpdated: Date.parse("2026-01-15"), instrumentType }, priceHistory: history };
|
|
200
|
-
const provider = createTestDataProvider({
|
|
201
|
-
getQuote: async () => financials.quote,
|
|
202
|
-
getTickerFinancials: async () => financials,
|
|
203
|
-
getPriceHistory: async () => history,
|
|
204
|
-
getPriceHistoryForResolution: async () => history,
|
|
205
|
-
});
|
|
206
|
-
const result = await resolveChartSpecData(chartSpec({
|
|
207
|
-
viewport: { range: "1M", resolution: "1d" },
|
|
208
|
-
series: [chartSeries({ id: "direct", source: { kind: "security", instrument: { symbol: "TEST" }, fieldId: "market.volume" } }), chartSeries({ id: "price", source: { kind: "security", instrument: { symbol: "TEST" }, fieldId: "market.close" } })],
|
|
209
|
-
studies: [{ id: "volume", kind: "volume", inputSeriesIds: ["price"], parameters: {}, panelId: "main", axis: "left" }],
|
|
210
|
-
}), { dataProvider: provider, loadFredSeries: async () => fredLoad(), now: new Date("2026-01-16") });
|
|
211
|
-
for (const id of ["direct", "volume"]) {
|
|
212
|
-
expect(result.series.find((entry) => entry.id === id)?.unit).toBe(expectedUnit);
|
|
213
|
-
expect(result.series.find((entry) => entry.id === id)?.points.map((point) => point.value)).toEqual([1234]);
|
|
214
|
-
}
|
|
215
|
-
expect(result.warnings.some((warning) => warning.includes("Volume unit unknown"))).toBe(!expectedUnit);
|
|
216
|
-
}
|
|
217
|
-
});
|
|
218
|
-
|
|
219
|
-
test("cached history honors the visible date range before the network resolves", () => {
|
|
220
|
-
const source = { kind: "security" as const, instrument: { symbol: "TEST", exchange: "NASDAQ" }, fieldId: "market.close" };
|
|
221
|
-
const history = ["2021-01-01", "2026-08-01", "2026-08-15", "2026-09-10"].map((day, i) => ({
|
|
222
|
-
date: new Date(`${day}T00:00:00Z`), close: 100 + i, volume: 1_000 + i,
|
|
223
|
-
}));
|
|
224
|
-
const seeded = seedChartResolutionResult(chartSpec({
|
|
225
|
-
viewport: { range: "1M", resolution: "auto" },
|
|
226
|
-
series: [chartSeries({ source, transform: "percent" })],
|
|
227
|
-
}), new Map([[chartQuoteOverrideKeyForSource(source), history]]));
|
|
228
|
-
expect(seeded?.viewport?.start.toISOString()).toBe("2026-08-10T00:00:00.000Z");
|
|
229
|
-
expect(seeded?.viewport?.end.toISOString()).toBe("2026-09-10T00:00:00.000Z");
|
|
230
|
-
expect(seeded?.series[0]?.points.map((p) => p.date.toISOString().slice(0, 10))).toEqual(["2026-08-15", "2026-09-10"]);
|
|
231
|
-
expect(seeded?.series[0]?.points[0]?.value).toBe(0);
|
|
232
|
-
expect(seeded?.bufferedSeries?.[0]?.points).toHaveLength(4);
|
|
233
|
-
});
|
|
234
|
-
|
|
235
|
-
test("a point-limited seed exposes a viewport only for an explicit date window", () => {
|
|
236
|
-
const source = { kind: "security" as const, instrument: { symbol: "TEST", exchange: "NASDAQ" }, fieldId: "market.close" };
|
|
237
|
-
const history = ["2026-08-01", "2026-08-15", "2026-09-10"].map((day, index) => ({
|
|
238
|
-
date: new Date(`${day}T00:00:00Z`), close: 100 + index,
|
|
239
|
-
}));
|
|
240
|
-
const cached = new Map([[chartQuoteOverrideKeyForSource(source), history]]);
|
|
241
|
-
const spec = chartSpec({ viewport: { range: "1Y", resolution: "auto", maxPoints: 2 }, series: [chartSeries({ source })] });
|
|
242
|
-
const seed = seedChartResolutionResult(spec, cached);
|
|
243
|
-
expect(seed?.series[0]?.points).toHaveLength(2);
|
|
244
|
-
expect(seed?.viewport).toBeUndefined();
|
|
245
|
-
expect(seed?.bufferedSeries).toBeUndefined();
|
|
246
|
-
const explicit = seedChartResolutionResult({ ...spec, viewport: {
|
|
247
|
-
...spec.viewport, dateWindow: { start: "2026-08-01", end: "2026-09-10" },
|
|
248
|
-
} }, cached);
|
|
249
|
-
expect(explicit?.viewport?.start.toISOString()).toBe("2026-08-01T00:00:00.000Z");
|
|
250
|
-
expect(explicit?.viewport?.end.toISOString()).toBe("2026-09-10T23:59:59.999Z");
|
|
251
|
-
});
|
|
252
|
-
|
|
253
|
-
test("stale cached observations cannot move a current preset window into the past", () => {
|
|
254
|
-
const source = { kind: "security" as const, instrument: { symbol: "TEST" }, fieldId: "market.close" };
|
|
255
|
-
const cached = new Map([[chartQuoteOverrideKeyForSource(source), [{ date: new Date("2026-08-31T00:00:00Z"), close: 100 }]]]);
|
|
256
|
-
const result = seedChartResolutionResult(chartSpec({ viewport: { range: "1M", resolution: "auto" },
|
|
257
|
-
series: [chartSeries({ source })] }), cached, new Date("2026-09-10T18:00:00Z"));
|
|
258
|
-
expect(result?.viewport).toEqual({ start: new Date("2026-08-10T18:00:00Z"), end: new Date("2026-09-10T18:00:00Z") });
|
|
259
|
-
});
|
|
260
|
-
|
|
261
|
-
test("keeps study output over the whole buffered history its base series carries", async () => {
|
|
262
|
-
const history = Array.from({ length: 900 }, (_, day) => {
|
|
263
|
-
const date = new Date(Date.UTC(2024, 0, 1) + day * 86_400_000);
|
|
264
|
-
return date.getUTCDay() === 0 || date.getUTCDay() === 6
|
|
265
|
-
? null
|
|
266
|
-
: { date, open: 100, high: 101, low: 99, close: 100 + (day % 7), volume: 1_000 + day };
|
|
267
|
-
}).filter((point): point is NonNullable<typeof point> => point !== null);
|
|
268
|
-
const provider = createTestDataProvider({
|
|
269
|
-
getTickerFinancials: async () => emptyFinancials(),
|
|
270
|
-
getChartResolutionSupport: () => [{ resolution: "1d", maxRange: "ALL" }],
|
|
271
|
-
getPriceHistoryForResolution: async () => history,
|
|
272
|
-
getDetailedPriceHistory: async () => history,
|
|
273
|
-
});
|
|
274
|
-
const spec: ChartSpec = chartSpec({
|
|
275
|
-
viewport: { range: "1Y", resolution: "1d" },
|
|
276
|
-
panels: [{ id: "main" }, { id: "volume", label: "Volume", height: 0.24 }],
|
|
277
|
-
series: [chartSeries({
|
|
278
|
-
source: {
|
|
279
|
-
kind: "security",
|
|
280
|
-
instrument: { symbol: "TEST", exchange: "NASDAQ" },
|
|
281
|
-
fieldId: "market.close",
|
|
282
|
-
},
|
|
283
|
-
})],
|
|
284
|
-
studies: [{
|
|
285
|
-
id: "volume",
|
|
286
|
-
kind: "volume",
|
|
287
|
-
inputSeriesIds: ["price"],
|
|
288
|
-
parameters: {},
|
|
289
|
-
panelId: "volume",
|
|
290
|
-
axis: "left",
|
|
291
|
-
}],
|
|
292
|
-
});
|
|
293
|
-
const sources = {
|
|
294
|
-
dataProvider: provider,
|
|
295
|
-
now: new Date("2026-06-15T00:00:00.000Z"),
|
|
296
|
-
loadFredSeries: async () => fredLoad(),
|
|
297
|
-
};
|
|
298
|
-
const cache = new ChartResolveCache();
|
|
299
|
-
|
|
300
|
-
await resolveChartSpecData(spec, sources, cache);
|
|
301
|
-
// Panning back accumulates older bars into the buffer. The study has to
|
|
302
|
-
// follow, or it empties out wherever the base series has already been.
|
|
303
|
-
const panned = await resolveChartSpecData(spec, sources, cache, {
|
|
304
|
-
requestViewport: {
|
|
305
|
-
start: new Date("2024-02-01T00:00:00.000Z"),
|
|
306
|
-
end: new Date("2024-08-01T00:00:00.000Z"),
|
|
307
|
-
},
|
|
308
|
-
});
|
|
309
|
-
|
|
310
|
-
const span = (id: string) => {
|
|
311
|
-
const entry = panned.bufferedSeries?.find((candidate) => candidate.id === id);
|
|
312
|
-
return entry && entry.points.length > 0
|
|
313
|
-
? {
|
|
314
|
-
first: entry.points[0]!.date.toISOString(),
|
|
315
|
-
last: entry.points.at(-1)!.date.toISOString(),
|
|
316
|
-
}
|
|
317
|
-
: null;
|
|
318
|
-
};
|
|
319
|
-
expect(span("volume")).toEqual(span("price"));
|
|
320
|
-
});
|
|
321
|
-
|
|
322
|
-
test("routes futures and Treasury aliases through the existing market and FRED pipelines", async () => {
|
|
323
|
-
const marketRequests: string[] = [];
|
|
324
|
-
const fredRequests: string[] = [];
|
|
325
|
-
const provider = createTestDataProvider({
|
|
326
|
-
getTickerFinancials: async () => emptyFinancials(),
|
|
327
|
-
getPriceHistoryForResolution: async (symbol) => {
|
|
328
|
-
marketRequests.push(symbol);
|
|
329
|
-
return [{ date: new Date("2026-02-01T00:00:00Z"), close: 6_100 }];
|
|
330
|
-
},
|
|
331
|
-
});
|
|
332
|
-
|
|
333
|
-
const result = await resolveChartSpecData(
|
|
334
|
-
buildCustomChartPreset("FUT:ES, UST:10Y"),
|
|
335
|
-
{
|
|
336
|
-
dataProvider: provider,
|
|
337
|
-
now: new Date("2026-03-01T00:00:00Z"),
|
|
338
|
-
loadFredSeries: async ({ seriesId }) => {
|
|
339
|
-
fredRequests.push(seriesId);
|
|
340
|
-
return fredLoad({
|
|
341
|
-
observations: [{ date: "2026-02-01", value: 4.25 }],
|
|
342
|
-
info: null,
|
|
343
|
-
});
|
|
344
|
-
},
|
|
345
|
-
},
|
|
346
|
-
);
|
|
347
|
-
|
|
348
|
-
expect(result.errors).toEqual([]);
|
|
349
|
-
expect(marketRequests).toEqual(["ES=F"]);
|
|
350
|
-
expect(fredRequests).toEqual(["DGS10"]);
|
|
351
|
-
expect(result.series.map((series) => series.points[0]?.value ?? series.points[0]?.close))
|
|
352
|
-
.toEqual([6_100, 4.25]);
|
|
353
|
-
});
|
|
354
|
-
|
|
355
|
-
test("keeps missing capability series visible with a useful error and resolves them through the injected boundary", async () => {
|
|
356
|
-
const spec: ChartSpec = chartSpec({
|
|
357
|
-
viewport: { range: "1M", resolution: "auto" },
|
|
358
|
-
series: [chartSeries({
|
|
359
|
-
id: "plugin-series",
|
|
360
|
-
source: { kind: "capability", capabilityId: "charts.test", seriesId: "one" },
|
|
361
|
-
style: "area",
|
|
362
|
-
axis: "auto",
|
|
363
|
-
})],
|
|
364
|
-
});
|
|
365
|
-
const sources = { dataProvider: null, loadFredSeries: async () => fredLoad(), now: new Date("2026-02-01") };
|
|
366
|
-
const missing = await resolveChartSpecData(spec, sources);
|
|
367
|
-
expect(missing.series).toHaveLength(1);
|
|
368
|
-
expect(missing.series[0]?.points).toEqual([]);
|
|
369
|
-
expect(missing.errors[0]).toContain('Chart series capability "charts.test" is unavailable');
|
|
370
|
-
|
|
371
|
-
const resolved = await resolveChartSpecData(spec, {
|
|
372
|
-
...sources,
|
|
373
|
-
resolveCapabilitySeries: async () => ({
|
|
374
|
-
id: "provider-id",
|
|
375
|
-
label: "Provider Label",
|
|
376
|
-
color: "#fff",
|
|
377
|
-
unit: "value",
|
|
378
|
-
unitGroup: "value",
|
|
379
|
-
nativeFrequency: "daily",
|
|
380
|
-
dataShape: "scalar",
|
|
381
|
-
style: "line",
|
|
382
|
-
transform: "raw",
|
|
383
|
-
axis: "left",
|
|
384
|
-
panelId: "provider",
|
|
385
|
-
interpolation: "none",
|
|
386
|
-
points: [{ date: new Date("2026-01-15"), observedAt: new Date("2026-01-15"), value: 42 }],
|
|
387
|
-
}),
|
|
388
|
-
});
|
|
389
|
-
expect(resolved.errors).toEqual([]);
|
|
390
|
-
expect(resolved.series[0]).toMatchObject({ id: "plugin-series", style: "area", panelId: "main" });
|
|
391
|
-
expect(resolved.series[0]?.points[0]?.value).toBe(42);
|
|
392
|
-
});
|
|
393
|
-
|
|
394
|
-
test("resolves capability coverage for each effective panned viewport and caches by structured bounds", async () => {
|
|
395
|
-
const spec: ChartSpec = chartSpec({
|
|
396
|
-
viewport: { range: "1M", resolution: "auto" },
|
|
397
|
-
series: [chartSeries({
|
|
398
|
-
id: "plugin-series",
|
|
399
|
-
source: { kind: "capability", capabilityId: "charts.test", seriesId: "provider/series" },
|
|
400
|
-
})],
|
|
401
|
-
});
|
|
402
|
-
const requested: ChartSpec["viewport"][] = [];
|
|
403
|
-
const cache = new ChartResolveCache();
|
|
404
|
-
const sources = {
|
|
405
|
-
dataProvider: null,
|
|
406
|
-
loadFredSeries: async () => fredLoad(),
|
|
407
|
-
now: new Date("2026-03-01T00:00:00.000Z"),
|
|
408
|
-
resolveCapabilitySeries: async (_source: any, viewport: ChartSpec["viewport"]) => {
|
|
409
|
-
requested.push(viewport);
|
|
410
|
-
const date = new Date(viewport.dateWindow!.start);
|
|
411
|
-
return {
|
|
412
|
-
id: "provider",
|
|
413
|
-
label: "Provider",
|
|
414
|
-
color: "#ffffff",
|
|
415
|
-
unit: "value",
|
|
416
|
-
unitGroup: "value",
|
|
417
|
-
nativeFrequency: "daily" as const,
|
|
418
|
-
dataShape: "scalar" as const,
|
|
419
|
-
style: "line" as const,
|
|
420
|
-
transform: "raw" as const,
|
|
421
|
-
axis: "left" as const,
|
|
422
|
-
panelId: "main",
|
|
423
|
-
interpolation: "none" as const,
|
|
424
|
-
points: [{ date, observedAt: date, value: 1 }],
|
|
425
|
-
};
|
|
426
|
-
},
|
|
427
|
-
};
|
|
428
|
-
const firstViewport = { start: new Date("2026-01-01T00:00:00.000Z"), end: new Date("2026-01-08T00:00:00.000Z") };
|
|
429
|
-
const secondViewport = { start: new Date("2026-02-01T00:00:00.000Z"), end: new Date("2026-02-08T00:00:00.000Z") };
|
|
430
|
-
|
|
431
|
-
await resolveChartSpecData(spec, sources, cache, { requestViewport: firstViewport });
|
|
432
|
-
const panned = await resolveChartSpecData(spec, sources, cache, { requestViewport: secondViewport });
|
|
433
|
-
await resolveChartSpecData(spec, sources, cache, { requestViewport: firstViewport });
|
|
434
|
-
|
|
435
|
-
expect(panned.series[0]?.points[0]?.date.toISOString()).toBe(secondViewport.start.toISOString());
|
|
436
|
-
expect(panned.viewport).toEqual(secondViewport);
|
|
437
|
-
expect(requested.map((viewport) => viewport.dateWindow)).toEqual([
|
|
438
|
-
{ start: firstViewport.start.toISOString(), end: firstViewport.end.toISOString() },
|
|
439
|
-
{ start: secondViewport.start.toISOString(), end: secondViewport.end.toISOString() },
|
|
440
|
-
]);
|
|
441
|
-
expect(chartSeriesSourceKey({ kind: "capability", capabilityId: "a", seriesId: "b:c" }))
|
|
442
|
-
.not.toBe(chartSeriesSourceKey({ kind: "capability", capabilityId: "a-b", seriesId: "c" }));
|
|
443
|
-
});
|
|
444
|
-
|
|
445
|
-
test("derives Auto fetch resolution from the finest explicit market period", async () => {
|
|
446
|
-
const cases = [
|
|
447
|
-
{ range: "ALL" as const, periods: ["daily", "monthly"] as const, expected: "1d" },
|
|
448
|
-
{ range: "ALL" as const, periods: ["weekly", "monthly"] as const, expected: "1wk" },
|
|
449
|
-
{ range: "1Y" as const, periods: ["monthly"] as const, expected: "1d" },
|
|
450
|
-
];
|
|
451
|
-
|
|
452
|
-
for (const scenario of cases) {
|
|
453
|
-
const requestedResolutions: string[] = [];
|
|
454
|
-
const provider = createTestDataProvider({
|
|
455
|
-
getTickerFinancials: async () => emptyFinancials(),
|
|
456
|
-
getPriceHistoryForResolution: async (_symbol, _exchange, _range, resolution) => {
|
|
457
|
-
requestedResolutions.push(resolution);
|
|
458
|
-
return [{ date: new Date("2025-01-07T16:00:00Z"), close: 100 }];
|
|
459
|
-
},
|
|
460
|
-
});
|
|
461
|
-
const spec: ChartSpec = chartSpec({
|
|
462
|
-
viewport: { range: scenario.range, resolution: "auto" },
|
|
463
|
-
series: scenario.periods.map((period, index) => (chartSeries({
|
|
464
|
-
id: `price-${index}`,
|
|
465
|
-
source: {
|
|
466
|
-
kind: "security" as const,
|
|
467
|
-
instrument: { symbol: `TEST${index}` },
|
|
468
|
-
fieldId: "market.close",
|
|
469
|
-
period,
|
|
470
|
-
},
|
|
471
|
-
style: "line" as const,
|
|
472
|
-
transform: "raw" as const,
|
|
473
|
-
axis: "left" as const,
|
|
474
|
-
interpolation: "none" as const,
|
|
475
|
-
}))),
|
|
476
|
-
});
|
|
477
|
-
|
|
478
|
-
const result = await resolveChartSpecData(spec, {
|
|
479
|
-
dataProvider: provider,
|
|
480
|
-
now: new Date("2025-01-08T00:00:00Z"),
|
|
481
|
-
loadFredSeries: async () => fredLoad(),
|
|
482
|
-
});
|
|
483
|
-
|
|
484
|
-
expect(result.errors).toEqual([]);
|
|
485
|
-
expect(new Set(requestedResolutions)).toEqual(new Set([scenario.expected]));
|
|
486
|
-
}
|
|
487
|
-
});
|
|
488
|
-
|
|
489
|
-
test("skips financials and broker resolution support for ohlcv charts with an exchange", async () => {
|
|
490
|
-
let financialCalls = 0;
|
|
491
|
-
let resolveSupport: (() => void) | null = null;
|
|
492
|
-
const supportGate = new Promise<void>((resolve) => {
|
|
493
|
-
resolveSupport = resolve;
|
|
494
|
-
});
|
|
495
|
-
const provider = createTestDataProvider({
|
|
496
|
-
getTickerFinancials: async () => {
|
|
497
|
-
financialCalls += 1;
|
|
498
|
-
return emptyFinancials();
|
|
499
|
-
},
|
|
500
|
-
getChartResolutionSupport: async () => {
|
|
501
|
-
await supportGate;
|
|
502
|
-
return [{ resolution: "1d" as const, maxRange: "5Y" as const }];
|
|
503
|
-
},
|
|
504
|
-
getPriceHistoryForResolution: async () => [
|
|
505
|
-
{ date: new Date("2025-01-07T16:00:00Z"), close: 100 },
|
|
506
|
-
],
|
|
507
|
-
});
|
|
508
|
-
const spec: ChartSpec = chartSpec({
|
|
509
|
-
viewport: { range: "5Y", resolution: "auto" },
|
|
510
|
-
series: [chartSeries({
|
|
511
|
-
source: {
|
|
512
|
-
kind: "security",
|
|
513
|
-
instrument: { symbol: "TEST", exchange: "NASDAQ" },
|
|
514
|
-
fieldId: "market.ohlcv",
|
|
515
|
-
},
|
|
516
|
-
style: "candles",
|
|
517
|
-
})],
|
|
518
|
-
});
|
|
519
|
-
|
|
520
|
-
const result = await Promise.race([
|
|
521
|
-
resolveChartSpecData(spec, {
|
|
522
|
-
dataProvider: provider,
|
|
523
|
-
now: new Date("2025-01-08T00:00:00Z"),
|
|
524
|
-
loadFredSeries: async () => fredLoad(),
|
|
525
|
-
}),
|
|
526
|
-
new Promise<never>((_, reject) => {
|
|
527
|
-
setTimeout(() => reject(new Error("hung waiting for broker resolution support")), 200);
|
|
528
|
-
}),
|
|
529
|
-
]);
|
|
530
|
-
|
|
531
|
-
expect(financialCalls).toBe(0);
|
|
532
|
-
expect(result.errors).toEqual([]);
|
|
533
|
-
expect(result.series[0]?.points).toHaveLength(1);
|
|
534
|
-
resolveSupport?.();
|
|
535
|
-
});
|
|
536
|
-
|
|
537
|
-
test("does not relabel provider-default history as a manually requested resolution", async () => {
|
|
538
|
-
let genericHistoryCalls = 0;
|
|
539
|
-
const provider = createTestDataProvider({
|
|
540
|
-
getTickerFinancials: async () => emptyFinancials(),
|
|
541
|
-
getPriceHistoryForResolution: async () => [],
|
|
542
|
-
getPriceHistory: async () => {
|
|
543
|
-
genericHistoryCalls += 1;
|
|
544
|
-
return [{ date: new Date("2025-01-07T16:00:00Z"), close: 100 }];
|
|
545
|
-
},
|
|
546
|
-
});
|
|
547
|
-
const spec: ChartSpec = chartSpec({
|
|
548
|
-
viewport: { range: "1W", resolution: "5m" },
|
|
549
|
-
series: [chartSeries({
|
|
550
|
-
source: { kind: "security", instrument: { symbol: "TEST" }, fieldId: "market.close" },
|
|
551
|
-
})],
|
|
552
|
-
});
|
|
553
|
-
|
|
554
|
-
const result = await resolveChartSpecData(spec, {
|
|
555
|
-
dataProvider: provider,
|
|
556
|
-
now: new Date("2025-01-08T00:00:00Z"),
|
|
557
|
-
loadFredSeries: async () => fredLoad(),
|
|
558
|
-
});
|
|
559
|
-
|
|
560
|
-
expect(genericHistoryCalls).toBe(0);
|
|
561
|
-
// The series keeps its legend slot with no observations so the chart and the
|
|
562
|
-
// series editor agree on what the user added.
|
|
563
|
-
expect(result.series.map((entry) => [entry.id, entry.points.length])).toEqual([["price", 0]]);
|
|
564
|
-
expect(result.errors).toEqual([
|
|
565
|
-
"price: Requested 5m price history is unavailable for TEST. Choose Auto or a supported interval.",
|
|
566
|
-
]);
|
|
567
|
-
});
|
|
568
|
-
|
|
569
|
-
test("falls back from an unsupported manual interval while exposing source capabilities", async () => {
|
|
570
|
-
const requestedResolutions: string[] = [];
|
|
571
|
-
const provider = createTestDataProvider({
|
|
572
|
-
getTickerFinancials: async () => emptyFinancials(),
|
|
573
|
-
getChartResolutionSupport: () => [
|
|
574
|
-
{ resolution: "15m", maxRange: "1M" },
|
|
575
|
-
{ resolution: "1h", maxRange: "3M" },
|
|
576
|
-
],
|
|
577
|
-
getPriceHistoryForResolution: async (_symbol, _exchange, _range, resolution) => {
|
|
578
|
-
requestedResolutions.push(resolution);
|
|
579
|
-
return [{ date: new Date("2026-07-30T15:00:00Z"), close: 100 }];
|
|
580
|
-
},
|
|
581
|
-
});
|
|
582
|
-
const spec: ChartSpec = chartSpec({
|
|
583
|
-
viewport: { range: "1M", resolution: "45m" },
|
|
584
|
-
series: [chartSeries({
|
|
585
|
-
source: {
|
|
586
|
-
kind: "security",
|
|
587
|
-
instrument: { symbol: "TEST", exchange: "NASDAQ" },
|
|
588
|
-
fieldId: "market.close",
|
|
589
|
-
},
|
|
590
|
-
})],
|
|
591
|
-
});
|
|
592
|
-
|
|
593
|
-
const result = await resolveChartSpecData(spec, {
|
|
594
|
-
dataProvider: provider,
|
|
595
|
-
now: new Date("2026-07-30T16:00:00Z"),
|
|
596
|
-
loadFredSeries: async () => fredLoad(),
|
|
597
|
-
});
|
|
598
|
-
|
|
599
|
-
expect(requestedResolutions).toEqual(["15m"]);
|
|
600
|
-
expect(result.errors).toEqual([]);
|
|
601
|
-
expect(result.warnings).toContain(
|
|
602
|
-
"45M data is unavailable for this range. Auto resolution was used instead.",
|
|
603
|
-
);
|
|
604
|
-
expect(result.resolutionSupport).toEqual([
|
|
605
|
-
{ resolution: "15m", maxRange: "1M" },
|
|
606
|
-
{ resolution: "1h", maxRange: "3M" },
|
|
607
|
-
]);
|
|
608
|
-
});
|
|
609
|
-
|
|
610
|
-
test("picks a supported interval when the range preset is unsupported", async () => {
|
|
611
|
-
const requestedResolutions: string[] = [];
|
|
612
|
-
const provider = createTestDataProvider({
|
|
613
|
-
getTickerFinancials: async () => emptyFinancials(),
|
|
614
|
-
getChartResolutionSupport: () => [
|
|
615
|
-
{ resolution: "5m", maxRange: "1W" },
|
|
616
|
-
{ resolution: "15m", maxRange: "1M" },
|
|
617
|
-
{ resolution: "1h", maxRange: "3M" },
|
|
618
|
-
],
|
|
619
|
-
getPriceHistoryForResolution: async (_symbol, _exchange, _range, resolution) => {
|
|
620
|
-
requestedResolutions.push(resolution);
|
|
621
|
-
if (resolution === "1m") throw new Error("1m unsupported");
|
|
622
|
-
return [{ date: new Date("2026-07-30T15:00:00Z"), close: 100 }];
|
|
623
|
-
},
|
|
624
|
-
});
|
|
625
|
-
const series = chartSeries({
|
|
626
|
-
source: {
|
|
627
|
-
kind: "security",
|
|
628
|
-
instrument: { symbol: "NVDA", exchange: "XNAS" },
|
|
629
|
-
fieldId: "market.ohlcv",
|
|
630
|
-
},
|
|
631
|
-
style: "candles",
|
|
632
|
-
});
|
|
633
|
-
const sources = {
|
|
634
|
-
dataProvider: provider,
|
|
635
|
-
now: new Date("2026-07-30T16:00:00Z"),
|
|
636
|
-
loadFredSeries: async () => fredLoad(),
|
|
637
|
-
};
|
|
638
|
-
const cache = new ChartResolveCache();
|
|
639
|
-
|
|
640
|
-
// GIP opens on a hard 1m interval; the provider only serves 5m and coarser.
|
|
641
|
-
const manual = await resolveChartSpecData(
|
|
642
|
-
chartSpec({ viewport: { range: "1D", resolution: "1m" }, series: [series] }),
|
|
643
|
-
sources,
|
|
644
|
-
cache,
|
|
645
|
-
);
|
|
646
|
-
expect(manual.errors).toEqual([]);
|
|
647
|
-
expect(manual.warnings).toContain(
|
|
648
|
-
"1M data is unavailable for this range. Auto resolution was used instead.",
|
|
649
|
-
);
|
|
650
|
-
|
|
651
|
-
// The pane then flips the spec to Auto, reusing the same cache.
|
|
652
|
-
const auto = await resolveChartSpecData(
|
|
653
|
-
chartSpec({ viewport: { range: "1D", resolution: "auto" }, series: [series] }),
|
|
654
|
-
sources,
|
|
655
|
-
cache,
|
|
656
|
-
);
|
|
657
|
-
expect(auto.errors).toEqual([]);
|
|
658
|
-
expect(auto.resolution).toBe("5m");
|
|
659
|
-
expect(new Set(requestedResolutions)).toEqual(new Set(["5m"]));
|
|
660
|
-
});
|
|
661
|
-
|
|
662
|
-
test("price-only charts paint with a placeholder list, then adopt the source's real intervals", async () => {
|
|
663
|
-
let resolveSupport: ((value: Array<{ resolution: "1m" | "5m" | "30m" | "1d"; maxRange: "1W" | "1M" | "6M" | "5Y" }>) => void) | null = null;
|
|
664
|
-
const supportGate = new Promise<Array<{ resolution: "1m" | "5m" | "30m" | "1d"; maxRange: "1W" | "1M" | "6M" | "5Y" }>>((resolve) => {
|
|
665
|
-
resolveSupport = resolve;
|
|
666
|
-
});
|
|
667
|
-
const requestedResolutions: string[] = [];
|
|
668
|
-
const provider = createTestDataProvider({
|
|
669
|
-
getTickerFinancials: async () => emptyFinancials(),
|
|
670
|
-
getChartResolutionSupport: () => supportGate,
|
|
671
|
-
getPriceHistoryForResolution: async (_symbol, _exchange, _range, resolution) => {
|
|
672
|
-
requestedResolutions.push(resolution);
|
|
673
|
-
return [{ date: new Date("2026-07-30T15:00:00Z"), close: 100 }];
|
|
674
|
-
},
|
|
675
|
-
});
|
|
676
|
-
const spec = chartSpec({
|
|
677
|
-
viewport: { range: "1D", resolution: "auto" },
|
|
678
|
-
series: [chartSeries({
|
|
679
|
-
source: { kind: "security", instrument: { symbol: "NVDA", exchange: "XNAS" }, fieldId: "market.ohlcv" },
|
|
680
|
-
style: "candles",
|
|
681
|
-
})],
|
|
682
|
-
});
|
|
683
|
-
const sources = {
|
|
684
|
-
dataProvider: provider,
|
|
685
|
-
now: new Date("2026-07-30T16:00:00Z"),
|
|
686
|
-
loadFredSeries: async () => fredLoad(),
|
|
687
|
-
};
|
|
688
|
-
const cache = new ChartResolveCache();
|
|
689
|
-
let settledNotifications = 0;
|
|
690
|
-
|
|
691
|
-
const first = await resolveChartSpecData(spec, sources, cache, {
|
|
692
|
-
onResolutionSupportSettled: () => { settledNotifications += 1; },
|
|
693
|
-
});
|
|
694
|
-
// The placeholder omits 1m, but it must not talk Auto out of the 1D preset.
|
|
695
|
-
expect(first.errors).toEqual([]);
|
|
696
|
-
expect(first.resolution).toBe("1m");
|
|
697
|
-
expect(first.resolutionSupport?.map((entry) => entry.resolution)).toEqual(["5m", "15m", "1h", "1d", "1wk", "1mo"]);
|
|
698
|
-
expect(settledNotifications).toBe(0);
|
|
699
|
-
|
|
700
|
-
resolveSupport!([
|
|
701
|
-
{ resolution: "1m", maxRange: "1W" },
|
|
702
|
-
{ resolution: "5m", maxRange: "1M" },
|
|
703
|
-
{ resolution: "30m", maxRange: "6M" },
|
|
704
|
-
{ resolution: "1d", maxRange: "5Y" },
|
|
705
|
-
]);
|
|
706
|
-
await supportGate;
|
|
707
|
-
await new Promise((resolve) => setTimeout(resolve, 0));
|
|
708
|
-
expect(settledNotifications).toBe(1);
|
|
709
|
-
|
|
710
|
-
const second = await resolveChartSpecData(spec, sources, cache, {
|
|
711
|
-
onResolutionSupportSettled: () => { settledNotifications += 1; },
|
|
712
|
-
});
|
|
713
|
-
expect(second.resolution).toBe("1m");
|
|
714
|
-
expect(second.resolutionSupport?.map((entry) => entry.resolution)).toEqual(["1m", "5m", "30m", "1d"]);
|
|
715
|
-
expect(settledNotifications).toBe(1);
|
|
716
|
-
expect(new Set(requestedResolutions)).toEqual(new Set(["1m"]));
|
|
717
|
-
});
|
|
718
|
-
|
|
719
|
-
test("one-shot loaders wait for the real interval list", async () => {
|
|
720
|
-
const provider = createTestDataProvider({
|
|
721
|
-
getTickerFinancials: async () => emptyFinancials(),
|
|
722
|
-
getChartResolutionSupport: async () => [
|
|
723
|
-
{ resolution: "5m" as const, maxRange: "1W" as const },
|
|
724
|
-
{ resolution: "1d" as const, maxRange: "5Y" as const },
|
|
725
|
-
],
|
|
726
|
-
getPriceHistoryForResolution: async () => [{ date: new Date("2026-07-30T15:00:00Z"), close: 100 }],
|
|
727
|
-
});
|
|
728
|
-
const spec = chartSpec({
|
|
729
|
-
viewport: { range: "1D", resolution: "auto" },
|
|
730
|
-
series: [chartSeries({
|
|
731
|
-
source: { kind: "security", instrument: { symbol: "NVDA", exchange: "XNAS" }, fieldId: "market.ohlcv" },
|
|
732
|
-
style: "candles",
|
|
733
|
-
})],
|
|
734
|
-
});
|
|
735
|
-
const result = await resolveChartSpecData(spec, {
|
|
736
|
-
dataProvider: provider,
|
|
737
|
-
now: new Date("2026-07-30T16:00:00Z"),
|
|
738
|
-
loadFredSeries: async () => fredLoad(),
|
|
739
|
-
}, undefined, { awaitResolutionSupport: true });
|
|
740
|
-
expect(result.resolution).toBe("5m");
|
|
741
|
-
expect(result.resolutionSupport?.map((entry) => entry.resolution)).toEqual(["5m", "1d"]);
|
|
742
|
-
});
|
|
743
|
-
|
|
744
|
-
test("a failed manual interval request does not poison the Auto retry", async () => {
|
|
745
|
-
let calls = 0;
|
|
746
|
-
const provider = createTestDataProvider({
|
|
747
|
-
getTickerFinancials: async () => emptyFinancials(),
|
|
748
|
-
getPriceHistoryForResolution: async () => {
|
|
749
|
-
calls += 1;
|
|
750
|
-
throw new Error("resolution api unsupported");
|
|
751
|
-
},
|
|
752
|
-
getPriceHistory: async () => [{ date: new Date("2026-07-30T15:00:00Z"), close: 100 }],
|
|
753
|
-
});
|
|
754
|
-
const series = chartSeries({
|
|
755
|
-
source: { kind: "security", instrument: { symbol: "TEST", exchange: "NASDAQ" }, fieldId: "market.close" },
|
|
756
|
-
});
|
|
757
|
-
const sources = {
|
|
758
|
-
dataProvider: provider,
|
|
759
|
-
now: new Date("2026-07-30T16:00:00Z"),
|
|
760
|
-
loadFredSeries: async () => fredLoad(),
|
|
761
|
-
};
|
|
762
|
-
const cache = new ChartResolveCache();
|
|
763
|
-
|
|
764
|
-
const manual = await resolveChartSpecData(
|
|
765
|
-
chartSpec({ viewport: { range: "1D", resolution: "1m" }, series: [series] }),
|
|
766
|
-
sources,
|
|
767
|
-
cache,
|
|
768
|
-
);
|
|
769
|
-
expect(manual.errors).toEqual([
|
|
770
|
-
"price: Requested 1m price history is unavailable for TEST:XNAS. Choose Auto or a supported interval.",
|
|
771
|
-
]);
|
|
772
|
-
|
|
773
|
-
const auto = await resolveChartSpecData(
|
|
774
|
-
chartSpec({ viewport: { range: "1D", resolution: "auto" }, series: [series] }),
|
|
775
|
-
sources,
|
|
776
|
-
cache,
|
|
777
|
-
);
|
|
778
|
-
expect(auto.errors).toEqual([]);
|
|
779
|
-
expect(auto.series[0]?.points).toHaveLength(1);
|
|
780
|
-
expect(calls).toBe(2);
|
|
781
|
-
});
|
|
782
|
-
|
|
783
|
-
test.each([
|
|
784
|
-
{ selected: "1wk", maxRange: "ALL", range: "ALL", expected: "1wk" },
|
|
785
|
-
{ selected: "1mo", maxRange: "ALL", range: "ALL", expected: "1mo" },
|
|
786
|
-
{ selected: "1wk", maxRange: "5Y", range: "ALL", expected: "1mo" },
|
|
787
|
-
{ selected: "5m", maxRange: "1W", range: "ALL", expected: "1mo" },
|
|
788
|
-
{ selected: "1wk", maxRange: "5Y", range: "1Y", expected: "1wk" },
|
|
789
|
-
] as const)("honors $selected/$range only within the provider's $maxRange limit", async ({ selected, maxRange, range, expected }) => {
|
|
790
|
-
const requests: string[] = [];
|
|
791
|
-
const provider = createTestDataProvider({
|
|
792
|
-
getTickerFinancials: async () => emptyFinancials(),
|
|
793
|
-
getChartResolutionSupport: () => [
|
|
794
|
-
{ resolution: selected, maxRange },
|
|
795
|
-
{ resolution: "1mo", maxRange: "ALL" },
|
|
796
|
-
],
|
|
797
|
-
getPriceHistoryForResolution: async (_symbol, _exchange, _range, resolution) => {
|
|
798
|
-
requests.push(resolution);
|
|
799
|
-
return [{ date: new Date("2026-08-03"), close: resolution === "1wk" ? 35 : 33 }];
|
|
800
|
-
},
|
|
801
|
-
});
|
|
802
|
-
const spec = chartSpec({
|
|
803
|
-
viewport: { range, resolution: selected },
|
|
804
|
-
series: [chartSeries({ source: {
|
|
805
|
-
kind: "security", instrument: { symbol: "TEST", exchange: "LSE" }, fieldId: "market.close",
|
|
806
|
-
} })],
|
|
807
|
-
});
|
|
808
|
-
const result = await resolveChartSpecData(spec, {
|
|
809
|
-
dataProvider: provider, now: new Date("2026-09-11"), loadFredSeries: async () => fredLoad(),
|
|
810
|
-
});
|
|
811
|
-
|
|
812
|
-
expect(requests).toEqual([expected]);
|
|
813
|
-
expect(result.resolution).toBe(expected);
|
|
814
|
-
expect(result.series[0]?.points.at(-1)?.value).toBe(expected === "1wk" ? 35 : 33);
|
|
815
|
-
expect(result.errors).toEqual([]);
|
|
816
|
-
expect(result.warnings.some((warning) => warning.includes("Auto resolution was used instead")))
|
|
817
|
-
.toBe(expected !== selected);
|
|
818
|
-
});
|
|
819
|
-
|
|
820
|
-
test.each(["ALL", "5Y"] as const)("checks explicit long date windows against the %s manual limit", async (maxRange) => {
|
|
821
|
-
const requests: string[] = [];
|
|
822
|
-
const provider = createTestDataProvider({
|
|
823
|
-
getTickerFinancials: async () => emptyFinancials(),
|
|
824
|
-
getChartResolutionSupport: () => [
|
|
825
|
-
{ resolution: "1wk", maxRange },
|
|
826
|
-
{ resolution: "1mo", maxRange: "ALL" },
|
|
827
|
-
],
|
|
828
|
-
getDetailedPriceHistory: async (_symbol, _exchange, _start, _end, resolution) => {
|
|
829
|
-
requests.push(resolution);
|
|
830
|
-
return [{ date: new Date("1997-07-01"), close: 10 }];
|
|
831
|
-
},
|
|
832
|
-
});
|
|
833
|
-
const spec = chartSpec({
|
|
834
|
-
viewport: { range: "ALL", resolution: "1wk", dateWindow: { start: "1997-01-01", end: "2026-09-11" } },
|
|
835
|
-
series: [chartSeries({ source: {
|
|
836
|
-
kind: "security", instrument: { symbol: "TEST", exchange: "LSE" }, fieldId: "market.close",
|
|
837
|
-
} })],
|
|
838
|
-
});
|
|
839
|
-
const result = await resolveChartSpecData(spec, {
|
|
840
|
-
dataProvider: provider, now: new Date("2026-09-11"), loadFredSeries: async () => fredLoad(),
|
|
841
|
-
});
|
|
842
|
-
expect(requests).toEqual([maxRange === "ALL" ? "1wk" : "1mo"]);
|
|
843
|
-
expect(result.errors).toEqual([]);
|
|
844
|
-
});
|
|
845
|
-
|
|
846
|
-
test("requires every comparison source to support the manual ALL interval", async () => {
|
|
847
|
-
const requests: string[] = [];
|
|
848
|
-
const provider = createTestDataProvider({
|
|
849
|
-
getTickerFinancials: async () => emptyFinancials(),
|
|
850
|
-
getChartResolutionSupport: (symbol) => [
|
|
851
|
-
{ resolution: "1wk", maxRange: symbol === "UNLIMITED" ? "ALL" : "5Y" },
|
|
852
|
-
{ resolution: "1mo", maxRange: "ALL" },
|
|
853
|
-
],
|
|
854
|
-
getPriceHistoryForResolution: async (symbol, _exchange, _range, resolution) => {
|
|
855
|
-
requests.push(`${symbol}:${resolution}`);
|
|
856
|
-
return [{ date: new Date("2026-08-03"), close: 33 }];
|
|
857
|
-
},
|
|
858
|
-
});
|
|
859
|
-
const spec = chartSpec({
|
|
860
|
-
viewport: { range: "ALL", resolution: "1wk" },
|
|
861
|
-
series: ["UNLIMITED", "LIMITED"].map((symbol) => chartSeries({ id: symbol, source: {
|
|
862
|
-
kind: "security", instrument: { symbol, exchange: "LSE" }, fieldId: "market.close",
|
|
863
|
-
} })),
|
|
864
|
-
});
|
|
865
|
-
const result = await resolveChartSpecData(spec, {
|
|
866
|
-
dataProvider: provider, now: new Date("2026-09-11"), loadFredSeries: async () => fredLoad(),
|
|
867
|
-
});
|
|
868
|
-
expect(requests.sort()).toEqual(["LIMITED:1mo", "UNLIMITED:1mo"]);
|
|
869
|
-
expect(result.resolution).toBe("1mo");
|
|
870
|
-
expect(result.resolutionSupport).toContainEqual({ resolution: "1wk", maxRange: "5Y" });
|
|
871
|
-
expect(result.warnings).toContain("1WK data is unavailable for this range. Auto resolution was used instead.");
|
|
872
|
-
});
|
|
873
|
-
|
|
874
|
-
test("keeps the snapshot exchange when a newer quote omits it", async () => {
|
|
875
|
-
const historyExchanges: string[] = [];
|
|
876
|
-
const source = {
|
|
877
|
-
kind: "security" as const,
|
|
878
|
-
instrument: { symbol: "SNDK" },
|
|
879
|
-
fieldId: "market.ohlcv",
|
|
880
|
-
};
|
|
881
|
-
const provider = createTestDataProvider({
|
|
882
|
-
getTickerFinancials: async () => ({
|
|
883
|
-
...emptyFinancials(),
|
|
884
|
-
quote: {
|
|
885
|
-
symbol: "SNDK",
|
|
886
|
-
price: 1_240,
|
|
887
|
-
currency: "USD",
|
|
888
|
-
change: 20,
|
|
889
|
-
changePercent: 1.64,
|
|
890
|
-
lastUpdated: Date.parse("2026-07-30T15:25:00Z"),
|
|
891
|
-
listingExchangeName: "XNAS",
|
|
892
|
-
},
|
|
893
|
-
}),
|
|
894
|
-
getPriceHistoryForResolution: async (_symbol, exchange) => {
|
|
895
|
-
historyExchanges.push(exchange);
|
|
896
|
-
return [{
|
|
897
|
-
date: new Date("2026-07-30T15:20:00Z"),
|
|
898
|
-
open: 1_235,
|
|
899
|
-
high: 1_242,
|
|
900
|
-
low: 1_233,
|
|
901
|
-
close: 1_240,
|
|
902
|
-
}];
|
|
903
|
-
},
|
|
904
|
-
});
|
|
905
|
-
const spec: ChartSpec = chartSpec({
|
|
906
|
-
viewport: { range: "1D", resolution: "5m" },
|
|
907
|
-
series: [{
|
|
908
|
-
id: "price",
|
|
909
|
-
source,
|
|
910
|
-
style: "candles",
|
|
911
|
-
transform: "raw",
|
|
912
|
-
axis: "left",
|
|
913
|
-
panelId: "main",
|
|
914
|
-
interpolation: "none",
|
|
915
|
-
}],
|
|
916
|
-
});
|
|
917
|
-
|
|
918
|
-
const result = await resolveChartSpecData(spec, {
|
|
919
|
-
dataProvider: provider,
|
|
920
|
-
now: new Date("2026-07-30T15:30:00Z"),
|
|
921
|
-
quoteOverrides: new Map([[
|
|
922
|
-
chartQuoteOverrideKeyForSource(source),
|
|
923
|
-
{
|
|
924
|
-
symbol: "SNDK",
|
|
925
|
-
price: 1_245,
|
|
926
|
-
currency: "USD",
|
|
927
|
-
change: 25,
|
|
928
|
-
changePercent: 2.05,
|
|
929
|
-
lastUpdated: Date.parse("2026-07-30T15:26:00Z"),
|
|
930
|
-
},
|
|
931
|
-
]]),
|
|
932
|
-
loadFredSeries: async () => fredLoad(),
|
|
933
|
-
});
|
|
934
|
-
|
|
935
|
-
expect(result.errors).toEqual([]);
|
|
936
|
-
expect(historyExchanges).toEqual(["XNAS"]);
|
|
937
|
-
// A formed bar is stamped at its opening, like the provider's bars.
|
|
938
|
-
expect(result.series[0]?.points.at(-1)?.date.toISOString())
|
|
939
|
-
.toBe("2026-07-30T15:25:00.000Z");
|
|
940
|
-
expect(result.series[0]?.timeBasis).toMatchObject({
|
|
941
|
-
kind: "market",
|
|
942
|
-
timeZone: "America/New_York",
|
|
943
|
-
cadenceMs: 5 * 60_000,
|
|
944
|
-
});
|
|
945
|
-
});
|
|
946
|
-
|
|
947
|
-
test("resolves the exchange before selecting an adaptive Auto resolution", async () => {
|
|
948
|
-
const supportExchanges: string[] = [];
|
|
949
|
-
const historyRequests: Array<{ exchange: string; resolution: string }> = [];
|
|
950
|
-
const provider = createTestDataProvider({
|
|
951
|
-
getTickerFinancials: async () => ({
|
|
952
|
-
...emptyFinancials(),
|
|
953
|
-
quote: {
|
|
954
|
-
symbol: "SNDK",
|
|
955
|
-
price: 1_240,
|
|
956
|
-
currency: "USD",
|
|
957
|
-
change: 20,
|
|
958
|
-
changePercent: 1.64,
|
|
959
|
-
lastUpdated: Date.parse("2026-07-30T15:25:00Z"),
|
|
960
|
-
listingExchangeName: "XNAS",
|
|
961
|
-
},
|
|
962
|
-
}),
|
|
963
|
-
getChartResolutionSupport: (_symbol, exchange) => {
|
|
964
|
-
supportExchanges.push(exchange);
|
|
965
|
-
return exchange === "XNAS"
|
|
966
|
-
? [{ resolution: "5m", maxRange: "1W" }]
|
|
967
|
-
: [{ resolution: "1d", maxRange: "5Y" }];
|
|
968
|
-
},
|
|
969
|
-
getDetailedPriceHistory: async (_symbol, exchange, _start, _end, resolution) => {
|
|
970
|
-
historyRequests.push({ exchange, resolution });
|
|
971
|
-
return [{ date: new Date("2026-07-30T15:20:00Z"), close: 1_240 }];
|
|
972
|
-
},
|
|
973
|
-
});
|
|
974
|
-
const spec: ChartSpec = chartSpec({
|
|
975
|
-
viewport: { range: "1D", resolution: "auto" },
|
|
976
|
-
series: [chartSeries({
|
|
977
|
-
source: {
|
|
978
|
-
kind: "security",
|
|
979
|
-
instrument: { symbol: "SNDK" },
|
|
980
|
-
fieldId: "market.close",
|
|
981
|
-
},
|
|
982
|
-
})],
|
|
983
|
-
});
|
|
984
|
-
|
|
985
|
-
const result = await resolveChartSpecData(
|
|
986
|
-
spec,
|
|
987
|
-
{
|
|
988
|
-
dataProvider: provider,
|
|
989
|
-
now: new Date("2026-07-30T15:30:00Z"),
|
|
990
|
-
loadFredSeries: async () => fredLoad(),
|
|
991
|
-
},
|
|
992
|
-
new ChartResolveCache(),
|
|
993
|
-
{
|
|
994
|
-
autoViewport: {
|
|
995
|
-
start: new Date("2026-07-30T09:30:00Z"),
|
|
996
|
-
end: new Date("2026-07-30T15:30:00Z"),
|
|
997
|
-
},
|
|
998
|
-
targetPointCount: 100,
|
|
999
|
-
},
|
|
1000
|
-
);
|
|
1001
|
-
|
|
1002
|
-
expect(result.errors).toEqual([]);
|
|
1003
|
-
expect(supportExchanges).toEqual(["XNAS"]);
|
|
1004
|
-
expect(historyRequests).toEqual([{ exchange: "XNAS", resolution: "5m" }]);
|
|
1005
|
-
});
|
|
1006
|
-
|
|
1007
|
-
test("uses provider-default history as a valid fallback for Auto resolution", async () => {
|
|
1008
|
-
let genericHistoryCalls = 0;
|
|
1009
|
-
const provider = createTestDataProvider({
|
|
1010
|
-
getTickerFinancials: async () => emptyFinancials(),
|
|
1011
|
-
getPriceHistoryForResolution: async () => {
|
|
1012
|
-
throw new Error("5m is unavailable");
|
|
1013
|
-
},
|
|
1014
|
-
getPriceHistory: async () => {
|
|
1015
|
-
genericHistoryCalls += 1;
|
|
1016
|
-
return [{ date: new Date("2025-01-07T16:00:00Z"), close: 100 }];
|
|
1017
|
-
},
|
|
1018
|
-
});
|
|
1019
|
-
const spec: ChartSpec = chartSpec({
|
|
1020
|
-
viewport: { range: "1W", resolution: "auto" },
|
|
1021
|
-
series: [chartSeries({
|
|
1022
|
-
source: { kind: "security", instrument: { symbol: "TEST" }, fieldId: "market.close" },
|
|
1023
|
-
})],
|
|
1024
|
-
});
|
|
1025
|
-
|
|
1026
|
-
const result = await resolveChartSpecData(spec, {
|
|
1027
|
-
dataProvider: provider,
|
|
1028
|
-
now: new Date("2025-01-08T00:00:00Z"),
|
|
1029
|
-
loadFredSeries: async () => fredLoad(),
|
|
1030
|
-
});
|
|
1031
|
-
|
|
1032
|
-
expect(genericHistoryCalls).toBe(1);
|
|
1033
|
-
expect(result.errors).toEqual([]);
|
|
1034
|
-
expect(result.series[0]?.points.map((point) => point.value)).toEqual([100]);
|
|
1035
|
-
});
|
|
1036
|
-
|
|
1037
|
-
test("clamps preload history to the provider limit without coarsening the visible interval", async () => {
|
|
1038
|
-
const requests: Array<{ range: string; resolution: string }> = [];
|
|
1039
|
-
const provider = createTestDataProvider({
|
|
1040
|
-
getTickerFinancials: async () => emptyFinancials(),
|
|
1041
|
-
getChartResolutionSupport: () => [{ resolution: "5m", maxRange: "1W" }],
|
|
1042
|
-
getPriceHistoryForResolution: async (_symbol, _exchange, range, resolution) => {
|
|
1043
|
-
requests.push({ range, resolution });
|
|
1044
|
-
return [{ date: new Date("2025-01-07T16:00:00Z"), close: 100 }];
|
|
1045
|
-
},
|
|
1046
|
-
});
|
|
1047
|
-
const spec: ChartSpec = chartSpec({
|
|
1048
|
-
viewport: { range: "1W", resolution: "auto" },
|
|
1049
|
-
series: [chartSeries({
|
|
1050
|
-
source: { kind: "security", instrument: { symbol: "TEST" }, fieldId: "market.close" },
|
|
1051
|
-
})],
|
|
1052
|
-
});
|
|
1053
|
-
|
|
1054
|
-
const result = await resolveChartSpecData(spec, {
|
|
1055
|
-
dataProvider: provider,
|
|
1056
|
-
now: new Date("2025-01-08T00:00:00Z"),
|
|
1057
|
-
loadFredSeries: async () => fredLoad(),
|
|
1058
|
-
});
|
|
1059
|
-
|
|
1060
|
-
expect(result.errors).toEqual([]);
|
|
1061
|
-
expect(requests).toEqual([{ range: "1W", resolution: "5m" }]);
|
|
1062
|
-
});
|
|
1063
|
-
|
|
1064
|
-
test("keeps Auto zoom selection while loading a separately panned history window", async () => {
|
|
1065
|
-
const detailedRequests: Array<{
|
|
1066
|
-
start: string;
|
|
1067
|
-
end: string;
|
|
1068
|
-
resolution: string;
|
|
1069
|
-
}> = [];
|
|
1070
|
-
const provider = createTestDataProvider({
|
|
1071
|
-
getTickerFinancials: async () => emptyFinancials(),
|
|
1072
|
-
getChartResolutionSupport: () => [
|
|
1073
|
-
{ resolution: "15m", maxRange: "1M" },
|
|
1074
|
-
{ resolution: "1h", maxRange: "6M" },
|
|
1075
|
-
{ resolution: "1d", maxRange: "5Y" },
|
|
1076
|
-
],
|
|
1077
|
-
getDetailedPriceHistory: async (_symbol, _exchange, start, end, resolution) => {
|
|
1078
|
-
detailedRequests.push({
|
|
1079
|
-
start: start.toISOString(),
|
|
1080
|
-
end: end.toISOString(),
|
|
1081
|
-
resolution,
|
|
1082
|
-
});
|
|
1083
|
-
return [{ date: new Date("2025-01-15T16:00:00.000Z"), close: 100 }];
|
|
1084
|
-
},
|
|
1085
|
-
});
|
|
1086
|
-
const spec: ChartSpec = chartSpec({
|
|
1087
|
-
viewport: { range: "3M", resolution: "auto" },
|
|
1088
|
-
series: [chartSeries({
|
|
1089
|
-
source: {
|
|
1090
|
-
kind: "security",
|
|
1091
|
-
instrument: { symbol: "TEST", exchange: "NASDAQ" },
|
|
1092
|
-
fieldId: "market.close",
|
|
1093
|
-
},
|
|
1094
|
-
})],
|
|
1095
|
-
});
|
|
1096
|
-
|
|
1097
|
-
const result = await resolveChartSpecData(
|
|
1098
|
-
spec,
|
|
1099
|
-
{
|
|
1100
|
-
dataProvider: provider,
|
|
1101
|
-
now: new Date("2025-04-01T00:00:00.000Z"),
|
|
1102
|
-
loadFredSeries: async () => fredLoad(),
|
|
1103
|
-
},
|
|
1104
|
-
new ChartResolveCache(),
|
|
1105
|
-
{
|
|
1106
|
-
autoViewport: {
|
|
1107
|
-
start: new Date("2025-03-10T00:00:00.000Z"),
|
|
1108
|
-
end: new Date("2025-03-17T00:00:00.000Z"),
|
|
1109
|
-
},
|
|
1110
|
-
requestViewport: {
|
|
1111
|
-
start: new Date("2025-01-10T00:00:00.000Z"),
|
|
1112
|
-
end: new Date("2025-01-17T00:00:00.000Z"),
|
|
1113
|
-
},
|
|
1114
|
-
targetPointCount: 100,
|
|
1115
|
-
},
|
|
1116
|
-
);
|
|
1117
|
-
|
|
1118
|
-
expect(spec.viewport.resolution).toBe("auto");
|
|
1119
|
-
expect(detailedRequests).toHaveLength(1);
|
|
1120
|
-
expect(detailedRequests[0]?.resolution).toBe("15m");
|
|
1121
|
-
expect(detailedRequests[0]?.end).toBe("2025-01-17T00:00:00.001Z");
|
|
1122
|
-
expect(result.viewport?.start.toISOString()).toBe("2025-01-10T00:00:00.000Z");
|
|
1123
|
-
expect(result.viewport?.end.toISOString()).toBe("2025-01-17T00:00:00.000Z");
|
|
1124
|
-
expect(result.series[0]?.timeBasis).toMatchObject({
|
|
1125
|
-
kind: "market",
|
|
1126
|
-
timeZone: "America/New_York",
|
|
1127
|
-
cadenceMs: 15 * 60 * 1_000,
|
|
1128
|
-
});
|
|
1129
|
-
});
|
|
1130
|
-
|
|
1131
|
-
test("accumulates historical windows without replacing the current tail", async () => {
|
|
1132
|
-
const detailedRequests: Array<{ start: string; end: string }> = [];
|
|
1133
|
-
const currentHistory = [
|
|
1134
|
-
{ date: "2026-01-02T16:00:00.000Z" as unknown as Date, close: 110 },
|
|
1135
|
-
{ date: new Date("2026-07-30T16:00:00.000Z"), close: 120 },
|
|
1136
|
-
];
|
|
1137
|
-
const historicalHistory = [
|
|
1138
|
-
{ date: new Date("2024-08-01T16:00:00.000Z"), close: 90 },
|
|
1139
|
-
{ date: new Date("2025-07-29T16:00:00.000Z"), close: 100 },
|
|
1140
|
-
];
|
|
1141
|
-
const provider = createTestDataProvider({
|
|
1142
|
-
getTickerFinancials: async () => emptyFinancials(),
|
|
1143
|
-
getChartResolutionSupport: () => [
|
|
1144
|
-
{ resolution: "1h", maxRange: "1Y" },
|
|
1145
|
-
{ resolution: "1d", maxRange: "ALL" },
|
|
1146
|
-
],
|
|
1147
|
-
getPriceHistoryForResolution: async () => currentHistory,
|
|
1148
|
-
getDetailedPriceHistory: async (_symbol, _exchange, start, end) => {
|
|
1149
|
-
detailedRequests.push({
|
|
1150
|
-
start: start.toISOString(),
|
|
1151
|
-
end: end.toISOString(),
|
|
1152
|
-
});
|
|
1153
|
-
return historicalHistory;
|
|
1154
|
-
},
|
|
1155
|
-
});
|
|
1156
|
-
const spec: ChartSpec = chartSpec({
|
|
1157
|
-
viewport: { range: "1Y", resolution: "1h" },
|
|
1158
|
-
series: [chartSeries({
|
|
1159
|
-
source: {
|
|
1160
|
-
kind: "security",
|
|
1161
|
-
instrument: { symbol: "TEST", exchange: "NASDAQ" },
|
|
1162
|
-
fieldId: "market.close",
|
|
1163
|
-
},
|
|
1164
|
-
})],
|
|
1165
|
-
});
|
|
1166
|
-
const sources = {
|
|
1167
|
-
dataProvider: provider,
|
|
1168
|
-
now: new Date("2026-07-30T16:00:00.000Z"),
|
|
1169
|
-
loadFredSeries: async () => fredLoad(),
|
|
1170
|
-
};
|
|
1171
|
-
const cache = new ChartResolveCache();
|
|
1172
|
-
|
|
1173
|
-
const current = await resolveChartSpecData(spec, sources, cache);
|
|
1174
|
-
const historical = await resolveChartSpecData(spec, sources, cache, {
|
|
1175
|
-
requestViewport: {
|
|
1176
|
-
start: new Date("2024-07-30T16:00:00.000Z"),
|
|
1177
|
-
end: new Date("2025-07-30T16:00:00.000Z"),
|
|
1178
|
-
},
|
|
1179
|
-
});
|
|
1180
|
-
const revisitedCurrent = await resolveChartSpecData(spec, sources, cache);
|
|
1181
|
-
const bufferedDates = (result: typeof current) => (
|
|
1182
|
-
result.bufferedSeries?.[0]?.points.map((point) => point.date.toISOString())
|
|
1183
|
-
);
|
|
1184
|
-
|
|
1185
|
-
expect(detailedRequests).toEqual([{
|
|
1186
|
-
start: "2024-07-30T16:00:00.000Z",
|
|
1187
|
-
end: "2025-07-30T16:00:00.001Z",
|
|
1188
|
-
}]);
|
|
1189
|
-
expect(current.resolutionSupport).toEqual([
|
|
1190
|
-
{ resolution: "1h", maxRange: "1Y" },
|
|
1191
|
-
{ resolution: "1d", maxRange: "ALL" },
|
|
1192
|
-
]);
|
|
1193
|
-
expect(bufferedDates(historical)).toEqual([
|
|
1194
|
-
"2024-08-01T16:00:00.000Z",
|
|
1195
|
-
"2025-07-29T16:00:00.000Z",
|
|
1196
|
-
"2026-01-02T16:00:00.000Z",
|
|
1197
|
-
"2026-07-30T16:00:00.000Z",
|
|
1198
|
-
]);
|
|
1199
|
-
expect(bufferedDates(revisitedCurrent)).toEqual(bufferedDates(historical));
|
|
1200
|
-
expect(revisitedCurrent.bufferedSeries?.[0]?.points.at(-1)?.value).toBe(120);
|
|
1201
|
-
});
|
|
1202
|
-
|
|
1203
|
-
test("keeps one daily bar per session when windows come from sources that stamp bars differently", async () => {
|
|
1204
|
-
// The trailing window is stamped at the opening bell, the panned window at
|
|
1205
|
-
// local midnight, so the same sessions arrive with timestamps hours apart.
|
|
1206
|
-
const currentHistory = [
|
|
1207
|
-
{ date: new Date("2026-07-28T13:30:00.000Z"), close: 110 },
|
|
1208
|
-
{ date: new Date("2026-07-29T13:30:00.000Z"), close: 115 },
|
|
1209
|
-
{ date: new Date("2026-07-30T13:30:00.000Z"), close: 120 },
|
|
1210
|
-
];
|
|
1211
|
-
const historicalHistory = [
|
|
1212
|
-
{ date: new Date("2026-07-23T22:00:00.000Z"), close: 100 },
|
|
1213
|
-
{ date: new Date("2026-07-27T22:00:00.000Z"), close: 111 },
|
|
1214
|
-
{ date: new Date("2026-07-28T22:00:00.000Z"), close: 116 },
|
|
1215
|
-
{ date: new Date("2026-07-29T22:00:00.000Z"), close: 121 },
|
|
1216
|
-
];
|
|
1217
|
-
const provider = createTestDataProvider({
|
|
1218
|
-
getTickerFinancials: async () => emptyFinancials(),
|
|
1219
|
-
getChartResolutionSupport: () => [{ resolution: "1d", maxRange: "ALL" }],
|
|
1220
|
-
getPriceHistoryForResolution: async () => currentHistory,
|
|
1221
|
-
getDetailedPriceHistory: async () => historicalHistory,
|
|
1222
|
-
});
|
|
1223
|
-
const spec: ChartSpec = chartSpec({
|
|
1224
|
-
viewport: { range: "1Y", resolution: "1d" },
|
|
1225
|
-
series: [chartSeries({
|
|
1226
|
-
source: {
|
|
1227
|
-
kind: "security",
|
|
1228
|
-
instrument: { symbol: "TEST", exchange: "NASDAQ" },
|
|
1229
|
-
fieldId: "market.close",
|
|
1230
|
-
},
|
|
1231
|
-
})],
|
|
1232
|
-
});
|
|
1233
|
-
const sources = {
|
|
1234
|
-
dataProvider: provider,
|
|
1235
|
-
now: new Date("2026-07-30T16:00:00.000Z"),
|
|
1236
|
-
loadFredSeries: async () => fredLoad(),
|
|
1237
|
-
};
|
|
1238
|
-
const cache = new ChartResolveCache();
|
|
1239
|
-
|
|
1240
|
-
await resolveChartSpecData(spec, sources, cache);
|
|
1241
|
-
const panned = await resolveChartSpecData(spec, sources, cache, {
|
|
1242
|
-
requestViewport: {
|
|
1243
|
-
start: new Date("2026-07-20T00:00:00.000Z"),
|
|
1244
|
-
end: new Date("2026-07-30T16:00:00.000Z"),
|
|
1245
|
-
},
|
|
1246
|
-
});
|
|
1247
|
-
|
|
1248
|
-
const points = panned.bufferedSeries?.[0]?.points ?? [];
|
|
1249
|
-
expect(points.map((point) => point.date.toISOString())).toEqual([
|
|
1250
|
-
"2026-07-23T22:00:00.000Z",
|
|
1251
|
-
"2026-07-28T13:30:00.000Z",
|
|
1252
|
-
"2026-07-29T13:30:00.000Z",
|
|
1253
|
-
"2026-07-30T13:30:00.000Z",
|
|
1254
|
-
]);
|
|
1255
|
-
expect(points.map((point) => point.value)).toEqual([100, 110, 115, 120]);
|
|
1256
|
-
});
|
|
1257
|
-
|
|
1258
|
-
test("keeps percent transforms and studies defined in a panned history window", async () => {
|
|
1259
|
-
const provider = createTestDataProvider({
|
|
1260
|
-
getTickerFinancials: async () => emptyFinancials(),
|
|
1261
|
-
getDetailedPriceHistory: async () => [
|
|
1262
|
-
{ date: new Date("2024-10-15T16:00:00.000Z"), close: 100 },
|
|
1263
|
-
{ date: new Date("2024-10-16T16:00:00.000Z"), close: 110 },
|
|
1264
|
-
],
|
|
1265
|
-
});
|
|
1266
|
-
const spec: ChartSpec = chartSpec({
|
|
1267
|
-
viewport: { range: "3M", resolution: "1d" },
|
|
1268
|
-
series: [chartSeries({
|
|
1269
|
-
source: {
|
|
1270
|
-
kind: "security",
|
|
1271
|
-
instrument: { symbol: "TEST", exchange: "NASDAQ" },
|
|
1272
|
-
fieldId: "market.close",
|
|
1273
|
-
},
|
|
1274
|
-
transform: "percent",
|
|
1275
|
-
})],
|
|
1276
|
-
studies: [{
|
|
1277
|
-
id: "sma",
|
|
1278
|
-
kind: "sma",
|
|
1279
|
-
inputSeriesIds: ["price"],
|
|
1280
|
-
parameters: { period: 2 },
|
|
1281
|
-
panelId: "main",
|
|
1282
|
-
axis: "left",
|
|
1283
|
-
}],
|
|
1284
|
-
});
|
|
1285
|
-
|
|
1286
|
-
const result = await resolveChartSpecData(
|
|
1287
|
-
spec,
|
|
1288
|
-
{
|
|
1289
|
-
dataProvider: provider,
|
|
1290
|
-
now: new Date("2025-04-01T00:00:00.000Z"),
|
|
1291
|
-
loadFredSeries: async () => fredLoad(),
|
|
1292
|
-
},
|
|
1293
|
-
new ChartResolveCache(),
|
|
1294
|
-
{
|
|
1295
|
-
requestViewport: {
|
|
1296
|
-
start: new Date("2024-10-10T00:00:00.000Z"),
|
|
1297
|
-
end: new Date("2024-10-17T00:00:00.000Z"),
|
|
1298
|
-
},
|
|
1299
|
-
},
|
|
1300
|
-
);
|
|
1301
|
-
|
|
1302
|
-
expect(result.errors).toEqual([]);
|
|
1303
|
-
expect(result.bufferedSeries?.find((series) => series.id === "price")?.points.map((point) => point.value))
|
|
1304
|
-
.toEqual([0, 10]);
|
|
1305
|
-
expect(result.bufferedSeries?.find((series) => series.id === "sma")?.points.map((point) => point.value))
|
|
1306
|
-
.toEqual([5]);
|
|
1307
|
-
});
|
|
1308
|
-
|
|
1309
|
-
test("resolves unrelated price, filed fundamental, and economic series on one chart", async () => {
|
|
1310
|
-
const provider = createTestDataProvider({
|
|
1311
|
-
getTickerFinancials: async (symbol) => symbol === "MSFT"
|
|
1312
|
-
? {
|
|
1313
|
-
...emptyFinancials(),
|
|
1314
|
-
annualStatements: [{
|
|
1315
|
-
date: "2025-12-31",
|
|
1316
|
-
availableAt: "2026-02-15",
|
|
1317
|
-
fieldAvailability: { totalRevenue: "2026-02-15" },
|
|
1318
|
-
totalRevenue: 250,
|
|
1319
|
-
}],
|
|
1320
|
-
}
|
|
1321
|
-
: emptyFinancials(),
|
|
1322
|
-
getPriceHistoryForResolution: async (symbol, _exchange, _range, resolution) => {
|
|
1323
|
-
expect(symbol).toBe("AAPL");
|
|
1324
|
-
expect(resolution).toBe("1d");
|
|
1325
|
-
return [
|
|
1326
|
-
{ date: new Date("2024-12-31T00:00:00Z"), close: 80 },
|
|
1327
|
-
{ date: new Date("2025-04-01T00:00:00Z"), close: 100 },
|
|
1328
|
-
{ date: new Date("2026-03-01T00:00:00Z"), close: 125 },
|
|
1329
|
-
];
|
|
1330
|
-
},
|
|
1331
|
-
});
|
|
1332
|
-
const spec: ChartSpec = chartSpec({
|
|
1333
|
-
viewport: { range: "1Y", resolution: "1d" },
|
|
1334
|
-
panels: [{ id: "main" }, { id: "macro", height: 0.4 }],
|
|
1335
|
-
series: [
|
|
1336
|
-
chartSeries({
|
|
1337
|
-
id: "aapl-price",
|
|
1338
|
-
source: { kind: "security", instrument: { symbol: "AAPL" }, fieldId: "market.close" },
|
|
1339
|
-
transform: "percent",
|
|
1340
|
-
axis: "auto",
|
|
1341
|
-
}),
|
|
1342
|
-
chartSeries({
|
|
1343
|
-
id: "msft-revenue",
|
|
1344
|
-
source: {
|
|
1345
|
-
kind: "security",
|
|
1346
|
-
instrument: { symbol: "MSFT" },
|
|
1347
|
-
fieldId: "fundamental.totalRevenue",
|
|
1348
|
-
period: "annual",
|
|
1349
|
-
timestampMode: "available-at",
|
|
1350
|
-
},
|
|
1351
|
-
style: "columns",
|
|
1352
|
-
axis: "auto",
|
|
1353
|
-
interpolation: "step-after",
|
|
1354
|
-
}),
|
|
1355
|
-
chartSeries({
|
|
1356
|
-
id: "cpi",
|
|
1357
|
-
source: { kind: "economic", provider: "fred", seriesId: "CPIAUCSL" },
|
|
1358
|
-
style: "step",
|
|
1359
|
-
axis: "auto",
|
|
1360
|
-
panelId: "macro",
|
|
1361
|
-
interpolation: "step-after",
|
|
1362
|
-
}),
|
|
1363
|
-
],
|
|
1364
|
-
});
|
|
1365
|
-
|
|
1366
|
-
const result = await resolveChartSpecData(spec, {
|
|
1367
|
-
dataProvider: provider,
|
|
1368
|
-
now: new Date("2026-03-31T00:00:00Z"),
|
|
1369
|
-
loadFredSeries: async () => fredLoad({
|
|
1370
|
-
observations: [
|
|
1371
|
-
{ date: "2025-03-01", value: 310 },
|
|
1372
|
-
{ date: "2026-03-01", value: 320 },
|
|
1373
|
-
],
|
|
1374
|
-
info: {
|
|
1375
|
-
id: "CPIAUCSL",
|
|
1376
|
-
title: "Consumer Price Index",
|
|
1377
|
-
units: "Index 1982-1984=100",
|
|
1378
|
-
frequency: "Monthly",
|
|
1379
|
-
seasonalAdjustment: "Seasonally Adjusted",
|
|
1380
|
-
source: "FRED",
|
|
1381
|
-
notes: "",
|
|
1382
|
-
},
|
|
1383
|
-
}, {
|
|
1384
|
-
fetchedAt: Date.parse("2026-03-15T00:00:00Z"),
|
|
1385
|
-
stale: true,
|
|
1386
|
-
source: "stale-fallback",
|
|
1387
|
-
refreshError: "network unavailable",
|
|
1388
|
-
}),
|
|
1389
|
-
});
|
|
1390
|
-
|
|
1391
|
-
expect(result.errors).toEqual([]);
|
|
1392
|
-
expect(result.series).toHaveLength(3);
|
|
1393
|
-
const price = result.series.find((entry) => entry.id === "aapl-price")!;
|
|
1394
|
-
expect(price.points.map((point) => point.value)).toEqual([0, 25]);
|
|
1395
|
-
expect(price.axis).toBe("left");
|
|
1396
|
-
const bufferedPrice = result.bufferedSeries?.find((entry) => entry.id === "aapl-price");
|
|
1397
|
-
expect(bufferedPrice?.points.map((point) => point.value)).toEqual([-20, 0, 25]);
|
|
1398
|
-
const revenue = result.series.find((entry) => entry.id === "msft-revenue")!;
|
|
1399
|
-
expect(revenue.points[0]?.date.toISOString().slice(0, 10)).toBe("2026-02-15");
|
|
1400
|
-
expect(revenue.axis).toBe("right");
|
|
1401
|
-
expect(result.series.find((entry) => entry.id === "cpi")?.panelId).toBe("macro");
|
|
1402
|
-
expect(result.warnings[0]).toContain("FRED refresh failed (network unavailable)");
|
|
1403
|
-
expect(result.warnings[0]).toContain("cached data fetched 2026-03-15");
|
|
1404
|
-
expect(result.warnings.some((warning) => warning.includes("FRED vintage dates"))).toBe(true);
|
|
1405
|
-
expect(result.viewport).toEqual({
|
|
1406
|
-
start: new Date("2025-03-31T00:00:00.000Z"),
|
|
1407
|
-
end: new Date("2026-03-31T00:00:00.000Z"),
|
|
1408
|
-
});
|
|
1409
|
-
});
|
|
1410
|
-
|
|
1411
|
-
test("uses an exact custom window, derives its auto resolution, and warms studies before clipping", async () => {
|
|
1412
|
-
let detailRequest: {
|
|
1413
|
-
start: Date;
|
|
1414
|
-
end: Date;
|
|
1415
|
-
barSize: string;
|
|
1416
|
-
} | null = null;
|
|
1417
|
-
const provider = createTestDataProvider({
|
|
1418
|
-
getTickerFinancials: async () => emptyFinancials(),
|
|
1419
|
-
getDetailedPriceHistory: async (_symbol, _exchange, start, end, barSize) => {
|
|
1420
|
-
detailRequest = { start, end, barSize };
|
|
1421
|
-
return [
|
|
1422
|
-
{ date: new Date("2024-12-30T16:00:00Z"), close: 10 },
|
|
1423
|
-
{ date: new Date("2024-12-31T16:00:00Z"), close: 20 },
|
|
1424
|
-
{ date: new Date("2025-01-01T16:00:00Z"), close: 30 },
|
|
1425
|
-
{ date: new Date("2025-01-31T16:00:00Z"), close: 40 },
|
|
1426
|
-
];
|
|
1427
|
-
},
|
|
1428
|
-
});
|
|
1429
|
-
const spec: ChartSpec = chartSpec({
|
|
1430
|
-
viewport: {
|
|
1431
|
-
range: "1Y",
|
|
1432
|
-
resolution: "auto",
|
|
1433
|
-
dateWindow: { start: "2025-01-01", end: "2025-01-31" },
|
|
1434
|
-
},
|
|
1435
|
-
series: [chartSeries({
|
|
1436
|
-
source: { kind: "security", instrument: { symbol: "TEST" }, fieldId: "market.close" },
|
|
1437
|
-
})],
|
|
1438
|
-
studies: [{
|
|
1439
|
-
id: "sma",
|
|
1440
|
-
kind: "sma",
|
|
1441
|
-
inputSeriesIds: ["price"],
|
|
1442
|
-
parameters: { period: 3 },
|
|
1443
|
-
panelId: "main",
|
|
1444
|
-
axis: "left",
|
|
1445
|
-
}],
|
|
1446
|
-
});
|
|
1447
|
-
|
|
1448
|
-
const result = await resolveChartSpecData(spec, {
|
|
1449
|
-
dataProvider: provider,
|
|
1450
|
-
now: new Date("2026-03-01T00:00:00Z"),
|
|
1451
|
-
loadFredSeries: async () => fredLoad(),
|
|
1452
|
-
});
|
|
1453
|
-
|
|
1454
|
-
expect(detailRequest).not.toBeNull();
|
|
1455
|
-
expect(detailRequest!.barSize).toBe("15m");
|
|
1456
|
-
expect(detailRequest!.start.getTime()).toBeLessThan(new Date("2025-01-01T00:00:00Z").getTime());
|
|
1457
|
-
expect(detailRequest!.end.toISOString()).toBe("2025-02-01T00:00:00.000Z");
|
|
1458
|
-
expect(result.series.find((entry) => entry.id === "price")?.points.map((point) => point.date.toISOString())).toEqual([
|
|
1459
|
-
"2025-01-01T16:00:00.000Z",
|
|
1460
|
-
"2025-01-31T16:00:00.000Z",
|
|
1461
|
-
]);
|
|
1462
|
-
expect(result.series.find((entry) => entry.id === "sma")?.points.map((point) => point.value)).toEqual([20, 30]);
|
|
1463
|
-
expect(result.viewport).toEqual({
|
|
1464
|
-
start: new Date("2025-01-01T00:00:00.000Z"),
|
|
1465
|
-
end: new Date("2025-01-31T23:59:59.999Z"),
|
|
1466
|
-
});
|
|
1467
|
-
});
|
|
1468
|
-
|
|
1469
|
-
test("falls back to a trailing range that reaches a historical custom window", async () => {
|
|
1470
|
-
let detailAttempted = false;
|
|
1471
|
-
let requestedRange = "";
|
|
1472
|
-
let requestedResolution = "";
|
|
1473
|
-
const provider = createTestDataProvider({
|
|
1474
|
-
getTickerFinancials: async () => emptyFinancials(),
|
|
1475
|
-
getDetailedPriceHistory: async () => {
|
|
1476
|
-
detailAttempted = true;
|
|
1477
|
-
return [];
|
|
1478
|
-
},
|
|
1479
|
-
getPriceHistoryForResolution: async (_symbol, _exchange, range, resolution) => {
|
|
1480
|
-
requestedRange = range;
|
|
1481
|
-
requestedResolution = resolution;
|
|
1482
|
-
return [{ date: new Date("2025-01-31T16:00:00Z"), close: 40 }];
|
|
1483
|
-
},
|
|
1484
|
-
});
|
|
1485
|
-
const spec: ChartSpec = chartSpec({
|
|
1486
|
-
viewport: {
|
|
1487
|
-
range: "1D",
|
|
1488
|
-
resolution: "auto",
|
|
1489
|
-
dateWindow: { start: "2025-01-01", end: "2025-01-31" },
|
|
1490
|
-
},
|
|
1491
|
-
series: [chartSeries({
|
|
1492
|
-
source: { kind: "security", instrument: { symbol: "TEST" }, fieldId: "market.close" },
|
|
1493
|
-
})],
|
|
1494
|
-
});
|
|
1495
|
-
|
|
1496
|
-
const result = await resolveChartSpecData(spec, {
|
|
1497
|
-
dataProvider: provider,
|
|
1498
|
-
now: new Date("2026-03-01T00:00:00Z"),
|
|
1499
|
-
loadFredSeries: async () => fredLoad(),
|
|
1500
|
-
});
|
|
1501
|
-
|
|
1502
|
-
expect(detailAttempted).toBe(true);
|
|
1503
|
-
expect(requestedRange).toBe("5Y");
|
|
1504
|
-
expect(requestedResolution).toBe("15m");
|
|
1505
|
-
expect(result.series[0]?.points).toHaveLength(1);
|
|
1506
|
-
});
|
|
1507
|
-
|
|
1508
|
-
test("retains the prior step observation as the custom window's left-edge anchor", async () => {
|
|
1509
|
-
const provider = createTestDataProvider({
|
|
1510
|
-
getTickerFinancials: async () => ({
|
|
1511
|
-
...emptyFinancials(),
|
|
1512
|
-
annualStatements: [{
|
|
1513
|
-
date: "2024-09-30",
|
|
1514
|
-
availableAt: "2024-12-15",
|
|
1515
|
-
fieldAvailability: { totalRevenue: "2024-12-15" },
|
|
1516
|
-
totalRevenue: 90,
|
|
1517
|
-
}],
|
|
1518
|
-
}),
|
|
1519
|
-
});
|
|
1520
|
-
const spec: ChartSpec = chartSpec({
|
|
1521
|
-
viewport: {
|
|
1522
|
-
range: "1M",
|
|
1523
|
-
resolution: "auto",
|
|
1524
|
-
dateWindow: { start: "2025-01-01", end: "2025-01-31" },
|
|
1525
|
-
},
|
|
1526
|
-
series: [chartSeries({
|
|
1527
|
-
id: "revenue",
|
|
1528
|
-
source: {
|
|
1529
|
-
kind: "security",
|
|
1530
|
-
instrument: { symbol: "TEST" },
|
|
1531
|
-
fieldId: "fundamental.totalRevenue",
|
|
1532
|
-
period: "annual",
|
|
1533
|
-
timestampMode: "available-at",
|
|
1534
|
-
},
|
|
1535
|
-
style: "step",
|
|
1536
|
-
interpolation: "step-after",
|
|
1537
|
-
})],
|
|
1538
|
-
});
|
|
1539
|
-
|
|
1540
|
-
const result = await resolveChartSpecData(spec, {
|
|
1541
|
-
dataProvider: provider,
|
|
1542
|
-
now: new Date("2025-02-01T00:00:00Z"),
|
|
1543
|
-
loadFredSeries: async () => fredLoad(),
|
|
1544
|
-
});
|
|
1545
|
-
|
|
1546
|
-
const anchor = result.series[0]?.points[0];
|
|
1547
|
-
expect(result.series[0]?.points).toHaveLength(1);
|
|
1548
|
-
expect(anchor?.date.toISOString()).toBe("2024-12-15T00:00:00.000Z");
|
|
1549
|
-
expect(anchor?.value).toBe(90);
|
|
1550
|
-
});
|
|
1551
|
-
|
|
1552
|
-
test("retains an as-of anchor for ratio and spread formulas across a custom window", async () => {
|
|
1553
|
-
const provider = createTestDataProvider({
|
|
1554
|
-
getTickerFinancials: async (symbol) => ({
|
|
1555
|
-
...emptyFinancials(),
|
|
1556
|
-
financialCurrency: "USD",
|
|
1557
|
-
quarterlyStatements: symbol === "LEFT"
|
|
1558
|
-
? [
|
|
1559
|
-
{
|
|
1560
|
-
date: "2024-12-31",
|
|
1561
|
-
availableAt: "2025-02-10",
|
|
1562
|
-
fieldAvailability: { totalRevenue: "2025-02-10" },
|
|
1563
|
-
totalRevenue: 100,
|
|
1564
|
-
},
|
|
1565
|
-
{
|
|
1566
|
-
date: "2025-03-31",
|
|
1567
|
-
availableAt: "2025-05-10",
|
|
1568
|
-
fieldAvailability: { totalRevenue: "2025-05-10" },
|
|
1569
|
-
totalRevenue: 120,
|
|
1570
|
-
},
|
|
1571
|
-
]
|
|
1572
|
-
: [
|
|
1573
|
-
{
|
|
1574
|
-
date: "2024-12-31",
|
|
1575
|
-
availableAt: "2025-02-20",
|
|
1576
|
-
fieldAvailability: { totalRevenue: "2025-02-20" },
|
|
1577
|
-
totalRevenue: 50,
|
|
1578
|
-
},
|
|
1579
|
-
{
|
|
1580
|
-
date: "2025-03-31",
|
|
1581
|
-
availableAt: "2025-06-10",
|
|
1582
|
-
fieldAvailability: { totalRevenue: "2025-06-10" },
|
|
1583
|
-
totalRevenue: 40,
|
|
1584
|
-
},
|
|
1585
|
-
],
|
|
1586
|
-
}),
|
|
1587
|
-
});
|
|
1588
|
-
const fundamental = (id: string, symbol: string): ChartSpec["series"][number] => (chartSeries({
|
|
1589
|
-
id,
|
|
1590
|
-
source: {
|
|
1591
|
-
kind: "security",
|
|
1592
|
-
instrument: { symbol },
|
|
1593
|
-
fieldId: "fundamental.totalRevenue",
|
|
1594
|
-
period: "quarterly",
|
|
1595
|
-
timestampMode: "available-at",
|
|
1596
|
-
},
|
|
1597
|
-
// The built-in fundamental comparison preset uses columns without
|
|
1598
|
-
// display interpolation; formula calculation still uses as-of values.
|
|
1599
|
-
style: "columns",
|
|
1600
|
-
}));
|
|
1601
|
-
const spec: ChartSpec = chartSpec({
|
|
1602
|
-
viewport: {
|
|
1603
|
-
range: "1Y",
|
|
1604
|
-
resolution: "auto",
|
|
1605
|
-
dateWindow: { start: "2025-04-01", end: "2025-07-31" },
|
|
1606
|
-
},
|
|
1607
|
-
panels: [{ id: "main" }, { id: "formula" }],
|
|
1608
|
-
series: [fundamental("left", "LEFT"), fundamental("right", "RIGHT")],
|
|
1609
|
-
studies: [
|
|
1610
|
-
{
|
|
1611
|
-
id: "ratio",
|
|
1612
|
-
kind: "ratio",
|
|
1613
|
-
inputSeriesIds: ["left", "right"],
|
|
1614
|
-
parameters: {},
|
|
1615
|
-
panelId: "formula",
|
|
1616
|
-
axis: "left",
|
|
1617
|
-
},
|
|
1618
|
-
{
|
|
1619
|
-
id: "spread",
|
|
1620
|
-
kind: "spread",
|
|
1621
|
-
inputSeriesIds: ["left", "right"],
|
|
1622
|
-
parameters: {},
|
|
1623
|
-
panelId: "formula",
|
|
1624
|
-
axis: "left",
|
|
1625
|
-
},
|
|
1626
|
-
],
|
|
1627
|
-
});
|
|
1628
|
-
|
|
1629
|
-
const result = await resolveChartSpecData(spec, {
|
|
1630
|
-
dataProvider: provider,
|
|
1631
|
-
now: new Date("2025-08-01T00:00:00Z"),
|
|
1632
|
-
loadFredSeries: async () => fredLoad(),
|
|
1633
|
-
});
|
|
1634
|
-
|
|
1635
|
-
expect(result.errors).toEqual([]);
|
|
1636
|
-
expect(result.series.find(({ id }) => id === "ratio")).toMatchObject({
|
|
1637
|
-
style: "step",
|
|
1638
|
-
interpolation: "step-after",
|
|
1639
|
-
});
|
|
1640
|
-
expect(result.series.find(({ id }) => id === "ratio")?.points.map((point) => ({
|
|
1641
|
-
date: point.date.toISOString().slice(0, 10),
|
|
1642
|
-
value: point.value,
|
|
1643
|
-
}))).toEqual([
|
|
1644
|
-
{ date: "2025-02-20", value: 2 },
|
|
1645
|
-
{ date: "2025-05-10", value: 2.4 },
|
|
1646
|
-
{ date: "2025-06-10", value: 3 },
|
|
1647
|
-
]);
|
|
1648
|
-
expect(result.series.find(({ id }) => id === "spread")?.points[0]).toMatchObject({
|
|
1649
|
-
date: new Date("2025-02-20T00:00:00Z"),
|
|
1650
|
-
value: 50,
|
|
1651
|
-
});
|
|
1652
|
-
});
|
|
1653
|
-
|
|
1654
|
-
test("keeps an explicit viewport when a latest-observation cap is also set", async () => {
|
|
1655
|
-
const provider = createTestDataProvider({
|
|
1656
|
-
getTickerFinancials: async () => ({
|
|
1657
|
-
...emptyFinancials(),
|
|
1658
|
-
annualStatements: [
|
|
1659
|
-
{
|
|
1660
|
-
date: "2023-12-31",
|
|
1661
|
-
availableAt: "2025-01-10",
|
|
1662
|
-
fieldAvailability: { totalRevenue: "2025-01-10" },
|
|
1663
|
-
totalRevenue: 100,
|
|
1664
|
-
},
|
|
1665
|
-
{
|
|
1666
|
-
date: "2024-12-31",
|
|
1667
|
-
availableAt: "2025-02-10",
|
|
1668
|
-
fieldAvailability: { totalRevenue: "2025-02-10" },
|
|
1669
|
-
totalRevenue: 120,
|
|
1670
|
-
},
|
|
1671
|
-
],
|
|
1672
|
-
}),
|
|
1673
|
-
});
|
|
1674
|
-
const spec: ChartSpec = chartSpec({
|
|
1675
|
-
viewport: {
|
|
1676
|
-
range: "ALL",
|
|
1677
|
-
resolution: "auto",
|
|
1678
|
-
dateWindow: { start: "2025-01-01", end: "2025-02-28" },
|
|
1679
|
-
maxPoints: 1,
|
|
1680
|
-
},
|
|
1681
|
-
series: [chartSeries({
|
|
1682
|
-
id: "revenue",
|
|
1683
|
-
source: {
|
|
1684
|
-
kind: "security",
|
|
1685
|
-
instrument: { symbol: "TEST" },
|
|
1686
|
-
fieldId: "fundamental.totalRevenue",
|
|
1687
|
-
period: "annual",
|
|
1688
|
-
timestampMode: "available-at",
|
|
1689
|
-
},
|
|
1690
|
-
style: "step",
|
|
1691
|
-
interpolation: "step-after",
|
|
1692
|
-
})],
|
|
1693
|
-
});
|
|
1694
|
-
|
|
1695
|
-
const result = await resolveChartSpecData(spec, {
|
|
1696
|
-
dataProvider: provider,
|
|
1697
|
-
now: new Date("2025-03-01T00:00:00Z"),
|
|
1698
|
-
loadFredSeries: async () => fredLoad(),
|
|
1699
|
-
});
|
|
1700
|
-
|
|
1701
|
-
expect(result.series[0]?.points.map((point) => point.value)).toEqual([120]);
|
|
1702
|
-
expect(result.viewport).toEqual({
|
|
1703
|
-
start: new Date("2025-01-01T00:00:00.000Z"),
|
|
1704
|
-
end: new Date("2025-02-28T23:59:59.999Z"),
|
|
1705
|
-
});
|
|
1706
|
-
});
|
|
1707
|
-
|
|
1708
|
-
test("keeps hidden base series available to visible studies without rendering the base", async () => {
|
|
1709
|
-
const provider = createTestDataProvider({
|
|
1710
|
-
getTickerFinancials: async () => emptyFinancials(),
|
|
1711
|
-
getPriceHistoryForResolution: async () => [
|
|
1712
|
-
{ date: new Date("2025-01-01T16:00:00Z"), close: 10 },
|
|
1713
|
-
{ date: new Date("2025-01-02T16:00:00Z"), close: 20 },
|
|
1714
|
-
{ date: new Date("2025-01-03T16:00:00Z"), close: 30 },
|
|
1715
|
-
],
|
|
1716
|
-
});
|
|
1717
|
-
const spec: ChartSpec = chartSpec({
|
|
1718
|
-
viewport: { range: "1Y", resolution: "1d" },
|
|
1719
|
-
series: [chartSeries({
|
|
1720
|
-
source: {
|
|
1721
|
-
kind: "security",
|
|
1722
|
-
instrument: { symbol: "TEST", exchange: "NASDAQ" },
|
|
1723
|
-
fieldId: "market.close",
|
|
1724
|
-
},
|
|
1725
|
-
visible: false,
|
|
1726
|
-
})],
|
|
1727
|
-
studies: [{
|
|
1728
|
-
id: "sma",
|
|
1729
|
-
kind: "sma",
|
|
1730
|
-
inputSeriesIds: ["price"],
|
|
1731
|
-
parameters: { period: 2 },
|
|
1732
|
-
panelId: "main",
|
|
1733
|
-
axis: "left",
|
|
1734
|
-
}],
|
|
1735
|
-
});
|
|
1736
|
-
|
|
1737
|
-
const result = await resolveChartSpecData(spec, {
|
|
1738
|
-
dataProvider: provider,
|
|
1739
|
-
now: new Date("2025-01-04T00:00:00Z"),
|
|
1740
|
-
loadFredSeries: async () => fredLoad(),
|
|
1741
|
-
});
|
|
1742
|
-
|
|
1743
|
-
expect(result.errors).toEqual([]);
|
|
1744
|
-
expect(result.series.map((series) => series.id)).toEqual(["sma"]);
|
|
1745
|
-
expect(result.legendSeries?.map((series) => series.id)).toEqual(["price", "sma"]);
|
|
1746
|
-
expect(result.series[0]?.points.map((point) => point.value)).toEqual([15, 25]);
|
|
1747
|
-
expect(result.legendSeries?.find((series) => series.id === "price")?.timeBasis)
|
|
1748
|
-
.toMatchObject({ kind: "market", timeZone: "America/New_York" });
|
|
1749
|
-
expect(result.timelineSeries?.map((series) => series.id)).toEqual(["price"]);
|
|
1750
|
-
expect(result.series[0]?.timeBasis)
|
|
1751
|
-
.toMatchObject({ kind: "market", timeZone: "America/New_York" });
|
|
1752
|
-
});
|
|
1753
|
-
|
|
1754
|
-
test("applies a streamed quote override before recomputing transforms and studies", async () => {
|
|
1755
|
-
const now = Date.now();
|
|
1756
|
-
const source = {
|
|
1757
|
-
kind: "security" as const,
|
|
1758
|
-
instrument: { symbol: "LIVE" },
|
|
1759
|
-
fieldId: "market.close",
|
|
1760
|
-
};
|
|
1761
|
-
const provider = createTestDataProvider({
|
|
1762
|
-
getTickerFinancials: async () => ({
|
|
1763
|
-
...emptyFinancials(),
|
|
1764
|
-
quote: {
|
|
1765
|
-
symbol: "LIVE",
|
|
1766
|
-
price: 115,
|
|
1767
|
-
currency: "USD",
|
|
1768
|
-
change: 5,
|
|
1769
|
-
changePercent: 4.5,
|
|
1770
|
-
lastUpdated: now - 500,
|
|
1771
|
-
},
|
|
1772
|
-
}),
|
|
1773
|
-
getPriceHistoryForResolution: async () => [
|
|
1774
|
-
{ date: new Date(now - 2 * 86_400_000), close: 100 },
|
|
1775
|
-
{ date: new Date(now - 86_400_000), close: 110 },
|
|
1776
|
-
],
|
|
1777
|
-
});
|
|
1778
|
-
const spec: ChartSpec = chartSpec({
|
|
1779
|
-
viewport: { range: "1Y", resolution: "1d" },
|
|
1780
|
-
series: [{
|
|
1781
|
-
id: "price",
|
|
1782
|
-
source,
|
|
1783
|
-
style: "line",
|
|
1784
|
-
transform: "percent",
|
|
1785
|
-
axis: "left",
|
|
1786
|
-
panelId: "main",
|
|
1787
|
-
interpolation: "none",
|
|
1788
|
-
}],
|
|
1789
|
-
studies: [{
|
|
1790
|
-
id: "sma",
|
|
1791
|
-
kind: "sma",
|
|
1792
|
-
inputSeriesIds: ["price"],
|
|
1793
|
-
parameters: { period: 2 },
|
|
1794
|
-
panelId: "main",
|
|
1795
|
-
axis: "left",
|
|
1796
|
-
}],
|
|
1797
|
-
});
|
|
1798
|
-
const quoteOverrides = new Map([[
|
|
1799
|
-
chartQuoteOverrideKeyForSource(source),
|
|
1800
|
-
{
|
|
1801
|
-
symbol: "LIVE",
|
|
1802
|
-
price: 121,
|
|
1803
|
-
currency: "USD",
|
|
1804
|
-
change: 11,
|
|
1805
|
-
changePercent: 10,
|
|
1806
|
-
lastUpdated: now,
|
|
1807
|
-
},
|
|
1808
|
-
]]);
|
|
1809
|
-
|
|
1810
|
-
const result = await resolveChartSpecData(spec, {
|
|
1811
|
-
dataProvider: provider,
|
|
1812
|
-
now: new Date(now),
|
|
1813
|
-
quoteOverrides,
|
|
1814
|
-
loadFredSeries: async () => fredLoad(),
|
|
1815
|
-
});
|
|
1816
|
-
|
|
1817
|
-
expect(result.errors).toEqual([]);
|
|
1818
|
-
const price = result.series.find((entry) => entry.id === "price")!;
|
|
1819
|
-
expect(price.points).toHaveLength(3);
|
|
1820
|
-
expect(price.points.at(-1)?.date.getTime()).toBe(now);
|
|
1821
|
-
expect(price.points.at(-1)?.value).toBeCloseTo(21);
|
|
1822
|
-
const sma = result.series.find((entry) => entry.id === "sma")!;
|
|
1823
|
-
expect(sma.points).toHaveLength(2);
|
|
1824
|
-
expect(sma.points.at(-1)?.date.getTime()).toBe(now);
|
|
1825
|
-
expect(sma.points.at(-1)?.value).toBeCloseTo(15.5);
|
|
1826
|
-
});
|
|
1827
|
-
|
|
1828
|
-
test.each([0, 60_000])("validates a quote received after resolution starts against %i ms elapsed", async (elapsed) => {
|
|
1829
|
-
const now = Date.parse("2026-08-05T22:00:00Z");
|
|
1830
|
-
const quoteTime = now + 60_000;
|
|
1831
|
-
const clock = spyOn(Date, "now").mockReturnValue(now);
|
|
1832
|
-
const provider = createTestDataProvider({
|
|
1833
|
-
getTickerFinancials: async () => ({
|
|
1834
|
-
...emptyFinancials(),
|
|
1835
|
-
quote: {
|
|
1836
|
-
symbol: "FRESH",
|
|
1837
|
-
price: 130,
|
|
1838
|
-
currency: "USD",
|
|
1839
|
-
change: 30,
|
|
1840
|
-
changePercent: 30,
|
|
1841
|
-
lastUpdated: quoteTime,
|
|
1842
|
-
listingExchangeName: "XNAS",
|
|
1843
|
-
marketState: "POST",
|
|
1844
|
-
postMarketPrice: 129,
|
|
1845
|
-
postMarketChange: -1,
|
|
1846
|
-
postMarketChangePercent: -0.77,
|
|
1847
|
-
},
|
|
1848
|
-
}),
|
|
1849
|
-
getPriceHistoryForResolution: async () => {
|
|
1850
|
-
clock.mockReturnValue(now + elapsed);
|
|
1851
|
-
return [
|
|
1852
|
-
{ date: new Date(now - 2 * 86_400_000), open: 99, high: 102, low: 98, close: 100 },
|
|
1853
|
-
{ date: new Date(now - 86_400_000), open: 100, high: 101, low: 99, close: 100 },
|
|
1854
|
-
];
|
|
1855
|
-
},
|
|
1856
|
-
});
|
|
1857
|
-
const spec: ChartSpec = chartSpec({
|
|
1858
|
-
viewport: { range: "6M", resolution: "1d" },
|
|
1859
|
-
series: [chartSeries({
|
|
1860
|
-
source: {
|
|
1861
|
-
kind: "security",
|
|
1862
|
-
instrument: { symbol: "FRESH", exchange: "XNAS" },
|
|
1863
|
-
fieldId: "market.ohlcv",
|
|
1864
|
-
},
|
|
1865
|
-
style: "candles",
|
|
1866
|
-
})],
|
|
1867
|
-
studies: [{
|
|
1868
|
-
id: "sma",
|
|
1869
|
-
kind: "sma",
|
|
1870
|
-
inputSeriesIds: ["price"],
|
|
1871
|
-
parameters: { period: 2 },
|
|
1872
|
-
panelId: "main",
|
|
1873
|
-
axis: "left",
|
|
1874
|
-
}],
|
|
1875
|
-
});
|
|
1876
|
-
|
|
1877
|
-
try {
|
|
1878
|
-
const result = await resolveChartSpecData(spec, {
|
|
1879
|
-
dataProvider: provider,
|
|
1880
|
-
now: new Date(now),
|
|
1881
|
-
quoteOverrides: new Map([[
|
|
1882
|
-
chartQuoteOverrideKeyForSource({
|
|
1883
|
-
kind: "security",
|
|
1884
|
-
instrument: { symbol: "FRESH", exchange: "XNAS" },
|
|
1885
|
-
fieldId: "market.ohlcv",
|
|
1886
|
-
}),
|
|
1887
|
-
{
|
|
1888
|
-
symbol: "FRESH",
|
|
1889
|
-
price: 130,
|
|
1890
|
-
currency: "USD",
|
|
1891
|
-
change: 30,
|
|
1892
|
-
changePercent: 30,
|
|
1893
|
-
lastUpdated: quoteTime,
|
|
1894
|
-
listingExchangeName: "XNAS",
|
|
1895
|
-
marketState: "POST",
|
|
1896
|
-
postMarketPrice: 129,
|
|
1897
|
-
postMarketChange: -1,
|
|
1898
|
-
postMarketChangePercent: -0.77,
|
|
1899
|
-
},
|
|
1900
|
-
]]),
|
|
1901
|
-
loadFredSeries: async () => fredLoad(),
|
|
1902
|
-
});
|
|
1903
|
-
|
|
1904
|
-
expect(result.errors).toEqual([]);
|
|
1905
|
-
expect(result.viewport?.end.getTime()).toBe(elapsed ? quoteTime : now);
|
|
1906
|
-
const price = result.series.find((entry) => entry.id === "price");
|
|
1907
|
-
const sma = result.series.find((entry) => entry.id === "sma");
|
|
1908
|
-
expect(price?.points.at(-1)?.date.getTime()).toBe(elapsed ? quoteTime : now - 86_400_000);
|
|
1909
|
-
expect(price?.points.at(-1)?.close).toBe(elapsed ? 129 : 100);
|
|
1910
|
-
expect(price?.latestChangePercent).toBe(elapsed ? 30 : undefined);
|
|
1911
|
-
expect(sma?.points.at(-1)?.date.getTime()).toBe(elapsed ? quoteTime : now - 86_400_000);
|
|
1912
|
-
} finally { clock.mockRestore(); }
|
|
1913
|
-
});
|
|
1914
|
-
|
|
1915
|
-
test.each(["line", "candles"] as const)("keeps one daily bar when a live quote updates a %s chart", async (style) => {
|
|
1916
|
-
const now = Date.parse("2026-09-10T18:44:00Z");
|
|
1917
|
-
const source = { kind: "security" as const, instrument: { symbol: "SQQQ", exchange: "NASDAQ" }, fieldId: "market.close" };
|
|
1918
|
-
const provider = createTestDataProvider({
|
|
1919
|
-
getPriceHistoryForResolution: async () => [{
|
|
1920
|
-
date: new Date("2026-09-10T13:30:00Z"), open: 40, high: 41, low: 39, close: 39.77, volume: 1000,
|
|
1921
|
-
}],
|
|
1922
|
-
});
|
|
1923
|
-
const result = await resolveChartSpecData(chartSpec({
|
|
1924
|
-
viewport: { range: "1M", resolution: "1d" },
|
|
1925
|
-
series: [{ id: "price", source, style, transform: "raw", axis: "left", panelId: "main", interpolation: "none" }],
|
|
1926
|
-
}), {
|
|
1927
|
-
dataProvider: provider,
|
|
1928
|
-
now: new Date(now),
|
|
1929
|
-
quoteOverrides: new Map([[chartQuoteOverrideKeyForSource(source), {
|
|
1930
|
-
symbol: "SQQQ", price: 39.75, currency: "USD", change: 0, changePercent: 0,
|
|
1931
|
-
lastUpdated: now, listingExchangeName: "NASDAQ", marketState: "REGULAR",
|
|
1932
|
-
}]]),
|
|
1933
|
-
});
|
|
1934
|
-
expect(result.errors).toEqual([]);
|
|
1935
|
-
expect(result.series[0]?.points).toHaveLength(1);
|
|
1936
|
-
expect(result.series[0]?.points[0]).toMatchObject({ value: 39.75, open: 40, high: 41, low: 39, volume: 1000 });
|
|
1937
|
-
});
|
|
1938
|
-
|
|
1939
|
-
test("retains the known listing session when the quote omits exchange metadata", async () => {
|
|
1940
|
-
const now = Date.parse("2026-09-11T00:01:00Z");
|
|
1941
|
-
const source = { kind: "security" as const, instrument: { symbol: "SQQQ", exchange: "NASDAQ" }, fieldId: "market.close" };
|
|
1942
|
-
const result = await resolveChartSpecData(chartSpec({
|
|
1943
|
-
viewport: { range: "1M", resolution: "1d" },
|
|
1944
|
-
series: [{ id: "price", source, style: "line", transform: "raw", axis: "left", panelId: "main", interpolation: "none" }],
|
|
1945
|
-
}), {
|
|
1946
|
-
dataProvider: createTestDataProvider({ getPriceHistoryForResolution: async () => [
|
|
1947
|
-
{ date: new Date("2026-09-10T00:00:00Z"), close: 100 },
|
|
1948
|
-
] }),
|
|
1949
|
-
now: new Date(now),
|
|
1950
|
-
quoteOverrides: new Map([[chartQuoteOverrideKeyForSource(source), {
|
|
1951
|
-
symbol: "SQQQ", price: 100, postMarketPrice: 105, currency: "USD", change: 0, changePercent: 0,
|
|
1952
|
-
lastUpdated: now - 60_000, marketState: "POST",
|
|
1953
|
-
}]]),
|
|
1954
|
-
});
|
|
1955
|
-
expect(result.errors).toEqual([]);
|
|
1956
|
-
expect(result.series[0]?.points).toHaveLength(1);
|
|
1957
|
-
expect(result.series[0]?.points[0]?.value).toBe(105);
|
|
1958
|
-
});
|
|
1959
|
-
|
|
1960
|
-
test("reuses raw source loads while live quotes recompute the chart tail", async () => {
|
|
1961
|
-
const now = Date.parse("2026-05-15T20:30:00Z");
|
|
1962
|
-
const source = {
|
|
1963
|
-
kind: "security" as const,
|
|
1964
|
-
instrument: { symbol: "LIVE" },
|
|
1965
|
-
fieldId: "market.close",
|
|
1966
|
-
};
|
|
1967
|
-
let financialCalls = 0;
|
|
1968
|
-
let historyCalls = 0;
|
|
1969
|
-
let fredCalls = 0;
|
|
1970
|
-
const provider = createTestDataProvider({
|
|
1971
|
-
getTickerFinancials: async () => {
|
|
1972
|
-
financialCalls += 1;
|
|
1973
|
-
return emptyFinancials();
|
|
1974
|
-
},
|
|
1975
|
-
getPriceHistoryForResolution: async () => {
|
|
1976
|
-
historyCalls += 1;
|
|
1977
|
-
return [{ date: new Date(now - 86_400_000), close: 100 }];
|
|
1978
|
-
},
|
|
1979
|
-
});
|
|
1980
|
-
const spec: ChartSpec = chartSpec({
|
|
1981
|
-
viewport: { range: "1Y", resolution: "1d" },
|
|
1982
|
-
series: [{
|
|
1983
|
-
id: "price",
|
|
1984
|
-
source,
|
|
1985
|
-
style: "line",
|
|
1986
|
-
transform: "raw",
|
|
1987
|
-
axis: "left",
|
|
1988
|
-
panelId: "main",
|
|
1989
|
-
interpolation: "none",
|
|
1990
|
-
}, chartSeries({
|
|
1991
|
-
id: "cpi",
|
|
1992
|
-
source: { kind: "economic", provider: "fred", seriesId: "CPIAUCSL" },
|
|
1993
|
-
axis: "right",
|
|
1994
|
-
})],
|
|
1995
|
-
});
|
|
1996
|
-
const loadFredSeries = async () => {
|
|
1997
|
-
fredCalls += 1;
|
|
1998
|
-
return fredLoad({
|
|
1999
|
-
observations: [{ date: "2026-05-01", value: 320 }],
|
|
2000
|
-
info: null,
|
|
2001
|
-
});
|
|
2002
|
-
};
|
|
2003
|
-
const cache = new ChartResolveCache();
|
|
2004
|
-
|
|
2005
|
-
await resolveChartSpecData(spec, {
|
|
2006
|
-
dataProvider: provider,
|
|
2007
|
-
now: new Date(now),
|
|
2008
|
-
loadFredSeries,
|
|
2009
|
-
}, cache);
|
|
2010
|
-
const live = await resolveChartSpecData(spec, {
|
|
2011
|
-
dataProvider: provider,
|
|
2012
|
-
now: new Date(now + 1_000),
|
|
2013
|
-
loadFredSeries,
|
|
2014
|
-
quoteOverrides: new Map([[
|
|
2015
|
-
chartQuoteOverrideKeyForSource(source),
|
|
2016
|
-
{
|
|
2017
|
-
symbol: "LIVE",
|
|
2018
|
-
price: 105,
|
|
2019
|
-
currency: "USD",
|
|
2020
|
-
change: 5,
|
|
2021
|
-
changePercent: 5,
|
|
2022
|
-
lastUpdated: now,
|
|
2023
|
-
},
|
|
2024
|
-
]]),
|
|
2025
|
-
}, cache);
|
|
2026
|
-
|
|
2027
|
-
expect(financialCalls).toBe(1);
|
|
2028
|
-
expect(historyCalls).toBe(1);
|
|
2029
|
-
expect(fredCalls).toBe(1);
|
|
2030
|
-
expect(live.errors).toEqual([]);
|
|
2031
|
-
expect(live.series.find((entry) => entry.id === "price")?.points.at(-1)?.value).toBe(105);
|
|
2032
|
-
});
|
|
2033
|
-
|
|
2034
|
-
test("derives current trailing multiples from the live quote and latest public TTM inputs", async () => {
|
|
2035
|
-
const quoteTime = Date.parse("2025-05-01T16:00:00Z");
|
|
2036
|
-
const statements = [
|
|
2037
|
-
{
|
|
2038
|
-
date: "2024-03-31",
|
|
2039
|
-
availableAt: "2024-05-01",
|
|
2040
|
-
totalRevenue: 100,
|
|
2041
|
-
ebitda: 20,
|
|
2042
|
-
freeCashFlow: 10,
|
|
2043
|
-
eps: 1,
|
|
2044
|
-
basicShares: 10,
|
|
2045
|
-
totalDebt: 50,
|
|
2046
|
-
cashAndCashEquivalents: 20,
|
|
2047
|
-
},
|
|
2048
|
-
{
|
|
2049
|
-
date: "2024-06-30",
|
|
2050
|
-
availableAt: "2024-08-01",
|
|
2051
|
-
totalRevenue: 110,
|
|
2052
|
-
ebitda: 22,
|
|
2053
|
-
freeCashFlow: 11,
|
|
2054
|
-
eps: 1.1,
|
|
2055
|
-
basicShares: 10,
|
|
2056
|
-
totalDebt: 50,
|
|
2057
|
-
cashAndCashEquivalents: 20,
|
|
2058
|
-
},
|
|
2059
|
-
{
|
|
2060
|
-
date: "2024-09-30",
|
|
2061
|
-
availableAt: "2024-11-01",
|
|
2062
|
-
totalRevenue: 120,
|
|
2063
|
-
ebitda: 24,
|
|
2064
|
-
freeCashFlow: 12,
|
|
2065
|
-
eps: 1.2,
|
|
2066
|
-
basicShares: 10,
|
|
2067
|
-
totalDebt: 50,
|
|
2068
|
-
cashAndCashEquivalents: 20,
|
|
2069
|
-
},
|
|
2070
|
-
{
|
|
2071
|
-
date: "2024-12-31",
|
|
2072
|
-
availableAt: "2025-02-15",
|
|
2073
|
-
totalRevenue: 130,
|
|
2074
|
-
ebitda: 26,
|
|
2075
|
-
freeCashFlow: 13,
|
|
2076
|
-
eps: 1.3,
|
|
2077
|
-
basicShares: 10,
|
|
2078
|
-
totalDebt: 50,
|
|
2079
|
-
cashAndCashEquivalents: 20,
|
|
2080
|
-
},
|
|
2081
|
-
{
|
|
2082
|
-
date: "2025-03-31",
|
|
2083
|
-
// This newer TTM window is not public at the quote timestamp.
|
|
2084
|
-
availableAt: "2025-05-15",
|
|
2085
|
-
totalRevenue: 1_000,
|
|
2086
|
-
ebitda: 500,
|
|
2087
|
-
freeCashFlow: 400,
|
|
2088
|
-
eps: 20,
|
|
2089
|
-
basicShares: 20,
|
|
2090
|
-
totalDebt: 100,
|
|
2091
|
-
cashAndCashEquivalents: 5,
|
|
2092
|
-
},
|
|
2093
|
-
];
|
|
2094
|
-
const provider = createTestDataProvider({
|
|
2095
|
-
getTickerFinancials: async () => ({
|
|
2096
|
-
...emptyFinancials(),
|
|
2097
|
-
quarterlyStatements: statements,
|
|
2098
|
-
financialCurrency: "USD",
|
|
2099
|
-
quote: {
|
|
2100
|
-
symbol: "LIVE",
|
|
2101
|
-
price: 50,
|
|
2102
|
-
currency: "USD",
|
|
2103
|
-
change: 0,
|
|
2104
|
-
changePercent: 0,
|
|
2105
|
-
lastUpdated: quoteTime - 1_000,
|
|
2106
|
-
},
|
|
2107
|
-
}),
|
|
2108
|
-
getPriceHistoryForResolution: async () => [
|
|
2109
|
-
{ date: new Date("2024-04-30T16:00:00Z"), close: 40 },
|
|
2110
|
-
{ date: new Date("2024-07-31T16:00:00Z"), close: 45 },
|
|
2111
|
-
{ date: new Date("2024-10-31T16:00:00Z"), close: 48 },
|
|
2112
|
-
{ date: new Date("2025-02-14T16:00:00Z"), close: 50 },
|
|
2113
|
-
],
|
|
2114
|
-
});
|
|
2115
|
-
const valuationFields = [
|
|
2116
|
-
"trailingPE",
|
|
2117
|
-
"priceSales",
|
|
2118
|
-
"evSales",
|
|
2119
|
-
"evEbitda",
|
|
2120
|
-
"priceFcf",
|
|
2121
|
-
] as const;
|
|
2122
|
-
const makeSeries = (metric: typeof valuationFields[number]): ChartSpec["series"][number] => (chartSeries({
|
|
2123
|
-
id: metric,
|
|
2124
|
-
source: {
|
|
2125
|
-
kind: "security",
|
|
2126
|
-
instrument: { symbol: "LIVE" },
|
|
2127
|
-
fieldId: `valuation.${metric}`,
|
|
2128
|
-
period: "quarterly",
|
|
2129
|
-
timestampMode: "available-at",
|
|
2130
|
-
},
|
|
2131
|
-
style: "step",
|
|
2132
|
-
interpolation: "step-after",
|
|
2133
|
-
}));
|
|
2134
|
-
const spec: ChartSpec = chartSpec({
|
|
2135
|
-
viewport: { range: "1Y", resolution: "1d" },
|
|
2136
|
-
series: valuationFields.map(makeSeries),
|
|
2137
|
-
});
|
|
2138
|
-
const firstSource = spec.series[0]!.source;
|
|
2139
|
-
if (firstSource.kind !== "security") throw new Error("expected security source");
|
|
2140
|
-
const quoteOverrides = new Map([[
|
|
2141
|
-
chartQuoteOverrideKeyForSource(firstSource),
|
|
2142
|
-
{
|
|
2143
|
-
symbol: "LIVE",
|
|
2144
|
-
price: 60,
|
|
2145
|
-
currency: "USD",
|
|
2146
|
-
change: 10,
|
|
2147
|
-
changePercent: 20,
|
|
2148
|
-
lastUpdated: quoteTime,
|
|
2149
|
-
},
|
|
2150
|
-
]]);
|
|
2151
|
-
|
|
2152
|
-
const result = await resolveChartSpecData(spec, {
|
|
2153
|
-
dataProvider: provider,
|
|
2154
|
-
now: new Date(quoteTime),
|
|
2155
|
-
quoteOverrides,
|
|
2156
|
-
loadFredSeries: async () => fredLoad(),
|
|
2157
|
-
});
|
|
2158
|
-
|
|
2159
|
-
expect(result.errors).toEqual([]);
|
|
2160
|
-
const currentValue = (id: string) => {
|
|
2161
|
-
const point = result.series.find((series) => series.id === id)?.points.at(-1);
|
|
2162
|
-
expect(point).toMatchObject({
|
|
2163
|
-
date: new Date(quoteTime),
|
|
2164
|
-
periodLabel: "Current",
|
|
2165
|
-
provenance: { quality: "derived" },
|
|
2166
|
-
});
|
|
2167
|
-
return point?.value;
|
|
2168
|
-
};
|
|
2169
|
-
expect(currentValue("trailingPE")).toBeCloseTo(60 / 4.6, 10);
|
|
2170
|
-
expect(currentValue("priceSales")).toBeCloseTo(600 / 460, 10);
|
|
2171
|
-
expect(currentValue("evSales")).toBeCloseTo(630 / 460, 10);
|
|
2172
|
-
expect(currentValue("evEbitda")).toBeCloseTo(630 / 92, 10);
|
|
2173
|
-
expect(currentValue("priceFcf")).toBeCloseTo(600 / 46, 10);
|
|
2174
|
-
});
|
|
2175
|
-
|
|
2176
|
-
test("does not re-timestamp provider forward PE or PEG on quote overrides", async () => {
|
|
2177
|
-
const snapshotTime = Date.parse("2025-04-30T16:00:00Z");
|
|
2178
|
-
const overrideTime = Date.parse("2025-05-01T16:00:00Z");
|
|
2179
|
-
let historyCalls = 0;
|
|
2180
|
-
const provider = createTestDataProvider({
|
|
2181
|
-
getTickerFinancials: async () => ({
|
|
2182
|
-
...emptyFinancials(),
|
|
2183
|
-
fundamentals: { forwardPE: 15, pegRatio: 1.5 },
|
|
2184
|
-
quote: {
|
|
2185
|
-
symbol: "STATIC",
|
|
2186
|
-
price: 50,
|
|
2187
|
-
currency: "USD",
|
|
2188
|
-
change: 0,
|
|
2189
|
-
changePercent: 0,
|
|
2190
|
-
lastUpdated: snapshotTime,
|
|
2191
|
-
},
|
|
2192
|
-
}),
|
|
2193
|
-
getPriceHistoryForResolution: async () => {
|
|
2194
|
-
historyCalls += 1;
|
|
2195
|
-
return [];
|
|
2196
|
-
},
|
|
2197
|
-
});
|
|
2198
|
-
const makeSeries = (metric: "forwardPE" | "pegRatio"): ChartSpec["series"][number] => (chartSeries({
|
|
2199
|
-
id: metric,
|
|
2200
|
-
source: {
|
|
2201
|
-
kind: "security",
|
|
2202
|
-
instrument: { symbol: "STATIC" },
|
|
2203
|
-
fieldId: `valuation.${metric}`,
|
|
2204
|
-
timestampMode: "available-at",
|
|
2205
|
-
},
|
|
2206
|
-
style: "step",
|
|
2207
|
-
interpolation: "step-after",
|
|
2208
|
-
}));
|
|
2209
|
-
const spec: ChartSpec = chartSpec({
|
|
2210
|
-
viewport: { range: "1Y", resolution: "1d" },
|
|
2211
|
-
series: [makeSeries("forwardPE"), makeSeries("pegRatio")],
|
|
2212
|
-
});
|
|
2213
|
-
const firstSource = spec.series[0]!.source;
|
|
2214
|
-
if (firstSource.kind !== "security") throw new Error("expected security source");
|
|
2215
|
-
const quoteOverrides = new Map([[
|
|
2216
|
-
chartQuoteOverrideKeyForSource(firstSource),
|
|
2217
|
-
{
|
|
2218
|
-
symbol: "STATIC",
|
|
2219
|
-
price: 60,
|
|
2220
|
-
currency: "USD",
|
|
2221
|
-
change: 10,
|
|
2222
|
-
changePercent: 20,
|
|
2223
|
-
lastUpdated: overrideTime,
|
|
2224
|
-
},
|
|
2225
|
-
]]);
|
|
2226
|
-
|
|
2227
|
-
const result = await resolveChartSpecData(spec, {
|
|
2228
|
-
dataProvider: provider,
|
|
2229
|
-
now: new Date(overrideTime),
|
|
2230
|
-
quoteOverrides,
|
|
2231
|
-
loadFredSeries: async () => fredLoad(),
|
|
2232
|
-
});
|
|
2233
|
-
|
|
2234
|
-
expect(result.errors).toEqual([]);
|
|
2235
|
-
expect(historyCalls).toBe(0);
|
|
2236
|
-
expect(result.series.find(({ id }) => id === "forwardPE")?.points).toEqual([
|
|
2237
|
-
expect.objectContaining({ date: new Date(snapshotTime), value: 15 }),
|
|
2238
|
-
]);
|
|
2239
|
-
expect(result.series.find(({ id }) => id === "pegRatio")?.points).toEqual([
|
|
2240
|
-
expect.objectContaining({ date: new Date(snapshotTime), value: 1.5 }),
|
|
2241
|
-
]);
|
|
2242
|
-
});
|
|
2243
|
-
|
|
2244
|
-
test("merges streamed quotes into the active OHLC resolution bucket", async () => {
|
|
2245
|
-
const now = Date.now();
|
|
2246
|
-
const source = {
|
|
2247
|
-
kind: "security" as const,
|
|
2248
|
-
instrument: { symbol: "LIVE" },
|
|
2249
|
-
fieldId: "market.ohlcv",
|
|
2250
|
-
};
|
|
2251
|
-
const provider = createTestDataProvider({
|
|
2252
|
-
getTickerFinancials: async () => emptyFinancials(),
|
|
2253
|
-
getPriceHistoryForResolution: async () => [
|
|
2254
|
-
{
|
|
2255
|
-
date: new Date(now - 10 * 60_000),
|
|
2256
|
-
open: 100,
|
|
2257
|
-
high: 110,
|
|
2258
|
-
low: 99,
|
|
2259
|
-
close: 108,
|
|
2260
|
-
volume: 1_000,
|
|
2261
|
-
},
|
|
2262
|
-
{
|
|
2263
|
-
date: new Date(now - 4 * 60_000),
|
|
2264
|
-
open: 108,
|
|
2265
|
-
high: 120,
|
|
2266
|
-
low: 105,
|
|
2267
|
-
close: 115,
|
|
2268
|
-
volume: 800,
|
|
2269
|
-
},
|
|
2270
|
-
],
|
|
2271
|
-
});
|
|
2272
|
-
const spec: ChartSpec = chartSpec({
|
|
2273
|
-
viewport: { range: "1D", resolution: "5m" },
|
|
2274
|
-
series: [{
|
|
2275
|
-
id: "price",
|
|
2276
|
-
source,
|
|
2277
|
-
style: "candles",
|
|
2278
|
-
transform: "raw",
|
|
2279
|
-
axis: "left",
|
|
2280
|
-
panelId: "main",
|
|
2281
|
-
interpolation: "none",
|
|
2282
|
-
}],
|
|
2283
|
-
});
|
|
2284
|
-
const quoteOverrides = new Map([[
|
|
2285
|
-
chartQuoteOverrideKeyForSource(source),
|
|
2286
|
-
{
|
|
2287
|
-
symbol: "LIVE",
|
|
2288
|
-
price: 121,
|
|
2289
|
-
currency: "USD",
|
|
2290
|
-
change: 6,
|
|
2291
|
-
changePercent: 5.2,
|
|
2292
|
-
lastUpdated: now,
|
|
2293
|
-
},
|
|
2294
|
-
]]);
|
|
2295
|
-
|
|
2296
|
-
const result = await resolveChartSpecData(spec, {
|
|
2297
|
-
dataProvider: provider,
|
|
2298
|
-
now: new Date(now),
|
|
2299
|
-
quoteOverrides,
|
|
2300
|
-
loadFredSeries: async () => fredLoad(),
|
|
2301
|
-
});
|
|
2302
|
-
|
|
2303
|
-
expect(result.errors).toEqual([]);
|
|
2304
|
-
const price = result.series.find((entry) => entry.id === "price")!;
|
|
2305
|
-
expect(price.points).toHaveLength(2);
|
|
2306
|
-
expect(price.points.at(-1)).toMatchObject({
|
|
2307
|
-
date: new Date(now - 4 * 60_000),
|
|
2308
|
-
value: 121,
|
|
2309
|
-
open: 108,
|
|
2310
|
-
high: 121,
|
|
2311
|
-
low: 105,
|
|
2312
|
-
close: 121,
|
|
2313
|
-
volume: 800,
|
|
2314
|
-
});
|
|
2315
|
-
});
|
|
2316
|
-
|
|
2317
|
-
test("calculates formulas and volume from raw inputs before display transforms", async () => {
|
|
2318
|
-
const provider = createTestDataProvider({
|
|
2319
|
-
getTickerFinancials: async () => emptyFinancials(),
|
|
2320
|
-
getPriceHistoryForResolution: async (symbol) => symbol === "LEFT"
|
|
2321
|
-
? [
|
|
2322
|
-
{ date: new Date("2025-01-01T00:00:00Z"), close: 100, volume: 1_000 },
|
|
2323
|
-
{ date: new Date("2025-01-02T00:00:00Z"), close: 120, volume: 1_200 },
|
|
2324
|
-
]
|
|
2325
|
-
: [
|
|
2326
|
-
{ date: new Date("2025-01-01T00:00:00Z"), close: 200, volume: 2_000 },
|
|
2327
|
-
{ date: new Date("2025-01-02T00:00:00Z"), close: 240, volume: 2_400 },
|
|
2328
|
-
],
|
|
2329
|
-
});
|
|
2330
|
-
const makeSeries = (id: string, symbol: string): ChartSpec["series"][number] => (chartSeries({
|
|
2331
|
-
id,
|
|
2332
|
-
source: { kind: "security", instrument: { symbol }, fieldId: "market.ohlcv" },
|
|
2333
|
-
transform: "percent",
|
|
2334
|
-
}));
|
|
2335
|
-
const spec: ChartSpec = chartSpec({
|
|
2336
|
-
viewport: { range: "1Y", resolution: "1d" },
|
|
2337
|
-
panels: [{ id: "main" }, { id: "formula" }, { id: "volume" }],
|
|
2338
|
-
series: [makeSeries("left", "LEFT"), makeSeries("right", "RIGHT")],
|
|
2339
|
-
studies: [
|
|
2340
|
-
{
|
|
2341
|
-
id: "ratio",
|
|
2342
|
-
kind: "ratio",
|
|
2343
|
-
inputSeriesIds: ["left", "right"],
|
|
2344
|
-
parameters: {},
|
|
2345
|
-
panelId: "formula",
|
|
2346
|
-
axis: "left",
|
|
2347
|
-
},
|
|
2348
|
-
{
|
|
2349
|
-
id: "volume",
|
|
2350
|
-
kind: "volume",
|
|
2351
|
-
inputSeriesIds: ["left"],
|
|
2352
|
-
parameters: {},
|
|
2353
|
-
panelId: "volume",
|
|
2354
|
-
axis: "left",
|
|
2355
|
-
},
|
|
2356
|
-
{
|
|
2357
|
-
id: "sma",
|
|
2358
|
-
kind: "sma",
|
|
2359
|
-
inputSeriesIds: ["left"],
|
|
2360
|
-
parameters: { period: 2 },
|
|
2361
|
-
panelId: "main",
|
|
2362
|
-
axis: "left",
|
|
2363
|
-
},
|
|
2364
|
-
],
|
|
2365
|
-
});
|
|
2366
|
-
|
|
2367
|
-
const result = await resolveChartSpecData(spec, {
|
|
2368
|
-
dataProvider: provider,
|
|
2369
|
-
now: new Date("2025-01-02T00:00:00Z"),
|
|
2370
|
-
loadFredSeries: async () => fredLoad(),
|
|
2371
|
-
});
|
|
2372
|
-
|
|
2373
|
-
expect(result.errors).toEqual([]);
|
|
2374
|
-
expect(result.series.find((series) => series.id === "ratio")?.points.map((point) => point.value))
|
|
2375
|
-
.toEqual([0.5, 0.5]);
|
|
2376
|
-
expect(result.series.find((series) => series.id === "volume")?.points.map((point) => point.value))
|
|
2377
|
-
.toEqual([1_000, 1_200]);
|
|
2378
|
-
expect(result.series.find((series) => series.id === "sma")).toMatchObject({
|
|
2379
|
-
transform: "percent",
|
|
2380
|
-
unit: "%",
|
|
2381
|
-
});
|
|
2382
|
-
expect(result.series.find((series) => series.id === "sma")?.points.map((point) => point.value))
|
|
2383
|
-
.toEqual([10]);
|
|
2384
|
-
});
|
|
2385
|
-
});
|
|
2386
|
-
|
|
2387
|
-
describe("mergePriceHistoryWindows", () => {
|
|
2388
|
-
const legacyMerge = (
|
|
2389
|
-
current: TickerFinancials["priceHistory"],
|
|
2390
|
-
incoming: TickerFinancials["priceHistory"],
|
|
2391
|
-
resolution: "1h" | "1d",
|
|
2392
|
-
) => {
|
|
2393
|
-
const byTimestamp = new Map<number, TickerFinancials["priceHistory"][number]>();
|
|
2394
|
-
for (const point of [...current, ...incoming]) {
|
|
2395
|
-
const timestamp = point.date.getTime();
|
|
2396
|
-
if (Number.isFinite(timestamp)) byTimestamp.set(timestamp, point);
|
|
2397
|
-
}
|
|
2398
|
-
const sorted = [...byTimestamp.values()].sort((left, right) => left.date.getTime() - right.date.getTime());
|
|
2399
|
-
if (resolution === "1h") return sorted;
|
|
2400
|
-
const plotted = new Set(current.map((point) => point.date.getTime()));
|
|
2401
|
-
const merged: TickerFinancials["priceHistory"] = [];
|
|
2402
|
-
for (const point of sorted) {
|
|
2403
|
-
const previous = merged.at(-1);
|
|
2404
|
-
if (!previous || point.date.getTime() - previous.date.getTime() >= 86_400_000 * 0.8) {
|
|
2405
|
-
merged.push(point);
|
|
2406
|
-
} else if (!plotted.has(previous.date.getTime()) && plotted.has(point.date.getTime())) {
|
|
2407
|
-
merged[merged.length - 1] = point;
|
|
2408
|
-
}
|
|
2409
|
-
}
|
|
2410
|
-
return merged;
|
|
2411
|
-
};
|
|
2412
|
-
|
|
2413
|
-
test("linear merge matches the prior merge for overlaps, duplicates, and unsorted fallback", () => {
|
|
2414
|
-
const point = (date: string, close: number) => ({ date: new Date(date), close });
|
|
2415
|
-
const sortedCurrent = [
|
|
2416
|
-
point("2026-07-28T13:30:00Z", 110),
|
|
2417
|
-
point("2026-07-29T13:30:00Z", 115),
|
|
2418
|
-
point("2026-07-29T13:30:00Z", 116),
|
|
2419
|
-
point("2026-07-30T13:30:00Z", 120),
|
|
2420
|
-
];
|
|
2421
|
-
const incoming = [
|
|
2422
|
-
point("2026-07-27T22:00:00Z", 111),
|
|
2423
|
-
point("2026-07-29T13:30:00Z", 999),
|
|
2424
|
-
point("2026-07-29T22:00:00Z", 121),
|
|
2425
|
-
];
|
|
2426
|
-
|
|
2427
|
-
for (const current of [sortedCurrent, [...sortedCurrent].reverse()]) {
|
|
2428
|
-
for (const resolution of ["1h", "1d"] as const) {
|
|
2429
|
-
expect(mergePriceHistoryWindows(current, incoming, resolution)).toEqual(
|
|
2430
|
-
legacyMerge(current, incoming, resolution),
|
|
2431
|
-
);
|
|
2432
|
-
}
|
|
2433
|
-
}
|
|
2434
|
-
});
|
|
2435
|
-
});
|
|
2436
|
-
|
|
2437
|
-
test("financial charts disclose snapshot vintages once without changing period or availability timestamps", async () => {
|
|
2438
|
-
const dataProvider = createTestDataProvider({ getTickerFinancials: async () => ({
|
|
2439
|
-
annualStatements: [{ date: "2017-06-30", totalRevenue: 96_571_000_000, netIncome: 25_489_000_000, fieldAvailability: { totalRevenue: "2018-08-03", netIncome: "2018-08-03" } }],
|
|
2440
|
-
quarterlyStatements: [], priceHistory: [],
|
|
2441
|
-
}) });
|
|
2442
|
-
for (const timestampMode of ["period-end", "available-at"] as const) {
|
|
2443
|
-
const result = await resolveChartSpecData(chartSpec({ viewport: { range: "ALL", resolution: "auto" },
|
|
2444
|
-
series: ["totalRevenue", "netIncome"].map((field) => chartSeries({ id: field, style: "columns",
|
|
2445
|
-
source: { kind: "security", instrument: { symbol: "MSFT", exchange: "NASDAQ" }, fieldId: `fundamental.${field}`, period: "annual", timestampMode },
|
|
2446
|
-
})),
|
|
2447
|
-
}), { dataProvider });
|
|
2448
|
-
expect(result.warnings.filter((warning) => warning === FINANCIAL_VINTAGE_NOTICE)).toHaveLength(1);
|
|
2449
|
-
expect(result.series[0]?.points[0]).toMatchObject({ value: 96_571_000_000, observedAt: new Date("2017-06-30T00:00:00Z"), availableAt: new Date("2018-08-03T00:00:00Z"), date: new Date(timestampMode === "period-end" ? "2017-06-30T00:00:00Z" : "2018-08-03T00:00:00Z") });
|
|
2450
|
-
}
|
|
2451
|
-
});
|
|
2452
|
-
|
|
2453
|
-
test.each([-9, 0, 12])("forward P/E chart handles reported multiple %s without inventing comparable points", async (forwardPE) => {
|
|
2454
|
-
const now = new Date("2026-06-01T16:00:00Z");
|
|
2455
|
-
const financials = { ...emptyFinancials(), fundamentals: { forwardPE },
|
|
2456
|
-
quote: { symbol: "TEST", price: 20, currency: "USD", change: 0, changePercent: 0, lastUpdated: now.getTime() } };
|
|
2457
|
-
const provider = createTestDataProvider({ getTickerFinancials: async () => financials });
|
|
2458
|
-
const spec = chartSpec({ viewport: { range: "1Y", resolution: "auto" }, series: [chartSeries({
|
|
2459
|
-
source: { kind: "security", instrument: { symbol: "TEST" }, fieldId: "valuation.forwardPE" },
|
|
2460
|
-
})] });
|
|
2461
|
-
const result = await resolveChartSpecData(spec, { dataProvider: provider, now, loadFredSeries: async () => fredLoad() });
|
|
2462
|
-
expect(result.errors).toEqual([]);
|
|
2463
|
-
if (forwardPE > 0) {
|
|
2464
|
-
expect(result.series[0]?.points.map((point) => point.value)).toEqual([12]);
|
|
2465
|
-
expect(result.series[0]?.warning).toBeUndefined();
|
|
2466
|
-
} else {
|
|
2467
|
-
expect(result.series[0]?.points).toEqual([]);
|
|
2468
|
-
expect(result.series[0]?.warning).toContain("not meaningful");
|
|
2469
|
-
}
|
|
2470
|
-
expect(financials.fundamentals.forwardPE).toBe(forwardPE);
|
|
2471
|
-
});
|