react-semaphor 0.1.559 → 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 +389 -378
- 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-CB3oFAXk.js +658 -0
- package/dist/chunks/{assistant-chat-B_4bVE6I.js → assistant-chat-DiVHY3Hw.js} +209 -211
- package/dist/chunks/bookmark-impact-CR09dpkn.js +75 -0
- package/dist/chunks/bookmark-state-BusLpkb7.js +743 -0
- package/dist/chunks/{braces-Rdxa3H-s.js → braces-u8VorWJc.js} +1 -1
- package/dist/chunks/{comparison-window-caption-CKzQ5LcF.js → comparison-window-caption-DDsIWJYT.js} +201 -201
- package/dist/chunks/{context-DVy4HOU0.js → context-TUjw9eqr.js} +1 -1
- package/dist/chunks/{custom-visual-inputs-zVa9wX_o.js → custom-visual-inputs-DfolidZ9.js} +1 -1
- package/dist/chunks/{dashboard-BziwOVpZ.js → dashboard-BRdZBPqr.js} +1 -1
- package/dist/chunks/{dashboard-briefing-launcher-CbeNR-YI.js → dashboard-briefing-launcher-CgvTLndW.js} +1163 -1178
- package/dist/chunks/{dashboard-controls-RD6UJs1r.js → dashboard-controls-B4vfSzTF.js} +877 -941
- package/dist/chunks/{dashboard-json-DGpv17vL.js → dashboard-json-Y3MF59g7.js} +5 -5
- package/dist/chunks/document-dashboard-inputs-CvBbFTUA.js +1718 -0
- package/dist/chunks/{edit-dashboard-visual-AQ2pQkFp.js → edit-dashboard-visual-DwjZcxj-.js} +9080 -9354
- package/dist/chunks/filter-reach-copy-bijwf_-b.js +3596 -0
- package/dist/chunks/{filter-value-text-B4l-xqJT.js → filter-value-text-DFnhwuEW.js} +3 -3
- package/dist/chunks/global-date-filter-utils-BXgCpvQM.js +15142 -0
- package/dist/chunks/{index-B1Xr7W24.js → index-ClwbY3BL.js} +648 -674
- package/dist/chunks/{layout-grid-Bbz3zKif.js → layout-grid-CtvCBfOm.js} +1 -1
- package/dist/chunks/{list-filter-3sbH0Uy1.js → list-filter-BklYgciR.js} +1 -1
- package/dist/chunks/{matrix-analytical-definition-CEe3PGEo.js → matrix-analytical-definition-pU51-JmY.js} +4 -4
- package/dist/chunks/{matrix-card-BRNGb1C4.js → matrix-card-CUorIB7Q.js} +3 -3
- package/dist/chunks/{matrix-member-presentation-CEegvTqg.js → matrix-member-presentation-Df5UgCGN.js} +1 -1
- package/dist/chunks/{matrix-operation-contract-COxrfQTS.js → matrix-operation-contract-BSiGEXVC.js} +221 -214
- package/dist/chunks/{metric-comparison-DQx-uX__.js → metric-comparison-95aC0uEO.js} +6 -6
- package/dist/chunks/{model-change-CJEj3ZD6.js → model-change-B5wQhg5G.js} +1 -1
- package/dist/chunks/{palette-DMJtp3Vn.js → palette-DTnMhipt.js} +1 -1
- package/dist/chunks/pivot-result-contract-expectations-Bo-86vwS.js +56 -0
- package/dist/chunks/{pivot-result-identity-CAj8SiRL.js → pivot-result-identity-olvXJoB9.js} +1 -1
- package/dist/chunks/{report-preferences-dialog-0sc8B1lh.js → report-preferences-dialog-C2YUIwKG.js} +55 -55
- package/dist/chunks/{report-runtime-context-bYoExeWr.js → report-runtime-context-DoIUr3MP.js} +2 -2
- package/dist/chunks/resolve-dashboard-input-context-q_iiNXE1.js +6503 -0
- package/dist/chunks/{save-DSb1jTtG.js → save-DH4RyrnG.js} +1 -1
- package/dist/chunks/{saved-dashboard-context-BQWM3ldX.js → saved-dashboard-context-8jqfI7hI.js} +59 -59
- package/dist/chunks/{selection-reducer-DSzMWb4x.js → selection-reducer-CV7K4FI6.js} +1 -1
- package/dist/chunks/{semaphor-ready-indicator-Bz14Oma5.js → semaphor-ready-indicator-E2XWyibu.js} +40105 -41658
- package/dist/chunks/{shelf-drop-preview-context-DBHAkgch.js → shelf-drop-preview-context-C29EUzDp.js} +570 -570
- package/dist/chunks/{source-entity-resolution-BOrmNCEM.js → source-entity-resolution-BXI3nQ5Z.js} +1 -1
- package/dist/chunks/{switch-Dq8XPFpT.js → switch-balDSHc7.js} +3 -3
- package/dist/chunks/{table-export-sheet-C_RvEUyO.js → table-export-sheet-CK8tvh4d.js} +1 -1
- package/dist/chunks/temporal-input-presentation-B77JsAzU.js +5002 -0
- package/dist/chunks/{token-types-LCYMJ3pa.js → token-types-DhYH5YKb.js} +1 -1
- package/dist/chunks/{upload-Dr_WAxHQ.js → upload-Ufj8vjyn.js} +1 -1
- package/dist/chunks/{use-create-flow-overlay-state-BK3YFkfc.js → use-create-flow-overlay-state-9WsnzEO5.js} +6 -6
- package/dist/chunks/{validators-C87JPd-_.js → validators-BtaCFIEB.js} +1206 -1579
- package/dist/chunks/{zoned-wall-clock-E35Frf9v.js → zoned-wall-clock-CGLVI40Q.js} +1 -1
- package/dist/dashboard/index.js +2 -2
- package/dist/dashboard-authoring/index.js +2713 -1459
- 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 +262 -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/components/editor/editor-aside/utils.d.ts +1 -1
- package/dist/types/components/visual/data-table/types/data-table.d.ts +5 -20
- package/dist/types/index.js +50 -51
- package/dist/types/lib/formatters/canonical-format-adapter.d.ts +2 -29
- package/dist/types/lib/formatters/kpi-number-formatter.d.ts +41 -0
- package/dist/types/lib/formatters/raw-temporal-presentation.d.ts +0 -2
- package/dist/types/lib/formatters/table-column-settings.d.ts +47 -0
- package/dist/types/lib/matrix-table/matrix-card-adapter.d.ts +10 -188
- package/dist/types/lib/matrix-table/matrix-delivery-policy.d.ts +1 -1
- package/dist/types/lib/matrix-table/matrix-delivery.d.ts +16 -372
- package/dist/types/lib/stores/dashboard-store.d.ts +0 -1
- package/dist/types/lib/stores/editor-store.d.ts +48 -10
- package/dist/types/lib/stores/table-actions.d.ts +9 -5
- package/dist/types/lib/table-formatting/index.d.ts +0 -2
- package/dist/types/lib/table-formatting/table-conditional-formatting-range-source.d.ts +3 -2
- package/dist/types/lib/table-formatting/table-conditional-formatting-range.d.ts +3 -2
- package/dist/types/lib/table-formatting/table-formatting-normalize.d.ts +1 -2
- package/dist/types/lib/table-formatting/table-formatting-render-model.d.ts +9 -0
- package/dist/types/lib/table-formatting/table-formatting-types.d.ts +5 -95
- package/dist/types/lib/table-formatting/table-presentation-fields.d.ts +35 -0
- package/dist/types/lib/types/common-types.d.ts +40 -47
- package/dist/types/lib/types/explorer-types.d.ts +11 -43
- package/dist/types/lib/utils/card-config-utils.d.ts +8 -0
- package/dist/types/lib/utils/card-definition.d.ts +9 -187
- package/dist/types/shared/analytics-protocol/analytics-base-schemas.d.ts +169 -513
- package/dist/types/shared/analytics-protocol/contracts.d.ts +32 -9
- package/dist/types/shared/analytics-protocol/execution-input-schemas.d.ts +108 -980
- package/dist/types/shared/analytics-protocol/field-validation.d.ts +1 -0
- package/dist/types/shared/analytics-protocol/matrix-definition-contract.d.ts +281 -4624
- package/dist/types/shared/analytics-protocol/matrix-operation-contract.d.ts +20 -20
- package/dist/types/shared/analytics-protocol/matrix-operation-request.d.ts +18 -18
- package/dist/types/shared/analytics-protocol/matrix-path-contract.d.ts +40 -40
- package/dist/types/shared/analytics-protocol/matrix-window-contract.d.ts +3 -203
- package/dist/types/shared/analytics-protocol/measure-aggregation-profile.d.ts +12 -0
- package/dist/types/shared/analytics-protocol/scalar-value.d.ts +8 -8
- package/dist/types/shared/assistant-context/saved-dashboard-context.d.ts +8 -0
- package/dist/types/shared/assistant-protocol/context.d.ts +69 -69
- package/dist/types/shared/dashboard-authoring/canonical-result-keys.d.ts +13 -0
- package/dist/types/shared/dashboard-authoring/card-export-request.d.ts +4 -1
- package/dist/types/shared/dashboard-authoring/card-formats/sql-date-pattern.d.ts +10 -0
- package/dist/types/shared/dashboard-authoring/card-formats/upgrade-card-formats.d.ts +57 -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 +555 -38
- 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/editable.d.ts +14 -0
- package/dist/types/shared/dashboard-authoring/conditional-formatting/evaluate.d.ts +16 -0
- package/dist/types/shared/dashboard-authoring/conditional-formatting/index.d.ts +9 -0
- package/dist/types/shared/dashboard-authoring/conditional-formatting/kpi.d.ts +7 -0
- package/dist/types/shared/dashboard-authoring/conditional-formatting/resolve-card-column-ref.d.ts +17 -0
- package/dist/types/shared/dashboard-authoring/conditional-formatting/retain.d.ts +14 -0
- package/dist/types/shared/dashboard-authoring/conditional-formatting/schema.d.ts +4499 -0
- package/dist/types/shared/dashboard-authoring/conditional-formatting/store.d.ts +12 -0
- package/dist/types/shared/dashboard-authoring/conditional-formatting/types.d.ts +151 -0
- package/dist/types/shared/dashboard-authoring/conditional-formatting/upgrade.d.ts +35 -0
- package/dist/types/shared/dashboard-authoring/control-execution-contract.d.ts +62 -62
- package/dist/types/shared/dashboard-authoring/index.d.ts +8 -0
- package/dist/types/shared/dashboard-authoring/kpi-figure.d.ts +123 -0
- package/dist/types/shared/dashboard-authoring/matrix-authoring.d.ts +4 -5
- package/dist/types/shared/dashboard-authoring/matrix-delivery.d.ts +24 -736
- 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-authoring/retired-presentation-fields.d.ts +31 -0
- package/dist/types/shared/dashboard-authoring/upgrade-card-presentation.d.ts +14 -0
- package/dist/types/shared/dashboard-viewer/bookmark-impact.d.ts +33 -0
- package/dist/types/shared/format-utils/formatters/matrix-formatter.d.ts +13 -2
- package/dist/types/shared/format-utils/formatters/number-formatter.d.ts +16 -0
- package/dist/types/shared/format-utils/index.d.ts +2 -0
- package/dist/types/shared/format-utils/matrix-export-presentation.d.ts +10 -366
- package/dist/types/shared/format-utils/raw-temporal.d.ts +31 -1
- package/dist/types/shared/format-utils/resolve-column-format.d.ts +43 -0
- package/dist/types/shared/format-utils/retired-format-adapters.d.ts +68 -0
- package/dist/types/shared/format-utils/semantic-format.d.ts +5 -1
- package/dist/types/shared/format-utils/stored-value-format.d.ts +16 -0
- package/dist/types/shared/format-utils/types/format-types.d.ts +10 -12
- package/package.json +2 -2
- package/dist/chunks/analytics-base-schemas-BUFUoO6G.js +0 -472
- package/dist/chunks/bookmark-state-ssqrs5oP.js +0 -111
- package/dist/chunks/document-dashboard-inputs-ChVkcBuu.js +0 -3010
- package/dist/chunks/editor-draft-sync-BN5qYHPF.js +0 -15
- package/dist/chunks/filter-reach-copy-B5Y7FHzg.js +0 -3411
- package/dist/chunks/global-date-filter-utils-DBzEOX9M.js +0 -12222
- package/dist/chunks/pivot-result-contract-expectations-DOYhqeZb.js +0 -1926
- package/dist/chunks/raw-temporal-presentation-BmT7z6NH.js +0 -584
- package/dist/chunks/resolve-dashboard-input-context-B_C_VAJH.js +0 -5520
- package/dist/chunks/table-settings-DXj_zXwS.js +0 -637
- package/dist/chunks/temporal-input-presentation-AhLSkGPf.js +0 -2939
- package/dist/types/lib/table-formatting/table-conditional-formatting-evaluator.d.ts +0 -9
- package/dist/types/lib/table-formatting/table-formatting-validation.d.ts +0 -12
package/dist/chunks/{matrix-operation-contract-COxrfQTS.js → matrix-operation-contract-BSiGEXVC.js}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z as t } from "zod";
|
|
2
|
-
import {
|
|
3
|
-
import { R as w, K as ue, Y as G, a_ as ee, t as A, S as
|
|
2
|
+
import { x as je, K as Fe, U as Le, V as Ue, Y as qe, Z as De, s as U, I as Z, n as Me, P as Be, Q as ce, g as Ge, r as ze, J as Ve, B as We, C as Ke, b as le, F as Xe } from "./analytics-base-schemas-CB3oFAXk.js";
|
|
3
|
+
import { R as w, K as ue, Y as G, a_ as ee, t as A, S as Ze, aU as $, M as $e, s as Ye, H as de, ag as He, r as Qe, aj as Je, m as et } from "./validators-BtaCFIEB.js";
|
|
4
4
|
const Y = {
|
|
5
5
|
answerSummary: "string",
|
|
6
6
|
responseDetail: "responseDetail",
|
|
@@ -61,7 +61,7 @@ const Y = {
|
|
|
61
61
|
"timeout",
|
|
62
62
|
"budget_exceeded",
|
|
63
63
|
"cancelled"
|
|
64
|
-
],
|
|
64
|
+
], tt = {
|
|
65
65
|
invalid_request: 400,
|
|
66
66
|
missing_relationship: 400,
|
|
67
67
|
ambiguous_relationship: 400,
|
|
@@ -74,29 +74,29 @@ const Y = {
|
|
|
74
74
|
timeout: 504,
|
|
75
75
|
budget_exceeded: 413,
|
|
76
76
|
cancelled: 499
|
|
77
|
-
},
|
|
78
|
-
function
|
|
77
|
+
}, nt = /* @__PURE__ */ new Set(["execution_failed", "timeout"]);
|
|
78
|
+
function at(e) {
|
|
79
79
|
return typeof e == "string" && me.includes(e);
|
|
80
80
|
}
|
|
81
|
-
function
|
|
81
|
+
function rt(e, n, a = {}) {
|
|
82
82
|
return {
|
|
83
83
|
code: e,
|
|
84
84
|
message: n,
|
|
85
85
|
...a.details ? { details: a.details } : {},
|
|
86
86
|
...a.nextStep ? { nextStep: a.nextStep } : {},
|
|
87
|
-
retryable:
|
|
88
|
-
status: a.status ??
|
|
87
|
+
retryable: nt.has(e),
|
|
88
|
+
status: a.status ?? tt[e]
|
|
89
89
|
};
|
|
90
90
|
}
|
|
91
|
-
function
|
|
91
|
+
function cn(e) {
|
|
92
92
|
if (!e || typeof e != "object") return;
|
|
93
93
|
const n = e.refusal ?? e;
|
|
94
94
|
if (!n || typeof n != "object") return;
|
|
95
95
|
const { code: a, message: r } = n;
|
|
96
|
-
if (!(!
|
|
96
|
+
if (!(!at(a) || typeof r != "string"))
|
|
97
97
|
return n;
|
|
98
98
|
}
|
|
99
|
-
const
|
|
99
|
+
const st = {
|
|
100
100
|
invalid_request: { message: "This query configuration cannot run.", nextStep: "Check the selected fields, filters and parameters." },
|
|
101
101
|
missing_relationship: { message: "The selected data is not connected.", nextStep: "Choose related datasets or ask the owner to add a relationship." },
|
|
102
102
|
ambiguous_relationship: { message: "The selected data has more than one relationship path.", nextStep: "Choose the relationship to use." },
|
|
@@ -110,29 +110,29 @@ const rt = {
|
|
|
110
110
|
budget_exceeded: { message: "The query exceeds this view’s limits.", nextStep: "Request fewer rows, columns or measures." },
|
|
111
111
|
cancelled: { message: "The query was cancelled.", nextStep: "Reload the view when ready." }
|
|
112
112
|
};
|
|
113
|
-
function
|
|
114
|
-
const n =
|
|
113
|
+
function ln(e) {
|
|
114
|
+
const n = st[e.code], a = rt(e.code, n.message, { nextStep: n.nextStep, status: e.status }), r = e.retryable ?? a.retryable;
|
|
115
115
|
return {
|
|
116
116
|
...a,
|
|
117
117
|
retryable: r,
|
|
118
118
|
...!r && a.retryable ? { nextStep: "Ask the owner to check the query." } : {}
|
|
119
119
|
};
|
|
120
120
|
}
|
|
121
|
-
const
|
|
121
|
+
const ot = [
|
|
122
122
|
...me,
|
|
123
123
|
"stale_cursor",
|
|
124
124
|
"source_truncated"
|
|
125
|
-
],
|
|
125
|
+
], un = Object.freeze({
|
|
126
126
|
coordinates: 2e4,
|
|
127
127
|
responseBytes: 5 * 1024 * 1024
|
|
128
|
-
}), O = t.string().uuid(), y = t.string().min(1),
|
|
128
|
+
}), O = t.string().uuid(), y = t.string().min(1), it = t.number().int().positive().max(Number.MAX_SAFE_INTEGER);
|
|
129
129
|
function f(e, n, a) {
|
|
130
130
|
e.addIssue({ code: "custom", path: n, message: a });
|
|
131
131
|
}
|
|
132
132
|
function v(e, n, a) {
|
|
133
133
|
new Set(e).size !== e.length && f(n, a, "Duplicate identity.");
|
|
134
134
|
}
|
|
135
|
-
const
|
|
135
|
+
const ct = t.object({
|
|
136
136
|
id: y,
|
|
137
137
|
axis: ue,
|
|
138
138
|
parent: w,
|
|
@@ -140,18 +140,18 @@ const it = t.object({
|
|
|
140
140
|
t.object({ kind: t.literal("first") }).strict(),
|
|
141
141
|
t.object({ kind: t.enum(["after", "before"]), cursor: y }).strict()
|
|
142
142
|
]),
|
|
143
|
-
size:
|
|
143
|
+
size: it
|
|
144
144
|
}).strict(), te = t.object({
|
|
145
145
|
paths: t.array(w).readonly(),
|
|
146
146
|
pageIds: t.array(y).readonly()
|
|
147
|
-
}).strict(),
|
|
147
|
+
}).strict(), lt = t.object({
|
|
148
148
|
id: y,
|
|
149
149
|
rows: te,
|
|
150
150
|
columns: te,
|
|
151
151
|
measureIds: t.array(O).min(1).readonly()
|
|
152
152
|
}).strict(), pe = t.object({
|
|
153
|
-
pages: t.array(
|
|
154
|
-
blocks: t.array(
|
|
153
|
+
pages: t.array(ct).readonly(),
|
|
154
|
+
blocks: t.array(lt).readonly()
|
|
155
155
|
}).strict().superRefine((e, n) => {
|
|
156
156
|
!e.pages.length && !e.blocks.length && f(n, [], "Request at least one page or block."), v(
|
|
157
157
|
[...e.pages, ...e.blocks].map((a) => a.id),
|
|
@@ -170,7 +170,7 @@ const it = t.object({
|
|
|
170
170
|
"Page reference must name a page on this axis in this operation."
|
|
171
171
|
);
|
|
172
172
|
}
|
|
173
|
-
}),
|
|
173
|
+
}), dn = t.object({ spec: G, request: pe }).strict().superRefine(({ spec: e, request: n }, a) => {
|
|
174
174
|
for (const r of n.pages)
|
|
175
175
|
ee(
|
|
176
176
|
e,
|
|
@@ -190,7 +190,7 @@ const it = t.object({
|
|
|
190
190
|
for (const c of r[s].paths)
|
|
191
191
|
ee(e, s, c, a, ["blocks", r.id, s]);
|
|
192
192
|
}
|
|
193
|
-
}),
|
|
193
|
+
}), ut = t.object({
|
|
194
194
|
requestId: y,
|
|
195
195
|
axis: ue,
|
|
196
196
|
parent: w,
|
|
@@ -229,11 +229,11 @@ function fe(e, n) {
|
|
|
229
229
|
const a = e.rowPaths.map(A), r = e.columnPaths.map(A);
|
|
230
230
|
return v(a, n, ["coverage", "rowPaths"]), v(r, n, ["coverage", "columnPaths"]), v(e.measureIds, n, ["coverage", "measureIds"]), { rows: a, columns: r };
|
|
231
231
|
}
|
|
232
|
-
const
|
|
232
|
+
const dt = t.object({
|
|
233
233
|
requestId: y,
|
|
234
234
|
coverage: he,
|
|
235
235
|
cells: t.array(
|
|
236
|
-
|
|
236
|
+
Ze.extend({ value: $ }).strict()
|
|
237
237
|
).readonly()
|
|
238
238
|
}).strict().superRefine((e, n) => {
|
|
239
239
|
const { rows: a, columns: r } = fe(e.coverage, n), s = new Set(a), c = new Set(r), i = new Set(e.coverage.measureIds);
|
|
@@ -250,11 +250,11 @@ const ut = t.object({
|
|
|
250
250
|
);
|
|
251
251
|
for (const l of e.cells)
|
|
252
252
|
(!s.has(A(l.rowPath)) || !c.has(A(l.columnPath)) || !i.has(l.measureId)) && f(n, ["cells"], "Cell is outside certified coverage.");
|
|
253
|
-
}), q = t.number().int().nonnegative(),
|
|
253
|
+
}), q = t.number().int().nonnegative(), mt = t.object({
|
|
254
254
|
requestId: y,
|
|
255
255
|
coverage: he,
|
|
256
256
|
values: t.array(
|
|
257
|
-
t.tuple([q, q, q,
|
|
257
|
+
t.tuple([q, q, q, $]).readonly()
|
|
258
258
|
).readonly()
|
|
259
259
|
}).strict().superRefine((e, n) => {
|
|
260
260
|
fe(e.coverage, n);
|
|
@@ -269,14 +269,14 @@ const ut = t.object({
|
|
|
269
269
|
}
|
|
270
270
|
}), ne = t.object({
|
|
271
271
|
id: O,
|
|
272
|
-
column:
|
|
272
|
+
column: Fe,
|
|
273
273
|
nativeDataType: y,
|
|
274
|
-
semanticFormat:
|
|
274
|
+
semanticFormat: je.optional()
|
|
275
275
|
}).strict(), ge = t.object({
|
|
276
276
|
levels: t.array(ne).readonly(),
|
|
277
277
|
measures: t.array(ne).readonly()
|
|
278
278
|
}).strict(), H = t.object({
|
|
279
|
-
code: t.enum(
|
|
279
|
+
code: t.enum(ot),
|
|
280
280
|
message: y,
|
|
281
281
|
/** Technical cause for dashboard owners; never shown as the primary copy. */
|
|
282
282
|
detail: y.optional(),
|
|
@@ -288,16 +288,16 @@ const ut = t.object({
|
|
|
288
288
|
t.object({ kind: t.literal("operation") }).strict(),
|
|
289
289
|
t.object({ kind: t.enum(["page", "block"]), requestId: y }).strict()
|
|
290
290
|
])
|
|
291
|
-
}).strict(),
|
|
291
|
+
}).strict(), pt = t.object({
|
|
292
292
|
dialect: t.enum(["postgres", "clickhouse", "duckdb", "snowflake"]),
|
|
293
|
-
aggregates: t.array(
|
|
293
|
+
aggregates: t.array($e).readonly()
|
|
294
294
|
}).strict();
|
|
295
295
|
function ye(e) {
|
|
296
296
|
return t.object({
|
|
297
297
|
queryIdentity: y,
|
|
298
298
|
descriptors: ge,
|
|
299
|
-
capabilities:
|
|
300
|
-
pages: t.array(
|
|
299
|
+
capabilities: pt,
|
|
300
|
+
pages: t.array(ut).readonly(),
|
|
301
301
|
blocks: t.array(e).readonly(),
|
|
302
302
|
failures: t.array(H).readonly()
|
|
303
303
|
}).strict().superRefine((n, a) => {
|
|
@@ -356,9 +356,9 @@ function ye(e) {
|
|
|
356
356
|
});
|
|
357
357
|
}
|
|
358
358
|
const Se = ye(
|
|
359
|
-
ut
|
|
360
|
-
), pt = ye(
|
|
361
359
|
dt
|
|
360
|
+
), ht = ye(
|
|
361
|
+
mt
|
|
362
362
|
);
|
|
363
363
|
function be(e) {
|
|
364
364
|
return t.union([
|
|
@@ -378,12 +378,12 @@ function be(e) {
|
|
|
378
378
|
), r.status === "success" != (s.failures.length === 0) && f(a, ["status"], "Status must match failure coverage.");
|
|
379
379
|
});
|
|
380
380
|
}
|
|
381
|
-
const
|
|
381
|
+
const mn = be(
|
|
382
382
|
Se
|
|
383
|
-
),
|
|
384
|
-
|
|
383
|
+
), pn = be(
|
|
384
|
+
ht
|
|
385
385
|
);
|
|
386
|
-
function
|
|
386
|
+
function ft(e) {
|
|
387
387
|
const { rowPaths: n, columnPaths: a, measureIds: r } = e.coverage, s = (m) => new Map(m.map((o, d) => [o, d])), c = s(n.map(A)), i = s(a.map(A)), l = s(r);
|
|
388
388
|
return {
|
|
389
389
|
requestId: e.requestId,
|
|
@@ -396,7 +396,7 @@ function ht(e) {
|
|
|
396
396
|
})
|
|
397
397
|
};
|
|
398
398
|
}
|
|
399
|
-
function
|
|
399
|
+
function gt(e) {
|
|
400
400
|
const { rowPaths: n, columnPaths: a, measureIds: r } = e.coverage;
|
|
401
401
|
return {
|
|
402
402
|
requestId: e.requestId,
|
|
@@ -409,19 +409,19 @@ function ft(e) {
|
|
|
409
409
|
}))
|
|
410
410
|
};
|
|
411
411
|
}
|
|
412
|
-
function
|
|
413
|
-
return { ...e, blocks: e.blocks.map(ht) };
|
|
414
|
-
}
|
|
415
|
-
function mn(e) {
|
|
412
|
+
function yt(e) {
|
|
416
413
|
return { ...e, blocks: e.blocks.map(ft) };
|
|
417
414
|
}
|
|
418
|
-
function
|
|
419
|
-
return
|
|
415
|
+
function hn(e) {
|
|
416
|
+
return { ...e, blocks: e.blocks.map(gt) };
|
|
417
|
+
}
|
|
418
|
+
function fn(e) {
|
|
419
|
+
return e.status === "failed" ? e : { status: e.status, window: yt(e.window) };
|
|
420
420
|
}
|
|
421
421
|
const Ae = t.object({
|
|
422
422
|
kind: t.literal("matrix"),
|
|
423
423
|
window: Se
|
|
424
|
-
}).strict(), Ie = t.enum(["member", "subtotal", "grand_total"]),
|
|
424
|
+
}).strict(), Ie = t.enum(["member", "subtotal", "grand_total"]), St = t.discriminatedUnion("kind", [
|
|
425
425
|
t.object({ kind: t.literal("hierarchy"), label: t.string() }).strict(),
|
|
426
426
|
t.object({ kind: t.literal("level"), levelId: O, label: t.string() }).strict(),
|
|
427
427
|
t.object({
|
|
@@ -431,18 +431,18 @@ const Ae = t.object({
|
|
|
431
431
|
role: Ie,
|
|
432
432
|
label: t.string()
|
|
433
433
|
}).strict()
|
|
434
|
-
]),
|
|
435
|
-
columns: t.array(
|
|
434
|
+
]), bt = t.object({
|
|
435
|
+
columns: t.array(St).readonly(),
|
|
436
436
|
descriptors: ge
|
|
437
437
|
}).strict(), ae = t.union([
|
|
438
438
|
t.object({
|
|
439
439
|
kind: t.literal("value"),
|
|
440
|
-
value:
|
|
440
|
+
value: $.refine(
|
|
441
441
|
(e) => e !== null
|
|
442
442
|
)
|
|
443
443
|
}).strict(),
|
|
444
444
|
t.object({ kind: t.enum(["null", "empty"]) }).strict()
|
|
445
|
-
]),
|
|
445
|
+
]), At = t.discriminatedUnion("kind", [
|
|
446
446
|
t.object({
|
|
447
447
|
kind: t.literal("layout"),
|
|
448
448
|
rowPath: w,
|
|
@@ -455,24 +455,24 @@ const Ae = t.object({
|
|
|
455
455
|
columnPath: w,
|
|
456
456
|
values: t.array(ae).readonly()
|
|
457
457
|
}).strict()
|
|
458
|
-
]),
|
|
458
|
+
]), gn = t.discriminatedUnion("kind", [
|
|
459
459
|
t.object({
|
|
460
460
|
kind: t.literal("layout"),
|
|
461
|
-
layout:
|
|
461
|
+
layout: bt,
|
|
462
462
|
next: y
|
|
463
463
|
}).strict(),
|
|
464
464
|
t.object({
|
|
465
465
|
kind: t.literal("rows"),
|
|
466
|
-
rows: t.array(
|
|
466
|
+
rows: t.array(At).readonly(),
|
|
467
467
|
next: y.nullable()
|
|
468
468
|
}).strict()
|
|
469
|
-
]),
|
|
470
|
-
Fe,
|
|
469
|
+
]), It = t.union([
|
|
471
470
|
Le,
|
|
472
471
|
Ue,
|
|
473
472
|
qe,
|
|
473
|
+
De,
|
|
474
474
|
Ae
|
|
475
|
-
]),
|
|
475
|
+
]), _t = t.object({
|
|
476
476
|
status: t.enum([
|
|
477
477
|
"not_required",
|
|
478
478
|
"resolved",
|
|
@@ -516,7 +516,7 @@ const Ae = t.object({
|
|
|
516
516
|
queryId: t.string().optional(),
|
|
517
517
|
summary: t.string(),
|
|
518
518
|
evidenceIds: t.array(t.string()).optional(),
|
|
519
|
-
fieldsUsed: t.array(
|
|
519
|
+
fieldsUsed: t.array(Z).optional()
|
|
520
520
|
}).passthrough()
|
|
521
521
|
),
|
|
522
522
|
blocked: t.array(
|
|
@@ -543,11 +543,11 @@ const Ae = t.object({
|
|
|
543
543
|
).optional()
|
|
544
544
|
}).passthrough(), ke = t.object({
|
|
545
545
|
scope: t.literal("filtered_query"),
|
|
546
|
-
measures: t.record(
|
|
546
|
+
measures: t.record(Me)
|
|
547
547
|
}).passthrough(), we = t.object({
|
|
548
548
|
answeredObligations: t.array(t.string()),
|
|
549
549
|
missingObligations: t.array(t.string()),
|
|
550
|
-
warnings: t.array(
|
|
550
|
+
warnings: t.array(Be).optional()
|
|
551
551
|
}).passthrough(), ve = t.object({
|
|
552
552
|
intentId: t.string().optional(),
|
|
553
553
|
queryId: t.string().optional(),
|
|
@@ -563,39 +563,39 @@ const Ae = t.object({
|
|
|
563
563
|
]).optional(),
|
|
564
564
|
intent: t.unknown().optional(),
|
|
565
565
|
compiledQuery: t.unknown().optional(),
|
|
566
|
-
fieldsUsed: t.array(
|
|
567
|
-
result:
|
|
566
|
+
fieldsUsed: t.array(Z).optional(),
|
|
567
|
+
result: It.optional(),
|
|
568
568
|
validation: ce,
|
|
569
569
|
coverage: we.optional(),
|
|
570
570
|
missingFields: t.array(t.string()).optional(),
|
|
571
571
|
warnings: t.array(t.string()).optional(),
|
|
572
|
-
relationshipDiagnostics:
|
|
572
|
+
relationshipDiagnostics: _t.optional(),
|
|
573
573
|
diagnosticFeedback: _e.optional(),
|
|
574
574
|
population: ke.optional(),
|
|
575
575
|
metadata: t.record(t.string(), t.unknown()).optional()
|
|
576
|
-
}).passthrough(),
|
|
577
|
-
function
|
|
576
|
+
}).passthrough(), kt = ve;
|
|
577
|
+
function wt(e) {
|
|
578
578
|
switch (e) {
|
|
579
579
|
case "boolean":
|
|
580
580
|
return t.boolean().optional();
|
|
581
581
|
case "compactExecutionFieldArray":
|
|
582
|
-
return t.array(
|
|
582
|
+
return t.array(Ve).optional();
|
|
583
583
|
case "coverage":
|
|
584
584
|
return we.optional();
|
|
585
585
|
case "diagnosticFeedback":
|
|
586
586
|
return _e.optional();
|
|
587
587
|
case "executionFieldArray":
|
|
588
|
-
return t.array(
|
|
588
|
+
return t.array(Z).optional();
|
|
589
589
|
case "executionResult":
|
|
590
|
-
return
|
|
590
|
+
return kt.optional();
|
|
591
591
|
case "number":
|
|
592
592
|
return t.number().finite().optional();
|
|
593
593
|
case "population":
|
|
594
594
|
return ke.optional();
|
|
595
595
|
case "record":
|
|
596
|
-
return
|
|
596
|
+
return ze.optional();
|
|
597
597
|
case "recordArray":
|
|
598
|
-
return
|
|
598
|
+
return Ge.optional();
|
|
599
599
|
case "responseDetail":
|
|
600
600
|
return t.enum(["compact", "standard", "debug"]).optional();
|
|
601
601
|
case "string":
|
|
@@ -610,32 +610,32 @@ function kt(e) {
|
|
|
610
610
|
return ce.optional();
|
|
611
611
|
}
|
|
612
612
|
}
|
|
613
|
-
const
|
|
613
|
+
const vt = Object.fromEntries(
|
|
614
614
|
Object.entries(Y).map(
|
|
615
|
-
([e, n]) => [e,
|
|
615
|
+
([e, n]) => [e, wt(n)]
|
|
616
616
|
)
|
|
617
|
-
),
|
|
617
|
+
), Tt = t.object(vt).strict(), Et = new Set(
|
|
618
618
|
Object.keys(Y)
|
|
619
619
|
);
|
|
620
|
-
function
|
|
620
|
+
function yn() {
|
|
621
621
|
return Object.keys(
|
|
622
622
|
Y
|
|
623
623
|
);
|
|
624
624
|
}
|
|
625
|
-
function
|
|
626
|
-
return
|
|
625
|
+
function Rt(e) {
|
|
626
|
+
return Et.has(e);
|
|
627
627
|
}
|
|
628
|
-
function
|
|
628
|
+
function Sn(e) {
|
|
629
629
|
if (!e || typeof e != "object" || Array.isArray(e))
|
|
630
630
|
throw new Error("Semaphor analyze result must be an object.");
|
|
631
631
|
const a = Object.keys(e).filter(
|
|
632
|
-
(r) => !
|
|
632
|
+
(r) => !Rt(r)
|
|
633
633
|
);
|
|
634
634
|
if (a.length)
|
|
635
635
|
throw new Error(
|
|
636
636
|
`Semaphor analyze result contains unsupported top-level field(s): ${a.join(", ")}.`
|
|
637
637
|
);
|
|
638
|
-
return
|
|
638
|
+
return Tt.parse(e);
|
|
639
639
|
}
|
|
640
640
|
const Te = 100, F = "selection:";
|
|
641
641
|
function Ee(e) {
|
|
@@ -645,14 +645,14 @@ function Ee(e) {
|
|
|
645
645
|
e.sourceField ?? ""
|
|
646
646
|
].join("::");
|
|
647
647
|
}
|
|
648
|
-
function
|
|
648
|
+
function bn(e) {
|
|
649
649
|
return `${F}${e}`;
|
|
650
650
|
}
|
|
651
|
-
function
|
|
651
|
+
function Ct(e) {
|
|
652
652
|
return e.startsWith(F) && e.length > F.length;
|
|
653
653
|
}
|
|
654
|
-
function
|
|
655
|
-
return
|
|
654
|
+
function An(e) {
|
|
655
|
+
return Ct(e) ? e.slice(F.length) : void 0;
|
|
656
656
|
}
|
|
657
657
|
function Re(e) {
|
|
658
658
|
if (!e) return "";
|
|
@@ -664,7 +664,7 @@ function Re(e) {
|
|
|
664
664
|
n ? [n.kind, n.yearStartMonth] : null
|
|
665
665
|
]);
|
|
666
666
|
}
|
|
667
|
-
function
|
|
667
|
+
function Nt(e) {
|
|
668
668
|
return JSON.stringify([
|
|
669
669
|
Ee(e.field),
|
|
670
670
|
e.operator,
|
|
@@ -673,7 +673,7 @@ function Ct(e) {
|
|
|
673
673
|
]);
|
|
674
674
|
}
|
|
675
675
|
function se(e) {
|
|
676
|
-
return JSON.stringify(e.conditions.map(
|
|
676
|
+
return JSON.stringify(e.conditions.map(Nt).sort());
|
|
677
677
|
}
|
|
678
678
|
function z(e) {
|
|
679
679
|
return JSON.stringify([
|
|
@@ -689,7 +689,7 @@ function oe(e) {
|
|
|
689
689
|
e.conditions.map(z).sort()
|
|
690
690
|
);
|
|
691
691
|
}
|
|
692
|
-
function
|
|
692
|
+
function In(e) {
|
|
693
693
|
const n = e.map((a) => a.id);
|
|
694
694
|
if (new Set(n).size !== n.length)
|
|
695
695
|
throw new Error("Data App selections require one active selection per id.");
|
|
@@ -714,23 +714,23 @@ function bn(e) {
|
|
|
714
714
|
function D(e, n) {
|
|
715
715
|
return e < n ? -1 : e > n ? 1 : 0;
|
|
716
716
|
}
|
|
717
|
-
function
|
|
717
|
+
function _n(e, n) {
|
|
718
718
|
return se(e) === se(n);
|
|
719
719
|
}
|
|
720
|
-
const
|
|
721
|
-
function
|
|
722
|
-
return e.conditions.map((n) => n.label ? n.label : n.operator === "isNull" || n.value === null ?
|
|
720
|
+
const Ot = "(Blank)";
|
|
721
|
+
function kn(e) {
|
|
722
|
+
return e.conditions.map((n) => n.label ? n.label : n.operator === "isNull" || n.value === null ? Ot : String(n.value)).join(" · ");
|
|
723
723
|
}
|
|
724
|
-
const
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
]),
|
|
724
|
+
const xt = t.union([
|
|
725
|
+
We,
|
|
726
|
+
Ke
|
|
727
|
+
]), Pt = t.object({
|
|
728
728
|
name: t.string().min(1),
|
|
729
|
-
source:
|
|
729
|
+
source: xt,
|
|
730
730
|
dataType: t.enum(["string", "number", "boolean", "date", "datetime"]),
|
|
731
731
|
sourceField: t.string().min(1).optional()
|
|
732
|
-
}).strict(),
|
|
733
|
-
field:
|
|
732
|
+
}).strict(), jt = t.object({
|
|
733
|
+
field: Pt,
|
|
734
734
|
operator: t.enum(["=", "isNull"]),
|
|
735
735
|
value: t.union([t.string(), t.number().finite(), t.null()]),
|
|
736
736
|
label: t.string().optional(),
|
|
@@ -741,8 +741,8 @@ const Ot = t.union([
|
|
|
741
741
|
message: "isNull carries a null value, and only isNull does.",
|
|
742
742
|
path: ["value"]
|
|
743
743
|
});
|
|
744
|
-
}),
|
|
745
|
-
conditions: t.array(
|
|
744
|
+
}), Ft = t.object({
|
|
745
|
+
conditions: t.array(jt).min(1)
|
|
746
746
|
}).strict().superRefine((e, n) => {
|
|
747
747
|
const a = e.conditions.map((r) => Ee(r.field));
|
|
748
748
|
new Set(a).size !== a.length && n.addIssue({
|
|
@@ -750,11 +750,11 @@ const Ot = t.union([
|
|
|
750
750
|
message: "A tuple holds one condition per field.",
|
|
751
751
|
path: ["conditions"]
|
|
752
752
|
});
|
|
753
|
-
}),
|
|
753
|
+
}), wn = t.object({
|
|
754
754
|
kind: t.literal("selection"),
|
|
755
755
|
sourceCardId: t.string().min(1),
|
|
756
|
-
tuples: t.array(
|
|
757
|
-
}).strict(),
|
|
756
|
+
tuples: t.array(Ft).min(1).max(Te)
|
|
757
|
+
}).strict(), Lt = t.object({
|
|
758
758
|
field: Xe,
|
|
759
759
|
operator: t.enum(["=", "isNull"]),
|
|
760
760
|
value: t.union([t.string(), t.number().finite(), t.null()]),
|
|
@@ -765,8 +765,8 @@ const Ot = t.union([
|
|
|
765
765
|
message: "isNull carries a null value, and only isNull does.",
|
|
766
766
|
path: ["value"]
|
|
767
767
|
});
|
|
768
|
-
}),
|
|
769
|
-
conditions: t.array(
|
|
768
|
+
}), Ut = t.object({
|
|
769
|
+
conditions: t.array(Lt).min(1)
|
|
770
770
|
}).strict().superRefine((e, n) => {
|
|
771
771
|
for (let a = 0; a < e.conditions.length; a += 1) {
|
|
772
772
|
const r = e.conditions[a];
|
|
@@ -778,21 +778,21 @@ const Ot = t.union([
|
|
|
778
778
|
path: ["conditions", a, "field"]
|
|
779
779
|
});
|
|
780
780
|
}
|
|
781
|
-
}),
|
|
781
|
+
}), vn = t.object({
|
|
782
782
|
id: t.string().min(1),
|
|
783
|
-
tuples: t.array(
|
|
784
|
-
}).strict(),
|
|
783
|
+
tuples: t.array(Ut).min(1).max(Te)
|
|
784
|
+
}).strict(), qt = t.object({ key: t.string().min(1), nativeText: t.string().nullable() }).strict(), Dt = t.object({
|
|
785
785
|
executionInstant: t.string().refine((e) => Qe(e) !== null, {
|
|
786
786
|
message: "executionInstant must be an ISO instant"
|
|
787
787
|
}),
|
|
788
|
-
dataAnchors: t.array(
|
|
788
|
+
dataAnchors: t.array(qt).default([])
|
|
789
789
|
}).strict().refine(
|
|
790
790
|
(e) => new Set(e.dataAnchors.map((n) => n.key)).size === e.dataAnchors.length,
|
|
791
791
|
{ message: "dataAnchors keys must be unique", path: ["dataAnchors"] }
|
|
792
792
|
);
|
|
793
|
-
function
|
|
793
|
+
function Tn(e) {
|
|
794
794
|
if (e == null) return;
|
|
795
|
-
const n =
|
|
795
|
+
const n = Dt.safeParse(e);
|
|
796
796
|
return n.success ? n.data : void 0;
|
|
797
797
|
}
|
|
798
798
|
const Ce = {
|
|
@@ -859,16 +859,16 @@ const Ce = {
|
|
|
859
859
|
COLLECT_SET: "other",
|
|
860
860
|
FIRST: "other",
|
|
861
861
|
LAST: "other"
|
|
862
|
-
},
|
|
863
|
-
function
|
|
862
|
+
}, Mt = /(?:_AGG$|^APPROX_[A-Z0-9_]+$|^COUNT_DISTINCT$|^HLL_(?:COUNT|ESTIMATE)$|^REGR_[A-Z_]+$)/;
|
|
863
|
+
function Bt(e) {
|
|
864
864
|
const n = e.toUpperCase();
|
|
865
|
-
return n in Ce ||
|
|
865
|
+
return n in Ce || Mt.test(n);
|
|
866
866
|
}
|
|
867
867
|
function Ne(e, n = !1) {
|
|
868
868
|
const a = Ce[e.toUpperCase()] ?? "other";
|
|
869
869
|
return n ? a === "count" || a === "count_distinct" ? "count_distinct" : a === "min" || a === "max" ? a : "repeat_safe_other" : a;
|
|
870
870
|
}
|
|
871
|
-
const
|
|
871
|
+
const Gt = /* @__PURE__ */ new Set([
|
|
872
872
|
"NULLIF",
|
|
873
873
|
"COALESCE",
|
|
874
874
|
"IFNULL",
|
|
@@ -883,7 +883,7 @@ const Bt = /* @__PURE__ */ new Set([
|
|
|
883
883
|
"CAST",
|
|
884
884
|
"TRY_CAST",
|
|
885
885
|
"SAFE_CAST"
|
|
886
|
-
]),
|
|
886
|
+
]), zt = /* @__PURE__ */ new Set(["DECIMAL", "NUMERIC", "INTEGER", "INT", "BIGINT", "FLOAT", "DOUBLE", "REAL", "VARCHAR", "TEXT"]), ie = /[A-Za-z_]/, Vt = /[A-Za-z0-9_]/;
|
|
887
887
|
function V(e, n) {
|
|
888
888
|
const a = e[n];
|
|
889
889
|
let r = n + 1;
|
|
@@ -920,12 +920,12 @@ function j(e, n) {
|
|
|
920
920
|
}
|
|
921
921
|
function M(e, n) {
|
|
922
922
|
let a = n + 1;
|
|
923
|
-
for (; a < e.length &&
|
|
923
|
+
for (; a < e.length && Vt.test(e[a]); ) a += 1;
|
|
924
924
|
return a;
|
|
925
925
|
}
|
|
926
|
-
const
|
|
927
|
-
function
|
|
928
|
-
return Array.from(e.matchAll(
|
|
926
|
+
const Wt = /\{([A-Za-z_][A-Za-z0-9_]*)\}/g;
|
|
927
|
+
function Kt(e) {
|
|
928
|
+
return Array.from(e.matchAll(Wt), (n) => n[1]);
|
|
929
929
|
}
|
|
930
930
|
function W(e, n = /* @__PURE__ */ new Set()) {
|
|
931
931
|
const a = [], r = [];
|
|
@@ -947,7 +947,7 @@ function W(e, n = /* @__PURE__ */ new Set()) {
|
|
|
947
947
|
}
|
|
948
948
|
if (ie.test(m)) {
|
|
949
949
|
const o = M(e, l), d = e.slice(l, o), p = j(e, o);
|
|
950
|
-
if (e[p] === "(" &&
|
|
950
|
+
if (e[p] === "(" && Bt(d)) {
|
|
951
951
|
let g = P(e, p);
|
|
952
952
|
const I = g - 1;
|
|
953
953
|
let R = g;
|
|
@@ -980,7 +980,7 @@ function W(e, n = /* @__PURE__ */ new Set()) {
|
|
|
980
980
|
kind: Ne(d, C),
|
|
981
981
|
distinct: C,
|
|
982
982
|
windowed: b,
|
|
983
|
-
tokens:
|
|
983
|
+
tokens: Kt(e.slice(p, g)),
|
|
984
984
|
span: { start: l, end: R, argumentStart: p + 1, argumentEnd: I },
|
|
985
985
|
argumentCount: x,
|
|
986
986
|
filtered: _
|
|
@@ -1036,9 +1036,9 @@ function Xt(e, n) {
|
|
|
1036
1036
|
}
|
|
1037
1037
|
if (o.startsWith("@") || o === "'S'" || ["NULL", "TRUE", "FALSE"].includes(o) || /^[0-9.]/.test(o))
|
|
1038
1038
|
return s++, !0;
|
|
1039
|
-
if (!
|
|
1039
|
+
if (!Gt.has(o) || (s++, !c("(") || !i())) return !1;
|
|
1040
1040
|
if (["CAST", "TRY_CAST", "SAFE_CAST"].includes(o)) {
|
|
1041
|
-
if (!c("AS") || !
|
|
1041
|
+
if (!c("AS") || !zt.has(a[s++]) || (c("PRECISION"), c("(") && (!/^\d+$/.test(a[s++] || "") || c(",") && !/^\d+$/.test(a[s++] || "") || !c(")"))))
|
|
1042
1042
|
return !1;
|
|
1043
1043
|
} else
|
|
1044
1044
|
for (; c(","); ) if (!i()) return !1;
|
|
@@ -1046,7 +1046,7 @@ function Xt(e, n) {
|
|
|
1046
1046
|
};
|
|
1047
1047
|
return i() && s === a.length;
|
|
1048
1048
|
}
|
|
1049
|
-
function
|
|
1049
|
+
function Zt(e) {
|
|
1050
1050
|
const n = [];
|
|
1051
1051
|
let a = 0;
|
|
1052
1052
|
for (; a < e.length; ) {
|
|
@@ -1091,7 +1091,7 @@ function Kt(e) {
|
|
|
1091
1091
|
return n;
|
|
1092
1092
|
}
|
|
1093
1093
|
function $t(e) {
|
|
1094
|
-
const n =
|
|
1094
|
+
const n = Zt(e), a = n.some((o) => o.type === "op" && o.value === "/");
|
|
1095
1095
|
if (n.some((o) => o.type === "other"))
|
|
1096
1096
|
return { kind: "other", hasDivision: a };
|
|
1097
1097
|
let r = 0, s = !0;
|
|
@@ -1145,7 +1145,7 @@ const Oe = /* @__PURE__ */ new Set([
|
|
|
1145
1145
|
"count_distinct",
|
|
1146
1146
|
"repeat_safe_other"
|
|
1147
1147
|
]);
|
|
1148
|
-
function
|
|
1148
|
+
function K(e) {
|
|
1149
1149
|
if (!(!e || !e.trim()))
|
|
1150
1150
|
return Ne(e);
|
|
1151
1151
|
}
|
|
@@ -1167,7 +1167,7 @@ function xe(e) {
|
|
|
1167
1167
|
return { kind: "none", reason: "other" };
|
|
1168
1168
|
}
|
|
1169
1169
|
}
|
|
1170
|
-
function
|
|
1170
|
+
function Yt(e) {
|
|
1171
1171
|
var n, a;
|
|
1172
1172
|
return ((n = e.derivedField) == null ? void 0 : n.computeStage) || ((a = e.calculatedFormula) == null ? void 0 : a.computeStage);
|
|
1173
1173
|
}
|
|
@@ -1181,7 +1181,7 @@ const Q = {
|
|
|
1181
1181
|
identity: "unresolved",
|
|
1182
1182
|
unresolved: !0
|
|
1183
1183
|
}, Pe = { ...Q, stage: "row" };
|
|
1184
|
-
function
|
|
1184
|
+
function X(e) {
|
|
1185
1185
|
return {
|
|
1186
1186
|
stage: "row",
|
|
1187
1187
|
outer: e,
|
|
@@ -1199,23 +1199,23 @@ function B(e, n) {
|
|
|
1199
1199
|
const a = (r = n.derivedField) == null ? void 0 : r.aggregationBehavior;
|
|
1200
1200
|
return !a || e.unresolved ? e : a === "additive" ? e.reaggregation.kind === "additive" ? e : { ...e, reaggregation: { kind: "additive" } } : { ...e, reaggregation: { kind: "none", reason: "declared" } };
|
|
1201
1201
|
}
|
|
1202
|
-
function
|
|
1202
|
+
function Ht(e, n) {
|
|
1203
1203
|
if (!e) return Q;
|
|
1204
1204
|
if (typeof e.expression == "string" && e.expression.trim()) {
|
|
1205
1205
|
const r = J(e, n + 1);
|
|
1206
1206
|
return r === "row_input" ? "raw" : r.unresolved || r.stage === "aggregate" || r.outer ? r : "raw";
|
|
1207
1207
|
}
|
|
1208
|
-
const a =
|
|
1209
|
-
return a ?
|
|
1208
|
+
const a = K(e.aggregate);
|
|
1209
|
+
return a ? X(a) : "raw";
|
|
1210
1210
|
}
|
|
1211
|
-
const
|
|
1211
|
+
const Qt = 12;
|
|
1212
1212
|
function J(e, n) {
|
|
1213
1213
|
var E;
|
|
1214
|
-
if (n >
|
|
1214
|
+
if (n > Qt) return Q;
|
|
1215
1215
|
const a = typeof e.expression == "string" ? e.expression.trim() : "";
|
|
1216
1216
|
if (!a)
|
|
1217
1217
|
return B(
|
|
1218
|
-
K(
|
|
1218
|
+
X(K(e.aggregate) ?? "sum"),
|
|
1219
1219
|
e
|
|
1220
1220
|
);
|
|
1221
1221
|
const r = W(a), s = ((E = e.calculatedFormula) == null ? void 0 : E.inputFields) || [], c = (u) => {
|
|
@@ -1223,7 +1223,7 @@ function J(e, n) {
|
|
|
1223
1223
|
return S ? s[Number(S[1])] : void 0;
|
|
1224
1224
|
}, i = /* @__PURE__ */ new Map();
|
|
1225
1225
|
for (const u of r.tokensOutsideAggregates)
|
|
1226
|
-
i.has(u) || i.set(u,
|
|
1226
|
+
i.has(u) || i.set(u, Ht(c(u), n));
|
|
1227
1227
|
const l = r.calls.some(
|
|
1228
1228
|
(u) => u.tokens.some((S) => {
|
|
1229
1229
|
const k = c(S);
|
|
@@ -1233,15 +1233,15 @@ function J(e, n) {
|
|
|
1233
1233
|
})
|
|
1234
1234
|
), m = Array.from(i.values()).filter(
|
|
1235
1235
|
(u) => u !== "raw"
|
|
1236
|
-
), o = Array.from(i.values()).some((u) => u === "raw"), d = r.calls.length > 0 || m.length > 0 ||
|
|
1236
|
+
), o = Array.from(i.values()).some((u) => u === "raw"), d = r.calls.length > 0 || m.length > 0 || Yt(e) === "aggregate" || !!e.isPreAggregated, p = new Set(
|
|
1237
1237
|
[...i].filter(
|
|
1238
1238
|
([u, S]) => S === "raw" ? !d && !!c(u) : !S.unresolved
|
|
1239
1239
|
).map(([u]) => u)
|
|
1240
1240
|
), g = W(a, p).aggregateInputsComplete;
|
|
1241
1241
|
if (!d) {
|
|
1242
1242
|
if (!g) return Pe;
|
|
1243
|
-
const u =
|
|
1244
|
-
return u ? B(
|
|
1243
|
+
const u = K(e.aggregate);
|
|
1244
|
+
return u ? B(X(u), e) : "row_input";
|
|
1245
1245
|
}
|
|
1246
1246
|
const I = !g || o || r.nestedAggregate || l || m.some((u) => u.unresolved) || r.calls.length === 0 && m.length === 0, R = [
|
|
1247
1247
|
...r.calls.map((u) => ({ kind: u.kind, distinct: u.distinct })),
|
|
@@ -1282,106 +1282,113 @@ function J(e, n) {
|
|
|
1282
1282
|
e
|
|
1283
1283
|
);
|
|
1284
1284
|
}
|
|
1285
|
-
function
|
|
1285
|
+
function Jt(e) {
|
|
1286
1286
|
const n = J(e, 0);
|
|
1287
1287
|
return n === "row_input" ? Pe : n;
|
|
1288
1288
|
}
|
|
1289
|
-
|
|
1290
|
-
|
|
1289
|
+
function En(e) {
|
|
1290
|
+
const n = Je((e == null ? void 0 : e.dataType) || "number");
|
|
1291
|
+
if (!e) return n;
|
|
1292
|
+
const a = Jt(e);
|
|
1293
|
+
return a.unresolved || a.outputType === "input" ? n : "number";
|
|
1294
|
+
}
|
|
1295
|
+
const en = t.object({
|
|
1296
|
+
intent: et,
|
|
1291
1297
|
matrixWindowRequest: pe
|
|
1292
|
-
}).strict(),
|
|
1298
|
+
}).strict(), tn = t.object({
|
|
1293
1299
|
runtimeFilters: G.innerType().shape.filters,
|
|
1294
1300
|
runtimeSorts: G.innerType().shape.sorts.optional()
|
|
1295
1301
|
});
|
|
1296
|
-
function
|
|
1297
|
-
return
|
|
1302
|
+
function Rn(e) {
|
|
1303
|
+
return tn.parse(e);
|
|
1298
1304
|
}
|
|
1299
|
-
const
|
|
1305
|
+
const nn = {
|
|
1300
1306
|
// A window executes a governed statement set, not one compiled query.
|
|
1301
1307
|
compiledQuery: t.never().optional(),
|
|
1302
|
-
intent:
|
|
1308
|
+
intent: en.shape.intent,
|
|
1303
1309
|
resultShape: t.literal("matrix"),
|
|
1304
1310
|
result: Ae.optional(),
|
|
1305
1311
|
metadata: t.object({ rowLimitExceeded: t.boolean(), matrixFailure: H.optional() }).passthrough()
|
|
1306
|
-
},
|
|
1312
|
+
}, an = ve.extend(nn), Cn = an.superRefine((e, n) => {
|
|
1307
1313
|
e.status === "failed" == !!e.result && n.addIssue({ code: "custom", message: "Only answered or partial Matrix execution carries a window." }), e.result && e.status === "partial" != e.result.window.failures.length > 0 && n.addIssue({ code: "custom", message: "Matrix execution status must match acquired window failures." });
|
|
1308
1314
|
});
|
|
1309
1315
|
export {
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1316
|
+
dn as $,
|
|
1317
|
+
kn as A,
|
|
1318
|
+
Pt as B,
|
|
1319
|
+
jt as C,
|
|
1320
|
+
Ft as D,
|
|
1321
|
+
wn as E,
|
|
1322
|
+
Lt as F,
|
|
1323
|
+
Ut as G,
|
|
1324
|
+
Dt as H,
|
|
1325
|
+
Tn as I,
|
|
1326
|
+
Bt as J,
|
|
1321
1327
|
Ne as K,
|
|
1322
1328
|
W as L,
|
|
1323
1329
|
$t as M,
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1330
|
+
Jt as N,
|
|
1331
|
+
En as O,
|
|
1332
|
+
me as P,
|
|
1327
1333
|
at as Q,
|
|
1328
|
-
|
|
1334
|
+
rt as R,
|
|
1329
1335
|
Te as S,
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1336
|
+
cn as T,
|
|
1337
|
+
ln as U,
|
|
1338
|
+
ot as V,
|
|
1339
|
+
un as W,
|
|
1340
|
+
ct as X,
|
|
1341
|
+
te as Y,
|
|
1342
|
+
lt as Z,
|
|
1343
|
+
pe as _,
|
|
1344
|
+
vn as a,
|
|
1339
1345
|
ut as a0,
|
|
1340
1346
|
dt as a1,
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1347
|
+
mt as a2,
|
|
1348
|
+
ne as a3,
|
|
1349
|
+
H as a4,
|
|
1350
|
+
pt as a5,
|
|
1351
|
+
Se as a6,
|
|
1352
|
+
ht as a7,
|
|
1353
|
+
mn as a8,
|
|
1354
|
+
pn as a9,
|
|
1349
1355
|
ft as aa,
|
|
1350
1356
|
gt as ab,
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1357
|
+
yt as ac,
|
|
1358
|
+
hn as ad,
|
|
1359
|
+
fn as ae,
|
|
1354
1360
|
St as af,
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1361
|
+
bt as ag,
|
|
1362
|
+
ae as ah,
|
|
1363
|
+
At as ai,
|
|
1364
|
+
gn as aj,
|
|
1365
|
+
tn as ak,
|
|
1366
|
+
Rn as al,
|
|
1367
|
+
Cn as am,
|
|
1368
|
+
en as an,
|
|
1369
|
+
Y as b,
|
|
1370
|
+
In as c,
|
|
1371
|
+
It as d,
|
|
1372
|
+
_t as e,
|
|
1373
|
+
_e as f,
|
|
1374
|
+
yn as g,
|
|
1375
|
+
ke as h,
|
|
1376
|
+
Rt as i,
|
|
1377
|
+
we as j,
|
|
1378
|
+
ve as k,
|
|
1379
|
+
kt as l,
|
|
1380
|
+
vt as m,
|
|
1381
|
+
Tt as n,
|
|
1382
|
+
Ae as o,
|
|
1383
|
+
Sn as p,
|
|
1384
|
+
Ee as q,
|
|
1385
|
+
bn as r,
|
|
1379
1386
|
se as s,
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
+
Ct as t,
|
|
1388
|
+
An as u,
|
|
1389
|
+
Re as v,
|
|
1390
|
+
Nt as w,
|
|
1391
|
+
z as x,
|
|
1392
|
+
oe as y,
|
|
1393
|
+
_n as z
|
|
1387
1394
|
};
|