@forgecharts/sdk 1.2.5 → 1.2.8
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/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +245 -50
- package/dist/index.js.map +1 -1
- package/dist/internal.js +245 -50
- package/dist/internal.js.map +1 -1
- package/dist/licensing/ChartRuntimeResolver.d.ts +55 -24
- 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 +3 -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 +29 -2
- package/dist/licensing/licenseTypes.d.ts.map +1 -1
- package/dist/node.d.ts +3 -1
- package/dist/node.d.ts.map +1 -1
- package/dist/react/index.js +234 -55
- package/dist/react/index.js.map +1 -1
- package/dist/react/internal.js +237 -57
- package/dist/react/internal.js.map +1 -1
- package/dist/react/shell/ManagedAppShell.d.ts.map +1 -1
- 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/package.json +2 -1
package/dist/internal.js
CHANGED
|
@@ -10671,8 +10671,127 @@ var TradingOverlayStore = class {
|
|
|
10671
10671
|
}
|
|
10672
10672
|
};
|
|
10673
10673
|
|
|
10674
|
+
// src/licensing/licenseTypes.ts
|
|
10675
|
+
var TRADING_FEATURE_KEYS = /* @__PURE__ */ new Set([
|
|
10676
|
+
"orderEntry",
|
|
10677
|
+
"managedTrading",
|
|
10678
|
+
"draggableOrders",
|
|
10679
|
+
"bracketOrders",
|
|
10680
|
+
"trailingStops",
|
|
10681
|
+
"positionsOverlay"
|
|
10682
|
+
]);
|
|
10683
|
+
|
|
10684
|
+
// src/licensing/capabilityMatrix.ts
|
|
10685
|
+
var PRODUCT_TIERS = ["core", "trading", "platform"];
|
|
10686
|
+
var CURRENT_SCHEMA_VERSION = 2;
|
|
10687
|
+
var BASE_MATRIX = {
|
|
10688
|
+
core: {
|
|
10689
|
+
orderEntry: false,
|
|
10690
|
+
managedTrading: false,
|
|
10691
|
+
draggableOrders: false,
|
|
10692
|
+
bracketOrders: false,
|
|
10693
|
+
externalIngestion: true,
|
|
10694
|
+
symbolResolverRequired: true,
|
|
10695
|
+
tradingBridgeRequired: false,
|
|
10696
|
+
fullAppShell: false
|
|
10697
|
+
},
|
|
10698
|
+
trading: {
|
|
10699
|
+
orderEntry: true,
|
|
10700
|
+
managedTrading: false,
|
|
10701
|
+
draggableOrders: true,
|
|
10702
|
+
bracketOrders: true,
|
|
10703
|
+
externalIngestion: true,
|
|
10704
|
+
symbolResolverRequired: true,
|
|
10705
|
+
tradingBridgeRequired: true,
|
|
10706
|
+
fullAppShell: false
|
|
10707
|
+
},
|
|
10708
|
+
platform: {
|
|
10709
|
+
orderEntry: true,
|
|
10710
|
+
managedTrading: true,
|
|
10711
|
+
draggableOrders: true,
|
|
10712
|
+
bracketOrders: true,
|
|
10713
|
+
externalIngestion: false,
|
|
10714
|
+
symbolResolverRequired: false,
|
|
10715
|
+
tradingBridgeRequired: false,
|
|
10716
|
+
fullAppShell: true
|
|
10717
|
+
}
|
|
10718
|
+
};
|
|
10719
|
+
function getDefaultCapabilities(productTier, deploymentMode) {
|
|
10720
|
+
const base = BASE_MATRIX[productTier];
|
|
10721
|
+
if (deploymentMode === "unmanaged") {
|
|
10722
|
+
return { ...base, managedTrading: false, fullAppShell: false };
|
|
10723
|
+
}
|
|
10724
|
+
return { ...base };
|
|
10725
|
+
}
|
|
10726
|
+
function isValidCombination(deploymentMode, capabilities) {
|
|
10727
|
+
if (deploymentMode === "managed" && capabilities.fullAppShell === false) return false;
|
|
10728
|
+
return true;
|
|
10729
|
+
}
|
|
10730
|
+
function hasAnyTradingFeature(features) {
|
|
10731
|
+
if (!features) return false;
|
|
10732
|
+
for (const key of TRADING_FEATURE_KEYS) {
|
|
10733
|
+
if (features[key] === true) return true;
|
|
10734
|
+
}
|
|
10735
|
+
return false;
|
|
10736
|
+
}
|
|
10737
|
+
function inferProductTier(raw, mode) {
|
|
10738
|
+
if (mode === "managed") return "platform";
|
|
10739
|
+
if (raw.tier === "trading" || raw.tier === "dom") return "trading";
|
|
10740
|
+
if (hasAnyTradingFeature(raw.features)) return "trading";
|
|
10741
|
+
return "core";
|
|
10742
|
+
}
|
|
10743
|
+
function migrateLegacyPayload(raw) {
|
|
10744
|
+
const warnings = [];
|
|
10745
|
+
const mode = raw.deploymentMode ?? raw.mode ?? "unmanaged";
|
|
10746
|
+
let productTier = raw.productTier;
|
|
10747
|
+
if (!productTier) {
|
|
10748
|
+
productTier = inferProductTier(raw, mode);
|
|
10749
|
+
warnings.push(
|
|
10750
|
+
`License payload has no productTier \u2014 inferred '${productTier}' from mode='${mode}'` + (raw.tier ? ` and legacy tier='${raw.tier}'` : "") + "."
|
|
10751
|
+
);
|
|
10752
|
+
}
|
|
10753
|
+
let capabilities = raw.capabilities;
|
|
10754
|
+
if (!capabilities) {
|
|
10755
|
+
capabilities = getDefaultCapabilities(productTier, mode);
|
|
10756
|
+
warnings.push(`License payload has no capabilities \u2014 derived defaults for productTier='${productTier}', deploymentMode='${mode}'.`);
|
|
10757
|
+
}
|
|
10758
|
+
if (!raw.schemaVersion || raw.schemaVersion < CURRENT_SCHEMA_VERSION) {
|
|
10759
|
+
warnings.push(`License payload schemaVersion=${raw.schemaVersion ?? 1} is legacy \u2014 migrated to v${CURRENT_SCHEMA_VERSION}.`);
|
|
10760
|
+
}
|
|
10761
|
+
const payload = {
|
|
10762
|
+
licenseKey: raw.licenseKey ?? "",
|
|
10763
|
+
mode,
|
|
10764
|
+
deploymentMode: mode,
|
|
10765
|
+
productTier,
|
|
10766
|
+
capabilities,
|
|
10767
|
+
schemaVersion: CURRENT_SCHEMA_VERSION,
|
|
10768
|
+
...raw.tier != null && { tier: raw.tier },
|
|
10769
|
+
...raw.plan != null && { plan: raw.plan },
|
|
10770
|
+
...raw.expires != null && { expires: raw.expires },
|
|
10771
|
+
...raw.features != null && { features: raw.features }
|
|
10772
|
+
};
|
|
10773
|
+
return { payload, warnings };
|
|
10774
|
+
}
|
|
10775
|
+
function validateLicensePolicy(payload) {
|
|
10776
|
+
const warnings = [];
|
|
10777
|
+
const capabilities = payload.capabilities ?? getDefaultCapabilities(payload.productTier ?? "core", payload.mode);
|
|
10778
|
+
if (isValidCombination(payload.mode, capabilities)) {
|
|
10779
|
+
return { valid: true, normalized: { ...payload, capabilities }, warnings };
|
|
10780
|
+
}
|
|
10781
|
+
warnings.push(
|
|
10782
|
+
`Invalid license combination: deploymentMode='${payload.mode}' requires fullAppShell capability. Normalizing productTier to 'platform'.`
|
|
10783
|
+
);
|
|
10784
|
+
const normalizedCapabilities = getDefaultCapabilities("platform", payload.mode);
|
|
10785
|
+
return {
|
|
10786
|
+
valid: false,
|
|
10787
|
+
normalized: { ...payload, productTier: "platform", capabilities: normalizedCapabilities },
|
|
10788
|
+
warnings
|
|
10789
|
+
};
|
|
10790
|
+
}
|
|
10791
|
+
|
|
10674
10792
|
// src/licensing/LicenseManager.ts
|
|
10675
10793
|
var DEFAULT_MODE = "unmanaged";
|
|
10794
|
+
var DEFAULT_PRODUCT_TIER = "core";
|
|
10676
10795
|
var DEFAULT_FEATURES = {};
|
|
10677
10796
|
var LicenseManager = class _LicenseManager {
|
|
10678
10797
|
static instance = null;
|
|
@@ -10735,22 +10854,42 @@ var LicenseManager = class _LicenseManager {
|
|
|
10735
10854
|
if (!data.valid) {
|
|
10736
10855
|
throw new Error(data.reason ?? "License invalid");
|
|
10737
10856
|
}
|
|
10738
|
-
const
|
|
10857
|
+
const raw = {
|
|
10739
10858
|
licenseKey: data.licenseKey ?? key.trim().toUpperCase(),
|
|
10740
10859
|
mode: data.mode ?? "unmanaged",
|
|
10860
|
+
...data.tier != null && { tier: data.tier },
|
|
10861
|
+
...data.productTier != null && { productTier: data.productTier },
|
|
10862
|
+
...data.capabilities != null && { capabilities: data.capabilities },
|
|
10863
|
+
...data.schemaVersion != null && { schemaVersion: data.schemaVersion },
|
|
10741
10864
|
...data.plan != null && { plan: data.plan },
|
|
10742
10865
|
...data.expiresAt != null && { expires: data.expiresAt },
|
|
10743
10866
|
...data.features != null && { features: data.features }
|
|
10744
10867
|
};
|
|
10868
|
+
const payload = this.#applyPolicyPipeline(raw);
|
|
10745
10869
|
this.payload = payload;
|
|
10746
10870
|
this.notify();
|
|
10747
10871
|
return payload;
|
|
10748
10872
|
}
|
|
10749
|
-
/** Load a pre-validated payload (e.g. from cache / localStorage). */
|
|
10873
|
+
/** Load a pre-validated payload (e.g. from cache / localStorage). Runs through the same migration + guardrail pipeline as `validateLicense`. */
|
|
10750
10874
|
loadLicense(payload) {
|
|
10751
|
-
this.payload = payload;
|
|
10875
|
+
this.payload = this.#applyPolicyPipeline(payload);
|
|
10752
10876
|
this.notify();
|
|
10753
10877
|
}
|
|
10878
|
+
/**
|
|
10879
|
+
* Runs a raw/legacy/partial payload through `migrateLegacyPayload` (fills
|
|
10880
|
+
* missing productTier/capabilities/schemaVersion, deterministically, with
|
|
10881
|
+
* warnings) then `validateLicensePolicy` (guardrail normalization).
|
|
10882
|
+
* Any warnings are surfaced via `console.warn` — callers never see a
|
|
10883
|
+
* payload without `capabilities`.
|
|
10884
|
+
*/
|
|
10885
|
+
#applyPolicyPipeline(raw) {
|
|
10886
|
+
const { payload: migrated, warnings: migrationWarnings } = migrateLegacyPayload(raw);
|
|
10887
|
+
const { normalized, warnings: policyWarnings } = validateLicensePolicy(migrated);
|
|
10888
|
+
for (const warning of [...migrationWarnings, ...policyWarnings]) {
|
|
10889
|
+
console.warn(`[LicenseManager] ${warning}`);
|
|
10890
|
+
}
|
|
10891
|
+
return normalized;
|
|
10892
|
+
}
|
|
10754
10893
|
/** Return the currently loaded payload, or null if none. */
|
|
10755
10894
|
getLicense() {
|
|
10756
10895
|
return this.payload;
|
|
@@ -10771,6 +10910,25 @@ var LicenseManager = class _LicenseManager {
|
|
|
10771
10910
|
hasFeature(name) {
|
|
10772
10911
|
return this.getFeatures()[name] === true;
|
|
10773
10912
|
}
|
|
10913
|
+
/**
|
|
10914
|
+
* The entitlement tier driven by the active license.
|
|
10915
|
+
* Defaults to 'core' — the most restrictive tier — so no trading/managed
|
|
10916
|
+
* capability appears without a valid license.
|
|
10917
|
+
*/
|
|
10918
|
+
getProductTier() {
|
|
10919
|
+
return this.payload?.productTier ?? DEFAULT_PRODUCT_TIER;
|
|
10920
|
+
}
|
|
10921
|
+
/**
|
|
10922
|
+
* The resolved capability set for the active license (or the safest
|
|
10923
|
+
* defaults — unmanaged/core — when no license is loaded yet).
|
|
10924
|
+
*/
|
|
10925
|
+
getCapabilities() {
|
|
10926
|
+
return this.payload?.capabilities ?? getDefaultCapabilities(DEFAULT_PRODUCT_TIER, DEFAULT_MODE);
|
|
10927
|
+
}
|
|
10928
|
+
/** Check whether a specific capability is enabled on the active license. */
|
|
10929
|
+
hasCapability(name) {
|
|
10930
|
+
return this.getCapabilities()[name] === true;
|
|
10931
|
+
}
|
|
10774
10932
|
/** Clear the current license state (returns to safe unmanaged defaults). */
|
|
10775
10933
|
clear() {
|
|
10776
10934
|
this.payload = null;
|
|
@@ -10778,16 +10936,6 @@ var LicenseManager = class _LicenseManager {
|
|
|
10778
10936
|
}
|
|
10779
10937
|
};
|
|
10780
10938
|
|
|
10781
|
-
// src/licensing/licenseTypes.ts
|
|
10782
|
-
var TRADING_FEATURE_KEYS = /* @__PURE__ */ new Set([
|
|
10783
|
-
"orderEntry",
|
|
10784
|
-
"managedTrading",
|
|
10785
|
-
"draggableOrders",
|
|
10786
|
-
"bracketOrders",
|
|
10787
|
-
"trailingStops",
|
|
10788
|
-
"positionsOverlay"
|
|
10789
|
-
]);
|
|
10790
|
-
|
|
10791
10939
|
// src/licensing/ChartRuntimeResolver.ts
|
|
10792
10940
|
var ChartRuntimeResolver = class _ChartRuntimeResolver {
|
|
10793
10941
|
static instance = null;
|
|
@@ -10816,15 +10964,23 @@ var ChartRuntimeResolver = class _ChartRuntimeResolver {
|
|
|
10816
10964
|
/**
|
|
10817
10965
|
* Check whether a specific platform feature is enabled.
|
|
10818
10966
|
*
|
|
10819
|
-
* Resolution:
|
|
10820
|
-
* 1. If the feature is a trading feature and
|
|
10967
|
+
* Resolution (capability-driven — never gated on deploymentMode alone):
|
|
10968
|
+
* 1. If the feature is a trading feature and productTier is 'core' → false.
|
|
10821
10969
|
* 2. If the feature has an explicit flag in the license → use it.
|
|
10822
|
-
* 3. Default: true for
|
|
10970
|
+
* 3. Default: true for platform/trading tier, true for non-trading features.
|
|
10823
10971
|
*/
|
|
10824
10972
|
hasFeature(name) {
|
|
10825
|
-
if (TRADING_FEATURE_KEYS.has(name) && this
|
|
10973
|
+
if (TRADING_FEATURE_KEYS.has(name) && this.#isCoreTier()) return false;
|
|
10826
10974
|
return this.#featureOrDefault(name, true);
|
|
10827
10975
|
}
|
|
10976
|
+
/** The entitlement tier driven by the active license. */
|
|
10977
|
+
getProductTier() {
|
|
10978
|
+
return this.lm.getProductTier();
|
|
10979
|
+
}
|
|
10980
|
+
/** True when the active license's productTier is 'core' (no trading capabilities). */
|
|
10981
|
+
#isCoreTier() {
|
|
10982
|
+
return this.lm.getProductTier() === "core";
|
|
10983
|
+
}
|
|
10828
10984
|
// ── Charting capability queries ─────────────────────────────────────────────
|
|
10829
10985
|
/** Chart type selection (candlestick, bar, line, area, etc.). */
|
|
10830
10986
|
canUseChartTypes() {
|
|
@@ -10878,50 +11034,77 @@ var ChartRuntimeResolver = class _ChartRuntimeResolver {
|
|
|
10878
11034
|
// ── Trading capability queries (managed-only by default) ────────────────────
|
|
10879
11035
|
/**
|
|
10880
11036
|
* Built-in order entry UI hooks.
|
|
10881
|
-
*
|
|
11037
|
+
* Ceiling driven by `productTier` (core = false, trading/platform = true) —
|
|
11038
|
+
* available in both Unmanaged Trading and Managed Platform. An explicit
|
|
11039
|
+
* `features.orderEntry` flag on the payload may only narrow below the
|
|
11040
|
+
* ceiling, never elevate above it.
|
|
10882
11041
|
*/
|
|
10883
11042
|
canUseOrderEntry() {
|
|
10884
|
-
|
|
10885
|
-
return this.#featureOrDefault("orderEntry", true);
|
|
11043
|
+
return this.#capabilityWithOverride("orderEntry");
|
|
10886
11044
|
}
|
|
10887
11045
|
/**
|
|
10888
11046
|
* Managed trading service hooks (broker execution, position management).
|
|
10889
|
-
*
|
|
11047
|
+
* Only true for Managed Platform — `managedTrading` is forced off under
|
|
11048
|
+
* unmanaged deployment regardless of tier (see capabilityMatrix).
|
|
10890
11049
|
*/
|
|
10891
11050
|
canUseManagedTrading() {
|
|
10892
|
-
|
|
10893
|
-
return this.#featureOrDefault("managedTrading", true);
|
|
11051
|
+
return this.#capabilityWithOverride("managedTrading");
|
|
10894
11052
|
}
|
|
10895
11053
|
/**
|
|
10896
11054
|
* Drag-to-price order placement.
|
|
10897
|
-
*
|
|
11055
|
+
* Ceiling driven by `productTier` — available in Unmanaged Trading and
|
|
11056
|
+
* Managed Platform.
|
|
10898
11057
|
*/
|
|
10899
11058
|
canUseDraggableOrders() {
|
|
10900
|
-
|
|
10901
|
-
return this.#featureOrDefault("draggableOrders", true);
|
|
11059
|
+
return this.#capabilityWithOverride("draggableOrders");
|
|
10902
11060
|
}
|
|
10903
11061
|
/**
|
|
10904
11062
|
* Bracket / OCO order support.
|
|
10905
|
-
*
|
|
11063
|
+
* Ceiling driven by `productTier` — available in Unmanaged Trading and
|
|
11064
|
+
* Managed Platform.
|
|
10906
11065
|
*/
|
|
10907
11066
|
canUseBracketOrders() {
|
|
10908
|
-
|
|
10909
|
-
|
|
11067
|
+
return this.#capabilityWithOverride("bracketOrders");
|
|
11068
|
+
}
|
|
11069
|
+
/**
|
|
11070
|
+
* Resolve one of the 4 override-able capability keys: the tier×mode matrix
|
|
11071
|
+
* sets the ceiling, an explicit `features[name]` flag may only narrow it.
|
|
11072
|
+
*/
|
|
11073
|
+
#capabilityWithOverride(name) {
|
|
11074
|
+
const ceiling = this.lm.getCapabilities()[name];
|
|
11075
|
+
if (!ceiling) return false;
|
|
11076
|
+
const explicit = this.lm.getFeatures()[name];
|
|
11077
|
+
return explicit === void 0 ? true : explicit === true;
|
|
11078
|
+
}
|
|
11079
|
+
/**
|
|
11080
|
+
* Whether trading UI must route execution through host-supplied intent
|
|
11081
|
+
* handlers rather than a managed backend (Unmanaged Trading only).
|
|
11082
|
+
*/
|
|
11083
|
+
requiresTradingBridge() {
|
|
11084
|
+
return this.lm.getCapabilities().tradingBridgeRequired;
|
|
11085
|
+
}
|
|
11086
|
+
/** Whether the host must supply an `ISymbolResolver` (unmanaged tiers). */
|
|
11087
|
+
requiresSymbolResolver() {
|
|
11088
|
+
return this.lm.getCapabilities().symbolResolverRequired;
|
|
11089
|
+
}
|
|
11090
|
+
/** Whether the full managed app shell should render (Managed Platform only). */
|
|
11091
|
+
hasFullAppShell() {
|
|
11092
|
+
return this.lm.getCapabilities().fullAppShell;
|
|
10910
11093
|
}
|
|
10911
11094
|
/**
|
|
10912
|
-
* Trailing stop orders.
|
|
10913
|
-
*
|
|
11095
|
+
* Trailing stop orders. Not part of the core capability set — gated on
|
|
11096
|
+
* productTier (not deploymentMode) to keep the two axes independent.
|
|
10914
11097
|
*/
|
|
10915
11098
|
canUseTrailingStops() {
|
|
10916
|
-
if (this
|
|
11099
|
+
if (this.#isCoreTier()) return false;
|
|
10917
11100
|
return this.#featureOrDefault("trailingStops", true);
|
|
10918
11101
|
}
|
|
10919
11102
|
/**
|
|
10920
|
-
* Positions overlay on chart.
|
|
10921
|
-
*
|
|
11103
|
+
* Positions overlay on chart. Not part of the core capability set — gated
|
|
11104
|
+
* on productTier (not deploymentMode) to keep the two axes independent.
|
|
10922
11105
|
*/
|
|
10923
11106
|
canUsePositionsOverlay() {
|
|
10924
|
-
if (this
|
|
11107
|
+
if (this.#isCoreTier()) return false;
|
|
10925
11108
|
return this.#featureOrDefault("positionsOverlay", true);
|
|
10926
11109
|
}
|
|
10927
11110
|
// ── Scripting capability queries ────────────────────────────────────────────
|
|
@@ -10961,11 +11144,11 @@ var ChartRuntimeResolver = class _ChartRuntimeResolver {
|
|
|
10961
11144
|
// ── Legacy / backward-compat ────────────────────────────────────────────────
|
|
10962
11145
|
/**
|
|
10963
11146
|
* External data ingestion APIs (e.g. pushing tick data from an external broker).
|
|
10964
|
-
*
|
|
11147
|
+
* Driven by `productTier`/`deploymentMode` via `capabilities.externalIngestion`
|
|
11148
|
+
* — true for core/trading, false for Managed Platform (the managed feed owns data).
|
|
10965
11149
|
*/
|
|
10966
11150
|
canUseExternalIngestion() {
|
|
10967
|
-
|
|
10968
|
-
return this.#featureOrDefault("unmanagedIngestion", false);
|
|
11151
|
+
return this.lm.getCapabilities().externalIngestion;
|
|
10969
11152
|
}
|
|
10970
11153
|
// ── UI render capability checks ──────────────────────────────────────────────
|
|
10971
11154
|
// Component-level gates derived from the feature-level checks above.
|
|
@@ -11026,8 +11209,13 @@ var ChartRuntimeResolver = class _ChartRuntimeResolver {
|
|
|
11026
11209
|
*/
|
|
11027
11210
|
getCapabilities() {
|
|
11028
11211
|
return {
|
|
11029
|
-
// ── Mode
|
|
11212
|
+
// ── Mode / tier ─────────────────────────────────────────────────────
|
|
11030
11213
|
mode: this.lm.getMode(),
|
|
11214
|
+
productTier: this.lm.getProductTier(),
|
|
11215
|
+
// ── Capabilities (the 3-model matrix) ──────────────────────────────
|
|
11216
|
+
symbolResolverRequired: this.requiresSymbolResolver(),
|
|
11217
|
+
tradingBridgeRequired: this.requiresTradingBridge(),
|
|
11218
|
+
fullAppShell: this.hasFullAppShell(),
|
|
11031
11219
|
// ── Charting features ───────────────────────────────────────────────
|
|
11032
11220
|
chartTypes: this.canUseChartTypes(),
|
|
11033
11221
|
drawingTools: this.canUseDrawingTools(),
|
|
@@ -11221,10 +11409,9 @@ function assertManagedMode() {
|
|
|
11221
11409
|
}
|
|
11222
11410
|
}
|
|
11223
11411
|
function assertCanPlaceOrders() {
|
|
11224
|
-
assertManagedMode();
|
|
11225
11412
|
if (!resolver2().canUseOrderEntry()) {
|
|
11226
11413
|
throw new Error(
|
|
11227
|
-
"[ForgeCharts] Order entry is not enabled on the active license. Contact your license provider to enable the orderEntry
|
|
11414
|
+
"[ForgeCharts] Order entry is not enabled on the active license. Contact your license provider to enable the orderEntry capability (requires productTier=trading or productTier=platform)."
|
|
11228
11415
|
);
|
|
11229
11416
|
}
|
|
11230
11417
|
}
|
|
@@ -11232,7 +11419,15 @@ function assertCanUseBrackets() {
|
|
|
11232
11419
|
assertCanPlaceOrders();
|
|
11233
11420
|
if (!resolver2().canUseBracketOrders()) {
|
|
11234
11421
|
throw new Error(
|
|
11235
|
-
"[ForgeCharts] Bracket orders are not enabled on the active license. Contact your license provider to enable the bracketOrders
|
|
11422
|
+
"[ForgeCharts] Bracket orders are not enabled on the active license. Contact your license provider to enable the bracketOrders capability."
|
|
11423
|
+
);
|
|
11424
|
+
}
|
|
11425
|
+
}
|
|
11426
|
+
function assertCanUseManagedBrackets() {
|
|
11427
|
+
assertCanUseManagedTrading();
|
|
11428
|
+
if (!resolver2().canUseBracketOrders()) {
|
|
11429
|
+
throw new Error(
|
|
11430
|
+
"[ForgeCharts] Bracket orders are not enabled on the active license. Contact your license provider to enable the bracketOrders capability."
|
|
11236
11431
|
);
|
|
11237
11432
|
}
|
|
11238
11433
|
}
|
|
@@ -11240,7 +11435,7 @@ function assertCanUseDraggableOrders() {
|
|
|
11240
11435
|
assertCanPlaceOrders();
|
|
11241
11436
|
if (!resolver2().canUseDraggableOrders()) {
|
|
11242
11437
|
throw new Error(
|
|
11243
|
-
"[ForgeCharts] Draggable orders are not enabled on the active license. Contact your license provider to enable the draggableOrders
|
|
11438
|
+
"[ForgeCharts] Draggable orders are not enabled on the active license. Contact your license provider to enable the draggableOrders capability."
|
|
11244
11439
|
);
|
|
11245
11440
|
}
|
|
11246
11441
|
}
|
|
@@ -11248,12 +11443,12 @@ function assertCanUseManagedTrading() {
|
|
|
11248
11443
|
assertManagedMode();
|
|
11249
11444
|
if (!resolver2().canUseManagedTrading()) {
|
|
11250
11445
|
throw new Error(
|
|
11251
|
-
"[ForgeCharts] Managed trading is not enabled on the active license. Contact your license provider to enable the managedTrading
|
|
11446
|
+
"[ForgeCharts] Managed trading is not enabled on the active license. Contact your license provider to enable the managedTrading capability (requires productTier=platform)."
|
|
11252
11447
|
);
|
|
11253
11448
|
}
|
|
11254
11449
|
}
|
|
11255
11450
|
var isManagedCapable = () => resolver2().isManagedMode();
|
|
11256
|
-
var canPlaceOrders = () => resolver2().
|
|
11451
|
+
var canPlaceOrders = () => resolver2().canUseOrderEntry();
|
|
11257
11452
|
var canPlaceBrackets = () => canPlaceOrders() && resolver2().canUseBracketOrders();
|
|
11258
11453
|
var canUseDraggable = () => canPlaceOrders() && resolver2().canUseDraggableOrders();
|
|
11259
11454
|
var canUseManagedTradingHook = () => resolver2().isManagedMode() && resolver2().canUseManagedTrading();
|
|
@@ -11312,7 +11507,7 @@ var ManagedTradingController = class {
|
|
|
11312
11507
|
* (provider event stream) and call _store.upsertOrder() as status changes.
|
|
11313
11508
|
*/
|
|
11314
11509
|
async placeOrder(input) {
|
|
11315
|
-
|
|
11510
|
+
assertCanUseManagedTrading();
|
|
11316
11511
|
if (!this._provider) notImplemented("placeOrder");
|
|
11317
11512
|
const clientId = makeId();
|
|
11318
11513
|
const overlayOrder = {
|
|
@@ -11350,7 +11545,7 @@ var ManagedTradingController = class {
|
|
|
11350
11545
|
* visually fades out rather than disappearing instantly).
|
|
11351
11546
|
*/
|
|
11352
11547
|
async cancelOrder(orderId) {
|
|
11353
|
-
|
|
11548
|
+
assertCanUseManagedTrading();
|
|
11354
11549
|
if (!this._provider) notImplemented("cancelOrder");
|
|
11355
11550
|
await this._provider.cancelOrder(orderId);
|
|
11356
11551
|
const existing = this._store.getOrders().find((o) => o.id === orderId);
|
|
@@ -11370,7 +11565,7 @@ var ManagedTradingController = class {
|
|
|
11370
11565
|
* before forwarding to the provider.
|
|
11371
11566
|
*/
|
|
11372
11567
|
async modifyOrder(orderId, updates) {
|
|
11373
|
-
|
|
11568
|
+
assertCanUseManagedTrading();
|
|
11374
11569
|
if (!this._provider) notImplemented("modifyOrder");
|
|
11375
11570
|
const ack = await this._provider.modifyOrder(orderId, updates);
|
|
11376
11571
|
const existing = this._store.getOrders().find((o) => o.id === orderId);
|
|
@@ -11397,7 +11592,7 @@ var ManagedTradingController = class {
|
|
|
11397
11592
|
* users can adjust prices before confirming.
|
|
11398
11593
|
*/
|
|
11399
11594
|
async placeBracketOrder(input) {
|
|
11400
|
-
|
|
11595
|
+
assertCanUseManagedBrackets();
|
|
11401
11596
|
if (!this._provider) notImplemented("placeBracketOrder");
|
|
11402
11597
|
const groupId = input.entry.groupId ?? makeId();
|
|
11403
11598
|
const ack = await this._provider.placeBracketOrder({
|
|
@@ -24677,6 +24872,6 @@ var demonstrationTool = {
|
|
|
24677
24872
|
cursorStyle: DEMONSTRATION_STYLE
|
|
24678
24873
|
};
|
|
24679
24874
|
|
|
24680
|
-
export { CROSSHAIR_LABEL, CROSSHAIR_STYLE, CURSOR_LABEL, CURSOR_STYLE, CandleEngine, Chart, ChartRuntimeResolver, CoordTransform, Crosshair, DEFAULT_SYNC_OPTIONS, DEMONSTRATION_COLOR, DEMONSTRATION_FILL, DEMONSTRATION_LABEL, DEMONSTRATION_RADIUS, DEMONSTRATION_STROKE, DEMONSTRATION_STYLE, DOT_COLOR, DOT_LABEL, DOT_RADIUS, DOT_STYLE, DatafeedConnector, DirtyFlags, ForgeScriptIndicator, ForgeScriptRuntime, Series2 as ForgeScriptSeries, GridChartContainer, GridSyncProvider, IndicatorDAG, InteractionManager, LayerName, LayoutTemplateSelector, LicenseManager, ManagedTradingController, PaneManager, PixiBenchmark, PixiChart, PixiLayerManager, PriceScale, ReferenceAPI, Series, TChart, TimeScale, TradingOverlayStore, UnmanagedIngestion, assertCanPlaceOrders, assertCanUseBrackets, assertCanUseDraggableOrders, assertCanUseManagedTrading, assertManagedMode, canPlaceBrackets, canPlaceOrders, canRenderBracketControls, canRenderBuySellButtons, canRenderCandles, canRenderDrawings, canRenderExternalOverlayOnlyMode, canRenderFills, canRenderIndicators, canRenderManagedTradingControls, canRenderOrderEntry, canRenderOrderModificationControls, canRenderOrderTicket, canRenderOverlays, canRenderPositions, canUseAiAgent, canUseAlerts, canUseBarReplay, canUseBracketOrders, canUseChartTypes, canUseCustomIndicators, canUseCustomTimeframes, canUseDataExport, canUseDraggable, canUseDraggableOrders, canUseDrawingTools, canUseExtendedDrawings, canUseExternalIngestion, canUseForgeScript, canUseHistoricalData, canUseIndicators, canUseManagedTrading, canUseManagedTradingHook, canUseMultiChartLayout, canUseMultiPane, canUseMultipleProviders, canUseMultipleWorkspaces, canUseOrderEntry, canUsePositionsOverlay, canUseRealtimeData, canUseSavedLayouts, canUseTrailingStops, canUseWatchlists, clearTelemetryListeners, computeEMA, computeEMAFromSeries, computeMACD, computeRSI, computeSMA, computeSMAFromSeries, computeVolume, computeWMAFromSeries, createChart, crosshairTool, cursorTool, demonstrationTool, detectLanguage, detectLanguageWithFallback, dotTool, evaluateSaveGate, exchangeNow, extractField, getBucketStart2 as getBucketStart, getCapabilities, getDefaultStyle, getGridTemplate, getGroupedTemplates, getMissingBarCount, getStyleSlots, hasFeature, initServerClock, isManagedCapable, isManagedMode, isUnmanagedMode, lineStyleToDash, mergeBars, onConversionEvent, resolveStyle, runSandbox, serverClockOffset, serverNow, timeframeToMs2 as timeframeToMs, useGridSync, validateForgeScript };
|
|
24875
|
+
export { CROSSHAIR_LABEL, CROSSHAIR_STYLE, CURRENT_SCHEMA_VERSION, CURSOR_LABEL, CURSOR_STYLE, CandleEngine, Chart, ChartRuntimeResolver, CoordTransform, Crosshair, DEFAULT_SYNC_OPTIONS, DEMONSTRATION_COLOR, DEMONSTRATION_FILL, DEMONSTRATION_LABEL, DEMONSTRATION_RADIUS, DEMONSTRATION_STROKE, DEMONSTRATION_STYLE, DOT_COLOR, DOT_LABEL, DOT_RADIUS, DOT_STYLE, DatafeedConnector, DirtyFlags, ForgeScriptIndicator, ForgeScriptRuntime, Series2 as ForgeScriptSeries, GridChartContainer, GridSyncProvider, IndicatorDAG, InteractionManager, LayerName, LayoutTemplateSelector, LicenseManager, ManagedTradingController, PRODUCT_TIERS, PaneManager, PixiBenchmark, PixiChart, PixiLayerManager, PriceScale, ReferenceAPI, Series, TChart, TimeScale, TradingOverlayStore, UnmanagedIngestion, assertCanPlaceOrders, assertCanUseBrackets, assertCanUseDraggableOrders, assertCanUseManagedTrading, assertManagedMode, canPlaceBrackets, canPlaceOrders, canRenderBracketControls, canRenderBuySellButtons, canRenderCandles, canRenderDrawings, canRenderExternalOverlayOnlyMode, canRenderFills, canRenderIndicators, canRenderManagedTradingControls, canRenderOrderEntry, canRenderOrderModificationControls, canRenderOrderTicket, canRenderOverlays, canRenderPositions, canUseAiAgent, canUseAlerts, canUseBarReplay, canUseBracketOrders, canUseChartTypes, canUseCustomIndicators, canUseCustomTimeframes, canUseDataExport, canUseDraggable, canUseDraggableOrders, canUseDrawingTools, canUseExtendedDrawings, canUseExternalIngestion, canUseForgeScript, canUseHistoricalData, canUseIndicators, canUseManagedTrading, canUseManagedTradingHook, canUseMultiChartLayout, canUseMultiPane, canUseMultipleProviders, canUseMultipleWorkspaces, canUseOrderEntry, canUsePositionsOverlay, canUseRealtimeData, canUseSavedLayouts, canUseTrailingStops, canUseWatchlists, clearTelemetryListeners, computeEMA, computeEMAFromSeries, computeMACD, computeRSI, computeSMA, computeSMAFromSeries, computeVolume, computeWMAFromSeries, createChart, crosshairTool, cursorTool, demonstrationTool, detectLanguage, detectLanguageWithFallback, dotTool, evaluateSaveGate, exchangeNow, extractField, getBucketStart2 as getBucketStart, getCapabilities, getDefaultCapabilities, getDefaultStyle, getGridTemplate, getGroupedTemplates, getMissingBarCount, getStyleSlots, hasFeature, initServerClock, isManagedCapable, isManagedMode, isUnmanagedMode, isValidCombination, lineStyleToDash, mergeBars, migrateLegacyPayload, onConversionEvent, resolveStyle, runSandbox, serverClockOffset, serverNow, timeframeToMs2 as timeframeToMs, useGridSync, validateForgeScript, validateLicensePolicy };
|
|
24681
24876
|
//# sourceMappingURL=internal.js.map
|
|
24682
24877
|
//# sourceMappingURL=internal.js.map
|