@ainyc/canonry 4.191.0 → 4.192.1
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/assets/assets/{AuditHistoryPanel-C2dvjYNh.js → AuditHistoryPanel-DvqnrQc_.js} +1 -1
- package/assets/assets/{BacklinksPage-D1yPQtfF.js → BacklinksPage-BCk2qBfC.js} +1 -1
- package/assets/assets/{ChartPrimitives-DLEICrrL.js → ChartPrimitives-Bxa_vFmq.js} +1 -1
- package/assets/assets/{HistoryPage-DOEa7naA.js → HistoryPage-IMlkx--Q.js} +1 -1
- package/assets/assets/MeasurementPropertyPage-1o1e5vmH.js +1 -0
- package/assets/assets/ProjectPage-BusVoYaC.js +8 -0
- package/assets/assets/{RunRow-BO7lyC1C.js → RunRow-BherM7NU.js} +1 -1
- package/assets/assets/{RunsPage-DHSWfTav.js → RunsPage-B5G_OrmE.js} +1 -1
- package/assets/assets/{SettingsPage-oiJdhiq0.js → SettingsPage-CMeCn5uk.js} +1 -1
- package/assets/assets/{SiteHealthSection-gVdylFY-.js → SiteHealthSection-DZX1yv4k.js} +3 -3
- package/assets/assets/{TrafficPage-YIdwRpQh.js → TrafficPage-BV-HOztp.js} +1 -1
- package/assets/assets/{TrafficSourceDetailPage-B4Cop6ox.js → TrafficSourceDetailPage-9IN0q7bd.js} +1 -1
- package/assets/assets/{extract-error-message-XavUZNf3.js → extract-error-message-c7zJp5uX.js} +1 -1
- package/assets/assets/{index-njfYnO22.js → index-D3KGn0S0.js} +26 -26
- package/assets/assets/{react-sigma_core.esm.min-V7giUpEn.js → react-sigma_core.esm.min-DxHkjhKC.js} +1 -1
- package/assets/assets/{vendor-lucide-dNHw1I5G.js → vendor-lucide-CW2qe0uH.js} +1 -1
- package/assets/assets/{vendor-markdown-9tTeP8v7.js → vendor-markdown-B-Oq2NYq.js} +1 -1
- package/assets/assets/{vendor-radix-BpmvLvpp.js → vendor-radix-twS1M3FF.js} +1 -1
- package/assets/assets/{vendor-recharts-FA0uySU7.js → vendor-recharts-D-cUuLZo.js} +1 -1
- package/assets/assets/{vendor-tanstack-CYBjbqVr.js → vendor-tanstack-ZXXkndVj.js} +1 -1
- package/assets/index.html +6 -6
- package/dist/{chunk-KBUV3HGS.js → chunk-QRNKMGVD.js} +1351 -1228
- package/dist/{chunk-WSD5J6O4.js → chunk-S5QNBQ72.js} +2 -2
- package/dist/{chunk-XI6FN52S.js → chunk-T4OO575U.js} +45 -14
- package/dist/{chunk-ZK4FJDCH.js → chunk-T6GRXUOE.js} +519 -231
- package/dist/{chunk-2A7E5TDU.js → chunk-V4ZLHKOG.js} +5 -4
- package/dist/cli.js +14 -10
- package/dist/index.js +4 -4
- package/dist/{intelligence-service-EVRWZHDG.js → intelligence-service-QYRQHSJH.js} +2 -2
- package/dist/mcp.js +3 -3
- package/package.json +13 -13
- package/assets/assets/MeasurementPropertyPage-D-O8vnMS.js +0 -1
- package/assets/assets/ProjectPage-DqTCcimz.js +0 -8
|
@@ -3880,6 +3880,8 @@ var measurementV2TargetSchema = z6.object({
|
|
|
3880
3880
|
stableKey: measurementV2StableKeySchema,
|
|
3881
3881
|
label: z6.string().trim().min(1),
|
|
3882
3882
|
aliases: z6.array(z6.string().min(1)),
|
|
3883
|
+
/** Explicit qualified identity phrases for names shared with other places/businesses. */
|
|
3884
|
+
identityAliases: z6.array(z6.string().trim().min(1)).optional(),
|
|
3883
3885
|
urlMatchers: z6.array(measurementV2UrlMatcherSchema),
|
|
3884
3886
|
/** An aliasless Target can be cited but never mentioned; the flag keeps that out of a 0% reading. */
|
|
3885
3887
|
mentionNotApplicable: z6.boolean(),
|
|
@@ -3950,6 +3952,8 @@ var measurementV2ReportingScopeSchema = z6.object({
|
|
|
3950
3952
|
stableKey: measurementV2StableKeySchema,
|
|
3951
3953
|
label: z6.string().trim().min(1),
|
|
3952
3954
|
kind: z6.literal("market"),
|
|
3955
|
+
/** Explicit navigation association; never inferred from labels or shared properties. */
|
|
3956
|
+
groupKey: measurementV2StableKeySchema.optional(),
|
|
3953
3957
|
usageEdges: z6.array(measurementV2UsageEdgeSchema)
|
|
3954
3958
|
}).strict();
|
|
3955
3959
|
function measurementV2UsageEdgeKey(edge) {
|
|
@@ -4012,6 +4016,12 @@ var measurementPlanV2Schema = z6.object({
|
|
|
4012
4016
|
});
|
|
4013
4017
|
}
|
|
4014
4018
|
reportingScopeKeys.add(scope.stableKey);
|
|
4019
|
+
if (scope.groupKey !== void 0) {
|
|
4020
|
+
const group = plan.groups.find((group2) => group2.stableKey === scope.groupKey);
|
|
4021
|
+
if (!group || scope.usageEdges.some((edge) => !group.targetKeys.includes(edge.targetKey))) {
|
|
4022
|
+
ctx.addIssue({ code: z6.ZodIssueCode.custom, path: ["reportingScopes", scopeIndex, "groupKey"], message: "A market must link to an existing group containing all its assigned properties." });
|
|
4023
|
+
}
|
|
4024
|
+
}
|
|
4015
4025
|
const memberKeys = /* @__PURE__ */ new Set();
|
|
4016
4026
|
scope.usageEdges.forEach((edge, edgeIndex) => {
|
|
4017
4027
|
const key = measurementV2UsageEdgeKey(edge);
|
|
@@ -4124,6 +4134,7 @@ function canonicalMeasurementPlanV2(plan) {
|
|
|
4124
4134
|
targets: [...plan.targets].map((target) => ({
|
|
4125
4135
|
...target,
|
|
4126
4136
|
aliases: [...target.aliases].sort(compareText),
|
|
4137
|
+
...target.identityAliases === void 0 ? {} : { identityAliases: [...target.identityAliases].sort(compareText) },
|
|
4127
4138
|
urlMatchers: [...target.urlMatchers].sort((left, right) => compareText(matcherOrderKey(left), matcherOrderKey(right)))
|
|
4128
4139
|
})).sort((left, right) => compareText(left.stableKey, right.stableKey)),
|
|
4129
4140
|
groups: [...plan.groups].map((group) => ({
|
|
@@ -4171,6 +4182,7 @@ var measurementMetricUnavailableReasonSchema = z6.enum([
|
|
|
4171
4182
|
"plan_v1",
|
|
4172
4183
|
"no_population",
|
|
4173
4184
|
"evidence_incomplete",
|
|
4185
|
+
"identity_ambiguous",
|
|
4174
4186
|
"not_applicable"
|
|
4175
4187
|
]);
|
|
4176
4188
|
var measurementMetricValueSchema = z6.discriminatedUnion("state", [
|
|
@@ -6123,6 +6135,8 @@ var visibilityReportRequestShape = {
|
|
|
6123
6135
|
queryClass: visibilityReportQueryClassSchema.default("non-brand"),
|
|
6124
6136
|
scope: visibilityReportScopeKindSchema.default("project"),
|
|
6125
6137
|
scopeKey: nonBlankIdSchema.optional(),
|
|
6138
|
+
/** Exact frozen market refinement for a project, group, or Property selection. */
|
|
6139
|
+
marketKey: nonBlankIdSchema.optional(),
|
|
6126
6140
|
provider: nonBlankIdSchema.optional(),
|
|
6127
6141
|
/** Exact stored served-model identity. Null/absent model evidence never matches this filter. */
|
|
6128
6142
|
model: nonBlankIdSchema.optional(),
|
|
@@ -6156,6 +6170,13 @@ var visibilityReportRequestSchema = z15.object(visibilityReportRequestShape).str
|
|
|
6156
6170
|
message: "scopeKey is not valid for project scope"
|
|
6157
6171
|
});
|
|
6158
6172
|
}
|
|
6173
|
+
if (value.scope === "market" && value.marketKey !== void 0) {
|
|
6174
|
+
ctx.addIssue({
|
|
6175
|
+
code: z15.ZodIssueCode.custom,
|
|
6176
|
+
path: ["marketKey"],
|
|
6177
|
+
message: "marketKey is not valid for market scope"
|
|
6178
|
+
});
|
|
6179
|
+
}
|
|
6159
6180
|
if (value.from !== void 0 && value.to !== void 0 && value.from > value.to) {
|
|
6160
6181
|
ctx.addIssue({
|
|
6161
6182
|
code: z15.ZodIssueCode.custom,
|
|
@@ -6179,7 +6200,7 @@ var visibilityReportRateSchema = z15.object({
|
|
|
6179
6200
|
numerator: z15.number().int().nonnegative().nullable(),
|
|
6180
6201
|
denominator: z15.number().int().nonnegative().nullable(),
|
|
6181
6202
|
rate: z15.number().min(0).max(1).nullable(),
|
|
6182
|
-
reason: z15.enum(["no-population", "incomplete", "evidence-incomplete", "not-applicable"]).optional()
|
|
6203
|
+
reason: z15.enum(["no-population", "incomplete", "evidence-incomplete", "identity-ambiguous", "not-applicable"]).optional()
|
|
6183
6204
|
}).strict().superRefine((value, ctx) => {
|
|
6184
6205
|
const unavailable = value.numerator === null || value.denominator === null || value.rate === null;
|
|
6185
6206
|
if (unavailable) {
|
|
@@ -6214,7 +6235,9 @@ var visibilityReportScopeOptionSchema = z15.object({
|
|
|
6214
6235
|
kind: visibilityReportScopeKindSchema,
|
|
6215
6236
|
targetCount: z15.number().int().nonnegative(),
|
|
6216
6237
|
/** Group and Property membership is frozen and explicit; groups have zero or one id. */
|
|
6217
|
-
parentGroupIds: z15.array(nonBlankIdSchema).optional()
|
|
6238
|
+
parentGroupIds: z15.array(nonBlankIdSchema).optional(),
|
|
6239
|
+
/** Explicit frozen market links; absent for scopes without market metadata. */
|
|
6240
|
+
marketKeys: z15.array(nonBlankIdSchema).optional()
|
|
6218
6241
|
}).strict();
|
|
6219
6242
|
var visibilityReportModelOptionSchema = z15.object({
|
|
6220
6243
|
provider: nonBlankIdSchema,
|
|
@@ -6274,6 +6297,8 @@ var visibilityReportQueryRowSchema = z15.object({
|
|
|
6274
6297
|
model: z15.string().nullable(),
|
|
6275
6298
|
location: z15.string().nullable(),
|
|
6276
6299
|
targetKeys: z15.array(nonBlankIdSchema),
|
|
6300
|
+
/** Frozen market memberships for standalone Property query grouping. */
|
|
6301
|
+
marketKeys: z15.array(nonBlankIdSchema).optional(),
|
|
6277
6302
|
answerCount: z15.number().int().nonnegative(),
|
|
6278
6303
|
mentionCoverage: visibilityReportRateSchema,
|
|
6279
6304
|
citationCoverage: visibilityReportRateSchema
|
|
@@ -6288,6 +6313,7 @@ var visibilityReportEvidenceRowSchema = z15.object({
|
|
|
6288
6313
|
location: z15.string().nullable(),
|
|
6289
6314
|
targetKeys: z15.array(nonBlankIdSchema),
|
|
6290
6315
|
mentioned: z15.boolean().nullable(),
|
|
6316
|
+
mentionUnavailableReason: z15.literal("identity-ambiguous").optional(),
|
|
6291
6317
|
cited: z15.boolean().nullable(),
|
|
6292
6318
|
/** Present only for a query-key detail reading; aggregate listings never return answer bodies. */
|
|
6293
6319
|
answerText: z15.string().nullable(),
|
|
@@ -6356,6 +6382,8 @@ var visibilityReportSelectionSchema = z15.object({
|
|
|
6356
6382
|
mode: visibilityReportResolvedModeSchema,
|
|
6357
6383
|
queryClass: visibilityReportQueryClassSchema,
|
|
6358
6384
|
scope: visibilityReportScopeOptionSchema,
|
|
6385
|
+
/** Selected frozen market refinement, omitted when reading the full scope. */
|
|
6386
|
+
market: visibilityReportScopeOptionSchema.optional(),
|
|
6359
6387
|
provider: z15.string().nullable(),
|
|
6360
6388
|
model: z15.string().nullable(),
|
|
6361
6389
|
location: visibilityReportLocationSelectionSchema,
|
|
@@ -6506,6 +6534,7 @@ var queryTrackingGroupSchema = z16.object({
|
|
|
6506
6534
|
}).strict();
|
|
6507
6535
|
var queryTrackingMarketSchema = z16.object({
|
|
6508
6536
|
stableKey: measurementV2StableKeySchema,
|
|
6537
|
+
groupKey: measurementV2StableKeySchema.optional(),
|
|
6509
6538
|
label: z16.string().trim().min(1),
|
|
6510
6539
|
usageEdges: z16.array(measurementV2UsageEdgeSchema)
|
|
6511
6540
|
}).strict();
|
|
@@ -6729,6 +6758,7 @@ var measurementUsageEdgeTypeSchema = z17.enum(["baseline", "target"]);
|
|
|
6729
6758
|
var measurementMetricReasonSchema = z17.enum([
|
|
6730
6759
|
"incomplete",
|
|
6731
6760
|
"evidence-incomplete",
|
|
6761
|
+
"identity-ambiguous",
|
|
6732
6762
|
"no-population",
|
|
6733
6763
|
"aliasless",
|
|
6734
6764
|
"no-competitors",
|
|
@@ -7367,6 +7397,7 @@ var measurementDraftTargetSchema = z19.object({
|
|
|
7367
7397
|
label: z19.string().trim().min(1),
|
|
7368
7398
|
status: measurementDraftTargetStatusSchema,
|
|
7369
7399
|
aliases: z19.array(z19.string().trim().min(1)),
|
|
7400
|
+
identityAliases: z19.array(z19.string().trim().min(1)).optional(),
|
|
7370
7401
|
urlMatchers: z19.array(z19.string().trim().min(1)),
|
|
7371
7402
|
source: measurementDraftTargetSourceSchema,
|
|
7372
7403
|
discoveredUrl: z19.string().trim().min(1).optional(),
|
|
@@ -8465,14 +8496,14 @@ function roundSignificant(value, sig = 6) {
|
|
|
8465
8496
|
const factor = 10 ** (sig - magnitude);
|
|
8466
8497
|
return (Math.round(value * factor) + 0) / factor;
|
|
8467
8498
|
}
|
|
8468
|
-
function wilsonInterval(successes, n,
|
|
8499
|
+
function wilsonInterval(successes, n, z61 = 1.96) {
|
|
8469
8500
|
if (!Number.isFinite(n) || n <= 0) return null;
|
|
8470
8501
|
const s = Math.max(0, Math.min(successes, n));
|
|
8471
8502
|
const p = s / n;
|
|
8472
|
-
const z210 =
|
|
8503
|
+
const z210 = z61 * z61;
|
|
8473
8504
|
const denom = 1 + z210 / n;
|
|
8474
8505
|
const center = (p + z210 / (2 * n)) / denom;
|
|
8475
|
-
const margin =
|
|
8506
|
+
const margin = z61 / denom * Math.sqrt(p * (1 - p) / n + z210 / (4 * n * n));
|
|
8476
8507
|
return {
|
|
8477
8508
|
low: round(Math.max(0, center - margin)),
|
|
8478
8509
|
high: round(Math.min(1, center + margin))
|
|
@@ -14523,10 +14554,86 @@ function citationStateToCited(state) {
|
|
|
14523
14554
|
}
|
|
14524
14555
|
|
|
14525
14556
|
// ../contracts/src/report.ts
|
|
14557
|
+
import { z as z52 } from "zod";
|
|
14558
|
+
|
|
14559
|
+
// ../contracts/src/report-visibility.ts
|
|
14526
14560
|
import { z as z51 } from "zod";
|
|
14561
|
+
var reportVisibilitySchema = z51.object({
|
|
14562
|
+
selection: visibilityReportSelectionSchema,
|
|
14563
|
+
/** History window only; the latest summary remains available even outside it. */
|
|
14564
|
+
historyWindow: z51.object({ from: z51.string().datetime(), to: z51.string().datetime() }).optional(),
|
|
14565
|
+
populations: z51.array(visibilityReportPopulationSchema.pick({ queryClass: true, summary: true, trend: true }))
|
|
14566
|
+
});
|
|
14567
|
+
var REPORT_VISIBILITY_COPY = {
|
|
14568
|
+
title: "AI visibility",
|
|
14569
|
+
description: "Each answer is counted once for its assigned properties. Branded and non-brand queries are measured separately.",
|
|
14570
|
+
simpleDescription: "Each saved answer is counted once. Branded and non-brand queries are measured separately.",
|
|
14571
|
+
queryType: "Query type",
|
|
14572
|
+
queries: "Queries measured",
|
|
14573
|
+
answers: "Answers measured",
|
|
14574
|
+
mentioned: "Mentioned",
|
|
14575
|
+
cited: "Cited",
|
|
14576
|
+
history: "Measurement history",
|
|
14577
|
+
latestMeasurement: "Latest measurement",
|
|
14578
|
+
allLocations: "All measured locations",
|
|
14579
|
+
noLocation: "No provider location",
|
|
14580
|
+
location: "Location",
|
|
14581
|
+
previousOutsideWindow: "Previous measurement outside this period",
|
|
14582
|
+
date: "Date",
|
|
14583
|
+
comparison: "Comparison",
|
|
14584
|
+
notMeasured: "Not measured",
|
|
14585
|
+
incomplete: "Evidence incomplete",
|
|
14586
|
+
ambiguous: "Property identity unverified",
|
|
14587
|
+
noPopulation: "No measured answers",
|
|
14588
|
+
notApplicable: "Not applicable",
|
|
14589
|
+
comparable: "Comparable",
|
|
14590
|
+
baseline: "Baseline",
|
|
14591
|
+
changed: "Measurement changed",
|
|
14592
|
+
unknownHistory: "Comparison unavailable"
|
|
14593
|
+
};
|
|
14594
|
+
function reportQueryClassLabel(value) {
|
|
14595
|
+
return { branded: "Branded", "non-brand": "Non-brand", unknown: "Unclassified" }[value];
|
|
14596
|
+
}
|
|
14597
|
+
function reportVisibilityRate(value) {
|
|
14598
|
+
return value.rate === null ? REPORT_VISIBILITY_COPY.notMeasured : `${Number((value.rate * 100).toFixed(1))}%`;
|
|
14599
|
+
}
|
|
14600
|
+
function reportVisibilityEvidence(value) {
|
|
14601
|
+
if (value.numerator !== null && value.denominator !== null) return `${value.numerator} of ${value.denominator} answers`;
|
|
14602
|
+
switch (value.reason) {
|
|
14603
|
+
case "no-population":
|
|
14604
|
+
return REPORT_VISIBILITY_COPY.noPopulation;
|
|
14605
|
+
case "not-applicable":
|
|
14606
|
+
return REPORT_VISIBILITY_COPY.notApplicable;
|
|
14607
|
+
// Identity ambiguity is an explicit evidence state, never a negative result.
|
|
14608
|
+
case "identity-ambiguous":
|
|
14609
|
+
return REPORT_VISIBILITY_COPY.ambiguous;
|
|
14610
|
+
default:
|
|
14611
|
+
return REPORT_VISIBILITY_COPY.incomplete;
|
|
14612
|
+
}
|
|
14613
|
+
}
|
|
14614
|
+
function reportVisibilityComparison(state, outsideWindow = false) {
|
|
14615
|
+
const label = state === "first" ? REPORT_VISIBILITY_COPY.baseline : state === "comparable" ? REPORT_VISIBILITY_COPY.comparable : state === "legacy-unknown" ? REPORT_VISIBILITY_COPY.unknownHistory : REPORT_VISIBILITY_COPY.changed;
|
|
14616
|
+
return outsideWindow ? `${label} \xB7 ${REPORT_VISIBILITY_COPY.previousOutsideWindow}` : label;
|
|
14617
|
+
}
|
|
14618
|
+
function reportVisibilityMeasurementLabel(visibility) {
|
|
14619
|
+
const date = visibility.selection.measurement.completedAt?.slice(0, 10) ?? REPORT_VISIBILITY_COPY.notMeasured;
|
|
14620
|
+
return `${REPORT_VISIBILITY_COPY.latestMeasurement}: ${date}`;
|
|
14621
|
+
}
|
|
14622
|
+
function reportVisibilityHistoryLabel(visibility) {
|
|
14623
|
+
const window = visibility.historyWindow;
|
|
14624
|
+
return window === void 0 ? REPORT_VISIBILITY_COPY.history : `${REPORT_VISIBILITY_COPY.history} (${window.from.slice(0, 10)} \u2013 ${window.to.slice(0, 10)})`;
|
|
14625
|
+
}
|
|
14626
|
+
function reportVisibilityLocationLabel(visibility) {
|
|
14627
|
+
const location = visibility.selection.location;
|
|
14628
|
+
if (location.kind === "all") return REPORT_VISIBILITY_COPY.allLocations;
|
|
14629
|
+
if (location.kind === "none") return REPORT_VISIBILITY_COPY.noLocation;
|
|
14630
|
+
return `${REPORT_VISIBILITY_COPY.location}: ${location.value}`;
|
|
14631
|
+
}
|
|
14632
|
+
|
|
14633
|
+
// ../contracts/src/report.ts
|
|
14527
14634
|
var REPORT_PERIOD_OPTIONS = [7, 14, 30, 90];
|
|
14528
14635
|
var REPORT_DEFAULT_PERIOD_DAYS = 30;
|
|
14529
|
-
var reportPeriodSchema =
|
|
14636
|
+
var reportPeriodSchema = z52.union([z52.literal(7), z52.literal(14), z52.literal(30), z52.literal(90)]).describe("Report window in days (7, 14, 30, or 90). Defaults to 30 when omitted.");
|
|
14530
14637
|
function isReportPeriodDays(n) {
|
|
14531
14638
|
return REPORT_PERIOD_OPTIONS.includes(n);
|
|
14532
14639
|
}
|
|
@@ -14541,45 +14648,45 @@ function parseReportPeriodDays(value) {
|
|
|
14541
14648
|
function reportComparisonWindowDays(periodDays) {
|
|
14542
14649
|
return Math.max(1, Math.floor(periodDays / 2));
|
|
14543
14650
|
}
|
|
14544
|
-
var providerLocationTreatmentSchema =
|
|
14651
|
+
var providerLocationTreatmentSchema = z52.enum([
|
|
14545
14652
|
"prompt",
|
|
14546
14653
|
"request-param",
|
|
14547
14654
|
"browser-geo",
|
|
14548
14655
|
"ignored"
|
|
14549
14656
|
]);
|
|
14550
|
-
var reportMetaLocationSchema =
|
|
14657
|
+
var reportMetaLocationSchema = z52.object({
|
|
14551
14658
|
/** Human-readable label as configured on the project (e.g. "michigan"). */
|
|
14552
|
-
label:
|
|
14659
|
+
label: z52.string(),
|
|
14553
14660
|
/** Resolved city/region/country from the project's `LocationContext`. */
|
|
14554
|
-
city:
|
|
14555
|
-
region:
|
|
14556
|
-
country:
|
|
14661
|
+
city: z52.string(),
|
|
14662
|
+
region: z52.string(),
|
|
14663
|
+
country: z52.string(),
|
|
14557
14664
|
/**
|
|
14558
14665
|
* Other locations configured on the project that did NOT power this report.
|
|
14559
14666
|
* When non-empty, callers should make clear that the report is location-scoped:
|
|
14560
14667
|
* a separate sweep is needed to see how AI engines respond from each one.
|
|
14561
14668
|
*/
|
|
14562
|
-
otherConfiguredLabels:
|
|
14669
|
+
otherConfiguredLabels: z52.array(z52.string())
|
|
14563
14670
|
});
|
|
14564
|
-
var reportProviderLocationHandlingSchema =
|
|
14671
|
+
var reportProviderLocationHandlingSchema = z52.object({
|
|
14565
14672
|
/** Provider name (matches `query_snapshots.provider`). */
|
|
14566
|
-
provider:
|
|
14673
|
+
provider: z52.string(),
|
|
14567
14674
|
/** How this provider applied the configured location during this run. */
|
|
14568
14675
|
treatment: providerLocationTreatmentSchema,
|
|
14569
14676
|
/** One-sentence explanation suitable for the report. */
|
|
14570
|
-
description:
|
|
14677
|
+
description: z52.string()
|
|
14571
14678
|
});
|
|
14572
|
-
var reportMetaSchema =
|
|
14679
|
+
var reportMetaSchema = z52.object({
|
|
14573
14680
|
/** ISO timestamp the report was generated (server clock). */
|
|
14574
|
-
generatedAt:
|
|
14681
|
+
generatedAt: z52.string(),
|
|
14575
14682
|
/** Project the report covers. */
|
|
14576
|
-
project:
|
|
14577
|
-
id:
|
|
14578
|
-
name:
|
|
14579
|
-
displayName:
|
|
14580
|
-
canonicalDomain:
|
|
14581
|
-
country:
|
|
14582
|
-
language:
|
|
14683
|
+
project: z52.object({
|
|
14684
|
+
id: z52.string(),
|
|
14685
|
+
name: z52.string(),
|
|
14686
|
+
displayName: z52.string(),
|
|
14687
|
+
canonicalDomain: z52.string(),
|
|
14688
|
+
country: z52.string(),
|
|
14689
|
+
language: z52.string()
|
|
14583
14690
|
}),
|
|
14584
14691
|
/**
|
|
14585
14692
|
* The location that powered the latest visibility run, when one was set.
|
|
@@ -14594,31 +14701,33 @@ var reportMetaSchema = z51.object({
|
|
|
14594
14701
|
* each provider's answer — some providers append it to the prompt, some
|
|
14595
14702
|
* pass it as a structured request field, and some (CDP) ignore it.
|
|
14596
14703
|
*/
|
|
14597
|
-
providerLocationHandling:
|
|
14704
|
+
providerLocationHandling: z52.array(reportProviderLocationHandlingSchema),
|
|
14598
14705
|
/** Earliest data point referenced by the report (ISO date). */
|
|
14599
|
-
periodStart:
|
|
14706
|
+
periodStart: z52.string().nullable(),
|
|
14600
14707
|
/** Latest data point referenced by the report (ISO date). */
|
|
14601
|
-
periodEnd:
|
|
14708
|
+
periodEnd: z52.string().nullable(),
|
|
14602
14709
|
/**
|
|
14603
14710
|
* The selected report window, in days (one of `REPORT_PERIOD_OPTIONS`).
|
|
14604
14711
|
* Every time-windowed section scopes to this many days; renderers read it to
|
|
14605
14712
|
* label the window ("Last 30 days", "(30d)"). Defaults to
|
|
14606
14713
|
* `REPORT_DEFAULT_PERIOD_DAYS` when no `period` is requested.
|
|
14607
14714
|
*/
|
|
14608
|
-
periodDays:
|
|
14715
|
+
periodDays: z52.number().int().positive()
|
|
14609
14716
|
});
|
|
14610
|
-
var reportExecutiveSummarySchema =
|
|
14717
|
+
var reportExecutiveSummarySchema = z52.object({
|
|
14718
|
+
/** Legacy project/query scalars are unavailable for Advanced portfolios. Use visibility instead. */
|
|
14719
|
+
visibilityBasis: z52.enum(["legacy-project-queries", "frozen-populations"]).optional(),
|
|
14611
14720
|
/**
|
|
14612
14721
|
* 0..100 — share of tracked queries that were cited by at least one
|
|
14613
14722
|
* provider in the latest run. "Cited" means the project's domain appeared
|
|
14614
14723
|
* in the source list / grounding the AI used to answer. Computed per-query
|
|
14615
14724
|
* (not per-(query × provider)) so the rate is invariant to provider count.
|
|
14616
14725
|
*/
|
|
14617
|
-
citationRate:
|
|
14726
|
+
citationRate: z52.number().nullable(),
|
|
14618
14727
|
/** Numerator of `citationRate` — distinct tracked queries cited by ≥1 provider in the latest run. */
|
|
14619
|
-
citedQueryCount:
|
|
14728
|
+
citedQueryCount: z52.number().nullable(),
|
|
14620
14729
|
/** Denominator of `citationRate` — total tracked queries. */
|
|
14621
|
-
totalQueryCount:
|
|
14730
|
+
totalQueryCount: z52.number().nullable(),
|
|
14622
14731
|
/**
|
|
14623
14732
|
* 0..100 — share of tracked queries where the project's brand or domain
|
|
14624
14733
|
* appeared in at least one provider's answer text in the latest run.
|
|
@@ -14626,71 +14735,71 @@ var reportExecutiveSummarySchema = z51.object({
|
|
|
14626
14735
|
* the prose without citing your domain in its sources, and vice versa.
|
|
14627
14736
|
* Same per-query denominator as `citationRate` for consistency.
|
|
14628
14737
|
*/
|
|
14629
|
-
mentionRate:
|
|
14738
|
+
mentionRate: z52.number().nullable(),
|
|
14630
14739
|
/** Numerator of `mentionRate` — distinct tracked queries mentioned in ≥1 provider's answer text. */
|
|
14631
|
-
mentionedQueryCount:
|
|
14740
|
+
mentionedQueryCount: z52.number().nullable(),
|
|
14632
14741
|
/** Compared to the previous run: 'up' | 'down' | 'flat' | 'unknown' (no prior run). */
|
|
14633
|
-
trend:
|
|
14742
|
+
trend: z52.enum(["up", "down", "flat", "unknown"]),
|
|
14634
14743
|
/** Total tracked queries. */
|
|
14635
|
-
queryCount:
|
|
14744
|
+
queryCount: z52.number(),
|
|
14636
14745
|
/** Total tracked competitors. */
|
|
14637
|
-
competitorCount:
|
|
14746
|
+
competitorCount: z52.number(),
|
|
14638
14747
|
/** Number of providers in the latest run. */
|
|
14639
|
-
providerCount:
|
|
14748
|
+
providerCount: z52.number(),
|
|
14640
14749
|
/** GSC totals across the most-recent sync window. Null when GSC is not connected. */
|
|
14641
|
-
gsc:
|
|
14642
|
-
clicks:
|
|
14643
|
-
impressions:
|
|
14644
|
-
ctr:
|
|
14645
|
-
avgPosition:
|
|
14646
|
-
periodStart:
|
|
14647
|
-
periodEnd:
|
|
14750
|
+
gsc: z52.object({
|
|
14751
|
+
clicks: z52.number(),
|
|
14752
|
+
impressions: z52.number(),
|
|
14753
|
+
ctr: z52.number(),
|
|
14754
|
+
avgPosition: z52.number(),
|
|
14755
|
+
periodStart: z52.string(),
|
|
14756
|
+
periodEnd: z52.string()
|
|
14648
14757
|
}).nullable(),
|
|
14649
14758
|
/** GA4 totals across the most-recent sync period. Null when GA4 is not connected. */
|
|
14650
|
-
ga:
|
|
14651
|
-
sessions:
|
|
14652
|
-
users:
|
|
14653
|
-
periodStart:
|
|
14654
|
-
periodEnd:
|
|
14759
|
+
ga: z52.object({
|
|
14760
|
+
sessions: z52.number(),
|
|
14761
|
+
users: z52.number(),
|
|
14762
|
+
periodStart: z52.string(),
|
|
14763
|
+
periodEnd: z52.string()
|
|
14655
14764
|
}).nullable(),
|
|
14656
14765
|
/** Top 3-5 findings, each rendered as a single-sentence narrative. */
|
|
14657
|
-
findings:
|
|
14658
|
-
title:
|
|
14659
|
-
detail:
|
|
14660
|
-
tone:
|
|
14766
|
+
findings: z52.array(z52.object({
|
|
14767
|
+
title: z52.string(),
|
|
14768
|
+
detail: z52.string(),
|
|
14769
|
+
tone: z52.enum(["positive", "caution", "negative", "neutral"])
|
|
14661
14770
|
}))
|
|
14662
14771
|
});
|
|
14663
|
-
var citationCellSchema =
|
|
14664
|
-
citationState:
|
|
14665
|
-
answerMentioned:
|
|
14666
|
-
model:
|
|
14772
|
+
var citationCellSchema = z52.object({
|
|
14773
|
+
citationState: z52.enum(["cited", "not-cited", "pending"]),
|
|
14774
|
+
answerMentioned: z52.boolean().nullable(),
|
|
14775
|
+
model: z52.string().nullable()
|
|
14667
14776
|
});
|
|
14668
|
-
var citationScorecardSchema =
|
|
14669
|
-
queries:
|
|
14670
|
-
providers:
|
|
14777
|
+
var citationScorecardSchema = z52.object({
|
|
14778
|
+
queries: z52.array(z52.string()),
|
|
14779
|
+
providers: z52.array(z52.string()),
|
|
14671
14780
|
/** matrix[queryIndex][providerIndex] — null when no snapshot exists for the pair. */
|
|
14672
|
-
matrix:
|
|
14781
|
+
matrix: z52.array(z52.array(citationCellSchema.nullable())),
|
|
14673
14782
|
/** Per-provider citation + mention rates (0..100). */
|
|
14674
|
-
providerRates:
|
|
14675
|
-
provider:
|
|
14676
|
-
citedCount:
|
|
14783
|
+
providerRates: z52.array(z52.object({
|
|
14784
|
+
provider: z52.string(),
|
|
14785
|
+
citedCount: z52.number(),
|
|
14677
14786
|
/** Number of snapshots for this provider where the answer text mentioned the project. */
|
|
14678
|
-
mentionedCount:
|
|
14679
|
-
totalCount:
|
|
14680
|
-
citationRate:
|
|
14681
|
-
mentionRate:
|
|
14787
|
+
mentionedCount: z52.number(),
|
|
14788
|
+
totalCount: z52.number(),
|
|
14789
|
+
citationRate: z52.number(),
|
|
14790
|
+
mentionRate: z52.number()
|
|
14682
14791
|
}))
|
|
14683
14792
|
});
|
|
14684
|
-
var competitorRowSchema =
|
|
14685
|
-
domain:
|
|
14793
|
+
var competitorRowSchema = z52.object({
|
|
14794
|
+
domain: z52.string(),
|
|
14686
14795
|
/** Number of (query × provider) pairs that cited this competitor. */
|
|
14687
|
-
citationCount:
|
|
14796
|
+
citationCount: z52.number(),
|
|
14688
14797
|
/** Out-of count for the same denominator. */
|
|
14689
|
-
totalCount:
|
|
14798
|
+
totalCount: z52.number(),
|
|
14690
14799
|
/** 'High' | 'Moderate' | 'Low' | 'None' — from buildPortfolioProject pressure logic. */
|
|
14691
|
-
pressureLabel:
|
|
14800
|
+
pressureLabel: z52.enum(["High", "Moderate", "Low", "None"]),
|
|
14692
14801
|
/** Distinct queries on which this competitor was cited. */
|
|
14693
|
-
citedQueries:
|
|
14802
|
+
citedQueries: z52.array(z52.string()),
|
|
14694
14803
|
/**
|
|
14695
14804
|
* Citation share 0..100. Numerator = this competitor's `citationCount`.
|
|
14696
14805
|
* Denominator = sum of `citationCount` across all competitors plus the
|
|
@@ -14698,30 +14807,30 @@ var competitorRowSchema = z51.object({
|
|
|
14698
14807
|
* slots in the snapshot. Distinct from the project-level Mention Share
|
|
14699
14808
|
* gauge — that one is brand-in-answer-text, this one is domain-in-source-list.
|
|
14700
14809
|
*/
|
|
14701
|
-
sharePct:
|
|
14810
|
+
sharePct: z52.number(),
|
|
14702
14811
|
/**
|
|
14703
14812
|
* URLs from the latest run's grounding sources whose host matches this
|
|
14704
14813
|
* competitor's domain, with the queries each URL was cited for. Empty
|
|
14705
14814
|
* when no grounding-source data is available (e.g. no `rawResponse` JSON
|
|
14706
14815
|
* stored for the snapshots).
|
|
14707
14816
|
*/
|
|
14708
|
-
theirCitedPages:
|
|
14817
|
+
theirCitedPages: z52.array(z52.object({ url: z52.string(), citedFor: z52.array(z52.string()) }))
|
|
14709
14818
|
});
|
|
14710
|
-
var competitorLandscapeSchema =
|
|
14819
|
+
var competitorLandscapeSchema = z52.object({
|
|
14711
14820
|
/** Project's own citation count (for the bar chart comparing project vs competitors). */
|
|
14712
|
-
projectCitationCount:
|
|
14713
|
-
competitors:
|
|
14821
|
+
projectCitationCount: z52.number(),
|
|
14822
|
+
competitors: z52.array(competitorRowSchema)
|
|
14714
14823
|
});
|
|
14715
|
-
var mentionRowSchema =
|
|
14716
|
-
domain:
|
|
14824
|
+
var mentionRowSchema = z52.object({
|
|
14825
|
+
domain: z52.string(),
|
|
14717
14826
|
/** Number of (query × provider) pairs whose answer text mentioned this competitor's brand or domain. */
|
|
14718
|
-
mentionCount:
|
|
14827
|
+
mentionCount: z52.number(),
|
|
14719
14828
|
/** Out-of count for the same denominator (snapshots that had answer text). */
|
|
14720
|
-
totalCount:
|
|
14829
|
+
totalCount: z52.number(),
|
|
14721
14830
|
/** 'High' | 'Moderate' | 'Low' | 'None' — mention frequency tier (mirrors CompetitorRow.pressureLabel). */
|
|
14722
|
-
pressureLabel:
|
|
14831
|
+
pressureLabel: z52.enum(["High", "Moderate", "Low", "None"]),
|
|
14723
14832
|
/** Distinct queries on which this competitor was mentioned. */
|
|
14724
|
-
mentionedQueries:
|
|
14833
|
+
mentionedQueries: z52.array(z52.string()),
|
|
14725
14834
|
/**
|
|
14726
14835
|
* Mention share 0..100. Numerator = this competitor's `mentionCount`.
|
|
14727
14836
|
* Denominator = sum of `mentionCount` across all competitors plus the
|
|
@@ -14730,122 +14839,122 @@ var mentionRowSchema = z51.object({
|
|
|
14730
14839
|
* split of the same head-to-head measure the project's hero
|
|
14731
14840
|
* `MentionShareDto` gauge headlines.
|
|
14732
14841
|
*/
|
|
14733
|
-
sharePct:
|
|
14842
|
+
sharePct: z52.number().nullable()
|
|
14734
14843
|
});
|
|
14735
|
-
var mentionLandscapeSectionSchema =
|
|
14844
|
+
var mentionLandscapeSectionSchema = z52.object({
|
|
14736
14845
|
shareOfVoice: visibilityStatsShareOfVoiceSchema.optional(),
|
|
14737
14846
|
/** Project's own mention count (for the bar chart comparing project vs competitors). */
|
|
14738
|
-
projectMentionCount:
|
|
14847
|
+
projectMentionCount: z52.number(),
|
|
14739
14848
|
/** Snapshots considered — those with non-empty answerText. Drives the totalCount denominator. */
|
|
14740
|
-
totalAnswerSnapshots:
|
|
14741
|
-
competitors:
|
|
14849
|
+
totalAnswerSnapshots: z52.number(),
|
|
14850
|
+
competitors: z52.array(mentionRowSchema)
|
|
14742
14851
|
});
|
|
14743
14852
|
var mentionLandscapeSchema = mentionLandscapeSectionSchema.extend({
|
|
14744
14853
|
/** `pooled` only when the project has no usable brand alias to classify by. */
|
|
14745
|
-
scope:
|
|
14854
|
+
scope: z52.enum(["non-brand", "pooled"]),
|
|
14746
14855
|
/** Non-brand queries — identical to the top-level counts, named so a reader can tell. */
|
|
14747
14856
|
nonBrand: mentionLandscapeSectionSchema,
|
|
14748
14857
|
/** Branded queries — recognition, not competitive placement. */
|
|
14749
14858
|
branded: mentionLandscapeSectionSchema
|
|
14750
14859
|
});
|
|
14751
|
-
var aiSourceCategoryBucketSchema =
|
|
14860
|
+
var aiSourceCategoryBucketSchema = z52.object({
|
|
14752
14861
|
/** Category slug from packages/contracts/src/source-categories. */
|
|
14753
|
-
category:
|
|
14862
|
+
category: z52.string(),
|
|
14754
14863
|
/** Display label. */
|
|
14755
|
-
label:
|
|
14864
|
+
label: z52.string(),
|
|
14756
14865
|
/** Number of citations falling in this category. */
|
|
14757
|
-
count:
|
|
14866
|
+
count: z52.number(),
|
|
14758
14867
|
/** 0..100 share of total citations. */
|
|
14759
|
-
sharePct:
|
|
14868
|
+
sharePct: z52.number()
|
|
14760
14869
|
});
|
|
14761
|
-
var aiSourceOriginSchema =
|
|
14762
|
-
categories:
|
|
14870
|
+
var aiSourceOriginSchema = z52.object({
|
|
14871
|
+
categories: z52.array(aiSourceCategoryBucketSchema),
|
|
14763
14872
|
/** Top 20 source domains by citation count (excluding the project's own domain). */
|
|
14764
|
-
topDomains:
|
|
14765
|
-
domain:
|
|
14766
|
-
count:
|
|
14873
|
+
topDomains: z52.array(z52.object({
|
|
14874
|
+
domain: z52.string(),
|
|
14875
|
+
count: z52.number(),
|
|
14767
14876
|
/** True when the domain is one of the project's tracked competitors. */
|
|
14768
|
-
isCompetitor:
|
|
14877
|
+
isCompetitor: z52.boolean()
|
|
14769
14878
|
}))
|
|
14770
14879
|
});
|
|
14771
|
-
var gscQueryRowSchema =
|
|
14772
|
-
query:
|
|
14773
|
-
clicks:
|
|
14774
|
-
impressions:
|
|
14775
|
-
ctr:
|
|
14776
|
-
avgPosition:
|
|
14880
|
+
var gscQueryRowSchema = z52.object({
|
|
14881
|
+
query: z52.string(),
|
|
14882
|
+
clicks: z52.number(),
|
|
14883
|
+
impressions: z52.number(),
|
|
14884
|
+
ctr: z52.number(),
|
|
14885
|
+
avgPosition: z52.number(),
|
|
14777
14886
|
/** Heuristic categorization: 'brand' | 'lead-gen' | 'industry' | 'other'. */
|
|
14778
|
-
category:
|
|
14779
|
-
});
|
|
14780
|
-
var gscSectionSchema =
|
|
14781
|
-
periodStart:
|
|
14782
|
-
periodEnd:
|
|
14783
|
-
totalClicks:
|
|
14784
|
-
totalImpressions:
|
|
14785
|
-
ctr:
|
|
14786
|
-
avgPosition:
|
|
14787
|
-
topQueries:
|
|
14788
|
-
categoryBreakdown:
|
|
14789
|
-
category:
|
|
14790
|
-
clicks:
|
|
14791
|
-
impressions:
|
|
14792
|
-
sharePct:
|
|
14887
|
+
category: z52.enum(["brand", "lead-gen", "industry", "other"])
|
|
14888
|
+
});
|
|
14889
|
+
var gscSectionSchema = z52.object({
|
|
14890
|
+
periodStart: z52.string(),
|
|
14891
|
+
periodEnd: z52.string(),
|
|
14892
|
+
totalClicks: z52.number(),
|
|
14893
|
+
totalImpressions: z52.number(),
|
|
14894
|
+
ctr: z52.number(),
|
|
14895
|
+
avgPosition: z52.number(),
|
|
14896
|
+
topQueries: z52.array(gscQueryRowSchema),
|
|
14897
|
+
categoryBreakdown: z52.array(z52.object({
|
|
14898
|
+
category: z52.enum(["brand", "lead-gen", "industry", "other"]),
|
|
14899
|
+
clicks: z52.number(),
|
|
14900
|
+
impressions: z52.number(),
|
|
14901
|
+
sharePct: z52.number()
|
|
14793
14902
|
})),
|
|
14794
|
-
trend:
|
|
14903
|
+
trend: z52.array(z52.object({ date: z52.string(), clicks: z52.number(), impressions: z52.number() })),
|
|
14795
14904
|
/**
|
|
14796
14905
|
* Tracked AEO queries that have no GSC impressions in the report window.
|
|
14797
14906
|
* Surfaces queries that may not represent real search demand.
|
|
14798
14907
|
*/
|
|
14799
|
-
trackedButNoGsc:
|
|
14908
|
+
trackedButNoGsc: z52.array(z52.string()),
|
|
14800
14909
|
/**
|
|
14801
14910
|
* GSC top queries (sorted by impressions desc) that are not tracked as
|
|
14802
14911
|
* AEO queries — the candidate set for adding to the AEO project.
|
|
14803
14912
|
*/
|
|
14804
|
-
gscButNotTracked:
|
|
14805
|
-
});
|
|
14806
|
-
var gaTrafficSectionSchema =
|
|
14807
|
-
totalSessions:
|
|
14808
|
-
totalUsers:
|
|
14809
|
-
totalOrganicSessions:
|
|
14810
|
-
periodStart:
|
|
14811
|
-
periodEnd:
|
|
14812
|
-
topLandingPages:
|
|
14813
|
-
page:
|
|
14814
|
-
sessions:
|
|
14913
|
+
gscButNotTracked: z52.array(z52.string())
|
|
14914
|
+
});
|
|
14915
|
+
var gaTrafficSectionSchema = z52.object({
|
|
14916
|
+
totalSessions: z52.number(),
|
|
14917
|
+
totalUsers: z52.number(),
|
|
14918
|
+
totalOrganicSessions: z52.number(),
|
|
14919
|
+
periodStart: z52.string(),
|
|
14920
|
+
periodEnd: z52.string(),
|
|
14921
|
+
topLandingPages: z52.array(z52.object({
|
|
14922
|
+
page: z52.string(),
|
|
14923
|
+
sessions: z52.number(),
|
|
14815
14924
|
/**
|
|
14816
14925
|
* @deprecated Never emitted. A per-landing-page user count cannot be
|
|
14817
14926
|
* summed: GA evaluates users as a COUNT DISTINCT at the requested grain,
|
|
14818
14927
|
* so a visitor is counted once per page and per day. Kept optional so
|
|
14819
14928
|
* existing consumers keep parsing.
|
|
14820
14929
|
*/
|
|
14821
|
-
users:
|
|
14822
|
-
organicSessions:
|
|
14930
|
+
users: z52.number().optional(),
|
|
14931
|
+
organicSessions: z52.number()
|
|
14823
14932
|
})),
|
|
14824
|
-
channelBreakdown:
|
|
14825
|
-
channel:
|
|
14826
|
-
sessions:
|
|
14827
|
-
sharePct:
|
|
14933
|
+
channelBreakdown: z52.array(z52.object({
|
|
14934
|
+
channel: z52.string(),
|
|
14935
|
+
sessions: z52.number(),
|
|
14936
|
+
sharePct: z52.number()
|
|
14828
14937
|
}))
|
|
14829
14938
|
});
|
|
14830
|
-
var socialReferralSectionSchema =
|
|
14831
|
-
totalSessions:
|
|
14832
|
-
organicSessions:
|
|
14833
|
-
paidSessions:
|
|
14834
|
-
channels:
|
|
14835
|
-
channelGroup:
|
|
14836
|
-
sessions:
|
|
14837
|
-
sharePct:
|
|
14939
|
+
var socialReferralSectionSchema = z52.object({
|
|
14940
|
+
totalSessions: z52.number(),
|
|
14941
|
+
organicSessions: z52.number(),
|
|
14942
|
+
paidSessions: z52.number(),
|
|
14943
|
+
channels: z52.array(z52.object({
|
|
14944
|
+
channelGroup: z52.string(),
|
|
14945
|
+
sessions: z52.number(),
|
|
14946
|
+
sharePct: z52.number()
|
|
14838
14947
|
})),
|
|
14839
|
-
topCampaigns:
|
|
14840
|
-
source:
|
|
14841
|
-
medium:
|
|
14842
|
-
sessions:
|
|
14948
|
+
topCampaigns: z52.array(z52.object({
|
|
14949
|
+
source: z52.string(),
|
|
14950
|
+
medium: z52.string(),
|
|
14951
|
+
sessions: z52.number()
|
|
14843
14952
|
}))
|
|
14844
14953
|
});
|
|
14845
|
-
var aiReferralSectionSchema =
|
|
14846
|
-
totalSessions:
|
|
14847
|
-
paidSessions:
|
|
14848
|
-
organicSessions:
|
|
14954
|
+
var aiReferralSectionSchema = z52.object({
|
|
14955
|
+
totalSessions: z52.number(),
|
|
14956
|
+
paidSessions: z52.number(),
|
|
14957
|
+
organicSessions: z52.number(),
|
|
14849
14958
|
/**
|
|
14850
14959
|
* @deprecated Never emitted since 4.127.0 and removed in the next major.
|
|
14851
14960
|
*
|
|
@@ -14858,38 +14967,38 @@ var aiReferralSectionSchema = z51.object({
|
|
|
14858
14967
|
* deleted so existing API / `canonry report --format json` / MCP consumers
|
|
14859
14968
|
* keep parsing; they now read `undefined` instead of an inflated number.
|
|
14860
14969
|
*/
|
|
14861
|
-
totalUsers:
|
|
14970
|
+
totalUsers: z52.number().optional(),
|
|
14862
14971
|
/** @deprecated See `totalUsers`. Never emitted since 4.127.0. */
|
|
14863
|
-
paidUsers:
|
|
14972
|
+
paidUsers: z52.number().optional(),
|
|
14864
14973
|
/** @deprecated See `totalUsers`. Never emitted since 4.127.0. */
|
|
14865
|
-
organicUsers:
|
|
14866
|
-
bySource:
|
|
14867
|
-
source:
|
|
14868
|
-
sessions:
|
|
14974
|
+
organicUsers: z52.number().optional(),
|
|
14975
|
+
bySource: z52.array(z52.object({
|
|
14976
|
+
source: z52.string(),
|
|
14977
|
+
sessions: z52.number(),
|
|
14869
14978
|
/** @deprecated See `totalUsers`. Never emitted since 4.127.0. */
|
|
14870
|
-
users:
|
|
14871
|
-
paidSessions:
|
|
14872
|
-
organicSessions:
|
|
14873
|
-
sharePct:
|
|
14979
|
+
users: z52.number().optional(),
|
|
14980
|
+
paidSessions: z52.number(),
|
|
14981
|
+
organicSessions: z52.number(),
|
|
14982
|
+
sharePct: z52.number()
|
|
14874
14983
|
})),
|
|
14875
|
-
trend:
|
|
14876
|
-
topLandingPages:
|
|
14877
|
-
page:
|
|
14878
|
-
sessions:
|
|
14984
|
+
trend: z52.array(z52.object({ date: z52.string(), sessions: z52.number() })),
|
|
14985
|
+
topLandingPages: z52.array(z52.object({
|
|
14986
|
+
page: z52.string(),
|
|
14987
|
+
sessions: z52.number(),
|
|
14879
14988
|
/** @deprecated See `totalUsers`. Never emitted since 4.127.0. */
|
|
14880
|
-
users:
|
|
14989
|
+
users: z52.number().optional()
|
|
14881
14990
|
}))
|
|
14882
14991
|
});
|
|
14883
|
-
var serverActivitySectionSchema =
|
|
14992
|
+
var serverActivitySectionSchema = z52.object({
|
|
14884
14993
|
/** ISO8601 inclusive lower bound of the report window (default: 7 days). */
|
|
14885
|
-
windowStart:
|
|
14994
|
+
windowStart: z52.string(),
|
|
14886
14995
|
/** ISO8601 inclusive upper bound. */
|
|
14887
|
-
windowEnd:
|
|
14888
|
-
hasData:
|
|
14996
|
+
windowEnd: z52.string(),
|
|
14997
|
+
hasData: z52.boolean(),
|
|
14889
14998
|
/** Last-7d total verified crawler hits, with prior 7d for delta. */
|
|
14890
|
-
verifiedCrawlerHits:
|
|
14999
|
+
verifiedCrawlerHits: z52.object({ current: z52.number(), prior: z52.number(), deltaPct: z52.number().nullable() }),
|
|
14891
15000
|
/** Last-7d total unverified crawler hits, separated from verified trust metrics. */
|
|
14892
|
-
unverifiedCrawlerHits:
|
|
15001
|
+
unverifiedCrawlerHits: z52.object({ current: z52.number(), prior: z52.number(), deltaPct: z52.number().nullable() }),
|
|
14893
15002
|
/**
|
|
14894
15003
|
* Last-7d on-demand per-user fetches from AI surfaces (ChatGPT-User,
|
|
14895
15004
|
* Perplexity-User, MistralAI-User). Disjoint from `verifiedCrawlerHits` /
|
|
@@ -14898,7 +15007,7 @@ var serverActivitySectionSchema = z51.object({
|
|
|
14898
15007
|
* because the operational question for user-fetch is "is this happening?"
|
|
14899
15008
|
* not "is this a confirmed bot identity?"
|
|
14900
15009
|
*/
|
|
14901
|
-
aiUserFetchHits:
|
|
15010
|
+
aiUserFetchHits: z52.object({ current: z52.number(), prior: z52.number(), deltaPct: z52.number().nullable() }),
|
|
14902
15011
|
/**
|
|
14903
15012
|
* Last-7d AI-referral sessions (sessionized from server-side request
|
|
14904
15013
|
* evidence). Paid + organic + unclassified. Excludes subresource fetches and
|
|
@@ -14906,7 +15015,7 @@ var serverActivitySectionSchema = z51.object({
|
|
|
14906
15015
|
* not an arrival, and its destination raises its own row. Redirect-answered
|
|
14907
15016
|
* requests are reported separately in `referralRedirects`.
|
|
14908
15017
|
*/
|
|
14909
|
-
referralArrivals:
|
|
15018
|
+
referralArrivals: z52.object({ current: z52.number(), prior: z52.number(), deltaPct: z52.number().nullable() }),
|
|
14910
15019
|
/**
|
|
14911
15020
|
* AI-referred requests in the current window that were answered with a
|
|
14912
15021
|
* Location redirect instead of a page. Not arrivals — but a site where this
|
|
@@ -14914,7 +15023,7 @@ var serverActivitySectionSchema = z51.object({
|
|
|
14914
15023
|
* is exactly the thing to fix, so the report must be able to say it rather
|
|
14915
15024
|
* than render an empty section.
|
|
14916
15025
|
*/
|
|
14917
|
-
referralRedirects:
|
|
15026
|
+
referralRedirects: z52.number().int().nonnegative(),
|
|
14918
15027
|
/**
|
|
14919
15028
|
* `referralArrivals` split by traffic class. The three buckets sum to it.
|
|
14920
15029
|
*
|
|
@@ -14923,23 +15032,23 @@ var serverActivitySectionSchema = z51.object({
|
|
|
14923
15032
|
* never be resolved. Reporting them as organic would overstate earned AI
|
|
14924
15033
|
* traffic by exactly a client's ad volume.
|
|
14925
15034
|
*/
|
|
14926
|
-
referralArrivalsByClass:
|
|
14927
|
-
paid:
|
|
14928
|
-
organic:
|
|
14929
|
-
unclassified:
|
|
15035
|
+
referralArrivalsByClass: z52.object({
|
|
15036
|
+
paid: z52.object({ current: z52.number(), prior: z52.number(), deltaPct: z52.number().nullable() }),
|
|
15037
|
+
organic: z52.object({ current: z52.number(), prior: z52.number(), deltaPct: z52.number().nullable() }),
|
|
15038
|
+
unclassified: z52.object({ current: z52.number(), prior: z52.number(), deltaPct: z52.number().nullable() })
|
|
14930
15039
|
}),
|
|
14931
15040
|
/** Pre-rendered one-line breakdown, e.g. "Paid 1,200 · Organic 24". Empty when there is nothing to split. */
|
|
14932
|
-
referralArrivalsClassSummary:
|
|
15041
|
+
referralArrivalsClassSummary: z52.string(),
|
|
14933
15042
|
/** Per-AI-operator breakdown (OpenAI, Anthropic, Google AI, Perplexity, …). */
|
|
14934
|
-
byOperator:
|
|
14935
|
-
operator:
|
|
14936
|
-
verifiedHits:
|
|
15043
|
+
byOperator: z52.array(z52.object({
|
|
15044
|
+
operator: z52.string(),
|
|
15045
|
+
verifiedHits: z52.number(),
|
|
14937
15046
|
/** Shown to agency audience only: claimed-bot UA, source IP not in a published range. */
|
|
14938
|
-
unverifiedHits:
|
|
15047
|
+
unverifiedHits: z52.number(),
|
|
14939
15048
|
/** Per-user fetches from this operator's AI surface (ChatGPT-User, …). */
|
|
14940
|
-
userFetchHits:
|
|
14941
|
-
referralArrivals:
|
|
14942
|
-
deltaPct:
|
|
15049
|
+
userFetchHits: z52.number(),
|
|
15050
|
+
referralArrivals: z52.number(),
|
|
15051
|
+
deltaPct: z52.number().nullable()
|
|
14943
15052
|
})),
|
|
14944
15053
|
/**
|
|
14945
15054
|
* Top crawled paths (verified only, last-7d). Path-level citation cross-reference
|
|
@@ -14949,9 +15058,9 @@ var serverActivitySectionSchema = z51.object({
|
|
|
14949
15058
|
* citation evidence can extend this entry with a `citationState` field without
|
|
14950
15059
|
* breaking the contract.
|
|
14951
15060
|
*/
|
|
14952
|
-
topCrawledPaths:
|
|
14953
|
-
path:
|
|
14954
|
-
verifiedHits:
|
|
15061
|
+
topCrawledPaths: z52.array(z52.object({
|
|
15062
|
+
path: z52.string(),
|
|
15063
|
+
verifiedHits: z52.number(),
|
|
14955
15064
|
/**
|
|
14956
15065
|
* Hits from a crawler that identified itself but whose source IP could not
|
|
14957
15066
|
* be matched against the operator's published ranges. Additive, not an
|
|
@@ -14959,88 +15068,88 @@ var serverActivitySectionSchema = z51.object({
|
|
|
14959
15068
|
* logs, for one), so for those projects every hit lands here and a
|
|
14960
15069
|
* verified-only view reports zero against real crawl activity.
|
|
14961
15070
|
*/
|
|
14962
|
-
unverifiedHits:
|
|
15071
|
+
unverifiedHits: z52.number().default(0),
|
|
14963
15072
|
/** How many distinct AI operators crawled this path in the window. */
|
|
14964
|
-
distinctOperators:
|
|
15073
|
+
distinctOperators: z52.number()
|
|
14965
15074
|
})),
|
|
14966
15075
|
/** AI products that sent ≥1 session in the window (referral by destination). */
|
|
14967
|
-
referralProducts:
|
|
14968
|
-
product:
|
|
14969
|
-
arrivals:
|
|
14970
|
-
distinctLandingPaths:
|
|
15076
|
+
referralProducts: z52.array(z52.object({
|
|
15077
|
+
product: z52.string(),
|
|
15078
|
+
arrivals: z52.number(),
|
|
15079
|
+
distinctLandingPaths: z52.number()
|
|
14971
15080
|
})),
|
|
14972
15081
|
/** Daily trend, last 14d for sparkline / chart rendering. */
|
|
14973
|
-
dailyTrend:
|
|
14974
|
-
date:
|
|
14975
|
-
verifiedCrawlerHits:
|
|
15082
|
+
dailyTrend: z52.array(z52.object({
|
|
15083
|
+
date: z52.string(),
|
|
15084
|
+
verifiedCrawlerHits: z52.number(),
|
|
14976
15085
|
/** See topCrawledPaths.unverifiedHits. Plotted alongside, never instead. */
|
|
14977
|
-
unverifiedCrawlerHits:
|
|
14978
|
-
userFetchHits:
|
|
14979
|
-
referralArrivals:
|
|
15086
|
+
unverifiedCrawlerHits: z52.number().default(0),
|
|
15087
|
+
userFetchHits: z52.number(),
|
|
15088
|
+
referralArrivals: z52.number()
|
|
14980
15089
|
})),
|
|
14981
15090
|
/**
|
|
14982
15091
|
* Top landing paths for AI-referral sessions (last-7d).
|
|
14983
15092
|
* Complements `topCrawledPaths` (what bots fetch) with what humans actually land on.
|
|
14984
15093
|
*/
|
|
14985
|
-
topReferralLandingPaths:
|
|
14986
|
-
path:
|
|
14987
|
-
arrivals:
|
|
14988
|
-
distinctProducts:
|
|
15094
|
+
topReferralLandingPaths: z52.array(z52.object({
|
|
15095
|
+
path: z52.string(),
|
|
15096
|
+
arrivals: z52.number(),
|
|
15097
|
+
distinctProducts: z52.number()
|
|
14989
15098
|
}))
|
|
14990
15099
|
});
|
|
14991
|
-
var indexingHealthSectionSchema =
|
|
15100
|
+
var indexingHealthSectionSchema = z52.object({
|
|
14992
15101
|
/** Source: 'google' | 'bing' | null when neither is connected. */
|
|
14993
|
-
provider:
|
|
14994
|
-
total:
|
|
14995
|
-
indexed:
|
|
14996
|
-
notIndexed:
|
|
15102
|
+
provider: z52.enum(["google", "bing"]).nullable(),
|
|
15103
|
+
total: z52.number(),
|
|
15104
|
+
indexed: z52.number(),
|
|
15105
|
+
notIndexed: z52.number(),
|
|
14997
15106
|
/** Google-only — pages explicitly marked as deindexed. Bing reports 'unknown' instead. */
|
|
14998
|
-
deindexed:
|
|
15107
|
+
deindexed: z52.number(),
|
|
14999
15108
|
/** Bing-only — pages with no inspection data yet. */
|
|
15000
|
-
unknown:
|
|
15109
|
+
unknown: z52.number(),
|
|
15001
15110
|
/** 0..100. */
|
|
15002
|
-
indexedPct:
|
|
15111
|
+
indexedPct: z52.number()
|
|
15003
15112
|
});
|
|
15004
|
-
var citationsTrendPointSchema =
|
|
15113
|
+
var citationsTrendPointSchema = z52.object({
|
|
15005
15114
|
/** Run ID — anchor for cross-section linking. */
|
|
15006
|
-
runId:
|
|
15115
|
+
runId: z52.string(),
|
|
15007
15116
|
/** ISO timestamp when the run finished (or createdAt fallback). */
|
|
15008
|
-
date:
|
|
15117
|
+
date: z52.string(),
|
|
15009
15118
|
/**
|
|
15010
15119
|
* 0..100 — same per-query unique-cited definition as
|
|
15011
15120
|
* `ReportExecutiveSummary.citationRate`. Stable across runs with different
|
|
15012
15121
|
* provider counts so the trend line measures real movement rather than
|
|
15013
15122
|
* provider-count variance.
|
|
15014
15123
|
*/
|
|
15015
|
-
citationRate:
|
|
15124
|
+
citationRate: z52.number(),
|
|
15016
15125
|
/** Numerator of `citationRate` for this run. */
|
|
15017
|
-
citedQueryCount:
|
|
15126
|
+
citedQueryCount: z52.number(),
|
|
15018
15127
|
/** Denominator of `citationRate` for this run. */
|
|
15019
|
-
totalQueryCount:
|
|
15128
|
+
totalQueryCount: z52.number(),
|
|
15020
15129
|
/** 0..100 — same per-query unique-mentioned definition as `ReportExecutiveSummary.mentionRate`. */
|
|
15021
|
-
mentionRate:
|
|
15130
|
+
mentionRate: z52.number(),
|
|
15022
15131
|
/** Numerator of `mentionRate` for this run. */
|
|
15023
|
-
mentionedQueryCount:
|
|
15132
|
+
mentionedQueryCount: z52.number(),
|
|
15024
15133
|
/**
|
|
15025
15134
|
* Per-provider rates for the same run. Each provider's rate is per-pair
|
|
15026
15135
|
* within that provider (`cited / scanned`), so it remains comparable
|
|
15027
15136
|
* between providers in the same run.
|
|
15028
15137
|
*/
|
|
15029
|
-
providerRates:
|
|
15030
|
-
provider:
|
|
15031
|
-
citationRate:
|
|
15032
|
-
mentionRate:
|
|
15138
|
+
providerRates: z52.array(z52.object({
|
|
15139
|
+
provider: z52.string(),
|
|
15140
|
+
citationRate: z52.number(),
|
|
15141
|
+
mentionRate: z52.number()
|
|
15033
15142
|
}))
|
|
15034
15143
|
});
|
|
15035
|
-
var reportInsightSchema =
|
|
15036
|
-
id:
|
|
15037
|
-
type:
|
|
15038
|
-
severity:
|
|
15039
|
-
title:
|
|
15040
|
-
query:
|
|
15041
|
-
provider:
|
|
15042
|
-
recommendation:
|
|
15043
|
-
createdAt:
|
|
15144
|
+
var reportInsightSchema = z52.object({
|
|
15145
|
+
id: z52.string(),
|
|
15146
|
+
type: z52.enum(["regression", "gain", "opportunity"]),
|
|
15147
|
+
severity: z52.enum(["critical", "high", "medium", "low"]),
|
|
15148
|
+
title: z52.string(),
|
|
15149
|
+
query: z52.string(),
|
|
15150
|
+
provider: z52.string(),
|
|
15151
|
+
recommendation: z52.string().nullable(),
|
|
15152
|
+
createdAt: z52.string(),
|
|
15044
15153
|
/**
|
|
15045
15154
|
* How many times this insight fired across recent runs for the same
|
|
15046
15155
|
* `(query, provider, type)` tuple. Always ≥ 1. Insights returned by the
|
|
@@ -15048,64 +15157,64 @@ var reportInsightSchema = z51.object({
|
|
|
15048
15157
|
* surfacing the multiplicity. Use it directly instead of grouping again
|
|
15049
15158
|
* client-side — counts derived from raw insight rows will overcount.
|
|
15050
15159
|
*/
|
|
15051
|
-
instanceCount:
|
|
15160
|
+
instanceCount: z52.number()
|
|
15052
15161
|
});
|
|
15053
|
-
var recommendedNextStepSchema =
|
|
15162
|
+
var recommendedNextStepSchema = z52.object({
|
|
15054
15163
|
/** 'immediate' | 'short-term' | 'medium-term' — bucketed by severity heuristic. */
|
|
15055
|
-
horizon:
|
|
15056
|
-
title:
|
|
15057
|
-
rationale:
|
|
15164
|
+
horizon: z52.enum(["immediate", "short-term", "medium-term"]),
|
|
15165
|
+
title: z52.string(),
|
|
15166
|
+
rationale: z52.string()
|
|
15058
15167
|
});
|
|
15059
|
-
var reportRateDeltaSchema =
|
|
15168
|
+
var reportRateDeltaSchema = z52.object({
|
|
15060
15169
|
/** Current value (0..100 for rates, raw count otherwise). When `window`
|
|
15061
15170
|
* is present this is the average over the last `window` checks. */
|
|
15062
|
-
current:
|
|
15171
|
+
current: z52.number(),
|
|
15063
15172
|
/** Prior value compared against. When `window` is present this is the
|
|
15064
15173
|
* average over the prior `window` checks before that. */
|
|
15065
|
-
prior:
|
|
15174
|
+
prior: z52.number(),
|
|
15066
15175
|
/** Absolute delta (current − prior). Negative = decrease. */
|
|
15067
|
-
deltaAbs:
|
|
15176
|
+
deltaAbs: z52.number(),
|
|
15068
15177
|
/**
|
|
15069
15178
|
* Signed percent change vs `prior`, rounded to a whole number. Null when
|
|
15070
15179
|
* `prior <= 0` (percentage undefined). Renderers route count/traffic tiles
|
|
15071
15180
|
* through the "smart %" rule — percentage when the prior base is large
|
|
15072
15181
|
* enough (`MIN_PCT_BASE`), otherwise a rounded raw delta.
|
|
15073
15182
|
*/
|
|
15074
|
-
deltaPct:
|
|
15183
|
+
deltaPct: z52.number().nullable(),
|
|
15075
15184
|
/**
|
|
15076
15185
|
* Direction tag for tone mapping. Threshold is metric-specific (3pp for
|
|
15077
15186
|
* rates, 0.5 for counts) so small noise lands as 'flat' rather than
|
|
15078
15187
|
* flipping up/down each run.
|
|
15079
15188
|
*/
|
|
15080
|
-
direction:
|
|
15189
|
+
direction: z52.enum(["up", "down", "flat"]),
|
|
15081
15190
|
/**
|
|
15082
15191
|
* How many points went into each side of the average. Omitted (or 1)
|
|
15083
15192
|
* means point-to-point (legacy "since last check"). Higher values mean
|
|
15084
15193
|
* a rolling-average comparison — renderers should label it as
|
|
15085
15194
|
* "vs prior N checks" when this is ≥ 2.
|
|
15086
15195
|
*/
|
|
15087
|
-
window:
|
|
15196
|
+
window: z52.number().optional()
|
|
15088
15197
|
});
|
|
15089
|
-
var reportProviderMovementSchema =
|
|
15090
|
-
provider:
|
|
15091
|
-
current:
|
|
15092
|
-
prior:
|
|
15093
|
-
deltaAbs:
|
|
15094
|
-
direction:
|
|
15198
|
+
var reportProviderMovementSchema = z52.object({
|
|
15199
|
+
provider: z52.string(),
|
|
15200
|
+
current: z52.number(),
|
|
15201
|
+
prior: z52.number(),
|
|
15202
|
+
deltaAbs: z52.number(),
|
|
15203
|
+
direction: z52.enum(["up", "down", "flat"])
|
|
15095
15204
|
});
|
|
15096
|
-
var whatsChangedSectionSchema =
|
|
15205
|
+
var whatsChangedSectionSchema = z52.object({
|
|
15097
15206
|
/**
|
|
15098
15207
|
* False when there's no prior run (or fewer than the trend baseline),
|
|
15099
15208
|
* meaning all per-metric deltas will be null. Renderers use this to swap
|
|
15100
15209
|
* in a "establishing baseline" fallback rather than rendering empty
|
|
15101
15210
|
* delta tiles.
|
|
15102
15211
|
*/
|
|
15103
|
-
enoughHistory:
|
|
15212
|
+
enoughHistory: z52.boolean(),
|
|
15104
15213
|
/**
|
|
15105
15214
|
* One-sentence narrative summary suitable as a section subtitle.
|
|
15106
15215
|
* Always present — even on baseline, narrates whatever signal exists.
|
|
15107
15216
|
*/
|
|
15108
|
-
headline:
|
|
15217
|
+
headline: z52.string(),
|
|
15109
15218
|
/** Citation rate delta vs the prior completed run. Null when no prior run. */
|
|
15110
15219
|
citationRate: reportRateDeltaSchema.nullable(),
|
|
15111
15220
|
/** Mention rate delta vs the prior completed run. Null when no prior run. */
|
|
@@ -15133,30 +15242,30 @@ var whatsChangedSectionSchema = z51.object({
|
|
|
15133
15242
|
* deltas "vs prior {comparisonWindowDays} days" off this single value so the
|
|
15134
15243
|
* SPA and HTML stay verbatim-identical.
|
|
15135
15244
|
*/
|
|
15136
|
-
comparisonWindowDays:
|
|
15245
|
+
comparisonWindowDays: z52.number().int().positive(),
|
|
15137
15246
|
/**
|
|
15138
15247
|
* Per-provider citation rate movements (latest run vs prior run). Empty
|
|
15139
15248
|
* when no prior run. Sorted by |deltaAbs| desc — providers with the
|
|
15140
15249
|
* biggest swing first.
|
|
15141
15250
|
*/
|
|
15142
|
-
providerMovements:
|
|
15251
|
+
providerMovements: z52.array(reportProviderMovementSchema),
|
|
15143
15252
|
/**
|
|
15144
15253
|
* Top wins this period — gains surfaced by the intelligence engine.
|
|
15145
15254
|
* Capped at 5; sourced from `insights` filtered to `type: 'gain'`.
|
|
15146
15255
|
*/
|
|
15147
|
-
wins:
|
|
15256
|
+
wins: z52.array(reportInsightSchema),
|
|
15148
15257
|
/**
|
|
15149
15258
|
* Top regressions this period — citations or mentions lost. Capped at 5;
|
|
15150
15259
|
* sourced from `insights` filtered to `type: 'regression'`.
|
|
15151
15260
|
*/
|
|
15152
|
-
regressions:
|
|
15153
|
-
});
|
|
15154
|
-
var reportAudienceSchema =
|
|
15155
|
-
var reportActionAudienceSchema =
|
|
15156
|
-
var reportActionHorizonSchema =
|
|
15157
|
-
var reportActionConfidenceSchema =
|
|
15158
|
-
var reportToneSchema =
|
|
15159
|
-
var reportActionCategorySchema =
|
|
15261
|
+
regressions: z52.array(reportInsightSchema)
|
|
15262
|
+
});
|
|
15263
|
+
var reportAudienceSchema = z52.enum(["agency", "client"]);
|
|
15264
|
+
var reportActionAudienceSchema = z52.enum(["agency", "client", "both"]);
|
|
15265
|
+
var reportActionHorizonSchema = z52.enum(["immediate", "short-term", "medium-term"]);
|
|
15266
|
+
var reportActionConfidenceSchema = z52.enum(["high", "medium", "low"]);
|
|
15267
|
+
var reportToneSchema = z52.enum(["positive", "caution", "negative", "neutral"]);
|
|
15268
|
+
var reportActionCategorySchema = z52.enum([
|
|
15160
15269
|
"content",
|
|
15161
15270
|
"competitors",
|
|
15162
15271
|
"provider",
|
|
@@ -15165,23 +15274,23 @@ var reportActionCategorySchema = z51.enum([
|
|
|
15165
15274
|
"location",
|
|
15166
15275
|
"monitoring"
|
|
15167
15276
|
]);
|
|
15168
|
-
var reportActionPlanItemSchema =
|
|
15277
|
+
var reportActionPlanItemSchema = z52.object({
|
|
15169
15278
|
/** Which report audience should see this action. `both` renders in both modes. */
|
|
15170
15279
|
audience: reportActionAudienceSchema,
|
|
15171
15280
|
/** Stable sort priority. Lower numbers render earlier. */
|
|
15172
|
-
priority:
|
|
15281
|
+
priority: z52.number(),
|
|
15173
15282
|
/** When this should be tackled. */
|
|
15174
15283
|
horizon: reportActionHorizonSchema,
|
|
15175
15284
|
category: reportActionCategorySchema,
|
|
15176
|
-
title:
|
|
15285
|
+
title: z52.string(),
|
|
15177
15286
|
/** Direct next step written as an operator/client-friendly imperative. */
|
|
15178
|
-
action:
|
|
15287
|
+
action: z52.string(),
|
|
15179
15288
|
/** Why this matters. Keep each entry concise and evidence-backed. */
|
|
15180
|
-
why:
|
|
15289
|
+
why: z52.array(z52.string()),
|
|
15181
15290
|
/** Specific observations that justify the action. */
|
|
15182
|
-
evidence:
|
|
15291
|
+
evidence: z52.array(z52.string()),
|
|
15183
15292
|
/** What should move if the action worked. */
|
|
15184
|
-
successMetric:
|
|
15293
|
+
successMetric: z52.string(),
|
|
15185
15294
|
/** Confidence in the recommendation based on the available evidence. */
|
|
15186
15295
|
confidence: reportActionConfidenceSchema,
|
|
15187
15296
|
/**
|
|
@@ -15193,23 +15302,23 @@ var reportActionPlanItemSchema = z51.object({
|
|
|
15193
15302
|
* load. Actions sourced from other signals (competitor gaps, indexing
|
|
15194
15303
|
* issues, etc.) omit this and use their own dismiss flows.
|
|
15195
15304
|
*/
|
|
15196
|
-
targetRef:
|
|
15305
|
+
targetRef: z52.string().optional()
|
|
15197
15306
|
});
|
|
15198
|
-
var reportClientSummarySchema =
|
|
15199
|
-
headline:
|
|
15200
|
-
overview:
|
|
15201
|
-
actionItems:
|
|
15202
|
-
confidenceNotes:
|
|
15307
|
+
var reportClientSummarySchema = z52.object({
|
|
15308
|
+
headline: z52.string(),
|
|
15309
|
+
overview: z52.string(),
|
|
15310
|
+
actionItems: z52.array(reportActionPlanItemSchema),
|
|
15311
|
+
confidenceNotes: z52.array(z52.string())
|
|
15203
15312
|
});
|
|
15204
|
-
var reportAgencyDiagnosticSchema =
|
|
15205
|
-
title:
|
|
15206
|
-
detail:
|
|
15207
|
-
severity:
|
|
15208
|
-
evidence:
|
|
15313
|
+
var reportAgencyDiagnosticSchema = z52.object({
|
|
15314
|
+
title: z52.string(),
|
|
15315
|
+
detail: z52.string(),
|
|
15316
|
+
severity: z52.enum(["positive", "caution", "negative", "neutral"]),
|
|
15317
|
+
evidence: z52.array(z52.string())
|
|
15209
15318
|
});
|
|
15210
|
-
var reportAgencyDiagnosticsSchema =
|
|
15211
|
-
priorities:
|
|
15212
|
-
diagnostics:
|
|
15319
|
+
var reportAgencyDiagnosticsSchema = z52.object({
|
|
15320
|
+
priorities: z52.array(reportActionPlanItemSchema),
|
|
15321
|
+
diagnostics: z52.array(reportAgencyDiagnosticSchema)
|
|
15213
15322
|
});
|
|
15214
15323
|
function reportActionTone(action) {
|
|
15215
15324
|
if (action.horizon === "immediate") return "negative";
|
|
@@ -15267,7 +15376,9 @@ function reportConfidenceLabel(confidence) {
|
|
|
15267
15376
|
return "Low";
|
|
15268
15377
|
}
|
|
15269
15378
|
}
|
|
15270
|
-
var projectReportDtoSchema =
|
|
15379
|
+
var projectReportDtoSchema = z52.object({
|
|
15380
|
+
/** Authoritative assignment-aware answer coverage, separated by frozen query class. */
|
|
15381
|
+
visibility: reportVisibilitySchema.optional(),
|
|
15271
15382
|
meta: reportMetaSchema,
|
|
15272
15383
|
executiveSummary: reportExecutiveSummarySchema,
|
|
15273
15384
|
citationScorecard: citationScorecardSchema,
|
|
@@ -15281,16 +15392,16 @@ var projectReportDtoSchema = z51.object({
|
|
|
15281
15392
|
/** Server-side log-evidence visibility (crawls + click-through sessions). Null when no traffic source connected. */
|
|
15282
15393
|
serverActivity: serverActivitySectionSchema.nullable(),
|
|
15283
15394
|
indexingHealth: indexingHealthSectionSchema.nullable(),
|
|
15284
|
-
citationsTrend:
|
|
15395
|
+
citationsTrend: z52.array(citationsTrendPointSchema),
|
|
15285
15396
|
/**
|
|
15286
15397
|
* Trend-focused "what's changed" summary for the report's act 2. Always
|
|
15287
15398
|
* present; renderers gate empty/baseline states via `enoughHistory`.
|
|
15288
15399
|
*/
|
|
15289
15400
|
whatsChanged: whatsChangedSectionSchema,
|
|
15290
|
-
insights:
|
|
15291
|
-
recommendedNextSteps:
|
|
15401
|
+
insights: z52.array(reportInsightSchema),
|
|
15402
|
+
recommendedNextSteps: z52.array(recommendedNextStepSchema),
|
|
15292
15403
|
/** Canonical structured actions shared by the client and agency render modes. */
|
|
15293
|
-
actionPlan:
|
|
15404
|
+
actionPlan: z52.array(reportActionPlanItemSchema),
|
|
15294
15405
|
/** Polished client-facing summary and action shortlist. */
|
|
15295
15406
|
clientSummary: reportClientSummarySchema,
|
|
15296
15407
|
/** Technical, evidence-oriented operator diagnostics for agency mode. */
|
|
@@ -15300,114 +15411,114 @@ var projectReportDtoSchema = z51.object({
|
|
|
15300
15411
|
* intelligence layer (`buildContentTargetRows`). Empty when no run has
|
|
15301
15412
|
* produced candidate queries with demand or competitor signal.
|
|
15302
15413
|
*/
|
|
15303
|
-
contentOpportunities:
|
|
15414
|
+
contentOpportunities: z52.array(contentTargetRowDtoSchema),
|
|
15304
15415
|
/**
|
|
15305
15416
|
* Queries where competitors were cited but the project was not. Sourced
|
|
15306
15417
|
* from `buildContentGapRows`. Empty until the first answer-visibility run.
|
|
15307
15418
|
*/
|
|
15308
|
-
contentGaps:
|
|
15419
|
+
contentGaps: z52.array(contentGapRowDtoSchema),
|
|
15309
15420
|
/**
|
|
15310
15421
|
* Per-query grounding source map (own + competitor cited URLs). Sourced
|
|
15311
15422
|
* from `buildContentSourceRows`. Empty until the first answer-visibility run.
|
|
15312
15423
|
*/
|
|
15313
|
-
groundingSources:
|
|
15424
|
+
groundingSources: z52.array(contentSourceRowDtoSchema)
|
|
15314
15425
|
});
|
|
15315
15426
|
|
|
15316
15427
|
// ../contracts/src/organic-evidence.ts
|
|
15317
|
-
import { z as
|
|
15318
|
-
var organicEvidencePeriodSchema =
|
|
15319
|
-
var cohortNameSchema =
|
|
15320
|
-
var countSchema =
|
|
15321
|
-
clicks:
|
|
15322
|
-
impressions:
|
|
15428
|
+
import { z as z53 } from "zod";
|
|
15429
|
+
var organicEvidencePeriodSchema = z53.union([z53.literal(60), z53.literal(90)]);
|
|
15430
|
+
var cohortNameSchema = z53.enum(["earliest", "middle", "prior", "latest"]);
|
|
15431
|
+
var countSchema = z53.object({
|
|
15432
|
+
clicks: z53.number().int().nonnegative(),
|
|
15433
|
+
impressions: z53.number().int().nonnegative()
|
|
15323
15434
|
});
|
|
15324
|
-
var cohortSchema =
|
|
15435
|
+
var cohortSchema = z53.object({
|
|
15325
15436
|
name: cohortNameSchema,
|
|
15326
|
-
startDate:
|
|
15327
|
-
endDate:
|
|
15437
|
+
startDate: z53.string(),
|
|
15438
|
+
endDate: z53.string()
|
|
15328
15439
|
});
|
|
15329
15440
|
var searchCohortSchema = cohortSchema.extend({ totals: countSchema });
|
|
15330
15441
|
var sessionCohortSchema = cohortSchema.extend({
|
|
15331
|
-
organicSessions:
|
|
15332
|
-
});
|
|
15333
|
-
var sourceCoverageSchema =
|
|
15334
|
-
startDate:
|
|
15335
|
-
endDate:
|
|
15336
|
-
observedDays:
|
|
15337
|
-
});
|
|
15338
|
-
var crawlerCountsSchema =
|
|
15339
|
-
verified:
|
|
15340
|
-
claimedUnverified:
|
|
15341
|
-
unknownAiLike:
|
|
15342
|
-
});
|
|
15343
|
-
var referralCountsSchema =
|
|
15344
|
-
total:
|
|
15345
|
-
paid:
|
|
15346
|
-
organic:
|
|
15347
|
-
unknown:
|
|
15348
|
-
});
|
|
15349
|
-
var organicEvidenceDtoSchema =
|
|
15350
|
-
contractVersion:
|
|
15442
|
+
organicSessions: z53.number().int().nonnegative()
|
|
15443
|
+
});
|
|
15444
|
+
var sourceCoverageSchema = z53.object({
|
|
15445
|
+
startDate: z53.string(),
|
|
15446
|
+
endDate: z53.string(),
|
|
15447
|
+
observedDays: z53.number().int().nonnegative()
|
|
15448
|
+
});
|
|
15449
|
+
var crawlerCountsSchema = z53.object({
|
|
15450
|
+
verified: z53.number().int().nonnegative(),
|
|
15451
|
+
claimedUnverified: z53.number().int().nonnegative(),
|
|
15452
|
+
unknownAiLike: z53.number().int().nonnegative()
|
|
15453
|
+
});
|
|
15454
|
+
var referralCountsSchema = z53.object({
|
|
15455
|
+
total: z53.number().int().nonnegative(),
|
|
15456
|
+
paid: z53.number().int().nonnegative(),
|
|
15457
|
+
organic: z53.number().int().nonnegative(),
|
|
15458
|
+
unknown: z53.number().int().nonnegative()
|
|
15459
|
+
});
|
|
15460
|
+
var organicEvidenceDtoSchema = z53.object({
|
|
15461
|
+
contractVersion: z53.literal("organic-evidence/v1"),
|
|
15351
15462
|
periodDays: organicEvidencePeriodSchema,
|
|
15352
15463
|
/** Latest headline evidence date, preferring the GSC property date when available. */
|
|
15353
|
-
asOfDate:
|
|
15354
|
-
coverage:
|
|
15355
|
-
gsc:
|
|
15356
|
-
ga4:
|
|
15357
|
-
server:
|
|
15358
|
-
visibility:
|
|
15464
|
+
asOfDate: z53.string().nullable(),
|
|
15465
|
+
coverage: z53.object({
|
|
15466
|
+
gsc: z53.boolean(),
|
|
15467
|
+
ga4: z53.boolean(),
|
|
15468
|
+
server: z53.boolean(),
|
|
15469
|
+
visibility: z53.boolean()
|
|
15359
15470
|
}),
|
|
15360
|
-
sourceCoverage:
|
|
15471
|
+
sourceCoverage: z53.object({
|
|
15361
15472
|
gsc: sourceCoverageSchema.nullable(),
|
|
15362
15473
|
ga4: sourceCoverageSchema.nullable(),
|
|
15363
15474
|
server: sourceCoverageSchema.nullable(),
|
|
15364
|
-
visibility:
|
|
15475
|
+
visibility: z53.object({ completedAt: z53.string(), ageDays: z53.number().nonnegative() }).nullable()
|
|
15365
15476
|
}),
|
|
15366
|
-
gsc:
|
|
15477
|
+
gsc: z53.object({
|
|
15367
15478
|
propertyTotals: countSchema,
|
|
15368
15479
|
namedBrand: countSchema,
|
|
15369
15480
|
namedNonBrand: countSchema,
|
|
15370
15481
|
suppressedOrUnreportedResidual: countSchema,
|
|
15371
|
-
cohorts:
|
|
15482
|
+
cohorts: z53.array(searchCohortSchema)
|
|
15372
15483
|
}).nullable(),
|
|
15373
|
-
ga4:
|
|
15374
|
-
organicSessions:
|
|
15375
|
-
cohorts:
|
|
15484
|
+
ga4: z53.object({
|
|
15485
|
+
organicSessions: z53.number().int().nonnegative(),
|
|
15486
|
+
cohorts: z53.array(sessionCohortSchema)
|
|
15376
15487
|
}).nullable(),
|
|
15377
|
-
gaAiReferrals:
|
|
15378
|
-
paidSessions:
|
|
15379
|
-
organicSessions:
|
|
15488
|
+
gaAiReferrals: z53.object({
|
|
15489
|
+
paidSessions: z53.number().int().nonnegative(),
|
|
15490
|
+
organicSessions: z53.number().int().nonnegative()
|
|
15380
15491
|
}).nullable(),
|
|
15381
|
-
server:
|
|
15492
|
+
server: z53.object({
|
|
15382
15493
|
crawlerHits: crawlerCountsSchema,
|
|
15383
15494
|
userFetchHits: crawlerCountsSchema,
|
|
15384
15495
|
referralSessions: referralCountsSchema
|
|
15385
15496
|
}).nullable(),
|
|
15386
|
-
visibility:
|
|
15387
|
-
runId:
|
|
15388
|
-
completedAt:
|
|
15389
|
-
ageDays:
|
|
15390
|
-
answerPairs:
|
|
15391
|
-
mentionedPairs:
|
|
15392
|
-
citedPairs:
|
|
15497
|
+
visibility: z53.object({
|
|
15498
|
+
runId: z53.string(),
|
|
15499
|
+
completedAt: z53.string(),
|
|
15500
|
+
ageDays: z53.number().nonnegative(),
|
|
15501
|
+
answerPairs: z53.number().int().nonnegative(),
|
|
15502
|
+
mentionedPairs: z53.number().int().nonnegative(),
|
|
15503
|
+
citedPairs: z53.number().int().nonnegative()
|
|
15393
15504
|
}).nullable(),
|
|
15394
15505
|
measurement: gaMeasurementAnalysisDtoSchema,
|
|
15395
|
-
pages:
|
|
15396
|
-
path:
|
|
15506
|
+
pages: z53.array(z53.object({
|
|
15507
|
+
path: z53.string(),
|
|
15397
15508
|
gsc: countSchema,
|
|
15398
|
-
ga4OrganicSessions:
|
|
15399
|
-
server:
|
|
15509
|
+
ga4OrganicSessions: z53.number().int().nonnegative(),
|
|
15510
|
+
server: z53.object({
|
|
15400
15511
|
crawlerHits: crawlerCountsSchema,
|
|
15401
15512
|
userFetchHits: crawlerCountsSchema,
|
|
15402
15513
|
referralSessions: referralCountsSchema
|
|
15403
15514
|
})
|
|
15404
15515
|
})),
|
|
15405
|
-
findings:
|
|
15406
|
-
tone:
|
|
15407
|
-
title:
|
|
15408
|
-
detail:
|
|
15516
|
+
findings: z53.array(z53.object({
|
|
15517
|
+
tone: z53.enum(["positive", "caution", "neutral"]),
|
|
15518
|
+
title: z53.string(),
|
|
15519
|
+
detail: z53.string()
|
|
15409
15520
|
})),
|
|
15410
|
-
limitations:
|
|
15521
|
+
limitations: z53.array(z53.object({ code: z53.string(), detail: z53.string() }))
|
|
15411
15522
|
});
|
|
15412
15523
|
|
|
15413
15524
|
// ../contracts/src/report-dedup.ts
|
|
@@ -15478,10 +15589,10 @@ function dedupeReportOpportunities(report) {
|
|
|
15478
15589
|
}
|
|
15479
15590
|
|
|
15480
15591
|
// ../contracts/src/skills.ts
|
|
15481
|
-
import { z as
|
|
15482
|
-
var codingAgentSchema =
|
|
15592
|
+
import { z as z54 } from "zod";
|
|
15593
|
+
var codingAgentSchema = z54.enum(["claude", "codex"]);
|
|
15483
15594
|
var CodingAgents = codingAgentSchema.enum;
|
|
15484
|
-
var skillsClientSchema =
|
|
15595
|
+
var skillsClientSchema = z54.enum(["claude", "codex", "all"]);
|
|
15485
15596
|
var SkillsClients = skillsClientSchema.enum;
|
|
15486
15597
|
var SKILL_MANIFEST_FILENAME = ".canonry-skill-manifest.json";
|
|
15487
15598
|
function classifySkillFile(params) {
|
|
@@ -15499,22 +15610,22 @@ function coerceSkillManifest(parsed) {
|
|
|
15499
15610
|
}
|
|
15500
15611
|
|
|
15501
15612
|
// ../contracts/src/traffic.ts
|
|
15502
|
-
import { z as
|
|
15503
|
-
var trafficCrawlerSegmentsSchema =
|
|
15504
|
-
content:
|
|
15505
|
-
sitemap:
|
|
15506
|
-
robots:
|
|
15507
|
-
asset:
|
|
15508
|
-
other:
|
|
15509
|
-
});
|
|
15510
|
-
var trafficPathClassSchema =
|
|
15613
|
+
import { z as z55 } from "zod";
|
|
15614
|
+
var trafficCrawlerSegmentsSchema = z55.object({
|
|
15615
|
+
content: z55.number().int().nonnegative(),
|
|
15616
|
+
sitemap: z55.number().int().nonnegative(),
|
|
15617
|
+
robots: z55.number().int().nonnegative(),
|
|
15618
|
+
asset: z55.number().int().nonnegative(),
|
|
15619
|
+
other: z55.number().int().nonnegative()
|
|
15620
|
+
});
|
|
15621
|
+
var trafficPathClassSchema = z55.enum([
|
|
15511
15622
|
"content",
|
|
15512
15623
|
"sitemap",
|
|
15513
15624
|
"robots",
|
|
15514
15625
|
"asset",
|
|
15515
15626
|
"other"
|
|
15516
15627
|
]);
|
|
15517
|
-
var trafficSourceTypeSchema =
|
|
15628
|
+
var trafficSourceTypeSchema = z55.enum([
|
|
15518
15629
|
"cloud-run",
|
|
15519
15630
|
"wordpress",
|
|
15520
15631
|
"cloudflare",
|
|
@@ -15522,7 +15633,7 @@ var trafficSourceTypeSchema = z54.enum([
|
|
|
15522
15633
|
"generic-log"
|
|
15523
15634
|
]);
|
|
15524
15635
|
var TrafficSourceTypes = trafficSourceTypeSchema.enum;
|
|
15525
|
-
var trafficAdapterCapabilitySchema =
|
|
15636
|
+
var trafficAdapterCapabilitySchema = z55.enum([
|
|
15526
15637
|
"raw-request-events",
|
|
15527
15638
|
"aggregate-request-metrics",
|
|
15528
15639
|
"request-url",
|
|
@@ -15533,87 +15644,87 @@ var trafficAdapterCapabilitySchema = z54.enum([
|
|
|
15533
15644
|
"cursor-pull"
|
|
15534
15645
|
]);
|
|
15535
15646
|
var TrafficAdapterCapabilities = trafficAdapterCapabilitySchema.enum;
|
|
15536
|
-
var trafficEvidenceKindSchema =
|
|
15647
|
+
var trafficEvidenceKindSchema = z55.enum(["raw-request", "aggregate-bucket"]);
|
|
15537
15648
|
var TrafficEvidenceKinds = trafficEvidenceKindSchema.enum;
|
|
15538
|
-
var trafficEventConfidenceSchema =
|
|
15649
|
+
var trafficEventConfidenceSchema = z55.enum(["observed", "provider-aggregated", "inferred"]);
|
|
15539
15650
|
var TrafficEventConfidences = trafficEventConfidenceSchema.enum;
|
|
15540
|
-
var trafficProviderResourceSchema =
|
|
15541
|
-
type:
|
|
15542
|
-
labels:
|
|
15651
|
+
var trafficProviderResourceSchema = z55.object({
|
|
15652
|
+
type: z55.string().nullable(),
|
|
15653
|
+
labels: z55.record(z55.string(), z55.string())
|
|
15543
15654
|
});
|
|
15544
|
-
var normalizedTrafficRequestSchema =
|
|
15655
|
+
var normalizedTrafficRequestSchema = z55.object({
|
|
15545
15656
|
sourceType: trafficSourceTypeSchema,
|
|
15546
|
-
evidenceKind:
|
|
15547
|
-
confidence:
|
|
15548
|
-
eventId:
|
|
15549
|
-
observedAt:
|
|
15550
|
-
method:
|
|
15551
|
-
requestUrl:
|
|
15552
|
-
host:
|
|
15553
|
-
path:
|
|
15554
|
-
queryString:
|
|
15555
|
-
status:
|
|
15556
|
-
userAgent:
|
|
15557
|
-
remoteIp:
|
|
15558
|
-
referer:
|
|
15559
|
-
latencyMs:
|
|
15560
|
-
requestSizeBytes:
|
|
15561
|
-
responseSizeBytes:
|
|
15657
|
+
evidenceKind: z55.literal(TrafficEvidenceKinds["raw-request"]),
|
|
15658
|
+
confidence: z55.literal(TrafficEventConfidences.observed),
|
|
15659
|
+
eventId: z55.string().min(1),
|
|
15660
|
+
observedAt: z55.string().min(1),
|
|
15661
|
+
method: z55.string().nullable(),
|
|
15662
|
+
requestUrl: z55.string().nullable(),
|
|
15663
|
+
host: z55.string().nullable(),
|
|
15664
|
+
path: z55.string().min(1),
|
|
15665
|
+
queryString: z55.string().nullable(),
|
|
15666
|
+
status: z55.number().int().nullable(),
|
|
15667
|
+
userAgent: z55.string().nullable(),
|
|
15668
|
+
remoteIp: z55.string().nullable(),
|
|
15669
|
+
referer: z55.string().nullable(),
|
|
15670
|
+
latencyMs: z55.number().nullable(),
|
|
15671
|
+
requestSizeBytes: z55.number().int().nullable(),
|
|
15672
|
+
responseSizeBytes: z55.number().int().nullable(),
|
|
15562
15673
|
providerResource: trafficProviderResourceSchema,
|
|
15563
|
-
providerLabels:
|
|
15674
|
+
providerLabels: z55.record(z55.string(), z55.string())
|
|
15564
15675
|
});
|
|
15565
|
-
var normalizedTrafficPullPageSchema =
|
|
15566
|
-
events:
|
|
15567
|
-
rawEntryCount:
|
|
15568
|
-
skippedEntryCount:
|
|
15569
|
-
nextPageToken:
|
|
15570
|
-
filter:
|
|
15676
|
+
var normalizedTrafficPullPageSchema = z55.object({
|
|
15677
|
+
events: z55.array(normalizedTrafficRequestSchema),
|
|
15678
|
+
rawEntryCount: z55.number().int().nonnegative(),
|
|
15679
|
+
skippedEntryCount: z55.number().int().nonnegative(),
|
|
15680
|
+
nextPageToken: z55.string().optional(),
|
|
15681
|
+
filter: z55.string()
|
|
15571
15682
|
});
|
|
15572
|
-
var trafficSourceStatusSchema =
|
|
15683
|
+
var trafficSourceStatusSchema = z55.enum(["connected", "paused", "error", "archived"]);
|
|
15573
15684
|
var TrafficSourceStatuses = trafficSourceStatusSchema.enum;
|
|
15574
|
-
var trafficSourceAuthModeSchema =
|
|
15685
|
+
var trafficSourceAuthModeSchema = z55.enum(["oauth", "service-account"]);
|
|
15575
15686
|
var TrafficSourceAuthModes = trafficSourceAuthModeSchema.enum;
|
|
15576
|
-
var verificationStatusSchema =
|
|
15687
|
+
var verificationStatusSchema = z55.enum(["verified", "claimed_unverified", "unknown_ai_like"]);
|
|
15577
15688
|
var VerificationStatuses = verificationStatusSchema.enum;
|
|
15578
|
-
var trafficVerificationManifestSchema =
|
|
15689
|
+
var trafficVerificationManifestSchema = z55.object({
|
|
15579
15690
|
/** Stable identity: source + publisher version + canonical prefix-content digest. */
|
|
15580
|
-
id:
|
|
15581
|
-
source:
|
|
15582
|
-
version:
|
|
15691
|
+
id: z55.string().min(1),
|
|
15692
|
+
source: z55.string().min(1),
|
|
15693
|
+
version: z55.string().min(1)
|
|
15583
15694
|
});
|
|
15584
|
-
var trafficVerificationManifestUsageSchema =
|
|
15585
|
-
manifestId:
|
|
15695
|
+
var trafficVerificationManifestUsageSchema = z55.object({
|
|
15696
|
+
manifestId: z55.string().min(1),
|
|
15586
15697
|
manifest: trafficVerificationManifestSchema.nullable(),
|
|
15587
|
-
hits:
|
|
15698
|
+
hits: z55.number().int().nonnegative()
|
|
15588
15699
|
});
|
|
15589
|
-
var cloudRunSourceConfigSchema =
|
|
15590
|
-
gcpProjectId:
|
|
15591
|
-
serviceName:
|
|
15592
|
-
location:
|
|
15700
|
+
var cloudRunSourceConfigSchema = z55.object({
|
|
15701
|
+
gcpProjectId: z55.string().min(1),
|
|
15702
|
+
serviceName: z55.string().nullable().optional(),
|
|
15703
|
+
location: z55.string().nullable().optional(),
|
|
15593
15704
|
authMode: trafficSourceAuthModeSchema
|
|
15594
15705
|
});
|
|
15595
|
-
var wordpressTrafficSourceConfigSchema =
|
|
15596
|
-
baseUrl:
|
|
15597
|
-
username:
|
|
15706
|
+
var wordpressTrafficSourceConfigSchema = z55.object({
|
|
15707
|
+
baseUrl: z55.string().url(),
|
|
15708
|
+
username: z55.string().min(1)
|
|
15598
15709
|
});
|
|
15599
|
-
var vercelTrafficEnvironmentSchema =
|
|
15710
|
+
var vercelTrafficEnvironmentSchema = z55.enum(["production", "preview"]);
|
|
15600
15711
|
var VercelTrafficEnvironments = vercelTrafficEnvironmentSchema.enum;
|
|
15601
|
-
var vercelTrafficSourceConfigSchema =
|
|
15712
|
+
var vercelTrafficSourceConfigSchema = z55.object({
|
|
15602
15713
|
/** Vercel project id (e.g. `prj_...`). */
|
|
15603
|
-
projectId:
|
|
15714
|
+
projectId: z55.string().min(1),
|
|
15604
15715
|
/** Vercel team or account id: the org that owns the project. */
|
|
15605
|
-
teamId:
|
|
15716
|
+
teamId: z55.string().min(1),
|
|
15606
15717
|
environment: vercelTrafficEnvironmentSchema
|
|
15607
15718
|
});
|
|
15608
|
-
var trafficSourceDtoSchema =
|
|
15609
|
-
id:
|
|
15610
|
-
projectId:
|
|
15719
|
+
var trafficSourceDtoSchema = z55.object({
|
|
15720
|
+
id: z55.string(),
|
|
15721
|
+
projectId: z55.string(),
|
|
15611
15722
|
sourceType: trafficSourceTypeSchema,
|
|
15612
|
-
displayName:
|
|
15723
|
+
displayName: z55.string(),
|
|
15613
15724
|
status: trafficSourceStatusSchema,
|
|
15614
|
-
lastSyncedAt:
|
|
15615
|
-
lastCursor:
|
|
15616
|
-
lastError:
|
|
15725
|
+
lastSyncedAt: z55.string().nullable(),
|
|
15726
|
+
lastCursor: z55.string().nullable(),
|
|
15727
|
+
lastError: z55.string().nullable(),
|
|
15617
15728
|
/**
|
|
15618
15729
|
* Newest instant a sync clamped past instead of ingesting, or null when no
|
|
15619
15730
|
* skip is outstanding. Non-null means this source has a known gap in its
|
|
@@ -15622,226 +15733,226 @@ var trafficSourceDtoSchema = z54.object({
|
|
|
15622
15733
|
* what the skipping sync did. WordPress generic replace-mode backfill is
|
|
15623
15734
|
* deliberately unavailable because the retained feed cannot prove coverage.
|
|
15624
15735
|
*/
|
|
15625
|
-
skippedThroughAt:
|
|
15736
|
+
skippedThroughAt: z55.string().nullable(),
|
|
15626
15737
|
/** Residual Cloudflare Queue depth reported by the most recent bounded pull. */
|
|
15627
|
-
queueBacklogCount:
|
|
15738
|
+
queueBacklogCount: z55.number().int().nonnegative().nullable(),
|
|
15628
15739
|
/** Instant at which `queueBacklogCount` was observed, or null before the first pull. */
|
|
15629
|
-
queueBacklogObservedAt:
|
|
15630
|
-
archivedAt:
|
|
15631
|
-
config:
|
|
15632
|
-
createdAt:
|
|
15633
|
-
updatedAt:
|
|
15634
|
-
});
|
|
15635
|
-
var trafficConnectCloudRunRequestSchema =
|
|
15636
|
-
gcpProjectId:
|
|
15637
|
-
serviceName:
|
|
15638
|
-
location:
|
|
15639
|
-
displayName:
|
|
15740
|
+
queueBacklogObservedAt: z55.string().nullable(),
|
|
15741
|
+
archivedAt: z55.string().nullable(),
|
|
15742
|
+
config: z55.record(z55.string(), z55.unknown()),
|
|
15743
|
+
createdAt: z55.string(),
|
|
15744
|
+
updatedAt: z55.string()
|
|
15745
|
+
});
|
|
15746
|
+
var trafficConnectCloudRunRequestSchema = z55.object({
|
|
15747
|
+
gcpProjectId: z55.string().min(1),
|
|
15748
|
+
serviceName: z55.string().min(1).optional(),
|
|
15749
|
+
location: z55.string().min(1).optional(),
|
|
15750
|
+
displayName: z55.string().min(1).optional(),
|
|
15640
15751
|
/** Service-account JSON content (string). When omitted, defaults to OAuth via `canonry google connect <project> --type ga4` flow. */
|
|
15641
|
-
keyJson:
|
|
15752
|
+
keyJson: z55.string().optional()
|
|
15642
15753
|
});
|
|
15643
|
-
var trafficConnectWordpressRequestSchema =
|
|
15644
|
-
baseUrl:
|
|
15645
|
-
username:
|
|
15754
|
+
var trafficConnectWordpressRequestSchema = z55.object({
|
|
15755
|
+
baseUrl: z55.string().url(),
|
|
15756
|
+
username: z55.string().min(1),
|
|
15646
15757
|
/** WordPress Application Password (the same auth used by the content client). */
|
|
15647
|
-
applicationPassword:
|
|
15648
|
-
displayName:
|
|
15758
|
+
applicationPassword: z55.string().min(1),
|
|
15759
|
+
displayName: z55.string().min(1).optional()
|
|
15649
15760
|
});
|
|
15650
|
-
var trafficConnectVercelRequestSchema =
|
|
15761
|
+
var trafficConnectVercelRequestSchema = z55.object({
|
|
15651
15762
|
/** Vercel project id (e.g. `prj_...`) — from the Vercel dashboard or `.vercel/project.json`. */
|
|
15652
|
-
projectId:
|
|
15763
|
+
projectId: z55.string().min(1),
|
|
15653
15764
|
/** Vercel team or account id: the org that owns the project ("orgId" in .vercel/project.json). */
|
|
15654
|
-
teamId:
|
|
15765
|
+
teamId: z55.string().min(1),
|
|
15655
15766
|
/** Vercel personal access token. Stored in `~/.canonry/config.yaml`, never the DB. */
|
|
15656
|
-
token:
|
|
15767
|
+
token: z55.string().min(1),
|
|
15657
15768
|
/** Which deployment environment's request logs to pull. Default: `production`. */
|
|
15658
15769
|
environment: vercelTrafficEnvironmentSchema.optional(),
|
|
15659
|
-
displayName:
|
|
15770
|
+
displayName: z55.string().min(1).optional()
|
|
15660
15771
|
});
|
|
15661
|
-
var cloudflareTrafficDeliveryModeSchema =
|
|
15772
|
+
var cloudflareTrafficDeliveryModeSchema = z55.enum(["direct-push", "queue-pull"]);
|
|
15662
15773
|
var CloudflareTrafficDeliveryModes = cloudflareTrafficDeliveryModeSchema.enum;
|
|
15663
|
-
var cloudflareQueueNameSchema =
|
|
15774
|
+
var cloudflareQueueNameSchema = z55.string().regex(
|
|
15664
15775
|
/^(?=.{1,63}$)[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,
|
|
15665
15776
|
"Cloudflare Queue name must be 1-63 characters, use only letters, numbers, or dashes, and start and end with a letter or number"
|
|
15666
15777
|
);
|
|
15667
|
-
var cloudflareTrafficSourceBaseSchema =
|
|
15668
|
-
schemaVersion:
|
|
15778
|
+
var cloudflareTrafficSourceBaseSchema = z55.object({
|
|
15779
|
+
schemaVersion: z55.literal(1),
|
|
15669
15780
|
/** Semver of the Worker script bundle that was generated at connect/rotate time. */
|
|
15670
|
-
workerVersion:
|
|
15781
|
+
workerVersion: z55.string().min(1),
|
|
15671
15782
|
/** Identifier of the bot/referer keyword set baked into the deployed Worker. */
|
|
15672
|
-
expectedBotListVersion:
|
|
15783
|
+
expectedBotListVersion: z55.string().min(1),
|
|
15673
15784
|
/** Target Cloudflare zone for the operator-managed Worker route. */
|
|
15674
|
-
zoneId:
|
|
15785
|
+
zoneId: z55.string().nullable()
|
|
15675
15786
|
});
|
|
15676
15787
|
var cloudflareDirectPushTrafficSourceConfigSchema = cloudflareTrafficSourceBaseSchema.extend({
|
|
15677
|
-
deliveryMode:
|
|
15788
|
+
deliveryMode: z55.literal(CloudflareTrafficDeliveryModes["direct-push"]),
|
|
15678
15789
|
/** Cloudflare account id used to target the correct account during Wrangler deploy. */
|
|
15679
|
-
accountId:
|
|
15790
|
+
accountId: z55.string().nullable()
|
|
15680
15791
|
});
|
|
15681
15792
|
var cloudflareQueuePullTrafficSourceConfigSchema = cloudflareTrafficSourceBaseSchema.extend({
|
|
15682
|
-
deliveryMode:
|
|
15793
|
+
deliveryMode: z55.literal(CloudflareTrafficDeliveryModes["queue-pull"]),
|
|
15683
15794
|
/** Cloudflare account that owns the Queue. */
|
|
15684
|
-
accountId:
|
|
15795
|
+
accountId: z55.string().min(1),
|
|
15685
15796
|
/** Cloudflare Queue id used by Canonry's pull consumer. */
|
|
15686
|
-
queueId:
|
|
15797
|
+
queueId: z55.string().min(1),
|
|
15687
15798
|
/** Queue producer binding target written to the generated Wrangler file. */
|
|
15688
15799
|
queueName: cloudflareQueueNameSchema,
|
|
15689
15800
|
/** Operator-recorded Queue retention for configuration drift checks. */
|
|
15690
|
-
retentionSeconds:
|
|
15801
|
+
retentionSeconds: z55.number().int().min(60).max(1209600)
|
|
15691
15802
|
});
|
|
15692
15803
|
function defaultCloudflareDeliveryMode(value) {
|
|
15693
15804
|
if (typeof value !== "object" || value === null || Array.isArray(value)) return value;
|
|
15694
15805
|
const record = value;
|
|
15695
15806
|
return "deliveryMode" in record ? value : { ...record, deliveryMode: "direct-push" };
|
|
15696
15807
|
}
|
|
15697
|
-
var cloudflareTrafficSourceConfigSchema =
|
|
15808
|
+
var cloudflareTrafficSourceConfigSchema = z55.preprocess(
|
|
15698
15809
|
defaultCloudflareDeliveryMode,
|
|
15699
|
-
|
|
15810
|
+
z55.discriminatedUnion("deliveryMode", [
|
|
15700
15811
|
cloudflareDirectPushTrafficSourceConfigSchema,
|
|
15701
15812
|
cloudflareQueuePullTrafficSourceConfigSchema
|
|
15702
15813
|
])
|
|
15703
15814
|
);
|
|
15704
|
-
var trafficConnectCloudflareBaseRequestSchema =
|
|
15705
|
-
displayName:
|
|
15815
|
+
var trafficConnectCloudflareBaseRequestSchema = z55.object({
|
|
15816
|
+
displayName: z55.string().min(1).optional(),
|
|
15706
15817
|
/** Target Cloudflare zone. Canonry does not validate it against Cloudflare. */
|
|
15707
|
-
zoneId:
|
|
15818
|
+
zoneId: z55.string().min(1).optional()
|
|
15708
15819
|
});
|
|
15709
15820
|
var trafficConnectCloudflareDirectPushRequestSchema = trafficConnectCloudflareBaseRequestSchema.extend({
|
|
15710
|
-
deliveryMode:
|
|
15821
|
+
deliveryMode: z55.literal(CloudflareTrafficDeliveryModes["direct-push"]),
|
|
15711
15822
|
/** Cloudflare account id. Set it when Wrangler can access more than one account. */
|
|
15712
|
-
accountId:
|
|
15823
|
+
accountId: z55.string().min(1).optional()
|
|
15713
15824
|
});
|
|
15714
15825
|
var trafficConnectCloudflareQueuePullRequestSchema = trafficConnectCloudflareBaseRequestSchema.extend({
|
|
15715
|
-
deliveryMode:
|
|
15716
|
-
accountId:
|
|
15717
|
-
queueId:
|
|
15826
|
+
deliveryMode: z55.literal(CloudflareTrafficDeliveryModes["queue-pull"]),
|
|
15827
|
+
accountId: z55.string().min(1),
|
|
15828
|
+
queueId: z55.string().min(1),
|
|
15718
15829
|
queueName: cloudflareQueueNameSchema,
|
|
15719
|
-
retentionSeconds:
|
|
15830
|
+
retentionSeconds: z55.number().int().min(60).max(1209600),
|
|
15720
15831
|
/** Queue pull token; secret-store only, never persisted in configJson or returned. */
|
|
15721
|
-
apiToken:
|
|
15832
|
+
apiToken: z55.string().min(1)
|
|
15722
15833
|
});
|
|
15723
|
-
var trafficConnectCloudflareRequestSchema =
|
|
15834
|
+
var trafficConnectCloudflareRequestSchema = z55.preprocess(
|
|
15724
15835
|
defaultCloudflareDeliveryMode,
|
|
15725
|
-
|
|
15836
|
+
z55.discriminatedUnion("deliveryMode", [
|
|
15726
15837
|
trafficConnectCloudflareDirectPushRequestSchema,
|
|
15727
15838
|
trafficConnectCloudflareQueuePullRequestSchema
|
|
15728
15839
|
])
|
|
15729
15840
|
);
|
|
15730
|
-
var trafficConnectCloudflareResponseBaseSchema =
|
|
15731
|
-
sourceId:
|
|
15732
|
-
workerScript:
|
|
15733
|
-
wranglerToml:
|
|
15734
|
-
workerVersion:
|
|
15735
|
-
instructions:
|
|
15841
|
+
var trafficConnectCloudflareResponseBaseSchema = z55.object({
|
|
15842
|
+
sourceId: z55.string().min(1),
|
|
15843
|
+
workerScript: z55.string().min(1),
|
|
15844
|
+
wranglerToml: z55.string().min(1),
|
|
15845
|
+
workerVersion: z55.string().min(1),
|
|
15846
|
+
instructions: z55.string().min(1)
|
|
15736
15847
|
});
|
|
15737
15848
|
var trafficConnectCloudflareDirectPushResponseSchema = trafficConnectCloudflareResponseBaseSchema.extend({
|
|
15738
|
-
deliveryMode:
|
|
15739
|
-
activationRequired:
|
|
15849
|
+
deliveryMode: z55.literal(CloudflareTrafficDeliveryModes["direct-push"]),
|
|
15850
|
+
activationRequired: z55.boolean().default(false)
|
|
15740
15851
|
});
|
|
15741
15852
|
var trafficConnectCloudflareQueuePullResponseSchema = trafficConnectCloudflareResponseBaseSchema.extend({
|
|
15742
|
-
deliveryMode:
|
|
15743
|
-
activationRequired:
|
|
15744
|
-
accountId:
|
|
15745
|
-
queueId:
|
|
15853
|
+
deliveryMode: z55.literal(CloudflareTrafficDeliveryModes["queue-pull"]),
|
|
15854
|
+
activationRequired: z55.boolean().default(false),
|
|
15855
|
+
accountId: z55.string().min(1),
|
|
15856
|
+
queueId: z55.string().min(1),
|
|
15746
15857
|
queueName: cloudflareQueueNameSchema,
|
|
15747
|
-
retentionSeconds:
|
|
15858
|
+
retentionSeconds: z55.number().int().min(60).max(1209600)
|
|
15748
15859
|
});
|
|
15749
|
-
var trafficConnectCloudflareResponseSchema =
|
|
15860
|
+
var trafficConnectCloudflareResponseSchema = z55.discriminatedUnion("deliveryMode", [
|
|
15750
15861
|
trafficConnectCloudflareDirectPushResponseSchema,
|
|
15751
15862
|
trafficConnectCloudflareQueuePullResponseSchema
|
|
15752
15863
|
]);
|
|
15753
|
-
var cloudflareEdgeEventSchema =
|
|
15864
|
+
var cloudflareEdgeEventSchema = z55.object({
|
|
15754
15865
|
/** Cloudflare `cf-ray` request id — globally unique per request. */
|
|
15755
|
-
eventId:
|
|
15756
|
-
observedAt:
|
|
15757
|
-
method:
|
|
15758
|
-
host:
|
|
15759
|
-
path:
|
|
15760
|
-
queryString:
|
|
15761
|
-
status:
|
|
15762
|
-
userAgent:
|
|
15763
|
-
remoteIp:
|
|
15764
|
-
referer:
|
|
15765
|
-
cf:
|
|
15766
|
-
verifiedBot:
|
|
15767
|
-
botScore:
|
|
15768
|
-
country:
|
|
15769
|
-
asn:
|
|
15770
|
-
asOrganization:
|
|
15866
|
+
eventId: z55.string().min(1),
|
|
15867
|
+
observedAt: z55.string().datetime(),
|
|
15868
|
+
method: z55.string().nullable(),
|
|
15869
|
+
host: z55.string().nullable(),
|
|
15870
|
+
path: z55.string().min(1),
|
|
15871
|
+
queryString: z55.string().nullable(),
|
|
15872
|
+
status: z55.number().int().nullable(),
|
|
15873
|
+
userAgent: z55.string().nullable(),
|
|
15874
|
+
remoteIp: z55.string().nullable(),
|
|
15875
|
+
referer: z55.string().nullable(),
|
|
15876
|
+
cf: z55.object({
|
|
15877
|
+
verifiedBot: z55.boolean().nullable(),
|
|
15878
|
+
botScore: z55.number().int().nullable(),
|
|
15879
|
+
country: z55.string().nullable(),
|
|
15880
|
+
asn: z55.number().int().nullable(),
|
|
15881
|
+
asOrganization: z55.string().nullable()
|
|
15771
15882
|
}).nullable()
|
|
15772
15883
|
});
|
|
15773
|
-
var cloudflareEdgeEventBatchSchema =
|
|
15774
|
-
schemaVersion:
|
|
15775
|
-
workerVersion:
|
|
15776
|
-
events:
|
|
15884
|
+
var cloudflareEdgeEventBatchSchema = z55.object({
|
|
15885
|
+
schemaVersion: z55.literal(1),
|
|
15886
|
+
workerVersion: z55.string().min(1),
|
|
15887
|
+
events: z55.array(cloudflareEdgeEventSchema).min(1).max(100)
|
|
15777
15888
|
});
|
|
15778
15889
|
var cloudflareWorkerIngestRequestSchema = cloudflareEdgeEventBatchSchema;
|
|
15779
|
-
var cloudflareWorkerIngestResponseSchema =
|
|
15780
|
-
acceptedEvents:
|
|
15781
|
-
droppedEvents:
|
|
15782
|
-
workerVersionAck:
|
|
15783
|
-
crawlerBucketRows:
|
|
15784
|
-
aiUserFetchBucketRows:
|
|
15785
|
-
aiReferralBucketRows:
|
|
15786
|
-
sampleRows:
|
|
15787
|
-
});
|
|
15788
|
-
var trafficSyncResponseSchema =
|
|
15789
|
-
sourceId:
|
|
15790
|
-
runId:
|
|
15791
|
-
syncedAt:
|
|
15792
|
-
pulledEvents:
|
|
15890
|
+
var cloudflareWorkerIngestResponseSchema = z55.object({
|
|
15891
|
+
acceptedEvents: z55.number().int(),
|
|
15892
|
+
droppedEvents: z55.number().int(),
|
|
15893
|
+
workerVersionAck: z55.string(),
|
|
15894
|
+
crawlerBucketRows: z55.number().int(),
|
|
15895
|
+
aiUserFetchBucketRows: z55.number().int(),
|
|
15896
|
+
aiReferralBucketRows: z55.number().int(),
|
|
15897
|
+
sampleRows: z55.number().int()
|
|
15898
|
+
});
|
|
15899
|
+
var trafficSyncResponseSchema = z55.object({
|
|
15900
|
+
sourceId: z55.string(),
|
|
15901
|
+
runId: z55.string(),
|
|
15902
|
+
syncedAt: z55.string(),
|
|
15903
|
+
pulledEvents: z55.number().int().nonnegative(),
|
|
15793
15904
|
/** Self-traffic events (Canonry's own tooling) dropped before rollup. */
|
|
15794
|
-
selfTrafficExcluded:
|
|
15795
|
-
crawlerHits:
|
|
15796
|
-
aiUserFetchHits:
|
|
15797
|
-
aiReferralHits:
|
|
15798
|
-
unknownHits:
|
|
15799
|
-
crawlerBucketRows:
|
|
15800
|
-
aiUserFetchBucketRows:
|
|
15801
|
-
aiReferralBucketRows:
|
|
15802
|
-
sampleRows:
|
|
15905
|
+
selfTrafficExcluded: z55.number().int().nonnegative(),
|
|
15906
|
+
crawlerHits: z55.number().int().nonnegative(),
|
|
15907
|
+
aiUserFetchHits: z55.number().int().nonnegative(),
|
|
15908
|
+
aiReferralHits: z55.number().int().nonnegative(),
|
|
15909
|
+
unknownHits: z55.number().int().nonnegative(),
|
|
15910
|
+
crawlerBucketRows: z55.number().int().nonnegative(),
|
|
15911
|
+
aiUserFetchBucketRows: z55.number().int().nonnegative(),
|
|
15912
|
+
aiReferralBucketRows: z55.number().int().nonnegative(),
|
|
15913
|
+
sampleRows: z55.number().int().nonnegative(),
|
|
15803
15914
|
/** Residual upstream Queue depth after a bounded sync; present for Queue pull. */
|
|
15804
|
-
remainingBacklogCount:
|
|
15805
|
-
windowStart:
|
|
15806
|
-
windowEnd:
|
|
15915
|
+
remainingBacklogCount: z55.number().int().nonnegative().optional(),
|
|
15916
|
+
windowStart: z55.string(),
|
|
15917
|
+
windowEnd: z55.string()
|
|
15807
15918
|
});
|
|
15808
|
-
var trafficBackfillRequestSchema =
|
|
15919
|
+
var trafficBackfillRequestSchema = z55.object({
|
|
15809
15920
|
/** Lookback window in days. Default: 30; capped server-side at the adapter ceiling. WordPress always requires a retention-aware repair, not this generic replace operation. */
|
|
15810
|
-
days:
|
|
15921
|
+
days: z55.number().int().positive().optional()
|
|
15811
15922
|
});
|
|
15812
|
-
var trafficResetRequestSchema =
|
|
15813
|
-
advanceToNow:
|
|
15923
|
+
var trafficResetRequestSchema = z55.object({
|
|
15924
|
+
advanceToNow: z55.literal(true)
|
|
15814
15925
|
});
|
|
15815
|
-
var trafficBackfillResponseSchema =
|
|
15816
|
-
sourceId:
|
|
15817
|
-
runId:
|
|
15926
|
+
var trafficBackfillResponseSchema = z55.object({
|
|
15927
|
+
sourceId: z55.string(),
|
|
15928
|
+
runId: z55.string(),
|
|
15818
15929
|
status: runStatusSchema,
|
|
15819
|
-
windowStart:
|
|
15820
|
-
windowEnd:
|
|
15930
|
+
windowStart: z55.string(),
|
|
15931
|
+
windowEnd: z55.string(),
|
|
15821
15932
|
/** Days actually used after server-side clamping (≤ requested). */
|
|
15822
|
-
daysRequested:
|
|
15823
|
-
daysApplied:
|
|
15933
|
+
daysRequested: z55.number().int().positive(),
|
|
15934
|
+
daysApplied: z55.number().int().positive()
|
|
15824
15935
|
});
|
|
15825
|
-
var trafficSourceTotalsSchema =
|
|
15936
|
+
var trafficSourceTotalsSchema = z55.object({
|
|
15826
15937
|
/**
|
|
15827
15938
|
* Total classified-crawler hits in the window. UNCHANGED contract — still the
|
|
15828
15939
|
* full count across every path class. Use `crawlerContentHits` for the
|
|
15829
15940
|
* "content was actually crawled" signal.
|
|
15830
15941
|
*/
|
|
15831
|
-
crawlerHits:
|
|
15942
|
+
crawlerHits: z55.number().int().nonnegative(),
|
|
15832
15943
|
/** Crawler hits against content/document paths only (= `crawlerSegments.content`). */
|
|
15833
|
-
crawlerContentHits:
|
|
15944
|
+
crawlerContentHits: z55.number().int().nonnegative(),
|
|
15834
15945
|
/** Infrastructure crawler hits — sitemap + robots + asset fetches (`crawlerSegments.{sitemap,robots,asset}`). */
|
|
15835
|
-
crawlerInfraHits:
|
|
15946
|
+
crawlerInfraHits: z55.number().int().nonnegative(),
|
|
15836
15947
|
/** Full per-class crawler-hit breakdown; the five buckets sum to `crawlerHits`. */
|
|
15837
15948
|
crawlerSegments: trafficCrawlerSegmentsSchema,
|
|
15838
|
-
aiUserFetchHits:
|
|
15949
|
+
aiUserFetchHits: z55.number().int().nonnegative(),
|
|
15839
15950
|
/**
|
|
15840
15951
|
* Every request carrying AI-origin evidence. UNCHANGED contract — still the
|
|
15841
15952
|
* full count across every status. Use `aiReferralLandedHits` for the
|
|
15842
15953
|
* "someone actually arrived" signal.
|
|
15843
15954
|
*/
|
|
15844
|
-
aiReferralHits:
|
|
15955
|
+
aiReferralHits: z55.number().int().nonnegative(),
|
|
15845
15956
|
/**
|
|
15846
15957
|
* Countable referral SESSIONS: excludes requests answered with a proven
|
|
15847
15958
|
* Location redirect (301/302/303/307/308) AND static subresource fetches,
|
|
@@ -15852,7 +15963,7 @@ var trafficSourceTotalsSchema = z54.object({
|
|
|
15852
15963
|
* `landed + redirected <= total`; the gap is subresource noise, which is
|
|
15853
15964
|
* neither a session nor a hop.
|
|
15854
15965
|
*/
|
|
15855
|
-
aiReferralLandedHits:
|
|
15966
|
+
aiReferralLandedHits: z55.number().int().nonnegative(),
|
|
15856
15967
|
/**
|
|
15857
15968
|
* Referral hits answered with a Location redirect. The visitor got no
|
|
15858
15969
|
* content here; the destination raises its own row when it carries the same
|
|
@@ -15860,50 +15971,50 @@ var trafficSourceTotalsSchema = z54.object({
|
|
|
15860
15971
|
* where this is most of the total is a finding in itself: its AI arrivals
|
|
15861
15972
|
* all bounce off a redirect.
|
|
15862
15973
|
*/
|
|
15863
|
-
aiReferralRedirectedHits:
|
|
15864
|
-
sampleCount:
|
|
15974
|
+
aiReferralRedirectedHits: z55.number().int().nonnegative(),
|
|
15975
|
+
sampleCount: z55.number().int().nonnegative()
|
|
15865
15976
|
});
|
|
15866
|
-
var trafficSourceListResponseSchema =
|
|
15867
|
-
sources:
|
|
15977
|
+
var trafficSourceListResponseSchema = z55.object({
|
|
15978
|
+
sources: z55.array(trafficSourceDtoSchema)
|
|
15868
15979
|
});
|
|
15869
15980
|
var trafficSourceDetailDtoSchema = trafficSourceDtoSchema.extend({
|
|
15870
15981
|
totals24h: trafficSourceTotalsSchema,
|
|
15871
|
-
latestRun:
|
|
15872
|
-
runId:
|
|
15982
|
+
latestRun: z55.object({
|
|
15983
|
+
runId: z55.string(),
|
|
15873
15984
|
status: runStatusSchema,
|
|
15874
|
-
startedAt:
|
|
15875
|
-
finishedAt:
|
|
15876
|
-
error:
|
|
15985
|
+
startedAt: z55.string().nullable(),
|
|
15986
|
+
finishedAt: z55.string().nullable(),
|
|
15987
|
+
error: z55.string().nullable()
|
|
15877
15988
|
}).nullable()
|
|
15878
15989
|
});
|
|
15879
|
-
var trafficStatusResponseSchema =
|
|
15880
|
-
sources:
|
|
15990
|
+
var trafficStatusResponseSchema = z55.object({
|
|
15991
|
+
sources: z55.array(trafficSourceDetailDtoSchema)
|
|
15881
15992
|
});
|
|
15882
|
-
var trafficEventKindSchema =
|
|
15993
|
+
var trafficEventKindSchema = z55.enum(["crawler", "ai-user-fetch", "ai-referral"]);
|
|
15883
15994
|
var TrafficEventKinds = trafficEventKindSchema.enum;
|
|
15884
|
-
var trafficSeriesGranularitySchema =
|
|
15995
|
+
var trafficSeriesGranularitySchema = z55.enum(["hour", "day"]);
|
|
15885
15996
|
var TrafficSeriesGranularities = trafficSeriesGranularitySchema.enum;
|
|
15886
|
-
var trafficSeriesPointSchema =
|
|
15997
|
+
var trafficSeriesPointSchema = z55.object({
|
|
15887
15998
|
/**
|
|
15888
15999
|
* UTC bucket key: an ISO hour for hourly series, or `YYYY-MM-DD` for daily
|
|
15889
16000
|
* series. The response includes zero-value buckets across the full window.
|
|
15890
16001
|
*/
|
|
15891
|
-
bucket:
|
|
15892
|
-
crawlerHits:
|
|
15893
|
-
aiUserFetchHits:
|
|
15894
|
-
aiReferralHits:
|
|
16002
|
+
bucket: z55.string(),
|
|
16003
|
+
crawlerHits: z55.number().int().nonnegative(),
|
|
16004
|
+
aiUserFetchHits: z55.number().int().nonnegative(),
|
|
16005
|
+
aiReferralHits: z55.number().int().nonnegative(),
|
|
15895
16006
|
/**
|
|
15896
16007
|
* The part of `aiReferralHits` not answered with a Location redirect — the
|
|
15897
16008
|
* series to chart under any label that says sessions or visits.
|
|
15898
16009
|
*/
|
|
15899
|
-
aiReferralLandedHits:
|
|
16010
|
+
aiReferralLandedHits: z55.number().int().nonnegative(),
|
|
15900
16011
|
/**
|
|
15901
16012
|
* The part of `crawlerHits` that is a real content page, excluding robots,
|
|
15902
16013
|
* sitemaps and assets. `crawlerHits` keeps its full-count contract; this is
|
|
15903
16014
|
* the series to chart under any label that says "pages crawled", because a
|
|
15904
16015
|
* sitemap re-fetch is not a page an engine read.
|
|
15905
16016
|
*/
|
|
15906
|
-
crawlerContentHits:
|
|
16017
|
+
crawlerContentHits: z55.number().int().nonnegative(),
|
|
15907
16018
|
/**
|
|
15908
16019
|
* False for a bucket that predates any observation for this project, i.e.
|
|
15909
16020
|
* before `series.coverageStart`. Such a bucket reads 0 because nothing was
|
|
@@ -15911,74 +16022,74 @@ var trafficSeriesPointSchema = z54.object({
|
|
|
15911
16022
|
* those as a measured zero. Derived here rather than in a component so the
|
|
15912
16023
|
* CLI draws the same distinction.
|
|
15913
16024
|
*/
|
|
15914
|
-
measured:
|
|
15915
|
-
});
|
|
15916
|
-
var trafficCrawlerEventEntrySchema =
|
|
15917
|
-
kind:
|
|
15918
|
-
sourceId:
|
|
15919
|
-
tsHour:
|
|
15920
|
-
botId:
|
|
15921
|
-
operator:
|
|
15922
|
-
verificationStatus:
|
|
15923
|
-
verificationManifests:
|
|
15924
|
-
verificationUnattributedHits:
|
|
15925
|
-
pathNormalized:
|
|
16025
|
+
measured: z55.boolean()
|
|
16026
|
+
});
|
|
16027
|
+
var trafficCrawlerEventEntrySchema = z55.object({
|
|
16028
|
+
kind: z55.literal(TrafficEventKinds.crawler),
|
|
16029
|
+
sourceId: z55.string(),
|
|
16030
|
+
tsHour: z55.string(),
|
|
16031
|
+
botId: z55.string(),
|
|
16032
|
+
operator: z55.string(),
|
|
16033
|
+
verificationStatus: z55.string(),
|
|
16034
|
+
verificationManifests: z55.array(trafficVerificationManifestUsageSchema).optional(),
|
|
16035
|
+
verificationUnattributedHits: z55.number().int().nonnegative().optional(),
|
|
16036
|
+
pathNormalized: z55.string(),
|
|
15926
16037
|
/** Coarse class of the fetched path — lets the UI split content crawls from sitemap/robots/asset polling. */
|
|
15927
16038
|
pathClass: trafficPathClassSchema,
|
|
15928
|
-
status:
|
|
15929
|
-
hits:
|
|
15930
|
-
});
|
|
15931
|
-
var trafficAiUserFetchEventEntrySchema =
|
|
15932
|
-
kind:
|
|
15933
|
-
sourceId:
|
|
15934
|
-
tsHour:
|
|
15935
|
-
botId:
|
|
15936
|
-
operator:
|
|
15937
|
-
verificationStatus:
|
|
15938
|
-
verificationManifests:
|
|
15939
|
-
verificationUnattributedHits:
|
|
15940
|
-
pathNormalized:
|
|
15941
|
-
status:
|
|
15942
|
-
hits:
|
|
15943
|
-
});
|
|
15944
|
-
var trafficAiReferralEventEntrySchema =
|
|
15945
|
-
kind:
|
|
15946
|
-
sourceId:
|
|
15947
|
-
tsHour:
|
|
15948
|
-
product:
|
|
15949
|
-
operator:
|
|
15950
|
-
sourceDomain:
|
|
15951
|
-
evidenceType:
|
|
15952
|
-
landingPathNormalized:
|
|
15953
|
-
status:
|
|
16039
|
+
status: z55.number().int(),
|
|
16040
|
+
hits: z55.number().int().nonnegative()
|
|
16041
|
+
});
|
|
16042
|
+
var trafficAiUserFetchEventEntrySchema = z55.object({
|
|
16043
|
+
kind: z55.literal(TrafficEventKinds["ai-user-fetch"]),
|
|
16044
|
+
sourceId: z55.string(),
|
|
16045
|
+
tsHour: z55.string(),
|
|
16046
|
+
botId: z55.string(),
|
|
16047
|
+
operator: z55.string(),
|
|
16048
|
+
verificationStatus: z55.string(),
|
|
16049
|
+
verificationManifests: z55.array(trafficVerificationManifestUsageSchema).optional(),
|
|
16050
|
+
verificationUnattributedHits: z55.number().int().nonnegative().optional(),
|
|
16051
|
+
pathNormalized: z55.string(),
|
|
16052
|
+
status: z55.number().int(),
|
|
16053
|
+
hits: z55.number().int().nonnegative()
|
|
16054
|
+
});
|
|
16055
|
+
var trafficAiReferralEventEntrySchema = z55.object({
|
|
16056
|
+
kind: z55.literal(TrafficEventKinds["ai-referral"]),
|
|
16057
|
+
sourceId: z55.string(),
|
|
16058
|
+
tsHour: z55.string(),
|
|
16059
|
+
product: z55.string(),
|
|
16060
|
+
operator: z55.string(),
|
|
16061
|
+
sourceDomain: z55.string(),
|
|
16062
|
+
evidenceType: z55.string(),
|
|
16063
|
+
landingPathNormalized: z55.string(),
|
|
16064
|
+
status: z55.number().int(),
|
|
15954
16065
|
/** Total AI-referral sessions in the bucket. `paidHits + organicHits + unknownHits === hits`. */
|
|
15955
|
-
hits:
|
|
16066
|
+
hits: z55.number().int().nonnegative(),
|
|
15956
16067
|
/** Sessions carrying paid-attribution UTM evidence (`utm_medium=cpc`, …). */
|
|
15957
|
-
paidHits:
|
|
16068
|
+
paidHits: z55.number().int().nonnegative(),
|
|
15958
16069
|
/** Sessions with no paid-attribution evidence. Not proof the click was unpaid — an untagged ad click is indistinguishable. */
|
|
15959
|
-
organicHits:
|
|
16070
|
+
organicHits: z55.number().int().nonnegative(),
|
|
15960
16071
|
/**
|
|
15961
16072
|
* Sessions ingested before the classifier shipped. Their UTM tags were never
|
|
15962
16073
|
* persisted, so they can never be resolved to paid or organic. Never fold
|
|
15963
16074
|
* these into `organicHits`.
|
|
15964
16075
|
*/
|
|
15965
|
-
unknownHits:
|
|
16076
|
+
unknownHits: z55.number().int().nonnegative()
|
|
15966
16077
|
});
|
|
15967
|
-
var trafficEventEntrySchema =
|
|
16078
|
+
var trafficEventEntrySchema = z55.discriminatedUnion("kind", [
|
|
15968
16079
|
trafficCrawlerEventEntrySchema,
|
|
15969
16080
|
trafficAiUserFetchEventEntrySchema,
|
|
15970
16081
|
trafficAiReferralEventEntrySchema
|
|
15971
16082
|
]);
|
|
15972
|
-
var trafficEventsResponseSchema =
|
|
15973
|
-
windowStart:
|
|
15974
|
-
windowEnd:
|
|
16083
|
+
var trafficEventsResponseSchema = z55.object({
|
|
16084
|
+
windowStart: z55.string(),
|
|
16085
|
+
windowEnd: z55.string(),
|
|
15975
16086
|
/**
|
|
15976
16087
|
* Full-window chart data, aggregated independently from the capped detail
|
|
15977
16088
|
* rows below. This prevents dense windows from silently losing old buckets.
|
|
15978
16089
|
*/
|
|
15979
|
-
series:
|
|
16090
|
+
series: z55.object({
|
|
15980
16091
|
granularity: trafficSeriesGranularitySchema,
|
|
15981
|
-
points:
|
|
16092
|
+
points: z55.array(trafficSeriesPointSchema),
|
|
15982
16093
|
/**
|
|
15983
16094
|
* Earliest event ever observed for this project, across ALL of its traffic
|
|
15984
16095
|
* sources, or null when nothing has been recorded. Buckets before it were
|
|
@@ -15987,7 +16098,7 @@ var trafficEventsResponseSchema = z54.object({
|
|
|
15987
16098
|
* nothing. The cost is that a source connected much later hides its own
|
|
15988
16099
|
* early gap, which is the better error than marking real data unmeasured.
|
|
15989
16100
|
*/
|
|
15990
|
-
coverageStart:
|
|
16101
|
+
coverageStart: z55.string().nullable(),
|
|
15991
16102
|
/**
|
|
15992
16103
|
* Least-squares fit per charted metric, over the densified points.
|
|
15993
16104
|
*
|
|
@@ -15996,52 +16107,52 @@ var trafficEventsResponseSchema = z54.object({
|
|
|
15996
16107
|
* UI/CLI parity rule. `null` for a metric with fewer than two observations,
|
|
15997
16108
|
* so a caller renders "no trend" instead of a fabricated flat line.
|
|
15998
16109
|
*/
|
|
15999
|
-
trends:
|
|
16110
|
+
trends: z55.object({
|
|
16000
16111
|
crawlerContentHits: linearTrendSchema.nullable(),
|
|
16001
16112
|
aiUserFetchHits: linearTrendSchema.nullable(),
|
|
16002
16113
|
aiReferralLandedHits: linearTrendSchema.nullable()
|
|
16003
16114
|
})
|
|
16004
16115
|
}),
|
|
16005
|
-
totals:
|
|
16116
|
+
totals: z55.object({
|
|
16006
16117
|
/** Total classified-crawler hits across the window. UNCHANGED contract. */
|
|
16007
|
-
crawlerHits:
|
|
16118
|
+
crawlerHits: z55.number().int().nonnegative(),
|
|
16008
16119
|
/** Crawler hits against content/document paths only (= `crawlerSegments.content`). */
|
|
16009
|
-
crawlerContentHits:
|
|
16120
|
+
crawlerContentHits: z55.number().int().nonnegative(),
|
|
16010
16121
|
/** Infrastructure crawler hits — sitemap + robots + asset fetches. */
|
|
16011
|
-
crawlerInfraHits:
|
|
16122
|
+
crawlerInfraHits: z55.number().int().nonnegative(),
|
|
16012
16123
|
/** Full per-class crawler-hit breakdown; the five buckets sum to `crawlerHits`. */
|
|
16013
16124
|
crawlerSegments: trafficCrawlerSegmentsSchema,
|
|
16014
|
-
aiUserFetchHits:
|
|
16125
|
+
aiUserFetchHits: z55.number().int().nonnegative(),
|
|
16015
16126
|
/**
|
|
16016
16127
|
* Every AI-referral request in the window, whatever the server answered.
|
|
16017
16128
|
* NOT a session count: use `aiReferralLandedHits` for anything presented
|
|
16018
16129
|
* as sessions or visits. The three class buckets sum to the LANDED figure,
|
|
16019
16130
|
* because a redirect hop's paid tags are not a paid session.
|
|
16020
16131
|
*/
|
|
16021
|
-
aiReferralHits:
|
|
16132
|
+
aiReferralHits: z55.number().int().nonnegative(),
|
|
16022
16133
|
/**
|
|
16023
16134
|
* Countable referral SESSIONS: no redirect hops, no static subresource
|
|
16024
16135
|
* fetches — the same predicate the report uses, so windowed totals here
|
|
16025
16136
|
* and report arrivals cannot disagree.
|
|
16026
16137
|
*/
|
|
16027
|
-
aiReferralLandedHits:
|
|
16138
|
+
aiReferralLandedHits: z55.number().int().nonnegative(),
|
|
16028
16139
|
/** Referral hits answered with a Location redirect — hops, not arrivals. */
|
|
16029
|
-
aiReferralRedirectedHits:
|
|
16140
|
+
aiReferralRedirectedHits: z55.number().int().nonnegative(),
|
|
16030
16141
|
/** LANDED sessions carrying paid-attribution UTM evidence. */
|
|
16031
|
-
aiReferralPaidHits:
|
|
16142
|
+
aiReferralPaidHits: z55.number().int().nonnegative(),
|
|
16032
16143
|
/** LANDED sessions with no paid-attribution evidence. */
|
|
16033
|
-
aiReferralOrganicHits:
|
|
16144
|
+
aiReferralOrganicHits: z55.number().int().nonnegative(),
|
|
16034
16145
|
/** LANDED sessions ingested before the classifier shipped; unresolvable, never organic. */
|
|
16035
|
-
aiReferralUnknownHits:
|
|
16146
|
+
aiReferralUnknownHits: z55.number().int().nonnegative()
|
|
16036
16147
|
}),
|
|
16037
|
-
eventRows:
|
|
16148
|
+
eventRows: z55.object({
|
|
16038
16149
|
/** Total detail rows matching the window/source/kind filters before `limit`. */
|
|
16039
|
-
total:
|
|
16150
|
+
total: z55.number().int().nonnegative(),
|
|
16040
16151
|
/** Number of newest detail rows included in `events`. */
|
|
16041
|
-
returned:
|
|
16042
|
-
truncated:
|
|
16152
|
+
returned: z55.number().int().nonnegative(),
|
|
16153
|
+
truncated: z55.boolean()
|
|
16043
16154
|
}),
|
|
16044
|
-
events:
|
|
16155
|
+
events: z55.array(trafficEventEntrySchema)
|
|
16045
16156
|
});
|
|
16046
16157
|
|
|
16047
16158
|
// ../contracts/src/traffic-path.ts
|
|
@@ -16180,76 +16291,76 @@ function sumInfraHits(segments) {
|
|
|
16180
16291
|
}
|
|
16181
16292
|
|
|
16182
16293
|
// ../contracts/src/research.ts
|
|
16183
|
-
import { z as
|
|
16294
|
+
import { z as z57 } from "zod";
|
|
16184
16295
|
|
|
16185
16296
|
// ../contracts/src/users.ts
|
|
16186
|
-
import { z as
|
|
16297
|
+
import { z as z56 } from "zod";
|
|
16187
16298
|
var UserRoles = {
|
|
16188
16299
|
admin: "admin",
|
|
16189
16300
|
viewer: "viewer"
|
|
16190
16301
|
};
|
|
16191
|
-
var userRoleSchema =
|
|
16302
|
+
var userRoleSchema = z56.enum(["admin", "viewer"]);
|
|
16192
16303
|
var USER_NAME_PATTERN = /^[a-z\d][\w.-]{0,63}$/i;
|
|
16193
|
-
var userNameSchema =
|
|
16304
|
+
var userNameSchema = z56.string().regex(
|
|
16194
16305
|
USER_NAME_PATTERN,
|
|
16195
16306
|
"A name may use letters, digits, dots, dashes and underscores, and must start with a letter or digit."
|
|
16196
16307
|
);
|
|
16197
16308
|
var USER_PASSWORD_MIN_LENGTH = 12;
|
|
16198
|
-
var userPasswordSchema =
|
|
16309
|
+
var userPasswordSchema = z56.string().min(
|
|
16199
16310
|
USER_PASSWORD_MIN_LENGTH,
|
|
16200
16311
|
`A password must be at least ${USER_PASSWORD_MIN_LENGTH} characters.`
|
|
16201
16312
|
);
|
|
16202
16313
|
function normalizeUserName(name) {
|
|
16203
16314
|
return name.trim().toLowerCase();
|
|
16204
16315
|
}
|
|
16205
|
-
var userDtoSchema =
|
|
16206
|
-
id:
|
|
16207
|
-
name:
|
|
16316
|
+
var userDtoSchema = z56.object({
|
|
16317
|
+
id: z56.string(),
|
|
16318
|
+
name: z56.string(),
|
|
16208
16319
|
role: userRoleSchema,
|
|
16209
|
-
createdAt:
|
|
16210
|
-
lastLoginAt:
|
|
16320
|
+
createdAt: z56.string(),
|
|
16321
|
+
lastLoginAt: z56.string().nullable()
|
|
16211
16322
|
});
|
|
16212
|
-
var userListDtoSchema =
|
|
16213
|
-
users:
|
|
16323
|
+
var userListDtoSchema = z56.object({
|
|
16324
|
+
users: z56.array(userDtoSchema)
|
|
16214
16325
|
});
|
|
16215
|
-
var createUserRequestSchema =
|
|
16326
|
+
var createUserRequestSchema = z56.object({
|
|
16216
16327
|
name: userNameSchema,
|
|
16217
16328
|
password: userPasswordSchema,
|
|
16218
16329
|
role: userRoleSchema
|
|
16219
16330
|
});
|
|
16220
|
-
var loginRequestSchema =
|
|
16221
|
-
name:
|
|
16222
|
-
password:
|
|
16331
|
+
var loginRequestSchema = z56.object({
|
|
16332
|
+
name: z56.string().min(1),
|
|
16333
|
+
password: z56.string().min(1)
|
|
16223
16334
|
});
|
|
16224
|
-
var authSessionDtoSchema =
|
|
16335
|
+
var authSessionDtoSchema = z56.object({
|
|
16225
16336
|
/** True once at least one account exists, so the dashboard must sign in. */
|
|
16226
|
-
authRequired:
|
|
16337
|
+
authRequired: z56.boolean(),
|
|
16227
16338
|
/** The signed-in person, or null when nobody is signed in. */
|
|
16228
16339
|
user: userDtoSchema.pick({ name: true, role: true }).nullable()
|
|
16229
16340
|
});
|
|
16230
16341
|
var LOGIN_FAILED_MESSAGE = "Incorrect name or password.";
|
|
16231
16342
|
|
|
16232
16343
|
// ../contracts/src/research.ts
|
|
16233
|
-
var researchRunStatusSchema =
|
|
16344
|
+
var researchRunStatusSchema = z57.enum(["queued", "running", "completed", "partial", "failed"]);
|
|
16234
16345
|
var ResearchRunStatuses = researchRunStatusSchema.enum;
|
|
16235
|
-
var researchQueryStatusSchema =
|
|
16346
|
+
var researchQueryStatusSchema = z57.enum(["queued", "running", "completed", "failed"]);
|
|
16236
16347
|
var ResearchQueryStatuses = researchQueryStatusSchema.enum;
|
|
16237
16348
|
var DEFAULT_VIEWER_RESEARCH_DAILY_RUN_LIMIT = 20;
|
|
16238
16349
|
var MAX_RESEARCH_BATCH_RUNS = 20;
|
|
16239
16350
|
var MAX_RESEARCH_BATCH_QUERIES = 50;
|
|
16240
|
-
var researchScopeSelectionSchema =
|
|
16241
|
-
kind:
|
|
16351
|
+
var researchScopeSelectionSchema = z57.object({
|
|
16352
|
+
kind: z57.enum(["market", "property"]),
|
|
16242
16353
|
key: measurementV2StableKeySchema,
|
|
16243
16354
|
/** Guards a reviewed scope preview from silently using a newer plan revision. */
|
|
16244
|
-
expectedPlanRevision:
|
|
16355
|
+
expectedPlanRevision: z57.number().int().positive().optional()
|
|
16245
16356
|
}).strict();
|
|
16246
|
-
var researchRunScopeSchema =
|
|
16247
|
-
kind:
|
|
16357
|
+
var researchRunScopeSchema = z57.object({
|
|
16358
|
+
kind: z57.enum(["market", "property"]),
|
|
16248
16359
|
key: measurementV2StableKeySchema,
|
|
16249
|
-
label:
|
|
16250
|
-
planRevision:
|
|
16360
|
+
label: z57.string().trim().min(1),
|
|
16361
|
+
planRevision: z57.number().int().positive()
|
|
16251
16362
|
}).strict();
|
|
16252
|
-
var researchQueryTextSchema =
|
|
16363
|
+
var researchQueryTextSchema = z57.string().min(1).max(4e3).refine((value) => value.trim().length > 0, "Research queries cannot be blank.");
|
|
16253
16364
|
function deduplicateResearchQueries(queries) {
|
|
16254
16365
|
const seen = /* @__PURE__ */ new Set();
|
|
16255
16366
|
return queries.filter((query) => {
|
|
@@ -16274,271 +16385,275 @@ function expandResearchTemplate(template, scope, location) {
|
|
|
16274
16385
|
const bindings = Object.fromEntries(template.variables.map((variable) => [variable, available[variable]]));
|
|
16275
16386
|
return { bindings, output: expandQueryTemplate(template.pattern, bindings) };
|
|
16276
16387
|
}
|
|
16277
|
-
var researchTemplateSelectionSchema =
|
|
16278
|
-
templateId:
|
|
16279
|
-
templateVersion:
|
|
16388
|
+
var researchTemplateSelectionSchema = z57.object({
|
|
16389
|
+
templateId: z57.string().trim().min(1).max(256),
|
|
16390
|
+
templateVersion: z57.string().trim().min(1).max(256),
|
|
16391
|
+
/** Original preview context used to expand names, independent of the final engine location. */
|
|
16392
|
+
bindingLocation: locationContextSchema.nullable().optional()
|
|
16280
16393
|
}).strict();
|
|
16281
|
-
var researchRunCreateSchema =
|
|
16282
|
-
queries:
|
|
16283
|
-
provider:
|
|
16284
|
-
model:
|
|
16394
|
+
var researchRunCreateSchema = z57.object({
|
|
16395
|
+
queries: z57.array(researchQueryTextSchema).min(1).max(50),
|
|
16396
|
+
provider: z57.string().trim().min(1).optional(),
|
|
16397
|
+
model: z57.string().trim().min(1).max(200).optional(),
|
|
16285
16398
|
location: locationContextSchema.nullable().optional(),
|
|
16286
16399
|
scope: researchScopeSelectionSchema.optional(),
|
|
16287
16400
|
template: researchTemplateSelectionSchema.optional(),
|
|
16288
|
-
idempotencyKey:
|
|
16401
|
+
idempotencyKey: z57.string().trim().min(1).max(128).optional()
|
|
16289
16402
|
}).superRefine((value, ctx) => {
|
|
16290
|
-
if (value.model && !value.provider) ctx.addIssue({ code:
|
|
16403
|
+
if (value.model && !value.provider) ctx.addIssue({ code: z57.ZodIssueCode.custom, path: ["provider"], message: "provider is required when model is supplied" });
|
|
16291
16404
|
});
|
|
16292
16405
|
var researchBatchScopeSelectionSchema = researchScopeSelectionSchema.extend({
|
|
16293
|
-
expectedPlanRevision:
|
|
16406
|
+
expectedPlanRevision: z57.number().int().positive()
|
|
16294
16407
|
}).strict();
|
|
16295
|
-
var researchBatchRunCreateSchema =
|
|
16296
|
-
queries:
|
|
16297
|
-
provider:
|
|
16298
|
-
model:
|
|
16408
|
+
var researchBatchRunCreateSchema = z57.object({
|
|
16409
|
+
queries: z57.array(researchQueryTextSchema).min(1).max(MAX_RESEARCH_BATCH_QUERIES),
|
|
16410
|
+
provider: z57.string().trim().min(1),
|
|
16411
|
+
model: z57.string().trim().min(1).max(200),
|
|
16299
16412
|
location: locationContextSchema.nullable(),
|
|
16300
16413
|
scope: researchBatchScopeSelectionSchema.optional(),
|
|
16301
16414
|
template: researchTemplateSelectionSchema.optional()
|
|
16302
16415
|
}).strict();
|
|
16303
|
-
var researchBatchCreateSchema =
|
|
16304
|
-
idempotencyKey:
|
|
16305
|
-
runs:
|
|
16416
|
+
var researchBatchCreateSchema = z57.object({
|
|
16417
|
+
idempotencyKey: z57.string().trim().min(1).max(128),
|
|
16418
|
+
runs: z57.array(researchBatchRunCreateSchema).min(1).max(MAX_RESEARCH_BATCH_RUNS)
|
|
16306
16419
|
}).strict().superRefine((value, ctx) => {
|
|
16307
16420
|
const totalQueries = value.runs.reduce((total, run) => total + run.queries.length, 0);
|
|
16308
16421
|
if (totalQueries > MAX_RESEARCH_BATCH_QUERIES) {
|
|
16309
|
-
ctx.addIssue({ code:
|
|
16422
|
+
ctx.addIssue({ code: z57.ZodIssueCode.custom, path: ["runs"], message: `A research batch may contain at most ${MAX_RESEARCH_BATCH_QUERIES} concrete queries across all destinations` });
|
|
16310
16423
|
}
|
|
16311
16424
|
});
|
|
16312
|
-
var researchRunPrincipalSchema =
|
|
16313
|
-
kind:
|
|
16314
|
-
id:
|
|
16315
|
-
name:
|
|
16425
|
+
var researchRunPrincipalSchema = z57.object({
|
|
16426
|
+
kind: z57.enum(["api-key", "user"]),
|
|
16427
|
+
id: z57.string(),
|
|
16428
|
+
name: z57.string(),
|
|
16316
16429
|
role: userRoleSchema.nullable(),
|
|
16317
16430
|
/** Consumes the shared limited-research budget. Legacy viewers count by role. */
|
|
16318
|
-
limited:
|
|
16431
|
+
limited: z57.boolean().optional()
|
|
16319
16432
|
});
|
|
16320
|
-
var researchRunSummarySchema =
|
|
16321
|
-
id:
|
|
16322
|
-
projectId:
|
|
16433
|
+
var researchRunSummarySchema = z57.object({
|
|
16434
|
+
id: z57.string(),
|
|
16435
|
+
projectId: z57.string(),
|
|
16323
16436
|
status: researchRunStatusSchema,
|
|
16324
|
-
provider:
|
|
16325
|
-
requestedModel:
|
|
16326
|
-
resolvedModel:
|
|
16437
|
+
provider: z57.string(),
|
|
16438
|
+
requestedModel: z57.string().nullable(),
|
|
16439
|
+
resolvedModel: z57.string(),
|
|
16327
16440
|
location: locationContextSchema.nullable(),
|
|
16328
16441
|
scope: researchRunScopeSchema.nullable().optional(),
|
|
16329
16442
|
template: queryTrackingTemplateProvenanceSchema.nullable().optional(),
|
|
16330
|
-
totalQueries:
|
|
16331
|
-
completedQueries:
|
|
16332
|
-
failedQueries:
|
|
16333
|
-
error:
|
|
16443
|
+
totalQueries: z57.number().int(),
|
|
16444
|
+
completedQueries: z57.number().int(),
|
|
16445
|
+
failedQueries: z57.number().int(),
|
|
16446
|
+
error: z57.string().nullable(),
|
|
16334
16447
|
initiatedBy: researchRunPrincipalSchema.nullable(),
|
|
16335
|
-
startedAt:
|
|
16336
|
-
finishedAt:
|
|
16337
|
-
createdAt:
|
|
16448
|
+
startedAt: z57.string().nullable(),
|
|
16449
|
+
finishedAt: z57.string().nullable(),
|
|
16450
|
+
createdAt: z57.string()
|
|
16338
16451
|
});
|
|
16339
|
-
var researchRunQuerySchema =
|
|
16340
|
-
id:
|
|
16341
|
-
position:
|
|
16342
|
-
query:
|
|
16452
|
+
var researchRunQuerySchema = z57.object({
|
|
16453
|
+
id: z57.string(),
|
|
16454
|
+
position: z57.number().int(),
|
|
16455
|
+
query: z57.string(),
|
|
16343
16456
|
queryClass: queryClassSchema.nullable().optional(),
|
|
16344
16457
|
status: researchQueryStatusSchema,
|
|
16345
|
-
requestedModel:
|
|
16346
|
-
resolvedModel:
|
|
16347
|
-
servedModel:
|
|
16348
|
-
answerText:
|
|
16349
|
-
groundingSources:
|
|
16350
|
-
citedDomains:
|
|
16351
|
-
searchQueries:
|
|
16352
|
-
namedCompetitors:
|
|
16353
|
-
citedCompetitorDomains:
|
|
16354
|
-
answerMentioned:
|
|
16458
|
+
requestedModel: z57.string().nullable(),
|
|
16459
|
+
resolvedModel: z57.string(),
|
|
16460
|
+
servedModel: z57.string().nullable(),
|
|
16461
|
+
answerText: z57.string().nullable(),
|
|
16462
|
+
groundingSources: z57.array(groundingSourceSchema),
|
|
16463
|
+
citedDomains: z57.array(z57.string()),
|
|
16464
|
+
searchQueries: z57.array(z57.string()),
|
|
16465
|
+
namedCompetitors: z57.array(z57.string()).default([]),
|
|
16466
|
+
citedCompetitorDomains: z57.array(z57.string()).default([]),
|
|
16467
|
+
answerMentioned: z57.boolean().nullable(),
|
|
16355
16468
|
citationState: citationStateSchema.nullable(),
|
|
16356
|
-
error:
|
|
16357
|
-
startedAt:
|
|
16358
|
-
finishedAt:
|
|
16359
|
-
createdAt:
|
|
16360
|
-
});
|
|
16361
|
-
var researchRunDetailSchema = researchRunSummarySchema.extend({ queries:
|
|
16362
|
-
var researchBatchSchema =
|
|
16363
|
-
var researchProviderOptionSchema =
|
|
16364
|
-
name:
|
|
16365
|
-
displayName:
|
|
16366
|
-
modelConfigurable:
|
|
16367
|
-
defaultModel:
|
|
16368
|
-
knownModels:
|
|
16369
|
-
});
|
|
16370
|
-
var researchRunListSchema =
|
|
16371
|
-
runs:
|
|
16372
|
-
|
|
16469
|
+
error: z57.string().nullable(),
|
|
16470
|
+
startedAt: z57.string().nullable(),
|
|
16471
|
+
finishedAt: z57.string().nullable(),
|
|
16472
|
+
createdAt: z57.string()
|
|
16473
|
+
});
|
|
16474
|
+
var researchRunDetailSchema = researchRunSummarySchema.extend({ queries: z57.array(researchRunQuerySchema) });
|
|
16475
|
+
var researchBatchSchema = z57.object({ runs: z57.array(researchRunDetailSchema) });
|
|
16476
|
+
var researchProviderOptionSchema = z57.object({
|
|
16477
|
+
name: z57.string(),
|
|
16478
|
+
displayName: z57.string(),
|
|
16479
|
+
modelConfigurable: z57.boolean(),
|
|
16480
|
+
defaultModel: z57.string(),
|
|
16481
|
+
knownModels: z57.array(z57.object({ id: z57.string(), displayName: z57.string() }))
|
|
16482
|
+
});
|
|
16483
|
+
var researchRunListSchema = z57.object({
|
|
16484
|
+
runs: z57.array(researchRunSummarySchema),
|
|
16485
|
+
/** Opaque continuation after the last returned (createdAt, id); null ends history. */
|
|
16486
|
+
nextCursor: z57.string().nullable().optional(),
|
|
16487
|
+
providers: z57.array(researchProviderOptionSchema).optional(),
|
|
16373
16488
|
/** Credential-specific admission policy, shared by UI, CLI and MCP consumers. */
|
|
16374
|
-
access:
|
|
16489
|
+
access: z57.object({ canRun: z57.boolean(), dailyRunLimit: z57.number().int().positive().nullable() }).optional()
|
|
16375
16490
|
});
|
|
16376
16491
|
|
|
16377
16492
|
// ../contracts/src/ads.ts
|
|
16378
|
-
import { z as
|
|
16493
|
+
import { z as z58 } from "zod";
|
|
16379
16494
|
var AdsReviewStatuses = {
|
|
16380
16495
|
approved: "approved"
|
|
16381
16496
|
};
|
|
16382
16497
|
var AdsIntegrityDecisions = {
|
|
16383
16498
|
allowed: "allowed"
|
|
16384
16499
|
};
|
|
16385
|
-
var adsConnectRequestSchema =
|
|
16500
|
+
var adsConnectRequestSchema = z58.object({
|
|
16386
16501
|
/** Ads Manager "SDK key" scoped to one ad account. Stored in config.yaml, never the DB. */
|
|
16387
|
-
apiKey:
|
|
16388
|
-
});
|
|
16389
|
-
var adsAccountDtoSchema =
|
|
16390
|
-
id:
|
|
16391
|
-
name:
|
|
16392
|
-
status:
|
|
16393
|
-
currencyCode:
|
|
16394
|
-
timezone:
|
|
16395
|
-
url:
|
|
16396
|
-
reviewStatus:
|
|
16397
|
-
integrityReviewStatus:
|
|
16398
|
-
integrityDecision:
|
|
16399
|
-
});
|
|
16400
|
-
var adsGeoSearchQuerySchema =
|
|
16401
|
-
q:
|
|
16402
|
-
limit:
|
|
16403
|
-
});
|
|
16404
|
-
var adsGeoLocationDtoSchema =
|
|
16405
|
-
id:
|
|
16406
|
-
type:
|
|
16407
|
-
canonicalName:
|
|
16408
|
-
countryCode:
|
|
16409
|
-
name:
|
|
16410
|
-
regionCode:
|
|
16411
|
-
});
|
|
16412
|
-
var adsGeoSearchResponseSchema =
|
|
16413
|
-
count:
|
|
16414
|
-
query:
|
|
16415
|
-
results:
|
|
16416
|
-
});
|
|
16417
|
-
var adsConversionPixelDtoSchema =
|
|
16418
|
-
id:
|
|
16419
|
-
clientType:
|
|
16420
|
-
name:
|
|
16421
|
-
pixelId:
|
|
16422
|
-
});
|
|
16423
|
-
var adsConversionPixelListResponseSchema =
|
|
16424
|
-
pixels:
|
|
16425
|
-
});
|
|
16426
|
-
var adsConversionEventSettingSourceDtoSchema =
|
|
16427
|
-
id:
|
|
16428
|
-
name:
|
|
16429
|
-
});
|
|
16430
|
-
var adsConversionEventSettingDtoSchema =
|
|
16431
|
-
id:
|
|
16432
|
-
name:
|
|
16433
|
-
eventType:
|
|
16434
|
-
customEventName:
|
|
16435
|
-
attributionWindowDays:
|
|
16436
|
-
adAccountId:
|
|
16437
|
-
sourceIds:
|
|
16438
|
-
sources:
|
|
16439
|
-
archived:
|
|
16440
|
-
version:
|
|
16441
|
-
});
|
|
16442
|
-
var adsConversionEventSettingListResponseSchema =
|
|
16443
|
-
eventSettings:
|
|
16444
|
-
});
|
|
16445
|
-
var adsConnectionStatusDtoSchema =
|
|
16446
|
-
connected:
|
|
16447
|
-
adAccountId:
|
|
16448
|
-
displayName:
|
|
16449
|
-
currencyCode:
|
|
16450
|
-
timezone:
|
|
16451
|
-
status:
|
|
16452
|
-
reviewStatus:
|
|
16453
|
-
integrityReviewStatus:
|
|
16454
|
-
integrityDecision:
|
|
16455
|
-
lastSyncedAt:
|
|
16502
|
+
apiKey: z58.string().min(1)
|
|
16503
|
+
});
|
|
16504
|
+
var adsAccountDtoSchema = z58.object({
|
|
16505
|
+
id: z58.string(),
|
|
16506
|
+
name: z58.string(),
|
|
16507
|
+
status: z58.string(),
|
|
16508
|
+
currencyCode: z58.string().nullable(),
|
|
16509
|
+
timezone: z58.string().nullable(),
|
|
16510
|
+
url: z58.string().nullable(),
|
|
16511
|
+
reviewStatus: z58.string().nullable(),
|
|
16512
|
+
integrityReviewStatus: z58.string().nullable(),
|
|
16513
|
+
integrityDecision: z58.string().nullable()
|
|
16514
|
+
});
|
|
16515
|
+
var adsGeoSearchQuerySchema = z58.object({
|
|
16516
|
+
q: z58.string().trim().min(1).max(200),
|
|
16517
|
+
limit: z58.number().int().min(1).max(100).default(20)
|
|
16518
|
+
});
|
|
16519
|
+
var adsGeoLocationDtoSchema = z58.object({
|
|
16520
|
+
id: z58.string(),
|
|
16521
|
+
type: z58.string(),
|
|
16522
|
+
canonicalName: z58.string(),
|
|
16523
|
+
countryCode: z58.string(),
|
|
16524
|
+
name: z58.string(),
|
|
16525
|
+
regionCode: z58.string().nullable()
|
|
16526
|
+
});
|
|
16527
|
+
var adsGeoSearchResponseSchema = z58.object({
|
|
16528
|
+
count: z58.number().int().nonnegative(),
|
|
16529
|
+
query: z58.string(),
|
|
16530
|
+
results: z58.array(adsGeoLocationDtoSchema)
|
|
16531
|
+
});
|
|
16532
|
+
var adsConversionPixelDtoSchema = z58.object({
|
|
16533
|
+
id: z58.string(),
|
|
16534
|
+
clientType: z58.string().optional(),
|
|
16535
|
+
name: z58.string().optional(),
|
|
16536
|
+
pixelId: z58.string().optional()
|
|
16537
|
+
});
|
|
16538
|
+
var adsConversionPixelListResponseSchema = z58.object({
|
|
16539
|
+
pixels: z58.array(adsConversionPixelDtoSchema)
|
|
16540
|
+
});
|
|
16541
|
+
var adsConversionEventSettingSourceDtoSchema = z58.object({
|
|
16542
|
+
id: z58.string(),
|
|
16543
|
+
name: z58.string().optional()
|
|
16544
|
+
});
|
|
16545
|
+
var adsConversionEventSettingDtoSchema = z58.object({
|
|
16546
|
+
id: z58.string(),
|
|
16547
|
+
name: z58.string().optional(),
|
|
16548
|
+
eventType: z58.string().optional(),
|
|
16549
|
+
customEventName: z58.string().nullable().optional(),
|
|
16550
|
+
attributionWindowDays: z58.number().int().positive().optional(),
|
|
16551
|
+
adAccountId: z58.string().optional(),
|
|
16552
|
+
sourceIds: z58.array(z58.string()).optional(),
|
|
16553
|
+
sources: z58.array(adsConversionEventSettingSourceDtoSchema).optional(),
|
|
16554
|
+
archived: z58.boolean().optional(),
|
|
16555
|
+
version: z58.number().int().nonnegative().optional()
|
|
16556
|
+
});
|
|
16557
|
+
var adsConversionEventSettingListResponseSchema = z58.object({
|
|
16558
|
+
eventSettings: z58.array(adsConversionEventSettingDtoSchema)
|
|
16559
|
+
});
|
|
16560
|
+
var adsConnectionStatusDtoSchema = z58.object({
|
|
16561
|
+
connected: z58.boolean(),
|
|
16562
|
+
adAccountId: z58.string().nullable().optional(),
|
|
16563
|
+
displayName: z58.string().nullable().optional(),
|
|
16564
|
+
currencyCode: z58.string().nullable().optional(),
|
|
16565
|
+
timezone: z58.string().nullable().optional(),
|
|
16566
|
+
status: z58.string().nullable().optional(),
|
|
16567
|
+
reviewStatus: z58.string().nullable().optional(),
|
|
16568
|
+
integrityReviewStatus: z58.string().nullable().optional(),
|
|
16569
|
+
integrityDecision: z58.string().nullable().optional(),
|
|
16570
|
+
lastSyncedAt: z58.string().nullable().optional(),
|
|
16456
16571
|
/** Whether the ad account has OpenAI conversion tracking (pixel or CAPI) configured,
|
|
16457
16572
|
* detected from synced campaigns carrying conversion_event_setting_ids. Optional:
|
|
16458
16573
|
* only present when connected. */
|
|
16459
|
-
conversionTrackingConfigured:
|
|
16574
|
+
conversionTrackingConfigured: z58.boolean().optional()
|
|
16460
16575
|
});
|
|
16461
|
-
var adsDisconnectResponseSchema =
|
|
16462
|
-
disconnected:
|
|
16576
|
+
var adsDisconnectResponseSchema = z58.object({
|
|
16577
|
+
disconnected: z58.boolean()
|
|
16463
16578
|
});
|
|
16464
|
-
var adsSyncResponseSchema =
|
|
16465
|
-
runId:
|
|
16466
|
-
status:
|
|
16579
|
+
var adsSyncResponseSchema = z58.object({
|
|
16580
|
+
runId: z58.string(),
|
|
16581
|
+
status: z58.string()
|
|
16467
16582
|
});
|
|
16468
|
-
var adsCreativeDtoSchema =
|
|
16469
|
-
type:
|
|
16470
|
-
title:
|
|
16471
|
-
body:
|
|
16472
|
-
targetUrl:
|
|
16473
|
-
fileId:
|
|
16583
|
+
var adsCreativeDtoSchema = z58.object({
|
|
16584
|
+
type: z58.string().nullable().optional(),
|
|
16585
|
+
title: z58.string().nullable().optional(),
|
|
16586
|
+
body: z58.string().nullable().optional(),
|
|
16587
|
+
targetUrl: z58.string().nullable().optional(),
|
|
16588
|
+
fileId: z58.string().nullable().optional()
|
|
16474
16589
|
});
|
|
16475
|
-
var adsCampaignBiddingTypeSchema =
|
|
16590
|
+
var adsCampaignBiddingTypeSchema = z58.enum(["impressions", "clicks"]);
|
|
16476
16591
|
var AdsCampaignBiddingTypes = adsCampaignBiddingTypeSchema.enum;
|
|
16477
|
-
var adsAdGroupBillingEventTypeSchema =
|
|
16592
|
+
var adsAdGroupBillingEventTypeSchema = z58.enum(["impression", "click"]);
|
|
16478
16593
|
var AdsAdGroupBillingEventTypes = adsAdGroupBillingEventTypeSchema.enum;
|
|
16479
|
-
var adsAdDtoSchema =
|
|
16480
|
-
id:
|
|
16481
|
-
adGroupId:
|
|
16482
|
-
name:
|
|
16483
|
-
status:
|
|
16484
|
-
reviewStatus:
|
|
16594
|
+
var adsAdDtoSchema = z58.object({
|
|
16595
|
+
id: z58.string(),
|
|
16596
|
+
adGroupId: z58.string(),
|
|
16597
|
+
name: z58.string(),
|
|
16598
|
+
status: z58.string(),
|
|
16599
|
+
reviewStatus: z58.string().nullable().optional(),
|
|
16485
16600
|
creative: adsCreativeDtoSchema.nullable().optional(),
|
|
16486
|
-
upstreamUpdatedAt:
|
|
16487
|
-
syncedAt:
|
|
16488
|
-
});
|
|
16489
|
-
var adsAdGroupDtoSchema =
|
|
16490
|
-
id:
|
|
16491
|
-
campaignId:
|
|
16492
|
-
name:
|
|
16493
|
-
description:
|
|
16494
|
-
status:
|
|
16495
|
-
billingEventType:
|
|
16496
|
-
maxBidMicros:
|
|
16601
|
+
upstreamUpdatedAt: z58.number().int().nullable().optional(),
|
|
16602
|
+
syncedAt: z58.string().optional()
|
|
16603
|
+
});
|
|
16604
|
+
var adsAdGroupDtoSchema = z58.object({
|
|
16605
|
+
id: z58.string(),
|
|
16606
|
+
campaignId: z58.string(),
|
|
16607
|
+
name: z58.string(),
|
|
16608
|
+
description: z58.string().nullable().optional(),
|
|
16609
|
+
status: z58.string(),
|
|
16610
|
+
billingEventType: z58.union([adsAdGroupBillingEventTypeSchema, z58.null()]).optional(),
|
|
16611
|
+
maxBidMicros: z58.number().int().nullable().optional(),
|
|
16497
16612
|
/**
|
|
16498
16613
|
* The targeting primitive: entries are multi-line strings of
|
|
16499
16614
|
* newline-separated example queries (the live Ads Manager format).
|
|
16500
16615
|
*/
|
|
16501
|
-
contextHints:
|
|
16502
|
-
ads:
|
|
16503
|
-
upstreamUpdatedAt:
|
|
16504
|
-
syncedAt:
|
|
16505
|
-
});
|
|
16506
|
-
var adsCampaignDtoSchema =
|
|
16507
|
-
id:
|
|
16508
|
-
name:
|
|
16509
|
-
description:
|
|
16510
|
-
status:
|
|
16511
|
-
startTime:
|
|
16512
|
-
endTime:
|
|
16513
|
-
biddingType:
|
|
16514
|
-
dailySpendLimitMicros:
|
|
16515
|
-
lifetimeSpendLimitMicros:
|
|
16516
|
-
conversionEventSettingIds:
|
|
16517
|
-
locationIds:
|
|
16518
|
-
adGroups:
|
|
16519
|
-
upstreamUpdatedAt:
|
|
16520
|
-
syncedAt:
|
|
16521
|
-
});
|
|
16522
|
-
var adsCampaignListResponseSchema =
|
|
16523
|
-
campaigns:
|
|
16524
|
-
});
|
|
16525
|
-
var adsInsightLevelSchema =
|
|
16616
|
+
contextHints: z58.array(z58.string()).default([]),
|
|
16617
|
+
ads: z58.array(adsAdDtoSchema).default([]),
|
|
16618
|
+
upstreamUpdatedAt: z58.number().int().nullable().optional(),
|
|
16619
|
+
syncedAt: z58.string().optional()
|
|
16620
|
+
});
|
|
16621
|
+
var adsCampaignDtoSchema = z58.object({
|
|
16622
|
+
id: z58.string(),
|
|
16623
|
+
name: z58.string(),
|
|
16624
|
+
description: z58.string().nullable().optional(),
|
|
16625
|
+
status: z58.string(),
|
|
16626
|
+
startTime: z58.number().int().nullable().optional(),
|
|
16627
|
+
endTime: z58.number().int().nullable().optional(),
|
|
16628
|
+
biddingType: z58.union([adsCampaignBiddingTypeSchema, z58.null()]).optional(),
|
|
16629
|
+
dailySpendLimitMicros: z58.number().int().nullable().optional(),
|
|
16630
|
+
lifetimeSpendLimitMicros: z58.number().int().nullable().optional(),
|
|
16631
|
+
conversionEventSettingIds: z58.array(z58.string()).default([]),
|
|
16632
|
+
locationIds: z58.array(z58.string()).optional(),
|
|
16633
|
+
adGroups: z58.array(adsAdGroupDtoSchema).default([]),
|
|
16634
|
+
upstreamUpdatedAt: z58.number().int().nullable().optional(),
|
|
16635
|
+
syncedAt: z58.string().optional()
|
|
16636
|
+
});
|
|
16637
|
+
var adsCampaignListResponseSchema = z58.object({
|
|
16638
|
+
campaigns: z58.array(adsCampaignDtoSchema)
|
|
16639
|
+
});
|
|
16640
|
+
var adsInsightLevelSchema = z58.enum(["campaign", "ad_group"]);
|
|
16526
16641
|
var AdsInsightLevels = adsInsightLevelSchema.enum;
|
|
16527
|
-
var adsInsightRowDtoSchema =
|
|
16642
|
+
var adsInsightRowDtoSchema = z58.object({
|
|
16528
16643
|
level: adsInsightLevelSchema,
|
|
16529
|
-
entityId:
|
|
16530
|
-
date:
|
|
16531
|
-
impressions:
|
|
16532
|
-
clicks:
|
|
16533
|
-
spendMicros:
|
|
16644
|
+
entityId: z58.string(),
|
|
16645
|
+
date: z58.string(),
|
|
16646
|
+
impressions: z58.number().int(),
|
|
16647
|
+
clicks: z58.number().int(),
|
|
16648
|
+
spendMicros: z58.number().int(),
|
|
16534
16649
|
/** Conversion count for the row. 0 when conversion tracking is not configured.
|
|
16535
16650
|
* Conversion VALUE (for ROAS) is a deliberate follow-up: the upstream value
|
|
16536
16651
|
* field is not yet captured against a live conversion-tracking account. */
|
|
16537
|
-
conversions:
|
|
16652
|
+
conversions: z58.number().int(),
|
|
16538
16653
|
/** clicks / impressions; null when impressions is 0. */
|
|
16539
|
-
ctr:
|
|
16654
|
+
ctr: z58.number().nullable(),
|
|
16540
16655
|
/** spendMicros / clicks, rounded to integer micros; null when clicks is 0. */
|
|
16541
|
-
cpcMicros:
|
|
16656
|
+
cpcMicros: z58.number().int().nullable(),
|
|
16542
16657
|
/**
|
|
16543
16658
|
* True when `date` is the ad account's CURRENT local calendar date, so this
|
|
16544
16659
|
* row is a running figure rather than a closed day. The sync re-reads the
|
|
@@ -16551,42 +16666,42 @@ var adsInsightRowDtoSchema = z57.object({
|
|
|
16551
16666
|
* conversion metrics, so the count stays at 0 until the day closes and the
|
|
16552
16667
|
* next sync reads the real figure. Treat it as not yet reported.
|
|
16553
16668
|
*/
|
|
16554
|
-
inProgress:
|
|
16669
|
+
inProgress: z58.boolean()
|
|
16555
16670
|
});
|
|
16556
|
-
var adsInsightsResponseSchema =
|
|
16557
|
-
rows:
|
|
16671
|
+
var adsInsightsResponseSchema = z58.object({
|
|
16672
|
+
rows: z58.array(adsInsightRowDtoSchema),
|
|
16558
16673
|
/** Account currency for rendering spend/cpc; null before the first sync. */
|
|
16559
|
-
currencyCode:
|
|
16560
|
-
});
|
|
16561
|
-
var adsRollupWindowDtoSchema =
|
|
16562
|
-
from:
|
|
16563
|
-
to:
|
|
16564
|
-
inProgressDate:
|
|
16565
|
-
});
|
|
16566
|
-
var adsTotalsDtoSchema =
|
|
16567
|
-
impressions:
|
|
16568
|
-
clicks:
|
|
16569
|
-
spendMicros:
|
|
16570
|
-
conversions:
|
|
16571
|
-
ctr:
|
|
16572
|
-
cpcMicros:
|
|
16573
|
-
});
|
|
16574
|
-
var adsSummaryDtoSchema =
|
|
16575
|
-
connected:
|
|
16576
|
-
displayName:
|
|
16577
|
-
currencyCode:
|
|
16578
|
-
lastSyncedAt:
|
|
16579
|
-
campaignCount:
|
|
16580
|
-
adGroupCount:
|
|
16581
|
-
adCount:
|
|
16674
|
+
currencyCode: z58.string().nullable().optional()
|
|
16675
|
+
});
|
|
16676
|
+
var adsRollupWindowDtoSchema = z58.object({
|
|
16677
|
+
from: z58.string().nullable(),
|
|
16678
|
+
to: z58.string().nullable(),
|
|
16679
|
+
inProgressDate: z58.string().nullable()
|
|
16680
|
+
});
|
|
16681
|
+
var adsTotalsDtoSchema = z58.object({
|
|
16682
|
+
impressions: z58.number().int(),
|
|
16683
|
+
clicks: z58.number().int(),
|
|
16684
|
+
spendMicros: z58.number().int(),
|
|
16685
|
+
conversions: z58.number().int(),
|
|
16686
|
+
ctr: z58.number().nullable(),
|
|
16687
|
+
cpcMicros: z58.number().int().nullable()
|
|
16688
|
+
});
|
|
16689
|
+
var adsSummaryDtoSchema = z58.object({
|
|
16690
|
+
connected: z58.boolean(),
|
|
16691
|
+
displayName: z58.string().nullable().optional(),
|
|
16692
|
+
currencyCode: z58.string().nullable().optional(),
|
|
16693
|
+
lastSyncedAt: z58.string().nullable().optional(),
|
|
16694
|
+
campaignCount: z58.number().int(),
|
|
16695
|
+
adGroupCount: z58.number().int(),
|
|
16696
|
+
adCount: z58.number().int(),
|
|
16582
16697
|
/** Date range the totals cover (oldest/newest rollup date), null when empty. */
|
|
16583
16698
|
window: adsRollupWindowDtoSchema,
|
|
16584
16699
|
/** Campaign-level rollup totals over the window (levels are not summed across). */
|
|
16585
16700
|
totals: adsTotalsDtoSchema
|
|
16586
16701
|
});
|
|
16587
|
-
var adsDeliverySnapshotStatusSchema =
|
|
16702
|
+
var adsDeliverySnapshotStatusSchema = z58.enum(["unavailable", "partial", "complete"]);
|
|
16588
16703
|
var AdsDeliverySnapshotStatuses = adsDeliverySnapshotStatusSchema.enum;
|
|
16589
|
-
var adsDeliverySnapshotIssueSchema =
|
|
16704
|
+
var adsDeliverySnapshotIssueSchema = z58.enum([
|
|
16590
16705
|
"no_ads_connection",
|
|
16591
16706
|
"connection_not_synced",
|
|
16592
16707
|
"no_ads_sync",
|
|
@@ -16597,12 +16712,12 @@ var adsDeliverySnapshotIssueSchema = z57.enum([
|
|
|
16597
16712
|
"source_sync_not_completed"
|
|
16598
16713
|
]);
|
|
16599
16714
|
var AdsDeliverySnapshotIssues = adsDeliverySnapshotIssueSchema.enum;
|
|
16600
|
-
var adsHistoricalCampaignRollupStatusSchema =
|
|
16715
|
+
var adsHistoricalCampaignRollupStatusSchema = z58.enum(["unavailable", "reported"]);
|
|
16601
16716
|
var AdsHistoricalCampaignRollupStatuses = adsHistoricalCampaignRollupStatusSchema.enum;
|
|
16602
16717
|
var AdsDeliveryConfigurationBases = {
|
|
16603
16718
|
storedSnapshot: "stored_ads_snapshot"
|
|
16604
16719
|
};
|
|
16605
|
-
var adsActivityAssessmentStateSchema =
|
|
16720
|
+
var adsActivityAssessmentStateSchema = z58.enum([
|
|
16606
16721
|
"unavailable",
|
|
16607
16722
|
"partial_snapshot",
|
|
16608
16723
|
"metrics_unavailable",
|
|
@@ -16610,76 +16725,76 @@ var adsActivityAssessmentStateSchema = z57.enum([
|
|
|
16610
16725
|
"no_observed_activity"
|
|
16611
16726
|
]);
|
|
16612
16727
|
var AdsActivityAssessmentStates = adsActivityAssessmentStateSchema.enum;
|
|
16613
|
-
var adsDeliveryDiagnosticsAdSchema =
|
|
16614
|
-
id:
|
|
16615
|
-
name:
|
|
16616
|
-
status:
|
|
16617
|
-
reviewStatus:
|
|
16618
|
-
});
|
|
16619
|
-
var adsDeliveryDiagnosticsAdGroupSchema =
|
|
16620
|
-
id:
|
|
16621
|
-
name:
|
|
16622
|
-
status:
|
|
16623
|
-
billingEventType:
|
|
16624
|
-
maxBidMicros:
|
|
16625
|
-
contextHints:
|
|
16626
|
-
ads:
|
|
16627
|
-
});
|
|
16628
|
-
var adsDeliveryDiagnosticsCampaignSchema =
|
|
16629
|
-
id:
|
|
16630
|
-
name:
|
|
16631
|
-
status:
|
|
16632
|
-
biddingType:
|
|
16633
|
-
dailySpendLimitMicros:
|
|
16634
|
-
lifetimeSpendLimitMicros:
|
|
16635
|
-
conversionEventSettingIds:
|
|
16636
|
-
adGroups:
|
|
16637
|
-
});
|
|
16638
|
-
var adsDeliveryDiagnosticsDtoSchema =
|
|
16639
|
-
snapshot:
|
|
16728
|
+
var adsDeliveryDiagnosticsAdSchema = z58.object({
|
|
16729
|
+
id: z58.string(),
|
|
16730
|
+
name: z58.string(),
|
|
16731
|
+
status: z58.string(),
|
|
16732
|
+
reviewStatus: z58.string().nullable()
|
|
16733
|
+
});
|
|
16734
|
+
var adsDeliveryDiagnosticsAdGroupSchema = z58.object({
|
|
16735
|
+
id: z58.string(),
|
|
16736
|
+
name: z58.string(),
|
|
16737
|
+
status: z58.string(),
|
|
16738
|
+
billingEventType: z58.union([adsAdGroupBillingEventTypeSchema, z58.null()]),
|
|
16739
|
+
maxBidMicros: z58.number().int().nullable(),
|
|
16740
|
+
contextHints: z58.array(z58.string()),
|
|
16741
|
+
ads: z58.array(adsDeliveryDiagnosticsAdSchema)
|
|
16742
|
+
});
|
|
16743
|
+
var adsDeliveryDiagnosticsCampaignSchema = z58.object({
|
|
16744
|
+
id: z58.string(),
|
|
16745
|
+
name: z58.string(),
|
|
16746
|
+
status: z58.string(),
|
|
16747
|
+
biddingType: z58.union([adsCampaignBiddingTypeSchema, z58.null()]),
|
|
16748
|
+
dailySpendLimitMicros: z58.number().int().nullable(),
|
|
16749
|
+
lifetimeSpendLimitMicros: z58.number().int().nullable(),
|
|
16750
|
+
conversionEventSettingIds: z58.array(z58.string()),
|
|
16751
|
+
adGroups: z58.array(adsDeliveryDiagnosticsAdGroupSchema)
|
|
16752
|
+
});
|
|
16753
|
+
var adsDeliveryDiagnosticsDtoSchema = z58.object({
|
|
16754
|
+
snapshot: z58.object({
|
|
16640
16755
|
status: adsDeliverySnapshotStatusSchema,
|
|
16641
16756
|
// A union keeps the OpenAPI form explicit enough for the generated SDK to
|
|
16642
16757
|
// retain the complete-snapshot `null` value (rather than narrowing it to
|
|
16643
16758
|
// the issue enum alone).
|
|
16644
|
-
issue:
|
|
16645
|
-
lastSyncedAt:
|
|
16646
|
-
campaignCount:
|
|
16647
|
-
adGroupCount:
|
|
16648
|
-
adCount:
|
|
16649
|
-
sourceSync:
|
|
16650
|
-
runId:
|
|
16759
|
+
issue: z58.union([adsDeliverySnapshotIssueSchema, z58.null()]),
|
|
16760
|
+
lastSyncedAt: z58.string().nullable(),
|
|
16761
|
+
campaignCount: z58.number().int().nonnegative(),
|
|
16762
|
+
adGroupCount: z58.number().int().nonnegative(),
|
|
16763
|
+
adCount: z58.number().int().nonnegative(),
|
|
16764
|
+
sourceSync: z58.object({
|
|
16765
|
+
runId: z58.string(),
|
|
16651
16766
|
status: runStatusSchema
|
|
16652
16767
|
}).nullable()
|
|
16653
16768
|
}),
|
|
16654
|
-
historicalCampaignRollups:
|
|
16769
|
+
historicalCampaignRollups: z58.object({
|
|
16655
16770
|
status: adsHistoricalCampaignRollupStatusSchema,
|
|
16656
16771
|
window: adsRollupWindowDtoSchema,
|
|
16657
16772
|
totals: adsTotalsDtoSchema.nullable()
|
|
16658
16773
|
}),
|
|
16659
|
-
storedConfiguration:
|
|
16660
|
-
basis:
|
|
16661
|
-
connection:
|
|
16662
|
-
status:
|
|
16663
|
-
reviewStatus:
|
|
16664
|
-
integrityReviewStatus:
|
|
16665
|
-
integrityDecision:
|
|
16666
|
-
conversionTrackingConfigured:
|
|
16774
|
+
storedConfiguration: z58.object({
|
|
16775
|
+
basis: z58.literal(AdsDeliveryConfigurationBases.storedSnapshot),
|
|
16776
|
+
connection: z58.object({
|
|
16777
|
+
status: z58.string().nullable(),
|
|
16778
|
+
reviewStatus: z58.string().nullable(),
|
|
16779
|
+
integrityReviewStatus: z58.string().nullable(),
|
|
16780
|
+
integrityDecision: z58.string().nullable(),
|
|
16781
|
+
conversionTrackingConfigured: z58.boolean()
|
|
16667
16782
|
}).nullable(),
|
|
16668
|
-
campaigns:
|
|
16783
|
+
campaigns: z58.array(adsDeliveryDiagnosticsCampaignSchema)
|
|
16669
16784
|
}),
|
|
16670
|
-
assessment:
|
|
16671
|
-
});
|
|
16672
|
-
var adsOperationKeySchema =
|
|
16673
|
-
var adsEntityIdSchema =
|
|
16674
|
-
var adsNameSchema =
|
|
16675
|
-
var adsTimestampSchema =
|
|
16676
|
-
var adsMicrosSchema =
|
|
16677
|
-
var adsSha256Schema =
|
|
16678
|
-
var adsConversionEventSettingIdsSchema =
|
|
16679
|
-
var adsHttpsUrlSchema =
|
|
16785
|
+
assessment: z58.object({ state: adsActivityAssessmentStateSchema })
|
|
16786
|
+
});
|
|
16787
|
+
var adsOperationKeySchema = z58.string().min(8).max(128).regex(/^[\w.:-]+$/, "operationKey may contain letters, numbers, dot, underscore, colon, and hyphen");
|
|
16788
|
+
var adsEntityIdSchema = z58.string().min(1).max(200);
|
|
16789
|
+
var adsNameSchema = z58.string().min(3).max(1e3).refine((value) => value.trim().length > 0);
|
|
16790
|
+
var adsTimestampSchema = z58.number().int().min(946684800).max(4102444800);
|
|
16791
|
+
var adsMicrosSchema = z58.number().int().positive().max(Number.MAX_SAFE_INTEGER);
|
|
16792
|
+
var adsSha256Schema = z58.string().regex(/^[a-f0-9]{64}$/);
|
|
16793
|
+
var adsConversionEventSettingIdsSchema = z58.array(adsEntityIdSchema).max(100).refine((ids) => new Set(ids).size === ids.length, "conversionEventSettingIds must be unique");
|
|
16794
|
+
var adsHttpsUrlSchema = z58.string().url().refine((value) => new URL(value).protocol === "https:", {
|
|
16680
16795
|
message: "URL must use https"
|
|
16681
16796
|
});
|
|
16682
|
-
var adsOperationKindSchema =
|
|
16797
|
+
var adsOperationKindSchema = z58.enum([
|
|
16683
16798
|
"image_upload",
|
|
16684
16799
|
"campaign_create",
|
|
16685
16800
|
"campaign_update",
|
|
@@ -16696,25 +16811,25 @@ var adsOperationKindSchema = z57.enum([
|
|
|
16696
16811
|
"ad_archive"
|
|
16697
16812
|
]);
|
|
16698
16813
|
var AdsOperationKinds = adsOperationKindSchema.enum;
|
|
16699
|
-
var adsOperationStateSchema =
|
|
16814
|
+
var adsOperationStateSchema = z58.enum(["pending", "reconciling", "succeeded", "failed", "unknown"]);
|
|
16700
16815
|
var AdsOperationStates = adsOperationStateSchema.enum;
|
|
16701
|
-
var adsReconcileStrategySchema =
|
|
16816
|
+
var adsReconcileStrategySchema = z58.enum(["known_entity", "create_fingerprint", "manual_only"]);
|
|
16702
16817
|
var AdsReconcileStrategies = adsReconcileStrategySchema.enum;
|
|
16703
|
-
var adsUnresolvedOperationStateSchema =
|
|
16818
|
+
var adsUnresolvedOperationStateSchema = z58.enum([
|
|
16704
16819
|
AdsOperationStates.pending,
|
|
16705
16820
|
AdsOperationStates.unknown,
|
|
16706
16821
|
AdsOperationStates.reconciling
|
|
16707
16822
|
]);
|
|
16708
16823
|
var AdsUnresolvedOperationStates = adsUnresolvedOperationStateSchema.enum;
|
|
16709
|
-
var adsEntityStatusSchema =
|
|
16824
|
+
var adsEntityStatusSchema = z58.enum(["active", "paused", "archived"]);
|
|
16710
16825
|
var AdsEntityStatuses = adsEntityStatusSchema.enum;
|
|
16711
|
-
var adsEntityTypeSchema =
|
|
16826
|
+
var adsEntityTypeSchema = z58.enum(["file", "campaign", "ad_group", "ad"]);
|
|
16712
16827
|
var AdsEntityTypes = adsEntityTypeSchema.enum;
|
|
16713
|
-
var adsActivationEntityTypeSchema =
|
|
16828
|
+
var adsActivationEntityTypeSchema = z58.enum(["campaign", "ad_group", "ad"]);
|
|
16714
16829
|
var AdsActivationEntityTypes = adsActivationEntityTypeSchema.enum;
|
|
16715
|
-
var adsActivationEntityRefSchema =
|
|
16830
|
+
var adsActivationEntityRefSchema = z58.object({
|
|
16716
16831
|
id: adsEntityIdSchema,
|
|
16717
|
-
expectedUpdatedAt:
|
|
16832
|
+
expectedUpdatedAt: z58.number().int().nonnegative()
|
|
16718
16833
|
}).strict();
|
|
16719
16834
|
var adsActivationAdSchema = adsActivationEntityRefSchema;
|
|
16720
16835
|
var ADS_ACTIVATION_ABSOLUTE_MAX_ENTITIES = 1e3;
|
|
@@ -16726,10 +16841,10 @@ function countAdsActivationManifestEntities(manifest) {
|
|
|
16726
16841
|
);
|
|
16727
16842
|
}
|
|
16728
16843
|
var adsActivationAdGroupSchema = adsActivationEntityRefSchema.extend({
|
|
16729
|
-
ads:
|
|
16844
|
+
ads: z58.array(adsActivationAdSchema).min(1).max(ADS_ACTIVATION_ABSOLUTE_MAX_ENTITIES - 1)
|
|
16730
16845
|
}).strict();
|
|
16731
16846
|
var adsActivationCampaignSchema = adsActivationEntityRefSchema.extend({
|
|
16732
|
-
adGroups:
|
|
16847
|
+
adGroups: z58.array(adsActivationAdGroupSchema).min(1).max(ADS_ACTIVATION_ABSOLUTE_MAX_ENTITIES - 1)
|
|
16733
16848
|
}).strict();
|
|
16734
16849
|
function compareAdsActivationEntityIds(left, right) {
|
|
16735
16850
|
if (left < right) return -1;
|
|
@@ -16748,7 +16863,7 @@ function addCanonicalEntityOrderIssue(items, path, ctx) {
|
|
|
16748
16863
|
}
|
|
16749
16864
|
}
|
|
16750
16865
|
}
|
|
16751
|
-
var adsActivationManifestSchema =
|
|
16866
|
+
var adsActivationManifestSchema = z58.object({
|
|
16752
16867
|
campaign: adsActivationCampaignSchema
|
|
16753
16868
|
}).strict().superRefine((manifest, ctx) => {
|
|
16754
16869
|
const entityCount = countAdsActivationManifestEntities(manifest);
|
|
@@ -16791,7 +16906,7 @@ function canonicalizeAdsActivationManifest(manifest) {
|
|
|
16791
16906
|
};
|
|
16792
16907
|
}
|
|
16793
16908
|
var adsActivationManifestHashSchema = adsSha256Schema;
|
|
16794
|
-
var adsActivationGrantStateSchema =
|
|
16909
|
+
var adsActivationGrantStateSchema = z58.enum([
|
|
16795
16910
|
"approved",
|
|
16796
16911
|
"executing",
|
|
16797
16912
|
"consumed",
|
|
@@ -16800,7 +16915,7 @@ var adsActivationGrantStateSchema = z57.enum([
|
|
|
16800
16915
|
"unknown"
|
|
16801
16916
|
]);
|
|
16802
16917
|
var AdsActivationGrantStates = adsActivationGrantStateSchema.enum;
|
|
16803
|
-
var adsOperationStepStateSchema =
|
|
16918
|
+
var adsOperationStepStateSchema = z58.enum([
|
|
16804
16919
|
"pending",
|
|
16805
16920
|
"executing",
|
|
16806
16921
|
"active",
|
|
@@ -16811,35 +16926,35 @@ var adsOperationStepStateSchema = z57.enum([
|
|
|
16811
16926
|
"unknown"
|
|
16812
16927
|
]);
|
|
16813
16928
|
var AdsOperationStepStates = adsOperationStepStateSchema.enum;
|
|
16814
|
-
var adsReconcileFieldsSchema =
|
|
16929
|
+
var adsReconcileFieldsSchema = z58.object({
|
|
16815
16930
|
name: adsNameSchema.optional(),
|
|
16816
|
-
description:
|
|
16931
|
+
description: z58.string().max(4e3).nullable().optional(),
|
|
16817
16932
|
status: adsEntityStatusSchema.optional(),
|
|
16818
16933
|
startTime: adsTimestampSchema.nullable().optional(),
|
|
16819
16934
|
endTime: adsTimestampSchema.nullable().optional(),
|
|
16820
16935
|
lifetimeSpendLimitMicros: adsMicrosSchema.min(1e6).optional(),
|
|
16821
|
-
locationIds:
|
|
16936
|
+
locationIds: z58.array(adsEntityIdSchema).max(100).optional(),
|
|
16822
16937
|
biddingType: adsCampaignBiddingTypeSchema.optional(),
|
|
16823
16938
|
conversionEventSettingIds: adsConversionEventSettingIdsSchema.optional(),
|
|
16824
16939
|
campaignId: adsEntityIdSchema.optional(),
|
|
16825
|
-
contextHints:
|
|
16940
|
+
contextHints: z58.array(z58.string().min(1).max(1e3)).max(100).optional(),
|
|
16826
16941
|
maxBidMicros: adsMicrosSchema.max(1e8).optional(),
|
|
16827
16942
|
billingEventType: adsAdGroupBillingEventTypeSchema.optional(),
|
|
16828
16943
|
adGroupId: adsEntityIdSchema.optional(),
|
|
16829
16944
|
creativeFingerprint: adsSha256Schema.optional()
|
|
16830
16945
|
}).strict();
|
|
16831
|
-
var adsImageUploadRequestSchema =
|
|
16946
|
+
var adsImageUploadRequestSchema = z58.object({
|
|
16832
16947
|
operationKey: adsOperationKeySchema,
|
|
16833
16948
|
imageUrl: adsHttpsUrlSchema
|
|
16834
16949
|
});
|
|
16835
|
-
var adsCampaignCreateRequestSchema =
|
|
16950
|
+
var adsCampaignCreateRequestSchema = z58.object({
|
|
16836
16951
|
operationKey: adsOperationKeySchema,
|
|
16837
16952
|
name: adsNameSchema,
|
|
16838
|
-
description:
|
|
16953
|
+
description: z58.string().max(4e3).optional(),
|
|
16839
16954
|
startTime: adsTimestampSchema.optional(),
|
|
16840
16955
|
endTime: adsTimestampSchema.optional(),
|
|
16841
16956
|
lifetimeSpendLimitMicros: adsMicrosSchema.min(1e6),
|
|
16842
|
-
locationIds:
|
|
16957
|
+
locationIds: z58.array(adsEntityIdSchema).min(1).max(100),
|
|
16843
16958
|
// biddingType is BILLING (what the account pays for) and is immutable once
|
|
16844
16959
|
// the provider creates the campaign. conversionEventSettingIds is
|
|
16845
16960
|
// OPTIMIZATION (what delivery is steered toward). The two are independent,
|
|
@@ -16852,22 +16967,22 @@ var adsCampaignCreateRequestSchema = z57.object({
|
|
|
16852
16967
|
ctx.addIssue({ code: "custom", path: ["endTime"], message: "endTime must be after startTime" });
|
|
16853
16968
|
}
|
|
16854
16969
|
});
|
|
16855
|
-
var adsAdGroupCreateRequestSchema =
|
|
16970
|
+
var adsAdGroupCreateRequestSchema = z58.object({
|
|
16856
16971
|
operationKey: adsOperationKeySchema,
|
|
16857
16972
|
campaignId: adsEntityIdSchema,
|
|
16858
16973
|
name: adsNameSchema,
|
|
16859
|
-
description:
|
|
16860
|
-
contextHints:
|
|
16974
|
+
description: z58.string().max(4e3).optional(),
|
|
16975
|
+
contextHints: z58.array(z58.string().min(1).max(1e3)).min(1).max(100),
|
|
16861
16976
|
maxBidMicros: adsMicrosSchema.max(1e8),
|
|
16862
16977
|
billingEventType: adsAdGroupBillingEventTypeSchema.optional()
|
|
16863
16978
|
});
|
|
16864
|
-
var adsChatCardCreativeRequestSchema =
|
|
16865
|
-
title:
|
|
16866
|
-
body:
|
|
16979
|
+
var adsChatCardCreativeRequestSchema = z58.object({
|
|
16980
|
+
title: z58.string().min(3).max(50),
|
|
16981
|
+
body: z58.string().min(1).max(100),
|
|
16867
16982
|
targetUrl: adsHttpsUrlSchema,
|
|
16868
16983
|
fileId: adsEntityIdSchema
|
|
16869
16984
|
});
|
|
16870
|
-
var adsAdCreateRequestSchema =
|
|
16985
|
+
var adsAdCreateRequestSchema = z58.object({
|
|
16871
16986
|
operationKey: adsOperationKeySchema,
|
|
16872
16987
|
adGroupId: adsEntityIdSchema,
|
|
16873
16988
|
name: adsNameSchema,
|
|
@@ -16876,62 +16991,62 @@ var adsAdCreateRequestSchema = z57.object({
|
|
|
16876
16991
|
function hasMutationField(value) {
|
|
16877
16992
|
return Object.keys(value).some((key) => key !== "operationKey" && key !== "expectedUpdatedAt");
|
|
16878
16993
|
}
|
|
16879
|
-
var adsCampaignUpdateRequestSchema =
|
|
16994
|
+
var adsCampaignUpdateRequestSchema = z58.object({
|
|
16880
16995
|
operationKey: adsOperationKeySchema,
|
|
16881
|
-
expectedUpdatedAt:
|
|
16996
|
+
expectedUpdatedAt: z58.number().int().nonnegative(),
|
|
16882
16997
|
name: adsNameSchema.optional(),
|
|
16883
|
-
description:
|
|
16998
|
+
description: z58.string().max(4e3).nullable().optional(),
|
|
16884
16999
|
startTime: adsTimestampSchema.nullable().optional(),
|
|
16885
17000
|
endTime: adsTimestampSchema.nullable().optional(),
|
|
16886
17001
|
lifetimeSpendLimitMicros: adsMicrosSchema.min(1e6).optional(),
|
|
16887
|
-
locationIds:
|
|
17002
|
+
locationIds: z58.array(adsEntityIdSchema).min(1).max(100).optional()
|
|
16888
17003
|
}).refine(hasMutationField, { message: "At least one campaign field must be updated" });
|
|
16889
|
-
var adsAdGroupUpdateRequestSchema =
|
|
17004
|
+
var adsAdGroupUpdateRequestSchema = z58.object({
|
|
16890
17005
|
operationKey: adsOperationKeySchema,
|
|
16891
|
-
expectedUpdatedAt:
|
|
17006
|
+
expectedUpdatedAt: z58.number().int().nonnegative(),
|
|
16892
17007
|
name: adsNameSchema.optional(),
|
|
16893
|
-
description:
|
|
16894
|
-
contextHints:
|
|
17008
|
+
description: z58.string().max(4e3).nullable().optional(),
|
|
17009
|
+
contextHints: z58.array(z58.string().min(1).max(1e3)).min(1).max(100).optional(),
|
|
16895
17010
|
maxBidMicros: adsMicrosSchema.max(1e8).optional()
|
|
16896
17011
|
}).refine(hasMutationField, { message: "At least one ad group field must be updated" });
|
|
16897
|
-
var adsAdUpdateRequestSchema =
|
|
17012
|
+
var adsAdUpdateRequestSchema = z58.object({
|
|
16898
17013
|
operationKey: adsOperationKeySchema,
|
|
16899
|
-
expectedUpdatedAt:
|
|
17014
|
+
expectedUpdatedAt: z58.number().int().nonnegative(),
|
|
16900
17015
|
name: adsNameSchema.optional(),
|
|
16901
17016
|
creative: adsChatCardCreativeRequestSchema.optional()
|
|
16902
17017
|
}).refine(hasMutationField, { message: "At least one ad field must be updated" });
|
|
16903
|
-
var adsPauseRequestSchema =
|
|
17018
|
+
var adsPauseRequestSchema = z58.object({
|
|
16904
17019
|
operationKey: adsOperationKeySchema
|
|
16905
17020
|
});
|
|
16906
|
-
var adsArchiveRequestSchema =
|
|
17021
|
+
var adsArchiveRequestSchema = z58.object({
|
|
16907
17022
|
operationKey: adsOperationKeySchema,
|
|
16908
|
-
expectedUpdatedAt:
|
|
17023
|
+
expectedUpdatedAt: z58.number().int().nonnegative()
|
|
16909
17024
|
});
|
|
16910
|
-
var adsOperationDtoSchema =
|
|
16911
|
-
id:
|
|
16912
|
-
adAccountId:
|
|
16913
|
-
operationKey:
|
|
17025
|
+
var adsOperationDtoSchema = z58.object({
|
|
17026
|
+
id: z58.string(),
|
|
17027
|
+
adAccountId: z58.string().nullable(),
|
|
17028
|
+
operationKey: z58.string(),
|
|
16914
17029
|
kind: adsOperationKindSchema,
|
|
16915
17030
|
state: adsOperationStateSchema,
|
|
16916
|
-
entityType:
|
|
16917
|
-
entityId:
|
|
16918
|
-
upstreamUpdatedAt:
|
|
16919
|
-
errorCode:
|
|
16920
|
-
errorMessage:
|
|
16921
|
-
reconcileStrategy:
|
|
17031
|
+
entityType: z58.union([adsEntityTypeSchema, z58.null()]),
|
|
17032
|
+
entityId: z58.string().nullable(),
|
|
17033
|
+
upstreamUpdatedAt: z58.number().int().nullable(),
|
|
17034
|
+
errorCode: z58.string().nullable(),
|
|
17035
|
+
errorMessage: z58.string().nullable(),
|
|
17036
|
+
reconcileStrategy: z58.union([adsReconcileStrategySchema, z58.null()]),
|
|
16922
17037
|
reconcileParentId: adsEntityIdSchema.nullable(),
|
|
16923
17038
|
reconcileFingerprint: adsSha256Schema.nullable(),
|
|
16924
17039
|
reconcileFields: adsReconcileFieldsSchema.nullable(),
|
|
16925
|
-
reconcileAttempts:
|
|
16926
|
-
lastReconciledAt:
|
|
16927
|
-
createdAt:
|
|
16928
|
-
updatedAt:
|
|
17040
|
+
reconcileAttempts: z58.number().int().nonnegative(),
|
|
17041
|
+
lastReconciledAt: z58.string().nullable(),
|
|
17042
|
+
createdAt: z58.string(),
|
|
17043
|
+
updatedAt: z58.string()
|
|
16929
17044
|
});
|
|
16930
|
-
var adsOperationResponseSchema =
|
|
17045
|
+
var adsOperationResponseSchema = z58.object({
|
|
16931
17046
|
operation: adsOperationDtoSchema,
|
|
16932
|
-
replayed:
|
|
17047
|
+
replayed: z58.boolean()
|
|
16933
17048
|
});
|
|
16934
|
-
var adsActivationIsoTimestampSchema =
|
|
17049
|
+
var adsActivationIsoTimestampSchema = z58.iso.datetime({ offset: true });
|
|
16935
17050
|
var adsActivationGrantBaseShape = {
|
|
16936
17051
|
id: adsEntityIdSchema,
|
|
16937
17052
|
projectId: adsEntityIdSchema,
|
|
@@ -16946,61 +17061,61 @@ var adsActivationGrantBaseShape = {
|
|
|
16946
17061
|
updatedAt: adsActivationIsoTimestampSchema,
|
|
16947
17062
|
revocationRequestedAt: adsActivationIsoTimestampSchema.nullable()
|
|
16948
17063
|
};
|
|
16949
|
-
var adsActivationGrantApprovedDtoSchema =
|
|
17064
|
+
var adsActivationGrantApprovedDtoSchema = z58.object({
|
|
16950
17065
|
...adsActivationGrantBaseShape,
|
|
16951
|
-
state:
|
|
16952
|
-
operationId:
|
|
16953
|
-
executionStartedAt:
|
|
16954
|
-
consumedAt:
|
|
16955
|
-
revokedAt:
|
|
16956
|
-
expiredAt:
|
|
16957
|
-
}).strict();
|
|
16958
|
-
var adsActivationGrantExecutingDtoSchema =
|
|
17066
|
+
state: z58.literal(AdsActivationGrantStates.approved),
|
|
17067
|
+
operationId: z58.null(),
|
|
17068
|
+
executionStartedAt: z58.null(),
|
|
17069
|
+
consumedAt: z58.null(),
|
|
17070
|
+
revokedAt: z58.null(),
|
|
17071
|
+
expiredAt: z58.null()
|
|
17072
|
+
}).strict();
|
|
17073
|
+
var adsActivationGrantExecutingDtoSchema = z58.object({
|
|
16959
17074
|
...adsActivationGrantBaseShape,
|
|
16960
|
-
state:
|
|
17075
|
+
state: z58.literal(AdsActivationGrantStates.executing),
|
|
16961
17076
|
operationId: adsEntityIdSchema,
|
|
16962
17077
|
executionStartedAt: adsActivationIsoTimestampSchema,
|
|
16963
|
-
consumedAt:
|
|
16964
|
-
revokedAt:
|
|
16965
|
-
expiredAt:
|
|
17078
|
+
consumedAt: z58.null(),
|
|
17079
|
+
revokedAt: z58.null(),
|
|
17080
|
+
expiredAt: z58.null()
|
|
16966
17081
|
}).strict();
|
|
16967
|
-
var adsActivationGrantConsumedDtoSchema =
|
|
17082
|
+
var adsActivationGrantConsumedDtoSchema = z58.object({
|
|
16968
17083
|
...adsActivationGrantBaseShape,
|
|
16969
|
-
state:
|
|
17084
|
+
state: z58.literal(AdsActivationGrantStates.consumed),
|
|
16970
17085
|
operationId: adsEntityIdSchema,
|
|
16971
17086
|
executionStartedAt: adsActivationIsoTimestampSchema,
|
|
16972
17087
|
consumedAt: adsActivationIsoTimestampSchema,
|
|
16973
|
-
revokedAt:
|
|
16974
|
-
expiredAt:
|
|
17088
|
+
revokedAt: z58.null(),
|
|
17089
|
+
expiredAt: z58.null()
|
|
16975
17090
|
}).strict();
|
|
16976
|
-
var adsActivationGrantRevokedDtoSchema =
|
|
17091
|
+
var adsActivationGrantRevokedDtoSchema = z58.object({
|
|
16977
17092
|
...adsActivationGrantBaseShape,
|
|
16978
|
-
state:
|
|
16979
|
-
operationId:
|
|
16980
|
-
executionStartedAt:
|
|
16981
|
-
consumedAt:
|
|
17093
|
+
state: z58.literal(AdsActivationGrantStates.revoked),
|
|
17094
|
+
operationId: z58.null(),
|
|
17095
|
+
executionStartedAt: z58.null(),
|
|
17096
|
+
consumedAt: z58.null(),
|
|
16982
17097
|
revokedAt: adsActivationIsoTimestampSchema,
|
|
16983
|
-
expiredAt:
|
|
17098
|
+
expiredAt: z58.null()
|
|
16984
17099
|
}).strict();
|
|
16985
|
-
var adsActivationGrantExpiredDtoSchema =
|
|
17100
|
+
var adsActivationGrantExpiredDtoSchema = z58.object({
|
|
16986
17101
|
...adsActivationGrantBaseShape,
|
|
16987
|
-
state:
|
|
16988
|
-
operationId:
|
|
16989
|
-
executionStartedAt:
|
|
16990
|
-
consumedAt:
|
|
16991
|
-
revokedAt:
|
|
17102
|
+
state: z58.literal(AdsActivationGrantStates.expired),
|
|
17103
|
+
operationId: z58.null(),
|
|
17104
|
+
executionStartedAt: z58.null(),
|
|
17105
|
+
consumedAt: z58.null(),
|
|
17106
|
+
revokedAt: z58.null(),
|
|
16992
17107
|
expiredAt: adsActivationIsoTimestampSchema
|
|
16993
17108
|
}).strict();
|
|
16994
|
-
var adsActivationGrantUnknownDtoSchema =
|
|
17109
|
+
var adsActivationGrantUnknownDtoSchema = z58.object({
|
|
16995
17110
|
...adsActivationGrantBaseShape,
|
|
16996
|
-
state:
|
|
17111
|
+
state: z58.literal(AdsActivationGrantStates.unknown),
|
|
16997
17112
|
operationId: adsEntityIdSchema,
|
|
16998
17113
|
executionStartedAt: adsActivationIsoTimestampSchema,
|
|
16999
|
-
consumedAt:
|
|
17000
|
-
revokedAt:
|
|
17001
|
-
expiredAt:
|
|
17114
|
+
consumedAt: z58.null(),
|
|
17115
|
+
revokedAt: z58.null(),
|
|
17116
|
+
expiredAt: z58.null()
|
|
17002
17117
|
}).strict();
|
|
17003
|
-
var adsActivationGrantDtoSchema =
|
|
17118
|
+
var adsActivationGrantDtoSchema = z58.discriminatedUnion("state", [
|
|
17004
17119
|
adsActivationGrantApprovedDtoSchema,
|
|
17005
17120
|
adsActivationGrantExecutingDtoSchema,
|
|
17006
17121
|
adsActivationGrantConsumedDtoSchema,
|
|
@@ -17026,92 +17141,92 @@ var adsActivationGrantDtoSchema = z57.discriminatedUnion("state", [
|
|
|
17026
17141
|
var adsOperationStepBaseShape = {
|
|
17027
17142
|
id: adsEntityIdSchema,
|
|
17028
17143
|
operationId: adsEntityIdSchema,
|
|
17029
|
-
ordinal:
|
|
17144
|
+
ordinal: z58.number().int().nonnegative(),
|
|
17030
17145
|
entityType: adsActivationEntityTypeSchema,
|
|
17031
17146
|
entityId: adsEntityIdSchema,
|
|
17032
|
-
expectedUpdatedAt:
|
|
17147
|
+
expectedUpdatedAt: z58.number().int().nonnegative(),
|
|
17033
17148
|
createdAt: adsActivationIsoTimestampSchema,
|
|
17034
17149
|
updatedAt: adsActivationIsoTimestampSchema
|
|
17035
17150
|
};
|
|
17036
17151
|
var adsOperationStepNoErrorShape = {
|
|
17037
|
-
errorCode:
|
|
17038
|
-
errorMessage:
|
|
17152
|
+
errorCode: z58.null(),
|
|
17153
|
+
errorMessage: z58.null()
|
|
17039
17154
|
};
|
|
17040
17155
|
var adsOperationStepErrorShape = {
|
|
17041
|
-
errorCode:
|
|
17042
|
-
errorMessage:
|
|
17043
|
-
remediation:
|
|
17156
|
+
errorCode: z58.string().min(1).max(100),
|
|
17157
|
+
errorMessage: z58.string().min(1).max(500),
|
|
17158
|
+
remediation: z58.string().min(1).max(500)
|
|
17044
17159
|
};
|
|
17045
|
-
var adsOperationStepPendingDtoSchema =
|
|
17160
|
+
var adsOperationStepPendingDtoSchema = z58.object({
|
|
17046
17161
|
...adsOperationStepBaseShape,
|
|
17047
17162
|
...adsOperationStepNoErrorShape,
|
|
17048
|
-
state:
|
|
17049
|
-
providerUpdatedAt:
|
|
17050
|
-
remediation:
|
|
17051
|
-
startedAt:
|
|
17052
|
-
finishedAt:
|
|
17163
|
+
state: z58.literal(AdsOperationStepStates.pending),
|
|
17164
|
+
providerUpdatedAt: z58.null(),
|
|
17165
|
+
remediation: z58.null(),
|
|
17166
|
+
startedAt: z58.null(),
|
|
17167
|
+
finishedAt: z58.null()
|
|
17053
17168
|
}).strict();
|
|
17054
|
-
var adsOperationStepExecutingDtoSchema =
|
|
17169
|
+
var adsOperationStepExecutingDtoSchema = z58.object({
|
|
17055
17170
|
...adsOperationStepBaseShape,
|
|
17056
17171
|
...adsOperationStepNoErrorShape,
|
|
17057
|
-
state:
|
|
17058
|
-
providerUpdatedAt:
|
|
17059
|
-
remediation:
|
|
17172
|
+
state: z58.literal(AdsOperationStepStates.executing),
|
|
17173
|
+
providerUpdatedAt: z58.null(),
|
|
17174
|
+
remediation: z58.null(),
|
|
17060
17175
|
startedAt: adsActivationIsoTimestampSchema,
|
|
17061
|
-
finishedAt:
|
|
17176
|
+
finishedAt: z58.null()
|
|
17062
17177
|
}).strict();
|
|
17063
|
-
var adsOperationStepActiveDtoSchema =
|
|
17178
|
+
var adsOperationStepActiveDtoSchema = z58.object({
|
|
17064
17179
|
...adsOperationStepBaseShape,
|
|
17065
17180
|
...adsOperationStepNoErrorShape,
|
|
17066
|
-
state:
|
|
17067
|
-
providerUpdatedAt:
|
|
17068
|
-
remediation:
|
|
17181
|
+
state: z58.literal(AdsOperationStepStates.active),
|
|
17182
|
+
providerUpdatedAt: z58.number().int().nonnegative(),
|
|
17183
|
+
remediation: z58.null(),
|
|
17069
17184
|
startedAt: adsActivationIsoTimestampSchema,
|
|
17070
17185
|
finishedAt: adsActivationIsoTimestampSchema
|
|
17071
17186
|
}).strict();
|
|
17072
|
-
var adsOperationStepFailedDtoSchema =
|
|
17187
|
+
var adsOperationStepFailedDtoSchema = z58.object({
|
|
17073
17188
|
...adsOperationStepBaseShape,
|
|
17074
17189
|
...adsOperationStepErrorShape,
|
|
17075
|
-
state:
|
|
17076
|
-
providerUpdatedAt:
|
|
17190
|
+
state: z58.literal(AdsOperationStepStates.failed),
|
|
17191
|
+
providerUpdatedAt: z58.union([z58.number().int().nonnegative(), z58.null()]),
|
|
17077
17192
|
startedAt: adsActivationIsoTimestampSchema,
|
|
17078
17193
|
finishedAt: adsActivationIsoTimestampSchema
|
|
17079
17194
|
}).strict();
|
|
17080
|
-
var adsOperationStepRollbackExecutingDtoSchema =
|
|
17195
|
+
var adsOperationStepRollbackExecutingDtoSchema = z58.object({
|
|
17081
17196
|
...adsOperationStepBaseShape,
|
|
17082
17197
|
...adsOperationStepNoErrorShape,
|
|
17083
|
-
state:
|
|
17084
|
-
providerUpdatedAt:
|
|
17085
|
-
remediation:
|
|
17198
|
+
state: z58.literal(AdsOperationStepStates.rollback_executing),
|
|
17199
|
+
providerUpdatedAt: z58.number().int().nonnegative(),
|
|
17200
|
+
remediation: z58.string().min(1).max(500),
|
|
17086
17201
|
startedAt: adsActivationIsoTimestampSchema,
|
|
17087
|
-
finishedAt:
|
|
17202
|
+
finishedAt: z58.null()
|
|
17088
17203
|
}).strict();
|
|
17089
|
-
var adsOperationStepRolledBackDtoSchema =
|
|
17204
|
+
var adsOperationStepRolledBackDtoSchema = z58.object({
|
|
17090
17205
|
...adsOperationStepBaseShape,
|
|
17091
17206
|
...adsOperationStepNoErrorShape,
|
|
17092
|
-
state:
|
|
17093
|
-
providerUpdatedAt:
|
|
17094
|
-
remediation:
|
|
17207
|
+
state: z58.literal(AdsOperationStepStates.rolled_back),
|
|
17208
|
+
providerUpdatedAt: z58.number().int().nonnegative(),
|
|
17209
|
+
remediation: z58.string().min(1).max(500),
|
|
17095
17210
|
startedAt: adsActivationIsoTimestampSchema,
|
|
17096
17211
|
finishedAt: adsActivationIsoTimestampSchema
|
|
17097
17212
|
}).strict();
|
|
17098
|
-
var adsOperationStepRollbackFailedDtoSchema =
|
|
17213
|
+
var adsOperationStepRollbackFailedDtoSchema = z58.object({
|
|
17099
17214
|
...adsOperationStepBaseShape,
|
|
17100
17215
|
...adsOperationStepErrorShape,
|
|
17101
|
-
state:
|
|
17102
|
-
providerUpdatedAt:
|
|
17216
|
+
state: z58.literal(AdsOperationStepStates.rollback_failed),
|
|
17217
|
+
providerUpdatedAt: z58.number().int().nonnegative(),
|
|
17103
17218
|
startedAt: adsActivationIsoTimestampSchema,
|
|
17104
17219
|
finishedAt: adsActivationIsoTimestampSchema
|
|
17105
17220
|
}).strict();
|
|
17106
|
-
var adsOperationStepUnknownDtoSchema =
|
|
17221
|
+
var adsOperationStepUnknownDtoSchema = z58.object({
|
|
17107
17222
|
...adsOperationStepBaseShape,
|
|
17108
17223
|
...adsOperationStepErrorShape,
|
|
17109
|
-
state:
|
|
17110
|
-
providerUpdatedAt:
|
|
17224
|
+
state: z58.literal(AdsOperationStepStates.unknown),
|
|
17225
|
+
providerUpdatedAt: z58.union([z58.number().int().nonnegative(), z58.null()]),
|
|
17111
17226
|
startedAt: adsActivationIsoTimestampSchema,
|
|
17112
17227
|
finishedAt: adsActivationIsoTimestampSchema
|
|
17113
17228
|
}).strict();
|
|
17114
|
-
var adsOperationStepDtoSchema =
|
|
17229
|
+
var adsOperationStepDtoSchema = z58.discriminatedUnion("state", [
|
|
17115
17230
|
adsOperationStepPendingDtoSchema,
|
|
17116
17231
|
adsOperationStepExecutingDtoSchema,
|
|
17117
17232
|
adsOperationStepActiveDtoSchema,
|
|
@@ -17125,29 +17240,29 @@ var AdsActivationVersionPolicies = {
|
|
|
17125
17240
|
exact: "exact",
|
|
17126
17241
|
refreshSemanticallyUnchanged: "refresh_semantically_unchanged"
|
|
17127
17242
|
};
|
|
17128
|
-
var adsActivationVersionPolicySchema =
|
|
17243
|
+
var adsActivationVersionPolicySchema = z58.enum([
|
|
17129
17244
|
AdsActivationVersionPolicies.exact,
|
|
17130
17245
|
AdsActivationVersionPolicies.refreshSemanticallyUnchanged
|
|
17131
17246
|
]);
|
|
17132
|
-
var adsActivationGrantCreateRequestSchema =
|
|
17247
|
+
var adsActivationGrantCreateRequestSchema = z58.object({
|
|
17133
17248
|
manifest: adsActivationManifestSchema,
|
|
17134
17249
|
executorApiKeyId: adsEntityIdSchema,
|
|
17135
17250
|
expiresAt: adsActivationIsoTimestampSchema,
|
|
17136
17251
|
versionPolicy: adsActivationVersionPolicySchema.default(AdsActivationVersionPolicies.exact)
|
|
17137
17252
|
}).strict();
|
|
17138
|
-
var adsActivationGrantResponseSchema =
|
|
17253
|
+
var adsActivationGrantResponseSchema = z58.object({
|
|
17139
17254
|
grant: adsActivationGrantDtoSchema
|
|
17140
17255
|
}).strict();
|
|
17141
|
-
var adsActivationGrantRevokeRequestSchema =
|
|
17142
|
-
var adsActivateTreeRequestSchema =
|
|
17256
|
+
var adsActivationGrantRevokeRequestSchema = z58.object({}).strict();
|
|
17257
|
+
var adsActivateTreeRequestSchema = z58.object({
|
|
17143
17258
|
operationKey: adsOperationKeySchema,
|
|
17144
17259
|
grantId: adsEntityIdSchema,
|
|
17145
17260
|
manifestHash: adsActivationManifestHashSchema
|
|
17146
17261
|
}).strict();
|
|
17147
|
-
var adsActivateTreeResponseSchema =
|
|
17262
|
+
var adsActivateTreeResponseSchema = z58.object({
|
|
17148
17263
|
grant: adsActivationGrantDtoSchema,
|
|
17149
17264
|
operation: adsOperationDtoSchema,
|
|
17150
|
-
steps:
|
|
17265
|
+
steps: z58.array(adsOperationStepDtoSchema)
|
|
17151
17266
|
}).strict();
|
|
17152
17267
|
var adsUnresolvedOperationStatesDefault = [
|
|
17153
17268
|
AdsOperationStates.pending,
|
|
@@ -17166,102 +17281,102 @@ function parseUnresolvedOperationStates(value) {
|
|
|
17166
17281
|
}
|
|
17167
17282
|
return typeof value === "string" ? value.split(",").filter(Boolean) : value;
|
|
17168
17283
|
}
|
|
17169
|
-
var adsUnresolvedOperationListQuerySchema =
|
|
17170
|
-
state:
|
|
17284
|
+
var adsUnresolvedOperationListQuerySchema = z58.object({
|
|
17285
|
+
state: z58.preprocess(
|
|
17171
17286
|
parseUnresolvedOperationStates,
|
|
17172
|
-
|
|
17287
|
+
z58.array(adsUnresolvedOperationStateSchema).min(1).max(3).refine((states) => new Set(states).size === states.length, "state values must be unique")
|
|
17173
17288
|
),
|
|
17174
|
-
limit:
|
|
17175
|
-
cursor:
|
|
17289
|
+
limit: z58.coerce.number().int().min(1).max(200).default(100),
|
|
17290
|
+
cursor: z58.string().min(1).max(1e3).optional()
|
|
17176
17291
|
});
|
|
17177
|
-
var adsUnresolvedOperationListResponseSchema =
|
|
17178
|
-
operations:
|
|
17179
|
-
count:
|
|
17180
|
-
nextCursor:
|
|
17292
|
+
var adsUnresolvedOperationListResponseSchema = z58.object({
|
|
17293
|
+
operations: z58.array(adsOperationDtoSchema),
|
|
17294
|
+
count: z58.number().int().nonnegative(),
|
|
17295
|
+
nextCursor: z58.string().nullable()
|
|
17181
17296
|
});
|
|
17182
|
-
var adsOperationReconcileRequestSchema =
|
|
17183
|
-
var adsOperationReconcileResponseSchema =
|
|
17297
|
+
var adsOperationReconcileRequestSchema = z58.object({}).strict();
|
|
17298
|
+
var adsOperationReconcileResponseSchema = z58.object({
|
|
17184
17299
|
operation: adsOperationDtoSchema,
|
|
17185
|
-
resolved:
|
|
17300
|
+
resolved: z58.boolean()
|
|
17186
17301
|
});
|
|
17187
|
-
var adsLiveDeliveryQuerySchema =
|
|
17188
|
-
campaignId:
|
|
17189
|
-
lookbackDays:
|
|
17302
|
+
var adsLiveDeliveryQuerySchema = z58.object({
|
|
17303
|
+
campaignId: z58.string().min(1).max(200).optional(),
|
|
17304
|
+
lookbackDays: z58.coerce.number().int().min(1).max(30).default(7)
|
|
17190
17305
|
});
|
|
17191
|
-
var adsLiveEntityTypeSchema =
|
|
17306
|
+
var adsLiveEntityTypeSchema = z58.enum(["campaign", "ad_group", "ad"]);
|
|
17192
17307
|
var AdsLiveEntityTypes = adsLiveEntityTypeSchema.enum;
|
|
17193
|
-
var adsLivePresenceSchema =
|
|
17308
|
+
var adsLivePresenceSchema = z58.enum(["both", "live-only", "stored-only"]);
|
|
17194
17309
|
var AdsLivePresences = adsLivePresenceSchema.enum;
|
|
17195
|
-
var adsLiveDeliveryBasisSchema =
|
|
17310
|
+
var adsLiveDeliveryBasisSchema = z58.literal("live-provider-read");
|
|
17196
17311
|
var AdsLiveDeliveryBases = { liveProviderRead: "live-provider-read" };
|
|
17197
|
-
var adsLiveMetricRowSchema =
|
|
17198
|
-
date:
|
|
17199
|
-
startTime:
|
|
17200
|
-
endTime:
|
|
17201
|
-
impressions:
|
|
17202
|
-
clicks:
|
|
17203
|
-
spend:
|
|
17204
|
-
conversions:
|
|
17205
|
-
ctr:
|
|
17206
|
-
cpc:
|
|
17207
|
-
cpm:
|
|
17208
|
-
});
|
|
17209
|
-
var adsLiveMetricValuesSchema =
|
|
17210
|
-
impressions:
|
|
17211
|
-
clicks:
|
|
17212
|
-
spendMicros:
|
|
17213
|
-
conversions:
|
|
17214
|
-
});
|
|
17215
|
-
var adsLiveMetricDeltaSchema =
|
|
17216
|
-
date:
|
|
17312
|
+
var adsLiveMetricRowSchema = z58.object({
|
|
17313
|
+
date: z58.string().nullable(),
|
|
17314
|
+
startTime: z58.number().nullable(),
|
|
17315
|
+
endTime: z58.number().nullable(),
|
|
17316
|
+
impressions: z58.number().nullable(),
|
|
17317
|
+
clicks: z58.number().nullable(),
|
|
17318
|
+
spend: z58.number().nullable(),
|
|
17319
|
+
conversions: z58.number().nullable(),
|
|
17320
|
+
ctr: z58.number().nullable(),
|
|
17321
|
+
cpc: z58.number().nullable(),
|
|
17322
|
+
cpm: z58.number().nullable()
|
|
17323
|
+
});
|
|
17324
|
+
var adsLiveMetricValuesSchema = z58.object({
|
|
17325
|
+
impressions: z58.number().int(),
|
|
17326
|
+
clicks: z58.number().int(),
|
|
17327
|
+
spendMicros: z58.number().int(),
|
|
17328
|
+
conversions: z58.number().int()
|
|
17329
|
+
});
|
|
17330
|
+
var adsLiveMetricDeltaSchema = z58.object({
|
|
17331
|
+
date: z58.string(),
|
|
17217
17332
|
live: adsLiveMetricValuesSchema.nullable(),
|
|
17218
17333
|
stored: adsLiveMetricValuesSchema.nullable(),
|
|
17219
|
-
drifted:
|
|
17220
|
-
});
|
|
17221
|
-
var adsLiveFieldDeltaSchema =
|
|
17222
|
-
field:
|
|
17223
|
-
live:
|
|
17224
|
-
stored:
|
|
17225
|
-
});
|
|
17226
|
-
var adsLiveEntityStateSchema =
|
|
17227
|
-
name:
|
|
17228
|
-
status:
|
|
17229
|
-
reviewStatus:
|
|
17230
|
-
mode:
|
|
17231
|
-
updatedAt:
|
|
17232
|
-
});
|
|
17233
|
-
var adsStoredEntityStateSchema =
|
|
17234
|
-
name:
|
|
17235
|
-
status:
|
|
17236
|
-
reviewStatus:
|
|
17237
|
-
upstreamUpdatedAt:
|
|
17238
|
-
syncedAt:
|
|
17239
|
-
});
|
|
17240
|
-
var adsLiveEntityComparisonSchema =
|
|
17334
|
+
drifted: z58.boolean()
|
|
17335
|
+
});
|
|
17336
|
+
var adsLiveFieldDeltaSchema = z58.object({
|
|
17337
|
+
field: z58.string(),
|
|
17338
|
+
live: z58.string().nullable(),
|
|
17339
|
+
stored: z58.string().nullable()
|
|
17340
|
+
});
|
|
17341
|
+
var adsLiveEntityStateSchema = z58.object({
|
|
17342
|
+
name: z58.string().nullable(),
|
|
17343
|
+
status: z58.string(),
|
|
17344
|
+
reviewStatus: z58.string().nullable(),
|
|
17345
|
+
mode: z58.string().nullable(),
|
|
17346
|
+
updatedAt: z58.number().nullable()
|
|
17347
|
+
});
|
|
17348
|
+
var adsStoredEntityStateSchema = z58.object({
|
|
17349
|
+
name: z58.string(),
|
|
17350
|
+
status: z58.string(),
|
|
17351
|
+
reviewStatus: z58.string().nullable(),
|
|
17352
|
+
upstreamUpdatedAt: z58.number().nullable(),
|
|
17353
|
+
syncedAt: z58.string()
|
|
17354
|
+
});
|
|
17355
|
+
var adsLiveEntityComparisonSchema = z58.object({
|
|
17241
17356
|
entityType: adsLiveEntityTypeSchema,
|
|
17242
|
-
id:
|
|
17243
|
-
parentId:
|
|
17357
|
+
id: z58.string(),
|
|
17358
|
+
parentId: z58.string().nullable(),
|
|
17244
17359
|
presence: adsLivePresenceSchema,
|
|
17245
17360
|
live: adsLiveEntityStateSchema.nullable(),
|
|
17246
17361
|
stored: adsStoredEntityStateSchema.nullable(),
|
|
17247
|
-
fieldDeltas:
|
|
17362
|
+
fieldDeltas: z58.array(adsLiveFieldDeltaSchema),
|
|
17248
17363
|
/** Provider rows, unaggregated. Null for ads (no per-ad insights surface). */
|
|
17249
|
-
liveMetrics:
|
|
17250
|
-
metricDeltas:
|
|
17251
|
-
drifted:
|
|
17364
|
+
liveMetrics: z58.array(adsLiveMetricRowSchema).nullable(),
|
|
17365
|
+
metricDeltas: z58.array(adsLiveMetricDeltaSchema).nullable(),
|
|
17366
|
+
drifted: z58.boolean()
|
|
17252
17367
|
});
|
|
17253
|
-
var adsLiveReadFailureSchema =
|
|
17254
|
-
surface:
|
|
17255
|
-
entityId:
|
|
17256
|
-
upstreamStatus:
|
|
17368
|
+
var adsLiveReadFailureSchema = z58.object({
|
|
17369
|
+
surface: z58.string(),
|
|
17370
|
+
entityId: z58.string().nullable(),
|
|
17371
|
+
upstreamStatus: z58.number().int().nullable()
|
|
17257
17372
|
});
|
|
17258
|
-
var adsLiveDeliveryDtoSchema =
|
|
17373
|
+
var adsLiveDeliveryDtoSchema = z58.object({
|
|
17259
17374
|
basis: adsLiveDeliveryBasisSchema,
|
|
17260
17375
|
/** Instant the live read was issued; the metrics window is measured back from it. */
|
|
17261
|
-
fetchedAt:
|
|
17262
|
-
adAccountId:
|
|
17263
|
-
storedSnapshotSyncedAt:
|
|
17264
|
-
metricsWindow:
|
|
17376
|
+
fetchedAt: z58.string(),
|
|
17377
|
+
adAccountId: z58.string(),
|
|
17378
|
+
storedSnapshotSyncedAt: z58.string().nullable(),
|
|
17379
|
+
metricsWindow: z58.object({ lookbackDays: z58.number().int().positive() }),
|
|
17265
17380
|
/**
|
|
17266
17381
|
* Two different units live here, and confusing them understates the cost of
|
|
17267
17382
|
* this endpoint by two orders of magnitude.
|
|
@@ -17277,28 +17392,28 @@ var adsLiveDeliveryDtoSchema = z57.object({
|
|
|
17277
17392
|
* no observed HTTP-request count: the pagination happens inside the provider
|
|
17278
17393
|
* client, below the injected reader seam, so the route cannot see it.
|
|
17279
17394
|
*/
|
|
17280
|
-
bounds:
|
|
17281
|
-
maxCampaigns:
|
|
17282
|
-
maxAdGroupsPerCampaign:
|
|
17283
|
-
maxAdsPerAdGroup:
|
|
17395
|
+
bounds: z58.object({
|
|
17396
|
+
maxCampaigns: z58.number().int().positive(),
|
|
17397
|
+
maxAdGroupsPerCampaign: z58.number().int().positive(),
|
|
17398
|
+
maxAdsPerAdGroup: z58.number().int().positive(),
|
|
17284
17399
|
/** Budget in logical reader calls, NOT in upstream HTTP requests. */
|
|
17285
|
-
maxReaderCalls:
|
|
17400
|
+
maxReaderCalls: z58.number().int().positive(),
|
|
17286
17401
|
/** Reader calls this read actually issued. Observed, not a bound. */
|
|
17287
|
-
readerCalls:
|
|
17402
|
+
readerCalls: z58.number().int().nonnegative(),
|
|
17288
17403
|
/** Pages one paginated reader call may fetch before the client gives up. */
|
|
17289
|
-
maxPagesPerReaderCall:
|
|
17404
|
+
maxPagesPerReaderCall: z58.number().int().positive(),
|
|
17290
17405
|
/** Worst-case upstream HTTP requests. A documented bound, not an observation. */
|
|
17291
|
-
maxUpstreamHttpRequests:
|
|
17292
|
-
truncated:
|
|
17406
|
+
maxUpstreamHttpRequests: z58.number().int().positive(),
|
|
17407
|
+
truncated: z58.boolean()
|
|
17293
17408
|
}),
|
|
17294
|
-
entities:
|
|
17295
|
-
drift:
|
|
17296
|
-
entitiesCompared:
|
|
17297
|
-
driftedEntities:
|
|
17298
|
-
statusDrifted:
|
|
17299
|
-
metricsDrifted:
|
|
17409
|
+
entities: z58.array(adsLiveEntityComparisonSchema),
|
|
17410
|
+
drift: z58.object({
|
|
17411
|
+
entitiesCompared: z58.number().int().nonnegative(),
|
|
17412
|
+
driftedEntities: z58.number().int().nonnegative(),
|
|
17413
|
+
statusDrifted: z58.number().int().nonnegative(),
|
|
17414
|
+
metricsDrifted: z58.number().int().nonnegative()
|
|
17300
17415
|
}),
|
|
17301
|
-
errors:
|
|
17416
|
+
errors: z58.array(adsLiveReadFailureSchema)
|
|
17302
17417
|
});
|
|
17303
17418
|
function adsCtr(clicks, impressions) {
|
|
17304
17419
|
return impressions > 0 ? clicks / impressions : null;
|
|
@@ -17326,9 +17441,9 @@ function isLocationRedirectStatus(status) {
|
|
|
17326
17441
|
}
|
|
17327
17442
|
|
|
17328
17443
|
// ../contracts/src/health.ts
|
|
17329
|
-
import { z as
|
|
17330
|
-
var mcpHealthSchema =
|
|
17331
|
-
status:
|
|
17444
|
+
import { z as z59 } from "zod";
|
|
17445
|
+
var mcpHealthSchema = z59.object({
|
|
17446
|
+
status: z59.enum(["available", "unavailable", "not-supported"])
|
|
17332
17447
|
});
|
|
17333
17448
|
|
|
17334
17449
|
// ../contracts/src/sql-like.ts
|
|
@@ -17491,16 +17606,16 @@ function classifyProviderErrorMessages(messages) {
|
|
|
17491
17606
|
}
|
|
17492
17607
|
|
|
17493
17608
|
// ../contracts/src/telemetry.ts
|
|
17494
|
-
import { z as
|
|
17609
|
+
import { z as z60 } from "zod";
|
|
17495
17610
|
var ONBOARDING_FLOW_VERSION = 1;
|
|
17496
|
-
var onboardingStepSchema =
|
|
17611
|
+
var onboardingStepSchema = z60.enum([
|
|
17497
17612
|
"system",
|
|
17498
17613
|
"project",
|
|
17499
17614
|
"queries",
|
|
17500
17615
|
"competitors",
|
|
17501
17616
|
"run"
|
|
17502
17617
|
]);
|
|
17503
|
-
var onboardingCountBucketSchema =
|
|
17618
|
+
var onboardingCountBucketSchema = z60.enum([
|
|
17504
17619
|
"0",
|
|
17505
17620
|
"1",
|
|
17506
17621
|
"2-3",
|
|
@@ -17516,7 +17631,7 @@ function bucketOnboardingCount(value) {
|
|
|
17516
17631
|
if (value < 11) return "6-10";
|
|
17517
17632
|
return "11+";
|
|
17518
17633
|
}
|
|
17519
|
-
var onboardingBlockReasonSchema =
|
|
17634
|
+
var onboardingBlockReasonSchema = z60.enum([
|
|
17520
17635
|
"api_unavailable",
|
|
17521
17636
|
"database_unavailable",
|
|
17522
17637
|
"worker_unavailable",
|
|
@@ -17536,39 +17651,39 @@ var onboardingBlockReasonSchema = z59.enum([
|
|
|
17536
17651
|
"network",
|
|
17537
17652
|
"unknown"
|
|
17538
17653
|
]);
|
|
17539
|
-
var onboardingSurfaceSchema =
|
|
17654
|
+
var onboardingSurfaceSchema = z60.enum([
|
|
17540
17655
|
"wizard",
|
|
17541
17656
|
"platform",
|
|
17542
17657
|
"site_health"
|
|
17543
17658
|
]);
|
|
17544
|
-
var onboardingEventBaseSchema =
|
|
17545
|
-
eventId:
|
|
17546
|
-
flowVersion:
|
|
17547
|
-
onboardingSessionId:
|
|
17659
|
+
var onboardingEventBaseSchema = z60.object({
|
|
17660
|
+
eventId: z60.string().uuid(),
|
|
17661
|
+
flowVersion: z60.literal(ONBOARDING_FLOW_VERSION),
|
|
17662
|
+
onboardingSessionId: z60.string().uuid(),
|
|
17548
17663
|
surface: onboardingSurfaceSchema.optional()
|
|
17549
17664
|
});
|
|
17550
|
-
var onboardingTelemetryEventSchema =
|
|
17665
|
+
var onboardingTelemetryEventSchema = z60.discriminatedUnion("event", [
|
|
17551
17666
|
onboardingEventBaseSchema.extend({
|
|
17552
|
-
event:
|
|
17667
|
+
event: z60.literal("onboarding.started"),
|
|
17553
17668
|
step: onboardingStepSchema,
|
|
17554
|
-
resumed:
|
|
17669
|
+
resumed: z60.boolean()
|
|
17555
17670
|
}).strict(),
|
|
17556
17671
|
onboardingEventBaseSchema.extend({
|
|
17557
|
-
event:
|
|
17672
|
+
event: z60.literal("onboarding.step_completed"),
|
|
17558
17673
|
step: onboardingStepSchema,
|
|
17559
|
-
method:
|
|
17674
|
+
method: z60.enum(["existing", "inline", "manual", "generated", "skipped", "automatic"]),
|
|
17560
17675
|
countBucket: onboardingCountBucketSchema.optional()
|
|
17561
17676
|
}).strict(),
|
|
17562
17677
|
onboardingEventBaseSchema.extend({
|
|
17563
|
-
event:
|
|
17678
|
+
event: z60.literal("onboarding.blocked"),
|
|
17564
17679
|
step: onboardingStepSchema,
|
|
17565
|
-
action:
|
|
17680
|
+
action: z60.enum(["continue", "configure_provider", "generate_queries", "save", "launch_run", "retry_run"]),
|
|
17566
17681
|
reasonCode: onboardingBlockReasonSchema
|
|
17567
17682
|
}).strict(),
|
|
17568
17683
|
onboardingEventBaseSchema.extend({
|
|
17569
|
-
event:
|
|
17570
|
-
origin:
|
|
17571
|
-
result:
|
|
17684
|
+
event: z60.literal("run.requested"),
|
|
17685
|
+
origin: z60.literal("dashboard_setup"),
|
|
17686
|
+
result: z60.enum(["queued", "rejected"]),
|
|
17572
17687
|
/**
|
|
17573
17688
|
* What kind of run was asked for. A site-health crawl has no providers and
|
|
17574
17689
|
* no tracked queries, so its buckets are legitimately `0`; without this
|
|
@@ -17577,7 +17692,7 @@ var onboardingTelemetryEventSchema = z59.discriminatedUnion("event", [
|
|
|
17577
17692
|
* `surface`: a documented fallback that nothing applies becomes a null
|
|
17578
17693
|
* bucket downstream.
|
|
17579
17694
|
*/
|
|
17580
|
-
kind:
|
|
17695
|
+
kind: z60.enum(["answer_visibility", "site_health"]).optional(),
|
|
17581
17696
|
providerCountBucket: onboardingCountBucketSchema,
|
|
17582
17697
|
queryCountBucket: onboardingCountBucketSchema,
|
|
17583
17698
|
reasonCode: onboardingBlockReasonSchema.optional()
|
|
@@ -17587,8 +17702,8 @@ function normalizeOnboardingEventForCollection(event) {
|
|
|
17587
17702
|
const surfaced = { ...event, surface: event.surface ?? "wizard" };
|
|
17588
17703
|
return surfaced.event === "run.requested" ? { ...surfaced, kind: surfaced.kind ?? "answer_visibility" } : surfaced;
|
|
17589
17704
|
}
|
|
17590
|
-
var telemetryEventAcceptedDtoSchema =
|
|
17591
|
-
accepted:
|
|
17705
|
+
var telemetryEventAcceptedDtoSchema = z60.object({
|
|
17706
|
+
accepted: z60.boolean()
|
|
17592
17707
|
});
|
|
17593
17708
|
var GHOST_TELEMETRY_TEST_LOCATIONS = /* @__PURE__ */ new Set(["nyc", "lax", "chi"]);
|
|
17594
17709
|
function isGhostTelemetryEvent(eventName, properties) {
|
|
@@ -18198,6 +18313,14 @@ export {
|
|
|
18198
18313
|
citationVisibilityResponseSchema,
|
|
18199
18314
|
emptyCitationVisibility,
|
|
18200
18315
|
citationStateToCited,
|
|
18316
|
+
REPORT_VISIBILITY_COPY,
|
|
18317
|
+
reportQueryClassLabel,
|
|
18318
|
+
reportVisibilityRate,
|
|
18319
|
+
reportVisibilityEvidence,
|
|
18320
|
+
reportVisibilityComparison,
|
|
18321
|
+
reportVisibilityMeasurementLabel,
|
|
18322
|
+
reportVisibilityHistoryLabel,
|
|
18323
|
+
reportVisibilityLocationLabel,
|
|
18201
18324
|
REPORT_PERIOD_OPTIONS,
|
|
18202
18325
|
reportPeriodSchema,
|
|
18203
18326
|
parseReportPeriodDays,
|