@koda-sl/baker-cli 0.179.0 → 0.180.0-dev.e916855f4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +18 -1
- package/dist/{chunk-P2T3IZRE.js → chunk-QPVJGKV7.js} +4 -4
- package/dist/chunk-QPVJGKV7.js.map +1 -0
- package/dist/{chunk-ZWYQIEBI.js → chunk-RKGSX6ZR.js} +13 -6
- package/dist/chunk-RKGSX6ZR.js.map +1 -0
- package/dist/{chunk-X5C6HE24.js → chunk-VKFY7XN5.js} +2 -2
- package/dist/{chunk-PXXJ3HJW.js → chunk-YXQOSMWG.js} +3 -3
- package/dist/cli.js +1395 -1117
- package/dist/cli.js.map +1 -1
- package/dist/{client-PJ7ID35L.js → client-HXMDU745.js} +4 -2
- package/dist/engine/index.js +1 -1
- package/dist/{output-NWX3YW64.js → output-XB3PKLPQ.js} +3 -3
- package/dist/{shared-5ZEOG664.js → shared-QRHBP3JR.js} +4 -4
- package/package.json +1 -1
- package/dist/chunk-P2T3IZRE.js.map +0 -1
- package/dist/chunk-ZWYQIEBI.js.map +0 -1
- /package/dist/{chunk-X5C6HE24.js.map → chunk-VKFY7XN5.js.map} +0 -0
- /package/dist/{chunk-PXXJ3HJW.js.map → chunk-YXQOSMWG.js.map} +0 -0
- /package/dist/{client-PJ7ID35L.js.map → client-HXMDU745.js.map} +0 -0
- /package/dist/{output-NWX3YW64.js.map → output-XB3PKLPQ.js.map} +0 -0
- /package/dist/{shared-5ZEOG664.js.map → shared-QRHBP3JR.js.map} +0 -0
package/dist/cli.js
CHANGED
|
@@ -36,7 +36,7 @@ import {
|
|
|
36
36
|
toModelSafeImage,
|
|
37
37
|
ulid,
|
|
38
38
|
validateCanvasDeep
|
|
39
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-QPVJGKV7.js";
|
|
40
40
|
import {
|
|
41
41
|
csvOrJson,
|
|
42
42
|
daysAgoIso,
|
|
@@ -45,7 +45,7 @@ import {
|
|
|
45
45
|
resolveAccountIdArg,
|
|
46
46
|
resolveEffectiveStatus,
|
|
47
47
|
todayIso
|
|
48
|
-
} from "./chunk-
|
|
48
|
+
} from "./chunk-YXQOSMWG.js";
|
|
49
49
|
import {
|
|
50
50
|
buildQueryCacheKey,
|
|
51
51
|
cacheGet,
|
|
@@ -61,13 +61,14 @@ import {
|
|
|
61
61
|
writeAdsJson,
|
|
62
62
|
writeAdsOutput,
|
|
63
63
|
writeJsonEnvelope
|
|
64
|
-
} from "./chunk-
|
|
64
|
+
} from "./chunk-VKFY7XN5.js";
|
|
65
65
|
import {
|
|
66
66
|
ApiError,
|
|
67
67
|
apiGet,
|
|
68
68
|
apiPost,
|
|
69
|
+
apiPut,
|
|
69
70
|
validateConvexId
|
|
70
|
-
} from "./chunk-
|
|
71
|
+
} from "./chunk-RKGSX6ZR.js";
|
|
71
72
|
import {
|
|
72
73
|
installStreamTaps,
|
|
73
74
|
logInvocation
|
|
@@ -79,7 +80,7 @@ import {
|
|
|
79
80
|
} from "./chunk-YL3HDEIJ.js";
|
|
80
81
|
|
|
81
82
|
// src/cli.ts
|
|
82
|
-
import { defineCommand as
|
|
83
|
+
import { defineCommand as defineCommand192, runMain } from "citty";
|
|
83
84
|
|
|
84
85
|
// src/commands/actions/index.ts
|
|
85
86
|
import { defineCommand as defineCommand18 } from "citty";
|
|
@@ -3504,8 +3505,37 @@ var imagesIngestResponseSchema = z11.object({
|
|
|
3504
3505
|
contentHash: z11.string()
|
|
3505
3506
|
});
|
|
3506
3507
|
|
|
3507
|
-
// ../api/src/
|
|
3508
|
+
// ../api/src/landings.ts
|
|
3508
3509
|
import { z as z12 } from "zod";
|
|
3510
|
+
var MAX_LANDING_FOLDER_NAME_LENGTH = 48;
|
|
3511
|
+
var landingFolderSchema = z12.object({
|
|
3512
|
+
name: z12.string(),
|
|
3513
|
+
/** How many landings are filed under it. A folder with none does not exist. */
|
|
3514
|
+
count: z12.number()
|
|
3515
|
+
});
|
|
3516
|
+
var landingFoldersListResponseSchema = z12.object({
|
|
3517
|
+
folders: z12.array(landingFolderSchema),
|
|
3518
|
+
/** Published landings sitting loose in the root. */
|
|
3519
|
+
unfiled: z12.number()
|
|
3520
|
+
});
|
|
3521
|
+
var landingFolderSetRequestSchema = z12.object({
|
|
3522
|
+
slugs: z12.array(z12.string().min(1)).min(1).max(200),
|
|
3523
|
+
/** `null` unfiles the pages. */
|
|
3524
|
+
folder: z12.string().max(MAX_LANDING_FOLDER_NAME_LENGTH).nullable()
|
|
3525
|
+
});
|
|
3526
|
+
var landingFolderSetResponseSchema = z12.object({
|
|
3527
|
+
/** Slugs whose live filing changed, with the normalized folder applied. */
|
|
3528
|
+
moved: z12.array(z12.string()),
|
|
3529
|
+
/** Slugs already filed there — no-ops, reported so the caller isn't misled. */
|
|
3530
|
+
unchanged: z12.array(z12.string()),
|
|
3531
|
+
/** Slugs with no published page. Their filing waits on the first publish. */
|
|
3532
|
+
notFound: z12.array(z12.string()),
|
|
3533
|
+
/** The company's folders after the move, so the caller never has to re-list. */
|
|
3534
|
+
folders: z12.array(landingFolderSchema)
|
|
3535
|
+
});
|
|
3536
|
+
|
|
3537
|
+
// ../api/src/tags.ts
|
|
3538
|
+
import { z as z13 } from "zod";
|
|
3509
3539
|
var TAG_TYPES = [
|
|
3510
3540
|
"meta",
|
|
3511
3541
|
"amplitude",
|
|
@@ -3526,7 +3556,7 @@ var TAG_TYPES = [
|
|
|
3526
3556
|
"recaptcha",
|
|
3527
3557
|
"twitterAds"
|
|
3528
3558
|
];
|
|
3529
|
-
var tagTypeSchema =
|
|
3559
|
+
var tagTypeSchema = z13.enum(TAG_TYPES);
|
|
3530
3560
|
var TAG_IDENTIFYING_FIELD = {
|
|
3531
3561
|
meta: "pixelId",
|
|
3532
3562
|
googleAds: "conversionID",
|
|
@@ -3547,218 +3577,218 @@ var TAG_IDENTIFYING_FIELD = {
|
|
|
3547
3577
|
recaptcha: "siteKey",
|
|
3548
3578
|
twitterAds: "pixelId"
|
|
3549
3579
|
};
|
|
3550
|
-
var tagDraftOpKindSchema =
|
|
3551
|
-
var tagDraftOpViewSchema =
|
|
3580
|
+
var tagDraftOpKindSchema = z13.enum(["create", "update", "delete"]);
|
|
3581
|
+
var tagDraftOpViewSchema = z13.object({
|
|
3552
3582
|
/** `tag_temp_*` for staged creates; the real tag id for update/delete ops. */
|
|
3553
|
-
ref:
|
|
3583
|
+
ref: z13.string(),
|
|
3554
3584
|
kind: tagDraftOpKindSchema,
|
|
3555
3585
|
type: tagTypeSchema,
|
|
3556
3586
|
/** Present on update/delete ops — the real tag this op targets. */
|
|
3557
|
-
tagId:
|
|
3587
|
+
tagId: z13.string().optional(),
|
|
3558
3588
|
/** Non-secret config (create: full; update: the staged patch). Secrets are structurally absent. */
|
|
3559
|
-
config:
|
|
3589
|
+
config: z13.record(z13.string(), z13.string()),
|
|
3560
3590
|
/** Update only — fields the op explicitly clears. */
|
|
3561
|
-
clearFields:
|
|
3591
|
+
clearFields: z13.array(z13.string()).optional(),
|
|
3562
3592
|
/** Names of secret fields already provided via the dashboard secure form. Never values. */
|
|
3563
|
-
secretsSet:
|
|
3593
|
+
secretsSet: z13.array(z13.string()),
|
|
3564
3594
|
/** Names of secret fields still awaiting user input. */
|
|
3565
|
-
secretsPending:
|
|
3566
|
-
summary:
|
|
3567
|
-
stagedAt:
|
|
3595
|
+
secretsPending: z13.array(z13.string()),
|
|
3596
|
+
summary: z13.string(),
|
|
3597
|
+
stagedAt: z13.number()
|
|
3568
3598
|
});
|
|
3569
|
-
var tagsEffectiveEntrySchema =
|
|
3599
|
+
var tagsEffectiveEntrySchema = z13.object({
|
|
3570
3600
|
/** Real tag id, or `tag_temp_*` for staged creates. Use as flow side-effect `tagIds` value. */
|
|
3571
|
-
ref:
|
|
3572
|
-
tagId:
|
|
3601
|
+
ref: z13.string(),
|
|
3602
|
+
tagId: z13.string().optional(),
|
|
3573
3603
|
type: tagTypeSchema,
|
|
3574
3604
|
/** Value of the type's identifying field, when set. */
|
|
3575
|
-
identifier:
|
|
3605
|
+
identifier: z13.string().optional(),
|
|
3576
3606
|
/** Redacted config; for staged updates, production config with the patch merged. */
|
|
3577
|
-
config:
|
|
3607
|
+
config: z13.record(z13.string(), z13.string()),
|
|
3578
3608
|
/** Absent = live production tag with no staged changes in this chat. */
|
|
3579
3609
|
staged: tagDraftOpKindSchema.optional(),
|
|
3580
|
-
secretsSet:
|
|
3581
|
-
secretsPending:
|
|
3610
|
+
secretsSet: z13.array(z13.string()),
|
|
3611
|
+
secretsPending: z13.array(z13.string())
|
|
3582
3612
|
});
|
|
3583
|
-
var tagsListRequestSchema =
|
|
3584
|
-
var tagsListResponseSchema =
|
|
3585
|
-
var tagsDraftListRequestSchema =
|
|
3586
|
-
var tagsDraftListResponseSchema =
|
|
3587
|
-
status:
|
|
3588
|
-
ops:
|
|
3613
|
+
var tagsListRequestSchema = z13.object({ chatId: z13.string() });
|
|
3614
|
+
var tagsListResponseSchema = z13.object({ tags: z13.array(tagsEffectiveEntrySchema) });
|
|
3615
|
+
var tagsDraftListRequestSchema = z13.object({ chatId: z13.string() });
|
|
3616
|
+
var tagsDraftListResponseSchema = z13.object({
|
|
3617
|
+
status: z13.enum(["active", "publishing", "applied", "discarded", "none"]),
|
|
3618
|
+
ops: z13.array(tagDraftOpViewSchema)
|
|
3589
3619
|
});
|
|
3590
|
-
var tagInputRequestSchema =
|
|
3620
|
+
var tagInputRequestSchema = z13.object({
|
|
3591
3621
|
// Every tag change is a tab in the approval form: create/edit show the full
|
|
3592
3622
|
// body; delete shows a confirm. No tag change bypasses this approval.
|
|
3593
|
-
mode:
|
|
3623
|
+
mode: z13.enum(["create", "edit", "delete"]),
|
|
3594
3624
|
tagType: tagTypeSchema,
|
|
3595
3625
|
/** Edit/delete mode — the real tag id or `tag_temp_*` ref being changed. */
|
|
3596
|
-
ref:
|
|
3626
|
+
ref: z13.string().optional(),
|
|
3597
3627
|
/** Non-secret values the agent proposes to prefill. Secret keys are stripped at every boundary. */
|
|
3598
|
-
prefilledConfig:
|
|
3628
|
+
prefilledConfig: z13.record(z13.string(), z13.string()).optional(),
|
|
3599
3629
|
/** Secret field names the agent asks the user to provide. */
|
|
3600
|
-
requestedSecretFields:
|
|
3630
|
+
requestedSecretFields: z13.array(z13.string()).optional(),
|
|
3601
3631
|
/** Short message shown above the form explaining why the input is needed. */
|
|
3602
|
-
message:
|
|
3632
|
+
message: z13.string().optional()
|
|
3603
3633
|
});
|
|
3604
|
-
var tagChangeToolInputSchema =
|
|
3605
|
-
changes:
|
|
3634
|
+
var tagChangeToolInputSchema = z13.object({
|
|
3635
|
+
changes: z13.array(tagInputRequestSchema).min(1).max(8)
|
|
3606
3636
|
});
|
|
3607
|
-
var tagInputResultSchema =
|
|
3608
|
-
|
|
3609
|
-
status:
|
|
3610
|
-
ref:
|
|
3637
|
+
var tagInputResultSchema = z13.discriminatedUnion("status", [
|
|
3638
|
+
z13.object({
|
|
3639
|
+
status: z13.literal("submitted"),
|
|
3640
|
+
ref: z13.string(),
|
|
3611
3641
|
type: tagTypeSchema,
|
|
3612
3642
|
/** Identifying field name → value (non-secret), when the type has one. */
|
|
3613
|
-
identifier:
|
|
3614
|
-
secretFieldsSet:
|
|
3615
|
-
note:
|
|
3643
|
+
identifier: z13.record(z13.string(), z13.string()).optional(),
|
|
3644
|
+
secretFieldsSet: z13.array(z13.string()),
|
|
3645
|
+
note: z13.string().optional()
|
|
3616
3646
|
}),
|
|
3617
|
-
|
|
3618
|
-
status:
|
|
3619
|
-
reason:
|
|
3647
|
+
z13.object({
|
|
3648
|
+
status: z13.literal("declined"),
|
|
3649
|
+
reason: z13.string().optional()
|
|
3620
3650
|
})
|
|
3621
3651
|
]);
|
|
3622
|
-
var tagChangeToolResultSchema =
|
|
3623
|
-
results:
|
|
3652
|
+
var tagChangeToolResultSchema = z13.object({
|
|
3653
|
+
results: z13.array(tagInputResultSchema)
|
|
3624
3654
|
});
|
|
3625
3655
|
|
|
3626
3656
|
// ../api/src/testimonials.ts
|
|
3627
|
-
import { z as
|
|
3628
|
-
var testimonialSourceTypeSchema =
|
|
3629
|
-
var testimonialStatusSchema =
|
|
3630
|
-
var testimonialSentimentSchema =
|
|
3631
|
-
var testimonialDocSchema =
|
|
3632
|
-
_id:
|
|
3633
|
-
_creationTime:
|
|
3634
|
-
companyId:
|
|
3635
|
-
sourceId:
|
|
3657
|
+
import { z as z14 } from "zod";
|
|
3658
|
+
var testimonialSourceTypeSchema = z14.enum(["google", "trustpilot"]);
|
|
3659
|
+
var testimonialStatusSchema = z14.enum(["pending", "processing", "ready", "error"]);
|
|
3660
|
+
var testimonialSentimentSchema = z14.enum(["positive", "neutral", "negative"]);
|
|
3661
|
+
var testimonialDocSchema = z14.object({
|
|
3662
|
+
_id: z14.string(),
|
|
3663
|
+
_creationTime: z14.number(),
|
|
3664
|
+
companyId: z14.string(),
|
|
3665
|
+
sourceId: z14.string(),
|
|
3636
3666
|
sourceType: testimonialSourceTypeSchema,
|
|
3637
|
-
reviewText:
|
|
3638
|
-
reviewTitle:
|
|
3639
|
-
searchText:
|
|
3640
|
-
reviewerName:
|
|
3641
|
-
reviewerImageUrl:
|
|
3642
|
-
reviewerImageId:
|
|
3643
|
-
reviewerLocation:
|
|
3644
|
-
rating:
|
|
3645
|
-
reviewDate:
|
|
3646
|
-
ownerAnswer:
|
|
3647
|
-
mediaUrls:
|
|
3648
|
-
imageIds:
|
|
3649
|
-
videoIds:
|
|
3650
|
-
sourceUrl:
|
|
3651
|
-
rawData:
|
|
3652
|
-
tags:
|
|
3653
|
-
highlight:
|
|
3654
|
-
language:
|
|
3655
|
-
summary:
|
|
3667
|
+
reviewText: z14.string(),
|
|
3668
|
+
reviewTitle: z14.string().optional(),
|
|
3669
|
+
searchText: z14.string().optional(),
|
|
3670
|
+
reviewerName: z14.string().optional(),
|
|
3671
|
+
reviewerImageUrl: z14.string().optional(),
|
|
3672
|
+
reviewerImageId: z14.string().optional(),
|
|
3673
|
+
reviewerLocation: z14.string().optional(),
|
|
3674
|
+
rating: z14.number().optional(),
|
|
3675
|
+
reviewDate: z14.number().optional(),
|
|
3676
|
+
ownerAnswer: z14.string().optional(),
|
|
3677
|
+
mediaUrls: z14.array(z14.string()).optional(),
|
|
3678
|
+
imageIds: z14.array(z14.string()).optional(),
|
|
3679
|
+
videoIds: z14.array(z14.string()).optional(),
|
|
3680
|
+
sourceUrl: z14.string().optional(),
|
|
3681
|
+
rawData: z14.unknown().optional(),
|
|
3682
|
+
tags: z14.array(z14.string()),
|
|
3683
|
+
highlight: z14.string().optional(),
|
|
3684
|
+
language: z14.string().optional(),
|
|
3685
|
+
summary: z14.string().optional(),
|
|
3656
3686
|
sentiment: testimonialSentimentSchema.optional(),
|
|
3657
|
-
textEmbedding:
|
|
3658
|
-
externalId:
|
|
3659
|
-
contentHash:
|
|
3687
|
+
textEmbedding: z14.array(z14.number()).optional(),
|
|
3688
|
+
externalId: z14.string().optional(),
|
|
3689
|
+
contentHash: z14.string().optional(),
|
|
3660
3690
|
status: testimonialStatusSchema,
|
|
3661
|
-
errorMessage:
|
|
3662
|
-
createdAt:
|
|
3663
|
-
updatedAt:
|
|
3691
|
+
errorMessage: z14.string().optional(),
|
|
3692
|
+
createdAt: z14.number(),
|
|
3693
|
+
updatedAt: z14.number()
|
|
3664
3694
|
});
|
|
3665
|
-
var testimonialsListRequestSchema =
|
|
3695
|
+
var testimonialsListRequestSchema = z14.object({
|
|
3666
3696
|
source: testimonialSourceTypeSchema.optional(),
|
|
3667
|
-
rating_min:
|
|
3668
|
-
rating_max:
|
|
3669
|
-
tags:
|
|
3697
|
+
rating_min: z14.coerce.number().int().min(1).max(5).optional(),
|
|
3698
|
+
rating_max: z14.coerce.number().int().min(1).max(5).optional(),
|
|
3699
|
+
tags: z14.string().transform((s) => s.split(",").filter(Boolean)).optional(),
|
|
3670
3700
|
status: testimonialStatusSchema.optional(),
|
|
3671
3701
|
sentiment: testimonialSentimentSchema.optional(),
|
|
3672
|
-
language:
|
|
3673
|
-
limit:
|
|
3674
|
-
});
|
|
3675
|
-
var testimonialsListResponseSchema =
|
|
3676
|
-
var testimonialsGetRequestSchema =
|
|
3677
|
-
var testimonialsSearchRequestSchema =
|
|
3678
|
-
query:
|
|
3679
|
-
limit:
|
|
3702
|
+
language: z14.string().min(2).max(5).optional(),
|
|
3703
|
+
limit: z14.coerce.number().int().positive().max(200).optional()
|
|
3704
|
+
});
|
|
3705
|
+
var testimonialsListResponseSchema = z14.array(testimonialDocSchema);
|
|
3706
|
+
var testimonialsGetRequestSchema = z14.object({ id: z14.string().min(1, "Missing id parameter") });
|
|
3707
|
+
var testimonialsSearchRequestSchema = z14.object({
|
|
3708
|
+
query: z14.string().min(1),
|
|
3709
|
+
limit: z14.coerce.number().int().positive().max(100).optional(),
|
|
3680
3710
|
source: testimonialSourceTypeSchema.optional(),
|
|
3681
|
-
rating_min:
|
|
3682
|
-
rating_max:
|
|
3683
|
-
tags:
|
|
3711
|
+
rating_min: z14.coerce.number().int().min(1).max(5).optional(),
|
|
3712
|
+
rating_max: z14.coerce.number().int().min(1).max(5).optional(),
|
|
3713
|
+
tags: z14.array(z14.string()).optional(),
|
|
3684
3714
|
status: testimonialStatusSchema.optional(),
|
|
3685
3715
|
sentiment: testimonialSentimentSchema.optional(),
|
|
3686
|
-
language:
|
|
3716
|
+
language: z14.string().min(2).max(5).optional()
|
|
3687
3717
|
}).refine(
|
|
3688
3718
|
(data) => data.rating_min === void 0 || data.rating_max === void 0 || data.rating_min <= data.rating_max,
|
|
3689
3719
|
{ message: "rating_min must be less than or equal to rating_max" }
|
|
3690
3720
|
);
|
|
3691
|
-
var testimonialsSearchResponseSchema =
|
|
3692
|
-
var testimonialsOutscraperWebhookResponseSchema =
|
|
3693
|
-
ok:
|
|
3694
|
-
note:
|
|
3721
|
+
var testimonialsSearchResponseSchema = z14.array(testimonialDocSchema);
|
|
3722
|
+
var testimonialsOutscraperWebhookResponseSchema = z14.object({
|
|
3723
|
+
ok: z14.literal(true),
|
|
3724
|
+
note: z14.string().optional()
|
|
3695
3725
|
});
|
|
3696
3726
|
|
|
3697
3727
|
// ../api/src/videos.ts
|
|
3698
|
-
import { z as
|
|
3699
|
-
var videoStatusSchema =
|
|
3700
|
-
var videoTranscriptSegmentSchema =
|
|
3701
|
-
text:
|
|
3702
|
-
startSecond:
|
|
3703
|
-
endSecond:
|
|
3704
|
-
});
|
|
3705
|
-
var videoSceneSchema =
|
|
3706
|
-
title:
|
|
3707
|
-
description:
|
|
3708
|
-
startSecond:
|
|
3709
|
-
endSecond:
|
|
3710
|
-
thumbnailTime:
|
|
3711
|
-
});
|
|
3712
|
-
var videoDocSchema =
|
|
3713
|
-
_id:
|
|
3714
|
-
_creationTime:
|
|
3715
|
-
companyId:
|
|
3716
|
-
muxAssetId:
|
|
3717
|
-
muxPlaybackId:
|
|
3718
|
-
muxUploadId:
|
|
3719
|
-
name:
|
|
3720
|
-
description:
|
|
3721
|
-
tags:
|
|
3722
|
-
source:
|
|
3723
|
-
externalId:
|
|
3724
|
-
sourceId:
|
|
3725
|
-
width:
|
|
3726
|
-
height:
|
|
3727
|
-
aspectRatio:
|
|
3728
|
-
duration:
|
|
3729
|
-
transcript:
|
|
3730
|
-
transcriptSegments:
|
|
3731
|
-
scenes:
|
|
3732
|
-
descriptionEmbedding:
|
|
3733
|
-
searchText:
|
|
3728
|
+
import { z as z15 } from "zod";
|
|
3729
|
+
var videoStatusSchema = z15.enum(["uploading", "uploaded", "processing", "ready", "error"]);
|
|
3730
|
+
var videoTranscriptSegmentSchema = z15.object({
|
|
3731
|
+
text: z15.string(),
|
|
3732
|
+
startSecond: z15.number(),
|
|
3733
|
+
endSecond: z15.number()
|
|
3734
|
+
});
|
|
3735
|
+
var videoSceneSchema = z15.object({
|
|
3736
|
+
title: z15.string(),
|
|
3737
|
+
description: z15.string(),
|
|
3738
|
+
startSecond: z15.number(),
|
|
3739
|
+
endSecond: z15.number(),
|
|
3740
|
+
thumbnailTime: z15.number()
|
|
3741
|
+
});
|
|
3742
|
+
var videoDocSchema = z15.object({
|
|
3743
|
+
_id: z15.string(),
|
|
3744
|
+
_creationTime: z15.number(),
|
|
3745
|
+
companyId: z15.string(),
|
|
3746
|
+
muxAssetId: z15.string(),
|
|
3747
|
+
muxPlaybackId: z15.string(),
|
|
3748
|
+
muxUploadId: z15.string(),
|
|
3749
|
+
name: z15.string(),
|
|
3750
|
+
description: z15.string(),
|
|
3751
|
+
tags: z15.array(z15.string()),
|
|
3752
|
+
source: z15.string(),
|
|
3753
|
+
externalId: z15.string().optional(),
|
|
3754
|
+
sourceId: z15.string().optional(),
|
|
3755
|
+
width: z15.number().optional(),
|
|
3756
|
+
height: z15.number().optional(),
|
|
3757
|
+
aspectRatio: z15.number().optional(),
|
|
3758
|
+
duration: z15.number().optional(),
|
|
3759
|
+
transcript: z15.string().optional(),
|
|
3760
|
+
transcriptSegments: z15.array(videoTranscriptSegmentSchema).optional(),
|
|
3761
|
+
scenes: z15.array(videoSceneSchema).optional(),
|
|
3762
|
+
descriptionEmbedding: z15.array(z15.number()).optional(),
|
|
3763
|
+
searchText: z15.string().optional(),
|
|
3734
3764
|
status: videoStatusSchema,
|
|
3735
|
-
errorMessage:
|
|
3736
|
-
createdAt:
|
|
3737
|
-
updatedAt:
|
|
3738
|
-
thumbnailUrl:
|
|
3739
|
-
});
|
|
3740
|
-
var videosWebhookResponseSchema =
|
|
3741
|
-
var videosGetRequestSchema =
|
|
3742
|
-
var videosSearchRequestSchema =
|
|
3743
|
-
query:
|
|
3744
|
-
limit:
|
|
3745
|
-
tags:
|
|
3746
|
-
});
|
|
3747
|
-
var videoSearchResultSchema =
|
|
3748
|
-
_id:
|
|
3749
|
-
thumbnailUrl:
|
|
3750
|
-
name:
|
|
3751
|
-
description:
|
|
3752
|
-
tags:
|
|
3753
|
-
status:
|
|
3754
|
-
duration:
|
|
3755
|
-
muxPlaybackId:
|
|
3756
|
-
createdAt:
|
|
3757
|
-
});
|
|
3758
|
-
var videosSearchResponseSchema =
|
|
3759
|
-
var videosUploadResponseSchema =
|
|
3760
|
-
var videosDeleteRequestSchema =
|
|
3761
|
-
var videosDeleteResponseSchema =
|
|
3765
|
+
errorMessage: z15.string().optional(),
|
|
3766
|
+
createdAt: z15.number(),
|
|
3767
|
+
updatedAt: z15.number(),
|
|
3768
|
+
thumbnailUrl: z15.string()
|
|
3769
|
+
});
|
|
3770
|
+
var videosWebhookResponseSchema = z15.object({ ok: z15.literal(true) });
|
|
3771
|
+
var videosGetRequestSchema = z15.object({ id: z15.string().min(1, "Missing id parameter") });
|
|
3772
|
+
var videosSearchRequestSchema = z15.object({
|
|
3773
|
+
query: z15.string().min(1),
|
|
3774
|
+
limit: z15.coerce.number().int().positive().max(100).optional(),
|
|
3775
|
+
tags: z15.array(z15.string()).optional()
|
|
3776
|
+
});
|
|
3777
|
+
var videoSearchResultSchema = z15.object({
|
|
3778
|
+
_id: z15.string(),
|
|
3779
|
+
thumbnailUrl: z15.string(),
|
|
3780
|
+
name: z15.string(),
|
|
3781
|
+
description: z15.string(),
|
|
3782
|
+
tags: z15.array(z15.string()),
|
|
3783
|
+
status: z15.string(),
|
|
3784
|
+
duration: z15.number().optional(),
|
|
3785
|
+
muxPlaybackId: z15.string(),
|
|
3786
|
+
createdAt: z15.number()
|
|
3787
|
+
});
|
|
3788
|
+
var videosSearchResponseSchema = z15.array(videoSearchResultSchema);
|
|
3789
|
+
var videosUploadResponseSchema = z15.object({ uploadUrl: z15.string(), videoId: z15.string() });
|
|
3790
|
+
var videosDeleteRequestSchema = z15.object({ id: z15.string().min(1, "Missing video ID") });
|
|
3791
|
+
var videosDeleteResponseSchema = z15.object({ ok: z15.literal(true) });
|
|
3762
3792
|
|
|
3763
3793
|
// src/commands/actions/complete.ts
|
|
3764
3794
|
import { defineCommand as defineCommand2 } from "citty";
|
|
@@ -5359,7 +5389,7 @@ var GEO_TARGET_CONSTANT_REGEX = /^geoTargetConstants\/\d+$/;
|
|
|
5359
5389
|
var LANGUAGE_CONSTANT_REGEX = /^languageConstants\/\d+$/;
|
|
5360
5390
|
|
|
5361
5391
|
// ../api/src/ads-google/ops.ts
|
|
5362
|
-
import { z as
|
|
5392
|
+
import { z as z16 } from "zod";
|
|
5363
5393
|
|
|
5364
5394
|
// ../api/src/ads-google/structured-snippet-headers.ts
|
|
5365
5395
|
var STRUCTURED_SNIPPET_HEADERS_EN = [
|
|
@@ -5854,54 +5884,54 @@ function canonicalStructuredSnippetHeader(header) {
|
|
|
5854
5884
|
}
|
|
5855
5885
|
|
|
5856
5886
|
// ../api/src/ads-google/ops.ts
|
|
5857
|
-
var tempRefSchema2 =
|
|
5858
|
-
var refSchema =
|
|
5859
|
-
|
|
5860
|
-
|
|
5887
|
+
var tempRefSchema2 = z16.string().regex(TEMP_REF_REGEX2, "expected a g_temp_* reference");
|
|
5888
|
+
var refSchema = z16.union([
|
|
5889
|
+
z16.string().regex(RESOURCE_NAME_REGEX, "expected a customers/\u2026/\u2026/\u2026 resource name"),
|
|
5890
|
+
z16.string().regex(NUMERIC_ID_REGEX2, "expected a numeric id"),
|
|
5861
5891
|
tempRefSchema2
|
|
5862
5892
|
]);
|
|
5863
5893
|
var targetRefSchema = refSchema;
|
|
5864
|
-
var microsSchema =
|
|
5865
|
-
var httpsUrlSchema2 =
|
|
5866
|
-
var customerIdSchema =
|
|
5867
|
-
var stageableStatusSchema2 =
|
|
5868
|
-
var matchTypeSchema =
|
|
5869
|
-
var finalUrlSuffixSchema =
|
|
5894
|
+
var microsSchema = z16.number().int().positive("expected a positive micros amount");
|
|
5895
|
+
var httpsUrlSchema2 = z16.string().url().refine((u) => u.startsWith("https://"), "final URLs must be https");
|
|
5896
|
+
var customerIdSchema = z16.string().regex(NUMERIC_ID_REGEX2, "customerId must be the bare numeric customer id");
|
|
5897
|
+
var stageableStatusSchema2 = z16.enum(STAGEABLE_CREATE_STATUSES2);
|
|
5898
|
+
var matchTypeSchema = z16.enum(KEYWORD_MATCH_TYPES);
|
|
5899
|
+
var finalUrlSuffixSchema = z16.string().max(GOOGLE_ADS_LIMITS.campaign.finalUrlSuffixMax).refine((s) => !/^[?&]/.test(s), "drop the leading ? or & \u2014 a final URL suffix is bare query parameters").refine((s) => !s.includes("{lpurl}"), "{lpurl} belongs in a tracking template, not in a final URL suffix").refine((s) => !/\s/.test(s), "a final URL suffix cannot contain whitespace").refine((s) => s === "" || s.includes("="), 'expected key=value pairs, e.g. "utm_source=google&utm_agency=baker"');
|
|
5870
5900
|
var LANDING_PAGE_TAGS = ["{lpurl}", "{unescapedlpurl}", "{escapedlpurl}", "{lpurl+2}", "{lpurl+3}"];
|
|
5871
|
-
var trackingUrlTemplateSchema =
|
|
5901
|
+
var trackingUrlTemplateSchema = z16.string().max(GOOGLE_ADS_LIMITS.campaign.trackingUrlTemplateMax).refine((t) => !/\s/.test(t), "a tracking template cannot contain whitespace").refine(
|
|
5872
5902
|
(t) => t === "" || LANDING_PAGE_TAGS.some((tag) => t.includes(tag)),
|
|
5873
5903
|
`a tracking template must carry the landing page through one of ${LANDING_PAGE_TAGS.join(", ")}, e.g. "https://tracker.example/?url={lpurl}"`
|
|
5874
5904
|
).refine(
|
|
5875
5905
|
(t) => t === "" || /^(https?:\/\/|\{)/.test(t),
|
|
5876
5906
|
"a tracking template must start with http://, https:// or a {lpurl} tag"
|
|
5877
5907
|
);
|
|
5878
|
-
var urlCustomParametersSchema =
|
|
5879
|
-
|
|
5880
|
-
key:
|
|
5881
|
-
value:
|
|
5908
|
+
var urlCustomParametersSchema = z16.array(
|
|
5909
|
+
z16.strictObject({
|
|
5910
|
+
key: z16.string().min(1).max(GOOGLE_ADS_LIMITS.campaign.urlCustomParameterKeyMax).regex(/^[A-Za-z0-9_]+$/, "a custom parameter key is letters, digits and underscores only"),
|
|
5911
|
+
value: z16.string().max(GOOGLE_ADS_LIMITS.campaign.urlCustomParameterValueMax)
|
|
5882
5912
|
})
|
|
5883
5913
|
).max(GOOGLE_ADS_LIMITS.campaign.urlCustomParametersMax).refine(
|
|
5884
5914
|
(params) => new Set(params.map((p) => p.key)).size === params.length,
|
|
5885
5915
|
"each custom parameter key can appear only once"
|
|
5886
5916
|
);
|
|
5887
|
-
var keywordTextSchema =
|
|
5888
|
-
var budgetCreateSchema =
|
|
5889
|
-
name:
|
|
5917
|
+
var keywordTextSchema = z16.string().min(1).max(GOOGLE_ADS_LIMITS.keyword.textMax).refine((t) => t.trim().split(/\s+/).length <= GOOGLE_ADS_LIMITS.keyword.wordsMax, "keyword exceeds 10 words");
|
|
5918
|
+
var budgetCreateSchema = z16.object({
|
|
5919
|
+
name: z16.string().min(1).max(GOOGLE_ADS_LIMITS.budget.nameMax),
|
|
5890
5920
|
amountMicros: microsSchema,
|
|
5891
|
-
deliveryMethod:
|
|
5892
|
-
explicitlyShared:
|
|
5921
|
+
deliveryMethod: z16.enum(BUDGET_DELIVERY_METHODS).default("STANDARD"),
|
|
5922
|
+
explicitlyShared: z16.boolean().default(false)
|
|
5893
5923
|
});
|
|
5894
|
-
var budgetUpdateSchema =
|
|
5895
|
-
name:
|
|
5924
|
+
var budgetUpdateSchema = z16.object({
|
|
5925
|
+
name: z16.string().min(1).max(GOOGLE_ADS_LIMITS.budget.nameMax).optional(),
|
|
5896
5926
|
amountMicros: microsSchema.optional(),
|
|
5897
|
-
deliveryMethod:
|
|
5927
|
+
deliveryMethod: z16.enum(BUDGET_DELIVERY_METHODS).optional()
|
|
5898
5928
|
}).refine((p) => Object.values(p).some((v) => v !== void 0), "update needs at least one field");
|
|
5899
|
-
var biddingConfigSchema =
|
|
5900
|
-
type:
|
|
5929
|
+
var biddingConfigSchema = z16.object({
|
|
5930
|
+
type: z16.enum(BIDDING_STRATEGY_TYPES),
|
|
5901
5931
|
targetCpaMicros: microsSchema.optional(),
|
|
5902
|
-
targetRoas:
|
|
5932
|
+
targetRoas: z16.number().positive().optional(),
|
|
5903
5933
|
cpcBidCeilingMicros: microsSchema.optional(),
|
|
5904
|
-
enhancedCpcEnabled:
|
|
5934
|
+
enhancedCpcEnabled: z16.boolean().optional()
|
|
5905
5935
|
}).superRefine((p, ctx) => {
|
|
5906
5936
|
if (p.type === "TARGET_CPA" && p.targetCpaMicros === void 0) {
|
|
5907
5937
|
ctx.addIssue({ code: "custom", path: ["targetCpaMicros"], message: "TARGET_CPA needs targetCpaMicros" });
|
|
@@ -5910,24 +5940,24 @@ var biddingConfigSchema = z15.object({
|
|
|
5910
5940
|
ctx.addIssue({ code: "custom", path: ["targetRoas"], message: "TARGET_ROAS needs targetRoas" });
|
|
5911
5941
|
}
|
|
5912
5942
|
});
|
|
5913
|
-
var networkSettingsSchema =
|
|
5914
|
-
targetGoogleSearch:
|
|
5915
|
-
targetSearchNetwork:
|
|
5916
|
-
targetContentNetwork:
|
|
5917
|
-
targetPartnerSearchNetwork:
|
|
5943
|
+
var networkSettingsSchema = z16.object({
|
|
5944
|
+
targetGoogleSearch: z16.boolean().optional(),
|
|
5945
|
+
targetSearchNetwork: z16.boolean().optional(),
|
|
5946
|
+
targetContentNetwork: z16.boolean().optional(),
|
|
5947
|
+
targetPartnerSearchNetwork: z16.boolean().optional()
|
|
5918
5948
|
});
|
|
5919
|
-
var dateSchema =
|
|
5920
|
-
var geoTargetTypeSettingSchema =
|
|
5921
|
-
positiveGeoTargetType:
|
|
5922
|
-
negativeGeoTargetType:
|
|
5949
|
+
var dateSchema = z16.string().regex(/^\d{4}-\d{2}-\d{2}$/, "expected a YYYY-MM-DD date");
|
|
5950
|
+
var geoTargetTypeSettingSchema = z16.strictObject({
|
|
5951
|
+
positiveGeoTargetType: z16.enum(POSITIVE_GEO_TARGET_TYPES).optional(),
|
|
5952
|
+
negativeGeoTargetType: z16.enum(NEGATIVE_GEO_TARGET_TYPES).optional()
|
|
5923
5953
|
}).refine(
|
|
5924
5954
|
(p) => p.positiveGeoTargetType !== void 0 || p.negativeGeoTargetType !== void 0,
|
|
5925
5955
|
"geoTargetTypeSetting needs positiveGeoTargetType and/or negativeGeoTargetType"
|
|
5926
5956
|
);
|
|
5927
|
-
var campaignCreateSchema2 =
|
|
5928
|
-
name:
|
|
5929
|
-
channelType:
|
|
5930
|
-
channelSubType:
|
|
5957
|
+
var campaignCreateSchema2 = z16.strictObject({
|
|
5958
|
+
name: z16.string().min(1).max(GOOGLE_ADS_LIMITS.campaign.nameMax),
|
|
5959
|
+
channelType: z16.enum(ADVERTISING_CHANNEL_TYPES),
|
|
5960
|
+
channelSubType: z16.enum(ADVERTISING_CHANNEL_SUB_TYPES).optional(),
|
|
5931
5961
|
budget: refSchema,
|
|
5932
5962
|
/** Inline standard bidding, or a portfolio strategy ref via biddingStrategy. */
|
|
5933
5963
|
bidding: biddingConfigSchema.optional(),
|
|
@@ -5947,12 +5977,12 @@ var campaignCreateSchema2 = z15.strictObject({
|
|
|
5947
5977
|
/** The `{_name}` parameters this campaign's tracking template and final URLs can reference. */
|
|
5948
5978
|
urlCustomParameters: urlCustomParametersSchema.optional(),
|
|
5949
5979
|
/** Advisory Google Ads UI objective — drives warnings, not sent to the API. */
|
|
5950
|
-
objective:
|
|
5980
|
+
objective: z16.enum(CAMPAIGN_OBJECTIVES).optional(),
|
|
5951
5981
|
/**
|
|
5952
5982
|
* Whether the campaign contains EU political advertising. Google requires the declaration on
|
|
5953
5983
|
* every campaign create (FieldError.REQUIRED without it); omitted means it does not.
|
|
5954
5984
|
*/
|
|
5955
|
-
euPoliticalAds:
|
|
5985
|
+
euPoliticalAds: z16.boolean().optional(),
|
|
5956
5986
|
status: stageableStatusSchema2.default("PAUSED")
|
|
5957
5987
|
}).superRefine((p, ctx) => {
|
|
5958
5988
|
if (!p.bidding && !p.biddingStrategy) {
|
|
@@ -5976,8 +6006,8 @@ var campaignCreateSchema2 = z15.strictObject({
|
|
|
5976
6006
|
ctx.addIssue({ code: "custom", path: ["endDate"], message: "endDate must be after startDate" });
|
|
5977
6007
|
}
|
|
5978
6008
|
});
|
|
5979
|
-
var campaignUpdateSchema2 =
|
|
5980
|
-
name:
|
|
6009
|
+
var campaignUpdateSchema2 = z16.strictObject({
|
|
6010
|
+
name: z16.string().min(1).max(GOOGLE_ADS_LIMITS.campaign.nameMax).optional(),
|
|
5981
6011
|
budget: refSchema.optional(),
|
|
5982
6012
|
bidding: biddingConfigSchema.optional(),
|
|
5983
6013
|
networkSettings: networkSettingsSchema.optional(),
|
|
@@ -5992,130 +6022,130 @@ var campaignUpdateSchema2 = z15.strictObject({
|
|
|
5992
6022
|
/** Replaces the campaign's custom parameters wholesale; `[]` removes them all. */
|
|
5993
6023
|
urlCustomParameters: urlCustomParametersSchema.optional(),
|
|
5994
6024
|
/** Corrects the campaign's EU political advertising declaration (true = contains, false = does not). */
|
|
5995
|
-
euPoliticalAds:
|
|
5996
|
-
status:
|
|
6025
|
+
euPoliticalAds: z16.boolean().optional(),
|
|
6026
|
+
status: z16.enum(["ENABLED", "PAUSED", "REMOVED"]).optional()
|
|
5997
6027
|
}).refine((p) => Object.values(p).some((v) => v !== void 0), "update needs at least one field");
|
|
5998
|
-
var adGroupCreateSchema =
|
|
5999
|
-
name:
|
|
6028
|
+
var adGroupCreateSchema = z16.object({
|
|
6029
|
+
name: z16.string().min(1).max(GOOGLE_ADS_LIMITS.adGroup.nameMax),
|
|
6000
6030
|
campaign: refSchema,
|
|
6001
|
-
type:
|
|
6031
|
+
type: z16.enum(AD_GROUP_TYPES).default("SEARCH_STANDARD"),
|
|
6002
6032
|
cpcBidMicros: microsSchema.optional(),
|
|
6003
6033
|
status: stageableStatusSchema2.default("PAUSED")
|
|
6004
6034
|
});
|
|
6005
|
-
var adGroupUpdateSchema =
|
|
6006
|
-
name:
|
|
6035
|
+
var adGroupUpdateSchema = z16.object({
|
|
6036
|
+
name: z16.string().min(1).max(GOOGLE_ADS_LIMITS.adGroup.nameMax).optional(),
|
|
6007
6037
|
cpcBidMicros: microsSchema.optional(),
|
|
6008
|
-
status:
|
|
6038
|
+
status: z16.enum(["ENABLED", "PAUSED", "REMOVED"]).optional()
|
|
6009
6039
|
}).refine((p) => Object.values(p).some((v) => v !== void 0), "update needs at least one field");
|
|
6010
|
-
var keywordAddSchema =
|
|
6040
|
+
var keywordAddSchema = z16.object({
|
|
6011
6041
|
adGroup: refSchema,
|
|
6012
6042
|
text: keywordTextSchema,
|
|
6013
6043
|
matchType: matchTypeSchema,
|
|
6014
6044
|
cpcBidMicros: microsSchema.optional(),
|
|
6015
|
-
finalUrls:
|
|
6045
|
+
finalUrls: z16.array(httpsUrlSchema2).optional(),
|
|
6016
6046
|
status: stageableStatusSchema2.default("ENABLED")
|
|
6017
6047
|
});
|
|
6018
|
-
var keywordUpdateSchema =
|
|
6048
|
+
var keywordUpdateSchema = z16.object({
|
|
6019
6049
|
cpcBidMicros: microsSchema.optional(),
|
|
6020
|
-
finalUrls:
|
|
6021
|
-
status:
|
|
6050
|
+
finalUrls: z16.array(httpsUrlSchema2).optional(),
|
|
6051
|
+
status: z16.enum(["ENABLED", "PAUSED", "REMOVED"]).optional()
|
|
6022
6052
|
}).refine((p) => Object.values(p).some((v) => v !== void 0), "update needs at least one field");
|
|
6023
|
-
var negativeKeywordAddSchema =
|
|
6024
|
-
level:
|
|
6053
|
+
var negativeKeywordAddSchema = z16.object({
|
|
6054
|
+
level: z16.enum(["adGroup", "campaign"]),
|
|
6025
6055
|
parent: refSchema,
|
|
6026
6056
|
text: keywordTextSchema,
|
|
6027
6057
|
matchType: matchTypeSchema
|
|
6028
6058
|
});
|
|
6029
|
-
var sharedSetCreateSchema =
|
|
6030
|
-
name:
|
|
6031
|
-
type:
|
|
6059
|
+
var sharedSetCreateSchema = z16.object({
|
|
6060
|
+
name: z16.string().min(1).max(GOOGLE_ADS_LIMITS.sharedSet.nameMax),
|
|
6061
|
+
type: z16.enum(SHARED_SET_TYPES).default("NEGATIVE_KEYWORDS")
|
|
6032
6062
|
});
|
|
6033
|
-
var sharedSetMemberAddSchema =
|
|
6063
|
+
var sharedSetMemberAddSchema = z16.object({
|
|
6034
6064
|
sharedSet: refSchema,
|
|
6035
6065
|
text: keywordTextSchema,
|
|
6036
6066
|
matchType: matchTypeSchema
|
|
6037
6067
|
});
|
|
6038
|
-
var campaignSharedSetAttachSchema =
|
|
6068
|
+
var campaignSharedSetAttachSchema = z16.object({
|
|
6039
6069
|
campaign: refSchema,
|
|
6040
6070
|
sharedSet: refSchema
|
|
6041
6071
|
});
|
|
6042
|
-
var adTextAssetSchema =
|
|
6043
|
-
text:
|
|
6044
|
-
pinnedField:
|
|
6072
|
+
var adTextAssetSchema = z16.object({
|
|
6073
|
+
text: z16.string().min(1),
|
|
6074
|
+
pinnedField: z16.enum(PINNED_FIELDS).optional()
|
|
6045
6075
|
});
|
|
6046
|
-
var responsiveSearchAdSchema =
|
|
6047
|
-
format:
|
|
6048
|
-
headlines:
|
|
6076
|
+
var responsiveSearchAdSchema = z16.strictObject({
|
|
6077
|
+
format: z16.literal("responsiveSearch"),
|
|
6078
|
+
headlines: z16.array(
|
|
6049
6079
|
adTextAssetSchema.refine(
|
|
6050
6080
|
(a) => a.text.length <= GOOGLE_ADS_LIMITS.responsiveSearchAd.headlineTextMax,
|
|
6051
6081
|
"headline exceeds 30 chars"
|
|
6052
6082
|
)
|
|
6053
6083
|
).min(GOOGLE_ADS_LIMITS.responsiveSearchAd.headlinesMin).max(GOOGLE_ADS_LIMITS.responsiveSearchAd.headlinesMax),
|
|
6054
|
-
descriptions:
|
|
6084
|
+
descriptions: z16.array(
|
|
6055
6085
|
adTextAssetSchema.refine(
|
|
6056
6086
|
(a) => a.text.length <= GOOGLE_ADS_LIMITS.responsiveSearchAd.descriptionTextMax,
|
|
6057
6087
|
"description exceeds 90 chars"
|
|
6058
6088
|
)
|
|
6059
6089
|
).min(GOOGLE_ADS_LIMITS.responsiveSearchAd.descriptionsMin).max(GOOGLE_ADS_LIMITS.responsiveSearchAd.descriptionsMax),
|
|
6060
|
-
path1:
|
|
6061
|
-
path2:
|
|
6062
|
-
finalUrls:
|
|
6063
|
-
});
|
|
6064
|
-
var responsiveDisplayAdSchema =
|
|
6065
|
-
format:
|
|
6066
|
-
headlines:
|
|
6067
|
-
longHeadline:
|
|
6068
|
-
descriptions:
|
|
6069
|
-
businessName:
|
|
6090
|
+
path1: z16.string().max(GOOGLE_ADS_LIMITS.responsiveSearchAd.pathMax).optional(),
|
|
6091
|
+
path2: z16.string().max(GOOGLE_ADS_LIMITS.responsiveSearchAd.pathMax).optional(),
|
|
6092
|
+
finalUrls: z16.array(httpsUrlSchema2).min(1)
|
|
6093
|
+
});
|
|
6094
|
+
var responsiveDisplayAdSchema = z16.strictObject({
|
|
6095
|
+
format: z16.literal("responsiveDisplay"),
|
|
6096
|
+
headlines: z16.array(z16.object({ text: z16.string().min(1).max(GOOGLE_ADS_LIMITS.responsiveDisplayAd.headlineTextMax) })).min(1).max(5),
|
|
6097
|
+
longHeadline: z16.object({ text: z16.string().min(1).max(GOOGLE_ADS_LIMITS.responsiveDisplayAd.longHeadlineTextMax) }),
|
|
6098
|
+
descriptions: z16.array(z16.object({ text: z16.string().min(1).max(GOOGLE_ADS_LIMITS.responsiveDisplayAd.descriptionTextMax) })).min(1).max(5),
|
|
6099
|
+
businessName: z16.string().min(1).max(GOOGLE_ADS_LIMITS.responsiveDisplayAd.businessNameMax),
|
|
6070
6100
|
// A Responsive Display Ad's images are fields on the ad's own content (never campaign-level
|
|
6071
6101
|
// asset links). Google requires ≥1 landscape marketing image (1.91:1) AND ≥1 square marketing
|
|
6072
6102
|
// image (1:1) to serve; the logo images are optional.
|
|
6073
|
-
marketingImageAssets:
|
|
6074
|
-
squareMarketingImageAssets:
|
|
6075
|
-
logoImageAssets:
|
|
6076
|
-
finalUrls:
|
|
6077
|
-
});
|
|
6078
|
-
var callAdSchema =
|
|
6079
|
-
format:
|
|
6080
|
-
countryCode:
|
|
6081
|
-
phoneNumber:
|
|
6082
|
-
headline1:
|
|
6083
|
-
headline2:
|
|
6084
|
-
description1:
|
|
6085
|
-
description2:
|
|
6086
|
-
businessName:
|
|
6087
|
-
finalUrls:
|
|
6088
|
-
});
|
|
6089
|
-
var appAdSchema =
|
|
6090
|
-
format:
|
|
6091
|
-
headlines:
|
|
6092
|
-
descriptions:
|
|
6103
|
+
marketingImageAssets: z16.array(refSchema).optional(),
|
|
6104
|
+
squareMarketingImageAssets: z16.array(refSchema).optional(),
|
|
6105
|
+
logoImageAssets: z16.array(refSchema).optional(),
|
|
6106
|
+
finalUrls: z16.array(httpsUrlSchema2).min(1)
|
|
6107
|
+
});
|
|
6108
|
+
var callAdSchema = z16.strictObject({
|
|
6109
|
+
format: z16.literal("call"),
|
|
6110
|
+
countryCode: z16.string().length(2),
|
|
6111
|
+
phoneNumber: z16.string().min(3),
|
|
6112
|
+
headline1: z16.string().min(1).max(30),
|
|
6113
|
+
headline2: z16.string().min(1).max(30),
|
|
6114
|
+
description1: z16.string().min(1).max(90),
|
|
6115
|
+
description2: z16.string().min(1).max(90),
|
|
6116
|
+
businessName: z16.string().min(1).max(25),
|
|
6117
|
+
finalUrls: z16.array(httpsUrlSchema2).min(1)
|
|
6118
|
+
});
|
|
6119
|
+
var appAdSchema = z16.strictObject({
|
|
6120
|
+
format: z16.literal("app"),
|
|
6121
|
+
headlines: z16.array(z16.object({ text: z16.string().min(1).max(GOOGLE_ADS_LIMITS.appAd.headlineTextMax) })).min(GOOGLE_ADS_LIMITS.appAd.headlinesMin).max(GOOGLE_ADS_LIMITS.appAd.headlinesMax),
|
|
6122
|
+
descriptions: z16.array(z16.object({ text: z16.string().min(1).max(GOOGLE_ADS_LIMITS.appAd.descriptionTextMax) })).min(GOOGLE_ADS_LIMITS.appAd.descriptionsMin).max(GOOGLE_ADS_LIMITS.appAd.descriptionsMax),
|
|
6093
6123
|
// An App campaign ad carries its images on its own content (`AppAdInfo.images`), not as
|
|
6094
6124
|
// campaign-level asset links — same shape as a responsive display ad's marketing images.
|
|
6095
|
-
images:
|
|
6125
|
+
images: z16.array(refSchema).max(GOOGLE_ADS_LIMITS.appAd.imagesMax).optional(),
|
|
6096
6126
|
// `AppAdInfo.youtube_videos` — an App ad's videos live on its content too. Without this field
|
|
6097
6127
|
// there is no way to express "keep these videos on the ad", so a content update that only
|
|
6098
6128
|
// restated headlines silently left the ad's videos to whatever the mask happened to omit.
|
|
6099
|
-
youtubeVideos:
|
|
6129
|
+
youtubeVideos: z16.array(refSchema).max(GOOGLE_ADS_LIMITS.appAd.youtubeVideosMax).optional()
|
|
6100
6130
|
});
|
|
6101
|
-
var videoAdSchema =
|
|
6102
|
-
format:
|
|
6131
|
+
var videoAdSchema = z16.strictObject({
|
|
6132
|
+
format: z16.literal("video"),
|
|
6103
6133
|
// A raw YouTube id is not a publishable Google Ads reference — the video must be staged as
|
|
6104
6134
|
// its own `google.asset.create` (type: youtubeVideo) first, then referenced here by asset ref.
|
|
6105
|
-
videoAssets:
|
|
6106
|
-
finalUrls:
|
|
6107
|
-
});
|
|
6108
|
-
var demandGenAdSchema =
|
|
6109
|
-
format:
|
|
6110
|
-
headlines:
|
|
6111
|
-
descriptions:
|
|
6112
|
-
businessName:
|
|
6113
|
-
finalUrls:
|
|
6114
|
-
imageAssets:
|
|
6115
|
-
squareImageAssets:
|
|
6116
|
-
logoImageAssets:
|
|
6117
|
-
});
|
|
6118
|
-
var adContentSchema2 =
|
|
6135
|
+
videoAssets: z16.array(refSchema).min(1),
|
|
6136
|
+
finalUrls: z16.array(httpsUrlSchema2).min(1)
|
|
6137
|
+
});
|
|
6138
|
+
var demandGenAdSchema = z16.strictObject({
|
|
6139
|
+
format: z16.literal("demandGen"),
|
|
6140
|
+
headlines: z16.array(z16.object({ text: z16.string().min(1).max(40) })).min(1).max(5),
|
|
6141
|
+
descriptions: z16.array(z16.object({ text: z16.string().min(1).max(90) })).min(1).max(5),
|
|
6142
|
+
businessName: z16.string().min(1).max(25),
|
|
6143
|
+
finalUrls: z16.array(httpsUrlSchema2).min(1),
|
|
6144
|
+
imageAssets: z16.array(refSchema).optional(),
|
|
6145
|
+
squareImageAssets: z16.array(refSchema).optional(),
|
|
6146
|
+
logoImageAssets: z16.array(refSchema).optional()
|
|
6147
|
+
});
|
|
6148
|
+
var adContentSchema2 = z16.discriminatedUnion("format", [
|
|
6119
6149
|
responsiveSearchAdSchema,
|
|
6120
6150
|
responsiveDisplayAdSchema,
|
|
6121
6151
|
callAdSchema,
|
|
@@ -6123,56 +6153,56 @@ var adContentSchema2 = z15.discriminatedUnion("format", [
|
|
|
6123
6153
|
videoAdSchema,
|
|
6124
6154
|
demandGenAdSchema
|
|
6125
6155
|
]);
|
|
6126
|
-
var adCreateSchema =
|
|
6156
|
+
var adCreateSchema = z16.object({
|
|
6127
6157
|
adGroup: refSchema,
|
|
6128
6158
|
status: stageableStatusSchema2.default("PAUSED"),
|
|
6129
6159
|
content: adContentSchema2
|
|
6130
6160
|
});
|
|
6131
|
-
var adUpdateSchema =
|
|
6132
|
-
status:
|
|
6161
|
+
var adUpdateSchema = z16.object({
|
|
6162
|
+
status: z16.enum(["ENABLED", "PAUSED", "REMOVED"]).optional(),
|
|
6133
6163
|
/** Whole-content replacement for RSA-like formats; re-validated against adContentSchema. */
|
|
6134
|
-
content:
|
|
6164
|
+
content: z16.record(z16.string(), z16.unknown()).optional()
|
|
6135
6165
|
}).refine((p) => Object.values(p).some((v) => v !== void 0), "update needs at least one field");
|
|
6136
|
-
var textAssetSchema =
|
|
6137
|
-
var imageAssetSchema =
|
|
6138
|
-
type:
|
|
6139
|
-
imageId:
|
|
6140
|
-
name:
|
|
6141
|
-
});
|
|
6142
|
-
var youtubeVideoAssetSchema =
|
|
6143
|
-
type:
|
|
6144
|
-
youtubeVideoId:
|
|
6145
|
-
name:
|
|
6146
|
-
});
|
|
6147
|
-
var sitelinkAssetSchema =
|
|
6148
|
-
type:
|
|
6149
|
-
linkText:
|
|
6150
|
-
description1:
|
|
6151
|
-
description2:
|
|
6152
|
-
finalUrls:
|
|
6153
|
-
});
|
|
6154
|
-
var calloutAssetSchema =
|
|
6155
|
-
type:
|
|
6156
|
-
calloutText:
|
|
6157
|
-
});
|
|
6158
|
-
var structuredSnippetHeaderSchema =
|
|
6166
|
+
var textAssetSchema = z16.object({ type: z16.literal("text"), text: z16.string().min(1) });
|
|
6167
|
+
var imageAssetSchema = z16.object({
|
|
6168
|
+
type: z16.literal("image"),
|
|
6169
|
+
imageId: z16.string().min(1),
|
|
6170
|
+
name: z16.string().optional()
|
|
6171
|
+
});
|
|
6172
|
+
var youtubeVideoAssetSchema = z16.object({
|
|
6173
|
+
type: z16.literal("youtubeVideo"),
|
|
6174
|
+
youtubeVideoId: z16.string().min(1),
|
|
6175
|
+
name: z16.string().optional()
|
|
6176
|
+
});
|
|
6177
|
+
var sitelinkAssetSchema = z16.object({
|
|
6178
|
+
type: z16.literal("sitelink"),
|
|
6179
|
+
linkText: z16.string().min(1).max(GOOGLE_ADS_LIMITS.asset.sitelinkLinkTextMax),
|
|
6180
|
+
description1: z16.string().max(GOOGLE_ADS_LIMITS.asset.sitelinkDescriptionMax).optional(),
|
|
6181
|
+
description2: z16.string().max(GOOGLE_ADS_LIMITS.asset.sitelinkDescriptionMax).optional(),
|
|
6182
|
+
finalUrls: z16.array(httpsUrlSchema2).min(1)
|
|
6183
|
+
});
|
|
6184
|
+
var calloutAssetSchema = z16.object({
|
|
6185
|
+
type: z16.literal("callout"),
|
|
6186
|
+
calloutText: z16.string().min(1).max(GOOGLE_ADS_LIMITS.asset.calloutTextMax)
|
|
6187
|
+
});
|
|
6188
|
+
var structuredSnippetHeaderSchema = z16.string().min(1).transform((header, ctx) => {
|
|
6159
6189
|
const canonical2 = canonicalStructuredSnippetHeader(header);
|
|
6160
6190
|
if (!canonical2) {
|
|
6161
6191
|
ctx.addIssue({
|
|
6162
6192
|
code: "custom",
|
|
6163
6193
|
message: `Google Ads does not accept "${header}" as a structured snippet header. Use one of: ${STRUCTURED_SNIPPET_HEADERS_EN.join(", ")} \u2014 or that header in the campaign's language.`
|
|
6164
6194
|
});
|
|
6165
|
-
return
|
|
6195
|
+
return z16.NEVER;
|
|
6166
6196
|
}
|
|
6167
6197
|
return canonical2;
|
|
6168
6198
|
});
|
|
6169
|
-
var structuredSnippetAssetSchema =
|
|
6170
|
-
type:
|
|
6199
|
+
var structuredSnippetAssetSchema = z16.object({
|
|
6200
|
+
type: z16.literal("structuredSnippet"),
|
|
6171
6201
|
header: structuredSnippetHeaderSchema,
|
|
6172
|
-
values:
|
|
6202
|
+
values: z16.array(z16.string().min(1)).min(GOOGLE_ADS_LIMITS.asset.structuredSnippetValuesMin).max(GOOGLE_ADS_LIMITS.asset.structuredSnippetValuesMax)
|
|
6173
6203
|
});
|
|
6174
|
-
var callToActionAssetSchema =
|
|
6175
|
-
var assetCreateSchema =
|
|
6204
|
+
var callToActionAssetSchema = z16.object({ type: z16.literal("callToAction"), callToAction: z16.string().min(1) });
|
|
6205
|
+
var assetCreateSchema = z16.discriminatedUnion("type", [
|
|
6176
6206
|
textAssetSchema,
|
|
6177
6207
|
imageAssetSchema,
|
|
6178
6208
|
youtubeVideoAssetSchema,
|
|
@@ -6181,80 +6211,80 @@ var assetCreateSchema = z15.discriminatedUnion("type", [
|
|
|
6181
6211
|
structuredSnippetAssetSchema,
|
|
6182
6212
|
callToActionAssetSchema
|
|
6183
6213
|
]);
|
|
6184
|
-
var assetUpdateSchema =
|
|
6185
|
-
name:
|
|
6186
|
-
linkText:
|
|
6187
|
-
description1:
|
|
6188
|
-
description2:
|
|
6189
|
-
finalUrls:
|
|
6190
|
-
calloutText:
|
|
6214
|
+
var assetUpdateSchema = z16.object({
|
|
6215
|
+
name: z16.string().min(1).optional(),
|
|
6216
|
+
linkText: z16.string().min(1).max(GOOGLE_ADS_LIMITS.asset.sitelinkLinkTextMax).optional(),
|
|
6217
|
+
description1: z16.string().max(GOOGLE_ADS_LIMITS.asset.sitelinkDescriptionMax).optional(),
|
|
6218
|
+
description2: z16.string().max(GOOGLE_ADS_LIMITS.asset.sitelinkDescriptionMax).optional(),
|
|
6219
|
+
finalUrls: z16.array(httpsUrlSchema2).min(1).optional(),
|
|
6220
|
+
calloutText: z16.string().min(1).max(GOOGLE_ADS_LIMITS.asset.calloutTextMax).optional(),
|
|
6191
6221
|
header: structuredSnippetHeaderSchema.optional(),
|
|
6192
|
-
values:
|
|
6193
|
-
callToAction:
|
|
6194
|
-
text:
|
|
6222
|
+
values: z16.array(z16.string().min(1)).min(GOOGLE_ADS_LIMITS.asset.structuredSnippetValuesMin).max(GOOGLE_ADS_LIMITS.asset.structuredSnippetValuesMax).optional(),
|
|
6223
|
+
callToAction: z16.string().min(1).optional(),
|
|
6224
|
+
text: z16.string().min(1).optional()
|
|
6195
6225
|
}).refine((p) => Object.values(p).some((v) => v !== void 0), "update needs at least one field");
|
|
6196
|
-
var assetLinkAttachSchema =
|
|
6197
|
-
level:
|
|
6226
|
+
var assetLinkAttachSchema = z16.object({
|
|
6227
|
+
level: z16.enum(["campaign", "adGroup", "customer"]),
|
|
6198
6228
|
parent: refSchema.optional(),
|
|
6199
6229
|
asset: refSchema,
|
|
6200
|
-
fieldType:
|
|
6230
|
+
fieldType: z16.enum(ASSET_FIELD_TYPES)
|
|
6201
6231
|
}).superRefine((value, ctx) => {
|
|
6202
6232
|
if (value.level !== "customer" && !value.parent) {
|
|
6203
6233
|
ctx.addIssue({
|
|
6204
|
-
code:
|
|
6234
|
+
code: z16.ZodIssueCode.custom,
|
|
6205
6235
|
path: ["parent"],
|
|
6206
6236
|
message: `parent is required for a ${value.level}-level asset link (--parent-ref)`
|
|
6207
6237
|
});
|
|
6208
6238
|
}
|
|
6209
6239
|
});
|
|
6210
|
-
var assetGroupCreateSchema =
|
|
6240
|
+
var assetGroupCreateSchema = z16.object({
|
|
6211
6241
|
campaign: refSchema,
|
|
6212
|
-
name:
|
|
6213
|
-
finalUrls:
|
|
6214
|
-
headlines:
|
|
6215
|
-
longHeadlines:
|
|
6216
|
-
descriptions:
|
|
6217
|
-
businessName:
|
|
6218
|
-
imageAssets:
|
|
6219
|
-
squareImageAssets:
|
|
6220
|
-
portraitImageAssets:
|
|
6221
|
-
logoAssets:
|
|
6222
|
-
status:
|
|
6223
|
-
});
|
|
6224
|
-
var assetGroupAssetAttachSchema =
|
|
6242
|
+
name: z16.string().min(1).max(GOOGLE_ADS_LIMITS.assetGroup.nameMax),
|
|
6243
|
+
finalUrls: z16.array(httpsUrlSchema2).min(1),
|
|
6244
|
+
headlines: z16.array(z16.object({ text: z16.string().min(1).max(GOOGLE_ADS_LIMITS.assetGroup.headlineTextMax) })).min(GOOGLE_ADS_LIMITS.assetGroup.headlinesMin).max(GOOGLE_ADS_LIMITS.assetGroup.headlinesMax),
|
|
6245
|
+
longHeadlines: z16.array(z16.object({ text: z16.string().min(1).max(GOOGLE_ADS_LIMITS.assetGroup.longHeadlineTextMax) })).min(GOOGLE_ADS_LIMITS.assetGroup.longHeadlinesMin).max(GOOGLE_ADS_LIMITS.assetGroup.longHeadlinesMax),
|
|
6246
|
+
descriptions: z16.array(z16.object({ text: z16.string().min(1).max(GOOGLE_ADS_LIMITS.assetGroup.descriptionTextMax) })).min(GOOGLE_ADS_LIMITS.assetGroup.descriptionsMin).max(GOOGLE_ADS_LIMITS.assetGroup.descriptionsMax),
|
|
6247
|
+
businessName: z16.string().min(1).max(GOOGLE_ADS_LIMITS.assetGroup.businessNameMax),
|
|
6248
|
+
imageAssets: z16.array(refSchema).optional(),
|
|
6249
|
+
squareImageAssets: z16.array(refSchema).optional(),
|
|
6250
|
+
portraitImageAssets: z16.array(refSchema).optional(),
|
|
6251
|
+
logoAssets: z16.array(refSchema).optional(),
|
|
6252
|
+
status: z16.enum(["ENABLED", "PAUSED"]).default("PAUSED")
|
|
6253
|
+
});
|
|
6254
|
+
var assetGroupAssetAttachSchema = z16.object({
|
|
6225
6255
|
assetGroup: refSchema,
|
|
6226
6256
|
asset: refSchema,
|
|
6227
|
-
fieldType:
|
|
6257
|
+
fieldType: z16.enum(ASSET_GROUP_ASSET_FIELD_TYPES)
|
|
6228
6258
|
});
|
|
6229
|
-
var assetGroupUpdateSchema =
|
|
6230
|
-
name:
|
|
6231
|
-
finalUrls:
|
|
6232
|
-
status:
|
|
6259
|
+
var assetGroupUpdateSchema = z16.object({
|
|
6260
|
+
name: z16.string().min(1).max(GOOGLE_ADS_LIMITS.assetGroup.nameMax).optional(),
|
|
6261
|
+
finalUrls: z16.array(httpsUrlSchema2).min(1).optional(),
|
|
6262
|
+
status: z16.enum(["ENABLED", "PAUSED", "REMOVED"]).optional()
|
|
6233
6263
|
}).refine((p) => Object.values(p).some((v) => v !== void 0), "update needs at least one field");
|
|
6234
|
-
var audienceCreateSchema2 =
|
|
6235
|
-
name:
|
|
6236
|
-
type:
|
|
6237
|
-
description:
|
|
6264
|
+
var audienceCreateSchema2 = z16.object({
|
|
6265
|
+
name: z16.string().min(1).max(GOOGLE_ADS_LIMITS.audience.nameMax),
|
|
6266
|
+
type: z16.enum(USER_LIST_TYPES).default("BASIC"),
|
|
6267
|
+
description: z16.string().optional(),
|
|
6238
6268
|
/** Customer-match members (crm-based) — file-first for large lists. */
|
|
6239
|
-
members:
|
|
6240
|
-
sourceFileRef:
|
|
6269
|
+
members: z16.array(z16.record(z16.string(), z16.string())).optional(),
|
|
6270
|
+
sourceFileRef: z16.string().optional()
|
|
6241
6271
|
});
|
|
6242
|
-
var audienceCriterionAttachSchema =
|
|
6243
|
-
level:
|
|
6272
|
+
var audienceCriterionAttachSchema = z16.object({
|
|
6273
|
+
level: z16.enum(["campaign", "adGroup"]),
|
|
6244
6274
|
parent: refSchema,
|
|
6245
6275
|
userList: refSchema,
|
|
6246
|
-
negative:
|
|
6276
|
+
negative: z16.boolean().default(false)
|
|
6247
6277
|
});
|
|
6248
|
-
var conversionActionCreateSchema =
|
|
6249
|
-
name:
|
|
6250
|
-
type:
|
|
6251
|
-
category:
|
|
6252
|
-
countingType:
|
|
6278
|
+
var conversionActionCreateSchema = z16.object({
|
|
6279
|
+
name: z16.string().min(1).max(GOOGLE_ADS_LIMITS.conversionAction.nameMax),
|
|
6280
|
+
type: z16.enum(CONVERSION_ACTION_TYPES).optional(),
|
|
6281
|
+
category: z16.enum(CONVERSION_ACTION_CATEGORIES).optional(),
|
|
6282
|
+
countingType: z16.enum(CONVERSION_COUNTING_TYPES).optional(),
|
|
6253
6283
|
defaultValueMicros: microsSchema.optional(),
|
|
6254
|
-
defaultCurrencyCode:
|
|
6255
|
-
clickThroughLookbackWindowDays:
|
|
6256
|
-
viewThroughLookbackWindowDays:
|
|
6257
|
-
status:
|
|
6284
|
+
defaultCurrencyCode: z16.string().length(3).optional(),
|
|
6285
|
+
clickThroughLookbackWindowDays: z16.number().int().positive().optional(),
|
|
6286
|
+
viewThroughLookbackWindowDays: z16.number().int().positive().optional(),
|
|
6287
|
+
status: z16.enum(["ENABLED", "PAUSED"]).optional(),
|
|
6258
6288
|
/**
|
|
6259
6289
|
* Primary = Google bids toward this conversion; secondary = it is only reported ("Primary action
|
|
6260
6290
|
* used for bidding optimization" / "Secondary action not used for bidding optimization" in the UI).
|
|
@@ -6264,17 +6294,17 @@ var conversionActionCreateSchema = z15.object({
|
|
|
6264
6294
|
* exists yet to flip on a create, so a fixed resolved value is safe here in a way it would never be
|
|
6265
6295
|
* on an update: joining bidding becomes an explicit `primaryForGoal: true`, never an accident.
|
|
6266
6296
|
*/
|
|
6267
|
-
primaryForGoal:
|
|
6297
|
+
primaryForGoal: z16.boolean().optional()
|
|
6268
6298
|
});
|
|
6269
6299
|
var HIDDEN_CONVERSION_STATUS_ERROR = 'Google rejects status HIDDEN on every conversion action write ("the field\'s value is on a deny-list"), so it is not part of this contract. To stop automated bidding optimizing toward a conversion while it keeps measuring, demote it instead: `baker ads google conversions update --target <id> --no-primary`. To stop it counting altogether, use `status: "REMOVED"`. Pick one of those and carry on with the rest of the job.';
|
|
6270
|
-
var conversionActionUpdateSchema =
|
|
6271
|
-
name:
|
|
6272
|
-
category:
|
|
6273
|
-
countingType:
|
|
6300
|
+
var conversionActionUpdateSchema = z16.object({
|
|
6301
|
+
name: z16.string().min(1).max(GOOGLE_ADS_LIMITS.conversionAction.nameMax).optional(),
|
|
6302
|
+
category: z16.enum(CONVERSION_ACTION_CATEGORIES).optional(),
|
|
6303
|
+
countingType: z16.enum(CONVERSION_COUNTING_TYPES).optional(),
|
|
6274
6304
|
defaultValueMicros: microsSchema.optional(),
|
|
6275
|
-
defaultCurrencyCode:
|
|
6276
|
-
clickThroughLookbackWindowDays:
|
|
6277
|
-
viewThroughLookbackWindowDays:
|
|
6305
|
+
defaultCurrencyCode: z16.string().length(3).optional(),
|
|
6306
|
+
clickThroughLookbackWindowDays: z16.number().int().positive().optional(),
|
|
6307
|
+
viewThroughLookbackWindowDays: z16.number().int().positive().optional(),
|
|
6278
6308
|
/**
|
|
6279
6309
|
* `HIDDEN` is deliberately not writable. Google returns it — an action hidden long ago reads
|
|
6280
6310
|
* back as HIDDEN, and every read path keeps it — but it is on the API's deny-list for a write:
|
|
@@ -6283,70 +6313,70 @@ var conversionActionUpdateSchema = z15.object({
|
|
|
6283
6313
|
* obvious pick for an agent told to retire an action gently, and the whole cleanup published
|
|
6284
6314
|
* nothing.
|
|
6285
6315
|
*/
|
|
6286
|
-
status:
|
|
6316
|
+
status: z16.enum(["ENABLED", "REMOVED"], {
|
|
6287
6317
|
error: (issue) => issue.input === "HIDDEN" ? HIDDEN_CONVERSION_STATUS_ERROR : void 0
|
|
6288
6318
|
}).optional(),
|
|
6289
6319
|
/** Promote to primary (bid toward it) or demote to secondary (report only). No default — an
|
|
6290
6320
|
* update must never change an existing action's bidding role unless it was asked to. */
|
|
6291
|
-
primaryForGoal:
|
|
6321
|
+
primaryForGoal: z16.boolean().optional()
|
|
6292
6322
|
}).refine((p) => Object.values(p).some((v) => v !== void 0), "update needs at least one field");
|
|
6293
|
-
var conversionGoalSetSchema =
|
|
6294
|
-
category:
|
|
6295
|
-
origin:
|
|
6323
|
+
var conversionGoalSetSchema = z16.object({
|
|
6324
|
+
category: z16.enum(CONVERSION_ACTION_CATEGORIES),
|
|
6325
|
+
origin: z16.enum(CONVERSION_ORIGINS),
|
|
6296
6326
|
/** True = conversions of this category/origin count toward automated bidding; false = reported only. */
|
|
6297
|
-
biddable:
|
|
6327
|
+
biddable: z16.boolean()
|
|
6298
6328
|
});
|
|
6299
|
-
var biddingStrategyCreateSchema =
|
|
6300
|
-
name:
|
|
6329
|
+
var biddingStrategyCreateSchema = z16.object({
|
|
6330
|
+
name: z16.string().min(1).max(GOOGLE_ADS_LIMITS.biddingStrategy.nameMax),
|
|
6301
6331
|
config: biddingConfigSchema
|
|
6302
6332
|
}).superRefine((p, ctx) => {
|
|
6303
6333
|
if (p.config.type === "MANUAL_CPC") {
|
|
6304
6334
|
ctx.addIssue({ code: "custom", path: ["config", "type"], message: "portfolio strategies cannot be Manual CPC" });
|
|
6305
6335
|
}
|
|
6306
6336
|
});
|
|
6307
|
-
var biddingStrategyUpdateSchema =
|
|
6308
|
-
name:
|
|
6337
|
+
var biddingStrategyUpdateSchema = z16.object({
|
|
6338
|
+
name: z16.string().min(1).max(GOOGLE_ADS_LIMITS.biddingStrategy.nameMax).optional(),
|
|
6309
6339
|
config: biddingConfigSchema.optional()
|
|
6310
6340
|
}).refine((p) => Object.values(p).some((v) => v !== void 0), "update needs at least one field");
|
|
6311
|
-
var labelCreateSchema =
|
|
6312
|
-
name:
|
|
6313
|
-
backgroundColor:
|
|
6314
|
-
description:
|
|
6341
|
+
var labelCreateSchema = z16.object({
|
|
6342
|
+
name: z16.string().min(1).max(GOOGLE_ADS_LIMITS.label.nameMax),
|
|
6343
|
+
backgroundColor: z16.string().regex(/^#[0-9A-Fa-f]{6}$/).optional(),
|
|
6344
|
+
description: z16.string().optional()
|
|
6315
6345
|
});
|
|
6316
|
-
var labelAttachSchema =
|
|
6317
|
-
level:
|
|
6346
|
+
var labelAttachSchema = z16.object({
|
|
6347
|
+
level: z16.enum(["campaign", "adGroup", "ad"]),
|
|
6318
6348
|
parent: refSchema,
|
|
6319
6349
|
label: refSchema
|
|
6320
6350
|
});
|
|
6321
|
-
var locationCriterionSchema =
|
|
6322
|
-
criterionType:
|
|
6323
|
-
geoTargetConstant:
|
|
6324
|
-
});
|
|
6325
|
-
var languageCriterionSchema =
|
|
6326
|
-
criterionType:
|
|
6327
|
-
languageConstant:
|
|
6328
|
-
});
|
|
6329
|
-
var adScheduleCriterionSchema =
|
|
6330
|
-
criterionType:
|
|
6331
|
-
dayOfWeek:
|
|
6332
|
-
startHour:
|
|
6333
|
-
startMinute:
|
|
6334
|
-
endHour:
|
|
6335
|
-
endMinute:
|
|
6336
|
-
});
|
|
6337
|
-
var deviceCriterionSchema =
|
|
6338
|
-
criterionType:
|
|
6339
|
-
device:
|
|
6351
|
+
var locationCriterionSchema = z16.object({
|
|
6352
|
+
criterionType: z16.literal("location"),
|
|
6353
|
+
geoTargetConstant: z16.union([z16.string().regex(GEO_TARGET_CONSTANT_REGEX), z16.string().regex(NUMERIC_ID_REGEX2)])
|
|
6354
|
+
});
|
|
6355
|
+
var languageCriterionSchema = z16.object({
|
|
6356
|
+
criterionType: z16.literal("language"),
|
|
6357
|
+
languageConstant: z16.union([z16.string().regex(LANGUAGE_CONSTANT_REGEX), z16.string().regex(NUMERIC_ID_REGEX2)])
|
|
6358
|
+
});
|
|
6359
|
+
var adScheduleCriterionSchema = z16.object({
|
|
6360
|
+
criterionType: z16.literal("adSchedule"),
|
|
6361
|
+
dayOfWeek: z16.enum(DAYS_OF_WEEK),
|
|
6362
|
+
startHour: z16.number().int().min(0).max(23),
|
|
6363
|
+
startMinute: z16.enum(["ZERO", "FIFTEEN", "THIRTY", "FORTY_FIVE"]).default("ZERO"),
|
|
6364
|
+
endHour: z16.number().int().min(0).max(24),
|
|
6365
|
+
endMinute: z16.enum(["ZERO", "FIFTEEN", "THIRTY", "FORTY_FIVE"]).default("ZERO")
|
|
6366
|
+
});
|
|
6367
|
+
var deviceCriterionSchema = z16.object({
|
|
6368
|
+
criterionType: z16.literal("device"),
|
|
6369
|
+
device: z16.enum(DEVICE_TYPES),
|
|
6340
6370
|
// Google's `CampaignCriterion.bid_modifier`: "The modifier must be in the range 0.1 - 10.0. Use 0
|
|
6341
6371
|
// to opt out of a Device type." So 0 (exclude the device) and 0.1–10.0 are valid; the (0, 0.1) gap is not.
|
|
6342
|
-
bidModifier:
|
|
6372
|
+
bidModifier: z16.number().min(0).max(10).optional().refine((v) => v === void 0 || v === 0 || v >= 0.1, {
|
|
6343
6373
|
message: "bid modifier must be 0 (exclude the device) or between 0.1 and 10.0"
|
|
6344
6374
|
})
|
|
6345
6375
|
});
|
|
6346
|
-
var campaignCriterionAddSchema =
|
|
6376
|
+
var campaignCriterionAddSchema = z16.object({
|
|
6347
6377
|
campaign: refSchema,
|
|
6348
|
-
negative:
|
|
6349
|
-
criterion:
|
|
6378
|
+
negative: z16.boolean().default(false),
|
|
6379
|
+
criterion: z16.discriminatedUnion("criterionType", [
|
|
6350
6380
|
locationCriterionSchema,
|
|
6351
6381
|
languageCriterionSchema,
|
|
6352
6382
|
adScheduleCriterionSchema,
|
|
@@ -6356,7 +6386,7 @@ var campaignCriterionAddSchema = z15.object({
|
|
|
6356
6386
|
const c = val.criterion;
|
|
6357
6387
|
if (c.criterionType === "adSchedule" && c.endHour === 24 && c.endMinute !== "ZERO") {
|
|
6358
6388
|
ctx.addIssue({
|
|
6359
|
-
code:
|
|
6389
|
+
code: z16.ZodIssueCode.custom,
|
|
6360
6390
|
message: "endHour 24 (midnight) cannot have a non-zero endMinute",
|
|
6361
6391
|
path: ["criterion", "endMinute"]
|
|
6362
6392
|
});
|
|
@@ -6411,17 +6441,17 @@ var GOOGLE_DRAFT_OP_KINDS = [
|
|
|
6411
6441
|
"google.campaignCriterion.add",
|
|
6412
6442
|
"google.campaignCriterion.remove"
|
|
6413
6443
|
];
|
|
6414
|
-
var googleDraftOpKindSchema =
|
|
6444
|
+
var googleDraftOpKindSchema = z16.enum(GOOGLE_DRAFT_OP_KINDS);
|
|
6415
6445
|
function createOp2(kind, payload) {
|
|
6416
|
-
return
|
|
6446
|
+
return z16.object({ kind: z16.literal(kind), customerId: customerIdSchema, payload });
|
|
6417
6447
|
}
|
|
6418
6448
|
function updateOp2(kind, payload) {
|
|
6419
|
-
return
|
|
6449
|
+
return z16.object({ kind: z16.literal(kind), customerId: customerIdSchema, target: targetRefSchema, payload });
|
|
6420
6450
|
}
|
|
6421
6451
|
function targetOp(kind) {
|
|
6422
|
-
return
|
|
6452
|
+
return z16.object({ kind: z16.literal(kind), customerId: customerIdSchema, target: targetRefSchema });
|
|
6423
6453
|
}
|
|
6424
|
-
var googleDraftOpInputSchema =
|
|
6454
|
+
var googleDraftOpInputSchema = z16.discriminatedUnion("kind", [
|
|
6425
6455
|
createOp2("google.budget.create", budgetCreateSchema),
|
|
6426
6456
|
updateOp2("google.budget.update", budgetUpdateSchema),
|
|
6427
6457
|
createOp2("google.campaign.create", campaignCreateSchema2),
|
|
@@ -6472,48 +6502,48 @@ var googleDraftOpInputSchema = z15.discriminatedUnion("kind", [
|
|
|
6472
6502
|
]);
|
|
6473
6503
|
|
|
6474
6504
|
// ../api/src/ads-google/url-options.ts
|
|
6475
|
-
import { z as
|
|
6505
|
+
import { z as z17 } from "zod";
|
|
6476
6506
|
var URL_OPTION_LEVELS = ["account", "campaign", "ad_group", "ad"];
|
|
6477
|
-
var googleUrlOptionValueSchema =
|
|
6478
|
-
|
|
6479
|
-
|
|
6480
|
-
|
|
6507
|
+
var googleUrlOptionValueSchema = z17.discriminatedUnion("state", [
|
|
6508
|
+
z17.object({ state: z17.literal("set"), value: z17.string() }),
|
|
6509
|
+
z17.object({ state: z17.literal("not_set") }),
|
|
6510
|
+
z17.object({ state: z17.literal("not_read"), reason: z17.string() })
|
|
6481
6511
|
]);
|
|
6482
|
-
var googleUrlOptionsRequestSchema =
|
|
6483
|
-
customerId:
|
|
6484
|
-
managerId:
|
|
6512
|
+
var googleUrlOptionsRequestSchema = z17.object({
|
|
6513
|
+
customerId: z17.string().regex(NUMERIC_ID_REGEX2, "customerId must be the bare numeric customer id"),
|
|
6514
|
+
managerId: z17.string().optional(),
|
|
6485
6515
|
/** Compact by default: only campaigns that actually override the account. `full` lists every campaign. */
|
|
6486
|
-
full:
|
|
6487
|
-
skipCache:
|
|
6516
|
+
full: z17.boolean().optional(),
|
|
6517
|
+
skipCache: z17.boolean().optional()
|
|
6488
6518
|
});
|
|
6489
|
-
var googleUrlOptionsCampaignSchema =
|
|
6490
|
-
id:
|
|
6491
|
-
name:
|
|
6492
|
-
status:
|
|
6519
|
+
var googleUrlOptionsCampaignSchema = z17.object({
|
|
6520
|
+
id: z17.string(),
|
|
6521
|
+
name: z17.string(),
|
|
6522
|
+
status: z17.string(),
|
|
6493
6523
|
final_url_suffix: googleUrlOptionValueSchema,
|
|
6494
6524
|
tracking_url_template: googleUrlOptionValueSchema
|
|
6495
6525
|
});
|
|
6496
|
-
var googleUrlOptionsResponseSchema =
|
|
6497
|
-
customer_id:
|
|
6498
|
-
account:
|
|
6499
|
-
level:
|
|
6500
|
-
read:
|
|
6526
|
+
var googleUrlOptionsResponseSchema = z17.object({
|
|
6527
|
+
customer_id: z17.string(),
|
|
6528
|
+
account: z17.object({
|
|
6529
|
+
level: z17.literal("account"),
|
|
6530
|
+
read: z17.boolean(),
|
|
6501
6531
|
final_url_suffix: googleUrlOptionValueSchema,
|
|
6502
6532
|
tracking_url_template: googleUrlOptionValueSchema
|
|
6503
6533
|
}),
|
|
6504
|
-
campaigns:
|
|
6505
|
-
level:
|
|
6506
|
-
read:
|
|
6534
|
+
campaigns: z17.object({
|
|
6535
|
+
level: z17.literal("campaign"),
|
|
6536
|
+
read: z17.boolean(),
|
|
6507
6537
|
/** Campaigns actually observed. 0 with `read: true` means the account has no non-removed campaigns. */
|
|
6508
|
-
campaigns_read:
|
|
6538
|
+
campaigns_read: z17.number().int().nonnegative(),
|
|
6509
6539
|
/** Campaigns observed to carry no override of their own — an explicit finding, not an omission. */
|
|
6510
|
-
campaigns_without_override:
|
|
6511
|
-
overrides:
|
|
6540
|
+
campaigns_without_override: z17.number().int().nonnegative(),
|
|
6541
|
+
overrides: z17.array(googleUrlOptionsCampaignSchema),
|
|
6512
6542
|
/** Compact mode only: campaigns read but not listed because they carry no override. */
|
|
6513
|
-
omitted:
|
|
6543
|
+
omitted: z17.number().int().nonnegative()
|
|
6514
6544
|
}),
|
|
6515
6545
|
/** Levels this command never queried. Nothing here may be reported as "not configured". */
|
|
6516
|
-
levels_not_read:
|
|
6546
|
+
levels_not_read: z17.array(z17.object({ level: z17.enum(URL_OPTION_LEVELS), reason: z17.string() }))
|
|
6517
6547
|
});
|
|
6518
6548
|
var ACCOUNT_URL_OPTIONS_LOCATION = "Google Ads UI \u2192 Admin \u2192 Account settings \u2192 Tracking (account-level tracking template and final URL suffix)";
|
|
6519
6549
|
var ACCOUNT_URL_OPTIONS_NOT_STAGEABLE = "Account-level URL options are written by a different Google service than the one Baker's staged changes apply through, so they can't be staged or published from here.";
|
|
@@ -6558,149 +6588,149 @@ function urlOptionsHints(report) {
|
|
|
6558
6588
|
}
|
|
6559
6589
|
|
|
6560
6590
|
// ../api/src/ads-google/wire.ts
|
|
6561
|
-
import { z as
|
|
6562
|
-
var googleWriteModeSchema =
|
|
6563
|
-
var publishVerificationSchema =
|
|
6564
|
-
status:
|
|
6565
|
-
note:
|
|
6566
|
-
checkedAt:
|
|
6567
|
-
});
|
|
6568
|
-
var googleDraftOpResultSchema =
|
|
6569
|
-
status:
|
|
6570
|
-
resourceName:
|
|
6571
|
-
error:
|
|
6572
|
-
skippedBecause:
|
|
6573
|
-
executedAt:
|
|
6591
|
+
import { z as z18 } from "zod";
|
|
6592
|
+
var googleWriteModeSchema = z18.enum(["live", "simulated"]);
|
|
6593
|
+
var publishVerificationSchema = z18.object({
|
|
6594
|
+
status: z18.enum(["confirmed", "unconfirmed", "drifted"]),
|
|
6595
|
+
note: z18.string().optional(),
|
|
6596
|
+
checkedAt: z18.number()
|
|
6597
|
+
});
|
|
6598
|
+
var googleDraftOpResultSchema = z18.object({
|
|
6599
|
+
status: z18.enum(["applied", "simulated", "failed", "skipped"]),
|
|
6600
|
+
resourceName: z18.string().optional(),
|
|
6601
|
+
error: z18.string().optional(),
|
|
6602
|
+
skippedBecause: z18.string().optional(),
|
|
6603
|
+
executedAt: z18.number().optional(),
|
|
6574
6604
|
verification: publishVerificationSchema.optional()
|
|
6575
6605
|
});
|
|
6576
|
-
var googleDraftStageRequestSchema =
|
|
6577
|
-
chatId:
|
|
6606
|
+
var googleDraftStageRequestSchema = z18.object({
|
|
6607
|
+
chatId: z18.string(),
|
|
6578
6608
|
op: googleDraftOpInputSchema
|
|
6579
6609
|
});
|
|
6580
|
-
var googleDraftStageResponseSchema =
|
|
6581
|
-
|
|
6582
|
-
staged:
|
|
6583
|
-
ref:
|
|
6610
|
+
var googleDraftStageResponseSchema = z18.discriminatedUnion("staged", [
|
|
6611
|
+
z18.object({
|
|
6612
|
+
staged: z18.literal(true),
|
|
6613
|
+
ref: z18.string(),
|
|
6584
6614
|
kind: googleDraftOpKindSchema,
|
|
6585
6615
|
mode: googleWriteModeSchema,
|
|
6586
|
-
dependsOn:
|
|
6587
|
-
summary:
|
|
6588
|
-
warnings:
|
|
6616
|
+
dependsOn: z18.array(z18.string()),
|
|
6617
|
+
summary: z18.string(),
|
|
6618
|
+
warnings: z18.array(z18.string()),
|
|
6589
6619
|
/** True when the op amended an already-staged op in place instead of appending a new one. */
|
|
6590
|
-
amended:
|
|
6620
|
+
amended: z18.boolean().optional()
|
|
6591
6621
|
}),
|
|
6592
|
-
|
|
6593
|
-
staged:
|
|
6594
|
-
noop:
|
|
6622
|
+
z18.object({
|
|
6623
|
+
staged: z18.literal(false),
|
|
6624
|
+
noop: z18.literal(true),
|
|
6595
6625
|
kind: googleDraftOpKindSchema,
|
|
6596
6626
|
mode: googleWriteModeSchema,
|
|
6597
|
-
summary:
|
|
6598
|
-
reason:
|
|
6627
|
+
summary: z18.string(),
|
|
6628
|
+
reason: z18.string()
|
|
6599
6629
|
})
|
|
6600
6630
|
]);
|
|
6601
|
-
var googleDraftAmendRequestSchema =
|
|
6602
|
-
chatId:
|
|
6603
|
-
ref:
|
|
6604
|
-
patch:
|
|
6631
|
+
var googleDraftAmendRequestSchema = z18.object({
|
|
6632
|
+
chatId: z18.string(),
|
|
6633
|
+
ref: z18.string(),
|
|
6634
|
+
patch: z18.record(z18.string(), z18.unknown())
|
|
6605
6635
|
});
|
|
6606
|
-
var googleDraftShowRequestSchema =
|
|
6607
|
-
chatId:
|
|
6608
|
-
ref:
|
|
6636
|
+
var googleDraftShowRequestSchema = z18.object({
|
|
6637
|
+
chatId: z18.string(),
|
|
6638
|
+
ref: z18.string()
|
|
6609
6639
|
});
|
|
6610
6640
|
var GOOGLE_DRAFT_BATCH_MAX = 500;
|
|
6611
|
-
var googleDraftStageBatchRequestSchema =
|
|
6612
|
-
chatId:
|
|
6613
|
-
ops:
|
|
6641
|
+
var googleDraftStageBatchRequestSchema = z18.object({
|
|
6642
|
+
chatId: z18.string(),
|
|
6643
|
+
ops: z18.array(googleDraftOpInputSchema).min(1).max(GOOGLE_DRAFT_BATCH_MAX)
|
|
6614
6644
|
});
|
|
6615
|
-
var googleDraftStageBatchResponseSchema =
|
|
6616
|
-
staged:
|
|
6645
|
+
var googleDraftStageBatchResponseSchema = z18.object({
|
|
6646
|
+
staged: z18.literal(true),
|
|
6617
6647
|
mode: googleWriteModeSchema,
|
|
6618
|
-
count:
|
|
6619
|
-
ops:
|
|
6620
|
-
|
|
6621
|
-
ref:
|
|
6648
|
+
count: z18.number(),
|
|
6649
|
+
ops: z18.array(
|
|
6650
|
+
z18.object({
|
|
6651
|
+
ref: z18.string(),
|
|
6622
6652
|
kind: googleDraftOpKindSchema,
|
|
6623
|
-
dependsOn:
|
|
6624
|
-
summary:
|
|
6625
|
-
warnings:
|
|
6653
|
+
dependsOn: z18.array(z18.string()),
|
|
6654
|
+
summary: z18.string(),
|
|
6655
|
+
warnings: z18.array(z18.string())
|
|
6626
6656
|
})
|
|
6627
6657
|
),
|
|
6628
|
-
skipped:
|
|
6658
|
+
skipped: z18.array(z18.object({ kind: googleDraftOpKindSchema, summary: z18.string(), reason: z18.string() })).optional()
|
|
6629
6659
|
});
|
|
6630
|
-
var googleDraftOpViewSchema =
|
|
6631
|
-
ref:
|
|
6660
|
+
var googleDraftOpViewSchema = z18.object({
|
|
6661
|
+
ref: z18.string(),
|
|
6632
6662
|
kind: googleDraftOpKindSchema,
|
|
6633
|
-
customerId:
|
|
6634
|
-
target:
|
|
6635
|
-
dependsOn:
|
|
6636
|
-
summary:
|
|
6637
|
-
stagedAt:
|
|
6663
|
+
customerId: z18.string(),
|
|
6664
|
+
target: z18.string().optional(),
|
|
6665
|
+
dependsOn: z18.array(z18.string()),
|
|
6666
|
+
summary: z18.string(),
|
|
6667
|
+
stagedAt: z18.number(),
|
|
6638
6668
|
result: googleDraftOpResultSchema.optional()
|
|
6639
6669
|
});
|
|
6640
|
-
var googleDraftShowResponseSchema =
|
|
6670
|
+
var googleDraftShowResponseSchema = z18.object({
|
|
6641
6671
|
op: googleDraftOpViewSchema.extend({
|
|
6642
|
-
payload:
|
|
6643
|
-
warnings:
|
|
6644
|
-
annotations:
|
|
6672
|
+
payload: z18.unknown().optional(),
|
|
6673
|
+
warnings: z18.array(z18.string()).optional(),
|
|
6674
|
+
annotations: z18.unknown().optional()
|
|
6645
6675
|
})
|
|
6646
6676
|
});
|
|
6647
|
-
var googleDraftListRequestSchema =
|
|
6648
|
-
chatId:
|
|
6677
|
+
var googleDraftListRequestSchema = z18.object({
|
|
6678
|
+
chatId: z18.string()
|
|
6649
6679
|
});
|
|
6650
|
-
var googleDraftAdvisorySchema =
|
|
6651
|
-
scope:
|
|
6652
|
-
message:
|
|
6680
|
+
var googleDraftAdvisorySchema = z18.object({
|
|
6681
|
+
scope: z18.enum(["campaign", "adGroup"]),
|
|
6682
|
+
message: z18.string()
|
|
6653
6683
|
});
|
|
6654
|
-
var googleDraftStatusCollectionSchema =
|
|
6655
|
-
label:
|
|
6656
|
-
added:
|
|
6657
|
-
removed:
|
|
6658
|
-
existing:
|
|
6684
|
+
var googleDraftStatusCollectionSchema = z18.object({
|
|
6685
|
+
label: z18.string(),
|
|
6686
|
+
added: z18.number(),
|
|
6687
|
+
removed: z18.number(),
|
|
6688
|
+
existing: z18.number()
|
|
6659
6689
|
});
|
|
6660
|
-
var googleDraftChangeOperationSchema =
|
|
6661
|
-
var googleDraftStatusNodeSchema =
|
|
6662
|
-
() =>
|
|
6663
|
-
entity:
|
|
6664
|
-
name:
|
|
6690
|
+
var googleDraftChangeOperationSchema = z18.enum(["create", "update", "pause", "resume", "remove"]);
|
|
6691
|
+
var googleDraftStatusNodeSchema = z18.lazy(
|
|
6692
|
+
() => z18.object({
|
|
6693
|
+
entity: z18.string(),
|
|
6694
|
+
name: z18.string(),
|
|
6665
6695
|
operation: googleDraftChangeOperationSchema.optional(),
|
|
6666
|
-
existing:
|
|
6667
|
-
collections:
|
|
6668
|
-
children:
|
|
6669
|
-
warnings:
|
|
6696
|
+
existing: z18.boolean(),
|
|
6697
|
+
collections: z18.array(googleDraftStatusCollectionSchema),
|
|
6698
|
+
children: z18.array(googleDraftStatusNodeSchema),
|
|
6699
|
+
warnings: z18.array(z18.string()).optional()
|
|
6670
6700
|
})
|
|
6671
6701
|
);
|
|
6672
|
-
var googleDraftListResponseSchema =
|
|
6673
|
-
status:
|
|
6702
|
+
var googleDraftListResponseSchema = z18.object({
|
|
6703
|
+
status: z18.enum(["active", "publishing", "applied", "discarded", "none"]),
|
|
6674
6704
|
mode: googleWriteModeSchema,
|
|
6675
|
-
count:
|
|
6676
|
-
ops:
|
|
6705
|
+
count: z18.number(),
|
|
6706
|
+
ops: z18.array(googleDraftOpViewSchema),
|
|
6677
6707
|
/** Grouped campaign ▸ ad group ▸ ad tree for the readable CLI status view. */
|
|
6678
|
-
tree:
|
|
6708
|
+
tree: z18.array(googleDraftStatusNodeSchema).optional(),
|
|
6679
6709
|
/** Non-blocking completeness advisories for the whole draft. */
|
|
6680
|
-
advisories:
|
|
6710
|
+
advisories: z18.array(googleDraftAdvisorySchema).optional()
|
|
6681
6711
|
});
|
|
6682
|
-
var googleDraftRemoveRequestSchema =
|
|
6683
|
-
chatId:
|
|
6684
|
-
ref:
|
|
6712
|
+
var googleDraftRemoveRequestSchema = z18.object({
|
|
6713
|
+
chatId: z18.string(),
|
|
6714
|
+
ref: z18.string()
|
|
6685
6715
|
});
|
|
6686
|
-
var googleDraftRemoveResponseSchema =
|
|
6716
|
+
var googleDraftRemoveResponseSchema = z18.object({
|
|
6687
6717
|
/** The requested ref plus any dependents removed by cascade. */
|
|
6688
|
-
removed:
|
|
6718
|
+
removed: z18.array(z18.string())
|
|
6689
6719
|
});
|
|
6690
|
-
var googleDraftClearRequestSchema =
|
|
6691
|
-
chatId:
|
|
6720
|
+
var googleDraftClearRequestSchema = z18.object({
|
|
6721
|
+
chatId: z18.string()
|
|
6692
6722
|
});
|
|
6693
|
-
var googleDraftClearResponseSchema =
|
|
6694
|
-
cleared:
|
|
6723
|
+
var googleDraftClearResponseSchema = z18.object({
|
|
6724
|
+
cleared: z18.number()
|
|
6695
6725
|
});
|
|
6696
|
-
var googleFieldErrorSchema =
|
|
6697
|
-
path:
|
|
6698
|
-
message:
|
|
6726
|
+
var googleFieldErrorSchema = z18.object({
|
|
6727
|
+
path: z18.string(),
|
|
6728
|
+
message: z18.string()
|
|
6699
6729
|
});
|
|
6700
|
-
var googleDraftErrorResponseSchema =
|
|
6701
|
-
code:
|
|
6702
|
-
error:
|
|
6703
|
-
fields:
|
|
6730
|
+
var googleDraftErrorResponseSchema = z18.object({
|
|
6731
|
+
code: z18.string(),
|
|
6732
|
+
error: z18.string(),
|
|
6733
|
+
fields: z18.array(googleFieldErrorSchema).optional()
|
|
6704
6734
|
});
|
|
6705
6735
|
|
|
6706
6736
|
// src/commands/ads/google/changes-window.ts
|
|
@@ -8122,11 +8152,11 @@ function rawTextEntries(value) {
|
|
|
8122
8152
|
const values = Array.isArray(value) ? value : typeof value === "string" ? [value] : [];
|
|
8123
8153
|
return values.filter((v) => typeof v === "string").flatMap((v) => v.split(",")).map((v) => v.trim()).filter(Boolean);
|
|
8124
8154
|
}
|
|
8125
|
-
function rawFileEntries(
|
|
8126
|
-
if (typeof
|
|
8155
|
+
function rawFileEntries(path29) {
|
|
8156
|
+
if (typeof path29 !== "string" || path29.length === 0) {
|
|
8127
8157
|
return [];
|
|
8128
8158
|
}
|
|
8129
|
-
return readFileSync2(
|
|
8159
|
+
return readFileSync2(path29, "utf8").split(/\r?\n/).map((line) => line.trim()).filter((line) => line.length > 0 && !line.startsWith("#"));
|
|
8130
8160
|
}
|
|
8131
8161
|
function keywordEntries(args) {
|
|
8132
8162
|
const defaultMatch = typeof args["match-type"] === "string" ? args["match-type"].toUpperCase() : void 0;
|
|
@@ -8149,19 +8179,19 @@ function keywordEntries(args) {
|
|
|
8149
8179
|
}
|
|
8150
8180
|
return entries;
|
|
8151
8181
|
}
|
|
8152
|
-
function loadJsonFileArg(
|
|
8153
|
-
if (typeof
|
|
8182
|
+
function loadJsonFileArg(path29) {
|
|
8183
|
+
if (typeof path29 !== "string" || path29.length === 0) {
|
|
8154
8184
|
return {};
|
|
8155
8185
|
}
|
|
8156
8186
|
try {
|
|
8157
|
-
const parsed = JSON.parse(readFileSync2(
|
|
8187
|
+
const parsed = JSON.parse(readFileSync2(path29, "utf8"));
|
|
8158
8188
|
if (parsed === null || typeof parsed !== "object" || Array.isArray(parsed)) {
|
|
8159
|
-
failWriteValidation(`${
|
|
8189
|
+
failWriteValidation(`${path29} must contain a JSON object`);
|
|
8160
8190
|
}
|
|
8161
8191
|
return parsed;
|
|
8162
8192
|
} catch (err) {
|
|
8163
8193
|
if (err instanceof SyntaxError) {
|
|
8164
|
-
failWriteValidation(`${
|
|
8194
|
+
failWriteValidation(`${path29} is not valid JSON: ${err.message}`);
|
|
8165
8195
|
}
|
|
8166
8196
|
throw err;
|
|
8167
8197
|
}
|
|
@@ -8291,10 +8321,10 @@ async function stageUpdate(kind, customerId, target, payload, hints) {
|
|
|
8291
8321
|
async function stageTarget(kind, customerId, target, hints) {
|
|
8292
8322
|
await stageGoogleOp({ kind, customerId, target }, hints);
|
|
8293
8323
|
}
|
|
8294
|
-
async function draftAction(
|
|
8324
|
+
async function draftAction(path29, body, chat) {
|
|
8295
8325
|
try {
|
|
8296
8326
|
const chatId = resolveChatId(chat);
|
|
8297
|
-
const response = await apiPost(
|
|
8327
|
+
const response = await apiPost(path29, { chatId, ...body });
|
|
8298
8328
|
writeJsonEnvelope(response);
|
|
8299
8329
|
} catch (err) {
|
|
8300
8330
|
handleGoogleError(err);
|
|
@@ -10905,19 +10935,19 @@ function failWriteValidation2(message) {
|
|
|
10905
10935
|
writeJsonEnvelope({ ok: false, error: { code: "VALIDATION_ERROR", message } });
|
|
10906
10936
|
process.exit(1);
|
|
10907
10937
|
}
|
|
10908
|
-
function loadJsonFileArg2(
|
|
10909
|
-
if (typeof
|
|
10938
|
+
function loadJsonFileArg2(path29) {
|
|
10939
|
+
if (typeof path29 !== "string" || path29.length === 0) {
|
|
10910
10940
|
return {};
|
|
10911
10941
|
}
|
|
10912
10942
|
try {
|
|
10913
|
-
const parsed = JSON.parse(readFileSync4(
|
|
10943
|
+
const parsed = JSON.parse(readFileSync4(path29, "utf8"));
|
|
10914
10944
|
if (parsed === null || typeof parsed !== "object" || Array.isArray(parsed)) {
|
|
10915
|
-
failWriteValidation2(`${
|
|
10945
|
+
failWriteValidation2(`${path29} must contain a JSON object`);
|
|
10916
10946
|
}
|
|
10917
10947
|
return parsed;
|
|
10918
10948
|
} catch (err) {
|
|
10919
10949
|
if (err instanceof SyntaxError) {
|
|
10920
|
-
failWriteValidation2(`${
|
|
10950
|
+
failWriteValidation2(`${path29} is not valid JSON: ${err.message}`);
|
|
10921
10951
|
}
|
|
10922
10952
|
throw err;
|
|
10923
10953
|
}
|
|
@@ -11002,15 +11032,15 @@ function parseLocaleFlag(value) {
|
|
|
11002
11032
|
}
|
|
11003
11033
|
return { language: match[1], country: match[2].toUpperCase() };
|
|
11004
11034
|
}
|
|
11005
|
-
function loadTargetingFileArg(
|
|
11006
|
-
if (typeof
|
|
11035
|
+
function loadTargetingFileArg(path29) {
|
|
11036
|
+
if (typeof path29 !== "string" || path29.length === 0) {
|
|
11007
11037
|
return void 0;
|
|
11008
11038
|
}
|
|
11009
|
-
const parsed = loadJsonFileArg2(
|
|
11039
|
+
const parsed = loadJsonFileArg2(path29);
|
|
11010
11040
|
const criteria = parsed.targetingCriteria ?? parsed;
|
|
11011
11041
|
if (!criteria.include) {
|
|
11012
11042
|
failWriteValidation2(
|
|
11013
|
-
`${
|
|
11043
|
+
`${path29} must contain targeting criteria with an "include" block (see baker schema ads.linkedin.campaigns.create)`
|
|
11014
11044
|
);
|
|
11015
11045
|
}
|
|
11016
11046
|
return criteria;
|
|
@@ -11045,14 +11075,14 @@ function parseCsvLine(line) {
|
|
|
11045
11075
|
cells.push(current);
|
|
11046
11076
|
return cells.map((cell) => cell.trim());
|
|
11047
11077
|
}
|
|
11048
|
-
function parseListFileArg(
|
|
11049
|
-
if (typeof
|
|
11078
|
+
function parseListFileArg(path29, maxRows) {
|
|
11079
|
+
if (typeof path29 !== "string" || path29.length === 0) {
|
|
11050
11080
|
return void 0;
|
|
11051
11081
|
}
|
|
11052
|
-
const raw = readFileSync4(
|
|
11082
|
+
const raw = readFileSync4(path29, "utf8");
|
|
11053
11083
|
const lines = raw.split(/\r?\n/).filter((line) => line.trim().length > 0);
|
|
11054
11084
|
if (lines.length < 2) {
|
|
11055
|
-
failWriteValidation2(`${
|
|
11085
|
+
failWriteValidation2(`${path29} needs a header row and at least one data row`);
|
|
11056
11086
|
}
|
|
11057
11087
|
const columns = parseCsvLine(lines[0]).map((column) => column.trim());
|
|
11058
11088
|
const rows = [];
|
|
@@ -11071,7 +11101,7 @@ function parseListFileArg(path28, maxRows) {
|
|
|
11071
11101
|
}
|
|
11072
11102
|
}
|
|
11073
11103
|
if (rows.length > maxRows) {
|
|
11074
|
-
failWriteValidation2(`${
|
|
11104
|
+
failWriteValidation2(`${path29} has ${rows.length} rows \u2014 the inline limit is ${maxRows}. Split the list.`);
|
|
11075
11105
|
}
|
|
11076
11106
|
return { columns, rows };
|
|
11077
11107
|
}
|
|
@@ -11167,11 +11197,11 @@ function readPositionals(args) {
|
|
|
11167
11197
|
function splitIdList(raw) {
|
|
11168
11198
|
return raw.split(",").map((id) => id.trim()).filter(Boolean);
|
|
11169
11199
|
}
|
|
11170
|
-
function idsFileEntries(
|
|
11171
|
-
if (typeof
|
|
11200
|
+
function idsFileEntries(path29) {
|
|
11201
|
+
if (typeof path29 !== "string" || path29.length === 0) {
|
|
11172
11202
|
return [];
|
|
11173
11203
|
}
|
|
11174
|
-
return readFileSync4(
|
|
11204
|
+
return readFileSync4(path29, "utf8").split(/\r?\n/).map((line) => line.trim()).filter((line) => line.length > 0 && !line.startsWith("#")).flatMap(splitIdList);
|
|
11175
11205
|
}
|
|
11176
11206
|
function requireTargets(args, entity) {
|
|
11177
11207
|
const positionals = readPositionals(args);
|
|
@@ -13794,9 +13824,9 @@ function compactRow(row) {
|
|
|
13794
13824
|
...destination.postUrn ? { postUrn: destination.postUrn } : {}
|
|
13795
13825
|
};
|
|
13796
13826
|
}
|
|
13797
|
-
function readPath(row,
|
|
13827
|
+
function readPath(row, path29) {
|
|
13798
13828
|
let current = row;
|
|
13799
|
-
for (const segment of
|
|
13829
|
+
for (const segment of path29.split(".")) {
|
|
13800
13830
|
const record = asRecord2(current);
|
|
13801
13831
|
if (!record) return void 0;
|
|
13802
13832
|
current = record[segment];
|
|
@@ -13806,10 +13836,10 @@ function readPath(row, path28) {
|
|
|
13806
13836
|
function projectFields(rows, paths) {
|
|
13807
13837
|
return rows.map((row) => {
|
|
13808
13838
|
const projected = {};
|
|
13809
|
-
for (const
|
|
13810
|
-
const value = readPath(row,
|
|
13839
|
+
for (const path29 of paths) {
|
|
13840
|
+
const value = readPath(row, path29);
|
|
13811
13841
|
if (value !== void 0) {
|
|
13812
|
-
projected[
|
|
13842
|
+
projected[path29] = value;
|
|
13813
13843
|
}
|
|
13814
13844
|
}
|
|
13815
13845
|
return projected;
|
|
@@ -15002,57 +15032,57 @@ var NUMERIC_ID_REGEX3 = /^\d+$/;
|
|
|
15002
15032
|
var IMAGE_HASH_REGEX = /^[A-Fa-f0-9]{16,}$/;
|
|
15003
15033
|
|
|
15004
15034
|
// ../api/src/ads-meta/ops.ts
|
|
15005
|
-
import { z as
|
|
15006
|
-
var tempRefSchema3 =
|
|
15007
|
-
var parentRefSchema2 =
|
|
15008
|
-
var moneySchema2 =
|
|
15009
|
-
amount:
|
|
15010
|
-
currencyCode:
|
|
15011
|
-
});
|
|
15012
|
-
var httpsUrlSchema3 =
|
|
15013
|
-
var bakerMediaIdSchema2 =
|
|
15014
|
-
var stageableStatusSchema3 =
|
|
15015
|
-
var updateStatusSchema =
|
|
15035
|
+
import { z as z19 } from "zod";
|
|
15036
|
+
var tempRefSchema3 = z19.string().regex(TEMP_REF_REGEX3, "expected a meta_temp_* reference");
|
|
15037
|
+
var parentRefSchema2 = z19.union([z19.string().regex(NUMERIC_ID_REGEX3, "expected a numeric id"), tempRefSchema3]);
|
|
15038
|
+
var moneySchema2 = z19.object({
|
|
15039
|
+
amount: z19.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"),
|
|
15040
|
+
currencyCode: z19.string().length(3).optional()
|
|
15041
|
+
});
|
|
15042
|
+
var httpsUrlSchema3 = z19.string().url().refine((u) => u.startsWith("https://"), "destination URLs must be https");
|
|
15043
|
+
var bakerMediaIdSchema2 = z19.string().min(1);
|
|
15044
|
+
var stageableStatusSchema3 = z19.enum(STAGEABLE_CREATE_STATUSES3);
|
|
15045
|
+
var updateStatusSchema = z19.enum(UPDATE_STATUSES);
|
|
15016
15046
|
function currencyMinimums2(currencyCode) {
|
|
15017
15047
|
return CURRENCY_MINIMUMS2[currencyCode] ?? DEFAULT_CURRENCY_MINIMUM2;
|
|
15018
15048
|
}
|
|
15019
|
-
function validateDailyBudgetFloor(money, ctx,
|
|
15049
|
+
function validateDailyBudgetFloor(money, ctx, path29) {
|
|
15020
15050
|
if (money?.currencyCode) {
|
|
15021
15051
|
const min = currencyMinimums2(money.currencyCode).dailyBudgetMin;
|
|
15022
15052
|
if (Number(money.amount) < min) {
|
|
15023
|
-
ctx.addIssue({ code: "custom", path:
|
|
15053
|
+
ctx.addIssue({ code: "custom", path: path29, message: `below the ${min} ${money.currencyCode} daily minimum` });
|
|
15024
15054
|
}
|
|
15025
15055
|
}
|
|
15026
15056
|
}
|
|
15027
|
-
var geoLocationsSchema =
|
|
15028
|
-
countries:
|
|
15029
|
-
regions:
|
|
15030
|
-
cities:
|
|
15031
|
-
zips:
|
|
15032
|
-
location_types:
|
|
15033
|
-
}).catchall(
|
|
15034
|
-
var idNameSchema =
|
|
15035
|
-
var metaTargetingSchema =
|
|
15057
|
+
var geoLocationsSchema = z19.object({
|
|
15058
|
+
countries: z19.array(z19.string().length(2)).optional(),
|
|
15059
|
+
regions: z19.array(z19.object({ key: z19.string() })).optional(),
|
|
15060
|
+
cities: z19.array(z19.object({ key: z19.string(), radius: z19.number().optional(), distance_unit: z19.string().optional() })).optional(),
|
|
15061
|
+
zips: z19.array(z19.object({ key: z19.string() })).optional(),
|
|
15062
|
+
location_types: z19.array(z19.string()).optional()
|
|
15063
|
+
}).catchall(z19.unknown());
|
|
15064
|
+
var idNameSchema = z19.object({ id: z19.string(), name: z19.string().optional() });
|
|
15065
|
+
var metaTargetingSchema = z19.object({
|
|
15036
15066
|
geo_locations: geoLocationsSchema.optional(),
|
|
15037
15067
|
excluded_geo_locations: geoLocationsSchema.optional(),
|
|
15038
|
-
age_min:
|
|
15039
|
-
age_max:
|
|
15040
|
-
genders:
|
|
15041
|
-
locales:
|
|
15042
|
-
interests:
|
|
15043
|
-
behaviors:
|
|
15044
|
-
custom_audiences:
|
|
15045
|
-
excluded_custom_audiences:
|
|
15046
|
-
flexible_spec:
|
|
15047
|
-
exclusions:
|
|
15048
|
-
publisher_platforms:
|
|
15049
|
-
facebook_positions:
|
|
15050
|
-
instagram_positions:
|
|
15051
|
-
audience_network_positions:
|
|
15052
|
-
messenger_positions:
|
|
15053
|
-
device_platforms:
|
|
15054
|
-
targeting_automation:
|
|
15055
|
-
}).catchall(
|
|
15068
|
+
age_min: z19.number().int().min(13).max(65).optional(),
|
|
15069
|
+
age_max: z19.number().int().min(13).max(65).optional(),
|
|
15070
|
+
genders: z19.array(z19.union([z19.literal(1), z19.literal(2)])).optional(),
|
|
15071
|
+
locales: z19.array(z19.number().int()).optional(),
|
|
15072
|
+
interests: z19.array(idNameSchema).optional(),
|
|
15073
|
+
behaviors: z19.array(idNameSchema).optional(),
|
|
15074
|
+
custom_audiences: z19.array(z19.object({ id: parentRefSchema2 })).optional(),
|
|
15075
|
+
excluded_custom_audiences: z19.array(z19.object({ id: parentRefSchema2 })).optional(),
|
|
15076
|
+
flexible_spec: z19.array(z19.record(z19.string(), z19.unknown())).optional(),
|
|
15077
|
+
exclusions: z19.record(z19.string(), z19.unknown()).optional(),
|
|
15078
|
+
publisher_platforms: z19.array(z19.string()).optional(),
|
|
15079
|
+
facebook_positions: z19.array(z19.string()).optional(),
|
|
15080
|
+
instagram_positions: z19.array(z19.string()).optional(),
|
|
15081
|
+
audience_network_positions: z19.array(z19.string()).optional(),
|
|
15082
|
+
messenger_positions: z19.array(z19.string()).optional(),
|
|
15083
|
+
device_platforms: z19.array(z19.string()).optional(),
|
|
15084
|
+
targeting_automation: z19.object({ advantage_audience: z19.union([z19.literal(0), z19.literal(1)]) }).partial().optional()
|
|
15085
|
+
}).catchall(z19.unknown());
|
|
15056
15086
|
var GEO_INCLUSION_KEYS = [
|
|
15057
15087
|
"countries",
|
|
15058
15088
|
"country_groups",
|
|
@@ -15091,21 +15121,21 @@ function targetingHardLimitsDemographics(t) {
|
|
|
15091
15121
|
const narrowsGender = Array.isArray(t.genders) && t.genders.length === 1;
|
|
15092
15122
|
return narrowsAgeMax || narrowsAgeMin || narrowsGender;
|
|
15093
15123
|
}
|
|
15094
|
-
var specialAdCategoriesSchema =
|
|
15095
|
-
var campaignCreateSchema3 =
|
|
15096
|
-
name:
|
|
15097
|
-
objective:
|
|
15124
|
+
var specialAdCategoriesSchema = z19.array(z19.enum(SPECIAL_AD_CATEGORIES)).default(["NONE"]);
|
|
15125
|
+
var campaignCreateSchema3 = z19.object({
|
|
15126
|
+
name: z19.string().min(1).max(META_LIMITS.campaign.nameMax),
|
|
15127
|
+
objective: z19.enum(OBJECTIVES),
|
|
15098
15128
|
status: stageableStatusSchema3.default("PAUSED"),
|
|
15099
15129
|
special_ad_categories: specialAdCategoriesSchema,
|
|
15100
|
-
special_ad_category_country:
|
|
15101
|
-
buying_type:
|
|
15102
|
-
bid_strategy:
|
|
15130
|
+
special_ad_category_country: z19.array(z19.string().length(2)).optional(),
|
|
15131
|
+
buying_type: z19.enum(BUYING_TYPES).default("AUCTION"),
|
|
15132
|
+
bid_strategy: z19.enum(BID_STRATEGIES).optional(),
|
|
15103
15133
|
/** Campaign Budget Optimization (Advantage campaign budget) — mutually exclusive with ad-set budgets. */
|
|
15104
15134
|
dailyBudget: moneySchema2.optional(),
|
|
15105
15135
|
lifetimeBudget: moneySchema2.optional(),
|
|
15106
15136
|
spendCap: moneySchema2.optional(),
|
|
15107
|
-
start_time:
|
|
15108
|
-
stop_time:
|
|
15137
|
+
start_time: z19.number().int().positive().optional(),
|
|
15138
|
+
stop_time: z19.number().int().positive().optional()
|
|
15109
15139
|
}).superRefine((p, ctx) => {
|
|
15110
15140
|
if (p.dailyBudget && p.lifetimeBudget) {
|
|
15111
15141
|
ctx.addIssue({ code: "custom", path: ["dailyBudget"], message: "set only one of dailyBudget or lifetimeBudget" });
|
|
@@ -15123,15 +15153,15 @@ var campaignCreateSchema3 = z18.object({
|
|
|
15123
15153
|
});
|
|
15124
15154
|
}
|
|
15125
15155
|
});
|
|
15126
|
-
var campaignUpdateSchema3 =
|
|
15127
|
-
name:
|
|
15156
|
+
var campaignUpdateSchema3 = z19.object({
|
|
15157
|
+
name: z19.string().min(1).max(META_LIMITS.campaign.nameMax).optional(),
|
|
15128
15158
|
status: updateStatusSchema.optional(),
|
|
15129
|
-
bid_strategy:
|
|
15159
|
+
bid_strategy: z19.enum(BID_STRATEGIES).optional(),
|
|
15130
15160
|
dailyBudget: moneySchema2.optional(),
|
|
15131
15161
|
lifetimeBudget: moneySchema2.optional(),
|
|
15132
15162
|
spendCap: moneySchema2.optional(),
|
|
15133
|
-
start_time:
|
|
15134
|
-
stop_time:
|
|
15163
|
+
start_time: z19.number().int().positive().optional(),
|
|
15164
|
+
stop_time: z19.number().int().positive().optional()
|
|
15135
15165
|
}).superRefine((p, ctx) => {
|
|
15136
15166
|
if (!Object.values(p).some((val) => val !== void 0)) {
|
|
15137
15167
|
ctx.addIssue({ code: "custom", message: "update needs at least one field" });
|
|
@@ -15141,42 +15171,42 @@ var campaignUpdateSchema3 = z18.object({
|
|
|
15141
15171
|
}
|
|
15142
15172
|
validateDailyBudgetFloor(p.dailyBudget, ctx, ["dailyBudget", "amount"]);
|
|
15143
15173
|
});
|
|
15144
|
-
var promotedObjectSchema =
|
|
15174
|
+
var promotedObjectSchema = z19.object({
|
|
15145
15175
|
page_id: parentRefSchema2.optional(),
|
|
15146
|
-
pixel_id:
|
|
15147
|
-
custom_event_type:
|
|
15148
|
-
application_id:
|
|
15149
|
-
object_store_url:
|
|
15150
|
-
product_catalog_id:
|
|
15151
|
-
product_set_id:
|
|
15152
|
-
whatsapp_phone_number:
|
|
15153
|
-
offline_conversion_data_set_id:
|
|
15176
|
+
pixel_id: z19.string().regex(NUMERIC_ID_REGEX3).optional(),
|
|
15177
|
+
custom_event_type: z19.enum(CUSTOM_EVENT_TYPES).optional(),
|
|
15178
|
+
application_id: z19.string().regex(NUMERIC_ID_REGEX3).optional(),
|
|
15179
|
+
object_store_url: z19.string().url().optional(),
|
|
15180
|
+
product_catalog_id: z19.string().regex(NUMERIC_ID_REGEX3).optional(),
|
|
15181
|
+
product_set_id: z19.string().regex(NUMERIC_ID_REGEX3).optional(),
|
|
15182
|
+
whatsapp_phone_number: z19.string().optional(),
|
|
15183
|
+
offline_conversion_data_set_id: z19.string().regex(NUMERIC_ID_REGEX3).optional()
|
|
15154
15184
|
}).partial();
|
|
15155
|
-
var attributionSpecSchema =
|
|
15156
|
-
|
|
15157
|
-
event_type:
|
|
15158
|
-
window_days:
|
|
15185
|
+
var attributionSpecSchema = z19.array(
|
|
15186
|
+
z19.object({
|
|
15187
|
+
event_type: z19.enum(ATTRIBUTION_EVENT_TYPES),
|
|
15188
|
+
window_days: z19.union([z19.literal(1), z19.literal(7), z19.literal(28)])
|
|
15159
15189
|
})
|
|
15160
15190
|
);
|
|
15161
15191
|
var adSetFields = {
|
|
15162
|
-
name:
|
|
15192
|
+
name: z19.string().min(1).max(META_LIMITS.adSet.nameMax),
|
|
15163
15193
|
campaign_id: parentRefSchema2,
|
|
15164
15194
|
status: stageableStatusSchema3.default("PAUSED"),
|
|
15165
15195
|
dailyBudget: moneySchema2.optional(),
|
|
15166
15196
|
lifetimeBudget: moneySchema2.optional(),
|
|
15167
15197
|
bidAmount: moneySchema2.optional(),
|
|
15168
|
-
bid_strategy:
|
|
15169
|
-
billing_event:
|
|
15170
|
-
optimization_goal:
|
|
15171
|
-
destination_type:
|
|
15198
|
+
bid_strategy: z19.enum(BID_STRATEGIES).optional(),
|
|
15199
|
+
billing_event: z19.enum(BILLING_EVENTS),
|
|
15200
|
+
optimization_goal: z19.enum(OPTIMIZATION_GOALS),
|
|
15201
|
+
destination_type: z19.enum(DESTINATION_TYPES).optional(),
|
|
15172
15202
|
promoted_object: promotedObjectSchema.optional(),
|
|
15173
15203
|
attribution_spec: attributionSpecSchema.optional(),
|
|
15174
|
-
start_time:
|
|
15175
|
-
end_time:
|
|
15204
|
+
start_time: z19.number().int().positive().optional(),
|
|
15205
|
+
end_time: z19.number().int().positive().optional(),
|
|
15176
15206
|
targeting: metaTargetingSchema,
|
|
15177
15207
|
/** EU Digital Services Act: who benefits from / pays for the ad. Auto-filled from the account for EU geo when omitted. */
|
|
15178
|
-
dsa_beneficiary:
|
|
15179
|
-
dsa_payor:
|
|
15208
|
+
dsa_beneficiary: z19.string().min(1).max(100).optional(),
|
|
15209
|
+
dsa_payor: z19.string().min(1).max(100).optional()
|
|
15180
15210
|
};
|
|
15181
15211
|
function validateBidStrategy(p, ctx) {
|
|
15182
15212
|
const strategy = p.bid_strategy;
|
|
@@ -15273,7 +15303,7 @@ function validateAdvantageAudience(p, ctx) {
|
|
|
15273
15303
|
});
|
|
15274
15304
|
}
|
|
15275
15305
|
}
|
|
15276
|
-
var adSetCreateSchema =
|
|
15306
|
+
var adSetCreateSchema = z19.object(adSetFields).superRefine((p, ctx) => {
|
|
15277
15307
|
validateAdSetBudgetAndBid(p, ctx);
|
|
15278
15308
|
validateAdSetPromotedObject(p, ctx);
|
|
15279
15309
|
validateAdvantageAudience(p, ctx);
|
|
@@ -15285,22 +15315,22 @@ var adSetCreateSchema = z18.object(adSetFields).superRefine((p, ctx) => {
|
|
|
15285
15315
|
});
|
|
15286
15316
|
}
|
|
15287
15317
|
});
|
|
15288
|
-
var adSetUpdateSchema =
|
|
15318
|
+
var adSetUpdateSchema = z19.object({
|
|
15289
15319
|
name: adSetFields.name.optional(),
|
|
15290
15320
|
status: updateStatusSchema.optional(),
|
|
15291
15321
|
dailyBudget: moneySchema2.optional(),
|
|
15292
15322
|
lifetimeBudget: moneySchema2.optional(),
|
|
15293
15323
|
bidAmount: moneySchema2.optional(),
|
|
15294
|
-
bid_strategy:
|
|
15295
|
-
optimization_goal:
|
|
15296
|
-
destination_type:
|
|
15324
|
+
bid_strategy: z19.enum(BID_STRATEGIES).optional(),
|
|
15325
|
+
optimization_goal: z19.enum(OPTIMIZATION_GOALS).optional(),
|
|
15326
|
+
destination_type: z19.enum(DESTINATION_TYPES).optional(),
|
|
15297
15327
|
promoted_object: promotedObjectSchema.optional(),
|
|
15298
15328
|
attribution_spec: attributionSpecSchema.optional(),
|
|
15299
|
-
start_time:
|
|
15300
|
-
end_time:
|
|
15329
|
+
start_time: z19.number().int().positive().optional(),
|
|
15330
|
+
end_time: z19.number().int().positive().optional(),
|
|
15301
15331
|
targeting: metaTargetingSchema.optional(),
|
|
15302
|
-
dsa_beneficiary:
|
|
15303
|
-
dsa_payor:
|
|
15332
|
+
dsa_beneficiary: z19.string().min(1).max(100).optional(),
|
|
15333
|
+
dsa_payor: z19.string().min(1).max(100).optional()
|
|
15304
15334
|
}).superRefine((p, ctx) => {
|
|
15305
15335
|
if (!Object.values(p).some((val) => val !== void 0)) {
|
|
15306
15336
|
ctx.addIssue({ code: "custom", message: "update needs at least one field" });
|
|
@@ -15311,38 +15341,38 @@ var adSetUpdateSchema = z18.object({
|
|
|
15311
15341
|
}
|
|
15312
15342
|
validateAdvantageAudience(p, ctx);
|
|
15313
15343
|
});
|
|
15314
|
-
var messageSchema =
|
|
15315
|
-
var headlineSchema2 =
|
|
15316
|
-
var descriptionSchema =
|
|
15317
|
-
var callToActionSchema =
|
|
15318
|
-
type:
|
|
15344
|
+
var messageSchema = z19.string().min(1).max(META_LIMITS.creative.messageHardMax);
|
|
15345
|
+
var headlineSchema2 = z19.string().min(1).max(META_LIMITS.creative.headlineMax);
|
|
15346
|
+
var descriptionSchema = z19.string().min(1).max(META_LIMITS.creative.descriptionMax);
|
|
15347
|
+
var callToActionSchema = z19.object({
|
|
15348
|
+
type: z19.enum(CTA_TYPES2),
|
|
15319
15349
|
/** Overrides the base link for the CTA button; defaults to the ad's link. */
|
|
15320
15350
|
link: httpsUrlSchema3.optional()
|
|
15321
15351
|
});
|
|
15322
|
-
var creativeEnhancementsSchema =
|
|
15323
|
-
standardEnhancements:
|
|
15324
|
-
features:
|
|
15352
|
+
var creativeEnhancementsSchema = z19.object({
|
|
15353
|
+
standardEnhancements: z19.enum(ENROLL_STATUSES).optional(),
|
|
15354
|
+
features: z19.record(z19.string(), z19.enum(ENROLL_STATUSES)).optional()
|
|
15325
15355
|
});
|
|
15326
15356
|
var creativeSharedFields = {
|
|
15327
|
-
name:
|
|
15357
|
+
name: z19.string().max(META_LIMITS.creative.nameMax).optional(),
|
|
15328
15358
|
/** Facebook Page id backing the ad's identity. */
|
|
15329
15359
|
page_id: parentRefSchema2,
|
|
15330
15360
|
/** Instagram account id for IG placements (aka instagram_actor_id on read). */
|
|
15331
|
-
instagram_user_id:
|
|
15361
|
+
instagram_user_id: z19.string().regex(NUMERIC_ID_REGEX3).optional(),
|
|
15332
15362
|
/** URL tracking parameters appended to the destination, e.g. "utm_source=fb&utm_campaign=x". */
|
|
15333
|
-
url_tags:
|
|
15363
|
+
url_tags: z19.string().max(1e3).optional(),
|
|
15334
15364
|
enhancements: creativeEnhancementsSchema.optional()
|
|
15335
15365
|
};
|
|
15336
15366
|
var imageMediaFields = {
|
|
15337
|
-
imageHash:
|
|
15367
|
+
imageHash: z19.string().regex(IMAGE_HASH_REGEX).optional(),
|
|
15338
15368
|
imageRef: tempRefSchema3.optional()
|
|
15339
15369
|
};
|
|
15340
15370
|
var videoMediaFields = {
|
|
15341
|
-
videoId:
|
|
15371
|
+
videoId: z19.string().regex(NUMERIC_ID_REGEX3).optional(),
|
|
15342
15372
|
videoRef: tempRefSchema3.optional(),
|
|
15343
15373
|
/** Thumbnail for a video creative — image hash, ref, or public url. */
|
|
15344
|
-
thumbnailHash:
|
|
15345
|
-
imageUrl:
|
|
15374
|
+
thumbnailHash: z19.string().regex(IMAGE_HASH_REGEX).optional(),
|
|
15375
|
+
imageUrl: z19.string().url().optional()
|
|
15346
15376
|
};
|
|
15347
15377
|
function countImageRefs(p) {
|
|
15348
15378
|
return [p.imageHash, p.imageRef].filter(Boolean).length;
|
|
@@ -15350,8 +15380,8 @@ function countImageRefs(p) {
|
|
|
15350
15380
|
function countVideoRefs(p) {
|
|
15351
15381
|
return [p.videoId, p.videoRef].filter(Boolean).length;
|
|
15352
15382
|
}
|
|
15353
|
-
var singleCreativeSchema =
|
|
15354
|
-
creativeType:
|
|
15383
|
+
var singleCreativeSchema = z19.object({
|
|
15384
|
+
creativeType: z19.literal("single"),
|
|
15355
15385
|
...creativeSharedFields,
|
|
15356
15386
|
/** Primary text. */
|
|
15357
15387
|
message: messageSchema,
|
|
@@ -15360,7 +15390,7 @@ var singleCreativeSchema = z18.object({
|
|
|
15360
15390
|
headline: headlineSchema2.optional(),
|
|
15361
15391
|
description: descriptionSchema.optional(),
|
|
15362
15392
|
/** Display URL / caption shown under the headline. */
|
|
15363
|
-
caption:
|
|
15393
|
+
caption: z19.string().max(255).optional(),
|
|
15364
15394
|
call_to_action: callToActionSchema.optional(),
|
|
15365
15395
|
...imageMediaFields,
|
|
15366
15396
|
...videoMediaFields
|
|
@@ -15384,10 +15414,10 @@ var singleCreativeSchema = z18.object({
|
|
|
15384
15414
|
});
|
|
15385
15415
|
}
|
|
15386
15416
|
});
|
|
15387
|
-
var carouselCardSchema =
|
|
15417
|
+
var carouselCardSchema = z19.object({
|
|
15388
15418
|
link: httpsUrlSchema3,
|
|
15389
|
-
headline:
|
|
15390
|
-
description:
|
|
15419
|
+
headline: z19.string().max(META_LIMITS.creative.headlineMax).optional(),
|
|
15420
|
+
description: z19.string().max(META_LIMITS.creative.descriptionMax).optional(),
|
|
15391
15421
|
call_to_action: callToActionSchema.optional(),
|
|
15392
15422
|
...imageMediaFields,
|
|
15393
15423
|
...videoMediaFields
|
|
@@ -15407,35 +15437,35 @@ var carouselCardSchema = z18.object({
|
|
|
15407
15437
|
ctx.addIssue({ code: "custom", path: ["videoId"], message: "each card is an image OR a video, not both" });
|
|
15408
15438
|
}
|
|
15409
15439
|
});
|
|
15410
|
-
var carouselCreativeSchema2 =
|
|
15411
|
-
creativeType:
|
|
15440
|
+
var carouselCreativeSchema2 = z19.object({
|
|
15441
|
+
creativeType: z19.literal("carousel"),
|
|
15412
15442
|
...creativeSharedFields,
|
|
15413
15443
|
message: messageSchema,
|
|
15414
15444
|
/** Optional "see more" card destination applied when a card has no own link. */
|
|
15415
15445
|
link: httpsUrlSchema3.optional(),
|
|
15416
15446
|
call_to_action: callToActionSchema.optional(),
|
|
15417
|
-
cards:
|
|
15447
|
+
cards: z19.array(carouselCardSchema).min(META_LIMITS.creative.carouselCardsMin).max(META_LIMITS.creative.carouselCardsMax)
|
|
15418
15448
|
});
|
|
15419
|
-
var dynamicImageSchema =
|
|
15420
|
-
var dynamicVideoSchema =
|
|
15449
|
+
var dynamicImageSchema = z19.object({ ...imageMediaFields }).refine((p) => countImageRefs(p) === 1, "each dynamic image needs exactly one reference");
|
|
15450
|
+
var dynamicVideoSchema = z19.object({
|
|
15421
15451
|
videoId: videoMediaFields.videoId,
|
|
15422
15452
|
videoRef: videoMediaFields.videoRef,
|
|
15423
15453
|
thumbnailHash: videoMediaFields.thumbnailHash
|
|
15424
15454
|
}).refine((p) => countVideoRefs(p) === 1, "each dynamic video needs exactly one reference");
|
|
15425
15455
|
var DYN = META_LIMITS.creative;
|
|
15426
|
-
var dynamicCreativeSchema =
|
|
15427
|
-
creativeType:
|
|
15456
|
+
var dynamicCreativeSchema = z19.object({
|
|
15457
|
+
creativeType: z19.literal("dynamic"),
|
|
15428
15458
|
...creativeSharedFields,
|
|
15429
|
-
bodies:
|
|
15430
|
-
titles:
|
|
15431
|
-
descriptions:
|
|
15432
|
-
images:
|
|
15433
|
-
videos:
|
|
15434
|
-
ad_formats:
|
|
15435
|
-
call_to_action_types:
|
|
15436
|
-
link_urls:
|
|
15459
|
+
bodies: z19.array(z19.object({ text: messageSchema })).min(DYN.dynamicTextsMin).max(DYN.dynamicTextsMax),
|
|
15460
|
+
titles: z19.array(z19.object({ text: headlineSchema2 })).min(DYN.dynamicTextsMin).max(DYN.dynamicTextsMax),
|
|
15461
|
+
descriptions: z19.array(z19.object({ text: descriptionSchema })).max(DYN.dynamicTextsMax).optional(),
|
|
15462
|
+
images: z19.array(dynamicImageSchema).optional(),
|
|
15463
|
+
videos: z19.array(dynamicVideoSchema).optional(),
|
|
15464
|
+
ad_formats: z19.array(z19.enum(AD_FORMATS2)).min(1),
|
|
15465
|
+
call_to_action_types: z19.array(z19.enum(CTA_TYPES2)).optional(),
|
|
15466
|
+
link_urls: z19.array(z19.object({ website_url: httpsUrlSchema3, display_url: z19.string().optional() })).min(1),
|
|
15437
15467
|
/** Multi-language / placement customization — structural passthrough for v1. */
|
|
15438
|
-
asset_customization_rules:
|
|
15468
|
+
asset_customization_rules: z19.array(z19.record(z19.string(), z19.unknown())).optional()
|
|
15439
15469
|
}).superRefine((p, ctx) => {
|
|
15440
15470
|
if (!(p.images?.length || p.videos?.length)) {
|
|
15441
15471
|
ctx.addIssue({
|
|
@@ -15445,57 +15475,57 @@ var dynamicCreativeSchema = z18.object({
|
|
|
15445
15475
|
});
|
|
15446
15476
|
}
|
|
15447
15477
|
});
|
|
15448
|
-
var existingPostCreativeSchema =
|
|
15449
|
-
creativeType:
|
|
15478
|
+
var existingPostCreativeSchema = z19.object({
|
|
15479
|
+
creativeType: z19.literal("existing_post"),
|
|
15450
15480
|
name: creativeSharedFields.name,
|
|
15451
15481
|
/** "<page_id>_<post_id>" object story id of the post to promote. */
|
|
15452
|
-
object_story_id:
|
|
15482
|
+
object_story_id: z19.string().regex(/^\d+_\d+$/, 'expected "<page_id>_<post_id>"'),
|
|
15453
15483
|
instagram_user_id: creativeSharedFields.instagram_user_id,
|
|
15454
15484
|
url_tags: creativeSharedFields.url_tags,
|
|
15455
15485
|
enhancements: creativeSharedFields.enhancements
|
|
15456
15486
|
});
|
|
15457
|
-
var creativeContentSchema2 =
|
|
15487
|
+
var creativeContentSchema2 = z19.discriminatedUnion("creativeType", [
|
|
15458
15488
|
singleCreativeSchema,
|
|
15459
15489
|
carouselCreativeSchema2,
|
|
15460
15490
|
dynamicCreativeSchema,
|
|
15461
15491
|
existingPostCreativeSchema
|
|
15462
15492
|
]);
|
|
15463
15493
|
var adCreativeCreateSchema = creativeContentSchema2;
|
|
15464
|
-
var adCreativeUpdateSchema =
|
|
15465
|
-
name:
|
|
15494
|
+
var adCreativeUpdateSchema = z19.object({
|
|
15495
|
+
name: z19.string().max(META_LIMITS.creative.nameMax).optional(),
|
|
15466
15496
|
status: updateStatusSchema.optional(),
|
|
15467
15497
|
/** Content patch — only honored when the target is a staged meta_temp_* creative. */
|
|
15468
|
-
content:
|
|
15498
|
+
content: z19.record(z19.string(), z19.unknown()).optional()
|
|
15469
15499
|
}).refine((p) => Object.values(p).some((val) => val !== void 0), "update needs at least one field");
|
|
15470
|
-
var adCreateSchema2 =
|
|
15471
|
-
name:
|
|
15500
|
+
var adCreateSchema2 = z19.object({
|
|
15501
|
+
name: z19.string().min(1).max(META_LIMITS.ad.nameMax),
|
|
15472
15502
|
adset_id: parentRefSchema2,
|
|
15473
15503
|
status: stageableStatusSchema3.default("PAUSED"),
|
|
15474
|
-
creative:
|
|
15504
|
+
creative: z19.object({ creative_id: parentRefSchema2 }),
|
|
15475
15505
|
/** Conversion pixel / offline event set / view tags — structural passthrough. */
|
|
15476
|
-
tracking_specs:
|
|
15506
|
+
tracking_specs: z19.array(z19.record(z19.string(), z19.unknown())).optional()
|
|
15477
15507
|
});
|
|
15478
|
-
var adUpdateSchema2 =
|
|
15479
|
-
name:
|
|
15508
|
+
var adUpdateSchema2 = z19.object({
|
|
15509
|
+
name: z19.string().min(1).max(META_LIMITS.ad.nameMax).optional(),
|
|
15480
15510
|
status: updateStatusSchema.optional(),
|
|
15481
15511
|
/** Swapping the creative is the Meta way to "edit" an ad's creative. */
|
|
15482
|
-
creative:
|
|
15483
|
-
tracking_specs:
|
|
15512
|
+
creative: z19.object({ creative_id: parentRefSchema2 }).optional(),
|
|
15513
|
+
tracking_specs: z19.array(z19.record(z19.string(), z19.unknown())).optional()
|
|
15484
15514
|
}).refine((p) => Object.values(p).some((val) => val !== void 0), "update needs at least one field");
|
|
15485
|
-
var lookalikeSpecSchema =
|
|
15486
|
-
origin:
|
|
15487
|
-
ratio:
|
|
15488
|
-
country:
|
|
15489
|
-
});
|
|
15490
|
-
var customAudienceCreateSchema =
|
|
15491
|
-
name:
|
|
15492
|
-
subtype:
|
|
15493
|
-
description:
|
|
15494
|
-
customer_file_source:
|
|
15495
|
-
retention_days:
|
|
15515
|
+
var lookalikeSpecSchema = z19.object({
|
|
15516
|
+
origin: z19.array(z19.object({ id: parentRefSchema2 })).min(1),
|
|
15517
|
+
ratio: z19.number().min(0.01).max(0.2).optional(),
|
|
15518
|
+
country: z19.string().length(2).optional()
|
|
15519
|
+
});
|
|
15520
|
+
var customAudienceCreateSchema = z19.object({
|
|
15521
|
+
name: z19.string().min(1).max(META_LIMITS.audience.nameMax),
|
|
15522
|
+
subtype: z19.enum(CUSTOM_AUDIENCE_SUBTYPES),
|
|
15523
|
+
description: z19.string().max(500).optional(),
|
|
15524
|
+
customer_file_source: z19.string().optional(),
|
|
15525
|
+
retention_days: z19.number().int().min(1).max(META_LIMITS.audience.retentionDaysMax).optional(),
|
|
15496
15526
|
lookalike_spec: lookalikeSpecSchema.optional(),
|
|
15497
15527
|
/** Website/engagement rule — structural passthrough validated by Meta. */
|
|
15498
|
-
rule:
|
|
15528
|
+
rule: z19.record(z19.string(), z19.unknown()).optional()
|
|
15499
15529
|
}).superRefine((p, ctx) => {
|
|
15500
15530
|
if (p.subtype === "LOOKALIKE" && !p.lookalike_spec) {
|
|
15501
15531
|
ctx.addIssue({ code: "custom", path: ["lookalike_spec"], message: "LOOKALIKE audiences need a lookalike_spec" });
|
|
@@ -15504,16 +15534,16 @@ var customAudienceCreateSchema = z18.object({
|
|
|
15504
15534
|
ctx.addIssue({ code: "custom", path: ["rule"], message: `${p.subtype} audiences need a rule (use --file)` });
|
|
15505
15535
|
}
|
|
15506
15536
|
});
|
|
15507
|
-
var customAudienceUpdateSchema =
|
|
15508
|
-
name:
|
|
15509
|
-
description:
|
|
15537
|
+
var customAudienceUpdateSchema = z19.object({
|
|
15538
|
+
name: z19.string().min(1).max(META_LIMITS.audience.nameMax).optional(),
|
|
15539
|
+
description: z19.string().max(500).optional()
|
|
15510
15540
|
}).refine((p) => Object.values(p).some((val) => val !== void 0), "update needs at least one field");
|
|
15511
|
-
var mediaUploadSchema =
|
|
15512
|
-
kind:
|
|
15541
|
+
var mediaUploadSchema = z19.object({
|
|
15542
|
+
kind: z19.enum(MEDIA_KINDS),
|
|
15513
15543
|
bakerImageId: bakerMediaIdSchema2.optional(),
|
|
15514
15544
|
bakerVideoId: bakerMediaIdSchema2.optional(),
|
|
15515
15545
|
/** Optional display name / filename hint. */
|
|
15516
|
-
name:
|
|
15546
|
+
name: z19.string().max(255).optional()
|
|
15517
15547
|
}).superRefine((p, ctx) => {
|
|
15518
15548
|
if (p.kind === "image" && !p.bakerImageId) {
|
|
15519
15549
|
ctx.addIssue({ code: "custom", path: ["bakerImageId"], message: "image uploads need a bakerImageId" });
|
|
@@ -15535,16 +15565,16 @@ var META_DRAFT_OP_KINDS = [
|
|
|
15535
15565
|
"customAudience.update",
|
|
15536
15566
|
"media.upload"
|
|
15537
15567
|
];
|
|
15538
|
-
var metaDraftOpKindSchema =
|
|
15539
|
-
var accountIdSchema2 =
|
|
15540
|
-
var updateTargetSchema2 =
|
|
15568
|
+
var metaDraftOpKindSchema = z19.enum(META_DRAFT_OP_KINDS);
|
|
15569
|
+
var accountIdSchema2 = z19.string().regex(NUMERIC_ID_REGEX3, "accountId must be the bare numeric ad account id");
|
|
15570
|
+
var updateTargetSchema2 = z19.union([z19.string().regex(NUMERIC_ID_REGEX3), tempRefSchema3]);
|
|
15541
15571
|
function createOp3(kind, payload) {
|
|
15542
|
-
return
|
|
15572
|
+
return z19.object({ kind: z19.literal(kind), accountId: accountIdSchema2, payload });
|
|
15543
15573
|
}
|
|
15544
15574
|
function updateOp3(kind, payload) {
|
|
15545
|
-
return
|
|
15575
|
+
return z19.object({ kind: z19.literal(kind), accountId: accountIdSchema2, target: updateTargetSchema2, payload });
|
|
15546
15576
|
}
|
|
15547
|
-
var metaDraftOpInputSchema =
|
|
15577
|
+
var metaDraftOpInputSchema = z19.discriminatedUnion("kind", [
|
|
15548
15578
|
createOp3("campaign.create", campaignCreateSchema3),
|
|
15549
15579
|
updateOp3("campaign.update", campaignUpdateSchema3),
|
|
15550
15580
|
createOp3("adSet.create", adSetCreateSchema),
|
|
@@ -15559,100 +15589,100 @@ var metaDraftOpInputSchema = z18.discriminatedUnion("kind", [
|
|
|
15559
15589
|
]);
|
|
15560
15590
|
|
|
15561
15591
|
// ../api/src/ads-meta/wire.ts
|
|
15562
|
-
import { z as
|
|
15563
|
-
var metaWriteModeSchema =
|
|
15564
|
-
var metaDraftOpResultSchema =
|
|
15565
|
-
status:
|
|
15592
|
+
import { z as z20 } from "zod";
|
|
15593
|
+
var metaWriteModeSchema = z20.enum(["live", "simulated"]);
|
|
15594
|
+
var metaDraftOpResultSchema = z20.object({
|
|
15595
|
+
status: z20.enum(["applied", "simulated", "failed", "skipped"]),
|
|
15566
15596
|
/** The resulting Meta node id (campaign/adset/creative/ad/audience) or simulated id. */
|
|
15567
|
-
id:
|
|
15597
|
+
id: z20.string().optional(),
|
|
15568
15598
|
/** For media.upload ops: the resulting image hash. */
|
|
15569
|
-
hash:
|
|
15570
|
-
error:
|
|
15571
|
-
skippedBecause:
|
|
15572
|
-
executedAt:
|
|
15599
|
+
hash: z20.string().optional(),
|
|
15600
|
+
error: z20.string().optional(),
|
|
15601
|
+
skippedBecause: z20.string().optional(),
|
|
15602
|
+
executedAt: z20.number().optional()
|
|
15573
15603
|
});
|
|
15574
|
-
var metaDraftStageRequestSchema =
|
|
15575
|
-
chatId:
|
|
15604
|
+
var metaDraftStageRequestSchema = z20.object({
|
|
15605
|
+
chatId: z20.string(),
|
|
15576
15606
|
op: metaDraftOpInputSchema
|
|
15577
15607
|
});
|
|
15578
|
-
var metaDraftStageResponseSchema =
|
|
15579
|
-
staged:
|
|
15580
|
-
ref:
|
|
15608
|
+
var metaDraftStageResponseSchema = z20.object({
|
|
15609
|
+
staged: z20.literal(true),
|
|
15610
|
+
ref: z20.string(),
|
|
15581
15611
|
kind: metaDraftOpKindSchema,
|
|
15582
15612
|
mode: metaWriteModeSchema,
|
|
15583
|
-
dependsOn:
|
|
15584
|
-
summary:
|
|
15585
|
-
warnings:
|
|
15613
|
+
dependsOn: z20.array(z20.string()),
|
|
15614
|
+
summary: z20.string(),
|
|
15615
|
+
warnings: z20.array(z20.string()),
|
|
15586
15616
|
/** True when the op amended an already-staged op in place instead of appending a new one. */
|
|
15587
|
-
amended:
|
|
15588
|
-
});
|
|
15589
|
-
var metaDraftDuplicateRequestSchema =
|
|
15590
|
-
chatId:
|
|
15591
|
-
accountId:
|
|
15592
|
-
entity:
|
|
15593
|
-
sourceId:
|
|
15594
|
-
overrides:
|
|
15617
|
+
amended: z20.boolean().optional()
|
|
15618
|
+
});
|
|
15619
|
+
var metaDraftDuplicateRequestSchema = z20.object({
|
|
15620
|
+
chatId: z20.string(),
|
|
15621
|
+
accountId: z20.string(),
|
|
15622
|
+
entity: z20.enum(["campaign", "adSet", "ad"]),
|
|
15623
|
+
sourceId: z20.string(),
|
|
15624
|
+
overrides: z20.record(z20.string(), z20.unknown()).optional(),
|
|
15595
15625
|
/** Pause the original after the copy publishes. */
|
|
15596
|
-
replace:
|
|
15626
|
+
replace: z20.boolean().optional()
|
|
15597
15627
|
});
|
|
15598
|
-
var metaDraftOpViewSchema =
|
|
15599
|
-
ref:
|
|
15628
|
+
var metaDraftOpViewSchema = z20.object({
|
|
15629
|
+
ref: z20.string(),
|
|
15600
15630
|
kind: metaDraftOpKindSchema,
|
|
15601
|
-
accountId:
|
|
15602
|
-
target:
|
|
15603
|
-
dependsOn:
|
|
15604
|
-
summary:
|
|
15605
|
-
stagedAt:
|
|
15631
|
+
accountId: z20.string(),
|
|
15632
|
+
target: z20.string().optional(),
|
|
15633
|
+
dependsOn: z20.array(z20.string()),
|
|
15634
|
+
summary: z20.string(),
|
|
15635
|
+
stagedAt: z20.number(),
|
|
15606
15636
|
result: metaDraftOpResultSchema.optional()
|
|
15607
15637
|
});
|
|
15608
|
-
var metaDraftListRequestSchema =
|
|
15609
|
-
chatId:
|
|
15638
|
+
var metaDraftListRequestSchema = z20.object({
|
|
15639
|
+
chatId: z20.string()
|
|
15610
15640
|
});
|
|
15611
|
-
var metaDraftAdvisorySchema =
|
|
15612
|
-
ref:
|
|
15613
|
-
message:
|
|
15641
|
+
var metaDraftAdvisorySchema = z20.object({
|
|
15642
|
+
ref: z20.string(),
|
|
15643
|
+
message: z20.string()
|
|
15614
15644
|
});
|
|
15615
|
-
var metaDraftListResponseSchema =
|
|
15616
|
-
status:
|
|
15645
|
+
var metaDraftListResponseSchema = z20.object({
|
|
15646
|
+
status: z20.enum(["active", "publishing", "applied", "discarded", "none"]),
|
|
15617
15647
|
mode: metaWriteModeSchema,
|
|
15618
|
-
count:
|
|
15619
|
-
ops:
|
|
15648
|
+
count: z20.number(),
|
|
15649
|
+
ops: z20.array(metaDraftOpViewSchema),
|
|
15620
15650
|
/** Non-blocking cross-op quality advisories — "good campaign, not just valid". */
|
|
15621
|
-
advisories:
|
|
15651
|
+
advisories: z20.array(metaDraftAdvisorySchema)
|
|
15622
15652
|
});
|
|
15623
|
-
var metaDraftShowRequestSchema =
|
|
15624
|
-
chatId:
|
|
15625
|
-
ref:
|
|
15653
|
+
var metaDraftShowRequestSchema = z20.object({
|
|
15654
|
+
chatId: z20.string(),
|
|
15655
|
+
ref: z20.string()
|
|
15626
15656
|
});
|
|
15627
|
-
var metaDraftShowResponseSchema =
|
|
15657
|
+
var metaDraftShowResponseSchema = z20.object({
|
|
15628
15658
|
op: metaDraftOpViewSchema.extend({
|
|
15629
|
-
payload:
|
|
15630
|
-
warnings:
|
|
15631
|
-
annotations:
|
|
15659
|
+
payload: z20.unknown().optional(),
|
|
15660
|
+
warnings: z20.array(z20.string()).optional(),
|
|
15661
|
+
annotations: z20.unknown().optional()
|
|
15632
15662
|
})
|
|
15633
15663
|
});
|
|
15634
|
-
var metaDraftRemoveRequestSchema =
|
|
15635
|
-
chatId:
|
|
15636
|
-
ref:
|
|
15664
|
+
var metaDraftRemoveRequestSchema = z20.object({
|
|
15665
|
+
chatId: z20.string(),
|
|
15666
|
+
ref: z20.string()
|
|
15637
15667
|
});
|
|
15638
|
-
var metaDraftRemoveResponseSchema =
|
|
15668
|
+
var metaDraftRemoveResponseSchema = z20.object({
|
|
15639
15669
|
/** The requested ref plus any dependents removed by cascade. */
|
|
15640
|
-
removed:
|
|
15670
|
+
removed: z20.array(z20.string())
|
|
15641
15671
|
});
|
|
15642
|
-
var metaDraftClearRequestSchema =
|
|
15643
|
-
chatId:
|
|
15672
|
+
var metaDraftClearRequestSchema = z20.object({
|
|
15673
|
+
chatId: z20.string()
|
|
15644
15674
|
});
|
|
15645
|
-
var metaDraftClearResponseSchema =
|
|
15646
|
-
cleared:
|
|
15675
|
+
var metaDraftClearResponseSchema = z20.object({
|
|
15676
|
+
cleared: z20.number()
|
|
15647
15677
|
});
|
|
15648
|
-
var metaFieldErrorSchema =
|
|
15649
|
-
path:
|
|
15650
|
-
message:
|
|
15678
|
+
var metaFieldErrorSchema = z20.object({
|
|
15679
|
+
path: z20.string(),
|
|
15680
|
+
message: z20.string()
|
|
15651
15681
|
});
|
|
15652
|
-
var metaDraftErrorResponseSchema =
|
|
15653
|
-
code:
|
|
15654
|
-
error:
|
|
15655
|
-
fields:
|
|
15682
|
+
var metaDraftErrorResponseSchema = z20.object({
|
|
15683
|
+
code: z20.string(),
|
|
15684
|
+
error: z20.string(),
|
|
15685
|
+
fields: z20.array(metaFieldErrorSchema).optional()
|
|
15656
15686
|
});
|
|
15657
15687
|
|
|
15658
15688
|
// src/commands/ads/meta/write-shared.ts
|
|
@@ -15663,19 +15693,19 @@ function failWriteValidation3(message) {
|
|
|
15663
15693
|
writeJsonEnvelope({ ok: false, error: { code: "VALIDATION_ERROR", message } });
|
|
15664
15694
|
process.exit(1);
|
|
15665
15695
|
}
|
|
15666
|
-
function loadJsonFileArg3(
|
|
15667
|
-
if (typeof
|
|
15696
|
+
function loadJsonFileArg3(path29) {
|
|
15697
|
+
if (typeof path29 !== "string" || path29.length === 0) {
|
|
15668
15698
|
return {};
|
|
15669
15699
|
}
|
|
15670
15700
|
try {
|
|
15671
|
-
const parsed = JSON.parse(readFileSync8(
|
|
15701
|
+
const parsed = JSON.parse(readFileSync8(path29, "utf8"));
|
|
15672
15702
|
if (parsed === null || typeof parsed !== "object" || Array.isArray(parsed)) {
|
|
15673
|
-
failWriteValidation3(`${
|
|
15703
|
+
failWriteValidation3(`${path29} must contain a JSON object`);
|
|
15674
15704
|
}
|
|
15675
15705
|
return parsed;
|
|
15676
15706
|
} catch (err) {
|
|
15677
15707
|
if (err instanceof SyntaxError) {
|
|
15678
|
-
failWriteValidation3(`${
|
|
15708
|
+
failWriteValidation3(`${path29} is not valid JSON: ${err.message}`);
|
|
15679
15709
|
}
|
|
15680
15710
|
throw err;
|
|
15681
15711
|
}
|
|
@@ -16218,10 +16248,10 @@ function duplicateCommand2(entity, label) {
|
|
|
16218
16248
|
replace: { type: "boolean", description: "Pause the original once the copy publishes" }
|
|
16219
16249
|
},
|
|
16220
16250
|
run: async ({ args }) => {
|
|
16221
|
-
const { apiPost: apiPost2 } = await import("./client-
|
|
16251
|
+
const { apiPost: apiPost2 } = await import("./client-HXMDU745.js");
|
|
16222
16252
|
const { requireChatId: requireChatId2 } = await import("./env-6QJCMTRK.js");
|
|
16223
|
-
const { writeJsonEnvelope: writeJsonEnvelope2 } = await import("./output-
|
|
16224
|
-
const { handleMetaError: handleMetaError2 } = await import("./shared-
|
|
16253
|
+
const { writeJsonEnvelope: writeJsonEnvelope2 } = await import("./output-XB3PKLPQ.js");
|
|
16254
|
+
const { handleMetaError: handleMetaError2 } = await import("./shared-QRHBP3JR.js");
|
|
16225
16255
|
try {
|
|
16226
16256
|
const accountId = bareAccountId2(args);
|
|
16227
16257
|
const chatId = requireChatId2();
|
|
@@ -19594,7 +19624,7 @@ import { toCardinal as nwKo } from "n2words/ko-KR";
|
|
|
19594
19624
|
import { toCardinal as nwNl } from "n2words/nl-NL";
|
|
19595
19625
|
import { toCardinal as nwPl } from "n2words/pl-PL";
|
|
19596
19626
|
import { toCardinal as nwPt } from "n2words/pt-PT";
|
|
19597
|
-
import { z as
|
|
19627
|
+
import { z as z21 } from "zod";
|
|
19598
19628
|
|
|
19599
19629
|
// src/engine/scaffold/lib/shoot-modes.ts
|
|
19600
19630
|
var SHOOT_MODES = [
|
|
@@ -19930,71 +19960,71 @@ function trimArgs(durationS, offsetS = 0, dims) {
|
|
|
19930
19960
|
"{{out.video}}"
|
|
19931
19961
|
];
|
|
19932
19962
|
}
|
|
19933
|
-
var FrameAsset =
|
|
19934
|
-
var DialogueLine =
|
|
19935
|
-
speaker:
|
|
19936
|
-
line:
|
|
19963
|
+
var FrameAsset = z21.object({ url: z21.string().optional() }).loose().optional();
|
|
19964
|
+
var DialogueLine = z21.object({
|
|
19965
|
+
speaker: z21.string().optional(),
|
|
19966
|
+
line: z21.string().optional(),
|
|
19937
19967
|
// Absolute seconds on the source timeline (the deconstruct emits both).
|
|
19938
|
-
start_s:
|
|
19939
|
-
end_s:
|
|
19940
|
-
delivery:
|
|
19941
|
-
voice_description:
|
|
19968
|
+
start_s: z21.number().optional(),
|
|
19969
|
+
end_s: z21.number().optional(),
|
|
19970
|
+
delivery: z21.string().optional(),
|
|
19971
|
+
voice_description: z21.string().optional(),
|
|
19942
19972
|
// DECON-supplied: is this speaker's FACE visibly speaking in THIS scene? Element
|
|
19943
19973
|
// presence alone can't answer that — a founder pictured in a polaroid close-up is
|
|
19944
19974
|
// "present" yet the line is voiceover, and treating it as on-camera produced a
|
|
19945
19975
|
// native Seedance lip-sync clip of a still photograph. `false` pins the line to
|
|
19946
19976
|
// the VO path; absent keeps the presence-based decision (old blueprints).
|
|
19947
|
-
on_camera:
|
|
19977
|
+
on_camera: z21.boolean().optional()
|
|
19948
19978
|
}).loose();
|
|
19949
|
-
var Sfx =
|
|
19950
|
-
at_s:
|
|
19951
|
-
duration_s:
|
|
19952
|
-
sound_effect_prompt:
|
|
19953
|
-
description:
|
|
19979
|
+
var Sfx = z21.object({
|
|
19980
|
+
at_s: z21.number().optional(),
|
|
19981
|
+
duration_s: z21.number().optional(),
|
|
19982
|
+
sound_effect_prompt: z21.string().optional(),
|
|
19983
|
+
description: z21.string().optional()
|
|
19954
19984
|
}).loose();
|
|
19955
|
-
var CompositionRegion =
|
|
19985
|
+
var CompositionRegion = z21.object({
|
|
19956
19986
|
// full | top | bottom | left | right | inset
|
|
19957
|
-
panel:
|
|
19987
|
+
panel: z21.string().optional(),
|
|
19958
19988
|
// 9-grid anchor for an `inset` presenter box.
|
|
19959
|
-
position:
|
|
19960
|
-
is_presenter:
|
|
19989
|
+
position: z21.string().optional(),
|
|
19990
|
+
is_presenter: z21.boolean().optional(),
|
|
19961
19991
|
// The cast id shown/speaking in this region (routes lip-sync + element refs).
|
|
19962
|
-
cast_ref:
|
|
19992
|
+
cast_ref: z21.string().optional(),
|
|
19963
19993
|
// What the region's content IS: camera | screen_capture | static_graphic |
|
|
19964
19994
|
// generated. Authoritative for routing when present (regex-over-prose fallback
|
|
19965
19995
|
// otherwise): screen_capture/static_graphic are rebuilt from REAL surfaces on the
|
|
19966
19996
|
// overlay layer, never AI-generated.
|
|
19967
|
-
kind:
|
|
19997
|
+
kind: z21.string().optional(),
|
|
19968
19998
|
// Opaque id naming the SPECIFIC on-screen document/note/app-state this
|
|
19969
19999
|
// screen_capture region shows. Two scenes share it only when they show the SAME
|
|
19970
20000
|
// recording continuing (scrolling/typing/waiting within it) — a genuinely
|
|
19971
20001
|
// DIFFERENT document/note/recording (a source video splicing two screen captures)
|
|
19972
20002
|
// gets a different id. Breaks a persistent-layout run into separate surface stubs
|
|
19973
20003
|
// instead of asking the operator for one screenshot that can't cover both.
|
|
19974
|
-
surface_id:
|
|
20004
|
+
surface_id: z21.string().optional(),
|
|
19975
20005
|
// Camera bubble(s)/inset(s) embedded INSIDE this region's surface (a Loom-style
|
|
19976
20006
|
// presenter bubble inside a screen recording) — video-in-video the reproduction
|
|
19977
20007
|
// must re-composite, not paint into the surface.
|
|
19978
|
-
nested:
|
|
19979
|
-
summary:
|
|
19980
|
-
frame_prompt:
|
|
19981
|
-
motion_prompt:
|
|
20008
|
+
nested: z21.array(z21.object({}).loose()).optional(),
|
|
20009
|
+
summary: z21.string().optional(),
|
|
20010
|
+
frame_prompt: z21.string().optional(),
|
|
20011
|
+
motion_prompt: z21.string().optional()
|
|
19982
20012
|
}).loose();
|
|
19983
|
-
var SceneComposition =
|
|
20013
|
+
var SceneComposition = z21.object({
|
|
19984
20014
|
// full_frame (default) | split_screen | pip | keyed_overlay
|
|
19985
|
-
layout:
|
|
20015
|
+
layout: z21.string().optional(),
|
|
19986
20016
|
// split_screen only: vertical (top/bottom) | horizontal (left/right).
|
|
19987
|
-
split_axis:
|
|
19988
|
-
regions:
|
|
20017
|
+
split_axis: z21.string().optional(),
|
|
20018
|
+
regions: z21.array(CompositionRegion).optional()
|
|
19989
20019
|
}).loose();
|
|
19990
|
-
var CameraMotion =
|
|
19991
|
-
var TranscriptWord =
|
|
19992
|
-
var Scene =
|
|
19993
|
-
start_s:
|
|
19994
|
-
end_s:
|
|
19995
|
-
duration_s:
|
|
19996
|
-
summary:
|
|
19997
|
-
action_detail:
|
|
20020
|
+
var CameraMotion = z21.object({ movement: z21.string().optional(), detail: z21.string().optional() }).loose();
|
|
20021
|
+
var TranscriptWord = z21.object({ text: z21.string().optional() }).loose();
|
|
20022
|
+
var Scene = z21.object({
|
|
20023
|
+
start_s: z21.number().optional(),
|
|
20024
|
+
end_s: z21.number().optional(),
|
|
20025
|
+
duration_s: z21.number().optional(),
|
|
20026
|
+
summary: z21.string().optional(),
|
|
20027
|
+
action_detail: z21.string().optional(),
|
|
19998
20028
|
// The scene's spatial layout. Absent/full_frame ⇒ one uncut shot (default path).
|
|
19999
20029
|
// A layered layout (split_screen/pip/keyed_overlay) with regions ⇒ the scaffold
|
|
20000
20030
|
// builds one clip per region and stacks/overlays them into the scene picture.
|
|
@@ -20002,82 +20032,82 @@ var Scene = z20.object({
|
|
|
20002
20032
|
// The capture "look" for this scene — selected from the ad-native shoot-mode
|
|
20003
20033
|
// grammar (see lib/shoot-modes.ts). When absent the scaffold auto-derives a
|
|
20004
20034
|
// UGC/product mode; a human can override per scene by setting this.
|
|
20005
|
-
shoot_mode:
|
|
20035
|
+
shoot_mode: z21.string().optional(),
|
|
20006
20036
|
// Diegetic ambient the clip's native audio should carry (no music). When
|
|
20007
20037
|
// absent the scene falls back to its shoot mode's default ambience.
|
|
20008
|
-
ambient:
|
|
20038
|
+
ambient: z21.string().optional(),
|
|
20009
20039
|
camera_motion: CameraMotion.optional(),
|
|
20010
|
-
start_frame_prompt:
|
|
20011
|
-
end_frame_prompt:
|
|
20012
|
-
motion_prompt:
|
|
20040
|
+
start_frame_prompt: z21.string().optional(),
|
|
20041
|
+
end_frame_prompt: z21.string().optional(),
|
|
20042
|
+
motion_prompt: z21.string().optional(),
|
|
20013
20043
|
// The scene's role in the ad's persuasion arc (DECON-supplied); drives the
|
|
20014
20044
|
// script re-craft checklist. Inferred from position when absent.
|
|
20015
|
-
narrative_role:
|
|
20045
|
+
narrative_role: z21.string().optional(),
|
|
20016
20046
|
// DECON-supplied on the HOOK scene: the engineered physical/emotional state that
|
|
20017
20047
|
// makes the first frame stop the scroll (sweaty/breathless/urgent …). Injected
|
|
20018
20048
|
// into the hook's start-frame description so the generator renders that state,
|
|
20019
20049
|
// not a calm influencer (CCA-11).
|
|
20020
|
-
hook_mechanic:
|
|
20050
|
+
hook_mechanic: z21.object({ mechanic: z21.string().optional(), why_it_stops_scroll: z21.string().optional() }).loose().optional(),
|
|
20021
20051
|
// DECON-supplied per-scene location (so a gym hook isn't flattened to "home").
|
|
20022
|
-
scene_setting:
|
|
20052
|
+
scene_setting: z21.string().optional(),
|
|
20023
20053
|
// How this scene cuts to the next (DECON-supplied). A recognized non-cut type
|
|
20024
20054
|
// (fade/whip/zoom/dissolve/swipe) is reproduced as an ffmpeg xfade at the
|
|
20025
20055
|
// boundary; cut/match_cut/none/other stay hard cuts. The last scene's value is
|
|
20026
20056
|
// ignored (nothing follows it).
|
|
20027
|
-
transition_out:
|
|
20028
|
-
dialogue:
|
|
20029
|
-
sfx:
|
|
20030
|
-
overlays:
|
|
20031
|
-
floating_elements:
|
|
20057
|
+
transition_out: z21.object({ type: z21.string().optional(), description: z21.string().optional() }).loose().optional(),
|
|
20058
|
+
dialogue: z21.array(DialogueLine).optional(),
|
|
20059
|
+
sfx: z21.array(Sfx).optional(),
|
|
20060
|
+
overlays: z21.array(z21.unknown()).optional(),
|
|
20061
|
+
floating_elements: z21.array(z21.unknown()).optional(),
|
|
20032
20062
|
// DECON-supplied: how much the picture itself moves within the shot. Gates the
|
|
20033
20063
|
// flash-hold optimization — a sub-2s b-roll flash with REAL subject motion
|
|
20034
20064
|
// (pouring, spreading, hands working) must stay a real clip; freezing it turns
|
|
20035
20065
|
// a montage into a slideshow. Absent (old blueprints) keeps the cheap still.
|
|
20036
|
-
motion_level:
|
|
20037
|
-
transcript_slice:
|
|
20066
|
+
motion_level: z21.enum(["static", "subtle", "dynamic"]).optional(),
|
|
20067
|
+
transcript_slice: z21.array(TranscriptWord).optional(),
|
|
20038
20068
|
start_frame_asset: FrameAsset,
|
|
20039
20069
|
end_frame_asset: FrameAsset,
|
|
20040
20070
|
// DECON-supplied: true when this scene is a length-split CONTINUATION of the
|
|
20041
20071
|
// previous one (the SAME physical shot, broken up only because it exceeded the
|
|
20042
20072
|
// clip ceiling). The scaffold then shares the splice keyframe — this scene's
|
|
20043
20073
|
// start frame IS the previous scene's end frame — so the join is seamless.
|
|
20044
|
-
continues_previous:
|
|
20074
|
+
continues_previous: z21.boolean().optional()
|
|
20045
20075
|
}).loose();
|
|
20046
|
-
var VideoBlueprint =
|
|
20047
|
-
source:
|
|
20048
|
-
global:
|
|
20049
|
-
music:
|
|
20050
|
-
present:
|
|
20051
|
-
music_prompt:
|
|
20076
|
+
var VideoBlueprint = z21.object({
|
|
20077
|
+
source: z21.object({ aspect_ratio: z21.string().optional(), duration_s: z21.number().optional() }).loose().optional(),
|
|
20078
|
+
global: z21.object({
|
|
20079
|
+
music: z21.object({
|
|
20080
|
+
present: z21.boolean().optional(),
|
|
20081
|
+
music_prompt: z21.string().optional(),
|
|
20052
20082
|
// Absolute second the music enters in the reference (the bed often
|
|
20053
20083
|
// kicks in mid-ad, after the hook). We start the regenerated track here
|
|
20054
20084
|
// instead of at 0 so the timing matches.
|
|
20055
|
-
starts_at_s:
|
|
20085
|
+
starts_at_s: z21.number().optional(),
|
|
20056
20086
|
// Populated by the deconstruct when AudD (Shazam-style) recognizes the
|
|
20057
20087
|
// reference track. We never reuse it — only style the regenerated bed.
|
|
20058
|
-
identified_track:
|
|
20088
|
+
identified_track: z21.object({ title: z21.string().optional(), artist: z21.string().optional() }).loose().nullish()
|
|
20059
20089
|
}).loose().optional(),
|
|
20060
|
-
cast:
|
|
20061
|
-
|
|
20062
|
-
id:
|
|
20063
|
-
description:
|
|
20090
|
+
cast: z21.array(
|
|
20091
|
+
z21.object({
|
|
20092
|
+
id: z21.string().optional(),
|
|
20093
|
+
description: z21.string().optional(),
|
|
20064
20094
|
// The deconstruct's note on the target-market localization (e.g. "native
|
|
20065
20095
|
// French speaker") — read to derive the spoken-track language code.
|
|
20066
|
-
market_localization_note:
|
|
20096
|
+
market_localization_note: z21.string().optional()
|
|
20067
20097
|
}).loose()
|
|
20068
20098
|
).optional(),
|
|
20069
|
-
voiceover:
|
|
20099
|
+
voiceover: z21.object({
|
|
20070
20100
|
// on_camera | mixed → mouths are on screen (lip-sync candidates);
|
|
20071
20101
|
// voiceover | none → narration over the picture (no lip-sync).
|
|
20072
|
-
mode:
|
|
20073
|
-
voice_description:
|
|
20074
|
-
persona:
|
|
20102
|
+
mode: z21.string().optional(),
|
|
20103
|
+
voice_description: z21.string().optional(),
|
|
20104
|
+
persona: z21.string().optional()
|
|
20075
20105
|
}).loose().optional(),
|
|
20076
20106
|
// Visual palette — read only to colour a clean brand-card/CTA plate (the
|
|
20077
20107
|
// first hex is the dominant brand colour); never to drive frame generation.
|
|
20078
|
-
style:
|
|
20108
|
+
style: z21.object({ palette: z21.array(z21.object({ hex: z21.string().optional() }).loose()).optional() }).loose().optional()
|
|
20079
20109
|
}).loose().optional(),
|
|
20080
|
-
scenes:
|
|
20110
|
+
scenes: z21.array(Scene).min(1)
|
|
20081
20111
|
}).loose();
|
|
20082
20112
|
function injectHookPhysicality(blueprint) {
|
|
20083
20113
|
for (const scene of blueprint.scenes) {
|
|
@@ -20094,26 +20124,26 @@ function clipIntentOf(scene, sceneIndex) {
|
|
|
20094
20124
|
if (/hero|reveal|product|payoff|transformation|result/.test(role) || scene.motion_level === "dynamic") return "hero";
|
|
20095
20125
|
return "body";
|
|
20096
20126
|
}
|
|
20097
|
-
var AppearsItem =
|
|
20098
|
-
var RecurringElement =
|
|
20127
|
+
var AppearsItem = z21.union([z21.number(), z21.object({ scene: z21.number(), edge: z21.string().optional() }).loose()]);
|
|
20128
|
+
var RecurringElement = z21.object({
|
|
20099
20129
|
// person | animal | product | logo | badge | other
|
|
20100
|
-
type:
|
|
20101
|
-
label:
|
|
20102
|
-
description:
|
|
20103
|
-
expression:
|
|
20130
|
+
type: z21.string(),
|
|
20131
|
+
label: z21.string().optional(),
|
|
20132
|
+
description: z21.string().optional(),
|
|
20133
|
+
expression: z21.string().nullable().optional(),
|
|
20104
20134
|
// When the element maps to a global cast entry, its stable id (for annotation).
|
|
20105
|
-
cast_id:
|
|
20135
|
+
cast_id: z21.string().nullable().optional(),
|
|
20106
20136
|
// The label of another element that is the SAME individual as this one, shown
|
|
20107
20137
|
// in a DIFFERENT wardrobe/persona/state (e.g. one creator playing skeptic in a
|
|
20108
20138
|
// pink shirt and believer in a white shirt). Each look gets its own reference
|
|
20109
20139
|
// slot, but the face/identity must stay identical across them.
|
|
20110
|
-
same_as:
|
|
20140
|
+
same_as: z21.string().nullable().optional(),
|
|
20111
20141
|
// Scenes the element appears in. Either a bare list of scene indices (both
|
|
20112
20142
|
// edges) or per-{scene,edge} entries. Both forms are accepted and merged.
|
|
20113
|
-
scenes:
|
|
20114
|
-
appears_in:
|
|
20143
|
+
scenes: z21.array(z21.number()).optional(),
|
|
20144
|
+
appears_in: z21.array(AppearsItem).optional()
|
|
20115
20145
|
}).loose();
|
|
20116
|
-
var RecurringElements =
|
|
20146
|
+
var RecurringElements = z21.array(RecurringElement);
|
|
20117
20147
|
function sanitizeId(raw, fallback) {
|
|
20118
20148
|
const id = raw.toLowerCase().replace(/[^a-z0-9]+/g, "_").replace(/^_+|_+$/g, "");
|
|
20119
20149
|
return /^[a-z]/.test(id) ? id : `${fallback}_${id}`.replace(/_+$/g, "") || fallback;
|
|
@@ -20588,7 +20618,7 @@ function scrubFloatSentences(text, floatDescs) {
|
|
|
20588
20618
|
return kept;
|
|
20589
20619
|
}
|
|
20590
20620
|
function sceneFloatDescs(scene) {
|
|
20591
|
-
const floats =
|
|
20621
|
+
const floats = z21.array(FloatingElement).safeParse(scene.floating_elements ?? []);
|
|
20592
20622
|
if (!floats.success) return [];
|
|
20593
20623
|
return floats.data.map((f) => f.description?.trim() ?? "").filter(Boolean);
|
|
20594
20624
|
}
|
|
@@ -22012,25 +22042,25 @@ function buildSfxMusic(blueprint, clock, nodes) {
|
|
|
22012
22042
|
}
|
|
22013
22043
|
return tracks;
|
|
22014
22044
|
}
|
|
22015
|
-
var OverlayStyle =
|
|
22016
|
-
var Overlay =
|
|
22017
|
-
text:
|
|
22018
|
-
appears_at_s:
|
|
22019
|
-
duration_s:
|
|
22020
|
-
position:
|
|
22021
|
-
role:
|
|
22022
|
-
animation:
|
|
22023
|
-
animation_detail:
|
|
22045
|
+
var OverlayStyle = z21.object({ color_hex: z21.string().optional(), background: z21.string().optional(), size: z21.string().optional() }).loose();
|
|
22046
|
+
var Overlay = z21.object({
|
|
22047
|
+
text: z21.string().optional(),
|
|
22048
|
+
appears_at_s: z21.number().optional(),
|
|
22049
|
+
duration_s: z21.number().optional(),
|
|
22050
|
+
position: z21.string().optional(),
|
|
22051
|
+
role: z21.string().optional(),
|
|
22052
|
+
animation: z21.string().optional(),
|
|
22053
|
+
animation_detail: z21.string().optional(),
|
|
22024
22054
|
style: OverlayStyle.optional()
|
|
22025
22055
|
}).loose();
|
|
22026
|
-
var FloatingElement =
|
|
22027
|
-
kind:
|
|
22028
|
-
description:
|
|
22029
|
-
brand_name:
|
|
22030
|
-
what_it_represents:
|
|
22031
|
-
appears_at_s:
|
|
22032
|
-
duration_s:
|
|
22033
|
-
position:
|
|
22056
|
+
var FloatingElement = z21.object({
|
|
22057
|
+
kind: z21.string().optional(),
|
|
22058
|
+
description: z21.string().optional(),
|
|
22059
|
+
brand_name: z21.string().nullish(),
|
|
22060
|
+
what_it_represents: z21.string().optional(),
|
|
22061
|
+
appears_at_s: z21.number().optional(),
|
|
22062
|
+
duration_s: z21.number().optional(),
|
|
22063
|
+
position: z21.string().optional()
|
|
22034
22064
|
}).loose();
|
|
22035
22065
|
function escapeHtml(s) {
|
|
22036
22066
|
return s.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
@@ -22062,7 +22092,7 @@ function positionClass(position) {
|
|
|
22062
22092
|
function collectCaptions(blueprint, clock) {
|
|
22063
22093
|
return blueprint.scenes.flatMap((scene, i) => {
|
|
22064
22094
|
const sceneStart = scene.start_s ?? 0;
|
|
22065
|
-
const overlays =
|
|
22095
|
+
const overlays = z21.array(Overlay).safeParse(scene.overlays ?? []);
|
|
22066
22096
|
return overlays.success ? overlays.data.filter((ov) => Boolean(ov.text?.trim())).map((ov) => {
|
|
22067
22097
|
const at = clock.map(i, ov.appears_at_s ?? sceneStart);
|
|
22068
22098
|
return { text: ov.text.trim(), at, end: at + (ov.duration_s ?? 2.5), ov };
|
|
@@ -22142,7 +22172,7 @@ function collectFloatWindows(blueprint, uiRouted, clock) {
|
|
|
22142
22172
|
const windows = /* @__PURE__ */ new Map();
|
|
22143
22173
|
blueprint.scenes.forEach((scene, i) => {
|
|
22144
22174
|
const sceneStart = scene.start_s ?? 0;
|
|
22145
|
-
const floats =
|
|
22175
|
+
const floats = z21.array(FloatingElement).safeParse(scene.floating_elements ?? []);
|
|
22146
22176
|
if (!floats.success) return;
|
|
22147
22177
|
for (const fe of floats.data) {
|
|
22148
22178
|
const at = clock.map(i, fe.appears_at_s ?? sceneStart);
|
|
@@ -22590,8 +22620,8 @@ function buildMotionBoard(blueprint) {
|
|
|
22590
22620
|
const end_s = scene.end_s ?? start_s + sceneDurationS(scene);
|
|
22591
22621
|
cursor = end_s;
|
|
22592
22622
|
const spoken = sceneSpokenText(scene);
|
|
22593
|
-
const overlays =
|
|
22594
|
-
const floats =
|
|
22623
|
+
const overlays = z21.array(Overlay).safeParse(scene.overlays ?? []);
|
|
22624
|
+
const floats = z21.array(FloatingElement).safeParse(scene.floating_elements ?? []);
|
|
22595
22625
|
const graphics = [
|
|
22596
22626
|
...(overlays.success ? overlays.data : []).filter((ov) => ov.text?.trim()).map((ov) => ({
|
|
22597
22627
|
kind: "text",
|
|
@@ -24030,7 +24060,7 @@ import path18 from "path";
|
|
|
24030
24060
|
import { defineCommand as defineCommand95 } from "citty";
|
|
24031
24061
|
|
|
24032
24062
|
// src/engine/scaffold/staticAd.ts
|
|
24033
|
-
import { z as
|
|
24063
|
+
import { z as z22 } from "zod";
|
|
24034
24064
|
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"]);
|
|
24035
24065
|
var DEFAULT_ASPECT_RATIO = "9:16";
|
|
24036
24066
|
var SHEET_SUBJECT_TYPE2 = {
|
|
@@ -24042,24 +24072,24 @@ var ACTOR_SHEET_IMAGE_SIZE = "4K";
|
|
|
24042
24072
|
var ADAPT_MODEL = "google/gemini-3-pro-image-preview";
|
|
24043
24073
|
var ADAPT_IMAGE_SIZE = "2K";
|
|
24044
24074
|
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.";
|
|
24045
|
-
var Blueprint =
|
|
24046
|
-
meta:
|
|
24047
|
-
text_content:
|
|
24075
|
+
var Blueprint = z22.object({
|
|
24076
|
+
meta: z22.object({ estimated_aspect_ratio: z22.string().optional() }).loose().optional(),
|
|
24077
|
+
text_content: z22.array(z22.object({ text: z22.string().optional() }).loose()).optional()
|
|
24048
24078
|
}).loose();
|
|
24049
|
-
var ElementLocator =
|
|
24050
|
-
collection:
|
|
24051
|
-
index:
|
|
24079
|
+
var ElementLocator = z22.object({
|
|
24080
|
+
collection: z22.enum(["subjects", "people", "brands_logos"]),
|
|
24081
|
+
index: z22.number().int().nonnegative()
|
|
24052
24082
|
}).loose();
|
|
24053
|
-
var MainElement =
|
|
24083
|
+
var MainElement = z22.object({
|
|
24054
24084
|
// logo | product | person | animal | badge | other
|
|
24055
|
-
type:
|
|
24056
|
-
label:
|
|
24057
|
-
description:
|
|
24058
|
-
expression:
|
|
24059
|
-
reason:
|
|
24085
|
+
type: z22.string(),
|
|
24086
|
+
label: z22.string().optional(),
|
|
24087
|
+
description: z22.string().optional(),
|
|
24088
|
+
expression: z22.string().nullable().optional(),
|
|
24089
|
+
reason: z22.string().optional(),
|
|
24060
24090
|
locator: ElementLocator.optional()
|
|
24061
24091
|
}).loose();
|
|
24062
|
-
var MainElements =
|
|
24092
|
+
var MainElements = z22.array(MainElement);
|
|
24063
24093
|
function sanitizeId2(raw, fallback) {
|
|
24064
24094
|
const id = raw.toLowerCase().replace(/[^a-z0-9]+/g, "_").replace(/^_+|_+$/g, "");
|
|
24065
24095
|
return /^[a-z]/.test(id) ? id : `${fallback}_${id}`.replace(/_+$/g, "") || fallback;
|
|
@@ -24360,9 +24390,9 @@ function resolveScaffoldStaticAdPaths(rawFile, out, cwd = process.cwd(), slug) {
|
|
|
24360
24390
|
const outPath = out ? path16.resolve(cwd, out) : slug ? path16.join(cwd, "src", "creatives", slug, `${slug}.canvas.json`) : imageIsUrl ? path16.join(cwd, "static-ad.canvas.json") : path16.join(path16.dirname(imageSource), "static-ad.canvas.json");
|
|
24361
24391
|
const blueprintPath = path16.join(path16.dirname(outPath), "prompt.json");
|
|
24362
24392
|
const creativeDir = slug ? path16.dirname(outPath) : null;
|
|
24363
|
-
const
|
|
24393
|
+
const definitionPath2 = creativeDir ? path16.join(creativeDir, "_definition.md") : null;
|
|
24364
24394
|
const referencesDir = creativeDir ? path16.join(creativeDir, "references") : null;
|
|
24365
|
-
return { imageIsUrl, imageSource, outPath, blueprintPath, creativeDir, definitionPath, referencesDir };
|
|
24395
|
+
return { imageIsUrl, imageSource, outPath, blueprintPath, creativeDir, definitionPath: definitionPath2, referencesDir };
|
|
24366
24396
|
}
|
|
24367
24397
|
var SCAFFOLD_SLUG_PATTERN = /^[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/;
|
|
24368
24398
|
var SCAFFOLD_SLUG_MAX_LENGTH = 100;
|
|
@@ -24757,7 +24787,7 @@ var scaffoldStaticAdCommand = defineCommand95({
|
|
|
24757
24787
|
);
|
|
24758
24788
|
process.exit(2);
|
|
24759
24789
|
}
|
|
24760
|
-
const { imageIsUrl, imageSource, outPath, blueprintPath, definitionPath, referencesDir } = resolveScaffoldStaticAdPaths(
|
|
24790
|
+
const { imageIsUrl, imageSource, outPath, blueprintPath, definitionPath: definitionPath2, referencesDir } = resolveScaffoldStaticAdPaths(
|
|
24761
24791
|
String(args.file),
|
|
24762
24792
|
args.out ? String(args.out) : void 0,
|
|
24763
24793
|
process.cwd(),
|
|
@@ -24836,9 +24866,9 @@ var scaffoldStaticAdCommand = defineCommand95({
|
|
|
24836
24866
|
}
|
|
24837
24867
|
await writeFile7(outPath, `${JSON.stringify(canvas, null, 2)}
|
|
24838
24868
|
`, "utf8");
|
|
24839
|
-
if (
|
|
24869
|
+
if (definitionPath2 && !await fileExists(definitionPath2)) {
|
|
24840
24870
|
await writeFile7(
|
|
24841
|
-
|
|
24871
|
+
definitionPath2,
|
|
24842
24872
|
buildCreativeDefinition({
|
|
24843
24873
|
title: args.title ? String(args.title) : titleFromSlug(slug ?? ""),
|
|
24844
24874
|
kind: "static",
|
|
@@ -24869,7 +24899,7 @@ var scaffoldStaticAdCommand = defineCommand95({
|
|
|
24869
24899
|
ok: true,
|
|
24870
24900
|
canvas_path: outPath,
|
|
24871
24901
|
prompt_path: blueprintPath,
|
|
24872
|
-
definition_path:
|
|
24902
|
+
definition_path: definitionPath2 ?? void 0,
|
|
24873
24903
|
source_reference: durableSourceUrl ?? void 0,
|
|
24874
24904
|
output: canvas.output,
|
|
24875
24905
|
models: { describe: describeModel, select: selectModel, layout: layoutModel, gen: opts.genModel },
|
|
@@ -25577,10 +25607,10 @@ var scaffoldVideoCommand = defineCommand96({
|
|
|
25577
25607
|
await ensureGitignore(process.cwd(), ["canvas/", ".context/"]);
|
|
25578
25608
|
const sourceRef = videoSourceReference(blueprint, fileArg2);
|
|
25579
25609
|
if (slug) {
|
|
25580
|
-
const
|
|
25581
|
-
if (!await fileExists2(
|
|
25610
|
+
const definitionPath2 = path21.join(outDir, "_definition.md");
|
|
25611
|
+
if (!await fileExists2(definitionPath2)) {
|
|
25582
25612
|
await writeFile8(
|
|
25583
|
-
|
|
25613
|
+
definitionPath2,
|
|
25584
25614
|
buildCreativeDefinition({
|
|
25585
25615
|
title: titleFromSlug(slug),
|
|
25586
25616
|
kind: "video",
|
|
@@ -26443,12 +26473,12 @@ function listFlowSlugs() {
|
|
|
26443
26473
|
return readdirSync2(dir, { withFileTypes: true }).filter((entry) => entry.isDirectory() && !entry.name.startsWith("_") && entry.name !== ".gitkeep").map((entry) => entry.name).sort();
|
|
26444
26474
|
}
|
|
26445
26475
|
function readFlowTree(slug) {
|
|
26446
|
-
const
|
|
26447
|
-
if (!existsSync4(
|
|
26476
|
+
const path29 = join3(flowsDir(), slug, "_data.json");
|
|
26477
|
+
if (!existsSync4(path29)) {
|
|
26448
26478
|
failLocal(`No form "${slug}". Run "baker flows list" to see the forms in this workspace.`);
|
|
26449
26479
|
}
|
|
26450
26480
|
try {
|
|
26451
|
-
return JSON.parse(readFileSync9(
|
|
26481
|
+
return JSON.parse(readFileSync9(path29, "utf-8"));
|
|
26452
26482
|
} catch (error) {
|
|
26453
26483
|
failLocal(`Could not read form "${slug}": ${error instanceof Error ? error.message : String(error)}`);
|
|
26454
26484
|
}
|
|
@@ -26861,10 +26891,10 @@ async function stageOps(ops) {
|
|
|
26861
26891
|
handleError(err);
|
|
26862
26892
|
}
|
|
26863
26893
|
}
|
|
26864
|
-
async function draftAction2(
|
|
26894
|
+
async function draftAction2(path29, body, chat) {
|
|
26865
26895
|
const chatId = resolveChatId(chat);
|
|
26866
26896
|
try {
|
|
26867
|
-
const data = await apiPost(
|
|
26897
|
+
const data = await apiPost(path29, { chatId, ...body });
|
|
26868
26898
|
writeJsonEnvelope({ ok: true, data });
|
|
26869
26899
|
return data;
|
|
26870
26900
|
} catch (err) {
|
|
@@ -28888,9 +28918,9 @@ async function readImageBuffer(pathOrUrl) {
|
|
|
28888
28918
|
}
|
|
28889
28919
|
return readFile19(pathOrUrl);
|
|
28890
28920
|
}
|
|
28891
|
-
async function isDirectory(
|
|
28921
|
+
async function isDirectory(path29) {
|
|
28892
28922
|
try {
|
|
28893
|
-
const s = await stat4(
|
|
28923
|
+
const s = await stat4(path29);
|
|
28894
28924
|
return s.isDirectory();
|
|
28895
28925
|
} catch {
|
|
28896
28926
|
return false;
|
|
@@ -31510,11 +31540,10 @@ Full guide: __tooling__/docs/tools/baker/images.md`
|
|
|
31510
31540
|
});
|
|
31511
31541
|
|
|
31512
31542
|
// src/commands/landing/index.ts
|
|
31513
|
-
import { defineCommand as
|
|
31543
|
+
import { defineCommand as defineCommand144 } from "citty";
|
|
31514
31544
|
|
|
31515
31545
|
// src/commands/landing/critique.ts
|
|
31516
|
-
import
|
|
31517
|
-
import path27 from "path";
|
|
31546
|
+
import path28 from "path";
|
|
31518
31547
|
import { defineCommand as defineCommand142 } from "citty";
|
|
31519
31548
|
|
|
31520
31549
|
// src/engine/landing/lib/brand-tokens.ts
|
|
@@ -32686,15 +32715,43 @@ function describeCounts(findings) {
|
|
|
32686
32715
|
return [b ? `${b} block` : "", w ? `${w} warn` : "", a ? `${a} advisory` : ""].filter(Boolean).join(", ");
|
|
32687
32716
|
}
|
|
32688
32717
|
|
|
32718
|
+
// src/commands/landing/pages.ts
|
|
32719
|
+
import { readdir as readdir7, stat as stat5 } from "fs/promises";
|
|
32720
|
+
import path25 from "path";
|
|
32721
|
+
async function listLandingSlugs(projectRoot) {
|
|
32722
|
+
try {
|
|
32723
|
+
const entries = await readdir7(path25.join(projectRoot, "src", "pages"), { withFileTypes: true });
|
|
32724
|
+
return entries.filter((e) => e.isDirectory() && !e.name.startsWith("_") && !e.name.startsWith(".")).map((e) => e.name).sort();
|
|
32725
|
+
} catch {
|
|
32726
|
+
return [];
|
|
32727
|
+
}
|
|
32728
|
+
}
|
|
32729
|
+
async function isDir(p) {
|
|
32730
|
+
try {
|
|
32731
|
+
return (await stat5(p)).isDirectory();
|
|
32732
|
+
} catch {
|
|
32733
|
+
return false;
|
|
32734
|
+
}
|
|
32735
|
+
}
|
|
32736
|
+
function definitionPath(projectRoot, slug) {
|
|
32737
|
+
return path25.resolve(projectRoot, "src", "pages", slug, "_definition.md");
|
|
32738
|
+
}
|
|
32739
|
+
function foldersCollide(a, b) {
|
|
32740
|
+
return foldKey(a) === foldKey(b);
|
|
32741
|
+
}
|
|
32742
|
+
function foldKey(name) {
|
|
32743
|
+
return name.normalize("NFD").replace(new RegExp("\\p{Diacritic}", "gu"), "").toLowerCase().replace(/[^a-z0-9]+/g, "");
|
|
32744
|
+
}
|
|
32745
|
+
|
|
32689
32746
|
// src/commands/landing/snapshot.ts
|
|
32690
32747
|
import { mkdir as mkdir8, rename as rename2, writeFile as writeFile11 } from "fs/promises";
|
|
32691
|
-
import
|
|
32748
|
+
import path26 from "path";
|
|
32692
32749
|
var CRITIC_VERSION = "2";
|
|
32693
32750
|
function critiqueCacheDir(projectRoot) {
|
|
32694
|
-
return
|
|
32751
|
+
return path26.join(projectRoot, ".cache", "landing-critique");
|
|
32695
32752
|
}
|
|
32696
32753
|
function snapshotPath(projectRoot, slug) {
|
|
32697
|
-
return
|
|
32754
|
+
return path26.join(critiqueCacheDir(projectRoot), `${slug}.json`);
|
|
32698
32755
|
}
|
|
32699
32756
|
async function writeCritiqueSnapshot(projectRoot, snapshot) {
|
|
32700
32757
|
await mkdir8(critiqueCacheDir(projectRoot), { recursive: true });
|
|
@@ -32706,21 +32763,21 @@ async function writeCritiqueSnapshot(projectRoot, snapshot) {
|
|
|
32706
32763
|
}
|
|
32707
32764
|
|
|
32708
32765
|
// src/commands/landing/source-version.ts
|
|
32709
|
-
import { readdir as
|
|
32710
|
-
import
|
|
32766
|
+
import { readdir as readdir8, readFile as readFile22, stat as stat6 } from "fs/promises";
|
|
32767
|
+
import path27 from "path";
|
|
32711
32768
|
async function landingSourceRelPaths(landingDir) {
|
|
32712
32769
|
const rel = [];
|
|
32713
|
-
if (await isFile(
|
|
32714
|
-
const componentsDir =
|
|
32770
|
+
if (await isFile(path27.join(landingDir, "index.astro"))) rel.push("index.astro");
|
|
32771
|
+
const componentsDir = path27.join(landingDir, "_components");
|
|
32715
32772
|
for (const abs of await walkAstro(componentsDir)) {
|
|
32716
|
-
rel.push(
|
|
32773
|
+
rel.push(path27.relative(landingDir, abs).split(path27.sep).join("/"));
|
|
32717
32774
|
}
|
|
32718
32775
|
return rel.sort((a, b) => a < b ? -1 : a > b ? 1 : 0);
|
|
32719
32776
|
}
|
|
32720
32777
|
async function readLandingSources(landingDir) {
|
|
32721
32778
|
const rel = await landingSourceRelPaths(landingDir);
|
|
32722
32779
|
const out = [];
|
|
32723
|
-
for (const r of rel) out.push({ path: r, text: await readFile22(
|
|
32780
|
+
for (const r of rel) out.push({ path: r, text: await readFile22(path27.join(landingDir, r), "utf8") });
|
|
32724
32781
|
return out;
|
|
32725
32782
|
}
|
|
32726
32783
|
async function computeLandingSourceSha(landingDir) {
|
|
@@ -32729,7 +32786,7 @@ async function computeLandingSourceSha(landingDir) {
|
|
|
32729
32786
|
for (const r of rel) {
|
|
32730
32787
|
let bytes;
|
|
32731
32788
|
try {
|
|
32732
|
-
bytes = await readFile22(
|
|
32789
|
+
bytes = await readFile22(path27.join(landingDir, r));
|
|
32733
32790
|
} catch {
|
|
32734
32791
|
bytes = Buffer.alloc(0);
|
|
32735
32792
|
}
|
|
@@ -32739,7 +32796,7 @@ async function computeLandingSourceSha(landingDir) {
|
|
|
32739
32796
|
}
|
|
32740
32797
|
async function isFile(p) {
|
|
32741
32798
|
try {
|
|
32742
|
-
return (await
|
|
32799
|
+
return (await stat6(p)).isFile();
|
|
32743
32800
|
} catch {
|
|
32744
32801
|
return false;
|
|
32745
32802
|
}
|
|
@@ -32747,13 +32804,13 @@ async function isFile(p) {
|
|
|
32747
32804
|
async function walkAstro(dir) {
|
|
32748
32805
|
let entries;
|
|
32749
32806
|
try {
|
|
32750
|
-
entries = await
|
|
32807
|
+
entries = await readdir8(dir, { withFileTypes: true });
|
|
32751
32808
|
} catch {
|
|
32752
32809
|
return [];
|
|
32753
32810
|
}
|
|
32754
32811
|
const out = [];
|
|
32755
32812
|
for (const entry of entries) {
|
|
32756
|
-
const abs =
|
|
32813
|
+
const abs = path27.join(dir, entry.name);
|
|
32757
32814
|
if (entry.isDirectory()) out.push(...await walkAstro(abs));
|
|
32758
32815
|
else if (entry.isFile() && entry.name.endsWith(".astro")) out.push(abs);
|
|
32759
32816
|
}
|
|
@@ -32814,7 +32871,7 @@ var critiqueCommand2 = defineCommand142({
|
|
|
32814
32871
|
{ availableSlugs: await listLandingSlugs(projectRoot) }
|
|
32815
32872
|
);
|
|
32816
32873
|
}
|
|
32817
|
-
if (!await isDir(
|
|
32874
|
+
if (!await isDir(path28.resolve(projectRoot, "src", "pages", slug))) {
|
|
32818
32875
|
fail5("NOT_FOUND", `No landing at src/pages/${slug}/`, {
|
|
32819
32876
|
availableSlugs: await listLandingSlugs(projectRoot)
|
|
32820
32877
|
});
|
|
@@ -32853,7 +32910,7 @@ var critiqueCommand2 = defineCommand142({
|
|
|
32853
32910
|
}
|
|
32854
32911
|
});
|
|
32855
32912
|
async function critiqueOne(projectRoot, slug, brand) {
|
|
32856
|
-
const landingDir =
|
|
32913
|
+
const landingDir = path28.resolve(projectRoot, "src", "pages", slug);
|
|
32857
32914
|
const [sources, sourceSha] = await Promise.all([readLandingSources(landingDir), computeLandingSourceSha(landingDir)]);
|
|
32858
32915
|
const report = critiqueLanding({ slug, sources, brand });
|
|
32859
32916
|
let snapshotFailed = false;
|
|
@@ -32871,14 +32928,6 @@ async function critiqueOne(projectRoot, slug, brand) {
|
|
|
32871
32928
|
}
|
|
32872
32929
|
return { slug, report, snapshotFailed };
|
|
32873
32930
|
}
|
|
32874
|
-
async function listLandingSlugs(projectRoot) {
|
|
32875
|
-
try {
|
|
32876
|
-
const entries = await readdir8(path27.join(projectRoot, "src", "pages"), { withFileTypes: true });
|
|
32877
|
-
return entries.filter((e) => e.isDirectory() && !e.name.startsWith("_") && !e.name.startsWith(".")).map((e) => e.name).sort();
|
|
32878
|
-
} catch {
|
|
32879
|
-
return [];
|
|
32880
|
-
}
|
|
32881
|
-
}
|
|
32882
32931
|
function present(f) {
|
|
32883
32932
|
return {
|
|
32884
32933
|
id: f.id,
|
|
@@ -32890,32 +32939,261 @@ function present(f) {
|
|
|
32890
32939
|
...f.brandDrift ? { brandDrift: true } : {}
|
|
32891
32940
|
};
|
|
32892
32941
|
}
|
|
32893
|
-
|
|
32894
|
-
|
|
32895
|
-
|
|
32896
|
-
|
|
32897
|
-
|
|
32942
|
+
|
|
32943
|
+
// src/commands/landing/folder.ts
|
|
32944
|
+
import { readFile as readFile23, writeFile as writeFile12 } from "fs/promises";
|
|
32945
|
+
import { defineCommand as defineCommand143 } from "citty";
|
|
32946
|
+
|
|
32947
|
+
// src/commands/landing/definition-folder.ts
|
|
32948
|
+
var FRONTMATTER_DELIMITER = "---";
|
|
32949
|
+
var TOP_LEVEL_FOLDER_RE = /^folder\s*:/;
|
|
32950
|
+
var DefinitionFormatError = class extends Error {
|
|
32951
|
+
};
|
|
32952
|
+
function toYamlString(value) {
|
|
32953
|
+
return `"${value.replace(/\\/g, "\\\\").replace(/"/g, '\\"')}"`;
|
|
32954
|
+
}
|
|
32955
|
+
function setFolderInFrontmatter(source, folder) {
|
|
32956
|
+
const lines = source.split("\n");
|
|
32957
|
+
if (lines[0]?.trim() !== FRONTMATTER_DELIMITER) {
|
|
32958
|
+
throw new DefinitionFormatError("The page's definition does not start with a frontmatter block");
|
|
32959
|
+
}
|
|
32960
|
+
const closing = lines.findIndex((line2, i) => i > 0 && line2.trim() === FRONTMATTER_DELIMITER);
|
|
32961
|
+
if (closing === -1) {
|
|
32962
|
+
throw new DefinitionFormatError("The page's definition has an unterminated frontmatter block");
|
|
32963
|
+
}
|
|
32964
|
+
const existing = lines.findIndex((line2, i) => i > 0 && i < closing && TOP_LEVEL_FOLDER_RE.test(line2));
|
|
32965
|
+
if (folder === null) {
|
|
32966
|
+
if (existing === -1) {
|
|
32967
|
+
return source;
|
|
32968
|
+
}
|
|
32969
|
+
return [...lines.slice(0, existing), ...lines.slice(existing + 1)].join("\n");
|
|
32970
|
+
}
|
|
32971
|
+
const line = `folder: ${toYamlString(folder)}`;
|
|
32972
|
+
if (existing !== -1) {
|
|
32973
|
+
return [...lines.slice(0, existing), line, ...lines.slice(existing + 1)].join("\n");
|
|
32974
|
+
}
|
|
32975
|
+
return [...lines.slice(0, closing), line, ...lines.slice(closing)].join("\n");
|
|
32976
|
+
}
|
|
32977
|
+
|
|
32978
|
+
// src/commands/landing/folder.ts
|
|
32979
|
+
registerSchema({
|
|
32980
|
+
command: "landing.folder.list",
|
|
32981
|
+
description: "Start here before filing anything: the folders this company already uses, with how many landings each holds. Reuse one of these rather than inventing a near-duplicate name.",
|
|
32982
|
+
args: {}
|
|
32983
|
+
});
|
|
32984
|
+
registerSchema({
|
|
32985
|
+
command: "landing.folder.set",
|
|
32986
|
+
description: "File landings under a folder in Baker (or pull them out with --none). Takes several slugs at once. Applies immediately to pages that are already published, and writes the folder into each page's definition so a page that has never been published is filed the moment it is.",
|
|
32987
|
+
args: {
|
|
32988
|
+
slug: {
|
|
32989
|
+
type: "string",
|
|
32990
|
+
description: "Landing slug (folder under src/pages/). Pass several, space-separated.",
|
|
32991
|
+
required: true
|
|
32992
|
+
},
|
|
32993
|
+
name: {
|
|
32994
|
+
type: "string",
|
|
32995
|
+
description: "Folder to file them under. Run `baker landing folder list` first and reuse an existing one.",
|
|
32996
|
+
required: false
|
|
32997
|
+
},
|
|
32998
|
+
none: { type: "boolean", description: "Pull the landings out of their folder", required: false }
|
|
32999
|
+
}
|
|
33000
|
+
});
|
|
33001
|
+
function fail6(code, message, fix) {
|
|
33002
|
+
process.stderr.write(
|
|
33003
|
+
`${JSON.stringify({ ok: false, error: { code, message, ...fix ? { fix } : {} } }, null, 2)}
|
|
33004
|
+
`
|
|
33005
|
+
);
|
|
33006
|
+
process.exit(2);
|
|
33007
|
+
}
|
|
33008
|
+
function normalizeName(raw) {
|
|
33009
|
+
const collapsed = raw.replace(/\s+/g, " ").trim();
|
|
33010
|
+
if (collapsed === "") {
|
|
33011
|
+
fail6("VALIDATION_ERROR", "Give the folder a name, or pass --none to unfile the pages.");
|
|
33012
|
+
}
|
|
33013
|
+
if (collapsed.length > MAX_LANDING_FOLDER_NAME_LENGTH) {
|
|
33014
|
+
fail6("VALIDATION_ERROR", `Folder names can be at most ${MAX_LANDING_FOLDER_NAME_LENGTH} characters.`);
|
|
33015
|
+
}
|
|
33016
|
+
if (collapsed.includes("/")) {
|
|
33017
|
+
fail6("VALIDATION_ERROR", "Folder names can't contain a slash \u2014 a folder is not part of the page's URL.");
|
|
33018
|
+
}
|
|
33019
|
+
return collapsed;
|
|
33020
|
+
}
|
|
33021
|
+
function parseSlugs(args) {
|
|
33022
|
+
const rest = Array.isArray(args._) ? args._ : [];
|
|
33023
|
+
const all = [args.slug, ...rest].filter((s) => typeof s === "string" && s.length > 0);
|
|
33024
|
+
return [...new Set(all)];
|
|
33025
|
+
}
|
|
33026
|
+
var listCommand13 = defineCommand143({
|
|
33027
|
+
meta: {
|
|
33028
|
+
name: "list",
|
|
33029
|
+
description: "Folders this company already uses, with how many landings each holds. Run this BEFORE naming a folder \u2014 reusing one is the difference between an organised list and the same wall of cards split across near-duplicate names. Example: baker landing folder list"
|
|
33030
|
+
},
|
|
33031
|
+
async run() {
|
|
33032
|
+
const data = await apiGet("/api/landings/folders");
|
|
33033
|
+
writeJson({
|
|
33034
|
+
ok: true,
|
|
33035
|
+
data,
|
|
33036
|
+
hints: [
|
|
33037
|
+
data.folders.length === 0 ? "No folders yet. The first `baker landing folder set` creates one \u2014 pick a name that will still fit the next five pages." : "Reuse one of these names exactly. A near-duplicate ('Masters' vs 'Master IA') splits one group into two."
|
|
33038
|
+
]
|
|
33039
|
+
});
|
|
33040
|
+
}
|
|
33041
|
+
});
|
|
33042
|
+
async function updateDefinitions(projectRoot, slugs, folder) {
|
|
33043
|
+
const updated = [];
|
|
33044
|
+
const problems = [];
|
|
33045
|
+
for (const slug of slugs) {
|
|
33046
|
+
const file = definitionPath(projectRoot, slug);
|
|
33047
|
+
let source;
|
|
33048
|
+
try {
|
|
33049
|
+
source = await readFile23(file, "utf8");
|
|
33050
|
+
} catch {
|
|
33051
|
+
continue;
|
|
33052
|
+
}
|
|
33053
|
+
try {
|
|
33054
|
+
const next = setFolderInFrontmatter(source, folder);
|
|
33055
|
+
if (next !== source) {
|
|
33056
|
+
await writeFile12(file, next, "utf8");
|
|
33057
|
+
}
|
|
33058
|
+
updated.push(slug);
|
|
33059
|
+
} catch (error) {
|
|
33060
|
+
problems.push(`${slug}: ${error instanceof DefinitionFormatError ? error.message : "could not be updated"}`);
|
|
33061
|
+
}
|
|
33062
|
+
}
|
|
33063
|
+
return { updated, problems };
|
|
33064
|
+
}
|
|
33065
|
+
function collisionHint(folder, foldersBefore) {
|
|
33066
|
+
if (folder === null) {
|
|
33067
|
+
return [];
|
|
33068
|
+
}
|
|
33069
|
+
const existed = foldersBefore.some((f) => f.name === folder);
|
|
33070
|
+
if (existed) {
|
|
33071
|
+
return [];
|
|
33072
|
+
}
|
|
33073
|
+
const nearMatch = foldersBefore.find((f) => foldersCollide(f.name, folder));
|
|
33074
|
+
return nearMatch ? [
|
|
33075
|
+
`Created "${folder}", but "${nearMatch.name}" already exists and reads as the same group. If you meant that one, re-run with --name "${nearMatch.name}" \u2014 two names for one idea is the mess folders are meant to fix.`
|
|
33076
|
+
] : [];
|
|
33077
|
+
}
|
|
33078
|
+
var setCommand = defineCommand143({
|
|
33079
|
+
meta: {
|
|
33080
|
+
name: "set",
|
|
33081
|
+
description: "File landings under a folder in Baker. Applies immediately to published pages and writes the folder into each page's definition, so a page that has never been published is filed the moment it is. Run `baker landing folder list` first and reuse an existing folder. Examples: baker landing folder set maii-info maii-dossier --name Masters | baker landing folder set maii-info --none"
|
|
33082
|
+
},
|
|
33083
|
+
args: {
|
|
33084
|
+
slug: {
|
|
33085
|
+
type: "positional",
|
|
33086
|
+
required: true,
|
|
33087
|
+
description: "Landing slug (folder under src/pages/). Space-separate several to file them in one call."
|
|
33088
|
+
},
|
|
33089
|
+
name: { type: "string", description: "Folder to file them under" },
|
|
33090
|
+
none: { type: "boolean", description: "Pull the landings out of their folder", default: false }
|
|
33091
|
+
},
|
|
33092
|
+
async run({ args }) {
|
|
33093
|
+
const slugs = parseSlugs(args);
|
|
33094
|
+
const projectRoot = process.cwd();
|
|
33095
|
+
if (args.none === true && typeof args.name === "string" && args.name.length > 0) {
|
|
33096
|
+
fail6("VALIDATION_ERROR", "Pass either --name or --none, not both.");
|
|
33097
|
+
}
|
|
33098
|
+
if (args.none !== true && (typeof args.name !== "string" || args.name.length === 0)) {
|
|
33099
|
+
fail6("VALIDATION_ERROR", "Missing --name. Pass the folder to file these pages under, or --none to unfile them.");
|
|
33100
|
+
}
|
|
33101
|
+
const folder = args.none === true ? null : normalizeName(String(args.name));
|
|
33102
|
+
const before = await apiGet("/api/landings/folders");
|
|
33103
|
+
const definitions = await updateDefinitions(projectRoot, slugs, folder);
|
|
33104
|
+
const result = await apiPut("/api/landings/folders", { slugs, folder });
|
|
33105
|
+
if (result.notFound.length === slugs.length && definitions.updated.length === 0) {
|
|
33106
|
+
fail6("NOT_FOUND", `No landing matches ${slugs.join(", ")}.`, {
|
|
33107
|
+
action: "Re-run with a slug that exists",
|
|
33108
|
+
explanation: "A slug is the folder name directly under src/pages/.",
|
|
33109
|
+
availableSlugs: await listLandingSlugs(projectRoot)
|
|
33110
|
+
});
|
|
33111
|
+
}
|
|
33112
|
+
const pendingPublish = result.notFound.filter((slug) => definitions.updated.includes(slug));
|
|
33113
|
+
const unknown = result.notFound.filter((slug) => !definitions.updated.includes(slug));
|
|
33114
|
+
writeJson({
|
|
33115
|
+
ok: true,
|
|
33116
|
+
data: {
|
|
33117
|
+
folder,
|
|
33118
|
+
moved: result.moved,
|
|
33119
|
+
unchanged: result.unchanged,
|
|
33120
|
+
pendingPublish,
|
|
33121
|
+
unknown,
|
|
33122
|
+
folders: result.folders
|
|
33123
|
+
},
|
|
33124
|
+
hints: setHints({ folder, before: before.folders, pendingPublish, unknown, problems: definitions.problems })
|
|
33125
|
+
});
|
|
32898
33126
|
}
|
|
33127
|
+
});
|
|
33128
|
+
function setHints({
|
|
33129
|
+
folder,
|
|
33130
|
+
before,
|
|
33131
|
+
pendingPublish,
|
|
33132
|
+
unknown,
|
|
33133
|
+
problems
|
|
33134
|
+
}) {
|
|
33135
|
+
const hints = collisionHint(folder, before);
|
|
33136
|
+
if (pendingPublish.length > 0) {
|
|
33137
|
+
const one = pendingPublish.length === 1;
|
|
33138
|
+
hints.push(
|
|
33139
|
+
`${pendingPublish.join(", ")} ${one ? "has" : "have"} not been published yet, so ${one ? "it is" : "they are"} filed in the page's own definition and will land in "${folder ?? "no folder"}" on the first publish.`
|
|
33140
|
+
);
|
|
33141
|
+
}
|
|
33142
|
+
if (unknown.length > 0) {
|
|
33143
|
+
hints.push(`No landing found for ${unknown.join(", ")} \u2014 neither published nor in this workspace. Check the slug.`);
|
|
33144
|
+
}
|
|
33145
|
+
if (problems.length > 0) {
|
|
33146
|
+
hints.push(
|
|
33147
|
+
`Filed in Baker, but could not record it in ${problems.join("; ")}. The page stays where you just put it; only its birth folder is unrecorded.`
|
|
33148
|
+
);
|
|
33149
|
+
}
|
|
33150
|
+
return hints;
|
|
32899
33151
|
}
|
|
33152
|
+
var folderCommand = defineCommand143({
|
|
33153
|
+
meta: {
|
|
33154
|
+
name: "folder",
|
|
33155
|
+
description: `File landing pages into folders in Baker \u2014 how the user's Landings view is organised when there are more pages than fit on a screen.
|
|
33156
|
+
|
|
33157
|
+
A folder is nothing but the name its landings share: there is no folder to create, and the last page leaving one takes the folder with it. It is NOT part of the page's URL \u2014 filing a page never moves it.
|
|
33158
|
+
|
|
33159
|
+
Two things to know:
|
|
33160
|
+
- Run \`baker landing folder list\` BEFORE naming a folder, and reuse an existing name. A near-duplicate splits one group in two.
|
|
33161
|
+
- The user can also file pages themselves in the dashboard, and their filing wins. \`set\` records the folder in the page's definition too, so a page that has never been published is filed the moment it is.
|
|
33162
|
+
|
|
33163
|
+
Examples:
|
|
33164
|
+
baker landing folder list
|
|
33165
|
+
baker landing folder set maii-info maii-dossier --name Masters
|
|
33166
|
+
baker landing folder set old-promo --none
|
|
33167
|
+
Full guide: __tooling__/docs/tools/baker/landing.md`
|
|
33168
|
+
},
|
|
33169
|
+
subCommands: {
|
|
33170
|
+
list: listCommand13,
|
|
33171
|
+
set: setCommand
|
|
33172
|
+
},
|
|
33173
|
+
default: "list"
|
|
33174
|
+
});
|
|
32900
33175
|
|
|
32901
33176
|
// src/commands/landing/index.ts
|
|
32902
|
-
var landingCommand =
|
|
33177
|
+
var landingCommand = defineCommand144({
|
|
32903
33178
|
meta: {
|
|
32904
33179
|
name: "landing",
|
|
32905
|
-
description: `
|
|
33180
|
+
description: `Tools for landing pages (src/pages/<slug>/): design quality, and how the pages are filed in Baker.
|
|
32906
33181
|
|
|
32907
33182
|
Start here: \`baker landing critique <slug>\` after building or editing a landing.
|
|
32908
33183
|
|
|
32909
33184
|
Subcommands:
|
|
32910
|
-
baker landing critique <slug> \u2014 deterministic design-quality critic (advisory): flags the known AI 'slop' tells (gradient text, overused fonts, side-tab borders, cream palettes, buzzword copy, broken images) tiered block/warn/advisory, respecting the client's BRAND.md. Records the critique the publish quality gate requires \u2014 run it before finishing a landing
|
|
33185
|
+
baker landing critique <slug> \u2014 deterministic design-quality critic (advisory): flags the known AI 'slop' tells (gradient text, overused fonts, side-tab borders, cream palettes, buzzword copy, broken images) tiered block/warn/advisory, respecting the client's BRAND.md. Records the critique the publish quality gate requires \u2014 run it before finishing a landing.
|
|
33186
|
+
baker landing folder list \u2014 the folders this company already uses. Run BEFORE naming a folder and reuse one.
|
|
33187
|
+
baker landing folder set <slug\u2026> --name <folder> | --none \u2014 file pages into a folder in the user's Landings view (never changes a page's URL).`
|
|
32911
33188
|
},
|
|
32912
33189
|
subCommands: {
|
|
32913
|
-
critique: critiqueCommand2
|
|
33190
|
+
critique: critiqueCommand2,
|
|
33191
|
+
folder: folderCommand
|
|
32914
33192
|
}
|
|
32915
33193
|
});
|
|
32916
33194
|
|
|
32917
33195
|
// src/commands/mcp/index.ts
|
|
32918
|
-
import { defineCommand as
|
|
33196
|
+
import { defineCommand as defineCommand145 } from "citty";
|
|
32919
33197
|
|
|
32920
33198
|
// src/commands/mcp/platforms.ts
|
|
32921
33199
|
function readsKey(label) {
|
|
@@ -32970,7 +33248,7 @@ function parseHeaders(raw) {
|
|
|
32970
33248
|
}
|
|
32971
33249
|
return Object.keys(headers).length > 0 ? headers : void 0;
|
|
32972
33250
|
}
|
|
32973
|
-
function
|
|
33251
|
+
function fail7(err) {
|
|
32974
33252
|
if (err instanceof ApiError) {
|
|
32975
33253
|
writeJson({ ok: false, error: { code: err.code, message: err.message } });
|
|
32976
33254
|
process.exit(1);
|
|
@@ -32984,7 +33262,7 @@ registerSchema({
|
|
|
32984
33262
|
description: "List everything this chat can reach: managed integrations (Attio, Slack, Gmail, Google Sheets, \u2026), custom MCP servers, and the platforms the company signed in to (HubSpot, Google Ads, GA4, Search Console, Tag Manager) which you read through their own `baker` commands. Start here when the user mentions an external tool or platform.",
|
|
32985
33263
|
args: {}
|
|
32986
33264
|
});
|
|
32987
|
-
var connectedCommand =
|
|
33265
|
+
var connectedCommand = defineCommand145({
|
|
32988
33266
|
meta: {
|
|
32989
33267
|
name: "connected",
|
|
32990
33268
|
description: `Everything this chat can reach \u2014 managed integrations, custom MCP servers, and connected platforms.
|
|
@@ -33034,7 +33312,7 @@ A tool or platform the user names that is NOT listed anywhere here is simply not
|
|
|
33034
33312
|
hints
|
|
33035
33313
|
});
|
|
33036
33314
|
} catch (err) {
|
|
33037
|
-
|
|
33315
|
+
fail7(err);
|
|
33038
33316
|
}
|
|
33039
33317
|
}
|
|
33040
33318
|
});
|
|
@@ -33043,7 +33321,7 @@ registerSchema({
|
|
|
33043
33321
|
description: "List the custom MCP servers this company's chats see (org + company + your own user scope).",
|
|
33044
33322
|
args: {}
|
|
33045
33323
|
});
|
|
33046
|
-
var
|
|
33324
|
+
var listCommand14 = defineCommand145({
|
|
33047
33325
|
meta: { name: "list", description: "List custom MCP servers visible to this company's chats." },
|
|
33048
33326
|
run: async () => {
|
|
33049
33327
|
try {
|
|
@@ -33062,7 +33340,7 @@ var listCommand13 = defineCommand144({
|
|
|
33062
33340
|
} : {}
|
|
33063
33341
|
});
|
|
33064
33342
|
} catch (err) {
|
|
33065
|
-
|
|
33343
|
+
fail7(err);
|
|
33066
33344
|
}
|
|
33067
33345
|
}
|
|
33068
33346
|
});
|
|
@@ -33080,7 +33358,7 @@ registerSchema({
|
|
|
33080
33358
|
header: { type: "string", description: 'Auth header "Key: Value" (repeatable)', required: false }
|
|
33081
33359
|
}
|
|
33082
33360
|
});
|
|
33083
|
-
var addCommand =
|
|
33361
|
+
var addCommand = defineCommand145({
|
|
33084
33362
|
meta: {
|
|
33085
33363
|
name: "add",
|
|
33086
33364
|
description: `Register a custom MCP server. Tools appear as mcp__<name>__* on the NEXT message.
|
|
@@ -33123,7 +33401,7 @@ Examples:
|
|
|
33123
33401
|
]
|
|
33124
33402
|
});
|
|
33125
33403
|
} catch (err) {
|
|
33126
|
-
|
|
33404
|
+
fail7(err);
|
|
33127
33405
|
}
|
|
33128
33406
|
}
|
|
33129
33407
|
});
|
|
@@ -33132,7 +33410,7 @@ registerSchema({
|
|
|
33132
33410
|
description: "Remove a company custom MCP server by name.",
|
|
33133
33411
|
args: { name: { type: "string", description: "Server name to remove", required: true } }
|
|
33134
33412
|
});
|
|
33135
|
-
var removeCommand4 =
|
|
33413
|
+
var removeCommand4 = defineCommand145({
|
|
33136
33414
|
meta: {
|
|
33137
33415
|
name: "remove",
|
|
33138
33416
|
description: `Remove a company custom MCP server by name.
|
|
@@ -33150,11 +33428,11 @@ Example:
|
|
|
33150
33428
|
});
|
|
33151
33429
|
writeJson({ ok: true, data });
|
|
33152
33430
|
} catch (err) {
|
|
33153
|
-
|
|
33431
|
+
fail7(err);
|
|
33154
33432
|
}
|
|
33155
33433
|
}
|
|
33156
33434
|
});
|
|
33157
|
-
var mcpCommand =
|
|
33435
|
+
var mcpCommand = defineCommand145({
|
|
33158
33436
|
meta: {
|
|
33159
33437
|
name: "mcp",
|
|
33160
33438
|
description: `Third-party tools for this company \u2014 see what's connected, register custom HTTPS MCP endpoints.
|
|
@@ -33173,17 +33451,17 @@ Full guide: __tooling__/docs/tools/baker/mcp.md`
|
|
|
33173
33451
|
},
|
|
33174
33452
|
subCommands: {
|
|
33175
33453
|
connected: connectedCommand,
|
|
33176
|
-
list:
|
|
33454
|
+
list: listCommand14,
|
|
33177
33455
|
add: addCommand,
|
|
33178
33456
|
remove: removeCommand4
|
|
33179
33457
|
}
|
|
33180
33458
|
});
|
|
33181
33459
|
|
|
33182
33460
|
// src/commands/research/index.ts
|
|
33183
|
-
import { defineCommand as
|
|
33461
|
+
import { defineCommand as defineCommand156 } from "citty";
|
|
33184
33462
|
|
|
33185
33463
|
// src/commands/research/advertisers.ts
|
|
33186
|
-
import { defineCommand as
|
|
33464
|
+
import { defineCommand as defineCommand146 } from "citty";
|
|
33187
33465
|
|
|
33188
33466
|
// src/commands/research/output.ts
|
|
33189
33467
|
var RESEARCH_DATA_NOTE = "Estimates based on third-party SERP data \u2014 not exact figures. Use for directional insights, not precise measurement.";
|
|
@@ -33296,7 +33574,7 @@ var FIELDS3 = {
|
|
|
33296
33574
|
etv: "Estimated traffic value (USD)",
|
|
33297
33575
|
visibility: "SERP visibility score (0-1)"
|
|
33298
33576
|
};
|
|
33299
|
-
var advertisersCommand =
|
|
33577
|
+
var advertisersCommand = defineCommand146({
|
|
33300
33578
|
meta: {
|
|
33301
33579
|
name: "advertisers",
|
|
33302
33580
|
description: `Find domains competing for a keyword in Google SERPs.
|
|
@@ -33343,7 +33621,7 @@ Examples:
|
|
|
33343
33621
|
});
|
|
33344
33622
|
|
|
33345
33623
|
// src/commands/research/autocomplete.ts
|
|
33346
|
-
import { defineCommand as
|
|
33624
|
+
import { defineCommand as defineCommand147 } from "citty";
|
|
33347
33625
|
registerSchema({
|
|
33348
33626
|
command: "research.autocomplete",
|
|
33349
33627
|
description: "Get Google Autocomplete suggestions for a seed keyword. Useful for keyword expansion and discovering what people actually search for. IMPORTANT: If --location and --language are omitted, defaults to United States (us) and English (en).",
|
|
@@ -33366,7 +33644,7 @@ registerSchema({
|
|
|
33366
33644
|
var FIELDS4 = {
|
|
33367
33645
|
suggestion: "Autocomplete suggestion from Google"
|
|
33368
33646
|
};
|
|
33369
|
-
var autocompleteCommand =
|
|
33647
|
+
var autocompleteCommand = defineCommand147({
|
|
33370
33648
|
meta: {
|
|
33371
33649
|
name: "autocomplete",
|
|
33372
33650
|
description: `Get Google Autocomplete suggestions for keyword expansion.
|
|
@@ -33412,7 +33690,7 @@ Examples:
|
|
|
33412
33690
|
});
|
|
33413
33691
|
|
|
33414
33692
|
// src/commands/research/countries.ts
|
|
33415
|
-
import { defineCommand as
|
|
33693
|
+
import { defineCommand as defineCommand148 } from "citty";
|
|
33416
33694
|
registerSchema({
|
|
33417
33695
|
command: "research.countries",
|
|
33418
33696
|
description: "List all supported country codes for --location flag in research commands.",
|
|
@@ -33469,7 +33747,7 @@ var FIELDS5 = {
|
|
|
33469
33747
|
code: "Country code to pass as --location",
|
|
33470
33748
|
name: "Country name"
|
|
33471
33749
|
};
|
|
33472
|
-
var countriesCommand =
|
|
33750
|
+
var countriesCommand = defineCommand148({
|
|
33473
33751
|
meta: {
|
|
33474
33752
|
name: "countries",
|
|
33475
33753
|
description: "List all supported country codes for --location flag."
|
|
@@ -33480,7 +33758,7 @@ var countriesCommand = defineCommand147({
|
|
|
33480
33758
|
});
|
|
33481
33759
|
|
|
33482
33760
|
// src/commands/research/intent.ts
|
|
33483
|
-
import { defineCommand as
|
|
33761
|
+
import { defineCommand as defineCommand149 } from "citty";
|
|
33484
33762
|
registerSchema({
|
|
33485
33763
|
command: "research.intent",
|
|
33486
33764
|
description: "Classify Google Search intent for keywords. Determines if someone searching is looking to buy, research, or navigate. IMPORTANT: If --language is omitted, defaults to English (en). The response includes a query_context object showing which language was used.",
|
|
@@ -33503,7 +33781,7 @@ var FIELDS6 = {
|
|
|
33503
33781
|
intent: "Primary Google Search intent: informational, navigational, commercial, transactional",
|
|
33504
33782
|
probability: "Confidence score 0.0-1.0"
|
|
33505
33783
|
};
|
|
33506
|
-
var intentCommand =
|
|
33784
|
+
var intentCommand = defineCommand149({
|
|
33507
33785
|
meta: {
|
|
33508
33786
|
name: "intent",
|
|
33509
33787
|
description: `Classify Google Search intent for keywords. Returns intent type and confidence.
|
|
@@ -33551,7 +33829,7 @@ Examples:
|
|
|
33551
33829
|
});
|
|
33552
33830
|
|
|
33553
33831
|
// src/commands/research/keyword-gap.ts
|
|
33554
|
-
import { defineCommand as
|
|
33832
|
+
import { defineCommand as defineCommand150 } from "citty";
|
|
33555
33833
|
registerSchema({
|
|
33556
33834
|
command: "research.keyword-gap",
|
|
33557
33835
|
description: "Find keywords a competitor ranks for (organic or paid) that you don't. Discovers expansion opportunities. IMPORTANT: If --location and --language are omitted, defaults to United States (us) and English (en). The response includes a query_context object showing which location/language were used.",
|
|
@@ -33580,7 +33858,7 @@ var FIELDS7 = {
|
|
|
33580
33858
|
cpc: "Cost per click USD",
|
|
33581
33859
|
their_position: "Competitor's ranking position"
|
|
33582
33860
|
};
|
|
33583
|
-
var keywordGapCommand =
|
|
33861
|
+
var keywordGapCommand = defineCommand150({
|
|
33584
33862
|
meta: {
|
|
33585
33863
|
name: "keyword-gap",
|
|
33586
33864
|
description: `Find keywords a competitor has that you don't. Supports pagination via --offset.
|
|
@@ -33654,7 +33932,7 @@ Examples:
|
|
|
33654
33932
|
});
|
|
33655
33933
|
|
|
33656
33934
|
// src/commands/research/keywords-for-site.ts
|
|
33657
|
-
import { defineCommand as
|
|
33935
|
+
import { defineCommand as defineCommand151 } from "citty";
|
|
33658
33936
|
registerSchema({
|
|
33659
33937
|
command: "research.keywords-for-site",
|
|
33660
33938
|
description: "Get keywords a competitor targets in Google. Use --type paid to see only paid keywords, --type organic for organic only. IMPORTANT: If --location and --language are omitted, defaults to United States (us) and English (en). The response includes a query_context object showing which location/language were used.",
|
|
@@ -33687,7 +33965,7 @@ var FIELDS8 = {
|
|
|
33687
33965
|
competition: "LOW, MEDIUM, or HIGH",
|
|
33688
33966
|
competition_index: "Competition score 0-100"
|
|
33689
33967
|
};
|
|
33690
|
-
var keywordsForSiteCommand =
|
|
33968
|
+
var keywordsForSiteCommand = defineCommand151({
|
|
33691
33969
|
meta: {
|
|
33692
33970
|
name: "keywords-for-site",
|
|
33693
33971
|
description: `Get keywords a competitor targets in Google. Use --type to filter paid/organic.
|
|
@@ -33740,7 +34018,7 @@ Examples:
|
|
|
33740
34018
|
});
|
|
33741
34019
|
|
|
33742
34020
|
// src/commands/research/languages.ts
|
|
33743
|
-
import { defineCommand as
|
|
34021
|
+
import { defineCommand as defineCommand152 } from "citty";
|
|
33744
34022
|
registerSchema({
|
|
33745
34023
|
command: "research.languages",
|
|
33746
34024
|
description: "List all supported language codes for --language flag in research commands.",
|
|
@@ -33770,7 +34048,7 @@ var FIELDS9 = {
|
|
|
33770
34048
|
code: "Language code to pass as --language",
|
|
33771
34049
|
name: "Language name (also accepted by --language)"
|
|
33772
34050
|
};
|
|
33773
|
-
var languagesCommand2 =
|
|
34051
|
+
var languagesCommand2 = defineCommand152({
|
|
33774
34052
|
meta: {
|
|
33775
34053
|
name: "languages",
|
|
33776
34054
|
description: "List all supported language codes for --language flag."
|
|
@@ -33781,7 +34059,7 @@ var languagesCommand2 = defineCommand151({
|
|
|
33781
34059
|
});
|
|
33782
34060
|
|
|
33783
34061
|
// src/commands/research/lighthouse.ts
|
|
33784
|
-
import { defineCommand as
|
|
34062
|
+
import { defineCommand as defineCommand153 } from "citty";
|
|
33785
34063
|
registerSchema({
|
|
33786
34064
|
command: "research.lighthouse",
|
|
33787
34065
|
description: "Landing page performance audit. Returns metrics that affect Google Ads Quality Score and CPC.",
|
|
@@ -33800,7 +34078,7 @@ var FIELDS10 = {
|
|
|
33800
34078
|
speed_index_ms: "Speed Index in ms (good: < 3400)",
|
|
33801
34079
|
interactive_ms: "Time to Interactive in ms (good: < 3800)"
|
|
33802
34080
|
};
|
|
33803
|
-
var lighthouseCommand =
|
|
34081
|
+
var lighthouseCommand = defineCommand153({
|
|
33804
34082
|
meta: {
|
|
33805
34083
|
name: "lighthouse",
|
|
33806
34084
|
description: `Landing page performance audit. Metrics affecting Google Ads Quality Score.
|
|
@@ -33838,7 +34116,7 @@ Examples:
|
|
|
33838
34116
|
});
|
|
33839
34117
|
|
|
33840
34118
|
// src/commands/research/relevant-pages.ts
|
|
33841
|
-
import { defineCommand as
|
|
34119
|
+
import { defineCommand as defineCommand154 } from "citty";
|
|
33842
34120
|
registerSchema({
|
|
33843
34121
|
command: "research.relevant-pages",
|
|
33844
34122
|
description: "Get the top pages of a competitor domain with organic traffic and ranking data. Shows which pages drive the most traffic. IMPORTANT: If --location and --language are omitted, defaults to United States (us) and English (en).",
|
|
@@ -33864,7 +34142,7 @@ var FIELDS11 = {
|
|
|
33864
34142
|
keywords: "Total organic keywords the page ranks for",
|
|
33865
34143
|
top_10: "Keywords in positions 1-10"
|
|
33866
34144
|
};
|
|
33867
|
-
var relevantPagesCommand =
|
|
34145
|
+
var relevantPagesCommand = defineCommand154({
|
|
33868
34146
|
meta: {
|
|
33869
34147
|
name: "relevant-pages",
|
|
33870
34148
|
description: `Get the top pages of a competitor domain with traffic data.
|
|
@@ -33910,7 +34188,7 @@ Examples:
|
|
|
33910
34188
|
});
|
|
33911
34189
|
|
|
33912
34190
|
// src/commands/research/web.ts
|
|
33913
|
-
import { defineCommand as
|
|
34191
|
+
import { defineCommand as defineCommand155 } from "citty";
|
|
33914
34192
|
registerSchema({
|
|
33915
34193
|
command: "research.web",
|
|
33916
34194
|
description: "Search the web with AI to answer marketing questions \u2014 competitors, ICP, pricing, pain points, market trends. Three depth levels: medium (quick, default), high (thorough), xhigh (exhaustive deep research).",
|
|
@@ -33961,7 +34239,7 @@ async function runDeepResearch(question) {
|
|
|
33961
34239
|
}
|
|
33962
34240
|
throw new Error("Deep research timed out");
|
|
33963
34241
|
}
|
|
33964
|
-
var webCommand =
|
|
34242
|
+
var webCommand = defineCommand155({
|
|
33965
34243
|
meta: {
|
|
33966
34244
|
name: "web",
|
|
33967
34245
|
description: `Search the web with AI to answer any open-ended marketing question. Uses live internet data via Google Search.
|
|
@@ -34021,7 +34299,7 @@ Examples:
|
|
|
34021
34299
|
});
|
|
34022
34300
|
|
|
34023
34301
|
// src/commands/research/index.ts
|
|
34024
|
-
var researchCommand =
|
|
34302
|
+
var researchCommand = defineCommand156({
|
|
34025
34303
|
meta: {
|
|
34026
34304
|
name: "research",
|
|
34027
34305
|
description: `Competitive intelligence and AI-powered research commands.
|
|
@@ -34062,10 +34340,10 @@ Full guide: __tooling__/docs/tools/baker/research.md`
|
|
|
34062
34340
|
});
|
|
34063
34341
|
|
|
34064
34342
|
// src/commands/scheduled-actions/index.ts
|
|
34065
|
-
import { defineCommand as
|
|
34343
|
+
import { defineCommand as defineCommand163 } from "citty";
|
|
34066
34344
|
|
|
34067
34345
|
// src/commands/scheduled-actions/create.ts
|
|
34068
|
-
import { defineCommand as
|
|
34346
|
+
import { defineCommand as defineCommand157 } from "citty";
|
|
34069
34347
|
|
|
34070
34348
|
// src/commands/scheduled-actions/shared.ts
|
|
34071
34349
|
var TEMP_SCHEDULED_ACTION_PREFIX = "temp_sched_";
|
|
@@ -34180,7 +34458,7 @@ registerSchema({
|
|
|
34180
34458
|
prompt: { type: "string", description: "Additional prompt instructions for the spawned agent", required: false }
|
|
34181
34459
|
}
|
|
34182
34460
|
});
|
|
34183
|
-
var createCommand2 =
|
|
34461
|
+
var createCommand2 = defineCommand157({
|
|
34184
34462
|
meta: {
|
|
34185
34463
|
name: "create",
|
|
34186
34464
|
description: 'Stage a scheduled action. Example: baker scheduled-actions create --name "Weekly report" --description "..." --cron "0 9 * * MON"'
|
|
@@ -34229,7 +34507,7 @@ var createCommand2 = defineCommand156({
|
|
|
34229
34507
|
});
|
|
34230
34508
|
|
|
34231
34509
|
// src/commands/scheduled-actions/delete.ts
|
|
34232
|
-
import { defineCommand as
|
|
34510
|
+
import { defineCommand as defineCommand158 } from "citty";
|
|
34233
34511
|
registerSchema({
|
|
34234
34512
|
command: "scheduled-actions.delete",
|
|
34235
34513
|
description: "Stage deletion of a published scheduled action or cancellation of a temp_sched_* draft creation.",
|
|
@@ -34237,7 +34515,7 @@ registerSchema({
|
|
|
34237
34515
|
id: { type: "string", description: "Published scheduled action ID or temp_sched_* draft ID", required: true }
|
|
34238
34516
|
}
|
|
34239
34517
|
});
|
|
34240
|
-
var deleteCommand2 =
|
|
34518
|
+
var deleteCommand2 = defineCommand158({
|
|
34241
34519
|
meta: {
|
|
34242
34520
|
name: "delete",
|
|
34243
34521
|
description: "Stage scheduled action deletion. Example: baker scheduled-actions delete <id-or-temp_sched_id>"
|
|
@@ -34266,7 +34544,7 @@ var deleteCommand2 = defineCommand157({
|
|
|
34266
34544
|
});
|
|
34267
34545
|
|
|
34268
34546
|
// src/commands/scheduled-actions/get.ts
|
|
34269
|
-
import { defineCommand as
|
|
34547
|
+
import { defineCommand as defineCommand159 } from "citty";
|
|
34270
34548
|
registerSchema({
|
|
34271
34549
|
command: "scheduled-actions.get",
|
|
34272
34550
|
description: "Get a published scheduled action or a temp_sched_* draft-created scheduled action.",
|
|
@@ -34275,7 +34553,7 @@ registerSchema({
|
|
|
34275
34553
|
chat: { type: "string", description: CHAT_READ_ARG.description, required: false }
|
|
34276
34554
|
}
|
|
34277
34555
|
});
|
|
34278
|
-
var getCommand3 =
|
|
34556
|
+
var getCommand3 = defineCommand159({
|
|
34279
34557
|
meta: {
|
|
34280
34558
|
name: "get",
|
|
34281
34559
|
description: "Get a scheduled action. Example: baker scheduled-actions get <id-or-temp_sched_id>"
|
|
@@ -34314,7 +34592,7 @@ var getCommand3 = defineCommand158({
|
|
|
34314
34592
|
});
|
|
34315
34593
|
|
|
34316
34594
|
// src/commands/scheduled-actions/list.ts
|
|
34317
|
-
import { defineCommand as
|
|
34595
|
+
import { defineCommand as defineCommand160 } from "citty";
|
|
34318
34596
|
registerSchema({
|
|
34319
34597
|
command: "scheduled-actions.list",
|
|
34320
34598
|
description: "List published scheduled actions. Includes draft state when BAKER_CHAT_ID is set, or --chat <id> to read an earlier chat's staged schedules instead.",
|
|
@@ -34322,7 +34600,7 @@ registerSchema({
|
|
|
34322
34600
|
chat: { type: "string", description: CHAT_READ_ARG.description, required: false }
|
|
34323
34601
|
}
|
|
34324
34602
|
});
|
|
34325
|
-
var
|
|
34603
|
+
var listCommand15 = defineCommand160({
|
|
34326
34604
|
meta: {
|
|
34327
34605
|
name: "list",
|
|
34328
34606
|
description: "List scheduled actions. Includes staged draft ops when BAKER_CHAT_ID is set, or --chat <id> to read an earlier chat's staged schedules instead."
|
|
@@ -34345,7 +34623,7 @@ var listCommand14 = defineCommand159({
|
|
|
34345
34623
|
});
|
|
34346
34624
|
|
|
34347
34625
|
// src/commands/scheduled-actions/trigger.ts
|
|
34348
|
-
import { defineCommand as
|
|
34626
|
+
import { defineCommand as defineCommand161 } from "citty";
|
|
34349
34627
|
registerSchema({
|
|
34350
34628
|
command: "scheduled-actions.trigger",
|
|
34351
34629
|
description: "Immediately trigger a published scheduled action. Does not require BAKER_CHAT_ID and rejects temp_sched_* IDs.",
|
|
@@ -34353,7 +34631,7 @@ registerSchema({
|
|
|
34353
34631
|
id: { type: "string", description: "Published scheduled action ID", required: true }
|
|
34354
34632
|
}
|
|
34355
34633
|
});
|
|
34356
|
-
var triggerCommand =
|
|
34634
|
+
var triggerCommand = defineCommand161({
|
|
34357
34635
|
meta: {
|
|
34358
34636
|
name: "trigger",
|
|
34359
34637
|
description: "Immediately trigger a published scheduled action. Example: baker scheduled-actions trigger <id>"
|
|
@@ -34390,7 +34668,7 @@ var triggerCommand = defineCommand160({
|
|
|
34390
34668
|
});
|
|
34391
34669
|
|
|
34392
34670
|
// src/commands/scheduled-actions/update.ts
|
|
34393
|
-
import { defineCommand as
|
|
34671
|
+
import { defineCommand as defineCommand162 } from "citty";
|
|
34394
34672
|
registerSchema({
|
|
34395
34673
|
command: "scheduled-actions.update",
|
|
34396
34674
|
description: "Stage an update to a published scheduled action or temp_sched_* draft-created scheduled action.",
|
|
@@ -34415,7 +34693,7 @@ registerSchema({
|
|
|
34415
34693
|
prompt: { type: "string", description: "Replacement additional spawned-agent instructions", required: false }
|
|
34416
34694
|
}
|
|
34417
34695
|
});
|
|
34418
|
-
var updateCommand2 =
|
|
34696
|
+
var updateCommand2 = defineCommand162({
|
|
34419
34697
|
meta: {
|
|
34420
34698
|
name: "update",
|
|
34421
34699
|
description: "Stage a scheduled action update. Example: baker scheduled-actions update <id> --enabled false"
|
|
@@ -34486,7 +34764,7 @@ var updateCommand2 = defineCommand161({
|
|
|
34486
34764
|
});
|
|
34487
34765
|
|
|
34488
34766
|
// src/commands/scheduled-actions/index.ts
|
|
34489
|
-
var scheduledActionsCommand =
|
|
34767
|
+
var scheduledActionsCommand = defineCommand163({
|
|
34490
34768
|
meta: {
|
|
34491
34769
|
name: "scheduled-actions",
|
|
34492
34770
|
description: `Manage Scheduled Actions. Subcommands: list, get, create, update, delete, trigger.
|
|
@@ -34503,7 +34781,7 @@ Examples:
|
|
|
34503
34781
|
Full guide: __tooling__/docs/tools/baker/scheduled-actions.md`
|
|
34504
34782
|
},
|
|
34505
34783
|
subCommands: {
|
|
34506
|
-
list:
|
|
34784
|
+
list: listCommand15,
|
|
34507
34785
|
get: getCommand3,
|
|
34508
34786
|
create: createCommand2,
|
|
34509
34787
|
update: updateCommand2,
|
|
@@ -34513,14 +34791,14 @@ Full guide: __tooling__/docs/tools/baker/scheduled-actions.md`
|
|
|
34513
34791
|
});
|
|
34514
34792
|
|
|
34515
34793
|
// src/commands/schema.ts
|
|
34516
|
-
import { defineCommand as
|
|
34794
|
+
import { defineCommand as defineCommand164 } from "citty";
|
|
34517
34795
|
function narrowToFamily(commandName, available) {
|
|
34518
34796
|
const segments = commandName.split(".");
|
|
34519
34797
|
const prefix = segments[0] === "ads" && segments[1] ? `ads.${segments[1]}.` : `${segments[0]}.`;
|
|
34520
34798
|
const siblings = available.filter((name) => name.startsWith(prefix));
|
|
34521
34799
|
return siblings.length > 0 ? siblings : available;
|
|
34522
34800
|
}
|
|
34523
|
-
var schemaCommand =
|
|
34801
|
+
var schemaCommand = defineCommand164({
|
|
34524
34802
|
meta: {
|
|
34525
34803
|
name: "schema",
|
|
34526
34804
|
description: "Inspect command argument schemas (for AI agent introspection). Lists all commands if no argument given. Example: baker schema images.search"
|
|
@@ -34564,10 +34842,10 @@ var schemaCommand = defineCommand163({
|
|
|
34564
34842
|
});
|
|
34565
34843
|
|
|
34566
34844
|
// src/commands/tag-manager/index.ts
|
|
34567
|
-
import { defineCommand as
|
|
34845
|
+
import { defineCommand as defineCommand168 } from "citty";
|
|
34568
34846
|
|
|
34569
34847
|
// src/commands/tag-manager/draft.ts
|
|
34570
|
-
import { defineCommand as
|
|
34848
|
+
import { defineCommand as defineCommand165 } from "citty";
|
|
34571
34849
|
|
|
34572
34850
|
// src/commands/tag-manager/shared.ts
|
|
34573
34851
|
import { readFileSync as readFileSync13 } from "fs";
|
|
@@ -34634,10 +34912,10 @@ async function stageOp4(op) {
|
|
|
34634
34912
|
handleError4(err);
|
|
34635
34913
|
}
|
|
34636
34914
|
}
|
|
34637
|
-
async function draftAction3(
|
|
34915
|
+
async function draftAction3(path29, body, chat) {
|
|
34638
34916
|
const chatId = resolveChatId(chat);
|
|
34639
34917
|
try {
|
|
34640
|
-
const data = await apiPost(
|
|
34918
|
+
const data = await apiPost(path29, { chatId, ...body });
|
|
34641
34919
|
writeJsonEnvelope({ ok: true, data });
|
|
34642
34920
|
return data;
|
|
34643
34921
|
} catch (err) {
|
|
@@ -34690,13 +34968,13 @@ registerSchema({
|
|
|
34690
34968
|
chat: { type: "string", description: CHAT_READ_ARG.description, required: false }
|
|
34691
34969
|
}
|
|
34692
34970
|
});
|
|
34693
|
-
var draftCommand4 =
|
|
34971
|
+
var draftCommand4 = defineCommand165({
|
|
34694
34972
|
meta: {
|
|
34695
34973
|
name: "draft",
|
|
34696
34974
|
description: "List, show, amend, remove, or clear staged Tag Manager changes for this chat. `list` and `show` take --chat <id> to read an earlier chat's changes instead."
|
|
34697
34975
|
},
|
|
34698
34976
|
subCommands: {
|
|
34699
|
-
list:
|
|
34977
|
+
list: defineCommand165({
|
|
34700
34978
|
meta: {
|
|
34701
34979
|
name: "list",
|
|
34702
34980
|
description: "Review everything staged on this chat (--json for the raw envelope)"
|
|
@@ -34709,7 +34987,7 @@ var draftCommand4 = defineCommand164({
|
|
|
34709
34987
|
await draftList2(args.json === true, args.chat);
|
|
34710
34988
|
}
|
|
34711
34989
|
}),
|
|
34712
|
-
show:
|
|
34990
|
+
show: defineCommand165({
|
|
34713
34991
|
meta: {
|
|
34714
34992
|
name: "show",
|
|
34715
34993
|
description: "Print the full staged payload for one change \u2014 the receipt to verify it looks right before publish (never truncated)."
|
|
@@ -34726,7 +35004,7 @@ var draftCommand4 = defineCommand164({
|
|
|
34726
35004
|
);
|
|
34727
35005
|
}
|
|
34728
35006
|
}),
|
|
34729
|
-
amend:
|
|
35007
|
+
amend: defineCommand165({
|
|
34730
35008
|
meta: {
|
|
34731
35009
|
name: "amend",
|
|
34732
35010
|
description: "Update a staged change in place \u2014 merges a JSON patch into its payload (objects deep-merge, null deletes a key, arrays/scalars replace) and re-validates. Use this instead of remove + re-create."
|
|
@@ -34743,7 +35021,7 @@ var draftCommand4 = defineCommand164({
|
|
|
34743
35021
|
});
|
|
34744
35022
|
}
|
|
34745
35023
|
}),
|
|
34746
|
-
remove:
|
|
35024
|
+
remove: defineCommand165({
|
|
34747
35025
|
meta: { name: "remove", description: "Remove one staged change (cascades to anything depending on it)" },
|
|
34748
35026
|
args: { ref: { type: "positional", description: "Staged ref (gtm_temp_*) or target", required: false } },
|
|
34749
35027
|
run: async ({ args }) => {
|
|
@@ -34752,7 +35030,7 @@ var draftCommand4 = defineCommand164({
|
|
|
34752
35030
|
});
|
|
34753
35031
|
}
|
|
34754
35032
|
}),
|
|
34755
|
-
clear:
|
|
35033
|
+
clear: defineCommand165({
|
|
34756
35034
|
meta: { name: "clear", description: "Discard all Tag Manager changes staged on this chat" },
|
|
34757
35035
|
run: async () => {
|
|
34758
35036
|
await draftAction3("/api/tag-manager/draft/clear", {});
|
|
@@ -34762,7 +35040,7 @@ var draftCommand4 = defineCommand164({
|
|
|
34762
35040
|
});
|
|
34763
35041
|
|
|
34764
35042
|
// src/commands/tag-manager/read.ts
|
|
34765
|
-
import { defineCommand as
|
|
35043
|
+
import { defineCommand as defineCommand166 } from "citty";
|
|
34766
35044
|
registerSchema({
|
|
34767
35045
|
command: "tagManager.containers",
|
|
34768
35046
|
description: "List the Google Tag Manager containers this company's connection can reach. Every container the company connected is flagged `connected: true` \u2014 there can be several, and Baker may read and change all of them. Start here to confirm which containers you are managing.",
|
|
@@ -34803,7 +35081,7 @@ function containersHints(containers) {
|
|
|
34803
35081
|
}))
|
|
34804
35082
|
});
|
|
34805
35083
|
}
|
|
34806
|
-
var containersCommand =
|
|
35084
|
+
var containersCommand = defineCommand166({
|
|
34807
35085
|
meta: {
|
|
34808
35086
|
name: "containers",
|
|
34809
35087
|
description: `List Tag Manager containers reachable by this company's connection.
|
|
@@ -34820,7 +35098,7 @@ Start here:
|
|
|
34820
35098
|
}
|
|
34821
35099
|
}
|
|
34822
35100
|
});
|
|
34823
|
-
var readCommand =
|
|
35101
|
+
var readCommand = defineCommand166({
|
|
34824
35102
|
meta: {
|
|
34825
35103
|
name: "read",
|
|
34826
35104
|
description: `Read the current contents of the Tag Manager container \u2014 always do this before staging changes.
|
|
@@ -34862,7 +35140,7 @@ Examples:
|
|
|
34862
35140
|
});
|
|
34863
35141
|
|
|
34864
35142
|
// src/commands/tag-manager/write-commands.ts
|
|
34865
|
-
import { defineCommand as
|
|
35143
|
+
import { defineCommand as defineCommand167 } from "citty";
|
|
34866
35144
|
var CONTAINER_ARG_DESCRIPTION = "Numeric container id (optional only when one container is connected \u2014 run `baker tag-manager containers`)";
|
|
34867
35145
|
var ENTITIES = [
|
|
34868
35146
|
{
|
|
@@ -34918,10 +35196,10 @@ for (const { entity, noun, createHint } of ENTITIES) {
|
|
|
34918
35196
|
});
|
|
34919
35197
|
}
|
|
34920
35198
|
function entityCommand(entity, noun, example) {
|
|
34921
|
-
return
|
|
35199
|
+
return defineCommand167({
|
|
34922
35200
|
meta: { name: entity, description: `Stage ${noun} changes on this chat's Tag Manager draft` },
|
|
34923
35201
|
subCommands: {
|
|
34924
|
-
create:
|
|
35202
|
+
create: defineCommand167({
|
|
34925
35203
|
meta: {
|
|
34926
35204
|
name: "create",
|
|
34927
35205
|
description: `Stage a new ${noun}
|
|
@@ -34943,7 +35221,7 @@ Examples:
|
|
|
34943
35221
|
});
|
|
34944
35222
|
}
|
|
34945
35223
|
}),
|
|
34946
|
-
update:
|
|
35224
|
+
update: defineCommand167({
|
|
34947
35225
|
meta: {
|
|
34948
35226
|
name: "update",
|
|
34949
35227
|
description: `Stage an update to an existing ${noun} (pass its id or path)`
|
|
@@ -34963,7 +35241,7 @@ Examples:
|
|
|
34963
35241
|
});
|
|
34964
35242
|
}
|
|
34965
35243
|
}),
|
|
34966
|
-
delete:
|
|
35244
|
+
delete: defineCommand167({
|
|
34967
35245
|
meta: { name: "delete", description: `Stage the deletion of a ${noun} (pass its id or path)` },
|
|
34968
35246
|
args: {
|
|
34969
35247
|
id: { type: "positional", description: `${noun} id or path`, required: false },
|
|
@@ -34984,7 +35262,7 @@ var exampleFor = (entity) => ENTITIES.find((e) => e.entity === entity)?.example
|
|
|
34984
35262
|
var tagCommand = entityCommand("tag", "tag", exampleFor("tag"));
|
|
34985
35263
|
var triggerCommand2 = entityCommand("trigger", "trigger", exampleFor("trigger"));
|
|
34986
35264
|
var variableCommand = entityCommand("variable", "variable", exampleFor("variable"));
|
|
34987
|
-
var
|
|
35265
|
+
var folderCommand2 = entityCommand("folder", "folder", exampleFor("folder"));
|
|
34988
35266
|
registerSchema({
|
|
34989
35267
|
command: "tagManager.builtin",
|
|
34990
35268
|
description: "Enable or disable Tag Manager built-in variables by type (e.g. clickUrl, pageUrl, formId). Built-in variables must be enabled before a trigger or tag can reference them as {{Click URL}}.",
|
|
@@ -35004,7 +35282,7 @@ function builtinTypes(args) {
|
|
|
35004
35282
|
}
|
|
35005
35283
|
return raw.split(",").map((entry) => entry.trim());
|
|
35006
35284
|
}
|
|
35007
|
-
var builtinCommand =
|
|
35285
|
+
var builtinCommand = defineCommand167({
|
|
35008
35286
|
meta: {
|
|
35009
35287
|
name: "builtin",
|
|
35010
35288
|
description: `Enable or disable built-in variables
|
|
@@ -35014,7 +35292,7 @@ Examples:
|
|
|
35014
35292
|
baker tag-manager builtin disable --types formId`
|
|
35015
35293
|
},
|
|
35016
35294
|
subCommands: {
|
|
35017
|
-
enable:
|
|
35295
|
+
enable: defineCommand167({
|
|
35018
35296
|
meta: { name: "enable", description: "Stage enabling built-in variables" },
|
|
35019
35297
|
args: {
|
|
35020
35298
|
types: { type: "string", description: "Comma-separated types", required: false },
|
|
@@ -35028,7 +35306,7 @@ Examples:
|
|
|
35028
35306
|
});
|
|
35029
35307
|
}
|
|
35030
35308
|
}),
|
|
35031
|
-
disable:
|
|
35309
|
+
disable: defineCommand167({
|
|
35032
35310
|
meta: { name: "disable", description: "Stage disabling built-in variables" },
|
|
35033
35311
|
args: {
|
|
35034
35312
|
types: { type: "string", description: "Comma-separated types", required: false },
|
|
@@ -35046,7 +35324,7 @@ Examples:
|
|
|
35046
35324
|
});
|
|
35047
35325
|
|
|
35048
35326
|
// src/commands/tag-manager/index.ts
|
|
35049
|
-
var tagManagerCommand =
|
|
35327
|
+
var tagManagerCommand = defineCommand168({
|
|
35050
35328
|
meta: {
|
|
35051
35329
|
name: "tag-manager",
|
|
35052
35330
|
description: `Read and change what lives inside the client's Google Tag Manager container \u2014 tags, triggers, variables, folders and built-in variables.
|
|
@@ -35073,14 +35351,14 @@ Full guide: __tooling__/docs/tools/baker/tag-manager.md`
|
|
|
35073
35351
|
tag: tagCommand,
|
|
35074
35352
|
trigger: triggerCommand2,
|
|
35075
35353
|
variable: variableCommand,
|
|
35076
|
-
folder:
|
|
35354
|
+
folder: folderCommand2,
|
|
35077
35355
|
builtin: builtinCommand,
|
|
35078
35356
|
draft: draftCommand4
|
|
35079
35357
|
}
|
|
35080
35358
|
});
|
|
35081
35359
|
|
|
35082
35360
|
// src/commands/tags/index.ts
|
|
35083
|
-
import { defineCommand as
|
|
35361
|
+
import { defineCommand as defineCommand169 } from "citty";
|
|
35084
35362
|
|
|
35085
35363
|
// src/commands/tags/shared.ts
|
|
35086
35364
|
function failApi3(err) {
|
|
@@ -35149,7 +35427,7 @@ async function listTags(json) {
|
|
|
35149
35427
|
var listArgs9 = {
|
|
35150
35428
|
json: { type: "boolean", description: "Print the raw JSON envelope instead of the readable list" }
|
|
35151
35429
|
};
|
|
35152
|
-
var
|
|
35430
|
+
var listCommand16 = defineCommand169({
|
|
35153
35431
|
meta: {
|
|
35154
35432
|
name: "list",
|
|
35155
35433
|
description: "Effective tags for this chat (production + staged), with each tag's full readable config (secrets excluded) \u2014 reuse a stored value to pre-fill a change rather than asking the user. Refs printed here are what flow side-effect tagIds should use. Example: baker tags list"
|
|
@@ -35168,7 +35446,7 @@ async function listDraft3(chat) {
|
|
|
35168
35446
|
failApi3(err);
|
|
35169
35447
|
}
|
|
35170
35448
|
}
|
|
35171
|
-
var draftCommand5 =
|
|
35449
|
+
var draftCommand5 = defineCommand169({
|
|
35172
35450
|
meta: {
|
|
35173
35451
|
name: "draft",
|
|
35174
35452
|
description: "Review the tag changes staged in this chat (read-only). Staged changes were approved via request_tag_input and apply when the chat is published; to amend or drop one, propose a follow-up change through the same tool (a delete on a tag_temp_* ref drops the staged create). Takes --chat <id> to read an earlier chat's staged changes instead."
|
|
@@ -35178,7 +35456,7 @@ var draftCommand5 = defineCommand168({
|
|
|
35178
35456
|
await listDraft3(args.chat);
|
|
35179
35457
|
}
|
|
35180
35458
|
});
|
|
35181
|
-
var tagsCommand3 =
|
|
35459
|
+
var tagsCommand3 = defineCommand169({
|
|
35182
35460
|
meta: {
|
|
35183
35461
|
name: "tags",
|
|
35184
35462
|
description: `Read the client's marketing/analytics tags (Meta pixel, GA4, Google Ads, GTM, Clarity, Hotjar, \u2026) \u2014 production tags plus the changes staged in this chat.
|
|
@@ -35195,7 +35473,7 @@ Examples:
|
|
|
35195
35473
|
Full guide: __tooling__/docs/tools/baker/tags.md`
|
|
35196
35474
|
},
|
|
35197
35475
|
subCommands: {
|
|
35198
|
-
list:
|
|
35476
|
+
list: listCommand16,
|
|
35199
35477
|
draft: draftCommand5
|
|
35200
35478
|
},
|
|
35201
35479
|
// Bare `baker tags` lists the effective tags. `args` stays so citty knows this
|
|
@@ -35207,10 +35485,10 @@ Full guide: __tooling__/docs/tools/baker/tags.md`
|
|
|
35207
35485
|
});
|
|
35208
35486
|
|
|
35209
35487
|
// src/commands/testimonials/index.ts
|
|
35210
|
-
import { defineCommand as
|
|
35488
|
+
import { defineCommand as defineCommand173 } from "citty";
|
|
35211
35489
|
|
|
35212
35490
|
// src/commands/testimonials/get.ts
|
|
35213
|
-
import { defineCommand as
|
|
35491
|
+
import { defineCommand as defineCommand170 } from "citty";
|
|
35214
35492
|
registerSchema({
|
|
35215
35493
|
command: "testimonials.get",
|
|
35216
35494
|
description: "Get a single testimonial by ID",
|
|
@@ -35218,7 +35496,7 @@ registerSchema({
|
|
|
35218
35496
|
id: { type: "string", description: "Testimonial ID", required: true }
|
|
35219
35497
|
}
|
|
35220
35498
|
});
|
|
35221
|
-
var getCommand4 =
|
|
35499
|
+
var getCommand4 = defineCommand170({
|
|
35222
35500
|
meta: { name: "get", description: "Get a single testimonial by ID. Example: baker testimonials get j571abc123" },
|
|
35223
35501
|
args: {
|
|
35224
35502
|
id: { type: "positional", description: "Testimonial ID", required: false },
|
|
@@ -35255,7 +35533,7 @@ var getCommand4 = defineCommand169({
|
|
|
35255
35533
|
});
|
|
35256
35534
|
|
|
35257
35535
|
// src/commands/testimonials/list.ts
|
|
35258
|
-
import { defineCommand as
|
|
35536
|
+
import { defineCommand as defineCommand171 } from "citty";
|
|
35259
35537
|
registerSchema({
|
|
35260
35538
|
command: "testimonials.list",
|
|
35261
35539
|
description: "List testimonials with optional filters.",
|
|
@@ -35285,7 +35563,7 @@ registerSchema({
|
|
|
35285
35563
|
limit: { type: "number", description: "Max results (default 50)", required: false, default: 50 }
|
|
35286
35564
|
}
|
|
35287
35565
|
});
|
|
35288
|
-
var
|
|
35566
|
+
var listCommand17 = defineCommand171({
|
|
35289
35567
|
meta: {
|
|
35290
35568
|
name: "list",
|
|
35291
35569
|
description: "List testimonials with optional filters. Example: baker testimonials list --source google --sentiment positive"
|
|
@@ -35334,7 +35612,7 @@ var listCommand16 = defineCommand170({
|
|
|
35334
35612
|
});
|
|
35335
35613
|
|
|
35336
35614
|
// src/commands/testimonials/search.ts
|
|
35337
|
-
import { defineCommand as
|
|
35615
|
+
import { defineCommand as defineCommand172 } from "citty";
|
|
35338
35616
|
function languageBiasHint(results, requestedLanguage) {
|
|
35339
35617
|
if (requestedLanguage) {
|
|
35340
35618
|
return null;
|
|
@@ -35412,7 +35690,7 @@ function buildSearchRequest(query, args) {
|
|
|
35412
35690
|
}
|
|
35413
35691
|
return body;
|
|
35414
35692
|
}
|
|
35415
|
-
var searchCommand2 =
|
|
35693
|
+
var searchCommand2 = defineCommand172({
|
|
35416
35694
|
meta: {
|
|
35417
35695
|
name: "search",
|
|
35418
35696
|
description: "Semantic search testimonials by text query. Uses hybrid BM25 + vector + reranking. Example: baker testimonials search 'great service' --rating-min 4"
|
|
@@ -35468,7 +35746,7 @@ var searchCommand2 = defineCommand171({
|
|
|
35468
35746
|
var tagsCommand4 = makeTagsCommand("testimonials", "testimonial", "/api/testimonials/tags");
|
|
35469
35747
|
|
|
35470
35748
|
// src/commands/testimonials/index.ts
|
|
35471
|
-
var testimonialsCommand =
|
|
35749
|
+
var testimonialsCommand = defineCommand173({
|
|
35472
35750
|
meta: {
|
|
35473
35751
|
name: "testimonials",
|
|
35474
35752
|
description: `Find and browse testimonials in Baker. Subcommands: search, get, list, tags.
|
|
@@ -35484,16 +35762,16 @@ Full guide: __tooling__/docs/tools/baker/testimonials.md`
|
|
|
35484
35762
|
subCommands: {
|
|
35485
35763
|
get: getCommand4,
|
|
35486
35764
|
search: searchCommand2,
|
|
35487
|
-
list:
|
|
35765
|
+
list: listCommand17,
|
|
35488
35766
|
tags: tagsCommand4
|
|
35489
35767
|
}
|
|
35490
35768
|
});
|
|
35491
35769
|
|
|
35492
35770
|
// src/commands/videos/index.ts
|
|
35493
|
-
import { defineCommand as
|
|
35771
|
+
import { defineCommand as defineCommand178 } from "citty";
|
|
35494
35772
|
|
|
35495
35773
|
// src/commands/videos/delete.ts
|
|
35496
|
-
import { defineCommand as
|
|
35774
|
+
import { defineCommand as defineCommand174 } from "citty";
|
|
35497
35775
|
registerSchema({
|
|
35498
35776
|
command: "videos.delete",
|
|
35499
35777
|
description: "Delete a video by ID",
|
|
@@ -35507,7 +35785,7 @@ registerSchema({
|
|
|
35507
35785
|
}
|
|
35508
35786
|
}
|
|
35509
35787
|
});
|
|
35510
|
-
var deleteCommand3 =
|
|
35788
|
+
var deleteCommand3 = defineCommand174({
|
|
35511
35789
|
meta: {
|
|
35512
35790
|
name: "delete",
|
|
35513
35791
|
description: "Delete a video by ID. Use --dry-run to preview. Example: baker videos delete j571abc123 --dry-run"
|
|
@@ -35548,7 +35826,7 @@ var deleteCommand3 = defineCommand173({
|
|
|
35548
35826
|
});
|
|
35549
35827
|
|
|
35550
35828
|
// src/commands/videos/get.ts
|
|
35551
|
-
import { defineCommand as
|
|
35829
|
+
import { defineCommand as defineCommand175 } from "citty";
|
|
35552
35830
|
registerSchema({
|
|
35553
35831
|
command: "videos.get",
|
|
35554
35832
|
description: "Get a single video by ID",
|
|
@@ -35556,7 +35834,7 @@ registerSchema({
|
|
|
35556
35834
|
id: { type: "string", description: "Video ID", required: true }
|
|
35557
35835
|
}
|
|
35558
35836
|
});
|
|
35559
|
-
var getCommand5 =
|
|
35837
|
+
var getCommand5 = defineCommand175({
|
|
35560
35838
|
meta: { name: "get", description: "Get a single video by ID. Example: baker videos get j571abc123" },
|
|
35561
35839
|
args: {
|
|
35562
35840
|
id: { type: "positional", description: "Video ID", required: false },
|
|
@@ -35593,7 +35871,7 @@ var getCommand5 = defineCommand174({
|
|
|
35593
35871
|
});
|
|
35594
35872
|
|
|
35595
35873
|
// src/commands/videos/search.ts
|
|
35596
|
-
import { defineCommand as
|
|
35874
|
+
import { defineCommand as defineCommand176 } from "citty";
|
|
35597
35875
|
registerSchema({
|
|
35598
35876
|
command: "videos.search",
|
|
35599
35877
|
description: "Search videos by text query. Only returns ready videos.",
|
|
@@ -35603,7 +35881,7 @@ registerSchema({
|
|
|
35603
35881
|
tags: { type: "string", description: "Comma-separated tags to filter by", required: false }
|
|
35604
35882
|
}
|
|
35605
35883
|
});
|
|
35606
|
-
var searchCommand3 =
|
|
35884
|
+
var searchCommand3 = defineCommand176({
|
|
35607
35885
|
meta: {
|
|
35608
35886
|
name: "search",
|
|
35609
35887
|
description: "Semantic search videos by text query. Uses hybrid BM25 + vector + reranking. Example: baker videos search 'product demo' --tags tutorial"
|
|
@@ -35653,9 +35931,9 @@ var searchCommand3 = defineCommand175({
|
|
|
35653
35931
|
var tagsCommand5 = makeTagsCommand("videos", "video", "/api/videos/tags");
|
|
35654
35932
|
|
|
35655
35933
|
// src/commands/videos/upload.ts
|
|
35656
|
-
import { readFile as
|
|
35934
|
+
import { readFile as readFile24, stat as stat7 } from "fs/promises";
|
|
35657
35935
|
import { extname as extname3 } from "path";
|
|
35658
|
-
import { defineCommand as
|
|
35936
|
+
import { defineCommand as defineCommand177 } from "citty";
|
|
35659
35937
|
var MIME_MAP = {
|
|
35660
35938
|
".mp4": "video/mp4",
|
|
35661
35939
|
".mov": "video/quicktime",
|
|
@@ -35689,7 +35967,7 @@ function detectContentType(filePath) {
|
|
|
35689
35967
|
}
|
|
35690
35968
|
return mime;
|
|
35691
35969
|
}
|
|
35692
|
-
var uploadCommand2 =
|
|
35970
|
+
var uploadCommand2 = defineCommand177({
|
|
35693
35971
|
meta: {
|
|
35694
35972
|
name: "upload",
|
|
35695
35973
|
description: "Upload a video file to Baker via Mux direct upload. Auto-detects content type. Example: baker videos upload ./demo.mp4"
|
|
@@ -35718,7 +35996,7 @@ var uploadCommand2 = defineCommand176({
|
|
|
35718
35996
|
return;
|
|
35719
35997
|
}
|
|
35720
35998
|
const { uploadUrl, videoId } = await apiPost("/api/videos/upload", {});
|
|
35721
|
-
const fileBuffer = await
|
|
35999
|
+
const fileBuffer = await readFile24(filePath);
|
|
35722
36000
|
const uploadResponse = await fetch(uploadUrl, {
|
|
35723
36001
|
method: "PUT",
|
|
35724
36002
|
headers: { "Content-Type": contentType },
|
|
@@ -35743,7 +36021,7 @@ var uploadCommand2 = defineCommand176({
|
|
|
35743
36021
|
});
|
|
35744
36022
|
|
|
35745
36023
|
// src/commands/videos/index.ts
|
|
35746
|
-
var videosCommand =
|
|
36024
|
+
var videosCommand = defineCommand178({
|
|
35747
36025
|
meta: {
|
|
35748
36026
|
name: "videos",
|
|
35749
36027
|
description: `Find and manage videos in Baker. Subcommands: search, get, upload, delete, tags.
|
|
@@ -35767,10 +36045,10 @@ Full guide: __tooling__/docs/tools/baker/videos.md`
|
|
|
35767
36045
|
});
|
|
35768
36046
|
|
|
35769
36047
|
// src/commands/winning-ads/index.ts
|
|
35770
|
-
import { defineCommand as
|
|
36048
|
+
import { defineCommand as defineCommand191 } from "citty";
|
|
35771
36049
|
|
|
35772
36050
|
// src/commands/winning-ads/advertisers.ts
|
|
35773
|
-
import { defineCommand as
|
|
36051
|
+
import { defineCommand as defineCommand179 } from "citty";
|
|
35774
36052
|
|
|
35775
36053
|
// src/commands/winning-ads/shared.ts
|
|
35776
36054
|
function splitList(value) {
|
|
@@ -35823,7 +36101,7 @@ function advertiserNormalizer(record, full) {
|
|
|
35823
36101
|
last_synced_at: record.last_synced_at ?? null
|
|
35824
36102
|
};
|
|
35825
36103
|
}
|
|
35826
|
-
var advertisersCommand2 =
|
|
36104
|
+
var advertisersCommand2 = defineCommand179({
|
|
35827
36105
|
meta: {
|
|
35828
36106
|
name: "advertisers",
|
|
35829
36107
|
description: 'List corpus advertisers by name or domain. Find your own advertiser for --exclude-advertiser, or a competitor for --advertiser-id / winners. Example: baker winning-ads advertisers "Deel" --output md'
|
|
@@ -35881,7 +36159,7 @@ var advertisersCommand2 = defineCommand178({
|
|
|
35881
36159
|
});
|
|
35882
36160
|
|
|
35883
36161
|
// src/commands/winning-ads/brief.ts
|
|
35884
|
-
import { defineCommand as
|
|
36162
|
+
import { defineCommand as defineCommand180 } from "citty";
|
|
35885
36163
|
registerSchema({
|
|
35886
36164
|
command: "winning-ads.brief",
|
|
35887
36165
|
description: "Generate a creative brief grounded in strategically-similar winning ads. Optionally describe the target creative with --dna (JSON) and steer with --notes.",
|
|
@@ -35927,7 +36205,7 @@ function parseDna(raw) {
|
|
|
35927
36205
|
}
|
|
35928
36206
|
return parsed;
|
|
35929
36207
|
}
|
|
35930
|
-
var briefCommand =
|
|
36208
|
+
var briefCommand = defineCommand180({
|
|
35931
36209
|
meta: {
|
|
35932
36210
|
name: "brief",
|
|
35933
36211
|
description: `Generate a creative brief from winning references. Example: baker winning-ads brief --dna '{"angle":"cost savings"}' --notes "B2B, LinkedIn video" --k 8`
|
|
@@ -35963,7 +36241,7 @@ var briefCommand = defineCommand179({
|
|
|
35963
36241
|
});
|
|
35964
36242
|
|
|
35965
36243
|
// src/commands/winning-ads/content.ts
|
|
35966
|
-
import { defineCommand as
|
|
36244
|
+
import { defineCommand as defineCommand181 } from "citty";
|
|
35967
36245
|
registerSchema({
|
|
35968
36246
|
command: "winning-ads.content",
|
|
35969
36247
|
description: "Read what's INSIDE one winning ad: the spoken transcript, the on-screen text, and the ad copy. Use this after `search`/`winners`/`feed` return a shortlist \u2014 pass an ad_id to understand a reference before reproducing it. Add --full for speech, pacing, and soundtrack detail. Video ads carry the transcript/on-screen text; static ads carry only the copy.",
|
|
@@ -35976,7 +36254,7 @@ registerSchema({
|
|
|
35976
36254
|
}
|
|
35977
36255
|
}
|
|
35978
36256
|
});
|
|
35979
|
-
var contentCommand =
|
|
36257
|
+
var contentCommand = defineCommand181({
|
|
35980
36258
|
meta: {
|
|
35981
36259
|
name: "content",
|
|
35982
36260
|
description: "Read the transcript + on-screen text + copy of one winning ad. Example: baker winning-ads content adg_123 --platform meta --full --output md"
|
|
@@ -36025,7 +36303,7 @@ var contentCommand = defineCommand180({
|
|
|
36025
36303
|
});
|
|
36026
36304
|
|
|
36027
36305
|
// src/commands/winning-ads/feed.ts
|
|
36028
|
-
import { defineCommand as
|
|
36306
|
+
import { defineCommand as defineCommand182 } from "citty";
|
|
36029
36307
|
function buildFeedParams(input) {
|
|
36030
36308
|
const params = {};
|
|
36031
36309
|
const advertiser = splitList(input.advertiser);
|
|
@@ -36077,7 +36355,7 @@ registerSchema({
|
|
|
36077
36355
|
format: { type: "string", description: "Comma-separated formats to include (e.g. static,video)", required: false }
|
|
36078
36356
|
}
|
|
36079
36357
|
});
|
|
36080
|
-
var feedCommand =
|
|
36358
|
+
var feedCommand = defineCommand182({
|
|
36081
36359
|
meta: {
|
|
36082
36360
|
name: "feed",
|
|
36083
36361
|
description: "Winners across every brand you follow (browse, then trim per advertiser). Example: baker winning-ads feed --per-advertiser 5 --output md"
|
|
@@ -36162,7 +36440,7 @@ var feedCommand = defineCommand181({
|
|
|
36162
36440
|
});
|
|
36163
36441
|
|
|
36164
36442
|
// src/commands/winning-ads/follow.ts
|
|
36165
|
-
import { defineCommand as
|
|
36443
|
+
import { defineCommand as defineCommand183 } from "citty";
|
|
36166
36444
|
var PLATFORMS = ["meta", "linkedin"];
|
|
36167
36445
|
registerSchema({
|
|
36168
36446
|
command: "winning-ads.follow",
|
|
@@ -36177,7 +36455,7 @@ registerSchema({
|
|
|
36177
36455
|
label: { type: "string", description: "Optional display label (defaults to the resolved name)", required: false }
|
|
36178
36456
|
}
|
|
36179
36457
|
});
|
|
36180
|
-
var followCommand =
|
|
36458
|
+
var followCommand = defineCommand183({
|
|
36181
36459
|
meta: {
|
|
36182
36460
|
name: "follow",
|
|
36183
36461
|
description: 'Follow a brand to track ALL its ads \u2014 every platform and country. --platform is how we read your input, not a limit. A domain tracks both Meta + LinkedIn. Example: baker winning-ads follow "deel.com" --platform meta'
|
|
@@ -36224,7 +36502,7 @@ var followCommand = defineCommand182({
|
|
|
36224
36502
|
});
|
|
36225
36503
|
|
|
36226
36504
|
// src/commands/winning-ads/follow-competitors.ts
|
|
36227
|
-
import { defineCommand as
|
|
36505
|
+
import { defineCommand as defineCommand184 } from "citty";
|
|
36228
36506
|
var PLATFORMS2 = ["meta", "linkedin"];
|
|
36229
36507
|
var BATCH_TIMEOUT_MS = 3e5;
|
|
36230
36508
|
function buildFollowBatchBody(input) {
|
|
@@ -36257,7 +36535,7 @@ registerSchema({
|
|
|
36257
36535
|
}
|
|
36258
36536
|
}
|
|
36259
36537
|
});
|
|
36260
|
-
var followCompetitorsCommand =
|
|
36538
|
+
var followCompetitorsCommand = defineCommand184({
|
|
36261
36539
|
meta: {
|
|
36262
36540
|
name: "follow-competitors",
|
|
36263
36541
|
description: 'Follow many brands at once by domain \u2014 add every competitor in one call. Example: baker winning-ads follow-competitors "deel.com,notion.so,hubspot.com"'
|
|
@@ -36332,7 +36610,7 @@ var followCompetitorsCommand = defineCommand183({
|
|
|
36332
36610
|
});
|
|
36333
36611
|
|
|
36334
36612
|
// src/commands/winning-ads/following.ts
|
|
36335
|
-
import { defineCommand as
|
|
36613
|
+
import { defineCommand as defineCommand185 } from "citty";
|
|
36336
36614
|
registerSchema({
|
|
36337
36615
|
command: "winning-ads.following",
|
|
36338
36616
|
description: "List the brands you follow in your ad-dna library, with each one's status (ready vs still adding) and cached ad counts.",
|
|
@@ -36365,7 +36643,7 @@ function followingNormalizer(record, full) {
|
|
|
36365
36643
|
platforms: Array.isArray(record.platforms) ? record.platforms : []
|
|
36366
36644
|
};
|
|
36367
36645
|
}
|
|
36368
|
-
var followingCommand =
|
|
36646
|
+
var followingCommand = defineCommand185({
|
|
36369
36647
|
meta: {
|
|
36370
36648
|
name: "following",
|
|
36371
36649
|
description: "List brands you follow, with status (ready / adding\u2026) and cached counts. Example: baker winning-ads following --output md"
|
|
@@ -36400,7 +36678,7 @@ var followingCommand = defineCommand184({
|
|
|
36400
36678
|
});
|
|
36401
36679
|
|
|
36402
36680
|
// src/commands/winning-ads/patterns.ts
|
|
36403
|
-
import { defineCommand as
|
|
36681
|
+
import { defineCommand as defineCommand186 } from "citty";
|
|
36404
36682
|
registerSchema({
|
|
36405
36683
|
command: "winning-ads.patterns",
|
|
36406
36684
|
description: "Mine what separates two cohorts of ads: pass a comma-list of winning ad ids (--winners) and a comma-list of weaker ad ids (--duds). Returns the discriminating DNA fields.",
|
|
@@ -36439,7 +36717,7 @@ function discriminatorRow(record) {
|
|
|
36439
36717
|
top_values_duds: Array.isArray(record.top_values_b) ? record.top_values_b.join(", ") : ""
|
|
36440
36718
|
};
|
|
36441
36719
|
}
|
|
36442
|
-
var patternsCommand =
|
|
36720
|
+
var patternsCommand = defineCommand186({
|
|
36443
36721
|
meta: {
|
|
36444
36722
|
name: "patterns",
|
|
36445
36723
|
description: "Discover what separates winning ads from weak ones. Example: baker winning-ads patterns --winners a_1,a_2,a_3 --duds a_9,a_8 --output md"
|
|
@@ -36495,7 +36773,7 @@ var patternsCommand = defineCommand185({
|
|
|
36495
36773
|
});
|
|
36496
36774
|
|
|
36497
36775
|
// src/commands/winning-ads/search.ts
|
|
36498
|
-
import { defineCommand as
|
|
36776
|
+
import { defineCommand as defineCommand187 } from "citty";
|
|
36499
36777
|
registerSchema({
|
|
36500
36778
|
command: "winning-ads.search",
|
|
36501
36779
|
description: "Search the ad-dna corpus of scored winning ads. Returns a lean shortlist (advertiser, summary, scores, media_url) to pick a reference to reproduce.",
|
|
@@ -36603,7 +36881,7 @@ function buildSearchBody(args) {
|
|
|
36603
36881
|
}
|
|
36604
36882
|
return body;
|
|
36605
36883
|
}
|
|
36606
|
-
var searchCommand4 =
|
|
36884
|
+
var searchCommand4 = defineCommand187({
|
|
36607
36885
|
meta: {
|
|
36608
36886
|
name: "search",
|
|
36609
36887
|
description: "Search winning reference ads. Example: baker winning-ads search 'B2B SaaS before/after AI automation' --platform meta --format static --winner-category winner --exclude-advertiser adv_123 --output md"
|
|
@@ -36718,7 +36996,7 @@ var searchCommand4 = defineCommand186({
|
|
|
36718
36996
|
});
|
|
36719
36997
|
|
|
36720
36998
|
// src/commands/winning-ads/seeds.ts
|
|
36721
|
-
import { defineCommand as
|
|
36999
|
+
import { defineCommand as defineCommand188 } from "citty";
|
|
36722
37000
|
function leanRow(r) {
|
|
36723
37001
|
return {
|
|
36724
37002
|
key: r.key,
|
|
@@ -36746,7 +37024,7 @@ function makeSeedCommand(opts) {
|
|
|
36746
37024
|
limit: { type: "number", description: "Max keys 1-100 (default 20)", required: false, default: 20 }
|
|
36747
37025
|
}
|
|
36748
37026
|
});
|
|
36749
|
-
return
|
|
37027
|
+
return defineCommand188({
|
|
36750
37028
|
meta: { name: opts.name, description: opts.description },
|
|
36751
37029
|
args: {
|
|
36752
37030
|
platform: { type: "string", description: "Single platform to segment on", required: false },
|
|
@@ -36795,7 +37073,7 @@ var formatsCommand = makeSeedCommand({
|
|
|
36795
37073
|
});
|
|
36796
37074
|
|
|
36797
37075
|
// src/commands/winning-ads/unfollow.ts
|
|
36798
|
-
import { defineCommand as
|
|
37076
|
+
import { defineCommand as defineCommand189 } from "citty";
|
|
36799
37077
|
registerSchema({
|
|
36800
37078
|
command: "winning-ads.unfollow",
|
|
36801
37079
|
description: "Stop following a brand \u2014 removes it from your ad-dna library by advertiser id.",
|
|
@@ -36803,7 +37081,7 @@ registerSchema({
|
|
|
36803
37081
|
advertiser: { type: "string", description: "Advertiser id to unfollow", required: true }
|
|
36804
37082
|
}
|
|
36805
37083
|
});
|
|
36806
|
-
var unfollowCommand =
|
|
37084
|
+
var unfollowCommand = defineCommand189({
|
|
36807
37085
|
meta: {
|
|
36808
37086
|
name: "unfollow",
|
|
36809
37087
|
description: "Stop following a brand by advertiser id. Example: baker winning-ads unfollow adv_123"
|
|
@@ -36824,7 +37102,7 @@ var unfollowCommand = defineCommand188({
|
|
|
36824
37102
|
});
|
|
36825
37103
|
|
|
36826
37104
|
// src/commands/winning-ads/winners.ts
|
|
36827
|
-
import { defineCommand as
|
|
37105
|
+
import { defineCommand as defineCommand190 } from "citty";
|
|
36828
37106
|
registerSchema({
|
|
36829
37107
|
command: "winning-ads.winners",
|
|
36830
37108
|
description: "Top winning ads for one advertiser id (from `advertisers` or `following`). Returns lean winner cards; add --full for DNA + longevity.",
|
|
@@ -36834,7 +37112,7 @@ registerSchema({
|
|
|
36834
37112
|
platform: { type: "string", description: "Filter to a single platform: meta|linkedin", required: false }
|
|
36835
37113
|
}
|
|
36836
37114
|
});
|
|
36837
|
-
var winnersCommand =
|
|
37115
|
+
var winnersCommand = defineCommand190({
|
|
36838
37116
|
meta: {
|
|
36839
37117
|
name: "winners",
|
|
36840
37118
|
description: "Top winning ads for a specific advertiser id. Example: baker winning-ads winners adv_123 --top 15 --output md"
|
|
@@ -36884,7 +37162,7 @@ var winnersCommand = defineCommand189({
|
|
|
36884
37162
|
});
|
|
36885
37163
|
|
|
36886
37164
|
// src/commands/winning-ads/index.ts
|
|
36887
|
-
var winningAdsCommand =
|
|
37165
|
+
var winningAdsCommand = defineCommand191({
|
|
36888
37166
|
meta: {
|
|
36889
37167
|
name: "winning-ads",
|
|
36890
37168
|
description: `Search the ad-dna corpus of scored "winning" ads for reference creatives to reproduce, and manage the brands your library tracks. Proxied through the Baker backend (BAKER_API_KEY) \u2014 no separate token needed.
|
|
@@ -36956,7 +37234,7 @@ function getCliVersion() {
|
|
|
36956
37234
|
}
|
|
36957
37235
|
|
|
36958
37236
|
// src/cli.ts
|
|
36959
|
-
var main =
|
|
37237
|
+
var main = defineCommand192({
|
|
36960
37238
|
meta: {
|
|
36961
37239
|
name: "baker",
|
|
36962
37240
|
version: getCliVersion(),
|