react-semaphor 0.1.390 → 0.1.392

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.
Files changed (68) hide show
  1. package/dist/analytics-protocol/index.cjs +1 -1
  2. package/dist/analytics-protocol/index.js +120 -252
  3. package/dist/brand-studio/index.cjs +1 -1
  4. package/dist/brand-studio/index.js +7 -7
  5. package/dist/chunks/analyze-result-contract-C9Gv2_qW.js +1585 -0
  6. package/dist/chunks/analyze-result-contract-Zgg-Bbpj.js +1 -0
  7. package/dist/chunks/{braces--20GzUQh.js → braces-8TRlDwDw.js} +1 -1
  8. package/dist/chunks/{braces-C0Vh_Mft.js → braces-D2tStQjF.js} +1 -1
  9. package/dist/chunks/{calendar-preferences-dialog-B-VsxhsA.js → calendar-preferences-dialog-49fcEPXS.js} +4 -4
  10. package/dist/chunks/{calendar-preferences-dialog-DE67Z3oQ.js → calendar-preferences-dialog-DwLeBLy2.js} +1 -1
  11. package/dist/chunks/dashboard-briefing-launcher-CgkSKkZR.js +80 -0
  12. package/dist/chunks/{dashboard-briefing-launcher-BIj3X7b3.js → dashboard-briefing-launcher-cgPKz1yX.js} +252 -252
  13. package/dist/chunks/dashboard-controls-D12ZSUP_.js +52 -0
  14. package/dist/chunks/{dashboard-controls-BXxucM4f.js → dashboard-controls-VMFm3OP4.js} +87 -87
  15. package/dist/chunks/{dashboard-json-C6oZuipD.js → dashboard-json-C-GG5yC7.js} +4 -4
  16. package/dist/chunks/{dashboard-json-BNwshkK2.js → dashboard-json-CvK0oI24.js} +1 -1
  17. package/dist/chunks/{edit-dashboard-visual-CmfrI_L3.js → edit-dashboard-visual-B5KB7dx4.js} +977 -977
  18. package/dist/chunks/edit-dashboard-visual-ql99faTz.js +178 -0
  19. package/dist/chunks/{index-icb12JV1.js → index-CQmKDEbe.js} +735 -741
  20. package/dist/chunks/{index-4W_ElSBJ.js → index-DXCBPLDu.js} +218 -223
  21. package/dist/chunks/{layout-grid-B7-klXiK.js → layout-grid-C0OI-MRn.js} +1 -1
  22. package/dist/chunks/{layout-grid-DV89AC9_.js → layout-grid-CiubineE.js} +1 -1
  23. package/dist/chunks/{palette-Dj-dgPYh.js → palette-C4KTXOug.js} +1 -1
  24. package/dist/chunks/{palette-5IwhMbSF.js → palette-Cp1hqZtm.js} +1 -1
  25. package/dist/chunks/{save-C5fwVdTF.js → save-C__QggEE.js} +1 -1
  26. package/dist/chunks/{save-16C6YSW2.js → save-DgMfP0j8.js} +1 -1
  27. package/dist/chunks/{search-0LmWwZzW.js → search-BHsQIWBV.js} +17 -7
  28. package/dist/chunks/{search-Dq1Mbb03.js → search-DNCejM7Z.js} +9 -4
  29. package/dist/chunks/source-identity-uMaUe036.js +1 -0
  30. package/dist/chunks/{source-identity-CN4xiyKJ.js → source-identity-y0VSSreA.js} +33 -15
  31. package/dist/chunks/{switch-bdJp0Bkw.js → switch-B79Hn4Qh.js} +27 -32
  32. package/dist/chunks/{switch-DUdaHFZQ.js → switch-BXQAlSuW.js} +637 -647
  33. package/dist/chunks/use-create-flow-overlay-state-7MFN3PWX.js +21 -0
  34. package/dist/chunks/{use-create-flow-overlay-state-YvqCp6Zo.js → use-create-flow-overlay-state-Bw5LRkf9.js} +93 -92
  35. package/dist/chunks/{validators-CHPH6ORs.js → validators-4EGCWWga.js} +1 -1
  36. package/dist/chunks/{validators-lWo8m0Q7.js → validators-CPtkrola.js} +1 -1
  37. package/dist/chunks/{x-B_cx7LwM.js → x-B6ghREd2.js} +10 -5
  38. package/dist/chunks/{x-IdR_js6f.js → x-CXDkqdur.js} +28 -18
  39. package/dist/dashboard/index.cjs +1 -1
  40. package/dist/dashboard/index.js +1 -1
  41. package/dist/dashboard-authoring/index.cjs +1 -1
  42. package/dist/dashboard-authoring/index.js +3 -3
  43. package/dist/data-app-builder/index.cjs +13 -13
  44. package/dist/data-app-builder/index.js +11 -11
  45. package/dist/data-app-sdk/index.cjs +5 -5
  46. package/dist/data-app-sdk/index.js +1698 -1121
  47. package/dist/data-app-sdk-adapters/index.cjs +1 -1
  48. package/dist/data-app-sdk-adapters/index.js +6 -7
  49. package/dist/data-app-sdk-validation/index.cjs +1 -1
  50. package/dist/data-app-sdk-validation/index.js +3 -3
  51. package/dist/index.cjs +1 -1
  52. package/dist/index.js +13 -13
  53. package/dist/surfboard/index.cjs +1 -1
  54. package/dist/surfboard/index.js +2 -2
  55. package/dist/types/analytics-protocol.d.ts +2107 -43
  56. package/dist/types/dashboard-assistant.d.ts +3 -1
  57. package/dist/types/data-app-sdk-adapters.d.ts +1 -1
  58. package/dist/types/data-app-sdk-validation.d.ts +4 -2
  59. package/dist/types/data-app-sdk.d.ts +73 -5
  60. package/package.json +2 -1
  61. package/src/data-app-sdk/README.md +55 -0
  62. package/dist/chunks/analyze-result-contract-CtXfp3nv.js +0 -1
  63. package/dist/chunks/analyze-result-contract-DuhlklhI.js +0 -102
  64. package/dist/chunks/dashboard-briefing-launcher-Czx6BcXW.js +0 -80
  65. package/dist/chunks/dashboard-controls-BP-DcPFs.js +0 -52
  66. package/dist/chunks/edit-dashboard-visual-BAprin3J.js +0 -178
  67. package/dist/chunks/source-identity-C-xaeE_I.js +0 -1
  68. package/dist/chunks/use-create-flow-overlay-state-BIHKf_XK.js +0 -21
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const A=require("../chunks/operators-DrTQsJXv.js"),d=require("../chunks/validators-lWo8m0Q7.js"),b=require("../chunks/analyze-result-contract-CtXfp3nv.js"),o=require("../chunks/catalog-field-grounding-Bnx-3tE0.js"),y=require("../chunks/source-identity-C-xaeE_I.js"),g="semaphor-data-app-codegen-summary/v1";function R(a){return v(a).ok}function v(a){const i=[];if(!a||typeof a!="object")return{ok:!1,issues:["Summary must be an object."]};const e=a;return e.schemaVersion!==g&&i.push(`schemaVersion must be ${g}.`),(typeof e.title!="string"||!e.title.trim())&&i.push("title is required."),Array.isArray(e.sources)||i.push("sources must be an array."),Array.isArray(e.inputs)||i.push("inputs must be an array."),Array.isArray(e.views)||i.push("views must be an array."),Array.isArray(e.filterContracts)||i.push("filterContracts must be an array."),(!e.implementationChecklist||typeof e.implementationChecklist!="object")&&i.push("implementationChecklist must be an object."),e.implementationChecklist&&typeof e.implementationChecklist=="object"&&i.push(...T(e.implementationChecklist)),Array.isArray(e.sources)&&e.sources.forEach((t,r)=>{i.push(...k(t,`sources.${r}`))}),Array.isArray(e.inputs)&&e.inputs.forEach((t,r)=>{i.push(...F(t,`inputs.${r}`))}),Array.isArray(e.views)&&e.views.forEach((t,r)=>{i.push(...$(t,`views.${r}`))}),Array.isArray(e.filterContracts)&&e.filterContracts.forEach((t,r)=>{i.push(...q(t,`filterContracts.${r}`))}),{ok:i.length===0,issues:i}}function k(a,i){const e=s(a);return e?typeof e.sourceKey=="string"&&e.sourceKey.trim()?[]:e.kind==="semantic"&&typeof e.domainId=="string"&&e.domainId.trim()&&(typeof e.datasetName=="string"&&e.datasetName.trim()||typeof e.datasetId=="string"&&e.datasetId.trim())?[]:e.kind==="physical"&&typeof e.tableName=="string"&&e.tableName.trim()&&typeof e.connectionId=="string"&&e.connectionId.trim()?[]:e.kind==="sql"&&typeof e.connectionId=="string"&&e.connectionId.trim()?[]:[`${i} must include sourceKey or a supported source identity.`]:[`${i} must be an object.`]}function T(a){const i=s(a);if(!i)return["implementationChecklist must be an object."];const e=[],t=["requiredDevtools","requiredInputOptions","filterScopeByInput","bindingsByView","validationCommands","browserSmokeChecks"];for(const n of t)n in i||e.push(`implementationChecklist.${n} is required.`);const r=s(i.requiredDevtools);return r?typeof r.mountRootDevtools!="boolean"&&e.push("implementationChecklist.requiredDevtools.mountRootDevtools must be a boolean."):e.push("implementationChecklist.requiredDevtools must be an object."),Array.isArray(i.requiredInputOptions)||e.push("implementationChecklist.requiredInputOptions must be an array."),Array.isArray(i.filterScopeByInput)||e.push("implementationChecklist.filterScopeByInput must be an array."),s(i.bindingsByView)||e.push("implementationChecklist.bindingsByView must be an object."),l(i.validationCommands)||e.push("implementationChecklist.validationCommands must be an array of strings."),l(i.browserSmokeChecks)||e.push("implementationChecklist.browserSmokeChecks must be an array of strings."),e}function F(a,i){const e=s(a);if(!e)return[`${i} must be an object.`];const t=[];return(typeof e.id!="string"||!e.id.trim())&&t.push(`${i}.id is required.`),e.fieldRef&&t.push(...m(e.fieldRef,`${i}.fieldRef`)),t.push(...S(e.optionQuery,`${i}.optionQuery`)),l(e.appliesToViewIds)||t.push(`${i}.appliesToViewIds must be an array of strings.`),e.bindings!==void 0&&!Array.isArray(e.bindings)&&t.push(`${i}.bindings must be an array.`),Array.isArray(e.bindings)&&e.bindings.forEach((r,n)=>{const p=s(r);if(!p){t.push(`${i}.bindings.${n} must be an object.`);return}l(p.appliesToViewIds)||t.push(`${i}.bindings.${n}.appliesToViewIds must be an array of strings.`),t.push(...m(p.fieldRef,`${i}.bindings.${n}.fieldRef`))}),t}function $(a,i){const e=s(a);if(!e)return[`${i} must be an object.`];const t=[];return(typeof e.id!="string"||!e.id.trim())&&t.push(`${i}.id is required.`),Array.isArray(e.fields)?(e.fields.forEach((r,n)=>{t.push(...m(r,`${i}.fields.${n}`))}),t):(_(e)||t.push(`${i}.fields must be an array.`),t)}function q(a,i){const e=s(a);if(!e)return[`${i} must be an object.`];const t=[];if(e.fieldRef&&t.push(...m(e.fieldRef,`${i}.fieldRef`)),(typeof e.inputId!="string"||!e.inputId.trim())&&t.push(`${i}.inputId is required.`),t.push(...S(e.optionQuery,`${i}.optionQuery`)),l(e.appliesToViewIds)||t.push(`${i}.appliesToViewIds must be an array of strings.`),l(e.notAppliedToViewIds)||t.push(`${i}.notAppliedToViewIds must be an array of strings.`),!Array.isArray(e.bindings))t.push(`${i}.bindings must be an array.`);else{const r=l(e.appliesToViewIds)?new Set(e.appliesToViewIds):void 0,n=l(e.notAppliedToViewIds)?new Set(e.notAppliedToViewIds):void 0;e.bindings.forEach((p,f)=>{const u=s(p);if(!u){t.push(`${i}.bindings.${f} must be an object.`);return}typeof u.viewId!="string"||!u.viewId?t.push(`${i}.bindings.${f}.viewId is required.`):(r&&!r.has(u.viewId)&&t.push(`${i}.bindings.${f}.viewId must be included in appliesToViewIds.`),n!=null&&n.has(u.viewId)&&t.push(`${i}.bindings.${f}.viewId must not be listed in notAppliedToViewIds.`)),t.push(...m(u.fieldRef,`${i}.bindings.${f}.fieldRef`))})}return t}function S(a,i){if(a===void 0)return[];const e=s(a);return e?[...h(e.valueFieldRef,`${i}.valueFieldRef`),...h(e.labelFieldRef,`${i}.labelFieldRef`),...h(e.filterFieldRef,`${i}.filterFieldRef`)]:[`${i} must be an object.`]}function _(a){const i=s(a.computation),e=s(a.visualSpec);return(i==null?void 0:i.kind)==="presentation_only"||a.visual==="text_block"||(e==null?void 0:e.visualType)==="text_block"}function h(a,i){return a===void 0?[]:m(a,i)}function m(a,i){const e=s(a);if(!e)return[`${i} must be an object.`];const t=[];return(typeof e.name!="string"||!e.name.trim())&&t.push(`${i}.name is required.`),!e.source&&typeof e.sourceKey!="string"&&t.push(`${i} must include source or sourceKey.`),t}function s(a){return a&&typeof a=="object"&&!Array.isArray(a)?a:void 0}function l(a){return Array.isArray(a)&&a.every(i=>typeof i=="string")}function w(a,i={}){const e=I(a),t={connectionId:i.connectionId,connectionType:a,path:["database","schema","table"],labels:{database:"Database",schema:"Schema",table:"Table"},prefixLevels:["database","schema","table"],dialect:"postgres",supportsFilterClause:!0};return e.includes("postgres")?{...t,prefixLevels:["schema","table"],dialect:"postgres"}:e.includes("mysql")?{...t,prefixLevels:["database","table"],dialect:"mysql",supportsFilterClause:!1}:e.includes("mssql")||e.includes("sqlserver")?{...t,dialect:"mssql",supportsFilterClause:!1}:e.includes("redshift")?{...t,prefixLevels:["schema","table"],dialect:"redshift"}:e.includes("snowflake")?{...t,dialect:"snowflake"}:e.includes("clickhouse")?{connectionId:i.connectionId,connectionType:a,path:["database","table"],labels:{database:"Database",table:"Table"},prefixLevels:["database","table"],dialect:"clickhouse",supportsFilterClause:!1}:e==="s3"||e==="api"?{connectionId:i.connectionId,connectionType:a,path:["table"],labels:{table:e==="api"?"API Table":"File Table"},prefixLevels:["table"],dialect:"duckdb",supportsFilterClause:!0}:e==="googlesheets"||e==="fileupload"?{connectionId:i.connectionId,connectionType:a,path:["table"],labels:{table:"Table"},prefixLevels:["table"],dialect:"postgres",supportsFilterClause:!0}:e==="s3tables"?{...t,labels:{database:"Database",schema:"Namespace",table:"Table"},dialect:"duckdb"}:e==="bigquery"?{...t,labels:{database:"Project",schema:"Dataset",table:"Table"},prefixLevels:["schema","table"],dialect:"bigquery",supportsFilterClause:!1}:t}function D(a){const i=I(a);switch(i){case"mysql":case"bigquery":case"redshift":case"snowflake":case"clickhouse":case"duckdb":case"sqlite":return i;case"mssql":case"sqlserver":return"mssql";case"postgres":case"postgresql":return"postgres";default:return"unknown"}}function E(a){return a.capabilities.prefixLevels.every(i=>!!C(a.source,i))}function N(a){const i=a.quoteIdentifier??O;return a.capabilities.prefixLevels.map(e=>C(a.source,e)).filter(e=>!!e).map(e=>i(e,a.capabilities.dialect)).join(".")}function C(a,i){return i==="database"?a.databaseName:i==="schema"?a.schemaName:a.tableName}function O(a,i){return i==="mysql"||i==="bigquery"||i==="clickhouse"||i==="duckdb"?`\`${a.replace(/`/g,"``")}\``:i==="mssql"?`[${a.replace(/]/g,"]]")}]`:`"${a.replace(/"/g,'""')}"`}function I(a){if(typeof a!="string")return"";const i=[];for(const e of a.trim().toLowerCase())M(e)&&i.push(e);return i.join("")}function M(a){const i=a.charCodeAt(0);return i>=48&&i<=57||i>=97&&i<=122}const c={kind:"semantic",domainId:"domain_sales",datasetName:"orders",connectionId:"conn_sales",label:"Orders"},L={revenueKpi:{version:1,kind:"metric",id:"revenue-kpi",label:"Revenue",source:c,measures:[{name:"revenue",role:"measure"}],primaryMeasure:{name:"revenue",role:"measure"},comparison:{kind:"previous_period"},limit:1},revenueTrend:{version:1,kind:"records",id:"revenue-trend",label:"Revenue trend",source:c,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:c,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",inputId:"region",source:c,labelField:{name:"region",role:"dimension",dataType:"string"},valueField:{name:"region",role:"dimension",dataType:"string"},limit:100},previousPeriodRevenueComparison:{version:1,kind:"metric",id:"revenue-previous-period",label:"Revenue previous period comparison",source:c,measures:[{name:"revenue",role:"measure"}],primaryMeasure:{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:c,measures:[{name:"net_tons",role:"measure"},{name:"ticket_value",role:"measure"}],primaryMeasure:{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=A.normalizeSemaphorAnalyticsFilterOperator;exports.normalizeSemaphorInputOperator=A.normalizeSemaphorInputOperator;exports.parseSemaphorIsoTimeWindowBoundary=d.parseSemaphorIsoTimeWindowBoundary;exports.validateSemaphorAnalyticsIntent=d.validateSemaphorAnalyticsIntent;exports.validateSemaphorAnalyticsRecoveryPlan=d.validateSemaphorAnalyticsRecoveryPlan;exports.validateSemaphorDashboardIntent=d.validateSemaphorDashboardIntent;exports.validateSemaphorDerivedFieldDefinition=d.validateSemaphorDerivedFieldDefinition;exports.validateSemaphorOperationIntent=d.validateSemaphorOperationIntent;exports.validateSemaphorResultCalculation=d.validateSemaphorResultCalculation;exports.SEMAPHOR_ANALYZE_RESULT_FIELD_CONTRACT=b.SEMAPHOR_ANALYZE_RESULT_FIELD_CONTRACT;exports.getSemaphorAnalyzeResultFieldNames=b.getSemaphorAnalyzeResultFieldNames;exports.isSemaphorAnalyzeResultFieldName=b.isSemaphorAnalyzeResultFieldName;exports.parseSemaphorAnalyzeResult=b.parseSemaphorAnalyzeResult;exports.buildAnalyticsCatalogFieldSummary=o.buildAnalyticsCatalogFieldSummary;exports.getAnalyticsCatalogFieldCandidates=o.getAnalyticsCatalogFieldCandidates;exports.getAnalyticsCatalogFieldName=o.getAnalyticsCatalogFieldName;exports.isAnalyticsCatalogDateField=o.isAnalyticsCatalogDateField;exports.isAnalyticsCatalogDimensionField=o.isAnalyticsCatalogDimensionField;exports.isAnalyticsCatalogMetricField=o.isAnalyticsCatalogMetricField;exports.isAnalyticsDateLikeDataType=o.isAnalyticsDateLikeDataType;exports.isAnalyticsMetricIdentifierField=o.isAnalyticsMetricIdentifierField;exports.isAnalyticsTechnicalIdentifierField=o.isAnalyticsTechnicalIdentifierField;exports.normalizeAnalyticsCatalogDataType=o.normalizeAnalyticsCatalogDataType;exports.normalizeAnalyticsCatalogName=o.normalizeAnalyticsCatalogName;exports.preferSemaphorFieldRefMetadata=y.preferSemaphorFieldRefMetadata;exports.preferSemaphorSourceMetadata=y.preferSemaphorSourceMetadata;exports.semaphorFieldRefsMatch=y.semaphorFieldRefsMatch;exports.semaphorSourceIdentityKey=y.semaphorSourceIdentityKey;exports.semaphorSourcesReferToSameDataset=y.semaphorSourcesReferToSameDataset;exports.SEMAPHOR_ANALYTICS_INTENT_FIXTURES=L;exports.SEMAPHOR_DATA_APP_CODEGEN_SUMMARY_SCHEMA_VERSION=g;exports.buildSemaphorQualifiedSourcePath=N;exports.getSemaphorConnectionCapabilities=w;exports.isSemaphorDataAppCodegenSummary=R;exports.normalizeSemaphorDialect=D;exports.semaphorSourceHasRequiredCoordinates=E;exports.validateSemaphorDataAppCodegenSummary=v;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("../chunks/operators-DrTQsJXv.js"),o=require("../chunks/validators-CPtkrola.js"),e=require("../chunks/analyze-result-contract-Zgg-Bbpj.js"),i=require("../chunks/catalog-field-grounding-Bnx-3tE0.js"),l=require("../chunks/source-identity-uMaUe036.js");function u(a,r={}){const t=d(a),s={connectionId:r.connectionId,connectionType:a,path:["database","schema","table"],labels:{database:"Database",schema:"Schema",table:"Table"},prefixLevels:["database","schema","table"],dialect:"postgres",supportsFilterClause:!0};return t.includes("postgres")?{...s,prefixLevels:["schema","table"],dialect:"postgres"}:t.includes("mysql")?{...s,prefixLevels:["database","table"],dialect:"mysql",supportsFilterClause:!1}:t.includes("mssql")||t.includes("sqlserver")?{...s,dialect:"mssql",supportsFilterClause:!1}:t.includes("redshift")?{...s,prefixLevels:["schema","table"],dialect:"redshift"}:t.includes("snowflake")?{...s,dialect:"snowflake"}:t.includes("clickhouse")?{connectionId:r.connectionId,connectionType:a,path:["database","table"],labels:{database:"Database",table:"Table"},prefixLevels:["database","table"],dialect:"clickhouse",supportsFilterClause:!1}:t==="s3"||t==="api"?{connectionId:r.connectionId,connectionType:a,path:["table"],labels:{table:t==="api"?"API Table":"File Table"},prefixLevels:["table"],dialect:"duckdb",supportsFilterClause:!0}:t==="googlesheets"||t==="fileupload"?{connectionId:r.connectionId,connectionType:a,path:["table"],labels:{table:"Table"},prefixLevels:["table"],dialect:"postgres",supportsFilterClause:!0}:t==="s3tables"?{...s,labels:{database:"Database",schema:"Namespace",table:"Table"},dialect:"duckdb"}:t==="bigquery"?{...s,labels:{database:"Project",schema:"Dataset",table:"Table"},prefixLevels:["schema","table"],dialect:"bigquery",supportsFilterClause:!1}:s}function p(a){const r=d(a);switch(r){case"mysql":case"bigquery":case"redshift":case"snowflake":case"clickhouse":case"duckdb":case"sqlite":return r;case"mssql":case"sqlserver":return"mssql";case"postgres":case"postgresql":return"postgres";default:return"unknown"}}function h(a){return a.capabilities.prefixLevels.every(r=>!!c(a.source,r))}function S(a){const r=a.quoteIdentifier??y;return a.capabilities.prefixLevels.map(t=>c(a.source,t)).filter(t=>!!t).map(t=>r(t,a.capabilities.dialect)).join(".")}function c(a,r){return r==="database"?a.databaseName:r==="schema"?a.schemaName:a.tableName}function y(a,r){return r==="mysql"||r==="bigquery"||r==="clickhouse"||r==="duckdb"?`\`${a.replace(/`/g,"``")}\``:r==="mssql"?`[${a.replace(/]/g,"]]")}]`:`"${a.replace(/"/g,'""')}"`}function d(a){if(typeof a!="string")return"";const r=[];for(const t of a.trim().toLowerCase())A(t)&&r.push(t);return r.join("")}function A(a){const r=a.charCodeAt(0);return r>=48&&r<=57||r>=97&&r<=122}const n={kind:"semantic",domainId:"domain_sales",datasetName:"orders",connectionId:"conn_sales",label:"Orders"},b={revenueKpi:{version:1,kind:"metric",id:"revenue-kpi",label:"Revenue",source:n,measures:[{name:"revenue",role:"measure"}],primaryMeasure:{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",inputId:"region",source:n,labelField:{name:"region",role:"dimension",dataType:"string"},valueField:{name:"region",role:"dimension",dataType:"string"},limit:100},previousPeriodRevenueComparison:{version:1,kind:"metric",id:"revenue-previous-period",label:"Revenue previous period comparison",source:n,measures:[{name:"revenue",role:"measure"}],primaryMeasure:{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,measures:[{name:"net_tons",role:"measure"},{name:"ticket_value",role:"measure"}],primaryMeasure:{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=m.normalizeSemaphorAnalyticsFilterOperator;exports.normalizeSemaphorInputOperator=m.normalizeSemaphorInputOperator;exports.parseSemaphorIsoTimeWindowBoundary=o.parseSemaphorIsoTimeWindowBoundary;exports.validateSemaphorAnalyticsIntent=o.validateSemaphorAnalyticsIntent;exports.validateSemaphorAnalyticsRecoveryPlan=o.validateSemaphorAnalyticsRecoveryPlan;exports.validateSemaphorDashboardIntent=o.validateSemaphorDashboardIntent;exports.validateSemaphorDerivedFieldDefinition=o.validateSemaphorDerivedFieldDefinition;exports.validateSemaphorOperationIntent=o.validateSemaphorOperationIntent;exports.validateSemaphorResultCalculation=o.validateSemaphorResultCalculation;exports.SEMAPHOR_ANALYZE_RESULT_FIELD_CONTRACT=e.SEMAPHOR_ANALYZE_RESULT_FIELD_CONTRACT;exports.SEMAPHOR_DATA_APP_CODEGEN_SUMMARY_SCHEMA_VERSION=e.SEMAPHOR_DATA_APP_CODEGEN_SUMMARY_SCHEMA_VERSION;exports.SEMAPHOR_DATA_APP_CODEGEN_SUMMARY_VALIDATOR_VERSION=e.SEMAPHOR_DATA_APP_CODEGEN_SUMMARY_VALIDATOR_VERSION;exports.getSemaphorAnalyzeResultFieldNames=e.getSemaphorAnalyzeResultFieldNames;exports.isSemaphorAnalyzeResultFieldName=e.isSemaphorAnalyzeResultFieldName;exports.isSemaphorDataAppCodegenSummary=e.isSemaphorDataAppCodegenSummary;exports.parseSemaphorAnalyzeResult=e.parseSemaphorAnalyzeResult;exports.semaphorAnalyticsCoverageSchema=e.semaphorAnalyticsCoverageSchema;exports.semaphorAnalyticsDiagnosticFeedbackSchema=e.semaphorAnalyticsDiagnosticFeedbackSchema;exports.semaphorAnalyticsExecutionResultSchema=e.semaphorAnalyticsExecutionResultSchema;exports.semaphorAnalyticsPopulationSchema=e.semaphorAnalyticsPopulationSchema;exports.semaphorAnalyticsResultSchema=e.semaphorAnalyticsResultSchema;exports.semaphorAnalyticsValidationIssueSchema=e.semaphorAnalyticsValidationIssueSchema;exports.semaphorAnalyticsValidationResultSchema=e.semaphorAnalyticsValidationResultSchema;exports.semaphorAnalyzeResultSchema=e.semaphorAnalyzeResultSchema;exports.semaphorAnalyzeResultShape=e.semaphorAnalyzeResultShape;exports.semaphorDataAppCodegenSummarySchema=e.semaphorDataAppCodegenSummarySchema;exports.semaphorDerivedFieldDefinitionSchema=e.semaphorDerivedFieldDefinitionSchema;exports.semaphorExecutionFieldRefSchema=e.semaphorExecutionFieldRefSchema;exports.semaphorFieldRefSchema=e.semaphorFieldRefSchema;exports.semaphorInputOptionsResultSchema=e.semaphorInputOptionsResultSchema;exports.semaphorMatrixResultSchema=e.semaphorMatrixResultSchema;exports.semaphorMetricResultSchema=e.semaphorMetricResultSchema;exports.semaphorPhysicalSourceRefSchema=e.semaphorPhysicalSourceRefSchema;exports.semaphorRecordsResultSchema=e.semaphorRecordsResultSchema;exports.semaphorRelationshipDiagnosticsSchema=e.semaphorRelationshipDiagnosticsSchema;exports.semaphorResultColumnSchema=e.semaphorResultColumnSchema;exports.semaphorSemanticSourceRefSchema=e.semaphorSemanticSourceRefSchema;exports.semaphorSourceRefSchema=e.semaphorSourceRefSchema;exports.semaphorSqlResultSchema=e.semaphorSqlResultSchema;exports.semaphorSqlSourceRefSchema=e.semaphorSqlSourceRefSchema;exports.validateSemaphorDataAppCodegenSummary=e.validateSemaphorDataAppCodegenSummary;exports.buildAnalyticsCatalogFieldSummary=i.buildAnalyticsCatalogFieldSummary;exports.getAnalyticsCatalogFieldCandidates=i.getAnalyticsCatalogFieldCandidates;exports.getAnalyticsCatalogFieldName=i.getAnalyticsCatalogFieldName;exports.isAnalyticsCatalogDateField=i.isAnalyticsCatalogDateField;exports.isAnalyticsCatalogDimensionField=i.isAnalyticsCatalogDimensionField;exports.isAnalyticsCatalogMetricField=i.isAnalyticsCatalogMetricField;exports.isAnalyticsDateLikeDataType=i.isAnalyticsDateLikeDataType;exports.isAnalyticsMetricIdentifierField=i.isAnalyticsMetricIdentifierField;exports.isAnalyticsTechnicalIdentifierField=i.isAnalyticsTechnicalIdentifierField;exports.normalizeAnalyticsCatalogDataType=i.normalizeAnalyticsCatalogDataType;exports.normalizeAnalyticsCatalogName=i.normalizeAnalyticsCatalogName;exports.mergeSemaphorSourcesByIdentity=l.mergeSemaphorSourcesByIdentity;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=b;exports.buildSemaphorQualifiedSourcePath=S;exports.getSemaphorConnectionCapabilities=u;exports.normalizeSemaphorDialect=p;exports.semaphorSourceHasRequiredCoordinates=h;
@@ -1,170 +1,12 @@
1
- import { a as O, n as V } from "../chunks/operators-C8TxpM4C.js";
2
- import { p as L, b as M, d as x, e as B, v as P, c as z, a as Q } from "../chunks/validators-CHPH6ORs.js";
3
- import { S as H, g as U, i as Y, p as G } from "../chunks/analyze-result-contract-DuhlklhI.js";
4
- import { j as X, a as Z, g as J, c as ee, h as ie, f as se, i as re, e as te, d as ae, b as ne, n as oe } from "../chunks/catalog-field-grounding-CJKAqtiC.js";
5
- import { p as ue, c as de, s as ce, a as me, b as pe } from "../chunks/source-identity-CN4xiyKJ.js";
6
- const f = "semaphor-data-app-codegen-summary/v1";
7
- function T(s) {
8
- return g(s).ok;
9
- }
10
- function g(s) {
11
- const i = [];
12
- if (!s || typeof s != "object")
13
- return { ok: !1, issues: ["Summary must be an object."] };
14
- const e = s;
15
- return e.schemaVersion !== f && i.push(
16
- `schemaVersion must be ${f}.`
17
- ), (typeof e.title != "string" || !e.title.trim()) && i.push("title is required."), Array.isArray(e.sources) || i.push("sources must be an array."), Array.isArray(e.inputs) || i.push("inputs must be an array."), Array.isArray(e.views) || i.push("views must be an array."), Array.isArray(e.filterContracts) || i.push("filterContracts must be an array."), (!e.implementationChecklist || typeof e.implementationChecklist != "object") && i.push("implementationChecklist must be an object."), e.implementationChecklist && typeof e.implementationChecklist == "object" && i.push(
18
- ...I(e.implementationChecklist)
19
- ), Array.isArray(e.sources) && e.sources.forEach((r, t) => {
20
- i.push(...v(r, `sources.${t}`));
21
- }), Array.isArray(e.inputs) && e.inputs.forEach((r, t) => {
22
- i.push(...A(r, `inputs.${t}`));
23
- }), Array.isArray(e.views) && e.views.forEach((r, t) => {
24
- i.push(...C(r, `views.${t}`));
25
- }), Array.isArray(e.filterContracts) && e.filterContracts.forEach((r, t) => {
26
- i.push(
27
- ...k(r, `filterContracts.${t}`)
28
- );
29
- }), { ok: i.length === 0, issues: i };
30
- }
31
- function v(s, i) {
32
- const e = a(s);
33
- return e ? typeof e.sourceKey == "string" && e.sourceKey.trim() ? [] : e.kind === "semantic" && typeof e.domainId == "string" && e.domainId.trim() && (typeof e.datasetName == "string" && e.datasetName.trim() || typeof e.datasetId == "string" && e.datasetId.trim()) ? [] : e.kind === "physical" && typeof e.tableName == "string" && e.tableName.trim() && typeof e.connectionId == "string" && e.connectionId.trim() ? [] : e.kind === "sql" && typeof e.connectionId == "string" && e.connectionId.trim() ? [] : [`${i} must include sourceKey or a supported source identity.`] : [`${i} must be an object.`];
34
- }
35
- function I(s) {
36
- const i = a(s);
37
- if (!i)
38
- return ["implementationChecklist must be an object."];
39
- const e = [], r = [
40
- "requiredDevtools",
41
- "requiredInputOptions",
42
- "filterScopeByInput",
43
- "bindingsByView",
44
- "validationCommands",
45
- "browserSmokeChecks"
46
- ];
47
- for (const n of r)
48
- n in i || e.push(`implementationChecklist.${n} is required.`);
49
- const t = a(i.requiredDevtools);
50
- return t ? typeof t.mountRootDevtools != "boolean" && e.push(
51
- "implementationChecklist.requiredDevtools.mountRootDevtools must be a boolean."
52
- ) : e.push("implementationChecklist.requiredDevtools must be an object."), Array.isArray(i.requiredInputOptions) || e.push(
53
- "implementationChecklist.requiredInputOptions must be an array."
54
- ), Array.isArray(i.filterScopeByInput) || e.push("implementationChecklist.filterScopeByInput must be an array."), a(i.bindingsByView) || e.push("implementationChecklist.bindingsByView must be an object."), o(i.validationCommands) || e.push(
55
- "implementationChecklist.validationCommands must be an array of strings."
56
- ), o(i.browserSmokeChecks) || e.push(
57
- "implementationChecklist.browserSmokeChecks must be an array of strings."
58
- ), e;
59
- }
60
- function A(s, i) {
61
- const e = a(s);
62
- if (!e)
63
- return [`${i} must be an object.`];
64
- const r = [];
65
- return (typeof e.id != "string" || !e.id.trim()) && r.push(`${i}.id is required.`), e.fieldRef && r.push(...d(e.fieldRef, `${i}.fieldRef`)), r.push(...b(e.optionQuery, `${i}.optionQuery`)), o(e.appliesToViewIds) || r.push(`${i}.appliesToViewIds must be an array of strings.`), e.bindings !== void 0 && !Array.isArray(e.bindings) && r.push(`${i}.bindings must be an array.`), Array.isArray(e.bindings) && e.bindings.forEach((t, n) => {
66
- const c = a(t);
67
- if (!c) {
68
- r.push(`${i}.bindings.${n} must be an object.`);
69
- return;
70
- }
71
- o(c.appliesToViewIds) || r.push(
72
- `${i}.bindings.${n}.appliesToViewIds must be an array of strings.`
73
- ), r.push(
74
- ...d(
75
- c.fieldRef,
76
- `${i}.bindings.${n}.fieldRef`
77
- )
78
- );
79
- }), r;
80
- }
81
- function C(s, i) {
82
- const e = a(s);
83
- if (!e)
84
- return [`${i} must be an object.`];
85
- const r = [];
86
- return (typeof e.id != "string" || !e.id.trim()) && r.push(`${i}.id is required.`), Array.isArray(e.fields) ? (e.fields.forEach((t, n) => {
87
- r.push(...d(t, `${i}.fields.${n}`));
88
- }), r) : (S(e) || r.push(`${i}.fields must be an array.`), r);
89
- }
90
- function k(s, i) {
91
- const e = a(s);
92
- if (!e)
93
- return [`${i} must be an object.`];
94
- const r = [];
95
- if (e.fieldRef && r.push(
96
- ...d(e.fieldRef, `${i}.fieldRef`)
97
- ), (typeof e.inputId != "string" || !e.inputId.trim()) && r.push(`${i}.inputId is required.`), r.push(
98
- ...b(e.optionQuery, `${i}.optionQuery`)
99
- ), o(e.appliesToViewIds) || r.push(`${i}.appliesToViewIds must be an array of strings.`), o(e.notAppliedToViewIds) || r.push(`${i}.notAppliedToViewIds must be an array of strings.`), !Array.isArray(e.bindings))
100
- r.push(`${i}.bindings must be an array.`);
101
- else {
102
- const t = o(e.appliesToViewIds) ? new Set(e.appliesToViewIds) : void 0, n = o(
103
- e.notAppliedToViewIds
104
- ) ? new Set(e.notAppliedToViewIds) : void 0;
105
- e.bindings.forEach((c, m) => {
106
- const l = a(c);
107
- if (!l) {
108
- r.push(`${i}.bindings.${m} must be an object.`);
109
- return;
110
- }
111
- typeof l.viewId != "string" || !l.viewId ? r.push(`${i}.bindings.${m}.viewId is required.`) : (t && !t.has(l.viewId) && r.push(
112
- `${i}.bindings.${m}.viewId must be included in appliesToViewIds.`
113
- ), n != null && n.has(l.viewId) && r.push(
114
- `${i}.bindings.${m}.viewId must not be listed in notAppliedToViewIds.`
115
- )), r.push(
116
- ...d(
117
- l.fieldRef,
118
- `${i}.bindings.${m}.fieldRef`
119
- )
120
- );
121
- });
122
- }
123
- return r;
124
- }
125
- function b(s, i) {
126
- if (s === void 0)
127
- return [];
128
- const e = a(s);
129
- return e ? [
130
- ...p(
131
- e.valueFieldRef,
132
- `${i}.valueFieldRef`
133
- ),
134
- ...p(
135
- e.labelFieldRef,
136
- `${i}.labelFieldRef`
137
- ),
138
- ...p(
139
- e.filterFieldRef,
140
- `${i}.filterFieldRef`
141
- )
142
- ] : [`${i} must be an object.`];
143
- }
144
- function S(s) {
145
- const i = a(s.computation), e = a(s.visualSpec);
146
- return (i == null ? void 0 : i.kind) === "presentation_only" || s.visual === "text_block" || (e == null ? void 0 : e.visualType) === "text_block";
147
- }
148
- function p(s, i) {
149
- return s === void 0 ? [] : d(s, i);
150
- }
151
- function d(s, i) {
152
- const e = a(s);
153
- if (!e)
154
- return [`${i} must be an object.`];
155
- const r = [];
156
- return (typeof e.name != "string" || !e.name.trim()) && r.push(`${i}.name is required.`), !e.source && typeof e.sourceKey != "string" && r.push(`${i} must include source or sourceKey.`), r;
157
- }
158
- function a(s) {
159
- return s && typeof s == "object" && !Array.isArray(s) ? s : void 0;
160
- }
161
- function o(s) {
162
- return Array.isArray(s) && s.every((i) => typeof i == "string");
163
- }
164
- function w(s, i = {}) {
165
- const e = h(s), r = {
166
- connectionId: i.connectionId,
167
- connectionType: s,
1
+ import { a as S, n as f } from "../chunks/operators-C8TxpM4C.js";
2
+ import { p as g, b as v, d as A, e as R, v as C, c as I, a as T } from "../chunks/validators-4EGCWWga.js";
3
+ import { S as k, a as F, b as D, g as q, i as E, c as L, p as M, A as O, y as x, B as N, z as P, w as z, m as w, n as B, D as H, C as U, E as Y, j, k as G, h as V, r as Q, u as $, o as K, d as W, q as X, x as Z, l as J, s as ee, f as ae, t as se, e as re, v as te } from "../chunks/analyze-result-contract-C9Gv2_qW.js";
4
+ import { j as ne, a as oe, g as le, c as me, h as de, f as ce, i as ue, e as pe, d as he, b as be, n as Se } from "../chunks/catalog-field-grounding-CJKAqtiC.js";
5
+ import { m as ye, p as ge, c as ve, s as Ae, a as Re, b as Ce } from "../chunks/source-identity-y0VSSreA.js";
6
+ function m(e, a = {}) {
7
+ const s = n(e), r = {
8
+ connectionId: a.connectionId,
9
+ connectionType: e,
168
10
  path: ["database", "schema", "table"],
169
11
  labels: {
170
12
  database: "Database",
@@ -175,29 +17,29 @@ function w(s, i = {}) {
175
17
  dialect: "postgres",
176
18
  supportsFilterClause: !0
177
19
  };
178
- return e.includes("postgres") ? {
20
+ return s.includes("postgres") ? {
179
21
  ...r,
180
22
  prefixLevels: ["schema", "table"],
181
23
  dialect: "postgres"
182
- } : e.includes("mysql") ? {
24
+ } : s.includes("mysql") ? {
183
25
  ...r,
184
26
  prefixLevels: ["database", "table"],
185
27
  dialect: "mysql",
186
28
  supportsFilterClause: !1
187
- } : e.includes("mssql") || e.includes("sqlserver") ? {
29
+ } : s.includes("mssql") || s.includes("sqlserver") ? {
188
30
  ...r,
189
31
  dialect: "mssql",
190
32
  supportsFilterClause: !1
191
- } : e.includes("redshift") ? {
33
+ } : s.includes("redshift") ? {
192
34
  ...r,
193
35
  prefixLevels: ["schema", "table"],
194
36
  dialect: "redshift"
195
- } : e.includes("snowflake") ? {
37
+ } : s.includes("snowflake") ? {
196
38
  ...r,
197
39
  dialect: "snowflake"
198
- } : e.includes("clickhouse") ? {
199
- connectionId: i.connectionId,
200
- connectionType: s,
40
+ } : s.includes("clickhouse") ? {
41
+ connectionId: a.connectionId,
42
+ connectionType: e,
201
43
  path: ["database", "table"],
202
44
  labels: {
203
45
  database: "Database",
@@ -206,19 +48,19 @@ function w(s, i = {}) {
206
48
  prefixLevels: ["database", "table"],
207
49
  dialect: "clickhouse",
208
50
  supportsFilterClause: !1
209
- } : e === "s3" || e === "api" ? {
210
- connectionId: i.connectionId,
211
- connectionType: s,
51
+ } : s === "s3" || s === "api" ? {
52
+ connectionId: a.connectionId,
53
+ connectionType: e,
212
54
  path: ["table"],
213
55
  labels: {
214
- table: e === "api" ? "API Table" : "File Table"
56
+ table: s === "api" ? "API Table" : "File Table"
215
57
  },
216
58
  prefixLevels: ["table"],
217
59
  dialect: "duckdb",
218
60
  supportsFilterClause: !0
219
- } : e === "googlesheets" || e === "fileupload" ? {
220
- connectionId: i.connectionId,
221
- connectionType: s,
61
+ } : s === "googlesheets" || s === "fileupload" ? {
62
+ connectionId: a.connectionId,
63
+ connectionType: e,
222
64
  path: ["table"],
223
65
  labels: {
224
66
  table: "Table"
@@ -226,7 +68,7 @@ function w(s, i = {}) {
226
68
  prefixLevels: ["table"],
227
69
  dialect: "postgres",
228
70
  supportsFilterClause: !0
229
- } : e === "s3tables" ? {
71
+ } : s === "s3tables" ? {
230
72
  ...r,
231
73
  labels: {
232
74
  database: "Database",
@@ -234,7 +76,7 @@ function w(s, i = {}) {
234
76
  table: "Table"
235
77
  },
236
78
  dialect: "duckdb"
237
- } : e === "bigquery" ? {
79
+ } : s === "bigquery" ? {
238
80
  ...r,
239
81
  labels: {
240
82
  database: "Project",
@@ -246,9 +88,9 @@ function w(s, i = {}) {
246
88
  supportsFilterClause: !1
247
89
  } : r;
248
90
  }
249
- function q(s) {
250
- const i = h(s);
251
- switch (i) {
91
+ function d(e) {
92
+ const a = n(e);
93
+ switch (a) {
252
94
  case "mysql":
253
95
  case "bigquery":
254
96
  case "redshift":
@@ -256,7 +98,7 @@ function q(s) {
256
98
  case "clickhouse":
257
99
  case "duckdb":
258
100
  case "sqlite":
259
- return i;
101
+ return a;
260
102
  case "mssql":
261
103
  case "sqlserver":
262
104
  return "mssql";
@@ -267,46 +109,46 @@ function q(s) {
267
109
  return "unknown";
268
110
  }
269
111
  }
270
- function F(s) {
271
- return s.capabilities.prefixLevels.every(
272
- (i) => !!y(s.source, i)
112
+ function c(e) {
113
+ return e.capabilities.prefixLevels.every(
114
+ (a) => !!i(e.source, a)
273
115
  );
274
116
  }
275
- function _(s) {
276
- const i = s.quoteIdentifier ?? R;
277
- return s.capabilities.prefixLevels.map((e) => y(s.source, e)).filter((e) => !!e).map((e) => i(e, s.capabilities.dialect)).join(".");
117
+ function u(e) {
118
+ const a = e.quoteIdentifier ?? o;
119
+ return e.capabilities.prefixLevels.map((s) => i(e.source, s)).filter((s) => !!s).map((s) => a(s, e.capabilities.dialect)).join(".");
278
120
  }
279
- function y(s, i) {
280
- return i === "database" ? s.databaseName : i === "schema" ? s.schemaName : s.tableName;
121
+ function i(e, a) {
122
+ return a === "database" ? e.databaseName : a === "schema" ? e.schemaName : e.tableName;
281
123
  }
282
- function R(s, i) {
283
- return i === "mysql" || i === "bigquery" || i === "clickhouse" || i === "duckdb" ? `\`${s.replace(/`/g, "``")}\`` : i === "mssql" ? `[${s.replace(/]/g, "]]")}]` : `"${s.replace(/"/g, '""')}"`;
124
+ function o(e, a) {
125
+ return a === "mysql" || a === "bigquery" || a === "clickhouse" || a === "duckdb" ? `\`${e.replace(/`/g, "``")}\`` : a === "mssql" ? `[${e.replace(/]/g, "]]")}]` : `"${e.replace(/"/g, '""')}"`;
284
126
  }
285
- function h(s) {
286
- if (typeof s != "string")
127
+ function n(e) {
128
+ if (typeof e != "string")
287
129
  return "";
288
- const i = [];
289
- for (const e of s.trim().toLowerCase())
290
- $(e) && i.push(e);
291
- return i.join("");
130
+ const a = [];
131
+ for (const s of e.trim().toLowerCase())
132
+ l(s) && a.push(s);
133
+ return a.join("");
292
134
  }
293
- function $(s) {
294
- const i = s.charCodeAt(0);
295
- return i >= 48 && i <= 57 || i >= 97 && i <= 122;
135
+ function l(e) {
136
+ const a = e.charCodeAt(0);
137
+ return a >= 48 && a <= 57 || a >= 97 && a <= 122;
296
138
  }
297
- const u = {
139
+ const t = {
298
140
  kind: "semantic",
299
141
  domainId: "domain_sales",
300
142
  datasetName: "orders",
301
143
  connectionId: "conn_sales",
302
144
  label: "Orders"
303
- }, D = {
145
+ }, p = {
304
146
  revenueKpi: {
305
147
  version: 1,
306
148
  kind: "metric",
307
149
  id: "revenue-kpi",
308
150
  label: "Revenue",
309
- source: u,
151
+ source: t,
310
152
  measures: [{ name: "revenue", role: "measure" }],
311
153
  primaryMeasure: { name: "revenue", role: "measure" },
312
154
  comparison: { kind: "previous_period" },
@@ -317,7 +159,7 @@ const u = {
317
159
  kind: "records",
318
160
  id: "revenue-trend",
319
161
  label: "Revenue trend",
320
- source: u,
162
+ source: t,
321
163
  fields: [
322
164
  { name: "order_date", role: "date", dataType: "date", label: "Order Date" },
323
165
  { name: "revenue", role: "measure", dataType: "number" }
@@ -331,7 +173,7 @@ const u = {
331
173
  kind: "records",
332
174
  id: "top-customers",
333
175
  label: "Top customers",
334
- source: u,
176
+ source: t,
335
177
  fields: [
336
178
  { name: "customer_name", role: "dimension", dataType: "string" },
337
179
  { name: "segment", role: "dimension", dataType: "string" },
@@ -346,7 +188,7 @@ const u = {
346
188
  id: "region-options",
347
189
  label: "Region options",
348
190
  inputId: "region",
349
- source: u,
191
+ source: t,
350
192
  labelField: { name: "region", role: "dimension", dataType: "string" },
351
193
  valueField: { name: "region", role: "dimension", dataType: "string" },
352
194
  limit: 100
@@ -356,7 +198,7 @@ const u = {
356
198
  kind: "metric",
357
199
  id: "revenue-previous-period",
358
200
  label: "Revenue previous period comparison",
359
- source: u,
201
+ source: t,
360
202
  measures: [{ name: "revenue", role: "measure" }],
361
203
  primaryMeasure: { name: "revenue", role: "measure" },
362
204
  dateField: { name: "order_date", role: "date", dataType: "date" },
@@ -369,7 +211,7 @@ const u = {
369
211
  kind: "metric",
370
212
  id: "inbound-supplier-concentration",
371
213
  label: "Inbound supplier concentration",
372
- source: u,
214
+ source: t,
373
215
  measures: [
374
216
  { name: "net_tons", role: "measure" },
375
217
  { name: "ticket_value", role: "measure" }
@@ -407,41 +249,67 @@ const u = {
407
249
  }
408
250
  };
409
251
  export {
410
- D as SEMAPHOR_ANALYTICS_INTENT_FIXTURES,
411
- H as SEMAPHOR_ANALYZE_RESULT_FIELD_CONTRACT,
412
- f as SEMAPHOR_DATA_APP_CODEGEN_SUMMARY_SCHEMA_VERSION,
413
- X as buildAnalyticsCatalogFieldSummary,
414
- _ as buildSemaphorQualifiedSourcePath,
415
- Z as getAnalyticsCatalogFieldCandidates,
416
- J as getAnalyticsCatalogFieldName,
417
- U as getSemaphorAnalyzeResultFieldNames,
418
- w as getSemaphorConnectionCapabilities,
419
- ee as isAnalyticsCatalogDateField,
420
- ie as isAnalyticsCatalogDimensionField,
421
- se as isAnalyticsCatalogMetricField,
422
- re as isAnalyticsDateLikeDataType,
423
- te as isAnalyticsMetricIdentifierField,
424
- ae as isAnalyticsTechnicalIdentifierField,
425
- Y as isSemaphorAnalyzeResultFieldName,
426
- T as isSemaphorDataAppCodegenSummary,
427
- ne as normalizeAnalyticsCatalogDataType,
428
- oe as normalizeAnalyticsCatalogName,
429
- O as normalizeSemaphorAnalyticsFilterOperator,
430
- q as normalizeSemaphorDialect,
431
- V as normalizeSemaphorInputOperator,
432
- G as parseSemaphorAnalyzeResult,
433
- L as parseSemaphorIsoTimeWindowBoundary,
434
- ue as preferSemaphorFieldRefMetadata,
435
- de as preferSemaphorSourceMetadata,
436
- ce as semaphorFieldRefsMatch,
437
- F as semaphorSourceHasRequiredCoordinates,
438
- me as semaphorSourceIdentityKey,
439
- pe as semaphorSourcesReferToSameDataset,
440
- M as validateSemaphorAnalyticsIntent,
441
- x as validateSemaphorAnalyticsRecoveryPlan,
442
- B as validateSemaphorDashboardIntent,
443
- g as validateSemaphorDataAppCodegenSummary,
444
- P as validateSemaphorDerivedFieldDefinition,
445
- z as validateSemaphorOperationIntent,
446
- Q as validateSemaphorResultCalculation
252
+ p as SEMAPHOR_ANALYTICS_INTENT_FIXTURES,
253
+ k as SEMAPHOR_ANALYZE_RESULT_FIELD_CONTRACT,
254
+ F as SEMAPHOR_DATA_APP_CODEGEN_SUMMARY_SCHEMA_VERSION,
255
+ D as SEMAPHOR_DATA_APP_CODEGEN_SUMMARY_VALIDATOR_VERSION,
256
+ ne as buildAnalyticsCatalogFieldSummary,
257
+ u as buildSemaphorQualifiedSourcePath,
258
+ oe as getAnalyticsCatalogFieldCandidates,
259
+ le as getAnalyticsCatalogFieldName,
260
+ q as getSemaphorAnalyzeResultFieldNames,
261
+ m as getSemaphorConnectionCapabilities,
262
+ me as isAnalyticsCatalogDateField,
263
+ de as isAnalyticsCatalogDimensionField,
264
+ ce as isAnalyticsCatalogMetricField,
265
+ ue as isAnalyticsDateLikeDataType,
266
+ pe as isAnalyticsMetricIdentifierField,
267
+ he as isAnalyticsTechnicalIdentifierField,
268
+ E as isSemaphorAnalyzeResultFieldName,
269
+ L as isSemaphorDataAppCodegenSummary,
270
+ ye as mergeSemaphorSourcesByIdentity,
271
+ be as normalizeAnalyticsCatalogDataType,
272
+ Se as normalizeAnalyticsCatalogName,
273
+ S as normalizeSemaphorAnalyticsFilterOperator,
274
+ d as normalizeSemaphorDialect,
275
+ f as normalizeSemaphorInputOperator,
276
+ M as parseSemaphorAnalyzeResult,
277
+ g as parseSemaphorIsoTimeWindowBoundary,
278
+ ge as preferSemaphorFieldRefMetadata,
279
+ ve as preferSemaphorSourceMetadata,
280
+ O as semaphorAnalyticsCoverageSchema,
281
+ x as semaphorAnalyticsDiagnosticFeedbackSchema,
282
+ N as semaphorAnalyticsExecutionResultSchema,
283
+ P as semaphorAnalyticsPopulationSchema,
284
+ z as semaphorAnalyticsResultSchema,
285
+ w as semaphorAnalyticsValidationIssueSchema,
286
+ B as semaphorAnalyticsValidationResultSchema,
287
+ H as semaphorAnalyzeResultSchema,
288
+ U as semaphorAnalyzeResultShape,
289
+ Y as semaphorDataAppCodegenSummarySchema,
290
+ j as semaphorDerivedFieldDefinitionSchema,
291
+ G as semaphorExecutionFieldRefSchema,
292
+ V as semaphorFieldRefSchema,
293
+ Ae as semaphorFieldRefsMatch,
294
+ Q as semaphorInputOptionsResultSchema,
295
+ $ as semaphorMatrixResultSchema,
296
+ K as semaphorMetricResultSchema,
297
+ W as semaphorPhysicalSourceRefSchema,
298
+ X as semaphorRecordsResultSchema,
299
+ Z as semaphorRelationshipDiagnosticsSchema,
300
+ J as semaphorResultColumnSchema,
301
+ ee as semaphorSemanticSourceRefSchema,
302
+ c as semaphorSourceHasRequiredCoordinates,
303
+ Re as semaphorSourceIdentityKey,
304
+ ae as semaphorSourceRefSchema,
305
+ Ce as semaphorSourcesReferToSameDataset,
306
+ se as semaphorSqlResultSchema,
307
+ re as semaphorSqlSourceRefSchema,
308
+ v as validateSemaphorAnalyticsIntent,
309
+ A as validateSemaphorAnalyticsRecoveryPlan,
310
+ R as validateSemaphorDashboardIntent,
311
+ te as validateSemaphorDataAppCodegenSummary,
312
+ C as validateSemaphorDerivedFieldDefinition,
313
+ I as validateSemaphorOperationIntent,
314
+ T as validateSemaphorResultCalculation
447
315
  };
@@ -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-bdJp0Bkw.js"),A=require("../chunks/index-DRlMUglg.js"),J=require("../chunks/x-B_cx7LwM.js");require("../chunks/analyze-result-contract-CtXfp3nv.js");const U=require("../chunks/palette-Dj-dgPYh.js"),be=require("../chunks/braces-C0Vh_Mft.js"),fe=require("../chunks/save-C5fwVdTF.js"),me=require("../chunks/layout-grid-B7-klXiK.js");/**
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),m=require("react"),d=require("../chunks/switch-B79Hn4Qh.js"),A=require("../chunks/index-DRlMUglg.js"),J=require("../chunks/x-B6ghREd2.js");require("../chunks/analyze-result-contract-Zgg-Bbpj.js");const U=require("../chunks/palette-C4KTXOug.js"),be=require("../chunks/braces-D2tStQjF.js"),fe=require("../chunks/save-C__QggEE.js"),me=require("../chunks/layout-grid-C0OI-MRn.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 q, P as ge, a as be, B as C, b as fe, U as De, C as Ie, R as me, e as le, S as se, d as Je, T as je, H as Le, I as U, J as $e, K as M, M as _e, N as Ve, O as Ue, Q as Me, L as E, V as K, W as Q, X as ee, Y as he, Z as re, _ as oe, $ as ke, a0 as xe, a1 as ye, a2 as ve, a3 as Ce, a4 as Ge } from "../chunks/switch-DUdaHFZQ.js";
3
+ import { c as q, P as ge, a as be, B as C, b as fe, U as De, C as Ie, R as me, e as le, S as se, d as Je, T as je, G as Le, H as U, I as $e, J as M, K as _e, M as Ve, N as Ue, O as Me, L as E, Q as K, V as Q, W as ee, X as he, Y as re, Z as oe, _ as ke, $ as xe, a0 as ye, a1 as ve, a2 as Ce, a3 as Ge } from "../chunks/switch-BXQAlSuW.js";
4
4
  import { r as We, v as He, A as Xe, a as Ye, p as Ze } from "../chunks/index-CJdxSyQq.js";
5
- import { c as ae, X as qe } from "../chunks/x-IdR_js6f.js";
6
- import "../chunks/analyze-result-contract-DuhlklhI.js";
7
- import { P as G } from "../chunks/palette-5IwhMbSF.js";
8
- import { B as Ke } from "../chunks/braces--20GzUQh.js";
9
- import { S as Qe } from "../chunks/save-16C6YSW2.js";
10
- import { L as er } from "../chunks/layout-grid-DV89AC9_.js";
5
+ import { c as ae, X as qe } from "../chunks/x-CXDkqdur.js";
6
+ import "../chunks/analyze-result-contract-C9Gv2_qW.js";
7
+ import { P as G } from "../chunks/palette-Cp1hqZtm.js";
8
+ import { B as Ke } from "../chunks/braces-8TRlDwDw.js";
9
+ import { S as Qe } from "../chunks/save-DgMfP0j8.js";
10
+ import { L as er } from "../chunks/layout-grid-CiubineE.js";
11
11
  /**
12
12
  * @license lucide-react v0.453.0 - ISC
13
13
  *