@canonry/canonry 4.131.0 → 4.133.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/agent-workspace/skills/canonry/references/canonry-cli.md +7 -0
- package/assets/assets/{AuditHistoryPanel-yJXZMO5t.js → AuditHistoryPanel-CVDg3GXg.js} +1 -1
- package/assets/assets/{BacklinksPage-6VTLbAYx.js → BacklinksPage-Dh4RIvS7.js} +1 -1
- package/assets/assets/{ChartPrimitives-D5YGiDLi.js → ChartPrimitives-BK89G5H_.js} +1 -1
- package/assets/assets/{HistoryPage-BxdTM6-R.js → HistoryPage-D8rMu_Js.js} +1 -1
- package/assets/assets/{ProjectPage-BJKxZPRO.js → ProjectPage-CiTDveNK.js} +1 -1
- package/assets/assets/{RunRow-DTrAO7tE.js → RunRow-DVOwbmTp.js} +1 -1
- package/assets/assets/{RunsPage-CHU0DQGl.js → RunsPage-tz3Oil7N.js} +1 -1
- package/assets/assets/{SettingsPage-bOIwju6t.js → SettingsPage-C698YidM.js} +1 -1
- package/assets/assets/{TrafficPage-BKvuR482.js → TrafficPage-XDXWMtey.js} +1 -1
- package/assets/assets/{TrafficSourceDetailPage-3-iUTgQg.js → TrafficSourceDetailPage-Clz8kOR8.js} +1 -1
- package/assets/assets/{arrow-left-BXSfGhr6.js → arrow-left-GWLbh0pE.js} +1 -1
- package/assets/assets/{extract-error-message-DEAY62LS.js → extract-error-message-Dk8w-sb1.js} +1 -1
- package/assets/assets/index-jTshRRh0.js +210 -0
- package/assets/assets/{trash-2-O1wo9IX1.js → trash-2-DwnzsuH1.js} +1 -1
- package/assets/index.html +1 -1
- package/dist/{chunk-5GQ6FF5R.js → chunk-42P7POVS.js} +4 -4
- package/dist/{chunk-73HPY6XQ.js → chunk-P4MIG7V5.js} +81 -1
- package/dist/{chunk-ZXVWL5HX.js → chunk-VPY3PZXV.js} +1827 -873
- package/dist/{chunk-3WBAJKRR.js → chunk-ZPQX5ZQ2.js} +740 -555
- package/dist/cli.js +139 -11
- package/dist/index.js +4 -4
- package/dist/{intelligence-service-YJKQQYJQ.js → intelligence-service-2K7GVEQM.js} +2 -2
- package/dist/mcp.js +2 -2
- package/package.json +8 -8
- package/assets/assets/index-CfjIYitV.js +0 -210
|
@@ -216,6 +216,89 @@ var DEFAULT_MEASUREMENT_CONFIG = Object.freeze({
|
|
|
216
216
|
var defaultMeasurementConfig = () => createDefaultMeasurementConfig();
|
|
217
217
|
var gaMeasurementComponentStatusSchema = z2.enum(["never-synced", "ready", "error"]);
|
|
218
218
|
var gaLeadAttributionScopeSchema = z2.enum(["landing-page", "channel"]);
|
|
219
|
+
var gaMeasurementAnalysisWindowSchema = z2.enum(["30d", "60d", "90d"]);
|
|
220
|
+
var gaMeasurementHostScopeSchema = z2.enum(["marketing", "all"]);
|
|
221
|
+
var analysisDateSchema = z2.iso.date();
|
|
222
|
+
var analysisPeriodSchema = z2.object({
|
|
223
|
+
label: z2.enum(["earliest", "middle", "previous", "latest"]),
|
|
224
|
+
startDate: analysisDateSchema,
|
|
225
|
+
endDate: analysisDateSchema
|
|
226
|
+
});
|
|
227
|
+
var analysisSessionPeriodSchema = analysisPeriodSchema.extend({
|
|
228
|
+
sessions: z2.number().int().nonnegative()
|
|
229
|
+
});
|
|
230
|
+
var analysisEventPeriodSchema = analysisPeriodSchema.extend({
|
|
231
|
+
eventCount: z2.number().int().nonnegative()
|
|
232
|
+
});
|
|
233
|
+
var analysisClickPeriodSchema = analysisPeriodSchema.extend({
|
|
234
|
+
clicks: z2.number().int().nonnegative(),
|
|
235
|
+
impressions: z2.number().int().nonnegative()
|
|
236
|
+
});
|
|
237
|
+
var analysisDemandPeriodSchema = analysisPeriodSchema.extend({
|
|
238
|
+
propertyClicks: z2.number().int().nonnegative(),
|
|
239
|
+
propertyImpressions: z2.number().int().nonnegative(),
|
|
240
|
+
reportedQueryClicks: z2.number().int().nonnegative(),
|
|
241
|
+
reportedQueryImpressions: z2.number().int().nonnegative(),
|
|
242
|
+
brandedClicks: z2.number().int().nonnegative(),
|
|
243
|
+
brandedImpressions: z2.number().int().nonnegative(),
|
|
244
|
+
nonBrandedClicks: z2.number().int().nonnegative(),
|
|
245
|
+
nonBrandedImpressions: z2.number().int().nonnegative(),
|
|
246
|
+
unreportedClicks: z2.number().int().nonnegative(),
|
|
247
|
+
unreportedImpressions: z2.number().int().nonnegative()
|
|
248
|
+
});
|
|
249
|
+
var gaMeasurementAnalysisDtoSchema = z2.object({
|
|
250
|
+
window: gaMeasurementAnalysisWindowSchema,
|
|
251
|
+
bucketDays: z2.literal(30),
|
|
252
|
+
filters: z2.object({
|
|
253
|
+
hostScope: gaMeasurementHostScopeSchema,
|
|
254
|
+
marketingHosts: z2.array(z2.string()),
|
|
255
|
+
pathPrefix: z2.string().nullable(),
|
|
256
|
+
brandTerms: z2.array(z2.string()),
|
|
257
|
+
queryMixScope: z2.literal("property")
|
|
258
|
+
}),
|
|
259
|
+
acquisition: z2.object({
|
|
260
|
+
status: gaMeasurementComponentStatusSchema,
|
|
261
|
+
error: z2.string().nullable(),
|
|
262
|
+
syncedAt: z2.string().datetime().nullable(),
|
|
263
|
+
periods: z2.array(analysisSessionPeriodSchema),
|
|
264
|
+
channels: z2.array(z2.object({
|
|
265
|
+
channelGroup: z2.string(),
|
|
266
|
+
periods: z2.array(analysisSessionPeriodSchema)
|
|
267
|
+
})),
|
|
268
|
+
pages: z2.array(z2.object({
|
|
269
|
+
hostName: z2.string(),
|
|
270
|
+
landingPage: z2.string(),
|
|
271
|
+
periods: z2.array(analysisSessionPeriodSchema)
|
|
272
|
+
}))
|
|
273
|
+
}),
|
|
274
|
+
leads: z2.object({
|
|
275
|
+
status: gaMeasurementComponentStatusSchema,
|
|
276
|
+
error: z2.string().nullable(),
|
|
277
|
+
syncedAt: z2.string().datetime().nullable(),
|
|
278
|
+
attributionScope: gaLeadAttributionScopeSchema.nullable(),
|
|
279
|
+
hostAndPathFiltersApplied: z2.boolean(),
|
|
280
|
+
periods: z2.array(analysisEventPeriodSchema),
|
|
281
|
+
channels: z2.array(z2.object({
|
|
282
|
+
channelGroup: z2.string(),
|
|
283
|
+
periods: z2.array(analysisEventPeriodSchema)
|
|
284
|
+
}))
|
|
285
|
+
}),
|
|
286
|
+
searchDemand: z2.object({
|
|
287
|
+
status: z2.enum(["ready", "unavailable"]),
|
|
288
|
+
periods: z2.array(analysisDemandPeriodSchema),
|
|
289
|
+
queries: z2.array(z2.object({
|
|
290
|
+
query: z2.string(),
|
|
291
|
+
classification: z2.enum(["branded", "non-branded"]),
|
|
292
|
+
periods: z2.array(analysisClickPeriodSchema)
|
|
293
|
+
})),
|
|
294
|
+
pages: z2.array(z2.object({
|
|
295
|
+
hostName: z2.string(),
|
|
296
|
+
landingPage: z2.string(),
|
|
297
|
+
periods: z2.array(analysisClickPeriodSchema)
|
|
298
|
+
})),
|
|
299
|
+
latestDate: analysisDateSchema.nullable()
|
|
300
|
+
})
|
|
301
|
+
});
|
|
219
302
|
|
|
220
303
|
// ../contracts/src/project.ts
|
|
221
304
|
var configSourceSchema = z3.enum(["cli", "api", "config-file"]);
|
|
@@ -5762,6 +5845,103 @@ var projectReportDtoSchema = z33.object({
|
|
|
5762
5845
|
groundingSources: z33.array(contentSourceRowDtoSchema)
|
|
5763
5846
|
});
|
|
5764
5847
|
|
|
5848
|
+
// ../contracts/src/organic-evidence.ts
|
|
5849
|
+
import { z as z34 } from "zod";
|
|
5850
|
+
var organicEvidencePeriodSchema = z34.union([z34.literal(60), z34.literal(90)]);
|
|
5851
|
+
var cohortNameSchema = z34.enum(["earliest", "middle", "prior", "latest"]);
|
|
5852
|
+
var countSchema = z34.object({
|
|
5853
|
+
clicks: z34.number().int().nonnegative(),
|
|
5854
|
+
impressions: z34.number().int().nonnegative()
|
|
5855
|
+
});
|
|
5856
|
+
var cohortSchema = z34.object({
|
|
5857
|
+
name: cohortNameSchema,
|
|
5858
|
+
startDate: z34.string(),
|
|
5859
|
+
endDate: z34.string()
|
|
5860
|
+
});
|
|
5861
|
+
var searchCohortSchema = cohortSchema.extend({ totals: countSchema });
|
|
5862
|
+
var sessionCohortSchema = cohortSchema.extend({
|
|
5863
|
+
organicSessions: z34.number().int().nonnegative()
|
|
5864
|
+
});
|
|
5865
|
+
var sourceCoverageSchema = z34.object({
|
|
5866
|
+
startDate: z34.string(),
|
|
5867
|
+
endDate: z34.string(),
|
|
5868
|
+
observedDays: z34.number().int().nonnegative()
|
|
5869
|
+
});
|
|
5870
|
+
var crawlerCountsSchema = z34.object({
|
|
5871
|
+
verified: z34.number().int().nonnegative(),
|
|
5872
|
+
claimedUnverified: z34.number().int().nonnegative(),
|
|
5873
|
+
unknownAiLike: z34.number().int().nonnegative()
|
|
5874
|
+
});
|
|
5875
|
+
var referralCountsSchema = z34.object({
|
|
5876
|
+
total: z34.number().int().nonnegative(),
|
|
5877
|
+
paid: z34.number().int().nonnegative(),
|
|
5878
|
+
organic: z34.number().int().nonnegative(),
|
|
5879
|
+
unknown: z34.number().int().nonnegative()
|
|
5880
|
+
});
|
|
5881
|
+
var organicEvidenceDtoSchema = z34.object({
|
|
5882
|
+
contractVersion: z34.literal("organic-evidence/v1"),
|
|
5883
|
+
periodDays: organicEvidencePeriodSchema,
|
|
5884
|
+
/** Latest headline evidence date, preferring the GSC property date when available. */
|
|
5885
|
+
asOfDate: z34.string().nullable(),
|
|
5886
|
+
coverage: z34.object({
|
|
5887
|
+
gsc: z34.boolean(),
|
|
5888
|
+
ga4: z34.boolean(),
|
|
5889
|
+
server: z34.boolean(),
|
|
5890
|
+
visibility: z34.boolean()
|
|
5891
|
+
}),
|
|
5892
|
+
sourceCoverage: z34.object({
|
|
5893
|
+
gsc: sourceCoverageSchema.nullable(),
|
|
5894
|
+
ga4: sourceCoverageSchema.nullable(),
|
|
5895
|
+
server: sourceCoverageSchema.nullable(),
|
|
5896
|
+
visibility: z34.object({ completedAt: z34.string(), ageDays: z34.number().nonnegative() }).nullable()
|
|
5897
|
+
}),
|
|
5898
|
+
gsc: z34.object({
|
|
5899
|
+
propertyTotals: countSchema,
|
|
5900
|
+
namedBrand: countSchema,
|
|
5901
|
+
namedNonBrand: countSchema,
|
|
5902
|
+
suppressedOrUnreportedResidual: countSchema,
|
|
5903
|
+
cohorts: z34.array(searchCohortSchema)
|
|
5904
|
+
}).nullable(),
|
|
5905
|
+
ga4: z34.object({
|
|
5906
|
+
organicSessions: z34.number().int().nonnegative(),
|
|
5907
|
+
cohorts: z34.array(sessionCohortSchema)
|
|
5908
|
+
}).nullable(),
|
|
5909
|
+
gaAiReferrals: z34.object({
|
|
5910
|
+
paidSessions: z34.number().int().nonnegative(),
|
|
5911
|
+
organicSessions: z34.number().int().nonnegative()
|
|
5912
|
+
}).nullable(),
|
|
5913
|
+
server: z34.object({
|
|
5914
|
+
crawlerHits: crawlerCountsSchema,
|
|
5915
|
+
userFetchHits: crawlerCountsSchema,
|
|
5916
|
+
referralSessions: referralCountsSchema
|
|
5917
|
+
}).nullable(),
|
|
5918
|
+
visibility: z34.object({
|
|
5919
|
+
runId: z34.string(),
|
|
5920
|
+
completedAt: z34.string(),
|
|
5921
|
+
ageDays: z34.number().nonnegative(),
|
|
5922
|
+
answerPairs: z34.number().int().nonnegative(),
|
|
5923
|
+
mentionedPairs: z34.number().int().nonnegative(),
|
|
5924
|
+
citedPairs: z34.number().int().nonnegative()
|
|
5925
|
+
}).nullable(),
|
|
5926
|
+
measurement: gaMeasurementAnalysisDtoSchema,
|
|
5927
|
+
pages: z34.array(z34.object({
|
|
5928
|
+
path: z34.string(),
|
|
5929
|
+
gsc: countSchema,
|
|
5930
|
+
ga4OrganicSessions: z34.number().int().nonnegative(),
|
|
5931
|
+
server: z34.object({
|
|
5932
|
+
crawlerHits: crawlerCountsSchema,
|
|
5933
|
+
userFetchHits: crawlerCountsSchema,
|
|
5934
|
+
referralSessions: referralCountsSchema
|
|
5935
|
+
})
|
|
5936
|
+
})),
|
|
5937
|
+
findings: z34.array(z34.object({
|
|
5938
|
+
tone: z34.enum(["positive", "caution", "neutral"]),
|
|
5939
|
+
title: z34.string(),
|
|
5940
|
+
detail: z34.string()
|
|
5941
|
+
})),
|
|
5942
|
+
limitations: z34.array(z34.object({ code: z34.string(), detail: z34.string() }))
|
|
5943
|
+
});
|
|
5944
|
+
|
|
5765
5945
|
// ../contracts/src/report-dedup.ts
|
|
5766
5946
|
var REPORT_INTENT_STOPWORDS = /* @__PURE__ */ new Set([
|
|
5767
5947
|
"a",
|
|
@@ -5830,10 +6010,10 @@ function dedupeReportOpportunities(report) {
|
|
|
5830
6010
|
}
|
|
5831
6011
|
|
|
5832
6012
|
// ../contracts/src/skills.ts
|
|
5833
|
-
import { z as
|
|
5834
|
-
var codingAgentSchema =
|
|
6013
|
+
import { z as z35 } from "zod";
|
|
6014
|
+
var codingAgentSchema = z35.enum(["claude", "codex"]);
|
|
5835
6015
|
var CodingAgents = codingAgentSchema.enum;
|
|
5836
|
-
var skillsClientSchema =
|
|
6016
|
+
var skillsClientSchema = z35.enum(["claude", "codex", "all"]);
|
|
5837
6017
|
var SkillsClients = skillsClientSchema.enum;
|
|
5838
6018
|
var SKILL_MANIFEST_FILENAME = ".canonry-skill-manifest.json";
|
|
5839
6019
|
function classifySkillFile(params) {
|
|
@@ -5851,22 +6031,22 @@ function coerceSkillManifest(parsed) {
|
|
|
5851
6031
|
}
|
|
5852
6032
|
|
|
5853
6033
|
// ../contracts/src/traffic.ts
|
|
5854
|
-
import { z as
|
|
5855
|
-
var trafficCrawlerSegmentsSchema =
|
|
5856
|
-
content:
|
|
5857
|
-
sitemap:
|
|
5858
|
-
robots:
|
|
5859
|
-
asset:
|
|
5860
|
-
other:
|
|
5861
|
-
});
|
|
5862
|
-
var trafficPathClassSchema =
|
|
6034
|
+
import { z as z36 } from "zod";
|
|
6035
|
+
var trafficCrawlerSegmentsSchema = z36.object({
|
|
6036
|
+
content: z36.number().int().nonnegative(),
|
|
6037
|
+
sitemap: z36.number().int().nonnegative(),
|
|
6038
|
+
robots: z36.number().int().nonnegative(),
|
|
6039
|
+
asset: z36.number().int().nonnegative(),
|
|
6040
|
+
other: z36.number().int().nonnegative()
|
|
6041
|
+
});
|
|
6042
|
+
var trafficPathClassSchema = z36.enum([
|
|
5863
6043
|
"content",
|
|
5864
6044
|
"sitemap",
|
|
5865
6045
|
"robots",
|
|
5866
6046
|
"asset",
|
|
5867
6047
|
"other"
|
|
5868
6048
|
]);
|
|
5869
|
-
var trafficSourceTypeSchema =
|
|
6049
|
+
var trafficSourceTypeSchema = z36.enum([
|
|
5870
6050
|
"cloud-run",
|
|
5871
6051
|
"wordpress",
|
|
5872
6052
|
"cloudflare",
|
|
@@ -5874,7 +6054,7 @@ var trafficSourceTypeSchema = z35.enum([
|
|
|
5874
6054
|
"generic-log"
|
|
5875
6055
|
]);
|
|
5876
6056
|
var TrafficSourceTypes = trafficSourceTypeSchema.enum;
|
|
5877
|
-
var trafficAdapterCapabilitySchema =
|
|
6057
|
+
var trafficAdapterCapabilitySchema = z36.enum([
|
|
5878
6058
|
"raw-request-events",
|
|
5879
6059
|
"aggregate-request-metrics",
|
|
5880
6060
|
"request-url",
|
|
@@ -5885,279 +6065,279 @@ var trafficAdapterCapabilitySchema = z35.enum([
|
|
|
5885
6065
|
"cursor-pull"
|
|
5886
6066
|
]);
|
|
5887
6067
|
var TrafficAdapterCapabilities = trafficAdapterCapabilitySchema.enum;
|
|
5888
|
-
var trafficEvidenceKindSchema =
|
|
6068
|
+
var trafficEvidenceKindSchema = z36.enum(["raw-request", "aggregate-bucket"]);
|
|
5889
6069
|
var TrafficEvidenceKinds = trafficEvidenceKindSchema.enum;
|
|
5890
|
-
var trafficEventConfidenceSchema =
|
|
6070
|
+
var trafficEventConfidenceSchema = z36.enum(["observed", "provider-aggregated", "inferred"]);
|
|
5891
6071
|
var TrafficEventConfidences = trafficEventConfidenceSchema.enum;
|
|
5892
|
-
var trafficProviderResourceSchema =
|
|
5893
|
-
type:
|
|
5894
|
-
labels:
|
|
6072
|
+
var trafficProviderResourceSchema = z36.object({
|
|
6073
|
+
type: z36.string().nullable(),
|
|
6074
|
+
labels: z36.record(z36.string(), z36.string())
|
|
5895
6075
|
});
|
|
5896
|
-
var normalizedTrafficRequestSchema =
|
|
6076
|
+
var normalizedTrafficRequestSchema = z36.object({
|
|
5897
6077
|
sourceType: trafficSourceTypeSchema,
|
|
5898
|
-
evidenceKind:
|
|
5899
|
-
confidence:
|
|
5900
|
-
eventId:
|
|
5901
|
-
observedAt:
|
|
5902
|
-
method:
|
|
5903
|
-
requestUrl:
|
|
5904
|
-
host:
|
|
5905
|
-
path:
|
|
5906
|
-
queryString:
|
|
5907
|
-
status:
|
|
5908
|
-
userAgent:
|
|
5909
|
-
remoteIp:
|
|
5910
|
-
referer:
|
|
5911
|
-
latencyMs:
|
|
5912
|
-
requestSizeBytes:
|
|
5913
|
-
responseSizeBytes:
|
|
6078
|
+
evidenceKind: z36.literal(TrafficEvidenceKinds["raw-request"]),
|
|
6079
|
+
confidence: z36.literal(TrafficEventConfidences.observed),
|
|
6080
|
+
eventId: z36.string().min(1),
|
|
6081
|
+
observedAt: z36.string().min(1),
|
|
6082
|
+
method: z36.string().nullable(),
|
|
6083
|
+
requestUrl: z36.string().nullable(),
|
|
6084
|
+
host: z36.string().nullable(),
|
|
6085
|
+
path: z36.string().min(1),
|
|
6086
|
+
queryString: z36.string().nullable(),
|
|
6087
|
+
status: z36.number().int().nullable(),
|
|
6088
|
+
userAgent: z36.string().nullable(),
|
|
6089
|
+
remoteIp: z36.string().nullable(),
|
|
6090
|
+
referer: z36.string().nullable(),
|
|
6091
|
+
latencyMs: z36.number().nullable(),
|
|
6092
|
+
requestSizeBytes: z36.number().int().nullable(),
|
|
6093
|
+
responseSizeBytes: z36.number().int().nullable(),
|
|
5914
6094
|
providerResource: trafficProviderResourceSchema,
|
|
5915
|
-
providerLabels:
|
|
6095
|
+
providerLabels: z36.record(z36.string(), z36.string())
|
|
5916
6096
|
});
|
|
5917
|
-
var normalizedTrafficPullPageSchema =
|
|
5918
|
-
events:
|
|
5919
|
-
rawEntryCount:
|
|
5920
|
-
skippedEntryCount:
|
|
5921
|
-
nextPageToken:
|
|
5922
|
-
filter:
|
|
6097
|
+
var normalizedTrafficPullPageSchema = z36.object({
|
|
6098
|
+
events: z36.array(normalizedTrafficRequestSchema),
|
|
6099
|
+
rawEntryCount: z36.number().int().nonnegative(),
|
|
6100
|
+
skippedEntryCount: z36.number().int().nonnegative(),
|
|
6101
|
+
nextPageToken: z36.string().optional(),
|
|
6102
|
+
filter: z36.string()
|
|
5923
6103
|
});
|
|
5924
|
-
var trafficSourceStatusSchema =
|
|
6104
|
+
var trafficSourceStatusSchema = z36.enum(["connected", "paused", "error", "archived"]);
|
|
5925
6105
|
var TrafficSourceStatuses = trafficSourceStatusSchema.enum;
|
|
5926
|
-
var trafficSourceAuthModeSchema =
|
|
6106
|
+
var trafficSourceAuthModeSchema = z36.enum(["oauth", "service-account"]);
|
|
5927
6107
|
var TrafficSourceAuthModes = trafficSourceAuthModeSchema.enum;
|
|
5928
|
-
var verificationStatusSchema =
|
|
6108
|
+
var verificationStatusSchema = z36.enum(["verified", "claimed_unverified", "unknown_ai_like"]);
|
|
5929
6109
|
var VerificationStatuses = verificationStatusSchema.enum;
|
|
5930
|
-
var cloudRunSourceConfigSchema =
|
|
5931
|
-
gcpProjectId:
|
|
5932
|
-
serviceName:
|
|
5933
|
-
location:
|
|
6110
|
+
var cloudRunSourceConfigSchema = z36.object({
|
|
6111
|
+
gcpProjectId: z36.string().min(1),
|
|
6112
|
+
serviceName: z36.string().nullable().optional(),
|
|
6113
|
+
location: z36.string().nullable().optional(),
|
|
5934
6114
|
authMode: trafficSourceAuthModeSchema
|
|
5935
6115
|
});
|
|
5936
|
-
var wordpressTrafficSourceConfigSchema =
|
|
5937
|
-
baseUrl:
|
|
5938
|
-
username:
|
|
6116
|
+
var wordpressTrafficSourceConfigSchema = z36.object({
|
|
6117
|
+
baseUrl: z36.string().url(),
|
|
6118
|
+
username: z36.string().min(1)
|
|
5939
6119
|
});
|
|
5940
|
-
var vercelTrafficEnvironmentSchema =
|
|
6120
|
+
var vercelTrafficEnvironmentSchema = z36.enum(["production", "preview"]);
|
|
5941
6121
|
var VercelTrafficEnvironments = vercelTrafficEnvironmentSchema.enum;
|
|
5942
|
-
var vercelTrafficSourceConfigSchema =
|
|
6122
|
+
var vercelTrafficSourceConfigSchema = z36.object({
|
|
5943
6123
|
/** Vercel project id (e.g. `prj_...`). */
|
|
5944
|
-
projectId:
|
|
6124
|
+
projectId: z36.string().min(1),
|
|
5945
6125
|
/** Vercel team or account id: the org that owns the project. */
|
|
5946
|
-
teamId:
|
|
6126
|
+
teamId: z36.string().min(1),
|
|
5947
6127
|
environment: vercelTrafficEnvironmentSchema
|
|
5948
6128
|
});
|
|
5949
|
-
var trafficSourceDtoSchema =
|
|
5950
|
-
id:
|
|
5951
|
-
projectId:
|
|
6129
|
+
var trafficSourceDtoSchema = z36.object({
|
|
6130
|
+
id: z36.string(),
|
|
6131
|
+
projectId: z36.string(),
|
|
5952
6132
|
sourceType: trafficSourceTypeSchema,
|
|
5953
|
-
displayName:
|
|
6133
|
+
displayName: z36.string(),
|
|
5954
6134
|
status: trafficSourceStatusSchema,
|
|
5955
|
-
lastSyncedAt:
|
|
5956
|
-
lastCursor:
|
|
5957
|
-
lastError:
|
|
5958
|
-
archivedAt:
|
|
5959
|
-
config:
|
|
5960
|
-
createdAt:
|
|
5961
|
-
updatedAt:
|
|
5962
|
-
});
|
|
5963
|
-
var trafficConnectCloudRunRequestSchema =
|
|
5964
|
-
gcpProjectId:
|
|
5965
|
-
serviceName:
|
|
5966
|
-
location:
|
|
5967
|
-
displayName:
|
|
6135
|
+
lastSyncedAt: z36.string().nullable(),
|
|
6136
|
+
lastCursor: z36.string().nullable(),
|
|
6137
|
+
lastError: z36.string().nullable(),
|
|
6138
|
+
archivedAt: z36.string().nullable(),
|
|
6139
|
+
config: z36.record(z36.string(), z36.unknown()),
|
|
6140
|
+
createdAt: z36.string(),
|
|
6141
|
+
updatedAt: z36.string()
|
|
6142
|
+
});
|
|
6143
|
+
var trafficConnectCloudRunRequestSchema = z36.object({
|
|
6144
|
+
gcpProjectId: z36.string().min(1),
|
|
6145
|
+
serviceName: z36.string().min(1).optional(),
|
|
6146
|
+
location: z36.string().min(1).optional(),
|
|
6147
|
+
displayName: z36.string().min(1).optional(),
|
|
5968
6148
|
/** Service-account JSON content (string). When omitted, defaults to OAuth via `canonry google connect <project> --type ga4` flow. */
|
|
5969
|
-
keyJson:
|
|
6149
|
+
keyJson: z36.string().optional()
|
|
5970
6150
|
});
|
|
5971
|
-
var trafficConnectWordpressRequestSchema =
|
|
5972
|
-
baseUrl:
|
|
5973
|
-
username:
|
|
6151
|
+
var trafficConnectWordpressRequestSchema = z36.object({
|
|
6152
|
+
baseUrl: z36.string().url(),
|
|
6153
|
+
username: z36.string().min(1),
|
|
5974
6154
|
/** WordPress Application Password (the same auth used by the content client). */
|
|
5975
|
-
applicationPassword:
|
|
5976
|
-
displayName:
|
|
6155
|
+
applicationPassword: z36.string().min(1),
|
|
6156
|
+
displayName: z36.string().min(1).optional()
|
|
5977
6157
|
});
|
|
5978
|
-
var trafficConnectVercelRequestSchema =
|
|
6158
|
+
var trafficConnectVercelRequestSchema = z36.object({
|
|
5979
6159
|
/** Vercel project id (e.g. `prj_...`) — from the Vercel dashboard or `.vercel/project.json`. */
|
|
5980
|
-
projectId:
|
|
6160
|
+
projectId: z36.string().min(1),
|
|
5981
6161
|
/** Vercel team or account id: the org that owns the project ("orgId" in .vercel/project.json). */
|
|
5982
|
-
teamId:
|
|
6162
|
+
teamId: z36.string().min(1),
|
|
5983
6163
|
/** Vercel personal access token. Stored in `~/.canonry/config.yaml`, never the DB. */
|
|
5984
|
-
token:
|
|
6164
|
+
token: z36.string().min(1),
|
|
5985
6165
|
/** Which deployment environment's request logs to pull. Default: `production`. */
|
|
5986
6166
|
environment: vercelTrafficEnvironmentSchema.optional(),
|
|
5987
|
-
displayName:
|
|
6167
|
+
displayName: z36.string().min(1).optional()
|
|
5988
6168
|
});
|
|
5989
|
-
var trafficSyncResponseSchema =
|
|
5990
|
-
sourceId:
|
|
5991
|
-
runId:
|
|
5992
|
-
syncedAt:
|
|
5993
|
-
pulledEvents:
|
|
6169
|
+
var trafficSyncResponseSchema = z36.object({
|
|
6170
|
+
sourceId: z36.string(),
|
|
6171
|
+
runId: z36.string(),
|
|
6172
|
+
syncedAt: z36.string(),
|
|
6173
|
+
pulledEvents: z36.number().int().nonnegative(),
|
|
5994
6174
|
/** Self-traffic events (Canonry's own tooling) dropped before rollup. */
|
|
5995
|
-
selfTrafficExcluded:
|
|
5996
|
-
crawlerHits:
|
|
5997
|
-
aiUserFetchHits:
|
|
5998
|
-
aiReferralHits:
|
|
5999
|
-
unknownHits:
|
|
6000
|
-
crawlerBucketRows:
|
|
6001
|
-
aiUserFetchBucketRows:
|
|
6002
|
-
aiReferralBucketRows:
|
|
6003
|
-
sampleRows:
|
|
6004
|
-
windowStart:
|
|
6005
|
-
windowEnd:
|
|
6006
|
-
});
|
|
6007
|
-
var trafficBackfillRequestSchema =
|
|
6175
|
+
selfTrafficExcluded: z36.number().int().nonnegative(),
|
|
6176
|
+
crawlerHits: z36.number().int().nonnegative(),
|
|
6177
|
+
aiUserFetchHits: z36.number().int().nonnegative(),
|
|
6178
|
+
aiReferralHits: z36.number().int().nonnegative(),
|
|
6179
|
+
unknownHits: z36.number().int().nonnegative(),
|
|
6180
|
+
crawlerBucketRows: z36.number().int().nonnegative(),
|
|
6181
|
+
aiUserFetchBucketRows: z36.number().int().nonnegative(),
|
|
6182
|
+
aiReferralBucketRows: z36.number().int().nonnegative(),
|
|
6183
|
+
sampleRows: z36.number().int().nonnegative(),
|
|
6184
|
+
windowStart: z36.string(),
|
|
6185
|
+
windowEnd: z36.string()
|
|
6186
|
+
});
|
|
6187
|
+
var trafficBackfillRequestSchema = z36.object({
|
|
6008
6188
|
/** Lookback window in days. Capped server-side at the upstream log retention ceiling (Cloud Logging _Default = 30d). Default: 30. */
|
|
6009
|
-
days:
|
|
6189
|
+
days: z36.number().int().positive().optional()
|
|
6010
6190
|
});
|
|
6011
|
-
var trafficResetRequestSchema =
|
|
6012
|
-
advanceToNow:
|
|
6191
|
+
var trafficResetRequestSchema = z36.object({
|
|
6192
|
+
advanceToNow: z36.literal(true)
|
|
6013
6193
|
});
|
|
6014
|
-
var trafficBackfillResponseSchema =
|
|
6015
|
-
sourceId:
|
|
6016
|
-
runId:
|
|
6194
|
+
var trafficBackfillResponseSchema = z36.object({
|
|
6195
|
+
sourceId: z36.string(),
|
|
6196
|
+
runId: z36.string(),
|
|
6017
6197
|
status: runStatusSchema,
|
|
6018
|
-
windowStart:
|
|
6019
|
-
windowEnd:
|
|
6198
|
+
windowStart: z36.string(),
|
|
6199
|
+
windowEnd: z36.string(),
|
|
6020
6200
|
/** Days actually used after server-side clamping (≤ requested). */
|
|
6021
|
-
daysRequested:
|
|
6022
|
-
daysApplied:
|
|
6201
|
+
daysRequested: z36.number().int().positive(),
|
|
6202
|
+
daysApplied: z36.number().int().positive()
|
|
6023
6203
|
});
|
|
6024
|
-
var trafficSourceTotalsSchema =
|
|
6204
|
+
var trafficSourceTotalsSchema = z36.object({
|
|
6025
6205
|
/**
|
|
6026
6206
|
* Total classified-crawler hits in the window. UNCHANGED contract — still the
|
|
6027
6207
|
* full count across every path class. Use `crawlerContentHits` for the
|
|
6028
6208
|
* "content was actually crawled" signal.
|
|
6029
6209
|
*/
|
|
6030
|
-
crawlerHits:
|
|
6210
|
+
crawlerHits: z36.number().int().nonnegative(),
|
|
6031
6211
|
/** Crawler hits against content/document paths only (= `crawlerSegments.content`). */
|
|
6032
|
-
crawlerContentHits:
|
|
6212
|
+
crawlerContentHits: z36.number().int().nonnegative(),
|
|
6033
6213
|
/** Infrastructure crawler hits — sitemap + robots + asset fetches (`crawlerSegments.{sitemap,robots,asset}`). */
|
|
6034
|
-
crawlerInfraHits:
|
|
6214
|
+
crawlerInfraHits: z36.number().int().nonnegative(),
|
|
6035
6215
|
/** Full per-class crawler-hit breakdown; the five buckets sum to `crawlerHits`. */
|
|
6036
6216
|
crawlerSegments: trafficCrawlerSegmentsSchema,
|
|
6037
|
-
aiUserFetchHits:
|
|
6038
|
-
aiReferralHits:
|
|
6039
|
-
sampleCount:
|
|
6217
|
+
aiUserFetchHits: z36.number().int().nonnegative(),
|
|
6218
|
+
aiReferralHits: z36.number().int().nonnegative(),
|
|
6219
|
+
sampleCount: z36.number().int().nonnegative()
|
|
6040
6220
|
});
|
|
6041
|
-
var trafficSourceListResponseSchema =
|
|
6042
|
-
sources:
|
|
6221
|
+
var trafficSourceListResponseSchema = z36.object({
|
|
6222
|
+
sources: z36.array(trafficSourceDtoSchema)
|
|
6043
6223
|
});
|
|
6044
6224
|
var trafficSourceDetailDtoSchema = trafficSourceDtoSchema.extend({
|
|
6045
6225
|
totals24h: trafficSourceTotalsSchema,
|
|
6046
|
-
latestRun:
|
|
6047
|
-
runId:
|
|
6226
|
+
latestRun: z36.object({
|
|
6227
|
+
runId: z36.string(),
|
|
6048
6228
|
status: runStatusSchema,
|
|
6049
|
-
startedAt:
|
|
6050
|
-
finishedAt:
|
|
6051
|
-
error:
|
|
6229
|
+
startedAt: z36.string().nullable(),
|
|
6230
|
+
finishedAt: z36.string().nullable(),
|
|
6231
|
+
error: z36.string().nullable()
|
|
6052
6232
|
}).nullable()
|
|
6053
6233
|
});
|
|
6054
|
-
var trafficStatusResponseSchema =
|
|
6055
|
-
sources:
|
|
6234
|
+
var trafficStatusResponseSchema = z36.object({
|
|
6235
|
+
sources: z36.array(trafficSourceDetailDtoSchema)
|
|
6056
6236
|
});
|
|
6057
|
-
var trafficEventKindSchema =
|
|
6237
|
+
var trafficEventKindSchema = z36.enum(["crawler", "ai-user-fetch", "ai-referral"]);
|
|
6058
6238
|
var TrafficEventKinds = trafficEventKindSchema.enum;
|
|
6059
|
-
var trafficSeriesGranularitySchema =
|
|
6239
|
+
var trafficSeriesGranularitySchema = z36.enum(["hour", "day"]);
|
|
6060
6240
|
var TrafficSeriesGranularities = trafficSeriesGranularitySchema.enum;
|
|
6061
|
-
var trafficSeriesPointSchema =
|
|
6241
|
+
var trafficSeriesPointSchema = z36.object({
|
|
6062
6242
|
/**
|
|
6063
6243
|
* UTC bucket key: an ISO hour for hourly series, or `YYYY-MM-DD` for daily
|
|
6064
6244
|
* series. The response includes zero-value buckets across the full window.
|
|
6065
6245
|
*/
|
|
6066
|
-
bucket:
|
|
6067
|
-
crawlerHits:
|
|
6068
|
-
aiUserFetchHits:
|
|
6069
|
-
aiReferralHits:
|
|
6070
|
-
});
|
|
6071
|
-
var trafficCrawlerEventEntrySchema =
|
|
6072
|
-
kind:
|
|
6073
|
-
sourceId:
|
|
6074
|
-
tsHour:
|
|
6075
|
-
botId:
|
|
6076
|
-
operator:
|
|
6077
|
-
verificationStatus:
|
|
6078
|
-
pathNormalized:
|
|
6246
|
+
bucket: z36.string(),
|
|
6247
|
+
crawlerHits: z36.number().int().nonnegative(),
|
|
6248
|
+
aiUserFetchHits: z36.number().int().nonnegative(),
|
|
6249
|
+
aiReferralHits: z36.number().int().nonnegative()
|
|
6250
|
+
});
|
|
6251
|
+
var trafficCrawlerEventEntrySchema = z36.object({
|
|
6252
|
+
kind: z36.literal(TrafficEventKinds.crawler),
|
|
6253
|
+
sourceId: z36.string(),
|
|
6254
|
+
tsHour: z36.string(),
|
|
6255
|
+
botId: z36.string(),
|
|
6256
|
+
operator: z36.string(),
|
|
6257
|
+
verificationStatus: z36.string(),
|
|
6258
|
+
pathNormalized: z36.string(),
|
|
6079
6259
|
/** Coarse class of the fetched path — lets the UI split content crawls from sitemap/robots/asset polling. */
|
|
6080
6260
|
pathClass: trafficPathClassSchema,
|
|
6081
|
-
status:
|
|
6082
|
-
hits:
|
|
6083
|
-
});
|
|
6084
|
-
var trafficAiUserFetchEventEntrySchema =
|
|
6085
|
-
kind:
|
|
6086
|
-
sourceId:
|
|
6087
|
-
tsHour:
|
|
6088
|
-
botId:
|
|
6089
|
-
operator:
|
|
6090
|
-
verificationStatus:
|
|
6091
|
-
pathNormalized:
|
|
6092
|
-
status:
|
|
6093
|
-
hits:
|
|
6094
|
-
});
|
|
6095
|
-
var trafficAiReferralEventEntrySchema =
|
|
6096
|
-
kind:
|
|
6097
|
-
sourceId:
|
|
6098
|
-
tsHour:
|
|
6099
|
-
product:
|
|
6100
|
-
operator:
|
|
6101
|
-
sourceDomain:
|
|
6102
|
-
evidenceType:
|
|
6103
|
-
landingPathNormalized:
|
|
6104
|
-
status:
|
|
6261
|
+
status: z36.number().int(),
|
|
6262
|
+
hits: z36.number().int().nonnegative()
|
|
6263
|
+
});
|
|
6264
|
+
var trafficAiUserFetchEventEntrySchema = z36.object({
|
|
6265
|
+
kind: z36.literal(TrafficEventKinds["ai-user-fetch"]),
|
|
6266
|
+
sourceId: z36.string(),
|
|
6267
|
+
tsHour: z36.string(),
|
|
6268
|
+
botId: z36.string(),
|
|
6269
|
+
operator: z36.string(),
|
|
6270
|
+
verificationStatus: z36.string(),
|
|
6271
|
+
pathNormalized: z36.string(),
|
|
6272
|
+
status: z36.number().int(),
|
|
6273
|
+
hits: z36.number().int().nonnegative()
|
|
6274
|
+
});
|
|
6275
|
+
var trafficAiReferralEventEntrySchema = z36.object({
|
|
6276
|
+
kind: z36.literal(TrafficEventKinds["ai-referral"]),
|
|
6277
|
+
sourceId: z36.string(),
|
|
6278
|
+
tsHour: z36.string(),
|
|
6279
|
+
product: z36.string(),
|
|
6280
|
+
operator: z36.string(),
|
|
6281
|
+
sourceDomain: z36.string(),
|
|
6282
|
+
evidenceType: z36.string(),
|
|
6283
|
+
landingPathNormalized: z36.string(),
|
|
6284
|
+
status: z36.number().int(),
|
|
6105
6285
|
/** Total AI-referral sessions in the bucket. `paidHits + organicHits + unknownHits === hits`. */
|
|
6106
|
-
hits:
|
|
6286
|
+
hits: z36.number().int().nonnegative(),
|
|
6107
6287
|
/** Sessions carrying paid-attribution UTM evidence (`utm_medium=cpc`, …). */
|
|
6108
|
-
paidHits:
|
|
6288
|
+
paidHits: z36.number().int().nonnegative(),
|
|
6109
6289
|
/** Sessions with no paid-attribution evidence. Not proof the click was unpaid — an untagged ad click is indistinguishable. */
|
|
6110
|
-
organicHits:
|
|
6290
|
+
organicHits: z36.number().int().nonnegative(),
|
|
6111
6291
|
/**
|
|
6112
6292
|
* Sessions ingested before the classifier shipped. Their UTM tags were never
|
|
6113
6293
|
* persisted, so they can never be resolved to paid or organic. Never fold
|
|
6114
6294
|
* these into `organicHits`.
|
|
6115
6295
|
*/
|
|
6116
|
-
unknownHits:
|
|
6296
|
+
unknownHits: z36.number().int().nonnegative()
|
|
6117
6297
|
});
|
|
6118
|
-
var trafficEventEntrySchema =
|
|
6298
|
+
var trafficEventEntrySchema = z36.discriminatedUnion("kind", [
|
|
6119
6299
|
trafficCrawlerEventEntrySchema,
|
|
6120
6300
|
trafficAiUserFetchEventEntrySchema,
|
|
6121
6301
|
trafficAiReferralEventEntrySchema
|
|
6122
6302
|
]);
|
|
6123
|
-
var trafficEventsResponseSchema =
|
|
6124
|
-
windowStart:
|
|
6125
|
-
windowEnd:
|
|
6303
|
+
var trafficEventsResponseSchema = z36.object({
|
|
6304
|
+
windowStart: z36.string(),
|
|
6305
|
+
windowEnd: z36.string(),
|
|
6126
6306
|
/**
|
|
6127
6307
|
* Full-window chart data, aggregated independently from the capped detail
|
|
6128
6308
|
* rows below. This prevents dense windows from silently losing old buckets.
|
|
6129
6309
|
*/
|
|
6130
|
-
series:
|
|
6310
|
+
series: z36.object({
|
|
6131
6311
|
granularity: trafficSeriesGranularitySchema,
|
|
6132
|
-
points:
|
|
6312
|
+
points: z36.array(trafficSeriesPointSchema)
|
|
6133
6313
|
}),
|
|
6134
|
-
totals:
|
|
6314
|
+
totals: z36.object({
|
|
6135
6315
|
/** Total classified-crawler hits across the window. UNCHANGED contract. */
|
|
6136
|
-
crawlerHits:
|
|
6316
|
+
crawlerHits: z36.number().int().nonnegative(),
|
|
6137
6317
|
/** Crawler hits against content/document paths only (= `crawlerSegments.content`). */
|
|
6138
|
-
crawlerContentHits:
|
|
6318
|
+
crawlerContentHits: z36.number().int().nonnegative(),
|
|
6139
6319
|
/** Infrastructure crawler hits — sitemap + robots + asset fetches. */
|
|
6140
|
-
crawlerInfraHits:
|
|
6320
|
+
crawlerInfraHits: z36.number().int().nonnegative(),
|
|
6141
6321
|
/** Full per-class crawler-hit breakdown; the five buckets sum to `crawlerHits`. */
|
|
6142
6322
|
crawlerSegments: trafficCrawlerSegmentsSchema,
|
|
6143
|
-
aiUserFetchHits:
|
|
6323
|
+
aiUserFetchHits: z36.number().int().nonnegative(),
|
|
6144
6324
|
/** Total AI-referral sessions. The three class buckets below sum to it. */
|
|
6145
|
-
aiReferralHits:
|
|
6325
|
+
aiReferralHits: z36.number().int().nonnegative(),
|
|
6146
6326
|
/** AI-referral sessions carrying paid-attribution UTM evidence. */
|
|
6147
|
-
aiReferralPaidHits:
|
|
6327
|
+
aiReferralPaidHits: z36.number().int().nonnegative(),
|
|
6148
6328
|
/** AI-referral sessions with no paid-attribution evidence. */
|
|
6149
|
-
aiReferralOrganicHits:
|
|
6329
|
+
aiReferralOrganicHits: z36.number().int().nonnegative(),
|
|
6150
6330
|
/** AI-referral sessions ingested before the classifier shipped; unresolvable, never organic. */
|
|
6151
|
-
aiReferralUnknownHits:
|
|
6331
|
+
aiReferralUnknownHits: z36.number().int().nonnegative()
|
|
6152
6332
|
}),
|
|
6153
|
-
eventRows:
|
|
6333
|
+
eventRows: z36.object({
|
|
6154
6334
|
/** Total detail rows matching the window/source/kind filters before `limit`. */
|
|
6155
|
-
total:
|
|
6335
|
+
total: z36.number().int().nonnegative(),
|
|
6156
6336
|
/** Number of newest detail rows included in `events`. */
|
|
6157
|
-
returned:
|
|
6158
|
-
truncated:
|
|
6337
|
+
returned: z36.number().int().nonnegative(),
|
|
6338
|
+
truncated: z36.boolean()
|
|
6159
6339
|
}),
|
|
6160
|
-
events:
|
|
6340
|
+
events: z36.array(trafficEventEntrySchema)
|
|
6161
6341
|
});
|
|
6162
6342
|
|
|
6163
6343
|
// ../contracts/src/traffic-path.ts
|
|
@@ -6296,71 +6476,71 @@ function sumInfraHits(segments) {
|
|
|
6296
6476
|
}
|
|
6297
6477
|
|
|
6298
6478
|
// ../contracts/src/research.ts
|
|
6299
|
-
import { z as
|
|
6300
|
-
var researchRunStatusSchema =
|
|
6479
|
+
import { z as z37 } from "zod";
|
|
6480
|
+
var researchRunStatusSchema = z37.enum(["queued", "running", "completed", "partial", "failed"]);
|
|
6301
6481
|
var ResearchRunStatuses = researchRunStatusSchema.enum;
|
|
6302
|
-
var researchQueryStatusSchema =
|
|
6482
|
+
var researchQueryStatusSchema = z37.enum(["queued", "running", "completed", "failed"]);
|
|
6303
6483
|
var ResearchQueryStatuses = researchQueryStatusSchema.enum;
|
|
6304
|
-
var researchRunCreateSchema =
|
|
6305
|
-
queries:
|
|
6306
|
-
provider:
|
|
6307
|
-
model:
|
|
6484
|
+
var researchRunCreateSchema = z37.object({
|
|
6485
|
+
queries: z37.array(z37.string().trim().min(1).max(4e3)).min(1).max(50),
|
|
6486
|
+
provider: z37.string().trim().min(1).optional(),
|
|
6487
|
+
model: z37.string().trim().min(1).max(200).optional(),
|
|
6308
6488
|
location: locationContextSchema.nullable().optional(),
|
|
6309
|
-
idempotencyKey:
|
|
6489
|
+
idempotencyKey: z37.string().trim().min(1).max(128).optional()
|
|
6310
6490
|
}).superRefine((value, ctx) => {
|
|
6311
|
-
if (value.model && !value.provider) ctx.addIssue({ code:
|
|
6491
|
+
if (value.model && !value.provider) ctx.addIssue({ code: z37.ZodIssueCode.custom, path: ["provider"], message: "provider is required when model is supplied" });
|
|
6312
6492
|
});
|
|
6313
|
-
var researchRunSummarySchema =
|
|
6314
|
-
id:
|
|
6315
|
-
projectId:
|
|
6493
|
+
var researchRunSummarySchema = z37.object({
|
|
6494
|
+
id: z37.string(),
|
|
6495
|
+
projectId: z37.string(),
|
|
6316
6496
|
status: researchRunStatusSchema,
|
|
6317
|
-
provider:
|
|
6318
|
-
requestedModel:
|
|
6319
|
-
resolvedModel:
|
|
6497
|
+
provider: z37.string(),
|
|
6498
|
+
requestedModel: z37.string().nullable(),
|
|
6499
|
+
resolvedModel: z37.string(),
|
|
6320
6500
|
location: locationContextSchema.nullable(),
|
|
6321
|
-
totalQueries:
|
|
6322
|
-
completedQueries:
|
|
6323
|
-
failedQueries:
|
|
6324
|
-
error:
|
|
6325
|
-
startedAt:
|
|
6326
|
-
finishedAt:
|
|
6327
|
-
createdAt:
|
|
6328
|
-
});
|
|
6329
|
-
var researchRunQuerySchema =
|
|
6330
|
-
id:
|
|
6331
|
-
position:
|
|
6332
|
-
query:
|
|
6501
|
+
totalQueries: z37.number().int(),
|
|
6502
|
+
completedQueries: z37.number().int(),
|
|
6503
|
+
failedQueries: z37.number().int(),
|
|
6504
|
+
error: z37.string().nullable(),
|
|
6505
|
+
startedAt: z37.string().nullable(),
|
|
6506
|
+
finishedAt: z37.string().nullable(),
|
|
6507
|
+
createdAt: z37.string()
|
|
6508
|
+
});
|
|
6509
|
+
var researchRunQuerySchema = z37.object({
|
|
6510
|
+
id: z37.string(),
|
|
6511
|
+
position: z37.number().int(),
|
|
6512
|
+
query: z37.string(),
|
|
6333
6513
|
status: researchQueryStatusSchema,
|
|
6334
|
-
requestedModel:
|
|
6335
|
-
resolvedModel:
|
|
6336
|
-
servedModel:
|
|
6337
|
-
answerText:
|
|
6338
|
-
groundingSources:
|
|
6339
|
-
citedDomains:
|
|
6340
|
-
searchQueries:
|
|
6341
|
-
answerMentioned:
|
|
6514
|
+
requestedModel: z37.string().nullable(),
|
|
6515
|
+
resolvedModel: z37.string(),
|
|
6516
|
+
servedModel: z37.string().nullable(),
|
|
6517
|
+
answerText: z37.string().nullable(),
|
|
6518
|
+
groundingSources: z37.array(groundingSourceSchema),
|
|
6519
|
+
citedDomains: z37.array(z37.string()),
|
|
6520
|
+
searchQueries: z37.array(z37.string()),
|
|
6521
|
+
answerMentioned: z37.boolean().nullable(),
|
|
6342
6522
|
citationState: citationStateSchema.nullable(),
|
|
6343
|
-
error:
|
|
6344
|
-
startedAt:
|
|
6345
|
-
finishedAt:
|
|
6346
|
-
createdAt:
|
|
6523
|
+
error: z37.string().nullable(),
|
|
6524
|
+
startedAt: z37.string().nullable(),
|
|
6525
|
+
finishedAt: z37.string().nullable(),
|
|
6526
|
+
createdAt: z37.string()
|
|
6347
6527
|
});
|
|
6348
|
-
var researchRunDetailSchema = researchRunSummarySchema.extend({ queries:
|
|
6349
|
-
var researchRunListSchema =
|
|
6528
|
+
var researchRunDetailSchema = researchRunSummarySchema.extend({ queries: z37.array(researchRunQuerySchema) });
|
|
6529
|
+
var researchRunListSchema = z37.object({ runs: z37.array(researchRunSummarySchema) });
|
|
6350
6530
|
|
|
6351
6531
|
// ../contracts/src/statistics.ts
|
|
6352
6532
|
function round(value, dp = 4) {
|
|
6353
6533
|
const f = 10 ** dp;
|
|
6354
6534
|
return (Math.round(value * f) + 0) / f;
|
|
6355
6535
|
}
|
|
6356
|
-
function wilsonInterval(successes, n,
|
|
6536
|
+
function wilsonInterval(successes, n, z39 = 1.96) {
|
|
6357
6537
|
if (!Number.isFinite(n) || n <= 0) return null;
|
|
6358
6538
|
const s = Math.max(0, Math.min(successes, n));
|
|
6359
6539
|
const p = s / n;
|
|
6360
|
-
const z210 =
|
|
6540
|
+
const z210 = z39 * z39;
|
|
6361
6541
|
const denom = 1 + z210 / n;
|
|
6362
6542
|
const center = (p + z210 / (2 * n)) / denom;
|
|
6363
|
-
const margin =
|
|
6543
|
+
const margin = z39 / denom * Math.sqrt(p * (1 - p) / n + z210 / (4 * n * n));
|
|
6364
6544
|
return {
|
|
6365
6545
|
low: round(Math.max(0, center - margin)),
|
|
6366
6546
|
high: round(Math.min(1, center + margin))
|
|
@@ -6368,211 +6548,211 @@ function wilsonInterval(successes, n, z38 = 1.96) {
|
|
|
6368
6548
|
}
|
|
6369
6549
|
|
|
6370
6550
|
// ../contracts/src/ads.ts
|
|
6371
|
-
import { z as
|
|
6551
|
+
import { z as z38 } from "zod";
|
|
6372
6552
|
var AdsReviewStatuses = {
|
|
6373
6553
|
approved: "approved"
|
|
6374
6554
|
};
|
|
6375
6555
|
var AdsIntegrityDecisions = {
|
|
6376
6556
|
allowed: "allowed"
|
|
6377
6557
|
};
|
|
6378
|
-
var adsConnectRequestSchema =
|
|
6558
|
+
var adsConnectRequestSchema = z38.object({
|
|
6379
6559
|
/** Ads Manager "SDK key" scoped to one ad account. Stored in config.yaml, never the DB. */
|
|
6380
|
-
apiKey:
|
|
6381
|
-
});
|
|
6382
|
-
var adsAccountDtoSchema =
|
|
6383
|
-
id:
|
|
6384
|
-
name:
|
|
6385
|
-
status:
|
|
6386
|
-
currencyCode:
|
|
6387
|
-
timezone:
|
|
6388
|
-
url:
|
|
6389
|
-
reviewStatus:
|
|
6390
|
-
integrityReviewStatus:
|
|
6391
|
-
integrityDecision:
|
|
6392
|
-
});
|
|
6393
|
-
var adsGeoSearchQuerySchema =
|
|
6394
|
-
q:
|
|
6395
|
-
limit:
|
|
6396
|
-
});
|
|
6397
|
-
var adsGeoLocationDtoSchema =
|
|
6398
|
-
id:
|
|
6399
|
-
type:
|
|
6400
|
-
canonicalName:
|
|
6401
|
-
countryCode:
|
|
6402
|
-
name:
|
|
6403
|
-
regionCode:
|
|
6404
|
-
});
|
|
6405
|
-
var adsGeoSearchResponseSchema =
|
|
6406
|
-
count:
|
|
6407
|
-
query:
|
|
6408
|
-
results:
|
|
6409
|
-
});
|
|
6410
|
-
var adsConversionPixelDtoSchema =
|
|
6411
|
-
id:
|
|
6412
|
-
clientType:
|
|
6413
|
-
name:
|
|
6414
|
-
pixelId:
|
|
6415
|
-
});
|
|
6416
|
-
var adsConversionPixelListResponseSchema =
|
|
6417
|
-
pixels:
|
|
6418
|
-
});
|
|
6419
|
-
var adsConversionEventSettingSourceDtoSchema =
|
|
6420
|
-
id:
|
|
6421
|
-
name:
|
|
6422
|
-
});
|
|
6423
|
-
var adsConversionEventSettingDtoSchema =
|
|
6424
|
-
id:
|
|
6425
|
-
name:
|
|
6426
|
-
eventType:
|
|
6427
|
-
customEventName:
|
|
6428
|
-
attributionWindowDays:
|
|
6429
|
-
adAccountId:
|
|
6430
|
-
sourceIds:
|
|
6431
|
-
sources:
|
|
6432
|
-
archived:
|
|
6433
|
-
version:
|
|
6434
|
-
});
|
|
6435
|
-
var adsConversionEventSettingListResponseSchema =
|
|
6436
|
-
eventSettings:
|
|
6437
|
-
});
|
|
6438
|
-
var adsConnectionStatusDtoSchema =
|
|
6439
|
-
connected:
|
|
6440
|
-
adAccountId:
|
|
6441
|
-
displayName:
|
|
6442
|
-
currencyCode:
|
|
6443
|
-
timezone:
|
|
6444
|
-
status:
|
|
6445
|
-
reviewStatus:
|
|
6446
|
-
integrityReviewStatus:
|
|
6447
|
-
integrityDecision:
|
|
6448
|
-
lastSyncedAt:
|
|
6560
|
+
apiKey: z38.string().min(1)
|
|
6561
|
+
});
|
|
6562
|
+
var adsAccountDtoSchema = z38.object({
|
|
6563
|
+
id: z38.string(),
|
|
6564
|
+
name: z38.string(),
|
|
6565
|
+
status: z38.string(),
|
|
6566
|
+
currencyCode: z38.string().nullable(),
|
|
6567
|
+
timezone: z38.string().nullable(),
|
|
6568
|
+
url: z38.string().nullable(),
|
|
6569
|
+
reviewStatus: z38.string().nullable(),
|
|
6570
|
+
integrityReviewStatus: z38.string().nullable(),
|
|
6571
|
+
integrityDecision: z38.string().nullable()
|
|
6572
|
+
});
|
|
6573
|
+
var adsGeoSearchQuerySchema = z38.object({
|
|
6574
|
+
q: z38.string().trim().min(1).max(200),
|
|
6575
|
+
limit: z38.number().int().min(1).max(100).default(20)
|
|
6576
|
+
});
|
|
6577
|
+
var adsGeoLocationDtoSchema = z38.object({
|
|
6578
|
+
id: z38.string(),
|
|
6579
|
+
type: z38.string(),
|
|
6580
|
+
canonicalName: z38.string(),
|
|
6581
|
+
countryCode: z38.string(),
|
|
6582
|
+
name: z38.string(),
|
|
6583
|
+
regionCode: z38.string().nullable()
|
|
6584
|
+
});
|
|
6585
|
+
var adsGeoSearchResponseSchema = z38.object({
|
|
6586
|
+
count: z38.number().int().nonnegative(),
|
|
6587
|
+
query: z38.string(),
|
|
6588
|
+
results: z38.array(adsGeoLocationDtoSchema)
|
|
6589
|
+
});
|
|
6590
|
+
var adsConversionPixelDtoSchema = z38.object({
|
|
6591
|
+
id: z38.string(),
|
|
6592
|
+
clientType: z38.string().optional(),
|
|
6593
|
+
name: z38.string().optional(),
|
|
6594
|
+
pixelId: z38.string().optional()
|
|
6595
|
+
});
|
|
6596
|
+
var adsConversionPixelListResponseSchema = z38.object({
|
|
6597
|
+
pixels: z38.array(adsConversionPixelDtoSchema)
|
|
6598
|
+
});
|
|
6599
|
+
var adsConversionEventSettingSourceDtoSchema = z38.object({
|
|
6600
|
+
id: z38.string(),
|
|
6601
|
+
name: z38.string().optional()
|
|
6602
|
+
});
|
|
6603
|
+
var adsConversionEventSettingDtoSchema = z38.object({
|
|
6604
|
+
id: z38.string(),
|
|
6605
|
+
name: z38.string().optional(),
|
|
6606
|
+
eventType: z38.string().optional(),
|
|
6607
|
+
customEventName: z38.string().nullable().optional(),
|
|
6608
|
+
attributionWindowDays: z38.number().int().positive().optional(),
|
|
6609
|
+
adAccountId: z38.string().optional(),
|
|
6610
|
+
sourceIds: z38.array(z38.string()).optional(),
|
|
6611
|
+
sources: z38.array(adsConversionEventSettingSourceDtoSchema).optional(),
|
|
6612
|
+
archived: z38.boolean().optional(),
|
|
6613
|
+
version: z38.number().int().nonnegative().optional()
|
|
6614
|
+
});
|
|
6615
|
+
var adsConversionEventSettingListResponseSchema = z38.object({
|
|
6616
|
+
eventSettings: z38.array(adsConversionEventSettingDtoSchema)
|
|
6617
|
+
});
|
|
6618
|
+
var adsConnectionStatusDtoSchema = z38.object({
|
|
6619
|
+
connected: z38.boolean(),
|
|
6620
|
+
adAccountId: z38.string().nullable().optional(),
|
|
6621
|
+
displayName: z38.string().nullable().optional(),
|
|
6622
|
+
currencyCode: z38.string().nullable().optional(),
|
|
6623
|
+
timezone: z38.string().nullable().optional(),
|
|
6624
|
+
status: z38.string().nullable().optional(),
|
|
6625
|
+
reviewStatus: z38.string().nullable().optional(),
|
|
6626
|
+
integrityReviewStatus: z38.string().nullable().optional(),
|
|
6627
|
+
integrityDecision: z38.string().nullable().optional(),
|
|
6628
|
+
lastSyncedAt: z38.string().nullable().optional(),
|
|
6449
6629
|
/** Whether the ad account has OpenAI conversion tracking (pixel or CAPI) configured,
|
|
6450
6630
|
* detected from synced campaigns carrying conversion_event_setting_ids. Optional:
|
|
6451
6631
|
* only present when connected. */
|
|
6452
|
-
conversionTrackingConfigured:
|
|
6632
|
+
conversionTrackingConfigured: z38.boolean().optional()
|
|
6453
6633
|
});
|
|
6454
|
-
var adsDisconnectResponseSchema =
|
|
6455
|
-
disconnected:
|
|
6634
|
+
var adsDisconnectResponseSchema = z38.object({
|
|
6635
|
+
disconnected: z38.boolean()
|
|
6456
6636
|
});
|
|
6457
|
-
var adsSyncResponseSchema =
|
|
6458
|
-
runId:
|
|
6459
|
-
status:
|
|
6637
|
+
var adsSyncResponseSchema = z38.object({
|
|
6638
|
+
runId: z38.string(),
|
|
6639
|
+
status: z38.string()
|
|
6460
6640
|
});
|
|
6461
|
-
var adsCreativeDtoSchema =
|
|
6462
|
-
type:
|
|
6463
|
-
title:
|
|
6464
|
-
body:
|
|
6465
|
-
targetUrl:
|
|
6466
|
-
fileId:
|
|
6641
|
+
var adsCreativeDtoSchema = z38.object({
|
|
6642
|
+
type: z38.string().nullable().optional(),
|
|
6643
|
+
title: z38.string().nullable().optional(),
|
|
6644
|
+
body: z38.string().nullable().optional(),
|
|
6645
|
+
targetUrl: z38.string().nullable().optional(),
|
|
6646
|
+
fileId: z38.string().nullable().optional()
|
|
6467
6647
|
});
|
|
6468
|
-
var adsCampaignBiddingTypeSchema =
|
|
6648
|
+
var adsCampaignBiddingTypeSchema = z38.enum(["impressions", "clicks"]);
|
|
6469
6649
|
var AdsCampaignBiddingTypes = adsCampaignBiddingTypeSchema.enum;
|
|
6470
|
-
var adsAdGroupBillingEventTypeSchema =
|
|
6650
|
+
var adsAdGroupBillingEventTypeSchema = z38.enum(["impression", "click"]);
|
|
6471
6651
|
var AdsAdGroupBillingEventTypes = adsAdGroupBillingEventTypeSchema.enum;
|
|
6472
|
-
var adsAdDtoSchema =
|
|
6473
|
-
id:
|
|
6474
|
-
adGroupId:
|
|
6475
|
-
name:
|
|
6476
|
-
status:
|
|
6477
|
-
reviewStatus:
|
|
6652
|
+
var adsAdDtoSchema = z38.object({
|
|
6653
|
+
id: z38.string(),
|
|
6654
|
+
adGroupId: z38.string(),
|
|
6655
|
+
name: z38.string(),
|
|
6656
|
+
status: z38.string(),
|
|
6657
|
+
reviewStatus: z38.string().nullable().optional(),
|
|
6478
6658
|
creative: adsCreativeDtoSchema.nullable().optional(),
|
|
6479
|
-
upstreamUpdatedAt:
|
|
6480
|
-
syncedAt:
|
|
6481
|
-
});
|
|
6482
|
-
var adsAdGroupDtoSchema =
|
|
6483
|
-
id:
|
|
6484
|
-
campaignId:
|
|
6485
|
-
name:
|
|
6486
|
-
description:
|
|
6487
|
-
status:
|
|
6488
|
-
billingEventType:
|
|
6489
|
-
maxBidMicros:
|
|
6659
|
+
upstreamUpdatedAt: z38.number().int().nullable().optional(),
|
|
6660
|
+
syncedAt: z38.string().optional()
|
|
6661
|
+
});
|
|
6662
|
+
var adsAdGroupDtoSchema = z38.object({
|
|
6663
|
+
id: z38.string(),
|
|
6664
|
+
campaignId: z38.string(),
|
|
6665
|
+
name: z38.string(),
|
|
6666
|
+
description: z38.string().nullable().optional(),
|
|
6667
|
+
status: z38.string(),
|
|
6668
|
+
billingEventType: z38.union([adsAdGroupBillingEventTypeSchema, z38.null()]).optional(),
|
|
6669
|
+
maxBidMicros: z38.number().int().nullable().optional(),
|
|
6490
6670
|
/**
|
|
6491
6671
|
* The targeting primitive: entries are multi-line strings of
|
|
6492
6672
|
* newline-separated example queries (the live Ads Manager format).
|
|
6493
6673
|
*/
|
|
6494
|
-
contextHints:
|
|
6495
|
-
ads:
|
|
6496
|
-
upstreamUpdatedAt:
|
|
6497
|
-
syncedAt:
|
|
6498
|
-
});
|
|
6499
|
-
var adsCampaignDtoSchema =
|
|
6500
|
-
id:
|
|
6501
|
-
name:
|
|
6502
|
-
description:
|
|
6503
|
-
status:
|
|
6504
|
-
startTime:
|
|
6505
|
-
endTime:
|
|
6506
|
-
biddingType:
|
|
6507
|
-
dailySpendLimitMicros:
|
|
6508
|
-
lifetimeSpendLimitMicros:
|
|
6509
|
-
conversionEventSettingIds:
|
|
6510
|
-
locationIds:
|
|
6511
|
-
adGroups:
|
|
6512
|
-
upstreamUpdatedAt:
|
|
6513
|
-
syncedAt:
|
|
6514
|
-
});
|
|
6515
|
-
var adsCampaignListResponseSchema =
|
|
6516
|
-
campaigns:
|
|
6517
|
-
});
|
|
6518
|
-
var adsInsightLevelSchema =
|
|
6674
|
+
contextHints: z38.array(z38.string()).default([]),
|
|
6675
|
+
ads: z38.array(adsAdDtoSchema).default([]),
|
|
6676
|
+
upstreamUpdatedAt: z38.number().int().nullable().optional(),
|
|
6677
|
+
syncedAt: z38.string().optional()
|
|
6678
|
+
});
|
|
6679
|
+
var adsCampaignDtoSchema = z38.object({
|
|
6680
|
+
id: z38.string(),
|
|
6681
|
+
name: z38.string(),
|
|
6682
|
+
description: z38.string().nullable().optional(),
|
|
6683
|
+
status: z38.string(),
|
|
6684
|
+
startTime: z38.number().int().nullable().optional(),
|
|
6685
|
+
endTime: z38.number().int().nullable().optional(),
|
|
6686
|
+
biddingType: z38.union([adsCampaignBiddingTypeSchema, z38.null()]).optional(),
|
|
6687
|
+
dailySpendLimitMicros: z38.number().int().nullable().optional(),
|
|
6688
|
+
lifetimeSpendLimitMicros: z38.number().int().nullable().optional(),
|
|
6689
|
+
conversionEventSettingIds: z38.array(z38.string()).default([]),
|
|
6690
|
+
locationIds: z38.array(z38.string()).optional(),
|
|
6691
|
+
adGroups: z38.array(adsAdGroupDtoSchema).default([]),
|
|
6692
|
+
upstreamUpdatedAt: z38.number().int().nullable().optional(),
|
|
6693
|
+
syncedAt: z38.string().optional()
|
|
6694
|
+
});
|
|
6695
|
+
var adsCampaignListResponseSchema = z38.object({
|
|
6696
|
+
campaigns: z38.array(adsCampaignDtoSchema)
|
|
6697
|
+
});
|
|
6698
|
+
var adsInsightLevelSchema = z38.enum(["campaign", "ad_group"]);
|
|
6519
6699
|
var AdsInsightLevels = adsInsightLevelSchema.enum;
|
|
6520
|
-
var adsInsightRowDtoSchema =
|
|
6700
|
+
var adsInsightRowDtoSchema = z38.object({
|
|
6521
6701
|
level: adsInsightLevelSchema,
|
|
6522
|
-
entityId:
|
|
6523
|
-
date:
|
|
6524
|
-
impressions:
|
|
6525
|
-
clicks:
|
|
6526
|
-
spendMicros:
|
|
6702
|
+
entityId: z38.string(),
|
|
6703
|
+
date: z38.string(),
|
|
6704
|
+
impressions: z38.number().int(),
|
|
6705
|
+
clicks: z38.number().int(),
|
|
6706
|
+
spendMicros: z38.number().int(),
|
|
6527
6707
|
/** Conversion count for the row. 0 when conversion tracking is not configured.
|
|
6528
6708
|
* Conversion VALUE (for ROAS) is a deliberate follow-up: the upstream value
|
|
6529
6709
|
* field is not yet captured against a live conversion-tracking account. */
|
|
6530
|
-
conversions:
|
|
6710
|
+
conversions: z38.number().int(),
|
|
6531
6711
|
/** clicks / impressions; null when impressions is 0. */
|
|
6532
|
-
ctr:
|
|
6712
|
+
ctr: z38.number().nullable(),
|
|
6533
6713
|
/** spendMicros / clicks, rounded to integer micros; null when clicks is 0. */
|
|
6534
|
-
cpcMicros:
|
|
6714
|
+
cpcMicros: z38.number().int().nullable()
|
|
6535
6715
|
});
|
|
6536
|
-
var adsInsightsResponseSchema =
|
|
6537
|
-
rows:
|
|
6716
|
+
var adsInsightsResponseSchema = z38.object({
|
|
6717
|
+
rows: z38.array(adsInsightRowDtoSchema),
|
|
6538
6718
|
/** Account currency for rendering spend/cpc; null before the first sync. */
|
|
6539
|
-
currencyCode:
|
|
6540
|
-
});
|
|
6541
|
-
var adsTotalsDtoSchema =
|
|
6542
|
-
impressions:
|
|
6543
|
-
clicks:
|
|
6544
|
-
spendMicros:
|
|
6545
|
-
conversions:
|
|
6546
|
-
ctr:
|
|
6547
|
-
cpcMicros:
|
|
6548
|
-
});
|
|
6549
|
-
var adsSummaryDtoSchema =
|
|
6550
|
-
connected:
|
|
6551
|
-
displayName:
|
|
6552
|
-
currencyCode:
|
|
6553
|
-
lastSyncedAt:
|
|
6554
|
-
campaignCount:
|
|
6555
|
-
adGroupCount:
|
|
6556
|
-
adCount:
|
|
6719
|
+
currencyCode: z38.string().nullable().optional()
|
|
6720
|
+
});
|
|
6721
|
+
var adsTotalsDtoSchema = z38.object({
|
|
6722
|
+
impressions: z38.number().int(),
|
|
6723
|
+
clicks: z38.number().int(),
|
|
6724
|
+
spendMicros: z38.number().int(),
|
|
6725
|
+
conversions: z38.number().int(),
|
|
6726
|
+
ctr: z38.number().nullable(),
|
|
6727
|
+
cpcMicros: z38.number().int().nullable()
|
|
6728
|
+
});
|
|
6729
|
+
var adsSummaryDtoSchema = z38.object({
|
|
6730
|
+
connected: z38.boolean(),
|
|
6731
|
+
displayName: z38.string().nullable().optional(),
|
|
6732
|
+
currencyCode: z38.string().nullable().optional(),
|
|
6733
|
+
lastSyncedAt: z38.string().nullable().optional(),
|
|
6734
|
+
campaignCount: z38.number().int(),
|
|
6735
|
+
adGroupCount: z38.number().int(),
|
|
6736
|
+
adCount: z38.number().int(),
|
|
6557
6737
|
/** Date range the totals cover (oldest/newest rollup date), null when empty. */
|
|
6558
|
-
window:
|
|
6559
|
-
from:
|
|
6560
|
-
to:
|
|
6738
|
+
window: z38.object({
|
|
6739
|
+
from: z38.string().nullable(),
|
|
6740
|
+
to: z38.string().nullable()
|
|
6561
6741
|
}),
|
|
6562
6742
|
/** Campaign-level rollup totals over the window (levels are not summed across). */
|
|
6563
6743
|
totals: adsTotalsDtoSchema
|
|
6564
6744
|
});
|
|
6565
|
-
var adsOperationKeySchema =
|
|
6566
|
-
var adsEntityIdSchema =
|
|
6567
|
-
var adsNameSchema =
|
|
6568
|
-
var adsTimestampSchema =
|
|
6569
|
-
var adsMicrosSchema =
|
|
6570
|
-
var adsSha256Schema =
|
|
6571
|
-
var adsConversionEventSettingIdsSchema =
|
|
6572
|
-
var adsHttpsUrlSchema =
|
|
6745
|
+
var adsOperationKeySchema = z38.string().min(8).max(128).regex(/^[\w.:-]+$/, "operationKey may contain letters, numbers, dot, underscore, colon, and hyphen");
|
|
6746
|
+
var adsEntityIdSchema = z38.string().min(1).max(200);
|
|
6747
|
+
var adsNameSchema = z38.string().min(3).max(1e3).refine((value) => value.trim().length > 0);
|
|
6748
|
+
var adsTimestampSchema = z38.number().int().min(946684800).max(4102444800);
|
|
6749
|
+
var adsMicrosSchema = z38.number().int().positive().max(Number.MAX_SAFE_INTEGER);
|
|
6750
|
+
var adsSha256Schema = z38.string().regex(/^[a-f0-9]{64}$/);
|
|
6751
|
+
var adsConversionEventSettingIdsSchema = z38.array(adsEntityIdSchema).max(100).refine((ids) => new Set(ids).size === ids.length, "conversionEventSettingIds must be unique");
|
|
6752
|
+
var adsHttpsUrlSchema = z38.string().url().refine((value) => new URL(value).protocol === "https:", {
|
|
6573
6753
|
message: "URL must use https"
|
|
6574
6754
|
});
|
|
6575
|
-
var adsOperationKindSchema =
|
|
6755
|
+
var adsOperationKindSchema = z38.enum([
|
|
6576
6756
|
"image_upload",
|
|
6577
6757
|
"campaign_create",
|
|
6578
6758
|
"campaign_update",
|
|
@@ -6586,33 +6766,33 @@ var adsOperationKindSchema = z37.enum([
|
|
|
6586
6766
|
"ad_pause"
|
|
6587
6767
|
]);
|
|
6588
6768
|
var AdsOperationKinds = adsOperationKindSchema.enum;
|
|
6589
|
-
var adsOperationStateSchema =
|
|
6769
|
+
var adsOperationStateSchema = z38.enum(["pending", "reconciling", "succeeded", "failed", "unknown"]);
|
|
6590
6770
|
var AdsOperationStates = adsOperationStateSchema.enum;
|
|
6591
|
-
var adsReconcileStrategySchema =
|
|
6771
|
+
var adsReconcileStrategySchema = z38.enum(["known_entity", "create_fingerprint", "manual_only"]);
|
|
6592
6772
|
var AdsReconcileStrategies = adsReconcileStrategySchema.enum;
|
|
6593
|
-
var adsUnresolvedOperationStateSchema =
|
|
6773
|
+
var adsUnresolvedOperationStateSchema = z38.enum([
|
|
6594
6774
|
AdsOperationStates.pending,
|
|
6595
6775
|
AdsOperationStates.unknown,
|
|
6596
6776
|
AdsOperationStates.reconciling
|
|
6597
6777
|
]);
|
|
6598
6778
|
var AdsUnresolvedOperationStates = adsUnresolvedOperationStateSchema.enum;
|
|
6599
|
-
var adsEntityStatusSchema =
|
|
6779
|
+
var adsEntityStatusSchema = z38.enum(["active", "paused", "archived"]);
|
|
6600
6780
|
var AdsEntityStatuses = adsEntityStatusSchema.enum;
|
|
6601
|
-
var adsEntityTypeSchema =
|
|
6781
|
+
var adsEntityTypeSchema = z38.enum(["file", "campaign", "ad_group", "ad"]);
|
|
6602
6782
|
var AdsEntityTypes = adsEntityTypeSchema.enum;
|
|
6603
|
-
var adsActivationEntityTypeSchema =
|
|
6783
|
+
var adsActivationEntityTypeSchema = z38.enum(["campaign", "ad_group", "ad"]);
|
|
6604
6784
|
var AdsActivationEntityTypes = adsActivationEntityTypeSchema.enum;
|
|
6605
|
-
var adsActivationEntityRefSchema =
|
|
6785
|
+
var adsActivationEntityRefSchema = z38.object({
|
|
6606
6786
|
id: adsEntityIdSchema,
|
|
6607
|
-
expectedUpdatedAt:
|
|
6787
|
+
expectedUpdatedAt: z38.number().int().nonnegative()
|
|
6608
6788
|
}).strict();
|
|
6609
6789
|
var adsActivationAdSchema = adsActivationEntityRefSchema;
|
|
6610
6790
|
var ADS_ACTIVATION_MAX_ENTITIES = 100;
|
|
6611
6791
|
var adsActivationAdGroupSchema = adsActivationEntityRefSchema.extend({
|
|
6612
|
-
ads:
|
|
6792
|
+
ads: z38.array(adsActivationAdSchema).min(1).max(ADS_ACTIVATION_MAX_ENTITIES - 1)
|
|
6613
6793
|
}).strict();
|
|
6614
6794
|
var adsActivationCampaignSchema = adsActivationEntityRefSchema.extend({
|
|
6615
|
-
adGroups:
|
|
6795
|
+
adGroups: z38.array(adsActivationAdGroupSchema).min(1).max(ADS_ACTIVATION_MAX_ENTITIES - 1)
|
|
6616
6796
|
}).strict();
|
|
6617
6797
|
function compareAdsActivationEntityIds(left, right) {
|
|
6618
6798
|
if (left < right) return -1;
|
|
@@ -6631,7 +6811,7 @@ function addCanonicalEntityOrderIssue(items, path, ctx) {
|
|
|
6631
6811
|
}
|
|
6632
6812
|
}
|
|
6633
6813
|
}
|
|
6634
|
-
var adsActivationManifestSchema =
|
|
6814
|
+
var adsActivationManifestSchema = z38.object({
|
|
6635
6815
|
campaign: adsActivationCampaignSchema
|
|
6636
6816
|
}).strict().superRefine((manifest, ctx) => {
|
|
6637
6817
|
const entityCount = 1 + manifest.campaign.adGroups.reduce(
|
|
@@ -6677,7 +6857,7 @@ function canonicalizeAdsActivationManifest(manifest) {
|
|
|
6677
6857
|
};
|
|
6678
6858
|
}
|
|
6679
6859
|
var adsActivationManifestHashSchema = adsSha256Schema;
|
|
6680
|
-
var adsActivationGrantStateSchema =
|
|
6860
|
+
var adsActivationGrantStateSchema = z38.enum([
|
|
6681
6861
|
"approved",
|
|
6682
6862
|
"executing",
|
|
6683
6863
|
"consumed",
|
|
@@ -6686,7 +6866,7 @@ var adsActivationGrantStateSchema = z37.enum([
|
|
|
6686
6866
|
"unknown"
|
|
6687
6867
|
]);
|
|
6688
6868
|
var AdsActivationGrantStates = adsActivationGrantStateSchema.enum;
|
|
6689
|
-
var adsOperationStepStateSchema =
|
|
6869
|
+
var adsOperationStepStateSchema = z38.enum([
|
|
6690
6870
|
"pending",
|
|
6691
6871
|
"executing",
|
|
6692
6872
|
"active",
|
|
@@ -6697,35 +6877,35 @@ var adsOperationStepStateSchema = z37.enum([
|
|
|
6697
6877
|
"unknown"
|
|
6698
6878
|
]);
|
|
6699
6879
|
var AdsOperationStepStates = adsOperationStepStateSchema.enum;
|
|
6700
|
-
var adsReconcileFieldsSchema =
|
|
6880
|
+
var adsReconcileFieldsSchema = z38.object({
|
|
6701
6881
|
name: adsNameSchema.optional(),
|
|
6702
|
-
description:
|
|
6882
|
+
description: z38.string().max(4e3).nullable().optional(),
|
|
6703
6883
|
status: adsEntityStatusSchema.optional(),
|
|
6704
6884
|
startTime: adsTimestampSchema.nullable().optional(),
|
|
6705
6885
|
endTime: adsTimestampSchema.nullable().optional(),
|
|
6706
6886
|
lifetimeSpendLimitMicros: adsMicrosSchema.min(1e6).optional(),
|
|
6707
|
-
locationIds:
|
|
6887
|
+
locationIds: z38.array(adsEntityIdSchema).max(100).optional(),
|
|
6708
6888
|
biddingType: adsCampaignBiddingTypeSchema.optional(),
|
|
6709
6889
|
conversionEventSettingIds: adsConversionEventSettingIdsSchema.optional(),
|
|
6710
6890
|
campaignId: adsEntityIdSchema.optional(),
|
|
6711
|
-
contextHints:
|
|
6891
|
+
contextHints: z38.array(z38.string().min(1).max(1e3)).max(100).optional(),
|
|
6712
6892
|
maxBidMicros: adsMicrosSchema.max(1e8).optional(),
|
|
6713
6893
|
billingEventType: adsAdGroupBillingEventTypeSchema.optional(),
|
|
6714
6894
|
adGroupId: adsEntityIdSchema.optional(),
|
|
6715
6895
|
creativeFingerprint: adsSha256Schema.optional()
|
|
6716
6896
|
}).strict();
|
|
6717
|
-
var adsImageUploadRequestSchema =
|
|
6897
|
+
var adsImageUploadRequestSchema = z38.object({
|
|
6718
6898
|
operationKey: adsOperationKeySchema,
|
|
6719
6899
|
imageUrl: adsHttpsUrlSchema
|
|
6720
6900
|
});
|
|
6721
|
-
var adsCampaignCreateRequestSchema =
|
|
6901
|
+
var adsCampaignCreateRequestSchema = z38.object({
|
|
6722
6902
|
operationKey: adsOperationKeySchema,
|
|
6723
6903
|
name: adsNameSchema,
|
|
6724
|
-
description:
|
|
6904
|
+
description: z38.string().max(4e3).optional(),
|
|
6725
6905
|
startTime: adsTimestampSchema.optional(),
|
|
6726
6906
|
endTime: adsTimestampSchema.optional(),
|
|
6727
6907
|
lifetimeSpendLimitMicros: adsMicrosSchema.min(1e6),
|
|
6728
|
-
locationIds:
|
|
6908
|
+
locationIds: z38.array(adsEntityIdSchema).min(1).max(100),
|
|
6729
6909
|
biddingType: adsCampaignBiddingTypeSchema.optional(),
|
|
6730
6910
|
conversionEventSettingIds: adsConversionEventSettingIdsSchema.optional()
|
|
6731
6911
|
}).superRefine((value, ctx) => {
|
|
@@ -6740,22 +6920,22 @@ var adsCampaignCreateRequestSchema = z37.object({
|
|
|
6740
6920
|
});
|
|
6741
6921
|
}
|
|
6742
6922
|
});
|
|
6743
|
-
var adsAdGroupCreateRequestSchema =
|
|
6923
|
+
var adsAdGroupCreateRequestSchema = z38.object({
|
|
6744
6924
|
operationKey: adsOperationKeySchema,
|
|
6745
6925
|
campaignId: adsEntityIdSchema,
|
|
6746
6926
|
name: adsNameSchema,
|
|
6747
|
-
description:
|
|
6748
|
-
contextHints:
|
|
6927
|
+
description: z38.string().max(4e3).optional(),
|
|
6928
|
+
contextHints: z38.array(z38.string().min(1).max(1e3)).min(1).max(100),
|
|
6749
6929
|
maxBidMicros: adsMicrosSchema.max(1e8),
|
|
6750
6930
|
billingEventType: adsAdGroupBillingEventTypeSchema.optional()
|
|
6751
6931
|
});
|
|
6752
|
-
var adsChatCardCreativeRequestSchema =
|
|
6753
|
-
title:
|
|
6754
|
-
body:
|
|
6932
|
+
var adsChatCardCreativeRequestSchema = z38.object({
|
|
6933
|
+
title: z38.string().min(3).max(50),
|
|
6934
|
+
body: z38.string().min(1).max(100),
|
|
6755
6935
|
targetUrl: adsHttpsUrlSchema,
|
|
6756
6936
|
fileId: adsEntityIdSchema
|
|
6757
6937
|
});
|
|
6758
|
-
var adsAdCreateRequestSchema =
|
|
6938
|
+
var adsAdCreateRequestSchema = z38.object({
|
|
6759
6939
|
operationKey: adsOperationKeySchema,
|
|
6760
6940
|
adGroupId: adsEntityIdSchema,
|
|
6761
6941
|
name: adsNameSchema,
|
|
@@ -6764,58 +6944,58 @@ var adsAdCreateRequestSchema = z37.object({
|
|
|
6764
6944
|
function hasMutationField(value) {
|
|
6765
6945
|
return Object.keys(value).some((key) => key !== "operationKey" && key !== "expectedUpdatedAt");
|
|
6766
6946
|
}
|
|
6767
|
-
var adsCampaignUpdateRequestSchema =
|
|
6947
|
+
var adsCampaignUpdateRequestSchema = z38.object({
|
|
6768
6948
|
operationKey: adsOperationKeySchema,
|
|
6769
|
-
expectedUpdatedAt:
|
|
6949
|
+
expectedUpdatedAt: z38.number().int().nonnegative(),
|
|
6770
6950
|
name: adsNameSchema.optional(),
|
|
6771
|
-
description:
|
|
6951
|
+
description: z38.string().max(4e3).nullable().optional(),
|
|
6772
6952
|
startTime: adsTimestampSchema.nullable().optional(),
|
|
6773
6953
|
endTime: adsTimestampSchema.nullable().optional(),
|
|
6774
6954
|
lifetimeSpendLimitMicros: adsMicrosSchema.min(1e6).optional(),
|
|
6775
|
-
locationIds:
|
|
6955
|
+
locationIds: z38.array(adsEntityIdSchema).min(1).max(100).optional()
|
|
6776
6956
|
}).refine(hasMutationField, { message: "At least one campaign field must be updated" });
|
|
6777
|
-
var adsAdGroupUpdateRequestSchema =
|
|
6957
|
+
var adsAdGroupUpdateRequestSchema = z38.object({
|
|
6778
6958
|
operationKey: adsOperationKeySchema,
|
|
6779
|
-
expectedUpdatedAt:
|
|
6959
|
+
expectedUpdatedAt: z38.number().int().nonnegative(),
|
|
6780
6960
|
name: adsNameSchema.optional(),
|
|
6781
|
-
description:
|
|
6782
|
-
contextHints:
|
|
6961
|
+
description: z38.string().max(4e3).nullable().optional(),
|
|
6962
|
+
contextHints: z38.array(z38.string().min(1).max(1e3)).min(1).max(100).optional(),
|
|
6783
6963
|
maxBidMicros: adsMicrosSchema.max(1e8).optional()
|
|
6784
6964
|
}).refine(hasMutationField, { message: "At least one ad group field must be updated" });
|
|
6785
|
-
var adsAdUpdateRequestSchema =
|
|
6965
|
+
var adsAdUpdateRequestSchema = z38.object({
|
|
6786
6966
|
operationKey: adsOperationKeySchema,
|
|
6787
|
-
expectedUpdatedAt:
|
|
6967
|
+
expectedUpdatedAt: z38.number().int().nonnegative(),
|
|
6788
6968
|
name: adsNameSchema.optional(),
|
|
6789
6969
|
creative: adsChatCardCreativeRequestSchema.optional()
|
|
6790
6970
|
}).refine(hasMutationField, { message: "At least one ad field must be updated" });
|
|
6791
|
-
var adsPauseRequestSchema =
|
|
6971
|
+
var adsPauseRequestSchema = z38.object({
|
|
6792
6972
|
operationKey: adsOperationKeySchema
|
|
6793
6973
|
});
|
|
6794
|
-
var adsOperationDtoSchema =
|
|
6795
|
-
id:
|
|
6796
|
-
adAccountId:
|
|
6797
|
-
operationKey:
|
|
6974
|
+
var adsOperationDtoSchema = z38.object({
|
|
6975
|
+
id: z38.string(),
|
|
6976
|
+
adAccountId: z38.string().nullable(),
|
|
6977
|
+
operationKey: z38.string(),
|
|
6798
6978
|
kind: adsOperationKindSchema,
|
|
6799
6979
|
state: adsOperationStateSchema,
|
|
6800
|
-
entityType:
|
|
6801
|
-
entityId:
|
|
6802
|
-
upstreamUpdatedAt:
|
|
6803
|
-
errorCode:
|
|
6804
|
-
errorMessage:
|
|
6805
|
-
reconcileStrategy:
|
|
6980
|
+
entityType: z38.union([adsEntityTypeSchema, z38.null()]),
|
|
6981
|
+
entityId: z38.string().nullable(),
|
|
6982
|
+
upstreamUpdatedAt: z38.number().int().nullable(),
|
|
6983
|
+
errorCode: z38.string().nullable(),
|
|
6984
|
+
errorMessage: z38.string().nullable(),
|
|
6985
|
+
reconcileStrategy: z38.union([adsReconcileStrategySchema, z38.null()]),
|
|
6806
6986
|
reconcileParentId: adsEntityIdSchema.nullable(),
|
|
6807
6987
|
reconcileFingerprint: adsSha256Schema.nullable(),
|
|
6808
6988
|
reconcileFields: adsReconcileFieldsSchema.nullable(),
|
|
6809
|
-
reconcileAttempts:
|
|
6810
|
-
lastReconciledAt:
|
|
6811
|
-
createdAt:
|
|
6812
|
-
updatedAt:
|
|
6989
|
+
reconcileAttempts: z38.number().int().nonnegative(),
|
|
6990
|
+
lastReconciledAt: z38.string().nullable(),
|
|
6991
|
+
createdAt: z38.string(),
|
|
6992
|
+
updatedAt: z38.string()
|
|
6813
6993
|
});
|
|
6814
|
-
var adsOperationResponseSchema =
|
|
6994
|
+
var adsOperationResponseSchema = z38.object({
|
|
6815
6995
|
operation: adsOperationDtoSchema,
|
|
6816
|
-
replayed:
|
|
6996
|
+
replayed: z38.boolean()
|
|
6817
6997
|
});
|
|
6818
|
-
var adsActivationIsoTimestampSchema =
|
|
6998
|
+
var adsActivationIsoTimestampSchema = z38.iso.datetime({ offset: true });
|
|
6819
6999
|
var adsActivationGrantBaseShape = {
|
|
6820
7000
|
id: adsEntityIdSchema,
|
|
6821
7001
|
projectId: adsEntityIdSchema,
|
|
@@ -6830,61 +7010,61 @@ var adsActivationGrantBaseShape = {
|
|
|
6830
7010
|
updatedAt: adsActivationIsoTimestampSchema,
|
|
6831
7011
|
revocationRequestedAt: adsActivationIsoTimestampSchema.nullable()
|
|
6832
7012
|
};
|
|
6833
|
-
var adsActivationGrantApprovedDtoSchema =
|
|
7013
|
+
var adsActivationGrantApprovedDtoSchema = z38.object({
|
|
6834
7014
|
...adsActivationGrantBaseShape,
|
|
6835
|
-
state:
|
|
6836
|
-
operationId:
|
|
6837
|
-
executionStartedAt:
|
|
6838
|
-
consumedAt:
|
|
6839
|
-
revokedAt:
|
|
6840
|
-
expiredAt:
|
|
7015
|
+
state: z38.literal(AdsActivationGrantStates.approved),
|
|
7016
|
+
operationId: z38.null(),
|
|
7017
|
+
executionStartedAt: z38.null(),
|
|
7018
|
+
consumedAt: z38.null(),
|
|
7019
|
+
revokedAt: z38.null(),
|
|
7020
|
+
expiredAt: z38.null()
|
|
6841
7021
|
}).strict();
|
|
6842
|
-
var adsActivationGrantExecutingDtoSchema =
|
|
7022
|
+
var adsActivationGrantExecutingDtoSchema = z38.object({
|
|
6843
7023
|
...adsActivationGrantBaseShape,
|
|
6844
|
-
state:
|
|
7024
|
+
state: z38.literal(AdsActivationGrantStates.executing),
|
|
6845
7025
|
operationId: adsEntityIdSchema,
|
|
6846
7026
|
executionStartedAt: adsActivationIsoTimestampSchema,
|
|
6847
|
-
consumedAt:
|
|
6848
|
-
revokedAt:
|
|
6849
|
-
expiredAt:
|
|
7027
|
+
consumedAt: z38.null(),
|
|
7028
|
+
revokedAt: z38.null(),
|
|
7029
|
+
expiredAt: z38.null()
|
|
6850
7030
|
}).strict();
|
|
6851
|
-
var adsActivationGrantConsumedDtoSchema =
|
|
7031
|
+
var adsActivationGrantConsumedDtoSchema = z38.object({
|
|
6852
7032
|
...adsActivationGrantBaseShape,
|
|
6853
|
-
state:
|
|
7033
|
+
state: z38.literal(AdsActivationGrantStates.consumed),
|
|
6854
7034
|
operationId: adsEntityIdSchema,
|
|
6855
7035
|
executionStartedAt: adsActivationIsoTimestampSchema,
|
|
6856
7036
|
consumedAt: adsActivationIsoTimestampSchema,
|
|
6857
|
-
revokedAt:
|
|
6858
|
-
expiredAt:
|
|
7037
|
+
revokedAt: z38.null(),
|
|
7038
|
+
expiredAt: z38.null()
|
|
6859
7039
|
}).strict();
|
|
6860
|
-
var adsActivationGrantRevokedDtoSchema =
|
|
7040
|
+
var adsActivationGrantRevokedDtoSchema = z38.object({
|
|
6861
7041
|
...adsActivationGrantBaseShape,
|
|
6862
|
-
state:
|
|
6863
|
-
operationId:
|
|
6864
|
-
executionStartedAt:
|
|
6865
|
-
consumedAt:
|
|
7042
|
+
state: z38.literal(AdsActivationGrantStates.revoked),
|
|
7043
|
+
operationId: z38.null(),
|
|
7044
|
+
executionStartedAt: z38.null(),
|
|
7045
|
+
consumedAt: z38.null(),
|
|
6866
7046
|
revokedAt: adsActivationIsoTimestampSchema,
|
|
6867
|
-
expiredAt:
|
|
7047
|
+
expiredAt: z38.null()
|
|
6868
7048
|
}).strict();
|
|
6869
|
-
var adsActivationGrantExpiredDtoSchema =
|
|
7049
|
+
var adsActivationGrantExpiredDtoSchema = z38.object({
|
|
6870
7050
|
...adsActivationGrantBaseShape,
|
|
6871
|
-
state:
|
|
6872
|
-
operationId:
|
|
6873
|
-
executionStartedAt:
|
|
6874
|
-
consumedAt:
|
|
6875
|
-
revokedAt:
|
|
7051
|
+
state: z38.literal(AdsActivationGrantStates.expired),
|
|
7052
|
+
operationId: z38.null(),
|
|
7053
|
+
executionStartedAt: z38.null(),
|
|
7054
|
+
consumedAt: z38.null(),
|
|
7055
|
+
revokedAt: z38.null(),
|
|
6876
7056
|
expiredAt: adsActivationIsoTimestampSchema
|
|
6877
7057
|
}).strict();
|
|
6878
|
-
var adsActivationGrantUnknownDtoSchema =
|
|
7058
|
+
var adsActivationGrantUnknownDtoSchema = z38.object({
|
|
6879
7059
|
...adsActivationGrantBaseShape,
|
|
6880
|
-
state:
|
|
7060
|
+
state: z38.literal(AdsActivationGrantStates.unknown),
|
|
6881
7061
|
operationId: adsEntityIdSchema,
|
|
6882
7062
|
executionStartedAt: adsActivationIsoTimestampSchema,
|
|
6883
|
-
consumedAt:
|
|
6884
|
-
revokedAt:
|
|
6885
|
-
expiredAt:
|
|
7063
|
+
consumedAt: z38.null(),
|
|
7064
|
+
revokedAt: z38.null(),
|
|
7065
|
+
expiredAt: z38.null()
|
|
6886
7066
|
}).strict();
|
|
6887
|
-
var adsActivationGrantDtoSchema =
|
|
7067
|
+
var adsActivationGrantDtoSchema = z38.discriminatedUnion("state", [
|
|
6888
7068
|
adsActivationGrantApprovedDtoSchema,
|
|
6889
7069
|
adsActivationGrantExecutingDtoSchema,
|
|
6890
7070
|
adsActivationGrantConsumedDtoSchema,
|
|
@@ -6910,92 +7090,92 @@ var adsActivationGrantDtoSchema = z37.discriminatedUnion("state", [
|
|
|
6910
7090
|
var adsOperationStepBaseShape = {
|
|
6911
7091
|
id: adsEntityIdSchema,
|
|
6912
7092
|
operationId: adsEntityIdSchema,
|
|
6913
|
-
ordinal:
|
|
7093
|
+
ordinal: z38.number().int().nonnegative(),
|
|
6914
7094
|
entityType: adsActivationEntityTypeSchema,
|
|
6915
7095
|
entityId: adsEntityIdSchema,
|
|
6916
|
-
expectedUpdatedAt:
|
|
7096
|
+
expectedUpdatedAt: z38.number().int().nonnegative(),
|
|
6917
7097
|
createdAt: adsActivationIsoTimestampSchema,
|
|
6918
7098
|
updatedAt: adsActivationIsoTimestampSchema
|
|
6919
7099
|
};
|
|
6920
7100
|
var adsOperationStepNoErrorShape = {
|
|
6921
|
-
errorCode:
|
|
6922
|
-
errorMessage:
|
|
7101
|
+
errorCode: z38.null(),
|
|
7102
|
+
errorMessage: z38.null()
|
|
6923
7103
|
};
|
|
6924
7104
|
var adsOperationStepErrorShape = {
|
|
6925
|
-
errorCode:
|
|
6926
|
-
errorMessage:
|
|
6927
|
-
remediation:
|
|
7105
|
+
errorCode: z38.string().min(1).max(100),
|
|
7106
|
+
errorMessage: z38.string().min(1).max(500),
|
|
7107
|
+
remediation: z38.string().min(1).max(500)
|
|
6928
7108
|
};
|
|
6929
|
-
var adsOperationStepPendingDtoSchema =
|
|
7109
|
+
var adsOperationStepPendingDtoSchema = z38.object({
|
|
6930
7110
|
...adsOperationStepBaseShape,
|
|
6931
7111
|
...adsOperationStepNoErrorShape,
|
|
6932
|
-
state:
|
|
6933
|
-
providerUpdatedAt:
|
|
6934
|
-
remediation:
|
|
6935
|
-
startedAt:
|
|
6936
|
-
finishedAt:
|
|
7112
|
+
state: z38.literal(AdsOperationStepStates.pending),
|
|
7113
|
+
providerUpdatedAt: z38.null(),
|
|
7114
|
+
remediation: z38.null(),
|
|
7115
|
+
startedAt: z38.null(),
|
|
7116
|
+
finishedAt: z38.null()
|
|
6937
7117
|
}).strict();
|
|
6938
|
-
var adsOperationStepExecutingDtoSchema =
|
|
7118
|
+
var adsOperationStepExecutingDtoSchema = z38.object({
|
|
6939
7119
|
...adsOperationStepBaseShape,
|
|
6940
7120
|
...adsOperationStepNoErrorShape,
|
|
6941
|
-
state:
|
|
6942
|
-
providerUpdatedAt:
|
|
6943
|
-
remediation:
|
|
7121
|
+
state: z38.literal(AdsOperationStepStates.executing),
|
|
7122
|
+
providerUpdatedAt: z38.null(),
|
|
7123
|
+
remediation: z38.null(),
|
|
6944
7124
|
startedAt: adsActivationIsoTimestampSchema,
|
|
6945
|
-
finishedAt:
|
|
7125
|
+
finishedAt: z38.null()
|
|
6946
7126
|
}).strict();
|
|
6947
|
-
var adsOperationStepActiveDtoSchema =
|
|
7127
|
+
var adsOperationStepActiveDtoSchema = z38.object({
|
|
6948
7128
|
...adsOperationStepBaseShape,
|
|
6949
7129
|
...adsOperationStepNoErrorShape,
|
|
6950
|
-
state:
|
|
6951
|
-
providerUpdatedAt:
|
|
6952
|
-
remediation:
|
|
7130
|
+
state: z38.literal(AdsOperationStepStates.active),
|
|
7131
|
+
providerUpdatedAt: z38.number().int().nonnegative(),
|
|
7132
|
+
remediation: z38.null(),
|
|
6953
7133
|
startedAt: adsActivationIsoTimestampSchema,
|
|
6954
7134
|
finishedAt: adsActivationIsoTimestampSchema
|
|
6955
7135
|
}).strict();
|
|
6956
|
-
var adsOperationStepFailedDtoSchema =
|
|
7136
|
+
var adsOperationStepFailedDtoSchema = z38.object({
|
|
6957
7137
|
...adsOperationStepBaseShape,
|
|
6958
7138
|
...adsOperationStepErrorShape,
|
|
6959
|
-
state:
|
|
6960
|
-
providerUpdatedAt:
|
|
7139
|
+
state: z38.literal(AdsOperationStepStates.failed),
|
|
7140
|
+
providerUpdatedAt: z38.union([z38.number().int().nonnegative(), z38.null()]),
|
|
6961
7141
|
startedAt: adsActivationIsoTimestampSchema,
|
|
6962
7142
|
finishedAt: adsActivationIsoTimestampSchema
|
|
6963
7143
|
}).strict();
|
|
6964
|
-
var adsOperationStepRollbackExecutingDtoSchema =
|
|
7144
|
+
var adsOperationStepRollbackExecutingDtoSchema = z38.object({
|
|
6965
7145
|
...adsOperationStepBaseShape,
|
|
6966
7146
|
...adsOperationStepNoErrorShape,
|
|
6967
|
-
state:
|
|
6968
|
-
providerUpdatedAt:
|
|
6969
|
-
remediation:
|
|
7147
|
+
state: z38.literal(AdsOperationStepStates.rollback_executing),
|
|
7148
|
+
providerUpdatedAt: z38.number().int().nonnegative(),
|
|
7149
|
+
remediation: z38.string().min(1).max(500),
|
|
6970
7150
|
startedAt: adsActivationIsoTimestampSchema,
|
|
6971
|
-
finishedAt:
|
|
7151
|
+
finishedAt: z38.null()
|
|
6972
7152
|
}).strict();
|
|
6973
|
-
var adsOperationStepRolledBackDtoSchema =
|
|
7153
|
+
var adsOperationStepRolledBackDtoSchema = z38.object({
|
|
6974
7154
|
...adsOperationStepBaseShape,
|
|
6975
7155
|
...adsOperationStepNoErrorShape,
|
|
6976
|
-
state:
|
|
6977
|
-
providerUpdatedAt:
|
|
6978
|
-
remediation:
|
|
7156
|
+
state: z38.literal(AdsOperationStepStates.rolled_back),
|
|
7157
|
+
providerUpdatedAt: z38.number().int().nonnegative(),
|
|
7158
|
+
remediation: z38.string().min(1).max(500),
|
|
6979
7159
|
startedAt: adsActivationIsoTimestampSchema,
|
|
6980
7160
|
finishedAt: adsActivationIsoTimestampSchema
|
|
6981
7161
|
}).strict();
|
|
6982
|
-
var adsOperationStepRollbackFailedDtoSchema =
|
|
7162
|
+
var adsOperationStepRollbackFailedDtoSchema = z38.object({
|
|
6983
7163
|
...adsOperationStepBaseShape,
|
|
6984
7164
|
...adsOperationStepErrorShape,
|
|
6985
|
-
state:
|
|
6986
|
-
providerUpdatedAt:
|
|
7165
|
+
state: z38.literal(AdsOperationStepStates.rollback_failed),
|
|
7166
|
+
providerUpdatedAt: z38.number().int().nonnegative(),
|
|
6987
7167
|
startedAt: adsActivationIsoTimestampSchema,
|
|
6988
7168
|
finishedAt: adsActivationIsoTimestampSchema
|
|
6989
7169
|
}).strict();
|
|
6990
|
-
var adsOperationStepUnknownDtoSchema =
|
|
7170
|
+
var adsOperationStepUnknownDtoSchema = z38.object({
|
|
6991
7171
|
...adsOperationStepBaseShape,
|
|
6992
7172
|
...adsOperationStepErrorShape,
|
|
6993
|
-
state:
|
|
6994
|
-
providerUpdatedAt:
|
|
7173
|
+
state: z38.literal(AdsOperationStepStates.unknown),
|
|
7174
|
+
providerUpdatedAt: z38.union([z38.number().int().nonnegative(), z38.null()]),
|
|
6995
7175
|
startedAt: adsActivationIsoTimestampSchema,
|
|
6996
7176
|
finishedAt: adsActivationIsoTimestampSchema
|
|
6997
7177
|
}).strict();
|
|
6998
|
-
var adsOperationStepDtoSchema =
|
|
7178
|
+
var adsOperationStepDtoSchema = z38.discriminatedUnion("state", [
|
|
6999
7179
|
adsOperationStepPendingDtoSchema,
|
|
7000
7180
|
adsOperationStepExecutingDtoSchema,
|
|
7001
7181
|
adsOperationStepActiveDtoSchema,
|
|
@@ -7009,29 +7189,29 @@ var AdsActivationVersionPolicies = {
|
|
|
7009
7189
|
exact: "exact",
|
|
7010
7190
|
refreshSemanticallyUnchanged: "refresh_semantically_unchanged"
|
|
7011
7191
|
};
|
|
7012
|
-
var adsActivationVersionPolicySchema =
|
|
7192
|
+
var adsActivationVersionPolicySchema = z38.enum([
|
|
7013
7193
|
AdsActivationVersionPolicies.exact,
|
|
7014
7194
|
AdsActivationVersionPolicies.refreshSemanticallyUnchanged
|
|
7015
7195
|
]);
|
|
7016
|
-
var adsActivationGrantCreateRequestSchema =
|
|
7196
|
+
var adsActivationGrantCreateRequestSchema = z38.object({
|
|
7017
7197
|
manifest: adsActivationManifestSchema,
|
|
7018
7198
|
executorApiKeyId: adsEntityIdSchema,
|
|
7019
7199
|
expiresAt: adsActivationIsoTimestampSchema,
|
|
7020
7200
|
versionPolicy: adsActivationVersionPolicySchema.default(AdsActivationVersionPolicies.exact)
|
|
7021
7201
|
}).strict();
|
|
7022
|
-
var adsActivationGrantResponseSchema =
|
|
7202
|
+
var adsActivationGrantResponseSchema = z38.object({
|
|
7023
7203
|
grant: adsActivationGrantDtoSchema
|
|
7024
7204
|
}).strict();
|
|
7025
|
-
var adsActivationGrantRevokeRequestSchema =
|
|
7026
|
-
var adsActivateTreeRequestSchema =
|
|
7205
|
+
var adsActivationGrantRevokeRequestSchema = z38.object({}).strict();
|
|
7206
|
+
var adsActivateTreeRequestSchema = z38.object({
|
|
7027
7207
|
operationKey: adsOperationKeySchema,
|
|
7028
7208
|
grantId: adsEntityIdSchema,
|
|
7029
7209
|
manifestHash: adsActivationManifestHashSchema
|
|
7030
7210
|
}).strict();
|
|
7031
|
-
var adsActivateTreeResponseSchema =
|
|
7211
|
+
var adsActivateTreeResponseSchema = z38.object({
|
|
7032
7212
|
grant: adsActivationGrantDtoSchema,
|
|
7033
7213
|
operation: adsOperationDtoSchema,
|
|
7034
|
-
steps:
|
|
7214
|
+
steps: z38.array(adsOperationStepDtoSchema)
|
|
7035
7215
|
}).strict();
|
|
7036
7216
|
var adsUnresolvedOperationStatesDefault = [
|
|
7037
7217
|
AdsOperationStates.pending,
|
|
@@ -7050,23 +7230,23 @@ function parseUnresolvedOperationStates(value) {
|
|
|
7050
7230
|
}
|
|
7051
7231
|
return typeof value === "string" ? value.split(",").filter(Boolean) : value;
|
|
7052
7232
|
}
|
|
7053
|
-
var adsUnresolvedOperationListQuerySchema =
|
|
7054
|
-
state:
|
|
7233
|
+
var adsUnresolvedOperationListQuerySchema = z38.object({
|
|
7234
|
+
state: z38.preprocess(
|
|
7055
7235
|
parseUnresolvedOperationStates,
|
|
7056
|
-
|
|
7236
|
+
z38.array(adsUnresolvedOperationStateSchema).min(1).max(3).refine((states) => new Set(states).size === states.length, "state values must be unique")
|
|
7057
7237
|
),
|
|
7058
|
-
limit:
|
|
7059
|
-
cursor:
|
|
7238
|
+
limit: z38.coerce.number().int().min(1).max(200).default(100),
|
|
7239
|
+
cursor: z38.string().min(1).max(1e3).optional()
|
|
7060
7240
|
});
|
|
7061
|
-
var adsUnresolvedOperationListResponseSchema =
|
|
7062
|
-
operations:
|
|
7063
|
-
count:
|
|
7064
|
-
nextCursor:
|
|
7241
|
+
var adsUnresolvedOperationListResponseSchema = z38.object({
|
|
7242
|
+
operations: z38.array(adsOperationDtoSchema),
|
|
7243
|
+
count: z38.number().int().nonnegative(),
|
|
7244
|
+
nextCursor: z38.string().nullable()
|
|
7065
7245
|
});
|
|
7066
|
-
var adsOperationReconcileRequestSchema =
|
|
7067
|
-
var adsOperationReconcileResponseSchema =
|
|
7246
|
+
var adsOperationReconcileRequestSchema = z38.object({}).strict();
|
|
7247
|
+
var adsOperationReconcileResponseSchema = z38.object({
|
|
7068
7248
|
operation: adsOperationDtoSchema,
|
|
7069
|
-
resolved:
|
|
7249
|
+
resolved: z38.boolean()
|
|
7070
7250
|
});
|
|
7071
7251
|
function adsCtr(clicks, impressions) {
|
|
7072
7252
|
return impressions > 0 ? clicks / impressions : null;
|
|
@@ -7289,6 +7469,9 @@ export {
|
|
|
7289
7469
|
internalError,
|
|
7290
7470
|
runtimeStateMissing,
|
|
7291
7471
|
DEFAULT_MEASUREMENT_CONFIG,
|
|
7472
|
+
gaMeasurementAnalysisWindowSchema,
|
|
7473
|
+
gaMeasurementHostScopeSchema,
|
|
7474
|
+
gaMeasurementAnalysisDtoSchema,
|
|
7292
7475
|
findDuplicateLocationLabels,
|
|
7293
7476
|
hasLocationLabel,
|
|
7294
7477
|
orderLocationsDefaultFirst,
|
|
@@ -7536,6 +7719,8 @@ export {
|
|
|
7536
7719
|
reportActionCategoryLabel,
|
|
7537
7720
|
reportConfidenceLabel,
|
|
7538
7721
|
projectReportDtoSchema,
|
|
7722
|
+
organicEvidencePeriodSchema,
|
|
7723
|
+
organicEvidenceDtoSchema,
|
|
7539
7724
|
dedupeReportActions,
|
|
7540
7725
|
dedupeReportOpportunities,
|
|
7541
7726
|
CodingAgents,
|