react-semaphor 0.1.472 → 0.1.473
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 +102 -94
- package/dist/brand-studio/index.cjs +1 -1
- package/dist/brand-studio/index.js +4 -4
- package/dist/briefings/index.js +4 -4
- package/dist/chunks/{analyze-result-contract-B3agc2XU.js → analyze-result-contract-C8s8EUL5.js} +1 -1
- package/dist/chunks/{common-types-g_1fKJLK.js → common-types-BLPy5_E0.js} +1 -1
- package/dist/chunks/{dashboard-briefing-launcher-Lw4gjW_M.js → dashboard-briefing-launcher-B0f28WrK.js} +9 -9
- package/dist/chunks/{dashboard-briefing-launcher-8vxGyexK.cjs → dashboard-briefing-launcher-BjCkA5vw.cjs} +1 -1
- package/dist/chunks/{dashboard-controls-BKR8g3M9.cjs → dashboard-controls-BRclCQEX.cjs} +1 -1
- package/dist/chunks/{dashboard-controls-CRgDlxdt.js → dashboard-controls-CMJqSLgo.js} +9 -9
- package/dist/chunks/{dashboard-filter-value-compatibility-ilbH2A31.js → dashboard-filter-value-compatibility-9W8Ckcle.js} +168 -158
- package/dist/chunks/dashboard-filter-value-compatibility-Co1dn9Bc.cjs +1 -0
- package/dist/chunks/{dashboard-input-contract-Vr_3ApfF.js → dashboard-input-contract-BrGdGFz0.js} +6 -6
- package/dist/chunks/{dashboard-json-BhhVg9mI.js → dashboard-json-1ohpjO_q.js} +7 -7
- package/dist/chunks/{dashboard-json-CUgAzrYq.cjs → dashboard-json-DmtGHdDq.cjs} +1 -1
- package/dist/chunks/{edit-dashboard-visual-DlQtYQOO.js → edit-dashboard-visual-D9oKtOo6.js} +12 -12
- package/dist/chunks/{edit-dashboard-visual-BxmanBVo.cjs → edit-dashboard-visual-DNqJHdHE.cjs} +1 -1
- package/dist/chunks/{editor-action-buttons-CRWacpxi.js → editor-action-buttons-C_B8Wzkf.js} +6 -6
- package/dist/chunks/{editor-action-buttons-DKcD0UQy.cjs → editor-action-buttons-DwI3FcSw.cjs} +1 -1
- package/dist/chunks/{index-xdqe-Zvd.cjs → index-B6zSYUN4.cjs} +167 -167
- package/dist/chunks/{index-0fmECZL2.js → index-DalKzjEZ.js} +31914 -31864
- package/dist/chunks/{index-oVXvCLH-.js → index-DsvIlrI-.js} +9 -9
- package/dist/chunks/matrix-result-contract-Bhg60NtS.cjs +1 -0
- package/dist/chunks/matrix-result-contract-BpzhImar.js +421 -0
- package/dist/chunks/{pivot-header-presentation-7XrwJYDm.js → pivot-header-presentation-Be3FyR0N.js} +2 -2
- package/dist/chunks/{pivot-result-identity-5v4hRVbc.js → pivot-result-identity-CIZXsI53.js} +1 -1
- package/dist/chunks/{pivot-result-lifecycle-O_roVguV.js → pivot-result-lifecycle-PxmbJWkm.js} +19 -19
- package/dist/chunks/{raw-temporal-contract-BEMf3avg.js → raw-temporal-contract-U8J9RlEH.js} +1 -1
- package/dist/chunks/{report-preferences-dialog-Dxt9XMpd.js → report-preferences-dialog-C9mJffNQ.js} +6 -6
- package/dist/chunks/{report-preferences-dialog-8KYKazoG.cjs → report-preferences-dialog-DGMd-eTT.cjs} +1 -1
- package/dist/chunks/{report-runtime-context-DnNbpkGo.js → report-runtime-context-DNbgCsko.js} +7 -7
- package/dist/chunks/{saved-temporal-bucket-format-CygnBDO2.js → saved-temporal-bucket-format-CHsXUPJI.js} +8 -8
- package/dist/chunks/source-entity-resolution-BDC-Qngk.cjs +1 -0
- package/dist/chunks/source-entity-resolution-ugN3sZUk.js +781 -0
- package/dist/chunks/{switch-CQN9Hzho.cjs → switch-B4eH4guz.cjs} +13 -13
- package/dist/chunks/{switch-n2yUNY8i.js → switch-D20CIzj6.js} +1460 -1455
- package/dist/chunks/{temporal-bucket-CUKJktCl.js → temporal-bucket-CtP7hKLa.js} +12 -12
- package/dist/chunks/{temporal-bucket-authoring-CZoJV2L6.js → temporal-bucket-authoring-DJ9kK2wD.js} +3 -3
- package/dist/chunks/{temporal-bucket-contract-Cno9TlYr.js → temporal-bucket-contract-CZl5D7FZ.js} +1 -1
- package/dist/chunks/{token-types-W3EHNW-D.js → token-types-DfDtCqlw.js} +1 -1
- package/dist/chunks/{update-policy-kRNJwwUV.js → update-policy-BybMiM61.js} +1 -1
- package/dist/chunks/{validators-B5t1s8oh.js → validators-D-T-2HOR.js} +50 -50
- package/dist/dashboard/index.cjs +1 -1
- package/dist/dashboard/index.js +2 -2
- package/dist/dashboard-authoring/index.cjs +3 -3
- package/dist/dashboard-authoring/index.js +355 -341
- package/dist/data-app-builder/index.cjs +1 -1
- package/dist/data-app-builder/index.js +2 -2
- package/dist/data-app-codegen/index.js +2 -2
- package/dist/data-app-codegen-node/index.js +3 -3
- package/dist/data-app-sdk/index.js +3 -3
- package/dist/data-app-sdk-adapters/index.js +2 -2
- package/dist/data-app-sdk-validation/index.js +9 -9
- package/dist/format-utils/index.js +10 -10
- package/dist/index.cjs +1 -1
- package/dist/index.js +14 -14
- package/dist/report-runtime-context/index.js +2 -2
- package/dist/surfboard/index.cjs +1 -1
- package/dist/surfboard/index.js +3 -3
- package/dist/types/analytics-protocol.d.ts +141 -0
- package/dist/types/index.js +4 -4
- package/dist/types/main.d.ts +7 -0
- package/package.json +1 -1
- package/dist/chunks/dashboard-filter-value-compatibility-Dmh-NaPK.cjs +0 -1
- package/dist/chunks/matrix-result-contract-DoU9diAh.js +0 -822
- package/dist/chunks/matrix-result-contract-SrzyG_KQ.cjs +0 -1
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
var K = Object.defineProperty;
|
|
2
2
|
var Q = (e, n, t) => n in e ? K(e, n, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[n] = t;
|
|
3
|
-
var
|
|
4
|
-
import { ai as
|
|
5
|
-
import "./analyze-result-contract-
|
|
3
|
+
var j = (e, n, t) => Q(e, typeof n != "symbol" ? n + "" : n, t);
|
|
4
|
+
import { ai as y, ak as Y, j as P, C as $, F as C } from "./validators-D-T-2HOR.js";
|
|
5
|
+
import "./analyze-result-contract-C8s8EUL5.js";
|
|
6
6
|
import "../value-format-preferences/index.js";
|
|
7
|
+
import { l as G } from "./source-entity-resolution-ugN3sZUk.js";
|
|
7
8
|
function c(e) {
|
|
8
9
|
return typeof e == "string" && e.trim().length > 0 ? e.trim() : null;
|
|
9
10
|
}
|
|
@@ -19,7 +20,7 @@ function X(e) {
|
|
|
19
20
|
s && t ? `${s}.${t}.${n}` : null
|
|
20
21
|
]) : [];
|
|
21
22
|
}
|
|
22
|
-
function
|
|
23
|
+
function H(e) {
|
|
23
24
|
const n = c(e.table) || c(e.tableName);
|
|
24
25
|
return J([
|
|
25
26
|
c(e.name),
|
|
@@ -44,25 +45,25 @@ function Z(e, n) {
|
|
|
44
45
|
const a = c(e.connectionId), o = c(n.connectionId);
|
|
45
46
|
return !!(a && o && a !== o);
|
|
46
47
|
}
|
|
47
|
-
function
|
|
48
|
+
function R(e, n = !1) {
|
|
48
49
|
return c(e.table) || c(e.tableName) || (e.type !== "dataset" || n ? c(e.name) : null);
|
|
49
50
|
}
|
|
50
|
-
function
|
|
51
|
+
function x(e) {
|
|
51
52
|
return c(e.catalog) || c(e.database) || c(e.databaseName);
|
|
52
53
|
}
|
|
53
|
-
function
|
|
54
|
+
function w(e) {
|
|
54
55
|
return c(e.schema) || c(e.schemaName);
|
|
55
56
|
}
|
|
56
57
|
function T(e) {
|
|
57
58
|
return e.length === 1 ? e[0] : void 0;
|
|
58
59
|
}
|
|
59
|
-
function
|
|
60
|
-
const t =
|
|
60
|
+
function S(e, n) {
|
|
61
|
+
const t = R(n, !0), s = x(n), i = w(n);
|
|
61
62
|
if (!(!t || !s && !i))
|
|
62
63
|
return T(
|
|
63
64
|
e.filter((d) => {
|
|
64
65
|
const a = d;
|
|
65
|
-
return !(
|
|
66
|
+
return !(R(a) !== t || s && x(a) !== s || i && w(a) !== i);
|
|
66
67
|
})
|
|
67
68
|
);
|
|
68
69
|
}
|
|
@@ -97,33 +98,33 @@ function E(e, n) {
|
|
|
97
98
|
), s.length === 1)
|
|
98
99
|
return s[0];
|
|
99
100
|
}
|
|
100
|
-
if (!!(
|
|
101
|
-
return
|
|
101
|
+
if (!!(R(n, !0) && (x(n) || w(n))))
|
|
102
|
+
return S(t, n);
|
|
102
103
|
if (s.length > 1)
|
|
103
104
|
return;
|
|
104
|
-
const d =
|
|
105
|
+
const d = H(n);
|
|
105
106
|
if (d.length === 0)
|
|
106
107
|
return;
|
|
107
|
-
const a = t.filter((o) =>
|
|
108
|
+
const a = t.filter((o) => H(
|
|
108
109
|
o
|
|
109
110
|
).some(
|
|
110
111
|
(r) => d.includes(r)
|
|
111
112
|
));
|
|
112
113
|
return T(a);
|
|
113
114
|
}
|
|
114
|
-
function
|
|
115
|
+
function A(e, n) {
|
|
115
116
|
const t = E(e, n);
|
|
116
117
|
return t ? { ...n, ...t } : n;
|
|
117
118
|
}
|
|
118
|
-
function
|
|
119
|
+
function Ne(e, n) {
|
|
119
120
|
const t = n || [];
|
|
120
121
|
return t.length === 0 ? e : {
|
|
121
122
|
...e,
|
|
122
|
-
baseEntity:
|
|
123
|
+
baseEntity: A(t, e.baseEntity),
|
|
123
124
|
joins: e.joins.map((s) => ({
|
|
124
125
|
...s,
|
|
125
|
-
source:
|
|
126
|
-
target:
|
|
126
|
+
source: A(t, s.source),
|
|
127
|
+
target: A(t, s.target)
|
|
127
128
|
}))
|
|
128
129
|
};
|
|
129
130
|
}
|
|
@@ -138,35 +139,44 @@ function Ae(e, n) {
|
|
|
138
139
|
!E(n, i) && !E(s, i) && s.push(i);
|
|
139
140
|
}), s;
|
|
140
141
|
}
|
|
141
|
-
function
|
|
142
|
+
function I(e) {
|
|
142
143
|
return !!e && typeof e == "object" && !Array.isArray(e);
|
|
143
144
|
}
|
|
144
145
|
function k(e) {
|
|
145
|
-
return
|
|
146
|
+
return I(e) && typeof e.name == "string";
|
|
146
147
|
}
|
|
147
|
-
function
|
|
148
|
-
return !
|
|
148
|
+
function B(e) {
|
|
149
|
+
return !I(e) || e.kind !== "semantic" && e.kind !== "physical" || (e.kind === "semantic" ? [e.datasetId, e.datasetName, e.connectionId] : [e.databaseName, e.schemaName]).some(
|
|
149
150
|
(t) => t !== void 0 && typeof t != "string"
|
|
150
|
-
) ? !1 :
|
|
151
|
+
) ? !1 : P(
|
|
151
152
|
e
|
|
152
153
|
);
|
|
153
154
|
}
|
|
154
155
|
function M(e, n) {
|
|
155
156
|
var r, g;
|
|
156
|
-
const t = Array.isArray(n == null ? void 0 : n.selectedEntities) ? n.selectedEntities.filter(k) : void 0, s = E(t, e), i = s ? { ...e, ...s } : e, d =
|
|
157
|
+
const t = Array.isArray(n == null ? void 0 : n.selectedEntities) ? n.selectedEntities.filter(k) : void 0, s = E(t, e), i = s ? { ...e, ...s } : e, d = "domainId" in i && typeof i.domainId == "string" && !!i.domainId.trim();
|
|
157
158
|
if ((n == null ? void 0 : n.mode) === "semanticDomain" && !d)
|
|
158
159
|
return;
|
|
159
|
-
if ((n == null ? void 0 : n.mode) !== "database" && i.type === "dataset"
|
|
160
|
-
const
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
160
|
+
if ((n == null ? void 0 : n.mode) !== "database" && i.type === "dataset") {
|
|
161
|
+
const u = G(
|
|
162
|
+
{
|
|
163
|
+
entities: [i],
|
|
164
|
+
semanticDomainId: n == null ? void 0 : n.semanticDomainId,
|
|
165
|
+
connectionId: n == null ? void 0 : n.connectionId,
|
|
166
|
+
fieldEntityType: "dataset"
|
|
167
|
+
},
|
|
168
|
+
{ includePhysicalDatasets: !0 }
|
|
169
|
+
);
|
|
170
|
+
if (u.kind === "resolved") {
|
|
171
|
+
const f = "label" in i && typeof i.label == "string" ? i.label : void 0;
|
|
172
|
+
return {
|
|
173
|
+
...u.source,
|
|
174
|
+
...f ? { label: f } : {}
|
|
175
|
+
};
|
|
176
|
+
}
|
|
169
177
|
}
|
|
178
|
+
if ((n == null ? void 0 : n.mode) === "semanticDomain")
|
|
179
|
+
return;
|
|
170
180
|
const a = i.connectionId || (n == null ? void 0 : n.connectionId), o = i.type === "dataset" && "table" in i && i.table ? i.table : i.name;
|
|
171
181
|
if (!a || !o)
|
|
172
182
|
return;
|
|
@@ -179,9 +189,9 @@ function M(e, n) {
|
|
|
179
189
|
schemaName: i.schema || ((g = n == null ? void 0 : n.dbSelection) == null ? void 0 : g.schema),
|
|
180
190
|
dialect: i.dialect
|
|
181
191
|
};
|
|
182
|
-
return
|
|
192
|
+
return B(l) ? l : void 0;
|
|
183
193
|
}
|
|
184
|
-
function
|
|
194
|
+
function ee(e, n) {
|
|
185
195
|
var o, l;
|
|
186
196
|
const t = M(e, n);
|
|
187
197
|
if (!t) return;
|
|
@@ -193,15 +203,15 @@ function ne(e, n) {
|
|
|
193
203
|
} : void 0;
|
|
194
204
|
return { source: t, ...a ? { executionTable: a } : {} };
|
|
195
205
|
}
|
|
196
|
-
function
|
|
197
|
-
const n =
|
|
206
|
+
function ne(e) {
|
|
207
|
+
const n = I(e.dataSource) ? e.dataSource : void 0;
|
|
198
208
|
if (typeof e.sql == "string" && e.sql.trim()) {
|
|
199
209
|
const a = [], o = Array.isArray(n == null ? void 0 : n.selectedEntities) ? n.selectedEntities : [];
|
|
200
210
|
for (const l of o) {
|
|
201
211
|
if (!k(l)) continue;
|
|
202
|
-
const r =
|
|
212
|
+
const r = ee(l, n);
|
|
203
213
|
r && !a.some(
|
|
204
|
-
(g) =>
|
|
214
|
+
(g) => y(
|
|
205
215
|
g.source,
|
|
206
216
|
r.source
|
|
207
217
|
)
|
|
@@ -213,15 +223,15 @@ function te(e) {
|
|
|
213
223
|
pinnedCatalogSources: a
|
|
214
224
|
};
|
|
215
225
|
}
|
|
216
|
-
if (!
|
|
226
|
+
if (!I(e.config))
|
|
217
227
|
return { cardId: e.id, kind: "unconfigured" };
|
|
218
|
-
const t = [], s =
|
|
219
|
-
|
|
220
|
-
const d =
|
|
228
|
+
const t = [], s = I(e.config.matrixIntent) ? e.config.matrixIntent : void 0, i = e.type === "matrixTable" ? (s == null ? void 0 : s.kind) === "matrix" ? s.source : e.config.source : void 0;
|
|
229
|
+
B(i) && t.push(i);
|
|
230
|
+
const d = I(e.config.joinPlan) ? e.config.joinPlan : void 0;
|
|
221
231
|
if (d) {
|
|
222
232
|
const a = Array.isArray(d.joins) ? d.joins : [], o = [d.baseEntity];
|
|
223
233
|
for (const r of a)
|
|
224
|
-
|
|
234
|
+
I(r) && o.push(r.source, r.target);
|
|
225
235
|
let l = !1;
|
|
226
236
|
for (const r of o) {
|
|
227
237
|
if (!k(r)) {
|
|
@@ -241,7 +251,7 @@ function te(e) {
|
|
|
241
251
|
}
|
|
242
252
|
if (!t.length && !d && e.type !== "matrixTable") {
|
|
243
253
|
const a = e.config.queryBaseSource;
|
|
244
|
-
|
|
254
|
+
B(a) && t.push(a);
|
|
245
255
|
}
|
|
246
256
|
return {
|
|
247
257
|
cardId: e.id,
|
|
@@ -249,15 +259,15 @@ function te(e) {
|
|
|
249
259
|
executableSources: Y(t)
|
|
250
260
|
};
|
|
251
261
|
}
|
|
252
|
-
function
|
|
262
|
+
function te(e, n) {
|
|
253
263
|
return (e.kind === "config" ? e.executableSources : e.kind === "sql" ? e.pinnedCatalogSources.map((s) => s.source) : []).some(
|
|
254
|
-
(s) =>
|
|
264
|
+
(s) => y(s, n)
|
|
255
265
|
);
|
|
256
266
|
}
|
|
257
267
|
function Ce(e, n) {
|
|
258
268
|
if (e.kind === "config")
|
|
259
269
|
return e.executableSources.find(
|
|
260
|
-
(t) =>
|
|
270
|
+
(t) => y(t, n)
|
|
261
271
|
);
|
|
262
272
|
}
|
|
263
273
|
function Re(e, n) {
|
|
@@ -267,10 +277,10 @@ function Re(e, n) {
|
|
|
267
277
|
function U(e, n) {
|
|
268
278
|
if (e.kind === "sql")
|
|
269
279
|
return e.pinnedCatalogSources.find(
|
|
270
|
-
(t) =>
|
|
280
|
+
(t) => y(t.source, n)
|
|
271
281
|
);
|
|
272
282
|
}
|
|
273
|
-
function
|
|
283
|
+
function L(e) {
|
|
274
284
|
const n = /* @__PURE__ */ new Set();
|
|
275
285
|
for (const t of [e.name, e.sourceField]) {
|
|
276
286
|
if (!t) continue;
|
|
@@ -283,20 +293,20 @@ function j(e) {
|
|
|
283
293
|
return n;
|
|
284
294
|
}
|
|
285
295
|
function V(e, n) {
|
|
286
|
-
const t =
|
|
296
|
+
const t = C(e), s = C(n);
|
|
287
297
|
return t === "unknown" || s === "unknown" ? !1 : (t === "date" || t === "datetime") && (s === "date" || s === "datetime") ? !0 : t === s;
|
|
288
298
|
}
|
|
289
|
-
function
|
|
290
|
-
return
|
|
299
|
+
function ie(e, n) {
|
|
300
|
+
return y(e.field.source, n.field.source) && $(e.field.name) === $(n.field.name) && $(e.field.sourceField || e.field.name) === $(n.field.sourceField || n.field.name);
|
|
291
301
|
}
|
|
292
|
-
function
|
|
302
|
+
function se(e, n) {
|
|
293
303
|
if (e.kind !== "field") return !1;
|
|
294
|
-
const t =
|
|
304
|
+
const t = L(n), s = L(e.field);
|
|
295
305
|
return V(n.dataType, e.field.dataType) && [...s].some((i) => t.has(i));
|
|
296
306
|
}
|
|
297
307
|
function xe(e) {
|
|
298
308
|
const n = e.candidates.filter(
|
|
299
|
-
(t) =>
|
|
309
|
+
(t) => se(
|
|
300
310
|
t,
|
|
301
311
|
e.logicalValueField
|
|
302
312
|
)
|
|
@@ -310,16 +320,16 @@ function we(e) {
|
|
|
310
320
|
e.logicalValueField.dataType,
|
|
311
321
|
t.field.dataType
|
|
312
322
|
) || n.some(
|
|
313
|
-
(s) =>
|
|
323
|
+
(s) => ie(s, t)
|
|
314
324
|
) || n.push(t);
|
|
315
325
|
return n.length === 1 ? { status: "matched", target: n[0] } : n.length > 1 ? { status: "ambiguous" } : { status: "notApplicable" };
|
|
316
326
|
}
|
|
317
|
-
const
|
|
318
|
-
function
|
|
319
|
-
return e != null && e.trim() ?
|
|
327
|
+
const re = /\{\{-?\s*filters\s*\|\s*where\s*-?\}\}/i, oe = /\{\{-?\s*filters\s*\|\s*and\s*-?\}\}/i, ae = /\bwhere\b/i;
|
|
328
|
+
function de(e) {
|
|
329
|
+
return e != null && e.trim() ? re.test(e) || oe.test(e) : !1;
|
|
320
330
|
}
|
|
321
331
|
function Be(e) {
|
|
322
|
-
return !(e != null && e.trim()) ||
|
|
332
|
+
return !(e != null && e.trim()) || de(e) ? null : ae.test(e) ? {
|
|
323
333
|
helper: "{{ filters | and }}",
|
|
324
334
|
description: "For queries with an existing WHERE clause."
|
|
325
335
|
} : {
|
|
@@ -327,7 +337,7 @@ function Be(e) {
|
|
|
327
337
|
description: "For queries without a WHERE clause."
|
|
328
338
|
};
|
|
329
339
|
}
|
|
330
|
-
function
|
|
340
|
+
function ce(e) {
|
|
331
341
|
return (e.field.sourceField || e.field.name).trim() || void 0;
|
|
332
342
|
}
|
|
333
343
|
function Me(e) {
|
|
@@ -336,7 +346,7 @@ function Me(e) {
|
|
|
336
346
|
const n = U(
|
|
337
347
|
e.inventory,
|
|
338
348
|
e.target.field.source
|
|
339
|
-
), t =
|
|
349
|
+
), t = ce(e.target);
|
|
340
350
|
if (!n || !t) return { status: "ineligible" };
|
|
341
351
|
if (n.executionTable) {
|
|
342
352
|
const a = [
|
|
@@ -360,7 +370,7 @@ function Me(e) {
|
|
|
360
370
|
), d = [];
|
|
361
371
|
for (const a of i)
|
|
362
372
|
d.some(
|
|
363
|
-
(o) =>
|
|
373
|
+
(o) => y(o, a.field.source)
|
|
364
374
|
) || d.push(a.field.source);
|
|
365
375
|
return d.length > 1 ? { status: "ineligible" } : {
|
|
366
376
|
status: "eligible",
|
|
@@ -368,14 +378,14 @@ function Me(e) {
|
|
|
368
378
|
executionIdentifier: t
|
|
369
379
|
};
|
|
370
380
|
}
|
|
371
|
-
class
|
|
381
|
+
class le extends Error {
|
|
372
382
|
constructor(t) {
|
|
373
383
|
super(t.map((s) => s.message).join(" "));
|
|
374
|
-
|
|
384
|
+
j(this, "issues");
|
|
375
385
|
this.name = "DashboardFilterMappingContractError", this.issues = t;
|
|
376
386
|
}
|
|
377
387
|
}
|
|
378
|
-
const
|
|
388
|
+
const fe = {
|
|
379
389
|
string: !0,
|
|
380
390
|
number: !0,
|
|
381
391
|
boolean: !0,
|
|
@@ -391,7 +401,7 @@ function m(e) {
|
|
|
391
401
|
function F(e) {
|
|
392
402
|
return Array.isArray(e) && e.every((n) => typeof n == "string");
|
|
393
403
|
}
|
|
394
|
-
function
|
|
404
|
+
function ue(e) {
|
|
395
405
|
if (!m(e)) return !1;
|
|
396
406
|
switch (e.kind) {
|
|
397
407
|
case "allSheets":
|
|
@@ -408,13 +418,13 @@ function me(e) {
|
|
|
408
418
|
return !1;
|
|
409
419
|
}
|
|
410
420
|
}
|
|
411
|
-
function
|
|
421
|
+
function me(e) {
|
|
412
422
|
return e === "shared" || e === "perSheet" || e === "perCard" || e === "perDocumentSection";
|
|
413
423
|
}
|
|
414
|
-
function
|
|
424
|
+
function he(e) {
|
|
415
425
|
return m(e) ? h(e.id) && h(e.column) && h(e.dataType) : !1;
|
|
416
426
|
}
|
|
417
|
-
function
|
|
427
|
+
function ge(e, n, t, s) {
|
|
418
428
|
var o;
|
|
419
429
|
if (!m(n)) {
|
|
420
430
|
s.push({
|
|
@@ -430,7 +440,7 @@ function be(e, n, t, s) {
|
|
|
430
440
|
["valueField", n.valueField],
|
|
431
441
|
["searchField", n.searchField]
|
|
432
442
|
];
|
|
433
|
-
if (!m(i) || i.kind !== "semantic" && i.kind !== "physical" || !
|
|
443
|
+
if (!m(i) || i.kind !== "semantic" && i.kind !== "physical" || !P(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))) {
|
|
434
444
|
s.push({
|
|
435
445
|
code: "invalid_option_source",
|
|
436
446
|
path: t,
|
|
@@ -440,7 +450,7 @@ function be(e, n, t, s) {
|
|
|
440
450
|
return;
|
|
441
451
|
}
|
|
442
452
|
for (const [l, r] of d)
|
|
443
|
-
r !== void 0 && m(r) && (!h(r.name) || r.source !== void 0 && !
|
|
453
|
+
r !== void 0 && m(r) && (!h(r.name) || r.source !== void 0 && !y(
|
|
444
454
|
r.source,
|
|
445
455
|
i
|
|
446
456
|
)) && s.push({
|
|
@@ -450,7 +460,7 @@ function be(e, n, t, s) {
|
|
|
450
460
|
inputId: e
|
|
451
461
|
});
|
|
452
462
|
for (const [l, r] of ((o = n.disambiguationFields) == null ? void 0 : o.entries()) || [])
|
|
453
|
-
(!m(r) || !h(r.name) || r.source !== void 0 && !
|
|
463
|
+
(!m(r) || !h(r.name) || r.source !== void 0 && !y(
|
|
454
464
|
r.source,
|
|
455
465
|
i
|
|
456
466
|
)) && s.push({
|
|
@@ -469,7 +479,7 @@ function be(e, n, t, s) {
|
|
|
469
479
|
inputId: e
|
|
470
480
|
});
|
|
471
481
|
}
|
|
472
|
-
function
|
|
482
|
+
function be(e, n, t, s, i, d) {
|
|
473
483
|
var r;
|
|
474
484
|
if (h(n.bindingId) || i.push({
|
|
475
485
|
code: "invalid_binding_id",
|
|
@@ -489,7 +499,7 @@ function pe(e, n, t, s, i, d) {
|
|
|
489
499
|
return;
|
|
490
500
|
}
|
|
491
501
|
const a = n.target.field;
|
|
492
|
-
if (!h(a == null ? void 0 : a.name) || !a.source || a.source.kind !== "semantic" && a.source.kind !== "physical" || !
|
|
502
|
+
if (!h(a == null ? void 0 : a.name) || !a.source || a.source.kind !== "semantic" && a.source.kind !== "physical" || !P(a.source)) {
|
|
493
503
|
i.push({
|
|
494
504
|
code: "invalid_target_field",
|
|
495
505
|
path: `${t}.target.field`,
|
|
@@ -501,7 +511,7 @@ function pe(e, n, t, s, i, d) {
|
|
|
501
511
|
return;
|
|
502
512
|
}
|
|
503
513
|
if (Object.prototype.hasOwnProperty.call(
|
|
504
|
-
|
|
514
|
+
fe,
|
|
505
515
|
a.dataType
|
|
506
516
|
) || i.push({
|
|
507
517
|
code: "unknown_target_data_type",
|
|
@@ -530,8 +540,8 @@ function pe(e, n, t, s, i, d) {
|
|
|
530
540
|
});
|
|
531
541
|
return;
|
|
532
542
|
}
|
|
533
|
-
const l =
|
|
534
|
-
(l.kind === "unconfigured" || !
|
|
543
|
+
const l = ne(o);
|
|
544
|
+
(l.kind === "unconfigured" || !te(l, a.source)) && i.push({
|
|
535
545
|
code: "unavailable_card_source",
|
|
536
546
|
path: `${t}.target.field.source`,
|
|
537
547
|
message: `${t}.target field source is not declared by card '${o.id}'.`,
|
|
@@ -540,7 +550,7 @@ function pe(e, n, t, s, i, d) {
|
|
|
540
550
|
bindingId: n.bindingId
|
|
541
551
|
});
|
|
542
552
|
}
|
|
543
|
-
function
|
|
553
|
+
function pe(e, n, t, s, i, d) {
|
|
544
554
|
if (n === void 0) return;
|
|
545
555
|
if (!m(n) || n.kind !== "cardMappings" || !Array.isArray(n.cards)) {
|
|
546
556
|
i.push({
|
|
@@ -583,7 +593,7 @@ function Ie(e, n, t, s, i, d) {
|
|
|
583
593
|
});
|
|
584
594
|
return;
|
|
585
595
|
}
|
|
586
|
-
o.kind === "bound" ?
|
|
596
|
+
o.kind === "bound" ? be(
|
|
587
597
|
e,
|
|
588
598
|
o,
|
|
589
599
|
r,
|
|
@@ -615,12 +625,12 @@ function ye({
|
|
|
615
625
|
path: "dashboard.inputs",
|
|
616
626
|
message: "dashboard.inputs must be an array when present."
|
|
617
627
|
}), { ok: !1, inputs: o, issues: i }) : ((Array.isArray(e) ? e : []).forEach((r, g) => {
|
|
618
|
-
const
|
|
619
|
-
if (!m(r) || r.kind !== "filter" && r.kind !== "control" || !h(r.id) || !h(r.label) || !h(r.variableName) || !
|
|
628
|
+
const u = `dashboard.inputs[${g}]`;
|
|
629
|
+
if (!m(r) || r.kind !== "filter" && r.kind !== "control" || !h(r.id) || !h(r.label) || !h(r.variableName) || !ue(r.scope) || !me(r.runtimeScope)) {
|
|
620
630
|
i.push({
|
|
621
631
|
code: "invalid_input",
|
|
622
|
-
path:
|
|
623
|
-
message: `${
|
|
632
|
+
path: u,
|
|
633
|
+
message: `${u} must be a complete filter or control Dashboard Input envelope.`,
|
|
624
634
|
inputId: m(r) && typeof r.id == "string" ? r.id : void 0
|
|
625
635
|
});
|
|
626
636
|
return;
|
|
@@ -628,74 +638,74 @@ function ye({
|
|
|
628
638
|
if (r.kind === "control" && !m(r.control)) {
|
|
629
639
|
i.push({
|
|
630
640
|
code: "invalid_input",
|
|
631
|
-
path: `${
|
|
632
|
-
message: `${
|
|
641
|
+
path: `${u}.control`,
|
|
642
|
+
message: `${u}.control must be a control definition.`,
|
|
633
643
|
inputId: r.id
|
|
634
644
|
});
|
|
635
645
|
return;
|
|
636
646
|
}
|
|
637
|
-
const
|
|
638
|
-
if (
|
|
639
|
-
o.push(
|
|
647
|
+
const f = r;
|
|
648
|
+
if (f.kind === "control") {
|
|
649
|
+
o.push(f);
|
|
640
650
|
return;
|
|
641
651
|
}
|
|
642
|
-
const
|
|
643
|
-
if (_ &&
|
|
652
|
+
const v = f.filter, p = f.filterReference, _ = v !== void 0, z = !!p;
|
|
653
|
+
if (_ && z) {
|
|
644
654
|
i.push({
|
|
645
655
|
code: "both_filter_definitions",
|
|
646
|
-
path:
|
|
647
|
-
message: `${
|
|
648
|
-
inputId:
|
|
656
|
+
path: u,
|
|
657
|
+
message: `${u} must contain either filter or filterReference, not both.`,
|
|
658
|
+
inputId: f.id
|
|
649
659
|
});
|
|
650
660
|
return;
|
|
651
661
|
}
|
|
652
|
-
if (!_ && !
|
|
662
|
+
if (!_ && !z) {
|
|
653
663
|
i.push({
|
|
654
664
|
code: "missing_filter_definition",
|
|
655
|
-
path:
|
|
656
|
-
message: `${
|
|
657
|
-
inputId:
|
|
665
|
+
path: u,
|
|
666
|
+
message: `${u} must contain filter or filterReference.`,
|
|
667
|
+
inputId: f.id
|
|
658
668
|
});
|
|
659
669
|
return;
|
|
660
670
|
}
|
|
661
|
-
if (_ && !
|
|
671
|
+
if (_ && !he(v)) {
|
|
662
672
|
i.push({
|
|
663
673
|
code: "invalid_input",
|
|
664
|
-
path: `${
|
|
665
|
-
message: `${
|
|
666
|
-
inputId:
|
|
674
|
+
path: `${u}.filter`,
|
|
675
|
+
message: `${u}.filter must be a complete dashboard filter definition.`,
|
|
676
|
+
inputId: f.id
|
|
667
677
|
});
|
|
668
678
|
return;
|
|
669
679
|
}
|
|
670
680
|
let b, D;
|
|
671
681
|
if (_)
|
|
672
|
-
b =
|
|
682
|
+
b = v, D = "embedded";
|
|
673
683
|
else {
|
|
674
684
|
if ((p == null ? void 0 : p.kind) !== "dashboardFilter") {
|
|
675
685
|
i.push({
|
|
676
686
|
code: "invalid_filter_reference",
|
|
677
|
-
path: `${
|
|
678
|
-
message: `${
|
|
679
|
-
inputId:
|
|
687
|
+
path: `${u}.filterReference.kind`,
|
|
688
|
+
message: `${u}.filterReference.kind must be 'dashboardFilter'.`,
|
|
689
|
+
inputId: f.id
|
|
680
690
|
});
|
|
681
691
|
return;
|
|
682
692
|
}
|
|
683
|
-
const
|
|
684
|
-
if (b =
|
|
693
|
+
const N = typeof (p == null ? void 0 : p.filterId) == "string" ? p.filterId : void 0;
|
|
694
|
+
if (b = N ? d.get(N) : void 0, D = "dashboardFilter", !b) {
|
|
685
695
|
i.push({
|
|
686
696
|
code: "orphaned_filter_reference",
|
|
687
|
-
path: `${
|
|
688
|
-
message: `${
|
|
689
|
-
inputId:
|
|
697
|
+
path: `${u}.filterReference.filterId`,
|
|
698
|
+
message: `${u}.filterReference cannot resolve dashboard filter '${N || ""}'.`,
|
|
699
|
+
inputId: f.id
|
|
690
700
|
});
|
|
691
701
|
return;
|
|
692
702
|
}
|
|
693
703
|
if (b.kind === "global-date") {
|
|
694
704
|
i.push({
|
|
695
705
|
code: "global_date_reference",
|
|
696
|
-
path: `${
|
|
697
|
-
message: `${
|
|
698
|
-
inputId:
|
|
706
|
+
path: `${u}.filterReference`,
|
|
707
|
+
message: `${u}.filterReference cannot reference the Global Date filter.`,
|
|
708
|
+
inputId: f.id
|
|
699
709
|
});
|
|
700
710
|
return;
|
|
701
711
|
}
|
|
@@ -703,71 +713,71 @@ function ye({
|
|
|
703
713
|
if (q) {
|
|
704
714
|
i.push({
|
|
705
715
|
code: "duplicate_filter_reference",
|
|
706
|
-
path: `${
|
|
707
|
-
message: `${
|
|
708
|
-
inputId:
|
|
716
|
+
path: `${u}.filterReference.filterId`,
|
|
717
|
+
message: `${u}.filterReference duplicates dashboard filter '${b.id}' already owned by Dashboard Input '${q}'.`,
|
|
718
|
+
inputId: f.id
|
|
709
719
|
});
|
|
710
720
|
return;
|
|
711
721
|
}
|
|
712
|
-
l.set(b.id,
|
|
722
|
+
l.set(b.id, f.id);
|
|
713
723
|
}
|
|
714
724
|
if (!b) return;
|
|
715
|
-
if (
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
`${
|
|
725
|
+
if (f.optionSource !== void 0 && ge(
|
|
726
|
+
f.id,
|
|
727
|
+
f.optionSource,
|
|
728
|
+
`${u}.optionSource`,
|
|
719
729
|
i
|
|
720
|
-
),
|
|
730
|
+
), f.application && b.kind === "global-date") {
|
|
721
731
|
i.push({
|
|
722
732
|
code: "global_date_reference",
|
|
723
|
-
path: `${
|
|
724
|
-
message: `${
|
|
725
|
-
inputId:
|
|
733
|
+
path: `${u}.application`,
|
|
734
|
+
message: `${u}.application cannot map the Global Date filter.`,
|
|
735
|
+
inputId: f.id
|
|
726
736
|
});
|
|
727
737
|
return;
|
|
728
738
|
}
|
|
729
|
-
|
|
739
|
+
f.application && f.scope.kind !== "allSheets" && f.scope.kind !== "sheets" && i.push({
|
|
730
740
|
code: "unsupported_mapped_scope",
|
|
731
|
-
path: `${
|
|
732
|
-
message: `${
|
|
733
|
-
inputId:
|
|
734
|
-
}),
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
`${
|
|
741
|
+
path: `${u}.scope`,
|
|
742
|
+
message: `${u}.scope must be allSheets or sheets when cardMappings are present.`,
|
|
743
|
+
inputId: f.id
|
|
744
|
+
}), pe(
|
|
745
|
+
f.id,
|
|
746
|
+
f.application,
|
|
747
|
+
`${u}.application`,
|
|
738
748
|
a,
|
|
739
749
|
i,
|
|
740
750
|
s
|
|
741
751
|
);
|
|
742
752
|
const {
|
|
743
|
-
filter:
|
|
744
|
-
filterReference:
|
|
753
|
+
filter: _e,
|
|
754
|
+
filterReference: Fe,
|
|
745
755
|
// A reference-backed authored input must shadow the generated
|
|
746
756
|
// dashboard-filter compatibility input. Older writers may have copied
|
|
747
757
|
// the compatibility marker onto the reference; never preserve it.
|
|
748
758
|
compatibility: O,
|
|
749
759
|
...W
|
|
750
|
-
} =
|
|
760
|
+
} = f;
|
|
751
761
|
o.push({
|
|
752
762
|
...W,
|
|
753
763
|
filter: b,
|
|
754
764
|
..._ && O ? { compatibility: O } : {},
|
|
755
|
-
...
|
|
756
|
-
optionSource:
|
|
765
|
+
...f.optionSource ? {
|
|
766
|
+
optionSource: f.optionSource
|
|
757
767
|
} : {},
|
|
758
768
|
definitionOrigin: D
|
|
759
769
|
});
|
|
760
770
|
}), i.length ? { ok: !1, inputs: o, issues: i } : { ok: !0, inputs: o });
|
|
761
771
|
}
|
|
762
|
-
function
|
|
772
|
+
function Pe(e) {
|
|
763
773
|
const n = ye(e);
|
|
764
|
-
if (!n.ok) throw new
|
|
774
|
+
if (!n.ok) throw new le(n.issues);
|
|
765
775
|
return n.inputs;
|
|
766
776
|
}
|
|
767
|
-
function
|
|
777
|
+
function ze(e = () => globalThis.crypto.randomUUID()) {
|
|
768
778
|
return e();
|
|
769
779
|
}
|
|
770
|
-
const
|
|
780
|
+
const Ie = {
|
|
771
781
|
date: /* @__PURE__ */ new Set([
|
|
772
782
|
"between",
|
|
773
783
|
"not between",
|
|
@@ -806,31 +816,31 @@ const $e = {
|
|
|
806
816
|
]),
|
|
807
817
|
boolean: /* @__PURE__ */ new Set(["=", "!=", "in", "not in", "is null", "is not null"])
|
|
808
818
|
};
|
|
809
|
-
function
|
|
810
|
-
const n =
|
|
819
|
+
function $e(e) {
|
|
820
|
+
const n = C(e);
|
|
811
821
|
return n === "number" || n === "boolean" ? n : n === "date" || n === "datetime" ? "date" : "string";
|
|
812
822
|
}
|
|
813
823
|
function Oe(e, n) {
|
|
814
|
-
return typeof n != "string" ? !1 : $e
|
|
824
|
+
return typeof n != "string" ? !1 : Ie[$e(e)].has(n);
|
|
815
825
|
}
|
|
816
826
|
export {
|
|
817
|
-
|
|
827
|
+
le as D,
|
|
818
828
|
Re as a,
|
|
819
|
-
|
|
829
|
+
ne as b,
|
|
820
830
|
U as c,
|
|
821
|
-
|
|
822
|
-
|
|
831
|
+
te as d,
|
|
832
|
+
se as e,
|
|
823
833
|
Ce as f,
|
|
824
834
|
we as g,
|
|
825
|
-
|
|
835
|
+
de as h,
|
|
826
836
|
Be as i,
|
|
827
837
|
Me as j,
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
838
|
+
Pe as k,
|
|
839
|
+
ze as l,
|
|
840
|
+
$e as m,
|
|
831
841
|
ye as n,
|
|
832
842
|
Oe as o,
|
|
833
|
-
|
|
843
|
+
Ne as p,
|
|
834
844
|
Ae as q,
|
|
835
845
|
xe as r
|
|
836
846
|
};
|