react-semaphor 0.1.545 → 0.1.547
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 +408 -442
- package/dist/assistant-context/index.js +1 -1
- package/dist/assistant-protocol/index.js +100 -76
- package/dist/brand-studio/index.js +4 -4
- package/dist/briefings/index.js +6 -6
- package/dist/chunks/{add-to-dashboard-BuAqfA2Y.js → add-to-dashboard-BQRAAnc3.js} +55 -33
- package/dist/chunks/{analytics-base-schemas-BFAoRlkU.js → analytics-base-schemas-BKs3flFS.js} +2 -2
- package/dist/chunks/applied-constraints-DU-wndZ7.js +47 -0
- package/dist/chunks/{assistant-chat-D7sWTypJ.js → assistant-chat-CK84cPAB.js} +2826 -2595
- package/dist/chunks/{bookmark-state-CXw7lZ50.js → bookmark-state-Cu-a5ie_.js} +8 -15
- package/dist/chunks/comparison-window-caption-C2xF-eWw.js +1433 -0
- package/dist/chunks/{context-ClREvqCZ.js → context-BerEBuFR.js} +11 -6
- package/dist/chunks/custom-visual-inputs-ChL54gGm.js +295 -0
- package/dist/chunks/{dashboard-B1tMju0u.js → dashboard-DCk26-6i.js} +1 -1
- package/dist/chunks/{dashboard-briefing-launcher-CePgIu0Z.js → dashboard-briefing-launcher-CQ1eYsGy.js} +1291 -1277
- package/dist/chunks/dashboard-controls-BMeZjF7r.js +2307 -0
- package/dist/chunks/{dashboard-json-CoYRPqxx.js → dashboard-json-BZqCoanC.js} +5 -5
- package/dist/chunks/{document-dashboard-inputs-BesAHZvB.js → document-dashboard-inputs-tYd7ao0o.js} +877 -979
- package/dist/chunks/{edit-dashboard-visual-JPtNfJRb.js → edit-dashboard-visual-Bv3MHM_G.js} +2157 -2243
- package/dist/chunks/filter-reach-copy-CGWsL_ez.js +3480 -0
- package/dist/chunks/{filter-value-text-ff7osJr7.js → filter-value-text-Ddf55Ku1.js} +9 -9
- package/dist/chunks/global-date-filter-utils-BhAu8zIM.js +12137 -0
- package/dist/chunks/index-CtoK1Lgu.js +586 -0
- package/dist/chunks/{index-DRWiuqyd.js → index-DmrLP5Ro.js} +105 -104
- package/dist/chunks/list-filter-DsaTbM3J.js +15 -0
- package/dist/chunks/matrix-analytical-definition-B9vW-osb.js +717 -0
- package/dist/chunks/{matrix-card-DjwWcCo8.js → matrix-card-LiMEipvq.js} +3 -3
- package/dist/chunks/{matrix-formatter-DnCyRXJE.js → matrix-formatter-DWEeC0_c.js} +44 -44
- package/dist/chunks/{matrix-member-presentation-CQGdVks6.js → matrix-member-presentation-DqzG-UhQ.js} +1 -1
- package/dist/chunks/{matrix-operation-contract-8OIO4gob.js → matrix-operation-contract-D6vYkZK4.js} +72 -72
- package/dist/chunks/{metric-comparison-DEwi9uc2.js → metric-comparison-zpGw4lD6.js} +2 -2
- package/dist/chunks/normalize-dashboard-for-dirty-check-XKgH3GFX.js +119 -0
- package/dist/chunks/{pivot-header-presentation-DHcx1XGQ.js → pivot-header-presentation-CQnIDtUv.js} +1 -1
- package/dist/chunks/{pivot-result-identity-DJhXXcns.js → pivot-result-identity-C-Q1j1Wb.js} +1 -1
- package/dist/chunks/{pivot-result-lifecycle-DM4CyGKs.js → pivot-result-lifecycle-pwq3b7LC.js} +571 -380
- package/dist/chunks/{raw-temporal-contract-C51YG48G.js → raw-temporal-contract-WuXA8jBP.js} +1 -1
- package/dist/chunks/{raw-temporal-presentation-C3mUgnEx.js → raw-temporal-presentation-DypB7sMX.js} +8 -8
- package/dist/chunks/{report-preferences-dialog-DUtuUL_5.js → report-preferences-dialog-DoVyriYC.js} +154 -155
- package/dist/chunks/{report-runtime-context-Dq8XyODK.js → report-runtime-context-hWiTCzFV.js} +2 -2
- package/dist/chunks/resolve-dashboard-input-context-D0JDUa4h.js +5576 -0
- package/dist/chunks/{saved-dashboard-context-LrF_kW0l.js → saved-dashboard-context-BfAH5j4L.js} +34 -34
- package/dist/chunks/{selection-reducer-Dj_8xD69.js → selection-reducer-CJzkTZio.js} +15 -15
- package/dist/chunks/{semaphor-ready-indicator-BxF96Yhv.js → semaphor-ready-indicator-CRm17oIP.js} +51771 -52574
- package/dist/chunks/{shelf-drop-preview-context-CNaM_Gmh.js → shelf-drop-preview-context-vy6P9THz.js} +7 -7
- package/dist/chunks/{source-entity-resolution-BYn9giz3.js → source-entity-resolution-BIGRvtbG.js} +13 -13
- package/dist/chunks/{switch-uDtPgQlQ.js → switch-CEBOR4n7.js} +3 -3
- package/dist/chunks/{table-export-sheet-YzMioA7Y.js → table-export-sheet-4X9mAG3V.js} +1 -1
- package/dist/chunks/table-settings-WysCBj62.js +614 -0
- package/dist/chunks/{temporal-bucket-D7NBrrtL.js → temporal-bucket-CQOSbv9-.js} +26 -26
- package/dist/chunks/{token-types-DBbZVQsm.js → token-types-BMqRmT-C.js} +1 -1
- package/dist/chunks/{use-create-flow-overlay-state-CjB7ig1o.js → use-create-flow-overlay-state-Csx_Xjsh.js} +101 -101
- package/dist/chunks/{validators-DMHTpf7a.js → validators-C-aOQlTB.js} +713 -658
- package/dist/chunks/{relative-date-label-Bk2j94pA.js → zoned-wall-clock-MulfA26h.js} +64 -21
- package/dist/dashboard/index.js +2 -2
- package/dist/dashboard-authoring/index.js +1895 -1163
- package/dist/data-app-sdk/index.js +6 -6
- package/dist/data-app-sdk-adapters/index.js +3 -3
- package/dist/data-app-sdk-validation/index.js +14 -14
- package/dist/format-utils/index.js +133 -133
- package/dist/index.js +192 -186
- package/dist/layouts/index.js +5 -242
- package/dist/report-runtime-context/index.js +2 -2
- package/dist/shared/index.js +4 -5
- package/dist/style.css +1 -1
- package/dist/surfboard/index.js +2 -2
- package/dist/types/components/index.d.ts +2 -0
- package/dist/types/components/surfboard/arrange-layout-button.d.ts +8 -0
- package/dist/types/components/surfboard/filter/types.d.ts +7 -0
- package/dist/types/components/surfboard/screen-size-preview-button.d.ts +10 -0
- package/dist/types/components/visual/matrix-table/matrix-card-view.d.ts +3 -0
- package/dist/types/index.js +6 -6
- package/dist/types/lib/charts/table-chart-types.d.ts +4 -0
- package/dist/types/lib/charts/types.d.ts +2 -2
- package/dist/types/lib/dashboard-inputs/dashboard-filter-mapping-authoring.d.ts +346 -21
- package/dist/types/lib/dashboard-inputs/dashboard-filter-value-identity.d.ts +65 -0
- package/dist/types/lib/dashboard-inputs/dashboard-input-values.d.ts +6 -0
- package/dist/types/lib/dashboard-inputs/filter-settings.d.ts +2 -0
- package/dist/types/lib/dashboard-inputs/prepare-loaded-dashboard.d.ts +15 -0
- package/dist/types/lib/dashboard-inputs/resolve-selection-input.d.ts +3 -3
- package/dist/types/lib/hooks/use-dashboard-card.d.ts +2 -0
- package/dist/types/lib/matrix-table/matrix-delivery-policy.d.ts +1 -1
- package/dist/types/lib/matrix-table/matrix-editor.d.ts +52 -0
- package/dist/types/lib/matrix-table/matrix-runtime-types.d.ts +9 -1
- package/dist/types/lib/matrix-table/matrix-runtime.d.ts +5 -1
- package/dist/types/lib/query-context/dashboard-filter-mapping-resolution.d.ts +149 -10
- package/dist/types/lib/stores/dashboard-store.d.ts +137 -6
- package/dist/types/lib/types/common-types.d.ts +8 -0
- package/dist/types/lib/types/explorer-types.d.ts +10 -0
- package/dist/types/lib/types/semantic-types.d.ts +84 -0
- package/dist/types/lib/utils/build-saved-editor-card.d.ts +20 -0
- package/dist/types/lib/utils/card-type-change.d.ts +16 -0
- package/dist/types/lib/utils/field-availability-context.d.ts +25 -0
- package/dist/types/lib/utils/field-placement.d.ts +96 -0
- package/dist/types/lib/utils/field-state-calculator.d.ts +161 -0
- package/dist/types/lib/utils/qualified-entity-name.d.ts +2 -0
- package/dist/types/shared/analytics-protocol/applied-constraints.d.ts +57 -1
- package/dist/types/shared/analytics-protocol/field-provenance.d.ts +89 -0
- package/dist/types/shared/analytics-protocol/index.d.ts +2 -0
- package/dist/types/shared/analytics-protocol/query-policies.d.ts +52 -0
- package/dist/types/shared/analytics-protocol/time-window-schema.d.ts +1 -1
- package/dist/types/shared/analytics-protocol/time-window.d.ts +40 -1
- package/dist/types/shared/assistant-context/saved-dashboard-context.d.ts +4 -1
- package/dist/types/shared/assistant-protocol/answer-text.d.ts +20 -0
- package/dist/types/shared/assistant-protocol/context.d.ts +29 -29
- package/dist/types/shared/assistant-protocol/index.d.ts +1 -0
- package/dist/types/shared/assistant-protocol/limits.d.ts +6 -1
- package/dist/types/shared/assistant-protocol/parts.d.ts +43 -3
- package/dist/types/shared/assistant-protocol/request.d.ts +14 -2
- package/dist/types/shared/dashboard-authoring/calculated-field-identity.d.ts +3 -0
- package/dist/types/shared/dashboard-authoring/changes/card-query-part.d.ts +487 -0
- package/dist/types/shared/dashboard-authoring/changes/card-types.d.ts +34 -0
- package/dist/types/shared/dashboard-authoring/changes/dashboard-change.d.ts +7886 -0
- package/dist/types/shared/dashboard-authoring/changes/diagnostics.d.ts +45 -0
- package/dist/types/shared/dashboard-authoring/changes/read-card-query.d.ts +54 -0
- package/dist/types/shared/dashboard-authoring/changes/resolve-dashboard-changes.d.ts +96 -0
- package/dist/types/shared/dashboard-authoring/click-to-filter-settings.d.ts +3 -3
- package/dist/types/shared/dashboard-authoring/column-catalog.d.ts +32 -0
- package/dist/types/shared/dashboard-authoring/contracts.d.ts +0 -55
- package/dist/types/shared/dashboard-authoring/control-execution-contract.d.ts +24 -14
- package/dist/types/shared/dashboard-authoring/dashboard-card-source-index.d.ts +9 -1
- package/dist/types/shared/dashboard-authoring/dashboard-filter-automatic-target.d.ts +4 -4
- package/dist/types/shared/dashboard-authoring/dashboard-filter-mapping-contract.d.ts +3 -1
- package/dist/types/shared/dashboard-authoring/dashboard-filter-mapping-types.d.ts +27 -1
- package/dist/types/shared/dashboard-authoring/dashboard-filter-value-compatibility.d.ts +12 -3
- package/dist/types/shared/dashboard-authoring/dashboard-input-scope.d.ts +26 -0
- package/dist/types/shared/dashboard-authoring/filter-applicability.d.ts +75 -0
- package/dist/types/shared/dashboard-authoring/filter-reach-copy.d.ts +18 -0
- package/dist/types/shared/dashboard-authoring/filter-reach-preview.d.ts +97 -0
- package/dist/types/shared/dashboard-authoring/index.d.ts +22 -2
- package/dist/types/shared/dashboard-authoring/operations/apply-dashboard-operations.d.ts +10 -37
- package/dist/types/shared/dashboard-authoring/operations/operation-types.d.ts +189 -0
- package/dist/types/shared/dashboard-authoring/outline/outline-dashboard.d.ts +101 -0
- package/dist/types/shared/dashboard-authoring/outline/outline-filters.d.ts +100 -0
- package/dist/types/shared/dashboard-authoring/semantic-auto-join-card.d.ts +22 -0
- package/dist/types/shared/dashboard-authoring/validators.d.ts +1 -2
- package/dist/types/shared/layouts/engine/grid.d.ts +25 -0
- package/dist/types/shared/layouts/engine/index.d.ts +4 -0
- package/dist/types/shared/layouts/engine/sheet-layout.d.ts +7 -0
- package/dist/types/shared/layouts/engine/types.d.ts +125 -0
- package/dist/types/shared/layouts/index.d.ts +1 -2
- package/package.json +2 -2
- package/dist/chunks/apply-dashboard-operations-CZEMsx8E.js +0 -2080
- package/dist/chunks/calendar-day-equality-dvoQp1xW.js +0 -410
- package/dist/chunks/comparison-window-caption-D4E6IHPD.js +0 -1624
- package/dist/chunks/custom-visual-inputs-DLCD9Y5V.js +0 -329
- package/dist/chunks/dashboard-controls-Cq05n3e0.js +0 -2315
- package/dist/chunks/dashboard-filter-value-compatibility-CwQ_iSNb.js +0 -108
- package/dist/chunks/matrix-analytical-definition-C7Gb0e12.js +0 -117
- package/dist/chunks/normalize-dashboard-for-dirty-check-Bk3VYv_q.js +0 -67
- package/dist/chunks/numeric-presentation-7X_IrD58.js +0 -5226
- package/dist/chunks/resolve-dashboard-input-context-DJ2tICwz.js +0 -9415
- package/dist/chunks/stable-serialize-CfqXeiBP.js +0 -6
- package/dist/chunks/table-settings-CLZocegs.js +0 -501
- package/dist/chunks/use-debounced-dirty-check-BwAbnX_5.js +0 -59
- package/dist/chunks/zoned-wall-clock-BkxV9jS2.js +0 -46
- package/dist/types/shared/dashboard-authoring/change-compiler.d.ts +0 -7
- package/dist/types/shared/dashboard-authoring/layout-compiler.d.ts +0 -2
- package/dist/types/shared/layouts/create-frame-layouts.d.ts +0 -27
- package/dist/types/shared/layouts/frame-layouts.d.ts +0 -23
|
@@ -1,144 +1,149 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { D as
|
|
5
|
-
import { N as
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import "../chunks/matrix-operation-contract-
|
|
10
|
-
import "../chunks/analytics-base-schemas-
|
|
1
|
+
var Ot = Object.defineProperty;
|
|
2
|
+
var Nt = (e, t, a) => t in e ? Ot(e, t, { enumerable: !0, configurable: !0, writable: !0, value: a }) : e[t] = a;
|
|
3
|
+
var ke = (e, t, a) => Nt(e, typeof t != "symbol" ? t + "" : t, a);
|
|
4
|
+
import { D as it, r as It, b as qt, c as Pt, a as nt, d as Mt } from "../chunks/filter-reach-copy-CGWsL_ez.js";
|
|
5
|
+
import { N as yi, R as _i, f as Ci, j as Si, l as vi, k as wi, u as xi, q as Di, e as Ti, i as ki, y as $i, z as Fi, s as Ai, v as Ri, t as Ei, m as Oi, n as Ni, p as qi, g as Pi, o as Mi, h as Li, x as Bi, w as Vi } from "../chunks/filter-reach-copy-CGWsL_ez.js";
|
|
6
|
+
import { M as Lt, N as Bt, O as $e, P as Vt, Q as Gt, R as Ut, S as jt, T as zt, U as Qt, V as Kt, W as Ht, X as Wt, Y as de, Z as Yt, _ as Xt, $ as fe, a0 as Jt, a1 as Zt, a2 as Me, a3 as yt, a4 as oe, a5 as ne, a6 as Ee, a7 as ea, a8 as Le, a9 as ta, aa, ab as sa, ac as ot, ad as ia, ae as na, af as _t, ag as ie, ah as rt, ai as oa, aj as ra, ak as Oe, al as da, am as dt, an as la, ao as lt, ap as ca, aq as ce, ar as ua, as as ct, b as ha, at as fa, au as pa, av as ma, aw as ga, ax as ut, ay as ba, az as Ia, aA as ya, aB as _a, aC as Ca, aD as Sa, aE as va, aF as wa, aG as xa, aH as Fe, aI as Da } from "../chunks/global-date-filter-utils-BhAu8zIM.js";
|
|
7
|
+
import { cx as Ui, aT as ji, c8 as zi, c9 as Qi, co as Ki, cn as Hi, ch as Wi, cp as Yi, cq as Xi, bO as Ji, bP as Zi, bQ as en, bL as tn, bM as an, bN as sn, bH as nn, bI as on, bK as rn, bJ as dn, bR as ln, cK as cn, ca as un, b7 as hn, b6 as fn, c2 as pn, cz as mn, bh as gn, cD as bn, cl as In, cm as yn, aQ as _n, cC as Cn, bk as Sn, cA as vn, by as wn, cg as xn, bS as Dn, bz as Tn, cM as kn, aL as $n, cE as Fn, ck as An, aM as Rn, c1 as En, c0 as On, bb as Nn, a$ as qn, b3 as Pn, cI as Mn, bt as Ln, d as Bn, a as Vn, bl as Gn, aN as Un, cw as jn, cO as zn, b0 as Qn, b1 as Kn, b2 as Hn, bg as Wn, bi as Yn, c5 as Xn, g as Jn, bG as Zn, bp as eo, bF as to, bC as ao, c6 as so, aV as io, aW as no, cG as oo, bm as ro, b8 as lo, ci as co, bd as uo, cu as ho, br as fo, bY as po, cN as mo, aR as go, b_ as bo, b$ as Io, cJ as yo, bw as _o, bo as Co, bq as So, bc as vo, bs as wo, cr as xo, cF as Do, aO as To, cy as ko, bv as $o, b9 as Fo, bB as Ao, cs as Ro, c3 as Eo, c4 as Oo, aU as No, cL as qo, c7 as Po, ce as Mo, bE as Lo, aY as Bo, ct as Vo, cH as Go, aJ as Uo, cv as jo, bx as zo, ba as Qo, bU as Ko, a_ as Ho, b4 as Wo, b5 as Yo, cb as Xo, cc as Jo, aZ as Zo, bW as er, bX as tr, bV as ar, aX as sr, bD as ir, cd as nr, bu as or, cj as rr, aK as dr, bA as lr, bZ as cr, aS as ur, cB as hr, bj as fr, bn as pr, aP as mr, bT as gr, bf as br, be as Ir, cf as yr } from "../chunks/global-date-filter-utils-BhAu8zIM.js";
|
|
8
|
+
import { x as Ta, ao as Be, ap as ka, a3 as Ct, ab as $a, a6 as Fa, ad as St, aD as Aa, aB as vt, aC as Ra } from "../chunks/validators-C-aOQlTB.js";
|
|
9
|
+
import "../chunks/matrix-operation-contract-D6vYkZK4.js";
|
|
10
|
+
import "../chunks/analytics-base-schemas-BKs3flFS.js";
|
|
11
11
|
import "zod";
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import { D as
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
|
|
12
|
+
import { a as Ea, r as Oa } from "../chunks/index-CtoK1Lgu.js";
|
|
13
|
+
import { n as Na } from "../chunks/operators-B3zZoskU.js";
|
|
14
|
+
import { a as Cr, b as Sr, r as vr } from "../chunks/raw-temporal-presentation-DypB7sMX.js";
|
|
15
|
+
import { w as re } from "../chunks/table-settings-WysCBj62.js";
|
|
16
|
+
import { D as xr, x as Dr, y as Tr, F as kr, B as $r, z as Fr, G as Ar, A as Rr, v as Er } from "../chunks/table-settings-WysCBj62.js";
|
|
17
|
+
import { v as ve, w as qa } from "../chunks/resolve-dashboard-input-context-D0JDUa4h.js";
|
|
18
|
+
import { J as Nr, P as qr, K as Pr, b as Mr, N as Lr, I as Br, z as Vr, Q as Gr, R as Ur, M as jr, C as zr, D as Qr, G as Kr, H as Hr, F as Wr, x as Yr, y as Xr, p as Jr, O as Zr, E as ed, A as td, L as ad, B as sd } from "../chunks/resolve-dashboard-input-context-D0JDUa4h.js";
|
|
19
|
+
import { G as nd, F as od, D as rd, E as dd, H as ld, I as cd } from "../chunks/pivot-result-lifecycle-pwq3b7LC.js";
|
|
20
|
+
import { e as Pa, w as Ma } from "../chunks/metric-comparison-zpGw4lD6.js";
|
|
21
|
+
import { p as La } from "../chunks/report-runtime-context-hWiTCzFV.js";
|
|
22
|
+
import { m as hd, a as fd, r as pd } from "../chunks/matrix-card-LiMEipvq.js";
|
|
23
|
+
import { n as ht, t as Ba } from "../chunks/matrix-analytical-definition-B9vW-osb.js";
|
|
24
|
+
import "../chunks/index-CuHybtft.js";
|
|
25
|
+
import "../value-format-preferences/index.js";
|
|
26
|
+
import "../chunks/_commonjsHelpers-DimLPMtv.js";
|
|
27
|
+
function Y(e) {
|
|
23
28
|
return e && typeof e == "object" ? e : null;
|
|
24
29
|
}
|
|
25
|
-
function
|
|
30
|
+
function Z(e) {
|
|
26
31
|
return typeof e == "string" ? e : null;
|
|
27
32
|
}
|
|
28
|
-
function
|
|
29
|
-
var t, a,
|
|
30
|
-
return !!(e && typeof e == "object") && (((t =
|
|
33
|
+
function Va(e) {
|
|
34
|
+
var t, a, s;
|
|
35
|
+
return !!(e && typeof e == "object") && (((t = Y(e)) == null ? void 0 : t.kind) === "semantic" || ((a = Y(e)) == null ? void 0 : a.kind) === "physical" || ((s = Y(e)) == null ? void 0 : s.kind) === "sql");
|
|
31
36
|
}
|
|
32
|
-
function
|
|
33
|
-
return
|
|
37
|
+
function me(e) {
|
|
38
|
+
return Va(e) ? e.kind === "semantic" ? !!(e.domainId && e.datasetName) : e.kind === "physical" ? !!(e.connectionId && e.tableName) : !1 : !1;
|
|
34
39
|
}
|
|
35
|
-
function
|
|
36
|
-
return
|
|
40
|
+
function ni(e) {
|
|
41
|
+
return Ta(e);
|
|
37
42
|
}
|
|
38
|
-
function
|
|
39
|
-
return
|
|
43
|
+
function wt(e, t) {
|
|
44
|
+
return Be(e, t);
|
|
40
45
|
}
|
|
41
|
-
function
|
|
42
|
-
return
|
|
46
|
+
function Ga(e, t) {
|
|
47
|
+
return ka(e, t);
|
|
43
48
|
}
|
|
44
|
-
function
|
|
49
|
+
function we(e) {
|
|
45
50
|
const t = [];
|
|
46
51
|
for (const a of e) {
|
|
47
|
-
const
|
|
48
|
-
(
|
|
52
|
+
const s = t.findIndex(
|
|
53
|
+
(r) => wt(r, a)
|
|
49
54
|
);
|
|
50
|
-
|
|
51
|
-
t[
|
|
55
|
+
s === -1 ? t.push(a) : t[s] = Ga(
|
|
56
|
+
t[s],
|
|
52
57
|
a
|
|
53
58
|
);
|
|
54
59
|
}
|
|
55
60
|
return t;
|
|
56
61
|
}
|
|
57
|
-
function
|
|
58
|
-
return
|
|
62
|
+
function oi(e) {
|
|
63
|
+
return we(e)[0];
|
|
59
64
|
}
|
|
60
|
-
function
|
|
61
|
-
return e.kind !== "semantic" || e.connectionId || (t == null ? void 0 : t.kind) !== "semantic" || !
|
|
65
|
+
function Ne(e, t) {
|
|
66
|
+
return e.kind !== "semantic" || e.connectionId || (t == null ? void 0 : t.kind) !== "semantic" || !Be(e, t) || !t.connectionId ? e : { ...e, connectionId: t.connectionId };
|
|
62
67
|
}
|
|
63
|
-
function
|
|
64
|
-
return
|
|
68
|
+
function qe(e) {
|
|
69
|
+
return me(e) ? e : void 0;
|
|
65
70
|
}
|
|
66
|
-
function
|
|
71
|
+
function ft(e, t) {
|
|
67
72
|
if (!(e.kind !== "semantic" || e.connectionId))
|
|
68
73
|
return t.find(
|
|
69
|
-
(a) => (a == null ? void 0 : a.kind) === "semantic" &&
|
|
74
|
+
(a) => (a == null ? void 0 : a.kind) === "semantic" && Be(e, a) && !!a.connectionId
|
|
70
75
|
);
|
|
71
76
|
}
|
|
72
|
-
function
|
|
73
|
-
const a =
|
|
74
|
-
return a ?
|
|
77
|
+
function J(e, t) {
|
|
78
|
+
const a = qe(e == null ? void 0 : e.source);
|
|
79
|
+
return a ? Ne(a, t) : void 0;
|
|
75
80
|
}
|
|
76
|
-
function
|
|
81
|
+
function Ua({
|
|
77
82
|
explicitSource: e,
|
|
78
83
|
field: t,
|
|
79
84
|
defaultSource: a,
|
|
80
|
-
fallbackSources:
|
|
85
|
+
fallbackSources: s
|
|
81
86
|
}) {
|
|
82
|
-
const
|
|
83
|
-
|
|
84
|
-
|
|
87
|
+
const r = [a, ...s || []], n = qe(e), i = n ? Ne(
|
|
88
|
+
n,
|
|
89
|
+
ft(n, r)
|
|
85
90
|
) : void 0;
|
|
86
|
-
if (
|
|
87
|
-
return
|
|
91
|
+
if (i)
|
|
92
|
+
return i;
|
|
88
93
|
if (e !== void 0)
|
|
89
94
|
return;
|
|
90
|
-
const
|
|
91
|
-
|
|
92
|
-
|
|
95
|
+
const d = J(t, a), u = d ? Ne(
|
|
96
|
+
d,
|
|
97
|
+
ft(d, r)
|
|
93
98
|
) : void 0;
|
|
94
|
-
if (
|
|
95
|
-
return
|
|
99
|
+
if (u)
|
|
100
|
+
return u;
|
|
96
101
|
if ((t == null ? void 0 : t.source) === void 0)
|
|
97
|
-
return
|
|
102
|
+
return qe(a);
|
|
98
103
|
}
|
|
99
|
-
function
|
|
104
|
+
function ri(e, t) {
|
|
100
105
|
if (!(e != null && e.name) || !(t != null && t.name) || e.name !== t.name)
|
|
101
106
|
return !1;
|
|
102
|
-
const a =
|
|
103
|
-
return !a || !
|
|
107
|
+
const a = J(e), s = J(t);
|
|
108
|
+
return !a || !s ? !0 : wt(a, s);
|
|
104
109
|
}
|
|
105
|
-
function
|
|
110
|
+
function se(e) {
|
|
106
111
|
var t;
|
|
107
|
-
return
|
|
112
|
+
return Z((t = Y(e)) == null ? void 0 : t.kind);
|
|
108
113
|
}
|
|
109
|
-
function
|
|
114
|
+
function xt(e) {
|
|
110
115
|
var t, a;
|
|
111
|
-
return
|
|
116
|
+
return se(e) !== "semantic" ? null : ((a = Z((t = Y(e)) == null ? void 0 : t.domainId)) == null ? void 0 : a.trim()) || null;
|
|
112
117
|
}
|
|
113
|
-
function
|
|
118
|
+
function ja(e) {
|
|
114
119
|
var t;
|
|
115
|
-
return
|
|
120
|
+
return se(e) !== "semantic" ? null : Z((t = Y(e)) == null ? void 0 : t.datasetName);
|
|
116
121
|
}
|
|
117
|
-
function
|
|
122
|
+
function za(e) {
|
|
118
123
|
var t;
|
|
119
|
-
return
|
|
124
|
+
return se(e) !== "semantic" ? null : Z((t = Y(e)) == null ? void 0 : t.datasetId);
|
|
120
125
|
}
|
|
121
|
-
function
|
|
126
|
+
function Qa(e) {
|
|
122
127
|
var t;
|
|
123
|
-
return
|
|
128
|
+
return se(e) !== "physical" ? null : Z((t = Y(e)) == null ? void 0 : t.connectionId);
|
|
124
129
|
}
|
|
125
|
-
function
|
|
130
|
+
function Ka(e) {
|
|
126
131
|
var t;
|
|
127
|
-
return
|
|
132
|
+
return se(e) !== "physical" ? null : Z((t = Y(e)) == null ? void 0 : t.tableName);
|
|
128
133
|
}
|
|
129
|
-
function
|
|
134
|
+
function Ha(e) {
|
|
130
135
|
var t;
|
|
131
|
-
return
|
|
136
|
+
return se(e) !== "physical" ? "" : Z((t = Y(e)) == null ? void 0 : t.databaseName) || "";
|
|
132
137
|
}
|
|
133
|
-
function
|
|
138
|
+
function Wa(e) {
|
|
134
139
|
var t;
|
|
135
|
-
return
|
|
140
|
+
return se(e) !== "physical" ? "" : Z((t = Y(e)) == null ? void 0 : t.schemaName) || "";
|
|
136
141
|
}
|
|
137
|
-
function
|
|
142
|
+
function Ya(e) {
|
|
138
143
|
if (e.analyticsIntent && typeof e.analyticsIntent == "object" && "source" in e.analyticsIntent)
|
|
139
144
|
return e.analyticsIntent.source;
|
|
140
145
|
}
|
|
141
|
-
function
|
|
146
|
+
function Xa({
|
|
142
147
|
datasets: e,
|
|
143
148
|
requireAtLeastOne: t
|
|
144
149
|
}) {
|
|
@@ -146,27 +151,27 @@ function tt({
|
|
|
146
151
|
return { ok: !1, issue: "invalid_dataset_count" };
|
|
147
152
|
if (e.length <= 1)
|
|
148
153
|
return { ok: !0 };
|
|
149
|
-
const a = e.map(
|
|
150
|
-
return a.some((
|
|
154
|
+
const a = e.map(xt), s = new Set(a.filter(Boolean));
|
|
155
|
+
return a.some((r) => !r) || s.size !== 1 ? { ok: !1, issue: "invalid_multi_dataset_scope" } : { ok: !0 };
|
|
151
156
|
}
|
|
152
|
-
function
|
|
157
|
+
function Ve(e, t) {
|
|
153
158
|
if (!t)
|
|
154
159
|
return !1;
|
|
155
160
|
if (t.kind === "semantic") {
|
|
156
|
-
const a =
|
|
157
|
-
return
|
|
161
|
+
const a = za(e);
|
|
162
|
+
return xt(e) === t.domainId ? a && t.datasetId ? a === t.datasetId : ja(e) === t.datasetName : !1;
|
|
158
163
|
}
|
|
159
|
-
return t.kind === "physical" ?
|
|
164
|
+
return t.kind === "physical" ? Qa(e) === t.connectionId && Ka(e) === t.tableName && Ha(e) === (t.databaseName || "") && Wa(e) === (t.schemaName || "") : !1;
|
|
160
165
|
}
|
|
161
|
-
function
|
|
166
|
+
function di(e, t) {
|
|
162
167
|
return e.find(
|
|
163
|
-
(a) =>
|
|
168
|
+
(a) => Ve(a, t)
|
|
164
169
|
);
|
|
165
170
|
}
|
|
166
|
-
function
|
|
171
|
+
function M(e, t, a) {
|
|
167
172
|
return a ? { code: e, message: t, cardId: a } : { code: e, message: t };
|
|
168
173
|
}
|
|
169
|
-
function
|
|
174
|
+
function ye(e) {
|
|
170
175
|
const t = /* @__PURE__ */ new Set();
|
|
171
176
|
for (const a of e) {
|
|
172
177
|
if (t.has(a))
|
|
@@ -175,19 +180,19 @@ function P(e) {
|
|
|
175
180
|
}
|
|
176
181
|
return null;
|
|
177
182
|
}
|
|
178
|
-
function
|
|
183
|
+
function Ja({
|
|
179
184
|
card: e,
|
|
180
185
|
datasets: t,
|
|
181
186
|
errors: a
|
|
182
187
|
}) {
|
|
183
188
|
if (e.type === "text")
|
|
184
189
|
return;
|
|
185
|
-
const
|
|
186
|
-
if (!
|
|
190
|
+
const s = Ya(e);
|
|
191
|
+
if (!s) {
|
|
187
192
|
if (t.length <= 1)
|
|
188
193
|
return;
|
|
189
194
|
a.push(
|
|
190
|
-
|
|
195
|
+
M(
|
|
191
196
|
"missing_card_analytics_source",
|
|
192
197
|
"Multi-dataset dashboard cards must include analytics intent with a source so the materializer can choose the correct dataset.",
|
|
193
198
|
e.id
|
|
@@ -195,68 +200,68 @@ function be({
|
|
|
195
200
|
);
|
|
196
201
|
return;
|
|
197
202
|
}
|
|
198
|
-
t.some((
|
|
199
|
-
|
|
203
|
+
t.some((r) => Ve(r, s)) || a.push(
|
|
204
|
+
M(
|
|
200
205
|
"invalid_card_analytics_source",
|
|
201
206
|
"Dashboard cards with an explicit analytics source must use one of the selected datasets.",
|
|
202
207
|
e.id
|
|
203
208
|
)
|
|
204
209
|
);
|
|
205
210
|
}
|
|
206
|
-
function
|
|
211
|
+
function _e(e) {
|
|
207
212
|
return e.map((t) => t == null ? void 0 : t.source).filter((t) => !!t);
|
|
208
213
|
}
|
|
209
|
-
function
|
|
214
|
+
function Ae(e) {
|
|
210
215
|
return Array.isArray(e) ? e.filter(
|
|
211
216
|
(t) => !!(t && typeof t == "object")
|
|
212
217
|
) : [];
|
|
213
218
|
}
|
|
214
|
-
function
|
|
219
|
+
function pt(e) {
|
|
215
220
|
return Array.isArray(e) ? e.filter(
|
|
216
221
|
(t) => !!(t && typeof t == "object")
|
|
217
222
|
) : [];
|
|
218
223
|
}
|
|
219
|
-
function
|
|
220
|
-
var a,
|
|
224
|
+
function Za(e) {
|
|
225
|
+
var a, s;
|
|
221
226
|
if (!e)
|
|
222
227
|
return [];
|
|
223
228
|
const t = [e.source];
|
|
224
229
|
return e.kind === "metric" ? t.push(
|
|
225
|
-
...
|
|
226
|
-
...
|
|
230
|
+
..._e([
|
|
231
|
+
...Ae(e.measures),
|
|
227
232
|
e.primaryMeasure,
|
|
228
233
|
e.dateField,
|
|
229
|
-
...
|
|
230
|
-
...
|
|
234
|
+
...Ae(e.dimensions),
|
|
235
|
+
...pt(e.filters).map((r) => r.field)
|
|
231
236
|
])
|
|
232
237
|
) : e.kind === "records" ? t.push(
|
|
233
|
-
...
|
|
234
|
-
...
|
|
238
|
+
..._e([
|
|
239
|
+
...Ae(e.fields),
|
|
235
240
|
e.dateField,
|
|
236
241
|
(a = e.orderBy) == null ? void 0 : a.field,
|
|
237
|
-
...
|
|
242
|
+
...pt(e.filters).map((r) => r.field)
|
|
238
243
|
])
|
|
239
|
-
) : e.kind === "inputOptions" ? (((
|
|
240
|
-
...
|
|
244
|
+
) : e.kind === "inputOptions" ? (((s = e.population) == null ? void 0 : s.kind) === "related_population" && t.push(e.population.baseSource), t.push(
|
|
245
|
+
..._e([
|
|
241
246
|
e.labelField,
|
|
242
247
|
e.valueField,
|
|
243
248
|
e.searchField,
|
|
244
249
|
...e.disambiguationFields || []
|
|
245
250
|
])
|
|
246
|
-
)) : e.kind === "sql" && t.push(...
|
|
251
|
+
)) : e.kind === "sql" && t.push(..._e(e.fields || [])), t;
|
|
247
252
|
}
|
|
248
|
-
function
|
|
253
|
+
function es({
|
|
249
254
|
card: e,
|
|
250
255
|
datasets: t,
|
|
251
256
|
errors: a
|
|
252
257
|
}) {
|
|
253
258
|
if (e.type !== "text") {
|
|
254
|
-
for (const
|
|
255
|
-
if (
|
|
256
|
-
(
|
|
259
|
+
for (const s of Za(e.analyticsIntent))
|
|
260
|
+
if (s && !t.some(
|
|
261
|
+
(r) => Ve(r, s)
|
|
257
262
|
)) {
|
|
258
263
|
a.push(
|
|
259
|
-
|
|
264
|
+
M(
|
|
260
265
|
"invalid_card_query_source",
|
|
261
266
|
"Dashboard card query field references must use one of the selected datasets.",
|
|
262
267
|
e.id
|
|
@@ -266,36 +271,36 @@ function ge({
|
|
|
266
271
|
}
|
|
267
272
|
}
|
|
268
273
|
}
|
|
269
|
-
function
|
|
274
|
+
function ts({
|
|
270
275
|
card: e,
|
|
271
276
|
errors: t
|
|
272
277
|
}) {
|
|
273
278
|
if (e.type === "text" || !e.analyticsIntent)
|
|
274
279
|
return;
|
|
275
|
-
const a =
|
|
280
|
+
const a = Ct(e.analyticsIntent);
|
|
276
281
|
if (!a.ok)
|
|
277
|
-
for (const
|
|
282
|
+
for (const s of a.errors)
|
|
278
283
|
t.push(
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
284
|
+
M(
|
|
285
|
+
s.code,
|
|
286
|
+
s.path ? `${s.path}: ${s.message}` : s.message,
|
|
282
287
|
e.id
|
|
283
288
|
)
|
|
284
289
|
);
|
|
285
290
|
}
|
|
286
|
-
function
|
|
291
|
+
function as({
|
|
287
292
|
datasets: e,
|
|
288
293
|
errors: t,
|
|
289
294
|
requireAtLeastOne: a
|
|
290
295
|
}) {
|
|
291
|
-
const
|
|
296
|
+
const s = Xa({
|
|
292
297
|
datasets: e,
|
|
293
298
|
requireAtLeastOne: a
|
|
294
299
|
});
|
|
295
|
-
if (!
|
|
296
|
-
if (
|
|
300
|
+
if (!s.ok) {
|
|
301
|
+
if (s.issue === "invalid_dataset_count") {
|
|
297
302
|
t.push(
|
|
298
|
-
|
|
303
|
+
M(
|
|
299
304
|
"invalid_dataset_count",
|
|
300
305
|
"Dashboard authoring requires at least one selected dataset."
|
|
301
306
|
)
|
|
@@ -303,337 +308,160 @@ function Ce({
|
|
|
303
308
|
return;
|
|
304
309
|
}
|
|
305
310
|
t.push(
|
|
306
|
-
|
|
311
|
+
M(
|
|
307
312
|
"invalid_multi_dataset_scope",
|
|
308
313
|
"Multi-dataset dashboard authoring is limited to semantic datasets from one domain."
|
|
309
314
|
)
|
|
310
315
|
);
|
|
311
316
|
}
|
|
312
317
|
}
|
|
313
|
-
function
|
|
318
|
+
function ss({
|
|
314
319
|
input: e,
|
|
315
320
|
errors: t
|
|
316
321
|
}) {
|
|
317
322
|
var a;
|
|
318
323
|
(a = e.filter.sql) != null && a.trim() && t.push(
|
|
319
|
-
|
|
324
|
+
M(
|
|
320
325
|
"generated_filter_sql_out_of_scope",
|
|
321
326
|
`Generated dashboard filter "${e.label}" must use grounded filter configuration; custom SQL is outside the dashboard-authoring contract.`
|
|
322
327
|
)
|
|
323
328
|
);
|
|
324
329
|
}
|
|
325
|
-
function
|
|
330
|
+
function is({
|
|
326
331
|
card: e,
|
|
327
332
|
errors: t
|
|
328
333
|
}) {
|
|
329
334
|
"interactionConfig" in e && t.push(
|
|
330
|
-
|
|
335
|
+
M(
|
|
331
336
|
"legacy_card_interactions_unsupported",
|
|
332
337
|
"Dashboard authoring accepts click-to-filter settings only through card.clickToFilter.",
|
|
333
338
|
e.id
|
|
334
339
|
)
|
|
335
|
-
), e.clickToFilter !== void 0 && !
|
|
336
|
-
|
|
340
|
+
), e.clickToFilter !== void 0 && !Lt.safeParse(e.clickToFilter).success && t.push(
|
|
341
|
+
M(
|
|
337
342
|
"invalid_click_to_filter",
|
|
338
343
|
"Dashboard card clickToFilter settings do not match the canonical schema.",
|
|
339
344
|
e.id
|
|
340
345
|
)
|
|
341
|
-
), e.respondsToSelections !== void 0 && !
|
|
342
|
-
|
|
346
|
+
), e.respondsToSelections !== void 0 && !Bt.safeParse(e.respondsToSelections).success && t.push(
|
|
347
|
+
M(
|
|
343
348
|
"invalid_responds_to_selections",
|
|
344
349
|
"Dashboard card respondsToSelections must be a boolean.",
|
|
345
350
|
e.id
|
|
346
351
|
)
|
|
347
352
|
);
|
|
348
353
|
}
|
|
349
|
-
function
|
|
350
|
-
var
|
|
354
|
+
function ns(e) {
|
|
355
|
+
var A, c;
|
|
351
356
|
const t = [];
|
|
352
357
|
if (!e || typeof e != "object")
|
|
353
358
|
return {
|
|
354
359
|
ok: !1,
|
|
355
360
|
errors: [
|
|
356
|
-
|
|
361
|
+
M(
|
|
357
362
|
"invalid_plan",
|
|
358
363
|
"Dashboard plan must be a structured object."
|
|
359
364
|
)
|
|
360
365
|
],
|
|
361
366
|
warnings: []
|
|
362
367
|
};
|
|
363
|
-
const a = e,
|
|
364
|
-
a.version !== 1 && t.push(
|
|
365
|
-
const
|
|
366
|
-
|
|
367
|
-
|
|
368
|
+
const a = e, s = [...a.warnings || []];
|
|
369
|
+
a.version !== 1 && t.push(M("invalid_version", "Dashboard plan version must be 1.")), (A = a.title) != null && A.trim() || t.push(M("missing_title", "Dashboard plan needs a title."));
|
|
370
|
+
const r = Array.isArray(a.datasets) ? a.datasets : [], n = Array.isArray(a.sheets) ? a.sheets : [];
|
|
371
|
+
as({ datasets: r, errors: t, requireAtLeastOne: !0 }), n.length !== 1 && t.push(
|
|
372
|
+
M(
|
|
368
373
|
"invalid_sheet_count",
|
|
369
374
|
"MVP dashboard authoring creates exactly one dashboard sheet."
|
|
370
375
|
)
|
|
371
376
|
);
|
|
372
|
-
const
|
|
373
|
-
|
|
374
|
-
|
|
377
|
+
const i = n[0];
|
|
378
|
+
i && i.kind !== "dashboard" && t.push(
|
|
379
|
+
M("invalid_sheet_kind", 'Generated sheet must use kind "dashboard".')
|
|
375
380
|
);
|
|
376
|
-
const
|
|
377
|
-
|
|
378
|
-
|
|
381
|
+
const d = (i == null ? void 0 : i.cards) || [];
|
|
382
|
+
d.length > it && t.push(
|
|
383
|
+
M(
|
|
379
384
|
"too_many_cards",
|
|
380
|
-
`Generated dashboards can contain at most ${
|
|
385
|
+
`Generated dashboards can contain at most ${it} cards.`
|
|
381
386
|
)
|
|
382
387
|
);
|
|
383
|
-
const
|
|
384
|
-
|
|
385
|
-
|
|
388
|
+
const u = ye(d.map((m) => m.id));
|
|
389
|
+
u && t.push(
|
|
390
|
+
M("duplicate_card_id", `Duplicate generated card id: ${u}.`)
|
|
386
391
|
);
|
|
387
|
-
const
|
|
388
|
-
|
|
389
|
-
|
|
392
|
+
const b = ye(d.map((m) => m.frameId));
|
|
393
|
+
b && t.push(
|
|
394
|
+
M(
|
|
390
395
|
"duplicate_frame_id",
|
|
391
|
-
`Duplicate generated frame id: ${
|
|
396
|
+
`Duplicate generated frame id: ${b}.`
|
|
392
397
|
)
|
|
393
398
|
);
|
|
394
|
-
for (const
|
|
395
|
-
(
|
|
396
|
-
|
|
399
|
+
for (const m of d)
|
|
400
|
+
(c = m.title) != null && c.trim() || t.push(M("missing_card_title", "Card title is required.", m.id)), m.type === "custom" && t.push(
|
|
401
|
+
M(
|
|
397
402
|
"custom_visual_out_of_scope",
|
|
398
403
|
"Whole-dashboard authoring supports built-in visual types only.",
|
|
399
|
-
|
|
404
|
+
m.id
|
|
400
405
|
)
|
|
401
|
-
),
|
|
402
|
-
|
|
406
|
+
), m.type !== "text" && !m.analyticsIntent && s.push(
|
|
407
|
+
M(
|
|
403
408
|
"missing_analytics_intent",
|
|
404
409
|
"Non-text card has no analytics intent and may be skipped by the app layer.",
|
|
405
|
-
|
|
410
|
+
m.id
|
|
406
411
|
)
|
|
407
|
-
),
|
|
408
|
-
const
|
|
409
|
-
|
|
410
|
-
|
|
412
|
+
), Ja({ card: m, datasets: r, errors: t }), ts({ card: m, errors: t }), es({ card: m, datasets: r, errors: t }), is({ card: m, errors: t });
|
|
413
|
+
const y = Array.isArray(a.filterInputs) ? a.filterInputs : [], C = y.map((m) => m.id), p = ye(C);
|
|
414
|
+
p && t.push(
|
|
415
|
+
M(
|
|
411
416
|
"duplicate_input_id",
|
|
412
|
-
`Duplicate dashboard input id: ${
|
|
417
|
+
`Duplicate dashboard input id: ${p}.`
|
|
413
418
|
)
|
|
414
419
|
);
|
|
415
|
-
const
|
|
416
|
-
|
|
417
|
-
|
|
420
|
+
const $ = y.map((m) => m.variableName).filter(Boolean) || [], _ = ye($);
|
|
421
|
+
_ && t.push(
|
|
422
|
+
M(
|
|
418
423
|
"duplicate_input_variable",
|
|
419
|
-
`Duplicate dashboard input variable name: ${
|
|
424
|
+
`Duplicate dashboard input variable name: ${_}.`
|
|
420
425
|
)
|
|
421
426
|
);
|
|
422
|
-
for (const
|
|
423
|
-
|
|
424
|
-
const
|
|
425
|
-
for (const
|
|
426
|
-
|
|
427
|
-
|
|
427
|
+
for (const m of y)
|
|
428
|
+
ss({ input: m, errors: t });
|
|
429
|
+
const g = Array.isArray(a.calculatedFields) ? a.calculatedFields : [];
|
|
430
|
+
for (const m of g)
|
|
431
|
+
m.scope === "domain" && m.reuseOnly !== !0 && t.push(
|
|
432
|
+
M(
|
|
428
433
|
"domain_calculated_field_create_out_of_scope",
|
|
429
|
-
`Creating domain calculated field "${
|
|
434
|
+
`Creating domain calculated field "${m.name}" is outside MVP.`
|
|
430
435
|
)
|
|
431
436
|
);
|
|
432
|
-
return { ok: t.length === 0, errors: t, warnings:
|
|
437
|
+
return { ok: t.length === 0, errors: t, warnings: s };
|
|
433
438
|
}
|
|
434
|
-
function
|
|
435
|
-
|
|
436
|
-
const t = [];
|
|
437
|
-
if (!e || typeof e != "object")
|
|
438
|
-
return {
|
|
439
|
-
ok: !1,
|
|
440
|
-
errors: [
|
|
441
|
-
p(
|
|
442
|
-
"invalid_change_plan",
|
|
443
|
-
"Dashboard change plan must be a structured object."
|
|
444
|
-
)
|
|
445
|
-
],
|
|
446
|
-
warnings: []
|
|
447
|
-
};
|
|
448
|
-
const a = e, r = [...a.warnings || []];
|
|
449
|
-
a.version !== 1 && t.push(
|
|
450
|
-
p("invalid_version", "Dashboard change plan version must be 1.")
|
|
451
|
-
), (o = a.dashboardId) != null && o.trim() || t.push(
|
|
452
|
-
p("missing_dashboard_id", "Dashboard change plan needs a dashboard id.")
|
|
453
|
-
);
|
|
454
|
-
const n = Array.isArray(a.datasets) ? a.datasets : [], i = Array.isArray(a.operations) ? a.operations : [];
|
|
455
|
-
Ce({ datasets: n, errors: t, requireAtLeastOne: !1 });
|
|
456
|
-
for (const s of i) {
|
|
457
|
-
if (s.kind === "unsupported") {
|
|
458
|
-
r.push(
|
|
459
|
-
p("unsupported_operation", s.reason || s.requestedAction)
|
|
460
|
-
);
|
|
461
|
-
continue;
|
|
462
|
-
}
|
|
463
|
-
if (s.kind === "addCard" && s.card.type === "custom" && t.push(
|
|
464
|
-
p(
|
|
465
|
-
"custom_visual_out_of_scope",
|
|
466
|
-
"Whole-dashboard authoring supports built-in visual types only.",
|
|
467
|
-
s.card.id
|
|
468
|
-
)
|
|
469
|
-
), s.kind === "addCard" && (be({
|
|
470
|
-
card: s.card,
|
|
471
|
-
datasets: n,
|
|
472
|
-
errors: t
|
|
473
|
-
}), Ie({
|
|
474
|
-
card: s.card,
|
|
475
|
-
errors: t
|
|
476
|
-
}), ge({
|
|
477
|
-
card: s.card,
|
|
478
|
-
datasets: n,
|
|
479
|
-
errors: t
|
|
480
|
-
}), Q({ card: s.card, errors: t })), s.kind === "updateCardSelectionSettings") {
|
|
481
|
-
const l = s.card;
|
|
482
|
-
s.card.clickToFilter === void 0 && s.card.respondsToSelections === void 0 && t.push(
|
|
483
|
-
p(
|
|
484
|
-
"empty_card_selection_settings_update",
|
|
485
|
-
"A card selection-settings update must provide clickToFilter or respondsToSelections.",
|
|
486
|
-
s.cardId
|
|
487
|
-
)
|
|
488
|
-
), Q({
|
|
489
|
-
card: {
|
|
490
|
-
id: s.cardId,
|
|
491
|
-
frameId: "",
|
|
492
|
-
title: "",
|
|
493
|
-
type: "table",
|
|
494
|
-
role: "table",
|
|
495
|
-
priority: 0,
|
|
496
|
-
...l
|
|
497
|
-
},
|
|
498
|
-
errors: t
|
|
499
|
-
});
|
|
500
|
-
}
|
|
501
|
-
s.kind === "addFilterInput" && ye({ input: s.input, errors: t }), s.kind === "addCalculatedField" && s.field.scope === "domain" && s.field.reuseOnly !== !0 && t.push(
|
|
502
|
-
p(
|
|
503
|
-
"domain_calculated_field_create_out_of_scope",
|
|
504
|
-
`Creating domain calculated field "${s.field.name}" is outside MVP.`
|
|
505
|
-
)
|
|
506
|
-
);
|
|
507
|
-
}
|
|
508
|
-
return { ok: t.length === 0, errors: t, warnings: r };
|
|
509
|
-
}
|
|
510
|
-
const it = {
|
|
511
|
-
lg: 48,
|
|
512
|
-
md: 36,
|
|
513
|
-
sm: 24,
|
|
514
|
-
xs: 12,
|
|
515
|
-
xxs: 6
|
|
516
|
-
};
|
|
517
|
-
function ot(e, t) {
|
|
518
|
-
let a = 0, r = 0, n = 0;
|
|
519
|
-
return e.map((i) => {
|
|
520
|
-
const o = Math.min(i.w, t);
|
|
521
|
-
a > 0 && a + o > t && (a = 0, r += n, n = 0);
|
|
522
|
-
const s = {
|
|
523
|
-
i: i.frameId,
|
|
524
|
-
x: a,
|
|
525
|
-
y: r,
|
|
526
|
-
w: o,
|
|
527
|
-
h: i.h,
|
|
528
|
-
minW: Math.min(i.minW, t),
|
|
529
|
-
minH: i.minH,
|
|
530
|
-
static: !1
|
|
531
|
-
};
|
|
532
|
-
return a += o, n = Math.max(n, i.h), s;
|
|
533
|
-
});
|
|
534
|
-
}
|
|
535
|
-
function st(e) {
|
|
536
|
-
const t = [...e].sort((l, d) => l.priority - d.priority), a = t.filter((l) => l.role === "kpi"), r = t.filter((l) => l.role === "chart"), n = t.filter((l) => l.role === "table"), i = t.filter((l) => l.role === "text"), o = i.slice(0, 1), s = i.slice(o.length);
|
|
537
|
-
return { kpis: a, introText: o, charts: r, tables: n, supportingText: s };
|
|
538
|
-
}
|
|
539
|
-
function dt(e, t, a) {
|
|
540
|
-
return t === "xxs" || t === "xs" ? a : t === "sm" ? Math.min(12, a) : t === "md" ? e <= 1 || e === 2 ? 18 : 12 : e <= 1 || e === 2 ? 24 : e === 3 ? 16 : 12;
|
|
541
|
-
}
|
|
542
|
-
function ct(e, t, a, r) {
|
|
543
|
-
return a === "xxs" || a === "xs" || a === "sm" || a === "md" || t === 1 || t % 2 === 1 && e === 0 ? r : r / 2;
|
|
544
|
-
}
|
|
545
|
-
function lt(e) {
|
|
546
|
-
const { item: t, band: a, index: r, bandCount: n, breakpoint: i, columns: o } = e;
|
|
547
|
-
return a === "kpi" ? {
|
|
548
|
-
...t,
|
|
549
|
-
band: a,
|
|
550
|
-
w: dt(n, i, o),
|
|
551
|
-
h: 15,
|
|
552
|
-
minW: Math.min(6, o),
|
|
553
|
-
minH: 12
|
|
554
|
-
} : a === "table" ? {
|
|
555
|
-
...t,
|
|
556
|
-
band: a,
|
|
557
|
-
w: o,
|
|
558
|
-
h: i === "xxs" || i === "xs" ? 34 : 38,
|
|
559
|
-
minW: Math.min(12, o),
|
|
560
|
-
minH: 18
|
|
561
|
-
} : a === "introText" ? {
|
|
562
|
-
...t,
|
|
563
|
-
band: a,
|
|
564
|
-
w: o,
|
|
565
|
-
h: i === "xxs" || i === "xs" ? 12 : 10,
|
|
566
|
-
minW: Math.min(12, o),
|
|
567
|
-
minH: 8
|
|
568
|
-
} : a === "supportingText" ? {
|
|
569
|
-
...t,
|
|
570
|
-
band: a,
|
|
571
|
-
w: i === "lg" ? o / 2 : o,
|
|
572
|
-
h: i === "xxs" || i === "xs" ? 12 : 10,
|
|
573
|
-
minW: Math.min(12, o),
|
|
574
|
-
minH: 8
|
|
575
|
-
} : {
|
|
576
|
-
...t,
|
|
577
|
-
band: a,
|
|
578
|
-
w: ct(r, n, i, o),
|
|
579
|
-
h: i === "xxs" || i === "xs" ? 28 : 30,
|
|
580
|
-
minW: Math.min(12, o),
|
|
581
|
-
minH: 16
|
|
582
|
-
};
|
|
583
|
-
}
|
|
584
|
-
function A(e, t, a, r) {
|
|
585
|
-
return e.map(
|
|
586
|
-
(n, i) => lt({
|
|
587
|
-
item: n,
|
|
588
|
-
band: t,
|
|
589
|
-
index: i,
|
|
590
|
-
bandCount: e.length,
|
|
591
|
-
breakpoint: a,
|
|
592
|
-
columns: r
|
|
593
|
-
})
|
|
594
|
-
);
|
|
595
|
-
}
|
|
596
|
-
function J(e) {
|
|
597
|
-
const t = st(e);
|
|
598
|
-
return Object.fromEntries(
|
|
599
|
-
ke.map((a) => {
|
|
600
|
-
const r = it[a], n = [
|
|
601
|
-
...A(t.introText, "introText", a, r),
|
|
602
|
-
...A(t.kpis, "kpi", a, r),
|
|
603
|
-
...A(t.charts, "chart", a, r),
|
|
604
|
-
...A(t.tables, "table", a, r),
|
|
605
|
-
...A(t.supportingText, "supportingText", a, r)
|
|
606
|
-
];
|
|
607
|
-
return [a, ot(n, r)];
|
|
608
|
-
})
|
|
609
|
-
);
|
|
610
|
-
}
|
|
611
|
-
function ut(e) {
|
|
612
|
-
const t = Be(e);
|
|
439
|
+
function os(e) {
|
|
440
|
+
const t = $a(e);
|
|
613
441
|
return t === "datetime" ? "date" : t === "unknown" ? "string" : t;
|
|
614
442
|
}
|
|
615
|
-
function
|
|
443
|
+
function rs(e) {
|
|
616
444
|
return !!(e && typeof e == "object" && !Array.isArray(e));
|
|
617
445
|
}
|
|
618
|
-
function
|
|
619
|
-
return
|
|
446
|
+
function ds(e) {
|
|
447
|
+
return rs(e) && typeof e.filterId == "string" && typeof e.operation == "string" && Array.isArray(e.values);
|
|
620
448
|
}
|
|
621
|
-
function
|
|
449
|
+
function ls(e) {
|
|
622
450
|
return e.filter(
|
|
623
451
|
(t) => typeof t == "string" || typeof t == "number"
|
|
624
452
|
);
|
|
625
453
|
}
|
|
626
|
-
function
|
|
454
|
+
function cs(e) {
|
|
627
455
|
return e.filter(
|
|
628
456
|
(t) => t instanceof Date || typeof t == "string"
|
|
629
457
|
);
|
|
630
458
|
}
|
|
631
|
-
function
|
|
459
|
+
function Dt(e, t) {
|
|
632
460
|
if (t === void 0)
|
|
633
461
|
return;
|
|
634
|
-
const a =
|
|
635
|
-
if (
|
|
636
|
-
return
|
|
462
|
+
const a = os(e.dataType), s = e.operation || "in";
|
|
463
|
+
if (ds(t))
|
|
464
|
+
return $e({
|
|
637
465
|
definition: e,
|
|
638
466
|
sourceValue: t,
|
|
639
467
|
value: {
|
|
@@ -646,13 +474,13 @@ function Z(e, t) {
|
|
|
646
474
|
semanticContext: e.semanticContext
|
|
647
475
|
}
|
|
648
476
|
});
|
|
649
|
-
if (
|
|
650
|
-
return
|
|
477
|
+
if (s === "is null" || s === "is not null")
|
|
478
|
+
return $e({
|
|
651
479
|
definition: e,
|
|
652
480
|
value: {
|
|
653
481
|
filterId: e.id,
|
|
654
482
|
name: e.column,
|
|
655
|
-
operation:
|
|
483
|
+
operation: s,
|
|
656
484
|
valueType: a,
|
|
657
485
|
values: [],
|
|
658
486
|
dataType: e.dataType,
|
|
@@ -660,42 +488,42 @@ function Z(e, t) {
|
|
|
660
488
|
semanticContext: e.semanticContext
|
|
661
489
|
}
|
|
662
490
|
});
|
|
663
|
-
const
|
|
664
|
-
if (
|
|
665
|
-
return
|
|
491
|
+
const r = Array.isArray(t) ? t : [t], n = a === "date" ? cs(r) : ls(r);
|
|
492
|
+
if (n.length !== 0 && !((s === "between" || s === "not between") && n.length < 2))
|
|
493
|
+
return $e({
|
|
666
494
|
definition: e,
|
|
667
495
|
value: {
|
|
668
496
|
filterId: e.id,
|
|
669
497
|
name: e.column,
|
|
670
|
-
operation:
|
|
498
|
+
operation: s,
|
|
671
499
|
valueType: a,
|
|
672
|
-
values:
|
|
500
|
+
values: n,
|
|
673
501
|
dataType: e.dataType,
|
|
674
502
|
fieldMeta: e.fieldMeta,
|
|
675
503
|
semanticContext: e.semanticContext
|
|
676
504
|
}
|
|
677
505
|
});
|
|
678
506
|
}
|
|
679
|
-
function
|
|
507
|
+
function Tt(e, t, a) {
|
|
680
508
|
return a ? { code: e, message: t, cardId: a } : { code: e, message: t };
|
|
681
509
|
}
|
|
682
|
-
function
|
|
683
|
-
const
|
|
684
|
-
(
|
|
685
|
-
).map((
|
|
686
|
-
return
|
|
510
|
+
function us(e, t, a) {
|
|
511
|
+
const s = (t || []).filter(
|
|
512
|
+
(r) => r.scope === "card" && r.targetCardId === a
|
|
513
|
+
).map((r) => r.field).filter(Boolean);
|
|
514
|
+
return s.length === 0 ? e : {
|
|
687
515
|
...e,
|
|
688
516
|
calculatedFields: [
|
|
689
517
|
...e.calculatedFields || [],
|
|
690
|
-
...
|
|
518
|
+
...s
|
|
691
519
|
]
|
|
692
520
|
};
|
|
693
521
|
}
|
|
694
|
-
function
|
|
522
|
+
function hs(e, t, a) {
|
|
695
523
|
return t.clickToFilter === void 0 && t.respondsToSelections === void 0 ? e : {
|
|
696
524
|
...e,
|
|
697
525
|
...t.clickToFilter ? {
|
|
698
|
-
clickToFilter:
|
|
526
|
+
clickToFilter: Vt(
|
|
699
527
|
t.clickToFilter,
|
|
700
528
|
{ cardIds: Object.fromEntries(a) }
|
|
701
529
|
)
|
|
@@ -703,114 +531,111 @@ function gt(e, t, a) {
|
|
|
703
531
|
...t.respondsToSelections !== void 0 ? { respondsToSelections: t.respondsToSelections } : {}
|
|
704
532
|
};
|
|
705
533
|
}
|
|
706
|
-
function
|
|
534
|
+
function fs(e, t) {
|
|
707
535
|
if (!e) return e;
|
|
708
|
-
const a =
|
|
536
|
+
const a = Ut(e, {
|
|
709
537
|
renamedCardIds: t,
|
|
710
538
|
keepOnlyRenamedCardIds: !0
|
|
711
539
|
});
|
|
712
|
-
return
|
|
540
|
+
return jt(a) ? null : a;
|
|
713
541
|
}
|
|
714
|
-
function
|
|
715
|
-
const a = {},
|
|
542
|
+
function ps(e, t) {
|
|
543
|
+
const a = {}, s = [];
|
|
716
544
|
return {
|
|
717
545
|
inputs: (e.filterInputs || []).flatMap(
|
|
718
|
-
(
|
|
719
|
-
const
|
|
720
|
-
if (
|
|
721
|
-
return
|
|
722
|
-
|
|
546
|
+
(n, i) => {
|
|
547
|
+
const d = fs(n.scope, t);
|
|
548
|
+
if (d === null)
|
|
549
|
+
return s.push(
|
|
550
|
+
Tt(
|
|
723
551
|
"filter_input_scope_empty",
|
|
724
|
-
`Filter input "${
|
|
552
|
+
`Filter input "${n.label}" was skipped because all scoped cards or tabs were skipped during query validation.`
|
|
725
553
|
)
|
|
726
554
|
), [];
|
|
727
|
-
const
|
|
728
|
-
|
|
729
|
-
|
|
555
|
+
const u = Dt(
|
|
556
|
+
n.filter,
|
|
557
|
+
n.defaultValue
|
|
730
558
|
);
|
|
731
|
-
return
|
|
559
|
+
return u && (a.shared ?? (a.shared = {}), a.shared[n.id] = {
|
|
732
560
|
status: "set",
|
|
733
561
|
value: {
|
|
734
562
|
kind: "filter",
|
|
735
|
-
filterValue:
|
|
563
|
+
filterValue: u
|
|
736
564
|
}
|
|
737
565
|
}), [
|
|
738
566
|
{
|
|
739
|
-
id:
|
|
567
|
+
id: n.id,
|
|
740
568
|
kind: "filter",
|
|
741
|
-
label:
|
|
742
|
-
variableName:
|
|
743
|
-
scope:
|
|
569
|
+
label: n.label,
|
|
570
|
+
variableName: n.variableName,
|
|
571
|
+
scope: d || { kind: "allSheets", sheetKinds: ["dashboard"] },
|
|
744
572
|
runtimeScope: "shared",
|
|
745
573
|
presentation: {
|
|
746
574
|
placement: "toolbar",
|
|
747
|
-
order:
|
|
575
|
+
order: i
|
|
748
576
|
},
|
|
749
577
|
exports: ["label", "value", "start", "end", "range"],
|
|
750
578
|
// Reach is the scope (S-1): a filter definition stores none.
|
|
751
|
-
filter:
|
|
579
|
+
filter: Gt(n.filter)
|
|
752
580
|
}
|
|
753
581
|
];
|
|
754
582
|
}
|
|
755
583
|
),
|
|
756
|
-
warnings:
|
|
584
|
+
warnings: s,
|
|
757
585
|
defaultInputValues: a.shared && Object.keys(a.shared).length > 0 ? a : void 0
|
|
758
586
|
};
|
|
759
587
|
}
|
|
760
|
-
function
|
|
761
|
-
var
|
|
762
|
-
const t =
|
|
588
|
+
function li(e) {
|
|
589
|
+
var g, A;
|
|
590
|
+
const t = ns(e.plan);
|
|
763
591
|
if (!t.ok)
|
|
764
592
|
throw new Error(
|
|
765
593
|
t.errors.map((c) => c.message).join(`
|
|
766
594
|
`) || "Dashboard plan is invalid."
|
|
767
595
|
);
|
|
768
|
-
const a = e.plan.sheets[0],
|
|
596
|
+
const a = e.plan.sheets[0], s = [...t.warnings], r = [], n = new Map(
|
|
769
597
|
e.cardArtifacts.map((c) => [c.planCardId, c])
|
|
770
|
-
),
|
|
598
|
+
), i = new Map(
|
|
771
599
|
e.cardArtifacts.map((c) => [
|
|
772
600
|
c.planCardId,
|
|
773
601
|
c.card.id
|
|
774
602
|
])
|
|
775
|
-
),
|
|
603
|
+
), d = [];
|
|
776
604
|
for (const c of a.cards) {
|
|
777
|
-
const
|
|
778
|
-
if (!
|
|
779
|
-
const
|
|
605
|
+
const m = n.get(c.id);
|
|
606
|
+
if (!m) {
|
|
607
|
+
const k = Tt(
|
|
780
608
|
"missing_card_artifact",
|
|
781
609
|
`Card "${c.title}" was skipped because no generated artifact was supplied.`,
|
|
782
610
|
c.id
|
|
783
611
|
);
|
|
784
|
-
|
|
612
|
+
r.push(k);
|
|
785
613
|
continue;
|
|
786
614
|
}
|
|
787
|
-
|
|
788
|
-
const
|
|
789
|
-
|
|
790
|
-
|
|
615
|
+
s.push(...m.warnings || []);
|
|
616
|
+
const F = hs(
|
|
617
|
+
us(
|
|
618
|
+
m.card,
|
|
791
619
|
e.plan.calculatedFields,
|
|
792
620
|
c.id
|
|
793
621
|
),
|
|
794
622
|
c,
|
|
795
|
-
|
|
623
|
+
i
|
|
796
624
|
);
|
|
797
|
-
|
|
625
|
+
d.push({
|
|
798
626
|
id: c.frameId,
|
|
799
|
-
cards: [
|
|
800
|
-
activeCardId:
|
|
627
|
+
cards: [F],
|
|
628
|
+
activeCardId: F.id
|
|
801
629
|
});
|
|
802
630
|
}
|
|
803
|
-
if (
|
|
631
|
+
if (d.length === 0)
|
|
804
632
|
throw new Error("Dashboard plan did not produce any persistable cards.");
|
|
805
|
-
const { inputs:
|
|
806
|
-
|
|
807
|
-
const
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
role: c.role
|
|
812
|
-
}))
|
|
813
|
-
);
|
|
633
|
+
const { inputs: u, defaultInputValues: b, warnings: y } = ps(e.plan, i);
|
|
634
|
+
s.push(...y);
|
|
635
|
+
const C = new Map(a.cards.map((c) => [c.frameId, c.priority])), p = d.map((c, m) => ({ frame: c, index: m })).sort(
|
|
636
|
+
(c, m) => (C.get(c.frame.id) ?? 0) - (C.get(m.frame.id) ?? 0) || c.index - m.index
|
|
637
|
+
).map(({ frame: c }) => c), $ = Ea({ id: a.id, frames: p, layouts: void 0 }, { kind: "arrange" });
|
|
638
|
+
if (!$.ok) throw new Error($.failure.message);
|
|
814
639
|
return { dashboard: {
|
|
815
640
|
id: e.dashboardId,
|
|
816
641
|
title: e.plan.title,
|
|
@@ -824,405 +649,151 @@ function ta(e) {
|
|
|
824
649
|
kind: "dashboard",
|
|
825
650
|
title: a.title,
|
|
826
651
|
description: a.description,
|
|
827
|
-
frames:
|
|
828
|
-
layouts:
|
|
829
|
-
|
|
652
|
+
frames: $.frames,
|
|
653
|
+
layouts: $.layouts,
|
|
654
|
+
customizedBreakpoints: $.customizedBreakpoints,
|
|
655
|
+
calculatedFields: (g = e.plan.calculatedFields) == null ? void 0 : g.filter((c) => c.scope === "sheet" && c.field).map((c) => c.field)
|
|
830
656
|
}
|
|
831
657
|
],
|
|
832
|
-
calculatedFields: (
|
|
833
|
-
inputs:
|
|
834
|
-
...
|
|
835
|
-
}, warnings:
|
|
836
|
-
}
|
|
837
|
-
function F(e, t, a) {
|
|
838
|
-
return a ? { code: e, message: t, cardId: a } : { code: e, message: t };
|
|
839
|
-
}
|
|
840
|
-
function yt(e) {
|
|
841
|
-
return JSON.parse(JSON.stringify(e));
|
|
842
|
-
}
|
|
843
|
-
function _t(e) {
|
|
844
|
-
var t;
|
|
845
|
-
return (t = e.sheets) == null ? void 0 : t.find(
|
|
846
|
-
(a) => (a.kind || "dashboard") === "dashboard"
|
|
847
|
-
);
|
|
848
|
-
}
|
|
849
|
-
function $(e, t) {
|
|
850
|
-
var a;
|
|
851
|
-
for (const r of e.sheets || [])
|
|
852
|
-
for (const n of r.frames || []) {
|
|
853
|
-
const i = (a = n.cards) == null ? void 0 : a.find((o) => o.id === t);
|
|
854
|
-
if (i)
|
|
855
|
-
return { sheet: r, frame: n, card: i };
|
|
856
|
-
}
|
|
857
|
-
return null;
|
|
858
|
-
}
|
|
859
|
-
function De(e) {
|
|
860
|
-
var a, r;
|
|
861
|
-
const t = (r = (a = e.cards) == null ? void 0 : a[0]) == null ? void 0 : r.type;
|
|
862
|
-
return t === "kpi" ? "kpi" : t === "table" || t === "detailTable" || t === "pivotTable" ? "table" : t === "text" ? "text" : "chart";
|
|
863
|
-
}
|
|
864
|
-
function Dt(e) {
|
|
865
|
-
var t;
|
|
866
|
-
return new Map(
|
|
867
|
-
(((t = e.layouts) == null ? void 0 : t.lg) || []).map((a, r) => [a.i, r])
|
|
868
|
-
);
|
|
869
|
-
}
|
|
870
|
-
function Se(e, t = /* @__PURE__ */ new Map()) {
|
|
871
|
-
const a = Dt(e), r = Math.max(
|
|
872
|
-
a.size,
|
|
873
|
-
t.size
|
|
874
|
-
), n = (e.frames || []).map(
|
|
875
|
-
(i, o) => ({
|
|
876
|
-
frameId: i.id,
|
|
877
|
-
role: De(i),
|
|
878
|
-
priority: t.get(i.id) ?? a.get(i.id) ?? r + o
|
|
879
|
-
})
|
|
880
|
-
);
|
|
881
|
-
e.layouts = J(n);
|
|
882
|
-
}
|
|
883
|
-
function St(e) {
|
|
884
|
-
return Object.values(e.layouts || {}).some((t) => t.length > 0);
|
|
885
|
-
}
|
|
886
|
-
function Tt(e, t) {
|
|
887
|
-
if (!St(e)) {
|
|
888
|
-
Se(e);
|
|
889
|
-
return;
|
|
890
|
-
}
|
|
891
|
-
const a = J([
|
|
892
|
-
{ frameId: t.id, role: De(t), priority: 0 }
|
|
893
|
-
]);
|
|
894
|
-
e.layouts ?? (e.layouts = {});
|
|
895
|
-
for (const [r, n] of Object.entries(a)) {
|
|
896
|
-
const i = e.layouts[r] || [];
|
|
897
|
-
if (i.some((l) => l.i === t.id))
|
|
898
|
-
continue;
|
|
899
|
-
const o = n[0];
|
|
900
|
-
if (!o)
|
|
901
|
-
continue;
|
|
902
|
-
const s = i.reduce(
|
|
903
|
-
(l, d) => Math.max(l, d.y + d.h),
|
|
904
|
-
0
|
|
905
|
-
);
|
|
906
|
-
e.layouts[r] = [
|
|
907
|
-
...i,
|
|
908
|
-
{ ...o, y: s }
|
|
909
|
-
];
|
|
910
|
-
}
|
|
911
|
-
}
|
|
912
|
-
function vt(e, t) {
|
|
913
|
-
var r;
|
|
914
|
-
const a = Z(
|
|
915
|
-
t.filter,
|
|
916
|
-
t.defaultValue
|
|
917
|
-
);
|
|
918
|
-
a && (e.defaultInputValues ?? (e.defaultInputValues = {}), (r = e.defaultInputValues).shared ?? (r.shared = {}), e.defaultInputValues.shared[t.id] = {
|
|
919
|
-
status: "set",
|
|
920
|
-
value: {
|
|
921
|
-
kind: "filter",
|
|
922
|
-
filterValue: a
|
|
923
|
-
}
|
|
924
|
-
});
|
|
658
|
+
calculatedFields: (A = e.plan.calculatedFields) == null ? void 0 : A.filter((c) => c.scope === "dashboard" && c.field).map((c) => c.field),
|
|
659
|
+
inputs: u,
|
|
660
|
+
...b ? { defaultInputValues: b } : {}
|
|
661
|
+
}, warnings: s, skippedOperations: r };
|
|
925
662
|
}
|
|
926
|
-
function
|
|
927
|
-
var l;
|
|
928
|
-
const t = nt(e.changePlan);
|
|
929
|
-
if (!t.ok)
|
|
930
|
-
throw new Error(
|
|
931
|
-
t.errors.map((d) => d.message).join(`
|
|
932
|
-
`) || "Dashboard change plan is invalid."
|
|
933
|
-
);
|
|
934
|
-
const a = yt(e.dashboard), r = [...t.warnings], n = [], i = new Map(
|
|
935
|
-
e.cardArtifacts.map((d) => [d.planCardId, d])
|
|
936
|
-
), o = new Map(
|
|
937
|
-
e.cardArtifacts.map((d) => [
|
|
938
|
-
d.planCardId,
|
|
939
|
-
d.card.id
|
|
940
|
-
])
|
|
941
|
-
), s = _t(a);
|
|
942
|
-
if (!s)
|
|
943
|
-
throw new Error("Dashboard has no editable dashboard sheet.");
|
|
944
|
-
s.frames ?? (s.frames = []);
|
|
945
|
-
for (const d of e.changePlan.operations)
|
|
946
|
-
switch (d.kind) {
|
|
947
|
-
case "addCard": {
|
|
948
|
-
if ((s.frames || []).reduce(
|
|
949
|
-
(g, c) => {
|
|
950
|
-
var h;
|
|
951
|
-
return g + (((h = c.cards) == null ? void 0 : h.length) || 0);
|
|
952
|
-
},
|
|
953
|
-
0
|
|
954
|
-
) >= L) {
|
|
955
|
-
n.push(
|
|
956
|
-
F(
|
|
957
|
-
"generated_card_limit_reached",
|
|
958
|
-
`AI refinement is capped at ${L} cards.`,
|
|
959
|
-
d.card.id
|
|
960
|
-
)
|
|
961
|
-
);
|
|
962
|
-
break;
|
|
963
|
-
}
|
|
964
|
-
const m = i.get(d.card.id);
|
|
965
|
-
if (!m) {
|
|
966
|
-
n.push(
|
|
967
|
-
F(
|
|
968
|
-
"missing_card_artifact",
|
|
969
|
-
`Card "${d.card.title}" was skipped because no generated artifact was supplied.`,
|
|
970
|
-
d.card.id
|
|
971
|
-
)
|
|
972
|
-
);
|
|
973
|
-
break;
|
|
974
|
-
}
|
|
975
|
-
const y = {
|
|
976
|
-
...m.card,
|
|
977
|
-
...d.card.clickToFilter ? {
|
|
978
|
-
clickToFilter: G(
|
|
979
|
-
d.card.clickToFilter,
|
|
980
|
-
{ cardIds: Object.fromEntries(o) }
|
|
981
|
-
)
|
|
982
|
-
} : {},
|
|
983
|
-
...d.card.respondsToSelections !== void 0 ? {
|
|
984
|
-
respondsToSelections: d.card.respondsToSelections
|
|
985
|
-
} : {}
|
|
986
|
-
}, b = {
|
|
987
|
-
id: d.card.frameId,
|
|
988
|
-
cards: [y],
|
|
989
|
-
activeCardId: y.id
|
|
990
|
-
};
|
|
991
|
-
s.frames.push(b), Tt(s, b);
|
|
992
|
-
break;
|
|
993
|
-
}
|
|
994
|
-
case "addFilterInput": {
|
|
995
|
-
a.inputs ?? (a.inputs = []);
|
|
996
|
-
const f = {
|
|
997
|
-
id: d.input.id,
|
|
998
|
-
kind: "filter",
|
|
999
|
-
label: d.input.label,
|
|
1000
|
-
variableName: d.input.variableName,
|
|
1001
|
-
// A card this change adds is named by its plan id; an existing
|
|
1002
|
-
// card keeps its id (the scope rule's one rewrite, M2).
|
|
1003
|
-
scope: d.input.scope ? fe(d.input.scope, {
|
|
1004
|
-
renamedCardIds: o
|
|
1005
|
-
}) : { kind: "allSheets", sheetKinds: ["dashboard"] },
|
|
1006
|
-
runtimeScope: "shared",
|
|
1007
|
-
presentation: {
|
|
1008
|
-
placement: "toolbar",
|
|
1009
|
-
order: a.inputs.length
|
|
1010
|
-
},
|
|
1011
|
-
exports: ["label", "value", "start", "end", "range"],
|
|
1012
|
-
// Reach is the scope (S-1): a filter definition stores none.
|
|
1013
|
-
filter: pe(d.input.filter)
|
|
1014
|
-
};
|
|
1015
|
-
a.inputs.push(f), vt(a, d.input);
|
|
1016
|
-
break;
|
|
1017
|
-
}
|
|
1018
|
-
case "addCalculatedField": {
|
|
1019
|
-
if (d.field.scope === "dashboard" && d.field.field)
|
|
1020
|
-
a.calculatedFields ?? (a.calculatedFields = []), a.calculatedFields.push(d.field.field);
|
|
1021
|
-
else if (d.field.scope === "sheet" && d.field.field)
|
|
1022
|
-
s.calculatedFields ?? (s.calculatedFields = []), s.calculatedFields.push(d.field.field);
|
|
1023
|
-
else if (d.field.scope === "card" && d.field.field) {
|
|
1024
|
-
const f = d.field.targetCardId ? $(a, d.field.targetCardId) : null;
|
|
1025
|
-
f ? ((l = f.card).calculatedFields ?? (l.calculatedFields = []), f.card.calculatedFields.push(d.field.field)) : n.push(
|
|
1026
|
-
F(
|
|
1027
|
-
"missing_calculated_field_target",
|
|
1028
|
-
`Calculated field "${d.field.name}" needs a valid target card.`
|
|
1029
|
-
)
|
|
1030
|
-
);
|
|
1031
|
-
}
|
|
1032
|
-
break;
|
|
1033
|
-
}
|
|
1034
|
-
case "renameCard": {
|
|
1035
|
-
const f = $(a, d.cardId);
|
|
1036
|
-
if (!f) {
|
|
1037
|
-
n.push(
|
|
1038
|
-
F(
|
|
1039
|
-
"card_not_found",
|
|
1040
|
-
`Card "${d.cardId}" could not be renamed because it was not found.`,
|
|
1041
|
-
d.cardId
|
|
1042
|
-
)
|
|
1043
|
-
);
|
|
1044
|
-
break;
|
|
1045
|
-
}
|
|
1046
|
-
f.card.title = d.title, d.description !== void 0 && (f.card.description = d.description);
|
|
1047
|
-
break;
|
|
1048
|
-
}
|
|
1049
|
-
case "updateCardSelectionSettings": {
|
|
1050
|
-
const f = o.get(d.cardId) ?? d.cardId, m = $(a, f);
|
|
1051
|
-
if (!m) {
|
|
1052
|
-
n.push(
|
|
1053
|
-
F(
|
|
1054
|
-
"card_not_found",
|
|
1055
|
-
`Card "${d.cardId}" could not be updated because it was not found.`,
|
|
1056
|
-
d.cardId
|
|
1057
|
-
)
|
|
1058
|
-
);
|
|
1059
|
-
break;
|
|
1060
|
-
}
|
|
1061
|
-
d.card.clickToFilter !== void 0 && (m.card.clickToFilter = G(
|
|
1062
|
-
d.card.clickToFilter,
|
|
1063
|
-
{ cardIds: Object.fromEntries(o) }
|
|
1064
|
-
)), d.card.respondsToSelections !== void 0 && (m.card.respondsToSelections = d.card.respondsToSelections);
|
|
1065
|
-
break;
|
|
1066
|
-
}
|
|
1067
|
-
case "reorderCards": {
|
|
1068
|
-
const f = /* @__PURE__ */ new Map();
|
|
1069
|
-
for (let m = 0; m < d.cardIds.length; m += 1) {
|
|
1070
|
-
const y = d.cardIds[m], b = $(a, y);
|
|
1071
|
-
b && f.set(b.frame.id, m);
|
|
1072
|
-
}
|
|
1073
|
-
Se(s, f);
|
|
1074
|
-
break;
|
|
1075
|
-
}
|
|
1076
|
-
case "reuseCalculatedField":
|
|
1077
|
-
r.push(
|
|
1078
|
-
F(
|
|
1079
|
-
"reused_calculated_field",
|
|
1080
|
-
`Calculated field "${d.fieldId}" is reused by reference.`
|
|
1081
|
-
)
|
|
1082
|
-
);
|
|
1083
|
-
break;
|
|
1084
|
-
case "unsupported":
|
|
1085
|
-
n.push(
|
|
1086
|
-
F("unsupported_operation", d.reason || d.requestedAction)
|
|
1087
|
-
);
|
|
1088
|
-
break;
|
|
1089
|
-
}
|
|
1090
|
-
return { dashboard: a, warnings: r, skippedOperations: n };
|
|
1091
|
-
}
|
|
1092
|
-
function _(e, t, a) {
|
|
663
|
+
function H(e, t, a) {
|
|
1093
664
|
return a ? { code: e, message: t, cardId: a } : { code: e, message: t };
|
|
1094
665
|
}
|
|
1095
|
-
function
|
|
666
|
+
function he(e, t) {
|
|
1096
667
|
return e.trim().toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "") || t;
|
|
1097
668
|
}
|
|
1098
|
-
function
|
|
669
|
+
function kt(e, t) {
|
|
1099
670
|
if (!t.has(e))
|
|
1100
671
|
return t.add(e), e;
|
|
1101
|
-
let a = 2,
|
|
1102
|
-
for (; t.has(
|
|
1103
|
-
a += 1,
|
|
1104
|
-
return t.add(
|
|
672
|
+
let a = 2, s = `${e}-${a}`;
|
|
673
|
+
for (; t.has(s); )
|
|
674
|
+
a += 1, s = `${e}-${a}`;
|
|
675
|
+
return t.add(s), s;
|
|
1105
676
|
}
|
|
1106
|
-
function
|
|
677
|
+
function ge(e) {
|
|
1107
678
|
return !!(e && typeof e == "object");
|
|
1108
679
|
}
|
|
1109
|
-
function
|
|
680
|
+
function $t(e) {
|
|
1110
681
|
return Array.isArray(e.inputs) ? e.inputs.filter(
|
|
1111
|
-
(t) =>
|
|
682
|
+
(t) => ge(t) && typeof t.id == "string"
|
|
1112
683
|
) : [];
|
|
1113
684
|
}
|
|
1114
|
-
function
|
|
685
|
+
function Ge(e) {
|
|
1115
686
|
return Array.isArray(e.sections) ? e.sections.filter(
|
|
1116
|
-
(t) =>
|
|
687
|
+
(t) => ge(t)
|
|
1117
688
|
) : [];
|
|
1118
689
|
}
|
|
1119
|
-
function
|
|
690
|
+
function Ue(e) {
|
|
1120
691
|
return Array.isArray(e.views) ? e.views.filter(
|
|
1121
|
-
(t) =>
|
|
692
|
+
(t) => ge(t)
|
|
1122
693
|
) : [];
|
|
1123
694
|
}
|
|
1124
|
-
function
|
|
695
|
+
function te(e) {
|
|
1125
696
|
if (!Array.isArray(e))
|
|
1126
697
|
return [];
|
|
1127
698
|
const t = [];
|
|
1128
699
|
for (const a of e) {
|
|
1129
|
-
const
|
|
1130
|
-
|
|
700
|
+
const s = J(a);
|
|
701
|
+
s && t.push(s);
|
|
1131
702
|
}
|
|
1132
703
|
return t;
|
|
1133
704
|
}
|
|
1134
|
-
function
|
|
1135
|
-
var r, n
|
|
705
|
+
function ms(e) {
|
|
706
|
+
var s, r, n;
|
|
1136
707
|
if (!e)
|
|
1137
708
|
return [];
|
|
1138
709
|
const t = [];
|
|
1139
|
-
if (
|
|
1140
|
-
t.push(...
|
|
1141
|
-
const
|
|
1142
|
-
|
|
1143
|
-
...
|
|
1144
|
-
(
|
|
710
|
+
if (me(e.source) && t.push(e.source), e.kind === "metric") {
|
|
711
|
+
t.push(...te(e.measures));
|
|
712
|
+
const i = J(e.dateField);
|
|
713
|
+
i && t.push(i), t.push(...te(e.dimensions)), t.push(
|
|
714
|
+
...te(
|
|
715
|
+
(s = e.filters) == null ? void 0 : s.map((d) => d.field)
|
|
1145
716
|
)
|
|
1146
717
|
);
|
|
1147
718
|
} else if (e.kind === "records") {
|
|
1148
|
-
const
|
|
1149
|
-
|
|
1150
|
-
...
|
|
1151
|
-
(
|
|
719
|
+
const i = J(e.dateField);
|
|
720
|
+
i && t.push(i), t.push(...te(e.fields)), t.push(
|
|
721
|
+
...te(
|
|
722
|
+
(r = e.filters) == null ? void 0 : r.map((d) => d.field)
|
|
1152
723
|
)
|
|
1153
724
|
);
|
|
1154
|
-
} else e.kind === "inputOptions" ? (((
|
|
1155
|
-
...
|
|
725
|
+
} else e.kind === "inputOptions" ? (((n = e.population) == null ? void 0 : n.kind) === "related_population" && me(e.population.baseSource) && t.push(e.population.baseSource), t.push(
|
|
726
|
+
...te([
|
|
1156
727
|
e.labelField,
|
|
1157
728
|
e.valueField,
|
|
1158
729
|
e.searchField,
|
|
1159
730
|
...e.disambiguationFields || []
|
|
1160
|
-
].filter((
|
|
1161
|
-
)) : e.kind === "sql" && t.push(...
|
|
731
|
+
].filter((i) => !!i))
|
|
732
|
+
)) : e.kind === "sql" && t.push(...te(e.fields));
|
|
1162
733
|
const a = "inputs" in e && Array.isArray(e.inputs) ? e.inputs : [];
|
|
1163
|
-
for (const
|
|
1164
|
-
const
|
|
1165
|
-
|
|
734
|
+
for (const i of a) {
|
|
735
|
+
const d = J(i.field);
|
|
736
|
+
d && t.push(d);
|
|
1166
737
|
}
|
|
1167
738
|
return t;
|
|
1168
739
|
}
|
|
1169
|
-
function
|
|
740
|
+
function gs(e) {
|
|
1170
741
|
const t = [];
|
|
1171
|
-
for (const a of
|
|
1172
|
-
const
|
|
1173
|
-
|
|
742
|
+
for (const a of $t(e)) {
|
|
743
|
+
const s = J(a.field);
|
|
744
|
+
s && t.push(s);
|
|
1174
745
|
}
|
|
1175
|
-
for (const a of
|
|
1176
|
-
for (const
|
|
1177
|
-
t.push(...
|
|
746
|
+
for (const a of Ge(e))
|
|
747
|
+
for (const s of Ue(a))
|
|
748
|
+
t.push(...ms(s.analytics));
|
|
1178
749
|
return t;
|
|
1179
750
|
}
|
|
1180
|
-
function
|
|
751
|
+
function bs(e) {
|
|
1181
752
|
var a;
|
|
1182
753
|
const t = [];
|
|
1183
|
-
for (const
|
|
1184
|
-
for (const
|
|
1185
|
-
|
|
754
|
+
for (const s of Ge(e))
|
|
755
|
+
for (const r of Ue(s))
|
|
756
|
+
me((a = r.analytics) == null ? void 0 : a.source) && t.push(r.analytics.source);
|
|
1186
757
|
return t;
|
|
1187
758
|
}
|
|
1188
|
-
function
|
|
1189
|
-
const a =
|
|
759
|
+
function Is(e, t) {
|
|
760
|
+
const a = we(e).filter(me);
|
|
1190
761
|
if (a.length === 0)
|
|
1191
762
|
return t.push(
|
|
1192
|
-
|
|
763
|
+
H(
|
|
1193
764
|
"missing_materializable_dataset",
|
|
1194
765
|
"No semantic or physical source could be converted into the current dashboard authoring dataset reference."
|
|
1195
766
|
)
|
|
1196
767
|
), [];
|
|
1197
|
-
const
|
|
768
|
+
const s = a.every((n) => n.kind === "semantic"), r = Array.from(
|
|
1198
769
|
new Set(
|
|
1199
|
-
a.filter((
|
|
770
|
+
a.filter((n) => n.kind === "semantic").map((n) => n.domainId)
|
|
1200
771
|
)
|
|
1201
772
|
);
|
|
1202
|
-
return a.length > 1 && (!
|
|
1203
|
-
|
|
773
|
+
return a.length > 1 && (!s || r.length !== 1) ? (t.push(
|
|
774
|
+
H(
|
|
1204
775
|
"multiple_datasets_out_of_scope",
|
|
1205
776
|
"The dashboard authoring compiler supports multiple datasets only within one semantic domain; using the first source and deferring the rest."
|
|
1206
777
|
)
|
|
1207
778
|
), [a[0]]) : a;
|
|
1208
779
|
}
|
|
1209
|
-
function
|
|
1210
|
-
const a =
|
|
1211
|
-
|
|
780
|
+
function ys(e, t) {
|
|
781
|
+
const a = Ge(e), s = $t(e), r = we(gs(e)), n = we(
|
|
782
|
+
bs(e)
|
|
1212
783
|
);
|
|
1213
784
|
return {
|
|
1214
785
|
sections: a,
|
|
1215
|
-
inputs:
|
|
1216
|
-
sources:
|
|
1217
|
-
primarySources:
|
|
1218
|
-
defaultSource:
|
|
1219
|
-
datasets:
|
|
786
|
+
inputs: s,
|
|
787
|
+
sources: r,
|
|
788
|
+
primarySources: n,
|
|
789
|
+
defaultSource: n.length === 1 ? n[0] : void 0,
|
|
790
|
+
datasets: Is(r, t)
|
|
1220
791
|
};
|
|
1221
792
|
}
|
|
1222
|
-
function
|
|
1223
|
-
return e &&
|
|
793
|
+
function _s(e) {
|
|
794
|
+
return e && Ct(e).ok ? e : void 0;
|
|
1224
795
|
}
|
|
1225
|
-
function
|
|
796
|
+
function Cs(e) {
|
|
1226
797
|
var t;
|
|
1227
798
|
switch ((t = e.presentation) == null ? void 0 : t.kind) {
|
|
1228
799
|
case "kpi":
|
|
@@ -1241,12 +812,12 @@ function Rt(e) {
|
|
|
1241
812
|
return null;
|
|
1242
813
|
}
|
|
1243
814
|
}
|
|
1244
|
-
function
|
|
1245
|
-
var t, a,
|
|
1246
|
-
return ((t = e.presentation) == null ? void 0 : t.kind) === "kpi" ? "kpi" : ((a = e.presentation) == null ? void 0 : a.kind) === "table" ? "table" : ((
|
|
815
|
+
function Ss(e) {
|
|
816
|
+
var t, a, s;
|
|
817
|
+
return ((t = e.presentation) == null ? void 0 : t.kind) === "kpi" ? "kpi" : ((a = e.presentation) == null ? void 0 : a.kind) === "table" ? "table" : ((s = e.presentation) == null ? void 0 : s.kind) === "text" ? "text" : "chart";
|
|
1247
818
|
}
|
|
1248
|
-
function
|
|
1249
|
-
const t =
|
|
819
|
+
function vs(e) {
|
|
820
|
+
const t = Na(e);
|
|
1250
821
|
switch (t) {
|
|
1251
822
|
case "not_in":
|
|
1252
823
|
return "not in";
|
|
@@ -1260,77 +831,77 @@ function Nt(e) {
|
|
|
1260
831
|
return t || "in";
|
|
1261
832
|
}
|
|
1262
833
|
}
|
|
1263
|
-
function
|
|
1264
|
-
return
|
|
834
|
+
function ws(e) {
|
|
835
|
+
return ge(e.field) ? e.field.dataType === "datetime" ? "date" : e.field.dataType || "string" : "string";
|
|
1265
836
|
}
|
|
1266
|
-
function
|
|
837
|
+
function xs(e) {
|
|
1267
838
|
if (!(!e || e.kind !== "physical"))
|
|
1268
839
|
return [e.databaseName, e.schemaName, e.tableName].filter(Boolean).join(".");
|
|
1269
840
|
}
|
|
1270
|
-
function
|
|
841
|
+
function Ds(e, t, a, s, r, n) {
|
|
1271
842
|
if (e.kind !== "filter")
|
|
1272
|
-
return
|
|
1273
|
-
|
|
843
|
+
return n.push(
|
|
844
|
+
H(
|
|
1274
845
|
"control_inputs_deferred",
|
|
1275
846
|
`Control input "${e.label}" is represented in the protocol but not yet materialized by the dashboard authoring adapter.`
|
|
1276
847
|
)
|
|
1277
848
|
), null;
|
|
1278
|
-
if (!
|
|
1279
|
-
return
|
|
1280
|
-
|
|
849
|
+
if (!ge(e.field) || typeof e.field.name != "string")
|
|
850
|
+
return n.push(
|
|
851
|
+
H(
|
|
1281
852
|
"filter_requires_field",
|
|
1282
853
|
`Filter "${e.label || e.id}" needs a field before the dashboard compiler can materialize it.`
|
|
1283
854
|
)
|
|
1284
855
|
), null;
|
|
1285
|
-
const
|
|
856
|
+
const i = Ua({
|
|
1286
857
|
explicitSource: void 0,
|
|
1287
858
|
field: e.field,
|
|
1288
859
|
defaultSource: t,
|
|
1289
860
|
fallbackSources: a
|
|
1290
|
-
}),
|
|
1291
|
-
if (!
|
|
1292
|
-
return
|
|
1293
|
-
|
|
861
|
+
}), d = (i == null ? void 0 : i.kind) === "semantic" || (i == null ? void 0 : i.kind) === "physical" ? i.connectionId : void 0;
|
|
862
|
+
if (!d)
|
|
863
|
+
return n.push(
|
|
864
|
+
H(
|
|
1294
865
|
"filter_requires_connection_id",
|
|
1295
866
|
`Filter "${e.label}" needs a source connectionId before the dashboard compiler can materialize it.`
|
|
1296
867
|
)
|
|
1297
868
|
), null;
|
|
1298
|
-
const
|
|
1299
|
-
id: `filter-${
|
|
1300
|
-
|
|
1301
|
-
|
|
869
|
+
const y = {
|
|
870
|
+
id: `filter-${kt(
|
|
871
|
+
he(e.id, e.field.name),
|
|
872
|
+
r
|
|
1302
873
|
)}`,
|
|
1303
874
|
variableName: e.id,
|
|
1304
|
-
connectionId:
|
|
875
|
+
connectionId: d,
|
|
1305
876
|
title: e.label,
|
|
1306
877
|
column: e.field.name,
|
|
1307
|
-
dataType:
|
|
1308
|
-
qualifiedTableName:
|
|
878
|
+
dataType: ws(e),
|
|
879
|
+
qualifiedTableName: xs(i),
|
|
1309
880
|
sql: "",
|
|
1310
|
-
operation:
|
|
881
|
+
operation: vs(e.operator),
|
|
1311
882
|
type: e.multi === !1 ? "single" : "multiple",
|
|
1312
883
|
location: "dashboard",
|
|
1313
|
-
fieldMeta: (
|
|
884
|
+
fieldMeta: (i == null ? void 0 : i.kind) === "semantic" ? {
|
|
1314
885
|
name: e.field.name,
|
|
1315
886
|
qualifiedFieldName: e.field.name,
|
|
1316
887
|
dataType: e.field.dataType,
|
|
1317
888
|
role: e.field.role === "measure" ? "metric" : "groupby"
|
|
1318
889
|
} : void 0,
|
|
1319
|
-
semanticContext: (
|
|
1320
|
-
semanticDomainId:
|
|
1321
|
-
connectionId:
|
|
1322
|
-
} : (
|
|
1323
|
-
connectionId:
|
|
1324
|
-
connectionType:
|
|
890
|
+
semanticContext: (i == null ? void 0 : i.kind) === "semantic" ? {
|
|
891
|
+
semanticDomainId: i.domainId,
|
|
892
|
+
connectionId: i.connectionId
|
|
893
|
+
} : (i == null ? void 0 : i.kind) === "physical" ? {
|
|
894
|
+
connectionId: i.connectionId,
|
|
895
|
+
connectionType: i.connectionType,
|
|
1325
896
|
selectedEntities: [
|
|
1326
897
|
{
|
|
1327
898
|
type: "table",
|
|
1328
|
-
connectionId:
|
|
1329
|
-
connectionType:
|
|
1330
|
-
dialect:
|
|
1331
|
-
database:
|
|
1332
|
-
schema:
|
|
1333
|
-
name:
|
|
899
|
+
connectionId: i.connectionId,
|
|
900
|
+
connectionType: i.connectionType,
|
|
901
|
+
dialect: i.dialect,
|
|
902
|
+
database: i.databaseName,
|
|
903
|
+
schema: i.schemaName,
|
|
904
|
+
name: i.tableName
|
|
1334
905
|
}
|
|
1335
906
|
]
|
|
1336
907
|
} : void 0
|
|
@@ -1339,38 +910,38 @@ function $t(e, t, a, r, n, i) {
|
|
|
1339
910
|
id: e.id,
|
|
1340
911
|
label: e.label,
|
|
1341
912
|
variableName: e.id,
|
|
1342
|
-
scope:
|
|
1343
|
-
filter:
|
|
1344
|
-
defaultValue:
|
|
1345
|
-
|
|
913
|
+
scope: s,
|
|
914
|
+
filter: y,
|
|
915
|
+
defaultValue: Dt(
|
|
916
|
+
y,
|
|
1346
917
|
e.defaultValue
|
|
1347
918
|
)
|
|
1348
919
|
};
|
|
1349
920
|
}
|
|
1350
|
-
function
|
|
921
|
+
function Re(e) {
|
|
1351
922
|
const t = [], a = [];
|
|
1352
|
-
for (const
|
|
1353
|
-
const
|
|
1354
|
-
|
|
923
|
+
for (const s of e.viewIds) {
|
|
924
|
+
const r = e.viewIdToCardId.get(s);
|
|
925
|
+
r ? t.push(r) : a.push(s);
|
|
1355
926
|
}
|
|
1356
927
|
return a.length > 0 && e.warnings.push(
|
|
1357
|
-
|
|
928
|
+
H(
|
|
1358
929
|
"input_scope_view_not_found",
|
|
1359
930
|
`Filter "${e.inputLabel}" referenced unknown view ids: ${a.join(", ")}.`
|
|
1360
931
|
)
|
|
1361
932
|
), Array.from(new Set(t));
|
|
1362
933
|
}
|
|
1363
|
-
function
|
|
1364
|
-
var
|
|
934
|
+
function Ts(e) {
|
|
935
|
+
var s, r;
|
|
1365
936
|
if (!e.protocolScope) {
|
|
1366
|
-
const
|
|
1367
|
-
return
|
|
937
|
+
const n = Array.from(new Set(e.boundCardIds));
|
|
938
|
+
return n.length > 0 && n.length < e.allCardIds.length ? { kind: "cards", cardIds: n } : void 0;
|
|
1368
939
|
}
|
|
1369
940
|
if (e.protocolScope.level === "dashboard") {
|
|
1370
|
-
if (!((
|
|
941
|
+
if (!((s = e.protocolScope.excludeViewIds) != null && s.length))
|
|
1371
942
|
return;
|
|
1372
|
-
const
|
|
1373
|
-
|
|
943
|
+
const n = new Set(
|
|
944
|
+
Re({
|
|
1374
945
|
inputLabel: e.inputLabel,
|
|
1375
946
|
viewIds: e.protocolScope.excludeViewIds,
|
|
1376
947
|
viewIdToCardId: e.viewIdToCardId,
|
|
@@ -1379,35 +950,35 @@ function Bt(e) {
|
|
|
1379
950
|
);
|
|
1380
951
|
return {
|
|
1381
952
|
kind: "cards",
|
|
1382
|
-
cardIds: e.allCardIds.filter((
|
|
953
|
+
cardIds: e.allCardIds.filter((i) => !n.has(i))
|
|
1383
954
|
};
|
|
1384
955
|
}
|
|
1385
956
|
if (e.protocolScope.level === "view") {
|
|
1386
|
-
const
|
|
957
|
+
const n = Re({
|
|
1387
958
|
inputLabel: e.inputLabel,
|
|
1388
959
|
viewIds: e.protocolScope.viewIds,
|
|
1389
960
|
viewIdToCardId: e.viewIdToCardId,
|
|
1390
961
|
warnings: e.warnings
|
|
1391
962
|
});
|
|
1392
|
-
return
|
|
1393
|
-
|
|
963
|
+
return n.length === 0 ? (e.warnings.push(
|
|
964
|
+
H(
|
|
1394
965
|
"input_scope_has_no_materialized_cards",
|
|
1395
966
|
`Filter "${e.inputLabel}" was deferred because its view scope does not match any materialized cards.`
|
|
1396
967
|
)
|
|
1397
|
-
), null) : { kind: "cards", cardIds:
|
|
968
|
+
), null) : { kind: "cards", cardIds: n };
|
|
1398
969
|
}
|
|
1399
970
|
const t = e.sectionIdToCardIds.get(e.protocolScope.sectionId) || [];
|
|
1400
971
|
if (t.length === 0)
|
|
1401
972
|
return e.warnings.push(
|
|
1402
|
-
|
|
973
|
+
H(
|
|
1403
974
|
"input_scope_section_not_found",
|
|
1404
975
|
`Filter "${e.inputLabel}" was deferred because section "${e.protocolScope.sectionId}" does not match any materialized cards.`
|
|
1405
976
|
)
|
|
1406
977
|
), null;
|
|
1407
|
-
if (!((
|
|
978
|
+
if (!((r = e.protocolScope.excludeViewIds) != null && r.length))
|
|
1408
979
|
return { kind: "cards", cardIds: t };
|
|
1409
980
|
const a = new Set(
|
|
1410
|
-
|
|
981
|
+
Re({
|
|
1411
982
|
inputLabel: e.inputLabel,
|
|
1412
983
|
viewIds: e.protocolScope.excludeViewIds,
|
|
1413
984
|
viewIdToCardId: e.viewIdToCardId,
|
|
@@ -1416,107 +987,107 @@ function Bt(e) {
|
|
|
1416
987
|
);
|
|
1417
988
|
return {
|
|
1418
989
|
kind: "cards",
|
|
1419
|
-
cardIds: t.filter((
|
|
990
|
+
cardIds: t.filter((n) => !a.has(n))
|
|
1420
991
|
};
|
|
1421
992
|
}
|
|
1422
|
-
function
|
|
1423
|
-
var
|
|
1424
|
-
const t = [], a =
|
|
1425
|
-
for (const
|
|
1426
|
-
t.push(
|
|
1427
|
-
for (const
|
|
1428
|
-
t.push(
|
|
1429
|
-
const
|
|
1430
|
-
let
|
|
1431
|
-
for (const [
|
|
1432
|
-
const
|
|
1433
|
-
|
|
1434
|
-
for (const [
|
|
1435
|
-
const
|
|
1436
|
-
|
|
1437
|
-
`card-${
|
|
993
|
+
function ci(e) {
|
|
994
|
+
var $, _, g;
|
|
995
|
+
const t = [], a = Fa(e);
|
|
996
|
+
for (const A of a.warnings)
|
|
997
|
+
t.push(H(A.code, A.message));
|
|
998
|
+
for (const A of a.errors)
|
|
999
|
+
t.push(H(A.code, A.message));
|
|
1000
|
+
const s = ys(e, t), r = [], n = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map(), d = /* @__PURE__ */ new Map(), u = /* @__PURE__ */ new Set(), b = /* @__PURE__ */ new Set();
|
|
1001
|
+
let y = 0;
|
|
1002
|
+
for (const [A, c] of s.sections.entries()) {
|
|
1003
|
+
const m = typeof c.title == "string" ? c.title : `Section ${A + 1}`, F = c.id || he(m, `section-${A + 1}`);
|
|
1004
|
+
i.set(F, []);
|
|
1005
|
+
for (const [k, D] of Ue(c).entries()) {
|
|
1006
|
+
const N = Cs(D), R = he(
|
|
1007
|
+
D.id || `${m}-${D.title || `View ${k + 1}`}`,
|
|
1008
|
+
`card-${A + 1}-${k + 1}`
|
|
1438
1009
|
);
|
|
1439
|
-
if (!
|
|
1010
|
+
if (!N) {
|
|
1440
1011
|
t.push(
|
|
1441
|
-
|
|
1012
|
+
H(
|
|
1442
1013
|
"unsupported_presentation",
|
|
1443
|
-
`Dashboard presentation "${((
|
|
1444
|
-
`card-${
|
|
1014
|
+
`Dashboard presentation "${(($ = D.presentation) == null ? void 0 : $.kind) || "unknown"}" is not supported by the dashboard authoring adapter.`,
|
|
1015
|
+
`card-${R}`
|
|
1445
1016
|
)
|
|
1446
1017
|
);
|
|
1447
1018
|
continue;
|
|
1448
1019
|
}
|
|
1449
|
-
if (((
|
|
1020
|
+
if (((_ = D.analytics) == null ? void 0 : _.kind) === "sql") {
|
|
1450
1021
|
t.push(
|
|
1451
|
-
|
|
1022
|
+
H(
|
|
1452
1023
|
"sql_intent_deferred",
|
|
1453
1024
|
"SQL analytics intent is valid protocol, but the current dashboard authoring adapter only materializes semantic and physical config-card intents.",
|
|
1454
|
-
`card-${
|
|
1025
|
+
`card-${R}`
|
|
1455
1026
|
)
|
|
1456
1027
|
);
|
|
1457
1028
|
continue;
|
|
1458
1029
|
}
|
|
1459
|
-
const
|
|
1460
|
-
|
|
1461
|
-
const
|
|
1462
|
-
for (const
|
|
1463
|
-
const
|
|
1464
|
-
|
|
1030
|
+
const O = kt(R, u), E = `card-${O}`;
|
|
1031
|
+
D.id && n.set(D.id, E), (g = i.get(F)) == null || g.push(E);
|
|
1032
|
+
const V = D.analytics && "inputs" in D.analytics ? D.analytics.inputs : void 0;
|
|
1033
|
+
for (const K of V || []) {
|
|
1034
|
+
const L = d.get(K.inputId) || [];
|
|
1035
|
+
L.push(E), d.set(K.inputId, L);
|
|
1465
1036
|
}
|
|
1466
|
-
|
|
1467
|
-
id:
|
|
1468
|
-
frameId: `frame-${
|
|
1469
|
-
title:
|
|
1470
|
-
description:
|
|
1471
|
-
type:
|
|
1472
|
-
role:
|
|
1473
|
-
priority:
|
|
1474
|
-
section:
|
|
1475
|
-
analyticsIntent:
|
|
1476
|
-
text:
|
|
1477
|
-
}),
|
|
1037
|
+
r.push({
|
|
1038
|
+
id: E,
|
|
1039
|
+
frameId: `frame-${O}`,
|
|
1040
|
+
title: D.title,
|
|
1041
|
+
description: D.description,
|
|
1042
|
+
type: N,
|
|
1043
|
+
role: Ss(D),
|
|
1044
|
+
priority: y,
|
|
1045
|
+
section: m,
|
|
1046
|
+
analyticsIntent: _s(D.analytics),
|
|
1047
|
+
text: D.text
|
|
1048
|
+
}), y += 1;
|
|
1478
1049
|
}
|
|
1479
1050
|
}
|
|
1480
|
-
const
|
|
1481
|
-
const
|
|
1482
|
-
protocolScope:
|
|
1483
|
-
inputLabel:
|
|
1484
|
-
allCardIds:
|
|
1485
|
-
boundCardIds:
|
|
1486
|
-
viewIdToCardId:
|
|
1487
|
-
sectionIdToCardIds:
|
|
1051
|
+
const C = s.inputs.map((A) => {
|
|
1052
|
+
const c = Ts({
|
|
1053
|
+
protocolScope: A.scope,
|
|
1054
|
+
inputLabel: A.label,
|
|
1055
|
+
allCardIds: r.map((m) => m.id),
|
|
1056
|
+
boundCardIds: d.get(A.id) || [],
|
|
1057
|
+
viewIdToCardId: n,
|
|
1058
|
+
sectionIdToCardIds: i,
|
|
1488
1059
|
warnings: t
|
|
1489
1060
|
});
|
|
1490
|
-
return
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1061
|
+
return c === null ? null : Ds(
|
|
1062
|
+
A,
|
|
1063
|
+
s.defaultSource,
|
|
1064
|
+
s.sources,
|
|
1065
|
+
c,
|
|
1066
|
+
b,
|
|
1496
1067
|
t
|
|
1497
1068
|
);
|
|
1498
|
-
}).filter((
|
|
1069
|
+
}).filter((A) => !!A);
|
|
1499
1070
|
return { plan: {
|
|
1500
1071
|
version: 1,
|
|
1501
|
-
id: `plan-${
|
|
1072
|
+
id: `plan-${he(e.title, "dashboard")}`,
|
|
1502
1073
|
title: e.title,
|
|
1503
1074
|
description: e.description,
|
|
1504
|
-
datasets:
|
|
1075
|
+
datasets: s.datasets,
|
|
1505
1076
|
sheets: [
|
|
1506
1077
|
{
|
|
1507
|
-
id: `sheet-${
|
|
1078
|
+
id: `sheet-${he(e.title, "dashboard")}`,
|
|
1508
1079
|
title: e.title,
|
|
1509
1080
|
description: e.description,
|
|
1510
1081
|
kind: "dashboard",
|
|
1511
|
-
cards:
|
|
1082
|
+
cards: r
|
|
1512
1083
|
}
|
|
1513
1084
|
],
|
|
1514
|
-
filterInputs:
|
|
1085
|
+
filterInputs: C.length ? C : void 0,
|
|
1515
1086
|
warnings: t.length ? t : void 0,
|
|
1516
|
-
unresolvedRequests: a.ok ? void 0 : a.errors.map((
|
|
1087
|
+
unresolvedRequests: a.ok ? void 0 : a.errors.map((A) => A.message)
|
|
1517
1088
|
}, warnings: t };
|
|
1518
1089
|
}
|
|
1519
|
-
const
|
|
1090
|
+
const ui = [
|
|
1520
1091
|
"cardType",
|
|
1521
1092
|
"sql",
|
|
1522
1093
|
"python",
|
|
@@ -1531,324 +1102,1485 @@ const na = [
|
|
|
1531
1102
|
"resolvedPrimaryDateField",
|
|
1532
1103
|
"globalDateComparison",
|
|
1533
1104
|
"calendarContext"
|
|
1534
|
-
],
|
|
1105
|
+
], hi = [
|
|
1535
1106
|
"cardId",
|
|
1536
1107
|
"cardTitle",
|
|
1537
1108
|
"cache_config",
|
|
1538
1109
|
"queryConfig",
|
|
1539
1110
|
"tableConfig"
|
|
1540
1111
|
];
|
|
1541
|
-
class
|
|
1542
|
-
constructor(a,
|
|
1112
|
+
class W extends Error {
|
|
1113
|
+
constructor(a, s, r) {
|
|
1543
1114
|
super(a);
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
Object.setPrototypeOf(this,
|
|
1115
|
+
ke(this, "field");
|
|
1116
|
+
ke(this, "details");
|
|
1117
|
+
Object.setPrototypeOf(this, W.prototype), this.name = "CardQueryRequestError", this.field = s, this.details = r;
|
|
1547
1118
|
}
|
|
1548
1119
|
}
|
|
1549
|
-
function
|
|
1120
|
+
function je(e) {
|
|
1550
1121
|
return e.label ? `${e.label}.` : "";
|
|
1551
1122
|
}
|
|
1552
|
-
function
|
|
1123
|
+
function ae(e) {
|
|
1553
1124
|
return !e || typeof e != "object" || Array.isArray(e) ? {} : { ...e };
|
|
1554
1125
|
}
|
|
1555
|
-
function
|
|
1126
|
+
function Ce(e) {
|
|
1556
1127
|
return typeof e == "string" ? e : "";
|
|
1557
1128
|
}
|
|
1558
|
-
function
|
|
1559
|
-
const a =
|
|
1129
|
+
function ks(e, t = {}) {
|
|
1130
|
+
const a = ae(e), s = je(t), r = {};
|
|
1560
1131
|
if (a.calendarContext !== void 0) {
|
|
1561
|
-
const
|
|
1562
|
-
if (!
|
|
1563
|
-
throw new
|
|
1564
|
-
`${
|
|
1132
|
+
const i = La(a.calendarContext);
|
|
1133
|
+
if (!i.ok)
|
|
1134
|
+
throw new W(
|
|
1135
|
+
`${s}calendarContext: ${i.issues.map((d) => d.message).join("; ")}`,
|
|
1565
1136
|
"calendarContext",
|
|
1566
|
-
|
|
1137
|
+
i.issues
|
|
1567
1138
|
);
|
|
1568
|
-
|
|
1139
|
+
r.calendarContext = i.value;
|
|
1569
1140
|
}
|
|
1570
|
-
const
|
|
1571
|
-
if (!
|
|
1572
|
-
throw new
|
|
1573
|
-
`${
|
|
1141
|
+
const n = zt(a.resolvedPrimaryDateField);
|
|
1142
|
+
if (!n.ok)
|
|
1143
|
+
throw new W(
|
|
1144
|
+
`${s}${Qt(n.issues)}`,
|
|
1574
1145
|
"resolvedPrimaryDateField",
|
|
1575
|
-
|
|
1146
|
+
n.issues
|
|
1576
1147
|
);
|
|
1577
|
-
if (a.resolvedPrimaryDateField && (
|
|
1578
|
-
const
|
|
1579
|
-
if (!
|
|
1580
|
-
throw new
|
|
1581
|
-
`${
|
|
1148
|
+
if (a.resolvedPrimaryDateField && (r.resolvedPrimaryDateField = a.resolvedPrimaryDateField), a.globalDateComparison !== void 0) {
|
|
1149
|
+
const i = Pa(a.globalDateComparison);
|
|
1150
|
+
if (!i.ok)
|
|
1151
|
+
throw new W(
|
|
1152
|
+
`${s}Invalid globalDateComparison: ${i.errors.map((d) => `${d.path}: ${d.message}`).join("; ")}`,
|
|
1582
1153
|
"globalDateComparison",
|
|
1583
|
-
|
|
1154
|
+
i.errors
|
|
1584
1155
|
);
|
|
1585
|
-
|
|
1156
|
+
r.globalDateComparison = Ma(
|
|
1586
1157
|
a.globalDateComparison
|
|
1587
1158
|
);
|
|
1588
1159
|
}
|
|
1589
|
-
return
|
|
1160
|
+
return r;
|
|
1590
1161
|
}
|
|
1591
|
-
function
|
|
1592
|
-
const a =
|
|
1162
|
+
function fi(e, t = {}) {
|
|
1163
|
+
const a = ae(e), s = je(t), r = {};
|
|
1593
1164
|
if (a.pagination !== void 0) {
|
|
1594
|
-
const
|
|
1595
|
-
if (!Number.isInteger(
|
|
1596
|
-
throw new
|
|
1597
|
-
`${
|
|
1165
|
+
const n = ae(a.pagination), i = n.page, d = n.pageSize;
|
|
1166
|
+
if (!Number.isInteger(i) || i < 1 || !Number.isInteger(d) || d < 1)
|
|
1167
|
+
throw new W(
|
|
1168
|
+
`${s}pagination must name a page and a page size of at least 1`,
|
|
1598
1169
|
"pagination"
|
|
1599
1170
|
);
|
|
1600
|
-
|
|
1171
|
+
r.pagination = { page: i, pageSize: d };
|
|
1601
1172
|
}
|
|
1602
1173
|
if (a.tableTotalsRequest !== void 0) {
|
|
1603
1174
|
if (!a.tableTotalsRequest || typeof a.tableTotalsRequest != "object" || Array.isArray(a.tableTotalsRequest))
|
|
1604
|
-
throw new
|
|
1605
|
-
|
|
1175
|
+
throw new W(`${s}tableTotalsRequest must be an object`, "tableTotalsRequest");
|
|
1176
|
+
r.tableTotalsRequest = a.tableTotalsRequest;
|
|
1606
1177
|
}
|
|
1607
1178
|
if (a.sourceRowProbe !== void 0) {
|
|
1608
|
-
const
|
|
1609
|
-
if (!Number.isInteger(
|
|
1610
|
-
throw new
|
|
1611
|
-
`${
|
|
1179
|
+
const n = ae(a.sourceRowProbe).limit;
|
|
1180
|
+
if (!Number.isInteger(n) || n < 1)
|
|
1181
|
+
throw new W(
|
|
1182
|
+
`${s}sourceRowProbe must name a limit of at least 1`,
|
|
1612
1183
|
"sourceRowProbe"
|
|
1613
1184
|
);
|
|
1614
|
-
if (
|
|
1615
|
-
throw new
|
|
1616
|
-
`${
|
|
1185
|
+
if (r.pagination)
|
|
1186
|
+
throw new W(
|
|
1187
|
+
`${s}sourceRowProbe cannot be combined with pagination`,
|
|
1617
1188
|
"sourceRowProbe"
|
|
1618
1189
|
);
|
|
1619
|
-
|
|
1190
|
+
r.sourceRowProbe = { limit: n };
|
|
1620
1191
|
}
|
|
1621
|
-
return
|
|
1622
|
-
}
|
|
1623
|
-
function
|
|
1624
|
-
const a =
|
|
1625
|
-
if (!
|
|
1626
|
-
const
|
|
1627
|
-
if (!
|
|
1628
|
-
const
|
|
1629
|
-
if (
|
|
1630
|
-
throw
|
|
1631
|
-
const
|
|
1632
|
-
if (
|
|
1633
|
-
if (
|
|
1634
|
-
const
|
|
1635
|
-
hasExecutableConfig:
|
|
1636
|
-
sql:
|
|
1637
|
-
normalizedPython:
|
|
1192
|
+
return r;
|
|
1193
|
+
}
|
|
1194
|
+
function pi(e, t = {}) {
|
|
1195
|
+
const a = ae(e), s = je(t), r = (g) => new W(`${s}${g} is required`, g), n = Ce(a.connection_id).trim();
|
|
1196
|
+
if (!n) throw r("connection_id");
|
|
1197
|
+
const i = Ce(a.cardType).trim();
|
|
1198
|
+
if (!i) throw r("cardType");
|
|
1199
|
+
const d = a.resultOwner;
|
|
1200
|
+
if (d !== "config" && d !== "freeform" && d !== "none")
|
|
1201
|
+
throw r("resultOwner");
|
|
1202
|
+
const u = ae(a.cardConfig), b = Ce(a.sql), y = Ce(a.python), C = !!t.configOptional || Object.keys(u).length > 0;
|
|
1203
|
+
if (d === "config" && !C) throw r("cardConfig");
|
|
1204
|
+
if (d === "freeform" && !b.trim()) throw r("sql");
|
|
1205
|
+
const p = Kt({
|
|
1206
|
+
hasExecutableConfig: C,
|
|
1207
|
+
sql: b,
|
|
1208
|
+
normalizedPython: y
|
|
1638
1209
|
});
|
|
1639
|
-
if (
|
|
1640
|
-
throw new
|
|
1641
|
-
`${
|
|
1210
|
+
if (d !== p)
|
|
1211
|
+
throw new W(
|
|
1212
|
+
`${s}resultOwner must match the normalized execution owner "${p}"`,
|
|
1642
1213
|
"resultOwner"
|
|
1643
1214
|
);
|
|
1644
|
-
if (
|
|
1645
|
-
const
|
|
1646
|
-
if (Object.keys(
|
|
1647
|
-
const
|
|
1215
|
+
if (d === "none") throw r("cardConfig");
|
|
1216
|
+
const $ = ae(a.cardDataSource);
|
|
1217
|
+
if (Object.keys($).length === 0) throw r("cardDataSource");
|
|
1218
|
+
const _ = Ht({
|
|
1648
1219
|
controlValues: a.controlValues,
|
|
1649
1220
|
controlDefinitions: a.controlDefinitions,
|
|
1650
1221
|
cardControlDefinitions: a.cardControlDefinitions,
|
|
1651
1222
|
controlBindings: a.controlBindings
|
|
1652
1223
|
});
|
|
1653
1224
|
return {
|
|
1654
|
-
connection_id:
|
|
1655
|
-
cardType:
|
|
1656
|
-
sql:
|
|
1657
|
-
python:
|
|
1658
|
-
resultOwner:
|
|
1659
|
-
cardConfig:
|
|
1660
|
-
cardDataSource:
|
|
1225
|
+
connection_id: n,
|
|
1226
|
+
cardType: i,
|
|
1227
|
+
sql: b,
|
|
1228
|
+
python: y,
|
|
1229
|
+
resultOwner: d,
|
|
1230
|
+
cardConfig: u,
|
|
1231
|
+
cardDataSource: $,
|
|
1661
1232
|
active_filters: Array.isArray(a.active_filters) ? a.active_filters : [],
|
|
1662
|
-
controlValues:
|
|
1663
|
-
controlDefinitions:
|
|
1664
|
-
cardControlDefinitions:
|
|
1665
|
-
controlBindings:
|
|
1666
|
-
...
|
|
1233
|
+
controlValues: _.controlValues,
|
|
1234
|
+
controlDefinitions: _.controlDefinitions,
|
|
1235
|
+
cardControlDefinitions: _.cardControlDefinitions,
|
|
1236
|
+
controlBindings: _.controlBindings,
|
|
1237
|
+
...ks(a, t)
|
|
1238
|
+
};
|
|
1239
|
+
}
|
|
1240
|
+
const $s = {
|
|
1241
|
+
global_date: "The date filter for the whole report can't be changed through the MCP. Change it in the editor; removing or excluding it works.",
|
|
1242
|
+
not_semantic: "This filter reads a database table, not a dataset, so it can't be changed through the MCP. Change it in the editor; removing or excluding it works.",
|
|
1243
|
+
scope_not_expressible: "This filter applies to chosen cards rather than whole sheets, so it can't be changed through the MCP. Change it in the editor; removing or excluding it works."
|
|
1244
|
+
};
|
|
1245
|
+
function Fs(e, t, a = {}) {
|
|
1246
|
+
var d;
|
|
1247
|
+
const s = de(e), r = Yt(t.scope), n = new Set(re(e).map((u) => u.cardId)), i = {
|
|
1248
|
+
reaches: [],
|
|
1249
|
+
excluded: [
|
|
1250
|
+
.../* @__PURE__ */ new Set([
|
|
1251
|
+
...(((d = t.application) == null ? void 0 : d.cards) ?? []).filter((u) => u.kind === "excluded").map((u) => u.cardId),
|
|
1252
|
+
...r.filter((u) => n.has(u))
|
|
1253
|
+
])
|
|
1254
|
+
],
|
|
1255
|
+
notReached: []
|
|
1256
|
+
};
|
|
1257
|
+
if (t.filter.kind === "global-date") {
|
|
1258
|
+
const u = new Set(i.excluded);
|
|
1259
|
+
return i.reaches = Xt(e, t.filter).filter(({ card: b }) => !u.has(b.id) && fe(b)).map(({ card: b }) => b.id), i;
|
|
1260
|
+
}
|
|
1261
|
+
for (const u of s.reachedCards({ inputId: t.id })) {
|
|
1262
|
+
const b = ve(t, u.card, a), y = b.reach, C = () => {
|
|
1263
|
+
const p = fe(u.card);
|
|
1264
|
+
return {
|
|
1265
|
+
cardId: u.cardId,
|
|
1266
|
+
title: u.card.title ?? "",
|
|
1267
|
+
...(p == null ? void 0 : p.kind) === "semantic" ? { datasetName: p.datasetName } : {}
|
|
1268
|
+
};
|
|
1269
|
+
};
|
|
1270
|
+
switch (y) {
|
|
1271
|
+
case "bound":
|
|
1272
|
+
case "automatic":
|
|
1273
|
+
case "sql":
|
|
1274
|
+
case "relationshipApplied":
|
|
1275
|
+
i.reaches.push(u.cardId);
|
|
1276
|
+
break;
|
|
1277
|
+
case "blocked":
|
|
1278
|
+
case "ambiguous":
|
|
1279
|
+
(i.blocked ?? (i.blocked = [])).push({ cardId: u.cardId, title: u.card.title ?? "", reason: y });
|
|
1280
|
+
break;
|
|
1281
|
+
case "relationship":
|
|
1282
|
+
(i.relationshipPending ?? (i.relationshipPending = [])).push(C());
|
|
1283
|
+
break;
|
|
1284
|
+
case "excluded":
|
|
1285
|
+
break;
|
|
1286
|
+
case "notApplicable":
|
|
1287
|
+
fe(u.card) && i.notReached.push({ ...C(), ...b.reason ? { reason: b.reason } : {} });
|
|
1288
|
+
break;
|
|
1289
|
+
default: {
|
|
1290
|
+
const p = y;
|
|
1291
|
+
throw new Error(`Unhandled filter reach ${String(p)}`);
|
|
1292
|
+
}
|
|
1293
|
+
}
|
|
1294
|
+
}
|
|
1295
|
+
return i;
|
|
1296
|
+
}
|
|
1297
|
+
function As(e, t) {
|
|
1298
|
+
var r;
|
|
1299
|
+
const a = t.scope;
|
|
1300
|
+
if (a.kind === "allSheets") {
|
|
1301
|
+
if ((r = a.sheetKinds) != null && r.length && !a.sheetKinds.includes("dashboard")) return;
|
|
1302
|
+
const n = Jt(a);
|
|
1303
|
+
return {
|
|
1304
|
+
sheetIds: "all",
|
|
1305
|
+
...n.length ? { exceptSheetIds: [...n] } : {},
|
|
1306
|
+
...Zt(a) ? { includesDocumentSheets: !0 } : {}
|
|
1307
|
+
};
|
|
1308
|
+
}
|
|
1309
|
+
if (a.kind !== "sheets") return;
|
|
1310
|
+
const s = [...Me(e).values()].filter((n) => yt(t, n));
|
|
1311
|
+
return {
|
|
1312
|
+
sheetIds: s.filter((n) => n.sheetKind === "dashboard").map((n) => n.sheetId),
|
|
1313
|
+
// Document sheets it names stay through a change of sheets (`withUnstatedScopeParts`).
|
|
1314
|
+
...s.some((n) => n.sheetKind === "document") ? { includesDocumentSheets: !0 } : {}
|
|
1315
|
+
};
|
|
1316
|
+
}
|
|
1317
|
+
function Ft(e, t) {
|
|
1318
|
+
return e ?? { tz: "UTC", weekStart: 1, anchor: { iso: t ?? "1970-01-01T00:00:00.000Z" } };
|
|
1319
|
+
}
|
|
1320
|
+
function At(e, t, a, s) {
|
|
1321
|
+
var g, A, c;
|
|
1322
|
+
const { input: r } = t, n = Fs(e, r, s), i = (m, F) => ({
|
|
1323
|
+
filterId: r.id,
|
|
1324
|
+
label: r.label,
|
|
1325
|
+
editable: !1,
|
|
1326
|
+
kind: F,
|
|
1327
|
+
notEditable: { reason: m, message: $s[m] },
|
|
1328
|
+
reaches: n.reaches,
|
|
1329
|
+
excluded: n.excluded,
|
|
1330
|
+
...n.blocked ? { blocked: n.blocked } : {},
|
|
1331
|
+
...n.relationshipPending ? { relationshipPending: n.relationshipPending } : {}
|
|
1332
|
+
});
|
|
1333
|
+
if (r.filter.kind === "global-date") return i("global_date", "global_date");
|
|
1334
|
+
const d = Wt(r.filter).filter((m) => m.kind === "semantic");
|
|
1335
|
+
if (d.length !== 1 || d[0].kind !== "semantic") return i("not_semantic", "field");
|
|
1336
|
+
const u = As(e, r);
|
|
1337
|
+
if (!u || t.origin !== "embeddedInput") return i("scope_not_expressible", "field");
|
|
1338
|
+
const b = ((g = r.filter.fieldMeta) == null ? void 0 : g.name) ?? ((A = r.filter.column) == null ? void 0 : A.split(".").pop()) ?? "", y = It({
|
|
1339
|
+
dashboard: e,
|
|
1340
|
+
target: { kind: "dashboardInput", input: r, scope: {} },
|
|
1341
|
+
calendar: Ft(a, void 0)
|
|
1342
|
+
}).value, C = St(r.filter.dataType), p = C || (c = y == null ? void 0 : y.values) == null ? void 0 : c.filter((m) => ["string", "number", "boolean"].includes(typeof m)), $ = y && "relativeMeta" in y ? y.relativeMeta : void 0, _ = C && $ ? Aa($) : null;
|
|
1343
|
+
return {
|
|
1344
|
+
filterId: r.id,
|
|
1345
|
+
label: r.label,
|
|
1346
|
+
editable: !0,
|
|
1347
|
+
domainId: d[0].domainId,
|
|
1348
|
+
datasetName: d[0].datasetName,
|
|
1349
|
+
field: b,
|
|
1350
|
+
selection: r.filter.type === "single" ? "single" : "multiple",
|
|
1351
|
+
...p != null && p.length ? { defaultValues: p } : {},
|
|
1352
|
+
..._ ? { defaultPeriod: _ } : {},
|
|
1353
|
+
...C ? { datePicker: r.filter.dateSelectionMode === "day" ? "day" : r.filter.dateSelectionMode === "months" ? "month" : "range" } : {},
|
|
1354
|
+
...u,
|
|
1355
|
+
...n
|
|
1356
|
+
};
|
|
1357
|
+
}
|
|
1358
|
+
function Rt(e, t, a) {
|
|
1359
|
+
return de(e).inputs.map((s) => At(e, s, t, a));
|
|
1360
|
+
}
|
|
1361
|
+
function pe(e, t, a, s) {
|
|
1362
|
+
const r = de(e).findFilterInput({ inputId: t });
|
|
1363
|
+
return r ? At(e, r, a, s) : void 0;
|
|
1364
|
+
}
|
|
1365
|
+
function Rs(e, t, a, s, r) {
|
|
1366
|
+
var c, m, F, k, D, N;
|
|
1367
|
+
const n = oe(e, { sql: !0 });
|
|
1368
|
+
if (!n.editable) return [n.message];
|
|
1369
|
+
const i = n.query, d = t;
|
|
1370
|
+
if ("sql" in t) return d.sql === i.sql && d.connectionId === i.connectionId ? [] : ["the SQL"];
|
|
1371
|
+
const u = (s == null ? void 0 : s.source.kind) === "semantic" ? oe({
|
|
1372
|
+
id: e.id,
|
|
1373
|
+
title: e.title,
|
|
1374
|
+
type: s.type,
|
|
1375
|
+
dataSource: s.source.dataSource,
|
|
1376
|
+
connectionId: s.source.connectionId,
|
|
1377
|
+
config: s.config
|
|
1378
|
+
}, { sql: !0 }) : void 0;
|
|
1379
|
+
if (u && !u.editable) return ["the compiled query"];
|
|
1380
|
+
const b = u != null && u.editable ? u.query : void 0, y = String(d.datasetName ?? ""), C = [], p = (R) => ne(R, y), $ = (R, O, E) => {
|
|
1381
|
+
const V = O ?? [], K = E ?? [];
|
|
1382
|
+
(V.length !== K.length || V.some((L, q) => p(L) !== p(K[q]))) && C.push(R);
|
|
1383
|
+
};
|
|
1384
|
+
for (const R of ["domainId", "datasetName"]) d[R] !== i[R] && C.push(R);
|
|
1385
|
+
if ($("measures", d.measures, i.measures), $("columns", d.columns, i.columns), a || n.matrix) {
|
|
1386
|
+
const R = (E) => new Set(((E == null ? void 0 : E.columns) ?? []).map(p)), O = (E, V) => (E ?? []).filter((K) => !R(V).has(p(K)));
|
|
1387
|
+
$("dimensions", O(d.dimensions, a), O(i.dimensions, n.matrix)), $("matrix.columns", a == null ? void 0 : a.columns, (c = n.matrix) == null ? void 0 : c.columns);
|
|
1388
|
+
} else
|
|
1389
|
+
$("dimensions", d.dimensions, i.dimensions);
|
|
1390
|
+
const _ = d.timeWindow !== void 0 && !d.timeGrain, g = _ && i.timeWindow === void 0 ? void 0 : _ && d.dateField === void 0 ? b == null ? void 0 : b.dateField : d.dateField;
|
|
1391
|
+
g !== void 0 && (i.dateField === void 0 || p(g) !== p(i.dateField)) && C.push("dateField"), d.timeGrain !== void 0 && d.timeGrain !== i.timeGrain && C.push("timeGrain");
|
|
1392
|
+
const A = (m = e.config) != null && m.matrix ? e.config.matrix.spec.measures.map((R) => R.kind === "aggregate" ? { aggregate: R.aggregate } : {}) : ((F = e.config) == null ? void 0 : F.metricColumns) ?? [];
|
|
1393
|
+
(d.measures ?? []).forEach((R, O) => {
|
|
1394
|
+
const E = R && typeof R == "object" ? R.aggregate : void 0;
|
|
1395
|
+
E && ht(A[O] ?? {}) !== E && C.push(`the aggregate of measures[${O}]`);
|
|
1396
|
+
});
|
|
1397
|
+
for (const { key: R, label: O } of Ee(t))
|
|
1398
|
+
ea(e, R) !== O && C.push(`the label "${O}"`);
|
|
1399
|
+
if (!r || r.aspects.includes("filters")) {
|
|
1400
|
+
const R = d.filters ?? [];
|
|
1401
|
+
let O = i.filters ?? [];
|
|
1402
|
+
const E = d.timeWindow, V = i.timeWindow, K = (L, q) => {
|
|
1403
|
+
const j = (De) => JSON.stringify((De ?? []).map(String));
|
|
1404
|
+
return p(L.field) === p(q.field) && L.operator === q.operator && (L.scope ?? "row") === (q.scope ?? "row") && (typeof L.field == "object" ? L.field.aggregate : void 0) === (typeof q.field == "object" ? q.field.aggregate : void 0) && (L.values === void 0 || j(L.values) === j(q.values));
|
|
1405
|
+
};
|
|
1406
|
+
if (E && !V) {
|
|
1407
|
+
const L = ((b == null ? void 0 : b.filters) ?? []).filter(
|
|
1408
|
+
(q) => !(b != null && b.timeWindow) && !R.some((j) => K(j, q))
|
|
1409
|
+
);
|
|
1410
|
+
(!L.length || L.some((q) => !O.some((j) => K(q, j)))) && C.push("timeWindow"), O = O.filter((q) => !L.some((j) => K(j, q)));
|
|
1411
|
+
} else E ? Object.keys(E).filter((q) => !(q === "kind" && E.kind === "relative" && (V == null ? void 0 : V.kind) === void 0)).some((q) => !Le(E[q], V == null ? void 0 : V[q])) && C.push("timeWindow") : V && C.push("timeWindow");
|
|
1412
|
+
(R.length !== O.length || R.some((L, q) => !K(L, O[q]))) && C.push("filters");
|
|
1413
|
+
}
|
|
1414
|
+
if (d.orderBy !== void 0) {
|
|
1415
|
+
const R = d.orderBy, O = (D = (k = e.config) == null ? void 0 : k.sortByColumns) == null ? void 0 : D[0], E = O && ta(e.config ?? {}, O), V = R.field && typeof R.field == "object" ? R.field.aggregate : void 0;
|
|
1416
|
+
(!O || !E || O.direction !== R.direction || p(R.field) !== aa(E.name, sa(E)) || V !== void 0 && ht(E) !== V) && C.push("orderBy");
|
|
1417
|
+
}
|
|
1418
|
+
return d.limit !== void 0 && ((N = e.config) == null ? void 0 : N.rowLimit) !== d.limit && C.push("limit"), C;
|
|
1419
|
+
}
|
|
1420
|
+
class ue extends Error {
|
|
1421
|
+
}
|
|
1422
|
+
const Pe = (e) => (e ?? "").trim().toLowerCase(), xe = ua, mt = { measures: ma, records: pa, sql: fa }, Se = {
|
|
1423
|
+
measures: "a measures query (measures, with optional dimensions)",
|
|
1424
|
+
records: "a records query (columns)",
|
|
1425
|
+
sql: "a SQL query"
|
|
1426
|
+
};
|
|
1427
|
+
function Et(e, t) {
|
|
1428
|
+
return t.path.reduce((a, s) => typeof s == "number" ? `${a}[${s}]` : `${a}.${s}`, e);
|
|
1429
|
+
}
|
|
1430
|
+
async function mi(e, t, a) {
|
|
1431
|
+
var Qe, Ke, He, We, Ye, Xe, Je, Ze, et;
|
|
1432
|
+
const s = [], r = [], n = [], i = [], d = /* @__PURE__ */ new Set(), u = [], b = /* @__PURE__ */ new Map(), y = { calendar: a.calendar }, C = a.relationshipReach ? { relationshipReach: a.relationshipReach } : {};
|
|
1433
|
+
let p = e, $ = 0;
|
|
1434
|
+
if (t.length > ot)
|
|
1435
|
+
return {
|
|
1436
|
+
ok: !1,
|
|
1437
|
+
problems: [
|
|
1438
|
+
{
|
|
1439
|
+
code: "too_many_changes",
|
|
1440
|
+
message: `A proposal takes at most ${ot} changes; this one has ${t.length}.`,
|
|
1441
|
+
path: "changes",
|
|
1442
|
+
fix: "Split the changes into several proposals."
|
|
1443
|
+
}
|
|
1444
|
+
]
|
|
1445
|
+
};
|
|
1446
|
+
const _ = [];
|
|
1447
|
+
if (t.forEach((f, o) => {
|
|
1448
|
+
const l = ia.safeParse(f);
|
|
1449
|
+
if (l.success) {
|
|
1450
|
+
_.push(l.data);
|
|
1451
|
+
return;
|
|
1452
|
+
}
|
|
1453
|
+
for (const h of l.error.issues)
|
|
1454
|
+
s.push({
|
|
1455
|
+
code: "invalid_change",
|
|
1456
|
+
message: h.message,
|
|
1457
|
+
path: Et(`changes[${o}]`, h),
|
|
1458
|
+
fix: "Send the change in the shape the tool schema gives."
|
|
1459
|
+
});
|
|
1460
|
+
}), s.length) return { ok: !1, problems: s };
|
|
1461
|
+
const g = (f) => {
|
|
1462
|
+
throw s.push(f), new ue();
|
|
1463
|
+
}, A = (f) => {
|
|
1464
|
+
a.capabilities.sql || g({
|
|
1465
|
+
code: "capability_required",
|
|
1466
|
+
message: "This change creates, reads or changes a SQL card, which needs SQL access.",
|
|
1467
|
+
path: f,
|
|
1468
|
+
fix: "Use a measures or records query, or ask an administrator for SQL access."
|
|
1469
|
+
}), d.add("sql");
|
|
1470
|
+
}, c = (f, o) => {
|
|
1471
|
+
const l = nt(p, [f], y);
|
|
1472
|
+
l.ok ? (p = l.dashboard, n.push(f)) : g({ code: "invalid_change", message: l.failedAt.message, path: o, ...l.failedAt.fix ? { fix: l.failedAt.fix } : {} });
|
|
1473
|
+
}, m = (f, o) => {
|
|
1474
|
+
if (f.startsWith("$")) {
|
|
1475
|
+
const l = b.get(f);
|
|
1476
|
+
return (!l || l.kind !== "card") && g({
|
|
1477
|
+
code: "handle_unknown",
|
|
1478
|
+
message: `${f} isn't a card handle defined earlier in this list.`,
|
|
1479
|
+
path: o,
|
|
1480
|
+
fix: "Define the handle with an earlier card.add, or use the card id from the outline."
|
|
1481
|
+
}), l.id;
|
|
1482
|
+
}
|
|
1483
|
+
return re(p).some((l) => l.cardId === f) || g({
|
|
1484
|
+
code: "card_not_found",
|
|
1485
|
+
message: `There's no card ${f} on this dashboard.`,
|
|
1486
|
+
path: o,
|
|
1487
|
+
fix: "Read the outline again and use its card ids."
|
|
1488
|
+
}), f;
|
|
1489
|
+
}, F = (f, o) => {
|
|
1490
|
+
if (f.startsWith("$")) {
|
|
1491
|
+
const h = b.get(f);
|
|
1492
|
+
return (!h || h.kind !== "filter") && g({
|
|
1493
|
+
code: "handle_unknown",
|
|
1494
|
+
message: `${f} isn't a filter handle defined earlier in this list.`,
|
|
1495
|
+
path: o,
|
|
1496
|
+
fix: "Define the handle with an earlier filter.add, or use the filter id from the outline."
|
|
1497
|
+
}), h.id;
|
|
1498
|
+
}
|
|
1499
|
+
return (Array.isArray(p.inputs) ? p.inputs : []).some((h) => h.id === f && h.kind === "filter") || g({
|
|
1500
|
+
code: "filter_not_found",
|
|
1501
|
+
message: `There's no filter ${f} on this dashboard.`,
|
|
1502
|
+
path: o,
|
|
1503
|
+
fix: "Read the outline again and use its filter ids."
|
|
1504
|
+
}), f;
|
|
1505
|
+
}, k = () => (p.sheets ?? []).filter((f) => !ct(f)), D = () => k().map((f) => ({ sheetId: f.id, title: f.title ?? "" })), N = (f, o) => {
|
|
1506
|
+
const l = (p.sheets ?? []).find((h) => h.id === f);
|
|
1507
|
+
return l || g({ code: "sheet_not_found", message: `There's no sheet ${f} on this dashboard.`, path: o, fix: "Read the outline again and use its sheet ids.", details: { sheets: D() } }), ct(l) && g({ code: "sheet_not_a_grid", message: `"${l.title}" is a Document sheet.`, path: o, fix: "Add the card to a grid sheet; Document sheets are changed in the editor.", details: { sheets: D() } }), l;
|
|
1508
|
+
}, R = (f, o, l, h) => {
|
|
1509
|
+
var T;
|
|
1510
|
+
for (const w of ga(o, l)) g({ ...w, path: `${h}.${w.path}` });
|
|
1511
|
+
const I = ce[f], v = xe(o), S = o.dateField;
|
|
1512
|
+
if (S && typeof S != "string" && S.label && !o.timeGrain && g({
|
|
1513
|
+
code: "invalid_change",
|
|
1514
|
+
message: "A label names a column, and the date field is a column only when the card groups by it.",
|
|
1515
|
+
path: `${h}.query.dateField.label`,
|
|
1516
|
+
fix: "Send timeGrain to group by the date, or leave the label out."
|
|
1517
|
+
}), !I.forms.includes(v)) {
|
|
1518
|
+
const w = Object.keys(ce).filter((x) => ce[x].forms.includes(v));
|
|
1519
|
+
g({
|
|
1520
|
+
code: "type_not_supported",
|
|
1521
|
+
message: `A ${f.replace(/_/g, " ")} card takes ${I.forms.map((x) => Se[x]).join(" or ")}, not ${Se[v]}.`,
|
|
1522
|
+
path: `${h}.query`,
|
|
1523
|
+
fix: `Send ${I.forms.map((x) => Se[x]).join(" or ")}, or use a type this query fits: ${w.join(", ")}.`
|
|
1524
|
+
});
|
|
1525
|
+
}
|
|
1526
|
+
if (v === "measures") {
|
|
1527
|
+
const w = o, x = w.measures.length;
|
|
1528
|
+
I.measures && (x < I.measures.min || I.measures.max !== void 0 && x > I.measures.max) && g({
|
|
1529
|
+
code: "type_not_supported",
|
|
1530
|
+
message: `A ${f.replace(/_/g, " ")} card shows exactly ${I.measures.max} measure.`,
|
|
1531
|
+
path: `${h}.query.measures`,
|
|
1532
|
+
fix: "Send one measure, or use a table or chart for several."
|
|
1533
|
+
}), !I.dimensions && ((T = w.dimensions) != null && T.length) && g({
|
|
1534
|
+
code: "type_not_supported",
|
|
1535
|
+
message: `A ${f.replace(/_/g, " ")} card shows one number, so it has no dimensions.`,
|
|
1536
|
+
path: `${h}.query.dimensions`,
|
|
1537
|
+
fix: "Remove the dimensions, or use a table or chart."
|
|
1538
|
+
}), f === "matrix" && (w.orderBy || w.limit) && g({
|
|
1539
|
+
code: "type_not_supported",
|
|
1540
|
+
message: "A Matrix's sorting and top N are set in the editor.",
|
|
1541
|
+
path: `${h}.query`,
|
|
1542
|
+
fix: "Leave out orderBy and limit for a Matrix."
|
|
1543
|
+
});
|
|
1544
|
+
}
|
|
1545
|
+
if (I.matrixColumns && !l && g({
|
|
1546
|
+
code: "type_not_supported",
|
|
1547
|
+
message: "A Matrix needs matrix.columns: the query fields that run across the top.",
|
|
1548
|
+
path: `${h}.matrix`,
|
|
1549
|
+
fix: "Send matrix: { columns: [...] } naming dimensions or the date field of the query (an empty list puts nothing across the top)."
|
|
1550
|
+
}), !I.matrixColumns && l && g({ code: "type_not_supported", message: "matrix.columns is only for Matrix cards.", path: `${h}.matrix`, fix: 'Leave out matrix, or use type "matrix".' }), l && v === "measures") {
|
|
1551
|
+
const w = o, x = w.datasetName, G = [...w.dimensions ?? [], ...w.timeGrain && w.dateField ? [w.dateField] : []];
|
|
1552
|
+
G.length && l.columns.length >= G.length && G.every((P) => l.columns.some((B) => ne(B, x) === ne(P, x))) && g({
|
|
1553
|
+
code: "type_not_supported",
|
|
1554
|
+
message: "A Matrix needs at least one field down the side.",
|
|
1555
|
+
path: `${h}.matrix.columns`,
|
|
1556
|
+
fix: "Leave one dimension or the date field out of matrix.columns."
|
|
1557
|
+
});
|
|
1558
|
+
const Q = new Set([...w.dimensions ?? [], ...w.dateField ? [w.dateField] : []].map((P) => ne(P, x)));
|
|
1559
|
+
l.columns.forEach((P, B) => {
|
|
1560
|
+
Q.has(ne(P, x)) || g({
|
|
1561
|
+
code: "type_not_supported",
|
|
1562
|
+
message: `"${ut(P)}" isn't one of the query's dimensions or its date field.`,
|
|
1563
|
+
path: `${h}.matrix.columns[${B}]`,
|
|
1564
|
+
fix: "Name dimensions or the date field of the query in matrix.columns."
|
|
1565
|
+
});
|
|
1566
|
+
});
|
|
1567
|
+
}
|
|
1568
|
+
}, O = (f, o) => g({
|
|
1569
|
+
code: f.code === "query_not_kept" ? "card_not_editable" : "invalid_change",
|
|
1570
|
+
message: f.message,
|
|
1571
|
+
path: `${o}.query`,
|
|
1572
|
+
fix: f.code === "query_not_kept" ? "Tell the user to make this change in the editor." : "Read the outline again and propose again.",
|
|
1573
|
+
details: { reason: "not_expressible", ..."parts" in f ? { parts: f.parts } : {} }
|
|
1574
|
+
}), E = (f, o, l, h, I, v, S) => {
|
|
1575
|
+
const T = Rs(f, o, l, v, S);
|
|
1576
|
+
T.length && g({
|
|
1577
|
+
code: "card_not_editable",
|
|
1578
|
+
message: `As changed, "${I}" wouldn't run the query asked for, so make this change in the editor.`,
|
|
1579
|
+
path: `${h}.query`,
|
|
1580
|
+
fix: "Tell the user to make this change in the editor.",
|
|
1581
|
+
details: { reason: "not_expressible", detail: `doesn't hold: ${T.join(", ")}` }
|
|
1582
|
+
});
|
|
1583
|
+
}, V = async (f, o, l, h) => {
|
|
1584
|
+
const I = rt(f);
|
|
1585
|
+
if ("sql" in o)
|
|
1586
|
+
return A(`${h}.query`), { type: I, source: { kind: "sql", connectionId: o.connectionId, sql: o.sql } };
|
|
1587
|
+
const v = I === "matrixTable" || I === "detailTable" ? "table" : I, S = await a.compileCardQuery({ query: o, chartType: v });
|
|
1588
|
+
if (!S.ok)
|
|
1589
|
+
throw s.push(...S.problems.map((x) => ({ ...x, path: x.path ? `${h}.query.${x.path}` : `${h}.query` }))), new ue();
|
|
1590
|
+
r.push(...S.warnings.map((x) => ({ ...x, path: x.path ?? `${h}.query` })));
|
|
1591
|
+
let T = { ...S.part, type: I };
|
|
1592
|
+
const w = T.config ?? {};
|
|
1593
|
+
if (I === "detailTable") {
|
|
1594
|
+
const x = ba(Ia("table", "detailTable", w)) ?? {};
|
|
1595
|
+
T = { ...T, config: Os(x) };
|
|
1596
|
+
}
|
|
1597
|
+
return I === "matrixTable" && (T = await K(T, w, o, l, h)), Ns(T, Ee(o));
|
|
1598
|
+
}, K = async (f, o, l, h, I) => {
|
|
1599
|
+
var Q;
|
|
1600
|
+
const v = await a.loadCardSource({ domainId: l.domainId, datasetName: l.datasetName });
|
|
1601
|
+
if (v || g({ code: "field_not_found", message: `The dataset "${l.datasetName}" isn't available.`, path: `${I}.query.datasetName`, fix: "Find datasets with semaphor_list_datasets." }), f.source.kind !== "semantic") throw new ue();
|
|
1602
|
+
const S = { id: "scratch", title: "", type: "table", dataSource: f.source.dataSource, config: o }, T = Ca(S, "matrixTable", { catalog: v.fields, createId: a.newId }), w = T.status === "changed" ? (Q = T.card.config) == null ? void 0 : Q.matrix : void 0;
|
|
1603
|
+
(T.status !== "changed" || T.leftOut.length || !w) && g({
|
|
1604
|
+
code: "type_not_supported",
|
|
1605
|
+
message: T.status === "changed" && T.leftOut.length ? `These fields can't run in a Matrix: ${T.leftOut.join(", ")}.` : "This query can't be shown as a Matrix.",
|
|
1606
|
+
path: `${I}.query`,
|
|
1607
|
+
fix: "Use plain dataset fields for a Matrix, or use a table."
|
|
1608
|
+
});
|
|
1609
|
+
let x = w;
|
|
1610
|
+
const G = l.datasetName;
|
|
1611
|
+
for (const [P, B] of h.columns.entries()) {
|
|
1612
|
+
const U = [...x.spec.rows, ...x.spec.columns].find(
|
|
1613
|
+
(z) => Sa(z.field) === ne(B, G)
|
|
1614
|
+
);
|
|
1615
|
+
U || g({ code: "type_not_supported", message: `"${ut(B)}" isn't a level of this Matrix.`, path: `${I}.matrix.columns[${P}]`, fix: "Name dimensions or the date field of the query in matrix.columns." }), x = va(x, wa(x.spec, U.id, "columns")).config;
|
|
1616
|
+
}
|
|
1617
|
+
return { ...f, config: { matrix: x } };
|
|
1618
|
+
}, L = /* @__PURE__ */ new Map(), q = /* @__PURE__ */ new Map();
|
|
1619
|
+
for (const [f, o] of _.entries()) {
|
|
1620
|
+
const l = `changes[${f}]`;
|
|
1621
|
+
try {
|
|
1622
|
+
switch (o.op) {
|
|
1623
|
+
case "card.add": {
|
|
1624
|
+
const h = o.position && typeof o.position == "object" ? (() => {
|
|
1625
|
+
const B = m(o.position.after, `${l}.position.after`), U = re(p).find(
|
|
1626
|
+
(z) => z.cardId === B && z.kind === "frameCard"
|
|
1627
|
+
);
|
|
1628
|
+
return !U || U.kind !== "frameCard" ? g({
|
|
1629
|
+
code: "card_not_found",
|
|
1630
|
+
message: `${o.position.after} isn't a card on a grid sheet.`,
|
|
1631
|
+
path: `${l}.position.after`,
|
|
1632
|
+
fix: "Use a cardId from semaphor_get_dashboard_details on the same sheet, or a handle from this proposal."
|
|
1633
|
+
}) : (o.sheetId && o.sheetId !== U.sheetId && g({
|
|
1634
|
+
code: "invalid_change",
|
|
1635
|
+
message: `position.after names a card on another sheet than ${o.sheetId}.`,
|
|
1636
|
+
path: `${l}.position.after`,
|
|
1637
|
+
fix: "Leave out sheetId, or name the card's sheet."
|
|
1638
|
+
}), { sheetId: U.sheetId, frameId: U.frameId });
|
|
1639
|
+
})() : void 0, I = h ? N(h.sheetId, `${l}.position.after`) : o.sheetId ? N(o.sheetId, `${l}.sheetId`) : (() => {
|
|
1640
|
+
const B = k();
|
|
1641
|
+
return B.length !== 1 && g({
|
|
1642
|
+
code: B.length ? "sheet_required" : "sheet_not_a_grid",
|
|
1643
|
+
message: B.length ? "This dashboard has several grid sheets; say which one gets the card." : "This dashboard has no grid sheet to add a card to.",
|
|
1644
|
+
path: `${l}.sheetId`,
|
|
1645
|
+
fix: B.length ? "Send sheetId: one of details.sheets." : "Add a grid sheet in the editor first.",
|
|
1646
|
+
details: { sheets: D() }
|
|
1647
|
+
}), B[0];
|
|
1648
|
+
})();
|
|
1649
|
+
R(o.type, o.query, o.matrix, l);
|
|
1650
|
+
const v = await V(o.type, o.query, o.matrix, l), S = {
|
|
1651
|
+
...Pt({ id: a.newId(), title: o.title, ...o.description ? { description: o.description } : {} }),
|
|
1652
|
+
type: v.type
|
|
1653
|
+
}, T = lt(S, v);
|
|
1654
|
+
T.ok || g({ code: "invalid_change", message: T.message, path: l });
|
|
1655
|
+
const w = T.ok ? T.card : S;
|
|
1656
|
+
E(w, o.query, o.matrix, l, o.title, v);
|
|
1657
|
+
const x = { id: a.newId(), cards: [w], activeCardId: w.id }, G = h ? { after: h.frameId } : typeof o.position == "string" ? o.position : void 0, Q = G || o.width ? { ...G ? { position: G } : {}, ...o.width ? { width: o.width } : {} } : void 0;
|
|
1658
|
+
c({ op: "card.add", sheetId: I.id, frame: x, ...Q ? { placement: Q } : {}, changeIndex: f }, l);
|
|
1659
|
+
const P = o.handle ?? `$card_${++$}`;
|
|
1660
|
+
b.has(P) && g({ code: "invalid_change", message: `The handle ${P} is defined twice.`, path: `${l}.handle`, fix: "Give each new card or filter its own handle." }), b.set(P, { kind: "card", id: w.id, title: o.title }), i.push({ ref: P, kind: "card", id: w.id, title: o.title, changeIndex: f }), u.push(w.id);
|
|
1661
|
+
break;
|
|
1662
|
+
}
|
|
1663
|
+
case "card.update": {
|
|
1664
|
+
const h = m(o.cardId, `${l}.cardId`), I = ie(p, h);
|
|
1665
|
+
I || g({ code: "card_not_editable", message: "Cards in Document sections are changed in the editor.", path: `${l}.cardId`, fix: "Tell the user to change it in the editor.", details: { reason: "document_section" } });
|
|
1666
|
+
const v = I.card, S = oe(v, { sql: !0 });
|
|
1667
|
+
((Qe = S.source) == null ? void 0 : Qe.kind) === "sql" && A(`${l}.cardId`), S.editable || g({
|
|
1668
|
+
code: "card_not_editable",
|
|
1669
|
+
message: S.message,
|
|
1670
|
+
path: `${l}.cardId`,
|
|
1671
|
+
fix: S.reason === "needs_sql_access" ? "Ask for SQL access." : "Tell the user to change it in the editor.",
|
|
1672
|
+
details: { reason: S.reason, ...S.detail ? { detail: S.detail } : {} }
|
|
1673
|
+
}), I.frame.visualId && r.push({
|
|
1674
|
+
code: "detaches_linked_visual",
|
|
1675
|
+
message: `"${v.title}" will stop following its library visual and become local to this dashboard.`,
|
|
1676
|
+
path: l,
|
|
1677
|
+
details: { cardIds: [h] }
|
|
1678
|
+
});
|
|
1679
|
+
let T = !1;
|
|
1680
|
+
const w = o.type ? rt(o.type) : void 0;
|
|
1681
|
+
if (w && w !== v.type) {
|
|
1682
|
+
const x = S.editable ? S.source : void 0, G = oa(v, w), Q = G && x && x.kind === "semantic" ? (Ke = await a.loadCardSource({ domainId: x.domainId, datasetName: x.datasetName })) == null ? void 0 : Ke.fields : void 0, P = [], B = ra(v, w, {
|
|
1683
|
+
...Q ? { catalog: Q } : {},
|
|
1684
|
+
...G && !Q ? { catalogLoading: !0 } : {},
|
|
1685
|
+
createId: () => {
|
|
1686
|
+
const U = a.newId();
|
|
1687
|
+
return P.push(U), U;
|
|
1688
|
+
}
|
|
1689
|
+
});
|
|
1690
|
+
if (B.status === "refused" && g({ code: "type_not_supported", message: "The card's dataset fields couldn't be loaded for a change to or from a Matrix.", path: `${l}.type`, fix: "Send a complete query with the type change." }), B.status === "changed") {
|
|
1691
|
+
const U = [...B.leftOut, ...B.droppedPreferences];
|
|
1692
|
+
U.length && r.push({
|
|
1693
|
+
code: "type_change_drops",
|
|
1694
|
+
message: `Changing "${v.title}" to ${o.type.replace(/_/g, " ")} leaves out ${U.join(", ")}.`,
|
|
1695
|
+
path: `${l}.type`,
|
|
1696
|
+
details: { dropped: U }
|
|
1697
|
+
}), c(
|
|
1698
|
+
{ op: "card.update", cardId: h, update: { kind: "retype", type: w, ...Q ? { catalog: Q } : {}, newIds: P }, changeIndex: f },
|
|
1699
|
+
`${l}.type`
|
|
1700
|
+
), T = !0;
|
|
1701
|
+
}
|
|
1702
|
+
}
|
|
1703
|
+
if (o.query || o.matrix) {
|
|
1704
|
+
const x = ie(p, h).card, G = oe(x, { sql: !0 }), Q = G.editable ? G.query : void 0, P = Ms(Q, o.query ?? {}, `${l}.query`, g), B = Oe(x.type), U = o.matrix ?? (G.editable ? G.matrix : void 0);
|
|
1705
|
+
R(B, P, U, l);
|
|
1706
|
+
const z = G.editable ? da(G.query, P, G.matrix, U) : void 0, tt = !z || z.aspects.length > 0, le = z && !("sql" in P) ? Ee(P).filter((X) => !dt(z, X.key.role)) : [], at = la(x, z, le.map((X) => X.key.role));
|
|
1707
|
+
at && O(at, l);
|
|
1708
|
+
let Te = P;
|
|
1709
|
+
if (z && !("sql" in P) && P.orderBy && !z.aspects.includes("order") && ["metric", "group_by", "detail"].some((X) => dt(z, X))) {
|
|
1710
|
+
const { orderBy: X, ...be } = P;
|
|
1711
|
+
Te = be;
|
|
1712
|
+
}
|
|
1713
|
+
let st;
|
|
1714
|
+
if (tt) {
|
|
1715
|
+
const X = await V(B, Te, U, l);
|
|
1716
|
+
st = X;
|
|
1717
|
+
const be = z ? { ...X, change: z } : X, ee = lt(x, be);
|
|
1718
|
+
if (ee.ok || O(ee, l), ee.ok && ee.droppedBindings.length && r.push({
|
|
1719
|
+
code: "control_binding_dropped",
|
|
1720
|
+
message: `"${x.title}" loses the controls bound to the levels or measures this change removes; they stop changing this card.`,
|
|
1721
|
+
path: `${l}.query`,
|
|
1722
|
+
fix: "Keep those fields in the query, or tell the user the controls no longer apply to this card.",
|
|
1723
|
+
details: { controlIds: ee.droppedBindings }
|
|
1724
|
+
}), ee.ok)
|
|
1725
|
+
for (const Ie of ee.keptLabels)
|
|
1726
|
+
r.push({
|
|
1727
|
+
code: "label_kept_after_change",
|
|
1728
|
+
message: `"${x.title}" keeps the label "${Ie.label}" on ${Ie.field}, whose aggregate or time grain changed.`,
|
|
1729
|
+
path: `${l}.query`,
|
|
1730
|
+
fix: "State a new label on the field ref if the old one no longer fits.",
|
|
1731
|
+
details: { columns: [{ label: Ie.label, field: Ie.field }] }
|
|
1732
|
+
});
|
|
1733
|
+
c({ op: "card.update", cardId: h, update: { kind: "requery", query: be }, changeIndex: f }, `${l}.query`), T = !0;
|
|
1734
|
+
}
|
|
1735
|
+
le.length && ca(ie(p, h).card, le).changed.length && c({ op: "card.update", cardId: h, update: { kind: "relabel", labels: le }, changeIndex: f }, `${l}.query`), (tt || le.length) && E(ie(p, h).card, Te, U, l, x.title ?? "", st, z);
|
|
1736
|
+
}
|
|
1737
|
+
(o.title !== void 0 || o.description !== void 0) && c(
|
|
1738
|
+
{
|
|
1739
|
+
op: "card.update",
|
|
1740
|
+
cardId: h,
|
|
1741
|
+
update: {
|
|
1742
|
+
kind: "rename",
|
|
1743
|
+
...o.title !== void 0 ? { title: o.title } : {},
|
|
1744
|
+
...o.description !== void 0 ? { description: o.description } : {}
|
|
1745
|
+
},
|
|
1746
|
+
changeIndex: f
|
|
1747
|
+
},
|
|
1748
|
+
l
|
|
1749
|
+
), T && !u.includes(h) && u.push(h), i.push({ ref: o.cardId, kind: "card", id: h, title: v.title ?? "", changeIndex: f });
|
|
1750
|
+
break;
|
|
1751
|
+
}
|
|
1752
|
+
case "card.remove": {
|
|
1753
|
+
const h = m(o.cardId, `${l}.cardId`), I = ie(p, h);
|
|
1754
|
+
I || g({ code: "card_not_editable", message: "Cards in Document sections are removed in the editor.", path: `${l}.cardId`, fix: "Tell the user to remove it in the editor.", details: { reason: "document_section" } }), I.frame.cards.some((S) => {
|
|
1755
|
+
var T, w;
|
|
1756
|
+
return ((T = S.customCardPreferences) == null ? void 0 : T.visualType) === "multiple" || !!((w = S.customCardPreferences) != null && w.dataInputCardIds);
|
|
1757
|
+
}) && I.frame.cards.length > 1 && g({ code: "card_not_editable", message: "This card is an input of a custom visual; remove it in the editor.", path: `${l}.cardId`, fix: "Tell the user to remove it in the editor.", details: { reason: "custom" } }), I.frame.visualId && I.frame.cards.length > 1 && r.push({
|
|
1758
|
+
code: "detaches_linked_visual",
|
|
1759
|
+
message: `Removing "${I.card.title}" makes the rest of its tile local to this dashboard; it stops following its library visual.`,
|
|
1760
|
+
path: l,
|
|
1761
|
+
details: { cardIds: I.frame.cards.filter((S) => S.id !== h).map((S) => S.id) }
|
|
1762
|
+
}), c({ op: "card.remove", cardId: h, changeIndex: f }, l), i.push({ ref: o.cardId, kind: "card", id: h, title: I.card.title ?? "", changeIndex: f });
|
|
1763
|
+
break;
|
|
1764
|
+
}
|
|
1765
|
+
case "filter.add": {
|
|
1766
|
+
const h = await a.loadCardSource({ domainId: o.domainId, datasetName: o.datasetName });
|
|
1767
|
+
h || g({ code: "field_not_found", message: `The dataset "${o.datasetName}" isn't available in this domain.`, path: `${l}.datasetName`, fix: "Find datasets with semaphor_list_datasets." });
|
|
1768
|
+
const I = _t(h.fields, o.field, o.datasetName);
|
|
1769
|
+
I || g({
|
|
1770
|
+
code: "field_not_found",
|
|
1771
|
+
message: `"${o.field}" isn't a field of ${o.datasetName}.`,
|
|
1772
|
+
path: `${l}.field`,
|
|
1773
|
+
fix: "Use one of details.available, or read semaphor_get_dataset_schema.",
|
|
1774
|
+
details: { available: h.fields.slice(0, 20).map((x) => x.name) }
|
|
1775
|
+
});
|
|
1776
|
+
const v = gt(o.sheetIds, l, N), S = qt({
|
|
1777
|
+
field: I,
|
|
1778
|
+
dataSource: h.dataSource,
|
|
1779
|
+
connectionId: h.connectionId,
|
|
1780
|
+
connectionType: h.connectionType,
|
|
1781
|
+
scope: v,
|
|
1782
|
+
existingInputs: Array.isArray(p.inputs) ? p.inputs : [],
|
|
1783
|
+
createId: a.newId,
|
|
1784
|
+
label: o.label
|
|
1785
|
+
}), T = { ...S.filter };
|
|
1786
|
+
T.dateSelectionMode || (T.type = o.selection ?? "multiple"), o.defaultValues && (T.defaultValues = o.defaultValues), o.defaultPeriod && (T.defaultDateFilter = bt(o.defaultPeriod, I, `${l}.defaultPeriod`, g)), c({ op: "filter.add", input: { ...S, filter: T }, changeIndex: f }, l), L.set(S.id, { sheetIds: o.sheetIds ?? "all", changeIndex: f }), (o.defaultValues !== void 0 || o.defaultPeriod !== void 0) && q.set(S.id, { values: o.defaultValues, period: o.defaultPeriod, changeIndex: f });
|
|
1787
|
+
const w = o.handle;
|
|
1788
|
+
w && (b.has(w) && g({ code: "invalid_change", message: `The handle ${w} is defined twice.`, path: `${l}.handle`, fix: "Give each new card or filter its own handle." }), b.set(w, { kind: "filter", id: S.id, title: o.label })), i.push({ ref: w ?? S.id, kind: "filter", id: S.id, title: o.label, changeIndex: f });
|
|
1789
|
+
break;
|
|
1790
|
+
}
|
|
1791
|
+
case "filter.update": {
|
|
1792
|
+
const h = F(o.filterId, `${l}.filterId`), I = pe(p, h, void 0, C);
|
|
1793
|
+
I != null && I.editable || g({
|
|
1794
|
+
code: "filter_not_editable",
|
|
1795
|
+
message: I && !I.editable ? I.notEditable.message : "This filter can't be changed through the MCP.",
|
|
1796
|
+
path: `${l}.filterId`,
|
|
1797
|
+
fix: "Tell the user to change it in the editor; removing or excluding it works."
|
|
1798
|
+
});
|
|
1799
|
+
const v = (p.inputs ?? []).find((x) => x.id === h);
|
|
1800
|
+
if ((v == null ? void 0 : v.kind) !== "filter" || !v.filter) throw new ue();
|
|
1801
|
+
const S = { ...v.filter };
|
|
1802
|
+
let T = !1;
|
|
1803
|
+
o.selection && (S.type = o.selection), o.defaultValues !== void 0 && (T = !0, o.defaultValues === null ? delete S.defaultValues : S.defaultValues = o.defaultValues), o.defaultPeriod !== void 0 && (T = !0, o.defaultPeriod === null ? delete S.defaultDateFilter : S.defaultDateFilter = bt(
|
|
1804
|
+
o.defaultPeriod,
|
|
1805
|
+
{ dataType: S.dataType },
|
|
1806
|
+
`${l}.defaultPeriod`,
|
|
1807
|
+
g
|
|
1808
|
+
));
|
|
1809
|
+
const w = {
|
|
1810
|
+
...o.label !== void 0 ? { label: o.label } : {},
|
|
1811
|
+
...o.selection !== void 0 || T ? { definition: S } : {},
|
|
1812
|
+
// A change of sheets states the sheets; what else the scope says (the cards it leaves out,
|
|
1813
|
+
// whether it covers Document sheets) stays.
|
|
1814
|
+
...o.sheetIds !== void 0 ? { scope: na(
|
|
1815
|
+
v.scope,
|
|
1816
|
+
gt(o.sheetIds ?? void 0, l, N),
|
|
1817
|
+
new Set([...Me(p).values()].filter((x) => x.sheetKind === "document").map((x) => x.sheetId))
|
|
1818
|
+
) } : {},
|
|
1819
|
+
...T ? { values: { defaultChanged: !0, target: {} } } : {}
|
|
1820
|
+
};
|
|
1821
|
+
c({ op: "filter.update", filterId: h, settings: w, changeIndex: f }, l), o.sheetIds !== void 0 && L.set(h, { sheetIds: o.sheetIds ?? "all", changeIndex: f }), T && q.set(h, { values: o.defaultValues, period: o.defaultPeriod, changeIndex: f }), i.push({ ref: o.filterId, kind: "filter", id: h, title: v.label, changeIndex: f });
|
|
1822
|
+
break;
|
|
1823
|
+
}
|
|
1824
|
+
case "filter.remove": {
|
|
1825
|
+
const h = F(o.filterId, `${l}.filterId`), I = ((He = (p.inputs ?? []).find((v) => v.id === h)) == null ? void 0 : He.label) ?? "";
|
|
1826
|
+
c({ op: "filter.remove", filterId: h, changeIndex: f }, l), i.push({ ref: o.filterId, kind: "filter", id: h, title: I, changeIndex: f });
|
|
1827
|
+
break;
|
|
1828
|
+
}
|
|
1829
|
+
case "filter.bind": {
|
|
1830
|
+
const h = F(o.filterId, `${l}.filterId`), I = pe(p, h, void 0, C);
|
|
1831
|
+
I != null && I.editable || g({
|
|
1832
|
+
code: "filter_not_editable",
|
|
1833
|
+
message: I && !I.editable ? I.notEditable.message : "This filter can't be changed through the MCP.",
|
|
1834
|
+
path: `${l}.filterId`,
|
|
1835
|
+
fix: "Tell the user to change it in the editor; removing or excluding it works."
|
|
1836
|
+
});
|
|
1837
|
+
const v = m(o.cardId, `${l}.cardId`), S = re(p).find((w) => w.cardId === v).card, T = await Ls(S, o.field, a, `${l}.field`, g);
|
|
1838
|
+
c({ op: "filter.bind", filterId: h, cardId: v, binding: { kind: "bound", cardId: v, bindingId: a.newId(), target: T }, changeIndex: f }, l), i.push({ ref: o.filterId, kind: "filter", id: h, title: I.label, changeIndex: f });
|
|
1839
|
+
break;
|
|
1840
|
+
}
|
|
1841
|
+
case "layout.arrange": {
|
|
1842
|
+
const h = o.sheetId ? N(o.sheetId, `${l}.sheetId`) : (() => {
|
|
1843
|
+
const I = k();
|
|
1844
|
+
return I.length !== 1 && g({
|
|
1845
|
+
code: I.length ? "sheet_required" : "sheet_not_a_grid",
|
|
1846
|
+
message: I.length ? "This dashboard has several grid sheets; say which one to arrange." : "This dashboard has no grid sheet to arrange.",
|
|
1847
|
+
path: `${l}.sheetId`,
|
|
1848
|
+
fix: I.length ? "Send sheetId: one of details.sheets." : "Add a grid sheet in the editor first.",
|
|
1849
|
+
details: { sheets: D() }
|
|
1850
|
+
}), I[0];
|
|
1851
|
+
})();
|
|
1852
|
+
c({ op: "layout.arrange", sheetId: h.id, ...o.keepOrder ? { keepOrder: !0 } : {}, changeIndex: f }, l);
|
|
1853
|
+
break;
|
|
1854
|
+
}
|
|
1855
|
+
case "filter.exclude": {
|
|
1856
|
+
const h = F(o.filterId, `${l}.filterId`), I = m(o.cardId, `${l}.cardId`), v = ((We = (p.inputs ?? []).find((S) => S.id === h)) == null ? void 0 : We.label) ?? "";
|
|
1857
|
+
c({ op: "filter.exclude", filterId: h, cardId: I, changeIndex: f }, l), i.push({ ref: o.filterId, kind: "filter", id: h, title: v, changeIndex: f });
|
|
1858
|
+
break;
|
|
1859
|
+
}
|
|
1860
|
+
}
|
|
1861
|
+
} catch (h) {
|
|
1862
|
+
if (!(h instanceof ue)) throw h;
|
|
1863
|
+
}
|
|
1864
|
+
}
|
|
1865
|
+
if (s.length) return { ok: !1, problems: s };
|
|
1866
|
+
const j = nt(e, n, y);
|
|
1867
|
+
if (!j.ok)
|
|
1868
|
+
return {
|
|
1869
|
+
ok: !1,
|
|
1870
|
+
problems: [
|
|
1871
|
+
{
|
|
1872
|
+
code: "invalid_change",
|
|
1873
|
+
message: j.failedAt.message,
|
|
1874
|
+
path: `changes[${((Ye = n[j.failedAt.index]) == null ? void 0 : Ye.changeIndex) ?? 0}]`,
|
|
1875
|
+
fix: "Read the outline again and propose again."
|
|
1876
|
+
}
|
|
1877
|
+
]
|
|
1878
|
+
};
|
|
1879
|
+
for (const f of u) {
|
|
1880
|
+
const o = ie(j.dashboard, f);
|
|
1881
|
+
if (!o) continue;
|
|
1882
|
+
const l = ((Xe = n.find((S) => ze(S) === f)) == null ? void 0 : Xe.changeIndex) ?? 0, h = oe(o.card, { sql: !0 }), I = Oe(o.card.type);
|
|
1883
|
+
h.editable && ("sql" in h.query ? !!h.query.sql : "measures" in h.query ? h.query.measures.length > 0 : h.query.columns.length > 0) && ((Je = ce[I]) == null ? void 0 : Je.forms.includes(xe(h.query))) || s.push({
|
|
1884
|
+
code: "type_not_supported",
|
|
1885
|
+
message: `As changed, "${o.card.title}" would have no query a ${I.replace(/_/g, " ")} can run.`,
|
|
1886
|
+
path: `changes[${l}]`,
|
|
1887
|
+
fix: `Send a complete query with the type change: ${((Ze = ce[I]) == null ? void 0 : Ze.forms.map((S) => Se[S]).join(" or ")) ?? "a measures query"}.`
|
|
1888
|
+
});
|
|
1889
|
+
}
|
|
1890
|
+
if (s.push(...qs(e, j.dashboard, n, L, C)), s.push(...Ps(j.dashboard, q, a.calendar)), s.length) return { ok: !1, problems: s };
|
|
1891
|
+
for (const f of n) {
|
|
1892
|
+
if (f.op !== "filter.add" && !(f.op === "filter.update" && f.settings.scope)) continue;
|
|
1893
|
+
const o = f.op === "filter.add" ? f.input.id : f.filterId, l = pe(j.dashboard, o, void 0, C);
|
|
1894
|
+
if (!(l != null && l.editable)) continue;
|
|
1895
|
+
const h = async (v) => {
|
|
1896
|
+
const S = [];
|
|
1897
|
+
for (const T of v) {
|
|
1898
|
+
const w = T.datasetName ? await a.findRelationshipFields({
|
|
1899
|
+
domainId: l.domainId,
|
|
1900
|
+
fromDataset: l.datasetName,
|
|
1901
|
+
field: l.field,
|
|
1902
|
+
toDataset: T.datasetName
|
|
1903
|
+
}) : [];
|
|
1904
|
+
S.push({ ...T, suggestedFields: w });
|
|
1905
|
+
}
|
|
1906
|
+
return S;
|
|
1907
|
+
}, I = (v) => v.map((S) => `"${S.title}"`).join(", ");
|
|
1908
|
+
if (l.notReached.length) {
|
|
1909
|
+
const v = await h(l.notReached);
|
|
1910
|
+
r.push({
|
|
1911
|
+
code: "filter_not_reaching_cards",
|
|
1912
|
+
message: `"${l.label}" doesn't reach ${v.length} card${v.length === 1 ? "" : "s"} on its sheets: ${I(v)}.`,
|
|
1913
|
+
path: `changes[${f.changeIndex ?? 0}]`,
|
|
1914
|
+
fix: "Add filter.bind with one of the suggested fields to reach a card, or leave it unfiltered.",
|
|
1915
|
+
details: { cards: v }
|
|
1916
|
+
});
|
|
1917
|
+
}
|
|
1918
|
+
if ((et = l.relationshipPending) != null && et.length) {
|
|
1919
|
+
const v = await h(l.relationshipPending);
|
|
1920
|
+
r.push({
|
|
1921
|
+
code: "filter_reach_through_relationships",
|
|
1922
|
+
message: `"${l.label}" may reach ${v.length} card${v.length === 1 ? "" : "s"} on its sheets through the domain's relationships: ${I(v)}. Whether it applies is decided when each card runs.`,
|
|
1923
|
+
path: `changes[${f.changeIndex ?? 0}]`,
|
|
1924
|
+
fix: "Add filter.bind with one of the suggested fields to make it certain, or leave it to the relationships.",
|
|
1925
|
+
details: { cards: v }
|
|
1926
|
+
});
|
|
1927
|
+
}
|
|
1928
|
+
}
|
|
1929
|
+
const De = Es(j.dashboard, n, j.descriptions, C);
|
|
1930
|
+
return {
|
|
1931
|
+
ok: !0,
|
|
1932
|
+
operations: n,
|
|
1933
|
+
context: y,
|
|
1934
|
+
dashboard: j.dashboard,
|
|
1935
|
+
refs: i,
|
|
1936
|
+
descriptions: De,
|
|
1937
|
+
changedCardIds: u,
|
|
1938
|
+
requires: [...d],
|
|
1939
|
+
warnings: r
|
|
1667
1940
|
};
|
|
1668
1941
|
}
|
|
1942
|
+
function Es(e, t, a, s) {
|
|
1943
|
+
const r = t.filter((u) => u.op === "card.add");
|
|
1944
|
+
if (!r.length) return [...a];
|
|
1945
|
+
const n = Rt(e, void 0, s);
|
|
1946
|
+
if (!n.length) return [...a];
|
|
1947
|
+
const i = (u) => ya(u.map((b) => `"${b}"`)), d = /* @__PURE__ */ new Map();
|
|
1948
|
+
for (const u of r) {
|
|
1949
|
+
const b = ze(u);
|
|
1950
|
+
if (!b || u.changeIndex === void 0) continue;
|
|
1951
|
+
const y = n.filter((_) => _.reaches.includes(b)).map((_) => _.label), C = n.filter((_) => {
|
|
1952
|
+
var g;
|
|
1953
|
+
return "notReached" in _ && ((g = _.notReached) == null ? void 0 : g.some((A) => A.cardId === b));
|
|
1954
|
+
}).map((_) => _.label), p = n.filter((_) => {
|
|
1955
|
+
var g;
|
|
1956
|
+
return (g = _.relationshipPending) == null ? void 0 : g.some((A) => A.cardId === b);
|
|
1957
|
+
}).map((_) => _.label), $ = [
|
|
1958
|
+
...y.length ? [`The dashboard's ${i(y)} filter${y.length === 1 ? " applies" : "s apply"} to it.`] : [],
|
|
1959
|
+
...C.length ? [`${i(C)} ${C.length === 1 ? "doesn't" : "don't"} reach it.`] : [],
|
|
1960
|
+
...p.length ? [`${i(p)} may reach it through the domain's relationships.`] : []
|
|
1961
|
+
];
|
|
1962
|
+
$.length && d.set(u.changeIndex, $.join(" "));
|
|
1963
|
+
}
|
|
1964
|
+
return a.map((u) => {
|
|
1965
|
+
const b = u.changeIndex === void 0 ? void 0 : d.get(u.changeIndex);
|
|
1966
|
+
return b ? { ...u, sentence: `${u.sentence} ${b}` } : u;
|
|
1967
|
+
});
|
|
1968
|
+
}
|
|
1969
|
+
function ze(e) {
|
|
1970
|
+
var t;
|
|
1971
|
+
if (e.op === "card.update" || e.op === "card.remove") return e.cardId;
|
|
1972
|
+
if (e.op === "card.add") return (t = e.frame.cards[0]) == null ? void 0 : t.id;
|
|
1973
|
+
}
|
|
1974
|
+
function Os(e) {
|
|
1975
|
+
return Object.fromEntries(
|
|
1976
|
+
_a.flatMap((t) => e[t] === void 0 ? [] : [[t, e[t]]])
|
|
1977
|
+
);
|
|
1978
|
+
}
|
|
1979
|
+
function Ns(e, t) {
|
|
1980
|
+
if (!t.length || !e.config) return e;
|
|
1981
|
+
const a = { ...e.config }, s = [];
|
|
1982
|
+
if (a.matrix) {
|
|
1983
|
+
const n = a.matrix, i = xa(n), d = [...n.spec.rows, ...n.spec.columns], u = { ...n.presentation.levelLabels }, b = { ...n.presentation.measureLabels };
|
|
1984
|
+
for (const { key: y, label: C } of t) {
|
|
1985
|
+
if (y.role === "metric") {
|
|
1986
|
+
const p = i.measures.findIndex(($) => Fe($, y));
|
|
1987
|
+
if (p < 0) continue;
|
|
1988
|
+
b[n.spec.measures[p].id] = C;
|
|
1989
|
+
} else {
|
|
1990
|
+
const p = i.levels.findIndex(($) => Fe($, y));
|
|
1991
|
+
if (p < 0) continue;
|
|
1992
|
+
u[d[p].id] = C;
|
|
1993
|
+
}
|
|
1994
|
+
s.push(y);
|
|
1995
|
+
}
|
|
1996
|
+
return a.matrix = { ...n, presentation: { ...n.presentation, levelLabels: u, measureLabels: b } }, { ...e, config: a, statedLabels: s };
|
|
1997
|
+
}
|
|
1998
|
+
const r = { metric: "metricColumns", group_by: "groupByColumns", detail: "detailColumns" };
|
|
1999
|
+
for (const { key: n, label: i } of t) {
|
|
2000
|
+
const d = [...a[r[n.role]] ?? []], u = Da(n.role, d).findIndex((b) => Fe(b, n));
|
|
2001
|
+
u < 0 || (d[u] = Ba(d[u], i), a[r[n.role]] = d, s.push(n));
|
|
2002
|
+
}
|
|
2003
|
+
return { ...e, config: a, statedLabels: s };
|
|
2004
|
+
}
|
|
2005
|
+
function qs(e, t, a, s, r) {
|
|
2006
|
+
var A;
|
|
2007
|
+
const n = [], i = new Map(re(t).map((c) => [c.cardId, c])), d = Me(t), u = de(t), b = (c) => {
|
|
2008
|
+
var m, F;
|
|
2009
|
+
return ((F = (m = t.sheets) == null ? void 0 : m.find((k) => k.id === c)) == null ? void 0 : F.title) ?? c;
|
|
2010
|
+
}, y = (c, m) => {
|
|
2011
|
+
var F;
|
|
2012
|
+
return ((F = [...a].reverse().find((k) => ze(k) === m || "filterId" in k && k.filterId === c)) == null ? void 0 : F.changeIndex) ?? 0;
|
|
2013
|
+
}, C = (c, m) => {
|
|
2014
|
+
const F = u.findFilterInput({ inputId: c }).input, k = i.get(m), D = `"${k.card.title ?? ""}"`, N = `"${F.label}"`;
|
|
2015
|
+
if (k.kind === "documentSectionCard")
|
|
2016
|
+
return {
|
|
2017
|
+
reason: "document_section",
|
|
2018
|
+
message: `${D} is in a Document section, which takes only the filters its Document sheet shows.`,
|
|
2019
|
+
fix: "Tell the user to change where the filter shows in the editor."
|
|
2020
|
+
};
|
|
2021
|
+
const R = d.get(k.sheetId);
|
|
2022
|
+
if (R && !yt(F, R))
|
|
2023
|
+
return {
|
|
2024
|
+
reason: "outside_sheets",
|
|
2025
|
+
message: `${N} isn't shown on "${b(k.sheetId)}", so it can't filter ${D}.`,
|
|
2026
|
+
fix: "Show it on that sheet first with filter.update sheetIds (null for every sheet), in the same proposal."
|
|
2027
|
+
};
|
|
2028
|
+
const O = qa(F, k.card);
|
|
2029
|
+
switch (O.status) {
|
|
2030
|
+
case "incompatible":
|
|
2031
|
+
return { reason: "incompatible_field", message: `${D} can't take ${N}'s values on that field: their types differ.`, fix: "Bind a field of the same type (filter.bind)." };
|
|
2032
|
+
case "stale":
|
|
2033
|
+
return {
|
|
2034
|
+
reason: "field_not_on_card",
|
|
2035
|
+
message: `${D} doesn't have the field ${N} is bound to.`,
|
|
2036
|
+
fix: "Bind a field the card has (filter.bind), or exclude the card (filter.exclude), in the same proposal."
|
|
2037
|
+
};
|
|
2038
|
+
case "ambiguous":
|
|
2039
|
+
return {
|
|
2040
|
+
reason: "ambiguous_field",
|
|
2041
|
+
message: `${D} has more than one field ${N} could filter.`,
|
|
2042
|
+
fix: "Bind the field it should use (filter.bind), or exclude the card (filter.exclude), in the same proposal."
|
|
2043
|
+
};
|
|
2044
|
+
case "relationship": {
|
|
2045
|
+
const E = ve(F, k.card, r);
|
|
2046
|
+
return E.reach === "blocked" ? {
|
|
2047
|
+
reason: "relationship_route_changed",
|
|
2048
|
+
message: `The relationships ${D} used for ${N} changed in the domain.`,
|
|
2049
|
+
fix: "Tell the user to choose the relationship again in the filter's Cards tab."
|
|
2050
|
+
} : E.reason === "relationship_ambiguous" ? {
|
|
2051
|
+
reason: "relationship_ambiguous",
|
|
2052
|
+
message: `${N} connects to ${D} through more than one path.`,
|
|
2053
|
+
fix: "Tell the user to choose a path in the filter's Cards tab, or bind a field the card has (filter.bind)."
|
|
2054
|
+
} : {
|
|
2055
|
+
reason: "relationship_pending",
|
|
2056
|
+
message: `${N} may reach ${D} through the domain's relationships; whether it applies is decided when the card runs.`,
|
|
2057
|
+
fix: "Bind a field the card has (filter.bind) to make it certain, or leave it to the relationships."
|
|
2058
|
+
};
|
|
2059
|
+
}
|
|
2060
|
+
case "excluded":
|
|
2061
|
+
case "bound":
|
|
2062
|
+
case "unsupportedTarget":
|
|
2063
|
+
case "sql":
|
|
2064
|
+
case "automatic":
|
|
2065
|
+
case "passthrough":
|
|
2066
|
+
case "notApplicable":
|
|
2067
|
+
return { reason: "filter_settings_override", message: `${N} still wouldn't filter ${D}: its settings leave that card out.`, fix: "Tell the user to change the filter's settings in the editor." };
|
|
2068
|
+
default: {
|
|
2069
|
+
const E = O;
|
|
2070
|
+
throw new Error(`Unhandled filter card target ${String(E.status)}`);
|
|
2071
|
+
}
|
|
2072
|
+
}
|
|
2073
|
+
}, p = /* @__PURE__ */ new Set(), $ = /* @__PURE__ */ new Map();
|
|
2074
|
+
for (const c of a)
|
|
2075
|
+
(c.op === "filter.bind" || c.op === "filter.exclude") && $.set(`${c.filterId}|${c.cardId}`, c);
|
|
2076
|
+
for (const c of $.values()) {
|
|
2077
|
+
const m = pe(t, c.filterId, void 0, r), F = i.get(c.cardId);
|
|
2078
|
+
if (!m || !F) continue;
|
|
2079
|
+
const k = m.reaches.includes(c.cardId);
|
|
2080
|
+
if (c.op === "filter.bind" ? k : !k) continue;
|
|
2081
|
+
p.add(`${c.filterId}|${c.cardId}`);
|
|
2082
|
+
const D = c.op === "filter.bind" ? C(c.filterId, c.cardId) : { reason: "filter_settings_override", message: `"${m.label}" would still filter "${F.card.title ?? ""}".`, fix: "Tell the user to change the filter's settings in the editor." };
|
|
2083
|
+
n.push({
|
|
2084
|
+
code: "filter_not_editable",
|
|
2085
|
+
message: D.message,
|
|
2086
|
+
path: `changes[${c.changeIndex ?? 0}]`,
|
|
2087
|
+
fix: D.fix,
|
|
2088
|
+
details: { reason: D.reason, cardId: c.cardId }
|
|
2089
|
+
});
|
|
2090
|
+
}
|
|
2091
|
+
for (const [c, m] of s) {
|
|
2092
|
+
const F = pe(t, c, void 0, r);
|
|
2093
|
+
if (!F) continue;
|
|
2094
|
+
const k = F.editable && ((A = F.exceptSheetIds) == null ? void 0 : A.some((R) => {
|
|
2095
|
+
var O;
|
|
2096
|
+
return ((O = d.get(R)) == null ? void 0 : O.sheetKind) === "dashboard";
|
|
2097
|
+
})), D = F.editable && !k ? F.sheetIds : void 0, N = m.sheetIds === "all" ? "all" : [...m.sheetIds].sort();
|
|
2098
|
+
Le(D === "all" || !D ? D : [...D].sort(), N) || n.push({
|
|
2099
|
+
code: "filter_not_editable",
|
|
2100
|
+
message: `"${F.label}" wouldn't show on the sheets asked for. Change where it shows in the editor.`,
|
|
2101
|
+
path: `changes[${m.changeIndex}].sheetIds`,
|
|
2102
|
+
fix: "Tell the user to change the filter's sheets in the editor.",
|
|
2103
|
+
details: { reason: "filter_settings_override", ...D ? { sheetIds: D } : {} }
|
|
2104
|
+
});
|
|
2105
|
+
}
|
|
2106
|
+
const _ = de(e), g = (c) => c === "blocked" || c === "ambiguous";
|
|
2107
|
+
for (const c of u.inputs) {
|
|
2108
|
+
const m = c.input.id;
|
|
2109
|
+
for (const F of u.reachedCards({ inputId: m })) {
|
|
2110
|
+
if (p.has(`${m}|${F.cardId}`) || !g(ve(c.input, F.card, r).reach)) continue;
|
|
2111
|
+
const k = _.findFilterInput({ inputId: m }), D = k && _.reachedCards({ inputId: m }).find((R) => R.cardId === F.cardId);
|
|
2112
|
+
if (k && D && g(ve(k.input, D.card, r).reach)) continue;
|
|
2113
|
+
const N = C(m, F.cardId);
|
|
2114
|
+
n.push({
|
|
2115
|
+
code: "invalid_change",
|
|
2116
|
+
message: `${N.message} The card would stop showing data while "${c.input.label}" has a value.`,
|
|
2117
|
+
path: `changes[${y(m, F.cardId)}]`,
|
|
2118
|
+
fix: N.fix,
|
|
2119
|
+
details: { reason: N.reason, filterId: m, cardId: F.cardId }
|
|
2120
|
+
});
|
|
2121
|
+
}
|
|
2122
|
+
}
|
|
2123
|
+
return n;
|
|
2124
|
+
}
|
|
2125
|
+
function Ps(e, t, a) {
|
|
2126
|
+
const s = [], r = de(e);
|
|
2127
|
+
for (const [n, i] of t) {
|
|
2128
|
+
const d = r.findFilterInput({ inputId: n });
|
|
2129
|
+
if (!d) continue;
|
|
2130
|
+
const u = It({ dashboard: e, target: { kind: "dashboardInput", input: d.input, scope: {} }, calendar: a }).value, b = d.input.filter.dateSelectionMode, y = b === "day" ? "its date picker takes one day" : void 0, C = (p, $) => s.push({
|
|
2131
|
+
code: "filter_not_editable",
|
|
2132
|
+
message: p,
|
|
2133
|
+
path: `changes[${i.changeIndex}]`,
|
|
2134
|
+
fix: $,
|
|
2135
|
+
details: { reason: "default_not_applied", ...b ? { datePicker: b } : {} }
|
|
2136
|
+
});
|
|
2137
|
+
if (i.period) {
|
|
2138
|
+
const p = vt(i.period), $ = u && "relativeMeta" in u ? u.relativeMeta : void 0;
|
|
2139
|
+
(!$ || !Le($, p)) && C(
|
|
2140
|
+
`"${d.input.label}" wouldn't load with that default${y ? `: ${y}` : ""}.`,
|
|
2141
|
+
y ? "Ask for a default the picker can take, or tell the user to make it a date range in the editor." : "Tell the user to change the filter's default in the editor."
|
|
2142
|
+
);
|
|
2143
|
+
} else if (i.values) {
|
|
2144
|
+
const p = ($) => JSON.stringify(($ ?? []).map(String).sort());
|
|
2145
|
+
(!u || p(u.values) !== p(i.values)) && C(`"${d.input.label}" wouldn't load with those values.`, "Tell the user to change the filter's default in the editor.");
|
|
2146
|
+
} else
|
|
2147
|
+
(St(d.input.filter.dataType) ? i.period === null : i.values === null) && u && C(`"${d.input.label}" would still load with a default.`, "Tell the user to change the filter's default in the editor.");
|
|
2148
|
+
}
|
|
2149
|
+
return s;
|
|
2150
|
+
}
|
|
2151
|
+
function Ms(e, t, a, s) {
|
|
2152
|
+
const r = Object.fromEntries(Object.entries(t).filter(([, y]) => y != null)), n = xe(r), i = xe(e), d = (y) => mt[y].safeParse(r);
|
|
2153
|
+
if (!e || n && n !== i) {
|
|
2154
|
+
const y = n ?? i, C = y ? d(y) : void 0;
|
|
2155
|
+
return C != null && C.success ? C.data : s({
|
|
2156
|
+
code: e ? "query_form_mismatch" : "type_not_supported",
|
|
2157
|
+
message: e ? "This patch changes the query's form (measures, records or SQL) without a complete query." : "This card's current query can't be patched; send a complete query.",
|
|
2158
|
+
path: a,
|
|
2159
|
+
fix: "Send a complete query of the new form: domainId, datasetName and measures (or columns), or connectionId and sql."
|
|
2160
|
+
});
|
|
2161
|
+
}
|
|
2162
|
+
const u = { ...e };
|
|
2163
|
+
for (const [y, C] of Object.entries(t))
|
|
2164
|
+
C !== void 0 && (C === null ? delete u[y] : u[y] = C);
|
|
2165
|
+
const b = mt[i].safeParse(u);
|
|
2166
|
+
if (!b.success) {
|
|
2167
|
+
const y = b.error.issues[0];
|
|
2168
|
+
return s({
|
|
2169
|
+
code: (y == null ? void 0 : y.code) === "unrecognized_keys" ? "query_form_mismatch" : "invalid_change",
|
|
2170
|
+
message: (y == null ? void 0 : y.message) ?? "The merged query is not valid.",
|
|
2171
|
+
path: y ? Et(a, y) : a,
|
|
2172
|
+
fix: "Patch only keys of the card's query form, or send a complete query of a new form."
|
|
2173
|
+
});
|
|
2174
|
+
}
|
|
2175
|
+
return b.data;
|
|
2176
|
+
}
|
|
2177
|
+
function gt(e, t, a) {
|
|
2178
|
+
return e ? (e.forEach((s, r) => a(s, `${t}.sheetIds[${r}]`)), { kind: "sheets", sheetIds: [...e] }) : { kind: "allSheets", sheetKinds: ["dashboard"] };
|
|
2179
|
+
}
|
|
2180
|
+
function bt(e, t, a, s) {
|
|
2181
|
+
["date", "datetime", "timestamp"].some((i) => Pe(t.dataType).includes(i)) || s({ code: "invalid_change", message: "defaultPeriod is for date filters.", path: a, fix: "Use defaultValues for this field." });
|
|
2182
|
+
const n = vt(e);
|
|
2183
|
+
if (!n) {
|
|
2184
|
+
const i = "anchor" in e && e.anchor === "latest_available";
|
|
2185
|
+
if (!i && Ra(e)) {
|
|
2186
|
+
const d = e.unit;
|
|
2187
|
+
return s({
|
|
2188
|
+
code: "invalid_change",
|
|
2189
|
+
message: `A filter's default can't count a partial ${d} back from now; its presets are whole days with today, complete ${d}s, or a calendar ${d}.`,
|
|
2190
|
+
path: a,
|
|
2191
|
+
fix: `Use completeness "complete_periods", days ({ unit: "day", value: N }), or { kind: "calendar", unit: "${d}", period: "this", toDate: true }; ask the user which they mean.`
|
|
2192
|
+
});
|
|
2193
|
+
}
|
|
2194
|
+
return s({
|
|
2195
|
+
code: "invalid_change",
|
|
2196
|
+
message: i ? "A filter's default runs to now, not to the latest available data." : "This period can't be a filter's default.",
|
|
2197
|
+
path: a,
|
|
2198
|
+
fix: i ? "Leave out anchor (a filter default runs to now)." : 'Use days ({ unit: "day", value: N }), complete periods, or a calendar window ({ kind: "calendar", unit, period }).'
|
|
2199
|
+
});
|
|
2200
|
+
}
|
|
2201
|
+
return n;
|
|
2202
|
+
}
|
|
2203
|
+
async function Ls(e, t, a, s, r) {
|
|
2204
|
+
const n = ha(e), i = n.kind === "config" ? n.executableSources : n.kind === "sql" ? n.pinnedCatalogSources.map((_) => _.source) : [], d = fe(e), u = typeof t == "string" ? (d == null ? void 0 : d.kind) === "semantic" ? d.datasetName : void 0 : t.datasetName, b = i.find((_) => _.kind === "semantic" && Pe(_.datasetName) === Pe(u));
|
|
2205
|
+
if (!b || b.kind !== "semantic")
|
|
2206
|
+
return r({
|
|
2207
|
+
code: "field_not_found",
|
|
2208
|
+
message: `"${e.title}" doesn't read ${u ? `the dataset ${u}` : "a dataset"}.`,
|
|
2209
|
+
path: s,
|
|
2210
|
+
fix: "Name a field of the card's own dataset, or { name, datasetName } for a dataset its query joins."
|
|
2211
|
+
});
|
|
2212
|
+
const y = await a.loadCardSource({ domainId: b.domainId, datasetName: b.datasetName }), C = typeof t == "string" ? t : t.name, p = y ? _t(y.fields, C, b.datasetName) : void 0, $ = p ? Mt(b, { column_name: p.name, data_type: p.dataType, ...p.sourceField ? { sourceField: p.sourceField } : {} }) : void 0;
|
|
2213
|
+
return $ || r({
|
|
2214
|
+
code: "field_not_found",
|
|
2215
|
+
message: `"${C}" isn't a field of ${b.datasetName}.`,
|
|
2216
|
+
path: s,
|
|
2217
|
+
fix: "Use one of details.available, or read semaphor_get_dataset_schema.",
|
|
2218
|
+
details: { available: ((y == null ? void 0 : y.fields) ?? []).slice(0, 20).map((_) => _.name) }
|
|
2219
|
+
});
|
|
2220
|
+
}
|
|
2221
|
+
const Bs = 50;
|
|
2222
|
+
function gi(e, t) {
|
|
2223
|
+
var p, $;
|
|
2224
|
+
const a = (p = t.sheetIds) != null && p.length ? new Set(t.sheetIds) : void 0, s = ($ = t.cardIds) != null && $.length ? new Set(t.cardIds) : void 0, r = (e.sheets ?? []).filter((_) => !a || a.has(_.id)), n = re(e).filter(
|
|
2225
|
+
(_) => (!a || a.has(_.sheetId)) && (!s || s.has(_.cardId))
|
|
2226
|
+
), i = n.length > (t.maxQueryCards ?? Bs), d = new Map(
|
|
2227
|
+
(e.sheets ?? []).flatMap((_) => (_.frames ?? []).map((g) => [g.id, g]))
|
|
2228
|
+
), u = /* @__PURE__ */ new Map(), b = (_) => {
|
|
2229
|
+
(_ == null ? void 0 : _.kind) === "semantic" && u.set(`${_.domainId}|${_.datasetName}`, { domainId: _.domainId, datasetName: _.datasetName });
|
|
2230
|
+
}, y = r.map((_) => ({
|
|
2231
|
+
sheetId: _.id,
|
|
2232
|
+
title: _.title ?? "",
|
|
2233
|
+
kind: _.kind === "document" ? "document" : "dashboard",
|
|
2234
|
+
..._.kind === "document" ? {} : { layout: Vs(_) },
|
|
2235
|
+
cards: n.filter((g) => g.sheetId === _.id).map((g) => {
|
|
2236
|
+
var D;
|
|
2237
|
+
const A = g.card, c = g.kind === "frameCard" ? (D = d.get(g.frameId)) == null ? void 0 : D.visualId : void 0, m = c ? { linkedVisualId: c } : {}, F = { cardId: g.cardId, title: A.title ?? "" };
|
|
2238
|
+
if (g.kind !== "frameCard") {
|
|
2239
|
+
const N = fe(A);
|
|
2240
|
+
return b(N), {
|
|
2241
|
+
...F,
|
|
2242
|
+
type: Oe(A.type),
|
|
2243
|
+
...N ? { source: N } : {},
|
|
2244
|
+
editable: !1,
|
|
2245
|
+
notEditable: g.kind === "documentSectionCard" ? { reason: "document_section", message: "Cards in Document sections can't be changed through the MCP yet. Change them in the editor." } : {
|
|
2246
|
+
reason: "not_expressible",
|
|
2247
|
+
message: "This card isn't in a tile, so it can't be changed through the MCP. Change it in the editor.",
|
|
2248
|
+
detail: "a card outside a tile"
|
|
2249
|
+
}
|
|
2250
|
+
};
|
|
2251
|
+
}
|
|
2252
|
+
const k = oe(A, { sql: t.sql });
|
|
2253
|
+
return b(k.source), k.editable ? {
|
|
2254
|
+
...F,
|
|
2255
|
+
type: k.type,
|
|
2256
|
+
source: k.source,
|
|
2257
|
+
...m,
|
|
2258
|
+
editable: !0,
|
|
2259
|
+
...i ? {} : { query: k.query, ...k.matrix ? { matrix: k.matrix } : {} }
|
|
2260
|
+
} : {
|
|
2261
|
+
...F,
|
|
2262
|
+
type: k.type,
|
|
2263
|
+
...k.source ? { source: k.source } : {},
|
|
2264
|
+
...m,
|
|
2265
|
+
editable: !1,
|
|
2266
|
+
notEditable: { reason: k.reason, message: k.message, ...k.detail ? { detail: k.detail } : {} }
|
|
2267
|
+
};
|
|
2268
|
+
})
|
|
2269
|
+
})), C = Rt(e, Ft(t.calendar, t.updatedAt), {
|
|
2270
|
+
...t.relationshipReach ? { relationshipReach: t.relationshipReach } : {}
|
|
2271
|
+
});
|
|
2272
|
+
for (const _ of C)
|
|
2273
|
+
_.editable && u.set(`${_.domainId}|${_.datasetName}`, { domainId: _.domainId, datasetName: _.datasetName });
|
|
2274
|
+
return {
|
|
2275
|
+
dashboardId: t.dashboardId,
|
|
2276
|
+
title: e.title ?? "",
|
|
2277
|
+
updatedAt: t.updatedAt,
|
|
2278
|
+
access: t.access,
|
|
2279
|
+
datasets: [...u.values()],
|
|
2280
|
+
sheets: y,
|
|
2281
|
+
filters: C,
|
|
2282
|
+
...i ? { truncated: !0 } : {}
|
|
2283
|
+
};
|
|
2284
|
+
}
|
|
2285
|
+
function Vs(e) {
|
|
2286
|
+
const t = new Map((e.frames ?? []).map((a) => [a.id, a]));
|
|
2287
|
+
return Oa(e).rows.map((a) => ({
|
|
2288
|
+
tiles: a.tiles.map((s) => {
|
|
2289
|
+
var d, u;
|
|
2290
|
+
const r = ((d = t.get(s.frameId)) == null ? void 0 : d.cards) ?? [], n = (u = t.get(s.frameId)) == null ? void 0 : u.activeCardId, i = r.map((b) => b.id);
|
|
2291
|
+
return { cardIds: n && i.includes(n) ? [n, ...i.filter((b) => b !== n)] : i, width: s.width };
|
|
2292
|
+
})
|
|
2293
|
+
}));
|
|
2294
|
+
}
|
|
1669
2295
|
export {
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
2296
|
+
Ui as AGGREGATES,
|
|
2297
|
+
ji as AUTOMATIC_TEMPORAL_BUCKET_FORMAT,
|
|
2298
|
+
zi as CALCULATED_FIELDS_GROUP_ID,
|
|
2299
|
+
Qi as CALCULATED_FIELDS_GROUP_NAME,
|
|
2300
|
+
Ki as CARD_CONFIG_KEY_CLASSES,
|
|
2301
|
+
Hi as CARD_KEY_CLASSES,
|
|
2302
|
+
_a as CARD_QUERY_CONFIG_KEYS,
|
|
2303
|
+
hi as CARD_QUERY_REQUEST_DESCRIPTIVE_FIELDS,
|
|
2304
|
+
ui as CARD_QUERY_REQUEST_EXECUTED_FIELDS,
|
|
2305
|
+
Wi as CARD_TYPES,
|
|
2306
|
+
ce as CARD_TYPE_RULES,
|
|
2307
|
+
Yi as COLUMN_KEY_CLASSES,
|
|
2308
|
+
Xi as COLUMN_PRESENTATION_KEYS,
|
|
2309
|
+
Ji as CONTROL_BINDING_MAPPING_MISSING_ERROR_CODE,
|
|
2310
|
+
Zi as CONTROL_BINDING_TARGET_INVALID_ERROR_CODE,
|
|
2311
|
+
en as CONTROL_BINDING_VALUE_INVALID_ERROR_CODE,
|
|
2312
|
+
tn as CONTROL_CONTEXT_UNSUPPORTED_ERROR_CODE,
|
|
2313
|
+
an as CONTROL_DEFINITION_DUPLICATE_ERROR_CODE,
|
|
2314
|
+
sn as CONTROL_DEFINITION_INVALID_ERROR_CODE,
|
|
2315
|
+
nn as CONTROL_PLACEHOLDER_QUOTED_ERROR_CODE,
|
|
2316
|
+
on as CONTROL_REFERENCE_MISSING_ERROR_CODE,
|
|
2317
|
+
rn as CONTROL_VALUE_INVALID_ERROR_CODE,
|
|
2318
|
+
dn as CONTROL_VALUE_MISSING_ERROR_CODE,
|
|
2319
|
+
W as CardQueryRequestError,
|
|
2320
|
+
ln as ControlResolutionError,
|
|
2321
|
+
it as DASHBOARD_AUTHORING_MAX_GENERATED_CARDS,
|
|
2322
|
+
cn as DASHBOARD_CHANGE_OPS,
|
|
2323
|
+
un as DASHBOARD_DEFAULT_OPTION_DEPENDENCIES,
|
|
2324
|
+
xr as DASHBOARD_FILTER_OPERATIONS,
|
|
2325
|
+
hn as DASHBOARD_INPUT_RUNTIME_SCOPE_KINDS,
|
|
2326
|
+
Dr as DOCUMENT_KPI_SECTION_MAX_CARDS,
|
|
2327
|
+
Tr as DOCUMENT_KPI_SECTION_MAX_TILES,
|
|
2328
|
+
fn as DashboardFilterMappingContractError,
|
|
2329
|
+
pn as ExecutionControlContractError,
|
|
2330
|
+
mn as FILTER_OPERATORS,
|
|
2331
|
+
gn as FilterModelError,
|
|
2332
|
+
ot as MAX_PROPOSED_CHANGES,
|
|
2333
|
+
bn as MAX_QUERY_LIMIT,
|
|
2334
|
+
yi as NEW_CARD_TYPE,
|
|
2335
|
+
In as QUERY_ASPECTS,
|
|
2336
|
+
yn as QUERY_CONFIG_KEY_ASPECTS,
|
|
2337
|
+
_i as RELATIONSHIP_ROUTE_CHANGED_MESSAGE,
|
|
2338
|
+
_n as SEMAPHOR_CARTESIAN_CHART_TYPES,
|
|
2339
|
+
Cn as TIME_GRAINS,
|
|
2340
|
+
Sn as TOOLBAR_FILTER_REACH_FIELDS,
|
|
2341
|
+
vn as analyticsFilterSchema,
|
|
2342
|
+
Nr as applyCardReferenceRemapping,
|
|
2343
|
+
nt as applyDashboardOperations,
|
|
2344
|
+
qr as applyFilterApplicability,
|
|
2345
|
+
Ci as applyFilterSettingsChange,
|
|
2346
|
+
Pr as applyGroupByOverride,
|
|
2347
|
+
wn as applyLinkedClickToFilterOverrides,
|
|
2348
|
+
xn as applyOptionDependencyOverride,
|
|
2349
|
+
Si as buildCardExportFormatOptions,
|
|
2350
|
+
Mr as buildCardExportQueryContext,
|
|
2351
|
+
vi as buildCardExportRequest,
|
|
2352
|
+
wi as buildCardExportRequestFromOptions,
|
|
2353
|
+
xi as buildColumnCatalog,
|
|
2354
|
+
Dn as buildControlDefinitionIndex,
|
|
2355
|
+
ha as buildDashboardCardSourceIndex,
|
|
2356
|
+
Di as buildEntityColumnGroup,
|
|
2357
|
+
Ti as buildFilterInputFromDefinition,
|
|
2358
|
+
qt as buildFilterInputFromField,
|
|
2359
|
+
Tn as buildLinkedClickToFilterOverrides,
|
|
2360
|
+
kn as buildProposeChangeInputSchema,
|
|
2361
|
+
$n as buildSavedEditorCard,
|
|
2362
|
+
ki as buildTableExportFormatOptions,
|
|
2363
|
+
Fn as cardQueryPatchSchema,
|
|
2364
|
+
An as cardTypeSentenceName,
|
|
2365
|
+
Ca as changeCardType,
|
|
2366
|
+
Rn as changeMatrixEditor,
|
|
2367
|
+
Lt as clickToFilterSettingsSchema,
|
|
2368
|
+
Lr as collectJoinPlanIdentifiers,
|
|
2369
|
+
sa as columnDataset,
|
|
2370
|
+
Sa as columnFieldKey,
|
|
2371
|
+
Da as columnKeys,
|
|
2372
|
+
li as compileDashboardFromPlan,
|
|
2373
|
+
Br as composeCardReferenceRemapping,
|
|
2374
|
+
En as controlBindingExecutionSchema,
|
|
2375
|
+
On as controlDefinitionExecutionSchema,
|
|
2376
|
+
la as controlRefusal,
|
|
2377
|
+
Nn as createDashboardFilterBindingId,
|
|
2378
|
+
nd as createMatrixAuthoringDraft,
|
|
2379
|
+
od as createMatrixConfig,
|
|
2380
|
+
Pt as createNewCard,
|
|
2381
|
+
Ve as dashboardAuthoringDatasetMatchesSource,
|
|
2382
|
+
ri as dashboardAuthoringFieldsReferToSameTarget,
|
|
2383
|
+
J as dashboardAuthoringSourceFromField,
|
|
2384
|
+
ni as dashboardAuthoringSourceKey,
|
|
2385
|
+
wt as dashboardAuthoringSourcesReferToSameDataset,
|
|
2386
|
+
qn as dashboardCardFilterSourceInventoryContains,
|
|
2387
|
+
ia as dashboardChangeSchema,
|
|
2388
|
+
Pn as dashboardFilterTargetMatchesLogicalValue,
|
|
2389
|
+
kr as dashboardFilterValueTypeForDataType,
|
|
2390
|
+
Mn as dashboardGenerateSchema,
|
|
2391
|
+
Zt as dashboardInputScopeIncludesDocumentSheets,
|
|
2392
|
+
ci as dashboardPlanFromSemaphorDashboardIntent,
|
|
2393
|
+
Ln as defaultClickToFilterSettings,
|
|
2394
|
+
Vr as describeDashboardFilterCardReach,
|
|
2395
|
+
ve as describeDashboardFilterCardReachDetail,
|
|
2396
|
+
da as describeQueryChange,
|
|
2397
|
+
$i as describeRelationshipRoute,
|
|
2398
|
+
Fi as describeRelationshipSkip,
|
|
2399
|
+
Bn as doesDashboardInputApplyToTarget,
|
|
2400
|
+
Vn as doesDashboardInputSurviveCarriedContext,
|
|
2401
|
+
Gn as doesToolbarFilterReachTab,
|
|
2402
|
+
Ai as domainCalculatedFields,
|
|
2403
|
+
Un as dropMatrixEditorField,
|
|
2404
|
+
aa as fieldIdentityKey,
|
|
2405
|
+
jn as fieldRefSchema,
|
|
2406
|
+
Gr as filterApplicabilityContextForCard,
|
|
2407
|
+
Ri as filterReachPreviewAnswers,
|
|
2408
|
+
Ur as filterValueReachForCard,
|
|
2409
|
+
zn as filterValueSemanticDataset,
|
|
2410
|
+
_t as findCatalogField,
|
|
2411
|
+
di as findDashboardAuthoringDatasetForSource,
|
|
2412
|
+
Qn as findDashboardCardExecutableSource,
|
|
2413
|
+
Kn as findDashboardCardPinnedCatalogSource,
|
|
2414
|
+
Hn as findDashboardSqlPinnedCatalogSource,
|
|
2415
|
+
ta as findSortedColumn,
|
|
2416
|
+
Ei as flattenEntityColumns,
|
|
2417
|
+
Wn as foldPrototypeDocumentInputs,
|
|
2418
|
+
Yn as formatFilterModelIssues,
|
|
2419
|
+
Qt as formatResolvedPrimaryDateFieldIssues,
|
|
2420
|
+
jr as formatSkippedFilterWarnings,
|
|
2421
|
+
Oi as getCalculatedFieldAggregateOverrides,
|
|
2422
|
+
Xn as getCalculatedFieldNamespace,
|
|
2423
|
+
Ni as getCalculatedFieldParameters,
|
|
2424
|
+
qi as getCalculatedFieldShelfOverrides,
|
|
2425
|
+
Jn as getCardDefinition,
|
|
2426
|
+
Zn as getColumnCatalogFieldId,
|
|
2427
|
+
Ya as getDashboardAuthoringCardSource,
|
|
2428
|
+
Pi as getDashboardFilterSubscriptionHint,
|
|
2429
|
+
eo as getDashboardGlobalDateFilter,
|
|
2430
|
+
$r as getDocumentKpiSectionShapeIssues,
|
|
2431
|
+
Fr as getDocumentSectionCards,
|
|
2432
|
+
Mi as getDomainCalculatedSelectionOverrides,
|
|
2433
|
+
to as getFieldAggregationOptions,
|
|
2434
|
+
ao as getMatrixBindingTargets,
|
|
2435
|
+
rd as getMatrixLevelLabel,
|
|
2436
|
+
dd as getMatrixMeasureLabel,
|
|
2437
|
+
so as getStableDomainCalculatedFieldId,
|
|
2438
|
+
io as getTemporalBucketAuthoringOptions,
|
|
2439
|
+
no as getTemporalBucketAuthoringSelection,
|
|
2440
|
+
oo as handleSchema,
|
|
2441
|
+
Li as hasDashboardFilterSubscription,
|
|
2442
|
+
ro as hasToolbarFilterReachField,
|
|
2443
|
+
zr as hostFilterValueFor,
|
|
2444
|
+
Qr as hostFilterValuesToSlots,
|
|
2445
|
+
Kr as isAdHocFilterValueOnTab,
|
|
2446
|
+
lo as isAllowedDashboardInputScopeCombination,
|
|
2447
|
+
co as isCardType,
|
|
2448
|
+
Ar as isDashboardFilterOperationCompatible,
|
|
2449
|
+
yt as isDashboardInputOnTab,
|
|
2450
|
+
uo as isDashboardInputOwnedBySheet,
|
|
2451
|
+
jt as isDashboardInputScopeEmpty,
|
|
2452
|
+
ho as isGroupedDate,
|
|
2453
|
+
fo as isHiddenFilterInput,
|
|
2454
|
+
me as isMaterializableDashboardAuthoringSource,
|
|
2455
|
+
po as isPresentationCurrencyBinding,
|
|
2456
|
+
mo as isSemanticAutoJoinCard,
|
|
2457
|
+
go as isSemaphorCartesianChartType,
|
|
2458
|
+
Va as isSemaphorSourceRef,
|
|
2459
|
+
bo as isStructuralControlBinding,
|
|
2460
|
+
Io as isValidControlOptionPresentation,
|
|
2461
|
+
ea as labelAt,
|
|
2462
|
+
yo as layoutArrangeSchema,
|
|
2463
|
+
_o as linkedClickToFilterOverridesSchema,
|
|
2464
|
+
Hr as listAdHocFilterValuesOnTab,
|
|
2465
|
+
re as listDashboardCardLocations,
|
|
2466
|
+
Co as listDashboardFilterDefinitions,
|
|
2467
|
+
So as listDashboardFilterInputsOnTab,
|
|
2468
|
+
vo as listDashboardInputReachKeys,
|
|
2469
|
+
Yt as listDashboardInputScopeExceptedCardIds,
|
|
2470
|
+
Jt as listDashboardInputScopeExceptedSheetIds,
|
|
2471
|
+
Me as listDashboardTabTargets,
|
|
2472
|
+
Wr as listFilterInputValueTargets,
|
|
2473
|
+
wo as listStoredFilterDefinitions,
|
|
2474
|
+
Rr as mapDocumentSectionCards,
|
|
2475
|
+
xo as matchColumns,
|
|
2476
|
+
Yr as matrixCatalogSources,
|
|
2477
|
+
xa as matrixColumnKeys,
|
|
2478
|
+
Do as matrixColumnsSchema,
|
|
2479
|
+
hd as matrixDefinitionFields,
|
|
2480
|
+
fd as matrixDefinitionSources,
|
|
2481
|
+
To as matrixEditorCatalogFromFields,
|
|
2482
|
+
Xr as matrixExecutionSources,
|
|
2483
|
+
ko as measureRefSchema,
|
|
2484
|
+
we as mergeDashboardAuthoringSources,
|
|
2485
|
+
ld as mergeMatrixSorts,
|
|
2486
|
+
ma as metricCardQuerySchema,
|
|
2487
|
+
wa as moveMatrixLevel,
|
|
2488
|
+
$o as normalizeClickToFilterSettings,
|
|
2489
|
+
Fo as normalizeDashboardInputs,
|
|
2490
|
+
Ao as normalizeLegacyLinkedTargetOverrides,
|
|
2491
|
+
Ro as occurrenceKeys,
|
|
2492
|
+
Ft as outlineCalendar,
|
|
2493
|
+
gi as outlineDashboard,
|
|
2494
|
+
pe as outlineFilter,
|
|
2495
|
+
Rt as outlineFilters,
|
|
2496
|
+
pi as parseCardQueryRequest,
|
|
2497
|
+
ks as parseCardQueryRequestContext,
|
|
2498
|
+
fi as parseCardQueryRequestExtras,
|
|
2499
|
+
Eo as parseExecutionControlBindingsShallow,
|
|
2500
|
+
Ht as parseExecutionControlContext,
|
|
2501
|
+
Oo as parseExecutionControlContract,
|
|
2502
|
+
ca as planCardLabels,
|
|
2503
|
+
lt as planCardRequery,
|
|
2504
|
+
Bi as pluralDatasetLabel,
|
|
2505
|
+
Ga as preferDashboardAuthoringSourceMetadata,
|
|
2506
|
+
oi as preferredDashboardAuthoringSource,
|
|
2507
|
+
Jr as prepareLoadedDashboard,
|
|
2508
|
+
No as previewTemporalBucketAuthoringFormat,
|
|
2509
|
+
qo as proposedChangeSchema,
|
|
2510
|
+
Zr as pruneUnrelatedCalculatedFilters,
|
|
2511
|
+
ua as queryForm,
|
|
2512
|
+
oe as readCardQuery,
|
|
2513
|
+
fe as readCardSource,
|
|
2514
|
+
de as readDashboardFilterModel,
|
|
2515
|
+
Po as readExactDomainCalculatedFieldReference,
|
|
2516
|
+
Vi as readFilterReachResponse,
|
|
2517
|
+
ed as readFilterValueList,
|
|
2518
|
+
pd as readMatrixCardConfig,
|
|
2519
|
+
Mo as rebindDashboardOptionDependencyInputId,
|
|
2520
|
+
dt as rebuildsRole,
|
|
2521
|
+
Lo as reconcileMatrixSpecStructure,
|
|
2522
|
+
Bo as reconcileTemporalBucketAuthoringFormat,
|
|
2523
|
+
pa as recordsCardQuerySchema,
|
|
2524
|
+
Vo as refDataset,
|
|
2525
|
+
ne as refKey,
|
|
2526
|
+
ut as refName,
|
|
2527
|
+
Go as relationshipAddSchema,
|
|
2528
|
+
Uo as relationshipRouteTarget,
|
|
2529
|
+
jo as relativeToTimeWindow,
|
|
2530
|
+
Vt as remapClickToFilterReferences,
|
|
2531
|
+
zo as remapLinkedClickToFilterOverrides,
|
|
2532
|
+
Qo as requireNormalizedDashboardInputs,
|
|
2533
|
+
Ko as resolveBindingControlValue,
|
|
2534
|
+
Cr as resolveCanonicalDetailResultRawKey,
|
|
2535
|
+
Sr as resolveCanonicalResultOutputKey,
|
|
2536
|
+
vr as resolveCanonicalResultRawKey,
|
|
2537
|
+
Ua as resolveDashboardAuthoringSource,
|
|
2538
|
+
mi as resolveDashboardChanges,
|
|
2539
|
+
Ho as resolveDashboardEntitySource,
|
|
2540
|
+
Wo as resolveDashboardFilterAutomaticTarget,
|
|
2541
|
+
Yo as resolveDashboardFilterInheritedTarget,
|
|
2542
|
+
Xo as resolveDashboardOptionDependencies,
|
|
2543
|
+
Jo as resolveDashboardOptionPopulation,
|
|
2544
|
+
td as resolveDashboardSqlFilterTarget,
|
|
2545
|
+
Zo as resolveFieldSelectedSource,
|
|
2546
|
+
er as resolveGroupByFieldTarget,
|
|
2547
|
+
ad as resolveMatrixControlBindings,
|
|
2548
|
+
cd as resolveMatrixDefinition,
|
|
2549
|
+
tr as resolveMetricFieldTarget,
|
|
2550
|
+
ar as resolveScalarMappedValue,
|
|
2551
|
+
sr as resolveTemporalBucketAuthoringFormat,
|
|
2552
|
+
Kt as resolveTemporalResultOwner,
|
|
2553
|
+
Bt as respondsToSelectionsSchema,
|
|
2554
|
+
ir as retainMatrixConditionalFormatting,
|
|
2555
|
+
Ut as rewriteDashboardInputScopeIds,
|
|
2556
|
+
Fe as sameColumnKey,
|
|
2557
|
+
Le as sameValue,
|
|
2558
|
+
nr as selectDashboardOptionDependencyInputIds,
|
|
2559
|
+
or as selectionFieldFromExplorerField,
|
|
2560
|
+
rr as settableCardType,
|
|
2561
|
+
dr as sharedCardPreferences,
|
|
2562
|
+
fa as sqlCardQuerySchema,
|
|
2563
|
+
Ee as statedLabelsOf,
|
|
2564
|
+
lr as stripInstanceTargetsForLibrarySave,
|
|
2565
|
+
cr as structuralControlOverride,
|
|
2566
|
+
At as summarizeFilter,
|
|
2567
|
+
ur as supportsCanonicalDashboardTemporalResult,
|
|
2568
|
+
hr as timeWindowSchema,
|
|
2569
|
+
rt as toChartType,
|
|
2570
|
+
Oe as toPublicCardType,
|
|
2571
|
+
fr as toolbarFilterInputFields,
|
|
2572
|
+
pr as toolbarFilterScope,
|
|
2573
|
+
mr as transformComparisonDocument,
|
|
2574
|
+
va as updateMatrixConfig,
|
|
2575
|
+
sd as upgradeToStoredDashboard,
|
|
2576
|
+
gr as validateControlValue,
|
|
2577
|
+
Xa as validateDashboardAuthoringDatasetScope,
|
|
2578
|
+
Er as validateDashboardFilterValues,
|
|
2579
|
+
ns as validateDashboardPlan,
|
|
2580
|
+
zt as validateResolvedPrimaryDateFieldShape,
|
|
2581
|
+
br as withCardExcludedFromScope,
|
|
2582
|
+
Ir as withCardIncludedInScope,
|
|
2583
|
+
yr as withDashboardOptionDependencyOverride,
|
|
2584
|
+
na as withUnstatedScopeParts,
|
|
2585
|
+
Gt as withoutToolbarFilterReachFields
|
|
1854
2586
|
};
|