react-semaphor 0.1.377 → 0.1.379
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 +1 -1
- package/dist/brand-studio/index.cjs +1 -1
- package/dist/brand-studio/index.js +6 -6
- package/dist/chunks/{braces-C2uBgj3t.js → braces-BT-ZyB-g.js} +1 -1
- package/dist/chunks/{braces-CkXyWzRh.js → braces-DOxxfERN.js} +1 -1
- package/dist/chunks/{calendar-preferences-dialog-C55VOTIy.js → calendar-preferences-dialog-Dsgs8WDv.js} +16 -17
- package/dist/chunks/calendar-preferences-dialog-iZs8XqyH.js +1 -0
- package/dist/chunks/catalog-field-grounding-8L9I0zdg.js +1 -0
- package/dist/chunks/{catalog-field-grounding-DHXEI7cW.js → catalog-field-grounding-BK4BX8sZ.js} +7 -6
- package/dist/chunks/dashboard-briefing-launcher-B5vPTl8P.js +80 -0
- package/dist/chunks/{dashboard-briefing-launcher-CUyeiL_T.js → dashboard-briefing-launcher-Coks66cV.js} +2093 -2142
- package/dist/chunks/{dashboard-controls-B4hxFc3Q.js → dashboard-controls-BfkcnIdy.js} +40 -40
- package/dist/chunks/{dashboard-controls-D4vI0wvU.js → dashboard-controls-Dyqye6fh.js} +1 -1
- package/dist/chunks/{dashboard-json-DQnm6daE.js → dashboard-json-CV_LnO9x.js} +1 -1
- package/dist/chunks/{dashboard-json-pl1_mFqJ.js → dashboard-json-DjXi4cI6.js} +3 -3
- package/dist/chunks/{edit-dashboard-visual-CF4aSsav.js → edit-dashboard-visual-DOW1Ap1N.js} +1031 -1032
- package/dist/chunks/{edit-dashboard-visual-CjTXY51a.js → edit-dashboard-visual-yinO0yU-.js} +33 -33
- package/dist/chunks/{index-B2kPleRS.js → index-CkoRCh3g.js} +199 -194
- package/dist/chunks/{index-Bn866BBY.js → index-DlprYjr6.js} +20664 -20526
- package/dist/chunks/{layout-grid-BFmJ7vmH.js → layout-grid-DTbOIOsE.js} +1 -1
- package/dist/chunks/{layout-grid-CTOW9oTg.js → layout-grid-DccceHv4.js} +1 -1
- package/dist/chunks/{palette-OFaniMPn.js → palette-DCzLwqIw.js} +1 -1
- package/dist/chunks/{palette-DrhPeer-.js → palette-SimHJELn.js} +1 -1
- package/dist/chunks/{save-BxWBiQv1.js → save-D2O96E5A.js} +1 -1
- package/dist/chunks/{save-Dh6gSC4x.js → save-zNVYH02T.js} +1 -1
- package/dist/chunks/{switch-C-fGjxjY.js → switch-DMPsMpHW.js} +1 -1
- package/dist/chunks/{switch-D5xopzFD.js → switch-Jhyl63RF.js} +1 -1
- package/dist/chunks/{use-create-flow-overlay-state-Dg2ffpCE.js → use-create-flow-overlay-state-NsqFPwdB.js} +1 -1
- package/dist/chunks/{use-create-flow-overlay-state-DrKP0jWE.js → use-create-flow-overlay-state-r5JKyXU8.js} +4 -4
- package/dist/chunks/{validation-bMedDBOo.js → validation-BM3-ShHV.js} +1 -1
- package/dist/chunks/{validation-BHFaWDU-.js → validation-BVpqRFar.js} +1 -1
- package/dist/dashboard/index.cjs +1 -1
- package/dist/dashboard/index.js +1 -1
- package/dist/dashboard-authoring/index.cjs +1 -1
- package/dist/dashboard-authoring/index.js +1 -1
- package/dist/data-app-builder/index.cjs +1 -1
- package/dist/data-app-builder/index.js +3 -3
- package/dist/data-app-sdk/index.cjs +1 -1
- package/dist/data-app-sdk/index.js +3 -3
- package/dist/data-app-sdk-validation/index.cjs +1 -1
- package/dist/data-app-sdk-validation/index.js +2 -2
- package/dist/index.cjs +1 -1
- package/dist/index.js +62 -61
- 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 +44 -0
- package/dist/types/dashboard-assistant.d.ts +42 -0
- package/dist/types/data-app-sdk-validation.d.ts +42 -0
- package/dist/types/data-app-sdk.d.ts +42 -0
- package/dist/types/main.d.ts +7 -0
- package/dist/types/types.d.ts +4 -0
- package/package.json +1 -1
- package/dist/chunks/calendar-preferences-dialog-DAukJOaP.js +0 -1
- package/dist/chunks/catalog-field-grounding-BGW0hnB9.js +0 -1
- package/dist/chunks/chevrons-up-down-BnzChFLU.js +0 -14
- package/dist/chunks/chevrons-up-down-W0nzHzx0.js +0 -6
- package/dist/chunks/dashboard-briefing-launcher-DMKfG_z3.js +0 -111
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("../chunks/validators-jpoYhpHh.js"),r=require("../chunks/catalog-field-grounding-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("../chunks/validators-jpoYhpHh.js"),r=require("../chunks/catalog-field-grounding-8L9I0zdg.js"),l=require("../chunks/source-identity-C-xaeE_I.js");function c(e,a={}){const i=d(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 u(e){const a=d(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 m(e){return e.capabilities.prefixLevels.every(a=>!!o(e.source,a))}function p(e){const a=e.quoteIdentifier??b;return e.capabilities.prefixLevels.map(i=>o(e.source,i)).filter(i=>!!i).map(i=>a(i,e.capabilities.dialect)).join(".")}function o(e,a){return a==="database"?e.databaseName:a==="schema"?e.schemaName:e.tableName}function b(e,a){return a==="mysql"||a==="bigquery"||a==="clickhouse"||a==="duckdb"?`\`${e.replace(/`/g,"``")}\``:a==="mssql"?`[${e.replace(/]/g,"]]")}]`:`"${e.replace(/"/g,'""')}"`}function d(e){if(typeof e!="string")return"";const a=[];for(const i of e.trim().toLowerCase())h(i)&&a.push(i);return a.join("")}function h(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.normalizeSemaphorAnalyticsFilterOperator=t.normalizeSemaphorAnalyticsFilterOperator;exports.normalizeSemaphorInputOperator=t.normalizeSemaphorInputOperator;exports.parseSemaphorIsoTimeWindowBoundary=t.parseSemaphorIsoTimeWindowBoundary;exports.validateSemaphorAnalyticsIntent=t.validateSemaphorAnalyticsIntent;exports.validateSemaphorAnalyticsRecoveryPlan=t.validateSemaphorAnalyticsRecoveryPlan;exports.validateSemaphorDashboardIntent=t.validateSemaphorDashboardIntent;exports.validateSemaphorDerivedFieldDefinition=t.validateSemaphorDerivedFieldDefinition;exports.validateSemaphorOperationIntent=t.validateSemaphorOperationIntent;exports.validateSemaphorResultCalculation=t.validateSemaphorResultCalculation;exports.SEMAPHOR_ANALYZE_RESULT_FIELD_CONTRACT=r.SEMAPHOR_ANALYZE_RESULT_FIELD_CONTRACT;exports.buildAnalyticsCatalogFieldSummary=r.buildAnalyticsCatalogFieldSummary;exports.getAnalyticsCatalogFieldCandidates=r.getAnalyticsCatalogFieldCandidates;exports.getAnalyticsCatalogFieldName=r.getAnalyticsCatalogFieldName;exports.getSemaphorAnalyzeResultFieldNames=r.getSemaphorAnalyzeResultFieldNames;exports.isAnalyticsCatalogDateField=r.isAnalyticsCatalogDateField;exports.isAnalyticsCatalogDimensionField=r.isAnalyticsCatalogDimensionField;exports.isAnalyticsCatalogMetricField=r.isAnalyticsCatalogMetricField;exports.isAnalyticsDateLikeDataType=r.isAnalyticsDateLikeDataType;exports.isAnalyticsMetricIdentifierField=r.isAnalyticsMetricIdentifierField;exports.isAnalyticsTechnicalIdentifierField=r.isAnalyticsTechnicalIdentifierField;exports.isSemaphorAnalyzeResultFieldName=r.isSemaphorAnalyzeResultFieldName;exports.normalizeAnalyticsCatalogDataType=r.normalizeAnalyticsCatalogDataType;exports.normalizeAnalyticsCatalogName=r.normalizeAnalyticsCatalogName;exports.parseSemaphorAnalyzeResult=r.parseSemaphorAnalyzeResult;exports.preferSemaphorFieldRefMetadata=l.preferSemaphorFieldRefMetadata;exports.preferSemaphorSourceMetadata=l.preferSemaphorSourceMetadata;exports.semaphorFieldRefsMatch=l.semaphorFieldRefsMatch;exports.semaphorSourceIdentityKey=l.semaphorSourceIdentityKey;exports.semaphorSourcesReferToSameDataset=l.semaphorSourcesReferToSameDataset;exports.SEMAPHOR_ANALYTICS_INTENT_FIXTURES=f;exports.buildSemaphorQualifiedSourcePath=p;exports.getSemaphorConnectionCapabilities=c;exports.normalizeSemaphorDialect=u;exports.semaphorSourceHasRequiredCoordinates=m;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { a as h, n as v, p as g, c as y, e as S, f as k, v as C, d as T, b as I } from "../chunks/validators-CtNmgsvG.js";
|
|
2
|
-
import { S as F, l as q, b as R, a as _, g as L, e as D, k as N, j as x, d as M, h as O, f as z, i as E, c as w, n as P, p as B } from "../chunks/catalog-field-grounding-
|
|
2
|
+
import { S as F, l as q, b as R, a as _, g as L, e as D, k as N, j as x, d as M, h as O, f as z, i as E, c as w, n as P, p as B } from "../chunks/catalog-field-grounding-BK4BX8sZ.js";
|
|
3
3
|
import { c as Q, p as U, b as Y, s as G, a as H } from "../chunks/source-identity-Dj3dryN9.js";
|
|
4
4
|
function d(e, a = {}) {
|
|
5
5
|
const r = n(e), s = {
|
|
@@ -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-Jhyl63RF.js"),A=require("../chunks/index-DRlMUglg.js");require("../chunks/index-BxM99sFL.js");require("../chunks/catalog-field-grounding-8L9I0zdg.js");const V=require("../chunks/palette-SimHJELn.js"),ge=require("../chunks/braces-BT-ZyB-g.js"),be=require("../chunks/save-D2O96E5A.js"),fe=require("../chunks/layout-grid-DccceHv4.js");/**
|
|
2
2
|
* @license lucide-react v0.453.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -1,13 +1,13 @@
|
|
|
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 ae, a as q, P as ge, b as be, B as C, d as fe, U as De, C as Ie, R as me, f as le, X as Je, S as se, e as je, T as Le, I as $e, J as U, K as _e, M, N as Ve, O as Ue, Q as Me, V as Ge, L as E, W as K, Y as Q, Z as ee, _ as he, $ as re, a0 as oe, a1 as ke, a2 as xe, a3 as ye, a4 as ve, a5 as Ce, a6 as We } from "../chunks/switch-
|
|
3
|
+
import { c as ae, a as q, P as ge, b as be, B as C, d as fe, U as De, C as Ie, R as me, f as le, X as Je, S as se, e as je, T as Le, I as $e, J as U, K as _e, M, N as Ve, O as Ue, Q as Me, V as Ge, L as E, W as K, Y as Q, Z as ee, _ as he, $ as re, a0 as oe, a1 as ke, a2 as xe, a3 as ye, a4 as ve, a5 as Ce, a6 as We } from "../chunks/switch-DMPsMpHW.js";
|
|
4
4
|
import { r as He, v as Ye, A as Xe, a as Ze, p as qe } from "../chunks/index-CJdxSyQq.js";
|
|
5
5
|
import "../chunks/index-CuHybtft.js";
|
|
6
|
-
import "../chunks/catalog-field-grounding-
|
|
7
|
-
import { P as G } from "../chunks/palette-
|
|
8
|
-
import { B as Ke } from "../chunks/braces-
|
|
9
|
-
import { S as Qe } from "../chunks/save-
|
|
10
|
-
import { L as er } from "../chunks/layout-grid-
|
|
6
|
+
import "../chunks/catalog-field-grounding-BK4BX8sZ.js";
|
|
7
|
+
import { P as G } from "../chunks/palette-DCzLwqIw.js";
|
|
8
|
+
import { B as Ke } from "../chunks/braces-DOxxfERN.js";
|
|
9
|
+
import { S as Qe } from "../chunks/save-zNVYH02T.js";
|
|
10
|
+
import { L as er } from "../chunks/layout-grid-DTbOIOsE.js";
|
|
11
11
|
/**
|
|
12
12
|
* @license lucide-react v0.453.0 - ISC
|
|
13
13
|
*
|
|
@@ -1,10 +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, b as te, c as se, d as ne, e as le, f as oe, R as W, g as O, C as ie, h as ce, i as de, j as ue, k as
|
|
4
|
-
import { a as S, L as G, P as
|
|
3
|
+
import { u as re, b as te, c as se, d as ne, e as le, f as oe, R as W, g as O, C as ie, h as ce, i as de, j as ue, k as me, l as _, m as R, n as fe, o as he, p as N } from "./index-DlprYjr6.js";
|
|
4
|
+
import { a as S, L as G, P as pe, b as ge, B as j, d as ve, e as V, f as be } from "./switch-DMPsMpHW.js";
|
|
5
5
|
import "./index-CuHybtft.js";
|
|
6
|
-
import "./catalog-field-grounding-
|
|
7
|
-
import { C as be } from "./chevrons-up-down-BnzChFLU.js";
|
|
6
|
+
import "./catalog-field-grounding-BK4BX8sZ.js";
|
|
8
7
|
function we(n = {}) {
|
|
9
8
|
var C, A, E, L;
|
|
10
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 || {
|
|
@@ -168,7 +167,7 @@ function xe(n) {
|
|
|
168
167
|
const c = K.find((e) => e.value === n);
|
|
169
168
|
return c ? c.label : String(n);
|
|
170
169
|
}
|
|
171
|
-
function
|
|
170
|
+
function Ae({
|
|
172
171
|
open: n,
|
|
173
172
|
onOpenChange: c
|
|
174
173
|
}) {
|
|
@@ -311,13 +310,13 @@ function Ee({
|
|
|
311
310
|
/* @__PURE__ */ s("div", { className: "space-y-1.5", children: [
|
|
312
311
|
/* @__PURE__ */ r(G, { className: Z, children: "Timezone" }),
|
|
313
312
|
/* @__PURE__ */ s(
|
|
314
|
-
|
|
313
|
+
pe,
|
|
315
314
|
{
|
|
316
315
|
open: z,
|
|
317
316
|
onOpenChange: x,
|
|
318
317
|
modal: !0,
|
|
319
318
|
children: [
|
|
320
|
-
/* @__PURE__ */ r(
|
|
319
|
+
/* @__PURE__ */ r(ge, { asChild: !0, children: /* @__PURE__ */ s(
|
|
321
320
|
j,
|
|
322
321
|
{
|
|
323
322
|
variant: "outline",
|
|
@@ -328,19 +327,19 @@ function Ee({
|
|
|
328
327
|
disabled: m,
|
|
329
328
|
children: [
|
|
330
329
|
/* @__PURE__ */ r("span", { className: "truncate", children: E }),
|
|
331
|
-
/* @__PURE__ */ r(
|
|
330
|
+
/* @__PURE__ */ r(ie, { className: "ml-2 h-3.5 w-3.5 shrink-0 opacity-50" })
|
|
332
331
|
]
|
|
333
332
|
}
|
|
334
333
|
) }),
|
|
335
334
|
/* @__PURE__ */ r(
|
|
336
|
-
|
|
335
|
+
ve,
|
|
337
336
|
{
|
|
338
337
|
className: "z-50 w-[--radix-popover-trigger-width] p-0",
|
|
339
338
|
align: "start",
|
|
340
|
-
children: /* @__PURE__ */ s(
|
|
341
|
-
/* @__PURE__ */ r(
|
|
342
|
-
/* @__PURE__ */ s(
|
|
343
|
-
/* @__PURE__ */ r(
|
|
339
|
+
children: /* @__PURE__ */ s(ce, { className: "overflow-visible", children: [
|
|
340
|
+
/* @__PURE__ */ r(de, { placeholder: "Search timezones…" }),
|
|
341
|
+
/* @__PURE__ */ s(ue, { children: [
|
|
342
|
+
/* @__PURE__ */ r(me, { children: "No timezone found." }),
|
|
344
343
|
/* @__PURE__ */ r(_, { heading: "Common", children: D.map((a) => /* @__PURE__ */ s(
|
|
345
344
|
R,
|
|
346
345
|
{
|
|
@@ -364,7 +363,7 @@ function Ee({
|
|
|
364
363
|
},
|
|
365
364
|
a.value
|
|
366
365
|
)) }),
|
|
367
|
-
/* @__PURE__ */ r(
|
|
366
|
+
/* @__PURE__ */ r(fe, {}),
|
|
368
367
|
/* @__PURE__ */ r(_, { heading: "All timezones", children: A.map((a) => /* @__PURE__ */ s(
|
|
369
368
|
R,
|
|
370
369
|
{
|
|
@@ -435,7 +434,7 @@ function Ee({
|
|
|
435
434
|
}
|
|
436
435
|
)
|
|
437
436
|
] }),
|
|
438
|
-
/* @__PURE__ */ s(
|
|
437
|
+
/* @__PURE__ */ s(he, { children: [
|
|
439
438
|
/* @__PURE__ */ r(
|
|
440
439
|
j,
|
|
441
440
|
{
|
|
@@ -447,12 +446,12 @@ function Ee({
|
|
|
447
446
|
}
|
|
448
447
|
),
|
|
449
448
|
/* @__PURE__ */ r(j, { size: "xs", onClick: i, disabled: q, children: U ? /* @__PURE__ */ s(X, { children: [
|
|
450
|
-
/* @__PURE__ */ r(
|
|
449
|
+
/* @__PURE__ */ r(be, { className: "h-3.5 w-3.5 animate-spin" }),
|
|
451
450
|
"Saving…"
|
|
452
451
|
] }) : "Save" })
|
|
453
452
|
] })
|
|
454
453
|
] }) });
|
|
455
454
|
}
|
|
456
455
|
export {
|
|
457
|
-
|
|
456
|
+
Ae as C
|
|
458
457
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e=require("react/jsx-runtime"),l=require("react"),t=require("./index-CkoRCh3g.js"),o=require("./switch-Jhyl63RF.js");require("./index-BxM99sFL.js");require("./catalog-field-grounding-8L9I0zdg.js");function G(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 i=await fetch(`${f}/v1/user-preferences/calendar`,{method:"GET",headers:{Authorization:`Bearer ${m}`}});if(!i.ok){const u=await i.json().catch(()=>({}));throw new Error(u.error||"Failed to fetch preferences")}const r=await i.json();S({tz:r.tz,weekStart:r.weekStart,source:r.source,isInherited:r.isInherited,userHasPrefs:r.userHasPrefs,inherited:r.inherited})}catch(i){const r=i instanceof Error?i.message:"Unknown error";c(r)}finally{C(!1)}}},[m,f,x]);l.useEffect(()=>{x&&p()},[x,p]);const T=l.useCallback(async i=>{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(i)});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 i=await fetch(`${f}/v1/user-preferences/calendar`,{method:"DELETE",headers:{Authorization:`Bearer ${m}`}});if(!i.ok){const u=await i.json().catch(()=>({}));throw new Error(u.error||"Failed to clear preferences")}const r=await i.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(i){const r=i instanceof Error?i.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 W(){try{const n=Intl;if(n.supportedValuesOf)return n.supportedValuesOf("timeZone")}catch{}return E.map(n=>n.value)}function _(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 q(n){const d=M.find(a=>a.value===n);return d?d.label:String(n)}function V({open:n,onOpenChange:d}){var D,U,F;const{preferences:a,isLoading:x,isSaving:m,isClearing:f,updatePreferences:L,clearPreferences:C}=G({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(()=>W(),[]),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",i=a.inherited?q(a.inherited.weekStart):"Monday",r=_((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:o.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 ",i]})]})]}),e.jsxs("label",{htmlFor:"mode-custom",className:o.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:o.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(o.Label,{className:H,children:"Timezone"}),e.jsxs(o.Popover,{open:T,onOpenChange:w,modal:!0,children:[e.jsx(o.PopoverTrigger,{asChild:!0,children:e.jsxs(o.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(t.ChevronsUpDown,{className:"ml-2 h-3.5 w-3.5 shrink-0 opacity-50"})]})}),e.jsx(o.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(o.Check,{className:o.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(o.Check,{className:o.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(o.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:o.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(o.Button,{variant:"outline",size:"xs",onClick:$,disabled:I,children:"Cancel"}),e.jsx(o.Button,{size:"xs",onClick:u,disabled:B,children:I?e.jsxs(e.Fragment,{children:[e.jsx(o.LoaderCircle,{className:"h-3.5 w-3.5 animate-spin"}),"Saving…"]}):"Save"})]})]})})}exports.CalendarPreferencesDialog=V;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const o={answerSummary:"string",responseDetail:"responseDetail",mode:"string",comparisonType:"string",executionResult:"unknown",compiledQuery:"unknown",data:"unknown",resultSets:"record",columns:"unknownArray",records:"recordArray",rowCount:"number",rowLimitExceeded:"boolean",output:"string",querySpec:"unknown",metadata:"record",validation:"unknown",coverage:"unknown",diagnosticFeedback:"unknown",missingFields:"stringArray",warnings:"unknownArray",comparison:"unknown",population:"unknown",comparisons:"recordArray",fieldsUsed:"unknown",changes:"recordArray",largestNegativeChanges:"recordArray",largestPositiveChanges:"recordArray",drivers:"recordArray",absoluteDeltaDrivers:"recordArray",largestNegativeDrivers:"recordArray",largestPositiveDrivers:"recordArray",periodRows:"recordArray",sql:"unknown",omitted:"stringArray"},b=new Set(Object.keys(o)),S=new Set(["compact","standard","debug"]);function D(){return Object.keys(o)}function g(e){return b.has(e)}function F(e){if(!e||typeof e!="object"||Array.isArray(e))throw new Error("Semaphor analyze result must be an object.");const n=e,t=Object.keys(n).filter(r=>!g(r));if(t.length)throw new Error(`Semaphor analyze result contains unsupported top-level field(s): ${t.join(", ")}.`);for(const[r,i]of Object.entries(n)){if(i===void 0)continue;const a=o[r];if(!k(i,a))throw new Error(`Semaphor analyze result field "${r}" does not match contract kind "${a}".`)}return n}function k(e,n){switch(n){case"boolean":return typeof e=="boolean";case"number":return typeof e=="number"&&Number.isFinite(e);case"record":return A(e);case"recordArray":return Array.isArray(e)&&e.every(A);case"responseDetail":return typeof e=="string"&&S.has(e);case"string":return typeof e=="string";case"stringArray":return Array.isArray(e)&&e.every(t=>typeof t=="string");case"unknown":return!0;case"unknownArray":return Array.isArray(e)}}function A(e){return!!(e&&typeof e=="object"&&!Array.isArray(e))}function c(e){return typeof e=="string"?e.trim().toLowerCase():""}function p(e){return String(e.column_name||e.name||e.qualifiedFieldName||"")}function w(e){return Array.from(new Set([e.column_name,e.name,e.qualifiedFieldName,e.alias].filter(n=>typeof n=="string"&&n.trim().length>0).map(n=>n.trim())))}function d(e){const n=T(e);return n?n.includes("int")||n.includes("uint")||n.includes("bigint")||n.includes("smallint")||n.includes("tinyint")||n.includes("numeric")||n.includes("decimal")||n.includes("double")||n.includes("float")||n.includes("number")||n.includes("real")||n.includes("money")||n.includes("currency")||n.includes("percent")?"number":n.includes("timestamp")||n.includes("datetime")||n.startsWith("time")?"datetime":n.includes("date")?"date":n.includes("bool")?"boolean":"string":"unknown"}function T(e){let n=c(e),t="";for(;n&&n!==t;)t=n,n=f(n,"nullable"),n=f(n,"lowcardinality");return n}function f(e,n){const t=`${n}(`;return!e.startsWith(t)||!e.endsWith(")")?e:e.slice(t.length,-1).trim()}function h(e){const n=d(e);return n==="date"||n==="datetime"}function u(e){return h(e.dataType||e.data_type)}function y(e){const n=C(e);return n==="id"||n==="row_id"}function l(e){const n=C(e);return y(e)||n.endsWith("_id")||n.endsWith("_key")||n.endsWith("_number")}function C(e){return c(p(e)||e.name||e.alias).replace(/[^a-z0-9]+/g,"_").replace(/^_+|_+$/g,"")}function m(e,n={}){const t=c(e.role);return t==="metric"||t==="measure"?!n.excludeIdentifiers||!l(e):t==="groupby"||t==="dimension"||t==="date"||t==="id"?!1:d(e.dataType||e.data_type)==="number"&&(!n.excludeIdentifiers||!l(e))}function _(e){return!m(e)&&!u(e)}function E(e){const n=new Set,t=new Set,r=new Set;for(const i of e){if(y(i))continue;const a=w(i);if(a.length!==0){if(u(i)){a.forEach(s=>t.add(s));continue}if(m(i,{excludeIdentifiers:!0})){a.forEach(s=>n.add(s));continue}a.forEach(s=>r.add(s))}}return{validMetricCandidates:Array.from(n).sort(),validDateCandidates:Array.from(t).sort(),validDimensionCandidates:Array.from(r).sort()}}exports.SEMAPHOR_ANALYZE_RESULT_FIELD_CONTRACT=o;exports.buildAnalyticsCatalogFieldSummary=E;exports.getAnalyticsCatalogFieldCandidates=w;exports.getAnalyticsCatalogFieldName=p;exports.getSemaphorAnalyzeResultFieldNames=D;exports.isAnalyticsCatalogDateField=u;exports.isAnalyticsCatalogDimensionField=_;exports.isAnalyticsCatalogMetricField=m;exports.isAnalyticsDateLikeDataType=h;exports.isAnalyticsMetricIdentifierField=l;exports.isAnalyticsTechnicalIdentifierField=y;exports.isSemaphorAnalyzeResultFieldName=g;exports.normalizeAnalyticsCatalogDataType=d;exports.normalizeAnalyticsCatalogName=c;exports.parseSemaphorAnalyzeResult=F;
|
package/dist/chunks/{catalog-field-grounding-DHXEI7cW.js → catalog-field-grounding-BK4BX8sZ.js}
RENAMED
|
@@ -16,6 +16,7 @@ const o = {
|
|
|
16
16
|
metadata: "record",
|
|
17
17
|
validation: "unknown",
|
|
18
18
|
coverage: "unknown",
|
|
19
|
+
diagnosticFeedback: "unknown",
|
|
19
20
|
missingFields: "stringArray",
|
|
20
21
|
warnings: "unknownArray",
|
|
21
22
|
comparison: "unknown",
|
|
@@ -96,10 +97,10 @@ function d(e) {
|
|
|
96
97
|
function c(e) {
|
|
97
98
|
return typeof e == "string" ? e.trim().toLowerCase() : "";
|
|
98
99
|
}
|
|
99
|
-
function
|
|
100
|
+
function k(e) {
|
|
100
101
|
return String(e.column_name || e.name || e.qualifiedFieldName || "");
|
|
101
102
|
}
|
|
102
|
-
function
|
|
103
|
+
function S(e) {
|
|
103
104
|
return Array.from(
|
|
104
105
|
new Set(
|
|
105
106
|
[
|
|
@@ -144,7 +145,7 @@ function l(e) {
|
|
|
144
145
|
}
|
|
145
146
|
function p(e) {
|
|
146
147
|
return c(
|
|
147
|
-
|
|
148
|
+
k(e) || e.name || e.alias
|
|
148
149
|
).replace(/[^a-z0-9]+/g, "_").replace(/^_+|_+$/g, "");
|
|
149
150
|
}
|
|
150
151
|
function A(e, n = {}) {
|
|
@@ -161,7 +162,7 @@ function T(e) {
|
|
|
161
162
|
for (const a of e) {
|
|
162
163
|
if (f(a))
|
|
163
164
|
continue;
|
|
164
|
-
const i =
|
|
165
|
+
const i = S(a);
|
|
165
166
|
if (i.length !== 0) {
|
|
166
167
|
if (m(a)) {
|
|
167
168
|
i.forEach((s) => r.add(s));
|
|
@@ -182,8 +183,8 @@ function T(e) {
|
|
|
182
183
|
}
|
|
183
184
|
export {
|
|
184
185
|
o as S,
|
|
185
|
-
|
|
186
|
-
|
|
186
|
+
k as a,
|
|
187
|
+
S as b,
|
|
187
188
|
y as c,
|
|
188
189
|
D as d,
|
|
189
190
|
m as e,
|