@canonry/canonry 7.57.2 → 7.58.0
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/README.md +28 -0
- package/assets/agent-workspace/skills/canonry/references/canonry-cli.md +6 -0
- package/assets/assets/{AgentSetupPage-Cc_zsHR0.js → AgentSetupPage-DZBjF9HP.js} +3 -3
- package/assets/assets/{AuditHistoryPanel-vMTAZBj_.js → AuditHistoryPanel-DAY6GbzH.js} +1 -1
- package/assets/assets/{BacklinksPage-CbploUJf.js → BacklinksPage-Ci9s8osY.js} +1 -1
- package/assets/assets/{HistoryPage-m-59cu3N.js → HistoryPage-BM7PM3Ow.js} +1 -1
- package/assets/assets/MeasurementPropertyPage-DgMIc9zm.js +4 -0
- package/assets/assets/ProjectPage-OOpNW437.js +9 -0
- package/assets/assets/RunsPage-B6dUljTT.js +1 -0
- package/assets/assets/{SettingsPage-UT9KpfMj.js → SettingsPage-DjhPnQNP.js} +1 -1
- package/assets/assets/SiteHealthSection-CQipxjCq.js +2 -0
- package/assets/assets/ToneBadge-Bk7cBexZ.js +60 -0
- package/assets/assets/{TrafficPage-BPwgnTWA.js → TrafficPage-TceTtJmu.js} +2 -2
- package/assets/assets/{TrafficSourceDetailPage-D7_b16wr.js → TrafficSourceDetailPage-BVAVo-JO.js} +1 -1
- package/assets/assets/{account-context-BAJ4-K7g.js → account-context-ChEngAKj.js} +1 -1
- package/assets/assets/{card-OSE9muoF.js → card-qOcJFZhl.js} +1 -1
- package/assets/assets/{extract-error-message-CmAMG5OS.js → extract-error-message-bWEYiDDO.js} +1 -1
- package/assets/assets/{format-helpers-k8DWKWfO.js → format-helpers-CvOZG1pt.js} +1 -1
- package/assets/assets/{index-BMD46UDb.css → index-D67dZGOY.css} +1 -1
- package/assets/assets/index-cRQCvw6S.js +56 -0
- package/assets/assets/query-client-nsJhXK9R.js +1 -0
- package/assets/assets/react-query-BKjNH2ek.js +1 -0
- package/assets/assets/{react-sigma_core.esm.min-DLc_m5Ao.js → react-sigma_core.esm.min-RpFcdsyW.js} +1 -1
- package/assets/assets/{service-B51xJDz2.js → service-DwTt-v6l.js} +1 -1
- package/assets/index.html +8 -8
- package/dist/{ads-5ZKOYN72.js → ads-BMBXQB67.js} +3 -3
- package/dist/{agent-Q63YJLFN.js → agent-S6CU36RL.js} +7 -7
- package/dist/{agent-ask-5EZKRAMG.js → agent-ask-XG7WQBX6.js} +3 -3
- package/dist/{agent-conversations-B3P2DHD2.js → agent-conversations-C4QBZAPC.js} +3 -3
- package/dist/{agent-memory-4672STKY.js → agent-memory-I7UJ7MKH.js} +3 -3
- package/dist/{agent-providers-IARC3ZE6.js → agent-providers-YHRIYJDT.js} +3 -3
- package/dist/{agent-transcript-CQLUO6TR.js → agent-transcript-2WICUOEW.js} +3 -3
- package/dist/{analytics-HBWILHPQ.js → analytics-Y5AGSYWD.js} +3 -3
- package/dist/{apply-YRVGOW4D.js → apply-DLVLMU3O.js} +3 -3
- package/dist/{backfill-T2R2QTOZ.js → backfill-JAHDHVXJ.js} +9 -9
- package/dist/{backlinks-KOSJ4BAT.js → backlinks-TEZTPNZ5.js} +3 -3
- package/dist/{bing-LYCNZP6M.js → bing-IIA5HLND.js} +3 -3
- package/dist/{bootstrap-AI7CKW3E.js → bootstrap-AKGA3BJI.js} +10 -10
- package/dist/{cdp-LP3GDIXS.js → cdp-WWOFWFYU.js} +7 -7
- package/dist/{chunk-46S3COHT.js → chunk-27SGL3DF.js} +1 -1
- package/dist/{chunk-PXEU7GIW.js → chunk-2DZYA62C.js} +18 -6
- package/dist/{chunk-XJJNKNX3.js → chunk-3U7LL3JM.js} +1 -1
- package/dist/{chunk-TRXD3CXS.js → chunk-4P7NK7XM.js} +2 -2
- package/dist/{chunk-ICVMS2JE.js → chunk-4TM4NXQR.js} +2 -2
- package/dist/{chunk-MUSBD3EX.js → chunk-4UGM5YV4.js} +3 -3
- package/dist/{chunk-TCXRQZYE.js → chunk-52NCZIAC.js} +1 -1
- package/dist/{chunk-HRYRYUI2.js → chunk-6IBLGQVZ.js} +1 -1
- package/dist/{chunk-4PYN2J6Z.js → chunk-7CKJTD3Q.js} +1129 -905
- package/dist/{chunk-ADWVQ3UM.js → chunk-BP5OKJIC.js} +2 -2
- package/dist/{chunk-JZX4CR7V.js → chunk-F6W7FCS2.js} +196 -2
- package/dist/{chunk-QTFHMU6I.js → chunk-G34BVUMF.js} +1 -1
- package/dist/{chunk-ZD37CGTP.js → chunk-IFVTHGXG.js} +2 -2
- package/dist/{chunk-7RLF3PV4.js → chunk-JGRUCEL4.js} +2 -2
- package/dist/{chunk-4NDWRR4B.js → chunk-KWXARGCT.js} +27 -5
- package/dist/{chunk-2THE4GKG.js → chunk-L7TKNHEX.js} +1 -1
- package/dist/{chunk-KZZAU4SN.js → chunk-N2HCXIQ3.js} +1 -1
- package/dist/{chunk-4MJYGB56.js → chunk-NCIPNVD6.js} +8 -0
- package/dist/{chunk-UMMF5KC5.js → chunk-NMLVLFF7.js} +5 -5
- package/dist/{chunk-YWUB5ZU6.js → chunk-NS7KRCND.js} +1140 -573
- package/dist/{chunk-IVSJLTKC.js → chunk-NWQQYLZV.js} +2845 -2243
- package/dist/{chunk-WODNZ6PH.js → chunk-PEZO3YEC.js} +4 -4
- package/dist/{chunk-42V5EYJX.js → chunk-Q4J3XSWE.js} +1 -1
- package/dist/{chunk-DJ4YDAI6.js → chunk-QFO7JHX2.js} +9 -4
- package/dist/{chunk-QN3YYE4J.js → chunk-QSPLYPVA.js} +1 -1
- package/dist/{chunk-N3WRXGRW.js → chunk-RXMGU7AF.js} +8 -8
- package/dist/{chunk-EIGZFAQJ.js → chunk-SCS7R2ND.js} +2269 -2011
- package/dist/{chunk-3PMACMXD.js → chunk-TH3NNUJW.js} +17 -1
- package/dist/{chunk-FILMLHNG.js → chunk-TVANRUBO.js} +108 -83
- package/dist/{chunk-TX6JOU2D.js → chunk-U65LWABS.js} +7 -3
- package/dist/{chunk-BM4AWHD6.js → chunk-WLIGKWVB.js} +3 -3
- package/dist/{chunk-LACYPNQA.js → chunk-Y7NX6EIK.js} +1801 -1456
- package/dist/{chunk-T76XI4DS.js → chunk-YDSY5YJE.js} +4 -4
- package/dist/{chunk-TAEBXXGQ.js → chunk-YJPQBJZO.js} +250 -3
- package/dist/{chunk-BMLVLHSH.js → chunk-ZYL3LCDZ.js} +1 -1
- package/dist/{citations-XUAOQHRF.js → citations-4LVBHTDX.js} +3 -3
- package/dist/{cli-catalog-R6JZ5ELQ.js → cli-catalog-PJYR3JHX.js} +3 -3
- package/dist/{cli-commands-YFN3ZE4O.js → cli-commands-2HYNKJDJ.js} +7 -7
- package/dist/cli.js +13 -13
- package/dist/{competitor-67DBTBBA.js → competitor-T7UXAW4F.js} +3 -3
- package/dist/{content-3OVMQETU.js → content-DFYYGGPI.js} +3 -3
- package/dist/{dashboard-LFJXKLFE.js → dashboard-2P3TEH6S.js} +6 -6
- package/dist/{demo-6ANGZSRC.js → demo-UBMNDBRF.js} +1 -1
- package/dist/{demo-server-HUVMI3XH.js → demo-server-F4M74FVL.js} +11 -11
- package/dist/{discover-YF3FDGSD.js → discover-QTC5OBQG.js} +3 -3
- package/dist/{discover-eval-CMHDYK5O.js → discover-eval-QQZGUPR6.js} +3 -3
- package/dist/{doctor-WKNWJSK4.js → doctor-VHFDL5MH.js} +3 -3
- package/dist/{evidence-CLNQ2CYR.js → evidence-4PRFOC2I.js} +3 -3
- package/dist/{export-cmd-OHRV4TVH.js → export-cmd-BQE7BPKZ.js} +3 -3
- package/dist/{ga-FX742WRJ.js → ga-ULY5XDBK.js} +3 -3
- package/dist/{gbp-MRQ4IZCG.js → gbp-4WHNZAFY.js} +3 -3
- package/dist/{google-C7TZMMMK.js → google-O4IVWLSG.js} +4 -4
- package/dist/{google-marketing-D2UGYDMK.js → google-marketing-DCQDTDDG.js} +1 -1
- package/dist/{health-cmd-67I3W2ZU.js → health-cmd-I2JTACS7.js} +3 -3
- package/dist/{history-ZWVARGNG.js → history-LUPHO3P3.js} +3 -3
- package/dist/index.d.ts +1212 -19
- package/dist/index.js +25 -25
- package/dist/{init-AOBSZ2LL.js → init-YKMNKERW.js} +11 -11
- package/dist/{insights-7LBGR4WZ.js → insights-GC2W45U4.js} +3 -3
- package/dist/intelligence-service-4PHEK5F4.js +15 -0
- package/dist/{keys-6QJRMT55.js → keys-DXQBSOBI.js} +3 -3
- package/dist/{keyword-OPBDMSWK.js → keyword-2DCR2QCJ.js} +3 -3
- package/dist/{logs-EGD3OBA4.js → logs-H45QFIEB.js} +3 -3
- package/dist/{mcp-KAM74JPU.js → mcp-NXXP6M3C.js} +2 -2
- package/dist/mcp.js +10 -10
- package/dist/{measurement-plan-V53W3HSX.js → measurement-plan-IG4JUKKW.js} +5 -5
- package/dist/{notify-KYZJ2RDC.js → notify-BLLWXMBB.js} +3 -3
- package/dist/{organic-evidence-N53Z2XJH.js → organic-evidence-73K7W7SB.js} +3 -3
- package/dist/{overview-BE25C6Q5.js → overview-4TAULPUG.js} +4 -4
- package/dist/{project-NO32ZURN.js → project-ANX4JTWS.js} +3 -3
- package/dist/{query-NKVTEXLS.js → query-U3MFTLGR.js} +3 -3
- package/dist/{research-YISKR3TJ.js → research-3YZ6QI67.js} +3 -3
- package/dist/{results-export-HD6Q6ZNB.js → results-export-72OVLKSC.js} +3 -3
- package/dist/{run-MAOMVPZL.js → run-SI6IL4FC.js} +4 -4
- package/dist/{schedule-NWDR5YEK.js → schedule-FYEHU2VH.js} +3 -3
- package/dist/{search-PBA5FKL7.js → search-MXDT3DQE.js} +3 -3
- package/dist/{serve-VRTPB4I3.js → serve-C4FOCQEX.js} +26 -26
- package/dist/{session-M2SYYRPJ.js → session-VTFLD3C5.js} +13 -13
- package/dist/{settings-Q2FL6ONA.js → settings-ZGS26QOP.js} +3 -3
- package/dist/{skills-7LRRFGYJ.js → skills-ZMMCKKSA.js} +2 -2
- package/dist/{snapshot-BPYTJ4C4.js → snapshot-5AGGUQKE.js} +3 -3
- package/dist/{src-5KXLTZQQ.js → src-AIM5FPLZ.js} +15 -2
- package/dist/{status-T56ADODQ.js → status-HVQI4E5X.js} +4 -4
- package/dist/{technical-aeo-W5VS6DYU.js → technical-aeo-S4OFCURE.js} +3 -3
- package/dist/{telemetry-4V3L3ZQ2.js → telemetry-SPSC5MUN.js} +4 -4
- package/dist/{tools-M4S6JACN.js → tools-LRHO7QOT.js} +11 -11
- package/dist/{traffic-ESXWT2F2.js → traffic-5AXVN37M.js} +5 -5
- package/dist/{users-YCOSFESL.js → users-WFKSUCGV.js} +3 -3
- package/dist/{visibility-stats-AA4AQPSL.js → visibility-stats-5S26GC27.js} +3 -3
- package/dist/{wordpress-GSONHGOA.js → wordpress-IUPZC7II.js} +3 -3
- package/package.json +2 -1
- package/assets/assets/MeasurementPropertyPage-C68Gtag-.js +0 -4
- package/assets/assets/ProjectPage-BLdhBCRJ.js +0 -7
- package/assets/assets/RunsPage-qnNeAXTI.js +0 -1
- package/assets/assets/SiteHealthSection-DUYFjszN.js +0 -2
- package/assets/assets/ToneBadge-Yt2Lm4cB.js +0 -60
- package/assets/assets/index-C04O5pbQ.js +0 -56
- package/assets/assets/query-client-CmCGzr9j.js +0 -1
- package/assets/assets/react-query-CWskqnJ3.js +0 -1
- package/dist/intelligence-service-B266DYRT.js +0 -15
|
@@ -3421,6 +3421,17 @@ function hostOf(value) {
|
|
|
3421
3421
|
const hostname = getHostname(trimmed);
|
|
3422
3422
|
return hostname ? hostname.replace(/^www\./i, "").toLowerCase() : null;
|
|
3423
3423
|
}
|
|
3424
|
+
function normalizeHostname(input) {
|
|
3425
|
+
const value = input.trim();
|
|
3426
|
+
if (!value || /[\s/\\:@?#%]/.test(value) || value.endsWith(".")) return null;
|
|
3427
|
+
try {
|
|
3428
|
+
const host = new URL(`https://${value}`).hostname.toLowerCase();
|
|
3429
|
+
if (/^\d+\.\d+\.\d+\.\d+$/.test(host) || host.length > 253 || host.split(".").some((label) => !/^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$/.test(label))) return null;
|
|
3430
|
+
return host;
|
|
3431
|
+
} catch {
|
|
3432
|
+
return null;
|
|
3433
|
+
}
|
|
3434
|
+
}
|
|
3424
3435
|
function registrableDomain(value) {
|
|
3425
3436
|
if (value == null || value.trim() === "") return "";
|
|
3426
3437
|
return getDomain2(value, DOMAIN_PARSE_OPTIONS)?.toLowerCase() ?? "";
|
|
@@ -6159,6 +6170,42 @@ function compileMeasurementPlanPreview(input, context) {
|
|
|
6159
6170
|
function canonicalMeasurementPlanJson(plan) {
|
|
6160
6171
|
return JSON.stringify(canonicalJsonValue2(plan));
|
|
6161
6172
|
}
|
|
6173
|
+
function parseMeasurementUrl(value) {
|
|
6174
|
+
const trimmed = value.trim();
|
|
6175
|
+
if (!trimmed) return null;
|
|
6176
|
+
try {
|
|
6177
|
+
const parsed = new URL(trimmed.includes("://") ? trimmed : `https://${trimmed}`);
|
|
6178
|
+
if (parsed.protocol !== "http:" && parsed.protocol !== "https:") return null;
|
|
6179
|
+
const host = normalizeMeasurementHost(parsed.hostname);
|
|
6180
|
+
return { host, pathname: canonicalizeMeasurementPath(parsed.pathname || "/") };
|
|
6181
|
+
} catch {
|
|
6182
|
+
return null;
|
|
6183
|
+
}
|
|
6184
|
+
}
|
|
6185
|
+
function equalPath(left, right, pathCase) {
|
|
6186
|
+
return pathCase === "insensitive" ? foldPathCase(left) === foldPathCase(right) : left === right;
|
|
6187
|
+
}
|
|
6188
|
+
function hasPathPrefix(pathname, prefix, pathCase) {
|
|
6189
|
+
const actual = pathCase === "insensitive" ? foldPathCase(pathname) : pathname;
|
|
6190
|
+
const expected = pathCase === "insensitive" ? foldPathCase(prefix) : prefix;
|
|
6191
|
+
return expected === "/" || actual === expected || actual.startsWith(`${expected}/`);
|
|
6192
|
+
}
|
|
6193
|
+
function matchesMeasurementTargetUrl(url, input) {
|
|
6194
|
+
const parsedMatcher = measurementTargetUrlMatcherSchema.safeParse(input);
|
|
6195
|
+
const parsedUrl = parseMeasurementUrl(url);
|
|
6196
|
+
if (!parsedMatcher.success || !parsedUrl) return false;
|
|
6197
|
+
const matcher = parsedMatcher.data;
|
|
6198
|
+
const parts = matcherParts(matcher);
|
|
6199
|
+
if (parsedUrl.host !== parts.host) return false;
|
|
6200
|
+
switch (matcher.kind) {
|
|
6201
|
+
case "host":
|
|
6202
|
+
return true;
|
|
6203
|
+
case "prefix":
|
|
6204
|
+
return hasPathPrefix(parsedUrl.pathname, matcher.pathPrefix, matcher.pathCase);
|
|
6205
|
+
case "exact":
|
|
6206
|
+
return equalPath(parsedUrl.pathname, parts.pathname, matcher.pathCase);
|
|
6207
|
+
}
|
|
6208
|
+
}
|
|
6162
6209
|
|
|
6163
6210
|
// ../contracts/src/answer-evidence.ts
|
|
6164
6211
|
import { z as z13 } from "zod";
|
|
@@ -6611,7 +6658,8 @@ var runKindSchema = z17.enum([
|
|
|
6611
6658
|
"gbp-sync",
|
|
6612
6659
|
"ads-sync",
|
|
6613
6660
|
"google-ads-sync",
|
|
6614
|
-
"gtm-sync"
|
|
6661
|
+
"gtm-sync",
|
|
6662
|
+
"seo-sync"
|
|
6615
6663
|
]);
|
|
6616
6664
|
var RunKinds = runKindSchema.enum;
|
|
6617
6665
|
var runListFilterQuerySchema = z17.object({
|
|
@@ -13142,6 +13190,7 @@ var LIVE_READ_OPERATIONS = /* @__PURE__ */ new Set([
|
|
|
13142
13190
|
"POST /api/v1/projects/{name}/measurement-discovery"
|
|
13143
13191
|
]);
|
|
13144
13192
|
var READ_SEMANTIC_OPERATIONS = /* @__PURE__ */ new Set([
|
|
13193
|
+
"POST /api/v1/projects/{name}/seo/refresh-intents",
|
|
13145
13194
|
"POST /api/v1/projects/{name}/measurement-plan/compile-preview",
|
|
13146
13195
|
"POST /api/v1/projects/{name}/measurement-plan/diff-preview",
|
|
13147
13196
|
"POST /api/v1/projects/{name}/measurement-plan/draft/actions/preview-assignments",
|
|
@@ -13160,6 +13209,17 @@ var WRITE_OPERATIONS = /* @__PURE__ */ new Set([
|
|
|
13160
13209
|
"GET /api/v1/projects/{name}/bing/coverage"
|
|
13161
13210
|
]);
|
|
13162
13211
|
var STORED_READ_OPERATIONS = /* @__PURE__ */ new Set([
|
|
13212
|
+
"GET /api/v1/seo/operator/tasks/{id}",
|
|
13213
|
+
"GET /api/v1/projects/{name}/seo/context",
|
|
13214
|
+
"GET /api/v1/projects/{name}/seo/status",
|
|
13215
|
+
"GET /api/v1/projects/{name}/seo/profiles",
|
|
13216
|
+
"GET /api/v1/projects/{name}/seo/profiles/{id}",
|
|
13217
|
+
"GET /api/v1/projects/{name}/seo/runs",
|
|
13218
|
+
"GET /api/v1/projects/{name}/seo/runs/{id}",
|
|
13219
|
+
"GET /api/v1/projects/{name}/seo/overview",
|
|
13220
|
+
"GET /api/v1/projects/{name}/seo/keyword-metrics",
|
|
13221
|
+
"GET /api/v1/projects/{name}/seo/domain-intelligence",
|
|
13222
|
+
"GET /api/v1/projects/{name}/seo/ranked-keywords",
|
|
13163
13223
|
"GET /api/v1/projects/{name}/gbp/local-post-attempt",
|
|
13164
13224
|
"GET /api/v1/openapi.json",
|
|
13165
13225
|
"GET /api/v1/screenshots/{snapshotId}",
|
|
@@ -18209,14 +18269,14 @@ function median(values) {
|
|
|
18209
18269
|
const middle = Math.floor(sorted.length / 2);
|
|
18210
18270
|
return sorted.length % 2 === 1 ? sorted[middle] : (sorted[middle - 1] + sorted[middle]) / 2;
|
|
18211
18271
|
}
|
|
18212
|
-
function wilsonInterval(successes, n,
|
|
18272
|
+
function wilsonInterval(successes, n, z91 = 1.96) {
|
|
18213
18273
|
if (!Number.isFinite(n) || n <= 0) return null;
|
|
18214
18274
|
const s = Math.max(0, Math.min(successes, n));
|
|
18215
18275
|
const p = s / n;
|
|
18216
|
-
const z210 =
|
|
18276
|
+
const z210 = z91 * z91;
|
|
18217
18277
|
const denom = 1 + z210 / n;
|
|
18218
18278
|
const center = (p + z210 / (2 * n)) / denom;
|
|
18219
|
-
const margin =
|
|
18279
|
+
const margin = z91 / denom * Math.sqrt(p * (1 - p) / n + z210 / (4 * n * n));
|
|
18220
18280
|
return {
|
|
18221
18281
|
low: round(Math.max(0, center - margin)),
|
|
18222
18282
|
high: round(Math.min(1, center + margin))
|
|
@@ -20196,6 +20256,8 @@ var gbpLiveReviewsSchema = z59.object({
|
|
|
20196
20256
|
var READ_ONLY_SCOPE = "read";
|
|
20197
20257
|
var WILDCARD_SCOPE = "*";
|
|
20198
20258
|
var RESEARCH_RUN_SCOPE = "research.run";
|
|
20259
|
+
var SEO_RUN_SCOPE = "seo.run";
|
|
20260
|
+
var SEO_WRITE_SCOPE = "seo.write";
|
|
20199
20261
|
var PROJECTS_WRITE_SCOPE = "projects.write";
|
|
20200
20262
|
var ADS_WRITE_SCOPE = "ads.write";
|
|
20201
20263
|
var ADS_APPROVE_SCOPE = "ads.approve";
|
|
@@ -20203,11 +20265,11 @@ var ADS_ACTIVATE_SCOPE = "ads.activate";
|
|
|
20203
20265
|
var GOOGLE_MARKETING_LIVE_READ_SCOPE = "google-marketing.read-live";
|
|
20204
20266
|
var GOOGLE_MARKETING_WRITE_SCOPE = "google-marketing.write";
|
|
20205
20267
|
function grantsWrite(scope) {
|
|
20206
|
-
return scope === WILDCARD_SCOPE || scope === "write" || scope.endsWith(".write") || scope === ADS_APPROVE_SCOPE || scope === ADS_ACTIVATE_SCOPE || scope === RESEARCH_RUN_SCOPE;
|
|
20268
|
+
return scope === WILDCARD_SCOPE || scope === "write" || scope.endsWith(".write") || scope === ADS_APPROVE_SCOPE || scope === ADS_ACTIVATE_SCOPE || scope === RESEARCH_RUN_SCOPE || scope === SEO_RUN_SCOPE;
|
|
20207
20269
|
}
|
|
20208
20270
|
function restrictedWriteScopes(scopes) {
|
|
20209
20271
|
const writes = scopes.filter(grantsWrite);
|
|
20210
|
-
const restricted = /* @__PURE__ */ new Set([ADS_WRITE_SCOPE, ADS_APPROVE_SCOPE, ADS_ACTIVATE_SCOPE, RESEARCH_RUN_SCOPE, GBP_POSTS_WRITE_SCOPE]);
|
|
20272
|
+
const restricted = /* @__PURE__ */ new Set([ADS_WRITE_SCOPE, ADS_APPROVE_SCOPE, ADS_ACTIVATE_SCOPE, RESEARCH_RUN_SCOPE, SEO_RUN_SCOPE, SEO_WRITE_SCOPE, GBP_POSTS_WRITE_SCOPE]);
|
|
20211
20273
|
return writes.length > 0 && writes.every((scope) => restricted.has(scope)) ? writes : null;
|
|
20212
20274
|
}
|
|
20213
20275
|
function intersectScopes(authority, requested) {
|
|
@@ -20716,19 +20778,260 @@ function uncheckedSourcesLabel(value) {
|
|
|
20716
20778
|
return `${value.unchecked} of ${total} ${total === 1 ? "answer" : "answers"} had sources that could not be checked`;
|
|
20717
20779
|
}
|
|
20718
20780
|
|
|
20719
|
-
// ../contracts/src/
|
|
20781
|
+
// ../contracts/src/seo.ts
|
|
20720
20782
|
import { z as z64 } from "zod";
|
|
20721
|
-
var
|
|
20783
|
+
var seoCapabilitySchema = z64.enum(["keyword-metrics", "domain-intelligence", "ranked-keywords"]);
|
|
20784
|
+
var SeoCapabilities = seoCapabilitySchema.enum;
|
|
20785
|
+
var seoProviderSchema = z64.enum(["dataforseo"]);
|
|
20786
|
+
var SeoProviders = seoProviderSchema.enum;
|
|
20787
|
+
var seoTargetKindSchema = z64.enum(["domain", "host"]);
|
|
20788
|
+
var SeoTargetKinds = seoTargetKindSchema.enum;
|
|
20789
|
+
var seoScopeKindSchema = z64.enum(["project", "group", "market", "property"]);
|
|
20790
|
+
var SeoScopeKinds = seoScopeKindSchema.enum;
|
|
20791
|
+
var seoRunStatusSchema = z64.enum(["queued", "running", "completed", "partial", "failed", "cancelled", "reconciliation-required"]);
|
|
20792
|
+
var SeoRunStatuses = seoRunStatusSchema.enum;
|
|
20793
|
+
var seoAvailabilitySchema = z64.enum(["ready", "unavailable"]);
|
|
20794
|
+
var SeoAvailability = seoAvailabilitySchema.enum;
|
|
20795
|
+
var seoTargetSchema = z64.object({
|
|
20796
|
+
kind: seoTargetKindSchema,
|
|
20797
|
+
value: z64.string().min(1).max(253),
|
|
20798
|
+
includeSubdomains: z64.boolean()
|
|
20799
|
+
}).strict();
|
|
20800
|
+
var seoScopeSelectionSchema = z64.object({
|
|
20801
|
+
kind: seoScopeKindSchema,
|
|
20802
|
+
key: z64.string().min(1).max(200).optional(),
|
|
20803
|
+
expectedPlanRevision: z64.number().int().nonnegative().optional()
|
|
20804
|
+
}).strict();
|
|
20805
|
+
var seoProfileInputSchema = z64.object({
|
|
20806
|
+
name: z64.string().trim().min(1).max(120),
|
|
20807
|
+
connectionId: z64.string().min(1).max(100),
|
|
20808
|
+
capabilities: z64.array(seoCapabilitySchema).min(1).max(3),
|
|
20809
|
+
targets: z64.array(seoTargetSchema).max(20),
|
|
20810
|
+
keywords: z64.array(z64.string().trim().min(1).max(80).regex(/^\S+(?:\s+\S+){0,9}$/, "Use at most 10 words per keyword.")).max(700),
|
|
20811
|
+
locationCode: z64.number().int().positive(),
|
|
20812
|
+
languageCode: z64.string().min(2).max(10),
|
|
20813
|
+
limit: z64.number().int().min(1).max(1e3),
|
|
20814
|
+
scope: seoScopeSelectionSchema
|
|
20815
|
+
}).strict();
|
|
20816
|
+
var seoProfileSchema = seoProfileInputSchema.extend({
|
|
20817
|
+
id: z64.string(),
|
|
20818
|
+
revision: z64.number().int().positive(),
|
|
20819
|
+
createdAt: z64.string(),
|
|
20820
|
+
updatedAt: z64.string()
|
|
20821
|
+
});
|
|
20822
|
+
var seoProfileListSchema = z64.object({ profiles: z64.array(seoProfileSchema) }).strict();
|
|
20823
|
+
var seoConnectionSummarySchema = z64.object({
|
|
20722
20824
|
id: z64.string(),
|
|
20723
|
-
|
|
20825
|
+
label: z64.string(),
|
|
20826
|
+
provider: seoProviderSchema,
|
|
20827
|
+
capabilities: z64.array(seoCapabilitySchema)
|
|
20828
|
+
}).strict();
|
|
20829
|
+
var seoContextSchema = z64.object({
|
|
20830
|
+
available: z64.boolean(),
|
|
20831
|
+
reason: z64.string().nullable(),
|
|
20832
|
+
connections: z64.array(seoConnectionSummarySchema),
|
|
20833
|
+
scopes: z64.array(z64.object({
|
|
20834
|
+
kind: seoScopeKindSchema,
|
|
20835
|
+
key: z64.string().nullable(),
|
|
20836
|
+
label: z64.string(),
|
|
20837
|
+
planRevision: z64.number().int().nonnegative().optional(),
|
|
20838
|
+
supported: z64.boolean(),
|
|
20839
|
+
reason: z64.string().nullable(),
|
|
20840
|
+
capabilities: z64.array(seoCapabilitySchema).optional()
|
|
20841
|
+
}).strict()),
|
|
20842
|
+
access: z64.object({ canRun: z64.boolean(), canWrite: z64.boolean() }).strict()
|
|
20843
|
+
}).strict();
|
|
20844
|
+
var seoStatusSchema = z64.object({
|
|
20845
|
+
available: z64.boolean(),
|
|
20846
|
+
reason: z64.string().nullable(),
|
|
20847
|
+
capabilities: z64.array(seoCapabilitySchema),
|
|
20848
|
+
profileCount: z64.number().int().nonnegative(),
|
|
20849
|
+
latestRunId: z64.string().nullable(),
|
|
20850
|
+
latestRunStatus: seoRunStatusSchema.nullable(),
|
|
20851
|
+
lastCompletedAt: z64.string().nullable()
|
|
20852
|
+
}).strict();
|
|
20853
|
+
var seoEstimateInputSchema = z64.object({ profileId: z64.string().min(1) }).strict();
|
|
20854
|
+
var seoRefreshIntentInputSchema = seoEstimateInputSchema;
|
|
20855
|
+
var seoQuoteSchema = z64.object({
|
|
20856
|
+
token: z64.string(),
|
|
20857
|
+
expiresAt: z64.string(),
|
|
20858
|
+
profileId: z64.string(),
|
|
20859
|
+
profileRevision: z64.number().int().positive(),
|
|
20860
|
+
taskCount: z64.number().int().nonnegative(),
|
|
20861
|
+
targets: z64.array(seoTargetSchema),
|
|
20862
|
+
capabilities: z64.array(seoCapabilitySchema),
|
|
20863
|
+
availability: seoAvailabilitySchema,
|
|
20864
|
+
reason: z64.string().nullable()
|
|
20865
|
+
}).strict();
|
|
20866
|
+
var seoSyncInputSchema = z64.object({
|
|
20867
|
+
quoteToken: z64.string().min(1).max(16384),
|
|
20868
|
+
idempotencyKey: z64.string().min(1).max(200)
|
|
20869
|
+
}).strict();
|
|
20870
|
+
var seoProvenanceSchema = z64.object({
|
|
20871
|
+
provider: seoProviderSchema,
|
|
20872
|
+
dataset: z64.string(),
|
|
20873
|
+
engine: z64.literal("google"),
|
|
20874
|
+
locationCode: z64.number().int().positive(),
|
|
20875
|
+
languageCode: z64.string(),
|
|
20876
|
+
device: z64.literal("unspecified"),
|
|
20877
|
+
collectedAt: z64.string(),
|
|
20878
|
+
sourceUpdatedAt: z64.string().nullable()
|
|
20879
|
+
}).strict();
|
|
20880
|
+
var seoMonthlyVolumeSchema = z64.object({
|
|
20881
|
+
year: z64.number().int(),
|
|
20882
|
+
month: z64.number().int().min(1).max(12),
|
|
20883
|
+
searchVolume: z64.number().int().nonnegative().nullable()
|
|
20884
|
+
}).strict();
|
|
20885
|
+
var seoKeywordMetricsSchema = z64.object({
|
|
20886
|
+
keyword: z64.string(),
|
|
20887
|
+
searchVolume: z64.number().int().nonnegative().nullable(),
|
|
20888
|
+
cpcUsd: z64.number().nonnegative().nullable(),
|
|
20889
|
+
adCompetition: fraction(z64.number().min(0).max(1)).nullable(),
|
|
20890
|
+
keywordDifficulty: z64.number().min(0).max(100).nullable().describe("Provider difficulty score on a 0\u2013100 scale; not a percentage."),
|
|
20891
|
+
searchIntent: z64.string().nullable(),
|
|
20892
|
+
monthlySearches: z64.array(seoMonthlyVolumeSchema),
|
|
20893
|
+
coreKeyword: z64.string().nullable(),
|
|
20894
|
+
provenance: seoProvenanceSchema
|
|
20895
|
+
}).strict();
|
|
20896
|
+
var seoDomainIntelligenceSchema = z64.object({
|
|
20897
|
+
target: seoTargetSchema,
|
|
20898
|
+
organicKeywords: z64.number().int().nonnegative().nullable(),
|
|
20899
|
+
estimatedOrganicTraffic: z64.number().nonnegative().nullable(),
|
|
20900
|
+
estimatedOrganicTrafficValueUsd: z64.number().nonnegative().nullable(),
|
|
20901
|
+
top1: z64.number().int().nonnegative().nullable(),
|
|
20902
|
+
top2To3: z64.number().int().nonnegative().nullable(),
|
|
20903
|
+
top4To10: z64.number().int().nonnegative().nullable(),
|
|
20904
|
+
top11To20: z64.number().int().nonnegative().nullable(),
|
|
20905
|
+
provenance: seoProvenanceSchema
|
|
20906
|
+
}).strict();
|
|
20907
|
+
var seoRankedKeywordSchema = z64.object({
|
|
20908
|
+
target: seoTargetSchema,
|
|
20909
|
+
keyword: z64.string(),
|
|
20910
|
+
url: z64.string().nullable(),
|
|
20911
|
+
rankOrganic: z64.number().int().positive().nullable(),
|
|
20912
|
+
rankAbsolute: z64.number().int().positive().nullable(),
|
|
20913
|
+
searchVolume: z64.number().int().nonnegative().nullable(),
|
|
20914
|
+
estimatedTraffic: z64.number().nonnegative().nullable(),
|
|
20915
|
+
cpcUsd: z64.number().nonnegative().nullable(),
|
|
20916
|
+
keywordDifficulty: z64.number().min(0).max(100).nullable().describe("Provider difficulty score on a 0\u2013100 scale; not a percentage."),
|
|
20917
|
+
serpFeatures: z64.array(z64.string()),
|
|
20918
|
+
provenance: seoProvenanceSchema
|
|
20919
|
+
}).strict();
|
|
20920
|
+
var seoResultsSchema = z64.object({
|
|
20921
|
+
keywordMetrics: z64.array(seoKeywordMetricsSchema),
|
|
20922
|
+
domainIntelligence: z64.array(seoDomainIntelligenceSchema),
|
|
20923
|
+
rankedKeywords: z64.array(seoRankedKeywordSchema)
|
|
20924
|
+
}).strict();
|
|
20925
|
+
function emptySeoResults() {
|
|
20926
|
+
return { keywordMetrics: [], domainIntelligence: [], rankedKeywords: [] };
|
|
20927
|
+
}
|
|
20928
|
+
var seoRunSchema = z64.object({
|
|
20929
|
+
id: z64.string(),
|
|
20930
|
+
projectId: z64.string(),
|
|
20931
|
+
profileId: z64.string(),
|
|
20932
|
+
profileRevision: z64.number().int().positive(),
|
|
20933
|
+
locationCode: z64.number().int().positive(),
|
|
20934
|
+
languageCode: z64.string(),
|
|
20935
|
+
cancelRequested: z64.boolean(),
|
|
20936
|
+
status: seoRunStatusSchema,
|
|
20937
|
+
capabilities: z64.array(seoCapabilitySchema),
|
|
20938
|
+
scope: seoScopeSelectionSchema,
|
|
20939
|
+
taskCount: z64.number().int().nonnegative(),
|
|
20940
|
+
completedTasks: z64.number().int().nonnegative(),
|
|
20941
|
+
failedTasks: z64.number().int().nonnegative(),
|
|
20942
|
+
createdAt: z64.string(),
|
|
20943
|
+
startedAt: z64.string().nullable(),
|
|
20944
|
+
finishedAt: z64.string().nullable(),
|
|
20945
|
+
error: z64.string().nullable()
|
|
20946
|
+
}).strict();
|
|
20947
|
+
var seoTaskSchema = z64.object({
|
|
20948
|
+
id: z64.string(),
|
|
20949
|
+
capability: seoCapabilitySchema,
|
|
20950
|
+
target: seoTargetSchema.nullable(),
|
|
20951
|
+
status: seoRunStatusSchema,
|
|
20952
|
+
error: z64.string().nullable(),
|
|
20953
|
+
remoteTaskId: z64.string().nullable()
|
|
20954
|
+
}).strict();
|
|
20955
|
+
var seoResultCountsSchema = z64.object({
|
|
20956
|
+
keywordMetrics: z64.number().int().nonnegative(),
|
|
20957
|
+
domainIntelligence: z64.number().int().nonnegative(),
|
|
20958
|
+
rankedKeywords: z64.number().int().nonnegative()
|
|
20959
|
+
}).strict();
|
|
20960
|
+
var seoRunDetailSchema = seoRunSchema.extend({
|
|
20961
|
+
tasks: z64.array(seoTaskSchema),
|
|
20962
|
+
results: seoResultsSchema,
|
|
20963
|
+
resultCounts: seoResultCountsSchema,
|
|
20964
|
+
resultsTruncated: z64.boolean()
|
|
20965
|
+
});
|
|
20966
|
+
var seoRunListSchema = z64.object({ runs: z64.array(seoRunSchema) }).strict();
|
|
20967
|
+
var seoEvidenceQuerySchema = z64.object({
|
|
20968
|
+
profileId: z64.string().optional(),
|
|
20969
|
+
runId: z64.string().optional(),
|
|
20970
|
+
limit: z64.number().int().min(1).max(100).optional(),
|
|
20971
|
+
offset: z64.number().int().min(0).max(1e5).optional()
|
|
20972
|
+
}).strict();
|
|
20973
|
+
var seoPageShape = {
|
|
20974
|
+
runId: z64.string().nullable(),
|
|
20975
|
+
total: z64.number().int().nonnegative(),
|
|
20976
|
+
limit: z64.number().int().min(1).max(100),
|
|
20977
|
+
offset: z64.number().int().nonnegative()
|
|
20978
|
+
};
|
|
20979
|
+
var seoKeywordMetricsListSchema = z64.object({ ...seoPageShape, items: z64.array(seoKeywordMetricsSchema) }).strict();
|
|
20980
|
+
var seoDomainIntelligenceListSchema = z64.object({ ...seoPageShape, items: z64.array(seoDomainIntelligenceSchema) }).strict();
|
|
20981
|
+
var seoRankedKeywordListSchema = z64.object({ ...seoPageShape, items: z64.array(seoRankedKeywordSchema) }).strict();
|
|
20982
|
+
var seoOverviewSchema = z64.object({
|
|
20983
|
+
status: seoStatusSchema,
|
|
20984
|
+
profiles: z64.array(seoProfileSchema),
|
|
20985
|
+
latestRun: seoRunSchema.nullable(),
|
|
20986
|
+
evidenceRunId: z64.string().nullable(),
|
|
20987
|
+
evidenceRun: seoRunSchema.nullable(),
|
|
20988
|
+
summary: z64.object({
|
|
20989
|
+
target: seoTargetSchema,
|
|
20990
|
+
organicKeywords: z64.number().int().nonnegative().nullable(),
|
|
20991
|
+
inTop10: z64.number().int().nonnegative().nullable(),
|
|
20992
|
+
estimatedOrganicTraffic: z64.number().nonnegative().nullable(),
|
|
20993
|
+
provenance: seoProvenanceSchema
|
|
20994
|
+
}).strict().nullable(),
|
|
20995
|
+
keywordMetricsCount: z64.number().int().nonnegative(),
|
|
20996
|
+
domainIntelligenceCount: z64.number().int().nonnegative(),
|
|
20997
|
+
rankedKeywordCount: z64.number().int().nonnegative()
|
|
20998
|
+
}).strict();
|
|
20999
|
+
var seoMicrosSchema = z64.number().int().min(0).max(Number.MAX_SAFE_INTEGER);
|
|
21000
|
+
var seoOperatorTaskSchema = z64.object({
|
|
21001
|
+
id: z64.string(),
|
|
21002
|
+
runId: z64.string(),
|
|
21003
|
+
status: seoRunStatusSchema,
|
|
21004
|
+
reservedCostMicros: seoMicrosSchema,
|
|
21005
|
+
actualCostMicros: seoMicrosSchema.nullable(),
|
|
21006
|
+
receipts: z64.array(z64.object({
|
|
21007
|
+
remoteTaskId: z64.string().nullable(),
|
|
21008
|
+
statusCode: z64.number().int().nullable(),
|
|
21009
|
+
costMicros: seoMicrosSchema.nullable()
|
|
21010
|
+
}).strict())
|
|
21011
|
+
}).strict();
|
|
21012
|
+
var seoReconcileInputSchema = z64.object({
|
|
21013
|
+
actualCostMicros: seoMicrosSchema,
|
|
21014
|
+
remoteTaskId: z64.string().min(1).max(255),
|
|
21015
|
+
outcome: z64.enum(["completed", "failed"]),
|
|
21016
|
+
note: z64.string().trim().min(10).max(2e3)
|
|
21017
|
+
}).strict();
|
|
21018
|
+
var seoReconcileResultSchema = z64.object({ id: z64.string(), status: seoRunStatusSchema }).strict();
|
|
21019
|
+
var seoAdapterOutcomeSchema = z64.enum(["completed", "partial", "failed", "unknown"]);
|
|
21020
|
+
var SeoAdapterOutcomes = seoAdapterOutcomeSchema.enum;
|
|
21021
|
+
|
|
21022
|
+
// ../contracts/src/api-keys.ts
|
|
21023
|
+
import { z as z65 } from "zod";
|
|
21024
|
+
var apiKeyDtoSchema = z65.object({
|
|
21025
|
+
id: z65.string(),
|
|
21026
|
+
name: z65.string(),
|
|
20724
21027
|
/** First 9 chars of the raw token (`cnry_` + 4 hex). Safe to display. */
|
|
20725
|
-
keyPrefix:
|
|
20726
|
-
scopes:
|
|
21028
|
+
keyPrefix: z65.string(),
|
|
21029
|
+
scopes: z65.array(z65.string()),
|
|
20727
21030
|
/**
|
|
20728
21031
|
* The project this key is scoped to, or `null` for a full-instance key. A
|
|
20729
21032
|
* scoped key may only read/write its own project (enforced server-side).
|
|
20730
21033
|
*/
|
|
20731
|
-
projectId:
|
|
21034
|
+
projectId: z65.string().nullable(),
|
|
20732
21035
|
/**
|
|
20733
21036
|
* The scoped project's name, or `null` for a full-instance key. Resolved
|
|
20734
21037
|
* server-side so a surface listing keys does not have to fetch every project
|
|
@@ -20736,89 +21039,89 @@ var apiKeyDtoSchema = z64.object({
|
|
|
20736
21039
|
* "is this key safe to hand to someone", which is the question the list is
|
|
20737
21040
|
* usually open to answer. Additive field.
|
|
20738
21041
|
*/
|
|
20739
|
-
projectName:
|
|
21042
|
+
projectName: z65.string().nullable(),
|
|
20740
21043
|
/**
|
|
20741
21044
|
* Server-derived convenience flag: `true` when this key is read-only (carries
|
|
20742
21045
|
* the `read` scope and no write-granting scope), in which case the API rejects
|
|
20743
21046
|
* every write HTTP method for it. Derived from `scopes` via `isReadOnlyKey`
|
|
20744
21047
|
* — surfaces don't recompute it (see the UI/CLI parity rule). Additive field.
|
|
20745
21048
|
*/
|
|
20746
|
-
readOnly:
|
|
21049
|
+
readOnly: z65.boolean(),
|
|
20747
21050
|
/** Present on /keys/self: host-derived direct-bearer authority, never a mintable scope. */
|
|
20748
|
-
operator:
|
|
20749
|
-
createdAt:
|
|
20750
|
-
lastUsedAt:
|
|
20751
|
-
revokedAt:
|
|
21051
|
+
operator: z65.boolean().optional(),
|
|
21052
|
+
createdAt: z65.string(),
|
|
21053
|
+
lastUsedAt: z65.string().nullable(),
|
|
21054
|
+
revokedAt: z65.string().nullable()
|
|
20752
21055
|
});
|
|
20753
|
-
var apiKeyListDtoSchema =
|
|
20754
|
-
keys:
|
|
21056
|
+
var apiKeyListDtoSchema = z65.object({
|
|
21057
|
+
keys: z65.array(apiKeyDtoSchema)
|
|
20755
21058
|
});
|
|
20756
|
-
var createApiKeyRequestSchema =
|
|
20757
|
-
name:
|
|
21059
|
+
var createApiKeyRequestSchema = z65.object({
|
|
21060
|
+
name: z65.string().min(1).max(100),
|
|
20758
21061
|
/**
|
|
20759
21062
|
* Scopes granted to the new key. Omit to default to `['*']` (full access,
|
|
20760
21063
|
* what `canonry init` writes for the root key). When provided it must be a
|
|
20761
21064
|
* non-empty list — an empty array would mint a key that can do nothing.
|
|
20762
21065
|
*/
|
|
20763
|
-
scopes:
|
|
21066
|
+
scopes: z65.array(z65.string()).min(1).optional(),
|
|
20764
21067
|
/**
|
|
20765
21068
|
* Bind the new key to a SINGLE project (by project id). Omit for a
|
|
20766
21069
|
* full-instance key (the default). A scoped key may only read/write that
|
|
20767
21070
|
* project; the server validates the id exists at creation time.
|
|
20768
21071
|
*/
|
|
20769
|
-
projectId:
|
|
21072
|
+
projectId: z65.string().optional()
|
|
20770
21073
|
});
|
|
20771
21074
|
var createdApiKeyDtoSchema = apiKeyDtoSchema.extend({
|
|
20772
|
-
key:
|
|
21075
|
+
key: z65.string()
|
|
20773
21076
|
});
|
|
20774
21077
|
|
|
20775
21078
|
// ../contracts/src/config-schema.ts
|
|
20776
|
-
import { z as
|
|
21079
|
+
import { z as z67 } from "zod";
|
|
20777
21080
|
|
|
20778
21081
|
// ../contracts/src/schedule.ts
|
|
20779
|
-
import { z as
|
|
20780
|
-
var schedulableRunKindSchema =
|
|
21082
|
+
import { z as z66 } from "zod";
|
|
21083
|
+
var schedulableRunKindSchema = z66.enum(["answer-visibility", "traffic-sync", "gbp-sync", "data-refresh", "backlinks-sync", "site-audit", "ads-sync", "doctor"]);
|
|
20781
21084
|
var SchedulableRunKinds = schedulableRunKindSchema.enum;
|
|
20782
|
-
var calendarRecurrenceSchema =
|
|
20783
|
-
everyDays:
|
|
20784
|
-
startDate:
|
|
20785
|
-
time:
|
|
20786
|
-
}).strict();
|
|
20787
|
-
var scheduleDtoSchema =
|
|
20788
|
-
id:
|
|
20789
|
-
projectId:
|
|
21085
|
+
var calendarRecurrenceSchema = z66.object({
|
|
21086
|
+
everyDays: z66.number().int().min(1).max(3650),
|
|
21087
|
+
startDate: z66.string().date(),
|
|
21088
|
+
time: z66.string().regex(/^([01]\d|2[0-3]):[0-5]\d$/, "Time must be HH:mm")
|
|
21089
|
+
}).strict();
|
|
21090
|
+
var scheduleDtoSchema = z66.object({
|
|
21091
|
+
id: z66.string(),
|
|
21092
|
+
projectId: z66.string(),
|
|
20790
21093
|
/** Run kind dispatched when this schedule fires. Defaults to 'answer-visibility' for legacy rows. */
|
|
20791
21094
|
kind: schedulableRunKindSchema,
|
|
20792
21095
|
/** Empty for calendar recurrence schedules. */
|
|
20793
|
-
cronExpr:
|
|
21096
|
+
cronExpr: z66.string(),
|
|
20794
21097
|
recurrence: calendarRecurrenceSchema.nullable().optional(),
|
|
20795
|
-
preset:
|
|
20796
|
-
timezone:
|
|
20797
|
-
enabled:
|
|
20798
|
-
providers:
|
|
21098
|
+
preset: z66.string().nullable().optional(),
|
|
21099
|
+
timezone: z66.string().default("UTC"),
|
|
21100
|
+
enabled: z66.boolean().default(true),
|
|
21101
|
+
providers: z66.array(providerNameSchema).default([]),
|
|
20799
21102
|
/** Traffic-source UUID for `kind === 'traffic-sync'` schedules. Null otherwise. */
|
|
20800
|
-
sourceId:
|
|
20801
|
-
lastRunAt:
|
|
20802
|
-
nextRunAt:
|
|
20803
|
-
createdAt:
|
|
20804
|
-
updatedAt:
|
|
21103
|
+
sourceId: z66.string().nullable().optional(),
|
|
21104
|
+
lastRunAt: z66.string().nullable().optional(),
|
|
21105
|
+
nextRunAt: z66.string().nullable().optional(),
|
|
21106
|
+
createdAt: z66.string(),
|
|
21107
|
+
updatedAt: z66.string()
|
|
20805
21108
|
});
|
|
20806
|
-
var scheduleExpectedUpdatedAtSchema =
|
|
21109
|
+
var scheduleExpectedUpdatedAtSchema = z66.string().datetime();
|
|
20807
21110
|
function nextScheduleUpdatedAt(previous, nowMs = Date.now()) {
|
|
20808
21111
|
const previousMs = previous === void 0 ? Number.NaN : Date.parse(previous);
|
|
20809
21112
|
return new Date(Number.isFinite(previousMs) ? Math.max(nowMs, previousMs + 1) : nowMs).toISOString();
|
|
20810
21113
|
}
|
|
20811
|
-
var scheduleUpsertRequestSchema =
|
|
21114
|
+
var scheduleUpsertRequestSchema = z66.object({
|
|
20812
21115
|
/** Run kind. Defaults to 'answer-visibility' so existing callers don't have to change. */
|
|
20813
21116
|
kind: schedulableRunKindSchema.optional(),
|
|
20814
|
-
preset:
|
|
20815
|
-
cron:
|
|
21117
|
+
preset: z66.string().min(1).optional(),
|
|
21118
|
+
cron: z66.string().min(1).optional(),
|
|
20816
21119
|
recurrence: calendarRecurrenceSchema.optional(),
|
|
20817
|
-
timezone:
|
|
20818
|
-
enabled:
|
|
20819
|
-
providers:
|
|
21120
|
+
timezone: z66.string().optional().default("UTC"),
|
|
21121
|
+
enabled: z66.boolean().optional().default(true),
|
|
21122
|
+
providers: z66.array(providerNameSchema).optional().default([]),
|
|
20820
21123
|
/** Required when kind === 'traffic-sync'. Forbidden for other kinds. Validated server-side. */
|
|
20821
|
-
sourceId:
|
|
21124
|
+
sourceId: z66.string().optional(),
|
|
20822
21125
|
/**
|
|
20823
21126
|
* Optimistic concurrency guard. A timestamp updates only that exact version;
|
|
20824
21127
|
* null creates only while the schedule is absent. Omit for legacy behavior.
|
|
@@ -20830,18 +21133,18 @@ var scheduleUpsertRequestSchema = z65.object({
|
|
|
20830
21133
|
);
|
|
20831
21134
|
|
|
20832
21135
|
// ../contracts/src/config-schema.ts
|
|
20833
|
-
var configMetadataSchema =
|
|
20834
|
-
name:
|
|
21136
|
+
var configMetadataSchema = z67.object({
|
|
21137
|
+
name: z67.string().min(1).max(63).regex(/^[a-z0-9]([a-z0-9-]*[a-z0-9])?$/, {
|
|
20835
21138
|
message: "Name must be a lowercase slug (letters, numbers, hyphens)"
|
|
20836
21139
|
}),
|
|
20837
|
-
labels:
|
|
21140
|
+
labels: z67.record(z67.string(), z67.string()).optional().default({})
|
|
20838
21141
|
});
|
|
20839
|
-
var configScheduleObjectSchema =
|
|
20840
|
-
preset:
|
|
20841
|
-
cron:
|
|
21142
|
+
var configScheduleObjectSchema = z67.object({
|
|
21143
|
+
preset: z67.string().min(1).optional(),
|
|
21144
|
+
cron: z67.string().min(1).optional(),
|
|
20842
21145
|
recurrence: calendarRecurrenceSchema.optional(),
|
|
20843
|
-
timezone:
|
|
20844
|
-
providers:
|
|
21146
|
+
timezone: z67.string().optional().default("UTC"),
|
|
21147
|
+
providers: z67.array(providerNameSchema).optional().default([]),
|
|
20845
21148
|
/**
|
|
20846
21149
|
* Whether the schedule fires. Omit to leave an existing schedule's state
|
|
20847
21150
|
* alone — a schedule paused from the dashboard or the API stays paused
|
|
@@ -20849,59 +21152,59 @@ var configScheduleObjectSchema = z66.object({
|
|
|
20849
21152
|
* someone deliberately stopped. A schedule created by this apply defaults
|
|
20850
21153
|
* to enabled.
|
|
20851
21154
|
*/
|
|
20852
|
-
enabled:
|
|
21155
|
+
enabled: z67.boolean().optional()
|
|
20853
21156
|
});
|
|
20854
21157
|
function hasOneScheduleTiming(schedule) {
|
|
20855
21158
|
return [schedule.preset, schedule.cron, schedule.recurrence].filter((value) => value !== void 0).length === 1;
|
|
20856
21159
|
}
|
|
20857
21160
|
var oneScheduleTimingMessage = { message: 'Exactly one of "preset", "cron", or "recurrence" must be provided' };
|
|
20858
21161
|
var configScheduleSchema = configScheduleObjectSchema.refine(hasOneScheduleTiming, oneScheduleTimingMessage).optional();
|
|
20859
|
-
var configNotificationSchema =
|
|
20860
|
-
id:
|
|
20861
|
-
channel:
|
|
20862
|
-
url:
|
|
20863
|
-
events:
|
|
20864
|
-
});
|
|
20865
|
-
var configGoogleSchema =
|
|
20866
|
-
gsc:
|
|
20867
|
-
propertyUrl:
|
|
21162
|
+
var configNotificationSchema = z67.object({
|
|
21163
|
+
id: z67.string().min(1).optional(),
|
|
21164
|
+
channel: z67.literal("webhook"),
|
|
21165
|
+
url: z67.string().url(),
|
|
21166
|
+
events: z67.array(notificationEventSchema).min(1)
|
|
21167
|
+
});
|
|
21168
|
+
var configGoogleSchema = z67.object({
|
|
21169
|
+
gsc: z67.object({
|
|
21170
|
+
propertyUrl: z67.string()
|
|
20868
21171
|
}).optional(),
|
|
20869
|
-
syncSchedule:
|
|
20870
|
-
preset:
|
|
20871
|
-
cron:
|
|
21172
|
+
syncSchedule: z67.object({
|
|
21173
|
+
preset: z67.string().optional(),
|
|
21174
|
+
cron: z67.string().optional()
|
|
20872
21175
|
}).optional()
|
|
20873
21176
|
}).optional();
|
|
20874
|
-
var configQueryListSchema =
|
|
21177
|
+
var configQueryListSchema = z67.array(z67.string().min(1));
|
|
20875
21178
|
var configSpecShape = {
|
|
20876
|
-
displayName:
|
|
20877
|
-
canonicalDomain:
|
|
20878
|
-
ownedDomains:
|
|
20879
|
-
aliases:
|
|
21179
|
+
displayName: z67.string().min(1),
|
|
21180
|
+
canonicalDomain: z67.string().min(1),
|
|
21181
|
+
ownedDomains: z67.array(z67.string().min(1)).optional().default([]),
|
|
21182
|
+
aliases: z67.array(z67.string().min(1)).optional().default([]),
|
|
20880
21183
|
// No default on purpose: an apply that omits it keeps the project's stored
|
|
20881
21184
|
// list, minus names that no longer qualify against this spec's `aliases`,
|
|
20882
21185
|
// display name and competitors. Each entry must be an alias.
|
|
20883
|
-
qualifiedAliases:
|
|
20884
|
-
country:
|
|
20885
|
-
language:
|
|
21186
|
+
qualifiedAliases: z67.array(z67.string().min(1).max(PROJECT_QUALIFIED_ALIAS_MAX_LENGTH)).max(PROJECT_QUALIFIED_ALIAS_LIMIT).optional(),
|
|
21187
|
+
country: z67.string().length(2),
|
|
21188
|
+
language: z67.string().min(2),
|
|
20886
21189
|
queries: configQueryListSchema.optional(),
|
|
20887
21190
|
keywords: configQueryListSchema.optional(),
|
|
20888
21191
|
// Each entry is a bare domain or `{ domain, aliases }`. A bare domain (or an
|
|
20889
21192
|
// object without `aliases`) keeps that competitor's stored aliases on apply;
|
|
20890
21193
|
// `aliases` sets them exactly (`[]` clears). The domain set itself is still
|
|
20891
21194
|
// replaced by this list.
|
|
20892
|
-
competitors:
|
|
20893
|
-
providers:
|
|
21195
|
+
competitors: z67.array(competitorEntrySchema).optional().default([]),
|
|
21196
|
+
providers: z67.array(providerNameSchema).optional().default([]),
|
|
20894
21197
|
providerModels: providerModelsSchema.optional().default({}),
|
|
20895
21198
|
// No default on purpose: an apply that omits it leaves the project's stored
|
|
20896
21199
|
// preference alone, the same rule as `queries`.
|
|
20897
21200
|
providerDispatchModes: providerDispatchModesSchema.optional(),
|
|
20898
|
-
locations:
|
|
20899
|
-
defaultLocation:
|
|
21201
|
+
locations: z67.array(locationContextSchema).optional().default([]),
|
|
21202
|
+
defaultLocation: z67.string().optional(),
|
|
20900
21203
|
measurement: measurementConfigSchema.optional().default(defaultMeasurementConfig),
|
|
20901
21204
|
schedule: configScheduleSchema,
|
|
20902
|
-
notifications:
|
|
21205
|
+
notifications: z67.array(configNotificationSchema).optional().default([]),
|
|
20903
21206
|
google: configGoogleSchema,
|
|
20904
|
-
autoExtractBacklinks:
|
|
21207
|
+
autoExtractBacklinks: z67.boolean().optional().default(false),
|
|
20905
21208
|
/** Highest star rating that counts as a negative Google review (1-4). Omitted means the default of 3. */
|
|
20906
21209
|
negativeReviewMaxStars: gbpNegativeReviewMaxStarsSchema.optional(),
|
|
20907
21210
|
/**
|
|
@@ -20941,20 +21244,20 @@ function checkConfigSpec(spec, ctx) {
|
|
|
20941
21244
|
});
|
|
20942
21245
|
}
|
|
20943
21246
|
}
|
|
20944
|
-
var configSpecSchema =
|
|
20945
|
-
var projectConfigSchema =
|
|
20946
|
-
apiVersion:
|
|
20947
|
-
kind:
|
|
21247
|
+
var configSpecSchema = z67.object(configSpecShape).superRefine(checkConfigSpec);
|
|
21248
|
+
var projectConfigSchema = z67.object({
|
|
21249
|
+
apiVersion: z67.literal("canonry/v1"),
|
|
21250
|
+
kind: z67.literal("Project"),
|
|
20948
21251
|
metadata: configMetadataSchema,
|
|
20949
21252
|
spec: configSpecSchema
|
|
20950
21253
|
});
|
|
20951
21254
|
var projectConfigExportSchema = projectConfigSchema.extend({
|
|
20952
|
-
spec:
|
|
21255
|
+
spec: z67.object({
|
|
20953
21256
|
...configSpecShape,
|
|
20954
21257
|
queries: configQueryListSchema,
|
|
20955
21258
|
providerModels: providerModelsSchema.optional(),
|
|
20956
|
-
schedule: configScheduleObjectSchema.extend({ enabled:
|
|
20957
|
-
autoExtractBacklinks:
|
|
21259
|
+
schedule: configScheduleObjectSchema.extend({ enabled: z67.boolean() }).refine(hasOneScheduleTiming, oneScheduleTimingMessage).optional(),
|
|
21260
|
+
autoExtractBacklinks: z67.boolean().optional()
|
|
20958
21261
|
}).superRefine(checkConfigSpec)
|
|
20959
21262
|
});
|
|
20960
21263
|
function resolveConfigSpecQueries(spec) {
|
|
@@ -20962,134 +21265,134 @@ function resolveConfigSpecQueries(spec) {
|
|
|
20962
21265
|
}
|
|
20963
21266
|
|
|
20964
21267
|
// ../contracts/src/config-diff.ts
|
|
20965
|
-
import { z as
|
|
21268
|
+
import { z as z68 } from "zod";
|
|
20966
21269
|
function fieldChangeSchema(schema) {
|
|
20967
|
-
return
|
|
20968
|
-
}
|
|
20969
|
-
var projectFieldsStateSchema =
|
|
20970
|
-
displayName:
|
|
20971
|
-
canonicalDomain:
|
|
20972
|
-
ownedDomains:
|
|
20973
|
-
aliases:
|
|
20974
|
-
qualifiedAliases:
|
|
20975
|
-
country:
|
|
20976
|
-
language:
|
|
20977
|
-
labels:
|
|
20978
|
-
providers:
|
|
21270
|
+
return z68.object({ before: schema.nullable(), after: schema.nullable() });
|
|
21271
|
+
}
|
|
21272
|
+
var projectFieldsStateSchema = z68.object({
|
|
21273
|
+
displayName: z68.string().optional(),
|
|
21274
|
+
canonicalDomain: z68.string().optional(),
|
|
21275
|
+
ownedDomains: z68.array(z68.string()).optional(),
|
|
21276
|
+
aliases: z68.array(z68.string()).optional(),
|
|
21277
|
+
qualifiedAliases: z68.array(z68.string()).optional(),
|
|
21278
|
+
country: z68.string().optional(),
|
|
21279
|
+
language: z68.string().optional(),
|
|
21280
|
+
labels: z68.record(z68.string(), z68.string()).optional(),
|
|
21281
|
+
providers: z68.array(z68.string()).optional(),
|
|
20979
21282
|
providerModels: providerModelsSchema.optional(),
|
|
20980
21283
|
providerDispatchModes: providerDispatchModesSchema.optional(),
|
|
20981
21284
|
"measurement.marketingHosts": measurementConfigSchema.shape.marketingHosts.optional(),
|
|
20982
21285
|
"measurement.brandTerms": measurementConfigSchema.shape.brandTerms.optional(),
|
|
20983
21286
|
"measurement.leadEventNames": measurementConfigSchema.shape.leadEventNames.optional(),
|
|
20984
|
-
locations:
|
|
20985
|
-
defaultLocation:
|
|
20986
|
-
autoExtractBacklinks:
|
|
20987
|
-
negativeReviewMaxStars:
|
|
20988
|
-
siteAuditMaxPages:
|
|
20989
|
-
competitorAutoAliases:
|
|
21287
|
+
locations: z68.array(locationContextSchema).optional(),
|
|
21288
|
+
defaultLocation: z68.string().nullable().optional(),
|
|
21289
|
+
autoExtractBacklinks: z68.boolean().optional(),
|
|
21290
|
+
negativeReviewMaxStars: z68.number().int().nullable().optional(),
|
|
21291
|
+
siteAuditMaxPages: z68.number().int().nullable().optional(),
|
|
21292
|
+
competitorAutoAliases: z68.enum(["off", "preview", "apply"]).optional(),
|
|
20990
21293
|
configSource: configSourceSchema.optional()
|
|
20991
21294
|
}).strict();
|
|
20992
|
-
var projectFieldsChangeSchema =
|
|
20993
|
-
displayName: fieldChangeSchema(
|
|
20994
|
-
canonicalDomain: fieldChangeSchema(
|
|
20995
|
-
ownedDomains: fieldChangeSchema(
|
|
20996
|
-
aliases: fieldChangeSchema(
|
|
20997
|
-
qualifiedAliases: fieldChangeSchema(
|
|
20998
|
-
country: fieldChangeSchema(
|
|
20999
|
-
language: fieldChangeSchema(
|
|
21000
|
-
labels: fieldChangeSchema(
|
|
21001
|
-
providers: fieldChangeSchema(
|
|
21295
|
+
var projectFieldsChangeSchema = z68.object({
|
|
21296
|
+
displayName: fieldChangeSchema(z68.string()).optional(),
|
|
21297
|
+
canonicalDomain: fieldChangeSchema(z68.string()).optional(),
|
|
21298
|
+
ownedDomains: fieldChangeSchema(z68.array(z68.string())).optional(),
|
|
21299
|
+
aliases: fieldChangeSchema(z68.array(z68.string())).optional(),
|
|
21300
|
+
qualifiedAliases: fieldChangeSchema(z68.array(z68.string())).optional(),
|
|
21301
|
+
country: fieldChangeSchema(z68.string()).optional(),
|
|
21302
|
+
language: fieldChangeSchema(z68.string()).optional(),
|
|
21303
|
+
labels: fieldChangeSchema(z68.record(z68.string(), z68.string())).optional(),
|
|
21304
|
+
providers: fieldChangeSchema(z68.array(z68.string())).optional(),
|
|
21002
21305
|
providerModels: fieldChangeSchema(providerModelsSchema).optional(),
|
|
21003
21306
|
providerDispatchModes: fieldChangeSchema(providerDispatchModesSchema).optional(),
|
|
21004
21307
|
"measurement.marketingHosts": fieldChangeSchema(measurementConfigSchema.shape.marketingHosts).optional(),
|
|
21005
21308
|
"measurement.brandTerms": fieldChangeSchema(measurementConfigSchema.shape.brandTerms).optional(),
|
|
21006
21309
|
"measurement.leadEventNames": fieldChangeSchema(measurementConfigSchema.shape.leadEventNames).optional(),
|
|
21007
|
-
locations: fieldChangeSchema(
|
|
21008
|
-
defaultLocation: fieldChangeSchema(
|
|
21009
|
-
autoExtractBacklinks: fieldChangeSchema(
|
|
21010
|
-
negativeReviewMaxStars: fieldChangeSchema(
|
|
21011
|
-
siteAuditMaxPages: fieldChangeSchema(
|
|
21012
|
-
competitorAutoAliases: fieldChangeSchema(
|
|
21310
|
+
locations: fieldChangeSchema(z68.array(locationContextSchema)).optional(),
|
|
21311
|
+
defaultLocation: fieldChangeSchema(z68.string()).optional(),
|
|
21312
|
+
autoExtractBacklinks: fieldChangeSchema(z68.boolean()).optional(),
|
|
21313
|
+
negativeReviewMaxStars: fieldChangeSchema(z68.number().int()).optional(),
|
|
21314
|
+
siteAuditMaxPages: fieldChangeSchema(z68.number().int().nullable()).optional(),
|
|
21315
|
+
competitorAutoAliases: fieldChangeSchema(z68.enum(["off", "preview", "apply"])).optional(),
|
|
21013
21316
|
configSource: fieldChangeSchema(configSourceSchema).optional()
|
|
21014
21317
|
}).strict();
|
|
21015
|
-
var scheduleStateSchema =
|
|
21016
|
-
cron:
|
|
21017
|
-
preset:
|
|
21318
|
+
var scheduleStateSchema = z68.object({
|
|
21319
|
+
cron: z68.string().optional(),
|
|
21320
|
+
preset: z68.string().optional(),
|
|
21018
21321
|
recurrence: calendarRecurrenceSchema.optional(),
|
|
21019
|
-
timezone:
|
|
21020
|
-
providers:
|
|
21021
|
-
enabled:
|
|
21022
|
-
}).strict();
|
|
21023
|
-
var droppedAliasSchema =
|
|
21024
|
-
domain:
|
|
21025
|
-
alias:
|
|
21026
|
-
reason:
|
|
21027
|
-
conflictsWith:
|
|
21028
|
-
conflictingName:
|
|
21029
|
-
markets:
|
|
21030
|
-
}).strict();
|
|
21031
|
-
var configStateNotificationSchema =
|
|
21032
|
-
id:
|
|
21033
|
-
url:
|
|
21034
|
-
urlHost:
|
|
21035
|
-
events:
|
|
21036
|
-
enabled:
|
|
21037
|
-
source:
|
|
21038
|
-
});
|
|
21039
|
-
var projectConfigStateSchema =
|
|
21040
|
-
project:
|
|
21041
|
-
configRevision:
|
|
21322
|
+
timezone: z68.string(),
|
|
21323
|
+
providers: z68.array(z68.string()),
|
|
21324
|
+
enabled: z68.boolean()
|
|
21325
|
+
}).strict();
|
|
21326
|
+
var droppedAliasSchema = z68.object({
|
|
21327
|
+
domain: z68.string(),
|
|
21328
|
+
alias: z68.string(),
|
|
21329
|
+
reason: z68.enum(["too-long", "too-short", "project-brand", "other-competitor", "market-competitor", "claimed-by-alias"]),
|
|
21330
|
+
conflictsWith: z68.string().optional(),
|
|
21331
|
+
conflictingName: z68.string().optional(),
|
|
21332
|
+
markets: z68.array(z68.string()).optional()
|
|
21333
|
+
}).strict();
|
|
21334
|
+
var configStateNotificationSchema = z68.object({
|
|
21335
|
+
id: z68.string(),
|
|
21336
|
+
url: z68.string().optional(),
|
|
21337
|
+
urlHost: z68.string(),
|
|
21338
|
+
events: z68.array(z68.string()),
|
|
21339
|
+
enabled: z68.boolean(),
|
|
21340
|
+
source: z68.string().optional()
|
|
21341
|
+
});
|
|
21342
|
+
var projectConfigStateSchema = z68.object({
|
|
21343
|
+
project: z68.object({ id: z68.string(), name: z68.string() }),
|
|
21344
|
+
configRevision: z68.number().int(),
|
|
21042
21345
|
fields: projectFieldsStateSchema,
|
|
21043
|
-
queries:
|
|
21044
|
-
competitors:
|
|
21346
|
+
queries: z68.array(z68.object({ id: z68.string(), text: z68.string() })),
|
|
21347
|
+
competitors: z68.array(z68.object({ id: z68.string(), domain: z68.string(), aliases: z68.array(z68.string()) })),
|
|
21045
21348
|
schedule: scheduleStateSchema.nullable(),
|
|
21046
|
-
notifications:
|
|
21047
|
-
managed:
|
|
21048
|
-
detachedSnapshotCount:
|
|
21049
|
-
});
|
|
21050
|
-
var notificationAddedSchema =
|
|
21051
|
-
var notificationRemovedSchema = notificationAddedSchema.extend({ id:
|
|
21052
|
-
var notificationKeptSchema =
|
|
21053
|
-
id:
|
|
21054
|
-
urlHost:
|
|
21055
|
-
urlChanged:
|
|
21056
|
-
eventsBefore:
|
|
21057
|
-
eventsAfter:
|
|
21058
|
-
});
|
|
21059
|
-
var applyPreviewDtoSchema =
|
|
21060
|
-
project:
|
|
21061
|
-
action:
|
|
21062
|
-
changed:
|
|
21063
|
-
configRevision:
|
|
21349
|
+
notifications: z68.array(configStateNotificationSchema),
|
|
21350
|
+
managed: z68.object({ queries: z68.boolean(), competitors: z68.boolean(), schedule: z68.boolean(), notifications: z68.boolean() }),
|
|
21351
|
+
detachedSnapshotCount: z68.number().int().nonnegative()
|
|
21352
|
+
});
|
|
21353
|
+
var notificationAddedSchema = z68.object({ urlHost: z68.string(), events: z68.array(z68.string()) });
|
|
21354
|
+
var notificationRemovedSchema = notificationAddedSchema.extend({ id: z68.string() });
|
|
21355
|
+
var notificationKeptSchema = z68.object({
|
|
21356
|
+
id: z68.string(),
|
|
21357
|
+
urlHost: z68.string(),
|
|
21358
|
+
urlChanged: z68.boolean(),
|
|
21359
|
+
eventsBefore: z68.array(z68.string()),
|
|
21360
|
+
eventsAfter: z68.array(z68.string())
|
|
21361
|
+
});
|
|
21362
|
+
var applyPreviewDtoSchema = z68.object({
|
|
21363
|
+
project: z68.object({ id: z68.string().nullable(), name: z68.string() }),
|
|
21364
|
+
action: z68.enum(["create", "update", "none"]),
|
|
21365
|
+
changed: z68.boolean(),
|
|
21366
|
+
configRevision: z68.object({ before: z68.number().int().nullable(), after: z68.number().int() }),
|
|
21064
21367
|
fields: projectFieldsChangeSchema,
|
|
21065
|
-
queries:
|
|
21066
|
-
managed:
|
|
21067
|
-
added:
|
|
21068
|
-
removed:
|
|
21069
|
-
unchangedCount:
|
|
21070
|
-
snapshotsDetached:
|
|
21368
|
+
queries: z68.object({
|
|
21369
|
+
managed: z68.boolean(),
|
|
21370
|
+
added: z68.array(z68.string()),
|
|
21371
|
+
removed: z68.array(z68.string()),
|
|
21372
|
+
unchangedCount: z68.number().int().nonnegative(),
|
|
21373
|
+
snapshotsDetached: z68.number().int().nonnegative()
|
|
21071
21374
|
}),
|
|
21072
|
-
competitors:
|
|
21073
|
-
managed:
|
|
21074
|
-
added:
|
|
21075
|
-
removed:
|
|
21076
|
-
aliasChanges:
|
|
21077
|
-
droppedAliases:
|
|
21375
|
+
competitors: z68.object({
|
|
21376
|
+
managed: z68.boolean(),
|
|
21377
|
+
added: z68.array(z68.string()),
|
|
21378
|
+
removed: z68.array(z68.string()),
|
|
21379
|
+
aliasChanges: z68.array(z68.object({ domain: z68.string(), before: z68.array(z68.string()), after: z68.array(z68.string()) })),
|
|
21380
|
+
droppedAliases: z68.array(droppedAliasSchema)
|
|
21078
21381
|
}),
|
|
21079
|
-
schedule:
|
|
21080
|
-
managed:
|
|
21081
|
-
action:
|
|
21382
|
+
schedule: z68.object({
|
|
21383
|
+
managed: z68.boolean(),
|
|
21384
|
+
action: z68.enum(["create", "update", "delete", "none"]),
|
|
21082
21385
|
before: scheduleStateSchema.nullable(),
|
|
21083
21386
|
after: scheduleStateSchema.nullable()
|
|
21084
21387
|
}),
|
|
21085
|
-
notifications:
|
|
21086
|
-
managed:
|
|
21087
|
-
added:
|
|
21088
|
-
removed:
|
|
21089
|
-
kept:
|
|
21090
|
-
secretsRotated:
|
|
21388
|
+
notifications: z68.object({
|
|
21389
|
+
managed: z68.boolean(),
|
|
21390
|
+
added: z68.array(notificationAddedSchema),
|
|
21391
|
+
removed: z68.array(notificationRemovedSchema),
|
|
21392
|
+
kept: z68.array(notificationKeptSchema),
|
|
21393
|
+
secretsRotated: z68.number().int().nonnegative()
|
|
21091
21394
|
}),
|
|
21092
|
-
effects:
|
|
21395
|
+
effects: z68.array(z68.enum([
|
|
21093
21396
|
"mention-backfill",
|
|
21094
21397
|
"competitor-rescore",
|
|
21095
21398
|
"competitor-auto-alias-rescan",
|
|
@@ -21201,46 +21504,46 @@ function diffProjectConfigState(before, after, options = {}) {
|
|
|
21201
21504
|
}
|
|
21202
21505
|
|
|
21203
21506
|
// ../contracts/src/simple-measurement-definition.ts
|
|
21204
|
-
import { z as
|
|
21507
|
+
import { z as z69 } from "zod";
|
|
21205
21508
|
var SIMPLE_MEASUREMENT_DEFINITION_SCHEMA_VERSION = 1;
|
|
21206
|
-
var nonBlankStringSchema =
|
|
21509
|
+
var nonBlankStringSchema = z69.string().refine((value) => value.trim().length > 0, {
|
|
21207
21510
|
message: "Must not be blank"
|
|
21208
21511
|
});
|
|
21209
|
-
var simpleMeasurementIdentitySchema =
|
|
21512
|
+
var simpleMeasurementIdentitySchema = z69.object({
|
|
21210
21513
|
// These fields intentionally preserve their stored presentation. The shared
|
|
21211
21514
|
// matcher derives its normalized form separately when classifying queries.
|
|
21212
|
-
displayName:
|
|
21213
|
-
aliases:
|
|
21214
|
-
canonicalDomain:
|
|
21215
|
-
ownedDomains:
|
|
21515
|
+
displayName: z69.string(),
|
|
21516
|
+
aliases: z69.array(z69.string()),
|
|
21517
|
+
canonicalDomain: z69.string(),
|
|
21518
|
+
ownedDomains: z69.array(z69.string()),
|
|
21216
21519
|
// Sentiment-only: the aliases the evaluator is told are this brand's own
|
|
21217
21520
|
// names. Omitted when empty, so a sidecar that never opted in keeps its
|
|
21218
21521
|
// checksum. No bounds or matcher rules here: a later change to the write
|
|
21219
21522
|
// rules must never make a stored sidecar unreadable.
|
|
21220
|
-
qualifiedAliases:
|
|
21523
|
+
qualifiedAliases: z69.array(z69.string()).optional()
|
|
21221
21524
|
}).strict();
|
|
21222
|
-
var simpleMeasurementEngineSchema =
|
|
21525
|
+
var simpleMeasurementEngineSchema = z69.object({
|
|
21223
21526
|
provider: providerNameSchema.refine((value) => value.trim().length > 0, {
|
|
21224
21527
|
message: "Provider must not be blank"
|
|
21225
21528
|
}),
|
|
21226
21529
|
// Preserve the requested model exactly; null does not claim a served model.
|
|
21227
21530
|
// A legacy empty value can resolve to an adapter default.
|
|
21228
|
-
requestedModel:
|
|
21531
|
+
requestedModel: z69.string().nullable()
|
|
21229
21532
|
}).strict();
|
|
21230
|
-
var simpleMeasurementCompetitorSchema =
|
|
21533
|
+
var simpleMeasurementCompetitorSchema = z69.object({
|
|
21231
21534
|
// This is a snapshot of legacy dispatch inputs, not a competitor write API.
|
|
21232
21535
|
// Stored identifiers may be labels, URLs, or blank. Preserve them exactly;
|
|
21233
21536
|
// readers derive hostname attribution separately when the value supports it.
|
|
21234
|
-
domain:
|
|
21235
|
-
label:
|
|
21236
|
-
aliases:
|
|
21537
|
+
domain: z69.string(),
|
|
21538
|
+
label: z69.string(),
|
|
21539
|
+
aliases: z69.array(z69.string())
|
|
21237
21540
|
}).strict();
|
|
21238
|
-
var simpleMeasurementQueryInputSchema =
|
|
21541
|
+
var simpleMeasurementQueryInputSchema = z69.object({
|
|
21239
21542
|
queryId: nonBlankStringSchema,
|
|
21240
21543
|
// The legacy runner can dispatch a stored empty query. Preserve that exact
|
|
21241
21544
|
// selected input rather than making first capture change its behavior.
|
|
21242
|
-
queryText:
|
|
21243
|
-
provenance:
|
|
21545
|
+
queryText: z69.string(),
|
|
21546
|
+
provenance: z69.string().nullable()
|
|
21244
21547
|
}).strict();
|
|
21245
21548
|
var simpleMeasurementQuerySchema = simpleMeasurementQueryInputSchema.extend({
|
|
21246
21549
|
queryClass: queryClassSchema.nullable()
|
|
@@ -21251,7 +21554,7 @@ function addCollectionIssues(value, ctx) {
|
|
|
21251
21554
|
const key = engine.provider.trim().toLocaleLowerCase("en");
|
|
21252
21555
|
if (engineProviders.has(key)) {
|
|
21253
21556
|
ctx.addIssue({
|
|
21254
|
-
code:
|
|
21557
|
+
code: z69.ZodIssueCode.custom,
|
|
21255
21558
|
path: ["engines", index, "provider"],
|
|
21256
21559
|
message: `Duplicate engine provider "${engine.provider}"`
|
|
21257
21560
|
});
|
|
@@ -21262,7 +21565,7 @@ function addCollectionIssues(value, ctx) {
|
|
|
21262
21565
|
value.queries.forEach((query, index) => {
|
|
21263
21566
|
if (queryIds.has(query.queryId)) {
|
|
21264
21567
|
ctx.addIssue({
|
|
21265
|
-
code:
|
|
21568
|
+
code: z69.ZodIssueCode.custom,
|
|
21266
21569
|
path: ["queries", index, "queryId"],
|
|
21267
21570
|
message: `Duplicate query id "${query.queryId}"`
|
|
21268
21571
|
});
|
|
@@ -21274,7 +21577,7 @@ function addCollectionIssues(value, ctx) {
|
|
|
21274
21577
|
const key = competitor.domain;
|
|
21275
21578
|
if (competitorDomains.has(key)) {
|
|
21276
21579
|
ctx.addIssue({
|
|
21277
|
-
code:
|
|
21580
|
+
code: z69.ZodIssueCode.custom,
|
|
21278
21581
|
path: ["competitors", index, "domain"],
|
|
21279
21582
|
message: `Duplicate competitor domain "${competitor.domain}"`
|
|
21280
21583
|
});
|
|
@@ -21282,28 +21585,28 @@ function addCollectionIssues(value, ctx) {
|
|
|
21282
21585
|
competitorDomains.add(key);
|
|
21283
21586
|
});
|
|
21284
21587
|
}
|
|
21285
|
-
var simpleMeasurementDefinitionInputSchema =
|
|
21286
|
-
capturedAt:
|
|
21588
|
+
var simpleMeasurementDefinitionInputSchema = z69.object({
|
|
21589
|
+
capturedAt: z69.string().datetime(),
|
|
21287
21590
|
identity: simpleMeasurementIdentitySchema,
|
|
21288
|
-
country:
|
|
21289
|
-
language:
|
|
21591
|
+
country: z69.string(),
|
|
21592
|
+
language: z69.string(),
|
|
21290
21593
|
location: locationContextSchema.nullable(),
|
|
21291
|
-
engines:
|
|
21594
|
+
engines: z69.array(simpleMeasurementEngineSchema).min(1),
|
|
21292
21595
|
/** Missing on historical sidecars; an empty array means the captured set was intentionally empty. */
|
|
21293
|
-
competitors:
|
|
21294
|
-
queries:
|
|
21596
|
+
competitors: z69.array(simpleMeasurementCompetitorSchema).optional(),
|
|
21597
|
+
queries: z69.array(simpleMeasurementQueryInputSchema)
|
|
21295
21598
|
}).strict().superRefine(addCollectionIssues);
|
|
21296
|
-
var simpleMeasurementDefinitionSchema =
|
|
21297
|
-
schemaVersion:
|
|
21298
|
-
capturedAt:
|
|
21599
|
+
var simpleMeasurementDefinitionSchema = z69.object({
|
|
21600
|
+
schemaVersion: z69.literal(SIMPLE_MEASUREMENT_DEFINITION_SCHEMA_VERSION),
|
|
21601
|
+
capturedAt: z69.string().datetime(),
|
|
21299
21602
|
identity: simpleMeasurementIdentitySchema,
|
|
21300
|
-
country:
|
|
21301
|
-
language:
|
|
21603
|
+
country: z69.string(),
|
|
21604
|
+
language: z69.string(),
|
|
21302
21605
|
// Requested adapter input, not proof that the provider applied this context.
|
|
21303
21606
|
location: locationContextSchema.nullable(),
|
|
21304
|
-
engines:
|
|
21305
|
-
competitors:
|
|
21306
|
-
queries:
|
|
21607
|
+
engines: z69.array(simpleMeasurementEngineSchema).min(1),
|
|
21608
|
+
competitors: z69.array(simpleMeasurementCompetitorSchema).optional(),
|
|
21609
|
+
queries: z69.array(simpleMeasurementQuerySchema)
|
|
21307
21610
|
}).strict().superRefine(addCollectionIssues);
|
|
21308
21611
|
function simpleMeasurementCompetitorNames(competitors) {
|
|
21309
21612
|
return competitors?.flatMap((competitor) => [competitor.label, ...competitor.aliases]) ?? [];
|
|
@@ -21396,21 +21699,21 @@ function canonicalSimpleMeasurementDefinitionJson(definition) {
|
|
|
21396
21699
|
}
|
|
21397
21700
|
|
|
21398
21701
|
// ../contracts/src/measurement-group-import.ts
|
|
21399
|
-
import { z as
|
|
21702
|
+
import { z as z70 } from "zod";
|
|
21400
21703
|
var MEASUREMENT_GROUP_MEMBERSHIP_CSV_PARSER_VERSION = "canonry.measurement-group-membership-csv/v1";
|
|
21401
21704
|
var MEASUREMENT_GROUP_MEMBERSHIP_CSV_MAX_BYTES = 1048576;
|
|
21402
21705
|
var MEASUREMENT_GROUP_MEMBERSHIP_CSV_MAX_DATA_ROWS = 5e3;
|
|
21403
|
-
var sha256HexSchema4 =
|
|
21404
|
-
var dataRowNumberSchema =
|
|
21405
|
-
var measurementDraftSegmentDescriptorSchema =
|
|
21706
|
+
var sha256HexSchema4 = z70.string().regex(/^[a-f0-9]{64}$/);
|
|
21707
|
+
var dataRowNumberSchema = z70.number().int().positive();
|
|
21708
|
+
var measurementDraftSegmentDescriptorSchema = z70.object({
|
|
21406
21709
|
stableKey: measurementV2StableKeySchema,
|
|
21407
|
-
kind:
|
|
21408
|
-
retiredAt:
|
|
21710
|
+
kind: z70.enum(["target", "group"]),
|
|
21711
|
+
retiredAt: z70.string().datetime().nullable()
|
|
21409
21712
|
}).strict();
|
|
21410
|
-
var measurementDraftPreviewGroupMembershipRequestSchema =
|
|
21411
|
-
csv:
|
|
21713
|
+
var measurementDraftPreviewGroupMembershipRequestSchema = z70.object({
|
|
21714
|
+
csv: z70.string()
|
|
21412
21715
|
}).strict();
|
|
21413
|
-
var measurementDraftGroupMembershipRowStatusSchema =
|
|
21716
|
+
var measurementDraftGroupMembershipRowStatusSchema = z70.enum([
|
|
21414
21717
|
"matched",
|
|
21415
21718
|
"ambiguous",
|
|
21416
21719
|
"unmatched",
|
|
@@ -21419,7 +21722,7 @@ var measurementDraftGroupMembershipRowStatusSchema = z69.enum([
|
|
|
21419
21722
|
"proposed",
|
|
21420
21723
|
"excluded"
|
|
21421
21724
|
]);
|
|
21422
|
-
var measurementDraftGroupMembershipRowReasonSchema =
|
|
21725
|
+
var measurementDraftGroupMembershipRowReasonSchema = z70.enum([
|
|
21423
21726
|
"column-count",
|
|
21424
21727
|
"missing-property",
|
|
21425
21728
|
"missing-group",
|
|
@@ -21432,103 +21735,103 @@ var measurementDraftGroupMembershipRowReasonSchema = z69.enum([
|
|
|
21432
21735
|
"group-label-ambiguous",
|
|
21433
21736
|
"group-key-conflict"
|
|
21434
21737
|
]);
|
|
21435
|
-
var rowSourceSchema =
|
|
21738
|
+
var rowSourceSchema = z70.object({
|
|
21436
21739
|
/** One-based logical record number after the CSV header, not a physical line number. */
|
|
21437
21740
|
dataRow: dataRowNumberSchema,
|
|
21438
|
-
property:
|
|
21439
|
-
group:
|
|
21440
|
-
url:
|
|
21441
|
-
normalizedProperty:
|
|
21442
|
-
normalizedGroupLabel:
|
|
21741
|
+
property: z70.string(),
|
|
21742
|
+
group: z70.string(),
|
|
21743
|
+
url: z70.string().nullable(),
|
|
21744
|
+
normalizedProperty: z70.string(),
|
|
21745
|
+
normalizedGroupLabel: z70.string()
|
|
21443
21746
|
}).strict();
|
|
21444
21747
|
var rowFailureSchema = rowSourceSchema.extend({
|
|
21445
21748
|
reason: measurementDraftGroupMembershipRowReasonSchema
|
|
21446
21749
|
});
|
|
21447
|
-
var measurementDraftGroupKeyConflictEvidenceSchema =
|
|
21448
|
-
source:
|
|
21750
|
+
var measurementDraftGroupKeyConflictEvidenceSchema = z70.object({
|
|
21751
|
+
source: z70.enum(["draft-target", "draft-group", "persisted-segment", "retired-segment", "proposed-group"]),
|
|
21449
21752
|
stableKey: measurementV2StableKeySchema,
|
|
21450
|
-
kind:
|
|
21451
|
-
retiredAt:
|
|
21452
|
-
normalizedGroupLabel:
|
|
21753
|
+
kind: z70.enum(["target", "group"]).optional(),
|
|
21754
|
+
retiredAt: z70.string().datetime().nullable().optional(),
|
|
21755
|
+
normalizedGroupLabel: z70.string().optional()
|
|
21453
21756
|
}).strict();
|
|
21454
|
-
var measurementDraftGroupKeyConflictSchema =
|
|
21757
|
+
var measurementDraftGroupKeyConflictSchema = z70.object({
|
|
21455
21758
|
proposedGroupKey: measurementV2StableKeySchema,
|
|
21456
|
-
evidence:
|
|
21759
|
+
evidence: z70.array(measurementDraftGroupKeyConflictEvidenceSchema).min(1)
|
|
21457
21760
|
}).strict();
|
|
21458
|
-
var measurementDraftGroupMembershipRowSchema =
|
|
21761
|
+
var measurementDraftGroupMembershipRowSchema = z70.discriminatedUnion("status", [
|
|
21459
21762
|
rowSourceSchema.extend({
|
|
21460
|
-
status:
|
|
21763
|
+
status: z70.literal("matched"),
|
|
21461
21764
|
targetKey: measurementV2StableKeySchema,
|
|
21462
21765
|
groupKey: measurementV2StableKeySchema
|
|
21463
21766
|
}).strict(),
|
|
21464
21767
|
rowFailureSchema.extend({
|
|
21465
|
-
status:
|
|
21466
|
-
candidateTargetKeys:
|
|
21467
|
-
candidateGroupKeys:
|
|
21768
|
+
status: z70.literal("ambiguous"),
|
|
21769
|
+
candidateTargetKeys: z70.array(measurementV2StableKeySchema).min(1).optional(),
|
|
21770
|
+
candidateGroupKeys: z70.array(measurementV2StableKeySchema).min(1).optional()
|
|
21468
21771
|
}).strict(),
|
|
21469
21772
|
rowFailureSchema.extend({
|
|
21470
|
-
status:
|
|
21773
|
+
status: z70.literal("unmatched")
|
|
21471
21774
|
}).strict(),
|
|
21472
21775
|
rowFailureSchema.extend({
|
|
21473
|
-
status:
|
|
21776
|
+
status: z70.literal("invalid"),
|
|
21474
21777
|
groupKeyConflict: measurementDraftGroupKeyConflictSchema.optional()
|
|
21475
21778
|
}).strict(),
|
|
21476
21779
|
rowSourceSchema.extend({
|
|
21477
|
-
status:
|
|
21780
|
+
status: z70.literal("duplicate"),
|
|
21478
21781
|
duplicateOfRow: dataRowNumberSchema,
|
|
21479
21782
|
targetKey: measurementV2StableKeySchema,
|
|
21480
21783
|
groupKey: measurementV2StableKeySchema
|
|
21481
21784
|
}).strict(),
|
|
21482
21785
|
rowFailureSchema.extend({
|
|
21483
|
-
status:
|
|
21786
|
+
status: z70.literal("proposed"),
|
|
21484
21787
|
targetKey: measurementV2StableKeySchema
|
|
21485
21788
|
}).strict(),
|
|
21486
21789
|
rowFailureSchema.extend({
|
|
21487
|
-
status:
|
|
21790
|
+
status: z70.literal("excluded"),
|
|
21488
21791
|
targetKey: measurementV2StableKeySchema
|
|
21489
21792
|
}).strict()
|
|
21490
21793
|
]);
|
|
21491
|
-
var measurementDraftGroupMembershipChangeSchema =
|
|
21492
|
-
normalizedGroupLabel:
|
|
21794
|
+
var measurementDraftGroupMembershipChangeSchema = z70.object({
|
|
21795
|
+
normalizedGroupLabel: z70.string(),
|
|
21493
21796
|
groupKey: measurementV2StableKeySchema,
|
|
21494
|
-
label:
|
|
21495
|
-
action:
|
|
21496
|
-
matchedRows:
|
|
21497
|
-
targetKeys:
|
|
21498
|
-
addedTargetKeys:
|
|
21499
|
-
unchangedTargetKeys:
|
|
21500
|
-
}).strict();
|
|
21501
|
-
var measurementDraftGroupMembershipImportCountsSchema =
|
|
21502
|
-
dataRows:
|
|
21503
|
-
matchedRows:
|
|
21504
|
-
ambiguousRows:
|
|
21505
|
-
unmatchedRows:
|
|
21506
|
-
invalidRows:
|
|
21507
|
-
duplicateRows:
|
|
21508
|
-
proposedRows:
|
|
21509
|
-
excludedRows:
|
|
21797
|
+
label: z70.string().trim().min(1),
|
|
21798
|
+
action: z70.enum(["create", "extend"]),
|
|
21799
|
+
matchedRows: z70.array(dataRowNumberSchema),
|
|
21800
|
+
targetKeys: z70.array(measurementV2StableKeySchema),
|
|
21801
|
+
addedTargetKeys: z70.array(measurementV2StableKeySchema),
|
|
21802
|
+
unchangedTargetKeys: z70.array(measurementV2StableKeySchema)
|
|
21803
|
+
}).strict();
|
|
21804
|
+
var measurementDraftGroupMembershipImportCountsSchema = z70.object({
|
|
21805
|
+
dataRows: z70.number().int().nonnegative(),
|
|
21806
|
+
matchedRows: z70.number().int().nonnegative(),
|
|
21807
|
+
ambiguousRows: z70.number().int().nonnegative(),
|
|
21808
|
+
unmatchedRows: z70.number().int().nonnegative(),
|
|
21809
|
+
invalidRows: z70.number().int().nonnegative(),
|
|
21810
|
+
duplicateRows: z70.number().int().nonnegative(),
|
|
21811
|
+
proposedRows: z70.number().int().nonnegative(),
|
|
21812
|
+
excludedRows: z70.number().int().nonnegative(),
|
|
21510
21813
|
/** Rows that cannot be committed without correcting the draft or source. */
|
|
21511
|
-
needsAttention:
|
|
21512
|
-
groupsReady:
|
|
21513
|
-
groupsToCreate:
|
|
21514
|
-
groupsToExtend:
|
|
21515
|
-
membershipsReady:
|
|
21516
|
-
addedMemberships:
|
|
21517
|
-
unchangedMemberships:
|
|
21518
|
-
}).strict();
|
|
21519
|
-
var measurementDraftPreviewGroupMembershipResponseSchema =
|
|
21520
|
-
draftEtag:
|
|
21814
|
+
needsAttention: z70.number().int().nonnegative(),
|
|
21815
|
+
groupsReady: z70.number().int().nonnegative(),
|
|
21816
|
+
groupsToCreate: z70.number().int().nonnegative(),
|
|
21817
|
+
groupsToExtend: z70.number().int().nonnegative(),
|
|
21818
|
+
membershipsReady: z70.number().int().nonnegative(),
|
|
21819
|
+
addedMemberships: z70.number().int().nonnegative(),
|
|
21820
|
+
unchangedMemberships: z70.number().int().nonnegative()
|
|
21821
|
+
}).strict();
|
|
21822
|
+
var measurementDraftPreviewGroupMembershipResponseSchema = z70.object({
|
|
21823
|
+
draftEtag: z70.string().trim().min(1),
|
|
21521
21824
|
sourceChecksum: sha256HexSchema4,
|
|
21522
21825
|
previewChecksum: sha256HexSchema4,
|
|
21523
|
-
rows:
|
|
21524
|
-
groupChanges:
|
|
21826
|
+
rows: z70.array(measurementDraftGroupMembershipRowSchema),
|
|
21827
|
+
groupChanges: z70.array(measurementDraftGroupMembershipChangeSchema),
|
|
21525
21828
|
counts: measurementDraftGroupMembershipImportCountsSchema
|
|
21526
21829
|
}).strict();
|
|
21527
|
-
var measurementDraftApplyGroupMembershipRequestSchema =
|
|
21528
|
-
csv:
|
|
21830
|
+
var measurementDraftApplyGroupMembershipRequestSchema = z70.object({
|
|
21831
|
+
csv: z70.string(),
|
|
21529
21832
|
sourceChecksum: sha256HexSchema4,
|
|
21530
21833
|
previewChecksum: sha256HexSchema4,
|
|
21531
|
-
acceptedRows:
|
|
21834
|
+
acceptedRows: z70.array(dataRowNumberSchema).min(1)
|
|
21532
21835
|
}).strict().superRefine((value, context) => {
|
|
21533
21836
|
if (new Set(value.acceptedRows).size === value.acceptedRows.length) return;
|
|
21534
21837
|
context.addIssue({
|
|
@@ -21539,9 +21842,9 @@ var measurementDraftApplyGroupMembershipRequestSchema = z69.object({
|
|
|
21539
21842
|
});
|
|
21540
21843
|
var measurementDraftApplyGroupMembershipResponseSchema = measurementDraftMutationResponseSchema.extend({
|
|
21541
21844
|
/** Accepted matched CSV records, including records whose membership was already present. */
|
|
21542
|
-
appliedRows:
|
|
21543
|
-
addedMemberships:
|
|
21544
|
-
unchangedMemberships:
|
|
21845
|
+
appliedRows: z70.number().int().nonnegative(),
|
|
21846
|
+
addedMemberships: z70.number().int().nonnegative(),
|
|
21847
|
+
unchangedMemberships: z70.number().int().nonnegative()
|
|
21545
21848
|
}).strict();
|
|
21546
21849
|
|
|
21547
21850
|
// ../contracts/src/measurement-target-names.ts
|
|
@@ -21596,44 +21899,44 @@ function measurementTargetNameIssueMessage(issue) {
|
|
|
21596
21899
|
}
|
|
21597
21900
|
|
|
21598
21901
|
// ../contracts/src/google.ts
|
|
21599
|
-
import { z as
|
|
21600
|
-
var googleConnectionTypeSchema =
|
|
21601
|
-
var googleConnectionDtoSchema =
|
|
21602
|
-
id:
|
|
21603
|
-
domain:
|
|
21902
|
+
import { z as z71 } from "zod";
|
|
21903
|
+
var googleConnectionTypeSchema = z71.enum(["gsc", "ga4", "gbp"]);
|
|
21904
|
+
var googleConnectionDtoSchema = z71.object({
|
|
21905
|
+
id: z71.string(),
|
|
21906
|
+
domain: z71.string(),
|
|
21604
21907
|
connectionType: googleConnectionTypeSchema,
|
|
21605
|
-
propertyId:
|
|
21606
|
-
sitemapUrl:
|
|
21607
|
-
scopes:
|
|
21608
|
-
createdAt:
|
|
21609
|
-
updatedAt:
|
|
21610
|
-
});
|
|
21611
|
-
var googleOAuthStartResponseSchema =
|
|
21612
|
-
authUrl:
|
|
21613
|
-
redirectUri:
|
|
21614
|
-
}).strict();
|
|
21615
|
-
var gscSearchDataDtoSchema =
|
|
21616
|
-
date:
|
|
21617
|
-
query:
|
|
21618
|
-
page:
|
|
21619
|
-
country:
|
|
21620
|
-
device:
|
|
21621
|
-
clicks:
|
|
21622
|
-
impressions:
|
|
21908
|
+
propertyId: z71.string().nullable().optional(),
|
|
21909
|
+
sitemapUrl: z71.string().nullable().optional(),
|
|
21910
|
+
scopes: z71.array(z71.string()).default([]),
|
|
21911
|
+
createdAt: z71.string(),
|
|
21912
|
+
updatedAt: z71.string()
|
|
21913
|
+
});
|
|
21914
|
+
var googleOAuthStartResponseSchema = z71.object({
|
|
21915
|
+
authUrl: z71.string().url(),
|
|
21916
|
+
redirectUri: z71.string().url()
|
|
21917
|
+
}).strict();
|
|
21918
|
+
var gscSearchDataDtoSchema = z71.object({
|
|
21919
|
+
date: z71.string(),
|
|
21920
|
+
query: z71.string(),
|
|
21921
|
+
page: z71.string(),
|
|
21922
|
+
country: z71.string().nullable().optional(),
|
|
21923
|
+
device: z71.string().nullable().optional(),
|
|
21924
|
+
clicks: z71.number(),
|
|
21925
|
+
impressions: z71.number(),
|
|
21623
21926
|
ctr: fraction(),
|
|
21624
|
-
position:
|
|
21625
|
-
});
|
|
21626
|
-
var gscPerformanceOrderBySchema =
|
|
21627
|
-
var gscPerformanceResponseDtoSchema =
|
|
21628
|
-
rows:
|
|
21629
|
-
totalMatching:
|
|
21630
|
-
truncated:
|
|
21631
|
-
latestAvailableDate:
|
|
21632
|
-
});
|
|
21633
|
-
var gscPerformanceDailyPointSchema =
|
|
21634
|
-
date:
|
|
21635
|
-
clicks:
|
|
21636
|
-
impressions:
|
|
21927
|
+
position: z71.number()
|
|
21928
|
+
});
|
|
21929
|
+
var gscPerformanceOrderBySchema = z71.enum(["clicks", "impressions", "date"]);
|
|
21930
|
+
var gscPerformanceResponseDtoSchema = z71.object({
|
|
21931
|
+
rows: z71.array(gscSearchDataDtoSchema),
|
|
21932
|
+
totalMatching: z71.number(),
|
|
21933
|
+
truncated: z71.boolean(),
|
|
21934
|
+
latestAvailableDate: z71.string().nullable()
|
|
21935
|
+
});
|
|
21936
|
+
var gscPerformanceDailyPointSchema = z71.object({
|
|
21937
|
+
date: z71.string(),
|
|
21938
|
+
clicks: z71.number(),
|
|
21939
|
+
impressions: z71.number(),
|
|
21637
21940
|
ctr: fraction(),
|
|
21638
21941
|
/**
|
|
21639
21942
|
* Average ranking position for the day, or `null` on a date served by the
|
|
@@ -21642,15 +21945,15 @@ var gscPerformanceDailyPointSchema = z70.object({
|
|
|
21642
21945
|
* absence is reported rather than a fabricated `0` — which would also read as
|
|
21643
21946
|
* an impossibly good rank on a chart with an inverted axis.
|
|
21644
21947
|
*/
|
|
21645
|
-
position:
|
|
21948
|
+
position: z71.number().nullable()
|
|
21646
21949
|
});
|
|
21647
|
-
var gscWindowRangeSchema =
|
|
21950
|
+
var gscWindowRangeSchema = z71.object({
|
|
21648
21951
|
/** Inclusive lower bound, or `null` for the `all` window. */
|
|
21649
|
-
startDate:
|
|
21952
|
+
startDate: z71.string().nullable(),
|
|
21650
21953
|
/** Inclusive upper bound: the last date the property published. */
|
|
21651
|
-
endDate:
|
|
21954
|
+
endDate: z71.string().nullable(),
|
|
21652
21955
|
/** `MAX(date)` across the project's GSC data, ignoring the window. */
|
|
21653
|
-
latestDataDate:
|
|
21956
|
+
latestDataDate: z71.string().nullable(),
|
|
21654
21957
|
/**
|
|
21655
21958
|
* Calendar days since the last day with recorded traffic, on GSC's Pacific
|
|
21656
21959
|
* calendar. `null` with no data.
|
|
@@ -21660,37 +21963,37 @@ var gscWindowRangeSchema = z70.object({
|
|
|
21660
21963
|
* number. Render it as "data through <endDate>", never as "Search Console is
|
|
21661
21964
|
* N days behind".
|
|
21662
21965
|
*/
|
|
21663
|
-
daysSinceLatestData:
|
|
21966
|
+
daysSinceLatestData: z71.number().nullable()
|
|
21664
21967
|
});
|
|
21665
|
-
var gscPerformanceTrendsSchema =
|
|
21968
|
+
var gscPerformanceTrendsSchema = z71.object({
|
|
21666
21969
|
clicks: linearTrendSchema.nullable(),
|
|
21667
21970
|
impressions: linearTrendSchema.nullable(),
|
|
21668
21971
|
ctr: linearTrendSchema.nullable(),
|
|
21669
21972
|
position: linearTrendSchema.nullable()
|
|
21670
21973
|
});
|
|
21671
|
-
var gscPeriodTotalsSchema =
|
|
21672
|
-
startDate:
|
|
21673
|
-
endDate:
|
|
21674
|
-
clicks:
|
|
21675
|
-
impressions:
|
|
21974
|
+
var gscPeriodTotalsSchema = z71.object({
|
|
21975
|
+
startDate: z71.string(),
|
|
21976
|
+
endDate: z71.string(),
|
|
21977
|
+
clicks: z71.number(),
|
|
21978
|
+
impressions: z71.number(),
|
|
21676
21979
|
/** The period's own `clicks / impressions`, never a mean of daily ratios. */
|
|
21677
21980
|
ctr: fraction().nullable(),
|
|
21678
21981
|
/** Impression-weighted mean position, or null when no day carried one. */
|
|
21679
|
-
position:
|
|
21982
|
+
position: z71.number().nullable(),
|
|
21680
21983
|
/**
|
|
21681
21984
|
* Which table the figures came from. `gsc_daily_totals` (property-daily) and
|
|
21682
21985
|
* `SUM(gsc_search_data)` (dimensioned) are not interchangeable: on one real
|
|
21683
21986
|
* property-month the same period reads 1,142 clicks / 34,916 impressions from
|
|
21684
21987
|
* the first and 792 / 45,266 from the second.
|
|
21685
21988
|
*/
|
|
21686
|
-
source:
|
|
21989
|
+
source: z71.enum(["property-daily", "dimensioned", "mixed", "empty"])
|
|
21687
21990
|
});
|
|
21688
|
-
var gscPeriodComparisonSchema =
|
|
21991
|
+
var gscPeriodComparisonSchema = z71.object({
|
|
21689
21992
|
/**
|
|
21690
21993
|
* Length of EACH period in calendar days. Equals the selected window under
|
|
21691
21994
|
* `basis: 'prior-window'`, and half of it under `basis: 'split-window'`.
|
|
21692
21995
|
*/
|
|
21693
|
-
days:
|
|
21996
|
+
days: z71.number(),
|
|
21694
21997
|
/**
|
|
21695
21998
|
* Which two periods these are, so a surface can say what it is showing.
|
|
21696
21999
|
*
|
|
@@ -21712,7 +22015,7 @@ var gscPeriodComparisonSchema = z70.object({
|
|
|
21712
22015
|
* split the window, but a surface should render the absence with its
|
|
21713
22016
|
* period-length copy rather than assert a basis nobody sent.
|
|
21714
22017
|
*/
|
|
21715
|
-
basis:
|
|
22018
|
+
basis: z71.enum(["prior-window", "split-window"]).optional(),
|
|
21716
22019
|
prior: gscPeriodTotalsSchema,
|
|
21717
22020
|
trailing: gscPeriodTotalsSchema,
|
|
21718
22021
|
/**
|
|
@@ -21720,24 +22023,24 @@ var gscPeriodComparisonSchema = z70.object({
|
|
|
21720
22023
|
* case every `change` is null. Empty/property-daily halves are comparable;
|
|
21721
22024
|
* `SUM(gsc_search_data)` is never valid for property totals.
|
|
21722
22025
|
*/
|
|
21723
|
-
comparable:
|
|
22026
|
+
comparable: z71.boolean(),
|
|
21724
22027
|
/**
|
|
21725
22028
|
* Relative change as a ratio (0.5 = +50%), null where the prior period gives
|
|
21726
22029
|
* nothing to divide by or the trailing metric is unavailable. The sign is
|
|
21727
22030
|
* mathematical: a POSITIVE `position` means the rank number rose, which is
|
|
21728
22031
|
* worse. Desirability is the renderer's call.
|
|
21729
22032
|
*/
|
|
21730
|
-
change:
|
|
22033
|
+
change: z71.object({
|
|
21731
22034
|
clicks: fraction().nullable(),
|
|
21732
22035
|
impressions: fraction().nullable(),
|
|
21733
22036
|
ctr: fraction().nullable(),
|
|
21734
22037
|
position: fraction().nullable()
|
|
21735
22038
|
})
|
|
21736
22039
|
});
|
|
21737
|
-
var gscPerformanceDailyDtoSchema =
|
|
21738
|
-
totals:
|
|
21739
|
-
clicks:
|
|
21740
|
-
impressions:
|
|
22040
|
+
var gscPerformanceDailyDtoSchema = z71.object({
|
|
22041
|
+
totals: z71.object({
|
|
22042
|
+
clicks: z71.number(),
|
|
22043
|
+
impressions: z71.number(),
|
|
21741
22044
|
ctr: fraction(),
|
|
21742
22045
|
/**
|
|
21743
22046
|
* Impression-weighted mean position over the window, or `null` when no day
|
|
@@ -21745,15 +22048,15 @@ var gscPerformanceDailyDtoSchema = z70.object({
|
|
|
21745
22048
|
* daily values: position is non-additive, and an unweighted mean lets a
|
|
21746
22049
|
* one-impression day count as much as a thousand-impression day.
|
|
21747
22050
|
*/
|
|
21748
|
-
position:
|
|
22051
|
+
position: z71.number().nullable(),
|
|
21749
22052
|
/**
|
|
21750
22053
|
* Days that carried a property-level position. Below `days`, `position`
|
|
21751
22054
|
* describes a subset of the window and must be labelled as partial.
|
|
21752
22055
|
*/
|
|
21753
|
-
positionDays:
|
|
21754
|
-
days:
|
|
22056
|
+
positionDays: z71.number(),
|
|
22057
|
+
days: z71.number()
|
|
21755
22058
|
}),
|
|
21756
|
-
daily:
|
|
22059
|
+
daily: z71.array(gscPerformanceDailyPointSchema),
|
|
21757
22060
|
/**
|
|
21758
22061
|
* Optional because a server older than this field omits it. Both the web and
|
|
21759
22062
|
* the CLI guard for that skew; declaring it required here would tell a
|
|
@@ -21774,23 +22077,23 @@ var gscPerformanceDailyDtoSchema = z70.object({
|
|
|
21774
22077
|
*/
|
|
21775
22078
|
periodComparison: gscPeriodComparisonSchema.nullable().optional()
|
|
21776
22079
|
});
|
|
21777
|
-
var gscTopPageRowSchema =
|
|
21778
|
-
page:
|
|
21779
|
-
clicks:
|
|
21780
|
-
impressions:
|
|
22080
|
+
var gscTopPageRowSchema = z71.object({
|
|
22081
|
+
page: z71.string(),
|
|
22082
|
+
clicks: z71.number(),
|
|
22083
|
+
impressions: z71.number(),
|
|
21781
22084
|
ctr: fraction()
|
|
21782
22085
|
});
|
|
21783
|
-
var gscTopPagesDtoSchema =
|
|
21784
|
-
rows:
|
|
21785
|
-
totals:
|
|
21786
|
-
clicks:
|
|
21787
|
-
impressions:
|
|
22086
|
+
var gscTopPagesDtoSchema = z71.object({
|
|
22087
|
+
rows: z71.array(gscTopPageRowSchema),
|
|
22088
|
+
totals: z71.object({
|
|
22089
|
+
clicks: z71.number(),
|
|
22090
|
+
impressions: z71.number(),
|
|
21788
22091
|
ctr: fraction(),
|
|
21789
|
-
days:
|
|
22092
|
+
days: z71.number(),
|
|
21790
22093
|
/** First date the property-level totals actually cover. */
|
|
21791
|
-
coveredFrom:
|
|
22094
|
+
coveredFrom: z71.string().nullable(),
|
|
21792
22095
|
/** Last date the property-level totals actually cover. */
|
|
21793
|
-
coveredThrough:
|
|
22096
|
+
coveredThrough: z71.string().nullable(),
|
|
21794
22097
|
/**
|
|
21795
22098
|
* False when the totals span less than the ranked rows above.
|
|
21796
22099
|
*
|
|
@@ -21798,19 +22101,19 @@ var gscTopPagesDtoSchema = z70.object({
|
|
|
21798
22101
|
* 30-day totals sync can sit next to months of dimensioned rows. Printing
|
|
21799
22102
|
* both as one period would misstate the window the totals belong to.
|
|
21800
22103
|
*/
|
|
21801
|
-
complete:
|
|
22104
|
+
complete: z71.boolean()
|
|
21802
22105
|
}).nullable(),
|
|
21803
|
-
totalsSource:
|
|
22106
|
+
totalsSource: z71.literal("property-daily"),
|
|
21804
22107
|
/** First date the ranked rows cover, so a caller can compare spans. */
|
|
21805
|
-
rankedFrom:
|
|
22108
|
+
rankedFrom: z71.string().nullable(),
|
|
21806
22109
|
/** Last date the ranked rows cover. */
|
|
21807
|
-
rankedThrough:
|
|
22110
|
+
rankedThrough: z71.string().nullable()
|
|
21808
22111
|
});
|
|
21809
|
-
var gscQueryTotalsSourceSchema =
|
|
21810
|
-
var gscQueryTotalRowSchema =
|
|
21811
|
-
query:
|
|
21812
|
-
clicks:
|
|
21813
|
-
impressions:
|
|
22112
|
+
var gscQueryTotalsSourceSchema = z71.enum(["google", "page-summed", "mixed"]);
|
|
22113
|
+
var gscQueryTotalRowSchema = z71.object({
|
|
22114
|
+
query: z71.string(),
|
|
22115
|
+
clicks: z71.number(),
|
|
22116
|
+
impressions: z71.number(),
|
|
21814
22117
|
/** clicks / impressions as a 0..1 fraction, 0 when impressions are 0. */
|
|
21815
22118
|
ctr: fraction(),
|
|
21816
22119
|
/**
|
|
@@ -21818,15 +22121,15 @@ var gscQueryTotalRowSchema = z70.object({
|
|
|
21818
22121
|
* sum(position * impressions) / sum(impressions). When the query has no
|
|
21819
22122
|
* impressions in the window, the plain mean of its daily positions.
|
|
21820
22123
|
*/
|
|
21821
|
-
position:
|
|
22124
|
+
position: z71.number(),
|
|
21822
22125
|
/** Distinct dates the query appeared on in the window. */
|
|
21823
|
-
days:
|
|
22126
|
+
days: z71.number(),
|
|
21824
22127
|
source: gscQueryTotalsSourceSchema
|
|
21825
22128
|
});
|
|
21826
|
-
var gscQueryTotalsDtoSchema =
|
|
21827
|
-
rows:
|
|
21828
|
-
totalMatching:
|
|
21829
|
-
truncated:
|
|
22129
|
+
var gscQueryTotalsDtoSchema = z71.object({
|
|
22130
|
+
rows: z71.array(gscQueryTotalRowSchema),
|
|
22131
|
+
totalMatching: z71.number(),
|
|
22132
|
+
truncated: z71.boolean(),
|
|
21830
22133
|
/**
|
|
21831
22134
|
* The range the rows were read from, exactly. Explicit dates win; a labelled
|
|
21832
22135
|
* window paired with only `endDate` spans that many days ending on it. A
|
|
@@ -21844,49 +22147,49 @@ var gscQueryTotalsDtoSchema = z70.object({
|
|
|
21844
22147
|
* omits it, which means coverage is unknown, not that no rows are stored.
|
|
21845
22148
|
* This route always sends it.
|
|
21846
22149
|
*/
|
|
21847
|
-
earliestDataDate:
|
|
22150
|
+
earliestDataDate: z71.string().nullable().optional()
|
|
21848
22151
|
})
|
|
21849
22152
|
});
|
|
21850
|
-
var gscUrlInspectionDtoSchema =
|
|
21851
|
-
id:
|
|
21852
|
-
url:
|
|
21853
|
-
indexingState:
|
|
21854
|
-
verdict:
|
|
21855
|
-
coverageState:
|
|
21856
|
-
pageFetchState:
|
|
21857
|
-
robotsTxtState:
|
|
21858
|
-
crawlTime:
|
|
21859
|
-
lastCrawlResult:
|
|
21860
|
-
isMobileFriendly:
|
|
21861
|
-
richResults:
|
|
22153
|
+
var gscUrlInspectionDtoSchema = z71.object({
|
|
22154
|
+
id: z71.string(),
|
|
22155
|
+
url: z71.string(),
|
|
22156
|
+
indexingState: z71.string().nullable().optional(),
|
|
22157
|
+
verdict: z71.string().nullable().optional(),
|
|
22158
|
+
coverageState: z71.string().nullable().optional(),
|
|
22159
|
+
pageFetchState: z71.string().nullable().optional(),
|
|
22160
|
+
robotsTxtState: z71.string().nullable().optional(),
|
|
22161
|
+
crawlTime: z71.string().nullable().optional(),
|
|
22162
|
+
lastCrawlResult: z71.string().nullable().optional(),
|
|
22163
|
+
isMobileFriendly: z71.boolean().nullable().optional(),
|
|
22164
|
+
richResults: z71.array(z71.string()).default([]),
|
|
21862
22165
|
// Spec gap: server has returned `referringUrls` since the GSC inspect
|
|
21863
22166
|
// route shipped (see google.ts handler at /gsc/inspect + /gsc/inspections),
|
|
21864
22167
|
// but the schema dropped the field so the generated TS client (and
|
|
21865
22168
|
// anything else reading from this DTO) lost the data silently. Adding
|
|
21866
22169
|
// here restores end-to-end visibility.
|
|
21867
|
-
referringUrls:
|
|
21868
|
-
inspectedAt:
|
|
21869
|
-
});
|
|
21870
|
-
var indexTransitionSchema =
|
|
21871
|
-
var gscDeindexedRowSchema =
|
|
21872
|
-
url:
|
|
21873
|
-
previousState:
|
|
21874
|
-
currentState:
|
|
21875
|
-
transitionDate:
|
|
21876
|
-
});
|
|
21877
|
-
var gscReasonGroupSchema =
|
|
21878
|
-
reason:
|
|
21879
|
-
count:
|
|
21880
|
-
urls:
|
|
21881
|
-
});
|
|
21882
|
-
var gscCoverageSummaryDtoSchema =
|
|
21883
|
-
summary:
|
|
22170
|
+
referringUrls: z71.array(z71.string()).default([]),
|
|
22171
|
+
inspectedAt: z71.string()
|
|
22172
|
+
});
|
|
22173
|
+
var indexTransitionSchema = z71.enum(["stable", "reindexed", "deindexed", "still-missing", "new"]);
|
|
22174
|
+
var gscDeindexedRowSchema = z71.object({
|
|
22175
|
+
url: z71.string(),
|
|
22176
|
+
previousState: z71.string().nullable(),
|
|
22177
|
+
currentState: z71.string().nullable(),
|
|
22178
|
+
transitionDate: z71.string()
|
|
22179
|
+
});
|
|
22180
|
+
var gscReasonGroupSchema = z71.object({
|
|
22181
|
+
reason: z71.string(),
|
|
22182
|
+
count: z71.number(),
|
|
22183
|
+
urls: z71.array(gscUrlInspectionDtoSchema).default([])
|
|
22184
|
+
});
|
|
22185
|
+
var gscCoverageSummaryDtoSchema = z71.object({
|
|
22186
|
+
summary: z71.object({
|
|
21884
22187
|
/** Inspected pages, each in exactly one of `indexed` / `notIndexed`. */
|
|
21885
|
-
total:
|
|
21886
|
-
indexed:
|
|
21887
|
-
notIndexed:
|
|
22188
|
+
total: z71.number(),
|
|
22189
|
+
indexed: z71.number(),
|
|
22190
|
+
notIndexed: z71.number(),
|
|
21888
22191
|
/** Pages whose latest inspection lost the indexed state of the one before it. */
|
|
21889
|
-
deindexed:
|
|
22192
|
+
deindexed: z71.number(),
|
|
21890
22193
|
/** `indexed / total` as a 0..100 percent rounded to one decimal; 0 when nothing was inspected. */
|
|
21891
22194
|
percentage: percent(),
|
|
21892
22195
|
/**
|
|
@@ -21894,92 +22197,92 @@ var gscCoverageSummaryDtoSchema = z70.object({
|
|
|
21894
22197
|
* full coverage still reads short of 100%. Null when nothing was
|
|
21895
22198
|
* inspected: an empty site has no coverage share, not a 0% one.
|
|
21896
22199
|
*/
|
|
21897
|
-
indexedShare: fraction(
|
|
22200
|
+
indexedShare: fraction(z71.number().min(0).max(1)).nullable(),
|
|
21898
22201
|
/** `notIndexed / total`, 0..1. With `indexedShare` it sums to 1. Null when nothing was inspected. */
|
|
21899
|
-
notIndexedShare: fraction(
|
|
22202
|
+
notIndexedShare: fraction(z71.number().min(0).max(1)).nullable()
|
|
21900
22203
|
}),
|
|
21901
|
-
lastInspectedAt:
|
|
21902
|
-
lastSyncedAt:
|
|
21903
|
-
indexed:
|
|
21904
|
-
notIndexed:
|
|
21905
|
-
deindexed:
|
|
21906
|
-
reasonGroups:
|
|
21907
|
-
});
|
|
21908
|
-
var indexingNotificationDtoSchema =
|
|
21909
|
-
url:
|
|
21910
|
-
type:
|
|
21911
|
-
notifiedAt:
|
|
21912
|
-
});
|
|
21913
|
-
var indexingRequestResultDtoSchema =
|
|
21914
|
-
url:
|
|
21915
|
-
type:
|
|
21916
|
-
notifiedAt:
|
|
21917
|
-
status:
|
|
21918
|
-
error:
|
|
21919
|
-
});
|
|
21920
|
-
var indexingRequestResponseDtoSchema =
|
|
21921
|
-
summary:
|
|
21922
|
-
total:
|
|
21923
|
-
succeeded:
|
|
21924
|
-
failed:
|
|
22204
|
+
lastInspectedAt: z71.string().nullable(),
|
|
22205
|
+
lastSyncedAt: z71.string().nullable(),
|
|
22206
|
+
indexed: z71.array(gscUrlInspectionDtoSchema).default([]),
|
|
22207
|
+
notIndexed: z71.array(gscUrlInspectionDtoSchema).default([]),
|
|
22208
|
+
deindexed: z71.array(gscDeindexedRowSchema).default([]),
|
|
22209
|
+
reasonGroups: z71.array(gscReasonGroupSchema).default([])
|
|
22210
|
+
});
|
|
22211
|
+
var indexingNotificationDtoSchema = z71.object({
|
|
22212
|
+
url: z71.string(),
|
|
22213
|
+
type: z71.enum(["URL_UPDATED", "URL_DELETED"]),
|
|
22214
|
+
notifiedAt: z71.string()
|
|
22215
|
+
});
|
|
22216
|
+
var indexingRequestResultDtoSchema = z71.object({
|
|
22217
|
+
url: z71.string(),
|
|
22218
|
+
type: z71.enum(["URL_UPDATED", "URL_DELETED"]),
|
|
22219
|
+
notifiedAt: z71.string(),
|
|
22220
|
+
status: z71.enum(["success", "error"]),
|
|
22221
|
+
error: z71.string().optional()
|
|
22222
|
+
});
|
|
22223
|
+
var indexingRequestResponseDtoSchema = z71.object({
|
|
22224
|
+
summary: z71.object({
|
|
22225
|
+
total: z71.number().int().nonnegative(),
|
|
22226
|
+
succeeded: z71.number().int().nonnegative(),
|
|
22227
|
+
failed: z71.number().int().nonnegative()
|
|
21925
22228
|
}),
|
|
21926
|
-
results:
|
|
22229
|
+
results: z71.array(indexingRequestResultDtoSchema).default([])
|
|
21927
22230
|
});
|
|
21928
|
-
var gscCoverageSnapshotDtoSchema =
|
|
21929
|
-
date:
|
|
21930
|
-
indexed:
|
|
21931
|
-
notIndexed:
|
|
22231
|
+
var gscCoverageSnapshotDtoSchema = z71.object({
|
|
22232
|
+
date: z71.string(),
|
|
22233
|
+
indexed: z71.number(),
|
|
22234
|
+
notIndexed: z71.number(),
|
|
21932
22235
|
/**
|
|
21933
22236
|
* Pages with no evidence either way — no impressions in the window and never
|
|
21934
22237
|
* inspected. Deliberately NOT folded into `notIndexed`: absence of
|
|
21935
22238
|
* impressions is not evidence of exclusion, and merging the two would report
|
|
21936
22239
|
* every unmeasured page as a problem.
|
|
21937
22240
|
*/
|
|
21938
|
-
unknownPages:
|
|
22241
|
+
unknownPages: z71.number().default(0),
|
|
21939
22242
|
/** Of the total, how many carry a real URL Inspection verdict. */
|
|
21940
|
-
verifiedByInspection:
|
|
22243
|
+
verifiedByInspection: z71.number().default(0),
|
|
21941
22244
|
/** Pages proven indexed by impressions alone, costing no inspection quota. */
|
|
21942
|
-
derivedFromImpressions:
|
|
21943
|
-
reasonBreakdown:
|
|
22245
|
+
derivedFromImpressions: z71.number().default(0),
|
|
22246
|
+
reasonBreakdown: z71.record(z71.string(), z71.number()).default({})
|
|
21944
22247
|
});
|
|
21945
|
-
var gscSiteDtoSchema =
|
|
21946
|
-
siteUrl:
|
|
21947
|
-
permissionLevel:
|
|
22248
|
+
var gscSiteDtoSchema = z71.object({
|
|
22249
|
+
siteUrl: z71.string(),
|
|
22250
|
+
permissionLevel: z71.string()
|
|
21948
22251
|
});
|
|
21949
|
-
var gscSiteListResponseDtoSchema =
|
|
21950
|
-
sites:
|
|
22252
|
+
var gscSiteListResponseDtoSchema = z71.object({
|
|
22253
|
+
sites: z71.array(gscSiteDtoSchema).default([])
|
|
21951
22254
|
});
|
|
21952
|
-
var gscSitemapContentDtoSchema =
|
|
21953
|
-
type:
|
|
21954
|
-
submitted:
|
|
22255
|
+
var gscSitemapContentDtoSchema = z71.object({
|
|
22256
|
+
type: z71.string(),
|
|
22257
|
+
submitted: z71.string(),
|
|
21955
22258
|
// Google still returns this for existing sitemap reads, but it is not a
|
|
21956
22259
|
// reliable submission outcome. Retained only for response compatibility.
|
|
21957
|
-
indexed:
|
|
21958
|
-
});
|
|
21959
|
-
var gscSitemapDtoSchema =
|
|
21960
|
-
path:
|
|
21961
|
-
parentSitemapUrl:
|
|
21962
|
-
lastSubmitted:
|
|
21963
|
-
isPending:
|
|
21964
|
-
isSitemapsIndex:
|
|
21965
|
-
type:
|
|
21966
|
-
lastDownloaded:
|
|
21967
|
-
warnings:
|
|
21968
|
-
errors:
|
|
21969
|
-
contents:
|
|
21970
|
-
});
|
|
21971
|
-
var gscSitemapListResponseDtoSchema =
|
|
21972
|
-
sitemaps:
|
|
21973
|
-
summary:
|
|
21974
|
-
total:
|
|
21975
|
-
indexes:
|
|
21976
|
-
files:
|
|
22260
|
+
indexed: z71.string().optional().describe("Deprecated compatibility field.")
|
|
22261
|
+
});
|
|
22262
|
+
var gscSitemapDtoSchema = z71.object({
|
|
22263
|
+
path: z71.string(),
|
|
22264
|
+
parentSitemapUrl: z71.string().optional(),
|
|
22265
|
+
lastSubmitted: z71.string().optional(),
|
|
22266
|
+
isPending: z71.boolean().optional(),
|
|
22267
|
+
isSitemapsIndex: z71.boolean().optional(),
|
|
22268
|
+
type: z71.string().optional(),
|
|
22269
|
+
lastDownloaded: z71.string().optional(),
|
|
22270
|
+
warnings: z71.string().optional(),
|
|
22271
|
+
errors: z71.string().optional(),
|
|
22272
|
+
contents: z71.array(gscSitemapContentDtoSchema).optional()
|
|
22273
|
+
});
|
|
22274
|
+
var gscSitemapListResponseDtoSchema = z71.object({
|
|
22275
|
+
sitemaps: z71.array(gscSitemapDtoSchema).default([]),
|
|
22276
|
+
summary: z71.object({
|
|
22277
|
+
total: z71.number().int().nonnegative(),
|
|
22278
|
+
indexes: z71.number().int().nonnegative(),
|
|
22279
|
+
files: z71.number().int().nonnegative()
|
|
21977
22280
|
}),
|
|
21978
|
-
preferredSubmissionUrls:
|
|
22281
|
+
preferredSubmissionUrls: z71.array(z71.string()).default([])
|
|
21979
22282
|
});
|
|
21980
|
-
var gscSubmitSitemapsRequestDtoSchema =
|
|
21981
|
-
sitemapUrls:
|
|
21982
|
-
|
|
22283
|
+
var gscSubmitSitemapsRequestDtoSchema = z71.object({
|
|
22284
|
+
sitemapUrls: z71.array(
|
|
22285
|
+
z71.string().url().refine(
|
|
21983
22286
|
(value) => {
|
|
21984
22287
|
const protocol = new URL(value).protocol;
|
|
21985
22288
|
return protocol === "http:" || protocol === "https:";
|
|
@@ -21988,30 +22291,30 @@ var gscSubmitSitemapsRequestDtoSchema = z70.object({
|
|
|
21988
22291
|
)
|
|
21989
22292
|
).min(1).max(50)
|
|
21990
22293
|
});
|
|
21991
|
-
var gscSubmitSitemapResultDtoSchema =
|
|
21992
|
-
sitemapUrl:
|
|
21993
|
-
status:
|
|
21994
|
-
submittedAt:
|
|
21995
|
-
error:
|
|
21996
|
-
});
|
|
21997
|
-
var gscSubmitSitemapsResponseDtoSchema =
|
|
21998
|
-
summary:
|
|
21999
|
-
total:
|
|
22000
|
-
accepted:
|
|
22001
|
-
failed:
|
|
22294
|
+
var gscSubmitSitemapResultDtoSchema = z71.object({
|
|
22295
|
+
sitemapUrl: z71.string(),
|
|
22296
|
+
status: z71.enum(["accepted", "error"]),
|
|
22297
|
+
submittedAt: z71.string().optional(),
|
|
22298
|
+
error: z71.string().optional()
|
|
22299
|
+
});
|
|
22300
|
+
var gscSubmitSitemapsResponseDtoSchema = z71.object({
|
|
22301
|
+
summary: z71.object({
|
|
22302
|
+
total: z71.number().int().nonnegative(),
|
|
22303
|
+
accepted: z71.number().int().nonnegative(),
|
|
22304
|
+
failed: z71.number().int().nonnegative()
|
|
22002
22305
|
}),
|
|
22003
|
-
results:
|
|
22004
|
-
});
|
|
22005
|
-
var gscDiscoverSitemapsResponseDtoSchema =
|
|
22006
|
-
sitemaps:
|
|
22007
|
-
primarySitemapUrl:
|
|
22008
|
-
run:
|
|
22009
|
-
id:
|
|
22010
|
-
projectId:
|
|
22011
|
-
kind:
|
|
22012
|
-
status:
|
|
22013
|
-
trigger:
|
|
22014
|
-
createdAt:
|
|
22306
|
+
results: z71.array(gscSubmitSitemapResultDtoSchema)
|
|
22307
|
+
});
|
|
22308
|
+
var gscDiscoverSitemapsResponseDtoSchema = z71.object({
|
|
22309
|
+
sitemaps: z71.array(gscSitemapDtoSchema),
|
|
22310
|
+
primarySitemapUrl: z71.string(),
|
|
22311
|
+
run: z71.object({
|
|
22312
|
+
id: z71.string(),
|
|
22313
|
+
projectId: z71.string(),
|
|
22314
|
+
kind: z71.string(),
|
|
22315
|
+
status: z71.string(),
|
|
22316
|
+
trigger: z71.string(),
|
|
22317
|
+
createdAt: z71.string()
|
|
22015
22318
|
}).nullable()
|
|
22016
22319
|
});
|
|
22017
22320
|
|
|
@@ -22130,255 +22433,255 @@ async function mapWithConcurrency(items, concurrency, fn) {
|
|
|
22130
22433
|
}
|
|
22131
22434
|
|
|
22132
22435
|
// ../contracts/src/bing.ts
|
|
22133
|
-
import { z as
|
|
22134
|
-
var bingConnectionDtoSchema =
|
|
22135
|
-
id:
|
|
22136
|
-
domain:
|
|
22137
|
-
siteUrl:
|
|
22138
|
-
createdAt:
|
|
22139
|
-
updatedAt:
|
|
22140
|
-
});
|
|
22141
|
-
var bingUrlInspectionDtoSchema =
|
|
22142
|
-
id:
|
|
22143
|
-
url:
|
|
22144
|
-
httpCode:
|
|
22145
|
-
inIndex:
|
|
22146
|
-
lastCrawledDate:
|
|
22147
|
-
inIndexDate:
|
|
22148
|
-
inspectedAt:
|
|
22436
|
+
import { z as z72 } from "zod";
|
|
22437
|
+
var bingConnectionDtoSchema = z72.object({
|
|
22438
|
+
id: z72.string(),
|
|
22439
|
+
domain: z72.string(),
|
|
22440
|
+
siteUrl: z72.string().nullable().optional(),
|
|
22441
|
+
createdAt: z72.string(),
|
|
22442
|
+
updatedAt: z72.string()
|
|
22443
|
+
});
|
|
22444
|
+
var bingUrlInspectionDtoSchema = z72.object({
|
|
22445
|
+
id: z72.string(),
|
|
22446
|
+
url: z72.string(),
|
|
22447
|
+
httpCode: z72.number().nullable().optional(),
|
|
22448
|
+
inIndex: z72.boolean().nullable().optional(),
|
|
22449
|
+
lastCrawledDate: z72.string().nullable().optional(),
|
|
22450
|
+
inIndexDate: z72.string().nullable().optional(),
|
|
22451
|
+
inspectedAt: z72.string(),
|
|
22149
22452
|
// Fields derived from GetUrlInfo response (more reliable than InIndex)
|
|
22150
|
-
documentSize:
|
|
22151
|
-
anchorCount:
|
|
22152
|
-
discoveryDate:
|
|
22153
|
-
});
|
|
22154
|
-
var bingCoverageSummaryDtoSchema =
|
|
22155
|
-
summary:
|
|
22156
|
-
total:
|
|
22157
|
-
indexed:
|
|
22158
|
-
notIndexed:
|
|
22159
|
-
unknown:
|
|
22453
|
+
documentSize: z72.number().nullable().optional(),
|
|
22454
|
+
anchorCount: z72.number().nullable().optional(),
|
|
22455
|
+
discoveryDate: z72.string().nullable().optional()
|
|
22456
|
+
});
|
|
22457
|
+
var bingCoverageSummaryDtoSchema = z72.object({
|
|
22458
|
+
summary: z72.object({
|
|
22459
|
+
total: z72.number(),
|
|
22460
|
+
indexed: z72.number(),
|
|
22461
|
+
notIndexed: z72.number(),
|
|
22462
|
+
unknown: z72.number().optional(),
|
|
22160
22463
|
percentage: percent()
|
|
22161
22464
|
}),
|
|
22162
|
-
lastInspectedAt:
|
|
22163
|
-
indexed:
|
|
22164
|
-
notIndexed:
|
|
22165
|
-
unknown:
|
|
22166
|
-
});
|
|
22167
|
-
var bingKeywordStatsDtoSchema =
|
|
22168
|
-
query:
|
|
22169
|
-
impressions:
|
|
22170
|
-
clicks:
|
|
22465
|
+
lastInspectedAt: z72.string().nullable(),
|
|
22466
|
+
indexed: z72.array(bingUrlInspectionDtoSchema).default([]),
|
|
22467
|
+
notIndexed: z72.array(bingUrlInspectionDtoSchema).default([]),
|
|
22468
|
+
unknown: z72.array(bingUrlInspectionDtoSchema).default([]).optional()
|
|
22469
|
+
});
|
|
22470
|
+
var bingKeywordStatsDtoSchema = z72.object({
|
|
22471
|
+
query: z72.string(),
|
|
22472
|
+
impressions: z72.number(),
|
|
22473
|
+
clicks: z72.number(),
|
|
22171
22474
|
ctr: fraction(),
|
|
22172
|
-
averagePosition:
|
|
22173
|
-
});
|
|
22174
|
-
var bingCoverageSnapshotDtoSchema =
|
|
22175
|
-
date:
|
|
22176
|
-
indexed:
|
|
22177
|
-
notIndexed:
|
|
22178
|
-
unknown:
|
|
22179
|
-
});
|
|
22180
|
-
var bingSubmitResultDtoSchema =
|
|
22181
|
-
url:
|
|
22182
|
-
status:
|
|
22183
|
-
submittedAt:
|
|
22184
|
-
error:
|
|
22185
|
-
});
|
|
22186
|
-
var bingIndexingRequestResponseDtoSchema =
|
|
22187
|
-
summary:
|
|
22188
|
-
total:
|
|
22189
|
-
succeeded:
|
|
22190
|
-
failed:
|
|
22475
|
+
averagePosition: z72.number()
|
|
22476
|
+
});
|
|
22477
|
+
var bingCoverageSnapshotDtoSchema = z72.object({
|
|
22478
|
+
date: z72.string(),
|
|
22479
|
+
indexed: z72.number(),
|
|
22480
|
+
notIndexed: z72.number(),
|
|
22481
|
+
unknown: z72.number()
|
|
22482
|
+
});
|
|
22483
|
+
var bingSubmitResultDtoSchema = z72.object({
|
|
22484
|
+
url: z72.string(),
|
|
22485
|
+
status: z72.enum(["success", "error"]),
|
|
22486
|
+
submittedAt: z72.string(),
|
|
22487
|
+
error: z72.string().optional()
|
|
22488
|
+
});
|
|
22489
|
+
var bingIndexingRequestResponseDtoSchema = z72.object({
|
|
22490
|
+
summary: z72.object({
|
|
22491
|
+
total: z72.number().int().nonnegative(),
|
|
22492
|
+
succeeded: z72.number().int().nonnegative(),
|
|
22493
|
+
failed: z72.number().int().nonnegative()
|
|
22191
22494
|
}),
|
|
22192
|
-
results:
|
|
22495
|
+
results: z72.array(bingSubmitResultDtoSchema).default([])
|
|
22193
22496
|
});
|
|
22194
|
-
var bingSiteDtoSchema =
|
|
22195
|
-
url:
|
|
22196
|
-
verified:
|
|
22497
|
+
var bingSiteDtoSchema = z72.object({
|
|
22498
|
+
url: z72.string(),
|
|
22499
|
+
verified: z72.boolean()
|
|
22197
22500
|
});
|
|
22198
|
-
var bingSitesResponseDtoSchema =
|
|
22199
|
-
sites:
|
|
22501
|
+
var bingSitesResponseDtoSchema = z72.object({
|
|
22502
|
+
sites: z72.array(bingSiteDtoSchema).default([])
|
|
22200
22503
|
});
|
|
22201
|
-
var bingStatusDtoSchema =
|
|
22202
|
-
connected:
|
|
22203
|
-
domain:
|
|
22204
|
-
siteUrl:
|
|
22205
|
-
createdAt:
|
|
22206
|
-
updatedAt:
|
|
22504
|
+
var bingStatusDtoSchema = z72.object({
|
|
22505
|
+
connected: z72.boolean(),
|
|
22506
|
+
domain: z72.string(),
|
|
22507
|
+
siteUrl: z72.string().nullable(),
|
|
22508
|
+
createdAt: z72.string().nullable(),
|
|
22509
|
+
updatedAt: z72.string().nullable()
|
|
22207
22510
|
});
|
|
22208
|
-
var bingConnectResponseDtoSchema =
|
|
22209
|
-
connected:
|
|
22210
|
-
domain:
|
|
22211
|
-
siteUrl:
|
|
22212
|
-
availableSites:
|
|
22511
|
+
var bingConnectResponseDtoSchema = z72.object({
|
|
22512
|
+
connected: z72.boolean(),
|
|
22513
|
+
domain: z72.string(),
|
|
22514
|
+
siteUrl: z72.string().nullable(),
|
|
22515
|
+
availableSites: z72.array(bingSiteDtoSchema).default([])
|
|
22213
22516
|
});
|
|
22214
|
-
var bingSetSiteResponseDtoSchema =
|
|
22215
|
-
siteUrl:
|
|
22517
|
+
var bingSetSiteResponseDtoSchema = z72.object({
|
|
22518
|
+
siteUrl: z72.string()
|
|
22216
22519
|
});
|
|
22217
22520
|
|
|
22218
22521
|
// ../contracts/src/cdp.ts
|
|
22219
|
-
import { z as
|
|
22220
|
-
var cdpTargetStatusDtoSchema =
|
|
22221
|
-
name:
|
|
22222
|
-
alive:
|
|
22223
|
-
lastUsed:
|
|
22522
|
+
import { z as z73 } from "zod";
|
|
22523
|
+
var cdpTargetStatusDtoSchema = z73.object({
|
|
22524
|
+
name: z73.string(),
|
|
22525
|
+
alive: z73.boolean(),
|
|
22526
|
+
lastUsed: z73.string().nullable()
|
|
22224
22527
|
});
|
|
22225
|
-
var cdpStatusDtoSchema =
|
|
22226
|
-
connected:
|
|
22227
|
-
endpoint:
|
|
22228
|
-
version:
|
|
22229
|
-
browserVersion:
|
|
22230
|
-
targets:
|
|
22528
|
+
var cdpStatusDtoSchema = z73.object({
|
|
22529
|
+
connected: z73.boolean(),
|
|
22530
|
+
endpoint: z73.string(),
|
|
22531
|
+
version: z73.string().optional(),
|
|
22532
|
+
browserVersion: z73.string().optional(),
|
|
22533
|
+
targets: z73.array(cdpTargetStatusDtoSchema).default([])
|
|
22231
22534
|
});
|
|
22232
22535
|
|
|
22233
22536
|
// ../contracts/src/wordpress.ts
|
|
22234
|
-
import { z as
|
|
22235
|
-
var wordpressEnvSchema =
|
|
22236
|
-
var wordpressConnectionDtoSchema =
|
|
22237
|
-
projectName:
|
|
22238
|
-
url:
|
|
22239
|
-
stagingUrl:
|
|
22240
|
-
username:
|
|
22537
|
+
import { z as z74 } from "zod";
|
|
22538
|
+
var wordpressEnvSchema = z74.enum(["live", "staging"]);
|
|
22539
|
+
var wordpressConnectionDtoSchema = z74.object({
|
|
22540
|
+
projectName: z74.string(),
|
|
22541
|
+
url: z74.string(),
|
|
22542
|
+
stagingUrl: z74.string().optional(),
|
|
22543
|
+
username: z74.string(),
|
|
22241
22544
|
defaultEnv: wordpressEnvSchema,
|
|
22242
|
-
createdAt:
|
|
22243
|
-
updatedAt:
|
|
22244
|
-
});
|
|
22245
|
-
var wordpressSiteStatusDtoSchema =
|
|
22246
|
-
url:
|
|
22247
|
-
reachable:
|
|
22248
|
-
pageCount:
|
|
22249
|
-
version:
|
|
22250
|
-
error:
|
|
22251
|
-
plugins:
|
|
22252
|
-
authenticatedUser:
|
|
22253
|
-
id:
|
|
22254
|
-
slug:
|
|
22545
|
+
createdAt: z74.string(),
|
|
22546
|
+
updatedAt: z74.string()
|
|
22547
|
+
});
|
|
22548
|
+
var wordpressSiteStatusDtoSchema = z74.object({
|
|
22549
|
+
url: z74.string(),
|
|
22550
|
+
reachable: z74.boolean(),
|
|
22551
|
+
pageCount: z74.number().nullable().optional(),
|
|
22552
|
+
version: z74.string().nullable().optional(),
|
|
22553
|
+
error: z74.string().nullable().optional(),
|
|
22554
|
+
plugins: z74.array(z74.string()).optional(),
|
|
22555
|
+
authenticatedUser: z74.object({
|
|
22556
|
+
id: z74.number(),
|
|
22557
|
+
slug: z74.string()
|
|
22255
22558
|
}).nullable().optional()
|
|
22256
22559
|
});
|
|
22257
|
-
var wordpressStatusDtoSchema =
|
|
22258
|
-
connected:
|
|
22259
|
-
projectName:
|
|
22560
|
+
var wordpressStatusDtoSchema = z74.object({
|
|
22561
|
+
connected: z74.boolean(),
|
|
22562
|
+
projectName: z74.string(),
|
|
22260
22563
|
defaultEnv: wordpressEnvSchema,
|
|
22261
22564
|
live: wordpressSiteStatusDtoSchema.nullable(),
|
|
22262
22565
|
staging: wordpressSiteStatusDtoSchema.nullable(),
|
|
22263
|
-
adminUrl:
|
|
22566
|
+
adminUrl: z74.string().nullable().optional()
|
|
22264
22567
|
});
|
|
22265
|
-
var wordpressPageSummaryDtoSchema =
|
|
22266
|
-
id:
|
|
22267
|
-
slug:
|
|
22268
|
-
title:
|
|
22269
|
-
status:
|
|
22270
|
-
modifiedAt:
|
|
22271
|
-
link:
|
|
22568
|
+
var wordpressPageSummaryDtoSchema = z74.object({
|
|
22569
|
+
id: z74.number(),
|
|
22570
|
+
slug: z74.string(),
|
|
22571
|
+
title: z74.string(),
|
|
22572
|
+
status: z74.string(),
|
|
22573
|
+
modifiedAt: z74.string().nullable().optional(),
|
|
22574
|
+
link: z74.string().nullable().optional()
|
|
22272
22575
|
});
|
|
22273
|
-
var wordpressPageListDtoSchema =
|
|
22576
|
+
var wordpressPageListDtoSchema = z74.object({
|
|
22274
22577
|
env: wordpressEnvSchema,
|
|
22275
|
-
pages:
|
|
22578
|
+
pages: z74.array(wordpressPageSummaryDtoSchema)
|
|
22276
22579
|
});
|
|
22277
|
-
var wordpressSeoStateDtoSchema =
|
|
22278
|
-
title:
|
|
22279
|
-
description:
|
|
22280
|
-
noindex:
|
|
22281
|
-
writable:
|
|
22282
|
-
writeTargets:
|
|
22580
|
+
var wordpressSeoStateDtoSchema = z74.object({
|
|
22581
|
+
title: z74.string().nullable(),
|
|
22582
|
+
description: z74.string().nullable(),
|
|
22583
|
+
noindex: z74.boolean().nullable(),
|
|
22584
|
+
writable: z74.boolean().default(false),
|
|
22585
|
+
writeTargets: z74.array(z74.string()).default([])
|
|
22283
22586
|
});
|
|
22284
|
-
var wordpressSchemaBlockDtoSchema =
|
|
22285
|
-
type:
|
|
22286
|
-
json:
|
|
22587
|
+
var wordpressSchemaBlockDtoSchema = z74.object({
|
|
22588
|
+
type: z74.string(),
|
|
22589
|
+
json: z74.record(z74.string(), z74.unknown())
|
|
22287
22590
|
});
|
|
22288
22591
|
var wordpressPageDetailDtoSchema = wordpressPageSummaryDtoSchema.extend({
|
|
22289
22592
|
env: wordpressEnvSchema,
|
|
22290
|
-
content:
|
|
22593
|
+
content: z74.string(),
|
|
22291
22594
|
seo: wordpressSeoStateDtoSchema,
|
|
22292
|
-
schemaBlocks:
|
|
22595
|
+
schemaBlocks: z74.array(wordpressSchemaBlockDtoSchema).default([])
|
|
22293
22596
|
});
|
|
22294
22597
|
var wordpressDiffPageDtoSchema = wordpressPageDetailDtoSchema.extend({
|
|
22295
|
-
contentHash:
|
|
22296
|
-
contentSnippet:
|
|
22297
|
-
});
|
|
22298
|
-
var wordpressManualAssistDtoSchema =
|
|
22299
|
-
manualRequired:
|
|
22300
|
-
targetUrl:
|
|
22301
|
-
adminUrl:
|
|
22302
|
-
content:
|
|
22303
|
-
nextSteps:
|
|
22304
|
-
});
|
|
22305
|
-
var wordpressAuditIssueDtoSchema =
|
|
22306
|
-
slug:
|
|
22307
|
-
severity:
|
|
22308
|
-
code:
|
|
22598
|
+
contentHash: z74.string(),
|
|
22599
|
+
contentSnippet: z74.string()
|
|
22600
|
+
});
|
|
22601
|
+
var wordpressManualAssistDtoSchema = z74.object({
|
|
22602
|
+
manualRequired: z74.literal(true),
|
|
22603
|
+
targetUrl: z74.string(),
|
|
22604
|
+
adminUrl: z74.string().nullable().optional(),
|
|
22605
|
+
content: z74.string(),
|
|
22606
|
+
nextSteps: z74.array(z74.string()).default([])
|
|
22607
|
+
});
|
|
22608
|
+
var wordpressAuditIssueDtoSchema = z74.object({
|
|
22609
|
+
slug: z74.string(),
|
|
22610
|
+
severity: z74.enum(["high", "medium", "low"]),
|
|
22611
|
+
code: z74.enum([
|
|
22309
22612
|
"noindex",
|
|
22310
22613
|
"missing-seo-title",
|
|
22311
22614
|
"missing-meta-description",
|
|
22312
22615
|
"missing-schema",
|
|
22313
22616
|
"thin-content"
|
|
22314
22617
|
]),
|
|
22315
|
-
message:
|
|
22618
|
+
message: z74.string()
|
|
22316
22619
|
});
|
|
22317
|
-
var wordpressAuditPageDtoSchema =
|
|
22318
|
-
slug:
|
|
22319
|
-
title:
|
|
22320
|
-
status:
|
|
22321
|
-
wordCount:
|
|
22620
|
+
var wordpressAuditPageDtoSchema = z74.object({
|
|
22621
|
+
slug: z74.string(),
|
|
22622
|
+
title: z74.string(),
|
|
22623
|
+
status: z74.string(),
|
|
22624
|
+
wordCount: z74.number(),
|
|
22322
22625
|
seo: wordpressSeoStateDtoSchema,
|
|
22323
|
-
schemaPresent:
|
|
22324
|
-
issues:
|
|
22626
|
+
schemaPresent: z74.boolean(),
|
|
22627
|
+
issues: z74.array(wordpressAuditIssueDtoSchema).default([])
|
|
22325
22628
|
});
|
|
22326
|
-
var wordpressBulkMetaEntryResultDtoSchema =
|
|
22327
|
-
slug:
|
|
22328
|
-
status:
|
|
22329
|
-
error:
|
|
22629
|
+
var wordpressBulkMetaEntryResultDtoSchema = z74.object({
|
|
22630
|
+
slug: z74.string(),
|
|
22631
|
+
status: z74.enum(["applied", "skipped", "manual"]),
|
|
22632
|
+
error: z74.string().optional(),
|
|
22330
22633
|
manualAssist: wordpressManualAssistDtoSchema.optional()
|
|
22331
22634
|
});
|
|
22332
|
-
var wordpressBulkMetaResultDtoSchema =
|
|
22635
|
+
var wordpressBulkMetaResultDtoSchema = z74.object({
|
|
22333
22636
|
env: wordpressEnvSchema,
|
|
22334
|
-
strategy:
|
|
22335
|
-
results:
|
|
22637
|
+
strategy: z74.enum(["plugin", "manual"]),
|
|
22638
|
+
results: z74.array(wordpressBulkMetaEntryResultDtoSchema)
|
|
22336
22639
|
});
|
|
22337
|
-
var wordpressSchemaDeployEntryResultDtoSchema =
|
|
22338
|
-
slug:
|
|
22339
|
-
status:
|
|
22340
|
-
schemasInjected:
|
|
22640
|
+
var wordpressSchemaDeployEntryResultDtoSchema = z74.object({
|
|
22641
|
+
slug: z74.string(),
|
|
22642
|
+
status: z74.enum(["deployed", "stripped", "skipped", "failed"]),
|
|
22643
|
+
schemasInjected: z74.array(z74.string()).optional(),
|
|
22341
22644
|
manualAssist: wordpressManualAssistDtoSchema.optional(),
|
|
22342
|
-
error:
|
|
22645
|
+
error: z74.string().optional()
|
|
22343
22646
|
});
|
|
22344
|
-
var wordpressSchemaDeployResultDtoSchema =
|
|
22647
|
+
var wordpressSchemaDeployResultDtoSchema = z74.object({
|
|
22345
22648
|
env: wordpressEnvSchema,
|
|
22346
|
-
results:
|
|
22649
|
+
results: z74.array(wordpressSchemaDeployEntryResultDtoSchema)
|
|
22347
22650
|
});
|
|
22348
|
-
var wordpressSchemaStatusPageDtoSchema =
|
|
22349
|
-
slug:
|
|
22350
|
-
title:
|
|
22351
|
-
canonrySchemas:
|
|
22352
|
-
thirdPartySchemas:
|
|
22353
|
-
hasCanonrySchema:
|
|
22651
|
+
var wordpressSchemaStatusPageDtoSchema = z74.object({
|
|
22652
|
+
slug: z74.string(),
|
|
22653
|
+
title: z74.string(),
|
|
22654
|
+
canonrySchemas: z74.array(z74.string()),
|
|
22655
|
+
thirdPartySchemas: z74.array(z74.string()),
|
|
22656
|
+
hasCanonrySchema: z74.boolean()
|
|
22354
22657
|
});
|
|
22355
|
-
var wordpressSchemaStatusResultDtoSchema =
|
|
22658
|
+
var wordpressSchemaStatusResultDtoSchema = z74.object({
|
|
22356
22659
|
env: wordpressEnvSchema,
|
|
22357
|
-
pages:
|
|
22660
|
+
pages: z74.array(wordpressSchemaStatusPageDtoSchema)
|
|
22358
22661
|
});
|
|
22359
|
-
var wordpressOnboardStepDtoSchema =
|
|
22360
|
-
name:
|
|
22361
|
-
status:
|
|
22362
|
-
summary:
|
|
22363
|
-
error:
|
|
22662
|
+
var wordpressOnboardStepDtoSchema = z74.object({
|
|
22663
|
+
name: z74.string(),
|
|
22664
|
+
status: z74.enum(["completed", "skipped", "failed"]),
|
|
22665
|
+
summary: z74.string().optional(),
|
|
22666
|
+
error: z74.string().optional()
|
|
22364
22667
|
});
|
|
22365
|
-
var wordpressOnboardResultDtoSchema =
|
|
22366
|
-
projectName:
|
|
22367
|
-
steps:
|
|
22668
|
+
var wordpressOnboardResultDtoSchema = z74.object({
|
|
22669
|
+
projectName: z74.string(),
|
|
22670
|
+
steps: z74.array(wordpressOnboardStepDtoSchema)
|
|
22368
22671
|
});
|
|
22369
|
-
var wordpressDiffDtoSchema =
|
|
22370
|
-
slug:
|
|
22672
|
+
var wordpressDiffDtoSchema = z74.object({
|
|
22673
|
+
slug: z74.string(),
|
|
22371
22674
|
live: wordpressDiffPageDtoSchema,
|
|
22372
22675
|
staging: wordpressDiffPageDtoSchema,
|
|
22373
|
-
hasDifferences:
|
|
22374
|
-
differences:
|
|
22375
|
-
title:
|
|
22376
|
-
slug:
|
|
22377
|
-
content:
|
|
22378
|
-
seoTitle:
|
|
22379
|
-
seoDescription:
|
|
22380
|
-
noindex:
|
|
22381
|
-
schema:
|
|
22676
|
+
hasDifferences: z74.boolean(),
|
|
22677
|
+
differences: z74.object({
|
|
22678
|
+
title: z74.boolean(),
|
|
22679
|
+
slug: z74.boolean(),
|
|
22680
|
+
content: z74.boolean(),
|
|
22681
|
+
seoTitle: z74.boolean(),
|
|
22682
|
+
seoDescription: z74.boolean(),
|
|
22683
|
+
noindex: z74.boolean(),
|
|
22684
|
+
schema: z74.boolean()
|
|
22382
22685
|
})
|
|
22383
22686
|
});
|
|
22384
22687
|
|
|
@@ -22561,61 +22864,61 @@ var LlmCapabilities = {
|
|
|
22561
22864
|
var LLM_CAPABILITIES = Object.values(LlmCapabilities);
|
|
22562
22865
|
|
|
22563
22866
|
// ../contracts/src/status.ts
|
|
22564
|
-
import { z as
|
|
22565
|
-
var statusIntegrationSchema =
|
|
22867
|
+
import { z as z75 } from "zod";
|
|
22868
|
+
var statusIntegrationSchema = z75.enum(["gsc", "ga", "gbp", "bing", "ads", "google-ads", "gtm", "traffic"]);
|
|
22566
22869
|
var StatusIntegrations = statusIntegrationSchema.enum;
|
|
22567
|
-
var integrationStateSchema =
|
|
22870
|
+
var integrationStateSchema = z75.enum(["ok", "failing", "stale", "never-synced"]);
|
|
22568
22871
|
var IntegrationStates = integrationStateSchema.enum;
|
|
22569
|
-
var dateTimeSchema2 =
|
|
22570
|
-
var dateSchema =
|
|
22571
|
-
var integrationStatusRowSchema =
|
|
22872
|
+
var dateTimeSchema2 = z75.string().datetime({ offset: true });
|
|
22873
|
+
var dateSchema = z75.string().regex(/^\d{4}-\d{2}-\d{2}$/);
|
|
22874
|
+
var integrationStatusRowSchema = z75.object({
|
|
22572
22875
|
integration: statusIntegrationSchema,
|
|
22573
|
-
label:
|
|
22876
|
+
label: z75.string(),
|
|
22574
22877
|
runKind: runKindSchema,
|
|
22575
|
-
sourceId:
|
|
22878
|
+
sourceId: z75.string().nullable(),
|
|
22576
22879
|
state: integrationStateSchema,
|
|
22577
22880
|
lastSuccessAt: dateTimeSchema2.nullable(),
|
|
22578
22881
|
latestRunAt: dateTimeSchema2.nullable(),
|
|
22579
|
-
latestRunId:
|
|
22882
|
+
latestRunId: z75.string().nullable(),
|
|
22580
22883
|
latestStatus: runStatusSchema.nullable(),
|
|
22581
22884
|
latestTrigger: runTriggerSchema.nullable(),
|
|
22582
|
-
consecutiveFailures:
|
|
22583
|
-
latestError:
|
|
22885
|
+
consecutiveFailures: z75.number().int().nonnegative(),
|
|
22886
|
+
latestError: z75.string().max(300).nullable(),
|
|
22584
22887
|
dataThrough: dateSchema.nullable(),
|
|
22585
|
-
dataAgeDays:
|
|
22586
|
-
doctorChecks:
|
|
22888
|
+
dataAgeDays: z75.number().int().nonnegative().nullable(),
|
|
22889
|
+
doctorChecks: z75.array(z75.string())
|
|
22587
22890
|
});
|
|
22588
|
-
var statusHealthSchema =
|
|
22589
|
-
status:
|
|
22590
|
-
code:
|
|
22591
|
-
summary:
|
|
22891
|
+
var statusHealthSchema = z75.object({
|
|
22892
|
+
status: z75.enum(["ok", "warn", "fail"]),
|
|
22893
|
+
code: z75.string(),
|
|
22894
|
+
summary: z75.string(),
|
|
22592
22895
|
checkedAt: dateTimeSchema2,
|
|
22593
22896
|
notifiedAt: dateTimeSchema2.nullable()
|
|
22594
22897
|
});
|
|
22595
|
-
var projectStatusSchema =
|
|
22596
|
-
project:
|
|
22597
|
-
displayName:
|
|
22598
|
-
state:
|
|
22898
|
+
var projectStatusSchema = z75.object({
|
|
22899
|
+
project: z75.string(),
|
|
22900
|
+
displayName: z75.string(),
|
|
22901
|
+
state: z75.enum([...integrationStateSchema.options, "warning"]),
|
|
22599
22902
|
health: statusHealthSchema.nullable(),
|
|
22600
|
-
integrations:
|
|
22903
|
+
integrations: z75.array(integrationStatusRowSchema)
|
|
22601
22904
|
});
|
|
22602
|
-
var instanceStatusDtoSchema =
|
|
22905
|
+
var instanceStatusDtoSchema = z75.object({
|
|
22603
22906
|
generatedAt: dateTimeSchema2,
|
|
22604
22907
|
mcp: mcpHealthSchema.optional(),
|
|
22605
|
-
summary:
|
|
22606
|
-
projects:
|
|
22607
|
-
ok:
|
|
22608
|
-
failing:
|
|
22609
|
-
warning:
|
|
22610
|
-
stale:
|
|
22611
|
-
neverSynced:
|
|
22908
|
+
summary: z75.object({
|
|
22909
|
+
projects: z75.number().int().nonnegative(),
|
|
22910
|
+
ok: z75.number().int().nonnegative(),
|
|
22911
|
+
failing: z75.number().int().nonnegative(),
|
|
22912
|
+
warning: z75.number().int().nonnegative().optional(),
|
|
22913
|
+
stale: z75.number().int().nonnegative(),
|
|
22914
|
+
neverSynced: z75.number().int().nonnegative()
|
|
22612
22915
|
}),
|
|
22613
|
-
projects:
|
|
22916
|
+
projects: z75.array(projectStatusSchema)
|
|
22614
22917
|
});
|
|
22615
22918
|
|
|
22616
22919
|
// ../contracts/src/run-dispatch.ts
|
|
22617
|
-
import { z as
|
|
22618
|
-
var providerBatchRequestOutcomeSchema =
|
|
22920
|
+
import { z as z76 } from "zod";
|
|
22921
|
+
var providerBatchRequestOutcomeSchema = z76.enum([
|
|
22619
22922
|
"recorded",
|
|
22620
22923
|
"errored",
|
|
22621
22924
|
"expired",
|
|
@@ -22624,7 +22927,7 @@ var providerBatchRequestOutcomeSchema = z75.enum([
|
|
|
22624
22927
|
"duplicate"
|
|
22625
22928
|
]);
|
|
22626
22929
|
var ProviderBatchRequestOutcomes = providerBatchRequestOutcomeSchema.enum;
|
|
22627
|
-
var providerBatchIneligibilityReasonSchema =
|
|
22930
|
+
var providerBatchIneligibilityReasonSchema = z76.enum([
|
|
22628
22931
|
"not_plan_run",
|
|
22629
22932
|
"scoped_run",
|
|
22630
22933
|
"probe_run",
|
|
@@ -22727,18 +23030,18 @@ function summarizeRunUsage(rows) {
|
|
|
22727
23030
|
}
|
|
22728
23031
|
|
|
22729
23032
|
// ../contracts/src/snapshot.ts
|
|
22730
|
-
import { z as
|
|
22731
|
-
var snapshotProviderModeSchema =
|
|
23033
|
+
import { z as z77 } from "zod";
|
|
23034
|
+
var snapshotProviderModeSchema = z77.enum(["all", "api", "browser"]);
|
|
22732
23035
|
var SnapshotProviderModes = snapshotProviderModeSchema.enum;
|
|
22733
|
-
var snapshotAccuracySchema =
|
|
22734
|
-
var snapshotQueryListSchema =
|
|
22735
|
-
var snapshotRequestInputSchema =
|
|
22736
|
-
companyName:
|
|
22737
|
-
domain:
|
|
23036
|
+
var snapshotAccuracySchema = z77.enum(["yes", "no", "unknown", "not-mentioned"]);
|
|
23037
|
+
var snapshotQueryListSchema = z77.array(z77.string().min(1));
|
|
23038
|
+
var snapshotRequestInputSchema = z77.object({
|
|
23039
|
+
companyName: z77.string().min(1),
|
|
23040
|
+
domain: z77.string().min(1),
|
|
22738
23041
|
queries: snapshotQueryListSchema.optional(),
|
|
22739
23042
|
phrases: snapshotQueryListSchema.optional(),
|
|
22740
|
-
competitors:
|
|
22741
|
-
providers:
|
|
23043
|
+
competitors: z77.array(z77.string().min(1)).optional(),
|
|
23044
|
+
providers: z77.array(z77.string().trim().min(1)).min(1).optional().describe("Configured provider names to use for both answers and analysis. Omit to use all providers matching providerMode."),
|
|
22742
23045
|
providerMode: snapshotProviderModeSchema.optional().describe("Filter providers by transport; defaults to all. Browser-only selection requires manual queries and uses no API provider for analysis.")
|
|
22743
23046
|
}).superRefine((input, ctx) => {
|
|
22744
23047
|
if (input.queries !== void 0 && input.phrases !== void 0) {
|
|
@@ -22755,106 +23058,106 @@ var snapshotRequestSchema = snapshotRequestInputSchema.safeExtend({
|
|
|
22755
23058
|
function resolveSnapshotRequestQueries(input) {
|
|
22756
23059
|
return input.queries ?? input.phrases ?? [];
|
|
22757
23060
|
}
|
|
22758
|
-
var snapshotCompetitorEntrySchema =
|
|
22759
|
-
name:
|
|
22760
|
-
count:
|
|
22761
|
-
});
|
|
22762
|
-
var snapshotAuditFactorSchema =
|
|
22763
|
-
id:
|
|
22764
|
-
name:
|
|
22765
|
-
weight:
|
|
22766
|
-
score:
|
|
22767
|
-
findings:
|
|
22768
|
-
type:
|
|
22769
|
-
message:
|
|
23061
|
+
var snapshotCompetitorEntrySchema = z77.object({
|
|
23062
|
+
name: z77.string(),
|
|
23063
|
+
count: z77.number().int().nonnegative()
|
|
23064
|
+
});
|
|
23065
|
+
var snapshotAuditFactorSchema = z77.object({
|
|
23066
|
+
id: z77.string(),
|
|
23067
|
+
name: z77.string(),
|
|
23068
|
+
weight: z77.number(),
|
|
23069
|
+
score: z77.number(),
|
|
23070
|
+
findings: z77.array(z77.object({
|
|
23071
|
+
type: z77.string(),
|
|
23072
|
+
message: z77.string()
|
|
22770
23073
|
})).default([]),
|
|
22771
|
-
recommendations:
|
|
22772
|
-
});
|
|
22773
|
-
var snapshotAuditSchema =
|
|
22774
|
-
url:
|
|
22775
|
-
finalUrl:
|
|
22776
|
-
auditedAt:
|
|
22777
|
-
overallScore:
|
|
22778
|
-
summary:
|
|
22779
|
-
factors:
|
|
22780
|
-
});
|
|
22781
|
-
var snapshotProfileSchema =
|
|
22782
|
-
industry:
|
|
22783
|
-
summary:
|
|
22784
|
-
services:
|
|
22785
|
-
categoryTerms:
|
|
22786
|
-
});
|
|
22787
|
-
var snapshotProviderResultSchema =
|
|
22788
|
-
provider:
|
|
22789
|
-
displayName:
|
|
22790
|
-
model:
|
|
22791
|
-
mentioned:
|
|
22792
|
-
cited:
|
|
23074
|
+
recommendations: z77.array(z77.string()).default([])
|
|
23075
|
+
});
|
|
23076
|
+
var snapshotAuditSchema = z77.object({
|
|
23077
|
+
url: z77.string(),
|
|
23078
|
+
finalUrl: z77.string(),
|
|
23079
|
+
auditedAt: z77.string(),
|
|
23080
|
+
overallScore: z77.number(),
|
|
23081
|
+
summary: z77.string(),
|
|
23082
|
+
factors: z77.array(snapshotAuditFactorSchema).default([])
|
|
23083
|
+
});
|
|
23084
|
+
var snapshotProfileSchema = z77.object({
|
|
23085
|
+
industry: z77.string(),
|
|
23086
|
+
summary: z77.string(),
|
|
23087
|
+
services: z77.array(z77.string()).default([]),
|
|
23088
|
+
categoryTerms: z77.array(z77.string()).default([])
|
|
23089
|
+
});
|
|
23090
|
+
var snapshotProviderResultSchema = z77.object({
|
|
23091
|
+
provider: z77.string(),
|
|
23092
|
+
displayName: z77.string(),
|
|
23093
|
+
model: z77.string().nullable().optional(),
|
|
23094
|
+
mentioned: z77.boolean(),
|
|
23095
|
+
cited: z77.boolean(),
|
|
22793
23096
|
describedAccurately: snapshotAccuracySchema,
|
|
22794
|
-
accuracyNotes:
|
|
22795
|
-
incorrectClaims:
|
|
22796
|
-
recommendedCompetitors:
|
|
22797
|
-
citedDomains:
|
|
22798
|
-
groundingSources:
|
|
22799
|
-
searchQueries:
|
|
22800
|
-
answerText:
|
|
22801
|
-
error:
|
|
23097
|
+
accuracyNotes: z77.string().nullable().optional(),
|
|
23098
|
+
incorrectClaims: z77.array(z77.string()).default([]),
|
|
23099
|
+
recommendedCompetitors: z77.array(z77.string()).default([]),
|
|
23100
|
+
citedDomains: z77.array(z77.string()).default([]),
|
|
23101
|
+
groundingSources: z77.array(groundingSourceSchema).default([]),
|
|
23102
|
+
searchQueries: z77.array(z77.string()).default([]),
|
|
23103
|
+
answerText: z77.string(),
|
|
23104
|
+
error: z77.string().nullable().optional(),
|
|
22802
23105
|
/** Vendor-neutral answer evidence (answer services); absent for answer engines. */
|
|
22803
23106
|
evidence: answerEvidenceSchema.nullable().optional(),
|
|
22804
23107
|
/** False when the provider's sources are not tied to its answer, so `cited` was not measured. */
|
|
22805
|
-
citationMeasured:
|
|
23108
|
+
citationMeasured: z77.boolean().optional()
|
|
22806
23109
|
});
|
|
22807
|
-
var snapshotQueryResultSchema =
|
|
22808
|
-
query:
|
|
22809
|
-
providerResults:
|
|
23110
|
+
var snapshotQueryResultSchema = z77.object({
|
|
23111
|
+
query: z77.string(),
|
|
23112
|
+
providerResults: z77.array(snapshotProviderResultSchema).default([])
|
|
22810
23113
|
});
|
|
22811
|
-
var snapshotSummarySchema =
|
|
22812
|
-
totalQueries:
|
|
22813
|
-
totalProviders:
|
|
22814
|
-
totalComparisons:
|
|
22815
|
-
mentionCount:
|
|
23114
|
+
var snapshotSummarySchema = z77.object({
|
|
23115
|
+
totalQueries: z77.number().int().nonnegative(),
|
|
23116
|
+
totalProviders: z77.number().int().nonnegative(),
|
|
23117
|
+
totalComparisons: z77.number().int().nonnegative(),
|
|
23118
|
+
mentionCount: z77.number().int().nonnegative(),
|
|
22816
23119
|
/** Successful responses whose citation was measured and found the domain cited; read against `citationComparisons`. */
|
|
22817
|
-
citationCount:
|
|
23120
|
+
citationCount: z77.number().int().nonnegative(),
|
|
22818
23121
|
/**
|
|
22819
23122
|
* Successful responses whose citation could be measured: the denominator of
|
|
22820
23123
|
* `citationCount`. Lower than `totalComparisons` when a provider's sources
|
|
22821
23124
|
* are not tied to its answer, so those answers are neither cited nor not
|
|
22822
23125
|
* cited. Absent on reports made before it existed (read `totalComparisons`).
|
|
22823
23126
|
*/
|
|
22824
|
-
citationComparisons:
|
|
22825
|
-
topCompetitors:
|
|
22826
|
-
visibilityGap:
|
|
22827
|
-
whatThisMeans:
|
|
22828
|
-
recommendedActions:
|
|
22829
|
-
});
|
|
22830
|
-
var snapshotReportSchema =
|
|
22831
|
-
companyName:
|
|
22832
|
-
domain:
|
|
22833
|
-
homepageUrl:
|
|
22834
|
-
generatedAt:
|
|
22835
|
-
queries:
|
|
22836
|
-
competitors:
|
|
23127
|
+
citationComparisons: z77.number().int().nonnegative().optional(),
|
|
23128
|
+
topCompetitors: z77.array(snapshotCompetitorEntrySchema).default([]),
|
|
23129
|
+
visibilityGap: z77.string(),
|
|
23130
|
+
whatThisMeans: z77.array(z77.string()).default([]),
|
|
23131
|
+
recommendedActions: z77.array(z77.string()).default([])
|
|
23132
|
+
});
|
|
23133
|
+
var snapshotReportSchema = z77.object({
|
|
23134
|
+
companyName: z77.string(),
|
|
23135
|
+
domain: z77.string(),
|
|
23136
|
+
homepageUrl: z77.string(),
|
|
23137
|
+
generatedAt: z77.string(),
|
|
23138
|
+
queries: z77.array(z77.string()).default([]),
|
|
23139
|
+
competitors: z77.array(z77.string()).default([]),
|
|
22837
23140
|
profile: snapshotProfileSchema,
|
|
22838
23141
|
audit: snapshotAuditSchema,
|
|
22839
|
-
queryResults:
|
|
23142
|
+
queryResults: z77.array(snapshotQueryResultSchema).default([]),
|
|
22840
23143
|
summary: snapshotSummarySchema
|
|
22841
23144
|
});
|
|
22842
23145
|
|
|
22843
23146
|
// ../contracts/src/competitor-suggestions.ts
|
|
22844
|
-
import { z as
|
|
22845
|
-
var competitorSuggestionsQuerySchema =
|
|
23147
|
+
import { z as z78 } from "zod";
|
|
23148
|
+
var competitorSuggestionsQuerySchema = z78.object({
|
|
22846
23149
|
window: metricsWindowSchema.optional(),
|
|
22847
|
-
minAnswers:
|
|
22848
|
-
queryClass:
|
|
22849
|
-
groupKey:
|
|
22850
|
-
limit:
|
|
23150
|
+
minAnswers: z78.coerce.number().int().min(1).max(1e3).optional(),
|
|
23151
|
+
queryClass: z78.enum(["non-brand", "branded", "all"]).optional(),
|
|
23152
|
+
groupKey: z78.string().trim().min(1).optional(),
|
|
23153
|
+
limit: z78.coerce.number().int().min(1).max(100).optional()
|
|
22851
23154
|
}).strict();
|
|
22852
|
-
var competitorSuggestionNameSchema =
|
|
22853
|
-
name:
|
|
22854
|
-
answerCount:
|
|
22855
|
-
pairedAnswers:
|
|
23155
|
+
var competitorSuggestionNameSchema = z78.object({
|
|
23156
|
+
name: z78.string().trim().min(1),
|
|
23157
|
+
answerCount: z78.number().int().nonnegative(),
|
|
23158
|
+
pairedAnswers: z78.number().int().nonnegative()
|
|
22856
23159
|
}).strict();
|
|
22857
|
-
var competitorSuggestionReasonSchema =
|
|
23160
|
+
var competitorSuggestionReasonSchema = z78.enum([
|
|
22858
23161
|
"below-min-answers",
|
|
22859
23162
|
"not-named",
|
|
22860
23163
|
"unpaired-name",
|
|
@@ -22865,56 +23168,56 @@ var competitorSuggestionReasonSchema = z77.enum([
|
|
|
22865
23168
|
"shared-host"
|
|
22866
23169
|
]);
|
|
22867
23170
|
var CompetitorSuggestionReasons = competitorSuggestionReasonSchema.enum;
|
|
22868
|
-
var competitorSuggestionStatusSchema =
|
|
23171
|
+
var competitorSuggestionStatusSchema = z78.enum(["suggested", "tracked", "excluded"]);
|
|
22869
23172
|
var CompetitorSuggestionStatuses = competitorSuggestionStatusSchema.enum;
|
|
22870
|
-
var competitorSuggestionSchema =
|
|
22871
|
-
domain:
|
|
22872
|
-
label:
|
|
22873
|
-
names:
|
|
22874
|
-
namingAnswers:
|
|
22875
|
-
citingAnswers:
|
|
22876
|
-
bothAnswers:
|
|
22877
|
-
pairedAnswers:
|
|
22878
|
-
namedByOtherNameAnswers:
|
|
22879
|
-
sweeps:
|
|
22880
|
-
firstSeenAt:
|
|
22881
|
-
lastSeenAt:
|
|
23173
|
+
var competitorSuggestionSchema = z78.object({
|
|
23174
|
+
domain: z78.string().trim().min(1),
|
|
23175
|
+
label: z78.string().trim().min(1),
|
|
23176
|
+
names: z78.array(competitorSuggestionNameSchema).max(5),
|
|
23177
|
+
namingAnswers: z78.number().int().nonnegative(),
|
|
23178
|
+
citingAnswers: z78.number().int().nonnegative(),
|
|
23179
|
+
bothAnswers: z78.number().int().nonnegative(),
|
|
23180
|
+
pairedAnswers: z78.number().int().nonnegative(),
|
|
23181
|
+
namedByOtherNameAnswers: z78.number().int().nonnegative(),
|
|
23182
|
+
sweeps: z78.number().int().nonnegative(),
|
|
23183
|
+
firstSeenAt: z78.string().datetime().nullable(),
|
|
23184
|
+
lastSeenAt: z78.string().datetime().nullable(),
|
|
22882
23185
|
surfaceClass: competitorLandscapeSurfaceClassSchema,
|
|
22883
|
-
tracked:
|
|
22884
|
-
marketKeys:
|
|
23186
|
+
tracked: z78.boolean(),
|
|
23187
|
+
marketKeys: z78.array(z78.string().trim().min(1)).optional(),
|
|
22885
23188
|
status: competitorSuggestionStatusSchema,
|
|
22886
23189
|
reason: competitorSuggestionReasonSchema.nullable(),
|
|
22887
|
-
sampleUrls:
|
|
23190
|
+
sampleUrls: z78.array(z78.string().url()).max(3)
|
|
22888
23191
|
}).strict();
|
|
22889
|
-
var competitorSuggestionsResponseSchema =
|
|
22890
|
-
project:
|
|
23192
|
+
var competitorSuggestionsResponseSchema = z78.object({
|
|
23193
|
+
project: z78.string().trim().min(1),
|
|
22891
23194
|
window: metricsWindowSchema,
|
|
22892
23195
|
scope: competitorLandscapeScopeSchema,
|
|
22893
|
-
filters:
|
|
22894
|
-
queryClass:
|
|
22895
|
-
groupKey:
|
|
22896
|
-
limit:
|
|
22897
|
-
minAnswers:
|
|
23196
|
+
filters: z78.object({
|
|
23197
|
+
queryClass: z78.enum(["non-brand", "branded", "all"]),
|
|
23198
|
+
groupKey: z78.string().nullable(),
|
|
23199
|
+
limit: z78.number().int().positive(),
|
|
23200
|
+
minAnswers: z78.number().int().positive()
|
|
22898
23201
|
}).strict(),
|
|
22899
|
-
thresholds:
|
|
22900
|
-
candidates:
|
|
22901
|
-
candidatesTotal:
|
|
22902
|
-
excludedCounts:
|
|
22903
|
-
unresolvedNames:
|
|
22904
|
-
evidence:
|
|
22905
|
-
answeredResults:
|
|
22906
|
-
sourceResults:
|
|
22907
|
-
excludedProbeResults:
|
|
22908
|
-
excludedNonCompletedResults:
|
|
23202
|
+
thresholds: z78.object({ minAnswers: z78.number().int().positive() }).strict(),
|
|
23203
|
+
candidates: z78.array(competitorSuggestionSchema),
|
|
23204
|
+
candidatesTotal: z78.number().int().nonnegative(),
|
|
23205
|
+
excludedCounts: z78.record(z78.string(), z78.number().int().nonnegative()),
|
|
23206
|
+
unresolvedNames: z78.array(z78.object({ name: z78.string().trim().min(1), answerCount: z78.number().int().nonnegative() }).strict()),
|
|
23207
|
+
evidence: z78.object({
|
|
23208
|
+
answeredResults: z78.number().int().nonnegative(),
|
|
23209
|
+
sourceResults: z78.number().int().nonnegative(),
|
|
23210
|
+
excludedProbeResults: z78.number().int().nonnegative(),
|
|
23211
|
+
excludedNonCompletedResults: z78.number().int().nonnegative()
|
|
22909
23212
|
}).strict(),
|
|
22910
|
-
runCount:
|
|
22911
|
-
runIds:
|
|
22912
|
-
countUnits:
|
|
22913
|
-
answers:
|
|
22914
|
-
distinctNames:
|
|
22915
|
-
runs:
|
|
23213
|
+
runCount: z78.number().int().nonnegative(),
|
|
23214
|
+
runIds: z78.array(z78.string()),
|
|
23215
|
+
countUnits: z78.object({
|
|
23216
|
+
answers: z78.array(z78.string()),
|
|
23217
|
+
distinctNames: z78.array(z78.string()),
|
|
23218
|
+
runs: z78.array(z78.string())
|
|
22916
23219
|
}).strict(),
|
|
22917
|
-
truncated:
|
|
23220
|
+
truncated: z78.boolean()
|
|
22918
23221
|
}).strict();
|
|
22919
23222
|
var COMPETITOR_SUGGESTION_COUNT_UNITS = {
|
|
22920
23223
|
...COMPETITOR_LANDSCAPE_COUNT_UNITS,
|
|
@@ -22932,9 +23235,9 @@ var COMPETITOR_SUGGESTION_COUNT_UNITS = {
|
|
|
22932
23235
|
};
|
|
22933
23236
|
|
|
22934
23237
|
// ../contracts/src/intelligence.ts
|
|
22935
|
-
import { z as
|
|
22936
|
-
var insightSeveritySchema =
|
|
22937
|
-
var insightActionGroupSchema =
|
|
23238
|
+
import { z as z79 } from "zod";
|
|
23239
|
+
var insightSeveritySchema = z79.enum(["critical", "high", "medium", "low"]);
|
|
23240
|
+
var insightActionGroupSchema = z79.enum(["write", "investigate", "monitor"]);
|
|
22938
23241
|
var InsightActionGroups = insightActionGroupSchema.enum;
|
|
22939
23242
|
var insightActionGroupByType = {
|
|
22940
23243
|
// Content-required: a missing or competitive answer needs new or updated material.
|
|
@@ -22956,10 +23259,10 @@ var insightActionGroupByType = {
|
|
|
22956
23259
|
"gbp-metric-drop": InsightActionGroups.investigate,
|
|
22957
23260
|
"gbp-keyword-drop": InsightActionGroups.investigate
|
|
22958
23261
|
};
|
|
22959
|
-
var healthSnapshotDtoSchema =
|
|
22960
|
-
id:
|
|
22961
|
-
projectId:
|
|
22962
|
-
runId:
|
|
23262
|
+
var healthSnapshotDtoSchema = z79.object({
|
|
23263
|
+
id: z79.string(),
|
|
23264
|
+
projectId: z79.string(),
|
|
23265
|
+
runId: z79.string().nullable(),
|
|
22963
23266
|
overallCitedRate: fraction(),
|
|
22964
23267
|
/**
|
|
22965
23268
|
* Share of (query × provider) pairs where the project was MENTIONED in the
|
|
@@ -22968,46 +23271,50 @@ var healthSnapshotDtoSchema = z78.object({
|
|
|
22968
23271
|
* as 0 (the API coalesces NULL→0).
|
|
22969
23272
|
*/
|
|
22970
23273
|
overallMentionRate: fraction(),
|
|
22971
|
-
totalPairs:
|
|
22972
|
-
citedPairs:
|
|
23274
|
+
totalPairs: z79.number().int().nonnegative(),
|
|
23275
|
+
citedPairs: z79.number().int().nonnegative(),
|
|
22973
23276
|
/** Count of pairs mentioned in the answer text. Legacy rows read back as 0. */
|
|
22974
|
-
mentionedPairs:
|
|
22975
|
-
providerBreakdown:
|
|
23277
|
+
mentionedPairs: z79.number().int().nonnegative(),
|
|
23278
|
+
providerBreakdown: z79.record(z79.string(), z79.object({
|
|
22976
23279
|
citedRate: fraction(),
|
|
22977
23280
|
mentionRate: fraction(),
|
|
22978
|
-
cited:
|
|
22979
|
-
mentioned:
|
|
22980
|
-
total:
|
|
23281
|
+
cited: z79.number().int().nonnegative(),
|
|
23282
|
+
mentioned: z79.number().int().nonnegative(),
|
|
23283
|
+
total: z79.number().int().nonnegative()
|
|
22981
23284
|
})),
|
|
22982
|
-
createdAt:
|
|
23285
|
+
createdAt: z79.string(),
|
|
22983
23286
|
/**
|
|
22984
23287
|
* `'ready'` when the snapshot reflects real data; `'no-data'` for the
|
|
22985
23288
|
* sentinel returned by `/health/latest` when a project has no health
|
|
22986
23289
|
* snapshots yet (newly created, or only failed runs). Numeric fields are
|
|
22987
23290
|
* zero and `providerBreakdown` is `{}` in the no-data case.
|
|
22988
23291
|
*/
|
|
22989
|
-
status:
|
|
23292
|
+
status: z79.enum(["ready", "no-data"]),
|
|
22990
23293
|
/** Reason for `status === 'no-data'`. Absent when `status === 'ready'`. */
|
|
22991
|
-
reason:
|
|
23294
|
+
reason: z79.literal("no-runs-yet").optional()
|
|
22992
23295
|
});
|
|
22993
23296
|
|
|
22994
23297
|
// ../contracts/src/agent.ts
|
|
22995
|
-
import { z as
|
|
22996
|
-
var agentViewContextSchema =
|
|
22997
|
-
view:
|
|
22998
|
-
|
|
23298
|
+
import { z as z80 } from "zod";
|
|
23299
|
+
var agentViewContextSchema = z80.object({
|
|
23300
|
+
view: z80.enum(["project", "visibility", "property", "queries", "site-health", "seo"]),
|
|
23301
|
+
seoProfileId: z80.string().trim().min(1).max(128).optional(),
|
|
23302
|
+
seoRunId: z80.string().trim().min(1).max(128).optional(),
|
|
23303
|
+
unavailableReason: z80.string().trim().min(1).max(512).optional(),
|
|
22999
23304
|
selection: visibilityReportRequestSchema.optional(),
|
|
23000
|
-
page:
|
|
23001
|
-
runId:
|
|
23002
|
-
nodeKey:
|
|
23305
|
+
page: z80.object({
|
|
23306
|
+
runId: z80.string().trim().min(1).max(256).optional(),
|
|
23307
|
+
nodeKey: z80.string().trim().min(1).max(2048).optional()
|
|
23003
23308
|
}).strict().optional()
|
|
23004
23309
|
}).strict().superRefine((value, ctx) => {
|
|
23310
|
+
if (value.seoProfileId && value.view !== "seo") ctx.addIssue({ code: "custom", message: "SEO profile context requires the SEO view." });
|
|
23311
|
+
if (value.seoRunId && value.view !== "seo") ctx.addIssue({ code: "custom", message: "SEO run context requires the SEO view." });
|
|
23005
23312
|
if (value.page && value.view !== "site-health") ctx.addIssue({ code: "custom", message: "Page context requires Site Health." });
|
|
23006
23313
|
if (value.selection && !["visibility", "property", "queries"].includes(value.view)) ctx.addIssue({ code: "custom", message: "Measurement selection requires a measurement view." });
|
|
23007
23314
|
});
|
|
23008
|
-
var agentTurnLimitsSchema =
|
|
23009
|
-
maxToolCalls:
|
|
23010
|
-
timeoutMs:
|
|
23315
|
+
var agentTurnLimitsSchema = z80.object({
|
|
23316
|
+
maxToolCalls: z80.number().int().min(1).max(100).default(30),
|
|
23317
|
+
timeoutMs: z80.number().int().min(1e3).max(6e5).default(18e4)
|
|
23011
23318
|
}).strict();
|
|
23012
23319
|
function agentVisibilityEvidence(report, project, retrievedAt) {
|
|
23013
23320
|
const selection = report.selection;
|
|
@@ -23050,34 +23357,34 @@ function agentVisibilityEvidence(report, project, retrievedAt) {
|
|
|
23050
23357
|
))
|
|
23051
23358
|
};
|
|
23052
23359
|
}
|
|
23053
|
-
var agentProviderIdSchema =
|
|
23054
|
-
var agentProviderOptionDtoSchema =
|
|
23360
|
+
var agentProviderIdSchema = z80.enum(["claude", "openai", "gemini", "zai", "openrouter"]);
|
|
23361
|
+
var agentProviderOptionDtoSchema = z80.object({
|
|
23055
23362
|
/** Stable identifier — what clients pass back as `provider` on the prompt endpoint. */
|
|
23056
23363
|
id: agentProviderIdSchema,
|
|
23057
23364
|
/** Human-readable label for UI pickers, e.g. "Anthropic (Claude)". */
|
|
23058
|
-
label:
|
|
23365
|
+
label: z80.string(),
|
|
23059
23366
|
/** Default model if the caller doesn't pick one. */
|
|
23060
|
-
defaultModel:
|
|
23367
|
+
defaultModel: z80.string(),
|
|
23061
23368
|
/** Whether a usable API key was found (config.yaml or provider env var). */
|
|
23062
|
-
configured:
|
|
23369
|
+
configured: z80.boolean(),
|
|
23063
23370
|
/**
|
|
23064
23371
|
* Where the key resolved from, if any. `null` when `configured === false`.
|
|
23065
23372
|
* Surfaced so the UI can nudge users toward their preferred source of truth.
|
|
23066
23373
|
*/
|
|
23067
|
-
keySource:
|
|
23374
|
+
keySource: z80.enum(["config", "env"]).nullable(),
|
|
23068
23375
|
/**
|
|
23069
23376
|
* A short list of models to offer for this provider: the default first,
|
|
23070
23377
|
* then a few stronger current models. A pinned model outside the list is
|
|
23071
23378
|
* listed first. Any other model ID can still be requested.
|
|
23072
23379
|
*/
|
|
23073
|
-
models:
|
|
23380
|
+
models: z80.array(z80.object({ id: z80.string(), displayName: z80.string() })).optional()
|
|
23074
23381
|
});
|
|
23075
|
-
var agentProvidersResponseDtoSchema =
|
|
23382
|
+
var agentProvidersResponseDtoSchema = z80.object({
|
|
23076
23383
|
/**
|
|
23077
23384
|
* Every provider Aero knows about. `configured === false` entries are
|
|
23078
23385
|
* included so the UI can render them disabled with an onboarding hint.
|
|
23079
23386
|
*/
|
|
23080
|
-
providers:
|
|
23387
|
+
providers: z80.array(agentProviderOptionDtoSchema).default([]),
|
|
23081
23388
|
/**
|
|
23082
23389
|
* Provider a new session uses when the caller names none: the
|
|
23083
23390
|
* `agent.provider` pin when set (reported even without a key, as its
|
|
@@ -23087,50 +23394,50 @@ var agentProvidersResponseDtoSchema = z79.object({
|
|
|
23087
23394
|
*/
|
|
23088
23395
|
defaultProvider: agentProviderIdSchema.nullable()
|
|
23089
23396
|
});
|
|
23090
|
-
var memorySourceSchema =
|
|
23397
|
+
var memorySourceSchema = z80.enum(["aero", "user", "compaction"]);
|
|
23091
23398
|
var MemorySources = memorySourceSchema.enum;
|
|
23092
23399
|
var AGENT_MEMORY_VALUE_MAX_BYTES = 2 * 1024;
|
|
23093
23400
|
var AGENT_MEMORY_KEY_MAX_LENGTH = 128;
|
|
23094
|
-
var agentMemoryUpsertRequestSchema =
|
|
23095
|
-
key:
|
|
23096
|
-
value:
|
|
23401
|
+
var agentMemoryUpsertRequestSchema = z80.object({
|
|
23402
|
+
key: z80.string().min(1).max(AGENT_MEMORY_KEY_MAX_LENGTH),
|
|
23403
|
+
value: z80.string().min(1)
|
|
23097
23404
|
});
|
|
23098
|
-
var agentMemoryDeleteRequestSchema =
|
|
23099
|
-
key:
|
|
23405
|
+
var agentMemoryDeleteRequestSchema = z80.object({
|
|
23406
|
+
key: z80.string().min(1).max(AGENT_MEMORY_KEY_MAX_LENGTH)
|
|
23100
23407
|
});
|
|
23101
|
-
var agentPromptRequestSchema =
|
|
23102
|
-
prompt:
|
|
23103
|
-
conversationId:
|
|
23408
|
+
var agentPromptRequestSchema = z80.object({
|
|
23409
|
+
prompt: z80.string().trim().min(1),
|
|
23410
|
+
conversationId: z80.string().min(1).nullable().optional(),
|
|
23104
23411
|
provider: agentProviderIdSchema.optional(),
|
|
23105
|
-
modelId:
|
|
23106
|
-
scope:
|
|
23107
|
-
profile:
|
|
23412
|
+
modelId: z80.string().trim().min(1).optional(),
|
|
23413
|
+
scope: z80.enum(["all", "read-only"]).optional(),
|
|
23414
|
+
profile: z80.enum(["default", "ads-operator"]).optional(),
|
|
23108
23415
|
context: agentViewContextSchema.optional(),
|
|
23109
23416
|
limits: agentTurnLimitsSchema.optional()
|
|
23110
23417
|
});
|
|
23111
|
-
var agentConversationMessageSchema =
|
|
23112
|
-
var agentConversationSummarySchema =
|
|
23113
|
-
id:
|
|
23114
|
-
title:
|
|
23115
|
-
active:
|
|
23116
|
-
modelProvider:
|
|
23117
|
-
modelId:
|
|
23118
|
-
createdAt:
|
|
23119
|
-
updatedAt:
|
|
23418
|
+
var agentConversationMessageSchema = z80.looseObject({ role: z80.string(), content: z80.unknown().optional() });
|
|
23419
|
+
var agentConversationSummarySchema = z80.object({
|
|
23420
|
+
id: z80.string(),
|
|
23421
|
+
title: z80.string(),
|
|
23422
|
+
active: z80.boolean(),
|
|
23423
|
+
modelProvider: z80.string(),
|
|
23424
|
+
modelId: z80.string(),
|
|
23425
|
+
createdAt: z80.string(),
|
|
23426
|
+
updatedAt: z80.string()
|
|
23120
23427
|
});
|
|
23121
23428
|
var agentConversationSchema = agentConversationSummarySchema.extend({
|
|
23122
|
-
messages:
|
|
23123
|
-
isStreaming:
|
|
23429
|
+
messages: z80.array(agentConversationMessageSchema),
|
|
23430
|
+
isStreaming: z80.boolean()
|
|
23124
23431
|
});
|
|
23125
|
-
var agentConversationListSchema =
|
|
23126
|
-
conversations:
|
|
23127
|
-
currentConversationId:
|
|
23128
|
-
nextOffset:
|
|
23432
|
+
var agentConversationListSchema = z80.object({
|
|
23433
|
+
conversations: z80.array(agentConversationSummarySchema),
|
|
23434
|
+
currentConversationId: z80.string().nullable(),
|
|
23435
|
+
nextOffset: z80.number().int().nullable()
|
|
23129
23436
|
});
|
|
23130
|
-
var agentConversationCreateSchema =
|
|
23131
|
-
id:
|
|
23437
|
+
var agentConversationCreateSchema = z80.object({
|
|
23438
|
+
id: z80.uuid()
|
|
23132
23439
|
}).strict();
|
|
23133
|
-
var agentConversationDeleteSchema =
|
|
23440
|
+
var agentConversationDeleteSchema = z80.object({ id: z80.string(), status: z80.literal("deleted") });
|
|
23134
23441
|
function agentConversationTitle(messages) {
|
|
23135
23442
|
for (const message of messages) {
|
|
23136
23443
|
if (message.role !== "user") continue;
|
|
@@ -23142,49 +23449,49 @@ function agentConversationTitle(messages) {
|
|
|
23142
23449
|
return "New conversation";
|
|
23143
23450
|
}
|
|
23144
23451
|
var aeroPreviewStarterIds = ["status", "changes", "gaps", "insights"];
|
|
23145
|
-
var aeroPreviewStarterIdSchema =
|
|
23146
|
-
var aeroPreviewStepSchema =
|
|
23452
|
+
var aeroPreviewStarterIdSchema = z80.enum(aeroPreviewStarterIds);
|
|
23453
|
+
var aeroPreviewStepSchema = z80.object({
|
|
23147
23454
|
/** Assistant text shown before the tool call, when the turn narrates it. */
|
|
23148
|
-
text:
|
|
23149
|
-
tool:
|
|
23455
|
+
text: z80.string().optional(),
|
|
23456
|
+
tool: z80.object({
|
|
23150
23457
|
/** Real Canonry MCP tool name, such as canonry_visibility_report. */
|
|
23151
|
-
name:
|
|
23458
|
+
name: z80.string(),
|
|
23152
23459
|
/** The tool's registered title, which the live bar shows as the card label. */
|
|
23153
|
-
label:
|
|
23154
|
-
arguments:
|
|
23460
|
+
label: z80.string(),
|
|
23461
|
+
arguments: z80.record(z80.string(), z80.unknown()),
|
|
23155
23462
|
/** A compact excerpt of the stored result, not the full payload. */
|
|
23156
|
-
result:
|
|
23157
|
-
durationMs:
|
|
23463
|
+
result: z80.unknown(),
|
|
23464
|
+
durationMs: z80.number().int().nonnegative()
|
|
23158
23465
|
})
|
|
23159
23466
|
});
|
|
23160
|
-
var aeroPreviewStarterSchema =
|
|
23467
|
+
var aeroPreviewStarterSchema = z80.object({
|
|
23161
23468
|
id: aeroPreviewStarterIdSchema,
|
|
23162
|
-
steps:
|
|
23469
|
+
steps: z80.array(aeroPreviewStepSchema),
|
|
23163
23470
|
/** Final assistant markdown. */
|
|
23164
|
-
answer:
|
|
23471
|
+
answer: z80.string()
|
|
23165
23472
|
});
|
|
23166
|
-
var aeroPreviewResponseSchema =
|
|
23167
|
-
project:
|
|
23168
|
-
seededAt:
|
|
23169
|
-
starters:
|
|
23473
|
+
var aeroPreviewResponseSchema = z80.object({
|
|
23474
|
+
project: z80.string(),
|
|
23475
|
+
seededAt: z80.string(),
|
|
23476
|
+
starters: z80.array(aeroPreviewStarterSchema)
|
|
23170
23477
|
});
|
|
23171
|
-
var agentConversationListQuerySchema =
|
|
23172
|
-
offset:
|
|
23173
|
-
limit:
|
|
23478
|
+
var agentConversationListQuerySchema = z80.object({
|
|
23479
|
+
offset: z80.coerce.number().int().min(0).default(0),
|
|
23480
|
+
limit: z80.coerce.number().int().min(1).max(100).default(50)
|
|
23174
23481
|
}).strict();
|
|
23175
23482
|
|
|
23176
23483
|
// ../contracts/src/sentiment.ts
|
|
23177
|
-
import { z as
|
|
23484
|
+
import { z as z81 } from "zod";
|
|
23178
23485
|
var SENTIMENT_MODEL = "jev-1.13.0";
|
|
23179
23486
|
var SENTIMENT_OPENROUTER_MODEL = "typesafe/jev-1.13";
|
|
23180
23487
|
var SENTIMENT_OPENROUTER_SERVED_MODEL = "typesafe/jev-1.13-20260917";
|
|
23181
|
-
var sentimentEvaluatorProviderSchema =
|
|
23488
|
+
var sentimentEvaluatorProviderSchema = z81.enum(["typesafe", "openrouter"]);
|
|
23182
23489
|
var SENTIMENT_INTERVAL_LIMITATION = "Wilson 95% intervals assume independent observations. They exclude classifier error and dependence among related queries, Properties, and sweeps.";
|
|
23183
|
-
var id =
|
|
23184
|
-
var count =
|
|
23185
|
-
var runIds =
|
|
23186
|
-
var rate = fraction(
|
|
23187
|
-
var sentimentOutcomeSchema =
|
|
23490
|
+
var id = z81.string().trim().min(1).max(256);
|
|
23491
|
+
var count = z81.number().int().nonnegative();
|
|
23492
|
+
var runIds = z81.preprocess((value) => typeof value === "string" ? [value] : value, z81.array(id).min(1).max(100));
|
|
23493
|
+
var rate = fraction(z81.number().min(0).max(1)).nullable();
|
|
23494
|
+
var sentimentOutcomeSchema = z81.enum([
|
|
23188
23495
|
"favorable",
|
|
23189
23496
|
"mixed",
|
|
23190
23497
|
"unfavorable",
|
|
@@ -23205,22 +23512,22 @@ var sentimentOutcomeSchema = z80.enum([
|
|
|
23205
23512
|
"canceled"
|
|
23206
23513
|
]);
|
|
23207
23514
|
var SentimentOutcomes = sentimentOutcomeSchema.enum;
|
|
23208
|
-
var sentimentStateSchema =
|
|
23209
|
-
var sentimentEvaluationDefinitionSchema =
|
|
23210
|
-
schemaVersion:
|
|
23211
|
-
requestedModel:
|
|
23515
|
+
var sentimentStateSchema = z81.enum(["disabled", "not-measured", "processing", "partial", "complete", "failed", "canceled", "unsupported"]);
|
|
23516
|
+
var sentimentEvaluationDefinitionSchema = z81.object({
|
|
23517
|
+
schemaVersion: z81.union([z81.literal(1), z81.literal(2)]),
|
|
23518
|
+
requestedModel: z81.enum([SENTIMENT_MODEL, SENTIMENT_OPENROUTER_MODEL]),
|
|
23212
23519
|
/** Omitted on historical direct TypeSafe definitions to preserve their immutable identity. */
|
|
23213
23520
|
provider: sentimentEvaluatorProviderSchema.optional(),
|
|
23214
|
-
expectedReturnedModel:
|
|
23521
|
+
expectedReturnedModel: z81.literal(SENTIMENT_OPENROUTER_SERVED_MODEL).optional(),
|
|
23215
23522
|
verdictVersion: id,
|
|
23216
23523
|
identityVersion: id,
|
|
23217
23524
|
evidenceVersion: id,
|
|
23218
23525
|
segmentationVersion: id,
|
|
23219
23526
|
preprocessingVersion: id,
|
|
23220
|
-
languagePolicy:
|
|
23221
|
-
comparisonMethodVersion:
|
|
23222
|
-
confidenceThreshold:
|
|
23223
|
-
questions:
|
|
23527
|
+
languagePolicy: z81.literal("en-only"),
|
|
23528
|
+
comparisonMethodVersion: z81.literal("wilson-independent-v1"),
|
|
23529
|
+
confidenceThreshold: z81.number().min(0).max(1).nullable(),
|
|
23530
|
+
questions: z81.object({ identity: z81.string(), judgment: z81.string(), stance: z81.string(), conclusion: z81.string(), complaint: z81.string() }).strict()
|
|
23224
23531
|
}).strict().superRefine((definition, ctx) => {
|
|
23225
23532
|
const routed = definition.provider === "openrouter";
|
|
23226
23533
|
if (definition.requestedModel !== (routed ? SENTIMENT_OPENROUTER_MODEL : SENTIMENT_MODEL) || (routed ? definition.expectedReturnedModel !== SENTIMENT_OPENROUTER_SERVED_MODEL : definition.expectedReturnedModel !== void 0)) {
|
|
@@ -23263,7 +23570,7 @@ function storedDefinitionProjection(value) {
|
|
|
23263
23570
|
if (typeof projected.questions === "object" && projected.questions !== null) projected.questions = Object.fromEntries(Object.entries(projected.questions).filter(([key]) => key !== "theme"));
|
|
23264
23571
|
return projected;
|
|
23265
23572
|
}
|
|
23266
|
-
var storedSentimentEvaluationDefinitionSchema =
|
|
23573
|
+
var storedSentimentEvaluationDefinitionSchema = z81.preprocess(storedDefinitionProjection, sentimentEvaluationDefinitionSchema);
|
|
23267
23574
|
function canonicalSentimentJson(value) {
|
|
23268
23575
|
function canonical(item) {
|
|
23269
23576
|
if (Array.isArray(item)) return item.map(canonical);
|
|
@@ -23272,69 +23579,69 @@ function canonicalSentimentJson(value) {
|
|
|
23272
23579
|
}
|
|
23273
23580
|
return JSON.stringify(canonical(value));
|
|
23274
23581
|
}
|
|
23275
|
-
var sentimentSubjectSchema =
|
|
23276
|
-
var sentimentUsageEdgeSchema =
|
|
23277
|
-
var sentimentExecutionContextSchema =
|
|
23582
|
+
var sentimentSubjectSchema = z81.object({ id, displayName: z81.string(), aliases: z81.array(z81.string()), qualifiedAliases: z81.array(z81.string()).default([]), urls: z81.array(z81.string()), mentionNotApplicable: z81.boolean() }).strict();
|
|
23583
|
+
var sentimentUsageEdgeSchema = z81.object({ queryId: id, executionNodeKey: id.nullable(), targetId: id, propertyId: id.nullable(), groupId: id.nullable(), marketId: id.nullable(), queryClass: z81.enum(["branded", "non-brand"]), queryText: z81.string().optional(), location: z81.string().nullable() }).strict();
|
|
23584
|
+
var sentimentExecutionContextSchema = z81.object({
|
|
23278
23585
|
queryId: id,
|
|
23279
|
-
queryText:
|
|
23280
|
-
queryClass:
|
|
23586
|
+
queryText: z81.string(),
|
|
23587
|
+
queryClass: z81.enum(["branded", "non-brand"]),
|
|
23281
23588
|
provider: id,
|
|
23282
|
-
requestedModel:
|
|
23283
|
-
servedModel:
|
|
23284
|
-
location:
|
|
23285
|
-
revision:
|
|
23286
|
-
usageEdges:
|
|
23589
|
+
requestedModel: z81.string().nullable(),
|
|
23590
|
+
servedModel: z81.string().nullable(),
|
|
23591
|
+
location: z81.string().nullable(),
|
|
23592
|
+
revision: z81.number().int().nullable(),
|
|
23593
|
+
usageEdges: z81.array(sentimentUsageEdgeSchema),
|
|
23287
23594
|
locationContext: locationContextSchema.nullable().default(null)
|
|
23288
23595
|
}).strict();
|
|
23289
|
-
var sentimentEvidenceSchema =
|
|
23290
|
-
var sentimentUsageSchema =
|
|
23291
|
-
var sentimentClassifierInputSchema =
|
|
23596
|
+
var sentimentEvidenceSchema = z81.object({ id, text: z81.string().min(1), start: count, end: count }).strict();
|
|
23597
|
+
var sentimentUsageSchema = z81.object({ kind: z81.enum(["reported", "estimated", "unknown"]), inputTokens: count.nullable(), outputTokens: count.nullable() }).strict();
|
|
23598
|
+
var sentimentClassifierInputSchema = z81.object({
|
|
23292
23599
|
sourceSnapshotId: id,
|
|
23293
|
-
sourceText:
|
|
23600
|
+
sourceText: z81.string(),
|
|
23294
23601
|
sourceTextHash: id,
|
|
23295
23602
|
subject: sentimentSubjectSchema,
|
|
23296
23603
|
subjectHash: id,
|
|
23297
23604
|
context: sentimentExecutionContextSchema,
|
|
23298
|
-
language:
|
|
23605
|
+
language: z81.string(),
|
|
23299
23606
|
definition: sentimentEvaluationDefinitionSchema,
|
|
23300
|
-
sentences:
|
|
23607
|
+
sentences: z81.array(sentimentEvidenceSchema)
|
|
23301
23608
|
}).strict();
|
|
23302
|
-
var storedSentimentClassifierInputSchema =
|
|
23609
|
+
var storedSentimentClassifierInputSchema = z81.preprocess((value) => {
|
|
23303
23610
|
if (typeof value !== "object" || value === null || !("definition" in value)) return value;
|
|
23304
23611
|
return { ...value, definition: storedDefinitionProjection(value.definition) };
|
|
23305
23612
|
}, sentimentClassifierInputSchema);
|
|
23306
|
-
var classifierCommon = { returnedModel:
|
|
23307
|
-
var sentimentClassifierOutputSchema =
|
|
23308
|
-
|
|
23309
|
-
kind:
|
|
23613
|
+
var classifierCommon = { returnedModel: z81.string().nullable(), usage: sentimentUsageSchema };
|
|
23614
|
+
var sentimentClassifierOutputSchema = z81.discriminatedUnion("kind", [
|
|
23615
|
+
z81.object({
|
|
23616
|
+
kind: z81.literal("classified"),
|
|
23310
23617
|
...classifierCommon,
|
|
23311
|
-
returnedModel:
|
|
23618
|
+
returnedModel: z81.string(),
|
|
23312
23619
|
outcome: sentimentOutcomeSchema,
|
|
23313
|
-
conclusion:
|
|
23314
|
-
complaint:
|
|
23315
|
-
confidence:
|
|
23620
|
+
conclusion: z81.array(sentimentEvidenceSchema),
|
|
23621
|
+
complaint: z81.array(sentimentEvidenceSchema).nullable(),
|
|
23622
|
+
confidence: z81.number().min(0).max(1).nullable()
|
|
23316
23623
|
}).strict(),
|
|
23317
|
-
|
|
23318
|
-
|
|
23624
|
+
z81.object({ kind: z81.literal("abstained"), ...classifierCommon, outcome: sentimentOutcomeSchema, reason: z81.string() }).strict(),
|
|
23625
|
+
z81.object({ kind: z81.literal("failed"), ...classifierCommon, outcome: z81.literal("failed"), error: z81.object({ code: id, message: z81.string(), retryable: z81.boolean(), retryAfterMs: z81.number().nonnegative().nullable() }).strict() }).strict()
|
|
23319
23626
|
]).superRefine((result, ctx) => {
|
|
23320
23627
|
if (result.kind === "classified" && ["favorable", "mixed", "unfavorable"].includes(result.outcome) && result.conclusion.length === 0) {
|
|
23321
23628
|
ctx.addIssue({ code: "custom", path: ["conclusion"], message: "Judgments require conclusion evidence" });
|
|
23322
23629
|
}
|
|
23323
23630
|
});
|
|
23324
|
-
var storedSentimentClassifierOutputSchema =
|
|
23325
|
-
var sentimentSelectionBaseSchema =
|
|
23631
|
+
var storedSentimentClassifierOutputSchema = z81.preprocess((value) => typeof value === "object" && value !== null ? Object.fromEntries(Object.entries(value).filter(([key]) => key !== "themes")) : value, sentimentClassifierOutputSchema);
|
|
23632
|
+
var sentimentSelectionBaseSchema = z81.object({
|
|
23326
23633
|
runId: id.optional(),
|
|
23327
23634
|
runIds: runIds.optional(),
|
|
23328
|
-
revision:
|
|
23329
|
-
mode:
|
|
23330
|
-
queryClass:
|
|
23331
|
-
scope:
|
|
23635
|
+
revision: z81.coerce.number().int().positive().optional(),
|
|
23636
|
+
mode: z81.enum(["auto", "simple", "advanced"]).default("auto"),
|
|
23637
|
+
queryClass: z81.enum(["branded", "non-brand"]).default("branded"),
|
|
23638
|
+
scope: z81.enum(["project", "property", "group", "market"]).default("project"),
|
|
23332
23639
|
queryId: id.optional(),
|
|
23333
23640
|
scopeKey: id.optional(),
|
|
23334
23641
|
marketKey: id.optional(),
|
|
23335
23642
|
provider: id.optional(),
|
|
23336
23643
|
model: id.optional(),
|
|
23337
|
-
location:
|
|
23644
|
+
location: z81.string().min(1).optional(),
|
|
23338
23645
|
evaluationDefinitionId: id.optional(),
|
|
23339
23646
|
/** Exact frozen Advanced execution node of the selected query. Identity: it narrows the assessed population. */
|
|
23340
23647
|
executionNodeKey: id.optional()
|
|
@@ -23344,26 +23651,26 @@ function exclusiveSentimentRuns(value, ctx) {
|
|
|
23344
23651
|
if (value.runIds && new Set(value.runIds).size !== value.runIds.length) ctx.addIssue({ code: "custom", path: ["runIds"], message: "Run IDs must be unique." });
|
|
23345
23652
|
}
|
|
23346
23653
|
var sentimentSelectionSchema = sentimentSelectionBaseSchema.superRefine(exclusiveSentimentRuns);
|
|
23347
|
-
var sentimentSummaryIncludeSchema =
|
|
23654
|
+
var sentimentSummaryIncludeSchema = z81.enum(["assessments", "locations"]);
|
|
23348
23655
|
var SENTIMENT_QUERY_PAGE_DEFAULT = 25;
|
|
23349
23656
|
var SENTIMENT_QUERY_PAGE_MAX = 500;
|
|
23350
23657
|
var sentimentSummaryRequestSchema = sentimentSelectionBaseSchema.extend({
|
|
23351
|
-
include:
|
|
23352
|
-
queryLimit:
|
|
23353
|
-
queryCursor:
|
|
23658
|
+
include: z81.preprocess((value) => typeof value === "string" ? value.split(",").map((item) => item.trim()).filter(Boolean) : value, z81.array(sentimentSummaryIncludeSchema).max(2)).optional(),
|
|
23659
|
+
queryLimit: z81.coerce.number().int().min(1).max(SENTIMENT_QUERY_PAGE_MAX).default(SENTIMENT_QUERY_PAGE_DEFAULT),
|
|
23660
|
+
queryCursor: z81.string().min(1).max(16384).optional()
|
|
23354
23661
|
}).superRefine(exclusiveSentimentRuns);
|
|
23355
|
-
var sentimentEvidenceOutcomeFilterSchema =
|
|
23662
|
+
var sentimentEvidenceOutcomeFilterSchema = z81.preprocess((value) => {
|
|
23356
23663
|
const items = typeof value === "string" ? [value] : Array.isArray(value) ? value : null;
|
|
23357
23664
|
return items ? [...new Set(items.flatMap((item) => typeof item === "string" ? item.split(",").map((part) => part.trim()).filter(Boolean) : [item]))] : value;
|
|
23358
|
-
},
|
|
23359
|
-
var sentimentEvidenceRequestSchema = sentimentSelectionBaseSchema.extend({ assessmentId: id.optional(), outcome: sentimentEvidenceOutcomeFilterSchema.optional(), cursor:
|
|
23665
|
+
}, z81.array(sentimentOutcomeSchema).min(1).max(sentimentOutcomeSchema.options.length));
|
|
23666
|
+
var sentimentEvidenceRequestSchema = sentimentSelectionBaseSchema.extend({ assessmentId: id.optional(), outcome: sentimentEvidenceOutcomeFilterSchema.optional(), cursor: z81.string().min(1).max(16384).optional(), limit: z81.coerce.number().int().min(1).max(100).default(50) }).superRefine(exclusiveSentimentRuns);
|
|
23360
23667
|
var sentimentCompareRequestSchema = sentimentSelectionBaseSchema.extend({ fromRunId: id.describe("Run ID or previous-rated to select the preceding run with stored ratings in this scope."), toRunId: id }).superRefine((value, ctx) => {
|
|
23361
23668
|
exclusiveSentimentRuns(value, ctx);
|
|
23362
23669
|
if (value.runIds) ctx.addIssue({ code: "custom", path: ["runIds"], message: "Comparison requires one explicit run per period." });
|
|
23363
23670
|
});
|
|
23364
|
-
var sentimentResolvedSelectionSchema = sentimentSelectionBaseSchema.extend({ runId: id.nullable(), revision:
|
|
23365
|
-
var sentimentCountsSchema =
|
|
23366
|
-
var sentimentCoverageSchema =
|
|
23671
|
+
var sentimentResolvedSelectionSchema = sentimentSelectionBaseSchema.extend({ runId: id.nullable(), revision: z81.number().int().nullable(), evaluationDefinitionId: id.nullable(), mode: z81.enum(["simple", "advanced"]) });
|
|
23672
|
+
var sentimentCountsSchema = z81.object(Object.fromEntries(sentimentOutcomeSchema.options.map((outcome) => [outcome, count]))).strict();
|
|
23673
|
+
var sentimentCoverageSchema = z81.object({
|
|
23367
23674
|
selected: count,
|
|
23368
23675
|
eligibleAssessments: count,
|
|
23369
23676
|
unadmittedAssessments: count,
|
|
@@ -23377,45 +23684,45 @@ var sentimentCoverageSchema = z80.object({
|
|
|
23377
23684
|
expectedProviderSlots: count,
|
|
23378
23685
|
completedProviderSlots: count
|
|
23379
23686
|
}).strict();
|
|
23380
|
-
var sentimentScoreSchema =
|
|
23381
|
-
var headlineFields = { state: sentimentStateSchema, reason:
|
|
23382
|
-
var sentimentHeadlineSchema =
|
|
23383
|
-
var sentimentOverallHeadlineSchema =
|
|
23384
|
-
var sentimentOverviewSchema =
|
|
23385
|
-
var sentimentAssessmentSummarySchema =
|
|
23687
|
+
var sentimentScoreSchema = z81.object({ favorableRate: rate, mixedRate: rate, unfavorableRate: rate, favorableDisplay: z81.string(), mixedDisplay: z81.string(), unfavorableDisplay: z81.string(), interval: z81.object({ low: z81.number(), high: z81.number() }).strict().nullable(), method: z81.literal("wilson-independent-v1"), limitation: z81.string() }).strict();
|
|
23688
|
+
var headlineFields = { state: sentimentStateSchema, reason: z81.string().nullable(), provisional: z81.boolean(), coverage: sentimentCoverageSchema, score: sentimentScoreSchema };
|
|
23689
|
+
var sentimentHeadlineSchema = z81.object({ ...headlineFields, selection: sentimentResolvedSelectionSchema, runIds: z81.array(id) }).strict();
|
|
23690
|
+
var sentimentOverallHeadlineSchema = z81.object({ ...headlineFields, queryClass: z81.literal("all"), pooled: z81.literal(true).optional(), runIds: z81.array(id) }).strict();
|
|
23691
|
+
var sentimentOverviewSchema = z81.object({ configured: z81.boolean(), branded: sentimentHeadlineSchema, nonBrand: sentimentHeadlineSchema, headlineQueryClass: z81.literal("branded").optional(), pooledOverall: sentimentOverallHeadlineSchema.optional(), overall: sentimentOverallHeadlineSchema.optional().describe("Deprecated compatibility field. Pooled branded and non-brand assessments; never use as the sentiment headline.") }).strict();
|
|
23692
|
+
var sentimentAssessmentSummarySchema = z81.object({
|
|
23386
23693
|
assessmentId: id.nullable(),
|
|
23387
23694
|
sourceSnapshotId: id,
|
|
23388
23695
|
runId: id,
|
|
23389
23696
|
subjectId: id,
|
|
23390
|
-
subjectLabel:
|
|
23697
|
+
subjectLabel: z81.string(),
|
|
23391
23698
|
executionNodeKey: id.nullable(),
|
|
23392
23699
|
provider: id,
|
|
23393
|
-
requestedModel:
|
|
23394
|
-
servedModel:
|
|
23395
|
-
location:
|
|
23700
|
+
requestedModel: z81.string().nullable(),
|
|
23701
|
+
servedModel: z81.string().nullable(),
|
|
23702
|
+
location: z81.string().nullable(),
|
|
23396
23703
|
evaluationDefinitionId: id.nullable(),
|
|
23397
23704
|
state: sentimentStateSchema,
|
|
23398
|
-
outcome:
|
|
23399
|
-
reason:
|
|
23705
|
+
outcome: z81.union([sentimentOutcomeSchema, z81.null()]),
|
|
23706
|
+
reason: z81.string().nullable()
|
|
23400
23707
|
}).strict();
|
|
23401
|
-
var sentimentQuerySummarySchema =
|
|
23402
|
-
var sentimentBreakdownSchema =
|
|
23403
|
-
var sentimentSummarySchema =
|
|
23708
|
+
var sentimentQuerySummarySchema = z81.object({ ...headlineFields, queryId: id, executionNodeKey: id.nullable().optional(), queryText: z81.string(), queryClass: z81.enum(["branded", "non-brand"]), sourceSnapshotIds: z81.array(id), assessments: z81.array(sentimentAssessmentSummarySchema).default([]), locations: z81.array(z81.object({ ...headlineFields, location: z81.string().nullable(), sourceSnapshotIds: z81.array(id) }).strict()) }).strict();
|
|
23709
|
+
var sentimentBreakdownSchema = z81.object({ ...headlineFields, dimension: z81.enum(["provider", "property", "market", "query"]), key: z81.string(), label: z81.string(), queryClass: z81.enum(["branded", "non-brand"]) }).strict();
|
|
23710
|
+
var sentimentSummarySchema = z81.object({
|
|
23404
23711
|
...headlineFields,
|
|
23405
|
-
configured:
|
|
23712
|
+
configured: z81.boolean(),
|
|
23406
23713
|
selection: sentimentResolvedSelectionSchema,
|
|
23407
23714
|
evaluationDefinition: sentimentEvaluationDefinitionSchema.nullable(),
|
|
23408
|
-
breakdowns:
|
|
23409
|
-
queries:
|
|
23715
|
+
breakdowns: z81.array(sentimentBreakdownSchema),
|
|
23716
|
+
queries: z81.array(sentimentQuerySummarySchema),
|
|
23410
23717
|
/**
|
|
23411
23718
|
* Branded reads: the Properties with a mixed or unfavorable rating, most criticized first
|
|
23412
23719
|
* ({@link rankCriticizedProperties}). `keys` are the first {@link SENTIMENT_CRITICIZED_PROPERTY_LIMIT}
|
|
23413
23720
|
* property breakdown keys; `total` counts them all; `{ total: 0, keys: [] }` with fewer than two
|
|
23414
23721
|
* Properties in view. Absent from older servers, comparison periods, and non-brand, disabled or unavailable reads.
|
|
23415
23722
|
*/
|
|
23416
|
-
criticizedProperties:
|
|
23723
|
+
criticizedProperties: z81.object({ total: count, keys: z81.array(z81.string()) }).strict().optional(),
|
|
23417
23724
|
/** Present on the paged summary read; follow `nextCursor` as `queryCursor` for the next query rows. */
|
|
23418
|
-
queryPage:
|
|
23725
|
+
queryPage: z81.object({ total: count, limit: count, nextCursor: z81.string().nullable() }).strict().optional()
|
|
23419
23726
|
}).strict();
|
|
23420
23727
|
var SENTIMENT_CRITICIZED_PROPERTY_LIMIT = 5;
|
|
23421
23728
|
function rankCriticizedProperties(rows) {
|
|
@@ -23426,91 +23733,91 @@ function rankCriticizedProperties(rows) {
|
|
|
23426
23733
|
criticized.sort((a, b) => criticism(b) - criticism(a) || b.coverage.counts.unfavorable - a.coverage.counts.unfavorable || a.coverage.counts.favorable - b.coverage.counts.favorable || a.label.localeCompare(b.label) || a.key.localeCompare(b.key));
|
|
23427
23734
|
return { total: criticized.length, keys: criticized.slice(0, SENTIMENT_CRITICIZED_PROPERTY_LIMIT).map((row) => row.key) };
|
|
23428
23735
|
}
|
|
23429
|
-
var sentimentSettingsUpdateSchema =
|
|
23430
|
-
var sentimentSettingsSchema =
|
|
23736
|
+
var sentimentSettingsUpdateSchema = z81.object({ enabled: z81.boolean().optional() }).strict();
|
|
23737
|
+
var sentimentSettingsSchema = z81.object({
|
|
23431
23738
|
provider: sentimentEvaluatorProviderSchema.optional(),
|
|
23432
|
-
installEnabled:
|
|
23433
|
-
enabled:
|
|
23434
|
-
ready:
|
|
23435
|
-
readinessReasons:
|
|
23436
|
-
model:
|
|
23739
|
+
installEnabled: z81.boolean(),
|
|
23740
|
+
enabled: z81.boolean(),
|
|
23741
|
+
ready: z81.boolean(),
|
|
23742
|
+
readinessReasons: z81.array(z81.string()),
|
|
23743
|
+
model: z81.string(),
|
|
23437
23744
|
enablementEpoch: count,
|
|
23438
23745
|
completionBoundary: count,
|
|
23439
23746
|
evaluationDefinitionId: id.nullable(),
|
|
23440
|
-
actions:
|
|
23441
|
-
experimental:
|
|
23442
|
-
disclosure:
|
|
23443
|
-
}).strict();
|
|
23444
|
-
var sentimentBackfillSelectionSchema = sentimentSelectionBaseSchema.extend({ runIds: runIds.optional(), from:
|
|
23445
|
-
var sentimentBackfillRequestSchema =
|
|
23446
|
-
var sentimentBackfillPreviewSchema =
|
|
23447
|
-
previewToken:
|
|
23448
|
-
expiresAt:
|
|
23747
|
+
actions: z81.object({ configure: z81.boolean(), backfill: z81.boolean() }).strict(),
|
|
23748
|
+
experimental: z81.literal(true),
|
|
23749
|
+
disclosure: z81.string()
|
|
23750
|
+
}).strict();
|
|
23751
|
+
var sentimentBackfillSelectionSchema = sentimentSelectionBaseSchema.extend({ runIds: runIds.optional(), from: z81.string().datetime().optional(), to: z81.string().datetime().optional() }).superRefine(exclusiveSentimentRuns);
|
|
23752
|
+
var sentimentBackfillRequestSchema = z81.object({ previewToken: z81.string().min(1).max(65536), idempotencyKey: z81.string().trim().min(1).max(128) }).strict();
|
|
23753
|
+
var sentimentBackfillPreviewSchema = z81.object({
|
|
23754
|
+
previewToken: z81.string().nullable(),
|
|
23755
|
+
expiresAt: z81.string().nullable(),
|
|
23449
23756
|
selection: sentimentBackfillSelectionSchema,
|
|
23450
23757
|
evaluationDefinitionId: id.nullable(),
|
|
23451
23758
|
eligibleAssessments: count,
|
|
23452
23759
|
alreadyClassified: count,
|
|
23453
|
-
skipped:
|
|
23760
|
+
skipped: z81.array(z81.object({ runId: id, reason: z81.string(), count }).strict()),
|
|
23454
23761
|
estimatedInputTokens: count,
|
|
23455
|
-
estimatedCostUsd:
|
|
23456
|
-
estimateMethod:
|
|
23762
|
+
estimatedCostUsd: z81.number().nonnegative().nullable(),
|
|
23763
|
+
estimateMethod: z81.string()
|
|
23457
23764
|
}).strict();
|
|
23458
|
-
var sentimentJobStateSchema =
|
|
23459
|
-
var sentimentAttemptReceiptSchema =
|
|
23460
|
-
var sentimentJobSchema =
|
|
23765
|
+
var sentimentJobStateSchema = z81.enum(["pending", "running", "waiting-to-retry", "complete", "partial", "failed", "canceled"]);
|
|
23766
|
+
var sentimentAttemptReceiptSchema = z81.object({ id, workItemId: id, dispatchedAt: z81.string(), completedAt: z81.string().nullable(), returnedModel: z81.string().nullable(), usage: sentimentUsageSchema, errorCode: z81.string().nullable() }).strict();
|
|
23767
|
+
var sentimentJobSchema = z81.object({
|
|
23461
23768
|
id,
|
|
23462
23769
|
projectId: id,
|
|
23463
|
-
origin:
|
|
23770
|
+
origin: z81.enum(["automatic", "backfill"]),
|
|
23464
23771
|
state: sentimentJobStateSchema,
|
|
23465
23772
|
enablementEpoch: count,
|
|
23466
23773
|
evaluationDefinitionId: id,
|
|
23467
23774
|
selection: sentimentBackfillSelectionSchema,
|
|
23468
|
-
createdAt:
|
|
23469
|
-
updatedAt:
|
|
23775
|
+
createdAt: z81.string(),
|
|
23776
|
+
updatedAt: z81.string(),
|
|
23470
23777
|
counts: sentimentCountsSchema,
|
|
23471
23778
|
selected: count,
|
|
23472
|
-
cancellationReason:
|
|
23473
|
-
attempts:
|
|
23779
|
+
cancellationReason: z81.string().nullable(),
|
|
23780
|
+
attempts: z81.array(sentimentAttemptReceiptSchema),
|
|
23474
23781
|
/** Paged job read: every attempt of the job, and the cursor for the next (older) attempts. */
|
|
23475
23782
|
attemptCount: count.optional(),
|
|
23476
|
-
nextAttemptCursor:
|
|
23783
|
+
nextAttemptCursor: z81.string().nullable().optional()
|
|
23477
23784
|
}).strict();
|
|
23478
23785
|
var sentimentJobSummarySchema = sentimentJobSchema.omit({ attempts: true, attemptCount: true, nextAttemptCursor: true }).extend({ attemptCount: count }).strict();
|
|
23479
|
-
var sentimentJobsSchema =
|
|
23786
|
+
var sentimentJobsSchema = z81.object({ jobs: z81.array(sentimentJobSummarySchema) }).strict();
|
|
23480
23787
|
var SENTIMENT_ATTEMPT_PAGE_DEFAULT = 50;
|
|
23481
|
-
var sentimentJobRequestSchema =
|
|
23482
|
-
attemptLimit:
|
|
23483
|
-
attemptCursor:
|
|
23788
|
+
var sentimentJobRequestSchema = z81.object({
|
|
23789
|
+
attemptLimit: z81.coerce.number().int().min(1).max(200).default(SENTIMENT_ATTEMPT_PAGE_DEFAULT),
|
|
23790
|
+
attemptCursor: z81.string().min(1).max(4096).optional()
|
|
23484
23791
|
}).strict();
|
|
23485
|
-
var sentimentEvidenceItemSchema =
|
|
23792
|
+
var sentimentEvidenceItemSchema = z81.object({
|
|
23486
23793
|
assessmentId: id,
|
|
23487
23794
|
runId: id,
|
|
23488
23795
|
sourceSnapshotId: id,
|
|
23489
|
-
sourceText:
|
|
23796
|
+
sourceText: z81.string(),
|
|
23490
23797
|
sourceTextHash: id,
|
|
23491
23798
|
subject: sentimentSubjectSchema,
|
|
23492
23799
|
subjectHash: id,
|
|
23493
23800
|
context: sentimentExecutionContextSchema,
|
|
23494
23801
|
evaluationDefinitionId: id,
|
|
23495
23802
|
outcome: sentimentOutcomeSchema,
|
|
23496
|
-
conclusion:
|
|
23497
|
-
complaint:
|
|
23498
|
-
returnedModel:
|
|
23499
|
-
reason:
|
|
23803
|
+
conclusion: z81.array(sentimentEvidenceSchema),
|
|
23804
|
+
complaint: z81.array(sentimentEvidenceSchema).nullable(),
|
|
23805
|
+
returnedModel: z81.string().nullable(),
|
|
23806
|
+
reason: z81.string().nullable()
|
|
23500
23807
|
}).strict();
|
|
23501
|
-
var sentimentEvidencePageSchema =
|
|
23502
|
-
var sentimentComparisonSchema =
|
|
23808
|
+
var sentimentEvidencePageSchema = z81.object({ state: sentimentStateSchema, selection: sentimentResolvedSelectionSchema.extend({ assessmentId: id.optional(), outcome: z81.array(sentimentOutcomeSchema).optional() }), items: z81.array(sentimentEvidenceItemSchema), nextCursor: z81.string().nullable() }).strict();
|
|
23809
|
+
var sentimentComparisonSchema = z81.object({
|
|
23503
23810
|
from: sentimentSummarySchema,
|
|
23504
23811
|
to: sentimentSummarySchema,
|
|
23505
|
-
verdict:
|
|
23506
|
-
favorableRateDelta:
|
|
23507
|
-
refusalReasons:
|
|
23812
|
+
verdict: z81.enum(["improved", "declined", "no-clear-change"]).nullable(),
|
|
23813
|
+
favorableRateDelta: z81.number().nullable(),
|
|
23814
|
+
refusalReasons: z81.array(z81.string()),
|
|
23508
23815
|
commonUnits: count,
|
|
23509
23816
|
excludedFrom: count,
|
|
23510
23817
|
excludedTo: count,
|
|
23511
|
-
changedScope:
|
|
23512
|
-
method:
|
|
23513
|
-
limitation:
|
|
23818
|
+
changedScope: z81.boolean(),
|
|
23819
|
+
method: z81.literal("wilson-independent-v1"),
|
|
23820
|
+
limitation: z81.string()
|
|
23514
23821
|
}).strict();
|
|
23515
23822
|
function emptySentimentCounts() {
|
|
23516
23823
|
return Object.fromEntries(sentimentOutcomeSchema.options.map((outcome) => [outcome, 0]));
|
|
@@ -23547,7 +23854,7 @@ function aggregateSentiment(items, options = {}) {
|
|
|
23547
23854
|
}
|
|
23548
23855
|
|
|
23549
23856
|
// ../contracts/src/composites.ts
|
|
23550
|
-
import { z as
|
|
23857
|
+
import { z as z82 } from "zod";
|
|
23551
23858
|
var PROJECT_OVERVIEW_QUERY_CLASS_SCOPE = {
|
|
23552
23859
|
queryClass: "all",
|
|
23553
23860
|
figures: [
|
|
@@ -23569,26 +23876,26 @@ var PROJECT_OVERVIEW_QUERY_CLASS_SCOPE = {
|
|
|
23569
23876
|
],
|
|
23570
23877
|
note: "These figures pool branded and non-brand queries in one denominator. Only scores.mentionShare splits the classes. For one class, use a read filtered by queryClass."
|
|
23571
23878
|
};
|
|
23572
|
-
var metricToneSchema =
|
|
23573
|
-
var scoreSummarySchema =
|
|
23574
|
-
label:
|
|
23575
|
-
value:
|
|
23576
|
-
delta:
|
|
23879
|
+
var metricToneSchema = z82.enum(["positive", "caution", "negative", "neutral"]);
|
|
23880
|
+
var scoreSummarySchema = z82.object({
|
|
23881
|
+
label: z82.string(),
|
|
23882
|
+
value: z82.string(),
|
|
23883
|
+
delta: z82.string(),
|
|
23577
23884
|
tone: metricToneSchema,
|
|
23578
|
-
description:
|
|
23579
|
-
tooltip:
|
|
23580
|
-
trend:
|
|
23885
|
+
description: z82.string(),
|
|
23886
|
+
tooltip: z82.string().optional(),
|
|
23887
|
+
trend: z82.array(percent()),
|
|
23581
23888
|
progress: percent().optional(),
|
|
23582
|
-
providerCoverage:
|
|
23889
|
+
providerCoverage: z82.string().optional()
|
|
23583
23890
|
});
|
|
23584
|
-
var mentionShareBreakdownSchema =
|
|
23585
|
-
projectMentionSnapshots:
|
|
23586
|
-
competitorMentionSnapshots:
|
|
23891
|
+
var mentionShareBreakdownSchema = z82.object({
|
|
23892
|
+
projectMentionSnapshots: z82.number().int().nonnegative(),
|
|
23893
|
+
competitorMentionSnapshots: z82.number().int().nonnegative(),
|
|
23587
23894
|
/** `projectMentionSnapshots + competitorMentionSnapshots`, the denominator of `score` and every `ranking` share. */
|
|
23588
|
-
combinedMentionSnapshots:
|
|
23589
|
-
perCompetitor:
|
|
23590
|
-
domain:
|
|
23591
|
-
mentionSnapshots:
|
|
23895
|
+
combinedMentionSnapshots: z82.number().int().nonnegative(),
|
|
23896
|
+
perCompetitor: z82.array(z82.object({
|
|
23897
|
+
domain: z82.string(),
|
|
23898
|
+
mentionSnapshots: z82.number().int().nonnegative(),
|
|
23592
23899
|
shareOfCompetitiveTotal: percent()
|
|
23593
23900
|
})),
|
|
23594
23901
|
/**
|
|
@@ -23598,50 +23905,50 @@ var mentionShareBreakdownSchema = z81.object({
|
|
|
23598
23905
|
* Empty when there is no head-to-head: no tracked competitors, or no brand
|
|
23599
23906
|
* named in this class.
|
|
23600
23907
|
*/
|
|
23601
|
-
ranking:
|
|
23602
|
-
kind:
|
|
23908
|
+
ranking: z82.array(z82.object({
|
|
23909
|
+
kind: z82.enum(["project", "competitor"]),
|
|
23603
23910
|
/** The tracked competitor's domain. Null on the project's row. */
|
|
23604
|
-
domain:
|
|
23605
|
-
mentionSnapshots:
|
|
23606
|
-
share: fraction(
|
|
23911
|
+
domain: z82.string().nullable(),
|
|
23912
|
+
mentionSnapshots: z82.number().int().nonnegative(),
|
|
23913
|
+
share: fraction(z82.number().min(0).max(1))
|
|
23607
23914
|
})),
|
|
23608
|
-
snapshotsWithAnswerText:
|
|
23609
|
-
snapshotsTotal:
|
|
23610
|
-
score: percent(
|
|
23915
|
+
snapshotsWithAnswerText: z82.number().int().nonnegative(),
|
|
23916
|
+
snapshotsTotal: z82.number().int().nonnegative(),
|
|
23917
|
+
score: percent(z82.number().min(0).max(100)).nullable()
|
|
23611
23918
|
});
|
|
23612
23919
|
var mentionShareSchema = scoreSummarySchema.extend({
|
|
23613
23920
|
/** Non-brand queries — the competitive figure. See `MentionShareDto`. */
|
|
23614
23921
|
breakdown: mentionShareBreakdownSchema,
|
|
23615
|
-
scope:
|
|
23922
|
+
scope: z82.enum(["non-brand", "pooled"]),
|
|
23616
23923
|
/** Branded queries, beside the competitive figure and never inside it. */
|
|
23617
23924
|
branded: mentionShareBreakdownSchema
|
|
23618
23925
|
});
|
|
23619
|
-
var movementSummarySchema =
|
|
23620
|
-
gained:
|
|
23621
|
-
lost:
|
|
23926
|
+
var movementSummarySchema = z82.object({
|
|
23927
|
+
gained: z82.number().int().nonnegative(),
|
|
23928
|
+
lost: z82.number().int().nonnegative(),
|
|
23622
23929
|
tone: metricToneSchema,
|
|
23623
|
-
hasPreviousRun:
|
|
23624
|
-
gainedQueries:
|
|
23625
|
-
lostQueries:
|
|
23626
|
-
});
|
|
23627
|
-
var movementComparisonSchema =
|
|
23628
|
-
hasPreviousRun:
|
|
23629
|
-
comparable:
|
|
23630
|
-
querySetChanged:
|
|
23631
|
-
previousRunAt:
|
|
23632
|
-
currentQueryCount:
|
|
23633
|
-
previousQueryCount:
|
|
23634
|
-
comparableQueryCount:
|
|
23635
|
-
addedQueryCount:
|
|
23636
|
-
removedQueryCount:
|
|
23637
|
-
addedQueries:
|
|
23638
|
-
removedQueries:
|
|
23639
|
-
});
|
|
23640
|
-
var projectOverviewInsightSchema =
|
|
23641
|
-
id:
|
|
23642
|
-
projectId:
|
|
23643
|
-
runId:
|
|
23644
|
-
type:
|
|
23930
|
+
hasPreviousRun: z82.boolean(),
|
|
23931
|
+
gainedQueries: z82.array(z82.string()).optional(),
|
|
23932
|
+
lostQueries: z82.array(z82.string()).optional()
|
|
23933
|
+
});
|
|
23934
|
+
var movementComparisonSchema = z82.object({
|
|
23935
|
+
hasPreviousRun: z82.boolean(),
|
|
23936
|
+
comparable: z82.boolean(),
|
|
23937
|
+
querySetChanged: z82.boolean(),
|
|
23938
|
+
previousRunAt: z82.string().nullable(),
|
|
23939
|
+
currentQueryCount: z82.number().int().nonnegative(),
|
|
23940
|
+
previousQueryCount: z82.number().int().nonnegative(),
|
|
23941
|
+
comparableQueryCount: z82.number().int().nonnegative(),
|
|
23942
|
+
addedQueryCount: z82.number().int().nonnegative(),
|
|
23943
|
+
removedQueryCount: z82.number().int().nonnegative(),
|
|
23944
|
+
addedQueries: z82.array(z82.string()),
|
|
23945
|
+
removedQueries: z82.array(z82.string())
|
|
23946
|
+
});
|
|
23947
|
+
var projectOverviewInsightSchema = z82.object({
|
|
23948
|
+
id: z82.string(),
|
|
23949
|
+
projectId: z82.string(),
|
|
23950
|
+
runId: z82.string().nullable(),
|
|
23951
|
+
type: z82.enum([
|
|
23645
23952
|
"regression",
|
|
23646
23953
|
"gain",
|
|
23647
23954
|
"opportunity",
|
|
@@ -23658,75 +23965,75 @@ var projectOverviewInsightSchema = z81.object({
|
|
|
23658
23965
|
"gbp-keyword-drop"
|
|
23659
23966
|
]),
|
|
23660
23967
|
severity: insightSeveritySchema,
|
|
23661
|
-
title:
|
|
23662
|
-
query:
|
|
23663
|
-
provider:
|
|
23664
|
-
recommendation:
|
|
23665
|
-
action:
|
|
23666
|
-
target:
|
|
23667
|
-
reason:
|
|
23968
|
+
title: z82.string(),
|
|
23969
|
+
query: z82.string(),
|
|
23970
|
+
provider: z82.string(),
|
|
23971
|
+
recommendation: z82.object({
|
|
23972
|
+
action: z82.string(),
|
|
23973
|
+
target: z82.string().optional(),
|
|
23974
|
+
reason: z82.string()
|
|
23668
23975
|
}).optional(),
|
|
23669
|
-
cause:
|
|
23670
|
-
cause:
|
|
23671
|
-
competitorDomain:
|
|
23672
|
-
details:
|
|
23976
|
+
cause: z82.object({
|
|
23977
|
+
cause: z82.string(),
|
|
23978
|
+
competitorDomain: z82.string().optional(),
|
|
23979
|
+
details: z82.string().optional()
|
|
23673
23980
|
}).optional(),
|
|
23674
|
-
dismissed:
|
|
23675
|
-
createdAt:
|
|
23981
|
+
dismissed: z82.boolean(),
|
|
23982
|
+
createdAt: z82.string()
|
|
23676
23983
|
});
|
|
23677
|
-
var projectOverviewHealthSchema =
|
|
23678
|
-
id:
|
|
23679
|
-
projectId:
|
|
23680
|
-
runId:
|
|
23984
|
+
var projectOverviewHealthSchema = z82.object({
|
|
23985
|
+
id: z82.string(),
|
|
23986
|
+
projectId: z82.string(),
|
|
23987
|
+
runId: z82.string().nullable(),
|
|
23681
23988
|
overallCitedRate: fraction(),
|
|
23682
23989
|
overallMentionRate: fraction(),
|
|
23683
|
-
totalPairs:
|
|
23684
|
-
citedPairs:
|
|
23685
|
-
mentionedPairs:
|
|
23686
|
-
providerBreakdown:
|
|
23990
|
+
totalPairs: z82.number().int().nonnegative(),
|
|
23991
|
+
citedPairs: z82.number().int().nonnegative(),
|
|
23992
|
+
mentionedPairs: z82.number().int().nonnegative(),
|
|
23993
|
+
providerBreakdown: z82.record(z82.string(), z82.object({
|
|
23687
23994
|
citedRate: fraction(),
|
|
23688
23995
|
mentionRate: fraction(),
|
|
23689
|
-
cited:
|
|
23690
|
-
mentioned:
|
|
23691
|
-
total:
|
|
23996
|
+
cited: z82.number().int().nonnegative(),
|
|
23997
|
+
mentioned: z82.number().int().nonnegative(),
|
|
23998
|
+
total: z82.number().int().nonnegative()
|
|
23692
23999
|
})),
|
|
23693
|
-
createdAt:
|
|
23694
|
-
status:
|
|
23695
|
-
reason:
|
|
24000
|
+
createdAt: z82.string(),
|
|
24001
|
+
status: z82.enum(["ready", "no-data"]),
|
|
24002
|
+
reason: z82.literal("no-runs-yet").optional()
|
|
23696
24003
|
});
|
|
23697
|
-
var projectOverviewDtoSchema =
|
|
24004
|
+
var projectOverviewDtoSchema = z82.object({
|
|
23698
24005
|
sentiment: sentimentOverviewSchema.optional(),
|
|
23699
24006
|
project: projectDtoSchema,
|
|
23700
24007
|
latestRun: latestProjectRunDtoSchema,
|
|
23701
24008
|
health: projectOverviewHealthSchema.nullable(),
|
|
23702
|
-
topInsights:
|
|
23703
|
-
queryClassScope:
|
|
23704
|
-
queryClass:
|
|
23705
|
-
figures:
|
|
23706
|
-
note:
|
|
24009
|
+
topInsights: z82.array(projectOverviewInsightSchema),
|
|
24010
|
+
queryClassScope: z82.object({
|
|
24011
|
+
queryClass: z82.literal("all"),
|
|
24012
|
+
figures: z82.array(z82.string()),
|
|
24013
|
+
note: z82.string()
|
|
23707
24014
|
}).optional(),
|
|
23708
|
-
queryCounts:
|
|
23709
|
-
totalQueries:
|
|
23710
|
-
citedQueries:
|
|
23711
|
-
notCitedQueries:
|
|
24015
|
+
queryCounts: z82.object({
|
|
24016
|
+
totalQueries: z82.number().int().nonnegative(),
|
|
24017
|
+
citedQueries: z82.number().int().nonnegative(),
|
|
24018
|
+
notCitedQueries: z82.number().int().nonnegative(),
|
|
23712
24019
|
citedRate: fraction(),
|
|
23713
|
-
mentionedQueries:
|
|
23714
|
-
notMentionedQueries:
|
|
24020
|
+
mentionedQueries: z82.number().int().nonnegative(),
|
|
24021
|
+
notMentionedQueries: z82.number().int().nonnegative(),
|
|
23715
24022
|
mentionRate: fraction()
|
|
23716
24023
|
}),
|
|
23717
|
-
providers:
|
|
23718
|
-
provider:
|
|
24024
|
+
providers: z82.array(z82.object({
|
|
24025
|
+
provider: z82.string(),
|
|
23719
24026
|
citedRate: fraction(),
|
|
23720
|
-
cited:
|
|
23721
|
-
total:
|
|
24027
|
+
cited: z82.number().int().nonnegative(),
|
|
24028
|
+
total: z82.number().int().nonnegative()
|
|
23722
24029
|
})),
|
|
23723
|
-
transitions:
|
|
23724
|
-
since:
|
|
23725
|
-
gained:
|
|
23726
|
-
lost:
|
|
23727
|
-
emerging:
|
|
24030
|
+
transitions: z82.object({
|
|
24031
|
+
since: z82.string().nullable(),
|
|
24032
|
+
gained: z82.number().int().nonnegative(),
|
|
24033
|
+
lost: z82.number().int().nonnegative(),
|
|
24034
|
+
emerging: z82.number().int().nonnegative()
|
|
23728
24035
|
}),
|
|
23729
|
-
scores:
|
|
24036
|
+
scores: z82.object({
|
|
23730
24037
|
mention: scoreSummarySchema,
|
|
23731
24038
|
visibility: scoreSummarySchema,
|
|
23732
24039
|
mentionShare: mentionShareSchema,
|
|
@@ -23740,74 +24047,74 @@ var projectOverviewDtoSchema = z81.object({
|
|
|
23740
24047
|
citationMovement: movementSummarySchema,
|
|
23741
24048
|
mentionMovement: movementSummarySchema,
|
|
23742
24049
|
movementComparison: movementComparisonSchema,
|
|
23743
|
-
competitors:
|
|
23744
|
-
id:
|
|
23745
|
-
domain:
|
|
23746
|
-
aliases:
|
|
23747
|
-
autoAliasNames:
|
|
23748
|
-
citationCount:
|
|
23749
|
-
totalQueries:
|
|
23750
|
-
pressureLabel:
|
|
23751
|
-
citedQueries:
|
|
24050
|
+
competitors: z82.array(z82.object({
|
|
24051
|
+
id: z82.string(),
|
|
24052
|
+
domain: z82.string(),
|
|
24053
|
+
aliases: z82.array(z82.string()).optional(),
|
|
24054
|
+
autoAliasNames: z82.array(z82.string()).optional(),
|
|
24055
|
+
citationCount: z82.number().int().nonnegative(),
|
|
24056
|
+
totalQueries: z82.number().int().nonnegative(),
|
|
24057
|
+
pressureLabel: z82.enum(["None", "Low", "Moderate", "High"]),
|
|
24058
|
+
citedQueries: z82.array(z82.string())
|
|
23752
24059
|
})),
|
|
23753
|
-
providerScores:
|
|
23754
|
-
provider:
|
|
23755
|
-
model:
|
|
24060
|
+
providerScores: z82.array(z82.object({
|
|
24061
|
+
provider: z82.string(),
|
|
24062
|
+
model: z82.string().nullable(),
|
|
23756
24063
|
score: percent(),
|
|
23757
|
-
cited:
|
|
23758
|
-
total:
|
|
23759
|
-
trend:
|
|
24064
|
+
cited: z82.number().int().nonnegative(),
|
|
24065
|
+
total: z82.number().int().nonnegative(),
|
|
24066
|
+
trend: z82.array(percent()).optional()
|
|
23760
24067
|
})),
|
|
23761
|
-
attentionItems:
|
|
23762
|
-
id:
|
|
24068
|
+
attentionItems: z82.array(z82.object({
|
|
24069
|
+
id: z82.string(),
|
|
23763
24070
|
tone: metricToneSchema,
|
|
23764
|
-
title:
|
|
23765
|
-
detail:
|
|
23766
|
-
actionLabel:
|
|
23767
|
-
href:
|
|
24071
|
+
title: z82.string(),
|
|
24072
|
+
detail: z82.string(),
|
|
24073
|
+
actionLabel: z82.string(),
|
|
24074
|
+
href: z82.string()
|
|
23768
24075
|
})),
|
|
23769
|
-
runHistory:
|
|
23770
|
-
runId:
|
|
23771
|
-
createdAt:
|
|
23772
|
-
citedCount:
|
|
23773
|
-
totalCount:
|
|
24076
|
+
runHistory: z82.array(z82.object({
|
|
24077
|
+
runId: z82.string(),
|
|
24078
|
+
createdAt: z82.string(),
|
|
24079
|
+
citedCount: z82.number().int().nonnegative(),
|
|
24080
|
+
totalCount: z82.number().int().nonnegative(),
|
|
23774
24081
|
citationRate: percent(),
|
|
23775
|
-
mentionedCount:
|
|
24082
|
+
mentionedCount: z82.number().int().nonnegative(),
|
|
23776
24083
|
mentionRate: percent(),
|
|
23777
|
-
status:
|
|
24084
|
+
status: z82.string()
|
|
23778
24085
|
})),
|
|
23779
|
-
suggestedQueries:
|
|
23780
|
-
rows:
|
|
23781
|
-
query:
|
|
23782
|
-
impressions:
|
|
23783
|
-
clicks:
|
|
23784
|
-
avgPosition:
|
|
23785
|
-
reason:
|
|
24086
|
+
suggestedQueries: z82.object({
|
|
24087
|
+
rows: z82.array(z82.object({
|
|
24088
|
+
query: z82.string(),
|
|
24089
|
+
impressions: z82.number(),
|
|
24090
|
+
clicks: z82.number(),
|
|
24091
|
+
avgPosition: z82.number(),
|
|
24092
|
+
reason: z82.string()
|
|
23786
24093
|
})),
|
|
23787
|
-
totalCandidates:
|
|
23788
|
-
skippedAlreadyTracked:
|
|
24094
|
+
totalCandidates: z82.number().int().nonnegative(),
|
|
24095
|
+
skippedAlreadyTracked: z82.number().int().nonnegative()
|
|
23789
24096
|
}),
|
|
23790
|
-
dateRangeLabel:
|
|
23791
|
-
contextLabel:
|
|
23792
|
-
});
|
|
23793
|
-
var searchHitKindSchema =
|
|
23794
|
-
var projectSearchSnapshotHitSchema =
|
|
23795
|
-
kind:
|
|
23796
|
-
id:
|
|
23797
|
-
runId:
|
|
23798
|
-
query:
|
|
23799
|
-
provider:
|
|
23800
|
-
model:
|
|
24097
|
+
dateRangeLabel: z82.string(),
|
|
24098
|
+
contextLabel: z82.string()
|
|
24099
|
+
});
|
|
24100
|
+
var searchHitKindSchema = z82.enum(["snapshot", "insight"]);
|
|
24101
|
+
var projectSearchSnapshotHitSchema = z82.object({
|
|
24102
|
+
kind: z82.literal("snapshot"),
|
|
24103
|
+
id: z82.string(),
|
|
24104
|
+
runId: z82.string(),
|
|
24105
|
+
query: z82.string(),
|
|
24106
|
+
provider: z82.string(),
|
|
24107
|
+
model: z82.string().nullable(),
|
|
23801
24108
|
citationState: citationStateSchema,
|
|
23802
|
-
matchedField:
|
|
23803
|
-
snippet:
|
|
23804
|
-
createdAt:
|
|
23805
|
-
});
|
|
23806
|
-
var projectSearchInsightHitSchema =
|
|
23807
|
-
kind:
|
|
23808
|
-
id:
|
|
23809
|
-
runId:
|
|
23810
|
-
type:
|
|
24109
|
+
matchedField: z82.enum(["answerText", "citedDomains", "citedUrls", "searchQueries", "query"]),
|
|
24110
|
+
snippet: z82.string(),
|
|
24111
|
+
createdAt: z82.string()
|
|
24112
|
+
});
|
|
24113
|
+
var projectSearchInsightHitSchema = z82.object({
|
|
24114
|
+
kind: z82.literal("insight"),
|
|
24115
|
+
id: z82.string(),
|
|
24116
|
+
runId: z82.string().nullable(),
|
|
24117
|
+
type: z82.enum([
|
|
23811
24118
|
"regression",
|
|
23812
24119
|
"gain",
|
|
23813
24120
|
"opportunity",
|
|
@@ -23825,23 +24132,23 @@ var projectSearchInsightHitSchema = z81.object({
|
|
|
23825
24132
|
"gbp-keyword-drop"
|
|
23826
24133
|
]),
|
|
23827
24134
|
severity: insightSeveritySchema,
|
|
23828
|
-
title:
|
|
23829
|
-
query:
|
|
23830
|
-
provider:
|
|
23831
|
-
matchedField:
|
|
23832
|
-
snippet:
|
|
23833
|
-
dismissed:
|
|
23834
|
-
createdAt:
|
|
23835
|
-
});
|
|
23836
|
-
var projectSearchHitSchema =
|
|
24135
|
+
title: z82.string(),
|
|
24136
|
+
query: z82.string(),
|
|
24137
|
+
provider: z82.string(),
|
|
24138
|
+
matchedField: z82.enum(["title", "query", "recommendation", "cause"]),
|
|
24139
|
+
snippet: z82.string(),
|
|
24140
|
+
dismissed: z82.boolean(),
|
|
24141
|
+
createdAt: z82.string()
|
|
24142
|
+
});
|
|
24143
|
+
var projectSearchHitSchema = z82.discriminatedUnion("kind", [
|
|
23837
24144
|
projectSearchSnapshotHitSchema,
|
|
23838
24145
|
projectSearchInsightHitSchema
|
|
23839
24146
|
]);
|
|
23840
|
-
var projectSearchResponseSchema =
|
|
23841
|
-
query:
|
|
23842
|
-
totalHits:
|
|
23843
|
-
truncated:
|
|
23844
|
-
hits:
|
|
24147
|
+
var projectSearchResponseSchema = z82.object({
|
|
24148
|
+
query: z82.string(),
|
|
24149
|
+
totalHits: z82.number().int().nonnegative(),
|
|
24150
|
+
truncated: z82.boolean(),
|
|
24151
|
+
hits: z82.array(projectSearchHitSchema)
|
|
23845
24152
|
});
|
|
23846
24153
|
|
|
23847
24154
|
// ../contracts/src/index-coverage.ts
|
|
@@ -23905,52 +24212,52 @@ function summarizeObservedQueryCounts(snapshots) {
|
|
|
23905
24212
|
}
|
|
23906
24213
|
|
|
23907
24214
|
// ../contracts/src/citations.ts
|
|
23908
|
-
import { z as
|
|
23909
|
-
var citationCoverageProviderSchema =
|
|
23910
|
-
provider:
|
|
24215
|
+
import { z as z83 } from "zod";
|
|
24216
|
+
var citationCoverageProviderSchema = z83.object({
|
|
24217
|
+
provider: z83.string(),
|
|
23911
24218
|
citationState: citationStateSchema,
|
|
23912
|
-
cited:
|
|
23913
|
-
mentioned:
|
|
23914
|
-
runId:
|
|
23915
|
-
runCreatedAt:
|
|
23916
|
-
});
|
|
23917
|
-
var citationCoverageRowSchema =
|
|
23918
|
-
queryId:
|
|
23919
|
-
query:
|
|
23920
|
-
providers:
|
|
23921
|
-
citedCount:
|
|
23922
|
-
mentionedCount:
|
|
23923
|
-
totalProviders:
|
|
23924
|
-
});
|
|
23925
|
-
var competitorGapRowSchema =
|
|
23926
|
-
queryId:
|
|
23927
|
-
query:
|
|
23928
|
-
provider:
|
|
23929
|
-
citingCompetitors:
|
|
23930
|
-
runId:
|
|
23931
|
-
runCreatedAt:
|
|
23932
|
-
});
|
|
23933
|
-
var citationVisibilitySummarySchema =
|
|
23934
|
-
providersConfigured:
|
|
23935
|
-
providersCiting:
|
|
23936
|
-
providersMentioning:
|
|
23937
|
-
totalQueries:
|
|
24219
|
+
cited: z83.boolean(),
|
|
24220
|
+
mentioned: z83.boolean(),
|
|
24221
|
+
runId: z83.string(),
|
|
24222
|
+
runCreatedAt: z83.string()
|
|
24223
|
+
});
|
|
24224
|
+
var citationCoverageRowSchema = z83.object({
|
|
24225
|
+
queryId: z83.string(),
|
|
24226
|
+
query: z83.string(),
|
|
24227
|
+
providers: z83.array(citationCoverageProviderSchema),
|
|
24228
|
+
citedCount: z83.number().int().nonnegative(),
|
|
24229
|
+
mentionedCount: z83.number().int().nonnegative(),
|
|
24230
|
+
totalProviders: z83.number().int().nonnegative()
|
|
24231
|
+
});
|
|
24232
|
+
var competitorGapRowSchema = z83.object({
|
|
24233
|
+
queryId: z83.string(),
|
|
24234
|
+
query: z83.string(),
|
|
24235
|
+
provider: z83.string(),
|
|
24236
|
+
citingCompetitors: z83.array(z83.string()),
|
|
24237
|
+
runId: z83.string(),
|
|
24238
|
+
runCreatedAt: z83.string()
|
|
24239
|
+
});
|
|
24240
|
+
var citationVisibilitySummarySchema = z83.object({
|
|
24241
|
+
providersConfigured: z83.number().int().nonnegative(),
|
|
24242
|
+
providersCiting: z83.number().int().nonnegative(),
|
|
24243
|
+
providersMentioning: z83.number().int().nonnegative(),
|
|
24244
|
+
totalQueries: z83.number().int().nonnegative(),
|
|
23938
24245
|
// Cross-tab buckets — each tracked query with at least one snapshot lands
|
|
23939
24246
|
// in exactly one of these. Queries with zero snapshots are not counted in
|
|
23940
24247
|
// any bucket; (sum of buckets) ≤ totalQueries.
|
|
23941
|
-
queriesCitedAndMentioned:
|
|
23942
|
-
queriesCitedOnly:
|
|
23943
|
-
queriesMentionedOnly:
|
|
23944
|
-
queriesInvisible:
|
|
23945
|
-
latestRunId:
|
|
23946
|
-
latestRunAt:
|
|
23947
|
-
});
|
|
23948
|
-
var citationVisibilityResponseSchema =
|
|
24248
|
+
queriesCitedAndMentioned: z83.number().int().nonnegative(),
|
|
24249
|
+
queriesCitedOnly: z83.number().int().nonnegative(),
|
|
24250
|
+
queriesMentionedOnly: z83.number().int().nonnegative(),
|
|
24251
|
+
queriesInvisible: z83.number().int().nonnegative(),
|
|
24252
|
+
latestRunId: z83.string().nullable(),
|
|
24253
|
+
latestRunAt: z83.string().nullable()
|
|
24254
|
+
});
|
|
24255
|
+
var citationVisibilityResponseSchema = z83.object({
|
|
23949
24256
|
summary: citationVisibilitySummarySchema,
|
|
23950
|
-
byQuery:
|
|
23951
|
-
competitorGaps:
|
|
23952
|
-
status:
|
|
23953
|
-
reason:
|
|
24257
|
+
byQuery: z83.array(citationCoverageRowSchema),
|
|
24258
|
+
competitorGaps: z83.array(competitorGapRowSchema),
|
|
24259
|
+
status: z83.enum(["ready", "no-data"]),
|
|
24260
|
+
reason: z83.enum(["no-runs-yet", "no-queries"]).optional()
|
|
23954
24261
|
});
|
|
23955
24262
|
function emptyCitationVisibility(reason) {
|
|
23956
24263
|
return {
|
|
@@ -23977,103 +24284,103 @@ function citationStateToCited(state) {
|
|
|
23977
24284
|
}
|
|
23978
24285
|
|
|
23979
24286
|
// ../contracts/src/organic-evidence.ts
|
|
23980
|
-
import { z as
|
|
23981
|
-
var organicEvidencePeriodSchema =
|
|
24287
|
+
import { z as z84 } from "zod";
|
|
24288
|
+
var organicEvidencePeriodSchema = z84.union(windowDayValues(WINDOW_SETS.organicEvidence).map((value) => z84.literal(value)));
|
|
23982
24289
|
function parseOrganicEvidencePeriod(value) {
|
|
23983
24290
|
return windowDays(parseWindowIn(value, WINDOW_SETS.organicEvidence, { field: "period", fallback: "90d" }));
|
|
23984
24291
|
}
|
|
23985
|
-
var cohortNameSchema =
|
|
23986
|
-
var countSchema =
|
|
23987
|
-
clicks:
|
|
23988
|
-
impressions:
|
|
24292
|
+
var cohortNameSchema = z84.enum(["earliest", "middle", "prior", "latest"]);
|
|
24293
|
+
var countSchema = z84.object({
|
|
24294
|
+
clicks: z84.number().int().nonnegative(),
|
|
24295
|
+
impressions: z84.number().int().nonnegative()
|
|
23989
24296
|
});
|
|
23990
|
-
var cohortSchema =
|
|
24297
|
+
var cohortSchema = z84.object({
|
|
23991
24298
|
name: cohortNameSchema,
|
|
23992
|
-
startDate:
|
|
23993
|
-
endDate:
|
|
24299
|
+
startDate: z84.string(),
|
|
24300
|
+
endDate: z84.string()
|
|
23994
24301
|
});
|
|
23995
24302
|
var searchCohortSchema = cohortSchema.extend({ totals: countSchema });
|
|
23996
24303
|
var sessionCohortSchema = cohortSchema.extend({
|
|
23997
|
-
organicSessions:
|
|
23998
|
-
});
|
|
23999
|
-
var sourceCoverageSchema =
|
|
24000
|
-
startDate:
|
|
24001
|
-
endDate:
|
|
24002
|
-
observedDays:
|
|
24003
|
-
});
|
|
24004
|
-
var crawlerCountsSchema =
|
|
24005
|
-
verified:
|
|
24006
|
-
claimedUnverified:
|
|
24007
|
-
unknownAiLike:
|
|
24008
|
-
});
|
|
24009
|
-
var referralCountsSchema =
|
|
24010
|
-
total:
|
|
24011
|
-
paid:
|
|
24012
|
-
organic:
|
|
24013
|
-
unknown:
|
|
24014
|
-
});
|
|
24015
|
-
var organicEvidenceDtoSchema =
|
|
24016
|
-
contractVersion:
|
|
24304
|
+
organicSessions: z84.number().int().nonnegative()
|
|
24305
|
+
});
|
|
24306
|
+
var sourceCoverageSchema = z84.object({
|
|
24307
|
+
startDate: z84.string(),
|
|
24308
|
+
endDate: z84.string(),
|
|
24309
|
+
observedDays: z84.number().int().nonnegative()
|
|
24310
|
+
});
|
|
24311
|
+
var crawlerCountsSchema = z84.object({
|
|
24312
|
+
verified: z84.number().int().nonnegative(),
|
|
24313
|
+
claimedUnverified: z84.number().int().nonnegative(),
|
|
24314
|
+
unknownAiLike: z84.number().int().nonnegative()
|
|
24315
|
+
});
|
|
24316
|
+
var referralCountsSchema = z84.object({
|
|
24317
|
+
total: z84.number().int().nonnegative(),
|
|
24318
|
+
paid: z84.number().int().nonnegative(),
|
|
24319
|
+
organic: z84.number().int().nonnegative(),
|
|
24320
|
+
unknown: z84.number().int().nonnegative()
|
|
24321
|
+
});
|
|
24322
|
+
var organicEvidenceDtoSchema = z84.object({
|
|
24323
|
+
contractVersion: z84.literal("organic-evidence/v1"),
|
|
24017
24324
|
periodDays: organicEvidencePeriodSchema,
|
|
24018
24325
|
/** Latest headline evidence date, preferring the GSC property date when available. */
|
|
24019
|
-
asOfDate:
|
|
24020
|
-
coverage:
|
|
24021
|
-
gsc:
|
|
24022
|
-
ga4:
|
|
24023
|
-
server:
|
|
24024
|
-
visibility:
|
|
24326
|
+
asOfDate: z84.string().nullable(),
|
|
24327
|
+
coverage: z84.object({
|
|
24328
|
+
gsc: z84.boolean(),
|
|
24329
|
+
ga4: z84.boolean(),
|
|
24330
|
+
server: z84.boolean(),
|
|
24331
|
+
visibility: z84.boolean()
|
|
24025
24332
|
}),
|
|
24026
|
-
sourceCoverage:
|
|
24333
|
+
sourceCoverage: z84.object({
|
|
24027
24334
|
gsc: sourceCoverageSchema.nullable(),
|
|
24028
24335
|
ga4: sourceCoverageSchema.nullable(),
|
|
24029
24336
|
server: sourceCoverageSchema.nullable(),
|
|
24030
|
-
visibility:
|
|
24337
|
+
visibility: z84.object({ completedAt: z84.string(), ageDays: z84.number().nonnegative() }).nullable()
|
|
24031
24338
|
}),
|
|
24032
|
-
gsc:
|
|
24339
|
+
gsc: z84.object({
|
|
24033
24340
|
propertyTotals: countSchema,
|
|
24034
24341
|
namedBrand: countSchema,
|
|
24035
24342
|
namedNonBrand: countSchema,
|
|
24036
24343
|
suppressedOrUnreportedResidual: countSchema,
|
|
24037
|
-
cohorts:
|
|
24344
|
+
cohorts: z84.array(searchCohortSchema)
|
|
24038
24345
|
}).nullable(),
|
|
24039
|
-
ga4:
|
|
24040
|
-
organicSessions:
|
|
24041
|
-
cohorts:
|
|
24346
|
+
ga4: z84.object({
|
|
24347
|
+
organicSessions: z84.number().int().nonnegative(),
|
|
24348
|
+
cohorts: z84.array(sessionCohortSchema)
|
|
24042
24349
|
}).nullable(),
|
|
24043
|
-
gaAiReferrals:
|
|
24044
|
-
paidSessions:
|
|
24045
|
-
organicSessions:
|
|
24350
|
+
gaAiReferrals: z84.object({
|
|
24351
|
+
paidSessions: z84.number().int().nonnegative(),
|
|
24352
|
+
organicSessions: z84.number().int().nonnegative()
|
|
24046
24353
|
}).nullable(),
|
|
24047
|
-
server:
|
|
24354
|
+
server: z84.object({
|
|
24048
24355
|
crawlerHits: crawlerCountsSchema,
|
|
24049
24356
|
userFetchHits: crawlerCountsSchema,
|
|
24050
24357
|
referralSessions: referralCountsSchema
|
|
24051
24358
|
}).nullable(),
|
|
24052
|
-
visibility:
|
|
24053
|
-
runId:
|
|
24054
|
-
completedAt:
|
|
24055
|
-
ageDays:
|
|
24056
|
-
answerPairs:
|
|
24057
|
-
mentionedPairs:
|
|
24058
|
-
citedPairs:
|
|
24359
|
+
visibility: z84.object({
|
|
24360
|
+
runId: z84.string(),
|
|
24361
|
+
completedAt: z84.string(),
|
|
24362
|
+
ageDays: z84.number().nonnegative(),
|
|
24363
|
+
answerPairs: z84.number().int().nonnegative(),
|
|
24364
|
+
mentionedPairs: z84.number().int().nonnegative(),
|
|
24365
|
+
citedPairs: z84.number().int().nonnegative()
|
|
24059
24366
|
}).nullable(),
|
|
24060
24367
|
measurement: gaMeasurementAnalysisDtoSchema,
|
|
24061
|
-
pages:
|
|
24062
|
-
path:
|
|
24368
|
+
pages: z84.array(z84.object({
|
|
24369
|
+
path: z84.string(),
|
|
24063
24370
|
gsc: countSchema,
|
|
24064
|
-
ga4OrganicSessions:
|
|
24065
|
-
server:
|
|
24371
|
+
ga4OrganicSessions: z84.number().int().nonnegative(),
|
|
24372
|
+
server: z84.object({
|
|
24066
24373
|
crawlerHits: crawlerCountsSchema,
|
|
24067
24374
|
userFetchHits: crawlerCountsSchema,
|
|
24068
24375
|
referralSessions: referralCountsSchema
|
|
24069
24376
|
})
|
|
24070
24377
|
})),
|
|
24071
|
-
findings:
|
|
24072
|
-
tone:
|
|
24073
|
-
title:
|
|
24074
|
-
detail:
|
|
24378
|
+
findings: z84.array(z84.object({
|
|
24379
|
+
tone: z84.enum(["positive", "caution", "neutral"]),
|
|
24380
|
+
title: z84.string(),
|
|
24381
|
+
detail: z84.string()
|
|
24075
24382
|
})),
|
|
24076
|
-
limitations:
|
|
24383
|
+
limitations: z84.array(z84.object({ code: z84.string(), detail: z84.string() }))
|
|
24077
24384
|
});
|
|
24078
24385
|
|
|
24079
24386
|
// ../contracts/src/traffic-path.ts
|
|
@@ -24371,9 +24678,9 @@ function serializeForInlineScript(value) {
|
|
|
24371
24678
|
}
|
|
24372
24679
|
|
|
24373
24680
|
// ../contracts/src/outcome-telemetry.ts
|
|
24374
|
-
import { z as
|
|
24681
|
+
import { z as z85 } from "zod";
|
|
24375
24682
|
var OUTCOME_SURFACES = ["cli", "mcp-stdio", "mcp-http", "aero", "api", "dashboard", "system"];
|
|
24376
|
-
var outcomeSurfaceSchema =
|
|
24683
|
+
var outcomeSurfaceSchema = z85.enum(OUTCOME_SURFACES);
|
|
24377
24684
|
var OutcomeSurfaces = outcomeSurfaceSchema.enum;
|
|
24378
24685
|
var INTEGRATION_NAMES = [
|
|
24379
24686
|
"provider",
|
|
@@ -24395,19 +24702,19 @@ var INTEGRATION_NAMES = [
|
|
|
24395
24702
|
/** The WordPress traffic-logger plugin source, apart from the WordPress publishing connection. */
|
|
24396
24703
|
"traffic_wordpress"
|
|
24397
24704
|
];
|
|
24398
|
-
var integrationNameSchema =
|
|
24705
|
+
var integrationNameSchema = z85.enum(INTEGRATION_NAMES);
|
|
24399
24706
|
var IntegrationNames = integrationNameSchema.enum;
|
|
24400
24707
|
var CONNECTION_ACTIONS = ["connect", "disconnect", "test", "reauth", "select"];
|
|
24401
|
-
var connectionActionSchema =
|
|
24708
|
+
var connectionActionSchema = z85.enum(CONNECTION_ACTIONS);
|
|
24402
24709
|
var ConnectionActions = connectionActionSchema.enum;
|
|
24403
24710
|
var CONNECTION_STATUSES = ["started", "succeeded", "failed", "cancelled"];
|
|
24404
|
-
var connectionStatusSchema =
|
|
24711
|
+
var connectionStatusSchema = z85.enum(CONNECTION_STATUSES);
|
|
24405
24712
|
var ConnectionStatuses = connectionStatusSchema.enum;
|
|
24406
24713
|
var OUTCOME_STATUSES = ["succeeded", "partial", "failed", "skipped", "cancelled"];
|
|
24407
|
-
var outcomeStatusSchema =
|
|
24714
|
+
var outcomeStatusSchema = z85.enum(OUTCOME_STATUSES);
|
|
24408
24715
|
var OutcomeStatuses = outcomeStatusSchema.enum;
|
|
24409
24716
|
var OUTCOME_TRIGGERS = ["manual", "scheduled", "agent", "startup", "retry", "push"];
|
|
24410
|
-
var outcomeTriggerSchema =
|
|
24717
|
+
var outcomeTriggerSchema = z85.enum(OUTCOME_TRIGGERS);
|
|
24411
24718
|
var OutcomeTriggers = outcomeTriggerSchema.enum;
|
|
24412
24719
|
var OUTCOME_REASON_CODES = [
|
|
24413
24720
|
"AUTH_DENIED",
|
|
@@ -24444,7 +24751,7 @@ var OUTCOME_REASON_CODES = [
|
|
|
24444
24751
|
"UNCAUGHT_EXCEPTION",
|
|
24445
24752
|
"UNHANDLED_REJECTION"
|
|
24446
24753
|
];
|
|
24447
|
-
var outcomeReasonCodeSchema =
|
|
24754
|
+
var outcomeReasonCodeSchema = z85.enum(OUTCOME_REASON_CODES);
|
|
24448
24755
|
var OutcomeReasonCodes = outcomeReasonCodeSchema.enum;
|
|
24449
24756
|
var FEATURE_OPERATIONS = {
|
|
24450
24757
|
search_console: ["sync", "inspect", "sitemap_submit"],
|
|
@@ -24474,7 +24781,7 @@ var FEATURE_OPERATIONS = {
|
|
|
24474
24781
|
server: ["start", "crash"]
|
|
24475
24782
|
};
|
|
24476
24783
|
var FEATURE_NAMES = Object.keys(FEATURE_OPERATIONS);
|
|
24477
|
-
var featureNameSchema =
|
|
24784
|
+
var featureNameSchema = z85.enum(FEATURE_NAMES);
|
|
24478
24785
|
var FeatureNames = featureNameSchema.enum;
|
|
24479
24786
|
var OUTCOME_COUNT_KEYS = [
|
|
24480
24787
|
"rows",
|
|
@@ -24512,16 +24819,16 @@ var OUTCOME_COUNT_KEYS = [
|
|
|
24512
24819
|
];
|
|
24513
24820
|
var COUNT_KEY_SET = new Set(OUTCOME_COUNT_KEYS);
|
|
24514
24821
|
var MAX_COUNT = 1e12;
|
|
24515
|
-
var countValueSchema =
|
|
24516
|
-
var countsSchema2 =
|
|
24822
|
+
var countValueSchema = z85.number().int().min(0).max(MAX_COUNT);
|
|
24823
|
+
var countsSchema2 = z85.record(z85.string(), countValueSchema).refine((obj) => Object.keys(obj).length > 0 && Object.keys(obj).length <= 12, "counts must have 1 to 12 keys").refine((obj) => Object.keys(obj).every((k) => COUNT_KEY_SET.has(k)), "unknown count key");
|
|
24517
24824
|
var WEBHOOK_TARGETS = ["first_party", "slack", "discord"];
|
|
24518
|
-
var webhookTargetSchema =
|
|
24825
|
+
var webhookTargetSchema = z85.enum(WEBHOOK_TARGETS);
|
|
24519
24826
|
var WebhookTargets = webhookTargetSchema.enum;
|
|
24520
24827
|
var STATUS_CLASSES = ["2xx", "3xx", "4xx", "5xx", "timeout", "network", "blocked"];
|
|
24521
|
-
var statusClassSchema =
|
|
24828
|
+
var statusClassSchema = z85.enum(STATUS_CLASSES);
|
|
24522
24829
|
var StatusClasses = statusClassSchema.enum;
|
|
24523
24830
|
var DURATION_BUCKETS = ["under_1s", "1s_to_10s", "10s_to_1m", "1m_to_5m", "5m_to_30m", "30m_or_more"];
|
|
24524
|
-
var durationBucketSchema =
|
|
24831
|
+
var durationBucketSchema = z85.enum(DURATION_BUCKETS);
|
|
24525
24832
|
var DurationBuckets = durationBucketSchema.enum;
|
|
24526
24833
|
function bucketDuration(durationMs) {
|
|
24527
24834
|
const duration = Number.isFinite(durationMs) ? Math.max(0, durationMs) : 0;
|
|
@@ -24532,12 +24839,12 @@ function bucketDuration(durationMs) {
|
|
|
24532
24839
|
if (duration < 18e5) return "5m_to_30m";
|
|
24533
24840
|
return "30m_or_more";
|
|
24534
24841
|
}
|
|
24535
|
-
var errorNameSchema =
|
|
24536
|
-
var agentSlugSchema =
|
|
24537
|
-
var providerNameSchema2 =
|
|
24538
|
-
var modelIdSchema2 =
|
|
24539
|
-
var slugSchema =
|
|
24540
|
-
var integrationConnectionPropertiesSchema =
|
|
24842
|
+
var errorNameSchema = z85.string().regex(/^[A-Z_$][\w$]{0,39}$/i);
|
|
24843
|
+
var agentSlugSchema = z85.string().regex(/^[a-z0-9][a-z0-9._-]{0,39}$/);
|
|
24844
|
+
var providerNameSchema2 = z85.enum(PROVIDER_NAMES);
|
|
24845
|
+
var modelIdSchema2 = z85.string().regex(/^[A-Z0-9][\w.:/@-]{0,99}$/i).refine((v) => !v.includes("://"), "a model id is never a URL");
|
|
24846
|
+
var slugSchema = z85.string().regex(/^[a-z0-9][a-z0-9._-]{0,31}$/);
|
|
24847
|
+
var integrationConnectionPropertiesSchema = z85.object({
|
|
24541
24848
|
integration: integrationNameSchema,
|
|
24542
24849
|
provider: providerNameSchema2.optional(),
|
|
24543
24850
|
action: connectionActionSchema,
|
|
@@ -24548,9 +24855,9 @@ var integrationConnectionPropertiesSchema = z84.object({
|
|
|
24548
24855
|
surface: outcomeSurfaceSchema.optional(),
|
|
24549
24856
|
agent: agentSlugSchema.optional(),
|
|
24550
24857
|
durationBucket: durationBucketSchema.optional(),
|
|
24551
|
-
attempt:
|
|
24858
|
+
attempt: z85.number().int().min(1).max(1e6).optional(),
|
|
24552
24859
|
/** The install's first success of this kind; set by the helpers, never by callers. */
|
|
24553
|
-
first:
|
|
24860
|
+
first: z85.literal(true).optional()
|
|
24554
24861
|
}).strict().refine(
|
|
24555
24862
|
(p) => p.integration === IntegrationNames.provider === (p.provider !== void 0),
|
|
24556
24863
|
"provider is required for, and only for, integration provider"
|
|
@@ -24558,9 +24865,9 @@ var integrationConnectionPropertiesSchema = z84.object({
|
|
|
24558
24865
|
(p) => p.status === ConnectionStatuses.succeeded || p.status === ConnectionStatuses.started || p.reasonCode !== void 0,
|
|
24559
24866
|
"a failed or cancelled attempt needs a reasonCode"
|
|
24560
24867
|
);
|
|
24561
|
-
var featureCompletedPropertiesSchema =
|
|
24868
|
+
var featureCompletedPropertiesSchema = z85.object({
|
|
24562
24869
|
feature: featureNameSchema,
|
|
24563
|
-
operation:
|
|
24870
|
+
operation: z85.string().regex(/^[a-z][a-z_]{0,31}$/),
|
|
24564
24871
|
status: outcomeStatusSchema,
|
|
24565
24872
|
trigger: outcomeTriggerSchema.optional(),
|
|
24566
24873
|
surface: outcomeSurfaceSchema.optional(),
|
|
@@ -24575,17 +24882,17 @@ var featureCompletedPropertiesSchema = z84.object({
|
|
|
24575
24882
|
provider: providerNameSchema2.optional(),
|
|
24576
24883
|
model: modelIdSchema2.optional(),
|
|
24577
24884
|
modelProvider: slugSchema.optional(),
|
|
24578
|
-
sampleRate:
|
|
24579
|
-
droppedBefore:
|
|
24580
|
-
domainHash:
|
|
24581
|
-
first:
|
|
24885
|
+
sampleRate: z85.number().int().min(1).max(1e6).optional(),
|
|
24886
|
+
droppedBefore: z85.number().int().min(0).max(MAX_COUNT).optional(),
|
|
24887
|
+
domainHash: z85.string().regex(/^[0-9a-f]{64}$/).optional(),
|
|
24888
|
+
first: z85.literal(true).optional()
|
|
24582
24889
|
}).strict().refine(
|
|
24583
24890
|
(p) => FEATURE_OPERATIONS[p.feature].includes(p.operation),
|
|
24584
24891
|
"operation is not one this feature reports"
|
|
24585
24892
|
).refine((p) => p.status === OutcomeStatuses.succeeded || p.reasonCode !== void 0, "a non-succeeded outcome needs a reasonCode");
|
|
24586
24893
|
var INSTALL_SOURCES = ["npm", "homebrew", "docker", "source"];
|
|
24587
|
-
var installSourceSchema =
|
|
24588
|
-
var installRefSchema =
|
|
24894
|
+
var installSourceSchema = z85.enum(INSTALL_SOURCES);
|
|
24895
|
+
var installRefSchema = z85.string().regex(/^[a-z0-9][a-z0-9-]{0,31}$/);
|
|
24589
24896
|
function normalizeInstallRef(value) {
|
|
24590
24897
|
const ref = value?.trim().toLowerCase();
|
|
24591
24898
|
return ref && installRefSchema.safeParse(ref).success ? ref : void 0;
|
|
@@ -24620,11 +24927,11 @@ var INSTALL_STATE_USAGE_KEYS = [
|
|
|
24620
24927
|
];
|
|
24621
24928
|
var fixedKeyCounts = (keys) => {
|
|
24622
24929
|
const allowed = new Set(keys);
|
|
24623
|
-
return
|
|
24930
|
+
return z85.record(z85.string(), countValueSchema).refine((obj) => Object.keys(obj).every((k) => allowed.has(k)), "unknown key");
|
|
24624
24931
|
};
|
|
24625
|
-
var installStatePropertiesSchema =
|
|
24626
|
-
providers:
|
|
24627
|
-
integrations:
|
|
24932
|
+
var installStatePropertiesSchema = z85.object({
|
|
24933
|
+
providers: z85.array(providerNameSchema2).max(PROVIDER_NAMES.length),
|
|
24934
|
+
integrations: z85.array(integrationNameSchema.exclude([IntegrationNames.provider])).max(INTEGRATION_NAMES.length),
|
|
24628
24935
|
counts: fixedKeyCounts(INSTALL_STATE_COUNT_KEYS),
|
|
24629
24936
|
usage24h: fixedKeyCounts(INSTALL_STATE_USAGE_KEYS),
|
|
24630
24937
|
providerCalls24h: fixedKeyCounts(PROVIDER_NAMES).optional(),
|
|
@@ -24705,13 +25012,14 @@ function classifyProviderOutcomeError(err) {
|
|
|
24705
25012
|
}
|
|
24706
25013
|
|
|
24707
25014
|
// ../contracts/src/ui-telemetry.ts
|
|
24708
|
-
import { z as
|
|
25015
|
+
import { z as z86 } from "zod";
|
|
24709
25016
|
var UI_PAGES = [
|
|
24710
25017
|
"/",
|
|
24711
25018
|
"/projects",
|
|
24712
25019
|
"/projects/:projectName",
|
|
24713
25020
|
"/projects/:projectName/portfolio",
|
|
24714
25021
|
"/projects/:projectName/search-console",
|
|
25022
|
+
"/projects/:projectName/seo-data",
|
|
24715
25023
|
"/projects/:projectName/conversions",
|
|
24716
25024
|
"/projects/:projectName/local",
|
|
24717
25025
|
"/projects/:projectName/discovery",
|
|
@@ -24734,11 +25042,12 @@ var UI_PAGES = [
|
|
|
24734
25042
|
"not-found",
|
|
24735
25043
|
"other"
|
|
24736
25044
|
];
|
|
24737
|
-
var uiPageSchema =
|
|
25045
|
+
var uiPageSchema = z86.enum(UI_PAGES);
|
|
24738
25046
|
var UI_PROJECT_TABS = [
|
|
24739
25047
|
"overview",
|
|
24740
25048
|
"portfolio",
|
|
24741
25049
|
"search-console",
|
|
25050
|
+
"seo-data",
|
|
24742
25051
|
"conversions",
|
|
24743
25052
|
"local",
|
|
24744
25053
|
"discovery",
|
|
@@ -24752,7 +25061,7 @@ var UI_PROJECT_TABS = [
|
|
|
24752
25061
|
"settings",
|
|
24753
25062
|
"other"
|
|
24754
25063
|
];
|
|
24755
|
-
var uiProjectTabSchema =
|
|
25064
|
+
var uiProjectTabSchema = z86.enum(UI_PROJECT_TABS);
|
|
24756
25065
|
var UI_ACTIONS = [
|
|
24757
25066
|
"sweep.launch",
|
|
24758
25067
|
"sweep.cancel",
|
|
@@ -24775,6 +25084,9 @@ var UI_ACTIONS = [
|
|
|
24775
25084
|
"integration.connect",
|
|
24776
25085
|
"integration.disconnect",
|
|
24777
25086
|
"traffic.sync",
|
|
25087
|
+
"seo.refresh",
|
|
25088
|
+
"seo.profile.save",
|
|
25089
|
+
"seo.cancel",
|
|
24778
25090
|
"notification.save",
|
|
24779
25091
|
"notification.test",
|
|
24780
25092
|
"measurement_plan.publish",
|
|
@@ -24794,7 +25106,7 @@ var UI_ACTIONS = [
|
|
|
24794
25106
|
/** A table search settled on a non-empty query (debounced or Enter; the text is never sent). */
|
|
24795
25107
|
"search.submit"
|
|
24796
25108
|
];
|
|
24797
|
-
var uiActionSchema =
|
|
25109
|
+
var uiActionSchema = z86.enum(UI_ACTIONS);
|
|
24798
25110
|
var UI_INTEGRATIONS = [
|
|
24799
25111
|
"google",
|
|
24800
25112
|
"gsc",
|
|
@@ -24810,9 +25122,9 @@ var UI_INTEGRATIONS = [
|
|
|
24810
25122
|
"traffic_cloud_run",
|
|
24811
25123
|
"traffic_wordpress"
|
|
24812
25124
|
];
|
|
24813
|
-
var uiIntegrationSchema =
|
|
24814
|
-
var UI_FILTERS = ["provider", "model", "location", "window", "query_class", "other"];
|
|
24815
|
-
var uiFilterSchema =
|
|
25125
|
+
var uiIntegrationSchema = z86.enum(UI_INTEGRATIONS);
|
|
25126
|
+
var UI_FILTERS = ["provider", "model", "location", "window", "query_class", "seoProfile", "other"];
|
|
25127
|
+
var uiFilterSchema = z86.enum(UI_FILTERS);
|
|
24816
25128
|
var UI_EXPORT_FORMATS = ["csv", "json", "html"];
|
|
24817
25129
|
var UI_ERROR_KINDS = ["render", "unhandled", "api"];
|
|
24818
25130
|
var UI_STATUS_CLASSES = ["4xx", "5xx", "network"];
|
|
@@ -24897,45 +25209,45 @@ function isUiApiRouteTemplate(route) {
|
|
|
24897
25209
|
return PARAM_SEGMENT.test(segment) || UI_ROUTE_FIXED_CHILDREN.has(`${previous}/${segment}`);
|
|
24898
25210
|
});
|
|
24899
25211
|
}
|
|
24900
|
-
var uiEventBaseSchema =
|
|
24901
|
-
eventId:
|
|
24902
|
-
uiSessionId:
|
|
25212
|
+
var uiEventBaseSchema = z86.object({
|
|
25213
|
+
eventId: z86.string().uuid(),
|
|
25214
|
+
uiSessionId: z86.string().uuid(),
|
|
24903
25215
|
page: uiPageSchema
|
|
24904
25216
|
});
|
|
24905
|
-
var uiTelemetryEventSchema =
|
|
25217
|
+
var uiTelemetryEventSchema = z86.discriminatedUnion("event", [
|
|
24906
25218
|
uiEventBaseSchema.extend({
|
|
24907
|
-
event:
|
|
25219
|
+
event: z86.literal("ui.page_viewed"),
|
|
24908
25220
|
tab: uiProjectTabSchema.optional()
|
|
24909
25221
|
}).strict(),
|
|
24910
25222
|
uiEventBaseSchema.extend({
|
|
24911
|
-
event:
|
|
25223
|
+
event: z86.literal("ui.action"),
|
|
24912
25224
|
action: uiActionSchema,
|
|
24913
25225
|
tab: uiProjectTabSchema.optional(),
|
|
24914
25226
|
integration: uiIntegrationSchema.optional(),
|
|
24915
|
-
format:
|
|
25227
|
+
format: z86.enum(UI_EXPORT_FORMATS).optional(),
|
|
24916
25228
|
filter: uiFilterSchema.optional()
|
|
24917
25229
|
}).strict(),
|
|
24918
25230
|
uiEventBaseSchema.extend({
|
|
24919
|
-
event:
|
|
24920
|
-
kind:
|
|
25231
|
+
event: z86.literal("ui.error"),
|
|
25232
|
+
kind: z86.enum(UI_ERROR_KINDS),
|
|
24921
25233
|
tab: uiProjectTabSchema.optional(),
|
|
24922
|
-
component:
|
|
24923
|
-
errorName:
|
|
24924
|
-
route:
|
|
24925
|
-
method:
|
|
24926
|
-
statusClass:
|
|
24927
|
-
status:
|
|
25234
|
+
component: z86.string().regex(UI_COMPONENT_PATTERN).optional(),
|
|
25235
|
+
errorName: z86.string().regex(UI_ERROR_NAME_PATTERN).optional(),
|
|
25236
|
+
route: z86.string().max(UI_API_ROUTE_MAX_LENGTH).refine(isUiApiRouteTemplate, "route must be a route template").optional(),
|
|
25237
|
+
method: z86.enum(["GET", "POST", "PUT", "PATCH", "DELETE"]).optional(),
|
|
25238
|
+
statusClass: z86.enum(UI_STATUS_CLASSES).optional(),
|
|
25239
|
+
status: z86.number().int().min(400).max(599).optional()
|
|
24928
25240
|
}).strict(),
|
|
24929
25241
|
uiEventBaseSchema.extend({
|
|
24930
|
-
event:
|
|
24931
|
-
metric:
|
|
24932
|
-
rating:
|
|
25242
|
+
event: z86.literal("ui.vitals"),
|
|
25243
|
+
metric: z86.enum(UI_VITAL_METRICS),
|
|
25244
|
+
rating: z86.enum(UI_VITAL_RATINGS),
|
|
24933
25245
|
tab: uiProjectTabSchema.optional()
|
|
24934
25246
|
}).strict()
|
|
24935
25247
|
]);
|
|
24936
25248
|
|
|
24937
25249
|
// ../contracts/src/feedback.ts
|
|
24938
|
-
import { z as
|
|
25250
|
+
import { z as z87 } from "zod";
|
|
24939
25251
|
|
|
24940
25252
|
// ../contracts/src/log-redaction.ts
|
|
24941
25253
|
var REDACTED = "[REDACTED]";
|
|
@@ -25087,7 +25399,7 @@ function redactEmbeddedUrls(value) {
|
|
|
25087
25399
|
|
|
25088
25400
|
// ../contracts/src/feedback.ts
|
|
25089
25401
|
var FEEDBACK_KINDS = ["struggle", "bug", "improvement", "other"];
|
|
25090
|
-
var feedbackKindSchema =
|
|
25402
|
+
var feedbackKindSchema = z87.enum(FEEDBACK_KINDS);
|
|
25091
25403
|
var FEEDBACK_LIMITS = {
|
|
25092
25404
|
summary: 500,
|
|
25093
25405
|
details: 4e3,
|
|
@@ -25095,17 +25407,17 @@ var FEEDBACK_LIMITS = {
|
|
|
25095
25407
|
command: 120,
|
|
25096
25408
|
errorCode: 40
|
|
25097
25409
|
};
|
|
25098
|
-
var feedbackSubmissionSchema =
|
|
25410
|
+
var feedbackSubmissionSchema = z87.object({
|
|
25099
25411
|
kind: feedbackKindSchema,
|
|
25100
|
-
summary:
|
|
25101
|
-
details:
|
|
25102
|
-
area:
|
|
25103
|
-
command:
|
|
25104
|
-
errorCode:
|
|
25412
|
+
summary: z87.string().trim().min(1).max(FEEDBACK_LIMITS.summary),
|
|
25413
|
+
details: z87.string().trim().min(1).max(FEEDBACK_LIMITS.details).optional(),
|
|
25414
|
+
area: z87.string().trim().min(1).max(FEEDBACK_LIMITS.area).optional(),
|
|
25415
|
+
command: z87.string().trim().min(1).max(FEEDBACK_LIMITS.command).optional(),
|
|
25416
|
+
errorCode: z87.string().trim().min(1).max(FEEDBACK_LIMITS.errorCode).optional()
|
|
25105
25417
|
}).strict();
|
|
25106
|
-
var feedbackAcceptedDtoSchema =
|
|
25107
|
-
accepted:
|
|
25108
|
-
id:
|
|
25418
|
+
var feedbackAcceptedDtoSchema = z87.object({
|
|
25419
|
+
accepted: z87.boolean(),
|
|
25420
|
+
id: z87.string()
|
|
25109
25421
|
});
|
|
25110
25422
|
function redactFeedbackText(value, limit) {
|
|
25111
25423
|
return truncateUtf16(
|
|
@@ -25184,7 +25496,7 @@ function asRecord(value) {
|
|
|
25184
25496
|
}
|
|
25185
25497
|
|
|
25186
25498
|
// ../contracts/src/tolerant-read.ts
|
|
25187
|
-
import { z as
|
|
25499
|
+
import { z as z88 } from "zod";
|
|
25188
25500
|
var WRAPPER_TYPES = /* @__PURE__ */ new Set(["optional", "nullable", "default", "prefault", "readonly", "catch", "nonoptional"]);
|
|
25189
25501
|
var DEPTH_LIMIT = 64;
|
|
25190
25502
|
function defOf(schema) {
|
|
@@ -25195,9 +25507,9 @@ function cloneWith(schema, changes) {
|
|
|
25195
25507
|
}
|
|
25196
25508
|
function openPrimitive(values) {
|
|
25197
25509
|
if (values.length === 0) return void 0;
|
|
25198
|
-
if (values.every((value) => typeof value === "string")) return
|
|
25199
|
-
if (values.every((value) => typeof value === "number")) return
|
|
25200
|
-
if (values.every((value) => typeof value === "boolean")) return
|
|
25510
|
+
if (values.every((value) => typeof value === "string")) return z88.string();
|
|
25511
|
+
if (values.every((value) => typeof value === "number")) return z88.number();
|
|
25512
|
+
if (values.every((value) => typeof value === "boolean")) return z88.boolean();
|
|
25201
25513
|
return void 0;
|
|
25202
25514
|
}
|
|
25203
25515
|
function walk2(schema, open, memo, depth) {
|
|
@@ -25211,7 +25523,7 @@ function walk2(schema, open, memo, depth) {
|
|
|
25211
25523
|
const shape = Object.fromEntries(Object.entries(schema.shape).map(([key, child]) => [key, next(child)]));
|
|
25212
25524
|
const declared = def.catchall;
|
|
25213
25525
|
const catchall = open.get(schema) ?? (declared && defOf(declared).type !== "never" ? next(declared) : void 0);
|
|
25214
|
-
result = catchall ?
|
|
25526
|
+
result = catchall ? z88.object(shape).catchall(catchall) : z88.object(shape);
|
|
25215
25527
|
} else if (WRAPPER_TYPES.has(def.type)) {
|
|
25216
25528
|
const inner = def.innerType;
|
|
25217
25529
|
const mapped = next(inner);
|
|
@@ -25228,10 +25540,10 @@ function walk2(schema, open, memo, depth) {
|
|
|
25228
25540
|
const options = def.options;
|
|
25229
25541
|
const mapped = options.map(next);
|
|
25230
25542
|
const changed = mapped.some((option, index) => option !== options[index]);
|
|
25231
|
-
result = !changed ? schema : def.discriminator ?
|
|
25543
|
+
result = !changed ? schema : def.discriminator ? z88.union(mapped) : cloneWith(schema, { options: mapped });
|
|
25232
25544
|
} else if (def.type === "record") {
|
|
25233
25545
|
const keyType = def.keyType, valueType = def.valueType;
|
|
25234
|
-
const mappedKey = defOf(keyType).type === "enum" ?
|
|
25546
|
+
const mappedKey = defOf(keyType).type === "enum" ? z88.string() : keyType;
|
|
25235
25547
|
const mappedValue = next(valueType);
|
|
25236
25548
|
result = mappedKey === keyType && mappedValue === valueType ? schema : cloneWith(schema, { keyType: mappedKey, valueType: mappedValue });
|
|
25237
25549
|
} else if (def.type === "intersection") {
|
|
@@ -25247,7 +25559,7 @@ function walk2(schema, open, memo, depth) {
|
|
|
25247
25559
|
result = changed ? cloneWith(schema, { items: mappedItems, rest: mappedRest }) : schema;
|
|
25248
25560
|
} else if (def.type === "lazy") {
|
|
25249
25561
|
const getter = def.getter;
|
|
25250
|
-
result =
|
|
25562
|
+
result = z88.lazy(() => next(getter()));
|
|
25251
25563
|
} else if (def.type === "enum") {
|
|
25252
25564
|
result = openPrimitive(Object.values(def.entries)) ?? schema;
|
|
25253
25565
|
} else if (def.type === "literal") {
|
|
@@ -25262,8 +25574,8 @@ function tolerantReadSchema(schema, options = {}) {
|
|
|
25262
25574
|
}
|
|
25263
25575
|
|
|
25264
25576
|
// ../contracts/src/sentiment-read.ts
|
|
25265
|
-
import { z as
|
|
25266
|
-
var OPEN_COUNTS = { openKeys: [[sentimentCountsSchema,
|
|
25577
|
+
import { z as z89 } from "zod";
|
|
25578
|
+
var OPEN_COUNTS = { openKeys: [[sentimentCountsSchema, z89.number().int().nonnegative()]] };
|
|
25267
25579
|
var sentimentSettingsReadSchema = tolerantReadSchema(sentimentSettingsSchema, OPEN_COUNTS);
|
|
25268
25580
|
var sentimentSummaryReadSchema = tolerantReadSchema(sentimentSummarySchema, OPEN_COUNTS);
|
|
25269
25581
|
var sentimentEvidencePageReadSchema = tolerantReadSchema(sentimentEvidencePageSchema, OPEN_COUNTS);
|
|
@@ -25293,29 +25605,29 @@ function rateOverChecked(numerator, answers, excluded, field) {
|
|
|
25293
25605
|
}
|
|
25294
25606
|
|
|
25295
25607
|
// ../contracts/src/cli-catalog.ts
|
|
25296
|
-
import { z as
|
|
25297
|
-
var cliCatalogOptionSchema =
|
|
25298
|
-
name:
|
|
25299
|
-
type:
|
|
25300
|
-
multiple:
|
|
25301
|
-
});
|
|
25302
|
-
var cliCatalogCommandSchema =
|
|
25303
|
-
id:
|
|
25304
|
-
path:
|
|
25305
|
-
usage:
|
|
25306
|
-
supportsDryRun:
|
|
25307
|
-
windows:
|
|
25308
|
-
options:
|
|
25608
|
+
import { z as z90 } from "zod";
|
|
25609
|
+
var cliCatalogOptionSchema = z90.object({
|
|
25610
|
+
name: z90.string(),
|
|
25611
|
+
type: z90.enum(["string", "boolean"]),
|
|
25612
|
+
multiple: z90.boolean()
|
|
25613
|
+
});
|
|
25614
|
+
var cliCatalogCommandSchema = z90.object({
|
|
25615
|
+
id: z90.string(),
|
|
25616
|
+
path: z90.array(z90.string()).min(1),
|
|
25617
|
+
usage: z90.string(),
|
|
25618
|
+
supportsDryRun: z90.boolean(),
|
|
25619
|
+
windows: z90.array(z90.string()).optional(),
|
|
25620
|
+
options: z90.array(cliCatalogOptionSchema),
|
|
25309
25621
|
access: operationAccessSchema
|
|
25310
25622
|
});
|
|
25311
|
-
var cliCatalogSchema =
|
|
25312
|
-
version:
|
|
25313
|
-
globalOptions:
|
|
25314
|
-
groups:
|
|
25315
|
-
root:
|
|
25316
|
-
section:
|
|
25317
|
-
summary:
|
|
25318
|
-
commands:
|
|
25623
|
+
var cliCatalogSchema = z90.object({
|
|
25624
|
+
version: z90.string(),
|
|
25625
|
+
globalOptions: z90.array(cliCatalogOptionSchema),
|
|
25626
|
+
groups: z90.array(z90.object({
|
|
25627
|
+
root: z90.string(),
|
|
25628
|
+
section: z90.string(),
|
|
25629
|
+
summary: z90.string(),
|
|
25630
|
+
commands: z90.array(cliCatalogCommandSchema)
|
|
25319
25631
|
}))
|
|
25320
25632
|
});
|
|
25321
25633
|
|
|
@@ -25413,6 +25725,7 @@ export {
|
|
|
25413
25725
|
compareText,
|
|
25414
25726
|
sortedUnique,
|
|
25415
25727
|
hostOf,
|
|
25728
|
+
normalizeHostname,
|
|
25416
25729
|
registrableDomain,
|
|
25417
25730
|
normalizeProjectDomain,
|
|
25418
25731
|
normalizeCompetitorDomain,
|
|
@@ -25550,6 +25863,7 @@ export {
|
|
|
25550
25863
|
measurementPlanCounts,
|
|
25551
25864
|
compileMeasurementPlanPreview,
|
|
25552
25865
|
canonicalMeasurementPlanJson,
|
|
25866
|
+
matchesMeasurementTargetUrl,
|
|
25553
25867
|
SourceRelationships,
|
|
25554
25868
|
CompletionStatuses,
|
|
25555
25869
|
CostBases,
|
|
@@ -25710,6 +26024,7 @@ export {
|
|
|
25710
26024
|
competitorAliasesRequestSchema,
|
|
25711
26025
|
competitorEntryParts,
|
|
25712
26026
|
formatPercent,
|
|
26027
|
+
formatNumber,
|
|
25713
26028
|
formatIsoDate,
|
|
25714
26029
|
formatIsoDateInTimeZone,
|
|
25715
26030
|
calendarDateRange,
|
|
@@ -25840,6 +26155,7 @@ export {
|
|
|
25840
26155
|
OperationAccesses,
|
|
25841
26156
|
OPERATION_ACCESS_HEADER,
|
|
25842
26157
|
STORED_ONLY_HEADER,
|
|
26158
|
+
READ_SEMANTIC_OPERATIONS,
|
|
25843
26159
|
operationAccess,
|
|
25844
26160
|
maxOperationAccess,
|
|
25845
26161
|
matchOperationTemplate,
|
|
@@ -26413,6 +26729,8 @@ export {
|
|
|
26413
26729
|
READ_ONLY_SCOPE,
|
|
26414
26730
|
WILDCARD_SCOPE,
|
|
26415
26731
|
RESEARCH_RUN_SCOPE,
|
|
26732
|
+
SEO_RUN_SCOPE,
|
|
26733
|
+
SEO_WRITE_SCOPE,
|
|
26416
26734
|
PROJECTS_WRITE_SCOPE,
|
|
26417
26735
|
ADS_WRITE_SCOPE,
|
|
26418
26736
|
ADS_APPROVE_SCOPE,
|
|
@@ -26499,5 +26817,32 @@ export {
|
|
|
26499
26817
|
UNATTRIBUTED_MENTION_REASON,
|
|
26500
26818
|
unattributedAnswersLabel,
|
|
26501
26819
|
uncheckedSourcesLabel,
|
|
26502
|
-
rateOverChecked
|
|
26820
|
+
rateOverChecked,
|
|
26821
|
+
SeoCapabilities,
|
|
26822
|
+
SeoProviders,
|
|
26823
|
+
SeoTargetKinds,
|
|
26824
|
+
SeoScopeKinds,
|
|
26825
|
+
SeoRunStatuses,
|
|
26826
|
+
SeoAvailability,
|
|
26827
|
+
seoProfileInputSchema,
|
|
26828
|
+
seoProfileSchema,
|
|
26829
|
+
seoProfileListSchema,
|
|
26830
|
+
seoContextSchema,
|
|
26831
|
+
seoStatusSchema,
|
|
26832
|
+
seoRefreshIntentInputSchema,
|
|
26833
|
+
seoQuoteSchema,
|
|
26834
|
+
seoSyncInputSchema,
|
|
26835
|
+
emptySeoResults,
|
|
26836
|
+
seoRunSchema,
|
|
26837
|
+
seoRunDetailSchema,
|
|
26838
|
+
seoRunListSchema,
|
|
26839
|
+
seoEvidenceQuerySchema,
|
|
26840
|
+
seoKeywordMetricsListSchema,
|
|
26841
|
+
seoDomainIntelligenceListSchema,
|
|
26842
|
+
seoRankedKeywordListSchema,
|
|
26843
|
+
seoOverviewSchema,
|
|
26844
|
+
seoOperatorTaskSchema,
|
|
26845
|
+
seoReconcileInputSchema,
|
|
26846
|
+
seoReconcileResultSchema,
|
|
26847
|
+
SeoAdapterOutcomes
|
|
26503
26848
|
};
|