react-semaphor 0.1.415 → 0.1.417
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/DATA_APP_SDK.md +1 -4
- package/dist/analytics-protocol/index.cjs +1 -1
- package/dist/analytics-protocol/index.js +2 -2
- package/dist/brand-studio/index.cjs +1 -1
- package/dist/brand-studio/index.js +2 -2
- package/dist/chunks/{analyze-result-contract-DPjm6btg.js → analyze-result-contract-B0O3oIYu.js} +2 -1
- package/dist/chunks/analyze-result-contract-CL97m8X8.js +1 -0
- package/dist/chunks/{calendar-preferences-dialog-B8FmFRHX.js → calendar-preferences-dialog-BOfryj8P.js} +3 -3
- package/dist/chunks/{calendar-preferences-dialog-ck4AU-to.js → calendar-preferences-dialog-Rq9qiG3X.js} +1 -1
- package/dist/chunks/{dashboard-briefing-launcher-Br_1IK1z.js → dashboard-briefing-launcher-D_P0cNQ_.js} +1 -1
- package/dist/chunks/{dashboard-briefing-launcher-Tr2SqDMK.js → dashboard-briefing-launcher-DgvlOcRI.js} +4 -4
- package/dist/chunks/{dashboard-controls-B7OObDNl.js → dashboard-controls-DzVA-wWu.js} +1 -1
- package/dist/chunks/{dashboard-controls-B2bEv8uG.js → dashboard-controls-JYTKRokc.js} +5 -5
- package/dist/chunks/{dashboard-json-DNixjalS.js → dashboard-json-D5TEri2w.js} +1 -1
- package/dist/chunks/{dashboard-json-DAB8WVyb.js → dashboard-json-h6YMk_-l.js} +3 -3
- package/dist/chunks/{edit-dashboard-visual-Dh8Ge3-B.js → edit-dashboard-visual-DOtCYmDn.js} +4 -4
- package/dist/chunks/{edit-dashboard-visual-DWygSAp3.js → edit-dashboard-visual-kfbu03n9.js} +1 -1
- package/dist/chunks/{index-CQIMj-FF.js → index-Beol8cOo.js} +2 -2
- package/dist/chunks/{index-BkTLAfKy.js → index-BgESS5r7.js} +5 -5
- package/dist/chunks/{switch-DMlqgIx_.js → switch--FHwRAOL.js} +1 -1
- package/dist/chunks/{switch-DgiogS4X.js → switch-C8_t4Pio.js} +1 -1
- package/dist/chunks/update-policy-B50M0Jeg.js +3 -0
- package/dist/chunks/{update-policy-BnEbPhHW.js → update-policy-CQLHKQ_h.js} +304 -290
- package/dist/chunks/{use-create-flow-overlay-state-CZA-dSns.js → use-create-flow-overlay-state-BEPWzqQn.js} +1 -1
- package/dist/chunks/{use-create-flow-overlay-state-uujasvbD.js → use-create-flow-overlay-state-NEs9ePDy.js} +3 -3
- package/dist/chunks/validators-JzI7olk4.js +1 -0
- package/dist/chunks/{validators-C-_9Ew5G.js → validators-UqQI3Cg_.js} +2 -2
- package/dist/dashboard/index.cjs +1 -1
- package/dist/dashboard/index.js +1 -1
- package/dist/dashboard-authoring/index.cjs +1 -1
- package/dist/dashboard-authoring/index.js +2 -2
- 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 +42 -42
- package/dist/data-app-codegen-node/index.js +270 -264
- package/dist/data-app-sdk/index.cjs +1 -1
- package/dist/data-app-sdk/index.js +2 -2
- package/dist/data-app-sdk-adapters/index.cjs +1 -1
- package/dist/data-app-sdk-adapters/index.js +1 -1
- package/dist/data-app-sdk-validation/index.cjs +1 -1
- package/dist/data-app-sdk-validation/index.js +2 -2
- 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 +2 -2
- package/dist/types/dashboard-assistant.d.ts +1 -1
- package/dist/types/dashboard-authoring.d.ts +1 -1
- package/dist/types/data-app-builder.d.ts +1 -1
- package/dist/types/data-app-codegen-node.d.ts +5 -4
- package/dist/types/data-app-codegen.d.ts +5 -4
- package/dist/types/data-app-sdk-adapters.d.ts +1 -1
- package/dist/types/data-app-sdk-validation.d.ts +1 -1
- package/dist/types/data-app-sdk.d.ts +1 -1
- package/dist/types/main.d.ts +1 -1
- package/package.json +1 -1
- package/src/data-app-sdk/README.md +1 -4
- package/dist/chunks/analyze-result-contract-8nxUOWp8.js +0 -1
- package/dist/chunks/update-policy-CWg9c08k.js +0 -3
- package/dist/chunks/validators-CB9BFarT.js +0 -1
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { S as
|
|
2
|
-
import { toSemaphorInputOptionsIntent as
|
|
3
|
-
const Le =
|
|
4
|
-
function
|
|
1
|
+
import { S as Q, a as X, v as Z } from "./analyze-result-contract-B0O3oIYu.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 Le = Q, j = X, M = "semaphor-generated-data-app-contract/v1", x = "semaphor-generated-data-app-contract-manifest/v1";
|
|
4
|
+
function L(e) {
|
|
5
5
|
return _(e) ? [
|
|
6
|
-
...
|
|
7
|
-
...
|
|
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
19
|
const t = _(e);
|
|
20
20
|
if (!t)
|
|
@@ -22,23 +22,23 @@ function ie(e) {
|
|
|
22
22
|
const n = [];
|
|
23
23
|
return ((r = _(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 = _(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 = _((i = _(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
38
|
function _(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,8 +47,8 @@ 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({
|
|
@@ -65,29 +65,29 @@ async function Je({
|
|
|
65
65
|
}
|
|
66
66
|
]
|
|
67
67
|
};
|
|
68
|
-
r.schemaVersion !==
|
|
68
|
+
r.schemaVersion !== x && n.push({
|
|
69
69
|
path: "schemaVersion",
|
|
70
|
-
message: `schemaVersion must be ${
|
|
70
|
+
message: `schemaVersion must be ${x}. Regenerate the contract with semaphor_create_data_app_contract.`,
|
|
71
71
|
repairHint: "Regenerate the contract with semaphor_create_data_app_contract."
|
|
72
|
-
}), r.generatedContractSchemaVersion !==
|
|
72
|
+
}), r.generatedContractSchemaVersion !== M && n.push({
|
|
73
73
|
path: "generatedContractSchemaVersion",
|
|
74
|
-
message: `generatedContractSchemaVersion must be ${
|
|
74
|
+
message: `generatedContractSchemaVersion must be ${M}. 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 = y(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({
|
|
@@ -101,26 +101,26 @@ async function Je({
|
|
|
101
101
|
repairHint: "Regenerate the generated contract so manifest hashes are written deterministically."
|
|
102
102
|
});
|
|
103
103
|
else if (y(r.codegenSummary)) {
|
|
104
|
-
const
|
|
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,73 +128,73 @@ 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
|
|
152
|
+
function fe(e) {
|
|
153
153
|
const t = y(e);
|
|
154
154
|
if (!t)
|
|
155
155
|
return [];
|
|
156
156
|
const n = [], r = new Set(
|
|
157
|
-
|
|
158
|
-
var
|
|
159
|
-
return (
|
|
157
|
+
C(t.inputs).map((o) => {
|
|
158
|
+
var a;
|
|
159
|
+
return (a = y(o)) == null ? void 0 : a.id;
|
|
160
160
|
}).filter(S)
|
|
161
|
-
),
|
|
162
|
-
|
|
163
|
-
var
|
|
164
|
-
return (
|
|
161
|
+
), s = new Set(
|
|
162
|
+
C(t.views).map((o) => {
|
|
163
|
+
var a;
|
|
164
|
+
return (a = y(o)) == null ? void 0 : a.id;
|
|
165
165
|
}).filter(S)
|
|
166
166
|
);
|
|
167
|
-
return
|
|
168
|
-
const
|
|
167
|
+
return C(t.filterContracts).forEach((o, a) => {
|
|
168
|
+
const i = y(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 = y(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 h = y(
|
|
180
|
+
const h = y(g == null ? void 0 : g.fieldRef);
|
|
181
181
|
S(h == null ? void 0 : h.name) || n.push({
|
|
182
|
-
path: `codegenSummary.filterContracts.${
|
|
183
|
-
message: `codegenSummary.filterContracts.${
|
|
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 z(n)}`;
|
|
195
195
|
}
|
|
196
196
|
async function pe(e) {
|
|
197
|
-
return `sha256:${await
|
|
197
|
+
return `sha256:${await z(N(e))}`;
|
|
198
198
|
}
|
|
199
199
|
function N(e) {
|
|
200
200
|
if (e === null || typeof e != "object")
|
|
@@ -204,87 +204,87 @@ function N(e) {
|
|
|
204
204
|
const t = e;
|
|
205
205
|
return `{${Object.keys(t).sort().filter((r) => t[r] !== void 0).map((r) => `${JSON.stringify(r)}:${N(t[r])}`).join(",")}}`;
|
|
206
206
|
}
|
|
207
|
-
async function
|
|
207
|
+
async function z(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
214
|
function y(e) {
|
|
215
215
|
return e && typeof e == "object" && !Array.isArray(e) ? e : void 0;
|
|
216
216
|
}
|
|
217
|
-
function
|
|
217
|
+
function C(e) {
|
|
218
218
|
return Array.isArray(e) ? e : [];
|
|
219
219
|
}
|
|
220
220
|
function S(e) {
|
|
221
221
|
return typeof e == "string" && e.length > 0;
|
|
222
222
|
}
|
|
223
223
|
function Ue(e) {
|
|
224
|
-
const t = d(e), n = b(t), r = [],
|
|
225
|
-
return
|
|
226
|
-
var
|
|
227
|
-
const
|
|
228
|
-
return !!(
|
|
229
|
-
}).forEach((
|
|
224
|
+
const t = d(e), n = b(t), r = [], s = [];
|
|
225
|
+
return v(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 : b(d(t)), a = Ne(r.builder), i = d(w(s, o)) || {}, c = ye({
|
|
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: Ee(n,
|
|
257
|
+
label: Ee(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 {
|
|
@@ -297,28 +297,28 @@ function Ye({
|
|
|
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 = b(d(n)), i = d(o.spec), c = he(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
|
-
|
|
308
|
+
w(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
|
-
|
|
320
|
+
return ee(
|
|
321
|
+
w(m, a)
|
|
322
322
|
);
|
|
323
323
|
} catch {
|
|
324
324
|
return null;
|
|
@@ -329,36 +329,36 @@ function We({
|
|
|
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 = b(d(s)), a = d(e), i = d(t), c = d(n), u = w(
|
|
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
350
|
function b(e) {
|
|
351
351
|
return {
|
|
352
352
|
sourcesByKey: new Map(
|
|
353
|
-
|
|
353
|
+
v(e == null ? void 0 : e.sources).map(d).filter(Me).filter((t) => typeof t.sourceKey == "string").map((t) => [String(t.sourceKey), U(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 he(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)
|
|
@@ -368,61 +368,61 @@ function me(e, t, n) {
|
|
|
368
368
|
if (typeof (t == null ? void 0 : t.sourceKey) == "string")
|
|
369
369
|
return n.sourcesByKey.get(t.sourceKey) || { sourceKey: t.sourceKey };
|
|
370
370
|
}
|
|
371
|
-
function
|
|
371
|
+
function ye({
|
|
372
372
|
view: e,
|
|
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 (Ce(
|
|
384
|
+
const a = { ...r };
|
|
385
|
+
if (Ce(o) === "server" && (a.pagination = {
|
|
386
386
|
page: 1,
|
|
387
|
-
pageSize:
|
|
388
|
-
}), t === "records" && Ve(
|
|
389
|
-
const c =
|
|
387
|
+
pageSize: Se({ tableBehavior: o, spec: r })
|
|
388
|
+
}), t === "records" && Ve(o) === "server") {
|
|
389
|
+
const c = Ae({
|
|
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 V(n == null ? void 0 : n.pageSize) || V(r == null ? void 0 : r.pageSize) || V(t.limit) || 100;
|
|
405
405
|
}
|
|
406
|
-
function
|
|
406
|
+
function Ae({
|
|
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 = we({
|
|
416
416
|
view: e,
|
|
417
417
|
rawSpec: t,
|
|
418
418
|
context: r
|
|
419
419
|
}).filter(
|
|
420
|
-
(c) =>
|
|
420
|
+
(c) => _e(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
428
|
function we({
|
|
@@ -430,50 +430,50 @@ function we({
|
|
|
430
430
|
rawSpec: t,
|
|
431
431
|
context: n
|
|
432
432
|
}) {
|
|
433
|
-
var
|
|
433
|
+
var s;
|
|
434
434
|
const r = [];
|
|
435
|
-
for (const
|
|
436
|
-
I(r, t.dateField, n), I(r, (
|
|
437
|
-
for (const
|
|
438
|
-
I(r,
|
|
439
|
-
return
|
|
435
|
+
for (const o of v(t.fields)) I(r, o, n);
|
|
436
|
+
I(r, t.dateField, n), I(r, (s = d(t.orderBy)) == null ? void 0 : s.field, n);
|
|
437
|
+
for (const o of v(e.fields))
|
|
438
|
+
I(r, o, n);
|
|
439
|
+
return Fe(
|
|
440
440
|
r,
|
|
441
|
-
(
|
|
441
|
+
(o) => $e(o.lookup)
|
|
442
442
|
);
|
|
443
443
|
}
|
|
444
444
|
function I(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(w(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
|
-
|
|
457
|
-
|
|
458
|
-
|
|
454
|
+
function _e(e) {
|
|
455
|
+
return Ke([
|
|
456
|
+
p(e.name),
|
|
457
|
+
J(e),
|
|
458
|
+
Ie(e)
|
|
459
459
|
]);
|
|
460
460
|
}
|
|
461
|
-
function
|
|
461
|
+
function $e(e) {
|
|
462
462
|
return [
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
463
|
+
J(e),
|
|
464
|
+
p(e.name),
|
|
465
|
+
p(e.role),
|
|
466
|
+
p(e.aggregate)
|
|
467
467
|
].join("|");
|
|
468
468
|
}
|
|
469
|
-
function
|
|
469
|
+
function J(e) {
|
|
470
470
|
return [
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
471
|
+
p(e.sourceKey) || ve(e.source),
|
|
472
|
+
p(e.name),
|
|
473
|
+
p(e.aggregate)
|
|
474
474
|
].filter(Boolean).join(":");
|
|
475
475
|
}
|
|
476
|
-
function
|
|
476
|
+
function ve(e) {
|
|
477
477
|
const t = d(e);
|
|
478
478
|
if (!t)
|
|
479
479
|
return "";
|
|
@@ -485,50 +485,50 @@ 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
506
|
function Ce(e) {
|
|
507
507
|
var t;
|
|
508
|
-
return
|
|
508
|
+
return p((t = d(e.pagination)) == null ? void 0 : t.mode);
|
|
509
509
|
}
|
|
510
510
|
function Ve(e) {
|
|
511
511
|
var t;
|
|
512
|
-
return
|
|
512
|
+
return p((t = d(e.sorting)) == null ? void 0 : t.mode);
|
|
513
513
|
}
|
|
514
|
-
function
|
|
514
|
+
function w(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) => w(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
|
-
return
|
|
521
|
+
return U(n);
|
|
522
522
|
const r = {};
|
|
523
|
-
for (const [
|
|
524
|
-
|
|
523
|
+
for (const [s, o] of Object.entries(n))
|
|
524
|
+
s !== "sourceKey" && (r[s] = w(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
|
}
|
|
531
|
-
function
|
|
531
|
+
function U(e) {
|
|
532
532
|
const { sourceKey: t, ...n } = e;
|
|
533
533
|
return n;
|
|
534
534
|
}
|
|
@@ -536,52 +536,52 @@ function Ee(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 = v(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 V(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 v(e) {
|
|
582
582
|
return Array.isArray(e) ? e : [];
|
|
583
583
|
}
|
|
584
|
-
function
|
|
584
|
+
function Me(e) {
|
|
585
585
|
return e !== void 0;
|
|
586
586
|
}
|
|
587
587
|
const xe = /* @__PURE__ */ new Set([
|
|
@@ -599,36 +599,50 @@ function Qe({
|
|
|
599
599
|
afterSummary: t,
|
|
600
600
|
migrationReport: n,
|
|
601
601
|
operationIntent: r,
|
|
602
|
-
|
|
602
|
+
constraints: s,
|
|
603
|
+
preferences: o
|
|
603
604
|
}) {
|
|
604
|
-
const
|
|
605
|
-
return
|
|
605
|
+
const a = l(r), i = typeof (a == null ? void 0 : a.kind) == "string" ? a.kind.trim() : "add";
|
|
606
|
+
return D(o) ? {
|
|
606
607
|
ok: !1,
|
|
607
608
|
policy: {
|
|
608
|
-
kind:
|
|
609
|
-
mode: "
|
|
609
|
+
kind: i,
|
|
610
|
+
mode: "invalid_update_constraints",
|
|
610
611
|
reason: "Metric aggregate override updates must use operationIntent.measureAggregateOverrides so deterministic update policy can guard the targeted edit."
|
|
611
612
|
},
|
|
612
613
|
violations: [
|
|
613
614
|
{
|
|
614
615
|
path: "preferences.measureAggregateOverrides",
|
|
616
|
+
reason: "preferences is retired. Move measureAggregateOverrides to operationIntent.measureAggregateOverrides for update calls."
|
|
617
|
+
}
|
|
618
|
+
]
|
|
619
|
+
} : D(s) ? {
|
|
620
|
+
ok: !1,
|
|
621
|
+
policy: {
|
|
622
|
+
kind: i,
|
|
623
|
+
mode: "invalid_update_constraints",
|
|
624
|
+
reason: "Metric aggregate override updates must use operationIntent.measureAggregateOverrides so deterministic update policy can guard the targeted edit."
|
|
625
|
+
},
|
|
626
|
+
violations: [
|
|
627
|
+
{
|
|
628
|
+
path: "constraints.measureAggregateOverrides",
|
|
615
629
|
reason: "Move measureAggregateOverrides to operationIntent.measureAggregateOverrides for update calls."
|
|
616
630
|
}
|
|
617
631
|
]
|
|
618
|
-
} : xe.has(
|
|
632
|
+
} : xe.has(i) ? G({
|
|
619
633
|
beforeSummary: e,
|
|
620
634
|
afterSummary: t,
|
|
621
635
|
migrationReport: n,
|
|
622
|
-
operationIntent:
|
|
636
|
+
operationIntent: a,
|
|
623
637
|
mode: "diagnostic_warning_fix",
|
|
624
638
|
allowedViewChangeReasons: T,
|
|
625
639
|
label: "Diagnostic warning fixes",
|
|
626
640
|
reason: "Diagnostic warning fixes are preserve-by-default and may not add/remove views, inputs, or filter contracts."
|
|
627
|
-
}) :
|
|
641
|
+
}) : i === "edit" && Array.isArray(a == null ? void 0 : a.measureAggregateOverrides) && a.measureAggregateOverrides.length > 0 ? G({
|
|
628
642
|
beforeSummary: e,
|
|
629
643
|
afterSummary: t,
|
|
630
644
|
migrationReport: n,
|
|
631
|
-
operationIntent:
|
|
645
|
+
operationIntent: a,
|
|
632
646
|
mode: "metric_aggregate_override_edit",
|
|
633
647
|
allowedViewChangeReasons: T,
|
|
634
648
|
label: "Metric aggregate override edits",
|
|
@@ -636,84 +650,84 @@ function Qe({
|
|
|
636
650
|
}) : {
|
|
637
651
|
ok: !0,
|
|
638
652
|
policy: {
|
|
639
|
-
kind:
|
|
653
|
+
kind: i,
|
|
640
654
|
mode: "general_iterative_update",
|
|
641
655
|
reason: "General generated-contract edits are allowed to change the requested contract shape. Review the migration report for expected UI work."
|
|
642
656
|
},
|
|
643
657
|
violations: []
|
|
644
658
|
};
|
|
645
659
|
}
|
|
646
|
-
function
|
|
660
|
+
function D(e) {
|
|
647
661
|
var t;
|
|
648
662
|
return Array.isArray((t = l(e)) == null ? void 0 : t.measureAggregateOverrides);
|
|
649
663
|
}
|
|
650
|
-
function
|
|
664
|
+
function G({
|
|
651
665
|
beforeSummary: e,
|
|
652
666
|
afterSummary: t,
|
|
653
667
|
migrationReport: n,
|
|
654
668
|
operationIntent: r,
|
|
655
|
-
mode:
|
|
656
|
-
allowedViewChangeReasons:
|
|
657
|
-
label:
|
|
658
|
-
reason:
|
|
669
|
+
mode: s,
|
|
670
|
+
allowedViewChangeReasons: o,
|
|
671
|
+
label: a,
|
|
672
|
+
reason: i
|
|
659
673
|
}) {
|
|
660
674
|
const c = [], u = De(r == null ? void 0 : r.targetViewIds), f = l(n) || {};
|
|
661
675
|
u.size === 0 && c.push({
|
|
662
676
|
path: "operationIntent.targetViewIds",
|
|
663
|
-
reason: `${
|
|
664
|
-
}),
|
|
677
|
+
reason: `${a} must declare targetViewIds so the update cannot broaden to unrelated views.`
|
|
678
|
+
}), E({
|
|
665
679
|
bucket: l(f.views),
|
|
666
680
|
label: "views",
|
|
667
|
-
operationLabel:
|
|
681
|
+
operationLabel: a,
|
|
668
682
|
violations: c
|
|
669
|
-
}),
|
|
683
|
+
}), E({
|
|
670
684
|
bucket: l(f.inputs),
|
|
671
685
|
label: "inputs",
|
|
672
|
-
operationLabel:
|
|
686
|
+
operationLabel: a,
|
|
673
687
|
violations: c
|
|
674
|
-
}),
|
|
688
|
+
}), B({
|
|
675
689
|
bucket: l(f.inputs),
|
|
676
690
|
label: "inputs",
|
|
677
|
-
operationLabel:
|
|
691
|
+
operationLabel: a,
|
|
678
692
|
violations: c
|
|
679
|
-
}),
|
|
693
|
+
}), E({
|
|
680
694
|
bucket: l(f.filterContracts),
|
|
681
695
|
label: "filterContracts",
|
|
682
|
-
operationLabel:
|
|
696
|
+
operationLabel: a,
|
|
683
697
|
violations: c
|
|
684
|
-
}),
|
|
698
|
+
}), B({
|
|
685
699
|
bucket: l(f.filterContracts),
|
|
686
700
|
label: "filterContracts",
|
|
687
|
-
operationLabel:
|
|
701
|
+
operationLabel: a,
|
|
688
702
|
violations: c
|
|
689
703
|
});
|
|
690
|
-
for (const m of
|
|
691
|
-
u.size > 0 && !u.has(
|
|
692
|
-
path: `views.${
|
|
693
|
-
reason: `${
|
|
704
|
+
for (const m of Y(l(f.views))) {
|
|
705
|
+
u.size > 0 && !u.has(A(m.id)) && c.push({
|
|
706
|
+
path: `views.${A(m.id) || "<unknown>"}`,
|
|
707
|
+
reason: `${a} may only change explicitly targeted views.`
|
|
694
708
|
});
|
|
695
709
|
const h = Array.isArray(m.reasons) ? m.reasons.filter(
|
|
696
|
-
($) => typeof $ != "string" || !
|
|
710
|
+
($) => typeof $ != "string" || !o.has($)
|
|
697
711
|
) : [];
|
|
698
712
|
h.length > 0 && c.push({
|
|
699
|
-
path: `views.${
|
|
700
|
-
reason: `${
|
|
713
|
+
path: `views.${A(m.id) || "<unknown>"}`,
|
|
714
|
+
reason: `${a} may only adjust fields/sdkSpec; changed ${h.join(", ")}.`
|
|
701
715
|
});
|
|
702
716
|
}
|
|
703
|
-
const
|
|
717
|
+
const g = Te({
|
|
704
718
|
beforeSummary: e,
|
|
705
719
|
afterSummary: t,
|
|
706
720
|
targetViewIds: u,
|
|
707
|
-
label:
|
|
721
|
+
label: a
|
|
708
722
|
});
|
|
709
|
-
return
|
|
723
|
+
return g && c.push(g), {
|
|
710
724
|
ok: c.length === 0,
|
|
711
725
|
policy: {
|
|
712
|
-
kind:
|
|
713
|
-
mode:
|
|
714
|
-
allowedViewChangeReasons: Array.from(
|
|
726
|
+
kind: A(r == null ? void 0 : r.kind) || "diagnostic_fix",
|
|
727
|
+
mode: s,
|
|
728
|
+
allowedViewChangeReasons: Array.from(o).sort(),
|
|
715
729
|
targetViewIds: Array.from(u).sort(),
|
|
716
|
-
reason:
|
|
730
|
+
reason: i
|
|
717
731
|
},
|
|
718
732
|
violations: c
|
|
719
733
|
};
|
|
@@ -724,35 +738,35 @@ function Te({
|
|
|
724
738
|
targetViewIds: n,
|
|
725
739
|
label: r
|
|
726
740
|
}) {
|
|
727
|
-
const
|
|
728
|
-
if (!
|
|
741
|
+
const s = l(e), o = l(t);
|
|
742
|
+
if (!s || !o)
|
|
729
743
|
return {
|
|
730
744
|
path: "codegenSummary",
|
|
731
745
|
reason: `${r} require before/after codegen summaries for full-scope verification.`
|
|
732
746
|
};
|
|
733
|
-
const
|
|
734
|
-
|
|
735
|
-
for (const
|
|
736
|
-
const m = c.get(
|
|
747
|
+
const a = q(s), i = q(o), c = P(s.views), u = P(o.views), f = Array.isArray(a.views) ? a.views : [];
|
|
748
|
+
a.views = f;
|
|
749
|
+
for (const g of n) {
|
|
750
|
+
const m = c.get(g), h = u.get(g);
|
|
737
751
|
if (!m || !h)
|
|
738
752
|
continue;
|
|
739
753
|
const $ = f.find(
|
|
740
|
-
(
|
|
754
|
+
(W) => {
|
|
741
755
|
var K;
|
|
742
|
-
return ((K = l(
|
|
756
|
+
return ((K = l(W)) == null ? void 0 : K.id) === g;
|
|
743
757
|
}
|
|
744
|
-
),
|
|
745
|
-
if (!$ || !
|
|
758
|
+
), O = l(h);
|
|
759
|
+
if (!$ || !O)
|
|
746
760
|
continue;
|
|
747
761
|
const F = $;
|
|
748
|
-
F.fields = k(
|
|
762
|
+
F.fields = k(O.fields), F.sdkSpec = k(O.sdkSpec);
|
|
749
763
|
}
|
|
750
|
-
return
|
|
764
|
+
return R(a) === R(i) ? null : {
|
|
751
765
|
path: "codegenSummary",
|
|
752
766
|
reason: `${r} may only change fields/sdkSpec on targetViewIds; another generated contract section changed.`
|
|
753
767
|
};
|
|
754
768
|
}
|
|
755
|
-
function
|
|
769
|
+
function q(e) {
|
|
756
770
|
const t = k(e);
|
|
757
771
|
for (const n of [
|
|
758
772
|
"implementationChecklist",
|
|
@@ -764,36 +778,36 @@ function G(e) {
|
|
|
764
778
|
delete t[n];
|
|
765
779
|
return qe(t.unsupportedInsights) && delete t.unsupportedInsights, t;
|
|
766
780
|
}
|
|
767
|
-
function
|
|
781
|
+
function E({
|
|
768
782
|
bucket: e,
|
|
769
783
|
label: t,
|
|
770
784
|
operationLabel: n,
|
|
771
785
|
violations: r
|
|
772
786
|
}) {
|
|
773
|
-
for (const
|
|
787
|
+
for (const s of H(e == null ? void 0 : e.added))
|
|
774
788
|
r.push({
|
|
775
|
-
path: `${t}.${
|
|
789
|
+
path: `${t}.${A(s.id) || "<unknown>"}`,
|
|
776
790
|
reason: `${n} may not add ${t}.`
|
|
777
791
|
});
|
|
778
|
-
for (const
|
|
792
|
+
for (const s of H(e == null ? void 0 : e.removed))
|
|
779
793
|
r.push({
|
|
780
|
-
path: `${t}.${
|
|
794
|
+
path: `${t}.${A(s.id) || "<unknown>"}`,
|
|
781
795
|
reason: `${n} may not remove ${t}.`
|
|
782
796
|
});
|
|
783
797
|
}
|
|
784
|
-
function
|
|
798
|
+
function B({
|
|
785
799
|
bucket: e,
|
|
786
800
|
label: t,
|
|
787
801
|
operationLabel: n,
|
|
788
802
|
violations: r
|
|
789
803
|
}) {
|
|
790
|
-
for (const
|
|
804
|
+
for (const s of Y(e))
|
|
791
805
|
r.push({
|
|
792
|
-
path: `${t}.${
|
|
806
|
+
path: `${t}.${A(s.id) || "<unknown>"}`,
|
|
793
807
|
reason: `${n} may not change ${t}.`
|
|
794
808
|
});
|
|
795
809
|
}
|
|
796
|
-
function
|
|
810
|
+
function Y(e) {
|
|
797
811
|
return H(e == null ? void 0 : e.changed);
|
|
798
812
|
}
|
|
799
813
|
function H(e) {
|
|
@@ -804,25 +818,25 @@ function De(e) {
|
|
|
804
818
|
e.filter((t) => typeof t == "string" && t.trim().length > 0).map((t) => t.trim())
|
|
805
819
|
) : /* @__PURE__ */ new Set();
|
|
806
820
|
}
|
|
807
|
-
function
|
|
821
|
+
function P(e) {
|
|
808
822
|
var n;
|
|
809
823
|
const t = /* @__PURE__ */ new Map();
|
|
810
824
|
for (const r of Array.isArray(e) ? e : []) {
|
|
811
|
-
const
|
|
812
|
-
typeof
|
|
825
|
+
const s = (n = l(r)) == null ? void 0 : n.id;
|
|
826
|
+
typeof s == "string" && s.trim() && t.set(s, r);
|
|
813
827
|
}
|
|
814
828
|
return t;
|
|
815
829
|
}
|
|
816
830
|
function k(e) {
|
|
817
831
|
return e === void 0 ? e : JSON.parse(JSON.stringify(e));
|
|
818
832
|
}
|
|
819
|
-
function
|
|
833
|
+
function R(e) {
|
|
820
834
|
if (e === null || typeof e != "object")
|
|
821
835
|
return JSON.stringify(e);
|
|
822
836
|
if (Array.isArray(e))
|
|
823
|
-
return `[${e.map((n) =>
|
|
837
|
+
return `[${e.map((n) => R(n)).join(",")}]`;
|
|
824
838
|
const t = e;
|
|
825
|
-
return `{${Object.keys(t).sort().filter((n) => t[n] !== void 0).map((n) => `${JSON.stringify(n)}:${
|
|
839
|
+
return `{${Object.keys(t).sort().filter((n) => t[n] !== void 0).map((n) => `${JSON.stringify(n)}:${R(t[n])}`).join(",")}}`;
|
|
826
840
|
}
|
|
827
841
|
function l(e) {
|
|
828
842
|
return e && typeof e == "object" && !Array.isArray(e) ? e : void 0;
|
|
@@ -833,22 +847,22 @@ function Ge(e) {
|
|
|
833
847
|
function qe(e) {
|
|
834
848
|
return Array.isArray(e) && e.length === 0;
|
|
835
849
|
}
|
|
836
|
-
function
|
|
850
|
+
function A(e) {
|
|
837
851
|
return typeof e == "string" ? e : "";
|
|
838
852
|
}
|
|
839
853
|
export {
|
|
840
854
|
Le as C,
|
|
841
|
-
|
|
842
|
-
|
|
855
|
+
M as G,
|
|
856
|
+
de as R,
|
|
843
857
|
j as a,
|
|
844
|
-
|
|
858
|
+
x as b,
|
|
845
859
|
ze as c,
|
|
846
860
|
Je as d,
|
|
847
|
-
|
|
861
|
+
ce as e,
|
|
848
862
|
We as f,
|
|
849
863
|
Ye as g,
|
|
850
|
-
|
|
864
|
+
le as h,
|
|
851
865
|
Ue as i,
|
|
852
866
|
Qe as j,
|
|
853
|
-
|
|
867
|
+
L as v
|
|
854
868
|
};
|