react-semaphor 0.1.338 → 0.1.340
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 +58 -57
- package/dist/brand-studio/index.cjs +1 -1
- package/dist/brand-studio/index.js +3 -3
- package/dist/chunks/{braces-Q86XHDaD.js → braces-Ccvdip75.js} +1 -1
- package/dist/chunks/{braces-BLa_lORs.js → braces-DDHkbW1c.js} +1 -1
- package/dist/chunks/{calendar-preferences-dialog-Cocogo9H.js → calendar-preferences-dialog-2IbYrrP1.js} +3 -3
- package/dist/chunks/{calendar-preferences-dialog-Bm7ji3k9.js → calendar-preferences-dialog-8-KE5sVX.js} +1 -1
- package/dist/chunks/catalog-field-grounding-DoEBOXQd.js +100 -0
- package/dist/chunks/catalog-field-grounding-Du6mKDcF.js +1 -0
- package/dist/chunks/{chevrons-up-down-BBTZ5pAY.js → chevrons-up-down-B9fTSds9.js} +1 -1
- package/dist/chunks/{chevrons-up-down-CYuWasy_.js → chevrons-up-down-pV0i9ptS.js} +1 -1
- package/dist/chunks/{dashboard-briefing-launcher-BtqtLx1-.js → dashboard-briefing-launcher-CcqDPVke.js} +1 -1
- package/dist/chunks/{dashboard-briefing-launcher-DF4CoaRn.js → dashboard-briefing-launcher-DtxDRAiu.js} +4 -4
- package/dist/chunks/{dashboard-controls-B5U-VUxs.js → dashboard-controls-Bi98DhYD.js} +6 -6
- package/dist/chunks/{dashboard-controls-0VMAeMoa.js → dashboard-controls-By7aKmDj.js} +1 -1
- package/dist/chunks/{dashboard-json-CqbLOfnr.js → dashboard-json-BOyLuhS6.js} +1 -1
- package/dist/chunks/{dashboard-json-Hmc0Ri5z.js → dashboard-json-CGxIsTEP.js} +2 -2
- package/dist/chunks/{edit-dashboard-visual-D4VVu-QQ.js → edit-dashboard-visual-Ba8LenNc.js} +6 -6
- package/dist/chunks/{edit-dashboard-visual-C0EDM0QB.js → edit-dashboard-visual-BuXlHmJH.js} +1 -1
- package/dist/chunks/{index-DE0vIuYG.js → index-DT9osgRT.js} +2 -2
- package/dist/chunks/{index-DzyUhzV3.js → index-DVPvpd8u.js} +5 -5
- package/dist/chunks/{palette-DalASD28.js → palette-BMXS-AcI.js} +1 -1
- package/dist/chunks/{palette-B9AbDw0n.js → palette-DKecBucs.js} +1 -1
- package/dist/chunks/{resource-management-panel-C4YydU9I.js → resource-management-panel-98Hy6SYB.js} +3 -3
- package/dist/chunks/{resource-management-panel-P9iNqBM1.js → resource-management-panel-ByR-FD3h.js} +1 -1
- package/dist/chunks/{switch-BAYfpAEb.js → switch-CP7SmEIZ.js} +1 -1
- package/dist/chunks/{switch-CyRoZr5T.js → switch-DYRgERrC.js} +1 -1
- package/dist/chunks/{use-create-flow-overlay-state-P1LMwQ89.js → use-create-flow-overlay-state-D5uvjbwY.js} +3 -3
- package/dist/chunks/{use-create-flow-overlay-state-CbhjxI3W.js → use-create-flow-overlay-state-uNxArZdj.js} +1 -1
- package/dist/chunks/{use-visual-utils-lB-3Zk0b.js → use-visual-utils-BLh9mKic.js} +2 -2
- package/dist/chunks/{use-visual-utils-CV6_-y4p.js → use-visual-utils-CpaqIHoc.js} +1 -1
- package/dist/chunks/{validators-BOqiGymD.js → validators-CPEQojnV.js} +325 -250
- package/dist/chunks/validators-CfP-49k9.js +1 -0
- package/dist/dashboard/index.cjs +1 -1
- package/dist/dashboard/index.js +1 -1
- package/dist/dashboard-authoring/index.cjs +3 -3
- package/dist/dashboard-authoring/index.js +424 -561
- package/dist/data-app-builder/index.cjs +1 -1
- package/dist/data-app-builder/index.js +1 -1
- package/dist/data-app-sdk/index.cjs +1 -1
- package/dist/data-app-sdk/index.js +313 -308
- package/dist/index.cjs +1 -1
- package/dist/index.js +7 -7
- package/dist/surfboard/index.cjs +1 -1
- package/dist/surfboard/index.js +2 -2
- package/dist/types/analytics-protocol.d.ts +75 -49
- package/dist/types/dashboard-authoring.d.ts +26 -52
- package/dist/types/dashboard.d.ts +1 -2
- package/dist/types/data-app-builder.d.ts +23 -13
- package/dist/types/data-app-sdk.d.ts +33 -46
- package/dist/types/main.d.ts +29 -50
- package/dist/types/shared.d.ts +1 -2
- package/dist/types/surfboard.d.ts +1 -2
- package/dist/types/types.d.ts +1 -2
- package/package.json +1 -1
- package/dist/chunks/catalog-field-grounding-DmT7aGUA.js +0 -191
- package/dist/chunks/catalog-field-grounding-VgVzDd25.js +0 -1
- package/dist/chunks/validators-BtFXY3S_.js +0 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../chunks/validators-CfP-49k9.js"),t=require("../chunks/catalog-field-grounding-Du6mKDcF.js");function d(e,a={}){const i=o(e),s={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 i.includes("postgres")?{...s,prefixLevels:["schema","table"],dialect:"postgres"}:i.includes("mysql")?{...s,prefixLevels:["database","table"],dialect:"mysql",supportsFilterClause:!1}:i.includes("mssql")||i.includes("sqlserver")?{...s,dialect:"mssql",supportsFilterClause:!1}:i.includes("redshift")?{...s,prefixLevels:["schema","table"],dialect:"redshift"}:i.includes("snowflake")?{...s,dialect:"snowflake"}:i.includes("clickhouse")?{connectionId:a.connectionId,connectionType:e,path:["database","table"],labels:{database:"Database",table:"Table"},prefixLevels:["database","table"],dialect:"clickhouse",supportsFilterClause:!1}:i==="s3"||i==="api"?{connectionId:a.connectionId,connectionType:e,path:["table"],labels:{table:i==="api"?"API Table":"File Table"},prefixLevels:["table"],dialect:"duckdb",supportsFilterClause:!0}:i==="googlesheets"||i==="fileupload"?{connectionId:a.connectionId,connectionType:e,path:["table"],labels:{table:"Table"},prefixLevels:["table"],dialect:"postgres",supportsFilterClause:!0}:i==="s3tables"?{...s,labels:{database:"Database",schema:"Namespace",table:"Table"},dialect:"duckdb"}:i==="bigquery"?{...s,labels:{database:"Project",schema:"Dataset",table:"Table"},prefixLevels:["schema","table"],dialect:"bigquery",supportsFilterClause:!1}:s}function c(e){const a=o(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";default:return"unknown"}}function u(e){return e.capabilities.prefixLevels.every(a=>!!l(e.source,a))}function m(e){const a=e.quoteIdentifier??p;return e.capabilities.prefixLevels.map(i=>l(e.source,i)).filter(i=>!!i).map(i=>a(i,e.capabilities.dialect)).join(".")}function l(e,a){return a==="database"?e.databaseName:a==="schema"?e.schemaName:e.tableName}function p(e,a){return a==="mysql"||a==="bigquery"||a==="clickhouse"||a==="duckdb"?`\`${e.replace(/`/g,"``")}\``:a==="mssql"?`[${e.replace(/]/g,"]]")}]`:`"${e.replace(/"/g,'""')}"`}function o(e){if(typeof e!="string")return"";const a=[];for(const i of e.trim().toLowerCase())b(i)&&a.push(i);return a.join("")}function b(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"},f={revenueKpi:{version:1,kind:"metric",id:"revenue-kpi",label:"Revenue",source:n,metrics:[{name:"revenue",role:"measure"}],primaryMetric:{name:"revenue",role:"measure"},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"},{name:"revenue",role:"measure",dataType:"number"}],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"}],orderBy:{field:{name:"revenue",role:"measure"},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,metrics:[{name:"revenue",role:"measure"}],primaryMetric:{name:"revenue",role:"measure"},dateField:{name:"order_date",role:"date",dataType:"date"},timeGrain:"week",comparison:{kind:"previous_period"},limit:100},inboundSupplierConcentration:{version:1,kind:"metric",id:"inbound-supplier-concentration",label:"Inbound supplier concentration",source:n,metrics:[{name:"net_tons",role:"measure"},{name:"ticket_value",role:"measure"}],primaryMetric:{name:"net_tons",role:"measure"},dateField:{name:"ticket_date",role:"date",dataType:"date"},timeWindow:{unit:"month",value:6,anchor:"latest_available"},dimensions:[{name:"supplier_id",role:"dimension",dataType:"number"}],filters:[{field:{name:"direction",role:"dimension",dataType:"string"},operator:"=",values:["Inbound"]}],limit:15},boundedSqlRanking:{version:1,kind:"sql",id:"top-customer-ranking-sql",label:"Top customer ranking SQL",source:{kind:"sql",connectionId:"conn_sales",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.preferSemaphorFieldRefMetadata=r.preferSemaphorFieldRefMetadata;exports.preferSemaphorSourceMetadata=r.preferSemaphorSourceMetadata;exports.semaphorFieldRefsMatch=r.semaphorFieldRefsMatch;exports.semaphorSourceIdentityKey=r.semaphorSourceIdentityKey;exports.semaphorSourcesReferToSameDataset=r.semaphorSourcesReferToSameDataset;exports.validateSemaphorAnalyticsIntent=r.validateSemaphorAnalyticsIntent;exports.validateSemaphorAnalyticsRecoveryPlan=r.validateSemaphorAnalyticsRecoveryPlan;exports.validateSemaphorDashboardIntent=r.validateSemaphorDashboardIntent;exports.validateSemaphorOperationIntent=r.validateSemaphorOperationIntent;exports.buildAnalyticsCatalogFieldSummary=t.buildAnalyticsCatalogFieldSummary;exports.getAnalyticsCatalogFieldCandidates=t.getAnalyticsCatalogFieldCandidates;exports.getAnalyticsCatalogFieldName=t.getAnalyticsCatalogFieldName;exports.isAnalyticsCatalogDateField=t.isAnalyticsCatalogDateField;exports.isAnalyticsCatalogDimensionField=t.isAnalyticsCatalogDimensionField;exports.isAnalyticsCatalogMetricField=t.isAnalyticsCatalogMetricField;exports.isAnalyticsDateLikeDataType=t.isAnalyticsDateLikeDataType;exports.isAnalyticsMetricIdentifierField=t.isAnalyticsMetricIdentifierField;exports.isAnalyticsTechnicalIdentifierField=t.isAnalyticsTechnicalIdentifierField;exports.normalizeAnalyticsCatalogDataType=t.normalizeAnalyticsCatalogDataType;exports.normalizeAnalyticsCatalogName=t.normalizeAnalyticsCatalogName;exports.SEMAPHOR_ANALYTICS_INTENT_FIXTURES=f;exports.buildSemaphorQualifiedSourcePath=m;exports.getSemaphorConnectionCapabilities=d;exports.normalizeSemaphorDialect=c;exports.semaphorSourceHasRequiredCoordinates=u;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { v,
|
|
2
|
-
import {
|
|
1
|
+
import { f as v, p as h, e as g, s as y, d as k, v as C, b as I, c as S, a as T } from "../chunks/validators-CPEQojnV.js";
|
|
2
|
+
import { j as F, a as _, g as A, c as R, h as L, f as D, i as x, e as M, d as N, b as w, n as O } from "../chunks/catalog-field-grounding-DoEBOXQd.js";
|
|
3
3
|
function d(e, a = {}) {
|
|
4
|
-
const
|
|
4
|
+
const r = n(e), t = {
|
|
5
5
|
connectionId: a.connectionId,
|
|
6
6
|
connectionType: e,
|
|
7
7
|
path: ["database", "schema", "table"],
|
|
@@ -14,27 +14,27 @@ function d(e, a = {}) {
|
|
|
14
14
|
dialect: "postgres",
|
|
15
15
|
supportsFilterClause: !0
|
|
16
16
|
};
|
|
17
|
-
return
|
|
17
|
+
return r.includes("postgres") ? {
|
|
18
18
|
...t,
|
|
19
19
|
prefixLevels: ["schema", "table"],
|
|
20
20
|
dialect: "postgres"
|
|
21
|
-
} :
|
|
21
|
+
} : r.includes("mysql") ? {
|
|
22
22
|
...t,
|
|
23
23
|
prefixLevels: ["database", "table"],
|
|
24
24
|
dialect: "mysql",
|
|
25
25
|
supportsFilterClause: !1
|
|
26
|
-
} :
|
|
26
|
+
} : r.includes("mssql") || r.includes("sqlserver") ? {
|
|
27
27
|
...t,
|
|
28
28
|
dialect: "mssql",
|
|
29
29
|
supportsFilterClause: !1
|
|
30
|
-
} :
|
|
30
|
+
} : r.includes("redshift") ? {
|
|
31
31
|
...t,
|
|
32
32
|
prefixLevels: ["schema", "table"],
|
|
33
33
|
dialect: "redshift"
|
|
34
|
-
} :
|
|
34
|
+
} : r.includes("snowflake") ? {
|
|
35
35
|
...t,
|
|
36
36
|
dialect: "snowflake"
|
|
37
|
-
} :
|
|
37
|
+
} : r.includes("clickhouse") ? {
|
|
38
38
|
connectionId: a.connectionId,
|
|
39
39
|
connectionType: e,
|
|
40
40
|
path: ["database", "table"],
|
|
@@ -45,17 +45,17 @@ function d(e, a = {}) {
|
|
|
45
45
|
prefixLevels: ["database", "table"],
|
|
46
46
|
dialect: "clickhouse",
|
|
47
47
|
supportsFilterClause: !1
|
|
48
|
-
} :
|
|
48
|
+
} : r === "s3" || r === "api" ? {
|
|
49
49
|
connectionId: a.connectionId,
|
|
50
50
|
connectionType: e,
|
|
51
51
|
path: ["table"],
|
|
52
52
|
labels: {
|
|
53
|
-
table:
|
|
53
|
+
table: r === "api" ? "API Table" : "File Table"
|
|
54
54
|
},
|
|
55
55
|
prefixLevels: ["table"],
|
|
56
56
|
dialect: "duckdb",
|
|
57
57
|
supportsFilterClause: !0
|
|
58
|
-
} :
|
|
58
|
+
} : r === "googlesheets" || r === "fileupload" ? {
|
|
59
59
|
connectionId: a.connectionId,
|
|
60
60
|
connectionType: e,
|
|
61
61
|
path: ["table"],
|
|
@@ -65,7 +65,7 @@ function d(e, a = {}) {
|
|
|
65
65
|
prefixLevels: ["table"],
|
|
66
66
|
dialect: "postgres",
|
|
67
67
|
supportsFilterClause: !0
|
|
68
|
-
} :
|
|
68
|
+
} : r === "s3tables" ? {
|
|
69
69
|
...t,
|
|
70
70
|
labels: {
|
|
71
71
|
database: "Database",
|
|
@@ -73,7 +73,7 @@ function d(e, a = {}) {
|
|
|
73
73
|
table: "Table"
|
|
74
74
|
},
|
|
75
75
|
dialect: "duckdb"
|
|
76
|
-
} :
|
|
76
|
+
} : r === "bigquery" ? {
|
|
77
77
|
...t,
|
|
78
78
|
labels: {
|
|
79
79
|
database: "Project",
|
|
@@ -102,8 +102,6 @@ function c(e) {
|
|
|
102
102
|
case "postgres":
|
|
103
103
|
case "postgresql":
|
|
104
104
|
return "postgres";
|
|
105
|
-
case "semantic":
|
|
106
|
-
return "semantic";
|
|
107
105
|
default:
|
|
108
106
|
return "unknown";
|
|
109
107
|
}
|
|
@@ -115,7 +113,7 @@ function u(e) {
|
|
|
115
113
|
}
|
|
116
114
|
function m(e) {
|
|
117
115
|
const a = e.quoteIdentifier ?? l;
|
|
118
|
-
return e.capabilities.prefixLevels.map((
|
|
116
|
+
return e.capabilities.prefixLevels.map((r) => s(e.source, r)).filter((r) => !!r).map((r) => a(r, e.capabilities.dialect)).join(".");
|
|
119
117
|
}
|
|
120
118
|
function s(e, a) {
|
|
121
119
|
return a === "database" ? e.databaseName : a === "schema" ? e.schemaName : e.tableName;
|
|
@@ -127,15 +125,15 @@ function n(e) {
|
|
|
127
125
|
if (typeof e != "string")
|
|
128
126
|
return "";
|
|
129
127
|
const a = [];
|
|
130
|
-
for (const
|
|
131
|
-
o(
|
|
128
|
+
for (const r of e.trim().toLowerCase())
|
|
129
|
+
o(r) && a.push(r);
|
|
132
130
|
return a.join("");
|
|
133
131
|
}
|
|
134
132
|
function o(e) {
|
|
135
133
|
const a = e.charCodeAt(0);
|
|
136
134
|
return a >= 48 && a <= 57 || a >= 97 && a <= 122;
|
|
137
135
|
}
|
|
138
|
-
const
|
|
136
|
+
const i = {
|
|
139
137
|
kind: "semantic",
|
|
140
138
|
domainId: "domain_sales",
|
|
141
139
|
datasetName: "orders",
|
|
@@ -147,9 +145,9 @@ const r = {
|
|
|
147
145
|
kind: "metric",
|
|
148
146
|
id: "revenue-kpi",
|
|
149
147
|
label: "Revenue",
|
|
150
|
-
source:
|
|
151
|
-
metrics: ["revenue"],
|
|
152
|
-
primaryMetric: "revenue",
|
|
148
|
+
source: i,
|
|
149
|
+
metrics: [{ name: "revenue", role: "measure" }],
|
|
150
|
+
primaryMetric: { name: "revenue", role: "measure" },
|
|
153
151
|
comparison: { kind: "previous_period" },
|
|
154
152
|
limit: 1
|
|
155
153
|
},
|
|
@@ -158,11 +156,11 @@ const r = {
|
|
|
158
156
|
kind: "records",
|
|
159
157
|
id: "revenue-trend",
|
|
160
158
|
label: "Revenue trend",
|
|
161
|
-
source:
|
|
159
|
+
source: i,
|
|
162
160
|
fields: [
|
|
163
|
-
{ name: "order_date", role: "date", dataType: "date", label: "Order Date" }
|
|
161
|
+
{ name: "order_date", role: "date", dataType: "date", label: "Order Date" },
|
|
162
|
+
{ name: "revenue", role: "measure", dataType: "number" }
|
|
164
163
|
],
|
|
165
|
-
measures: ["revenue"],
|
|
166
164
|
dateField: { name: "order_date", role: "date", dataType: "date" },
|
|
167
165
|
timeGrain: "month",
|
|
168
166
|
limit: 100
|
|
@@ -172,14 +170,13 @@ const r = {
|
|
|
172
170
|
kind: "records",
|
|
173
171
|
id: "top-customers",
|
|
174
172
|
label: "Top customers",
|
|
175
|
-
source:
|
|
173
|
+
source: i,
|
|
176
174
|
fields: [
|
|
177
175
|
{ name: "customer_name", role: "dimension", dataType: "string" },
|
|
178
176
|
{ name: "segment", role: "dimension", dataType: "string" },
|
|
179
177
|
{ name: "revenue", role: "measure", dataType: "number" }
|
|
180
178
|
],
|
|
181
|
-
|
|
182
|
-
orderBy: { field: "revenue", direction: "desc" },
|
|
179
|
+
orderBy: { field: { name: "revenue", role: "measure" }, direction: "desc" },
|
|
183
180
|
limit: 20
|
|
184
181
|
},
|
|
185
182
|
regionInputOptions: {
|
|
@@ -187,7 +184,7 @@ const r = {
|
|
|
187
184
|
kind: "inputOptions",
|
|
188
185
|
id: "region-options",
|
|
189
186
|
label: "Region options",
|
|
190
|
-
source:
|
|
187
|
+
source: i,
|
|
191
188
|
field: { name: "region", role: "dimension", dataType: "string" },
|
|
192
189
|
limit: 100
|
|
193
190
|
},
|
|
@@ -196,9 +193,9 @@ const r = {
|
|
|
196
193
|
kind: "metric",
|
|
197
194
|
id: "revenue-previous-period",
|
|
198
195
|
label: "Revenue previous period comparison",
|
|
199
|
-
source:
|
|
200
|
-
metrics: ["revenue"],
|
|
201
|
-
primaryMetric: "revenue",
|
|
196
|
+
source: i,
|
|
197
|
+
metrics: [{ name: "revenue", role: "measure" }],
|
|
198
|
+
primaryMetric: { name: "revenue", role: "measure" },
|
|
202
199
|
dateField: { name: "order_date", role: "date", dataType: "date" },
|
|
203
200
|
timeGrain: "week",
|
|
204
201
|
comparison: { kind: "previous_period" },
|
|
@@ -209,9 +206,12 @@ const r = {
|
|
|
209
206
|
kind: "metric",
|
|
210
207
|
id: "inbound-supplier-concentration",
|
|
211
208
|
label: "Inbound supplier concentration",
|
|
212
|
-
source:
|
|
213
|
-
metrics: [
|
|
214
|
-
|
|
209
|
+
source: i,
|
|
210
|
+
metrics: [
|
|
211
|
+
{ name: "net_tons", role: "measure" },
|
|
212
|
+
{ name: "ticket_value", role: "measure" }
|
|
213
|
+
],
|
|
214
|
+
primaryMetric: { name: "net_tons", role: "measure" },
|
|
215
215
|
dateField: { name: "ticket_date", role: "date", dataType: "date" },
|
|
216
216
|
timeWindow: { unit: "month", value: 6, anchor: "latest_available" },
|
|
217
217
|
dimensions: [{ name: "supplier_id", role: "dimension", dataType: "number" }],
|
|
@@ -219,7 +219,7 @@ const r = {
|
|
|
219
219
|
{
|
|
220
220
|
field: { name: "direction", role: "dimension", dataType: "string" },
|
|
221
221
|
operator: "=",
|
|
222
|
-
|
|
222
|
+
values: ["Inbound"]
|
|
223
223
|
}
|
|
224
224
|
],
|
|
225
225
|
limit: 15
|
|
@@ -230,11 +230,8 @@ const r = {
|
|
|
230
230
|
id: "top-customer-ranking-sql",
|
|
231
231
|
label: "Top customer ranking SQL",
|
|
232
232
|
source: {
|
|
233
|
-
kind: "
|
|
233
|
+
kind: "sql",
|
|
234
234
|
connectionId: "conn_sales",
|
|
235
|
-
databaseName: "warehouse",
|
|
236
|
-
schemaName: "public",
|
|
237
|
-
tableName: "orders",
|
|
238
235
|
dialect: "postgres"
|
|
239
236
|
},
|
|
240
237
|
sql: "SELECT customer_name, SUM(revenue) AS revenue FROM public.orders GROUP BY customer_name ORDER BY revenue DESC LIMIT 20",
|
|
@@ -248,24 +245,28 @@ const r = {
|
|
|
248
245
|
};
|
|
249
246
|
export {
|
|
250
247
|
p as SEMAPHOR_ANALYTICS_INTENT_FIXTURES,
|
|
251
|
-
|
|
248
|
+
F as buildAnalyticsCatalogFieldSummary,
|
|
252
249
|
m as buildSemaphorQualifiedSourcePath,
|
|
253
|
-
|
|
254
|
-
|
|
250
|
+
_ as getAnalyticsCatalogFieldCandidates,
|
|
251
|
+
A as getAnalyticsCatalogFieldName,
|
|
255
252
|
d as getSemaphorConnectionCapabilities,
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
D as normalizeAnalyticsCatalogName,
|
|
253
|
+
R as isAnalyticsCatalogDateField,
|
|
254
|
+
L as isAnalyticsCatalogDimensionField,
|
|
255
|
+
D as isAnalyticsCatalogMetricField,
|
|
256
|
+
x as isAnalyticsDateLikeDataType,
|
|
257
|
+
M as isAnalyticsMetricIdentifierField,
|
|
258
|
+
N as isAnalyticsTechnicalIdentifierField,
|
|
259
|
+
w as normalizeAnalyticsCatalogDataType,
|
|
260
|
+
O as normalizeAnalyticsCatalogName,
|
|
265
261
|
c as normalizeSemaphorDialect,
|
|
262
|
+
v as preferSemaphorFieldRefMetadata,
|
|
263
|
+
h as preferSemaphorSourceMetadata,
|
|
264
|
+
g as semaphorFieldRefsMatch,
|
|
266
265
|
u as semaphorSourceHasRequiredCoordinates,
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
266
|
+
y as semaphorSourceIdentityKey,
|
|
267
|
+
k as semaphorSourcesReferToSameDataset,
|
|
268
|
+
C as validateSemaphorAnalyticsIntent,
|
|
269
|
+
I as validateSemaphorAnalyticsRecoveryPlan,
|
|
270
|
+
S as validateSemaphorDashboardIntent,
|
|
271
|
+
T as validateSemaphorOperationIntent
|
|
271
272
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),m=require("react"),d=require("../chunks/switch-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),m=require("react"),d=require("../chunks/switch-DYRgERrC.js"),A=require("../chunks/index-DRlMUglg.js");require("../chunks/index-BxM99sFL.js");const V=require("../chunks/palette-BMXS-AcI.js"),ge=require("../chunks/braces-DDHkbW1c.js");/**
|
|
2
2
|
* @license lucide-react v0.453.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsxs as d, jsx as r, Fragment as ce } from "react/jsx-runtime";
|
|
2
2
|
import m from "react";
|
|
3
|
-
import { c as $, a as K, P as ge, b as be, B as C, d as fe, U as De, C as Ie, R as me, f as le, S as Je, X as je, J as se, e as Le, T as $e, K as _e, M, N as Ve, O as G, Q as Ue, V as Me, W as Ge, Y as We, L as E, Z as Q, _ as ee, $ as re, a0 as he, a1 as oe, a2 as ae, a3 as xe, a4 as ye, a5 as ke, a6 as ve, a7 as Ce, a8 as He } from "../chunks/switch-
|
|
3
|
+
import { c as $, a as K, P as ge, b as be, B as C, d as fe, U as De, C as Ie, R as me, f as le, S as Je, X as je, J as se, e as Le, T as $e, K as _e, M, N as Ve, O as G, Q as Ue, V as Me, W as Ge, Y as We, L as E, Z as Q, _ as ee, $ as re, a0 as he, a1 as oe, a2 as ae, a3 as xe, a4 as ye, a5 as ke, a6 as ve, a7 as Ce, a8 as He } from "../chunks/switch-CP7SmEIZ.js";
|
|
4
4
|
import { r as Ye, v as Xe, A as Ze, a as qe, p as Ke } from "../chunks/index-CJdxSyQq.js";
|
|
5
5
|
import "../chunks/index-CuHybtft.js";
|
|
6
|
-
import { P as W } from "../chunks/palette-
|
|
7
|
-
import { B as Qe } from "../chunks/braces-
|
|
6
|
+
import { P as W } from "../chunks/palette-DKecBucs.js";
|
|
7
|
+
import { B as Qe } from "../chunks/braces-Ccvdip75.js";
|
|
8
8
|
/**
|
|
9
9
|
* @license lucide-react v0.453.0 - ISC
|
|
10
10
|
*
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx as r, jsxs as s, Fragment as X } from "react/jsx-runtime";
|
|
2
2
|
import ee, { useState as h, useCallback as F, useEffect as ae, useMemo as H } from "react";
|
|
3
|
-
import { u as re, c as te, d as se, e as ne, f as le, g as oe, R as W, h as O, C as ie, i as ce, j as de, k as ue, l as _, m as R, n as me, o as fe, p as N } from "./index-
|
|
4
|
-
import { a as S, L as G, P as he, b as pe, B as j, d as ge, e as V, f as ve } from "./switch-
|
|
3
|
+
import { u as re, c as te, d as se, e as ne, f as le, g as oe, R as W, h as O, C as ie, i as ce, j as de, k as ue, l as _, m as R, n as me, o as fe, p as N } from "./index-DVPvpd8u.js";
|
|
4
|
+
import { a as S, L as G, P as he, b as pe, B as j, d as ge, e as V, f as ve } from "./switch-CP7SmEIZ.js";
|
|
5
5
|
import "./index-CuHybtft.js";
|
|
6
|
-
import { C as be } from "./chevrons-up-down-
|
|
6
|
+
import { C as be } from "./chevrons-up-down-pV0i9ptS.js";
|
|
7
7
|
function we(n = {}) {
|
|
8
8
|
var C, A, E, L;
|
|
9
9
|
const { authToken: c, tokenProps: e } = re(), p = n.enabled ?? !0, d = (c == null ? void 0 : c.accessToken) ?? null, u = (e == null ? void 0 : e.apiServiceUrl) ?? null, [I, k] = h(!1), [y, b] = h(!1), [m, g] = h(!1), [T, o] = h(null), [v, w] = h(null), P = v || {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const e=require("react/jsx-runtime"),l=require("react"),t=require("./index-
|
|
1
|
+
"use strict";const e=require("react/jsx-runtime"),l=require("react"),t=require("./index-DT9osgRT.js"),i=require("./switch-DYRgERrC.js");require("./index-BxM99sFL.js");const G=require("./chevrons-up-down-B9fTSds9.js");function W(n={}){var y,P,z,A;const{authToken:d,tokenProps:a}=t.useSemaphorContext(),x=n.enabled??!0,m=(d==null?void 0:d.accessToken)??null,f=(a==null?void 0:a.apiServiceUrl)??null,[L,C]=l.useState(!1),[j,b]=l.useState(!1),[h,g]=l.useState(!1),[N,c]=l.useState(null),[v,S]=l.useState(null),k=v||{tz:((P=(y=a==null?void 0:a.params)==null?void 0:y.calendarContext)==null?void 0:P.tz)||null,weekStart:((A=(z=a==null?void 0:a.params)==null?void 0:z.calendarContext)==null?void 0:A.weekStart)??null},p=l.useCallback(async()=>{if(!(!x||!m||!f)){C(!0),c(null);try{const o=await fetch(`${f}/v1/user-preferences/calendar`,{method:"GET",headers:{Authorization:`Bearer ${m}`}});if(!o.ok){const u=await o.json().catch(()=>({}));throw new Error(u.error||"Failed to fetch preferences")}const r=await o.json();S({tz:r.tz,weekStart:r.weekStart,source:r.source,isInherited:r.isInherited,userHasPrefs:r.userHasPrefs,inherited:r.inherited})}catch(o){const r=o instanceof Error?o.message:"Unknown error";c(r)}finally{C(!1)}}},[m,f,x]);l.useEffect(()=>{x&&p()},[x,p]);const T=l.useCallback(async o=>{if(!m||!f)return c("Not authenticated"),!1;b(!0),c(null);try{const r=await fetch(`${f}/v1/user-preferences/calendar`,{method:"PATCH",headers:{"Content-Type":"application/json",Authorization:`Bearer ${m}`},body:JSON.stringify(o)});if(!r.ok){const u=await r.json().catch(()=>({}));throw new Error(u.error||"Failed to update preferences")}return await p(),!0}catch(r){const u=r instanceof Error?r.message:"Unknown error";return c(u),!1}finally{b(!1)}},[m,f,p]),w=l.useCallback(async()=>{if(!m||!f)return c("Not authenticated"),!1;g(!0),c(null);try{const o=await fetch(`${f}/v1/user-preferences/calendar`,{method:"DELETE",headers:{Authorization:`Bearer ${m}`}});if(!o.ok){const u=await o.json().catch(()=>({}));throw new Error(u.error||"Failed to clear preferences")}const r=await o.text();if(r)try{const u=JSON.parse(r);return S({tz:u.tz,weekStart:u.weekStart,source:u.source,isInherited:u.isInherited??!0,userHasPrefs:!1,inherited:u.inherited}),!0}catch{}return await p(),!0}catch(o){const r=o instanceof Error?o.message:"Unknown error";return c(r),!1}finally{g(!1)}},[m,f,p]);return{preferences:k,isLoading:L,isSaving:j,isClearing:h,error:N,updatePreferences:T,clearPreferences:w,refetch:p}}const E=[{value:"America/New_York",label:"Eastern Time (US & Canada)"},{value:"America/Chicago",label:"Central Time (US & Canada)"},{value:"America/Denver",label:"Mountain Time (US & Canada)"},{value:"America/Los_Angeles",label:"Pacific Time (US & Canada)"},{value:"America/Phoenix",label:"Arizona"},{value:"America/Anchorage",label:"Alaska"},{value:"Pacific/Honolulu",label:"Hawaii"},{value:"Europe/London",label:"London"},{value:"Europe/Paris",label:"Paris, Berlin, Rome"},{value:"Asia/Tokyo",label:"Tokyo"},{value:"Asia/Shanghai",label:"Beijing, Shanghai"},{value:"Asia/Kolkata",label:"Mumbai, New Delhi"},{value:"Australia/Sydney",label:"Sydney"},{value:"UTC",label:"UTC"}],M=[{value:0,label:"Sunday"},{value:1,label:"Monday"},{value:6,label:"Saturday"}],H="text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground";function _(){try{const n=Intl;if(n.supportedValuesOf)return n.supportedValuesOf("timeZone")}catch{}return E.map(n=>n.value)}function q(n){switch(n){case"tenant":return"tenant";case"organization":return"organization";case"system":return"system";default:return"default"}}function O(n){const d=E.find(a=>a.value===n);return d?d.label:n}function V(n){const d=M.find(a=>a.value===n);return d?d.label:String(n)}function Z({open:n,onOpenChange:d}){var D,U,F;const{preferences:a,isLoading:x,isSaving:m,isClearing:f,updatePreferences:L,clearPreferences:C}=W({enabled:n}),j=a.tz||((D=a.inherited)==null?void 0:D.tz)||Intl.DateTimeFormat().resolvedOptions().timeZone,b=a.weekStart??((U=a.inherited)==null?void 0:U.weekStart)??1,[h,g]=l.useState(!a.userHasPrefs),[N,c]=l.useState(!1),[v,S]=l.useState(j),[k,p]=l.useState(b),[T,w]=l.useState(!1),y=l.useMemo(()=>_(),[]),P=l.useMemo(()=>y.filter(s=>!E.some(R=>R.value===s)),[y]),z=l.useMemo(()=>O(v),[v]),A=a.inherited?O(a.inherited.tz):"UTC",o=a.inherited?V(a.inherited.weekStart):"Monday",r=q((F=a.inherited)==null?void 0:F.source);l.useEffect(()=>{if(!n){c(!1);return}N||(a.userHasPrefs!==void 0&&g(!a.userHasPrefs),S(j),p(b))},[n,N,a.userHasPrefs,j,b]);const u=async()=>{if(x){t.ue.error("Preferences are still loading. Please try again.");return}h?await C()?(t.ue.success("Now using default settings. Please refresh the page to apply changes.",{duration:5e3}),d(!1)):t.ue.error("Failed to save preferences. Please try again."):await L({tz:v,weekStart:k})?(t.ue.success("Preferences saved. Please refresh the page to apply changes.",{duration:5e3}),d(!1)):t.ue.error("Failed to save preferences. Please try again.")},$=()=>{d(!1)},I=m||f,B=I||x;return e.jsx(t.Dialog,{open:n,onOpenChange:d,children:e.jsxs(t.DialogContent,{className:"rounded-control border-border/60 sm:max-w-[440px] sm:rounded-control",children:[e.jsxs(t.DialogHeader,{children:[e.jsx(t.DialogTitle,{className:"text-[15px]",children:"Calendar preferences"}),e.jsx(t.DialogDescription,{className:"text-[13px] leading-5",children:"Set your timezone and week-start for date calculations and displays."})]}),e.jsxs("div",{className:"space-y-4 py-1",children:[e.jsxs(t.RadioGroup,{value:h?"defaults":"custom",onValueChange:s=>{c(!0),g(s==="defaults")},className:"space-y-0.5",children:[e.jsxs("label",{htmlFor:"mode-defaults",className:i.cn("flex cursor-pointer items-start gap-2 rounded-control px-2 py-1.5 hover:bg-muted/50",h&&"bg-muted/50"),onClick:()=>{c(!0),g(!0)},children:[e.jsx(t.RadioGroupItem,{value:"defaults",id:"mode-defaults",className:"mt-0.5"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("p",{className:"text-[13px] font-medium text-foreground",children:["Use ",r," defaults"]}),e.jsxs("p",{className:"text-[12px] text-muted-foreground",children:[A,", week starts ",o]})]})]}),e.jsxs("label",{htmlFor:"mode-custom",className:i.cn("flex cursor-pointer items-start gap-2 rounded-control px-2 py-1.5 hover:bg-muted/50",!h&&"bg-muted/50"),onClick:()=>{c(!0),g(!1)},children:[e.jsx(t.RadioGroupItem,{value:"custom",id:"mode-custom",className:"mt-0.5"}),e.jsx("p",{className:"flex-1 text-[13px] font-medium text-foreground",children:"Use custom settings"})]})]}),e.jsxs("div",{className:i.cn("space-y-4 border-t border-border/60 pt-4 transition-opacity",h&&"pointer-events-none opacity-50"),children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(i.Label,{className:H,children:"Timezone"}),e.jsxs(i.Popover,{open:T,onOpenChange:w,modal:!0,children:[e.jsx(i.PopoverTrigger,{asChild:!0,children:e.jsxs(i.Button,{variant:"outline",size:"xs",role:"combobox","aria-expanded":T,className:"w-full justify-between text-[12px] font-normal",disabled:h,children:[e.jsx("span",{className:"truncate",children:z}),e.jsx(G.ChevronsUpDown,{className:"ml-2 h-3.5 w-3.5 shrink-0 opacity-50"})]})}),e.jsx(i.PopoverContent,{className:"z-50 w-[--radix-popover-trigger-width] p-0",align:"start",children:e.jsxs(t.Command,{className:"overflow-visible",children:[e.jsx(t.CommandInput,{placeholder:"Search timezones…"}),e.jsxs(t.CommandList,{children:[e.jsx(t.CommandEmpty,{children:"No timezone found."}),e.jsx(t.CommandGroup,{heading:"Common",children:E.map(s=>e.jsxs(t.CommandItem,{value:`${s.value} ${s.label}`,onSelect:()=>{c(!0),S(s.value),w(!1)},children:[e.jsx(i.Check,{className:i.cn("h-3.5 w-3.5",v===s.value?"opacity-100":"opacity-0")}),e.jsx("span",{className:"flex-1",children:s.label}),e.jsx("span",{className:"text-[11px] text-muted-foreground",children:s.value})]},s.value))}),e.jsx(t.CommandSeparator,{}),e.jsx(t.CommandGroup,{heading:"All timezones",children:P.map(s=>e.jsxs(t.CommandItem,{value:s,onSelect:()=>{c(!0),S(s),w(!1)},children:[e.jsx(i.Check,{className:i.cn("h-3.5 w-3.5",v===s?"opacity-100":"opacity-0")}),s]},s))})]})]})})]})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(i.Label,{className:H,children:"Week starts on"}),e.jsx(t.RadioGroup,{value:String(k),onValueChange:s=>{c(!0),p(Number(s))},className:"flex gap-4",disabled:h,children:M.map(s=>e.jsxs("label",{htmlFor:`week-start-${s.value}`,className:i.cn("flex cursor-pointer items-center gap-2 text-[13px]",h&&"cursor-not-allowed"),children:[e.jsx(t.RadioGroupItem,{value:String(s.value),id:`week-start-${s.value}`,disabled:h}),s.label]},s.value))})]})]})]}),e.jsxs(t.DialogFooter,{children:[e.jsx(i.Button,{variant:"outline",size:"xs",onClick:$,disabled:I,children:"Cancel"}),e.jsx(i.Button,{size:"xs",onClick:u,disabled:B,children:I?e.jsxs(e.Fragment,{children:[e.jsx(i.LoaderCircle,{className:"h-3.5 w-3.5 animate-spin"}),"Saving…"]}):"Save"})]})]})})}exports.CalendarPreferencesDialog=Z;
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
function c(n) {
|
|
2
|
+
return typeof n == "string" ? n.trim().toLowerCase() : "";
|
|
3
|
+
}
|
|
4
|
+
function g(n) {
|
|
5
|
+
return String(n.column_name || n.name || n.qualifiedFieldName || "");
|
|
6
|
+
}
|
|
7
|
+
function p(n) {
|
|
8
|
+
return Array.from(
|
|
9
|
+
new Set(
|
|
10
|
+
[
|
|
11
|
+
n.column_name,
|
|
12
|
+
n.name,
|
|
13
|
+
n.qualifiedFieldName,
|
|
14
|
+
n.alias
|
|
15
|
+
].filter(
|
|
16
|
+
(e) => typeof e == "string" && e.trim().length > 0
|
|
17
|
+
).map((e) => e.trim())
|
|
18
|
+
)
|
|
19
|
+
);
|
|
20
|
+
}
|
|
21
|
+
function o(n) {
|
|
22
|
+
const e = C(n);
|
|
23
|
+
return e ? e.includes("int") || e.includes("uint") || e.includes("bigint") || e.includes("smallint") || e.includes("tinyint") || e.includes("numeric") || e.includes("decimal") || e.includes("double") || e.includes("float") || e.includes("number") || e.includes("real") || e.includes("money") || e.includes("currency") || e.includes("percent") ? "number" : e.includes("timestamp") || e.includes("datetime") || e.startsWith("time") ? "datetime" : e.includes("date") ? "date" : e.includes("bool") ? "boolean" : "string" : "unknown";
|
|
24
|
+
}
|
|
25
|
+
function C(n) {
|
|
26
|
+
let e = c(n), t = "";
|
|
27
|
+
for (; e && e !== t; )
|
|
28
|
+
t = e, e = d(e, "nullable"), e = d(e, "lowcardinality");
|
|
29
|
+
return e;
|
|
30
|
+
}
|
|
31
|
+
function d(n, e) {
|
|
32
|
+
const t = `${e}(`;
|
|
33
|
+
return !n.startsWith(t) || !n.endsWith(")") ? n : n.slice(t.length, -1).trim();
|
|
34
|
+
}
|
|
35
|
+
function A(n) {
|
|
36
|
+
const e = o(n);
|
|
37
|
+
return e === "date" || e === "datetime";
|
|
38
|
+
}
|
|
39
|
+
function u(n) {
|
|
40
|
+
return A(n.dataType || n.data_type);
|
|
41
|
+
}
|
|
42
|
+
function m(n) {
|
|
43
|
+
const e = f(n);
|
|
44
|
+
return e === "id" || e === "row_id";
|
|
45
|
+
}
|
|
46
|
+
function l(n) {
|
|
47
|
+
const e = f(n);
|
|
48
|
+
return m(n) || e.endsWith("_id") || e.endsWith("_key") || e.endsWith("_number");
|
|
49
|
+
}
|
|
50
|
+
function f(n) {
|
|
51
|
+
return c(
|
|
52
|
+
g(n) || n.name || n.alias
|
|
53
|
+
).replace(/[^a-z0-9]+/g, "_").replace(/^_+|_+$/g, "");
|
|
54
|
+
}
|
|
55
|
+
function y(n, e = {}) {
|
|
56
|
+
const t = c(n.role);
|
|
57
|
+
return t === "metric" || t === "measure" ? !e.excludeIdentifiers || !l(n) : t === "groupby" || t === "dimension" || t === "date" || t === "id" ? !1 : o(
|
|
58
|
+
n.dataType || n.data_type
|
|
59
|
+
) === "number" && (!e.excludeIdentifiers || !l(n));
|
|
60
|
+
}
|
|
61
|
+
function h(n) {
|
|
62
|
+
return !y(n) && !u(n);
|
|
63
|
+
}
|
|
64
|
+
function D(n) {
|
|
65
|
+
const e = /* @__PURE__ */ new Set(), t = /* @__PURE__ */ new Set(), s = /* @__PURE__ */ new Set();
|
|
66
|
+
for (const a of n) {
|
|
67
|
+
if (m(a))
|
|
68
|
+
continue;
|
|
69
|
+
const r = p(a);
|
|
70
|
+
if (r.length !== 0) {
|
|
71
|
+
if (u(a)) {
|
|
72
|
+
r.forEach((i) => t.add(i));
|
|
73
|
+
continue;
|
|
74
|
+
}
|
|
75
|
+
if (y(a, { excludeIdentifiers: !0 })) {
|
|
76
|
+
r.forEach((i) => e.add(i));
|
|
77
|
+
continue;
|
|
78
|
+
}
|
|
79
|
+
r.forEach((i) => s.add(i));
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
return {
|
|
83
|
+
validMetricCandidates: Array.from(e).sort(),
|
|
84
|
+
validDateCandidates: Array.from(t).sort(),
|
|
85
|
+
validDimensionCandidates: Array.from(s).sort()
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
export {
|
|
89
|
+
p as a,
|
|
90
|
+
o as b,
|
|
91
|
+
u as c,
|
|
92
|
+
m as d,
|
|
93
|
+
l as e,
|
|
94
|
+
y as f,
|
|
95
|
+
g,
|
|
96
|
+
h,
|
|
97
|
+
A as i,
|
|
98
|
+
D as j,
|
|
99
|
+
c as n
|
|
100
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";function l(t){return typeof t=="string"?t.trim().toLowerCase():""}function f(t){return String(t.column_name||t.name||t.qualifiedFieldName||"")}function g(t){return Array.from(new Set([t.column_name,t.name,t.qualifiedFieldName,t.alias].filter(e=>typeof e=="string"&&e.trim().length>0).map(e=>e.trim())))}function d(t){const e=p(t);return e?e.includes("int")||e.includes("uint")||e.includes("bigint")||e.includes("smallint")||e.includes("tinyint")||e.includes("numeric")||e.includes("decimal")||e.includes("double")||e.includes("float")||e.includes("number")||e.includes("real")||e.includes("money")||e.includes("currency")||e.includes("percent")?"number":e.includes("timestamp")||e.includes("datetime")||e.startsWith("time")?"datetime":e.includes("date")?"date":e.includes("bool")?"boolean":"string":"unknown"}function p(t){let e=l(t),i="";for(;e&&e!==i;)i=e,e=y(e,"nullable"),e=y(e,"lowcardinality");return e}function y(t,e){const i=`${e}(`;return!t.startsWith(i)||!t.endsWith(")")?t:t.slice(i.length,-1).trim()}function A(t){const e=d(t);return e==="date"||e==="datetime"}function o(t){return A(t.dataType||t.data_type)}function u(t){const e=C(t);return e==="id"||e==="row_id"}function c(t){const e=C(t);return u(t)||e.endsWith("_id")||e.endsWith("_key")||e.endsWith("_number")}function C(t){return l(f(t)||t.name||t.alias).replace(/[^a-z0-9]+/g,"_").replace(/^_+|_+$/g,"")}function m(t,e={}){const i=l(t.role);return i==="metric"||i==="measure"?!e.excludeIdentifiers||!c(t):i==="groupby"||i==="dimension"||i==="date"||i==="id"?!1:d(t.dataType||t.data_type)==="number"&&(!e.excludeIdentifiers||!c(t))}function D(t){return!m(t)&&!o(t)}function F(t){const e=new Set,i=new Set,s=new Set;for(const a of t){if(u(a))continue;const r=g(a);if(r.length!==0){if(o(a)){r.forEach(n=>i.add(n));continue}if(m(a,{excludeIdentifiers:!0})){r.forEach(n=>e.add(n));continue}r.forEach(n=>s.add(n))}}return{validMetricCandidates:Array.from(e).sort(),validDateCandidates:Array.from(i).sort(),validDimensionCandidates:Array.from(s).sort()}}exports.buildAnalyticsCatalogFieldSummary=F;exports.getAnalyticsCatalogFieldCandidates=g;exports.getAnalyticsCatalogFieldName=f;exports.isAnalyticsCatalogDateField=o;exports.isAnalyticsCatalogDimensionField=D;exports.isAnalyticsCatalogMetricField=m;exports.isAnalyticsDateLikeDataType=A;exports.isAnalyticsMetricIdentifierField=c;exports.isAnalyticsTechnicalIdentifierField=u;exports.normalizeAnalyticsCatalogDataType=d;exports.normalizeAnalyticsCatalogName=l;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const e=require("react/jsx-runtime"),a=require("./switch-
|
|
1
|
+
"use strict";const e=require("react/jsx-runtime"),a=require("./switch-DYRgERrC.js"),l=require("./index-DT9osgRT.js"),oe=require("./use-create-flow-overlay-state-uNxArZdj.js"),h=require("react"),pn=require("./use-visual-utils-CpaqIHoc.js");require("./index-BxM99sFL.js");const Vs=require("./date-formatter-B4EBSe9C.js");require("./index-DRlMUglg.js");require("react-dom/client");require("react-dom");/**
|
|
2
2
|
* @license lucide-react v0.453.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx as t, jsxs as s, Fragment as ae } from "react/jsx-runtime";
|
|
2
|
-
import { c as Ie, L as vn, a2 as ao, B as pe, f as ne, G as ct, u as q, E as bt, aK as Tr, aa as pa, g as ze, e as Ke, H as fa, a as v, J as Ln, X as Ce, P as Fe, b as Ze, d as et, aL as so, aM as oo, aI as ga, aN as ba, a3 as Ge, a4 as Je, a5 as Qe, a6 as Ye, a7 as ue, V as io, aO as xa, aP as ya, a0 as Xe, T as lo, K as co, M as Lr, aQ as uo } from "./switch-
|
|
3
|
-
import { c as ut, d as mt, e as ht, f as pt, g as ft, bc as mo, o as va, ag as ho, ah as po, av as Na, bP as fo, p as he, aw as Nn, y as go, aN as Rn, aO as Fn, aQ as Pn, aR as je, aV as wa, aI as zt, bQ as bo, bR as xo, b0 as Mn, b1 as Bn, b2 as On, b3 as Vn, b4 as $n, b5 as Un, b6 as _n, u as It, $ as ot, aa as jn, a6 as Ca, a7 as zn, a0 as ka, a5 as yo, ac as vo, bK as No, bS as wo, aK as Co, a8 as Rr, x as Ot, a2 as ko, bT as So, bU as Ao, bV as Eo, bW as Io, bX as Do, bY as To, bZ as Lo, b_ as Ro, b$ as Sa, c0 as Fo, c1 as Po, c2 as Mo, c3 as Bo, c4 as Oo, c5 as gt, c6 as Vo, bJ as Aa, ax as Ea, c7 as $o, c8 as Uo, c9 as _o, ca as jo, cb as zo, cc as Ko, cd as qo, ce as Ia, cf as Ho, cg as Wo, ch as Da, ci as Ta, cj as La, ck as Go, cl as Jo, b9 as Ra, by as Qo, bv as Yo, cm as Xo, aW as Zo, cn as Fa, co as ei, cp as ti, aX as Fr, cq as ni, cr as ri, cs as wn, ct as ai, cu as si, cv as Pa, cw as Kn, cx as oi, cy as ii, cz as li, cA as Ma, cB as Dt, cC as Ba, az as Cn, b7 as Oa, cD as di, cE as ci, ay as kn, cF as ui, cG as Va, cH as mi, cI as hi, cJ as pi, cK as fi, cL as gi, cM as bi, cN as xi, cO as yi } from "./index-
|
|
4
|
-
import { V as vi, E as Pr, a as Mr, b as Ni, c as wi, L as Ci, d as ki, C as Si, u as $a, e as Ua, f as Ai, R as Ei, S as Ii } from "./use-create-flow-overlay-state-
|
|
2
|
+
import { c as Ie, L as vn, a2 as ao, B as pe, f as ne, G as ct, u as q, E as bt, aK as Tr, aa as pa, g as ze, e as Ke, H as fa, a as v, J as Ln, X as Ce, P as Fe, b as Ze, d as et, aL as so, aM as oo, aI as ga, aN as ba, a3 as Ge, a4 as Je, a5 as Qe, a6 as Ye, a7 as ue, V as io, aO as xa, aP as ya, a0 as Xe, T as lo, K as co, M as Lr, aQ as uo } from "./switch-CP7SmEIZ.js";
|
|
3
|
+
import { c as ut, d as mt, e as ht, f as pt, g as ft, bc as mo, o as va, ag as ho, ah as po, av as Na, bP as fo, p as he, aw as Nn, y as go, aN as Rn, aO as Fn, aQ as Pn, aR as je, aV as wa, aI as zt, bQ as bo, bR as xo, b0 as Mn, b1 as Bn, b2 as On, b3 as Vn, b4 as $n, b5 as Un, b6 as _n, u as It, $ as ot, aa as jn, a6 as Ca, a7 as zn, a0 as ka, a5 as yo, ac as vo, bK as No, bS as wo, aK as Co, a8 as Rr, x as Ot, a2 as ko, bT as So, bU as Ao, bV as Eo, bW as Io, bX as Do, bY as To, bZ as Lo, b_ as Ro, b$ as Sa, c0 as Fo, c1 as Po, c2 as Mo, c3 as Bo, c4 as Oo, c5 as gt, c6 as Vo, bJ as Aa, ax as Ea, c7 as $o, c8 as Uo, c9 as _o, ca as jo, cb as zo, cc as Ko, cd as qo, ce as Ia, cf as Ho, cg as Wo, ch as Da, ci as Ta, cj as La, ck as Go, cl as Jo, b9 as Ra, by as Qo, bv as Yo, cm as Xo, aW as Zo, cn as Fa, co as ei, cp as ti, aX as Fr, cq as ni, cr as ri, cs as wn, ct as ai, cu as si, cv as Pa, cw as Kn, cx as oi, cy as ii, cz as li, cA as Ma, cB as Dt, cC as Ba, az as Cn, b7 as Oa, cD as di, cE as ci, ay as kn, cF as ui, cG as Va, cH as mi, cI as hi, cJ as pi, cK as fi, cL as gi, cM as bi, cN as xi, cO as yi } from "./index-DVPvpd8u.js";
|
|
4
|
+
import { V as vi, E as Pr, a as Mr, b as Ni, c as wi, L as Ci, d as ki, C as Si, u as $a, e as Ua, f as Ai, R as Ei, S as Ii } from "./use-create-flow-overlay-state-D5uvjbwY.js";
|
|
5
5
|
import Di, { useState as S, useContext as Ti, useRef as Ee, useCallback as me, useEffect as ce, useMemo as V } from "react";
|
|
6
|
-
import { u as _a } from "./use-visual-utils-
|
|
6
|
+
import { u as _a } from "./use-visual-utils-BLh9mKic.js";
|
|
7
7
|
import "./index-CuHybtft.js";
|
|
8
8
|
import { l as Br } from "./date-formatter-CzcPZx39.js";
|
|
9
9
|
import "./index-CJdxSyQq.js";
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { jsx as t, jsxs as i, Fragment as R } from "react/jsx-runtime";
|
|
2
|
-
import { c as K, u as N, B as _, aA as dt, E as Vt, L as jr, a2 as qr, a as te, aB as Hr, aC as Vr, aD as rt, aE as me, aF as ct, aG as Kt, f as $e, X as Qt, aH as Wt, aI as Kr, G as Rt, Z as Qr, _ as Wr, $ as Jr, a1 as Xr, S as Ut, j as Yr, aJ as Zr } from "./switch-
|
|
3
|
-
import { bg as ea, u as G, c as Jt, bh as ta, aI as re, d as Xt, e as ra, f as at, g as nt, o as aa, bi as ue, aV as Fe, bj as na, bk as Tt, bl as Yt, bm as Zt, bn as sa, b9 as lt, bo as oa, bp as ia, bq as da, br as ca, bs as la, bt as ua, ae as pe, bu as he, p as k, bv as ma, bw as er, az as ut, be as pa, bx as ha, by as fa, bz as tr, aU as rr, aX as ar, ay as ga, aM as ba, bA as xa, bB as va, z as ya, y as Ue, K as wa, A as Xe, bC as Na, bD as Sa, bE as Da, _ as Ca, bF as ka, I as Ye, bG as Ea, bH as La, bI as Ia, bJ as Aa, aN as Ma, aO as Pa, aP as Oa, aQ as _a, aR as $, bK as Ra, aS as Ft, bL as Ua, bM as Ta, bN as Fa, J as $a, bO as Ga, b0 as Ba, b1 as za, b2 as ja, b3 as qa, b4 as Ha, b5 as Va, b6 as Ka, b7 as $t, w as st } from "./index-
|
|
2
|
+
import { c as K, u as N, B as _, aA as dt, E as Vt, L as jr, a2 as qr, a as te, aB as Hr, aC as Vr, aD as rt, aE as me, aF as ct, aG as Kt, f as $e, X as Qt, aH as Wt, aI as Kr, G as Rt, Z as Qr, _ as Wr, $ as Jr, a1 as Xr, S as Ut, j as Yr, aJ as Zr } from "./switch-CP7SmEIZ.js";
|
|
3
|
+
import { bg as ea, u as G, c as Jt, bh as ta, aI as re, d as Xt, e as ra, f as at, g as nt, o as aa, bi as ue, aV as Fe, bj as na, bk as Tt, bl as Yt, bm as Zt, bn as sa, b9 as lt, bo as oa, bp as ia, bq as da, br as ca, bs as la, bt as ua, ae as pe, bu as he, p as k, bv as ma, bw as er, az as ut, be as pa, bx as ha, by as fa, bz as tr, aU as rr, aX as ar, ay as ga, aM as ba, bA as xa, bB as va, z as ya, y as Ue, K as wa, A as Xe, bC as Na, bD as Sa, bE as Da, _ as Ca, bF as ka, I as Ye, bG as Ea, bH as La, bI as Ia, bJ as Aa, aN as Ma, aO as Pa, aP as Oa, aQ as _a, aR as $, bK as Ra, aS as Ft, bL as Ua, bM as Ta, bN as Fa, J as $a, bO as Ga, b0 as Ba, b1 as za, b2 as ja, b3 as qa, b4 as Ha, b5 as Va, b6 as Ka, b7 as $t, w as st } from "./index-DVPvpd8u.js";
|
|
4
4
|
import "./index-CuHybtft.js";
|
|
5
5
|
import * as I from "react";
|
|
6
6
|
import nr, { useState as w, useMemo as V, useEffect as Ge, useRef as Gt, useLayoutEffect as Qa, useCallback as Wa } from "react";
|
|
7
7
|
import "./index-CJdxSyQq.js";
|
|
8
8
|
import "react-dom/client";
|
|
9
9
|
import { createPortal as Ja } from "react-dom";
|
|
10
|
-
import { L as Xa, b as Ya, u as Za, A as en, V as tn, K as rn, e as an, M as nn, N as sn, U as on } from "./dashboard-briefing-launcher-
|
|
10
|
+
import { L as Xa, b as Ya, u as Za, A as en, V as tn, K as rn, e as an, M as nn, N as sn, U as on } from "./dashboard-briefing-launcher-DtxDRAiu.js";
|
|
11
11
|
import { d as sr } from "./index-DFOb_6HB.js";
|
|
12
|
-
import { C as dn } from "./calendar-preferences-dialog-
|
|
12
|
+
import { C as dn } from "./calendar-preferences-dialog-2IbYrrP1.js";
|
|
13
13
|
import { u as cn } from "./use-debounced-dirty-check-BwAbnX_5.js";
|
|
14
14
|
import { s as Ze } from "./normalize-dashboard-for-dirty-check-5KpZN8xr.js";
|
|
15
|
-
import { P as ln } from "./palette-
|
|
16
|
-
import { B as un } from "./braces-
|
|
15
|
+
import { P as ln } from "./palette-DKecBucs.js";
|
|
16
|
+
import { B as un } from "./braces-Ccvdip75.js";
|
|
17
17
|
/**
|
|
18
18
|
* @license lucide-react v0.453.0 - ISC
|
|
19
19
|
*
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),d=require("./switch-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),d=require("./switch-DYRgERrC.js"),s=require("./index-DT9osgRT.js");require("./index-BxM99sFL.js");const v=require("react");require("./index-DRlMUglg.js");require("react-dom/client");const Yt=require("react-dom"),O=require("./dashboard-briefing-launcher-CcqDPVke.js"),ht=require("./index-D7KJindZ.js"),Zt=require("./calendar-preferences-dialog-8-KE5sVX.js"),es=require("./use-debounced-dirty-check-XHSwAefL.js"),Re=require("./normalize-dashboard-for-dirty-check-BXRUMVb2.js"),ts=require("./palette-BMXS-AcI.js"),ss=require("./braces-DDHkbW1c.js");function rs(t){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const r in t)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(a,r,n.get?n:{enumerable:!0,get:()=>t[r]})}}return a.default=t,Object.freeze(a)}const E=rs(v);/**
|
|
2
2
|
* @license lucide-react v0.453.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),o=require("react");require("./index-BxM99sFL.js");const s=require("./switch-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),o=require("react");require("./index-BxM99sFL.js");const s=require("./switch-DYRgERrC.js");require("./index-DT9osgRT.js");require("./index-DRlMUglg.js");require("react-dom/client");require("react-dom");function b(){const t=s.useDashboardStore(e=>e.dashboard),c=s.useDashboardStore(e=>e.actions.setDashboard),u=s.useDashboardStore(e=>e.showDashboardJSON),h=s.useDashboardStore(e=>e.actions.setShowDashboardJSON),r=o.useMemo(()=>t?JSON.stringify(t,null,2):"",[t]),[l,i]=o.useState(r),n=o.useRef(r);return o.useEffect(()=>{r!==n.current&&(i(r),n.current=r)},[r]),a.jsxs("div",{className:s.cn("relative p-2",{hidden:!u}),children:[a.jsxs(s.Button,{variant:"secondary",size:"sm",className:"absolute right-2 top-2 z-10 h-8",onClick:()=>h(!1),children:[a.jsx(s.X,{className:"mr-2 h-4 w-4"}),"Close"]}),a.jsx("div",{className:"h-[550px] overflow-hidden",children:a.jsx(s.CodeEditor,{value:l,onValueChange:e=>{i(e);try{const d=JSON.parse(e);n.current=JSON.stringify(d,null,2),c(d)}catch{}},language:"json"})})]})}exports.default=b;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsxs as d, jsx as t } from "react/jsx-runtime";
|
|
2
2
|
import { useMemo as m, useState as b, useRef as f, useEffect as p } from "react";
|
|
3
3
|
import "./index-CuHybtft.js";
|
|
4
|
-
import { u as o, a as S, B as N, X as D, C as J } from "./switch-
|
|
5
|
-
import "./index-
|
|
4
|
+
import { u as o, a as S, B as N, X as D, C as J } from "./switch-CP7SmEIZ.js";
|
|
5
|
+
import "./index-DVPvpd8u.js";
|
|
6
6
|
import "./index-CJdxSyQq.js";
|
|
7
7
|
import "react-dom/client";
|
|
8
8
|
import "react-dom";
|