react-semaphor 0.1.514 → 0.1.516
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.cjs +1 -1
- package/dist/analytics-protocol/index.js +226 -225
- package/dist/brand-studio/index.cjs +1 -1
- package/dist/brand-studio/index.js +4 -4
- package/dist/briefings/index.cjs +1 -1
- package/dist/briefings/index.js +8 -8
- package/dist/chunks/{calculated-field-identity-BiTGmnST.cjs → calculated-field-identity-5bg9oHTw.cjs} +1 -1
- package/dist/chunks/{calculated-field-identity-DnRd4YIY.js → calculated-field-identity-DzJBs2J8.js} +4 -4
- package/dist/chunks/{card-config-utils-B2cDWQqB.js → card-config-utils-Cxnq2R6z.js} +14 -14
- package/dist/chunks/{card-config-utils-CMO4_zVs.cjs → card-config-utils-z86y6tSq.cjs} +1 -1
- package/dist/chunks/column-bands-CU0byntA.cjs +1 -0
- package/dist/chunks/column-bands-RdM-kjDe.js +47 -0
- package/dist/chunks/{dashboard-briefing-launcher-e3s3MuSs.js → dashboard-briefing-launcher-BCEHJ_eD.js} +15 -12
- package/dist/chunks/{dashboard-briefing-launcher-BzPD50QD.cjs → dashboard-briefing-launcher-CjZ4aE34.cjs} +2 -2
- package/dist/chunks/{dashboard-controls-DAOABnks.js → dashboard-controls-DFfit5KH.js} +12 -12
- package/dist/chunks/{dashboard-controls-DQBfOqmC.cjs → dashboard-controls-f9aJ70Zu.cjs} +1 -1
- package/dist/chunks/{dashboard-date-comparison-definition-D7Bl-YAl.js → dashboard-date-comparison-definition-BqNhECUr.js} +6 -6
- package/dist/chunks/{dashboard-date-comparison-definition-C_w-GO_5.cjs → dashboard-date-comparison-definition-Y6JZwpcr.cjs} +1 -1
- package/dist/chunks/{dashboard-json-S5Eq2GAg.js → dashboard-json-DVtcA02f.js} +7 -7
- package/dist/chunks/{dashboard-json-1jZycd5h.cjs → dashboard-json-deqQC-UR.cjs} +1 -1
- package/dist/chunks/edit-dashboard-visual-DK6lSC_p.cjs +172 -0
- package/dist/chunks/{edit-dashboard-visual-Bkm0ciHG.js → edit-dashboard-visual-lJ6rDH3w.js} +4553 -4542
- package/dist/chunks/{editor-action-buttons-Bvv16QA-.js → editor-action-buttons-Bnxxa439.js} +7 -7
- package/dist/chunks/{editor-action-buttons-B2NCSsDw.cjs → editor-action-buttons-CmDaQbPN.cjs} +1 -1
- package/dist/chunks/{field-aggregations-CzuQKtqx.js → field-aggregations-Dl2A3rbV.js} +461 -358
- package/dist/chunks/field-aggregations-pH_3kymD.cjs +1 -0
- package/dist/chunks/{field-dependencies-DIab72rQ.cjs → field-dependencies-EB485TdB.cjs} +1 -1
- package/dist/chunks/{field-dependencies-DXW4jtvJ.js → field-dependencies-v-lJNzC7.js} +1 -1
- package/dist/chunks/{index-nhUr9xBz.js → index-BVVl2JDK.js} +57955 -54696
- package/dist/chunks/{index-CACdoqu3.js → index-C8w91oj4.js} +61 -51
- package/dist/chunks/index-Cw2ypaFl.cjs +1 -0
- package/dist/chunks/index-DfqMtR9S.cjs +4 -0
- package/dist/chunks/index-UNKSfi7s.cjs +1434 -0
- package/dist/chunks/{index-CnGVjyF8.js → index-ylOpKRDu.js} +877 -849
- package/dist/chunks/{matrix-analytical-definition-Ct5Tu8np.cjs → matrix-analytical-definition-BWd159lN.cjs} +1 -1
- package/dist/chunks/{matrix-analytical-definition-BDAK2aEi.js → matrix-analytical-definition-BimC4XIV.js} +1 -1
- package/dist/chunks/{matrix-card-U4c72doZ.cjs → matrix-card-C2RjEYZ8.cjs} +1 -1
- package/dist/chunks/{matrix-card-DOIeTmjh.js → matrix-card-CIlz0Dnp.js} +2 -2
- package/dist/chunks/{matrix-control-sources-FjxGIbqk.cjs → matrix-control-sources-BvEJF7d3.cjs} +1 -1
- package/dist/chunks/{matrix-control-sources-BxKH2yu2.js → matrix-control-sources-KbZe1gj_.js} +51 -51
- package/dist/chunks/{matrix-definition-CBJW_4ii.cjs → matrix-definition-DanUT11P.cjs} +1 -1
- package/dist/chunks/{matrix-definition-I9rHB9zN.js → matrix-definition-E5gXXSTZ.js} +1 -1
- package/dist/chunks/matrix-formatter-BJTO8ky9.cjs +1 -0
- package/dist/chunks/matrix-formatter-CCXNRt3s.js +341 -0
- package/dist/chunks/{matrix-member-presentation-DO1VSqfh.js → matrix-member-presentation-Bw7-JCrr.js} +64 -64
- package/dist/chunks/matrix-member-presentation-DvXDEo0U.cjs +1 -0
- package/dist/chunks/{matrix-operation-contract-DoiWTUbT.cjs → matrix-operation-contract-0RxoU_M3.cjs} +1 -1
- package/dist/chunks/{matrix-operation-contract-D0HfzwZg.js → matrix-operation-contract-D32U2CSw.js} +19 -19
- package/dist/chunks/{metric-comparison-Dqc7_tnW.js → metric-comparison-BphoJ9bq.js} +1 -1
- package/dist/chunks/{metric-comparison-DBQ3EJTz.cjs → metric-comparison-CUmltzpz.cjs} +1 -1
- package/dist/chunks/pivot-header-presentation-BSZhB1g-.js +661 -0
- package/dist/chunks/pivot-header-presentation-EoUS5ze5.cjs +5 -0
- package/dist/chunks/{pivot-result-identity-8M-bZrw9.js → pivot-result-identity-BzUQiCEV.js} +4 -4
- package/dist/chunks/{pivot-result-identity-uTiylUNr.cjs → pivot-result-identity-gquWljbd.cjs} +1 -1
- package/dist/chunks/pivot-result-lifecycle-gl9cBfB-.cjs +1 -0
- package/dist/chunks/{pivot-result-lifecycle-BeOpjAhg.js → pivot-result-lifecycle-kRhiJkzg.js} +208 -149
- package/dist/chunks/{raw-temporal-DrmCX9Wq.js → raw-temporal-BqOfk-xN.js} +471 -361
- package/dist/chunks/{raw-temporal-contract-CFLGwTiI.js → raw-temporal-contract-BQZIJ1fn.js} +1 -1
- package/dist/chunks/{raw-temporal-contract-DECbTuzA.cjs → raw-temporal-contract-CklMVG_1.cjs} +1 -1
- package/dist/chunks/raw-temporal-eJXecCyJ.cjs +1 -0
- package/dist/chunks/{report-preferences-dialog-B2fzQH1T.js → report-preferences-dialog-CHXPEl7v.js} +6 -6
- package/dist/chunks/{report-preferences-dialog-DcLkVqni.cjs → report-preferences-dialog-Cto0vDwI.cjs} +1 -1
- package/dist/chunks/{report-runtime-context-Cs65Mrxj.js → report-runtime-context-CxIoGyNM.js} +1 -1
- package/dist/chunks/{report-runtime-context-DzvHBPxl.cjs → report-runtime-context-CzSrCBsu.cjs} +1 -1
- package/dist/chunks/{selection-reducer-BIiQXbGM.js → selection-reducer-CvCBQbl2.js} +1 -1
- package/dist/chunks/{selection-reducer-CGKKsaPa.cjs → selection-reducer-Kl22OzIk.cjs} +1 -1
- package/dist/chunks/{semantic-format-BZxJLKvw.js → semantic-format-DwqGYx4V.js} +25 -31
- package/dist/chunks/semantic-format-mVI32OJH.cjs +1 -0
- package/dist/chunks/{source-entity-resolution-D7vnmDwm.js → source-entity-resolution-Bzefiive.js} +7 -7
- package/dist/chunks/{source-entity-resolution-CjbgnwyX.cjs → source-entity-resolution-R46X34SE.cjs} +1 -1
- package/dist/chunks/switch-DNbWXEOP.cjs +134 -0
- package/dist/chunks/{switch-QfKb0Iwe.js → switch-DNv-hVmt.js} +8260 -7659
- package/dist/chunks/{temporal-bucket-B9hMwemw.js → temporal-bucket-DlFuhCnT.js} +6 -6
- package/dist/chunks/{temporal-bucket-contract-IWDgyTMw.js → temporal-bucket-contract-DTLDRzgV.js} +1 -1
- package/dist/chunks/{temporal-bucket-contract-ZctiyXYk.cjs → temporal-bucket-contract-nTv6gvX5.cjs} +1 -1
- package/dist/chunks/{token-types-Dl0hcKBX.js → token-types-BC6RcUY8.js} +1 -1
- package/dist/chunks/{token-types-Ahh5u4iT.cjs → token-types-aWrzwonf.cjs} +1 -1
- package/dist/chunks/{update-policy-COjFudhl.cjs → update-policy-DRDLWe7Y.cjs} +1 -1
- package/dist/chunks/{update-policy-BeQqjupC.js → update-policy-DhAUtiC8.js} +2 -2
- package/dist/chunks/{validators-CkHsAvwB.js → validators-CsdOtZI6.js} +411 -397
- package/dist/chunks/validators-DFeDcdpA.cjs +1 -0
- package/dist/dashboard/index.cjs +1 -1
- package/dist/dashboard/index.js +1 -1
- package/dist/dashboard-authoring/index.cjs +3 -3
- package/dist/dashboard-authoring/index.js +233 -227
- package/dist/data-app-builder/index.cjs +1 -1
- package/dist/data-app-builder/index.js +3 -3
- package/dist/data-app-codegen/index.cjs +1 -1
- package/dist/data-app-codegen/index.js +2 -2
- package/dist/data-app-codegen-node/index.cjs +1 -1
- package/dist/data-app-codegen-node/index.js +3 -3
- package/dist/data-app-sdk/index.cjs +1 -1
- package/dist/data-app-sdk/index.js +5 -5
- package/dist/data-app-sdk-adapters/index.cjs +1 -1
- package/dist/data-app-sdk-adapters/index.js +2 -2
- package/dist/data-app-sdk-validation/index.cjs +1 -1
- package/dist/data-app-sdk-validation/index.js +5 -5
- package/dist/format-utils/index.cjs +3 -3
- package/dist/format-utils/index.js +291 -397
- package/dist/index.cjs +1 -1
- package/dist/index.js +15 -15
- package/dist/pdf-table-layout/index.cjs +1 -0
- package/dist/pdf-table-layout/index.js +993 -0
- package/dist/report-runtime-context/index.cjs +1 -1
- package/dist/report-runtime-context/index.js +2 -2
- package/dist/style.css +1 -1
- package/dist/surfboard/index.cjs +1 -1
- package/dist/surfboard/index.js +2 -2
- package/dist/types/briefings/index.d.ts +1 -1
- package/dist/types/components/document-sheet/document-input-bar.d.ts +1 -3
- package/dist/types/components/document-sheet/document-insert-picker.d.ts +37 -0
- package/dist/types/components/document-sheet/document-kpi-section.d.ts +17 -0
- package/dist/types/components/document-sheet/document-matrix-layout-context.d.ts +10 -0
- package/dist/types/components/document-sheet/document-matrix-section.d.ts +27 -0
- package/dist/types/components/document-sheet/document-measure-layer.d.ts +45 -0
- package/dist/types/components/document-sheet/document-outline.d.ts +7 -1
- package/dist/types/components/document-sheet/document-page-navigation.d.ts +22 -0
- package/dist/types/components/document-sheet/document-page.d.ts +9 -5
- package/dist/types/components/document-sheet/document-panel/document-side-panel.d.ts +36 -0
- package/dist/types/components/document-sheet/document-panel/inputs-panel.d.ts +9 -0
- package/dist/types/components/document-sheet/document-panel/page-panel.d.ts +5 -0
- package/dist/types/components/document-sheet/document-panel/panel-controls.d.ts +14 -0
- package/dist/types/components/document-sheet/document-panel/region-panels.d.ts +11 -0
- package/dist/types/components/document-sheet/document-panel/section-panel.d.ts +25 -0
- package/dist/types/components/document-sheet/document-section-print-boundary.d.ts +9 -0
- package/dist/types/components/document-sheet/document-table-chrome.d.ts +22 -0
- package/dist/types/components/document-sheet/document-table-section.d.ts +3 -7
- package/dist/types/components/document-sheet/document-text-preview-context.d.ts +8 -0
- package/dist/types/components/document-sheet/use-first-fitting-variant.d.ts +18 -0
- package/dist/types/components/editor/editor-main/dashboard-variable-node.d.ts +12 -2
- package/dist/types/components/explorer/chart-configuration/matrix-authoring-controls.d.ts +7 -2
- package/dist/types/components/text-variables/variable-chip-plugin.d.ts +23 -0
- package/dist/types/components/text-variables/variable-chip.d.ts +18 -0
- package/dist/types/components/text-variables/variable-picker.d.ts +27 -0
- package/dist/types/components/visual/aggregated-table/utils/metric-format-resolver.d.ts +3 -3
- package/dist/types/components/visual/data-table/types/data-table.d.ts +4 -1
- package/dist/types/components/visual/pivot-table/utils/pivot-metric-formatting.d.ts +2 -2
- package/dist/types/components/visual/settings/table-presentation-settings.d.ts +27 -1
- package/dist/types/index.cjs +1 -1
- package/dist/types/index.js +5 -5
- package/dist/types/lib/dashboard-inputs/text-variable-options.d.ts +15 -0
- package/dist/types/lib/document/document-canvas-actions.d.ts +22 -0
- package/dist/types/lib/document/document-edits.d.ts +119 -0
- package/dist/types/lib/document/document-kpi-figure.d.ts +27 -0
- package/dist/types/lib/document/document-kpi-layout.d.ts +29 -0
- package/dist/types/lib/document/document-kpi-section-edits.d.ts +15 -0
- package/dist/types/lib/document/document-matrix-bands.d.ts +66 -0
- package/dist/types/lib/document/document-matrix-print.d.ts +11 -0
- package/dist/types/lib/document/document-pagination.d.ts +56 -3
- package/dist/types/lib/document/document-panel-target.d.ts +19 -0
- package/dist/types/lib/document/document-section-editor.d.ts +8 -7
- package/dist/types/lib/document/document-section-kinds.d.ts +49 -0
- package/dist/types/lib/document/document-section-query-options.d.ts +25 -0
- package/dist/types/lib/document/document-section-render-state.d.ts +26 -0
- package/dist/types/lib/document/document-section-utils.d.ts +11 -4
- package/dist/types/lib/document/document-table-dom.d.ts +4 -6
- package/dist/types/lib/document/document-table-pagination-model.d.ts +0 -5
- package/dist/types/lib/document/document-table-print-model.d.ts +4 -3
- package/dist/types/lib/document/document-table-style.d.ts +15 -4
- package/dist/types/lib/document/document-table-surface.d.ts +15 -0
- package/dist/types/lib/document/document-variables.d.ts +40 -6
- package/dist/types/lib/document/use-document-section-data.d.ts +39 -0
- package/dist/types/lib/document/use-measured-document-table-layout.d.ts +50 -0
- package/dist/types/lib/formatters/kpi-result-values.d.ts +20 -0
- package/dist/types/lib/formatters/metric-formatting.d.ts +3 -3
- package/dist/types/lib/hooks/query-context/use-dashboard-card-execution-snapshot.d.ts +8 -2
- package/dist/types/lib/hooks/use-dashboard-frame-query.d.ts +6 -0
- package/dist/types/lib/hooks/use-dashboard-kpi-actions.d.ts +1 -1
- package/dist/types/lib/hooks/use-document-section-editor.d.ts +2 -2
- package/dist/types/lib/hooks/use-document-section-session.d.ts +36 -0
- package/dist/types/lib/hooks/use-editor-preview.d.ts +17 -0
- package/dist/types/lib/hooks/use-is-editing-card.d.ts +7 -0
- package/dist/types/lib/matrix-table/matrix-card-adapter.d.ts +2 -0
- package/dist/types/lib/matrix-table/matrix-card-draft.d.ts +2 -0
- package/dist/types/lib/matrix-table/matrix-delivery.d.ts +4 -0
- package/dist/types/lib/matrix-table/matrix-layout-read.d.ts +68 -0
- package/dist/types/lib/query-context/build-dashboard-execution-snapshot.d.ts +8 -1
- package/dist/types/lib/query-context/build-dashboard-frame-base-query-contexts.d.ts +4 -2
- package/dist/types/lib/query-context/card-execution.d.ts +30 -0
- package/dist/types/lib/query-context/document-section-card-query.d.ts +37 -0
- package/dist/types/lib/stores/dashboard-store.d.ts +12 -8
- package/dist/types/lib/stores/editor-store.d.ts +2 -0
- package/dist/types/lib/table-formatting/table-presentation-fields.d.ts +1 -0
- package/dist/types/lib/text-variables/text-variable-types.d.ts +39 -0
- package/dist/types/lib/types/common-types.d.ts +34 -1
- package/dist/types/lib/utils/card-definition.d.ts +2 -0
- package/dist/types/lib/utils/card-utils.d.ts +13 -6
- package/dist/types/lib/utils/date-timezone-utils.d.ts +26 -4
- package/dist/types/pdf-table-layout.d.ts +2 -0
- package/dist/types/shared/analytics-protocol/index.d.ts +1 -1
- package/dist/types/shared/analytics-protocol/matrix-definition-contract.d.ts +45 -0
- package/dist/types/shared/analytics-protocol/matrix-member-presentation.d.ts +4 -0
- package/dist/types/shared/dashboard-authoring/document-section-cards.d.ts +56 -0
- package/dist/types/shared/dashboard-authoring/index.d.ts +1 -0
- package/dist/types/shared/dashboard-authoring/matrix-delivery.d.ts +36 -1
- package/dist/types/shared/format-utils/formatters/duration-formatter.d.ts +4 -1
- package/dist/types/shared/format-utils/formatters/index.d.ts +2 -2
- package/dist/types/shared/format-utils/formatters/matrix-formatter.d.ts +5 -0
- package/dist/types/shared/format-utils/formatters/number-formatter.d.ts +8 -2
- package/dist/types/shared/format-utils/index.d.ts +1 -0
- package/dist/types/shared/format-utils/matrix-export-presentation.d.ts +690 -1
- package/dist/types/shared/format-utils/matrix-print.d.ts +38 -0
- package/dist/types/shared/format-utils/pdf-table-layout/column-bands.d.ts +55 -0
- package/dist/types/shared/format-utils/pdf-table-layout/index.d.ts +6 -0
- package/dist/types/shared/format-utils/pdf-table-layout/page-size.d.ts +7 -0
- package/dist/types/shared/format-utils/pdf-table-layout/table-column-semantics.d.ts +106 -0
- package/dist/types/shared/format-utils/pdf-table-layout/table-column-widths.d.ts +13 -0
- package/dist/types/shared/format-utils/pdf-table-layout/table-page-geometry.d.ts +19 -0
- package/dist/types/shared/format-utils/pdf-table-layout/wide-table-layout.d.ts +46 -0
- package/dist/types/shared/format-utils/presentation-execution.d.ts +17 -2
- package/dist/types/shared/format-utils/table-structure.d.ts +9 -0
- package/dist/types/shared/format-utils/types/format-types.d.ts +16 -1
- package/package.json +6 -1
- package/dist/chunks/edit-dashboard-visual-BwJ2Eljw.cjs +0 -172
- package/dist/chunks/field-aggregations-jSi77h9Z.cjs +0 -1
- package/dist/chunks/index-DhlVxvyI.cjs +0 -4
- package/dist/chunks/index-DrOFJOCq.cjs +0 -1424
- package/dist/chunks/index-F25jnH0p.cjs +0 -1
- package/dist/chunks/matrix-formatter-BLunke3R.js +0 -424
- package/dist/chunks/matrix-formatter-CveLJo6S.cjs +0 -1
- package/dist/chunks/matrix-member-presentation-CFHjdrxT.cjs +0 -1
- package/dist/chunks/pivot-header-presentation-Cxz8-06f.cjs +0 -5
- package/dist/chunks/pivot-header-presentation-Dm9dUQsl.js +0 -415
- package/dist/chunks/pivot-result-lifecycle-BiERyXnS.cjs +0 -1
- package/dist/chunks/raw-temporal-BUeTpG76.cjs +0 -1
- package/dist/chunks/semantic-format-BzH69TRq.cjs +0 -1
- package/dist/chunks/switch--Re1K566.cjs +0 -134
- package/dist/chunks/validators-DVYAnnX0.cjs +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),p=require("react"),An=require("react-dom/client"),k=require("../chunks/index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),p=require("react"),An=require("react-dom/client"),k=require("../chunks/index-UNKSfi7s.cjs"),w=require("../chunks/switch-DNbWXEOP.cjs"),Ze=require("../data-app-builder-browser-runtime/index.cjs"),te=require("../chunks/x-B6ghREd2.cjs"),Cn=require("../chunks/save-3dYRmehL.cjs"),Rn=require("../chunks/mouse-pointer-2-DX4A_XZw.cjs"),tt=require("../chunks/selection-reducer-Kl22OzIk.cjs");function Tr(t){const s=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const a in t)if(a!=="default"){const d=Object.getOwnPropertyDescriptor(t,a);Object.defineProperty(s,a,d.get?d:{enumerable:!0,get:()=>t[a]})}}return s.default=t,Object.freeze(s)}const Bn=Tr(p),Dn=Tr(An);/**
|
|
2
2
|
* @license lucide-react v0.453.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -2,13 +2,13 @@ import { jsx as r, jsxs as c, Fragment as re } from "react/jsx-runtime";
|
|
|
2
2
|
import * as Zn from "react";
|
|
3
3
|
import { useContext as qn, useState as x, useRef as oe, useMemo as je, useEffect as W, useCallback as Ot } from "react";
|
|
4
4
|
import * as Xn from "react-dom/client";
|
|
5
|
-
import { aL as ea, aM as ta, aN as Ir, aO as jr, aP as zr, aQ as ra, aR as Wr, aS as Hr, aT as Jr, aU as Vr, aV as _r, aW as Ur, aX as Gr, aY as na, aZ as aa, a_ as oa, a$ as Ht, b0 as on, R as Kr, b1 as sa, b2 as Vt, b3 as sn, b4 as ia, b5 as la } from "../chunks/index-
|
|
6
|
-
import { B as H, P as it, a as lt, b as dt, _ as da, $ as ca, a0 as ua, a1 as pa, a2 as ha, L as me, R as ma, d as _t } from "../chunks/switch-
|
|
5
|
+
import { aL as ea, aM as ta, aN as Ir, aO as jr, aP as zr, aQ as ra, aR as Wr, aS as Hr, aT as Jr, aU as Vr, aV as _r, aW as Ur, aX as Gr, aY as na, aZ as aa, a_ as oa, a$ as Ht, b0 as on, R as Kr, b1 as sa, b2 as Vt, b3 as sn, b4 as ia, b5 as la } from "../chunks/index-BVVl2JDK.js";
|
|
6
|
+
import { B as H, P as it, a as lt, b as dt, _ as da, $ as ca, a0 as ua, a1 as pa, a2 as ha, L as me, R as ma, d as _t } from "../chunks/switch-DNv-hVmt.js";
|
|
7
7
|
import { loadSemaphorBrowserRuntime as ot } from "../data-app-builder-browser-runtime/index.js";
|
|
8
8
|
import { c as Ve, X as He } from "../chunks/x-CXDkqdur.js";
|
|
9
9
|
import { S as fa } from "../chunks/save-DgMfP0j8.js";
|
|
10
10
|
import { M as ga } from "../chunks/mouse-pointer-2-BZvGk45-.js";
|
|
11
|
-
import { C as Ut, S as ba } from "../chunks/selection-reducer-
|
|
11
|
+
import { C as Ut, S as ba } from "../chunks/selection-reducer-CvCBQbl2.js";
|
|
12
12
|
/**
|
|
13
13
|
* @license lucide-react v0.453.0 - ISC
|
|
14
14
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("../chunks/matrix-operation-contract-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("../chunks/matrix-operation-contract-0RxoU_M3.cjs"),e=require("../chunks/update-policy-DRDLWe7Y.cjs");exports.SEMAPHOR_DATA_APP_CODEGEN_SUMMARY_SCHEMA_VERSION=a.SEMAPHOR_DATA_APP_CODEGEN_SUMMARY_SCHEMA_VERSION;exports.SEMAPHOR_DATA_APP_CODEGEN_SUMMARY_VALIDATOR_VERSION=a.SEMAPHOR_DATA_APP_CODEGEN_SUMMARY_VALIDATOR_VERSION;exports.isSemaphorDataAppCodegenSummary=a.isSemaphorDataAppCodegenSummary;exports.validateSemaphorDataAppCodegenSummary=a.validateSemaphorDataAppCodegenSummary;exports.CODEGEN_SUMMARY_SCHEMA_VERSION=e.CODEGEN_SUMMARY_SCHEMA_VERSION;exports.CODEGEN_SUMMARY_VALIDATOR_VERSION=e.CODEGEN_SUMMARY_VALIDATOR_VERSION;exports.CONTRACT_MANIFEST_SCHEMA_VERSION=e.CONTRACT_MANIFEST_SCHEMA_VERSION;exports.GENERATED_CONTRACT_SCHEMA_VERSION=e.GENERATED_CONTRACT_SCHEMA_VERSION;exports.GENERATED_CONTRACT_TYPESCRIPT_FILES=e.GENERATED_CONTRACT_TYPESCRIPT_FILES;exports.REQUIRED_GENERATED_CONTRACT_FILES=e.REQUIRED_GENERATED_CONTRACT_FILES;exports.assertValidCodegenSummary=e.assertValidCodegenSummary;exports.buildSemaphorGeneratedActiveInput=e.buildSemaphorGeneratedActiveInput;exports.buildSemaphorGeneratedInputOptionIntent=e.buildSemaphorGeneratedInputOptionIntent;exports.buildSemaphorGeneratedViewExecutionRequest=e.buildSemaphorGeneratedViewExecutionRequest;exports.buildSemaphorGeneratedViewExecutionRequests=e.buildSemaphorGeneratedViewExecutionRequests;exports.evaluateSemaphorDataAppContractUpdatePolicy=e.evaluateSemaphorDataAppContractUpdatePolicy;exports.validateCodegenSummary=e.validateCodegenSummary;exports.validateSemaphorGeneratedContract=e.validateSemaphorGeneratedContract;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { S as E, a as S, i as A, v as t } from "../chunks/matrix-operation-contract-
|
|
2
|
-
import { C as R, a as r, b as s, G as C, e as o, R as p, c as d, f as O, g as i, h as m, i as n, j as N, v as T, d as I } from "../chunks/update-policy-
|
|
1
|
+
import { S as E, a as S, i as A, v as t } from "../chunks/matrix-operation-contract-D32U2CSw.js";
|
|
2
|
+
import { C as R, a as r, b as s, G as C, e as o, R as p, c as d, f as O, g as i, h as m, i as n, j as N, v as T, d as I } from "../chunks/update-policy-DhAUtiC8.js";
|
|
3
3
|
export {
|
|
4
4
|
R as CODEGEN_SUMMARY_SCHEMA_VERSION,
|
|
5
5
|
r as CODEGEN_SUMMARY_VALIDATOR_VERSION,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Y=require("../chunks/matrix-operation-contract-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Y=require("../chunks/matrix-operation-contract-0RxoU_M3.cjs"),C=require("../chunks/update-policy-DRDLWe7Y.cjs"),he=require("node:crypto"),Ce="src/semaphor/generated",H=`// Generated by Semaphor Agent Plugin. Do not hand-edit analytics wiring here.
|
|
2
2
|
// Regenerate from the accepted semaphor_plan_data_app codegenSummary when the plan changes.
|
|
3
3
|
`;function Oe(e,n={}){C.assertValidCodegenSummary(e);const r=Me(e);if(r.views.length===0&&!n.allowEmpty)throw new Error("Contract generation produced zero executable views. Stop and ask for a different domain/goal or semantic model improvement; pass --allow-empty only for an explicit model-gap report.");const t=ke(r),o=Ne({contract:r,files:t,generatorName:n.generatorName||"react-semaphor/data-app-codegen/node",generatorVersion:n.generatorVersion||"unknown"}),a={...t,"contract.manifest.json":`${JSON.stringify(o,null,2)}
|
|
4
4
|
`};return{schemaVersion:C.GENERATED_CONTRACT_SCHEMA_VERSION,files:a,manifest:o,contentHash:String(o.generatedContentHash||""),usageExample:Te(r),warnings:r.warnings,stats:{inputCount:r.inputs.length,executableViewCount:r.views.length,presentationViewCount:r.presentationViews.length,queryCount:r.views.length,optionQueryCount:r.optionQueries.length}}}function Me(e){var d,l,m,i,c,h,y,V,w,O,R,k;const n=[],r=[];for(const s of e.inputs){g(r,s.fieldRef);for(const I of s.bindings||[])g(r,I.fieldRef);g(r,(d=s.optionQuery)==null?void 0:d.valueFieldRef),g(r,(l=s.optionQuery)==null?void 0:l.labelFieldRef),g(r,(m=s.optionQuery)==null?void 0:m.filterFieldRef),D(r,(i=s.optionQuery)==null?void 0:i.spec)}for(const s of e.filterContracts){g(r,s.fieldRef),g(r,(c=s.optionQuery)==null?void 0:c.valueFieldRef),g(r,(h=s.optionQuery)==null?void 0:h.labelFieldRef),g(r,(y=s.optionQuery)==null?void 0:y.filterFieldRef),D(r,(V=s.optionQuery)==null?void 0:V.spec);for(const I of s.bindings||[])g(r,I.fieldRef)}for(const s of e.views){for(const I of s.fields||[])g(r,I);D(r,(w=s.sdkSpec)==null?void 0:w.spec),D(r,s.visualSpec)}const t=e.implementationChecklist||{};for(const s of Object.values(t.bindingsByView||{}))for(const I of Array.isArray(s)?s:[])g(r,I.fieldRef),g(r,I.optionValueField),g(r,I.optionLabelField);for(const s of t.requiredInputOptions||[])g(r,s.visibleLabelField),g(r,s.optionValueField),g(r,s.runtimeFilterField);const o=pn([...e.sources.map(s=>({raw:s,key:Ie(s),aliases:Ve(s),name:""})),...r.map(s=>an(s)).filter(x)]);B(o,s=>{const I=b(s.raw);return q(s.raw.label||(I==null?void 0:I.datasetName)||(I==null?void 0:I.datasetId)||(I==null?void 0:I.name)||s.raw.kind||"source")});const a=ln(o),u=ne(r.filter(s=>s.name).map(s=>({raw:s,key:X(s),name:""})),s=>s.key);B(u,s=>q([s.raw.sourceKey?yn(s.raw.sourceKey):"",s.raw.aggregate?s.raw.aggregate.toLowerCase():"",s.raw.name].filter(Boolean).join("_")));const p=new Map(u.map(s=>[s.key,s.name])),S=e.inputs.map(s=>({raw:s,name:q(s.id||s.label||"input")}));B(S,s=>s.name);const f=S.filter(s=>!!s.raw.optionQuery).map(s=>({input:s,name:`${s.name}Options`,raw:s.raw.optionQuery}));B(f,s=>s.name);for(const s of f)un(s.raw.labelFieldRef,s.raw.valueFieldRef)&&dn(s.raw.valueFieldRef)&&n.push(`Input option query ${((O=s.raw.spec)==null?void 0:O.inputId)||s.input.raw.id||s.name} uses identifier field ${s.raw.valueFieldRef.name} as both label and value. It can execute, but the UI will show key values unless the semantic model exposes a human-readable label through a modeled relationship.`);const $=e.views.filter(s=>{var I,K;return!!((I=s.sdkSpec)!=null&&I.builder&&((K=s.sdkSpec)!=null&&K.spec))}).map(s=>({raw:s,name:q(s.id||s.title||"query")}));B($,s=>s.name);const F=e.views.filter(s=>fe(s)&&!("sdkSpec"in s)).map(s=>sn(s));for(const s of e.views)(!("sdkSpec"in s)||!((R=s.sdkSpec)!=null&&R.builder)||!((k=s.sdkSpec)!=null&&k.spec))&&!fe(s)&&n.push(`Skipped view ${s.id||s.title||"unknown"} because it has no sdkSpec.`);return Ee({inputs:S,views:$,filterContracts:e.filterContracts}),{summary:e,title:e.title||"Semaphor Data App",sources:o,fields:u,inputs:S,optionQueries:f,views:$,presentationViews:F,filterContracts:e.filterContracts,checklist:t,sourceNameByKey:a,fieldNameByKey:p,warnings:n}}function Ee({inputs:e,views:n,filterContracts:r}){const t=new Set(e.map(a=>a.raw.id).filter(Boolean)),o=new Set(n.map(a=>a.raw.id).filter(Boolean));for(const[a,u]of r.entries()){if(!t.has(u.inputId))throw new Error(`filterContracts.${a}.inputId must reference a generated input.`);const p=new Set(u.appliesToViewIds||[]),S=new Set(u.notAppliedToViewIds||[]);for(const[f,$]of(u.appliesToViewIds||[]).entries())if(!o.has($))throw new Error(`filterContracts.${a}.appliesToViewIds.${f} must reference an executable generated view.`);for(const[f,$]of(u.notAppliedToViewIds||[]).entries())if(!o.has($))throw new Error(`filterContracts.${a}.notAppliedToViewIds.${f} must reference an executable generated view.`);for(const[f,$]of(u.bindings||[]).entries()){if(!o.has($.viewId))throw new Error(`filterContracts.${a}.bindings.${f}.viewId must reference an executable generated view.`);if(!p.has($.viewId))throw new Error(`filterContracts.${a}.bindings.${f}.viewId must be included in appliesToViewIds.`);if(S.has($.viewId))throw new Error(`filterContracts.${a}.bindings.${f}.viewId must not be listed in notAppliedToViewIds.`)}}}function ke(e){return{"sources.ts":ve(e),"fields.ts":je(e),"inputs.ts":De(e),"queries.ts":Be(e),"bindings.ts":Le(e),"accessors.ts":Ye(e),"metadata.ts":We(e),"index.ts":Xe(),"USAGE.md":Ae(e)}}function Ne({contract:e,files:n,generatorName:r,generatorVersion:t}){return{schemaVersion:C.CONTRACT_MANIFEST_SCHEMA_VERSION,generatedContractSchemaVersion:C.GENERATED_CONTRACT_SCHEMA_VERSION,generator:{name:r,version:t},generatedContentHash:Ge(n),codegenSummaryValidatorVersion:C.CODEGEN_SUMMARY_VALIDATOR_VERSION,codegenSummaryHash:xe(e.summary),codegenSummary:e.summary}}function Ge(e){const n=he.createHash("sha256");for(const r of Object.keys(e).filter(t=>t.endsWith(".ts")).sort())n.update(r),n.update("\0"),n.update(e[r]),n.update("\0");return`sha256:${n.digest("hex")}`}function Ae(e){const n=["# Semaphor Generated Data App Contract","","Generated files in this directory are governed Semaphor analytics wiring. Do not hand-edit them.","","Use the app-facing exports from `index.ts`:","","- `queries`: generated governed query factories.","- `queryOptionsForView`: scalar-input and explicit selection wiring for each generated view.","- `rowsForView`: table/records row readers.","- `rowValuesForView`: friendly row object readers for chart/table views.","- `metricValuesForView`: friendly metric-value readers.","- `kpiPropsForView`: KPI component props derived from runtime metric results.","- `roleValuesForView`: canonical dimension/measure/date/id role readers.","- `appInputSpecs`: generated input/filter specs.","- `inputOptionQueries`: option-list query factories for generated inputs.","- `semaphorGeneratedContractMetadata`: generated view/input metadata and presentation-only views.","","Start with these exports before opening large generated internals such as `metadata.ts`.","","For click-to-filter behavior, create one `semaphor.selection({ id, fields })` per source chart, call `useSemaphorSelection`, render its tuples as removable chips in app code, and pass the target view's selection handles as the second argument to `queryOptionsForView.<view>(inputHandles, selections)`. Do not mix selection handles into `appInputSpecs` or scalar input arrays.",""];return e.views.length>0&&(n.push("Generated executable views:"),e.views.forEach(r=>{n.push(`- \`${r.raw.id}\`: ${r.raw.title||r.name}`)}),n.push("")),e.inputs.length>0&&(n.push("Generated inputs:"),e.inputs.forEach(r=>{n.push(`- \`${r.raw.id}\`: ${r.raw.label||r.name}`)}),n.push("")),`${n.join(`
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { S as Vn, a as Fn, i as bn, v as kn } from "../chunks/matrix-operation-contract-
|
|
2
|
-
import { c as ke, G as fe, a as Re, b as Me } from "../chunks/update-policy-
|
|
3
|
-
import { C as Mn, e as Cn, R as On, f as Gn, g as xn, h as Nn, i as En, j as vn, v as An, d as Hn } from "../chunks/update-policy-
|
|
1
|
+
import { S as Vn, a as Fn, i as bn, v as kn } from "../chunks/matrix-operation-contract-D32U2CSw.js";
|
|
2
|
+
import { c as ke, G as fe, a as Re, b as Me } from "../chunks/update-policy-DhAUtiC8.js";
|
|
3
|
+
import { C as Mn, e as Cn, R as On, f as Gn, g as xn, h as Nn, i as En, j as vn, v as An, d as Hn } from "../chunks/update-policy-DhAUtiC8.js";
|
|
4
4
|
import { createHash as ye } from "node:crypto";
|
|
5
5
|
const wn = "src/semaphor/generated", H = `// Generated by Semaphor Agent Plugin. Do not hand-edit analytics wiring here.
|
|
6
6
|
// Regenerate from the accepted semaphor_plan_data_app codegenSummary when the plan changes.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const I=require("../data-app-sdk-adapters/index.cjs"),i=require("react/jsx-runtime"),u=require("react"),M=require("../chunks/validators-DVYAnnX0.cjs"),N=require("../chunks/matrix-operation-contract-DoiWTUbT.cjs"),tr=require("../chunks/matrix-formatter-CveLJo6S.cjs"),P=require("../chunks/selection-reducer-CGKKsaPa.cjs"),We=require("../chunks/x-B6ghREd2.cjs");function pe(e,r,t){return{...t,name:e,role:r}}function Vr(e){return e}function Qr(e){return e}const Ur={source:{semantic(e){return{...e,kind:"semantic"}},sql(e){return{...e,kind:"sql"}}},field:{measure(e,r={}){return pe(e,"measure",r)},dimension(e,r={}){return pe(e,"dimension",r)},date(e,r={}){return pe(e,"date",r)},id(e,r={}){return pe(e,"id",r)}},filter(e){return{...e,kind:"filter"}},selection(e){return{...e,kind:"selection"}},bindInput(e,r){return{toAnalyticsInput(){const[t]=I.toSemaphorInputSnapshots([e]),n=I.toSemaphorInputBinding({...r,inputId:r.inputId||t.inputId});return{...t,inputId:n.inputId,...n.kind?{kind:n.kind}:{},...n.controlRole?{controlRole:n.controlRole}:{},...n.operator?{operator:n.operator}:{},...n.field?{field:n.field}:{},...n.relationshipHint?{relationshipHint:n.relationshipHint}:{}}}}},control(e){return{...e,kind:"control"}},sqlParam(e){return{...e,kind:"control",role:"sqlParam"}},derivedField(e){return{...e,kind:"derived_field",expressionLanguage:e.expressionLanguage||"semaphor_sql_template"}},metric(e){return{...e,queryKind:"metric"}},analysis(e){return{...e,queryKind:"analysis"}},records(e){return{...e,queryKind:"records"}},inputOptions(e){return{...e,queryKind:"inputOptions"}},sql(e){return{...e,queryKind:"sql"}},matrix(e){return{...e,queryKind:"matrix"}}},de=10,Oe=8;function Ne(e,r){const t=e==null?void 0:e.result;if(t)switch(t.kind){case"records":return ae({title:"Records",rowNoun:"rows",records:t.records,columns:t.columns,rowCount:t.rowCount});case"sql":return ae({title:"SQL Rows",rowNoun:"rows",records:t.records,columns:t.columns,rowCount:t.rowCount});case"inputOptions":return ae({title:"Options",rowNoun:"options",records:t.options.slice(0,de).map(n=>{var s;return{label:n.label,value:n.value,count:n.count,disambiguation:(s=n.disambiguation)==null?void 0:s.join(" / ")}}),columns:[{key:"label",label:"Label"},{key:"value",label:"Value"},{key:"count",label:"Count"},{key:"disambiguation",label:"Disambiguation"}],rowCount:t.rowCount??t.options.length});case"metric":return Gr(t,r);case"matrix":return ae({title:"Matrix Cells",rowNoun:"cells",records:t.window.blocks.flatMap(n=>n.cells).slice(0,de).map(n=>{const s=t.window.descriptors.measures.find(o=>o.id===n.measureId);return{row:tr.matrixMemberLabel(n.rowPath),column:tr.matrixMemberLabel(n.columnPath),measure:(s==null?void 0:s.column.label)||n.measureId,value:n.value}}),columns:[{key:"row",label:"Row"},{key:"column",label:"Column"},{key:"measure",label:"Measure"},{key:"value",label:"Value"}],rowCount:t.window.blocks.reduce((n,s)=>n+s.cells.length,0)});default:return Yr(t)}}function Gr(e,r){var o,a,p,f,c;const t=[{metric:"primaryValue",value:(r==null?void 0:r.primaryValue)??e.primaryValue}],n=(r==null?void 0:r.comparisonKind)??((o=e.comparison)==null?void 0:o.kind);return n&&t.push({metric:`${n} value`,value:(r==null?void 0:r.comparisonValue)??((a=e.comparison)==null?void 0:a.value)},{metric:"delta",value:(r==null?void 0:r.delta)??((p=e.comparison)==null?void 0:p.delta)},{metric:"deltaPercent",value:(r==null?void 0:r.deltaPercent)??((f=e.comparison)==null?void 0:f.deltaPercent)}),(((c=r==null?void 0:r.missingMeasures)==null?void 0:c.filter(Boolean))??[]).forEach(m=>{t.push({metric:`missing:${m}`,value:"missing"})}),Object.entries((r==null?void 0:r.measures)??{}).sort(([m],[g])=>m.localeCompare(g)).forEach(([m,g])=>{t.push({metric:`measure:${m}`,value:g})}),Object.entries((r==null?void 0:r.measureBindings)??{}).sort(([m],[g])=>m.localeCompare(g)).forEach(([m,g])=>{t.push({metric:`binding:${m}`,value:g})}),ae({title:"Metric",rowNoun:"values",records:t,columns:[{key:"metric",label:"Metric"},{key:"value",label:"Value"}],rowCount:t.length})}function ae({title:e,rowNoun:r,records:t,columns:n,rowCount:s}){const o=Jr(n,t);if(!o.length)return;const a=s??t.length,p=t.slice(0,de);return{title:e,summary:`${Zr(a)} ${r}`,columns:o.slice(0,Oe),rows:p,truncatedRows:a>p.length,truncatedColumns:o.length>Oe}}function Jr(e,r){if(e!=null&&e.length)return e.filter(n=>n.key).map(n=>({key:n.key,label:n.label||n.key}));const t=new Set;return r.slice(0,de).forEach(n=>{Object.keys(n).forEach(s=>t.add(s))}),[...t].map(n=>({key:n,label:n}))}function Yr(e){throw new Error(`Unhandled Semaphor result kind: ${hr(e)}`)}function Xr(e){return e===null?"null":e===void 0?"":typeof e=="string"?nr(e):typeof e=="number"||typeof e=="boolean"?String(e):nr(hr(e))}function Zr(e){return typeof e=="number"?e.toLocaleString():"-"}function hr(e){return JSON.stringify(e,null,2)??"undefined"}function nr(e){return e.length>80?`${e.slice(0,77)}...`:e}function xe(e){return e.viewTitle||e.queryLabel||e.viewId||e.queryId}function et(e){if(e.label)return e.label;if(e.queryKind!=="inputOptions")return;const t=e.labelField.label||e.valueField.label||e.labelField.name||e.valueField.name||e.inputId;return`${rt(t)} Options`}function rt(e){return(e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[_-]+/g," ").replace(/\bfilter\b/gi," ").replace(/\boptions?\b/gi," ").replace(/\bid\b/gi," ").replace(/\s+/g," ").trim()||e).split(" ").filter(Boolean).map(n=>n===n.toUpperCase()&&n.length>1?n:`${n.slice(0,1).toUpperCase()}${n.slice(1)}`).join(" ")}function _e(e){return e.flatMap(r=>{var m,g,h,x;const t=r.latestAttempt,n=t==null?void 0:t.executionResult,s=qe((m=n==null?void 0:n.validation)==null?void 0:m.warnings),o=qe((g=n==null?void 0:n.validation)==null?void 0:g.errors),a=it((h=n==null?void 0:n.coverage)==null?void 0:h.missingObligations),p=qe((x=n==null?void 0:n.coverage)==null?void 0:x.warnings),f=[],c=xe(r);(t==null?void 0:t.status)==="error"&&f.push({trace:r,tone:"error",title:c,message:t.errorMessage||"Query attempt failed."});for(const b of r.clientWarnings)f.push({trace:r,tone:"warning",title:c,message:b});for(const b of s)f.push({trace:r,tone:"warning",title:c,...b});for(const b of o)f.push({trace:r,tone:"error",title:c,...b});for(const b of a)f.push({trace:r,tone:"warning",title:c,message:b});for(const b of p)f.push({trace:r,tone:"warning",title:c,...b});return f})}function tt(e){return{traceId:e.trace.traceId,queryId:e.trace.queryId,viewId:e.trace.viewId,viewTitle:e.trace.viewTitle,queryLabel:e.trace.queryLabel,severity:e.tone,title:e.title,message:e.message,code:e.code,path:e.path}}function nt(e,r){return e.filter(t=>t.trace.traceId===r.traceId).length}function st(e){const r=_e(e),t=e.filter(a=>{var p;return((p=a.latestAttempt)==null?void 0:p.status)==="error"}).length,n=e.filter(a=>{var p;return((p=a.latestAttempt)==null?void 0:p.status)==="loading"}).length,s=r.filter(a=>a.tone==="error").length,o=r.filter(a=>a.tone==="warning").length;return{total:e.length,failed:t,loading:n,errorCount:s,warningCount:o,issueCount:r.length,severity:t||s?"error":o?"warning":n?"loading":"ok"}}function it(e){return Array.isArray(e)?e.filter(r=>typeof r=="string"):[]}function qe(e){return Array.isArray(e)?e.map(ot).filter(r=>!!r):[]}function ot(e){if(typeof e=="string")return{message:e};if(!e||typeof e!="object"||Array.isArray(e))return;const r=e,t=typeof r.message=="string"?r.message:"",n=typeof r.code=="string"?r.code:"",s=typeof r.path=="string"?r.path:"";return t&&n?{message:s?`${t} (${n}, ${s})`:`${t} (${n})`,code:n,...s?{path:s}:{}}:t?{message:t,...s?{path:s}:{}}:n?{message:n,code:n}:void 0}function at(e){if(!e.enabled)return e;const r=e.queries.map(br);return{enabled:e.enabled,queries:r,issues:e.issues,getQuery:t=>r.find(n=>n.queryId===t),getQueries:t=>r.filter(n=>n.queryId===t)}}function sr(e){return e?br(e):void 0}function br(e){var r;return(r=e==null?void 0:e.latestAttempt)!=null&&r.executionResult?{...e,latestAttempt:{...e.latestAttempt,resultPreview:e.latestAttempt.resultPreview||Ne(e.latestAttempt.executionResult),executionResult:lt(e.latestAttempt.executionResult)}}:e}function lt(e){const{compiledQuery:r,intent:t,result:n,...s}=e,o=dt(s.metadata);return{...s,...o?{metadata:o}:{}}}function dt(e){if(!e||typeof e!="object"||Array.isArray(e))return e;const r=e.dataAppDebug;if(!r||typeof r!="object"||Array.isArray(r))return e;const{compiledSql:t,...n}=r;return{...e,dataAppDebug:n}}function ut(e){return e==="relative"?{position:"relative",top:"auto",right:"auto",bottom:"auto",left:"auto"}:{top:e.startsWith("top")?20:"auto",right:e.endsWith("right")?20:"auto",bottom:e.startsWith("bottom")?20:"auto",left:e.endsWith("left")?20:"auto"}}function ct(e){return e==="error"?{borderColor:"var(--sd-error-border)",background:"var(--sd-error-bg)",color:"var(--sd-error-fg)"}:e==="warning"?{borderColor:"var(--sd-warning-border)",background:"var(--sd-warning-bg)",color:"var(--sd-warning-fg)"}:e==="loading"?{borderColor:"var(--sd-loading-border)",background:"var(--sd-loading-bg)",color:"var(--sd-loading-fg)"}:{borderColor:"var(--sd-success-border)",background:"var(--sd-success-bg)",color:"var(--sd-success-fg)"}}function ft(e){return e==="right"?{top:16,right:16,bottom:16,left:"auto",width:"min(720px, calc(100vw - 32px))",height:"auto",borderRadius:6}:{top:"auto",right:16,bottom:16,left:16,width:"auto",height:"min(420px, 45vh)",borderRadius:6}}function pt(e){return e==="right"?{gridTemplateColumns:"minmax(210px, 280px) minmax(0, 1fr)"}:{gridTemplateColumns:"minmax(260px, 340px) minmax(0, 1fr)"}}function mt(e){return{borderRight:"1px solid var(--sd-border)",borderBottom:0}}function vr(e){return e==="error"?{background:"var(--sd-error-dot)"}:e==="success"?{background:"var(--sd-success-dot)"}:e==="loading"?{background:"var(--sd-loading-dot)"}:{background:"var(--sd-idle-dot)"}}function gt(e){return e==="error"?{borderColor:"var(--sd-error-border)",color:"var(--sd-error-fg)"}:e==="success"?{borderColor:"var(--sd-success-border)",color:"var(--sd-success-fg)"}:e==="loading"?{borderColor:"var(--sd-loading-border)",color:"var(--sd-loading-fg)"}:{borderColor:"var(--sd-border)",color:"var(--sd-fg-muted)"}}const ir="semaphor-devtools-stylesheet",T="semaphor-devtools",yt=`
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const I=require("../data-app-sdk-adapters/index.cjs"),i=require("react/jsx-runtime"),u=require("react"),M=require("../chunks/validators-DFeDcdpA.cjs"),N=require("../chunks/matrix-operation-contract-0RxoU_M3.cjs"),tr=require("../chunks/matrix-formatter-BJTO8ky9.cjs"),P=require("../chunks/selection-reducer-Kl22OzIk.cjs"),We=require("../chunks/x-B6ghREd2.cjs");function pe(e,r,t){return{...t,name:e,role:r}}function Vr(e){return e}function Qr(e){return e}const Ur={source:{semantic(e){return{...e,kind:"semantic"}},sql(e){return{...e,kind:"sql"}}},field:{measure(e,r={}){return pe(e,"measure",r)},dimension(e,r={}){return pe(e,"dimension",r)},date(e,r={}){return pe(e,"date",r)},id(e,r={}){return pe(e,"id",r)}},filter(e){return{...e,kind:"filter"}},selection(e){return{...e,kind:"selection"}},bindInput(e,r){return{toAnalyticsInput(){const[t]=I.toSemaphorInputSnapshots([e]),n=I.toSemaphorInputBinding({...r,inputId:r.inputId||t.inputId});return{...t,inputId:n.inputId,...n.kind?{kind:n.kind}:{},...n.controlRole?{controlRole:n.controlRole}:{},...n.operator?{operator:n.operator}:{},...n.field?{field:n.field}:{},...n.relationshipHint?{relationshipHint:n.relationshipHint}:{}}}}},control(e){return{...e,kind:"control"}},sqlParam(e){return{...e,kind:"control",role:"sqlParam"}},derivedField(e){return{...e,kind:"derived_field",expressionLanguage:e.expressionLanguage||"semaphor_sql_template"}},metric(e){return{...e,queryKind:"metric"}},analysis(e){return{...e,queryKind:"analysis"}},records(e){return{...e,queryKind:"records"}},inputOptions(e){return{...e,queryKind:"inputOptions"}},sql(e){return{...e,queryKind:"sql"}},matrix(e){return{...e,queryKind:"matrix"}}},de=10,Oe=8;function Ne(e,r){const t=e==null?void 0:e.result;if(t)switch(t.kind){case"records":return ae({title:"Records",rowNoun:"rows",records:t.records,columns:t.columns,rowCount:t.rowCount});case"sql":return ae({title:"SQL Rows",rowNoun:"rows",records:t.records,columns:t.columns,rowCount:t.rowCount});case"inputOptions":return ae({title:"Options",rowNoun:"options",records:t.options.slice(0,de).map(n=>{var s;return{label:n.label,value:n.value,count:n.count,disambiguation:(s=n.disambiguation)==null?void 0:s.join(" / ")}}),columns:[{key:"label",label:"Label"},{key:"value",label:"Value"},{key:"count",label:"Count"},{key:"disambiguation",label:"Disambiguation"}],rowCount:t.rowCount??t.options.length});case"metric":return Gr(t,r);case"matrix":return ae({title:"Matrix Cells",rowNoun:"cells",records:t.window.blocks.flatMap(n=>n.cells).slice(0,de).map(n=>{const s=t.window.descriptors.measures.find(o=>o.id===n.measureId);return{row:tr.matrixMemberLabel(n.rowPath),column:tr.matrixMemberLabel(n.columnPath),measure:(s==null?void 0:s.column.label)||n.measureId,value:n.value}}),columns:[{key:"row",label:"Row"},{key:"column",label:"Column"},{key:"measure",label:"Measure"},{key:"value",label:"Value"}],rowCount:t.window.blocks.reduce((n,s)=>n+s.cells.length,0)});default:return Yr(t)}}function Gr(e,r){var o,a,p,f,c;const t=[{metric:"primaryValue",value:(r==null?void 0:r.primaryValue)??e.primaryValue}],n=(r==null?void 0:r.comparisonKind)??((o=e.comparison)==null?void 0:o.kind);return n&&t.push({metric:`${n} value`,value:(r==null?void 0:r.comparisonValue)??((a=e.comparison)==null?void 0:a.value)},{metric:"delta",value:(r==null?void 0:r.delta)??((p=e.comparison)==null?void 0:p.delta)},{metric:"deltaPercent",value:(r==null?void 0:r.deltaPercent)??((f=e.comparison)==null?void 0:f.deltaPercent)}),(((c=r==null?void 0:r.missingMeasures)==null?void 0:c.filter(Boolean))??[]).forEach(m=>{t.push({metric:`missing:${m}`,value:"missing"})}),Object.entries((r==null?void 0:r.measures)??{}).sort(([m],[g])=>m.localeCompare(g)).forEach(([m,g])=>{t.push({metric:`measure:${m}`,value:g})}),Object.entries((r==null?void 0:r.measureBindings)??{}).sort(([m],[g])=>m.localeCompare(g)).forEach(([m,g])=>{t.push({metric:`binding:${m}`,value:g})}),ae({title:"Metric",rowNoun:"values",records:t,columns:[{key:"metric",label:"Metric"},{key:"value",label:"Value"}],rowCount:t.length})}function ae({title:e,rowNoun:r,records:t,columns:n,rowCount:s}){const o=Jr(n,t);if(!o.length)return;const a=s??t.length,p=t.slice(0,de);return{title:e,summary:`${Zr(a)} ${r}`,columns:o.slice(0,Oe),rows:p,truncatedRows:a>p.length,truncatedColumns:o.length>Oe}}function Jr(e,r){if(e!=null&&e.length)return e.filter(n=>n.key).map(n=>({key:n.key,label:n.label||n.key}));const t=new Set;return r.slice(0,de).forEach(n=>{Object.keys(n).forEach(s=>t.add(s))}),[...t].map(n=>({key:n,label:n}))}function Yr(e){throw new Error(`Unhandled Semaphor result kind: ${hr(e)}`)}function Xr(e){return e===null?"null":e===void 0?"":typeof e=="string"?nr(e):typeof e=="number"||typeof e=="boolean"?String(e):nr(hr(e))}function Zr(e){return typeof e=="number"?e.toLocaleString():"-"}function hr(e){return JSON.stringify(e,null,2)??"undefined"}function nr(e){return e.length>80?`${e.slice(0,77)}...`:e}function xe(e){return e.viewTitle||e.queryLabel||e.viewId||e.queryId}function et(e){if(e.label)return e.label;if(e.queryKind!=="inputOptions")return;const t=e.labelField.label||e.valueField.label||e.labelField.name||e.valueField.name||e.inputId;return`${rt(t)} Options`}function rt(e){return(e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[_-]+/g," ").replace(/\bfilter\b/gi," ").replace(/\boptions?\b/gi," ").replace(/\bid\b/gi," ").replace(/\s+/g," ").trim()||e).split(" ").filter(Boolean).map(n=>n===n.toUpperCase()&&n.length>1?n:`${n.slice(0,1).toUpperCase()}${n.slice(1)}`).join(" ")}function _e(e){return e.flatMap(r=>{var m,g,h,x;const t=r.latestAttempt,n=t==null?void 0:t.executionResult,s=qe((m=n==null?void 0:n.validation)==null?void 0:m.warnings),o=qe((g=n==null?void 0:n.validation)==null?void 0:g.errors),a=it((h=n==null?void 0:n.coverage)==null?void 0:h.missingObligations),p=qe((x=n==null?void 0:n.coverage)==null?void 0:x.warnings),f=[],c=xe(r);(t==null?void 0:t.status)==="error"&&f.push({trace:r,tone:"error",title:c,message:t.errorMessage||"Query attempt failed."});for(const b of r.clientWarnings)f.push({trace:r,tone:"warning",title:c,message:b});for(const b of s)f.push({trace:r,tone:"warning",title:c,...b});for(const b of o)f.push({trace:r,tone:"error",title:c,...b});for(const b of a)f.push({trace:r,tone:"warning",title:c,message:b});for(const b of p)f.push({trace:r,tone:"warning",title:c,...b});return f})}function tt(e){return{traceId:e.trace.traceId,queryId:e.trace.queryId,viewId:e.trace.viewId,viewTitle:e.trace.viewTitle,queryLabel:e.trace.queryLabel,severity:e.tone,title:e.title,message:e.message,code:e.code,path:e.path}}function nt(e,r){return e.filter(t=>t.trace.traceId===r.traceId).length}function st(e){const r=_e(e),t=e.filter(a=>{var p;return((p=a.latestAttempt)==null?void 0:p.status)==="error"}).length,n=e.filter(a=>{var p;return((p=a.latestAttempt)==null?void 0:p.status)==="loading"}).length,s=r.filter(a=>a.tone==="error").length,o=r.filter(a=>a.tone==="warning").length;return{total:e.length,failed:t,loading:n,errorCount:s,warningCount:o,issueCount:r.length,severity:t||s?"error":o?"warning":n?"loading":"ok"}}function it(e){return Array.isArray(e)?e.filter(r=>typeof r=="string"):[]}function qe(e){return Array.isArray(e)?e.map(ot).filter(r=>!!r):[]}function ot(e){if(typeof e=="string")return{message:e};if(!e||typeof e!="object"||Array.isArray(e))return;const r=e,t=typeof r.message=="string"?r.message:"",n=typeof r.code=="string"?r.code:"",s=typeof r.path=="string"?r.path:"";return t&&n?{message:s?`${t} (${n}, ${s})`:`${t} (${n})`,code:n,...s?{path:s}:{}}:t?{message:t,...s?{path:s}:{}}:n?{message:n,code:n}:void 0}function at(e){if(!e.enabled)return e;const r=e.queries.map(br);return{enabled:e.enabled,queries:r,issues:e.issues,getQuery:t=>r.find(n=>n.queryId===t),getQueries:t=>r.filter(n=>n.queryId===t)}}function sr(e){return e?br(e):void 0}function br(e){var r;return(r=e==null?void 0:e.latestAttempt)!=null&&r.executionResult?{...e,latestAttempt:{...e.latestAttempt,resultPreview:e.latestAttempt.resultPreview||Ne(e.latestAttempt.executionResult),executionResult:lt(e.latestAttempt.executionResult)}}:e}function lt(e){const{compiledQuery:r,intent:t,result:n,...s}=e,o=dt(s.metadata);return{...s,...o?{metadata:o}:{}}}function dt(e){if(!e||typeof e!="object"||Array.isArray(e))return e;const r=e.dataAppDebug;if(!r||typeof r!="object"||Array.isArray(r))return e;const{compiledSql:t,...n}=r;return{...e,dataAppDebug:n}}function ut(e){return e==="relative"?{position:"relative",top:"auto",right:"auto",bottom:"auto",left:"auto"}:{top:e.startsWith("top")?20:"auto",right:e.endsWith("right")?20:"auto",bottom:e.startsWith("bottom")?20:"auto",left:e.endsWith("left")?20:"auto"}}function ct(e){return e==="error"?{borderColor:"var(--sd-error-border)",background:"var(--sd-error-bg)",color:"var(--sd-error-fg)"}:e==="warning"?{borderColor:"var(--sd-warning-border)",background:"var(--sd-warning-bg)",color:"var(--sd-warning-fg)"}:e==="loading"?{borderColor:"var(--sd-loading-border)",background:"var(--sd-loading-bg)",color:"var(--sd-loading-fg)"}:{borderColor:"var(--sd-success-border)",background:"var(--sd-success-bg)",color:"var(--sd-success-fg)"}}function ft(e){return e==="right"?{top:16,right:16,bottom:16,left:"auto",width:"min(720px, calc(100vw - 32px))",height:"auto",borderRadius:6}:{top:"auto",right:16,bottom:16,left:16,width:"auto",height:"min(420px, 45vh)",borderRadius:6}}function pt(e){return e==="right"?{gridTemplateColumns:"minmax(210px, 280px) minmax(0, 1fr)"}:{gridTemplateColumns:"minmax(260px, 340px) minmax(0, 1fr)"}}function mt(e){return{borderRight:"1px solid var(--sd-border)",borderBottom:0}}function vr(e){return e==="error"?{background:"var(--sd-error-dot)"}:e==="success"?{background:"var(--sd-success-dot)"}:e==="loading"?{background:"var(--sd-loading-dot)"}:{background:"var(--sd-idle-dot)"}}function gt(e){return e==="error"?{borderColor:"var(--sd-error-border)",color:"var(--sd-error-fg)"}:e==="success"?{borderColor:"var(--sd-success-border)",color:"var(--sd-success-fg)"}:e==="loading"?{borderColor:"var(--sd-loading-border)",color:"var(--sd-loading-fg)"}:{borderColor:"var(--sd-border)",color:"var(--sd-fg-muted)"}}const ir="semaphor-devtools-stylesheet",T="semaphor-devtools",yt=`
|
|
2
2
|
.${T} {
|
|
3
3
|
--sd-bg: #ffffff;
|
|
4
4
|
--sd-bg-muted: #fafafa;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { toSemaphorInputSnapshots as rt, toSemaphorInputBinding as tt, toSemaphorSelectionSnapshots as nt, toSemaphorActiveInputSnapshots as X, toSemaphorMatrixIntent as it, toSemaphorSqlIntent as ot, toSemaphorInputOptionsIntent as st, toSemaphorRecordsIntent as at, toSemaphorAnalysisQueryOptions as lt, toSemaphorAnalysisIntent as dt, toSemaphorMetricIntent as ut, hasSemaphorInputValue as fe, normalizeSemaphorInputOptions as qr, toSemaphorInputSpec as Ar } from "../data-app-sdk-adapters/index.js";
|
|
2
2
|
import { jsxs as p, Fragment as Tr, jsx as l } from "react/jsx-runtime";
|
|
3
3
|
import { createContext as Ae, useContext as Q, useState as _, useRef as T, useEffect as B, useMemo as x, Fragment as ct, useId as kr, useCallback as L, useReducer as ft } from "react";
|
|
4
|
-
import { q as pt, u as gt,
|
|
5
|
-
import { a as ko,
|
|
6
|
-
import { Q as ht, a6 as bt, a5 as vt, D as sr, t as ar, L as St } from "../chunks/matrix-operation-contract-
|
|
7
|
-
import { m as lr } from "../chunks/matrix-formatter-
|
|
8
|
-
import { M as wt, a as It, S as xt, E as qt, C as At, r as dr } from "../chunks/selection-reducer-
|
|
4
|
+
import { q as pt, u as gt, ad as mt, aX as xe, s as yt } from "../chunks/validators-CsdOtZI6.js";
|
|
5
|
+
import { a as ko, b1 as Co } from "../chunks/validators-CsdOtZI6.js";
|
|
6
|
+
import { Q as ht, a6 as bt, a5 as vt, D as sr, t as ar, L as St } from "../chunks/matrix-operation-contract-D32U2CSw.js";
|
|
7
|
+
import { m as lr } from "../chunks/matrix-formatter-CCXNRt3s.js";
|
|
8
|
+
import { M as wt, a as It, S as xt, E as qt, C as At, r as dr } from "../chunks/selection-reducer-CvCBQbl2.js";
|
|
9
9
|
import { X as Tt, C as kt, j as Ct } from "../chunks/x-CXDkqdur.js";
|
|
10
10
|
function he(e, r, t) {
|
|
11
11
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const v=require("../chunks/operators-DEfKaU_V.cjs"),l=require("../chunks/validators-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const v=require("../chunks/operators-DEfKaU_V.cjs"),l=require("../chunks/validators-DFeDcdpA.cjs"),g=require("../chunks/matrix-operation-contract-0RxoU_M3.cjs");function p(t){var e,r,o;const i=R(t);return{version:1,kind:"metric",id:t.id,label:t.label,source:f(t),measures:i,primaryMeasure:b(t,i),dateField:t.dateField?a(t.dateField,"date"):void 0,timeGrain:t.timeGrain,dimensions:(e=t.dimensions)==null?void 0:e.map(n=>a(n,"dimension")),comparison:G(t.comparison),orderBy:t.orderBy?{field:a(t.orderBy.field),direction:t.orderBy.direction}:void 0,inputs:s(t.inputs),...(r=t.filters)!=null&&r.length?{filters:t.filters}:{},...t.relationshipHint?{relationshipHint:t.relationshipHint}:{},limit:t.limit,...(o=t.derivedFields)!=null&&o.length?{derivedFields:t.derivedFields}:{}}}function F(t){return{...p(t),...t.timeWindow?{timeWindow:t.timeWindow}:{},...t.analysis?{analysis:t.analysis}:{}}}function M(t){return{...t.chartTitle?{chartTitle:t.chartTitle}:{},...t.chartType?{chartType:t.chartType}:{},...t.driverMode?{driverMode:t.driverMode}:{},...t.includePopulation!==void 0?{includePopulation:t.includePopulation}:{},...t.calendarContext?{calendarContext:t.calendarContext}:{}}}function b(t,i){if(!t.primaryMeasure)return i[0]||{name:"",role:"measure"};const e=a(t.primaryMeasure,"measure"),r=H(e,i),o=r.length===1?r[0]:void 0;return o?c(e,o):e}function R(t){const i=[];for(const e of t.measures.map(r=>a(r,"measure"))){if(!e.name)continue;const r=i.findIndex(o=>w(o,e));if(r===-1){i.push(e);continue}i[r]=c(i[r],e)}return i}function w(t,i){return l.semaphorFieldRefsMatch(t,i)&&d(t)===d(i)}function A(t,i){return d(i)===d(t)}function k(t,i){return i.name!==t.name||t.source&&!l.semaphorFieldRefsMatch(i,t)?!1:A(t,i)}function H(t,i){const e=i.filter(r=>k(t,r));return t.aggregate!==void 0,e}function d(t){return l.semaphorMetricAggregate(t)}function c(t,i){if(t.aggregate&&i.aggregate&&t.aggregate!==i.aggregate)throw new Error(`Measure "${t.name}" was requested with conflicting aggregate semantics: ${t.aggregate} and ${i.aggregate}.`);return{...l.preferSemaphorFieldRefMetadata(t,i),aggregate:t.aggregate||i.aggregate}}function B(t){var e,r;if("sort"in t)throw new Error("semaphor.records supports orderBy for a single deterministic sort. Multiple sort clauses are not supported by the analytics protocol yet.");if(!_(t))throw new Error("semaphor.records needs at least one field.");const i=O(t.fields);return{version:1,kind:"records",id:t.id,label:t.label,source:f(t),fields:i,dateField:t.dateField?a(t.dateField,"date"):void 0,timeGrain:t.timeGrain,...t.timeWindow?{timeWindow:t.timeWindow}:{},...(e=t.filters)!=null&&e.length?{filters:t.filters}:{},orderBy:t.orderBy?{field:a(t.orderBy.field),direction:t.orderBy.direction}:void 0,inputs:s(t.inputs),...t.relationshipHint?{relationshipHint:t.relationshipHint}:{},limit:t.limit,...t.pagination?{pagination:t.pagination}:{},...t.totals?{totals:{mode:"server",measures:t.totals.measures.map(o=>a(o,"measure"))}}:{},...(r=t.derivedFields)!=null&&r.length?{derivedFields:t.derivedFields}:{}}}function O(t){return t.map(i=>{const e=a(i);if(!e.role)throw new Error(`semaphor.records field "${e.name}" needs an explicit role.`);return e})}function q(t){var e,r,o;const i=f(t);if(i.kind==="sql")throw new Error("semaphor.inputOptions requires a semantic or physical option source.");return{version:1,kind:"inputOptions",id:t.id,label:t.label,inputId:t.inputId,source:i,labelField:a(t.labelField,"dimension"),valueField:a(t.valueField,"dimension"),...t.searchField?{searchField:a(t.searchField,"dimension")}:{},...(e=t.disambiguationFields)!=null&&e.length?{disambiguationFields:t.disambiguationFields.map(n=>a(n,"dimension"))}:{},...t.population?{population:t.population}:{},...t.dependencies?{dependencies:t.dependencies}:{},search:t.search,limit:t.limit,...(r=t.inputs)!=null&&r.length?{inputs:t.inputs.map(n=>m(n))}:{},...(o=t.derivedFields)!=null&&o.length?{derivedFields:t.derivedFields}:{}}}function z(t){var i;return{version:1,kind:"sql",id:t.id,label:t.label,source:t.source,sql:t.sql,...t.defaultParameters?{defaultParameters:t.defaultParameters}:{},...t.pythonCode?{pythonCode:t.pythonCode}:{},...(i=t.fields)!=null&&i.length?{fields:t.fields.map(e=>a(e))}:{},inputs:s(t.inputs),limit:t.limit,...t.pagination?{pagination:t.pagination}:{},rationale:t.rationale}}function C(t){const{id:i,label:e,inputs:r,matrixWindowRequest:o,...n}=t,{queryKind:j,...I}=n;return l.matrixAnalyticalIntentSchema.parse({...I,kind:"matrix"})}function m(t){if("toAnalyticsInput"in t){const n=t.toAnalyticsInput();return{inputId:n.inputId,kind:n.kind,...n.controlRole?{controlRole:n.controlRole}:{},...n.operator?{operator:n.operator}:{},...n.field?{field:n.field}:{},...n.relationshipHint?{relationshipHint:n.relationshipHint}:{}}}if("id"in t){const n=h(t);return{inputId:n.inputId,kind:n.kind,...n.controlRole?{controlRole:n.controlRole}:{},...n.operator?{operator:n.operator}:{},...n.field?{field:n.field}:{},...n.relationshipHint?{relationshipHint:n.relationshipHint}:{}}}const i="kind"in t?t.kind:void 0,e="operator"in t?y(t.operator,t.inputId):void 0,r="controlRole"in t?t.controlRole:"role"in t?t.role:void 0,o=P(r)?r:void 0;return{inputId:t.inputId,...i?{kind:i}:{},...o?{controlRole:o}:{},...e?{operator:e}:{},...t.field?{field:t.field}:{},...t.relationshipHint?{relationshipHint:t.relationshipHint}:{}}}function P(t){return t==="grain"||t==="measure"||t==="dimension"||t==="aggregation"||t==="sqlParam"}function x(t){const i=s(t);return i.length>0?i:void 0}function S(t){return(t||[]).map($)}function T(t){return S(t).filter(i=>i.isActive)}function W(t){const i=(t||[]).flatMap(e=>{const r="toAnalyticsSelection"in e?e.toAnalyticsSelection():e;return r?[g.analyticsSelectionSchema.parse(r)]:[]});return g.canonicalizeAnalyticsSelections(i)}function h(t){if(t.kind==="filter"){const i=y(t.operator,t.id);return{inputId:t.id,kind:t.kind,label:t.label,field:a(t.field,"dimension"),operator:i||"in",...t.relationshipHint?{relationshipHint:t.relationshipHint}:{}}}return{inputId:t.id,kind:t.kind,label:t.label,controlRole:t.role}}function E(t=[]){return t.map(i=>typeof i=="object"?i:{label:String(i),value:i})}function u(t){return t==null?!1:Array.isArray(t)?t.length>0:typeof t=="string"?t.trim().length>0:!0}function $(t){if("toAnalyticsInput"in t)return t.toAnalyticsInput();if("kind"in t&&"isActive"in t)return t;if("id"in t){const i=h(t),e=Object.prototype.hasOwnProperty.call(t,"value")?t.value:t.defaultValue;return{inputId:i.inputId,kind:i.kind,label:i.label,...i.field?{field:i.field}:{},...i.operator?{operator:i.operator}:{},...i.controlRole?{controlRole:i.controlRole}:{},...i.relationshipHint?{relationshipHint:i.relationshipHint}:{},value:e,isActive:u(e)}}return{...t,kind:"filter",isActive:u(t.value),value:t.value}}function f(t){return t.source}function _(t){var i;return!!((i=t.fields)!=null&&i.length)}function a(t,i){return{...t,role:t.role||i}}function s(t){return(t||[]).map(m)}function G(t){if(t)return t}function y(t,i){if(t===void 0)return;const e=v.normalizeSemaphorInputOperator(t);if(!e)throw new Error(`useSemaphorInput "${i}" uses unsupported filter operator "${t}".`);return e}exports.hasSemaphorInputValue=u;exports.normalizeSemaphorInputOptions=E;exports.toSemaphorActiveInputSnapshots=T;exports.toSemaphorAnalysisIntent=F;exports.toSemaphorAnalysisQueryOptions=M;exports.toSemaphorInputBinding=m;exports.toSemaphorInputBindings=x;exports.toSemaphorInputOptionsIntent=q;exports.toSemaphorInputSnapshots=S;exports.toSemaphorInputSpec=h;exports.toSemaphorMatrixIntent=C;exports.toSemaphorMetricIntent=p;exports.toSemaphorRecordsIntent=B;exports.toSemaphorSelectionSnapshots=W;exports.toSemaphorSqlIntent=z;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { n as y } from "../chunks/operators-B3zZoskU.js";
|
|
2
|
-
import { m as v, s as m, p as I, a as S } from "../chunks/validators-
|
|
3
|
-
import { b as F, c as b } from "../chunks/matrix-operation-contract-
|
|
2
|
+
import { m as v, s as m, p as I, a as S } from "../chunks/validators-CsdOtZI6.js";
|
|
3
|
+
import { b as F, c as b } from "../chunks/matrix-operation-contract-D32U2CSw.js";
|
|
4
4
|
function w(i) {
|
|
5
5
|
var n, r, o;
|
|
6
6
|
const t = R(i);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("../chunks/validators-DVYAnnX0.cjs"),N=require("../chunks/matrix-operation-contract-DoiWTUbT.cjs"),E=require("../chunks/report-runtime-context-DzvHBPxl.cjs"),K=require("../chunks/source-entity-resolution-CjbgnwyX.cjs"),y=require("../data-app-sdk-adapters/index.cjs"),Q=require("../chunks/matrix-card-U4c72doZ.cjs");function W({intent:e,field:r,catalogField:t,relativePath:o}){const i=J({intent:e,field:r,relativePath:o});if(!i||i.allowedRelatedRoles.length===0)return!1;const n=I(r,i.selectedField),s=$(t),c=h(n);return P(s,i.allowedRelatedRoles)?c===s:!1}function U(e){return e.kind==="records"?L(e):e.kind==="metric"?X(e):[]}function $(e){const r=d.normalizeAnalyticsCatalogName(e.role);if(r==="measure")return"measure";if(r==="id")return"id";const t=d.normalizeAnalyticsCatalogDataType(e.dataType);if(r==="date"||t==="date"||t==="datetime")return"date";if(r==="dimension")return"dimension"}function P(e,r){return!!(e&&r.includes(e))}function I(e,r){const t=h(e);if(t)return e.role===t?e:{...e,role:t};const o=r?h(r):void 0;return o?{...e,role:o}:e}function v(e,r){return e.find(t=>T(t,r))}function J({intent:e,field:r,relativePath:t}){if(e.kind==="records")return V(e,r,t);if(e.kind==="metric")return G(e,r,t)}function V(e,r,t){if(t.startsWith("spec.fields."))return{allowedRelatedRoles:["dimension","date","id"]};if(t==="spec.dateField"&&!e.timeWindow)return{allowedRelatedRoles:["date"]};if(t==="spec.orderBy.field"){const o=v(H(e),r);return{selectedField:o,allowedRelatedRoles:o?k(o):[]}}}function G(e,r,t){if(t.startsWith("spec.dimensions."))return{allowedRelatedRoles:["dimension"]};if(t==="spec.orderBy.field"){const o=v(e.dimensions||[],r);return{selectedField:o,allowedRelatedRoles:o?["dimension"]:[]}}}function L(e){var o,i;const r=H(e),t=(o=e.orderBy)!=null&&o.field?v(r,e.orderBy.field):void 0;return b([...r.map(n=>p(n,k(n))),...(i=e.orderBy)!=null&&i.field?[p(I(e.orderBy.field,t),t?k(t):[],{unsupportedRelatedRoleMessage:"Joined records projections support related sort fields only when the same related field is included in spec.fields.",recommendedNextStep:"Add the related sort field to spec.fields, or keep orderBy fields on the base source."})]:[]])}function X(e){var t,o;const r=(t=e.orderBy)!=null&&t.field?v(e.dimensions||[],e.orderBy.field):void 0;return b([...e.measures.map(i=>p(i,[])),...e.primaryMeasure?[p(e.primaryMeasure,[])]:[],...(e.dimensions||[]).map(i=>p(i,["dimension"])),...e.dateField?[p({...e.dateField,role:"date"},[])]:[],...(o=e.orderBy)!=null&&o.field?[p(I(e.orderBy.field,r),r?["dimension"]:[],{unsupportedRelatedRoleMessage:"Joined metric projections support related orderBy fields only when the same related field is declared in spec.dimensions.",recommendedNextStep:"Add the related field as a metric dimension when it should participate in the grouped result, or keep orderBy fields on the base source."})]:[]])}function k(e){const r=e?h(e):void 0;return r==="dimension"?["dimension"]:r==="date"?["date"]:r==="id"?["id"]:["dimension","date","id"]}function p(e,r,t={}){return{field:I(e),allowedRelatedRoles:r,...t}}function b(e){const r=[];return e.forEach(t=>{r.some(o=>Y(o,t))||r.push(t)}),r}function H(e){const r=[...e.fields];return e.dateField&&!r.some(t=>w(t,e.dateField))&&r.push({...e.dateField,role:"date"}),r}function Y(e,r){return T(e.field,r.field)&&e.allowedRelatedRoles.join("|")===r.allowedRelatedRoles.join("|")&&(e.unsupportedRelatedRoleMessage||"")===(r.unsupportedRelatedRoleMessage||"")&&(e.recommendedNextStep||"")===(r.recommendedNextStep||"")}function w(e,r){return d.semaphorFieldRefsMatch(e,r)}function T(e,r){return w(e,r)&&Z(h(e),h(r))}function Z(e,r){return!!(e&&(!r||e===r))}function h(e){return $(e)}function j({intent:e,field:r,relativePath:t,baseCatalog:o,fieldCatalogs:i}){const n=g(r,e.source),s=d.semaphorSourcesReferToSameDataset(n,e.source);if(e.kind!=="matrix"&&!s&&!re(e.source,n))return{ok:!1,code:"invalid_source_ref",message:`Field "${r.name}" references a related Semaphor source outside the query's semantic domain.`,pathSuffix:".source",source:n};const c=s?o:S(i,n);if(!c)return{ok:!1,code:"invalid_source_ref",message:`Field "${r.name}" references a Semaphor source that is not present in the visible field catalog.`,pathSuffix:".source",source:n};const a=q(c,r,e.source);return a?e.kind!=="matrix"&&!s&&!ee({intent:e,field:r,catalogField:a,relativePath:t})?{ok:!1,code:"unsupported_joined_projection",message:`Field "${r.name}" references a related Semaphor source, but this query kind does not support joined projections for that field yet.`,pathSuffix:".source",source:n}:{ok:!0,source:n,catalogField:a,usesBaseSource:s}:{ok:!1,code:"missing_field",message:`Field "${r.name}" is not visible on the selected Semaphor source.`,source:n}}function ee({intent:e,field:r,catalogField:t,relativePath:o}){return W({intent:e,field:r,catalogField:t,relativePath:o})}function re(e,r){return e.kind==="semantic"&&r.kind==="semantic"&&e.domainId===r.domainId}function S(e,r){return e.find(t=>F(t,r))}function q(e,r,t){const o=g(r,t);if(F(e,o))return e.fields.find(i=>te(i,r)&&F(e,g(i,e.source)))}function R(e){return d.normalizeAnalyticsCatalogName(e)}function g(e,r){return e.source||r}function F(e,r){return[e.source,...e.sourceAliases||[]].some(t=>d.semaphorSourcesReferToSameDataset(t,r))}function te(e,r){return!!(e.name&&r.name&&e.name===r.name)}function oe(e){const r=[];if(!e.intent.filters)return r;const t=e.intent.source,i=d.mergeSemaphorSourcesByIdentity(e.fieldCatalogs.flatMap(a=>[a.source,...a.sourceAliases??[]])).filter(a=>t.kind==="semantic"?a.kind==="semantic"&&a.domainId===t.domainId:a.kind==="physical"&&a.connectionId===t.connectionId).map(a=>a.kind==="semantic"?{type:"dataset",name:a.datasetName,id:a.datasetId,domainId:a.domainId,connectionId:a.connectionId}:{type:"table",name:a.tableName,database:a.databaseName,schema:a.schemaName,connectionId:a.connectionId,connectionType:a.connectionType,dialect:a.dialect}),n=(a,u)=>{r.push({field:a,path:u,validation:j({...e,field:a,relativePath:u})})},s=(a,u)=>{if(a.derivedField)Object.entries(a.derivedField.inputs).forEach(([l,f])=>n(f.field,`${u}.derivedField.inputs.${l}.field`));else if(a.calculatedFormula)a.calculatedFormula.inputFields.forEach((l,f)=>s(l,`${u}.calculatedFormula.inputFields.${f}`));else{const l=K.resolveSemaphorSourceEntity({entities:i,semanticDomainId:t.kind==="semantic"?t.domainId:void 0,connectionId:t.connectionId,connectionType:t.kind==="physical"?t.connectionType:void 0,dialect:t.kind==="physical"?t.dialect:void 0,fieldEntityType:a.entityType,entityId:a.entityId,entityName:a.entityName,qualifiedHints:[a.qualifiedEntityName]});l.kind==="resolved"?n({name:a.name,source:l.source},u):r.push({field:{name:a.name},path:u,validation:{ok:!1,code:"invalid_source_ref",source:t,message:`Filter field "${a.name}" has no unambiguous source in the visible field catalog (${l.kind}).`}})}},c=(a,u)=>{a.conditions.forEach((l,f)=>s(l.field,`${u}.conditions.${f}.field`)),a.groups.forEach((l,f)=>c(l,`${u}.groups.${f}`))};return c(e.intent.filters,"spec.filters"),r}function M(e,r={}){const t=r.pathPrefix||"analysisOptions";if(e===void 0)return{ok:!0};if(!e||typeof e!="object"||Array.isArray(e))return m(t,"Data App analysis options must be an object.");const o=e,i={};if(o.chartTitle!==void 0){if(typeof o.chartTitle!="string")return m(`${t}.chartTitle`,'Data App analysis option "chartTitle" must be a string.');i.chartTitle=o.chartTitle}if(o.chartType!==void 0){if(typeof o.chartType!="string")return m(`${t}.chartType`,'Data App analysis option "chartType" must be a string.');i.chartType=o.chartType}if(o.driverMode!==void 0){if(!ne(o.driverMode))return m(`${t}.driverMode`,'Data App analysis option "driverMode" must be absolute_delta, largest_negative, largest_positive, positive_and_negative, or all.');i.driverMode=o.driverMode}if(o.includePopulation!==void 0){if(typeof o.includePopulation!="boolean")return m(`${t}.includePopulation`,'Data App analysis option "includePopulation" must be a boolean.');i.includePopulation=o.includePopulation}if(o.calendarContext!==void 0){const n=se(o.calendarContext,{pathPrefix:`${t}.calendarContext`,validateTimezone:r.validateTimezone});if(!n.ok)return n;i.calendarContext=n.calendarContext}return{ok:!0,analysisOptions:i}}function ie(e){const r=e.queries.map((i,n)=>ae(i,n,{fieldCatalogs:e.fieldCatalogs||[],requireFieldCatalog:!!e.requireFieldCatalog,validateTimezone:e.validateTimezone})),t=r.flatMap(i=>i.diagnostics),o=r.map(i=>i.executionResult);return{ok:t.every(i=>i.severity!=="error"),diagnostics:t,queries:r,intents:r.flatMap(i=>i.intent?[i.intent]:[]),executionResults:o}}function ae(e,r,t){const o=`queries.${r}`;try{const i=de(e),n=ke(e,i),s=d.validateSemaphorAnalyticsIntent(i),c=[...ge({querySpec:e,queryId:n,intent:i,pathPrefix:o}),...s.errors.map(u=>_(u,{queryHook:e.queryHook,queryId:n,pathPrefix:o,severity:"error",intent:i})),...s.warnings.map(u=>_(u,{queryHook:e.queryHook,queryId:n,pathPrefix:o,severity:"warning",intent:i})),...ce({querySpec:e,queryId:n,intent:i,pathPrefix:o,fieldCatalogs:t.fieldCatalogs,requireFieldCatalog:t.requireFieldCatalog}),...he({querySpec:e,queryId:n,intent:i,pathPrefix:o,validateTimezone:t.validateTimezone})],a=Se(s,c);return{queryHook:e.queryHook,queryId:n,intent:i,diagnostics:c,executionResult:x({intent:i,validation:a,diagnostics:c})}}catch(i){const n={severity:"error",code:"invalid_query_spec",message:i instanceof Error?i.message:String(i),path:o,queryHook:e.queryHook,queryId:O(e.spec)},s=z([n]);return{queryHook:e.queryHook,queryId:n.queryId,diagnostics:[n],executionResult:x({validation:s,diagnostics:[n]})}}}function m(e,r){return{ok:!1,issues:[{code:"invalid_analysis_option",message:r,path:e}]}}function D(e){return!!(e&&typeof e=="object"&&!Array.isArray(e))}function ne(e){return e==="absolute_delta"||e==="largest_negative"||e==="largest_positive"||e==="positive_and_negative"||e==="all"}function se(e,r){if(!e||typeof e!="object"||Array.isArray(e))return m(r.pathPrefix,'Data App analysis option "calendarContext" must be an object.');const t=e,o=t.tz;let i=o;if(typeof o=="string"&&r.validateTimezone&&(i=r.validateTimezone(o)),i===null)return m(`${r.pathPrefix}.tz`,'Data App analysis option "calendarContext.tz" must be a valid timezone string.');const n=E.parseCalendarContext({...t,tz:i});if(!n.ok){const s=n.issues[0];return m(s!=null&&s.path?`${r.pathPrefix}.${s.path}`:r.pathPrefix,`Data App analysis option "calendarContext" is invalid: ${(s==null?void 0:s.message)??"invalid value"}.`)}return{ok:!0,calendarContext:n.value}}function de(e){return le(e.spec)}function le(e){if(!D(e))throw new Error("useSemaphorQuery spec must be an object.");if(e.queryKind==="metric")return y.toSemaphorMetricIntent(e);if(e.queryKind==="analysis")return y.toSemaphorAnalysisIntent(e);if(e.queryKind==="records")return y.toSemaphorRecordsIntent(e);if(e.queryKind==="sql")return y.toSemaphorSqlIntent(e);if(e.queryKind==="matrix")return y.toSemaphorMatrixIntent(e);if(e.queryKind==="inputOptions")return y.toSemaphorInputOptionsIntent(e);throw new Error("useSemaphorQuery spec.queryKind must be metric, analysis, records, inputOptions, sql, or matrix.")}function ce(e){if(e.intent.kind==="sql")return[];if(e.fieldCatalogs.length===0&&!e.requireFieldCatalog)return[];const r=S(e.fieldCatalogs,e.intent.source);if(!r)return[{severity:"error",code:"invalid_source_ref",message:`Source ref for ${e.querySpec.queryHook} does not match a visible Semaphor source.`,path:`${e.pathPrefix}.spec.source`,queryHook:e.querySpec.queryHook,queryId:e.queryId,intentId:d.getAnalyticsIntentId(e.intent),source:e.intent.source}];const t=fe({...e,catalog:r}),o={...r,fields:[...r.fields,...ve(e.intent,r,e.intent.source)]};return[...t,...ue({...e,fieldCatalogs:e.fieldCatalogs}),...me({...e,catalog:o,fieldCatalogs:e.fieldCatalogs}),...pe({...e,catalog:o,fieldCatalogs:e.fieldCatalogs})]}function ue(e){var t;if(e.intent.kind!=="inputOptions"||((t=e.intent.population)==null?void 0:t.kind)!=="related_population")return[];const r=e.intent.population.baseSource;return S(e.fieldCatalogs,r)?[]:[{severity:"error",code:"invalid_source_ref",message:"Input options related population baseSource does not match a visible Semaphor source.",path:`${e.pathPrefix}.spec.population.baseSource`,queryHook:e.querySpec.queryHook,queryId:e.queryId,intentId:d.getAnalyticsIntentId(e.intent),source:r}]}function fe(e){const r=B(e.intent);if(r.length===0)return[];const t=[],o=new Set;return r.forEach((i,n)=>{const s=`${e.pathPrefix}.spec.derivedFields.${n}`,c=R(i.name);c&&(o.has(c)&&t.push({severity:"error",code:"duplicate_derived_field",message:`Derived field "${i.name}" is declared more than once.`,path:`${s}.name`,queryHook:e.querySpec.queryHook,queryId:e.queryId,intentId:d.getAnalyticsIntentId(e.intent),source:e.intent.source}),o.add(c),e.catalog.fields.some(a=>R(a.name)===c)&&t.push({severity:"error",code:"derived_field_name_collision",message:`Derived field "${i.name}" conflicts with a field already visible on the selected Semaphor source.`,path:`${s}.name`,queryHook:e.querySpec.queryHook,queryId:e.queryId,intentId:d.getAnalyticsIntentId(e.intent),source:e.intent.source})),Object.entries(i.inputs||{}).forEach(([a,u])=>{const l=qe(u);if(!l)return;const f=g(l,e.intent.source);if(!d.semaphorSourcesReferToSameDataset(f,e.intent.source)){t.push({severity:"error",code:"unsupported_derived_field_source",message:`Derived field "${i.name}" input "${a}" references a different Semaphor source. App-local derived fields must use fields from the query source.`,path:`${s}.inputs.${a}`,queryHook:e.querySpec.queryHook,queryId:e.queryId,intentId:d.getAnalyticsIntentId(e.intent),source:f,field:l});return}q(e.catalog,l,e.intent.source)||t.push({severity:"error",code:"missing_field",message:`Derived field "${i.name}" input "${a}" references field "${l.name}", which is not visible on the selected Semaphor source.`,path:`${s}.inputs.${a}`,queryHook:e.querySpec.queryHook,queryId:e.queryId,intentId:d.getAnalyticsIntentId(e.intent),source:f,field:l})})}),t}function me(e){const r=Ie(e.intent).map(({field:t,path:o})=>{const i=j({intent:e.intent,field:t,relativePath:o,baseCatalog:e.catalog,fieldCatalogs:e.fieldCatalogs});return{field:t,path:o,validation:i}});return e.intent.kind==="matrix"&&r.push(...oe({intent:e.intent,baseCatalog:e.catalog,fieldCatalogs:e.fieldCatalogs})),r.flatMap(({field:t,path:o,validation:i})=>i.ok?[]:[{severity:"error",code:i.code,message:i.message,path:`${e.pathPrefix}.${o}${i.pathSuffix||""}`,queryHook:e.querySpec.queryHook,queryId:e.queryId,intentId:d.getAnalyticsIntentId(e.intent),source:i.source,field:t}])}function pe(e){return("inputs"in e.intent?e.intent.inputs||[]:[]).flatMap((t,o)=>{if(!t.field)return[];const i=g(t.field,e.intent.source);if(!d.semaphorSourcesReferToSameDataset(i,e.intent.source)){if(ye(e.intent,i)){const n=S(e.fieldCatalogs,i);return n?q(n,t.field,i)?[]:[{severity:"error",code:"missing_field",message:`Input "${t.inputId}" references field "${t.field.name}", which is not visible on the selected Semaphor source.`,path:`${e.pathPrefix}.spec.inputs.${o}.field`,queryHook:e.querySpec.queryHook,queryId:e.queryId,intentId:d.getAnalyticsIntentId(e.intent),source:i,field:t.field}]:[{severity:"error",code:"invalid_source_ref",message:`Input "${t.inputId}" references a Semaphor source that is not present in the visible field catalog.`,path:`${e.pathPrefix}.spec.inputs.${o}.field.source`,queryHook:e.querySpec.queryHook,queryId:e.queryId,intentId:d.getAnalyticsIntentId(e.intent),source:i,field:t.field}]}return[{severity:"error",code:"unsupported_input_filter_composition",message:`Input "${t.inputId}" filters a different Semaphor source than the query, and no relationship-aware semantic validation path is available for this query kind.`,path:`${e.pathPrefix}.spec.inputs.${o}.field`,queryHook:e.querySpec.queryHook,queryId:e.queryId,intentId:d.getAnalyticsIntentId(e.intent),source:i,field:t.field}]}return q(e.catalog,t.field,e.intent.source)?[]:[{severity:"error",code:"missing_field",message:`Input "${t.inputId}" references field "${t.field.name}", which is not visible on the selected Semaphor source.`,path:`${e.pathPrefix}.spec.inputs.${o}.field`,queryHook:e.querySpec.queryHook,queryId:e.queryId,intentId:d.getAnalyticsIntentId(e.intent),source:i,field:t.field}]})}function ye(e,r){return e.source.kind==="semantic"&&r.kind==="semantic"&&r.domainId===e.source.domainId}function he(e){if(e.querySpec.spec.queryKind!=="analysis")return[];const r=M(e.querySpec.spec,{pathPrefix:`${e.pathPrefix}.spec`,validateTimezone:e.validateTimezone});return r.ok?[]:r.issues.map(t=>({severity:"error",code:t.code,message:t.message,path:t.path,queryHook:e.querySpec.queryHook,queryId:e.queryId,intentId:d.getAnalyticsIntentId(e.intent),source:e.intent.source}))}function ge(e){if(e.querySpec.spec.queryKind==="matrix"){const r=N.matrixWindowRequestSchema.safeParse(e.querySpec.spec.matrixWindowRequest);return r.success?[]:r.error.issues.map(t=>({severity:"error",code:"invalid_query_spec",message:t.message,path:[e.pathPrefix,"spec","matrixWindowRequest",...t.path].join("."),queryHook:e.querySpec.queryHook,queryId:e.queryId,intentId:d.getAnalyticsIntentId(e.intent)}))}return e.querySpec.spec.queryKind!=="sql"?[]:D(e.querySpec.spec)?Object.prototype.hasOwnProperty.call(e.querySpec.spec,"parameters")?[{severity:"error",code:"deprecated_sql_parameters",message:"semaphor.sql uses defaultParameters for static SQL param(...) fallback values. The legacy parameters field is not supported.",path:`${e.pathPrefix}.spec.parameters`,queryHook:e.querySpec.queryHook,queryId:e.queryId,intentId:d.getAnalyticsIntentId(e.intent)}]:[]:[]}function Ie(e){return e.kind==="metric"?[...e.measures.map((r,t)=>({field:r,path:`spec.measures.${t}`})),...e.primaryMeasure?[{field:e.primaryMeasure,path:"spec.primaryMeasure"}]:[],...e.dateField?[{field:e.dateField,path:"spec.dateField"}]:[],...(e.dimensions||[]).map((r,t)=>({field:r,path:`spec.dimensions.${t}`})),...e.orderBy?[{field:e.orderBy.field,path:"spec.orderBy.field"}]:[],...(e.filters||[]).map((r,t)=>({field:r.field,path:`spec.filters.${t}.field`}))]:e.kind==="records"?[...e.fields.map((r,t)=>({field:r,path:`spec.fields.${t}`})),...e.dateField?[{field:e.dateField,path:"spec.dateField"}]:[],...e.orderBy?[{field:e.orderBy.field,path:"spec.orderBy.field"}]:[],...(e.filters||[]).map((r,t)=>({field:r.field,path:`spec.filters.${t}.field`}))]:e.kind==="inputOptions"?[{field:e.labelField,path:"spec.labelField"},{field:e.valueField,path:"spec.valueField"},...e.searchField?[{field:e.searchField,path:"spec.searchField"}]:[],...(e.disambiguationFields||[]).map((r,t)=>({field:r,path:`spec.disambiguationFields.${t}`}))]:e.kind==="matrix"?Q.matrixDefinitionFields(e).flatMap((r,t)=>r.derivedField||r.name==="*"?[]:[{field:r,path:`spec.fields.${t}`}]):[]}function B(e){return!("derivedFields"in e)||!Array.isArray(e.derivedFields)?[]:e.derivedFields}function ve(e,r,t){return B(e).map(o=>({name:o.name,label:o.label,role:o.resultRole,dataType:o.dataType,source:r.source||t,...o.defaultAggregate?{aggregate:o.defaultAggregate}:{}}))}function qe(e){if(!(!e||typeof e!="object"))return e.field}function _(e,r){return{severity:r.severity,code:e.code||"invalid_analytics_intent",message:e.message,path:e.path?`${r.pathPrefix}.spec.${e.path}`:r.pathPrefix,queryHook:r.queryHook,queryId:r.queryId,intentId:d.getAnalyticsIntentId(r.intent),source:r.intent.source}}function Se(e,r){const t=z(r);return{ok:t.ok&&e.ok,errors:C([...e.errors,...t.errors]),warnings:C([...e.warnings,...t.warnings]),repairHints:[...e.repairHints,...t.repairHints]}}function z(e){const r=e.filter(o=>o.severity==="error").map(A),t=e.filter(o=>o.severity==="warning").map(A);return{ok:r.length===0,errors:r,warnings:t,repairHints:r.map(o=>{var i,n;return{code:o.code,message:o.message,fieldRole:o.fieldRole,invalidField:(i=o.repairHint)==null?void 0:i.invalidField,recommendedNextStep:((n=o.repairHint)==null?void 0:n.recommendedNextStep)||"Update the Data App SDK query spec to use visible Semaphor source and field refs."}})}}function A(e){var r;return{code:e.code,message:e.message,path:e.path,fieldRole:e.code==="invalid_source_ref"?"source":void 0,repairHint:{code:e.code,message:e.message,invalidField:(r=e.field)==null?void 0:r.name,fieldRole:e.code==="invalid_source_ref"?"source":void 0,recommendedNextStep:e.code==="unsupported_input_filter_composition"?"Use an input field from the same Semaphor source as the query, or split the query into separate source-scoped queries.":"Update the query spec to use a visible Semaphor source and field ref."}}}function C(e){const r=new Set;return e.filter(t=>{const o=`${t.code}:${t.path||""}:${t.message}`;return r.has(o)?!1:(r.add(o),!0)})}function x(e){var t;const r=e.diagnostics.filter(o=>o.severity==="error");return{intentId:d.getAnalyticsIntentId(e.intent),status:r.length?"failed":"answered",resultShape:(t=e.intent)==null?void 0:t.kind,intent:e.intent,validation:e.validation,coverage:{answeredObligations:r.length?[]:["query_spec_validation"],missingObligations:r.length?["query_spec_validation"]:[],warnings:e.validation.warnings},missingFields:r.filter(o=>o.code==="missing_field").flatMap(o=>{var i;return(i=o.field)!=null&&i.name?[o.field.name]:[]}),warnings:e.diagnostics.filter(o=>o.severity==="warning").map(o=>o.message),metadata:{validationKind:"data_app_sdk_query_spec"}}}function ke(e,r){return d.getAnalyticsIntentId(r)||O(e.spec)}function O(e){if(!e||typeof e!="object"||!("id"in e))return;const r=e.id;return typeof r=="string"&&r.trim()?r:void 0}exports.fieldWithSelectedProjectionRole=I;exports.findMatchingRelatedProjectionField=v;exports.isAllowedRelatedProjectionRole=P;exports.normalizeSemaphorAnalysisQueryOptions=M;exports.normalizeSemaphorFieldRole=$;exports.relatedProjectionFieldCandidatesForIntent=U;exports.validateSemaphorDataAppQuerySpecs=ie;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("../chunks/validators-DFeDcdpA.cjs"),N=require("../chunks/matrix-operation-contract-0RxoU_M3.cjs"),E=require("../chunks/report-runtime-context-CzSrCBsu.cjs"),K=require("../chunks/source-entity-resolution-R46X34SE.cjs"),y=require("../data-app-sdk-adapters/index.cjs"),Q=require("../chunks/matrix-card-C2RjEYZ8.cjs");function W({intent:e,field:r,catalogField:t,relativePath:o}){const i=J({intent:e,field:r,relativePath:o});if(!i||i.allowedRelatedRoles.length===0)return!1;const n=I(r,i.selectedField),s=$(t),c=h(n);return P(s,i.allowedRelatedRoles)?c===s:!1}function U(e){return e.kind==="records"?L(e):e.kind==="metric"?X(e):[]}function $(e){const r=d.normalizeAnalyticsCatalogName(e.role);if(r==="measure")return"measure";if(r==="id")return"id";const t=d.normalizeAnalyticsCatalogDataType(e.dataType);if(r==="date"||t==="date"||t==="datetime")return"date";if(r==="dimension")return"dimension"}function P(e,r){return!!(e&&r.includes(e))}function I(e,r){const t=h(e);if(t)return e.role===t?e:{...e,role:t};const o=r?h(r):void 0;return o?{...e,role:o}:e}function v(e,r){return e.find(t=>T(t,r))}function J({intent:e,field:r,relativePath:t}){if(e.kind==="records")return V(e,r,t);if(e.kind==="metric")return G(e,r,t)}function V(e,r,t){if(t.startsWith("spec.fields."))return{allowedRelatedRoles:["dimension","date","id"]};if(t==="spec.dateField"&&!e.timeWindow)return{allowedRelatedRoles:["date"]};if(t==="spec.orderBy.field"){const o=v(H(e),r);return{selectedField:o,allowedRelatedRoles:o?k(o):[]}}}function G(e,r,t){if(t.startsWith("spec.dimensions."))return{allowedRelatedRoles:["dimension"]};if(t==="spec.orderBy.field"){const o=v(e.dimensions||[],r);return{selectedField:o,allowedRelatedRoles:o?["dimension"]:[]}}}function L(e){var o,i;const r=H(e),t=(o=e.orderBy)!=null&&o.field?v(r,e.orderBy.field):void 0;return b([...r.map(n=>p(n,k(n))),...(i=e.orderBy)!=null&&i.field?[p(I(e.orderBy.field,t),t?k(t):[],{unsupportedRelatedRoleMessage:"Joined records projections support related sort fields only when the same related field is included in spec.fields.",recommendedNextStep:"Add the related sort field to spec.fields, or keep orderBy fields on the base source."})]:[]])}function X(e){var t,o;const r=(t=e.orderBy)!=null&&t.field?v(e.dimensions||[],e.orderBy.field):void 0;return b([...e.measures.map(i=>p(i,[])),...e.primaryMeasure?[p(e.primaryMeasure,[])]:[],...(e.dimensions||[]).map(i=>p(i,["dimension"])),...e.dateField?[p({...e.dateField,role:"date"},[])]:[],...(o=e.orderBy)!=null&&o.field?[p(I(e.orderBy.field,r),r?["dimension"]:[],{unsupportedRelatedRoleMessage:"Joined metric projections support related orderBy fields only when the same related field is declared in spec.dimensions.",recommendedNextStep:"Add the related field as a metric dimension when it should participate in the grouped result, or keep orderBy fields on the base source."})]:[]])}function k(e){const r=e?h(e):void 0;return r==="dimension"?["dimension"]:r==="date"?["date"]:r==="id"?["id"]:["dimension","date","id"]}function p(e,r,t={}){return{field:I(e),allowedRelatedRoles:r,...t}}function b(e){const r=[];return e.forEach(t=>{r.some(o=>Y(o,t))||r.push(t)}),r}function H(e){const r=[...e.fields];return e.dateField&&!r.some(t=>w(t,e.dateField))&&r.push({...e.dateField,role:"date"}),r}function Y(e,r){return T(e.field,r.field)&&e.allowedRelatedRoles.join("|")===r.allowedRelatedRoles.join("|")&&(e.unsupportedRelatedRoleMessage||"")===(r.unsupportedRelatedRoleMessage||"")&&(e.recommendedNextStep||"")===(r.recommendedNextStep||"")}function w(e,r){return d.semaphorFieldRefsMatch(e,r)}function T(e,r){return w(e,r)&&Z(h(e),h(r))}function Z(e,r){return!!(e&&(!r||e===r))}function h(e){return $(e)}function j({intent:e,field:r,relativePath:t,baseCatalog:o,fieldCatalogs:i}){const n=g(r,e.source),s=d.semaphorSourcesReferToSameDataset(n,e.source);if(e.kind!=="matrix"&&!s&&!re(e.source,n))return{ok:!1,code:"invalid_source_ref",message:`Field "${r.name}" references a related Semaphor source outside the query's semantic domain.`,pathSuffix:".source",source:n};const c=s?o:S(i,n);if(!c)return{ok:!1,code:"invalid_source_ref",message:`Field "${r.name}" references a Semaphor source that is not present in the visible field catalog.`,pathSuffix:".source",source:n};const a=q(c,r,e.source);return a?e.kind!=="matrix"&&!s&&!ee({intent:e,field:r,catalogField:a,relativePath:t})?{ok:!1,code:"unsupported_joined_projection",message:`Field "${r.name}" references a related Semaphor source, but this query kind does not support joined projections for that field yet.`,pathSuffix:".source",source:n}:{ok:!0,source:n,catalogField:a,usesBaseSource:s}:{ok:!1,code:"missing_field",message:`Field "${r.name}" is not visible on the selected Semaphor source.`,source:n}}function ee({intent:e,field:r,catalogField:t,relativePath:o}){return W({intent:e,field:r,catalogField:t,relativePath:o})}function re(e,r){return e.kind==="semantic"&&r.kind==="semantic"&&e.domainId===r.domainId}function S(e,r){return e.find(t=>F(t,r))}function q(e,r,t){const o=g(r,t);if(F(e,o))return e.fields.find(i=>te(i,r)&&F(e,g(i,e.source)))}function R(e){return d.normalizeAnalyticsCatalogName(e)}function g(e,r){return e.source||r}function F(e,r){return[e.source,...e.sourceAliases||[]].some(t=>d.semaphorSourcesReferToSameDataset(t,r))}function te(e,r){return!!(e.name&&r.name&&e.name===r.name)}function oe(e){const r=[];if(!e.intent.filters)return r;const t=e.intent.source,i=d.mergeSemaphorSourcesByIdentity(e.fieldCatalogs.flatMap(a=>[a.source,...a.sourceAliases??[]])).filter(a=>t.kind==="semantic"?a.kind==="semantic"&&a.domainId===t.domainId:a.kind==="physical"&&a.connectionId===t.connectionId).map(a=>a.kind==="semantic"?{type:"dataset",name:a.datasetName,id:a.datasetId,domainId:a.domainId,connectionId:a.connectionId}:{type:"table",name:a.tableName,database:a.databaseName,schema:a.schemaName,connectionId:a.connectionId,connectionType:a.connectionType,dialect:a.dialect}),n=(a,u)=>{r.push({field:a,path:u,validation:j({...e,field:a,relativePath:u})})},s=(a,u)=>{if(a.derivedField)Object.entries(a.derivedField.inputs).forEach(([l,f])=>n(f.field,`${u}.derivedField.inputs.${l}.field`));else if(a.calculatedFormula)a.calculatedFormula.inputFields.forEach((l,f)=>s(l,`${u}.calculatedFormula.inputFields.${f}`));else{const l=K.resolveSemaphorSourceEntity({entities:i,semanticDomainId:t.kind==="semantic"?t.domainId:void 0,connectionId:t.connectionId,connectionType:t.kind==="physical"?t.connectionType:void 0,dialect:t.kind==="physical"?t.dialect:void 0,fieldEntityType:a.entityType,entityId:a.entityId,entityName:a.entityName,qualifiedHints:[a.qualifiedEntityName]});l.kind==="resolved"?n({name:a.name,source:l.source},u):r.push({field:{name:a.name},path:u,validation:{ok:!1,code:"invalid_source_ref",source:t,message:`Filter field "${a.name}" has no unambiguous source in the visible field catalog (${l.kind}).`}})}},c=(a,u)=>{a.conditions.forEach((l,f)=>s(l.field,`${u}.conditions.${f}.field`)),a.groups.forEach((l,f)=>c(l,`${u}.groups.${f}`))};return c(e.intent.filters,"spec.filters"),r}function M(e,r={}){const t=r.pathPrefix||"analysisOptions";if(e===void 0)return{ok:!0};if(!e||typeof e!="object"||Array.isArray(e))return m(t,"Data App analysis options must be an object.");const o=e,i={};if(o.chartTitle!==void 0){if(typeof o.chartTitle!="string")return m(`${t}.chartTitle`,'Data App analysis option "chartTitle" must be a string.');i.chartTitle=o.chartTitle}if(o.chartType!==void 0){if(typeof o.chartType!="string")return m(`${t}.chartType`,'Data App analysis option "chartType" must be a string.');i.chartType=o.chartType}if(o.driverMode!==void 0){if(!ne(o.driverMode))return m(`${t}.driverMode`,'Data App analysis option "driverMode" must be absolute_delta, largest_negative, largest_positive, positive_and_negative, or all.');i.driverMode=o.driverMode}if(o.includePopulation!==void 0){if(typeof o.includePopulation!="boolean")return m(`${t}.includePopulation`,'Data App analysis option "includePopulation" must be a boolean.');i.includePopulation=o.includePopulation}if(o.calendarContext!==void 0){const n=se(o.calendarContext,{pathPrefix:`${t}.calendarContext`,validateTimezone:r.validateTimezone});if(!n.ok)return n;i.calendarContext=n.calendarContext}return{ok:!0,analysisOptions:i}}function ie(e){const r=e.queries.map((i,n)=>ae(i,n,{fieldCatalogs:e.fieldCatalogs||[],requireFieldCatalog:!!e.requireFieldCatalog,validateTimezone:e.validateTimezone})),t=r.flatMap(i=>i.diagnostics),o=r.map(i=>i.executionResult);return{ok:t.every(i=>i.severity!=="error"),diagnostics:t,queries:r,intents:r.flatMap(i=>i.intent?[i.intent]:[]),executionResults:o}}function ae(e,r,t){const o=`queries.${r}`;try{const i=de(e),n=ke(e,i),s=d.validateSemaphorAnalyticsIntent(i),c=[...ge({querySpec:e,queryId:n,intent:i,pathPrefix:o}),...s.errors.map(u=>_(u,{queryHook:e.queryHook,queryId:n,pathPrefix:o,severity:"error",intent:i})),...s.warnings.map(u=>_(u,{queryHook:e.queryHook,queryId:n,pathPrefix:o,severity:"warning",intent:i})),...ce({querySpec:e,queryId:n,intent:i,pathPrefix:o,fieldCatalogs:t.fieldCatalogs,requireFieldCatalog:t.requireFieldCatalog}),...he({querySpec:e,queryId:n,intent:i,pathPrefix:o,validateTimezone:t.validateTimezone})],a=Se(s,c);return{queryHook:e.queryHook,queryId:n,intent:i,diagnostics:c,executionResult:x({intent:i,validation:a,diagnostics:c})}}catch(i){const n={severity:"error",code:"invalid_query_spec",message:i instanceof Error?i.message:String(i),path:o,queryHook:e.queryHook,queryId:O(e.spec)},s=z([n]);return{queryHook:e.queryHook,queryId:n.queryId,diagnostics:[n],executionResult:x({validation:s,diagnostics:[n]})}}}function m(e,r){return{ok:!1,issues:[{code:"invalid_analysis_option",message:r,path:e}]}}function D(e){return!!(e&&typeof e=="object"&&!Array.isArray(e))}function ne(e){return e==="absolute_delta"||e==="largest_negative"||e==="largest_positive"||e==="positive_and_negative"||e==="all"}function se(e,r){if(!e||typeof e!="object"||Array.isArray(e))return m(r.pathPrefix,'Data App analysis option "calendarContext" must be an object.');const t=e,o=t.tz;let i=o;if(typeof o=="string"&&r.validateTimezone&&(i=r.validateTimezone(o)),i===null)return m(`${r.pathPrefix}.tz`,'Data App analysis option "calendarContext.tz" must be a valid timezone string.');const n=E.parseCalendarContext({...t,tz:i});if(!n.ok){const s=n.issues[0];return m(s!=null&&s.path?`${r.pathPrefix}.${s.path}`:r.pathPrefix,`Data App analysis option "calendarContext" is invalid: ${(s==null?void 0:s.message)??"invalid value"}.`)}return{ok:!0,calendarContext:n.value}}function de(e){return le(e.spec)}function le(e){if(!D(e))throw new Error("useSemaphorQuery spec must be an object.");if(e.queryKind==="metric")return y.toSemaphorMetricIntent(e);if(e.queryKind==="analysis")return y.toSemaphorAnalysisIntent(e);if(e.queryKind==="records")return y.toSemaphorRecordsIntent(e);if(e.queryKind==="sql")return y.toSemaphorSqlIntent(e);if(e.queryKind==="matrix")return y.toSemaphorMatrixIntent(e);if(e.queryKind==="inputOptions")return y.toSemaphorInputOptionsIntent(e);throw new Error("useSemaphorQuery spec.queryKind must be metric, analysis, records, inputOptions, sql, or matrix.")}function ce(e){if(e.intent.kind==="sql")return[];if(e.fieldCatalogs.length===0&&!e.requireFieldCatalog)return[];const r=S(e.fieldCatalogs,e.intent.source);if(!r)return[{severity:"error",code:"invalid_source_ref",message:`Source ref for ${e.querySpec.queryHook} does not match a visible Semaphor source.`,path:`${e.pathPrefix}.spec.source`,queryHook:e.querySpec.queryHook,queryId:e.queryId,intentId:d.getAnalyticsIntentId(e.intent),source:e.intent.source}];const t=fe({...e,catalog:r}),o={...r,fields:[...r.fields,...ve(e.intent,r,e.intent.source)]};return[...t,...ue({...e,fieldCatalogs:e.fieldCatalogs}),...me({...e,catalog:o,fieldCatalogs:e.fieldCatalogs}),...pe({...e,catalog:o,fieldCatalogs:e.fieldCatalogs})]}function ue(e){var t;if(e.intent.kind!=="inputOptions"||((t=e.intent.population)==null?void 0:t.kind)!=="related_population")return[];const r=e.intent.population.baseSource;return S(e.fieldCatalogs,r)?[]:[{severity:"error",code:"invalid_source_ref",message:"Input options related population baseSource does not match a visible Semaphor source.",path:`${e.pathPrefix}.spec.population.baseSource`,queryHook:e.querySpec.queryHook,queryId:e.queryId,intentId:d.getAnalyticsIntentId(e.intent),source:r}]}function fe(e){const r=B(e.intent);if(r.length===0)return[];const t=[],o=new Set;return r.forEach((i,n)=>{const s=`${e.pathPrefix}.spec.derivedFields.${n}`,c=R(i.name);c&&(o.has(c)&&t.push({severity:"error",code:"duplicate_derived_field",message:`Derived field "${i.name}" is declared more than once.`,path:`${s}.name`,queryHook:e.querySpec.queryHook,queryId:e.queryId,intentId:d.getAnalyticsIntentId(e.intent),source:e.intent.source}),o.add(c),e.catalog.fields.some(a=>R(a.name)===c)&&t.push({severity:"error",code:"derived_field_name_collision",message:`Derived field "${i.name}" conflicts with a field already visible on the selected Semaphor source.`,path:`${s}.name`,queryHook:e.querySpec.queryHook,queryId:e.queryId,intentId:d.getAnalyticsIntentId(e.intent),source:e.intent.source})),Object.entries(i.inputs||{}).forEach(([a,u])=>{const l=qe(u);if(!l)return;const f=g(l,e.intent.source);if(!d.semaphorSourcesReferToSameDataset(f,e.intent.source)){t.push({severity:"error",code:"unsupported_derived_field_source",message:`Derived field "${i.name}" input "${a}" references a different Semaphor source. App-local derived fields must use fields from the query source.`,path:`${s}.inputs.${a}`,queryHook:e.querySpec.queryHook,queryId:e.queryId,intentId:d.getAnalyticsIntentId(e.intent),source:f,field:l});return}q(e.catalog,l,e.intent.source)||t.push({severity:"error",code:"missing_field",message:`Derived field "${i.name}" input "${a}" references field "${l.name}", which is not visible on the selected Semaphor source.`,path:`${s}.inputs.${a}`,queryHook:e.querySpec.queryHook,queryId:e.queryId,intentId:d.getAnalyticsIntentId(e.intent),source:f,field:l})})}),t}function me(e){const r=Ie(e.intent).map(({field:t,path:o})=>{const i=j({intent:e.intent,field:t,relativePath:o,baseCatalog:e.catalog,fieldCatalogs:e.fieldCatalogs});return{field:t,path:o,validation:i}});return e.intent.kind==="matrix"&&r.push(...oe({intent:e.intent,baseCatalog:e.catalog,fieldCatalogs:e.fieldCatalogs})),r.flatMap(({field:t,path:o,validation:i})=>i.ok?[]:[{severity:"error",code:i.code,message:i.message,path:`${e.pathPrefix}.${o}${i.pathSuffix||""}`,queryHook:e.querySpec.queryHook,queryId:e.queryId,intentId:d.getAnalyticsIntentId(e.intent),source:i.source,field:t}])}function pe(e){return("inputs"in e.intent?e.intent.inputs||[]:[]).flatMap((t,o)=>{if(!t.field)return[];const i=g(t.field,e.intent.source);if(!d.semaphorSourcesReferToSameDataset(i,e.intent.source)){if(ye(e.intent,i)){const n=S(e.fieldCatalogs,i);return n?q(n,t.field,i)?[]:[{severity:"error",code:"missing_field",message:`Input "${t.inputId}" references field "${t.field.name}", which is not visible on the selected Semaphor source.`,path:`${e.pathPrefix}.spec.inputs.${o}.field`,queryHook:e.querySpec.queryHook,queryId:e.queryId,intentId:d.getAnalyticsIntentId(e.intent),source:i,field:t.field}]:[{severity:"error",code:"invalid_source_ref",message:`Input "${t.inputId}" references a Semaphor source that is not present in the visible field catalog.`,path:`${e.pathPrefix}.spec.inputs.${o}.field.source`,queryHook:e.querySpec.queryHook,queryId:e.queryId,intentId:d.getAnalyticsIntentId(e.intent),source:i,field:t.field}]}return[{severity:"error",code:"unsupported_input_filter_composition",message:`Input "${t.inputId}" filters a different Semaphor source than the query, and no relationship-aware semantic validation path is available for this query kind.`,path:`${e.pathPrefix}.spec.inputs.${o}.field`,queryHook:e.querySpec.queryHook,queryId:e.queryId,intentId:d.getAnalyticsIntentId(e.intent),source:i,field:t.field}]}return q(e.catalog,t.field,e.intent.source)?[]:[{severity:"error",code:"missing_field",message:`Input "${t.inputId}" references field "${t.field.name}", which is not visible on the selected Semaphor source.`,path:`${e.pathPrefix}.spec.inputs.${o}.field`,queryHook:e.querySpec.queryHook,queryId:e.queryId,intentId:d.getAnalyticsIntentId(e.intent),source:i,field:t.field}]})}function ye(e,r){return e.source.kind==="semantic"&&r.kind==="semantic"&&r.domainId===e.source.domainId}function he(e){if(e.querySpec.spec.queryKind!=="analysis")return[];const r=M(e.querySpec.spec,{pathPrefix:`${e.pathPrefix}.spec`,validateTimezone:e.validateTimezone});return r.ok?[]:r.issues.map(t=>({severity:"error",code:t.code,message:t.message,path:t.path,queryHook:e.querySpec.queryHook,queryId:e.queryId,intentId:d.getAnalyticsIntentId(e.intent),source:e.intent.source}))}function ge(e){if(e.querySpec.spec.queryKind==="matrix"){const r=N.matrixWindowRequestSchema.safeParse(e.querySpec.spec.matrixWindowRequest);return r.success?[]:r.error.issues.map(t=>({severity:"error",code:"invalid_query_spec",message:t.message,path:[e.pathPrefix,"spec","matrixWindowRequest",...t.path].join("."),queryHook:e.querySpec.queryHook,queryId:e.queryId,intentId:d.getAnalyticsIntentId(e.intent)}))}return e.querySpec.spec.queryKind!=="sql"?[]:D(e.querySpec.spec)?Object.prototype.hasOwnProperty.call(e.querySpec.spec,"parameters")?[{severity:"error",code:"deprecated_sql_parameters",message:"semaphor.sql uses defaultParameters for static SQL param(...) fallback values. The legacy parameters field is not supported.",path:`${e.pathPrefix}.spec.parameters`,queryHook:e.querySpec.queryHook,queryId:e.queryId,intentId:d.getAnalyticsIntentId(e.intent)}]:[]:[]}function Ie(e){return e.kind==="metric"?[...e.measures.map((r,t)=>({field:r,path:`spec.measures.${t}`})),...e.primaryMeasure?[{field:e.primaryMeasure,path:"spec.primaryMeasure"}]:[],...e.dateField?[{field:e.dateField,path:"spec.dateField"}]:[],...(e.dimensions||[]).map((r,t)=>({field:r,path:`spec.dimensions.${t}`})),...e.orderBy?[{field:e.orderBy.field,path:"spec.orderBy.field"}]:[],...(e.filters||[]).map((r,t)=>({field:r.field,path:`spec.filters.${t}.field`}))]:e.kind==="records"?[...e.fields.map((r,t)=>({field:r,path:`spec.fields.${t}`})),...e.dateField?[{field:e.dateField,path:"spec.dateField"}]:[],...e.orderBy?[{field:e.orderBy.field,path:"spec.orderBy.field"}]:[],...(e.filters||[]).map((r,t)=>({field:r.field,path:`spec.filters.${t}.field`}))]:e.kind==="inputOptions"?[{field:e.labelField,path:"spec.labelField"},{field:e.valueField,path:"spec.valueField"},...e.searchField?[{field:e.searchField,path:"spec.searchField"}]:[],...(e.disambiguationFields||[]).map((r,t)=>({field:r,path:`spec.disambiguationFields.${t}`}))]:e.kind==="matrix"?Q.matrixDefinitionFields(e).flatMap((r,t)=>r.derivedField||r.name==="*"?[]:[{field:r,path:`spec.fields.${t}`}]):[]}function B(e){return!("derivedFields"in e)||!Array.isArray(e.derivedFields)?[]:e.derivedFields}function ve(e,r,t){return B(e).map(o=>({name:o.name,label:o.label,role:o.resultRole,dataType:o.dataType,source:r.source||t,...o.defaultAggregate?{aggregate:o.defaultAggregate}:{}}))}function qe(e){if(!(!e||typeof e!="object"))return e.field}function _(e,r){return{severity:r.severity,code:e.code||"invalid_analytics_intent",message:e.message,path:e.path?`${r.pathPrefix}.spec.${e.path}`:r.pathPrefix,queryHook:r.queryHook,queryId:r.queryId,intentId:d.getAnalyticsIntentId(r.intent),source:r.intent.source}}function Se(e,r){const t=z(r);return{ok:t.ok&&e.ok,errors:C([...e.errors,...t.errors]),warnings:C([...e.warnings,...t.warnings]),repairHints:[...e.repairHints,...t.repairHints]}}function z(e){const r=e.filter(o=>o.severity==="error").map(A),t=e.filter(o=>o.severity==="warning").map(A);return{ok:r.length===0,errors:r,warnings:t,repairHints:r.map(o=>{var i,n;return{code:o.code,message:o.message,fieldRole:o.fieldRole,invalidField:(i=o.repairHint)==null?void 0:i.invalidField,recommendedNextStep:((n=o.repairHint)==null?void 0:n.recommendedNextStep)||"Update the Data App SDK query spec to use visible Semaphor source and field refs."}})}}function A(e){var r;return{code:e.code,message:e.message,path:e.path,fieldRole:e.code==="invalid_source_ref"?"source":void 0,repairHint:{code:e.code,message:e.message,invalidField:(r=e.field)==null?void 0:r.name,fieldRole:e.code==="invalid_source_ref"?"source":void 0,recommendedNextStep:e.code==="unsupported_input_filter_composition"?"Use an input field from the same Semaphor source as the query, or split the query into separate source-scoped queries.":"Update the query spec to use a visible Semaphor source and field ref."}}}function C(e){const r=new Set;return e.filter(t=>{const o=`${t.code}:${t.path||""}:${t.message}`;return r.has(o)?!1:(r.add(o),!0)})}function x(e){var t;const r=e.diagnostics.filter(o=>o.severity==="error");return{intentId:d.getAnalyticsIntentId(e.intent),status:r.length?"failed":"answered",resultShape:(t=e.intent)==null?void 0:t.kind,intent:e.intent,validation:e.validation,coverage:{answeredObligations:r.length?[]:["query_spec_validation"],missingObligations:r.length?["query_spec_validation"]:[],warnings:e.validation.warnings},missingFields:r.filter(o=>o.code==="missing_field").flatMap(o=>{var i;return(i=o.field)!=null&&i.name?[o.field.name]:[]}),warnings:e.diagnostics.filter(o=>o.severity==="warning").map(o=>o.message),metadata:{validationKind:"data_app_sdk_query_spec"}}}function ke(e,r){return d.getAnalyticsIntentId(r)||O(e.spec)}function O(e){if(!e||typeof e!="object"||!("id"in e))return;const r=e.id;return typeof r=="string"&&r.trim()?r:void 0}exports.fieldWithSelectedProjectionRole=I;exports.findMatchingRelatedProjectionField=v;exports.isAllowedRelatedProjectionRole=P;exports.normalizeSemaphorAnalysisQueryOptions=M;exports.normalizeSemaphorFieldRole=$;exports.relatedProjectionFieldCandidatesForIntent=U;exports.validateSemaphorDataAppQuerySpecs=ie;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Q } from "../chunks/matrix-operation-contract-
|
|
3
|
-
import { p as W } from "../chunks/report-runtime-context-
|
|
4
|
-
import { o as U } from "../chunks/source-entity-resolution-
|
|
1
|
+
import { ai as b, al as N, s as O, a$ as v, u as E, ad as K, aX as l } from "../chunks/validators-CsdOtZI6.js";
|
|
2
|
+
import { Q } from "../chunks/matrix-operation-contract-D32U2CSw.js";
|
|
3
|
+
import { p as W } from "../chunks/report-runtime-context-CxIoGyNM.js";
|
|
4
|
+
import { o as U } from "../chunks/source-entity-resolution-Bzefiive.js";
|
|
5
5
|
import { toSemaphorMetricIntent as J, toSemaphorAnalysisIntent as V, toSemaphorRecordsIntent as G, toSemaphorSqlIntent as L, toSemaphorMatrixIntent as X, toSemaphorInputOptionsIntent as Y } from "../data-app-sdk-adapters/index.js";
|
|
6
|
-
import { m as Z } from "../chunks/matrix-card-
|
|
6
|
+
import { m as Z } from "../chunks/matrix-card-CIlz0Dnp.js";
|
|
7
7
|
function ee({
|
|
8
8
|
intent: e,
|
|
9
9
|
field: r,
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
2
|
-
`){return
|
|
3
|
-
`}exports.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const v=require("../chunks/index-Cw2ypaFl.cjs"),s=require("../chunks/raw-temporal-eJXecCyJ.cjs"),o=require("../chunks/pivot-header-presentation-EoUS5ze5.cjs"),f=require("../chunks/matrix-formatter-BJTO8ky9.cjs"),y=require("../chunks/validators-DFeDcdpA.cjs"),p=require("../chunks/matrix-continuation-6nhDy-lF.cjs"),g=require("../chunks/semantic-format-mVI32OJH.cjs"),E=require("../pdf-export-policy/index.cjs"),u=require("../chunks/pivot-result-lifecycle-gl9cBfB-.cjs"),c=require("../chunks/temporal-bucket-4YEPEKlJ.cjs"),x=require("../chunks/metric-comparison-CUmltzpz.cjs"),R=require("../chunks/pivot-result-identity-gquWljbd.cjs"),w=require("../chunks/raw-temporal-contract-CklMVG_1.cjs");function _(e,r){const l=[];r.includeHeaders&&l.push(o.arrayToCSVRow(r.visibleColumns,r.delimiter));for(const t of e){const i=f.formatRowForExport(t,r);l.push(i.map(n=>o.escapeCSVValue(n,r.delimiter)).join(r.delimiter))}return l}function I(e,r,l=`
|
|
2
|
+
`){return _(e,r).join(l)}function h(e,r,l){for(const t of e){if(t.level<l){r[t.level].push(t.name);for(let i=1;i<t.colspan;i++)r[t.level].push("")}t.children?h(t.children,r,l):t.columnKey&&r[l].push(t.name)}}function F(e){const r=e.pivotByColumns.length,l=e.groupByColumns.length,t=Array.from({length:r+1},()=>[]);for(let i=0;i<r;i++)t[i].push(...Array(l).fill(""));if(t[r].push(...e.groupByColumns.map(i=>i.label||i.name)),h(e.columnHeadersTree,t,r),e.showRowTotals){for(let i=0;i<r;i++)t[i].push("");t[r].push("Total")}return t}function N(e,r,l){if(e==null)return"";if(!l.useFormattedValues)return String(e);const t=l.columnSettings[r];return typeof e=="number"&&(t==null?void 0:t.type)==="number"?s.formatNumberWithColumnSettings(e,t.numberFormat,l.locale):typeof e=="number"?e.toLocaleString(l.locale):String(e)}function M(e,r,l){const t=[];e.fieldValues.forEach((n,a)=>{e.isSubtotal&&a===0?t.push(`${n} Total`):e.isSubtotal?t.push(""):t.push(String(n??""))});let i=0;return r.columnHeaders.forEach(n=>{var m;const a=(m=e.cells[n])==null?void 0:m.value,T=N(a,n,l);t.push(T),r.showRowTotals&&typeof a=="number"&&(i+=a)}),r.showRowTotals&&t.push(i.toLocaleString(l.locale)),t}function O(e,r,l){const t=[];if(l.includeHeaders){const i=F(r);for(const n of i)t.push(o.arrayToCSVRow(n,l.delimiter))}for(const i of e){const n=M(i,r,l);t.push(n.map(a=>o.escapeCSVValue(a,l.delimiter)).join(l.delimiter))}return t}function A(e){if(e===null||typeof e!="object"||Array.isArray(e))return!1;const r=Object.getPrototypeOf(e);return r===null||r===Object.prototype}function S(e,r,l){const t=new Set(r),i=Object.keys(e).find(n=>!t.has(n));if(i)throw new Error(`${l} contains unknown property "${i}"`)}function D(e,r="tableTotalsRequest"){if(!A(e))throw new Error(`${r} must be an object`);if(S(e,["source","columns"],r),e.source!=="documentFlatTable")throw new Error(`${r}.source must be documentFlatTable`);if(!Array.isArray(e.columns)||e.columns.length===0)throw new Error(`${r}.columns must be a non-empty array`);let l=0;const t=e.columns.map((a,T)=>{const m=`${r}.columns.${T}`;if(!A(a))throw new Error(`${m} must be an object`);S(a,["fieldId","role","behavior","metricAlias","label"],m);const b=typeof a.fieldId=="string"?a.fieldId.trim():"";if(!b)throw new Error(`${m}.fieldId must be a non-empty string`);if(a.role!=="detail"&&a.role!=="groupby"&&a.role!=="metric")throw new Error(`${m}.role is invalid`);const C=a.role;if(a.behavior!=="sum"&&a.behavior!=="avg"&&a.behavior!=="count"&&a.behavior!=="label")throw new Error(`${m}.behavior is invalid`);const P=a.behavior,d=typeof a.metricAlias=="string"?a.metricAlias.trim():void 0;if(a.metricAlias!==void 0&&!d)throw new Error(`${m}.metricAlias must be a non-empty string`);if(d&&C!=="metric")throw new Error(`${m}.metricAlias requires metric role`);if(P==="label"){if(l+=1,C==="metric")throw new Error(`${m}.behavior label requires a non-metric role`)}else if(C!=="metric")throw new Error(`${m}.${P} requires metric role`);if(a.label!==void 0&&typeof a.label!="string")throw new Error(`${m}.label must be a string`);return{fieldId:b,role:C,behavior:P,...d?{metricAlias:d}:{},...a.label!==void 0?{label:a.label}:{}}}),i=new Map,n=new Set;for(const a of t){if(a.metricAlias){if(n.has(a.metricAlias))throw new Error(`${r}.columns duplicates metricAlias "${a.metricAlias}"`);n.add(a.metricAlias)}const T=i.get(a.fieldId)??[];T.push(a),i.set(a.fieldId,T)}for(const[a,T]of i)if(T.length!==1){for(const m of T)if(m.role!=="metric"||!m.metricAlias)throw new Error(`${r}.columns duplicates fieldId "${a}" without distinct metricAlias values`)}if(l>1)throw new Error(`${r}.columns may contain at most one label`);return{source:"documentFlatTable",columns:t}}function B(e,r="tableTotalsByColumnId"){if(!A(e))throw new Error(`${r} must be an object`);const l={};for(const[t,i]of Object.entries(e)){if(!t.trim())throw new Error(`${r} contains an empty column id`);if(i!==null&&typeof i!="string"&&(typeof i!="number"||!Number.isFinite(i)))throw new Error(`${r}.${t} must be a string, finite number, or null`);l[t]=i}if(Object.keys(l).length===0)throw new Error(`${r} must not be empty`);return l}function V(e){if(typeof e=="number")return Number.isFinite(e)?e:null;if(!e.trim())return null;const r=Number(e);return Number.isFinite(r)?r:null}function L(e){const r=e.visibleColumns.map(l=>{const i=Object.prototype.hasOwnProperty.call(e.totalsByColumnId,l)?e.totalsByColumnId[l]:l===e.labelColumnKey?"Total":null;if(i===null)return"";if(!e.useFormattedValues)return String(i);const n=u.findResolvedMeasureFormat({snapshot:e.snapshot,scope:e.scope,target:{kind:"column",columnKey:l}}),a=n?V(i):null;return n&&a!==null?s.formatMeasureCanonical(a,n):String(i)});return`${o.arrayToCSVRow(r,e.delimiter)}
|
|
3
|
+
`}exports.isMeasureCanonicalFormat=v.isMeasureCanonicalFormat;exports.isNumericCanonicalFormat=v.isNumericCanonicalFormat;exports.RawTemporalFormatContractError=s.RawTemporalFormatContractError;exports.assertRawTemporalChunkClassificationAgreement=s.assertRawTemporalChunkClassificationAgreement;exports.classifyDeclaredSqlTemporalColumn=s.classifyDeclaredSqlTemporalColumn;exports.createRawTemporalChunkClassificationEvidence=s.createRawTemporalChunkClassificationEvidence;exports.formatCurrency=s.formatCurrency;exports.formatDuration=s.formatDuration;exports.formatDurationCanonical=s.formatDurationCanonical;exports.formatMeasureCanonical=s.formatMeasureCanonical;exports.formatNumber=s.formatNumber;exports.formatNumberCustom=s.formatNumberCustom;exports.formatNumberWithColumnSettings=s.formatNumberWithColumnSettings;exports.formatNumericCanonical=s.formatNumericCanonical;exports.formatPercent=s.formatPercent;exports.formatRawTemporalValue=s.formatRawTemporalValue;exports.formatScientific=s.formatScientific;exports.parseNumericCanonicalFormat=s.parseNumericCanonicalFormat;exports.parseRawTemporalChunkClassificationEvidence=s.parseRawTemporalChunkClassificationEvidence;exports.parseResolvedNumericCanonicalFormat=s.parseResolvedNumericCanonicalFormat;exports.parseResolvedRawTemporalFormat=s.parseResolvedRawTemporalFormat;exports.prepareRawTemporalFormatter=s.prepareRawTemporalFormatter;exports.resolveCurrencyFractionDigits=s.resolveCurrencyFractionDigits;exports.resolveNumericPresentation=s.resolveNumericPresentation;exports.resolveRawTemporalFormat=s.resolveRawTemporalFormat;exports.validateCardExportNumericPresentationSnapshot=s.validateCardExportNumericPresentationSnapshot;exports.validateRawTemporalPattern=s.validateRawTemporalPattern;exports.AGGREGATE_PDF_CONTINUATION_CLASS=o.PDF_GROUP_CONTINUATION_CLASS;exports.AGGREGATE_TOTAL_MEMBER_MARKER=o.AGGREGATE_TOTAL_MEMBER_MARKER;exports.DIRECT_CSV_EXPORT_MAX_ROWS=o.DIRECT_CSV_EXPORT_MAX_ROWS;exports.FULL_DATASET_CSV_EXPORT_MAX_ROWS=o.FULL_DATASET_CSV_EXPORT_MAX_ROWS;exports.MATRIX_EXPORT_MAX_ARTIFACT_BYTES=o.MATRIX_EXPORT_MAX_ARTIFACT_BYTES;exports.MATRIX_EXPORT_MAX_CELLS=o.MATRIX_EXPORT_MAX_CELLS;exports.MATRIX_EXPORT_MAX_ENCODED_BYTES=o.MATRIX_EXPORT_MAX_ENCODED_BYTES;exports.MATRIX_PRINT_DEFAULT_DECIMALS=o.MATRIX_PRINT_DEFAULT_DECIMALS;exports.MATRIX_PRINT_ORGANIZATION_DEFAULTS=o.MATRIX_PRINT_ORGANIZATION_DEFAULTS;exports.PDF_GROUP_CONTINUATION_CLASS=o.PDF_GROUP_CONTINUATION_CLASS;exports.PdfSafetyLimitError=o.PdfSafetyLimitError;exports.PivotHeaderPresentationError=o.PivotHeaderPresentationError;exports.applyMatrixPrintNumberDefaults=o.applyMatrixPrintNumberDefaults;exports.applyMatrixPrintOrganization=o.applyMatrixPrintOrganization;exports.arrayToCSV=o.arrayToCSV;exports.arrayToCSVRow=o.arrayToCSVRow;exports.buildMatrixPrintTable=o.buildMatrixPrintTable;exports.buildMatrixTableStructure=o.buildMatrixTableStructure;exports.escapeCSVValue=o.escapeCSVValue;exports.formatAggregateGrandTotalLabel=o.formatAggregateGrandTotalLabel;exports.formatAggregateGroupCell=o.formatAggregateGroupCell;exports.formatAggregateGroupRow=o.formatAggregateGroupRow;exports.formatAggregateSubtotalLabel=o.formatAggregateSubtotalLabel;exports.formatMetricComparison=o.formatMetricComparison;exports.isAggregateTotalMemberMarker=o.isAggregateTotalMemberMarker;exports.matrixFlatCsvHeaders=o.matrixFlatCsvHeaders;exports.matrixFlatCsvRow=o.matrixFlatCsvRow;exports.objectsToCSV=o.objectsToCSV;exports.planMatrixKeepWithPrevious=o.planMatrixKeepWithPrevious;exports.prepareMatrixExportPresentation=o.prepareMatrixExportPresentation;exports.presentAggregateGroupRow=o.presentAggregateGroupRow;exports.presentPivotHeader=o.presentPivotHeader;exports.protectCSVText=o.protectCSVText;exports.readPdfErrorResponse=o.readPdfErrorResponse;exports.requestStructuredPdf=o.requestStructuredPdf;exports.requiresChunkedCsvExport=o.requiresChunkedCsvExport;exports.resolveAggregateTablePresentationContext=o.resolveAggregateTablePresentationContext;exports.shouldPresentAggregateGroupValue=o.shouldPresentAggregateGroupValue;exports.formatCellValue=f.formatCellValue;exports.formatDate=f.formatDate;exports.formatRelativeTime=f.formatRelativeTime;exports.formatRowForExport=f.formatRowForExport;exports.getTimezoneAbbreviation=f.getTimezoneAbbreviation;exports.getTimezoneName=f.getTimezoneName;exports.parseWithSourceTimezone=f.parseWithSourceTimezone;exports.resolveTimezone=f.resolveTimezone;exports.SEMAPHOR_GENERATED_COUNT_METRIC_ID=y.SEMAPHOR_GENERATED_COUNT_METRIC_ID;exports.MATRIX_EXPORT_TRANSFER_BYTES=p.MATRIX_EXPORT_TRANSFER_BYTES;exports.assertMatrixBatchResponseSize=p.assertMatrixBatchResponseSize;exports.matrixAttemptKey=p.matrixAttemptKey;exports.matrixBatchInputSchema=p.matrixBatchInputSchema;exports.matrixBatchResponseSchema=p.matrixBatchResponseSchema;exports.matrixExportDeadlineSchema=p.matrixExportDeadlineSchema;exports.matrixManifestSchema=p.matrixManifestSchema;exports.parseMatrixAttemptKey=p.parseMatrixAttemptKey;exports.parseMatrixBatchResponse=p.parseMatrixBatchResponse;exports.parseMatrixManifest=p.parseMatrixManifest;exports.fromSemanticFormat=g.fromSemanticFormat;exports.FAST_PDF_POLICY=E.FAST_PDF_POLICY;exports.PDF_SAFETY_LIMIT_EXCEEDED=E.PDF_SAFETY_LIMIT_EXCEEDED;exports.getUtf8ByteLength=E.getUtf8ByteLength;exports.isFastPdfOutputSizeEligible=E.isFastPdfOutputSizeEligible;exports.isFastPdfPageCountEligible=E.isFastPdfPageCountEligible;exports.isFastPdfRequestSizeEligible=E.isFastPdfRequestSizeEligible;exports.isFastPdfRowCountEligible=E.isFastPdfRowCountEligible;exports.MissingResolvedRawTemporalFormatError=u.MissingResolvedRawTemporalFormatError;exports.PivotResultLifecycleError=u.PivotResultLifecycleError;exports.PresentationExecutionSnapshotError=u.PresentationExecutionSnapshotError;exports.createCanonicalPivotResultTransport=u.createCanonicalPivotResultTransport;exports.createPresentationExecutionSnapshot=u.createPresentationExecutionSnapshot;exports.deriveMetricInstanceAliasExpectations=u.deriveMetricInstanceAliasExpectations;exports.derivePivotResultContractExpectations=u.derivePivotResultContractExpectations;exports.findResolvedMeasureFormat=u.findResolvedMeasureFormat;exports.findResolvedNumericFormat=u.findResolvedNumericFormat;exports.findResolvedRawTemporalFormat=u.findResolvedRawTemporalFormat;exports.findResolvedTemporalBucketFormat=u.findResolvedTemporalBucketFormat;exports.parseCanonicalPivotResultTransport=u.parseCanonicalPivotResultTransport;exports.parsePresentationExecutionSnapshot=u.parsePresentationExecutionSnapshot;exports.parsePresentationScope=u.parsePresentationScope;exports.parseResolvedPresentationEntries=u.parseResolvedPresentationEntries;exports.validateCardExportPresentationSnapshot=u.validateCardExportPresentationSnapshot;exports.DEFAULT_RESOLVED_TEMPORAL_STYLE_SET=c.DEFAULT_RESOLVED_TEMPORAL_STYLE_SET;exports.TEMPORAL_BUCKET_PATTERN_TOKENS=c.TEMPORAL_BUCKET_PATTERN_TOKENS;exports.TemporalBucketContractError=c.TemporalBucketContractError;exports.formatTemporalBucket=c.formatTemporalBucket;exports.isTemporalBucketPreset=c.isTemporalBucketPreset;exports.parseResolvedTemporalBucketFormat=c.parseResolvedTemporalBucketFormat;exports.parseTemporalBucketValue=c.parseTemporalBucketValue;exports.resolveApplicableTemporalBucketFormat=c.resolveApplicableTemporalBucketFormat;exports.resolveTemporalBucketPresentation=c.resolveTemporalBucketPresentation;exports.tokenizeTemporalBucketPattern=c.tokenizeTemporalBucketPattern;exports.validateTemporalBucketFormatApplicability=c.validateTemporalBucketFormatApplicability;exports.resolveMetricResultAlias=x.resolveMetricResultAlias;exports.PivotResultIdentityError=R.PivotResultIdentityError;exports.isPivotEmptyTupleAllowed=R.isPivotEmptyTupleAllowed;exports.isPivotSubtotalPrefix=R.isPivotSubtotalPrefix;exports.requirePivotHeaderMembers=R.requirePivotHeaderMembers;exports.requirePivotResultColumnIdentities=R.requirePivotResultColumnIdentities;exports.resolveQueryColumnKeyMapEntry=R.resolveQueryColumnKeyMapEntry;exports.resolveUniqueQueryColumnKeyMapEntry=R.resolveUniqueQueryColumnKeyMapEntry;exports.parseRawTemporalValueMetadata=w.parseRawTemporalValueMetadata;exports.validateRawTemporalResultColumn=w.validateRawTemporalResultColumn;exports.buildFlatTableExportTotalsFooter=L;exports.formatPivotDataRow=M;exports.formatPivotTableForCSV=O;exports.formatTableForCSV=_;exports.generatePivotHeaders=F;exports.generateTableCSV=I;exports.parseFlatTableExportTotalsByColumnId=B;exports.parseFlatTableExportTotalsRequest=D;
|