@forgecharts/sdk 1.2.3 → 1.2.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Omne-YBWT34SS.png +0 -0
- package/dist/Rithmic-CDB4YQEZ.png +0 -0
- package/dist/api/DrawingManager.d.ts +1 -1
- package/dist/api/DrawingManager.d.ts.map +1 -1
- package/dist/api/IndicatorDAG.d.ts +22 -0
- package/dist/api/IndicatorDAG.d.ts.map +1 -1
- package/dist/api/IndicatorRegistry.d.ts +6 -0
- package/dist/api/IndicatorRegistry.d.ts.map +1 -1
- package/dist/api/LayoutManager.d.ts +1 -0
- package/dist/api/LayoutManager.d.ts.map +1 -1
- package/dist/api/TChart.d.ts +30 -1
- package/dist/api/TChart.d.ts.map +1 -1
- package/dist/core/Chart.d.ts +8 -0
- package/dist/core/Chart.d.ts.map +1 -1
- package/dist/core/IndicatorEngine.d.ts +15 -0
- package/dist/core/IndicatorEngine.d.ts.map +1 -1
- package/dist/core/InteractionManager.d.ts +19 -0
- package/dist/core/InteractionManager.d.ts.map +1 -1
- package/dist/core/Series.d.ts.map +1 -1
- package/dist/core/indicatorStyles.d.ts +37 -0
- package/dist/core/indicatorStyles.d.ts.map +1 -0
- package/dist/datafeed/DatafeedConnector.d.ts +23 -0
- package/dist/datafeed/DatafeedConnector.d.ts.map +1 -1
- package/dist/engine/CandleEngine.d.ts +2 -0
- package/dist/engine/CandleEngine.d.ts.map +1 -1
- package/dist/forgecharts.css +123 -53
- package/dist/forgescript/runtime.d.ts +6 -0
- package/dist/forgescript/runtime.d.ts.map +1 -1
- package/dist/index.d.ts +15 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8682 -367
- package/dist/index.js.map +1 -1
- package/dist/internal.js +8683 -368
- package/dist/internal.js.map +1 -1
- package/dist/licensing/ChartRuntimeResolver.d.ts +164 -123
- package/dist/licensing/ChartRuntimeResolver.d.ts.map +1 -1
- package/dist/licensing/LicenseManager.d.ts +17 -2
- package/dist/licensing/LicenseManager.d.ts.map +1 -1
- package/dist/licensing/__tests__/ChartRuntimeResolver.test.d.ts +5 -0
- package/dist/licensing/__tests__/ChartRuntimeResolver.test.d.ts.map +1 -1
- package/dist/licensing/__tests__/LicenseManager.test.d.ts +3 -0
- package/dist/licensing/__tests__/LicenseManager.test.d.ts.map +1 -1
- package/dist/licensing/__tests__/capabilityMatrix.test.d.ts +11 -0
- package/dist/licensing/__tests__/capabilityMatrix.test.d.ts.map +1 -0
- package/dist/licensing/capabilityMatrix.d.ts +77 -0
- package/dist/licensing/capabilityMatrix.d.ts.map +1 -0
- package/dist/licensing/licenseTypes.d.ts +83 -16
- package/dist/licensing/licenseTypes.d.ts.map +1 -1
- package/dist/node.d.ts +59 -0
- package/dist/node.d.ts.map +1 -0
- package/dist/pixi/PixiCandlestickRenderer.d.ts +14 -0
- package/dist/pixi/PixiCandlestickRenderer.d.ts.map +1 -1
- package/dist/pixi/PixiChart.d.ts +8 -0
- package/dist/pixi/PixiChart.d.ts.map +1 -1
- package/dist/pixi/PixiCrosshairRenderer.d.ts.map +1 -1
- package/dist/pixi/PixiDrawingRenderer.d.ts.map +1 -1
- package/dist/pixi/PixiGridRenderer.d.ts +2 -0
- package/dist/pixi/PixiGridRenderer.d.ts.map +1 -1
- package/dist/pixi/PixiIndicatorRenderer.d.ts +4 -0
- package/dist/pixi/PixiIndicatorRenderer.d.ts.map +1 -1
- package/dist/pixi/PixiTradingRenderer.d.ts +54 -0
- package/dist/pixi/PixiTradingRenderer.d.ts.map +1 -1
- package/dist/pixi/snap.d.ts +38 -0
- package/dist/pixi/snap.d.ts.map +1 -0
- package/dist/react/agent/AgentFAB.d.ts +2 -1
- package/dist/react/agent/AgentFAB.d.ts.map +1 -1
- package/dist/react/agent/AgentProvider.d.ts +1 -1
- package/dist/react/agent/AgentProvider.d.ts.map +1 -1
- package/dist/react/agent/AgentUIBus.d.ts +7 -0
- package/dist/react/agent/AgentUIBus.d.ts.map +1 -1
- package/dist/react/agent/AssistantPanel.d.ts +2 -1
- package/dist/react/agent/AssistantPanel.d.ts.map +1 -1
- package/dist/react/agent/CommandDispatcher.d.ts +6 -2
- package/dist/react/agent/CommandDispatcher.d.ts.map +1 -1
- package/dist/react/agent/contractUtils.d.ts +31 -0
- package/dist/react/agent/contractUtils.d.ts.map +1 -0
- package/dist/react/agent/useAgent.d.ts +2 -2
- package/dist/react/agent/useAgent.d.ts.map +1 -1
- package/dist/react/canvas/ChartCanvas.d.ts +10 -0
- package/dist/react/canvas/ChartCanvas.d.ts.map +1 -1
- package/dist/react/canvas/ChartContextMenu.d.ts +1 -1
- package/dist/react/canvas/ChartContextMenu.d.ts.map +1 -1
- package/dist/react/canvas/ChartSettingsDialog.d.ts +1 -1
- package/dist/react/canvas/ChartSettingsDialog.d.ts.map +1 -1
- package/dist/react/canvas/ContractSwitchDialog.d.ts +1 -1
- package/dist/react/canvas/ContractSwitchDialog.d.ts.map +1 -1
- package/dist/react/canvas/DrawingPropertiesDialog.d.ts +1 -1
- package/dist/react/canvas/DrawingPropertiesDialog.d.ts.map +1 -1
- package/dist/react/canvas/IndicatorLabel.d.ts +11 -3
- package/dist/react/canvas/IndicatorLabel.d.ts.map +1 -1
- package/dist/react/canvas/IndicatorPane.d.ts +1 -1
- package/dist/react/canvas/IndicatorPane.d.ts.map +1 -1
- package/dist/react/canvas/PositionPropertiesDialog.d.ts +1 -1
- package/dist/react/canvas/PositionPropertiesDialog.d.ts.map +1 -1
- package/dist/react/canvas/TableOverlay.d.ts +1 -1
- package/dist/react/canvas/TableOverlay.d.ts.map +1 -1
- package/dist/react/canvas/toolbars/LeftToolbar.d.ts +4 -2
- package/dist/react/canvas/toolbars/LeftToolbar.d.ts.map +1 -1
- package/dist/react/hooks/useChartCapabilities.d.ts.map +1 -1
- package/dist/react/index.js +4452 -735
- package/dist/react/index.js.map +1 -1
- package/dist/react/internal.js +6148 -1387
- package/dist/react/internal.js.map +1 -1
- package/dist/react/shell/DatasetImportPanel.d.ts +13 -1
- package/dist/react/shell/DatasetImportPanel.d.ts.map +1 -1
- package/dist/react/shell/DatasetManagerDrawer.d.ts +11 -1
- package/dist/react/shell/DatasetManagerDrawer.d.ts.map +1 -1
- package/dist/react/shell/DepthOfMarketPanel.d.ts +18 -0
- package/dist/react/shell/DepthOfMarketPanel.d.ts.map +1 -0
- package/dist/react/shell/DocsEditor.d.ts +8 -1
- package/dist/react/shell/DocsEditor.d.ts.map +1 -1
- package/dist/react/shell/ManagedAppShell.d.ts.map +1 -1
- package/dist/react/shell/OrderEntryPanel.d.ts +16 -1
- package/dist/react/shell/OrderEntryPanel.d.ts.map +1 -1
- package/dist/react/shell/ScriptDrawer.d.ts +7 -1
- package/dist/react/shell/ScriptDrawer.d.ts.map +1 -1
- package/dist/react/shell/ScriptSettings.d.ts +7 -1
- package/dist/react/shell/ScriptSettings.d.ts.map +1 -1
- package/dist/react/shell/TradeDrawer.d.ts +8 -1
- package/dist/react/shell/TradeDrawer.d.ts.map +1 -1
- package/dist/react/shell/WatchlistDrawer.d.ts +2 -1
- package/dist/react/shell/WatchlistDrawer.d.ts.map +1 -1
- package/dist/react/shell/useDepthSubscription.d.ts +12 -0
- package/dist/react/shell/useDepthSubscription.d.ts.map +1 -0
- package/dist/react/shell/useWatchlistQuotes.d.ts +6 -0
- package/dist/react/shell/useWatchlistQuotes.d.ts.map +1 -1
- package/dist/react/workspace/BottomTradingPanel.d.ts +4 -1
- package/dist/react/workspace/BottomTradingPanel.d.ts.map +1 -1
- package/dist/react/workspace/ChartWorkspace.d.ts +30 -1
- package/dist/react/workspace/ChartWorkspace.d.ts.map +1 -1
- package/dist/react/workspace/FloatingPanel.d.ts +1 -1
- package/dist/react/workspace/FloatingPanel.d.ts.map +1 -1
- package/dist/react/workspace/GridChartContainer.d.ts +40 -0
- package/dist/react/workspace/GridChartContainer.d.ts.map +1 -0
- package/dist/react/workspace/GridSyncContext.d.ts +32 -0
- package/dist/react/workspace/GridSyncContext.d.ts.map +1 -0
- package/dist/react/workspace/GridTemplates.d.ts +16 -0
- package/dist/react/workspace/GridTemplates.d.ts.map +1 -0
- package/dist/react/workspace/IndicatorsDialog.d.ts +1 -1
- package/dist/react/workspace/IndicatorsDialog.d.ts.map +1 -1
- package/dist/react/workspace/LayoutMenu.d.ts +1 -1
- package/dist/react/workspace/LayoutMenu.d.ts.map +1 -1
- package/dist/react/workspace/LayoutTemplateSelector.d.ts +16 -0
- package/dist/react/workspace/LayoutTemplateSelector.d.ts.map +1 -0
- package/dist/react/workspace/SymbolSearchDialog.d.ts +1 -1
- package/dist/react/workspace/SymbolSearchDialog.d.ts.map +1 -1
- package/dist/react/workspace/TabBar.d.ts +4 -1
- package/dist/react/workspace/TabBar.d.ts.map +1 -1
- package/dist/react/workspace/toolbars/BottomToolbar.d.ts +5 -1
- package/dist/react/workspace/toolbars/BottomToolbar.d.ts.map +1 -1
- package/dist/react/workspace/toolbars/RightToolbar.d.ts +6 -1
- package/dist/react/workspace/toolbars/RightToolbar.d.ts.map +1 -1
- package/dist/react/workspace/toolbars/TopToolbar.d.ts +17 -2
- package/dist/react/workspace/toolbars/TopToolbar.d.ts.map +1 -1
- package/dist/services/BarPrefetchCache.d.ts +39 -0
- package/dist/services/BarPrefetchCache.d.ts.map +1 -0
- package/dist/trading/__tests__/managedCapabilities.test.d.ts +11 -0
- package/dist/trading/__tests__/managedCapabilities.test.d.ts.map +1 -0
- package/dist/trading/managed/ManagedTradingController.d.ts.map +1 -1
- package/dist/trading/managed/managedCapabilities.d.ts +45 -13
- package/dist/trading/managed/managedCapabilities.d.ts.map +1 -1
- package/dist/types/ChartBackend.d.ts +6 -0
- package/dist/types/ChartBackend.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -2,41 +2,31 @@
|
|
|
2
2
|
* ChartRuntimeResolver
|
|
3
3
|
*
|
|
4
4
|
* Single source of truth for runtime capability queries.
|
|
5
|
-
* Mode
|
|
6
|
-
* never passed in by chart config, ensuring clients cannot bypass
|
|
7
|
-
* license-driven
|
|
5
|
+
* Mode and productTier are always derived from the installed LicenseManager
|
|
6
|
+
* state — never passed in by chart config, ensuring clients cannot bypass
|
|
7
|
+
* license-driven gating.
|
|
8
|
+
*
|
|
9
|
+
* Capability resolution (3-model schema — deploymentMode × productTier):
|
|
10
|
+
* 1. The 8 canonical capabilities (orderEntry, managedTrading,
|
|
11
|
+
* draggableOrders, bracketOrders, externalIngestion,
|
|
12
|
+
* symbolResolverRequired, tradingBridgeRequired, fullAppShell) are
|
|
13
|
+
* read directly from `LicenseManager.getCapabilities()`, which was
|
|
14
|
+
* resolved once at license-load time by `capabilityMatrix.ts`'s
|
|
15
|
+
* tier × mode matrix. No capability is ever gated on `deploymentMode`
|
|
16
|
+
* alone here.
|
|
17
|
+
* 2. Other granular features (trailingStops, positionsOverlay, and the
|
|
18
|
+
* generic charting/data/scripting/workspace flags) use the license
|
|
19
|
+
* payload's `features` map, gated on `productTier` (not mode) where
|
|
20
|
+
* trading-adjacent, defaulting to allowed when omitted.
|
|
8
21
|
*
|
|
9
22
|
* Usage:
|
|
10
23
|
* import { ChartRuntimeResolver } from '@forgecharts/sdk';
|
|
11
24
|
* const resolver = ChartRuntimeResolver.getInstance();
|
|
12
|
-
*
|
|
13
|
-
* resolver.
|
|
14
|
-
* resolver.
|
|
15
|
-
* resolver.canUseOrderEntry() // built-in order entry UI
|
|
16
|
-
* resolver.canUseExternalIngestion() // external data ingestion APIs
|
|
17
|
-
* resolver.canRenderOverlays() // overlay rendering
|
|
18
|
-
* resolver.canUseIndicators() // indicator panel
|
|
19
|
-
* resolver.canUseManagedTrading() // managed broker / execution hooks
|
|
20
|
-
* resolver.canUseDraggableOrders() // drag-to-price order placement
|
|
21
|
-
* resolver.canUseBracketOrders() // bracket / OCO order support
|
|
22
|
-
*
|
|
23
|
-
* Capability matrix
|
|
24
|
-
* ─────────────────────────────────────────────────────
|
|
25
|
-
* Capability unmanaged managed
|
|
26
|
-
* ─────────────────────────────────────────────────────
|
|
27
|
-
* externalIngestion ✓ ✗ (managed feed owns data)
|
|
28
|
-
* overlays ✓ ✓ (both modes render overlays)
|
|
29
|
-
* indicators ✓ ✓
|
|
30
|
-
* orderEntry ✗ ✓ (requires managed license)
|
|
31
|
-
* managedTrading ✗ ✓
|
|
32
|
-
* draggableOrders ✗ ✓
|
|
33
|
-
* bracketOrders ✗ ✓
|
|
34
|
-
* ─────────────────────────────────────────────────────
|
|
35
|
-
*
|
|
36
|
-
* Feature flags in the LicensePayload can further restrict capabilities
|
|
37
|
-
* within a mode. A managed license with `orderEntry: false` will still
|
|
38
|
-
* return false from canUseOrderEntry().
|
|
25
|
+
* resolver.getProductTier();
|
|
26
|
+
* resolver.canUseOrderEntry();
|
|
27
|
+
* resolver.hasFeature('barReplay');
|
|
39
28
|
*/
|
|
29
|
+
import type { ProductTier } from './capabilityMatrix';
|
|
40
30
|
export declare class ChartRuntimeResolver {
|
|
41
31
|
#private;
|
|
42
32
|
private static instance;
|
|
@@ -49,106 +39,130 @@ export declare class ChartRuntimeResolver {
|
|
|
49
39
|
/** True when no license is installed or the license is in unmanaged mode. */
|
|
50
40
|
isUnmanagedMode(): boolean;
|
|
51
41
|
/**
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
* Overlay rendering from external state (price levels, zones, signals).
|
|
59
|
-
* Enabled in both modes by default; can be restricted via feature flag.
|
|
60
|
-
*/
|
|
61
|
-
canRenderOverlays(): boolean;
|
|
62
|
-
/**
|
|
63
|
-
* Indicator panel / computations.
|
|
64
|
-
* Enabled in both modes by default; can be restricted via feature flag.
|
|
42
|
+
* Check whether a specific platform feature is enabled.
|
|
43
|
+
*
|
|
44
|
+
* Resolution (capability-driven — never gated on deploymentMode alone):
|
|
45
|
+
* 1. If the feature is a trading feature and productTier is 'core' → false.
|
|
46
|
+
* 2. If the feature has an explicit flag in the license → use it.
|
|
47
|
+
* 3. Default: true for platform/trading tier, true for non-trading features.
|
|
65
48
|
*/
|
|
49
|
+
hasFeature(name: string): boolean;
|
|
50
|
+
/** The entitlement tier driven by the active license. */
|
|
51
|
+
getProductTier(): ProductTier;
|
|
52
|
+
/** Chart type selection (candlestick, bar, line, area, etc.). */
|
|
53
|
+
canUseChartTypes(): boolean;
|
|
54
|
+
/** Basic drawing tools (trend lines, horizontal lines, etc.). */
|
|
55
|
+
canUseDrawingTools(): boolean;
|
|
56
|
+
/** Extended drawing tools (Fibonacci, Gann, pitchfork, etc.). */
|
|
57
|
+
canUseExtendedDrawings(): boolean;
|
|
58
|
+
/** Indicator panel / computations. */
|
|
66
59
|
canUseIndicators(): boolean;
|
|
60
|
+
/** Multiple panes (indicator panels below price chart). */
|
|
61
|
+
canUseMultiPane(): boolean;
|
|
62
|
+
/** Bar replay / market replay feature. */
|
|
63
|
+
canUseBarReplay(): boolean;
|
|
64
|
+
/** Custom timeframes beyond the standard set. */
|
|
65
|
+
canUseCustomTimeframes(): boolean;
|
|
66
|
+
/** Overlay rendering (price levels, zones, signals). */
|
|
67
|
+
canRenderOverlays(): boolean;
|
|
68
|
+
/** Historical data access. */
|
|
69
|
+
canUseHistoricalData(): boolean;
|
|
70
|
+
/** Real-time data streaming. */
|
|
71
|
+
canUseRealtimeData(): boolean;
|
|
72
|
+
/** Multiple data providers / feeds. */
|
|
73
|
+
canUseMultipleProviders(): boolean;
|
|
74
|
+
/** Data export functionality. */
|
|
75
|
+
canUseDataExport(): boolean;
|
|
67
76
|
/**
|
|
68
77
|
* Built-in order entry UI hooks.
|
|
69
|
-
*
|
|
70
|
-
*
|
|
78
|
+
* Ceiling driven by `productTier` (core = false, trading/platform = true) —
|
|
79
|
+
* available in both Unmanaged Trading and Managed Platform. An explicit
|
|
80
|
+
* `features.orderEntry` flag on the payload may only narrow below the
|
|
81
|
+
* ceiling, never elevate above it.
|
|
71
82
|
*/
|
|
72
83
|
canUseOrderEntry(): boolean;
|
|
73
84
|
/**
|
|
74
85
|
* Managed trading service hooks (broker execution, position management).
|
|
75
|
-
*
|
|
76
|
-
*
|
|
86
|
+
* Only true for Managed Platform — `managedTrading` is forced off under
|
|
87
|
+
* unmanaged deployment regardless of tier (see capabilityMatrix).
|
|
77
88
|
*/
|
|
78
89
|
canUseManagedTrading(): boolean;
|
|
79
90
|
/**
|
|
80
91
|
* Drag-to-price order placement.
|
|
81
|
-
*
|
|
82
|
-
*
|
|
92
|
+
* Ceiling driven by `productTier` — available in Unmanaged Trading and
|
|
93
|
+
* Managed Platform.
|
|
83
94
|
*/
|
|
84
95
|
canUseDraggableOrders(): boolean;
|
|
85
96
|
/**
|
|
86
97
|
* Bracket / OCO order support.
|
|
87
|
-
*
|
|
88
|
-
*
|
|
98
|
+
* Ceiling driven by `productTier` — available in Unmanaged Trading and
|
|
99
|
+
* Managed Platform.
|
|
89
100
|
*/
|
|
90
101
|
canUseBracketOrders(): boolean;
|
|
91
102
|
/**
|
|
92
|
-
* Whether
|
|
93
|
-
*
|
|
103
|
+
* Whether trading UI must route execution through host-supplied intent
|
|
104
|
+
* handlers rather than a managed backend (Unmanaged Trading only).
|
|
94
105
|
*/
|
|
95
|
-
|
|
106
|
+
requiresTradingBridge(): boolean;
|
|
107
|
+
/** Whether the host must supply an `ISymbolResolver` (unmanaged tiers). */
|
|
108
|
+
requiresSymbolResolver(): boolean;
|
|
109
|
+
/** Whether the full managed app shell should render (Managed Platform only). */
|
|
110
|
+
hasFullAppShell(): boolean;
|
|
96
111
|
/**
|
|
97
|
-
*
|
|
98
|
-
*
|
|
112
|
+
* Trailing stop orders. Not part of the core capability set — gated on
|
|
113
|
+
* productTier (not deploymentMode) to keep the two axes independent.
|
|
99
114
|
*/
|
|
100
|
-
|
|
115
|
+
canUseTrailingStops(): boolean;
|
|
101
116
|
/**
|
|
102
|
-
*
|
|
103
|
-
*
|
|
117
|
+
* Positions overlay on chart. Not part of the core capability set — gated
|
|
118
|
+
* on productTier (not deploymentMode) to keep the two axes independent.
|
|
104
119
|
*/
|
|
105
|
-
|
|
120
|
+
canUsePositionsOverlay(): boolean;
|
|
121
|
+
/** ForgeScript scripting engine. */
|
|
122
|
+
canUseForgeScript(): boolean;
|
|
123
|
+
/** Custom indicator creation. */
|
|
124
|
+
canUseCustomIndicators(): boolean;
|
|
125
|
+
/** AI agent integration. */
|
|
126
|
+
canUseAiAgent(): boolean;
|
|
127
|
+
/** Save and restore chart layouts. */
|
|
128
|
+
canUseSavedLayouts(): boolean;
|
|
129
|
+
/** Multiple workspaces / tabs. */
|
|
130
|
+
canUseMultipleWorkspaces(): boolean;
|
|
131
|
+
/** Watchlist management. */
|
|
132
|
+
canUseWatchlists(): boolean;
|
|
133
|
+
/** Price / indicator alerts. */
|
|
134
|
+
canUseAlerts(): boolean;
|
|
135
|
+
/** Multi-chart grid layout. */
|
|
136
|
+
canUseMultiChartLayout(): boolean;
|
|
106
137
|
/**
|
|
107
|
-
*
|
|
108
|
-
*
|
|
109
|
-
*
|
|
138
|
+
* External data ingestion APIs (e.g. pushing tick data from an external broker).
|
|
139
|
+
* Driven by `productTier`/`deploymentMode` via `capabilities.externalIngestion`
|
|
140
|
+
* — true for core/trading, false for Managed Platform (the managed feed owns data).
|
|
110
141
|
*/
|
|
142
|
+
canUseExternalIngestion(): boolean;
|
|
143
|
+
/** Whether to render the order entry tool in the toolbar. */
|
|
144
|
+
canRenderOrderEntry(): boolean;
|
|
145
|
+
/** Whether to render Buy / Sell action buttons. */
|
|
146
|
+
canRenderBuySellButtons(): boolean;
|
|
147
|
+
/** Whether to render the order ticket panel. */
|
|
148
|
+
canRenderOrderTicket(): boolean;
|
|
149
|
+
/** Whether to render bracket order controls (TP, SL, OCO). */
|
|
111
150
|
canRenderBracketControls(): boolean;
|
|
112
|
-
/**
|
|
113
|
-
* Whether to render order modification controls (drag-to-modify, edit panel).
|
|
114
|
-
* Requires managed mode with order entry AND the draggableOrders feature flag.
|
|
115
|
-
* If order entry itself is disabled, modification controls are also hidden.
|
|
116
|
-
*/
|
|
151
|
+
/** Whether to render order modification controls (drag-to-modify). */
|
|
117
152
|
canRenderOrderModificationControls(): boolean;
|
|
118
|
-
/**
|
|
119
|
-
* Whether to render the managed trading control panel as a whole.
|
|
120
|
-
* Guards the container that holds buy/sell, order ticket, bracket controls, etc.
|
|
121
|
-
*/
|
|
153
|
+
/** Whether to render the managed trading control panel. */
|
|
122
154
|
canRenderManagedTradingControls(): boolean;
|
|
123
|
-
/**
|
|
124
|
-
* True when the chart is in external-overlay-only (unmanaged) mode.
|
|
125
|
-
* Drives rendering of the external data overlay panel while suppressing
|
|
126
|
-
* all order entry UI elements.
|
|
127
|
-
*/
|
|
155
|
+
/** True when in external-overlay-only (unmanaged) mode. */
|
|
128
156
|
canRenderExternalOverlayOnlyMode(): boolean;
|
|
129
|
-
/**
|
|
130
|
-
* Positions are always rendered regardless of license mode.
|
|
131
|
-
* Data flows from TradingOverlayStore (host-pushed in unmanaged,
|
|
132
|
-
* ManagedTradingController-driven in managed).
|
|
133
|
-
*/
|
|
157
|
+
/** Positions rendering — always available (data from TradingOverlayStore). */
|
|
134
158
|
canRenderPositions(): boolean;
|
|
135
|
-
/**
|
|
136
|
-
* Execution fills are always rendered regardless of license mode.
|
|
137
|
-
*/
|
|
159
|
+
/** Execution fills — always rendered. */
|
|
138
160
|
canRenderFills(): boolean;
|
|
139
|
-
/**
|
|
140
|
-
* Candles are always rendered — unaffected by license mode.
|
|
141
|
-
* The RapidAPI datafeed remains active in all modes.
|
|
142
|
-
*/
|
|
161
|
+
/** Candles — always rendered (RapidAPI datafeed unaffected by mode). */
|
|
143
162
|
canRenderCandles(): boolean;
|
|
144
|
-
/**
|
|
145
|
-
* Indicator panel follows the `indicators` feature flag.
|
|
146
|
-
* Enabled in both modes by default.
|
|
147
|
-
*/
|
|
163
|
+
/** Indicators follow the `indicators` feature flag. */
|
|
148
164
|
canRenderIndicators(): boolean;
|
|
149
|
-
/**
|
|
150
|
-
* Drawing tools are always available regardless of license mode.
|
|
151
|
-
*/
|
|
165
|
+
/** Drawing tools follow the `drawingTools` feature flag. */
|
|
152
166
|
canRenderDrawings(): boolean;
|
|
153
167
|
/**
|
|
154
168
|
* Returns the full capability set as a plain object — useful for logging,
|
|
@@ -158,13 +172,37 @@ export declare class ChartRuntimeResolver {
|
|
|
158
172
|
}
|
|
159
173
|
export interface ChartCapabilities {
|
|
160
174
|
mode: 'managed' | 'unmanaged';
|
|
161
|
-
|
|
162
|
-
|
|
175
|
+
productTier: ProductTier;
|
|
176
|
+
symbolResolverRequired: boolean;
|
|
177
|
+
tradingBridgeRequired: boolean;
|
|
178
|
+
fullAppShell: boolean;
|
|
179
|
+
chartTypes: boolean;
|
|
180
|
+
drawingTools: boolean;
|
|
181
|
+
extendedDrawings: boolean;
|
|
163
182
|
indicators: boolean;
|
|
183
|
+
multiPane: boolean;
|
|
184
|
+
barReplay: boolean;
|
|
185
|
+
customTimeframes: boolean;
|
|
186
|
+
overlays: boolean;
|
|
187
|
+
historicalData: boolean;
|
|
188
|
+
realtimeData: boolean;
|
|
189
|
+
multipleProviders: boolean;
|
|
190
|
+
dataExport: boolean;
|
|
164
191
|
orderEntry: boolean;
|
|
165
192
|
managedTrading: boolean;
|
|
166
193
|
draggableOrders: boolean;
|
|
167
194
|
bracketOrders: boolean;
|
|
195
|
+
trailingStops: boolean;
|
|
196
|
+
positionsOverlay: boolean;
|
|
197
|
+
forgeScript: boolean;
|
|
198
|
+
customIndicators: boolean;
|
|
199
|
+
aiAgent: boolean;
|
|
200
|
+
savedLayouts: boolean;
|
|
201
|
+
multipleWorkspaces: boolean;
|
|
202
|
+
watchlists: boolean;
|
|
203
|
+
alerts: boolean;
|
|
204
|
+
multiChartLayout: boolean;
|
|
205
|
+
externalIngestion: boolean;
|
|
168
206
|
/** Show the order entry tool in toolbars (managed only). */
|
|
169
207
|
renderOrderEntry: boolean;
|
|
170
208
|
/** Show Buy / Sell action buttons (managed only). */
|
|
@@ -187,51 +225,54 @@ export interface ChartCapabilities {
|
|
|
187
225
|
renderCandles: boolean;
|
|
188
226
|
/** Indicators follow the `indicators` feature flag (both modes). */
|
|
189
227
|
renderIndicators: boolean;
|
|
190
|
-
/** Drawing tools
|
|
228
|
+
/** Drawing tools follow the `drawingTools` feature flag. */
|
|
191
229
|
renderDrawings: boolean;
|
|
192
230
|
}
|
|
193
|
-
/** True when a managed license is active. */
|
|
194
231
|
export declare const isManagedMode: () => boolean;
|
|
195
|
-
/** True when no license or unmanaged license is active (safe default). */
|
|
196
232
|
export declare const isUnmanagedMode: () => boolean;
|
|
197
|
-
|
|
198
|
-
export declare const
|
|
199
|
-
|
|
200
|
-
export declare const
|
|
201
|
-
|
|
233
|
+
export declare const getProductTier: () => ProductTier;
|
|
234
|
+
export declare const requiresTradingBridge: () => boolean;
|
|
235
|
+
export declare const requiresSymbolResolver: () => boolean;
|
|
236
|
+
export declare const hasFullAppShell: () => boolean;
|
|
237
|
+
export declare const canUseChartTypes: () => boolean;
|
|
238
|
+
export declare const canUseDrawingTools: () => boolean;
|
|
239
|
+
export declare const canUseExtendedDrawings: () => boolean;
|
|
202
240
|
export declare const canUseIndicators: () => boolean;
|
|
203
|
-
|
|
241
|
+
export declare const canUseMultiPane: () => boolean;
|
|
242
|
+
export declare const canUseBarReplay: () => boolean;
|
|
243
|
+
export declare const canUseCustomTimeframes: () => boolean;
|
|
244
|
+
export declare const canRenderOverlays: () => boolean;
|
|
245
|
+
export declare const canUseHistoricalData: () => boolean;
|
|
246
|
+
export declare const canUseRealtimeData: () => boolean;
|
|
247
|
+
export declare const canUseMultipleProviders: () => boolean;
|
|
248
|
+
export declare const canUseDataExport: () => boolean;
|
|
204
249
|
export declare const canUseOrderEntry: () => boolean;
|
|
205
|
-
/** Managed trading service hooks — managed mode only. */
|
|
206
250
|
export declare const canUseManagedTrading: () => boolean;
|
|
207
|
-
/** Drag-to-price order placement — managed mode only. */
|
|
208
251
|
export declare const canUseDraggableOrders: () => boolean;
|
|
209
|
-
/** Bracket / OCO order support — managed mode only. */
|
|
210
252
|
export declare const canUseBracketOrders: () => boolean;
|
|
211
|
-
|
|
253
|
+
export declare const canUseTrailingStops: () => boolean;
|
|
254
|
+
export declare const canUsePositionsOverlay: () => boolean;
|
|
255
|
+
export declare const canUseForgeScript: () => boolean;
|
|
256
|
+
export declare const canUseCustomIndicators: () => boolean;
|
|
257
|
+
export declare const canUseAiAgent: () => boolean;
|
|
258
|
+
export declare const canUseSavedLayouts: () => boolean;
|
|
259
|
+
export declare const canUseMultipleWorkspaces: () => boolean;
|
|
260
|
+
export declare const canUseWatchlists: () => boolean;
|
|
261
|
+
export declare const canUseAlerts: () => boolean;
|
|
262
|
+
export declare const canUseMultiChartLayout: () => boolean;
|
|
263
|
+
export declare const canUseExternalIngestion: () => boolean;
|
|
264
|
+
export declare const hasFeature: (name: string) => boolean;
|
|
212
265
|
export declare const getCapabilities: () => ChartCapabilities;
|
|
213
|
-
/** Whether to render the order entry tool in toolbars (managed only). */
|
|
214
266
|
export declare const canRenderOrderEntry: () => boolean;
|
|
215
|
-
/** Whether to render Buy/Sell buttons (managed only). */
|
|
216
267
|
export declare const canRenderBuySellButtons: () => boolean;
|
|
217
|
-
/** Whether to render the order ticket panel (managed only). */
|
|
218
268
|
export declare const canRenderOrderTicket: () => boolean;
|
|
219
|
-
/** Whether to render bracket / OCO controls (managed + bracketOrders feature). */
|
|
220
269
|
export declare const canRenderBracketControls: () => boolean;
|
|
221
|
-
/** Whether to render drag/edit order modification controls (managed + draggableOrders). */
|
|
222
270
|
export declare const canRenderOrderModificationControls: () => boolean;
|
|
223
|
-
/** Whether to render the managed trading control panel (managed only). */
|
|
224
271
|
export declare const canRenderManagedTradingControls: () => boolean;
|
|
225
|
-
/** True when in external-overlay-only (unmanaged) mode — hides all order-entry UI. */
|
|
226
272
|
export declare const canRenderExternalOverlayOnlyMode: () => boolean;
|
|
227
|
-
/** Positions always rendered regardless of mode. */
|
|
228
273
|
export declare const canRenderPositions: () => boolean;
|
|
229
|
-
/** Execution fills always rendered regardless of mode. */
|
|
230
274
|
export declare const canRenderFills: () => boolean;
|
|
231
|
-
/** Candles always rendered — RapidAPI datafeed unaffected by mode. */
|
|
232
275
|
export declare const canRenderCandles: () => boolean;
|
|
233
|
-
/** Indicators follow the indicators feature flag (both modes by default). */
|
|
234
276
|
export declare const canRenderIndicators: () => boolean;
|
|
235
|
-
/** Drawing tools always available regardless of license mode. */
|
|
236
277
|
export declare const canRenderDrawings: () => boolean;
|
|
237
278
|
//# sourceMappingURL=ChartRuntimeResolver.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChartRuntimeResolver.d.ts","sourceRoot":"","sources":["../../src/licensing/ChartRuntimeResolver.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"ChartRuntimeResolver.d.ts","sourceRoot":"","sources":["../../src/licensing/ChartRuntimeResolver.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAKH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEtD,qBAAa,oBAAoB;;IAC/B,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAqC;IAE5D,0EAA0E;IAC1E,OAAO,KAAK,EAAE,GAEb;IAED,OAAO;IAEP,MAAM,CAAC,WAAW,IAAI,oBAAoB;IAS1C,uDAAuD;IACvD,aAAa,IAAI,OAAO;IAIxB,6EAA6E;IAC7E,eAAe,IAAI,OAAO;IAM1B;;;;;;;OAOG;IACH,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO;IAKjC,yDAAyD;IACzD,cAAc,IAAI,WAAW;IAW7B,iEAAiE;IACjE,gBAAgB,IAAI,OAAO;IAI3B,iEAAiE;IACjE,kBAAkB,IAAI,OAAO;IAI7B,iEAAiE;IACjE,sBAAsB,IAAI,OAAO;IAIjC,sCAAsC;IACtC,gBAAgB,IAAI,OAAO;IAI3B,2DAA2D;IAC3D,eAAe,IAAI,OAAO;IAI1B,0CAA0C;IAC1C,eAAe,IAAI,OAAO;IAI1B,iDA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AO,MAAM,oBAAoB,QAAqB,OAA4C,CAAC;AACnG,eAAO,MAAM,wBAAwB,QAAiB,OAAgD,CAAC;AACvG,eAAO,MAAM,kCAAkC,QAAO,OAA0D,CAAC;AACjH,eAAO,MAAM,+BAA+B,QAAU,OAAuD,CAAC;AAC9G,eAAO,MAAM,gCAAgC,QAAS,OAAwD,CAAC;AAC/G,eAAO,MAAM,kBAAkB,QAAuB,OAA0C,CAAC;AACjG,eAAO,MAAM,cAAc,QAA2B,OAAsC,CAAC;AAC7F,eAAO,MAAM,gBAAgB,QAAyB,OAAwC,CAAC;AAC/F,eAAO,MAAM,mBAAmB,QAAsB,OAA2C,CAAC;AAClG,eAAO,MAAM,iBAAiB,QAAwB,OAAyC,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { LicenseFeatures, LicenseMode, LicensePayload } from './licenseTypes';
|
|
2
|
+
import type { CapabilitySet, LegacyPayloadShape, ProductTier } from './capabilityMatrix';
|
|
2
3
|
/**
|
|
3
4
|
* LicenseManager — single source of truth for chart mode and feature access.
|
|
4
5
|
*
|
|
@@ -9,6 +10,7 @@ import type { LicenseFeatures, LicenseMode, LicensePayload } from './licenseType
|
|
|
9
10
|
* lm.hasFeature('orderEntry');
|
|
10
11
|
*/
|
|
11
12
|
export declare class LicenseManager {
|
|
13
|
+
#private;
|
|
12
14
|
private static instance;
|
|
13
15
|
private payload;
|
|
14
16
|
private readonly subscribers;
|
|
@@ -35,8 +37,8 @@ export declare class LicenseManager {
|
|
|
35
37
|
* e.g. "http://licenses.example.com:4100/api/public/license/verify"
|
|
36
38
|
*/
|
|
37
39
|
validateLicense(key: string, verifyUrl: string): Promise<LicensePayload>;
|
|
38
|
-
/** Load a pre-validated payload (e.g. from cache / localStorage). */
|
|
39
|
-
loadLicense(payload:
|
|
40
|
+
/** Load a pre-validated payload (e.g. from cache / localStorage). Runs through the same migration + guardrail pipeline as `validateLicense`. */
|
|
41
|
+
loadLicense(payload: LegacyPayloadShape): void;
|
|
40
42
|
/** Return the currently loaded payload, or null if none. */
|
|
41
43
|
getLicense(): LicensePayload | null;
|
|
42
44
|
/**
|
|
@@ -49,6 +51,19 @@ export declare class LicenseManager {
|
|
|
49
51
|
getFeatures(): LicenseFeatures;
|
|
50
52
|
/** Check whether a specific feature is enabled on the active license. */
|
|
51
53
|
hasFeature(name: keyof LicenseFeatures): boolean;
|
|
54
|
+
/**
|
|
55
|
+
* The entitlement tier driven by the active license.
|
|
56
|
+
* Defaults to 'core' — the most restrictive tier — so no trading/managed
|
|
57
|
+
* capability appears without a valid license.
|
|
58
|
+
*/
|
|
59
|
+
getProductTier(): ProductTier;
|
|
60
|
+
/**
|
|
61
|
+
* The resolved capability set for the active license (or the safest
|
|
62
|
+
* defaults — unmanaged/core — when no license is loaded yet).
|
|
63
|
+
*/
|
|
64
|
+
getCapabilities(): CapabilitySet;
|
|
65
|
+
/** Check whether a specific capability is enabled on the active license. */
|
|
66
|
+
hasCapability(name: keyof CapabilitySet): boolean;
|
|
52
67
|
/** Clear the current license state (returns to safe unmanaged defaults). */
|
|
53
68
|
clear(): void;
|
|
54
69
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LicenseManager.d.ts","sourceRoot":"","sources":["../../src/licensing/LicenseManager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,WAAW,EAAE,cAAc,
|
|
1
|
+
{"version":3,"file":"LicenseManager.d.ts","sourceRoot":"","sources":["../../src/licensing/LicenseManager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,WAAW,EAAE,cAAc,EAAe,MAAM,gBAAgB,CAAC;AAEhG,OAAO,KAAK,EAAE,aAAa,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAMzF;;;;;;;;GAQG;AACH,qBAAa,cAAc;;IACzB,OAAO,CAAC,MAAM,CAAC,QAAQ,CAA+B;IAEtD,OAAO,CAAC,OAAO,CAA+B;IAC9C,OAAO,CAAC,QAAQ,CAAC,WAAW,CAA8B;IAE1D,OAAO;IAEP;;;;;;;;;;OAUG;IACH,SAAS,CAAC,EAAE,EAAE,MAAM,IAAI,GAAG,MAAM,IAAI;IAKrC,OAAO,CAAC,MAAM;IAMd,MAAM,CAAC,WAAW,IAAI,cAAc;IAOpC;;;;;;OAMG;IACG,eAAe,CAAC,GAAG,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC;IAiD9E,gJAAgJ;IAChJ,WAAW,CAAC,OAAO,EAAE,kBAAkB,GAAG,IAAI;IAqB9C,4DAA4D;IAC5D,UAAU,IAAI,cAAc,GAAG,IAAI;IAInC;;;;OAIG;IACH,OAAO,IAAI,WAAW;IAItB,uDAAuD;IACvD,WAAW,IAAI,eAAe;IAI9B,yEAAyE;IACzE,UAAU,CAAC,IAAI,EAAE,MAAM,eAAe,GAAG,OAAO;IAIhD;;;;OAIG;IACH,cAAc,IAAI,WAAW;IAI7B;;;OAGG;IACH,eAAe,IAAI,aAAa;IAIhC,4EAA4E;IAC5E,aAAa,CAAC,IAAI,EAAE,MAAM,aAAa,GAAG,OAAO;IAIjD,4EAA4E;IAC5E,KAAK,IAAI,IAAI;CAId"}
|
|
@@ -6,8 +6,13 @@
|
|
|
6
6
|
* - Unmanaged license → same as no license for UI gating
|
|
7
7
|
* - Managed license → all managed UI visible, external ingestion blocked
|
|
8
8
|
* - Feature flags override defaults within a mode
|
|
9
|
+
* - New platform features (all 27 keys) resolve correctly
|
|
10
|
+
* - Trading features gated to managed mode
|
|
9
11
|
* - getCapabilities() snapshot is consistent with individual methods
|
|
10
12
|
* - Module-level convenience functions alias correctly
|
|
13
|
+
* - Unmanaged Trading (productTier='trading') gets order UI + tradingBridgeRequired
|
|
14
|
+
* without any deploymentMode==='managed' check (capability-driven, not mode-hardwired)
|
|
15
|
+
* - Managed Platform is the only combination with fullAppShell/managedTrading
|
|
11
16
|
*/
|
|
12
17
|
export {};
|
|
13
18
|
//# sourceMappingURL=ChartRuntimeResolver.test.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChartRuntimeResolver.test.d.ts","sourceRoot":"","sources":["../../../src/licensing/__tests__/ChartRuntimeResolver.test.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"ChartRuntimeResolver.test.d.ts","sourceRoot":"","sources":["../../../src/licensing/__tests__/ChartRuntimeResolver.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG"}
|
|
@@ -7,6 +7,9 @@
|
|
|
7
7
|
* - validateLicense resolves a payload (placeholder logic)
|
|
8
8
|
* - clear() resets to safe unmanaged defaults
|
|
9
9
|
* - subscribe/unsubscribe fires on every mutation
|
|
10
|
+
* - legacy payloads (no productTier/capabilities/schemaVersion) are
|
|
11
|
+
* migrated deterministically, with warnings, on every load path
|
|
12
|
+
* - the managed+non-platform guardrail is normalized with a warning
|
|
10
13
|
*/
|
|
11
14
|
export {};
|
|
12
15
|
//# sourceMappingURL=LicenseManager.test.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LicenseManager.test.d.ts","sourceRoot":"","sources":["../../../src/licensing/__tests__/LicenseManager.test.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"LicenseManager.test.d.ts","sourceRoot":"","sources":["../../../src/licensing/__tests__/LicenseManager.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* capabilityMatrix — unit tests
|
|
3
|
+
*
|
|
4
|
+
* Covers:
|
|
5
|
+
* - getDefaultCapabilities() for all 6 productTier x deploymentMode combos
|
|
6
|
+
* - no capability is ever true purely "because mode matches" (tier drives it)
|
|
7
|
+
* - isValidCombination() / validateLicensePolicy() guardrail behaviour
|
|
8
|
+
* - migrateLegacyPayload() deterministic inference + warnings
|
|
9
|
+
*/
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=capabilityMatrix.test.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"capabilityMatrix.test.d.ts","sourceRoot":"","sources":["../../../src/licensing/__tests__/capabilityMatrix.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* capabilityMatrix — the single source of truth for deriving capabilities
|
|
3
|
+
* from a license payload's two independent axes:
|
|
4
|
+
*
|
|
5
|
+
* deploymentMode : 'managed' | 'unmanaged' (wiring concern — who hosts the runtime)
|
|
6
|
+
* productTier : 'core' | 'trading' | 'platform' (entitlement concern — what's sold)
|
|
7
|
+
*
|
|
8
|
+
* No capability may be enabled purely because deploymentMode matches — tier
|
|
9
|
+
* drives the matrix; deploymentMode only vetoes the two capabilities that are
|
|
10
|
+
* inherently managed-stack concepts (`managedTrading`, `fullAppShell`).
|
|
11
|
+
*
|
|
12
|
+
* Server-side (ForgeCharts-admin) keeps a hand-synced copy of this file at
|
|
13
|
+
* `server/src/shared/capabilityMatrix.ts` — keep both in sync when editing.
|
|
14
|
+
*/
|
|
15
|
+
import type { LicenseFeatures, LicenseMode, LicensePayload, LicenseTier } from './licenseTypes';
|
|
16
|
+
export type ProductTier = 'core' | 'trading' | 'platform';
|
|
17
|
+
export declare const PRODUCT_TIERS: readonly ProductTier[];
|
|
18
|
+
export declare const CURRENT_SCHEMA_VERSION = 2;
|
|
19
|
+
export interface CapabilitySet {
|
|
20
|
+
orderEntry: boolean;
|
|
21
|
+
managedTrading: boolean;
|
|
22
|
+
draggableOrders: boolean;
|
|
23
|
+
bracketOrders: boolean;
|
|
24
|
+
externalIngestion: boolean;
|
|
25
|
+
symbolResolverRequired: boolean;
|
|
26
|
+
tradingBridgeRequired: boolean;
|
|
27
|
+
fullAppShell: boolean;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Resolve the default capability set for a given tier + mode.
|
|
31
|
+
* `managedTrading` and `fullAppShell` are inherently managed-stack concepts —
|
|
32
|
+
* they are forced off under unmanaged deployment regardless of tier. Every
|
|
33
|
+
* other capability is decided by tier alone.
|
|
34
|
+
*/
|
|
35
|
+
export declare function getDefaultCapabilities(productTier: ProductTier, deploymentMode: LicenseMode): CapabilitySet;
|
|
36
|
+
/**
|
|
37
|
+
* The only structurally invalid combination: a managed deployment that
|
|
38
|
+
* doesn't run the full managed shell. Managed Platform is the sole managed
|
|
39
|
+
* offering — there is no "managed core"/"managed trading" product.
|
|
40
|
+
*/
|
|
41
|
+
export declare function isValidCombination(deploymentMode: LicenseMode, capabilities: CapabilitySet): boolean;
|
|
42
|
+
export interface LegacyPayloadShape {
|
|
43
|
+
licenseKey?: string;
|
|
44
|
+
mode?: LicenseMode;
|
|
45
|
+
deploymentMode?: LicenseMode;
|
|
46
|
+
tier?: LicenseTier;
|
|
47
|
+
productTier?: ProductTier;
|
|
48
|
+
plan?: string;
|
|
49
|
+
expires?: string;
|
|
50
|
+
features?: LicenseFeatures;
|
|
51
|
+
capabilities?: CapabilitySet;
|
|
52
|
+
schemaVersion?: number;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Upgrade any payload (current or legacy) to the current schema: ensures
|
|
56
|
+
* `deploymentMode`, `productTier`, `capabilities`, and `schemaVersion` are
|
|
57
|
+
* always present. Never throws — always returns a usable payload plus a
|
|
58
|
+
* list of human-readable warnings describing any defaults that were applied.
|
|
59
|
+
*/
|
|
60
|
+
export declare function migrateLegacyPayload(raw: LegacyPayloadShape): {
|
|
61
|
+
payload: LicensePayload;
|
|
62
|
+
warnings: string[];
|
|
63
|
+
};
|
|
64
|
+
export interface PolicyValidationResult {
|
|
65
|
+
valid: boolean;
|
|
66
|
+
normalized: LicensePayload;
|
|
67
|
+
warnings: string[];
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Guardrail check for structurally invalid mode/tier/capability combinations.
|
|
71
|
+
* Consumption-side policy (SDK): normalize with a warning rather than throw,
|
|
72
|
+
* so a single bad payload can't break chart mounting for an end user.
|
|
73
|
+
* Issuance-side policy (ForgeCharts-admin) should reject instead — see the
|
|
74
|
+
* server-side `capabilityMatrix.ts` copy.
|
|
75
|
+
*/
|
|
76
|
+
export declare function validateLicensePolicy(payload: LicensePayload): PolicyValidationResult;
|
|
77
|
+
//# sourceMappingURL=capabilityMatrix.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"capabilityMatrix.d.ts","sourceRoot":"","sources":["../../src/licensing/capabilityMatrix.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,KAAK,EAAE,eAAe,EAAE,WAAW,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAGhG,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,SAAS,GAAG,UAAU,CAAC;AAE1D,eAAO,MAAM,aAAa,EAAE,SAAS,WAAW,EAAoC,CAAC;AAErF,eAAO,MAAM,sBAAsB,IAAI,CAAC;AAExC,MAAM,WAAW,aAAa;IAC5B,UAAU,EAAE,OAAO,CAAC;IACpB,cAAc,EAAE,OAAO,CAAC;IACxB,eAAe,EAAE,OAAO,CAAC;IACzB,aAAa,EAAE,OAAO,CAAC;IACvB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,sBAAsB,EAAE,OAAO,CAAC;IAChC,qBAAqB,EAAE,OAAO,CAAC;IAC/B,YAAY,EAAE,OAAO,CAAC;CACvB;AAoCD;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,WAAW,EAAE,WAAW,EAAE,cAAc,EAAE,WAAW,GAAG,aAAa,CAM3G;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,cAAc,EAAE,WAAW,EAAE,YAAY,EAAE,aAAa,GAAG,OAAO,CAGpG;AAED,MAAM,WAAW,kBAAkB;IACjC,UAAU,CAAC,EAAE,MAA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