react-semaphor 0.1.597 → 0.1.599
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/analytics-protocol/index.js +355 -346
- package/dist/assistant-context/index.js +1 -1
- package/dist/assistant-protocol/index.js +5 -5
- package/dist/brand-studio/index.js +8 -8
- package/dist/briefings/index.js +5 -5
- package/dist/chunks/{add-to-dashboard-C86FsM8D.js → add-to-dashboard-ClhEIFst.js} +1 -1
- package/dist/chunks/{analytics-base-schemas-8wz9vqn_.js → analytics-base-schemas-DevrgqQb.js} +67 -60
- package/dist/chunks/{assistant-chat-DUDiH9z4.js → assistant-chat-f3XuzrAm.js} +88 -89
- package/dist/chunks/{bookmark-impact-Dh-wiTs3.js → bookmark-impact-B5hyttm2.js} +3 -3
- package/dist/chunks/{bookmark-state-Be2W3s6t.js → bookmark-state-h1OLXVjE.js} +153 -153
- package/dist/chunks/{card-filter-builder-2-OxEBWf.js → card-filter-builder-DfLqD2RV.js} +1047 -1075
- package/dist/chunks/{comparison-window-caption-DmMFtNP5.js → comparison-window-caption-DJDwP9XO.js} +6 -6
- package/dist/chunks/{context-CVXTFljo.js → context-BJoEFgNl.js} +1 -1
- package/dist/chunks/{dashboard-g-7XY0Kw.js → dashboard-CoI4aOUc.js} +1 -1
- package/dist/chunks/{dashboard-briefing-launcher-CVDhvsTk.js → dashboard-briefing-launcher-RxYGtk-F.js} +181 -181
- package/dist/chunks/{dashboard-controls-CtQY-J33.js → dashboard-controls-DeaXrtLK.js} +85 -85
- package/dist/chunks/{dashboard-json-DkhzPI3-.js → dashboard-json-DvxKpKd_.js} +5 -5
- package/dist/chunks/dates-BhtO28Sn.js +164 -0
- package/dist/chunks/{edit-dashboard-visual-DWn74pCl.js → edit-dashboard-visual-C4f5hONA.js} +5489 -5433
- package/dist/chunks/{filter-line-BpdPq1D2.js → filter-line-Dkg3yuOX.js} +6 -6
- package/dist/chunks/{filter-reach-copy-DoXmRmk-.js → filter-reach-copy-Cl5Od38Q.js} +1760 -1584
- package/dist/chunks/{filter-value-text-CDQCIREQ.js → filter-value-text-CXyuLW9Q.js} +4 -4
- package/dist/chunks/{index-C0jX5wlM.js → index-EKpTtkYF.js} +7 -7
- package/dist/chunks/{layout-grid-DoFIfQGd.js → layout-grid-DSrBSfPM.js} +1 -1
- package/dist/chunks/{matrix-analytical-definition-CyWOwLmE.js → matrix-analytical-definition-BuUSBDm7.js} +242 -214
- package/dist/chunks/matrix-member-presentation-B_2beBc0.js +258 -0
- package/dist/chunks/{matrix-operation-contract-CAanJeCj.js → matrix-operation-contract-DdK0J_KU.js} +47 -47
- package/dist/chunks/{metric-comparison-BeKnUD08.js → metric-comparison-Bhz0V841.js} +2 -2
- package/dist/chunks/{paintbrush-KeaU1L1a.js → paintbrush-1UiU-uTz.js} +1 -1
- package/dist/chunks/{palette-BcFJLeXB.js → palette-DFIFf_-m.js} +1 -1
- package/dist/chunks/{pivot-result-contract-expectations-Dt0E1Wou.js → pivot-result-contract-expectations-Dk7WFR_u.js} +47 -47
- package/dist/chunks/{pivot-result-identity-BKUjYO1u.js → pivot-result-identity-CzzrJpEm.js} +1 -1
- package/dist/chunks/{raw-temporal-value-BzdgeDa7.js → raw-temporal-value-BLvdaMng.js} +2 -2
- package/dist/chunks/{report-preferences-dialog-5WUi6jC0.js → report-preferences-dialog-CZaYsQLK.js} +14 -14
- package/dist/chunks/{report-runtime-context-g4Zp_TU9.js → report-runtime-context-CEGluufW.js} +2 -2
- package/dist/chunks/{resolve-dashboard-input-context-DfJshnw8.js → resolve-dashboard-input-context-vPtbuDDz.js} +11786 -11247
- package/dist/chunks/{save-C9CZAk6V.js → save-CWQ02kHo.js} +1 -1
- package/dist/chunks/{saved-dashboard-context-DdhPU2Kq.js → saved-dashboard-context-C6X5nP4C.js} +97 -97
- package/dist/chunks/{selection-filter-compiler-BclSpK3P.js → selection-filter-compiler-Ce4BpjRX.js} +1 -1
- package/dist/chunks/{semaphor-ready-indicator-miYoJ-HP.js → semaphor-ready-indicator-BUiaKY6O.js} +60709 -59628
- package/dist/chunks/{shelf-drop-preview-context-D-awfyyo.js → shelf-drop-preview-context-CwxWJjBv.js} +6 -6
- package/dist/chunks/{stored-dashboard-D6FtWx_3.js → stored-dashboard-Bmct-STp.js} +1165 -1148
- package/dist/chunks/{style-sheet-parts-DM_Mw_sm.js → style-sheet-parts-BX7d7-2-.js} +198 -198
- package/dist/chunks/{table-export-sheet-DBlFMvE8.js → table-export-sheet-BWSVTclx.js} +1 -1
- package/dist/chunks/{token-types-BB2ImFx6.js → token-types-CnlEiAdS.js} +1 -1
- package/dist/chunks/{upload-CMTCg47S.js → upload-DsqUSS8l.js} +1 -1
- package/dist/chunks/{validators-BlEWWX9O.js → validators-D2Hm57lJ.js} +1090 -1071
- package/dist/chunks/{variable-draft-CxdgKDCx.js → variable-draft-Bi-zUa_a.js} +4 -4
- package/dist/dashboard/index.js +2 -2
- package/dist/dashboard-authoring/index.js +2554 -2538
- package/dist/format-utils/index.js +14 -14
- package/dist/index.js +48 -48
- package/dist/report-runtime-context/index.js +2 -2
- package/dist/style.css +1 -1
- package/dist/surfboard/index.js +2 -2
- package/dist/types/components/surfboard/filter/types.d.ts +13 -1
- package/dist/types/components/visual/data-table/hooks/use-data-table-logic.d.ts +0 -2
- package/dist/types/components/visual/data-table/types/data-table.d.ts +14 -21
- package/dist/types/index.js +5 -5
- package/dist/types/lib/dashboard-view-state/card-view-state.d.ts +11 -1
- package/dist/types/lib/dashboard-view-state/drill-path.d.ts +7 -0
- package/dist/types/lib/dashboard-viewer/table-view.d.ts +20 -0
- package/dist/types/lib/matrix-table/matrix-runtime-types.d.ts +8 -0
- package/dist/types/lib/matrix-table/matrix-runtime.d.ts +1 -0
- package/dist/types/lib/query-context/resolve-runtime-card-filters.d.ts +2 -0
- package/dist/types/lib/stores/dashboard-store.d.ts +3 -1
- package/dist/types/lib/utils/filter-default-value-utils.d.ts +1 -1
- package/dist/types/shared/analytics-protocol/analytics-base-schemas.d.ts +64 -0
- package/dist/types/shared/analytics-protocol/catalog-field-grounding.d.ts +7 -0
- package/dist/types/shared/analytics-protocol/column-filter-id.d.ts +4 -0
- package/dist/types/shared/analytics-protocol/contracts.d.ts +26 -0
- package/dist/types/shared/analytics-protocol/index.d.ts +2 -0
- package/dist/types/shared/analytics-protocol/numeric-range-options.d.ts +46 -0
- package/dist/types/shared/dashboard-authoring/card-query-request.d.ts +12 -1
- package/dist/types/shared/dashboard-authoring/card-settings/card-display-write.d.ts +12 -0
- package/dist/types/shared/dashboard-authoring/card-settings/card-kinds.d.ts +1 -1
- package/dist/types/shared/dashboard-authoring/card-settings/index.d.ts +1 -1
- package/dist/types/shared/dashboard-authoring/card-settings/inputs.d.ts +4 -0
- package/dist/types/shared/dashboard-authoring/card-settings/resolved.d.ts +2 -0
- package/dist/types/shared/dashboard-authoring/changes/dashboard-change.d.ts +63 -0
- package/dist/types/shared/dashboard-authoring/conditional-formatting/schema.d.ts +10 -10
- package/dist/types/shared/dashboard-authoring/dashboard-filter-mapping-contract.d.ts +2 -0
- package/dist/types/shared/dashboard-authoring/filter-model/index.d.ts +2 -0
- package/dist/types/shared/dashboard-authoring/filter-model/number-condition-spec.d.ts +24 -0
- package/dist/types/shared/dashboard-authoring/filter-model/number-range-setting.d.ts +47 -0
- package/dist/types/shared/dashboard-authoring/operations/operation-types.d.ts +8 -1
- package/dist/types/shared/dashboard-authoring/outline/outline-dashboard.d.ts +3 -1
- package/dist/types/shared/dashboard-authoring/outline/outline-filters.d.ts +35 -3
- package/dist/types/shared/usage-events/attribution.d.ts +2 -2
- package/dist/types/shared/usage-events/envelope.d.ts +2 -2
- package/dist/usage-events/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunks/aggregate-measure-field-DHlDj0Pc.js +0 -22
- package/dist/chunks/dates-B-bKEsiu.js +0 -115
- package/dist/chunks/list-filter-BeTQxjNy.js +0 -15
- package/dist/chunks/matrix-member-presentation-Bj2YcHAP.js +0 -169
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import { G as $, H as
|
|
2
|
-
import {
|
|
3
|
-
import { a as
|
|
1
|
+
import { G as $, H as A, E as he, I as te, F as K, L as pe } from "./raw-temporal-value-BLvdaMng.js";
|
|
2
|
+
import { ap as C, ar as w, aj as U, ah as p, aq as ve, ai as z, aw as ke, ak as X, a7 as Q, e as Ie, K as J, t as Ne } from "./validators-D2Hm57lJ.js";
|
|
3
|
+
import { a as Ce } from "./metric-comparison-Bhz0V841.js";
|
|
4
|
+
import { M as _e } from "./matrix-operation-contract-DdK0J_KU.js";
|
|
4
5
|
class Y extends Error {
|
|
5
6
|
constructor(t) {
|
|
6
7
|
super(t), this.name = "RelativeDateUsageError";
|
|
7
8
|
}
|
|
8
9
|
}
|
|
9
|
-
function
|
|
10
|
+
function Se(e, t, n = {}) {
|
|
10
11
|
const i = n.spansBack ?? 0;
|
|
11
|
-
if (i !== 0) return
|
|
12
|
+
if (i !== 0) return Ae(e, t, i);
|
|
12
13
|
const { calendar: a, now: r } = t;
|
|
13
14
|
switch (e.kind) {
|
|
14
15
|
case "periods": {
|
|
@@ -19,15 +20,15 @@ function Ne(e, t, n = {}) {
|
|
|
19
20
|
};
|
|
20
21
|
}
|
|
21
22
|
case "rolling": {
|
|
22
|
-
const s = e.anchor === "latest_data" ? t.latestData ?? r : r, o =
|
|
23
|
+
const s = e.anchor === "latest_data" ? t.latestData ?? r : r, o = he[e.unit];
|
|
23
24
|
return {
|
|
24
25
|
start: o === void 0 ? te(s, -e.n, e.unit, a) : new Date(s.getTime() - e.n * o),
|
|
25
26
|
end: s
|
|
26
27
|
};
|
|
27
28
|
}
|
|
28
29
|
case "monthDay": {
|
|
29
|
-
const s = e.day === "first" ? $(r, "month", a) :
|
|
30
|
-
return { start: $(s, "day", a), end:
|
|
30
|
+
const s = e.day === "first" ? $(r, "month", a) : A(r, "month", a);
|
|
31
|
+
return { start: $(s, "day", a), end: A(s, "day", a) };
|
|
31
32
|
}
|
|
32
33
|
}
|
|
33
34
|
}
|
|
@@ -38,17 +39,17 @@ function ne(e, t) {
|
|
|
38
39
|
function ie(e, t, n, i) {
|
|
39
40
|
return new Date(K(e, t, n, i).endExclusive.getTime() - 1);
|
|
40
41
|
}
|
|
41
|
-
function
|
|
42
|
+
function Ae(e, t, n) {
|
|
42
43
|
if (!Number.isInteger(n) || n < 0)
|
|
43
44
|
throw new Y(`spansBack must be a whole number of spans, got ${n}.`);
|
|
44
45
|
if (e.kind !== "periods" || typeof e.anchor != "object")
|
|
45
46
|
throw new Y("spansBack applies only to a window anchored at the end of the last complete period.");
|
|
46
|
-
const { calendar: i } = t, { unit: a } = e, r =
|
|
47
|
-
if (
|
|
47
|
+
const { calendar: i } = t, { unit: a } = e, r = Se(e, t), s = -n * (e.to - e.from + 1), o = K(r.start, a, i, s).start;
|
|
48
|
+
if (A(r.end, a, i).getTime() === r.end.getTime())
|
|
48
49
|
return { start: o, end: ie(r.end, a, i, s) };
|
|
49
50
|
const d = te(ne(e, t), s, a, i), c = Math.min(
|
|
50
|
-
|
|
51
|
-
|
|
51
|
+
A(d, e.anchor.lastComplete, i).getTime(),
|
|
52
|
+
A(d, a, i).getTime()
|
|
52
53
|
);
|
|
53
54
|
return { start: o, end: new Date(c) };
|
|
54
55
|
}
|
|
@@ -60,7 +61,7 @@ function ae(e) {
|
|
|
60
61
|
])
|
|
61
62
|
);
|
|
62
63
|
}
|
|
63
|
-
function
|
|
64
|
+
function st(e) {
|
|
64
65
|
const t = e.source.connectionType ? C(e.source.connectionType) : void 0, n = e.source.dialect ? w(e.source.dialect) : void 0, i = e.source.dialect && e.source.dialect !== "unknown" ? C(e.source.dialect) : void 0;
|
|
65
66
|
if (!e.capabilities && e.source.connectionType && e.source.dialect && e.source.dialect !== "unknown" && (!t || n === "unknown" || t.dialect !== n))
|
|
66
67
|
return { kind: "incompatible_capabilities" };
|
|
@@ -96,16 +97,16 @@ function q(e) {
|
|
|
96
97
|
...n ? { tableName: n } : {}
|
|
97
98
|
};
|
|
98
99
|
}
|
|
99
|
-
function
|
|
100
|
-
if (
|
|
101
|
-
const t = e.entities.filter(oe), n =
|
|
100
|
+
function Te(e) {
|
|
101
|
+
if (Fe(e)) return { kind: "malformed" };
|
|
102
|
+
const t = e.entities.filter(oe), n = De(e), i = Ee({
|
|
102
103
|
entities: t,
|
|
103
104
|
connectionType: e.connectionType,
|
|
104
105
|
dialect: e.dialect,
|
|
105
106
|
capabilities: e.capabilities
|
|
106
107
|
});
|
|
107
108
|
if (!i) return { kind: "incompatible_capabilities" };
|
|
108
|
-
const { capabilities: a } = i, r =
|
|
109
|
+
const { capabilities: a } = i, r = Be({
|
|
109
110
|
hints: e.qualifiedHints || [],
|
|
110
111
|
coordinateHint: e.coordinateHint,
|
|
111
112
|
capabilityAuthority: i
|
|
@@ -113,7 +114,7 @@ function _e(e) {
|
|
|
113
114
|
if (r.kind !== "valid")
|
|
114
115
|
return { kind: r.kind };
|
|
115
116
|
const s = r.coordinates, o = s ? t.filter(
|
|
116
|
-
(c) =>
|
|
117
|
+
(c) => U({
|
|
117
118
|
left: se(
|
|
118
119
|
q(c),
|
|
119
120
|
a
|
|
@@ -130,7 +131,7 @@ function _e(e) {
|
|
|
130
131
|
capabilityAuthority: i
|
|
131
132
|
};
|
|
132
133
|
if (s && o.length === 1) {
|
|
133
|
-
const c = o[0], l =
|
|
134
|
+
const c = o[0], l = R(
|
|
134
135
|
i,
|
|
135
136
|
c
|
|
136
137
|
);
|
|
@@ -138,7 +139,7 @@ function _e(e) {
|
|
|
138
139
|
kind: "resolved",
|
|
139
140
|
basis: "qualified",
|
|
140
141
|
entity: c,
|
|
141
|
-
coordinates:
|
|
142
|
+
coordinates: Pe(
|
|
142
143
|
q(c),
|
|
143
144
|
s,
|
|
144
145
|
l
|
|
@@ -153,11 +154,11 @@ function _e(e) {
|
|
|
153
154
|
]);
|
|
154
155
|
if (d.size > 0) {
|
|
155
156
|
const c = o.filter((l) => {
|
|
156
|
-
const m =
|
|
157
|
-
return Array.from(d).some((
|
|
157
|
+
const m = Le(l);
|
|
158
|
+
return Array.from(d).some((b) => m.has(b));
|
|
158
159
|
});
|
|
159
160
|
if (c.length === 1) {
|
|
160
|
-
const l = c[0], m =
|
|
161
|
+
const l = c[0], m = R(
|
|
161
162
|
i,
|
|
162
163
|
l
|
|
163
164
|
);
|
|
@@ -165,7 +166,7 @@ function _e(e) {
|
|
|
165
166
|
kind: "resolved",
|
|
166
167
|
basis: "bare",
|
|
167
168
|
entity: l,
|
|
168
|
-
coordinates:
|
|
169
|
+
coordinates: B(
|
|
169
170
|
q(l),
|
|
170
171
|
m
|
|
171
172
|
),
|
|
@@ -183,7 +184,7 @@ function _e(e) {
|
|
|
183
184
|
capabilityAuthority: i
|
|
184
185
|
};
|
|
185
186
|
if (t.length === 1) {
|
|
186
|
-
const c = t[0], l =
|
|
187
|
+
const c = t[0], l = R(
|
|
187
188
|
i,
|
|
188
189
|
c
|
|
189
190
|
);
|
|
@@ -191,7 +192,7 @@ function _e(e) {
|
|
|
191
192
|
kind: "resolved",
|
|
192
193
|
basis: "unqualified",
|
|
193
194
|
entity: c,
|
|
194
|
-
coordinates:
|
|
195
|
+
coordinates: B(
|
|
195
196
|
q(c),
|
|
196
197
|
l
|
|
197
198
|
),
|
|
@@ -200,7 +201,7 @@ function _e(e) {
|
|
|
200
201
|
}
|
|
201
202
|
return { kind: "unqualified" };
|
|
202
203
|
}
|
|
203
|
-
function
|
|
204
|
+
function De(e) {
|
|
204
205
|
const t = (e.qualifiedHints || []).map(f).filter((i) => !!i);
|
|
205
206
|
return Object.values(e.coordinateHint || {}).some(
|
|
206
207
|
(i) => !!f(i)
|
|
@@ -208,21 +209,21 @@ function Se(e) {
|
|
|
208
209
|
(i) => !!f(i)
|
|
209
210
|
) ? "bare" : void 0;
|
|
210
211
|
}
|
|
211
|
-
function
|
|
212
|
+
function T(e) {
|
|
212
213
|
return `${e.dialect}:${e.prefixLevels.join(".")}`;
|
|
213
214
|
}
|
|
214
|
-
function
|
|
215
|
+
function F(e) {
|
|
215
216
|
return {
|
|
216
217
|
dialect: e.dialect,
|
|
217
218
|
prefixLevels: [...e.prefixLevels]
|
|
218
219
|
};
|
|
219
220
|
}
|
|
220
|
-
function
|
|
221
|
+
function Ee(e) {
|
|
221
222
|
var k;
|
|
222
|
-
const t = f(e.connectionType), n = f(e.dialect), i = e.capabilities ?
|
|
223
|
-
if (t && !a || n && n !== "unknown" && r === "unknown" || i && a &&
|
|
223
|
+
const t = f(e.connectionType), n = f(e.dialect), i = e.capabilities ? F(e.capabilities) : void 0, a = t ? C(t) : void 0, r = n ? w(n) : void 0, s = n && n !== "unknown" ? C(n) : void 0;
|
|
224
|
+
if (t && !a || n && n !== "unknown" && r === "unknown" || i && a && T(i) !== T(a))
|
|
224
225
|
return;
|
|
225
|
-
const o = i || (a ?
|
|
226
|
+
const o = i || (a ? F(a) : s ? F(s) : void 0);
|
|
226
227
|
if (o)
|
|
227
228
|
return r && r !== "unknown" && o.dialect !== r ? void 0 : {
|
|
228
229
|
capabilities: o,
|
|
@@ -230,41 +231,41 @@ function Te(e) {
|
|
|
230
231
|
dialect: o.dialect,
|
|
231
232
|
evidence: "explicit"
|
|
232
233
|
};
|
|
233
|
-
const d = e.entities.map((
|
|
234
|
-
const I = D(
|
|
235
|
-
if (h && !S || N && N !== "unknown" && E === "unknown" || N && N !== "unknown" && !S && !
|
|
234
|
+
const d = e.entities.map((g) => {
|
|
235
|
+
const I = D(g), h = f(I == null ? void 0 : I.connectionType), N = f(I == null ? void 0 : I.dialect), S = h ? C(h) : void 0, E = N ? w(N) : void 0, L = N && N !== "unknown" ? C(N) : void 0;
|
|
236
|
+
if (h && !S || N && N !== "unknown" && E === "unknown" || N && N !== "unknown" && !S && !L || S && E && E !== "unknown" && S.dialect !== E)
|
|
236
237
|
return;
|
|
237
|
-
const V = S ||
|
|
238
|
+
const V = S || L, P = V ? F(V) : qe(I);
|
|
238
239
|
return P ? {
|
|
239
240
|
capabilities: P,
|
|
240
241
|
connectionType: h,
|
|
241
|
-
capabilityIdentity: h ?
|
|
242
|
-
inferred: !S && !
|
|
243
|
-
signature:
|
|
242
|
+
capabilityIdentity: h ? ve(h) : void 0,
|
|
243
|
+
inferred: !S && !L,
|
|
244
|
+
signature: T(P)
|
|
244
245
|
} : void 0;
|
|
245
246
|
});
|
|
246
|
-
if (d.some((
|
|
247
|
+
if (d.some((g) => !g)) return;
|
|
247
248
|
const c = d.filter(
|
|
248
|
-
(
|
|
249
|
+
(g) => !!g
|
|
249
250
|
);
|
|
250
|
-
if (new Set(c.map((
|
|
251
|
+
if (new Set(c.map((g) => g.signature)).size > 1)
|
|
251
252
|
return;
|
|
252
253
|
const l = (k = c[0]) == null ? void 0 : k.capabilities;
|
|
253
254
|
if (!l || r && r !== "unknown" && l.dialect !== r)
|
|
254
255
|
return;
|
|
255
256
|
const m = new Set(
|
|
256
|
-
c.map((
|
|
257
|
-
),
|
|
258
|
-
(
|
|
257
|
+
c.map((g) => g.capabilityIdentity).filter((g) => !!g)
|
|
258
|
+
), b = c.every(
|
|
259
|
+
(g) => g.connectionType && g.capabilityIdentity
|
|
259
260
|
);
|
|
260
261
|
return {
|
|
261
262
|
capabilities: l,
|
|
262
|
-
...
|
|
263
|
+
...b && m.size === 1 ? { connectionType: c[0].connectionType } : {},
|
|
263
264
|
dialect: l.dialect,
|
|
264
|
-
evidence: c.every((
|
|
265
|
+
evidence: c.every((g) => g.inferred) ? "coordinates" : "entity"
|
|
265
266
|
};
|
|
266
267
|
}
|
|
267
|
-
function
|
|
268
|
+
function qe(e) {
|
|
268
269
|
const t = !!f(e == null ? void 0 : e.database), n = !!f(e == null ? void 0 : e.schema);
|
|
269
270
|
if (!(t && n)) {
|
|
270
271
|
if (n)
|
|
@@ -273,13 +274,13 @@ function Ae(e) {
|
|
|
273
274
|
return { dialect: "unknown", prefixLevels: ["database", "table"] };
|
|
274
275
|
}
|
|
275
276
|
}
|
|
276
|
-
function
|
|
277
|
+
function R(e, t) {
|
|
277
278
|
var a;
|
|
278
279
|
if (e.evidence !== "entity") return e;
|
|
279
280
|
const n = f((a = D(t)) == null ? void 0 : a.connectionType), i = n ? C(n) : void 0;
|
|
280
|
-
return i &&
|
|
281
|
+
return i && T(i) === T(e.capabilities) ? { ...e, connectionType: n } : e;
|
|
281
282
|
}
|
|
282
|
-
function
|
|
283
|
+
function Fe(e) {
|
|
283
284
|
return (e.qualifiedHints || []).some(
|
|
284
285
|
(n) => {
|
|
285
286
|
const i = f(n);
|
|
@@ -290,42 +291,42 @@ function De(e) {
|
|
|
290
291
|
return !!(i && !p(i));
|
|
291
292
|
});
|
|
292
293
|
}
|
|
293
|
-
function
|
|
294
|
+
function Be(e) {
|
|
294
295
|
const { capabilities: t } = e.capabilityAuthority, n = [], i = [];
|
|
295
296
|
for (const m of e.hints) {
|
|
296
|
-
const
|
|
297
|
-
if (!
|
|
298
|
-
if (!
|
|
299
|
-
i.push(
|
|
297
|
+
const b = f(m);
|
|
298
|
+
if (!b) continue;
|
|
299
|
+
if (!b.includes(".")) {
|
|
300
|
+
i.push(b);
|
|
300
301
|
continue;
|
|
301
302
|
}
|
|
302
|
-
const k = p(
|
|
303
|
+
const k = p(b);
|
|
303
304
|
if (!k) return { kind: "malformed" };
|
|
304
305
|
n.push(k);
|
|
305
306
|
}
|
|
306
|
-
const a =
|
|
307
|
+
const a = He(e.coordinateHint);
|
|
307
308
|
if (a.kind === "malformed") return a;
|
|
308
309
|
const r = Array.from(new Set(n)).map(
|
|
309
|
-
(m) =>
|
|
310
|
+
(m) => z({
|
|
310
311
|
qualifiedName: m,
|
|
311
312
|
capabilities: t
|
|
312
313
|
})
|
|
313
314
|
);
|
|
314
|
-
if (!
|
|
315
|
+
if (!xe(r, t))
|
|
315
316
|
return { kind: "conflicting" };
|
|
316
317
|
const s = [...new Set(n)].sort(
|
|
317
|
-
(m,
|
|
318
|
-
)[0], o = s ?
|
|
318
|
+
(m, b) => b.split(".").length - m.split(".").length
|
|
319
|
+
)[0], o = s ? z({
|
|
319
320
|
qualifiedName: s,
|
|
320
321
|
capabilities: t
|
|
321
322
|
}) : void 0, d = se(
|
|
322
323
|
a.coordinates,
|
|
323
324
|
t
|
|
324
|
-
), c =
|
|
325
|
+
), c = B(
|
|
325
326
|
a.coordinates,
|
|
326
327
|
e.capabilityAuthority
|
|
327
328
|
), l = !!(d.tableName && (d.databaseName || d.schemaName));
|
|
328
|
-
return o && l && !
|
|
329
|
+
return o && l && !U({
|
|
329
330
|
left: o,
|
|
330
331
|
right: d,
|
|
331
332
|
capabilities: t
|
|
@@ -341,7 +342,7 @@ function Ee(e) {
|
|
|
341
342
|
]
|
|
342
343
|
};
|
|
343
344
|
}
|
|
344
|
-
function
|
|
345
|
+
function He(e) {
|
|
345
346
|
const t = {};
|
|
346
347
|
for (const [n, i] of Object.entries(e || {})) {
|
|
347
348
|
const a = f(i);
|
|
@@ -359,10 +360,10 @@ function se(e, t) {
|
|
|
359
360
|
...e.tableName ? { tableName: e.tableName } : {}
|
|
360
361
|
};
|
|
361
362
|
}
|
|
362
|
-
function
|
|
363
|
+
function xe(e, t) {
|
|
363
364
|
return e.every(
|
|
364
365
|
(n, i) => e.slice(i + 1).every(
|
|
365
|
-
(a) =>
|
|
366
|
+
(a) => U({
|
|
366
367
|
left: n,
|
|
367
368
|
right: a,
|
|
368
369
|
capabilities: t
|
|
@@ -375,7 +376,7 @@ function re(e) {
|
|
|
375
376
|
e.map(f).map(p).filter((t) => !!t)
|
|
376
377
|
);
|
|
377
378
|
}
|
|
378
|
-
function
|
|
379
|
+
function Le(e) {
|
|
379
380
|
const t = D(e);
|
|
380
381
|
return t ? re([
|
|
381
382
|
f(t.name),
|
|
@@ -383,8 +384,8 @@ function Fe(e) {
|
|
|
383
384
|
f(t.id)
|
|
384
385
|
]) : /* @__PURE__ */ new Set();
|
|
385
386
|
}
|
|
386
|
-
function
|
|
387
|
-
return
|
|
387
|
+
function Pe(e, t, n) {
|
|
388
|
+
return B(
|
|
388
389
|
{
|
|
389
390
|
...e,
|
|
390
391
|
...t
|
|
@@ -392,7 +393,7 @@ function He(e, t, n) {
|
|
|
392
393
|
n
|
|
393
394
|
);
|
|
394
395
|
}
|
|
395
|
-
function
|
|
396
|
+
function B(e, t) {
|
|
396
397
|
const n = t.evidence === "coordinates" ? t.capabilities.prefixLevels : ae(t.capabilities);
|
|
397
398
|
return {
|
|
398
399
|
...n.includes("database") && e.databaseName ? { databaseName: e.databaseName } : {},
|
|
@@ -406,7 +407,7 @@ function u(e) {
|
|
|
406
407
|
function _(e) {
|
|
407
408
|
return e && typeof e == "object" && !Array.isArray(e) ? e : void 0;
|
|
408
409
|
}
|
|
409
|
-
function
|
|
410
|
+
function Re(e) {
|
|
410
411
|
const t = _(e);
|
|
411
412
|
return !!(t && t.type === "dataset" && u(t.name));
|
|
412
413
|
}
|
|
@@ -433,10 +434,10 @@ function H(e) {
|
|
|
433
434
|
const t = u(e);
|
|
434
435
|
return t ? (n = p(t)) == null ? void 0 : n.toLowerCase() : void 0;
|
|
435
436
|
}
|
|
436
|
-
function
|
|
437
|
+
function j(e, t) {
|
|
437
438
|
const n = _(t), i = u(n == null ? void 0 : n.domainId) || u(e.semanticDomainId), a = u(n == null ? void 0 : n.name);
|
|
438
439
|
if (!i || !a) return;
|
|
439
|
-
const r = (n == null ? void 0 : n.datasetType) === "physical" ? void 0 :
|
|
440
|
+
const r = (n == null ? void 0 : n.datasetType) === "physical" ? void 0 : ke(n || {}), s = u(n == null ? void 0 : n.connectionId) || u(e.connectionId);
|
|
440
441
|
return {
|
|
441
442
|
kind: "semantic",
|
|
442
443
|
domainId: i,
|
|
@@ -445,12 +446,12 @@ function R(e, t) {
|
|
|
445
446
|
...s ? { connectionId: s } : {}
|
|
446
447
|
};
|
|
447
448
|
}
|
|
448
|
-
function
|
|
449
|
+
function je(e, t = {}) {
|
|
449
450
|
const n = u(e.fieldEntityType);
|
|
450
451
|
if (n && n !== "dataset")
|
|
451
452
|
return { kind: "unqualified" };
|
|
452
453
|
const i = e.entities.filter(
|
|
453
|
-
(s) => t.includePhysicalDatasets ?
|
|
454
|
+
(s) => t.includePhysicalDatasets ? Re(s) : ce(s)
|
|
454
455
|
), a = u(e.entityId);
|
|
455
456
|
if (a) {
|
|
456
457
|
const s = H(a), o = i.filter((d) => {
|
|
@@ -459,7 +460,7 @@ function xe(e, t = {}) {
|
|
|
459
460
|
});
|
|
460
461
|
if (o.length > 1) return { kind: "ambiguous", basis: "bare" };
|
|
461
462
|
if (o.length === 1) {
|
|
462
|
-
const d =
|
|
463
|
+
const d = j(e, o[0]);
|
|
463
464
|
return d ? {
|
|
464
465
|
kind: "resolved",
|
|
465
466
|
basis: "bare",
|
|
@@ -481,7 +482,7 @@ function xe(e, t = {}) {
|
|
|
481
482
|
});
|
|
482
483
|
if (s.length > 1) return { kind: "ambiguous", basis: "bare" };
|
|
483
484
|
if (s.length === 1) {
|
|
484
|
-
const o =
|
|
485
|
+
const o = j(e, s[0]);
|
|
485
486
|
return o ? {
|
|
486
487
|
kind: "resolved",
|
|
487
488
|
basis: "bare",
|
|
@@ -493,7 +494,7 @@ function xe(e, t = {}) {
|
|
|
493
494
|
return { kind: "not_found", basis: "bare" };
|
|
494
495
|
}
|
|
495
496
|
if (i.length === 1) {
|
|
496
|
-
const s =
|
|
497
|
+
const s = j(e, i[0]);
|
|
497
498
|
return s ? {
|
|
498
499
|
kind: "resolved",
|
|
499
500
|
basis: "unqualified",
|
|
@@ -504,7 +505,7 @@ function xe(e, t = {}) {
|
|
|
504
505
|
}
|
|
505
506
|
return { kind: "unqualified" };
|
|
506
507
|
}
|
|
507
|
-
function
|
|
508
|
+
function M(e) {
|
|
508
509
|
const t = e.resolution.kind === "resolved" ? _(e.resolution.entity) : void 0, n = u(e.connectionId) || u(t == null ? void 0 : t.connectionId), { connectionType: i, dialect: a } = e.resolution.capabilityAuthority, r = C(a), s = !!(r && r.dialect === e.resolution.capabilityAuthority.capabilities.dialect && r.prefixLevels.join(".") === e.resolution.capabilityAuthority.capabilities.prefixLevels.join(
|
|
509
510
|
"."
|
|
510
511
|
)), o = e.resolution.coordinates;
|
|
@@ -519,7 +520,7 @@ function O(e) {
|
|
|
519
520
|
...o.schemaName ? { schemaName: o.schemaName } : {}
|
|
520
521
|
};
|
|
521
522
|
}
|
|
522
|
-
function
|
|
523
|
+
function Me(e) {
|
|
523
524
|
if (!e.coordinates.tableName) return !1;
|
|
524
525
|
const t = _(e.entity), n = H(t == null ? void 0 : t.id), i = e.qualifiedHints.map(u).filter((l) => !!(l != null && l.includes(".")));
|
|
525
526
|
if (n && i.length > 0 && i.every((l) => H(l) === n))
|
|
@@ -535,20 +536,20 @@ function Pe(e) {
|
|
|
535
536
|
...s ? { schemaName: s } : {},
|
|
536
537
|
tableName: a
|
|
537
538
|
};
|
|
538
|
-
return
|
|
539
|
+
return X({
|
|
539
540
|
requested: e.coordinates,
|
|
540
541
|
allowed: d,
|
|
541
542
|
capabilities: o
|
|
542
|
-
}) ? !0 : r && !o.prefixLevels.includes("database") || s && !o.prefixLevels.includes("schema") ?
|
|
543
|
+
}) ? !0 : r && !o.prefixLevels.includes("database") || s && !o.prefixLevels.includes("schema") ? X({
|
|
543
544
|
requested: e.coordinates,
|
|
544
|
-
allowed:
|
|
545
|
+
allowed: z({
|
|
545
546
|
qualifiedName: [r, s, a].filter(Boolean).join("."),
|
|
546
547
|
capabilities: o
|
|
547
548
|
}),
|
|
548
549
|
capabilities: o
|
|
549
550
|
}) : !1;
|
|
550
551
|
}
|
|
551
|
-
function
|
|
552
|
+
function Oe(e) {
|
|
552
553
|
var a, r, s;
|
|
553
554
|
if (u(e.connectionType) || u(e.dialect) || e.capabilities || u(e.semanticDomainId) || u(e.fieldEntityType) === "dataset" || u((a = e.fallbackCoordinateHint) == null ? void 0 : a.databaseName) || u((r = e.fallbackCoordinateHint) == null ? void 0 : r.schemaName))
|
|
554
555
|
return;
|
|
@@ -564,17 +565,17 @@ function je(e) {
|
|
|
564
565
|
const n = t.map(p);
|
|
565
566
|
return n.some((o) => !o) ? void 0 : new Set(n.map((o) => o.toLowerCase())).size === 1 ? n[0] : void 0;
|
|
566
567
|
}
|
|
567
|
-
function
|
|
568
|
+
function rt(e) {
|
|
568
569
|
const t = e.entities.filter(
|
|
569
570
|
oe
|
|
570
571
|
), n = e.entities.filter(
|
|
571
572
|
ce
|
|
572
|
-
), i = t.length > 0 || n.length > 0, a =
|
|
573
|
+
), i = t.length > 0 || n.length > 0, a = je(e), r = e.qualifiedHints || [], s = r.some(
|
|
573
574
|
(c) => {
|
|
574
575
|
var l;
|
|
575
576
|
return (l = u(c)) == null ? void 0 : l.includes(".");
|
|
576
577
|
}
|
|
577
|
-
), o =
|
|
578
|
+
), o = Te({
|
|
578
579
|
entities: t,
|
|
579
580
|
connectionType: u(e.connectionType),
|
|
580
581
|
dialect: e.dialect,
|
|
@@ -586,7 +587,7 @@ function nt(e) {
|
|
|
586
587
|
if (o.kind === "malformed" || o.kind === "conflicting" || o.kind === "incompatible_capabilities" && s || o.kind === "ambiguous" && o.basis === "qualified")
|
|
587
588
|
return o;
|
|
588
589
|
if (o.kind === "resolved" && o.basis === "qualified") {
|
|
589
|
-
const c =
|
|
590
|
+
const c = M({
|
|
590
591
|
resolution: o,
|
|
591
592
|
connectionId: e.connectionId
|
|
592
593
|
});
|
|
@@ -598,7 +599,7 @@ function nt(e) {
|
|
|
598
599
|
} : { kind: "missing_connection" };
|
|
599
600
|
}
|
|
600
601
|
if (o.kind === "not_found" && o.basis === "qualified" && o.coordinates) {
|
|
601
|
-
if (a.kind === "resolved" && a.matchedById &&
|
|
602
|
+
if (a.kind === "resolved" && a.matchedById && Me({
|
|
602
603
|
entity: a.entity,
|
|
603
604
|
coordinates: o.coordinates,
|
|
604
605
|
capabilityAuthority: o.capabilityAuthority,
|
|
@@ -610,7 +611,7 @@ function nt(e) {
|
|
|
610
611
|
source: a.source,
|
|
611
612
|
entity: a.entity
|
|
612
613
|
};
|
|
613
|
-
const c =
|
|
614
|
+
const c = M({
|
|
614
615
|
resolution: o,
|
|
615
616
|
connectionId: e.connectionId
|
|
616
617
|
});
|
|
@@ -625,7 +626,7 @@ function nt(e) {
|
|
|
625
626
|
};
|
|
626
627
|
if (a.kind === "ambiguous") return a;
|
|
627
628
|
if (o.kind === "resolved") {
|
|
628
|
-
const c =
|
|
629
|
+
const c = M({
|
|
629
630
|
resolution: o,
|
|
630
631
|
connectionId: e.connectionId
|
|
631
632
|
});
|
|
@@ -649,7 +650,7 @@ function nt(e) {
|
|
|
649
650
|
}
|
|
650
651
|
};
|
|
651
652
|
if (o.kind === "incompatible_capabilities") {
|
|
652
|
-
const c = i ? void 0 :
|
|
653
|
+
const c = i ? void 0 : Oe(e), l = u(e.connectionId);
|
|
653
654
|
return c && l ? {
|
|
654
655
|
kind: "resolved",
|
|
655
656
|
basis: "historical",
|
|
@@ -662,17 +663,17 @@ function nt(e) {
|
|
|
662
663
|
} : { kind: "unqualified" };
|
|
663
664
|
}
|
|
664
665
|
const le = "click-reach:";
|
|
665
|
-
function
|
|
666
|
+
function ct(e, t) {
|
|
666
667
|
const n = t.source.kind === "semantic" ? t.source.datasetName : t.source.tableName;
|
|
667
668
|
return `${le}${e}:${n}.${t.name}`;
|
|
668
669
|
}
|
|
669
|
-
function
|
|
670
|
+
function lt(e) {
|
|
670
671
|
return typeof e == "string" && e.startsWith(le);
|
|
671
672
|
}
|
|
672
|
-
function
|
|
673
|
-
return
|
|
673
|
+
function $e(e, t) {
|
|
674
|
+
return Ce({ ...e, role: t });
|
|
674
675
|
}
|
|
675
|
-
function
|
|
676
|
+
function dt(e, t) {
|
|
676
677
|
if (t.id) {
|
|
677
678
|
const n = [];
|
|
678
679
|
e.forEach(
|
|
@@ -681,7 +682,7 @@ function ot(e, t) {
|
|
|
681
682
|
})
|
|
682
683
|
);
|
|
683
684
|
const i = t.alias ? n.find(
|
|
684
|
-
({ group: a, index: r }) =>
|
|
685
|
+
({ group: a, index: r }) => $e(e[a].fields[r], e[a].role) === t.alias
|
|
685
686
|
) : void 0;
|
|
686
687
|
if (i) return i;
|
|
687
688
|
if (n.length === 1) return n[0];
|
|
@@ -700,7 +701,7 @@ function de(e, t) {
|
|
|
700
701
|
const [a, r] = n.length <= i.length ? [n, i] : [i, n], s = r.length - a.length;
|
|
701
702
|
return a.every((o, d) => o === r[d + s]);
|
|
702
703
|
}
|
|
703
|
-
function
|
|
704
|
+
function we(e, t) {
|
|
704
705
|
const n = e.split("."), i = t.split("."), a = n.pop(), r = i.pop();
|
|
705
706
|
return !!(a && a === r && n.length > 0 && i.length > 0 && de(
|
|
706
707
|
n.join("."),
|
|
@@ -731,27 +732,27 @@ function W(e) {
|
|
|
731
732
|
const t = e.split(".").map((n) => n.trim());
|
|
732
733
|
return t.length > 0 && t.every(Boolean) ? t.join(".") : "";
|
|
733
734
|
}
|
|
734
|
-
function
|
|
735
|
+
function y(e) {
|
|
735
736
|
return typeof e == "string" ? e.trim() : "";
|
|
736
737
|
}
|
|
737
|
-
function
|
|
738
|
+
function Qe(e, t) {
|
|
738
739
|
return e.every(
|
|
739
740
|
(n, i) => e.slice(i + 1).every((a) => t(n, a))
|
|
740
741
|
);
|
|
741
742
|
}
|
|
742
|
-
function
|
|
743
|
-
const n =
|
|
743
|
+
function We(e, t) {
|
|
744
|
+
const n = y(e.id), i = y(e.name), a = y(t.entityId), r = y(t.entityName);
|
|
744
745
|
return !i || !a && !r ? !1 : (!a || a === n || a === i) && (!r || r === i);
|
|
745
746
|
}
|
|
746
|
-
function
|
|
747
|
-
const t = v(e.semanticContext) ? e.semanticContext : void 0, n = v(e.fieldMeta) ? e.fieldMeta : void 0, i =
|
|
747
|
+
function Ke(e) {
|
|
748
|
+
const t = v(e.semanticContext) ? e.semanticContext : void 0, n = v(e.fieldMeta) ? e.fieldMeta : void 0, i = y(t == null ? void 0 : t.semanticDomainId), a = Array.isArray(t == null ? void 0 : t.selectedEntities) ? t.selectedEntities.filter(
|
|
748
749
|
(h) => v(h) && h.type === "dataset"
|
|
749
750
|
) : [];
|
|
750
751
|
if (!!!(i || a.length > 0 || (n == null ? void 0 : n.entityType) === "dataset")) return;
|
|
751
752
|
if (!i)
|
|
752
753
|
return { status: "unresolved", reason: "incomplete_source_identity" };
|
|
753
|
-
const s =
|
|
754
|
-
(h) =>
|
|
754
|
+
const s = y(n == null ? void 0 : n.entityId), o = y(n == null ? void 0 : n.entityName), d = !!(s || o), c = d ? a.filter(
|
|
755
|
+
(h) => We(h, {
|
|
755
756
|
entityId: s,
|
|
756
757
|
entityName: o
|
|
757
758
|
})
|
|
@@ -760,22 +761,22 @@ function Me(e) {
|
|
|
760
761
|
return { status: "unresolved", reason: "incomplete_source_identity" };
|
|
761
762
|
if (d && a.length > 0 && c.length === 0)
|
|
762
763
|
return { status: "unresolved", reason: "divergent_source_identity" };
|
|
763
|
-
const l = c[0], m =
|
|
764
|
+
const l = c[0], m = y(l == null ? void 0 : l.domainId), b = y(l == null ? void 0 : l.id), k = y(l == null ? void 0 : l.name);
|
|
764
765
|
if (m && m !== i)
|
|
765
766
|
return { status: "unresolved", reason: "divergent_source_identity" };
|
|
766
|
-
const
|
|
767
|
+
const g = b, I = k || o;
|
|
767
768
|
return I ? {
|
|
768
769
|
status: "resolved",
|
|
769
770
|
source: {
|
|
770
771
|
kind: "semantic",
|
|
771
772
|
domainId: i,
|
|
772
773
|
datasetName: I,
|
|
773
|
-
...
|
|
774
|
+
...g ? { datasetId: g } : {}
|
|
774
775
|
}
|
|
775
776
|
} : { status: "unresolved", reason: "incomplete_source_identity" };
|
|
776
777
|
}
|
|
777
|
-
function
|
|
778
|
-
const n =
|
|
778
|
+
function Ue(e, t) {
|
|
779
|
+
const n = y(e.connectionId), i = v(e.semanticContext) ? e.semanticContext : void 0, a = y(i == null ? void 0 : i.connectionId);
|
|
779
780
|
if (n && a && n !== a)
|
|
780
781
|
return { status: "unresolved", reason: "divergent_source_identity" };
|
|
781
782
|
const r = n || a, s = v(e.fieldMeta) ? e.fieldMeta : void 0, o = t.split(".").slice(0, -1).join("."), d = W(e.qualifiedTableName), c = W(
|
|
@@ -790,7 +791,7 @@ function Qe(e, t) {
|
|
|
790
791
|
source: { kind: "physical", connectionId: r, tableName: m }
|
|
791
792
|
};
|
|
792
793
|
}
|
|
793
|
-
function
|
|
794
|
+
function Ge(e, t) {
|
|
794
795
|
const n = v(e.fieldMeta) ? e.fieldMeta : void 0, i = typeof (n == null ? void 0 : n.qualifiedFieldName) == "string" ? n.qualifiedFieldName.trim() : "", a = ee(
|
|
795
796
|
n == null ? void 0 : n.qualifiedFieldName
|
|
796
797
|
), r = typeof e.column == "string" ? e.column.trim() : "", s = ee(r), o = typeof e.qualifiedTableName == "string" ? e.qualifiedTableName.trim() : "", d = W(
|
|
@@ -798,20 +799,20 @@ function We(e, t) {
|
|
|
798
799
|
);
|
|
799
800
|
if (i && !a || t && o && !d || r.includes(".") && !s)
|
|
800
801
|
return { status: "unresolved", reason: "incomplete_field_identity" };
|
|
801
|
-
const c = s.split("."), l = s ? c[c.length - 1] : r, m = t && d && l ? `${d}.${l}` : "",
|
|
802
|
+
const c = s.split("."), l = s ? c[c.length - 1] : r, m = t && d && l ? `${d}.${l}` : "", b = [
|
|
802
803
|
a,
|
|
803
804
|
s,
|
|
804
805
|
m
|
|
805
806
|
].filter(Boolean);
|
|
806
|
-
if (
|
|
807
|
-
|
|
808
|
-
|
|
807
|
+
if (!Qe(
|
|
808
|
+
b,
|
|
809
|
+
we
|
|
809
810
|
))
|
|
810
811
|
return { status: "unresolved", reason: "divergent_field_identity" };
|
|
811
812
|
const k = s || a || m;
|
|
812
813
|
return k ? { status: "resolved", qualifiedFieldName: k } : { status: "unresolved", reason: "incomplete_field_identity" };
|
|
813
814
|
}
|
|
814
|
-
function
|
|
815
|
+
function Ve(e) {
|
|
815
816
|
if (!v(e))
|
|
816
817
|
return { status: "ineligible", reason: "invalid_input" };
|
|
817
818
|
if (e.kind === "global-date")
|
|
@@ -828,10 +829,10 @@ function Ke(e) {
|
|
|
828
829
|
return { status: "ineligible", reason: "custom_filter" };
|
|
829
830
|
if (e.targetColumns !== void 0 && (!Array.isArray(e.targetColumns) || e.targetColumns.length > 0))
|
|
830
831
|
return { status: "ineligible", reason: "multi_target_filter" };
|
|
831
|
-
const a =
|
|
832
|
+
const a = Ke(e), r = Ge(e, a === void 0);
|
|
832
833
|
if (r.status === "unresolved")
|
|
833
834
|
return { status: "ineligible", reason: r.reason };
|
|
834
|
-
const s = a ||
|
|
835
|
+
const s = a || Ue(e, r.qualifiedFieldName);
|
|
835
836
|
return s.status === "resolved" ? {
|
|
836
837
|
status: "eligible",
|
|
837
838
|
kind: "field_date",
|
|
@@ -839,91 +840,114 @@ function Ke(e) {
|
|
|
839
840
|
source: s.source
|
|
840
841
|
} : { status: "ineligible", reason: s.reason };
|
|
841
842
|
}
|
|
842
|
-
function
|
|
843
|
+
function Xe(e) {
|
|
843
844
|
if (!v(e) || e.kind !== "filter" || !v(e.filter))
|
|
844
845
|
return { status: "ineligible", reason: "invalid_input" };
|
|
845
|
-
const t =
|
|
846
|
+
const t = Ve(
|
|
846
847
|
e.filter
|
|
847
848
|
);
|
|
848
849
|
return t.status === "ineligible" ? t : t.kind === "field_date" && v(e.compatibility) && e.compatibility.source === "cardInlineFilter" ? { status: "ineligible", reason: "card_inline_filter" } : t;
|
|
849
850
|
}
|
|
850
|
-
function
|
|
851
|
-
return
|
|
851
|
+
function ut(e) {
|
|
852
|
+
return Xe(e).status === "eligible";
|
|
852
853
|
}
|
|
853
|
-
function
|
|
854
|
+
function ft(e) {
|
|
854
855
|
return `compat-filter:${e}`;
|
|
855
856
|
}
|
|
856
|
-
function
|
|
857
|
+
function mt(e) {
|
|
857
858
|
return `compat-control:${e}`;
|
|
858
859
|
}
|
|
859
|
-
function
|
|
860
|
+
function gt(e, t) {
|
|
860
861
|
return `compat-inline-filter:${e}:${t}`;
|
|
861
862
|
}
|
|
862
|
-
function
|
|
863
|
+
function bt(e, t) {
|
|
863
864
|
return `compat-card-control:${e}:${t}`;
|
|
864
865
|
}
|
|
865
|
-
function
|
|
866
|
+
function Je(e) {
|
|
867
|
+
var i;
|
|
868
|
+
if (!e) return !1;
|
|
869
|
+
if (typeof e.aggregate == "string" || e.isPreAggregated) return !0;
|
|
870
|
+
const t = typeof e.expression == "string" ? e.expression : "";
|
|
871
|
+
if (!t) return !1;
|
|
872
|
+
if (_e(t).calls.length > 0) return !0;
|
|
873
|
+
const n = (i = e.calculatedFormula) == null ? void 0 : i.inputFields;
|
|
874
|
+
return Array.isArray(n) && n.some((a) => {
|
|
875
|
+
const r = String((a == null ? void 0 : a.role) || "").toLowerCase(), s = String((a == null ? void 0 : a.aggregate) || "").trim();
|
|
876
|
+
return r === "metric" && s.length > 0;
|
|
877
|
+
});
|
|
878
|
+
}
|
|
879
|
+
function yt(e) {
|
|
880
|
+
return !!((e == null ? void 0 : e.role) === "metric" && (Ie(e) || Je(e)));
|
|
881
|
+
}
|
|
882
|
+
const ue = "col:";
|
|
883
|
+
function ht(e) {
|
|
884
|
+
return `${ue}${e}`;
|
|
885
|
+
}
|
|
886
|
+
function pt(e) {
|
|
887
|
+
return typeof e == "string" && e.startsWith(ue);
|
|
888
|
+
}
|
|
889
|
+
function fe(e, t) {
|
|
866
890
|
if (e) return e;
|
|
867
891
|
const n = t === void 0 ? "unknown" : Q(t);
|
|
868
892
|
return n === "number" || n === "unknown" ? "SUM" : "COUNT";
|
|
869
893
|
}
|
|
870
|
-
function
|
|
871
|
-
const t = e.aggregate ===
|
|
894
|
+
function Ye(e) {
|
|
895
|
+
const t = e.aggregate === fe(e.semanticAggregate, e.dataType);
|
|
872
896
|
return {
|
|
873
897
|
effectiveAggregate: e.aggregate,
|
|
874
898
|
aggregateSource: t ? e.semanticAggregate ? "semantic_model" : "default_sum" : "caller_override"
|
|
875
899
|
};
|
|
876
900
|
}
|
|
877
|
-
function
|
|
901
|
+
function Ze(e, t, n) {
|
|
878
902
|
const i = e.effectiveAggregate !== void 0 || e.aggregateSource !== void 0;
|
|
879
903
|
return {
|
|
880
904
|
aggregate: t,
|
|
881
905
|
aggregateOrigin: n,
|
|
882
|
-
...i ?
|
|
906
|
+
...i ? Ye({ aggregate: t, semanticAggregate: e.semanticAggregate, dataType: e.dataType }) : {}
|
|
883
907
|
};
|
|
884
908
|
}
|
|
885
|
-
function
|
|
886
|
-
return { ...e, ...
|
|
909
|
+
function vt(e, t, n) {
|
|
910
|
+
return { ...e, ...Ze(e, t, n) };
|
|
887
911
|
}
|
|
888
|
-
function
|
|
912
|
+
function kt(e) {
|
|
889
913
|
return e.aggregate ?? e.effectiveAggregate;
|
|
890
914
|
}
|
|
891
|
-
function
|
|
915
|
+
function It(e) {
|
|
892
916
|
if (!e.aggregate) return !1;
|
|
893
917
|
if (e.aggregateOrigin === "explicit" || e.aggregateSource === "caller_override") return !0;
|
|
894
918
|
if (e.aggregateSource) {
|
|
895
|
-
const t = e.aggregateSource === "default_sum" ?
|
|
919
|
+
const t = e.aggregateSource === "default_sum" ? fe(void 0, e.dataType) : e.semanticAggregate ?? e.effectiveAggregate;
|
|
896
920
|
return t !== void 0 && e.aggregate !== t;
|
|
897
921
|
}
|
|
898
922
|
return e.aggregateOrigin !== "default";
|
|
899
923
|
}
|
|
900
|
-
const
|
|
901
|
-
function
|
|
924
|
+
const Nt = ["label", "labelOrigin", "derivedLabel"];
|
|
925
|
+
function Ct(e) {
|
|
902
926
|
return { label: e, labelOrigin: "override", derivedLabel: void 0 };
|
|
903
927
|
}
|
|
904
|
-
function
|
|
928
|
+
function _t(e, t) {
|
|
905
929
|
const { derivedLabel: n, ...i } = e;
|
|
906
930
|
return { ...i, label: t, labelOrigin: "override" };
|
|
907
931
|
}
|
|
908
|
-
function
|
|
932
|
+
function St(e, t) {
|
|
909
933
|
return e.labelOrigin === "override" ? {} : { label: t, labelOrigin: "semantic" };
|
|
910
934
|
}
|
|
911
|
-
function
|
|
935
|
+
function At(e) {
|
|
912
936
|
if (e.groupedDate !== void 0) return { target: e.groupedDate, direction: "asc" };
|
|
913
937
|
if (!(!e.grouped || e.measures.length === 0))
|
|
914
938
|
return { target: e.primaryMeasure ?? e.measures[0], direction: "desc" };
|
|
915
939
|
}
|
|
916
|
-
const
|
|
940
|
+
const Tt = /* @__PURE__ */ new Set([
|
|
917
941
|
"contains",
|
|
918
942
|
"startsWith",
|
|
919
943
|
"endsWith",
|
|
920
944
|
"like",
|
|
921
945
|
"not like"
|
|
922
946
|
]);
|
|
923
|
-
function
|
|
947
|
+
function me(e) {
|
|
924
948
|
return e.includes("%") || e.includes("_");
|
|
925
949
|
}
|
|
926
|
-
function
|
|
950
|
+
function et(e, t) {
|
|
927
951
|
switch (e) {
|
|
928
952
|
case "contains":
|
|
929
953
|
return { pattern: `%${t}%`, negate: !1 };
|
|
@@ -937,35 +961,35 @@ function Je(e, t) {
|
|
|
937
961
|
return { pattern: t, negate: !0 };
|
|
938
962
|
}
|
|
939
963
|
}
|
|
940
|
-
function
|
|
941
|
-
return
|
|
964
|
+
function tt(e) {
|
|
965
|
+
return me(e) ? e : `%${e}%`;
|
|
942
966
|
}
|
|
943
|
-
function
|
|
944
|
-
const { pattern: n, negate: i } =
|
|
945
|
-
if (
|
|
967
|
+
function Dt(e, t) {
|
|
968
|
+
const { pattern: n, negate: i } = et(e, t), a = n.length > 2 && n.startsWith("%") && n.endsWith("%") ? n.slice(1, -1) : void 0, r = a !== void 0 && !me(a) ? a : n;
|
|
969
|
+
if (tt(r) === n)
|
|
946
970
|
return { operator: i ? "not_contains" : "contains", value: r };
|
|
947
971
|
}
|
|
948
|
-
function
|
|
972
|
+
function Et(e) {
|
|
949
973
|
const { operation: t, values: n, temporalPrecision: i } = e;
|
|
950
974
|
if (t !== "=" && t !== "!=" || i === "minute")
|
|
951
975
|
return null;
|
|
952
976
|
const a = Array.isArray(n) ? n : [n];
|
|
953
977
|
if (a.length !== 1 || typeof a[0] != "string") return null;
|
|
954
978
|
const r = a[0].trim();
|
|
955
|
-
return
|
|
979
|
+
return pe(r) ? { operation: t, day: r } : null;
|
|
956
980
|
}
|
|
957
|
-
function
|
|
981
|
+
function ge(e) {
|
|
958
982
|
const { label: t, ...n } = e;
|
|
959
983
|
return {
|
|
960
|
-
dataset:
|
|
984
|
+
dataset: Ne(n),
|
|
961
985
|
...e.kind === "physical" ? { dialect: e.dialect, connectionType: e.connectionType } : {}
|
|
962
986
|
};
|
|
963
987
|
}
|
|
964
988
|
function be(e) {
|
|
965
989
|
const { label: t, source: n, ...i } = e;
|
|
966
|
-
return { ...i, source: n &&
|
|
990
|
+
return { ...i, source: n && ge(n) };
|
|
967
991
|
}
|
|
968
|
-
function
|
|
992
|
+
function G(e) {
|
|
969
993
|
const {
|
|
970
994
|
label: t,
|
|
971
995
|
format: n,
|
|
@@ -984,14 +1008,14 @@ function U(e) {
|
|
|
984
1008
|
)
|
|
985
1009
|
};
|
|
986
1010
|
}
|
|
987
|
-
function
|
|
1011
|
+
function O(e) {
|
|
988
1012
|
const { derivedField: t, ...n } = e;
|
|
989
1013
|
return {
|
|
990
1014
|
...be(n),
|
|
991
|
-
derivedField: t &&
|
|
1015
|
+
derivedField: t && G(t)
|
|
992
1016
|
};
|
|
993
1017
|
}
|
|
994
|
-
function
|
|
1018
|
+
function x(e) {
|
|
995
1019
|
const {
|
|
996
1020
|
label: t,
|
|
997
1021
|
format: n,
|
|
@@ -1006,10 +1030,10 @@ function L(e) {
|
|
|
1006
1030
|
semanticTemporalPresentation: a && {
|
|
1007
1031
|
granularity: a.granularity
|
|
1008
1032
|
},
|
|
1009
|
-
derivedField: r &&
|
|
1033
|
+
derivedField: r && G(r),
|
|
1010
1034
|
calculatedFormula: s && {
|
|
1011
1035
|
...s,
|
|
1012
|
-
inputFields: s.inputFields.map(
|
|
1036
|
+
inputFields: s.inputFields.map(x)
|
|
1013
1037
|
}
|
|
1014
1038
|
};
|
|
1015
1039
|
}
|
|
@@ -1019,28 +1043,28 @@ function ye(e) {
|
|
|
1019
1043
|
conditions: e.conditions.map(
|
|
1020
1044
|
({ label: t, field: n, ...i }) => ({
|
|
1021
1045
|
...i,
|
|
1022
|
-
field:
|
|
1046
|
+
field: x(n)
|
|
1023
1047
|
})
|
|
1024
1048
|
),
|
|
1025
1049
|
groups: e.groups.map(ye)
|
|
1026
1050
|
};
|
|
1027
1051
|
}
|
|
1028
|
-
function
|
|
1052
|
+
function qt(e) {
|
|
1029
1053
|
return {
|
|
1030
1054
|
...e,
|
|
1031
|
-
source:
|
|
1055
|
+
source: ge(e.source),
|
|
1032
1056
|
rows: e.rows.map((t) => ({
|
|
1033
1057
|
...t,
|
|
1034
|
-
field:
|
|
1058
|
+
field: O(t.field)
|
|
1035
1059
|
})),
|
|
1036
1060
|
columns: e.columns.map((t) => ({
|
|
1037
1061
|
...t,
|
|
1038
|
-
field:
|
|
1062
|
+
field: O(t.field)
|
|
1039
1063
|
})),
|
|
1040
1064
|
measures: e.measures.map(
|
|
1041
|
-
(t) => t.kind === "aggregate" ? { ...t, field:
|
|
1065
|
+
(t) => t.kind === "aggregate" ? { ...t, field: O(t.field) } : {
|
|
1042
1066
|
...t,
|
|
1043
|
-
definition:
|
|
1067
|
+
definition: G(t.definition)
|
|
1044
1068
|
}
|
|
1045
1069
|
),
|
|
1046
1070
|
filters: e.filters && ye(e.filters),
|
|
@@ -1053,61 +1077,65 @@ function Nt(e) {
|
|
|
1053
1077
|
...n,
|
|
1054
1078
|
keys: n.keys.map((i) => ({
|
|
1055
1079
|
...i,
|
|
1056
|
-
source:
|
|
1057
|
-
target:
|
|
1080
|
+
source: x(i.source),
|
|
1081
|
+
target: x(i.target)
|
|
1058
1082
|
}))
|
|
1059
1083
|
}))
|
|
1060
1084
|
}))
|
|
1061
1085
|
},
|
|
1062
1086
|
// Sort scopes are keyed overrides, unlike ordered axes/calculation inputs.
|
|
1063
1087
|
sorts: [...e.sorts].sort((t, n) => {
|
|
1064
|
-
const i =
|
|
1088
|
+
const i = J(t), a = J(n);
|
|
1065
1089
|
return i < a ? -1 : i > a ? 1 : 0;
|
|
1066
1090
|
})
|
|
1067
1091
|
};
|
|
1068
1092
|
}
|
|
1069
1093
|
export {
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1094
|
+
Se as A,
|
|
1095
|
+
fe as B,
|
|
1096
|
+
Ye as C,
|
|
1097
|
+
vt as D,
|
|
1098
|
+
kt as E,
|
|
1099
|
+
It as F,
|
|
1100
|
+
Nt as G,
|
|
1101
|
+
Ct as H,
|
|
1102
|
+
_t as I,
|
|
1103
|
+
At as J,
|
|
1104
|
+
me as K,
|
|
1105
|
+
et as L,
|
|
1106
|
+
tt as M,
|
|
1107
|
+
Dt as N,
|
|
1108
|
+
Et as O,
|
|
1109
|
+
de as P,
|
|
1110
|
+
ze as Q,
|
|
1085
1111
|
Y as R,
|
|
1086
|
-
|
|
1087
|
-
|
|
1112
|
+
Tt as S,
|
|
1113
|
+
G as T,
|
|
1114
|
+
we as U,
|
|
1115
|
+
qt as a,
|
|
1088
1116
|
ae as b,
|
|
1089
1117
|
oe as c,
|
|
1090
|
-
|
|
1118
|
+
Te as d,
|
|
1091
1119
|
ce as e,
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1120
|
+
je as f,
|
|
1121
|
+
St as g,
|
|
1122
|
+
rt as h,
|
|
1123
|
+
lt as i,
|
|
1124
|
+
ct as j,
|
|
1125
|
+
dt as k,
|
|
1126
|
+
We as l,
|
|
1127
|
+
Ze as m,
|
|
1128
|
+
Ve as n,
|
|
1129
|
+
Xe as o,
|
|
1130
|
+
ut as p,
|
|
1131
|
+
ft as q,
|
|
1132
|
+
st as r,
|
|
1133
|
+
$e as s,
|
|
1134
|
+
mt as t,
|
|
1135
|
+
gt as u,
|
|
1136
|
+
bt as v,
|
|
1137
|
+
Je as w,
|
|
1138
|
+
yt as x,
|
|
1139
|
+
ht as y,
|
|
1140
|
+
pt as z
|
|
1113
1141
|
};
|