react-semaphor 0.1.416 → 0.1.418
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/analytics-protocol/index.cjs +1 -1
- package/dist/analytics-protocol/index.js +49 -50
- package/dist/brand-studio/index.cjs +1 -1
- package/dist/brand-studio/index.js +2 -2
- package/dist/chunks/analyze-result-contract-Akysi2ML.js +2003 -0
- package/dist/chunks/analyze-result-contract-COjyJzYm.js +1 -0
- package/dist/chunks/{calendar-preferences-dialog-B8FmFRHX.js → calendar-preferences-dialog-BbuLgela.js} +3 -3
- package/dist/chunks/{calendar-preferences-dialog-ck4AU-to.js → calendar-preferences-dialog-CInkkhl_.js} +1 -1
- package/dist/chunks/{dashboard-briefing-launcher-Br_1IK1z.js → dashboard-briefing-launcher-B4OWNsVD.js} +1 -1
- package/dist/chunks/{dashboard-briefing-launcher-Tr2SqDMK.js → dashboard-briefing-launcher-D7FNuDuc.js} +4 -4
- package/dist/chunks/{dashboard-controls-B7OObDNl.js → dashboard-controls-DTC1eCz0.js} +1 -1
- package/dist/chunks/{dashboard-controls-B2bEv8uG.js → dashboard-controls-DcX7Mid4.js} +5 -5
- package/dist/chunks/{dashboard-json-DAB8WVyb.js → dashboard-json-BHWbQS6I.js} +3 -3
- package/dist/chunks/{dashboard-json-DNixjalS.js → dashboard-json-vu38P5pV.js} +1 -1
- package/dist/chunks/{edit-dashboard-visual-DWygSAp3.js → edit-dashboard-visual-CkBhJBhp.js} +1 -1
- package/dist/chunks/{edit-dashboard-visual-Dh8Ge3-B.js → edit-dashboard-visual-DsCr90_3.js} +4 -4
- package/dist/chunks/{index-BkTLAfKy.js → index-C56DuHI8.js} +163 -164
- package/dist/chunks/{index-CQIMj-FF.js → index-C8thRvkW.js} +4 -4
- package/dist/chunks/{switch-DMlqgIx_.js → switch-BXuyni6l.js} +1 -1
- package/dist/chunks/{switch-DgiogS4X.js → switch-Dsx-IwBE.js} +1 -1
- package/dist/chunks/{update-policy-BnEbPhHW.js → update-policy-B5S_LfEu.js} +347 -314
- package/dist/chunks/update-policy-BqBKUk3Q.js +3 -0
- package/dist/chunks/{use-create-flow-overlay-state-CZA-dSns.js → use-create-flow-overlay-state-BDv_VpL6.js} +1 -1
- package/dist/chunks/{use-create-flow-overlay-state-uujasvbD.js → use-create-flow-overlay-state-CzftV84t.js} +3 -3
- package/dist/chunks/{validators-UqQI3Cg_.js → validators-CLzrE2N_.js} +1 -1
- package/dist/chunks/validators-CPFcUMrV.js +1 -0
- package/dist/dashboard/index.cjs +1 -1
- package/dist/dashboard/index.js +1 -1
- package/dist/dashboard-authoring/index.cjs +3 -3
- package/dist/dashboard-authoring/index.js +28 -29
- package/dist/data-app-builder/index.cjs +1 -1
- package/dist/data-app-builder/index.js +2 -2
- package/dist/data-app-codegen/index.cjs +1 -1
- package/dist/data-app-codegen/index.js +2 -2
- package/dist/data-app-codegen-node/index.cjs +154 -125
- package/dist/data-app-codegen-node/index.js +691 -609
- package/dist/data-app-sdk/index.cjs +2 -2
- package/dist/data-app-sdk/index.js +171 -157
- package/dist/data-app-sdk-adapters/index.cjs +1 -1
- package/dist/data-app-sdk-adapters/index.js +26 -27
- package/dist/data-app-sdk-validation/index.cjs +1 -1
- package/dist/data-app-sdk-validation/index.js +17 -18
- package/dist/index.cjs +1 -1
- package/dist/index.js +7 -7
- package/dist/surfboard/index.cjs +1 -1
- package/dist/surfboard/index.js +2 -2
- package/dist/types/analytics-protocol.d.ts +6 -1
- package/dist/types/dashboard-assistant.d.ts +1 -0
- package/dist/types/data-app-codegen-node.d.ts +5 -3
- package/dist/types/data-app-codegen.d.ts +5 -3
- package/dist/types/data-app-sdk-validation.d.ts +1 -0
- package/dist/types/data-app-sdk.d.ts +6 -0
- package/package.json +1 -1
- package/dist/chunks/analyze-result-contract-8nxUOWp8.js +0 -1
- package/dist/chunks/analyze-result-contract-DPjm6btg.js +0 -1869
- package/dist/chunks/source-identity-BM2FvJDP.js +0 -1
- package/dist/chunks/source-identity-Cv4Nm3TM.js +0 -75
- package/dist/chunks/update-policy-CWg9c08k.js +0 -3
- package/dist/chunks/validators-JzI7olk4.js +0 -1
|
@@ -1,44 +1,44 @@
|
|
|
1
|
-
import { S as
|
|
2
|
-
import { toSemaphorInputOptionsIntent as
|
|
3
|
-
const
|
|
4
|
-
function
|
|
5
|
-
return
|
|
6
|
-
...
|
|
7
|
-
...
|
|
1
|
+
import { S as Q, a as X, v as Z } from "./analyze-result-contract-Akysi2ML.js";
|
|
2
|
+
import { toSemaphorInputOptionsIntent as ee, toSemaphorAnalysisQueryOptions as te, toSemaphorAnalysisIntent as re, toSemaphorMetricIntent as ne, toSemaphorRecordsIntent as ae, toSemaphorMatrixIntent as se, toSemaphorSqlIntent as ie } from "../data-app-sdk-adapters/index.js";
|
|
3
|
+
const Ue = Q, j = X, x = "semaphor-generated-data-app-contract/v1", M = "semaphor-generated-data-app-contract-manifest/v1";
|
|
4
|
+
function L(e) {
|
|
5
|
+
return w(e) ? [
|
|
6
|
+
...Z(e).issues,
|
|
7
|
+
...oe(e)
|
|
8
8
|
] : ["Plan artifact must be a Semaphor codegenSummary object."];
|
|
9
9
|
}
|
|
10
10
|
function ze(e) {
|
|
11
|
-
const t =
|
|
11
|
+
const t = L(e);
|
|
12
12
|
if (t.length > 0)
|
|
13
13
|
throw new Error(`Invalid Semaphor codegenSummary:
|
|
14
14
|
- ${t.join(`
|
|
15
15
|
- `)}`);
|
|
16
16
|
}
|
|
17
|
-
function
|
|
17
|
+
function oe(e) {
|
|
18
18
|
var r;
|
|
19
|
-
const t =
|
|
19
|
+
const t = w(e);
|
|
20
20
|
if (!t)
|
|
21
21
|
return [];
|
|
22
22
|
const n = [];
|
|
23
|
-
return ((r =
|
|
23
|
+
return ((r = w(t.validation)) == null ? void 0 : r.status) === "blocked" && n.push(
|
|
24
24
|
"validation.status blocked cannot be generated. Resolve blocked semantic model gaps and replan before generating contract files."
|
|
25
|
-
), Array.isArray(t.unsupportedInsights) && t.unsupportedInsights.forEach((
|
|
26
|
-
var
|
|
27
|
-
((
|
|
28
|
-
`unsupportedInsights.${
|
|
25
|
+
), Array.isArray(t.unsupportedInsights) && t.unsupportedInsights.forEach((s, o) => {
|
|
26
|
+
var a;
|
|
27
|
+
((a = w(s)) == null ? void 0 : a.reason) === "missing_relationship" && n.push(
|
|
28
|
+
`unsupportedInsights.${o}.reason missing_relationship blocks contract generation. Call semaphor_propose_semantic_model_change, apply an approved semantic model patch, and replan before generating contract files.`
|
|
29
29
|
);
|
|
30
|
-
}), Array.isArray(t.views) && t.views.forEach((
|
|
31
|
-
var
|
|
32
|
-
const
|
|
33
|
-
(
|
|
34
|
-
`views.${
|
|
30
|
+
}), Array.isArray(t.views) && t.views.forEach((s, o) => {
|
|
31
|
+
var i;
|
|
32
|
+
const a = w((i = w(s)) == null ? void 0 : i.computation);
|
|
33
|
+
(a == null ? void 0 : a.kind) === "unsupported" && a.reason === "missing_relationship" && n.push(
|
|
34
|
+
`views.${o}.computation.reason missing_relationship blocks contract generation. Call semaphor_propose_semantic_model_change, apply an approved semantic model patch, and replan before generating contract files.`
|
|
35
35
|
);
|
|
36
36
|
}), n;
|
|
37
37
|
}
|
|
38
|
-
function
|
|
38
|
+
function w(e) {
|
|
39
39
|
return e && typeof e == "object" && !Array.isArray(e) ? e : void 0;
|
|
40
40
|
}
|
|
41
|
-
const
|
|
41
|
+
const ce = [
|
|
42
42
|
"sources.ts",
|
|
43
43
|
"fields.ts",
|
|
44
44
|
"inputs.ts",
|
|
@@ -47,15 +47,15 @@ const oe = [
|
|
|
47
47
|
"accessors.ts",
|
|
48
48
|
"metadata.ts",
|
|
49
49
|
"index.ts"
|
|
50
|
-
],
|
|
51
|
-
...
|
|
50
|
+
], de = [
|
|
51
|
+
...ce,
|
|
52
52
|
"contract.manifest.json"
|
|
53
53
|
];
|
|
54
54
|
async function Je({
|
|
55
55
|
manifest: e,
|
|
56
56
|
generatedFiles: t
|
|
57
57
|
}) {
|
|
58
|
-
const n = [], r =
|
|
58
|
+
const n = [], r = h(e);
|
|
59
59
|
if (!r)
|
|
60
60
|
return {
|
|
61
61
|
issues: [
|
|
@@ -74,20 +74,20 @@ async function Je({
|
|
|
74
74
|
message: `generatedContractSchemaVersion must be ${x}. Regenerate the contract with semaphor_generate_data_app_contract.`,
|
|
75
75
|
repairHint: "Regenerate the contract with semaphor_generate_data_app_contract."
|
|
76
76
|
});
|
|
77
|
-
const
|
|
78
|
-
S(
|
|
77
|
+
const s = h(r.generator);
|
|
78
|
+
S(s == null ? void 0 : s.name) || n.push({
|
|
79
79
|
path: "generator.name",
|
|
80
80
|
message: "generator.name is required.",
|
|
81
81
|
repairHint: "Regenerate the generated contract so manifest generator metadata is written deterministically."
|
|
82
|
-
}), S(
|
|
82
|
+
}), S(s == null ? void 0 : s.version) || n.push({
|
|
83
83
|
path: "generator.version",
|
|
84
84
|
message: "generator.version is required.",
|
|
85
85
|
repairHint: "Regenerate the generated contract so manifest generator metadata is written deterministically."
|
|
86
86
|
});
|
|
87
|
-
for (const
|
|
87
|
+
for (const a of L(r.codegenSummary))
|
|
88
88
|
n.push({
|
|
89
|
-
path: `codegenSummary.${
|
|
90
|
-
message: `codegenSummary.${
|
|
89
|
+
path: `codegenSummary.${a}`,
|
|
90
|
+
message: `codegenSummary.${a}`,
|
|
91
91
|
repairHint: "Regenerate the generated contract from a valid Data App codegenSummary."
|
|
92
92
|
});
|
|
93
93
|
if (r.codegenSummaryValidatorVersion !== j && n.push({
|
|
@@ -100,27 +100,27 @@ async function Je({
|
|
|
100
100
|
message: "codegenSummaryHash is required.",
|
|
101
101
|
repairHint: "Regenerate the generated contract so manifest hashes are written deterministically."
|
|
102
102
|
});
|
|
103
|
-
else if (
|
|
104
|
-
const
|
|
103
|
+
else if (h(r.codegenSummary)) {
|
|
104
|
+
const a = await pe(
|
|
105
105
|
r.codegenSummary
|
|
106
106
|
);
|
|
107
|
-
r.codegenSummaryHash !==
|
|
107
|
+
r.codegenSummaryHash !== a && n.push({
|
|
108
108
|
path: "codegenSummaryHash",
|
|
109
109
|
message: "codegenSummaryHash does not match codegenSummary. Regenerate the contract instead of editing the manifest.",
|
|
110
110
|
repairHint: "Regenerate the generated contract instead of editing the manifest."
|
|
111
111
|
});
|
|
112
112
|
}
|
|
113
|
-
n.push(...
|
|
114
|
-
const
|
|
115
|
-
if (n.push(...
|
|
113
|
+
n.push(...fe(r.codegenSummary));
|
|
114
|
+
const o = t ? ue(t) : [];
|
|
115
|
+
if (n.push(...o), typeof r.generatedContentHash != "string")
|
|
116
116
|
n.push({
|
|
117
117
|
path: "generatedContentHash",
|
|
118
118
|
message: "generatedContentHash is required.",
|
|
119
119
|
repairHint: "Regenerate the generated contract so manifest hashes are written deterministically."
|
|
120
120
|
});
|
|
121
|
-
else if (t &&
|
|
122
|
-
const
|
|
123
|
-
r.generatedContentHash !==
|
|
121
|
+
else if (t && o.length === 0) {
|
|
122
|
+
const a = await ge(t);
|
|
123
|
+
r.generatedContentHash !== a && n.push({
|
|
124
124
|
path: "generatedContentHash",
|
|
125
125
|
message: "generatedContentHash does not match generated TypeScript files. Regenerate the contract instead of hand-editing generated files.",
|
|
126
126
|
repairHint: "Regenerate the contract instead of hand-editing generated files."
|
|
@@ -128,90 +128,90 @@ async function Je({
|
|
|
128
128
|
}
|
|
129
129
|
return { issues: n };
|
|
130
130
|
}
|
|
131
|
-
function
|
|
131
|
+
function ue(e) {
|
|
132
132
|
var r;
|
|
133
|
-
const t = [], n = new Set(
|
|
134
|
-
for (const
|
|
135
|
-
if (
|
|
136
|
-
const
|
|
133
|
+
const t = [], n = new Set(de);
|
|
134
|
+
for (const s of Object.keys(e)) {
|
|
135
|
+
if (s.includes("/") || s.includes("\\")) {
|
|
136
|
+
const o = ((r = s.split("/").pop()) == null ? void 0 : r.split("\\").pop()) || s;
|
|
137
137
|
t.push({
|
|
138
|
-
path: `generatedFiles.${
|
|
139
|
-
message: `generatedFiles keys must be generated filenames such as "${
|
|
138
|
+
path: `generatedFiles.${s}`,
|
|
139
|
+
message: `generatedFiles keys must be generated filenames such as "${o}", not path-qualified keys such as "${s}".`,
|
|
140
140
|
repairHint: 'Pass generatedFiles keyed by filename, for example "queries.ts", not "src/semaphor/generated/queries.ts".'
|
|
141
141
|
});
|
|
142
142
|
continue;
|
|
143
143
|
}
|
|
144
|
-
n.has(
|
|
145
|
-
path: `generatedFiles.${
|
|
146
|
-
message: `generatedFiles contains unknown generated contract file "${
|
|
144
|
+
n.has(s) || t.push({
|
|
145
|
+
path: `generatedFiles.${s}`,
|
|
146
|
+
message: `generatedFiles contains unknown generated contract file "${s}".`,
|
|
147
147
|
repairHint: "Pass only the generated files returned by semaphor_generate_data_app_contract, keyed by filename."
|
|
148
148
|
});
|
|
149
149
|
}
|
|
150
150
|
return t;
|
|
151
151
|
}
|
|
152
|
-
function
|
|
153
|
-
const t =
|
|
152
|
+
function fe(e) {
|
|
153
|
+
const t = h(e);
|
|
154
154
|
if (!t)
|
|
155
155
|
return [];
|
|
156
156
|
const n = [], r = new Set(
|
|
157
|
-
V(t.inputs).map((
|
|
158
|
-
var
|
|
159
|
-
return (
|
|
157
|
+
V(t.inputs).map((o) => {
|
|
158
|
+
var a;
|
|
159
|
+
return (a = h(o)) == null ? void 0 : a.id;
|
|
160
160
|
}).filter(S)
|
|
161
|
-
),
|
|
162
|
-
V(t.views).map((
|
|
163
|
-
var
|
|
164
|
-
return (
|
|
161
|
+
), s = new Set(
|
|
162
|
+
V(t.views).map((o) => {
|
|
163
|
+
var a;
|
|
164
|
+
return (a = h(o)) == null ? void 0 : a.id;
|
|
165
165
|
}).filter(S)
|
|
166
166
|
);
|
|
167
|
-
return V(t.filterContracts).forEach((
|
|
168
|
-
const
|
|
167
|
+
return V(t.filterContracts).forEach((o, a) => {
|
|
168
|
+
const i = h(o), c = i == null ? void 0 : i.inputId;
|
|
169
169
|
(!S(c) || !r.has(c)) && n.push({
|
|
170
|
-
path: `codegenSummary.filterContracts.${
|
|
171
|
-
message: `codegenSummary.filterContracts.${
|
|
170
|
+
path: `codegenSummary.filterContracts.${a}.inputId`,
|
|
171
|
+
message: `codegenSummary.filterContracts.${a}.inputId must reference a generated input.`,
|
|
172
172
|
repairHint: "Regenerate the generated contract from a valid planner output."
|
|
173
|
-
}), Array.isArray(
|
|
174
|
-
const
|
|
175
|
-
(!S(m) || !
|
|
176
|
-
path: `codegenSummary.filterContracts.${
|
|
177
|
-
message: `codegenSummary.filterContracts.${
|
|
173
|
+
}), Array.isArray(i == null ? void 0 : i.bindings) && i.bindings.forEach((u, f) => {
|
|
174
|
+
const g = h(u), m = g == null ? void 0 : g.viewId;
|
|
175
|
+
(!S(m) || !s.has(m)) && n.push({
|
|
176
|
+
path: `codegenSummary.filterContracts.${a}.bindings.${f}.viewId`,
|
|
177
|
+
message: `codegenSummary.filterContracts.${a}.bindings.${f}.viewId must reference a generated view.`,
|
|
178
178
|
repairHint: "Regenerate the generated contract from a valid planner output."
|
|
179
179
|
});
|
|
180
|
-
const
|
|
181
|
-
S(
|
|
182
|
-
path: `codegenSummary.filterContracts.${
|
|
183
|
-
message: `codegenSummary.filterContracts.${
|
|
180
|
+
const y = h(g == null ? void 0 : g.fieldRef);
|
|
181
|
+
S(y == null ? void 0 : y.name) || n.push({
|
|
182
|
+
path: `codegenSummary.filterContracts.${a}.bindings.${f}.fieldRef`,
|
|
183
|
+
message: `codegenSummary.filterContracts.${a}.bindings.${f}.fieldRef is required.`,
|
|
184
184
|
repairHint: "Regenerate the generated contract from a valid planner output."
|
|
185
185
|
});
|
|
186
186
|
});
|
|
187
187
|
}), n;
|
|
188
188
|
}
|
|
189
|
-
async function
|
|
189
|
+
async function ge(e) {
|
|
190
190
|
const t = Object.keys(e).filter((r) => r.endsWith(".ts")).sort();
|
|
191
191
|
let n = "";
|
|
192
192
|
for (const r of t)
|
|
193
193
|
n += `${r}\0${e[r]}\0`;
|
|
194
|
-
return `sha256:${await
|
|
194
|
+
return `sha256:${await U(n)}`;
|
|
195
195
|
}
|
|
196
196
|
async function pe(e) {
|
|
197
|
-
return `sha256:${await
|
|
197
|
+
return `sha256:${await U(k(e))}`;
|
|
198
198
|
}
|
|
199
|
-
function
|
|
199
|
+
function k(e) {
|
|
200
200
|
if (e === null || typeof e != "object")
|
|
201
201
|
return JSON.stringify(e);
|
|
202
202
|
if (Array.isArray(e))
|
|
203
|
-
return `[${e.map((r) =>
|
|
203
|
+
return `[${e.map((r) => k(r)).join(",")}]`;
|
|
204
204
|
const t = e;
|
|
205
|
-
return `{${Object.keys(t).sort().filter((r) => t[r] !== void 0).map((r) => `${JSON.stringify(r)}:${
|
|
205
|
+
return `{${Object.keys(t).sort().filter((r) => t[r] !== void 0).map((r) => `${JSON.stringify(r)}:${k(t[r])}`).join(",")}}`;
|
|
206
206
|
}
|
|
207
|
-
async function
|
|
207
|
+
async function U(e) {
|
|
208
208
|
var r;
|
|
209
209
|
if (!((r = globalThis.crypto) != null && r.subtle))
|
|
210
210
|
throw new Error("SHA-256 digest support is required for generated contract validation.");
|
|
211
211
|
const t = new TextEncoder().encode(e), n = await globalThis.crypto.subtle.digest("SHA-256", t);
|
|
212
|
-
return Array.from(new Uint8Array(n)).map((
|
|
212
|
+
return Array.from(new Uint8Array(n)).map((s) => s.toString(16).padStart(2, "0")).join("");
|
|
213
213
|
}
|
|
214
|
-
function
|
|
214
|
+
function h(e) {
|
|
215
215
|
return e && typeof e == "object" && !Array.isArray(e) ? e : void 0;
|
|
216
216
|
}
|
|
217
217
|
function V(e) {
|
|
@@ -220,71 +220,71 @@ function V(e) {
|
|
|
220
220
|
function S(e) {
|
|
221
221
|
return typeof e == "string" && e.length > 0;
|
|
222
222
|
}
|
|
223
|
-
function
|
|
224
|
-
const t = d(e), n =
|
|
225
|
-
return
|
|
226
|
-
var
|
|
227
|
-
const
|
|
228
|
-
return !!(
|
|
229
|
-
}).forEach((
|
|
223
|
+
function Ye(e) {
|
|
224
|
+
const t = d(e), n = E(t), r = [], s = [];
|
|
225
|
+
return $(t == null ? void 0 : t.views).filter((o) => {
|
|
226
|
+
var i;
|
|
227
|
+
const a = d((i = d(o)) == null ? void 0 : i.sdkSpec);
|
|
228
|
+
return !!(a != null && a.builder && (a != null && a.spec));
|
|
229
|
+
}).forEach((o, a) => {
|
|
230
230
|
var u;
|
|
231
|
-
const
|
|
232
|
-
|
|
231
|
+
const i = String(((u = d(o)) == null ? void 0 : u.id) || `view_${a}`), c = le(
|
|
232
|
+
o,
|
|
233
233
|
n
|
|
234
234
|
);
|
|
235
235
|
if (c) {
|
|
236
|
-
r.push({ viewId:
|
|
236
|
+
r.push({ viewId: i, ...c });
|
|
237
237
|
return;
|
|
238
238
|
}
|
|
239
|
-
|
|
240
|
-
viewId:
|
|
241
|
-
path: `views.${
|
|
242
|
-
message: `Generated view execution validation could not build intent for "${
|
|
239
|
+
s.push({
|
|
240
|
+
viewId: i,
|
|
241
|
+
path: `views.${i}.sdkSpec`,
|
|
242
|
+
message: `Generated view execution validation could not build intent for "${i}".`
|
|
243
243
|
});
|
|
244
|
-
}), { requests: r, issues:
|
|
244
|
+
}), { requests: r, issues: s };
|
|
245
245
|
}
|
|
246
|
-
function
|
|
247
|
-
const n = d(e), r = d(n == null ? void 0 : n.sdkSpec),
|
|
248
|
-
if (!n || !(r != null && r.builder) || !
|
|
246
|
+
function le(e, t) {
|
|
247
|
+
const n = d(e), r = d(n == null ? void 0 : n.sdkSpec), s = d(r == null ? void 0 : r.spec);
|
|
248
|
+
if (!n || !(r != null && r.builder) || !s)
|
|
249
249
|
return null;
|
|
250
|
-
const
|
|
250
|
+
const o = me(t) ? t : E(d(t)), a = Ne(r.builder), i = d(A(s, o)) || {}, c = he({
|
|
251
251
|
view: n,
|
|
252
|
-
builder:
|
|
253
|
-
rawSpec:
|
|
252
|
+
builder: a,
|
|
253
|
+
rawSpec: s,
|
|
254
254
|
spec: {
|
|
255
|
-
...
|
|
255
|
+
...i,
|
|
256
256
|
id: n.id,
|
|
257
|
-
label:
|
|
257
|
+
label: Ve(n, s)
|
|
258
258
|
},
|
|
259
|
-
context:
|
|
259
|
+
context: o
|
|
260
260
|
});
|
|
261
261
|
try {
|
|
262
|
-
if (
|
|
262
|
+
if (a === "analysis") {
|
|
263
263
|
const u = c;
|
|
264
264
|
return {
|
|
265
|
-
intent:
|
|
265
|
+
intent: re(u),
|
|
266
266
|
resultShape: "analysis",
|
|
267
|
-
analysisOptions:
|
|
267
|
+
analysisOptions: te(u)
|
|
268
268
|
};
|
|
269
269
|
}
|
|
270
|
-
if (
|
|
270
|
+
if (a === "metric")
|
|
271
271
|
return {
|
|
272
|
-
intent:
|
|
272
|
+
intent: ne(c),
|
|
273
273
|
resultShape: "metric"
|
|
274
274
|
};
|
|
275
|
-
if (
|
|
275
|
+
if (a === "records")
|
|
276
276
|
return {
|
|
277
|
-
intent:
|
|
277
|
+
intent: ae(c),
|
|
278
278
|
resultShape: "records"
|
|
279
279
|
};
|
|
280
|
-
if (
|
|
280
|
+
if (a === "matrix")
|
|
281
281
|
return {
|
|
282
|
-
intent:
|
|
282
|
+
intent: se(c),
|
|
283
283
|
resultShape: "matrix"
|
|
284
284
|
};
|
|
285
|
-
if (
|
|
285
|
+
if (a === "sql")
|
|
286
286
|
return {
|
|
287
|
-
intent:
|
|
287
|
+
intent: ie(c),
|
|
288
288
|
resultShape: "sql"
|
|
289
289
|
};
|
|
290
290
|
} catch {
|
|
@@ -292,73 +292,73 @@ function ge(e, t) {
|
|
|
292
292
|
}
|
|
293
293
|
return null;
|
|
294
294
|
}
|
|
295
|
-
function
|
|
295
|
+
function We({
|
|
296
296
|
input: e,
|
|
297
297
|
filterContract: t,
|
|
298
298
|
codegenSummary: n
|
|
299
299
|
}) {
|
|
300
|
-
const r = d(e),
|
|
301
|
-
if (!r || !
|
|
300
|
+
const r = d(e), s = d(t), o = d(r == null ? void 0 : r.optionQuery) || d(s == null ? void 0 : s.optionQuery);
|
|
301
|
+
if (!r || !o)
|
|
302
302
|
return null;
|
|
303
|
-
const
|
|
303
|
+
const a = E(d(n)), i = d(o.spec), c = ye(o, i, a), u = o.valueFieldRef || o.valueField || (i == null ? void 0 : i.valueField), f = o.labelFieldRef || o.labelField || (i == null ? void 0 : i.labelField);
|
|
304
304
|
if (!c || !u || !f)
|
|
305
305
|
return null;
|
|
306
306
|
const m = {
|
|
307
307
|
...d(
|
|
308
|
-
A(
|
|
308
|
+
A(i || {}, a)
|
|
309
309
|
) || {},
|
|
310
|
-
id:
|
|
310
|
+
id: o.id || (i == null ? void 0 : i.id) || `${r.id}-options`,
|
|
311
311
|
inputId: r.id,
|
|
312
312
|
source: c,
|
|
313
313
|
valueField: u,
|
|
314
314
|
labelField: f,
|
|
315
|
-
population:
|
|
316
|
-
dependencies:
|
|
317
|
-
limit:
|
|
315
|
+
population: o.population || (i == null ? void 0 : i.population),
|
|
316
|
+
dependencies: o.dependencies || (i == null ? void 0 : i.dependencies),
|
|
317
|
+
limit: o.limit || (i == null ? void 0 : i.limit) || 100
|
|
318
318
|
};
|
|
319
319
|
try {
|
|
320
|
-
return
|
|
321
|
-
A(m,
|
|
320
|
+
return ee(
|
|
321
|
+
A(m, a)
|
|
322
322
|
);
|
|
323
323
|
} catch {
|
|
324
324
|
return null;
|
|
325
325
|
}
|
|
326
326
|
}
|
|
327
|
-
function
|
|
327
|
+
function Qe({
|
|
328
328
|
input: e,
|
|
329
329
|
filterContract: t,
|
|
330
330
|
binding: n,
|
|
331
331
|
option: r,
|
|
332
|
-
codegenSummary:
|
|
332
|
+
codegenSummary: s
|
|
333
333
|
}) {
|
|
334
|
-
const
|
|
335
|
-
(c == null ? void 0 : c.fieldRef) || (
|
|
336
|
-
|
|
334
|
+
const o = E(d(s)), a = d(e), i = d(t), c = d(n), u = A(
|
|
335
|
+
(c == null ? void 0 : c.fieldRef) || (i == null ? void 0 : i.fieldRef) || (a == null ? void 0 : a.fieldRef),
|
|
336
|
+
o
|
|
337
337
|
), f = String(
|
|
338
|
-
(
|
|
339
|
-
),
|
|
338
|
+
(i == null ? void 0 : i.operator) || (a == null ? void 0 : a.operator) || "in"
|
|
339
|
+
), g = He(c);
|
|
340
340
|
return {
|
|
341
|
-
inputId: String((
|
|
341
|
+
inputId: String((i == null ? void 0 : i.inputId) || (a == null ? void 0 : a.id) || ""),
|
|
342
342
|
kind: "filter",
|
|
343
343
|
operator: f,
|
|
344
|
-
value:
|
|
344
|
+
value: ke(f, r.value),
|
|
345
345
|
isActive: !0,
|
|
346
346
|
...u ? { field: u } : {},
|
|
347
|
-
...
|
|
347
|
+
...g ? { relationshipHint: g } : {}
|
|
348
348
|
};
|
|
349
349
|
}
|
|
350
|
-
function
|
|
350
|
+
function E(e) {
|
|
351
351
|
return {
|
|
352
352
|
sourcesByKey: new Map(
|
|
353
|
-
|
|
353
|
+
$(e == null ? void 0 : e.sources).map(d).filter(xe).filter((t) => typeof t.sourceKey == "string").map((t) => [String(t.sourceKey), J(t)])
|
|
354
354
|
)
|
|
355
355
|
};
|
|
356
356
|
}
|
|
357
|
-
function
|
|
357
|
+
function me(e) {
|
|
358
358
|
var t;
|
|
359
359
|
return e instanceof Object && ((t = d(e)) == null ? void 0 : t.sourcesByKey) instanceof Map;
|
|
360
360
|
}
|
|
361
|
-
function
|
|
361
|
+
function ye(e, t, n) {
|
|
362
362
|
if (typeof e.sourceKey == "string")
|
|
363
363
|
return n.sourcesByKey.get(e.sourceKey) || { sourceKey: e.sourceKey };
|
|
364
364
|
if (e.source)
|
|
@@ -373,104 +373,104 @@ function he({
|
|
|
373
373
|
builder: t,
|
|
374
374
|
rawSpec: n,
|
|
375
375
|
spec: r,
|
|
376
|
-
context:
|
|
376
|
+
context: s
|
|
377
377
|
}) {
|
|
378
|
-
var
|
|
378
|
+
var i;
|
|
379
379
|
if (t !== "records" && t !== "sql")
|
|
380
380
|
return r;
|
|
381
|
-
const
|
|
382
|
-
if (!
|
|
381
|
+
const o = d((i = d(e.visualSpec)) == null ? void 0 : i.tableBehavior);
|
|
382
|
+
if (!o)
|
|
383
383
|
return r;
|
|
384
|
-
const
|
|
385
|
-
if (
|
|
384
|
+
const a = { ...r };
|
|
385
|
+
if (Ee(o) === "server" && (a.pagination = {
|
|
386
386
|
page: 1,
|
|
387
|
-
pageSize:
|
|
388
|
-
}), t === "records" &&
|
|
389
|
-
const c =
|
|
387
|
+
pageSize: Se({ tableBehavior: o, spec: r })
|
|
388
|
+
}), t === "records" && Ce(o) === "server") {
|
|
389
|
+
const c = _e({
|
|
390
390
|
view: e,
|
|
391
391
|
rawSpec: n,
|
|
392
|
-
tableBehavior:
|
|
393
|
-
context:
|
|
392
|
+
tableBehavior: o,
|
|
393
|
+
context: s
|
|
394
394
|
});
|
|
395
|
-
c && (
|
|
395
|
+
c && (a.orderBy = c);
|
|
396
396
|
}
|
|
397
|
-
return
|
|
397
|
+
return a;
|
|
398
398
|
}
|
|
399
|
-
function
|
|
399
|
+
function Se({
|
|
400
400
|
tableBehavior: e,
|
|
401
401
|
spec: t
|
|
402
402
|
}) {
|
|
403
403
|
const n = d(e.pagination), r = d(t.pagination);
|
|
404
|
-
return
|
|
404
|
+
return N(n == null ? void 0 : n.pageSize) || N(r == null ? void 0 : r.pageSize) || N(t.limit) || 100;
|
|
405
405
|
}
|
|
406
|
-
function
|
|
406
|
+
function _e({
|
|
407
407
|
view: e,
|
|
408
408
|
rawSpec: t,
|
|
409
409
|
tableBehavior: n,
|
|
410
410
|
context: r
|
|
411
411
|
}) {
|
|
412
|
-
const
|
|
413
|
-
if (!
|
|
412
|
+
const s = d(n.sorting), o = p(s == null ? void 0 : s.defaultField);
|
|
413
|
+
if (!o)
|
|
414
414
|
return;
|
|
415
|
-
const
|
|
415
|
+
const i = Ae({
|
|
416
416
|
view: e,
|
|
417
417
|
rawSpec: t,
|
|
418
418
|
context: r
|
|
419
419
|
}).filter(
|
|
420
|
-
(c) =>
|
|
420
|
+
(c) => we(c.lookup).includes(o)
|
|
421
421
|
);
|
|
422
|
-
if (
|
|
422
|
+
if (i.length === 1)
|
|
423
423
|
return {
|
|
424
|
-
field:
|
|
425
|
-
direction: (
|
|
424
|
+
field: i[0].field,
|
|
425
|
+
direction: (s == null ? void 0 : s.defaultDirection) === "desc" ? "desc" : "asc"
|
|
426
426
|
};
|
|
427
427
|
}
|
|
428
|
-
function
|
|
428
|
+
function Ae({
|
|
429
429
|
view: e,
|
|
430
430
|
rawSpec: t,
|
|
431
431
|
context: n
|
|
432
432
|
}) {
|
|
433
|
-
var
|
|
433
|
+
var s;
|
|
434
434
|
const r = [];
|
|
435
|
-
for (const
|
|
436
|
-
|
|
437
|
-
for (const
|
|
438
|
-
|
|
439
|
-
return
|
|
435
|
+
for (const o of $(t.fields)) R(r, o, n);
|
|
436
|
+
R(r, t.dateField, n), R(r, (s = d(t.orderBy)) == null ? void 0 : s.field, n);
|
|
437
|
+
for (const o of $(e.fields))
|
|
438
|
+
R(r, o, n);
|
|
439
|
+
return Fe(
|
|
440
440
|
r,
|
|
441
|
-
(
|
|
441
|
+
(o) => ve(o.lookup)
|
|
442
442
|
);
|
|
443
443
|
}
|
|
444
|
-
function
|
|
444
|
+
function R(e, t, n) {
|
|
445
445
|
const r = d(t);
|
|
446
446
|
if (typeof (r == null ? void 0 : r.name) != "string" || r.name.length === 0)
|
|
447
447
|
return;
|
|
448
|
-
const
|
|
448
|
+
const s = d(A(r, n)) || r;
|
|
449
449
|
e.push({
|
|
450
450
|
lookup: r,
|
|
451
|
-
field:
|
|
451
|
+
field: s
|
|
452
452
|
});
|
|
453
453
|
}
|
|
454
|
-
function
|
|
455
|
-
return
|
|
456
|
-
|
|
454
|
+
function we(e) {
|
|
455
|
+
return Ke([
|
|
456
|
+
p(e.name),
|
|
457
457
|
z(e),
|
|
458
|
-
|
|
458
|
+
Ie(e)
|
|
459
459
|
]);
|
|
460
460
|
}
|
|
461
|
-
function
|
|
461
|
+
function ve(e) {
|
|
462
462
|
return [
|
|
463
463
|
z(e),
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
464
|
+
p(e.name),
|
|
465
|
+
p(e.role),
|
|
466
|
+
p(e.aggregate)
|
|
467
467
|
].join("|");
|
|
468
468
|
}
|
|
469
469
|
function z(e) {
|
|
470
470
|
return [
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
471
|
+
p(e.sourceKey) || $e(e.source),
|
|
472
|
+
p(e.name),
|
|
473
|
+
p(e.aggregate)
|
|
474
474
|
].filter(Boolean).join(":");
|
|
475
475
|
}
|
|
476
476
|
function $e(e) {
|
|
@@ -485,46 +485,46 @@ function $e(e) {
|
|
|
485
485
|
}
|
|
486
486
|
return JSON.stringify(t);
|
|
487
487
|
}
|
|
488
|
-
function
|
|
489
|
-
return
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
488
|
+
function Ie(e) {
|
|
489
|
+
return je([
|
|
490
|
+
Re(e),
|
|
491
|
+
p(e.aggregate).toLowerCase(),
|
|
492
|
+
p(e.label) || p(e.name)
|
|
493
493
|
].filter(Boolean));
|
|
494
494
|
}
|
|
495
|
-
function
|
|
496
|
-
return typeof e.sourceKey == "string" ?
|
|
495
|
+
function Re(e) {
|
|
496
|
+
return typeof e.sourceKey == "string" ? Oe(e.sourceKey) : be(e.source);
|
|
497
497
|
}
|
|
498
|
-
function
|
|
498
|
+
function be(e) {
|
|
499
499
|
const t = d(e);
|
|
500
|
-
return t ?
|
|
500
|
+
return t ? p(t.datasetName) || p(t.datasetId) || p(t.name) || p(t.kind) : "";
|
|
501
501
|
}
|
|
502
|
-
function
|
|
502
|
+
function Oe(e) {
|
|
503
503
|
const t = String(e).split(":");
|
|
504
504
|
return t[t.length - 1] || String(e);
|
|
505
505
|
}
|
|
506
|
-
function
|
|
506
|
+
function Ee(e) {
|
|
507
507
|
var t;
|
|
508
|
-
return
|
|
508
|
+
return p((t = d(e.pagination)) == null ? void 0 : t.mode);
|
|
509
509
|
}
|
|
510
|
-
function
|
|
510
|
+
function Ce(e) {
|
|
511
511
|
var t;
|
|
512
|
-
return
|
|
512
|
+
return p((t = d(e.sorting)) == null ? void 0 : t.mode);
|
|
513
513
|
}
|
|
514
514
|
function A(e, t) {
|
|
515
515
|
if (!e || typeof e != "object")
|
|
516
516
|
return e;
|
|
517
517
|
if (Array.isArray(e))
|
|
518
|
-
return e.map((
|
|
518
|
+
return e.map((s) => A(s, t));
|
|
519
519
|
const n = e;
|
|
520
520
|
if (typeof n.sourceKey == "string" && typeof n.kind == "string" && (typeof n.datasetName == "string" || typeof n.datasetId == "string"))
|
|
521
521
|
return J(n);
|
|
522
522
|
const r = {};
|
|
523
|
-
for (const [
|
|
524
|
-
|
|
523
|
+
for (const [s, o] of Object.entries(n))
|
|
524
|
+
s !== "sourceKey" && (r[s] = A(o, t));
|
|
525
525
|
if (typeof n.sourceKey == "string") {
|
|
526
|
-
const
|
|
527
|
-
|
|
526
|
+
const s = t.sourcesByKey.get(n.sourceKey);
|
|
527
|
+
s && !r.source && (r.source = s);
|
|
528
528
|
}
|
|
529
529
|
return r;
|
|
530
530
|
}
|
|
@@ -532,188 +532,221 @@ function J(e) {
|
|
|
532
532
|
const { sourceKey: t, ...n } = e;
|
|
533
533
|
return n;
|
|
534
534
|
}
|
|
535
|
-
function
|
|
535
|
+
function Ve(e, t) {
|
|
536
536
|
const n = d(e.visualSpec);
|
|
537
537
|
return (n == null ? void 0 : n.title) || e.title || t.label;
|
|
538
538
|
}
|
|
539
|
-
function
|
|
539
|
+
function Ne(e) {
|
|
540
540
|
const t = String(e || "").replace(/^semaphor\./, "");
|
|
541
541
|
return ["metric", "records", "analysis", "matrix", "sql"].includes(t) ? t : "";
|
|
542
542
|
}
|
|
543
|
-
function
|
|
543
|
+
function He(e) {
|
|
544
544
|
if (e != null && e.relationshipHint)
|
|
545
545
|
return e.relationshipHint;
|
|
546
|
-
const t =
|
|
546
|
+
const t = $(e == null ? void 0 : e.relationshipsUsed).map((n) => {
|
|
547
547
|
var r;
|
|
548
548
|
return (r = d(n)) == null ? void 0 : r.id;
|
|
549
549
|
}).filter((n) => typeof n == "string" && n.length > 0);
|
|
550
550
|
return t.length > 0 ? { relationshipIds: t } : void 0;
|
|
551
551
|
}
|
|
552
|
-
function
|
|
552
|
+
function ke(e, t) {
|
|
553
553
|
return e === "in" || e === "not_in" ? [t] : e === "between" ? Array.isArray(t) ? t : [t, t] : t;
|
|
554
554
|
}
|
|
555
|
-
function
|
|
555
|
+
function N(e) {
|
|
556
556
|
return typeof e == "number" && Number.isFinite(e) ? e : void 0;
|
|
557
557
|
}
|
|
558
|
-
function
|
|
558
|
+
function p(e) {
|
|
559
559
|
return typeof e == "string" ? e : "";
|
|
560
560
|
}
|
|
561
|
-
function
|
|
561
|
+
function Fe(e, t) {
|
|
562
562
|
const n = /* @__PURE__ */ new Set(), r = [];
|
|
563
|
-
for (const
|
|
564
|
-
const
|
|
565
|
-
!
|
|
563
|
+
for (const s of e) {
|
|
564
|
+
const o = t(s);
|
|
565
|
+
!o || n.has(o) || (n.add(o), r.push(s));
|
|
566
566
|
}
|
|
567
567
|
return r;
|
|
568
568
|
}
|
|
569
|
-
function
|
|
569
|
+
function Ke(e) {
|
|
570
570
|
return Array.from(new Set(e.filter(Boolean)));
|
|
571
571
|
}
|
|
572
|
-
function
|
|
572
|
+
function je(e) {
|
|
573
573
|
return (Array.isArray(e) ? e.join(" ") : e).replace(/[^a-zA-Z0-9]+/g, " ").trim().split(/\s+/).filter(Boolean).map((n, r) => {
|
|
574
|
-
const
|
|
575
|
-
return r === 0 ?
|
|
574
|
+
const s = n.toLowerCase();
|
|
575
|
+
return r === 0 ? s : s.charAt(0).toUpperCase() + s.slice(1);
|
|
576
576
|
}).join("");
|
|
577
577
|
}
|
|
578
578
|
function d(e) {
|
|
579
579
|
return e && typeof e == "object" && !Array.isArray(e) ? e : void 0;
|
|
580
580
|
}
|
|
581
|
-
function
|
|
581
|
+
function $(e) {
|
|
582
582
|
return Array.isArray(e) ? e : [];
|
|
583
583
|
}
|
|
584
|
-
function
|
|
584
|
+
function xe(e) {
|
|
585
585
|
return e !== void 0;
|
|
586
586
|
}
|
|
587
|
-
const
|
|
587
|
+
const Me = /* @__PURE__ */ new Set([
|
|
588
588
|
"diagnostic_fix",
|
|
589
589
|
"fix_diagnostics",
|
|
590
590
|
"fix_inspector_warnings",
|
|
591
591
|
"fix_runtime_warnings",
|
|
592
592
|
"fix_warnings"
|
|
593
|
-
]),
|
|
593
|
+
]), De = /* @__PURE__ */ new Set([
|
|
594
|
+
"add",
|
|
595
|
+
"edit",
|
|
596
|
+
"mixed",
|
|
597
|
+
"remove"
|
|
598
|
+
]), D = /* @__PURE__ */ new Set([
|
|
594
599
|
"fields",
|
|
600
|
+
"metricBindingKeys",
|
|
595
601
|
"sdkSpec"
|
|
596
602
|
]);
|
|
597
|
-
function
|
|
603
|
+
function Xe({
|
|
598
604
|
beforeSummary: e,
|
|
599
605
|
afterSummary: t,
|
|
600
606
|
migrationReport: n,
|
|
601
607
|
operationIntent: r,
|
|
602
|
-
|
|
608
|
+
constraints: s,
|
|
609
|
+
preferences: o
|
|
603
610
|
}) {
|
|
604
|
-
const
|
|
605
|
-
return
|
|
611
|
+
const a = l(r), i = typeof (a == null ? void 0 : a.kind) == "string" ? a.kind.trim() : "";
|
|
612
|
+
return De.has(i) ? {
|
|
613
|
+
ok: !1,
|
|
614
|
+
policy: {
|
|
615
|
+
kind: i,
|
|
616
|
+
mode: "invalid_operation_kind",
|
|
617
|
+
reason: "Retired Data App operation aliases are not accepted. Use the hard-migrated analytics/layout/style operationIntent kinds."
|
|
618
|
+
},
|
|
619
|
+
violations: [
|
|
620
|
+
{
|
|
621
|
+
path: "operationIntent.kind",
|
|
622
|
+
reason: "Use analytics_add, analytics_edit, analytics_remove, input_add, input_edit, layout_only, style_only, runtime_debug, semantic_model_repair, save_or_publish, or greenfield_create."
|
|
623
|
+
}
|
|
624
|
+
]
|
|
625
|
+
} : T(o) ? {
|
|
606
626
|
ok: !1,
|
|
607
627
|
policy: {
|
|
608
|
-
kind:
|
|
609
|
-
mode: "
|
|
628
|
+
kind: i,
|
|
629
|
+
mode: "invalid_update_constraints",
|
|
610
630
|
reason: "Metric aggregate override updates must use operationIntent.measureAggregateOverrides so deterministic update policy can guard the targeted edit."
|
|
611
631
|
},
|
|
612
632
|
violations: [
|
|
613
633
|
{
|
|
614
634
|
path: "preferences.measureAggregateOverrides",
|
|
635
|
+
reason: "preferences is retired. Move measureAggregateOverrides to operationIntent.measureAggregateOverrides for update calls."
|
|
636
|
+
}
|
|
637
|
+
]
|
|
638
|
+
} : T(s) ? {
|
|
639
|
+
ok: !1,
|
|
640
|
+
policy: {
|
|
641
|
+
kind: i,
|
|
642
|
+
mode: "invalid_update_constraints",
|
|
643
|
+
reason: "Metric aggregate override updates must use operationIntent.measureAggregateOverrides so deterministic update policy can guard the targeted edit."
|
|
644
|
+
},
|
|
645
|
+
violations: [
|
|
646
|
+
{
|
|
647
|
+
path: "constraints.measureAggregateOverrides",
|
|
615
648
|
reason: "Move measureAggregateOverrides to operationIntent.measureAggregateOverrides for update calls."
|
|
616
649
|
}
|
|
617
650
|
]
|
|
618
|
-
} :
|
|
651
|
+
} : Me.has(i) ? B({
|
|
619
652
|
beforeSummary: e,
|
|
620
653
|
afterSummary: t,
|
|
621
654
|
migrationReport: n,
|
|
622
|
-
operationIntent:
|
|
655
|
+
operationIntent: a,
|
|
623
656
|
mode: "diagnostic_warning_fix",
|
|
624
|
-
allowedViewChangeReasons:
|
|
657
|
+
allowedViewChangeReasons: D,
|
|
625
658
|
label: "Diagnostic warning fixes",
|
|
626
659
|
reason: "Diagnostic warning fixes are preserve-by-default and may not add/remove views, inputs, or filter contracts."
|
|
627
|
-
}) :
|
|
660
|
+
}) : i === "analytics_edit" && Array.isArray(a == null ? void 0 : a.measureAggregateOverrides) && a.measureAggregateOverrides.length > 0 ? B({
|
|
628
661
|
beforeSummary: e,
|
|
629
662
|
afterSummary: t,
|
|
630
663
|
migrationReport: n,
|
|
631
|
-
operationIntent:
|
|
664
|
+
operationIntent: a,
|
|
632
665
|
mode: "metric_aggregate_override_edit",
|
|
633
|
-
allowedViewChangeReasons:
|
|
666
|
+
allowedViewChangeReasons: D,
|
|
634
667
|
label: "Metric aggregate override edits",
|
|
635
668
|
reason: "Metric aggregate override edits are preserve-by-default and may only adjust fields/sdkSpec on targeted views."
|
|
636
669
|
}) : {
|
|
637
670
|
ok: !0,
|
|
638
671
|
policy: {
|
|
639
|
-
kind:
|
|
672
|
+
kind: i,
|
|
640
673
|
mode: "general_iterative_update",
|
|
641
674
|
reason: "General generated-contract edits are allowed to change the requested contract shape. Review the migration report for expected UI work."
|
|
642
675
|
},
|
|
643
676
|
violations: []
|
|
644
677
|
};
|
|
645
678
|
}
|
|
646
|
-
function
|
|
679
|
+
function T(e) {
|
|
647
680
|
var t;
|
|
648
681
|
return Array.isArray((t = l(e)) == null ? void 0 : t.measureAggregateOverrides);
|
|
649
682
|
}
|
|
650
|
-
function
|
|
683
|
+
function B({
|
|
651
684
|
beforeSummary: e,
|
|
652
685
|
afterSummary: t,
|
|
653
686
|
migrationReport: n,
|
|
654
687
|
operationIntent: r,
|
|
655
|
-
mode:
|
|
656
|
-
allowedViewChangeReasons:
|
|
657
|
-
label:
|
|
658
|
-
reason:
|
|
688
|
+
mode: s,
|
|
689
|
+
allowedViewChangeReasons: o,
|
|
690
|
+
label: a,
|
|
691
|
+
reason: i
|
|
659
692
|
}) {
|
|
660
|
-
const c = [], u =
|
|
693
|
+
const c = [], u = Be(r == null ? void 0 : r.targetViewIds), f = l(n) || {};
|
|
661
694
|
u.size === 0 && c.push({
|
|
662
695
|
path: "operationIntent.targetViewIds",
|
|
663
|
-
reason: `${
|
|
664
|
-
}),
|
|
696
|
+
reason: `${a} must declare targetViewIds so the update cannot broaden to unrelated views.`
|
|
697
|
+
}), H({
|
|
665
698
|
bucket: l(f.views),
|
|
666
699
|
label: "views",
|
|
667
|
-
operationLabel:
|
|
700
|
+
operationLabel: a,
|
|
668
701
|
violations: c
|
|
669
|
-
}),
|
|
702
|
+
}), H({
|
|
670
703
|
bucket: l(f.inputs),
|
|
671
704
|
label: "inputs",
|
|
672
|
-
operationLabel:
|
|
705
|
+
operationLabel: a,
|
|
673
706
|
violations: c
|
|
674
707
|
}), q({
|
|
675
708
|
bucket: l(f.inputs),
|
|
676
709
|
label: "inputs",
|
|
677
|
-
operationLabel:
|
|
710
|
+
operationLabel: a,
|
|
678
711
|
violations: c
|
|
679
|
-
}),
|
|
712
|
+
}), H({
|
|
680
713
|
bucket: l(f.filterContracts),
|
|
681
714
|
label: "filterContracts",
|
|
682
|
-
operationLabel:
|
|
715
|
+
operationLabel: a,
|
|
683
716
|
violations: c
|
|
684
717
|
}), q({
|
|
685
718
|
bucket: l(f.filterContracts),
|
|
686
719
|
label: "filterContracts",
|
|
687
|
-
operationLabel:
|
|
720
|
+
operationLabel: a,
|
|
688
721
|
violations: c
|
|
689
722
|
});
|
|
690
|
-
for (const m of
|
|
691
|
-
u.size > 0 && !u.has(
|
|
692
|
-
path: `views.${
|
|
693
|
-
reason: `${
|
|
723
|
+
for (const m of Y(l(f.views))) {
|
|
724
|
+
u.size > 0 && !u.has(_(m.id)) && c.push({
|
|
725
|
+
path: `views.${_(m.id) || "<unknown>"}`,
|
|
726
|
+
reason: `${a} may only change explicitly targeted views.`
|
|
694
727
|
});
|
|
695
|
-
const
|
|
696
|
-
(
|
|
728
|
+
const y = Array.isArray(m.reasons) ? m.reasons.filter(
|
|
729
|
+
(v) => typeof v != "string" || !o.has(v)
|
|
697
730
|
) : [];
|
|
698
|
-
|
|
699
|
-
path: `views.${
|
|
700
|
-
reason: `${
|
|
731
|
+
y.length > 0 && c.push({
|
|
732
|
+
path: `views.${_(m.id) || "<unknown>"}`,
|
|
733
|
+
reason: `${a} may only adjust fields/sdkSpec/metricBindingKeys; changed ${y.join(", ")}.`
|
|
701
734
|
});
|
|
702
735
|
}
|
|
703
|
-
const
|
|
736
|
+
const g = Te({
|
|
704
737
|
beforeSummary: e,
|
|
705
738
|
afterSummary: t,
|
|
706
739
|
targetViewIds: u,
|
|
707
|
-
label:
|
|
740
|
+
label: a
|
|
708
741
|
});
|
|
709
|
-
return
|
|
742
|
+
return g && c.push(g), {
|
|
710
743
|
ok: c.length === 0,
|
|
711
744
|
policy: {
|
|
712
|
-
kind:
|
|
713
|
-
mode:
|
|
714
|
-
allowedViewChangeReasons: Array.from(
|
|
745
|
+
kind: _(r == null ? void 0 : r.kind) || "diagnostic_fix",
|
|
746
|
+
mode: s,
|
|
747
|
+
allowedViewChangeReasons: Array.from(o).sort(),
|
|
715
748
|
targetViewIds: Array.from(u).sort(),
|
|
716
|
-
reason:
|
|
749
|
+
reason: i
|
|
717
750
|
},
|
|
718
751
|
violations: c
|
|
719
752
|
};
|
|
@@ -724,36 +757,36 @@ function Te({
|
|
|
724
757
|
targetViewIds: n,
|
|
725
758
|
label: r
|
|
726
759
|
}) {
|
|
727
|
-
const
|
|
728
|
-
if (!
|
|
760
|
+
const s = l(e), o = l(t);
|
|
761
|
+
if (!s || !o)
|
|
729
762
|
return {
|
|
730
763
|
path: "codegenSummary",
|
|
731
764
|
reason: `${r} require before/after codegen summaries for full-scope verification.`
|
|
732
765
|
};
|
|
733
|
-
const
|
|
734
|
-
|
|
735
|
-
for (const
|
|
736
|
-
const m = c.get(
|
|
737
|
-
if (!m || !
|
|
766
|
+
const a = G(s), i = G(o), c = P(s.views), u = P(o.views), f = Array.isArray(a.views) ? a.views : [];
|
|
767
|
+
a.views = f;
|
|
768
|
+
for (const g of n) {
|
|
769
|
+
const m = c.get(g), y = u.get(g);
|
|
770
|
+
if (!m || !y)
|
|
738
771
|
continue;
|
|
739
|
-
const
|
|
740
|
-
(
|
|
772
|
+
const v = f.find(
|
|
773
|
+
(W) => {
|
|
741
774
|
var K;
|
|
742
|
-
return ((K = l(
|
|
775
|
+
return ((K = l(W)) == null ? void 0 : K.id) === g;
|
|
743
776
|
}
|
|
744
|
-
),
|
|
745
|
-
if (
|
|
777
|
+
), I = l(y);
|
|
778
|
+
if (!v || !I)
|
|
746
779
|
continue;
|
|
747
|
-
const
|
|
748
|
-
|
|
780
|
+
const C = v;
|
|
781
|
+
C.fields = b(I.fields), C.metricBindingKeys = b(I.metricBindingKeys), C.sdkSpec = b(I.sdkSpec);
|
|
749
782
|
}
|
|
750
|
-
return
|
|
783
|
+
return O(a) === O(i) ? null : {
|
|
751
784
|
path: "codegenSummary",
|
|
752
|
-
reason: `${r} may only change fields/sdkSpec on targetViewIds; another generated contract section changed.`
|
|
785
|
+
reason: `${r} may only change fields/sdkSpec/metricBindingKeys on targetViewIds; another generated contract section changed.`
|
|
753
786
|
};
|
|
754
787
|
}
|
|
755
788
|
function G(e) {
|
|
756
|
-
const t =
|
|
789
|
+
const t = b(e);
|
|
757
790
|
for (const n of [
|
|
758
791
|
"implementationChecklist",
|
|
759
792
|
"assumptions",
|
|
@@ -764,20 +797,20 @@ function G(e) {
|
|
|
764
797
|
delete t[n];
|
|
765
798
|
return qe(t.unsupportedInsights) && delete t.unsupportedInsights, t;
|
|
766
799
|
}
|
|
767
|
-
function
|
|
800
|
+
function H({
|
|
768
801
|
bucket: e,
|
|
769
802
|
label: t,
|
|
770
803
|
operationLabel: n,
|
|
771
804
|
violations: r
|
|
772
805
|
}) {
|
|
773
|
-
for (const
|
|
806
|
+
for (const s of F(e == null ? void 0 : e.added))
|
|
774
807
|
r.push({
|
|
775
|
-
path: `${t}.${
|
|
808
|
+
path: `${t}.${_(s.id) || "<unknown>"}`,
|
|
776
809
|
reason: `${n} may not add ${t}.`
|
|
777
810
|
});
|
|
778
|
-
for (const
|
|
811
|
+
for (const s of F(e == null ? void 0 : e.removed))
|
|
779
812
|
r.push({
|
|
780
|
-
path: `${t}.${
|
|
813
|
+
path: `${t}.${_(s.id) || "<unknown>"}`,
|
|
781
814
|
reason: `${n} may not remove ${t}.`
|
|
782
815
|
});
|
|
783
816
|
}
|
|
@@ -787,42 +820,42 @@ function q({
|
|
|
787
820
|
operationLabel: n,
|
|
788
821
|
violations: r
|
|
789
822
|
}) {
|
|
790
|
-
for (const
|
|
823
|
+
for (const s of Y(e))
|
|
791
824
|
r.push({
|
|
792
|
-
path: `${t}.${
|
|
825
|
+
path: `${t}.${_(s.id) || "<unknown>"}`,
|
|
793
826
|
reason: `${n} may not change ${t}.`
|
|
794
827
|
});
|
|
795
828
|
}
|
|
796
|
-
function
|
|
797
|
-
return
|
|
829
|
+
function Y(e) {
|
|
830
|
+
return F(e == null ? void 0 : e.changed);
|
|
798
831
|
}
|
|
799
|
-
function
|
|
832
|
+
function F(e) {
|
|
800
833
|
return Array.isArray(e) ? e.map(l).filter(Ge) : [];
|
|
801
834
|
}
|
|
802
|
-
function
|
|
835
|
+
function Be(e) {
|
|
803
836
|
return Array.isArray(e) ? new Set(
|
|
804
837
|
e.filter((t) => typeof t == "string" && t.trim().length > 0).map((t) => t.trim())
|
|
805
838
|
) : /* @__PURE__ */ new Set();
|
|
806
839
|
}
|
|
807
|
-
function
|
|
840
|
+
function P(e) {
|
|
808
841
|
var n;
|
|
809
842
|
const t = /* @__PURE__ */ new Map();
|
|
810
843
|
for (const r of Array.isArray(e) ? e : []) {
|
|
811
|
-
const
|
|
812
|
-
typeof
|
|
844
|
+
const s = (n = l(r)) == null ? void 0 : n.id;
|
|
845
|
+
typeof s == "string" && s.trim() && t.set(s, r);
|
|
813
846
|
}
|
|
814
847
|
return t;
|
|
815
848
|
}
|
|
816
|
-
function
|
|
849
|
+
function b(e) {
|
|
817
850
|
return e === void 0 ? e : JSON.parse(JSON.stringify(e));
|
|
818
851
|
}
|
|
819
|
-
function
|
|
852
|
+
function O(e) {
|
|
820
853
|
if (e === null || typeof e != "object")
|
|
821
854
|
return JSON.stringify(e);
|
|
822
855
|
if (Array.isArray(e))
|
|
823
|
-
return `[${e.map((n) =>
|
|
856
|
+
return `[${e.map((n) => O(n)).join(",")}]`;
|
|
824
857
|
const t = e;
|
|
825
|
-
return `{${Object.keys(t).sort().filter((n) => t[n] !== void 0).map((n) => `${JSON.stringify(n)}:${
|
|
858
|
+
return `{${Object.keys(t).sort().filter((n) => t[n] !== void 0).map((n) => `${JSON.stringify(n)}:${O(t[n])}`).join(",")}}`;
|
|
826
859
|
}
|
|
827
860
|
function l(e) {
|
|
828
861
|
return e && typeof e == "object" && !Array.isArray(e) ? e : void 0;
|
|
@@ -833,22 +866,22 @@ function Ge(e) {
|
|
|
833
866
|
function qe(e) {
|
|
834
867
|
return Array.isArray(e) && e.length === 0;
|
|
835
868
|
}
|
|
836
|
-
function
|
|
869
|
+
function _(e) {
|
|
837
870
|
return typeof e == "string" ? e : "";
|
|
838
871
|
}
|
|
839
872
|
export {
|
|
840
|
-
|
|
873
|
+
Ue as C,
|
|
841
874
|
x as G,
|
|
842
|
-
|
|
875
|
+
de as R,
|
|
843
876
|
j as a,
|
|
844
877
|
M as b,
|
|
845
878
|
ze as c,
|
|
846
879
|
Je as d,
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
880
|
+
ce as e,
|
|
881
|
+
Qe as f,
|
|
882
|
+
We as g,
|
|
883
|
+
le as h,
|
|
884
|
+
Ye as i,
|
|
885
|
+
Xe as j,
|
|
886
|
+
L as v
|
|
854
887
|
};
|