react-semaphor 0.1.547 → 0.1.548
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 +1 -1
- package/dist/assistant-context/index.js +1 -1
- package/dist/briefings/index.js +1 -1
- package/dist/chunks/{assistant-chat-CK84cPAB.js → assistant-chat-DCcWsoGm.js} +5 -5
- package/dist/chunks/{custom-visual-inputs-ChL54gGm.js → custom-visual-inputs-BTRnwsfd.js} +1 -1
- package/dist/chunks/{dashboard-DCk26-6i.js → dashboard-BZHL9a-z.js} +1 -1
- package/dist/chunks/{dashboard-briefing-launcher-CQ1eYsGy.js → dashboard-briefing-launcher-DML-cAzB.js} +5 -5
- package/dist/chunks/{dashboard-controls-BMeZjF7r.js → dashboard-controls-BGoBTPS7.js} +7 -7
- package/dist/chunks/{dashboard-json-BZqCoanC.js → dashboard-json-iHPsdn3j.js} +1 -1
- package/dist/chunks/{document-dashboard-inputs-tYd7ao0o.js → document-dashboard-inputs-B2AqPfrq.js} +2 -2
- package/dist/chunks/{edit-dashboard-visual-Bv3MHM_G.js → edit-dashboard-visual-CLEFFf2T.js} +8 -8
- package/dist/chunks/{filter-reach-copy-CGWsL_ez.js → filter-reach-copy-ByzGadUk.js} +4 -4
- package/dist/chunks/{global-date-filter-utils-BhAu8zIM.js → global-date-filter-utils-CeeFJ1CP.js} +1 -1
- package/dist/chunks/{index-DmrLP5Ro.js → index-DeDHr3iz.js} +3 -3
- package/dist/chunks/{raw-temporal-presentation-DypB7sMX.js → raw-temporal-presentation-CrUM2I_o.js} +1 -1
- package/dist/chunks/{report-preferences-dialog-DoVyriYC.js → report-preferences-dialog-CM7kXmXp.js} +6 -6
- package/dist/chunks/{resolve-dashboard-input-context-D0JDUa4h.js → resolve-dashboard-input-context-BmWF9hSl.js} +2 -2
- package/dist/chunks/{saved-dashboard-context-BfAH5j4L.js → saved-dashboard-context-qtfzl9Eb.js} +4 -4
- package/dist/chunks/{semaphor-ready-indicator-CRm17oIP.js → semaphor-ready-indicator-Ol6VcaR7.js} +23634 -23619
- package/dist/chunks/{shelf-drop-preview-context-vy6P9THz.js → shelf-drop-preview-context-C2SEC3I9.js} +3 -3
- package/dist/chunks/{source-entity-resolution-BIGRvtbG.js → source-entity-resolution-D195CrYS.js} +221 -192
- package/dist/chunks/{use-create-flow-overlay-state-Csx_Xjsh.js → use-create-flow-overlay-state-CbGIjaVD.js} +2 -2
- package/dist/dashboard/index.js +1 -1
- package/dist/dashboard-authoring/index.js +7 -7
- package/dist/data-app-sdk-validation/index.js +1 -1
- package/dist/index.js +12 -12
- package/dist/surfboard/index.js +1 -1
- package/dist/types/lib/dashboard-inputs/dashboard-filter-mapping-authoring.d.ts +42 -6
- package/package.json +1 -1
package/dist/chunks/{source-entity-resolution-BIGRvtbG.js → source-entity-resolution-D195CrYS.js}
RENAMED
|
@@ -1,37 +1,37 @@
|
|
|
1
1
|
import { al as K } from "./validators-C-aOQlTB.js";
|
|
2
|
-
function
|
|
2
|
+
function h(e) {
|
|
3
3
|
const i = V(e);
|
|
4
4
|
return i.length > 0 ? i.join(".") : void 0;
|
|
5
5
|
}
|
|
6
6
|
function Q(e) {
|
|
7
|
-
const i =
|
|
7
|
+
const i = h(
|
|
8
8
|
e.qualifiedName
|
|
9
9
|
), t = (i == null ? void 0 : i.split(".")) || [];
|
|
10
10
|
if (t.length === 0) return {};
|
|
11
|
-
const
|
|
11
|
+
const a = {};
|
|
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
|
-
|
|
15
|
-
|
|
14
|
+
Z(
|
|
15
|
+
a,
|
|
16
16
|
e.capabilities.prefixLevels[r],
|
|
17
17
|
t[s]
|
|
18
18
|
);
|
|
19
|
-
return
|
|
19
|
+
return a;
|
|
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 =
|
|
24
|
-
return !t || !
|
|
23
|
+
const t = C(e.left, i), a = C(e.right, i);
|
|
24
|
+
return !t || !a || t === a;
|
|
25
25
|
});
|
|
26
26
|
}
|
|
27
|
-
function
|
|
27
|
+
function X(e) {
|
|
28
28
|
return e.capabilities.prefixLevels.every((i) => {
|
|
29
|
-
const t =
|
|
30
|
-
return t ?
|
|
29
|
+
const t = C(e.requested, i);
|
|
30
|
+
return t ? C(e.allowed, i) === t : !0;
|
|
31
31
|
});
|
|
32
32
|
}
|
|
33
|
-
function
|
|
34
|
-
const t = j(e),
|
|
33
|
+
function Y(e, i = {}) {
|
|
34
|
+
const t = j(e), a = {
|
|
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
|
+
...a,
|
|
49
49
|
prefixLevels: ["schema", "table"],
|
|
50
50
|
dialect: "postgres"
|
|
51
51
|
} : t.includes("mysql") ? {
|
|
52
|
-
...
|
|
52
|
+
...a,
|
|
53
53
|
prefixLevels: ["database", "table"],
|
|
54
54
|
dialect: "mysql",
|
|
55
55
|
supportsFilterClause: !1
|
|
56
56
|
} : t.includes("mssql") || t.includes("sqlserver") ? {
|
|
57
|
-
...
|
|
57
|
+
...a,
|
|
58
58
|
dialect: "mssql",
|
|
59
59
|
supportsFilterClause: !1
|
|
60
60
|
} : t.includes("redshift") ? {
|
|
61
|
-
...
|
|
61
|
+
...a,
|
|
62
62
|
prefixLevels: ["schema", "table"],
|
|
63
63
|
dialect: "redshift"
|
|
64
64
|
} : t.includes("snowflake") ? {
|
|
65
|
-
...
|
|
65
|
+
...a,
|
|
66
66
|
dialect: "snowflake"
|
|
67
67
|
} : t.includes("clickhouse") ? {
|
|
68
68
|
connectionId: i.connectionId,
|
|
@@ -96,7 +96,7 @@ function X(e, i = {}) {
|
|
|
96
96
|
dialect: "postgres",
|
|
97
97
|
supportsFilterClause: !0
|
|
98
98
|
} : t === "bigquery" ? {
|
|
99
|
-
...
|
|
99
|
+
...a,
|
|
100
100
|
labels: {
|
|
101
101
|
database: "Project",
|
|
102
102
|
schema: "Dataset",
|
|
@@ -105,12 +105,12 @@ function X(e, i = {}) {
|
|
|
105
105
|
prefixLevels: ["schema", "table"],
|
|
106
106
|
dialect: "bigquery",
|
|
107
107
|
supportsFilterClause: !1
|
|
108
|
-
} :
|
|
108
|
+
} : a;
|
|
109
109
|
}
|
|
110
110
|
function v(e, i = {}) {
|
|
111
111
|
return M(
|
|
112
112
|
e
|
|
113
|
-
) ?
|
|
113
|
+
) ? Y(e, i) : void 0;
|
|
114
114
|
}
|
|
115
115
|
function M(e) {
|
|
116
116
|
const i = j(e);
|
|
@@ -145,44 +145,44 @@ function z(e) {
|
|
|
145
145
|
return "unknown";
|
|
146
146
|
}
|
|
147
147
|
}
|
|
148
|
-
function
|
|
148
|
+
function ke(e) {
|
|
149
149
|
return e.capabilities.prefixLevels.every(
|
|
150
|
-
(i) => !!
|
|
150
|
+
(i) => !!C(e.source, i)
|
|
151
151
|
);
|
|
152
152
|
}
|
|
153
|
-
function
|
|
154
|
-
const i = e.quoteIdentifier ??
|
|
155
|
-
return e.capabilities.prefixLevels.map((t) =>
|
|
153
|
+
function ge(e) {
|
|
154
|
+
const i = e.quoteIdentifier ?? te;
|
|
155
|
+
return e.capabilities.prefixLevels.map((t) => C(e.source, t)).filter((t) => !!t).map((t) => i(t, e.capabilities.dialect)).join(".");
|
|
156
156
|
}
|
|
157
|
-
function
|
|
157
|
+
function C(e, i) {
|
|
158
158
|
return i === "database" ? e.databaseName : i === "schema" ? e.schemaName : e.tableName;
|
|
159
159
|
}
|
|
160
|
-
function
|
|
160
|
+
function Z(e, i, t) {
|
|
161
161
|
i === "database" ? e.databaseName = t : i === "schema" ? e.schemaName = t : e.tableName = t;
|
|
162
162
|
}
|
|
163
|
-
const
|
|
163
|
+
const ee = [
|
|
164
164
|
['"', '"'],
|
|
165
165
|
["`", "`"],
|
|
166
166
|
["[", "]"]
|
|
167
167
|
];
|
|
168
|
-
function
|
|
168
|
+
function ie(e) {
|
|
169
169
|
const i = e.trim();
|
|
170
|
-
for (const [t,
|
|
171
|
-
if (i.length >= 2 && i.startsWith(t) && i.endsWith(
|
|
172
|
-
return i.slice(1, -1).split(
|
|
170
|
+
for (const [t, a] of ee)
|
|
171
|
+
if (i.length >= 2 && i.startsWith(t) && i.endsWith(a))
|
|
172
|
+
return i.slice(1, -1).split(a + a).join(a);
|
|
173
173
|
return i;
|
|
174
174
|
}
|
|
175
175
|
function V(e) {
|
|
176
176
|
const i = e == null ? void 0 : e.trim();
|
|
177
177
|
if (!i) return [];
|
|
178
|
-
const t = i.split(".").map(
|
|
179
|
-
return t.some((
|
|
178
|
+
const t = i.split(".").map(ie);
|
|
179
|
+
return t.some((a) => !a) ? [] : t;
|
|
180
180
|
}
|
|
181
|
-
function
|
|
181
|
+
function Ne(e) {
|
|
182
182
|
const i = V(e ?? void 0);
|
|
183
183
|
return i[i.length - 1] || "";
|
|
184
184
|
}
|
|
185
|
-
function
|
|
185
|
+
function te(e, i) {
|
|
186
186
|
return i === "mysql" || i === "bigquery" || i === "clickhouse" || i === "duckdb" ? `\`${e.replace(/`/g, "``")}\`` : i === "mssql" ? `[${e.replace(/]/g, "]]")}]` : `"${e.replace(/"/g, '""')}"`;
|
|
187
187
|
}
|
|
188
188
|
function j(e) {
|
|
@@ -190,10 +190,10 @@ function j(e) {
|
|
|
190
190
|
return "";
|
|
191
191
|
const i = [];
|
|
192
192
|
for (const t of e.trim().toLowerCase())
|
|
193
|
-
|
|
193
|
+
ae(t) && i.push(t);
|
|
194
194
|
return i.join("");
|
|
195
195
|
}
|
|
196
|
-
function
|
|
196
|
+
function ae(e) {
|
|
197
197
|
const i = e.charCodeAt(0);
|
|
198
198
|
return i >= 48 && i <= 57 || i >= 97 && i <= 122;
|
|
199
199
|
}
|
|
@@ -205,18 +205,18 @@ function O(e) {
|
|
|
205
205
|
])
|
|
206
206
|
);
|
|
207
207
|
}
|
|
208
|
-
function
|
|
209
|
-
const i = e.source.connectionType ? v(e.source.connectionType) : void 0, t = e.source.dialect ? z(e.source.dialect) : void 0,
|
|
208
|
+
function Ie(e) {
|
|
209
|
+
const i = e.source.connectionType ? v(e.source.connectionType) : void 0, t = e.source.dialect ? z(e.source.dialect) : void 0, a = e.source.dialect && e.source.dialect !== "unknown" ? v(e.source.dialect) : void 0;
|
|
210
210
|
if (!e.capabilities && e.source.connectionType && e.source.dialect && e.source.dialect !== "unknown" && (!i || t === "unknown" || i.dialect !== t))
|
|
211
211
|
return { kind: "incompatible_capabilities" };
|
|
212
|
-
const s = e.capabilities || i ||
|
|
212
|
+
const s = e.capabilities || i || a;
|
|
213
213
|
if (!s) return { kind: "incompatible_capabilities" };
|
|
214
214
|
const r = O(s), o = {
|
|
215
215
|
...r.includes("database") && e.source.databaseName ? { databaseName: e.source.databaseName } : {},
|
|
216
216
|
...r.includes("schema") && e.source.schemaName ? { schemaName: e.source.schemaName } : {},
|
|
217
217
|
...e.source.tableName ? { tableName: e.source.tableName } : {}
|
|
218
|
-
},
|
|
219
|
-
return
|
|
218
|
+
}, n = r.filter((d) => d === "database" ? !o.databaseName : d === "schema" ? !o.schemaName : !o.tableName);
|
|
219
|
+
return n.length > 0 ? { kind: "missing_coordinates", missing: n } : {
|
|
220
220
|
kind: "resolved",
|
|
221
221
|
coordinates: o
|
|
222
222
|
};
|
|
@@ -242,22 +242,22 @@ function x(e) {
|
|
|
242
242
|
};
|
|
243
243
|
}
|
|
244
244
|
function ne(e) {
|
|
245
|
-
if (
|
|
246
|
-
const i = e.entities.filter(W), t =
|
|
245
|
+
if (ce(e)) return { kind: "malformed" };
|
|
246
|
+
const i = e.entities.filter(W), t = se(e), a = oe({
|
|
247
247
|
entities: i,
|
|
248
248
|
connectionType: e.connectionType,
|
|
249
249
|
dialect: e.dialect,
|
|
250
250
|
capabilities: e.capabilities
|
|
251
251
|
});
|
|
252
|
-
if (!
|
|
253
|
-
const { capabilities: s } =
|
|
252
|
+
if (!a) return { kind: "incompatible_capabilities" };
|
|
253
|
+
const { capabilities: s } = a, r = le({
|
|
254
254
|
hints: e.qualifiedHints || [],
|
|
255
255
|
coordinateHint: e.coordinateHint,
|
|
256
|
-
capabilityAuthority:
|
|
256
|
+
capabilityAuthority: a
|
|
257
257
|
});
|
|
258
258
|
if (r.kind !== "valid")
|
|
259
259
|
return { kind: r.kind };
|
|
260
|
-
const o = r.coordinates,
|
|
260
|
+
const o = r.coordinates, n = o ? i.filter(
|
|
261
261
|
(c) => P({
|
|
262
262
|
left: G(
|
|
263
263
|
x(c),
|
|
@@ -267,23 +267,23 @@ function ne(e) {
|
|
|
267
267
|
capabilities: s
|
|
268
268
|
})
|
|
269
269
|
) : i;
|
|
270
|
-
if (o &&
|
|
270
|
+
if (o && n.length === 0)
|
|
271
271
|
return {
|
|
272
272
|
kind: "not_found",
|
|
273
273
|
basis: "qualified",
|
|
274
274
|
coordinates: o,
|
|
275
|
-
capabilityAuthority:
|
|
275
|
+
capabilityAuthority: a
|
|
276
276
|
};
|
|
277
|
-
if (o &&
|
|
278
|
-
const c =
|
|
279
|
-
|
|
277
|
+
if (o && n.length === 1) {
|
|
278
|
+
const c = n[0], u = E(
|
|
279
|
+
a,
|
|
280
280
|
c
|
|
281
281
|
);
|
|
282
282
|
return {
|
|
283
283
|
kind: "resolved",
|
|
284
284
|
basis: "qualified",
|
|
285
285
|
entity: c,
|
|
286
|
-
coordinates:
|
|
286
|
+
coordinates: me(
|
|
287
287
|
x(c),
|
|
288
288
|
o,
|
|
289
289
|
u
|
|
@@ -297,13 +297,13 @@ function ne(e) {
|
|
|
297
297
|
o == null ? void 0 : o.tableName
|
|
298
298
|
]);
|
|
299
299
|
if (d.size > 0) {
|
|
300
|
-
const c =
|
|
301
|
-
const b =
|
|
302
|
-
return Array.from(d).some((
|
|
300
|
+
const c = n.filter((u) => {
|
|
301
|
+
const b = fe(u);
|
|
302
|
+
return Array.from(d).some((y) => b.has(y));
|
|
303
303
|
});
|
|
304
304
|
if (c.length === 1) {
|
|
305
305
|
const u = c[0], b = E(
|
|
306
|
-
|
|
306
|
+
a,
|
|
307
307
|
u
|
|
308
308
|
);
|
|
309
309
|
return {
|
|
@@ -317,7 +317,7 @@ function ne(e) {
|
|
|
317
317
|
capabilityAuthority: b
|
|
318
318
|
};
|
|
319
319
|
}
|
|
320
|
-
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: a };
|
|
321
321
|
}
|
|
322
322
|
if (o)
|
|
323
323
|
return { kind: "ambiguous", basis: "qualified" };
|
|
@@ -325,11 +325,11 @@ function ne(e) {
|
|
|
325
325
|
return {
|
|
326
326
|
kind: "not_found",
|
|
327
327
|
basis: t,
|
|
328
|
-
capabilityAuthority:
|
|
328
|
+
capabilityAuthority: a
|
|
329
329
|
};
|
|
330
330
|
if (i.length === 1) {
|
|
331
331
|
const c = i[0], u = E(
|
|
332
|
-
|
|
332
|
+
a,
|
|
333
333
|
c
|
|
334
334
|
);
|
|
335
335
|
return {
|
|
@@ -345,12 +345,12 @@ function ne(e) {
|
|
|
345
345
|
}
|
|
346
346
|
return { kind: "unqualified" };
|
|
347
347
|
}
|
|
348
|
-
function
|
|
349
|
-
const i = (e.qualifiedHints || []).map(f).filter((
|
|
348
|
+
function se(e) {
|
|
349
|
+
const i = (e.qualifiedHints || []).map(f).filter((a) => !!a);
|
|
350
350
|
return Object.values(e.coordinateHint || {}).some(
|
|
351
|
-
(
|
|
352
|
-
) || i.some((
|
|
353
|
-
(
|
|
351
|
+
(a) => !!f(a)
|
|
352
|
+
) || i.some((a) => a.includes(".")) ? "qualified" : [...i, ...e.bareHints || []].some(
|
|
353
|
+
(a) => !!f(a)
|
|
354
354
|
) ? "bare" : void 0;
|
|
355
355
|
}
|
|
356
356
|
function S(e) {
|
|
@@ -362,29 +362,29 @@ function L(e) {
|
|
|
362
362
|
prefixLevels: [...e.prefixLevels]
|
|
363
363
|
};
|
|
364
364
|
}
|
|
365
|
-
function
|
|
365
|
+
function oe(e) {
|
|
366
366
|
var q;
|
|
367
|
-
const i = f(e.connectionType), t = f(e.dialect),
|
|
368
|
-
if (i && !s || t && t !== "unknown" && r === "unknown" ||
|
|
367
|
+
const i = f(e.connectionType), t = f(e.dialect), a = 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" || a && s && S(a) !== S(s))
|
|
369
369
|
return;
|
|
370
|
-
const
|
|
371
|
-
if (
|
|
372
|
-
return r && r !== "unknown" &&
|
|
373
|
-
capabilities:
|
|
370
|
+
const n = a || (s ? L(s) : o ? L(o) : void 0);
|
|
371
|
+
if (n)
|
|
372
|
+
return r && r !== "unknown" && n.dialect !== r ? void 0 : {
|
|
373
|
+
capabilities: n,
|
|
374
374
|
...i ? { connectionType: i } : {},
|
|
375
|
-
dialect:
|
|
375
|
+
dialect: n.dialect,
|
|
376
376
|
evidence: "explicit"
|
|
377
377
|
};
|
|
378
378
|
const d = e.entities.map((m) => {
|
|
379
|
-
const k = w(m),
|
|
380
|
-
if (
|
|
379
|
+
const k = w(m), N = f(k == null ? void 0 : k.connectionType), p = f(k == null ? void 0 : k.dialect), I = N ? v(N) : void 0, H = p ? z(p) : void 0, A = p && p !== "unknown" ? v(p) : void 0;
|
|
380
|
+
if (N && !I || p && p !== "unknown" && H === "unknown" || p && p !== "unknown" && !I && !A || I && H && H !== "unknown" && I.dialect !== H)
|
|
381
381
|
return;
|
|
382
|
-
const F =
|
|
382
|
+
const F = I || A, B = F ? L(F) : re(k);
|
|
383
383
|
return B ? {
|
|
384
384
|
capabilities: B,
|
|
385
|
-
connectionType:
|
|
386
|
-
capabilityIdentity:
|
|
387
|
-
inferred: !
|
|
385
|
+
connectionType: N,
|
|
386
|
+
capabilityIdentity: N ? M(N) : void 0,
|
|
387
|
+
inferred: !I && !A,
|
|
388
388
|
signature: S(B)
|
|
389
389
|
} : void 0;
|
|
390
390
|
});
|
|
@@ -399,17 +399,17 @@ function se(e) {
|
|
|
399
399
|
return;
|
|
400
400
|
const b = new Set(
|
|
401
401
|
c.map((m) => m.capabilityIdentity).filter((m) => !!m)
|
|
402
|
-
),
|
|
402
|
+
), y = c.every(
|
|
403
403
|
(m) => m.connectionType && m.capabilityIdentity
|
|
404
404
|
);
|
|
405
405
|
return {
|
|
406
406
|
capabilities: u,
|
|
407
|
-
...
|
|
407
|
+
...y && b.size === 1 ? { connectionType: c[0].connectionType } : {},
|
|
408
408
|
dialect: u.dialect,
|
|
409
409
|
evidence: c.every((m) => m.inferred) ? "coordinates" : "entity"
|
|
410
410
|
};
|
|
411
411
|
}
|
|
412
|
-
function
|
|
412
|
+
function re(e) {
|
|
413
413
|
const i = !!f(e == null ? void 0 : e.database), t = !!f(e == null ? void 0 : e.schema);
|
|
414
414
|
if (!(i && t)) {
|
|
415
415
|
if (t)
|
|
@@ -421,34 +421,34 @@ function oe(e) {
|
|
|
421
421
|
function E(e, i) {
|
|
422
422
|
var s;
|
|
423
423
|
if (e.evidence !== "entity") return e;
|
|
424
|
-
const t = f((s = w(i)) == null ? void 0 : s.connectionType),
|
|
425
|
-
return
|
|
424
|
+
const t = f((s = w(i)) == null ? void 0 : s.connectionType), a = t ? v(t) : void 0;
|
|
425
|
+
return a && S(a) === S(e.capabilities) ? { ...e, connectionType: t } : e;
|
|
426
426
|
}
|
|
427
|
-
function
|
|
427
|
+
function ce(e) {
|
|
428
428
|
return (e.qualifiedHints || []).some(
|
|
429
429
|
(t) => {
|
|
430
|
-
const
|
|
431
|
-
return !!(
|
|
430
|
+
const a = f(t);
|
|
431
|
+
return !!(a && a.includes(".") && !h(a));
|
|
432
432
|
}
|
|
433
433
|
) ? !0 : Object.values(e.coordinateHint || {}).some((t) => {
|
|
434
|
-
const
|
|
435
|
-
return !!(
|
|
434
|
+
const a = f(t);
|
|
435
|
+
return !!(a && !h(a));
|
|
436
436
|
});
|
|
437
437
|
}
|
|
438
|
-
function
|
|
439
|
-
const { capabilities: i } = e.capabilityAuthority, t = [],
|
|
438
|
+
function le(e) {
|
|
439
|
+
const { capabilities: i } = e.capabilityAuthority, t = [], a = [];
|
|
440
440
|
for (const b of e.hints) {
|
|
441
|
-
const
|
|
442
|
-
if (!
|
|
443
|
-
if (!
|
|
444
|
-
|
|
441
|
+
const y = f(b);
|
|
442
|
+
if (!y) continue;
|
|
443
|
+
if (!y.includes(".")) {
|
|
444
|
+
a.push(y);
|
|
445
445
|
continue;
|
|
446
446
|
}
|
|
447
|
-
const q =
|
|
447
|
+
const q = h(y);
|
|
448
448
|
if (!q) return { kind: "malformed" };
|
|
449
449
|
t.push(q);
|
|
450
450
|
}
|
|
451
|
-
const s =
|
|
451
|
+
const s = de(e.coordinateHint);
|
|
452
452
|
if (s.kind === "malformed") return s;
|
|
453
453
|
const r = Array.from(new Set(t)).map(
|
|
454
454
|
(b) => Q({
|
|
@@ -456,11 +456,11 @@ function ce(e) {
|
|
|
456
456
|
capabilities: i
|
|
457
457
|
})
|
|
458
458
|
);
|
|
459
|
-
if (!
|
|
459
|
+
if (!ue(r, i))
|
|
460
460
|
return { kind: "conflicting" };
|
|
461
461
|
const o = [...new Set(t)].sort(
|
|
462
|
-
(b,
|
|
463
|
-
)[0],
|
|
462
|
+
(b, y) => y.split(".").length - b.split(".").length
|
|
463
|
+
)[0], n = o ? Q({
|
|
464
464
|
qualifiedName: o,
|
|
465
465
|
capabilities: i
|
|
466
466
|
}) : void 0, d = G(
|
|
@@ -470,28 +470,28 @@ function ce(e) {
|
|
|
470
470
|
s.coordinates,
|
|
471
471
|
e.capabilityAuthority
|
|
472
472
|
), u = !!(d.tableName && (d.databaseName || d.schemaName));
|
|
473
|
-
return
|
|
474
|
-
left:
|
|
473
|
+
return n && u && !P({
|
|
474
|
+
left: n,
|
|
475
475
|
right: d,
|
|
476
476
|
capabilities: i
|
|
477
477
|
}) ? { kind: "conflicting" } : {
|
|
478
478
|
kind: "valid",
|
|
479
|
-
coordinates:
|
|
479
|
+
coordinates: n ? {
|
|
480
480
|
...c,
|
|
481
|
-
...
|
|
481
|
+
...n
|
|
482
482
|
} : u ? c : void 0,
|
|
483
483
|
bareHints: [
|
|
484
|
-
...
|
|
484
|
+
...a,
|
|
485
485
|
...!u && d.tableName ? [d.tableName] : []
|
|
486
486
|
]
|
|
487
487
|
};
|
|
488
488
|
}
|
|
489
|
-
function
|
|
489
|
+
function de(e) {
|
|
490
490
|
const i = {};
|
|
491
|
-
for (const [t,
|
|
492
|
-
const s = f(
|
|
491
|
+
for (const [t, a] of Object.entries(e || {})) {
|
|
492
|
+
const s = f(a);
|
|
493
493
|
if (!s) continue;
|
|
494
|
-
const r =
|
|
494
|
+
const r = h(s);
|
|
495
495
|
if (!r) return { kind: "malformed" };
|
|
496
496
|
i[t] = r;
|
|
497
497
|
}
|
|
@@ -504,9 +504,9 @@ function G(e, i) {
|
|
|
504
504
|
...e.tableName ? { tableName: e.tableName } : {}
|
|
505
505
|
};
|
|
506
506
|
}
|
|
507
|
-
function
|
|
507
|
+
function ue(e, i) {
|
|
508
508
|
return e.every(
|
|
509
|
-
(t,
|
|
509
|
+
(t, a) => e.slice(a + 1).every(
|
|
510
510
|
(s) => P({
|
|
511
511
|
left: t,
|
|
512
512
|
right: s,
|
|
@@ -517,10 +517,10 @@ function de(e, i) {
|
|
|
517
517
|
}
|
|
518
518
|
function U(e) {
|
|
519
519
|
return new Set(
|
|
520
|
-
e.map(f).map(
|
|
520
|
+
e.map(f).map(h).filter((i) => !!i)
|
|
521
521
|
);
|
|
522
522
|
}
|
|
523
|
-
function
|
|
523
|
+
function fe(e) {
|
|
524
524
|
const i = w(e);
|
|
525
525
|
return i ? U([
|
|
526
526
|
f(i.name),
|
|
@@ -528,7 +528,7 @@ function ue(e) {
|
|
|
528
528
|
f(i.id)
|
|
529
529
|
]) : /* @__PURE__ */ new Set();
|
|
530
530
|
}
|
|
531
|
-
function
|
|
531
|
+
function me(e, i, t) {
|
|
532
532
|
return T(
|
|
533
533
|
{
|
|
534
534
|
...e,
|
|
@@ -548,67 +548,67 @@ function T(e, i) {
|
|
|
548
548
|
function l(e) {
|
|
549
549
|
return typeof e == "string" && e.trim() ? e.trim() : void 0;
|
|
550
550
|
}
|
|
551
|
-
function
|
|
551
|
+
function g(e) {
|
|
552
552
|
return e && typeof e == "object" && !Array.isArray(e) ? e : void 0;
|
|
553
553
|
}
|
|
554
|
-
function
|
|
555
|
-
const i =
|
|
554
|
+
function be(e) {
|
|
555
|
+
const i = g(e);
|
|
556
556
|
return !!(i && i.type === "dataset" && l(i.name));
|
|
557
557
|
}
|
|
558
558
|
function J(e) {
|
|
559
|
-
const i =
|
|
559
|
+
const i = g(e);
|
|
560
560
|
return !!(i && i.type === "dataset" && i.datasetType !== "physical" && l(i.name));
|
|
561
561
|
}
|
|
562
562
|
function R(e) {
|
|
563
563
|
const i = /* @__PURE__ */ new Set();
|
|
564
564
|
for (const t of e) {
|
|
565
|
-
const
|
|
566
|
-
if (!
|
|
567
|
-
const s =
|
|
565
|
+
const a = l(t);
|
|
566
|
+
if (!a) continue;
|
|
567
|
+
const s = h(a);
|
|
568
568
|
if (!s) continue;
|
|
569
569
|
const r = s.toLowerCase();
|
|
570
570
|
i.add(r);
|
|
571
|
-
const o = r.split("."),
|
|
572
|
-
|
|
571
|
+
const o = r.split("."), n = o[o.length - 1];
|
|
572
|
+
n && i.add(n);
|
|
573
573
|
}
|
|
574
574
|
return i;
|
|
575
575
|
}
|
|
576
576
|
function $(e) {
|
|
577
577
|
var t;
|
|
578
578
|
const i = l(e);
|
|
579
|
-
return i ? (t =
|
|
579
|
+
return i ? (t = h(i)) == null ? void 0 : t.toLowerCase() : void 0;
|
|
580
580
|
}
|
|
581
581
|
function D(e, i) {
|
|
582
|
-
const t =
|
|
583
|
-
if (!
|
|
582
|
+
const t = g(i), a = l(t == null ? void 0 : t.domainId) || l(e.semanticDomainId), s = l(t == null ? void 0 : t.name);
|
|
583
|
+
if (!a || !s) return;
|
|
584
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);
|
|
585
585
|
return {
|
|
586
586
|
kind: "semantic",
|
|
587
|
-
domainId:
|
|
587
|
+
domainId: a,
|
|
588
588
|
datasetName: s,
|
|
589
589
|
...r ? { datasetId: r } : {},
|
|
590
590
|
...o ? { connectionId: o } : {}
|
|
591
591
|
};
|
|
592
592
|
}
|
|
593
|
-
function
|
|
593
|
+
function he(e, i = {}) {
|
|
594
594
|
const t = l(e.fieldEntityType);
|
|
595
595
|
if (t && t !== "dataset")
|
|
596
596
|
return { kind: "unqualified" };
|
|
597
|
-
const
|
|
598
|
-
(o) => i.includePhysicalDatasets ?
|
|
597
|
+
const a = e.entities.filter(
|
|
598
|
+
(o) => i.includePhysicalDatasets ? be(o) : J(o)
|
|
599
599
|
), s = l(e.entityId);
|
|
600
600
|
if (s) {
|
|
601
|
-
const o = $(s),
|
|
602
|
-
const c =
|
|
601
|
+
const o = $(s), n = a.filter((d) => {
|
|
602
|
+
const c = g(d);
|
|
603
603
|
return !!(o && $(c == null ? void 0 : c.id) === o);
|
|
604
604
|
});
|
|
605
|
-
if (
|
|
606
|
-
if (
|
|
607
|
-
const d = D(e,
|
|
605
|
+
if (n.length > 1) return { kind: "ambiguous", basis: "bare" };
|
|
606
|
+
if (n.length === 1) {
|
|
607
|
+
const d = D(e, n[0]);
|
|
608
608
|
return d ? {
|
|
609
609
|
kind: "resolved",
|
|
610
610
|
basis: "bare",
|
|
611
|
-
entity:
|
|
611
|
+
entity: n[0],
|
|
612
612
|
source: d,
|
|
613
613
|
matchedById: !0
|
|
614
614
|
} : { kind: "not_found", basis: "bare" };
|
|
@@ -620,29 +620,29 @@ function be(e, i = {}) {
|
|
|
620
620
|
...e.bareHints || []
|
|
621
621
|
]);
|
|
622
622
|
if (r.size > 0) {
|
|
623
|
-
const o =
|
|
624
|
-
const d =
|
|
623
|
+
const o = a.filter((n) => {
|
|
624
|
+
const d = g(n);
|
|
625
625
|
return [...R([d == null ? void 0 : d.id, d == null ? void 0 : d.name])].some((u) => r.has(u));
|
|
626
626
|
});
|
|
627
627
|
if (o.length > 1) return { kind: "ambiguous", basis: "bare" };
|
|
628
628
|
if (o.length === 1) {
|
|
629
|
-
const
|
|
630
|
-
return
|
|
629
|
+
const n = D(e, o[0]);
|
|
630
|
+
return n ? {
|
|
631
631
|
kind: "resolved",
|
|
632
632
|
basis: "bare",
|
|
633
633
|
entity: o[0],
|
|
634
|
-
source:
|
|
634
|
+
source: n,
|
|
635
635
|
matchedById: !1
|
|
636
636
|
} : { kind: "not_found", basis: "bare" };
|
|
637
637
|
}
|
|
638
638
|
return { kind: "not_found", basis: "bare" };
|
|
639
639
|
}
|
|
640
|
-
if (
|
|
641
|
-
const o = D(e,
|
|
640
|
+
if (a.length === 1) {
|
|
641
|
+
const o = D(e, a[0]);
|
|
642
642
|
return o ? {
|
|
643
643
|
kind: "resolved",
|
|
644
644
|
basis: "unqualified",
|
|
645
|
-
entity:
|
|
645
|
+
entity: a[0],
|
|
646
646
|
source: o,
|
|
647
647
|
matchedById: !1
|
|
648
648
|
} : { kind: "unqualified" };
|
|
@@ -650,21 +650,39 @@ function be(e, i = {}) {
|
|
|
650
650
|
return { kind: "unqualified" };
|
|
651
651
|
}
|
|
652
652
|
function _(e) {
|
|
653
|
-
const i = e.resolution.kind === "resolved" ?
|
|
653
|
+
const i = e.resolution.kind === "resolved" ? g(e.resolution.entity) : void 0, t = l(e.connectionId) || l(i == null ? void 0 : i.connectionId), { connectionType: a, 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(
|
|
654
654
|
"."
|
|
655
|
-
)),
|
|
656
|
-
if (!(!t || !(
|
|
655
|
+
)), n = e.resolution.coordinates;
|
|
656
|
+
if (!(!t || !(n != null && n.tableName)))
|
|
657
657
|
return {
|
|
658
658
|
kind: "physical",
|
|
659
659
|
connectionId: t,
|
|
660
|
-
...
|
|
661
|
-
...!
|
|
662
|
-
tableName:
|
|
663
|
-
...
|
|
664
|
-
...
|
|
660
|
+
...a ? { connectionType: a } : {},
|
|
661
|
+
...!a && o ? { dialect: s } : {},
|
|
662
|
+
tableName: n.tableName,
|
|
663
|
+
...n.databaseName ? { databaseName: n.databaseName } : {},
|
|
664
|
+
...n.schemaName ? { schemaName: n.schemaName } : {}
|
|
665
665
|
};
|
|
666
666
|
}
|
|
667
|
-
function
|
|
667
|
+
function ye(e) {
|
|
668
|
+
const i = g(e.entity), t = h(l(i == null ? void 0 : i.table));
|
|
669
|
+
if (!t) return !1;
|
|
670
|
+
const a = h(
|
|
671
|
+
l(i == null ? void 0 : i.database)
|
|
672
|
+
), s = h(
|
|
673
|
+
l(i == null ? void 0 : i.schema)
|
|
674
|
+
);
|
|
675
|
+
return e.coordinates.tableName ? X({
|
|
676
|
+
requested: e.coordinates,
|
|
677
|
+
allowed: {
|
|
678
|
+
...a ? { databaseName: a } : {},
|
|
679
|
+
...s ? { schemaName: s } : {},
|
|
680
|
+
tableName: t
|
|
681
|
+
},
|
|
682
|
+
capabilities: e.capabilityAuthority.capabilities
|
|
683
|
+
}) : !1;
|
|
684
|
+
}
|
|
685
|
+
function pe(e) {
|
|
668
686
|
var s, r, o;
|
|
669
687
|
if (l(e.connectionType) || l(e.dialect) || e.capabilities || l(e.semanticDomainId) || l(e.fieldEntityType) === "dataset" || l((s = e.fallbackCoordinateHint) == null ? void 0 : s.databaseName) || l((r = e.fallbackCoordinateHint) == null ? void 0 : r.schemaName))
|
|
670
688
|
return;
|
|
@@ -674,23 +692,23 @@ function he(e) {
|
|
|
674
692
|
...(e.bareHints || []).map(l),
|
|
675
693
|
l(e.entityName),
|
|
676
694
|
...l(e.fieldEntityType) === "table" ? [l(e.entityId)] : []
|
|
677
|
-
].filter((
|
|
678
|
-
if (!i.length || i.some((
|
|
695
|
+
].filter((n) => !!n);
|
|
696
|
+
if (!i.length || i.some((n) => n.includes(".")))
|
|
679
697
|
return;
|
|
680
|
-
const t = i.map(
|
|
681
|
-
return t.some((
|
|
698
|
+
const t = i.map(h);
|
|
699
|
+
return t.some((n) => !n) ? void 0 : new Set(t.map((n) => n.toLowerCase())).size === 1 ? t[0] : void 0;
|
|
682
700
|
}
|
|
683
|
-
function
|
|
701
|
+
function Ce(e) {
|
|
684
702
|
const i = e.entities.filter(
|
|
685
703
|
W
|
|
686
704
|
), t = e.entities.filter(
|
|
687
705
|
J
|
|
688
|
-
),
|
|
706
|
+
), a = i.length > 0 || t.length > 0, s = he(e), r = e.qualifiedHints || [], o = r.some(
|
|
689
707
|
(c) => {
|
|
690
708
|
var u;
|
|
691
709
|
return (u = l(c)) == null ? void 0 : u.includes(".");
|
|
692
710
|
}
|
|
693
|
-
),
|
|
711
|
+
), n = ne({
|
|
694
712
|
entities: i,
|
|
695
713
|
connectionType: l(e.connectionType),
|
|
696
714
|
dialect: e.dialect,
|
|
@@ -699,49 +717,60 @@ function Ie(e) {
|
|
|
699
717
|
bareHints: [e.entityName, e.entityId, ...e.bareHints || []],
|
|
700
718
|
...!o && e.fallbackCoordinateHint ? { coordinateHint: e.fallbackCoordinateHint } : {}
|
|
701
719
|
});
|
|
702
|
-
if (
|
|
703
|
-
return
|
|
704
|
-
if (
|
|
720
|
+
if (n.kind === "malformed" || n.kind === "conflicting" || n.kind === "incompatible_capabilities" && o || n.kind === "ambiguous" && n.basis === "qualified")
|
|
721
|
+
return n;
|
|
722
|
+
if (n.kind === "resolved" && n.basis === "qualified") {
|
|
705
723
|
const c = _({
|
|
706
|
-
resolution:
|
|
724
|
+
resolution: n,
|
|
707
725
|
connectionId: e.connectionId
|
|
708
726
|
});
|
|
709
727
|
return c ? {
|
|
710
728
|
kind: "resolved",
|
|
711
|
-
basis:
|
|
729
|
+
basis: n.basis,
|
|
712
730
|
source: c,
|
|
713
|
-
entity:
|
|
731
|
+
entity: n.entity
|
|
714
732
|
} : { kind: "missing_connection" };
|
|
715
733
|
}
|
|
716
|
-
if (
|
|
734
|
+
if (n.kind === "not_found" && n.basis === "qualified" && n.coordinates) {
|
|
735
|
+
if (s.kind === "resolved" && s.matchedById && ye({
|
|
736
|
+
entity: s.entity,
|
|
737
|
+
coordinates: n.coordinates,
|
|
738
|
+
capabilityAuthority: n.capabilityAuthority
|
|
739
|
+
}))
|
|
740
|
+
return {
|
|
741
|
+
kind: "resolved",
|
|
742
|
+
basis: s.basis,
|
|
743
|
+
source: s.source,
|
|
744
|
+
entity: s.entity
|
|
745
|
+
};
|
|
717
746
|
const c = _({
|
|
718
|
-
resolution:
|
|
747
|
+
resolution: n,
|
|
719
748
|
connectionId: e.connectionId
|
|
720
749
|
});
|
|
721
|
-
return c ?
|
|
750
|
+
return c ? a ? { kind: "candidate", basis: "qualified", source: c } : { kind: "resolved", basis: "qualified", source: c } : { kind: "missing_connection" };
|
|
722
751
|
}
|
|
723
752
|
if (s.kind === "resolved")
|
|
724
|
-
return
|
|
753
|
+
return n.kind === "resolved" && n.basis === "bare" && !s.matchedById ? { kind: "ambiguous", basis: "bare" } : {
|
|
725
754
|
kind: "resolved",
|
|
726
755
|
basis: s.basis,
|
|
727
756
|
source: s.source,
|
|
728
757
|
entity: s.entity
|
|
729
758
|
};
|
|
730
759
|
if (s.kind === "ambiguous") return s;
|
|
731
|
-
if (
|
|
760
|
+
if (n.kind === "resolved") {
|
|
732
761
|
const c = _({
|
|
733
|
-
resolution:
|
|
762
|
+
resolution: n,
|
|
734
763
|
connectionId: e.connectionId
|
|
735
764
|
});
|
|
736
765
|
return c ? {
|
|
737
766
|
kind: "resolved",
|
|
738
|
-
basis:
|
|
767
|
+
basis: n.basis,
|
|
739
768
|
source: c,
|
|
740
|
-
entity:
|
|
769
|
+
entity: n.entity
|
|
741
770
|
} : { kind: "missing_connection" };
|
|
742
771
|
}
|
|
743
772
|
const d = l(e.entityName) || l(e.entityId);
|
|
744
|
-
if (!
|
|
773
|
+
if (!a && !o && l(e.semanticDomainId) && (!l(e.fieldEntityType) || l(e.fieldEntityType) === "dataset") && d)
|
|
745
774
|
return {
|
|
746
775
|
kind: "resolved",
|
|
747
776
|
basis: "historical",
|
|
@@ -752,35 +781,35 @@ function Ie(e) {
|
|
|
752
781
|
...l(e.connectionId) ? { connectionId: l(e.connectionId) } : {}
|
|
753
782
|
}
|
|
754
783
|
};
|
|
755
|
-
if (
|
|
756
|
-
const c =
|
|
784
|
+
if (n.kind === "incompatible_capabilities") {
|
|
785
|
+
const c = a ? void 0 : pe(e), u = l(e.connectionId);
|
|
757
786
|
return c && u ? {
|
|
758
787
|
kind: "resolved",
|
|
759
788
|
basis: "historical",
|
|
760
789
|
source: { kind: "physical", connectionId: u, tableName: c }
|
|
761
|
-
} :
|
|
790
|
+
} : n;
|
|
762
791
|
}
|
|
763
|
-
return
|
|
792
|
+
return n.kind === "ambiguous" ? n : n.kind === "not_found" ? {
|
|
764
793
|
kind: "not_found",
|
|
765
|
-
basis:
|
|
794
|
+
basis: n.basis
|
|
766
795
|
} : { kind: "unqualified" };
|
|
767
796
|
}
|
|
768
797
|
export {
|
|
769
|
-
|
|
798
|
+
X as a,
|
|
770
799
|
M as b,
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
800
|
+
h as c,
|
|
801
|
+
ke as d,
|
|
802
|
+
ge as e,
|
|
803
|
+
Ne as f,
|
|
804
|
+
Y as g,
|
|
776
805
|
O as h,
|
|
777
|
-
|
|
806
|
+
Ie as i,
|
|
778
807
|
W as j,
|
|
779
808
|
ne as k,
|
|
780
809
|
J as l,
|
|
781
|
-
|
|
810
|
+
he as m,
|
|
782
811
|
z as n,
|
|
783
|
-
|
|
812
|
+
Ce as o,
|
|
784
813
|
Q as p,
|
|
785
814
|
v as r,
|
|
786
815
|
P as s
|