@datarails-ai/dr-appspace-cli 0.12.64 → 0.12.66
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/cli.js +158 -14
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -13,7 +13,7 @@ import { fileURLToPath as fileURLToPath6 } from "url";
|
|
|
13
13
|
// package.json
|
|
14
14
|
var package_default = {
|
|
15
15
|
name: "@datarails-ai/dr-appspace-cli",
|
|
16
|
-
version: "0.12.
|
|
16
|
+
version: "0.12.66",
|
|
17
17
|
description: "Datarails App Space CLI \u2014 build, try, push and publish App Space apps",
|
|
18
18
|
type: "module",
|
|
19
19
|
engines: {
|
|
@@ -57,7 +57,7 @@ var package_default = {
|
|
|
57
57
|
};
|
|
58
58
|
|
|
59
59
|
// src/buildInfo.ts
|
|
60
|
-
var BUILD_TIME = "2026-11-
|
|
60
|
+
var BUILD_TIME = "2026-11-04T15:50:30.158Z";
|
|
61
61
|
function formatBuildTime(iso) {
|
|
62
62
|
if (iso === "") return "";
|
|
63
63
|
const d = new Date(iso);
|
|
@@ -6835,6 +6835,12 @@ function librarySection(handlers) {
|
|
|
6835
6835
|
}
|
|
6836
6836
|
return null;
|
|
6837
6837
|
}
|
|
6838
|
+
function withoutWhatIfPlan(row) {
|
|
6839
|
+
const read = isPlainObject(row.from) && isPlainObject(row.from.financeos) ? row.from.financeos.what_if : null;
|
|
6840
|
+
if (!isPlainObject(read) || read.context !== "@model.plan" || !Object.hasOwn(read, "plan")) return row;
|
|
6841
|
+
const { plan: _plan, ...rest } = read;
|
|
6842
|
+
return { ...row, from: { ...row.from, financeos: { ...row.from.financeos, what_if: rest } } };
|
|
6843
|
+
}
|
|
6838
6844
|
function readSources(handlers) {
|
|
6839
6845
|
const sources = {};
|
|
6840
6846
|
const texts = /* @__PURE__ */ new Map();
|
|
@@ -6845,7 +6851,7 @@ function readSources(handlers) {
|
|
|
6845
6851
|
const table = literals.constant("SOURCES");
|
|
6846
6852
|
if (!isPlainObject(table)) continue;
|
|
6847
6853
|
for (const [name, row] of Object.entries(table)) {
|
|
6848
|
-
if (isPlainObject(row) && sources[name] === void 0) sources[name] = row;
|
|
6854
|
+
if (isPlainObject(row) && sources[name] === void 0) sources[name] = withoutWhatIfPlan(row);
|
|
6849
6855
|
}
|
|
6850
6856
|
const carried = literals.constant("TRANSFORMS");
|
|
6851
6857
|
if (!isPlainObject(carried)) continue;
|
|
@@ -7844,7 +7850,7 @@ var contract_schema_default = {
|
|
|
7844
7850
|
from: {
|
|
7845
7851
|
description: 'one of four spellings: {"financeos": {...}} (the dashboard SPEC source vocabulary; a metric is {"metric": "@<key>"}, a key data.metrics declares, or {"metric_id": <id>}, which ties the app to one company), {"table": "<app table>"}, {"call": "<dotted method>", "args": {...}}, or ["<source>", ...] to compose others (with a transform, or with an expr the platform evaluates)',
|
|
7846
7852
|
oneOf: [
|
|
7847
|
-
{ type: "object", properties: { financeos: { type: "object", properties: { metric: { type: "string", description: 'OPTIONAL. The metric this source reads, as "@<key>": a key data.metrics declares ("@revenue_mom"). `app-space ship` binds the key to the company\'s own metric, so the contract names no metric id; the read parameters beside it (scenario, aggregation_type, period, honors, drill_rows, filterable) are what they are for metric_id, and the two never stand on one source. The compiler refuses the rest (source_metric).' } } } } },
|
|
7853
|
+
{ type: "object", properties: { financeos: { type: "object", properties: { what_if: { type: "object", description: `OPTIONAL, alone in from.financeos (trusted forecast models P2): the metric engine's what-if, {"metric": "@<key>", "context": "@model.plan"}. metric is the declared metric it projects (a calc the drivers move, never a driver); context names the plan data.model declares, which the card states as declared (the engine's what-if takes no context, so it is never claimed as sent). The source maps the drivers it moves in drivers and honours their params; its figures are the engine's evaluation, verbatim (shape kpi or series, no transform, no expr). The compiler refuses the rest (source_what_if).`, properties: { metric: { type: "string" }, context: { const: "@model.plan" } } }, metric: { type: "string", description: 'OPTIONAL. The metric this source reads, as "@<key>": a key data.metrics declares ("@revenue_mom"). `app-space ship` binds the key to the company\'s own metric, so the contract names no metric id; the read parameters beside it (scenario, aggregation_type, period, honors, drill_rows, filterable) are what they are for metric_id, and the two never stand on one source. The compiler refuses the rest (source_metric).' } } } } },
|
|
7848
7854
|
{ type: "array", items: { type: "string" } }
|
|
7849
7855
|
]
|
|
7850
7856
|
},
|
|
@@ -7853,6 +7859,8 @@ var contract_schema_default = {
|
|
|
7853
7859
|
transform: { type: "string", pattern: "^transforms/[a-z][a-z0-9_]*\\.py$" },
|
|
7854
7860
|
period: { type: ["string", "object", "null"], description: `OPTIONAL. The window the source reads. "all": every period, whatever the page sends, honoured or not (not a metric). "ytd", "last12" or "quarter" (a FinanceOS source, table or metric): a rolling window resolved at each request as the page's period presets are, so it ends today; a source that honours period reads the page's window when the page sends one, and this one when it sends none. An object {start, end, grain}: a fixed window, read where the source does not honour period. Absent: year to date, or the page's window where the source honours period.` },
|
|
7855
7861
|
honors: { type: "array", items: { type: "string" } },
|
|
7862
|
+
drivers: { type: "object", description: `OPTIONAL, a what-if source only (from.financeos.what_if): the drivers its page params move, {"@<driver key>": "<param>"} or {"@<driver key>": {"param": "<param>", "months": ["YYYY-MM"]}}, at most 20. Each key is a driver data.metrics declares; each param a slider or number a page declares and the source honours. A param the request carries as a number overrides the driver's baseline and default (or exactly the months listed); a driver whose param is absent keeps its stored values.` },
|
|
7863
|
+
contributions: { type: "boolean", description: "OPTIONAL, a what-if source only: true carries what each overridden driver contributed, the engine's own figures, in meta.source.contributions." },
|
|
7856
7864
|
where: { type: "object" },
|
|
7857
7865
|
order_by: { type: "string" },
|
|
7858
7866
|
limit: { type: "integer" },
|
|
@@ -12426,7 +12434,7 @@ function shapedOf(row) {
|
|
|
12426
12434
|
function declaredKeyOf(row) {
|
|
12427
12435
|
const origin = row.from;
|
|
12428
12436
|
const read = isObject4(origin) && isObject4(origin.financeos) ? origin.financeos : null;
|
|
12429
|
-
const metric = read === null ? null : read.metric;
|
|
12437
|
+
const metric = read === null ? null : isObject4(read.what_if) ? read.what_if.metric : read.metric;
|
|
12430
12438
|
return typeof metric === "string" && /^@[a-z][a-z0-9_]*$/.test(metric) ? metric.slice(1) : null;
|
|
12431
12439
|
}
|
|
12432
12440
|
function yearTotalFinding(card, row, model) {
|
|
@@ -12513,11 +12521,11 @@ var UI_KIT2 = "ui-kit/v4";
|
|
|
12513
12521
|
var CHARTS = "echarts@5.6.0";
|
|
12514
12522
|
var FMT = "dr-fmt@2.1.0";
|
|
12515
12523
|
var TOKENS = "dr-tokens@1.0.0";
|
|
12516
|
-
var WIDGETS = "dr-app-widgets@1.6.
|
|
12524
|
+
var WIDGETS = "dr-app-widgets@1.6.4";
|
|
12517
12525
|
var COMPONENTS = "dr-components@1.6.0";
|
|
12518
12526
|
var CONTROLS = "dr-components-controls@1.2.1";
|
|
12519
12527
|
var DASHBOARD_RUNTIME = "dr-app-runtime@1.13.4";
|
|
12520
|
-
var DASHBOARD_WIDGETS = "dr-app-widgets@1.6.
|
|
12528
|
+
var DASHBOARD_WIDGETS = "dr-app-widgets@1.6.4";
|
|
12521
12529
|
var DASHBOARD_BAR = "dr-app-dashboard@1.0.0";
|
|
12522
12530
|
var ASSISTANT = "dr-insights@1.4.1";
|
|
12523
12531
|
var MARKDOWN = "dr-md@1.0.0";
|
|
@@ -12804,7 +12812,7 @@ var FINANCEOS_SCOPES = {
|
|
|
12804
12812
|
"status:read": ["status", "whoami"],
|
|
12805
12813
|
"tables:read": ["list_tables", "get_table"],
|
|
12806
12814
|
"semantic:read": ["list_semantic_tables", "get_semantic_table", "metric_series"],
|
|
12807
|
-
"metrics:read": ["list_metrics", "get_metric", "metric_series", "metric_series_many"],
|
|
12815
|
+
"metrics:read": ["list_metrics", "get_metric", "metric_series", "metric_series_many", "metric_what_if"],
|
|
12808
12816
|
"filebox:read": ["list_filebox"],
|
|
12809
12817
|
"users:read": ["list_users"],
|
|
12810
12818
|
"pipeline:read": ["data_readiness"],
|
|
@@ -12842,6 +12850,10 @@ function financeosNeeds(row, origin) {
|
|
|
12842
12850
|
return needs;
|
|
12843
12851
|
}
|
|
12844
12852
|
const read = isPlainObject8(row.from.financeos) ? row.from.financeos : {};
|
|
12853
|
+
if (isPlainObject8(read.what_if)) {
|
|
12854
|
+
need("metric_what_if", scopesGranting("commands", "metric_what_if"));
|
|
12855
|
+
return needs;
|
|
12856
|
+
}
|
|
12845
12857
|
const filterable = Array.isArray(row.filterable) && row.filterable.length > 0;
|
|
12846
12858
|
if (readsMetric(read)) {
|
|
12847
12859
|
if (read.drill_rows) need("data_models", scopesGranting("namespaces", "data_models"));
|
|
@@ -13486,6 +13498,10 @@ function metricProblems(metrics, sources) {
|
|
|
13486
13498
|
for (const name of Object.keys(sources ?? {}).sort(natural3)) {
|
|
13487
13499
|
const row = sources[name];
|
|
13488
13500
|
if (!isPlainObject8(row) || originOf(row) !== "financeos" || !isPlainObject8(row.from.financeos)) continue;
|
|
13501
|
+
if (isPlainObject8(row.from.financeos.what_if)) {
|
|
13502
|
+
for (const ref of whatIfRefs(row)) if (declaredKeys.includes(ref.slice(1))) read.add(ref.slice(1));
|
|
13503
|
+
continue;
|
|
13504
|
+
}
|
|
13489
13505
|
const metric = row.from.financeos.metric;
|
|
13490
13506
|
if (metric === void 0 || metric === null) continue;
|
|
13491
13507
|
const pointer2 = `/data/sources/${escapePointer3(name)}/from/financeos/metric`;
|
|
@@ -13662,7 +13678,8 @@ function modelTotalProblems(model, sources) {
|
|
|
13662
13678
|
const lines = isPlainObject8(model) && isPlainObject8(model.lines) ? model.lines : {};
|
|
13663
13679
|
for (const [name, row] of Object.entries(isPlainObject8(sources) ? sources : {})) {
|
|
13664
13680
|
if (!isPlainObject8(row) || row.shape !== "kpi" || row.transform !== void 0 && row.transform !== null && row.transform !== false && row.transform !== "") continue;
|
|
13665
|
-
const
|
|
13681
|
+
const read = isPlainObject8(row.from) && isPlainObject8(row.from.financeos) ? row.from.financeos : null;
|
|
13682
|
+
const metric = read === null ? null : isPlainObject8(read.what_if) ? read.what_if.metric : read.metric;
|
|
13666
13683
|
const line2 = typeof metric === "string" && Object.hasOwn(lines, metric) && isPlainObject8(lines[metric]) ? lines[metric] : null;
|
|
13667
13684
|
const want = line2 !== null && typeof line2.fy === "string" && Object.hasOwn(FY_AGG, line2.fy) ? FY_AGG[line2.fy] : null;
|
|
13668
13685
|
if (want === null) continue;
|
|
@@ -13678,6 +13695,125 @@ function modelTotalProblems(model, sources) {
|
|
|
13678
13695
|
}
|
|
13679
13696
|
return problems;
|
|
13680
13697
|
}
|
|
13698
|
+
var WHAT_IF_MAX_DRIVERS = 20;
|
|
13699
|
+
var WHAT_IF_READ_KEYS = ["metric", "context"];
|
|
13700
|
+
var WHAT_IF_CONTEXT = "@model.plan";
|
|
13701
|
+
var WHAT_IF_SHAPES = ["kpi", "series"];
|
|
13702
|
+
var WHAT_IF_DRIVER_KEYS = ["param", "months"];
|
|
13703
|
+
var WHAT_IF_MONTH_RE = /^\d{4}-(0[1-9]|1[0-2])$/;
|
|
13704
|
+
var WHAT_IF_PARAM_KINDS = /* @__PURE__ */ new Set(["slider", "number"]);
|
|
13705
|
+
function whatIfOf(row) {
|
|
13706
|
+
const read = isPlainObject8(row) && isPlainObject8(row.from) && isPlainObject8(row.from.financeos) ? row.from.financeos : null;
|
|
13707
|
+
return read !== null && Object.hasOwn(read, "what_if") ? read.what_if : null;
|
|
13708
|
+
}
|
|
13709
|
+
function driverParam(target) {
|
|
13710
|
+
const param = isPlainObject8(target) ? target.param : target;
|
|
13711
|
+
return typeof param === "string" && param !== "" ? param : null;
|
|
13712
|
+
}
|
|
13713
|
+
function whatIfRefs(row) {
|
|
13714
|
+
const read = whatIfOf(row);
|
|
13715
|
+
if (!isPlainObject8(read)) return [];
|
|
13716
|
+
const refs = [];
|
|
13717
|
+
if (typeof read.metric === "string" && METRIC_REF_RE.test(read.metric)) refs.push(read.metric);
|
|
13718
|
+
for (const ref of Object.keys(isPlainObject8(row.drivers) ? row.drivers : {})) if (METRIC_REF_RE.test(ref)) refs.push(ref);
|
|
13719
|
+
return refs;
|
|
13720
|
+
}
|
|
13721
|
+
function whatIfProblems(contract) {
|
|
13722
|
+
const problems = [];
|
|
13723
|
+
const sources = isPlainObject8(contract?.data?.sources) ? contract.data.sources : {};
|
|
13724
|
+
const declared = isPlainObject8(contract?.data?.metrics) ? contract.data.metrics : {};
|
|
13725
|
+
const params = /* @__PURE__ */ new Map();
|
|
13726
|
+
for (const page of Array.isArray(contract?.pages) ? contract.pages : []) {
|
|
13727
|
+
for (const param of Array.isArray(page?.params) ? page.params : []) {
|
|
13728
|
+
if (isPlainObject8(param) && typeof param.name === "string" && !params.has(param.name)) params.set(param.name, param.kind);
|
|
13729
|
+
}
|
|
13730
|
+
}
|
|
13731
|
+
const declaredOf = (ref) => {
|
|
13732
|
+
const match = typeof ref === "string" ? METRIC_REF_RE.exec(ref) : null;
|
|
13733
|
+
return match !== null && Object.hasOwn(declared, match[1]) && isPlainObject8(declared[match[1]]) ? declared[match[1]] : null;
|
|
13734
|
+
};
|
|
13735
|
+
for (const name of Object.keys(sources).sort(natural3)) {
|
|
13736
|
+
const row = sources[name];
|
|
13737
|
+
const read = whatIfOf(row);
|
|
13738
|
+
if (read === null) continue;
|
|
13739
|
+
const at = (key) => `/data/sources/${escapePointer3(name)}${key ? `/${key}` : ""}`;
|
|
13740
|
+
const say = (key, message) => problems.push({ code: "source_what_if", pointer: at(key), message: `source "${name}" ${message}` });
|
|
13741
|
+
for (const key of Object.keys(row.from.financeos).sort(natural3)) {
|
|
13742
|
+
if (key !== "what_if") say(`from/financeos/${escapePointer3(key)}`, `states ${key} beside what_if; a what-if reads its result metric and nothing else, so drop ${key}`);
|
|
13743
|
+
}
|
|
13744
|
+
if (!isPlainObject8(read)) {
|
|
13745
|
+
say("from/financeos/what_if", `states what_if ${JSON.stringify(read)}; it is {"metric": "@<key>", "context": "${WHAT_IF_CONTEXT}"}`);
|
|
13746
|
+
continue;
|
|
13747
|
+
}
|
|
13748
|
+
for (const key of Object.keys(read).sort(natural3)) {
|
|
13749
|
+
if (!WHAT_IF_READ_KEYS.includes(key)) say(`from/financeos/what_if/${escapePointer3(key)}`, `states what_if.${key}, which a what-if does not take; it takes ${either3(WHAT_IF_READ_KEYS)}`);
|
|
13750
|
+
}
|
|
13751
|
+
const result = declaredOf(read.metric);
|
|
13752
|
+
if (result === null) {
|
|
13753
|
+
say("from/financeos/what_if/metric", `projects ${JSON.stringify(read.metric ?? null)}, which is not a metric data.metrics declares, written "@<key>"`);
|
|
13754
|
+
} else if (result.kind === "driver") {
|
|
13755
|
+
say("from/financeos/what_if/metric", `projects "${read.metric}", a driver; a what-if projects a metric the drivers move (a calc), so name that metric and map "${read.metric}" in drivers`);
|
|
13756
|
+
}
|
|
13757
|
+
if (read.context !== void 0 && read.context !== WHAT_IF_CONTEXT) {
|
|
13758
|
+
say("from/financeos/what_if/context", `runs under context ${JSON.stringify(read.context)}; the one context a what-if names is "${WHAT_IF_CONTEXT}", the plan data.model declares`);
|
|
13759
|
+
} else if (read.context === WHAT_IF_CONTEXT && !isPlainObject8(contract?.data?.model?.plan)) {
|
|
13760
|
+
say("from/financeos/what_if/context", `runs under "${WHAT_IF_CONTEXT}", and data.model declares no plan; declare data.model.plan ({"module": "forecast", "cycle": "4+8", "year": 2026}), or drop context`);
|
|
13761
|
+
}
|
|
13762
|
+
if (!WHAT_IF_SHAPES.includes(row.shape)) say("shape", `answers in shape ${JSON.stringify(row.shape ?? null)}; a what-if answers ${either3(WHAT_IF_SHAPES)}: the engine's months, or their total`);
|
|
13763
|
+
for (const key of ["transform", "expr"]) {
|
|
13764
|
+
if (row[key] !== void 0 && row[key] !== null) say(key, `states ${key}; a what-if's figures are the engine's own evaluation, verbatim, so no app step stands between them and the card`);
|
|
13765
|
+
}
|
|
13766
|
+
if (row.contributions !== void 0 && typeof row.contributions !== "boolean") say("contributions", `states contributions ${JSON.stringify(row.contributions)}; it is true (the card carries what each driver contributed) or false`);
|
|
13767
|
+
const honors = Array.isArray(row.honors) ? row.honors : [];
|
|
13768
|
+
const mapped = /* @__PURE__ */ new Set();
|
|
13769
|
+
if (!isPlainObject8(row.drivers) || Object.keys(row.drivers).length === 0) {
|
|
13770
|
+
say("drivers", `maps no drivers; a what-if moves at least one driver by a page param ({"@<driver>": "<param>"}) \u2014 a figure nothing moves is a plain metric read (from.financeos.metric)`);
|
|
13771
|
+
} else {
|
|
13772
|
+
const refs = Object.keys(row.drivers);
|
|
13773
|
+
if (refs.length > WHAT_IF_MAX_DRIVERS) say("drivers", `maps ${refs.length} drivers, and Datarails evaluates at most ${WHAT_IF_MAX_DRIVERS} in one what-if`);
|
|
13774
|
+
for (const ref of refs.sort(natural3)) {
|
|
13775
|
+
const pointer2 = `drivers/${escapePointer3(ref)}`;
|
|
13776
|
+
const decl = declaredOf(ref);
|
|
13777
|
+
if (decl === null || decl.kind !== "driver") {
|
|
13778
|
+
say(pointer2, `maps ${JSON.stringify(ref)}, which is not a driver data.metrics declares ("@<key>" of kind driver)${decl !== null ? ` \u2014 it is a ${decl.kind ?? "bound"} metric` : ""}`);
|
|
13779
|
+
}
|
|
13780
|
+
const target = row.drivers[ref];
|
|
13781
|
+
const param = driverParam(target);
|
|
13782
|
+
if (isPlainObject8(target)) {
|
|
13783
|
+
for (const key of Object.keys(target).sort(natural3)) if (!WHAT_IF_DRIVER_KEYS.includes(key)) say(`${pointer2}/${escapePointer3(key)}`, `maps "${ref}" with ${key}, which a driver does not take; it takes ${either3(WHAT_IF_DRIVER_KEYS)}`);
|
|
13784
|
+
const months = target.months;
|
|
13785
|
+
if (months !== void 0 && !(Array.isArray(months) && months.length > 0 && months.every((one) => typeof one === "string" && WHAT_IF_MONTH_RE.test(one)) && new Set(months).size === months.length)) {
|
|
13786
|
+
say(`${pointer2}/months`, `moves "${ref}" in months ${JSON.stringify(months)}; months is a list of distinct months, each "YYYY-MM"`);
|
|
13787
|
+
}
|
|
13788
|
+
}
|
|
13789
|
+
if (param === null) {
|
|
13790
|
+
say(pointer2, `maps "${ref}" to ${JSON.stringify(target ?? null)}; a driver maps to the page param that moves it, "<param>" or {"param": "<param>", "months": ["YYYY-MM"]}`);
|
|
13791
|
+
continue;
|
|
13792
|
+
}
|
|
13793
|
+
mapped.add(param);
|
|
13794
|
+
if (!params.has(param) || !WHAT_IF_PARAM_KINDS.has(params.get(param))) {
|
|
13795
|
+
say(pointer2, `moves "${ref}" by param "${param}", which no page declares as a slider or number; declare it in a page's params`);
|
|
13796
|
+
} else if (!honors.includes(param)) {
|
|
13797
|
+
say("honors", `moves "${ref}" by param "${param}", which it does not honour; add "${param}" to honors`);
|
|
13798
|
+
}
|
|
13799
|
+
}
|
|
13800
|
+
}
|
|
13801
|
+
honors.forEach((one, index) => {
|
|
13802
|
+
if (mapped.size > 0 && !mapped.has(one)) say(`honors/${index}`, `honours ${JSON.stringify(one)}, which no driver maps; a what-if honours the params that move its drivers, and nothing else moves it`);
|
|
13803
|
+
});
|
|
13804
|
+
}
|
|
13805
|
+
return problems;
|
|
13806
|
+
}
|
|
13807
|
+
function withWhatIfPlans(sources, model) {
|
|
13808
|
+
const plan = isPlainObject8(model) && isPlainObject8(model.plan) ? model.plan : null;
|
|
13809
|
+
if (plan === null) return sources;
|
|
13810
|
+
const out = {};
|
|
13811
|
+
for (const [name, row] of Object.entries(sources)) {
|
|
13812
|
+
const read = whatIfOf(row);
|
|
13813
|
+
out[name] = isPlainObject8(read) && read.context === WHAT_IF_CONTEXT ? { ...row, from: { ...row.from, financeos: { ...row.from.financeos, what_if: { ...read, plan: canonical(plan) } } } } : row;
|
|
13814
|
+
}
|
|
13815
|
+
return out;
|
|
13816
|
+
}
|
|
13681
13817
|
function driverParamProblems(contract) {
|
|
13682
13818
|
const problems = [];
|
|
13683
13819
|
const declared = isPlainObject8(contract?.data?.metrics) ? contract.data.metrics : {};
|
|
@@ -14298,7 +14434,8 @@ function compileApp(contract, { kit = null, runtime = RUNTIME, extra = {} } = {}
|
|
|
14298
14434
|
// The forecast plan's P1: the planning model, and the params that open on a driver.
|
|
14299
14435
|
...planModelProblems(contract?.data?.model, contract?.data?.metrics),
|
|
14300
14436
|
...modelTotalProblems(contract?.data?.model, stated2),
|
|
14301
|
-
...driverParamProblems(contract)
|
|
14437
|
+
...driverParamProblems(contract),
|
|
14438
|
+
...whatIfProblems(contract)
|
|
14302
14439
|
];
|
|
14303
14440
|
problems.push(...metricFindings.filter((one) => !one.advisory));
|
|
14304
14441
|
const owned = ownedReaders(contract.pages, extra);
|
|
@@ -14431,7 +14568,8 @@ function compileApp(contract, { kit = null, runtime = RUNTIME, extra = {} } = {}
|
|
|
14431
14568
|
files[path3] = handlers[name].role === "custom" ? extra[path3] : handlerModule(name, handlers[name], model);
|
|
14432
14569
|
}
|
|
14433
14570
|
const params = paramsTable(contract);
|
|
14434
|
-
|
|
14571
|
+
const carried = withWhatIfPlans(sources, contract?.data?.model);
|
|
14572
|
+
for (const name of served) files[`handlers/${name}.py`] = sourceModule(name, carried, transforms, params);
|
|
14435
14573
|
const theme = isPlainObject8(app.theme) ? app.theme : null;
|
|
14436
14574
|
if (theme !== null) files[THEME_FILE4] = themeCss(theme);
|
|
14437
14575
|
files[PALETTE_FILE] = paletteCss();
|
|
@@ -28663,6 +28801,12 @@ function librarySection2(handlers) {
|
|
|
28663
28801
|
}
|
|
28664
28802
|
return null;
|
|
28665
28803
|
}
|
|
28804
|
+
function withoutWhatIfPlan2(row) {
|
|
28805
|
+
const read = isPlainObject12(row.from) && isPlainObject12(row.from.financeos) ? row.from.financeos.what_if : null;
|
|
28806
|
+
if (!isPlainObject12(read) || read.context !== "@model.plan" || !Object.hasOwn(read, "plan")) return row;
|
|
28807
|
+
const { plan: _plan, ...rest } = read;
|
|
28808
|
+
return { ...row, from: { ...row.from, financeos: { ...row.from.financeos, what_if: rest } } };
|
|
28809
|
+
}
|
|
28666
28810
|
function readSources2(handlers) {
|
|
28667
28811
|
const sources = {};
|
|
28668
28812
|
const texts = /* @__PURE__ */ new Map();
|
|
@@ -28673,7 +28817,7 @@ function readSources2(handlers) {
|
|
|
28673
28817
|
const table = literals.constant("SOURCES");
|
|
28674
28818
|
if (!isPlainObject12(table)) continue;
|
|
28675
28819
|
for (const [name, row] of Object.entries(table)) {
|
|
28676
|
-
if (isPlainObject12(row) && sources[name] === void 0) sources[name] = row;
|
|
28820
|
+
if (isPlainObject12(row) && sources[name] === void 0) sources[name] = withoutWhatIfPlan2(row);
|
|
28677
28821
|
}
|
|
28678
28822
|
const carried = literals.constant("TRANSFORMS");
|
|
28679
28823
|
if (!isPlainObject12(carried)) continue;
|
|
@@ -30241,7 +30385,7 @@ function shapedOf2(row) {
|
|
|
30241
30385
|
function declaredKeyOf2(row) {
|
|
30242
30386
|
const origin = row.from;
|
|
30243
30387
|
const read = isObject7(origin) && isObject7(origin.financeos) ? origin.financeos : null;
|
|
30244
|
-
const metric = read === null ? null : read.metric;
|
|
30388
|
+
const metric = read === null ? null : isObject7(read.what_if) ? read.what_if.metric : read.metric;
|
|
30245
30389
|
return typeof metric === "string" && /^@[a-z][a-z0-9_]*$/.test(metric) ? metric.slice(1) : null;
|
|
30246
30390
|
}
|
|
30247
30391
|
function yearTotalFinding2(card, row, model) {
|
|
@@ -32293,7 +32437,7 @@ var kit_default2 = {
|
|
|
32293
32437
|
checks: "checks/run.mjs",
|
|
32294
32438
|
contract: "contract/extract.mjs",
|
|
32295
32439
|
charts: "echarts@5.6.0",
|
|
32296
|
-
appWidgets: "dr-app-widgets@1.6.
|
|
32440
|
+
appWidgets: "dr-app-widgets@1.6.4",
|
|
32297
32441
|
appComponents: "dr-components@1.6.0",
|
|
32298
32442
|
appControls: "dr-components-controls@1.2.1"
|
|
32299
32443
|
};
|