@canonry/canonry 7.57.1 → 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-C-kQupMX.js → AgentSetupPage-DZBjF9HP.js} +3 -3
- package/assets/assets/{AuditHistoryPanel-DvZk-ikR.js → AuditHistoryPanel-DAY6GbzH.js} +1 -1
- package/assets/assets/{BacklinksPage-TLB85t4y.js → BacklinksPage-Ci9s8osY.js} +1 -1
- package/assets/assets/{HistoryPage-C4nHeKDs.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-BjLpSN4f.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-BtjRPsdl.js → TrafficPage-TceTtJmu.js} +2 -2
- package/assets/assets/{TrafficSourceDetailPage-Bw-9JMOF.js → TrafficSourceDetailPage-BVAVo-JO.js} +1 -1
- package/assets/assets/{account-context-bLel7cL8.js → account-context-ChEngAKj.js} +1 -1
- package/assets/assets/{card-DFlbarlV.js → card-qOcJFZhl.js} +1 -1
- package/assets/assets/{extract-error-message-BYvs9oIt.js → extract-error-message-bWEYiDDO.js} +1 -1
- package/assets/assets/{format-helpers-DPVlVrlp.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-BaR2koVY.js → react-sigma_core.esm.min-RpFcdsyW.js} +1 -1
- package/assets/assets/{service-DiBkOka7.js → service-DwTt-v6l.js} +1 -1
- package/assets/index.html +8 -8
- package/dist/{ads-6PCFYPZ6.js → ads-BMBXQB67.js} +3 -3
- package/dist/{agent-UA3J23KG.js → agent-S6CU36RL.js} +7 -7
- package/dist/{agent-ask-D4RWVHZX.js → agent-ask-XG7WQBX6.js} +3 -3
- package/dist/{agent-conversations-BSKUJF7H.js → agent-conversations-C4QBZAPC.js} +3 -3
- package/dist/{agent-memory-ENPPLOV7.js → agent-memory-I7UJ7MKH.js} +3 -3
- package/dist/{agent-providers-5NV7YEVG.js → agent-providers-YHRIYJDT.js} +3 -3
- package/dist/{agent-transcript-TXDTQ7Q2.js → agent-transcript-2WICUOEW.js} +3 -3
- package/dist/{analytics-6ITOJIGW.js → analytics-Y5AGSYWD.js} +3 -3
- package/dist/{apply-EPQXYQRO.js → apply-DLVLMU3O.js} +3 -3
- package/dist/{backfill-WHQ5PRQY.js → backfill-JAHDHVXJ.js} +9 -9
- package/dist/{backlinks-ECIDQQ4I.js → backlinks-TEZTPNZ5.js} +3 -3
- package/dist/{bing-LHTVVJK7.js → bing-IIA5HLND.js} +3 -3
- package/dist/{bootstrap-KHYUCFLP.js → bootstrap-AKGA3BJI.js} +10 -10
- package/dist/{cdp-YZWEKVRO.js → cdp-WWOFWFYU.js} +7 -7
- package/dist/{chunk-2R32P77U.js → chunk-27SGL3DF.js} +1 -1
- package/dist/{chunk-72GHLLA5.js → chunk-2DZYA62C.js} +18 -6
- package/dist/{chunk-S2UDQAT7.js → chunk-3U7LL3JM.js} +1 -1
- package/dist/{chunk-BURMKOEF.js → chunk-4P7NK7XM.js} +2 -2
- package/dist/{chunk-MVUYDJ7G.js → chunk-4TM4NXQR.js} +2 -2
- package/dist/{chunk-GT7HWKBO.js → chunk-4UGM5YV4.js} +3 -3
- package/dist/{chunk-ZUAXF73A.js → chunk-52NCZIAC.js} +1 -1
- package/dist/{chunk-TIYL4KVS.js → chunk-6IBLGQVZ.js} +1 -1
- package/dist/{chunk-N6P3NLEI.js → chunk-7CKJTD3Q.js} +1129 -905
- package/dist/{chunk-6MK426LA.js → chunk-BP5OKJIC.js} +2 -2
- package/dist/{chunk-SOKD3TRA.js → chunk-F6W7FCS2.js} +196 -2
- package/dist/{chunk-HPC3CBPI.js → chunk-G34BVUMF.js} +1 -1
- package/dist/{chunk-XXYBDAS2.js → chunk-IFVTHGXG.js} +2 -2
- package/dist/{chunk-LCC5ZJPV.js → chunk-JGRUCEL4.js} +2 -2
- package/dist/{chunk-OJ5IDPYY.js → chunk-KWXARGCT.js} +27 -5
- package/dist/{chunk-VF36TGF4.js → chunk-L7TKNHEX.js} +1 -1
- package/dist/{chunk-522MYBLV.js → chunk-N2HCXIQ3.js} +1 -1
- package/dist/{chunk-4MJYGB56.js → chunk-NCIPNVD6.js} +8 -0
- package/dist/{chunk-HFMRK3V3.js → chunk-NMLVLFF7.js} +5 -5
- package/dist/{chunk-AMN7DC25.js → chunk-NS7KRCND.js} +1140 -573
- package/dist/{chunk-FC2JA3FN.js → chunk-NWQQYLZV.js} +2858 -2250
- package/dist/{chunk-W7EX6AYN.js → chunk-PEZO3YEC.js} +4 -4
- package/dist/{chunk-TXBL3N46.js → chunk-Q4J3XSWE.js} +1 -1
- package/dist/{chunk-RNDQREJC.js → chunk-QFO7JHX2.js} +9 -4
- package/dist/{chunk-KRIZF753.js → chunk-QSPLYPVA.js} +1 -1
- package/dist/{chunk-SLN2KNEE.js → chunk-RXMGU7AF.js} +8 -8
- package/dist/{chunk-5AJWITKP.js → chunk-SCS7R2ND.js} +2269 -2011
- package/dist/{chunk-3HRHHFQM.js → chunk-TH3NNUJW.js} +17 -1
- package/dist/{chunk-YFUQHJRZ.js → chunk-TVANRUBO.js} +108 -83
- package/dist/{chunk-JWBFDZIP.js → chunk-U65LWABS.js} +7 -3
- package/dist/{chunk-5L2ZTXBH.js → chunk-WLIGKWVB.js} +3 -3
- package/dist/{chunk-TIKT62IV.js → chunk-Y7NX6EIK.js} +1803 -1456
- package/dist/{chunk-ULFDCKIC.js → chunk-YDSY5YJE.js} +4 -4
- package/dist/{chunk-F7WRZW3A.js → chunk-YJPQBJZO.js} +250 -3
- package/dist/{chunk-E3YBETL6.js → chunk-ZYL3LCDZ.js} +1 -1
- package/dist/{citations-HXVWVRDO.js → citations-4LVBHTDX.js} +3 -3
- package/dist/{cli-catalog-EDAH3242.js → cli-catalog-PJYR3JHX.js} +3 -3
- package/dist/{cli-commands-5O54JBVV.js → cli-commands-2HYNKJDJ.js} +7 -7
- package/dist/cli.js +13 -13
- package/dist/{competitor-XYPBUM4Q.js → competitor-T7UXAW4F.js} +3 -3
- package/dist/{content-SDTRO2XT.js → content-DFYYGGPI.js} +3 -3
- package/dist/{dashboard-TERSQLOV.js → dashboard-2P3TEH6S.js} +6 -6
- package/dist/{demo-UT5Y2RFF.js → demo-UBMNDBRF.js} +1 -1
- package/dist/{demo-server-5D6QLZOA.js → demo-server-F4M74FVL.js} +11 -11
- package/dist/{discover-I6AQJPUK.js → discover-QTC5OBQG.js} +3 -3
- package/dist/{discover-eval-GLGBZC7B.js → discover-eval-QQZGUPR6.js} +3 -3
- package/dist/{doctor-Q47J7GZI.js → doctor-VHFDL5MH.js} +3 -3
- package/dist/{evidence-AMLTPRHA.js → evidence-4PRFOC2I.js} +3 -3
- package/dist/{export-cmd-NTCX43DE.js → export-cmd-BQE7BPKZ.js} +3 -3
- package/dist/{ga-END6LQJW.js → ga-ULY5XDBK.js} +3 -3
- package/dist/{gbp-CVJXSTTB.js → gbp-4WHNZAFY.js} +3 -3
- package/dist/{google-4OCFGWGV.js → google-O4IVWLSG.js} +4 -4
- package/dist/{google-marketing-NW27PADK.js → google-marketing-DCQDTDDG.js} +1 -1
- package/dist/{health-cmd-2KMNASB3.js → health-cmd-I2JTACS7.js} +3 -3
- package/dist/{history-6LBFXVKF.js → history-LUPHO3P3.js} +3 -3
- package/dist/index.d.ts +1197 -4
- package/dist/index.js +25 -25
- package/dist/{init-ONIDATRC.js → init-YKMNKERW.js} +11 -11
- package/dist/{insights-YH7NP5LX.js → insights-GC2W45U4.js} +3 -3
- package/dist/intelligence-service-4PHEK5F4.js +15 -0
- package/dist/{keys-CJ5DTL4Y.js → keys-DXQBSOBI.js} +3 -3
- package/dist/{keyword-7FMLF3B7.js → keyword-2DCR2QCJ.js} +3 -3
- package/dist/{logs-362Y2Z55.js → logs-H45QFIEB.js} +3 -3
- package/dist/{mcp-RTJ3HZLY.js → mcp-NXXP6M3C.js} +2 -2
- package/dist/mcp.js +10 -10
- package/dist/{measurement-plan-ICT6U62D.js → measurement-plan-IG4JUKKW.js} +5 -5
- package/dist/{notify-HT7QBF3B.js → notify-BLLWXMBB.js} +3 -3
- package/dist/{organic-evidence-CAGEQ5OR.js → organic-evidence-73K7W7SB.js} +3 -3
- package/dist/{overview-Y6RVRPC7.js → overview-4TAULPUG.js} +4 -4
- package/dist/{project-7OBPDHLH.js → project-ANX4JTWS.js} +3 -3
- package/dist/{query-23GN3BC6.js → query-U3MFTLGR.js} +3 -3
- package/dist/{research-N7EVBN47.js → research-3YZ6QI67.js} +3 -3
- package/dist/{results-export-BHEYAZXQ.js → results-export-72OVLKSC.js} +3 -3
- package/dist/{run-KVPMLHGQ.js → run-SI6IL4FC.js} +4 -4
- package/dist/{schedule-EZ2TLM22.js → schedule-FYEHU2VH.js} +3 -3
- package/dist/{search-UHUPUGT3.js → search-MXDT3DQE.js} +3 -3
- package/dist/{serve-VG52MHRC.js → serve-C4FOCQEX.js} +26 -26
- package/dist/{session-IQKGJYKH.js → session-VTFLD3C5.js} +13 -13
- package/dist/{settings-QCFPNHSC.js → settings-ZGS26QOP.js} +3 -3
- package/dist/{skills-FXPAKCVV.js → skills-ZMMCKKSA.js} +2 -2
- package/dist/{snapshot-NY5PNDWR.js → snapshot-5AGGUQKE.js} +3 -3
- package/dist/{src-V6W5XBAI.js → src-AIM5FPLZ.js} +15 -2
- package/dist/{status-MYXAVPIB.js → status-HVQI4E5X.js} +4 -4
- package/dist/{technical-aeo-4C2EQ6C5.js → technical-aeo-S4OFCURE.js} +3 -3
- package/dist/{telemetry-SMY4NDD2.js → telemetry-SPSC5MUN.js} +4 -4
- package/dist/{tools-KKSEFA25.js → tools-LRHO7QOT.js} +11 -11
- package/dist/{traffic-QTHEOB5M.js → traffic-5AXVN37M.js} +5 -5
- package/dist/{users-FDZPHCWI.js → users-WFKSUCGV.js} +3 -3
- package/dist/{visibility-stats-6B3S3AIY.js → visibility-stats-5S26GC27.js} +3 -3
- package/dist/{wordpress-5IIA4H3G.js → wordpress-IUPZC7II.js} +3 -3
- package/package.json +2 -1
- package/assets/assets/MeasurementPropertyPage-8E17rN5d.js +0 -4
- package/assets/assets/ProjectPage-B4SbAE_N.js +0 -7
- package/assets/assets/RunsPage-Enho1Wqz.js +0 -1
- package/assets/assets/SiteHealthSection-BUOBO4VH.js +0 -2
- package/assets/assets/ToneBadge-BLQKJIMR.js +0 -60
- package/assets/assets/index-DWP0Oz6d.js +0 -56
- package/assets/assets/query-client-DLuEpFRm.js +0 -1
- package/assets/assets/react-query-BVY1CIRz.js +0 -1
- package/dist/intelligence-service-KRIDKJH2.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))
|
|
@@ -20151,6 +20211,8 @@ var gbpLocalPostDtoSchema = z59.object({
|
|
|
20151
20211
|
actionType: z59.string().nullable(),
|
|
20152
20212
|
articleUrl: z59.string().nullable(),
|
|
20153
20213
|
imageUrls: z59.array(z59.string()),
|
|
20214
|
+
/** Listing only: false retains the post/links but supplies no exact image proof. */
|
|
20215
|
+
mediaSourceUrlsComplete: z59.boolean().optional(),
|
|
20154
20216
|
createTime: z59.string().datetime({ offset: true }),
|
|
20155
20217
|
updateTime: z59.string().datetime({ offset: true }),
|
|
20156
20218
|
searchUrl: z59.string().nullable()
|
|
@@ -20194,6 +20256,8 @@ var gbpLiveReviewsSchema = z59.object({
|
|
|
20194
20256
|
var READ_ONLY_SCOPE = "read";
|
|
20195
20257
|
var WILDCARD_SCOPE = "*";
|
|
20196
20258
|
var RESEARCH_RUN_SCOPE = "research.run";
|
|
20259
|
+
var SEO_RUN_SCOPE = "seo.run";
|
|
20260
|
+
var SEO_WRITE_SCOPE = "seo.write";
|
|
20197
20261
|
var PROJECTS_WRITE_SCOPE = "projects.write";
|
|
20198
20262
|
var ADS_WRITE_SCOPE = "ads.write";
|
|
20199
20263
|
var ADS_APPROVE_SCOPE = "ads.approve";
|
|
@@ -20201,11 +20265,11 @@ var ADS_ACTIVATE_SCOPE = "ads.activate";
|
|
|
20201
20265
|
var GOOGLE_MARKETING_LIVE_READ_SCOPE = "google-marketing.read-live";
|
|
20202
20266
|
var GOOGLE_MARKETING_WRITE_SCOPE = "google-marketing.write";
|
|
20203
20267
|
function grantsWrite(scope) {
|
|
20204
|
-
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;
|
|
20205
20269
|
}
|
|
20206
20270
|
function restrictedWriteScopes(scopes) {
|
|
20207
20271
|
const writes = scopes.filter(grantsWrite);
|
|
20208
|
-
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]);
|
|
20209
20273
|
return writes.length > 0 && writes.every((scope) => restricted.has(scope)) ? writes : null;
|
|
20210
20274
|
}
|
|
20211
20275
|
function intersectScopes(authority, requested) {
|
|
@@ -20714,19 +20778,260 @@ function uncheckedSourcesLabel(value) {
|
|
|
20714
20778
|
return `${value.unchecked} of ${total} ${total === 1 ? "answer" : "answers"} had sources that could not be checked`;
|
|
20715
20779
|
}
|
|
20716
20780
|
|
|
20717
|
-
// ../contracts/src/
|
|
20781
|
+
// ../contracts/src/seo.ts
|
|
20718
20782
|
import { z as z64 } from "zod";
|
|
20719
|
-
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({
|
|
20720
20824
|
id: z64.string(),
|
|
20721
|
-
|
|
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(),
|
|
20722
21027
|
/** First 9 chars of the raw token (`cnry_` + 4 hex). Safe to display. */
|
|
20723
|
-
keyPrefix:
|
|
20724
|
-
scopes:
|
|
21028
|
+
keyPrefix: z65.string(),
|
|
21029
|
+
scopes: z65.array(z65.string()),
|
|
20725
21030
|
/**
|
|
20726
21031
|
* The project this key is scoped to, or `null` for a full-instance key. A
|
|
20727
21032
|
* scoped key may only read/write its own project (enforced server-side).
|
|
20728
21033
|
*/
|
|
20729
|
-
projectId:
|
|
21034
|
+
projectId: z65.string().nullable(),
|
|
20730
21035
|
/**
|
|
20731
21036
|
* The scoped project's name, or `null` for a full-instance key. Resolved
|
|
20732
21037
|
* server-side so a surface listing keys does not have to fetch every project
|
|
@@ -20734,89 +21039,89 @@ var apiKeyDtoSchema = z64.object({
|
|
|
20734
21039
|
* "is this key safe to hand to someone", which is the question the list is
|
|
20735
21040
|
* usually open to answer. Additive field.
|
|
20736
21041
|
*/
|
|
20737
|
-
projectName:
|
|
21042
|
+
projectName: z65.string().nullable(),
|
|
20738
21043
|
/**
|
|
20739
21044
|
* Server-derived convenience flag: `true` when this key is read-only (carries
|
|
20740
21045
|
* the `read` scope and no write-granting scope), in which case the API rejects
|
|
20741
21046
|
* every write HTTP method for it. Derived from `scopes` via `isReadOnlyKey`
|
|
20742
21047
|
* — surfaces don't recompute it (see the UI/CLI parity rule). Additive field.
|
|
20743
21048
|
*/
|
|
20744
|
-
readOnly:
|
|
21049
|
+
readOnly: z65.boolean(),
|
|
20745
21050
|
/** Present on /keys/self: host-derived direct-bearer authority, never a mintable scope. */
|
|
20746
|
-
operator:
|
|
20747
|
-
createdAt:
|
|
20748
|
-
lastUsedAt:
|
|
20749
|
-
revokedAt:
|
|
21051
|
+
operator: z65.boolean().optional(),
|
|
21052
|
+
createdAt: z65.string(),
|
|
21053
|
+
lastUsedAt: z65.string().nullable(),
|
|
21054
|
+
revokedAt: z65.string().nullable()
|
|
20750
21055
|
});
|
|
20751
|
-
var apiKeyListDtoSchema =
|
|
20752
|
-
keys:
|
|
21056
|
+
var apiKeyListDtoSchema = z65.object({
|
|
21057
|
+
keys: z65.array(apiKeyDtoSchema)
|
|
20753
21058
|
});
|
|
20754
|
-
var createApiKeyRequestSchema =
|
|
20755
|
-
name:
|
|
21059
|
+
var createApiKeyRequestSchema = z65.object({
|
|
21060
|
+
name: z65.string().min(1).max(100),
|
|
20756
21061
|
/**
|
|
20757
21062
|
* Scopes granted to the new key. Omit to default to `['*']` (full access,
|
|
20758
21063
|
* what `canonry init` writes for the root key). When provided it must be a
|
|
20759
21064
|
* non-empty list — an empty array would mint a key that can do nothing.
|
|
20760
21065
|
*/
|
|
20761
|
-
scopes:
|
|
21066
|
+
scopes: z65.array(z65.string()).min(1).optional(),
|
|
20762
21067
|
/**
|
|
20763
21068
|
* Bind the new key to a SINGLE project (by project id). Omit for a
|
|
20764
21069
|
* full-instance key (the default). A scoped key may only read/write that
|
|
20765
21070
|
* project; the server validates the id exists at creation time.
|
|
20766
21071
|
*/
|
|
20767
|
-
projectId:
|
|
21072
|
+
projectId: z65.string().optional()
|
|
20768
21073
|
});
|
|
20769
21074
|
var createdApiKeyDtoSchema = apiKeyDtoSchema.extend({
|
|
20770
|
-
key:
|
|
21075
|
+
key: z65.string()
|
|
20771
21076
|
});
|
|
20772
21077
|
|
|
20773
21078
|
// ../contracts/src/config-schema.ts
|
|
20774
|
-
import { z as
|
|
21079
|
+
import { z as z67 } from "zod";
|
|
20775
21080
|
|
|
20776
21081
|
// ../contracts/src/schedule.ts
|
|
20777
|
-
import { z as
|
|
20778
|
-
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"]);
|
|
20779
21084
|
var SchedulableRunKinds = schedulableRunKindSchema.enum;
|
|
20780
|
-
var calendarRecurrenceSchema =
|
|
20781
|
-
everyDays:
|
|
20782
|
-
startDate:
|
|
20783
|
-
time:
|
|
20784
|
-
}).strict();
|
|
20785
|
-
var scheduleDtoSchema =
|
|
20786
|
-
id:
|
|
20787
|
-
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(),
|
|
20788
21093
|
/** Run kind dispatched when this schedule fires. Defaults to 'answer-visibility' for legacy rows. */
|
|
20789
21094
|
kind: schedulableRunKindSchema,
|
|
20790
21095
|
/** Empty for calendar recurrence schedules. */
|
|
20791
|
-
cronExpr:
|
|
21096
|
+
cronExpr: z66.string(),
|
|
20792
21097
|
recurrence: calendarRecurrenceSchema.nullable().optional(),
|
|
20793
|
-
preset:
|
|
20794
|
-
timezone:
|
|
20795
|
-
enabled:
|
|
20796
|
-
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([]),
|
|
20797
21102
|
/** Traffic-source UUID for `kind === 'traffic-sync'` schedules. Null otherwise. */
|
|
20798
|
-
sourceId:
|
|
20799
|
-
lastRunAt:
|
|
20800
|
-
nextRunAt:
|
|
20801
|
-
createdAt:
|
|
20802
|
-
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()
|
|
20803
21108
|
});
|
|
20804
|
-
var scheduleExpectedUpdatedAtSchema =
|
|
21109
|
+
var scheduleExpectedUpdatedAtSchema = z66.string().datetime();
|
|
20805
21110
|
function nextScheduleUpdatedAt(previous, nowMs = Date.now()) {
|
|
20806
21111
|
const previousMs = previous === void 0 ? Number.NaN : Date.parse(previous);
|
|
20807
21112
|
return new Date(Number.isFinite(previousMs) ? Math.max(nowMs, previousMs + 1) : nowMs).toISOString();
|
|
20808
21113
|
}
|
|
20809
|
-
var scheduleUpsertRequestSchema =
|
|
21114
|
+
var scheduleUpsertRequestSchema = z66.object({
|
|
20810
21115
|
/** Run kind. Defaults to 'answer-visibility' so existing callers don't have to change. */
|
|
20811
21116
|
kind: schedulableRunKindSchema.optional(),
|
|
20812
|
-
preset:
|
|
20813
|
-
cron:
|
|
21117
|
+
preset: z66.string().min(1).optional(),
|
|
21118
|
+
cron: z66.string().min(1).optional(),
|
|
20814
21119
|
recurrence: calendarRecurrenceSchema.optional(),
|
|
20815
|
-
timezone:
|
|
20816
|
-
enabled:
|
|
20817
|
-
providers:
|
|
21120
|
+
timezone: z66.string().optional().default("UTC"),
|
|
21121
|
+
enabled: z66.boolean().optional().default(true),
|
|
21122
|
+
providers: z66.array(providerNameSchema).optional().default([]),
|
|
20818
21123
|
/** Required when kind === 'traffic-sync'. Forbidden for other kinds. Validated server-side. */
|
|
20819
|
-
sourceId:
|
|
21124
|
+
sourceId: z66.string().optional(),
|
|
20820
21125
|
/**
|
|
20821
21126
|
* Optimistic concurrency guard. A timestamp updates only that exact version;
|
|
20822
21127
|
* null creates only while the schedule is absent. Omit for legacy behavior.
|
|
@@ -20828,18 +21133,18 @@ var scheduleUpsertRequestSchema = z65.object({
|
|
|
20828
21133
|
);
|
|
20829
21134
|
|
|
20830
21135
|
// ../contracts/src/config-schema.ts
|
|
20831
|
-
var configMetadataSchema =
|
|
20832
|
-
name:
|
|
21136
|
+
var configMetadataSchema = z67.object({
|
|
21137
|
+
name: z67.string().min(1).max(63).regex(/^[a-z0-9]([a-z0-9-]*[a-z0-9])?$/, {
|
|
20833
21138
|
message: "Name must be a lowercase slug (letters, numbers, hyphens)"
|
|
20834
21139
|
}),
|
|
20835
|
-
labels:
|
|
21140
|
+
labels: z67.record(z67.string(), z67.string()).optional().default({})
|
|
20836
21141
|
});
|
|
20837
|
-
var configScheduleObjectSchema =
|
|
20838
|
-
preset:
|
|
20839
|
-
cron:
|
|
21142
|
+
var configScheduleObjectSchema = z67.object({
|
|
21143
|
+
preset: z67.string().min(1).optional(),
|
|
21144
|
+
cron: z67.string().min(1).optional(),
|
|
20840
21145
|
recurrence: calendarRecurrenceSchema.optional(),
|
|
20841
|
-
timezone:
|
|
20842
|
-
providers:
|
|
21146
|
+
timezone: z67.string().optional().default("UTC"),
|
|
21147
|
+
providers: z67.array(providerNameSchema).optional().default([]),
|
|
20843
21148
|
/**
|
|
20844
21149
|
* Whether the schedule fires. Omit to leave an existing schedule's state
|
|
20845
21150
|
* alone — a schedule paused from the dashboard or the API stays paused
|
|
@@ -20847,59 +21152,59 @@ var configScheduleObjectSchema = z66.object({
|
|
|
20847
21152
|
* someone deliberately stopped. A schedule created by this apply defaults
|
|
20848
21153
|
* to enabled.
|
|
20849
21154
|
*/
|
|
20850
|
-
enabled:
|
|
21155
|
+
enabled: z67.boolean().optional()
|
|
20851
21156
|
});
|
|
20852
21157
|
function hasOneScheduleTiming(schedule) {
|
|
20853
21158
|
return [schedule.preset, schedule.cron, schedule.recurrence].filter((value) => value !== void 0).length === 1;
|
|
20854
21159
|
}
|
|
20855
21160
|
var oneScheduleTimingMessage = { message: 'Exactly one of "preset", "cron", or "recurrence" must be provided' };
|
|
20856
21161
|
var configScheduleSchema = configScheduleObjectSchema.refine(hasOneScheduleTiming, oneScheduleTimingMessage).optional();
|
|
20857
|
-
var configNotificationSchema =
|
|
20858
|
-
id:
|
|
20859
|
-
channel:
|
|
20860
|
-
url:
|
|
20861
|
-
events:
|
|
20862
|
-
});
|
|
20863
|
-
var configGoogleSchema =
|
|
20864
|
-
gsc:
|
|
20865
|
-
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()
|
|
20866
21171
|
}).optional(),
|
|
20867
|
-
syncSchedule:
|
|
20868
|
-
preset:
|
|
20869
|
-
cron:
|
|
21172
|
+
syncSchedule: z67.object({
|
|
21173
|
+
preset: z67.string().optional(),
|
|
21174
|
+
cron: z67.string().optional()
|
|
20870
21175
|
}).optional()
|
|
20871
21176
|
}).optional();
|
|
20872
|
-
var configQueryListSchema =
|
|
21177
|
+
var configQueryListSchema = z67.array(z67.string().min(1));
|
|
20873
21178
|
var configSpecShape = {
|
|
20874
|
-
displayName:
|
|
20875
|
-
canonicalDomain:
|
|
20876
|
-
ownedDomains:
|
|
20877
|
-
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([]),
|
|
20878
21183
|
// No default on purpose: an apply that omits it keeps the project's stored
|
|
20879
21184
|
// list, minus names that no longer qualify against this spec's `aliases`,
|
|
20880
21185
|
// display name and competitors. Each entry must be an alias.
|
|
20881
|
-
qualifiedAliases:
|
|
20882
|
-
country:
|
|
20883
|
-
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),
|
|
20884
21189
|
queries: configQueryListSchema.optional(),
|
|
20885
21190
|
keywords: configQueryListSchema.optional(),
|
|
20886
21191
|
// Each entry is a bare domain or `{ domain, aliases }`. A bare domain (or an
|
|
20887
21192
|
// object without `aliases`) keeps that competitor's stored aliases on apply;
|
|
20888
21193
|
// `aliases` sets them exactly (`[]` clears). The domain set itself is still
|
|
20889
21194
|
// replaced by this list.
|
|
20890
|
-
competitors:
|
|
20891
|
-
providers:
|
|
21195
|
+
competitors: z67.array(competitorEntrySchema).optional().default([]),
|
|
21196
|
+
providers: z67.array(providerNameSchema).optional().default([]),
|
|
20892
21197
|
providerModels: providerModelsSchema.optional().default({}),
|
|
20893
21198
|
// No default on purpose: an apply that omits it leaves the project's stored
|
|
20894
21199
|
// preference alone, the same rule as `queries`.
|
|
20895
21200
|
providerDispatchModes: providerDispatchModesSchema.optional(),
|
|
20896
|
-
locations:
|
|
20897
|
-
defaultLocation:
|
|
21201
|
+
locations: z67.array(locationContextSchema).optional().default([]),
|
|
21202
|
+
defaultLocation: z67.string().optional(),
|
|
20898
21203
|
measurement: measurementConfigSchema.optional().default(defaultMeasurementConfig),
|
|
20899
21204
|
schedule: configScheduleSchema,
|
|
20900
|
-
notifications:
|
|
21205
|
+
notifications: z67.array(configNotificationSchema).optional().default([]),
|
|
20901
21206
|
google: configGoogleSchema,
|
|
20902
|
-
autoExtractBacklinks:
|
|
21207
|
+
autoExtractBacklinks: z67.boolean().optional().default(false),
|
|
20903
21208
|
/** Highest star rating that counts as a negative Google review (1-4). Omitted means the default of 3. */
|
|
20904
21209
|
negativeReviewMaxStars: gbpNegativeReviewMaxStarsSchema.optional(),
|
|
20905
21210
|
/**
|
|
@@ -20939,20 +21244,20 @@ function checkConfigSpec(spec, ctx) {
|
|
|
20939
21244
|
});
|
|
20940
21245
|
}
|
|
20941
21246
|
}
|
|
20942
|
-
var configSpecSchema =
|
|
20943
|
-
var projectConfigSchema =
|
|
20944
|
-
apiVersion:
|
|
20945
|
-
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"),
|
|
20946
21251
|
metadata: configMetadataSchema,
|
|
20947
21252
|
spec: configSpecSchema
|
|
20948
21253
|
});
|
|
20949
21254
|
var projectConfigExportSchema = projectConfigSchema.extend({
|
|
20950
|
-
spec:
|
|
21255
|
+
spec: z67.object({
|
|
20951
21256
|
...configSpecShape,
|
|
20952
21257
|
queries: configQueryListSchema,
|
|
20953
21258
|
providerModels: providerModelsSchema.optional(),
|
|
20954
|
-
schedule: configScheduleObjectSchema.extend({ enabled:
|
|
20955
|
-
autoExtractBacklinks:
|
|
21259
|
+
schedule: configScheduleObjectSchema.extend({ enabled: z67.boolean() }).refine(hasOneScheduleTiming, oneScheduleTimingMessage).optional(),
|
|
21260
|
+
autoExtractBacklinks: z67.boolean().optional()
|
|
20956
21261
|
}).superRefine(checkConfigSpec)
|
|
20957
21262
|
});
|
|
20958
21263
|
function resolveConfigSpecQueries(spec) {
|
|
@@ -20960,134 +21265,134 @@ function resolveConfigSpecQueries(spec) {
|
|
|
20960
21265
|
}
|
|
20961
21266
|
|
|
20962
21267
|
// ../contracts/src/config-diff.ts
|
|
20963
|
-
import { z as
|
|
21268
|
+
import { z as z68 } from "zod";
|
|
20964
21269
|
function fieldChangeSchema(schema) {
|
|
20965
|
-
return
|
|
20966
|
-
}
|
|
20967
|
-
var projectFieldsStateSchema =
|
|
20968
|
-
displayName:
|
|
20969
|
-
canonicalDomain:
|
|
20970
|
-
ownedDomains:
|
|
20971
|
-
aliases:
|
|
20972
|
-
qualifiedAliases:
|
|
20973
|
-
country:
|
|
20974
|
-
language:
|
|
20975
|
-
labels:
|
|
20976
|
-
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(),
|
|
20977
21282
|
providerModels: providerModelsSchema.optional(),
|
|
20978
21283
|
providerDispatchModes: providerDispatchModesSchema.optional(),
|
|
20979
21284
|
"measurement.marketingHosts": measurementConfigSchema.shape.marketingHosts.optional(),
|
|
20980
21285
|
"measurement.brandTerms": measurementConfigSchema.shape.brandTerms.optional(),
|
|
20981
21286
|
"measurement.leadEventNames": measurementConfigSchema.shape.leadEventNames.optional(),
|
|
20982
|
-
locations:
|
|
20983
|
-
defaultLocation:
|
|
20984
|
-
autoExtractBacklinks:
|
|
20985
|
-
negativeReviewMaxStars:
|
|
20986
|
-
siteAuditMaxPages:
|
|
20987
|
-
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(),
|
|
20988
21293
|
configSource: configSourceSchema.optional()
|
|
20989
21294
|
}).strict();
|
|
20990
|
-
var projectFieldsChangeSchema =
|
|
20991
|
-
displayName: fieldChangeSchema(
|
|
20992
|
-
canonicalDomain: fieldChangeSchema(
|
|
20993
|
-
ownedDomains: fieldChangeSchema(
|
|
20994
|
-
aliases: fieldChangeSchema(
|
|
20995
|
-
qualifiedAliases: fieldChangeSchema(
|
|
20996
|
-
country: fieldChangeSchema(
|
|
20997
|
-
language: fieldChangeSchema(
|
|
20998
|
-
labels: fieldChangeSchema(
|
|
20999
|
-
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(),
|
|
21000
21305
|
providerModels: fieldChangeSchema(providerModelsSchema).optional(),
|
|
21001
21306
|
providerDispatchModes: fieldChangeSchema(providerDispatchModesSchema).optional(),
|
|
21002
21307
|
"measurement.marketingHosts": fieldChangeSchema(measurementConfigSchema.shape.marketingHosts).optional(),
|
|
21003
21308
|
"measurement.brandTerms": fieldChangeSchema(measurementConfigSchema.shape.brandTerms).optional(),
|
|
21004
21309
|
"measurement.leadEventNames": fieldChangeSchema(measurementConfigSchema.shape.leadEventNames).optional(),
|
|
21005
|
-
locations: fieldChangeSchema(
|
|
21006
|
-
defaultLocation: fieldChangeSchema(
|
|
21007
|
-
autoExtractBacklinks: fieldChangeSchema(
|
|
21008
|
-
negativeReviewMaxStars: fieldChangeSchema(
|
|
21009
|
-
siteAuditMaxPages: fieldChangeSchema(
|
|
21010
|
-
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(),
|
|
21011
21316
|
configSource: fieldChangeSchema(configSourceSchema).optional()
|
|
21012
21317
|
}).strict();
|
|
21013
|
-
var scheduleStateSchema =
|
|
21014
|
-
cron:
|
|
21015
|
-
preset:
|
|
21318
|
+
var scheduleStateSchema = z68.object({
|
|
21319
|
+
cron: z68.string().optional(),
|
|
21320
|
+
preset: z68.string().optional(),
|
|
21016
21321
|
recurrence: calendarRecurrenceSchema.optional(),
|
|
21017
|
-
timezone:
|
|
21018
|
-
providers:
|
|
21019
|
-
enabled:
|
|
21020
|
-
}).strict();
|
|
21021
|
-
var droppedAliasSchema =
|
|
21022
|
-
domain:
|
|
21023
|
-
alias:
|
|
21024
|
-
reason:
|
|
21025
|
-
conflictsWith:
|
|
21026
|
-
conflictingName:
|
|
21027
|
-
markets:
|
|
21028
|
-
}).strict();
|
|
21029
|
-
var configStateNotificationSchema =
|
|
21030
|
-
id:
|
|
21031
|
-
url:
|
|
21032
|
-
urlHost:
|
|
21033
|
-
events:
|
|
21034
|
-
enabled:
|
|
21035
|
-
source:
|
|
21036
|
-
});
|
|
21037
|
-
var projectConfigStateSchema =
|
|
21038
|
-
project:
|
|
21039
|
-
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(),
|
|
21040
21345
|
fields: projectFieldsStateSchema,
|
|
21041
|
-
queries:
|
|
21042
|
-
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()) })),
|
|
21043
21348
|
schedule: scheduleStateSchema.nullable(),
|
|
21044
|
-
notifications:
|
|
21045
|
-
managed:
|
|
21046
|
-
detachedSnapshotCount:
|
|
21047
|
-
});
|
|
21048
|
-
var notificationAddedSchema =
|
|
21049
|
-
var notificationRemovedSchema = notificationAddedSchema.extend({ id:
|
|
21050
|
-
var notificationKeptSchema =
|
|
21051
|
-
id:
|
|
21052
|
-
urlHost:
|
|
21053
|
-
urlChanged:
|
|
21054
|
-
eventsBefore:
|
|
21055
|
-
eventsAfter:
|
|
21056
|
-
});
|
|
21057
|
-
var applyPreviewDtoSchema =
|
|
21058
|
-
project:
|
|
21059
|
-
action:
|
|
21060
|
-
changed:
|
|
21061
|
-
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() }),
|
|
21062
21367
|
fields: projectFieldsChangeSchema,
|
|
21063
|
-
queries:
|
|
21064
|
-
managed:
|
|
21065
|
-
added:
|
|
21066
|
-
removed:
|
|
21067
|
-
unchangedCount:
|
|
21068
|
-
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()
|
|
21069
21374
|
}),
|
|
21070
|
-
competitors:
|
|
21071
|
-
managed:
|
|
21072
|
-
added:
|
|
21073
|
-
removed:
|
|
21074
|
-
aliasChanges:
|
|
21075
|
-
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)
|
|
21076
21381
|
}),
|
|
21077
|
-
schedule:
|
|
21078
|
-
managed:
|
|
21079
|
-
action:
|
|
21382
|
+
schedule: z68.object({
|
|
21383
|
+
managed: z68.boolean(),
|
|
21384
|
+
action: z68.enum(["create", "update", "delete", "none"]),
|
|
21080
21385
|
before: scheduleStateSchema.nullable(),
|
|
21081
21386
|
after: scheduleStateSchema.nullable()
|
|
21082
21387
|
}),
|
|
21083
|
-
notifications:
|
|
21084
|
-
managed:
|
|
21085
|
-
added:
|
|
21086
|
-
removed:
|
|
21087
|
-
kept:
|
|
21088
|
-
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()
|
|
21089
21394
|
}),
|
|
21090
|
-
effects:
|
|
21395
|
+
effects: z68.array(z68.enum([
|
|
21091
21396
|
"mention-backfill",
|
|
21092
21397
|
"competitor-rescore",
|
|
21093
21398
|
"competitor-auto-alias-rescan",
|
|
@@ -21199,46 +21504,46 @@ function diffProjectConfigState(before, after, options = {}) {
|
|
|
21199
21504
|
}
|
|
21200
21505
|
|
|
21201
21506
|
// ../contracts/src/simple-measurement-definition.ts
|
|
21202
|
-
import { z as
|
|
21507
|
+
import { z as z69 } from "zod";
|
|
21203
21508
|
var SIMPLE_MEASUREMENT_DEFINITION_SCHEMA_VERSION = 1;
|
|
21204
|
-
var nonBlankStringSchema =
|
|
21509
|
+
var nonBlankStringSchema = z69.string().refine((value) => value.trim().length > 0, {
|
|
21205
21510
|
message: "Must not be blank"
|
|
21206
21511
|
});
|
|
21207
|
-
var simpleMeasurementIdentitySchema =
|
|
21512
|
+
var simpleMeasurementIdentitySchema = z69.object({
|
|
21208
21513
|
// These fields intentionally preserve their stored presentation. The shared
|
|
21209
21514
|
// matcher derives its normalized form separately when classifying queries.
|
|
21210
|
-
displayName:
|
|
21211
|
-
aliases:
|
|
21212
|
-
canonicalDomain:
|
|
21213
|
-
ownedDomains:
|
|
21515
|
+
displayName: z69.string(),
|
|
21516
|
+
aliases: z69.array(z69.string()),
|
|
21517
|
+
canonicalDomain: z69.string(),
|
|
21518
|
+
ownedDomains: z69.array(z69.string()),
|
|
21214
21519
|
// Sentiment-only: the aliases the evaluator is told are this brand's own
|
|
21215
21520
|
// names. Omitted when empty, so a sidecar that never opted in keeps its
|
|
21216
21521
|
// checksum. No bounds or matcher rules here: a later change to the write
|
|
21217
21522
|
// rules must never make a stored sidecar unreadable.
|
|
21218
|
-
qualifiedAliases:
|
|
21523
|
+
qualifiedAliases: z69.array(z69.string()).optional()
|
|
21219
21524
|
}).strict();
|
|
21220
|
-
var simpleMeasurementEngineSchema =
|
|
21525
|
+
var simpleMeasurementEngineSchema = z69.object({
|
|
21221
21526
|
provider: providerNameSchema.refine((value) => value.trim().length > 0, {
|
|
21222
21527
|
message: "Provider must not be blank"
|
|
21223
21528
|
}),
|
|
21224
21529
|
// Preserve the requested model exactly; null does not claim a served model.
|
|
21225
21530
|
// A legacy empty value can resolve to an adapter default.
|
|
21226
|
-
requestedModel:
|
|
21531
|
+
requestedModel: z69.string().nullable()
|
|
21227
21532
|
}).strict();
|
|
21228
|
-
var simpleMeasurementCompetitorSchema =
|
|
21533
|
+
var simpleMeasurementCompetitorSchema = z69.object({
|
|
21229
21534
|
// This is a snapshot of legacy dispatch inputs, not a competitor write API.
|
|
21230
21535
|
// Stored identifiers may be labels, URLs, or blank. Preserve them exactly;
|
|
21231
21536
|
// readers derive hostname attribution separately when the value supports it.
|
|
21232
|
-
domain:
|
|
21233
|
-
label:
|
|
21234
|
-
aliases:
|
|
21537
|
+
domain: z69.string(),
|
|
21538
|
+
label: z69.string(),
|
|
21539
|
+
aliases: z69.array(z69.string())
|
|
21235
21540
|
}).strict();
|
|
21236
|
-
var simpleMeasurementQueryInputSchema =
|
|
21541
|
+
var simpleMeasurementQueryInputSchema = z69.object({
|
|
21237
21542
|
queryId: nonBlankStringSchema,
|
|
21238
21543
|
// The legacy runner can dispatch a stored empty query. Preserve that exact
|
|
21239
21544
|
// selected input rather than making first capture change its behavior.
|
|
21240
|
-
queryText:
|
|
21241
|
-
provenance:
|
|
21545
|
+
queryText: z69.string(),
|
|
21546
|
+
provenance: z69.string().nullable()
|
|
21242
21547
|
}).strict();
|
|
21243
21548
|
var simpleMeasurementQuerySchema = simpleMeasurementQueryInputSchema.extend({
|
|
21244
21549
|
queryClass: queryClassSchema.nullable()
|
|
@@ -21249,7 +21554,7 @@ function addCollectionIssues(value, ctx) {
|
|
|
21249
21554
|
const key = engine.provider.trim().toLocaleLowerCase("en");
|
|
21250
21555
|
if (engineProviders.has(key)) {
|
|
21251
21556
|
ctx.addIssue({
|
|
21252
|
-
code:
|
|
21557
|
+
code: z69.ZodIssueCode.custom,
|
|
21253
21558
|
path: ["engines", index, "provider"],
|
|
21254
21559
|
message: `Duplicate engine provider "${engine.provider}"`
|
|
21255
21560
|
});
|
|
@@ -21260,7 +21565,7 @@ function addCollectionIssues(value, ctx) {
|
|
|
21260
21565
|
value.queries.forEach((query, index) => {
|
|
21261
21566
|
if (queryIds.has(query.queryId)) {
|
|
21262
21567
|
ctx.addIssue({
|
|
21263
|
-
code:
|
|
21568
|
+
code: z69.ZodIssueCode.custom,
|
|
21264
21569
|
path: ["queries", index, "queryId"],
|
|
21265
21570
|
message: `Duplicate query id "${query.queryId}"`
|
|
21266
21571
|
});
|
|
@@ -21272,7 +21577,7 @@ function addCollectionIssues(value, ctx) {
|
|
|
21272
21577
|
const key = competitor.domain;
|
|
21273
21578
|
if (competitorDomains.has(key)) {
|
|
21274
21579
|
ctx.addIssue({
|
|
21275
|
-
code:
|
|
21580
|
+
code: z69.ZodIssueCode.custom,
|
|
21276
21581
|
path: ["competitors", index, "domain"],
|
|
21277
21582
|
message: `Duplicate competitor domain "${competitor.domain}"`
|
|
21278
21583
|
});
|
|
@@ -21280,28 +21585,28 @@ function addCollectionIssues(value, ctx) {
|
|
|
21280
21585
|
competitorDomains.add(key);
|
|
21281
21586
|
});
|
|
21282
21587
|
}
|
|
21283
|
-
var simpleMeasurementDefinitionInputSchema =
|
|
21284
|
-
capturedAt:
|
|
21588
|
+
var simpleMeasurementDefinitionInputSchema = z69.object({
|
|
21589
|
+
capturedAt: z69.string().datetime(),
|
|
21285
21590
|
identity: simpleMeasurementIdentitySchema,
|
|
21286
|
-
country:
|
|
21287
|
-
language:
|
|
21591
|
+
country: z69.string(),
|
|
21592
|
+
language: z69.string(),
|
|
21288
21593
|
location: locationContextSchema.nullable(),
|
|
21289
|
-
engines:
|
|
21594
|
+
engines: z69.array(simpleMeasurementEngineSchema).min(1),
|
|
21290
21595
|
/** Missing on historical sidecars; an empty array means the captured set was intentionally empty. */
|
|
21291
|
-
competitors:
|
|
21292
|
-
queries:
|
|
21596
|
+
competitors: z69.array(simpleMeasurementCompetitorSchema).optional(),
|
|
21597
|
+
queries: z69.array(simpleMeasurementQueryInputSchema)
|
|
21293
21598
|
}).strict().superRefine(addCollectionIssues);
|
|
21294
|
-
var simpleMeasurementDefinitionSchema =
|
|
21295
|
-
schemaVersion:
|
|
21296
|
-
capturedAt:
|
|
21599
|
+
var simpleMeasurementDefinitionSchema = z69.object({
|
|
21600
|
+
schemaVersion: z69.literal(SIMPLE_MEASUREMENT_DEFINITION_SCHEMA_VERSION),
|
|
21601
|
+
capturedAt: z69.string().datetime(),
|
|
21297
21602
|
identity: simpleMeasurementIdentitySchema,
|
|
21298
|
-
country:
|
|
21299
|
-
language:
|
|
21603
|
+
country: z69.string(),
|
|
21604
|
+
language: z69.string(),
|
|
21300
21605
|
// Requested adapter input, not proof that the provider applied this context.
|
|
21301
21606
|
location: locationContextSchema.nullable(),
|
|
21302
|
-
engines:
|
|
21303
|
-
competitors:
|
|
21304
|
-
queries:
|
|
21607
|
+
engines: z69.array(simpleMeasurementEngineSchema).min(1),
|
|
21608
|
+
competitors: z69.array(simpleMeasurementCompetitorSchema).optional(),
|
|
21609
|
+
queries: z69.array(simpleMeasurementQuerySchema)
|
|
21305
21610
|
}).strict().superRefine(addCollectionIssues);
|
|
21306
21611
|
function simpleMeasurementCompetitorNames(competitors) {
|
|
21307
21612
|
return competitors?.flatMap((competitor) => [competitor.label, ...competitor.aliases]) ?? [];
|
|
@@ -21394,21 +21699,21 @@ function canonicalSimpleMeasurementDefinitionJson(definition) {
|
|
|
21394
21699
|
}
|
|
21395
21700
|
|
|
21396
21701
|
// ../contracts/src/measurement-group-import.ts
|
|
21397
|
-
import { z as
|
|
21702
|
+
import { z as z70 } from "zod";
|
|
21398
21703
|
var MEASUREMENT_GROUP_MEMBERSHIP_CSV_PARSER_VERSION = "canonry.measurement-group-membership-csv/v1";
|
|
21399
21704
|
var MEASUREMENT_GROUP_MEMBERSHIP_CSV_MAX_BYTES = 1048576;
|
|
21400
21705
|
var MEASUREMENT_GROUP_MEMBERSHIP_CSV_MAX_DATA_ROWS = 5e3;
|
|
21401
|
-
var sha256HexSchema4 =
|
|
21402
|
-
var dataRowNumberSchema =
|
|
21403
|
-
var measurementDraftSegmentDescriptorSchema =
|
|
21706
|
+
var sha256HexSchema4 = z70.string().regex(/^[a-f0-9]{64}$/);
|
|
21707
|
+
var dataRowNumberSchema = z70.number().int().positive();
|
|
21708
|
+
var measurementDraftSegmentDescriptorSchema = z70.object({
|
|
21404
21709
|
stableKey: measurementV2StableKeySchema,
|
|
21405
|
-
kind:
|
|
21406
|
-
retiredAt:
|
|
21710
|
+
kind: z70.enum(["target", "group"]),
|
|
21711
|
+
retiredAt: z70.string().datetime().nullable()
|
|
21407
21712
|
}).strict();
|
|
21408
|
-
var measurementDraftPreviewGroupMembershipRequestSchema =
|
|
21409
|
-
csv:
|
|
21713
|
+
var measurementDraftPreviewGroupMembershipRequestSchema = z70.object({
|
|
21714
|
+
csv: z70.string()
|
|
21410
21715
|
}).strict();
|
|
21411
|
-
var measurementDraftGroupMembershipRowStatusSchema =
|
|
21716
|
+
var measurementDraftGroupMembershipRowStatusSchema = z70.enum([
|
|
21412
21717
|
"matched",
|
|
21413
21718
|
"ambiguous",
|
|
21414
21719
|
"unmatched",
|
|
@@ -21417,7 +21722,7 @@ var measurementDraftGroupMembershipRowStatusSchema = z69.enum([
|
|
|
21417
21722
|
"proposed",
|
|
21418
21723
|
"excluded"
|
|
21419
21724
|
]);
|
|
21420
|
-
var measurementDraftGroupMembershipRowReasonSchema =
|
|
21725
|
+
var measurementDraftGroupMembershipRowReasonSchema = z70.enum([
|
|
21421
21726
|
"column-count",
|
|
21422
21727
|
"missing-property",
|
|
21423
21728
|
"missing-group",
|
|
@@ -21430,103 +21735,103 @@ var measurementDraftGroupMembershipRowReasonSchema = z69.enum([
|
|
|
21430
21735
|
"group-label-ambiguous",
|
|
21431
21736
|
"group-key-conflict"
|
|
21432
21737
|
]);
|
|
21433
|
-
var rowSourceSchema =
|
|
21738
|
+
var rowSourceSchema = z70.object({
|
|
21434
21739
|
/** One-based logical record number after the CSV header, not a physical line number. */
|
|
21435
21740
|
dataRow: dataRowNumberSchema,
|
|
21436
|
-
property:
|
|
21437
|
-
group:
|
|
21438
|
-
url:
|
|
21439
|
-
normalizedProperty:
|
|
21440
|
-
normalizedGroupLabel:
|
|
21741
|
+
property: z70.string(),
|
|
21742
|
+
group: z70.string(),
|
|
21743
|
+
url: z70.string().nullable(),
|
|
21744
|
+
normalizedProperty: z70.string(),
|
|
21745
|
+
normalizedGroupLabel: z70.string()
|
|
21441
21746
|
}).strict();
|
|
21442
21747
|
var rowFailureSchema = rowSourceSchema.extend({
|
|
21443
21748
|
reason: measurementDraftGroupMembershipRowReasonSchema
|
|
21444
21749
|
});
|
|
21445
|
-
var measurementDraftGroupKeyConflictEvidenceSchema =
|
|
21446
|
-
source:
|
|
21750
|
+
var measurementDraftGroupKeyConflictEvidenceSchema = z70.object({
|
|
21751
|
+
source: z70.enum(["draft-target", "draft-group", "persisted-segment", "retired-segment", "proposed-group"]),
|
|
21447
21752
|
stableKey: measurementV2StableKeySchema,
|
|
21448
|
-
kind:
|
|
21449
|
-
retiredAt:
|
|
21450
|
-
normalizedGroupLabel:
|
|
21753
|
+
kind: z70.enum(["target", "group"]).optional(),
|
|
21754
|
+
retiredAt: z70.string().datetime().nullable().optional(),
|
|
21755
|
+
normalizedGroupLabel: z70.string().optional()
|
|
21451
21756
|
}).strict();
|
|
21452
|
-
var measurementDraftGroupKeyConflictSchema =
|
|
21757
|
+
var measurementDraftGroupKeyConflictSchema = z70.object({
|
|
21453
21758
|
proposedGroupKey: measurementV2StableKeySchema,
|
|
21454
|
-
evidence:
|
|
21759
|
+
evidence: z70.array(measurementDraftGroupKeyConflictEvidenceSchema).min(1)
|
|
21455
21760
|
}).strict();
|
|
21456
|
-
var measurementDraftGroupMembershipRowSchema =
|
|
21761
|
+
var measurementDraftGroupMembershipRowSchema = z70.discriminatedUnion("status", [
|
|
21457
21762
|
rowSourceSchema.extend({
|
|
21458
|
-
status:
|
|
21763
|
+
status: z70.literal("matched"),
|
|
21459
21764
|
targetKey: measurementV2StableKeySchema,
|
|
21460
21765
|
groupKey: measurementV2StableKeySchema
|
|
21461
21766
|
}).strict(),
|
|
21462
21767
|
rowFailureSchema.extend({
|
|
21463
|
-
status:
|
|
21464
|
-
candidateTargetKeys:
|
|
21465
|
-
candidateGroupKeys:
|
|
21768
|
+
status: z70.literal("ambiguous"),
|
|
21769
|
+
candidateTargetKeys: z70.array(measurementV2StableKeySchema).min(1).optional(),
|
|
21770
|
+
candidateGroupKeys: z70.array(measurementV2StableKeySchema).min(1).optional()
|
|
21466
21771
|
}).strict(),
|
|
21467
21772
|
rowFailureSchema.extend({
|
|
21468
|
-
status:
|
|
21773
|
+
status: z70.literal("unmatched")
|
|
21469
21774
|
}).strict(),
|
|
21470
21775
|
rowFailureSchema.extend({
|
|
21471
|
-
status:
|
|
21776
|
+
status: z70.literal("invalid"),
|
|
21472
21777
|
groupKeyConflict: measurementDraftGroupKeyConflictSchema.optional()
|
|
21473
21778
|
}).strict(),
|
|
21474
21779
|
rowSourceSchema.extend({
|
|
21475
|
-
status:
|
|
21780
|
+
status: z70.literal("duplicate"),
|
|
21476
21781
|
duplicateOfRow: dataRowNumberSchema,
|
|
21477
21782
|
targetKey: measurementV2StableKeySchema,
|
|
21478
21783
|
groupKey: measurementV2StableKeySchema
|
|
21479
21784
|
}).strict(),
|
|
21480
21785
|
rowFailureSchema.extend({
|
|
21481
|
-
status:
|
|
21786
|
+
status: z70.literal("proposed"),
|
|
21482
21787
|
targetKey: measurementV2StableKeySchema
|
|
21483
21788
|
}).strict(),
|
|
21484
21789
|
rowFailureSchema.extend({
|
|
21485
|
-
status:
|
|
21790
|
+
status: z70.literal("excluded"),
|
|
21486
21791
|
targetKey: measurementV2StableKeySchema
|
|
21487
21792
|
}).strict()
|
|
21488
21793
|
]);
|
|
21489
|
-
var measurementDraftGroupMembershipChangeSchema =
|
|
21490
|
-
normalizedGroupLabel:
|
|
21794
|
+
var measurementDraftGroupMembershipChangeSchema = z70.object({
|
|
21795
|
+
normalizedGroupLabel: z70.string(),
|
|
21491
21796
|
groupKey: measurementV2StableKeySchema,
|
|
21492
|
-
label:
|
|
21493
|
-
action:
|
|
21494
|
-
matchedRows:
|
|
21495
|
-
targetKeys:
|
|
21496
|
-
addedTargetKeys:
|
|
21497
|
-
unchangedTargetKeys:
|
|
21498
|
-
}).strict();
|
|
21499
|
-
var measurementDraftGroupMembershipImportCountsSchema =
|
|
21500
|
-
dataRows:
|
|
21501
|
-
matchedRows:
|
|
21502
|
-
ambiguousRows:
|
|
21503
|
-
unmatchedRows:
|
|
21504
|
-
invalidRows:
|
|
21505
|
-
duplicateRows:
|
|
21506
|
-
proposedRows:
|
|
21507
|
-
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(),
|
|
21508
21813
|
/** Rows that cannot be committed without correcting the draft or source. */
|
|
21509
|
-
needsAttention:
|
|
21510
|
-
groupsReady:
|
|
21511
|
-
groupsToCreate:
|
|
21512
|
-
groupsToExtend:
|
|
21513
|
-
membershipsReady:
|
|
21514
|
-
addedMemberships:
|
|
21515
|
-
unchangedMemberships:
|
|
21516
|
-
}).strict();
|
|
21517
|
-
var measurementDraftPreviewGroupMembershipResponseSchema =
|
|
21518
|
-
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),
|
|
21519
21824
|
sourceChecksum: sha256HexSchema4,
|
|
21520
21825
|
previewChecksum: sha256HexSchema4,
|
|
21521
|
-
rows:
|
|
21522
|
-
groupChanges:
|
|
21826
|
+
rows: z70.array(measurementDraftGroupMembershipRowSchema),
|
|
21827
|
+
groupChanges: z70.array(measurementDraftGroupMembershipChangeSchema),
|
|
21523
21828
|
counts: measurementDraftGroupMembershipImportCountsSchema
|
|
21524
21829
|
}).strict();
|
|
21525
|
-
var measurementDraftApplyGroupMembershipRequestSchema =
|
|
21526
|
-
csv:
|
|
21830
|
+
var measurementDraftApplyGroupMembershipRequestSchema = z70.object({
|
|
21831
|
+
csv: z70.string(),
|
|
21527
21832
|
sourceChecksum: sha256HexSchema4,
|
|
21528
21833
|
previewChecksum: sha256HexSchema4,
|
|
21529
|
-
acceptedRows:
|
|
21834
|
+
acceptedRows: z70.array(dataRowNumberSchema).min(1)
|
|
21530
21835
|
}).strict().superRefine((value, context) => {
|
|
21531
21836
|
if (new Set(value.acceptedRows).size === value.acceptedRows.length) return;
|
|
21532
21837
|
context.addIssue({
|
|
@@ -21537,9 +21842,9 @@ var measurementDraftApplyGroupMembershipRequestSchema = z69.object({
|
|
|
21537
21842
|
});
|
|
21538
21843
|
var measurementDraftApplyGroupMembershipResponseSchema = measurementDraftMutationResponseSchema.extend({
|
|
21539
21844
|
/** Accepted matched CSV records, including records whose membership was already present. */
|
|
21540
|
-
appliedRows:
|
|
21541
|
-
addedMemberships:
|
|
21542
|
-
unchangedMemberships:
|
|
21845
|
+
appliedRows: z70.number().int().nonnegative(),
|
|
21846
|
+
addedMemberships: z70.number().int().nonnegative(),
|
|
21847
|
+
unchangedMemberships: z70.number().int().nonnegative()
|
|
21543
21848
|
}).strict();
|
|
21544
21849
|
|
|
21545
21850
|
// ../contracts/src/measurement-target-names.ts
|
|
@@ -21594,44 +21899,44 @@ function measurementTargetNameIssueMessage(issue) {
|
|
|
21594
21899
|
}
|
|
21595
21900
|
|
|
21596
21901
|
// ../contracts/src/google.ts
|
|
21597
|
-
import { z as
|
|
21598
|
-
var googleConnectionTypeSchema =
|
|
21599
|
-
var googleConnectionDtoSchema =
|
|
21600
|
-
id:
|
|
21601
|
-
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(),
|
|
21602
21907
|
connectionType: googleConnectionTypeSchema,
|
|
21603
|
-
propertyId:
|
|
21604
|
-
sitemapUrl:
|
|
21605
|
-
scopes:
|
|
21606
|
-
createdAt:
|
|
21607
|
-
updatedAt:
|
|
21608
|
-
});
|
|
21609
|
-
var googleOAuthStartResponseSchema =
|
|
21610
|
-
authUrl:
|
|
21611
|
-
redirectUri:
|
|
21612
|
-
}).strict();
|
|
21613
|
-
var gscSearchDataDtoSchema =
|
|
21614
|
-
date:
|
|
21615
|
-
query:
|
|
21616
|
-
page:
|
|
21617
|
-
country:
|
|
21618
|
-
device:
|
|
21619
|
-
clicks:
|
|
21620
|
-
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(),
|
|
21621
21926
|
ctr: fraction(),
|
|
21622
|
-
position:
|
|
21623
|
-
});
|
|
21624
|
-
var gscPerformanceOrderBySchema =
|
|
21625
|
-
var gscPerformanceResponseDtoSchema =
|
|
21626
|
-
rows:
|
|
21627
|
-
totalMatching:
|
|
21628
|
-
truncated:
|
|
21629
|
-
latestAvailableDate:
|
|
21630
|
-
});
|
|
21631
|
-
var gscPerformanceDailyPointSchema =
|
|
21632
|
-
date:
|
|
21633
|
-
clicks:
|
|
21634
|
-
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(),
|
|
21635
21940
|
ctr: fraction(),
|
|
21636
21941
|
/**
|
|
21637
21942
|
* Average ranking position for the day, or `null` on a date served by the
|
|
@@ -21640,15 +21945,15 @@ var gscPerformanceDailyPointSchema = z70.object({
|
|
|
21640
21945
|
* absence is reported rather than a fabricated `0` — which would also read as
|
|
21641
21946
|
* an impossibly good rank on a chart with an inverted axis.
|
|
21642
21947
|
*/
|
|
21643
|
-
position:
|
|
21948
|
+
position: z71.number().nullable()
|
|
21644
21949
|
});
|
|
21645
|
-
var gscWindowRangeSchema =
|
|
21950
|
+
var gscWindowRangeSchema = z71.object({
|
|
21646
21951
|
/** Inclusive lower bound, or `null` for the `all` window. */
|
|
21647
|
-
startDate:
|
|
21952
|
+
startDate: z71.string().nullable(),
|
|
21648
21953
|
/** Inclusive upper bound: the last date the property published. */
|
|
21649
|
-
endDate:
|
|
21954
|
+
endDate: z71.string().nullable(),
|
|
21650
21955
|
/** `MAX(date)` across the project's GSC data, ignoring the window. */
|
|
21651
|
-
latestDataDate:
|
|
21956
|
+
latestDataDate: z71.string().nullable(),
|
|
21652
21957
|
/**
|
|
21653
21958
|
* Calendar days since the last day with recorded traffic, on GSC's Pacific
|
|
21654
21959
|
* calendar. `null` with no data.
|
|
@@ -21658,37 +21963,37 @@ var gscWindowRangeSchema = z70.object({
|
|
|
21658
21963
|
* number. Render it as "data through <endDate>", never as "Search Console is
|
|
21659
21964
|
* N days behind".
|
|
21660
21965
|
*/
|
|
21661
|
-
daysSinceLatestData:
|
|
21966
|
+
daysSinceLatestData: z71.number().nullable()
|
|
21662
21967
|
});
|
|
21663
|
-
var gscPerformanceTrendsSchema =
|
|
21968
|
+
var gscPerformanceTrendsSchema = z71.object({
|
|
21664
21969
|
clicks: linearTrendSchema.nullable(),
|
|
21665
21970
|
impressions: linearTrendSchema.nullable(),
|
|
21666
21971
|
ctr: linearTrendSchema.nullable(),
|
|
21667
21972
|
position: linearTrendSchema.nullable()
|
|
21668
21973
|
});
|
|
21669
|
-
var gscPeriodTotalsSchema =
|
|
21670
|
-
startDate:
|
|
21671
|
-
endDate:
|
|
21672
|
-
clicks:
|
|
21673
|
-
impressions:
|
|
21974
|
+
var gscPeriodTotalsSchema = z71.object({
|
|
21975
|
+
startDate: z71.string(),
|
|
21976
|
+
endDate: z71.string(),
|
|
21977
|
+
clicks: z71.number(),
|
|
21978
|
+
impressions: z71.number(),
|
|
21674
21979
|
/** The period's own `clicks / impressions`, never a mean of daily ratios. */
|
|
21675
21980
|
ctr: fraction().nullable(),
|
|
21676
21981
|
/** Impression-weighted mean position, or null when no day carried one. */
|
|
21677
|
-
position:
|
|
21982
|
+
position: z71.number().nullable(),
|
|
21678
21983
|
/**
|
|
21679
21984
|
* Which table the figures came from. `gsc_daily_totals` (property-daily) and
|
|
21680
21985
|
* `SUM(gsc_search_data)` (dimensioned) are not interchangeable: on one real
|
|
21681
21986
|
* property-month the same period reads 1,142 clicks / 34,916 impressions from
|
|
21682
21987
|
* the first and 792 / 45,266 from the second.
|
|
21683
21988
|
*/
|
|
21684
|
-
source:
|
|
21989
|
+
source: z71.enum(["property-daily", "dimensioned", "mixed", "empty"])
|
|
21685
21990
|
});
|
|
21686
|
-
var gscPeriodComparisonSchema =
|
|
21991
|
+
var gscPeriodComparisonSchema = z71.object({
|
|
21687
21992
|
/**
|
|
21688
21993
|
* Length of EACH period in calendar days. Equals the selected window under
|
|
21689
21994
|
* `basis: 'prior-window'`, and half of it under `basis: 'split-window'`.
|
|
21690
21995
|
*/
|
|
21691
|
-
days:
|
|
21996
|
+
days: z71.number(),
|
|
21692
21997
|
/**
|
|
21693
21998
|
* Which two periods these are, so a surface can say what it is showing.
|
|
21694
21999
|
*
|
|
@@ -21710,7 +22015,7 @@ var gscPeriodComparisonSchema = z70.object({
|
|
|
21710
22015
|
* split the window, but a surface should render the absence with its
|
|
21711
22016
|
* period-length copy rather than assert a basis nobody sent.
|
|
21712
22017
|
*/
|
|
21713
|
-
basis:
|
|
22018
|
+
basis: z71.enum(["prior-window", "split-window"]).optional(),
|
|
21714
22019
|
prior: gscPeriodTotalsSchema,
|
|
21715
22020
|
trailing: gscPeriodTotalsSchema,
|
|
21716
22021
|
/**
|
|
@@ -21718,24 +22023,24 @@ var gscPeriodComparisonSchema = z70.object({
|
|
|
21718
22023
|
* case every `change` is null. Empty/property-daily halves are comparable;
|
|
21719
22024
|
* `SUM(gsc_search_data)` is never valid for property totals.
|
|
21720
22025
|
*/
|
|
21721
|
-
comparable:
|
|
22026
|
+
comparable: z71.boolean(),
|
|
21722
22027
|
/**
|
|
21723
22028
|
* Relative change as a ratio (0.5 = +50%), null where the prior period gives
|
|
21724
22029
|
* nothing to divide by or the trailing metric is unavailable. The sign is
|
|
21725
22030
|
* mathematical: a POSITIVE `position` means the rank number rose, which is
|
|
21726
22031
|
* worse. Desirability is the renderer's call.
|
|
21727
22032
|
*/
|
|
21728
|
-
change:
|
|
22033
|
+
change: z71.object({
|
|
21729
22034
|
clicks: fraction().nullable(),
|
|
21730
22035
|
impressions: fraction().nullable(),
|
|
21731
22036
|
ctr: fraction().nullable(),
|
|
21732
22037
|
position: fraction().nullable()
|
|
21733
22038
|
})
|
|
21734
22039
|
});
|
|
21735
|
-
var gscPerformanceDailyDtoSchema =
|
|
21736
|
-
totals:
|
|
21737
|
-
clicks:
|
|
21738
|
-
impressions:
|
|
22040
|
+
var gscPerformanceDailyDtoSchema = z71.object({
|
|
22041
|
+
totals: z71.object({
|
|
22042
|
+
clicks: z71.number(),
|
|
22043
|
+
impressions: z71.number(),
|
|
21739
22044
|
ctr: fraction(),
|
|
21740
22045
|
/**
|
|
21741
22046
|
* Impression-weighted mean position over the window, or `null` when no day
|
|
@@ -21743,15 +22048,15 @@ var gscPerformanceDailyDtoSchema = z70.object({
|
|
|
21743
22048
|
* daily values: position is non-additive, and an unweighted mean lets a
|
|
21744
22049
|
* one-impression day count as much as a thousand-impression day.
|
|
21745
22050
|
*/
|
|
21746
|
-
position:
|
|
22051
|
+
position: z71.number().nullable(),
|
|
21747
22052
|
/**
|
|
21748
22053
|
* Days that carried a property-level position. Below `days`, `position`
|
|
21749
22054
|
* describes a subset of the window and must be labelled as partial.
|
|
21750
22055
|
*/
|
|
21751
|
-
positionDays:
|
|
21752
|
-
days:
|
|
22056
|
+
positionDays: z71.number(),
|
|
22057
|
+
days: z71.number()
|
|
21753
22058
|
}),
|
|
21754
|
-
daily:
|
|
22059
|
+
daily: z71.array(gscPerformanceDailyPointSchema),
|
|
21755
22060
|
/**
|
|
21756
22061
|
* Optional because a server older than this field omits it. Both the web and
|
|
21757
22062
|
* the CLI guard for that skew; declaring it required here would tell a
|
|
@@ -21772,23 +22077,23 @@ var gscPerformanceDailyDtoSchema = z70.object({
|
|
|
21772
22077
|
*/
|
|
21773
22078
|
periodComparison: gscPeriodComparisonSchema.nullable().optional()
|
|
21774
22079
|
});
|
|
21775
|
-
var gscTopPageRowSchema =
|
|
21776
|
-
page:
|
|
21777
|
-
clicks:
|
|
21778
|
-
impressions:
|
|
22080
|
+
var gscTopPageRowSchema = z71.object({
|
|
22081
|
+
page: z71.string(),
|
|
22082
|
+
clicks: z71.number(),
|
|
22083
|
+
impressions: z71.number(),
|
|
21779
22084
|
ctr: fraction()
|
|
21780
22085
|
});
|
|
21781
|
-
var gscTopPagesDtoSchema =
|
|
21782
|
-
rows:
|
|
21783
|
-
totals:
|
|
21784
|
-
clicks:
|
|
21785
|
-
impressions:
|
|
22086
|
+
var gscTopPagesDtoSchema = z71.object({
|
|
22087
|
+
rows: z71.array(gscTopPageRowSchema),
|
|
22088
|
+
totals: z71.object({
|
|
22089
|
+
clicks: z71.number(),
|
|
22090
|
+
impressions: z71.number(),
|
|
21786
22091
|
ctr: fraction(),
|
|
21787
|
-
days:
|
|
22092
|
+
days: z71.number(),
|
|
21788
22093
|
/** First date the property-level totals actually cover. */
|
|
21789
|
-
coveredFrom:
|
|
22094
|
+
coveredFrom: z71.string().nullable(),
|
|
21790
22095
|
/** Last date the property-level totals actually cover. */
|
|
21791
|
-
coveredThrough:
|
|
22096
|
+
coveredThrough: z71.string().nullable(),
|
|
21792
22097
|
/**
|
|
21793
22098
|
* False when the totals span less than the ranked rows above.
|
|
21794
22099
|
*
|
|
@@ -21796,19 +22101,19 @@ var gscTopPagesDtoSchema = z70.object({
|
|
|
21796
22101
|
* 30-day totals sync can sit next to months of dimensioned rows. Printing
|
|
21797
22102
|
* both as one period would misstate the window the totals belong to.
|
|
21798
22103
|
*/
|
|
21799
|
-
complete:
|
|
22104
|
+
complete: z71.boolean()
|
|
21800
22105
|
}).nullable(),
|
|
21801
|
-
totalsSource:
|
|
22106
|
+
totalsSource: z71.literal("property-daily"),
|
|
21802
22107
|
/** First date the ranked rows cover, so a caller can compare spans. */
|
|
21803
|
-
rankedFrom:
|
|
22108
|
+
rankedFrom: z71.string().nullable(),
|
|
21804
22109
|
/** Last date the ranked rows cover. */
|
|
21805
|
-
rankedThrough:
|
|
22110
|
+
rankedThrough: z71.string().nullable()
|
|
21806
22111
|
});
|
|
21807
|
-
var gscQueryTotalsSourceSchema =
|
|
21808
|
-
var gscQueryTotalRowSchema =
|
|
21809
|
-
query:
|
|
21810
|
-
clicks:
|
|
21811
|
-
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(),
|
|
21812
22117
|
/** clicks / impressions as a 0..1 fraction, 0 when impressions are 0. */
|
|
21813
22118
|
ctr: fraction(),
|
|
21814
22119
|
/**
|
|
@@ -21816,15 +22121,15 @@ var gscQueryTotalRowSchema = z70.object({
|
|
|
21816
22121
|
* sum(position * impressions) / sum(impressions). When the query has no
|
|
21817
22122
|
* impressions in the window, the plain mean of its daily positions.
|
|
21818
22123
|
*/
|
|
21819
|
-
position:
|
|
22124
|
+
position: z71.number(),
|
|
21820
22125
|
/** Distinct dates the query appeared on in the window. */
|
|
21821
|
-
days:
|
|
22126
|
+
days: z71.number(),
|
|
21822
22127
|
source: gscQueryTotalsSourceSchema
|
|
21823
22128
|
});
|
|
21824
|
-
var gscQueryTotalsDtoSchema =
|
|
21825
|
-
rows:
|
|
21826
|
-
totalMatching:
|
|
21827
|
-
truncated:
|
|
22129
|
+
var gscQueryTotalsDtoSchema = z71.object({
|
|
22130
|
+
rows: z71.array(gscQueryTotalRowSchema),
|
|
22131
|
+
totalMatching: z71.number(),
|
|
22132
|
+
truncated: z71.boolean(),
|
|
21828
22133
|
/**
|
|
21829
22134
|
* The range the rows were read from, exactly. Explicit dates win; a labelled
|
|
21830
22135
|
* window paired with only `endDate` spans that many days ending on it. A
|
|
@@ -21842,49 +22147,49 @@ var gscQueryTotalsDtoSchema = z70.object({
|
|
|
21842
22147
|
* omits it, which means coverage is unknown, not that no rows are stored.
|
|
21843
22148
|
* This route always sends it.
|
|
21844
22149
|
*/
|
|
21845
|
-
earliestDataDate:
|
|
22150
|
+
earliestDataDate: z71.string().nullable().optional()
|
|
21846
22151
|
})
|
|
21847
22152
|
});
|
|
21848
|
-
var gscUrlInspectionDtoSchema =
|
|
21849
|
-
id:
|
|
21850
|
-
url:
|
|
21851
|
-
indexingState:
|
|
21852
|
-
verdict:
|
|
21853
|
-
coverageState:
|
|
21854
|
-
pageFetchState:
|
|
21855
|
-
robotsTxtState:
|
|
21856
|
-
crawlTime:
|
|
21857
|
-
lastCrawlResult:
|
|
21858
|
-
isMobileFriendly:
|
|
21859
|
-
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([]),
|
|
21860
22165
|
// Spec gap: server has returned `referringUrls` since the GSC inspect
|
|
21861
22166
|
// route shipped (see google.ts handler at /gsc/inspect + /gsc/inspections),
|
|
21862
22167
|
// but the schema dropped the field so the generated TS client (and
|
|
21863
22168
|
// anything else reading from this DTO) lost the data silently. Adding
|
|
21864
22169
|
// here restores end-to-end visibility.
|
|
21865
|
-
referringUrls:
|
|
21866
|
-
inspectedAt:
|
|
21867
|
-
});
|
|
21868
|
-
var indexTransitionSchema =
|
|
21869
|
-
var gscDeindexedRowSchema =
|
|
21870
|
-
url:
|
|
21871
|
-
previousState:
|
|
21872
|
-
currentState:
|
|
21873
|
-
transitionDate:
|
|
21874
|
-
});
|
|
21875
|
-
var gscReasonGroupSchema =
|
|
21876
|
-
reason:
|
|
21877
|
-
count:
|
|
21878
|
-
urls:
|
|
21879
|
-
});
|
|
21880
|
-
var gscCoverageSummaryDtoSchema =
|
|
21881
|
-
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({
|
|
21882
22187
|
/** Inspected pages, each in exactly one of `indexed` / `notIndexed`. */
|
|
21883
|
-
total:
|
|
21884
|
-
indexed:
|
|
21885
|
-
notIndexed:
|
|
22188
|
+
total: z71.number(),
|
|
22189
|
+
indexed: z71.number(),
|
|
22190
|
+
notIndexed: z71.number(),
|
|
21886
22191
|
/** Pages whose latest inspection lost the indexed state of the one before it. */
|
|
21887
|
-
deindexed:
|
|
22192
|
+
deindexed: z71.number(),
|
|
21888
22193
|
/** `indexed / total` as a 0..100 percent rounded to one decimal; 0 when nothing was inspected. */
|
|
21889
22194
|
percentage: percent(),
|
|
21890
22195
|
/**
|
|
@@ -21892,92 +22197,92 @@ var gscCoverageSummaryDtoSchema = z70.object({
|
|
|
21892
22197
|
* full coverage still reads short of 100%. Null when nothing was
|
|
21893
22198
|
* inspected: an empty site has no coverage share, not a 0% one.
|
|
21894
22199
|
*/
|
|
21895
|
-
indexedShare: fraction(
|
|
22200
|
+
indexedShare: fraction(z71.number().min(0).max(1)).nullable(),
|
|
21896
22201
|
/** `notIndexed / total`, 0..1. With `indexedShare` it sums to 1. Null when nothing was inspected. */
|
|
21897
|
-
notIndexedShare: fraction(
|
|
22202
|
+
notIndexedShare: fraction(z71.number().min(0).max(1)).nullable()
|
|
21898
22203
|
}),
|
|
21899
|
-
lastInspectedAt:
|
|
21900
|
-
lastSyncedAt:
|
|
21901
|
-
indexed:
|
|
21902
|
-
notIndexed:
|
|
21903
|
-
deindexed:
|
|
21904
|
-
reasonGroups:
|
|
21905
|
-
});
|
|
21906
|
-
var indexingNotificationDtoSchema =
|
|
21907
|
-
url:
|
|
21908
|
-
type:
|
|
21909
|
-
notifiedAt:
|
|
21910
|
-
});
|
|
21911
|
-
var indexingRequestResultDtoSchema =
|
|
21912
|
-
url:
|
|
21913
|
-
type:
|
|
21914
|
-
notifiedAt:
|
|
21915
|
-
status:
|
|
21916
|
-
error:
|
|
21917
|
-
});
|
|
21918
|
-
var indexingRequestResponseDtoSchema =
|
|
21919
|
-
summary:
|
|
21920
|
-
total:
|
|
21921
|
-
succeeded:
|
|
21922
|
-
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()
|
|
21923
22228
|
}),
|
|
21924
|
-
results:
|
|
22229
|
+
results: z71.array(indexingRequestResultDtoSchema).default([])
|
|
21925
22230
|
});
|
|
21926
|
-
var gscCoverageSnapshotDtoSchema =
|
|
21927
|
-
date:
|
|
21928
|
-
indexed:
|
|
21929
|
-
notIndexed:
|
|
22231
|
+
var gscCoverageSnapshotDtoSchema = z71.object({
|
|
22232
|
+
date: z71.string(),
|
|
22233
|
+
indexed: z71.number(),
|
|
22234
|
+
notIndexed: z71.number(),
|
|
21930
22235
|
/**
|
|
21931
22236
|
* Pages with no evidence either way — no impressions in the window and never
|
|
21932
22237
|
* inspected. Deliberately NOT folded into `notIndexed`: absence of
|
|
21933
22238
|
* impressions is not evidence of exclusion, and merging the two would report
|
|
21934
22239
|
* every unmeasured page as a problem.
|
|
21935
22240
|
*/
|
|
21936
|
-
unknownPages:
|
|
22241
|
+
unknownPages: z71.number().default(0),
|
|
21937
22242
|
/** Of the total, how many carry a real URL Inspection verdict. */
|
|
21938
|
-
verifiedByInspection:
|
|
22243
|
+
verifiedByInspection: z71.number().default(0),
|
|
21939
22244
|
/** Pages proven indexed by impressions alone, costing no inspection quota. */
|
|
21940
|
-
derivedFromImpressions:
|
|
21941
|
-
reasonBreakdown:
|
|
22245
|
+
derivedFromImpressions: z71.number().default(0),
|
|
22246
|
+
reasonBreakdown: z71.record(z71.string(), z71.number()).default({})
|
|
21942
22247
|
});
|
|
21943
|
-
var gscSiteDtoSchema =
|
|
21944
|
-
siteUrl:
|
|
21945
|
-
permissionLevel:
|
|
22248
|
+
var gscSiteDtoSchema = z71.object({
|
|
22249
|
+
siteUrl: z71.string(),
|
|
22250
|
+
permissionLevel: z71.string()
|
|
21946
22251
|
});
|
|
21947
|
-
var gscSiteListResponseDtoSchema =
|
|
21948
|
-
sites:
|
|
22252
|
+
var gscSiteListResponseDtoSchema = z71.object({
|
|
22253
|
+
sites: z71.array(gscSiteDtoSchema).default([])
|
|
21949
22254
|
});
|
|
21950
|
-
var gscSitemapContentDtoSchema =
|
|
21951
|
-
type:
|
|
21952
|
-
submitted:
|
|
22255
|
+
var gscSitemapContentDtoSchema = z71.object({
|
|
22256
|
+
type: z71.string(),
|
|
22257
|
+
submitted: z71.string(),
|
|
21953
22258
|
// Google still returns this for existing sitemap reads, but it is not a
|
|
21954
22259
|
// reliable submission outcome. Retained only for response compatibility.
|
|
21955
|
-
indexed:
|
|
21956
|
-
});
|
|
21957
|
-
var gscSitemapDtoSchema =
|
|
21958
|
-
path:
|
|
21959
|
-
parentSitemapUrl:
|
|
21960
|
-
lastSubmitted:
|
|
21961
|
-
isPending:
|
|
21962
|
-
isSitemapsIndex:
|
|
21963
|
-
type:
|
|
21964
|
-
lastDownloaded:
|
|
21965
|
-
warnings:
|
|
21966
|
-
errors:
|
|
21967
|
-
contents:
|
|
21968
|
-
});
|
|
21969
|
-
var gscSitemapListResponseDtoSchema =
|
|
21970
|
-
sitemaps:
|
|
21971
|
-
summary:
|
|
21972
|
-
total:
|
|
21973
|
-
indexes:
|
|
21974
|
-
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()
|
|
21975
22280
|
}),
|
|
21976
|
-
preferredSubmissionUrls:
|
|
22281
|
+
preferredSubmissionUrls: z71.array(z71.string()).default([])
|
|
21977
22282
|
});
|
|
21978
|
-
var gscSubmitSitemapsRequestDtoSchema =
|
|
21979
|
-
sitemapUrls:
|
|
21980
|
-
|
|
22283
|
+
var gscSubmitSitemapsRequestDtoSchema = z71.object({
|
|
22284
|
+
sitemapUrls: z71.array(
|
|
22285
|
+
z71.string().url().refine(
|
|
21981
22286
|
(value) => {
|
|
21982
22287
|
const protocol = new URL(value).protocol;
|
|
21983
22288
|
return protocol === "http:" || protocol === "https:";
|
|
@@ -21986,30 +22291,30 @@ var gscSubmitSitemapsRequestDtoSchema = z70.object({
|
|
|
21986
22291
|
)
|
|
21987
22292
|
).min(1).max(50)
|
|
21988
22293
|
});
|
|
21989
|
-
var gscSubmitSitemapResultDtoSchema =
|
|
21990
|
-
sitemapUrl:
|
|
21991
|
-
status:
|
|
21992
|
-
submittedAt:
|
|
21993
|
-
error:
|
|
21994
|
-
});
|
|
21995
|
-
var gscSubmitSitemapsResponseDtoSchema =
|
|
21996
|
-
summary:
|
|
21997
|
-
total:
|
|
21998
|
-
accepted:
|
|
21999
|
-
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()
|
|
22000
22305
|
}),
|
|
22001
|
-
results:
|
|
22002
|
-
});
|
|
22003
|
-
var gscDiscoverSitemapsResponseDtoSchema =
|
|
22004
|
-
sitemaps:
|
|
22005
|
-
primarySitemapUrl:
|
|
22006
|
-
run:
|
|
22007
|
-
id:
|
|
22008
|
-
projectId:
|
|
22009
|
-
kind:
|
|
22010
|
-
status:
|
|
22011
|
-
trigger:
|
|
22012
|
-
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()
|
|
22013
22318
|
}).nullable()
|
|
22014
22319
|
});
|
|
22015
22320
|
|
|
@@ -22128,255 +22433,255 @@ async function mapWithConcurrency(items, concurrency, fn) {
|
|
|
22128
22433
|
}
|
|
22129
22434
|
|
|
22130
22435
|
// ../contracts/src/bing.ts
|
|
22131
|
-
import { z as
|
|
22132
|
-
var bingConnectionDtoSchema =
|
|
22133
|
-
id:
|
|
22134
|
-
domain:
|
|
22135
|
-
siteUrl:
|
|
22136
|
-
createdAt:
|
|
22137
|
-
updatedAt:
|
|
22138
|
-
});
|
|
22139
|
-
var bingUrlInspectionDtoSchema =
|
|
22140
|
-
id:
|
|
22141
|
-
url:
|
|
22142
|
-
httpCode:
|
|
22143
|
-
inIndex:
|
|
22144
|
-
lastCrawledDate:
|
|
22145
|
-
inIndexDate:
|
|
22146
|
-
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(),
|
|
22147
22452
|
// Fields derived from GetUrlInfo response (more reliable than InIndex)
|
|
22148
|
-
documentSize:
|
|
22149
|
-
anchorCount:
|
|
22150
|
-
discoveryDate:
|
|
22151
|
-
});
|
|
22152
|
-
var bingCoverageSummaryDtoSchema =
|
|
22153
|
-
summary:
|
|
22154
|
-
total:
|
|
22155
|
-
indexed:
|
|
22156
|
-
notIndexed:
|
|
22157
|
-
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(),
|
|
22158
22463
|
percentage: percent()
|
|
22159
22464
|
}),
|
|
22160
|
-
lastInspectedAt:
|
|
22161
|
-
indexed:
|
|
22162
|
-
notIndexed:
|
|
22163
|
-
unknown:
|
|
22164
|
-
});
|
|
22165
|
-
var bingKeywordStatsDtoSchema =
|
|
22166
|
-
query:
|
|
22167
|
-
impressions:
|
|
22168
|
-
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(),
|
|
22169
22474
|
ctr: fraction(),
|
|
22170
|
-
averagePosition:
|
|
22171
|
-
});
|
|
22172
|
-
var bingCoverageSnapshotDtoSchema =
|
|
22173
|
-
date:
|
|
22174
|
-
indexed:
|
|
22175
|
-
notIndexed:
|
|
22176
|
-
unknown:
|
|
22177
|
-
});
|
|
22178
|
-
var bingSubmitResultDtoSchema =
|
|
22179
|
-
url:
|
|
22180
|
-
status:
|
|
22181
|
-
submittedAt:
|
|
22182
|
-
error:
|
|
22183
|
-
});
|
|
22184
|
-
var bingIndexingRequestResponseDtoSchema =
|
|
22185
|
-
summary:
|
|
22186
|
-
total:
|
|
22187
|
-
succeeded:
|
|
22188
|
-
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()
|
|
22189
22494
|
}),
|
|
22190
|
-
results:
|
|
22495
|
+
results: z72.array(bingSubmitResultDtoSchema).default([])
|
|
22191
22496
|
});
|
|
22192
|
-
var bingSiteDtoSchema =
|
|
22193
|
-
url:
|
|
22194
|
-
verified:
|
|
22497
|
+
var bingSiteDtoSchema = z72.object({
|
|
22498
|
+
url: z72.string(),
|
|
22499
|
+
verified: z72.boolean()
|
|
22195
22500
|
});
|
|
22196
|
-
var bingSitesResponseDtoSchema =
|
|
22197
|
-
sites:
|
|
22501
|
+
var bingSitesResponseDtoSchema = z72.object({
|
|
22502
|
+
sites: z72.array(bingSiteDtoSchema).default([])
|
|
22198
22503
|
});
|
|
22199
|
-
var bingStatusDtoSchema =
|
|
22200
|
-
connected:
|
|
22201
|
-
domain:
|
|
22202
|
-
siteUrl:
|
|
22203
|
-
createdAt:
|
|
22204
|
-
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()
|
|
22205
22510
|
});
|
|
22206
|
-
var bingConnectResponseDtoSchema =
|
|
22207
|
-
connected:
|
|
22208
|
-
domain:
|
|
22209
|
-
siteUrl:
|
|
22210
|
-
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([])
|
|
22211
22516
|
});
|
|
22212
|
-
var bingSetSiteResponseDtoSchema =
|
|
22213
|
-
siteUrl:
|
|
22517
|
+
var bingSetSiteResponseDtoSchema = z72.object({
|
|
22518
|
+
siteUrl: z72.string()
|
|
22214
22519
|
});
|
|
22215
22520
|
|
|
22216
22521
|
// ../contracts/src/cdp.ts
|
|
22217
|
-
import { z as
|
|
22218
|
-
var cdpTargetStatusDtoSchema =
|
|
22219
|
-
name:
|
|
22220
|
-
alive:
|
|
22221
|
-
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()
|
|
22222
22527
|
});
|
|
22223
|
-
var cdpStatusDtoSchema =
|
|
22224
|
-
connected:
|
|
22225
|
-
endpoint:
|
|
22226
|
-
version:
|
|
22227
|
-
browserVersion:
|
|
22228
|
-
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([])
|
|
22229
22534
|
});
|
|
22230
22535
|
|
|
22231
22536
|
// ../contracts/src/wordpress.ts
|
|
22232
|
-
import { z as
|
|
22233
|
-
var wordpressEnvSchema =
|
|
22234
|
-
var wordpressConnectionDtoSchema =
|
|
22235
|
-
projectName:
|
|
22236
|
-
url:
|
|
22237
|
-
stagingUrl:
|
|
22238
|
-
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(),
|
|
22239
22544
|
defaultEnv: wordpressEnvSchema,
|
|
22240
|
-
createdAt:
|
|
22241
|
-
updatedAt:
|
|
22242
|
-
});
|
|
22243
|
-
var wordpressSiteStatusDtoSchema =
|
|
22244
|
-
url:
|
|
22245
|
-
reachable:
|
|
22246
|
-
pageCount:
|
|
22247
|
-
version:
|
|
22248
|
-
error:
|
|
22249
|
-
plugins:
|
|
22250
|
-
authenticatedUser:
|
|
22251
|
-
id:
|
|
22252
|
-
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()
|
|
22253
22558
|
}).nullable().optional()
|
|
22254
22559
|
});
|
|
22255
|
-
var wordpressStatusDtoSchema =
|
|
22256
|
-
connected:
|
|
22257
|
-
projectName:
|
|
22560
|
+
var wordpressStatusDtoSchema = z74.object({
|
|
22561
|
+
connected: z74.boolean(),
|
|
22562
|
+
projectName: z74.string(),
|
|
22258
22563
|
defaultEnv: wordpressEnvSchema,
|
|
22259
22564
|
live: wordpressSiteStatusDtoSchema.nullable(),
|
|
22260
22565
|
staging: wordpressSiteStatusDtoSchema.nullable(),
|
|
22261
|
-
adminUrl:
|
|
22566
|
+
adminUrl: z74.string().nullable().optional()
|
|
22262
22567
|
});
|
|
22263
|
-
var wordpressPageSummaryDtoSchema =
|
|
22264
|
-
id:
|
|
22265
|
-
slug:
|
|
22266
|
-
title:
|
|
22267
|
-
status:
|
|
22268
|
-
modifiedAt:
|
|
22269
|
-
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()
|
|
22270
22575
|
});
|
|
22271
|
-
var wordpressPageListDtoSchema =
|
|
22576
|
+
var wordpressPageListDtoSchema = z74.object({
|
|
22272
22577
|
env: wordpressEnvSchema,
|
|
22273
|
-
pages:
|
|
22578
|
+
pages: z74.array(wordpressPageSummaryDtoSchema)
|
|
22274
22579
|
});
|
|
22275
|
-
var wordpressSeoStateDtoSchema =
|
|
22276
|
-
title:
|
|
22277
|
-
description:
|
|
22278
|
-
noindex:
|
|
22279
|
-
writable:
|
|
22280
|
-
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([])
|
|
22281
22586
|
});
|
|
22282
|
-
var wordpressSchemaBlockDtoSchema =
|
|
22283
|
-
type:
|
|
22284
|
-
json:
|
|
22587
|
+
var wordpressSchemaBlockDtoSchema = z74.object({
|
|
22588
|
+
type: z74.string(),
|
|
22589
|
+
json: z74.record(z74.string(), z74.unknown())
|
|
22285
22590
|
});
|
|
22286
22591
|
var wordpressPageDetailDtoSchema = wordpressPageSummaryDtoSchema.extend({
|
|
22287
22592
|
env: wordpressEnvSchema,
|
|
22288
|
-
content:
|
|
22593
|
+
content: z74.string(),
|
|
22289
22594
|
seo: wordpressSeoStateDtoSchema,
|
|
22290
|
-
schemaBlocks:
|
|
22595
|
+
schemaBlocks: z74.array(wordpressSchemaBlockDtoSchema).default([])
|
|
22291
22596
|
});
|
|
22292
22597
|
var wordpressDiffPageDtoSchema = wordpressPageDetailDtoSchema.extend({
|
|
22293
|
-
contentHash:
|
|
22294
|
-
contentSnippet:
|
|
22295
|
-
});
|
|
22296
|
-
var wordpressManualAssistDtoSchema =
|
|
22297
|
-
manualRequired:
|
|
22298
|
-
targetUrl:
|
|
22299
|
-
adminUrl:
|
|
22300
|
-
content:
|
|
22301
|
-
nextSteps:
|
|
22302
|
-
});
|
|
22303
|
-
var wordpressAuditIssueDtoSchema =
|
|
22304
|
-
slug:
|
|
22305
|
-
severity:
|
|
22306
|
-
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([
|
|
22307
22612
|
"noindex",
|
|
22308
22613
|
"missing-seo-title",
|
|
22309
22614
|
"missing-meta-description",
|
|
22310
22615
|
"missing-schema",
|
|
22311
22616
|
"thin-content"
|
|
22312
22617
|
]),
|
|
22313
|
-
message:
|
|
22618
|
+
message: z74.string()
|
|
22314
22619
|
});
|
|
22315
|
-
var wordpressAuditPageDtoSchema =
|
|
22316
|
-
slug:
|
|
22317
|
-
title:
|
|
22318
|
-
status:
|
|
22319
|
-
wordCount:
|
|
22620
|
+
var wordpressAuditPageDtoSchema = z74.object({
|
|
22621
|
+
slug: z74.string(),
|
|
22622
|
+
title: z74.string(),
|
|
22623
|
+
status: z74.string(),
|
|
22624
|
+
wordCount: z74.number(),
|
|
22320
22625
|
seo: wordpressSeoStateDtoSchema,
|
|
22321
|
-
schemaPresent:
|
|
22322
|
-
issues:
|
|
22626
|
+
schemaPresent: z74.boolean(),
|
|
22627
|
+
issues: z74.array(wordpressAuditIssueDtoSchema).default([])
|
|
22323
22628
|
});
|
|
22324
|
-
var wordpressBulkMetaEntryResultDtoSchema =
|
|
22325
|
-
slug:
|
|
22326
|
-
status:
|
|
22327
|
-
error:
|
|
22629
|
+
var wordpressBulkMetaEntryResultDtoSchema = z74.object({
|
|
22630
|
+
slug: z74.string(),
|
|
22631
|
+
status: z74.enum(["applied", "skipped", "manual"]),
|
|
22632
|
+
error: z74.string().optional(),
|
|
22328
22633
|
manualAssist: wordpressManualAssistDtoSchema.optional()
|
|
22329
22634
|
});
|
|
22330
|
-
var wordpressBulkMetaResultDtoSchema =
|
|
22635
|
+
var wordpressBulkMetaResultDtoSchema = z74.object({
|
|
22331
22636
|
env: wordpressEnvSchema,
|
|
22332
|
-
strategy:
|
|
22333
|
-
results:
|
|
22637
|
+
strategy: z74.enum(["plugin", "manual"]),
|
|
22638
|
+
results: z74.array(wordpressBulkMetaEntryResultDtoSchema)
|
|
22334
22639
|
});
|
|
22335
|
-
var wordpressSchemaDeployEntryResultDtoSchema =
|
|
22336
|
-
slug:
|
|
22337
|
-
status:
|
|
22338
|
-
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(),
|
|
22339
22644
|
manualAssist: wordpressManualAssistDtoSchema.optional(),
|
|
22340
|
-
error:
|
|
22645
|
+
error: z74.string().optional()
|
|
22341
22646
|
});
|
|
22342
|
-
var wordpressSchemaDeployResultDtoSchema =
|
|
22647
|
+
var wordpressSchemaDeployResultDtoSchema = z74.object({
|
|
22343
22648
|
env: wordpressEnvSchema,
|
|
22344
|
-
results:
|
|
22649
|
+
results: z74.array(wordpressSchemaDeployEntryResultDtoSchema)
|
|
22345
22650
|
});
|
|
22346
|
-
var wordpressSchemaStatusPageDtoSchema =
|
|
22347
|
-
slug:
|
|
22348
|
-
title:
|
|
22349
|
-
canonrySchemas:
|
|
22350
|
-
thirdPartySchemas:
|
|
22351
|
-
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()
|
|
22352
22657
|
});
|
|
22353
|
-
var wordpressSchemaStatusResultDtoSchema =
|
|
22658
|
+
var wordpressSchemaStatusResultDtoSchema = z74.object({
|
|
22354
22659
|
env: wordpressEnvSchema,
|
|
22355
|
-
pages:
|
|
22660
|
+
pages: z74.array(wordpressSchemaStatusPageDtoSchema)
|
|
22356
22661
|
});
|
|
22357
|
-
var wordpressOnboardStepDtoSchema =
|
|
22358
|
-
name:
|
|
22359
|
-
status:
|
|
22360
|
-
summary:
|
|
22361
|
-
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()
|
|
22362
22667
|
});
|
|
22363
|
-
var wordpressOnboardResultDtoSchema =
|
|
22364
|
-
projectName:
|
|
22365
|
-
steps:
|
|
22668
|
+
var wordpressOnboardResultDtoSchema = z74.object({
|
|
22669
|
+
projectName: z74.string(),
|
|
22670
|
+
steps: z74.array(wordpressOnboardStepDtoSchema)
|
|
22366
22671
|
});
|
|
22367
|
-
var wordpressDiffDtoSchema =
|
|
22368
|
-
slug:
|
|
22672
|
+
var wordpressDiffDtoSchema = z74.object({
|
|
22673
|
+
slug: z74.string(),
|
|
22369
22674
|
live: wordpressDiffPageDtoSchema,
|
|
22370
22675
|
staging: wordpressDiffPageDtoSchema,
|
|
22371
|
-
hasDifferences:
|
|
22372
|
-
differences:
|
|
22373
|
-
title:
|
|
22374
|
-
slug:
|
|
22375
|
-
content:
|
|
22376
|
-
seoTitle:
|
|
22377
|
-
seoDescription:
|
|
22378
|
-
noindex:
|
|
22379
|
-
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()
|
|
22380
22685
|
})
|
|
22381
22686
|
});
|
|
22382
22687
|
|
|
@@ -22559,61 +22864,61 @@ var LlmCapabilities = {
|
|
|
22559
22864
|
var LLM_CAPABILITIES = Object.values(LlmCapabilities);
|
|
22560
22865
|
|
|
22561
22866
|
// ../contracts/src/status.ts
|
|
22562
|
-
import { z as
|
|
22563
|
-
var statusIntegrationSchema =
|
|
22867
|
+
import { z as z75 } from "zod";
|
|
22868
|
+
var statusIntegrationSchema = z75.enum(["gsc", "ga", "gbp", "bing", "ads", "google-ads", "gtm", "traffic"]);
|
|
22564
22869
|
var StatusIntegrations = statusIntegrationSchema.enum;
|
|
22565
|
-
var integrationStateSchema =
|
|
22870
|
+
var integrationStateSchema = z75.enum(["ok", "failing", "stale", "never-synced"]);
|
|
22566
22871
|
var IntegrationStates = integrationStateSchema.enum;
|
|
22567
|
-
var dateTimeSchema2 =
|
|
22568
|
-
var dateSchema =
|
|
22569
|
-
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({
|
|
22570
22875
|
integration: statusIntegrationSchema,
|
|
22571
|
-
label:
|
|
22876
|
+
label: z75.string(),
|
|
22572
22877
|
runKind: runKindSchema,
|
|
22573
|
-
sourceId:
|
|
22878
|
+
sourceId: z75.string().nullable(),
|
|
22574
22879
|
state: integrationStateSchema,
|
|
22575
22880
|
lastSuccessAt: dateTimeSchema2.nullable(),
|
|
22576
22881
|
latestRunAt: dateTimeSchema2.nullable(),
|
|
22577
|
-
latestRunId:
|
|
22882
|
+
latestRunId: z75.string().nullable(),
|
|
22578
22883
|
latestStatus: runStatusSchema.nullable(),
|
|
22579
22884
|
latestTrigger: runTriggerSchema.nullable(),
|
|
22580
|
-
consecutiveFailures:
|
|
22581
|
-
latestError:
|
|
22885
|
+
consecutiveFailures: z75.number().int().nonnegative(),
|
|
22886
|
+
latestError: z75.string().max(300).nullable(),
|
|
22582
22887
|
dataThrough: dateSchema.nullable(),
|
|
22583
|
-
dataAgeDays:
|
|
22584
|
-
doctorChecks:
|
|
22888
|
+
dataAgeDays: z75.number().int().nonnegative().nullable(),
|
|
22889
|
+
doctorChecks: z75.array(z75.string())
|
|
22585
22890
|
});
|
|
22586
|
-
var statusHealthSchema =
|
|
22587
|
-
status:
|
|
22588
|
-
code:
|
|
22589
|
-
summary:
|
|
22891
|
+
var statusHealthSchema = z75.object({
|
|
22892
|
+
status: z75.enum(["ok", "warn", "fail"]),
|
|
22893
|
+
code: z75.string(),
|
|
22894
|
+
summary: z75.string(),
|
|
22590
22895
|
checkedAt: dateTimeSchema2,
|
|
22591
22896
|
notifiedAt: dateTimeSchema2.nullable()
|
|
22592
22897
|
});
|
|
22593
|
-
var projectStatusSchema =
|
|
22594
|
-
project:
|
|
22595
|
-
displayName:
|
|
22596
|
-
state:
|
|
22898
|
+
var projectStatusSchema = z75.object({
|
|
22899
|
+
project: z75.string(),
|
|
22900
|
+
displayName: z75.string(),
|
|
22901
|
+
state: z75.enum([...integrationStateSchema.options, "warning"]),
|
|
22597
22902
|
health: statusHealthSchema.nullable(),
|
|
22598
|
-
integrations:
|
|
22903
|
+
integrations: z75.array(integrationStatusRowSchema)
|
|
22599
22904
|
});
|
|
22600
|
-
var instanceStatusDtoSchema =
|
|
22905
|
+
var instanceStatusDtoSchema = z75.object({
|
|
22601
22906
|
generatedAt: dateTimeSchema2,
|
|
22602
22907
|
mcp: mcpHealthSchema.optional(),
|
|
22603
|
-
summary:
|
|
22604
|
-
projects:
|
|
22605
|
-
ok:
|
|
22606
|
-
failing:
|
|
22607
|
-
warning:
|
|
22608
|
-
stale:
|
|
22609
|
-
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()
|
|
22610
22915
|
}),
|
|
22611
|
-
projects:
|
|
22916
|
+
projects: z75.array(projectStatusSchema)
|
|
22612
22917
|
});
|
|
22613
22918
|
|
|
22614
22919
|
// ../contracts/src/run-dispatch.ts
|
|
22615
|
-
import { z as
|
|
22616
|
-
var providerBatchRequestOutcomeSchema =
|
|
22920
|
+
import { z as z76 } from "zod";
|
|
22921
|
+
var providerBatchRequestOutcomeSchema = z76.enum([
|
|
22617
22922
|
"recorded",
|
|
22618
22923
|
"errored",
|
|
22619
22924
|
"expired",
|
|
@@ -22622,7 +22927,7 @@ var providerBatchRequestOutcomeSchema = z75.enum([
|
|
|
22622
22927
|
"duplicate"
|
|
22623
22928
|
]);
|
|
22624
22929
|
var ProviderBatchRequestOutcomes = providerBatchRequestOutcomeSchema.enum;
|
|
22625
|
-
var providerBatchIneligibilityReasonSchema =
|
|
22930
|
+
var providerBatchIneligibilityReasonSchema = z76.enum([
|
|
22626
22931
|
"not_plan_run",
|
|
22627
22932
|
"scoped_run",
|
|
22628
22933
|
"probe_run",
|
|
@@ -22725,18 +23030,18 @@ function summarizeRunUsage(rows) {
|
|
|
22725
23030
|
}
|
|
22726
23031
|
|
|
22727
23032
|
// ../contracts/src/snapshot.ts
|
|
22728
|
-
import { z as
|
|
22729
|
-
var snapshotProviderModeSchema =
|
|
23033
|
+
import { z as z77 } from "zod";
|
|
23034
|
+
var snapshotProviderModeSchema = z77.enum(["all", "api", "browser"]);
|
|
22730
23035
|
var SnapshotProviderModes = snapshotProviderModeSchema.enum;
|
|
22731
|
-
var snapshotAccuracySchema =
|
|
22732
|
-
var snapshotQueryListSchema =
|
|
22733
|
-
var snapshotRequestInputSchema =
|
|
22734
|
-
companyName:
|
|
22735
|
-
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),
|
|
22736
23041
|
queries: snapshotQueryListSchema.optional(),
|
|
22737
23042
|
phrases: snapshotQueryListSchema.optional(),
|
|
22738
|
-
competitors:
|
|
22739
|
-
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."),
|
|
22740
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.")
|
|
22741
23046
|
}).superRefine((input, ctx) => {
|
|
22742
23047
|
if (input.queries !== void 0 && input.phrases !== void 0) {
|
|
@@ -22753,106 +23058,106 @@ var snapshotRequestSchema = snapshotRequestInputSchema.safeExtend({
|
|
|
22753
23058
|
function resolveSnapshotRequestQueries(input) {
|
|
22754
23059
|
return input.queries ?? input.phrases ?? [];
|
|
22755
23060
|
}
|
|
22756
|
-
var snapshotCompetitorEntrySchema =
|
|
22757
|
-
name:
|
|
22758
|
-
count:
|
|
22759
|
-
});
|
|
22760
|
-
var snapshotAuditFactorSchema =
|
|
22761
|
-
id:
|
|
22762
|
-
name:
|
|
22763
|
-
weight:
|
|
22764
|
-
score:
|
|
22765
|
-
findings:
|
|
22766
|
-
type:
|
|
22767
|
-
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()
|
|
22768
23073
|
})).default([]),
|
|
22769
|
-
recommendations:
|
|
22770
|
-
});
|
|
22771
|
-
var snapshotAuditSchema =
|
|
22772
|
-
url:
|
|
22773
|
-
finalUrl:
|
|
22774
|
-
auditedAt:
|
|
22775
|
-
overallScore:
|
|
22776
|
-
summary:
|
|
22777
|
-
factors:
|
|
22778
|
-
});
|
|
22779
|
-
var snapshotProfileSchema =
|
|
22780
|
-
industry:
|
|
22781
|
-
summary:
|
|
22782
|
-
services:
|
|
22783
|
-
categoryTerms:
|
|
22784
|
-
});
|
|
22785
|
-
var snapshotProviderResultSchema =
|
|
22786
|
-
provider:
|
|
22787
|
-
displayName:
|
|
22788
|
-
model:
|
|
22789
|
-
mentioned:
|
|
22790
|
-
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(),
|
|
22791
23096
|
describedAccurately: snapshotAccuracySchema,
|
|
22792
|
-
accuracyNotes:
|
|
22793
|
-
incorrectClaims:
|
|
22794
|
-
recommendedCompetitors:
|
|
22795
|
-
citedDomains:
|
|
22796
|
-
groundingSources:
|
|
22797
|
-
searchQueries:
|
|
22798
|
-
answerText:
|
|
22799
|
-
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(),
|
|
22800
23105
|
/** Vendor-neutral answer evidence (answer services); absent for answer engines. */
|
|
22801
23106
|
evidence: answerEvidenceSchema.nullable().optional(),
|
|
22802
23107
|
/** False when the provider's sources are not tied to its answer, so `cited` was not measured. */
|
|
22803
|
-
citationMeasured:
|
|
23108
|
+
citationMeasured: z77.boolean().optional()
|
|
22804
23109
|
});
|
|
22805
|
-
var snapshotQueryResultSchema =
|
|
22806
|
-
query:
|
|
22807
|
-
providerResults:
|
|
23110
|
+
var snapshotQueryResultSchema = z77.object({
|
|
23111
|
+
query: z77.string(),
|
|
23112
|
+
providerResults: z77.array(snapshotProviderResultSchema).default([])
|
|
22808
23113
|
});
|
|
22809
|
-
var snapshotSummarySchema =
|
|
22810
|
-
totalQueries:
|
|
22811
|
-
totalProviders:
|
|
22812
|
-
totalComparisons:
|
|
22813
|
-
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(),
|
|
22814
23119
|
/** Successful responses whose citation was measured and found the domain cited; read against `citationComparisons`. */
|
|
22815
|
-
citationCount:
|
|
23120
|
+
citationCount: z77.number().int().nonnegative(),
|
|
22816
23121
|
/**
|
|
22817
23122
|
* Successful responses whose citation could be measured: the denominator of
|
|
22818
23123
|
* `citationCount`. Lower than `totalComparisons` when a provider's sources
|
|
22819
23124
|
* are not tied to its answer, so those answers are neither cited nor not
|
|
22820
23125
|
* cited. Absent on reports made before it existed (read `totalComparisons`).
|
|
22821
23126
|
*/
|
|
22822
|
-
citationComparisons:
|
|
22823
|
-
topCompetitors:
|
|
22824
|
-
visibilityGap:
|
|
22825
|
-
whatThisMeans:
|
|
22826
|
-
recommendedActions:
|
|
22827
|
-
});
|
|
22828
|
-
var snapshotReportSchema =
|
|
22829
|
-
companyName:
|
|
22830
|
-
domain:
|
|
22831
|
-
homepageUrl:
|
|
22832
|
-
generatedAt:
|
|
22833
|
-
queries:
|
|
22834
|
-
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([]),
|
|
22835
23140
|
profile: snapshotProfileSchema,
|
|
22836
23141
|
audit: snapshotAuditSchema,
|
|
22837
|
-
queryResults:
|
|
23142
|
+
queryResults: z77.array(snapshotQueryResultSchema).default([]),
|
|
22838
23143
|
summary: snapshotSummarySchema
|
|
22839
23144
|
});
|
|
22840
23145
|
|
|
22841
23146
|
// ../contracts/src/competitor-suggestions.ts
|
|
22842
|
-
import { z as
|
|
22843
|
-
var competitorSuggestionsQuerySchema =
|
|
23147
|
+
import { z as z78 } from "zod";
|
|
23148
|
+
var competitorSuggestionsQuerySchema = z78.object({
|
|
22844
23149
|
window: metricsWindowSchema.optional(),
|
|
22845
|
-
minAnswers:
|
|
22846
|
-
queryClass:
|
|
22847
|
-
groupKey:
|
|
22848
|
-
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()
|
|
22849
23154
|
}).strict();
|
|
22850
|
-
var competitorSuggestionNameSchema =
|
|
22851
|
-
name:
|
|
22852
|
-
answerCount:
|
|
22853
|
-
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()
|
|
22854
23159
|
}).strict();
|
|
22855
|
-
var competitorSuggestionReasonSchema =
|
|
23160
|
+
var competitorSuggestionReasonSchema = z78.enum([
|
|
22856
23161
|
"below-min-answers",
|
|
22857
23162
|
"not-named",
|
|
22858
23163
|
"unpaired-name",
|
|
@@ -22863,56 +23168,56 @@ var competitorSuggestionReasonSchema = z77.enum([
|
|
|
22863
23168
|
"shared-host"
|
|
22864
23169
|
]);
|
|
22865
23170
|
var CompetitorSuggestionReasons = competitorSuggestionReasonSchema.enum;
|
|
22866
|
-
var competitorSuggestionStatusSchema =
|
|
23171
|
+
var competitorSuggestionStatusSchema = z78.enum(["suggested", "tracked", "excluded"]);
|
|
22867
23172
|
var CompetitorSuggestionStatuses = competitorSuggestionStatusSchema.enum;
|
|
22868
|
-
var competitorSuggestionSchema =
|
|
22869
|
-
domain:
|
|
22870
|
-
label:
|
|
22871
|
-
names:
|
|
22872
|
-
namingAnswers:
|
|
22873
|
-
citingAnswers:
|
|
22874
|
-
bothAnswers:
|
|
22875
|
-
pairedAnswers:
|
|
22876
|
-
namedByOtherNameAnswers:
|
|
22877
|
-
sweeps:
|
|
22878
|
-
firstSeenAt:
|
|
22879
|
-
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(),
|
|
22880
23185
|
surfaceClass: competitorLandscapeSurfaceClassSchema,
|
|
22881
|
-
tracked:
|
|
22882
|
-
marketKeys:
|
|
23186
|
+
tracked: z78.boolean(),
|
|
23187
|
+
marketKeys: z78.array(z78.string().trim().min(1)).optional(),
|
|
22883
23188
|
status: competitorSuggestionStatusSchema,
|
|
22884
23189
|
reason: competitorSuggestionReasonSchema.nullable(),
|
|
22885
|
-
sampleUrls:
|
|
23190
|
+
sampleUrls: z78.array(z78.string().url()).max(3)
|
|
22886
23191
|
}).strict();
|
|
22887
|
-
var competitorSuggestionsResponseSchema =
|
|
22888
|
-
project:
|
|
23192
|
+
var competitorSuggestionsResponseSchema = z78.object({
|
|
23193
|
+
project: z78.string().trim().min(1),
|
|
22889
23194
|
window: metricsWindowSchema,
|
|
22890
23195
|
scope: competitorLandscapeScopeSchema,
|
|
22891
|
-
filters:
|
|
22892
|
-
queryClass:
|
|
22893
|
-
groupKey:
|
|
22894
|
-
limit:
|
|
22895
|
-
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()
|
|
22896
23201
|
}).strict(),
|
|
22897
|
-
thresholds:
|
|
22898
|
-
candidates:
|
|
22899
|
-
candidatesTotal:
|
|
22900
|
-
excludedCounts:
|
|
22901
|
-
unresolvedNames:
|
|
22902
|
-
evidence:
|
|
22903
|
-
answeredResults:
|
|
22904
|
-
sourceResults:
|
|
22905
|
-
excludedProbeResults:
|
|
22906
|
-
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()
|
|
22907
23212
|
}).strict(),
|
|
22908
|
-
runCount:
|
|
22909
|
-
runIds:
|
|
22910
|
-
countUnits:
|
|
22911
|
-
answers:
|
|
22912
|
-
distinctNames:
|
|
22913
|
-
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())
|
|
22914
23219
|
}).strict(),
|
|
22915
|
-
truncated:
|
|
23220
|
+
truncated: z78.boolean()
|
|
22916
23221
|
}).strict();
|
|
22917
23222
|
var COMPETITOR_SUGGESTION_COUNT_UNITS = {
|
|
22918
23223
|
...COMPETITOR_LANDSCAPE_COUNT_UNITS,
|
|
@@ -22930,9 +23235,9 @@ var COMPETITOR_SUGGESTION_COUNT_UNITS = {
|
|
|
22930
23235
|
};
|
|
22931
23236
|
|
|
22932
23237
|
// ../contracts/src/intelligence.ts
|
|
22933
|
-
import { z as
|
|
22934
|
-
var insightSeveritySchema =
|
|
22935
|
-
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"]);
|
|
22936
23241
|
var InsightActionGroups = insightActionGroupSchema.enum;
|
|
22937
23242
|
var insightActionGroupByType = {
|
|
22938
23243
|
// Content-required: a missing or competitive answer needs new or updated material.
|
|
@@ -22954,10 +23259,10 @@ var insightActionGroupByType = {
|
|
|
22954
23259
|
"gbp-metric-drop": InsightActionGroups.investigate,
|
|
22955
23260
|
"gbp-keyword-drop": InsightActionGroups.investigate
|
|
22956
23261
|
};
|
|
22957
|
-
var healthSnapshotDtoSchema =
|
|
22958
|
-
id:
|
|
22959
|
-
projectId:
|
|
22960
|
-
runId:
|
|
23262
|
+
var healthSnapshotDtoSchema = z79.object({
|
|
23263
|
+
id: z79.string(),
|
|
23264
|
+
projectId: z79.string(),
|
|
23265
|
+
runId: z79.string().nullable(),
|
|
22961
23266
|
overallCitedRate: fraction(),
|
|
22962
23267
|
/**
|
|
22963
23268
|
* Share of (query × provider) pairs where the project was MENTIONED in the
|
|
@@ -22966,46 +23271,50 @@ var healthSnapshotDtoSchema = z78.object({
|
|
|
22966
23271
|
* as 0 (the API coalesces NULL→0).
|
|
22967
23272
|
*/
|
|
22968
23273
|
overallMentionRate: fraction(),
|
|
22969
|
-
totalPairs:
|
|
22970
|
-
citedPairs:
|
|
23274
|
+
totalPairs: z79.number().int().nonnegative(),
|
|
23275
|
+
citedPairs: z79.number().int().nonnegative(),
|
|
22971
23276
|
/** Count of pairs mentioned in the answer text. Legacy rows read back as 0. */
|
|
22972
|
-
mentionedPairs:
|
|
22973
|
-
providerBreakdown:
|
|
23277
|
+
mentionedPairs: z79.number().int().nonnegative(),
|
|
23278
|
+
providerBreakdown: z79.record(z79.string(), z79.object({
|
|
22974
23279
|
citedRate: fraction(),
|
|
22975
23280
|
mentionRate: fraction(),
|
|
22976
|
-
cited:
|
|
22977
|
-
mentioned:
|
|
22978
|
-
total:
|
|
23281
|
+
cited: z79.number().int().nonnegative(),
|
|
23282
|
+
mentioned: z79.number().int().nonnegative(),
|
|
23283
|
+
total: z79.number().int().nonnegative()
|
|
22979
23284
|
})),
|
|
22980
|
-
createdAt:
|
|
23285
|
+
createdAt: z79.string(),
|
|
22981
23286
|
/**
|
|
22982
23287
|
* `'ready'` when the snapshot reflects real data; `'no-data'` for the
|
|
22983
23288
|
* sentinel returned by `/health/latest` when a project has no health
|
|
22984
23289
|
* snapshots yet (newly created, or only failed runs). Numeric fields are
|
|
22985
23290
|
* zero and `providerBreakdown` is `{}` in the no-data case.
|
|
22986
23291
|
*/
|
|
22987
|
-
status:
|
|
23292
|
+
status: z79.enum(["ready", "no-data"]),
|
|
22988
23293
|
/** Reason for `status === 'no-data'`. Absent when `status === 'ready'`. */
|
|
22989
|
-
reason:
|
|
23294
|
+
reason: z79.literal("no-runs-yet").optional()
|
|
22990
23295
|
});
|
|
22991
23296
|
|
|
22992
23297
|
// ../contracts/src/agent.ts
|
|
22993
|
-
import { z as
|
|
22994
|
-
var agentViewContextSchema =
|
|
22995
|
-
view:
|
|
22996
|
-
|
|
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(),
|
|
22997
23304
|
selection: visibilityReportRequestSchema.optional(),
|
|
22998
|
-
page:
|
|
22999
|
-
runId:
|
|
23000
|
-
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()
|
|
23001
23308
|
}).strict().optional()
|
|
23002
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." });
|
|
23003
23312
|
if (value.page && value.view !== "site-health") ctx.addIssue({ code: "custom", message: "Page context requires Site Health." });
|
|
23004
23313
|
if (value.selection && !["visibility", "property", "queries"].includes(value.view)) ctx.addIssue({ code: "custom", message: "Measurement selection requires a measurement view." });
|
|
23005
23314
|
});
|
|
23006
|
-
var agentTurnLimitsSchema =
|
|
23007
|
-
maxToolCalls:
|
|
23008
|
-
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)
|
|
23009
23318
|
}).strict();
|
|
23010
23319
|
function agentVisibilityEvidence(report, project, retrievedAt) {
|
|
23011
23320
|
const selection = report.selection;
|
|
@@ -23048,34 +23357,34 @@ function agentVisibilityEvidence(report, project, retrievedAt) {
|
|
|
23048
23357
|
))
|
|
23049
23358
|
};
|
|
23050
23359
|
}
|
|
23051
|
-
var agentProviderIdSchema =
|
|
23052
|
-
var agentProviderOptionDtoSchema =
|
|
23360
|
+
var agentProviderIdSchema = z80.enum(["claude", "openai", "gemini", "zai", "openrouter"]);
|
|
23361
|
+
var agentProviderOptionDtoSchema = z80.object({
|
|
23053
23362
|
/** Stable identifier — what clients pass back as `provider` on the prompt endpoint. */
|
|
23054
23363
|
id: agentProviderIdSchema,
|
|
23055
23364
|
/** Human-readable label for UI pickers, e.g. "Anthropic (Claude)". */
|
|
23056
|
-
label:
|
|
23365
|
+
label: z80.string(),
|
|
23057
23366
|
/** Default model if the caller doesn't pick one. */
|
|
23058
|
-
defaultModel:
|
|
23367
|
+
defaultModel: z80.string(),
|
|
23059
23368
|
/** Whether a usable API key was found (config.yaml or provider env var). */
|
|
23060
|
-
configured:
|
|
23369
|
+
configured: z80.boolean(),
|
|
23061
23370
|
/**
|
|
23062
23371
|
* Where the key resolved from, if any. `null` when `configured === false`.
|
|
23063
23372
|
* Surfaced so the UI can nudge users toward their preferred source of truth.
|
|
23064
23373
|
*/
|
|
23065
|
-
keySource:
|
|
23374
|
+
keySource: z80.enum(["config", "env"]).nullable(),
|
|
23066
23375
|
/**
|
|
23067
23376
|
* A short list of models to offer for this provider: the default first,
|
|
23068
23377
|
* then a few stronger current models. A pinned model outside the list is
|
|
23069
23378
|
* listed first. Any other model ID can still be requested.
|
|
23070
23379
|
*/
|
|
23071
|
-
models:
|
|
23380
|
+
models: z80.array(z80.object({ id: z80.string(), displayName: z80.string() })).optional()
|
|
23072
23381
|
});
|
|
23073
|
-
var agentProvidersResponseDtoSchema =
|
|
23382
|
+
var agentProvidersResponseDtoSchema = z80.object({
|
|
23074
23383
|
/**
|
|
23075
23384
|
* Every provider Aero knows about. `configured === false` entries are
|
|
23076
23385
|
* included so the UI can render them disabled with an onboarding hint.
|
|
23077
23386
|
*/
|
|
23078
|
-
providers:
|
|
23387
|
+
providers: z80.array(agentProviderOptionDtoSchema).default([]),
|
|
23079
23388
|
/**
|
|
23080
23389
|
* Provider a new session uses when the caller names none: the
|
|
23081
23390
|
* `agent.provider` pin when set (reported even without a key, as its
|
|
@@ -23085,50 +23394,50 @@ var agentProvidersResponseDtoSchema = z79.object({
|
|
|
23085
23394
|
*/
|
|
23086
23395
|
defaultProvider: agentProviderIdSchema.nullable()
|
|
23087
23396
|
});
|
|
23088
|
-
var memorySourceSchema =
|
|
23397
|
+
var memorySourceSchema = z80.enum(["aero", "user", "compaction"]);
|
|
23089
23398
|
var MemorySources = memorySourceSchema.enum;
|
|
23090
23399
|
var AGENT_MEMORY_VALUE_MAX_BYTES = 2 * 1024;
|
|
23091
23400
|
var AGENT_MEMORY_KEY_MAX_LENGTH = 128;
|
|
23092
|
-
var agentMemoryUpsertRequestSchema =
|
|
23093
|
-
key:
|
|
23094
|
-
value:
|
|
23401
|
+
var agentMemoryUpsertRequestSchema = z80.object({
|
|
23402
|
+
key: z80.string().min(1).max(AGENT_MEMORY_KEY_MAX_LENGTH),
|
|
23403
|
+
value: z80.string().min(1)
|
|
23095
23404
|
});
|
|
23096
|
-
var agentMemoryDeleteRequestSchema =
|
|
23097
|
-
key:
|
|
23405
|
+
var agentMemoryDeleteRequestSchema = z80.object({
|
|
23406
|
+
key: z80.string().min(1).max(AGENT_MEMORY_KEY_MAX_LENGTH)
|
|
23098
23407
|
});
|
|
23099
|
-
var agentPromptRequestSchema =
|
|
23100
|
-
prompt:
|
|
23101
|
-
conversationId:
|
|
23408
|
+
var agentPromptRequestSchema = z80.object({
|
|
23409
|
+
prompt: z80.string().trim().min(1),
|
|
23410
|
+
conversationId: z80.string().min(1).nullable().optional(),
|
|
23102
23411
|
provider: agentProviderIdSchema.optional(),
|
|
23103
|
-
modelId:
|
|
23104
|
-
scope:
|
|
23105
|
-
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(),
|
|
23106
23415
|
context: agentViewContextSchema.optional(),
|
|
23107
23416
|
limits: agentTurnLimitsSchema.optional()
|
|
23108
23417
|
});
|
|
23109
|
-
var agentConversationMessageSchema =
|
|
23110
|
-
var agentConversationSummarySchema =
|
|
23111
|
-
id:
|
|
23112
|
-
title:
|
|
23113
|
-
active:
|
|
23114
|
-
modelProvider:
|
|
23115
|
-
modelId:
|
|
23116
|
-
createdAt:
|
|
23117
|
-
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()
|
|
23118
23427
|
});
|
|
23119
23428
|
var agentConversationSchema = agentConversationSummarySchema.extend({
|
|
23120
|
-
messages:
|
|
23121
|
-
isStreaming:
|
|
23429
|
+
messages: z80.array(agentConversationMessageSchema),
|
|
23430
|
+
isStreaming: z80.boolean()
|
|
23122
23431
|
});
|
|
23123
|
-
var agentConversationListSchema =
|
|
23124
|
-
conversations:
|
|
23125
|
-
currentConversationId:
|
|
23126
|
-
nextOffset:
|
|
23432
|
+
var agentConversationListSchema = z80.object({
|
|
23433
|
+
conversations: z80.array(agentConversationSummarySchema),
|
|
23434
|
+
currentConversationId: z80.string().nullable(),
|
|
23435
|
+
nextOffset: z80.number().int().nullable()
|
|
23127
23436
|
});
|
|
23128
|
-
var agentConversationCreateSchema =
|
|
23129
|
-
id:
|
|
23437
|
+
var agentConversationCreateSchema = z80.object({
|
|
23438
|
+
id: z80.uuid()
|
|
23130
23439
|
}).strict();
|
|
23131
|
-
var agentConversationDeleteSchema =
|
|
23440
|
+
var agentConversationDeleteSchema = z80.object({ id: z80.string(), status: z80.literal("deleted") });
|
|
23132
23441
|
function agentConversationTitle(messages) {
|
|
23133
23442
|
for (const message of messages) {
|
|
23134
23443
|
if (message.role !== "user") continue;
|
|
@@ -23140,49 +23449,49 @@ function agentConversationTitle(messages) {
|
|
|
23140
23449
|
return "New conversation";
|
|
23141
23450
|
}
|
|
23142
23451
|
var aeroPreviewStarterIds = ["status", "changes", "gaps", "insights"];
|
|
23143
|
-
var aeroPreviewStarterIdSchema =
|
|
23144
|
-
var aeroPreviewStepSchema =
|
|
23452
|
+
var aeroPreviewStarterIdSchema = z80.enum(aeroPreviewStarterIds);
|
|
23453
|
+
var aeroPreviewStepSchema = z80.object({
|
|
23145
23454
|
/** Assistant text shown before the tool call, when the turn narrates it. */
|
|
23146
|
-
text:
|
|
23147
|
-
tool:
|
|
23455
|
+
text: z80.string().optional(),
|
|
23456
|
+
tool: z80.object({
|
|
23148
23457
|
/** Real Canonry MCP tool name, such as canonry_visibility_report. */
|
|
23149
|
-
name:
|
|
23458
|
+
name: z80.string(),
|
|
23150
23459
|
/** The tool's registered title, which the live bar shows as the card label. */
|
|
23151
|
-
label:
|
|
23152
|
-
arguments:
|
|
23460
|
+
label: z80.string(),
|
|
23461
|
+
arguments: z80.record(z80.string(), z80.unknown()),
|
|
23153
23462
|
/** A compact excerpt of the stored result, not the full payload. */
|
|
23154
|
-
result:
|
|
23155
|
-
durationMs:
|
|
23463
|
+
result: z80.unknown(),
|
|
23464
|
+
durationMs: z80.number().int().nonnegative()
|
|
23156
23465
|
})
|
|
23157
23466
|
});
|
|
23158
|
-
var aeroPreviewStarterSchema =
|
|
23467
|
+
var aeroPreviewStarterSchema = z80.object({
|
|
23159
23468
|
id: aeroPreviewStarterIdSchema,
|
|
23160
|
-
steps:
|
|
23469
|
+
steps: z80.array(aeroPreviewStepSchema),
|
|
23161
23470
|
/** Final assistant markdown. */
|
|
23162
|
-
answer:
|
|
23471
|
+
answer: z80.string()
|
|
23163
23472
|
});
|
|
23164
|
-
var aeroPreviewResponseSchema =
|
|
23165
|
-
project:
|
|
23166
|
-
seededAt:
|
|
23167
|
-
starters:
|
|
23473
|
+
var aeroPreviewResponseSchema = z80.object({
|
|
23474
|
+
project: z80.string(),
|
|
23475
|
+
seededAt: z80.string(),
|
|
23476
|
+
starters: z80.array(aeroPreviewStarterSchema)
|
|
23168
23477
|
});
|
|
23169
|
-
var agentConversationListQuerySchema =
|
|
23170
|
-
offset:
|
|
23171
|
-
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)
|
|
23172
23481
|
}).strict();
|
|
23173
23482
|
|
|
23174
23483
|
// ../contracts/src/sentiment.ts
|
|
23175
|
-
import { z as
|
|
23484
|
+
import { z as z81 } from "zod";
|
|
23176
23485
|
var SENTIMENT_MODEL = "jev-1.13.0";
|
|
23177
23486
|
var SENTIMENT_OPENROUTER_MODEL = "typesafe/jev-1.13";
|
|
23178
23487
|
var SENTIMENT_OPENROUTER_SERVED_MODEL = "typesafe/jev-1.13-20260917";
|
|
23179
|
-
var sentimentEvaluatorProviderSchema =
|
|
23488
|
+
var sentimentEvaluatorProviderSchema = z81.enum(["typesafe", "openrouter"]);
|
|
23180
23489
|
var SENTIMENT_INTERVAL_LIMITATION = "Wilson 95% intervals assume independent observations. They exclude classifier error and dependence among related queries, Properties, and sweeps.";
|
|
23181
|
-
var id =
|
|
23182
|
-
var count =
|
|
23183
|
-
var runIds =
|
|
23184
|
-
var rate = fraction(
|
|
23185
|
-
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([
|
|
23186
23495
|
"favorable",
|
|
23187
23496
|
"mixed",
|
|
23188
23497
|
"unfavorable",
|
|
@@ -23203,22 +23512,22 @@ var sentimentOutcomeSchema = z80.enum([
|
|
|
23203
23512
|
"canceled"
|
|
23204
23513
|
]);
|
|
23205
23514
|
var SentimentOutcomes = sentimentOutcomeSchema.enum;
|
|
23206
|
-
var sentimentStateSchema =
|
|
23207
|
-
var sentimentEvaluationDefinitionSchema =
|
|
23208
|
-
schemaVersion:
|
|
23209
|
-
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]),
|
|
23210
23519
|
/** Omitted on historical direct TypeSafe definitions to preserve their immutable identity. */
|
|
23211
23520
|
provider: sentimentEvaluatorProviderSchema.optional(),
|
|
23212
|
-
expectedReturnedModel:
|
|
23521
|
+
expectedReturnedModel: z81.literal(SENTIMENT_OPENROUTER_SERVED_MODEL).optional(),
|
|
23213
23522
|
verdictVersion: id,
|
|
23214
23523
|
identityVersion: id,
|
|
23215
23524
|
evidenceVersion: id,
|
|
23216
23525
|
segmentationVersion: id,
|
|
23217
23526
|
preprocessingVersion: id,
|
|
23218
|
-
languagePolicy:
|
|
23219
|
-
comparisonMethodVersion:
|
|
23220
|
-
confidenceThreshold:
|
|
23221
|
-
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()
|
|
23222
23531
|
}).strict().superRefine((definition, ctx) => {
|
|
23223
23532
|
const routed = definition.provider === "openrouter";
|
|
23224
23533
|
if (definition.requestedModel !== (routed ? SENTIMENT_OPENROUTER_MODEL : SENTIMENT_MODEL) || (routed ? definition.expectedReturnedModel !== SENTIMENT_OPENROUTER_SERVED_MODEL : definition.expectedReturnedModel !== void 0)) {
|
|
@@ -23261,7 +23570,7 @@ function storedDefinitionProjection(value) {
|
|
|
23261
23570
|
if (typeof projected.questions === "object" && projected.questions !== null) projected.questions = Object.fromEntries(Object.entries(projected.questions).filter(([key]) => key !== "theme"));
|
|
23262
23571
|
return projected;
|
|
23263
23572
|
}
|
|
23264
|
-
var storedSentimentEvaluationDefinitionSchema =
|
|
23573
|
+
var storedSentimentEvaluationDefinitionSchema = z81.preprocess(storedDefinitionProjection, sentimentEvaluationDefinitionSchema);
|
|
23265
23574
|
function canonicalSentimentJson(value) {
|
|
23266
23575
|
function canonical(item) {
|
|
23267
23576
|
if (Array.isArray(item)) return item.map(canonical);
|
|
@@ -23270,69 +23579,69 @@ function canonicalSentimentJson(value) {
|
|
|
23270
23579
|
}
|
|
23271
23580
|
return JSON.stringify(canonical(value));
|
|
23272
23581
|
}
|
|
23273
|
-
var sentimentSubjectSchema =
|
|
23274
|
-
var sentimentUsageEdgeSchema =
|
|
23275
|
-
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({
|
|
23276
23585
|
queryId: id,
|
|
23277
|
-
queryText:
|
|
23278
|
-
queryClass:
|
|
23586
|
+
queryText: z81.string(),
|
|
23587
|
+
queryClass: z81.enum(["branded", "non-brand"]),
|
|
23279
23588
|
provider: id,
|
|
23280
|
-
requestedModel:
|
|
23281
|
-
servedModel:
|
|
23282
|
-
location:
|
|
23283
|
-
revision:
|
|
23284
|
-
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),
|
|
23285
23594
|
locationContext: locationContextSchema.nullable().default(null)
|
|
23286
23595
|
}).strict();
|
|
23287
|
-
var sentimentEvidenceSchema =
|
|
23288
|
-
var sentimentUsageSchema =
|
|
23289
|
-
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({
|
|
23290
23599
|
sourceSnapshotId: id,
|
|
23291
|
-
sourceText:
|
|
23600
|
+
sourceText: z81.string(),
|
|
23292
23601
|
sourceTextHash: id,
|
|
23293
23602
|
subject: sentimentSubjectSchema,
|
|
23294
23603
|
subjectHash: id,
|
|
23295
23604
|
context: sentimentExecutionContextSchema,
|
|
23296
|
-
language:
|
|
23605
|
+
language: z81.string(),
|
|
23297
23606
|
definition: sentimentEvaluationDefinitionSchema,
|
|
23298
|
-
sentences:
|
|
23607
|
+
sentences: z81.array(sentimentEvidenceSchema)
|
|
23299
23608
|
}).strict();
|
|
23300
|
-
var storedSentimentClassifierInputSchema =
|
|
23609
|
+
var storedSentimentClassifierInputSchema = z81.preprocess((value) => {
|
|
23301
23610
|
if (typeof value !== "object" || value === null || !("definition" in value)) return value;
|
|
23302
23611
|
return { ...value, definition: storedDefinitionProjection(value.definition) };
|
|
23303
23612
|
}, sentimentClassifierInputSchema);
|
|
23304
|
-
var classifierCommon = { returnedModel:
|
|
23305
|
-
var sentimentClassifierOutputSchema =
|
|
23306
|
-
|
|
23307
|
-
kind:
|
|
23613
|
+
var classifierCommon = { returnedModel: z81.string().nullable(), usage: sentimentUsageSchema };
|
|
23614
|
+
var sentimentClassifierOutputSchema = z81.discriminatedUnion("kind", [
|
|
23615
|
+
z81.object({
|
|
23616
|
+
kind: z81.literal("classified"),
|
|
23308
23617
|
...classifierCommon,
|
|
23309
|
-
returnedModel:
|
|
23618
|
+
returnedModel: z81.string(),
|
|
23310
23619
|
outcome: sentimentOutcomeSchema,
|
|
23311
|
-
conclusion:
|
|
23312
|
-
complaint:
|
|
23313
|
-
confidence:
|
|
23620
|
+
conclusion: z81.array(sentimentEvidenceSchema),
|
|
23621
|
+
complaint: z81.array(sentimentEvidenceSchema).nullable(),
|
|
23622
|
+
confidence: z81.number().min(0).max(1).nullable()
|
|
23314
23623
|
}).strict(),
|
|
23315
|
-
|
|
23316
|
-
|
|
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()
|
|
23317
23626
|
]).superRefine((result, ctx) => {
|
|
23318
23627
|
if (result.kind === "classified" && ["favorable", "mixed", "unfavorable"].includes(result.outcome) && result.conclusion.length === 0) {
|
|
23319
23628
|
ctx.addIssue({ code: "custom", path: ["conclusion"], message: "Judgments require conclusion evidence" });
|
|
23320
23629
|
}
|
|
23321
23630
|
});
|
|
23322
|
-
var storedSentimentClassifierOutputSchema =
|
|
23323
|
-
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({
|
|
23324
23633
|
runId: id.optional(),
|
|
23325
23634
|
runIds: runIds.optional(),
|
|
23326
|
-
revision:
|
|
23327
|
-
mode:
|
|
23328
|
-
queryClass:
|
|
23329
|
-
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"),
|
|
23330
23639
|
queryId: id.optional(),
|
|
23331
23640
|
scopeKey: id.optional(),
|
|
23332
23641
|
marketKey: id.optional(),
|
|
23333
23642
|
provider: id.optional(),
|
|
23334
23643
|
model: id.optional(),
|
|
23335
|
-
location:
|
|
23644
|
+
location: z81.string().min(1).optional(),
|
|
23336
23645
|
evaluationDefinitionId: id.optional(),
|
|
23337
23646
|
/** Exact frozen Advanced execution node of the selected query. Identity: it narrows the assessed population. */
|
|
23338
23647
|
executionNodeKey: id.optional()
|
|
@@ -23342,26 +23651,26 @@ function exclusiveSentimentRuns(value, ctx) {
|
|
|
23342
23651
|
if (value.runIds && new Set(value.runIds).size !== value.runIds.length) ctx.addIssue({ code: "custom", path: ["runIds"], message: "Run IDs must be unique." });
|
|
23343
23652
|
}
|
|
23344
23653
|
var sentimentSelectionSchema = sentimentSelectionBaseSchema.superRefine(exclusiveSentimentRuns);
|
|
23345
|
-
var sentimentSummaryIncludeSchema =
|
|
23654
|
+
var sentimentSummaryIncludeSchema = z81.enum(["assessments", "locations"]);
|
|
23346
23655
|
var SENTIMENT_QUERY_PAGE_DEFAULT = 25;
|
|
23347
23656
|
var SENTIMENT_QUERY_PAGE_MAX = 500;
|
|
23348
23657
|
var sentimentSummaryRequestSchema = sentimentSelectionBaseSchema.extend({
|
|
23349
|
-
include:
|
|
23350
|
-
queryLimit:
|
|
23351
|
-
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()
|
|
23352
23661
|
}).superRefine(exclusiveSentimentRuns);
|
|
23353
|
-
var sentimentEvidenceOutcomeFilterSchema =
|
|
23662
|
+
var sentimentEvidenceOutcomeFilterSchema = z81.preprocess((value) => {
|
|
23354
23663
|
const items = typeof value === "string" ? [value] : Array.isArray(value) ? value : null;
|
|
23355
23664
|
return items ? [...new Set(items.flatMap((item) => typeof item === "string" ? item.split(",").map((part) => part.trim()).filter(Boolean) : [item]))] : value;
|
|
23356
|
-
},
|
|
23357
|
-
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);
|
|
23358
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) => {
|
|
23359
23668
|
exclusiveSentimentRuns(value, ctx);
|
|
23360
23669
|
if (value.runIds) ctx.addIssue({ code: "custom", path: ["runIds"], message: "Comparison requires one explicit run per period." });
|
|
23361
23670
|
});
|
|
23362
|
-
var sentimentResolvedSelectionSchema = sentimentSelectionBaseSchema.extend({ runId: id.nullable(), revision:
|
|
23363
|
-
var sentimentCountsSchema =
|
|
23364
|
-
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({
|
|
23365
23674
|
selected: count,
|
|
23366
23675
|
eligibleAssessments: count,
|
|
23367
23676
|
unadmittedAssessments: count,
|
|
@@ -23375,45 +23684,45 @@ var sentimentCoverageSchema = z80.object({
|
|
|
23375
23684
|
expectedProviderSlots: count,
|
|
23376
23685
|
completedProviderSlots: count
|
|
23377
23686
|
}).strict();
|
|
23378
|
-
var sentimentScoreSchema =
|
|
23379
|
-
var headlineFields = { state: sentimentStateSchema, reason:
|
|
23380
|
-
var sentimentHeadlineSchema =
|
|
23381
|
-
var sentimentOverallHeadlineSchema =
|
|
23382
|
-
var sentimentOverviewSchema =
|
|
23383
|
-
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({
|
|
23384
23693
|
assessmentId: id.nullable(),
|
|
23385
23694
|
sourceSnapshotId: id,
|
|
23386
23695
|
runId: id,
|
|
23387
23696
|
subjectId: id,
|
|
23388
|
-
subjectLabel:
|
|
23697
|
+
subjectLabel: z81.string(),
|
|
23389
23698
|
executionNodeKey: id.nullable(),
|
|
23390
23699
|
provider: id,
|
|
23391
|
-
requestedModel:
|
|
23392
|
-
servedModel:
|
|
23393
|
-
location:
|
|
23700
|
+
requestedModel: z81.string().nullable(),
|
|
23701
|
+
servedModel: z81.string().nullable(),
|
|
23702
|
+
location: z81.string().nullable(),
|
|
23394
23703
|
evaluationDefinitionId: id.nullable(),
|
|
23395
23704
|
state: sentimentStateSchema,
|
|
23396
|
-
outcome:
|
|
23397
|
-
reason:
|
|
23705
|
+
outcome: z81.union([sentimentOutcomeSchema, z81.null()]),
|
|
23706
|
+
reason: z81.string().nullable()
|
|
23398
23707
|
}).strict();
|
|
23399
|
-
var sentimentQuerySummarySchema =
|
|
23400
|
-
var sentimentBreakdownSchema =
|
|
23401
|
-
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({
|
|
23402
23711
|
...headlineFields,
|
|
23403
|
-
configured:
|
|
23712
|
+
configured: z81.boolean(),
|
|
23404
23713
|
selection: sentimentResolvedSelectionSchema,
|
|
23405
23714
|
evaluationDefinition: sentimentEvaluationDefinitionSchema.nullable(),
|
|
23406
|
-
breakdowns:
|
|
23407
|
-
queries:
|
|
23715
|
+
breakdowns: z81.array(sentimentBreakdownSchema),
|
|
23716
|
+
queries: z81.array(sentimentQuerySummarySchema),
|
|
23408
23717
|
/**
|
|
23409
23718
|
* Branded reads: the Properties with a mixed or unfavorable rating, most criticized first
|
|
23410
23719
|
* ({@link rankCriticizedProperties}). `keys` are the first {@link SENTIMENT_CRITICIZED_PROPERTY_LIMIT}
|
|
23411
23720
|
* property breakdown keys; `total` counts them all; `{ total: 0, keys: [] }` with fewer than two
|
|
23412
23721
|
* Properties in view. Absent from older servers, comparison periods, and non-brand, disabled or unavailable reads.
|
|
23413
23722
|
*/
|
|
23414
|
-
criticizedProperties:
|
|
23723
|
+
criticizedProperties: z81.object({ total: count, keys: z81.array(z81.string()) }).strict().optional(),
|
|
23415
23724
|
/** Present on the paged summary read; follow `nextCursor` as `queryCursor` for the next query rows. */
|
|
23416
|
-
queryPage:
|
|
23725
|
+
queryPage: z81.object({ total: count, limit: count, nextCursor: z81.string().nullable() }).strict().optional()
|
|
23417
23726
|
}).strict();
|
|
23418
23727
|
var SENTIMENT_CRITICIZED_PROPERTY_LIMIT = 5;
|
|
23419
23728
|
function rankCriticizedProperties(rows) {
|
|
@@ -23424,91 +23733,91 @@ function rankCriticizedProperties(rows) {
|
|
|
23424
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));
|
|
23425
23734
|
return { total: criticized.length, keys: criticized.slice(0, SENTIMENT_CRITICIZED_PROPERTY_LIMIT).map((row) => row.key) };
|
|
23426
23735
|
}
|
|
23427
|
-
var sentimentSettingsUpdateSchema =
|
|
23428
|
-
var sentimentSettingsSchema =
|
|
23736
|
+
var sentimentSettingsUpdateSchema = z81.object({ enabled: z81.boolean().optional() }).strict();
|
|
23737
|
+
var sentimentSettingsSchema = z81.object({
|
|
23429
23738
|
provider: sentimentEvaluatorProviderSchema.optional(),
|
|
23430
|
-
installEnabled:
|
|
23431
|
-
enabled:
|
|
23432
|
-
ready:
|
|
23433
|
-
readinessReasons:
|
|
23434
|
-
model:
|
|
23739
|
+
installEnabled: z81.boolean(),
|
|
23740
|
+
enabled: z81.boolean(),
|
|
23741
|
+
ready: z81.boolean(),
|
|
23742
|
+
readinessReasons: z81.array(z81.string()),
|
|
23743
|
+
model: z81.string(),
|
|
23435
23744
|
enablementEpoch: count,
|
|
23436
23745
|
completionBoundary: count,
|
|
23437
23746
|
evaluationDefinitionId: id.nullable(),
|
|
23438
|
-
actions:
|
|
23439
|
-
experimental:
|
|
23440
|
-
disclosure:
|
|
23441
|
-
}).strict();
|
|
23442
|
-
var sentimentBackfillSelectionSchema = sentimentSelectionBaseSchema.extend({ runIds: runIds.optional(), from:
|
|
23443
|
-
var sentimentBackfillRequestSchema =
|
|
23444
|
-
var sentimentBackfillPreviewSchema =
|
|
23445
|
-
previewToken:
|
|
23446
|
-
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(),
|
|
23447
23756
|
selection: sentimentBackfillSelectionSchema,
|
|
23448
23757
|
evaluationDefinitionId: id.nullable(),
|
|
23449
23758
|
eligibleAssessments: count,
|
|
23450
23759
|
alreadyClassified: count,
|
|
23451
|
-
skipped:
|
|
23760
|
+
skipped: z81.array(z81.object({ runId: id, reason: z81.string(), count }).strict()),
|
|
23452
23761
|
estimatedInputTokens: count,
|
|
23453
|
-
estimatedCostUsd:
|
|
23454
|
-
estimateMethod:
|
|
23762
|
+
estimatedCostUsd: z81.number().nonnegative().nullable(),
|
|
23763
|
+
estimateMethod: z81.string()
|
|
23455
23764
|
}).strict();
|
|
23456
|
-
var sentimentJobStateSchema =
|
|
23457
|
-
var sentimentAttemptReceiptSchema =
|
|
23458
|
-
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({
|
|
23459
23768
|
id,
|
|
23460
23769
|
projectId: id,
|
|
23461
|
-
origin:
|
|
23770
|
+
origin: z81.enum(["automatic", "backfill"]),
|
|
23462
23771
|
state: sentimentJobStateSchema,
|
|
23463
23772
|
enablementEpoch: count,
|
|
23464
23773
|
evaluationDefinitionId: id,
|
|
23465
23774
|
selection: sentimentBackfillSelectionSchema,
|
|
23466
|
-
createdAt:
|
|
23467
|
-
updatedAt:
|
|
23775
|
+
createdAt: z81.string(),
|
|
23776
|
+
updatedAt: z81.string(),
|
|
23468
23777
|
counts: sentimentCountsSchema,
|
|
23469
23778
|
selected: count,
|
|
23470
|
-
cancellationReason:
|
|
23471
|
-
attempts:
|
|
23779
|
+
cancellationReason: z81.string().nullable(),
|
|
23780
|
+
attempts: z81.array(sentimentAttemptReceiptSchema),
|
|
23472
23781
|
/** Paged job read: every attempt of the job, and the cursor for the next (older) attempts. */
|
|
23473
23782
|
attemptCount: count.optional(),
|
|
23474
|
-
nextAttemptCursor:
|
|
23783
|
+
nextAttemptCursor: z81.string().nullable().optional()
|
|
23475
23784
|
}).strict();
|
|
23476
23785
|
var sentimentJobSummarySchema = sentimentJobSchema.omit({ attempts: true, attemptCount: true, nextAttemptCursor: true }).extend({ attemptCount: count }).strict();
|
|
23477
|
-
var sentimentJobsSchema =
|
|
23786
|
+
var sentimentJobsSchema = z81.object({ jobs: z81.array(sentimentJobSummarySchema) }).strict();
|
|
23478
23787
|
var SENTIMENT_ATTEMPT_PAGE_DEFAULT = 50;
|
|
23479
|
-
var sentimentJobRequestSchema =
|
|
23480
|
-
attemptLimit:
|
|
23481
|
-
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()
|
|
23482
23791
|
}).strict();
|
|
23483
|
-
var sentimentEvidenceItemSchema =
|
|
23792
|
+
var sentimentEvidenceItemSchema = z81.object({
|
|
23484
23793
|
assessmentId: id,
|
|
23485
23794
|
runId: id,
|
|
23486
23795
|
sourceSnapshotId: id,
|
|
23487
|
-
sourceText:
|
|
23796
|
+
sourceText: z81.string(),
|
|
23488
23797
|
sourceTextHash: id,
|
|
23489
23798
|
subject: sentimentSubjectSchema,
|
|
23490
23799
|
subjectHash: id,
|
|
23491
23800
|
context: sentimentExecutionContextSchema,
|
|
23492
23801
|
evaluationDefinitionId: id,
|
|
23493
23802
|
outcome: sentimentOutcomeSchema,
|
|
23494
|
-
conclusion:
|
|
23495
|
-
complaint:
|
|
23496
|
-
returnedModel:
|
|
23497
|
-
reason:
|
|
23803
|
+
conclusion: z81.array(sentimentEvidenceSchema),
|
|
23804
|
+
complaint: z81.array(sentimentEvidenceSchema).nullable(),
|
|
23805
|
+
returnedModel: z81.string().nullable(),
|
|
23806
|
+
reason: z81.string().nullable()
|
|
23498
23807
|
}).strict();
|
|
23499
|
-
var sentimentEvidencePageSchema =
|
|
23500
|
-
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({
|
|
23501
23810
|
from: sentimentSummarySchema,
|
|
23502
23811
|
to: sentimentSummarySchema,
|
|
23503
|
-
verdict:
|
|
23504
|
-
favorableRateDelta:
|
|
23505
|
-
refusalReasons:
|
|
23812
|
+
verdict: z81.enum(["improved", "declined", "no-clear-change"]).nullable(),
|
|
23813
|
+
favorableRateDelta: z81.number().nullable(),
|
|
23814
|
+
refusalReasons: z81.array(z81.string()),
|
|
23506
23815
|
commonUnits: count,
|
|
23507
23816
|
excludedFrom: count,
|
|
23508
23817
|
excludedTo: count,
|
|
23509
|
-
changedScope:
|
|
23510
|
-
method:
|
|
23511
|
-
limitation:
|
|
23818
|
+
changedScope: z81.boolean(),
|
|
23819
|
+
method: z81.literal("wilson-independent-v1"),
|
|
23820
|
+
limitation: z81.string()
|
|
23512
23821
|
}).strict();
|
|
23513
23822
|
function emptySentimentCounts() {
|
|
23514
23823
|
return Object.fromEntries(sentimentOutcomeSchema.options.map((outcome) => [outcome, 0]));
|
|
@@ -23545,7 +23854,7 @@ function aggregateSentiment(items, options = {}) {
|
|
|
23545
23854
|
}
|
|
23546
23855
|
|
|
23547
23856
|
// ../contracts/src/composites.ts
|
|
23548
|
-
import { z as
|
|
23857
|
+
import { z as z82 } from "zod";
|
|
23549
23858
|
var PROJECT_OVERVIEW_QUERY_CLASS_SCOPE = {
|
|
23550
23859
|
queryClass: "all",
|
|
23551
23860
|
figures: [
|
|
@@ -23567,26 +23876,26 @@ var PROJECT_OVERVIEW_QUERY_CLASS_SCOPE = {
|
|
|
23567
23876
|
],
|
|
23568
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."
|
|
23569
23878
|
};
|
|
23570
|
-
var metricToneSchema =
|
|
23571
|
-
var scoreSummarySchema =
|
|
23572
|
-
label:
|
|
23573
|
-
value:
|
|
23574
|
-
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(),
|
|
23575
23884
|
tone: metricToneSchema,
|
|
23576
|
-
description:
|
|
23577
|
-
tooltip:
|
|
23578
|
-
trend:
|
|
23885
|
+
description: z82.string(),
|
|
23886
|
+
tooltip: z82.string().optional(),
|
|
23887
|
+
trend: z82.array(percent()),
|
|
23579
23888
|
progress: percent().optional(),
|
|
23580
|
-
providerCoverage:
|
|
23889
|
+
providerCoverage: z82.string().optional()
|
|
23581
23890
|
});
|
|
23582
|
-
var mentionShareBreakdownSchema =
|
|
23583
|
-
projectMentionSnapshots:
|
|
23584
|
-
competitorMentionSnapshots:
|
|
23891
|
+
var mentionShareBreakdownSchema = z82.object({
|
|
23892
|
+
projectMentionSnapshots: z82.number().int().nonnegative(),
|
|
23893
|
+
competitorMentionSnapshots: z82.number().int().nonnegative(),
|
|
23585
23894
|
/** `projectMentionSnapshots + competitorMentionSnapshots`, the denominator of `score` and every `ranking` share. */
|
|
23586
|
-
combinedMentionSnapshots:
|
|
23587
|
-
perCompetitor:
|
|
23588
|
-
domain:
|
|
23589
|
-
mentionSnapshots:
|
|
23895
|
+
combinedMentionSnapshots: z82.number().int().nonnegative(),
|
|
23896
|
+
perCompetitor: z82.array(z82.object({
|
|
23897
|
+
domain: z82.string(),
|
|
23898
|
+
mentionSnapshots: z82.number().int().nonnegative(),
|
|
23590
23899
|
shareOfCompetitiveTotal: percent()
|
|
23591
23900
|
})),
|
|
23592
23901
|
/**
|
|
@@ -23596,50 +23905,50 @@ var mentionShareBreakdownSchema = z81.object({
|
|
|
23596
23905
|
* Empty when there is no head-to-head: no tracked competitors, or no brand
|
|
23597
23906
|
* named in this class.
|
|
23598
23907
|
*/
|
|
23599
|
-
ranking:
|
|
23600
|
-
kind:
|
|
23908
|
+
ranking: z82.array(z82.object({
|
|
23909
|
+
kind: z82.enum(["project", "competitor"]),
|
|
23601
23910
|
/** The tracked competitor's domain. Null on the project's row. */
|
|
23602
|
-
domain:
|
|
23603
|
-
mentionSnapshots:
|
|
23604
|
-
share: fraction(
|
|
23911
|
+
domain: z82.string().nullable(),
|
|
23912
|
+
mentionSnapshots: z82.number().int().nonnegative(),
|
|
23913
|
+
share: fraction(z82.number().min(0).max(1))
|
|
23605
23914
|
})),
|
|
23606
|
-
snapshotsWithAnswerText:
|
|
23607
|
-
snapshotsTotal:
|
|
23608
|
-
score: percent(
|
|
23915
|
+
snapshotsWithAnswerText: z82.number().int().nonnegative(),
|
|
23916
|
+
snapshotsTotal: z82.number().int().nonnegative(),
|
|
23917
|
+
score: percent(z82.number().min(0).max(100)).nullable()
|
|
23609
23918
|
});
|
|
23610
23919
|
var mentionShareSchema = scoreSummarySchema.extend({
|
|
23611
23920
|
/** Non-brand queries — the competitive figure. See `MentionShareDto`. */
|
|
23612
23921
|
breakdown: mentionShareBreakdownSchema,
|
|
23613
|
-
scope:
|
|
23922
|
+
scope: z82.enum(["non-brand", "pooled"]),
|
|
23614
23923
|
/** Branded queries, beside the competitive figure and never inside it. */
|
|
23615
23924
|
branded: mentionShareBreakdownSchema
|
|
23616
23925
|
});
|
|
23617
|
-
var movementSummarySchema =
|
|
23618
|
-
gained:
|
|
23619
|
-
lost:
|
|
23926
|
+
var movementSummarySchema = z82.object({
|
|
23927
|
+
gained: z82.number().int().nonnegative(),
|
|
23928
|
+
lost: z82.number().int().nonnegative(),
|
|
23620
23929
|
tone: metricToneSchema,
|
|
23621
|
-
hasPreviousRun:
|
|
23622
|
-
gainedQueries:
|
|
23623
|
-
lostQueries:
|
|
23624
|
-
});
|
|
23625
|
-
var movementComparisonSchema =
|
|
23626
|
-
hasPreviousRun:
|
|
23627
|
-
comparable:
|
|
23628
|
-
querySetChanged:
|
|
23629
|
-
previousRunAt:
|
|
23630
|
-
currentQueryCount:
|
|
23631
|
-
previousQueryCount:
|
|
23632
|
-
comparableQueryCount:
|
|
23633
|
-
addedQueryCount:
|
|
23634
|
-
removedQueryCount:
|
|
23635
|
-
addedQueries:
|
|
23636
|
-
removedQueries:
|
|
23637
|
-
});
|
|
23638
|
-
var projectOverviewInsightSchema =
|
|
23639
|
-
id:
|
|
23640
|
-
projectId:
|
|
23641
|
-
runId:
|
|
23642
|
-
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([
|
|
23643
23952
|
"regression",
|
|
23644
23953
|
"gain",
|
|
23645
23954
|
"opportunity",
|
|
@@ -23656,75 +23965,75 @@ var projectOverviewInsightSchema = z81.object({
|
|
|
23656
23965
|
"gbp-keyword-drop"
|
|
23657
23966
|
]),
|
|
23658
23967
|
severity: insightSeveritySchema,
|
|
23659
|
-
title:
|
|
23660
|
-
query:
|
|
23661
|
-
provider:
|
|
23662
|
-
recommendation:
|
|
23663
|
-
action:
|
|
23664
|
-
target:
|
|
23665
|
-
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()
|
|
23666
23975
|
}).optional(),
|
|
23667
|
-
cause:
|
|
23668
|
-
cause:
|
|
23669
|
-
competitorDomain:
|
|
23670
|
-
details:
|
|
23976
|
+
cause: z82.object({
|
|
23977
|
+
cause: z82.string(),
|
|
23978
|
+
competitorDomain: z82.string().optional(),
|
|
23979
|
+
details: z82.string().optional()
|
|
23671
23980
|
}).optional(),
|
|
23672
|
-
dismissed:
|
|
23673
|
-
createdAt:
|
|
23981
|
+
dismissed: z82.boolean(),
|
|
23982
|
+
createdAt: z82.string()
|
|
23674
23983
|
});
|
|
23675
|
-
var projectOverviewHealthSchema =
|
|
23676
|
-
id:
|
|
23677
|
-
projectId:
|
|
23678
|
-
runId:
|
|
23984
|
+
var projectOverviewHealthSchema = z82.object({
|
|
23985
|
+
id: z82.string(),
|
|
23986
|
+
projectId: z82.string(),
|
|
23987
|
+
runId: z82.string().nullable(),
|
|
23679
23988
|
overallCitedRate: fraction(),
|
|
23680
23989
|
overallMentionRate: fraction(),
|
|
23681
|
-
totalPairs:
|
|
23682
|
-
citedPairs:
|
|
23683
|
-
mentionedPairs:
|
|
23684
|
-
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({
|
|
23685
23994
|
citedRate: fraction(),
|
|
23686
23995
|
mentionRate: fraction(),
|
|
23687
|
-
cited:
|
|
23688
|
-
mentioned:
|
|
23689
|
-
total:
|
|
23996
|
+
cited: z82.number().int().nonnegative(),
|
|
23997
|
+
mentioned: z82.number().int().nonnegative(),
|
|
23998
|
+
total: z82.number().int().nonnegative()
|
|
23690
23999
|
})),
|
|
23691
|
-
createdAt:
|
|
23692
|
-
status:
|
|
23693
|
-
reason:
|
|
24000
|
+
createdAt: z82.string(),
|
|
24001
|
+
status: z82.enum(["ready", "no-data"]),
|
|
24002
|
+
reason: z82.literal("no-runs-yet").optional()
|
|
23694
24003
|
});
|
|
23695
|
-
var projectOverviewDtoSchema =
|
|
24004
|
+
var projectOverviewDtoSchema = z82.object({
|
|
23696
24005
|
sentiment: sentimentOverviewSchema.optional(),
|
|
23697
24006
|
project: projectDtoSchema,
|
|
23698
24007
|
latestRun: latestProjectRunDtoSchema,
|
|
23699
24008
|
health: projectOverviewHealthSchema.nullable(),
|
|
23700
|
-
topInsights:
|
|
23701
|
-
queryClassScope:
|
|
23702
|
-
queryClass:
|
|
23703
|
-
figures:
|
|
23704
|
-
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()
|
|
23705
24014
|
}).optional(),
|
|
23706
|
-
queryCounts:
|
|
23707
|
-
totalQueries:
|
|
23708
|
-
citedQueries:
|
|
23709
|
-
notCitedQueries:
|
|
24015
|
+
queryCounts: z82.object({
|
|
24016
|
+
totalQueries: z82.number().int().nonnegative(),
|
|
24017
|
+
citedQueries: z82.number().int().nonnegative(),
|
|
24018
|
+
notCitedQueries: z82.number().int().nonnegative(),
|
|
23710
24019
|
citedRate: fraction(),
|
|
23711
|
-
mentionedQueries:
|
|
23712
|
-
notMentionedQueries:
|
|
24020
|
+
mentionedQueries: z82.number().int().nonnegative(),
|
|
24021
|
+
notMentionedQueries: z82.number().int().nonnegative(),
|
|
23713
24022
|
mentionRate: fraction()
|
|
23714
24023
|
}),
|
|
23715
|
-
providers:
|
|
23716
|
-
provider:
|
|
24024
|
+
providers: z82.array(z82.object({
|
|
24025
|
+
provider: z82.string(),
|
|
23717
24026
|
citedRate: fraction(),
|
|
23718
|
-
cited:
|
|
23719
|
-
total:
|
|
24027
|
+
cited: z82.number().int().nonnegative(),
|
|
24028
|
+
total: z82.number().int().nonnegative()
|
|
23720
24029
|
})),
|
|
23721
|
-
transitions:
|
|
23722
|
-
since:
|
|
23723
|
-
gained:
|
|
23724
|
-
lost:
|
|
23725
|
-
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()
|
|
23726
24035
|
}),
|
|
23727
|
-
scores:
|
|
24036
|
+
scores: z82.object({
|
|
23728
24037
|
mention: scoreSummarySchema,
|
|
23729
24038
|
visibility: scoreSummarySchema,
|
|
23730
24039
|
mentionShare: mentionShareSchema,
|
|
@@ -23738,74 +24047,74 @@ var projectOverviewDtoSchema = z81.object({
|
|
|
23738
24047
|
citationMovement: movementSummarySchema,
|
|
23739
24048
|
mentionMovement: movementSummarySchema,
|
|
23740
24049
|
movementComparison: movementComparisonSchema,
|
|
23741
|
-
competitors:
|
|
23742
|
-
id:
|
|
23743
|
-
domain:
|
|
23744
|
-
aliases:
|
|
23745
|
-
autoAliasNames:
|
|
23746
|
-
citationCount:
|
|
23747
|
-
totalQueries:
|
|
23748
|
-
pressureLabel:
|
|
23749
|
-
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())
|
|
23750
24059
|
})),
|
|
23751
|
-
providerScores:
|
|
23752
|
-
provider:
|
|
23753
|
-
model:
|
|
24060
|
+
providerScores: z82.array(z82.object({
|
|
24061
|
+
provider: z82.string(),
|
|
24062
|
+
model: z82.string().nullable(),
|
|
23754
24063
|
score: percent(),
|
|
23755
|
-
cited:
|
|
23756
|
-
total:
|
|
23757
|
-
trend:
|
|
24064
|
+
cited: z82.number().int().nonnegative(),
|
|
24065
|
+
total: z82.number().int().nonnegative(),
|
|
24066
|
+
trend: z82.array(percent()).optional()
|
|
23758
24067
|
})),
|
|
23759
|
-
attentionItems:
|
|
23760
|
-
id:
|
|
24068
|
+
attentionItems: z82.array(z82.object({
|
|
24069
|
+
id: z82.string(),
|
|
23761
24070
|
tone: metricToneSchema,
|
|
23762
|
-
title:
|
|
23763
|
-
detail:
|
|
23764
|
-
actionLabel:
|
|
23765
|
-
href:
|
|
24071
|
+
title: z82.string(),
|
|
24072
|
+
detail: z82.string(),
|
|
24073
|
+
actionLabel: z82.string(),
|
|
24074
|
+
href: z82.string()
|
|
23766
24075
|
})),
|
|
23767
|
-
runHistory:
|
|
23768
|
-
runId:
|
|
23769
|
-
createdAt:
|
|
23770
|
-
citedCount:
|
|
23771
|
-
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(),
|
|
23772
24081
|
citationRate: percent(),
|
|
23773
|
-
mentionedCount:
|
|
24082
|
+
mentionedCount: z82.number().int().nonnegative(),
|
|
23774
24083
|
mentionRate: percent(),
|
|
23775
|
-
status:
|
|
24084
|
+
status: z82.string()
|
|
23776
24085
|
})),
|
|
23777
|
-
suggestedQueries:
|
|
23778
|
-
rows:
|
|
23779
|
-
query:
|
|
23780
|
-
impressions:
|
|
23781
|
-
clicks:
|
|
23782
|
-
avgPosition:
|
|
23783
|
-
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()
|
|
23784
24093
|
})),
|
|
23785
|
-
totalCandidates:
|
|
23786
|
-
skippedAlreadyTracked:
|
|
24094
|
+
totalCandidates: z82.number().int().nonnegative(),
|
|
24095
|
+
skippedAlreadyTracked: z82.number().int().nonnegative()
|
|
23787
24096
|
}),
|
|
23788
|
-
dateRangeLabel:
|
|
23789
|
-
contextLabel:
|
|
23790
|
-
});
|
|
23791
|
-
var searchHitKindSchema =
|
|
23792
|
-
var projectSearchSnapshotHitSchema =
|
|
23793
|
-
kind:
|
|
23794
|
-
id:
|
|
23795
|
-
runId:
|
|
23796
|
-
query:
|
|
23797
|
-
provider:
|
|
23798
|
-
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(),
|
|
23799
24108
|
citationState: citationStateSchema,
|
|
23800
|
-
matchedField:
|
|
23801
|
-
snippet:
|
|
23802
|
-
createdAt:
|
|
23803
|
-
});
|
|
23804
|
-
var projectSearchInsightHitSchema =
|
|
23805
|
-
kind:
|
|
23806
|
-
id:
|
|
23807
|
-
runId:
|
|
23808
|
-
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([
|
|
23809
24118
|
"regression",
|
|
23810
24119
|
"gain",
|
|
23811
24120
|
"opportunity",
|
|
@@ -23823,23 +24132,23 @@ var projectSearchInsightHitSchema = z81.object({
|
|
|
23823
24132
|
"gbp-keyword-drop"
|
|
23824
24133
|
]),
|
|
23825
24134
|
severity: insightSeveritySchema,
|
|
23826
|
-
title:
|
|
23827
|
-
query:
|
|
23828
|
-
provider:
|
|
23829
|
-
matchedField:
|
|
23830
|
-
snippet:
|
|
23831
|
-
dismissed:
|
|
23832
|
-
createdAt:
|
|
23833
|
-
});
|
|
23834
|
-
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", [
|
|
23835
24144
|
projectSearchSnapshotHitSchema,
|
|
23836
24145
|
projectSearchInsightHitSchema
|
|
23837
24146
|
]);
|
|
23838
|
-
var projectSearchResponseSchema =
|
|
23839
|
-
query:
|
|
23840
|
-
totalHits:
|
|
23841
|
-
truncated:
|
|
23842
|
-
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)
|
|
23843
24152
|
});
|
|
23844
24153
|
|
|
23845
24154
|
// ../contracts/src/index-coverage.ts
|
|
@@ -23903,52 +24212,52 @@ function summarizeObservedQueryCounts(snapshots) {
|
|
|
23903
24212
|
}
|
|
23904
24213
|
|
|
23905
24214
|
// ../contracts/src/citations.ts
|
|
23906
|
-
import { z as
|
|
23907
|
-
var citationCoverageProviderSchema =
|
|
23908
|
-
provider:
|
|
24215
|
+
import { z as z83 } from "zod";
|
|
24216
|
+
var citationCoverageProviderSchema = z83.object({
|
|
24217
|
+
provider: z83.string(),
|
|
23909
24218
|
citationState: citationStateSchema,
|
|
23910
|
-
cited:
|
|
23911
|
-
mentioned:
|
|
23912
|
-
runId:
|
|
23913
|
-
runCreatedAt:
|
|
23914
|
-
});
|
|
23915
|
-
var citationCoverageRowSchema =
|
|
23916
|
-
queryId:
|
|
23917
|
-
query:
|
|
23918
|
-
providers:
|
|
23919
|
-
citedCount:
|
|
23920
|
-
mentionedCount:
|
|
23921
|
-
totalProviders:
|
|
23922
|
-
});
|
|
23923
|
-
var competitorGapRowSchema =
|
|
23924
|
-
queryId:
|
|
23925
|
-
query:
|
|
23926
|
-
provider:
|
|
23927
|
-
citingCompetitors:
|
|
23928
|
-
runId:
|
|
23929
|
-
runCreatedAt:
|
|
23930
|
-
});
|
|
23931
|
-
var citationVisibilitySummarySchema =
|
|
23932
|
-
providersConfigured:
|
|
23933
|
-
providersCiting:
|
|
23934
|
-
providersMentioning:
|
|
23935
|
-
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(),
|
|
23936
24245
|
// Cross-tab buckets — each tracked query with at least one snapshot lands
|
|
23937
24246
|
// in exactly one of these. Queries with zero snapshots are not counted in
|
|
23938
24247
|
// any bucket; (sum of buckets) ≤ totalQueries.
|
|
23939
|
-
queriesCitedAndMentioned:
|
|
23940
|
-
queriesCitedOnly:
|
|
23941
|
-
queriesMentionedOnly:
|
|
23942
|
-
queriesInvisible:
|
|
23943
|
-
latestRunId:
|
|
23944
|
-
latestRunAt:
|
|
23945
|
-
});
|
|
23946
|
-
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({
|
|
23947
24256
|
summary: citationVisibilitySummarySchema,
|
|
23948
|
-
byQuery:
|
|
23949
|
-
competitorGaps:
|
|
23950
|
-
status:
|
|
23951
|
-
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()
|
|
23952
24261
|
});
|
|
23953
24262
|
function emptyCitationVisibility(reason) {
|
|
23954
24263
|
return {
|
|
@@ -23975,103 +24284,103 @@ function citationStateToCited(state) {
|
|
|
23975
24284
|
}
|
|
23976
24285
|
|
|
23977
24286
|
// ../contracts/src/organic-evidence.ts
|
|
23978
|
-
import { z as
|
|
23979
|
-
var organicEvidencePeriodSchema =
|
|
24287
|
+
import { z as z84 } from "zod";
|
|
24288
|
+
var organicEvidencePeriodSchema = z84.union(windowDayValues(WINDOW_SETS.organicEvidence).map((value) => z84.literal(value)));
|
|
23980
24289
|
function parseOrganicEvidencePeriod(value) {
|
|
23981
24290
|
return windowDays(parseWindowIn(value, WINDOW_SETS.organicEvidence, { field: "period", fallback: "90d" }));
|
|
23982
24291
|
}
|
|
23983
|
-
var cohortNameSchema =
|
|
23984
|
-
var countSchema =
|
|
23985
|
-
clicks:
|
|
23986
|
-
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()
|
|
23987
24296
|
});
|
|
23988
|
-
var cohortSchema =
|
|
24297
|
+
var cohortSchema = z84.object({
|
|
23989
24298
|
name: cohortNameSchema,
|
|
23990
|
-
startDate:
|
|
23991
|
-
endDate:
|
|
24299
|
+
startDate: z84.string(),
|
|
24300
|
+
endDate: z84.string()
|
|
23992
24301
|
});
|
|
23993
24302
|
var searchCohortSchema = cohortSchema.extend({ totals: countSchema });
|
|
23994
24303
|
var sessionCohortSchema = cohortSchema.extend({
|
|
23995
|
-
organicSessions:
|
|
23996
|
-
});
|
|
23997
|
-
var sourceCoverageSchema =
|
|
23998
|
-
startDate:
|
|
23999
|
-
endDate:
|
|
24000
|
-
observedDays:
|
|
24001
|
-
});
|
|
24002
|
-
var crawlerCountsSchema =
|
|
24003
|
-
verified:
|
|
24004
|
-
claimedUnverified:
|
|
24005
|
-
unknownAiLike:
|
|
24006
|
-
});
|
|
24007
|
-
var referralCountsSchema =
|
|
24008
|
-
total:
|
|
24009
|
-
paid:
|
|
24010
|
-
organic:
|
|
24011
|
-
unknown:
|
|
24012
|
-
});
|
|
24013
|
-
var organicEvidenceDtoSchema =
|
|
24014
|
-
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"),
|
|
24015
24324
|
periodDays: organicEvidencePeriodSchema,
|
|
24016
24325
|
/** Latest headline evidence date, preferring the GSC property date when available. */
|
|
24017
|
-
asOfDate:
|
|
24018
|
-
coverage:
|
|
24019
|
-
gsc:
|
|
24020
|
-
ga4:
|
|
24021
|
-
server:
|
|
24022
|
-
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()
|
|
24023
24332
|
}),
|
|
24024
|
-
sourceCoverage:
|
|
24333
|
+
sourceCoverage: z84.object({
|
|
24025
24334
|
gsc: sourceCoverageSchema.nullable(),
|
|
24026
24335
|
ga4: sourceCoverageSchema.nullable(),
|
|
24027
24336
|
server: sourceCoverageSchema.nullable(),
|
|
24028
|
-
visibility:
|
|
24337
|
+
visibility: z84.object({ completedAt: z84.string(), ageDays: z84.number().nonnegative() }).nullable()
|
|
24029
24338
|
}),
|
|
24030
|
-
gsc:
|
|
24339
|
+
gsc: z84.object({
|
|
24031
24340
|
propertyTotals: countSchema,
|
|
24032
24341
|
namedBrand: countSchema,
|
|
24033
24342
|
namedNonBrand: countSchema,
|
|
24034
24343
|
suppressedOrUnreportedResidual: countSchema,
|
|
24035
|
-
cohorts:
|
|
24344
|
+
cohorts: z84.array(searchCohortSchema)
|
|
24036
24345
|
}).nullable(),
|
|
24037
|
-
ga4:
|
|
24038
|
-
organicSessions:
|
|
24039
|
-
cohorts:
|
|
24346
|
+
ga4: z84.object({
|
|
24347
|
+
organicSessions: z84.number().int().nonnegative(),
|
|
24348
|
+
cohorts: z84.array(sessionCohortSchema)
|
|
24040
24349
|
}).nullable(),
|
|
24041
|
-
gaAiReferrals:
|
|
24042
|
-
paidSessions:
|
|
24043
|
-
organicSessions:
|
|
24350
|
+
gaAiReferrals: z84.object({
|
|
24351
|
+
paidSessions: z84.number().int().nonnegative(),
|
|
24352
|
+
organicSessions: z84.number().int().nonnegative()
|
|
24044
24353
|
}).nullable(),
|
|
24045
|
-
server:
|
|
24354
|
+
server: z84.object({
|
|
24046
24355
|
crawlerHits: crawlerCountsSchema,
|
|
24047
24356
|
userFetchHits: crawlerCountsSchema,
|
|
24048
24357
|
referralSessions: referralCountsSchema
|
|
24049
24358
|
}).nullable(),
|
|
24050
|
-
visibility:
|
|
24051
|
-
runId:
|
|
24052
|
-
completedAt:
|
|
24053
|
-
ageDays:
|
|
24054
|
-
answerPairs:
|
|
24055
|
-
mentionedPairs:
|
|
24056
|
-
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()
|
|
24057
24366
|
}).nullable(),
|
|
24058
24367
|
measurement: gaMeasurementAnalysisDtoSchema,
|
|
24059
|
-
pages:
|
|
24060
|
-
path:
|
|
24368
|
+
pages: z84.array(z84.object({
|
|
24369
|
+
path: z84.string(),
|
|
24061
24370
|
gsc: countSchema,
|
|
24062
|
-
ga4OrganicSessions:
|
|
24063
|
-
server:
|
|
24371
|
+
ga4OrganicSessions: z84.number().int().nonnegative(),
|
|
24372
|
+
server: z84.object({
|
|
24064
24373
|
crawlerHits: crawlerCountsSchema,
|
|
24065
24374
|
userFetchHits: crawlerCountsSchema,
|
|
24066
24375
|
referralSessions: referralCountsSchema
|
|
24067
24376
|
})
|
|
24068
24377
|
})),
|
|
24069
|
-
findings:
|
|
24070
|
-
tone:
|
|
24071
|
-
title:
|
|
24072
|
-
detail:
|
|
24378
|
+
findings: z84.array(z84.object({
|
|
24379
|
+
tone: z84.enum(["positive", "caution", "neutral"]),
|
|
24380
|
+
title: z84.string(),
|
|
24381
|
+
detail: z84.string()
|
|
24073
24382
|
})),
|
|
24074
|
-
limitations:
|
|
24383
|
+
limitations: z84.array(z84.object({ code: z84.string(), detail: z84.string() }))
|
|
24075
24384
|
});
|
|
24076
24385
|
|
|
24077
24386
|
// ../contracts/src/traffic-path.ts
|
|
@@ -24369,9 +24678,9 @@ function serializeForInlineScript(value) {
|
|
|
24369
24678
|
}
|
|
24370
24679
|
|
|
24371
24680
|
// ../contracts/src/outcome-telemetry.ts
|
|
24372
|
-
import { z as
|
|
24681
|
+
import { z as z85 } from "zod";
|
|
24373
24682
|
var OUTCOME_SURFACES = ["cli", "mcp-stdio", "mcp-http", "aero", "api", "dashboard", "system"];
|
|
24374
|
-
var outcomeSurfaceSchema =
|
|
24683
|
+
var outcomeSurfaceSchema = z85.enum(OUTCOME_SURFACES);
|
|
24375
24684
|
var OutcomeSurfaces = outcomeSurfaceSchema.enum;
|
|
24376
24685
|
var INTEGRATION_NAMES = [
|
|
24377
24686
|
"provider",
|
|
@@ -24393,19 +24702,19 @@ var INTEGRATION_NAMES = [
|
|
|
24393
24702
|
/** The WordPress traffic-logger plugin source, apart from the WordPress publishing connection. */
|
|
24394
24703
|
"traffic_wordpress"
|
|
24395
24704
|
];
|
|
24396
|
-
var integrationNameSchema =
|
|
24705
|
+
var integrationNameSchema = z85.enum(INTEGRATION_NAMES);
|
|
24397
24706
|
var IntegrationNames = integrationNameSchema.enum;
|
|
24398
24707
|
var CONNECTION_ACTIONS = ["connect", "disconnect", "test", "reauth", "select"];
|
|
24399
|
-
var connectionActionSchema =
|
|
24708
|
+
var connectionActionSchema = z85.enum(CONNECTION_ACTIONS);
|
|
24400
24709
|
var ConnectionActions = connectionActionSchema.enum;
|
|
24401
24710
|
var CONNECTION_STATUSES = ["started", "succeeded", "failed", "cancelled"];
|
|
24402
|
-
var connectionStatusSchema =
|
|
24711
|
+
var connectionStatusSchema = z85.enum(CONNECTION_STATUSES);
|
|
24403
24712
|
var ConnectionStatuses = connectionStatusSchema.enum;
|
|
24404
24713
|
var OUTCOME_STATUSES = ["succeeded", "partial", "failed", "skipped", "cancelled"];
|
|
24405
|
-
var outcomeStatusSchema =
|
|
24714
|
+
var outcomeStatusSchema = z85.enum(OUTCOME_STATUSES);
|
|
24406
24715
|
var OutcomeStatuses = outcomeStatusSchema.enum;
|
|
24407
24716
|
var OUTCOME_TRIGGERS = ["manual", "scheduled", "agent", "startup", "retry", "push"];
|
|
24408
|
-
var outcomeTriggerSchema =
|
|
24717
|
+
var outcomeTriggerSchema = z85.enum(OUTCOME_TRIGGERS);
|
|
24409
24718
|
var OutcomeTriggers = outcomeTriggerSchema.enum;
|
|
24410
24719
|
var OUTCOME_REASON_CODES = [
|
|
24411
24720
|
"AUTH_DENIED",
|
|
@@ -24442,7 +24751,7 @@ var OUTCOME_REASON_CODES = [
|
|
|
24442
24751
|
"UNCAUGHT_EXCEPTION",
|
|
24443
24752
|
"UNHANDLED_REJECTION"
|
|
24444
24753
|
];
|
|
24445
|
-
var outcomeReasonCodeSchema =
|
|
24754
|
+
var outcomeReasonCodeSchema = z85.enum(OUTCOME_REASON_CODES);
|
|
24446
24755
|
var OutcomeReasonCodes = outcomeReasonCodeSchema.enum;
|
|
24447
24756
|
var FEATURE_OPERATIONS = {
|
|
24448
24757
|
search_console: ["sync", "inspect", "sitemap_submit"],
|
|
@@ -24472,7 +24781,7 @@ var FEATURE_OPERATIONS = {
|
|
|
24472
24781
|
server: ["start", "crash"]
|
|
24473
24782
|
};
|
|
24474
24783
|
var FEATURE_NAMES = Object.keys(FEATURE_OPERATIONS);
|
|
24475
|
-
var featureNameSchema =
|
|
24784
|
+
var featureNameSchema = z85.enum(FEATURE_NAMES);
|
|
24476
24785
|
var FeatureNames = featureNameSchema.enum;
|
|
24477
24786
|
var OUTCOME_COUNT_KEYS = [
|
|
24478
24787
|
"rows",
|
|
@@ -24510,16 +24819,16 @@ var OUTCOME_COUNT_KEYS = [
|
|
|
24510
24819
|
];
|
|
24511
24820
|
var COUNT_KEY_SET = new Set(OUTCOME_COUNT_KEYS);
|
|
24512
24821
|
var MAX_COUNT = 1e12;
|
|
24513
|
-
var countValueSchema =
|
|
24514
|
-
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");
|
|
24515
24824
|
var WEBHOOK_TARGETS = ["first_party", "slack", "discord"];
|
|
24516
|
-
var webhookTargetSchema =
|
|
24825
|
+
var webhookTargetSchema = z85.enum(WEBHOOK_TARGETS);
|
|
24517
24826
|
var WebhookTargets = webhookTargetSchema.enum;
|
|
24518
24827
|
var STATUS_CLASSES = ["2xx", "3xx", "4xx", "5xx", "timeout", "network", "blocked"];
|
|
24519
|
-
var statusClassSchema =
|
|
24828
|
+
var statusClassSchema = z85.enum(STATUS_CLASSES);
|
|
24520
24829
|
var StatusClasses = statusClassSchema.enum;
|
|
24521
24830
|
var DURATION_BUCKETS = ["under_1s", "1s_to_10s", "10s_to_1m", "1m_to_5m", "5m_to_30m", "30m_or_more"];
|
|
24522
|
-
var durationBucketSchema =
|
|
24831
|
+
var durationBucketSchema = z85.enum(DURATION_BUCKETS);
|
|
24523
24832
|
var DurationBuckets = durationBucketSchema.enum;
|
|
24524
24833
|
function bucketDuration(durationMs) {
|
|
24525
24834
|
const duration = Number.isFinite(durationMs) ? Math.max(0, durationMs) : 0;
|
|
@@ -24530,12 +24839,12 @@ function bucketDuration(durationMs) {
|
|
|
24530
24839
|
if (duration < 18e5) return "5m_to_30m";
|
|
24531
24840
|
return "30m_or_more";
|
|
24532
24841
|
}
|
|
24533
|
-
var errorNameSchema =
|
|
24534
|
-
var agentSlugSchema =
|
|
24535
|
-
var providerNameSchema2 =
|
|
24536
|
-
var modelIdSchema2 =
|
|
24537
|
-
var slugSchema =
|
|
24538
|
-
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({
|
|
24539
24848
|
integration: integrationNameSchema,
|
|
24540
24849
|
provider: providerNameSchema2.optional(),
|
|
24541
24850
|
action: connectionActionSchema,
|
|
@@ -24546,9 +24855,9 @@ var integrationConnectionPropertiesSchema = z84.object({
|
|
|
24546
24855
|
surface: outcomeSurfaceSchema.optional(),
|
|
24547
24856
|
agent: agentSlugSchema.optional(),
|
|
24548
24857
|
durationBucket: durationBucketSchema.optional(),
|
|
24549
|
-
attempt:
|
|
24858
|
+
attempt: z85.number().int().min(1).max(1e6).optional(),
|
|
24550
24859
|
/** The install's first success of this kind; set by the helpers, never by callers. */
|
|
24551
|
-
first:
|
|
24860
|
+
first: z85.literal(true).optional()
|
|
24552
24861
|
}).strict().refine(
|
|
24553
24862
|
(p) => p.integration === IntegrationNames.provider === (p.provider !== void 0),
|
|
24554
24863
|
"provider is required for, and only for, integration provider"
|
|
@@ -24556,9 +24865,9 @@ var integrationConnectionPropertiesSchema = z84.object({
|
|
|
24556
24865
|
(p) => p.status === ConnectionStatuses.succeeded || p.status === ConnectionStatuses.started || p.reasonCode !== void 0,
|
|
24557
24866
|
"a failed or cancelled attempt needs a reasonCode"
|
|
24558
24867
|
);
|
|
24559
|
-
var featureCompletedPropertiesSchema =
|
|
24868
|
+
var featureCompletedPropertiesSchema = z85.object({
|
|
24560
24869
|
feature: featureNameSchema,
|
|
24561
|
-
operation:
|
|
24870
|
+
operation: z85.string().regex(/^[a-z][a-z_]{0,31}$/),
|
|
24562
24871
|
status: outcomeStatusSchema,
|
|
24563
24872
|
trigger: outcomeTriggerSchema.optional(),
|
|
24564
24873
|
surface: outcomeSurfaceSchema.optional(),
|
|
@@ -24573,17 +24882,17 @@ var featureCompletedPropertiesSchema = z84.object({
|
|
|
24573
24882
|
provider: providerNameSchema2.optional(),
|
|
24574
24883
|
model: modelIdSchema2.optional(),
|
|
24575
24884
|
modelProvider: slugSchema.optional(),
|
|
24576
|
-
sampleRate:
|
|
24577
|
-
droppedBefore:
|
|
24578
|
-
domainHash:
|
|
24579
|
-
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()
|
|
24580
24889
|
}).strict().refine(
|
|
24581
24890
|
(p) => FEATURE_OPERATIONS[p.feature].includes(p.operation),
|
|
24582
24891
|
"operation is not one this feature reports"
|
|
24583
24892
|
).refine((p) => p.status === OutcomeStatuses.succeeded || p.reasonCode !== void 0, "a non-succeeded outcome needs a reasonCode");
|
|
24584
24893
|
var INSTALL_SOURCES = ["npm", "homebrew", "docker", "source"];
|
|
24585
|
-
var installSourceSchema =
|
|
24586
|
-
var installRefSchema =
|
|
24894
|
+
var installSourceSchema = z85.enum(INSTALL_SOURCES);
|
|
24895
|
+
var installRefSchema = z85.string().regex(/^[a-z0-9][a-z0-9-]{0,31}$/);
|
|
24587
24896
|
function normalizeInstallRef(value) {
|
|
24588
24897
|
const ref = value?.trim().toLowerCase();
|
|
24589
24898
|
return ref && installRefSchema.safeParse(ref).success ? ref : void 0;
|
|
@@ -24618,11 +24927,11 @@ var INSTALL_STATE_USAGE_KEYS = [
|
|
|
24618
24927
|
];
|
|
24619
24928
|
var fixedKeyCounts = (keys) => {
|
|
24620
24929
|
const allowed = new Set(keys);
|
|
24621
|
-
return
|
|
24930
|
+
return z85.record(z85.string(), countValueSchema).refine((obj) => Object.keys(obj).every((k) => allowed.has(k)), "unknown key");
|
|
24622
24931
|
};
|
|
24623
|
-
var installStatePropertiesSchema =
|
|
24624
|
-
providers:
|
|
24625
|
-
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),
|
|
24626
24935
|
counts: fixedKeyCounts(INSTALL_STATE_COUNT_KEYS),
|
|
24627
24936
|
usage24h: fixedKeyCounts(INSTALL_STATE_USAGE_KEYS),
|
|
24628
24937
|
providerCalls24h: fixedKeyCounts(PROVIDER_NAMES).optional(),
|
|
@@ -24703,13 +25012,14 @@ function classifyProviderOutcomeError(err) {
|
|
|
24703
25012
|
}
|
|
24704
25013
|
|
|
24705
25014
|
// ../contracts/src/ui-telemetry.ts
|
|
24706
|
-
import { z as
|
|
25015
|
+
import { z as z86 } from "zod";
|
|
24707
25016
|
var UI_PAGES = [
|
|
24708
25017
|
"/",
|
|
24709
25018
|
"/projects",
|
|
24710
25019
|
"/projects/:projectName",
|
|
24711
25020
|
"/projects/:projectName/portfolio",
|
|
24712
25021
|
"/projects/:projectName/search-console",
|
|
25022
|
+
"/projects/:projectName/seo-data",
|
|
24713
25023
|
"/projects/:projectName/conversions",
|
|
24714
25024
|
"/projects/:projectName/local",
|
|
24715
25025
|
"/projects/:projectName/discovery",
|
|
@@ -24732,11 +25042,12 @@ var UI_PAGES = [
|
|
|
24732
25042
|
"not-found",
|
|
24733
25043
|
"other"
|
|
24734
25044
|
];
|
|
24735
|
-
var uiPageSchema =
|
|
25045
|
+
var uiPageSchema = z86.enum(UI_PAGES);
|
|
24736
25046
|
var UI_PROJECT_TABS = [
|
|
24737
25047
|
"overview",
|
|
24738
25048
|
"portfolio",
|
|
24739
25049
|
"search-console",
|
|
25050
|
+
"seo-data",
|
|
24740
25051
|
"conversions",
|
|
24741
25052
|
"local",
|
|
24742
25053
|
"discovery",
|
|
@@ -24750,7 +25061,7 @@ var UI_PROJECT_TABS = [
|
|
|
24750
25061
|
"settings",
|
|
24751
25062
|
"other"
|
|
24752
25063
|
];
|
|
24753
|
-
var uiProjectTabSchema =
|
|
25064
|
+
var uiProjectTabSchema = z86.enum(UI_PROJECT_TABS);
|
|
24754
25065
|
var UI_ACTIONS = [
|
|
24755
25066
|
"sweep.launch",
|
|
24756
25067
|
"sweep.cancel",
|
|
@@ -24773,6 +25084,9 @@ var UI_ACTIONS = [
|
|
|
24773
25084
|
"integration.connect",
|
|
24774
25085
|
"integration.disconnect",
|
|
24775
25086
|
"traffic.sync",
|
|
25087
|
+
"seo.refresh",
|
|
25088
|
+
"seo.profile.save",
|
|
25089
|
+
"seo.cancel",
|
|
24776
25090
|
"notification.save",
|
|
24777
25091
|
"notification.test",
|
|
24778
25092
|
"measurement_plan.publish",
|
|
@@ -24792,7 +25106,7 @@ var UI_ACTIONS = [
|
|
|
24792
25106
|
/** A table search settled on a non-empty query (debounced or Enter; the text is never sent). */
|
|
24793
25107
|
"search.submit"
|
|
24794
25108
|
];
|
|
24795
|
-
var uiActionSchema =
|
|
25109
|
+
var uiActionSchema = z86.enum(UI_ACTIONS);
|
|
24796
25110
|
var UI_INTEGRATIONS = [
|
|
24797
25111
|
"google",
|
|
24798
25112
|
"gsc",
|
|
@@ -24808,9 +25122,9 @@ var UI_INTEGRATIONS = [
|
|
|
24808
25122
|
"traffic_cloud_run",
|
|
24809
25123
|
"traffic_wordpress"
|
|
24810
25124
|
];
|
|
24811
|
-
var uiIntegrationSchema =
|
|
24812
|
-
var UI_FILTERS = ["provider", "model", "location", "window", "query_class", "other"];
|
|
24813
|
-
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);
|
|
24814
25128
|
var UI_EXPORT_FORMATS = ["csv", "json", "html"];
|
|
24815
25129
|
var UI_ERROR_KINDS = ["render", "unhandled", "api"];
|
|
24816
25130
|
var UI_STATUS_CLASSES = ["4xx", "5xx", "network"];
|
|
@@ -24895,45 +25209,45 @@ function isUiApiRouteTemplate(route) {
|
|
|
24895
25209
|
return PARAM_SEGMENT.test(segment) || UI_ROUTE_FIXED_CHILDREN.has(`${previous}/${segment}`);
|
|
24896
25210
|
});
|
|
24897
25211
|
}
|
|
24898
|
-
var uiEventBaseSchema =
|
|
24899
|
-
eventId:
|
|
24900
|
-
uiSessionId:
|
|
25212
|
+
var uiEventBaseSchema = z86.object({
|
|
25213
|
+
eventId: z86.string().uuid(),
|
|
25214
|
+
uiSessionId: z86.string().uuid(),
|
|
24901
25215
|
page: uiPageSchema
|
|
24902
25216
|
});
|
|
24903
|
-
var uiTelemetryEventSchema =
|
|
25217
|
+
var uiTelemetryEventSchema = z86.discriminatedUnion("event", [
|
|
24904
25218
|
uiEventBaseSchema.extend({
|
|
24905
|
-
event:
|
|
25219
|
+
event: z86.literal("ui.page_viewed"),
|
|
24906
25220
|
tab: uiProjectTabSchema.optional()
|
|
24907
25221
|
}).strict(),
|
|
24908
25222
|
uiEventBaseSchema.extend({
|
|
24909
|
-
event:
|
|
25223
|
+
event: z86.literal("ui.action"),
|
|
24910
25224
|
action: uiActionSchema,
|
|
24911
25225
|
tab: uiProjectTabSchema.optional(),
|
|
24912
25226
|
integration: uiIntegrationSchema.optional(),
|
|
24913
|
-
format:
|
|
25227
|
+
format: z86.enum(UI_EXPORT_FORMATS).optional(),
|
|
24914
25228
|
filter: uiFilterSchema.optional()
|
|
24915
25229
|
}).strict(),
|
|
24916
25230
|
uiEventBaseSchema.extend({
|
|
24917
|
-
event:
|
|
24918
|
-
kind:
|
|
25231
|
+
event: z86.literal("ui.error"),
|
|
25232
|
+
kind: z86.enum(UI_ERROR_KINDS),
|
|
24919
25233
|
tab: uiProjectTabSchema.optional(),
|
|
24920
|
-
component:
|
|
24921
|
-
errorName:
|
|
24922
|
-
route:
|
|
24923
|
-
method:
|
|
24924
|
-
statusClass:
|
|
24925
|
-
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()
|
|
24926
25240
|
}).strict(),
|
|
24927
25241
|
uiEventBaseSchema.extend({
|
|
24928
|
-
event:
|
|
24929
|
-
metric:
|
|
24930
|
-
rating:
|
|
25242
|
+
event: z86.literal("ui.vitals"),
|
|
25243
|
+
metric: z86.enum(UI_VITAL_METRICS),
|
|
25244
|
+
rating: z86.enum(UI_VITAL_RATINGS),
|
|
24931
25245
|
tab: uiProjectTabSchema.optional()
|
|
24932
25246
|
}).strict()
|
|
24933
25247
|
]);
|
|
24934
25248
|
|
|
24935
25249
|
// ../contracts/src/feedback.ts
|
|
24936
|
-
import { z as
|
|
25250
|
+
import { z as z87 } from "zod";
|
|
24937
25251
|
|
|
24938
25252
|
// ../contracts/src/log-redaction.ts
|
|
24939
25253
|
var REDACTED = "[REDACTED]";
|
|
@@ -25085,7 +25399,7 @@ function redactEmbeddedUrls(value) {
|
|
|
25085
25399
|
|
|
25086
25400
|
// ../contracts/src/feedback.ts
|
|
25087
25401
|
var FEEDBACK_KINDS = ["struggle", "bug", "improvement", "other"];
|
|
25088
|
-
var feedbackKindSchema =
|
|
25402
|
+
var feedbackKindSchema = z87.enum(FEEDBACK_KINDS);
|
|
25089
25403
|
var FEEDBACK_LIMITS = {
|
|
25090
25404
|
summary: 500,
|
|
25091
25405
|
details: 4e3,
|
|
@@ -25093,17 +25407,17 @@ var FEEDBACK_LIMITS = {
|
|
|
25093
25407
|
command: 120,
|
|
25094
25408
|
errorCode: 40
|
|
25095
25409
|
};
|
|
25096
|
-
var feedbackSubmissionSchema =
|
|
25410
|
+
var feedbackSubmissionSchema = z87.object({
|
|
25097
25411
|
kind: feedbackKindSchema,
|
|
25098
|
-
summary:
|
|
25099
|
-
details:
|
|
25100
|
-
area:
|
|
25101
|
-
command:
|
|
25102
|
-
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()
|
|
25103
25417
|
}).strict();
|
|
25104
|
-
var feedbackAcceptedDtoSchema =
|
|
25105
|
-
accepted:
|
|
25106
|
-
id:
|
|
25418
|
+
var feedbackAcceptedDtoSchema = z87.object({
|
|
25419
|
+
accepted: z87.boolean(),
|
|
25420
|
+
id: z87.string()
|
|
25107
25421
|
});
|
|
25108
25422
|
function redactFeedbackText(value, limit) {
|
|
25109
25423
|
return truncateUtf16(
|
|
@@ -25182,7 +25496,7 @@ function asRecord(value) {
|
|
|
25182
25496
|
}
|
|
25183
25497
|
|
|
25184
25498
|
// ../contracts/src/tolerant-read.ts
|
|
25185
|
-
import { z as
|
|
25499
|
+
import { z as z88 } from "zod";
|
|
25186
25500
|
var WRAPPER_TYPES = /* @__PURE__ */ new Set(["optional", "nullable", "default", "prefault", "readonly", "catch", "nonoptional"]);
|
|
25187
25501
|
var DEPTH_LIMIT = 64;
|
|
25188
25502
|
function defOf(schema) {
|
|
@@ -25193,9 +25507,9 @@ function cloneWith(schema, changes) {
|
|
|
25193
25507
|
}
|
|
25194
25508
|
function openPrimitive(values) {
|
|
25195
25509
|
if (values.length === 0) return void 0;
|
|
25196
|
-
if (values.every((value) => typeof value === "string")) return
|
|
25197
|
-
if (values.every((value) => typeof value === "number")) return
|
|
25198
|
-
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();
|
|
25199
25513
|
return void 0;
|
|
25200
25514
|
}
|
|
25201
25515
|
function walk2(schema, open, memo, depth) {
|
|
@@ -25209,7 +25523,7 @@ function walk2(schema, open, memo, depth) {
|
|
|
25209
25523
|
const shape = Object.fromEntries(Object.entries(schema.shape).map(([key, child]) => [key, next(child)]));
|
|
25210
25524
|
const declared = def.catchall;
|
|
25211
25525
|
const catchall = open.get(schema) ?? (declared && defOf(declared).type !== "never" ? next(declared) : void 0);
|
|
25212
|
-
result = catchall ?
|
|
25526
|
+
result = catchall ? z88.object(shape).catchall(catchall) : z88.object(shape);
|
|
25213
25527
|
} else if (WRAPPER_TYPES.has(def.type)) {
|
|
25214
25528
|
const inner = def.innerType;
|
|
25215
25529
|
const mapped = next(inner);
|
|
@@ -25226,10 +25540,10 @@ function walk2(schema, open, memo, depth) {
|
|
|
25226
25540
|
const options = def.options;
|
|
25227
25541
|
const mapped = options.map(next);
|
|
25228
25542
|
const changed = mapped.some((option, index) => option !== options[index]);
|
|
25229
|
-
result = !changed ? schema : def.discriminator ?
|
|
25543
|
+
result = !changed ? schema : def.discriminator ? z88.union(mapped) : cloneWith(schema, { options: mapped });
|
|
25230
25544
|
} else if (def.type === "record") {
|
|
25231
25545
|
const keyType = def.keyType, valueType = def.valueType;
|
|
25232
|
-
const mappedKey = defOf(keyType).type === "enum" ?
|
|
25546
|
+
const mappedKey = defOf(keyType).type === "enum" ? z88.string() : keyType;
|
|
25233
25547
|
const mappedValue = next(valueType);
|
|
25234
25548
|
result = mappedKey === keyType && mappedValue === valueType ? schema : cloneWith(schema, { keyType: mappedKey, valueType: mappedValue });
|
|
25235
25549
|
} else if (def.type === "intersection") {
|
|
@@ -25245,7 +25559,7 @@ function walk2(schema, open, memo, depth) {
|
|
|
25245
25559
|
result = changed ? cloneWith(schema, { items: mappedItems, rest: mappedRest }) : schema;
|
|
25246
25560
|
} else if (def.type === "lazy") {
|
|
25247
25561
|
const getter = def.getter;
|
|
25248
|
-
result =
|
|
25562
|
+
result = z88.lazy(() => next(getter()));
|
|
25249
25563
|
} else if (def.type === "enum") {
|
|
25250
25564
|
result = openPrimitive(Object.values(def.entries)) ?? schema;
|
|
25251
25565
|
} else if (def.type === "literal") {
|
|
@@ -25260,8 +25574,8 @@ function tolerantReadSchema(schema, options = {}) {
|
|
|
25260
25574
|
}
|
|
25261
25575
|
|
|
25262
25576
|
// ../contracts/src/sentiment-read.ts
|
|
25263
|
-
import { z as
|
|
25264
|
-
var OPEN_COUNTS = { openKeys: [[sentimentCountsSchema,
|
|
25577
|
+
import { z as z89 } from "zod";
|
|
25578
|
+
var OPEN_COUNTS = { openKeys: [[sentimentCountsSchema, z89.number().int().nonnegative()]] };
|
|
25265
25579
|
var sentimentSettingsReadSchema = tolerantReadSchema(sentimentSettingsSchema, OPEN_COUNTS);
|
|
25266
25580
|
var sentimentSummaryReadSchema = tolerantReadSchema(sentimentSummarySchema, OPEN_COUNTS);
|
|
25267
25581
|
var sentimentEvidencePageReadSchema = tolerantReadSchema(sentimentEvidencePageSchema, OPEN_COUNTS);
|
|
@@ -25291,29 +25605,29 @@ function rateOverChecked(numerator, answers, excluded, field) {
|
|
|
25291
25605
|
}
|
|
25292
25606
|
|
|
25293
25607
|
// ../contracts/src/cli-catalog.ts
|
|
25294
|
-
import { z as
|
|
25295
|
-
var cliCatalogOptionSchema =
|
|
25296
|
-
name:
|
|
25297
|
-
type:
|
|
25298
|
-
multiple:
|
|
25299
|
-
});
|
|
25300
|
-
var cliCatalogCommandSchema =
|
|
25301
|
-
id:
|
|
25302
|
-
path:
|
|
25303
|
-
usage:
|
|
25304
|
-
supportsDryRun:
|
|
25305
|
-
windows:
|
|
25306
|
-
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),
|
|
25307
25621
|
access: operationAccessSchema
|
|
25308
25622
|
});
|
|
25309
|
-
var cliCatalogSchema =
|
|
25310
|
-
version:
|
|
25311
|
-
globalOptions:
|
|
25312
|
-
groups:
|
|
25313
|
-
root:
|
|
25314
|
-
section:
|
|
25315
|
-
summary:
|
|
25316
|
-
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)
|
|
25317
25631
|
}))
|
|
25318
25632
|
});
|
|
25319
25633
|
|
|
@@ -25411,6 +25725,7 @@ export {
|
|
|
25411
25725
|
compareText,
|
|
25412
25726
|
sortedUnique,
|
|
25413
25727
|
hostOf,
|
|
25728
|
+
normalizeHostname,
|
|
25414
25729
|
registrableDomain,
|
|
25415
25730
|
normalizeProjectDomain,
|
|
25416
25731
|
normalizeCompetitorDomain,
|
|
@@ -25548,6 +25863,7 @@ export {
|
|
|
25548
25863
|
measurementPlanCounts,
|
|
25549
25864
|
compileMeasurementPlanPreview,
|
|
25550
25865
|
canonicalMeasurementPlanJson,
|
|
25866
|
+
matchesMeasurementTargetUrl,
|
|
25551
25867
|
SourceRelationships,
|
|
25552
25868
|
CompletionStatuses,
|
|
25553
25869
|
CostBases,
|
|
@@ -25708,6 +26024,7 @@ export {
|
|
|
25708
26024
|
competitorAliasesRequestSchema,
|
|
25709
26025
|
competitorEntryParts,
|
|
25710
26026
|
formatPercent,
|
|
26027
|
+
formatNumber,
|
|
25711
26028
|
formatIsoDate,
|
|
25712
26029
|
formatIsoDateInTimeZone,
|
|
25713
26030
|
calendarDateRange,
|
|
@@ -25838,6 +26155,7 @@ export {
|
|
|
25838
26155
|
OperationAccesses,
|
|
25839
26156
|
OPERATION_ACCESS_HEADER,
|
|
25840
26157
|
STORED_ONLY_HEADER,
|
|
26158
|
+
READ_SEMANTIC_OPERATIONS,
|
|
25841
26159
|
operationAccess,
|
|
25842
26160
|
maxOperationAccess,
|
|
25843
26161
|
matchOperationTemplate,
|
|
@@ -26411,6 +26729,8 @@ export {
|
|
|
26411
26729
|
READ_ONLY_SCOPE,
|
|
26412
26730
|
WILDCARD_SCOPE,
|
|
26413
26731
|
RESEARCH_RUN_SCOPE,
|
|
26732
|
+
SEO_RUN_SCOPE,
|
|
26733
|
+
SEO_WRITE_SCOPE,
|
|
26414
26734
|
PROJECTS_WRITE_SCOPE,
|
|
26415
26735
|
ADS_WRITE_SCOPE,
|
|
26416
26736
|
ADS_APPROVE_SCOPE,
|
|
@@ -26497,5 +26817,32 @@ export {
|
|
|
26497
26817
|
UNATTRIBUTED_MENTION_REASON,
|
|
26498
26818
|
unattributedAnswersLabel,
|
|
26499
26819
|
uncheckedSourcesLabel,
|
|
26500
|
-
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
|
|
26501
26848
|
};
|