react-semaphor 0.1.537 → 0.1.539
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 +352 -341
- package/dist/assistant-context/index.js +10 -0
- package/dist/assistant-protocol/index.js +104 -0
- package/dist/brand-studio/index.js +35 -31
- package/dist/briefings/index.js +46 -45
- package/dist/chunks/_commonjsHelpers-BkfeUUK-.js +28 -0
- package/dist/chunks/add-to-dashboard-CxtTfISD.js +56 -0
- package/dist/chunks/aggregate-table-row-presentation-BjK9YfMI.js +979 -0
- package/dist/chunks/analytics-base-schemas-BFAoRlkU.js +472 -0
- package/dist/chunks/apply-dashboard-operations-C-iahGka.js +402 -0
- package/dist/chunks/assistant-chat-DgiSuFT4.js +8083 -0
- package/dist/chunks/availability-Bp5Gfu1I.js +44 -0
- package/dist/chunks/{bookmark-state-B-I9BDD0.js → bookmark-state-k7y5SNGf.js} +9 -9
- package/dist/chunks/{braces-8TRlDwDw.js → braces-o9UiRQes.js} +1 -1
- package/dist/chunks/calculated-field-identity-DcBS2NPP.js +2161 -0
- package/dist/chunks/calendar-day-equality-Bpl15IBo.js +487 -0
- package/dist/chunks/class-utils-Df1OVOT1.js +2315 -0
- package/dist/chunks/{field-dependencies-CpRUwr9J.js → common-types-CUf03Htv.js} +65 -58
- package/dist/chunks/context-HD9usB1P.js +349 -0
- package/dist/chunks/conversation-sQiWYUOb.js +16 -0
- package/dist/chunks/csv-utils-GUfKyT1J.js +56 -0
- package/dist/chunks/custom-visual-inputs-BrUOIwln.js +3288 -0
- package/dist/chunks/{dashboard-briefing-launcher-A2uVpHCp.js → dashboard-briefing-launcher-Bl3gCeBR.js} +580 -556
- package/dist/chunks/{dashboard-controls-DxTuVis_.js → dashboard-controls-0EX0HiJt.js} +683 -686
- package/dist/chunks/{common-types-g7yS12Cg.js → dashboard-filter-value-compatibility-D95O4nd7.js} +18 -24
- package/dist/chunks/dashboard-json-6X_2BDiL.js +69 -0
- package/dist/chunks/{dashboard-BPJo-Fnd.js → dashboard-y5BwcvzT.js} +1 -1
- package/dist/chunks/document-dashboard-inputs-BrYYlRVo.js +10678 -0
- package/dist/chunks/document-sheet-utils-C1eEldxs.js +1076 -0
- package/dist/chunks/{edit-dashboard-visual-ByV0OwSp.js → edit-dashboard-visual-Bzchfgga.js} +4744 -4746
- package/dist/chunks/editor-draft-sync-BN5qYHPF.js +15 -0
- package/dist/chunks/filter-value-text-BhWugPWE.js +163 -0
- package/dist/chunks/index-CqMiAkay.js +3164 -0
- package/dist/chunks/index-CuHybtft.js +51 -0
- package/dist/chunks/layout-grid-Bgzth8vd.js +16 -0
- package/dist/chunks/{matrix-analytical-definition-CgBTD6H8.js → matrix-analytical-definition-bcprSe4u.js} +1 -1
- package/dist/chunks/{matrix-card-CAdizkUl.js → matrix-card-CJn1hB5V.js} +13 -12
- package/dist/chunks/matrix-definition-DQDI2okF.js +206 -0
- package/dist/chunks/{matrix-formatter-DJCk8Znf.js → matrix-formatter-DQ8avoIQ.js} +648 -457
- package/dist/chunks/matrix-member-presentation-BNPSDKBG.js +105 -0
- package/dist/chunks/{matrix-operation-contract-BKupLHXL.js → matrix-operation-contract-B8PBF1Gd.js} +134 -133
- package/dist/chunks/{metric-comparison-BKHyvnAy.js → metric-comparison-CojWeLqx.js} +1 -1
- package/dist/chunks/{palette-Cp1hqZtm.js → palette-D10o_yYX.js} +1 -1
- package/dist/chunks/pivot-header-presentation-MkcKnjn3.js +42 -0
- package/dist/chunks/{pivot-result-identity-Bs4tLtLo.js → pivot-result-identity-D6hhcRXi.js} +1 -1
- package/dist/chunks/pivot-result-lifecycle-8qCDmpKc.js +804 -0
- package/dist/chunks/raw-temporal-D61lr48Y.js +1464 -0
- package/dist/chunks/{raw-temporal-contract-mLFS-9wk.js → raw-temporal-contract-C51YG48G.js} +1 -1
- package/dist/chunks/report-preferences-dialog-CWhSbc5_.js +1808 -0
- package/dist/chunks/{report-runtime-context-CG_I0PPW.js → report-runtime-context-B984Nq1E.js} +8 -7
- package/dist/chunks/save-CfJpQQ68.js +21 -0
- package/dist/chunks/saved-dashboard-context-Dqve2jlB.js +566 -0
- package/dist/chunks/{selection-reducer-CiDEtmAq.js → selection-reducer-vKIb_jS6.js} +2 -2
- package/dist/chunks/{semaphor-ready-indicator-CHu1L-lo.js → semaphor-ready-indicator-ldcwmLoY.js} +65803 -62954
- package/dist/chunks/{shelf-drop-preview-context-i-H6DFyU.js → shelf-drop-preview-context-BWxunXTq.js} +199 -196
- package/dist/chunks/{source-entity-resolution-C-oNyYMp.js → source-entity-resolution-CVA1a85c.js} +8 -8
- package/dist/chunks/switch-CvItuC1Q.js +8199 -0
- package/dist/chunks/{temporal-bucket-DlFuhCnT.js → temporal-bucket-D8JF7zKz.js} +86 -71
- package/dist/chunks/{temporal-bucket-contract-D2OuaVZ7.js → temporal-bucket-contract-DaOajRC7.js} +1 -1
- package/dist/chunks/{token-types-DtSJOUjh.js → token-types-bxUxXDX2.js} +1 -1
- package/dist/chunks/{upload-CAIpsti1.js → upload-BFX7apKV.js} +1 -1
- package/dist/chunks/{use-create-flow-overlay-state-Bj63WwHc.js → use-create-flow-overlay-state-RHgzVfcz.js} +331 -339
- package/dist/chunks/{validators-DMSH81OM.js → validators-Ej1DdCXa.js} +1050 -1510
- package/dist/chunks/visual-choice-JiJ-_3bi.js +204 -0
- package/dist/chunks/x-4f5U2XwU.js +100 -0
- package/dist/chunks/{zoned-wall-clock-1qlWCE20.js → zoned-wall-clock-MulfA26h.js} +2 -2
- package/dist/dashboard/index.js +2 -2
- package/dist/dashboard-authoring/index.js +823 -661
- package/dist/data-app-sdk/index.js +32 -30
- package/dist/data-app-sdk-adapters/index.js +23 -22
- package/dist/data-app-sdk-validation/index.js +23 -22
- package/dist/format-utils/index.js +173 -168
- package/dist/index.js +267 -258
- package/dist/layouts/index.js +236 -24
- 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/assistant-context.d.ts +2 -0
- package/dist/types/assistant-protocol.d.ts +2 -0
- package/dist/types/components/assistant/assistant-entry-points.d.ts +18 -0
- package/dist/types/components/assistant/assistant-provider.d.ts +19 -0
- package/dist/types/components/assistant/assistant-store.d.ts +52 -0
- package/dist/types/components/assistant/use-assistant.d.ts +38 -0
- package/dist/types/components/index.d.ts +5 -1
- package/dist/types/components/surfboard/filter/types.d.ts +5 -2
- package/dist/types/index.js +50 -51
- package/dist/types/lib/api/invalidate-token.d.ts +7 -0
- package/dist/types/lib/charts/cartesian-fields.d.ts +64 -0
- package/dist/types/lib/charts/types.d.ts +7 -0
- package/dist/types/lib/dashboard-inputs/dashboard-filter-mapping-storage-transition.d.ts +14 -2
- package/dist/types/lib/dashboard-inputs/dashboard-input-target-context.d.ts +5 -6
- package/dist/types/lib/dashboard-inputs/dashboard-input-values.d.ts +8 -3
- package/dist/types/lib/dashboard-inputs/resolve-dashboard-input-context.d.ts +11 -6
- package/dist/types/lib/dashboard-pagination/dashboard-card-pagination.d.ts +7 -0
- package/dist/types/lib/dashboard-viewer/compatibility-input-storage.d.ts +79 -0
- package/dist/types/lib/dashboard-viewer/viewer-state.d.ts +3 -2
- package/dist/types/lib/document/document-table-data-policy.d.ts +15 -0
- package/dist/types/lib/filter-values/filter-mode.d.ts +22 -0
- package/dist/types/lib/hooks/use-calendar-context.d.ts +5 -0
- package/dist/types/lib/hooks/use-filter-option-browse.d.ts +5 -0
- package/dist/types/lib/hooks/use-text-filter.d.ts +9 -0
- package/dist/types/lib/print/print-inputs.d.ts +4 -2
- package/dist/types/lib/query-context/build-card-query-context.d.ts +12 -4
- package/dist/types/lib/query-context/build-dashboard-execution-snapshot.d.ts +93 -0
- package/dist/types/lib/query-context/card-server-request.d.ts +72 -0
- package/dist/types/lib/query-context/compile-dashboard-card-filters.d.ts +7 -0
- package/dist/types/lib/query-context/describe-card-execution-snapshot.d.ts +56 -0
- package/dist/types/lib/query-context/document-section-card-query.d.ts +45 -0
- package/dist/types/lib/query-context/resolve-runtime-card-filters.d.ts +17 -2
- package/dist/types/lib/stores/dashboard-store.d.ts +34 -11
- package/dist/types/lib/stores/editor-store.d.ts +4 -2
- package/dist/types/lib/types/token-types.d.ts +11 -0
- package/dist/types/lib/utils/card-type-change.d.ts +30 -0
- package/dist/types/lib/utils/comparison-window-caption.d.ts +12 -0
- package/dist/types/lib/utils/filter-default-value-utils.d.ts +13 -2
- package/dist/types/shared/analytics-protocol/applied-constraints.d.ts +74 -0
- package/dist/types/shared/analytics-protocol/contracts.d.ts +3 -0
- package/dist/types/shared/analytics-protocol/filter-field-ownership.d.ts +43 -0
- package/dist/types/shared/analytics-protocol/index.d.ts +3 -0
- package/dist/types/shared/analytics-protocol/matrix-window-contract.d.ts +1 -1
- package/dist/types/shared/analytics-protocol/visual-choice.d.ts +75 -0
- package/dist/types/shared/assistant-context/index.d.ts +9 -0
- package/dist/types/shared/assistant-context/project-context.d.ts +55 -0
- package/dist/types/shared/assistant-context/saved-dashboard-context.d.ts +130 -0
- package/dist/types/shared/assistant-protocol/add-to-dashboard.d.ts +17 -0
- package/dist/types/shared/assistant-protocol/artifact.d.ts +63 -0
- package/dist/types/shared/assistant-protocol/availability.d.ts +39 -0
- package/dist/types/shared/assistant-protocol/context.d.ts +952 -0
- package/dist/types/shared/assistant-protocol/conversation.d.ts +38 -0
- package/dist/types/shared/assistant-protocol/index.d.ts +16 -0
- package/dist/types/shared/assistant-protocol/limits.d.ts +53 -0
- package/dist/types/shared/assistant-protocol/parts.d.ts +140 -0
- package/dist/types/shared/assistant-protocol/request.d.ts +77 -0
- package/dist/types/shared/assistant-protocol/sources.d.ts +27 -0
- package/dist/types/shared/assistant-protocol/token-config.d.ts +32 -0
- package/dist/types/shared/assistant-protocol/transcript.d.ts +40 -0
- package/dist/types/shared/dashboard-authoring/card-query-request.d.ts +112 -0
- package/dist/types/shared/dashboard-authoring/control-execution-contract.d.ts +1794 -0
- package/dist/types/shared/dashboard-authoring/index.d.ts +5 -0
- package/dist/types/shared/dashboard-authoring/new-card.d.ts +10 -0
- package/dist/types/shared/dashboard-authoring/operations/apply-dashboard-operations.d.ts +40 -0
- package/dist/types/shared/dashboard-authoring/resolved-primary-date-field-validation.d.ts +16 -0
- package/dist/types/shared/format-utils/filter-detail.d.ts +70 -0
- package/dist/types/shared/format-utils/filter-value-text.d.ts +15 -0
- package/dist/types/shared/format-utils/index.d.ts +3 -0
- package/dist/types/shared/format-utils/raw-temporal.d.ts +7 -0
- package/dist/types/shared/format-utils/temporal-bucket.d.ts +7 -0
- package/dist/types/shared/layouts/frame-layouts.d.ts +23 -0
- package/dist/types/shared/layouts/index.d.ts +1 -0
- package/package.json +12 -2
- package/dist/chunks/calculated-field-identity-BptYhyOP.js +0 -1326
- package/dist/chunks/calendar-day-equality-BRjN1S9h.js +0 -383
- package/dist/chunks/card-config-utils-BOM1dxCk.js +0 -1150
- package/dist/chunks/constants-DNWVy8Y3.js +0 -9
- package/dist/chunks/dashboard-json-B1dEQu98.js +0 -65
- package/dist/chunks/field-aggregations-CoLzYHeL.js +0 -1229
- package/dist/chunks/index-DTcTAGGM.js +0 -4101
- package/dist/chunks/matrix-continuation-C4sRcjZU.js +0 -72
- package/dist/chunks/matrix-control-sources-DTqcA2_L.js +0 -636
- package/dist/chunks/matrix-definition-D9iShKZI.js +0 -87
- package/dist/chunks/matrix-member-presentation-Ct8GuxHt.js +0 -209
- package/dist/chunks/numeric-presentation-CWu3gunq.js +0 -537
- package/dist/chunks/pivot-header-presentation-CHs2GFrM.js +0 -753
- package/dist/chunks/pivot-result-lifecycle-DQz_gjGu.js +0 -789
- package/dist/chunks/raw-temporal-iMXRK-Qz.js +0 -930
- package/dist/chunks/report-preferences-dialog-DXPjteCU.js +0 -1623
- package/dist/chunks/save-kO6cIaob.js +0 -34
- package/dist/chunks/semantic-format-DiqYeKwU.js +0 -192
- package/dist/chunks/switch-DO8a0EfJ.js +0 -25004
- package/dist/chunks/temporal-input-presentation-BD7YNUzu.js +0 -195
- package/dist/chunks/x-CXDkqdur.js +0 -149
- package/dist/types/lib/class-utils.d.ts +0 -2
- package/dist/types/lib/document/document-input-runtime.d.ts +0 -26
- package/dist/types/lib/utils.d.ts +0 -51
package/dist/chunks/{matrix-operation-contract-BKupLHXL.js → matrix-operation-contract-B8PBF1Gd.js}
RENAMED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { z as t } from "zod";
|
|
2
|
-
import {
|
|
2
|
+
import { z as je, E as Fe, F as Le, I as Ue, J as qe, s as U, x as K, n as De, C as Me, D as ce, f as Be, r as Ge, y as ze, m as Ve, o as We, t as le, u as Xe } from "./analytics-base-schemas-BFAoRlkU.js";
|
|
3
|
+
import { Z as k, T as ue, a2 as G, aH as ee, w as A, _ as Ze, aB as $, aI as Ke, U as $e, s as He, q as de, B as Ye, v as Qe, m as Je } from "./validators-Ej1DdCXa.js";
|
|
3
4
|
const H = {
|
|
4
5
|
answerSummary: "string",
|
|
5
6
|
responseDetail: "responseDetail",
|
|
@@ -87,7 +88,7 @@ function at(e, n, a = {}) {
|
|
|
87
88
|
status: a.status ?? et[e]
|
|
88
89
|
};
|
|
89
90
|
}
|
|
90
|
-
function
|
|
91
|
+
function sn(e) {
|
|
91
92
|
if (!e || typeof e != "object") return;
|
|
92
93
|
const n = e.refusal ?? e;
|
|
93
94
|
if (!n || typeof n != "object") return;
|
|
@@ -109,7 +110,7 @@ const rt = {
|
|
|
109
110
|
budget_exceeded: { message: "The query exceeds this view’s limits.", nextStep: "Request fewer rows, columns or measures." },
|
|
110
111
|
cancelled: { message: "The query was cancelled.", nextStep: "Reload the view when ready." }
|
|
111
112
|
};
|
|
112
|
-
function
|
|
113
|
+
function on(e) {
|
|
113
114
|
const n = rt[e.code], a = at(e.code, n.message, { nextStep: n.nextStep, status: e.status }), r = e.retryable ?? a.retryable;
|
|
114
115
|
return {
|
|
115
116
|
...a,
|
|
@@ -121,19 +122,19 @@ const st = [
|
|
|
121
122
|
...me,
|
|
122
123
|
"stale_cursor",
|
|
123
124
|
"source_truncated"
|
|
124
|
-
],
|
|
125
|
+
], cn = Object.freeze({
|
|
125
126
|
coordinates: 2e4,
|
|
126
127
|
responseBytes: 5 * 1024 * 1024
|
|
127
128
|
}), O = t.string().uuid(), y = t.string().min(1), ot = t.number().int().positive().max(Number.MAX_SAFE_INTEGER);
|
|
128
|
-
function
|
|
129
|
+
function f(e, n, a) {
|
|
129
130
|
e.addIssue({ code: "custom", path: n, message: a });
|
|
130
131
|
}
|
|
131
132
|
function v(e, n, a) {
|
|
132
|
-
new Set(e).size !== e.length &&
|
|
133
|
+
new Set(e).size !== e.length && f(n, a, "Duplicate identity.");
|
|
133
134
|
}
|
|
134
135
|
const it = t.object({
|
|
135
136
|
id: y,
|
|
136
|
-
axis:
|
|
137
|
+
axis: ue,
|
|
137
138
|
parent: k,
|
|
138
139
|
position: t.union([
|
|
139
140
|
t.object({ kind: t.literal("first") }).strict(),
|
|
@@ -152,7 +153,7 @@ const it = t.object({
|
|
|
152
153
|
pages: t.array(it).readonly(),
|
|
153
154
|
blocks: t.array(ct).readonly()
|
|
154
155
|
}).strict().superRefine((e, n) => {
|
|
155
|
-
!e.pages.length && !e.blocks.length &&
|
|
156
|
+
!e.pages.length && !e.blocks.length && f(n, [], "Request at least one page or block."), v(
|
|
156
157
|
[...e.pages, ...e.blocks].map((a) => a.id),
|
|
157
158
|
n,
|
|
158
159
|
[]
|
|
@@ -163,13 +164,13 @@ const it = t.object({
|
|
|
163
164
|
for (const s of a[r].pageIds)
|
|
164
165
|
e.pages.some(
|
|
165
166
|
(c) => c.id === s && c.axis === r
|
|
166
|
-
) ||
|
|
167
|
+
) || f(
|
|
167
168
|
n,
|
|
168
169
|
["blocks", a.id, r],
|
|
169
170
|
"Page reference must name a page on this axis in this operation."
|
|
170
171
|
);
|
|
171
172
|
}
|
|
172
|
-
}),
|
|
173
|
+
}), ln = t.object({ spec: G, request: pe }).strict().superRefine(({ spec: e, request: n }, a) => {
|
|
173
174
|
for (const r of n.pages)
|
|
174
175
|
ee(
|
|
175
176
|
e,
|
|
@@ -178,53 +179,53 @@ const it = t.object({
|
|
|
178
179
|
a,
|
|
179
180
|
["pages", r.id],
|
|
180
181
|
!0
|
|
181
|
-
), r.parent.length >= e[r.axis].length &&
|
|
182
|
+
), r.parent.length >= e[r.axis].length && f(
|
|
182
183
|
a,
|
|
183
184
|
["pages", r.id],
|
|
184
185
|
"Cannot request children of a leaf or empty axis."
|
|
185
186
|
);
|
|
186
187
|
for (const r of n.blocks) {
|
|
187
|
-
r.measureIds.some((s) => !e.measures.some((c) => c.id === s)) &&
|
|
188
|
+
r.measureIds.some((s) => !e.measures.some((c) => c.id === s)) && f(a, ["blocks", r.id], "Unknown block measure.");
|
|
188
189
|
for (const s of ["rows", "columns"])
|
|
189
190
|
for (const c of r[s].paths)
|
|
190
191
|
ee(e, s, c, a, ["blocks", r.id, s]);
|
|
191
192
|
}
|
|
192
193
|
}), lt = t.object({
|
|
193
194
|
requestId: y,
|
|
194
|
-
axis:
|
|
195
|
+
axis: ue,
|
|
195
196
|
parent: k,
|
|
196
197
|
members: t.array(t.object({ path: k }).strict()).readonly(),
|
|
197
198
|
before: y.nullable(),
|
|
198
199
|
after: y.nullable(),
|
|
199
200
|
exactCount: t.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER).optional()
|
|
200
201
|
}).strict().superRefine((e, n) => {
|
|
201
|
-
e.parent.some((r) => r.member.kind === "others") &&
|
|
202
|
+
e.parent.some((r) => r.member.kind === "others") && f(n, ["parent"], "Others has no children.");
|
|
202
203
|
const a = e.members.filter(
|
|
203
204
|
({ path: r }) => {
|
|
204
205
|
var s;
|
|
205
206
|
return ((s = r[r.length - 1]) == null ? void 0 : s.member.kind) === "others";
|
|
206
207
|
}
|
|
207
208
|
);
|
|
208
|
-
a.length > 1 &&
|
|
209
|
+
a.length > 1 && f(n, ["members"], "A page may contain Others only once."), a.length && (e.members[e.members.length - 1] !== a[0] && f(n, ["members"], "Others must be the last page member."), e.after !== null && f(n, ["after"], "Others must end the branch.")), new Set(
|
|
209
210
|
e.members.map(
|
|
210
211
|
(r) => {
|
|
211
212
|
var s;
|
|
212
213
|
return (s = r.path[r.path.length - 1]) == null ? void 0 : s.levelId;
|
|
213
214
|
}
|
|
214
215
|
)
|
|
215
|
-
).size > 1 &&
|
|
216
|
+
).size > 1 && f(n, ["members"], "One page must contain one child level."), v(
|
|
216
217
|
e.members.map((r) => A(r.path)),
|
|
217
218
|
n,
|
|
218
219
|
["members"]
|
|
219
220
|
);
|
|
220
221
|
for (const r of e.members)
|
|
221
|
-
(r.path.length !== e.parent.length + 1 || A(r.path.slice(0, -1)) !== A(e.parent)) &&
|
|
222
|
+
(r.path.length !== e.parent.length + 1 || A(r.path.slice(0, -1)) !== A(e.parent)) && f(n, ["members"], "Page members must be immediate children.");
|
|
222
223
|
}), he = t.object({
|
|
223
224
|
rowPaths: t.array(k).readonly(),
|
|
224
225
|
columnPaths: t.array(k).readonly(),
|
|
225
226
|
measureIds: t.array(O).readonly()
|
|
226
227
|
}).strict();
|
|
227
|
-
function
|
|
228
|
+
function fe(e, n) {
|
|
228
229
|
const a = e.rowPaths.map(A), r = e.columnPaths.map(A);
|
|
229
230
|
return v(a, n, ["coverage", "rowPaths"]), v(r, n, ["coverage", "columnPaths"]), v(e.measureIds, n, ["coverage", "measureIds"]), { rows: a, columns: r };
|
|
230
231
|
}
|
|
@@ -232,10 +233,10 @@ const ut = t.object({
|
|
|
232
233
|
requestId: y,
|
|
233
234
|
coverage: he,
|
|
234
235
|
cells: t.array(
|
|
235
|
-
|
|
236
|
+
Ze.extend({ value: $ }).strict()
|
|
236
237
|
).readonly()
|
|
237
238
|
}).strict().superRefine((e, n) => {
|
|
238
|
-
const { rows: a, columns: r } =
|
|
239
|
+
const { rows: a, columns: r } = fe(e.coverage, n), s = new Set(a), c = new Set(r), i = new Set(e.coverage.measureIds);
|
|
239
240
|
v(
|
|
240
241
|
e.cells.map(
|
|
241
242
|
(l) => JSON.stringify([
|
|
@@ -248,30 +249,30 @@ const ut = t.object({
|
|
|
248
249
|
["cells"]
|
|
249
250
|
);
|
|
250
251
|
for (const l of e.cells)
|
|
251
|
-
(!s.has(A(l.rowPath)) || !c.has(A(l.columnPath)) || !i.has(l.measureId)) &&
|
|
252
|
+
(!s.has(A(l.rowPath)) || !c.has(A(l.columnPath)) || !i.has(l.measureId)) && f(n, ["cells"], "Cell is outside certified coverage.");
|
|
252
253
|
}), q = t.number().int().nonnegative(), dt = t.object({
|
|
253
254
|
requestId: y,
|
|
254
255
|
coverage: he,
|
|
255
256
|
values: t.array(
|
|
256
|
-
t.tuple([q, q, q,
|
|
257
|
+
t.tuple([q, q, q, $]).readonly()
|
|
257
258
|
).readonly()
|
|
258
259
|
}).strict().superRefine((e, n) => {
|
|
259
|
-
|
|
260
|
+
fe(e.coverage, n);
|
|
260
261
|
const { rowPaths: a, columnPaths: r, measureIds: s } = e.coverage, c = /* @__PURE__ */ new Set();
|
|
261
262
|
for (const [i, l, m] of e.values) {
|
|
262
263
|
if (i >= a.length || l >= r.length || m >= s.length) {
|
|
263
|
-
|
|
264
|
+
f(n, ["values"], "Cell is outside certified coverage.");
|
|
264
265
|
continue;
|
|
265
266
|
}
|
|
266
267
|
const o = `${i},${l},${m}`;
|
|
267
|
-
c.has(o) &&
|
|
268
|
+
c.has(o) && f(n, ["values"], "Duplicate identity."), c.add(o);
|
|
268
269
|
}
|
|
269
270
|
}), ne = t.object({
|
|
270
271
|
id: O,
|
|
271
|
-
column:
|
|
272
|
+
column: je,
|
|
272
273
|
nativeDataType: y,
|
|
273
|
-
semanticFormat:
|
|
274
|
-
}).strict(),
|
|
274
|
+
semanticFormat: Ke.optional()
|
|
275
|
+
}).strict(), ge = t.object({
|
|
275
276
|
levels: t.array(ne).readonly(),
|
|
276
277
|
measures: t.array(ne).readonly()
|
|
277
278
|
}).strict(), Y = t.object({
|
|
@@ -288,13 +289,13 @@ const ut = t.object({
|
|
|
288
289
|
t.object({ kind: t.enum(["page", "block"]), requestId: y }).strict()
|
|
289
290
|
])
|
|
290
291
|
}).strict(), mt = t.object({
|
|
291
|
-
dialect: t.enum(["postgres", "clickhouse", "duckdb"]),
|
|
292
|
-
aggregates: t.array(
|
|
292
|
+
dialect: t.enum(["postgres", "clickhouse", "duckdb", "snowflake"]),
|
|
293
|
+
aggregates: t.array($e).readonly()
|
|
293
294
|
}).strict();
|
|
294
295
|
function ye(e) {
|
|
295
296
|
return t.object({
|
|
296
297
|
queryIdentity: y,
|
|
297
|
-
descriptors:
|
|
298
|
+
descriptors: ge,
|
|
298
299
|
capabilities: mt,
|
|
299
300
|
pages: t.array(lt).readonly(),
|
|
300
301
|
blocks: t.array(e).readonly(),
|
|
@@ -309,12 +310,12 @@ function ye(e) {
|
|
|
309
310
|
...i.members.map((l) => l.path)
|
|
310
311
|
]);
|
|
311
312
|
for (const i of n.blocks)
|
|
312
|
-
c.push(...i.coverage.rowPaths, ...i.coverage.columnPaths), i.coverage.measureIds.some((l) => !s.has(l)) &&
|
|
313
|
+
c.push(...i.coverage.rowPaths, ...i.coverage.columnPaths), i.coverage.measureIds.some((l) => !s.has(l)) && f(
|
|
313
314
|
a,
|
|
314
315
|
["blocks", i.requestId],
|
|
315
316
|
"Coverage references an unknown measure descriptor."
|
|
316
317
|
);
|
|
317
|
-
c.some((i) => i.some((l) => !r.has(l.levelId))) &&
|
|
318
|
+
c.some((i) => i.some((l) => !r.has(l.levelId))) && f(
|
|
318
319
|
a,
|
|
319
320
|
["descriptors"],
|
|
320
321
|
"Acquired paths require level descriptors."
|
|
@@ -337,7 +338,7 @@ function ye(e) {
|
|
|
337
338
|
);
|
|
338
339
|
for (const i of n.failures)
|
|
339
340
|
if (i.scope.kind === "operation")
|
|
340
|
-
|
|
341
|
+
f(
|
|
341
342
|
a,
|
|
342
343
|
["failures"],
|
|
343
344
|
"Operation failure cannot accompany acquired data."
|
|
@@ -346,7 +347,7 @@ function ye(e) {
|
|
|
346
347
|
const l = i.scope.requestId;
|
|
347
348
|
[...n.pages, ...n.blocks].some(
|
|
348
349
|
(m) => m.requestId === l
|
|
349
|
-
) &&
|
|
350
|
+
) && f(
|
|
350
351
|
a,
|
|
351
352
|
["failures"],
|
|
352
353
|
"A requested unit cannot both succeed and fail."
|
|
@@ -370,16 +371,16 @@ function be(e) {
|
|
|
370
371
|
const r = n;
|
|
371
372
|
if (r.status === "failed") return;
|
|
372
373
|
const { window: s } = r;
|
|
373
|
-
!s.pages.length && !s.blocks.length &&
|
|
374
|
+
!s.pages.length && !s.blocks.length && f(
|
|
374
375
|
a,
|
|
375
376
|
["window"],
|
|
376
377
|
"A window outcome requires successful acquired work."
|
|
377
|
-
), r.status === "success" != (s.failures.length === 0) &&
|
|
378
|
+
), r.status === "success" != (s.failures.length === 0) && f(a, ["status"], "Status must match failure coverage.");
|
|
378
379
|
});
|
|
379
380
|
}
|
|
380
|
-
const
|
|
381
|
+
const un = be(
|
|
381
382
|
Se
|
|
382
|
-
),
|
|
383
|
+
), dn = be(
|
|
383
384
|
pt
|
|
384
385
|
);
|
|
385
386
|
function ht(e) {
|
|
@@ -395,7 +396,7 @@ function ht(e) {
|
|
|
395
396
|
})
|
|
396
397
|
};
|
|
397
398
|
}
|
|
398
|
-
function
|
|
399
|
+
function ft(e) {
|
|
399
400
|
const { rowPaths: n, columnPaths: a, measureIds: r } = e.coverage;
|
|
400
401
|
return {
|
|
401
402
|
requestId: e.requestId,
|
|
@@ -408,14 +409,14 @@ function gt(e) {
|
|
|
408
409
|
}))
|
|
409
410
|
};
|
|
410
411
|
}
|
|
411
|
-
function
|
|
412
|
+
function gt(e) {
|
|
412
413
|
return { ...e, blocks: e.blocks.map(ht) };
|
|
413
414
|
}
|
|
414
|
-
function dn(e) {
|
|
415
|
-
return { ...e, blocks: e.blocks.map(gt) };
|
|
416
|
-
}
|
|
417
415
|
function mn(e) {
|
|
418
|
-
return
|
|
416
|
+
return { ...e, blocks: e.blocks.map(ft) };
|
|
417
|
+
}
|
|
418
|
+
function pn(e) {
|
|
419
|
+
return e.status === "failed" ? e : { status: e.status, window: gt(e.window) };
|
|
419
420
|
}
|
|
420
421
|
const Ae = t.object({
|
|
421
422
|
kind: t.literal("matrix"),
|
|
@@ -432,11 +433,11 @@ const Ae = t.object({
|
|
|
432
433
|
}).strict()
|
|
433
434
|
]), St = t.object({
|
|
434
435
|
columns: t.array(yt).readonly(),
|
|
435
|
-
descriptors:
|
|
436
|
+
descriptors: ge
|
|
436
437
|
}).strict(), ae = t.union([
|
|
437
438
|
t.object({
|
|
438
439
|
kind: t.literal("value"),
|
|
439
|
-
value:
|
|
440
|
+
value: $.refine(
|
|
440
441
|
(e) => e !== null
|
|
441
442
|
)
|
|
442
443
|
}).strict(),
|
|
@@ -454,7 +455,7 @@ const Ae = t.object({
|
|
|
454
455
|
columnPath: k,
|
|
455
456
|
values: t.array(ae).readonly()
|
|
456
457
|
}).strict()
|
|
457
|
-
]),
|
|
458
|
+
]), hn = t.discriminatedUnion("kind", [
|
|
458
459
|
t.object({
|
|
459
460
|
kind: t.literal("layout"),
|
|
460
461
|
layout: St,
|
|
@@ -466,10 +467,10 @@ const Ae = t.object({
|
|
|
466
467
|
next: y.nullable()
|
|
467
468
|
}).strict()
|
|
468
469
|
]), At = t.union([
|
|
470
|
+
Fe,
|
|
471
|
+
Le,
|
|
472
|
+
Ue,
|
|
469
473
|
qe,
|
|
470
|
-
De,
|
|
471
|
-
Me,
|
|
472
|
-
Ge,
|
|
473
474
|
Ae
|
|
474
475
|
]), It = t.object({
|
|
475
476
|
status: t.enum([
|
|
@@ -515,7 +516,7 @@ const Ae = t.object({
|
|
|
515
516
|
queryId: t.string().optional(),
|
|
516
517
|
summary: t.string(),
|
|
517
518
|
evidenceIds: t.array(t.string()).optional(),
|
|
518
|
-
fieldsUsed: t.array(
|
|
519
|
+
fieldsUsed: t.array(K).optional()
|
|
519
520
|
}).passthrough()
|
|
520
521
|
),
|
|
521
522
|
blocked: t.array(
|
|
@@ -542,11 +543,11 @@ const Ae = t.object({
|
|
|
542
543
|
).optional()
|
|
543
544
|
}).passthrough(), we = t.object({
|
|
544
545
|
scope: t.literal("filtered_query"),
|
|
545
|
-
measures: t.record(
|
|
546
|
+
measures: t.record(De)
|
|
546
547
|
}).passthrough(), ke = t.object({
|
|
547
548
|
answeredObligations: t.array(t.string()),
|
|
548
549
|
missingObligations: t.array(t.string()),
|
|
549
|
-
warnings: t.array(
|
|
550
|
+
warnings: t.array(Me).optional()
|
|
550
551
|
}).passthrough(), ve = t.object({
|
|
551
552
|
intentId: t.string().optional(),
|
|
552
553
|
queryId: t.string().optional(),
|
|
@@ -562,9 +563,9 @@ const Ae = t.object({
|
|
|
562
563
|
]).optional(),
|
|
563
564
|
intent: t.unknown().optional(),
|
|
564
565
|
compiledQuery: t.unknown().optional(),
|
|
565
|
-
fieldsUsed: t.array(
|
|
566
|
+
fieldsUsed: t.array(K).optional(),
|
|
566
567
|
result: At.optional(),
|
|
567
|
-
validation:
|
|
568
|
+
validation: ce,
|
|
568
569
|
coverage: ke.optional(),
|
|
569
570
|
missingFields: t.array(t.string()).optional(),
|
|
570
571
|
warnings: t.array(t.string()).optional(),
|
|
@@ -578,13 +579,13 @@ function wt(e) {
|
|
|
578
579
|
case "boolean":
|
|
579
580
|
return t.boolean().optional();
|
|
580
581
|
case "compactExecutionFieldArray":
|
|
581
|
-
return t.array(
|
|
582
|
+
return t.array(ze).optional();
|
|
582
583
|
case "coverage":
|
|
583
584
|
return ke.optional();
|
|
584
585
|
case "diagnosticFeedback":
|
|
585
586
|
return _e.optional();
|
|
586
587
|
case "executionFieldArray":
|
|
587
|
-
return t.array(
|
|
588
|
+
return t.array(K).optional();
|
|
588
589
|
case "executionResult":
|
|
589
590
|
return _t.optional();
|
|
590
591
|
case "number":
|
|
@@ -592,9 +593,9 @@ function wt(e) {
|
|
|
592
593
|
case "population":
|
|
593
594
|
return we.optional();
|
|
594
595
|
case "record":
|
|
595
|
-
return
|
|
596
|
+
return Ge.optional();
|
|
596
597
|
case "recordArray":
|
|
597
|
-
return
|
|
598
|
+
return Be.optional();
|
|
598
599
|
case "responseDetail":
|
|
599
600
|
return t.enum(["compact", "standard", "debug"]).optional();
|
|
600
601
|
case "string":
|
|
@@ -606,7 +607,7 @@ function wt(e) {
|
|
|
606
607
|
case "unknownArray":
|
|
607
608
|
return t.array(t.unknown()).optional();
|
|
608
609
|
case "validationResult":
|
|
609
|
-
return
|
|
610
|
+
return ce.optional();
|
|
610
611
|
}
|
|
611
612
|
}
|
|
612
613
|
const kt = Object.fromEntries(
|
|
@@ -616,7 +617,7 @@ const kt = Object.fromEntries(
|
|
|
616
617
|
), vt = t.object(kt).strict(), Tt = new Set(
|
|
617
618
|
Object.keys(H)
|
|
618
619
|
);
|
|
619
|
-
function
|
|
620
|
+
function fn() {
|
|
620
621
|
return Object.keys(
|
|
621
622
|
H
|
|
622
623
|
);
|
|
@@ -644,13 +645,13 @@ function Re(e) {
|
|
|
644
645
|
e.sourceField ?? ""
|
|
645
646
|
].join("::");
|
|
646
647
|
}
|
|
647
|
-
function
|
|
648
|
+
function yn(e) {
|
|
648
649
|
return `${F}${e}`;
|
|
649
650
|
}
|
|
650
651
|
function Et(e) {
|
|
651
652
|
return e.startsWith(F) && e.length > F.length;
|
|
652
653
|
}
|
|
653
|
-
function
|
|
654
|
+
function Sn(e) {
|
|
654
655
|
return Et(e) ? e.slice(F.length) : void 0;
|
|
655
656
|
}
|
|
656
657
|
function Ee(e) {
|
|
@@ -688,7 +689,7 @@ function oe(e) {
|
|
|
688
689
|
e.conditions.map(z).sort()
|
|
689
690
|
);
|
|
690
691
|
}
|
|
691
|
-
function
|
|
692
|
+
function bn(e) {
|
|
692
693
|
const n = e.map((a) => a.id);
|
|
693
694
|
if (new Set(n).size !== n.length)
|
|
694
695
|
throw new Error("Data App selections require one active selection per id.");
|
|
@@ -713,16 +714,16 @@ function Sn(e) {
|
|
|
713
714
|
function D(e, n) {
|
|
714
715
|
return e < n ? -1 : e > n ? 1 : 0;
|
|
715
716
|
}
|
|
716
|
-
function
|
|
717
|
+
function An(e, n) {
|
|
717
718
|
return se(e) === se(n);
|
|
718
719
|
}
|
|
719
720
|
const Nt = "(Blank)";
|
|
720
|
-
function
|
|
721
|
+
function In(e) {
|
|
721
722
|
return e.conditions.map((n) => n.label ? n.label : n.operator === "isNull" || n.value === null ? Nt : String(n.value)).join(" · ");
|
|
722
723
|
}
|
|
723
724
|
const Ot = t.union([
|
|
724
|
-
|
|
725
|
-
|
|
725
|
+
Ve,
|
|
726
|
+
We
|
|
726
727
|
]), xt = t.object({
|
|
727
728
|
name: t.string().min(1),
|
|
728
729
|
source: Ot,
|
|
@@ -733,7 +734,7 @@ const Ot = t.union([
|
|
|
733
734
|
operator: t.enum(["=", "isNull"]),
|
|
734
735
|
value: t.union([t.string(), t.number().finite(), t.null()]),
|
|
735
736
|
label: t.string().optional(),
|
|
736
|
-
temporalBucket:
|
|
737
|
+
temporalBucket: le.optional()
|
|
737
738
|
}).strict().superRefine((e, n) => {
|
|
738
739
|
e.operator === "isNull" != (e.value === null) && n.addIssue({
|
|
739
740
|
code: t.ZodIssueCode.custom,
|
|
@@ -749,15 +750,15 @@ const Ot = t.union([
|
|
|
749
750
|
message: "A tuple holds one condition per field.",
|
|
750
751
|
path: ["conditions"]
|
|
751
752
|
});
|
|
752
|
-
}),
|
|
753
|
+
}), _n = t.object({
|
|
753
754
|
kind: t.literal("selection"),
|
|
754
755
|
sourceCardId: t.string().min(1),
|
|
755
756
|
tuples: t.array(jt).min(1).max(Te)
|
|
756
757
|
}).strict(), Ft = t.object({
|
|
757
|
-
field:
|
|
758
|
+
field: Xe,
|
|
758
759
|
operator: t.enum(["=", "isNull"]),
|
|
759
760
|
value: t.union([t.string(), t.number().finite(), t.null()]),
|
|
760
|
-
temporalBucket:
|
|
761
|
+
temporalBucket: le.optional()
|
|
761
762
|
}).strict().superRefine((e, n) => {
|
|
762
763
|
e.operator === "isNull" != (e.value === null) && n.addIssue({
|
|
763
764
|
code: t.ZodIssueCode.custom,
|
|
@@ -777,7 +778,7 @@ const Ot = t.union([
|
|
|
777
778
|
path: ["conditions", a, "field"]
|
|
778
779
|
});
|
|
779
780
|
}
|
|
780
|
-
}),
|
|
781
|
+
}), wn = t.object({
|
|
781
782
|
id: t.string().min(1),
|
|
782
783
|
tuples: t.array(Lt).min(1).max(Te)
|
|
783
784
|
}).strict(), Ut = t.object({ key: t.string().min(1), nativeText: t.string().nullable() }).strict(), qt = t.object({
|
|
@@ -789,7 +790,7 @@ const Ot = t.union([
|
|
|
789
790
|
(e) => new Set(e.dataAnchors.map((n) => n.key)).size === e.dataAnchors.length,
|
|
790
791
|
{ message: "dataAnchors keys must be unique", path: ["dataAnchors"] }
|
|
791
792
|
);
|
|
792
|
-
function
|
|
793
|
+
function kn(e) {
|
|
793
794
|
if (e == null) return;
|
|
794
795
|
const n = qt.safeParse(e);
|
|
795
796
|
return n.success ? n.data : void 0;
|
|
@@ -864,7 +865,7 @@ function Ne(e, n = !1) {
|
|
|
864
865
|
const a = Ce[e.toUpperCase()] ?? "other";
|
|
865
866
|
return n ? a === "count" || a === "count_distinct" ? "count_distinct" : a === "min" || a === "max" ? a : "repeat_safe_other" : a;
|
|
866
867
|
}
|
|
867
|
-
const
|
|
868
|
+
const Bt = /* @__PURE__ */ new Set([
|
|
868
869
|
"NULLIF",
|
|
869
870
|
"COALESCE",
|
|
870
871
|
"IFNULL",
|
|
@@ -879,7 +880,7 @@ const Gt = /* @__PURE__ */ new Set([
|
|
|
879
880
|
"CAST",
|
|
880
881
|
"TRY_CAST",
|
|
881
882
|
"SAFE_CAST"
|
|
882
|
-
]),
|
|
883
|
+
]), Gt = /* @__PURE__ */ new Set(["DECIMAL", "NUMERIC", "INTEGER", "INT", "BIGINT", "FLOAT", "DOUBLE", "REAL", "VARCHAR", "TEXT"]), ie = /[A-Za-z_]/, zt = /[A-Za-z0-9_]/;
|
|
883
884
|
function V(e, n) {
|
|
884
885
|
const a = e[n];
|
|
885
886
|
let r = n + 1;
|
|
@@ -944,10 +945,10 @@ function W(e, n = /* @__PURE__ */ new Set()) {
|
|
|
944
945
|
if (ie.test(m)) {
|
|
945
946
|
const o = M(e, l), d = e.slice(l, o), p = j(e, o);
|
|
946
947
|
if (e[p] === "(" && Mt(d)) {
|
|
947
|
-
let
|
|
948
|
-
const I =
|
|
949
|
-
let E =
|
|
950
|
-
const T = e.slice(p + 1,
|
|
948
|
+
let g = P(e, p);
|
|
949
|
+
const I = g - 1;
|
|
950
|
+
let E = g;
|
|
951
|
+
const T = e.slice(p + 1, g - 1);
|
|
951
952
|
let x = T.trim() ? 1 : 0;
|
|
952
953
|
for (let h = p + 1; h < E - 1; h++)
|
|
953
954
|
e[h] === "'" || e[h] === '"' ? h = V(e, h) - 1 : e[h] === "(" ? h = P(e, h) - 1 : e[h] === "," && x++;
|
|
@@ -955,18 +956,18 @@ function W(e, n = /* @__PURE__ */ new Set()) {
|
|
|
955
956
|
W(C ? T.replace(/^\s*DISTINCT\b/i, "") : T).calls.length > 0 && (s = !0);
|
|
956
957
|
let b = !1, _ = !1;
|
|
957
958
|
for (; ; ) {
|
|
958
|
-
const h = j(e,
|
|
959
|
+
const h = j(e, g);
|
|
959
960
|
if (!ie.test(e[h] || "")) break;
|
|
960
961
|
const N = M(e, h), R = e.slice(h, N).toUpperCase(), u = j(e, N);
|
|
961
962
|
if (R === "WITHIN") {
|
|
962
963
|
const S = M(e, u), w = j(e, S);
|
|
963
964
|
if (e.slice(u, S).toUpperCase() === "GROUP" && e[w] === "(") {
|
|
964
|
-
|
|
965
|
+
g = P(e, w), E = g;
|
|
965
966
|
continue;
|
|
966
967
|
}
|
|
967
968
|
}
|
|
968
969
|
if ((R === "FILTER" || R === "OVER") && e[u] === "(") {
|
|
969
|
-
b = b || R === "OVER", _ = _ || R === "FILTER",
|
|
970
|
+
b = b || R === "OVER", _ = _ || R === "FILTER", g = P(e, u);
|
|
970
971
|
continue;
|
|
971
972
|
}
|
|
972
973
|
break;
|
|
@@ -976,11 +977,11 @@ function W(e, n = /* @__PURE__ */ new Set()) {
|
|
|
976
977
|
kind: Ne(d, C),
|
|
977
978
|
distinct: C,
|
|
978
979
|
windowed: b,
|
|
979
|
-
tokens: Wt(e.slice(p,
|
|
980
|
+
tokens: Wt(e.slice(p, g)),
|
|
980
981
|
span: { start: l, end: E, argumentStart: p + 1, argumentEnd: I },
|
|
981
982
|
argumentCount: x,
|
|
982
983
|
filtered: _
|
|
983
|
-
}), c += `@${a.length - 1}`, l =
|
|
984
|
+
}), c += `@${a.length - 1}`, l = g;
|
|
984
985
|
continue;
|
|
985
986
|
}
|
|
986
987
|
c += e.slice(l, o), l = o;
|
|
@@ -1032,9 +1033,9 @@ function Xt(e, n) {
|
|
|
1032
1033
|
}
|
|
1033
1034
|
if (o.startsWith("@") || o === "'S'" || ["NULL", "TRUE", "FALSE"].includes(o) || /^[0-9.]/.test(o))
|
|
1034
1035
|
return s++, !0;
|
|
1035
|
-
if (!
|
|
1036
|
+
if (!Bt.has(o) || (s++, !c("(") || !i())) return !1;
|
|
1036
1037
|
if (["CAST", "TRY_CAST", "SAFE_CAST"].includes(o)) {
|
|
1037
|
-
if (!c("AS") || !
|
|
1038
|
+
if (!c("AS") || !Gt.has(a[s++]) || (c("PRECISION"), c("(") && (!/^\d+$/.test(a[s++] || "") || c(",") && !/^\d+$/.test(a[s++] || "") || !c(")"))))
|
|
1038
1039
|
return !1;
|
|
1039
1040
|
} else
|
|
1040
1041
|
for (; c(","); ) if (!i()) return !1;
|
|
@@ -1042,7 +1043,7 @@ function Xt(e, n) {
|
|
|
1042
1043
|
};
|
|
1043
1044
|
return i() && s === a.length;
|
|
1044
1045
|
}
|
|
1045
|
-
function
|
|
1046
|
+
function Zt(e) {
|
|
1046
1047
|
const n = [];
|
|
1047
1048
|
let a = 0;
|
|
1048
1049
|
for (; a < e.length; ) {
|
|
@@ -1087,7 +1088,7 @@ function $t(e) {
|
|
|
1087
1088
|
return n;
|
|
1088
1089
|
}
|
|
1089
1090
|
function Kt(e) {
|
|
1090
|
-
const n =
|
|
1091
|
+
const n = Zt(e), a = n.some((o) => o.type === "op" && o.value === "/");
|
|
1091
1092
|
if (n.some((o) => o.type === "other"))
|
|
1092
1093
|
return { kind: "other", hasDivision: a };
|
|
1093
1094
|
let r = 0, s = !0;
|
|
@@ -1099,9 +1100,9 @@ function Kt(e) {
|
|
|
1099
1100
|
if (!(I && I.type === "op" && (I.value === "+" || I.value === "-"))) break;
|
|
1100
1101
|
r += 1;
|
|
1101
1102
|
}
|
|
1102
|
-
const
|
|
1103
|
-
if (!
|
|
1104
|
-
d === void 0 ? d =
|
|
1103
|
+
const g = i();
|
|
1104
|
+
if (!g) return null;
|
|
1105
|
+
d === void 0 ? d = g.degree : d !== g.degree && (s = !1), o = o.concat(g.units), p = !1;
|
|
1105
1106
|
}
|
|
1106
1107
|
return { degree: d ?? 0, units: o };
|
|
1107
1108
|
}, i = () => {
|
|
@@ -1163,7 +1164,7 @@ function xe(e) {
|
|
|
1163
1164
|
return { kind: "none", reason: "other" };
|
|
1164
1165
|
}
|
|
1165
1166
|
}
|
|
1166
|
-
function
|
|
1167
|
+
function $t(e) {
|
|
1167
1168
|
var n, a;
|
|
1168
1169
|
return ((n = e.derivedField) == null ? void 0 : n.computeStage) || ((a = e.calculatedFormula) == null ? void 0 : a.computeStage);
|
|
1169
1170
|
}
|
|
@@ -1177,7 +1178,7 @@ const Q = {
|
|
|
1177
1178
|
identity: "unresolved",
|
|
1178
1179
|
unresolved: !0
|
|
1179
1180
|
}, Pe = { ...Q, stage: "row" };
|
|
1180
|
-
function
|
|
1181
|
+
function Z(e) {
|
|
1181
1182
|
return {
|
|
1182
1183
|
stage: "row",
|
|
1183
1184
|
outer: e,
|
|
@@ -1190,7 +1191,7 @@ function $(e) {
|
|
|
1190
1191
|
unresolved: !1
|
|
1191
1192
|
};
|
|
1192
1193
|
}
|
|
1193
|
-
function
|
|
1194
|
+
function B(e, n) {
|
|
1194
1195
|
var r;
|
|
1195
1196
|
const a = (r = n.derivedField) == null ? void 0 : r.aggregationBehavior;
|
|
1196
1197
|
return !a || e.unresolved ? e : a === "additive" ? e.reaggregation.kind === "additive" ? e : { ...e, reaggregation: { kind: "additive" } } : { ...e, reaggregation: { kind: "none", reason: "declared" } };
|
|
@@ -1202,7 +1203,7 @@ function Ht(e, n) {
|
|
|
1202
1203
|
return r === "row_input" ? "raw" : r.unresolved || r.stage === "aggregate" || r.outer ? r : "raw";
|
|
1203
1204
|
}
|
|
1204
1205
|
const a = X(e.aggregate);
|
|
1205
|
-
return a ?
|
|
1206
|
+
return a ? Z(a) : "raw";
|
|
1206
1207
|
}
|
|
1207
1208
|
const Yt = 12;
|
|
1208
1209
|
function J(e, n) {
|
|
@@ -1210,8 +1211,8 @@ function J(e, n) {
|
|
|
1210
1211
|
if (n > Yt) return Q;
|
|
1211
1212
|
const a = typeof e.expression == "string" ? e.expression.trim() : "";
|
|
1212
1213
|
if (!a)
|
|
1213
|
-
return
|
|
1214
|
-
|
|
1214
|
+
return B(
|
|
1215
|
+
Z(X(e.aggregate) ?? "sum"),
|
|
1215
1216
|
e
|
|
1216
1217
|
);
|
|
1217
1218
|
const r = W(a), s = ((R = e.calculatedFormula) == null ? void 0 : R.inputFields) || [], c = (u) => {
|
|
@@ -1229,17 +1230,17 @@ function J(e, n) {
|
|
|
1229
1230
|
})
|
|
1230
1231
|
), m = Array.from(i.values()).filter(
|
|
1231
1232
|
(u) => u !== "raw"
|
|
1232
|
-
), o = Array.from(i.values()).some((u) => u === "raw"), d = r.calls.length > 0 || m.length > 0 ||
|
|
1233
|
+
), o = Array.from(i.values()).some((u) => u === "raw"), d = r.calls.length > 0 || m.length > 0 || $t(e) === "aggregate" || !!e.isPreAggregated, p = new Set(
|
|
1233
1234
|
[...i].filter(
|
|
1234
1235
|
([u, S]) => S === "raw" ? !d && !!c(u) : !S.unresolved
|
|
1235
1236
|
).map(([u]) => u)
|
|
1236
|
-
),
|
|
1237
|
+
), g = W(a, p).aggregateInputsComplete;
|
|
1237
1238
|
if (!d) {
|
|
1238
|
-
if (!
|
|
1239
|
+
if (!g) return Pe;
|
|
1239
1240
|
const u = X(e.aggregate);
|
|
1240
|
-
return u ?
|
|
1241
|
+
return u ? B(Z(u), e) : "row_input";
|
|
1241
1242
|
}
|
|
1242
|
-
const I = !
|
|
1243
|
+
const I = !g || o || r.nestedAggregate || l || m.some((u) => u.unresolved) || r.calls.length === 0 && m.length === 0, E = [
|
|
1243
1244
|
...r.calls.map((u) => ({ kind: u.kind, distinct: u.distinct })),
|
|
1244
1245
|
...m.flatMap((u) => u.calls)
|
|
1245
1246
|
], T = r.windowed || m.some((u) => u.windowed), x = !I && !T && E.every((u) => Oe.has(u.kind)), C = (u) => {
|
|
@@ -1264,7 +1265,7 @@ function J(e, n) {
|
|
|
1264
1265
|
h = u.identity, N = u.outputType;
|
|
1265
1266
|
}
|
|
1266
1267
|
else b.kind === "linear" ? (_ = b.units.every((S) => C(S).kind === "additive") ? { kind: "additive" } : { kind: "none", reason: "other" }, h = "linear") : (_ = { kind: "none", reason: b.hasDivision ? "ratio" : "other" }, h = b.hasDivision ? "ratio" : "expression");
|
|
1267
|
-
return
|
|
1268
|
+
return B(
|
|
1268
1269
|
{
|
|
1269
1270
|
stage: "aggregate",
|
|
1270
1271
|
calls: E,
|
|
@@ -1278,7 +1279,7 @@ function J(e, n) {
|
|
|
1278
1279
|
e
|
|
1279
1280
|
);
|
|
1280
1281
|
}
|
|
1281
|
-
function
|
|
1282
|
+
function vn(e) {
|
|
1282
1283
|
const n = J(e, 0);
|
|
1283
1284
|
return n === "row_input" ? Pe : n;
|
|
1284
1285
|
}
|
|
@@ -1286,10 +1287,10 @@ const Qt = t.object({
|
|
|
1286
1287
|
intent: Je,
|
|
1287
1288
|
matrixWindowRequest: pe
|
|
1288
1289
|
}).strict(), Jt = t.object({
|
|
1289
|
-
runtimeFilters:
|
|
1290
|
-
runtimeSorts:
|
|
1290
|
+
runtimeFilters: G.innerType().shape.filters,
|
|
1291
|
+
runtimeSorts: G.innerType().shape.sorts.optional()
|
|
1291
1292
|
});
|
|
1292
|
-
function
|
|
1293
|
+
function Tn(e) {
|
|
1293
1294
|
return Jt.parse(e);
|
|
1294
1295
|
}
|
|
1295
1296
|
const en = {
|
|
@@ -1299,39 +1300,39 @@ const en = {
|
|
|
1299
1300
|
resultShape: t.literal("matrix"),
|
|
1300
1301
|
result: Ae.optional(),
|
|
1301
1302
|
metadata: t.object({ rowLimitExceeded: t.boolean(), matrixFailure: Y.optional() }).passthrough()
|
|
1302
|
-
}, tn = ve.extend(en),
|
|
1303
|
+
}, tn = ve.extend(en), Rn = tn.superRefine((e, n) => {
|
|
1303
1304
|
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." });
|
|
1304
1305
|
});
|
|
1305
1306
|
export {
|
|
1306
1307
|
lt as $,
|
|
1307
1308
|
oe as A,
|
|
1308
|
-
|
|
1309
|
-
|
|
1309
|
+
An as B,
|
|
1310
|
+
In as C,
|
|
1310
1311
|
xt as D,
|
|
1311
1312
|
Pt as E,
|
|
1312
1313
|
jt as F,
|
|
1313
1314
|
Ft as G,
|
|
1314
1315
|
Lt as H,
|
|
1315
1316
|
qt as I,
|
|
1316
|
-
|
|
1317
|
+
kn as J,
|
|
1317
1318
|
Mt as K,
|
|
1318
1319
|
Ne as L,
|
|
1319
1320
|
W as M,
|
|
1320
1321
|
Kt as N,
|
|
1321
|
-
|
|
1322
|
+
vn as O,
|
|
1322
1323
|
me as P,
|
|
1323
1324
|
nt as Q,
|
|
1324
1325
|
at as R,
|
|
1325
1326
|
H as S,
|
|
1326
|
-
|
|
1327
|
-
|
|
1327
|
+
sn as T,
|
|
1328
|
+
on as U,
|
|
1328
1329
|
st as V,
|
|
1329
|
-
|
|
1330
|
+
cn as W,
|
|
1330
1331
|
it as X,
|
|
1331
1332
|
te as Y,
|
|
1332
1333
|
ct as Z,
|
|
1333
|
-
|
|
1334
|
-
|
|
1334
|
+
ln as _,
|
|
1335
|
+
wn as a,
|
|
1335
1336
|
ut as a0,
|
|
1336
1337
|
dt as a1,
|
|
1337
1338
|
ne as a2,
|
|
@@ -1339,28 +1340,28 @@ export {
|
|
|
1339
1340
|
mt as a4,
|
|
1340
1341
|
Se as a5,
|
|
1341
1342
|
pt as a6,
|
|
1342
|
-
|
|
1343
|
-
|
|
1343
|
+
un as a7,
|
|
1344
|
+
dn as a8,
|
|
1344
1345
|
ht as a9,
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1346
|
+
ft as aa,
|
|
1347
|
+
gt as ab,
|
|
1348
|
+
mn as ac,
|
|
1349
|
+
pn as ad,
|
|
1349
1350
|
yt as ae,
|
|
1350
1351
|
St as af,
|
|
1351
1352
|
ae as ag,
|
|
1352
1353
|
bt as ah,
|
|
1353
|
-
|
|
1354
|
+
hn as ai,
|
|
1354
1355
|
Jt as aj,
|
|
1355
|
-
|
|
1356
|
-
|
|
1356
|
+
Tn as ak,
|
|
1357
|
+
Rn as al,
|
|
1357
1358
|
Qt as am,
|
|
1358
|
-
|
|
1359
|
-
|
|
1359
|
+
Sn as b,
|
|
1360
|
+
bn as c,
|
|
1360
1361
|
At as d,
|
|
1361
1362
|
It as e,
|
|
1362
1363
|
_e as f,
|
|
1363
|
-
|
|
1364
|
+
fn as g,
|
|
1364
1365
|
we as h,
|
|
1365
1366
|
Rt as i,
|
|
1366
1367
|
ke as j,
|
|
@@ -1372,9 +1373,9 @@ export {
|
|
|
1372
1373
|
gn as p,
|
|
1373
1374
|
Ae as q,
|
|
1374
1375
|
Te as r,
|
|
1375
|
-
|
|
1376
|
+
_n as s,
|
|
1376
1377
|
Re as t,
|
|
1377
|
-
|
|
1378
|
+
yn as u,
|
|
1378
1379
|
Et as v,
|
|
1379
1380
|
Ee as w,
|
|
1380
1381
|
Ct as x,
|