react-semaphor 0.1.459 → 0.1.461
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 +32 -32
- 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 +4 -4
- package/dist/chunks/{analyze-result-contract-BbRJ-C06.js → analyze-result-contract-DROq4vgY.js} +1 -1
- package/dist/chunks/{analyze-result-contract-LPDNldic.cjs → analyze-result-contract-DSGoFuXQ.cjs} +1 -1
- package/dist/chunks/canonical-result-keys-CEQefvdO.js +33 -0
- package/dist/chunks/canonical-result-keys-Cb96edol.cjs +1 -0
- package/dist/chunks/{common-types-H51FLKB7.js → common-types-BHVKgxRR.js} +1 -1
- package/dist/chunks/{common-types-C57kJ59w.cjs → common-types-BcV9PD9D.cjs} +1 -1
- package/dist/chunks/{dashboard-briefing-launcher-ClCj98sq.js → dashboard-briefing-launcher-3owMxX5K.js} +60 -61
- package/dist/chunks/{dashboard-briefing-launcher-DHtEouuH.cjs → dashboard-briefing-launcher-xuGrw8H3.cjs} +2 -2
- package/dist/chunks/{dashboard-controls-B8gsKlxc.js → dashboard-controls-B4GvjGr1.js} +44 -45
- package/dist/chunks/{dashboard-controls-VRShl9J0.cjs → dashboard-controls-Bpm_xOXQ.cjs} +1 -1
- package/dist/chunks/dashboard-filter-value-compatibility-KXIyvbhc.js +677 -0
- package/dist/chunks/dashboard-filter-value-compatibility-UapptYnn.cjs +1 -0
- package/dist/chunks/dashboard-input-contract-BkRFQ7Tq.cjs +1 -0
- package/dist/chunks/{dashboard-date-comparison-definition-DC3ekV2S.js → dashboard-input-contract-D5dxTWJ5.js} +41 -25
- package/dist/chunks/{dashboard-json-i_Auue_K.js → dashboard-json-DzyxoBp-.js} +13 -14
- package/dist/chunks/dashboard-json-yLM01xK4.cjs +1 -0
- package/dist/chunks/{edit-dashboard-visual-DWWyT55u.cjs → edit-dashboard-visual-1T278Nr_.cjs} +28 -28
- package/dist/chunks/{edit-dashboard-visual-B3JF0fe4.js → edit-dashboard-visual-nwSasO_j.js} +880 -894
- package/dist/chunks/{editor-action-buttons-BTlCsP63.cjs → editor-action-buttons-CX1Pken3.cjs} +2 -2
- package/dist/chunks/{editor-action-buttons-C9x3nGnb.js → editor-action-buttons-Dqw0asfA.js} +28 -28
- package/dist/chunks/index-B1qplNxl.cjs +1392 -0
- package/dist/chunks/{index-BS2-ZZGf.js → index-DazD5k0F.js} +45362 -42931
- package/dist/chunks/{index-BIFLI8ul.js → index-De_7nrwb.js} +10 -10
- package/dist/chunks/index-DjjKJPDy.cjs +4 -0
- package/dist/chunks/{matrix-result-contract-CofATICL.js → matrix-result-contract-BTpPuHOc.js} +88 -104
- package/dist/chunks/matrix-result-contract-ZRNfeIbI.cjs +1 -0
- package/dist/chunks/{pivot-header-presentation-B9nXXKlW.cjs → pivot-header-presentation-BijPbP33.cjs} +1 -1
- package/dist/chunks/{pivot-header-presentation-D-0jvUwn.js → pivot-header-presentation-DW0gKG8g.js} +2 -2
- package/dist/chunks/{pivot-result-identity-Bb4EixVN.cjs → pivot-result-identity-DxHtiKVj.cjs} +1 -1
- package/dist/chunks/{pivot-result-identity-DU1v-5Xk.js → pivot-result-identity-Z9tN2tEV.js} +1 -1
- package/dist/chunks/{pivot-result-lifecycle-DTLRuDEW.cjs → pivot-result-lifecycle-BXzIlQVu.cjs} +1 -1
- package/dist/chunks/{pivot-result-lifecycle-CHWEGU2o.js → pivot-result-lifecycle-g2U-vzQb.js} +7 -7
- package/dist/chunks/{raw-temporal-contract-BtjH_G-d.cjs → raw-temporal-contract-DfAvqNMo.cjs} +1 -1
- package/dist/chunks/{raw-temporal-contract-CxncLze5.js → raw-temporal-contract-UtAqoOZO.js} +1 -1
- package/dist/chunks/{report-preferences-dialog-BK0yAJnQ.cjs → report-preferences-dialog-DKPyjiCt.cjs} +1 -1
- package/dist/chunks/{report-preferences-dialog-BDpkcUtz.js → report-preferences-dialog-Dv3vCCFt.js} +6 -6
- package/dist/chunks/{report-runtime-context-DqxS4wbi.cjs → report-runtime-context-C0NfLPfc.cjs} +1 -1
- package/dist/chunks/{report-runtime-context-SM6YO61_.js → report-runtime-context-CNncA3VD.js} +11 -11
- package/dist/chunks/{saved-temporal-bucket-format-CFfWXRl9.cjs → saved-temporal-bucket-format-3QKveR3v.cjs} +1 -1
- package/dist/chunks/{saved-temporal-bucket-format-SGAV0ivR.js → saved-temporal-bucket-format-Dd2eixTH.js} +11 -11
- package/dist/chunks/switch-DBZsEV0U.cjs +138 -0
- package/dist/chunks/{switch-DQR-Va05.js → switch-kPUJEC1A.js} +6615 -5219
- package/dist/chunks/{temporal-bucket-5UYEotyQ.js → temporal-bucket-C85rmFmC.js} +4 -4
- package/dist/chunks/temporal-bucket-authoring-1fZuPAVb.js +653 -0
- package/dist/chunks/temporal-bucket-authoring-BK1UhYpD.cjs +1 -0
- package/dist/chunks/{temporal-bucket-contract-D5d-xEl3.js → temporal-bucket-contract-DXXNZssK.js} +1 -1
- package/dist/chunks/{temporal-bucket-contract-D2-93DGr.cjs → temporal-bucket-contract-xFkvboaw.cjs} +1 -1
- package/dist/chunks/{temporal-bucket-DHY1y9lq.cjs → temporal-bucket-pMfghsLX.cjs} +1 -1
- package/dist/chunks/{token-types-GbxRUozo.js → token-types-BLxc7UwR.js} +1 -1
- package/dist/chunks/{token-types-D7CaaI80.cjs → token-types-BYYO109W.cjs} +1 -1
- package/dist/chunks/{update-policy-hednMF-0.js → update-policy-CB8XJIoY.js} +1 -1
- package/dist/chunks/{update-policy-BmiOd0PB.cjs → update-policy-DMjjGjQY.cjs} +1 -1
- package/dist/chunks/{validators-DEmd8Sin.js → validators-DVd8s3qY.js} +416 -350
- package/dist/chunks/validators-dJlwubP4.cjs +1 -0
- package/dist/dashboard/index.cjs +1 -1
- package/dist/dashboard/index.js +2 -2
- package/dist/dashboard-authoring/index.cjs +3 -3
- package/dist/dashboard-authoring/index.js +328 -311
- package/dist/data-app-builder/index.cjs +1 -1
- package/dist/data-app-builder/index.js +2 -2
- 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 +55 -55
- package/dist/data-app-sdk-adapters/index.cjs +1 -1
- package/dist/data-app-sdk-adapters/index.js +61 -56
- package/dist/data-app-sdk-validation/index.cjs +1 -1
- package/dist/data-app-sdk-validation/index.js +9 -9
- package/dist/format-utils/index.cjs +1 -1
- package/dist/format-utils/index.js +15 -15
- package/dist/index.cjs +1 -1
- package/dist/index.js +154 -155
- 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 +3 -3
- package/dist/types/analytics-protocol.d.ts +16 -8
- package/dist/types/briefings.d.ts +95 -13
- package/dist/types/dashboard-assistant.d.ts +11 -6
- package/dist/types/dashboard-authoring.d.ts +257 -19
- package/dist/types/dashboard.d.ts +109 -14
- package/dist/types/data-app-builder.d.ts +11 -6
- package/dist/types/data-app-codegen-node.d.ts +16 -8
- package/dist/types/data-app-codegen.d.ts +16 -8
- package/dist/types/data-app-sdk-adapters.d.ts +17 -11
- package/dist/types/data-app-sdk-validation.d.ts +17 -11
- package/dist/types/data-app-sdk.d.ts +17 -11
- package/dist/types/index.cjs +1 -1
- package/dist/types/index.js +4 -4
- package/dist/types/main.d.ts +225 -20
- package/dist/types/shared.d.ts +95 -13
- package/dist/types/surfboard.d.ts +109 -14
- package/dist/types/types.d.ts +109 -14
- package/package.json +1 -1
- package/dist/chunks/canonical-result-keys-BA0HCP4e.cjs +0 -1
- package/dist/chunks/canonical-result-keys-D6avdjpA.js +0 -467
- package/dist/chunks/dashboard-date-comparison-definition-Ces4alFm.cjs +0 -1
- package/dist/chunks/dashboard-json-BhvPMpZA.cjs +0 -1
- package/dist/chunks/index-DHF-2AqS.cjs +0 -1392
- package/dist/chunks/index-k8tEp0ys.cjs +0 -4
- package/dist/chunks/matrix-result-contract-zamd9euI.cjs +0 -1
- package/dist/chunks/switch-f3TuZNLr.cjs +0 -138
- package/dist/chunks/temporal-bucket-authoring-K1kE6R_z.js +0 -222
- package/dist/chunks/temporal-bucket-authoring-o3Emn05L.cjs +0 -1
- package/dist/chunks/validators-BDYprKI9.cjs +0 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { s as m, p as I, c } from "../chunks/validators-
|
|
2
|
-
import { n as
|
|
3
|
-
import "../chunks/analyze-result-contract-
|
|
1
|
+
import { s as m, p as I, c as p } from "../chunks/validators-DVd8s3qY.js";
|
|
2
|
+
import { n as c } from "../chunks/operators-C8TxpM4C.js";
|
|
3
|
+
import "../chunks/analyze-result-contract-DROq4vgY.js";
|
|
4
4
|
import "../value-format-preferences/index.js";
|
|
5
5
|
function F(i) {
|
|
6
|
-
var n,
|
|
6
|
+
var n, e, a;
|
|
7
7
|
const t = M(i);
|
|
8
8
|
return {
|
|
9
9
|
version: 1,
|
|
@@ -15,27 +15,27 @@ function F(i) {
|
|
|
15
15
|
primaryMeasure: S(i, t),
|
|
16
16
|
dateField: i.dateField ? o(i.dateField, "date") : void 0,
|
|
17
17
|
timeGrain: i.timeGrain,
|
|
18
|
-
dimensions: (n = i.dimensions) == null ? void 0 : n.map((
|
|
18
|
+
dimensions: (n = i.dimensions) == null ? void 0 : n.map((r) => o(r, "dimension")),
|
|
19
19
|
comparison: T(i.comparison),
|
|
20
20
|
orderBy: i.orderBy ? {
|
|
21
21
|
field: o(i.orderBy.field),
|
|
22
22
|
direction: i.orderBy.direction
|
|
23
23
|
} : void 0,
|
|
24
24
|
inputs: l(i.inputs),
|
|
25
|
-
...(
|
|
25
|
+
...(e = i.filters) != null && e.length ? { filters: i.filters } : {},
|
|
26
26
|
...i.relationshipHint ? { relationshipHint: i.relationshipHint } : {},
|
|
27
27
|
limit: i.limit,
|
|
28
28
|
...(a = i.derivedFields) != null && a.length ? { derivedFields: i.derivedFields } : {}
|
|
29
29
|
};
|
|
30
30
|
}
|
|
31
|
-
function
|
|
31
|
+
function q(i) {
|
|
32
32
|
return {
|
|
33
33
|
...F(i),
|
|
34
34
|
...i.timeWindow ? { timeWindow: i.timeWindow } : {},
|
|
35
35
|
...i.analysis ? { analysis: i.analysis } : {}
|
|
36
36
|
};
|
|
37
37
|
}
|
|
38
|
-
function
|
|
38
|
+
function G(i) {
|
|
39
39
|
return {
|
|
40
40
|
...i.chartTitle ? { chartTitle: i.chartTitle } : {},
|
|
41
41
|
...i.chartType ? { chartType: i.chartType } : {},
|
|
@@ -47,25 +47,25 @@ function V(i) {
|
|
|
47
47
|
function S(i, t) {
|
|
48
48
|
if (!i.primaryMeasure)
|
|
49
49
|
return t[0] || { name: "", role: "measure" };
|
|
50
|
-
const n = o(i.primaryMeasure, "measure"),
|
|
50
|
+
const n = o(i.primaryMeasure, "measure"), e = R(n, t), a = e.length === 1 ? e[0] : void 0;
|
|
51
51
|
return a ? h(n, a) : n;
|
|
52
52
|
}
|
|
53
53
|
function M(i) {
|
|
54
54
|
const t = [];
|
|
55
55
|
for (const n of i.measures.map(
|
|
56
|
-
(
|
|
56
|
+
(e) => o(e, "measure")
|
|
57
57
|
)) {
|
|
58
58
|
if (!n.name)
|
|
59
59
|
continue;
|
|
60
|
-
const
|
|
60
|
+
const e = t.findIndex(
|
|
61
61
|
(a) => b(a, n)
|
|
62
62
|
);
|
|
63
|
-
if (
|
|
63
|
+
if (e === -1) {
|
|
64
64
|
t.push(n);
|
|
65
65
|
continue;
|
|
66
66
|
}
|
|
67
|
-
t[
|
|
68
|
-
t[
|
|
67
|
+
t[e] = h(
|
|
68
|
+
t[e],
|
|
69
69
|
n
|
|
70
70
|
);
|
|
71
71
|
}
|
|
@@ -74,20 +74,20 @@ function M(i) {
|
|
|
74
74
|
function b(i, t) {
|
|
75
75
|
return m(i, t) && d(i) === d(t);
|
|
76
76
|
}
|
|
77
|
-
function
|
|
77
|
+
function w(i, t) {
|
|
78
78
|
return d(t) === d(i);
|
|
79
79
|
}
|
|
80
|
-
function
|
|
81
|
-
return t.name !== i.name || i.source && !m(t, i) ? !1 :
|
|
80
|
+
function H(i, t) {
|
|
81
|
+
return t.name !== i.name || i.source && !m(t, i) ? !1 : w(i, t);
|
|
82
82
|
}
|
|
83
|
-
function
|
|
83
|
+
function R(i, t) {
|
|
84
84
|
const n = t.filter(
|
|
85
|
-
(
|
|
85
|
+
(e) => H(i, e)
|
|
86
86
|
);
|
|
87
87
|
return i.aggregate !== void 0, n;
|
|
88
88
|
}
|
|
89
89
|
function d(i) {
|
|
90
|
-
return
|
|
90
|
+
return p(i);
|
|
91
91
|
}
|
|
92
92
|
function h(i, t) {
|
|
93
93
|
if (i.aggregate && t.aggregate && i.aggregate !== t.aggregate)
|
|
@@ -99,8 +99,8 @@ function h(i, t) {
|
|
|
99
99
|
aggregate: i.aggregate || t.aggregate
|
|
100
100
|
};
|
|
101
101
|
}
|
|
102
|
-
function
|
|
103
|
-
var n,
|
|
102
|
+
function V(i) {
|
|
103
|
+
var n, e;
|
|
104
104
|
if ("sort" in i)
|
|
105
105
|
throw new Error(
|
|
106
106
|
"semaphor.records supports orderBy for a single deterministic sort. Multiple sort clauses are not supported by the analytics protocol yet."
|
|
@@ -135,7 +135,7 @@ function j(i) {
|
|
|
135
135
|
)
|
|
136
136
|
}
|
|
137
137
|
} : {},
|
|
138
|
-
...(
|
|
138
|
+
...(e = i.derivedFields) != null && e.length ? { derivedFields: i.derivedFields } : {}
|
|
139
139
|
};
|
|
140
140
|
}
|
|
141
141
|
function k(i) {
|
|
@@ -148,29 +148,34 @@ function k(i) {
|
|
|
148
148
|
return n;
|
|
149
149
|
});
|
|
150
150
|
}
|
|
151
|
-
function
|
|
152
|
-
var
|
|
151
|
+
function j(i) {
|
|
152
|
+
var n, e, a;
|
|
153
|
+
const t = u(i);
|
|
154
|
+
if (t.kind === "sql")
|
|
155
|
+
throw new Error(
|
|
156
|
+
"semaphor.inputOptions requires a semantic or physical option source."
|
|
157
|
+
);
|
|
153
158
|
return {
|
|
154
159
|
version: 1,
|
|
155
160
|
kind: "inputOptions",
|
|
156
161
|
id: i.id,
|
|
157
162
|
label: i.label,
|
|
158
163
|
inputId: i.inputId,
|
|
159
|
-
source:
|
|
164
|
+
source: t,
|
|
160
165
|
labelField: o(i.labelField, "dimension"),
|
|
161
166
|
valueField: o(i.valueField, "dimension"),
|
|
162
167
|
...i.searchField ? { searchField: o(i.searchField, "dimension") } : {},
|
|
163
|
-
...(
|
|
168
|
+
...(n = i.disambiguationFields) != null && n.length ? {
|
|
164
169
|
disambiguationFields: i.disambiguationFields.map(
|
|
165
|
-
(
|
|
170
|
+
(r) => o(r, "dimension")
|
|
166
171
|
)
|
|
167
172
|
} : {},
|
|
168
173
|
...i.population ? { population: i.population } : {},
|
|
169
174
|
...i.dependencies ? { dependencies: i.dependencies } : {},
|
|
170
175
|
search: i.search,
|
|
171
176
|
limit: i.limit,
|
|
172
|
-
...(
|
|
173
|
-
...(
|
|
177
|
+
...(e = i.inputs) != null && e.length ? { inputs: i.inputs.map((r) => g(r)) } : {},
|
|
178
|
+
...(a = i.derivedFields) != null && a.length ? { derivedFields: i.derivedFields } : {}
|
|
174
179
|
};
|
|
175
180
|
}
|
|
176
181
|
function Q(i) {
|
|
@@ -199,9 +204,9 @@ function D(i) {
|
|
|
199
204
|
id: i.id,
|
|
200
205
|
label: i.label,
|
|
201
206
|
source: u(i),
|
|
202
|
-
rows: i.rows.map((
|
|
207
|
+
rows: i.rows.map((e) => s(e, "dimension")),
|
|
203
208
|
columns: (i.columns ?? []).map(
|
|
204
|
-
(
|
|
209
|
+
(e) => s(e, "dimension")
|
|
205
210
|
),
|
|
206
211
|
values: i.values.map(A),
|
|
207
212
|
...(t = i.filters) != null && t.length ? { filters: i.filters } : {},
|
|
@@ -239,28 +244,28 @@ function B(i) {
|
|
|
239
244
|
}
|
|
240
245
|
function g(i) {
|
|
241
246
|
if ("toAnalyticsInput" in i) {
|
|
242
|
-
const
|
|
247
|
+
const r = i.toAnalyticsInput();
|
|
243
248
|
return {
|
|
244
|
-
inputId:
|
|
245
|
-
kind:
|
|
246
|
-
...
|
|
247
|
-
...
|
|
248
|
-
...
|
|
249
|
-
...
|
|
249
|
+
inputId: r.inputId,
|
|
250
|
+
kind: r.kind,
|
|
251
|
+
...r.controlRole ? { controlRole: r.controlRole } : {},
|
|
252
|
+
...r.operator ? { operator: r.operator } : {},
|
|
253
|
+
...r.field ? { field: r.field } : {},
|
|
254
|
+
...r.relationshipHint ? { relationshipHint: r.relationshipHint } : {}
|
|
250
255
|
};
|
|
251
256
|
}
|
|
252
257
|
if ("id" in i) {
|
|
253
|
-
const
|
|
258
|
+
const r = y(i);
|
|
254
259
|
return {
|
|
255
|
-
inputId:
|
|
256
|
-
kind:
|
|
257
|
-
...
|
|
258
|
-
...
|
|
259
|
-
...
|
|
260
|
-
...
|
|
260
|
+
inputId: r.inputId,
|
|
261
|
+
kind: r.kind,
|
|
262
|
+
...r.controlRole ? { controlRole: r.controlRole } : {},
|
|
263
|
+
...r.operator ? { operator: r.operator } : {},
|
|
264
|
+
...r.field ? { field: r.field } : {},
|
|
265
|
+
...r.relationshipHint ? { relationshipHint: r.relationshipHint } : {}
|
|
261
266
|
};
|
|
262
267
|
}
|
|
263
|
-
const t = "kind" in i ? i.kind : void 0, n = "operator" in i ? v(i.operator, i.inputId) : void 0,
|
|
268
|
+
const t = "kind" in i ? i.kind : void 0, n = "operator" in i ? v(i.operator, i.inputId) : void 0, e = "controlRole" in i ? i.controlRole : "role" in i ? i.role : void 0, a = O(e) ? e : void 0;
|
|
264
269
|
return {
|
|
265
270
|
inputId: i.inputId,
|
|
266
271
|
...t ? { kind: t } : {},
|
|
@@ -270,18 +275,18 @@ function g(i) {
|
|
|
270
275
|
...i.relationshipHint ? { relationshipHint: i.relationshipHint } : {}
|
|
271
276
|
};
|
|
272
277
|
}
|
|
273
|
-
function
|
|
278
|
+
function O(i) {
|
|
274
279
|
return i === "grain" || i === "measure" || i === "dimension" || i === "aggregation" || i === "sqlParam";
|
|
275
280
|
}
|
|
276
281
|
function J(i) {
|
|
277
282
|
const t = l(i);
|
|
278
283
|
return t.length > 0 ? t : void 0;
|
|
279
284
|
}
|
|
280
|
-
function
|
|
285
|
+
function C(i) {
|
|
281
286
|
return (i || []).map(P);
|
|
282
287
|
}
|
|
283
288
|
function K(i) {
|
|
284
|
-
return
|
|
289
|
+
return C(i).filter((t) => t.isActive);
|
|
285
290
|
}
|
|
286
291
|
function y(i) {
|
|
287
292
|
if (i.kind === "filter") {
|
|
@@ -364,7 +369,7 @@ function T(i) {
|
|
|
364
369
|
function v(i, t) {
|
|
365
370
|
if (i === void 0)
|
|
366
371
|
return;
|
|
367
|
-
const n =
|
|
372
|
+
const n = c(i);
|
|
368
373
|
if (!n)
|
|
369
374
|
throw new Error(
|
|
370
375
|
`useSemaphorInput "${t}" uses unsupported filter operator "${i}".`
|
|
@@ -375,15 +380,15 @@ export {
|
|
|
375
380
|
f as hasSemaphorInputValue,
|
|
376
381
|
N as normalizeSemaphorInputOptions,
|
|
377
382
|
K as toSemaphorActiveInputSnapshots,
|
|
378
|
-
|
|
379
|
-
|
|
383
|
+
q as toSemaphorAnalysisIntent,
|
|
384
|
+
G as toSemaphorAnalysisQueryOptions,
|
|
380
385
|
g as toSemaphorInputBinding,
|
|
381
386
|
J as toSemaphorInputBindings,
|
|
382
|
-
|
|
383
|
-
|
|
387
|
+
j as toSemaphorInputOptionsIntent,
|
|
388
|
+
C as toSemaphorInputSnapshots,
|
|
384
389
|
y as toSemaphorInputSpec,
|
|
385
390
|
D as toSemaphorMatrixIntent,
|
|
386
391
|
F as toSemaphorMetricIntent,
|
|
387
|
-
|
|
392
|
+
V as toSemaphorRecordsIntent,
|
|
388
393
|
Q as toSemaphorSqlIntent
|
|
389
394
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("../chunks/validators-BDYprKI9.cjs");require("../chunks/analyze-result-contract-LPDNldic.cjs");require("../value-format-preferences/index.cjs");const Q=require("../chunks/report-runtime-context-DqxS4wbi.cjs"),h=require("../data-app-sdk-adapters/index.cjs");function E({intent:e,field:r,catalogField:o,relativePath:t}){const i=J({intent:e,field:r,relativePath:t});if(!i||i.allowedRelatedRoles.length===0)return!1;const a=p(r,i.selectedField),s=b(o),n=m(a);return j(s,i.allowedRelatedRoles)?n===s:!1}function W(e){return e.kind==="records"?G(e):e.kind==="metric"?X(e):Y(e)}function b(e){const r=c.normalizeAnalyticsCatalogName(e.role);if(r==="measure")return"measure";if(r==="id")return"id";const o=c.normalizeAnalyticsCatalogDataType(e.dataType);if(r==="date"||o==="date"||o==="datetime")return"date";if(r==="dimension")return"dimension"}function j(e,r){return!!(e&&r.includes(e))}function p(e,r){const o=m(e);if(o)return e.role===o?e:{...e,role:o};const t=r?m(r):void 0;return t?{...e,role:t}:e}function f(e,r){return e.find(o=>T(o,r))}function S(e){return[...e.rows.map(r=>r.field),...(e.columns||[]).map(r=>r.field)]}function J({intent:e,field:r,relativePath:o}){if(e.kind==="records")return U(e,r,o);if(e.kind==="metric")return L(e,r,o);if(e.kind==="matrix")return V(e,r,o)}function U(e,r,o){if(o.startsWith("spec.fields."))return{allowedRelatedRoles:["dimension","date","id"]};if(o==="spec.dateField"&&!e.timeWindow)return{allowedRelatedRoles:["date"]};if(o==="spec.orderBy.field"){const t=f(M(e),r);return{selectedField:t,allowedRelatedRoles:t?R(t):[]}}}function L(e,r,o){if(o.startsWith("spec.dimensions."))return{allowedRelatedRoles:["dimension"]};if(o==="spec.orderBy.field"){const t=f(e.dimensions||[],r);return{selectedField:t,allowedRelatedRoles:t?["dimension"]:[]}}}function V(e,r,o){if(re(o))return{allowedRelatedRoles:["dimension","date"]};if(oe(o)){const t=f(S(e),r);return{selectedField:t,allowedRelatedRoles:q(t)}}}function G(e){var t,i;const r=M(e),o=(t=e.orderBy)!=null&&t.field?f(r,e.orderBy.field):void 0;return _([...r.map(a=>l(a,R(a))),...(i=e.orderBy)!=null&&i.field?[l(p(e.orderBy.field,o),o?R(o):[],{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 o,t;const r=(o=e.orderBy)!=null&&o.field?f(e.dimensions||[],e.orderBy.field):void 0;return _([...e.measures.map(i=>l(i,[])),...e.primaryMeasure?[l(e.primaryMeasure,[])]:[],...(e.dimensions||[]).map(i=>l(i,["dimension"])),...e.dateField?[l({...e.dateField,role:"date"},[])]:[],...(t=e.orderBy)!=null&&t.field?[l(p(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 Y(e){const r=[...e.rows,...e.columns||[]];return _([...r.map(o=>l(o.field,q(o.field))),...r.flatMap(o=>{var a;if(((a=o.sortBy)==null?void 0:a.by.kind)!=="field")return[];const t=o.sortBy.by.field,i=f(S(e),t);return[l(p(t,i),q(i),{unsupportedRelatedRoleMessage:"Joined matrix projections support related axis sort fields only when the same related field is used as a row/column axis.",recommendedNextStep:"Use a related field as a row or column axis, or keep axis sort fields on the base source."})]}),...e.values.map(o=>l(o.field,[],{unsupportedRelatedRoleMessage:"Joined matrix projections support related row/column dimensions or dates only. Related value fields are not supported in this phase.",recommendedNextStep:"Keep matrix values on the base source, or use governed SQL for unsupported aggregate-safe joined values."})),...(e.sort||[]).flatMap(o=>{if(o.by.kind!=="field")return[];const t=o.by.field,i=f(S(e),t);return[l(p(t,i),q(i),{unsupportedRelatedRoleMessage:"Joined matrix projections support related top-level sort fields only when the same related field is used as a row/column axis.",recommendedNextStep:"Use a related field as a row or column axis, or keep matrix sort fields on the base source."})]})])}function R(e){const r=e?m(e):void 0;return r==="dimension"?["dimension"]:r==="date"?["date"]:r==="id"?["id"]:["dimension","date","id"]}function q(e){const r=e?m(e):void 0;return r==="date"?["date"]:r==="dimension"?["dimension"]:[]}function l(e,r,o={}){return{field:p(e),allowedRelatedRoles:r,...o}}function _(e){const r=[];return e.forEach(o=>{r.some(t=>Z(t,o))||r.push(o)}),r}function M(e){const r=[...e.fields];return e.dateField&&!r.some(o=>B(o,e.dateField))&&r.push({...e.dateField,role:"date"}),r}function Z(e,r){return T(e.field,r.field)&&e.allowedRelatedRoles.join("|")===r.allowedRelatedRoles.join("|")&&(e.unsupportedRelatedRoleMessage||"")===(r.unsupportedRelatedRoleMessage||"")&&(e.recommendedNextStep||"")===(r.recommendedNextStep||"")}function B(e,r){return c.semaphorFieldRefsMatch(e,r)}function T(e,r){return B(e,r)&&ee(m(e),m(r))}function ee(e,r){return!!(e&&(!r||e===r))}function m(e){return b(e)}function re(e){const r=e.split(".");return r.length===4&&r[0]==="spec"&&(r[1]==="rows"||r[1]==="columns")&&x(r[2])&&r[3]==="field"}function oe(e){const r=e.split(".");return r.length===6&&r[0]==="spec"&&(r[1]==="rows"||r[1]==="columns")&&x(r[2])&&r[3]==="sortBy"&&r[4]==="by"&&r[5]==="field"||r.length===5&&r[0]==="spec"&&r[1]==="sort"&&x(r[2])&&r[3]==="by"&&r[4]==="field"}function x(e){return e===void 0||e.trim()===""?!1:Number.isInteger(Number(e))&&Number(e)>=0}function te({intent:e,field:r,relativePath:o,baseCatalog:t,fieldCatalogs:i}){const a=v(r,e.source),s=c.semaphorSourcesReferToSameDataset(a,e.source);if(!s&&!ae(e.source,a))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:a};const n=s?t:I(i,a);if(!n)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:a};const d=F(n,r,e.source);return d?!s&&!ie({intent:e,field:r,catalogField:d,relativePath:o})?{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:a}:{ok:!0,source:a,catalogField:d,usesBaseSource:s}:{ok:!1,code:"missing_field",message:`Field "${r.name}" is not visible on the selected Semaphor source.`,source:a}}function ie({intent:e,field:r,catalogField:o,relativePath:t}){return E({intent:e,field:r,catalogField:o,relativePath:t})}function ae(e,r){return e.kind==="semantic"&&r.kind==="semantic"&&e.domainId===r.domainId}function I(e,r){return e.find(o=>$(o,r))}function F(e,r,o){const t=v(r,o);if($(e,t))return e.fields.find(i=>se(i,r)&&$(e,v(i,e.source)))}function w(e){return c.normalizeAnalyticsCatalogName(e)}function v(e,r){return e.source||r}function $(e,r){return[e.source,...e.sourceAliases||[]].some(o=>c.semaphorSourcesReferToSameDataset(o,r))}function se(e,r){return!!(e.name&&r.name&&e.name===r.name)}function D(e,r={}){const o=r.pathPrefix||"analysisOptions";if(e===void 0)return{ok:!0};if(!e||typeof e!="object"||Array.isArray(e))return u(o,"Data App analysis options must be an object.");const t=e,i={};if(t.chartTitle!==void 0){if(typeof t.chartTitle!="string")return u(`${o}.chartTitle`,'Data App analysis option "chartTitle" must be a string.');i.chartTitle=t.chartTitle}if(t.chartType!==void 0){if(typeof t.chartType!="string")return u(`${o}.chartType`,'Data App analysis option "chartType" must be a string.');i.chartType=t.chartType}if(t.driverMode!==void 0){if(!le(t.driverMode))return u(`${o}.driverMode`,'Data App analysis option "driverMode" must be absolute_delta, largest_negative, largest_positive, positive_and_negative, or all.');i.driverMode=t.driverMode}if(t.includePopulation!==void 0){if(typeof t.includePopulation!="boolean")return u(`${o}.includePopulation`,'Data App analysis option "includePopulation" must be a boolean.');i.includePopulation=t.includePopulation}if(t.calendarContext!==void 0){const a=ce(t.calendarContext,{pathPrefix:`${o}.calendarContext`,validateTimezone:r.validateTimezone});if(!a.ok)return a;i.calendarContext=a.calendarContext}return{ok:!0,analysisOptions:i}}function ne(e){const r=e.queries.map((i,a)=>de(i,a,{fieldCatalogs:e.fieldCatalogs||[],requireFieldCatalog:!!e.requireFieldCatalog,validateTimezone:e.validateTimezone})),o=r.flatMap(i=>i.diagnostics),t=r.map(i=>i.executionResult);return{ok:o.every(i=>i.severity!=="error"),diagnostics:o,queries:r,intents:r.flatMap(i=>i.intent?[i.intent]:[]),executionResults:t}}function de(e,r,o){const t=`queries.${r}`;try{const i=ue(e),a=xe(e,i),s=c.validateSemaphorAnalyticsIntent(i),n=[...Se({querySpec:e,queryId:a,intent:i,pathPrefix:t}),...s.errors.map(g=>C(g,{queryHook:e.queryHook,queryId:a,pathPrefix:t,severity:"error",intent:i})),...s.warnings.map(g=>C(g,{queryHook:e.queryHook,queryId:a,pathPrefix:t,severity:"warning",intent:i})),...pe({querySpec:e,queryId:a,intent:i,pathPrefix:t,fieldCatalogs:o.fieldCatalogs,requireFieldCatalog:o.requireFieldCatalog}),...qe({querySpec:e,queryId:a,intent:i,pathPrefix:t,validateTimezone:o.validateTimezone})],d=Re(s,n);return{queryHook:e.queryHook,queryId:a,intent:i,diagnostics:n,executionResult:H({intent:i,validation:d,diagnostics:n})}}catch(i){const a={severity:"error",code:"invalid_query_spec",message:i instanceof Error?i.message:String(i),path:t,queryHook:e.queryHook,queryId:K(e.spec)},s=O([a]);return{queryHook:e.queryHook,queryId:a.queryId,diagnostics:[a],executionResult:H({validation:s,diagnostics:[a]})}}}function u(e,r){return{ok:!1,issues:[{code:"invalid_analysis_option",message:r,path:e}]}}function z(e){return!!(e&&typeof e=="object"&&!Array.isArray(e))}function le(e){return e==="absolute_delta"||e==="largest_negative"||e==="largest_positive"||e==="positive_and_negative"||e==="all"}function ce(e,r){if(!e||typeof e!="object"||Array.isArray(e))return u(r.pathPrefix,'Data App analysis option "calendarContext" must be an object.');const o=e,t=o.tz;let i=t;if(typeof t=="string"&&r.validateTimezone&&(i=r.validateTimezone(t)),i===null)return u(`${r.pathPrefix}.tz`,'Data App analysis option "calendarContext.tz" must be a valid timezone string.');const a=Q.parseCalendarContext({...o,tz:i});if(!a.ok){const s=a.issues[0];return u(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:a.value}}function ue(e){return fe(e.spec)}function fe(e){if(!z(e))throw new Error("useSemaphorQuery spec must be an object.");if(e.queryKind==="metric")return h.toSemaphorMetricIntent(e);if(e.queryKind==="analysis")return h.toSemaphorAnalysisIntent(e);if(e.queryKind==="records")return h.toSemaphorRecordsIntent(e);if(e.queryKind==="sql")return h.toSemaphorSqlIntent(e);if(e.queryKind==="matrix")return h.toSemaphorMatrixIntent(e);if(e.queryKind==="inputOptions")return h.toSemaphorInputOptionsIntent(e);throw new Error("useSemaphorQuery spec.queryKind must be metric, analysis, records, inputOptions, sql, or matrix.")}function pe(e){if(e.intent.kind==="sql")return[];if(e.fieldCatalogs.length===0&&!e.requireFieldCatalog)return[];const r=I(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:e.intent.id,source:e.intent.source}];const o=ye({...e,catalog:r}),t={...r,fields:[...r.fields,...Ie(e.intent,r,e.intent.source)]};return[...o,...me({...e,fieldCatalogs:e.fieldCatalogs}),...he({...e,catalog:t,fieldCatalogs:e.fieldCatalogs}),...ge({...e,catalog:t,fieldCatalogs:e.fieldCatalogs})]}function me(e){var o;if(e.intent.kind!=="inputOptions"||((o=e.intent.population)==null?void 0:o.kind)!=="related_population")return[];const r=e.intent.population.baseSource;return I(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:e.intent.id,source:r}]}function ye(e){const r=N(e.intent);if(r.length===0)return[];const o=[],t=new Set;return r.forEach((i,a)=>{const s=`${e.pathPrefix}.spec.derivedFields.${a}`,n=w(i.name);n&&(t.has(n)&&o.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:e.intent.id,source:e.intent.source}),t.add(n),e.catalog.fields.some(d=>w(d.name)===n)&&o.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:e.intent.id,source:e.intent.source})),Object.entries(i.inputs||{}).forEach(([d,g])=>{const y=ke(g);if(!y)return;const k=v(y,e.intent.source);if(!c.semaphorSourcesReferToSameDataset(k,e.intent.source)){o.push({severity:"error",code:"unsupported_derived_field_source",message:`Derived field "${i.name}" input "${d}" references a different Semaphor source. App-local derived fields must use fields from the query source.`,path:`${s}.inputs.${d}`,queryHook:e.querySpec.queryHook,queryId:e.queryId,intentId:e.intent.id,source:k,field:y});return}F(e.catalog,y,e.intent.source)||o.push({severity:"error",code:"missing_field",message:`Derived field "${i.name}" input "${d}" references field "${y.name}", which is not visible on the selected Semaphor source.`,path:`${s}.inputs.${d}`,queryHook:e.querySpec.queryHook,queryId:e.queryId,intentId:e.intent.id,source:k,field:y})})}),o}function he(e){return Fe(e.intent).flatMap(({field:r,path:o})=>{const t=te({intent:e.intent,field:r,relativePath:o,baseCatalog:e.catalog,fieldCatalogs:e.fieldCatalogs});return t.ok?[]:[{severity:"error",code:t.code,message:t.message,path:`${e.pathPrefix}.${o}${t.pathSuffix||""}`,queryHook:e.querySpec.queryHook,queryId:e.queryId,intentId:e.intent.id,source:t.source,field:r}]})}function ge(e){return("inputs"in e.intent?e.intent.inputs||[]:[]).flatMap((o,t)=>{if(!o.field)return[];const i=v(o.field,e.intent.source);if(!c.semaphorSourcesReferToSameDataset(i,e.intent.source)){if(ve(e.intent,i)){const a=I(e.fieldCatalogs,i);return a?F(a,o.field,i)?[]:[{severity:"error",code:"missing_field",message:`Input "${o.inputId}" references field "${o.field.name}", which is not visible on the selected Semaphor source.`,path:`${e.pathPrefix}.spec.inputs.${t}.field`,queryHook:e.querySpec.queryHook,queryId:e.queryId,intentId:e.intent.id,source:i,field:o.field}]:[{severity:"error",code:"invalid_source_ref",message:`Input "${o.inputId}" references a Semaphor source that is not present in the visible field catalog.`,path:`${e.pathPrefix}.spec.inputs.${t}.field.source`,queryHook:e.querySpec.queryHook,queryId:e.queryId,intentId:e.intent.id,source:i,field:o.field}]}return[{severity:"error",code:"unsupported_input_filter_composition",message:`Input "${o.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.${t}.field`,queryHook:e.querySpec.queryHook,queryId:e.queryId,intentId:e.intent.id,source:i,field:o.field}]}return F(e.catalog,o.field,e.intent.source)?[]:[{severity:"error",code:"missing_field",message:`Input "${o.inputId}" references field "${o.field.name}", which is not visible on the selected Semaphor source.`,path:`${e.pathPrefix}.spec.inputs.${t}.field`,queryHook:e.querySpec.queryHook,queryId:e.queryId,intentId:e.intent.id,source:i,field:o.field}]})}function ve(e,r){return e.source.kind==="semantic"&&r.kind==="semantic"&&r.domainId===e.source.domainId}function qe(e){if(e.querySpec.spec.queryKind!=="analysis")return[];const r=D(e.querySpec.spec,{pathPrefix:`${e.pathPrefix}.spec`,validateTimezone:e.validateTimezone});return r.ok?[]:r.issues.map(o=>({severity:"error",code:o.code,message:o.message,path:o.path,queryHook:e.querySpec.queryHook,queryId:e.queryId,intentId:e.intent.id,source:e.intent.source}))}function Se(e){return e.querySpec.spec.queryKind!=="sql"?[]:z(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:e.intent.id}]:[]:[]}function Fe(e){return e.kind==="metric"?[...e.measures.map((r,o)=>({field:r,path:`spec.measures.${o}`})),...e.primaryMeasure?[{field:e.primaryMeasure,path:"spec.primaryMeasure"}]:[],...e.dateField?[{field:e.dateField,path:"spec.dateField"}]:[],...(e.dimensions||[]).map((r,o)=>({field:r,path:`spec.dimensions.${o}`})),...e.orderBy?[{field:e.orderBy.field,path:"spec.orderBy.field"}]:[],...(e.filters||[]).map((r,o)=>({field:r.field,path:`spec.filters.${o}.field`}))]:e.kind==="records"?[...e.fields.map((r,o)=>({field:r,path:`spec.fields.${o}`})),...e.dateField?[{field:e.dateField,path:"spec.dateField"}]:[],...e.orderBy?[{field:e.orderBy.field,path:"spec.orderBy.field"}]:[],...(e.filters||[]).map((r,o)=>({field:r.field,path:`spec.filters.${o}.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,o)=>({field:r,path:`spec.disambiguationFields.${o}`}))]:e.kind==="matrix"?[...e.rows.map((r,o)=>({field:r.field,path:`spec.rows.${o}.field`})),...e.rows.flatMap((r,o)=>{var t;return((t=r.sortBy)==null?void 0:t.by.kind)==="field"?[{field:r.sortBy.by.field,path:`spec.rows.${o}.sortBy.by.field`}]:[]}),...(e.columns||[]).map((r,o)=>({field:r.field,path:`spec.columns.${o}.field`})),...(e.columns||[]).flatMap((r,o)=>{var t;return((t=r.sortBy)==null?void 0:t.by.kind)==="field"?[{field:r.sortBy.by.field,path:`spec.columns.${o}.sortBy.by.field`}]:[]}),...e.values.map((r,o)=>({field:r.field,path:`spec.values.${o}.field`})),...(e.sort||[]).flatMap((r,o)=>r.by.kind==="field"?[{field:r.by.field,path:`spec.sort.${o}.by.field`}]:[]),...(e.filters||[]).map((r,o)=>({field:r.field,path:`spec.filters.${o}.field`}))]:[]}function N(e){return!("derivedFields"in e)||!Array.isArray(e.derivedFields)?[]:e.derivedFields}function Ie(e,r,o){return N(e).map(t=>({name:t.name,label:t.label,role:t.resultRole,dataType:t.dataType,source:r.source||o,...t.defaultAggregate?{aggregate:t.defaultAggregate}:{}}))}function ke(e){if(!(!e||typeof e!="object"))return e.field}function C(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:r.intent.id,source:r.intent.source}}function Re(e,r){const o=O(r);return{ok:o.ok&&e.ok,errors:A([...e.errors,...o.errors]),warnings:A([...e.warnings,...o.warnings]),repairHints:[...e.repairHints,...o.repairHints]}}function O(e){const r=e.filter(t=>t.severity==="error").map(P),o=e.filter(t=>t.severity==="warning").map(P);return{ok:r.length===0,errors:r,warnings:o,repairHints:r.map(t=>{var i,a;return{code:t.code,message:t.message,fieldRole:t.fieldRole,invalidField:(i=t.repairHint)==null?void 0:i.invalidField,recommendedNextStep:((a=t.repairHint)==null?void 0:a.recommendedNextStep)||"Update the Data App SDK query spec to use visible Semaphor source and field refs."}})}}function P(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 A(e){const r=new Set;return e.filter(o=>{const t=`${o.code}:${o.path||""}:${o.message}`;return r.has(t)?!1:(r.add(t),!0)})}function H(e){var o,t;const r=e.diagnostics.filter(i=>i.severity==="error");return{intentId:(o=e.intent)==null?void 0:o.id,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(i=>i.code==="missing_field").flatMap(i=>{var a;return(a=i.field)!=null&&a.name?[i.field.name]:[]}),warnings:e.diagnostics.filter(i=>i.severity==="warning").map(i=>i.message),metadata:{validationKind:"data_app_sdk_query_spec"}}}function xe(e,r){return r.id||K(e.spec)}function K(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=p;exports.findMatchingRelatedProjectionField=f;exports.isAllowedRelatedProjectionRole=j;exports.matrixAxisFieldsForPolicy=S;exports.normalizeSemaphorAnalysisQueryOptions=D;exports.normalizeSemaphorFieldRole=b;exports.relatedProjectionFieldCandidatesForIntent=W;exports.validateSemaphorDataAppQuerySpecs=ne;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("../chunks/validators-dJlwubP4.cjs");require("../chunks/analyze-result-contract-DSGoFuXQ.cjs");require("../value-format-preferences/index.cjs");const Q=require("../chunks/report-runtime-context-C0NfLPfc.cjs"),h=require("../data-app-sdk-adapters/index.cjs");function E({intent:e,field:r,catalogField:o,relativePath:t}){const i=J({intent:e,field:r,relativePath:t});if(!i||i.allowedRelatedRoles.length===0)return!1;const a=p(r,i.selectedField),s=b(o),n=m(a);return j(s,i.allowedRelatedRoles)?n===s:!1}function W(e){return e.kind==="records"?G(e):e.kind==="metric"?X(e):Y(e)}function b(e){const r=c.normalizeAnalyticsCatalogName(e.role);if(r==="measure")return"measure";if(r==="id")return"id";const o=c.normalizeAnalyticsCatalogDataType(e.dataType);if(r==="date"||o==="date"||o==="datetime")return"date";if(r==="dimension")return"dimension"}function j(e,r){return!!(e&&r.includes(e))}function p(e,r){const o=m(e);if(o)return e.role===o?e:{...e,role:o};const t=r?m(r):void 0;return t?{...e,role:t}:e}function f(e,r){return e.find(o=>T(o,r))}function S(e){return[...e.rows.map(r=>r.field),...(e.columns||[]).map(r=>r.field)]}function J({intent:e,field:r,relativePath:o}){if(e.kind==="records")return U(e,r,o);if(e.kind==="metric")return L(e,r,o);if(e.kind==="matrix")return V(e,r,o)}function U(e,r,o){if(o.startsWith("spec.fields."))return{allowedRelatedRoles:["dimension","date","id"]};if(o==="spec.dateField"&&!e.timeWindow)return{allowedRelatedRoles:["date"]};if(o==="spec.orderBy.field"){const t=f(M(e),r);return{selectedField:t,allowedRelatedRoles:t?R(t):[]}}}function L(e,r,o){if(o.startsWith("spec.dimensions."))return{allowedRelatedRoles:["dimension"]};if(o==="spec.orderBy.field"){const t=f(e.dimensions||[],r);return{selectedField:t,allowedRelatedRoles:t?["dimension"]:[]}}}function V(e,r,o){if(re(o))return{allowedRelatedRoles:["dimension","date"]};if(oe(o)){const t=f(S(e),r);return{selectedField:t,allowedRelatedRoles:q(t)}}}function G(e){var t,i;const r=M(e),o=(t=e.orderBy)!=null&&t.field?f(r,e.orderBy.field):void 0;return _([...r.map(a=>l(a,R(a))),...(i=e.orderBy)!=null&&i.field?[l(p(e.orderBy.field,o),o?R(o):[],{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 o,t;const r=(o=e.orderBy)!=null&&o.field?f(e.dimensions||[],e.orderBy.field):void 0;return _([...e.measures.map(i=>l(i,[])),...e.primaryMeasure?[l(e.primaryMeasure,[])]:[],...(e.dimensions||[]).map(i=>l(i,["dimension"])),...e.dateField?[l({...e.dateField,role:"date"},[])]:[],...(t=e.orderBy)!=null&&t.field?[l(p(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 Y(e){const r=[...e.rows,...e.columns||[]];return _([...r.map(o=>l(o.field,q(o.field))),...r.flatMap(o=>{var a;if(((a=o.sortBy)==null?void 0:a.by.kind)!=="field")return[];const t=o.sortBy.by.field,i=f(S(e),t);return[l(p(t,i),q(i),{unsupportedRelatedRoleMessage:"Joined matrix projections support related axis sort fields only when the same related field is used as a row/column axis.",recommendedNextStep:"Use a related field as a row or column axis, or keep axis sort fields on the base source."})]}),...e.values.map(o=>l(o.field,[],{unsupportedRelatedRoleMessage:"Joined matrix projections support related row/column dimensions or dates only. Related value fields are not supported in this phase.",recommendedNextStep:"Keep matrix values on the base source, or use governed SQL for unsupported aggregate-safe joined values."})),...(e.sort||[]).flatMap(o=>{if(o.by.kind!=="field")return[];const t=o.by.field,i=f(S(e),t);return[l(p(t,i),q(i),{unsupportedRelatedRoleMessage:"Joined matrix projections support related top-level sort fields only when the same related field is used as a row/column axis.",recommendedNextStep:"Use a related field as a row or column axis, or keep matrix sort fields on the base source."})]})])}function R(e){const r=e?m(e):void 0;return r==="dimension"?["dimension"]:r==="date"?["date"]:r==="id"?["id"]:["dimension","date","id"]}function q(e){const r=e?m(e):void 0;return r==="date"?["date"]:r==="dimension"?["dimension"]:[]}function l(e,r,o={}){return{field:p(e),allowedRelatedRoles:r,...o}}function _(e){const r=[];return e.forEach(o=>{r.some(t=>Z(t,o))||r.push(o)}),r}function M(e){const r=[...e.fields];return e.dateField&&!r.some(o=>B(o,e.dateField))&&r.push({...e.dateField,role:"date"}),r}function Z(e,r){return T(e.field,r.field)&&e.allowedRelatedRoles.join("|")===r.allowedRelatedRoles.join("|")&&(e.unsupportedRelatedRoleMessage||"")===(r.unsupportedRelatedRoleMessage||"")&&(e.recommendedNextStep||"")===(r.recommendedNextStep||"")}function B(e,r){return c.semaphorFieldRefsMatch(e,r)}function T(e,r){return B(e,r)&&ee(m(e),m(r))}function ee(e,r){return!!(e&&(!r||e===r))}function m(e){return b(e)}function re(e){const r=e.split(".");return r.length===4&&r[0]==="spec"&&(r[1]==="rows"||r[1]==="columns")&&x(r[2])&&r[3]==="field"}function oe(e){const r=e.split(".");return r.length===6&&r[0]==="spec"&&(r[1]==="rows"||r[1]==="columns")&&x(r[2])&&r[3]==="sortBy"&&r[4]==="by"&&r[5]==="field"||r.length===5&&r[0]==="spec"&&r[1]==="sort"&&x(r[2])&&r[3]==="by"&&r[4]==="field"}function x(e){return e===void 0||e.trim()===""?!1:Number.isInteger(Number(e))&&Number(e)>=0}function te({intent:e,field:r,relativePath:o,baseCatalog:t,fieldCatalogs:i}){const a=v(r,e.source),s=c.semaphorSourcesReferToSameDataset(a,e.source);if(!s&&!ae(e.source,a))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:a};const n=s?t:I(i,a);if(!n)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:a};const d=F(n,r,e.source);return d?!s&&!ie({intent:e,field:r,catalogField:d,relativePath:o})?{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:a}:{ok:!0,source:a,catalogField:d,usesBaseSource:s}:{ok:!1,code:"missing_field",message:`Field "${r.name}" is not visible on the selected Semaphor source.`,source:a}}function ie({intent:e,field:r,catalogField:o,relativePath:t}){return E({intent:e,field:r,catalogField:o,relativePath:t})}function ae(e,r){return e.kind==="semantic"&&r.kind==="semantic"&&e.domainId===r.domainId}function I(e,r){return e.find(o=>$(o,r))}function F(e,r,o){const t=v(r,o);if($(e,t))return e.fields.find(i=>se(i,r)&&$(e,v(i,e.source)))}function w(e){return c.normalizeAnalyticsCatalogName(e)}function v(e,r){return e.source||r}function $(e,r){return[e.source,...e.sourceAliases||[]].some(o=>c.semaphorSourcesReferToSameDataset(o,r))}function se(e,r){return!!(e.name&&r.name&&e.name===r.name)}function D(e,r={}){const o=r.pathPrefix||"analysisOptions";if(e===void 0)return{ok:!0};if(!e||typeof e!="object"||Array.isArray(e))return u(o,"Data App analysis options must be an object.");const t=e,i={};if(t.chartTitle!==void 0){if(typeof t.chartTitle!="string")return u(`${o}.chartTitle`,'Data App analysis option "chartTitle" must be a string.');i.chartTitle=t.chartTitle}if(t.chartType!==void 0){if(typeof t.chartType!="string")return u(`${o}.chartType`,'Data App analysis option "chartType" must be a string.');i.chartType=t.chartType}if(t.driverMode!==void 0){if(!le(t.driverMode))return u(`${o}.driverMode`,'Data App analysis option "driverMode" must be absolute_delta, largest_negative, largest_positive, positive_and_negative, or all.');i.driverMode=t.driverMode}if(t.includePopulation!==void 0){if(typeof t.includePopulation!="boolean")return u(`${o}.includePopulation`,'Data App analysis option "includePopulation" must be a boolean.');i.includePopulation=t.includePopulation}if(t.calendarContext!==void 0){const a=ce(t.calendarContext,{pathPrefix:`${o}.calendarContext`,validateTimezone:r.validateTimezone});if(!a.ok)return a;i.calendarContext=a.calendarContext}return{ok:!0,analysisOptions:i}}function ne(e){const r=e.queries.map((i,a)=>de(i,a,{fieldCatalogs:e.fieldCatalogs||[],requireFieldCatalog:!!e.requireFieldCatalog,validateTimezone:e.validateTimezone})),o=r.flatMap(i=>i.diagnostics),t=r.map(i=>i.executionResult);return{ok:o.every(i=>i.severity!=="error"),diagnostics:o,queries:r,intents:r.flatMap(i=>i.intent?[i.intent]:[]),executionResults:t}}function de(e,r,o){const t=`queries.${r}`;try{const i=ue(e),a=xe(e,i),s=c.validateSemaphorAnalyticsIntent(i),n=[...Se({querySpec:e,queryId:a,intent:i,pathPrefix:t}),...s.errors.map(g=>C(g,{queryHook:e.queryHook,queryId:a,pathPrefix:t,severity:"error",intent:i})),...s.warnings.map(g=>C(g,{queryHook:e.queryHook,queryId:a,pathPrefix:t,severity:"warning",intent:i})),...pe({querySpec:e,queryId:a,intent:i,pathPrefix:t,fieldCatalogs:o.fieldCatalogs,requireFieldCatalog:o.requireFieldCatalog}),...qe({querySpec:e,queryId:a,intent:i,pathPrefix:t,validateTimezone:o.validateTimezone})],d=Re(s,n);return{queryHook:e.queryHook,queryId:a,intent:i,diagnostics:n,executionResult:H({intent:i,validation:d,diagnostics:n})}}catch(i){const a={severity:"error",code:"invalid_query_spec",message:i instanceof Error?i.message:String(i),path:t,queryHook:e.queryHook,queryId:K(e.spec)},s=O([a]);return{queryHook:e.queryHook,queryId:a.queryId,diagnostics:[a],executionResult:H({validation:s,diagnostics:[a]})}}}function u(e,r){return{ok:!1,issues:[{code:"invalid_analysis_option",message:r,path:e}]}}function z(e){return!!(e&&typeof e=="object"&&!Array.isArray(e))}function le(e){return e==="absolute_delta"||e==="largest_negative"||e==="largest_positive"||e==="positive_and_negative"||e==="all"}function ce(e,r){if(!e||typeof e!="object"||Array.isArray(e))return u(r.pathPrefix,'Data App analysis option "calendarContext" must be an object.');const o=e,t=o.tz;let i=t;if(typeof t=="string"&&r.validateTimezone&&(i=r.validateTimezone(t)),i===null)return u(`${r.pathPrefix}.tz`,'Data App analysis option "calendarContext.tz" must be a valid timezone string.');const a=Q.parseCalendarContext({...o,tz:i});if(!a.ok){const s=a.issues[0];return u(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:a.value}}function ue(e){return fe(e.spec)}function fe(e){if(!z(e))throw new Error("useSemaphorQuery spec must be an object.");if(e.queryKind==="metric")return h.toSemaphorMetricIntent(e);if(e.queryKind==="analysis")return h.toSemaphorAnalysisIntent(e);if(e.queryKind==="records")return h.toSemaphorRecordsIntent(e);if(e.queryKind==="sql")return h.toSemaphorSqlIntent(e);if(e.queryKind==="matrix")return h.toSemaphorMatrixIntent(e);if(e.queryKind==="inputOptions")return h.toSemaphorInputOptionsIntent(e);throw new Error("useSemaphorQuery spec.queryKind must be metric, analysis, records, inputOptions, sql, or matrix.")}function pe(e){if(e.intent.kind==="sql")return[];if(e.fieldCatalogs.length===0&&!e.requireFieldCatalog)return[];const r=I(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:e.intent.id,source:e.intent.source}];const o=ye({...e,catalog:r}),t={...r,fields:[...r.fields,...Ie(e.intent,r,e.intent.source)]};return[...o,...me({...e,fieldCatalogs:e.fieldCatalogs}),...he({...e,catalog:t,fieldCatalogs:e.fieldCatalogs}),...ge({...e,catalog:t,fieldCatalogs:e.fieldCatalogs})]}function me(e){var o;if(e.intent.kind!=="inputOptions"||((o=e.intent.population)==null?void 0:o.kind)!=="related_population")return[];const r=e.intent.population.baseSource;return I(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:e.intent.id,source:r}]}function ye(e){const r=N(e.intent);if(r.length===0)return[];const o=[],t=new Set;return r.forEach((i,a)=>{const s=`${e.pathPrefix}.spec.derivedFields.${a}`,n=w(i.name);n&&(t.has(n)&&o.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:e.intent.id,source:e.intent.source}),t.add(n),e.catalog.fields.some(d=>w(d.name)===n)&&o.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:e.intent.id,source:e.intent.source})),Object.entries(i.inputs||{}).forEach(([d,g])=>{const y=ke(g);if(!y)return;const k=v(y,e.intent.source);if(!c.semaphorSourcesReferToSameDataset(k,e.intent.source)){o.push({severity:"error",code:"unsupported_derived_field_source",message:`Derived field "${i.name}" input "${d}" references a different Semaphor source. App-local derived fields must use fields from the query source.`,path:`${s}.inputs.${d}`,queryHook:e.querySpec.queryHook,queryId:e.queryId,intentId:e.intent.id,source:k,field:y});return}F(e.catalog,y,e.intent.source)||o.push({severity:"error",code:"missing_field",message:`Derived field "${i.name}" input "${d}" references field "${y.name}", which is not visible on the selected Semaphor source.`,path:`${s}.inputs.${d}`,queryHook:e.querySpec.queryHook,queryId:e.queryId,intentId:e.intent.id,source:k,field:y})})}),o}function he(e){return Fe(e.intent).flatMap(({field:r,path:o})=>{const t=te({intent:e.intent,field:r,relativePath:o,baseCatalog:e.catalog,fieldCatalogs:e.fieldCatalogs});return t.ok?[]:[{severity:"error",code:t.code,message:t.message,path:`${e.pathPrefix}.${o}${t.pathSuffix||""}`,queryHook:e.querySpec.queryHook,queryId:e.queryId,intentId:e.intent.id,source:t.source,field:r}]})}function ge(e){return("inputs"in e.intent?e.intent.inputs||[]:[]).flatMap((o,t)=>{if(!o.field)return[];const i=v(o.field,e.intent.source);if(!c.semaphorSourcesReferToSameDataset(i,e.intent.source)){if(ve(e.intent,i)){const a=I(e.fieldCatalogs,i);return a?F(a,o.field,i)?[]:[{severity:"error",code:"missing_field",message:`Input "${o.inputId}" references field "${o.field.name}", which is not visible on the selected Semaphor source.`,path:`${e.pathPrefix}.spec.inputs.${t}.field`,queryHook:e.querySpec.queryHook,queryId:e.queryId,intentId:e.intent.id,source:i,field:o.field}]:[{severity:"error",code:"invalid_source_ref",message:`Input "${o.inputId}" references a Semaphor source that is not present in the visible field catalog.`,path:`${e.pathPrefix}.spec.inputs.${t}.field.source`,queryHook:e.querySpec.queryHook,queryId:e.queryId,intentId:e.intent.id,source:i,field:o.field}]}return[{severity:"error",code:"unsupported_input_filter_composition",message:`Input "${o.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.${t}.field`,queryHook:e.querySpec.queryHook,queryId:e.queryId,intentId:e.intent.id,source:i,field:o.field}]}return F(e.catalog,o.field,e.intent.source)?[]:[{severity:"error",code:"missing_field",message:`Input "${o.inputId}" references field "${o.field.name}", which is not visible on the selected Semaphor source.`,path:`${e.pathPrefix}.spec.inputs.${t}.field`,queryHook:e.querySpec.queryHook,queryId:e.queryId,intentId:e.intent.id,source:i,field:o.field}]})}function ve(e,r){return e.source.kind==="semantic"&&r.kind==="semantic"&&r.domainId===e.source.domainId}function qe(e){if(e.querySpec.spec.queryKind!=="analysis")return[];const r=D(e.querySpec.spec,{pathPrefix:`${e.pathPrefix}.spec`,validateTimezone:e.validateTimezone});return r.ok?[]:r.issues.map(o=>({severity:"error",code:o.code,message:o.message,path:o.path,queryHook:e.querySpec.queryHook,queryId:e.queryId,intentId:e.intent.id,source:e.intent.source}))}function Se(e){return e.querySpec.spec.queryKind!=="sql"?[]:z(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:e.intent.id}]:[]:[]}function Fe(e){return e.kind==="metric"?[...e.measures.map((r,o)=>({field:r,path:`spec.measures.${o}`})),...e.primaryMeasure?[{field:e.primaryMeasure,path:"spec.primaryMeasure"}]:[],...e.dateField?[{field:e.dateField,path:"spec.dateField"}]:[],...(e.dimensions||[]).map((r,o)=>({field:r,path:`spec.dimensions.${o}`})),...e.orderBy?[{field:e.orderBy.field,path:"spec.orderBy.field"}]:[],...(e.filters||[]).map((r,o)=>({field:r.field,path:`spec.filters.${o}.field`}))]:e.kind==="records"?[...e.fields.map((r,o)=>({field:r,path:`spec.fields.${o}`})),...e.dateField?[{field:e.dateField,path:"spec.dateField"}]:[],...e.orderBy?[{field:e.orderBy.field,path:"spec.orderBy.field"}]:[],...(e.filters||[]).map((r,o)=>({field:r.field,path:`spec.filters.${o}.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,o)=>({field:r,path:`spec.disambiguationFields.${o}`}))]:e.kind==="matrix"?[...e.rows.map((r,o)=>({field:r.field,path:`spec.rows.${o}.field`})),...e.rows.flatMap((r,o)=>{var t;return((t=r.sortBy)==null?void 0:t.by.kind)==="field"?[{field:r.sortBy.by.field,path:`spec.rows.${o}.sortBy.by.field`}]:[]}),...(e.columns||[]).map((r,o)=>({field:r.field,path:`spec.columns.${o}.field`})),...(e.columns||[]).flatMap((r,o)=>{var t;return((t=r.sortBy)==null?void 0:t.by.kind)==="field"?[{field:r.sortBy.by.field,path:`spec.columns.${o}.sortBy.by.field`}]:[]}),...e.values.map((r,o)=>({field:r.field,path:`spec.values.${o}.field`})),...(e.sort||[]).flatMap((r,o)=>r.by.kind==="field"?[{field:r.by.field,path:`spec.sort.${o}.by.field`}]:[]),...(e.filters||[]).map((r,o)=>({field:r.field,path:`spec.filters.${o}.field`}))]:[]}function N(e){return!("derivedFields"in e)||!Array.isArray(e.derivedFields)?[]:e.derivedFields}function Ie(e,r,o){return N(e).map(t=>({name:t.name,label:t.label,role:t.resultRole,dataType:t.dataType,source:r.source||o,...t.defaultAggregate?{aggregate:t.defaultAggregate}:{}}))}function ke(e){if(!(!e||typeof e!="object"))return e.field}function C(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:r.intent.id,source:r.intent.source}}function Re(e,r){const o=O(r);return{ok:o.ok&&e.ok,errors:A([...e.errors,...o.errors]),warnings:A([...e.warnings,...o.warnings]),repairHints:[...e.repairHints,...o.repairHints]}}function O(e){const r=e.filter(t=>t.severity==="error").map(P),o=e.filter(t=>t.severity==="warning").map(P);return{ok:r.length===0,errors:r,warnings:o,repairHints:r.map(t=>{var i,a;return{code:t.code,message:t.message,fieldRole:t.fieldRole,invalidField:(i=t.repairHint)==null?void 0:i.invalidField,recommendedNextStep:((a=t.repairHint)==null?void 0:a.recommendedNextStep)||"Update the Data App SDK query spec to use visible Semaphor source and field refs."}})}}function P(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 A(e){const r=new Set;return e.filter(o=>{const t=`${o.code}:${o.path||""}:${o.message}`;return r.has(t)?!1:(r.add(t),!0)})}function H(e){var o,t;const r=e.diagnostics.filter(i=>i.severity==="error");return{intentId:(o=e.intent)==null?void 0:o.id,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(i=>i.code==="missing_field").flatMap(i=>{var a;return(a=i.field)!=null&&a.name?[i.field.name]:[]}),warnings:e.diagnostics.filter(i=>i.severity==="warning").map(i=>i.message),metadata:{validationKind:"data_app_sdk_query_spec"}}}function xe(e,r){return r.id||K(e.spec)}function K(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=p;exports.findMatchingRelatedProjectionField=f;exports.isAllowedRelatedProjectionRole=j;exports.matrixAxisFieldsForPolicy=S;exports.normalizeSemaphorAnalysisQueryOptions=D;exports.normalizeSemaphorFieldRole=b;exports.relatedProjectionFieldCandidatesForIntent=W;exports.validateSemaphorDataAppQuerySpecs=ne;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "../chunks/analyze-result-contract-
|
|
1
|
+
import { C as H, F as O, s as K, af as q, y as Q } from "../chunks/validators-DVd8s3qY.js";
|
|
2
|
+
import "../chunks/analyze-result-contract-DROq4vgY.js";
|
|
3
3
|
import "../value-format-preferences/index.js";
|
|
4
|
-
import { p as E } from "../chunks/report-runtime-context-
|
|
4
|
+
import { p as E } from "../chunks/report-runtime-context-CNncA3VD.js";
|
|
5
5
|
import { toSemaphorMetricIntent as J, toSemaphorAnalysisIntent as U, toSemaphorRecordsIntent as W, toSemaphorSqlIntent as L, toSemaphorMatrixIntent as V, toSemaphorInputOptionsIntent as G } from "../data-app-sdk-adapters/index.js";
|
|
6
6
|
function X({
|
|
7
7
|
intent: e,
|
|
@@ -58,7 +58,7 @@ function m(e, r) {
|
|
|
58
58
|
}
|
|
59
59
|
function u(e, r) {
|
|
60
60
|
return e.find(
|
|
61
|
-
(o) =>
|
|
61
|
+
(o) => B(o, r)
|
|
62
62
|
);
|
|
63
63
|
}
|
|
64
64
|
function k(e) {
|
|
@@ -256,17 +256,17 @@ function $(e) {
|
|
|
256
256
|
function M(e) {
|
|
257
257
|
const r = [...e.fields];
|
|
258
258
|
return e.dateField && !r.some(
|
|
259
|
-
(o) =>
|
|
259
|
+
(o) => j(o, e.dateField)
|
|
260
260
|
) && r.push({ ...e.dateField, role: "date" }), r;
|
|
261
261
|
}
|
|
262
262
|
function se(e, r) {
|
|
263
|
-
return
|
|
263
|
+
return B(e.field, r.field) && e.allowedRelatedRoles.join("|") === r.allowedRelatedRoles.join("|") && (e.unsupportedRelatedRoleMessage || "") === (r.unsupportedRelatedRoleMessage || "") && (e.recommendedNextStep || "") === (r.recommendedNextStep || "");
|
|
264
264
|
}
|
|
265
|
-
function
|
|
265
|
+
function j(e, r) {
|
|
266
266
|
return K(e, r);
|
|
267
267
|
}
|
|
268
|
-
function
|
|
269
|
-
return
|
|
268
|
+
function B(e, r) {
|
|
269
|
+
return j(e, r) && ne(
|
|
270
270
|
f(e),
|
|
271
271
|
f(r)
|
|
272
272
|
);
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("../chunks/format-types-PSZZ7hG8.cjs"),n=require("../chunks/pivot-result-lifecycle-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("../chunks/format-types-PSZZ7hG8.cjs"),n=require("../chunks/pivot-result-lifecycle-BXzIlQVu.cjs"),s=require("../chunks/pivot-header-presentation-BijPbP33.cjs"),f=require("../chunks/validators-dJlwubP4.cjs"),c=require("../chunks/temporal-bucket-pMfghsLX.cjs"),p=require("../chunks/pivot-result-identity-DxHtiKVj.cjs"),v=require("../chunks/raw-temporal-contract-DfAvqNMo.cjs");function V(r,e,t,o){const a=r instanceof Date?r.toISOString():String(r),i=(o==null?void 0:o.browserTimezone)||t,l=(o==null?void 0:o.isSqlCard)??!1;if(e!=null&&e.useRelativeTime)return s.formatRelativeTime(a,(e==null?void 0:e.sourceTimezone)||"auto");const m=e!=null&&e.useCustomFormat&&(e!=null&&e.customFormat)?e.customFormat:(e==null?void 0:e.format)||"MM/dd/yyyy";return s.formatDate(a,m,e!=null&&e.timezone&&(e==null?void 0:e.timezone)!=="auto"?e.timezone:l?i:t,(e==null?void 0:e.sourceTimezone)||"auto")}function y(r,e,t){if(r==null)return"";if(!t.useFormattedValues||!e)return String(r);switch(e.type){case"number":return typeof r=="number"?n.formatNumberWithColumnSettings(r,e.numberFormat,t.locale):String(r);case"date":return V(r,e.dateFormat,t.timezone,{browserTimezone:t.browserTimezone,isSqlCard:t.isSqlCard});case"progress":return typeof r=="number"?`${r}%`:String(r);case"badge":case"link":case"text":case"none":default:return String(r)}}function h(r,e){return e.visibleColumns.map(t=>{const o=r[t],a=e.columnSettings[t];return y(o,a,{useFormattedValues:e.useFormattedValues,timezone:e.timezone,locale:e.locale})})}function S(r,e){const t=[];e.includeHeaders&&t.push(s.arrayToCSVRow(e.visibleColumns,e.delimiter));for(const o of r){const a=h(o,e);t.push(a.map(i=>s.escapeCSVValue(i,e.delimiter)).join(e.delimiter))}return t}function M(r,e,t=`
|
|
2
2
|
`){return S(r,e).join(t)}function d(r,e,t){for(const o of r){if(o.level<t){e[o.level].push(o.name);for(let a=1;a<o.colspan;a++)e[o.level].push("")}o.children?d(o.children,e,t):o.columnKey&&e[t].push(o.name)}}function P(r){const e=r.pivotByColumns.length,t=r.groupByColumns.length,o=Array.from({length:e+1},()=>[]);for(let a=0;a<e;a++)o[a].push(...Array(t).fill(""));if(o[e].push(...r.groupByColumns.map(a=>a.label||a.name)),d(r.columnHeadersTree,o,e),r.showRowTotals){for(let a=0;a<e;a++)o[a].push("");o[e].push("Total")}return o}function N(r,e,t){if(r==null)return"";if(!t.useFormattedValues)return String(r);const o=t.columnSettings[e];return typeof r=="number"&&(o==null?void 0:o.type)==="number"?n.formatNumberWithColumnSettings(r,o.numberFormat,t.locale):typeof r=="number"?r.toLocaleString(t.locale):String(r)}function A(r,e,t){const o=[];r.fieldValues.forEach((i,l)=>{r.isSubtotal&&l===0?o.push(`${i} Total`):r.isSubtotal?o.push(""):o.push(String(i??""))});let a=0;return e.columnHeaders.forEach(i=>{var u;const l=(u=r.cells[i])==null?void 0:u.value,m=N(l,i,t);o.push(m),e.showRowTotals&&typeof l=="number"&&(a+=l)}),e.showRowTotals&&o.push(a.toLocaleString(t.locale)),o}function k(r,e,t){const o=[];if(t.includeHeaders){const a=P(e);for(const i of a)o.push(s.arrayToCSVRow(i,t.delimiter))}for(const a of r){const i=A(a,e,t);o.push(i.map(l=>s.escapeCSVValue(l,t.delimiter)).join(t.delimiter))}return o}function R(r){if(r===null||typeof r!="object"||Array.isArray(r))return!1;const e=Object.getPrototypeOf(r);return e===null||e===Object.prototype}function C(r,e,t){const o=new Set(e),a=Object.keys(r).find(i=>!o.has(i));if(a)throw new Error(`${t} contains unknown property "${a}"`)}function B(r,e="tableTotalsRequest"){if(!R(r))throw new Error(`${e} must be an object`);if(C(r,["source","columns"],e),r.source!=="documentFlatTable")throw new Error(`${e}.source must be documentFlatTable`);if(!Array.isArray(r.columns)||r.columns.length===0)throw new Error(`${e}.columns must be a non-empty array`);let t=0;const o=r.columns.map((l,m)=>{const u=`${e}.columns.${m}`;if(!R(l))throw new Error(`${u} must be an object`);C(l,["fieldId","role","behavior","metricAlias","label"],u);const w=typeof l.fieldId=="string"?l.fieldId.trim():"";if(!w)throw new Error(`${u}.fieldId must be a non-empty string`);if(l.role!=="detail"&&l.role!=="groupby"&&l.role!=="metric")throw new Error(`${u}.role is invalid`);const T=l.role;if(l.behavior!=="sum"&&l.behavior!=="avg"&&l.behavior!=="count"&&l.behavior!=="label")throw new Error(`${u}.behavior is invalid`);const E=l.behavior,b=typeof l.metricAlias=="string"?l.metricAlias.trim():void 0;if(l.metricAlias!==void 0&&!b)throw new Error(`${u}.metricAlias must be a non-empty string`);if(b&&T!=="metric")throw new Error(`${u}.metricAlias requires metric role`);if(E==="label"){if(t+=1,T==="metric")throw new Error(`${u}.behavior label requires a non-metric role`)}else if(T!=="metric")throw new Error(`${u}.${E} requires metric role`);if(l.label!==void 0&&typeof l.label!="string")throw new Error(`${u}.label must be a string`);return{fieldId:w,role:T,behavior:E,...b?{metricAlias:b}:{},...l.label!==void 0?{label:l.label}:{}}}),a=new Map,i=new Set;for(const l of o){if(l.metricAlias){if(i.has(l.metricAlias))throw new Error(`${e}.columns duplicates metricAlias "${l.metricAlias}"`);i.add(l.metricAlias)}const m=a.get(l.fieldId)??[];m.push(l),a.set(l.fieldId,m)}for(const[l,m]of a)if(m.length!==1){for(const u of m)if(u.role!=="metric"||!u.metricAlias)throw new Error(`${e}.columns duplicates fieldId "${l}" without distinct metricAlias values`)}if(t>1)throw new Error(`${e}.columns may contain at most one label`);return{source:"documentFlatTable",columns:o}}function $(r,e="tableTotalsByColumnId"){if(!R(r))throw new Error(`${e} must be an object`);const t={};for(const[o,a]of Object.entries(r)){if(!o.trim())throw new Error(`${e} contains an empty column id`);if(a!==null&&typeof a!="string"&&(typeof a!="number"||!Number.isFinite(a)))throw new Error(`${e}.${o} must be a string, finite number, or null`);t[o]=a}if(Object.keys(t).length===0)throw new Error(`${e} must not be empty`);return t}function _(r){if(typeof r=="number")return Number.isFinite(r)?r:null;if(!r.trim())return null;const e=Number(r);return Number.isFinite(e)?e:null}function I(r){const e=r.visibleColumns.map(t=>{const a=Object.prototype.hasOwnProperty.call(r.totalsByColumnId,t)?r.totalsByColumnId[t]:t===r.labelColumnKey?"Total":null;if(a===null)return"";if(!r.useFormattedValues)return String(a);const i=n.findResolvedNumericFormat({snapshot:r.snapshot,scope:r.scope,target:{kind:"column",columnKey:t}}),l=i?_(a):null;return i&&l!==null?n.formatNumericCanonical(l,i):String(a)});return`${s.arrayToCSVRow(e,r.delimiter)}
|
|
3
3
|
`}exports.isNumericCanonicalFormat=g.isNumericCanonicalFormat;exports.MissingResolvedRawTemporalFormatError=n.MissingResolvedRawTemporalFormatError;exports.PivotResultLifecycleError=n.PivotResultLifecycleError;exports.PresentationExecutionSnapshotError=n.PresentationExecutionSnapshotError;exports.RawTemporalFormatContractError=n.RawTemporalFormatContractError;exports.assertRawTemporalChunkClassificationAgreement=n.assertRawTemporalChunkClassificationAgreement;exports.classifyDeclaredSqlTemporalColumn=n.classifyDeclaredSqlTemporalColumn;exports.createCanonicalPivotResultTransport=n.createCanonicalPivotResultTransport;exports.createPresentationExecutionSnapshot=n.createPresentationExecutionSnapshot;exports.createRawTemporalChunkClassificationEvidence=n.createRawTemporalChunkClassificationEvidence;exports.deriveMetricInstanceAliasExpectations=n.deriveMetricInstanceAliasExpectations;exports.derivePivotResultContractExpectations=n.derivePivotResultContractExpectations;exports.findResolvedNumericFormat=n.findResolvedNumericFormat;exports.findResolvedRawTemporalFormat=n.findResolvedRawTemporalFormat;exports.findResolvedTemporalBucketFormat=n.findResolvedTemporalBucketFormat;exports.formatCurrency=n.formatCurrency;exports.formatNumber=n.formatNumber;exports.formatNumberCustom=n.formatNumberCustom;exports.formatNumberWithColumnSettings=n.formatNumberWithColumnSettings;exports.formatNumericCanonical=n.formatNumericCanonical;exports.formatPercent=n.formatPercent;exports.formatRawTemporalValue=n.formatRawTemporalValue;exports.formatScientific=n.formatScientific;exports.parseCanonicalPivotResultTransport=n.parseCanonicalPivotResultTransport;exports.parseNumericCanonicalFormat=n.parseNumericCanonicalFormat;exports.parsePresentationExecutionSnapshot=n.parsePresentationExecutionSnapshot;exports.parsePresentationScope=n.parsePresentationScope;exports.parseRawTemporalChunkClassificationEvidence=n.parseRawTemporalChunkClassificationEvidence;exports.parseResolvedNumericCanonicalFormat=n.parseResolvedNumericCanonicalFormat;exports.parseResolvedPresentationEntries=n.parseResolvedPresentationEntries;exports.parseResolvedRawTemporalFormat=n.parseResolvedRawTemporalFormat;exports.prepareRawTemporalFormatter=n.prepareRawTemporalFormatter;exports.resolveCurrencyFractionDigits=n.resolveCurrencyFractionDigits;exports.resolveNumericPresentation=n.resolveNumericPresentation;exports.resolveRawTemporalFormat=n.resolveRawTemporalFormat;exports.validateCardExportNumericPresentationSnapshot=n.validateCardExportNumericPresentationSnapshot;exports.validateCardExportPresentationSnapshot=n.validateCardExportPresentationSnapshot;exports.AGGREGATE_TOTAL_MEMBER_MARKER=s.AGGREGATE_TOTAL_MEMBER_MARKER;exports.PivotHeaderPresentationError=s.PivotHeaderPresentationError;exports.arrayToCSV=s.arrayToCSV;exports.arrayToCSVRow=s.arrayToCSVRow;exports.escapeCSVValue=s.escapeCSVValue;exports.formatAggregateGrandTotalLabel=s.formatAggregateGrandTotalLabel;exports.formatAggregateGroupCell=s.formatAggregateGroupCell;exports.formatAggregateGroupRow=s.formatAggregateGroupRow;exports.formatAggregateSubtotalLabel=s.formatAggregateSubtotalLabel;exports.formatDate=s.formatDate;exports.formatDuration=s.formatDuration;exports.formatMetricComparison=s.formatMetricComparison;exports.formatRelativeTime=s.formatRelativeTime;exports.getTimezoneAbbreviation=s.getTimezoneAbbreviation;exports.getTimezoneName=s.getTimezoneName;exports.isAggregateTotalMemberMarker=s.isAggregateTotalMemberMarker;exports.objectsToCSV=s.objectsToCSV;exports.parseWithSourceTimezone=s.parseWithSourceTimezone;exports.presentAggregateGroupRow=s.presentAggregateGroupRow;exports.presentPivotHeader=s.presentPivotHeader;exports.resolveAggregateTablePresentationContext=s.resolveAggregateTablePresentationContext;exports.resolveTimezone=s.resolveTimezone;exports.SEMAPHOR_GENERATED_COUNT_METRIC_ID=f.SEMAPHOR_GENERATED_COUNT_METRIC_ID;exports.TEMPORAL_BUCKET_PATTERN_TOKENS=f.TEMPORAL_BUCKET_PATTERN_TOKENS;exports.isTemporalBucketPreset=f.isTemporalBucketPreset;exports.resolveApplicableTemporalBucketFormat=f.resolveApplicableTemporalBucketFormat;exports.tokenizeTemporalBucketPattern=f.tokenizeTemporalBucketPattern;exports.validateTemporalBucketFormatApplicability=f.validateTemporalBucketFormatApplicability;exports.DEFAULT_RESOLVED_TEMPORAL_STYLE_SET=c.DEFAULT_RESOLVED_TEMPORAL_STYLE_SET;exports.TemporalBucketContractError=c.TemporalBucketContractError;exports.formatTemporalBucket=c.formatTemporalBucket;exports.parseResolvedTemporalBucketFormat=c.parseResolvedTemporalBucketFormat;exports.parseTemporalBucketValue=c.parseTemporalBucketValue;exports.resolveMetricResultAlias=c.resolveMetricResultAlias;exports.resolveTemporalBucketPresentation=c.resolveTemporalBucketPresentation;exports.PivotResultIdentityError=p.PivotResultIdentityError;exports.isPivotEmptyTupleAllowed=p.isPivotEmptyTupleAllowed;exports.isPivotSubtotalPrefix=p.isPivotSubtotalPrefix;exports.requirePivotHeaderMembers=p.requirePivotHeaderMembers;exports.requirePivotResultColumnIdentities=p.requirePivotResultColumnIdentities;exports.resolveQueryColumnKeyMapEntry=p.resolveQueryColumnKeyMapEntry;exports.resolveUniqueQueryColumnKeyMapEntry=p.resolveUniqueQueryColumnKeyMapEntry;exports.parseRawTemporalValueMetadata=v.parseRawTemporalValueMetadata;exports.validateRawTemporalResultColumn=v.validateRawTemporalResultColumn;exports.buildFlatTableExportTotalsFooter=I;exports.formatCellValue=y;exports.formatPivotDataRow=A;exports.formatPivotTableForCSV=k;exports.formatRowForExport=h;exports.formatTableForCSV=S;exports.generatePivotHeaders=P;exports.generateTableCSV=M;exports.parseFlatTableExportTotalsByColumnId=$;exports.parseFlatTableExportTotalsRequest=B;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { i as _ } from "../chunks/format-types-CFHQoIuk.js";
|
|
2
|
-
import { f as w, a as y, b as R } from "../chunks/pivot-result-lifecycle-
|
|
3
|
-
import { M as L, E as G, P as H, R as K, z as U, w as W, G as Q, n as F, x as Y, C as J, D as X, o as Z, q as ee, d as re, c as oe, h as te, e as se, B as ne, g as le, F as ae, p as ie, m as ue, k as me, y as ce, i as fe, l as pe, t as be, A as Te, r as we, j as he, u as Ee, v as ye, s as Re } from "../chunks/pivot-result-lifecycle-
|
|
4
|
-
import { f as C, a as v, b as p, e as h } from "../chunks/pivot-header-presentation-
|
|
5
|
-
import { A as ve, P as Ae, i as Se, m as Pe, q as de, s as ge, l as $e, c as
|
|
6
|
-
import {
|
|
7
|
-
import { i as Qe, T as Fe,
|
|
8
|
-
import { P as or, b as tr, i as sr, c as nr, d as lr, r as ar, a as ir } from "../chunks/pivot-result-identity-
|
|
9
|
-
import { p as mr, v as cr } from "../chunks/raw-temporal-contract-
|
|
2
|
+
import { f as w, a as y, b as R } from "../chunks/pivot-result-lifecycle-g2U-vzQb.js";
|
|
3
|
+
import { M as L, E as G, P as H, R as K, z as U, w as W, G as Q, n as F, x as Y, C as J, D as X, o as Z, q as ee, d as re, c as oe, h as te, e as se, B as ne, g as le, F as ae, p as ie, m as ue, k as me, y as ce, i as fe, l as pe, t as be, A as Te, r as we, j as he, u as Ee, v as ye, s as Re } from "../chunks/pivot-result-lifecycle-g2U-vzQb.js";
|
|
4
|
+
import { f as C, a as v, b as p, e as h } from "../chunks/pivot-header-presentation-DW0gKG8g.js";
|
|
5
|
+
import { A as ve, P as Ae, i as Se, m as Pe, q as de, s as ge, l as $e, c as ke, d as Ve, g as xe, h as Me, j as Be, o as Ie, p as Ne, n as je, t as ze, k as Oe, r as qe } from "../chunks/pivot-header-presentation-DW0gKG8g.js";
|
|
6
|
+
import { r as De, am as Le, ak as Ge, an as He, al as Ke, aj as Ue } from "../chunks/validators-DVd8s3qY.js";
|
|
7
|
+
import { i as Qe, T as Fe, h as Ye, j as Je, p as Xe, a as Ze, k as er } from "../chunks/temporal-bucket-C85rmFmC.js";
|
|
8
|
+
import { P as or, b as tr, i as sr, c as nr, d as lr, r as ar, a as ir } from "../chunks/pivot-result-identity-Z9tN2tEV.js";
|
|
9
|
+
import { p as mr, v as cr } from "../chunks/raw-temporal-contract-UtAqoOZO.js";
|
|
10
10
|
function A(r, e, t, o) {
|
|
11
11
|
const s = r instanceof Date ? r.toISOString() : String(r), l = (o == null ? void 0 : o.browserTimezone) || t, n = (o == null ? void 0 : o.isSqlCard) ?? !1;
|
|
12
12
|
if (e != null && e.useRelativeTime)
|
|
@@ -117,7 +117,7 @@ function $(r, e, t) {
|
|
|
117
117
|
t.locale
|
|
118
118
|
) : typeof r == "number" ? r.toLocaleString(t.locale) : String(r);
|
|
119
119
|
}
|
|
120
|
-
function
|
|
120
|
+
function k(r, e, t) {
|
|
121
121
|
const o = [];
|
|
122
122
|
r.fieldValues.forEach((l, n) => {
|
|
123
123
|
r.isSubtotal && n === 0 ? o.push(`${l} Total`) : r.isSubtotal ? o.push("") : o.push(String(l ?? ""));
|
|
@@ -137,7 +137,7 @@ function I(r, e, t) {
|
|
|
137
137
|
o.push(p(l, t.delimiter));
|
|
138
138
|
}
|
|
139
139
|
for (const s of r) {
|
|
140
|
-
const l =
|
|
140
|
+
const l = k(
|
|
141
141
|
s,
|
|
142
142
|
e,
|
|
143
143
|
t
|
|
@@ -242,7 +242,7 @@ function j(r, e = "tableTotalsByColumnId") {
|
|
|
242
242
|
throw new Error(`${e} must not be empty`);
|
|
243
243
|
return t;
|
|
244
244
|
}
|
|
245
|
-
function
|
|
245
|
+
function V(r) {
|
|
246
246
|
if (typeof r == "number")
|
|
247
247
|
return Number.isFinite(r) ? r : null;
|
|
248
248
|
if (!r.trim())
|
|
@@ -264,7 +264,7 @@ function z(r) {
|
|
|
264
264
|
snapshot: r.snapshot,
|
|
265
265
|
scope: r.scope,
|
|
266
266
|
target: { kind: "column", columnKey: t }
|
|
267
|
-
}), n = l ?
|
|
267
|
+
}), n = l ? V(s) : null;
|
|
268
268
|
return l && n !== null ? R(n, l) : String(s);
|
|
269
269
|
});
|
|
270
270
|
return `${p(e, r.delimiter)}
|
|
@@ -303,14 +303,14 @@ export {
|
|
|
303
303
|
S as formatCellValue,
|
|
304
304
|
re as formatCurrency,
|
|
305
305
|
v as formatDate,
|
|
306
|
-
|
|
307
|
-
|
|
306
|
+
ke as formatDuration,
|
|
307
|
+
Ve as formatMetricComparison,
|
|
308
308
|
oe as formatNumber,
|
|
309
309
|
te as formatNumberCustom,
|
|
310
310
|
w as formatNumberWithColumnSettings,
|
|
311
311
|
R as formatNumericCanonical,
|
|
312
312
|
se as formatPercent,
|
|
313
|
-
|
|
313
|
+
k as formatPivotDataRow,
|
|
314
314
|
I as formatPivotTableForCSV,
|
|
315
315
|
ne as formatRawTemporalValue,
|
|
316
316
|
C as formatRelativeTime,
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./chunks/index-DHF-2AqS.cjs"),d=require("./chunks/common-types-C57kJ59w.cjs"),P=require("./chunks/report-preferences-dialog-BK0yAJnQ.cjs"),i=require("react/jsx-runtime"),r=require("./chunks/switch-f3TuZNLr.cjs"),h=require("react"),N=require("./chunks/token-types-D7CaaI80.cjs"),u=require("./chunks/dashboard-briefing-launcher-DHtEouuH.cjs"),R=require("./chunks/use-debounced-dirty-check-XHSwAefL.cjs");require("./value-format-preferences/index.cjs");require("./chunks/validators-BDYprKI9.cjs");const _=require("./chunks/report-runtime-context-DqxS4wbi.cjs"),T=require("./chunks/pivot-result-identity-Bb4EixVN.cjs");require("./chunks/analyze-result-contract-LPDNldic.cjs");require("./chunks/temporal-bucket-authoring-o3Emn05L.cjs");require("./chunks/canonical-result-keys-BA0HCP4e.cjs");require("./chunks/saved-temporal-bucket-format-CFfWXRl9.cjs");require("react-dom");require("./chunks/color-CyB5o13F.cjs");require("./chunks/index-ByFbacH7.cjs");const B=require("./chunks/normalize-dashboard-for-dirty-check-BXRUMVb2.cjs"),w=require("./chunks/x-B6ghREd2.cjs");function j(a){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(a){for(const o in a)if(o!=="default"){const l=Object.getOwnPropertyDescriptor(a,o);Object.defineProperty(t,o,l.get?l:{enumerable:!0,get:()=>a[o]})}}return t.default=a,Object.freeze(t)}const C=j(h);function M(a){const{displayPreferences:t,cardId:o,...l}=a,n={...l,id:a.dashboardId};return i.jsx(e.ErrorBoundary,{FallbackComponent:e.Fallback,children:i.jsxs(e.SemaphorContextProvider,{dashboardProps:n,children:[i.jsx(e.SemaphorReadyIndicator,{componentType:"visual",componentId:a.cardId}),i.jsx(e.UXProvider,{appearance:a.appearance,children:i.jsx(e.DisplayPreferencesProvider,{displayPreferences:t,children:i.jsx(e.Container,{type:"visual",cardId:o,...n,children:i.jsx(L,{cardId:o})})})})]})})}function L({cardId:a}){const t=r.useDashboardStore(n=>{var c;return(c=n.dashboard)==null?void 0:c.sheets}),{card:o,frame:l}=h.useMemo(()=>{const n=t==null?void 0:t.flatMap(s=>s.frames),c=n==null?void 0:n.flatMap(s=>s==null?void 0:s.cards),D=c==null?void 0:c.find(s=>(s==null?void 0:s.id)===a),E=n==null?void 0:n.find(s=>{var m;return(m=s==null?void 0:s.cards)==null?void 0:m.find(g=>(g==null?void 0:g.id)===a)});return{card:D,frame:E}},[t,a]);return!o||!l?i.jsx(e.FallbackVisual,{error:new Error("Card not found"),resetErrorBoundary:()=>{},customerFacingMessage:`Card not found with ID: ${a}`}):i.jsx("main",{className:"flex h-full grow flex-col",children:i.jsx(e.ErrorBoundary,{FallbackComponent:({error:n,resetErrorBoundary:c})=>i.jsx(e.FallbackVisual,{error:n,resetErrorBoundary:c,customerFacingMessage:"Error creating visual. Please try again."}),children:i.jsx(e.DashboardCard,{card:o,frame:l})})})}function q(a,t,o,l){h.useEffect(()=>{a&&!o&&t&&l(e.cloneDeep(t))},[a,o,t,l])}function I({name:a,items:t,value:o,onChange:l,isLoading:n,isError:c,refetch:D,className:E,icon:s,showNone:m=!1}){const g=C.useRef(null),[y,b]=C.useState(!1),[S,A]=C.useState("100%"),x=m?[...t||[],{id:"none",name:"None"}]:t;C.useLayoutEffect(()=>{g.current&&A(g.current.offsetWidth)},[]);function v(){var f;return n?"Loading...":c?"Error":o?(f=t==null?void 0:t.find(p=>p.id===o))==null?void 0:f.name:`Select ${a}`}function F(f,p){l(p),b(!1)}return i.jsxs(r.Popover,{open:y,onOpenChange:b,children:[i.jsx(r.PopoverTrigger,{asChild:!0,children:i.jsxs(r.Button,{ref:g,variant:"outline",role:"combobox","aria-expanded":y,className:r.cn("flex h-9 w-full justify-between",E),children:[i.jsxs("div",{className:"flex items-center gap-2",children:[s&&i.jsx("div",{className:"mr-2",children:s}),i.jsx("span",{className:"max-w-[150px] overflow-hidden truncate text-ellipsis whitespace-nowrap",children:v()})]}),i.jsx(w.ChevronDown,{className:"size-4 opacity-50"})]})}),i.jsx(r.PopoverContent,{className:"w-full p-0",style:{minWidth:S},children:i.jsxs(e.Command,{children:[i.jsxs("div",{className:"flex h-9 items-center justify-between border-b pr-1",children:[i.jsx(e.CommandInput,{className:"h-9",placeholder:"Search..."}),i.jsx(e.IconButton,{className:"h-7",onClick:D,children:i.jsx(e.RefreshCw,{className:r.cn("size-3.5 opacity-50",n&&"animate-spin")})})]}),i.jsxs(e.CommandList,{children:[i.jsxs(e.CommandEmpty,{children:["No ",a==null?void 0:a.toLowerCase()," found."]}),i.jsx(e.CommandGroup,{children:x==null?void 0:x.map(f=>i.jsx(e.CommandItem,{className:"overflow-x-auto",value:f.name,onSelect:p=>F(p,f.id),children:i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(r.Check,{className:r.cn("size-4",o===f.id?"opacity-100":"opacity-0")}),i.jsx("div",{title:f.name,children:f.name})]})},f.id))})]})]})})]})}function U(a,t){h.useEffect(()=>(a&&t&&(window.__SEMAPHOR_PRINT_STATE__={...t}),()=>{a&&window.__SEMAPHOR_PRINT_STATE__&&delete window.__SEMAPHOR_PRINT_STATE__}),[a,t])}exports.BriefingAuthor=e.BriefingAuthor;exports.BriefingAuthorDialog=e.BriefingAuthorDialog;exports.BriefingUiCapabilitiesBoundary=e.BriefingUiCapabilitiesBoundary;exports.BriefingUiCapabilitiesProvider=e.BriefingUiCapabilitiesProvider;exports.BriefingsApiError=e.BriefingsApiError;exports.CardSummary=e.CardSummary;exports.Dashboard=e.Dashboard;exports.DashboardCreateDialogBase=e.DashboardCreateDialogBase;exports.DashboardExportDialog=e.DashboardExportDialog;exports.DashboardWC=e.DashboardWC;exports.DisplayFormatPreferencesFields=e.DisplayFormatPreferencesFields;exports.ExportError=e.ExportError;exports.MatrixTableVisual=e.MatrixTableVisual;exports.ResourceType=e.ResourceType;exports.SemaphorContextProvider=e.SemaphorContextProvider;exports.SemaphorDataProvider=e.SemaphorQueryClient;exports.SemaphorQueryClient=e.SemaphorQueryClient;exports.ShareDialog=e.ShareDialog;exports.SummaryCard=e.SummaryCard;exports.Surfboard=e.DashboardPlus;exports.applyBriefingFormPatch=e.applyBriefingFormPatch;exports.briefingFormDraftToCreateRequest=e.briefingFormDraftToCreateRequest;exports.briefingFormDraftToUpdateRequest=e.briefingFormDraftToUpdateRequest;exports.briefingToFormDraft=e.briefingToFormDraft;exports.cancelBriefingPreviewRun=e.cancelBriefingPreviewRun;exports.cancelBriefingRun=e.cancelBriefingRun;exports.cancelExport=e.cancelExport;exports.cloneDeep=e.cloneDeep;exports.createBriefing=e.createBriefing;exports.createBriefingFormDraft=e.createBriefingFormDraft;exports.createExport=e.createExport;exports.deleteBriefing=e.deleteBriefing;exports.deleteBriefingRun=e.deleteBriefingRun;exports.downloadDocumentPdf=e.downloadDocumentPdf;exports.downloadPdf=e.downloadPdf;exports.formatFileSize=e.formatFileSize;exports.getBriefing=e.getBriefing;exports.getBriefingArtifact=e.getBriefingArtifact;exports.getBriefingEvidence=e.getBriefingEvidence;exports.getBriefingPreviewRun=e.getBriefingPreviewRun;exports.getBriefingRun=e.getBriefingRun;exports.getDownloadUrl=e.getDownloadUrl;exports.getExportStatus=e.getExportStatus;exports.getExports=e.getExports;exports.isExportComplete=e.isExportComplete;exports.isExportInProgress=e.isExportInProgress;exports.listBriefingRuns=e.listBriefingRuns;exports.listBriefingTenantSummaries=e.listBriefingTenantSummaries;exports.listBriefings=e.listBriefings;exports.pauseBriefing=e.pauseBriefing;exports.polishBriefingText=e.polishBriefingText;exports.previewBriefingPlan=e.previewBriefingPlan;exports.resumeBriefing=e.resumeBriefing;exports.runBriefingNow=e.runBriefingNow;exports.runBriefingPreview=e.runBriefingPreview;exports.updateBriefing=e.updateBriefing;exports.useActiveExports=e.useActiveExports;exports.useAddNewFrame=e.useAddNewFrame;exports.useBriefingUiCapabilities=e.useBriefingUiCapabilities;exports.useCard=e.useCard;exports.useCardSummary=e.useCardSummary;exports.useDashboardById=e.useDashboardById;exports.useDashboardQuery=e.useDashboardQuery;exports.useDashboardSummary=e.useDashboardSummary;exports.useDataColumns=e.useDataColumns;exports.useDateFilterHook=e.useDateFilterHook;exports.useEditorAside=e.useEditorAside;exports.useExportActions=e.useExportActions;exports.useExportStore=e.useExportStore;exports.useInProgressExportsCount=e.useInProgressExportsCount;exports.useManagementStore=e.useManagementStore;exports.useResourceManagement=e.useResourceManagement;exports.useTextFilterHook=e.useTextFilterHook;exports.validateBriefingFormDraft=e.validateBriefingFormDraft;exports.CALCULATED_FIELD_ENTITY_MARKER=d.CALCULATED_FIELD_ENTITY_MARKER;exports.CONTROL_CARD_DEFAULT_VALUE=d.CONTROL_CARD_DEFAULT_VALUE;exports.DATE_FORMAT_VALUES=d.DATE_FORMAT_VALUES;exports.EMPTY_SELECTION=d.EMPTY_SELECTION;exports.PivotMarkerEnum=d.PivotMarkerEnum;exports.getFieldRuntimeColumnName=d.getFieldRuntimeColumnName;exports.hasCalculatedFieldMarker=d.hasCalculatedFieldMarker;exports.hasCalculatedFormulaInputs=d.hasCalculatedFormulaInputs;exports.isCalculatedDimension=d.isCalculatedDimension;exports.isCalculatedField=d.isCalculatedField;exports.isCalculatedMetric=d.isCalculatedMetric;exports.ReportPreferencesDialog=P.ReportPreferencesDialog;exports.createEmptyKpiConfig=r.createEmptyKpiConfig;exports.createSqlGenConfig=r.createSqlGenConfig;exports.emitDashboardLoad=r.emitDashboardLoad;exports.emitDashboardUnload=r.emitDashboardUnload;exports.fmt=r.fmt;exports.getColumnDataType=r.getColumnDataType;exports.getFilterValueType=r.getFilterValueType;exports.getFormattedTableNameForQuery=r.getFormattedTableNameForQuery;exports.getQualifiedTableName=r.getQualifiedTableName;exports.getSql=r.getSql;exports.invalidateToken=r.invalidateToken;exports.isBooleanDataType=r.isBooleanDataType;exports.isColumnInSqlGen=r.isColumnInSqlGen;exports.isDateDataType=r.isDateDataType;exports.isNumberDataType=r.isNumberDataType;exports.isTextDataType=r.isTextDataType;exports.resolveDataType=r.resolveDataType;exports.resolveDatamodelName=r.resolveDatamodelName;exports.useCurrentActiveCard=r.useCurrentActiveCard;exports.useCurrentCardConfig=r.useCurrentCardConfig;exports.useCurrentSheetActiveCards=r.useCurrentSheetActiveCards;exports.useDashboardActions=r.useDashboardActions;exports.useDashboardStore=r.useDashboardStore;exports.useEditorActions=r.useEditorActions;exports.useEditorStore=r.useEditorStore;exports.DEFAULT_SEMANTIC_DOMAIN_ACCESS=N.DEFAULT_SEMANTIC_DOMAIN_ACCESS;exports.AdvancedModeToggle=u.AdvancedModeToggle;exports.DashboardBriefingLauncher=u.DashboardBriefingLauncher;exports.DashboardControlsSettings=u.DashboardControlsSettings;exports.DashboardFilterControlsButton=u.DashboardFilterControlsButton;exports.DashboardFilterControlsLauncher=u.DashboardFilterControlsLauncher;exports.DocumentControlsSettings=u.DocumentControlsSettings;exports.ExportNotificationItem=u.ExportNotificationItem;exports.ExportNotificationList=u.ExportNotificationList;exports.NotificationBell=u.NotificationBell;exports.UnsavedChangesAlert=u.UnsavedChangesAlert;exports.VisualEditingControls=u.VisualEditingControls;exports.VisualsLibraryDialog=u.VisualsLibraryDialog;exports.WatchDashboardButton=u.WatchDashboardButton;exports.useExportPolling=u.useExportPolling;exports.useExportRecovery=u.useExportRecovery;exports.useDebouncedDirtyCheck=R.useDebouncedDirtyCheck;exports.DEFAULT_CALENDAR_CONTEXT=_.DEFAULT_CALENDAR_CONTEXT;exports.resolveQueryColumnKeyMapEntry=T.resolveQueryColumnKeyMapEntry;exports.resolveUniqueQueryColumnKeyMapEntry=T.resolveUniqueQueryColumnKeyMapEntry;exports.normalizeDashboardForDirtyCheck=B.normalizeDashboardForDirtyCheck;exports.serializeDashboardForDirtyCheck=B.serializeDashboardForDirtyCheck;exports.Combobox=I;exports.Visual=M;exports.useExposePrintState=U;exports.usePristineSnapshotInitializer=q;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./chunks/index-B1qplNxl.cjs"),d=require("./chunks/common-types-BcV9PD9D.cjs"),P=require("./chunks/report-preferences-dialog-DKPyjiCt.cjs"),i=require("react/jsx-runtime"),r=require("./chunks/switch-DBZsEV0U.cjs"),h=require("react"),N=require("./chunks/token-types-BYYO109W.cjs"),u=require("./chunks/dashboard-briefing-launcher-xuGrw8H3.cjs"),R=require("./chunks/use-debounced-dirty-check-XHSwAefL.cjs");require("./value-format-preferences/index.cjs");require("./chunks/validators-dJlwubP4.cjs");const _=require("./chunks/report-runtime-context-C0NfLPfc.cjs"),T=require("./chunks/pivot-result-identity-DxHtiKVj.cjs");require("./chunks/analyze-result-contract-DSGoFuXQ.cjs");require("./chunks/temporal-bucket-authoring-BK1UhYpD.cjs");require("./chunks/saved-temporal-bucket-format-3QKveR3v.cjs");require("react-dom");require("./chunks/color-CyB5o13F.cjs");require("./chunks/index-ByFbacH7.cjs");const B=require("./chunks/normalize-dashboard-for-dirty-check-BXRUMVb2.cjs"),w=require("./chunks/x-B6ghREd2.cjs");function j(a){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(a){for(const o in a)if(o!=="default"){const l=Object.getOwnPropertyDescriptor(a,o);Object.defineProperty(t,o,l.get?l:{enumerable:!0,get:()=>a[o]})}}return t.default=a,Object.freeze(t)}const C=j(h);function M(a){const{displayPreferences:t,cardId:o,...l}=a,n={...l,id:a.dashboardId};return i.jsx(e.ErrorBoundary,{FallbackComponent:e.Fallback,children:i.jsxs(e.SemaphorContextProvider,{dashboardProps:n,children:[i.jsx(e.SemaphorReadyIndicator,{componentType:"visual",componentId:a.cardId}),i.jsx(e.UXProvider,{appearance:a.appearance,children:i.jsx(e.DisplayPreferencesProvider,{displayPreferences:t,children:i.jsx(e.Container,{type:"visual",cardId:o,...n,children:i.jsx(L,{cardId:o})})})})]})})}function L({cardId:a}){const t=r.useDashboardStore(n=>{var c;return(c=n.dashboard)==null?void 0:c.sheets}),{card:o,frame:l}=h.useMemo(()=>{const n=t==null?void 0:t.flatMap(s=>s.frames),c=n==null?void 0:n.flatMap(s=>s==null?void 0:s.cards),D=c==null?void 0:c.find(s=>(s==null?void 0:s.id)===a),E=n==null?void 0:n.find(s=>{var m;return(m=s==null?void 0:s.cards)==null?void 0:m.find(g=>(g==null?void 0:g.id)===a)});return{card:D,frame:E}},[t,a]);return!o||!l?i.jsx(e.FallbackVisual,{error:new Error("Card not found"),resetErrorBoundary:()=>{},customerFacingMessage:`Card not found with ID: ${a}`}):i.jsx("main",{className:"flex h-full grow flex-col",children:i.jsx(e.ErrorBoundary,{FallbackComponent:({error:n,resetErrorBoundary:c})=>i.jsx(e.FallbackVisual,{error:n,resetErrorBoundary:c,customerFacingMessage:"Error creating visual. Please try again."}),children:i.jsx(e.DashboardCard,{card:o,frame:l})})})}function q(a,t,o,l){h.useEffect(()=>{a&&!o&&t&&l(e.cloneDeep(t))},[a,o,t,l])}function I({name:a,items:t,value:o,onChange:l,isLoading:n,isError:c,refetch:D,className:E,icon:s,showNone:m=!1}){const g=C.useRef(null),[y,b]=C.useState(!1),[S,A]=C.useState("100%"),x=m?[...t||[],{id:"none",name:"None"}]:t;C.useLayoutEffect(()=>{g.current&&A(g.current.offsetWidth)},[]);function v(){var f;return n?"Loading...":c?"Error":o?(f=t==null?void 0:t.find(p=>p.id===o))==null?void 0:f.name:`Select ${a}`}function F(f,p){l(p),b(!1)}return i.jsxs(r.Popover,{open:y,onOpenChange:b,children:[i.jsx(r.PopoverTrigger,{asChild:!0,children:i.jsxs(r.Button,{ref:g,variant:"outline",role:"combobox","aria-expanded":y,className:r.cn("flex h-9 w-full justify-between",E),children:[i.jsxs("div",{className:"flex items-center gap-2",children:[s&&i.jsx("div",{className:"mr-2",children:s}),i.jsx("span",{className:"max-w-[150px] overflow-hidden truncate text-ellipsis whitespace-nowrap",children:v()})]}),i.jsx(w.ChevronDown,{className:"size-4 opacity-50"})]})}),i.jsx(r.PopoverContent,{className:"w-full p-0",style:{minWidth:S},children:i.jsxs(e.Command,{children:[i.jsxs("div",{className:"flex h-9 items-center justify-between border-b pr-1",children:[i.jsx(e.CommandInput,{className:"h-9",placeholder:"Search..."}),i.jsx(e.IconButton,{className:"h-7",onClick:D,children:i.jsx(e.RefreshCw,{className:r.cn("size-3.5 opacity-50",n&&"animate-spin")})})]}),i.jsxs(e.CommandList,{children:[i.jsxs(e.CommandEmpty,{children:["No ",a==null?void 0:a.toLowerCase()," found."]}),i.jsx(e.CommandGroup,{children:x==null?void 0:x.map(f=>i.jsx(e.CommandItem,{className:"overflow-x-auto",value:f.name,onSelect:p=>F(p,f.id),children:i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(r.Check,{className:r.cn("size-4",o===f.id?"opacity-100":"opacity-0")}),i.jsx("div",{title:f.name,children:f.name})]})},f.id))})]})]})})]})}function U(a,t){h.useEffect(()=>(a&&t&&(window.__SEMAPHOR_PRINT_STATE__={...t}),()=>{a&&window.__SEMAPHOR_PRINT_STATE__&&delete window.__SEMAPHOR_PRINT_STATE__}),[a,t])}exports.BriefingAuthor=e.BriefingAuthor;exports.BriefingAuthorDialog=e.BriefingAuthorDialog;exports.BriefingUiCapabilitiesBoundary=e.BriefingUiCapabilitiesBoundary;exports.BriefingUiCapabilitiesProvider=e.BriefingUiCapabilitiesProvider;exports.BriefingsApiError=e.BriefingsApiError;exports.CardSummary=e.CardSummary;exports.Dashboard=e.Dashboard;exports.DashboardCreateDialogBase=e.DashboardCreateDialogBase;exports.DashboardExportDialog=e.DashboardExportDialog;exports.DashboardWC=e.DashboardWC;exports.DisplayFormatPreferencesFields=e.DisplayFormatPreferencesFields;exports.ExportError=e.ExportError;exports.MatrixTableVisual=e.MatrixTableVisual;exports.ResourceType=e.ResourceType;exports.SemaphorContextProvider=e.SemaphorContextProvider;exports.SemaphorDataProvider=e.SemaphorQueryClient;exports.SemaphorQueryClient=e.SemaphorQueryClient;exports.ShareDialog=e.ShareDialog;exports.SummaryCard=e.SummaryCard;exports.Surfboard=e.DashboardPlus;exports.applyBriefingFormPatch=e.applyBriefingFormPatch;exports.briefingFormDraftToCreateRequest=e.briefingFormDraftToCreateRequest;exports.briefingFormDraftToUpdateRequest=e.briefingFormDraftToUpdateRequest;exports.briefingToFormDraft=e.briefingToFormDraft;exports.cancelBriefingPreviewRun=e.cancelBriefingPreviewRun;exports.cancelBriefingRun=e.cancelBriefingRun;exports.cancelExport=e.cancelExport;exports.cloneDeep=e.cloneDeep;exports.createBriefing=e.createBriefing;exports.createBriefingFormDraft=e.createBriefingFormDraft;exports.createExport=e.createExport;exports.deleteBriefing=e.deleteBriefing;exports.deleteBriefingRun=e.deleteBriefingRun;exports.downloadDocumentPdf=e.downloadDocumentPdf;exports.downloadPdf=e.downloadPdf;exports.formatFileSize=e.formatFileSize;exports.getBriefing=e.getBriefing;exports.getBriefingArtifact=e.getBriefingArtifact;exports.getBriefingEvidence=e.getBriefingEvidence;exports.getBriefingPreviewRun=e.getBriefingPreviewRun;exports.getBriefingRun=e.getBriefingRun;exports.getDownloadUrl=e.getDownloadUrl;exports.getExportStatus=e.getExportStatus;exports.getExports=e.getExports;exports.isExportComplete=e.isExportComplete;exports.isExportInProgress=e.isExportInProgress;exports.listBriefingRuns=e.listBriefingRuns;exports.listBriefingTenantSummaries=e.listBriefingTenantSummaries;exports.listBriefings=e.listBriefings;exports.pauseBriefing=e.pauseBriefing;exports.polishBriefingText=e.polishBriefingText;exports.previewBriefingPlan=e.previewBriefingPlan;exports.resumeBriefing=e.resumeBriefing;exports.runBriefingNow=e.runBriefingNow;exports.runBriefingPreview=e.runBriefingPreview;exports.updateBriefing=e.updateBriefing;exports.useActiveExports=e.useActiveExports;exports.useAddNewFrame=e.useAddNewFrame;exports.useBriefingUiCapabilities=e.useBriefingUiCapabilities;exports.useCard=e.useCard;exports.useCardSummary=e.useCardSummary;exports.useDashboardById=e.useDashboardById;exports.useDashboardQuery=e.useDashboardQuery;exports.useDashboardSummary=e.useDashboardSummary;exports.useDataColumns=e.useDataColumns;exports.useDateFilterHook=e.useDateFilterHook;exports.useEditorAside=e.useEditorAside;exports.useExportActions=e.useExportActions;exports.useExportStore=e.useExportStore;exports.useInProgressExportsCount=e.useInProgressExportsCount;exports.useManagementStore=e.useManagementStore;exports.useResourceManagement=e.useResourceManagement;exports.useTextFilterHook=e.useTextFilterHook;exports.validateBriefingFormDraft=e.validateBriefingFormDraft;exports.CALCULATED_FIELD_ENTITY_MARKER=d.CALCULATED_FIELD_ENTITY_MARKER;exports.CONTROL_CARD_DEFAULT_VALUE=d.CONTROL_CARD_DEFAULT_VALUE;exports.DATE_FORMAT_VALUES=d.DATE_FORMAT_VALUES;exports.EMPTY_SELECTION=d.EMPTY_SELECTION;exports.PivotMarkerEnum=d.PivotMarkerEnum;exports.getFieldRuntimeColumnName=d.getFieldRuntimeColumnName;exports.hasCalculatedFieldMarker=d.hasCalculatedFieldMarker;exports.hasCalculatedFormulaInputs=d.hasCalculatedFormulaInputs;exports.isCalculatedDimension=d.isCalculatedDimension;exports.isCalculatedField=d.isCalculatedField;exports.isCalculatedMetric=d.isCalculatedMetric;exports.ReportPreferencesDialog=P.ReportPreferencesDialog;exports.createEmptyKpiConfig=r.createEmptyKpiConfig;exports.createSqlGenConfig=r.createSqlGenConfig;exports.emitDashboardLoad=r.emitDashboardLoad;exports.emitDashboardUnload=r.emitDashboardUnload;exports.fmt=r.fmt;exports.getColumnDataType=r.getColumnDataType;exports.getFilterValueType=r.getFilterValueType;exports.getFormattedTableNameForQuery=r.getFormattedTableNameForQuery;exports.getQualifiedTableName=r.getQualifiedTableName;exports.getSql=r.getSql;exports.invalidateToken=r.invalidateToken;exports.isBooleanDataType=r.isBooleanDataType;exports.isColumnInSqlGen=r.isColumnInSqlGen;exports.isDateDataType=r.isDateDataType;exports.isNumberDataType=r.isNumberDataType;exports.isTextDataType=r.isTextDataType;exports.resolveDataType=r.resolveDataType;exports.resolveDatamodelName=r.resolveDatamodelName;exports.useCurrentActiveCard=r.useCurrentActiveCard;exports.useCurrentCardConfig=r.useCurrentCardConfig;exports.useCurrentSheetActiveCards=r.useCurrentSheetActiveCards;exports.useDashboardActions=r.useDashboardActions;exports.useDashboardStore=r.useDashboardStore;exports.useEditorActions=r.useEditorActions;exports.useEditorStore=r.useEditorStore;exports.DEFAULT_SEMANTIC_DOMAIN_ACCESS=N.DEFAULT_SEMANTIC_DOMAIN_ACCESS;exports.AdvancedModeToggle=u.AdvancedModeToggle;exports.DashboardBriefingLauncher=u.DashboardBriefingLauncher;exports.DashboardControlsSettings=u.DashboardControlsSettings;exports.DashboardFilterControlsButton=u.DashboardFilterControlsButton;exports.DashboardFilterControlsLauncher=u.DashboardFilterControlsLauncher;exports.DocumentControlsSettings=u.DocumentControlsSettings;exports.ExportNotificationItem=u.ExportNotificationItem;exports.ExportNotificationList=u.ExportNotificationList;exports.NotificationBell=u.NotificationBell;exports.UnsavedChangesAlert=u.UnsavedChangesAlert;exports.VisualEditingControls=u.VisualEditingControls;exports.VisualsLibraryDialog=u.VisualsLibraryDialog;exports.WatchDashboardButton=u.WatchDashboardButton;exports.useExportPolling=u.useExportPolling;exports.useExportRecovery=u.useExportRecovery;exports.useDebouncedDirtyCheck=R.useDebouncedDirtyCheck;exports.DEFAULT_CALENDAR_CONTEXT=_.DEFAULT_CALENDAR_CONTEXT;exports.resolveQueryColumnKeyMapEntry=T.resolveQueryColumnKeyMapEntry;exports.resolveUniqueQueryColumnKeyMapEntry=T.resolveUniqueQueryColumnKeyMapEntry;exports.normalizeDashboardForDirtyCheck=B.normalizeDashboardForDirtyCheck;exports.serializeDashboardForDirtyCheck=B.serializeDashboardForDirtyCheck;exports.Combobox=I;exports.Visual=M;exports.useExposePrintState=U;exports.usePristineSnapshotInitializer=q;
|