react-semaphor 0.1.417 → 0.1.418
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 +49 -50
- package/dist/brand-studio/index.cjs +1 -1
- package/dist/brand-studio/index.js +2 -2
- package/dist/chunks/analyze-result-contract-Akysi2ML.js +2003 -0
- package/dist/chunks/analyze-result-contract-COjyJzYm.js +1 -0
- package/dist/chunks/{calendar-preferences-dialog-BOfryj8P.js → calendar-preferences-dialog-BbuLgela.js} +3 -3
- package/dist/chunks/{calendar-preferences-dialog-Rq9qiG3X.js → calendar-preferences-dialog-CInkkhl_.js} +1 -1
- package/dist/chunks/{dashboard-briefing-launcher-D_P0cNQ_.js → dashboard-briefing-launcher-B4OWNsVD.js} +1 -1
- package/dist/chunks/{dashboard-briefing-launcher-DgvlOcRI.js → dashboard-briefing-launcher-D7FNuDuc.js} +4 -4
- package/dist/chunks/{dashboard-controls-DzVA-wWu.js → dashboard-controls-DTC1eCz0.js} +1 -1
- package/dist/chunks/{dashboard-controls-JYTKRokc.js → dashboard-controls-DcX7Mid4.js} +5 -5
- package/dist/chunks/{dashboard-json-h6YMk_-l.js → dashboard-json-BHWbQS6I.js} +3 -3
- package/dist/chunks/{dashboard-json-D5TEri2w.js → dashboard-json-vu38P5pV.js} +1 -1
- package/dist/chunks/{edit-dashboard-visual-kfbu03n9.js → edit-dashboard-visual-CkBhJBhp.js} +1 -1
- package/dist/chunks/{edit-dashboard-visual-DOtCYmDn.js → edit-dashboard-visual-DsCr90_3.js} +4 -4
- package/dist/chunks/{index-BgESS5r7.js → index-C56DuHI8.js} +163 -164
- package/dist/chunks/{index-Beol8cOo.js → index-C8thRvkW.js} +4 -4
- package/dist/chunks/{switch--FHwRAOL.js → switch-BXuyni6l.js} +1 -1
- package/dist/chunks/{switch-C8_t4Pio.js → switch-Dsx-IwBE.js} +1 -1
- package/dist/chunks/{update-policy-CQLHKQ_h.js → update-policy-B5S_LfEu.js} +161 -142
- package/dist/chunks/update-policy-BqBKUk3Q.js +3 -0
- package/dist/chunks/{use-create-flow-overlay-state-BEPWzqQn.js → use-create-flow-overlay-state-BDv_VpL6.js} +1 -1
- package/dist/chunks/{use-create-flow-overlay-state-NEs9ePDy.js → use-create-flow-overlay-state-CzftV84t.js} +3 -3
- package/dist/chunks/{validators-UqQI3Cg_.js → validators-CLzrE2N_.js} +1 -1
- package/dist/chunks/validators-CPFcUMrV.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 +28 -29
- package/dist/data-app-builder/index.cjs +1 -1
- package/dist/data-app-builder/index.js +2 -2
- package/dist/data-app-codegen/index.cjs +1 -1
- package/dist/data-app-codegen/index.js +2 -2
- package/dist/data-app-codegen-node/index.cjs +154 -125
- package/dist/data-app-codegen-node/index.js +695 -613
- package/dist/data-app-sdk/index.cjs +2 -2
- package/dist/data-app-sdk/index.js +171 -157
- package/dist/data-app-sdk-adapters/index.cjs +1 -1
- package/dist/data-app-sdk-adapters/index.js +26 -27
- package/dist/data-app-sdk-validation/index.cjs +1 -1
- package/dist/data-app-sdk-validation/index.js +17 -18
- 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 +5 -0
- package/dist/types/dashboard-assistant.d.ts +1 -0
- package/dist/types/data-app-codegen-node.d.ts +2 -1
- package/dist/types/data-app-codegen.d.ts +2 -1
- package/dist/types/data-app-sdk-validation.d.ts +1 -0
- package/dist/types/data-app-sdk.d.ts +6 -0
- package/package.json +1 -1
- package/dist/chunks/analyze-result-contract-B0O3oIYu.js +0 -1870
- package/dist/chunks/analyze-result-contract-CL97m8X8.js +0 -1
- package/dist/chunks/source-identity-BM2FvJDP.js +0 -1
- package/dist/chunks/source-identity-Cv4Nm3TM.js +0 -75
- package/dist/chunks/update-policy-B50M0Jeg.js +0 -3
- package/dist/chunks/validators-JzI7olk4.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const v=require("../chunks/operators-DrTQsJXv.js"),m=require("../chunks/
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const v=require("../chunks/operators-DrTQsJXv.js"),m=require("../chunks/analyze-result-contract-COjyJzYm.js");function p(i){var n,e,a;const t=b(i);return{version:1,kind:"metric",id:i.id,label:i.label,source:u(i),measures:t,primaryMeasure:M(i,t),dateField:i.dateField?o(i.dateField,"date"):void 0,timeGrain:i.timeGrain,dimensions:(n=i.dimensions)==null?void 0:n.map(r=>o(r,"dimension")),comparison:G(i.comparison),orderBy:i.orderBy?{field:o(i.orderBy.field),direction:i.orderBy.direction}:void 0,inputs:l(i.inputs),...(e=i.filters)!=null&&e.length?{filters:i.filters}:{},...i.relationshipHint?{relationshipHint:i.relationshipHint}:{},limit:i.limit,...(a=i.derivedFields)!=null&&a.length?{derivedFields:i.derivedFields}:{}}}function c(i){return{...p(i),...i.timeWindow?{timeWindow:i.timeWindow}:{},...i.analysis?{analysis:i.analysis}:{}}}function F(i){return{...i.chartTitle?{chartTitle:i.chartTitle}:{},...i.chartType?{chartType:i.chartType}:{},...i.driverMode?{driverMode:i.driverMode}:{},...i.includePopulation!==void 0?{includePopulation:i.includePopulation}:{},...i.calendarContext?{calendarContext:i.calendarContext}:{}}}function M(i,t){if(!i.primaryMeasure)return t[0]||{name:"",role:"measure"};const n=o(i.primaryMeasure,"measure"),e=k(n,t),a=e.length===1?e[0]:void 0;return a?I(n,a):n}function b(i){const t=[];for(const n of i.measures.map(e=>o(e,"measure"))){if(!n.name)continue;const e=t.findIndex(a=>R(a,n));if(e===-1){t.push(n);continue}t[e]=I(t[e],n)}return t}function R(i,t){return m.semaphorFieldRefsMatch(i,t)&&d(i)===d(t)}function H(i,t){return d(t)===d(i)}function w(i,t){return t.name!==i.name||i.source&&!m.semaphorFieldRefsMatch(t,i)?!1:H(i,t)}function k(i,t){const n=t.filter(e=>w(i,e));return i.aggregate!==void 0,n}function d(i){return(i.aggregate||"SUM").toUpperCase()}function I(i,t){if(i.aggregate&&t.aggregate&&i.aggregate!==t.aggregate)throw new Error(`Measure "${i.name}" was requested with conflicting aggregate semantics: ${i.aggregate} and ${t.aggregate}.`);return{...m.preferSemaphorFieldRefMetadata(i,t),aggregate:i.aggregate||t.aggregate}}function A(i){var n,e;if("sort"in i)throw new Error("semaphor.records supports orderBy for a single deterministic sort. Multiple sort clauses are not supported by the analytics protocol yet.");if(!V(i))throw new Error("semaphor.records needs at least one field.");const t=B(i.fields);return{version:1,kind:"records",id:i.id,label:i.label,source:u(i),fields:t,dateField:i.dateField?o(i.dateField,"date"):void 0,timeGrain:i.timeGrain,...i.timeWindow?{timeWindow:i.timeWindow}:{},...(n=i.filters)!=null&&n.length?{filters:i.filters}:{},orderBy:i.orderBy?{field:o(i.orderBy.field),direction:i.orderBy.direction}:void 0,inputs:l(i.inputs),...i.relationshipHint?{relationshipHint:i.relationshipHint}:{},limit:i.limit,...i.pagination?{pagination:i.pagination}:{},...i.totals?{totals:{mode:"server",measures:i.totals.measures.map(a=>o(a,"measure"))}}:{},...(e=i.derivedFields)!=null&&e.length?{derivedFields:i.derivedFields}:{}}}function B(i){return i.map(t=>{const n=o(t);if(!n.role)throw new Error(`semaphor.records field "${n.name}" needs an explicit role.`);return n})}function x(i){var t,n,e;return{version:1,kind:"inputOptions",id:i.id,label:i.label,inputId:i.inputId,source:u(i),labelField:o(i.labelField,"dimension"),valueField:o(i.valueField,"dimension"),...i.searchField?{searchField:o(i.searchField,"dimension")}:{},...(t=i.disambiguationFields)!=null&&t.length?{disambiguationFields:i.disambiguationFields.map(a=>o(a,"dimension"))}:{},...i.population?{population:i.population}:{},...i.dependencies?{dependencies:i.dependencies}:{},search:i.search,limit:i.limit,...(n=i.inputs)!=null&&n.length?{inputs:i.inputs.map(a=>f(a))}:{},...(e=i.derivedFields)!=null&&e.length?{derivedFields:i.derivedFields}:{}}}function O(i){var t;return{version:1,kind:"sql",id:i.id,label:i.label,source:i.source,sql:i.sql,...i.defaultParameters?{defaultParameters:i.defaultParameters}:{},...i.pythonCode?{pythonCode:i.pythonCode}:{},...(t=i.fields)!=null&&t.length?{fields:i.fields.map(n=>o(n))}:{},inputs:l(i.inputs),limit:i.limit,...i.pagination?{pagination:i.pagination}:{},rationale:i.rationale}}function C(i){var t,n;return{version:1,kind:"matrix",id:i.id,label:i.label,source:u(i),rows:i.rows.map(e=>g(e,"dimension")),...i.columns?{columns:i.columns.map(e=>g(e,"dimension"))}:{},values:i.values.map(z),...(t=i.filters)!=null&&t.length?{filters:i.filters}:{},inputs:l(i.inputs),...i.relationshipHint?{relationshipHint:i.relationshipHint}:{},...i.totals?{totals:i.totals}:{},...(n=i.sort)!=null&&n.length?{sort:i.sort}:{},...i.expansion?{expansion:i.expansion}:{},...i.layout?{layout:i.layout}:{},...i.displayLimits?{displayLimits:i.displayLimits}:{}}}function g(i,t){return P(i)?{...i,field:o(i.field,t)}:{field:o(i,t)}}function z(i){return T(i)?{...i,field:o(i.field,"measure")}:{field:o(i,"measure"),aggregate:i.aggregate}}function P(i){return"field"in i}function T(i){return"field"in i}function f(i){if("toAnalyticsInput"in i){const r=i.toAnalyticsInput();return{inputId:r.inputId,kind:r.kind,...r.controlRole?{controlRole:r.controlRole}:{},...r.operator?{operator:r.operator}:{},...r.field?{field:r.field}:{},...r.relationshipHint?{relationshipHint:r.relationshipHint}:{}}}if("id"in i){const r=h(i);return{inputId:r.inputId,kind:r.kind,...r.controlRole?{controlRole:r.controlRole}:{},...r.operator?{operator:r.operator}:{},...r.field?{field:r.field}:{},...r.relationshipHint?{relationshipHint:r.relationshipHint}:{}}}const t="kind"in i?i.kind:void 0,n="operator"in i?S(i.operator,i.inputId):void 0,e="controlRole"in i?i.controlRole:"role"in i?i.role:void 0,a=W(e)?e:void 0;return{inputId:i.inputId,...t?{kind:t}:{},...a?{controlRole:a}:{},...n?{operator:n}:{},...i.field?{field:i.field}:{},...i.relationshipHint?{relationshipHint:i.relationshipHint}:{}}}function W(i){return i==="grain"||i==="measure"||i==="dimension"||i==="aggregation"||i==="sqlParam"}function $(i){const t=l(i);return t.length>0?t:void 0}function y(i){return(i||[]).map(L)}function q(i){return y(i).filter(t=>t.isActive)}function h(i){if(i.kind==="filter"){const t=S(i.operator,i.id);return{inputId:i.id,kind:i.kind,label:i.label,field:o(i.field,"dimension"),operator:t||"in",...i.relationshipHint?{relationshipHint:i.relationshipHint}:{}}}return{inputId:i.id,kind:i.kind,label:i.label,controlRole:i.role}}function E(i=[]){return i.map(t=>typeof t=="object"?t:{label:String(t),value:t})}function s(i){return i==null?!1:Array.isArray(i)?i.length>0:typeof i=="string"?i.trim().length>0:!0}function L(i){if("toAnalyticsInput"in i)return i.toAnalyticsInput();if("kind"in i&&"isActive"in i)return i;if("id"in i){const t=h(i),n=Object.prototype.hasOwnProperty.call(i,"value")?i.value:i.defaultValue;return{inputId:t.inputId,kind:t.kind,label:t.label,...t.field?{field:t.field}:{},...t.operator?{operator:t.operator}:{},...t.controlRole?{controlRole:t.controlRole}:{},...t.relationshipHint?{relationshipHint:t.relationshipHint}:{},value:n,isActive:s(n)}}return{...i,kind:"filter",isActive:s(i.value),value:i.value}}function u(i){return i.source}function V(i){var t;return!!((t=i.fields)!=null&&t.length)}function o(i,t){return{...i,role:i.role||t}}function l(i){return(i||[]).map(f)}function G(i){if(i)return i}function S(i,t){if(i===void 0)return;const n=v.normalizeSemaphorInputOperator(i);if(!n)throw new Error(`useSemaphorInput "${t}" uses unsupported filter operator "${i}".`);return n}exports.hasSemaphorInputValue=s;exports.normalizeSemaphorInputOptions=E;exports.toSemaphorActiveInputSnapshots=q;exports.toSemaphorAnalysisIntent=c;exports.toSemaphorAnalysisQueryOptions=F;exports.toSemaphorInputBinding=f;exports.toSemaphorInputBindings=$;exports.toSemaphorInputOptionsIntent=x;exports.toSemaphorInputSnapshots=y;exports.toSemaphorInputSpec=h;exports.toSemaphorMatrixIntent=C;exports.toSemaphorMetricIntent=p;exports.toSemaphorRecordsIntent=A;exports.toSemaphorSqlIntent=O;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { n as I } from "../chunks/operators-C8TxpM4C.js";
|
|
2
|
-
import { s as m, p as F } from "../chunks/
|
|
3
|
-
|
|
4
|
-
function p(i) {
|
|
2
|
+
import { s as m, p as F } from "../chunks/analyze-result-contract-Akysi2ML.js";
|
|
3
|
+
function S(i) {
|
|
5
4
|
var n, r, a;
|
|
6
|
-
const t =
|
|
5
|
+
const t = p(i);
|
|
7
6
|
return {
|
|
8
7
|
version: 1,
|
|
9
8
|
kind: "metric",
|
|
@@ -11,7 +10,7 @@ function p(i) {
|
|
|
11
10
|
label: i.label,
|
|
12
11
|
source: u(i),
|
|
13
12
|
measures: t,
|
|
14
|
-
primaryMeasure:
|
|
13
|
+
primaryMeasure: c(i, t),
|
|
15
14
|
dateField: i.dateField ? o(i.dateField, "date") : void 0,
|
|
16
15
|
timeGrain: i.timeGrain,
|
|
17
16
|
dimensions: (n = i.dimensions) == null ? void 0 : n.map((e) => o(e, "dimension")),
|
|
@@ -27,14 +26,14 @@ function p(i) {
|
|
|
27
26
|
...(a = i.derivedFields) != null && a.length ? { derivedFields: i.derivedFields } : {}
|
|
28
27
|
};
|
|
29
28
|
}
|
|
30
|
-
function
|
|
29
|
+
function $(i) {
|
|
31
30
|
return {
|
|
32
|
-
...
|
|
31
|
+
...S(i),
|
|
33
32
|
...i.timeWindow ? { timeWindow: i.timeWindow } : {},
|
|
34
33
|
...i.analysis ? { analysis: i.analysis } : {}
|
|
35
34
|
};
|
|
36
35
|
}
|
|
37
|
-
function
|
|
36
|
+
function E(i) {
|
|
38
37
|
return {
|
|
39
38
|
...i.chartTitle ? { chartTitle: i.chartTitle } : {},
|
|
40
39
|
...i.chartType ? { chartType: i.chartType } : {},
|
|
@@ -43,13 +42,13 @@ function L(i) {
|
|
|
43
42
|
...i.calendarContext ? { calendarContext: i.calendarContext } : {}
|
|
44
43
|
};
|
|
45
44
|
}
|
|
46
|
-
function
|
|
45
|
+
function c(i, t) {
|
|
47
46
|
if (!i.primaryMeasure)
|
|
48
47
|
return t[0] || { name: "", role: "measure" };
|
|
49
48
|
const n = o(i.primaryMeasure, "measure"), r = R(n, t), a = r.length === 1 ? r[0] : void 0;
|
|
50
49
|
return a ? h(n, a) : n;
|
|
51
50
|
}
|
|
52
|
-
function
|
|
51
|
+
function p(i) {
|
|
53
52
|
const t = [];
|
|
54
53
|
for (const n of i.measures.map(
|
|
55
54
|
(r) => o(r, "measure")
|
|
@@ -98,7 +97,7 @@ function h(i, t) {
|
|
|
98
97
|
aggregate: i.aggregate || t.aggregate
|
|
99
98
|
};
|
|
100
99
|
}
|
|
101
|
-
function
|
|
100
|
+
function L(i) {
|
|
102
101
|
var n, r;
|
|
103
102
|
if ("sort" in i)
|
|
104
103
|
throw new Error(
|
|
@@ -147,7 +146,7 @@ function w(i) {
|
|
|
147
146
|
return n;
|
|
148
147
|
});
|
|
149
148
|
}
|
|
150
|
-
function
|
|
149
|
+
function G(i) {
|
|
151
150
|
var t, n, r;
|
|
152
151
|
return {
|
|
153
152
|
version: 1,
|
|
@@ -172,7 +171,7 @@ function V(i) {
|
|
|
172
171
|
...(r = i.derivedFields) != null && r.length ? { derivedFields: i.derivedFields } : {}
|
|
173
172
|
};
|
|
174
173
|
}
|
|
175
|
-
function
|
|
174
|
+
function V(i) {
|
|
176
175
|
var t;
|
|
177
176
|
return {
|
|
178
177
|
version: 1,
|
|
@@ -190,7 +189,7 @@ function j(i) {
|
|
|
190
189
|
rationale: i.rationale
|
|
191
190
|
};
|
|
192
191
|
}
|
|
193
|
-
function
|
|
192
|
+
function j(i) {
|
|
194
193
|
var t, n;
|
|
195
194
|
return {
|
|
196
195
|
version: 1,
|
|
@@ -274,14 +273,14 @@ function g(i) {
|
|
|
274
273
|
function B(i) {
|
|
275
274
|
return i === "grain" || i === "measure" || i === "dimension" || i === "aggregation" || i === "sqlParam";
|
|
276
275
|
}
|
|
277
|
-
function
|
|
276
|
+
function q(i) {
|
|
278
277
|
const t = l(i);
|
|
279
278
|
return t.length > 0 ? t : void 0;
|
|
280
279
|
}
|
|
281
280
|
function C(i) {
|
|
282
281
|
return (i || []).map(O);
|
|
283
282
|
}
|
|
284
|
-
function
|
|
283
|
+
function U(i) {
|
|
285
284
|
return C(i).filter((t) => t.isActive);
|
|
286
285
|
}
|
|
287
286
|
function y(i) {
|
|
@@ -303,7 +302,7 @@ function y(i) {
|
|
|
303
302
|
controlRole: i.role
|
|
304
303
|
};
|
|
305
304
|
}
|
|
306
|
-
function
|
|
305
|
+
function Q(i = []) {
|
|
307
306
|
return i.map(
|
|
308
307
|
(t) => typeof t == "object" ? t : {
|
|
309
308
|
label: String(t),
|
|
@@ -374,17 +373,17 @@ function v(i, t) {
|
|
|
374
373
|
}
|
|
375
374
|
export {
|
|
376
375
|
f as hasSemaphorInputValue,
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
376
|
+
Q as normalizeSemaphorInputOptions,
|
|
377
|
+
U as toSemaphorActiveInputSnapshots,
|
|
378
|
+
$ as toSemaphorAnalysisIntent,
|
|
379
|
+
E as toSemaphorAnalysisQueryOptions,
|
|
381
380
|
g as toSemaphorInputBinding,
|
|
382
|
-
|
|
383
|
-
|
|
381
|
+
q as toSemaphorInputBindings,
|
|
382
|
+
G as toSemaphorInputOptionsIntent,
|
|
384
383
|
C as toSemaphorInputSnapshots,
|
|
385
384
|
y as toSemaphorInputSpec,
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
385
|
+
j as toSemaphorMatrixIntent,
|
|
386
|
+
S as toSemaphorMetricIntent,
|
|
387
|
+
L as toSemaphorRecordsIntent,
|
|
388
|
+
V as toSemaphorSqlIntent
|
|
390
389
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const E=require("../chunks/validators-JzI7olk4.js");require("../chunks/analyze-result-contract-CL97m8X8.js");const q=require("../chunks/source-identity-BM2FvJDP.js"),y=require("../data-app-sdk-adapters/index.cjs"),R=require("../chunks/catalog-field-grounding-Bnx-3tE0.js");function W({intent:e,field:r,catalogField:o,relativePath:t}){const i=U({intent:e,field:r,relativePath:t});if(!i||i.allowedRelatedRoles.length===0)return!1;const a=f(r,i.selectedField),s=w(o),n=p(a);return M(s,i.allowedRelatedRoles)?n===s:!1}function J(e){return e.kind==="records"?X(e):e.kind==="metric"?Y(e):Z(e)}function w(e){const r=R.normalizeAnalyticsCatalogName(e.role);if(r==="measure")return"measure";if(r==="id")return"id";const o=R.normalizeAnalyticsCatalogDataType(e.dataType);if(r==="date"||o==="date"||o==="datetime")return"date";if(r==="dimension")return"dimension"}function M(e,r){return!!(e&&r.includes(e))}function f(e,r){const o=p(e);if(o)return e.role===o?e:{...e,role:o};const t=r?p(r):void 0;return t?{...e,role:t}:e}function u(e,r){return e.find(o=>D(o,r))}function S(e){return[...e.rows.map(r=>r.field),...(e.columns||[]).map(r=>r.field)]}function U({intent:e,field:r,relativePath:o}){if(e.kind==="records")return L(e,r,o);if(e.kind==="metric")return V(e,r,o);if(e.kind==="matrix")return G(e,r,o)}function L(e,r,o){if(o.startsWith("spec.fields."))return{allowedRelatedRoles:["dimension","date","id"]};if(o==="spec.dateField"&&!e.timeWindow)return{allowedRelatedRoles:["date"]};if(o==="spec.orderBy.field"){const t=u(B(e),r);return{selectedField:t,allowedRelatedRoles:t?x(t):[]}}}function V(e,r,o){if(o.startsWith("spec.dimensions."))return{allowedRelatedRoles:["dimension"]};if(o==="spec.orderBy.field"){const t=u(e.dimensions||[],r);return{selectedField:t,allowedRelatedRoles:t?["dimension"]:[]}}}function G(e,r,o){if(oe(o))return{allowedRelatedRoles:["dimension","date"]};if(te(o)){const t=u(S(e),r);return{selectedField:t,allowedRelatedRoles:v(t)}}}function X(e){var t,i;const r=B(e),o=(t=e.orderBy)!=null&&t.field?u(r,e.orderBy.field):void 0;return _([...r.map(a=>l(a,x(a))),...(i=e.orderBy)!=null&&i.field?[l(f(e.orderBy.field,o),o?x(o):[],{unsupportedRelatedRoleMessage:"Joined records projections support related sort fields only when the same related field is included in spec.fields.",recommendedNextStep:"Add the related sort field to spec.fields, or keep orderBy fields on the base source."})]:[]])}function Y(e){var o,t;const r=(o=e.orderBy)!=null&&o.field?u(e.dimensions||[],e.orderBy.field):void 0;return _([...e.measures.map(i=>l(i,[])),...e.primaryMeasure?[l(e.primaryMeasure,[])]:[],...(e.dimensions||[]).map(i=>l(i,["dimension"])),...e.dateField?[l({...e.dateField,role:"date"},[])]:[],...(t=e.orderBy)!=null&&t.field?[l(f(e.orderBy.field,r),r?["dimension"]:[],{unsupportedRelatedRoleMessage:"Joined metric projections support related orderBy fields only when the same related field is declared in spec.dimensions.",recommendedNextStep:"Add the related field as a metric dimension when it should participate in the grouped result, or keep orderBy fields on the base source."})]:[]])}function Z(e){const r=[...e.rows,...e.columns||[]];return _([...r.map(o=>l(o.field,v(o.field))),...r.flatMap(o=>{var a;if(((a=o.sortBy)==null?void 0:a.by.kind)!=="field")return[];const t=o.sortBy.by.field,i=u(S(e),t);return[l(f(t,i),v(i),{unsupportedRelatedRoleMessage:"Joined matrix projections support related axis sort fields only when the same related field is used as a row/column axis.",recommendedNextStep:"Use a related field as a row or column axis, or keep axis sort fields on the base source."})]}),...e.values.map(o=>l(o.field,[],{unsupportedRelatedRoleMessage:"Joined matrix projections support related row/column dimensions or dates only. Related value fields are not supported in this phase.",recommendedNextStep:"Keep matrix values on the base source, or use governed SQL for unsupported aggregate-safe joined values."})),...(e.sort||[]).flatMap(o=>{if(o.by.kind!=="field")return[];const t=o.by.field,i=u(S(e),t);return[l(f(t,i),v(i),{unsupportedRelatedRoleMessage:"Joined matrix projections support related top-level sort fields only when the same related field is used as a row/column axis.",recommendedNextStep:"Use a related field as a row or column axis, or keep matrix sort fields on the base source."})]})])}function x(e){const r=e?p(e):void 0;return r==="dimension"?["dimension"]:r==="date"?["date"]:r==="id"?["id"]:["dimension","date","id"]}function v(e){const r=e?p(e):void 0;return r==="date"?["date"]:r==="dimension"?["dimension"]:[]}function l(e,r,o={}){return{field:f(e),allowedRelatedRoles:r,...o}}function _(e){const r=[];return e.forEach(o=>{r.some(t=>ee(t,o))||r.push(o)}),r}function B(e){const r=[...e.fields];return e.dateField&&!r.some(o=>T(o,e.dateField))&&r.push({...e.dateField,role:"date"}),r}function ee(e,r){return D(e.field,r.field)&&e.allowedRelatedRoles.join("|")===r.allowedRelatedRoles.join("|")&&(e.unsupportedRelatedRoleMessage||"")===(r.unsupportedRelatedRoleMessage||"")&&(e.recommendedNextStep||"")===(r.recommendedNextStep||"")}function T(e,r){return q.semaphorFieldRefsMatch(e,r)}function D(e,r){return T(e,r)&&re(p(e),p(r))}function re(e,r){return!!(e&&(!r||e===r))}function p(e){return w(e)}function oe(e){const r=e.split(".");return r.length===4&&r[0]==="spec"&&(r[1]==="rows"||r[1]==="columns")&&b(r[2])&&r[3]==="field"}function te(e){const r=e.split(".");return r.length===6&&r[0]==="spec"&&(r[1]==="rows"||r[1]==="columns")&&b(r[2])&&r[3]==="sortBy"&&r[4]==="by"&&r[5]==="field"||r.length===5&&r[0]==="spec"&&r[1]==="sort"&&b(r[2])&&r[3]==="by"&&r[4]==="field"}function b(e){return e===void 0||e.trim()===""?!1:Number.isInteger(Number(e))&&Number(e)>=0}function ie({intent:e,field:r,relativePath:o,baseCatalog:t,fieldCatalogs:i}){const a=g(r,e.source),s=q.semaphorSourcesReferToSameDataset(a,e.source);if(!s&&!se(e.source,a))return{ok:!1,code:"invalid_source_ref",message:`Field "${r.name}" references a related Semaphor source outside the query's semantic domain.`,pathSuffix:".source",source:a};const n=s?t:k(i,a);if(!n)return{ok:!1,code:"invalid_source_ref",message:`Field "${r.name}" references a Semaphor source that is not present in the visible field catalog.`,pathSuffix:".source",source:a};const d=I(n,r,e.source);return d?!s&&!ae({intent:e,field:r,catalogField:d,relativePath:o})?{ok:!1,code:"unsupported_joined_projection",message:`Field "${r.name}" references a related Semaphor source, but this query kind does not support joined projections for that field yet.`,pathSuffix:".source",source:a}:{ok:!0,source:a,catalogField:d,usesBaseSource:s}:{ok:!1,code:"missing_field",message:`Field "${r.name}" is not visible on the selected Semaphor source.`,source:a}}function ae({intent:e,field:r,catalogField:o,relativePath:t}){return W({intent:e,field:r,catalogField:o,relativePath:t})}function se(e,r){return e.kind==="semantic"&&r.kind==="semantic"&&e.domainId===r.domainId}function k(e,r){return e.find(o=>$(o,r))}function I(e,r,o){const t=g(r,o);if($(e,t))return e.fields.find(i=>ne(i,r)&&$(e,g(i,e.source)))}function P(e){return R.normalizeAnalyticsCatalogName(e)}function g(e,r){return e.source||r}function $(e,r){return[e.source,...e.sourceAliases||[]].some(o=>q.semaphorSourcesReferToSameDataset(o,r))}function ne(e,r){return!!(e.name&&r.name&&e.name===r.name)}function z(e,r={}){const o=r.pathPrefix||"analysisOptions";if(e===void 0)return{ok:!0};if(!e||typeof e!="object"||Array.isArray(e))return c(o,"Data App analysis options must be an object.");const t=e,i={};if(t.chartTitle!==void 0){if(typeof t.chartTitle!="string")return c(`${o}.chartTitle`,'Data App analysis option "chartTitle" must be a string.');i.chartTitle=t.chartTitle}if(t.chartType!==void 0){if(typeof t.chartType!="string")return c(`${o}.chartType`,'Data App analysis option "chartType" must be a string.');i.chartType=t.chartType}if(t.driverMode!==void 0){if(!ce(t.driverMode))return c(`${o}.driverMode`,'Data App analysis option "driverMode" must be absolute_delta, largest_negative, largest_positive, positive_and_negative, or all.');i.driverMode=t.driverMode}if(t.includePopulation!==void 0){if(typeof t.includePopulation!="boolean")return c(`${o}.includePopulation`,'Data App analysis option "includePopulation" must be a boolean.');i.includePopulation=t.includePopulation}if(t.calendarContext!==void 0){const a=fe(t.calendarContext,{pathPrefix:`${o}.calendarContext`,validateTimezone:r.validateTimezone});if(!a.ok)return a;i.calendarContext=a.calendarContext}return{ok:!0,analysisOptions:i}}function de(e){const r=e.queries.map((i,a)=>le(i,a,{fieldCatalogs:e.fieldCatalogs||[],requireFieldCatalog:!!e.requireFieldCatalog,validateTimezone:e.validateTimezone})),o=r.flatMap(i=>i.diagnostics),t=r.map(i=>i.executionResult);return{ok:o.every(i=>i.severity!=="error"),diagnostics:o,queries:r,intents:r.flatMap(i=>i.intent?[i.intent]:[]),executionResults:t}}function le(e,r,o){const t=`queries.${r}`;try{const i=pe(e),a=$e(e,i),s=E.validateSemaphorAnalyticsIntent(i),n=[...ke({querySpec:e,queryId:a,intent:i,pathPrefix:t}),...s.errors.map(h=>C(h,{queryHook:e.queryHook,queryId:a,pathPrefix:t,severity:"error",intent:i})),...s.warnings.map(h=>C(h,{queryHook:e.queryHook,queryId:a,pathPrefix:t,severity:"warning",intent:i})),...ye({querySpec:e,queryId:a,intent:i,pathPrefix:t,fieldCatalogs:o.fieldCatalogs,requireFieldCatalog:o.requireFieldCatalog}),...Ie({querySpec:e,queryId:a,intent:i,pathPrefix:t,validateTimezone:o.validateTimezone})],d=be(s,n);return{queryHook:e.queryHook,queryId:a,intent:i,diagnostics:n,executionResult:j({intent:i,validation:d,diagnostics:n})}}catch(i){const a={severity:"error",code:"invalid_query_spec",message:i instanceof Error?i.message:String(i),path:t,queryHook:e.queryHook,queryId:Q(e.spec)},s=K([a]);return{queryHook:e.queryHook,queryId:a.queryId,diagnostics:[a],executionResult:j({validation:s,diagnostics:[a]})}}}function c(e,r){return{ok:!1,issues:[{code:"invalid_analysis_option",message:r,path:e}]}}function N(e){return!!(e&&typeof e=="object"&&!Array.isArray(e))}function ce(e){return e==="absolute_delta"||e==="largest_negative"||e==="largest_positive"||e==="positive_and_negative"||e==="all"}function ue(e){return e.trim().length>0&&!Number.isNaN(Date.parse(e))}function fe(e,r){var d;if(!e||typeof e!="object"||Array.isArray(e))return c(r.pathPrefix,'Data App analysis option "calendarContext" must be an object.');const o=e,t=o.tz,i=o.weekStart,a=o.anchor,s=a&&typeof a=="object"&&!Array.isArray(a)?a.iso:void 0,n=typeof t=="string"?((d=r.validateTimezone)==null?void 0:d.call(r,t))??t:null;return n?typeof i!="number"||!Number.isInteger(i)||i<0||i>6?c(`${r.pathPrefix}.weekStart`,'Data App analysis option "calendarContext.weekStart" must be an integer from 0 to 6.'):a!=="now"&&!(typeof s=="string"&&ue(s))?c(`${r.pathPrefix}.anchor`,'Data App analysis option "calendarContext.anchor" must be "now" or an object with a valid iso string.'):{ok:!0,calendarContext:{tz:n,weekStart:i,anchor:a}}:c(`${r.pathPrefix}.tz`,'Data App analysis option "calendarContext.tz" must be a valid timezone string.')}function pe(e){return me(e.spec)}function me(e){if(!N(e))throw new Error("useSemaphorQuery spec must be an object.");if(e.queryKind==="metric")return y.toSemaphorMetricIntent(e);if(e.queryKind==="analysis")return y.toSemaphorAnalysisIntent(e);if(e.queryKind==="records")return y.toSemaphorRecordsIntent(e);if(e.queryKind==="sql")return y.toSemaphorSqlIntent(e);if(e.queryKind==="matrix")return y.toSemaphorMatrixIntent(e);if(e.queryKind==="inputOptions")return y.toSemaphorInputOptionsIntent(e);throw new Error("useSemaphorQuery spec.queryKind must be metric, analysis, records, inputOptions, sql, or matrix.")}function ye(e){if(e.intent.kind==="sql")return[];if(e.fieldCatalogs.length===0&&!e.requireFieldCatalog)return[];const r=k(e.fieldCatalogs,e.intent.source);if(!r)return[{severity:"error",code:"invalid_source_ref",message:`Source ref for ${e.querySpec.queryHook} does not match a visible Semaphor source.`,path:`${e.pathPrefix}.spec.source`,queryHook:e.querySpec.queryHook,queryId:e.queryId,intentId:e.intent.id,source:e.intent.source}];const o=ge({...e,catalog:r}),t={...r,fields:[...r.fields,...Re(e.intent,r,e.intent.source)]};return[...o,...he({...e,fieldCatalogs:e.fieldCatalogs}),...qe({...e,catalog:t,fieldCatalogs:e.fieldCatalogs}),...ve({...e,catalog:t,fieldCatalogs:e.fieldCatalogs})]}function he(e){var o;if(e.intent.kind!=="inputOptions"||((o=e.intent.population)==null?void 0:o.kind)!=="related_population")return[];const r=e.intent.population.baseSource;return k(e.fieldCatalogs,r)?[]:[{severity:"error",code:"invalid_source_ref",message:"Input options related population baseSource does not match a visible Semaphor source.",path:`${e.pathPrefix}.spec.population.baseSource`,queryHook:e.querySpec.queryHook,queryId:e.queryId,intentId:e.intent.id,source:r}]}function ge(e){const r=O(e.intent);if(r.length===0)return[];const o=[],t=new Set;return r.forEach((i,a)=>{const s=`${e.pathPrefix}.spec.derivedFields.${a}`,n=P(i.name);n&&(t.has(n)&&o.push({severity:"error",code:"duplicate_derived_field",message:`Derived field "${i.name}" is declared more than once.`,path:`${s}.name`,queryHook:e.querySpec.queryHook,queryId:e.queryId,intentId:e.intent.id,source:e.intent.source}),t.add(n),e.catalog.fields.some(d=>P(d.name)===n)&&o.push({severity:"error",code:"derived_field_name_collision",message:`Derived field "${i.name}" conflicts with a field already visible on the selected Semaphor source.`,path:`${s}.name`,queryHook:e.querySpec.queryHook,queryId:e.queryId,intentId:e.intent.id,source:e.intent.source})),Object.entries(i.inputs||{}).forEach(([d,h])=>{const m=xe(h);if(!m)return;const F=g(m,e.intent.source);if(!q.semaphorSourcesReferToSameDataset(F,e.intent.source)){o.push({severity:"error",code:"unsupported_derived_field_source",message:`Derived field "${i.name}" input "${d}" references a different Semaphor source. App-local derived fields must use fields from the query source.`,path:`${s}.inputs.${d}`,queryHook:e.querySpec.queryHook,queryId:e.queryId,intentId:e.intent.id,source:F,field:m});return}I(e.catalog,m,e.intent.source)||o.push({severity:"error",code:"missing_field",message:`Derived field "${i.name}" input "${d}" references field "${m.name}", which is not visible on the selected Semaphor source.`,path:`${s}.inputs.${d}`,queryHook:e.querySpec.queryHook,queryId:e.queryId,intentId:e.intent.id,source:F,field:m})})}),o}function qe(e){return Fe(e.intent).flatMap(({field:r,path:o})=>{const t=ie({intent:e.intent,field:r,relativePath:o,baseCatalog:e.catalog,fieldCatalogs:e.fieldCatalogs});return t.ok?[]:[{severity:"error",code:t.code,message:t.message,path:`${e.pathPrefix}.${o}${t.pathSuffix||""}`,queryHook:e.querySpec.queryHook,queryId:e.queryId,intentId:e.intent.id,source:t.source,field:r}]})}function ve(e){return("inputs"in e.intent?e.intent.inputs||[]:[]).flatMap((o,t)=>{if(!o.field)return[];const i=g(o.field,e.intent.source);if(!q.semaphorSourcesReferToSameDataset(i,e.intent.source)){if(Se(e.intent,i)){const a=k(e.fieldCatalogs,i);return a?I(a,o.field,i)?[]:[{severity:"error",code:"missing_field",message:`Input "${o.inputId}" references field "${o.field.name}", which is not visible on the selected Semaphor source.`,path:`${e.pathPrefix}.spec.inputs.${t}.field`,queryHook:e.querySpec.queryHook,queryId:e.queryId,intentId:e.intent.id,source:i,field:o.field}]:[{severity:"error",code:"invalid_source_ref",message:`Input "${o.inputId}" references a Semaphor source that is not present in the visible field catalog.`,path:`${e.pathPrefix}.spec.inputs.${t}.field.source`,queryHook:e.querySpec.queryHook,queryId:e.queryId,intentId:e.intent.id,source:i,field:o.field}]}return[{severity:"error",code:"unsupported_input_filter_composition",message:`Input "${o.inputId}" filters a different Semaphor source than the query, and no relationship-aware semantic validation path is available for this query kind.`,path:`${e.pathPrefix}.spec.inputs.${t}.field`,queryHook:e.querySpec.queryHook,queryId:e.queryId,intentId:e.intent.id,source:i,field:o.field}]}return I(e.catalog,o.field,e.intent.source)?[]:[{severity:"error",code:"missing_field",message:`Input "${o.inputId}" references field "${o.field.name}", which is not visible on the selected Semaphor source.`,path:`${e.pathPrefix}.spec.inputs.${t}.field`,queryHook:e.querySpec.queryHook,queryId:e.queryId,intentId:e.intent.id,source:i,field:o.field}]})}function Se(e,r){return e.source.kind==="semantic"&&r.kind==="semantic"&&r.domainId===e.source.domainId}function Ie(e){if(e.querySpec.spec.queryKind!=="analysis")return[];const r=z(e.querySpec.spec,{pathPrefix:`${e.pathPrefix}.spec`,validateTimezone:e.validateTimezone});return r.ok?[]:r.issues.map(o=>({severity:"error",code:o.code,message:o.message,path:o.path,queryHook:e.querySpec.queryHook,queryId:e.queryId,intentId:e.intent.id,source:e.intent.source}))}function ke(e){return e.querySpec.spec.queryKind!=="sql"?[]:N(e.querySpec.spec)?Object.prototype.hasOwnProperty.call(e.querySpec.spec,"parameters")?[{severity:"error",code:"deprecated_sql_parameters",message:"semaphor.sql uses defaultParameters for static SQL param(...) fallback values. The legacy parameters field is not supported.",path:`${e.pathPrefix}.spec.parameters`,queryHook:e.querySpec.queryHook,queryId:e.queryId,intentId:e.intent.id}]:[]:[]}function Fe(e){return e.kind==="metric"?[...e.measures.map((r,o)=>({field:r,path:`spec.measures.${o}`})),...e.primaryMeasure?[{field:e.primaryMeasure,path:"spec.primaryMeasure"}]:[],...e.dateField?[{field:e.dateField,path:"spec.dateField"}]:[],...(e.dimensions||[]).map((r,o)=>({field:r,path:`spec.dimensions.${o}`})),...e.orderBy?[{field:e.orderBy.field,path:"spec.orderBy.field"}]:[],...(e.filters||[]).map((r,o)=>({field:r.field,path:`spec.filters.${o}.field`}))]:e.kind==="records"?[...e.fields.map((r,o)=>({field:r,path:`spec.fields.${o}`})),...e.dateField?[{field:e.dateField,path:"spec.dateField"}]:[],...e.orderBy?[{field:e.orderBy.field,path:"spec.orderBy.field"}]:[],...(e.filters||[]).map((r,o)=>({field:r.field,path:`spec.filters.${o}.field`}))]:e.kind==="inputOptions"?[{field:e.labelField,path:"spec.labelField"},{field:e.valueField,path:"spec.valueField"},...e.searchField?[{field:e.searchField,path:"spec.searchField"}]:[],...(e.disambiguationFields||[]).map((r,o)=>({field:r,path:`spec.disambiguationFields.${o}`}))]:e.kind==="matrix"?[...e.rows.map((r,o)=>({field:r.field,path:`spec.rows.${o}.field`})),...e.rows.flatMap((r,o)=>{var t;return((t=r.sortBy)==null?void 0:t.by.kind)==="field"?[{field:r.sortBy.by.field,path:`spec.rows.${o}.sortBy.by.field`}]:[]}),...(e.columns||[]).map((r,o)=>({field:r.field,path:`spec.columns.${o}.field`})),...(e.columns||[]).flatMap((r,o)=>{var t;return((t=r.sortBy)==null?void 0:t.by.kind)==="field"?[{field:r.sortBy.by.field,path:`spec.columns.${o}.sortBy.by.field`}]:[]}),...e.values.map((r,o)=>({field:r.field,path:`spec.values.${o}.field`})),...(e.sort||[]).flatMap((r,o)=>r.by.kind==="field"?[{field:r.by.field,path:`spec.sort.${o}.by.field`}]:[]),...(e.filters||[]).map((r,o)=>({field:r.field,path:`spec.filters.${o}.field`}))]:[]}function O(e){return!("derivedFields"in e)||!Array.isArray(e.derivedFields)?[]:e.derivedFields}function Re(e,r,o){return O(e).map(t=>({name:t.name,label:t.label,role:t.resultRole,dataType:t.dataType,source:r.source||o,...t.defaultAggregate?{aggregate:t.defaultAggregate}:{}}))}function xe(e){if(!(!e||typeof e!="object"))return e.field}function C(e,r){return{severity:r.severity,code:e.code||"invalid_analytics_intent",message:e.message,path:e.path?`${r.pathPrefix}.spec.${e.path}`:r.pathPrefix,queryHook:r.queryHook,queryId:r.queryId,intentId:r.intent.id,source:r.intent.source}}function be(e,r){const o=K(r);return{ok:o.ok&&e.ok,errors:H([...e.errors,...o.errors]),warnings:H([...e.warnings,...o.warnings]),repairHints:[...e.repairHints,...o.repairHints]}}function K(e){const r=e.filter(t=>t.severity==="error").map(A),o=e.filter(t=>t.severity==="warning").map(A);return{ok:r.length===0,errors:r,warnings:o,repairHints:r.map(t=>{var i,a;return{code:t.code,message:t.message,fieldRole:t.fieldRole,invalidField:(i=t.repairHint)==null?void 0:i.invalidField,recommendedNextStep:((a=t.repairHint)==null?void 0:a.recommendedNextStep)||"Update the Data App SDK query spec to use visible Semaphor source and field refs."}})}}function A(e){var r;return{code:e.code,message:e.message,path:e.path,fieldRole:e.code==="invalid_source_ref"?"source":void 0,repairHint:{code:e.code,message:e.message,invalidField:(r=e.field)==null?void 0:r.name,fieldRole:e.code==="invalid_source_ref"?"source":void 0,recommendedNextStep:e.code==="unsupported_input_filter_composition"?"Use an input field from the same Semaphor source as the query, or split the query into separate source-scoped queries.":"Update the query spec to use a visible Semaphor source and field ref."}}}function H(e){const r=new Set;return e.filter(o=>{const t=`${o.code}:${o.path||""}:${o.message}`;return r.has(t)?!1:(r.add(t),!0)})}function j(e){var o,t;const r=e.diagnostics.filter(i=>i.severity==="error");return{intentId:(o=e.intent)==null?void 0:o.id,status:r.length?"failed":"answered",resultShape:(t=e.intent)==null?void 0:t.kind,intent:e.intent,validation:e.validation,coverage:{answeredObligations:r.length?[]:["query_spec_validation"],missingObligations:r.length?["query_spec_validation"]:[],warnings:e.validation.warnings},missingFields:r.filter(i=>i.code==="missing_field").flatMap(i=>{var a;return(a=i.field)!=null&&a.name?[i.field.name]:[]}),warnings:e.diagnostics.filter(i=>i.severity==="warning").map(i=>i.message),metadata:{validationKind:"data_app_sdk_query_spec"}}}function $e(e,r){return r.id||Q(e.spec)}function Q(e){if(!e||typeof e!="object"||!("id"in e))return;const r=e.id;return typeof r=="string"&&r.trim()?r:void 0}exports.fieldWithSelectedProjectionRole=f;exports.findMatchingRelatedProjectionField=u;exports.isAllowedRelatedProjectionRole=M;exports.matrixAxisFieldsForPolicy=S;exports.normalizeSemaphorAnalysisQueryOptions=z;exports.normalizeSemaphorFieldRole=w;exports.relatedProjectionFieldCandidatesForIntent=J;exports.validateSemaphorDataAppQuerySpecs=de;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const E=require("../chunks/validators-CPFcUMrV.js"),v=require("../chunks/analyze-result-contract-COjyJzYm.js"),y=require("../data-app-sdk-adapters/index.cjs"),R=require("../chunks/catalog-field-grounding-Bnx-3tE0.js");function W({intent:e,field:r,catalogField:o,relativePath:t}){const i=U({intent:e,field:r,relativePath:t});if(!i||i.allowedRelatedRoles.length===0)return!1;const a=f(r,i.selectedField),s=w(o),n=p(a);return M(s,i.allowedRelatedRoles)?n===s:!1}function J(e){return e.kind==="records"?X(e):e.kind==="metric"?Y(e):Z(e)}function w(e){const r=R.normalizeAnalyticsCatalogName(e.role);if(r==="measure")return"measure";if(r==="id")return"id";const o=R.normalizeAnalyticsCatalogDataType(e.dataType);if(r==="date"||o==="date"||o==="datetime")return"date";if(r==="dimension")return"dimension"}function M(e,r){return!!(e&&r.includes(e))}function f(e,r){const o=p(e);if(o)return e.role===o?e:{...e,role:o};const t=r?p(r):void 0;return t?{...e,role:t}:e}function u(e,r){return e.find(o=>D(o,r))}function S(e){return[...e.rows.map(r=>r.field),...(e.columns||[]).map(r=>r.field)]}function U({intent:e,field:r,relativePath:o}){if(e.kind==="records")return L(e,r,o);if(e.kind==="metric")return V(e,r,o);if(e.kind==="matrix")return G(e,r,o)}function L(e,r,o){if(o.startsWith("spec.fields."))return{allowedRelatedRoles:["dimension","date","id"]};if(o==="spec.dateField"&&!e.timeWindow)return{allowedRelatedRoles:["date"]};if(o==="spec.orderBy.field"){const t=u(B(e),r);return{selectedField:t,allowedRelatedRoles:t?x(t):[]}}}function V(e,r,o){if(o.startsWith("spec.dimensions."))return{allowedRelatedRoles:["dimension"]};if(o==="spec.orderBy.field"){const t=u(e.dimensions||[],r);return{selectedField:t,allowedRelatedRoles:t?["dimension"]:[]}}}function G(e,r,o){if(oe(o))return{allowedRelatedRoles:["dimension","date"]};if(te(o)){const t=u(S(e),r);return{selectedField:t,allowedRelatedRoles:q(t)}}}function X(e){var t,i;const r=B(e),o=(t=e.orderBy)!=null&&t.field?u(r,e.orderBy.field):void 0;return _([...r.map(a=>l(a,x(a))),...(i=e.orderBy)!=null&&i.field?[l(f(e.orderBy.field,o),o?x(o):[],{unsupportedRelatedRoleMessage:"Joined records projections support related sort fields only when the same related field is included in spec.fields.",recommendedNextStep:"Add the related sort field to spec.fields, or keep orderBy fields on the base source."})]:[]])}function Y(e){var o,t;const r=(o=e.orderBy)!=null&&o.field?u(e.dimensions||[],e.orderBy.field):void 0;return _([...e.measures.map(i=>l(i,[])),...e.primaryMeasure?[l(e.primaryMeasure,[])]:[],...(e.dimensions||[]).map(i=>l(i,["dimension"])),...e.dateField?[l({...e.dateField,role:"date"},[])]:[],...(t=e.orderBy)!=null&&t.field?[l(f(e.orderBy.field,r),r?["dimension"]:[],{unsupportedRelatedRoleMessage:"Joined metric projections support related orderBy fields only when the same related field is declared in spec.dimensions.",recommendedNextStep:"Add the related field as a metric dimension when it should participate in the grouped result, or keep orderBy fields on the base source."})]:[]])}function Z(e){const r=[...e.rows,...e.columns||[]];return _([...r.map(o=>l(o.field,q(o.field))),...r.flatMap(o=>{var a;if(((a=o.sortBy)==null?void 0:a.by.kind)!=="field")return[];const t=o.sortBy.by.field,i=u(S(e),t);return[l(f(t,i),q(i),{unsupportedRelatedRoleMessage:"Joined matrix projections support related axis sort fields only when the same related field is used as a row/column axis.",recommendedNextStep:"Use a related field as a row or column axis, or keep axis sort fields on the base source."})]}),...e.values.map(o=>l(o.field,[],{unsupportedRelatedRoleMessage:"Joined matrix projections support related row/column dimensions or dates only. Related value fields are not supported in this phase.",recommendedNextStep:"Keep matrix values on the base source, or use governed SQL for unsupported aggregate-safe joined values."})),...(e.sort||[]).flatMap(o=>{if(o.by.kind!=="field")return[];const t=o.by.field,i=u(S(e),t);return[l(f(t,i),q(i),{unsupportedRelatedRoleMessage:"Joined matrix projections support related top-level sort fields only when the same related field is used as a row/column axis.",recommendedNextStep:"Use a related field as a row or column axis, or keep matrix sort fields on the base source."})]})])}function x(e){const r=e?p(e):void 0;return r==="dimension"?["dimension"]:r==="date"?["date"]:r==="id"?["id"]:["dimension","date","id"]}function q(e){const r=e?p(e):void 0;return r==="date"?["date"]:r==="dimension"?["dimension"]:[]}function l(e,r,o={}){return{field:f(e),allowedRelatedRoles:r,...o}}function _(e){const r=[];return e.forEach(o=>{r.some(t=>ee(t,o))||r.push(o)}),r}function B(e){const r=[...e.fields];return e.dateField&&!r.some(o=>T(o,e.dateField))&&r.push({...e.dateField,role:"date"}),r}function ee(e,r){return D(e.field,r.field)&&e.allowedRelatedRoles.join("|")===r.allowedRelatedRoles.join("|")&&(e.unsupportedRelatedRoleMessage||"")===(r.unsupportedRelatedRoleMessage||"")&&(e.recommendedNextStep||"")===(r.recommendedNextStep||"")}function T(e,r){return v.semaphorFieldRefsMatch(e,r)}function D(e,r){return T(e,r)&&re(p(e),p(r))}function re(e,r){return!!(e&&(!r||e===r))}function p(e){return w(e)}function oe(e){const r=e.split(".");return r.length===4&&r[0]==="spec"&&(r[1]==="rows"||r[1]==="columns")&&b(r[2])&&r[3]==="field"}function te(e){const r=e.split(".");return r.length===6&&r[0]==="spec"&&(r[1]==="rows"||r[1]==="columns")&&b(r[2])&&r[3]==="sortBy"&&r[4]==="by"&&r[5]==="field"||r.length===5&&r[0]==="spec"&&r[1]==="sort"&&b(r[2])&&r[3]==="by"&&r[4]==="field"}function b(e){return e===void 0||e.trim()===""?!1:Number.isInteger(Number(e))&&Number(e)>=0}function ie({intent:e,field:r,relativePath:o,baseCatalog:t,fieldCatalogs:i}){const a=g(r,e.source),s=v.semaphorSourcesReferToSameDataset(a,e.source);if(!s&&!se(e.source,a))return{ok:!1,code:"invalid_source_ref",message:`Field "${r.name}" references a related Semaphor source outside the query's semantic domain.`,pathSuffix:".source",source:a};const n=s?t:k(i,a);if(!n)return{ok:!1,code:"invalid_source_ref",message:`Field "${r.name}" references a Semaphor source that is not present in the visible field catalog.`,pathSuffix:".source",source:a};const d=I(n,r,e.source);return d?!s&&!ae({intent:e,field:r,catalogField:d,relativePath:o})?{ok:!1,code:"unsupported_joined_projection",message:`Field "${r.name}" references a related Semaphor source, but this query kind does not support joined projections for that field yet.`,pathSuffix:".source",source:a}:{ok:!0,source:a,catalogField:d,usesBaseSource:s}:{ok:!1,code:"missing_field",message:`Field "${r.name}" is not visible on the selected Semaphor source.`,source:a}}function ae({intent:e,field:r,catalogField:o,relativePath:t}){return W({intent:e,field:r,catalogField:o,relativePath:t})}function se(e,r){return e.kind==="semantic"&&r.kind==="semantic"&&e.domainId===r.domainId}function k(e,r){return e.find(o=>$(o,r))}function I(e,r,o){const t=g(r,o);if($(e,t))return e.fields.find(i=>ne(i,r)&&$(e,g(i,e.source)))}function C(e){return R.normalizeAnalyticsCatalogName(e)}function g(e,r){return e.source||r}function $(e,r){return[e.source,...e.sourceAliases||[]].some(o=>v.semaphorSourcesReferToSameDataset(o,r))}function ne(e,r){return!!(e.name&&r.name&&e.name===r.name)}function z(e,r={}){const o=r.pathPrefix||"analysisOptions";if(e===void 0)return{ok:!0};if(!e||typeof e!="object"||Array.isArray(e))return c(o,"Data App analysis options must be an object.");const t=e,i={};if(t.chartTitle!==void 0){if(typeof t.chartTitle!="string")return c(`${o}.chartTitle`,'Data App analysis option "chartTitle" must be a string.');i.chartTitle=t.chartTitle}if(t.chartType!==void 0){if(typeof t.chartType!="string")return c(`${o}.chartType`,'Data App analysis option "chartType" must be a string.');i.chartType=t.chartType}if(t.driverMode!==void 0){if(!ce(t.driverMode))return c(`${o}.driverMode`,'Data App analysis option "driverMode" must be absolute_delta, largest_negative, largest_positive, positive_and_negative, or all.');i.driverMode=t.driverMode}if(t.includePopulation!==void 0){if(typeof t.includePopulation!="boolean")return c(`${o}.includePopulation`,'Data App analysis option "includePopulation" must be a boolean.');i.includePopulation=t.includePopulation}if(t.calendarContext!==void 0){const a=fe(t.calendarContext,{pathPrefix:`${o}.calendarContext`,validateTimezone:r.validateTimezone});if(!a.ok)return a;i.calendarContext=a.calendarContext}return{ok:!0,analysisOptions:i}}function de(e){const r=e.queries.map((i,a)=>le(i,a,{fieldCatalogs:e.fieldCatalogs||[],requireFieldCatalog:!!e.requireFieldCatalog,validateTimezone:e.validateTimezone})),o=r.flatMap(i=>i.diagnostics),t=r.map(i=>i.executionResult);return{ok:o.every(i=>i.severity!=="error"),diagnostics:o,queries:r,intents:r.flatMap(i=>i.intent?[i.intent]:[]),executionResults:t}}function le(e,r,o){const t=`queries.${r}`;try{const i=pe(e),a=$e(e,i),s=E.validateSemaphorAnalyticsIntent(i),n=[...ke({querySpec:e,queryId:a,intent:i,pathPrefix:t}),...s.errors.map(h=>P(h,{queryHook:e.queryHook,queryId:a,pathPrefix:t,severity:"error",intent:i})),...s.warnings.map(h=>P(h,{queryHook:e.queryHook,queryId:a,pathPrefix:t,severity:"warning",intent:i})),...ye({querySpec:e,queryId:a,intent:i,pathPrefix:t,fieldCatalogs:o.fieldCatalogs,requireFieldCatalog:o.requireFieldCatalog}),...Ie({querySpec:e,queryId:a,intent:i,pathPrefix:t,validateTimezone:o.validateTimezone})],d=be(s,n);return{queryHook:e.queryHook,queryId:a,intent:i,diagnostics:n,executionResult:j({intent:i,validation:d,diagnostics:n})}}catch(i){const a={severity:"error",code:"invalid_query_spec",message:i instanceof Error?i.message:String(i),path:t,queryHook:e.queryHook,queryId:Q(e.spec)},s=K([a]);return{queryHook:e.queryHook,queryId:a.queryId,diagnostics:[a],executionResult:j({validation:s,diagnostics:[a]})}}}function c(e,r){return{ok:!1,issues:[{code:"invalid_analysis_option",message:r,path:e}]}}function N(e){return!!(e&&typeof e=="object"&&!Array.isArray(e))}function ce(e){return e==="absolute_delta"||e==="largest_negative"||e==="largest_positive"||e==="positive_and_negative"||e==="all"}function ue(e){return e.trim().length>0&&!Number.isNaN(Date.parse(e))}function fe(e,r){var d;if(!e||typeof e!="object"||Array.isArray(e))return c(r.pathPrefix,'Data App analysis option "calendarContext" must be an object.');const o=e,t=o.tz,i=o.weekStart,a=o.anchor,s=a&&typeof a=="object"&&!Array.isArray(a)?a.iso:void 0,n=typeof t=="string"?((d=r.validateTimezone)==null?void 0:d.call(r,t))??t:null;return n?typeof i!="number"||!Number.isInteger(i)||i<0||i>6?c(`${r.pathPrefix}.weekStart`,'Data App analysis option "calendarContext.weekStart" must be an integer from 0 to 6.'):a!=="now"&&!(typeof s=="string"&&ue(s))?c(`${r.pathPrefix}.anchor`,'Data App analysis option "calendarContext.anchor" must be "now" or an object with a valid iso string.'):{ok:!0,calendarContext:{tz:n,weekStart:i,anchor:a}}:c(`${r.pathPrefix}.tz`,'Data App analysis option "calendarContext.tz" must be a valid timezone string.')}function pe(e){return me(e.spec)}function me(e){if(!N(e))throw new Error("useSemaphorQuery spec must be an object.");if(e.queryKind==="metric")return y.toSemaphorMetricIntent(e);if(e.queryKind==="analysis")return y.toSemaphorAnalysisIntent(e);if(e.queryKind==="records")return y.toSemaphorRecordsIntent(e);if(e.queryKind==="sql")return y.toSemaphorSqlIntent(e);if(e.queryKind==="matrix")return y.toSemaphorMatrixIntent(e);if(e.queryKind==="inputOptions")return y.toSemaphorInputOptionsIntent(e);throw new Error("useSemaphorQuery spec.queryKind must be metric, analysis, records, inputOptions, sql, or matrix.")}function ye(e){if(e.intent.kind==="sql")return[];if(e.fieldCatalogs.length===0&&!e.requireFieldCatalog)return[];const r=k(e.fieldCatalogs,e.intent.source);if(!r)return[{severity:"error",code:"invalid_source_ref",message:`Source ref for ${e.querySpec.queryHook} does not match a visible Semaphor source.`,path:`${e.pathPrefix}.spec.source`,queryHook:e.querySpec.queryHook,queryId:e.queryId,intentId:e.intent.id,source:e.intent.source}];const o=ge({...e,catalog:r}),t={...r,fields:[...r.fields,...Re(e.intent,r,e.intent.source)]};return[...o,...he({...e,fieldCatalogs:e.fieldCatalogs}),...ve({...e,catalog:t,fieldCatalogs:e.fieldCatalogs}),...qe({...e,catalog:t,fieldCatalogs:e.fieldCatalogs})]}function he(e){var o;if(e.intent.kind!=="inputOptions"||((o=e.intent.population)==null?void 0:o.kind)!=="related_population")return[];const r=e.intent.population.baseSource;return k(e.fieldCatalogs,r)?[]:[{severity:"error",code:"invalid_source_ref",message:"Input options related population baseSource does not match a visible Semaphor source.",path:`${e.pathPrefix}.spec.population.baseSource`,queryHook:e.querySpec.queryHook,queryId:e.queryId,intentId:e.intent.id,source:r}]}function ge(e){const r=O(e.intent);if(r.length===0)return[];const o=[],t=new Set;return r.forEach((i,a)=>{const s=`${e.pathPrefix}.spec.derivedFields.${a}`,n=C(i.name);n&&(t.has(n)&&o.push({severity:"error",code:"duplicate_derived_field",message:`Derived field "${i.name}" is declared more than once.`,path:`${s}.name`,queryHook:e.querySpec.queryHook,queryId:e.queryId,intentId:e.intent.id,source:e.intent.source}),t.add(n),e.catalog.fields.some(d=>C(d.name)===n)&&o.push({severity:"error",code:"derived_field_name_collision",message:`Derived field "${i.name}" conflicts with a field already visible on the selected Semaphor source.`,path:`${s}.name`,queryHook:e.querySpec.queryHook,queryId:e.queryId,intentId:e.intent.id,source:e.intent.source})),Object.entries(i.inputs||{}).forEach(([d,h])=>{const m=xe(h);if(!m)return;const F=g(m,e.intent.source);if(!v.semaphorSourcesReferToSameDataset(F,e.intent.source)){o.push({severity:"error",code:"unsupported_derived_field_source",message:`Derived field "${i.name}" input "${d}" references a different Semaphor source. App-local derived fields must use fields from the query source.`,path:`${s}.inputs.${d}`,queryHook:e.querySpec.queryHook,queryId:e.queryId,intentId:e.intent.id,source:F,field:m});return}I(e.catalog,m,e.intent.source)||o.push({severity:"error",code:"missing_field",message:`Derived field "${i.name}" input "${d}" references field "${m.name}", which is not visible on the selected Semaphor source.`,path:`${s}.inputs.${d}`,queryHook:e.querySpec.queryHook,queryId:e.queryId,intentId:e.intent.id,source:F,field:m})})}),o}function ve(e){return Fe(e.intent).flatMap(({field:r,path:o})=>{const t=ie({intent:e.intent,field:r,relativePath:o,baseCatalog:e.catalog,fieldCatalogs:e.fieldCatalogs});return t.ok?[]:[{severity:"error",code:t.code,message:t.message,path:`${e.pathPrefix}.${o}${t.pathSuffix||""}`,queryHook:e.querySpec.queryHook,queryId:e.queryId,intentId:e.intent.id,source:t.source,field:r}]})}function qe(e){return("inputs"in e.intent?e.intent.inputs||[]:[]).flatMap((o,t)=>{if(!o.field)return[];const i=g(o.field,e.intent.source);if(!v.semaphorSourcesReferToSameDataset(i,e.intent.source)){if(Se(e.intent,i)){const a=k(e.fieldCatalogs,i);return a?I(a,o.field,i)?[]:[{severity:"error",code:"missing_field",message:`Input "${o.inputId}" references field "${o.field.name}", which is not visible on the selected Semaphor source.`,path:`${e.pathPrefix}.spec.inputs.${t}.field`,queryHook:e.querySpec.queryHook,queryId:e.queryId,intentId:e.intent.id,source:i,field:o.field}]:[{severity:"error",code:"invalid_source_ref",message:`Input "${o.inputId}" references a Semaphor source that is not present in the visible field catalog.`,path:`${e.pathPrefix}.spec.inputs.${t}.field.source`,queryHook:e.querySpec.queryHook,queryId:e.queryId,intentId:e.intent.id,source:i,field:o.field}]}return[{severity:"error",code:"unsupported_input_filter_composition",message:`Input "${o.inputId}" filters a different Semaphor source than the query, and no relationship-aware semantic validation path is available for this query kind.`,path:`${e.pathPrefix}.spec.inputs.${t}.field`,queryHook:e.querySpec.queryHook,queryId:e.queryId,intentId:e.intent.id,source:i,field:o.field}]}return I(e.catalog,o.field,e.intent.source)?[]:[{severity:"error",code:"missing_field",message:`Input "${o.inputId}" references field "${o.field.name}", which is not visible on the selected Semaphor source.`,path:`${e.pathPrefix}.spec.inputs.${t}.field`,queryHook:e.querySpec.queryHook,queryId:e.queryId,intentId:e.intent.id,source:i,field:o.field}]})}function Se(e,r){return e.source.kind==="semantic"&&r.kind==="semantic"&&r.domainId===e.source.domainId}function Ie(e){if(e.querySpec.spec.queryKind!=="analysis")return[];const r=z(e.querySpec.spec,{pathPrefix:`${e.pathPrefix}.spec`,validateTimezone:e.validateTimezone});return r.ok?[]:r.issues.map(o=>({severity:"error",code:o.code,message:o.message,path:o.path,queryHook:e.querySpec.queryHook,queryId:e.queryId,intentId:e.intent.id,source:e.intent.source}))}function ke(e){return e.querySpec.spec.queryKind!=="sql"?[]:N(e.querySpec.spec)?Object.prototype.hasOwnProperty.call(e.querySpec.spec,"parameters")?[{severity:"error",code:"deprecated_sql_parameters",message:"semaphor.sql uses defaultParameters for static SQL param(...) fallback values. The legacy parameters field is not supported.",path:`${e.pathPrefix}.spec.parameters`,queryHook:e.querySpec.queryHook,queryId:e.queryId,intentId:e.intent.id}]:[]:[]}function Fe(e){return e.kind==="metric"?[...e.measures.map((r,o)=>({field:r,path:`spec.measures.${o}`})),...e.primaryMeasure?[{field:e.primaryMeasure,path:"spec.primaryMeasure"}]:[],...e.dateField?[{field:e.dateField,path:"spec.dateField"}]:[],...(e.dimensions||[]).map((r,o)=>({field:r,path:`spec.dimensions.${o}`})),...e.orderBy?[{field:e.orderBy.field,path:"spec.orderBy.field"}]:[],...(e.filters||[]).map((r,o)=>({field:r.field,path:`spec.filters.${o}.field`}))]:e.kind==="records"?[...e.fields.map((r,o)=>({field:r,path:`spec.fields.${o}`})),...e.dateField?[{field:e.dateField,path:"spec.dateField"}]:[],...e.orderBy?[{field:e.orderBy.field,path:"spec.orderBy.field"}]:[],...(e.filters||[]).map((r,o)=>({field:r.field,path:`spec.filters.${o}.field`}))]:e.kind==="inputOptions"?[{field:e.labelField,path:"spec.labelField"},{field:e.valueField,path:"spec.valueField"},...e.searchField?[{field:e.searchField,path:"spec.searchField"}]:[],...(e.disambiguationFields||[]).map((r,o)=>({field:r,path:`spec.disambiguationFields.${o}`}))]:e.kind==="matrix"?[...e.rows.map((r,o)=>({field:r.field,path:`spec.rows.${o}.field`})),...e.rows.flatMap((r,o)=>{var t;return((t=r.sortBy)==null?void 0:t.by.kind)==="field"?[{field:r.sortBy.by.field,path:`spec.rows.${o}.sortBy.by.field`}]:[]}),...(e.columns||[]).map((r,o)=>({field:r.field,path:`spec.columns.${o}.field`})),...(e.columns||[]).flatMap((r,o)=>{var t;return((t=r.sortBy)==null?void 0:t.by.kind)==="field"?[{field:r.sortBy.by.field,path:`spec.columns.${o}.sortBy.by.field`}]:[]}),...e.values.map((r,o)=>({field:r.field,path:`spec.values.${o}.field`})),...(e.sort||[]).flatMap((r,o)=>r.by.kind==="field"?[{field:r.by.field,path:`spec.sort.${o}.by.field`}]:[]),...(e.filters||[]).map((r,o)=>({field:r.field,path:`spec.filters.${o}.field`}))]:[]}function O(e){return!("derivedFields"in e)||!Array.isArray(e.derivedFields)?[]:e.derivedFields}function Re(e,r,o){return O(e).map(t=>({name:t.name,label:t.label,role:t.resultRole,dataType:t.dataType,source:r.source||o,...t.defaultAggregate?{aggregate:t.defaultAggregate}:{}}))}function xe(e){if(!(!e||typeof e!="object"))return e.field}function P(e,r){return{severity:r.severity,code:e.code||"invalid_analytics_intent",message:e.message,path:e.path?`${r.pathPrefix}.spec.${e.path}`:r.pathPrefix,queryHook:r.queryHook,queryId:r.queryId,intentId:r.intent.id,source:r.intent.source}}function be(e,r){const o=K(r);return{ok:o.ok&&e.ok,errors:H([...e.errors,...o.errors]),warnings:H([...e.warnings,...o.warnings]),repairHints:[...e.repairHints,...o.repairHints]}}function K(e){const r=e.filter(t=>t.severity==="error").map(A),o=e.filter(t=>t.severity==="warning").map(A);return{ok:r.length===0,errors:r,warnings:o,repairHints:r.map(t=>{var i,a;return{code:t.code,message:t.message,fieldRole:t.fieldRole,invalidField:(i=t.repairHint)==null?void 0:i.invalidField,recommendedNextStep:((a=t.repairHint)==null?void 0:a.recommendedNextStep)||"Update the Data App SDK query spec to use visible Semaphor source and field refs."}})}}function A(e){var r;return{code:e.code,message:e.message,path:e.path,fieldRole:e.code==="invalid_source_ref"?"source":void 0,repairHint:{code:e.code,message:e.message,invalidField:(r=e.field)==null?void 0:r.name,fieldRole:e.code==="invalid_source_ref"?"source":void 0,recommendedNextStep:e.code==="unsupported_input_filter_composition"?"Use an input field from the same Semaphor source as the query, or split the query into separate source-scoped queries.":"Update the query spec to use a visible Semaphor source and field ref."}}}function H(e){const r=new Set;return e.filter(o=>{const t=`${o.code}:${o.path||""}:${o.message}`;return r.has(t)?!1:(r.add(t),!0)})}function j(e){var o,t;const r=e.diagnostics.filter(i=>i.severity==="error");return{intentId:(o=e.intent)==null?void 0:o.id,status:r.length?"failed":"answered",resultShape:(t=e.intent)==null?void 0:t.kind,intent:e.intent,validation:e.validation,coverage:{answeredObligations:r.length?[]:["query_spec_validation"],missingObligations:r.length?["query_spec_validation"]:[],warnings:e.validation.warnings},missingFields:r.filter(i=>i.code==="missing_field").flatMap(i=>{var a;return(a=i.field)!=null&&a.name?[i.field.name]:[]}),warnings:e.diagnostics.filter(i=>i.severity==="warning").map(i=>i.message),metadata:{validationKind:"data_app_sdk_query_spec"}}}function $e(e,r){return r.id||Q(e.spec)}function Q(e){if(!e||typeof e!="object"||!("id"in e))return;const r=e.id;return typeof r=="string"&&r.trim()?r:void 0}exports.fieldWithSelectedProjectionRole=f;exports.findMatchingRelatedProjectionField=u;exports.isAllowedRelatedProjectionRole=M;exports.matrixAxisFieldsForPolicy=S;exports.normalizeSemaphorAnalysisQueryOptions=z;exports.normalizeSemaphorFieldRole=w;exports.relatedProjectionFieldCandidatesForIntent=J;exports.validateSemaphorDataAppQuerySpecs=de;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { b as O } from "../chunks/validators-
|
|
2
|
-
import "../chunks/analyze-result-contract-
|
|
3
|
-
import { s as K, b as q } from "../chunks/source-identity-Cv4Nm3TM.js";
|
|
1
|
+
import { b as O } from "../chunks/validators-CLzrE2N_.js";
|
|
2
|
+
import { s as K, I as q } from "../chunks/analyze-result-contract-Akysi2ML.js";
|
|
4
3
|
import { toSemaphorMetricIntent as Q, toSemaphorAnalysisIntent as E, toSemaphorRecordsIntent as J, toSemaphorSqlIntent as U, toSemaphorMatrixIntent as W, toSemaphorInputOptionsIntent as L } from "../data-app-sdk-adapters/index.js";
|
|
5
4
|
import { n as A, b as V } from "../chunks/catalog-field-grounding-CJKAqtiC.js";
|
|
6
5
|
function G({
|
|
@@ -25,7 +24,7 @@ function G({
|
|
|
25
24
|
i.allowedRelatedRoles
|
|
26
25
|
) ? n === s : !1;
|
|
27
26
|
}
|
|
28
|
-
function
|
|
27
|
+
function Te(e) {
|
|
29
28
|
return e.kind === "records" ? oe(e) : e.kind === "metric" ? te(e) : ie(e);
|
|
30
29
|
}
|
|
31
30
|
function H(e) {
|
|
@@ -279,13 +278,13 @@ function f(e) {
|
|
|
279
278
|
}
|
|
280
279
|
function ne(e) {
|
|
281
280
|
const r = e.split(".");
|
|
282
|
-
return r.length === 4 && r[0] === "spec" && (r[1] === "rows" || r[1] === "columns") &&
|
|
281
|
+
return r.length === 4 && r[0] === "spec" && (r[1] === "rows" || r[1] === "columns") && x(r[2]) && r[3] === "field";
|
|
283
282
|
}
|
|
284
283
|
function de(e) {
|
|
285
284
|
const r = e.split(".");
|
|
286
|
-
return r.length === 6 && r[0] === "spec" && (r[1] === "rows" || r[1] === "columns") &&
|
|
285
|
+
return r.length === 6 && r[0] === "spec" && (r[1] === "rows" || r[1] === "columns") && x(r[2]) && r[3] === "sortBy" && r[4] === "by" && r[5] === "field" || r.length === 5 && r[0] === "spec" && r[1] === "sort" && x(r[2]) && r[3] === "by" && r[4] === "field";
|
|
287
286
|
}
|
|
288
|
-
function
|
|
287
|
+
function x(e) {
|
|
289
288
|
return e === void 0 || e.trim() === "" ? !1 : Number.isInteger(Number(e)) && Number(e) >= 0;
|
|
290
289
|
}
|
|
291
290
|
function le({
|
|
@@ -357,13 +356,13 @@ function ue(e, r) {
|
|
|
357
356
|
return e.kind === "semantic" && r.kind === "semantic" && e.domainId === r.domainId;
|
|
358
357
|
}
|
|
359
358
|
function S(e, r) {
|
|
360
|
-
return e.find((o) =>
|
|
359
|
+
return e.find((o) => b(o, r));
|
|
361
360
|
}
|
|
362
361
|
function v(e, r, o) {
|
|
363
362
|
const t = h(r, o);
|
|
364
|
-
if (
|
|
363
|
+
if (b(e, t))
|
|
365
364
|
return e.fields.find(
|
|
366
|
-
(i) => fe(i, r) &&
|
|
365
|
+
(i) => fe(i, r) && b(
|
|
367
366
|
e,
|
|
368
367
|
h(i, e.source)
|
|
369
368
|
)
|
|
@@ -375,7 +374,7 @@ function $(e) {
|
|
|
375
374
|
function h(e, r) {
|
|
376
375
|
return e.source || r;
|
|
377
376
|
}
|
|
378
|
-
function
|
|
377
|
+
function b(e, r) {
|
|
379
378
|
return [e.source, ...e.sourceAliases || []].some(
|
|
380
379
|
(o) => q(o, r)
|
|
381
380
|
);
|
|
@@ -439,7 +438,7 @@ function pe(e, r = {}) {
|
|
|
439
438
|
}
|
|
440
439
|
return { ok: !0, analysisOptions: i };
|
|
441
440
|
}
|
|
442
|
-
function
|
|
441
|
+
function De(e) {
|
|
443
442
|
const r = e.queries.map(
|
|
444
443
|
(i, a) => me(i, a, {
|
|
445
444
|
fieldCatalogs: e.fieldCatalogs || [],
|
|
@@ -644,7 +643,7 @@ function Se(e) {
|
|
|
644
643
|
catalog: t,
|
|
645
644
|
fieldCatalogs: e.fieldCatalogs
|
|
646
645
|
}),
|
|
647
|
-
...
|
|
646
|
+
...xe({
|
|
648
647
|
...e,
|
|
649
648
|
catalog: t,
|
|
650
649
|
fieldCatalogs: e.fieldCatalogs
|
|
@@ -753,13 +752,13 @@ function Fe(e) {
|
|
|
753
752
|
];
|
|
754
753
|
});
|
|
755
754
|
}
|
|
756
|
-
function
|
|
755
|
+
function xe(e) {
|
|
757
756
|
return ("inputs" in e.intent ? e.intent.inputs || [] : []).flatMap((o, t) => {
|
|
758
757
|
if (!o.field)
|
|
759
758
|
return [];
|
|
760
759
|
const i = h(o.field, e.intent.source);
|
|
761
760
|
if (!q(i, e.intent.source)) {
|
|
762
|
-
if (
|
|
761
|
+
if (be(e.intent, i)) {
|
|
763
762
|
const a = S(e.fieldCatalogs, i);
|
|
764
763
|
return a ? v(a, o.field, i) ? [] : [
|
|
765
764
|
{
|
|
@@ -816,7 +815,7 @@ function be(e) {
|
|
|
816
815
|
];
|
|
817
816
|
});
|
|
818
817
|
}
|
|
819
|
-
function
|
|
818
|
+
function be(e, r) {
|
|
820
819
|
return e.source.kind === "semantic" && r.kind === "semantic" && r.domainId === e.source.domainId;
|
|
821
820
|
}
|
|
822
821
|
function Re(e) {
|
|
@@ -1070,6 +1069,6 @@ export {
|
|
|
1070
1069
|
k as matrixAxisFieldsForPolicy,
|
|
1071
1070
|
pe as normalizeSemaphorAnalysisQueryOptions,
|
|
1072
1071
|
H as normalizeSemaphorFieldRole,
|
|
1073
|
-
|
|
1074
|
-
|
|
1072
|
+
Te as relatedProjectionFieldCandidatesForIntent,
|
|
1073
|
+
De as validateSemaphorDataAppQuerySpecs
|
|
1075
1074
|
};
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./chunks/index-Beol8cOo.js"),d=require("./chunks/common-types-C73-Ud1-.js"),N=require("./chunks/calendar-preferences-dialog-Rq9qiG3X.js"),t=require("react/jsx-runtime"),a=require("./chunks/switch--FHwRAOL.js"),C=require("react"),y=require("./types/index.cjs"),r=require("./chunks/dashboard-briefing-launcher-D_P0cNQ_.js"),P=require("./chunks/use-debounced-dirty-check-XHSwAefL.js");require("./chunks/analyze-result-contract-CL97m8X8.js");require("react-dom");require("./chunks/index-DRlMUglg.js");const S=require("./chunks/normalize-dashboard-for-dirty-check-BXRUMVb2.js"),_=require("./chunks/x-B6ghREd2.js");function R(i){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(i){for(const n in i)if(n!=="default"){const u=Object.getOwnPropertyDescriptor(i,n);Object.defineProperty(o,n,u.get?u:{enumerable:!0,get:()=>i[n]})}}return o.default=i,Object.freeze(o)}const h=R(C);function w(i){const{displayPreferences:o,cardId:n,...u}=i,s={...u,id:i.dashboardId};return t.jsx(e.ErrorBoundary,{FallbackComponent:e.Fallback,children:t.jsxs(e.SemaphorContextProvider,{dashboardProps:s,children:[t.jsx(e.SemaphorReadyIndicator,{componentType:"visual",componentId:i.cardId}),t.jsx(e.UXProvider,{appearance:i.appearance,children:t.jsx(e.DisplayPreferencesProvider,{displayPreferences:o,children:t.jsx(e.Container,{type:"visual",cardId:n,...s,children:t.jsx(j,{cardId:n})})})})]})})}function j({cardId:i}){const o=a.useDashboardStore(s=>{var c;return(c=s.dashboard)==null?void 0:c.sheets}),{card:n,frame:u}=C.useMemo(()=>{const s=o==null?void 0:o.flatMap(l=>l.frames),c=s==null?void 0:s.flatMap(l=>l==null?void 0:l.cards),D=c==null?void 0:c.find(l=>(l==null?void 0:l.id)===i),E=s==null?void 0:s.find(l=>{var p;return(p=l==null?void 0:l.cards)==null?void 0:p.find(g=>(g==null?void 0:g.id)===i)});return{card:D,frame:E}},[o,i]);return!n||!u?t.jsx(e.FallbackVisual,{error:new Error("Card not found"),resetErrorBoundary:()=>{},customerFacingMessage:`Card not found with ID: ${i}`}):t.jsx("main",{className:"flex h-full grow flex-col",children:t.jsx(e.ErrorBoundary,{FallbackComponent:({error:s,resetErrorBoundary:c})=>t.jsx(e.FallbackVisual,{error:s,resetErrorBoundary:c,customerFacingMessage:"Error creating visual. Please try again."}),children:t.jsx(e.DashboardCard,{card:n,frame:u})})})}function L(i,o,n,u){C.useEffect(()=>{i&&!n&&o&&u(e.cloneDeep(o))},[i,n,o,u])}function M({name:i,items:o,value:n,onChange:u,isLoading:s,isError:c,refetch:D,className:E,icon:l,showNone:p=!1}){const g=h.useRef(null),[b,T]=h.useState(!1),[B,A]=h.useState("100%"),x=p?[...o||[],{id:"none",name:"None"}]:o;h.useLayoutEffect(()=>{g.current&&A(g.current.offsetWidth)},[]);function v(){var f;return s?"Loading...":c?"Error":n?(f=o==null?void 0:o.find(m=>m.id===n))==null?void 0:f.name:`Select ${i}`}function F(f,m){u(m),T(!1)}return t.jsxs(a.Popover,{open:b,onOpenChange:T,children:[t.jsx(a.PopoverTrigger,{asChild:!0,children:t.jsxs(a.Button,{ref:g,variant:"outline",role:"combobox","aria-expanded":b,className:a.cn("flex h-9 w-full justify-between",E),children:[t.jsxs("div",{className:"flex items-center gap-2",children:[l&&t.jsx("div",{className:"mr-2",children:l}),t.jsx("span",{className:"max-w-[150px] overflow-hidden truncate text-ellipsis whitespace-nowrap",children:v()})]}),t.jsx(_.ChevronDown,{className:"size-4 opacity-50"})]})}),t.jsx(a.PopoverContent,{className:"w-full p-0",style:{minWidth:B},children:t.jsxs(e.Command,{children:[t.jsxs("div",{className:"flex h-9 items-center justify-between border-b pr-1",children:[t.jsx(e.CommandInput,{className:"h-9",placeholder:"Search..."}),t.jsx(e.IconButton,{className:"h-7",onClick:D,children:t.jsx(e.RefreshCw,{className:a.cn("size-3.5 opacity-50",s&&"animate-spin")})})]}),t.jsxs(e.CommandList,{children:[t.jsxs(e.CommandEmpty,{children:["No ",i==null?void 0:i.toLowerCase()," found."]}),t.jsx(e.CommandGroup,{children:x==null?void 0:x.map(f=>t.jsx(e.CommandItem,{className:"overflow-x-auto",value:f.name,onSelect:m=>F(m,f.id),children:t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(a.Check,{className:a.cn("size-4",n===f.id?"opacity-100":"opacity-0")}),t.jsx("div",{title:f.name,children:f.name})]})},f.id))})]})]})})]})}function I(i,o){C.useEffect(()=>(i&&o&&(window.__SEMAPHOR_PRINT_STATE__={...o}),()=>{i&&window.__SEMAPHOR_PRINT_STATE__&&delete window.__SEMAPHOR_PRINT_STATE__}),[i,o])}exports.CardSummary=e.CardSummary;exports.Dashboard=e.Dashboard;exports.DashboardCreateDialogBase=e.DashboardCreateDialogBase;exports.DashboardExportDialog=e.DashboardExportDialog;exports.DashboardWC=e.DashboardWC;exports.ExportError=e.ExportError;exports.MatrixTableVisual=e.MatrixTableVisual;exports.ResourceType=e.ResourceType;exports.SemaphorContextProvider=e.SemaphorContextProvider;exports.SemaphorDataProvider=e.SemaphorQueryClient;exports.SemaphorQueryClient=e.SemaphorQueryClient;exports.ShareDialog=e.ShareDialog;exports.SummaryCard=e.SummaryCard;exports.Surfboard=e.DashboardPlus;exports.cancelExport=e.cancelExport;exports.cloneDeep=e.cloneDeep;exports.createExport=e.createExport;exports.downloadDocumentPdf=e.downloadDocumentPdf;exports.downloadPdf=e.downloadPdf;exports.formatFileSize=e.formatFileSize;exports.getDownloadUrl=e.getDownloadUrl;exports.getExportStatus=e.getExportStatus;exports.getExports=e.getExports;exports.isExportComplete=e.isExportComplete;exports.isExportInProgress=e.isExportInProgress;exports.useActiveExports=e.useActiveExports;exports.useAddNewFrame=e.useAddNewFrame;exports.useCard=e.useCard;exports.useCardSummary=e.useCardSummary;exports.useDashboardById=e.useDashboardById;exports.useDashboardQuery=e.useDashboardQuery;exports.useDashboardSummary=e.useDashboardSummary;exports.useDataColumns=e.useDataColumns;exports.useDateFilterHook=e.useDateFilterHook;exports.useEditorAside=e.useEditorAside;exports.useExportActions=e.useExportActions;exports.useExportStore=e.useExportStore;exports.useInProgressExportsCount=e.useInProgressExportsCount;exports.useManagementStore=e.useManagementStore;exports.useResourceManagement=e.useResourceManagement;exports.useTextFilterHook=e.useTextFilterHook;exports.CALCULATED_FIELD_ENTITY_MARKER=d.CALCULATED_FIELD_ENTITY_MARKER;exports.CONTROL_CARD_DEFAULT_VALUE=d.CONTROL_CARD_DEFAULT_VALUE;exports.DATE_FORMAT_VALUES=d.DATE_FORMAT_VALUES;exports.EMPTY_SELECTION=d.EMPTY_SELECTION;exports.PivotMarkerEnum=d.PivotMarkerEnum;exports.getFieldRuntimeColumnName=d.getFieldRuntimeColumnName;exports.hasCalculatedFieldMarker=d.hasCalculatedFieldMarker;exports.hasCalculatedFormulaInputs=d.hasCalculatedFormulaInputs;exports.isCalculatedDimension=d.isCalculatedDimension;exports.isCalculatedField=d.isCalculatedField;exports.isCalculatedMetric=d.isCalculatedMetric;exports.CalendarPreferencesDialog=N.CalendarPreferencesDialog;exports.createEmptyKpiConfig=a.createEmptyKpiConfig;exports.createSqlGenConfig=a.createSqlGenConfig;exports.emitDashboardLoad=a.emitDashboardLoad;exports.emitDashboardUnload=a.emitDashboardUnload;exports.fmt=a.fmt;exports.getColumnDataType=a.getColumnDataType;exports.getFilterValueType=a.getFilterValueType;exports.getFormattedTableNameForQuery=a.getFormattedTableNameForQuery;exports.getQualifiedTableName=a.getQualifiedTableName;exports.getSql=a.getSql;exports.invalidateToken=a.invalidateToken;exports.isBooleanDataType=a.isBooleanDataType;exports.isColumnInSqlGen=a.isColumnInSqlGen;exports.isDateDataType=a.isDateDataType;exports.isNumberDataType=a.isNumberDataType;exports.isTextDataType=a.isTextDataType;exports.resolveDataType=a.resolveDataType;exports.resolveDatamodelName=a.resolveDatamodelName;exports.useCurrentActiveCard=a.useCurrentActiveCard;exports.useCurrentCardConfig=a.useCurrentCardConfig;exports.useCurrentSheetActiveCards=a.useCurrentSheetActiveCards;exports.useDashboardActions=a.useDashboardActions;exports.useDashboardStore=a.useDashboardStore;exports.useEditorActions=a.useEditorActions;exports.useEditorStore=a.useEditorStore;exports.DEFAULT_CALENDAR_CONTEXT=y.DEFAULT_CALENDAR_CONTEXT;exports.DEFAULT_SEMANTIC_DOMAIN_ACCESS=y.DEFAULT_SEMANTIC_DOMAIN_ACCESS;exports.AdvancedModeToggle=r.AdvancedModeToggle;exports.BriefingAuthor=r.BriefingAuthor;exports.BriefingsApiError=r.BriefingsApiError;exports.DashboardBriefingLauncher=r.DashboardBriefingLauncher;exports.DashboardControlsSettings=r.DashboardControlsSettings;exports.DashboardFilterControlsButton=r.DashboardFilterControlsButton;exports.DashboardFilterControlsLauncher=r.DashboardFilterControlsLauncher;exports.DocumentControlsSettings=r.DocumentControlsSettings;exports.ExportNotificationItem=r.ExportNotificationItem;exports.ExportNotificationList=r.ExportNotificationList;exports.NotificationBell=r.NotificationBell;exports.UnsavedChangesAlert=r.UnsavedChangesAlert;exports.VisualEditingControls=r.VisualEditingControls;exports.VisualsLibraryDialog=r.VisualsLibraryDialog;exports.WatchDashboardButton=r.WatchDashboardButton;exports.applyBriefingFormPatch=r.applyBriefingFormPatch;exports.briefingFormDraftToCreateRequest=r.briefingFormDraftToCreateRequest;exports.briefingFormDraftToUpdateRequest=r.briefingFormDraftToUpdateRequest;exports.briefingToFormDraft=r.briefingToFormDraft;exports.cancelBriefingPreviewRun=r.cancelBriefingPreviewRun;exports.cancelBriefingRun=r.cancelBriefingRun;exports.createBriefing=r.createBriefing;exports.createBriefingFormDraft=r.createBriefingFormDraft;exports.deleteBriefing=r.deleteBriefing;exports.deleteBriefingRun=r.deleteBriefingRun;exports.getBriefing=r.getBriefing;exports.getBriefingArtifact=r.getBriefingArtifact;exports.getBriefingEvidence=r.getBriefingEvidence;exports.getBriefingPreviewRun=r.getBriefingPreviewRun;exports.getBriefingRun=r.getBriefingRun;exports.listBriefingRuns=r.listBriefingRuns;exports.listBriefingTenantSummaries=r.listBriefingTenantSummaries;exports.listBriefings=r.listBriefings;exports.pauseBriefing=r.pauseBriefing;exports.polishBriefingText=r.polishBriefingText;exports.previewBriefingPlan=r.previewBriefingPlan;exports.resumeBriefing=r.resumeBriefing;exports.runBriefingNow=r.runBriefingNow;exports.runBriefingPreview=r.runBriefingPreview;exports.updateBriefing=r.updateBriefing;exports.useExportPolling=r.useExportPolling;exports.useExportRecovery=r.useExportRecovery;exports.validateBriefingFormDraft=r.validateBriefingFormDraft;exports.useDebouncedDirtyCheck=P.useDebouncedDirtyCheck;exports.normalizeDashboardForDirtyCheck=S.normalizeDashboardForDirtyCheck;exports.serializeDashboardForDirtyCheck=S.serializeDashboardForDirtyCheck;exports.Combobox=M;exports.Visual=w;exports.useExposePrintState=I;exports.usePristineSnapshotInitializer=L;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./chunks/index-C8thRvkW.js"),d=require("./chunks/common-types-C73-Ud1-.js"),N=require("./chunks/calendar-preferences-dialog-CInkkhl_.js"),t=require("react/jsx-runtime"),a=require("./chunks/switch-BXuyni6l.js"),C=require("react"),y=require("./types/index.cjs"),r=require("./chunks/dashboard-briefing-launcher-B4OWNsVD.js"),P=require("./chunks/use-debounced-dirty-check-XHSwAefL.js");require("./chunks/analyze-result-contract-COjyJzYm.js");require("react-dom");require("./chunks/index-DRlMUglg.js");const S=require("./chunks/normalize-dashboard-for-dirty-check-BXRUMVb2.js"),_=require("./chunks/x-B6ghREd2.js");function R(i){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(i){for(const n in i)if(n!=="default"){const u=Object.getOwnPropertyDescriptor(i,n);Object.defineProperty(o,n,u.get?u:{enumerable:!0,get:()=>i[n]})}}return o.default=i,Object.freeze(o)}const h=R(C);function w(i){const{displayPreferences:o,cardId:n,...u}=i,s={...u,id:i.dashboardId};return t.jsx(e.ErrorBoundary,{FallbackComponent:e.Fallback,children:t.jsxs(e.SemaphorContextProvider,{dashboardProps:s,children:[t.jsx(e.SemaphorReadyIndicator,{componentType:"visual",componentId:i.cardId}),t.jsx(e.UXProvider,{appearance:i.appearance,children:t.jsx(e.DisplayPreferencesProvider,{displayPreferences:o,children:t.jsx(e.Container,{type:"visual",cardId:n,...s,children:t.jsx(j,{cardId:n})})})})]})})}function j({cardId:i}){const o=a.useDashboardStore(s=>{var c;return(c=s.dashboard)==null?void 0:c.sheets}),{card:n,frame:u}=C.useMemo(()=>{const s=o==null?void 0:o.flatMap(l=>l.frames),c=s==null?void 0:s.flatMap(l=>l==null?void 0:l.cards),D=c==null?void 0:c.find(l=>(l==null?void 0:l.id)===i),E=s==null?void 0:s.find(l=>{var p;return(p=l==null?void 0:l.cards)==null?void 0:p.find(g=>(g==null?void 0:g.id)===i)});return{card:D,frame:E}},[o,i]);return!n||!u?t.jsx(e.FallbackVisual,{error:new Error("Card not found"),resetErrorBoundary:()=>{},customerFacingMessage:`Card not found with ID: ${i}`}):t.jsx("main",{className:"flex h-full grow flex-col",children:t.jsx(e.ErrorBoundary,{FallbackComponent:({error:s,resetErrorBoundary:c})=>t.jsx(e.FallbackVisual,{error:s,resetErrorBoundary:c,customerFacingMessage:"Error creating visual. Please try again."}),children:t.jsx(e.DashboardCard,{card:n,frame:u})})})}function L(i,o,n,u){C.useEffect(()=>{i&&!n&&o&&u(e.cloneDeep(o))},[i,n,o,u])}function M({name:i,items:o,value:n,onChange:u,isLoading:s,isError:c,refetch:D,className:E,icon:l,showNone:p=!1}){const g=h.useRef(null),[b,T]=h.useState(!1),[B,A]=h.useState("100%"),x=p?[...o||[],{id:"none",name:"None"}]:o;h.useLayoutEffect(()=>{g.current&&A(g.current.offsetWidth)},[]);function v(){var f;return s?"Loading...":c?"Error":n?(f=o==null?void 0:o.find(m=>m.id===n))==null?void 0:f.name:`Select ${i}`}function F(f,m){u(m),T(!1)}return t.jsxs(a.Popover,{open:b,onOpenChange:T,children:[t.jsx(a.PopoverTrigger,{asChild:!0,children:t.jsxs(a.Button,{ref:g,variant:"outline",role:"combobox","aria-expanded":b,className:a.cn("flex h-9 w-full justify-between",E),children:[t.jsxs("div",{className:"flex items-center gap-2",children:[l&&t.jsx("div",{className:"mr-2",children:l}),t.jsx("span",{className:"max-w-[150px] overflow-hidden truncate text-ellipsis whitespace-nowrap",children:v()})]}),t.jsx(_.ChevronDown,{className:"size-4 opacity-50"})]})}),t.jsx(a.PopoverContent,{className:"w-full p-0",style:{minWidth:B},children:t.jsxs(e.Command,{children:[t.jsxs("div",{className:"flex h-9 items-center justify-between border-b pr-1",children:[t.jsx(e.CommandInput,{className:"h-9",placeholder:"Search..."}),t.jsx(e.IconButton,{className:"h-7",onClick:D,children:t.jsx(e.RefreshCw,{className:a.cn("size-3.5 opacity-50",s&&"animate-spin")})})]}),t.jsxs(e.CommandList,{children:[t.jsxs(e.CommandEmpty,{children:["No ",i==null?void 0:i.toLowerCase()," found."]}),t.jsx(e.CommandGroup,{children:x==null?void 0:x.map(f=>t.jsx(e.CommandItem,{className:"overflow-x-auto",value:f.name,onSelect:m=>F(m,f.id),children:t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(a.Check,{className:a.cn("size-4",n===f.id?"opacity-100":"opacity-0")}),t.jsx("div",{title:f.name,children:f.name})]})},f.id))})]})]})})]})}function I(i,o){C.useEffect(()=>(i&&o&&(window.__SEMAPHOR_PRINT_STATE__={...o}),()=>{i&&window.__SEMAPHOR_PRINT_STATE__&&delete window.__SEMAPHOR_PRINT_STATE__}),[i,o])}exports.CardSummary=e.CardSummary;exports.Dashboard=e.Dashboard;exports.DashboardCreateDialogBase=e.DashboardCreateDialogBase;exports.DashboardExportDialog=e.DashboardExportDialog;exports.DashboardWC=e.DashboardWC;exports.ExportError=e.ExportError;exports.MatrixTableVisual=e.MatrixTableVisual;exports.ResourceType=e.ResourceType;exports.SemaphorContextProvider=e.SemaphorContextProvider;exports.SemaphorDataProvider=e.SemaphorQueryClient;exports.SemaphorQueryClient=e.SemaphorQueryClient;exports.ShareDialog=e.ShareDialog;exports.SummaryCard=e.SummaryCard;exports.Surfboard=e.DashboardPlus;exports.cancelExport=e.cancelExport;exports.cloneDeep=e.cloneDeep;exports.createExport=e.createExport;exports.downloadDocumentPdf=e.downloadDocumentPdf;exports.downloadPdf=e.downloadPdf;exports.formatFileSize=e.formatFileSize;exports.getDownloadUrl=e.getDownloadUrl;exports.getExportStatus=e.getExportStatus;exports.getExports=e.getExports;exports.isExportComplete=e.isExportComplete;exports.isExportInProgress=e.isExportInProgress;exports.useActiveExports=e.useActiveExports;exports.useAddNewFrame=e.useAddNewFrame;exports.useCard=e.useCard;exports.useCardSummary=e.useCardSummary;exports.useDashboardById=e.useDashboardById;exports.useDashboardQuery=e.useDashboardQuery;exports.useDashboardSummary=e.useDashboardSummary;exports.useDataColumns=e.useDataColumns;exports.useDateFilterHook=e.useDateFilterHook;exports.useEditorAside=e.useEditorAside;exports.useExportActions=e.useExportActions;exports.useExportStore=e.useExportStore;exports.useInProgressExportsCount=e.useInProgressExportsCount;exports.useManagementStore=e.useManagementStore;exports.useResourceManagement=e.useResourceManagement;exports.useTextFilterHook=e.useTextFilterHook;exports.CALCULATED_FIELD_ENTITY_MARKER=d.CALCULATED_FIELD_ENTITY_MARKER;exports.CONTROL_CARD_DEFAULT_VALUE=d.CONTROL_CARD_DEFAULT_VALUE;exports.DATE_FORMAT_VALUES=d.DATE_FORMAT_VALUES;exports.EMPTY_SELECTION=d.EMPTY_SELECTION;exports.PivotMarkerEnum=d.PivotMarkerEnum;exports.getFieldRuntimeColumnName=d.getFieldRuntimeColumnName;exports.hasCalculatedFieldMarker=d.hasCalculatedFieldMarker;exports.hasCalculatedFormulaInputs=d.hasCalculatedFormulaInputs;exports.isCalculatedDimension=d.isCalculatedDimension;exports.isCalculatedField=d.isCalculatedField;exports.isCalculatedMetric=d.isCalculatedMetric;exports.CalendarPreferencesDialog=N.CalendarPreferencesDialog;exports.createEmptyKpiConfig=a.createEmptyKpiConfig;exports.createSqlGenConfig=a.createSqlGenConfig;exports.emitDashboardLoad=a.emitDashboardLoad;exports.emitDashboardUnload=a.emitDashboardUnload;exports.fmt=a.fmt;exports.getColumnDataType=a.getColumnDataType;exports.getFilterValueType=a.getFilterValueType;exports.getFormattedTableNameForQuery=a.getFormattedTableNameForQuery;exports.getQualifiedTableName=a.getQualifiedTableName;exports.getSql=a.getSql;exports.invalidateToken=a.invalidateToken;exports.isBooleanDataType=a.isBooleanDataType;exports.isColumnInSqlGen=a.isColumnInSqlGen;exports.isDateDataType=a.isDateDataType;exports.isNumberDataType=a.isNumberDataType;exports.isTextDataType=a.isTextDataType;exports.resolveDataType=a.resolveDataType;exports.resolveDatamodelName=a.resolveDatamodelName;exports.useCurrentActiveCard=a.useCurrentActiveCard;exports.useCurrentCardConfig=a.useCurrentCardConfig;exports.useCurrentSheetActiveCards=a.useCurrentSheetActiveCards;exports.useDashboardActions=a.useDashboardActions;exports.useDashboardStore=a.useDashboardStore;exports.useEditorActions=a.useEditorActions;exports.useEditorStore=a.useEditorStore;exports.DEFAULT_CALENDAR_CONTEXT=y.DEFAULT_CALENDAR_CONTEXT;exports.DEFAULT_SEMANTIC_DOMAIN_ACCESS=y.DEFAULT_SEMANTIC_DOMAIN_ACCESS;exports.AdvancedModeToggle=r.AdvancedModeToggle;exports.BriefingAuthor=r.BriefingAuthor;exports.BriefingsApiError=r.BriefingsApiError;exports.DashboardBriefingLauncher=r.DashboardBriefingLauncher;exports.DashboardControlsSettings=r.DashboardControlsSettings;exports.DashboardFilterControlsButton=r.DashboardFilterControlsButton;exports.DashboardFilterControlsLauncher=r.DashboardFilterControlsLauncher;exports.DocumentControlsSettings=r.DocumentControlsSettings;exports.ExportNotificationItem=r.ExportNotificationItem;exports.ExportNotificationList=r.ExportNotificationList;exports.NotificationBell=r.NotificationBell;exports.UnsavedChangesAlert=r.UnsavedChangesAlert;exports.VisualEditingControls=r.VisualEditingControls;exports.VisualsLibraryDialog=r.VisualsLibraryDialog;exports.WatchDashboardButton=r.WatchDashboardButton;exports.applyBriefingFormPatch=r.applyBriefingFormPatch;exports.briefingFormDraftToCreateRequest=r.briefingFormDraftToCreateRequest;exports.briefingFormDraftToUpdateRequest=r.briefingFormDraftToUpdateRequest;exports.briefingToFormDraft=r.briefingToFormDraft;exports.cancelBriefingPreviewRun=r.cancelBriefingPreviewRun;exports.cancelBriefingRun=r.cancelBriefingRun;exports.createBriefing=r.createBriefing;exports.createBriefingFormDraft=r.createBriefingFormDraft;exports.deleteBriefing=r.deleteBriefing;exports.deleteBriefingRun=r.deleteBriefingRun;exports.getBriefing=r.getBriefing;exports.getBriefingArtifact=r.getBriefingArtifact;exports.getBriefingEvidence=r.getBriefingEvidence;exports.getBriefingPreviewRun=r.getBriefingPreviewRun;exports.getBriefingRun=r.getBriefingRun;exports.listBriefingRuns=r.listBriefingRuns;exports.listBriefingTenantSummaries=r.listBriefingTenantSummaries;exports.listBriefings=r.listBriefings;exports.pauseBriefing=r.pauseBriefing;exports.polishBriefingText=r.polishBriefingText;exports.previewBriefingPlan=r.previewBriefingPlan;exports.resumeBriefing=r.resumeBriefing;exports.runBriefingNow=r.runBriefingNow;exports.runBriefingPreview=r.runBriefingPreview;exports.updateBriefing=r.updateBriefing;exports.useExportPolling=r.useExportPolling;exports.useExportRecovery=r.useExportRecovery;exports.validateBriefingFormDraft=r.validateBriefingFormDraft;exports.useDebouncedDirtyCheck=P.useDebouncedDirtyCheck;exports.normalizeDashboardForDirtyCheck=S.normalizeDashboardForDirtyCheck;exports.serializeDashboardForDirtyCheck=S.serializeDashboardForDirtyCheck;exports.Combobox=M;exports.Visual=w;exports.useExposePrintState=I;exports.usePristineSnapshotInitializer=L;
|
package/dist/index.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { E as T, F as N, S, q as P, U as w, r as _, s as F, t as x, v as R, w as M, h as I, i as L, I as k, x as U, j as O, k as V, l as z, m as q } from "./chunks/index-
|
|
2
|
-
import { X as fa, D as ma, V as pa, T as ha, O as ga, aa as Ca, M as Da, A as Ea, H as xa, H as Ta, J as ba, W as ya, a as va, a9 as Ba, a5 as Aa, Q as Na, P as Sa, ad as Pa, a8 as wa, a7 as _a, a6 as Fa, ac as Ra, ab as Ma, a2 as Ia, $ as La, N as ka, Z as Ua, L as Oa, z as Va, Y as za, _ as qa, B as Ha, a4 as Wa, a1 as ja, a0 as Ga, a3 as Qa, y as Ka, K as Xa, G as Ya } from "./chunks/index-
|
|
1
|
+
import { E as T, F as N, S, q as P, U as w, r as _, s as F, t as x, v as R, w as M, h as I, i as L, I as k, x as U, j as O, k as V, l as z, m as q } from "./chunks/index-C56DuHI8.js";
|
|
2
|
+
import { X as fa, D as ma, V as pa, T as ha, O as ga, aa as Ca, M as Da, A as Ea, H as xa, H as Ta, J as ba, W as ya, a as va, a9 as Ba, a5 as Aa, Q as Na, P as Sa, ad as Pa, a8 as wa, a7 as _a, a6 as Fa, ac as Ra, ab as Ma, a2 as Ia, $ as La, N as ka, Z as Ua, L as Oa, z as Va, Y as za, _ as qa, B as Ha, a4 as Wa, a1 as ja, a0 as Ga, a3 as Qa, y as Ka, K as Xa, G as Ya } from "./chunks/index-C56DuHI8.js";
|
|
3
3
|
import { a as Ja, C as Za, D as ae, E as ee, P as se, g as re, d as oe, h as te, b as ie, c as ne, i as le } from "./chunks/common-types-4bjoIgvm.js";
|
|
4
|
-
import { C as ue } from "./chunks/calendar-preferences-dialog-
|
|
4
|
+
import { C as ue } from "./chunks/calendar-preferences-dialog-BbuLgela.js";
|
|
5
5
|
import { jsx as a, jsxs as d } from "react/jsx-runtime";
|
|
6
|
-
import { u as H, P as W, a as j, B as G, c as C, b as Q, d as K } from "./chunks/switch-
|
|
7
|
-
import { D as fe, o as me, f as pe, g as he, h as ge, q as Ce, p as De, t as Ee, v as xe, n as Te, i as be, m as ye, r as ve, l as Be, k as Ae, j as Ne, w as Se, s as Pe, x as we, z as _e, y as Fe, A as Re, F as Me, E as Ie } from "./chunks/switch-
|
|
6
|
+
import { u as H, P as W, a as j, B as G, c as C, b as Q, d as K } from "./chunks/switch-Dsx-IwBE.js";
|
|
7
|
+
import { D as fe, o as me, f as pe, g as he, h as ge, q as Ce, p as De, t as Ee, v as xe, n as Te, i as be, m as ye, r as ve, l as Be, k as Ae, j as Ne, w as Se, s as Pe, x as we, z as _e, y as Fe, A as Re, F as Me, E as Ie } from "./chunks/switch-Dsx-IwBE.js";
|
|
8
8
|
import * as m from "react";
|
|
9
9
|
import { useMemo as X, useEffect as b } from "react";
|
|
10
10
|
import { DEFAULT_CALENDAR_CONTEXT as ke, DEFAULT_SEMANTIC_DOMAIN_ACCESS as Ue } from "./types/index.js";
|
|
11
|
-
import { A as Ve, L as ze, B as qe, M as He, D as We, e as je, f as Ge, d as Qe, b as Ke, E as Xe, N as Ye, U as $e, a as Je, V as Ze, W as as, G as es, I as ss, J as rs, H as os, s as ts, w as is, i as ns, F as ls, k as ds, x as us, h as cs, y as fs, z as ms, q as ps, v as hs, t as gs, g as Cs, l as Ds, p as Es, C as xs, n as Ts, r as bs, m as ys, o as vs, j as Bs, u as As, c as Ns, K as Ss } from "./chunks/dashboard-briefing-launcher-
|
|
11
|
+
import { A as Ve, L as ze, B as qe, M as He, D as We, e as je, f as Ge, d as Qe, b as Ke, E as Xe, N as Ye, U as $e, a as Je, V as Ze, W as as, G as es, I as ss, J as rs, H as os, s as ts, w as is, i as ns, F as ls, k as ds, x as us, h as cs, y as fs, z as ms, q as ps, v as hs, t as gs, g as Cs, l as Ds, p as Es, C as xs, n as Ts, r as bs, m as ys, o as vs, j as Bs, u as As, c as Ns, K as Ss } from "./chunks/dashboard-briefing-launcher-D7FNuDuc.js";
|
|
12
12
|
import { u as ws } from "./chunks/use-debounced-dirty-check-BwAbnX_5.js";
|
|
13
|
-
import "./chunks/analyze-result-contract-
|
|
13
|
+
import "./chunks/analyze-result-contract-Akysi2ML.js";
|
|
14
14
|
import "react-dom";
|
|
15
15
|
import "./chunks/index-CJdxSyQq.js";
|
|
16
16
|
import { n as Fs, s as Rs } from "./chunks/normalize-dashboard-for-dirty-check-5KpZN8xr.js";
|
package/dist/surfboard/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../chunks/index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../chunks/index-C8thRvkW.js"),e=require("../chunks/common-types-C73-Ud1-.js"),a=require("../chunks/calendar-preferences-dialog-CInkkhl_.js");exports.Surfboard=r.DashboardPlus;exports.CONTROL_CARD_DEFAULT_VALUE=e.CONTROL_CARD_DEFAULT_VALUE;exports.EMPTY_SELECTION=e.EMPTY_SELECTION;exports.CalendarPreferencesDialog=a.CalendarPreferencesDialog;
|
package/dist/surfboard/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { a as e } from "../chunks/index-
|
|
1
|
+
import { a as e } from "../chunks/index-C56DuHI8.js";
|
|
2
2
|
import { C, E } from "../chunks/common-types-4bjoIgvm.js";
|
|
3
|
-
import { C as s } from "../chunks/calendar-preferences-dialog-
|
|
3
|
+
import { C as s } from "../chunks/calendar-preferences-dialog-BbuLgela.js";
|
|
4
4
|
export {
|
|
5
5
|
C as CONTROL_CARD_DEFAULT_VALUE,
|
|
6
6
|
s as CalendarPreferencesDialog,
|
|
@@ -2188,6 +2188,7 @@ export declare type SemaphorDataAppCodegenExecutableView = {
|
|
|
2188
2188
|
sdkBuilder?: SemaphorDataAppCodegenSdkBuilder;
|
|
2189
2189
|
sdkSpec: SemaphorDataAppCodegenSdkSpec;
|
|
2190
2190
|
fields: SemaphorDataAppCodegenFieldRef[];
|
|
2191
|
+
metricBindingKeys?: string[];
|
|
2191
2192
|
computation?: SemaphorDataAppCodegenComputation;
|
|
2192
2193
|
uxExpectations?: string[];
|
|
2193
2194
|
validation?: SemaphorDataAppCodegenViewValidation;
|
|
@@ -3052,6 +3053,7 @@ export declare function semaphorMetricMeasureBindingKey(field: SemaphorFieldRef)
|
|
|
3052
3053
|
export declare type SemaphorMetricResult = SemaphorAnalyticsResultBase & {
|
|
3053
3054
|
kind: 'metric';
|
|
3054
3055
|
value: number | string | null;
|
|
3056
|
+
missingMeasures?: string[];
|
|
3055
3057
|
comparison?: {
|
|
3056
3058
|
kind: NonNullable<SemaphorMetricIntent['comparison']>['kind'];
|
|
3057
3059
|
value?: number | string | null;
|
|
@@ -3064,6 +3066,7 @@ export declare const semaphorMetricResultSchema: z.ZodObject<{
|
|
|
3064
3066
|
kind: z.ZodLiteral<"metric">;
|
|
3065
3067
|
value: z.ZodUnion<[z.ZodNumber, z.ZodString, z.ZodNull]>;
|
|
3066
3068
|
measures: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodNumber, z.ZodString, z.ZodNull]>>>;
|
|
3069
|
+
missingMeasures: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
3067
3070
|
comparison: z.ZodOptional<z.ZodObject<{
|
|
3068
3071
|
kind: z.ZodEnum<["previous_period", "previous_year", "target"]>;
|
|
3069
3072
|
value: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodString, z.ZodNull]>>;
|
|
@@ -3113,6 +3116,7 @@ export declare const semaphorMetricResultSchema: z.ZodObject<{
|
|
|
3113
3116
|
kind: z.ZodLiteral<"metric">;
|
|
3114
3117
|
value: z.ZodUnion<[z.ZodNumber, z.ZodString, z.ZodNull]>;
|
|
3115
3118
|
measures: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodNumber, z.ZodString, z.ZodNull]>>>;
|
|
3119
|
+
missingMeasures: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
3116
3120
|
comparison: z.ZodOptional<z.ZodObject<{
|
|
3117
3121
|
kind: z.ZodEnum<["previous_period", "previous_year", "target"]>;
|
|
3118
3122
|
value: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodString, z.ZodNull]>>;
|
|
@@ -3162,6 +3166,7 @@ export declare const semaphorMetricResultSchema: z.ZodObject<{
|
|
|
3162
3166
|
kind: z.ZodLiteral<"metric">;
|
|
3163
3167
|
value: z.ZodUnion<[z.ZodNumber, z.ZodString, z.ZodNull]>;
|
|
3164
3168
|
measures: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodNumber, z.ZodString, z.ZodNull]>>>;
|
|
3169
|
+
missingMeasures: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
3165
3170
|
comparison: z.ZodOptional<z.ZodObject<{
|
|
3166
3171
|
kind: z.ZodEnum<["previous_period", "previous_year", "target"]>;
|
|
3167
3172
|
value: z.ZodOptional<z.ZodUnion<[z.ZodNumber, z.ZodString, z.ZodNull]>>;
|
|
@@ -1337,6 +1337,7 @@ declare type SemaphorMetricIntent = {
|
|
|
1337
1337
|
declare type SemaphorMetricResult = SemaphorAnalyticsResultBase & {
|
|
1338
1338
|
kind: 'metric';
|
|
1339
1339
|
value: number | string | null;
|
|
1340
|
+
missingMeasures?: string[];
|
|
1340
1341
|
comparison?: {
|
|
1341
1342
|
kind: NonNullable<SemaphorMetricIntent['comparison']>['kind'];
|
|
1342
1343
|
value?: number | string | null;
|
|
@@ -211,6 +211,7 @@ declare type SemaphorDataAppCodegenExecutableView = {
|
|
|
211
211
|
sdkBuilder?: SemaphorDataAppCodegenSdkBuilder;
|
|
212
212
|
sdkSpec: SemaphorDataAppCodegenSdkSpec;
|
|
213
213
|
fields: SemaphorDataAppCodegenFieldRef[];
|
|
214
|
+
metricBindingKeys?: string[];
|
|
214
215
|
computation?: SemaphorDataAppCodegenComputation;
|
|
215
216
|
uxExpectations?: string[];
|
|
216
217
|
validation?: SemaphorDataAppCodegenViewValidation;
|
|
@@ -560,7 +561,7 @@ export declare type SemaphorDataAppContractGeneratorOptions = {
|
|
|
560
561
|
|
|
561
562
|
export declare type SemaphorDataAppContractUpdatePolicy = {
|
|
562
563
|
kind: string;
|
|
563
|
-
mode: 'invalid_update_constraints' | 'diagnostic_warning_fix' | 'metric_aggregate_override_edit' | 'general_iterative_update';
|
|
564
|
+
mode: 'invalid_update_constraints' | 'invalid_operation_kind' | 'diagnostic_warning_fix' | 'metric_aggregate_override_edit' | 'general_iterative_update';
|
|
564
565
|
reason: string;
|
|
565
566
|
allowedViewChangeReasons?: string[];
|
|
566
567
|
targetViewIds?: string[];
|
|
@@ -207,6 +207,7 @@ declare type SemaphorDataAppCodegenExecutableView = {
|
|
|
207
207
|
sdkBuilder?: SemaphorDataAppCodegenSdkBuilder;
|
|
208
208
|
sdkSpec: SemaphorDataAppCodegenSdkSpec;
|
|
209
209
|
fields: SemaphorDataAppCodegenFieldRef[];
|
|
210
|
+
metricBindingKeys?: string[];
|
|
210
211
|
computation?: SemaphorDataAppCodegenComputation;
|
|
211
212
|
uxExpectations?: string[];
|
|
212
213
|
validation?: SemaphorDataAppCodegenViewValidation;
|
|
@@ -550,7 +551,7 @@ declare type SemaphorDataAppCodegenVisualSpec = {
|
|
|
550
551
|
|
|
551
552
|
export declare type SemaphorDataAppContractUpdatePolicy = {
|
|
552
553
|
kind: string;
|
|
553
|
-
mode: 'invalid_update_constraints' | 'diagnostic_warning_fix' | 'metric_aggregate_override_edit' | 'general_iterative_update';
|
|
554
|
+
mode: 'invalid_update_constraints' | 'invalid_operation_kind' | 'diagnostic_warning_fix' | 'metric_aggregate_override_edit' | 'general_iterative_update';
|
|
554
555
|
reason: string;
|
|
555
556
|
allowedViewChangeReasons?: string[];
|
|
556
557
|
targetViewIds?: string[];
|
|
@@ -960,6 +960,7 @@ declare type SemaphorMetricQuerySpec = SemaphorQuerySourceSpec & SemaphorAppDeri
|
|
|
960
960
|
declare type SemaphorMetricResult = SemaphorAnalyticsResultBase & {
|
|
961
961
|
kind: 'metric';
|
|
962
962
|
value: number | string | null;
|
|
963
|
+
missingMeasures?: string[];
|
|
963
964
|
comparison?: {
|
|
964
965
|
kind: NonNullable<SemaphorMetricIntent['comparison']>['kind'];
|
|
965
966
|
value?: number | string | null;
|