react-semaphor 0.1.527 → 0.1.529
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 +207 -196
- package/dist/brand-studio/index.js +3 -3
- package/dist/briefings/index.js +5 -5
- package/dist/chunks/{calculated-field-identity-DEhjPSr-.js → calculated-field-identity-Q1aCudPD.js} +4 -4
- package/dist/chunks/{card-config-utils-BlIbwkuD.js → card-config-utils-DqyASiD_.js} +5 -5
- package/dist/chunks/{dashboard-JNHR0_cZ.js → dashboard-BC-EC5M_.js} +1 -1
- package/dist/chunks/{dashboard-briefing-launcher-D9pFByPh.js → dashboard-briefing-launcher-CwyFda8i.js} +9 -9
- package/dist/chunks/{dashboard-controls-CJI5ZWMq.js → dashboard-controls-Bqg8vlyr.js} +11 -11
- package/dist/chunks/{dashboard-json-DLdrFry-.js → dashboard-json-DVicOlh9.js} +3 -3
- package/dist/chunks/{edit-dashboard-visual-D5LjWle1.js → edit-dashboard-visual-D4k246cQ.js} +1984 -1961
- package/dist/chunks/{editor-action-buttons-G91NQKxU.js → editor-action-buttons-DKIZkBTZ.js} +6 -6
- package/dist/chunks/{field-aggregations-DeVQLIsP.js → field-aggregations-BCDRRYMo.js} +6 -6
- package/dist/chunks/{field-dependencies-CGYic38w.js → field-dependencies-BWStuMxe.js} +1 -1
- package/dist/chunks/{index-BvJOYbNv.js → index-BpAM7UE0.js} +351 -360
- package/dist/chunks/{matrix-analytical-definition-BJyH5-99.js → matrix-analytical-definition-Q4GL16S4.js} +1 -1
- package/dist/chunks/{matrix-card-DY45yiUM.js → matrix-card-CkfMe-h-.js} +2 -2
- package/dist/chunks/{matrix-control-sources-BypfLZsK.js → matrix-control-sources-fD0Ns_9n.js} +5 -5
- package/dist/chunks/{matrix-definition-Cdn3LoxW.js → matrix-definition-CiGRzEzt.js} +1 -1
- package/dist/chunks/{matrix-formatter-BoKU3MzZ.js → matrix-formatter-DDjECnMd.js} +5 -5
- package/dist/chunks/{matrix-member-presentation-BBW0n1iY.js → matrix-member-presentation-Glhem6xB.js} +1 -1
- package/dist/chunks/matrix-operation-contract-BotZ-6zT.js +1383 -0
- package/dist/chunks/{metric-comparison-Crljx_XY.js → metric-comparison-QEkk6hqL.js} +1 -1
- package/dist/chunks/{numeric-presentation-LvnNY5Ma.js → numeric-presentation-D2I9znLM.js} +1 -1
- package/dist/chunks/{pivot-header-presentation-D5v8uyjj.js → pivot-header-presentation-BTOXdU6S.js} +7 -7
- package/dist/chunks/{pivot-result-identity-CY__BuwI.js → pivot-result-identity-BhAm8MCg.js} +1 -1
- package/dist/chunks/{pivot-result-lifecycle-BWrPhlGT.js → pivot-result-lifecycle-BxmATSFJ.js} +8 -8
- package/dist/chunks/{raw-temporal-CdnA_OXJ.js → raw-temporal-B0EuwEHr.js} +2 -2
- package/dist/chunks/{raw-temporal-contract-Bc9z83t-.js → raw-temporal-contract-BlyUGV3y.js} +1 -1
- package/dist/chunks/{relative-date-DAF9J7mt.js → relative-date-P4o6ME04.js} +1 -1
- package/dist/chunks/{report-preferences-dialog-D3hxu4sE.js → report-preferences-dialog-DFpOrZ02.js} +9 -9
- package/dist/chunks/{report-runtime-context-CtaGGlit.js → report-runtime-context-DceiWMKz.js} +1 -1
- package/dist/chunks/{selection-reducer-C7Um5XN-.js → selection-reducer-DQok8gsC.js} +1 -1
- package/dist/chunks/{semantic-format-BjBMOSoo.js → semantic-format-ByNkXJpY.js} +3 -3
- package/dist/chunks/{semaphor-ready-indicator-D46I_4g7.js → semaphor-ready-indicator-DBb9d0Xp.js} +9359 -9411
- package/dist/chunks/{slider-B6LELqx6.js → slider-BibKRCxX.js} +8 -8
- package/dist/chunks/{source-entity-resolution-Bde29mqE.js → source-entity-resolution-BWmw7a8P.js} +124 -132
- package/dist/chunks/{switch-_7uBAbYx.js → switch-Bql-RCoZ.js} +16 -18
- package/dist/chunks/{temporal-bucket-contract-C6lUGPS3.js → temporal-bucket-contract-CdBtoHX2.js} +1 -1
- package/dist/chunks/{temporal-input-presentation-DyMWCZYh.js → temporal-input-presentation-wUO681Zs.js} +1 -1
- package/dist/chunks/{token-types-UjyNz95-.js → token-types-Brc30mNN.js} +1 -1
- package/dist/chunks/{validators-CQcG0EPN.js → validators-BS521dum.js} +1 -1
- package/dist/dashboard/index.js +1 -1
- package/dist/dashboard-authoring/index.js +10 -10
- package/dist/data-app-sdk/index.js +5 -5
- package/dist/data-app-sdk-adapters/index.js +2 -2
- package/dist/data-app-sdk-validation/index.js +5 -5
- package/dist/format-utils/index.js +13 -13
- package/dist/index.js +17 -17
- package/dist/report-runtime-context/index.js +2 -2
- package/dist/surfboard/index.js +1 -1
- package/dist/types/index.js +5 -5
- package/dist/types/lib/types/explorer-types.d.ts +3 -1
- package/dist/types/lib/types/semantic-types.d.ts +4 -2
- package/dist/types/lib/utils/aggregate-expression-utils.d.ts +0 -4
- package/dist/types/lib/utils/connection-capabilities.d.ts +3 -3
- package/dist/types/shared/analytics-protocol/aggregate-expression.d.ts +89 -0
- package/dist/types/shared/analytics-protocol/analytics-refusal.d.ts +32 -0
- package/dist/types/shared/analytics-protocol/contracts.d.ts +38 -0
- package/dist/types/shared/analytics-protocol/index.d.ts +3 -0
- package/dist/types/shared/analytics-protocol/matrix-analytical-definition.d.ts +1 -0
- package/dist/types/shared/analytics-protocol/matrix-window-contract.d.ts +10 -1
- package/dist/types/shared/analytics-protocol/measure-aggregation-profile.d.ts +63 -0
- package/package.json +2 -2
- package/dist/chunks/matrix-operation-contract-BV02rLhu.js +0 -809
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { jsxs as B, jsx as p, Fragment as fe } from "react/jsx-runtime";
|
|
2
2
|
import * as C from "react";
|
|
3
3
|
import Ue, { useState as pe, useRef as F, useCallback as W, useEffect as Q, forwardRef as ge, useMemo as T, memo as Qe, Suspense as Ye } from "react";
|
|
4
|
-
import { ax as $e, ay as oe, az as he, aA as Ge, aB as je, aC as We, aD as Xe, aE as Je, aF as Ze, aG as et, aH as tt, aI as nt, aJ as rt, aK as ot, aL as st, aM as at } from "./semaphor-ready-indicator-
|
|
5
|
-
import { a4 as Se, a5 as z, a6 as k, c as ve, a7 as it, a2 as L, a3 as ye, C as be, B as lt, a8 as ct, a9 as ut, u as Z, aa as dt, ab as ft, ac as H, ad as mt, ae as Ce, af as pt, ag as gt } from "./switch-
|
|
4
|
+
import { ax as $e, ay as oe, az as he, aA as Ge, aB as je, aC as We, aD as Xe, aE as Je, aF as Ze, aG as et, aH as tt, aI as nt, aJ as rt, aK as ot, aL as st, aM as at } from "./semaphor-ready-indicator-DBb9d0Xp.js";
|
|
5
|
+
import { a4 as Se, a5 as z, a6 as k, c as ve, a7 as it, a2 as L, a3 as ye, C as be, B as lt, a8 as ct, a9 as ut, u as Z, aa as dt, ab as ft, ac as H, ad as mt, ae as Ce, af as pt, ag as gt } from "./switch-Bql-RCoZ.js";
|
|
6
6
|
import "./x-CXDkqdur.js";
|
|
7
|
-
import "./validators-
|
|
8
|
-
import "./matrix-operation-contract-
|
|
7
|
+
import "./validators-BS521dum.js";
|
|
8
|
+
import "./matrix-operation-contract-BotZ-6zT.js";
|
|
9
9
|
import "zod";
|
|
10
10
|
import "../value-format-preferences/index.js";
|
|
11
|
-
import { u as Ee, r as we, f as Re } from "./editor-action-buttons-
|
|
12
|
-
import { M as ht } from "./selection-reducer-
|
|
13
|
-
import "./card-config-utils-
|
|
14
|
-
import { P as St, r as vt, g as yt, a as me, b as ee, n as bt, c as Ct } from "./index-
|
|
11
|
+
import { u as Ee, r as we, f as Re } from "./editor-action-buttons-DKIZkBTZ.js";
|
|
12
|
+
import { M as ht } from "./selection-reducer-DQok8gsC.js";
|
|
13
|
+
import "./card-config-utils-DqyASiD_.js";
|
|
14
|
+
import { P as St, r as vt, g as yt, a as me, b as ee, n as bt, c as Ct } from "./index-BpAM7UE0.js";
|
|
15
15
|
import { u as Et } from "./appearance-context-DEYtWinQ.js";
|
|
16
16
|
const dn = Ue.memo(function({
|
|
17
17
|
context: t = "editor"
|
package/dist/chunks/{source-entity-resolution-Bde29mqE.js → source-entity-resolution-BWmw7a8P.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { J as K } from "./validators-
|
|
1
|
+
import { J as K } from "./validators-BS521dum.js";
|
|
2
2
|
function p(e) {
|
|
3
3
|
const i = V(e);
|
|
4
4
|
return i.length > 0 ? i.join(".") : void 0;
|
|
@@ -8,20 +8,20 @@ function Q(e) {
|
|
|
8
8
|
e.qualifiedName
|
|
9
9
|
), t = (i == null ? void 0 : i.split(".")) || [];
|
|
10
10
|
if (t.length === 0) return {};
|
|
11
|
-
const
|
|
11
|
+
const n = {};
|
|
12
12
|
let s = t.length - 1;
|
|
13
13
|
for (let r = e.capabilities.prefixLevels.length - 1; r >= 0 && s >= 0; r -= 1, s -= 1)
|
|
14
14
|
Y(
|
|
15
|
-
|
|
15
|
+
n,
|
|
16
16
|
e.capabilities.prefixLevels[r],
|
|
17
17
|
t[s]
|
|
18
18
|
);
|
|
19
|
-
return
|
|
19
|
+
return n;
|
|
20
20
|
}
|
|
21
21
|
function P(e) {
|
|
22
22
|
return !e.left.tableName || !e.right.tableName ? !1 : e.capabilities.prefixLevels.every((i) => {
|
|
23
|
-
const t = I(e.left, i),
|
|
24
|
-
return !t || !
|
|
23
|
+
const t = I(e.left, i), n = I(e.right, i);
|
|
24
|
+
return !t || !n || t === n;
|
|
25
25
|
});
|
|
26
26
|
}
|
|
27
27
|
function pe(e) {
|
|
@@ -31,7 +31,7 @@ function pe(e) {
|
|
|
31
31
|
});
|
|
32
32
|
}
|
|
33
33
|
function X(e, i = {}) {
|
|
34
|
-
const t = j(e),
|
|
34
|
+
const t = j(e), n = {
|
|
35
35
|
connectionId: i.connectionId,
|
|
36
36
|
connectionType: e,
|
|
37
37
|
path: ["database", "schema", "table"],
|
|
@@ -45,24 +45,24 @@ function X(e, i = {}) {
|
|
|
45
45
|
supportsFilterClause: !0
|
|
46
46
|
};
|
|
47
47
|
return t.includes("postgres") ? {
|
|
48
|
-
...
|
|
48
|
+
...n,
|
|
49
49
|
prefixLevels: ["schema", "table"],
|
|
50
50
|
dialect: "postgres"
|
|
51
51
|
} : t.includes("mysql") ? {
|
|
52
|
-
...
|
|
52
|
+
...n,
|
|
53
53
|
prefixLevels: ["database", "table"],
|
|
54
54
|
dialect: "mysql",
|
|
55
55
|
supportsFilterClause: !1
|
|
56
56
|
} : t.includes("mssql") || t.includes("sqlserver") ? {
|
|
57
|
-
...
|
|
57
|
+
...n,
|
|
58
58
|
dialect: "mssql",
|
|
59
59
|
supportsFilterClause: !1
|
|
60
60
|
} : t.includes("redshift") ? {
|
|
61
|
-
...
|
|
61
|
+
...n,
|
|
62
62
|
prefixLevels: ["schema", "table"],
|
|
63
63
|
dialect: "redshift"
|
|
64
64
|
} : t.includes("snowflake") ? {
|
|
65
|
-
...
|
|
65
|
+
...n,
|
|
66
66
|
dialect: "snowflake"
|
|
67
67
|
} : t.includes("clickhouse") ? {
|
|
68
68
|
connectionId: i.connectionId,
|
|
@@ -95,16 +95,8 @@ function X(e, i = {}) {
|
|
|
95
95
|
prefixLevels: ["table"],
|
|
96
96
|
dialect: "postgres",
|
|
97
97
|
supportsFilterClause: !0
|
|
98
|
-
} : t === "s3tables" ? {
|
|
99
|
-
...a,
|
|
100
|
-
labels: {
|
|
101
|
-
database: "Database",
|
|
102
|
-
schema: "Namespace",
|
|
103
|
-
table: "Table"
|
|
104
|
-
},
|
|
105
|
-
dialect: "duckdb"
|
|
106
98
|
} : t === "bigquery" ? {
|
|
107
|
-
...
|
|
99
|
+
...n,
|
|
108
100
|
labels: {
|
|
109
101
|
database: "Project",
|
|
110
102
|
schema: "Dataset",
|
|
@@ -113,7 +105,7 @@ function X(e, i = {}) {
|
|
|
113
105
|
prefixLevels: ["schema", "table"],
|
|
114
106
|
dialect: "bigquery",
|
|
115
107
|
supportsFilterClause: !1
|
|
116
|
-
} :
|
|
108
|
+
} : n;
|
|
117
109
|
}
|
|
118
110
|
function v(e, i = {}) {
|
|
119
111
|
return M(
|
|
@@ -129,7 +121,7 @@ function M(e) {
|
|
|
129
121
|
if (i.includes("redshift")) return "redshift";
|
|
130
122
|
if (i.includes("snowflake")) return "snowflake";
|
|
131
123
|
if (i.includes("clickhouse")) return "clickhouse";
|
|
132
|
-
if (i === "s3" || i === "api" || i === "googlesheets" || i === "fileupload" || i === "
|
|
124
|
+
if (i === "s3" || i === "api" || i === "googlesheets" || i === "fileupload" || i === "bigquery")
|
|
133
125
|
return i;
|
|
134
126
|
}
|
|
135
127
|
function z(e) {
|
|
@@ -175,16 +167,16 @@ const Z = [
|
|
|
175
167
|
];
|
|
176
168
|
function ee(e) {
|
|
177
169
|
const i = e.trim();
|
|
178
|
-
for (const [t,
|
|
179
|
-
if (i.length >= 2 && i.startsWith(t) && i.endsWith(
|
|
180
|
-
return i.slice(1, -1).split(
|
|
170
|
+
for (const [t, n] of Z)
|
|
171
|
+
if (i.length >= 2 && i.startsWith(t) && i.endsWith(n))
|
|
172
|
+
return i.slice(1, -1).split(n + n).join(n);
|
|
181
173
|
return i;
|
|
182
174
|
}
|
|
183
175
|
function V(e) {
|
|
184
176
|
const i = e == null ? void 0 : e.trim();
|
|
185
177
|
if (!i) return [];
|
|
186
178
|
const t = i.split(".").map(ee);
|
|
187
|
-
return t.some((
|
|
179
|
+
return t.some((n) => !n) ? [] : t;
|
|
188
180
|
}
|
|
189
181
|
function ge(e) {
|
|
190
182
|
const i = V(e ?? void 0);
|
|
@@ -214,17 +206,17 @@ function O(e) {
|
|
|
214
206
|
);
|
|
215
207
|
}
|
|
216
208
|
function Ne(e) {
|
|
217
|
-
const i = e.source.connectionType ? v(e.source.connectionType) : void 0, t = e.source.dialect ? z(e.source.dialect) : void 0,
|
|
209
|
+
const i = e.source.connectionType ? v(e.source.connectionType) : void 0, t = e.source.dialect ? z(e.source.dialect) : void 0, n = e.source.dialect && e.source.dialect !== "unknown" ? v(e.source.dialect) : void 0;
|
|
218
210
|
if (!e.capabilities && e.source.connectionType && e.source.dialect && e.source.dialect !== "unknown" && (!i || t === "unknown" || i.dialect !== t))
|
|
219
211
|
return { kind: "incompatible_capabilities" };
|
|
220
|
-
const s = e.capabilities || i ||
|
|
212
|
+
const s = e.capabilities || i || n;
|
|
221
213
|
if (!s) return { kind: "incompatible_capabilities" };
|
|
222
214
|
const r = O(s), o = {
|
|
223
215
|
...r.includes("database") && e.source.databaseName ? { databaseName: e.source.databaseName } : {},
|
|
224
216
|
...r.includes("schema") && e.source.schemaName ? { schemaName: e.source.schemaName } : {},
|
|
225
217
|
...e.source.tableName ? { tableName: e.source.tableName } : {}
|
|
226
|
-
},
|
|
227
|
-
return
|
|
218
|
+
}, a = r.filter((d) => d === "database" ? !o.databaseName : d === "schema" ? !o.schemaName : !o.tableName);
|
|
219
|
+
return a.length > 0 ? { kind: "missing_coordinates", missing: a } : {
|
|
228
220
|
kind: "resolved",
|
|
229
221
|
coordinates: o
|
|
230
222
|
};
|
|
@@ -249,23 +241,23 @@ function x(e) {
|
|
|
249
241
|
...t ? { tableName: t } : {}
|
|
250
242
|
};
|
|
251
243
|
}
|
|
252
|
-
function
|
|
244
|
+
function ne(e) {
|
|
253
245
|
if (re(e)) return { kind: "malformed" };
|
|
254
|
-
const i = e.entities.filter(W), t =
|
|
246
|
+
const i = e.entities.filter(W), t = ae(e), n = se({
|
|
255
247
|
entities: i,
|
|
256
248
|
connectionType: e.connectionType,
|
|
257
249
|
dialect: e.dialect,
|
|
258
250
|
capabilities: e.capabilities
|
|
259
251
|
});
|
|
260
|
-
if (!
|
|
261
|
-
const { capabilities: s } =
|
|
252
|
+
if (!n) return { kind: "incompatible_capabilities" };
|
|
253
|
+
const { capabilities: s } = n, r = ce({
|
|
262
254
|
hints: e.qualifiedHints || [],
|
|
263
255
|
coordinateHint: e.coordinateHint,
|
|
264
|
-
capabilityAuthority:
|
|
256
|
+
capabilityAuthority: n
|
|
265
257
|
});
|
|
266
258
|
if (r.kind !== "valid")
|
|
267
259
|
return { kind: r.kind };
|
|
268
|
-
const o = r.coordinates,
|
|
260
|
+
const o = r.coordinates, a = o ? i.filter(
|
|
269
261
|
(c) => P({
|
|
270
262
|
left: G(
|
|
271
263
|
x(c),
|
|
@@ -275,16 +267,16 @@ function ae(e) {
|
|
|
275
267
|
capabilities: s
|
|
276
268
|
})
|
|
277
269
|
) : i;
|
|
278
|
-
if (o &&
|
|
270
|
+
if (o && a.length === 0)
|
|
279
271
|
return {
|
|
280
272
|
kind: "not_found",
|
|
281
273
|
basis: "qualified",
|
|
282
274
|
coordinates: o,
|
|
283
|
-
capabilityAuthority:
|
|
275
|
+
capabilityAuthority: n
|
|
284
276
|
};
|
|
285
|
-
if (o &&
|
|
286
|
-
const c =
|
|
287
|
-
|
|
277
|
+
if (o && a.length === 1) {
|
|
278
|
+
const c = a[0], u = E(
|
|
279
|
+
n,
|
|
288
280
|
c
|
|
289
281
|
);
|
|
290
282
|
return {
|
|
@@ -305,13 +297,13 @@ function ae(e) {
|
|
|
305
297
|
o == null ? void 0 : o.tableName
|
|
306
298
|
]);
|
|
307
299
|
if (d.size > 0) {
|
|
308
|
-
const c =
|
|
300
|
+
const c = a.filter((u) => {
|
|
309
301
|
const b = ue(u);
|
|
310
302
|
return Array.from(d).some((h) => b.has(h));
|
|
311
303
|
});
|
|
312
304
|
if (c.length === 1) {
|
|
313
305
|
const u = c[0], b = E(
|
|
314
|
-
|
|
306
|
+
n,
|
|
315
307
|
u
|
|
316
308
|
);
|
|
317
309
|
return {
|
|
@@ -325,7 +317,7 @@ function ae(e) {
|
|
|
325
317
|
capabilityAuthority: b
|
|
326
318
|
};
|
|
327
319
|
}
|
|
328
|
-
return c.length > 1 ? { kind: "ambiguous", basis: "bare" } : { kind: "not_found", basis: "bare", capabilityAuthority:
|
|
320
|
+
return c.length > 1 ? { kind: "ambiguous", basis: "bare" } : { kind: "not_found", basis: "bare", capabilityAuthority: n };
|
|
329
321
|
}
|
|
330
322
|
if (o)
|
|
331
323
|
return { kind: "ambiguous", basis: "qualified" };
|
|
@@ -333,11 +325,11 @@ function ae(e) {
|
|
|
333
325
|
return {
|
|
334
326
|
kind: "not_found",
|
|
335
327
|
basis: t,
|
|
336
|
-
capabilityAuthority:
|
|
328
|
+
capabilityAuthority: n
|
|
337
329
|
};
|
|
338
330
|
if (i.length === 1) {
|
|
339
331
|
const c = i[0], u = E(
|
|
340
|
-
|
|
332
|
+
n,
|
|
341
333
|
c
|
|
342
334
|
);
|
|
343
335
|
return {
|
|
@@ -353,12 +345,12 @@ function ae(e) {
|
|
|
353
345
|
}
|
|
354
346
|
return { kind: "unqualified" };
|
|
355
347
|
}
|
|
356
|
-
function
|
|
357
|
-
const i = (e.qualifiedHints || []).map(f).filter((
|
|
348
|
+
function ae(e) {
|
|
349
|
+
const i = (e.qualifiedHints || []).map(f).filter((n) => !!n);
|
|
358
350
|
return Object.values(e.coordinateHint || {}).some(
|
|
359
|
-
(
|
|
360
|
-
) || i.some((
|
|
361
|
-
(
|
|
351
|
+
(n) => !!f(n)
|
|
352
|
+
) || i.some((n) => n.includes(".")) ? "qualified" : [...i, ...e.bareHints || []].some(
|
|
353
|
+
(n) => !!f(n)
|
|
362
354
|
) ? "bare" : void 0;
|
|
363
355
|
}
|
|
364
356
|
function S(e) {
|
|
@@ -372,15 +364,15 @@ function L(e) {
|
|
|
372
364
|
}
|
|
373
365
|
function se(e) {
|
|
374
366
|
var q;
|
|
375
|
-
const i = f(e.connectionType), t = f(e.dialect),
|
|
376
|
-
if (i && !s || t && t !== "unknown" && r === "unknown" ||
|
|
367
|
+
const i = f(e.connectionType), t = f(e.dialect), n = e.capabilities ? L(e.capabilities) : void 0, s = i ? v(i) : void 0, r = t ? z(t) : void 0, o = t && t !== "unknown" ? v(t) : void 0;
|
|
368
|
+
if (i && !s || t && t !== "unknown" && r === "unknown" || n && s && S(n) !== S(s))
|
|
377
369
|
return;
|
|
378
|
-
const
|
|
379
|
-
if (
|
|
380
|
-
return r && r !== "unknown" &&
|
|
381
|
-
capabilities:
|
|
370
|
+
const a = n || (s ? L(s) : o ? L(o) : void 0);
|
|
371
|
+
if (a)
|
|
372
|
+
return r && r !== "unknown" && a.dialect !== r ? void 0 : {
|
|
373
|
+
capabilities: a,
|
|
382
374
|
...i ? { connectionType: i } : {},
|
|
383
|
-
dialect:
|
|
375
|
+
dialect: a.dialect,
|
|
384
376
|
evidence: "explicit"
|
|
385
377
|
};
|
|
386
378
|
const d = e.entities.map((m) => {
|
|
@@ -429,27 +421,27 @@ function oe(e) {
|
|
|
429
421
|
function E(e, i) {
|
|
430
422
|
var s;
|
|
431
423
|
if (e.evidence !== "entity") return e;
|
|
432
|
-
const t = f((s = w(i)) == null ? void 0 : s.connectionType),
|
|
433
|
-
return
|
|
424
|
+
const t = f((s = w(i)) == null ? void 0 : s.connectionType), n = t ? v(t) : void 0;
|
|
425
|
+
return n && S(n) === S(e.capabilities) ? { ...e, connectionType: t } : e;
|
|
434
426
|
}
|
|
435
427
|
function re(e) {
|
|
436
428
|
return (e.qualifiedHints || []).some(
|
|
437
429
|
(t) => {
|
|
438
|
-
const
|
|
439
|
-
return !!(
|
|
430
|
+
const n = f(t);
|
|
431
|
+
return !!(n && n.includes(".") && !p(n));
|
|
440
432
|
}
|
|
441
433
|
) ? !0 : Object.values(e.coordinateHint || {}).some((t) => {
|
|
442
|
-
const
|
|
443
|
-
return !!(
|
|
434
|
+
const n = f(t);
|
|
435
|
+
return !!(n && !p(n));
|
|
444
436
|
});
|
|
445
437
|
}
|
|
446
438
|
function ce(e) {
|
|
447
|
-
const { capabilities: i } = e.capabilityAuthority, t = [],
|
|
439
|
+
const { capabilities: i } = e.capabilityAuthority, t = [], n = [];
|
|
448
440
|
for (const b of e.hints) {
|
|
449
441
|
const h = f(b);
|
|
450
442
|
if (!h) continue;
|
|
451
443
|
if (!h.includes(".")) {
|
|
452
|
-
|
|
444
|
+
n.push(h);
|
|
453
445
|
continue;
|
|
454
446
|
}
|
|
455
447
|
const q = p(h);
|
|
@@ -468,7 +460,7 @@ function ce(e) {
|
|
|
468
460
|
return { kind: "conflicting" };
|
|
469
461
|
const o = [...new Set(t)].sort(
|
|
470
462
|
(b, h) => h.split(".").length - b.split(".").length
|
|
471
|
-
)[0],
|
|
463
|
+
)[0], a = o ? Q({
|
|
472
464
|
qualifiedName: o,
|
|
473
465
|
capabilities: i
|
|
474
466
|
}) : void 0, d = G(
|
|
@@ -478,26 +470,26 @@ function ce(e) {
|
|
|
478
470
|
s.coordinates,
|
|
479
471
|
e.capabilityAuthority
|
|
480
472
|
), u = !!(d.tableName && (d.databaseName || d.schemaName));
|
|
481
|
-
return
|
|
482
|
-
left:
|
|
473
|
+
return a && u && !P({
|
|
474
|
+
left: a,
|
|
483
475
|
right: d,
|
|
484
476
|
capabilities: i
|
|
485
477
|
}) ? { kind: "conflicting" } : {
|
|
486
478
|
kind: "valid",
|
|
487
|
-
coordinates:
|
|
479
|
+
coordinates: a ? {
|
|
488
480
|
...c,
|
|
489
|
-
...
|
|
481
|
+
...a
|
|
490
482
|
} : u ? c : void 0,
|
|
491
483
|
bareHints: [
|
|
492
|
-
...
|
|
484
|
+
...n,
|
|
493
485
|
...!u && d.tableName ? [d.tableName] : []
|
|
494
486
|
]
|
|
495
487
|
};
|
|
496
488
|
}
|
|
497
489
|
function le(e) {
|
|
498
490
|
const i = {};
|
|
499
|
-
for (const [t,
|
|
500
|
-
const s = f(
|
|
491
|
+
for (const [t, n] of Object.entries(e || {})) {
|
|
492
|
+
const s = f(n);
|
|
501
493
|
if (!s) continue;
|
|
502
494
|
const r = p(s);
|
|
503
495
|
if (!r) return { kind: "malformed" };
|
|
@@ -514,7 +506,7 @@ function G(e, i) {
|
|
|
514
506
|
}
|
|
515
507
|
function de(e, i) {
|
|
516
508
|
return e.every(
|
|
517
|
-
(t,
|
|
509
|
+
(t, n) => e.slice(n + 1).every(
|
|
518
510
|
(s) => P({
|
|
519
511
|
left: t,
|
|
520
512
|
right: s,
|
|
@@ -570,14 +562,14 @@ function U(e) {
|
|
|
570
562
|
function R(e) {
|
|
571
563
|
const i = /* @__PURE__ */ new Set();
|
|
572
564
|
for (const t of e) {
|
|
573
|
-
const
|
|
574
|
-
if (!
|
|
575
|
-
const s = p(
|
|
565
|
+
const n = l(t);
|
|
566
|
+
if (!n) continue;
|
|
567
|
+
const s = p(n);
|
|
576
568
|
if (!s) continue;
|
|
577
569
|
const r = s.toLowerCase();
|
|
578
570
|
i.add(r);
|
|
579
|
-
const o = r.split("."),
|
|
580
|
-
|
|
571
|
+
const o = r.split("."), a = o[o.length - 1];
|
|
572
|
+
a && i.add(a);
|
|
581
573
|
}
|
|
582
574
|
return i;
|
|
583
575
|
}
|
|
@@ -587,12 +579,12 @@ function $(e) {
|
|
|
587
579
|
return i ? (t = p(i)) == null ? void 0 : t.toLowerCase() : void 0;
|
|
588
580
|
}
|
|
589
581
|
function D(e, i) {
|
|
590
|
-
const t = C(i),
|
|
591
|
-
if (!
|
|
582
|
+
const t = C(i), n = l(t == null ? void 0 : t.domainId) || l(e.semanticDomainId), s = l(t == null ? void 0 : t.name);
|
|
583
|
+
if (!n || !s) return;
|
|
592
584
|
const r = (t == null ? void 0 : t.datasetType) === "physical" ? void 0 : K(t || {}), o = l(t == null ? void 0 : t.connectionId) || l(e.connectionId);
|
|
593
585
|
return {
|
|
594
586
|
kind: "semantic",
|
|
595
|
-
domainId:
|
|
587
|
+
domainId: n,
|
|
596
588
|
datasetName: s,
|
|
597
589
|
...r ? { datasetId: r } : {},
|
|
598
590
|
...o ? { connectionId: o } : {}
|
|
@@ -602,21 +594,21 @@ function be(e, i = {}) {
|
|
|
602
594
|
const t = l(e.fieldEntityType);
|
|
603
595
|
if (t && t !== "dataset")
|
|
604
596
|
return { kind: "unqualified" };
|
|
605
|
-
const
|
|
597
|
+
const n = e.entities.filter(
|
|
606
598
|
(o) => i.includePhysicalDatasets ? me(o) : U(o)
|
|
607
599
|
), s = l(e.entityId);
|
|
608
600
|
if (s) {
|
|
609
|
-
const o = $(s),
|
|
601
|
+
const o = $(s), a = n.filter((d) => {
|
|
610
602
|
const c = C(d);
|
|
611
603
|
return !!(o && $(c == null ? void 0 : c.id) === o);
|
|
612
604
|
});
|
|
613
|
-
if (
|
|
614
|
-
if (
|
|
615
|
-
const d = D(e,
|
|
605
|
+
if (a.length > 1) return { kind: "ambiguous", basis: "bare" };
|
|
606
|
+
if (a.length === 1) {
|
|
607
|
+
const d = D(e, a[0]);
|
|
616
608
|
return d ? {
|
|
617
609
|
kind: "resolved",
|
|
618
610
|
basis: "bare",
|
|
619
|
-
entity:
|
|
611
|
+
entity: a[0],
|
|
620
612
|
source: d,
|
|
621
613
|
matchedById: !0
|
|
622
614
|
} : { kind: "not_found", basis: "bare" };
|
|
@@ -628,29 +620,29 @@ function be(e, i = {}) {
|
|
|
628
620
|
...e.bareHints || []
|
|
629
621
|
]);
|
|
630
622
|
if (r.size > 0) {
|
|
631
|
-
const o =
|
|
632
|
-
const d = C(
|
|
623
|
+
const o = n.filter((a) => {
|
|
624
|
+
const d = C(a);
|
|
633
625
|
return [...R([d == null ? void 0 : d.id, d == null ? void 0 : d.name])].some((u) => r.has(u));
|
|
634
626
|
});
|
|
635
627
|
if (o.length > 1) return { kind: "ambiguous", basis: "bare" };
|
|
636
628
|
if (o.length === 1) {
|
|
637
|
-
const
|
|
638
|
-
return
|
|
629
|
+
const a = D(e, o[0]);
|
|
630
|
+
return a ? {
|
|
639
631
|
kind: "resolved",
|
|
640
632
|
basis: "bare",
|
|
641
633
|
entity: o[0],
|
|
642
|
-
source:
|
|
634
|
+
source: a,
|
|
643
635
|
matchedById: !1
|
|
644
636
|
} : { kind: "not_found", basis: "bare" };
|
|
645
637
|
}
|
|
646
638
|
return { kind: "not_found", basis: "bare" };
|
|
647
639
|
}
|
|
648
|
-
if (
|
|
649
|
-
const o = D(e,
|
|
640
|
+
if (n.length === 1) {
|
|
641
|
+
const o = D(e, n[0]);
|
|
650
642
|
return o ? {
|
|
651
643
|
kind: "resolved",
|
|
652
644
|
basis: "unqualified",
|
|
653
|
-
entity:
|
|
645
|
+
entity: n[0],
|
|
654
646
|
source: o,
|
|
655
647
|
matchedById: !1
|
|
656
648
|
} : { kind: "unqualified" };
|
|
@@ -658,18 +650,18 @@ function be(e, i = {}) {
|
|
|
658
650
|
return { kind: "unqualified" };
|
|
659
651
|
}
|
|
660
652
|
function _(e) {
|
|
661
|
-
const i = e.resolution.kind === "resolved" ? C(e.resolution.entity) : void 0, t = l(e.connectionId) || l(i == null ? void 0 : i.connectionId), { connectionType:
|
|
653
|
+
const i = e.resolution.kind === "resolved" ? C(e.resolution.entity) : void 0, t = l(e.connectionId) || l(i == null ? void 0 : i.connectionId), { connectionType: n, dialect: s } = e.resolution.capabilityAuthority, r = v(s), o = !!(r && r.dialect === e.resolution.capabilityAuthority.capabilities.dialect && r.prefixLevels.join(".") === e.resolution.capabilityAuthority.capabilities.prefixLevels.join(
|
|
662
654
|
"."
|
|
663
|
-
)),
|
|
664
|
-
if (!(!t || !(
|
|
655
|
+
)), a = e.resolution.coordinates;
|
|
656
|
+
if (!(!t || !(a != null && a.tableName)))
|
|
665
657
|
return {
|
|
666
658
|
kind: "physical",
|
|
667
659
|
connectionId: t,
|
|
668
|
-
...
|
|
669
|
-
...!
|
|
670
|
-
tableName:
|
|
671
|
-
...
|
|
672
|
-
...
|
|
660
|
+
...n ? { connectionType: n } : {},
|
|
661
|
+
...!n && o ? { dialect: s } : {},
|
|
662
|
+
tableName: a.tableName,
|
|
663
|
+
...a.databaseName ? { databaseName: a.databaseName } : {},
|
|
664
|
+
...a.schemaName ? { schemaName: a.schemaName } : {}
|
|
673
665
|
};
|
|
674
666
|
}
|
|
675
667
|
function he(e) {
|
|
@@ -682,23 +674,23 @@ function he(e) {
|
|
|
682
674
|
...(e.bareHints || []).map(l),
|
|
683
675
|
l(e.entityName),
|
|
684
676
|
...l(e.fieldEntityType) === "table" ? [l(e.entityId)] : []
|
|
685
|
-
].filter((
|
|
686
|
-
if (!i.length || i.some((
|
|
677
|
+
].filter((a) => !!a);
|
|
678
|
+
if (!i.length || i.some((a) => a.includes(".")))
|
|
687
679
|
return;
|
|
688
680
|
const t = i.map(p);
|
|
689
|
-
return t.some((
|
|
681
|
+
return t.some((a) => !a) ? void 0 : new Set(t.map((a) => a.toLowerCase())).size === 1 ? t[0] : void 0;
|
|
690
682
|
}
|
|
691
683
|
function Ie(e) {
|
|
692
684
|
const i = e.entities.filter(
|
|
693
685
|
W
|
|
694
686
|
), t = e.entities.filter(
|
|
695
687
|
U
|
|
696
|
-
),
|
|
688
|
+
), n = i.length > 0 || t.length > 0, s = be(e), r = e.qualifiedHints || [], o = r.some(
|
|
697
689
|
(c) => {
|
|
698
690
|
var u;
|
|
699
691
|
return (u = l(c)) == null ? void 0 : u.includes(".");
|
|
700
692
|
}
|
|
701
|
-
),
|
|
693
|
+
), a = ne({
|
|
702
694
|
entities: i,
|
|
703
695
|
connectionType: l(e.connectionType),
|
|
704
696
|
dialect: e.dialect,
|
|
@@ -707,49 +699,49 @@ function Ie(e) {
|
|
|
707
699
|
bareHints: [e.entityName, e.entityId, ...e.bareHints || []],
|
|
708
700
|
...!o && e.fallbackCoordinateHint ? { coordinateHint: e.fallbackCoordinateHint } : {}
|
|
709
701
|
});
|
|
710
|
-
if (
|
|
711
|
-
return
|
|
712
|
-
if (
|
|
702
|
+
if (a.kind === "malformed" || a.kind === "conflicting" || a.kind === "incompatible_capabilities" && o || a.kind === "ambiguous" && a.basis === "qualified")
|
|
703
|
+
return a;
|
|
704
|
+
if (a.kind === "resolved" && a.basis === "qualified") {
|
|
713
705
|
const c = _({
|
|
714
|
-
resolution:
|
|
706
|
+
resolution: a,
|
|
715
707
|
connectionId: e.connectionId
|
|
716
708
|
});
|
|
717
709
|
return c ? {
|
|
718
710
|
kind: "resolved",
|
|
719
|
-
basis:
|
|
711
|
+
basis: a.basis,
|
|
720
712
|
source: c,
|
|
721
|
-
entity:
|
|
713
|
+
entity: a.entity
|
|
722
714
|
} : { kind: "missing_connection" };
|
|
723
715
|
}
|
|
724
|
-
if (
|
|
716
|
+
if (a.kind === "not_found" && a.basis === "qualified" && a.coordinates) {
|
|
725
717
|
const c = _({
|
|
726
|
-
resolution:
|
|
718
|
+
resolution: a,
|
|
727
719
|
connectionId: e.connectionId
|
|
728
720
|
});
|
|
729
|
-
return c ?
|
|
721
|
+
return c ? n ? { kind: "candidate", basis: "qualified", source: c } : { kind: "resolved", basis: "qualified", source: c } : { kind: "missing_connection" };
|
|
730
722
|
}
|
|
731
723
|
if (s.kind === "resolved")
|
|
732
|
-
return
|
|
724
|
+
return a.kind === "resolved" && a.basis === "bare" && !s.matchedById ? { kind: "ambiguous", basis: "bare" } : {
|
|
733
725
|
kind: "resolved",
|
|
734
726
|
basis: s.basis,
|
|
735
727
|
source: s.source,
|
|
736
728
|
entity: s.entity
|
|
737
729
|
};
|
|
738
730
|
if (s.kind === "ambiguous") return s;
|
|
739
|
-
if (
|
|
731
|
+
if (a.kind === "resolved") {
|
|
740
732
|
const c = _({
|
|
741
|
-
resolution:
|
|
733
|
+
resolution: a,
|
|
742
734
|
connectionId: e.connectionId
|
|
743
735
|
});
|
|
744
736
|
return c ? {
|
|
745
737
|
kind: "resolved",
|
|
746
|
-
basis:
|
|
738
|
+
basis: a.basis,
|
|
747
739
|
source: c,
|
|
748
|
-
entity:
|
|
740
|
+
entity: a.entity
|
|
749
741
|
} : { kind: "missing_connection" };
|
|
750
742
|
}
|
|
751
743
|
const d = l(e.entityName) || l(e.entityId);
|
|
752
|
-
if (!
|
|
744
|
+
if (!n && !o && l(e.semanticDomainId) && (!l(e.fieldEntityType) || l(e.fieldEntityType) === "dataset") && d)
|
|
753
745
|
return {
|
|
754
746
|
kind: "resolved",
|
|
755
747
|
basis: "historical",
|
|
@@ -760,17 +752,17 @@ function Ie(e) {
|
|
|
760
752
|
...l(e.connectionId) ? { connectionId: l(e.connectionId) } : {}
|
|
761
753
|
}
|
|
762
754
|
};
|
|
763
|
-
if (
|
|
764
|
-
const c =
|
|
755
|
+
if (a.kind === "incompatible_capabilities") {
|
|
756
|
+
const c = n ? void 0 : he(e), u = l(e.connectionId);
|
|
765
757
|
return c && u ? {
|
|
766
758
|
kind: "resolved",
|
|
767
759
|
basis: "historical",
|
|
768
760
|
source: { kind: "physical", connectionId: u, tableName: c }
|
|
769
|
-
} :
|
|
761
|
+
} : a;
|
|
770
762
|
}
|
|
771
|
-
return
|
|
763
|
+
return a.kind === "ambiguous" ? a : a.kind === "not_found" ? {
|
|
772
764
|
kind: "not_found",
|
|
773
|
-
basis:
|
|
765
|
+
basis: a.basis
|
|
774
766
|
} : { kind: "unqualified" };
|
|
775
767
|
}
|
|
776
768
|
export {
|
|
@@ -785,7 +777,7 @@ export {
|
|
|
785
777
|
O as i,
|
|
786
778
|
Ne as j,
|
|
787
779
|
W as k,
|
|
788
|
-
|
|
780
|
+
ne as l,
|
|
789
781
|
U as m,
|
|
790
782
|
z as n,
|
|
791
783
|
be as o,
|