react-semaphor 0.1.587 → 0.1.588
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.js +341 -338
- package/dist/assistant-context/index.js +1 -1
- package/dist/assistant-protocol/index.js +5 -5
- package/dist/brand-studio/index.js +8 -8
- package/dist/briefings/index.js +5 -5
- package/dist/chunks/{add-to-dashboard-DhP8wVtM.js → add-to-dashboard-C86FsM8D.js} +1 -1
- package/dist/chunks/{aggregate-measure-field-DsFXETpI.js → aggregate-measure-field-BrkXsSJp.js} +2 -2
- package/dist/chunks/{analytics-base-schemas-BaIQrEzX.js → analytics-base-schemas-8wz9vqn_.js} +173 -165
- package/dist/chunks/{assistant-chat-pfJK-T0b.js → assistant-chat-BeM6joPc.js} +19 -18
- package/dist/chunks/{bookmark-impact-BSpGQL1M.js → bookmark-impact-B7pbMx2e.js} +2 -2
- package/dist/chunks/{bookmark-state-CL4WEpgB.js → bookmark-state-Bn7k3ttp.js} +5 -5
- package/dist/chunks/{card-filter-builder-C8PbhHjq.js → card-filter-builder-DmodrhyI.js} +81 -81
- package/dist/chunks/{comparison-window-caption-CoART8BC.js → comparison-window-caption-fqijZdVd.js} +451 -395
- package/dist/chunks/{context-BTLBjQNh.js → context-CVXTFljo.js} +1 -1
- package/dist/chunks/{dashboard-CVj1oMoW.js → dashboard-Tu5wT0Cw.js} +1 -1
- package/dist/chunks/{dashboard-briefing-launcher-TqA58rKz.js → dashboard-briefing-launcher-D8jMxIJo.js} +249 -265
- package/dist/chunks/{dashboard-controls-DQ8FsxAz.js → dashboard-controls-uzeAIEkM.js} +65 -65
- package/dist/chunks/{dashboard-json-DM88pmk2.js → dashboard-json-i5rpFNCg.js} +5 -5
- package/dist/chunks/dates-BunbHJH0.js +115 -0
- package/dist/chunks/{edit-dashboard-visual-BpRnU_6G.js → edit-dashboard-visual-BpEK_Sls.js} +2357 -2344
- package/dist/chunks/{filter-line-Cu2u1K36.js → filter-line-Dza3ee4w.js} +5 -5
- package/dist/chunks/{filter-reach-copy-0Xp97cLk.js → filter-reach-copy-D5AmDHda.js} +944 -942
- package/dist/chunks/{filter-value-text-xefXzZlf.js → filter-value-text-DQw4v3nC.js} +6 -6
- package/dist/chunks/{index-D_QSeVKy.js → index-dGxJTaP1.js} +39 -39
- package/dist/chunks/{layout-grid-9nSS2SL-.js → layout-grid-XCYphks2.js} +1 -1
- package/dist/chunks/{list-filter-CfMPI6v4.js → list-filter-DGV3fqqv.js} +1 -1
- package/dist/chunks/{matrix-analytical-definition-DOVSFFuf.js → matrix-analytical-definition-SN0JUJVk.js} +3 -3
- package/dist/chunks/{matrix-member-presentation-BKDyxJho.js → matrix-member-presentation-DVBJR0MA.js} +1 -1
- package/dist/chunks/{matrix-operation-contract-BM5TveR3.js → matrix-operation-contract-JSmproo9.js} +15 -15
- package/dist/chunks/{metric-comparison-ZmurmEIs.js → metric-comparison-xE_J6hkg.js} +2 -2
- package/dist/chunks/{paintbrush-LzAje2ff.js → paintbrush-DEEZXhDj.js} +1 -1
- package/dist/chunks/{palette-DicJG0TC.js → palette-Bgy0H-Nt.js} +1 -1
- package/dist/chunks/{pivot-header-presentation-CdeTU96P.js → pivot-header-presentation-D-DfPAjb.js} +1 -1
- package/dist/chunks/{pivot-result-contract-expectations-Bx_BCu-7.js → pivot-result-contract-expectations-DbBahmgc.js} +545 -536
- package/dist/chunks/{pivot-result-identity-Bvs6Uq3v.js → pivot-result-identity-CUsMt_4r.js} +1 -1
- package/dist/chunks/{raw-temporal-value-DH-feMc2.js → raw-temporal-value-BnGCWJAL.js} +1 -1
- package/dist/chunks/{report-preferences-dialog-CXKmWyLm.js → report-preferences-dialog-CTM0xfd0.js} +14 -14
- package/dist/chunks/{report-runtime-context-NlOXwyRB.js → report-runtime-context-CrOgmuxO.js} +2 -2
- package/dist/chunks/{resolve-dashboard-input-context-zEXuitoF.js → resolve-dashboard-input-context-DFBIngUZ.js} +5617 -5485
- package/dist/chunks/{save-0wu1Z1U7.js → save-xnRCvMeA.js} +1 -1
- package/dist/chunks/{saved-dashboard-context-Cll5LipJ.js → saved-dashboard-context-DKMTP9ib.js} +17 -17
- package/dist/chunks/selection-filter-compiler-DkIjp1yH.js +131 -0
- package/dist/chunks/{semaphor-ready-indicator-Bnj3H0Dm.js → semaphor-ready-indicator-zU9reNmX.js} +45952 -45617
- package/dist/chunks/{shelf-drop-preview-context-B8rmn6BD.js → shelf-drop-preview-context-R9sf4oDX.js} +6 -6
- package/dist/chunks/{stored-dashboard-CURqJgoa.js → stored-dashboard-CksluF2S.js} +1539 -1404
- package/dist/chunks/{style-sheet-parts-_dGSFzDi.js → style-sheet-parts-D7NbsFL0.js} +3 -3
- package/dist/chunks/{table-export-sheet-Dmtqi5NV.js → table-export-sheet-ClSgERQC.js} +1 -1
- package/dist/chunks/{token-types-DEe_FP4l.js → token-types-DTocOcwt.js} +1 -1
- package/dist/chunks/{upload-CtyOkU_B.js → upload-BXGgYS4g.js} +1 -1
- package/dist/chunks/{validators-CJ8Jh0E8.js → validators-CrYXNnNE.js} +51 -49
- package/dist/chunks/{variable-draft-DIv-9y6Q.js → variable-draft-rbtGPvmX.js} +16 -14
- package/dist/chunks/visual-choice-DDfHfHvY.js +172 -0
- package/dist/dashboard/index.js +2 -2
- package/dist/dashboard-authoring/index.js +821 -791
- package/dist/format-utils/index.js +162 -158
- package/dist/index.js +21 -21
- package/dist/report-runtime-context/index.js +2 -2
- package/dist/style.css +1 -1
- package/dist/surfboard/index.js +2 -2
- package/dist/types/index.js +5 -5
- package/dist/types/lib/dashboard-view-state/card-view-state.d.ts +39 -2
- package/dist/types/lib/dashboard-view-state/date-zoom.d.ts +65 -0
- package/dist/types/lib/dashboard-view-state/grain-pick.d.ts +38 -0
- package/dist/types/lib/dashboard-view-state/index.d.ts +2 -0
- package/dist/types/lib/formatters/grouped-temporal-presentation.d.ts +6 -2
- package/dist/types/lib/hooks/interactions/use-drill-actions.d.ts +1 -1
- package/dist/types/lib/interactions/get-click-context-from-table.d.ts +2 -2
- package/dist/types/lib/query-context/assemble-card-query.d.ts +2 -1
- package/dist/types/lib/query-context/build-card-query-context.d.ts +15 -1
- package/dist/types/lib/query-context/describe-card-execution-snapshot.d.ts +3 -0
- package/dist/types/lib/query-context/resolve-runtime-card-filters.d.ts +14 -1
- package/dist/types/lib/stores/dashboard-store.d.ts +7 -1
- package/dist/types/lib/types/explorer-types.d.ts +13 -0
- package/dist/types/lib/utils/card-config-utils.d.ts +1 -1
- package/dist/types/shared/analytics-protocol/analytics-base-schemas.d.ts +32 -0
- package/dist/types/shared/analytics-protocol/contracts.d.ts +30 -0
- package/dist/types/shared/analytics-protocol/filter-field-ownership.d.ts +13 -0
- package/dist/types/shared/dashboard-authoring/automatic-grain.d.ts +77 -0
- package/dist/types/shared/dashboard-authoring/changes/card-query-part.d.ts +1 -0
- package/dist/types/shared/dashboard-authoring/changes/dashboard-change.d.ts +13 -8
- package/dist/types/shared/dashboard-authoring/control-value-resolution.d.ts +24 -0
- package/dist/types/shared/dashboard-authoring/index.d.ts +1 -0
- package/dist/types/shared/dashboard-authoring/kpi-trend-rule.d.ts +6 -29
- package/dist/types/shared/dashboard-authoring/variable-draft.d.ts +1 -0
- package/dist/types/shared/format-utils/index.d.ts +1 -0
- package/dist/types/shared/format-utils/partial-period.d.ts +40 -0
- package/dist/types/shared/format-utils/temporal-bucket.d.ts +11 -0
- package/dist/types/shared/usage-events/details.d.ts +2 -2
- package/dist/usage-events/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunks/dates-5z3b9Loo.js +0 -136
- package/dist/chunks/selection-filter-compiler-BReJy-uv.js +0 -92
- package/dist/chunks/visual-choice-BBPizkRo.js +0 -206
package/dist/chunks/{analytics-base-schemas-BaIQrEzX.js → analytics-base-schemas-8wz9vqn_.js}
RENAMED
|
@@ -5,12 +5,12 @@ const Z = [
|
|
|
5
5
|
"population_required",
|
|
6
6
|
"ambiguous_relationship"
|
|
7
7
|
];
|
|
8
|
-
function
|
|
8
|
+
function Re(t) {
|
|
9
9
|
return Z.includes(
|
|
10
10
|
t
|
|
11
11
|
);
|
|
12
12
|
}
|
|
13
|
-
const
|
|
13
|
+
const ke = 200, D = [
|
|
14
14
|
"second",
|
|
15
15
|
"minute",
|
|
16
16
|
"hour",
|
|
@@ -20,7 +20,7 @@ const Te = 200, D = [
|
|
|
20
20
|
"quarter",
|
|
21
21
|
"year"
|
|
22
22
|
];
|
|
23
|
-
function
|
|
23
|
+
function Ie(t) {
|
|
24
24
|
return typeof t == "string" && D.includes(t);
|
|
25
25
|
}
|
|
26
26
|
const B = [
|
|
@@ -35,28 +35,28 @@ const B = [
|
|
|
35
35
|
"long",
|
|
36
36
|
"numeric",
|
|
37
37
|
"iso"
|
|
38
|
-
],
|
|
38
|
+
], G = ["hour", "day", "week", "month", "quarter", "year"], xe = {
|
|
39
39
|
invalidMetadata: "invalid_raw_temporal_metadata"
|
|
40
40
|
};
|
|
41
41
|
function z(t) {
|
|
42
42
|
return t === "second" || t === "minute" || t === "hour" ? "datetime" : "date";
|
|
43
43
|
}
|
|
44
|
-
const
|
|
44
|
+
const De = {
|
|
45
45
|
missingMetadata: "missing_temporal_bucket_metadata",
|
|
46
46
|
invalidMetadata: "invalid_temporal_bucket_metadata",
|
|
47
47
|
invalidValue: "invalid_temporal_bucket_value"
|
|
48
|
-
},
|
|
49
|
-
function
|
|
48
|
+
}, we = "__auto_count__";
|
|
49
|
+
function w(t) {
|
|
50
50
|
try {
|
|
51
51
|
return new Intl.DateTimeFormat("en-US", { timeZone: t }).format(), !0;
|
|
52
52
|
} catch {
|
|
53
53
|
return !1;
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
|
-
const
|
|
56
|
+
const L = 20;
|
|
57
57
|
function d(t) {
|
|
58
58
|
if (!(typeof t != "number" || !Number.isFinite(t)))
|
|
59
|
-
return Math.max(0, Math.min(
|
|
59
|
+
return Math.max(0, Math.min(L, Math.trunc(t)));
|
|
60
60
|
}
|
|
61
61
|
function s(t) {
|
|
62
62
|
return typeof t == "string" ? t : void 0;
|
|
@@ -67,12 +67,12 @@ function S(t) {
|
|
|
67
67
|
function _(t) {
|
|
68
68
|
return typeof t == "boolean" ? t : void 0;
|
|
69
69
|
}
|
|
70
|
-
function
|
|
70
|
+
function $(t) {
|
|
71
71
|
if (typeof t != "string") return;
|
|
72
72
|
const a = t.trim().toUpperCase();
|
|
73
73
|
return /^[A-Z]{3}$/.test(a) ? a : void 0;
|
|
74
74
|
}
|
|
75
|
-
function
|
|
75
|
+
function H(t) {
|
|
76
76
|
return typeof t == "number" && Number.isFinite(t) ? t : void 0;
|
|
77
77
|
}
|
|
78
78
|
function c(t) {
|
|
@@ -80,22 +80,22 @@ function c(t) {
|
|
|
80
80
|
Object.entries(t).filter(([, a]) => a !== void 0)
|
|
81
81
|
);
|
|
82
82
|
}
|
|
83
|
-
const
|
|
83
|
+
const K = /* @__PURE__ */ new Set(["number", "currency", "percent", "percentage", "scientific"]), W = /* @__PURE__ */ new Set(["millisecond", "second", "minute", "hour", "day"]);
|
|
84
84
|
function v(t) {
|
|
85
|
-
return typeof t == "string" &&
|
|
85
|
+
return typeof t == "string" && W.has(t) ? t : void 0;
|
|
86
86
|
}
|
|
87
|
-
function
|
|
87
|
+
function X(t) {
|
|
88
88
|
const a = t.percentValueMode ?? "fraction";
|
|
89
89
|
if (t.scale === 1 && a === "whole") {
|
|
90
|
-
const { scale: i, ...
|
|
91
|
-
return { ...
|
|
90
|
+
const { scale: i, ...f } = t;
|
|
91
|
+
return { ...f, percentValueMode: "whole" };
|
|
92
92
|
}
|
|
93
|
-
const
|
|
93
|
+
const o = t.minimumFractionDigits ?? (t.maximumFractionDigits === void 0 ? 1 : 0), n = t.maximumFractionDigits ?? Math.max(o, 1);
|
|
94
94
|
return c({
|
|
95
95
|
type: "number",
|
|
96
96
|
scale: a === "whole" ? t.scale : t.scale * 100,
|
|
97
|
-
minimumFractionDigits:
|
|
98
|
-
maximumFractionDigits:
|
|
97
|
+
minimumFractionDigits: o,
|
|
98
|
+
maximumFractionDigits: n,
|
|
99
99
|
useGrouping: t.useGrouping,
|
|
100
100
|
prefix: t.prefix,
|
|
101
101
|
suffix: `%${t.suffix ?? ""}`,
|
|
@@ -103,44 +103,44 @@ function W(t) {
|
|
|
103
103
|
signDisplay: t.signDisplay
|
|
104
104
|
});
|
|
105
105
|
}
|
|
106
|
-
function
|
|
106
|
+
function Y(t) {
|
|
107
107
|
const a = t.type === "percentage" ? "percent" : t.type;
|
|
108
|
-
let
|
|
108
|
+
let o = d(t.minimumFractionDigits), n = d(t.maximumFractionDigits);
|
|
109
109
|
const i = d(t.decimals);
|
|
110
|
-
|
|
111
|
-
const
|
|
110
|
+
o === void 0 && n === void 0 && i !== void 0 && (o = i, n = i), o !== void 0 && n !== void 0 && o > n && ([o, n] = [n, o]);
|
|
111
|
+
const f = t.negativeStyle === "parentheses" || t.negativeStyle === "minus" ? t.negativeStyle : void 0, P = t.signDisplay === "auto" || t.signDisplay === "always" || t.signDisplay === "exceptZero" || t.signDisplay === "never" ? t.signDisplay : void 0, m = c({
|
|
112
112
|
type: a,
|
|
113
|
-
currency: a === "currency" ?
|
|
114
|
-
minimumFractionDigits:
|
|
115
|
-
maximumFractionDigits:
|
|
113
|
+
currency: a === "currency" ? $(t.currency) : void 0,
|
|
114
|
+
minimumFractionDigits: o,
|
|
115
|
+
maximumFractionDigits: n,
|
|
116
116
|
useGrouping: _(t.useGrouping) ?? _(t.thousandsSeparator),
|
|
117
117
|
prefix: s(t.prefix),
|
|
118
118
|
// Intl adds the % of a percent; a stored '%' suffix on one is the same sign.
|
|
119
119
|
suffix: a === "percent" && t.suffix === "%" ? void 0 : s(t.suffix),
|
|
120
|
-
negativeStyle:
|
|
120
|
+
negativeStyle: f,
|
|
121
121
|
compact: _(t.compact),
|
|
122
|
-
scale:
|
|
122
|
+
scale: H(t.scale),
|
|
123
123
|
percentValueMode: a === "percent" ? t.percentValueMode === "whole" ? "whole" : "fraction" : void 0,
|
|
124
124
|
signDisplay: P
|
|
125
125
|
});
|
|
126
|
-
return m.type === "percent" && m.scale !== void 0 ?
|
|
126
|
+
return m.type === "percent" && m.scale !== void 0 ? X(m) : m;
|
|
127
127
|
}
|
|
128
|
-
function
|
|
128
|
+
function J(t) {
|
|
129
129
|
if (!t || typeof t != "object" || Array.isArray(t)) return;
|
|
130
130
|
const a = t;
|
|
131
131
|
if (a.type === "temporal_bucket") {
|
|
132
|
-
const
|
|
133
|
-
return
|
|
132
|
+
const o = a.presentation;
|
|
133
|
+
return o && typeof o == "object" && !Array.isArray(o) ? { type: "temporal_bucket", presentation: o } : void 0;
|
|
134
134
|
}
|
|
135
|
-
if (typeof a.type == "string" &&
|
|
136
|
-
return
|
|
135
|
+
if (typeof a.type == "string" && K.has(a.type))
|
|
136
|
+
return Y(a);
|
|
137
137
|
if (a.type === "date" || a.type === "datetime") {
|
|
138
|
-
const
|
|
138
|
+
const o = S(a.pattern), n = a.preset === "short" || a.preset === "long" || a.preset === "numeric" || a.preset === "iso" ? a.preset : void 0, i = o && (a.dialect === "date_fns" || a.dialect === "semaphor_tokens") ? a.dialect : void 0;
|
|
139
139
|
return c({
|
|
140
140
|
type: "date",
|
|
141
|
-
pattern:
|
|
141
|
+
pattern: o,
|
|
142
142
|
dialect: i,
|
|
143
|
-
preset:
|
|
143
|
+
preset: o ? void 0 : n,
|
|
144
144
|
relative: a.relative === !0 ? !0 : void 0,
|
|
145
145
|
timezone: S(a.timezone),
|
|
146
146
|
sourceTimezone: S(a.sourceTimezone),
|
|
@@ -149,14 +149,14 @@ function Y(t) {
|
|
|
149
149
|
});
|
|
150
150
|
}
|
|
151
151
|
if (a.type === "duration") {
|
|
152
|
-
const
|
|
152
|
+
const o = d(a.maxUnits);
|
|
153
153
|
return c({
|
|
154
154
|
type: "duration",
|
|
155
155
|
inputUnit: v(a.inputUnit),
|
|
156
156
|
outputStyle: a.outputStyle === "compact" || a.outputStyle === "digital" || a.outputStyle === "long" ? a.outputStyle : void 0,
|
|
157
157
|
largestUnit: v(a.largestUnit),
|
|
158
158
|
smallestUnit: v(a.smallestUnit),
|
|
159
|
-
maxUnits:
|
|
159
|
+
maxUnits: o === void 0 ? void 0 : Math.min(o, 10),
|
|
160
160
|
prefix: s(a.prefix),
|
|
161
161
|
suffix: s(a.suffix),
|
|
162
162
|
negativeStyle: a.negativeStyle === "parentheses" || a.negativeStyle === "minus" ? a.negativeStyle : void 0
|
|
@@ -165,7 +165,7 @@ function Y(t) {
|
|
|
165
165
|
if (a.type === "string")
|
|
166
166
|
return c({ type: "string", prefix: s(a.prefix), suffix: s(a.suffix) });
|
|
167
167
|
}
|
|
168
|
-
const
|
|
168
|
+
const Q = e.record(e.string(), e.unknown()), p = e.array(Q), u = e.enum([
|
|
169
169
|
"SUM",
|
|
170
170
|
"COUNT",
|
|
171
171
|
"AVG",
|
|
@@ -184,7 +184,7 @@ const J = e.record(e.string(), e.unknown()), p = e.array(J), u = e.enum([
|
|
|
184
184
|
"duckdb",
|
|
185
185
|
"sqlite",
|
|
186
186
|
"unknown"
|
|
187
|
-
]),
|
|
187
|
+
]), ee = e.enum(D), h = e.enum([
|
|
188
188
|
"dimension",
|
|
189
189
|
"measure",
|
|
190
190
|
"date",
|
|
@@ -197,27 +197,27 @@ const J = e.record(e.string(), e.unknown()), p = e.array(J), u = e.enum([
|
|
|
197
197
|
"date",
|
|
198
198
|
"datetime",
|
|
199
199
|
"unknown"
|
|
200
|
-
]), T = e.union([e.number(), e.string(), e.null()]),
|
|
200
|
+
]), T = e.union([e.number(), e.string(), e.null()]), R = e.enum([
|
|
201
201
|
"millisecond",
|
|
202
202
|
"second",
|
|
203
203
|
"minute",
|
|
204
204
|
"hour",
|
|
205
205
|
"day"
|
|
206
|
-
]),
|
|
206
|
+
]), te = e.enum(B), ae = e.discriminatedUnion("mode", [
|
|
207
207
|
e.object({ mode: e.literal("auto") }).strict(),
|
|
208
208
|
e.object({
|
|
209
209
|
mode: e.literal("preset"),
|
|
210
|
-
preset:
|
|
210
|
+
preset: te
|
|
211
211
|
}).strict(),
|
|
212
212
|
e.object({
|
|
213
213
|
mode: e.literal("pattern"),
|
|
214
214
|
pattern: e.string().min(1)
|
|
215
215
|
}).strict()
|
|
216
|
-
]),
|
|
216
|
+
]), j = e.object({
|
|
217
217
|
type: e.literal("temporal_bucket"),
|
|
218
|
-
presentation:
|
|
219
|
-
}).strict(),
|
|
220
|
-
tz: e.string().min(1).refine(
|
|
218
|
+
presentation: ae
|
|
219
|
+
}).strict(), oe = e.object({
|
|
220
|
+
tz: e.string().min(1).refine(w, {
|
|
221
221
|
message: "tz must be a valid IANA timezone"
|
|
222
222
|
}),
|
|
223
223
|
weekStart: e.number().int().min(0).max(6),
|
|
@@ -225,18 +225,23 @@ const J = e.record(e.string(), e.unknown()), p = e.array(J), u = e.enum([
|
|
|
225
225
|
kind: e.literal("month_aligned"),
|
|
226
226
|
yearStartMonth: e.number().int().min(1).max(12)
|
|
227
227
|
}).strict().optional()
|
|
228
|
-
}).strict(),
|
|
228
|
+
}).strict(), k = e.object({
|
|
229
229
|
kind: e.literal("temporal_bucket"),
|
|
230
|
-
granularity:
|
|
231
|
-
calendar:
|
|
230
|
+
granularity: ee,
|
|
231
|
+
calendar: oe
|
|
232
232
|
}).strict(), ne = e.object({
|
|
233
|
+
grainSource: e.enum(["automatic", "card"]),
|
|
234
|
+
window: e.object({ startInclusive: e.string(), endExclusive: e.string() }).strict().optional(),
|
|
235
|
+
automaticGrain: e.enum(G),
|
|
236
|
+
holdsTime: e.boolean()
|
|
237
|
+
}).strict(), ie = e.object({
|
|
233
238
|
kind: e.literal("raw_temporal"),
|
|
234
239
|
valueKind: e.enum(["date", "wall_datetime", "instant"])
|
|
235
|
-
}).strict(),
|
|
240
|
+
}).strict(), je = e.object({
|
|
236
241
|
kind: e.literal("raw_temporal"),
|
|
237
242
|
valueKind: e.enum(["date", "wall_datetime", "instant"]),
|
|
238
|
-
tz: e.string().min(1).refine(
|
|
239
|
-
}).strict(), r = e.string(), I = e.number().int().min(0).max(20),
|
|
243
|
+
tz: e.string().min(1).refine(w, "tz must be an IANA timezone.")
|
|
244
|
+
}).strict(), r = e.string(), I = e.number().int().min(0).max(20), A = e.object({
|
|
240
245
|
type: e.enum(["number", "currency", "percent", "scientific"]),
|
|
241
246
|
currency: e.string().regex(/^[A-Z]{3}$/, "Expected an ISO 4217 currency code.").optional(),
|
|
242
247
|
minimumFractionDigits: I.optional(),
|
|
@@ -250,8 +255,8 @@ const J = e.record(e.string(), e.unknown()), p = e.array(J), u = e.enum([
|
|
|
250
255
|
percentValueMode: e.enum(["fraction", "whole"]).optional(),
|
|
251
256
|
signDisplay: e.enum(["auto", "always", "exceptZero", "never"]).optional()
|
|
252
257
|
}).strict().superRefine((t, a) => {
|
|
253
|
-
const { minimumFractionDigits:
|
|
254
|
-
|
|
258
|
+
const { minimumFractionDigits: o, maximumFractionDigits: n } = t;
|
|
259
|
+
o !== void 0 && n !== void 0 && o > n && a.addIssue({
|
|
255
260
|
code: e.ZodIssueCode.custom,
|
|
256
261
|
path: ["minimumFractionDigits"],
|
|
257
262
|
message: "minimumFractionDigits must not exceed maximumFractionDigits."
|
|
@@ -272,11 +277,11 @@ const J = e.record(e.string(), e.unknown()), p = e.array(J), u = e.enum([
|
|
|
272
277
|
path: ["percentValueMode"],
|
|
273
278
|
message: "Only a percent format has percentValueMode."
|
|
274
279
|
});
|
|
275
|
-
}),
|
|
280
|
+
}), se = ["short", "long", "numeric", "iso"], F = e.object({
|
|
276
281
|
type: e.literal("date"),
|
|
277
282
|
pattern: e.string().min(1).optional(),
|
|
278
283
|
dialect: e.enum(["semaphor_tokens", "date_fns"]).optional(),
|
|
279
|
-
preset: e.enum(
|
|
284
|
+
preset: e.enum(se).optional(),
|
|
280
285
|
relative: e.boolean().optional(),
|
|
281
286
|
timezone: e.string().min(1).optional(),
|
|
282
287
|
sourceTimezone: e.string().min(1).optional(),
|
|
@@ -294,10 +299,10 @@ const J = e.record(e.string(), e.unknown()), p = e.array(J), u = e.enum([
|
|
|
294
299
|
});
|
|
295
300
|
}), M = e.object({
|
|
296
301
|
type: e.literal("duration"),
|
|
297
|
-
inputUnit:
|
|
302
|
+
inputUnit: R.optional(),
|
|
298
303
|
outputStyle: e.enum(["compact", "digital", "long"]).optional(),
|
|
299
|
-
largestUnit:
|
|
300
|
-
smallestUnit:
|
|
304
|
+
largestUnit: R.optional(),
|
|
305
|
+
smallestUnit: R.optional(),
|
|
301
306
|
maxUnits: e.number().int().min(0).max(10).optional(),
|
|
302
307
|
prefix: r.optional(),
|
|
303
308
|
suffix: r.optional(),
|
|
@@ -306,12 +311,12 @@ const J = e.record(e.string(), e.unknown()), p = e.array(J), u = e.enum([
|
|
|
306
311
|
type: e.literal("string"),
|
|
307
312
|
prefix: r.optional(),
|
|
308
313
|
suffix: r.optional()
|
|
309
|
-
}).strict(),
|
|
310
|
-
F,
|
|
314
|
+
}).strict(), E = e.union([
|
|
311
315
|
A,
|
|
316
|
+
F,
|
|
312
317
|
M,
|
|
313
318
|
C
|
|
314
|
-
]),
|
|
319
|
+
]), re = e.unknown().superRefine((t, a) => {
|
|
315
320
|
t && typeof t == "object" && "locale" in t && ["number", "currency", "percent", "percentage", "scientific"].includes(
|
|
316
321
|
String(t.type)
|
|
317
322
|
) && a.addIssue({
|
|
@@ -319,53 +324,53 @@ const J = e.record(e.string(), e.unknown()), p = e.array(J), u = e.enum([
|
|
|
319
324
|
path: ["locale"],
|
|
320
325
|
message: "Numeric semantic formats inherit locale from viewer preferences."
|
|
321
326
|
});
|
|
322
|
-
}).transform((t) =>
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
]),
|
|
326
|
-
function
|
|
327
|
+
}).transform((t) => J(t) ?? t).pipe(E), Ae = e.union([
|
|
328
|
+
E,
|
|
329
|
+
j
|
|
330
|
+
]), Fe = ["number", "currency", "percent", "scientific", "duration", "date", "string", "temporal_bucket"];
|
|
331
|
+
function ce(t) {
|
|
327
332
|
switch (t) {
|
|
328
333
|
case "number":
|
|
329
334
|
case "currency":
|
|
330
335
|
case "percent":
|
|
331
336
|
case "scientific":
|
|
332
|
-
return F;
|
|
333
|
-
case "date":
|
|
334
337
|
return A;
|
|
338
|
+
case "date":
|
|
339
|
+
return F;
|
|
335
340
|
case "duration":
|
|
336
341
|
return M;
|
|
337
342
|
case "string":
|
|
338
343
|
return C;
|
|
339
344
|
case "temporal_bucket":
|
|
340
|
-
return
|
|
345
|
+
return j;
|
|
341
346
|
default:
|
|
342
347
|
return;
|
|
343
348
|
}
|
|
344
349
|
}
|
|
345
|
-
function
|
|
346
|
-
let a =
|
|
350
|
+
function Me(t) {
|
|
351
|
+
let a = ce(t);
|
|
347
352
|
for (; a && !(a instanceof e.ZodObject); )
|
|
348
353
|
a = a instanceof e.ZodEffects ? a.innerType() : void 0;
|
|
349
354
|
return a ? Object.keys(a.shape) : void 0;
|
|
350
355
|
}
|
|
351
|
-
function
|
|
352
|
-
return e.object(t).passthrough().superRefine((
|
|
356
|
+
function le(t, a) {
|
|
357
|
+
return e.object(t).passthrough().superRefine((o, n) => {
|
|
353
358
|
for (const i of a)
|
|
354
|
-
Object.prototype.hasOwnProperty.call(
|
|
359
|
+
Object.prototype.hasOwnProperty.call(o, i) || n.addIssue({
|
|
355
360
|
code: "custom",
|
|
356
361
|
path: [i],
|
|
357
362
|
message: `Required field "${i}" is missing.`
|
|
358
363
|
});
|
|
359
364
|
});
|
|
360
365
|
}
|
|
361
|
-
const
|
|
366
|
+
const O = e.object({
|
|
362
367
|
kind: e.literal("semantic"),
|
|
363
368
|
domainId: e.string(),
|
|
364
369
|
datasetName: e.string(),
|
|
365
370
|
datasetId: e.string().optional(),
|
|
366
371
|
label: e.string().optional(),
|
|
367
372
|
connectionId: e.string().optional()
|
|
368
|
-
}).passthrough(),
|
|
373
|
+
}).passthrough(), pe = e.object({
|
|
369
374
|
kind: e.literal("physical"),
|
|
370
375
|
connectionId: e.string(),
|
|
371
376
|
connectionType: e.string().optional(),
|
|
@@ -374,27 +379,27 @@ const E = e.object({
|
|
|
374
379
|
schemaName: e.string().optional(),
|
|
375
380
|
label: e.string().optional(),
|
|
376
381
|
dialect: g.optional()
|
|
377
|
-
}).passthrough(),
|
|
382
|
+
}).passthrough(), ue = e.object({
|
|
378
383
|
kind: e.literal("sql"),
|
|
379
384
|
connectionId: e.string(),
|
|
380
385
|
dialect: g.optional(),
|
|
381
386
|
label: e.string().optional()
|
|
382
387
|
}).passthrough(), N = e.union([
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
]),
|
|
388
|
+
O,
|
|
389
|
+
pe,
|
|
390
|
+
ue
|
|
391
|
+
]), me = e.object({
|
|
387
392
|
name: e.string(),
|
|
388
393
|
label: e.string().optional(),
|
|
389
394
|
role: h.optional(),
|
|
390
395
|
dataType: y.optional(),
|
|
391
396
|
source: N.optional(),
|
|
392
397
|
aggregate: u.optional()
|
|
393
|
-
}).passthrough(), V =
|
|
398
|
+
}).passthrough(), V = me, de = e.object({
|
|
394
399
|
kind: e.literal("field"),
|
|
395
400
|
field: V,
|
|
396
401
|
aggregate: u.optional()
|
|
397
|
-
}).passthrough(),
|
|
402
|
+
}).passthrough(), ge = e.object({
|
|
398
403
|
kind: e.literal("derived_field"),
|
|
399
404
|
name: e.string(),
|
|
400
405
|
label: e.string(),
|
|
@@ -404,7 +409,7 @@ const E = e.object({
|
|
|
404
409
|
computeStage: e.enum(["row", "aggregate"]),
|
|
405
410
|
expression: e.string(),
|
|
406
411
|
expressionLanguage: e.literal("semaphor_sql_template").optional(),
|
|
407
|
-
inputs: e.record(
|
|
412
|
+
inputs: e.record(de),
|
|
408
413
|
defaultAggregate: u.optional(),
|
|
409
414
|
aggregationBehavior: e.enum([
|
|
410
415
|
"additive",
|
|
@@ -420,13 +425,13 @@ const E = e.object({
|
|
|
420
425
|
"aggregate_then_join",
|
|
421
426
|
"weighted"
|
|
422
427
|
]).optional(),
|
|
423
|
-
format:
|
|
428
|
+
format: re.optional(),
|
|
424
429
|
tags: e.array(e.string()).optional()
|
|
425
|
-
}).passthrough(), U =
|
|
430
|
+
}).passthrough(), U = ge, Ce = V.and(
|
|
426
431
|
e.object({
|
|
427
432
|
derivedField: U.optional()
|
|
428
433
|
}).passthrough()
|
|
429
|
-
),
|
|
434
|
+
), he = O, ye = e.object({
|
|
430
435
|
kind: e.literal("physical"),
|
|
431
436
|
connectionId: e.string().optional(),
|
|
432
437
|
connectionType: e.string().optional(),
|
|
@@ -435,22 +440,22 @@ const E = e.object({
|
|
|
435
440
|
schemaName: e.string().optional(),
|
|
436
441
|
label: e.string().optional(),
|
|
437
442
|
dialect: g.optional()
|
|
438
|
-
}).passthrough(),
|
|
443
|
+
}).passthrough(), be = e.object({
|
|
439
444
|
kind: e.literal("sql"),
|
|
440
445
|
connectionId: e.string().optional(),
|
|
441
446
|
dialect: g.optional(),
|
|
442
447
|
label: e.string().optional()
|
|
443
|
-
}).passthrough(),
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
]),
|
|
448
|
+
}).passthrough(), fe = e.union([
|
|
449
|
+
he,
|
|
450
|
+
ye,
|
|
451
|
+
be
|
|
452
|
+
]), Ee = e.object({
|
|
448
453
|
key: e.string().optional(),
|
|
449
454
|
name: e.string(),
|
|
450
455
|
label: e.string().optional(),
|
|
451
456
|
role: h.optional(),
|
|
452
457
|
dataType: y.optional(),
|
|
453
|
-
source:
|
|
458
|
+
source: fe.optional(),
|
|
454
459
|
aggregate: u.optional(),
|
|
455
460
|
derivedField: e.never().optional()
|
|
456
461
|
}).passthrough(), l = e.object({
|
|
@@ -462,8 +467,9 @@ const E = e.object({
|
|
|
462
467
|
aggregate: u.optional(),
|
|
463
468
|
source: N.optional(),
|
|
464
469
|
derivedField: U.optional(),
|
|
465
|
-
temporalBucket:
|
|
466
|
-
rawTemporal:
|
|
470
|
+
temporalBucket: k.optional(),
|
|
471
|
+
rawTemporal: ie.optional(),
|
|
472
|
+
dateGrain: ne.optional(),
|
|
467
473
|
pivotIdentity: e.object({
|
|
468
474
|
metricId: e.string().min(1),
|
|
469
475
|
metricAlias: e.string().min(1),
|
|
@@ -471,7 +477,7 @@ const E = e.object({
|
|
|
471
477
|
e.object({
|
|
472
478
|
fieldId: e.string().min(1),
|
|
473
479
|
value: e.string().nullable(),
|
|
474
|
-
temporalBucket:
|
|
480
|
+
temporalBucket: k.optional()
|
|
475
481
|
}).strict()
|
|
476
482
|
)
|
|
477
483
|
}).strict().optional()
|
|
@@ -481,27 +487,27 @@ const E = e.object({
|
|
|
481
487
|
path: ["rawTemporal"],
|
|
482
488
|
message: "A result column cannot carry both temporalBucket and rawTemporal metadata."
|
|
483
489
|
}), t.temporalBucket) {
|
|
484
|
-
const
|
|
490
|
+
const o = z(
|
|
485
491
|
t.temporalBucket.granularity
|
|
486
492
|
);
|
|
487
|
-
t.dataType !==
|
|
493
|
+
t.dataType !== o && a.addIssue({
|
|
488
494
|
code: e.ZodIssueCode.custom,
|
|
489
495
|
path: ["dataType"],
|
|
490
|
-
message: `${t.temporalBucket.granularity} temporal buckets require dataType ${
|
|
496
|
+
message: `${t.temporalBucket.granularity} temporal buckets require dataType ${o}.`
|
|
491
497
|
});
|
|
492
498
|
}
|
|
493
499
|
if (t.rawTemporal) {
|
|
494
|
-
const
|
|
495
|
-
t.dataType !==
|
|
500
|
+
const o = t.rawTemporal.valueKind === "date" ? "date" : "datetime";
|
|
501
|
+
t.dataType !== o && a.addIssue({
|
|
496
502
|
code: e.ZodIssueCode.custom,
|
|
497
503
|
path: ["dataType"],
|
|
498
|
-
message: `${t.rawTemporal.valueKind} raw temporal values require dataType ${
|
|
504
|
+
message: `${t.rawTemporal.valueKind} raw temporal values require dataType ${o}.`
|
|
499
505
|
});
|
|
500
506
|
}
|
|
501
|
-
}),
|
|
507
|
+
}), Oe = e.object({
|
|
502
508
|
records: p,
|
|
503
509
|
columns: e.array(l).optional()
|
|
504
|
-
}).passthrough(),
|
|
510
|
+
}).passthrough(), Ne = e.object({
|
|
505
511
|
records: p,
|
|
506
512
|
columns: e.array(l)
|
|
507
513
|
}).passthrough(), q = e.object({
|
|
@@ -519,28 +525,28 @@ const E = e.object({
|
|
|
519
525
|
path: e.string().optional(),
|
|
520
526
|
fieldRole: e.enum(["measure", "date", "dimension", "input", "source", "sql"]).optional(),
|
|
521
527
|
repairHint: q.optional()
|
|
522
|
-
}).passthrough(),
|
|
528
|
+
}).passthrough(), Ve = e.object({
|
|
523
529
|
ok: e.boolean(),
|
|
524
530
|
errors: e.array(x),
|
|
525
531
|
warnings: e.array(x),
|
|
526
532
|
repairHints: e.array(q)
|
|
527
|
-
}).passthrough(),
|
|
533
|
+
}).passthrough(), Se = e.object({
|
|
528
534
|
page: e.number(),
|
|
529
535
|
pageSize: e.number(),
|
|
530
536
|
pageCount: e.number(),
|
|
531
537
|
totalCount: e.number(),
|
|
532
538
|
hasNextPage: e.boolean(),
|
|
533
539
|
hasPrevPage: e.boolean()
|
|
534
|
-
}).passthrough(),
|
|
540
|
+
}).passthrough(), b = {
|
|
535
541
|
intentId: e.string().optional(),
|
|
536
542
|
queryPath: e.enum(["query_spec", "sql", "sql_python"]),
|
|
537
543
|
warnings: e.array(e.string()).optional(),
|
|
538
544
|
rowCount: e.number().optional(),
|
|
539
545
|
rowLimitExceeded: e.boolean().optional(),
|
|
540
546
|
limit: e.number().optional(),
|
|
541
|
-
pagination:
|
|
542
|
-
},
|
|
543
|
-
...
|
|
547
|
+
pagination: Se.optional()
|
|
548
|
+
}, Ue = e.object({
|
|
549
|
+
...b,
|
|
544
550
|
kind: e.literal("metric"),
|
|
545
551
|
primaryValue: T,
|
|
546
552
|
measures: e.record(T).optional(),
|
|
@@ -552,8 +558,8 @@ const E = e.object({
|
|
|
552
558
|
deltaPercent: e.union([e.number(), e.null()]).optional()
|
|
553
559
|
}).passthrough().optional(),
|
|
554
560
|
records: p.optional()
|
|
555
|
-
}).passthrough(),
|
|
556
|
-
...
|
|
561
|
+
}).passthrough(), qe = e.object({
|
|
562
|
+
...b,
|
|
557
563
|
kind: e.literal("records"),
|
|
558
564
|
columns: e.array(l),
|
|
559
565
|
records: p,
|
|
@@ -563,7 +569,7 @@ const E = e.object({
|
|
|
563
569
|
row: e.record(e.string(), e.unknown()),
|
|
564
570
|
columns: e.array(l).optional()
|
|
565
571
|
}).passthrough().optional()
|
|
566
|
-
}).passthrough(),
|
|
572
|
+
}).passthrough(), _e = e.object({
|
|
567
573
|
inputId: e.string().min(1),
|
|
568
574
|
status: e.enum(["applied", "inactive", "skipped", "overridden", "error"]),
|
|
569
575
|
reason: e.enum([
|
|
@@ -576,16 +582,16 @@ const E = e.object({
|
|
|
576
582
|
"unsupported_dependency",
|
|
577
583
|
"override_not_eligible"
|
|
578
584
|
]).optional()
|
|
579
|
-
}),
|
|
585
|
+
}), ve = e.object({
|
|
580
586
|
complete: e.boolean(),
|
|
581
587
|
reason: e.enum(["unsupported", "truncated"]).optional()
|
|
582
|
-
}),
|
|
583
|
-
...
|
|
588
|
+
}), Pe = e.object({
|
|
589
|
+
...b,
|
|
584
590
|
kind: e.literal("inputOptions"),
|
|
585
|
-
dependencyOutcomes: e.array(
|
|
586
|
-
match:
|
|
591
|
+
dependencyOutcomes: e.array(_e).optional(),
|
|
592
|
+
match: ve.optional(),
|
|
587
593
|
options: e.array(
|
|
588
|
-
|
|
594
|
+
le(
|
|
589
595
|
{
|
|
590
596
|
label: e.string(),
|
|
591
597
|
value: e.unknown(),
|
|
@@ -595,8 +601,8 @@ const E = e.object({
|
|
|
595
601
|
["value"]
|
|
596
602
|
)
|
|
597
603
|
)
|
|
598
|
-
}).passthrough(),
|
|
599
|
-
...
|
|
604
|
+
}).passthrough(), Ze = e.object({
|
|
605
|
+
...b,
|
|
600
606
|
kind: e.literal("sql"),
|
|
601
607
|
columns: e.array(l),
|
|
602
608
|
records: p,
|
|
@@ -607,57 +613,59 @@ const E = e.object({
|
|
|
607
613
|
}).passthrough().optional()
|
|
608
614
|
}).passthrough();
|
|
609
615
|
export {
|
|
610
|
-
|
|
616
|
+
Pe as $,
|
|
617
|
+
G as A,
|
|
611
618
|
Fe as B,
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
619
|
+
ce as C,
|
|
620
|
+
Me as D,
|
|
621
|
+
O as E,
|
|
615
622
|
pe as F,
|
|
616
|
-
|
|
623
|
+
ue as G,
|
|
617
624
|
me as H,
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
625
|
+
V as I,
|
|
626
|
+
ge as J,
|
|
627
|
+
U as K,
|
|
628
|
+
Ce as L,
|
|
629
|
+
ke as M,
|
|
630
|
+
Ee as N,
|
|
624
631
|
Z as O,
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
+
l as P,
|
|
633
|
+
Oe as Q,
|
|
634
|
+
xe as R,
|
|
635
|
+
we as S,
|
|
636
|
+
De as T,
|
|
637
|
+
Ne as U,
|
|
638
|
+
x as V,
|
|
632
639
|
Ve as W,
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
640
|
+
Ue as X,
|
|
641
|
+
qe as Y,
|
|
642
|
+
_e as Z,
|
|
643
|
+
ve as _,
|
|
637
644
|
z as a,
|
|
638
|
-
|
|
639
|
-
|
|
645
|
+
Ze as a0,
|
|
646
|
+
k as b,
|
|
647
|
+
Re as c,
|
|
640
648
|
D as d,
|
|
641
|
-
|
|
649
|
+
Ie as e,
|
|
642
650
|
B as f,
|
|
643
651
|
p as g,
|
|
644
652
|
u as h,
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
653
|
+
w as i,
|
|
654
|
+
ee as j,
|
|
655
|
+
j as k,
|
|
648
656
|
ne as l,
|
|
649
|
-
|
|
657
|
+
ie as m,
|
|
650
658
|
T as n,
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
659
|
+
je as o,
|
|
660
|
+
A as p,
|
|
661
|
+
se as q,
|
|
662
|
+
Q as r,
|
|
655
663
|
N as s,
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
664
|
+
J as t,
|
|
665
|
+
F as u,
|
|
666
|
+
M as v,
|
|
667
|
+
C as w,
|
|
668
|
+
E as x,
|
|
669
|
+
re as y,
|
|
670
|
+
Ae as z
|
|
663
671
|
};
|