react-semaphor 0.1.327 → 0.1.329
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 +211 -72
- package/dist/brand-studio/index.cjs +5 -5
- package/dist/brand-studio/index.js +23 -24
- package/dist/chunks/_commonjsHelpers-BVfed4GL.js +28 -0
- package/dist/chunks/_commonjsHelpers-DwTZ_eVU.js +1 -0
- package/dist/chunks/{braces-BGWZEnQJ.js → braces-CG8viaD2.js} +1 -1
- package/dist/chunks/{braces-B6qRDu1H.js → braces-DSaa_4Oc.js} +1 -1
- package/dist/chunks/{calendar-preferences-dialog-fkLUMJyR.js → calendar-preferences-dialog-DD_qAthL.js} +1 -1
- package/dist/chunks/{calendar-preferences-dialog-CjwbE_82.js → calendar-preferences-dialog-JRmNJptJ.js} +3 -3
- package/dist/chunks/{chevrons-up-down-xG-bVFD9.js → chevrons-up-down-CBa0uh0X.js} +1 -1
- package/dist/chunks/{chevrons-up-down-BpsogQvv.js → chevrons-up-down-ChDNqVP7.js} +1 -1
- package/dist/chunks/dashboard-briefing-launcher-BKdJFwH5.js +106 -0
- package/dist/chunks/{dashboard-briefing-launcher-Cy1nWZRW.js → dashboard-briefing-launcher-BfyNkd8i.js} +1141 -1137
- package/dist/chunks/{dashboard-controls-BWnVEFJq.js → dashboard-controls-0pZDLvFL.js} +218 -218
- package/dist/chunks/{dashboard-controls-C7rOGZO-.js → dashboard-controls-C0xm1QMR.js} +10 -10
- package/dist/chunks/dashboard-json-BW5OVZ6m.js +1 -0
- package/dist/chunks/{dashboard-json-BpRNSsF3.js → dashboard-json-DsruhRPD.js} +14 -13
- package/dist/chunks/{edit-dashboard-visual-B2vkIKEa.js → edit-dashboard-visual-DQyJ7SSv.js} +1 -1
- package/dist/chunks/{edit-dashboard-visual-CYf26co_.js → edit-dashboard-visual-g5SZZahJ.js} +9 -8
- package/dist/chunks/index-1JWDPCun.js +1935 -0
- package/dist/chunks/index-BdjXTQt4.js +1444 -0
- package/dist/chunks/{index-DTlbYpxd.js → index-BmKr-K7J.js} +116971 -113296
- package/dist/chunks/index-C1l78BIx.js +3247 -0
- package/dist/chunks/lib-Ce3zosXY.js +38 -0
- package/dist/chunks/lib-DFvr9fM4.js +5500 -0
- package/dist/chunks/{palette-CSF7IVJn.js → palette-D0YmAqBS.js} +1 -1
- package/dist/chunks/{palette-CWgEPBoG.js → palette-DQgq3edH.js} +1 -1
- package/dist/chunks/{resource-management-panel-D6nbfJY3.js → resource-management-panel-CIfBh46E.js} +1 -1
- package/dist/chunks/{resource-management-panel-D893Onv8.js → resource-management-panel-Cj19pw9M.js} +145 -145
- package/dist/chunks/{switch-DJJJD_g1.js → switch-BvTzw2AW.js} +39 -34
- package/dist/chunks/{switch-DKf6vHfP.js → switch-De31SR3q.js} +878 -885
- package/dist/chunks/typescript-Cmizj1hi.js +446 -0
- package/dist/chunks/typescript-H1EwZsOb.js +159820 -0
- package/dist/chunks/use-create-flow-overlay-state-BTQiKRD1.js +26 -0
- package/dist/chunks/{use-create-flow-overlay-state-p21zs2p6.js → use-create-flow-overlay-state-IcHP0l39.js} +150 -151
- package/dist/chunks/{use-visual-utils-BKBua6o4.js → use-visual-utils-DQ5zGYD2.js} +13 -13
- package/dist/chunks/{use-visual-utils-BqWm0QeW.js → use-visual-utils-XF-AqV8o.js} +1 -1
- package/dist/dashboard/index.cjs +1 -1
- package/dist/dashboard/index.js +1 -1
- package/dist/data-app-builder/index.cjs +1 -0
- package/dist/data-app-builder/index.js +4 -0
- package/dist/data-app-builder-browser-runtime/index.cjs +1 -0
- package/dist/data-app-builder-browser-runtime/index.js +10 -0
- package/dist/data-app-sdk/index.cjs +1 -1
- package/dist/data-app-sdk/index.js +208 -196
- package/dist/index.cjs +1 -1
- package/dist/index.js +14 -14
- package/dist/style.css +1 -1
- package/dist/surfboard/index.cjs +1 -1
- package/dist/surfboard/index.js +2 -2
- package/dist/types/analytics-protocol.d.ts +76 -1
- package/dist/types/dashboard-authoring.d.ts +2 -1
- package/dist/types/data-app-builder-browser-runtime.d.ts +185 -0
- package/dist/types/data-app-builder.d.ts +631 -0
- package/dist/types/data-app-sdk.d.ts +16 -2
- package/dist/types/main.d.ts +4 -1
- package/package.json +11 -1
- package/dist/chunks/dashboard-briefing-launcher-Co57xBfS.js +0 -106
- package/dist/chunks/dashboard-json-DBPMknGo.js +0 -1
- package/dist/chunks/index-BD90s-wf.js +0 -1309
- package/dist/chunks/save-CtQbSub2.js +0 -6
- package/dist/chunks/save-DRdFKF57.js +0 -21
- package/dist/chunks/use-create-flow-overlay-state-C4LgoK8q.js +0 -26
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("../chunks/validators-odlRJblR.js");function s(e){return typeof e=="string"?e.trim().toLowerCase():""}function g(e){return String(e.column_name||e.name||e.qualifiedFieldName||"")}function y(e){return Array.from(new Set([e.column_name,e.name,e.qualifiedFieldName,e.alias].filter(a=>typeof a=="string"&&a.trim().length>0).map(a=>a.trim())))}function u(e){const a=s(e);return a?a.includes("int")||a.includes("numeric")||a.includes("decimal")||a.includes("double")||a.includes("float")||a.includes("number")||a.includes("real")||a.includes("money")?"number":a.includes("timestamp")||a.includes("datetime")||a==="time"||a.startsWith("time ")?"datetime":a.includes("date")?"date":a.includes("bool")?"boolean":"string":"unknown"}function h(e){const a=u(e);return a==="date"||a==="datetime"}function m(e){return h(e.dataType||e.data_type)}function p(e){const a=v(e);return a==="id"||a==="row_id"}function d(e){const a=v(e);return p(e)||a.endsWith("_id")||a.endsWith("_key")||a.endsWith("_number")}function v(e){return s(g(e)||e.name||e.alias).replace(/[^a-z0-9]+/g,"_").replace(/^_+|_+$/g,"")}function f(e,a={}){const t=s(e.role);return t==="metric"||t==="measure"?!a.excludeIdentifiers||!d(e):t==="groupby"||t==="dimension"||t==="date"||t==="id"?!1:u(e.dataType||e.data_type)==="number"&&(!a.excludeIdentifiers||!d(e))}function A(e){return!f(e)&&!m(e)}function S(e){return[e.column_name,e.name,e.label,e.alias,e.qualifiedFieldName].filter(a=>typeof a=="string"&&a.trim().length>0).map(a=>s(a).replace(/[^a-z0-9]+/g," ")).join(" ")}function c(e,a){return a.some(t=>{const i=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return new RegExp(`(^|\\s)${i}(\\s|$)`,"i").test(e)})}function T(e){const a=S(e);if(a)return c(a,["pct","percent","percentage","rate","ratio","share","conversion","retention","churn","growth","margin rate","margin pct","margin percent","margin percentage"])?{type:"percent",minimumFractionDigits:0,maximumFractionDigits:1,percentValueMode:"fraction"}:c(a,["revenue","sales","profit","arr","mrr","gmv","amount","price","cost","spend","expense","budget","income","value","booking","bookings"])?{type:"currency",currency:"USD",minimumFractionDigits:0,maximumFractionDigits:1,compact:!0}:c(a,["count","quantity","orders","order","users","customers","tickets","units","sessions","visits","items","rows"])?{type:"number",minimumFractionDigits:0,maximumFractionDigits:0,compact:!0}:{type:"number",minimumFractionDigits:0,maximumFractionDigits:1,compact:!0}}function k(e){const a=new Set,t=new Set,i=new Set;for(const o of e){if(p(o))continue;const l=y(o);if(l.length!==0){if(m(o)){l.forEach(r=>t.add(r));continue}if(f(o,{excludeIdentifiers:!0})){l.forEach(r=>a.add(r));continue}l.forEach(r=>i.add(r))}}return{validMetricCandidates:Array.from(a).sort(),validDateCandidates:Array.from(t).sort(),validDimensionCandidates:Array.from(i).sort()}}function D(e,a={}){const t=F(e),i={connectionId:a.connectionId,connectionType:e,path:["database","schema","table"],labels:{database:"Database",schema:"Schema",table:"Table"},prefixLevels:["database","schema","table"],dialect:"postgres",supportsFilterClause:!0};return t.includes("postgres")?{...i,prefixLevels:["schema","table"],dialect:"postgres"}:t.includes("mysql")?{...i,prefixLevels:["database","table"],dialect:"mysql",supportsFilterClause:!1}:t.includes("mssql")||t.includes("sqlserver")?{...i,dialect:"mssql",supportsFilterClause:!1}:t.includes("redshift")?{...i,prefixLevels:["schema","table"],dialect:"redshift"}:t.includes("snowflake")?{...i,dialect:"snowflake"}:t.includes("clickhouse")?{connectionId:a.connectionId,connectionType:e,path:["database","table"],labels:{database:"Database",table:"Table"},prefixLevels:["database","table"],dialect:"clickhouse",supportsFilterClause:!1}:t==="s3"||t==="api"?{connectionId:a.connectionId,connectionType:e,path:["table"],labels:{table:t==="api"?"API Table":"File Table"},prefixLevels:["table"],dialect:"duckdb",supportsFilterClause:!0}:t==="googlesheets"||t==="fileupload"?{connectionId:a.connectionId,connectionType:e,path:["table"],labels:{table:"Table"},prefixLevels:["table"],dialect:"postgres",supportsFilterClause:!0}:t==="s3tables"?{...i,labels:{database:"Database",schema:"Namespace",table:"Table"},dialect:"duckdb"}:t==="bigquery"?{...i,labels:{database:"Project",schema:"Dataset",table:"Table"},prefixLevels:["schema","table"],dialect:"bigquery",supportsFilterClause:!1}:i}function I(e){const a=F(e);switch(a){case"mysql":case"bigquery":case"redshift":case"snowflake":case"clickhouse":case"duckdb":case"sqlite":return a;case"mssql":case"sqlserver":return"mssql";case"postgres":case"postgresql":return"postgres";case"semantic":return"semantic";default:return"unknown"}}function q(e){return e.capabilities.prefixLevels.every(a=>!!C(e.source,a))}function _(e){const a=e.quoteIdentifier??N;return e.capabilities.prefixLevels.map(t=>C(e.source,t)).filter(t=>!!t).map(t=>a(t,e.capabilities.dialect)).join(".")}function C(e,a){return a==="database"?e.databaseName:a==="schema"?e.schemaName:e.tableName}function N(e,a){return a==="mysql"||a==="bigquery"||a==="clickhouse"||a==="duckdb"?`\`${e.replace(/`/g,"``")}\``:a==="mssql"?`[${e.replace(/]/g,"]]")}]`:`"${e.replace(/"/g,'""')}"`}function F(e){if(typeof e!="string")return"";const a=[];for(const t of e.trim().toLowerCase())x(t)&&a.push(t);return a.join("")}function x(e){const a=e.charCodeAt(0);return a>=48&&a<=57||a>=97&&a<=122}const n={kind:"semantic",domainId:"domain_sales",datasetName:"orders",connectionId:"conn_sales",label:"Orders"},L={revenueKpi:{version:1,kind:"metric",id:"revenue-kpi",label:"Revenue",source:n,metric:"revenue",comparison:{kind:"previous_period"},limit:1},revenueTrend:{version:1,kind:"records",id:"revenue-trend",label:"Revenue trend",source:n,fields:[{name:"order_date",role:"date",dataType:"date",label:"Order Date"}],measures:["revenue"],dateField:{name:"order_date",role:"date",dataType:"date"},timeGrain:"month",limit:100},topCustomersRecords:{version:1,kind:"records",id:"top-customers",label:"Top customers",source:n,fields:[{name:"customer_name",role:"dimension",dataType:"string"},{name:"segment",role:"dimension",dataType:"string"},{name:"revenue",role:"measure",dataType:"number"}],measures:["revenue"],orderBy:{field:"revenue",direction:"desc"},limit:20},regionInputOptions:{version:1,kind:"inputOptions",id:"region-options",label:"Region options",source:n,field:{name:"region",role:"dimension",dataType:"string"},limit:100},previousPeriodRevenueComparison:{version:1,kind:"metric",id:"revenue-previous-period",label:"Revenue previous period comparison",source:n,metric:"revenue",dateField:{name:"order_date",role:"date",dataType:"date"},timeGrain:"week",comparison:{kind:"previous_period"},limit:100},boundedSqlRanking:{version:1,kind:"sql",id:"top-customer-ranking-sql",label:"Top customer ranking SQL",source:{kind:"physical",connectionId:"conn_sales",databaseName:"warehouse",schemaName:"public",tableName:"orders",dialect:"postgres"},sql:"SELECT customer_name, SUM(revenue) AS revenue FROM public.orders GROUP BY customer_name ORDER BY revenue DESC LIMIT 20",limit:20,rationale:"Ranking is SQL-natural because it requires ordering grouped aggregate rows.",fields:[{name:"customer_name",role:"dimension",dataType:"string"},{name:"revenue",role:"measure",dataType:"number"}]}};exports.validateSemaphorAnalyticsIntent=b.validateSemaphorAnalyticsIntent;exports.validateSemaphorDashboardIntent=b.validateSemaphorDashboardIntent;exports.SEMAPHOR_ANALYTICS_INTENT_FIXTURES=L;exports.buildAnalyticsCatalogFieldSummary=k;exports.buildSemaphorQualifiedSourcePath=_;exports.getAnalyticsCatalogFieldCandidates=y;exports.getAnalyticsCatalogFieldName=g;exports.getSemaphorConnectionCapabilities=D;exports.inferAnalyticsMetricFormat=T;exports.isAnalyticsCatalogDateField=m;exports.isAnalyticsCatalogDimensionField=A;exports.isAnalyticsCatalogMetricField=f;exports.isAnalyticsDateLikeDataType=h;exports.isAnalyticsMetricIdentifierField=d;exports.isAnalyticsTechnicalIdentifierField=p;exports.normalizeAnalyticsCatalogDataType=u;exports.normalizeAnalyticsCatalogName=s;exports.normalizeSemaphorDialect=I;exports.semaphorSourceHasRequiredCoordinates=q;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { v as
|
|
2
|
-
function
|
|
1
|
+
import { v as R, a as z } from "../chunks/validators-DDAweCzB.js";
|
|
2
|
+
function c(e) {
|
|
3
3
|
return typeof e == "string" ? e.trim().toLowerCase() : "";
|
|
4
4
|
}
|
|
5
|
-
function
|
|
5
|
+
function h(e) {
|
|
6
6
|
return String(e.column_name || e.name || e.qualifiedFieldName || "");
|
|
7
7
|
}
|
|
8
8
|
function v(e) {
|
|
@@ -14,45 +14,45 @@ function v(e) {
|
|
|
14
14
|
e.qualifiedFieldName,
|
|
15
15
|
e.alias
|
|
16
16
|
].filter(
|
|
17
|
-
(
|
|
18
|
-
).map((
|
|
17
|
+
(t) => typeof t == "string" && t.trim().length > 0
|
|
18
|
+
).map((t) => t.trim())
|
|
19
19
|
)
|
|
20
20
|
);
|
|
21
21
|
}
|
|
22
|
-
function
|
|
23
|
-
const
|
|
24
|
-
return
|
|
22
|
+
function d(e) {
|
|
23
|
+
const t = c(e);
|
|
24
|
+
return t ? t.includes("int") || t.includes("numeric") || t.includes("decimal") || t.includes("double") || t.includes("float") || t.includes("number") || t.includes("real") || t.includes("money") ? "number" : t.includes("timestamp") || t.includes("datetime") || t === "time" || t.startsWith("time ") ? "datetime" : t.includes("date") ? "date" : t.includes("bool") ? "boolean" : "string" : "unknown";
|
|
25
25
|
}
|
|
26
|
-
function
|
|
27
|
-
const
|
|
28
|
-
return
|
|
26
|
+
function C(e) {
|
|
27
|
+
const t = d(e);
|
|
28
|
+
return t === "date" || t === "datetime";
|
|
29
29
|
}
|
|
30
|
-
function
|
|
31
|
-
return
|
|
30
|
+
function m(e) {
|
|
31
|
+
return C(e.dataType || e.data_type);
|
|
32
32
|
}
|
|
33
33
|
function p(e) {
|
|
34
|
-
const
|
|
35
|
-
return
|
|
34
|
+
const t = f(e);
|
|
35
|
+
return t === "id" || t === "row_id";
|
|
36
36
|
}
|
|
37
37
|
function u(e) {
|
|
38
|
-
const
|
|
39
|
-
return p(e) ||
|
|
38
|
+
const t = f(e);
|
|
39
|
+
return p(e) || t.endsWith("_id") || t.endsWith("_key") || t.endsWith("_number");
|
|
40
40
|
}
|
|
41
|
-
function
|
|
42
|
-
return
|
|
43
|
-
|
|
41
|
+
function f(e) {
|
|
42
|
+
return c(
|
|
43
|
+
h(e) || e.name || e.alias
|
|
44
44
|
).replace(/[^a-z0-9]+/g, "_").replace(/^_+|_+$/g, "");
|
|
45
45
|
}
|
|
46
|
-
function
|
|
47
|
-
const
|
|
48
|
-
return
|
|
46
|
+
function b(e, t = {}) {
|
|
47
|
+
const a = c(e.role);
|
|
48
|
+
return a === "metric" || a === "measure" ? !t.excludeIdentifiers || !u(e) : a === "groupby" || a === "dimension" || a === "date" || a === "id" ? !1 : d(
|
|
49
49
|
e.dataType || e.data_type
|
|
50
|
-
) === "number" && (!
|
|
50
|
+
) === "number" && (!t.excludeIdentifiers || !u(e));
|
|
51
51
|
}
|
|
52
|
-
function
|
|
53
|
-
return !
|
|
52
|
+
function q(e) {
|
|
53
|
+
return !b(e) && !m(e);
|
|
54
54
|
}
|
|
55
|
-
function
|
|
55
|
+
function k(e) {
|
|
56
56
|
return [
|
|
57
57
|
e.column_name,
|
|
58
58
|
e.name,
|
|
@@ -60,21 +60,21 @@ function T(e) {
|
|
|
60
60
|
e.alias,
|
|
61
61
|
e.qualifiedFieldName
|
|
62
62
|
].filter(
|
|
63
|
-
(
|
|
63
|
+
(t) => typeof t == "string" && t.trim().length > 0
|
|
64
64
|
).map(
|
|
65
|
-
(
|
|
65
|
+
(t) => c(t).replace(/[^a-z0-9]+/g, " ")
|
|
66
66
|
).join(" ");
|
|
67
67
|
}
|
|
68
|
-
function
|
|
69
|
-
return
|
|
70
|
-
const
|
|
71
|
-
return new RegExp(`(^|\\s)${
|
|
68
|
+
function l(e, t) {
|
|
69
|
+
return t.some((a) => {
|
|
70
|
+
const r = a.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
71
|
+
return new RegExp(`(^|\\s)${r}(\\s|$)`, "i").test(e);
|
|
72
72
|
});
|
|
73
73
|
}
|
|
74
|
-
function
|
|
75
|
-
const
|
|
76
|
-
if (
|
|
77
|
-
return
|
|
74
|
+
function D(e) {
|
|
75
|
+
const t = k(e);
|
|
76
|
+
if (t)
|
|
77
|
+
return l(t, [
|
|
78
78
|
"pct",
|
|
79
79
|
"percent",
|
|
80
80
|
"percentage",
|
|
@@ -94,7 +94,7 @@ function F(e) {
|
|
|
94
94
|
minimumFractionDigits: 0,
|
|
95
95
|
maximumFractionDigits: 1,
|
|
96
96
|
percentValueMode: "fraction"
|
|
97
|
-
} :
|
|
97
|
+
} : l(t, [
|
|
98
98
|
"revenue",
|
|
99
99
|
"sales",
|
|
100
100
|
"profit",
|
|
@@ -117,7 +117,7 @@ function F(e) {
|
|
|
117
117
|
minimumFractionDigits: 0,
|
|
118
118
|
maximumFractionDigits: 1,
|
|
119
119
|
compact: !0
|
|
120
|
-
} :
|
|
120
|
+
} : l(t, [
|
|
121
121
|
"count",
|
|
122
122
|
"quantity",
|
|
123
123
|
"orders",
|
|
@@ -142,43 +142,178 @@ function F(e) {
|
|
|
142
142
|
compact: !0
|
|
143
143
|
};
|
|
144
144
|
}
|
|
145
|
-
function
|
|
146
|
-
const
|
|
147
|
-
for (const
|
|
148
|
-
if (p(
|
|
145
|
+
function I(e) {
|
|
146
|
+
const t = /* @__PURE__ */ new Set(), a = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set();
|
|
147
|
+
for (const s of e) {
|
|
148
|
+
if (p(s))
|
|
149
149
|
continue;
|
|
150
|
-
const
|
|
151
|
-
if (
|
|
152
|
-
if (
|
|
153
|
-
|
|
150
|
+
const o = v(s);
|
|
151
|
+
if (o.length !== 0) {
|
|
152
|
+
if (m(s)) {
|
|
153
|
+
o.forEach((i) => a.add(i));
|
|
154
154
|
continue;
|
|
155
155
|
}
|
|
156
|
-
if (
|
|
157
|
-
|
|
156
|
+
if (b(s, { excludeIdentifiers: !0 })) {
|
|
157
|
+
o.forEach((i) => t.add(i));
|
|
158
158
|
continue;
|
|
159
159
|
}
|
|
160
|
-
|
|
160
|
+
o.forEach((i) => r.add(i));
|
|
161
161
|
}
|
|
162
162
|
}
|
|
163
163
|
return {
|
|
164
|
-
validMetricCandidates: Array.from(
|
|
165
|
-
validDateCandidates: Array.from(
|
|
166
|
-
validDimensionCandidates: Array.from(
|
|
164
|
+
validMetricCandidates: Array.from(t).sort(),
|
|
165
|
+
validDateCandidates: Array.from(a).sort(),
|
|
166
|
+
validDimensionCandidates: Array.from(r).sort()
|
|
167
167
|
};
|
|
168
168
|
}
|
|
169
|
-
|
|
169
|
+
function S(e, t = {}) {
|
|
170
|
+
const a = y(e), r = {
|
|
171
|
+
connectionId: t.connectionId,
|
|
172
|
+
connectionType: e,
|
|
173
|
+
path: ["database", "schema", "table"],
|
|
174
|
+
labels: {
|
|
175
|
+
database: "Database",
|
|
176
|
+
schema: "Schema",
|
|
177
|
+
table: "Table"
|
|
178
|
+
},
|
|
179
|
+
prefixLevels: ["database", "schema", "table"],
|
|
180
|
+
dialect: "postgres",
|
|
181
|
+
supportsFilterClause: !0
|
|
182
|
+
};
|
|
183
|
+
return a.includes("postgres") ? {
|
|
184
|
+
...r,
|
|
185
|
+
prefixLevels: ["schema", "table"],
|
|
186
|
+
dialect: "postgres"
|
|
187
|
+
} : a.includes("mysql") ? {
|
|
188
|
+
...r,
|
|
189
|
+
prefixLevels: ["database", "table"],
|
|
190
|
+
dialect: "mysql",
|
|
191
|
+
supportsFilterClause: !1
|
|
192
|
+
} : a.includes("mssql") || a.includes("sqlserver") ? {
|
|
193
|
+
...r,
|
|
194
|
+
dialect: "mssql",
|
|
195
|
+
supportsFilterClause: !1
|
|
196
|
+
} : a.includes("redshift") ? {
|
|
197
|
+
...r,
|
|
198
|
+
prefixLevels: ["schema", "table"],
|
|
199
|
+
dialect: "redshift"
|
|
200
|
+
} : a.includes("snowflake") ? {
|
|
201
|
+
...r,
|
|
202
|
+
dialect: "snowflake"
|
|
203
|
+
} : a.includes("clickhouse") ? {
|
|
204
|
+
connectionId: t.connectionId,
|
|
205
|
+
connectionType: e,
|
|
206
|
+
path: ["database", "table"],
|
|
207
|
+
labels: {
|
|
208
|
+
database: "Database",
|
|
209
|
+
table: "Table"
|
|
210
|
+
},
|
|
211
|
+
prefixLevels: ["database", "table"],
|
|
212
|
+
dialect: "clickhouse",
|
|
213
|
+
supportsFilterClause: !1
|
|
214
|
+
} : a === "s3" || a === "api" ? {
|
|
215
|
+
connectionId: t.connectionId,
|
|
216
|
+
connectionType: e,
|
|
217
|
+
path: ["table"],
|
|
218
|
+
labels: {
|
|
219
|
+
table: a === "api" ? "API Table" : "File Table"
|
|
220
|
+
},
|
|
221
|
+
prefixLevels: ["table"],
|
|
222
|
+
dialect: "duckdb",
|
|
223
|
+
supportsFilterClause: !0
|
|
224
|
+
} : a === "googlesheets" || a === "fileupload" ? {
|
|
225
|
+
connectionId: t.connectionId,
|
|
226
|
+
connectionType: e,
|
|
227
|
+
path: ["table"],
|
|
228
|
+
labels: {
|
|
229
|
+
table: "Table"
|
|
230
|
+
},
|
|
231
|
+
prefixLevels: ["table"],
|
|
232
|
+
dialect: "postgres",
|
|
233
|
+
supportsFilterClause: !0
|
|
234
|
+
} : a === "s3tables" ? {
|
|
235
|
+
...r,
|
|
236
|
+
labels: {
|
|
237
|
+
database: "Database",
|
|
238
|
+
schema: "Namespace",
|
|
239
|
+
table: "Table"
|
|
240
|
+
},
|
|
241
|
+
dialect: "duckdb"
|
|
242
|
+
} : a === "bigquery" ? {
|
|
243
|
+
...r,
|
|
244
|
+
labels: {
|
|
245
|
+
database: "Project",
|
|
246
|
+
schema: "Dataset",
|
|
247
|
+
table: "Table"
|
|
248
|
+
},
|
|
249
|
+
prefixLevels: ["schema", "table"],
|
|
250
|
+
dialect: "bigquery",
|
|
251
|
+
supportsFilterClause: !1
|
|
252
|
+
} : r;
|
|
253
|
+
}
|
|
254
|
+
function _(e) {
|
|
255
|
+
const t = y(e);
|
|
256
|
+
switch (t) {
|
|
257
|
+
case "mysql":
|
|
258
|
+
case "bigquery":
|
|
259
|
+
case "redshift":
|
|
260
|
+
case "snowflake":
|
|
261
|
+
case "clickhouse":
|
|
262
|
+
case "duckdb":
|
|
263
|
+
case "sqlite":
|
|
264
|
+
return t;
|
|
265
|
+
case "mssql":
|
|
266
|
+
case "sqlserver":
|
|
267
|
+
return "mssql";
|
|
268
|
+
case "postgres":
|
|
269
|
+
case "postgresql":
|
|
270
|
+
return "postgres";
|
|
271
|
+
case "semantic":
|
|
272
|
+
return "semantic";
|
|
273
|
+
default:
|
|
274
|
+
return "unknown";
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
function A(e) {
|
|
278
|
+
return e.capabilities.prefixLevels.every(
|
|
279
|
+
(t) => !!g(e.source, t)
|
|
280
|
+
);
|
|
281
|
+
}
|
|
282
|
+
function x(e) {
|
|
283
|
+
const t = e.quoteIdentifier ?? F;
|
|
284
|
+
return e.capabilities.prefixLevels.map((a) => g(e.source, a)).filter((a) => !!a).map((a) => t(a, e.capabilities.dialect)).join(".");
|
|
285
|
+
}
|
|
286
|
+
function g(e, t) {
|
|
287
|
+
return t === "database" ? e.databaseName : t === "schema" ? e.schemaName : e.tableName;
|
|
288
|
+
}
|
|
289
|
+
function F(e, t) {
|
|
290
|
+
return t === "mysql" || t === "bigquery" || t === "clickhouse" || t === "duckdb" ? `\`${e.replace(/`/g, "``")}\`` : t === "mssql" ? `[${e.replace(/]/g, "]]")}]` : `"${e.replace(/"/g, '""')}"`;
|
|
291
|
+
}
|
|
292
|
+
function y(e) {
|
|
293
|
+
if (typeof e != "string")
|
|
294
|
+
return "";
|
|
295
|
+
const t = [];
|
|
296
|
+
for (const a of e.trim().toLowerCase())
|
|
297
|
+
T(a) && t.push(a);
|
|
298
|
+
return t.join("");
|
|
299
|
+
}
|
|
300
|
+
function T(e) {
|
|
301
|
+
const t = e.charCodeAt(0);
|
|
302
|
+
return t >= 48 && t <= 57 || t >= 97 && t <= 122;
|
|
303
|
+
}
|
|
304
|
+
const n = {
|
|
170
305
|
kind: "semantic",
|
|
171
306
|
domainId: "domain_sales",
|
|
172
307
|
datasetName: "orders",
|
|
173
308
|
connectionId: "conn_sales",
|
|
174
309
|
label: "Orders"
|
|
175
|
-
},
|
|
310
|
+
}, w = {
|
|
176
311
|
revenueKpi: {
|
|
177
312
|
version: 1,
|
|
178
313
|
kind: "metric",
|
|
179
314
|
id: "revenue-kpi",
|
|
180
315
|
label: "Revenue",
|
|
181
|
-
source:
|
|
316
|
+
source: n,
|
|
182
317
|
metric: "revenue",
|
|
183
318
|
comparison: { kind: "previous_period" },
|
|
184
319
|
limit: 1
|
|
@@ -188,7 +323,7 @@ const a = {
|
|
|
188
323
|
kind: "records",
|
|
189
324
|
id: "revenue-trend",
|
|
190
325
|
label: "Revenue trend",
|
|
191
|
-
source:
|
|
326
|
+
source: n,
|
|
192
327
|
fields: [
|
|
193
328
|
{ name: "order_date", role: "date", dataType: "date", label: "Order Date" }
|
|
194
329
|
],
|
|
@@ -202,7 +337,7 @@ const a = {
|
|
|
202
337
|
kind: "records",
|
|
203
338
|
id: "top-customers",
|
|
204
339
|
label: "Top customers",
|
|
205
|
-
source:
|
|
340
|
+
source: n,
|
|
206
341
|
fields: [
|
|
207
342
|
{ name: "customer_name", role: "dimension", dataType: "string" },
|
|
208
343
|
{ name: "segment", role: "dimension", dataType: "string" },
|
|
@@ -217,7 +352,7 @@ const a = {
|
|
|
217
352
|
kind: "inputOptions",
|
|
218
353
|
id: "region-options",
|
|
219
354
|
label: "Region options",
|
|
220
|
-
source:
|
|
355
|
+
source: n,
|
|
221
356
|
field: { name: "region", role: "dimension", dataType: "string" },
|
|
222
357
|
limit: 100
|
|
223
358
|
},
|
|
@@ -226,7 +361,7 @@ const a = {
|
|
|
226
361
|
kind: "metric",
|
|
227
362
|
id: "revenue-previous-period",
|
|
228
363
|
label: "Revenue previous period comparison",
|
|
229
|
-
source:
|
|
364
|
+
source: n,
|
|
230
365
|
metric: "revenue",
|
|
231
366
|
dateField: { name: "order_date", role: "date", dataType: "date" },
|
|
232
367
|
timeGrain: "week",
|
|
@@ -256,19 +391,23 @@ const a = {
|
|
|
256
391
|
}
|
|
257
392
|
};
|
|
258
393
|
export {
|
|
259
|
-
|
|
260
|
-
|
|
394
|
+
w as SEMAPHOR_ANALYTICS_INTENT_FIXTURES,
|
|
395
|
+
I as buildAnalyticsCatalogFieldSummary,
|
|
396
|
+
x as buildSemaphorQualifiedSourcePath,
|
|
261
397
|
v as getAnalyticsCatalogFieldCandidates,
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
b as
|
|
398
|
+
h as getAnalyticsCatalogFieldName,
|
|
399
|
+
S as getSemaphorConnectionCapabilities,
|
|
400
|
+
D as inferAnalyticsMetricFormat,
|
|
401
|
+
m as isAnalyticsCatalogDateField,
|
|
402
|
+
q as isAnalyticsCatalogDimensionField,
|
|
403
|
+
b as isAnalyticsCatalogMetricField,
|
|
404
|
+
C as isAnalyticsDateLikeDataType,
|
|
268
405
|
u as isAnalyticsMetricIdentifierField,
|
|
269
406
|
p as isAnalyticsTechnicalIdentifierField,
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
407
|
+
d as normalizeAnalyticsCatalogDataType,
|
|
408
|
+
c as normalizeAnalyticsCatalogName,
|
|
409
|
+
_ as normalizeSemaphorDialect,
|
|
410
|
+
A as semaphorSourceHasRequiredCoordinates,
|
|
411
|
+
R as validateSemaphorAnalyticsIntent,
|
|
412
|
+
z as validateSemaphorDashboardIntent
|
|
274
413
|
};
|