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