react-semaphor 0.1.468 → 0.1.470
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 +110 -106
- 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-kaCNxjA7.js → analyze-result-contract-B3agc2XU.js} +1 -1
- package/dist/chunks/{analyze-result-contract-CMwVg9w2.cjs → analyze-result-contract-OgPk-zGu.cjs} +1 -1
- package/dist/chunks/{common-types-tRK8fhXV.cjs → common-types-C1IM7gao.cjs} +1 -1
- package/dist/chunks/{common-types-BgI-ymBp.js → common-types-g_1fKJLK.js} +1 -1
- package/dist/chunks/{dashboard-briefing-launcher-DjBmkS6v.js → dashboard-briefing-launcher-DEVbQCQE.js} +9 -9
- package/dist/chunks/{dashboard-briefing-launcher-Bo4GmnB7.cjs → dashboard-briefing-launcher-exfJnSop.cjs} +1 -1
- package/dist/chunks/{dashboard-controls-CstKugeB.cjs → dashboard-controls-8D1m_ECN.cjs} +1 -1
- package/dist/chunks/{dashboard-controls-CvrCyVPZ.js → dashboard-controls-DPK-CRWL.js} +9 -9
- package/dist/chunks/{dashboard-filter-value-compatibility-o-kufPZB.js → dashboard-filter-value-compatibility-BAaqJGjt.js} +78 -78
- package/dist/chunks/dashboard-filter-value-compatibility-CYrWe1U6.cjs +1 -0
- package/dist/chunks/{dashboard-input-contract-12mPNhCF.cjs → dashboard-input-contract-JFJZgenC.cjs} +1 -1
- package/dist/chunks/{dashboard-input-contract-Ciboc347.js → dashboard-input-contract-Vr_3ApfF.js} +1 -1
- package/dist/chunks/{dashboard-json-D9r_xere.js → dashboard-json-DVWLTmIJ.js} +7 -7
- package/dist/chunks/{dashboard-json-ZGqzmExU.cjs → dashboard-json-DhKOoHwK.cjs} +1 -1
- package/dist/chunks/edit-dashboard-visual-B6zidwTu.cjs +172 -0
- package/dist/chunks/{edit-dashboard-visual-D64tmqA4.js → edit-dashboard-visual-CxEC3bPx.js} +7283 -7417
- package/dist/chunks/{editor-action-buttons-BXJlZl7z.cjs → editor-action-buttons-B3S00DsB.cjs} +1 -1
- package/dist/chunks/{editor-action-buttons-C2msc_en.js → editor-action-buttons-HfJ-Bohl.js} +6 -6
- package/dist/chunks/{index-CQN-X1jN.cjs → index-B4VxBoJg.cjs} +1 -1
- package/dist/chunks/index-DVBYvkj0.cjs +1404 -0
- package/dist/chunks/{index-DO4BESNy.js → index-oVXvCLH-.js} +9 -9
- package/dist/chunks/{index-B6cfDHwn.js → index-tsB3LfTQ.js} +33898 -33887
- package/dist/chunks/matrix-result-contract-DoU9diAh.js +822 -0
- package/dist/chunks/matrix-result-contract-SrzyG_KQ.cjs +1 -0
- package/dist/chunks/{pivot-header-presentation-OpY8xzdT.js → pivot-header-presentation-BW0Ay7WV.js} +2 -2
- package/dist/chunks/{pivot-header-presentation-DyV0iOZ_.cjs → pivot-header-presentation-DVBTHug2.cjs} +1 -1
- package/dist/chunks/{pivot-result-identity-CCMpd8ZA.js → pivot-result-identity-5v4hRVbc.js} +1 -1
- package/dist/chunks/{pivot-result-identity-gsOwOjHi.cjs → pivot-result-identity-DRUlTWUq.cjs} +1 -1
- package/dist/chunks/{pivot-result-lifecycle-CEfU43GZ.cjs → pivot-result-lifecycle-DJgO2P0H.cjs} +1 -1
- package/dist/chunks/{pivot-result-lifecycle-B38AZx4a.js → pivot-result-lifecycle-O_roVguV.js} +7 -7
- package/dist/chunks/{raw-temporal-contract-r_EMdR85.js → raw-temporal-contract-BEMf3avg.js} +1 -1
- package/dist/chunks/{raw-temporal-contract-UdblxoVB.cjs → raw-temporal-contract-D8YuxTAg.cjs} +1 -1
- package/dist/chunks/{report-preferences-dialog-Dvy818KV.js → report-preferences-dialog-D-VpoQJz.js} +6 -6
- package/dist/chunks/{report-preferences-dialog-B89ypIJ-.cjs → report-preferences-dialog-DvNWNrlj.cjs} +1 -1
- package/dist/chunks/{report-runtime-context-CcXUjpb-.js → report-runtime-context-DnNbpkGo.js} +1 -1
- package/dist/chunks/{report-runtime-context-CLtzrZdC.cjs → report-runtime-context-RFiWq4wK.cjs} +1 -1
- package/dist/chunks/{saved-temporal-bucket-format-hylaofsQ.js → saved-temporal-bucket-format-CygnBDO2.js} +24 -24
- package/dist/chunks/{saved-temporal-bucket-format-Ca4hUfTo.cjs → saved-temporal-bucket-format-DNMtD77o.cjs} +1 -1
- package/dist/chunks/{switch-8PklEEN1.js → switch-DnbD-yCM.js} +248 -233
- package/dist/chunks/{switch-DykyqM66.cjs → switch-NAbuOQNg.cjs} +2 -2
- package/dist/chunks/{temporal-bucket-BDRcWdVv.cjs → temporal-bucket-9Wz9Ds6H.cjs} +1 -1
- package/dist/chunks/{temporal-bucket-Cc9fmx8s.js → temporal-bucket-CUKJktCl.js} +1 -1
- package/dist/chunks/{temporal-bucket-authoring-DjPFtRSF.js → temporal-bucket-authoring-CZoJV2L6.js} +3 -3
- package/dist/chunks/{temporal-bucket-authoring-C6sZAVqS.cjs → temporal-bucket-authoring-DSpzgXHc.cjs} +1 -1
- package/dist/chunks/{temporal-bucket-contract-vrOkax-r.cjs → temporal-bucket-contract-BD862TAa.cjs} +1 -1
- package/dist/chunks/{temporal-bucket-contract-DT4kU0VY.js → temporal-bucket-contract-Cno9TlYr.js} +1 -1
- package/dist/chunks/{token-types-DALtlgbG.cjs → token-types-CoHsSJ4E.cjs} +1 -1
- package/dist/chunks/{token-types-Z889rD6g.js → token-types-W3EHNW-D.js} +1 -1
- package/dist/chunks/{update-policy-Cyufdviq.cjs → update-policy-BGNXFgBU.cjs} +1 -1
- package/dist/chunks/{update-policy-Bu5Tw43R.js → update-policy-kRNJwwUV.js} +1 -1
- package/dist/chunks/{validators-DhTaCK1O.js → validators-B5t1s8oh.js} +274 -266
- package/dist/chunks/validators-DcshgK7w.cjs +1 -0
- package/dist/dashboard/index.cjs +1 -1
- package/dist/dashboard/index.js +2 -2
- package/dist/dashboard-authoring/index.cjs +1 -1
- package/dist/dashboard-authoring/index.js +4 -4
- 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 +3 -3
- package/dist/data-app-sdk-adapters/index.cjs +1 -1
- package/dist/data-app-sdk-adapters/index.js +2 -2
- package/dist/data-app-sdk-validation/index.cjs +1 -1
- package/dist/data-app-sdk-validation/index.js +3 -3
- package/dist/format-utils/index.cjs +1 -1
- package/dist/format-utils/index.js +12 -12
- package/dist/index.cjs +1 -1
- package/dist/index.js +14 -14
- 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 +69 -0
- package/dist/types/index.cjs +1 -1
- package/dist/types/index.js +4 -4
- package/dist/types/main.d.ts +1 -0
- package/package.json +1 -1
- package/dist/chunks/dashboard-filter-value-compatibility-Bnl2lsng.cjs +0 -1
- package/dist/chunks/edit-dashboard-visual-BzVDWVyZ.cjs +0 -172
- package/dist/chunks/index-DZdmd5AL.cjs +0 -1392
- package/dist/chunks/matrix-result-contract-C3cGHj_y.js +0 -598
- package/dist/chunks/matrix-result-contract-CkRVx693.cjs +0 -1
- package/dist/chunks/validators-DO-YuzgO.cjs +0 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
var O = Object.defineProperty;
|
|
2
|
-
var
|
|
3
|
-
var C = (e, n, i) =>
|
|
4
|
-
import {
|
|
5
|
-
import "./analyze-result-contract-
|
|
2
|
+
var S = (e, n, i) => n in e ? O(e, n, { enumerable: !0, configurable: !0, writable: !0, value: i }) : e[n] = i;
|
|
3
|
+
var C = (e, n, i) => S(e, typeof n != "symbol" ? n + "" : n, i);
|
|
4
|
+
import { ai as h, ak as M, h as N, af as q, ah as H, B as I, E as D } from "./validators-B5t1s8oh.js";
|
|
5
|
+
import "./analyze-result-contract-B3agc2XU.js";
|
|
6
6
|
import "../value-format-preferences/index.js";
|
|
7
7
|
function p(e) {
|
|
8
8
|
return !!e && typeof e == "object" && !Array.isArray(e);
|
|
@@ -23,12 +23,12 @@ function x(e, n) {
|
|
|
23
23
|
const r = e, a = {
|
|
24
24
|
kind: "semantic",
|
|
25
25
|
domainId: r.domainId,
|
|
26
|
-
datasetId: r
|
|
26
|
+
datasetId: q(r),
|
|
27
27
|
datasetName: r.name,
|
|
28
28
|
connectionId: r.connectionId || (n == null ? void 0 : n.connectionId),
|
|
29
29
|
label: r.label
|
|
30
30
|
};
|
|
31
|
-
return _(a) ?
|
|
31
|
+
return _(a) ? H(a) : void 0;
|
|
32
32
|
}
|
|
33
33
|
const i = e.connectionId || (n == null ? void 0 : n.connectionId), d = e.type === "dataset" && "table" in e && e.table ? e.table : e.name;
|
|
34
34
|
if (!i || !d)
|
|
@@ -44,7 +44,7 @@ function x(e, n) {
|
|
|
44
44
|
};
|
|
45
45
|
return _(t) ? t : void 0;
|
|
46
46
|
}
|
|
47
|
-
function
|
|
47
|
+
function L(e, n) {
|
|
48
48
|
var r, a;
|
|
49
49
|
const i = x(e, n);
|
|
50
50
|
if (!i) return;
|
|
@@ -56,13 +56,13 @@ function H(e, n) {
|
|
|
56
56
|
} : void 0;
|
|
57
57
|
return { source: i, ...o ? { executionTable: o } : {} };
|
|
58
58
|
}
|
|
59
|
-
function
|
|
59
|
+
function V(e) {
|
|
60
60
|
const n = p(e.dataSource) ? e.dataSource : void 0;
|
|
61
61
|
if (typeof e.sql == "string" && e.sql.trim()) {
|
|
62
62
|
const o = [], r = Array.isArray(n == null ? void 0 : n.selectedEntities) ? n.selectedEntities : [];
|
|
63
63
|
for (const a of r) {
|
|
64
64
|
if (!E(a)) continue;
|
|
65
|
-
const s =
|
|
65
|
+
const s = L(a, n);
|
|
66
66
|
s && !o.some(
|
|
67
67
|
(F) => h(
|
|
68
68
|
F.source,
|
|
@@ -104,25 +104,25 @@ function L(e) {
|
|
|
104
104
|
return {
|
|
105
105
|
cardId: e.id,
|
|
106
106
|
kind: "config",
|
|
107
|
-
executableSources:
|
|
107
|
+
executableSources: M(i)
|
|
108
108
|
};
|
|
109
109
|
}
|
|
110
|
-
function
|
|
110
|
+
function U(e, n) {
|
|
111
111
|
return (e.kind === "config" ? e.executableSources : e.kind === "sql" ? e.pinnedCatalogSources.map((d) => d.source) : []).some(
|
|
112
112
|
(d) => h(d, n)
|
|
113
113
|
);
|
|
114
114
|
}
|
|
115
|
-
function
|
|
115
|
+
function he(e, n) {
|
|
116
116
|
if (e.kind === "config")
|
|
117
117
|
return e.executableSources.find(
|
|
118
118
|
(i) => h(i, n)
|
|
119
119
|
);
|
|
120
120
|
}
|
|
121
|
-
function
|
|
121
|
+
function pe(e, n) {
|
|
122
122
|
var i;
|
|
123
|
-
return (i =
|
|
123
|
+
return (i = B(e, n)) == null ? void 0 : i.source;
|
|
124
124
|
}
|
|
125
|
-
function
|
|
125
|
+
function B(e, n) {
|
|
126
126
|
if (e.kind === "sql")
|
|
127
127
|
return e.pinnedCatalogSources.find(
|
|
128
128
|
(i) => h(i.source, n)
|
|
@@ -140,44 +140,44 @@ function P(e) {
|
|
|
140
140
|
}
|
|
141
141
|
return n;
|
|
142
142
|
}
|
|
143
|
-
function
|
|
143
|
+
function j(e, n) {
|
|
144
144
|
const i = D(e), d = D(n);
|
|
145
145
|
return i === "unknown" || d === "unknown" ? !1 : (i === "date" || i === "datetime") && (d === "date" || d === "datetime") ? !0 : i === d;
|
|
146
146
|
}
|
|
147
|
-
function
|
|
147
|
+
function W(e, n) {
|
|
148
148
|
return h(e.field.source, n.field.source) && I(e.field.name) === I(n.field.name) && I(e.field.sourceField || e.field.name) === I(n.field.sourceField || n.field.name);
|
|
149
149
|
}
|
|
150
|
-
function
|
|
150
|
+
function K(e, n) {
|
|
151
151
|
if (e.kind !== "field") return !1;
|
|
152
152
|
const i = P(n), d = P(e.field);
|
|
153
|
-
return
|
|
153
|
+
return j(n.dataType, e.field.dataType) && [...d].some((t) => i.has(t));
|
|
154
154
|
}
|
|
155
|
-
function
|
|
155
|
+
function Ie(e) {
|
|
156
156
|
const n = e.candidates.filter(
|
|
157
|
-
(i) =>
|
|
157
|
+
(i) => K(
|
|
158
158
|
i,
|
|
159
159
|
e.logicalValueField
|
|
160
160
|
)
|
|
161
161
|
);
|
|
162
162
|
return n.length === 1 ? { status: "matched", target: n[0] } : n.length > 1 ? { status: "ambiguous" } : { status: "notApplicable" };
|
|
163
163
|
}
|
|
164
|
-
function
|
|
164
|
+
function ye(e) {
|
|
165
165
|
const n = [];
|
|
166
166
|
for (const i of e.acceptedTargets)
|
|
167
|
-
!
|
|
167
|
+
!j(
|
|
168
168
|
e.logicalValueField.dataType,
|
|
169
169
|
i.field.dataType
|
|
170
170
|
) || n.some(
|
|
171
|
-
(d) =>
|
|
171
|
+
(d) => W(d, i)
|
|
172
172
|
) || n.push(i);
|
|
173
173
|
return n.length === 1 ? { status: "matched", target: n[0] } : n.length > 1 ? { status: "ambiguous" } : { status: "notApplicable" };
|
|
174
174
|
}
|
|
175
|
-
const
|
|
176
|
-
function
|
|
177
|
-
return e != null && e.trim() ?
|
|
175
|
+
const Y = /\{\{-?\s*filters\s*\|\s*where\s*-?\}\}/i, G = /\{\{-?\s*filters\s*\|\s*and\s*-?\}\}/i, J = /\bwhere\b/i;
|
|
176
|
+
function Q(e) {
|
|
177
|
+
return e != null && e.trim() ? Y.test(e) || G.test(e) : !1;
|
|
178
178
|
}
|
|
179
|
-
function
|
|
180
|
-
return !(e != null && e.trim()) ||
|
|
179
|
+
function $e(e) {
|
|
180
|
+
return !(e != null && e.trim()) || Q(e) ? null : J.test(e) ? {
|
|
181
181
|
helper: "{{ filters | and }}",
|
|
182
182
|
description: "For queries with an existing WHERE clause."
|
|
183
183
|
} : {
|
|
@@ -185,16 +185,16 @@ function ye(e) {
|
|
|
185
185
|
description: "For queries without a WHERE clause."
|
|
186
186
|
};
|
|
187
187
|
}
|
|
188
|
-
function
|
|
188
|
+
function X(e) {
|
|
189
189
|
return (e.field.sourceField || e.field.name).trim() || void 0;
|
|
190
190
|
}
|
|
191
|
-
function
|
|
191
|
+
function _e(e) {
|
|
192
192
|
if (e.inventory.kind !== "sql" || e.target.kind !== "field")
|
|
193
193
|
return { status: "ineligible" };
|
|
194
|
-
const n =
|
|
194
|
+
const n = B(
|
|
195
195
|
e.inventory,
|
|
196
196
|
e.target.field.source
|
|
197
|
-
), i =
|
|
197
|
+
), i = X(e.target);
|
|
198
198
|
if (!n || !i) return { status: "ineligible" };
|
|
199
199
|
if (n.executionTable) {
|
|
200
200
|
const o = [
|
|
@@ -226,14 +226,14 @@ function $e(e) {
|
|
|
226
226
|
executionIdentifier: i
|
|
227
227
|
};
|
|
228
228
|
}
|
|
229
|
-
class
|
|
229
|
+
class Z extends Error {
|
|
230
230
|
constructor(i) {
|
|
231
231
|
super(i.map((d) => d.message).join(" "));
|
|
232
232
|
C(this, "issues");
|
|
233
233
|
this.name = "DashboardFilterMappingContractError", this.issues = i;
|
|
234
234
|
}
|
|
235
235
|
}
|
|
236
|
-
const
|
|
236
|
+
const ee = {
|
|
237
237
|
string: !0,
|
|
238
238
|
number: !0,
|
|
239
239
|
boolean: !0,
|
|
@@ -249,7 +249,7 @@ function f(e) {
|
|
|
249
249
|
function $(e) {
|
|
250
250
|
return Array.isArray(e) && e.every((n) => typeof n == "string");
|
|
251
251
|
}
|
|
252
|
-
function
|
|
252
|
+
function ne(e) {
|
|
253
253
|
if (!f(e)) return !1;
|
|
254
254
|
switch (e.kind) {
|
|
255
255
|
case "allSheets":
|
|
@@ -266,13 +266,13 @@ function ee(e) {
|
|
|
266
266
|
return !1;
|
|
267
267
|
}
|
|
268
268
|
}
|
|
269
|
-
function
|
|
269
|
+
function ie(e) {
|
|
270
270
|
return e === "shared" || e === "perSheet" || e === "perCard" || e === "perDocumentSection";
|
|
271
271
|
}
|
|
272
|
-
function
|
|
272
|
+
function te(e) {
|
|
273
273
|
return f(e) ? m(e.id) && m(e.column) && m(e.dataType) : !1;
|
|
274
274
|
}
|
|
275
|
-
function
|
|
275
|
+
function se(e, n, i, d) {
|
|
276
276
|
var r;
|
|
277
277
|
if (!f(n)) {
|
|
278
278
|
d.push({
|
|
@@ -327,7 +327,7 @@ function te(e, n, i, d) {
|
|
|
327
327
|
inputId: e
|
|
328
328
|
});
|
|
329
329
|
}
|
|
330
|
-
function
|
|
330
|
+
function re(e, n, i, d, t, c) {
|
|
331
331
|
var s;
|
|
332
332
|
if (m(n.bindingId) || t.push({
|
|
333
333
|
code: "invalid_binding_id",
|
|
@@ -359,7 +359,7 @@ function se(e, n, i, d, t, c) {
|
|
|
359
359
|
return;
|
|
360
360
|
}
|
|
361
361
|
if (Object.prototype.hasOwnProperty.call(
|
|
362
|
-
|
|
362
|
+
ee,
|
|
363
363
|
o.dataType
|
|
364
364
|
) || t.push({
|
|
365
365
|
code: "unknown_target_data_type",
|
|
@@ -388,8 +388,8 @@ function se(e, n, i, d, t, c) {
|
|
|
388
388
|
});
|
|
389
389
|
return;
|
|
390
390
|
}
|
|
391
|
-
const a =
|
|
392
|
-
(a.kind === "unconfigured" || !
|
|
391
|
+
const a = V(r);
|
|
392
|
+
(a.kind === "unconfigured" || !U(a, o.source)) && t.push({
|
|
393
393
|
code: "unavailable_card_source",
|
|
394
394
|
path: `${i}.target.field.source`,
|
|
395
395
|
message: `${i}.target field source is not declared by card '${r.id}'.`,
|
|
@@ -398,7 +398,7 @@ function se(e, n, i, d, t, c) {
|
|
|
398
398
|
bindingId: n.bindingId
|
|
399
399
|
});
|
|
400
400
|
}
|
|
401
|
-
function
|
|
401
|
+
function oe(e, n, i, d, t, c) {
|
|
402
402
|
if (n === void 0) return;
|
|
403
403
|
if (!f(n) || n.kind !== "cardMappings" || !Array.isArray(n.cards)) {
|
|
404
404
|
t.push({
|
|
@@ -441,7 +441,7 @@ function re(e, n, i, d, t, c) {
|
|
|
441
441
|
});
|
|
442
442
|
return;
|
|
443
443
|
}
|
|
444
|
-
r.kind === "bound" ?
|
|
444
|
+
r.kind === "bound" ? re(
|
|
445
445
|
e,
|
|
446
446
|
r,
|
|
447
447
|
s,
|
|
@@ -457,7 +457,7 @@ function re(e, n, i, d, t, c) {
|
|
|
457
457
|
});
|
|
458
458
|
});
|
|
459
459
|
}
|
|
460
|
-
function
|
|
460
|
+
function de({
|
|
461
461
|
inputs: e,
|
|
462
462
|
dashboardFilters: n,
|
|
463
463
|
cards: i = [],
|
|
@@ -474,7 +474,7 @@ function oe({
|
|
|
474
474
|
message: "dashboard.inputs must be an array when present."
|
|
475
475
|
}), { ok: !1, inputs: r, issues: t }) : ((Array.isArray(e) ? e : []).forEach((s, F) => {
|
|
476
476
|
const u = `dashboard.inputs[${F}]`;
|
|
477
|
-
if (!f(s) || s.kind !== "filter" && s.kind !== "control" || !m(s.id) || !m(s.label) || !m(s.variableName) || !
|
|
477
|
+
if (!f(s) || s.kind !== "filter" && s.kind !== "control" || !m(s.id) || !m(s.label) || !m(s.variableName) || !ne(s.scope) || !ie(s.runtimeScope)) {
|
|
478
478
|
t.push({
|
|
479
479
|
code: "invalid_input",
|
|
480
480
|
path: u,
|
|
@@ -516,7 +516,7 @@ function oe({
|
|
|
516
516
|
});
|
|
517
517
|
return;
|
|
518
518
|
}
|
|
519
|
-
if (y && !
|
|
519
|
+
if (y && !te(T)) {
|
|
520
520
|
t.push({
|
|
521
521
|
code: "invalid_input",
|
|
522
522
|
path: `${u}.filter`,
|
|
@@ -570,7 +570,7 @@ function oe({
|
|
|
570
570
|
a.set(b.id, l.id);
|
|
571
571
|
}
|
|
572
572
|
if (!b) return;
|
|
573
|
-
if (l.optionSource !== void 0 &&
|
|
573
|
+
if (l.optionSource !== void 0 && se(
|
|
574
574
|
l.id,
|
|
575
575
|
l.optionSource,
|
|
576
576
|
`${u}.optionSource`,
|
|
@@ -589,7 +589,7 @@ function oe({
|
|
|
589
589
|
path: `${u}.scope`,
|
|
590
590
|
message: `${u}.scope must be allSheets or sheets when cardMappings are present.`,
|
|
591
591
|
inputId: l.id
|
|
592
|
-
}),
|
|
592
|
+
}), oe(
|
|
593
593
|
l.id,
|
|
594
594
|
l.application,
|
|
595
595
|
`${u}.application`,
|
|
@@ -598,8 +598,8 @@ function oe({
|
|
|
598
598
|
d
|
|
599
599
|
);
|
|
600
600
|
const {
|
|
601
|
-
filter:
|
|
602
|
-
filterReference:
|
|
601
|
+
filter: le,
|
|
602
|
+
filterReference: ue,
|
|
603
603
|
// A reference-backed authored input must shadow the generated
|
|
604
604
|
// dashboard-filter compatibility input. Older writers may have copied
|
|
605
605
|
// the compatibility marker onto the reference; never preserve it.
|
|
@@ -617,15 +617,15 @@ function oe({
|
|
|
617
617
|
});
|
|
618
618
|
}), t.length ? { ok: !1, inputs: r, issues: t } : { ok: !0, inputs: r });
|
|
619
619
|
}
|
|
620
|
-
function
|
|
621
|
-
const n =
|
|
622
|
-
if (!n.ok) throw new
|
|
620
|
+
function Fe(e) {
|
|
621
|
+
const n = de(e);
|
|
622
|
+
if (!n.ok) throw new Z(n.issues);
|
|
623
623
|
return n.inputs;
|
|
624
624
|
}
|
|
625
|
-
function
|
|
625
|
+
function Te(e = () => globalThis.crypto.randomUUID()) {
|
|
626
626
|
return e();
|
|
627
627
|
}
|
|
628
|
-
const
|
|
628
|
+
const ae = {
|
|
629
629
|
date: /* @__PURE__ */ new Set([
|
|
630
630
|
"between",
|
|
631
631
|
"not between",
|
|
@@ -662,31 +662,31 @@ const de = {
|
|
|
662
662
|
"is null",
|
|
663
663
|
"is not null"
|
|
664
664
|
]),
|
|
665
|
-
boolean: /* @__PURE__ */ new Set(["=", "!=", "is null", "is not null"])
|
|
665
|
+
boolean: /* @__PURE__ */ new Set(["=", "!=", "in", "not in", "is null", "is not null"])
|
|
666
666
|
};
|
|
667
|
-
function
|
|
667
|
+
function ce(e) {
|
|
668
668
|
const n = D(e);
|
|
669
669
|
return n === "number" || n === "boolean" ? n : n === "date" || n === "datetime" ? "date" : "string";
|
|
670
670
|
}
|
|
671
|
-
function
|
|
672
|
-
return typeof n != "string" ? !1 :
|
|
671
|
+
function ke(e, n) {
|
|
672
|
+
return typeof n != "string" ? !1 : ae[ce(e)].has(n);
|
|
673
673
|
}
|
|
674
674
|
export {
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
675
|
+
Z as D,
|
|
676
|
+
pe as a,
|
|
677
|
+
V as b,
|
|
678
|
+
B as c,
|
|
679
|
+
U as d,
|
|
680
|
+
K as e,
|
|
681
|
+
he as f,
|
|
682
|
+
ye as g,
|
|
683
|
+
Q as h,
|
|
684
|
+
$e as i,
|
|
685
|
+
_e as j,
|
|
686
|
+
Fe as k,
|
|
687
|
+
Te as l,
|
|
688
|
+
ce as m,
|
|
689
|
+
de as n,
|
|
690
|
+
ke as o,
|
|
691
|
+
Ie as r
|
|
692
692
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var H=Object.defineProperty;var L=(e,n,t)=>n in e?H(e,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[n]=t;var N=(e,n,t)=>L(e,typeof n!="symbol"?n+"":n,t);const f=require("./validators-DcshgK7w.cjs");require("./analyze-result-contract-OgPk-zGu.cjs");require("../value-format-preferences/index.cjs");function p(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function k(e){return p(e)&&typeof e.name=="string"}function F(e){return!p(e)||e.kind!=="semantic"&&e.kind!=="physical"||(e.kind==="semantic"?[e.datasetId,e.datasetName,e.connectionId]:[e.databaseName,e.schemaName]).some(t=>t!==void 0&&typeof t!="string")?!1:f.hasCompleteSemaphorSourceIdentity(e)}function v(e,n){var c,o;if((n==null?void 0:n.mode)!=="database"&&e.type==="dataset"&&"domainId"in e&&e.domainId){const s=e,d={kind:"semantic",domainId:s.domainId,datasetId:f.getSemaphorDatasetEntityId(s),datasetName:s.name,connectionId:s.connectionId||(n==null?void 0:n.connectionId),label:s.label};return F(d)?f.canonicalizeSemaphorSourceIdentity(d):void 0}const t=e.connectionId||(n==null?void 0:n.connectionId),a=e.type==="dataset"&&"table"in e&&e.table?e.table:e.name;if(!t||!a)return;const i={kind:"physical",connectionId:t,connectionType:e.connectionType||(n==null?void 0:n.connectionType),tableName:a,databaseName:e.database||((c=n==null?void 0:n.dbSelection)==null?void 0:c.database),schemaName:e.schema||((o=n==null?void 0:n.dbSelection)==null?void 0:o.schema),dialect:e.dialect};return F(i)?i:void 0}function V(e,n){var s,d;const t=v(e,n);if(!t)return;const a=e.type==="dataset"&&"table"in e&&typeof e.table=="string"?e.table.trim():void 0,i=t.kind==="physical"?t.tableName:a,c=e.connectionId||(n==null?void 0:n.connectionId),o=i&&c?{connectionId:c,databaseName:e.database||((s=n==null?void 0:n.dbSelection)==null?void 0:s.database),schemaName:e.schema||((d=n==null?void 0:n.dbSelection)==null?void 0:d.schema),tableName:i}:void 0;return{source:t,...o?{executionTable:o}:{}}}function x(e){const n=p(e.dataSource)?e.dataSource:void 0;if(typeof e.sql=="string"&&e.sql.trim()){const o=[],s=Array.isArray(n==null?void 0:n.selectedEntities)?n.selectedEntities:[];for(const d of s){if(!k(d))continue;const r=V(d,n);r&&!o.some(T=>f.semaphorSourcesReferToSameDataset(T.source,r.source))&&o.push(r)}return{cardId:e.id,kind:"sql",pinnedCatalogSources:o}}if(!p(e.config))return{cardId:e.id,kind:"unconfigured"};const t=[],a=p(e.config.matrixIntent)?e.config.matrixIntent:void 0,i=e.type==="matrixTable"?(a==null?void 0:a.kind)==="matrix"?a.source:e.config.source:void 0;F(i)&&t.push(i);const c=p(e.config.joinPlan)?e.config.joinPlan:void 0;if(c){const o=Array.isArray(c.joins)?c.joins:[],s=[c.baseEntity];for(const d of o)p(d)&&s.push(d.source,d.target);for(const d of s){if(!k(d))continue;const r=v(d,n);r&&t.push(r)}}else if(e.type!=="matrixTable"){const o=Array.isArray(n==null?void 0:n.selectedEntities)?n.selectedEntities:[];if(o.length===1&&k(o[0])){const s=v(o[0],n);s&&t.push(s)}}if(!t.length&&!c&&e.type!=="matrixTable"){const o=e.config.queryBaseSource;F(o)&&t.push(o)}return{cardId:e.id,kind:"config",executableSources:f.mergeSemaphorSourcesByIdentity(t)}}function w(e,n){return(e.kind==="config"?e.executableSources:e.kind==="sql"?e.pinnedCatalogSources.map(a=>a.source):[]).some(a=>f.semaphorSourcesReferToSameDataset(a,n))}function U(e,n){if(e.kind==="config")return e.executableSources.find(t=>f.semaphorSourcesReferToSameDataset(t,n))}function W(e,n){var t;return(t=C(e,n))==null?void 0:t.source}function C(e,n){if(e.kind==="sql")return e.pinnedCatalogSources.find(t=>f.semaphorSourcesReferToSameDataset(t.source,n))}function R(e){const n=new Set;for(const t of[e.name,e.sourceField]){if(!t)continue;const a=f.normalizeAnalyticsCatalogName(t);if(!a)continue;n.add(a);const i=a.split("."),c=i[i.length-1];c&&n.add(c)}return n}function z(e,n){const t=f.normalizeAnalyticsCatalogDataType(e),a=f.normalizeAnalyticsCatalogDataType(n);return t==="unknown"||a==="unknown"?!1:(t==="date"||t==="datetime")&&(a==="date"||a==="datetime")?!0:t===a}function K(e,n){return f.semaphorSourcesReferToSameDataset(e.field.source,n.field.source)&&f.normalizeAnalyticsCatalogName(e.field.name)===f.normalizeAnalyticsCatalogName(n.field.name)&&f.normalizeAnalyticsCatalogName(e.field.sourceField||e.field.name)===f.normalizeAnalyticsCatalogName(n.field.sourceField||n.field.name)}function P(e,n){if(e.kind!=="field")return!1;const t=R(n),a=R(e.field);return z(n.dataType,e.field.dataType)&&[...a].some(i=>t.has(i))}function Y(e){const n=e.candidates.filter(t=>P(t,e.logicalValueField));return n.length===1?{status:"matched",target:n[0]}:n.length>1?{status:"ambiguous"}:{status:"notApplicable"}}function G(e){const n=[];for(const t of e.acceptedTargets)!z(e.logicalValueField.dataType,t.field.dataType)||n.some(a=>K(a,t))||n.push(t);return n.length===1?{status:"matched",target:n[0]}:n.length>1?{status:"ambiguous"}:{status:"notApplicable"}}const J=/\{\{-?\s*filters\s*\|\s*where\s*-?\}\}/i,Q=/\{\{-?\s*filters\s*\|\s*and\s*-?\}\}/i,X=/\bwhere\b/i;function B(e){return e!=null&&e.trim()?J.test(e)||Q.test(e):!1}function Z(e){return!(e!=null&&e.trim())||B(e)?null:X.test(e)?{helper:"{{ filters | and }}",description:"For queries with an existing WHERE clause."}:{helper:"{{ filters | where }}",description:"For queries without a WHERE clause."}}function ee(e){return(e.field.sourceField||e.field.name).trim()||void 0}function ne(e){if(e.inventory.kind!=="sql"||e.target.kind!=="field")return{status:"ineligible"};const n=C(e.inventory,e.target.field.source),t=ee(e.target);if(!n||!t)return{status:"ineligible"};if(n.executionTable){const o=[n.executionTable.databaseName,n.executionTable.schemaName,n.executionTable.tableName,t].filter(Boolean).join(".");return{status:"eligible",source:n.source,executionIdentifier:o}}if(e.inventory.pinnedCatalogSources.length!==1)return{status:"ineligible"};const a=f.normalizeAnalyticsCatalogName(t),i=(e.candidateTargets||[]).filter(o=>f.normalizeAnalyticsCatalogName(o.field.sourceField||o.field.name)===a),c=[];for(const o of i)c.some(s=>f.semaphorSourcesReferToSameDataset(s,o.field.source))||c.push(o.field.source);return c.length>1?{status:"ineligible"}:{status:"eligible",source:n.source,executionIdentifier:t}}class j extends Error{constructor(t){super(t.map(a=>a.message).join(" "));N(this,"issues");this.name="DashboardFilterMappingContractError",this.issues=t}}const te={string:!0,number:!0,boolean:!0,date:!0,datetime:!0};function b(e){return typeof e=="string"&&e.trim().length>0}function m(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function I(e){return Array.isArray(e)&&e.every(n=>typeof n=="string")}function ie(e){if(!m(e))return!1;switch(e.kind){case"allSheets":return e.sheetKinds===void 0||I(e.sheetKinds)&&e.sheetKinds.every(n=>n==="dashboard"||n==="document");case"sheets":return I(e.sheetIds);case"cards":return I(e.cardIds);case"documentSections":return b(e.sheetId)&&I(e.sectionIds);default:return!1}}function re(e){return e==="shared"||e==="perSheet"||e==="perCard"||e==="perDocumentSection"}function se(e){return m(e)?b(e.id)&&b(e.column)&&b(e.dataType):!1}function oe(e,n,t,a){var s;if(!m(n)){a.push({code:"invalid_option_source",path:t,message:`${t} must be a semantic or physical option source.`,inputId:e});return}const i=n.source,c=[["labelField",n.labelField],["valueField",n.valueField],["searchField",n.searchField]];if(!m(i)||i.kind!=="semantic"&&i.kind!=="physical"||!f.hasCompleteSemaphorSourceIdentity(i)||!m(n.labelField)||!m(n.valueField)||n.searchField!==void 0&&!m(n.searchField)||n.disambiguationFields!==void 0&&(!Array.isArray(n.disambiguationFields)||!n.disambiguationFields.every(m))){a.push({code:"invalid_option_source",path:t,message:`${t} must contain a valid semantic or physical source and field references.`,inputId:e});return}for(const[d,r]of c)r!==void 0&&m(r)&&(!b(r.name)||r.source!==void 0&&!f.semaphorSourcesReferToSameDataset(r.source,i))&&a.push({code:"invalid_option_source",path:`${t}.${d}`,message:`${t}.${d} must be a named field belonging to the declared option source.`,inputId:e});for(const[d,r]of((s=n.disambiguationFields)==null?void 0:s.entries())||[])(!m(r)||!b(r.name)||r.source!==void 0&&!f.semaphorSourcesReferToSameDataset(r.source,i))&&a.push({code:"invalid_option_source",path:`${t}.disambiguationFields[${d}]`,message:`${t}.disambiguationFields[${d}] must be a named field belonging to the declared option source.`,inputId:e});const o=n.valueField;["string","number","boolean","date","datetime"].includes(String(o.dataType))||a.push({code:"invalid_option_source",path:`${t}.valueField.dataType`,message:`${t}.valueField.dataType must be a known option-value datatype.`,inputId:e})}function ae(e,n,t,a,i,c){var r;if(b(n.bindingId)||i.push({code:"invalid_binding_id",path:`${t}.bindingId`,message:`${t}.bindingId must be an opaque non-empty id.`,inputId:e,cardId:n.cardId}),((r=n.target)==null?void 0:r.kind)!=="field"){i.push({code:"unsupported_target",path:`${t}.target`,message:`${t}.target must be one direct field target.`,inputId:e,cardId:n.cardId,bindingId:n.bindingId});return}const o=n.target.field;if(!b(o==null?void 0:o.name)||!o.source||o.source.kind!=="semantic"&&o.source.kind!=="physical"||!f.hasCompleteSemaphorSourceIdentity(o.source)){i.push({code:"invalid_target_field",path:`${t}.target.field`,message:`${t}.target.field must have a name and a source-qualified semantic or physical identity.`,inputId:e,cardId:n.cardId,bindingId:n.bindingId});return}if(Object.prototype.hasOwnProperty.call(te,o.dataType)||i.push({code:"unknown_target_data_type",path:`${t}.target.field.dataType`,message:`${t}.target.field.dataType must be known.`,inputId:e,cardId:n.cardId,bindingId:n.bindingId}),o.sourceField!==void 0&&!b(o.sourceField)&&i.push({code:"invalid_target_field",path:`${t}.target.field.sourceField`,message:`${t}.target.field.sourceField must be a non-empty catalog-grounded column when provided.`,inputId:e,cardId:n.cardId,bindingId:n.bindingId}),!c)return;const s=a.get(n.cardId);if(!s){i.push({code:"unknown_card",path:`${t}.cardId`,message:`${t}.cardId '${n.cardId}' does not exist.`,inputId:e,cardId:n.cardId,bindingId:n.bindingId});return}const d=x(s);(d.kind==="unconfigured"||!w(d,o.source))&&i.push({code:"unavailable_card_source",path:`${t}.target.field.source`,message:`${t}.target field source is not declared by card '${s.id}'.`,inputId:e,cardId:s.id,bindingId:n.bindingId})}function de(e,n,t,a,i,c){if(n===void 0)return;if(!m(n)||n.kind!=="cardMappings"||!Array.isArray(n.cards)){i.push({code:"invalid_application",path:t,message:`${t} must be a cardMappings application with a cards array.`,inputId:e});return}const o=new Set;n.cards.forEach((s,d)=>{const r=`${t}.cards[${d}]`;if(!b(s==null?void 0:s.cardId)){i.push({code:"unknown_card",path:`${r}.cardId`,message:`${r}.cardId is required.`,inputId:e});return}if(o.has(s.cardId)){i.push({code:"duplicate_card_application",path:`${r}.cardId`,message:`${t} contains more than one entry for card '${s.cardId}'.`,inputId:e,cardId:s.cardId});return}if(o.add(s.cardId),c&&!a.has(s.cardId)){i.push({code:"unknown_card",path:`${r}.cardId`,message:`${r}.cardId '${s.cardId}' does not exist.`,inputId:e,cardId:s.cardId});return}s.kind==="bound"?ae(e,s,r,a,i,c):s.kind!=="excluded"&&i.push({code:"invalid_application",path:r,message:`${r}.kind must be 'bound' or 'excluded'.`,inputId:e,cardId:s.cardId})})}function q({inputs:e,dashboardFilters:n,cards:t=[],validateCardTargets:a=!1}){const i=[],c=new Map((n||[]).map(r=>[r.id,r])),o=new Map(a?t.map(r=>[r.id,r]):[]),s=[],d=new Map;return e!=null&&!Array.isArray(e)?(i.push({code:"invalid_input",path:"dashboard.inputs",message:"dashboard.inputs must be an array when present."}),{ok:!1,inputs:s,issues:i}):((Array.isArray(e)?e:[]).forEach((r,T)=>{const u=`dashboard.inputs[${T}]`;if(!m(r)||r.kind!=="filter"&&r.kind!=="control"||!b(r.id)||!b(r.label)||!b(r.variableName)||!ie(r.scope)||!re(r.runtimeScope)){i.push({code:"invalid_input",path:u,message:`${u} must be a complete filter or control Dashboard Input envelope.`,inputId:m(r)&&typeof r.id=="string"?r.id:void 0});return}if(r.kind==="control"&&!m(r.control)){i.push({code:"invalid_input",path:`${u}.control`,message:`${u}.control must be a control definition.`,inputId:r.id});return}const l=r;if(l.kind==="control"){s.push(l);return}const $=l.filter,g=l.filterReference,y=$!==void 0,E=!!g;if(y&&E){i.push({code:"both_filter_definitions",path:u,message:`${u} must contain either filter or filterReference, not both.`,inputId:l.id});return}if(!y&&!E){i.push({code:"missing_filter_definition",path:u,message:`${u} must contain filter or filterReference.`,inputId:l.id});return}if(y&&!se($)){i.push({code:"invalid_input",path:`${u}.filter`,message:`${u}.filter must be a complete dashboard filter definition.`,inputId:l.id});return}let h,_;if(y)h=$,_="embedded";else{if((g==null?void 0:g.kind)!=="dashboardFilter"){i.push({code:"invalid_filter_reference",path:`${u}.filterReference.kind`,message:`${u}.filterReference.kind must be 'dashboardFilter'.`,inputId:l.id});return}const D=typeof(g==null?void 0:g.filterId)=="string"?g.filterId:void 0;if(h=D?c.get(D):void 0,_="dashboardFilter",!h){i.push({code:"orphaned_filter_reference",path:`${u}.filterReference.filterId`,message:`${u}.filterReference cannot resolve dashboard filter '${D||""}'.`,inputId:l.id});return}if(h.kind==="global-date"){i.push({code:"global_date_reference",path:`${u}.filterReference`,message:`${u}.filterReference cannot reference the Global Date filter.`,inputId:l.id});return}const A=d.get(h.id);if(A){i.push({code:"duplicate_filter_reference",path:`${u}.filterReference.filterId`,message:`${u}.filterReference duplicates dashboard filter '${h.id}' already owned by Dashboard Input '${A}'.`,inputId:l.id});return}d.set(h.id,l.id)}if(!h)return;if(l.optionSource!==void 0&&oe(l.id,l.optionSource,`${u}.optionSource`,i),l.application&&h.kind==="global-date"){i.push({code:"global_date_reference",path:`${u}.application`,message:`${u}.application cannot map the Global Date filter.`,inputId:l.id});return}l.application&&l.scope.kind!=="allSheets"&&l.scope.kind!=="sheets"&&i.push({code:"unsupported_mapped_scope",path:`${u}.scope`,message:`${u}.scope must be allSheets or sheets when cardMappings are present.`,inputId:l.id}),de(l.id,l.application,`${u}.application`,o,i,a);const{filter:me,filterReference:be,compatibility:S,...O}=l;s.push({...O,filter:h,...y&&S?{compatibility:S}:{},...l.optionSource?{optionSource:l.optionSource}:{},definitionOrigin:_})}),i.length?{ok:!1,inputs:s,issues:i}:{ok:!0,inputs:s})}function ce(e){const n=q(e);if(!n.ok)throw new j(n.issues);return n.inputs}function le(e=()=>globalThis.crypto.randomUUID()){return e()}const ue={date:new Set(["between","not between","=","!=",">",">=","<","<=","is null","is not null"]),number:new Set(["between","not between","=","!=",">",">=","<","<=","in","not in","is null","is not null"]),string:new Set(["=","!=","in","not in","like","not like","is null","is not null"]),boolean:new Set(["=","!=","in","not in","is null","is not null"])};function M(e){const n=f.normalizeAnalyticsCatalogDataType(e);return n==="number"||n==="boolean"?n:n==="date"||n==="datetime"?"date":"string"}function fe(e,n){return typeof n!="string"?!1:ue[M(e)].has(n)}exports.DashboardFilterMappingContractError=j;exports.buildDashboardCardSourceIndex=x;exports.createDashboardFilterBindingId=le;exports.dashboardCardFilterSourceInventoryContains=w;exports.dashboardFilterTargetMatchesLogicalValue=P;exports.dashboardFilterValueTypeForDataType=M;exports.findDashboardCardExecutableSource=U;exports.findDashboardCardPinnedCatalogSource=W;exports.findDashboardSqlPinnedCatalogSource=C;exports.getDashboardFilterSubscriptionHint=Z;exports.hasDashboardFilterSubscription=B;exports.isDashboardFilterOperationCompatible=fe;exports.normalizeDashboardInputs=q;exports.requireNormalizedDashboardInputs=ce;exports.resolveDashboardFilterAutomaticTarget=Y;exports.resolveDashboardFilterInheritedTarget=G;exports.resolveDashboardSqlFilterTarget=ne;
|
package/dist/chunks/{dashboard-input-contract-12mPNhCF.cjs → dashboard-input-contract-JFJZgenC.cjs}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const h=require("./validators-
|
|
1
|
+
"use strict";const h=require("./validators-DcshgK7w.cjs");function v(e,n){const t=e.split(".").map(r=>r.trim()),i=n.split(".").map(r=>r.trim());if(t.length===0||i.length===0||t.some(r=>!r)||i.some(r=>!r))return!1;const[o,s]=t.length<=i.length?[t,i]:[i,t],a=s.length-o.length;return o.every((r,c)=>r===s[c+a])}function D(e,n){const t=e.split("."),i=n.split("."),o=t.pop(),s=i.pop();return!!(o&&o===s&&t.length>0&&i.length>0&&v(t.join("."),i.join(".")))}function F(e){const n=e.map(i=>i.trim()).filter(Boolean);if(n.every((i,o)=>n.slice(o+1).every(s=>v(i,s))))return[...n].sort((i,o)=>o.split(".").length-i.split(".").length)[0]}function u(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function _(e){if(typeof e!="string")return"";const n=e.split(".").map(t=>t.trim());return n.length>1&&n.every(Boolean)?n.join("."):""}function I(e){if(typeof e!="string")return"";const n=e.split(".").map(t=>t.trim());return n.length>0&&n.every(Boolean)?n.join("."):""}function d(e){return typeof e=="string"?e.trim():""}function S(e,n){return e.every((t,i)=>e.slice(i+1).every(o=>n(t,o)))}function N(e,n){const t=d(e.id),i=d(e.name),o=d(n.entityId),s=d(n.entityName);return!i||!o&&!s?!1:(!o||o===t||o===i)&&(!s||s===i)}function E(e){const n=u(e.semanticContext)?e.semanticContext:void 0,t=u(e.fieldMeta)?e.fieldMeta:void 0,i=d(n==null?void 0:n.semanticDomainId),o=Array.isArray(n==null?void 0:n.selectedEntities)?n.selectedEntities.filter(g=>u(g)&&g.type==="dataset"):[];if(!!!(i||o.length>0||(t==null?void 0:t.entityType)==="dataset"))return;if(!i)return{status:"unresolved",reason:"incomplete_source_identity"};const a=d(t==null?void 0:t.entityId),r=d(t==null?void 0:t.entityName),c=!!(a||r),f=c?o.filter(g=>N(g,{entityId:a,entityName:r})):o;if(f.length>1)return{status:"unresolved",reason:"incomplete_source_identity"};if(c&&o.length>0&&f.length===0)return{status:"unresolved",reason:"divergent_source_identity"};const l=f[0],m=d(l==null?void 0:l.domainId),y=d(l==null?void 0:l.id),p=d(l==null?void 0:l.name);if(m&&m!==i)return{status:"unresolved",reason:"divergent_source_identity"};const b=y,C=p||r;return C?{status:"resolved",source:{kind:"semantic",domainId:i,datasetName:C,...b?{datasetId:b}:{}}}:{status:"unresolved",reason:"incomplete_source_identity"}}function A(e,n){const t=d(e.connectionId),i=u(e.semanticContext)?e.semanticContext:void 0,o=d(i==null?void 0:i.connectionId);if(t&&o&&t!==o)return{status:"unresolved",reason:"divergent_source_identity"};const s=t||o,a=u(e.fieldMeta)?e.fieldMeta:void 0,r=n.split(".").slice(0,-1).join("."),c=I(e.qualifiedTableName),f=I(a==null?void 0:a.qualifiedEntityName),l=[c,f,r].filter(Boolean),m=F(l);return!m&&l.length>0?{status:"unresolved",reason:"divergent_source_identity"}:!s||!m?{status:"unresolved",reason:"incomplete_source_identity"}:{status:"resolved",source:{kind:"physical",connectionId:s,tableName:m}}}function B(e,n){const t=u(e.fieldMeta)?e.fieldMeta:void 0,i=typeof(t==null?void 0:t.qualifiedFieldName)=="string"?t.qualifiedFieldName.trim():"",o=_(t==null?void 0:t.qualifiedFieldName),s=typeof e.column=="string"?e.column.trim():"",a=_(s),r=typeof e.qualifiedTableName=="string"?e.qualifiedTableName.trim():"",c=I(e.qualifiedTableName);if(i&&!o||n&&r&&!c||s.includes(".")&&!a)return{status:"unresolved",reason:"incomplete_field_identity"};const f=a.split("."),l=a?f[f.length-1]:s,m=n&&c&&l?`${c}.${l}`:"",y=[o,a,m].filter(Boolean);if(!S(y,D))return{status:"unresolved",reason:"divergent_field_identity"};const p=a||o||m;return p?{status:"resolved",qualifiedFieldName:p}:{status:"unresolved",reason:"incomplete_field_identity"}}function q(e){if(!u(e))return{status:"ineligible",reason:"invalid_input"};if(e.kind==="global-date")return{status:"eligible",kind:"global_date"};const n=h.normalizeAnalyticsCatalogDataType(e.dataType);if(n!=="date"&&n!=="datetime")return{status:"ineligible",reason:"non_date_filter"};const t=u(e.fieldMeta)?e.fieldMeta:void 0,i=h.normalizeAnalyticsCatalogDataType(t==null?void 0:t.dataType);if((t==null?void 0:t.dataType)!==void 0&&i!=="date"&&i!=="datetime")return{status:"ineligible",reason:"non_date_filter"};if(e.customFilterPreferences)return{status:"ineligible",reason:"custom_filter"};if(e.targetColumns!==void 0&&(!Array.isArray(e.targetColumns)||e.targetColumns.length>0))return{status:"ineligible",reason:"multi_target_filter"};const o=E(e),s=B(e,o===void 0);if(s.status==="unresolved")return{status:"ineligible",reason:s.reason};const a=o||A(e,s.qualifiedFieldName);return a.status==="resolved"?{status:"eligible",kind:"field_date",qualifiedFieldName:s.qualifiedFieldName,source:a.source}:{status:"ineligible",reason:a.reason}}function T(e){if(!u(e)||e.kind!=="filter"||!u(e.filter))return{status:"ineligible",reason:"invalid_input"};const n=q(e.filter);return n.status==="ineligible"?n:n.kind==="field_date"&&u(e.compatibility)&&e.compatibility.source==="cardInlineFilter"?{status:"ineligible",reason:"card_inline_filter"}:n}function $(e){return T(e).status==="eligible"}function k(e){return`compat-filter:${e}`}function j(e){return`compat-control:${e}`}function z(e,n){return`compat-inline-filter:${e}:${n}`}function M(e,n){return`compat-card-control:${e}:${n}`}exports.getCardControlCompatInputId=M;exports.getCardInlineFilterCompatInputId=z;exports.getDashboardControlCompatInputId=j;exports.getDashboardFilterCompatInputId=k;exports.isComparisonCapableDashboardDateInputDefinition=$;exports.qualifiedEntityIdentitiesReferToSameEntity=v;exports.qualifiedFieldIdentitiesReferToSameField=D;exports.resolveDashboardDateComparisonFilterDefinition=q;exports.resolveDashboardDateComparisonInputDefinition=T;exports.selectMostQualifiedCompatibleEntityIdentity=F;exports.semanticDatasetMatchesFieldCoordinates=N;
|
package/dist/chunks/{dashboard-input-contract-Ciboc347.js → dashboard-input-contract-Vr_3ApfF.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { E as _ } from "./validators-
|
|
1
|
+
import { E as _ } from "./validators-B5t1s8oh.js";
|
|
2
2
|
function C(e, n) {
|
|
3
3
|
const t = e.split(".").map((r) => r.trim()), i = n.split(".").map((r) => r.trim());
|
|
4
4
|
if (t.length === 0 || i.length === 0 || t.some((r) => !r) || i.some((r) => !r))
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { jsxs as d, jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import { useMemo as p, useState as u, useRef as f, useEffect as b } from "react";
|
|
3
3
|
import { X as S } from "./x-CXDkqdur.js";
|
|
4
|
-
import { u as a, c as N, B as D, C as J } from "./switch-
|
|
5
|
-
import "./saved-temporal-bucket-format-
|
|
6
|
-
import "./validators-
|
|
7
|
-
import "./analyze-result-contract-
|
|
4
|
+
import { u as a, c as N, B as D, C as J } from "./switch-DnbD-yCM.js";
|
|
5
|
+
import "./saved-temporal-bucket-format-CygnBDO2.js";
|
|
6
|
+
import "./validators-B5t1s8oh.js";
|
|
7
|
+
import "./analyze-result-contract-B3agc2XU.js";
|
|
8
8
|
import "../value-format-preferences/index.js";
|
|
9
|
-
import "./index-
|
|
9
|
+
import "./index-tsB3LfTQ.js";
|
|
10
10
|
import "./appearance-runtime-provider-CjmE4gBY.js";
|
|
11
11
|
import "./appearance-context-DVXt8qjW.js";
|
|
12
12
|
import "./index-DSKR3nKn.js";
|
|
13
|
-
import "./temporal-bucket-authoring-
|
|
13
|
+
import "./temporal-bucket-authoring-CZoJV2L6.js";
|
|
14
14
|
import "./color-CJvdlFM_.js";
|
|
15
15
|
import "react-dom";
|
|
16
|
-
import "./index-
|
|
16
|
+
import "./index-oVXvCLH-.js";
|
|
17
17
|
function q() {
|
|
18
18
|
const r = a((o) => o.dashboard), c = a((o) => o.actions.setDashboard), h = a(
|
|
19
19
|
(o) => o.showDashboardJSON
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),o=require("react"),b=require("./x-B6ghREd2.cjs"),r=require("./switch-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),o=require("react"),b=require("./x-B6ghREd2.cjs"),r=require("./switch-NAbuOQNg.cjs");require("./saved-temporal-bucket-format-DNMtD77o.cjs");require("./validators-DcshgK7w.cjs");require("./analyze-result-contract-OgPk-zGu.cjs");require("../value-format-preferences/index.cjs");require("./index-DVBYvkj0.cjs");require("./appearance-runtime-provider-BgNYdUYH.cjs");require("./appearance-context-DhyjbQk1.cjs");require("./index-ByFbacH7.cjs");require("./temporal-bucket-authoring-DSpzgXHc.cjs");require("./color-CyB5o13F.cjs");require("react-dom");require("./index-B4VxBoJg.cjs");function S(){const t=r.useDashboardStore(e=>e.dashboard),d=r.useDashboardStore(e=>e.actions.setDashboard),c=r.useDashboardStore(e=>e.showDashboardJSON),h=r.useDashboardStore(e=>e.actions.setShowDashboardJSON),s=o.useMemo(()=>t?JSON.stringify(t,null,2):"",[t]),[l,n]=o.useState(s),i=o.useRef(s);return o.useEffect(()=>{s!==i.current&&(n(s),i.current=s)},[s]),a.jsxs("div",{className:r.cn("relative p-2",{hidden:!c}),children:[a.jsxs(r.Button,{variant:"secondary",size:"sm",className:"absolute right-2 top-2 z-10 h-8",onClick:()=>h(!1),children:[a.jsx(b.X,{className:"mr-2 h-4 w-4"}),"Close"]}),a.jsx("div",{className:"h-[550px] overflow-hidden",children:a.jsx(r.CodeEditor,{value:l,onValueChange:e=>{n(e);try{const u=JSON.parse(e);i.current=JSON.stringify(u,null,2),d(u)}catch{}},language:"json"})})]})}exports.default=S;
|