react-semaphor 0.1.559 → 0.1.560
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/analytics-protocol/index.js +368 -361
- package/dist/assistant-context/index.js +1 -1
- package/dist/assistant-protocol/index.js +5 -5
- package/dist/brand-studio/index.js +9 -9
- package/dist/briefings/index.js +5 -5
- package/dist/chunks/analytics-base-schemas-CHLxsPfX.js +630 -0
- package/dist/chunks/{assistant-chat-B_4bVE6I.js → assistant-chat-Bu2fFm_I.js} +206 -207
- package/dist/chunks/{bookmark-state-ssqrs5oP.js → bookmark-state-BFY9oNmr.js} +3 -3
- package/dist/chunks/{braces-Rdxa3H-s.js → braces-Da41xfUd.js} +1 -1
- package/dist/chunks/{comparison-window-caption-CKzQ5LcF.js → comparison-window-caption-4FNkMrzE.js} +166 -166
- package/dist/chunks/{context-DVy4HOU0.js → context-BgPDzLHZ.js} +1 -1
- package/dist/chunks/{custom-visual-inputs-zVa9wX_o.js → custom-visual-inputs-Dz-enUNR.js} +1 -1
- package/dist/chunks/{dashboard-BziwOVpZ.js → dashboard-_MeBuy67.js} +1 -1
- package/dist/chunks/{dashboard-briefing-launcher-CbeNR-YI.js → dashboard-briefing-launcher-CEi4Pr_v.js} +1152 -1166
- package/dist/chunks/{dashboard-controls-RD6UJs1r.js → dashboard-controls-Bi7fyG-4.js} +98 -98
- package/dist/chunks/{dashboard-json-DGpv17vL.js → dashboard-json-B1mU_OMa.js} +5 -5
- package/dist/chunks/{document-dashboard-inputs-ChVkcBuu.js → document-dashboard-inputs-CkWfDB8c.js} +64 -64
- package/dist/chunks/{edit-dashboard-visual-AQ2pQkFp.js → edit-dashboard-visual-0CJN31Y3.js} +8375 -8615
- package/dist/chunks/filter-reach-copy-BF4w4kI2.js +3738 -0
- package/dist/chunks/{filter-value-text-B4l-xqJT.js → filter-value-text-CRC-K_l_.js} +3 -3
- package/dist/chunks/{global-date-filter-utils-DBzEOX9M.js → global-date-filter-utils-D8365uPH.js} +4068 -3401
- package/dist/chunks/{index-B1Xr7W24.js → index-DtHidOPV.js} +579 -604
- package/dist/chunks/{layout-grid-Bbz3zKif.js → layout-grid-BvsH4RY2.js} +1 -1
- package/dist/chunks/{list-filter-3sbH0Uy1.js → list-filter-Dg0otx5E.js} +1 -1
- package/dist/chunks/{matrix-analytical-definition-CEe3PGEo.js → matrix-analytical-definition-CM18W8w6.js} +4 -4
- package/dist/chunks/{matrix-card-BRNGb1C4.js → matrix-card-HPskLaPy.js} +3 -3
- package/dist/chunks/{matrix-member-presentation-CEegvTqg.js → matrix-member-presentation-Bbrfrke4.js} +1 -1
- package/dist/chunks/{matrix-operation-contract-COxrfQTS.js → matrix-operation-contract-WPv4R-H_.js} +110 -110
- package/dist/chunks/{metric-comparison-DQx-uX__.js → metric-comparison-ljMKYZKa.js} +2 -2
- package/dist/chunks/{model-change-CJEj3ZD6.js → model-change-Ccn1zaxl.js} +1 -1
- package/dist/chunks/{palette-DMJtp3Vn.js → palette-Bsh376zO.js} +1 -1
- package/dist/chunks/{pivot-result-contract-expectations-DOYhqeZb.js → pivot-result-contract-expectations-Bl5suy4-.js} +602 -696
- package/dist/chunks/{pivot-result-identity-CAj8SiRL.js → pivot-result-identity-vS9TSh4f.js} +1 -1
- package/dist/chunks/{raw-temporal-presentation-BmT7z6NH.js → raw-temporal-presentation-BHm7s-hz.js} +230 -274
- package/dist/chunks/{report-preferences-dialog-0sc8B1lh.js → report-preferences-dialog-BV8L0SeS.js} +55 -55
- package/dist/chunks/{report-runtime-context-bYoExeWr.js → report-runtime-context-BZQh9ywy.js} +2 -2
- package/dist/chunks/{resolve-dashboard-input-context-B_C_VAJH.js → resolve-dashboard-input-context-CAMiWvyR.js} +1749 -1989
- package/dist/chunks/{save-DSb1jTtG.js → save-B5EAsgQF.js} +1 -1
- package/dist/chunks/{saved-dashboard-context-BQWM3ldX.js → saved-dashboard-context-n2Wn11cV.js} +57 -57
- package/dist/chunks/{selection-reducer-DSzMWb4x.js → selection-reducer-D0YnaAD9.js} +1 -1
- package/dist/chunks/{semaphor-ready-indicator-Bz14Oma5.js → semaphor-ready-indicator-XLBLOJ2V.js} +38374 -39104
- package/dist/chunks/{shelf-drop-preview-context-DBHAkgch.js → shelf-drop-preview-context-DHMa54a-.js} +570 -570
- package/dist/chunks/{source-entity-resolution-BOrmNCEM.js → source-entity-resolution-dUG5VWRm.js} +1 -1
- package/dist/chunks/{switch-Dq8XPFpT.js → switch-ByxH4M7t.js} +3 -3
- package/dist/chunks/{table-export-sheet-C_RvEUyO.js → table-export-sheet-C_GdeTYU.js} +1 -1
- package/dist/chunks/{table-settings-DXj_zXwS.js → table-settings-Imz0FgWi.js} +6 -6
- package/dist/chunks/{temporal-input-presentation-AhLSkGPf.js → temporal-input-presentation-uvNK_tM0.js} +1109 -820
- package/dist/chunks/{token-types-LCYMJ3pa.js → token-types-CQtXUVMy.js} +1 -1
- package/dist/chunks/{upload-Dr_WAxHQ.js → upload-wbR-NVzq.js} +1 -1
- package/dist/chunks/{use-create-flow-overlay-state-BK3YFkfc.js → use-create-flow-overlay-state-CEBaLOKC.js} +6 -6
- package/dist/chunks/{validators-C87JPd-_.js → validators-CXTneCA4.js} +1206 -1579
- package/dist/chunks/{zoned-wall-clock-E35Frf9v.js → zoned-wall-clock-B1n_WjW3.js} +1 -1
- package/dist/dashboard/index.js +2 -2
- package/dist/dashboard-authoring/index.js +2207 -1497
- package/dist/data-app-sdk/index.js +5 -5
- package/dist/data-app-sdk-adapters/index.js +3 -3
- package/dist/data-app-sdk-validation/index.js +6 -6
- package/dist/format-utils/index.js +181 -176
- package/dist/index.js +22 -22
- package/dist/report-runtime-context/index.js +2 -2
- package/dist/style.css +1 -1
- package/dist/surfboard/index.js +2 -2
- package/dist/types/components/editor/editor-aside/utils.d.ts +1 -1
- package/dist/types/components/visual/data-table/types/data-table.d.ts +5 -20
- package/dist/types/index.js +6 -6
- package/dist/types/lib/formatters/canonical-format-adapter.d.ts +2 -29
- package/dist/types/lib/formatters/raw-temporal-presentation.d.ts +0 -2
- package/dist/types/lib/formatters/table-column-settings.d.ts +47 -0
- package/dist/types/lib/matrix-table/matrix-card-adapter.d.ts +10 -188
- package/dist/types/lib/matrix-table/matrix-delivery-policy.d.ts +1 -1
- package/dist/types/lib/matrix-table/matrix-delivery.d.ts +16 -372
- package/dist/types/lib/stores/dashboard-store.d.ts +0 -1
- package/dist/types/lib/stores/editor-store.d.ts +39 -9
- package/dist/types/lib/stores/table-actions.d.ts +9 -3
- package/dist/types/lib/table-formatting/index.d.ts +0 -2
- package/dist/types/lib/table-formatting/table-conditional-formatting-range-source.d.ts +3 -2
- package/dist/types/lib/table-formatting/table-conditional-formatting-range.d.ts +3 -2
- package/dist/types/lib/table-formatting/table-formatting-normalize.d.ts +1 -2
- package/dist/types/lib/table-formatting/table-formatting-render-model.d.ts +9 -0
- package/dist/types/lib/table-formatting/table-formatting-types.d.ts +5 -95
- package/dist/types/lib/table-formatting/table-presentation-fields.d.ts +35 -0
- package/dist/types/lib/types/common-types.d.ts +40 -47
- package/dist/types/lib/types/explorer-types.d.ts +11 -43
- package/dist/types/lib/utils/card-config-utils.d.ts +8 -0
- package/dist/types/lib/utils/card-definition.d.ts +9 -187
- package/dist/types/shared/analytics-protocol/analytics-base-schemas.d.ts +159 -513
- package/dist/types/shared/analytics-protocol/contracts.d.ts +32 -9
- package/dist/types/shared/analytics-protocol/execution-input-schemas.d.ts +108 -980
- package/dist/types/shared/analytics-protocol/field-validation.d.ts +1 -0
- package/dist/types/shared/analytics-protocol/matrix-definition-contract.d.ts +281 -4624
- package/dist/types/shared/analytics-protocol/matrix-operation-contract.d.ts +20 -20
- package/dist/types/shared/analytics-protocol/matrix-operation-request.d.ts +18 -18
- package/dist/types/shared/analytics-protocol/matrix-path-contract.d.ts +40 -40
- package/dist/types/shared/analytics-protocol/matrix-window-contract.d.ts +3 -203
- package/dist/types/shared/analytics-protocol/scalar-value.d.ts +8 -8
- package/dist/types/shared/assistant-context/saved-dashboard-context.d.ts +8 -0
- package/dist/types/shared/assistant-protocol/context.d.ts +69 -69
- package/dist/types/shared/dashboard-authoring/canonical-result-keys.d.ts +13 -0
- package/dist/types/shared/dashboard-authoring/card-export-request.d.ts +4 -1
- package/dist/types/shared/dashboard-authoring/card-formats/sql-date-pattern.d.ts +10 -0
- package/dist/types/shared/dashboard-authoring/card-formats/upgrade-card-formats.d.ts +57 -0
- package/dist/types/shared/dashboard-authoring/changes/dashboard-change.d.ts +24 -24
- package/dist/types/shared/dashboard-authoring/conditional-formatting/editable.d.ts +14 -0
- package/dist/types/shared/dashboard-authoring/conditional-formatting/evaluate.d.ts +16 -0
- package/dist/types/shared/dashboard-authoring/conditional-formatting/index.d.ts +9 -0
- package/dist/types/shared/dashboard-authoring/conditional-formatting/kpi.d.ts +14 -0
- package/dist/types/shared/dashboard-authoring/conditional-formatting/resolve-card-column-ref.d.ts +17 -0
- package/dist/types/shared/dashboard-authoring/conditional-formatting/retain.d.ts +14 -0
- package/dist/types/shared/dashboard-authoring/conditional-formatting/schema.d.ts +4499 -0
- package/dist/types/shared/dashboard-authoring/conditional-formatting/store.d.ts +12 -0
- package/dist/types/shared/dashboard-authoring/conditional-formatting/types.d.ts +151 -0
- package/dist/types/shared/dashboard-authoring/conditional-formatting/upgrade.d.ts +35 -0
- package/dist/types/shared/dashboard-authoring/control-execution-contract.d.ts +62 -62
- package/dist/types/shared/dashboard-authoring/index.d.ts +5 -0
- package/dist/types/shared/dashboard-authoring/matrix-authoring.d.ts +4 -5
- package/dist/types/shared/dashboard-authoring/matrix-delivery.d.ts +24 -736
- package/dist/types/shared/dashboard-authoring/retired-presentation-fields.d.ts +31 -0
- package/dist/types/shared/dashboard-authoring/upgrade-card-presentation.d.ts +14 -0
- package/dist/types/shared/format-utils/formatters/matrix-formatter.d.ts +5 -1
- package/dist/types/shared/format-utils/formatters/number-formatter.d.ts +16 -0
- package/dist/types/shared/format-utils/index.d.ts +2 -0
- package/dist/types/shared/format-utils/matrix-export-presentation.d.ts +10 -366
- package/dist/types/shared/format-utils/raw-temporal.d.ts +15 -1
- package/dist/types/shared/format-utils/resolve-column-format.d.ts +43 -0
- package/dist/types/shared/format-utils/retired-format-adapters.d.ts +68 -0
- package/dist/types/shared/format-utils/semantic-format.d.ts +5 -1
- package/dist/types/shared/format-utils/stored-value-format.d.ts +16 -0
- package/dist/types/shared/format-utils/types/format-types.d.ts +10 -12
- package/package.json +1 -1
- package/dist/chunks/analytics-base-schemas-BUFUoO6G.js +0 -472
- package/dist/chunks/editor-draft-sync-BN5qYHPF.js +0 -15
- package/dist/chunks/filter-reach-copy-B5Y7FHzg.js +0 -3411
- package/dist/types/lib/table-formatting/table-conditional-formatting-evaluator.d.ts +0 -9
- package/dist/types/lib/table-formatting/table-formatting-validation.d.ts +0 -12
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import { M as
|
|
2
|
-
import { z as
|
|
3
|
-
function
|
|
1
|
+
import { M as ve, x as O, w as It, y as St, z as kt, B as wt, D as At, v as xt, h as je, j as X, k as Ft, b as Dt, d as Ye } from "./analytics-base-schemas-CHLxsPfX.js";
|
|
2
|
+
import { z as a } from "zod";
|
|
3
|
+
function Mt(e) {
|
|
4
4
|
return typeof e == "string" || typeof e == "number" && Number.isFinite(e) || typeof e == "boolean";
|
|
5
5
|
}
|
|
6
|
-
function
|
|
7
|
-
return !Array.isArray(e) || e.length === 0 || e.length >
|
|
6
|
+
function Et(e) {
|
|
7
|
+
return !Array.isArray(e) || e.length === 0 || e.length > ve || !e.every(Mt) ? {
|
|
8
8
|
ok: !1,
|
|
9
|
-
error: `matchValues must be 1 to ${
|
|
9
|
+
error: `matchValues must be 1 to ${ve} string, number or boolean values.`
|
|
10
10
|
} : { ok: !0, values: e };
|
|
11
11
|
}
|
|
12
|
-
const
|
|
12
|
+
const Tt = [
|
|
13
13
|
"day",
|
|
14
14
|
"week",
|
|
15
15
|
"month",
|
|
16
16
|
"quarter",
|
|
17
17
|
"year"
|
|
18
|
-
],
|
|
18
|
+
], Ma = ["this", "previous"], Nt = ["now", "latest_available"], Rt = [
|
|
19
19
|
"include_partial",
|
|
20
20
|
"complete_periods"
|
|
21
|
-
],
|
|
21
|
+
], Ea = {
|
|
22
22
|
second: 31536e4,
|
|
23
23
|
minute: 5256e3,
|
|
24
24
|
hour: 87600,
|
|
@@ -28,23 +28,23 @@ const Bt = [
|
|
|
28
28
|
quarter: 40,
|
|
29
29
|
year: 10
|
|
30
30
|
};
|
|
31
|
-
function
|
|
31
|
+
function $t(e) {
|
|
32
32
|
return e.anchor ?? "latest_available";
|
|
33
33
|
}
|
|
34
|
-
function
|
|
34
|
+
function M(e) {
|
|
35
35
|
return !!e && (e.kind === void 0 || e.kind === "relative");
|
|
36
36
|
}
|
|
37
|
-
function
|
|
37
|
+
function Ct(e) {
|
|
38
38
|
return (e == null ? void 0 : e.kind) === "calendar";
|
|
39
39
|
}
|
|
40
|
-
function
|
|
41
|
-
return
|
|
40
|
+
function Ta(e) {
|
|
41
|
+
return M(e) && e.anchor === "latest_available" || Yt(e) ? null : M(e) && e.unit === "day" && e.completeness !== "complete_periods" ? { mode: "between", unit: "day", from: 1 - e.value, to: 0 } : Ot(M(e) ? { ...e, anchor: "now" } : e);
|
|
42
42
|
}
|
|
43
|
-
const
|
|
44
|
-
function
|
|
45
|
-
return
|
|
43
|
+
const jt = /* @__PURE__ */ new Set(["week", "month", "quarter", "year"]);
|
|
44
|
+
function Yt(e) {
|
|
45
|
+
return M(e) && jt.has(e.unit) && e.completeness !== "complete_periods";
|
|
46
46
|
}
|
|
47
|
-
function
|
|
47
|
+
function Na(e) {
|
|
48
48
|
const t = e;
|
|
49
49
|
return t.mode === "between" ? t.unit === "day" && t.to === 0 && typeof t.from == "number" && t.from <= 0 ? { unit: "day", value: 1 - t.from } : null : t.mode === "last" && typeof t.n == "number" ? t.relativeTo === "latest_data" ? null : {
|
|
50
50
|
unit: t.unit,
|
|
@@ -53,28 +53,28 @@ function ga(e) {
|
|
|
53
53
|
completeness: t.complete ? "complete_periods" : "include_partial"
|
|
54
54
|
} : t.mode === "this" ? t.boundary ? null : { kind: "calendar", unit: t.unit, period: "this", ...t.toDate ? { toDate: !0 } : {} } : t.mode === "previous" ? { kind: "calendar", unit: t.unit, period: "previous" } : null;
|
|
55
55
|
}
|
|
56
|
-
function
|
|
57
|
-
if (
|
|
56
|
+
function Ot(e, t = {}) {
|
|
57
|
+
if (Ct(e))
|
|
58
58
|
return e.period === "previous" ? { mode: "previous", unit: e.unit } : {
|
|
59
59
|
mode: "this",
|
|
60
60
|
unit: e.unit,
|
|
61
61
|
...e.toDate ? { toDate: !0 } : {}
|
|
62
62
|
};
|
|
63
|
-
if (!
|
|
63
|
+
if (!M(e))
|
|
64
64
|
return null;
|
|
65
|
-
const i =
|
|
65
|
+
const i = $t(e) === "latest_available" ? { relativeTo: "latest_data" } : {}, s = e.value, l = (t.completeness ?? e.completeness) === "complete_periods";
|
|
66
66
|
switch (e.unit) {
|
|
67
67
|
case "second":
|
|
68
68
|
return null;
|
|
69
69
|
case "minute":
|
|
70
70
|
case "hour":
|
|
71
|
-
return
|
|
71
|
+
return l ? null : { mode: "last", n: s, unit: e.unit, ...i };
|
|
72
72
|
default:
|
|
73
73
|
return {
|
|
74
74
|
mode: "last",
|
|
75
|
-
n:
|
|
75
|
+
n: s,
|
|
76
76
|
unit: e.unit,
|
|
77
|
-
...
|
|
77
|
+
...l ? { complete: !0 } : {},
|
|
78
78
|
...i
|
|
79
79
|
};
|
|
80
80
|
}
|
|
@@ -82,54 +82,54 @@ function Kt(e, t = {}) {
|
|
|
82
82
|
function r(e, t, i) {
|
|
83
83
|
return i ? { code: e, message: t, path: i } : { code: e, message: t };
|
|
84
84
|
}
|
|
85
|
-
function
|
|
85
|
+
function c(e) {
|
|
86
86
|
return typeof e == "string" && e.trim().length > 0;
|
|
87
87
|
}
|
|
88
|
-
function
|
|
88
|
+
function Pt(e) {
|
|
89
89
|
const t = /* @__PURE__ */ new Set();
|
|
90
|
-
return
|
|
91
|
-
}
|
|
92
|
-
function
|
|
93
|
-
let i = "",
|
|
94
|
-
for (;
|
|
95
|
-
const
|
|
96
|
-
if (
|
|
97
|
-
|
|
90
|
+
return qt(e, (i) => (t.add(i), `{${i}}`)), Array.from(t);
|
|
91
|
+
}
|
|
92
|
+
function qt(e, t) {
|
|
93
|
+
let i = "", s = 0, l = 0;
|
|
94
|
+
for (; l < e.length; ) {
|
|
95
|
+
const n = e[l];
|
|
96
|
+
if (n === "'" || n === '"') {
|
|
97
|
+
l = Lt(e, l);
|
|
98
98
|
continue;
|
|
99
99
|
}
|
|
100
|
-
if (
|
|
101
|
-
const
|
|
102
|
-
if (
|
|
103
|
-
|
|
100
|
+
if (n === "{") {
|
|
101
|
+
const o = e.indexOf("}", l + 1);
|
|
102
|
+
if (o === -1) {
|
|
103
|
+
l += 1;
|
|
104
104
|
continue;
|
|
105
105
|
}
|
|
106
|
-
const d = e.slice(
|
|
107
|
-
/^[A-Za-z_][A-Za-z0-9_]*$/.test(d) && (i += e.slice(
|
|
106
|
+
const d = e.slice(l + 1, o);
|
|
107
|
+
/^[A-Za-z_][A-Za-z0-9_]*$/.test(d) && (i += e.slice(s, l) + t(d), s = o + 1), l = o + 1;
|
|
108
108
|
continue;
|
|
109
109
|
}
|
|
110
|
-
|
|
110
|
+
l += 1;
|
|
111
111
|
}
|
|
112
|
-
return i + e.slice(
|
|
112
|
+
return i + e.slice(s);
|
|
113
113
|
}
|
|
114
|
-
function
|
|
114
|
+
function Lt(e, t) {
|
|
115
115
|
const i = e[t];
|
|
116
|
-
let
|
|
117
|
-
for (;
|
|
118
|
-
if (e[
|
|
119
|
-
if (e[
|
|
120
|
-
|
|
116
|
+
let s = t + 1;
|
|
117
|
+
for (; s < e.length; ) {
|
|
118
|
+
if (e[s] === i) {
|
|
119
|
+
if (e[s + 1] === i) {
|
|
120
|
+
s += 2;
|
|
121
121
|
continue;
|
|
122
122
|
}
|
|
123
|
-
return
|
|
123
|
+
return s + 1;
|
|
124
124
|
}
|
|
125
|
-
|
|
125
|
+
s += 1;
|
|
126
126
|
}
|
|
127
127
|
return e.length;
|
|
128
128
|
}
|
|
129
129
|
function f(e) {
|
|
130
130
|
return !!(e && typeof e == "object" && !Array.isArray(e));
|
|
131
131
|
}
|
|
132
|
-
const
|
|
132
|
+
const Bt = /* @__PURE__ */ new Set([
|
|
133
133
|
"SUM",
|
|
134
134
|
"COUNT",
|
|
135
135
|
"AVG",
|
|
@@ -138,7 +138,7 @@ const Jt = /* @__PURE__ */ new Set([
|
|
|
138
138
|
"MEDIAN",
|
|
139
139
|
"DISTINCT"
|
|
140
140
|
]);
|
|
141
|
-
function
|
|
141
|
+
function se(e, t, i) {
|
|
142
142
|
if (!e || typeof e != "object") {
|
|
143
143
|
i.push(
|
|
144
144
|
r("missing_source", "Analytics intent needs a source.", t)
|
|
@@ -146,13 +146,13 @@ function pe(e, t, i) {
|
|
|
146
146
|
return;
|
|
147
147
|
}
|
|
148
148
|
if (e.kind === "semantic") {
|
|
149
|
-
|
|
149
|
+
c(e.domainId) || i.push(
|
|
150
150
|
r(
|
|
151
151
|
"missing_semantic_domain",
|
|
152
152
|
"Semantic source needs a domainId.",
|
|
153
153
|
`${t}.domainId`
|
|
154
154
|
)
|
|
155
|
-
),
|
|
155
|
+
), c(e.datasetName) || i.push(
|
|
156
156
|
r(
|
|
157
157
|
"missing_dataset_name",
|
|
158
158
|
"Semantic source needs a datasetName.",
|
|
@@ -162,13 +162,13 @@ function pe(e, t, i) {
|
|
|
162
162
|
return;
|
|
163
163
|
}
|
|
164
164
|
if (e.kind === "physical") {
|
|
165
|
-
|
|
165
|
+
c(e.connectionId) || i.push(
|
|
166
166
|
r(
|
|
167
167
|
"missing_connection_id",
|
|
168
168
|
"Physical source needs a connectionId.",
|
|
169
169
|
`${t}.connectionId`
|
|
170
170
|
)
|
|
171
|
-
),
|
|
171
|
+
), c(e.tableName) || i.push(
|
|
172
172
|
r(
|
|
173
173
|
"missing_table_name",
|
|
174
174
|
"Physical source needs a tableName.",
|
|
@@ -178,7 +178,7 @@ function pe(e, t, i) {
|
|
|
178
178
|
return;
|
|
179
179
|
}
|
|
180
180
|
if (e.kind === "sql") {
|
|
181
|
-
|
|
181
|
+
c(e.connectionId) || i.push(
|
|
182
182
|
r(
|
|
183
183
|
"missing_connection_id",
|
|
184
184
|
"SQL source needs a connectionId.",
|
|
@@ -191,23 +191,23 @@ function pe(e, t, i) {
|
|
|
191
191
|
r("invalid_source_kind", "Source kind is not supported.", t)
|
|
192
192
|
);
|
|
193
193
|
}
|
|
194
|
-
function
|
|
194
|
+
function _(e, t, i, s = {}) {
|
|
195
195
|
if (!e || !f(e)) {
|
|
196
|
-
|
|
196
|
+
s.required && i.push(
|
|
197
197
|
r("missing_field_ref", "Field reference needs a name.", t)
|
|
198
198
|
);
|
|
199
199
|
return;
|
|
200
200
|
}
|
|
201
|
-
|
|
201
|
+
c(e.name) || i.push(
|
|
202
202
|
r(
|
|
203
203
|
"missing_field_ref",
|
|
204
204
|
"Field reference needs a name.",
|
|
205
205
|
`${t}.name`
|
|
206
206
|
)
|
|
207
|
-
), e.source !== void 0 &&
|
|
207
|
+
), e.source !== void 0 && se(e.source, `${t}.source`, i), re(e.aggregate, `${t}.aggregate`, i);
|
|
208
208
|
}
|
|
209
|
-
function
|
|
210
|
-
e !== void 0 && (typeof e != "string" || !
|
|
209
|
+
function re(e, t, i) {
|
|
210
|
+
e !== void 0 && (typeof e != "string" || !Bt.has(e)) && i.push(
|
|
211
211
|
r(
|
|
212
212
|
"invalid_aggregate",
|
|
213
213
|
"Field aggregate must be SUM, COUNT, AVG, MIN, MAX, MEDIAN, or DISTINCT.",
|
|
@@ -215,38 +215,21 @@ function me(e, t, i) {
|
|
|
215
215
|
)
|
|
216
216
|
);
|
|
217
217
|
}
|
|
218
|
-
const
|
|
218
|
+
const Ht = /* @__PURE__ */ new Set([
|
|
219
219
|
"measure",
|
|
220
220
|
"dimension",
|
|
221
221
|
"date",
|
|
222
222
|
"id",
|
|
223
223
|
"unknown"
|
|
224
|
-
]),
|
|
224
|
+
]), Vt = /* @__PURE__ */ new Set(["row", "aggregate"]), Oe = /* @__PURE__ */ new Set([
|
|
225
225
|
"string",
|
|
226
226
|
"number",
|
|
227
227
|
"boolean",
|
|
228
228
|
"date",
|
|
229
229
|
"datetime",
|
|
230
230
|
"unknown"
|
|
231
|
-
])
|
|
232
|
-
|
|
233
|
-
"currency",
|
|
234
|
-
"percent",
|
|
235
|
-
"percentage",
|
|
236
|
-
"scientific",
|
|
237
|
-
"date",
|
|
238
|
-
"datetime",
|
|
239
|
-
"duration",
|
|
240
|
-
"string",
|
|
241
|
-
"temporal_bucket"
|
|
242
|
-
]), ni = /* @__PURE__ */ new Set([
|
|
243
|
-
"millisecond",
|
|
244
|
-
"second",
|
|
245
|
-
"minute",
|
|
246
|
-
"hour",
|
|
247
|
-
"day"
|
|
248
|
-
]), ai = /* @__PURE__ */ new Set(["compact", "digital", "long"]);
|
|
249
|
-
function Qe(e, t, i) {
|
|
231
|
+
]);
|
|
232
|
+
function Pe(e, t, i) {
|
|
250
233
|
if (e === void 0)
|
|
251
234
|
return;
|
|
252
235
|
if (!f(e)) {
|
|
@@ -259,93 +242,32 @@ function Qe(e, t, i) {
|
|
|
259
242
|
);
|
|
260
243
|
return;
|
|
261
244
|
}
|
|
262
|
-
const
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
`${t}.type`
|
|
268
|
-
)
|
|
269
|
-
), a.type === "temporal_bucket" && !z.safeParse(e).success && i.push(
|
|
270
|
-
r(
|
|
271
|
-
"invalid_temporal_bucket_format",
|
|
272
|
-
"Temporal bucket format must contain a valid auto, preset, or pattern presentation.",
|
|
273
|
-
t
|
|
274
|
-
)
|
|
275
|
-
), (a.type === "number" || a.type === "currency" || a.type === "percent" || a.type === "percentage" || a.type === "scientific") && Object.prototype.hasOwnProperty.call(e, "locale") && i.push(
|
|
276
|
-
r(
|
|
277
|
-
"invalid_value_format",
|
|
278
|
-
"Numeric value formats cannot define viewer locale.",
|
|
279
|
-
`${t}.locale`
|
|
280
|
-
)
|
|
281
|
-
), q(
|
|
282
|
-
e.minimumFractionDigits,
|
|
283
|
-
`${t}.minimumFractionDigits`,
|
|
284
|
-
i
|
|
285
|
-
), q(
|
|
286
|
-
e.maximumFractionDigits,
|
|
287
|
-
`${t}.maximumFractionDigits`,
|
|
288
|
-
i
|
|
289
|
-
), q(e.scale, `${t}.scale`, i), q(e.maxUnits, `${t}.maxUnits`, i), e.useGrouping !== void 0 && typeof e.useGrouping != "boolean" && i.push(
|
|
290
|
-
r(
|
|
291
|
-
"invalid_value_format_use_grouping",
|
|
292
|
-
"Value format useGrouping must be boolean.",
|
|
293
|
-
`${t}.useGrouping`
|
|
294
|
-
)
|
|
295
|
-
), e.negativeStyle !== void 0 && e.negativeStyle !== "minus" && e.negativeStyle !== "parentheses" && i.push(
|
|
296
|
-
r(
|
|
297
|
-
"invalid_value_format_negative_style",
|
|
298
|
-
"Value format negativeStyle must be minus or parentheses.",
|
|
299
|
-
`${t}.negativeStyle`
|
|
300
|
-
)
|
|
301
|
-
), e.percentValueMode !== void 0 && e.percentValueMode !== "fraction" && e.percentValueMode !== "whole" && i.push(
|
|
302
|
-
r(
|
|
303
|
-
"invalid_value_format_percent_mode",
|
|
304
|
-
"Value format percentValueMode must be fraction or whole.",
|
|
305
|
-
`${t}.percentValueMode`
|
|
306
|
-
)
|
|
307
|
-
);
|
|
308
|
-
for (const o of ["inputUnit", "largestUnit", "smallestUnit"]) {
|
|
309
|
-
const s = e[o];
|
|
310
|
-
s !== void 0 && (typeof s != "string" || !ni.has(s)) && i.push(
|
|
245
|
+
const s = (e.type === "temporal_bucket" ? O : It).safeParse(e);
|
|
246
|
+
if (s.success) return;
|
|
247
|
+
const l = e.type === "temporal_bucket" ? "invalid_temporal_bucket_format" : "invalid_value_format";
|
|
248
|
+
for (const n of s.error.issues)
|
|
249
|
+
i.push(
|
|
311
250
|
r(
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
251
|
+
l,
|
|
252
|
+
n.message,
|
|
253
|
+
[t, ...n.path.map(String)].filter(Boolean).join(".")
|
|
315
254
|
)
|
|
316
255
|
);
|
|
317
|
-
}
|
|
318
|
-
e.outputStyle !== void 0 && (typeof e.outputStyle != "string" || !ai.has(e.outputStyle)) && i.push(
|
|
319
|
-
r(
|
|
320
|
-
"invalid_value_format_duration_style",
|
|
321
|
-
"Duration format outputStyle must be compact, digital, or long.",
|
|
322
|
-
`${t}.outputStyle`
|
|
323
|
-
)
|
|
324
|
-
);
|
|
325
256
|
}
|
|
326
|
-
|
|
327
|
-
e !== void 0 && (typeof e != "number" || !Number.isFinite(e)) && i.push(
|
|
328
|
-
r(
|
|
329
|
-
"invalid_value_format_number",
|
|
330
|
-
"Value format numeric options must be finite numbers.",
|
|
331
|
-
t
|
|
332
|
-
)
|
|
333
|
-
);
|
|
334
|
-
}
|
|
335
|
-
const si = /* @__PURE__ */ new Set([
|
|
257
|
+
const Ut = /* @__PURE__ */ new Set([
|
|
336
258
|
"additive",
|
|
337
259
|
"non_additive",
|
|
338
260
|
"ratio_of_sums",
|
|
339
261
|
"weighted",
|
|
340
262
|
"pre_aggregated",
|
|
341
263
|
"snapshot"
|
|
342
|
-
]),
|
|
264
|
+
]), zt = /* @__PURE__ */ new Set([
|
|
343
265
|
"default",
|
|
344
266
|
"symmetric_aggregate",
|
|
345
267
|
"aggregate_then_join",
|
|
346
268
|
"weighted"
|
|
347
269
|
]);
|
|
348
|
-
function
|
|
270
|
+
function Gt(e, t, i) {
|
|
349
271
|
if (!e || !f(e)) {
|
|
350
272
|
i.push(
|
|
351
273
|
r(
|
|
@@ -357,7 +279,7 @@ function ri(e, t, i) {
|
|
|
357
279
|
return;
|
|
358
280
|
}
|
|
359
281
|
if (e.kind === "field") {
|
|
360
|
-
|
|
282
|
+
_(e.field, `${t}.field`, i, { required: !0 }), re(e.aggregate, `${t}.aggregate`, i);
|
|
361
283
|
return;
|
|
362
284
|
}
|
|
363
285
|
i.push(
|
|
@@ -368,7 +290,7 @@ function ri(e, t, i) {
|
|
|
368
290
|
)
|
|
369
291
|
);
|
|
370
292
|
}
|
|
371
|
-
function
|
|
293
|
+
function oe(e) {
|
|
372
294
|
const t = [];
|
|
373
295
|
if (!f(e))
|
|
374
296
|
return t.push(
|
|
@@ -383,31 +305,31 @@ function fe(e) {
|
|
|
383
305
|
"Derived field kind must be derived_field.",
|
|
384
306
|
"kind"
|
|
385
307
|
)
|
|
386
|
-
),
|
|
308
|
+
), c(e.name) || t.push(
|
|
387
309
|
r(
|
|
388
310
|
"invalid_derived_field_name",
|
|
389
311
|
"Derived field needs a name.",
|
|
390
312
|
"name"
|
|
391
313
|
)
|
|
392
|
-
),
|
|
314
|
+
), c(e.label) || t.push(
|
|
393
315
|
r(
|
|
394
316
|
"invalid_derived_field_label",
|
|
395
317
|
"Derived field needs a label.",
|
|
396
318
|
"label"
|
|
397
319
|
)
|
|
398
|
-
),
|
|
320
|
+
), Ht.has(e.resultRole) || t.push(
|
|
399
321
|
r(
|
|
400
322
|
"invalid_derived_field_role",
|
|
401
323
|
"Derived field resultRole must be measure, dimension, date, id, or unknown.",
|
|
402
324
|
"resultRole"
|
|
403
325
|
)
|
|
404
|
-
),
|
|
326
|
+
), Oe.has(e.dataType) || t.push(
|
|
405
327
|
r(
|
|
406
328
|
"invalid_derived_field_data_type",
|
|
407
329
|
"Derived field dataType must be string, number, boolean, date, datetime, or unknown.",
|
|
408
330
|
"dataType"
|
|
409
331
|
)
|
|
410
|
-
),
|
|
332
|
+
), Vt.has(e.computeStage) || t.push(
|
|
411
333
|
r(
|
|
412
334
|
"invalid_derived_field_compute_stage",
|
|
413
335
|
"Derived field computeStage must be row or aggregate.",
|
|
@@ -431,11 +353,11 @@ function fe(e) {
|
|
|
431
353
|
"Row-stage measure derived fields must declare defaultAggregate so row results have explicit rollup semantics.",
|
|
432
354
|
"defaultAggregate"
|
|
433
355
|
)
|
|
434
|
-
),
|
|
356
|
+
), re(
|
|
435
357
|
e.defaultAggregate,
|
|
436
358
|
"defaultAggregate",
|
|
437
359
|
t
|
|
438
|
-
), e.aggregationBehavior !== void 0 && !
|
|
360
|
+
), e.aggregationBehavior !== void 0 && !Ut.has(
|
|
439
361
|
e.aggregationBehavior
|
|
440
362
|
) && t.push(
|
|
441
363
|
r(
|
|
@@ -443,7 +365,7 @@ function fe(e) {
|
|
|
443
365
|
"Derived field aggregationBehavior is not supported.",
|
|
444
366
|
"aggregationBehavior"
|
|
445
367
|
)
|
|
446
|
-
), e.aggregationStrategy !== void 0 && !
|
|
368
|
+
), e.aggregationStrategy !== void 0 && !zt.has(
|
|
447
369
|
e.aggregationStrategy
|
|
448
370
|
) && t.push(
|
|
449
371
|
r(
|
|
@@ -451,7 +373,7 @@ function fe(e) {
|
|
|
451
373
|
"Derived field aggregationStrategy is not supported.",
|
|
452
374
|
"aggregationStrategy"
|
|
453
375
|
)
|
|
454
|
-
),
|
|
376
|
+
), c(e.expression) || t.push(
|
|
455
377
|
r(
|
|
456
378
|
"invalid_derived_field_expression",
|
|
457
379
|
"Derived field needs a named-token expression.",
|
|
@@ -469,8 +391,8 @@ function fe(e) {
|
|
|
469
391
|
"Derived field needs at least one typed input.",
|
|
470
392
|
"inputs"
|
|
471
393
|
)
|
|
472
|
-
) : Object.entries(e.inputs).forEach(([
|
|
473
|
-
if (!
|
|
394
|
+
) : Object.entries(e.inputs).forEach(([s, l]) => {
|
|
395
|
+
if (!c(s)) {
|
|
474
396
|
t.push(
|
|
475
397
|
r(
|
|
476
398
|
"invalid_derived_field_input_name",
|
|
@@ -480,31 +402,31 @@ function fe(e) {
|
|
|
480
402
|
);
|
|
481
403
|
return;
|
|
482
404
|
}
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
`inputs.${
|
|
405
|
+
Gt(
|
|
406
|
+
l,
|
|
407
|
+
`inputs.${s}`,
|
|
486
408
|
t
|
|
487
409
|
);
|
|
488
|
-
}),
|
|
489
|
-
const
|
|
410
|
+
}), c(e.expression) && f(e.inputs)) {
|
|
411
|
+
const s = Pt(
|
|
490
412
|
e.expression
|
|
491
|
-
),
|
|
492
|
-
(
|
|
413
|
+
), l = new Set(s), n = Object.keys(e.inputs).filter(
|
|
414
|
+
(o) => c(o)
|
|
493
415
|
);
|
|
494
|
-
|
|
495
|
-
Object.prototype.hasOwnProperty.call(e.inputs,
|
|
416
|
+
s.forEach((o) => {
|
|
417
|
+
Object.prototype.hasOwnProperty.call(e.inputs, o) || t.push(
|
|
496
418
|
r(
|
|
497
419
|
"invalid_derived_field_expression_token",
|
|
498
|
-
`Derived field expression token "{${
|
|
420
|
+
`Derived field expression token "{${o}}" needs a matching inputs.${o} entry.`,
|
|
499
421
|
"expression"
|
|
500
422
|
)
|
|
501
423
|
);
|
|
502
|
-
}),
|
|
503
|
-
|
|
424
|
+
}), n.forEach((o) => {
|
|
425
|
+
l.has(o) || t.push(
|
|
504
426
|
r(
|
|
505
427
|
"unused_derived_field_input",
|
|
506
|
-
`Derived field input "${
|
|
507
|
-
`inputs.${
|
|
428
|
+
`Derived field input "${o}" is not referenced by expression.`,
|
|
429
|
+
`inputs.${o}`
|
|
508
430
|
)
|
|
509
431
|
);
|
|
510
432
|
});
|
|
@@ -516,7 +438,7 @@ function fe(e) {
|
|
|
516
438
|
"Derived field computation metadata cannot own temporal bucket presentation; declare grain and format on the grouped field.",
|
|
517
439
|
"format"
|
|
518
440
|
)
|
|
519
|
-
) :
|
|
441
|
+
) : Pe(i, "format", t), e.tags !== void 0 && (!Array.isArray(e.tags) || e.tags.some((s) => !c(s))) && t.push(
|
|
520
442
|
r(
|
|
521
443
|
"invalid_derived_field_tags",
|
|
522
444
|
"Derived field tags must be non-empty strings.",
|
|
@@ -524,55 +446,41 @@ function fe(e) {
|
|
|
524
446
|
)
|
|
525
447
|
), { ok: t.length === 0, errors: t, warnings: [] };
|
|
526
448
|
}
|
|
527
|
-
const
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
z
|
|
541
|
-
]), ge = n.union([
|
|
542
|
-
jt.extend({ domainId: R, datasetName: R }).strict(),
|
|
543
|
-
$t.extend({ connectionId: R, tableName: R }).strict()
|
|
544
|
-
]), Xe = Ot.extend({
|
|
545
|
-
name: R,
|
|
546
|
-
source: ge.optional()
|
|
547
|
-
}).strict(), he = Pt.extend({
|
|
548
|
-
format: Ke.optional(),
|
|
549
|
-
inputs: n.record(
|
|
550
|
-
n.object({
|
|
551
|
-
kind: n.literal("field"),
|
|
552
|
-
field: Xe,
|
|
553
|
-
aggregate: He.optional()
|
|
449
|
+
const D = a.string().min(1).refine((e) => e.trim().length > 0, "Must not be blank."), le = a.union([
|
|
450
|
+
St.extend({ domainId: D, datasetName: D }).strict(),
|
|
451
|
+
kt.extend({ connectionId: D, tableName: D }).strict()
|
|
452
|
+
]), qe = wt.extend({
|
|
453
|
+
name: D,
|
|
454
|
+
source: le.optional()
|
|
455
|
+
}).strict(), de = At.extend({
|
|
456
|
+
format: xt.optional(),
|
|
457
|
+
inputs: a.record(
|
|
458
|
+
a.object({
|
|
459
|
+
kind: a.literal("field"),
|
|
460
|
+
field: qe,
|
|
461
|
+
aggregate: je.optional()
|
|
554
462
|
}).strict()
|
|
555
463
|
)
|
|
556
464
|
}).strict().superRefine((e, t) => {
|
|
557
465
|
var i;
|
|
558
|
-
for (const
|
|
466
|
+
for (const s of oe(e).errors)
|
|
559
467
|
t.addIssue({
|
|
560
468
|
code: "custom",
|
|
561
|
-
path: ((i =
|
|
562
|
-
message:
|
|
469
|
+
path: ((i = s.path) == null ? void 0 : i.split(".")) ?? [],
|
|
470
|
+
message: s.message
|
|
563
471
|
});
|
|
564
|
-
}),
|
|
565
|
-
derivedField:
|
|
472
|
+
}), Qt = qe.extend({
|
|
473
|
+
derivedField: de.optional()
|
|
566
474
|
}).strict();
|
|
567
|
-
function
|
|
475
|
+
function ue(e) {
|
|
568
476
|
return typeof e == "string" ? e.trim().toLowerCase() : "";
|
|
569
477
|
}
|
|
570
|
-
function
|
|
478
|
+
function Kt(e) {
|
|
571
479
|
return String(
|
|
572
480
|
e.column_name || e.name || e.qualifiedFieldName || ""
|
|
573
481
|
);
|
|
574
482
|
}
|
|
575
|
-
function
|
|
483
|
+
function Xt(e) {
|
|
576
484
|
return Array.from(
|
|
577
485
|
new Set(
|
|
578
486
|
[e.column_name, e.name, e.qualifiedFieldName, e.alias].filter(
|
|
@@ -581,11 +489,11 @@ function fi(e) {
|
|
|
581
489
|
)
|
|
582
490
|
);
|
|
583
491
|
}
|
|
584
|
-
function
|
|
585
|
-
const t =
|
|
586
|
-
return t ?
|
|
492
|
+
function ce(e) {
|
|
493
|
+
const t = Be(e);
|
|
494
|
+
return t ? ei(t) ? "number" : t.includes("timestamp") || t.includes("datetime") || t.startsWith("time") ? "datetime" : t.includes("date") ? "date" : t.includes("bool") ? "boolean" : "string" : "unknown";
|
|
587
495
|
}
|
|
588
|
-
const
|
|
496
|
+
const U = /* @__PURE__ */ new Map([
|
|
589
497
|
// Integer families (PostgreSQL, ClickHouse, DuckDB, MySQL).
|
|
590
498
|
["int", "integer"],
|
|
591
499
|
["uint", "integer"],
|
|
@@ -614,97 +522,97 @@ const W = /* @__PURE__ */ new Map([
|
|
|
614
522
|
["money", null],
|
|
615
523
|
["currency", null],
|
|
616
524
|
["percent", null]
|
|
617
|
-
]),
|
|
618
|
-
function
|
|
525
|
+
]), Zt = ["int", "uint", "decimal", "float"];
|
|
526
|
+
function Jt(e) {
|
|
619
527
|
return e.length > 0 && Array.from(e).every((t) => t >= "0" && t <= "9");
|
|
620
528
|
}
|
|
621
|
-
function
|
|
529
|
+
function Wt(e) {
|
|
622
530
|
var i;
|
|
623
531
|
const t = (i = /^number\s*\(\s*\d+\s*,\s*(\d+)\s*\)$/.exec(e)) == null ? void 0 : i[1];
|
|
624
532
|
return t === void 0 ? null : Number(t) === 0 ? "integer" : "decimal";
|
|
625
533
|
}
|
|
626
|
-
function
|
|
534
|
+
function Le(e) {
|
|
627
535
|
const t = e.split(/[\s(]/, 1)[0] || "";
|
|
628
536
|
if (t === "number")
|
|
629
|
-
return { numeric: !0, kind:
|
|
630
|
-
if (
|
|
631
|
-
return { numeric: !0, kind:
|
|
632
|
-
const i =
|
|
633
|
-
(
|
|
537
|
+
return { numeric: !0, kind: Wt(e) };
|
|
538
|
+
if (U.has(t))
|
|
539
|
+
return { numeric: !0, kind: U.get(t) ?? null };
|
|
540
|
+
const i = Zt.find(
|
|
541
|
+
(s) => t.startsWith(s) && Jt(t.slice(s.length))
|
|
634
542
|
);
|
|
635
|
-
return i ? { numeric: !0, kind:
|
|
543
|
+
return i ? { numeric: !0, kind: U.get(i) ?? null } : { numeric: !1, kind: null };
|
|
636
544
|
}
|
|
637
|
-
function
|
|
638
|
-
return
|
|
545
|
+
function ei(e) {
|
|
546
|
+
return Le(e).numeric;
|
|
639
547
|
}
|
|
640
|
-
function
|
|
641
|
-
return
|
|
548
|
+
function ti(e) {
|
|
549
|
+
return Le(Be(e)).kind;
|
|
642
550
|
}
|
|
643
|
-
function
|
|
644
|
-
let t =
|
|
551
|
+
function Be(e) {
|
|
552
|
+
let t = ue(e), i = "";
|
|
645
553
|
for (; t && t !== i; )
|
|
646
|
-
i = t, t =
|
|
554
|
+
i = t, t = Ie(t, "nullable"), t = Ie(t, "lowcardinality");
|
|
647
555
|
return t;
|
|
648
556
|
}
|
|
649
|
-
function
|
|
557
|
+
function Ie(e, t) {
|
|
650
558
|
const i = `${t}(`;
|
|
651
559
|
return !e.startsWith(i) || !e.endsWith(")") ? e : e.slice(i.length, -1).trim();
|
|
652
560
|
}
|
|
653
|
-
function
|
|
654
|
-
const t =
|
|
561
|
+
function ii(e) {
|
|
562
|
+
const t = ce(e);
|
|
655
563
|
return t === "date" || t === "datetime";
|
|
656
564
|
}
|
|
657
|
-
function
|
|
658
|
-
return
|
|
565
|
+
function He(e) {
|
|
566
|
+
return ii(e.dataType || e.data_type);
|
|
659
567
|
}
|
|
660
|
-
function
|
|
661
|
-
const t =
|
|
568
|
+
function Ve(e) {
|
|
569
|
+
const t = Ue(e);
|
|
662
570
|
return t === "id" || t === "row_id";
|
|
663
571
|
}
|
|
664
|
-
function
|
|
665
|
-
const t =
|
|
666
|
-
return
|
|
572
|
+
function Se(e) {
|
|
573
|
+
const t = Ue(e);
|
|
574
|
+
return Ve(e) || t.endsWith("_id") || t.endsWith("_key") || t.endsWith("_number");
|
|
667
575
|
}
|
|
668
|
-
function
|
|
669
|
-
return
|
|
670
|
-
|
|
576
|
+
function Ue(e) {
|
|
577
|
+
return ue(
|
|
578
|
+
Kt(e) || e.name || e.alias
|
|
671
579
|
).replace(/[^a-z0-9]+/g, "_").replace(/^_+|_+$/g, "");
|
|
672
580
|
}
|
|
673
|
-
function
|
|
674
|
-
const i =
|
|
675
|
-
return i === "metric" || i === "measure" ? !t.excludeIdentifiers || !
|
|
581
|
+
function ze(e, t = {}) {
|
|
582
|
+
const i = ue(e.role);
|
|
583
|
+
return i === "metric" || i === "measure" ? !t.excludeIdentifiers || !Se(e) : i === "groupby" || i === "dimension" || i === "date" || i === "id" ? !1 : ce(
|
|
676
584
|
e.dataType || e.data_type
|
|
677
|
-
) === "number" && (!t.excludeIdentifiers || !
|
|
585
|
+
) === "number" && (!t.excludeIdentifiers || !Se(e));
|
|
678
586
|
}
|
|
679
|
-
function
|
|
680
|
-
return !
|
|
587
|
+
function Ra(e) {
|
|
588
|
+
return !ze(e) && !He(e);
|
|
681
589
|
}
|
|
682
|
-
function
|
|
683
|
-
const t = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Set(),
|
|
684
|
-
for (const
|
|
685
|
-
if (
|
|
590
|
+
function $a(e) {
|
|
591
|
+
const t = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Set(), s = /* @__PURE__ */ new Set();
|
|
592
|
+
for (const l of e) {
|
|
593
|
+
if (Ve(l))
|
|
686
594
|
continue;
|
|
687
|
-
const
|
|
688
|
-
if (
|
|
689
|
-
if (
|
|
690
|
-
|
|
595
|
+
const n = Xt(l);
|
|
596
|
+
if (n.length !== 0) {
|
|
597
|
+
if (He(l)) {
|
|
598
|
+
n.forEach((o) => i.add(o));
|
|
691
599
|
continue;
|
|
692
600
|
}
|
|
693
|
-
if (
|
|
694
|
-
|
|
601
|
+
if (ze(l, { excludeIdentifiers: !0 })) {
|
|
602
|
+
n.forEach((o) => t.add(o));
|
|
695
603
|
continue;
|
|
696
604
|
}
|
|
697
|
-
|
|
605
|
+
n.forEach((o) => s.add(o));
|
|
698
606
|
}
|
|
699
607
|
}
|
|
700
608
|
return {
|
|
701
609
|
validMeasureCandidates: Array.from(t).sort(),
|
|
702
610
|
validDateCandidates: Array.from(i).sort(),
|
|
703
|
-
validDimensionCandidates: Array.from(
|
|
611
|
+
validDimensionCandidates: Array.from(s).sort()
|
|
704
612
|
};
|
|
705
613
|
}
|
|
706
|
-
const
|
|
707
|
-
function
|
|
614
|
+
const E = 16 * 1024;
|
|
615
|
+
function P(e) {
|
|
708
616
|
const t = /^([+-]?)(?:(\d+)(?:\.(\d*))?|\.(\d+))(?:[eE]([+-]?\d+))?$/.exec(e);
|
|
709
617
|
return t ? {
|
|
710
618
|
sign: t[1],
|
|
@@ -713,91 +621,91 @@ function V(e) {
|
|
|
713
621
|
exponent: Number(t[5] ?? "0")
|
|
714
622
|
} : null;
|
|
715
623
|
}
|
|
716
|
-
function
|
|
717
|
-
const { sign: t, whole: i, fraction:
|
|
718
|
-
return !Number.isSafeInteger(
|
|
624
|
+
function ke(e) {
|
|
625
|
+
const { sign: t, whole: i, fraction: s = "", exponent: l } = e, n = (i + s).replace(/^0+/, ""), o = n.replace(/0+$/, ""), d = l - s.length + n.length - o.length;
|
|
626
|
+
return !Number.isSafeInteger(l) || !Number.isSafeInteger(d) ? null : o ? `${t === "-" ? "-" : ""}${o}e${d}` : "0";
|
|
719
627
|
}
|
|
720
|
-
function
|
|
721
|
-
const t =
|
|
628
|
+
function Ca(e) {
|
|
629
|
+
const t = P(e);
|
|
722
630
|
if (!t) return null;
|
|
723
|
-
const i = t.sign === "+" ? e.slice(1) : e,
|
|
724
|
-
if (!Number.isFinite(
|
|
725
|
-
const
|
|
726
|
-
return
|
|
631
|
+
const i = t.sign === "+" ? e.slice(1) : e, s = Number(e);
|
|
632
|
+
if (!Number.isFinite(s)) return i;
|
|
633
|
+
const l = ke(t), n = P(String(s));
|
|
634
|
+
return l !== null && n !== null && l === ke(n) ? s : i;
|
|
727
635
|
}
|
|
728
|
-
function
|
|
729
|
-
if (e.length >
|
|
636
|
+
function ja(e) {
|
|
637
|
+
if (e.length > E)
|
|
730
638
|
throw new RangeError("Exact numeric text exceeds 16 KiB.");
|
|
731
|
-
const t =
|
|
639
|
+
const t = P(e);
|
|
732
640
|
if (!t) throw new TypeError("Expected finite decimal text.");
|
|
733
|
-
const { sign: i, whole:
|
|
734
|
-
return
|
|
641
|
+
const { sign: i, whole: s, fraction: l, exponent: n } = t, o = `${i}${s || "0"}${l ? `.${l}` : ""}`;
|
|
642
|
+
return R(`${o}e${n}`);
|
|
735
643
|
}
|
|
736
|
-
function
|
|
737
|
-
if (e.length >
|
|
644
|
+
function R(e) {
|
|
645
|
+
if (e.length > E)
|
|
738
646
|
throw new RangeError("Exact numeric text exceeds 16 KiB.");
|
|
739
|
-
const t =
|
|
647
|
+
const t = P(e);
|
|
740
648
|
if (!t || t.whole === "" || t.fraction === "")
|
|
741
649
|
throw new TypeError("Expected finite decimal text.");
|
|
742
|
-
const { sign: i, whole:
|
|
743
|
-
if (!Number.isSafeInteger(
|
|
650
|
+
const { sign: i, whole: s, fraction: l = "", exponent: n } = t;
|
|
651
|
+
if (!Number.isSafeInteger(n) || Math.abs(n) > E)
|
|
744
652
|
throw new RangeError("Exact numeric exponent exceeds the text budget.");
|
|
745
|
-
const
|
|
746
|
-
if (Math.max(
|
|
653
|
+
const o = s + l, d = s.length + n;
|
|
654
|
+
if (Math.max(o.length, d) + Math.max(0, -d) + 3 > E)
|
|
747
655
|
throw new RangeError("Normalized exact numeric text exceeds 16 KiB.");
|
|
748
|
-
let
|
|
749
|
-
d <= 0 ?
|
|
750
|
-
const [u,
|
|
751
|
-
return i === "-" &&
|
|
752
|
-
}
|
|
753
|
-
function
|
|
754
|
-
const i = e.startsWith("-"),
|
|
755
|
-
if (i !==
|
|
756
|
-
const [
|
|
757
|
-
let
|
|
758
|
-
if (!
|
|
759
|
-
const
|
|
760
|
-
|
|
656
|
+
let m;
|
|
657
|
+
d <= 0 ? m = `0.${"0".repeat(-d)}${o}` : d >= o.length ? m = o + "0".repeat(d - o.length) : m = `${o.slice(0, d)}.${o.slice(d)}`;
|
|
658
|
+
const [u, g = ""] = m.split("."), y = u.replace(/^0+(?=\d)/, ""), I = g.replace(/0+$/, ""), S = y + (I ? `.${I}` : "");
|
|
659
|
+
return i === "-" && S !== "0" ? `-${S}` : S;
|
|
660
|
+
}
|
|
661
|
+
function Ya(e, t) {
|
|
662
|
+
const i = e.startsWith("-"), s = t.startsWith("-");
|
|
663
|
+
if (i !== s) return i ? -1 : 1;
|
|
664
|
+
const [l, n = ""] = (i ? e.slice(1) : e).split("."), [o, d = ""] = (s ? t.slice(1) : t).split(".");
|
|
665
|
+
let p = Math.sign(l.length - o.length);
|
|
666
|
+
if (!p && l !== o && (p = l < o ? -1 : 1), !p) {
|
|
667
|
+
const m = Math.max(n.length, d.length), u = n.padEnd(m, "0"), g = d.padEnd(m, "0");
|
|
668
|
+
p = u === g ? 0 : u < g ? -1 : 1;
|
|
761
669
|
}
|
|
762
|
-
return
|
|
670
|
+
return p === 0 ? 0 : i ? -p : p;
|
|
763
671
|
}
|
|
764
|
-
function
|
|
672
|
+
function Oa(e, t) {
|
|
765
673
|
if (typeof t == "number" && !Number.isFinite(t))
|
|
766
674
|
throw new TypeError("Numeric scale must be finite.");
|
|
767
|
-
const i = [e,
|
|
768
|
-
const [
|
|
769
|
-
return { coefficient: BigInt(
|
|
770
|
-
}),
|
|
771
|
-
return
|
|
675
|
+
const i = [e, R(String(t))].map((n) => {
|
|
676
|
+
const [o, d = ""] = n.split(".");
|
|
677
|
+
return { coefficient: BigInt(o + d), digits: d.length };
|
|
678
|
+
}), s = i[0].coefficient * i[1].coefficient, l = i[0].digits + i[1].digits;
|
|
679
|
+
return R(`${s}e-${l}`);
|
|
772
680
|
}
|
|
773
|
-
function
|
|
681
|
+
function ai(e) {
|
|
774
682
|
try {
|
|
775
|
-
return
|
|
683
|
+
return R(e) === e;
|
|
776
684
|
} catch {
|
|
777
685
|
return !1;
|
|
778
686
|
}
|
|
779
687
|
}
|
|
780
|
-
const
|
|
781
|
-
kind:
|
|
782
|
-
type:
|
|
783
|
-
value:
|
|
688
|
+
const Ge = a.object({
|
|
689
|
+
kind: a.literal("exact_number"),
|
|
690
|
+
type: a.enum(["integer", "decimal"]),
|
|
691
|
+
value: a.string().max(E).refine(ai, "Expected canonical decimal text.")
|
|
784
692
|
}).strict().superRefine((e, t) => {
|
|
785
693
|
e.type === "integer" && e.value.includes(".") && t.addIssue({ code: "custom", path: ["value"], message: "An integer cannot have fractional digits." });
|
|
786
|
-
}),
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
694
|
+
}), ni = a.union([
|
|
695
|
+
a.null(),
|
|
696
|
+
a.string(),
|
|
697
|
+
a.boolean(),
|
|
698
|
+
a.number().finite(),
|
|
699
|
+
Ge
|
|
792
700
|
]);
|
|
793
|
-
function
|
|
794
|
-
return
|
|
701
|
+
function si(e, t) {
|
|
702
|
+
return Ge.parse({ kind: "exact_number", type: t, value: R(e) });
|
|
795
703
|
}
|
|
796
|
-
function
|
|
704
|
+
function Pa(e) {
|
|
797
705
|
return typeof e == "object" && e !== null && "kind" in e && e.kind === "exact_number" && "type" in e && (e.type === "integer" || e.type === "decimal") && "value" in e && typeof e.value == "string";
|
|
798
706
|
}
|
|
799
|
-
function
|
|
800
|
-
const t =
|
|
707
|
+
function qa(e) {
|
|
708
|
+
const t = ti(e.nativeDataType);
|
|
801
709
|
if (!t) throw new TypeError("Numeric result type is not established.");
|
|
802
710
|
if (e.value === null) return null;
|
|
803
711
|
if (t === "float") {
|
|
@@ -807,29 +715,29 @@ function ya(e) {
|
|
|
807
715
|
}
|
|
808
716
|
if (e.exactText === void 0)
|
|
809
717
|
throw new TypeError("Exact numeric sidecar is required; rounded result values cannot substitute.");
|
|
810
|
-
return
|
|
718
|
+
return si(e.exactText, t);
|
|
811
719
|
}
|
|
812
|
-
const
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
]),
|
|
720
|
+
const pe = a.string().uuid(), me = a.enum(["rows", "columns"]), La = a.enum(["member", "subtotal", "grand_total", "others"]), ri = a.discriminatedUnion("kind", [
|
|
721
|
+
a.object({ kind: a.literal("value"), value: ni }).strict(),
|
|
722
|
+
a.object({ kind: a.literal("others"), rankingId: pe }).strict()
|
|
723
|
+
]), A = a.array(a.object({ levelId: pe, member: ri }).strict()).readonly().superRefine((e, t) => {
|
|
816
724
|
new Set(e.map((i) => i.levelId)).size !== e.length && t.addIssue({
|
|
817
725
|
code: "custom",
|
|
818
726
|
path: [],
|
|
819
727
|
message: "Duplicate identity."
|
|
820
728
|
}), e.some(
|
|
821
|
-
(i,
|
|
729
|
+
(i, s) => i.member.kind === "others" && s !== e.length - 1
|
|
822
730
|
) && t.addIssue({
|
|
823
731
|
code: "custom",
|
|
824
732
|
path: [],
|
|
825
733
|
message: "Others is terminal."
|
|
826
734
|
});
|
|
827
|
-
}),
|
|
828
|
-
rowPath:
|
|
829
|
-
columnPath:
|
|
830
|
-
measureId:
|
|
735
|
+
}), Ba = a.object({
|
|
736
|
+
rowPath: A,
|
|
737
|
+
columnPath: A,
|
|
738
|
+
measureId: pe
|
|
831
739
|
}).strict();
|
|
832
|
-
function
|
|
740
|
+
function Qe(e) {
|
|
833
741
|
return JSON.stringify(
|
|
834
742
|
e.map(({ levelId: t, member: i }) => [
|
|
835
743
|
t,
|
|
@@ -837,11 +745,11 @@ function st(e) {
|
|
|
837
745
|
])
|
|
838
746
|
);
|
|
839
747
|
}
|
|
840
|
-
const
|
|
841
|
-
function
|
|
748
|
+
const Z = "SEMAPHOR_CALCULATED_FIELD", oi = "calculated_fields";
|
|
749
|
+
function li(e) {
|
|
842
750
|
return (e == null ? void 0 : e.sourceField) || (e == null ? void 0 : e.name) || "";
|
|
843
751
|
}
|
|
844
|
-
const
|
|
752
|
+
const di = [
|
|
845
753
|
// Day granularity formats
|
|
846
754
|
"MM-DD-YYYY",
|
|
847
755
|
"YYYY-MM-DD",
|
|
@@ -876,17 +784,17 @@ const Mi = [
|
|
|
876
784
|
// Custom format
|
|
877
785
|
"custom"
|
|
878
786
|
];
|
|
879
|
-
function
|
|
787
|
+
function Ha(e) {
|
|
880
788
|
return e.role === "metric" && "expression" in e && !!e.expression;
|
|
881
789
|
}
|
|
882
|
-
function
|
|
790
|
+
function Va(e) {
|
|
883
791
|
return !!e.expression;
|
|
884
792
|
}
|
|
885
|
-
function
|
|
886
|
-
return !!(e && (e.calculationRepresentation || e.expression || e.derivedField || e.calculatedFieldOrigin || e.calculatedFormula ||
|
|
793
|
+
function ui(e) {
|
|
794
|
+
return !!(e && (e.calculationRepresentation || e.expression || e.derivedField || e.calculatedFieldOrigin || e.calculatedFormula || J(e)));
|
|
887
795
|
}
|
|
888
|
-
function
|
|
889
|
-
var
|
|
796
|
+
function Ke(e) {
|
|
797
|
+
var g, y, I;
|
|
890
798
|
if (!e)
|
|
891
799
|
return {
|
|
892
800
|
representation: "physical",
|
|
@@ -895,22 +803,22 @@ function ot(e) {
|
|
|
895
803
|
runtimeExecutable: !1,
|
|
896
804
|
legacyManual: !1
|
|
897
805
|
};
|
|
898
|
-
const t = e.fieldScope === "domain" ? "domain" : "local", i = ((
|
|
899
|
-
const
|
|
900
|
-
return typeof
|
|
901
|
-
}),
|
|
902
|
-
if (e.derivedField ||
|
|
903
|
-
const
|
|
806
|
+
const t = e.fieldScope === "domain" ? "domain" : "local", i = ((g = e.derivedField) == null ? void 0 : g.computeStage) || ((y = e.calculatedFormula) == null ? void 0 : y.computeStage), s = !e.calculatedFormula || Array.isArray(e.calculatedFormula.inputFields) && e.calculatedFormula.inputFields.every((S) => {
|
|
807
|
+
const be = S && li(S);
|
|
808
|
+
return typeof be == "string" && !!be.trim();
|
|
809
|
+
}), l = typeof e.expression == "string" && !!e.expression.trim() && s, n = e.calculationRepresentation;
|
|
810
|
+
if (e.derivedField || n === "typed-derived") {
|
|
811
|
+
const S = e.derivedField !== void 0 && oe(e.derivedField).ok;
|
|
904
812
|
return {
|
|
905
813
|
representation: "typed-derived",
|
|
906
814
|
ownership: t,
|
|
907
|
-
completeness: (!
|
|
815
|
+
completeness: (!n || n === "typed-derived") && S && (!e.expression && !e.calculatedFormula || l) ? "complete" : "incomplete",
|
|
908
816
|
computeStage: i,
|
|
909
|
-
runtimeExecutable:
|
|
817
|
+
runtimeExecutable: l,
|
|
910
818
|
legacyManual: !1
|
|
911
819
|
};
|
|
912
820
|
}
|
|
913
|
-
if (!(!!
|
|
821
|
+
if (!(!!n || ui(e)))
|
|
914
822
|
return {
|
|
915
823
|
representation: "physical",
|
|
916
824
|
ownership: t,
|
|
@@ -918,73 +826,73 @@ function ot(e) {
|
|
|
918
826
|
runtimeExecutable: !1,
|
|
919
827
|
legacyManual: !1
|
|
920
828
|
};
|
|
921
|
-
const d = i || (e.role === "groupby" || ((
|
|
829
|
+
const d = i || (e.role === "groupby" || ((I = e.calculatedFieldOrigin) == null ? void 0 : I.role) === "groupby" ? "row" : void 0), p = t === "domain" || J(e) || e.fieldScope === "card" || e.fieldScope === "sheet" || e.fieldScope === "dashboard" ? "manual" : "inline-expression", m = n === "manual" || n === "inline-expression" ? n : p, u = (!n || n === "manual" || n === "inline-expression") && !(n === "inline-expression" && J(e));
|
|
922
830
|
return {
|
|
923
|
-
representation:
|
|
831
|
+
representation: m,
|
|
924
832
|
ownership: t,
|
|
925
|
-
completeness:
|
|
833
|
+
completeness: l && u ? "complete" : "incomplete",
|
|
926
834
|
computeStage: d,
|
|
927
|
-
runtimeExecutable:
|
|
928
|
-
legacyManual:
|
|
835
|
+
runtimeExecutable: l,
|
|
836
|
+
legacyManual: m === "manual" && t === "local" && !d
|
|
929
837
|
};
|
|
930
838
|
}
|
|
931
|
-
function
|
|
839
|
+
function Ua(e) {
|
|
932
840
|
if (e.calculationRepresentation) return e;
|
|
933
|
-
const { representation: t } =
|
|
841
|
+
const { representation: t } = Ke(e);
|
|
934
842
|
return t === "physical" ? e : { ...e, calculationRepresentation: t };
|
|
935
843
|
}
|
|
936
|
-
function
|
|
937
|
-
return
|
|
844
|
+
function za(e) {
|
|
845
|
+
return Ke(e).computeStage;
|
|
938
846
|
}
|
|
939
|
-
function
|
|
847
|
+
function Ga(e, t) {
|
|
940
848
|
return e === "aggregate" && t === "default";
|
|
941
849
|
}
|
|
942
|
-
function
|
|
943
|
-
var i,
|
|
850
|
+
function Qa(e) {
|
|
851
|
+
var i, s;
|
|
944
852
|
const t = e;
|
|
945
|
-
return !!(t != null && t.expression && ((
|
|
853
|
+
return !!(t != null && t.expression && ((s = (i = t.calculatedFormula) == null ? void 0 : i.inputFields) != null && s.length));
|
|
946
854
|
}
|
|
947
|
-
function
|
|
948
|
-
return !!(e && (e.entityName ===
|
|
855
|
+
function Ka(e) {
|
|
856
|
+
return !!(e && (e.entityName === Z || e.entityId === Z));
|
|
949
857
|
}
|
|
950
|
-
function
|
|
858
|
+
function J(e) {
|
|
951
859
|
return e ? [e.entityName, e.entityId, e.qualifiedEntityName].some(
|
|
952
|
-
(t) => t ===
|
|
860
|
+
(t) => t === Z || t === oi
|
|
953
861
|
) : !1;
|
|
954
862
|
}
|
|
955
|
-
function
|
|
956
|
-
const t =
|
|
863
|
+
function ci(e) {
|
|
864
|
+
const t = Ze(e);
|
|
957
865
|
return t.length > 0 ? t.join(".") : void 0;
|
|
958
866
|
}
|
|
959
|
-
function
|
|
960
|
-
const t =
|
|
867
|
+
function Xa(e) {
|
|
868
|
+
const t = ci(
|
|
961
869
|
e.qualifiedName
|
|
962
870
|
), i = (t == null ? void 0 : t.split(".")) || [];
|
|
963
871
|
if (i.length === 0) return {};
|
|
964
|
-
const
|
|
965
|
-
let
|
|
966
|
-
for (let
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
e.capabilities.prefixLevels[
|
|
970
|
-
i[
|
|
872
|
+
const s = {};
|
|
873
|
+
let l = i.length - 1;
|
|
874
|
+
for (let n = e.capabilities.prefixLevels.length - 1; n >= 0 && l >= 0; n -= 1, l -= 1)
|
|
875
|
+
fi(
|
|
876
|
+
s,
|
|
877
|
+
e.capabilities.prefixLevels[n],
|
|
878
|
+
i[l]
|
|
971
879
|
);
|
|
972
|
-
return
|
|
880
|
+
return s;
|
|
973
881
|
}
|
|
974
|
-
function
|
|
882
|
+
function Za(e) {
|
|
975
883
|
return !e.left.tableName || !e.right.tableName ? !1 : e.capabilities.prefixLevels.every((t) => {
|
|
976
|
-
const i =
|
|
977
|
-
return !i || !
|
|
884
|
+
const i = x(e.left, t), s = x(e.right, t);
|
|
885
|
+
return !i || !s || i === s;
|
|
978
886
|
});
|
|
979
887
|
}
|
|
980
|
-
function
|
|
888
|
+
function Ja(e) {
|
|
981
889
|
return e.capabilities.prefixLevels.every((t) => {
|
|
982
|
-
const i =
|
|
983
|
-
return i ?
|
|
890
|
+
const i = x(e.requested, t);
|
|
891
|
+
return i ? x(e.allowed, t) === i : !0;
|
|
984
892
|
});
|
|
985
893
|
}
|
|
986
|
-
function
|
|
987
|
-
const i =
|
|
894
|
+
function Xe(e, t = {}) {
|
|
895
|
+
const i = $(e), s = {
|
|
988
896
|
connectionId: t.connectionId,
|
|
989
897
|
connectionType: e,
|
|
990
898
|
path: ["database", "schema", "table"],
|
|
@@ -998,24 +906,24 @@ function rt(e, t = {}) {
|
|
|
998
906
|
supportsFilterClause: !0
|
|
999
907
|
};
|
|
1000
908
|
return i.includes("postgres") ? {
|
|
1001
|
-
...
|
|
909
|
+
...s,
|
|
1002
910
|
prefixLevels: ["schema", "table"],
|
|
1003
911
|
dialect: "postgres"
|
|
1004
912
|
} : i.includes("mysql") ? {
|
|
1005
|
-
...
|
|
913
|
+
...s,
|
|
1006
914
|
prefixLevels: ["database", "table"],
|
|
1007
915
|
dialect: "mysql",
|
|
1008
916
|
supportsFilterClause: !1
|
|
1009
917
|
} : i.includes("mssql") || i.includes("sqlserver") ? {
|
|
1010
|
-
...
|
|
918
|
+
...s,
|
|
1011
919
|
dialect: "mssql",
|
|
1012
920
|
supportsFilterClause: !1
|
|
1013
921
|
} : i.includes("redshift") ? {
|
|
1014
|
-
...
|
|
922
|
+
...s,
|
|
1015
923
|
prefixLevels: ["schema", "table"],
|
|
1016
924
|
dialect: "redshift"
|
|
1017
925
|
} : i.includes("snowflake") ? {
|
|
1018
|
-
...
|
|
926
|
+
...s,
|
|
1019
927
|
dialect: "snowflake"
|
|
1020
928
|
} : i.includes("clickhouse") ? {
|
|
1021
929
|
connectionId: t.connectionId,
|
|
@@ -1049,7 +957,7 @@ function rt(e, t = {}) {
|
|
|
1049
957
|
dialect: "postgres",
|
|
1050
958
|
supportsFilterClause: !0
|
|
1051
959
|
} : i === "bigquery" ? {
|
|
1052
|
-
...
|
|
960
|
+
...s,
|
|
1053
961
|
labels: {
|
|
1054
962
|
database: "Project",
|
|
1055
963
|
schema: "Dataset",
|
|
@@ -1058,9 +966,9 @@ function rt(e, t = {}) {
|
|
|
1058
966
|
prefixLevels: ["schema", "table"],
|
|
1059
967
|
dialect: "bigquery",
|
|
1060
968
|
supportsFilterClause: !1
|
|
1061
|
-
} :
|
|
969
|
+
} : s;
|
|
1062
970
|
}
|
|
1063
|
-
const
|
|
971
|
+
const fe = [
|
|
1064
972
|
"GoogleSheets",
|
|
1065
973
|
"FileUpload",
|
|
1066
974
|
"MySQL",
|
|
@@ -1074,31 +982,31 @@ const ve = [
|
|
|
1074
982
|
"API",
|
|
1075
983
|
"none"
|
|
1076
984
|
];
|
|
1077
|
-
function
|
|
985
|
+
function Wa(e) {
|
|
1078
986
|
if (!e) return;
|
|
1079
|
-
const t =
|
|
1080
|
-
(i) => i !== "none" &&
|
|
987
|
+
const t = fe.filter(
|
|
988
|
+
(i) => i !== "none" && Xe(i).dialect === e
|
|
1081
989
|
);
|
|
1082
990
|
return t.length === 1 ? t[0] : void 0;
|
|
1083
991
|
}
|
|
1084
|
-
const
|
|
992
|
+
const pi = {
|
|
1085
993
|
postgres: "PostgreSQL",
|
|
1086
994
|
sqlserver: "MSSQL"
|
|
1087
995
|
};
|
|
1088
|
-
function
|
|
1089
|
-
const t =
|
|
996
|
+
function en(e) {
|
|
997
|
+
const t = $(e);
|
|
1090
998
|
if (t)
|
|
1091
|
-
return
|
|
1092
|
-
(i) =>
|
|
1093
|
-
) ??
|
|
999
|
+
return fe.find(
|
|
1000
|
+
(i) => $(i) === t
|
|
1001
|
+
) ?? pi[t];
|
|
1094
1002
|
}
|
|
1095
|
-
function
|
|
1096
|
-
return
|
|
1003
|
+
function tn(e, t = {}) {
|
|
1004
|
+
return mi(
|
|
1097
1005
|
e
|
|
1098
|
-
) ?
|
|
1006
|
+
) ? Xe(e, t) : void 0;
|
|
1099
1007
|
}
|
|
1100
|
-
function
|
|
1101
|
-
const t =
|
|
1008
|
+
function mi(e) {
|
|
1009
|
+
const t = $(e);
|
|
1102
1010
|
if (t.includes("postgres")) return "postgres";
|
|
1103
1011
|
if (t.includes("mysql")) return "mysql";
|
|
1104
1012
|
if (t.includes("mssql") || t.includes("sqlserver"))
|
|
@@ -1109,8 +1017,8 @@ function Ei(e) {
|
|
|
1109
1017
|
if (t === "s3" || t === "api" || t === "googlesheets" || t === "fileupload" || t === "bigquery")
|
|
1110
1018
|
return t;
|
|
1111
1019
|
}
|
|
1112
|
-
function
|
|
1113
|
-
const t =
|
|
1020
|
+
function an(e) {
|
|
1021
|
+
const t = $(e);
|
|
1114
1022
|
switch (t) {
|
|
1115
1023
|
case "mysql":
|
|
1116
1024
|
case "bigquery":
|
|
@@ -1130,116 +1038,110 @@ function Ca(e) {
|
|
|
1130
1038
|
return "unknown";
|
|
1131
1039
|
}
|
|
1132
1040
|
}
|
|
1133
|
-
function
|
|
1041
|
+
function nn(e) {
|
|
1134
1042
|
return e.capabilities.prefixLevels.every(
|
|
1135
|
-
(t) => !!
|
|
1043
|
+
(t) => !!x(e.source, t)
|
|
1136
1044
|
);
|
|
1137
1045
|
}
|
|
1138
|
-
function
|
|
1139
|
-
const t = e.quoteIdentifier ??
|
|
1140
|
-
return e.capabilities.prefixLevels.map((i) =>
|
|
1046
|
+
function sn(e) {
|
|
1047
|
+
const t = e.quoteIdentifier ?? _i;
|
|
1048
|
+
return e.capabilities.prefixLevels.map((i) => x(e.source, i)).filter((i) => !!i).map((i) => t(i, e.capabilities.dialect)).join(".");
|
|
1141
1049
|
}
|
|
1142
|
-
function
|
|
1050
|
+
function x(e, t) {
|
|
1143
1051
|
return t === "database" ? e.databaseName : t === "schema" ? e.schemaName : e.tableName;
|
|
1144
1052
|
}
|
|
1145
|
-
function
|
|
1053
|
+
function fi(e, t, i) {
|
|
1146
1054
|
t === "database" ? e.databaseName = i : t === "schema" ? e.schemaName = i : e.tableName = i;
|
|
1147
1055
|
}
|
|
1148
|
-
const
|
|
1056
|
+
const gi = [
|
|
1149
1057
|
['"', '"'],
|
|
1150
1058
|
["`", "`"],
|
|
1151
1059
|
["[", "]"]
|
|
1152
1060
|
];
|
|
1153
|
-
function
|
|
1061
|
+
function hi(e) {
|
|
1154
1062
|
const t = e.trim();
|
|
1155
|
-
for (const [i,
|
|
1156
|
-
if (t.length >= 2 && t.startsWith(i) && t.endsWith(
|
|
1157
|
-
return t.slice(1, -1).split(
|
|
1063
|
+
for (const [i, s] of gi)
|
|
1064
|
+
if (t.length >= 2 && t.startsWith(i) && t.endsWith(s))
|
|
1065
|
+
return t.slice(1, -1).split(s + s).join(s);
|
|
1158
1066
|
return t;
|
|
1159
1067
|
}
|
|
1160
|
-
function
|
|
1068
|
+
function Ze(e) {
|
|
1161
1069
|
const t = e == null ? void 0 : e.trim();
|
|
1162
1070
|
if (!t) return [];
|
|
1163
|
-
const i = t.split(".").map(
|
|
1164
|
-
return i.some((
|
|
1071
|
+
const i = t.split(".").map(hi);
|
|
1072
|
+
return i.some((s) => !s) ? [] : i;
|
|
1165
1073
|
}
|
|
1166
|
-
function
|
|
1167
|
-
const t =
|
|
1074
|
+
function rn(e) {
|
|
1075
|
+
const t = Ze(e ?? void 0);
|
|
1168
1076
|
return t[t.length - 1] || "";
|
|
1169
1077
|
}
|
|
1170
|
-
function
|
|
1078
|
+
function _i(e, t) {
|
|
1171
1079
|
return t === "mysql" || t === "bigquery" || t === "clickhouse" || t === "duckdb" ? `\`${e.replace(/`/g, "``")}\`` : t === "mssql" ? `[${e.replace(/]/g, "]]")}]` : `"${e.replace(/"/g, '""')}"`;
|
|
1172
1080
|
}
|
|
1173
|
-
function
|
|
1081
|
+
function $(e) {
|
|
1174
1082
|
if (typeof e != "string")
|
|
1175
1083
|
return "";
|
|
1176
1084
|
const t = [];
|
|
1177
1085
|
for (const i of e.trim().toLowerCase())
|
|
1178
|
-
|
|
1086
|
+
yi(i) && t.push(i);
|
|
1179
1087
|
return t.join("");
|
|
1180
1088
|
}
|
|
1181
|
-
function
|
|
1089
|
+
function yi(e) {
|
|
1182
1090
|
const t = e.charCodeAt(0);
|
|
1183
1091
|
return t >= 48 && t <= 57 || t >= 97 && t <= 122;
|
|
1184
1092
|
}
|
|
1185
|
-
function
|
|
1093
|
+
function on(e) {
|
|
1186
1094
|
return typeof e == "object" && e !== null && e.mode === "last" && e.relativeTo === "latest_data";
|
|
1187
1095
|
}
|
|
1188
|
-
function
|
|
1096
|
+
function bi(e) {
|
|
1189
1097
|
return e === "between" || e === "not between";
|
|
1190
1098
|
}
|
|
1191
|
-
const
|
|
1192
|
-
mode:
|
|
1193
|
-
n:
|
|
1194
|
-
unit:
|
|
1195
|
-
complete:
|
|
1196
|
-
relativeTo:
|
|
1197
|
-
}),
|
|
1198
|
-
mode:
|
|
1199
|
-
n:
|
|
1200
|
-
unit:
|
|
1201
|
-
complete:
|
|
1202
|
-
relativeTo:
|
|
1203
|
-
}),
|
|
1204
|
-
mode:
|
|
1205
|
-
unit:
|
|
1206
|
-
toDate:
|
|
1207
|
-
boundary:
|
|
1208
|
-
}),
|
|
1209
|
-
mode:
|
|
1210
|
-
unit:
|
|
1211
|
-
from:
|
|
1212
|
-
to:
|
|
1213
|
-
}),
|
|
1099
|
+
const B = a.enum(["day", "week", "month", "quarter", "year"]), vi = a.enum(["minute", "hour"]), Je = a.number().int().positive(), we = a.number().int(), We = a.object({
|
|
1100
|
+
mode: a.literal("last"),
|
|
1101
|
+
n: Je,
|
|
1102
|
+
unit: vi,
|
|
1103
|
+
complete: a.literal(!1).optional(),
|
|
1104
|
+
relativeTo: a.literal("latest_data").optional()
|
|
1105
|
+
}), et = a.object({
|
|
1106
|
+
mode: a.literal("last"),
|
|
1107
|
+
n: Je,
|
|
1108
|
+
unit: B,
|
|
1109
|
+
complete: a.boolean().optional(),
|
|
1110
|
+
relativeTo: a.literal("latest_data").optional()
|
|
1111
|
+
}), tt = a.object({
|
|
1112
|
+
mode: a.literal("this"),
|
|
1113
|
+
unit: B,
|
|
1114
|
+
toDate: a.boolean().optional(),
|
|
1115
|
+
boundary: a.enum(["first_day", "last_day"]).optional()
|
|
1116
|
+
}), it = a.object({ mode: a.literal("previous"), unit: B }), at = a.object({
|
|
1117
|
+
mode: a.literal("between"),
|
|
1118
|
+
unit: B,
|
|
1119
|
+
from: we,
|
|
1120
|
+
to: we
|
|
1121
|
+
}), W = {
|
|
1214
1122
|
check: (e) => e.boundary === void 0 || e.unit === "month",
|
|
1215
1123
|
message: 'A month boundary requires unit "month".'
|
|
1216
|
-
},
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
message:
|
|
1124
|
+
}, Ii = a.union([
|
|
1125
|
+
We.strict(),
|
|
1126
|
+
et.strict(),
|
|
1127
|
+
tt.strict().refine(W.check, {
|
|
1128
|
+
message: W.message,
|
|
1221
1129
|
path: ["boundary"]
|
|
1222
1130
|
}),
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
]),
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1131
|
+
it.strict(),
|
|
1132
|
+
at.strict()
|
|
1133
|
+
]), Si = a.union([
|
|
1134
|
+
We,
|
|
1135
|
+
et,
|
|
1136
|
+
tt.refine(W.check),
|
|
1137
|
+
it,
|
|
1138
|
+
at
|
|
1231
1139
|
]);
|
|
1232
|
-
function
|
|
1233
|
-
const t =
|
|
1140
|
+
function ln(e) {
|
|
1141
|
+
const t = Si.safeParse(e);
|
|
1234
1142
|
return t.success ? t.data : void 0;
|
|
1235
1143
|
}
|
|
1236
|
-
const
|
|
1237
|
-
Vi.innerType().strict(),
|
|
1238
|
-
Ui.extend({ type: n.literal("date") }).strict(),
|
|
1239
|
-
Hi.strict(),
|
|
1240
|
-
zi.strict(),
|
|
1241
|
-
z
|
|
1242
|
-
]), I = n.string().min(1), Te = n.enum(["groupby", "metric", "sortby", "pivotby", "detail"]), gt = n.enum([
|
|
1144
|
+
const v = a.string().min(1), Ae = a.enum(["groupby", "metric", "sortby", "pivotby", "detail"]), nt = a.enum([
|
|
1243
1145
|
"table",
|
|
1244
1146
|
"view",
|
|
1245
1147
|
"materialized view",
|
|
@@ -1248,23 +1150,23 @@ const [Vi, Ui, Hi, zi] = Ue.options, Gi = n.union([
|
|
|
1248
1150
|
"dataset",
|
|
1249
1151
|
"url",
|
|
1250
1152
|
"upload"
|
|
1251
|
-
]),
|
|
1252
|
-
connectionId:
|
|
1253
|
-
connectionType:
|
|
1254
|
-
type:
|
|
1255
|
-
name:
|
|
1153
|
+
]), z = a.object({
|
|
1154
|
+
connectionId: v,
|
|
1155
|
+
connectionType: a.enum(fe),
|
|
1156
|
+
type: nt,
|
|
1157
|
+
name: v,
|
|
1256
1158
|
// Grounded relationship plans retain semantic identity and display metadata.
|
|
1257
1159
|
// SQL stays server-resolved; it is not accepted inside a join entity.
|
|
1258
|
-
alias:
|
|
1259
|
-
id:
|
|
1260
|
-
domainId:
|
|
1261
|
-
datasetType:
|
|
1262
|
-
label:
|
|
1263
|
-
description:
|
|
1264
|
-
dbObjectType:
|
|
1265
|
-
database:
|
|
1266
|
-
schema:
|
|
1267
|
-
dialect:
|
|
1160
|
+
alias: a.string().optional(),
|
|
1161
|
+
id: v.optional(),
|
|
1162
|
+
domainId: v.optional(),
|
|
1163
|
+
datasetType: a.enum(["physical", "virtual"]).optional(),
|
|
1164
|
+
label: a.string().optional(),
|
|
1165
|
+
description: a.string().optional(),
|
|
1166
|
+
dbObjectType: a.string().optional(),
|
|
1167
|
+
database: a.string().optional(),
|
|
1168
|
+
schema: a.string().optional(),
|
|
1169
|
+
dialect: a.enum([
|
|
1268
1170
|
"mysql",
|
|
1269
1171
|
"postgres",
|
|
1270
1172
|
"bigquery",
|
|
@@ -1274,44 +1176,44 @@ const [Vi, Ui, Hi, zi] = Ue.options, Gi = n.union([
|
|
|
1274
1176
|
"duckdb",
|
|
1275
1177
|
"mssql"
|
|
1276
1178
|
]).optional()
|
|
1277
|
-
}).strict(),
|
|
1278
|
-
() =>
|
|
1279
|
-
id:
|
|
1280
|
-
name:
|
|
1281
|
-
label:
|
|
1179
|
+
}).strict(), q = a.lazy(
|
|
1180
|
+
() => a.object({
|
|
1181
|
+
id: v,
|
|
1182
|
+
name: v,
|
|
1183
|
+
label: a.string(),
|
|
1282
1184
|
/** Set when `label` was synthesized from `name`; see `Field.derivedLabel`. */
|
|
1283
|
-
derivedLabel:
|
|
1284
|
-
qualifiedFieldName:
|
|
1285
|
-
dataType:
|
|
1286
|
-
entityId:
|
|
1287
|
-
entityName:
|
|
1288
|
-
entityType:
|
|
1289
|
-
alias:
|
|
1290
|
-
sourceField:
|
|
1291
|
-
source:
|
|
1292
|
-
nativeDataType:
|
|
1293
|
-
description:
|
|
1294
|
-
qualifiedEntityName:
|
|
1295
|
-
dateFormat:
|
|
1296
|
-
customFormat:
|
|
1297
|
-
granularity:
|
|
1298
|
-
role:
|
|
1299
|
-
calculationRepresentation:
|
|
1300
|
-
calculatedFieldOrigin:
|
|
1301
|
-
aggregateOrigin:
|
|
1302
|
-
labelOrigin:
|
|
1303
|
-
formatOrigin:
|
|
1304
|
-
expression:
|
|
1305
|
-
derivedField:
|
|
1306
|
-
format:
|
|
1307
|
-
semanticTemporalPresentation:
|
|
1308
|
-
granularity:
|
|
1309
|
-
format:
|
|
1185
|
+
derivedLabel: a.string().optional(),
|
|
1186
|
+
qualifiedFieldName: v,
|
|
1187
|
+
dataType: v,
|
|
1188
|
+
entityId: v,
|
|
1189
|
+
entityName: v,
|
|
1190
|
+
entityType: nt,
|
|
1191
|
+
alias: a.string().optional(),
|
|
1192
|
+
sourceField: a.string().optional(),
|
|
1193
|
+
source: le.optional(),
|
|
1194
|
+
nativeDataType: a.string().optional(),
|
|
1195
|
+
description: a.string().optional(),
|
|
1196
|
+
qualifiedEntityName: a.string().optional(),
|
|
1197
|
+
dateFormat: a.enum(di).optional(),
|
|
1198
|
+
customFormat: a.string().optional(),
|
|
1199
|
+
granularity: X.optional(),
|
|
1200
|
+
role: Ae.optional(),
|
|
1201
|
+
calculationRepresentation: a.enum(["inline-expression", "manual", "typed-derived"]).optional(),
|
|
1202
|
+
calculatedFieldOrigin: a.object({ id: v, role: Ae.optional() }).strict().optional(),
|
|
1203
|
+
aggregateOrigin: a.enum(["default", "explicit"]).optional(),
|
|
1204
|
+
labelOrigin: a.enum(["semantic", "override"]).optional(),
|
|
1205
|
+
formatOrigin: a.enum(["semantic", "override"]).optional(),
|
|
1206
|
+
expression: a.string().optional(),
|
|
1207
|
+
derivedField: de.optional(),
|
|
1208
|
+
format: O.optional(),
|
|
1209
|
+
semanticTemporalPresentation: a.object({
|
|
1210
|
+
granularity: X,
|
|
1211
|
+
format: Ft
|
|
1310
1212
|
}).strict().optional(),
|
|
1311
|
-
aggregate:
|
|
1312
|
-
fieldScope:
|
|
1313
|
-
calculatedFormula:
|
|
1314
|
-
operation:
|
|
1213
|
+
aggregate: je.optional(),
|
|
1214
|
+
fieldScope: a.enum(["card", "sheet", "dashboard", "domain"]).optional(),
|
|
1215
|
+
calculatedFormula: a.object({
|
|
1216
|
+
operation: a.enum([
|
|
1315
1217
|
"sum",
|
|
1316
1218
|
"difference",
|
|
1317
1219
|
"product",
|
|
@@ -1321,21 +1223,21 @@ const [Vi, Ui, Hi, zi] = Ue.options, Gi = n.union([
|
|
|
1321
1223
|
"scale",
|
|
1322
1224
|
"custom"
|
|
1323
1225
|
]),
|
|
1324
|
-
inputFields:
|
|
1325
|
-
constant:
|
|
1326
|
-
computeStage:
|
|
1226
|
+
inputFields: a.array(q),
|
|
1227
|
+
constant: a.number().finite().optional(),
|
|
1228
|
+
computeStage: a.enum(["row", "aggregate"]).optional()
|
|
1327
1229
|
}).strict().optional()
|
|
1328
1230
|
}).strict()
|
|
1329
|
-
),
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
]),
|
|
1336
|
-
id:
|
|
1337
|
-
field:
|
|
1338
|
-
operator:
|
|
1231
|
+
), ki = a.union([
|
|
1232
|
+
a.string(),
|
|
1233
|
+
a.number().finite(),
|
|
1234
|
+
a.boolean(),
|
|
1235
|
+
a.date(),
|
|
1236
|
+
a.null()
|
|
1237
|
+
]), wi = a.object({
|
|
1238
|
+
id: v,
|
|
1239
|
+
field: q,
|
|
1240
|
+
operator: a.enum([
|
|
1339
1241
|
"=",
|
|
1340
1242
|
"!=",
|
|
1341
1243
|
">",
|
|
@@ -1354,289 +1256,74 @@ const [Vi, Ui, Hi, zi] = Ue.options, Gi = n.union([
|
|
|
1354
1256
|
"isNull",
|
|
1355
1257
|
"isNotNull"
|
|
1356
1258
|
]),
|
|
1357
|
-
value:
|
|
1358
|
-
label:
|
|
1359
|
-
temporalBucket:
|
|
1360
|
-
relativeMeta:
|
|
1361
|
-
latestValue:
|
|
1362
|
-
latestValuePolicy:
|
|
1259
|
+
value: a.union([ki, a.array(a.string()), a.array(a.number().finite())]),
|
|
1260
|
+
label: a.string().optional(),
|
|
1261
|
+
temporalBucket: Dt.optional(),
|
|
1262
|
+
relativeMeta: Ii.optional(),
|
|
1263
|
+
latestValue: a.literal(!0).optional(),
|
|
1264
|
+
latestValuePolicy: a.literal("snapshot").optional()
|
|
1363
1265
|
}).strict().superRefine((e, t) => {
|
|
1364
|
-
const { operator: i, value:
|
|
1365
|
-
if ((i === "between" || i === "not between") && (!Array.isArray(
|
|
1266
|
+
const { operator: i, value: s } = e;
|
|
1267
|
+
if ((i === "between" || i === "not between") && (!Array.isArray(s) || s.length !== 2) && t.addIssue({
|
|
1366
1268
|
code: "custom",
|
|
1367
1269
|
path: ["value"],
|
|
1368
1270
|
message: "Between requires two endpoints."
|
|
1369
|
-
}), e.relativeMeta && !
|
|
1271
|
+
}), e.relativeMeta && !bi(i) && t.addIssue({
|
|
1370
1272
|
code: "custom",
|
|
1371
1273
|
path: ["relativeMeta"],
|
|
1372
1274
|
message: "A relative date requires between or not between."
|
|
1373
1275
|
}), e.latestValue) {
|
|
1374
|
-
const
|
|
1375
|
-
(i !== "=" || !
|
|
1276
|
+
const n = [e.field.nativeDataType, e.field.dataType].map((o) => ce(o)).some((o) => o === "date" || o === "datetime");
|
|
1277
|
+
(i !== "=" || !n) && t.addIssue({
|
|
1376
1278
|
code: "custom",
|
|
1377
1279
|
path: ["latestValue"],
|
|
1378
1280
|
message: "Latest value requires = on a date or timestamp field."
|
|
1379
1281
|
});
|
|
1380
1282
|
}
|
|
1381
|
-
(i === "in" || i === "not in") && !Array.isArray(
|
|
1283
|
+
(i === "in" || i === "not in") && !Array.isArray(s) && t.addIssue({
|
|
1382
1284
|
code: "custom",
|
|
1383
1285
|
path: ["value"],
|
|
1384
1286
|
message: "Membership requires an array."
|
|
1385
1287
|
});
|
|
1386
|
-
}),
|
|
1387
|
-
() =>
|
|
1388
|
-
id:
|
|
1389
|
-
logicalOperator:
|
|
1390
|
-
negate:
|
|
1391
|
-
conditions:
|
|
1392
|
-
groups:
|
|
1288
|
+
}), st = a.lazy(
|
|
1289
|
+
() => a.object({
|
|
1290
|
+
id: v,
|
|
1291
|
+
logicalOperator: a.enum(["AND", "OR"]),
|
|
1292
|
+
negate: a.boolean(),
|
|
1293
|
+
conditions: a.array(wi),
|
|
1294
|
+
groups: a.array(st)
|
|
1393
1295
|
}).strict()
|
|
1394
|
-
),
|
|
1395
|
-
baseEntity:
|
|
1396
|
-
joins:
|
|
1397
|
-
|
|
1398
|
-
id:
|
|
1399
|
-
source:
|
|
1400
|
-
target:
|
|
1401
|
-
joinType:
|
|
1402
|
-
sequence:
|
|
1403
|
-
autoResolved:
|
|
1404
|
-
relationshipId:
|
|
1405
|
-
relationshipName:
|
|
1406
|
-
relationshipCardinality:
|
|
1407
|
-
relationshipTraversalDirection:
|
|
1408
|
-
joinKeyGroups:
|
|
1409
|
-
|
|
1410
|
-
id:
|
|
1411
|
-
operator:
|
|
1412
|
-
keys:
|
|
1413
|
-
|
|
1414
|
-
id:
|
|
1415
|
-
source:
|
|
1416
|
-
target:
|
|
1417
|
-
operator:
|
|
1296
|
+
), Ai = a.object({
|
|
1297
|
+
baseEntity: z,
|
|
1298
|
+
joins: a.array(
|
|
1299
|
+
a.object({
|
|
1300
|
+
id: v,
|
|
1301
|
+
source: z,
|
|
1302
|
+
target: z,
|
|
1303
|
+
joinType: a.enum(["INNER", "LEFT", "RIGHT", "FULL"]),
|
|
1304
|
+
sequence: a.number().int().nonnegative(),
|
|
1305
|
+
autoResolved: a.boolean().optional(),
|
|
1306
|
+
relationshipId: a.string().optional(),
|
|
1307
|
+
relationshipName: a.string().optional(),
|
|
1308
|
+
relationshipCardinality: a.enum(["one_to_one", "one_to_many", "many_to_one", "many_to_many"]).optional(),
|
|
1309
|
+
relationshipTraversalDirection: a.enum(["forward", "reverse"]).optional(),
|
|
1310
|
+
joinKeyGroups: a.array(
|
|
1311
|
+
a.object({
|
|
1312
|
+
id: v,
|
|
1313
|
+
operator: a.enum(["AND", "OR"]),
|
|
1314
|
+
keys: a.array(
|
|
1315
|
+
a.object({
|
|
1316
|
+
id: a.string().optional(),
|
|
1317
|
+
source: q,
|
|
1318
|
+
target: q,
|
|
1319
|
+
operator: a.enum(["=", "!=", ">", ">=", "<", "<="])
|
|
1418
1320
|
}).strict()
|
|
1419
1321
|
).min(1)
|
|
1420
1322
|
}).strict()
|
|
1421
1323
|
).min(1)
|
|
1422
1324
|
}).strict()
|
|
1423
1325
|
)
|
|
1424
|
-
}).strict(),
|
|
1425
|
-
axis: G,
|
|
1426
|
-
levelId: n.string().uuid().optional(),
|
|
1427
|
-
// Persisted table preferences are edited through Immer; runtime paths remain readonly.
|
|
1428
|
-
oppositePath: F.transform((e) => [...e]).optional()
|
|
1429
|
-
}).strict(), k = n.string().min(1), Zi = n.array(
|
|
1430
|
-
n.enum(["body", "header", "footer", "subtotal", "grandTotal"])
|
|
1431
|
-
), Ji = n.enum(["normal", "medium", "semibold", "bold"]), en = n.enum(["none", "underline", "line-through"]), bt = n.object({
|
|
1432
|
-
version: n.literal(1),
|
|
1433
|
-
rules: n.array(
|
|
1434
|
-
n.object({
|
|
1435
|
-
id: n.string().min(1),
|
|
1436
|
-
name: n.string().optional(),
|
|
1437
|
-
enabled: n.boolean().optional(),
|
|
1438
|
-
target: n.object({
|
|
1439
|
-
level: n.enum(["cell", "row"]),
|
|
1440
|
-
matrix: Wi.optional(),
|
|
1441
|
-
columnIds: n.array(k).optional(),
|
|
1442
|
-
conditionColumnId: k.optional(),
|
|
1443
|
-
applyToColumnIds: n.array(k).optional(),
|
|
1444
|
-
tableParts: Zi.optional(),
|
|
1445
|
-
rowRoles: n.array(n.string()).optional(),
|
|
1446
|
-
depth: n.number().int().nonnegative().optional(),
|
|
1447
|
-
includeTotals: n.boolean().optional(),
|
|
1448
|
-
includeSubtotals: n.boolean().optional()
|
|
1449
|
-
}).strict(),
|
|
1450
|
-
condition: n.discriminatedUnion("kind", [
|
|
1451
|
-
n.object({
|
|
1452
|
-
kind: n.literal("comparison"),
|
|
1453
|
-
columnId: k,
|
|
1454
|
-
operator: n.enum(["eq", "neq", "gt", "gte", "lt", "lte"]),
|
|
1455
|
-
value: B
|
|
1456
|
-
}).strict(),
|
|
1457
|
-
n.object({
|
|
1458
|
-
kind: n.literal("between"),
|
|
1459
|
-
columnId: k,
|
|
1460
|
-
min: B,
|
|
1461
|
-
max: B,
|
|
1462
|
-
inclusive: n.boolean().optional()
|
|
1463
|
-
}).strict(),
|
|
1464
|
-
n.object({
|
|
1465
|
-
kind: n.literal("blank"),
|
|
1466
|
-
columnId: k,
|
|
1467
|
-
isBlank: n.boolean()
|
|
1468
|
-
}).strict(),
|
|
1469
|
-
n.object({
|
|
1470
|
-
kind: n.literal("contains"),
|
|
1471
|
-
columnId: k,
|
|
1472
|
-
value: n.string(),
|
|
1473
|
-
caseSensitive: n.boolean().optional(),
|
|
1474
|
-
exact: n.boolean().optional()
|
|
1475
|
-
}).strict(),
|
|
1476
|
-
n.object({
|
|
1477
|
-
kind: n.literal("topBottom"),
|
|
1478
|
-
columnId: k,
|
|
1479
|
-
direction: n.enum(["top", "bottom"]),
|
|
1480
|
-
count: n.number().int().positive()
|
|
1481
|
-
}).strict(),
|
|
1482
|
-
n.object({
|
|
1483
|
-
kind: n.literal("colorScale"),
|
|
1484
|
-
columnId: k,
|
|
1485
|
-
range: n.enum(["auto", "manual"]),
|
|
1486
|
-
min: n.number().finite().optional(),
|
|
1487
|
-
mid: n.number().finite().optional(),
|
|
1488
|
-
max: n.number().finite().optional(),
|
|
1489
|
-
colors: n.object({
|
|
1490
|
-
min: n.string(),
|
|
1491
|
-
mid: n.string().optional(),
|
|
1492
|
-
max: n.string()
|
|
1493
|
-
}).strict()
|
|
1494
|
-
}).strict(),
|
|
1495
|
-
n.object({
|
|
1496
|
-
kind: n.literal("dataBar"),
|
|
1497
|
-
columnId: k,
|
|
1498
|
-
range: n.enum(["auto", "manual"]),
|
|
1499
|
-
min: n.number().finite().optional(),
|
|
1500
|
-
max: n.number().finite().optional(),
|
|
1501
|
-
color: n.string(),
|
|
1502
|
-
showValue: n.boolean().optional()
|
|
1503
|
-
}).strict()
|
|
1504
|
-
]),
|
|
1505
|
-
style: n.object({
|
|
1506
|
-
backgroundColor: n.string().optional(),
|
|
1507
|
-
textColor: n.string().optional(),
|
|
1508
|
-
fontWeight: Ji.optional(),
|
|
1509
|
-
italic: n.boolean().optional(),
|
|
1510
|
-
textDecoration: en.optional(),
|
|
1511
|
-
icon: n.enum(["arrowUp", "arrowDown", "warning", "check", "x"]).optional(),
|
|
1512
|
-
dataBar: n.object({ color: n.string(), showValue: n.boolean() }).strict().optional()
|
|
1513
|
-
}).strict().optional()
|
|
1514
|
-
}).strict()
|
|
1515
|
-
)
|
|
1516
|
-
}).strict();
|
|
1517
|
-
function qa(e, t) {
|
|
1518
|
-
const i = (s) => {
|
|
1519
|
-
if (U(s)) return s.value;
|
|
1520
|
-
const l = typeof s == "string" ? Ii(s.trim()) ?? oe(s) : oe(s);
|
|
1521
|
-
if (l === null) return null;
|
|
1522
|
-
try {
|
|
1523
|
-
return Si(String(l));
|
|
1524
|
-
} catch {
|
|
1525
|
-
return null;
|
|
1526
|
-
}
|
|
1527
|
-
}, a = i(e), o = i(t);
|
|
1528
|
-
return a === null || o === null ? null : nt(a, o);
|
|
1529
|
-
}
|
|
1530
|
-
function La(e, t, i) {
|
|
1531
|
-
const a = an(e);
|
|
1532
|
-
if (a === null) return null;
|
|
1533
|
-
if (typeof a == "number" && typeof t == "number" && typeof i == "number") {
|
|
1534
|
-
const b = sn(a, t, i);
|
|
1535
|
-
return { ratio: b, midpointComparison: Math.sign(b - 0.5) };
|
|
1536
|
-
}
|
|
1537
|
-
if ([t, i].some((b) => typeof b == "number" && !Number.isFinite(b))) return null;
|
|
1538
|
-
const o = [a, t, i].map((b) => {
|
|
1539
|
-
const Y = typeof b == "number" ? x(String(b)) : b.value, [Ct, Ae = ""] = Y.split(".");
|
|
1540
|
-
return { coefficient: Ct + Ae, scale: Ae.length };
|
|
1541
|
-
}), s = Math.max(...o.map((b) => b.scale)), [l, d, c] = o.map(
|
|
1542
|
-
(b) => BigInt(b.coefficient) * 10n ** BigInt(s - b.scale)
|
|
1543
|
-
), p = c - d, u = l - d;
|
|
1544
|
-
if (p <= 0n)
|
|
1545
|
-
return {
|
|
1546
|
-
ratio: l >= c ? 1 : 0,
|
|
1547
|
-
midpointComparison: l >= c ? 1 : -1
|
|
1548
|
-
};
|
|
1549
|
-
const h = u * 2n - p, _ = h < 0n ? -1 : h > 0n ? 1 : 0;
|
|
1550
|
-
return { ratio: u <= 0n ? 0 : u >= p ? 1 : Number(u * 1000000000n / p) / 1e9, midpointComparison: _ };
|
|
1551
|
-
}
|
|
1552
|
-
function Ba(e) {
|
|
1553
|
-
return !!e && typeof e == "object" && !Array.isArray(e);
|
|
1554
|
-
}
|
|
1555
|
-
function Va(e) {
|
|
1556
|
-
return e.enabled !== !1;
|
|
1557
|
-
}
|
|
1558
|
-
function Ua(e) {
|
|
1559
|
-
return e.kind === "topBottom" || e.kind === "colorScale" && e.range === "auto" || e.kind === "dataBar" && e.range === "auto";
|
|
1560
|
-
}
|
|
1561
|
-
function tn(e) {
|
|
1562
|
-
return e.columnId;
|
|
1563
|
-
}
|
|
1564
|
-
function nn(e) {
|
|
1565
|
-
const t = [tn(e.condition)];
|
|
1566
|
-
return { validationRefs: [.../* @__PURE__ */ new Set([
|
|
1567
|
-
...t,
|
|
1568
|
-
...e.target.conditionColumnId === void 0 ? [] : [e.target.conditionColumnId],
|
|
1569
|
-
...e.target.columnIds ?? [],
|
|
1570
|
-
...e.target.applyToColumnIds ?? []
|
|
1571
|
-
])], evaluationInputs: t };
|
|
1572
|
-
}
|
|
1573
|
-
function oe(e) {
|
|
1574
|
-
if (typeof e == "number")
|
|
1575
|
-
return Number.isFinite(e) ? e : null;
|
|
1576
|
-
if (typeof e == "string" && e.trim() !== "") {
|
|
1577
|
-
const t = Number(e);
|
|
1578
|
-
return Number.isFinite(t) ? t : null;
|
|
1579
|
-
}
|
|
1580
|
-
return null;
|
|
1581
|
-
}
|
|
1582
|
-
function an(e) {
|
|
1583
|
-
return U(e) ? e : oe(e);
|
|
1584
|
-
}
|
|
1585
|
-
function Ha(e) {
|
|
1586
|
-
const t = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Set();
|
|
1587
|
-
for (const a of e)
|
|
1588
|
-
U(a) ? i.add(a.value) : t.add(a);
|
|
1589
|
-
return {
|
|
1590
|
-
has: (a) => U(a) ? i.has(a.value) : t.has(a)
|
|
1591
|
-
};
|
|
1592
|
-
}
|
|
1593
|
-
function za(e, t) {
|
|
1594
|
-
return typeof e == "number" && typeof t == "number" ? Math.sign(e - t) : nt(
|
|
1595
|
-
typeof e == "number" ? x(String(e)) : e.value,
|
|
1596
|
-
typeof t == "number" ? x(String(t)) : t.value
|
|
1597
|
-
);
|
|
1598
|
-
}
|
|
1599
|
-
function Ga(e) {
|
|
1600
|
-
return e == null || e === "";
|
|
1601
|
-
}
|
|
1602
|
-
function sn(e, t, i) {
|
|
1603
|
-
return !Number.isFinite(e) || !Number.isFinite(t) || !Number.isFinite(i) ? 0 : i === t ? e >= i ? 1 : 0 : Math.max(0, Math.min(1, (e - t) / (i - t)));
|
|
1604
|
-
}
|
|
1605
|
-
function on(e) {
|
|
1606
|
-
switch (e) {
|
|
1607
|
-
case "bold":
|
|
1608
|
-
return 700;
|
|
1609
|
-
case "semibold":
|
|
1610
|
-
return 600;
|
|
1611
|
-
case "medium":
|
|
1612
|
-
return 500;
|
|
1613
|
-
case "normal":
|
|
1614
|
-
return 400;
|
|
1615
|
-
default:
|
|
1616
|
-
return;
|
|
1617
|
-
}
|
|
1618
|
-
}
|
|
1619
|
-
function Qa(e) {
|
|
1620
|
-
return e ? _t({
|
|
1621
|
-
fontWeight: on(e.fontWeight),
|
|
1622
|
-
fontStyle: e.italic ? "italic" : void 0,
|
|
1623
|
-
color: e.textColor,
|
|
1624
|
-
backgroundColor: e.backgroundColor,
|
|
1625
|
-
textDecoration: e.textDecoration
|
|
1626
|
-
}) : {};
|
|
1627
|
-
}
|
|
1628
|
-
function Ka(...e) {
|
|
1629
|
-
return Object.assign(
|
|
1630
|
-
{},
|
|
1631
|
-
...e.filter((t) => !!t).map(_t)
|
|
1632
|
-
);
|
|
1633
|
-
}
|
|
1634
|
-
function _t(e) {
|
|
1635
|
-
return Object.fromEntries(
|
|
1636
|
-
Object.entries(e).filter(([, t]) => t !== void 0)
|
|
1637
|
-
);
|
|
1638
|
-
}
|
|
1639
|
-
const v = n.string().uuid(), rn = n.string().min(1), ln = n.number().int().positive().max(Number.MAX_SAFE_INTEGER), dn = n.enum([
|
|
1326
|
+
}).strict(), b = a.string().uuid(), xi = a.string().min(1), Fi = a.number().int().positive().max(Number.MAX_SAFE_INTEGER), Di = a.enum([
|
|
1640
1327
|
"SUM",
|
|
1641
1328
|
"COUNT",
|
|
1642
1329
|
"DISTINCT",
|
|
@@ -1644,406 +1331,363 @@ const v = n.string().uuid(), rn = n.string().min(1), ln = n.number().int().posit
|
|
|
1644
1331
|
"MIN",
|
|
1645
1332
|
"MAX",
|
|
1646
1333
|
"MEDIAN"
|
|
1647
|
-
]),
|
|
1334
|
+
]), rt = Qt.omit({
|
|
1648
1335
|
aggregate: !0
|
|
1649
|
-
}),
|
|
1650
|
-
id:
|
|
1651
|
-
field:
|
|
1652
|
-
grain:
|
|
1653
|
-
},
|
|
1654
|
-
id:
|
|
1655
|
-
kind:
|
|
1656
|
-
field:
|
|
1657
|
-
aggregate:
|
|
1658
|
-
}).strict(),
|
|
1659
|
-
id:
|
|
1660
|
-
kind:
|
|
1661
|
-
definition:
|
|
1662
|
-
}).strict(),
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
kind:
|
|
1666
|
-
measureId:
|
|
1667
|
-
oppositePath:
|
|
1336
|
+
}), Mi = {
|
|
1337
|
+
id: b,
|
|
1338
|
+
field: rt,
|
|
1339
|
+
grain: X.optional()
|
|
1340
|
+
}, ee = a.object(Mi).strict(), Ei = a.object({
|
|
1341
|
+
id: b,
|
|
1342
|
+
kind: a.literal("aggregate"),
|
|
1343
|
+
field: rt,
|
|
1344
|
+
aggregate: Di
|
|
1345
|
+
}).strict(), Ti = a.object({
|
|
1346
|
+
id: b,
|
|
1347
|
+
kind: a.literal("calculated"),
|
|
1348
|
+
definition: de
|
|
1349
|
+
}).strict(), ot = a.discriminatedUnion("kind", [Ei, Ti]), Ni = a.discriminatedUnion("kind", [
|
|
1350
|
+
a.object({ kind: a.literal("member") }).strict(),
|
|
1351
|
+
a.object({
|
|
1352
|
+
kind: a.literal("measure"),
|
|
1353
|
+
measureId: b,
|
|
1354
|
+
oppositePath: A
|
|
1668
1355
|
}).strict()
|
|
1669
|
-
]),
|
|
1670
|
-
axis:
|
|
1671
|
-
levelId:
|
|
1672
|
-
scope:
|
|
1673
|
-
|
|
1674
|
-
|
|
1356
|
+
]), Ri = {
|
|
1357
|
+
axis: me,
|
|
1358
|
+
levelId: b,
|
|
1359
|
+
scope: a.discriminatedUnion("kind", [
|
|
1360
|
+
a.object({ kind: a.literal("level") }).strict(),
|
|
1361
|
+
a.object({ kind: a.literal("branch"), parent: A }).strict()
|
|
1675
1362
|
]),
|
|
1676
|
-
target:
|
|
1677
|
-
direction:
|
|
1678
|
-
nulls:
|
|
1679
|
-
},
|
|
1680
|
-
id:
|
|
1681
|
-
axis:
|
|
1682
|
-
levelId:
|
|
1683
|
-
direction:
|
|
1684
|
-
count:
|
|
1685
|
-
measureId:
|
|
1686
|
-
oppositePath:
|
|
1687
|
-
others:
|
|
1688
|
-
}).strict(),
|
|
1689
|
-
id:
|
|
1690
|
-
axis:
|
|
1691
|
-
levelId:
|
|
1692
|
-
measureId:
|
|
1693
|
-
operator:
|
|
1694
|
-
value:
|
|
1695
|
-
|
|
1696
|
-
|
|
1363
|
+
target: Ni,
|
|
1364
|
+
direction: a.enum(["asc", "desc"]),
|
|
1365
|
+
nulls: a.enum(["first", "last"])
|
|
1366
|
+
}, lt = a.object(Ri).strict(), $i = a.object({
|
|
1367
|
+
id: b,
|
|
1368
|
+
axis: me,
|
|
1369
|
+
levelId: b,
|
|
1370
|
+
direction: a.enum(["top", "bottom"]),
|
|
1371
|
+
count: Fi,
|
|
1372
|
+
measureId: b,
|
|
1373
|
+
oppositePath: A,
|
|
1374
|
+
others: a.boolean()
|
|
1375
|
+
}).strict(), G = a.number().finite(), Ci = a.object({
|
|
1376
|
+
id: b,
|
|
1377
|
+
axis: me,
|
|
1378
|
+
levelId: b,
|
|
1379
|
+
measureId: b,
|
|
1380
|
+
operator: a.enum(["=", "!=", ">", ">=", "<", "<=", "between", "not between"]),
|
|
1381
|
+
value: a.union([
|
|
1382
|
+
G,
|
|
1383
|
+
a.tuple([G, G]).readonly()
|
|
1697
1384
|
])
|
|
1698
1385
|
}).strict().superRefine((e, t) => {
|
|
1699
1386
|
const i = e.operator === "between" || e.operator === "not between";
|
|
1700
|
-
i !== Array.isArray(e.value) ?
|
|
1701
|
-
}),
|
|
1702
|
-
source:
|
|
1703
|
-
rows:
|
|
1704
|
-
columns:
|
|
1705
|
-
measures:
|
|
1706
|
-
filters:
|
|
1707
|
-
joinPlan:
|
|
1708
|
-
relationshipHint:
|
|
1709
|
-
sorts:
|
|
1710
|
-
rankings:
|
|
1711
|
-
measureFilters:
|
|
1387
|
+
i !== Array.isArray(e.value) ? h(t, ["value"], i ? "A range condition needs a low and a high bound." : "A comparison needs one number.") : i && e.value[0] > e.value[1] && h(t, ["value"], "The low bound must not exceed the high bound.");
|
|
1388
|
+
}), dt = a.object({
|
|
1389
|
+
source: le,
|
|
1390
|
+
rows: a.array(ee).min(1).readonly(),
|
|
1391
|
+
columns: a.array(ee).readonly(),
|
|
1392
|
+
measures: a.array(ot).min(1).readonly(),
|
|
1393
|
+
filters: st.optional(),
|
|
1394
|
+
joinPlan: Ai.optional(),
|
|
1395
|
+
relationshipHint: a.object({ relationshipIds: a.array(xi).optional() }).strict().optional(),
|
|
1396
|
+
sorts: a.array(lt).readonly(),
|
|
1397
|
+
rankings: a.array($i).readonly(),
|
|
1398
|
+
measureFilters: a.array(Ci).readonly().optional()
|
|
1712
1399
|
}).strict();
|
|
1713
|
-
function
|
|
1400
|
+
function ut(e) {
|
|
1714
1401
|
return JSON.stringify([
|
|
1715
1402
|
e.axis,
|
|
1716
1403
|
e.levelId,
|
|
1717
1404
|
e.scope.kind,
|
|
1718
|
-
e.scope.kind === "branch" ?
|
|
1405
|
+
e.scope.kind === "branch" ? Qe(e.scope.parent) : null
|
|
1719
1406
|
]);
|
|
1720
1407
|
}
|
|
1721
|
-
function
|
|
1408
|
+
function h(e, t, i) {
|
|
1722
1409
|
e.addIssue({ code: "custom", path: t, message: i });
|
|
1723
1410
|
}
|
|
1724
1411
|
function w(e, t, i) {
|
|
1725
|
-
new Set(e).size !== e.length &&
|
|
1726
|
-
}
|
|
1727
|
-
function
|
|
1728
|
-
i.length > e[t].length &&
|
|
1729
|
-
var
|
|
1730
|
-
if (
|
|
1731
|
-
const
|
|
1732
|
-
(
|
|
1733
|
-
(u) => u.id ===
|
|
1734
|
-
)) &&
|
|
1735
|
-
|
|
1736
|
-
[...
|
|
1412
|
+
new Set(e).size !== e.length && h(t, i, "Duplicate identity.");
|
|
1413
|
+
}
|
|
1414
|
+
function L(e, t, i, s, l, n = !1) {
|
|
1415
|
+
i.length > e[t].length && h(s, l, "Path exceeds axis depth."), i.forEach((o, d) => {
|
|
1416
|
+
var p;
|
|
1417
|
+
if (o.levelId !== ((p = e[t][d]) == null ? void 0 : p.id) && h(s, [...l, d], "Path must be an ordered axis prefix."), o.member.kind === "others") {
|
|
1418
|
+
const m = o.member.rankingId;
|
|
1419
|
+
(n || d !== i.length - 1 || !e.rankings.some(
|
|
1420
|
+
(u) => u.id === m && u.others && u.axis === t && u.levelId === o.levelId
|
|
1421
|
+
)) && h(
|
|
1422
|
+
s,
|
|
1423
|
+
[...l, d],
|
|
1737
1424
|
"Others must terminate a path at its enabled ranking and cannot be a sort/rank target."
|
|
1738
1425
|
);
|
|
1739
1426
|
}
|
|
1740
1427
|
});
|
|
1741
1428
|
}
|
|
1742
|
-
function
|
|
1743
|
-
w(t.map(
|
|
1744
|
-
const
|
|
1745
|
-
if (d < 0 &&
|
|
1429
|
+
function ct(e, t, i, s) {
|
|
1430
|
+
w(t.map(ut), i, s), t.forEach((l, n) => {
|
|
1431
|
+
const o = [...s, n], d = e[l.axis].findIndex((p) => p.id === l.levelId);
|
|
1432
|
+
if (d < 0 && h(i, o, "Sort level is not on its axis."), l.scope.kind === "branch" && (L(
|
|
1746
1433
|
e,
|
|
1747
|
-
|
|
1748
|
-
|
|
1434
|
+
l.axis,
|
|
1435
|
+
l.scope.parent,
|
|
1749
1436
|
i,
|
|
1750
|
-
[...
|
|
1437
|
+
[...o, "scope", "parent"],
|
|
1751
1438
|
!0
|
|
1752
|
-
),
|
|
1439
|
+
), l.scope.parent.length !== d && h(
|
|
1753
1440
|
i,
|
|
1754
|
-
|
|
1441
|
+
o,
|
|
1755
1442
|
"Branch sort must name the immediate parent of its level."
|
|
1756
|
-
)),
|
|
1757
|
-
const
|
|
1758
|
-
e.measures.some((
|
|
1443
|
+
)), l.target.kind === "measure") {
|
|
1444
|
+
const p = l.target.measureId;
|
|
1445
|
+
e.measures.some((m) => m.id === p) || h(i, o, "Unknown sort measure."), L(
|
|
1759
1446
|
e,
|
|
1760
|
-
|
|
1761
|
-
|
|
1447
|
+
l.axis === "rows" ? "columns" : "rows",
|
|
1448
|
+
l.target.oppositePath,
|
|
1762
1449
|
i,
|
|
1763
|
-
[...
|
|
1450
|
+
[...o, "target", "oppositePath"],
|
|
1764
1451
|
!0
|
|
1765
1452
|
);
|
|
1766
1453
|
}
|
|
1767
1454
|
});
|
|
1768
1455
|
}
|
|
1769
|
-
function
|
|
1770
|
-
e && (e.kind !== t.kind || e.kind === "semantic" && t.kind === "semantic" && e.domainId !== t.domainId || e.kind === "physical" && t.kind === "physical" && e.connectionId !== t.connectionId) &&
|
|
1456
|
+
function Y(e, t, i, s) {
|
|
1457
|
+
e && (e.kind !== t.kind || e.kind === "semantic" && t.kind === "semantic" && e.domainId !== t.domainId || e.kind === "physical" && t.kind === "physical" && e.connectionId !== t.connectionId) && h(
|
|
1771
1458
|
i,
|
|
1772
|
-
|
|
1459
|
+
s,
|
|
1773
1460
|
"Field source must belong to the same semantic domain or physical connection."
|
|
1774
1461
|
);
|
|
1775
1462
|
}
|
|
1776
|
-
function
|
|
1777
|
-
(e.aggregationBehavior === "snapshot" || e.aggregationBehavior === "weighted" || e.aggregationStrategy === "weighted") &&
|
|
1463
|
+
function Q(e, t, i) {
|
|
1464
|
+
(e.aggregationBehavior === "snapshot" || e.aggregationBehavior === "weighted" || e.aggregationStrategy === "weighted") && h(t, i, "This measure semantic requires a later capability.");
|
|
1778
1465
|
}
|
|
1779
|
-
function
|
|
1466
|
+
function pt(e, t) {
|
|
1780
1467
|
w(
|
|
1781
|
-
[...e.rows, ...e.columns, ...e.measures].map((
|
|
1468
|
+
[...e.rows, ...e.columns, ...e.measures].map((n) => n.id),
|
|
1782
1469
|
t,
|
|
1783
1470
|
[]
|
|
1784
1471
|
), w(
|
|
1785
|
-
e.rankings.map((
|
|
1472
|
+
e.rankings.map((n) => n.id),
|
|
1786
1473
|
t,
|
|
1787
1474
|
["rankings"]
|
|
1788
1475
|
), w(
|
|
1789
|
-
e.rankings.map((
|
|
1476
|
+
e.rankings.map((n) => JSON.stringify([n.axis, n.levelId])),
|
|
1790
1477
|
t,
|
|
1791
1478
|
["rankings"]
|
|
1792
1479
|
);
|
|
1793
|
-
for (const
|
|
1794
|
-
e[
|
|
1795
|
-
|
|
1480
|
+
for (const n of ["rows", "columns"])
|
|
1481
|
+
e[n].forEach((o, d) => {
|
|
1482
|
+
o.grain && o.field.dataType !== void 0 && !["date", "datetime", "unknown"].includes(o.field.dataType) && h(t, [n, d, "grain"], "Grain requires a temporal field.");
|
|
1796
1483
|
});
|
|
1797
1484
|
const i = [
|
|
1798
1485
|
...e.rows,
|
|
1799
1486
|
...e.columns,
|
|
1800
|
-
...e.measures.filter((
|
|
1487
|
+
...e.measures.filter((n) => n.kind === "aggregate")
|
|
1801
1488
|
];
|
|
1802
|
-
for (const
|
|
1803
|
-
if (
|
|
1804
|
-
|
|
1489
|
+
for (const n of i)
|
|
1490
|
+
if (Y(n.field.source, e.source, t, [
|
|
1491
|
+
n.id,
|
|
1805
1492
|
"field",
|
|
1806
1493
|
"source"
|
|
1807
|
-
]),
|
|
1808
|
-
|
|
1494
|
+
]), n.field.derivedField) {
|
|
1495
|
+
n.field.derivedField.computeStage !== "row" && h(
|
|
1809
1496
|
t,
|
|
1810
|
-
[
|
|
1497
|
+
[n.id],
|
|
1811
1498
|
"Aggregate-stage calculations cannot be grouped or wrapped in an aggregate."
|
|
1812
|
-
),
|
|
1813
|
-
for (const
|
|
1814
|
-
|
|
1499
|
+
), Q(n.field.derivedField, t, [n.id]);
|
|
1500
|
+
for (const o of Object.values(n.field.derivedField.inputs))
|
|
1501
|
+
Y(o.field.source, e.source, t, [n.id, "inputs"]);
|
|
1815
1502
|
}
|
|
1816
|
-
for (const
|
|
1817
|
-
if (
|
|
1818
|
-
(
|
|
1503
|
+
for (const n of e.measures)
|
|
1504
|
+
if (n.kind === "calculated") {
|
|
1505
|
+
(n.definition.computeStage !== "aggregate" || n.definition.resultRole !== "measure") && h(
|
|
1819
1506
|
t,
|
|
1820
|
-
[
|
|
1507
|
+
[n.id],
|
|
1821
1508
|
"Calculated measures require aggregate stage and measure role."
|
|
1822
|
-
),
|
|
1823
|
-
for (const
|
|
1824
|
-
|
|
1825
|
-
|
|
1509
|
+
), Q(n.definition, t, [n.id]);
|
|
1510
|
+
for (const o of Object.values(n.definition.inputs))
|
|
1511
|
+
Y(o.field.source, e.source, t, [
|
|
1512
|
+
n.id,
|
|
1826
1513
|
"inputs"
|
|
1827
1514
|
]);
|
|
1828
1515
|
}
|
|
1829
|
-
const
|
|
1830
|
-
const
|
|
1831
|
-
var
|
|
1832
|
-
if ((d.aggregate || ((
|
|
1833
|
-
|
|
1834
|
-
for (const
|
|
1835
|
-
|
|
1516
|
+
const s = (n) => {
|
|
1517
|
+
const o = (d, p) => {
|
|
1518
|
+
var m, u;
|
|
1519
|
+
if ((d.aggregate || ((m = d.derivedField) == null ? void 0 : m.computeStage) === "aggregate") && h(t, p, "Aggregate/HAVING filters are not supported."), d.derivedField) {
|
|
1520
|
+
Q(d.derivedField, t, p);
|
|
1521
|
+
for (const g of Object.values(d.derivedField.inputs))
|
|
1522
|
+
Y(g.field.source, e.source, t, p);
|
|
1836
1523
|
}
|
|
1837
|
-
for (const
|
|
1838
|
-
|
|
1524
|
+
for (const g of ((u = d.calculatedFormula) == null ? void 0 : u.inputFields) ?? [])
|
|
1525
|
+
o(g, p);
|
|
1839
1526
|
};
|
|
1840
|
-
for (const d of
|
|
1841
|
-
|
|
1842
|
-
|
|
1527
|
+
for (const d of n.conditions)
|
|
1528
|
+
o(d.field, ["filters", d.id]);
|
|
1529
|
+
n.groups.forEach(s);
|
|
1843
1530
|
};
|
|
1844
|
-
if (e.filters &&
|
|
1845
|
-
const
|
|
1531
|
+
if (e.filters && s(e.filters), e.joinPlan) {
|
|
1532
|
+
const n = [
|
|
1846
1533
|
e.joinPlan.baseEntity,
|
|
1847
|
-
...e.joinPlan.joins.flatMap((
|
|
1534
|
+
...e.joinPlan.joins.flatMap((o) => [o.source, o.target])
|
|
1848
1535
|
];
|
|
1849
|
-
(new Set(
|
|
1850
|
-
e.joinPlan.joins.map((
|
|
1536
|
+
(new Set(n.map((o) => o.connectionId)).size > 1 || e.source.kind === "physical" && n[0].connectionId !== e.source.connectionId) && h(t, ["joinPlan"], "Joins must stay within the source connection."), w(
|
|
1537
|
+
e.joinPlan.joins.map((o) => o.id),
|
|
1851
1538
|
t,
|
|
1852
1539
|
["joinPlan", "joins"]
|
|
1853
1540
|
);
|
|
1854
1541
|
}
|
|
1855
|
-
|
|
1856
|
-
const
|
|
1857
|
-
w(
|
|
1858
|
-
|
|
1542
|
+
ct(e, e.sorts, t, ["sorts"]);
|
|
1543
|
+
const l = e.measureFilters ?? [];
|
|
1544
|
+
w(l.map((n) => n.id), t, ["measureFilters"]), w(
|
|
1545
|
+
l.map((n) => JSON.stringify([n.axis, n.levelId])),
|
|
1859
1546
|
t,
|
|
1860
1547
|
["measureFilters"]
|
|
1861
|
-
),
|
|
1862
|
-
(!e[
|
|
1863
|
-
}), e.rankings.forEach((
|
|
1864
|
-
(!e[
|
|
1548
|
+
), l.forEach((n, o) => {
|
|
1549
|
+
(!e[n.axis].some((d) => d.id === n.levelId) || !e.measures.some((d) => d.id === n.measureId)) && h(t, ["measureFilters", o], "Unknown measure filter level or measure.");
|
|
1550
|
+
}), e.rankings.forEach((n, o) => {
|
|
1551
|
+
(!e[n.axis].some((d) => d.id === n.levelId) || !e.measures.some((d) => d.id === n.measureId)) && h(t, ["rankings", o], "Unknown ranking level or measure."), L(
|
|
1865
1552
|
e,
|
|
1866
|
-
|
|
1867
|
-
|
|
1553
|
+
n.axis === "rows" ? "columns" : "rows",
|
|
1554
|
+
n.oppositePath,
|
|
1868
1555
|
t,
|
|
1869
|
-
["rankings",
|
|
1556
|
+
["rankings", o, "oppositePath"],
|
|
1870
1557
|
!0
|
|
1871
1558
|
);
|
|
1872
1559
|
});
|
|
1873
1560
|
}
|
|
1874
|
-
const
|
|
1875
|
-
rows:
|
|
1876
|
-
measures:
|
|
1877
|
-
}),
|
|
1878
|
-
const
|
|
1879
|
-
|
|
1880
|
-
}),
|
|
1881
|
-
visible:
|
|
1882
|
-
position:
|
|
1561
|
+
const j = dt.superRefine(pt), ji = dt.extend({
|
|
1562
|
+
rows: a.array(ee).readonly(),
|
|
1563
|
+
measures: a.array(ot).readonly()
|
|
1564
|
+
}), Yi = ji.superRefine(pt), Oi = j.innerType().extend({ kind: a.literal("matrix") }), Pi = Oi.superRefine(({ kind: e, ...t }, i) => {
|
|
1565
|
+
const s = j.safeParse(t);
|
|
1566
|
+
s.success || s.error.issues.forEach((l) => i.addIssue(l));
|
|
1567
|
+
}), qi = "{member}", xe = a.object({
|
|
1568
|
+
visible: a.boolean(),
|
|
1569
|
+
position: a.enum(["before", "after"]),
|
|
1883
1570
|
/** As written; a subtotal's `{member}` becomes its member's name. */
|
|
1884
|
-
label:
|
|
1885
|
-
}).strict(),
|
|
1886
|
-
grand:
|
|
1887
|
-
levels:
|
|
1571
|
+
label: a.string().optional()
|
|
1572
|
+
}).strict(), Fe = a.object({
|
|
1573
|
+
grand: xe,
|
|
1574
|
+
levels: a.record(b, xe).readonly(),
|
|
1888
1575
|
/**
|
|
1889
1576
|
* Skip a subtotal that only repeats one row: an expanded group with
|
|
1890
1577
|
* exactly one child shows no subtotal. Off when absent.
|
|
1891
1578
|
*/
|
|
1892
|
-
skipRedundant:
|
|
1893
|
-
}).strict(),
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
})
|
|
1898
|
-
}))
|
|
1899
|
-
}).superRefine((e, t) => {
|
|
1900
|
-
var i;
|
|
1901
|
-
w(e.rules.map((a) => a.id), t, ["rules"]);
|
|
1902
|
-
for (const a of e.rules) {
|
|
1903
|
-
const o = a.condition;
|
|
1904
|
-
o.kind === "topBottom" && g(
|
|
1905
|
-
t,
|
|
1906
|
-
["rules", a.id],
|
|
1907
|
-
"Relative highlighting is deferred."
|
|
1908
|
-
), (o.kind === "dataBar" || o.kind === "colorScale") && ((o.range !== "manual" || o.min === void 0 || o.max === void 0 || o.min >= o.max) && g(
|
|
1909
|
-
t,
|
|
1910
|
-
["rules", a.id],
|
|
1911
|
-
"Explicit increasing range endpoints are required."
|
|
1912
|
-
), o.kind === "colorScale" && o.mid !== void 0 && (o.mid <= o.min || o.mid >= o.max) && g(
|
|
1913
|
-
t,
|
|
1914
|
-
["rules", a.id],
|
|
1915
|
-
"Midpoint must be inside the range."
|
|
1916
|
-
)), (i = a.style) != null && i.dataBar && g(
|
|
1917
|
-
t,
|
|
1918
|
-
["rules", a.id],
|
|
1919
|
-
"Use an explicit-range dataBar condition."
|
|
1920
|
-
);
|
|
1921
|
-
}
|
|
1922
|
-
});
|
|
1923
|
-
function kn(e, t, i, a, o = []) {
|
|
1924
|
-
for (const s of e.rules) {
|
|
1925
|
-
const l = [...o, "rules", s.id], d = s.target.matrix;
|
|
1926
|
-
d && (d.levelId !== void 0 && !t[d.axis].some((c) => c.id === d.levelId) && g(a, [...l, "target", "matrix", "levelId"], "Conditional-format level is not on the selected axis."), d.oppositePath !== void 0 && $(t, d.axis === "rows" ? "columns" : "rows", d.oppositePath, a, [...l, "target", "matrix", "oppositePath"])), nn(s).validationRefs.some((c) => !i.has(c)) && g(a, l, "Conditional rules must reference displayed measures.");
|
|
1927
|
-
}
|
|
1928
|
-
}
|
|
1929
|
-
const wn = {
|
|
1930
|
-
layout: n.discriminatedUnion("kind", [
|
|
1931
|
-
n.object({ kind: n.literal("compact") }).strict(),
|
|
1932
|
-
n.object({ kind: n.literal("tabular"), repeatLabels: n.boolean() }).strict()
|
|
1579
|
+
skipRedundant: a.boolean().optional()
|
|
1580
|
+
}).strict(), Li = {
|
|
1581
|
+
layout: a.discriminatedUnion("kind", [
|
|
1582
|
+
a.object({ kind: a.literal("compact") }).strict(),
|
|
1583
|
+
a.object({ kind: a.literal("tabular"), repeatLabels: a.boolean() }).strict()
|
|
1933
1584
|
]),
|
|
1934
|
-
absence:
|
|
1935
|
-
levelLabels:
|
|
1936
|
-
measureLabels:
|
|
1937
|
-
levelFormats:
|
|
1938
|
-
measureFormats:
|
|
1939
|
-
totals:
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
n.object({ path: F, expanded: n.boolean() }).strict()
|
|
1585
|
+
absence: a.object({ emptyText: a.string(), nullText: a.string() }).strict(),
|
|
1586
|
+
levelLabels: a.record(b, a.string()).readonly(),
|
|
1587
|
+
measureLabels: a.record(b, a.string()).readonly(),
|
|
1588
|
+
levelFormats: a.record(b, O).readonly(),
|
|
1589
|
+
measureFormats: a.record(b, O).readonly(),
|
|
1590
|
+
totals: a.object({ rows: Fe, columns: Fe }).strict()
|
|
1591
|
+
}, ge = a.object(Li).strict(), Bi = a.object({
|
|
1592
|
+
depth: a.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER),
|
|
1593
|
+
overrides: a.array(
|
|
1594
|
+
a.object({ path: A, expanded: a.boolean() }).strict()
|
|
1945
1595
|
).readonly()
|
|
1946
|
-
}).strict(),
|
|
1596
|
+
}).strict(), De = Bi.superRefine(
|
|
1947
1597
|
(e, t) => w(
|
|
1948
|
-
e.overrides.map((i) =>
|
|
1598
|
+
e.overrides.map((i) => Qe(i.path)),
|
|
1949
1599
|
t,
|
|
1950
1600
|
["overrides"]
|
|
1951
1601
|
)
|
|
1952
|
-
),
|
|
1953
|
-
(e, t) => w(e.sorts.map(
|
|
1602
|
+
), Hi = { rows: De, columns: De }, H = a.object(Hi).strict(), Vi = H.extend({ sorts: a.array(lt).readonly() }).strict(), Ui = Vi.superRefine(
|
|
1603
|
+
(e, t) => w(e.sorts.map(ut), t, ["sorts"])
|
|
1954
1604
|
);
|
|
1955
|
-
function
|
|
1956
|
-
var
|
|
1957
|
-
const { spec: i, presentation:
|
|
1605
|
+
function V(e, t) {
|
|
1606
|
+
var p, m;
|
|
1607
|
+
const { spec: i, presentation: s, defaults: l, session: n } = e, o = new Set([...i.rows, ...i.columns].map((u) => u.id)), d = new Set(i.measures.map((u) => u.id));
|
|
1958
1608
|
for (const u of [
|
|
1959
1609
|
"levelLabels",
|
|
1960
1610
|
"levelFormats",
|
|
1961
1611
|
"measureLabels",
|
|
1962
1612
|
"measureFormats"
|
|
1963
1613
|
]) {
|
|
1964
|
-
const
|
|
1965
|
-
for (const
|
|
1966
|
-
|
|
1614
|
+
const g = u.startsWith("level") ? o : d;
|
|
1615
|
+
for (const y of Object.keys(s[u]))
|
|
1616
|
+
g.has(y) || h(
|
|
1967
1617
|
t,
|
|
1968
|
-
["presentation", u,
|
|
1618
|
+
["presentation", u, y],
|
|
1969
1619
|
"Unknown presentation reference."
|
|
1970
1620
|
);
|
|
1971
1621
|
}
|
|
1972
|
-
for (const [u,
|
|
1973
|
-
|
|
1622
|
+
for (const [u, g] of Object.entries(s.measureFormats))
|
|
1623
|
+
g.type === "temporal_bucket" && h(
|
|
1974
1624
|
t,
|
|
1975
1625
|
["presentation", "measureFormats", u],
|
|
1976
1626
|
"Measures cannot own temporal bucket formats."
|
|
1977
1627
|
);
|
|
1978
|
-
for (const [u,
|
|
1979
|
-
|
|
1628
|
+
for (const [u, g] of Object.entries(s.levelFormats))
|
|
1629
|
+
g.type === "temporal_bucket" && !((p = [...i.rows, ...i.columns].find((y) => y.id === u)) != null && p.grain) && h(
|
|
1980
1630
|
t,
|
|
1981
1631
|
["presentation", "levelFormats", u],
|
|
1982
1632
|
"Temporal bucket formats require a grain."
|
|
1983
1633
|
);
|
|
1984
1634
|
for (const u of ["rows", "columns"]) {
|
|
1985
|
-
(
|
|
1986
|
-
|
|
1987
|
-
) &&
|
|
1635
|
+
(m = s.totals[u].grand.label) != null && m.includes(
|
|
1636
|
+
qi
|
|
1637
|
+
) && h(
|
|
1988
1638
|
t,
|
|
1989
1639
|
["presentation", "totals", u, "grand", "label"],
|
|
1990
1640
|
"The grand total has no member, so its label cannot use {member}."
|
|
1991
1641
|
);
|
|
1992
|
-
const
|
|
1993
|
-
(
|
|
1642
|
+
const g = Object.keys(s.totals[u].levels);
|
|
1643
|
+
(g.length !== i[u].length || g.some((y) => !i[u].some((I) => I.id === y))) && h(
|
|
1994
1644
|
t,
|
|
1995
1645
|
["presentation", "totals", u],
|
|
1996
1646
|
"Subtotal map must contain exactly the current axis levels."
|
|
1997
1647
|
);
|
|
1998
|
-
for (const
|
|
1999
|
-
for (const
|
|
2000
|
-
|
|
1648
|
+
for (const y of [l, ...n ? [n] : []])
|
|
1649
|
+
for (const I of y[u].overrides)
|
|
1650
|
+
L(
|
|
2001
1651
|
i,
|
|
2002
1652
|
u,
|
|
2003
|
-
|
|
1653
|
+
I.path,
|
|
2004
1654
|
t,
|
|
2005
1655
|
[u, "overrides"],
|
|
2006
1656
|
!0
|
|
2007
|
-
),
|
|
1657
|
+
), I.path.length || h(
|
|
2008
1658
|
t,
|
|
2009
1659
|
[u, "overrides"],
|
|
2010
1660
|
"Use depth to expand/collapse the root."
|
|
2011
1661
|
);
|
|
2012
1662
|
}
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
|
|
2017
|
-
|
|
2018
|
-
|
|
2019
|
-
)
|
|
2020
|
-
}
|
|
2021
|
-
|
|
2022
|
-
spec:
|
|
2023
|
-
presentation:
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
spec:
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
Oe.extend({
|
|
2037
|
-
mode: n.literal("layout"),
|
|
2038
|
-
format: n.enum(["csv", "xlsx", "pdf"]),
|
|
2039
|
-
expansion: n.union([
|
|
2040
|
-
K.extend({ kind: n.literal("current") }).strict(),
|
|
2041
|
-
n.object({ kind: n.literal("all") }).strict()
|
|
1663
|
+
n && ct(i, n.sorts, t, ["session", "sorts"]);
|
|
1664
|
+
}
|
|
1665
|
+
const zi = a.object({
|
|
1666
|
+
spec: j,
|
|
1667
|
+
presentation: ge,
|
|
1668
|
+
defaults: H,
|
|
1669
|
+
session: Ui.optional()
|
|
1670
|
+
}).strict(), dn = zi.superRefine(V), Gi = a.object({
|
|
1671
|
+
version: a.literal(1),
|
|
1672
|
+
spec: j,
|
|
1673
|
+
presentation: ge,
|
|
1674
|
+
defaultView: H
|
|
1675
|
+
}).strict(), Qi = Gi.superRefine(
|
|
1676
|
+
(e, t) => V({ ...e, defaults: e.defaultView }, t)
|
|
1677
|
+
), Ki = Qi.innerType().extend({
|
|
1678
|
+
spec: Yi
|
|
1679
|
+
}), un = Ki.superRefine((e, t) => V({ ...e, defaults: e.defaultView }, t)), Me = a.object({ spec: j, presentation: ge }).strict(), Xi = a.union([
|
|
1680
|
+
Me.extend({
|
|
1681
|
+
mode: a.literal("layout"),
|
|
1682
|
+
format: a.enum(["csv", "xlsx", "pdf"]),
|
|
1683
|
+
expansion: a.union([
|
|
1684
|
+
H.extend({ kind: a.literal("current") }).strict(),
|
|
1685
|
+
a.object({ kind: a.literal("all") }).strict()
|
|
2042
1686
|
])
|
|
2043
1687
|
}).strict(),
|
|
2044
|
-
|
|
2045
|
-
]),
|
|
2046
|
-
(e, t) =>
|
|
1688
|
+
Me.extend({ mode: a.literal("flat"), format: a.enum(["csv", "xlsx"]) }).strict()
|
|
1689
|
+
]), cn = Xi.superRefine(
|
|
1690
|
+
(e, t) => V(
|
|
2047
1691
|
{
|
|
2048
1692
|
...e,
|
|
2049
1693
|
defaults: e.mode === "layout" && e.expansion.kind === "current" ? e.expansion : {
|
|
@@ -2054,44 +1698,44 @@ const Mn = n.object({
|
|
|
2054
1698
|
t
|
|
2055
1699
|
)
|
|
2056
1700
|
);
|
|
2057
|
-
function
|
|
1701
|
+
function pn(e) {
|
|
2058
1702
|
return e && "id" in e ? e.id : void 0;
|
|
2059
1703
|
}
|
|
2060
|
-
const
|
|
2061
|
-
function
|
|
1704
|
+
const Zi = "SUM";
|
|
1705
|
+
function k(e) {
|
|
2062
1706
|
return typeof e == "string" && e.trim().length > 0;
|
|
2063
1707
|
}
|
|
2064
|
-
function
|
|
2065
|
-
return
|
|
1708
|
+
function T(e) {
|
|
1709
|
+
return k(e) ? e.trim().toLowerCase() : "";
|
|
2066
1710
|
}
|
|
2067
|
-
function
|
|
2068
|
-
const t =
|
|
1711
|
+
function mn(e) {
|
|
1712
|
+
const t = k(e.id) ? e.id.trim() : void 0;
|
|
2069
1713
|
if (!t) return;
|
|
2070
|
-
const i =
|
|
2071
|
-
if (!(i ===
|
|
1714
|
+
const i = T(t), s = k(e.table) ? e.table.trim() : void 0;
|
|
1715
|
+
if (!(i === T(e.name) || s && i === T(s)))
|
|
2072
1716
|
return t;
|
|
2073
1717
|
}
|
|
2074
|
-
function
|
|
2075
|
-
const t =
|
|
1718
|
+
function F(e) {
|
|
1719
|
+
const t = k(e.datasetId) ? e.datasetId.trim() : void 0;
|
|
2076
1720
|
if (t)
|
|
2077
|
-
return
|
|
1721
|
+
return T(t) === T(e.datasetName) ? void 0 : t;
|
|
2078
1722
|
}
|
|
2079
|
-
function
|
|
1723
|
+
function mt(e) {
|
|
2080
1724
|
if (e.kind !== "semantic") return e;
|
|
2081
|
-
const t =
|
|
1725
|
+
const t = F(e), { datasetId: i, ...s } = e;
|
|
2082
1726
|
return {
|
|
2083
|
-
...
|
|
1727
|
+
...s,
|
|
2084
1728
|
...t ? { datasetId: t } : {}
|
|
2085
1729
|
};
|
|
2086
1730
|
}
|
|
2087
|
-
function
|
|
2088
|
-
return e ? e.kind === "semantic" ? !!(
|
|
1731
|
+
function fn(e) {
|
|
1732
|
+
return e ? e.kind === "semantic" ? !!(k(e.domainId) && (k(e.datasetId) || k(e.datasetName))) : e.kind === "physical" ? k(e.connectionId) && k(e.tableName) : k(e.connectionId) : !1;
|
|
2089
1733
|
}
|
|
2090
|
-
function
|
|
1734
|
+
function te(e) {
|
|
2091
1735
|
if (!e)
|
|
2092
1736
|
return "";
|
|
2093
1737
|
if (e.kind === "semantic") {
|
|
2094
|
-
const t =
|
|
1738
|
+
const t = F(e);
|
|
2095
1739
|
return [
|
|
2096
1740
|
e.kind,
|
|
2097
1741
|
e.domainId,
|
|
@@ -2111,7 +1755,7 @@ function le(e) {
|
|
|
2111
1755
|
e.label || ""
|
|
2112
1756
|
].join(":");
|
|
2113
1757
|
}
|
|
2114
|
-
function
|
|
1758
|
+
function he(e, t) {
|
|
2115
1759
|
if (!e || !t)
|
|
2116
1760
|
return e === t;
|
|
2117
1761
|
if (e.kind !== t.kind)
|
|
@@ -2119,89 +1763,89 @@ function Se(e, t) {
|
|
|
2119
1763
|
if (e.kind === "semantic" && t.kind === "semantic") {
|
|
2120
1764
|
if (e.domainId !== t.domainId)
|
|
2121
1765
|
return !1;
|
|
2122
|
-
const i =
|
|
2123
|
-
return i &&
|
|
1766
|
+
const i = F(e), s = F(t);
|
|
1767
|
+
return i && s ? i === s : e.datasetName === t.datasetName;
|
|
2124
1768
|
}
|
|
2125
|
-
return
|
|
1769
|
+
return te(e) === te(t);
|
|
2126
1770
|
}
|
|
2127
|
-
function
|
|
2128
|
-
return e.kind !== "semantic" || t.kind !== "semantic" ? e :
|
|
1771
|
+
function ft(e, t) {
|
|
1772
|
+
return e.kind !== "semantic" || t.kind !== "semantic" ? e : mt({
|
|
2129
1773
|
...e,
|
|
2130
1774
|
datasetName: e.datasetName || t.datasetName,
|
|
2131
|
-
datasetId:
|
|
1775
|
+
datasetId: F(e) || F(t),
|
|
2132
1776
|
label: e.label || t.label,
|
|
2133
1777
|
connectionId: e.connectionId || t.connectionId
|
|
2134
1778
|
});
|
|
2135
1779
|
}
|
|
2136
|
-
function
|
|
1780
|
+
function gn(e) {
|
|
2137
1781
|
const t = [];
|
|
2138
1782
|
for (const i of e) {
|
|
2139
|
-
const
|
|
1783
|
+
const s = mt(
|
|
2140
1784
|
i
|
|
2141
|
-
),
|
|
2142
|
-
(
|
|
1785
|
+
), l = t.findIndex(
|
|
1786
|
+
(n) => he(n, s)
|
|
2143
1787
|
);
|
|
2144
|
-
if (
|
|
2145
|
-
t.push(
|
|
1788
|
+
if (l === -1) {
|
|
1789
|
+
t.push(s);
|
|
2146
1790
|
continue;
|
|
2147
1791
|
}
|
|
2148
|
-
t[
|
|
2149
|
-
t[
|
|
2150
|
-
|
|
1792
|
+
t[l] = ft(
|
|
1793
|
+
t[l],
|
|
1794
|
+
s
|
|
2151
1795
|
);
|
|
2152
1796
|
}
|
|
2153
1797
|
return t;
|
|
2154
1798
|
}
|
|
2155
|
-
function
|
|
2156
|
-
return e.name === t.name &&
|
|
1799
|
+
function Ji(e, t) {
|
|
1800
|
+
return e.name === t.name && he(e.source, t.source);
|
|
2157
1801
|
}
|
|
2158
|
-
function
|
|
1802
|
+
function hn(e) {
|
|
2159
1803
|
return [
|
|
2160
|
-
e.source ?
|
|
2161
|
-
|
|
1804
|
+
e.source ? te(e.source) : "unknown",
|
|
1805
|
+
gt(e),
|
|
2162
1806
|
e.name
|
|
2163
1807
|
].filter(Boolean).join(":");
|
|
2164
1808
|
}
|
|
2165
|
-
function
|
|
2166
|
-
return
|
|
2167
|
-
e.aggregate ||
|
|
1809
|
+
function gt(e) {
|
|
1810
|
+
return Wi(
|
|
1811
|
+
e.aggregate || Zi
|
|
2168
1812
|
);
|
|
2169
1813
|
}
|
|
2170
|
-
function
|
|
1814
|
+
function Wi(e) {
|
|
2171
1815
|
return e.trim().toUpperCase();
|
|
2172
1816
|
}
|
|
2173
|
-
function
|
|
1817
|
+
function _n(e, t) {
|
|
2174
1818
|
return {
|
|
2175
1819
|
...e,
|
|
2176
1820
|
label: e.label || t.label,
|
|
2177
1821
|
role: e.role || t.role,
|
|
2178
1822
|
dataType: e.dataType || t.dataType,
|
|
2179
|
-
source: e.source && t.source ?
|
|
1823
|
+
source: e.source && t.source ? ft(e.source, t.source) : e.source || t.source
|
|
2180
1824
|
};
|
|
2181
1825
|
}
|
|
2182
|
-
function
|
|
1826
|
+
function ea(e) {
|
|
2183
1827
|
for (let t = 0; t < e.length; t += 1) {
|
|
2184
1828
|
const i = e[t];
|
|
2185
1829
|
if (e.some(
|
|
2186
|
-
(
|
|
1830
|
+
(s, l) => l !== t && _t(s, i)
|
|
2187
1831
|
))
|
|
2188
1832
|
return !1;
|
|
2189
1833
|
}
|
|
2190
1834
|
return !0;
|
|
2191
1835
|
}
|
|
2192
|
-
function
|
|
2193
|
-
return
|
|
1836
|
+
function ht(e, t) {
|
|
1837
|
+
return Ji(e, t);
|
|
2194
1838
|
}
|
|
2195
|
-
function
|
|
2196
|
-
return
|
|
1839
|
+
function _t(e, t) {
|
|
1840
|
+
return ht(e, t) && C(e) === C(t);
|
|
2197
1841
|
}
|
|
2198
|
-
function
|
|
2199
|
-
return `Metric intent has duplicate measure "${e.name}" with the same aggregate (${
|
|
1842
|
+
function ta(e) {
|
|
1843
|
+
return `Metric intent has duplicate measure "${e.name}" with the same aggregate (${C(e)}). Use different aggregates to request both, or remove one entry.`;
|
|
2200
1844
|
}
|
|
2201
|
-
function
|
|
1845
|
+
function Ee(e) {
|
|
2202
1846
|
return typeof e == "string" || typeof e == "number" || typeof e == "boolean" || e === null;
|
|
2203
1847
|
}
|
|
2204
|
-
function
|
|
1848
|
+
function ia(e, t, i) {
|
|
2205
1849
|
if (e !== void 0) {
|
|
2206
1850
|
if (!e || typeof e != "object" || Array.isArray(e)) {
|
|
2207
1851
|
i.push(
|
|
@@ -2213,89 +1857,89 @@ function Yn(e, t, i) {
|
|
|
2213
1857
|
);
|
|
2214
1858
|
return;
|
|
2215
1859
|
}
|
|
2216
|
-
Object.entries(e).forEach(([
|
|
2217
|
-
if (!
|
|
1860
|
+
Object.entries(e).forEach(([s, l]) => {
|
|
1861
|
+
if (!s.trim()) {
|
|
2218
1862
|
i.push(
|
|
2219
1863
|
r(
|
|
2220
1864
|
"invalid_sql_default_parameter_name",
|
|
2221
1865
|
"SQL defaultParameters names must be non-empty strings.",
|
|
2222
|
-
`${t}.${
|
|
1866
|
+
`${t}.${s}`
|
|
2223
1867
|
)
|
|
2224
1868
|
);
|
|
2225
1869
|
return;
|
|
2226
1870
|
}
|
|
2227
|
-
(Array.isArray(
|
|
1871
|
+
(Array.isArray(l) ? l.every(Ee) : Ee(l)) || i.push(
|
|
2228
1872
|
r(
|
|
2229
1873
|
"invalid_sql_default_parameter_value",
|
|
2230
1874
|
"SQL defaultParameters values must be strings, numbers, booleans, nulls, or arrays of those scalar values.",
|
|
2231
|
-
`${t}.${
|
|
1875
|
+
`${t}.${s}`
|
|
2232
1876
|
)
|
|
2233
1877
|
);
|
|
2234
1878
|
});
|
|
2235
1879
|
}
|
|
2236
1880
|
}
|
|
2237
|
-
function
|
|
2238
|
-
return
|
|
1881
|
+
function aa(e, t) {
|
|
1882
|
+
return _e(e, t).length === 1;
|
|
2239
1883
|
}
|
|
2240
|
-
function
|
|
2241
|
-
return
|
|
1884
|
+
function na(e, t) {
|
|
1885
|
+
return _e(e, t).length === 1;
|
|
2242
1886
|
}
|
|
2243
|
-
function
|
|
1887
|
+
function _e(e, t) {
|
|
2244
1888
|
return t.filter(
|
|
2245
|
-
(
|
|
1889
|
+
(s) => sa(e, s)
|
|
2246
1890
|
);
|
|
2247
1891
|
}
|
|
2248
|
-
function
|
|
2249
|
-
return
|
|
1892
|
+
function sa(e, t) {
|
|
1893
|
+
return ra(e, t) ? e.source ? ht(t, e) : !0 : !1;
|
|
2250
1894
|
}
|
|
2251
|
-
function
|
|
2252
|
-
return !(t.name !== e.name || e.role !== void 0 && t.role !== void 0 && t.role !== e.role ||
|
|
1895
|
+
function ra(e, t) {
|
|
1896
|
+
return !(t.name !== e.name || e.role !== void 0 && t.role !== void 0 && t.role !== e.role || oa(e, t) && C(t) !== C(e));
|
|
2253
1897
|
}
|
|
2254
|
-
function
|
|
1898
|
+
function oa(e, t) {
|
|
2255
1899
|
return e.role === "measure" || t.role === "measure" || e.aggregate !== void 0 || t.aggregate !== void 0;
|
|
2256
1900
|
}
|
|
2257
|
-
function
|
|
2258
|
-
return
|
|
1901
|
+
function C(e) {
|
|
1902
|
+
return gt(e);
|
|
2259
1903
|
}
|
|
2260
|
-
const
|
|
2261
|
-
function
|
|
1904
|
+
const la = /^(\d{4})-(\d{2})-(\d{2})$/, yt = /^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2})(?::(\d{2})(?:\.(\d+))?)?(Z|[+-]\d{2}:\d{2})$/;
|
|
1905
|
+
function ie(e) {
|
|
2262
1906
|
if (typeof e != "string")
|
|
2263
1907
|
return null;
|
|
2264
|
-
const t = e.trim(), i =
|
|
1908
|
+
const t = e.trim(), i = la.exec(t);
|
|
2265
1909
|
if (i) {
|
|
2266
|
-
const [,
|
|
2267
|
-
return
|
|
1910
|
+
const [, y, I, S] = i;
|
|
1911
|
+
return Te(y, I, S) ? new Date(Date.UTC(Number(y), Number(I) - 1, Number(S))) : null;
|
|
2268
1912
|
}
|
|
2269
|
-
const
|
|
2270
|
-
if (!
|
|
1913
|
+
const s = yt.exec(t);
|
|
1914
|
+
if (!s)
|
|
2271
1915
|
return null;
|
|
2272
|
-
const [,
|
|
2273
|
-
if (!
|
|
1916
|
+
const [, l, n, o, d, p, m = "00", , u] = s;
|
|
1917
|
+
if (!Te(l, n, o) || !N(d, 0, 23) || !N(p, 0, 59) || !N(m, 0, 59) || !da(u))
|
|
2274
1918
|
return null;
|
|
2275
|
-
const
|
|
2276
|
-
return Number.isFinite(
|
|
1919
|
+
const g = new Date(t);
|
|
1920
|
+
return Number.isFinite(g.getTime()) ? g : null;
|
|
2277
1921
|
}
|
|
2278
|
-
function
|
|
2279
|
-
return typeof e != "string" || !
|
|
1922
|
+
function yn(e) {
|
|
1923
|
+
return typeof e != "string" || !yt.test(e.trim()) ? null : ie(e);
|
|
2280
1924
|
}
|
|
2281
|
-
function
|
|
2282
|
-
const
|
|
2283
|
-
if (!Number.isInteger(
|
|
1925
|
+
function Te(e, t, i) {
|
|
1926
|
+
const s = Number(e), l = Number(t), n = Number(i);
|
|
1927
|
+
if (!Number.isInteger(s) || !Number.isInteger(l) || !Number.isInteger(n) || l < 1 || l > 12)
|
|
2284
1928
|
return !1;
|
|
2285
|
-
const
|
|
2286
|
-
return
|
|
1929
|
+
const o = new Date(Date.UTC(s, l - 1, n));
|
|
1930
|
+
return o.getUTCFullYear() === s && o.getUTCMonth() === l - 1 && o.getUTCDate() === n;
|
|
2287
1931
|
}
|
|
2288
|
-
function
|
|
2289
|
-
const
|
|
2290
|
-
return Number.isInteger(
|
|
1932
|
+
function N(e, t, i) {
|
|
1933
|
+
const s = Number(e);
|
|
1934
|
+
return Number.isInteger(s) && s >= t && s <= i;
|
|
2291
1935
|
}
|
|
2292
|
-
function
|
|
1936
|
+
function da(e) {
|
|
2293
1937
|
if (e === "Z")
|
|
2294
1938
|
return !0;
|
|
2295
1939
|
const t = /^([+-])(\d{2}):(\d{2})$/.exec(e);
|
|
2296
|
-
return !!(t &&
|
|
1940
|
+
return !!(t && N(t[2], 0, 23) && N(t[3], 0, 59));
|
|
2297
1941
|
}
|
|
2298
|
-
function
|
|
1942
|
+
function Ne(e, t, i) {
|
|
2299
1943
|
if (e !== void 0) {
|
|
2300
1944
|
if (!f(e)) {
|
|
2301
1945
|
i.push(
|
|
@@ -2322,7 +1966,7 @@ function qe(e, t, i) {
|
|
|
2322
1966
|
);
|
|
2323
1967
|
}
|
|
2324
1968
|
}
|
|
2325
|
-
function
|
|
1969
|
+
function Re(e) {
|
|
2326
1970
|
const t = /* @__PURE__ */ new Set();
|
|
2327
1971
|
for (const i of e) {
|
|
2328
1972
|
if (t.has(i))
|
|
@@ -2331,7 +1975,7 @@ function Le(e) {
|
|
|
2331
1975
|
}
|
|
2332
1976
|
return null;
|
|
2333
1977
|
}
|
|
2334
|
-
function
|
|
1978
|
+
function ua(e, t, i) {
|
|
2335
1979
|
if (!f(e)) {
|
|
2336
1980
|
i.push(
|
|
2337
1981
|
r(
|
|
@@ -2342,7 +1986,7 @@ function Gn(e, t, i) {
|
|
|
2342
1986
|
);
|
|
2343
1987
|
return;
|
|
2344
1988
|
}
|
|
2345
|
-
|
|
1989
|
+
c(e.inputId) || i.push(
|
|
2346
1990
|
r(
|
|
2347
1991
|
"invalid_input_binding",
|
|
2348
1992
|
"Input bindings need a non-empty inputId.",
|
|
@@ -2354,13 +1998,13 @@ function Gn(e, t, i) {
|
|
|
2354
1998
|
"Input binding kind must be filter or control.",
|
|
2355
1999
|
`${t}.kind`
|
|
2356
2000
|
)
|
|
2357
|
-
), e.field !== void 0 &&
|
|
2001
|
+
), e.field !== void 0 && _(e.field, `${t}.field`, i), e.relationshipHint !== void 0 && ye(
|
|
2358
2002
|
e.relationshipHint,
|
|
2359
2003
|
`${t}.relationshipHint`,
|
|
2360
2004
|
i
|
|
2361
2005
|
);
|
|
2362
2006
|
}
|
|
2363
|
-
function
|
|
2007
|
+
function ye(e, t, i) {
|
|
2364
2008
|
if (!f(e)) {
|
|
2365
2009
|
i.push(
|
|
2366
2010
|
r(
|
|
@@ -2371,7 +2015,7 @@ function we(e, t, i) {
|
|
|
2371
2015
|
);
|
|
2372
2016
|
return;
|
|
2373
2017
|
}
|
|
2374
|
-
e.relationshipIds !== void 0 && (!Array.isArray(e.relationshipIds) || e.relationshipIds.some((
|
|
2018
|
+
e.relationshipIds !== void 0 && (!Array.isArray(e.relationshipIds) || e.relationshipIds.some((s) => !c(s))) && i.push(
|
|
2375
2019
|
r(
|
|
2376
2020
|
"invalid_relationship_hint",
|
|
2377
2021
|
"Relationship hint relationshipIds must be non-empty strings.",
|
|
@@ -2379,15 +2023,15 @@ function we(e, t, i) {
|
|
|
2379
2023
|
)
|
|
2380
2024
|
);
|
|
2381
2025
|
}
|
|
2382
|
-
function
|
|
2383
|
-
var
|
|
2384
|
-
if (((
|
|
2026
|
+
function ca(e, t) {
|
|
2027
|
+
var s, l;
|
|
2028
|
+
if (((s = e.source) == null ? void 0 : s.kind) !== "semantic" && ((l = e.source) == null ? void 0 : l.kind) !== "physical" && t.push(
|
|
2385
2029
|
r(
|
|
2386
2030
|
"invalid_input_options_source",
|
|
2387
2031
|
"Input options must use a semantic or physical source.",
|
|
2388
2032
|
"source"
|
|
2389
2033
|
)
|
|
2390
|
-
),
|
|
2034
|
+
), c(e.inputId) || t.push(
|
|
2391
2035
|
r(
|
|
2392
2036
|
"missing_input_options_input_id",
|
|
2393
2037
|
"Input options intent needs the inputId it populates.",
|
|
@@ -2400,9 +2044,9 @@ function Qn(e, t) {
|
|
|
2400
2044
|
"search"
|
|
2401
2045
|
)
|
|
2402
2046
|
), e.matchValues !== void 0) {
|
|
2403
|
-
const
|
|
2404
|
-
|
|
2405
|
-
r("invalid_input_options_match_values",
|
|
2047
|
+
const n = Et(e.matchValues);
|
|
2048
|
+
n.ok || t.push(
|
|
2049
|
+
r("invalid_input_options_match_values", n.error, "matchValues")
|
|
2406
2050
|
), typeof e.search == "string" && e.search.trim() && t.push(
|
|
2407
2051
|
r(
|
|
2408
2052
|
"invalid_input_options_match_values",
|
|
@@ -2417,26 +2061,26 @@ function Qn(e, t) {
|
|
|
2417
2061
|
"Input options limit must be a positive finite number.",
|
|
2418
2062
|
"limit"
|
|
2419
2063
|
)
|
|
2420
|
-
), (!e.labelField || !
|
|
2064
|
+
), (!e.labelField || !c(e.labelField.name)) && t.push(
|
|
2421
2065
|
r(
|
|
2422
2066
|
"missing_input_options_label_field",
|
|
2423
2067
|
"Input options intent needs a labelField.",
|
|
2424
2068
|
"labelField"
|
|
2425
2069
|
)
|
|
2426
|
-
),
|
|
2070
|
+
), _(e.labelField, "labelField", t, {
|
|
2427
2071
|
required: !0
|
|
2428
|
-
}), (!e.valueField || !
|
|
2072
|
+
}), (!e.valueField || !c(e.valueField.name)) && t.push(
|
|
2429
2073
|
r(
|
|
2430
2074
|
"missing_input_options_value_field",
|
|
2431
2075
|
"Input options intent needs a valueField.",
|
|
2432
2076
|
"valueField"
|
|
2433
2077
|
)
|
|
2434
|
-
),
|
|
2078
|
+
), _(e.valueField, "valueField", t, {
|
|
2435
2079
|
required: !0
|
|
2436
|
-
}), e.searchField !== void 0 &&
|
|
2080
|
+
}), e.searchField !== void 0 && _(e.searchField, "searchField", t, {
|
|
2437
2081
|
required: !0
|
|
2438
|
-
}), e.disambiguationFields !== void 0 && (Array.isArray(e.disambiguationFields) ? e.disambiguationFields.forEach((
|
|
2439
|
-
|
|
2082
|
+
}), e.disambiguationFields !== void 0 && (Array.isArray(e.disambiguationFields) ? e.disambiguationFields.forEach((n, o) => {
|
|
2083
|
+
_(n, `disambiguationFields.${o}`, t, {
|
|
2440
2084
|
required: !0
|
|
2441
2085
|
});
|
|
2442
2086
|
}) : t.push(
|
|
@@ -2449,27 +2093,27 @@ function Qn(e, t) {
|
|
|
2449
2093
|
{ field: e.labelField, path: "labelField" },
|
|
2450
2094
|
{ field: e.valueField, path: "valueField" },
|
|
2451
2095
|
...e.searchField ? [{ field: e.searchField, path: "searchField" }] : [],
|
|
2452
|
-
...Array.isArray(e.disambiguationFields) ? e.disambiguationFields.map((
|
|
2453
|
-
field:
|
|
2454
|
-
path: `disambiguationFields.${
|
|
2096
|
+
...Array.isArray(e.disambiguationFields) ? e.disambiguationFields.map((n, o) => ({
|
|
2097
|
+
field: n,
|
|
2098
|
+
path: `disambiguationFields.${o}`
|
|
2455
2099
|
})) : []
|
|
2456
|
-
].forEach(({ field:
|
|
2457
|
-
|
|
2100
|
+
].forEach(({ field: n, path: o }) => {
|
|
2101
|
+
n != null && n.source && !he(n.source, e.source) && t.push(
|
|
2458
2102
|
r(
|
|
2459
2103
|
"input_options_field_source_mismatch",
|
|
2460
2104
|
"Input option fields must belong to the declared option source.",
|
|
2461
|
-
`${
|
|
2105
|
+
`${o}.source`
|
|
2462
2106
|
)
|
|
2463
2107
|
);
|
|
2464
2108
|
}), e.dependencies !== void 0) {
|
|
2465
|
-
const
|
|
2109
|
+
const n = ma(
|
|
2466
2110
|
e.dependencies
|
|
2467
2111
|
);
|
|
2468
|
-
t.push(...
|
|
2112
|
+
t.push(...n.errors), n.ok && ga(e, t);
|
|
2469
2113
|
}
|
|
2470
2114
|
if (e.population !== void 0) {
|
|
2471
|
-
const
|
|
2472
|
-
if (!f(
|
|
2115
|
+
const n = e.population;
|
|
2116
|
+
if (!f(n))
|
|
2473
2117
|
t.push(
|
|
2474
2118
|
r(
|
|
2475
2119
|
"invalid_input_options_population",
|
|
@@ -2478,38 +2122,38 @@ function Qn(e, t) {
|
|
|
2478
2122
|
)
|
|
2479
2123
|
);
|
|
2480
2124
|
else {
|
|
2481
|
-
const
|
|
2482
|
-
|
|
2125
|
+
const o = n.kind;
|
|
2126
|
+
o !== "option_source" && o !== "related_population" && t.push(
|
|
2483
2127
|
r(
|
|
2484
2128
|
"invalid_input_options_population",
|
|
2485
2129
|
"Input options population kind must be option_source or related_population.",
|
|
2486
2130
|
"population.kind"
|
|
2487
2131
|
)
|
|
2488
|
-
),
|
|
2132
|
+
), o === "option_source" && n.baseSource !== void 0 && t.push(
|
|
2489
2133
|
r(
|
|
2490
2134
|
"invalid_input_options_population",
|
|
2491
2135
|
"Input options population baseSource is only valid for related_population.",
|
|
2492
2136
|
"population.baseSource"
|
|
2493
2137
|
)
|
|
2494
|
-
),
|
|
2138
|
+
), o === "option_source" && n.relationshipHint !== void 0 && t.push(
|
|
2495
2139
|
r(
|
|
2496
2140
|
"invalid_input_options_population",
|
|
2497
2141
|
"Input options population relationshipHint is only valid for related_population.",
|
|
2498
2142
|
"population.relationshipHint"
|
|
2499
2143
|
)
|
|
2500
|
-
),
|
|
2501
|
-
|
|
2144
|
+
), o === "related_population" && (se(
|
|
2145
|
+
n.baseSource,
|
|
2502
2146
|
"population.baseSource",
|
|
2503
2147
|
t
|
|
2504
|
-
),
|
|
2505
|
-
|
|
2148
|
+
), n.relationshipHint !== void 0 && ye(
|
|
2149
|
+
n.relationshipHint,
|
|
2506
2150
|
"population.relationshipHint",
|
|
2507
2151
|
t
|
|
2508
2152
|
));
|
|
2509
2153
|
}
|
|
2510
2154
|
}
|
|
2511
2155
|
}
|
|
2512
|
-
function
|
|
2156
|
+
function pa(e, t) {
|
|
2513
2157
|
if (!(!("inputs" in e) || e.inputs === void 0)) {
|
|
2514
2158
|
if (!Array.isArray(e.inputs)) {
|
|
2515
2159
|
t.push(
|
|
@@ -2522,11 +2166,11 @@ function Kn(e, t) {
|
|
|
2522
2166
|
return;
|
|
2523
2167
|
}
|
|
2524
2168
|
e.inputs.forEach(
|
|
2525
|
-
(i,
|
|
2169
|
+
(i, s) => ua(i, `inputs.${s}`, t)
|
|
2526
2170
|
);
|
|
2527
2171
|
}
|
|
2528
2172
|
}
|
|
2529
|
-
function
|
|
2173
|
+
function ma(e, t = "protocol") {
|
|
2530
2174
|
const i = [];
|
|
2531
2175
|
if (!f(e))
|
|
2532
2176
|
return i.push(
|
|
@@ -2536,39 +2180,39 @@ function Xn(e, t = "protocol") {
|
|
|
2536
2180
|
"dependencies"
|
|
2537
2181
|
)
|
|
2538
2182
|
), { ok: !1, errors: i, warnings: [] };
|
|
2539
|
-
const
|
|
2540
|
-
if (
|
|
2183
|
+
const s = e, l = s.mode;
|
|
2184
|
+
if (l !== void 0 && l !== "independent" && l !== "explicit" && l !== "all_applicable" && i.push(
|
|
2541
2185
|
r(
|
|
2542
2186
|
"invalid_input_options_dependencies",
|
|
2543
2187
|
"Input options dependencies mode must be independent, explicit, or all_applicable.",
|
|
2544
2188
|
"dependencies.mode"
|
|
2545
2189
|
)
|
|
2546
|
-
),
|
|
2547
|
-
|
|
2190
|
+
), K(
|
|
2191
|
+
s.includeInputIds,
|
|
2548
2192
|
"dependencies.includeInputIds",
|
|
2549
2193
|
i,
|
|
2550
2194
|
"Input options includeInputIds must be non-empty strings."
|
|
2551
|
-
),
|
|
2552
|
-
|
|
2195
|
+
), K(
|
|
2196
|
+
s.excludeInputIds,
|
|
2553
2197
|
"dependencies.excludeInputIds",
|
|
2554
2198
|
i,
|
|
2555
2199
|
"Input options excludeInputIds must be non-empty strings."
|
|
2556
|
-
),
|
|
2200
|
+
), l === "all_applicable" && s.includeInputIds !== void 0 && i.push(
|
|
2557
2201
|
r(
|
|
2558
2202
|
"invalid_input_options_dependencies",
|
|
2559
2203
|
"All applicable dependencies cannot specify includeInputIds.",
|
|
2560
2204
|
"dependencies.includeInputIds"
|
|
2561
2205
|
)
|
|
2562
|
-
),
|
|
2563
|
-
|
|
2206
|
+
), K(
|
|
2207
|
+
s.omitInputIds,
|
|
2564
2208
|
"dependencies.omitInputIds",
|
|
2565
2209
|
i,
|
|
2566
2210
|
"Input options omitInputIds must be non-empty strings."
|
|
2567
|
-
), Array.isArray(
|
|
2568
|
-
const
|
|
2569
|
-
Array.isArray(
|
|
2211
|
+
), Array.isArray(s.omitInputIds)) {
|
|
2212
|
+
const n = new Set(
|
|
2213
|
+
Array.isArray(s.includeInputIds) ? s.includeInputIds : []
|
|
2570
2214
|
);
|
|
2571
|
-
(
|
|
2215
|
+
(l !== "explicit" || new Set(s.omitInputIds).size !== s.omitInputIds.length || s.omitInputIds.some((o) => !n.has(o))) && i.push(
|
|
2572
2216
|
r(
|
|
2573
2217
|
"invalid_input_options_dependencies",
|
|
2574
2218
|
"A browse override may only omit unique ids from an explicit includeInputIds list.",
|
|
@@ -2576,10 +2220,10 @@ function Xn(e, t = "protocol") {
|
|
|
2576
2220
|
)
|
|
2577
2221
|
);
|
|
2578
2222
|
}
|
|
2579
|
-
return t === "dashboard" &&
|
|
2223
|
+
return t === "dashboard" && fa(s, i), { ok: i.length === 0, errors: i, warnings: [] };
|
|
2580
2224
|
}
|
|
2581
|
-
function
|
|
2582
|
-
const { mode: i, includeInputIds:
|
|
2225
|
+
function fa(e, t) {
|
|
2226
|
+
const { mode: i, includeInputIds: s, excludeInputIds: l } = e;
|
|
2583
2227
|
i === void 0 && t.push(
|
|
2584
2228
|
r(
|
|
2585
2229
|
"invalid_input_options_dependencies",
|
|
@@ -2587,24 +2231,24 @@ function Wn(e, t) {
|
|
|
2587
2231
|
"dependencies.mode"
|
|
2588
2232
|
)
|
|
2589
2233
|
);
|
|
2590
|
-
for (const [
|
|
2591
|
-
["dependencies.includeInputIds",
|
|
2592
|
-
["dependencies.excludeInputIds",
|
|
2234
|
+
for (const [n, o] of [
|
|
2235
|
+
["dependencies.includeInputIds", s],
|
|
2236
|
+
["dependencies.excludeInputIds", l]
|
|
2593
2237
|
])
|
|
2594
|
-
Array.isArray(
|
|
2238
|
+
Array.isArray(o) && new Set(o).size !== o.length && t.push(
|
|
2595
2239
|
r(
|
|
2596
2240
|
"invalid_input_options_dependencies",
|
|
2597
2241
|
"Dashboard option dependency input IDs must be unique.",
|
|
2598
|
-
|
|
2242
|
+
n
|
|
2599
2243
|
)
|
|
2600
2244
|
);
|
|
2601
|
-
i === "independent" && (
|
|
2245
|
+
i === "independent" && (s !== void 0 || l !== void 0) && t.push(
|
|
2602
2246
|
r(
|
|
2603
2247
|
"invalid_input_options_dependencies",
|
|
2604
2248
|
"Independent dashboard dependencies cannot specify input IDs.",
|
|
2605
2249
|
"dependencies"
|
|
2606
2250
|
)
|
|
2607
|
-
), i === "explicit" && (!Array.isArray(
|
|
2251
|
+
), i === "explicit" && (!Array.isArray(s) || s.length === 0 || l !== void 0) && t.push(
|
|
2608
2252
|
r(
|
|
2609
2253
|
"invalid_input_options_dependencies",
|
|
2610
2254
|
"Explicit dashboard dependencies require included input IDs and cannot specify exclusions.",
|
|
@@ -2612,20 +2256,20 @@ function Wn(e, t) {
|
|
|
2612
2256
|
)
|
|
2613
2257
|
);
|
|
2614
2258
|
}
|
|
2615
|
-
function
|
|
2616
|
-
var
|
|
2259
|
+
function ga(e, t) {
|
|
2260
|
+
var l, n, o;
|
|
2617
2261
|
const i = new Set(
|
|
2618
2262
|
Array.isArray(e.inputs) ? e.inputs.map((d) => f(d) ? d.inputId : void 0).filter((d) => typeof d == "string") : []
|
|
2619
|
-
),
|
|
2620
|
-
for (const d of ((
|
|
2621
|
-
!i.has(d) && !
|
|
2263
|
+
), s = new Set(((l = e.dependencies) == null ? void 0 : l.omitInputIds) || []);
|
|
2264
|
+
for (const d of ((n = e.dependencies) == null ? void 0 : n.includeInputIds) || [])
|
|
2265
|
+
!i.has(d) && !s.has(d) && t.push(
|
|
2622
2266
|
r(
|
|
2623
2267
|
"invalid_input_options_dependencies",
|
|
2624
2268
|
`Input options dependency "${d}" is not declared in inputs.`,
|
|
2625
2269
|
"dependencies.includeInputIds"
|
|
2626
2270
|
)
|
|
2627
2271
|
);
|
|
2628
|
-
for (const d of ((
|
|
2272
|
+
for (const d of ((o = e.dependencies) == null ? void 0 : o.excludeInputIds) || [])
|
|
2629
2273
|
d !== e.inputId && !i.has(d) && t.push(
|
|
2630
2274
|
r(
|
|
2631
2275
|
"invalid_input_options_dependencies",
|
|
@@ -2634,11 +2278,11 @@ function Zn(e, t) {
|
|
|
2634
2278
|
)
|
|
2635
2279
|
);
|
|
2636
2280
|
}
|
|
2637
|
-
function
|
|
2638
|
-
e !== void 0 && (!Array.isArray(e) || e.some((
|
|
2281
|
+
function K(e, t, i, s) {
|
|
2282
|
+
e !== void 0 && (!Array.isArray(e) || e.some((l) => !c(l))) && i.push(r("invalid_input_options_dependencies", s, t));
|
|
2639
2283
|
}
|
|
2640
|
-
const
|
|
2641
|
-
function
|
|
2284
|
+
const ha = new Set(Ye);
|
|
2285
|
+
function _a(e, t, i) {
|
|
2642
2286
|
if (f(e) && e.type === "temporal_bucket") {
|
|
2643
2287
|
i.push(
|
|
2644
2288
|
r(
|
|
@@ -2649,9 +2293,9 @@ function ea(e, t, i) {
|
|
|
2649
2293
|
);
|
|
2650
2294
|
return;
|
|
2651
2295
|
}
|
|
2652
|
-
|
|
2296
|
+
Pe(e, t, i);
|
|
2653
2297
|
}
|
|
2654
|
-
function
|
|
2298
|
+
function $e(e, t, i) {
|
|
2655
2299
|
if (!f(e)) {
|
|
2656
2300
|
i.push(
|
|
2657
2301
|
r(
|
|
@@ -2662,8 +2306,8 @@ function Be(e, t, i) {
|
|
|
2662
2306
|
);
|
|
2663
2307
|
return;
|
|
2664
2308
|
}
|
|
2665
|
-
const
|
|
2666
|
-
if (
|
|
2309
|
+
const s = c(e.columnKey), l = f(e.field);
|
|
2310
|
+
if (s === l) {
|
|
2667
2311
|
i.push(
|
|
2668
2312
|
r(
|
|
2669
2313
|
"invalid_result_column_ref",
|
|
@@ -2673,11 +2317,11 @@ function Be(e, t, i) {
|
|
|
2673
2317
|
);
|
|
2674
2318
|
return;
|
|
2675
2319
|
}
|
|
2676
|
-
|
|
2320
|
+
l && _(e.field, `${t}.field`, i, {
|
|
2677
2321
|
required: !0
|
|
2678
2322
|
});
|
|
2679
2323
|
}
|
|
2680
|
-
function
|
|
2324
|
+
function ya(e, t, i) {
|
|
2681
2325
|
if (!f(e)) {
|
|
2682
2326
|
i.push(
|
|
2683
2327
|
r(
|
|
@@ -2688,21 +2332,21 @@ function ta(e, t, i) {
|
|
|
2688
2332
|
);
|
|
2689
2333
|
return;
|
|
2690
2334
|
}
|
|
2691
|
-
|
|
2335
|
+
c(e.key) || i.push(
|
|
2692
2336
|
r(
|
|
2693
2337
|
"invalid_result_calculation_output",
|
|
2694
2338
|
"Result calculation output needs a stable key.",
|
|
2695
2339
|
`${t}.key`
|
|
2696
2340
|
)
|
|
2697
|
-
), e.dataType !== void 0 && (typeof e.dataType != "string" || !
|
|
2341
|
+
), e.dataType !== void 0 && (typeof e.dataType != "string" || !Oe.has(e.dataType)) && i.push(
|
|
2698
2342
|
r(
|
|
2699
2343
|
"invalid_result_calculation_output",
|
|
2700
2344
|
"Result calculation output dataType must be string, number, boolean, date, datetime, or unknown.",
|
|
2701
2345
|
`${t}.dataType`
|
|
2702
2346
|
)
|
|
2703
|
-
),
|
|
2347
|
+
), _a(e.format, `${t}.format`, i);
|
|
2704
2348
|
}
|
|
2705
|
-
function
|
|
2349
|
+
function ba(e, t) {
|
|
2706
2350
|
if (e.analysis === void 0)
|
|
2707
2351
|
return;
|
|
2708
2352
|
if (!f(e.analysis)) {
|
|
@@ -2745,17 +2389,17 @@ function ia(e, t) {
|
|
|
2745
2389
|
)
|
|
2746
2390
|
);
|
|
2747
2391
|
const { timeWindow: i } = e.analysis;
|
|
2748
|
-
i !== void 0 &&
|
|
2749
|
-
}
|
|
2750
|
-
const
|
|
2751
|
-
|
|
2752
|
-
),
|
|
2753
|
-
|
|
2754
|
-
),
|
|
2755
|
-
|
|
2392
|
+
i !== void 0 && ae(i, "analysis.timeWindow", t);
|
|
2393
|
+
}
|
|
2394
|
+
const va = new Set(
|
|
2395
|
+
Tt
|
|
2396
|
+
), Ia = new Set(
|
|
2397
|
+
Nt
|
|
2398
|
+
), Sa = new Set(
|
|
2399
|
+
Rt
|
|
2756
2400
|
);
|
|
2757
|
-
function
|
|
2758
|
-
|
|
2401
|
+
function ka(e, t, i) {
|
|
2402
|
+
va.has(e.unit) || i.push(
|
|
2759
2403
|
r(
|
|
2760
2404
|
"invalid_time_window",
|
|
2761
2405
|
"Calendar time window unit must be one of: day, week, month, quarter, year.",
|
|
@@ -2781,7 +2425,7 @@ function oa(e, t, i) {
|
|
|
2781
2425
|
)
|
|
2782
2426
|
);
|
|
2783
2427
|
}
|
|
2784
|
-
function
|
|
2428
|
+
function ae(e, t, i) {
|
|
2785
2429
|
if (!f(e)) {
|
|
2786
2430
|
i.push(
|
|
2787
2431
|
r(
|
|
@@ -2799,37 +2443,37 @@ function ue(e, t, i) {
|
|
|
2799
2443
|
`${t}.kind`
|
|
2800
2444
|
)
|
|
2801
2445
|
), e.kind === "calendar") {
|
|
2802
|
-
|
|
2446
|
+
ka(e, t, i);
|
|
2803
2447
|
return;
|
|
2804
2448
|
}
|
|
2805
2449
|
if (e.kind === "absolute") {
|
|
2806
|
-
if (
|
|
2450
|
+
if (c(e.start) || i.push(
|
|
2807
2451
|
r(
|
|
2808
2452
|
"invalid_time_window",
|
|
2809
2453
|
"Absolute time window start must be a non-empty ISO date or timestamp string.",
|
|
2810
2454
|
`${t}.start`
|
|
2811
2455
|
)
|
|
2812
|
-
),
|
|
2456
|
+
), c(e.end) || i.push(
|
|
2813
2457
|
r(
|
|
2814
2458
|
"invalid_time_window",
|
|
2815
2459
|
"Absolute time window end must be a non-empty ISO date or timestamp string.",
|
|
2816
2460
|
`${t}.end`
|
|
2817
2461
|
)
|
|
2818
|
-
),
|
|
2819
|
-
const
|
|
2820
|
-
|
|
2462
|
+
), c(e.start) && c(e.end)) {
|
|
2463
|
+
const s = ie(e.start), l = ie(e.end);
|
|
2464
|
+
s || i.push(
|
|
2821
2465
|
r(
|
|
2822
2466
|
"invalid_time_window",
|
|
2823
2467
|
"Absolute time window start must be a valid ISO date or timestamp.",
|
|
2824
2468
|
`${t}.start`
|
|
2825
2469
|
)
|
|
2826
|
-
),
|
|
2470
|
+
), l || i.push(
|
|
2827
2471
|
r(
|
|
2828
2472
|
"invalid_time_window",
|
|
2829
2473
|
"Absolute time window end must be a valid ISO date or timestamp.",
|
|
2830
2474
|
`${t}.end`
|
|
2831
2475
|
)
|
|
2832
|
-
),
|
|
2476
|
+
), s && l && s.getTime() > l.getTime() && i.push(
|
|
2833
2477
|
r(
|
|
2834
2478
|
"invalid_time_window",
|
|
2835
2479
|
"Absolute time window start must be before or equal to end.",
|
|
@@ -2839,10 +2483,10 @@ function ue(e, t, i) {
|
|
|
2839
2483
|
}
|
|
2840
2484
|
return;
|
|
2841
2485
|
}
|
|
2842
|
-
(typeof e.unit != "string" || !
|
|
2486
|
+
(typeof e.unit != "string" || !ha.has(e.unit)) && i.push(
|
|
2843
2487
|
r(
|
|
2844
2488
|
"invalid_time_window",
|
|
2845
|
-
`Time window unit must be one of: ${
|
|
2489
|
+
`Time window unit must be one of: ${Ye.join(", ")}.`,
|
|
2846
2490
|
`${t}.unit`
|
|
2847
2491
|
)
|
|
2848
2492
|
), (typeof e.value != "number" || !Number.isFinite(e.value) || e.value <= 0) && i.push(
|
|
@@ -2851,13 +2495,13 @@ function ue(e, t, i) {
|
|
|
2851
2495
|
"Time window value must be a positive number.",
|
|
2852
2496
|
`${t}.value`
|
|
2853
2497
|
)
|
|
2854
|
-
), e.anchor !== void 0 && !
|
|
2498
|
+
), e.anchor !== void 0 && !Ia.has(e.anchor) && i.push(
|
|
2855
2499
|
r(
|
|
2856
2500
|
"invalid_time_window",
|
|
2857
2501
|
"Time window anchor must be now or latest_available.",
|
|
2858
2502
|
`${t}.anchor`
|
|
2859
2503
|
)
|
|
2860
|
-
), e.completeness !== void 0 && !
|
|
2504
|
+
), e.completeness !== void 0 && !Sa.has(e.completeness) && i.push(
|
|
2861
2505
|
r(
|
|
2862
2506
|
"invalid_time_window",
|
|
2863
2507
|
"Time window completeness must be include_partial or complete_periods.",
|
|
@@ -2865,7 +2509,7 @@ function ue(e, t, i) {
|
|
|
2865
2509
|
)
|
|
2866
2510
|
);
|
|
2867
2511
|
}
|
|
2868
|
-
function
|
|
2512
|
+
function ne(e, t, i) {
|
|
2869
2513
|
if (e !== void 0) {
|
|
2870
2514
|
if (!Array.isArray(e)) {
|
|
2871
2515
|
i.push(
|
|
@@ -2877,92 +2521,92 @@ function ce(e, t, i) {
|
|
|
2877
2521
|
);
|
|
2878
2522
|
return;
|
|
2879
2523
|
}
|
|
2880
|
-
e.forEach((
|
|
2881
|
-
var
|
|
2882
|
-
const
|
|
2883
|
-
if (!f(
|
|
2524
|
+
e.forEach((s, l) => {
|
|
2525
|
+
var p;
|
|
2526
|
+
const n = `${t}.${l}`;
|
|
2527
|
+
if (!f(s)) {
|
|
2884
2528
|
i.push(
|
|
2885
2529
|
r(
|
|
2886
2530
|
"invalid_analytics_filter",
|
|
2887
2531
|
"Analytics filter must be a structured object.",
|
|
2888
|
-
|
|
2532
|
+
n
|
|
2889
2533
|
)
|
|
2890
2534
|
);
|
|
2891
2535
|
return;
|
|
2892
2536
|
}
|
|
2893
|
-
const
|
|
2894
|
-
|
|
2537
|
+
const o = s;
|
|
2538
|
+
_(o.field, `${n}.field`, i, {
|
|
2895
2539
|
required: !0
|
|
2896
|
-
}),
|
|
2540
|
+
}), o.scope !== void 0 && o.scope !== "row" && o.scope !== "aggregate" && i.push(
|
|
2897
2541
|
r(
|
|
2898
2542
|
"invalid_analytics_filter_scope",
|
|
2899
2543
|
"Analytics filter scope must be row or aggregate.",
|
|
2900
|
-
`${
|
|
2544
|
+
`${n}.scope`
|
|
2901
2545
|
)
|
|
2902
|
-
),
|
|
2546
|
+
), o.scope === "aggregate" && ((p = o.field) == null ? void 0 : p.role) !== void 0 && o.field.role !== "measure" && i.push(
|
|
2903
2547
|
r(
|
|
2904
2548
|
"invalid_analytics_filter_scope",
|
|
2905
2549
|
"Aggregate-scope analytics filters must target a measure field.",
|
|
2906
|
-
`${
|
|
2550
|
+
`${n}.scope`
|
|
2907
2551
|
)
|
|
2908
2552
|
);
|
|
2909
|
-
const d =
|
|
2910
|
-
if (
|
|
2553
|
+
const d = o.operator === "is_null" || o.operator === "is_not_null";
|
|
2554
|
+
if (o.operator !== void 0 && o.operator !== "=" && o.operator !== "!=" && o.operator !== "in" && o.operator !== "not_in" && o.operator !== "contains" && o.operator !== "not_contains" && o.operator !== "between" && o.operator !== "not_between" && o.operator !== ">" && o.operator !== ">=" && o.operator !== "<" && o.operator !== "<=" && o.operator !== "is_null" && o.operator !== "is_not_null" && i.push(
|
|
2911
2555
|
r(
|
|
2912
2556
|
"invalid_analytics_filter_operator",
|
|
2913
2557
|
"Analytics filter operator is not supported.",
|
|
2914
|
-
`${
|
|
2558
|
+
`${n}.operator`
|
|
2915
2559
|
)
|
|
2916
|
-
),
|
|
2560
|
+
), o.values === void 0 && !d && i.push(
|
|
2917
2561
|
r(
|
|
2918
2562
|
"missing_analytics_filter_value",
|
|
2919
2563
|
"Analytics filter needs values unless it is a null check.",
|
|
2920
|
-
|
|
2564
|
+
n
|
|
2921
2565
|
)
|
|
2922
|
-
), d &&
|
|
2566
|
+
), d && o.values !== void 0) {
|
|
2923
2567
|
i.push(
|
|
2924
2568
|
r(
|
|
2925
2569
|
"invalid_analytics_filter_values",
|
|
2926
2570
|
"Null-check analytics filters must not include values.",
|
|
2927
|
-
`${
|
|
2571
|
+
`${n}.values`
|
|
2928
2572
|
)
|
|
2929
2573
|
);
|
|
2930
2574
|
return;
|
|
2931
2575
|
}
|
|
2932
|
-
if (
|
|
2576
|
+
if (o.values !== void 0 && !Array.isArray(o.values)) {
|
|
2933
2577
|
i.push(
|
|
2934
2578
|
r(
|
|
2935
2579
|
"invalid_analytics_filter_values",
|
|
2936
2580
|
"Analytics filter values must be an array when provided.",
|
|
2937
|
-
`${
|
|
2581
|
+
`${n}.values`
|
|
2938
2582
|
)
|
|
2939
2583
|
);
|
|
2940
2584
|
return;
|
|
2941
2585
|
}
|
|
2942
|
-
if (
|
|
2943
|
-
const
|
|
2944
|
-
if (
|
|
2945
|
-
|
|
2586
|
+
if (o.values !== void 0) {
|
|
2587
|
+
const m = o.values.length;
|
|
2588
|
+
if (o.operator === "between" || o.operator === "not_between") {
|
|
2589
|
+
m !== 2 && i.push(
|
|
2946
2590
|
r(
|
|
2947
2591
|
"invalid_analytics_filter_values",
|
|
2948
2592
|
"Between analytics filters must include exactly two values.",
|
|
2949
|
-
`${
|
|
2593
|
+
`${n}.values`
|
|
2950
2594
|
)
|
|
2951
2595
|
);
|
|
2952
2596
|
return;
|
|
2953
2597
|
}
|
|
2954
|
-
(
|
|
2598
|
+
(o.operator === "contains" || o.operator === "not_contains" || o.operator === "=" || o.operator === "!=" || o.operator === ">" || o.operator === ">=" || o.operator === "<" || o.operator === "<=" || o.operator === void 0) && m !== 1 && i.push(
|
|
2955
2599
|
r(
|
|
2956
2600
|
"invalid_analytics_filter_values",
|
|
2957
2601
|
"Scalar analytics filters must include exactly one value. Use in/not_in for multiple values.",
|
|
2958
|
-
`${
|
|
2602
|
+
`${n}.values`
|
|
2959
2603
|
)
|
|
2960
2604
|
);
|
|
2961
2605
|
}
|
|
2962
2606
|
});
|
|
2963
2607
|
}
|
|
2964
2608
|
}
|
|
2965
|
-
function
|
|
2609
|
+
function bn(e) {
|
|
2966
2610
|
const t = [];
|
|
2967
2611
|
if (!f(e))
|
|
2968
2612
|
return t.push(
|
|
@@ -2971,13 +2615,13 @@ function os(e) {
|
|
|
2971
2615
|
"Result calculation must be a structured object."
|
|
2972
2616
|
)
|
|
2973
2617
|
), { ok: !1, errors: t, warnings: [] };
|
|
2974
|
-
if (
|
|
2618
|
+
if (c(e.id) || t.push(
|
|
2975
2619
|
r(
|
|
2976
2620
|
"invalid_result_calculation_id",
|
|
2977
2621
|
"Result calculation needs an id.",
|
|
2978
2622
|
"id"
|
|
2979
2623
|
)
|
|
2980
|
-
),
|
|
2624
|
+
), c(e.label) || t.push(
|
|
2981
2625
|
r(
|
|
2982
2626
|
"invalid_result_calculation_label",
|
|
2983
2627
|
"Result calculation needs a label.",
|
|
@@ -2989,11 +2633,11 @@ function os(e) {
|
|
|
2989
2633
|
"Result calculation kind must be percent_of_total, rank, running_total, or previous_row_delta.",
|
|
2990
2634
|
"kind"
|
|
2991
2635
|
)
|
|
2992
|
-
),
|
|
2636
|
+
), $e(e.input, "input", t), ya(e.output, "output", t), e.kind === "percent_of_total") {
|
|
2993
2637
|
const i = e.denominator;
|
|
2994
|
-
i !== void 0 && (f(i) ? i.scope === "population" ? (
|
|
2638
|
+
i !== void 0 && (f(i) ? i.scope === "population" ? (_(i.metric, "denominator.metric", t, {
|
|
2995
2639
|
required: !0
|
|
2996
|
-
}),
|
|
2640
|
+
}), ne(
|
|
2997
2641
|
i.filters,
|
|
2998
2642
|
"denominator.filters",
|
|
2999
2643
|
t
|
|
@@ -3017,10 +2661,10 @@ function os(e) {
|
|
|
3017
2661
|
"Rank result calculation order must be asc or desc.",
|
|
3018
2662
|
"order"
|
|
3019
2663
|
)
|
|
3020
|
-
), (e.kind === "running_total" || e.kind === "previous_row_delta") && e.orderBy !== void 0 &&
|
|
2664
|
+
), (e.kind === "running_total" || e.kind === "previous_row_delta") && e.orderBy !== void 0 && $e(e.orderBy, "orderBy", t), { ok: t.length === 0, errors: t, warnings: [] };
|
|
3021
2665
|
}
|
|
3022
|
-
function
|
|
3023
|
-
var
|
|
2666
|
+
function bt(e) {
|
|
2667
|
+
var s;
|
|
3024
2668
|
const t = [], i = [];
|
|
3025
2669
|
if (!e || typeof e != "object")
|
|
3026
2670
|
return {
|
|
@@ -3040,8 +2684,8 @@ function Tt(e) {
|
|
|
3040
2684
|
]
|
|
3041
2685
|
};
|
|
3042
2686
|
if (e.kind === "matrix") {
|
|
3043
|
-
const
|
|
3044
|
-
return
|
|
2687
|
+
const l = Pi.safeParse(e);
|
|
2688
|
+
return l.success || t.push(...l.error.issues.map((n) => r("invalid_matrix_intent", n.message, n.path.join(".")))), { ok: t.length === 0, errors: t, warnings: i, repairHints: Ce(t) };
|
|
3045
2689
|
}
|
|
3046
2690
|
if (e.version !== void 0 && e.version !== 1 && t.push(
|
|
3047
2691
|
r(
|
|
@@ -3049,13 +2693,13 @@ function Tt(e) {
|
|
|
3049
2693
|
"Analytics intent version must be 1.",
|
|
3050
2694
|
"version"
|
|
3051
2695
|
)
|
|
3052
|
-
),
|
|
2696
|
+
), se(e.source, "source", t), wa(e, t), pa(e, t), "relationshipHint" in e && e.relationshipHint !== void 0 && ye(
|
|
3053
2697
|
e.relationshipHint,
|
|
3054
2698
|
"relationshipHint",
|
|
3055
2699
|
t
|
|
3056
2700
|
), e.kind === "metric") {
|
|
3057
|
-
const
|
|
3058
|
-
(
|
|
2701
|
+
const l = Array.isArray(e.measures) ? e.measures.filter(
|
|
2702
|
+
(n) => f(n) && c(n.name)
|
|
3059
2703
|
) : [];
|
|
3060
2704
|
if (!Array.isArray(e.measures) || e.measures.length === 0 ? t.push(
|
|
3061
2705
|
r(
|
|
@@ -3064,45 +2708,45 @@ function Tt(e) {
|
|
|
3064
2708
|
"measures"
|
|
3065
2709
|
)
|
|
3066
2710
|
) : e.measures.some(
|
|
3067
|
-
(
|
|
2711
|
+
(n) => !f(n) || !c(n.name)
|
|
3068
2712
|
) && t.push(
|
|
3069
2713
|
r(
|
|
3070
2714
|
"invalid_measure_list",
|
|
3071
2715
|
"Metric intent measures must be an array of field references with names.",
|
|
3072
2716
|
"measures"
|
|
3073
2717
|
)
|
|
3074
|
-
),
|
|
3075
|
-
|
|
2718
|
+
), l.forEach((n, o) => {
|
|
2719
|
+
_(n, `measures.${o}`, t, {
|
|
3076
2720
|
required: !0
|
|
3077
2721
|
});
|
|
3078
|
-
}),
|
|
3079
|
-
const
|
|
3080
|
-
(
|
|
3081
|
-
(
|
|
2722
|
+
}), l.length > 0 && !ea(l)) {
|
|
2723
|
+
const n = l.find(
|
|
2724
|
+
(o, d) => l.some(
|
|
2725
|
+
(p, m) => m !== d && _t(p, o)
|
|
3082
2726
|
)
|
|
3083
2727
|
);
|
|
3084
|
-
|
|
2728
|
+
n && t.push(
|
|
3085
2729
|
r(
|
|
3086
2730
|
"duplicate_measure",
|
|
3087
|
-
|
|
2731
|
+
ta(n),
|
|
3088
2732
|
"measures"
|
|
3089
2733
|
)
|
|
3090
2734
|
);
|
|
3091
2735
|
}
|
|
3092
|
-
if (f(e.primaryMeasure) &&
|
|
2736
|
+
if (f(e.primaryMeasure) && c(e.primaryMeasure.name) && _e(
|
|
3093
2737
|
e.primaryMeasure,
|
|
3094
|
-
|
|
2738
|
+
l
|
|
3095
2739
|
).length > 1 && t.push(
|
|
3096
2740
|
r(
|
|
3097
2741
|
"ambiguous_primary_measure",
|
|
3098
2742
|
"Metric intent primaryMeasure must identify exactly one selected measure.",
|
|
3099
2743
|
"primaryMeasure"
|
|
3100
2744
|
)
|
|
3101
|
-
), e.primaryMeasure !== void 0 && (
|
|
2745
|
+
), e.primaryMeasure !== void 0 && (_(e.primaryMeasure, "primaryMeasure", t, {
|
|
3102
2746
|
required: !0
|
|
3103
|
-
}), f(e.primaryMeasure) &&
|
|
2747
|
+
}), f(e.primaryMeasure) && c(e.primaryMeasure.name) && l.length > 0 && !aa(
|
|
3104
2748
|
e.primaryMeasure,
|
|
3105
|
-
|
|
2749
|
+
l
|
|
3106
2750
|
) && t.push(
|
|
3107
2751
|
r(
|
|
3108
2752
|
"invalid_primary_measure",
|
|
@@ -3116,21 +2760,21 @@ function Tt(e) {
|
|
|
3116
2760
|
"dimensions"
|
|
3117
2761
|
)
|
|
3118
2762
|
) : Array.isArray(e.dimensions) && e.dimensions.some(
|
|
3119
|
-
(
|
|
2763
|
+
(n) => !f(n) || !c(n.name)
|
|
3120
2764
|
) && t.push(
|
|
3121
2765
|
r(
|
|
3122
2766
|
"invalid_measure_dimensions",
|
|
3123
2767
|
"Metric intent dimensions must be an array of field references with names.",
|
|
3124
2768
|
"dimensions"
|
|
3125
2769
|
)
|
|
3126
|
-
), e.dateField !== void 0 &&
|
|
2770
|
+
), e.dateField !== void 0 && _(e.dateField, "dateField", t), e.timeWindow !== void 0 && (ae(e.timeWindow, "timeWindow", t), e.dateField || t.push(
|
|
3127
2771
|
r(
|
|
3128
2772
|
"missing_time_window_date_field",
|
|
3129
2773
|
"Metric timeWindow needs a dateField.",
|
|
3130
2774
|
"dateField"
|
|
3131
2775
|
)
|
|
3132
|
-
)),
|
|
3133
|
-
|
|
2776
|
+
)), ne(e.filters, "filters", t), Array.isArray(e.dimensions) && e.dimensions.forEach((n, o) => {
|
|
2777
|
+
_(n, `dimensions.${o}`, t);
|
|
3134
2778
|
}), e.orderBy !== void 0) {
|
|
3135
2779
|
if (!f(e.orderBy))
|
|
3136
2780
|
t.push(
|
|
@@ -3140,7 +2784,7 @@ function Tt(e) {
|
|
|
3140
2784
|
"orderBy"
|
|
3141
2785
|
)
|
|
3142
2786
|
);
|
|
3143
|
-
else if (
|
|
2787
|
+
else if (_(e.orderBy.field, "orderBy.field", t, {
|
|
3144
2788
|
required: !0
|
|
3145
2789
|
}), e.orderBy.direction !== "asc" && e.orderBy.direction !== "desc" && t.push(
|
|
3146
2790
|
r(
|
|
@@ -3148,17 +2792,17 @@ function Tt(e) {
|
|
|
3148
2792
|
"Metric intent orderBy direction must be asc or desc.",
|
|
3149
2793
|
"orderBy.direction"
|
|
3150
2794
|
)
|
|
3151
|
-
), f(e.orderBy.field) &&
|
|
3152
|
-
const
|
|
3153
|
-
...
|
|
2795
|
+
), f(e.orderBy.field) && c(e.orderBy.field.name)) {
|
|
2796
|
+
const n = [
|
|
2797
|
+
...l,
|
|
3154
2798
|
...e.timeGrain && e.dateField && f(e.dateField) ? [e.dateField] : [],
|
|
3155
2799
|
...Array.isArray(e.dimensions) ? e.dimensions.filter(
|
|
3156
|
-
(
|
|
2800
|
+
(o) => f(o) && c(o.name)
|
|
3157
2801
|
) : []
|
|
3158
2802
|
];
|
|
3159
|
-
|
|
2803
|
+
n.length > 0 && !na(
|
|
3160
2804
|
e.orderBy.field,
|
|
3161
|
-
|
|
2805
|
+
n
|
|
3162
2806
|
) && t.push(
|
|
3163
2807
|
r(
|
|
3164
2808
|
"invalid_measure_order_by",
|
|
@@ -3168,7 +2812,7 @@ function Tt(e) {
|
|
|
3168
2812
|
);
|
|
3169
2813
|
}
|
|
3170
2814
|
}
|
|
3171
|
-
|
|
2815
|
+
ba(e, t);
|
|
3172
2816
|
} else if (e.kind === "records") {
|
|
3173
2817
|
if (!Array.isArray(e.fields) || e.fields.length === 0 ? t.push(
|
|
3174
2818
|
r(
|
|
@@ -3177,30 +2821,30 @@ function Tt(e) {
|
|
|
3177
2821
|
"fields"
|
|
3178
2822
|
)
|
|
3179
2823
|
) : e.fields.some(
|
|
3180
|
-
(
|
|
2824
|
+
(l) => !f(l) || !c(l.name)
|
|
3181
2825
|
) && t.push(
|
|
3182
2826
|
r(
|
|
3183
2827
|
"invalid_record_fields",
|
|
3184
2828
|
"Records intent fields must be field references with names.",
|
|
3185
2829
|
"fields"
|
|
3186
2830
|
)
|
|
3187
|
-
), Array.isArray(e.fields) && e.fields.forEach((
|
|
3188
|
-
|
|
3189
|
-
}), e.dateField !== void 0 &&
|
|
2831
|
+
), Array.isArray(e.fields) && e.fields.forEach((l, n) => {
|
|
2832
|
+
_(l, `fields.${n}`, t);
|
|
2833
|
+
}), e.dateField !== void 0 && _(e.dateField, "dateField", t), Ne(e.pagination, "pagination", t), e.timeWindow !== void 0 && (ae(e.timeWindow, "timeWindow", t), e.dateField || t.push(
|
|
3190
2834
|
r(
|
|
3191
2835
|
"missing_time_window_date_field",
|
|
3192
2836
|
"Records timeWindow needs a dateField.",
|
|
3193
2837
|
"dateField"
|
|
3194
2838
|
)
|
|
3195
|
-
)),
|
|
3196
|
-
f(
|
|
2839
|
+
)), ne(e.filters, "filters", t), Array.isArray(e.filters) && e.filters.forEach((l, n) => {
|
|
2840
|
+
f(l) && l.scope === "aggregate" && t.push(
|
|
3197
2841
|
r(
|
|
3198
2842
|
"unsupported_record_filter_scope",
|
|
3199
2843
|
"Records intents support row-scope filters only. Use a metric intent for aggregate-scope filters.",
|
|
3200
|
-
`filters.${
|
|
2844
|
+
`filters.${n}.scope`
|
|
3201
2845
|
)
|
|
3202
2846
|
);
|
|
3203
|
-
}), e.orderBy !== void 0 && (f(e.orderBy) ? (
|
|
2847
|
+
}), e.orderBy !== void 0 && (f(e.orderBy) ? (_(e.orderBy.field, "orderBy.field", t, {
|
|
3204
2848
|
required: !0
|
|
3205
2849
|
}), e.orderBy.direction !== "asc" && e.orderBy.direction !== "desc" && t.push(
|
|
3206
2850
|
r(
|
|
@@ -3231,40 +2875,40 @@ function Tt(e) {
|
|
|
3231
2875
|
"totals.mode"
|
|
3232
2876
|
)
|
|
3233
2877
|
);
|
|
3234
|
-
const
|
|
3235
|
-
!Array.isArray(
|
|
2878
|
+
const l = e.totals.measures;
|
|
2879
|
+
!Array.isArray(l) || l.length === 0 ? t.push(
|
|
3236
2880
|
r(
|
|
3237
2881
|
"missing_records_totals_measures",
|
|
3238
2882
|
"Records server totals need at least one measure.",
|
|
3239
2883
|
"totals.measures"
|
|
3240
2884
|
)
|
|
3241
|
-
) :
|
|
3242
|
-
|
|
2885
|
+
) : l.forEach((n, o) => {
|
|
2886
|
+
_(n, `totals.measures.${o}`, t, {
|
|
3243
2887
|
required: !0
|
|
3244
|
-
}), (!f(
|
|
2888
|
+
}), (!f(n) || n.role !== "measure") && t.push(
|
|
3245
2889
|
r(
|
|
3246
2890
|
"invalid_records_totals_measure",
|
|
3247
2891
|
"Records server totals measures must be measure field references.",
|
|
3248
|
-
`totals.measures.${
|
|
2892
|
+
`totals.measures.${o}.role`
|
|
3249
2893
|
)
|
|
3250
2894
|
);
|
|
3251
2895
|
});
|
|
3252
2896
|
}
|
|
3253
|
-
} else e.kind === "inputOptions" ?
|
|
2897
|
+
} else e.kind === "inputOptions" ? ca(e, t) : e.kind === "sql" ? (((s = e.source) == null ? void 0 : s.kind) !== "sql" && t.push(
|
|
3254
2898
|
r(
|
|
3255
2899
|
"invalid_sql_source",
|
|
3256
2900
|
"SQL analytics intent must use a SQL execution source.",
|
|
3257
2901
|
"source"
|
|
3258
2902
|
)
|
|
3259
|
-
),
|
|
2903
|
+
), c(e.sql) || t.push(
|
|
3260
2904
|
r("missing_sql", "SQL analytics intent needs SQL text.", "sql")
|
|
3261
|
-
),
|
|
2905
|
+
), ia(
|
|
3262
2906
|
e.defaultParameters,
|
|
3263
2907
|
"defaultParameters",
|
|
3264
2908
|
t
|
|
3265
|
-
), Array.isArray(e.fields) && e.fields.forEach((
|
|
3266
|
-
|
|
3267
|
-
}),
|
|
2909
|
+
), Array.isArray(e.fields) && e.fields.forEach((l, n) => {
|
|
2910
|
+
_(l, `fields.${n}`, t);
|
|
2911
|
+
}), Ne(e.pagination, "pagination", t)) : t.push(
|
|
3268
2912
|
r(
|
|
3269
2913
|
"invalid_analytics_kind",
|
|
3270
2914
|
"Analytics kind is not supported.",
|
|
@@ -3275,10 +2919,10 @@ function Tt(e) {
|
|
|
3275
2919
|
ok: t.length === 0,
|
|
3276
2920
|
errors: t,
|
|
3277
2921
|
warnings: i,
|
|
3278
|
-
repairHints:
|
|
2922
|
+
repairHints: Ce(t)
|
|
3279
2923
|
};
|
|
3280
2924
|
}
|
|
3281
|
-
function
|
|
2925
|
+
function wa(e, t) {
|
|
3282
2926
|
if (!(!("derivedFields" in e) || e.derivedFields === void 0)) {
|
|
3283
2927
|
if (!Array.isArray(e.derivedFields)) {
|
|
3284
2928
|
t.push(
|
|
@@ -3290,19 +2934,19 @@ function ra(e, t) {
|
|
|
3290
2934
|
);
|
|
3291
2935
|
return;
|
|
3292
2936
|
}
|
|
3293
|
-
e.derivedFields.forEach((i,
|
|
3294
|
-
|
|
2937
|
+
e.derivedFields.forEach((i, s) => {
|
|
2938
|
+
oe(
|
|
3295
2939
|
i
|
|
3296
|
-
).errors.forEach((
|
|
2940
|
+
).errors.forEach((n) => {
|
|
3297
2941
|
t.push({
|
|
3298
|
-
...
|
|
3299
|
-
path:
|
|
2942
|
+
...n,
|
|
2943
|
+
path: n.path ? `derivedFields.${s}.${n.path}` : `derivedFields.${s}`
|
|
3300
2944
|
});
|
|
3301
2945
|
});
|
|
3302
2946
|
});
|
|
3303
2947
|
}
|
|
3304
2948
|
}
|
|
3305
|
-
function
|
|
2949
|
+
function Aa(e) {
|
|
3306
2950
|
const t = [], i = [];
|
|
3307
2951
|
if (!e || typeof e != "object")
|
|
3308
2952
|
return {
|
|
@@ -3334,33 +2978,33 @@ function la(e) {
|
|
|
3334
2978
|
"Answer-obligations operation intent needs at least one obligation.",
|
|
3335
2979
|
"obligations"
|
|
3336
2980
|
)
|
|
3337
|
-
) : e.obligations.forEach((
|
|
3338
|
-
|
|
2981
|
+
) : e.obligations.forEach((s, l) => {
|
|
2982
|
+
c(s.id) || t.push(
|
|
3339
2983
|
r(
|
|
3340
2984
|
"missing_obligation_id",
|
|
3341
2985
|
"Each analytics obligation needs an id.",
|
|
3342
|
-
`obligations.${
|
|
2986
|
+
`obligations.${l}.id`
|
|
3343
2987
|
)
|
|
3344
|
-
),
|
|
2988
|
+
), c(s.prompt) || t.push(
|
|
3345
2989
|
r(
|
|
3346
2990
|
"missing_obligation_prompt",
|
|
3347
2991
|
"Each analytics obligation needs a prompt.",
|
|
3348
|
-
`obligations.${
|
|
2992
|
+
`obligations.${l}.prompt`
|
|
3349
2993
|
)
|
|
3350
2994
|
);
|
|
3351
2995
|
});
|
|
3352
2996
|
else if (e.kind === "dashboard_change") {
|
|
3353
|
-
if (
|
|
2997
|
+
if (c(e.instruction) || t.push(
|
|
3354
2998
|
r(
|
|
3355
2999
|
"missing_instruction",
|
|
3356
3000
|
"Change operation intent needs an instruction.",
|
|
3357
3001
|
"instruction"
|
|
3358
3002
|
)
|
|
3359
3003
|
), e.analyticsIntent) {
|
|
3360
|
-
const
|
|
3004
|
+
const s = bt(
|
|
3361
3005
|
e.analyticsIntent
|
|
3362
3006
|
);
|
|
3363
|
-
t.push(...
|
|
3007
|
+
t.push(...s.errors), i.push(...s.warnings);
|
|
3364
3008
|
}
|
|
3365
3009
|
} else
|
|
3366
3010
|
t.push(
|
|
@@ -3374,10 +3018,10 @@ function la(e) {
|
|
|
3374
3018
|
ok: t.length === 0,
|
|
3375
3019
|
errors: t,
|
|
3376
3020
|
warnings: i,
|
|
3377
|
-
repairHints:
|
|
3021
|
+
repairHints: vt(t)
|
|
3378
3022
|
};
|
|
3379
3023
|
}
|
|
3380
|
-
function
|
|
3024
|
+
function vn(e) {
|
|
3381
3025
|
const t = [], i = [];
|
|
3382
3026
|
if (!e || typeof e != "object")
|
|
3383
3027
|
return {
|
|
@@ -3405,10 +3049,10 @@ function rs(e) {
|
|
|
3405
3049
|
"kind"
|
|
3406
3050
|
)
|
|
3407
3051
|
);
|
|
3408
|
-
const
|
|
3052
|
+
const s = Aa(
|
|
3409
3053
|
e.operationIntent
|
|
3410
3054
|
);
|
|
3411
|
-
return t.push(...
|
|
3055
|
+
return t.push(...s.errors), i.push(...s.warnings), Array.isArray(e.plannedToolCalls) || t.push(
|
|
3412
3056
|
r(
|
|
3413
3057
|
"invalid_planned_tool_calls",
|
|
3414
3058
|
"Recovery plan plannedToolCalls must be an array.",
|
|
@@ -3418,16 +3062,16 @@ function rs(e) {
|
|
|
3418
3062
|
ok: t.length === 0,
|
|
3419
3063
|
errors: t,
|
|
3420
3064
|
warnings: i,
|
|
3421
|
-
repairHints:
|
|
3065
|
+
repairHints: vt(t)
|
|
3422
3066
|
};
|
|
3423
3067
|
}
|
|
3424
|
-
function
|
|
3068
|
+
function vt(e) {
|
|
3425
3069
|
return e.map((t) => ({
|
|
3426
3070
|
code: t.code,
|
|
3427
3071
|
recommendedNextStep: t.code === "missing_obligations" ? "Normalize the user request into one or more typed analytics obligations before recovery planning." : "Correct the operation/recovery contract shape before planning execution."
|
|
3428
3072
|
}));
|
|
3429
3073
|
}
|
|
3430
|
-
function
|
|
3074
|
+
function Ce(e) {
|
|
3431
3075
|
return e.map((t) => {
|
|
3432
3076
|
switch (t.code) {
|
|
3433
3077
|
case "invalid_matrix_intent":
|
|
@@ -3515,14 +3159,14 @@ function Ve(e) {
|
|
|
3515
3159
|
}
|
|
3516
3160
|
}).filter((t) => !!t);
|
|
3517
3161
|
}
|
|
3518
|
-
function
|
|
3162
|
+
function xa(e, t, i, s) {
|
|
3519
3163
|
if (!e || typeof e != "object") {
|
|
3520
3164
|
i.push(
|
|
3521
3165
|
r("invalid_view", "Dashboard view must be an object.", t)
|
|
3522
3166
|
);
|
|
3523
3167
|
return;
|
|
3524
3168
|
}
|
|
3525
|
-
if (
|
|
3169
|
+
if (c(e.title) || i.push(
|
|
3526
3170
|
r("missing_view_title", "Dashboard view needs a title.", t)
|
|
3527
3171
|
), !e.presentation || typeof e.presentation != "object") {
|
|
3528
3172
|
i.push(
|
|
@@ -3535,7 +3179,7 @@ function da(e, t, i, a) {
|
|
|
3535
3179
|
return;
|
|
3536
3180
|
}
|
|
3537
3181
|
if (e.presentation.kind === "text") {
|
|
3538
|
-
|
|
3182
|
+
c(e.text) || s.push(
|
|
3539
3183
|
r(
|
|
3540
3184
|
"missing_text_content",
|
|
3541
3185
|
"Text views should include text content.",
|
|
@@ -3561,25 +3205,25 @@ function da(e, t, i, a) {
|
|
|
3561
3205
|
`${t}.analytics.kind`
|
|
3562
3206
|
)
|
|
3563
3207
|
);
|
|
3564
|
-
const
|
|
3565
|
-
for (const
|
|
3208
|
+
const l = bt(e.analytics);
|
|
3209
|
+
for (const n of l.errors)
|
|
3566
3210
|
i.push(
|
|
3567
3211
|
r(
|
|
3568
|
-
|
|
3569
|
-
|
|
3570
|
-
`${t}.analytics${
|
|
3212
|
+
n.code,
|
|
3213
|
+
n.message,
|
|
3214
|
+
`${t}.analytics${n.path ? `.${n.path}` : ""}`
|
|
3571
3215
|
)
|
|
3572
3216
|
);
|
|
3573
|
-
for (const
|
|
3574
|
-
|
|
3217
|
+
for (const n of l.warnings)
|
|
3218
|
+
s.push(
|
|
3575
3219
|
r(
|
|
3576
|
-
|
|
3577
|
-
|
|
3578
|
-
`${t}.analytics${
|
|
3220
|
+
n.code,
|
|
3221
|
+
n.message,
|
|
3222
|
+
`${t}.analytics${n.path ? `.${n.path}` : ""}`
|
|
3579
3223
|
)
|
|
3580
3224
|
);
|
|
3581
3225
|
}
|
|
3582
|
-
function
|
|
3226
|
+
function In(e) {
|
|
3583
3227
|
const t = [], i = [];
|
|
3584
3228
|
if (!e || typeof e != "object")
|
|
3585
3229
|
return {
|
|
@@ -3596,46 +3240,46 @@ function ls(e) {
|
|
|
3596
3240
|
r("invalid_version", "Dashboard intent version must be 1.")
|
|
3597
3241
|
), e.kind !== "dashboard" && t.push(
|
|
3598
3242
|
r("invalid_kind", "Experience intent kind must be dashboard.")
|
|
3599
|
-
),
|
|
3243
|
+
), c(e.title) || t.push(
|
|
3600
3244
|
r("missing_title", "Dashboard intent needs a title.", "title")
|
|
3601
3245
|
);
|
|
3602
|
-
const
|
|
3603
|
-
|
|
3246
|
+
const s = Array.isArray(e.inputs) ? e.inputs : [], l = Re(
|
|
3247
|
+
s.filter(f).map((p) => p.id).filter((p) => typeof p == "string")
|
|
3604
3248
|
);
|
|
3605
|
-
|
|
3249
|
+
l && t.push(
|
|
3606
3250
|
r(
|
|
3607
3251
|
"duplicate_input_id",
|
|
3608
|
-
`Duplicate input id: ${
|
|
3252
|
+
`Duplicate input id: ${l}.`,
|
|
3609
3253
|
"inputs"
|
|
3610
3254
|
)
|
|
3611
3255
|
);
|
|
3612
|
-
for (const [
|
|
3613
|
-
const u = `inputs.${
|
|
3614
|
-
if (!f(
|
|
3256
|
+
for (const [p, m] of s.entries()) {
|
|
3257
|
+
const u = `inputs.${p}`;
|
|
3258
|
+
if (!f(m)) {
|
|
3615
3259
|
t.push(
|
|
3616
3260
|
r("invalid_input", "Dashboard input must be an object.", u)
|
|
3617
3261
|
);
|
|
3618
3262
|
continue;
|
|
3619
3263
|
}
|
|
3620
|
-
m
|
|
3264
|
+
c(m.id) || t.push(
|
|
3621
3265
|
r("missing_input_id", "Input needs an id.", `${u}.id`)
|
|
3622
|
-
), m
|
|
3266
|
+
), c(m.label) || t.push(
|
|
3623
3267
|
r("missing_input_label", "Input needs a label.", `${u}.label`)
|
|
3624
|
-
), !
|
|
3268
|
+
), !m.field || !c(m.field.name) ? t.push(
|
|
3625
3269
|
r("missing_input_field", "Input needs a field.", `${u}.field`)
|
|
3626
|
-
) :
|
|
3270
|
+
) : _(m.field, `${u}.field`, t);
|
|
3627
3271
|
}
|
|
3628
|
-
const
|
|
3629
|
-
|
|
3272
|
+
const n = Array.isArray(e.sections) ? e.sections : [];
|
|
3273
|
+
n.length === 0 && t.push(
|
|
3630
3274
|
r(
|
|
3631
3275
|
"missing_sections",
|
|
3632
3276
|
"Dashboard intent needs at least one section.",
|
|
3633
3277
|
"sections"
|
|
3634
3278
|
)
|
|
3635
3279
|
);
|
|
3636
|
-
const
|
|
3637
|
-
(
|
|
3638
|
-
), d =
|
|
3280
|
+
const o = n.flatMap(
|
|
3281
|
+
(p) => p && typeof p == "object" && Array.isArray(p.views) ? p.views.filter(f).map((m) => m.id).filter((m) => !!m) : []
|
|
3282
|
+
), d = Re(o);
|
|
3639
3283
|
d && t.push(
|
|
3640
3284
|
r(
|
|
3641
3285
|
"duplicate_view_id",
|
|
@@ -3643,9 +3287,9 @@ function ls(e) {
|
|
|
3643
3287
|
"sections"
|
|
3644
3288
|
)
|
|
3645
3289
|
);
|
|
3646
|
-
for (const [
|
|
3647
|
-
const u = `sections.${
|
|
3648
|
-
if (!
|
|
3290
|
+
for (const [p, m] of n.entries()) {
|
|
3291
|
+
const u = `sections.${p}`;
|
|
3292
|
+
if (!m || typeof m != "object") {
|
|
3649
3293
|
t.push(
|
|
3650
3294
|
r(
|
|
3651
3295
|
"invalid_section",
|
|
@@ -3655,13 +3299,13 @@ function ls(e) {
|
|
|
3655
3299
|
);
|
|
3656
3300
|
continue;
|
|
3657
3301
|
}
|
|
3658
|
-
if (m
|
|
3302
|
+
if (c(m.title) || t.push(
|
|
3659
3303
|
r(
|
|
3660
3304
|
"missing_section_title",
|
|
3661
3305
|
"Dashboard section needs a title.",
|
|
3662
3306
|
u
|
|
3663
3307
|
)
|
|
3664
|
-
), !Array.isArray(
|
|
3308
|
+
), !Array.isArray(m.views) || m.views.length === 0) {
|
|
3665
3309
|
t.push(
|
|
3666
3310
|
r(
|
|
3667
3311
|
"missing_section_views",
|
|
@@ -3671,10 +3315,10 @@ function ls(e) {
|
|
|
3671
3315
|
);
|
|
3672
3316
|
continue;
|
|
3673
3317
|
}
|
|
3674
|
-
for (const [
|
|
3675
|
-
|
|
3676
|
-
|
|
3677
|
-
`${u}.views.${
|
|
3318
|
+
for (const [g, y] of m.views.entries())
|
|
3319
|
+
xa(
|
|
3320
|
+
y,
|
|
3321
|
+
`${u}.views.${g}`,
|
|
3678
3322
|
t,
|
|
3679
3323
|
i
|
|
3680
3324
|
);
|
|
@@ -3682,145 +3326,128 @@ function ls(e) {
|
|
|
3682
3326
|
return { ok: t.length === 0, errors: t, warnings: i };
|
|
3683
3327
|
}
|
|
3684
3328
|
export {
|
|
3685
|
-
|
|
3686
|
-
|
|
3687
|
-
|
|
3688
|
-
|
|
3689
|
-
|
|
3690
|
-
|
|
3691
|
-
|
|
3692
|
-
|
|
3693
|
-
|
|
3694
|
-
|
|
3695
|
-
|
|
3696
|
-
|
|
3697
|
-
|
|
3698
|
-
|
|
3699
|
-
|
|
3700
|
-
|
|
3701
|
-
|
|
3702
|
-
|
|
3703
|
-
|
|
3704
|
-
|
|
3705
|
-
|
|
3706
|
-
|
|
3707
|
-
|
|
3708
|
-
|
|
3709
|
-
|
|
3710
|
-
|
|
3711
|
-
|
|
3712
|
-
|
|
3713
|
-
|
|
3714
|
-
|
|
3715
|
-
|
|
3716
|
-
|
|
3717
|
-
|
|
3718
|
-
|
|
3719
|
-
|
|
3720
|
-
|
|
3721
|
-
|
|
3722
|
-
|
|
3723
|
-
|
|
3724
|
-
|
|
3725
|
-
|
|
3726
|
-
|
|
3727
|
-
|
|
3728
|
-
|
|
3729
|
-
|
|
3730
|
-
|
|
3731
|
-
|
|
3732
|
-
|
|
3733
|
-
|
|
3734
|
-
|
|
3735
|
-
|
|
3736
|
-
|
|
3737
|
-
|
|
3738
|
-
|
|
3739
|
-
|
|
3740
|
-
|
|
3741
|
-
|
|
3742
|
-
|
|
3743
|
-
|
|
3744
|
-
|
|
3745
|
-
|
|
3746
|
-
|
|
3747
|
-
|
|
3748
|
-
|
|
3749
|
-
|
|
3750
|
-
|
|
3751
|
-
|
|
3752
|
-
|
|
3753
|
-
|
|
3754
|
-
|
|
3755
|
-
|
|
3756
|
-
|
|
3757
|
-
|
|
3758
|
-
|
|
3759
|
-
|
|
3760
|
-
|
|
3761
|
-
|
|
3762
|
-
|
|
3763
|
-
|
|
3764
|
-
|
|
3765
|
-
|
|
3766
|
-
|
|
3767
|
-
|
|
3768
|
-
|
|
3769
|
-
|
|
3770
|
-
|
|
3771
|
-
|
|
3772
|
-
|
|
3773
|
-
|
|
3774
|
-
|
|
3775
|
-
|
|
3776
|
-
|
|
3777
|
-
|
|
3778
|
-
|
|
3779
|
-
|
|
3780
|
-
|
|
3781
|
-
|
|
3782
|
-
|
|
3783
|
-
|
|
3784
|
-
|
|
3785
|
-
|
|
3786
|
-
|
|
3787
|
-
|
|
3788
|
-
|
|
3789
|
-
|
|
3790
|
-
Qa as
|
|
3791
|
-
|
|
3792
|
-
|
|
3793
|
-
|
|
3794
|
-
|
|
3795
|
-
|
|
3796
|
-
|
|
3797
|
-
|
|
3798
|
-
|
|
3799
|
-
|
|
3800
|
-
|
|
3801
|
-
|
|
3802
|
-
|
|
3803
|
-
|
|
3804
|
-
|
|
3805
|
-
|
|
3806
|
-
|
|
3807
|
-
|
|
3808
|
-
|
|
3809
|
-
Fa as j,
|
|
3810
|
-
ae as k,
|
|
3811
|
-
Wa as l,
|
|
3812
|
-
vn as m,
|
|
3813
|
-
ka as n,
|
|
3814
|
-
Nn as o,
|
|
3815
|
-
as as p,
|
|
3816
|
-
is as q,
|
|
3817
|
-
ss as r,
|
|
3818
|
-
jn as s,
|
|
3819
|
-
st as t,
|
|
3820
|
-
Pa as u,
|
|
3821
|
-
Ya as v,
|
|
3822
|
-
Ea as w,
|
|
3823
|
-
Ca as x,
|
|
3824
|
-
Ma as y,
|
|
3825
|
-
Ni as z
|
|
3329
|
+
ge as $,
|
|
3330
|
+
mi as A,
|
|
3331
|
+
Xa as B,
|
|
3332
|
+
Z as C,
|
|
3333
|
+
di as D,
|
|
3334
|
+
mn as E,
|
|
3335
|
+
Ja as F,
|
|
3336
|
+
fn as G,
|
|
3337
|
+
te as H,
|
|
3338
|
+
st as I,
|
|
3339
|
+
La as J,
|
|
3340
|
+
me as K,
|
|
3341
|
+
oi as L,
|
|
3342
|
+
Di as M,
|
|
3343
|
+
rt as N,
|
|
3344
|
+
ee as O,
|
|
3345
|
+
ot as P,
|
|
3346
|
+
ri as Q,
|
|
3347
|
+
A as R,
|
|
3348
|
+
Ba as S,
|
|
3349
|
+
Ni as T,
|
|
3350
|
+
lt as U,
|
|
3351
|
+
$i as V,
|
|
3352
|
+
Ci as W,
|
|
3353
|
+
ut as X,
|
|
3354
|
+
j as Y,
|
|
3355
|
+
xe as Z,
|
|
3356
|
+
qi as _,
|
|
3357
|
+
gt as a,
|
|
3358
|
+
Oa as a$,
|
|
3359
|
+
De as a0,
|
|
3360
|
+
H as a1,
|
|
3361
|
+
Ui as a2,
|
|
3362
|
+
dn as a3,
|
|
3363
|
+
cn as a4,
|
|
3364
|
+
le as a5,
|
|
3365
|
+
Mt as a6,
|
|
3366
|
+
Et as a7,
|
|
3367
|
+
ie as a8,
|
|
3368
|
+
ma as a9,
|
|
3369
|
+
F as aA,
|
|
3370
|
+
mt as aB,
|
|
3371
|
+
he as aC,
|
|
3372
|
+
ft as aD,
|
|
3373
|
+
hn as aE,
|
|
3374
|
+
bi as aF,
|
|
3375
|
+
Ii as aG,
|
|
3376
|
+
Tt as aH,
|
|
3377
|
+
Ma as aI,
|
|
3378
|
+
Nt as aJ,
|
|
3379
|
+
Rt as aK,
|
|
3380
|
+
Ea as aL,
|
|
3381
|
+
$t as aM,
|
|
3382
|
+
M as aN,
|
|
3383
|
+
Ct as aO,
|
|
3384
|
+
Ta as aP,
|
|
3385
|
+
Yt as aQ,
|
|
3386
|
+
Na as aR,
|
|
3387
|
+
Ot as aS,
|
|
3388
|
+
Ge as aT,
|
|
3389
|
+
ni as aU,
|
|
3390
|
+
si as aV,
|
|
3391
|
+
Pa as aW,
|
|
3392
|
+
qa as aX,
|
|
3393
|
+
R as aY,
|
|
3394
|
+
Ca as aZ,
|
|
3395
|
+
L as a_,
|
|
3396
|
+
bn as aa,
|
|
3397
|
+
bt as ab,
|
|
3398
|
+
Aa as ac,
|
|
3399
|
+
vn as ad,
|
|
3400
|
+
In as ae,
|
|
3401
|
+
oe as af,
|
|
3402
|
+
ue as ag,
|
|
3403
|
+
Kt as ah,
|
|
3404
|
+
Xt as ai,
|
|
3405
|
+
ce as aj,
|
|
3406
|
+
ti as ak,
|
|
3407
|
+
ii as al,
|
|
3408
|
+
He as am,
|
|
3409
|
+
Ve as an,
|
|
3410
|
+
Se as ao,
|
|
3411
|
+
ze as ap,
|
|
3412
|
+
Ra as aq,
|
|
3413
|
+
$a as ar,
|
|
3414
|
+
Xe as as,
|
|
3415
|
+
fe as at,
|
|
3416
|
+
Wa as au,
|
|
3417
|
+
en as av,
|
|
3418
|
+
nn as aw,
|
|
3419
|
+
sn as ax,
|
|
3420
|
+
rn as ay,
|
|
3421
|
+
pn as az,
|
|
3422
|
+
Va as b,
|
|
3423
|
+
Ya as b0,
|
|
3424
|
+
Yi as b1,
|
|
3425
|
+
ja as b2,
|
|
3426
|
+
de as b3,
|
|
3427
|
+
qt as b4,
|
|
3428
|
+
Ae as b5,
|
|
3429
|
+
ui as c,
|
|
3430
|
+
Ke as d,
|
|
3431
|
+
za as e,
|
|
3432
|
+
Ga as f,
|
|
3433
|
+
li as g,
|
|
3434
|
+
Qa as h,
|
|
3435
|
+
Ha as i,
|
|
3436
|
+
Ka as j,
|
|
3437
|
+
J as k,
|
|
3438
|
+
un as l,
|
|
3439
|
+
Pi as m,
|
|
3440
|
+
Ua as n,
|
|
3441
|
+
Qi as o,
|
|
3442
|
+
_n as p,
|
|
3443
|
+
gn as q,
|
|
3444
|
+
yn as r,
|
|
3445
|
+
Ji as s,
|
|
3446
|
+
Qe as t,
|
|
3447
|
+
on as u,
|
|
3448
|
+
ln as v,
|
|
3449
|
+
tn as w,
|
|
3450
|
+
an as x,
|
|
3451
|
+
Za as y,
|
|
3452
|
+
ci as z
|
|
3826
3453
|
};
|