react-semaphor 0.1.560 → 0.1.561
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 +353 -349
- package/dist/assistant-context/index.js +1 -1
- package/dist/assistant-protocol/index.js +5 -5
- package/dist/brand-studio/index.js +9 -9
- package/dist/briefings/index.js +5 -5
- package/dist/chunks/{analytics-base-schemas-CHLxsPfX.js → analytics-base-schemas-CB3oFAXk.js} +199 -171
- package/dist/chunks/{assistant-chat-Bu2fFm_I.js → assistant-chat-DiVHY3Hw.js} +27 -28
- package/dist/chunks/bookmark-impact-CR09dpkn.js +75 -0
- package/dist/chunks/bookmark-state-BusLpkb7.js +743 -0
- package/dist/chunks/{braces-Da41xfUd.js → braces-u8VorWJc.js} +1 -1
- package/dist/chunks/{comparison-window-caption-4FNkMrzE.js → comparison-window-caption-DDsIWJYT.js} +108 -108
- package/dist/chunks/{context-BgPDzLHZ.js → context-TUjw9eqr.js} +1 -1
- package/dist/chunks/{custom-visual-inputs-Dz-enUNR.js → custom-visual-inputs-DfolidZ9.js} +1 -1
- package/dist/chunks/{dashboard-_MeBuy67.js → dashboard-BRdZBPqr.js} +1 -1
- package/dist/chunks/{dashboard-briefing-launcher-CEi4Pr_v.js → dashboard-briefing-launcher-CgvTLndW.js} +161 -162
- package/dist/chunks/{dashboard-controls-Bi7fyG-4.js → dashboard-controls-B4vfSzTF.js} +881 -945
- package/dist/chunks/{dashboard-json-B1mU_OMa.js → dashboard-json-Y3MF59g7.js} +5 -5
- package/dist/chunks/document-dashboard-inputs-CvBbFTUA.js +1718 -0
- package/dist/chunks/{edit-dashboard-visual-0CJN31Y3.js → edit-dashboard-visual-DwjZcxj-.js} +6112 -6146
- package/dist/chunks/{filter-reach-copy-BF4w4kI2.js → filter-reach-copy-bijwf_-b.js} +1250 -1392
- package/dist/chunks/{filter-value-text-CRC-K_l_.js → filter-value-text-DFnhwuEW.js} +3 -3
- package/dist/chunks/global-date-filter-utils-BXgCpvQM.js +15142 -0
- package/dist/chunks/{index-DtHidOPV.js → index-ClwbY3BL.js} +197 -198
- package/dist/chunks/{layout-grid-BvsH4RY2.js → layout-grid-CtvCBfOm.js} +1 -1
- package/dist/chunks/{list-filter-Dg0otx5E.js → list-filter-BklYgciR.js} +1 -1
- package/dist/chunks/{matrix-analytical-definition-CM18W8w6.js → matrix-analytical-definition-pU51-JmY.js} +4 -4
- package/dist/chunks/{matrix-card-HPskLaPy.js → matrix-card-CUorIB7Q.js} +3 -3
- package/dist/chunks/{matrix-member-presentation-Bbrfrke4.js → matrix-member-presentation-Df5UgCGN.js} +1 -1
- package/dist/chunks/{matrix-operation-contract-WPv4R-H_.js → matrix-operation-contract-BSiGEXVC.js} +255 -248
- package/dist/chunks/{metric-comparison-ljMKYZKa.js → metric-comparison-95aC0uEO.js} +6 -6
- package/dist/chunks/{model-change-Ccn1zaxl.js → model-change-B5wQhg5G.js} +1 -1
- package/dist/chunks/{palette-Bsh376zO.js → palette-DTnMhipt.js} +1 -1
- package/dist/chunks/pivot-result-contract-expectations-Bo-86vwS.js +56 -0
- package/dist/chunks/{pivot-result-identity-vS9TSh4f.js → pivot-result-identity-olvXJoB9.js} +1 -1
- package/dist/chunks/{report-preferences-dialog-BV8L0SeS.js → report-preferences-dialog-C2YUIwKG.js} +14 -14
- package/dist/chunks/{report-runtime-context-BZQh9ywy.js → report-runtime-context-DoIUr3MP.js} +2 -2
- package/dist/chunks/resolve-dashboard-input-context-q_iiNXE1.js +6503 -0
- package/dist/chunks/{save-B5EAsgQF.js → save-DH4RyrnG.js} +1 -1
- package/dist/chunks/{saved-dashboard-context-n2Wn11cV.js → saved-dashboard-context-8jqfI7hI.js} +12 -12
- package/dist/chunks/{selection-reducer-D0YnaAD9.js → selection-reducer-CV7K4FI6.js} +1 -1
- package/dist/chunks/{semaphor-ready-indicator-XLBLOJ2V.js → semaphor-ready-indicator-E2XWyibu.js} +30253 -31076
- package/dist/chunks/{shelf-drop-preview-context-DHMa54a-.js → shelf-drop-preview-context-C29EUzDp.js} +7 -7
- package/dist/chunks/{source-entity-resolution-dUG5VWRm.js → source-entity-resolution-BXI3nQ5Z.js} +1 -1
- package/dist/chunks/{switch-ByxH4M7t.js → switch-balDSHc7.js} +3 -3
- package/dist/chunks/{table-export-sheet-C_GdeTYU.js → table-export-sheet-CK8tvh4d.js} +1 -1
- package/dist/chunks/temporal-input-presentation-B77JsAzU.js +5002 -0
- package/dist/chunks/{token-types-CQtXUVMy.js → token-types-DhYH5YKb.js} +1 -1
- package/dist/chunks/{upload-wbR-NVzq.js → upload-Ufj8vjyn.js} +1 -1
- package/dist/chunks/{use-create-flow-overlay-state-CEBaLOKC.js → use-create-flow-overlay-state-9WsnzEO5.js} +6 -6
- package/dist/chunks/{validators-CXTneCA4.js → validators-BtaCFIEB.js} +37 -37
- package/dist/chunks/{zoned-wall-clock-B1n_WjW3.js → zoned-wall-clock-CGLVI40Q.js} +1 -1
- package/dist/dashboard/index.js +2 -2
- package/dist/dashboard-authoring/index.js +2400 -1856
- package/dist/data-app-sdk/index.js +20 -20
- package/dist/data-app-sdk-adapters/index.js +3 -3
- package/dist/data-app-sdk-validation/index.js +10 -10
- package/dist/format-utils/index.js +257 -256
- package/dist/index.js +214 -215
- 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/components/dashboard/summary-number-formatter.d.ts +6 -0
- package/dist/types/index.js +50 -51
- package/dist/types/lib/formatters/kpi-number-formatter.d.ts +41 -0
- package/dist/types/lib/stores/editor-store.d.ts +9 -1
- package/dist/types/lib/stores/table-actions.d.ts +0 -2
- package/dist/types/shared/analytics-protocol/analytics-base-schemas.d.ts +10 -0
- package/dist/types/shared/analytics-protocol/measure-aggregation-profile.d.ts +12 -0
- package/dist/types/shared/dashboard-authoring/card-settings/apply-card-settings.d.ts +11 -0
- package/dist/types/shared/dashboard-authoring/card-settings/card-display-write.d.ts +52 -0
- package/dist/types/shared/dashboard-authoring/card-settings/card-kinds.d.ts +14 -0
- package/dist/types/shared/dashboard-authoring/card-settings/carry-column-settings.d.ts +3 -0
- package/dist/types/shared/dashboard-authoring/card-settings/column-format-write.d.ts +8 -0
- package/dist/types/shared/dashboard-authoring/card-settings/column-names.d.ts +51 -0
- package/dist/types/shared/dashboard-authoring/card-settings/column-sources.d.ts +14 -0
- package/dist/types/shared/dashboard-authoring/card-settings/confirm-class.d.ts +9 -0
- package/dist/types/shared/dashboard-authoring/card-settings/highlight-inputs.d.ts +19 -0
- package/dist/types/shared/dashboard-authoring/card-settings/index.d.ts +15 -0
- package/dist/types/shared/dashboard-authoring/card-settings/inputs.d.ts +102 -0
- package/dist/types/shared/dashboard-authoring/card-settings/read-card-settings.d.ts +10 -0
- package/dist/types/shared/dashboard-authoring/card-settings/resolve-card-highlights.d.ts +14 -0
- package/dist/types/shared/dashboard-authoring/card-settings/resolve-card-settings.d.ts +59 -0
- package/dist/types/shared/dashboard-authoring/card-settings/resolved.d.ts +40 -0
- package/dist/types/shared/dashboard-authoring/card-settings/views.d.ts +28 -0
- package/dist/types/shared/dashboard-authoring/changes/card-query-part.d.ts +6 -0
- package/dist/types/shared/dashboard-authoring/changes/card-types.d.ts +32 -0
- package/dist/types/shared/dashboard-authoring/changes/dashboard-change.d.ts +539 -22
- package/dist/types/shared/dashboard-authoring/changes/diagnostics.d.ts +27 -8
- package/dist/types/shared/dashboard-authoring/changes/resolve-dashboard-changes.d.ts +25 -1
- package/dist/types/shared/dashboard-authoring/conditional-formatting/kpi.d.ts +1 -8
- package/dist/types/shared/dashboard-authoring/conditional-formatting/schema.d.ts +10 -10
- package/dist/types/shared/dashboard-authoring/index.d.ts +3 -0
- package/dist/types/shared/dashboard-authoring/kpi-figure.d.ts +123 -0
- package/dist/types/shared/dashboard-authoring/operations/operation-types.d.ts +21 -1
- package/dist/types/shared/dashboard-authoring/outline/outline-dashboard.d.ts +10 -4
- package/dist/types/shared/dashboard-viewer/bookmark-impact.d.ts +33 -0
- package/dist/types/shared/format-utils/formatters/matrix-formatter.d.ts +8 -1
- package/dist/types/shared/format-utils/raw-temporal.d.ts +16 -0
- package/package.json +2 -2
- package/dist/chunks/bookmark-state-BFY9oNmr.js +0 -111
- package/dist/chunks/document-dashboard-inputs-CkWfDB8c.js +0 -3010
- package/dist/chunks/global-date-filter-utils-D8365uPH.js +0 -12889
- package/dist/chunks/pivot-result-contract-expectations-Bl5suy4-.js +0 -1832
- package/dist/chunks/raw-temporal-presentation-BHm7s-hz.js +0 -540
- package/dist/chunks/resolve-dashboard-input-context-CAMiWvyR.js +0 -5280
- package/dist/chunks/table-settings-Imz0FgWi.js +0 -637
- package/dist/chunks/temporal-input-presentation-uvNK_tM0.js +0 -3228
package/dist/chunks/{analytics-base-schemas-CHLxsPfX.js → analytics-base-schemas-CB3oFAXk.js}
RENAMED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { z as e } from "zod";
|
|
2
|
-
const
|
|
2
|
+
const P = [
|
|
3
3
|
"missing_dependency",
|
|
4
4
|
"missing_relationship",
|
|
5
5
|
"population_required",
|
|
6
6
|
"ambiguous_relationship"
|
|
7
7
|
];
|
|
8
|
-
function
|
|
9
|
-
return
|
|
8
|
+
function ve(t) {
|
|
9
|
+
return P.includes(
|
|
10
10
|
t
|
|
11
11
|
);
|
|
12
12
|
}
|
|
13
|
-
const
|
|
13
|
+
const Re = 200, D = [
|
|
14
14
|
"second",
|
|
15
15
|
"minute",
|
|
16
16
|
"hour",
|
|
@@ -20,10 +20,10 @@ const ve = 200, D = [
|
|
|
20
20
|
"quarter",
|
|
21
21
|
"year"
|
|
22
22
|
];
|
|
23
|
-
function
|
|
23
|
+
function Te(t) {
|
|
24
24
|
return typeof t == "string" && D.includes(t);
|
|
25
25
|
}
|
|
26
|
-
const
|
|
26
|
+
const Z = [
|
|
27
27
|
"week_of_short",
|
|
28
28
|
"week_of_long",
|
|
29
29
|
"quarter_short",
|
|
@@ -38,7 +38,7 @@ const N = [
|
|
|
38
38
|
], ke = {
|
|
39
39
|
invalidMetadata: "invalid_raw_temporal_metadata"
|
|
40
40
|
};
|
|
41
|
-
function
|
|
41
|
+
function B(t) {
|
|
42
42
|
return t === "second" || t === "minute" || t === "hour" ? "datetime" : "date";
|
|
43
43
|
}
|
|
44
44
|
const xe = {
|
|
@@ -46,17 +46,17 @@ const xe = {
|
|
|
46
46
|
invalidMetadata: "invalid_temporal_bucket_metadata",
|
|
47
47
|
invalidValue: "invalid_temporal_bucket_value"
|
|
48
48
|
}, Ie = "__auto_count__";
|
|
49
|
-
function
|
|
49
|
+
function G(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 z = 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(z, 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 L(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 $(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 H = /* @__PURE__ */ new Set(["number", "currency", "percent", "percentage", "scientific"]), K = /* @__PURE__ */ new Set(["millisecond", "second", "minute", "hour", "day"]);
|
|
84
84
|
function v(t) {
|
|
85
|
-
return typeof t == "string" &&
|
|
85
|
+
return typeof t == "string" && K.has(t) ? t : void 0;
|
|
86
86
|
}
|
|
87
|
-
function
|
|
87
|
+
function W(t) {
|
|
88
88
|
const a = t.percentValueMode ?? "fraction";
|
|
89
89
|
if (t.scale === 1 && a === "whole") {
|
|
90
|
-
const { scale:
|
|
91
|
-
return { ...
|
|
90
|
+
const { scale: i, ...b } = t;
|
|
91
|
+
return { ...b, percentValueMode: "whole" };
|
|
92
92
|
}
|
|
93
|
-
const o = t.minimumFractionDigits ?? (t.maximumFractionDigits === void 0 ? 1 : 0),
|
|
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
97
|
minimumFractionDigits: o,
|
|
98
|
-
maximumFractionDigits:
|
|
98
|
+
maximumFractionDigits: n,
|
|
99
99
|
useGrouping: t.useGrouping,
|
|
100
100
|
prefix: t.prefix,
|
|
101
101
|
suffix: `%${t.suffix ?? ""}`,
|
|
@@ -103,44 +103,44 @@ function z(t) {
|
|
|
103
103
|
signDisplay: t.signDisplay
|
|
104
104
|
});
|
|
105
105
|
}
|
|
106
|
-
function
|
|
106
|
+
function X(t) {
|
|
107
107
|
const a = t.type === "percentage" ? "percent" : t.type;
|
|
108
|
-
let o = d(t.minimumFractionDigits),
|
|
109
|
-
const
|
|
110
|
-
o === void 0 &&
|
|
111
|
-
const
|
|
108
|
+
let o = d(t.minimumFractionDigits), n = d(t.maximumFractionDigits);
|
|
109
|
+
const i = d(t.decimals);
|
|
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 b = t.negativeStyle === "parentheses" || t.negativeStyle === "minus" ? t.negativeStyle : void 0, q = 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" ?
|
|
113
|
+
currency: a === "currency" ? L(t.currency) : void 0,
|
|
114
114
|
minimumFractionDigits: o,
|
|
115
|
-
maximumFractionDigits:
|
|
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: b,
|
|
121
121
|
compact: _(t.compact),
|
|
122
|
-
scale:
|
|
122
|
+
scale: $(t.scale),
|
|
123
123
|
percentValueMode: a === "percent" ? t.percentValueMode === "whole" ? "whole" : "fraction" : void 0,
|
|
124
|
-
signDisplay:
|
|
124
|
+
signDisplay: q
|
|
125
125
|
});
|
|
126
|
-
return m.type === "percent" && m.scale !== void 0 ?
|
|
126
|
+
return m.type === "percent" && m.scale !== void 0 ? W(m) : m;
|
|
127
127
|
}
|
|
128
|
-
function
|
|
128
|
+
function Y(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
132
|
const o = a.presentation;
|
|
133
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" && H.has(a.type))
|
|
136
|
+
return X(a);
|
|
137
137
|
if (a.type === "date" || a.type === "datetime") {
|
|
138
|
-
const o = S(a.pattern),
|
|
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
141
|
pattern: o,
|
|
142
|
-
dialect:
|
|
143
|
-
preset: o ? void 0 :
|
|
142
|
+
dialect: i,
|
|
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),
|
|
@@ -165,7 +165,7 @@ function $(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 J = e.record(e.string(), e.unknown()), p = e.array(J), u = e.enum([
|
|
169
169
|
"SUM",
|
|
170
170
|
"COUNT",
|
|
171
171
|
"AVG",
|
|
@@ -184,7 +184,7 @@ const H = e.record(e.string(), e.unknown()), p = e.array(H), u = e.enum([
|
|
|
184
184
|
"duckdb",
|
|
185
185
|
"sqlite",
|
|
186
186
|
"unknown"
|
|
187
|
-
]),
|
|
187
|
+
]), Q = e.enum(D), h = e.enum([
|
|
188
188
|
"dimension",
|
|
189
189
|
"measure",
|
|
190
190
|
"date",
|
|
@@ -197,27 +197,27 @@ const H = e.record(e.string(), e.unknown()), p = e.array(H), u = e.enum([
|
|
|
197
197
|
"date",
|
|
198
198
|
"datetime",
|
|
199
199
|
"unknown"
|
|
200
|
-
]), R = e.union([e.number(), e.string(), e.null()]),
|
|
200
|
+
]), R = e.union([e.number(), e.string(), e.null()]), T = e.enum([
|
|
201
201
|
"millisecond",
|
|
202
202
|
"second",
|
|
203
203
|
"minute",
|
|
204
204
|
"hour",
|
|
205
205
|
"day"
|
|
206
|
-
]),
|
|
206
|
+
]), ee = e.enum(Z), te = 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: ee
|
|
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: te
|
|
219
|
+
}).strict(), ae = e.object({
|
|
220
|
+
tz: e.string().min(1).refine(G, {
|
|
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,18 @@ const H = e.record(e.string(), e.unknown()), p = e.array(H), 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:
|
|
232
|
-
}).strict(),
|
|
230
|
+
granularity: Q,
|
|
231
|
+
calendar: ae
|
|
232
|
+
}).strict(), oe = e.object({
|
|
233
233
|
kind: e.literal("raw_temporal"),
|
|
234
234
|
valueKind: e.enum(["date", "wall_datetime", "instant"])
|
|
235
|
-
}).strict(), r = e.string(),
|
|
235
|
+
}).strict(), r = e.string(), x = e.number().int().min(0).max(20), w = e.object({
|
|
236
236
|
type: e.enum(["number", "currency", "percent", "scientific"]),
|
|
237
237
|
currency: e.string().regex(/^[A-Z]{3}$/, "Expected an ISO 4217 currency code.").optional(),
|
|
238
|
-
minimumFractionDigits:
|
|
239
|
-
maximumFractionDigits:
|
|
238
|
+
minimumFractionDigits: x.optional(),
|
|
239
|
+
maximumFractionDigits: x.optional(),
|
|
240
240
|
useGrouping: e.boolean().optional(),
|
|
241
241
|
prefix: r.optional(),
|
|
242
242
|
suffix: r.optional(),
|
|
@@ -246,8 +246,8 @@ const H = e.record(e.string(), e.unknown()), p = e.array(H), u = e.enum([
|
|
|
246
246
|
percentValueMode: e.enum(["fraction", "whole"]).optional(),
|
|
247
247
|
signDisplay: e.enum(["auto", "always", "exceptZero", "never"]).optional()
|
|
248
248
|
}).strict().superRefine((t, a) => {
|
|
249
|
-
const { minimumFractionDigits: o, maximumFractionDigits:
|
|
250
|
-
o !== void 0 &&
|
|
249
|
+
const { minimumFractionDigits: o, maximumFractionDigits: n } = t;
|
|
250
|
+
o !== void 0 && n !== void 0 && o > n && a.addIssue({
|
|
251
251
|
code: e.ZodIssueCode.custom,
|
|
252
252
|
path: ["minimumFractionDigits"],
|
|
253
253
|
message: "minimumFractionDigits must not exceed maximumFractionDigits."
|
|
@@ -268,11 +268,11 @@ const H = e.record(e.string(), e.unknown()), p = e.array(H), u = e.enum([
|
|
|
268
268
|
path: ["percentValueMode"],
|
|
269
269
|
message: "Only a percent format has percentValueMode."
|
|
270
270
|
});
|
|
271
|
-
}),
|
|
271
|
+
}), ne = ["short", "long", "numeric", "iso"], F = e.object({
|
|
272
272
|
type: e.literal("date"),
|
|
273
273
|
pattern: e.string().min(1).optional(),
|
|
274
274
|
dialect: e.enum(["semaphor_tokens", "date_fns"]).optional(),
|
|
275
|
-
preset: e.enum(
|
|
275
|
+
preset: e.enum(ne).optional(),
|
|
276
276
|
relative: e.boolean().optional(),
|
|
277
277
|
timezone: e.string().min(1).optional(),
|
|
278
278
|
sourceTimezone: e.string().min(1).optional(),
|
|
@@ -288,26 +288,26 @@ const H = e.record(e.string(), e.unknown()), p = e.array(H), u = e.enum([
|
|
|
288
288
|
path: ["dialect"],
|
|
289
289
|
message: "dialect names the token set of a pattern."
|
|
290
290
|
});
|
|
291
|
-
}),
|
|
291
|
+
}), A = e.object({
|
|
292
292
|
type: e.literal("duration"),
|
|
293
|
-
inputUnit:
|
|
293
|
+
inputUnit: T.optional(),
|
|
294
294
|
outputStyle: e.enum(["compact", "digital", "long"]).optional(),
|
|
295
|
-
largestUnit:
|
|
296
|
-
smallestUnit:
|
|
295
|
+
largestUnit: T.optional(),
|
|
296
|
+
smallestUnit: T.optional(),
|
|
297
297
|
maxUnits: e.number().int().min(0).max(10).optional(),
|
|
298
298
|
prefix: r.optional(),
|
|
299
299
|
suffix: r.optional(),
|
|
300
300
|
negativeStyle: e.enum(["minus", "parentheses"]).optional()
|
|
301
|
-
}).strict(),
|
|
301
|
+
}).strict(), M = e.object({
|
|
302
302
|
type: e.literal("string"),
|
|
303
303
|
prefix: r.optional(),
|
|
304
304
|
suffix: r.optional()
|
|
305
|
-
}).strict(),
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
]),
|
|
305
|
+
}).strict(), C = e.union([
|
|
306
|
+
w,
|
|
307
|
+
F,
|
|
308
|
+
A,
|
|
309
|
+
M
|
|
310
|
+
]), ie = e.unknown().superRefine((t, a) => {
|
|
311
311
|
t && typeof t == "object" && "locale" in t && ["number", "currency", "percent", "percentage", "scientific"].includes(
|
|
312
312
|
String(t.type)
|
|
313
313
|
) && a.addIssue({
|
|
@@ -315,28 +315,53 @@ const H = e.record(e.string(), e.unknown()), p = e.array(H), u = e.enum([
|
|
|
315
315
|
path: ["locale"],
|
|
316
316
|
message: "Numeric semantic formats inherit locale from viewer preferences."
|
|
317
317
|
});
|
|
318
|
-
}).transform((t) =>
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
]);
|
|
322
|
-
function se(t
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
318
|
+
}).transform((t) => Y(t) ?? t).pipe(C), De = e.union([
|
|
319
|
+
C,
|
|
320
|
+
j
|
|
321
|
+
]), je = ["number", "currency", "percent", "scientific", "duration", "date", "string", "temporal_bucket"];
|
|
322
|
+
function se(t) {
|
|
323
|
+
switch (t) {
|
|
324
|
+
case "number":
|
|
325
|
+
case "currency":
|
|
326
|
+
case "percent":
|
|
327
|
+
case "scientific":
|
|
328
|
+
return w;
|
|
329
|
+
case "date":
|
|
330
|
+
return F;
|
|
331
|
+
case "duration":
|
|
332
|
+
return A;
|
|
333
|
+
case "string":
|
|
334
|
+
return M;
|
|
335
|
+
case "temporal_bucket":
|
|
336
|
+
return j;
|
|
337
|
+
default:
|
|
338
|
+
return;
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
function we(t) {
|
|
342
|
+
let a = se(t);
|
|
343
|
+
for (; a && !(a instanceof e.ZodObject); )
|
|
344
|
+
a = a instanceof e.ZodEffects ? a.innerType() : void 0;
|
|
345
|
+
return a ? Object.keys(a.shape) : void 0;
|
|
346
|
+
}
|
|
347
|
+
function re(t, a) {
|
|
348
|
+
return e.object(t).passthrough().superRefine((o, n) => {
|
|
349
|
+
for (const i of a)
|
|
350
|
+
Object.prototype.hasOwnProperty.call(o, i) || n.addIssue({
|
|
326
351
|
code: "custom",
|
|
327
|
-
path: [
|
|
328
|
-
message: `Required field "${
|
|
352
|
+
path: [i],
|
|
353
|
+
message: `Required field "${i}" is missing.`
|
|
329
354
|
});
|
|
330
355
|
});
|
|
331
356
|
}
|
|
332
|
-
const
|
|
357
|
+
const O = e.object({
|
|
333
358
|
kind: e.literal("semantic"),
|
|
334
359
|
domainId: e.string(),
|
|
335
360
|
datasetName: e.string(),
|
|
336
361
|
datasetId: e.string().optional(),
|
|
337
362
|
label: e.string().optional(),
|
|
338
363
|
connectionId: e.string().optional()
|
|
339
|
-
}).passthrough(),
|
|
364
|
+
}).passthrough(), ce = e.object({
|
|
340
365
|
kind: e.literal("physical"),
|
|
341
366
|
connectionId: e.string(),
|
|
342
367
|
connectionType: e.string().optional(),
|
|
@@ -345,27 +370,27 @@ const w = e.object({
|
|
|
345
370
|
schemaName: e.string().optional(),
|
|
346
371
|
label: e.string().optional(),
|
|
347
372
|
dialect: g.optional()
|
|
348
|
-
}).passthrough(),
|
|
373
|
+
}).passthrough(), le = e.object({
|
|
349
374
|
kind: e.literal("sql"),
|
|
350
375
|
connectionId: e.string(),
|
|
351
376
|
dialect: g.optional(),
|
|
352
377
|
label: e.string().optional()
|
|
353
|
-
}).passthrough(),
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
]),
|
|
378
|
+
}).passthrough(), E = e.union([
|
|
379
|
+
O,
|
|
380
|
+
ce,
|
|
381
|
+
le
|
|
382
|
+
]), pe = e.object({
|
|
358
383
|
name: e.string(),
|
|
359
384
|
label: e.string().optional(),
|
|
360
385
|
role: h.optional(),
|
|
361
386
|
dataType: y.optional(),
|
|
362
|
-
source:
|
|
387
|
+
source: E.optional(),
|
|
363
388
|
aggregate: u.optional()
|
|
364
|
-
}).passthrough(),
|
|
389
|
+
}).passthrough(), N = pe, ue = e.object({
|
|
365
390
|
kind: e.literal("field"),
|
|
366
|
-
field:
|
|
391
|
+
field: N,
|
|
367
392
|
aggregate: u.optional()
|
|
368
|
-
}).passthrough(),
|
|
393
|
+
}).passthrough(), me = e.object({
|
|
369
394
|
kind: e.literal("derived_field"),
|
|
370
395
|
name: e.string(),
|
|
371
396
|
label: e.string(),
|
|
@@ -375,7 +400,7 @@ const w = e.object({
|
|
|
375
400
|
computeStage: e.enum(["row", "aggregate"]),
|
|
376
401
|
expression: e.string(),
|
|
377
402
|
expressionLanguage: e.literal("semaphor_sql_template").optional(),
|
|
378
|
-
inputs: e.record(
|
|
403
|
+
inputs: e.record(ue),
|
|
379
404
|
defaultAggregate: u.optional(),
|
|
380
405
|
aggregationBehavior: e.enum([
|
|
381
406
|
"additive",
|
|
@@ -391,13 +416,13 @@ const w = e.object({
|
|
|
391
416
|
"aggregate_then_join",
|
|
392
417
|
"weighted"
|
|
393
418
|
]).optional(),
|
|
394
|
-
format:
|
|
419
|
+
format: ie.optional(),
|
|
395
420
|
tags: e.array(e.string()).optional()
|
|
396
|
-
}).passthrough(),
|
|
421
|
+
}).passthrough(), V = me, Fe = N.and(
|
|
397
422
|
e.object({
|
|
398
|
-
derivedField:
|
|
423
|
+
derivedField: V.optional()
|
|
399
424
|
}).passthrough()
|
|
400
|
-
),
|
|
425
|
+
), de = O, ge = e.object({
|
|
401
426
|
kind: e.literal("physical"),
|
|
402
427
|
connectionId: e.string().optional(),
|
|
403
428
|
connectionType: e.string().optional(),
|
|
@@ -406,22 +431,22 @@ const w = e.object({
|
|
|
406
431
|
schemaName: e.string().optional(),
|
|
407
432
|
label: e.string().optional(),
|
|
408
433
|
dialect: g.optional()
|
|
409
|
-
}).passthrough(),
|
|
434
|
+
}).passthrough(), he = e.object({
|
|
410
435
|
kind: e.literal("sql"),
|
|
411
436
|
connectionId: e.string().optional(),
|
|
412
437
|
dialect: g.optional(),
|
|
413
438
|
label: e.string().optional()
|
|
414
|
-
}).passthrough(),
|
|
415
|
-
me,
|
|
439
|
+
}).passthrough(), ye = e.union([
|
|
416
440
|
de,
|
|
417
|
-
ge
|
|
418
|
-
|
|
441
|
+
ge,
|
|
442
|
+
he
|
|
443
|
+
]), Ae = e.object({
|
|
419
444
|
key: e.string().optional(),
|
|
420
445
|
name: e.string(),
|
|
421
446
|
label: e.string().optional(),
|
|
422
447
|
role: h.optional(),
|
|
423
448
|
dataType: y.optional(),
|
|
424
|
-
source:
|
|
449
|
+
source: ye.optional(),
|
|
425
450
|
aggregate: u.optional(),
|
|
426
451
|
derivedField: e.never().optional()
|
|
427
452
|
}).passthrough(), l = e.object({
|
|
@@ -431,10 +456,10 @@ const w = e.object({
|
|
|
431
456
|
role: h.optional(),
|
|
432
457
|
dataType: y.optional(),
|
|
433
458
|
aggregate: u.optional(),
|
|
434
|
-
source:
|
|
435
|
-
derivedField:
|
|
436
|
-
temporalBucket:
|
|
437
|
-
rawTemporal:
|
|
459
|
+
source: E.optional(),
|
|
460
|
+
derivedField: V.optional(),
|
|
461
|
+
temporalBucket: k.optional(),
|
|
462
|
+
rawTemporal: oe.optional(),
|
|
438
463
|
pivotIdentity: e.object({
|
|
439
464
|
metricId: e.string().min(1),
|
|
440
465
|
metricAlias: e.string().min(1),
|
|
@@ -442,7 +467,7 @@ const w = e.object({
|
|
|
442
467
|
e.object({
|
|
443
468
|
fieldId: e.string().min(1),
|
|
444
469
|
value: e.string().nullable(),
|
|
445
|
-
temporalBucket:
|
|
470
|
+
temporalBucket: k.optional()
|
|
446
471
|
}).strict()
|
|
447
472
|
)
|
|
448
473
|
}).strict().optional()
|
|
@@ -452,7 +477,7 @@ const w = e.object({
|
|
|
452
477
|
path: ["rawTemporal"],
|
|
453
478
|
message: "A result column cannot carry both temporalBucket and rawTemporal metadata."
|
|
454
479
|
}), t.temporalBucket) {
|
|
455
|
-
const o =
|
|
480
|
+
const o = B(
|
|
456
481
|
t.temporalBucket.granularity
|
|
457
482
|
);
|
|
458
483
|
t.dataType !== o && a.addIssue({
|
|
@@ -469,13 +494,13 @@ const w = e.object({
|
|
|
469
494
|
message: `${t.rawTemporal.valueKind} raw temporal values require dataType ${o}.`
|
|
470
495
|
});
|
|
471
496
|
}
|
|
472
|
-
}),
|
|
497
|
+
}), Me = e.object({
|
|
473
498
|
records: p,
|
|
474
499
|
columns: e.array(l).optional()
|
|
475
|
-
}).passthrough(),
|
|
500
|
+
}).passthrough(), Ce = e.object({
|
|
476
501
|
records: p,
|
|
477
502
|
columns: e.array(l)
|
|
478
|
-
}).passthrough(),
|
|
503
|
+
}).passthrough(), U = e.object({
|
|
479
504
|
code: e.string(),
|
|
480
505
|
message: e.string().optional(),
|
|
481
506
|
invalidField: e.string().optional(),
|
|
@@ -484,34 +509,34 @@ const w = e.object({
|
|
|
484
509
|
validDateCandidates: e.array(e.string()).optional(),
|
|
485
510
|
validDimensionCandidates: e.array(e.string()).optional(),
|
|
486
511
|
recommendedNextStep: e.string()
|
|
487
|
-
}).passthrough(),
|
|
512
|
+
}).passthrough(), I = e.object({
|
|
488
513
|
code: e.string(),
|
|
489
514
|
message: e.string(),
|
|
490
515
|
path: e.string().optional(),
|
|
491
516
|
fieldRole: e.enum(["measure", "date", "dimension", "input", "source", "sql"]).optional(),
|
|
492
|
-
repairHint:
|
|
493
|
-
}).passthrough(),
|
|
517
|
+
repairHint: U.optional()
|
|
518
|
+
}).passthrough(), Oe = e.object({
|
|
494
519
|
ok: e.boolean(),
|
|
495
|
-
errors: e.array(
|
|
496
|
-
warnings: e.array(
|
|
497
|
-
repairHints: e.array(
|
|
498
|
-
}).passthrough(),
|
|
520
|
+
errors: e.array(I),
|
|
521
|
+
warnings: e.array(I),
|
|
522
|
+
repairHints: e.array(U)
|
|
523
|
+
}).passthrough(), fe = e.object({
|
|
499
524
|
page: e.number(),
|
|
500
525
|
pageSize: e.number(),
|
|
501
526
|
pageCount: e.number(),
|
|
502
527
|
totalCount: e.number(),
|
|
503
528
|
hasNextPage: e.boolean(),
|
|
504
529
|
hasPrevPage: e.boolean()
|
|
505
|
-
}).passthrough(),
|
|
530
|
+
}).passthrough(), f = {
|
|
506
531
|
intentId: e.string().optional(),
|
|
507
532
|
queryPath: e.enum(["query_spec", "sql", "sql_python"]),
|
|
508
533
|
warnings: e.array(e.string()).optional(),
|
|
509
534
|
rowCount: e.number().optional(),
|
|
510
535
|
rowLimitExceeded: e.boolean().optional(),
|
|
511
536
|
limit: e.number().optional(),
|
|
512
|
-
pagination:
|
|
513
|
-
},
|
|
514
|
-
...
|
|
537
|
+
pagination: fe.optional()
|
|
538
|
+
}, Ee = e.object({
|
|
539
|
+
...f,
|
|
515
540
|
kind: e.literal("metric"),
|
|
516
541
|
primaryValue: R,
|
|
517
542
|
measures: e.record(R).optional(),
|
|
@@ -523,8 +548,8 @@ const w = e.object({
|
|
|
523
548
|
deltaPercent: e.union([e.number(), e.null()]).optional()
|
|
524
549
|
}).passthrough().optional(),
|
|
525
550
|
records: p.optional()
|
|
526
|
-
}).passthrough(),
|
|
527
|
-
...
|
|
551
|
+
}).passthrough(), Ne = e.object({
|
|
552
|
+
...f,
|
|
528
553
|
kind: e.literal("records"),
|
|
529
554
|
columns: e.array(l),
|
|
530
555
|
records: p,
|
|
@@ -547,16 +572,16 @@ const w = e.object({
|
|
|
547
572
|
"unsupported_dependency",
|
|
548
573
|
"override_not_eligible"
|
|
549
574
|
]).optional()
|
|
550
|
-
}),
|
|
575
|
+
}), Se = e.object({
|
|
551
576
|
complete: e.boolean(),
|
|
552
577
|
reason: e.enum(["unsupported", "truncated"]).optional()
|
|
553
|
-
}),
|
|
554
|
-
...
|
|
578
|
+
}), Ve = e.object({
|
|
579
|
+
...f,
|
|
555
580
|
kind: e.literal("inputOptions"),
|
|
556
581
|
dependencyOutcomes: e.array(be).optional(),
|
|
557
|
-
match:
|
|
582
|
+
match: Se.optional(),
|
|
558
583
|
options: e.array(
|
|
559
|
-
|
|
584
|
+
re(
|
|
560
585
|
{
|
|
561
586
|
label: e.string(),
|
|
562
587
|
value: e.unknown(),
|
|
@@ -566,8 +591,8 @@ const w = e.object({
|
|
|
566
591
|
["value"]
|
|
567
592
|
)
|
|
568
593
|
)
|
|
569
|
-
}).passthrough(),
|
|
570
|
-
...
|
|
594
|
+
}).passthrough(), Ue = e.object({
|
|
595
|
+
...f,
|
|
571
596
|
kind: e.literal("sql"),
|
|
572
597
|
columns: e.array(l),
|
|
573
598
|
records: p,
|
|
@@ -578,53 +603,56 @@ const w = e.object({
|
|
|
578
603
|
}).passthrough().optional()
|
|
579
604
|
}).passthrough();
|
|
580
605
|
export {
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
C,
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
606
|
+
we as A,
|
|
607
|
+
O as B,
|
|
608
|
+
ce as C,
|
|
609
|
+
le as D,
|
|
610
|
+
pe as E,
|
|
611
|
+
N as F,
|
|
612
|
+
me as G,
|
|
613
|
+
V as H,
|
|
614
|
+
Fe as I,
|
|
615
|
+
Ae as J,
|
|
616
|
+
l as K,
|
|
617
|
+
Me as L,
|
|
618
|
+
Re as M,
|
|
619
|
+
Ce as N,
|
|
620
|
+
P as O,
|
|
621
|
+
I as P,
|
|
622
|
+
Oe as Q,
|
|
598
623
|
ke as R,
|
|
599
624
|
Ie as S,
|
|
600
625
|
xe as T,
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
626
|
+
Ee as U,
|
|
627
|
+
Ne as V,
|
|
628
|
+
be as W,
|
|
629
|
+
Se as X,
|
|
630
|
+
Ve as Y,
|
|
631
|
+
Ue as Z,
|
|
632
|
+
B as a,
|
|
633
|
+
k as b,
|
|
634
|
+
ve as c,
|
|
607
635
|
D as d,
|
|
608
|
-
|
|
609
|
-
|
|
636
|
+
Te as e,
|
|
637
|
+
Z as f,
|
|
610
638
|
p as g,
|
|
611
639
|
u as h,
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
640
|
+
G as i,
|
|
641
|
+
Q as j,
|
|
642
|
+
j as k,
|
|
643
|
+
oe as l,
|
|
644
|
+
w as m,
|
|
617
645
|
R as n,
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
646
|
+
ne as o,
|
|
647
|
+
F as p,
|
|
648
|
+
A as q,
|
|
649
|
+
J as r,
|
|
650
|
+
E as s,
|
|
651
|
+
Y as t,
|
|
652
|
+
M as u,
|
|
653
|
+
C as v,
|
|
654
|
+
ie as w,
|
|
655
|
+
De as x,
|
|
656
|
+
je as y,
|
|
657
|
+
se as z
|
|
630
658
|
};
|