@koda-sl/baker-cli 0.278.0 → 0.279.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/dist/cli.js
CHANGED
|
@@ -58,7 +58,7 @@ import {
|
|
|
58
58
|
ulid,
|
|
59
59
|
validateCanvasDeep,
|
|
60
60
|
ytDlpBlockSignal
|
|
61
|
-
} from "./chunk-
|
|
61
|
+
} from "./chunk-V7BIRLPU.js";
|
|
62
62
|
import {
|
|
63
63
|
csvOrJson,
|
|
64
64
|
daysAgoIso,
|
|
@@ -12933,7 +12933,23 @@ var analyticsBeaconMetricsSchema = z26.object({
|
|
|
12933
12933
|
/** Deepest scroll reached, 0–100. */
|
|
12934
12934
|
scrollDepth: z26.number().int().min(0).max(100).optional(),
|
|
12935
12935
|
/** Free numeric payload — order value, lead score, whatever the page means. */
|
|
12936
|
-
value: z26.number().finite().optional()
|
|
12936
|
+
value: z26.number().finite().optional(),
|
|
12937
|
+
/**
|
|
12938
|
+
* Which currency {@link value} is in, when the page knows.
|
|
12939
|
+
*
|
|
12940
|
+
* `value_currency` used to be filled only by a server-sent event, on the
|
|
12941
|
+
* reasoning that a page reports a number on its own terms while a CRM reports
|
|
12942
|
+
* a deal in euros. That held while the only page was a Baker landing. It stops
|
|
12943
|
+
* holding the moment a client's own website reports a booking worth €500
|
|
12944
|
+
* through `window.baker.track(…)`: the amount is real money, and a bare
|
|
12945
|
+
* `500` beside a closed deal is a number nobody can act on — the same
|
|
12946
|
+
* complaint that put the column on the server contract in the first place.
|
|
12947
|
+
*
|
|
12948
|
+
* Three letters, upper-cased and cut by `buildAnalyticsRow`. A page that
|
|
12949
|
+
* sends nonsense writes nonsense into a label column; it cannot reach the
|
|
12950
|
+
* amount, which is separately bounded.
|
|
12951
|
+
*/
|
|
12952
|
+
valueCurrency: z26.string().max(3).optional()
|
|
12937
12953
|
});
|
|
12938
12954
|
var analyticsBeaconTriggerSchema = z26.object({
|
|
12939
12955
|
id: z26.string().max(120),
|
|
@@ -12969,7 +12985,20 @@ var analyticsBeaconClickIdsSchema = z26.object({
|
|
|
12969
12985
|
var analyticsBeaconIdentitySchema = z26.object({
|
|
12970
12986
|
/** Lowercase hex SHA-256. Anything else is dropped rather than stored. */
|
|
12971
12987
|
hash: z26.string().max(64),
|
|
12972
|
-
|
|
12988
|
+
/**
|
|
12989
|
+
* `external` is the site's own id for the person — the id they are logged in
|
|
12990
|
+
* under, the CRM contact key — hashed by the same rule the ingest endpoint
|
|
12991
|
+
* hashes `user_data.external_id` with, so the two produce one key.
|
|
12992
|
+
*
|
|
12993
|
+
* It was server-only, and being server-only made it the weakest of the three
|
|
12994
|
+
* for a reason that was circumstantial rather than essential: an event posted
|
|
12995
|
+
* by a CRM carries no browser, so an `external` digest joined that sender's
|
|
12996
|
+
* events to each other and to nothing else. Sent from a page it carries the
|
|
12997
|
+
* browser with it, which is what turns "customer 4821" into a visit, a
|
|
12998
|
+
* campaign and an ad click — and what lets the same customer on a second
|
|
12999
|
+
* device be one person (`identity_links` pairs the keys it sees together).
|
|
13000
|
+
*/
|
|
13001
|
+
kind: z26.enum(["email", "phone", "external"])
|
|
12973
13002
|
});
|
|
12974
13003
|
var analyticsBeaconEventSchema = z26.object({
|
|
12975
13004
|
type: analyticsEventTypeSchema,
|
|
@@ -13081,7 +13110,30 @@ var analyticsBeaconPayloadSchema = z26.object({
|
|
|
13081
13110
|
* else, is rate-limited, and is readable in the page source by design. It is
|
|
13082
13111
|
* scoped to declared origins for exactly that reason.
|
|
13083
13112
|
*/
|
|
13084
|
-
siteKey: z26.string().max(64).optional()
|
|
13113
|
+
siteKey: z26.string().max(64).optional(),
|
|
13114
|
+
/**
|
|
13115
|
+
* What the page says the visitor allowed, declared once for the batch.
|
|
13116
|
+
*
|
|
13117
|
+
* The page is not trusted with this and is not the only one asked. It is the
|
|
13118
|
+
* only party that can *see* a consent decision — the edge has no view of a
|
|
13119
|
+
* CMP, no cookie banner and no visitor — and it is also the party with an
|
|
13120
|
+
* interest in the answer, so the edge re-checks it rather than acting on it:
|
|
13121
|
+
* a batch that declares `analytics: false` has every identifier stripped from
|
|
13122
|
+
* every row in it on arrival, whatever those rows happened to carry. See
|
|
13123
|
+
* `stripIdentity` in the Worker's collector.
|
|
13124
|
+
*
|
|
13125
|
+
* A count is not a person. Stripping identity keeps the page view, the
|
|
13126
|
+
* conversion and the campaign exactly correct and makes "who" and "how many
|
|
13127
|
+
* people" unanswerable — the same trade a company measuring in `aggregate`
|
|
13128
|
+
* mode chose, applied per visit instead of per company.
|
|
13129
|
+
*
|
|
13130
|
+
* Absent means "not declared", which is every build published before this
|
|
13131
|
+
* field existed and is read as no instruction rather than as denial. Those
|
|
13132
|
+
* pages already omit their identifiers when consent is refused; making an
|
|
13133
|
+
* absent block mean "deny" would have stopped counting sessions on every one
|
|
13134
|
+
* of them at the moment this deployed.
|
|
13135
|
+
*/
|
|
13136
|
+
consent: z26.object({ analytics: z26.boolean() }).optional()
|
|
13085
13137
|
});
|
|
13086
13138
|
|
|
13087
13139
|
// ../api/src/analytics/submissionAnswers.ts
|
|
@@ -13153,9 +13205,19 @@ function mappingCommandFor(platform, proposed) {
|
|
|
13153
13205
|
return `baker analytics map --platform ${platform} --set ${pairs.join(",")}`;
|
|
13154
13206
|
}
|
|
13155
13207
|
|
|
13156
|
-
// ../api/src/analytics/
|
|
13208
|
+
// ../api/src/analytics/websiteTag.ts
|
|
13157
13209
|
import { z as z27 } from "zod";
|
|
13158
|
-
var
|
|
13210
|
+
var websiteTagResponseSchema = z27.object({
|
|
13211
|
+
host: z27.string(),
|
|
13212
|
+
siteKey: z27.string(),
|
|
13213
|
+
origins: z27.array(z27.string()),
|
|
13214
|
+
tag: z27.string(),
|
|
13215
|
+
brief: z27.string()
|
|
13216
|
+
});
|
|
13217
|
+
|
|
13218
|
+
// ../api/src/analytics/wire.ts
|
|
13219
|
+
import { z as z28 } from "zod";
|
|
13220
|
+
var adParamRoleSchema = z28.enum(AD_PARAM_ROLES);
|
|
13159
13221
|
var ANALYTICS_MAX_PAGE_SIZE = 200;
|
|
13160
13222
|
var ANALYTICS_MAX_PAGE = 500;
|
|
13161
13223
|
function isResolvableTimeZone(value) {
|
|
@@ -13166,7 +13228,7 @@ function isResolvableTimeZone(value) {
|
|
|
13166
13228
|
return false;
|
|
13167
13229
|
}
|
|
13168
13230
|
}
|
|
13169
|
-
var analyticsPresetSchema =
|
|
13231
|
+
var analyticsPresetSchema = z28.enum([
|
|
13170
13232
|
/** Everything that matters in one call — the default entry point. */
|
|
13171
13233
|
"overview",
|
|
13172
13234
|
/** Traffic shape: trend, sources, geo, device. */
|
|
@@ -13365,30 +13427,30 @@ var analyticsPresetSchema = z27.enum([
|
|
|
13365
13427
|
"stream"
|
|
13366
13428
|
]);
|
|
13367
13429
|
var ANALYTICS_PRESETS = analyticsPresetSchema.options;
|
|
13368
|
-
var analyticsQueryRequestSchema =
|
|
13430
|
+
var analyticsQueryRequestSchema = z28.object({
|
|
13369
13431
|
preset: analyticsPresetSchema,
|
|
13370
13432
|
/** Lookback in days. Ignored when `startDate` is given. */
|
|
13371
|
-
days:
|
|
13372
|
-
startDate:
|
|
13373
|
-
endDate:
|
|
13433
|
+
days: z28.coerce.number().int().positive().max(400).optional(),
|
|
13434
|
+
startDate: z28.iso.date().optional(),
|
|
13435
|
+
endDate: z28.iso.date().optional(),
|
|
13374
13436
|
/** Required by the `page` preset; ignored by the others. */
|
|
13375
|
-
path:
|
|
13437
|
+
path: z28.string().max(1024).optional(),
|
|
13376
13438
|
/** Narrows `funnel` to one Form. Omitted means every Form. */
|
|
13377
|
-
flowSlug:
|
|
13439
|
+
flowSlug: z28.string().max(120).optional(),
|
|
13378
13440
|
/**
|
|
13379
13441
|
* How far down the `geo` preset looks. Ignored by every other preset.
|
|
13380
13442
|
*
|
|
13381
13443
|
* A closed set rather than a column name, because it names a column and a
|
|
13382
13444
|
* column name taken from a request must never reach the SQL.
|
|
13383
13445
|
*/
|
|
13384
|
-
grain:
|
|
13446
|
+
grain: z28.enum(["country", "region", "city", "postal_code", "metro_code"]).optional(),
|
|
13385
13447
|
/**
|
|
13386
13448
|
* Narrows `geo` to one country before going finer.
|
|
13387
13449
|
*
|
|
13388
13450
|
* Not optional decoration below country level: postcodes collide across
|
|
13389
13451
|
* markets, so a bare `28001` is a Madrid postcode and a US ZIP at once.
|
|
13390
13452
|
*/
|
|
13391
|
-
country:
|
|
13453
|
+
country: z28.string().max(8).optional(),
|
|
13392
13454
|
/**
|
|
13393
13455
|
* Which ad dimension to break down by, or to narrow every other report to.
|
|
13394
13456
|
*
|
|
@@ -13406,7 +13468,7 @@ var analyticsQueryRequestSchema = z27.object({
|
|
|
13406
13468
|
* none of these" — which is how you size the untagged half of an account.
|
|
13407
13469
|
* Omit both to leave the report unnarrowed.
|
|
13408
13470
|
*/
|
|
13409
|
-
adValue:
|
|
13471
|
+
adValue: z28.string().max(255).optional(),
|
|
13410
13472
|
/**
|
|
13411
13473
|
* Read this report in one ad platform's vocabulary, and from its traffic.
|
|
13412
13474
|
*
|
|
@@ -13421,7 +13483,7 @@ var analyticsQueryRequestSchema = z27.object({
|
|
|
13421
13483
|
* Omit it for the union across every platform, which is the honest
|
|
13422
13484
|
* superset and the right default for "how is paid doing".
|
|
13423
13485
|
*/
|
|
13424
|
-
adPlatform:
|
|
13486
|
+
adPlatform: z28.enum(AD_PLATFORMS).optional(),
|
|
13425
13487
|
/**
|
|
13426
13488
|
* Read only what one collector produced: `site` for everything Baker
|
|
13427
13489
|
* measured itself, `systems` for what a client's own server posted to
|
|
@@ -13434,7 +13496,7 @@ var analyticsQueryRequestSchema = z27.object({
|
|
|
13434
13496
|
* ingest row carries no `session_id`, deliberately, so there is no visit
|
|
13435
13497
|
* for it to be counted in.
|
|
13436
13498
|
*/
|
|
13437
|
-
eventOrigin:
|
|
13499
|
+
eventOrigin: z28.enum(["site", "systems"]).optional(),
|
|
13438
13500
|
/**
|
|
13439
13501
|
* `stream` only: keep just one kind of event, named by the key
|
|
13440
13502
|
* `conversions` hands back in its catalogue.
|
|
@@ -13444,9 +13506,9 @@ var analyticsQueryRequestSchema = z27.object({
|
|
|
13444
13506
|
* and a filter that could only name the fourth would be a filter that hides
|
|
13445
13507
|
* most of the feed from itself.
|
|
13446
13508
|
*/
|
|
13447
|
-
eventKey:
|
|
13509
|
+
eventKey: z28.string().optional(),
|
|
13448
13510
|
/** Return the long breakdowns and the per-day trend. */
|
|
13449
|
-
full:
|
|
13511
|
+
full: z28.boolean().optional(),
|
|
13450
13512
|
/**
|
|
13451
13513
|
* IANA zone the day boundaries are drawn in. Defaults to UTC.
|
|
13452
13514
|
*
|
|
@@ -13467,7 +13529,7 @@ var analyticsQueryRequestSchema = z27.object({
|
|
|
13467
13529
|
* prevent — better to say the zone is unknown than to answer for the wrong
|
|
13468
13530
|
* one.
|
|
13469
13531
|
*/
|
|
13470
|
-
timezone:
|
|
13532
|
+
timezone: z28.string().max(64).refine(isResolvableTimeZone, { message: "Unknown timezone \u2014 pass an IANA zone such as Europe/Madrid" }).optional(),
|
|
13471
13533
|
/**
|
|
13472
13534
|
* How wide one point of a series is.
|
|
13473
13535
|
*
|
|
@@ -13476,7 +13538,7 @@ var analyticsQueryRequestSchema = z27.object({
|
|
|
13476
13538
|
* dashboard and 4 on a slide. A 24-hour window at `day` granularity is one
|
|
13477
13539
|
* bar, which is the shape this exists to prevent.
|
|
13478
13540
|
*/
|
|
13479
|
-
granularity:
|
|
13541
|
+
granularity: z28.enum(["hour", "day", "week", "month"]).optional(),
|
|
13480
13542
|
/**
|
|
13481
13543
|
* Narrow to one landing by its `internalId`.
|
|
13482
13544
|
*
|
|
@@ -13484,9 +13546,9 @@ var analyticsQueryRequestSchema = z27.object({
|
|
|
13484
13546
|
* renamed or moved, which is exactly when a before-and-after comparison
|
|
13485
13547
|
* matters most and is exactly when `path` stops matching.
|
|
13486
13548
|
*/
|
|
13487
|
-
landingId:
|
|
13549
|
+
landingId: z28.string().max(120).optional(),
|
|
13488
13550
|
/** Narrows `landings` to the landings carrying one tag. */
|
|
13489
|
-
tag:
|
|
13551
|
+
tag: z28.string().max(32).optional(),
|
|
13490
13552
|
/**
|
|
13491
13553
|
* Which visit the `session` preset replays.
|
|
13492
13554
|
*
|
|
@@ -13494,18 +13556,18 @@ var analyticsQueryRequestSchema = z27.object({
|
|
|
13494
13556
|
* a population report to one visitor produces numbers that are individually
|
|
13495
13557
|
* true and collectively meaningless.
|
|
13496
13558
|
*/
|
|
13497
|
-
sessionId:
|
|
13559
|
+
sessionId: z28.string().max(120).optional(),
|
|
13498
13560
|
/**
|
|
13499
13561
|
* Whose earlier visits to resolve, as a lowercase hex digest.
|
|
13500
13562
|
*
|
|
13501
13563
|
* A digest and never an address: the identity a page sends is hashed in the
|
|
13502
13564
|
* browser, and nothing downstream of that ever holds the original.
|
|
13503
13565
|
*/
|
|
13504
|
-
identityHash:
|
|
13566
|
+
identityHash: z28.string().max(128).optional(),
|
|
13505
13567
|
/** Which page-defined event the `events` preset breaks down. */
|
|
13506
|
-
eventName:
|
|
13568
|
+
eventName: z28.string().max(120).optional(),
|
|
13507
13569
|
/** Which of that event's own properties to break it down by. */
|
|
13508
|
-
property:
|
|
13570
|
+
property: z28.string().max(64).optional(),
|
|
13509
13571
|
/**
|
|
13510
13572
|
* Narrow the breakdown to the rows carrying one property value.
|
|
13511
13573
|
*
|
|
@@ -13515,7 +13577,7 @@ var analyticsQueryRequestSchema = z27.object({
|
|
|
13515
13577
|
* muted hero produces by playing to nobody. Grouping gives the two totals;
|
|
13516
13578
|
* only filtering gives either curve.
|
|
13517
13579
|
*/
|
|
13518
|
-
where:
|
|
13580
|
+
where: z28.object({ property: z28.string().max(64), value: z28.string().max(120) }).optional(),
|
|
13519
13581
|
/**
|
|
13520
13582
|
* An ordered funnel over page-defined event names.
|
|
13521
13583
|
*
|
|
@@ -13525,7 +13587,7 @@ var analyticsQueryRequestSchema = z27.object({
|
|
|
13525
13587
|
* step N after step N-1, or "saw pricing then clicked demo" and the reverse
|
|
13526
13588
|
* would be the same number.
|
|
13527
13589
|
*/
|
|
13528
|
-
steps:
|
|
13590
|
+
steps: z28.array(z28.string().max(120)).max(10).optional(),
|
|
13529
13591
|
/**
|
|
13530
13592
|
* Also return the immediately preceding window of the same length.
|
|
13531
13593
|
*
|
|
@@ -13534,9 +13596,9 @@ var analyticsQueryRequestSchema = z27.object({
|
|
|
13534
13596
|
* comparison window is described in the response and a caller can render
|
|
13535
13597
|
* either side of it.
|
|
13536
13598
|
*/
|
|
13537
|
-
compare:
|
|
13599
|
+
compare: z28.boolean().optional(),
|
|
13538
13600
|
/** `devices` only: which facet to group on. */
|
|
13539
|
-
deviceGrain:
|
|
13601
|
+
deviceGrain: z28.enum(["browser", "os", "engine", "device", "viewport"]).optional(),
|
|
13540
13602
|
/**
|
|
13541
13603
|
* One browser, by its cookie id.
|
|
13542
13604
|
*
|
|
@@ -13544,7 +13606,7 @@ var analyticsQueryRequestSchema = z27.object({
|
|
|
13544
13606
|
* history on `session` — every visit they made, not just the one. Given
|
|
13545
13607
|
* with `sessionId`, the session wins and this is ignored.
|
|
13546
13608
|
*/
|
|
13547
|
-
anonId:
|
|
13609
|
+
anonId: z28.string().max(120).optional(),
|
|
13548
13610
|
/**
|
|
13549
13611
|
* `people` only: keep only the visitors who converted.
|
|
13550
13612
|
*
|
|
@@ -13552,7 +13614,7 @@ var analyticsQueryRequestSchema = z27.object({
|
|
|
13552
13614
|
* filtering the most recent 200 visitors down to the ones who converted
|
|
13553
13615
|
* usually leaves two, and reads as "we had two leads".
|
|
13554
13616
|
*/
|
|
13555
|
-
onlyConverted:
|
|
13617
|
+
onlyConverted: z28.boolean().optional(),
|
|
13556
13618
|
/**
|
|
13557
13619
|
* Which page of a list-shaped report to read, 1-based.
|
|
13558
13620
|
*
|
|
@@ -13568,7 +13630,7 @@ var analyticsQueryRequestSchema = z27.object({
|
|
|
13568
13630
|
* indication that the number was the cap talking. A cap that is reported is
|
|
13569
13631
|
* a page; a cap that is not is a wrong answer.
|
|
13570
13632
|
*/
|
|
13571
|
-
page:
|
|
13633
|
+
page: z28.coerce.number().int().min(1).max(ANALYTICS_MAX_PAGE).optional(),
|
|
13572
13634
|
/**
|
|
13573
13635
|
* How many rows one page holds. Bounded, because the reader is a browser.
|
|
13574
13636
|
*
|
|
@@ -13576,7 +13638,7 @@ var analyticsQueryRequestSchema = z27.object({
|
|
|
13576
13638
|
* what keeps `baker analytics submissions --full` returning the same 800
|
|
13577
13639
|
* rows it always did for an agent that reads the whole thing in one go.
|
|
13578
13640
|
*/
|
|
13579
|
-
pageSize:
|
|
13641
|
+
pageSize: z28.coerce.number().int().min(1).max(ANALYTICS_MAX_PAGE_SIZE).optional()
|
|
13580
13642
|
}).refine((value) => value.preset !== "page" || typeof value.path === "string", {
|
|
13581
13643
|
message: "The 'page' preset needs --path",
|
|
13582
13644
|
path: ["path"]
|
|
@@ -13593,19 +13655,19 @@ var analyticsQueryRequestSchema = z27.object({
|
|
|
13593
13655
|
message: "Narrowing with --where needs --event and --property too",
|
|
13594
13656
|
path: ["where"]
|
|
13595
13657
|
});
|
|
13596
|
-
var analyticsWindowSchema =
|
|
13597
|
-
startDate:
|
|
13598
|
-
endDate:
|
|
13599
|
-
days:
|
|
13658
|
+
var analyticsWindowSchema = z28.object({
|
|
13659
|
+
startDate: z28.iso.date(),
|
|
13660
|
+
endDate: z28.iso.date(),
|
|
13661
|
+
days: z28.number().int().positive(),
|
|
13600
13662
|
/** True when the window reaches past the datasource TTL, so part of it is simply gone. */
|
|
13601
|
-
beyondRetention:
|
|
13663
|
+
beyondRetention: z28.boolean()
|
|
13602
13664
|
});
|
|
13603
|
-
var analyticsTotalsSchema =
|
|
13665
|
+
var analyticsTotalsSchema = z28.object({
|
|
13604
13666
|
/** Counted from `visitor_new`. */
|
|
13605
|
-
visitors:
|
|
13667
|
+
visitors: z28.number().int().nonnegative(),
|
|
13606
13668
|
/** Counted from `session_start`. */
|
|
13607
|
-
sessions:
|
|
13608
|
-
pageViews:
|
|
13669
|
+
sessions: z28.number().int().nonnegative(),
|
|
13670
|
+
pageViews: z28.number().int().nonnegative(),
|
|
13609
13671
|
/**
|
|
13610
13672
|
* Every conversion, counting a visit twice when it converted twice.
|
|
13611
13673
|
*
|
|
@@ -13613,9 +13675,9 @@ var analyticsTotalsSchema = z27.object({
|
|
|
13613
13675
|
* download, a repeatable action — so this legitimately runs ahead of
|
|
13614
13676
|
* {@link convertingSessions}, and of `sessions`.
|
|
13615
13677
|
*/
|
|
13616
|
-
conversions:
|
|
13678
|
+
conversions: z28.number().int().nonnegative(),
|
|
13617
13679
|
/** Visits that produced at least one conversion. Never above `sessions`. */
|
|
13618
|
-
convertingSessions:
|
|
13680
|
+
convertingSessions: z28.number().int().nonnegative(),
|
|
13619
13681
|
/**
|
|
13620
13682
|
* Converting visits per visit, 0–1. Null when there were no visits.
|
|
13621
13683
|
*
|
|
@@ -13624,12 +13686,12 @@ var analyticsTotalsSchema = z27.object({
|
|
|
13624
13686
|
* reading "125%" is read as a broken report, not as a visitor who did the
|
|
13625
13687
|
* thing twice. The count above still says how often it happened.
|
|
13626
13688
|
*/
|
|
13627
|
-
conversionRate:
|
|
13628
|
-
avgEngagementMs:
|
|
13689
|
+
conversionRate: z28.number().min(0).max(1).nullable(),
|
|
13690
|
+
avgEngagementMs: z28.number().nonnegative().nullable(),
|
|
13629
13691
|
/** Page views per session. At or near 1 means visitors leave from the page they land on. */
|
|
13630
|
-
pagesPerSession:
|
|
13692
|
+
pagesPerSession: z28.number().nonnegative().nullable()
|
|
13631
13693
|
});
|
|
13632
|
-
var analyticsTrendPointSchema =
|
|
13694
|
+
var analyticsTrendPointSchema = z28.object({
|
|
13633
13695
|
/**
|
|
13634
13696
|
* The bucket's start, as an ISO instant.
|
|
13635
13697
|
*
|
|
@@ -13640,17 +13702,17 @@ var analyticsTrendPointSchema = z27.object({
|
|
|
13640
13702
|
* on the zone the caller asked for — which a bare `YYYY-MM-DD` cannot
|
|
13641
13703
|
* express without silently choosing one.
|
|
13642
13704
|
*/
|
|
13643
|
-
bucket:
|
|
13644
|
-
visitors:
|
|
13645
|
-
sessions:
|
|
13646
|
-
pageViews:
|
|
13647
|
-
conversions:
|
|
13705
|
+
bucket: z28.string(),
|
|
13706
|
+
visitors: z28.number().int().nonnegative(),
|
|
13707
|
+
sessions: z28.number().int().nonnegative(),
|
|
13708
|
+
pageViews: z28.number().int().nonnegative(),
|
|
13709
|
+
conversions: z28.number().int().nonnegative()
|
|
13648
13710
|
});
|
|
13649
|
-
var analyticsLandingRowSchema =
|
|
13711
|
+
var analyticsLandingRowSchema = z28.object({
|
|
13650
13712
|
/** The landing's `internalId` — the reference every event carries. */
|
|
13651
|
-
landingId:
|
|
13713
|
+
landingId: z28.string(),
|
|
13652
13714
|
/** The Convex `landings._id`, so a dashboard can link straight to the row. */
|
|
13653
|
-
landingRef:
|
|
13715
|
+
landingRef: z28.string(),
|
|
13654
13716
|
/**
|
|
13655
13717
|
* What a person calls it, or `""` when the dimension has not been mirrored
|
|
13656
13718
|
* yet.
|
|
@@ -13660,31 +13722,31 @@ var analyticsLandingRowSchema = z27.object({
|
|
|
13660
13722
|
* than papered over with the id, so a caller can say "not synced yet"
|
|
13661
13723
|
* instead of showing something that looks like a name and is not.
|
|
13662
13724
|
*/
|
|
13663
|
-
name:
|
|
13664
|
-
slug:
|
|
13665
|
-
tags:
|
|
13666
|
-
views:
|
|
13667
|
-
sessions:
|
|
13725
|
+
name: z28.string(),
|
|
13726
|
+
slug: z28.string(),
|
|
13727
|
+
tags: z28.array(z28.string()),
|
|
13728
|
+
views: z28.number().int().nonnegative(),
|
|
13729
|
+
sessions: z28.number().int().nonnegative(),
|
|
13668
13730
|
/** Sessions that BEGAN here. The honest denominator for this page's rate. */
|
|
13669
|
-
entrances:
|
|
13670
|
-
visitors:
|
|
13671
|
-
conversions:
|
|
13731
|
+
entrances: z28.number().int().nonnegative(),
|
|
13732
|
+
visitors: z28.number().int().nonnegative(),
|
|
13733
|
+
conversions: z28.number().int().nonnegative(),
|
|
13672
13734
|
/** Visits that converted on this page at least once. */
|
|
13673
|
-
convertingSessions:
|
|
13674
|
-
outboundClicks:
|
|
13735
|
+
convertingSessions: z28.number().int().nonnegative(),
|
|
13736
|
+
outboundClicks: z28.number().int().nonnegative(),
|
|
13675
13737
|
/**
|
|
13676
13738
|
* Converting visits per entrance. Null when nobody entered here at all.
|
|
13677
13739
|
*
|
|
13678
13740
|
* Converting visits, not conversions: see {@link analyticsTotalsSchema}.
|
|
13679
13741
|
*/
|
|
13680
|
-
conversionRate:
|
|
13681
|
-
avgEngagementMs:
|
|
13742
|
+
conversionRate: z28.number().min(0).max(1).nullable(),
|
|
13743
|
+
avgEngagementMs: z28.number().nonnegative().nullable(),
|
|
13682
13744
|
/**
|
|
13683
13745
|
* Views per bucket, zero-filled against the same axis every other landing
|
|
13684
13746
|
* in the response uses — so the arrays are the same length and can be drawn
|
|
13685
13747
|
* side by side without asking what each element means.
|
|
13686
13748
|
*/
|
|
13687
|
-
sparkline:
|
|
13749
|
+
sparkline: z28.array(z28.number().int().nonnegative()),
|
|
13688
13750
|
/**
|
|
13689
13751
|
* The ad platforms actually sending this page traffic — `google`, `meta`,
|
|
13690
13752
|
* `linkedin`, `tiktok`, `x`, `microsoft`.
|
|
@@ -13693,7 +13755,7 @@ var analyticsLandingRowSchema = z27.object({
|
|
|
13693
13755
|
* a label is whatever somebody typed into a tracking template, a `gclid` is a
|
|
13694
13756
|
* click. Ordered by traffic, busiest first.
|
|
13695
13757
|
*/
|
|
13696
|
-
channels:
|
|
13758
|
+
channels: z28.array(z28.string()),
|
|
13697
13759
|
/**
|
|
13698
13760
|
* Visits per entry of {@link channels}, in the same order.
|
|
13699
13761
|
*
|
|
@@ -13703,26 +13765,26 @@ var analyticsLandingRowSchema = z27.object({
|
|
|
13703
13765
|
* show nothing at all. The count says how much, so one test click and a live
|
|
13704
13766
|
* campaign are distinguishable by reading rather than by absence.
|
|
13705
13767
|
*/
|
|
13706
|
-
channelSessions:
|
|
13707
|
-
});
|
|
13708
|
-
var analyticsTagRowSchema =
|
|
13709
|
-
tag:
|
|
13710
|
-
landings:
|
|
13711
|
-
views:
|
|
13712
|
-
sessions:
|
|
13713
|
-
entrances:
|
|
13714
|
-
conversions:
|
|
13768
|
+
channelSessions: z28.array(z28.number().int().nonnegative())
|
|
13769
|
+
});
|
|
13770
|
+
var analyticsTagRowSchema = z28.object({
|
|
13771
|
+
tag: z28.string(),
|
|
13772
|
+
landings: z28.number().int().nonnegative(),
|
|
13773
|
+
views: z28.number().int().nonnegative(),
|
|
13774
|
+
sessions: z28.number().int().nonnegative(),
|
|
13775
|
+
entrances: z28.number().int().nonnegative(),
|
|
13776
|
+
conversions: z28.number().int().nonnegative(),
|
|
13715
13777
|
/** Visits that converted on one of this tag's pages. */
|
|
13716
|
-
convertingSessions:
|
|
13778
|
+
convertingSessions: z28.number().int().nonnegative(),
|
|
13717
13779
|
/** Converting visits per entrance. */
|
|
13718
|
-
conversionRate:
|
|
13780
|
+
conversionRate: z28.number().min(0).max(1).nullable()
|
|
13719
13781
|
});
|
|
13720
13782
|
var ANALYTICS_EVENT_ORIGINS = ["site", "systems", "both"];
|
|
13721
|
-
var analyticsCustomEventRowSchema =
|
|
13722
|
-
eventName:
|
|
13723
|
-
events:
|
|
13724
|
-
sessions:
|
|
13725
|
-
visitors:
|
|
13783
|
+
var analyticsCustomEventRowSchema = z28.object({
|
|
13784
|
+
eventName: z28.string(),
|
|
13785
|
+
events: z28.number().int().nonnegative(),
|
|
13786
|
+
sessions: z28.number().int().nonnegative(),
|
|
13787
|
+
visitors: z28.number().int().nonnegative(),
|
|
13726
13788
|
/**
|
|
13727
13789
|
* The property keys this event carries.
|
|
13728
13790
|
*
|
|
@@ -13731,7 +13793,7 @@ var analyticsCustomEventRowSchema = z27.object({
|
|
|
13731
13793
|
* capped. This is what lets a dashboard offer the breakdown without the
|
|
13732
13794
|
* reader already knowing what the page chose to record.
|
|
13733
13795
|
*/
|
|
13734
|
-
propertyKeys:
|
|
13796
|
+
propertyKeys: z28.array(z28.string()),
|
|
13735
13797
|
/**
|
|
13736
13798
|
* What these events were worth, per currency.
|
|
13737
13799
|
*
|
|
@@ -13743,34 +13805,34 @@ var analyticsCustomEventRowSchema = z27.object({
|
|
|
13743
13805
|
* which is a score on the page's own terms rather than money. Kept rather
|
|
13744
13806
|
* than dropped, because for those events it is the only number there is.
|
|
13745
13807
|
*/
|
|
13746
|
-
money:
|
|
13747
|
-
landings:
|
|
13808
|
+
money: z28.record(z28.string(), z28.number()).default({}),
|
|
13809
|
+
landings: z28.array(z28.string()),
|
|
13748
13810
|
/** Which collector produced this name — and `both` when more than one did. */
|
|
13749
|
-
origin:
|
|
13811
|
+
origin: z28.enum(ANALYTICS_EVENT_ORIGINS)
|
|
13750
13812
|
});
|
|
13751
|
-
var analyticsEventBreakdownRowSchema =
|
|
13752
|
-
value:
|
|
13753
|
-
events:
|
|
13754
|
-
sessions:
|
|
13813
|
+
var analyticsEventBreakdownRowSchema = z28.object({
|
|
13814
|
+
value: z28.string(),
|
|
13815
|
+
events: z28.number().int().nonnegative(),
|
|
13816
|
+
sessions: z28.number().int().nonnegative(),
|
|
13755
13817
|
/** Per currency, exactly as {@link analyticsCustomEventRowSchema.money}. */
|
|
13756
|
-
money:
|
|
13818
|
+
money: z28.record(z28.string(), z28.number()).default({})
|
|
13757
13819
|
});
|
|
13758
|
-
var analyticsCustomFunnelStepSchema =
|
|
13759
|
-
stepIndex:
|
|
13760
|
-
stepName:
|
|
13761
|
-
sessions:
|
|
13820
|
+
var analyticsCustomFunnelStepSchema = z28.object({
|
|
13821
|
+
stepIndex: z28.number().int().positive(),
|
|
13822
|
+
stepName: z28.string(),
|
|
13823
|
+
sessions: z28.number().int().nonnegative(),
|
|
13762
13824
|
/** Share of the sessions that reached the previous step. Null on the first. */
|
|
13763
|
-
stepRate:
|
|
13825
|
+
stepRate: z28.number().min(0).max(1).nullable(),
|
|
13764
13826
|
/** Share of the sessions that reached step one. Null on the first. */
|
|
13765
|
-
overallRate:
|
|
13827
|
+
overallRate: z28.number().min(0).max(1).nullable()
|
|
13766
13828
|
});
|
|
13767
|
-
var analyticsDeviceRowSchema =
|
|
13829
|
+
var analyticsDeviceRowSchema = z28.object({
|
|
13768
13830
|
/** The bucket label — `Chrome 120.0`, `iOS 17.4`, `380–767`. */
|
|
13769
|
-
bucket:
|
|
13770
|
-
sessions:
|
|
13771
|
-
pageViews:
|
|
13772
|
-
convertingSessions:
|
|
13773
|
-
conversions:
|
|
13831
|
+
bucket: z28.string(),
|
|
13832
|
+
sessions: z28.number().int().nonnegative(),
|
|
13833
|
+
pageViews: z28.number().int().nonnegative(),
|
|
13834
|
+
convertingSessions: z28.number().int().nonnegative(),
|
|
13835
|
+
conversions: z28.number().int().nonnegative(),
|
|
13774
13836
|
/**
|
|
13775
13837
|
* Converting sessions over sessions.
|
|
13776
13838
|
*
|
|
@@ -13778,11 +13840,11 @@ var analyticsDeviceRowSchema = z27.object({
|
|
|
13778
13840
|
* can submit twice and a rate above 1 in a browser-comparison table reads as
|
|
13779
13841
|
* a bug in the report rather than as a visitor who filled two forms.
|
|
13780
13842
|
*/
|
|
13781
|
-
conversionRate:
|
|
13782
|
-
avgEngagementMs:
|
|
13843
|
+
conversionRate: z28.number().min(0).max(1).nullable(),
|
|
13844
|
+
avgEngagementMs: z28.number().nonnegative().nullable()
|
|
13783
13845
|
});
|
|
13784
|
-
var analyticsPageRowSchema =
|
|
13785
|
-
path:
|
|
13846
|
+
var analyticsPageRowSchema = z28.object({
|
|
13847
|
+
path: z28.string(),
|
|
13786
13848
|
/**
|
|
13787
13849
|
* The landing's own `internalId`, straight out of its `_definition.md`.
|
|
13788
13850
|
*
|
|
@@ -13791,28 +13853,28 @@ var analyticsPageRowSchema = z27.object({
|
|
|
13791
13853
|
* it has been renamed, which the path does not. Empty for a path with no
|
|
13792
13854
|
* landing behind it.
|
|
13793
13855
|
*/
|
|
13794
|
-
landingId:
|
|
13795
|
-
pageViews:
|
|
13856
|
+
landingId: z28.string(),
|
|
13857
|
+
pageViews: z28.number().int().nonnegative(),
|
|
13796
13858
|
/** Sessions that began on this page — its value as a landing page. */
|
|
13797
|
-
entrances:
|
|
13798
|
-
conversions:
|
|
13859
|
+
entrances: z28.number().int().nonnegative(),
|
|
13860
|
+
conversions: z28.number().int().nonnegative(),
|
|
13799
13861
|
/** Visits that converted on this page at least once. */
|
|
13800
|
-
convertingSessions:
|
|
13862
|
+
convertingSessions: z28.number().int().nonnegative(),
|
|
13801
13863
|
/** Converting visits per entrance, 0–1. Null when nobody landed here. */
|
|
13802
|
-
conversionRate:
|
|
13803
|
-
avgEngagementMs:
|
|
13804
|
-
});
|
|
13805
|
-
var analyticsSourceRowSchema =
|
|
13806
|
-
source:
|
|
13807
|
-
medium:
|
|
13808
|
-
sessions:
|
|
13809
|
-
conversions:
|
|
13810
|
-
conversionRate:
|
|
13811
|
-
});
|
|
13812
|
-
var analyticsCampaignRowSchema =
|
|
13813
|
-
utmSource:
|
|
13814
|
-
utmMedium:
|
|
13815
|
-
utmCampaign:
|
|
13864
|
+
conversionRate: z28.number().min(0).max(1).nullable(),
|
|
13865
|
+
avgEngagementMs: z28.number().nonnegative().nullable()
|
|
13866
|
+
});
|
|
13867
|
+
var analyticsSourceRowSchema = z28.object({
|
|
13868
|
+
source: z28.string(),
|
|
13869
|
+
medium: z28.string(),
|
|
13870
|
+
sessions: z28.number().int().nonnegative(),
|
|
13871
|
+
conversions: z28.number().int().nonnegative(),
|
|
13872
|
+
conversionRate: z28.number().min(0).max(1).nullable()
|
|
13873
|
+
});
|
|
13874
|
+
var analyticsCampaignRowSchema = z28.object({
|
|
13875
|
+
utmSource: z28.string(),
|
|
13876
|
+
utmMedium: z28.string(),
|
|
13877
|
+
utmCampaign: z28.string(),
|
|
13816
13878
|
/**
|
|
13817
13879
|
* The platform a click id proves, or `""` when the visit carried none.
|
|
13818
13880
|
*
|
|
@@ -13826,46 +13888,46 @@ var analyticsCampaignRowSchema = z27.object({
|
|
|
13826
13888
|
* campaign list as "no campaign tagging on any traffic", and dropping the
|
|
13827
13889
|
* paid ones would make that fire on a perfectly tagged account.
|
|
13828
13890
|
*/
|
|
13829
|
-
clickPlatform:
|
|
13830
|
-
sessions:
|
|
13831
|
-
conversions:
|
|
13832
|
-
conversionRate:
|
|
13891
|
+
clickPlatform: z28.string(),
|
|
13892
|
+
sessions: z28.number().int().nonnegative(),
|
|
13893
|
+
conversions: z28.number().int().nonnegative(),
|
|
13894
|
+
conversionRate: z28.number().min(0).max(1).nullable()
|
|
13833
13895
|
});
|
|
13834
|
-
var analyticsRealtimeMinuteSchema =
|
|
13896
|
+
var analyticsRealtimeMinuteSchema = z28.object({
|
|
13835
13897
|
/** The minute, as an ISO instant. */
|
|
13836
|
-
minute:
|
|
13837
|
-
visitors:
|
|
13838
|
-
pageViews:
|
|
13898
|
+
minute: z28.string(),
|
|
13899
|
+
visitors: z28.number().int().nonnegative(),
|
|
13900
|
+
pageViews: z28.number().int().nonnegative()
|
|
13839
13901
|
});
|
|
13840
|
-
var analyticsRealtimePageSchema =
|
|
13841
|
-
path:
|
|
13902
|
+
var analyticsRealtimePageSchema = z28.object({
|
|
13903
|
+
path: z28.string(),
|
|
13842
13904
|
/** The landing this path belongs to; empty when no landing claims it. */
|
|
13843
|
-
landingId:
|
|
13844
|
-
visitors:
|
|
13905
|
+
landingId: z28.string(),
|
|
13906
|
+
visitors: z28.number().int().nonnegative()
|
|
13845
13907
|
});
|
|
13846
|
-
var analyticsRealtimeSchema =
|
|
13908
|
+
var analyticsRealtimeSchema = z28.object({
|
|
13847
13909
|
/** Distinct visitors with any activity inside the active window. */
|
|
13848
|
-
activeNow:
|
|
13910
|
+
activeNow: z28.number().int().nonnegative(),
|
|
13849
13911
|
/** How recently a visitor must have acted to be counted, in minutes. */
|
|
13850
|
-
activeWithinMinutes:
|
|
13851
|
-
minutes:
|
|
13852
|
-
pages:
|
|
13853
|
-
});
|
|
13854
|
-
var analyticsDimensionRowSchema =
|
|
13855
|
-
key:
|
|
13856
|
-
sessions:
|
|
13857
|
-
conversions:
|
|
13858
|
-
conversionRate:
|
|
13859
|
-
});
|
|
13860
|
-
var analyticsFunnelStepSchema =
|
|
13861
|
-
stepId:
|
|
13862
|
-
stepIndex:
|
|
13912
|
+
activeWithinMinutes: z28.number().int().positive(),
|
|
13913
|
+
minutes: z28.array(analyticsRealtimeMinuteSchema),
|
|
13914
|
+
pages: z28.array(analyticsRealtimePageSchema)
|
|
13915
|
+
});
|
|
13916
|
+
var analyticsDimensionRowSchema = z28.object({
|
|
13917
|
+
key: z28.string(),
|
|
13918
|
+
sessions: z28.number().int().nonnegative(),
|
|
13919
|
+
conversions: z28.number().int().nonnegative(),
|
|
13920
|
+
conversionRate: z28.number().min(0).max(1).nullable()
|
|
13921
|
+
});
|
|
13922
|
+
var analyticsFunnelStepSchema = z28.object({
|
|
13923
|
+
stepId: z28.string(),
|
|
13924
|
+
stepIndex: z28.number().int().nonnegative(),
|
|
13863
13925
|
/** Visits that moved forward into this step. Never events — see `visits`. */
|
|
13864
|
-
views:
|
|
13926
|
+
views: z28.number().int().nonnegative(),
|
|
13865
13927
|
/** Visits that finished this step and moved on. */
|
|
13866
|
-
completions:
|
|
13928
|
+
completions: z28.number().int().nonnegative(),
|
|
13867
13929
|
/** Share of viewers who did not complete this step, 0–1. */
|
|
13868
|
-
dropRate:
|
|
13930
|
+
dropRate: z28.number().min(0).max(1).nullable(),
|
|
13869
13931
|
/**
|
|
13870
13932
|
* Visits that converted AT this step — the node kind's own outcome trigger
|
|
13871
13933
|
* fired here, or the Form was submitted here.
|
|
@@ -13874,7 +13936,7 @@ var analyticsFunnelStepSchema = z27.object({
|
|
|
13874
13936
|
* conversion, and knowing which step owns it is what stops a drop-off chart
|
|
13875
13937
|
* treating the booking widget's "profile viewed" as a funnel stage.
|
|
13876
13938
|
*/
|
|
13877
|
-
convertedSessions:
|
|
13939
|
+
convertedSessions: z28.number().int().nonnegative(),
|
|
13878
13940
|
/**
|
|
13879
13941
|
* This step is where the Form ends — a confirmation screen, not a loss.
|
|
13880
13942
|
*
|
|
@@ -13882,10 +13944,10 @@ var analyticsFunnelStepSchema = z27.object({
|
|
|
13882
13944
|
* `dropRate === null`, which is also how a step nobody viewed arrives, so a
|
|
13883
13945
|
* converting link node in the middle of a Form was labelled its ending.
|
|
13884
13946
|
*/
|
|
13885
|
-
isEnding:
|
|
13947
|
+
isEnding: z28.boolean()
|
|
13886
13948
|
});
|
|
13887
|
-
var analyticsFunnelSchema =
|
|
13888
|
-
flowSlug:
|
|
13949
|
+
var analyticsFunnelSchema = z28.object({
|
|
13950
|
+
flowSlug: z28.string(),
|
|
13889
13951
|
/**
|
|
13890
13952
|
* Visits that saw the Form at all — the denominator for every share here.
|
|
13891
13953
|
*
|
|
@@ -13900,15 +13962,15 @@ var analyticsFunnelSchema = z27.object({
|
|
|
13900
13962
|
* a Form four people had opened reported one step reached fifteen times and
|
|
13901
13963
|
* fourteen people lost.
|
|
13902
13964
|
*/
|
|
13903
|
-
visits:
|
|
13965
|
+
visits: z28.number().int().nonnegative(),
|
|
13904
13966
|
/** Visits that interacted with the Form at all — typed, picked, or advanced. */
|
|
13905
|
-
starts:
|
|
13906
|
-
submits:
|
|
13967
|
+
starts: z28.number().int().nonnegative(),
|
|
13968
|
+
submits: z28.number().int().nonnegative(),
|
|
13907
13969
|
/** Conversions per visit that opened the Form, 0–1. */
|
|
13908
|
-
completionRate:
|
|
13970
|
+
completionRate: z28.number().min(0).max(1).nullable(),
|
|
13909
13971
|
/** The step losing the most people. The single most useful field here. */
|
|
13910
13972
|
worstStep: analyticsFunnelStepSchema.nullable(),
|
|
13911
|
-
steps:
|
|
13973
|
+
steps: z28.array(analyticsFunnelStepSchema),
|
|
13912
13974
|
/**
|
|
13913
13975
|
* Visits that converted, counted once each at whichever node did it.
|
|
13914
13976
|
*
|
|
@@ -13917,33 +13979,33 @@ var analyticsFunnelSchema = z27.object({
|
|
|
13917
13979
|
* mid-flow Calendly node reports zero submits and every one of its real
|
|
13918
13980
|
* bookings here.
|
|
13919
13981
|
*/
|
|
13920
|
-
convertedSessions:
|
|
13921
|
-
});
|
|
13922
|
-
var analyticsPaidRowSchema =
|
|
13923
|
-
source:
|
|
13924
|
-
medium:
|
|
13925
|
-
campaign:
|
|
13926
|
-
content:
|
|
13927
|
-
term:
|
|
13982
|
+
convertedSessions: z28.number().int().nonnegative()
|
|
13983
|
+
});
|
|
13984
|
+
var analyticsPaidRowSchema = z28.object({
|
|
13985
|
+
source: z28.string(),
|
|
13986
|
+
medium: z28.string(),
|
|
13987
|
+
campaign: z28.string(),
|
|
13988
|
+
content: z28.string(),
|
|
13989
|
+
term: z28.string(),
|
|
13928
13990
|
/** `google` | `meta` | `tiktok` | `x` | `linkedin` | `microsoft` | `""`. */
|
|
13929
|
-
clickPlatform:
|
|
13930
|
-
sessions:
|
|
13931
|
-
convertingSessions:
|
|
13932
|
-
conversions:
|
|
13991
|
+
clickPlatform: z28.string(),
|
|
13992
|
+
sessions: z28.number().int().nonnegative(),
|
|
13993
|
+
convertingSessions: z28.number().int().nonnegative(),
|
|
13994
|
+
conversions: z28.number().int().nonnegative(),
|
|
13933
13995
|
/** Leads whose server-side delivery reported success. */
|
|
13934
|
-
delivered:
|
|
13996
|
+
delivered: z28.number().int().nonnegative(),
|
|
13935
13997
|
/** Leads whose delivery reported failure. Non-zero here is a broken integration. */
|
|
13936
|
-
failedDeliveries:
|
|
13998
|
+
failedDeliveries: z28.number().int().nonnegative(),
|
|
13937
13999
|
/** Distinct people, across devices — only countable where visitors identified themselves. */
|
|
13938
|
-
identifiedPeople:
|
|
14000
|
+
identifiedPeople: z28.number().int().nonnegative(),
|
|
13939
14001
|
/** Converting sessions per session, 0–1. */
|
|
13940
|
-
conversionRate:
|
|
14002
|
+
conversionRate: z28.number().min(0).max(1).nullable(),
|
|
13941
14003
|
/** Delivered leads per conversion, 0–1. Below 1 means leads are being lost after submit. */
|
|
13942
|
-
deliveryRate:
|
|
14004
|
+
deliveryRate: z28.number().min(0).max(1).nullable()
|
|
13943
14005
|
});
|
|
13944
|
-
var analyticsDeliveryRowSchema =
|
|
13945
|
-
eventId:
|
|
13946
|
-
submittedAt:
|
|
14006
|
+
var analyticsDeliveryRowSchema = z28.object({
|
|
14007
|
+
eventId: z28.string(),
|
|
14008
|
+
submittedAt: z28.string(),
|
|
13947
14009
|
/**
|
|
13948
14010
|
* The visit the submission was made in, so a lead can be opened as a story.
|
|
13949
14011
|
*
|
|
@@ -13952,18 +14014,18 @@ var analyticsDeliveryRowSchema = z27.object({
|
|
|
13952
14014
|
* which ad brought them, what they read first, how long they took — are all
|
|
13953
14015
|
* on the other side of this one join.
|
|
13954
14016
|
*/
|
|
13955
|
-
sessionId:
|
|
14017
|
+
sessionId: z28.string(),
|
|
13956
14018
|
/** Lowercase hex digest of who submitted, when the page could identify them. */
|
|
13957
|
-
identityHash:
|
|
13958
|
-
flowSlug:
|
|
13959
|
-
stepId:
|
|
13960
|
-
landingId:
|
|
13961
|
-
destinations:
|
|
13962
|
-
dispatched:
|
|
13963
|
-
succeeded:
|
|
13964
|
-
failed:
|
|
14019
|
+
identityHash: z28.string(),
|
|
14020
|
+
flowSlug: z28.string(),
|
|
14021
|
+
stepId: z28.string(),
|
|
14022
|
+
landingId: z28.string(),
|
|
14023
|
+
destinations: z28.array(z28.string()),
|
|
14024
|
+
dispatched: z28.number().int().nonnegative(),
|
|
14025
|
+
succeeded: z28.number().int().nonnegative(),
|
|
14026
|
+
failed: z28.number().int().nonnegative(),
|
|
13965
14027
|
/** Dispatched and never settled. Distinguishing this from failed is "wait" vs "act". */
|
|
13966
|
-
pending:
|
|
14028
|
+
pending: z28.number().int().nonnegative(),
|
|
13967
14029
|
/**
|
|
13968
14030
|
* The ids the destinations gave back.
|
|
13969
14031
|
*
|
|
@@ -13971,57 +14033,57 @@ var analyticsDeliveryRowSchema = z27.object({
|
|
|
13971
14033
|
* and previously invisible failure: the integration accepted the call and
|
|
13972
14034
|
* dropped the record.
|
|
13973
14035
|
*/
|
|
13974
|
-
providerRefs:
|
|
13975
|
-
sampleError:
|
|
14036
|
+
providerRefs: z28.array(z28.string()),
|
|
14037
|
+
sampleError: z28.string()
|
|
13976
14038
|
});
|
|
13977
|
-
var analyticsTriggerRowSchema =
|
|
13978
|
-
flowSlug:
|
|
14039
|
+
var analyticsTriggerRowSchema = z28.object({
|
|
14040
|
+
flowSlug: z28.string(),
|
|
13979
14041
|
/** `link`, `customForm`, `iframe`, `hubspotMeeting`, … */
|
|
13980
|
-
nodeType:
|
|
14042
|
+
nodeType: z28.string(),
|
|
13981
14043
|
/** The trigger, verbatim: `link.onClick`, `iframe.checkout_completed`. */
|
|
13982
|
-
triggerId:
|
|
13983
|
-
fires:
|
|
13984
|
-
sessions:
|
|
14044
|
+
triggerId: z28.string(),
|
|
14045
|
+
fires: z28.number().int().nonnegative(),
|
|
14046
|
+
sessions: z28.number().int().nonnegative(),
|
|
13985
14047
|
/** How many of those fires produced a side effect. Often zero, on purpose. */
|
|
13986
|
-
sideEffectsFired:
|
|
14048
|
+
sideEffectsFired: z28.number().int().nonnegative()
|
|
13987
14049
|
});
|
|
13988
|
-
var analyticsReleaseRowSchema =
|
|
14050
|
+
var analyticsReleaseRowSchema = z28.object({
|
|
13989
14051
|
/** The commit the build came from. */
|
|
13990
|
-
release:
|
|
13991
|
-
firstSeen:
|
|
13992
|
-
lastSeen:
|
|
13993
|
-
sessions:
|
|
13994
|
-
pageViews:
|
|
13995
|
-
conversions:
|
|
14052
|
+
release: z28.string(),
|
|
14053
|
+
firstSeen: z28.string(),
|
|
14054
|
+
lastSeen: z28.string(),
|
|
14055
|
+
sessions: z28.number().int().nonnegative(),
|
|
14056
|
+
pageViews: z28.number().int().nonnegative(),
|
|
14057
|
+
conversions: z28.number().int().nonnegative(),
|
|
13996
14058
|
/** Visits that converted on this build at least once. */
|
|
13997
|
-
convertingSessions:
|
|
14059
|
+
convertingSessions: z28.number().int().nonnegative(),
|
|
13998
14060
|
/** Converting visits per session, 0–1. Null below a usable sample. */
|
|
13999
|
-
conversionRate:
|
|
14061
|
+
conversionRate: z28.number().min(0).max(1).nullable()
|
|
14000
14062
|
});
|
|
14001
|
-
var analyticsGeoRowSchema =
|
|
14063
|
+
var analyticsGeoRowSchema = z28.object({
|
|
14002
14064
|
/** The place itself, at whatever grain was asked for. */
|
|
14003
|
-
place:
|
|
14065
|
+
place: z28.string(),
|
|
14004
14066
|
/** Always carried: a postcode without its country is ambiguous, a city twice over. */
|
|
14005
|
-
country:
|
|
14006
|
-
region:
|
|
14007
|
-
sessions:
|
|
14008
|
-
conversions:
|
|
14067
|
+
country: z28.string(),
|
|
14068
|
+
region: z28.string(),
|
|
14069
|
+
sessions: z28.number().int().nonnegative(),
|
|
14070
|
+
conversions: z28.number().int().nonnegative(),
|
|
14009
14071
|
/** Conversions per session, 0–1. Null below a usable sample. */
|
|
14010
|
-
conversionRate:
|
|
14072
|
+
conversionRate: z28.number().min(0).max(1).nullable(),
|
|
14011
14073
|
/** People rather than browsers, where the visit identified itself. */
|
|
14012
|
-
identifiedPeople:
|
|
14074
|
+
identifiedPeople: z28.number().int().nonnegative()
|
|
14013
14075
|
});
|
|
14014
|
-
var analyticsBotRowSchema =
|
|
14076
|
+
var analyticsBotRowSchema = z28.object({
|
|
14015
14077
|
/** The crawler's name, or `unidentified` for a machine we could not name. */
|
|
14016
|
-
bot:
|
|
14078
|
+
bot: z28.string(),
|
|
14017
14079
|
/** `search` | `ai` | `social` | `seo` | `monitoring` | `tool` | `automation`. */
|
|
14018
|
-
category:
|
|
14019
|
-
hits:
|
|
14020
|
-
pages:
|
|
14021
|
-
lastSeen:
|
|
14022
|
-
samplePaths:
|
|
14080
|
+
category: z28.string(),
|
|
14081
|
+
hits: z28.number().int().nonnegative(),
|
|
14082
|
+
pages: z28.number().int().nonnegative(),
|
|
14083
|
+
lastSeen: z28.string(),
|
|
14084
|
+
samplePaths: z28.array(z28.string())
|
|
14023
14085
|
});
|
|
14024
|
-
var analyticsWarningSchema =
|
|
14086
|
+
var analyticsWarningSchema = z28.object({
|
|
14025
14087
|
/**
|
|
14026
14088
|
* `AD_ROLE_UNMAPPED` is the one that reports a *question* rather than the
|
|
14027
14089
|
* data. A role resolves to the parameter names that carry it, and when a
|
|
@@ -14030,58 +14092,58 @@ var analyticsWarningSchema = z27.object({
|
|
|
14030
14092
|
* the whole report. Zero is a far more expensive conclusion than "nobody has
|
|
14031
14093
|
* said which parameter that is", so the narrowing is dropped and this says so.
|
|
14032
14094
|
*/
|
|
14033
|
-
code:
|
|
14034
|
-
message:
|
|
14035
|
-
});
|
|
14036
|
-
var analyticsFlowSummarySchema =
|
|
14037
|
-
flowSlug:
|
|
14038
|
-
sessions:
|
|
14039
|
-
starts:
|
|
14040
|
-
convertedSessions:
|
|
14041
|
-
submits:
|
|
14042
|
-
stepViews:
|
|
14095
|
+
code: z28.enum(["LOW_SAMPLE", "NO_DATA", "BEYOND_RETENTION", "AD_ROLE_UNMAPPED"]),
|
|
14096
|
+
message: z28.string()
|
|
14097
|
+
});
|
|
14098
|
+
var analyticsFlowSummarySchema = z28.object({
|
|
14099
|
+
flowSlug: z28.string(),
|
|
14100
|
+
sessions: z28.number().int().nonnegative(),
|
|
14101
|
+
starts: z28.number().int().nonnegative(),
|
|
14102
|
+
convertedSessions: z28.number().int().nonnegative(),
|
|
14103
|
+
submits: z28.number().int().nonnegative(),
|
|
14104
|
+
stepViews: z28.number().int().nonnegative(),
|
|
14043
14105
|
/** Distinct steps anyone reached, across all visits. */
|
|
14044
|
-
stepsSeen:
|
|
14045
|
-
deepestStepIndex:
|
|
14106
|
+
stepsSeen: z28.number().int().nonnegative(),
|
|
14107
|
+
deepestStepIndex: z28.number().int().nonnegative(),
|
|
14046
14108
|
/** Steps reached per visit, averaged — "how much of this Form do people read". */
|
|
14047
|
-
avgStepsReached:
|
|
14109
|
+
avgStepsReached: z28.number().nonnegative(),
|
|
14048
14110
|
/** Conversions per visit that started, 0–1. */
|
|
14049
|
-
conversionRate:
|
|
14111
|
+
conversionRate: z28.number().min(0).max(1).nullable(),
|
|
14050
14112
|
/** Which node ids produced the conversions. Usually one; two means two offers. */
|
|
14051
|
-
conversionSteps:
|
|
14113
|
+
conversionSteps: z28.array(z28.string()),
|
|
14052
14114
|
/** And by what — `calendlyEvent.eventScheduled`, `customForm.onFormSubmitted`. */
|
|
14053
|
-
conversionTriggers:
|
|
14054
|
-
conversionNodeTypes:
|
|
14055
|
-
lastSeen:
|
|
14115
|
+
conversionTriggers: z28.array(z28.string()),
|
|
14116
|
+
conversionNodeTypes: z28.array(z28.string()),
|
|
14117
|
+
lastSeen: z28.string()
|
|
14056
14118
|
});
|
|
14057
|
-
var analyticsFlowEdgeSchema =
|
|
14058
|
-
flowSlug:
|
|
14059
|
-
fromStep:
|
|
14060
|
-
toStep:
|
|
14061
|
-
sessions:
|
|
14119
|
+
var analyticsFlowEdgeSchema = z28.object({
|
|
14120
|
+
flowSlug: z28.string(),
|
|
14121
|
+
fromStep: z28.string(),
|
|
14122
|
+
toStep: z28.string(),
|
|
14123
|
+
sessions: z28.number().int().nonnegative()
|
|
14062
14124
|
});
|
|
14063
|
-
var analyticsConversionRowSchema =
|
|
14125
|
+
var analyticsConversionRowSchema = z28.object({
|
|
14064
14126
|
/** What a person calls this outcome. */
|
|
14065
|
-
name:
|
|
14127
|
+
name: z28.string(),
|
|
14066
14128
|
/** Every event counted under this name. One entry unless the name is shared. */
|
|
14067
|
-
eventKeys:
|
|
14129
|
+
eventKeys: z28.array(z28.string()),
|
|
14068
14130
|
/**
|
|
14069
14131
|
* `once_per_visit` | `every_time` — how repeats inside one visit are counted.
|
|
14070
14132
|
*
|
|
14071
14133
|
* `mixed` when a shared name spans both, which is a real state and an editing
|
|
14072
14134
|
* accident; saying so is what makes it findable.
|
|
14073
14135
|
*/
|
|
14074
|
-
countMode:
|
|
14136
|
+
countMode: z28.string(),
|
|
14075
14137
|
/** Counted the way each definition asked to be counted. */
|
|
14076
|
-
conversions:
|
|
14138
|
+
conversions: z28.number(),
|
|
14077
14139
|
/** Distinct visits that produced it, never mode-adjusted. The gap between the two is the repeat behaviour. */
|
|
14078
|
-
convertingVisits:
|
|
14140
|
+
convertingVisits: z28.number(),
|
|
14079
14141
|
/** Null when it has never fired. */
|
|
14080
|
-
lastSeen:
|
|
14142
|
+
lastSeen: z28.string().nullable()
|
|
14081
14143
|
});
|
|
14082
|
-
var analyticsEventCatalogRowSchema =
|
|
14144
|
+
var analyticsEventCatalogRowSchema = z28.object({
|
|
14083
14145
|
/** `form:…` | `submit:…` | `page:…` | `exit:…` — parse with `parseEventKey`. */
|
|
14084
|
-
eventKey:
|
|
14146
|
+
eventKey: z28.string(),
|
|
14085
14147
|
/**
|
|
14086
14148
|
* Which collector produced this key — and `both` when more than one did.
|
|
14087
14149
|
*
|
|
@@ -14091,41 +14153,41 @@ var analyticsEventCatalogRowSchema = z27.object({
|
|
|
14091
14153
|
* populations at any grain, but nothing downstream has to learn a second
|
|
14092
14154
|
* vocabulary to count one.
|
|
14093
14155
|
*/
|
|
14094
|
-
origin:
|
|
14095
|
-
events:
|
|
14096
|
-
sessions:
|
|
14156
|
+
origin: z28.enum(ANALYTICS_EVENT_ORIGINS),
|
|
14157
|
+
events: z28.number(),
|
|
14158
|
+
sessions: z28.number(),
|
|
14097
14159
|
/** The Form node's kind, for a `form:` key. Empty otherwise. */
|
|
14098
|
-
nodeType:
|
|
14160
|
+
nodeType: z28.string(),
|
|
14099
14161
|
/** The Form this happened in, for a `form:` or `submit:` key. Empty otherwise. */
|
|
14100
|
-
flowSlug:
|
|
14162
|
+
flowSlug: z28.string(),
|
|
14101
14163
|
/** Null when it has never fired — only possible for a row we already count. */
|
|
14102
|
-
lastSeen:
|
|
14164
|
+
lastSeen: z28.string().nullable(),
|
|
14103
14165
|
/** Already counted as a conversion. Shown, never hidden: a row that vanished on being counted reads as a bug. */
|
|
14104
|
-
isCounted:
|
|
14166
|
+
isCounted: z28.boolean(),
|
|
14105
14167
|
/** The name it is counted under, when it is. */
|
|
14106
|
-
countedAs:
|
|
14168
|
+
countedAs: z28.string()
|
|
14107
14169
|
});
|
|
14108
|
-
var analyticsAdDimensionRowSchema =
|
|
14170
|
+
var analyticsAdDimensionRowSchema = z28.object({
|
|
14109
14171
|
/** The dimension's value. Empty means "arrived carrying none of these". */
|
|
14110
|
-
value:
|
|
14172
|
+
value: z28.string(),
|
|
14111
14173
|
/** Which platform stamped the click, from the click id rather than a label. */
|
|
14112
|
-
platform:
|
|
14113
|
-
sessions:
|
|
14114
|
-
convertingSessions:
|
|
14115
|
-
conversions:
|
|
14116
|
-
bouncedSessions:
|
|
14117
|
-
identifiedPeople:
|
|
14118
|
-
pageViews:
|
|
14119
|
-
engagementMs:
|
|
14174
|
+
platform: z28.string(),
|
|
14175
|
+
sessions: z28.number(),
|
|
14176
|
+
convertingSessions: z28.number(),
|
|
14177
|
+
conversions: z28.number(),
|
|
14178
|
+
bouncedSessions: z28.number(),
|
|
14179
|
+
identifiedPeople: z28.number(),
|
|
14180
|
+
pageViews: z28.number(),
|
|
14181
|
+
engagementMs: z28.number(),
|
|
14120
14182
|
/** Conversions per session, or null when nothing arrived. */
|
|
14121
|
-
conversionRate:
|
|
14183
|
+
conversionRate: z28.number().nullable(),
|
|
14122
14184
|
/** Bounces per session, or null when nothing arrived. */
|
|
14123
|
-
bounceRate:
|
|
14185
|
+
bounceRate: z28.number().nullable()
|
|
14124
14186
|
});
|
|
14125
|
-
var analyticsAdParamRowSchema =
|
|
14126
|
-
name:
|
|
14187
|
+
var analyticsAdParamRowSchema = z28.object({
|
|
14188
|
+
name: z28.string(),
|
|
14127
14189
|
/** Whether the value is stored, or only the fact that the name appeared. */
|
|
14128
|
-
captured:
|
|
14190
|
+
captured: z28.boolean(),
|
|
14129
14191
|
/** The role in force for the platform asked about, built-in or configured. */
|
|
14130
14192
|
role: adParamRoleSchema.optional(),
|
|
14131
14193
|
/**
|
|
@@ -14134,7 +14196,7 @@ var analyticsAdParamRowSchema = z27.object({
|
|
|
14134
14196
|
* The difference between a row that can be reset to a sensible default and
|
|
14135
14197
|
* one where clearing it means "nobody has said".
|
|
14136
14198
|
*/
|
|
14137
|
-
configured:
|
|
14199
|
+
configured: z28.boolean(),
|
|
14138
14200
|
/**
|
|
14139
14201
|
* Visits carrying this parameter **that arrived from the platform asked
|
|
14140
14202
|
* about**, not visits carrying it anywhere.
|
|
@@ -14147,11 +14209,11 @@ var analyticsAdParamRowSchema = z27.object({
|
|
|
14147
14209
|
* parameter in Meta's vocabulary and then wonder why no report ever used it.
|
|
14148
14210
|
* The count belongs to the platform or it is not a count of anything.
|
|
14149
14211
|
*/
|
|
14150
|
-
sessions:
|
|
14151
|
-
events:
|
|
14212
|
+
sessions: z28.number(),
|
|
14213
|
+
events: z28.number(),
|
|
14152
14214
|
/** Up to five distinct values. Always empty for an uncaptured parameter. */
|
|
14153
|
-
sampleValues:
|
|
14154
|
-
lastSeen:
|
|
14215
|
+
sampleValues: z28.array(z28.string()),
|
|
14216
|
+
lastSeen: z28.string().optional(),
|
|
14155
14217
|
/**
|
|
14156
14218
|
* True when this row is here because somebody configured it, not because it
|
|
14157
14219
|
* arrived.
|
|
@@ -14163,31 +14225,31 @@ var analyticsAdParamRowSchema = z27.object({
|
|
|
14163
14225
|
* values, and says so rather than reading as a parameter that stopped
|
|
14164
14226
|
* arriving.
|
|
14165
14227
|
*/
|
|
14166
|
-
awaitingTraffic:
|
|
14228
|
+
awaitingTraffic: z28.boolean().optional()
|
|
14167
14229
|
});
|
|
14168
|
-
var analyticsFlowDestinationsSchema =
|
|
14169
|
-
flowSlug:
|
|
14230
|
+
var analyticsFlowDestinationsSchema = z28.object({
|
|
14231
|
+
flowSlug: z28.string(),
|
|
14170
14232
|
/** Destination types seen — `meta`, `httpWebhook`, `hubspotForm`. */
|
|
14171
|
-
destinations:
|
|
14172
|
-
lastSeen:
|
|
14233
|
+
destinations: z28.array(z28.string()),
|
|
14234
|
+
lastSeen: z28.string().optional()
|
|
14173
14235
|
});
|
|
14174
|
-
var analyticsAdPlatformTrafficSchema =
|
|
14175
|
-
platform:
|
|
14176
|
-
sessions:
|
|
14177
|
-
conversions:
|
|
14236
|
+
var analyticsAdPlatformTrafficSchema = z28.object({
|
|
14237
|
+
platform: z28.string(),
|
|
14238
|
+
sessions: z28.number(),
|
|
14239
|
+
conversions: z28.number(),
|
|
14178
14240
|
/** How many of those visits carried any campaign parameter at all. */
|
|
14179
|
-
taggedSessions:
|
|
14241
|
+
taggedSessions: z28.number()
|
|
14180
14242
|
});
|
|
14181
|
-
var analyticsPageInfoSchema =
|
|
14243
|
+
var analyticsPageInfoSchema = z28.object({
|
|
14182
14244
|
/** Which field of the response was paged. */
|
|
14183
|
-
block:
|
|
14184
|
-
page:
|
|
14185
|
-
pageSize:
|
|
14186
|
-
returned:
|
|
14187
|
-
hasMore:
|
|
14188
|
-
});
|
|
14189
|
-
var analyticsTimelineRowSchema =
|
|
14190
|
-
timestamp:
|
|
14245
|
+
block: z28.enum(["visitors", "submissions", "deliveries", "stream"]),
|
|
14246
|
+
page: z28.number().int(),
|
|
14247
|
+
pageSize: z28.number().int(),
|
|
14248
|
+
returned: z28.number().int(),
|
|
14249
|
+
hasMore: z28.boolean()
|
|
14250
|
+
});
|
|
14251
|
+
var analyticsTimelineRowSchema = z28.object({
|
|
14252
|
+
timestamp: z28.string(),
|
|
14191
14253
|
/**
|
|
14192
14254
|
* The visit this event belongs to, and the browser that made it.
|
|
14193
14255
|
*
|
|
@@ -14197,8 +14259,8 @@ var analyticsTimelineRowSchema = z27.object({
|
|
|
14197
14259
|
* visit's, so a row has to say who it was about before a reader can get from
|
|
14198
14260
|
* it to the person. On a replay both are constant and simply confirm it.
|
|
14199
14261
|
*/
|
|
14200
|
-
sessionId:
|
|
14201
|
-
anonId:
|
|
14262
|
+
sessionId: z28.string(),
|
|
14263
|
+
anonId: z28.string(),
|
|
14202
14264
|
/**
|
|
14203
14265
|
* Where the producer put this event in its own order, from 1. `0` means it
|
|
14204
14266
|
* did not number this one.
|
|
@@ -14209,32 +14271,32 @@ var analyticsTimelineRowSchema = z27.object({
|
|
|
14209
14271
|
* coming into view routinely share one — and sorted on the timestamp alone
|
|
14210
14272
|
* they came back in an order that matched nothing that happened.
|
|
14211
14273
|
*/
|
|
14212
|
-
eventSeq:
|
|
14274
|
+
eventSeq: z28.number().int().nonnegative(),
|
|
14213
14275
|
/** This event's identity, so two rows can be said to be the same event. */
|
|
14214
|
-
eventUid:
|
|
14276
|
+
eventUid: z28.string(),
|
|
14215
14277
|
/** `page_view`, `form_step_view`, `side_effect_dispatched`, … */
|
|
14216
|
-
eventType:
|
|
14278
|
+
eventType: z28.string(),
|
|
14217
14279
|
/** `edge`, `beacon`, `server` — where the row was written from. */
|
|
14218
|
-
source:
|
|
14219
|
-
environment:
|
|
14280
|
+
source: z28.string(),
|
|
14281
|
+
environment: z28.string(),
|
|
14220
14282
|
/** The build the page was published from. */
|
|
14221
|
-
release:
|
|
14222
|
-
path:
|
|
14223
|
-
host:
|
|
14224
|
-
landingId:
|
|
14225
|
-
flowSlug:
|
|
14226
|
-
stepId:
|
|
14227
|
-
stepIndex:
|
|
14228
|
-
nodeType:
|
|
14229
|
-
triggerId:
|
|
14283
|
+
release: z28.string(),
|
|
14284
|
+
path: z28.string(),
|
|
14285
|
+
host: z28.string(),
|
|
14286
|
+
landingId: z28.string(),
|
|
14287
|
+
flowSlug: z28.string(),
|
|
14288
|
+
stepId: z28.string(),
|
|
14289
|
+
stepIndex: z28.number().int().nonnegative(),
|
|
14290
|
+
nodeType: z28.string(),
|
|
14291
|
+
triggerId: z28.string(),
|
|
14230
14292
|
/** A page-defined event's own name, when this row is one. */
|
|
14231
|
-
eventName:
|
|
14293
|
+
eventName: z28.string(),
|
|
14232
14294
|
/** Whatever the page attached to a custom event. Strings only, by design. */
|
|
14233
|
-
properties:
|
|
14295
|
+
properties: z28.record(z28.string(), z28.string()),
|
|
14234
14296
|
/** Where an outbound click or a link node was going, in full. */
|
|
14235
|
-
targetUrl:
|
|
14297
|
+
targetUrl: z28.string(),
|
|
14236
14298
|
/** A number the page reported alongside the event. */
|
|
14237
|
-
value:
|
|
14299
|
+
value: z28.number(),
|
|
14238
14300
|
/**
|
|
14239
14301
|
* The currency that number is in, when it has one.
|
|
14240
14302
|
*
|
|
@@ -14242,9 +14304,9 @@ var analyticsTimelineRowSchema = z27.object({
|
|
|
14242
14304
|
* terms, a CRM reports a deal in euros — and without it the replay prints a
|
|
14243
14305
|
* bare `4200.5` beside a closed deal, which is a number nobody can act on.
|
|
14244
14306
|
*/
|
|
14245
|
-
valueCurrency:
|
|
14307
|
+
valueCurrency: z28.string().default(""),
|
|
14246
14308
|
/** The visitor's digest, when they had identified themselves by this point. */
|
|
14247
|
-
identityHash:
|
|
14309
|
+
identityHash: z28.string(),
|
|
14248
14310
|
/**
|
|
14249
14311
|
* The browser to attribute this row to, once the identity has been resolved.
|
|
14250
14312
|
*
|
|
@@ -14263,7 +14325,7 @@ var analyticsTimelineRowSchema = z27.object({
|
|
|
14263
14325
|
* session replay deliberately does not resolve, because an event that
|
|
14264
14326
|
* happened during no visit must not be placed inside one.
|
|
14265
14327
|
*/
|
|
14266
|
-
personAnonId:
|
|
14328
|
+
personAnonId: z28.string().default(""),
|
|
14267
14329
|
/**
|
|
14268
14330
|
* What this row knows the person by, when it does not know their browser:
|
|
14269
14331
|
* `email` | `phone` | `external` | `click` | `cookie`, or empty.
|
|
@@ -14273,7 +14335,7 @@ var analyticsTimelineRowSchema = z27.object({
|
|
|
14273
14335
|
* of Meta's cookies — is not a row about nobody, and rendering it as one is
|
|
14274
14336
|
* what made the server-sent half of the feed look unattached to the rest.
|
|
14275
14337
|
*/
|
|
14276
|
-
knownBy:
|
|
14338
|
+
knownBy: z28.string().default(""),
|
|
14277
14339
|
/**
|
|
14278
14340
|
* `email` | `phone` — which of the two they gave.
|
|
14279
14341
|
*
|
|
@@ -14281,7 +14343,7 @@ var analyticsTimelineRowSchema = z27.object({
|
|
|
14281
14343
|
* produces two `identify` rows in the same millisecond, and without the kind
|
|
14282
14344
|
* a replay renders the same sentence twice and reads as a duplicated event.
|
|
14283
14345
|
*/
|
|
14284
|
-
identityKind:
|
|
14346
|
+
identityKind: z28.string(),
|
|
14285
14347
|
/**
|
|
14286
14348
|
* The `user_data` block this event carried, exactly as it arrived.
|
|
14287
14349
|
*
|
|
@@ -14297,12 +14359,12 @@ var analyticsTimelineRowSchema = z27.object({
|
|
|
14297
14359
|
* overall. That is how a sender finds the field they forgot to map: the
|
|
14298
14360
|
* person has a postcode, and this event does not.
|
|
14299
14361
|
*/
|
|
14300
|
-
userData:
|
|
14301
|
-
sideEffectType:
|
|
14302
|
-
sideEffectName:
|
|
14303
|
-
sideEffectId:
|
|
14304
|
-
tagId:
|
|
14305
|
-
messageId:
|
|
14362
|
+
userData: z28.record(z28.string(), z28.string()).default({}),
|
|
14363
|
+
sideEffectType: z28.string(),
|
|
14364
|
+
sideEffectName: z28.string(),
|
|
14365
|
+
sideEffectId: z28.string(),
|
|
14366
|
+
tagId: z28.string(),
|
|
14367
|
+
messageId: z28.string(),
|
|
14306
14368
|
/**
|
|
14307
14369
|
* The submission this row belongs to.
|
|
14308
14370
|
*
|
|
@@ -14310,44 +14372,44 @@ var analyticsTimelineRowSchema = z27.object({
|
|
|
14310
14372
|
* together. Without it they read as two unrelated things that happened to
|
|
14311
14373
|
* occur in the same second.
|
|
14312
14374
|
*/
|
|
14313
|
-
eventId:
|
|
14314
|
-
runId:
|
|
14315
|
-
engagementMs:
|
|
14316
|
-
scrollDepth:
|
|
14375
|
+
eventId: z28.string(),
|
|
14376
|
+
runId: z28.string(),
|
|
14377
|
+
engagementMs: z28.number().int().nonnegative(),
|
|
14378
|
+
scrollDepth: z28.number().int().nonnegative(),
|
|
14317
14379
|
/** `success` | `failed` | `""` for a dispatch that has not settled yet. */
|
|
14318
|
-
outcome:
|
|
14380
|
+
outcome: z28.string(),
|
|
14319
14381
|
/** What the destination said when it refused. Empty on success. */
|
|
14320
|
-
error:
|
|
14382
|
+
error: z28.string(),
|
|
14321
14383
|
/** The destination's own id for the record it created, when it gave one. */
|
|
14322
|
-
providerRef:
|
|
14384
|
+
providerRef: z28.string(),
|
|
14323
14385
|
/** When the destination answered, so "it took eleven seconds" is sayable. */
|
|
14324
|
-
settledAt:
|
|
14325
|
-
});
|
|
14326
|
-
var analyticsSubmissionRowSchema =
|
|
14327
|
-
sessionId:
|
|
14328
|
-
flowSlug:
|
|
14329
|
-
startedAt:
|
|
14330
|
-
lastAt:
|
|
14331
|
-
anonId:
|
|
14332
|
-
identityHash:
|
|
14333
|
-
identityKind:
|
|
14334
|
-
landingId:
|
|
14335
|
-
path:
|
|
14386
|
+
settledAt: z28.string()
|
|
14387
|
+
});
|
|
14388
|
+
var analyticsSubmissionRowSchema = z28.object({
|
|
14389
|
+
sessionId: z28.string(),
|
|
14390
|
+
flowSlug: z28.string(),
|
|
14391
|
+
startedAt: z28.string(),
|
|
14392
|
+
lastAt: z28.string(),
|
|
14393
|
+
anonId: z28.string(),
|
|
14394
|
+
identityHash: z28.string(),
|
|
14395
|
+
identityKind: z28.string(),
|
|
14396
|
+
landingId: z28.string(),
|
|
14397
|
+
path: z28.string(),
|
|
14336
14398
|
/** Steps they saw. The denominator for "how far did they get". */
|
|
14337
|
-
stepsReached:
|
|
14399
|
+
stepsReached: z28.number().int().nonnegative(),
|
|
14338
14400
|
/** Steps they actually handed something over on. Zero means no attempt. */
|
|
14339
|
-
stepsSubmitted:
|
|
14340
|
-
submittedStepIds:
|
|
14401
|
+
stepsSubmitted: z28.number().int().nonnegative(),
|
|
14402
|
+
submittedStepIds: z28.array(z28.string()),
|
|
14341
14403
|
/** The furthest step they reached, for naming where they stopped. */
|
|
14342
|
-
lastStepId:
|
|
14404
|
+
lastStepId: z28.string(),
|
|
14343
14405
|
/** Whether the Form reached an ending, by any of its three routes. */
|
|
14344
|
-
finished:
|
|
14345
|
-
conversions:
|
|
14346
|
-
destinations:
|
|
14406
|
+
finished: z28.boolean(),
|
|
14407
|
+
conversions: z28.number().int().nonnegative(),
|
|
14408
|
+
destinations: z28.array(z28.string()),
|
|
14347
14409
|
/** Destinations that fired as a pixel in the page. */
|
|
14348
|
-
browserDestinations:
|
|
14410
|
+
browserDestinations: z28.array(z28.string()),
|
|
14349
14411
|
/** Destinations Baker dispatched from the server. */
|
|
14350
|
-
serverDestinations:
|
|
14412
|
+
serverDestinations: z28.array(z28.string()),
|
|
14351
14413
|
/**
|
|
14352
14414
|
* Server-side dispatch runs — the counterpart of `serverDestinations`, NOT of
|
|
14353
14415
|
* `destinations`.
|
|
@@ -14358,27 +14420,27 @@ var analyticsSubmissionRowSchema = z27.object({
|
|
|
14358
14420
|
* browser pixel. `destinations` is the union of both sides and is the column
|
|
14359
14421
|
* that answers "did this reach anything at all".
|
|
14360
14422
|
*/
|
|
14361
|
-
dispatched:
|
|
14362
|
-
succeeded:
|
|
14363
|
-
failed:
|
|
14423
|
+
dispatched: z28.number().int().nonnegative(),
|
|
14424
|
+
succeeded: z28.number().int().nonnegative(),
|
|
14425
|
+
failed: z28.number().int().nonnegative(),
|
|
14364
14426
|
/** Dispatched and never settled — "wait", as against "act". */
|
|
14365
|
-
pending:
|
|
14366
|
-
sampleError:
|
|
14367
|
-
providerRefs:
|
|
14427
|
+
pending: z28.number().int().nonnegative(),
|
|
14428
|
+
sampleError: z28.string(),
|
|
14429
|
+
providerRefs: z28.array(z28.string()),
|
|
14368
14430
|
/** The submission ids, which is how the panel opens the sealed payload. */
|
|
14369
|
-
eventIds:
|
|
14370
|
-
});
|
|
14371
|
-
var analyticsVisitorSessionSchema =
|
|
14372
|
-
sessionId:
|
|
14373
|
-
startedAt:
|
|
14374
|
-
endedAt:
|
|
14375
|
-
entryPath:
|
|
14376
|
-
entryLandingId:
|
|
14377
|
-
utmCampaign:
|
|
14378
|
-
referrerSource:
|
|
14379
|
-
deviceType:
|
|
14380
|
-
pageViews:
|
|
14381
|
-
conversions:
|
|
14431
|
+
eventIds: z28.array(z28.string())
|
|
14432
|
+
});
|
|
14433
|
+
var analyticsVisitorSessionSchema = z28.object({
|
|
14434
|
+
sessionId: z28.string(),
|
|
14435
|
+
startedAt: z28.string(),
|
|
14436
|
+
endedAt: z28.string(),
|
|
14437
|
+
entryPath: z28.string(),
|
|
14438
|
+
entryLandingId: z28.string(),
|
|
14439
|
+
utmCampaign: z28.string(),
|
|
14440
|
+
referrerSource: z28.string(),
|
|
14441
|
+
deviceType: z28.string(),
|
|
14442
|
+
pageViews: z28.number().int().nonnegative(),
|
|
14443
|
+
conversions: z28.number().int().nonnegative(),
|
|
14382
14444
|
/**
|
|
14383
14445
|
* True for the visits made BEFORE we knew who this was.
|
|
14384
14446
|
*
|
|
@@ -14386,29 +14448,29 @@ var analyticsVisitorSessionSchema = z27.object({
|
|
|
14386
14448
|
* that we recognised them all along, when in fact these visits were only
|
|
14387
14449
|
* attributed backwards through the browser after they identified themselves.
|
|
14388
14450
|
*/
|
|
14389
|
-
wasAnonymous:
|
|
14390
|
-
engagementMs:
|
|
14391
|
-
});
|
|
14392
|
-
var analyticsVisitProfileSchema =
|
|
14393
|
-
sessionId:
|
|
14394
|
-
startedAt:
|
|
14395
|
-
endedAt:
|
|
14396
|
-
entryPath:
|
|
14397
|
-
entryLandingId:
|
|
14398
|
-
country:
|
|
14399
|
-
region:
|
|
14400
|
-
city:
|
|
14401
|
-
timezone:
|
|
14451
|
+
wasAnonymous: z28.boolean(),
|
|
14452
|
+
engagementMs: z28.number().int().nonnegative()
|
|
14453
|
+
});
|
|
14454
|
+
var analyticsVisitProfileSchema = z28.object({
|
|
14455
|
+
sessionId: z28.string(),
|
|
14456
|
+
startedAt: z28.string(),
|
|
14457
|
+
endedAt: z28.string(),
|
|
14458
|
+
entryPath: z28.string(),
|
|
14459
|
+
entryLandingId: z28.string(),
|
|
14460
|
+
country: z28.string(),
|
|
14461
|
+
region: z28.string(),
|
|
14462
|
+
city: z28.string(),
|
|
14463
|
+
timezone: z28.string(),
|
|
14402
14464
|
/** The network the visit came from. What separates a datacentre from a person. */
|
|
14403
|
-
asOrganization:
|
|
14404
|
-
deviceType:
|
|
14405
|
-
browser:
|
|
14406
|
-
os:
|
|
14407
|
-
referrerSource:
|
|
14408
|
-
referrerDomain:
|
|
14409
|
-
utmSource:
|
|
14410
|
-
utmMedium:
|
|
14411
|
-
utmCampaign:
|
|
14465
|
+
asOrganization: z28.string(),
|
|
14466
|
+
deviceType: z28.string(),
|
|
14467
|
+
browser: z28.string(),
|
|
14468
|
+
os: z28.string(),
|
|
14469
|
+
referrerSource: z28.string(),
|
|
14470
|
+
referrerDomain: z28.string(),
|
|
14471
|
+
utmSource: z28.string(),
|
|
14472
|
+
utmMedium: z28.string(),
|
|
14473
|
+
utmCampaign: z28.string(),
|
|
14412
14474
|
/**
|
|
14413
14475
|
* Which platform the click id proves, in the `AD_PLATFORMS` vocabulary —
|
|
14414
14476
|
* `google` | `meta` | `tiktok` | `x` | `linkedin` | `microsoft` | `""`.
|
|
@@ -14417,42 +14479,42 @@ var analyticsVisitProfileSchema = z27.object({
|
|
|
14417
14479
|
* `google_ads` / `meta_ads` here alone, which meant every logo lookup on the
|
|
14418
14480
|
* People screen missed and a paid visit drew a neutral globe.
|
|
14419
14481
|
*/
|
|
14420
|
-
clickPlatform:
|
|
14482
|
+
clickPlatform: z28.string(),
|
|
14421
14483
|
/** Every ValueTrack-style parameter the URL carried, unresolved. */
|
|
14422
|
-
campaignParams:
|
|
14484
|
+
campaignParams: z28.record(z28.string(), z28.string()),
|
|
14423
14485
|
/** The browser's own cookie id. One person can have several. */
|
|
14424
|
-
anonId:
|
|
14425
|
-
identityHash:
|
|
14486
|
+
anonId: z28.string(),
|
|
14487
|
+
identityHash: z28.string(),
|
|
14426
14488
|
/** What the digest was made of — `email`, `phone`. Never the value. */
|
|
14427
|
-
identityKind:
|
|
14428
|
-
pageViews:
|
|
14429
|
-
conversions:
|
|
14430
|
-
engagementMs:
|
|
14489
|
+
identityKind: z28.string(),
|
|
14490
|
+
pageViews: z28.number().int().nonnegative(),
|
|
14491
|
+
conversions: z28.number().int().nonnegative(),
|
|
14492
|
+
engagementMs: z28.number().int().nonnegative()
|
|
14431
14493
|
});
|
|
14432
|
-
var analyticsPersonKeySchema =
|
|
14494
|
+
var analyticsPersonKeySchema = z28.object({
|
|
14433
14495
|
/** `email` | `phone` | `external` | `browser` | a click-id name | `fbp` | `fbc`. */
|
|
14434
|
-
kind:
|
|
14496
|
+
kind: z28.string(),
|
|
14435
14497
|
/** A digest for a contact detail, the value itself for a cookie or a click id. */
|
|
14436
|
-
value:
|
|
14437
|
-
firstSeen:
|
|
14438
|
-
lastSeen:
|
|
14498
|
+
value: z28.string(),
|
|
14499
|
+
firstSeen: z28.string(),
|
|
14500
|
+
lastSeen: z28.string(),
|
|
14439
14501
|
/** How many times it was observed beside another key — every submission repeats it. */
|
|
14440
|
-
observations:
|
|
14441
|
-
sessions:
|
|
14502
|
+
observations: z28.number().int().nonnegative(),
|
|
14503
|
+
sessions: z28.number().int().nonnegative(),
|
|
14442
14504
|
/** `client` | `edge` | `server` | `ingest` — which collector first saw it. */
|
|
14443
|
-
source:
|
|
14505
|
+
source: z28.string(),
|
|
14444
14506
|
/** The Form it was first seen on, where it came from one. */
|
|
14445
|
-
flowSlug:
|
|
14446
|
-
landingId:
|
|
14507
|
+
flowSlug: z28.string(),
|
|
14508
|
+
landingId: z28.string()
|
|
14447
14509
|
});
|
|
14448
|
-
var analyticsPersonProfileSchema =
|
|
14449
|
-
firstSeen:
|
|
14450
|
-
lastSeen:
|
|
14451
|
-
sessions:
|
|
14510
|
+
var analyticsPersonProfileSchema = z28.object({
|
|
14511
|
+
firstSeen: z28.string(),
|
|
14512
|
+
lastSeen: z28.string(),
|
|
14513
|
+
sessions: z28.number().int().nonnegative(),
|
|
14452
14514
|
/** How many browsers resolved to this person. More than one is cross-device. */
|
|
14453
|
-
devices:
|
|
14454
|
-
pageViews:
|
|
14455
|
-
conversions:
|
|
14515
|
+
devices: z28.number().int().nonnegative(),
|
|
14516
|
+
pageViews: z28.number().int().nonnegative(),
|
|
14517
|
+
conversions: z28.number().int().nonnegative(),
|
|
14456
14518
|
/**
|
|
14457
14519
|
* What they are worth, per currency — `{ EUR: 4753 }`.
|
|
14458
14520
|
*
|
|
@@ -14462,52 +14524,52 @@ var analyticsPersonProfileSchema = z27.object({
|
|
|
14462
14524
|
* Only a server event ever carries money, and a retried post is counted
|
|
14463
14525
|
* once, on `event_uid`.
|
|
14464
14526
|
*/
|
|
14465
|
-
money:
|
|
14466
|
-
engagementMs:
|
|
14527
|
+
money: z28.record(z28.string(), z28.number()),
|
|
14528
|
+
engagementMs: z28.number().int().nonnegative(),
|
|
14467
14529
|
/** How many of their events a client's own server posted. */
|
|
14468
|
-
serverEvents:
|
|
14469
|
-
country:
|
|
14470
|
-
region:
|
|
14471
|
-
city:
|
|
14472
|
-
deviceType:
|
|
14473
|
-
browser:
|
|
14474
|
-
os:
|
|
14475
|
-
utmSource:
|
|
14476
|
-
utmMedium:
|
|
14477
|
-
utmCampaign:
|
|
14478
|
-
referrerSource:
|
|
14479
|
-
entryLandingId:
|
|
14480
|
-
entryPath:
|
|
14530
|
+
serverEvents: z28.number().int().nonnegative(),
|
|
14531
|
+
country: z28.string(),
|
|
14532
|
+
region: z28.string(),
|
|
14533
|
+
city: z28.string(),
|
|
14534
|
+
deviceType: z28.string(),
|
|
14535
|
+
browser: z28.string(),
|
|
14536
|
+
os: z28.string(),
|
|
14537
|
+
utmSource: z28.string(),
|
|
14538
|
+
utmMedium: z28.string(),
|
|
14539
|
+
utmCampaign: z28.string(),
|
|
14540
|
+
referrerSource: z28.string(),
|
|
14541
|
+
entryLandingId: z28.string(),
|
|
14542
|
+
entryPath: z28.string(),
|
|
14481
14543
|
/**
|
|
14482
14544
|
* The customer-matching block, merged newest-wins across everything anyone
|
|
14483
14545
|
* has ever told us about them — `city`, `postal_code`, `country`,
|
|
14484
14546
|
* `first_name_sha256`, `fbp`. Keyed exactly as the store holds it, so a key
|
|
14485
14547
|
* ending `_sha256` says its value is a digest and cannot be shown.
|
|
14486
14548
|
*/
|
|
14487
|
-
matchKeys:
|
|
14488
|
-
});
|
|
14489
|
-
var analyticsVisitorRowSchema =
|
|
14490
|
-
anonId:
|
|
14491
|
-
firstSeen:
|
|
14492
|
-
lastSeen:
|
|
14493
|
-
sessions:
|
|
14494
|
-
pageViews:
|
|
14495
|
-
conversions:
|
|
14496
|
-
formTriggers:
|
|
14497
|
-
outboundClicks:
|
|
14498
|
-
engagementMs:
|
|
14549
|
+
matchKeys: z28.record(z28.string(), z28.string())
|
|
14550
|
+
});
|
|
14551
|
+
var analyticsVisitorRowSchema = z28.object({
|
|
14552
|
+
anonId: z28.string(),
|
|
14553
|
+
firstSeen: z28.string(),
|
|
14554
|
+
lastSeen: z28.string(),
|
|
14555
|
+
sessions: z28.number().int().nonnegative(),
|
|
14556
|
+
pageViews: z28.number().int().nonnegative(),
|
|
14557
|
+
conversions: z28.number().int().nonnegative(),
|
|
14558
|
+
formTriggers: z28.number().int().nonnegative(),
|
|
14559
|
+
outboundClicks: z28.number().int().nonnegative(),
|
|
14560
|
+
engagementMs: z28.number().int().nonnegative(),
|
|
14499
14561
|
/** The visit to open by default — the most recent one. */
|
|
14500
|
-
lastSessionId:
|
|
14501
|
-
entryPath:
|
|
14502
|
-
entryLandingId:
|
|
14503
|
-
lastPath:
|
|
14504
|
-
referrerSource:
|
|
14505
|
-
referrerDomain:
|
|
14506
|
-
utmSource:
|
|
14507
|
-
utmMedium:
|
|
14508
|
-
utmCampaign:
|
|
14509
|
-
clickPlatform:
|
|
14510
|
-
campaignParams:
|
|
14562
|
+
lastSessionId: z28.string(),
|
|
14563
|
+
entryPath: z28.string(),
|
|
14564
|
+
entryLandingId: z28.string(),
|
|
14565
|
+
lastPath: z28.string(),
|
|
14566
|
+
referrerSource: z28.string(),
|
|
14567
|
+
referrerDomain: z28.string(),
|
|
14568
|
+
utmSource: z28.string(),
|
|
14569
|
+
utmMedium: z28.string(),
|
|
14570
|
+
utmCampaign: z28.string(),
|
|
14571
|
+
clickPlatform: z28.string(),
|
|
14572
|
+
campaignParams: z28.record(z28.string(), z28.string()),
|
|
14511
14573
|
/**
|
|
14512
14574
|
* The click ids this person arrived on, by their own names — `gclid`,
|
|
14513
14575
|
* `fbclid`, `msclkid`, `li_fat_id`, `ttclid`, `twclid`, `wbraid`, `gbraid`.
|
|
@@ -14519,47 +14581,47 @@ var analyticsVisitorRowSchema = z27.object({
|
|
|
14519
14581
|
* therefore the value somebody is looking for when a conversion did not show
|
|
14520
14582
|
* up on the other side.
|
|
14521
14583
|
*/
|
|
14522
|
-
clickIds:
|
|
14523
|
-
country:
|
|
14524
|
-
region:
|
|
14525
|
-
city:
|
|
14526
|
-
timezone:
|
|
14527
|
-
asOrganization:
|
|
14528
|
-
deviceType:
|
|
14529
|
-
browser:
|
|
14530
|
-
os:
|
|
14531
|
-
identityHash:
|
|
14532
|
-
identityKind:
|
|
14533
|
-
});
|
|
14534
|
-
var analyticsQueryDataSchema =
|
|
14584
|
+
clickIds: z28.record(z28.string(), z28.string()),
|
|
14585
|
+
country: z28.string(),
|
|
14586
|
+
region: z28.string(),
|
|
14587
|
+
city: z28.string(),
|
|
14588
|
+
timezone: z28.string(),
|
|
14589
|
+
asOrganization: z28.string(),
|
|
14590
|
+
deviceType: z28.string(),
|
|
14591
|
+
browser: z28.string(),
|
|
14592
|
+
os: z28.string(),
|
|
14593
|
+
identityHash: z28.string(),
|
|
14594
|
+
identityKind: z28.string()
|
|
14595
|
+
});
|
|
14596
|
+
var analyticsQueryDataSchema = z28.object({
|
|
14535
14597
|
preset: analyticsPresetSchema,
|
|
14536
14598
|
window: analyticsWindowSchema,
|
|
14537
14599
|
totals: analyticsTotalsSchema,
|
|
14538
|
-
trend:
|
|
14539
|
-
topPages:
|
|
14540
|
-
topSources:
|
|
14541
|
-
topCampaigns:
|
|
14542
|
-
countries:
|
|
14543
|
-
devices:
|
|
14544
|
-
funnels:
|
|
14545
|
-
flowSummary:
|
|
14546
|
-
flowPaths:
|
|
14547
|
-
triggers:
|
|
14548
|
-
releases:
|
|
14549
|
-
paid:
|
|
14550
|
-
deliveries:
|
|
14551
|
-
submissions:
|
|
14552
|
-
geo:
|
|
14553
|
-
bots:
|
|
14554
|
-
landings:
|
|
14555
|
-
tags:
|
|
14556
|
-
customEvents:
|
|
14557
|
-
eventBreakdown:
|
|
14558
|
-
customFunnel:
|
|
14559
|
-
deviceBreakdown:
|
|
14600
|
+
trend: z28.array(analyticsTrendPointSchema).optional(),
|
|
14601
|
+
topPages: z28.array(analyticsPageRowSchema).optional(),
|
|
14602
|
+
topSources: z28.array(analyticsSourceRowSchema).optional(),
|
|
14603
|
+
topCampaigns: z28.array(analyticsCampaignRowSchema).optional(),
|
|
14604
|
+
countries: z28.array(analyticsDimensionRowSchema).optional(),
|
|
14605
|
+
devices: z28.array(analyticsDimensionRowSchema).optional(),
|
|
14606
|
+
funnels: z28.array(analyticsFunnelSchema).optional(),
|
|
14607
|
+
flowSummary: z28.array(analyticsFlowSummarySchema).optional(),
|
|
14608
|
+
flowPaths: z28.array(analyticsFlowEdgeSchema).optional(),
|
|
14609
|
+
triggers: z28.array(analyticsTriggerRowSchema).optional(),
|
|
14610
|
+
releases: z28.array(analyticsReleaseRowSchema).optional(),
|
|
14611
|
+
paid: z28.array(analyticsPaidRowSchema).optional(),
|
|
14612
|
+
deliveries: z28.array(analyticsDeliveryRowSchema).optional(),
|
|
14613
|
+
submissions: z28.array(analyticsSubmissionRowSchema).optional(),
|
|
14614
|
+
geo: z28.array(analyticsGeoRowSchema).optional(),
|
|
14615
|
+
bots: z28.array(analyticsBotRowSchema).optional(),
|
|
14616
|
+
landings: z28.array(analyticsLandingRowSchema).optional(),
|
|
14617
|
+
tags: z28.array(analyticsTagRowSchema).optional(),
|
|
14618
|
+
customEvents: z28.array(analyticsCustomEventRowSchema).optional(),
|
|
14619
|
+
eventBreakdown: z28.array(analyticsEventBreakdownRowSchema).optional(),
|
|
14620
|
+
customFunnel: z28.array(analyticsCustomFunnelStepSchema).optional(),
|
|
14621
|
+
deviceBreakdown: z28.array(analyticsDeviceRowSchema).optional(),
|
|
14560
14622
|
realtime: analyticsRealtimeSchema.optional(),
|
|
14561
|
-
adDimensions:
|
|
14562
|
-
adParams:
|
|
14623
|
+
adDimensions: z28.array(analyticsAdDimensionRowSchema).optional(),
|
|
14624
|
+
adParams: z28.array(analyticsAdParamRowSchema).optional(),
|
|
14563
14625
|
/**
|
|
14564
14626
|
* Parameters arriving on visits no platform can be named for.
|
|
14565
14627
|
*
|
|
@@ -14572,27 +14634,27 @@ var analyticsQueryDataSchema = z27.object({
|
|
|
14572
14634
|
* map them under, so a reader who recognises one adds it by name to the
|
|
14573
14635
|
* platform they know it belongs to.
|
|
14574
14636
|
*/
|
|
14575
|
-
adParamsUnattributed:
|
|
14576
|
-
adPlatformTraffic:
|
|
14577
|
-
flowDestinations:
|
|
14637
|
+
adParamsUnattributed: z28.array(analyticsAdParamRowSchema).optional(),
|
|
14638
|
+
adPlatformTraffic: z28.array(analyticsAdPlatformTrafficSchema).optional(),
|
|
14639
|
+
flowDestinations: z28.array(analyticsFlowDestinationsSchema).optional(),
|
|
14578
14640
|
/** Present only on a report that was asked for by the page. */
|
|
14579
14641
|
pageInfo: analyticsPageInfoSchema.optional(),
|
|
14580
|
-
conversions:
|
|
14642
|
+
conversions: z28.array(analyticsConversionRowSchema).optional(),
|
|
14581
14643
|
/** Every event these pages produced, counted or not. The "add a conversion" picker. */
|
|
14582
|
-
eventCatalog:
|
|
14583
|
-
timeline:
|
|
14644
|
+
eventCatalog: z28.array(analyticsEventCatalogRowSchema).optional(),
|
|
14645
|
+
timeline: z28.array(analyticsTimelineRowSchema).optional(),
|
|
14584
14646
|
/**
|
|
14585
14647
|
* The raw feed. Same row shape as a replay, because it is the same rows —
|
|
14586
14648
|
* what changes is that this one is bounded by a window rather than by a visit.
|
|
14587
14649
|
*/
|
|
14588
|
-
stream:
|
|
14589
|
-
visitorSessions:
|
|
14650
|
+
stream: z28.array(analyticsTimelineRowSchema).optional(),
|
|
14651
|
+
visitorSessions: z28.array(analyticsVisitorSessionSchema).optional(),
|
|
14590
14652
|
/** Every key this person is known by — contact details, browsers, clicks, cookies. */
|
|
14591
|
-
personKeys:
|
|
14653
|
+
personKeys: z28.array(analyticsPersonKeySchema).optional(),
|
|
14592
14654
|
/** The same person, rolled up: their totals across every device, and what is known about them. */
|
|
14593
14655
|
personProfile: analyticsPersonProfileSchema.optional(),
|
|
14594
14656
|
visitProfile: analyticsVisitProfileSchema.optional(),
|
|
14595
|
-
visitors:
|
|
14657
|
+
visitors: z28.array(analyticsVisitorRowSchema).optional(),
|
|
14596
14658
|
/**
|
|
14597
14659
|
* The same totals for the window immediately before this one, when asked for.
|
|
14598
14660
|
*
|
|
@@ -14600,43 +14662,43 @@ var analyticsQueryDataSchema = z27.object({
|
|
|
14600
14662
|
* deltas, so a caller can show either side of it and does not have to trust
|
|
14601
14663
|
* our arithmetic to render "1,240 vs 980".
|
|
14602
14664
|
*/
|
|
14603
|
-
previous:
|
|
14665
|
+
previous: z28.object({
|
|
14604
14666
|
window: analyticsWindowSchema,
|
|
14605
14667
|
totals: analyticsTotalsSchema
|
|
14606
14668
|
}).optional()
|
|
14607
14669
|
});
|
|
14608
|
-
var analyticsQueryResponseSchema =
|
|
14609
|
-
ok:
|
|
14670
|
+
var analyticsQueryResponseSchema = z28.object({
|
|
14671
|
+
ok: z28.literal(true),
|
|
14610
14672
|
data: analyticsQueryDataSchema,
|
|
14611
|
-
warnings:
|
|
14612
|
-
hints:
|
|
14673
|
+
warnings: z28.array(analyticsWarningSchema).optional(),
|
|
14674
|
+
hints: z28.array(z28.string()).optional()
|
|
14613
14675
|
});
|
|
14614
|
-
var analyticsConversionsRequestSchema =
|
|
14615
|
-
set:
|
|
14616
|
-
|
|
14676
|
+
var analyticsConversionsRequestSchema = z28.object({
|
|
14677
|
+
set: z28.array(
|
|
14678
|
+
z28.object({
|
|
14617
14679
|
/** `form:<flow>:<step>:<trigger>` | `submit:<flow>` | `page:<name>` | `exit:<host>`. */
|
|
14618
|
-
eventKey:
|
|
14619
|
-
name:
|
|
14620
|
-
countMode:
|
|
14680
|
+
eventKey: z28.string().max(320),
|
|
14681
|
+
name: z28.string().max(MAX_CONVERSION_NAME),
|
|
14682
|
+
countMode: z28.enum(CONVERSION_COUNT_MODES).optional()
|
|
14621
14683
|
})
|
|
14622
14684
|
).max(60).optional(),
|
|
14623
|
-
remove:
|
|
14624
|
-
});
|
|
14625
|
-
var analyticsConversionsResponseSchema =
|
|
14626
|
-
ok:
|
|
14627
|
-
data:
|
|
14628
|
-
definitions:
|
|
14629
|
-
|
|
14630
|
-
eventKey:
|
|
14631
|
-
name:
|
|
14632
|
-
countMode:
|
|
14633
|
-
updatedAt:
|
|
14685
|
+
remove: z28.array(z28.string().max(320)).max(60).optional()
|
|
14686
|
+
});
|
|
14687
|
+
var analyticsConversionsResponseSchema = z28.object({
|
|
14688
|
+
ok: z28.literal(true),
|
|
14689
|
+
data: z28.object({
|
|
14690
|
+
definitions: z28.array(
|
|
14691
|
+
z28.object({
|
|
14692
|
+
eventKey: z28.string(),
|
|
14693
|
+
name: z28.string(),
|
|
14694
|
+
countMode: z28.string(),
|
|
14695
|
+
updatedAt: z28.number()
|
|
14634
14696
|
})
|
|
14635
14697
|
)
|
|
14636
14698
|
}),
|
|
14637
|
-
hints:
|
|
14699
|
+
hints: z28.array(z28.string()).optional()
|
|
14638
14700
|
});
|
|
14639
|
-
var analyticsMappingRequestSchema =
|
|
14701
|
+
var analyticsMappingRequestSchema = z28.object({
|
|
14640
14702
|
/**
|
|
14641
14703
|
* Which platform these operations are about. Required for a change.
|
|
14642
14704
|
*
|
|
@@ -14645,15 +14707,15 @@ var analyticsMappingRequestSchema = z27.object({
|
|
|
14645
14707
|
* and a keyword on Meta traffic is not a thing that can exist. Omit it only
|
|
14646
14708
|
* to read the mapping back.
|
|
14647
14709
|
*/
|
|
14648
|
-
platform:
|
|
14710
|
+
platform: z28.enum(AD_PLATFORMS).optional(),
|
|
14649
14711
|
/** Parameter name → role, on `platform`. Merged over what is stored. */
|
|
14650
|
-
set:
|
|
14712
|
+
set: z28.record(z28.string().max(64), adParamRoleSchema).optional(),
|
|
14651
14713
|
/** Parameter names to stop reading, on `platform`. Applied after `set`. */
|
|
14652
|
-
remove:
|
|
14714
|
+
remove: z28.array(z28.string().max(64)).max(64).optional()
|
|
14653
14715
|
});
|
|
14654
|
-
var analyticsMappingResponseSchema =
|
|
14655
|
-
ok:
|
|
14656
|
-
data:
|
|
14716
|
+
var analyticsMappingResponseSchema = z28.object({
|
|
14717
|
+
ok: z28.literal(true),
|
|
14718
|
+
data: z28.object({
|
|
14657
14719
|
/**
|
|
14658
14720
|
* This company's own entries after the change, keyed `<platform>/<name>`.
|
|
14659
14721
|
*
|
|
@@ -14661,7 +14723,7 @@ var analyticsMappingResponseSchema = z27.object({
|
|
|
14661
14723
|
* just mapped `cid` on TikTok is usually about to be asked the same
|
|
14662
14724
|
* question about Google, and the answer there is different.
|
|
14663
14725
|
*/
|
|
14664
|
-
params:
|
|
14726
|
+
params: z28.record(z28.string(), adParamRoleSchema),
|
|
14665
14727
|
/**
|
|
14666
14728
|
* Names that are understood without being configured.
|
|
14667
14729
|
*
|
|
@@ -14669,7 +14731,7 @@ var analyticsMappingResponseSchema = z27.object({
|
|
|
14669
14731
|
* shipping a copy of the built-in list, and so an agent does not spend a
|
|
14670
14732
|
* turn configuring `keyword` to mean keyword.
|
|
14671
14733
|
*/
|
|
14672
|
-
builtIn:
|
|
14734
|
+
builtIn: z28.array(z28.string()),
|
|
14673
14735
|
/**
|
|
14674
14736
|
* What the client's own ad account says about each parameter just staged.
|
|
14675
14737
|
*
|
|
@@ -14679,30 +14741,30 @@ var analyticsMappingResponseSchema = z27.object({
|
|
|
14679
14741
|
* else, so the answer just given would produce a report that is wrong and
|
|
14680
14742
|
* looks entirely plausible.
|
|
14681
14743
|
*/
|
|
14682
|
-
evidence:
|
|
14683
|
-
|
|
14684
|
-
|
|
14685
|
-
status:
|
|
14686
|
-
macro:
|
|
14744
|
+
evidence: z28.record(
|
|
14745
|
+
z28.string(),
|
|
14746
|
+
z28.object({
|
|
14747
|
+
status: z28.enum(["confirmed", "contradicted", "unseen", "not_read"]),
|
|
14748
|
+
macro: z28.string().optional(),
|
|
14687
14749
|
suggestedRole: adParamRoleSchema.optional(),
|
|
14688
|
-
source:
|
|
14689
|
-
reason:
|
|
14750
|
+
source: z28.string().optional(),
|
|
14751
|
+
reason: z28.string().optional()
|
|
14690
14752
|
})
|
|
14691
14753
|
).optional(),
|
|
14692
|
-
updatedAt:
|
|
14754
|
+
updatedAt: z28.number().nullable()
|
|
14693
14755
|
}),
|
|
14694
|
-
hints:
|
|
14756
|
+
hints: z28.array(z28.string()).optional()
|
|
14695
14757
|
});
|
|
14696
|
-
var analyticsTrackingRequestSchema =
|
|
14697
|
-
platform:
|
|
14698
|
-
days:
|
|
14758
|
+
var analyticsTrackingRequestSchema = z28.object({
|
|
14759
|
+
platform: z28.enum(AD_PLATFORMS).optional(),
|
|
14760
|
+
days: z28.number().int().min(1).max(365).optional()
|
|
14699
14761
|
});
|
|
14700
|
-
var trackingDimensionSchema =
|
|
14762
|
+
var trackingDimensionSchema = z28.object({
|
|
14701
14763
|
role: adParamRoleSchema,
|
|
14702
14764
|
/** The platform's own macro for it — what goes in the URL. */
|
|
14703
|
-
macro:
|
|
14765
|
+
macro: z28.string(),
|
|
14704
14766
|
/** The account's own spelling where it has one, else the canonical name. */
|
|
14705
|
-
name:
|
|
14767
|
+
name: z28.string(),
|
|
14706
14768
|
/**
|
|
14707
14769
|
* What has to happen for this dimension to reach a report.
|
|
14708
14770
|
*
|
|
@@ -14713,34 +14775,34 @@ var trackingDimensionSchema = z27.object({
|
|
|
14713
14775
|
* `unknown` means no visit arrived and the account could not be read, which
|
|
14714
14776
|
* must never be reported as untagged.
|
|
14715
14777
|
*/
|
|
14716
|
-
state:
|
|
14717
|
-
evidence:
|
|
14718
|
-
note:
|
|
14719
|
-
});
|
|
14720
|
-
var analyticsTrackingPlatformSchema =
|
|
14721
|
-
platform:
|
|
14722
|
-
label:
|
|
14723
|
-
sessions:
|
|
14778
|
+
state: z28.enum(["covered", "unmapped", "missing", "unknown"]),
|
|
14779
|
+
evidence: z28.string().optional(),
|
|
14780
|
+
note: z28.string().optional()
|
|
14781
|
+
});
|
|
14782
|
+
var analyticsTrackingPlatformSchema = z28.object({
|
|
14783
|
+
platform: z28.enum(AD_PLATFORMS),
|
|
14784
|
+
label: z28.string(),
|
|
14785
|
+
sessions: z28.number(),
|
|
14724
14786
|
/** Whether the ad account itself could be read, and why not when it could not. */
|
|
14725
|
-
account:
|
|
14726
|
-
dimensions:
|
|
14787
|
+
account: z28.object({ read: z28.boolean(), templates: z28.number(), reason: z28.string().optional() }),
|
|
14788
|
+
dimensions: z28.array(trackingDimensionSchema),
|
|
14727
14789
|
/** Names the URLs already carry that Baker does not read yet. */
|
|
14728
|
-
unmapped:
|
|
14729
|
-
mapCommand:
|
|
14730
|
-
unexplained:
|
|
14790
|
+
unmapped: z28.record(z28.string(), adParamRoleSchema),
|
|
14791
|
+
mapCommand: z28.string(),
|
|
14792
|
+
unexplained: z28.array(z28.object({ name: z28.string(), value: z28.string() })),
|
|
14731
14793
|
/** The pairs to append to the account's tagging, or `""`. */
|
|
14732
|
-
suffix:
|
|
14733
|
-
whereItGoes:
|
|
14794
|
+
suffix: z28.string(),
|
|
14795
|
+
whereItGoes: z28.string(),
|
|
14734
14796
|
/** Which level to put them at, who can write it, and how an existing value is treated. */
|
|
14735
|
-
fix:
|
|
14797
|
+
fix: z28.string()
|
|
14736
14798
|
});
|
|
14737
|
-
var analyticsTrackingResponseSchema =
|
|
14738
|
-
ok:
|
|
14739
|
-
data:
|
|
14740
|
-
hints:
|
|
14799
|
+
var analyticsTrackingResponseSchema = z28.object({
|
|
14800
|
+
ok: z28.literal(true),
|
|
14801
|
+
data: z28.object({ days: z28.number(), platforms: z28.array(analyticsTrackingPlatformSchema) }),
|
|
14802
|
+
hints: z28.array(z28.string()).optional()
|
|
14741
14803
|
});
|
|
14742
|
-
var boundedReference = (max) =>
|
|
14743
|
-
var submissionRecordRequestSchema =
|
|
14804
|
+
var boundedReference = (max) => z28.string().transform((value) => cutToLength(value, max));
|
|
14805
|
+
var submissionRecordRequestSchema = z28.object({
|
|
14744
14806
|
/**
|
|
14745
14807
|
* Injected by the Worker from the host or the site key. Never from the page.
|
|
14746
14808
|
*
|
|
@@ -14749,9 +14811,9 @@ var submissionRecordRequestSchema = z27.object({
|
|
|
14749
14811
|
* would produce a row belonging to a company that does not exist, which is
|
|
14750
14812
|
* worse than refusing — this is the case where refusing is right.
|
|
14751
14813
|
*/
|
|
14752
|
-
companyId:
|
|
14814
|
+
companyId: z28.string().min(1),
|
|
14753
14815
|
/** Shared with every destination this submit was sent to, and with its event. */
|
|
14754
|
-
submissionId:
|
|
14816
|
+
submissionId: z28.string().min(1).pipe(boundedReference(128)),
|
|
14755
14817
|
/**
|
|
14756
14818
|
* The Form execution this step belongs to, or `""` from a page published
|
|
14757
14819
|
* before attempts existed.
|
|
@@ -14779,7 +14841,7 @@ var submissionRecordRequestSchema = z27.object({
|
|
|
14779
14841
|
* Degraded rather than refused, like everything else here: an unrecognised
|
|
14780
14842
|
* kind costs the copy one label, and refusing it would cost the copy.
|
|
14781
14843
|
*/
|
|
14782
|
-
identityKind:
|
|
14844
|
+
identityKind: z28.enum(["email", "phone"]).optional().catch(void 0),
|
|
14783
14845
|
/** Injected by the Worker's edge. Kept exactly here and as a /24 everywhere else. */
|
|
14784
14846
|
clientIp: boundedReference(64).nullish(),
|
|
14785
14847
|
/**
|
|
@@ -14790,7 +14852,7 @@ var submissionRecordRequestSchema = z27.object({
|
|
|
14790
14852
|
* pasted a paragraph into a free-text field lost the email and the budget
|
|
14791
14853
|
* beside it too. See {@link boundSubmissionAnswers}.
|
|
14792
14854
|
*/
|
|
14793
|
-
answers:
|
|
14855
|
+
answers: z28.record(z28.string(), z28.string()).transform(boundSubmissionAnswers)
|
|
14794
14856
|
});
|
|
14795
14857
|
|
|
14796
14858
|
// src/commands/ads/google/mapping-hints.ts
|
|
@@ -21499,7 +21561,7 @@ var NUMERIC_ID_REGEX3 = /^\d+$/;
|
|
|
21499
21561
|
var IMAGE_HASH_REGEX = /^[A-Fa-f0-9]{16,}$/;
|
|
21500
21562
|
|
|
21501
21563
|
// ../api/src/ads-meta/ops.ts
|
|
21502
|
-
import { z as
|
|
21564
|
+
import { z as z29 } from "zod";
|
|
21503
21565
|
|
|
21504
21566
|
// ../api/src/ads-meta/placements.ts
|
|
21505
21567
|
var FACEBOOK_POSITIONS_REQUIRING_FEED = ["marketplace", "search", "profile_feed", "notification"];
|
|
@@ -21571,16 +21633,16 @@ function positionsMissingRequiredFeed(targeting) {
|
|
|
21571
21633
|
}
|
|
21572
21634
|
|
|
21573
21635
|
// ../api/src/ads-meta/ops.ts
|
|
21574
|
-
var tempRefSchema4 =
|
|
21575
|
-
var parentRefSchema3 =
|
|
21576
|
-
var moneySchema2 =
|
|
21577
|
-
amount:
|
|
21578
|
-
currencyCode:
|
|
21579
|
-
});
|
|
21580
|
-
var httpsUrlSchema3 =
|
|
21581
|
-
var bakerMediaIdSchema2 =
|
|
21582
|
-
var stageableStatusSchema3 =
|
|
21583
|
-
var updateStatusSchema =
|
|
21636
|
+
var tempRefSchema4 = z29.string().regex(TEMP_REF_REGEX4, "expected a meta_temp_* reference");
|
|
21637
|
+
var parentRefSchema3 = z29.union([z29.string().regex(NUMERIC_ID_REGEX3, "expected a numeric id"), tempRefSchema4]);
|
|
21638
|
+
var moneySchema2 = z29.object({
|
|
21639
|
+
amount: z29.string().regex(/^\d+(\.\d{1,2})?$/, "expected a decimal amount like 50 or 50.00").refine((val) => Number(val) > 0, "amount must be greater than zero"),
|
|
21640
|
+
currencyCode: z29.string().length(3).optional()
|
|
21641
|
+
});
|
|
21642
|
+
var httpsUrlSchema3 = z29.string().url().refine((u) => u.startsWith("https://"), "destination URLs must be https");
|
|
21643
|
+
var bakerMediaIdSchema2 = z29.string().min(1);
|
|
21644
|
+
var stageableStatusSchema3 = z29.enum(STAGEABLE_CREATE_STATUSES4);
|
|
21645
|
+
var updateStatusSchema = z29.enum(UPDATE_STATUSES);
|
|
21584
21646
|
function currencyMinimums2(currencyCode) {
|
|
21585
21647
|
return CURRENCY_MINIMUMS2[currencyCode] ?? DEFAULT_CURRENCY_MINIMUM2;
|
|
21586
21648
|
}
|
|
@@ -21592,35 +21654,35 @@ function validateDailyBudgetFloor(money, ctx, path38) {
|
|
|
21592
21654
|
}
|
|
21593
21655
|
}
|
|
21594
21656
|
}
|
|
21595
|
-
var geoLocationsSchema =
|
|
21596
|
-
countries:
|
|
21597
|
-
regions:
|
|
21598
|
-
cities:
|
|
21599
|
-
zips:
|
|
21600
|
-
location_types:
|
|
21601
|
-
}).catchall(
|
|
21602
|
-
var idNameSchema =
|
|
21603
|
-
var metaTargetingSchema =
|
|
21657
|
+
var geoLocationsSchema = z29.object({
|
|
21658
|
+
countries: z29.array(z29.string().length(2)).optional(),
|
|
21659
|
+
regions: z29.array(z29.object({ key: z29.string() })).optional(),
|
|
21660
|
+
cities: z29.array(z29.object({ key: z29.string(), radius: z29.number().optional(), distance_unit: z29.string().optional() })).optional(),
|
|
21661
|
+
zips: z29.array(z29.object({ key: z29.string() })).optional(),
|
|
21662
|
+
location_types: z29.array(z29.string()).optional()
|
|
21663
|
+
}).catchall(z29.unknown());
|
|
21664
|
+
var idNameSchema = z29.object({ id: z29.string(), name: z29.string().optional() });
|
|
21665
|
+
var metaTargetingSchema = z29.object({
|
|
21604
21666
|
geo_locations: geoLocationsSchema.optional(),
|
|
21605
21667
|
excluded_geo_locations: geoLocationsSchema.optional(),
|
|
21606
|
-
age_min:
|
|
21607
|
-
age_max:
|
|
21608
|
-
genders:
|
|
21609
|
-
locales:
|
|
21610
|
-
interests:
|
|
21611
|
-
behaviors:
|
|
21612
|
-
custom_audiences:
|
|
21613
|
-
excluded_custom_audiences:
|
|
21614
|
-
flexible_spec:
|
|
21615
|
-
exclusions:
|
|
21616
|
-
publisher_platforms:
|
|
21617
|
-
facebook_positions:
|
|
21618
|
-
instagram_positions:
|
|
21619
|
-
audience_network_positions:
|
|
21620
|
-
messenger_positions:
|
|
21621
|
-
device_platforms:
|
|
21622
|
-
targeting_automation:
|
|
21623
|
-
}).catchall(
|
|
21668
|
+
age_min: z29.number().int().min(13).max(65).optional(),
|
|
21669
|
+
age_max: z29.number().int().min(13).max(65).optional(),
|
|
21670
|
+
genders: z29.array(z29.union([z29.literal(1), z29.literal(2)])).optional(),
|
|
21671
|
+
locales: z29.array(z29.number().int()).optional(),
|
|
21672
|
+
interests: z29.array(idNameSchema).optional(),
|
|
21673
|
+
behaviors: z29.array(idNameSchema).optional(),
|
|
21674
|
+
custom_audiences: z29.array(z29.object({ id: parentRefSchema3 })).optional(),
|
|
21675
|
+
excluded_custom_audiences: z29.array(z29.object({ id: parentRefSchema3 })).optional(),
|
|
21676
|
+
flexible_spec: z29.array(z29.record(z29.string(), z29.unknown())).optional(),
|
|
21677
|
+
exclusions: z29.record(z29.string(), z29.unknown()).optional(),
|
|
21678
|
+
publisher_platforms: z29.array(z29.string()).optional(),
|
|
21679
|
+
facebook_positions: z29.array(z29.string()).optional(),
|
|
21680
|
+
instagram_positions: z29.array(z29.string()).optional(),
|
|
21681
|
+
audience_network_positions: z29.array(z29.string()).optional(),
|
|
21682
|
+
messenger_positions: z29.array(z29.string()).optional(),
|
|
21683
|
+
device_platforms: z29.array(z29.string()).optional(),
|
|
21684
|
+
targeting_automation: z29.object({ advantage_audience: z29.union([z29.literal(0), z29.literal(1)]) }).partial().optional()
|
|
21685
|
+
}).catchall(z29.unknown());
|
|
21624
21686
|
var GEO_INCLUSION_KEYS = [
|
|
21625
21687
|
"countries",
|
|
21626
21688
|
"country_groups",
|
|
@@ -21659,15 +21721,15 @@ function targetingHardLimitsDemographics(t) {
|
|
|
21659
21721
|
const narrowsGender = Array.isArray(t.genders) && t.genders.length === 1;
|
|
21660
21722
|
return narrowsAgeMax || narrowsAgeMin || narrowsGender;
|
|
21661
21723
|
}
|
|
21662
|
-
var specialAdCategoriesSchema =
|
|
21663
|
-
var campaignCreateSchema4 =
|
|
21664
|
-
name:
|
|
21665
|
-
objective:
|
|
21724
|
+
var specialAdCategoriesSchema = z29.array(z29.enum(SPECIAL_AD_CATEGORIES)).default(["NONE"]);
|
|
21725
|
+
var campaignCreateSchema4 = z29.object({
|
|
21726
|
+
name: z29.string().min(1).max(META_LIMITS.campaign.nameMax),
|
|
21727
|
+
objective: z29.enum(OBJECTIVES2),
|
|
21666
21728
|
status: stageableStatusSchema3.default("PAUSED"),
|
|
21667
21729
|
special_ad_categories: specialAdCategoriesSchema,
|
|
21668
|
-
special_ad_category_country:
|
|
21669
|
-
buying_type:
|
|
21670
|
-
bid_strategy:
|
|
21730
|
+
special_ad_category_country: z29.array(z29.string().length(2)).optional(),
|
|
21731
|
+
buying_type: z29.enum(BUYING_TYPES).default("AUCTION"),
|
|
21732
|
+
bid_strategy: z29.enum(BID_STRATEGIES2).optional(),
|
|
21671
21733
|
/** Campaign Budget Optimization (Advantage campaign budget) — mutually exclusive with ad-set budgets. */
|
|
21672
21734
|
dailyBudget: moneySchema2.optional(),
|
|
21673
21735
|
lifetimeBudget: moneySchema2.optional(),
|
|
@@ -21678,9 +21740,9 @@ var campaignCreateSchema4 = z28.object({
|
|
|
21678
21740
|
* campaign budget (subcode 4834011); Baker sends false unless asked, because
|
|
21679
21741
|
* turning it on moves real spend between ad sets nobody asked to move.
|
|
21680
21742
|
*/
|
|
21681
|
-
adSetBudgetSharing:
|
|
21682
|
-
start_time:
|
|
21683
|
-
stop_time:
|
|
21743
|
+
adSetBudgetSharing: z29.boolean().optional(),
|
|
21744
|
+
start_time: z29.number().int().positive().optional(),
|
|
21745
|
+
stop_time: z29.number().int().positive().optional()
|
|
21684
21746
|
}).superRefine((p, ctx) => {
|
|
21685
21747
|
if (p.dailyBudget && p.lifetimeBudget) {
|
|
21686
21748
|
ctx.addIssue({ code: "custom", path: ["dailyBudget"], message: "set only one of dailyBudget or lifetimeBudget" });
|
|
@@ -21698,15 +21760,15 @@ var campaignCreateSchema4 = z28.object({
|
|
|
21698
21760
|
});
|
|
21699
21761
|
}
|
|
21700
21762
|
});
|
|
21701
|
-
var campaignUpdateSchema4 =
|
|
21702
|
-
name:
|
|
21763
|
+
var campaignUpdateSchema4 = z29.object({
|
|
21764
|
+
name: z29.string().min(1).max(META_LIMITS.campaign.nameMax).optional(),
|
|
21703
21765
|
status: updateStatusSchema.optional(),
|
|
21704
|
-
bid_strategy:
|
|
21766
|
+
bid_strategy: z29.enum(BID_STRATEGIES2).optional(),
|
|
21705
21767
|
dailyBudget: moneySchema2.optional(),
|
|
21706
21768
|
lifetimeBudget: moneySchema2.optional(),
|
|
21707
21769
|
spendCap: moneySchema2.optional(),
|
|
21708
|
-
start_time:
|
|
21709
|
-
stop_time:
|
|
21770
|
+
start_time: z29.number().int().positive().optional(),
|
|
21771
|
+
stop_time: z29.number().int().positive().optional()
|
|
21710
21772
|
}).superRefine((p, ctx) => {
|
|
21711
21773
|
if (!Object.values(p).some((val) => val !== void 0)) {
|
|
21712
21774
|
ctx.addIssue({ code: "custom", message: "update needs at least one field" });
|
|
@@ -21716,42 +21778,42 @@ var campaignUpdateSchema4 = z28.object({
|
|
|
21716
21778
|
}
|
|
21717
21779
|
validateDailyBudgetFloor(p.dailyBudget, ctx, ["dailyBudget", "amount"]);
|
|
21718
21780
|
});
|
|
21719
|
-
var promotedObjectSchema =
|
|
21781
|
+
var promotedObjectSchema = z29.object({
|
|
21720
21782
|
page_id: parentRefSchema3.optional(),
|
|
21721
|
-
pixel_id:
|
|
21722
|
-
custom_event_type:
|
|
21723
|
-
application_id:
|
|
21724
|
-
object_store_url:
|
|
21725
|
-
product_catalog_id:
|
|
21726
|
-
product_set_id:
|
|
21727
|
-
whatsapp_phone_number:
|
|
21728
|
-
offline_conversion_data_set_id:
|
|
21783
|
+
pixel_id: z29.string().regex(NUMERIC_ID_REGEX3).optional(),
|
|
21784
|
+
custom_event_type: z29.enum(CUSTOM_EVENT_TYPES).optional(),
|
|
21785
|
+
application_id: z29.string().regex(NUMERIC_ID_REGEX3).optional(),
|
|
21786
|
+
object_store_url: z29.string().url().optional(),
|
|
21787
|
+
product_catalog_id: z29.string().regex(NUMERIC_ID_REGEX3).optional(),
|
|
21788
|
+
product_set_id: z29.string().regex(NUMERIC_ID_REGEX3).optional(),
|
|
21789
|
+
whatsapp_phone_number: z29.string().optional(),
|
|
21790
|
+
offline_conversion_data_set_id: z29.string().regex(NUMERIC_ID_REGEX3).optional()
|
|
21729
21791
|
}).partial();
|
|
21730
|
-
var attributionSpecSchema =
|
|
21731
|
-
|
|
21732
|
-
event_type:
|
|
21733
|
-
window_days:
|
|
21792
|
+
var attributionSpecSchema = z29.array(
|
|
21793
|
+
z29.object({
|
|
21794
|
+
event_type: z29.enum(ATTRIBUTION_EVENT_TYPES),
|
|
21795
|
+
window_days: z29.union([z29.literal(1), z29.literal(7), z29.literal(28)])
|
|
21734
21796
|
})
|
|
21735
21797
|
);
|
|
21736
21798
|
var adSetFields = {
|
|
21737
|
-
name:
|
|
21799
|
+
name: z29.string().min(1).max(META_LIMITS.adSet.nameMax),
|
|
21738
21800
|
campaign_id: parentRefSchema3,
|
|
21739
21801
|
status: stageableStatusSchema3.default("PAUSED"),
|
|
21740
21802
|
dailyBudget: moneySchema2.optional(),
|
|
21741
21803
|
lifetimeBudget: moneySchema2.optional(),
|
|
21742
21804
|
bidAmount: moneySchema2.optional(),
|
|
21743
|
-
bid_strategy:
|
|
21744
|
-
billing_event:
|
|
21745
|
-
optimization_goal:
|
|
21746
|
-
destination_type:
|
|
21805
|
+
bid_strategy: z29.enum(BID_STRATEGIES2).optional(),
|
|
21806
|
+
billing_event: z29.enum(BILLING_EVENTS),
|
|
21807
|
+
optimization_goal: z29.enum(OPTIMIZATION_GOALS),
|
|
21808
|
+
destination_type: z29.enum(DESTINATION_TYPES).optional(),
|
|
21747
21809
|
promoted_object: promotedObjectSchema.optional(),
|
|
21748
21810
|
attribution_spec: attributionSpecSchema.optional(),
|
|
21749
|
-
start_time:
|
|
21750
|
-
end_time:
|
|
21811
|
+
start_time: z29.number().int().positive().optional(),
|
|
21812
|
+
end_time: z29.number().int().positive().optional(),
|
|
21751
21813
|
targeting: metaTargetingSchema,
|
|
21752
21814
|
/** EU Digital Services Act: who benefits from / pays for the ad. Auto-filled from the account for EU geo when omitted. */
|
|
21753
|
-
dsa_beneficiary:
|
|
21754
|
-
dsa_payor:
|
|
21815
|
+
dsa_beneficiary: z29.string().min(1).max(100).optional(),
|
|
21816
|
+
dsa_payor: z29.string().min(1).max(100).optional()
|
|
21755
21817
|
};
|
|
21756
21818
|
function validateBidStrategy(p, ctx) {
|
|
21757
21819
|
const strategy = p.bid_strategy;
|
|
@@ -21858,7 +21920,7 @@ function validateAdSetPlacements(p, ctx) {
|
|
|
21858
21920
|
});
|
|
21859
21921
|
}
|
|
21860
21922
|
}
|
|
21861
|
-
var adSetCreateSchema =
|
|
21923
|
+
var adSetCreateSchema = z29.object(adSetFields).superRefine((p, ctx) => {
|
|
21862
21924
|
validateAdSetBudgetAndBid(p, ctx);
|
|
21863
21925
|
validateAdSetPromotedObject(p, ctx);
|
|
21864
21926
|
validateAdvantageAudience(p, ctx);
|
|
@@ -21871,22 +21933,22 @@ var adSetCreateSchema = z28.object(adSetFields).superRefine((p, ctx) => {
|
|
|
21871
21933
|
});
|
|
21872
21934
|
}
|
|
21873
21935
|
});
|
|
21874
|
-
var adSetUpdateSchema =
|
|
21936
|
+
var adSetUpdateSchema = z29.object({
|
|
21875
21937
|
name: adSetFields.name.optional(),
|
|
21876
21938
|
status: updateStatusSchema.optional(),
|
|
21877
21939
|
dailyBudget: moneySchema2.optional(),
|
|
21878
21940
|
lifetimeBudget: moneySchema2.optional(),
|
|
21879
21941
|
bidAmount: moneySchema2.optional(),
|
|
21880
|
-
bid_strategy:
|
|
21881
|
-
optimization_goal:
|
|
21882
|
-
destination_type:
|
|
21942
|
+
bid_strategy: z29.enum(BID_STRATEGIES2).optional(),
|
|
21943
|
+
optimization_goal: z29.enum(OPTIMIZATION_GOALS).optional(),
|
|
21944
|
+
destination_type: z29.enum(DESTINATION_TYPES).optional(),
|
|
21883
21945
|
promoted_object: promotedObjectSchema.optional(),
|
|
21884
21946
|
attribution_spec: attributionSpecSchema.optional(),
|
|
21885
|
-
start_time:
|
|
21886
|
-
end_time:
|
|
21947
|
+
start_time: z29.number().int().positive().optional(),
|
|
21948
|
+
end_time: z29.number().int().positive().optional(),
|
|
21887
21949
|
targeting: metaTargetingSchema.optional(),
|
|
21888
|
-
dsa_beneficiary:
|
|
21889
|
-
dsa_payor:
|
|
21950
|
+
dsa_beneficiary: z29.string().min(1).max(100).optional(),
|
|
21951
|
+
dsa_payor: z29.string().min(1).max(100).optional()
|
|
21890
21952
|
}).superRefine((p, ctx) => {
|
|
21891
21953
|
if (!Object.values(p).some((val) => val !== void 0)) {
|
|
21892
21954
|
ctx.addIssue({ code: "custom", message: "update needs at least one field" });
|
|
@@ -21898,11 +21960,11 @@ var adSetUpdateSchema = z28.object({
|
|
|
21898
21960
|
validateAdvantageAudience(p, ctx);
|
|
21899
21961
|
validateAdSetPlacements(p, ctx);
|
|
21900
21962
|
});
|
|
21901
|
-
var messageSchema =
|
|
21902
|
-
var headlineSchema2 =
|
|
21903
|
-
var descriptionSchema =
|
|
21904
|
-
var callToActionSchema =
|
|
21905
|
-
type:
|
|
21963
|
+
var messageSchema = z29.string().min(1).max(META_LIMITS.creative.messageHardMax);
|
|
21964
|
+
var headlineSchema2 = z29.string().min(1).max(META_LIMITS.creative.headlineMax);
|
|
21965
|
+
var descriptionSchema = z29.string().min(1).max(META_LIMITS.creative.descriptionMax);
|
|
21966
|
+
var callToActionSchema = z29.object({
|
|
21967
|
+
type: z29.enum(CTA_TYPES2),
|
|
21906
21968
|
/** Overrides the base link for the CTA button; defaults to the ad's link. */
|
|
21907
21969
|
link: httpsUrlSchema3.optional(),
|
|
21908
21970
|
/**
|
|
@@ -21912,7 +21974,7 @@ var callToActionSchema = z28.object({
|
|
|
21912
21974
|
* Without it Meta refuses every ad in that ad set with subcode 3390001,
|
|
21913
21975
|
* "Choose or create an instant form for your leads campaign".
|
|
21914
21976
|
*/
|
|
21915
|
-
lead_gen_form_id:
|
|
21977
|
+
lead_gen_form_id: z29.string().regex(NUMERIC_ID_REGEX3).optional()
|
|
21916
21978
|
}).superRefine((p, ctx) => {
|
|
21917
21979
|
if (p.lead_gen_form_id && !LEAD_FORM_CTA_TYPES.some((allowed) => allowed === p.type)) {
|
|
21918
21980
|
ctx.addIssue({
|
|
@@ -21922,30 +21984,30 @@ var callToActionSchema = z28.object({
|
|
|
21922
21984
|
});
|
|
21923
21985
|
}
|
|
21924
21986
|
});
|
|
21925
|
-
var creativeEnhancementsSchema =
|
|
21926
|
-
standardEnhancements:
|
|
21927
|
-
features:
|
|
21987
|
+
var creativeEnhancementsSchema = z29.object({
|
|
21988
|
+
standardEnhancements: z29.enum(ENROLL_STATUSES).optional(),
|
|
21989
|
+
features: z29.record(z29.string(), z29.enum(ENROLL_STATUSES)).optional()
|
|
21928
21990
|
});
|
|
21929
21991
|
var creativeSharedFields = {
|
|
21930
|
-
name:
|
|
21992
|
+
name: z29.string().max(META_LIMITS.creative.nameMax).optional(),
|
|
21931
21993
|
/** Facebook Page id backing the ad's identity. */
|
|
21932
21994
|
page_id: parentRefSchema3,
|
|
21933
21995
|
/** Instagram account id for IG placements (aka instagram_actor_id on read). */
|
|
21934
|
-
instagram_user_id:
|
|
21996
|
+
instagram_user_id: z29.string().regex(NUMERIC_ID_REGEX3).optional(),
|
|
21935
21997
|
/** URL tracking parameters appended to the destination, e.g. "utm_source=fb&utm_campaign=x". */
|
|
21936
|
-
url_tags:
|
|
21998
|
+
url_tags: z29.string().max(1e3).optional(),
|
|
21937
21999
|
enhancements: creativeEnhancementsSchema.optional()
|
|
21938
22000
|
};
|
|
21939
22001
|
var imageMediaFields = {
|
|
21940
|
-
imageHash:
|
|
22002
|
+
imageHash: z29.string().regex(IMAGE_HASH_REGEX).optional(),
|
|
21941
22003
|
imageRef: tempRefSchema4.optional()
|
|
21942
22004
|
};
|
|
21943
22005
|
var videoMediaFields = {
|
|
21944
|
-
videoId:
|
|
22006
|
+
videoId: z29.string().regex(NUMERIC_ID_REGEX3).optional(),
|
|
21945
22007
|
videoRef: tempRefSchema4.optional(),
|
|
21946
22008
|
/** Thumbnail for a video creative — image hash, ref, or public url. */
|
|
21947
|
-
thumbnailHash:
|
|
21948
|
-
imageUrl:
|
|
22009
|
+
thumbnailHash: z29.string().regex(IMAGE_HASH_REGEX).optional(),
|
|
22010
|
+
imageUrl: z29.string().url().optional()
|
|
21949
22011
|
};
|
|
21950
22012
|
function countImageRefs(p) {
|
|
21951
22013
|
return [p.imageHash, p.imageRef].filter(Boolean).length;
|
|
@@ -21953,8 +22015,8 @@ function countImageRefs(p) {
|
|
|
21953
22015
|
function countVideoRefs(p) {
|
|
21954
22016
|
return [p.videoId, p.videoRef].filter(Boolean).length;
|
|
21955
22017
|
}
|
|
21956
|
-
var singleCreativeSchema =
|
|
21957
|
-
creativeType:
|
|
22018
|
+
var singleCreativeSchema = z29.object({
|
|
22019
|
+
creativeType: z29.literal("single"),
|
|
21958
22020
|
...creativeSharedFields,
|
|
21959
22021
|
/** Primary text. */
|
|
21960
22022
|
message: messageSchema,
|
|
@@ -21963,7 +22025,7 @@ var singleCreativeSchema = z28.object({
|
|
|
21963
22025
|
headline: headlineSchema2.optional(),
|
|
21964
22026
|
description: descriptionSchema.optional(),
|
|
21965
22027
|
/** Display URL / caption shown under the headline. */
|
|
21966
|
-
caption:
|
|
22028
|
+
caption: z29.string().max(255).optional(),
|
|
21967
22029
|
call_to_action: callToActionSchema.optional(),
|
|
21968
22030
|
...imageMediaFields,
|
|
21969
22031
|
...videoMediaFields
|
|
@@ -21987,10 +22049,10 @@ var singleCreativeSchema = z28.object({
|
|
|
21987
22049
|
});
|
|
21988
22050
|
}
|
|
21989
22051
|
});
|
|
21990
|
-
var carouselCardSchema =
|
|
22052
|
+
var carouselCardSchema = z29.object({
|
|
21991
22053
|
link: httpsUrlSchema3,
|
|
21992
|
-
headline:
|
|
21993
|
-
description:
|
|
22054
|
+
headline: z29.string().max(META_LIMITS.creative.headlineMax).optional(),
|
|
22055
|
+
description: z29.string().max(META_LIMITS.creative.descriptionMax).optional(),
|
|
21994
22056
|
call_to_action: callToActionSchema.optional(),
|
|
21995
22057
|
...imageMediaFields,
|
|
21996
22058
|
...videoMediaFields
|
|
@@ -22010,14 +22072,14 @@ var carouselCardSchema = z28.object({
|
|
|
22010
22072
|
ctx.addIssue({ code: "custom", path: ["videoId"], message: "each card is an image OR a video, not both" });
|
|
22011
22073
|
}
|
|
22012
22074
|
});
|
|
22013
|
-
var carouselCreativeSchema2 =
|
|
22014
|
-
creativeType:
|
|
22075
|
+
var carouselCreativeSchema2 = z29.object({
|
|
22076
|
+
creativeType: z29.literal("carousel"),
|
|
22015
22077
|
...creativeSharedFields,
|
|
22016
22078
|
message: messageSchema,
|
|
22017
22079
|
/** Optional "see more" card destination applied when a card has no own link. */
|
|
22018
22080
|
link: httpsUrlSchema3.optional(),
|
|
22019
22081
|
call_to_action: callToActionSchema.optional(),
|
|
22020
|
-
cards:
|
|
22082
|
+
cards: z29.array(carouselCardSchema).min(META_LIMITS.creative.carouselCardsMin).max(META_LIMITS.creative.carouselCardsMax)
|
|
22021
22083
|
}).superRefine((p, ctx) => {
|
|
22022
22084
|
const forms = new Set(
|
|
22023
22085
|
[p.call_to_action?.lead_gen_form_id, ...p.cards.map((card) => card.call_to_action?.lead_gen_form_id)].filter(
|
|
@@ -22032,27 +22094,27 @@ var carouselCreativeSchema2 = z28.object({
|
|
|
22032
22094
|
});
|
|
22033
22095
|
}
|
|
22034
22096
|
});
|
|
22035
|
-
var dynamicImageSchema =
|
|
22036
|
-
var dynamicVideoSchema =
|
|
22097
|
+
var dynamicImageSchema = z29.object({ ...imageMediaFields }).refine((p) => countImageRefs(p) === 1, "each dynamic image needs exactly one reference");
|
|
22098
|
+
var dynamicVideoSchema = z29.object({
|
|
22037
22099
|
videoId: videoMediaFields.videoId,
|
|
22038
22100
|
videoRef: videoMediaFields.videoRef,
|
|
22039
22101
|
thumbnailHash: videoMediaFields.thumbnailHash
|
|
22040
22102
|
}).refine((p) => countVideoRefs(p) === 1, "each dynamic video needs exactly one reference");
|
|
22041
22103
|
var DYN = META_LIMITS.creative;
|
|
22042
|
-
var dynamicCreativeSchema =
|
|
22043
|
-
creativeType:
|
|
22104
|
+
var dynamicCreativeSchema = z29.object({
|
|
22105
|
+
creativeType: z29.literal("dynamic"),
|
|
22044
22106
|
...creativeSharedFields,
|
|
22045
|
-
bodies:
|
|
22046
|
-
titles:
|
|
22047
|
-
descriptions:
|
|
22048
|
-
images:
|
|
22049
|
-
videos:
|
|
22107
|
+
bodies: z29.array(z29.object({ text: messageSchema })).min(DYN.dynamicTextsMin).max(DYN.dynamicTextsMax),
|
|
22108
|
+
titles: z29.array(z29.object({ text: headlineSchema2 })).min(DYN.dynamicTextsMin).max(DYN.dynamicTextsMax),
|
|
22109
|
+
descriptions: z29.array(z29.object({ text: descriptionSchema })).max(DYN.dynamicTextsMax).optional(),
|
|
22110
|
+
images: z29.array(dynamicImageSchema).optional(),
|
|
22111
|
+
videos: z29.array(dynamicVideoSchema).optional(),
|
|
22050
22112
|
/**
|
|
22051
22113
|
* Optional: Meta infers the format from the assets when it is omitted, and
|
|
22052
22114
|
* every flexible creative read back off a live account omits it.
|
|
22053
22115
|
*/
|
|
22054
|
-
ad_formats:
|
|
22055
|
-
call_to_action_types:
|
|
22116
|
+
ad_formats: z29.array(z29.enum(AD_FORMATS2)).min(1).optional(),
|
|
22117
|
+
call_to_action_types: z29.array(z29.string()).optional(),
|
|
22056
22118
|
/**
|
|
22057
22119
|
* The button on the creative's own `link_data` — a flexible ad carries both
|
|
22058
22120
|
* envelopes, and this is the one that takes `SEE_DETAILS`. Kept separate
|
|
@@ -22060,7 +22122,7 @@ var dynamicCreativeSchema = z28.object({
|
|
|
22060
22122
|
* different enums.
|
|
22061
22123
|
*/
|
|
22062
22124
|
call_to_action: callToActionSchema.optional(),
|
|
22063
|
-
link_urls:
|
|
22125
|
+
link_urls: z29.array(z29.object({ website_url: httpsUrlSchema3, display_url: z29.string().optional() })).min(1),
|
|
22064
22126
|
/**
|
|
22065
22127
|
* `asset_feed_spec.optimization_type` — passed through as a free string on
|
|
22066
22128
|
* purpose. Meta's own 400 enumerates ten values and then accepts
|
|
@@ -22068,9 +22130,9 @@ var dynamicCreativeSchema = z28.object({
|
|
|
22068
22130
|
* Advantage+ flexible creative on a live account reports. An enum here
|
|
22069
22131
|
* would refuse the value Meta itself hands back.
|
|
22070
22132
|
*/
|
|
22071
|
-
optimization_type:
|
|
22133
|
+
optimization_type: z29.string().optional(),
|
|
22072
22134
|
/** Multi-language / placement customization — structural passthrough for v1. */
|
|
22073
|
-
asset_customization_rules:
|
|
22135
|
+
asset_customization_rules: z29.array(z29.record(z29.string(), z29.unknown())).optional()
|
|
22074
22136
|
}).superRefine((p, ctx) => {
|
|
22075
22137
|
if (!(p.images?.length || p.videos?.length)) {
|
|
22076
22138
|
ctx.addIssue({
|
|
@@ -22091,27 +22153,27 @@ var dynamicCreativeSchema = z28.object({
|
|
|
22091
22153
|
});
|
|
22092
22154
|
});
|
|
22093
22155
|
});
|
|
22094
|
-
var existingPostCreativeSchema =
|
|
22095
|
-
creativeType:
|
|
22156
|
+
var existingPostCreativeSchema = z29.object({
|
|
22157
|
+
creativeType: z29.literal("existing_post"),
|
|
22096
22158
|
name: creativeSharedFields.name,
|
|
22097
22159
|
/** "<page_id>_<post_id>" object story id of the post to promote. */
|
|
22098
|
-
object_story_id:
|
|
22160
|
+
object_story_id: z29.string().regex(/^\d+_\d+$/, 'expected "<page_id>_<post_id>"'),
|
|
22099
22161
|
instagram_user_id: creativeSharedFields.instagram_user_id,
|
|
22100
22162
|
url_tags: creativeSharedFields.url_tags,
|
|
22101
22163
|
enhancements: creativeSharedFields.enhancements
|
|
22102
22164
|
});
|
|
22103
|
-
var specCreativeSchema =
|
|
22104
|
-
creativeType:
|
|
22165
|
+
var specCreativeSchema = z29.object({
|
|
22166
|
+
creativeType: z29.literal("spec"),
|
|
22105
22167
|
name: creativeSharedFields.name,
|
|
22106
22168
|
url_tags: creativeSharedFields.url_tags,
|
|
22107
22169
|
/** Promote the existing post — keeps the ad's likes, comments and shares. */
|
|
22108
|
-
object_story_id:
|
|
22109
|
-
object_story_spec:
|
|
22110
|
-
asset_feed_spec:
|
|
22111
|
-
degrees_of_freedom_spec:
|
|
22170
|
+
object_story_id: z29.string().regex(/^\d+_\d+$/, 'expected "<page_id>_<post_id>"').optional(),
|
|
22171
|
+
object_story_spec: z29.record(z29.string(), z29.unknown()).optional(),
|
|
22172
|
+
asset_feed_spec: z29.record(z29.string(), z29.unknown()).optional(),
|
|
22173
|
+
degrees_of_freedom_spec: z29.record(z29.string(), z29.unknown()).optional(),
|
|
22112
22174
|
instagram_user_id: creativeSharedFields.instagram_user_id,
|
|
22113
22175
|
/** The creative this spec was cloned from, for the review diff. */
|
|
22114
|
-
clonedFrom:
|
|
22176
|
+
clonedFrom: z29.string().regex(NUMERIC_ID_REGEX3).optional()
|
|
22115
22177
|
}).superRefine((p, ctx) => {
|
|
22116
22178
|
if (!(p.object_story_id || p.object_story_spec || p.asset_feed_spec)) {
|
|
22117
22179
|
ctx.addIssue({
|
|
@@ -22121,7 +22183,7 @@ var specCreativeSchema = z28.object({
|
|
|
22121
22183
|
});
|
|
22122
22184
|
}
|
|
22123
22185
|
});
|
|
22124
|
-
var creativeContentSchema2 =
|
|
22186
|
+
var creativeContentSchema2 = z29.discriminatedUnion("creativeType", [
|
|
22125
22187
|
singleCreativeSchema,
|
|
22126
22188
|
carouselCreativeSchema2,
|
|
22127
22189
|
dynamicCreativeSchema,
|
|
@@ -22129,41 +22191,41 @@ var creativeContentSchema2 = z28.discriminatedUnion("creativeType", [
|
|
|
22129
22191
|
specCreativeSchema
|
|
22130
22192
|
]);
|
|
22131
22193
|
var adCreativeCreateSchema = creativeContentSchema2;
|
|
22132
|
-
var adCreativeUpdateSchema =
|
|
22133
|
-
name:
|
|
22194
|
+
var adCreativeUpdateSchema = z29.object({
|
|
22195
|
+
name: z29.string().max(META_LIMITS.creative.nameMax).optional(),
|
|
22134
22196
|
status: updateStatusSchema.optional(),
|
|
22135
22197
|
/** Content patch — only honored when the target is a staged meta_temp_* creative. */
|
|
22136
|
-
content:
|
|
22198
|
+
content: z29.record(z29.string(), z29.unknown()).optional()
|
|
22137
22199
|
}).refine((p) => Object.values(p).some((val) => val !== void 0), "update needs at least one field");
|
|
22138
|
-
var adCreateSchema2 =
|
|
22139
|
-
name:
|
|
22200
|
+
var adCreateSchema2 = z29.object({
|
|
22201
|
+
name: z29.string().min(1).max(META_LIMITS.ad.nameMax),
|
|
22140
22202
|
adset_id: parentRefSchema3,
|
|
22141
22203
|
status: stageableStatusSchema3.default("PAUSED"),
|
|
22142
|
-
creative:
|
|
22204
|
+
creative: z29.object({ creative_id: parentRefSchema3 }),
|
|
22143
22205
|
/** Conversion pixel / offline event set / view tags — structural passthrough. */
|
|
22144
|
-
tracking_specs:
|
|
22206
|
+
tracking_specs: z29.array(z29.record(z29.string(), z29.unknown())).optional()
|
|
22145
22207
|
});
|
|
22146
|
-
var adUpdateSchema2 =
|
|
22147
|
-
name:
|
|
22208
|
+
var adUpdateSchema2 = z29.object({
|
|
22209
|
+
name: z29.string().min(1).max(META_LIMITS.ad.nameMax).optional(),
|
|
22148
22210
|
status: updateStatusSchema.optional(),
|
|
22149
22211
|
/** Swapping the creative is the Meta way to "edit" an ad's creative. */
|
|
22150
|
-
creative:
|
|
22151
|
-
tracking_specs:
|
|
22212
|
+
creative: z29.object({ creative_id: parentRefSchema3 }).optional(),
|
|
22213
|
+
tracking_specs: z29.array(z29.record(z29.string(), z29.unknown())).optional()
|
|
22152
22214
|
}).refine((p) => Object.values(p).some((val) => val !== void 0), "update needs at least one field");
|
|
22153
|
-
var lookalikeSpecSchema =
|
|
22154
|
-
origin:
|
|
22155
|
-
ratio:
|
|
22156
|
-
country:
|
|
22157
|
-
});
|
|
22158
|
-
var customAudienceCreateSchema =
|
|
22159
|
-
name:
|
|
22160
|
-
subtype:
|
|
22161
|
-
description:
|
|
22162
|
-
customer_file_source:
|
|
22163
|
-
retention_days:
|
|
22215
|
+
var lookalikeSpecSchema = z29.object({
|
|
22216
|
+
origin: z29.array(z29.object({ id: parentRefSchema3 })).min(1),
|
|
22217
|
+
ratio: z29.number().min(0.01).max(0.2).optional(),
|
|
22218
|
+
country: z29.string().length(2).optional()
|
|
22219
|
+
});
|
|
22220
|
+
var customAudienceCreateSchema = z29.object({
|
|
22221
|
+
name: z29.string().min(1).max(META_LIMITS.audience.nameMax),
|
|
22222
|
+
subtype: z29.enum(CUSTOM_AUDIENCE_SUBTYPES),
|
|
22223
|
+
description: z29.string().max(500).optional(),
|
|
22224
|
+
customer_file_source: z29.string().optional(),
|
|
22225
|
+
retention_days: z29.number().int().min(1).max(META_LIMITS.audience.retentionDaysMax).optional(),
|
|
22164
22226
|
lookalike_spec: lookalikeSpecSchema.optional(),
|
|
22165
22227
|
/** Website/engagement rule — structural passthrough validated by Meta. */
|
|
22166
|
-
rule:
|
|
22228
|
+
rule: z29.record(z29.string(), z29.unknown()).optional()
|
|
22167
22229
|
}).superRefine((p, ctx) => {
|
|
22168
22230
|
if (p.subtype === "LOOKALIKE" && !p.lookalike_spec) {
|
|
22169
22231
|
ctx.addIssue({ code: "custom", path: ["lookalike_spec"], message: "LOOKALIKE audiences need a lookalike_spec" });
|
|
@@ -22172,16 +22234,16 @@ var customAudienceCreateSchema = z28.object({
|
|
|
22172
22234
|
ctx.addIssue({ code: "custom", path: ["rule"], message: `${p.subtype} audiences need a rule (use --file)` });
|
|
22173
22235
|
}
|
|
22174
22236
|
});
|
|
22175
|
-
var customAudienceUpdateSchema =
|
|
22176
|
-
name:
|
|
22177
|
-
description:
|
|
22237
|
+
var customAudienceUpdateSchema = z29.object({
|
|
22238
|
+
name: z29.string().min(1).max(META_LIMITS.audience.nameMax).optional(),
|
|
22239
|
+
description: z29.string().max(500).optional()
|
|
22178
22240
|
}).refine((p) => Object.values(p).some((val) => val !== void 0), "update needs at least one field");
|
|
22179
|
-
var mediaUploadSchema =
|
|
22180
|
-
kind:
|
|
22241
|
+
var mediaUploadSchema = z29.object({
|
|
22242
|
+
kind: z29.enum(MEDIA_KINDS),
|
|
22181
22243
|
bakerImageId: bakerMediaIdSchema2.optional(),
|
|
22182
22244
|
bakerVideoId: bakerMediaIdSchema2.optional(),
|
|
22183
22245
|
/** Optional display name / filename hint. */
|
|
22184
|
-
name:
|
|
22246
|
+
name: z29.string().max(255).optional()
|
|
22185
22247
|
}).superRefine((p, ctx) => {
|
|
22186
22248
|
if (p.kind === "image" && !p.bakerImageId) {
|
|
22187
22249
|
ctx.addIssue({ code: "custom", path: ["bakerImageId"], message: "image uploads need a bakerImageId" });
|
|
@@ -22203,16 +22265,16 @@ var META_DRAFT_OP_KINDS = [
|
|
|
22203
22265
|
"customAudience.update",
|
|
22204
22266
|
"media.upload"
|
|
22205
22267
|
];
|
|
22206
|
-
var metaDraftOpKindSchema =
|
|
22207
|
-
var accountIdSchema3 =
|
|
22208
|
-
var updateTargetSchema3 =
|
|
22268
|
+
var metaDraftOpKindSchema = z29.enum(META_DRAFT_OP_KINDS);
|
|
22269
|
+
var accountIdSchema3 = z29.string().regex(NUMERIC_ID_REGEX3, "accountId must be the bare numeric ad account id");
|
|
22270
|
+
var updateTargetSchema3 = z29.union([z29.string().regex(NUMERIC_ID_REGEX3), tempRefSchema4]);
|
|
22209
22271
|
function createOp4(kind, payload) {
|
|
22210
|
-
return
|
|
22272
|
+
return z29.object({ kind: z29.literal(kind), accountId: accountIdSchema3, payload });
|
|
22211
22273
|
}
|
|
22212
22274
|
function updateOp4(kind, payload) {
|
|
22213
|
-
return
|
|
22275
|
+
return z29.object({ kind: z29.literal(kind), accountId: accountIdSchema3, target: updateTargetSchema3, payload });
|
|
22214
22276
|
}
|
|
22215
|
-
var metaDraftOpInputSchema =
|
|
22277
|
+
var metaDraftOpInputSchema = z29.discriminatedUnion("kind", [
|
|
22216
22278
|
createOp4("campaign.create", campaignCreateSchema4),
|
|
22217
22279
|
updateOp4("campaign.update", campaignUpdateSchema4),
|
|
22218
22280
|
createOp4("adSet.create", adSetCreateSchema),
|
|
@@ -22227,17 +22289,17 @@ var metaDraftOpInputSchema = z28.discriminatedUnion("kind", [
|
|
|
22227
22289
|
]);
|
|
22228
22290
|
|
|
22229
22291
|
// ../api/src/ads-meta/wire.ts
|
|
22230
|
-
import { z as
|
|
22231
|
-
var metaWriteModeSchema =
|
|
22232
|
-
var metaDraftOpResultSchema =
|
|
22233
|
-
status:
|
|
22292
|
+
import { z as z30 } from "zod";
|
|
22293
|
+
var metaWriteModeSchema = z30.enum(["live", "simulated"]);
|
|
22294
|
+
var metaDraftOpResultSchema = z30.object({
|
|
22295
|
+
status: z30.enum(["applied", "simulated", "failed", "skipped"]),
|
|
22234
22296
|
/** The resulting Meta node id (campaign/adset/creative/ad/audience) or simulated id. */
|
|
22235
|
-
id:
|
|
22297
|
+
id: z30.string().optional(),
|
|
22236
22298
|
/** For media.upload ops: the resulting image hash. */
|
|
22237
|
-
hash:
|
|
22238
|
-
error:
|
|
22239
|
-
skippedBecause:
|
|
22240
|
-
executedAt:
|
|
22299
|
+
hash: z30.string().optional(),
|
|
22300
|
+
error: z30.string().optional(),
|
|
22301
|
+
skippedBecause: z30.string().optional(),
|
|
22302
|
+
executedAt: z30.number().optional(),
|
|
22241
22303
|
/**
|
|
22242
22304
|
* Read-back check run AFTER the publish finalized — an annotation, never a
|
|
22243
22305
|
* contradiction of `status`. Shared shape with the other staged-write
|
|
@@ -22246,98 +22308,98 @@ var metaDraftOpResultSchema = z29.object({
|
|
|
22246
22308
|
*/
|
|
22247
22309
|
verification: publishVerificationSchema.optional()
|
|
22248
22310
|
});
|
|
22249
|
-
var metaDraftStageRequestSchema =
|
|
22250
|
-
chatId:
|
|
22311
|
+
var metaDraftStageRequestSchema = z30.object({
|
|
22312
|
+
chatId: z30.string(),
|
|
22251
22313
|
op: metaDraftOpInputSchema
|
|
22252
22314
|
});
|
|
22253
|
-
var metaDraftStageResponseSchema =
|
|
22254
|
-
staged:
|
|
22255
|
-
ref:
|
|
22315
|
+
var metaDraftStageResponseSchema = z30.object({
|
|
22316
|
+
staged: z30.literal(true),
|
|
22317
|
+
ref: z30.string(),
|
|
22256
22318
|
kind: metaDraftOpKindSchema,
|
|
22257
22319
|
mode: metaWriteModeSchema,
|
|
22258
|
-
dependsOn:
|
|
22259
|
-
summary:
|
|
22260
|
-
warnings:
|
|
22320
|
+
dependsOn: z30.array(z30.string()),
|
|
22321
|
+
summary: z30.string(),
|
|
22322
|
+
warnings: z30.array(z30.string()),
|
|
22261
22323
|
/** True when the op amended an already-staged op in place instead of appending a new one. */
|
|
22262
|
-
amended:
|
|
22263
|
-
});
|
|
22264
|
-
var metaDraftDuplicateRequestSchema =
|
|
22265
|
-
chatId:
|
|
22266
|
-
accountId:
|
|
22267
|
-
entity:
|
|
22268
|
-
sourceId:
|
|
22269
|
-
overrides:
|
|
22324
|
+
amended: z30.boolean().optional()
|
|
22325
|
+
});
|
|
22326
|
+
var metaDraftDuplicateRequestSchema = z30.object({
|
|
22327
|
+
chatId: z30.string(),
|
|
22328
|
+
accountId: z30.string(),
|
|
22329
|
+
entity: z30.enum(["campaign", "adSet", "ad"]),
|
|
22330
|
+
sourceId: z30.string(),
|
|
22331
|
+
overrides: z30.record(z30.string(), z30.unknown()).optional(),
|
|
22270
22332
|
/** Pause the original after the copy publishes. */
|
|
22271
|
-
replace:
|
|
22272
|
-
});
|
|
22273
|
-
var metaDraftRetagRequestSchema =
|
|
22274
|
-
chatId:
|
|
22275
|
-
accountId:
|
|
22276
|
-
adId:
|
|
22277
|
-
urlTags:
|
|
22278
|
-
set:
|
|
22333
|
+
replace: z30.boolean().optional()
|
|
22334
|
+
});
|
|
22335
|
+
var metaDraftRetagRequestSchema = z30.object({
|
|
22336
|
+
chatId: z30.string(),
|
|
22337
|
+
accountId: z30.string(),
|
|
22338
|
+
adId: z30.string(),
|
|
22339
|
+
urlTags: z30.string().max(1e3).optional(),
|
|
22340
|
+
set: z30.record(z30.string(), z30.string()).optional()
|
|
22279
22341
|
}).refine(
|
|
22280
22342
|
(p) => p.urlTags === void 0 !== (p.set === void 0),
|
|
22281
22343
|
"pass either the whole tracking string or the key=value pairs to change, not both"
|
|
22282
22344
|
);
|
|
22283
|
-
var metaDraftOpViewSchema =
|
|
22284
|
-
ref:
|
|
22345
|
+
var metaDraftOpViewSchema = z30.object({
|
|
22346
|
+
ref: z30.string(),
|
|
22285
22347
|
kind: metaDraftOpKindSchema,
|
|
22286
|
-
accountId:
|
|
22287
|
-
target:
|
|
22288
|
-
dependsOn:
|
|
22289
|
-
summary:
|
|
22290
|
-
stagedAt:
|
|
22348
|
+
accountId: z30.string(),
|
|
22349
|
+
target: z30.string().optional(),
|
|
22350
|
+
dependsOn: z30.array(z30.string()),
|
|
22351
|
+
summary: z30.string(),
|
|
22352
|
+
stagedAt: z30.number(),
|
|
22291
22353
|
result: metaDraftOpResultSchema.optional()
|
|
22292
22354
|
});
|
|
22293
|
-
var metaDraftListRequestSchema =
|
|
22294
|
-
chatId:
|
|
22355
|
+
var metaDraftListRequestSchema = z30.object({
|
|
22356
|
+
chatId: z30.string()
|
|
22295
22357
|
});
|
|
22296
|
-
var metaDraftAdvisorySchema =
|
|
22297
|
-
ref:
|
|
22298
|
-
message:
|
|
22358
|
+
var metaDraftAdvisorySchema = z30.object({
|
|
22359
|
+
ref: z30.string(),
|
|
22360
|
+
message: z30.string()
|
|
22299
22361
|
});
|
|
22300
|
-
var metaDraftListResponseSchema =
|
|
22301
|
-
status:
|
|
22362
|
+
var metaDraftListResponseSchema = z30.object({
|
|
22363
|
+
status: z30.enum(["active", "publishing", "applied", "discarded", "none"]),
|
|
22302
22364
|
mode: metaWriteModeSchema,
|
|
22303
|
-
count:
|
|
22304
|
-
ops:
|
|
22365
|
+
count: z30.number(),
|
|
22366
|
+
ops: z30.array(metaDraftOpViewSchema),
|
|
22305
22367
|
/** Non-blocking cross-op quality advisories — "good campaign, not just valid". */
|
|
22306
|
-
advisories:
|
|
22368
|
+
advisories: z30.array(metaDraftAdvisorySchema)
|
|
22307
22369
|
});
|
|
22308
|
-
var metaDraftShowRequestSchema =
|
|
22309
|
-
chatId:
|
|
22310
|
-
ref:
|
|
22370
|
+
var metaDraftShowRequestSchema = z30.object({
|
|
22371
|
+
chatId: z30.string(),
|
|
22372
|
+
ref: z30.string()
|
|
22311
22373
|
});
|
|
22312
|
-
var metaDraftShowResponseSchema =
|
|
22374
|
+
var metaDraftShowResponseSchema = z30.object({
|
|
22313
22375
|
op: metaDraftOpViewSchema.extend({
|
|
22314
|
-
payload:
|
|
22315
|
-
warnings:
|
|
22316
|
-
annotations:
|
|
22376
|
+
payload: z30.unknown().optional(),
|
|
22377
|
+
warnings: z30.array(z30.string()).optional(),
|
|
22378
|
+
annotations: z30.unknown().optional()
|
|
22317
22379
|
})
|
|
22318
22380
|
});
|
|
22319
|
-
var metaDraftRemoveRequestSchema =
|
|
22320
|
-
chatId:
|
|
22321
|
-
ref:
|
|
22381
|
+
var metaDraftRemoveRequestSchema = z30.object({
|
|
22382
|
+
chatId: z30.string(),
|
|
22383
|
+
ref: z30.string()
|
|
22322
22384
|
});
|
|
22323
|
-
var metaDraftRemoveResponseSchema =
|
|
22385
|
+
var metaDraftRemoveResponseSchema = z30.object({
|
|
22324
22386
|
/** The requested ref plus any dependents removed by cascade. */
|
|
22325
|
-
removed:
|
|
22387
|
+
removed: z30.array(z30.string())
|
|
22326
22388
|
});
|
|
22327
|
-
var metaDraftClearRequestSchema =
|
|
22328
|
-
chatId:
|
|
22389
|
+
var metaDraftClearRequestSchema = z30.object({
|
|
22390
|
+
chatId: z30.string()
|
|
22329
22391
|
});
|
|
22330
|
-
var metaDraftClearResponseSchema =
|
|
22331
|
-
cleared:
|
|
22392
|
+
var metaDraftClearResponseSchema = z30.object({
|
|
22393
|
+
cleared: z30.number()
|
|
22332
22394
|
});
|
|
22333
|
-
var metaFieldErrorSchema =
|
|
22334
|
-
path:
|
|
22335
|
-
message:
|
|
22395
|
+
var metaFieldErrorSchema = z30.object({
|
|
22396
|
+
path: z30.string(),
|
|
22397
|
+
message: z30.string()
|
|
22336
22398
|
});
|
|
22337
|
-
var metaDraftErrorResponseSchema =
|
|
22338
|
-
code:
|
|
22339
|
-
error:
|
|
22340
|
-
fields:
|
|
22399
|
+
var metaDraftErrorResponseSchema = z30.object({
|
|
22400
|
+
code: z30.string(),
|
|
22401
|
+
error: z30.string(),
|
|
22402
|
+
fields: z30.array(metaFieldErrorSchema).optional()
|
|
22341
22403
|
});
|
|
22342
22404
|
|
|
22343
22405
|
// src/commands/ads/meta/write-shared.ts
|
|
@@ -27096,7 +27158,7 @@ Full guides: __tooling__/docs/tools/baker/ads-<platform>.md (google|meta|linkedi
|
|
|
27096
27158
|
});
|
|
27097
27159
|
|
|
27098
27160
|
// ../api/src/event-ingest/arrivals.ts
|
|
27099
|
-
import { z as
|
|
27161
|
+
import { z as z31 } from "zod";
|
|
27100
27162
|
|
|
27101
27163
|
// ../api/src/event-ingest/mode.ts
|
|
27102
27164
|
var INGEST_MODE_HEADER = "X-Baker-Mode";
|
|
@@ -27105,16 +27167,16 @@ var INGEST_MODES = ["live", "test"];
|
|
|
27105
27167
|
// ../api/src/event-ingest/arrivals.ts
|
|
27106
27168
|
var INGEST_ARRIVALS_MAX = 200;
|
|
27107
27169
|
var INGEST_ARRIVALS_DEFAULT = 25;
|
|
27108
|
-
var ingestArrivalsRequestSchema =
|
|
27170
|
+
var ingestArrivalsRequestSchema = z31.object({
|
|
27109
27171
|
/** `test` shows only rehearsals, `live` only real traffic. Absent shows both. */
|
|
27110
|
-
mode:
|
|
27172
|
+
mode: z31.enum(INGEST_MODES).optional(),
|
|
27111
27173
|
/** `rejected` is the one worth asking for on its own — it is the whole reason to look. */
|
|
27112
|
-
outcome:
|
|
27174
|
+
outcome: z31.enum(["accepted", "rejected"]).optional(),
|
|
27113
27175
|
/** Narrow to one event name, for a company posting several kinds. */
|
|
27114
|
-
eventName:
|
|
27115
|
-
limit:
|
|
27176
|
+
eventName: z31.string().max(120).optional(),
|
|
27177
|
+
limit: z31.coerce.number().int().positive().max(INGEST_ARRIVALS_MAX).optional().default(INGEST_ARRIVALS_DEFAULT),
|
|
27116
27178
|
/** Include the masked raw body and the per-field previews. Off by default — it is most of the bytes. */
|
|
27117
|
-
full:
|
|
27179
|
+
full: z31.boolean().optional()
|
|
27118
27180
|
});
|
|
27119
27181
|
|
|
27120
27182
|
// ../api/src/event-ingest/endpoint.ts
|
|
@@ -27742,6 +27804,14 @@ event and counted **once** \u2014 one conversion, one event, its value added onc
|
|
|
27742
27804
|
is safe and needs no branch of its own. Both requests are shown in Baker, with the later
|
|
27743
27805
|
one marked "Already counted", so a retry is visible without being counted.
|
|
27744
27806
|
|
|
27807
|
+
The same holds **across connections**, which is the reason to use it. If the page also
|
|
27808
|
+
reports this outcome with Baker's website tag, pass one string as \`event_id\` here and as
|
|
27809
|
+
\`eventId\` in \`window.baker.conversion(name, { eventId })\`: the browser event and the
|
|
27810
|
+
server event are then one event and count once, whichever arrives first and whether or not
|
|
27811
|
+
the other ever does. Report an important outcome from both \u2014 a browser can be blocked, a
|
|
27812
|
+
server cannot \u2014 and always pair them with an id. Send no id and the two are two conversions,
|
|
27813
|
+
with nothing anywhere reporting an error.
|
|
27814
|
+
|
|
27745
27815
|
### HTTP statuses
|
|
27746
27816
|
|
|
27747
27817
|
| Status | Means | Do |
|
|
@@ -27790,21 +27860,21 @@ var INGEST_CLICK_ID_PARAMS = [
|
|
|
27790
27860
|
];
|
|
27791
27861
|
|
|
27792
27862
|
// ../api/src/event-ingest/wire.ts
|
|
27793
|
-
import { z as
|
|
27794
|
-
var ingestUserDataSchema =
|
|
27863
|
+
import { z as z32 } from "zod";
|
|
27864
|
+
var ingestUserDataSchema = z32.strictObject({
|
|
27795
27865
|
/** A plain address, or its SHA-256 digest. Both accepted; we tell them apart. */
|
|
27796
|
-
email:
|
|
27866
|
+
email: z32.string().nullish(),
|
|
27797
27867
|
/** A plain number, or its SHA-256 digest. Include the country code. */
|
|
27798
|
-
phone:
|
|
27868
|
+
phone: z32.string().nullish(),
|
|
27799
27869
|
/** Your own id for this person — a CRM contact id. Stored as you sent it, and hashed alongside so it joins. */
|
|
27800
|
-
external_id:
|
|
27870
|
+
external_id: z32.string().nullish(),
|
|
27801
27871
|
/** The Baker ID this browser already carries, if your system kept it. */
|
|
27802
|
-
baker_id:
|
|
27872
|
+
baker_id: z32.string().nullish(),
|
|
27803
27873
|
...Object.fromEntries(
|
|
27804
|
-
[...MATCH_FIELDS, ...MATCH_COOKIES, ...INGEST_CLICK_ID_PARAMS].map((param) => [param,
|
|
27874
|
+
[...MATCH_FIELDS, ...MATCH_COOKIES, ...INGEST_CLICK_ID_PARAMS].map((param) => [param, z32.string().nullish()])
|
|
27805
27875
|
)
|
|
27806
27876
|
});
|
|
27807
|
-
var ingestEventSchema =
|
|
27877
|
+
var ingestEventSchema = z32.strictObject({
|
|
27808
27878
|
/**
|
|
27809
27879
|
* What happened, in the sender's words. The only required field.
|
|
27810
27880
|
*
|
|
@@ -27819,7 +27889,7 @@ var ingestEventSchema = z31.strictObject({
|
|
|
27819
27889
|
* matched at read time. A sender asserting one would be asserting something
|
|
27820
27890
|
* about our configuration that they cannot see.
|
|
27821
27891
|
*/
|
|
27822
|
-
event_name:
|
|
27892
|
+
event_name: z32.string(),
|
|
27823
27893
|
/**
|
|
27824
27894
|
* When it happened: an ISO-8601 instant with an offset, or Unix seconds.
|
|
27825
27895
|
*
|
|
@@ -27830,7 +27900,7 @@ var ingestEventSchema = z31.strictObject({
|
|
|
27830
27900
|
* sender the timestamp is the arrival time to within a second, so demanding
|
|
27831
27901
|
* it buys nothing and loses the events of anyone who forgets it.
|
|
27832
27902
|
*/
|
|
27833
|
-
event_time:
|
|
27903
|
+
event_time: z32.union([z32.string(), z32.number()]).nullish(),
|
|
27834
27904
|
/**
|
|
27835
27905
|
* Your own id for this event, and **only** if you want it deduplicated.
|
|
27836
27906
|
*
|
|
@@ -27839,7 +27909,7 @@ var ingestEventSchema = z31.strictObject({
|
|
|
27839
27909
|
* Its *shape* is checked in `validateEventId`, not here, so a bad one is
|
|
27840
27910
|
* `invalid_event_id` inside a `200` rather than a `400` for the other 199.
|
|
27841
27911
|
*/
|
|
27842
|
-
event_id:
|
|
27912
|
+
event_id: z32.string().nullish(),
|
|
27843
27913
|
/**
|
|
27844
27914
|
* The page this happened on, as a full URL.
|
|
27845
27915
|
*
|
|
@@ -27848,7 +27918,7 @@ var ingestEventSchema = z31.strictObject({
|
|
|
27848
27918
|
* click ids a report is built on live in the query string. Everything else
|
|
27849
27919
|
* treats it as optional context.
|
|
27850
27920
|
*/
|
|
27851
|
-
url:
|
|
27921
|
+
url: z32.string().nullish(),
|
|
27852
27922
|
user_data: ingestUserDataSchema.nullish(),
|
|
27853
27923
|
/**
|
|
27854
27924
|
* What it was worth, as a decimal string or a JSON number.
|
|
@@ -27857,9 +27927,9 @@ var ingestEventSchema = z31.strictObject({
|
|
|
27857
27927
|
* own: that is where Google Ads keeps `conversion_value`/`currency_code` and
|
|
27858
27928
|
* where Meta keeps `value`/`currency` inside `custom_data`.
|
|
27859
27929
|
*/
|
|
27860
|
-
value:
|
|
27930
|
+
value: z32.union([z32.string(), z32.number()]).nullish(),
|
|
27861
27931
|
/** ISO-4217, required whenever `value` is present. */
|
|
27862
|
-
currency:
|
|
27932
|
+
currency: z32.string().nullish(),
|
|
27863
27933
|
/**
|
|
27864
27934
|
* Flat detail about the event.
|
|
27865
27935
|
*
|
|
@@ -27868,18 +27938,18 @@ var ingestEventSchema = z31.strictObject({
|
|
|
27868
27938
|
* left alone: masking one would rename the field and could collide with a
|
|
27869
27939
|
* sibling.
|
|
27870
27940
|
*/
|
|
27871
|
-
properties:
|
|
27941
|
+
properties: z32.record(z32.string(), z32.string()).nullish()
|
|
27872
27942
|
});
|
|
27873
|
-
var ingestBatchSchema =
|
|
27874
|
-
events:
|
|
27943
|
+
var ingestBatchSchema = z32.strictObject({
|
|
27944
|
+
events: z32.array(ingestEventSchema).min(1).max(EVENT_INGEST_BATCH_MAX)
|
|
27875
27945
|
});
|
|
27876
|
-
var ingestRejectionSchema =
|
|
27877
|
-
index:
|
|
27878
|
-
event_id:
|
|
27879
|
-
code:
|
|
27880
|
-
message:
|
|
27946
|
+
var ingestRejectionSchema = z32.strictObject({
|
|
27947
|
+
index: z32.number().int().nonnegative(),
|
|
27948
|
+
event_id: z32.string(),
|
|
27949
|
+
code: z32.enum(REJECTION_CODES),
|
|
27950
|
+
message: z32.string()
|
|
27881
27951
|
});
|
|
27882
|
-
var ingestResponseSchema =
|
|
27952
|
+
var ingestResponseSchema = z32.strictObject({
|
|
27883
27953
|
/**
|
|
27884
27954
|
* How this request was treated, echoed from `X-Baker-Mode`.
|
|
27885
27955
|
*
|
|
@@ -27889,13 +27959,13 @@ var ingestResponseSchema = z31.strictObject({
|
|
|
27889
27959
|
* count?" in the reply to the request that asked, instead of in a report
|
|
27890
27960
|
* somebody reads a week later.
|
|
27891
27961
|
*/
|
|
27892
|
-
mode:
|
|
27962
|
+
mode: z32.enum(INGEST_MODES),
|
|
27893
27963
|
/** `events.length`, echoed back so a client can detect a truncated body. */
|
|
27894
|
-
received:
|
|
27895
|
-
accepted:
|
|
27896
|
-
rejected:
|
|
27964
|
+
received: z32.number().int().nonnegative(),
|
|
27965
|
+
accepted: z32.number().int().nonnegative(),
|
|
27966
|
+
rejected: z32.array(ingestRejectionSchema)
|
|
27897
27967
|
});
|
|
27898
|
-
var ingestEnvelopeSchema =
|
|
27968
|
+
var ingestEnvelopeSchema = z32.object({ ok: z32.literal(true), data: ingestResponseSchema });
|
|
27899
27969
|
|
|
27900
27970
|
// src/commands/analytics/index.ts
|
|
27901
27971
|
import { defineCommand as defineCommand95 } from "citty";
|
|
@@ -29046,6 +29116,37 @@ Examples:
|
|
|
29046
29116
|
}
|
|
29047
29117
|
});
|
|
29048
29118
|
})();
|
|
29119
|
+
var websiteTagCommand = (() => {
|
|
29120
|
+
registerSchema({
|
|
29121
|
+
command: "analytics.website-tag",
|
|
29122
|
+
description: "The measurement tag for a website Baker does not publish, with this company's key in it",
|
|
29123
|
+
args: {}
|
|
29124
|
+
});
|
|
29125
|
+
return defineCommand95({
|
|
29126
|
+
meta: {
|
|
29127
|
+
name: "website-tag",
|
|
29128
|
+
description: `The one script tag that measures a website Baker does not publish \u2014 the client's own site, their shop, their booking page \u2014 with this company's site key already in it, plus the whole install as Markdown.
|
|
29129
|
+
|
|
29130
|
+
Reach for it whenever measurement has to reach a page Baker did not build. What it returns is real and complete: the tag, the websites the key is accepted from, and the rules for the hidden form fields, the identify call and the conversion call.
|
|
29131
|
+
|
|
29132
|
+
Two things worth knowing before you install it:
|
|
29133
|
+
the origins list \u2014 the key is IGNORED from any origin not on it, silently. An empty list means the tag will measure nothing.
|
|
29134
|
+
Tag Manager is usually the way in \u2014 a Custom HTML tag on All Pages. If the client has a container connected, you can stage that yourself (baker tag-manager).
|
|
29135
|
+
|
|
29136
|
+
Examples:
|
|
29137
|
+
baker analytics website-tag \u2014 the tag, the origins and the install brief
|
|
29138
|
+
baker analytics events --origin site \u2014 after it is live, what that website is reporting`
|
|
29139
|
+
},
|
|
29140
|
+
args: {},
|
|
29141
|
+
run: async () => {
|
|
29142
|
+
try {
|
|
29143
|
+
writeJsonEnvelope(await apiPost("/api/analytics/website-tag", {}));
|
|
29144
|
+
} catch (err) {
|
|
29145
|
+
handleError(err);
|
|
29146
|
+
}
|
|
29147
|
+
}
|
|
29148
|
+
});
|
|
29149
|
+
})();
|
|
29049
29150
|
var analyticsCommand2 = defineCommand95({
|
|
29050
29151
|
meta: {
|
|
29051
29152
|
name: "analytics",
|
|
@@ -29086,6 +29187,7 @@ Examples:
|
|
|
29086
29187
|
baker analytics map --platform google --remove kw \u2014 take that answer back
|
|
29087
29188
|
baker analytics delivery --page 2 --page-size 50 \u2014 the next page of a long list
|
|
29088
29189
|
baker analytics overview --compare \u2014 this window against the one before it
|
|
29190
|
+
baker analytics website-tag \u2014 the tag for a website Baker does not publish, key included
|
|
29089
29191
|
baker analytics sending-events \u2014 the contract for a client's server to post its own events
|
|
29090
29192
|
baker analytics arrivals --outcome rejected \u2014 what their server posted that we refused, and why
|
|
29091
29193
|
baker analytics events --origin systems \u2014 the events their systems reported, not ours
|
|
@@ -29114,6 +29216,7 @@ Full guide: __tooling__/docs/tools/baker/analytics.md`
|
|
|
29114
29216
|
tracking: trackingCommand,
|
|
29115
29217
|
arrivals: arrivalsCommand,
|
|
29116
29218
|
"sending-events": sendingEventsCommand,
|
|
29219
|
+
"website-tag": websiteTagCommand,
|
|
29117
29220
|
presets: presetsCommand
|
|
29118
29221
|
}
|
|
29119
29222
|
});
|
|
@@ -31438,7 +31541,7 @@ import { toCardinal as nwKo } from "n2words/ko-KR";
|
|
|
31438
31541
|
import { toCardinal as nwNl } from "n2words/nl-NL";
|
|
31439
31542
|
import { toCardinal as nwPl } from "n2words/pl-PL";
|
|
31440
31543
|
import { toCardinal as nwPt } from "n2words/pt-PT";
|
|
31441
|
-
import { z as
|
|
31544
|
+
import { z as z33 } from "zod";
|
|
31442
31545
|
|
|
31443
31546
|
// src/engine/scaffold/lib/shoot-modes.ts
|
|
31444
31547
|
var SHOOT_MODES = [
|
|
@@ -31788,71 +31891,71 @@ function trimArgs(durationS, offsetS = 0, dims) {
|
|
|
31788
31891
|
"{{out.video}}"
|
|
31789
31892
|
];
|
|
31790
31893
|
}
|
|
31791
|
-
var FrameAsset =
|
|
31792
|
-
var DialogueLine =
|
|
31793
|
-
speaker:
|
|
31794
|
-
line:
|
|
31894
|
+
var FrameAsset = z33.object({ url: z33.string().optional() }).loose().optional();
|
|
31895
|
+
var DialogueLine = z33.object({
|
|
31896
|
+
speaker: z33.string().optional(),
|
|
31897
|
+
line: z33.string().optional(),
|
|
31795
31898
|
// Absolute seconds on the source timeline (the deconstruct emits both).
|
|
31796
|
-
start_s:
|
|
31797
|
-
end_s:
|
|
31798
|
-
delivery:
|
|
31799
|
-
voice_description:
|
|
31899
|
+
start_s: z33.number().optional(),
|
|
31900
|
+
end_s: z33.number().optional(),
|
|
31901
|
+
delivery: z33.string().optional(),
|
|
31902
|
+
voice_description: z33.string().optional(),
|
|
31800
31903
|
// DECON-supplied: is this speaker's FACE visibly speaking in THIS scene? Element
|
|
31801
31904
|
// presence alone can't answer that — a founder pictured in a polaroid close-up is
|
|
31802
31905
|
// "present" yet the line is voiceover, and treating it as on-camera produced a
|
|
31803
31906
|
// native Seedance lip-sync clip of a still photograph. `false` pins the line to
|
|
31804
31907
|
// the VO path; absent keeps the presence-based decision (old blueprints).
|
|
31805
|
-
on_camera:
|
|
31908
|
+
on_camera: z33.boolean().optional()
|
|
31806
31909
|
}).loose();
|
|
31807
|
-
var Sfx =
|
|
31808
|
-
at_s:
|
|
31809
|
-
duration_s:
|
|
31810
|
-
sound_effect_prompt:
|
|
31811
|
-
description:
|
|
31910
|
+
var Sfx = z33.object({
|
|
31911
|
+
at_s: z33.number().optional(),
|
|
31912
|
+
duration_s: z33.number().optional(),
|
|
31913
|
+
sound_effect_prompt: z33.string().optional(),
|
|
31914
|
+
description: z33.string().optional()
|
|
31812
31915
|
}).loose();
|
|
31813
|
-
var CompositionRegion =
|
|
31916
|
+
var CompositionRegion = z33.object({
|
|
31814
31917
|
// full | top | bottom | left | right | inset
|
|
31815
|
-
panel:
|
|
31918
|
+
panel: z33.string().optional(),
|
|
31816
31919
|
// 9-grid anchor for an `inset` presenter box.
|
|
31817
|
-
position:
|
|
31818
|
-
is_presenter:
|
|
31920
|
+
position: z33.string().optional(),
|
|
31921
|
+
is_presenter: z33.boolean().optional(),
|
|
31819
31922
|
// The cast id shown/speaking in this region (routes lip-sync + element refs).
|
|
31820
|
-
cast_ref:
|
|
31923
|
+
cast_ref: z33.string().optional(),
|
|
31821
31924
|
// What the region's content IS: camera | screen_capture | static_graphic |
|
|
31822
31925
|
// generated. Authoritative for routing when present (regex-over-prose fallback
|
|
31823
31926
|
// otherwise): screen_capture/static_graphic are rebuilt from REAL surfaces on the
|
|
31824
31927
|
// overlay layer, never AI-generated.
|
|
31825
|
-
kind:
|
|
31928
|
+
kind: z33.string().optional(),
|
|
31826
31929
|
// Opaque id naming the SPECIFIC on-screen document/note/app-state this
|
|
31827
31930
|
// screen_capture region shows. Two scenes share it only when they show the SAME
|
|
31828
31931
|
// recording continuing (scrolling/typing/waiting within it) — a genuinely
|
|
31829
31932
|
// DIFFERENT document/note/recording (a source video splicing two screen captures)
|
|
31830
31933
|
// gets a different id. Breaks a persistent-layout run into separate surface stubs
|
|
31831
31934
|
// instead of asking the operator for one screenshot that can't cover both.
|
|
31832
|
-
surface_id:
|
|
31935
|
+
surface_id: z33.string().optional(),
|
|
31833
31936
|
// Camera bubble(s)/inset(s) embedded INSIDE this region's surface (a Loom-style
|
|
31834
31937
|
// presenter bubble inside a screen recording) — video-in-video the reproduction
|
|
31835
31938
|
// must re-composite, not paint into the surface.
|
|
31836
|
-
nested:
|
|
31837
|
-
summary:
|
|
31838
|
-
frame_prompt:
|
|
31839
|
-
motion_prompt:
|
|
31939
|
+
nested: z33.array(z33.object({}).loose()).optional(),
|
|
31940
|
+
summary: z33.string().optional(),
|
|
31941
|
+
frame_prompt: z33.string().optional(),
|
|
31942
|
+
motion_prompt: z33.string().optional()
|
|
31840
31943
|
}).loose();
|
|
31841
|
-
var SceneComposition =
|
|
31944
|
+
var SceneComposition = z33.object({
|
|
31842
31945
|
// full_frame (default) | split_screen | pip | keyed_overlay
|
|
31843
|
-
layout:
|
|
31946
|
+
layout: z33.string().optional(),
|
|
31844
31947
|
// split_screen only: vertical (top/bottom) | horizontal (left/right).
|
|
31845
|
-
split_axis:
|
|
31846
|
-
regions:
|
|
31948
|
+
split_axis: z33.string().optional(),
|
|
31949
|
+
regions: z33.array(CompositionRegion).optional()
|
|
31847
31950
|
}).loose();
|
|
31848
|
-
var CameraMotion =
|
|
31849
|
-
var TranscriptWord =
|
|
31850
|
-
var Scene =
|
|
31851
|
-
start_s:
|
|
31852
|
-
end_s:
|
|
31853
|
-
duration_s:
|
|
31854
|
-
summary:
|
|
31855
|
-
action_detail:
|
|
31951
|
+
var CameraMotion = z33.object({ movement: z33.string().optional(), detail: z33.string().optional() }).loose();
|
|
31952
|
+
var TranscriptWord = z33.object({ text: z33.string().optional() }).loose();
|
|
31953
|
+
var Scene = z33.object({
|
|
31954
|
+
start_s: z33.number().optional(),
|
|
31955
|
+
end_s: z33.number().optional(),
|
|
31956
|
+
duration_s: z33.number().optional(),
|
|
31957
|
+
summary: z33.string().optional(),
|
|
31958
|
+
action_detail: z33.string().optional(),
|
|
31856
31959
|
// The scene's spatial layout. Absent/full_frame ⇒ one uncut shot (default path).
|
|
31857
31960
|
// A layered layout (split_screen/pip/keyed_overlay) with regions ⇒ the scaffold
|
|
31858
31961
|
// builds one clip per region and stacks/overlays them into the scene picture.
|
|
@@ -31860,82 +31963,82 @@ var Scene = z32.object({
|
|
|
31860
31963
|
// The capture "look" for this scene — selected from the ad-native shoot-mode
|
|
31861
31964
|
// grammar (see lib/shoot-modes.ts). When absent the scaffold auto-derives a
|
|
31862
31965
|
// UGC/product mode; a human can override per scene by setting this.
|
|
31863
|
-
shoot_mode:
|
|
31966
|
+
shoot_mode: z33.string().optional(),
|
|
31864
31967
|
// Diegetic ambient the clip's native audio should carry (no music). When
|
|
31865
31968
|
// absent the scene falls back to its shoot mode's default ambience.
|
|
31866
|
-
ambient:
|
|
31969
|
+
ambient: z33.string().optional(),
|
|
31867
31970
|
camera_motion: CameraMotion.optional(),
|
|
31868
|
-
start_frame_prompt:
|
|
31869
|
-
end_frame_prompt:
|
|
31870
|
-
motion_prompt:
|
|
31971
|
+
start_frame_prompt: z33.string().optional(),
|
|
31972
|
+
end_frame_prompt: z33.string().optional(),
|
|
31973
|
+
motion_prompt: z33.string().optional(),
|
|
31871
31974
|
// The scene's role in the ad's persuasion arc (DECON-supplied); drives the
|
|
31872
31975
|
// script re-craft checklist. Inferred from position when absent.
|
|
31873
|
-
narrative_role:
|
|
31976
|
+
narrative_role: z33.string().optional(),
|
|
31874
31977
|
// DECON-supplied on the HOOK scene: the engineered physical/emotional state that
|
|
31875
31978
|
// makes the first frame stop the scroll (sweaty/breathless/urgent …). Injected
|
|
31876
31979
|
// into the hook's start-frame description so the generator renders that state,
|
|
31877
31980
|
// not a calm influencer (CCA-11).
|
|
31878
|
-
hook_mechanic:
|
|
31981
|
+
hook_mechanic: z33.object({ mechanic: z33.string().optional(), why_it_stops_scroll: z33.string().optional() }).loose().optional(),
|
|
31879
31982
|
// DECON-supplied per-scene location (so a gym hook isn't flattened to "home").
|
|
31880
|
-
scene_setting:
|
|
31983
|
+
scene_setting: z33.string().optional(),
|
|
31881
31984
|
// How this scene cuts to the next (DECON-supplied). A recognized non-cut type
|
|
31882
31985
|
// (fade/whip/zoom/dissolve/swipe) is reproduced as an ffmpeg xfade at the
|
|
31883
31986
|
// boundary; cut/match_cut/none/other stay hard cuts. The last scene's value is
|
|
31884
31987
|
// ignored (nothing follows it).
|
|
31885
|
-
transition_out:
|
|
31886
|
-
dialogue:
|
|
31887
|
-
sfx:
|
|
31888
|
-
overlays:
|
|
31889
|
-
floating_elements:
|
|
31988
|
+
transition_out: z33.object({ type: z33.string().optional(), description: z33.string().optional() }).loose().optional(),
|
|
31989
|
+
dialogue: z33.array(DialogueLine).optional(),
|
|
31990
|
+
sfx: z33.array(Sfx).optional(),
|
|
31991
|
+
overlays: z33.array(z33.unknown()).optional(),
|
|
31992
|
+
floating_elements: z33.array(z33.unknown()).optional(),
|
|
31890
31993
|
// DECON-supplied: how much the picture itself moves within the shot. Gates the
|
|
31891
31994
|
// flash-hold optimization — a sub-2s b-roll flash with REAL subject motion
|
|
31892
31995
|
// (pouring, spreading, hands working) must stay a real clip; freezing it turns
|
|
31893
31996
|
// a montage into a slideshow. Absent (old blueprints) keeps the cheap still.
|
|
31894
|
-
motion_level:
|
|
31895
|
-
transcript_slice:
|
|
31997
|
+
motion_level: z33.enum(["static", "subtle", "dynamic"]).optional(),
|
|
31998
|
+
transcript_slice: z33.array(TranscriptWord).optional(),
|
|
31896
31999
|
start_frame_asset: FrameAsset,
|
|
31897
32000
|
end_frame_asset: FrameAsset,
|
|
31898
32001
|
// DECON-supplied: true when this scene is a length-split CONTINUATION of the
|
|
31899
32002
|
// previous one (the SAME physical shot, broken up only because it exceeded the
|
|
31900
32003
|
// clip ceiling). The scaffold then shares the splice keyframe — this scene's
|
|
31901
32004
|
// start frame IS the previous scene's end frame — so the join is seamless.
|
|
31902
|
-
continues_previous:
|
|
32005
|
+
continues_previous: z33.boolean().optional()
|
|
31903
32006
|
}).loose();
|
|
31904
|
-
var VideoBlueprint =
|
|
31905
|
-
source:
|
|
31906
|
-
global:
|
|
31907
|
-
music:
|
|
31908
|
-
present:
|
|
31909
|
-
music_prompt:
|
|
32007
|
+
var VideoBlueprint = z33.object({
|
|
32008
|
+
source: z33.object({ aspect_ratio: z33.string().optional(), duration_s: z33.number().optional() }).loose().optional(),
|
|
32009
|
+
global: z33.object({
|
|
32010
|
+
music: z33.object({
|
|
32011
|
+
present: z33.boolean().optional(),
|
|
32012
|
+
music_prompt: z33.string().optional(),
|
|
31910
32013
|
// Absolute second the music enters in the reference (the bed often
|
|
31911
32014
|
// kicks in mid-ad, after the hook). We start the regenerated track here
|
|
31912
32015
|
// instead of at 0 so the timing matches.
|
|
31913
|
-
starts_at_s:
|
|
32016
|
+
starts_at_s: z33.number().optional(),
|
|
31914
32017
|
// Populated by the deconstruct when AudD (Shazam-style) recognizes the
|
|
31915
32018
|
// reference track. We never reuse it — only style the regenerated bed.
|
|
31916
|
-
identified_track:
|
|
32019
|
+
identified_track: z33.object({ title: z33.string().optional(), artist: z33.string().optional() }).loose().nullish()
|
|
31917
32020
|
}).loose().optional(),
|
|
31918
|
-
cast:
|
|
31919
|
-
|
|
31920
|
-
id:
|
|
31921
|
-
description:
|
|
32021
|
+
cast: z33.array(
|
|
32022
|
+
z33.object({
|
|
32023
|
+
id: z33.string().optional(),
|
|
32024
|
+
description: z33.string().optional(),
|
|
31922
32025
|
// The deconstruct's note on the target-market localization (e.g. "native
|
|
31923
32026
|
// French speaker") — read to derive the spoken-track language code.
|
|
31924
|
-
market_localization_note:
|
|
32027
|
+
market_localization_note: z33.string().optional()
|
|
31925
32028
|
}).loose()
|
|
31926
32029
|
).optional(),
|
|
31927
|
-
voiceover:
|
|
32030
|
+
voiceover: z33.object({
|
|
31928
32031
|
// on_camera | mixed → mouths are on screen (lip-sync candidates);
|
|
31929
32032
|
// voiceover | none → narration over the picture (no lip-sync).
|
|
31930
|
-
mode:
|
|
31931
|
-
voice_description:
|
|
31932
|
-
persona:
|
|
32033
|
+
mode: z33.string().optional(),
|
|
32034
|
+
voice_description: z33.string().optional(),
|
|
32035
|
+
persona: z33.string().optional()
|
|
31933
32036
|
}).loose().optional(),
|
|
31934
32037
|
// Visual palette — read only to colour a clean brand-card/CTA plate (the
|
|
31935
32038
|
// first hex is the dominant brand colour); never to drive frame generation.
|
|
31936
|
-
style:
|
|
32039
|
+
style: z33.object({ palette: z33.array(z33.object({ hex: z33.string().optional() }).loose()).optional() }).loose().optional()
|
|
31937
32040
|
}).loose().optional(),
|
|
31938
|
-
scenes:
|
|
32041
|
+
scenes: z33.array(Scene).min(1)
|
|
31939
32042
|
}).loose();
|
|
31940
32043
|
function injectHookPhysicality(blueprint) {
|
|
31941
32044
|
for (const scene of blueprint.scenes) {
|
|
@@ -31952,26 +32055,26 @@ function clipIntentOf(scene, sceneIndex) {
|
|
|
31952
32055
|
if (/hero|reveal|product|payoff|transformation|result/.test(role) || scene.motion_level === "dynamic") return "hero";
|
|
31953
32056
|
return "body";
|
|
31954
32057
|
}
|
|
31955
|
-
var AppearsItem =
|
|
31956
|
-
var RecurringElement =
|
|
32058
|
+
var AppearsItem = z33.union([z33.number(), z33.object({ scene: z33.number(), edge: z33.string().optional() }).loose()]);
|
|
32059
|
+
var RecurringElement = z33.object({
|
|
31957
32060
|
// person | animal | product | logo | badge | other
|
|
31958
|
-
type:
|
|
31959
|
-
label:
|
|
31960
|
-
description:
|
|
31961
|
-
expression:
|
|
32061
|
+
type: z33.string(),
|
|
32062
|
+
label: z33.string().optional(),
|
|
32063
|
+
description: z33.string().optional(),
|
|
32064
|
+
expression: z33.string().nullable().optional(),
|
|
31962
32065
|
// When the element maps to a global cast entry, its stable id (for annotation).
|
|
31963
|
-
cast_id:
|
|
32066
|
+
cast_id: z33.string().nullable().optional(),
|
|
31964
32067
|
// The label of another element that is the SAME individual as this one, shown
|
|
31965
32068
|
// in a DIFFERENT wardrobe/persona/state (e.g. one creator playing skeptic in a
|
|
31966
32069
|
// pink shirt and believer in a white shirt). Each look gets its own reference
|
|
31967
32070
|
// slot, but the face/identity must stay identical across them.
|
|
31968
|
-
same_as:
|
|
32071
|
+
same_as: z33.string().nullable().optional(),
|
|
31969
32072
|
// Scenes the element appears in. Either a bare list of scene indices (both
|
|
31970
32073
|
// edges) or per-{scene,edge} entries. Both forms are accepted and merged.
|
|
31971
|
-
scenes:
|
|
31972
|
-
appears_in:
|
|
32074
|
+
scenes: z33.array(z33.number()).optional(),
|
|
32075
|
+
appears_in: z33.array(AppearsItem).optional()
|
|
31973
32076
|
}).loose();
|
|
31974
|
-
var RecurringElements =
|
|
32077
|
+
var RecurringElements = z33.array(RecurringElement);
|
|
31975
32078
|
function sanitizeId(raw, fallback) {
|
|
31976
32079
|
const id = raw.toLowerCase().replace(/[^a-z0-9]+/g, "_").replace(/^_+|_+$/g, "");
|
|
31977
32080
|
return /^[a-z]/.test(id) ? id : `${fallback}_${id}`.replace(/_+$/g, "") || fallback;
|
|
@@ -32450,7 +32553,7 @@ function scrubFloatSentences(text2, floatDescs) {
|
|
|
32450
32553
|
return kept;
|
|
32451
32554
|
}
|
|
32452
32555
|
function sceneFloatDescs(scene) {
|
|
32453
|
-
const floats =
|
|
32556
|
+
const floats = z33.array(FloatingElement).safeParse(scene.floating_elements ?? []);
|
|
32454
32557
|
if (!floats.success) return [];
|
|
32455
32558
|
return floats.data.map((f) => f.description?.trim() ?? "").filter(Boolean);
|
|
32456
32559
|
}
|
|
@@ -33883,25 +33986,25 @@ function buildSfxMusic(blueprint, clock, nodes) {
|
|
|
33883
33986
|
}
|
|
33884
33987
|
return tracks;
|
|
33885
33988
|
}
|
|
33886
|
-
var OverlayStyle =
|
|
33887
|
-
var Overlay =
|
|
33888
|
-
text:
|
|
33889
|
-
appears_at_s:
|
|
33890
|
-
duration_s:
|
|
33891
|
-
position:
|
|
33892
|
-
role:
|
|
33893
|
-
animation:
|
|
33894
|
-
animation_detail:
|
|
33989
|
+
var OverlayStyle = z33.object({ color_hex: z33.string().optional(), background: z33.string().optional(), size: z33.string().optional() }).loose();
|
|
33990
|
+
var Overlay = z33.object({
|
|
33991
|
+
text: z33.string().optional(),
|
|
33992
|
+
appears_at_s: z33.number().optional(),
|
|
33993
|
+
duration_s: z33.number().optional(),
|
|
33994
|
+
position: z33.string().optional(),
|
|
33995
|
+
role: z33.string().optional(),
|
|
33996
|
+
animation: z33.string().optional(),
|
|
33997
|
+
animation_detail: z33.string().optional(),
|
|
33895
33998
|
style: OverlayStyle.optional()
|
|
33896
33999
|
}).loose();
|
|
33897
|
-
var FloatingElement =
|
|
33898
|
-
kind:
|
|
33899
|
-
description:
|
|
33900
|
-
brand_name:
|
|
33901
|
-
what_it_represents:
|
|
33902
|
-
appears_at_s:
|
|
33903
|
-
duration_s:
|
|
33904
|
-
position:
|
|
34000
|
+
var FloatingElement = z33.object({
|
|
34001
|
+
kind: z33.string().optional(),
|
|
34002
|
+
description: z33.string().optional(),
|
|
34003
|
+
brand_name: z33.string().nullish(),
|
|
34004
|
+
what_it_represents: z33.string().optional(),
|
|
34005
|
+
appears_at_s: z33.number().optional(),
|
|
34006
|
+
duration_s: z33.number().optional(),
|
|
34007
|
+
position: z33.string().optional()
|
|
33905
34008
|
}).loose();
|
|
33906
34009
|
function escapeHtml(s) {
|
|
33907
34010
|
return s.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
@@ -33933,7 +34036,7 @@ function positionClass(position) {
|
|
|
33933
34036
|
function collectCaptions(blueprint, clock) {
|
|
33934
34037
|
return blueprint.scenes.flatMap((scene, i) => {
|
|
33935
34038
|
const sceneStart = scene.start_s ?? 0;
|
|
33936
|
-
const overlays =
|
|
34039
|
+
const overlays = z33.array(Overlay).safeParse(scene.overlays ?? []);
|
|
33937
34040
|
return overlays.success ? overlays.data.filter((ov) => Boolean(ov.text?.trim())).map((ov) => {
|
|
33938
34041
|
const at = clock.map(i, ov.appears_at_s ?? sceneStart);
|
|
33939
34042
|
return { text: ov.text.trim(), at, end: at + (ov.duration_s ?? 2.5), ov };
|
|
@@ -34013,7 +34116,7 @@ function collectFloatWindows(blueprint, uiRouted, clock) {
|
|
|
34013
34116
|
const windows = /* @__PURE__ */ new Map();
|
|
34014
34117
|
blueprint.scenes.forEach((scene, i) => {
|
|
34015
34118
|
const sceneStart = scene.start_s ?? 0;
|
|
34016
|
-
const floats =
|
|
34119
|
+
const floats = z33.array(FloatingElement).safeParse(scene.floating_elements ?? []);
|
|
34017
34120
|
if (!floats.success) return;
|
|
34018
34121
|
for (const fe of floats.data) {
|
|
34019
34122
|
const at = clock.map(i, fe.appears_at_s ?? sceneStart);
|
|
@@ -34461,8 +34564,8 @@ function buildMotionBoard(blueprint) {
|
|
|
34461
34564
|
const end_s = scene.end_s ?? start_s + sceneDurationS(scene);
|
|
34462
34565
|
cursor = end_s;
|
|
34463
34566
|
const spoken = sceneSpokenText(scene);
|
|
34464
|
-
const overlays =
|
|
34465
|
-
const floats =
|
|
34567
|
+
const overlays = z33.array(Overlay).safeParse(scene.overlays ?? []);
|
|
34568
|
+
const floats = z33.array(FloatingElement).safeParse(scene.floating_elements ?? []);
|
|
34466
34569
|
const graphics = [
|
|
34467
34570
|
...(overlays.success ? overlays.data : []).filter((ov) => ov.text?.trim()).map((ov) => ({
|
|
34468
34571
|
kind: "text",
|
|
@@ -35922,7 +36025,7 @@ import path20 from "path";
|
|
|
35922
36025
|
import { defineCommand as defineCommand110 } from "citty";
|
|
35923
36026
|
|
|
35924
36027
|
// src/engine/scaffold/staticAd.ts
|
|
35925
|
-
import { z as
|
|
36028
|
+
import { z as z34 } from "zod";
|
|
35926
36029
|
var GEN_ASPECT_RATIOS = /* @__PURE__ */ new Set(["1:1", "4:5", "9:16", "16:9", "4:3", "3:4", "2:3", "3:2", "21:9"]);
|
|
35927
36030
|
var DEFAULT_ASPECT_RATIO = "9:16";
|
|
35928
36031
|
var SHEET_SUBJECT_TYPE2 = {
|
|
@@ -35934,24 +36037,24 @@ var ACTOR_SHEET_IMAGE_SIZE = "4K";
|
|
|
35934
36037
|
var ADAPT_MODEL = "google/gemini-3-pro-image-preview";
|
|
35935
36038
|
var ADAPT_IMAGE_SIZE = "2K";
|
|
35936
36039
|
var ADAPT_GUIDANCE = "Keep the headline, logo, CTA, and hero subject fully visible in every ratio. Reproduce every text string verbatim \u2014 no dropped, added, or altered characters \u2014 and preserve the exact brand-color treatment (e.g. a black\u2192red word pivot), never flattening it.";
|
|
35937
|
-
var Blueprint =
|
|
35938
|
-
meta:
|
|
35939
|
-
text_content:
|
|
36040
|
+
var Blueprint = z34.object({
|
|
36041
|
+
meta: z34.object({ estimated_aspect_ratio: z34.string().optional() }).loose().optional(),
|
|
36042
|
+
text_content: z34.array(z34.object({ text: z34.string().optional() }).loose()).optional()
|
|
35940
36043
|
}).loose();
|
|
35941
|
-
var ElementLocator =
|
|
35942
|
-
collection:
|
|
35943
|
-
index:
|
|
36044
|
+
var ElementLocator = z34.object({
|
|
36045
|
+
collection: z34.enum(["subjects", "people", "brands_logos"]),
|
|
36046
|
+
index: z34.number().int().nonnegative()
|
|
35944
36047
|
}).loose();
|
|
35945
|
-
var MainElement =
|
|
36048
|
+
var MainElement = z34.object({
|
|
35946
36049
|
// logo | product | person | animal | badge | other
|
|
35947
|
-
type:
|
|
35948
|
-
label:
|
|
35949
|
-
description:
|
|
35950
|
-
expression:
|
|
35951
|
-
reason:
|
|
36050
|
+
type: z34.string(),
|
|
36051
|
+
label: z34.string().optional(),
|
|
36052
|
+
description: z34.string().optional(),
|
|
36053
|
+
expression: z34.string().nullable().optional(),
|
|
36054
|
+
reason: z34.string().optional(),
|
|
35952
36055
|
locator: ElementLocator.optional()
|
|
35953
36056
|
}).loose();
|
|
35954
|
-
var MainElements =
|
|
36057
|
+
var MainElements = z34.array(MainElement);
|
|
35955
36058
|
function sanitizeId2(raw, fallback) {
|
|
35956
36059
|
const id = raw.toLowerCase().replace(/[^a-z0-9]+/g, "_").replace(/^_+|_+$/g, "");
|
|
35957
36060
|
return /^[a-z]/.test(id) ? id : `${fallback}_${id}`.replace(/_+$/g, "") || fallback;
|
|
@@ -42970,7 +43073,6 @@ var UnusableTargetError = class extends Error {
|
|
|
42970
43073
|
super(`"${target}" is neither an image URL nor a library image id.`);
|
|
42971
43074
|
this.target = target;
|
|
42972
43075
|
}
|
|
42973
|
-
target;
|
|
42974
43076
|
};
|
|
42975
43077
|
function readTargets(args) {
|
|
42976
43078
|
const positionals = Array.isArray(args._) ? args._ : [];
|