@koda-sl/baker-cli 0.120.0 → 0.121.0-dev.36aef87f5
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 +23 -1
- package/dist/{chunk-IWPAXJC3.js → chunk-MWFJ5NOP.js} +4 -4
- package/dist/chunk-MWFJ5NOP.js.map +1 -0
- package/dist/cli.js +1022 -814
- package/dist/cli.js.map +1 -1
- package/dist/engine/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-IWPAXJC3.js.map +0 -1
package/dist/cli.js
CHANGED
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
generateCatalog,
|
|
14
14
|
resolveConcurrency,
|
|
15
15
|
validateCanvasDeep
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-MWFJ5NOP.js";
|
|
17
17
|
import {
|
|
18
18
|
csvOrJson,
|
|
19
19
|
daysAgoIso,
|
|
@@ -49,7 +49,7 @@ import {
|
|
|
49
49
|
import "./chunk-5WRI5ZAA.js";
|
|
50
50
|
|
|
51
51
|
// src/cli.ts
|
|
52
|
-
import { defineCommand as
|
|
52
|
+
import { defineCommand as defineCommand161, runMain } from "citty";
|
|
53
53
|
|
|
54
54
|
// src/commands/actions/index.ts
|
|
55
55
|
import { defineCommand as defineCommand18 } from "citty";
|
|
@@ -848,7 +848,6 @@ var LINKEDIN_LIMITS = {
|
|
|
848
848
|
choiceOptionsMax: 30,
|
|
849
849
|
choiceOptionTextMax: 100,
|
|
850
850
|
thankYouMessageMax: 300,
|
|
851
|
-
privacyPolicyTextMax: 2e3,
|
|
852
851
|
legalDisclaimerMax: 2e3,
|
|
853
852
|
consentsMax: 5,
|
|
854
853
|
// Campaign Manager caps disclosure checkboxes at 5
|
|
@@ -1443,7 +1442,6 @@ var leadFormFields = {
|
|
|
1443
1442
|
/** Form language, e.g. { country: "US", language: "en" }. Defaults to the account locale on LinkedIn. */
|
|
1444
1443
|
locale: z2.object({ country: z2.string().length(2), language: z2.string().length(2) }).optional(),
|
|
1445
1444
|
privacyPolicyUrl: httpsUrlSchema,
|
|
1446
|
-
privacyPolicyText: z2.string().max(LEAD.privacyPolicyTextMax).optional(),
|
|
1447
1445
|
questions: z2.array(leadFormQuestionSchema).min(1).max(LEAD.questionsMax),
|
|
1448
1446
|
consents: z2.array(leadFormConsentSchema).max(LEAD.consentsMax).optional(),
|
|
1449
1447
|
hiddenFields: z2.array(leadFormHiddenFieldSchema).max(LEAD.hiddenFieldsMax).optional(),
|
|
@@ -1918,142 +1916,241 @@ var imagesIngestResponseSchema = z4.object({
|
|
|
1918
1916
|
contentHash: z4.string()
|
|
1919
1917
|
});
|
|
1920
1918
|
|
|
1921
|
-
// ../api/src/
|
|
1919
|
+
// ../api/src/tags.ts
|
|
1922
1920
|
import { z as z5 } from "zod";
|
|
1923
|
-
var
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1921
|
+
var TAG_TYPES = [
|
|
1922
|
+
"meta",
|
|
1923
|
+
"amplitude",
|
|
1924
|
+
"googleAds",
|
|
1925
|
+
"tiktok",
|
|
1926
|
+
"vwo",
|
|
1927
|
+
"hotjar",
|
|
1928
|
+
"clarity",
|
|
1929
|
+
"pinterest",
|
|
1930
|
+
"code",
|
|
1931
|
+
"googleAnalytics",
|
|
1932
|
+
"googleTagManager",
|
|
1933
|
+
"hubspot",
|
|
1934
|
+
"linkedinInsightTag",
|
|
1935
|
+
"onetrust",
|
|
1936
|
+
"posthog",
|
|
1937
|
+
"datafast",
|
|
1938
|
+
"recaptcha",
|
|
1939
|
+
"twitterAds"
|
|
1940
|
+
];
|
|
1941
|
+
var tagTypeSchema = z5.enum(TAG_TYPES);
|
|
1942
|
+
var tagDraftOpKindSchema = z5.enum(["create", "update", "delete"]);
|
|
1943
|
+
var tagDraftOpViewSchema = z5.object({
|
|
1944
|
+
/** `tag_temp_*` for staged creates; the real tag id for update/delete ops. */
|
|
1945
|
+
ref: z5.string(),
|
|
1946
|
+
kind: tagDraftOpKindSchema,
|
|
1947
|
+
type: tagTypeSchema,
|
|
1948
|
+
/** Present on update/delete ops — the real tag this op targets. */
|
|
1949
|
+
tagId: z5.string().optional(),
|
|
1950
|
+
/** Non-secret config (create: full; update: the staged patch). Secrets are structurally absent. */
|
|
1951
|
+
config: z5.record(z5.string(), z5.string()),
|
|
1952
|
+
/** Update only — fields the op explicitly clears. */
|
|
1953
|
+
clearFields: z5.array(z5.string()).optional(),
|
|
1954
|
+
/** Names of secret fields already provided via the dashboard secure form. Never values. */
|
|
1955
|
+
secretsSet: z5.array(z5.string()),
|
|
1956
|
+
/** Names of secret fields still awaiting user input. */
|
|
1957
|
+
secretsPending: z5.array(z5.string()),
|
|
1958
|
+
summary: z5.string(),
|
|
1959
|
+
stagedAt: z5.number()
|
|
1960
|
+
});
|
|
1961
|
+
var tagsEffectiveEntrySchema = z5.object({
|
|
1962
|
+
/** Real tag id, or `tag_temp_*` for staged creates. Use as flow side-effect `tagIds` value. */
|
|
1963
|
+
ref: z5.string(),
|
|
1964
|
+
tagId: z5.string().optional(),
|
|
1965
|
+
type: tagTypeSchema,
|
|
1966
|
+
/** Value of the type's identifying field, when set. */
|
|
1967
|
+
identifier: z5.string().optional(),
|
|
1968
|
+
/** Redacted config; for staged updates, production config with the patch merged. */
|
|
1969
|
+
config: z5.record(z5.string(), z5.string()),
|
|
1970
|
+
/** Absent = live production tag with no staged changes in this chat. */
|
|
1971
|
+
staged: tagDraftOpKindSchema.optional(),
|
|
1972
|
+
secretsSet: z5.array(z5.string()),
|
|
1973
|
+
secretsPending: z5.array(z5.string())
|
|
1974
|
+
});
|
|
1975
|
+
var tagsListRequestSchema = z5.object({ chatId: z5.string() });
|
|
1976
|
+
var tagsListResponseSchema = z5.object({ tags: z5.array(tagsEffectiveEntrySchema) });
|
|
1977
|
+
var tagsDraftListRequestSchema = z5.object({ chatId: z5.string() });
|
|
1978
|
+
var tagsDraftListResponseSchema = z5.object({
|
|
1979
|
+
status: z5.enum(["active", "publishing", "applied", "discarded", "none"]),
|
|
1980
|
+
ops: z5.array(tagDraftOpViewSchema)
|
|
1981
|
+
});
|
|
1982
|
+
var tagInputRequestSchema = z5.object({
|
|
1983
|
+
// Every tag change is a tab in the approval form: create/edit show the full
|
|
1984
|
+
// body; delete shows a confirm. No tag change bypasses this approval.
|
|
1985
|
+
mode: z5.enum(["create", "edit", "delete"]),
|
|
1986
|
+
tagType: tagTypeSchema,
|
|
1987
|
+
/** Edit/delete mode — the real tag id or `tag_temp_*` ref being changed. */
|
|
1988
|
+
ref: z5.string().optional(),
|
|
1989
|
+
/** Non-secret values the agent proposes to prefill. Secret keys are stripped at every boundary. */
|
|
1990
|
+
prefilledConfig: z5.record(z5.string(), z5.string()).optional(),
|
|
1991
|
+
/** Secret field names the agent asks the user to provide. */
|
|
1992
|
+
requestedSecretFields: z5.array(z5.string()).optional(),
|
|
1993
|
+
/** Short message shown above the form explaining why the input is needed. */
|
|
1994
|
+
message: z5.string().optional()
|
|
1995
|
+
});
|
|
1996
|
+
var tagChangeToolInputSchema = z5.object({
|
|
1997
|
+
changes: z5.array(tagInputRequestSchema).min(1).max(8)
|
|
1998
|
+
});
|
|
1999
|
+
var tagInputResultSchema = z5.discriminatedUnion("status", [
|
|
2000
|
+
z5.object({
|
|
2001
|
+
status: z5.literal("submitted"),
|
|
2002
|
+
ref: z5.string(),
|
|
2003
|
+
type: tagTypeSchema,
|
|
2004
|
+
/** Identifying field name → value (non-secret), when the type has one. */
|
|
2005
|
+
identifier: z5.record(z5.string(), z5.string()).optional(),
|
|
2006
|
+
secretFieldsSet: z5.array(z5.string()),
|
|
2007
|
+
note: z5.string().optional()
|
|
2008
|
+
}),
|
|
2009
|
+
z5.object({
|
|
2010
|
+
status: z5.literal("declined"),
|
|
2011
|
+
reason: z5.string().optional()
|
|
2012
|
+
})
|
|
2013
|
+
]);
|
|
2014
|
+
var tagChangeToolResultSchema = z5.object({
|
|
2015
|
+
results: z5.array(tagInputResultSchema)
|
|
2016
|
+
});
|
|
2017
|
+
|
|
2018
|
+
// ../api/src/testimonials.ts
|
|
2019
|
+
import { z as z6 } from "zod";
|
|
2020
|
+
var testimonialSourceTypeSchema = z6.enum(["google", "trustpilot"]);
|
|
2021
|
+
var testimonialStatusSchema = z6.enum(["pending", "processing", "ready", "error"]);
|
|
2022
|
+
var testimonialSentimentSchema = z6.enum(["positive", "neutral", "negative"]);
|
|
2023
|
+
var testimonialDocSchema = z6.object({
|
|
2024
|
+
_id: z6.string(),
|
|
2025
|
+
_creationTime: z6.number(),
|
|
2026
|
+
companyId: z6.string(),
|
|
2027
|
+
sourceId: z6.string(),
|
|
1931
2028
|
sourceType: testimonialSourceTypeSchema,
|
|
1932
|
-
reviewText:
|
|
1933
|
-
reviewTitle:
|
|
1934
|
-
searchText:
|
|
1935
|
-
reviewerName:
|
|
1936
|
-
reviewerImageUrl:
|
|
1937
|
-
reviewerImageId:
|
|
1938
|
-
reviewerLocation:
|
|
1939
|
-
rating:
|
|
1940
|
-
reviewDate:
|
|
1941
|
-
ownerAnswer:
|
|
1942
|
-
mediaUrls:
|
|
1943
|
-
imageIds:
|
|
1944
|
-
videoIds:
|
|
1945
|
-
sourceUrl:
|
|
1946
|
-
rawData:
|
|
1947
|
-
tags:
|
|
1948
|
-
highlight:
|
|
1949
|
-
language:
|
|
1950
|
-
summary:
|
|
2029
|
+
reviewText: z6.string(),
|
|
2030
|
+
reviewTitle: z6.string().optional(),
|
|
2031
|
+
searchText: z6.string().optional(),
|
|
2032
|
+
reviewerName: z6.string().optional(),
|
|
2033
|
+
reviewerImageUrl: z6.string().optional(),
|
|
2034
|
+
reviewerImageId: z6.string().optional(),
|
|
2035
|
+
reviewerLocation: z6.string().optional(),
|
|
2036
|
+
rating: z6.number().optional(),
|
|
2037
|
+
reviewDate: z6.number().optional(),
|
|
2038
|
+
ownerAnswer: z6.string().optional(),
|
|
2039
|
+
mediaUrls: z6.array(z6.string()).optional(),
|
|
2040
|
+
imageIds: z6.array(z6.string()).optional(),
|
|
2041
|
+
videoIds: z6.array(z6.string()).optional(),
|
|
2042
|
+
sourceUrl: z6.string().optional(),
|
|
2043
|
+
rawData: z6.unknown().optional(),
|
|
2044
|
+
tags: z6.array(z6.string()),
|
|
2045
|
+
highlight: z6.string().optional(),
|
|
2046
|
+
language: z6.string().optional(),
|
|
2047
|
+
summary: z6.string().optional(),
|
|
1951
2048
|
sentiment: testimonialSentimentSchema.optional(),
|
|
1952
|
-
textEmbedding:
|
|
1953
|
-
externalId:
|
|
1954
|
-
contentHash:
|
|
2049
|
+
textEmbedding: z6.array(z6.number()).optional(),
|
|
2050
|
+
externalId: z6.string().optional(),
|
|
2051
|
+
contentHash: z6.string().optional(),
|
|
1955
2052
|
status: testimonialStatusSchema,
|
|
1956
|
-
errorMessage:
|
|
1957
|
-
createdAt:
|
|
1958
|
-
updatedAt:
|
|
2053
|
+
errorMessage: z6.string().optional(),
|
|
2054
|
+
createdAt: z6.number(),
|
|
2055
|
+
updatedAt: z6.number()
|
|
1959
2056
|
});
|
|
1960
|
-
var testimonialsListRequestSchema =
|
|
2057
|
+
var testimonialsListRequestSchema = z6.object({
|
|
1961
2058
|
source: testimonialSourceTypeSchema.optional(),
|
|
1962
|
-
rating_min:
|
|
1963
|
-
rating_max:
|
|
1964
|
-
tags:
|
|
2059
|
+
rating_min: z6.coerce.number().int().min(1).max(5).optional(),
|
|
2060
|
+
rating_max: z6.coerce.number().int().min(1).max(5).optional(),
|
|
2061
|
+
tags: z6.string().transform((s) => s.split(",").filter(Boolean)).optional(),
|
|
1965
2062
|
status: testimonialStatusSchema.optional(),
|
|
1966
2063
|
sentiment: testimonialSentimentSchema.optional(),
|
|
1967
|
-
language:
|
|
1968
|
-
limit:
|
|
1969
|
-
});
|
|
1970
|
-
var testimonialsListResponseSchema =
|
|
1971
|
-
var testimonialsGetRequestSchema =
|
|
1972
|
-
var testimonialsSearchRequestSchema =
|
|
1973
|
-
query:
|
|
1974
|
-
limit:
|
|
2064
|
+
language: z6.string().min(2).max(5).optional(),
|
|
2065
|
+
limit: z6.coerce.number().int().positive().max(200).optional()
|
|
2066
|
+
});
|
|
2067
|
+
var testimonialsListResponseSchema = z6.array(testimonialDocSchema);
|
|
2068
|
+
var testimonialsGetRequestSchema = z6.object({ id: z6.string().min(1, "Missing id parameter") });
|
|
2069
|
+
var testimonialsSearchRequestSchema = z6.object({
|
|
2070
|
+
query: z6.string().min(1),
|
|
2071
|
+
limit: z6.coerce.number().int().positive().max(100).optional(),
|
|
1975
2072
|
source: testimonialSourceTypeSchema.optional(),
|
|
1976
|
-
rating_min:
|
|
1977
|
-
rating_max:
|
|
1978
|
-
tags:
|
|
2073
|
+
rating_min: z6.coerce.number().int().min(1).max(5).optional(),
|
|
2074
|
+
rating_max: z6.coerce.number().int().min(1).max(5).optional(),
|
|
2075
|
+
tags: z6.array(z6.string()).optional(),
|
|
1979
2076
|
status: testimonialStatusSchema.optional(),
|
|
1980
2077
|
sentiment: testimonialSentimentSchema.optional(),
|
|
1981
|
-
language:
|
|
2078
|
+
language: z6.string().min(2).max(5).optional()
|
|
1982
2079
|
}).refine(
|
|
1983
2080
|
(data) => data.rating_min === void 0 || data.rating_max === void 0 || data.rating_min <= data.rating_max,
|
|
1984
2081
|
{ message: "rating_min must be less than or equal to rating_max" }
|
|
1985
2082
|
);
|
|
1986
|
-
var testimonialsSearchResponseSchema =
|
|
1987
|
-
var testimonialsOutscraperWebhookResponseSchema =
|
|
1988
|
-
ok:
|
|
1989
|
-
note:
|
|
2083
|
+
var testimonialsSearchResponseSchema = z6.array(testimonialDocSchema);
|
|
2084
|
+
var testimonialsOutscraperWebhookResponseSchema = z6.object({
|
|
2085
|
+
ok: z6.literal(true),
|
|
2086
|
+
note: z6.string().optional()
|
|
1990
2087
|
});
|
|
1991
2088
|
|
|
1992
2089
|
// ../api/src/videos.ts
|
|
1993
|
-
import { z as
|
|
1994
|
-
var videoStatusSchema =
|
|
1995
|
-
var videoTranscriptSegmentSchema =
|
|
1996
|
-
text:
|
|
1997
|
-
startSecond:
|
|
1998
|
-
endSecond:
|
|
1999
|
-
});
|
|
2000
|
-
var videoSceneSchema =
|
|
2001
|
-
title:
|
|
2002
|
-
description:
|
|
2003
|
-
startSecond:
|
|
2004
|
-
endSecond:
|
|
2005
|
-
thumbnailTime:
|
|
2006
|
-
});
|
|
2007
|
-
var videoDocSchema =
|
|
2008
|
-
_id:
|
|
2009
|
-
_creationTime:
|
|
2010
|
-
companyId:
|
|
2011
|
-
muxAssetId:
|
|
2012
|
-
muxPlaybackId:
|
|
2013
|
-
muxUploadId:
|
|
2014
|
-
name:
|
|
2015
|
-
description:
|
|
2016
|
-
tags:
|
|
2017
|
-
source:
|
|
2018
|
-
externalId:
|
|
2019
|
-
sourceId:
|
|
2020
|
-
width:
|
|
2021
|
-
height:
|
|
2022
|
-
aspectRatio:
|
|
2023
|
-
duration:
|
|
2024
|
-
transcript:
|
|
2025
|
-
transcriptSegments:
|
|
2026
|
-
scenes:
|
|
2027
|
-
descriptionEmbedding:
|
|
2028
|
-
searchText:
|
|
2090
|
+
import { z as z7 } from "zod";
|
|
2091
|
+
var videoStatusSchema = z7.enum(["uploading", "uploaded", "processing", "ready", "error"]);
|
|
2092
|
+
var videoTranscriptSegmentSchema = z7.object({
|
|
2093
|
+
text: z7.string(),
|
|
2094
|
+
startSecond: z7.number(),
|
|
2095
|
+
endSecond: z7.number()
|
|
2096
|
+
});
|
|
2097
|
+
var videoSceneSchema = z7.object({
|
|
2098
|
+
title: z7.string(),
|
|
2099
|
+
description: z7.string(),
|
|
2100
|
+
startSecond: z7.number(),
|
|
2101
|
+
endSecond: z7.number(),
|
|
2102
|
+
thumbnailTime: z7.number()
|
|
2103
|
+
});
|
|
2104
|
+
var videoDocSchema = z7.object({
|
|
2105
|
+
_id: z7.string(),
|
|
2106
|
+
_creationTime: z7.number(),
|
|
2107
|
+
companyId: z7.string(),
|
|
2108
|
+
muxAssetId: z7.string(),
|
|
2109
|
+
muxPlaybackId: z7.string(),
|
|
2110
|
+
muxUploadId: z7.string(),
|
|
2111
|
+
name: z7.string(),
|
|
2112
|
+
description: z7.string(),
|
|
2113
|
+
tags: z7.array(z7.string()),
|
|
2114
|
+
source: z7.string(),
|
|
2115
|
+
externalId: z7.string().optional(),
|
|
2116
|
+
sourceId: z7.string().optional(),
|
|
2117
|
+
width: z7.number().optional(),
|
|
2118
|
+
height: z7.number().optional(),
|
|
2119
|
+
aspectRatio: z7.number().optional(),
|
|
2120
|
+
duration: z7.number().optional(),
|
|
2121
|
+
transcript: z7.string().optional(),
|
|
2122
|
+
transcriptSegments: z7.array(videoTranscriptSegmentSchema).optional(),
|
|
2123
|
+
scenes: z7.array(videoSceneSchema).optional(),
|
|
2124
|
+
descriptionEmbedding: z7.array(z7.number()).optional(),
|
|
2125
|
+
searchText: z7.string().optional(),
|
|
2029
2126
|
status: videoStatusSchema,
|
|
2030
|
-
errorMessage:
|
|
2031
|
-
createdAt:
|
|
2032
|
-
updatedAt:
|
|
2033
|
-
thumbnailUrl:
|
|
2034
|
-
});
|
|
2035
|
-
var videosWebhookResponseSchema =
|
|
2036
|
-
var videosGetRequestSchema =
|
|
2037
|
-
var videosSearchRequestSchema =
|
|
2038
|
-
query:
|
|
2039
|
-
limit:
|
|
2040
|
-
tags:
|
|
2041
|
-
});
|
|
2042
|
-
var videoSearchResultSchema =
|
|
2043
|
-
_id:
|
|
2044
|
-
thumbnailUrl:
|
|
2045
|
-
name:
|
|
2046
|
-
description:
|
|
2047
|
-
tags:
|
|
2048
|
-
status:
|
|
2049
|
-
duration:
|
|
2050
|
-
muxPlaybackId:
|
|
2051
|
-
createdAt:
|
|
2052
|
-
});
|
|
2053
|
-
var videosSearchResponseSchema =
|
|
2054
|
-
var videosUploadResponseSchema =
|
|
2055
|
-
var videosDeleteRequestSchema =
|
|
2056
|
-
var videosDeleteResponseSchema =
|
|
2127
|
+
errorMessage: z7.string().optional(),
|
|
2128
|
+
createdAt: z7.number(),
|
|
2129
|
+
updatedAt: z7.number(),
|
|
2130
|
+
thumbnailUrl: z7.string()
|
|
2131
|
+
});
|
|
2132
|
+
var videosWebhookResponseSchema = z7.object({ ok: z7.literal(true) });
|
|
2133
|
+
var videosGetRequestSchema = z7.object({ id: z7.string().min(1, "Missing id parameter") });
|
|
2134
|
+
var videosSearchRequestSchema = z7.object({
|
|
2135
|
+
query: z7.string().min(1),
|
|
2136
|
+
limit: z7.coerce.number().int().positive().max(100).optional(),
|
|
2137
|
+
tags: z7.array(z7.string()).optional()
|
|
2138
|
+
});
|
|
2139
|
+
var videoSearchResultSchema = z7.object({
|
|
2140
|
+
_id: z7.string(),
|
|
2141
|
+
thumbnailUrl: z7.string(),
|
|
2142
|
+
name: z7.string(),
|
|
2143
|
+
description: z7.string(),
|
|
2144
|
+
tags: z7.array(z7.string()),
|
|
2145
|
+
status: z7.string(),
|
|
2146
|
+
duration: z7.number().optional(),
|
|
2147
|
+
muxPlaybackId: z7.string(),
|
|
2148
|
+
createdAt: z7.number()
|
|
2149
|
+
});
|
|
2150
|
+
var videosSearchResponseSchema = z7.array(videoSearchResultSchema);
|
|
2151
|
+
var videosUploadResponseSchema = z7.object({ uploadUrl: z7.string(), videoId: z7.string() });
|
|
2152
|
+
var videosDeleteRequestSchema = z7.object({ id: z7.string().min(1, "Missing video ID") });
|
|
2153
|
+
var videosDeleteResponseSchema = z7.object({ ok: z7.literal(true) });
|
|
2057
2154
|
|
|
2058
2155
|
// src/commands/actions/complete.ts
|
|
2059
2156
|
import { defineCommand as defineCommand2 } from "citty";
|
|
@@ -3866,37 +3963,37 @@ var GEO_TARGET_CONSTANT_REGEX = /^geoTargetConstants\/\d+$/;
|
|
|
3866
3963
|
var LANGUAGE_CONSTANT_REGEX = /^languageConstants\/\d+$/;
|
|
3867
3964
|
|
|
3868
3965
|
// ../api/src/ads-google/ops.ts
|
|
3869
|
-
import { z as
|
|
3870
|
-
var tempRefSchema2 =
|
|
3871
|
-
var refSchema =
|
|
3872
|
-
|
|
3873
|
-
|
|
3966
|
+
import { z as z8 } from "zod";
|
|
3967
|
+
var tempRefSchema2 = z8.string().regex(TEMP_REF_REGEX2, "expected a g_temp_* reference");
|
|
3968
|
+
var refSchema = z8.union([
|
|
3969
|
+
z8.string().regex(RESOURCE_NAME_REGEX, "expected a customers/\u2026/\u2026/\u2026 resource name"),
|
|
3970
|
+
z8.string().regex(NUMERIC_ID_REGEX2, "expected a numeric id"),
|
|
3874
3971
|
tempRefSchema2
|
|
3875
3972
|
]);
|
|
3876
3973
|
var targetRefSchema = refSchema;
|
|
3877
|
-
var microsSchema =
|
|
3878
|
-
var httpsUrlSchema2 =
|
|
3879
|
-
var customerIdSchema =
|
|
3880
|
-
var stageableStatusSchema2 =
|
|
3881
|
-
var matchTypeSchema =
|
|
3882
|
-
var keywordTextSchema =
|
|
3883
|
-
var budgetCreateSchema =
|
|
3884
|
-
name:
|
|
3974
|
+
var microsSchema = z8.number().int().positive("expected a positive micros amount");
|
|
3975
|
+
var httpsUrlSchema2 = z8.string().url().refine((u) => u.startsWith("https://"), "final URLs must be https");
|
|
3976
|
+
var customerIdSchema = z8.string().regex(NUMERIC_ID_REGEX2, "customerId must be the bare numeric customer id");
|
|
3977
|
+
var stageableStatusSchema2 = z8.enum(STAGEABLE_CREATE_STATUSES2);
|
|
3978
|
+
var matchTypeSchema = z8.enum(KEYWORD_MATCH_TYPES);
|
|
3979
|
+
var keywordTextSchema = z8.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");
|
|
3980
|
+
var budgetCreateSchema = z8.object({
|
|
3981
|
+
name: z8.string().min(1).max(GOOGLE_ADS_LIMITS.budget.nameMax),
|
|
3885
3982
|
amountMicros: microsSchema,
|
|
3886
|
-
deliveryMethod:
|
|
3887
|
-
explicitlyShared:
|
|
3983
|
+
deliveryMethod: z8.enum(BUDGET_DELIVERY_METHODS).default("STANDARD"),
|
|
3984
|
+
explicitlyShared: z8.boolean().default(false)
|
|
3888
3985
|
});
|
|
3889
|
-
var budgetUpdateSchema =
|
|
3890
|
-
name:
|
|
3986
|
+
var budgetUpdateSchema = z8.object({
|
|
3987
|
+
name: z8.string().min(1).max(GOOGLE_ADS_LIMITS.budget.nameMax).optional(),
|
|
3891
3988
|
amountMicros: microsSchema.optional(),
|
|
3892
|
-
deliveryMethod:
|
|
3989
|
+
deliveryMethod: z8.enum(BUDGET_DELIVERY_METHODS).optional()
|
|
3893
3990
|
}).refine((p) => Object.values(p).some((v) => v !== void 0), "update needs at least one field");
|
|
3894
|
-
var biddingConfigSchema =
|
|
3895
|
-
type:
|
|
3991
|
+
var biddingConfigSchema = z8.object({
|
|
3992
|
+
type: z8.enum(BIDDING_STRATEGY_TYPES),
|
|
3896
3993
|
targetCpaMicros: microsSchema.optional(),
|
|
3897
|
-
targetRoas:
|
|
3994
|
+
targetRoas: z8.number().positive().optional(),
|
|
3898
3995
|
cpcBidCeilingMicros: microsSchema.optional(),
|
|
3899
|
-
enhancedCpcEnabled:
|
|
3996
|
+
enhancedCpcEnabled: z8.boolean().optional()
|
|
3900
3997
|
}).superRefine((p, ctx) => {
|
|
3901
3998
|
if (p.type === "TARGET_CPA" && p.targetCpaMicros === void 0) {
|
|
3902
3999
|
ctx.addIssue({ code: "custom", path: ["targetCpaMicros"], message: "TARGET_CPA needs targetCpaMicros" });
|
|
@@ -3905,17 +4002,17 @@ var biddingConfigSchema = z7.object({
|
|
|
3905
4002
|
ctx.addIssue({ code: "custom", path: ["targetRoas"], message: "TARGET_ROAS needs targetRoas" });
|
|
3906
4003
|
}
|
|
3907
4004
|
});
|
|
3908
|
-
var networkSettingsSchema =
|
|
3909
|
-
targetGoogleSearch:
|
|
3910
|
-
targetSearchNetwork:
|
|
3911
|
-
targetContentNetwork:
|
|
3912
|
-
targetPartnerSearchNetwork:
|
|
4005
|
+
var networkSettingsSchema = z8.object({
|
|
4006
|
+
targetGoogleSearch: z8.boolean().optional(),
|
|
4007
|
+
targetSearchNetwork: z8.boolean().optional(),
|
|
4008
|
+
targetContentNetwork: z8.boolean().optional(),
|
|
4009
|
+
targetPartnerSearchNetwork: z8.boolean().optional()
|
|
3913
4010
|
});
|
|
3914
|
-
var dateSchema =
|
|
3915
|
-
var campaignCreateSchema2 =
|
|
3916
|
-
name:
|
|
3917
|
-
channelType:
|
|
3918
|
-
channelSubType:
|
|
4011
|
+
var dateSchema = z8.string().regex(/^\d{4}-\d{2}-\d{2}$/, "expected a YYYY-MM-DD date");
|
|
4012
|
+
var campaignCreateSchema2 = z8.object({
|
|
4013
|
+
name: z8.string().min(1).max(GOOGLE_ADS_LIMITS.campaign.nameMax),
|
|
4014
|
+
channelType: z8.enum(ADVERTISING_CHANNEL_TYPES),
|
|
4015
|
+
channelSubType: z8.enum(ADVERTISING_CHANNEL_SUB_TYPES).optional(),
|
|
3919
4016
|
budget: refSchema,
|
|
3920
4017
|
/** Inline standard bidding, or a portfolio strategy ref via biddingStrategy. */
|
|
3921
4018
|
bidding: biddingConfigSchema.optional(),
|
|
@@ -3924,7 +4021,7 @@ var campaignCreateSchema2 = z7.object({
|
|
|
3924
4021
|
startDate: dateSchema.optional(),
|
|
3925
4022
|
endDate: dateSchema.optional(),
|
|
3926
4023
|
/** Advisory Google Ads UI objective — drives warnings, not sent to the API. */
|
|
3927
|
-
objective:
|
|
4024
|
+
objective: z8.enum(CAMPAIGN_OBJECTIVES).optional(),
|
|
3928
4025
|
status: stageableStatusSchema2.default("PAUSED")
|
|
3929
4026
|
}).superRefine((p, ctx) => {
|
|
3930
4027
|
if (!p.bidding && !p.biddingStrategy) {
|
|
@@ -3948,129 +4045,129 @@ var campaignCreateSchema2 = z7.object({
|
|
|
3948
4045
|
ctx.addIssue({ code: "custom", path: ["endDate"], message: "endDate must be after startDate" });
|
|
3949
4046
|
}
|
|
3950
4047
|
});
|
|
3951
|
-
var campaignUpdateSchema2 =
|
|
3952
|
-
name:
|
|
4048
|
+
var campaignUpdateSchema2 = z8.object({
|
|
4049
|
+
name: z8.string().min(1).max(GOOGLE_ADS_LIMITS.campaign.nameMax).optional(),
|
|
3953
4050
|
budget: refSchema.optional(),
|
|
3954
4051
|
bidding: biddingConfigSchema.optional(),
|
|
3955
4052
|
networkSettings: networkSettingsSchema.optional(),
|
|
3956
4053
|
startDate: dateSchema.optional(),
|
|
3957
4054
|
endDate: dateSchema.optional(),
|
|
3958
|
-
status:
|
|
4055
|
+
status: z8.enum(["ENABLED", "PAUSED", "REMOVED"]).optional()
|
|
3959
4056
|
}).refine((p) => Object.values(p).some((v) => v !== void 0), "update needs at least one field");
|
|
3960
|
-
var adGroupCreateSchema =
|
|
3961
|
-
name:
|
|
4057
|
+
var adGroupCreateSchema = z8.object({
|
|
4058
|
+
name: z8.string().min(1).max(GOOGLE_ADS_LIMITS.adGroup.nameMax),
|
|
3962
4059
|
campaign: refSchema,
|
|
3963
|
-
type:
|
|
4060
|
+
type: z8.enum(AD_GROUP_TYPES).default("SEARCH_STANDARD"),
|
|
3964
4061
|
cpcBidMicros: microsSchema.optional(),
|
|
3965
4062
|
status: stageableStatusSchema2.default("PAUSED")
|
|
3966
4063
|
});
|
|
3967
|
-
var adGroupUpdateSchema =
|
|
3968
|
-
name:
|
|
4064
|
+
var adGroupUpdateSchema = z8.object({
|
|
4065
|
+
name: z8.string().min(1).max(GOOGLE_ADS_LIMITS.adGroup.nameMax).optional(),
|
|
3969
4066
|
cpcBidMicros: microsSchema.optional(),
|
|
3970
|
-
status:
|
|
4067
|
+
status: z8.enum(["ENABLED", "PAUSED", "REMOVED"]).optional()
|
|
3971
4068
|
}).refine((p) => Object.values(p).some((v) => v !== void 0), "update needs at least one field");
|
|
3972
|
-
var keywordAddSchema =
|
|
4069
|
+
var keywordAddSchema = z8.object({
|
|
3973
4070
|
adGroup: refSchema,
|
|
3974
4071
|
text: keywordTextSchema,
|
|
3975
4072
|
matchType: matchTypeSchema,
|
|
3976
4073
|
cpcBidMicros: microsSchema.optional(),
|
|
3977
|
-
finalUrls:
|
|
4074
|
+
finalUrls: z8.array(httpsUrlSchema2).optional(),
|
|
3978
4075
|
status: stageableStatusSchema2.default("ENABLED")
|
|
3979
4076
|
});
|
|
3980
|
-
var keywordUpdateSchema =
|
|
4077
|
+
var keywordUpdateSchema = z8.object({
|
|
3981
4078
|
cpcBidMicros: microsSchema.optional(),
|
|
3982
|
-
finalUrls:
|
|
3983
|
-
status:
|
|
4079
|
+
finalUrls: z8.array(httpsUrlSchema2).optional(),
|
|
4080
|
+
status: z8.enum(["ENABLED", "PAUSED", "REMOVED"]).optional()
|
|
3984
4081
|
}).refine((p) => Object.values(p).some((v) => v !== void 0), "update needs at least one field");
|
|
3985
|
-
var negativeKeywordAddSchema =
|
|
3986
|
-
level:
|
|
4082
|
+
var negativeKeywordAddSchema = z8.object({
|
|
4083
|
+
level: z8.enum(["adGroup", "campaign"]),
|
|
3987
4084
|
parent: refSchema,
|
|
3988
4085
|
text: keywordTextSchema,
|
|
3989
4086
|
matchType: matchTypeSchema
|
|
3990
4087
|
});
|
|
3991
|
-
var sharedSetCreateSchema =
|
|
3992
|
-
name:
|
|
3993
|
-
type:
|
|
4088
|
+
var sharedSetCreateSchema = z8.object({
|
|
4089
|
+
name: z8.string().min(1).max(GOOGLE_ADS_LIMITS.sharedSet.nameMax),
|
|
4090
|
+
type: z8.enum(SHARED_SET_TYPES).default("NEGATIVE_KEYWORDS")
|
|
3994
4091
|
});
|
|
3995
|
-
var sharedSetMemberAddSchema =
|
|
4092
|
+
var sharedSetMemberAddSchema = z8.object({
|
|
3996
4093
|
sharedSet: refSchema,
|
|
3997
4094
|
text: keywordTextSchema,
|
|
3998
4095
|
matchType: matchTypeSchema
|
|
3999
4096
|
});
|
|
4000
|
-
var campaignSharedSetAttachSchema =
|
|
4097
|
+
var campaignSharedSetAttachSchema = z8.object({
|
|
4001
4098
|
campaign: refSchema,
|
|
4002
4099
|
sharedSet: refSchema
|
|
4003
4100
|
});
|
|
4004
|
-
var adTextAssetSchema =
|
|
4005
|
-
text:
|
|
4006
|
-
pinnedField:
|
|
4101
|
+
var adTextAssetSchema = z8.object({
|
|
4102
|
+
text: z8.string().min(1),
|
|
4103
|
+
pinnedField: z8.enum(PINNED_FIELDS).optional()
|
|
4007
4104
|
});
|
|
4008
|
-
var responsiveSearchAdSchema =
|
|
4009
|
-
format:
|
|
4010
|
-
headlines:
|
|
4105
|
+
var responsiveSearchAdSchema = z8.object({
|
|
4106
|
+
format: z8.literal("responsiveSearch"),
|
|
4107
|
+
headlines: z8.array(
|
|
4011
4108
|
adTextAssetSchema.refine(
|
|
4012
4109
|
(a) => a.text.length <= GOOGLE_ADS_LIMITS.responsiveSearchAd.headlineTextMax,
|
|
4013
4110
|
"headline exceeds 30 chars"
|
|
4014
4111
|
)
|
|
4015
4112
|
).min(GOOGLE_ADS_LIMITS.responsiveSearchAd.headlinesMin).max(GOOGLE_ADS_LIMITS.responsiveSearchAd.headlinesMax),
|
|
4016
|
-
descriptions:
|
|
4113
|
+
descriptions: z8.array(
|
|
4017
4114
|
adTextAssetSchema.refine(
|
|
4018
4115
|
(a) => a.text.length <= GOOGLE_ADS_LIMITS.responsiveSearchAd.descriptionTextMax,
|
|
4019
4116
|
"description exceeds 90 chars"
|
|
4020
4117
|
)
|
|
4021
4118
|
).min(GOOGLE_ADS_LIMITS.responsiveSearchAd.descriptionsMin).max(GOOGLE_ADS_LIMITS.responsiveSearchAd.descriptionsMax),
|
|
4022
|
-
path1:
|
|
4023
|
-
path2:
|
|
4024
|
-
finalUrls:
|
|
4025
|
-
});
|
|
4026
|
-
var responsiveDisplayAdSchema =
|
|
4027
|
-
format:
|
|
4028
|
-
headlines:
|
|
4029
|
-
longHeadline:
|
|
4030
|
-
descriptions:
|
|
4031
|
-
businessName:
|
|
4119
|
+
path1: z8.string().max(GOOGLE_ADS_LIMITS.responsiveSearchAd.pathMax).optional(),
|
|
4120
|
+
path2: z8.string().max(GOOGLE_ADS_LIMITS.responsiveSearchAd.pathMax).optional(),
|
|
4121
|
+
finalUrls: z8.array(httpsUrlSchema2).min(1)
|
|
4122
|
+
});
|
|
4123
|
+
var responsiveDisplayAdSchema = z8.object({
|
|
4124
|
+
format: z8.literal("responsiveDisplay"),
|
|
4125
|
+
headlines: z8.array(z8.object({ text: z8.string().min(1).max(GOOGLE_ADS_LIMITS.responsiveDisplayAd.headlineTextMax) })).min(1).max(5),
|
|
4126
|
+
longHeadline: z8.object({ text: z8.string().min(1).max(GOOGLE_ADS_LIMITS.responsiveDisplayAd.longHeadlineTextMax) }),
|
|
4127
|
+
descriptions: z8.array(z8.object({ text: z8.string().min(1).max(GOOGLE_ADS_LIMITS.responsiveDisplayAd.descriptionTextMax) })).min(1).max(5),
|
|
4128
|
+
businessName: z8.string().min(1).max(GOOGLE_ADS_LIMITS.responsiveDisplayAd.businessNameMax),
|
|
4032
4129
|
// A Responsive Display Ad's images are fields on the ad's own content (never campaign-level
|
|
4033
4130
|
// asset links). Google requires ≥1 landscape marketing image (1.91:1) AND ≥1 square marketing
|
|
4034
4131
|
// image (1:1) to serve; the logo images are optional.
|
|
4035
|
-
marketingImageAssets:
|
|
4036
|
-
squareMarketingImageAssets:
|
|
4037
|
-
logoImageAssets:
|
|
4038
|
-
finalUrls:
|
|
4039
|
-
});
|
|
4040
|
-
var callAdSchema =
|
|
4041
|
-
format:
|
|
4042
|
-
countryCode:
|
|
4043
|
-
phoneNumber:
|
|
4044
|
-
headline1:
|
|
4045
|
-
headline2:
|
|
4046
|
-
description1:
|
|
4047
|
-
description2:
|
|
4048
|
-
businessName:
|
|
4049
|
-
finalUrls:
|
|
4050
|
-
});
|
|
4051
|
-
var appAdSchema =
|
|
4052
|
-
format:
|
|
4053
|
-
headlines:
|
|
4054
|
-
descriptions:
|
|
4055
|
-
});
|
|
4056
|
-
var videoAdSchema =
|
|
4057
|
-
format:
|
|
4132
|
+
marketingImageAssets: z8.array(refSchema).optional(),
|
|
4133
|
+
squareMarketingImageAssets: z8.array(refSchema).optional(),
|
|
4134
|
+
logoImageAssets: z8.array(refSchema).optional(),
|
|
4135
|
+
finalUrls: z8.array(httpsUrlSchema2).min(1)
|
|
4136
|
+
});
|
|
4137
|
+
var callAdSchema = z8.object({
|
|
4138
|
+
format: z8.literal("call"),
|
|
4139
|
+
countryCode: z8.string().length(2),
|
|
4140
|
+
phoneNumber: z8.string().min(3),
|
|
4141
|
+
headline1: z8.string().min(1).max(30),
|
|
4142
|
+
headline2: z8.string().min(1).max(30),
|
|
4143
|
+
description1: z8.string().min(1).max(90),
|
|
4144
|
+
description2: z8.string().min(1).max(90),
|
|
4145
|
+
businessName: z8.string().min(1).max(25),
|
|
4146
|
+
finalUrls: z8.array(httpsUrlSchema2).min(1)
|
|
4147
|
+
});
|
|
4148
|
+
var appAdSchema = z8.object({
|
|
4149
|
+
format: z8.literal("app"),
|
|
4150
|
+
headlines: z8.array(z8.object({ text: z8.string().min(1).max(30) })).min(1),
|
|
4151
|
+
descriptions: z8.array(z8.object({ text: z8.string().min(1).max(90) })).min(1)
|
|
4152
|
+
});
|
|
4153
|
+
var videoAdSchema = z8.object({
|
|
4154
|
+
format: z8.literal("video"),
|
|
4058
4155
|
// A raw YouTube id is not a publishable Google Ads reference — the video must be staged as
|
|
4059
4156
|
// its own `google.asset.create` (type: youtubeVideo) first, then referenced here by asset ref.
|
|
4060
|
-
videoAssets:
|
|
4061
|
-
finalUrls:
|
|
4062
|
-
});
|
|
4063
|
-
var demandGenAdSchema =
|
|
4064
|
-
format:
|
|
4065
|
-
headlines:
|
|
4066
|
-
descriptions:
|
|
4067
|
-
businessName:
|
|
4068
|
-
finalUrls:
|
|
4069
|
-
imageAssets:
|
|
4070
|
-
squareImageAssets:
|
|
4071
|
-
logoImageAssets:
|
|
4072
|
-
});
|
|
4073
|
-
var adContentSchema =
|
|
4157
|
+
videoAssets: z8.array(refSchema).min(1),
|
|
4158
|
+
finalUrls: z8.array(httpsUrlSchema2).min(1)
|
|
4159
|
+
});
|
|
4160
|
+
var demandGenAdSchema = z8.object({
|
|
4161
|
+
format: z8.literal("demandGen"),
|
|
4162
|
+
headlines: z8.array(z8.object({ text: z8.string().min(1).max(40) })).min(1).max(5),
|
|
4163
|
+
descriptions: z8.array(z8.object({ text: z8.string().min(1).max(90) })).min(1).max(5),
|
|
4164
|
+
businessName: z8.string().min(1).max(25),
|
|
4165
|
+
finalUrls: z8.array(httpsUrlSchema2).min(1),
|
|
4166
|
+
imageAssets: z8.array(refSchema).optional(),
|
|
4167
|
+
squareImageAssets: z8.array(refSchema).optional(),
|
|
4168
|
+
logoImageAssets: z8.array(refSchema).optional()
|
|
4169
|
+
});
|
|
4170
|
+
var adContentSchema = z8.discriminatedUnion("format", [
|
|
4074
4171
|
responsiveSearchAdSchema,
|
|
4075
4172
|
responsiveDisplayAdSchema,
|
|
4076
4173
|
callAdSchema,
|
|
@@ -4078,45 +4175,45 @@ var adContentSchema = z7.discriminatedUnion("format", [
|
|
|
4078
4175
|
videoAdSchema,
|
|
4079
4176
|
demandGenAdSchema
|
|
4080
4177
|
]);
|
|
4081
|
-
var adCreateSchema =
|
|
4178
|
+
var adCreateSchema = z8.object({
|
|
4082
4179
|
adGroup: refSchema,
|
|
4083
4180
|
status: stageableStatusSchema2.default("PAUSED"),
|
|
4084
4181
|
content: adContentSchema
|
|
4085
4182
|
});
|
|
4086
|
-
var adUpdateSchema =
|
|
4087
|
-
status:
|
|
4183
|
+
var adUpdateSchema = z8.object({
|
|
4184
|
+
status: z8.enum(["ENABLED", "PAUSED", "REMOVED"]).optional(),
|
|
4088
4185
|
/** Whole-content replacement for RSA-like formats; re-validated against adContentSchema. */
|
|
4089
|
-
content:
|
|
4186
|
+
content: z8.record(z8.string(), z8.unknown()).optional()
|
|
4090
4187
|
}).refine((p) => Object.values(p).some((v) => v !== void 0), "update needs at least one field");
|
|
4091
|
-
var textAssetSchema =
|
|
4092
|
-
var imageAssetSchema =
|
|
4093
|
-
type:
|
|
4094
|
-
imageId:
|
|
4095
|
-
name:
|
|
4096
|
-
});
|
|
4097
|
-
var youtubeVideoAssetSchema =
|
|
4098
|
-
type:
|
|
4099
|
-
youtubeVideoId:
|
|
4100
|
-
name:
|
|
4101
|
-
});
|
|
4102
|
-
var sitelinkAssetSchema =
|
|
4103
|
-
type:
|
|
4104
|
-
linkText:
|
|
4105
|
-
description1:
|
|
4106
|
-
description2:
|
|
4107
|
-
finalUrls:
|
|
4108
|
-
});
|
|
4109
|
-
var calloutAssetSchema =
|
|
4110
|
-
type:
|
|
4111
|
-
calloutText:
|
|
4112
|
-
});
|
|
4113
|
-
var structuredSnippetAssetSchema =
|
|
4114
|
-
type:
|
|
4115
|
-
header:
|
|
4116
|
-
values:
|
|
4117
|
-
});
|
|
4118
|
-
var callToActionAssetSchema =
|
|
4119
|
-
var assetCreateSchema =
|
|
4188
|
+
var textAssetSchema = z8.object({ type: z8.literal("text"), text: z8.string().min(1) });
|
|
4189
|
+
var imageAssetSchema = z8.object({
|
|
4190
|
+
type: z8.literal("image"),
|
|
4191
|
+
imageId: z8.string().min(1),
|
|
4192
|
+
name: z8.string().optional()
|
|
4193
|
+
});
|
|
4194
|
+
var youtubeVideoAssetSchema = z8.object({
|
|
4195
|
+
type: z8.literal("youtubeVideo"),
|
|
4196
|
+
youtubeVideoId: z8.string().min(1),
|
|
4197
|
+
name: z8.string().optional()
|
|
4198
|
+
});
|
|
4199
|
+
var sitelinkAssetSchema = z8.object({
|
|
4200
|
+
type: z8.literal("sitelink"),
|
|
4201
|
+
linkText: z8.string().min(1).max(GOOGLE_ADS_LIMITS.asset.sitelinkLinkTextMax),
|
|
4202
|
+
description1: z8.string().max(GOOGLE_ADS_LIMITS.asset.sitelinkDescriptionMax).optional(),
|
|
4203
|
+
description2: z8.string().max(GOOGLE_ADS_LIMITS.asset.sitelinkDescriptionMax).optional(),
|
|
4204
|
+
finalUrls: z8.array(httpsUrlSchema2).min(1)
|
|
4205
|
+
});
|
|
4206
|
+
var calloutAssetSchema = z8.object({
|
|
4207
|
+
type: z8.literal("callout"),
|
|
4208
|
+
calloutText: z8.string().min(1).max(GOOGLE_ADS_LIMITS.asset.calloutTextMax)
|
|
4209
|
+
});
|
|
4210
|
+
var structuredSnippetAssetSchema = z8.object({
|
|
4211
|
+
type: z8.literal("structuredSnippet"),
|
|
4212
|
+
header: z8.string().min(1).max(GOOGLE_ADS_LIMITS.asset.structuredSnippetHeaderMax),
|
|
4213
|
+
values: z8.array(z8.string().min(1)).min(GOOGLE_ADS_LIMITS.asset.structuredSnippetValuesMin).max(GOOGLE_ADS_LIMITS.asset.structuredSnippetValuesMax)
|
|
4214
|
+
});
|
|
4215
|
+
var callToActionAssetSchema = z8.object({ type: z8.literal("callToAction"), callToAction: z8.string().min(1) });
|
|
4216
|
+
var assetCreateSchema = z8.discriminatedUnion("type", [
|
|
4120
4217
|
textAssetSchema,
|
|
4121
4218
|
imageAssetSchema,
|
|
4122
4219
|
youtubeVideoAssetSchema,
|
|
@@ -4125,136 +4222,136 @@ var assetCreateSchema = z7.discriminatedUnion("type", [
|
|
|
4125
4222
|
structuredSnippetAssetSchema,
|
|
4126
4223
|
callToActionAssetSchema
|
|
4127
4224
|
]);
|
|
4128
|
-
var assetUpdateSchema =
|
|
4129
|
-
name:
|
|
4130
|
-
linkText:
|
|
4131
|
-
description1:
|
|
4132
|
-
description2:
|
|
4133
|
-
finalUrls:
|
|
4134
|
-
calloutText:
|
|
4135
|
-
header:
|
|
4136
|
-
values:
|
|
4137
|
-
callToAction:
|
|
4138
|
-
text:
|
|
4225
|
+
var assetUpdateSchema = z8.object({
|
|
4226
|
+
name: z8.string().min(1).optional(),
|
|
4227
|
+
linkText: z8.string().min(1).max(GOOGLE_ADS_LIMITS.asset.sitelinkLinkTextMax).optional(),
|
|
4228
|
+
description1: z8.string().max(GOOGLE_ADS_LIMITS.asset.sitelinkDescriptionMax).optional(),
|
|
4229
|
+
description2: z8.string().max(GOOGLE_ADS_LIMITS.asset.sitelinkDescriptionMax).optional(),
|
|
4230
|
+
finalUrls: z8.array(httpsUrlSchema2).min(1).optional(),
|
|
4231
|
+
calloutText: z8.string().min(1).max(GOOGLE_ADS_LIMITS.asset.calloutTextMax).optional(),
|
|
4232
|
+
header: z8.string().min(1).max(GOOGLE_ADS_LIMITS.asset.structuredSnippetHeaderMax).optional(),
|
|
4233
|
+
values: z8.array(z8.string().min(1)).min(GOOGLE_ADS_LIMITS.asset.structuredSnippetValuesMin).max(GOOGLE_ADS_LIMITS.asset.structuredSnippetValuesMax).optional(),
|
|
4234
|
+
callToAction: z8.string().min(1).optional(),
|
|
4235
|
+
text: z8.string().min(1).optional()
|
|
4139
4236
|
}).refine((p) => Object.values(p).some((v) => v !== void 0), "update needs at least one field");
|
|
4140
|
-
var assetLinkAttachSchema =
|
|
4141
|
-
level:
|
|
4237
|
+
var assetLinkAttachSchema = z8.object({
|
|
4238
|
+
level: z8.enum(["campaign", "adGroup", "customer"]),
|
|
4142
4239
|
parent: refSchema.optional(),
|
|
4143
4240
|
asset: refSchema,
|
|
4144
|
-
fieldType:
|
|
4241
|
+
fieldType: z8.enum(ASSET_FIELD_TYPES)
|
|
4145
4242
|
}).superRefine((value, ctx) => {
|
|
4146
4243
|
if (value.level !== "customer" && !value.parent) {
|
|
4147
4244
|
ctx.addIssue({
|
|
4148
|
-
code:
|
|
4245
|
+
code: z8.ZodIssueCode.custom,
|
|
4149
4246
|
path: ["parent"],
|
|
4150
4247
|
message: `parent is required for a ${value.level}-level asset link (--parent-ref)`
|
|
4151
4248
|
});
|
|
4152
4249
|
}
|
|
4153
4250
|
});
|
|
4154
|
-
var assetGroupCreateSchema =
|
|
4251
|
+
var assetGroupCreateSchema = z8.object({
|
|
4155
4252
|
campaign: refSchema,
|
|
4156
|
-
name:
|
|
4157
|
-
finalUrls:
|
|
4158
|
-
headlines:
|
|
4159
|
-
longHeadlines:
|
|
4160
|
-
descriptions:
|
|
4161
|
-
businessName:
|
|
4162
|
-
imageAssets:
|
|
4163
|
-
squareImageAssets:
|
|
4164
|
-
logoAssets:
|
|
4165
|
-
status:
|
|
4166
|
-
});
|
|
4167
|
-
var assetGroupUpdateSchema =
|
|
4168
|
-
name:
|
|
4169
|
-
finalUrls:
|
|
4170
|
-
status:
|
|
4253
|
+
name: z8.string().min(1).max(GOOGLE_ADS_LIMITS.assetGroup.nameMax),
|
|
4254
|
+
finalUrls: z8.array(httpsUrlSchema2).min(1),
|
|
4255
|
+
headlines: z8.array(z8.object({ text: z8.string().min(1).max(GOOGLE_ADS_LIMITS.assetGroup.headlineTextMax) })).min(GOOGLE_ADS_LIMITS.assetGroup.headlinesMin).max(GOOGLE_ADS_LIMITS.assetGroup.headlinesMax),
|
|
4256
|
+
longHeadlines: z8.array(z8.object({ text: z8.string().min(1).max(GOOGLE_ADS_LIMITS.assetGroup.longHeadlineTextMax) })).min(GOOGLE_ADS_LIMITS.assetGroup.longHeadlinesMin).max(GOOGLE_ADS_LIMITS.assetGroup.longHeadlinesMax),
|
|
4257
|
+
descriptions: z8.array(z8.object({ text: z8.string().min(1).max(GOOGLE_ADS_LIMITS.assetGroup.descriptionTextMax) })).min(GOOGLE_ADS_LIMITS.assetGroup.descriptionsMin).max(GOOGLE_ADS_LIMITS.assetGroup.descriptionsMax),
|
|
4258
|
+
businessName: z8.string().min(1).max(GOOGLE_ADS_LIMITS.assetGroup.businessNameMax),
|
|
4259
|
+
imageAssets: z8.array(refSchema).optional(),
|
|
4260
|
+
squareImageAssets: z8.array(refSchema).optional(),
|
|
4261
|
+
logoAssets: z8.array(refSchema).optional(),
|
|
4262
|
+
status: z8.enum(["ENABLED", "PAUSED"]).default("PAUSED")
|
|
4263
|
+
});
|
|
4264
|
+
var assetGroupUpdateSchema = z8.object({
|
|
4265
|
+
name: z8.string().min(1).max(GOOGLE_ADS_LIMITS.assetGroup.nameMax).optional(),
|
|
4266
|
+
finalUrls: z8.array(httpsUrlSchema2).min(1).optional(),
|
|
4267
|
+
status: z8.enum(["ENABLED", "PAUSED", "REMOVED"]).optional()
|
|
4171
4268
|
}).refine((p) => Object.values(p).some((v) => v !== void 0), "update needs at least one field");
|
|
4172
|
-
var audienceCreateSchema2 =
|
|
4173
|
-
name:
|
|
4174
|
-
type:
|
|
4175
|
-
description:
|
|
4269
|
+
var audienceCreateSchema2 = z8.object({
|
|
4270
|
+
name: z8.string().min(1).max(GOOGLE_ADS_LIMITS.audience.nameMax),
|
|
4271
|
+
type: z8.enum(USER_LIST_TYPES).default("BASIC"),
|
|
4272
|
+
description: z8.string().optional(),
|
|
4176
4273
|
/** Customer-match members (crm-based) — file-first for large lists. */
|
|
4177
|
-
members:
|
|
4178
|
-
sourceFileRef:
|
|
4274
|
+
members: z8.array(z8.record(z8.string(), z8.string())).optional(),
|
|
4275
|
+
sourceFileRef: z8.string().optional()
|
|
4179
4276
|
});
|
|
4180
|
-
var audienceCriterionAttachSchema =
|
|
4181
|
-
level:
|
|
4277
|
+
var audienceCriterionAttachSchema = z8.object({
|
|
4278
|
+
level: z8.enum(["campaign", "adGroup"]),
|
|
4182
4279
|
parent: refSchema,
|
|
4183
4280
|
userList: refSchema,
|
|
4184
|
-
negative:
|
|
4281
|
+
negative: z8.boolean().default(false)
|
|
4185
4282
|
});
|
|
4186
|
-
var conversionActionCreateSchema =
|
|
4187
|
-
name:
|
|
4188
|
-
type:
|
|
4189
|
-
category:
|
|
4190
|
-
countingType:
|
|
4283
|
+
var conversionActionCreateSchema = z8.object({
|
|
4284
|
+
name: z8.string().min(1).max(GOOGLE_ADS_LIMITS.conversionAction.nameMax),
|
|
4285
|
+
type: z8.enum(CONVERSION_ACTION_TYPES).default("WEBPAGE"),
|
|
4286
|
+
category: z8.enum(CONVERSION_ACTION_CATEGORIES).default("DEFAULT"),
|
|
4287
|
+
countingType: z8.enum(CONVERSION_COUNTING_TYPES).default("ONE_PER_CLICK"),
|
|
4191
4288
|
defaultValueMicros: microsSchema.optional(),
|
|
4192
|
-
defaultCurrencyCode:
|
|
4193
|
-
clickThroughLookbackWindowDays:
|
|
4194
|
-
viewThroughLookbackWindowDays:
|
|
4195
|
-
status:
|
|
4196
|
-
});
|
|
4197
|
-
var conversionActionUpdateSchema =
|
|
4198
|
-
name:
|
|
4199
|
-
category:
|
|
4200
|
-
countingType:
|
|
4289
|
+
defaultCurrencyCode: z8.string().length(3).optional(),
|
|
4290
|
+
clickThroughLookbackWindowDays: z8.number().int().positive().optional(),
|
|
4291
|
+
viewThroughLookbackWindowDays: z8.number().int().positive().optional(),
|
|
4292
|
+
status: z8.enum(["ENABLED", "PAUSED"]).default("ENABLED")
|
|
4293
|
+
});
|
|
4294
|
+
var conversionActionUpdateSchema = z8.object({
|
|
4295
|
+
name: z8.string().min(1).max(GOOGLE_ADS_LIMITS.conversionAction.nameMax).optional(),
|
|
4296
|
+
category: z8.enum(CONVERSION_ACTION_CATEGORIES).optional(),
|
|
4297
|
+
countingType: z8.enum(CONVERSION_COUNTING_TYPES).optional(),
|
|
4201
4298
|
defaultValueMicros: microsSchema.optional(),
|
|
4202
|
-
defaultCurrencyCode:
|
|
4203
|
-
clickThroughLookbackWindowDays:
|
|
4204
|
-
viewThroughLookbackWindowDays:
|
|
4205
|
-
status:
|
|
4299
|
+
defaultCurrencyCode: z8.string().length(3).optional(),
|
|
4300
|
+
clickThroughLookbackWindowDays: z8.number().int().positive().optional(),
|
|
4301
|
+
viewThroughLookbackWindowDays: z8.number().int().positive().optional(),
|
|
4302
|
+
status: z8.enum(["ENABLED", "REMOVED", "HIDDEN"]).optional()
|
|
4206
4303
|
}).refine((p) => Object.values(p).some((v) => v !== void 0), "update needs at least one field");
|
|
4207
|
-
var biddingStrategyCreateSchema =
|
|
4208
|
-
name:
|
|
4304
|
+
var biddingStrategyCreateSchema = z8.object({
|
|
4305
|
+
name: z8.string().min(1).max(GOOGLE_ADS_LIMITS.biddingStrategy.nameMax),
|
|
4209
4306
|
config: biddingConfigSchema
|
|
4210
4307
|
}).superRefine((p, ctx) => {
|
|
4211
4308
|
if (p.config.type === "MANUAL_CPC") {
|
|
4212
4309
|
ctx.addIssue({ code: "custom", path: ["config", "type"], message: "portfolio strategies cannot be Manual CPC" });
|
|
4213
4310
|
}
|
|
4214
4311
|
});
|
|
4215
|
-
var biddingStrategyUpdateSchema =
|
|
4216
|
-
name:
|
|
4312
|
+
var biddingStrategyUpdateSchema = z8.object({
|
|
4313
|
+
name: z8.string().min(1).max(GOOGLE_ADS_LIMITS.biddingStrategy.nameMax).optional(),
|
|
4217
4314
|
config: biddingConfigSchema.optional()
|
|
4218
4315
|
}).refine((p) => Object.values(p).some((v) => v !== void 0), "update needs at least one field");
|
|
4219
|
-
var labelCreateSchema =
|
|
4220
|
-
name:
|
|
4221
|
-
backgroundColor:
|
|
4222
|
-
description:
|
|
4316
|
+
var labelCreateSchema = z8.object({
|
|
4317
|
+
name: z8.string().min(1).max(GOOGLE_ADS_LIMITS.label.nameMax),
|
|
4318
|
+
backgroundColor: z8.string().regex(/^#[0-9A-Fa-f]{6}$/).optional(),
|
|
4319
|
+
description: z8.string().optional()
|
|
4223
4320
|
});
|
|
4224
|
-
var labelAttachSchema =
|
|
4225
|
-
level:
|
|
4321
|
+
var labelAttachSchema = z8.object({
|
|
4322
|
+
level: z8.enum(["campaign", "adGroup", "ad"]),
|
|
4226
4323
|
parent: refSchema,
|
|
4227
4324
|
label: refSchema
|
|
4228
4325
|
});
|
|
4229
|
-
var locationCriterionSchema =
|
|
4230
|
-
criterionType:
|
|
4231
|
-
geoTargetConstant:
|
|
4232
|
-
});
|
|
4233
|
-
var languageCriterionSchema =
|
|
4234
|
-
criterionType:
|
|
4235
|
-
languageConstant:
|
|
4236
|
-
});
|
|
4237
|
-
var adScheduleCriterionSchema =
|
|
4238
|
-
criterionType:
|
|
4239
|
-
dayOfWeek:
|
|
4240
|
-
startHour:
|
|
4241
|
-
startMinute:
|
|
4242
|
-
endHour:
|
|
4243
|
-
endMinute:
|
|
4244
|
-
});
|
|
4245
|
-
var deviceCriterionSchema =
|
|
4246
|
-
criterionType:
|
|
4247
|
-
device:
|
|
4326
|
+
var locationCriterionSchema = z8.object({
|
|
4327
|
+
criterionType: z8.literal("location"),
|
|
4328
|
+
geoTargetConstant: z8.union([z8.string().regex(GEO_TARGET_CONSTANT_REGEX), z8.string().regex(NUMERIC_ID_REGEX2)])
|
|
4329
|
+
});
|
|
4330
|
+
var languageCriterionSchema = z8.object({
|
|
4331
|
+
criterionType: z8.literal("language"),
|
|
4332
|
+
languageConstant: z8.union([z8.string().regex(LANGUAGE_CONSTANT_REGEX), z8.string().regex(NUMERIC_ID_REGEX2)])
|
|
4333
|
+
});
|
|
4334
|
+
var adScheduleCriterionSchema = z8.object({
|
|
4335
|
+
criterionType: z8.literal("adSchedule"),
|
|
4336
|
+
dayOfWeek: z8.enum(DAYS_OF_WEEK),
|
|
4337
|
+
startHour: z8.number().int().min(0).max(23),
|
|
4338
|
+
startMinute: z8.enum(["ZERO", "FIFTEEN", "THIRTY", "FORTY_FIVE"]).default("ZERO"),
|
|
4339
|
+
endHour: z8.number().int().min(0).max(24),
|
|
4340
|
+
endMinute: z8.enum(["ZERO", "FIFTEEN", "THIRTY", "FORTY_FIVE"]).default("ZERO")
|
|
4341
|
+
});
|
|
4342
|
+
var deviceCriterionSchema = z8.object({
|
|
4343
|
+
criterionType: z8.literal("device"),
|
|
4344
|
+
device: z8.enum(DEVICE_TYPES),
|
|
4248
4345
|
// Google's `CampaignCriterion.bid_modifier`: "The modifier must be in the range 0.1 - 10.0. Use 0
|
|
4249
4346
|
// 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.
|
|
4250
|
-
bidModifier:
|
|
4347
|
+
bidModifier: z8.number().min(0).max(10).optional().refine((v) => v === void 0 || v === 0 || v >= 0.1, {
|
|
4251
4348
|
message: "bid modifier must be 0 (exclude the device) or between 0.1 and 10.0"
|
|
4252
4349
|
})
|
|
4253
4350
|
});
|
|
4254
|
-
var campaignCriterionAddSchema =
|
|
4351
|
+
var campaignCriterionAddSchema = z8.object({
|
|
4255
4352
|
campaign: refSchema,
|
|
4256
|
-
negative:
|
|
4257
|
-
criterion:
|
|
4353
|
+
negative: z8.boolean().default(false),
|
|
4354
|
+
criterion: z8.discriminatedUnion("criterionType", [
|
|
4258
4355
|
locationCriterionSchema,
|
|
4259
4356
|
languageCriterionSchema,
|
|
4260
4357
|
adScheduleCriterionSchema,
|
|
@@ -4264,7 +4361,7 @@ var campaignCriterionAddSchema = z7.object({
|
|
|
4264
4361
|
const c = val.criterion;
|
|
4265
4362
|
if (c.criterionType === "adSchedule" && c.endHour === 24 && c.endMinute !== "ZERO") {
|
|
4266
4363
|
ctx.addIssue({
|
|
4267
|
-
code:
|
|
4364
|
+
code: z8.ZodIssueCode.custom,
|
|
4268
4365
|
message: "endHour 24 (midnight) cannot have a non-zero endMinute",
|
|
4269
4366
|
path: ["criterion", "endMinute"]
|
|
4270
4367
|
});
|
|
@@ -4316,17 +4413,17 @@ var GOOGLE_DRAFT_OP_KINDS = [
|
|
|
4316
4413
|
"google.campaignCriterion.add",
|
|
4317
4414
|
"google.campaignCriterion.remove"
|
|
4318
4415
|
];
|
|
4319
|
-
var googleDraftOpKindSchema =
|
|
4416
|
+
var googleDraftOpKindSchema = z8.enum(GOOGLE_DRAFT_OP_KINDS);
|
|
4320
4417
|
function createOp2(kind, payload) {
|
|
4321
|
-
return
|
|
4418
|
+
return z8.object({ kind: z8.literal(kind), customerId: customerIdSchema, payload });
|
|
4322
4419
|
}
|
|
4323
4420
|
function updateOp2(kind, payload) {
|
|
4324
|
-
return
|
|
4421
|
+
return z8.object({ kind: z8.literal(kind), customerId: customerIdSchema, target: targetRefSchema, payload });
|
|
4325
4422
|
}
|
|
4326
4423
|
function targetOp(kind) {
|
|
4327
|
-
return
|
|
4424
|
+
return z8.object({ kind: z8.literal(kind), customerId: customerIdSchema, target: targetRefSchema });
|
|
4328
4425
|
}
|
|
4329
|
-
var googleDraftOpInputSchema =
|
|
4426
|
+
var googleDraftOpInputSchema = z8.discriminatedUnion("kind", [
|
|
4330
4427
|
createOp2("google.budget.create", budgetCreateSchema),
|
|
4331
4428
|
updateOp2("google.budget.update", budgetUpdateSchema),
|
|
4332
4429
|
createOp2("google.campaign.create", campaignCreateSchema2),
|
|
@@ -4374,132 +4471,132 @@ var googleDraftOpInputSchema = z7.discriminatedUnion("kind", [
|
|
|
4374
4471
|
]);
|
|
4375
4472
|
|
|
4376
4473
|
// ../api/src/ads-google/wire.ts
|
|
4377
|
-
import { z as
|
|
4378
|
-
var googleWriteModeSchema =
|
|
4379
|
-
var googleDraftOpResultSchema =
|
|
4380
|
-
status:
|
|
4381
|
-
resourceName:
|
|
4382
|
-
error:
|
|
4383
|
-
skippedBecause:
|
|
4384
|
-
executedAt:
|
|
4385
|
-
});
|
|
4386
|
-
var googleDraftStageRequestSchema =
|
|
4387
|
-
chatId:
|
|
4474
|
+
import { z as z9 } from "zod";
|
|
4475
|
+
var googleWriteModeSchema = z9.enum(["live", "simulated"]);
|
|
4476
|
+
var googleDraftOpResultSchema = z9.object({
|
|
4477
|
+
status: z9.enum(["applied", "simulated", "failed", "skipped"]),
|
|
4478
|
+
resourceName: z9.string().optional(),
|
|
4479
|
+
error: z9.string().optional(),
|
|
4480
|
+
skippedBecause: z9.string().optional(),
|
|
4481
|
+
executedAt: z9.number().optional()
|
|
4482
|
+
});
|
|
4483
|
+
var googleDraftStageRequestSchema = z9.object({
|
|
4484
|
+
chatId: z9.string(),
|
|
4388
4485
|
op: googleDraftOpInputSchema
|
|
4389
4486
|
});
|
|
4390
|
-
var googleDraftStageResponseSchema =
|
|
4391
|
-
staged:
|
|
4392
|
-
ref:
|
|
4487
|
+
var googleDraftStageResponseSchema = z9.object({
|
|
4488
|
+
staged: z9.literal(true),
|
|
4489
|
+
ref: z9.string(),
|
|
4393
4490
|
kind: googleDraftOpKindSchema,
|
|
4394
4491
|
mode: googleWriteModeSchema,
|
|
4395
|
-
dependsOn:
|
|
4396
|
-
summary:
|
|
4397
|
-
warnings:
|
|
4492
|
+
dependsOn: z9.array(z9.string()),
|
|
4493
|
+
summary: z9.string(),
|
|
4494
|
+
warnings: z9.array(z9.string()),
|
|
4398
4495
|
/** True when the op amended an already-staged op in place instead of appending a new one. */
|
|
4399
|
-
amended:
|
|
4496
|
+
amended: z9.boolean().optional()
|
|
4400
4497
|
});
|
|
4401
|
-
var googleDraftAmendRequestSchema =
|
|
4402
|
-
chatId:
|
|
4403
|
-
ref:
|
|
4404
|
-
patch:
|
|
4498
|
+
var googleDraftAmendRequestSchema = z9.object({
|
|
4499
|
+
chatId: z9.string(),
|
|
4500
|
+
ref: z9.string(),
|
|
4501
|
+
patch: z9.record(z9.string(), z9.unknown())
|
|
4405
4502
|
});
|
|
4406
|
-
var googleDraftShowRequestSchema =
|
|
4407
|
-
chatId:
|
|
4408
|
-
ref:
|
|
4503
|
+
var googleDraftShowRequestSchema = z9.object({
|
|
4504
|
+
chatId: z9.string(),
|
|
4505
|
+
ref: z9.string()
|
|
4409
4506
|
});
|
|
4410
4507
|
var GOOGLE_DRAFT_BATCH_MAX = 500;
|
|
4411
|
-
var googleDraftStageBatchRequestSchema =
|
|
4412
|
-
chatId:
|
|
4413
|
-
ops:
|
|
4508
|
+
var googleDraftStageBatchRequestSchema = z9.object({
|
|
4509
|
+
chatId: z9.string(),
|
|
4510
|
+
ops: z9.array(googleDraftOpInputSchema).min(1).max(GOOGLE_DRAFT_BATCH_MAX)
|
|
4414
4511
|
});
|
|
4415
|
-
var googleDraftStageBatchResponseSchema =
|
|
4416
|
-
staged:
|
|
4512
|
+
var googleDraftStageBatchResponseSchema = z9.object({
|
|
4513
|
+
staged: z9.literal(true),
|
|
4417
4514
|
mode: googleWriteModeSchema,
|
|
4418
|
-
count:
|
|
4419
|
-
ops:
|
|
4420
|
-
|
|
4421
|
-
ref:
|
|
4515
|
+
count: z9.number(),
|
|
4516
|
+
ops: z9.array(
|
|
4517
|
+
z9.object({
|
|
4518
|
+
ref: z9.string(),
|
|
4422
4519
|
kind: googleDraftOpKindSchema,
|
|
4423
|
-
dependsOn:
|
|
4424
|
-
summary:
|
|
4425
|
-
warnings:
|
|
4520
|
+
dependsOn: z9.array(z9.string()),
|
|
4521
|
+
summary: z9.string(),
|
|
4522
|
+
warnings: z9.array(z9.string())
|
|
4426
4523
|
})
|
|
4427
4524
|
)
|
|
4428
4525
|
});
|
|
4429
|
-
var googleDraftOpViewSchema =
|
|
4430
|
-
ref:
|
|
4526
|
+
var googleDraftOpViewSchema = z9.object({
|
|
4527
|
+
ref: z9.string(),
|
|
4431
4528
|
kind: googleDraftOpKindSchema,
|
|
4432
|
-
customerId:
|
|
4433
|
-
target:
|
|
4434
|
-
dependsOn:
|
|
4435
|
-
summary:
|
|
4436
|
-
stagedAt:
|
|
4529
|
+
customerId: z9.string(),
|
|
4530
|
+
target: z9.string().optional(),
|
|
4531
|
+
dependsOn: z9.array(z9.string()),
|
|
4532
|
+
summary: z9.string(),
|
|
4533
|
+
stagedAt: z9.number(),
|
|
4437
4534
|
result: googleDraftOpResultSchema.optional()
|
|
4438
4535
|
});
|
|
4439
|
-
var googleDraftShowResponseSchema =
|
|
4536
|
+
var googleDraftShowResponseSchema = z9.object({
|
|
4440
4537
|
op: googleDraftOpViewSchema.extend({
|
|
4441
|
-
payload:
|
|
4442
|
-
warnings:
|
|
4443
|
-
annotations:
|
|
4538
|
+
payload: z9.unknown().optional(),
|
|
4539
|
+
warnings: z9.array(z9.string()).optional(),
|
|
4540
|
+
annotations: z9.unknown().optional()
|
|
4444
4541
|
})
|
|
4445
4542
|
});
|
|
4446
|
-
var googleDraftListRequestSchema =
|
|
4447
|
-
chatId:
|
|
4543
|
+
var googleDraftListRequestSchema = z9.object({
|
|
4544
|
+
chatId: z9.string()
|
|
4448
4545
|
});
|
|
4449
|
-
var googleDraftAdvisorySchema =
|
|
4450
|
-
scope:
|
|
4451
|
-
message:
|
|
4546
|
+
var googleDraftAdvisorySchema = z9.object({
|
|
4547
|
+
scope: z9.enum(["campaign", "adGroup"]),
|
|
4548
|
+
message: z9.string()
|
|
4452
4549
|
});
|
|
4453
|
-
var googleDraftStatusCollectionSchema =
|
|
4454
|
-
label:
|
|
4455
|
-
added:
|
|
4456
|
-
removed:
|
|
4457
|
-
existing:
|
|
4550
|
+
var googleDraftStatusCollectionSchema = z9.object({
|
|
4551
|
+
label: z9.string(),
|
|
4552
|
+
added: z9.number(),
|
|
4553
|
+
removed: z9.number(),
|
|
4554
|
+
existing: z9.number()
|
|
4458
4555
|
});
|
|
4459
|
-
var googleDraftChangeOperationSchema =
|
|
4460
|
-
var googleDraftStatusNodeSchema =
|
|
4461
|
-
() =>
|
|
4462
|
-
entity:
|
|
4463
|
-
name:
|
|
4556
|
+
var googleDraftChangeOperationSchema = z9.enum(["create", "update", "pause", "resume", "remove"]);
|
|
4557
|
+
var googleDraftStatusNodeSchema = z9.lazy(
|
|
4558
|
+
() => z9.object({
|
|
4559
|
+
entity: z9.string(),
|
|
4560
|
+
name: z9.string(),
|
|
4464
4561
|
operation: googleDraftChangeOperationSchema.optional(),
|
|
4465
|
-
existing:
|
|
4466
|
-
collections:
|
|
4467
|
-
children:
|
|
4468
|
-
warnings:
|
|
4562
|
+
existing: z9.boolean(),
|
|
4563
|
+
collections: z9.array(googleDraftStatusCollectionSchema),
|
|
4564
|
+
children: z9.array(googleDraftStatusNodeSchema),
|
|
4565
|
+
warnings: z9.array(z9.string()).optional()
|
|
4469
4566
|
})
|
|
4470
4567
|
);
|
|
4471
|
-
var googleDraftListResponseSchema =
|
|
4472
|
-
status:
|
|
4568
|
+
var googleDraftListResponseSchema = z9.object({
|
|
4569
|
+
status: z9.enum(["active", "publishing", "applied", "discarded", "none"]),
|
|
4473
4570
|
mode: googleWriteModeSchema,
|
|
4474
|
-
count:
|
|
4475
|
-
ops:
|
|
4571
|
+
count: z9.number(),
|
|
4572
|
+
ops: z9.array(googleDraftOpViewSchema),
|
|
4476
4573
|
/** Grouped campaign ▸ ad group ▸ ad tree for the readable CLI status view. */
|
|
4477
|
-
tree:
|
|
4574
|
+
tree: z9.array(googleDraftStatusNodeSchema).optional(),
|
|
4478
4575
|
/** Non-blocking completeness advisories for the whole draft. */
|
|
4479
|
-
advisories:
|
|
4576
|
+
advisories: z9.array(googleDraftAdvisorySchema).optional()
|
|
4480
4577
|
});
|
|
4481
|
-
var googleDraftRemoveRequestSchema =
|
|
4482
|
-
chatId:
|
|
4483
|
-
ref:
|
|
4578
|
+
var googleDraftRemoveRequestSchema = z9.object({
|
|
4579
|
+
chatId: z9.string(),
|
|
4580
|
+
ref: z9.string()
|
|
4484
4581
|
});
|
|
4485
|
-
var googleDraftRemoveResponseSchema =
|
|
4582
|
+
var googleDraftRemoveResponseSchema = z9.object({
|
|
4486
4583
|
/** The requested ref plus any dependents removed by cascade. */
|
|
4487
|
-
removed:
|
|
4584
|
+
removed: z9.array(z9.string())
|
|
4488
4585
|
});
|
|
4489
|
-
var googleDraftClearRequestSchema =
|
|
4490
|
-
chatId:
|
|
4586
|
+
var googleDraftClearRequestSchema = z9.object({
|
|
4587
|
+
chatId: z9.string()
|
|
4491
4588
|
});
|
|
4492
|
-
var googleDraftClearResponseSchema =
|
|
4493
|
-
cleared:
|
|
4589
|
+
var googleDraftClearResponseSchema = z9.object({
|
|
4590
|
+
cleared: z9.number()
|
|
4494
4591
|
});
|
|
4495
|
-
var googleFieldErrorSchema =
|
|
4496
|
-
path:
|
|
4497
|
-
message:
|
|
4592
|
+
var googleFieldErrorSchema = z9.object({
|
|
4593
|
+
path: z9.string(),
|
|
4594
|
+
message: z9.string()
|
|
4498
4595
|
});
|
|
4499
|
-
var googleDraftErrorResponseSchema =
|
|
4500
|
-
code:
|
|
4501
|
-
error:
|
|
4502
|
-
fields:
|
|
4596
|
+
var googleDraftErrorResponseSchema = z9.object({
|
|
4597
|
+
code: z9.string(),
|
|
4598
|
+
error: z9.string(),
|
|
4599
|
+
fields: z9.array(googleFieldErrorSchema).optional()
|
|
4503
4600
|
});
|
|
4504
4601
|
|
|
4505
4602
|
// src/commands/ads/google/draft-status.ts
|
|
@@ -9383,7 +9480,7 @@ var leadFormsCreateCommand = defineCommand38({
|
|
|
9383
9480
|
Required: name, headline (\u226460), privacyPolicyUrl, questions[] (\u226412; playbook: \u22644 for completion).
|
|
9384
9481
|
Each question is a predefined profile field ({ name, predefinedField: "EMAIL" }) or a custom question ({ name, questionType: "MULTIPLE_CHOICE", options: [...] }; \u22643 custom).
|
|
9385
9482
|
Best-practice fields the preview will nudge for if missing: 1-3 qualifying questions, consents[] (disclosure checkboxes), thankYou.message + thankYou.landingUrl|appointmentUrl.
|
|
9386
|
-
Also supported: locale, formImageId|formImageUrn,
|
|
9483
|
+
Also supported: locale, formImageId|formImageUrn, hiddenFields[], legalDisclaimer, thankYou.cta. Example: baker ads linkedin lead-forms create --file form.json`
|
|
9387
9484
|
},
|
|
9388
9485
|
args: {
|
|
9389
9486
|
...accountArgs,
|
|
@@ -10807,17 +10904,17 @@ var NUMERIC_ID_REGEX3 = /^\d+$/;
|
|
|
10807
10904
|
var IMAGE_HASH_REGEX = /^[A-Fa-f0-9]{16,}$/;
|
|
10808
10905
|
|
|
10809
10906
|
// ../api/src/ads-meta/ops.ts
|
|
10810
|
-
import { z as
|
|
10811
|
-
var tempRefSchema3 =
|
|
10812
|
-
var parentRefSchema2 =
|
|
10813
|
-
var moneySchema2 =
|
|
10814
|
-
amount:
|
|
10815
|
-
currencyCode:
|
|
10816
|
-
});
|
|
10817
|
-
var httpsUrlSchema3 =
|
|
10818
|
-
var bakerMediaIdSchema2 =
|
|
10819
|
-
var stageableStatusSchema3 =
|
|
10820
|
-
var updateStatusSchema =
|
|
10907
|
+
import { z as z10 } from "zod";
|
|
10908
|
+
var tempRefSchema3 = z10.string().regex(TEMP_REF_REGEX3, "expected a meta_temp_* reference");
|
|
10909
|
+
var parentRefSchema2 = z10.union([z10.string().regex(NUMERIC_ID_REGEX3, "expected a numeric id"), tempRefSchema3]);
|
|
10910
|
+
var moneySchema2 = z10.object({
|
|
10911
|
+
amount: z10.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"),
|
|
10912
|
+
currencyCode: z10.string().length(3).optional()
|
|
10913
|
+
});
|
|
10914
|
+
var httpsUrlSchema3 = z10.string().url().refine((u) => u.startsWith("https://"), "destination URLs must be https");
|
|
10915
|
+
var bakerMediaIdSchema2 = z10.string().min(1);
|
|
10916
|
+
var stageableStatusSchema3 = z10.enum(STAGEABLE_CREATE_STATUSES3);
|
|
10917
|
+
var updateStatusSchema = z10.enum(UPDATE_STATUSES);
|
|
10821
10918
|
function currencyMinimums2(currencyCode) {
|
|
10822
10919
|
return CURRENCY_MINIMUMS2[currencyCode] ?? DEFAULT_CURRENCY_MINIMUM2;
|
|
10823
10920
|
}
|
|
@@ -10829,50 +10926,50 @@ function validateDailyBudgetFloor(money, ctx, path12) {
|
|
|
10829
10926
|
}
|
|
10830
10927
|
}
|
|
10831
10928
|
}
|
|
10832
|
-
var geoLocationsSchema =
|
|
10833
|
-
countries:
|
|
10834
|
-
regions:
|
|
10835
|
-
cities:
|
|
10836
|
-
zips:
|
|
10837
|
-
location_types:
|
|
10838
|
-
}).catchall(
|
|
10839
|
-
var idNameSchema =
|
|
10840
|
-
var metaTargetingSchema =
|
|
10929
|
+
var geoLocationsSchema = z10.object({
|
|
10930
|
+
countries: z10.array(z10.string().length(2)).optional(),
|
|
10931
|
+
regions: z10.array(z10.object({ key: z10.string() })).optional(),
|
|
10932
|
+
cities: z10.array(z10.object({ key: z10.string(), radius: z10.number().optional(), distance_unit: z10.string().optional() })).optional(),
|
|
10933
|
+
zips: z10.array(z10.object({ key: z10.string() })).optional(),
|
|
10934
|
+
location_types: z10.array(z10.string()).optional()
|
|
10935
|
+
}).catchall(z10.unknown());
|
|
10936
|
+
var idNameSchema = z10.object({ id: z10.string(), name: z10.string().optional() });
|
|
10937
|
+
var metaTargetingSchema = z10.object({
|
|
10841
10938
|
geo_locations: geoLocationsSchema.optional(),
|
|
10842
10939
|
excluded_geo_locations: geoLocationsSchema.optional(),
|
|
10843
|
-
age_min:
|
|
10844
|
-
age_max:
|
|
10845
|
-
genders:
|
|
10846
|
-
locales:
|
|
10847
|
-
interests:
|
|
10848
|
-
behaviors:
|
|
10849
|
-
custom_audiences:
|
|
10850
|
-
excluded_custom_audiences:
|
|
10851
|
-
flexible_spec:
|
|
10852
|
-
exclusions:
|
|
10853
|
-
publisher_platforms:
|
|
10854
|
-
facebook_positions:
|
|
10855
|
-
instagram_positions:
|
|
10856
|
-
audience_network_positions:
|
|
10857
|
-
messenger_positions:
|
|
10858
|
-
device_platforms:
|
|
10859
|
-
targeting_automation:
|
|
10860
|
-
}).catchall(
|
|
10861
|
-
var specialAdCategoriesSchema =
|
|
10862
|
-
var campaignCreateSchema3 =
|
|
10863
|
-
name:
|
|
10864
|
-
objective:
|
|
10940
|
+
age_min: z10.number().int().min(13).max(65).optional(),
|
|
10941
|
+
age_max: z10.number().int().min(13).max(65).optional(),
|
|
10942
|
+
genders: z10.array(z10.union([z10.literal(1), z10.literal(2)])).optional(),
|
|
10943
|
+
locales: z10.array(z10.number().int()).optional(),
|
|
10944
|
+
interests: z10.array(idNameSchema).optional(),
|
|
10945
|
+
behaviors: z10.array(idNameSchema).optional(),
|
|
10946
|
+
custom_audiences: z10.array(z10.object({ id: parentRefSchema2 })).optional(),
|
|
10947
|
+
excluded_custom_audiences: z10.array(z10.object({ id: parentRefSchema2 })).optional(),
|
|
10948
|
+
flexible_spec: z10.array(z10.record(z10.string(), z10.unknown())).optional(),
|
|
10949
|
+
exclusions: z10.record(z10.string(), z10.unknown()).optional(),
|
|
10950
|
+
publisher_platforms: z10.array(z10.string()).optional(),
|
|
10951
|
+
facebook_positions: z10.array(z10.string()).optional(),
|
|
10952
|
+
instagram_positions: z10.array(z10.string()).optional(),
|
|
10953
|
+
audience_network_positions: z10.array(z10.string()).optional(),
|
|
10954
|
+
messenger_positions: z10.array(z10.string()).optional(),
|
|
10955
|
+
device_platforms: z10.array(z10.string()).optional(),
|
|
10956
|
+
targeting_automation: z10.object({ advantage_audience: z10.union([z10.literal(0), z10.literal(1)]) }).partial().optional()
|
|
10957
|
+
}).catchall(z10.unknown());
|
|
10958
|
+
var specialAdCategoriesSchema = z10.array(z10.enum(SPECIAL_AD_CATEGORIES)).default(["NONE"]);
|
|
10959
|
+
var campaignCreateSchema3 = z10.object({
|
|
10960
|
+
name: z10.string().min(1).max(META_LIMITS.campaign.nameMax),
|
|
10961
|
+
objective: z10.enum(OBJECTIVES),
|
|
10865
10962
|
status: stageableStatusSchema3.default("PAUSED"),
|
|
10866
10963
|
special_ad_categories: specialAdCategoriesSchema,
|
|
10867
|
-
special_ad_category_country:
|
|
10868
|
-
buying_type:
|
|
10869
|
-
bid_strategy:
|
|
10964
|
+
special_ad_category_country: z10.array(z10.string().length(2)).optional(),
|
|
10965
|
+
buying_type: z10.enum(BUYING_TYPES).default("AUCTION"),
|
|
10966
|
+
bid_strategy: z10.enum(BID_STRATEGIES).optional(),
|
|
10870
10967
|
/** Campaign Budget Optimization (Advantage campaign budget) — mutually exclusive with ad-set budgets. */
|
|
10871
10968
|
dailyBudget: moneySchema2.optional(),
|
|
10872
10969
|
lifetimeBudget: moneySchema2.optional(),
|
|
10873
10970
|
spendCap: moneySchema2.optional(),
|
|
10874
|
-
start_time:
|
|
10875
|
-
stop_time:
|
|
10971
|
+
start_time: z10.number().int().positive().optional(),
|
|
10972
|
+
stop_time: z10.number().int().positive().optional()
|
|
10876
10973
|
}).superRefine((p, ctx) => {
|
|
10877
10974
|
if (p.dailyBudget && p.lifetimeBudget) {
|
|
10878
10975
|
ctx.addIssue({ code: "custom", path: ["dailyBudget"], message: "set only one of dailyBudget or lifetimeBudget" });
|
|
@@ -10882,15 +10979,15 @@ var campaignCreateSchema3 = z9.object({
|
|
|
10882
10979
|
ctx.addIssue({ code: "custom", path: ["stop_time"], message: "stop_time must be after start_time" });
|
|
10883
10980
|
}
|
|
10884
10981
|
});
|
|
10885
|
-
var campaignUpdateSchema3 =
|
|
10886
|
-
name:
|
|
10982
|
+
var campaignUpdateSchema3 = z10.object({
|
|
10983
|
+
name: z10.string().min(1).max(META_LIMITS.campaign.nameMax).optional(),
|
|
10887
10984
|
status: updateStatusSchema.optional(),
|
|
10888
|
-
bid_strategy:
|
|
10985
|
+
bid_strategy: z10.enum(BID_STRATEGIES).optional(),
|
|
10889
10986
|
dailyBudget: moneySchema2.optional(),
|
|
10890
10987
|
lifetimeBudget: moneySchema2.optional(),
|
|
10891
10988
|
spendCap: moneySchema2.optional(),
|
|
10892
|
-
start_time:
|
|
10893
|
-
stop_time:
|
|
10989
|
+
start_time: z10.number().int().positive().optional(),
|
|
10990
|
+
stop_time: z10.number().int().positive().optional()
|
|
10894
10991
|
}).superRefine((p, ctx) => {
|
|
10895
10992
|
if (!Object.values(p).some((val) => val !== void 0)) {
|
|
10896
10993
|
ctx.addIssue({ code: "custom", message: "update needs at least one field" });
|
|
@@ -10900,38 +10997,38 @@ var campaignUpdateSchema3 = z9.object({
|
|
|
10900
10997
|
}
|
|
10901
10998
|
validateDailyBudgetFloor(p.dailyBudget, ctx, ["dailyBudget", "amount"]);
|
|
10902
10999
|
});
|
|
10903
|
-
var promotedObjectSchema =
|
|
11000
|
+
var promotedObjectSchema = z10.object({
|
|
10904
11001
|
page_id: parentRefSchema2.optional(),
|
|
10905
|
-
pixel_id:
|
|
10906
|
-
custom_event_type:
|
|
10907
|
-
application_id:
|
|
10908
|
-
object_store_url:
|
|
10909
|
-
product_catalog_id:
|
|
10910
|
-
product_set_id:
|
|
10911
|
-
whatsapp_phone_number:
|
|
10912
|
-
offline_conversion_data_set_id:
|
|
11002
|
+
pixel_id: z10.string().regex(NUMERIC_ID_REGEX3).optional(),
|
|
11003
|
+
custom_event_type: z10.enum(CUSTOM_EVENT_TYPES).optional(),
|
|
11004
|
+
application_id: z10.string().regex(NUMERIC_ID_REGEX3).optional(),
|
|
11005
|
+
object_store_url: z10.string().url().optional(),
|
|
11006
|
+
product_catalog_id: z10.string().regex(NUMERIC_ID_REGEX3).optional(),
|
|
11007
|
+
product_set_id: z10.string().regex(NUMERIC_ID_REGEX3).optional(),
|
|
11008
|
+
whatsapp_phone_number: z10.string().optional(),
|
|
11009
|
+
offline_conversion_data_set_id: z10.string().regex(NUMERIC_ID_REGEX3).optional()
|
|
10913
11010
|
}).partial();
|
|
10914
|
-
var attributionSpecSchema =
|
|
10915
|
-
|
|
10916
|
-
event_type:
|
|
10917
|
-
window_days:
|
|
11011
|
+
var attributionSpecSchema = z10.array(
|
|
11012
|
+
z10.object({
|
|
11013
|
+
event_type: z10.enum(ATTRIBUTION_EVENT_TYPES),
|
|
11014
|
+
window_days: z10.union([z10.literal(1), z10.literal(7), z10.literal(28)])
|
|
10918
11015
|
})
|
|
10919
11016
|
);
|
|
10920
11017
|
var adSetFields = {
|
|
10921
|
-
name:
|
|
11018
|
+
name: z10.string().min(1).max(META_LIMITS.adSet.nameMax),
|
|
10922
11019
|
campaign_id: parentRefSchema2,
|
|
10923
11020
|
status: stageableStatusSchema3.default("PAUSED"),
|
|
10924
11021
|
dailyBudget: moneySchema2.optional(),
|
|
10925
11022
|
lifetimeBudget: moneySchema2.optional(),
|
|
10926
11023
|
bidAmount: moneySchema2.optional(),
|
|
10927
|
-
bid_strategy:
|
|
10928
|
-
billing_event:
|
|
10929
|
-
optimization_goal:
|
|
10930
|
-
destination_type:
|
|
11024
|
+
bid_strategy: z10.enum(BID_STRATEGIES).optional(),
|
|
11025
|
+
billing_event: z10.enum(BILLING_EVENTS),
|
|
11026
|
+
optimization_goal: z10.enum(OPTIMIZATION_GOALS),
|
|
11027
|
+
destination_type: z10.enum(DESTINATION_TYPES).optional(),
|
|
10931
11028
|
promoted_object: promotedObjectSchema.optional(),
|
|
10932
11029
|
attribution_spec: attributionSpecSchema.optional(),
|
|
10933
|
-
start_time:
|
|
10934
|
-
end_time:
|
|
11030
|
+
start_time: z10.number().int().positive().optional(),
|
|
11031
|
+
end_time: z10.number().int().positive().optional(),
|
|
10935
11032
|
targeting: metaTargetingSchema
|
|
10936
11033
|
};
|
|
10937
11034
|
function validateAdSetBudgetAndBid(p, ctx) {
|
|
@@ -10949,22 +11046,22 @@ function validateAdSetBudgetAndBid(p, ctx) {
|
|
|
10949
11046
|
ctx.addIssue({ code: "custom", path: ["end_time"], message: "end_time must be after start_time" });
|
|
10950
11047
|
}
|
|
10951
11048
|
}
|
|
10952
|
-
var adSetCreateSchema =
|
|
11049
|
+
var adSetCreateSchema = z10.object(adSetFields).superRefine((p, ctx) => {
|
|
10953
11050
|
validateAdSetBudgetAndBid(p, ctx);
|
|
10954
11051
|
});
|
|
10955
|
-
var adSetUpdateSchema =
|
|
11052
|
+
var adSetUpdateSchema = z10.object({
|
|
10956
11053
|
name: adSetFields.name.optional(),
|
|
10957
11054
|
status: updateStatusSchema.optional(),
|
|
10958
11055
|
dailyBudget: moneySchema2.optional(),
|
|
10959
11056
|
lifetimeBudget: moneySchema2.optional(),
|
|
10960
11057
|
bidAmount: moneySchema2.optional(),
|
|
10961
|
-
bid_strategy:
|
|
10962
|
-
optimization_goal:
|
|
10963
|
-
destination_type:
|
|
11058
|
+
bid_strategy: z10.enum(BID_STRATEGIES).optional(),
|
|
11059
|
+
optimization_goal: z10.enum(OPTIMIZATION_GOALS).optional(),
|
|
11060
|
+
destination_type: z10.enum(DESTINATION_TYPES).optional(),
|
|
10964
11061
|
promoted_object: promotedObjectSchema.optional(),
|
|
10965
11062
|
attribution_spec: attributionSpecSchema.optional(),
|
|
10966
|
-
start_time:
|
|
10967
|
-
end_time:
|
|
11063
|
+
start_time: z10.number().int().positive().optional(),
|
|
11064
|
+
end_time: z10.number().int().positive().optional(),
|
|
10968
11065
|
targeting: metaTargetingSchema.optional()
|
|
10969
11066
|
}).superRefine((p, ctx) => {
|
|
10970
11067
|
if (!Object.values(p).some((val) => val !== void 0)) {
|
|
@@ -10972,38 +11069,38 @@ var adSetUpdateSchema = z9.object({
|
|
|
10972
11069
|
}
|
|
10973
11070
|
validateAdSetBudgetAndBid(p, ctx);
|
|
10974
11071
|
});
|
|
10975
|
-
var messageSchema =
|
|
10976
|
-
var headlineSchema2 =
|
|
10977
|
-
var descriptionSchema =
|
|
10978
|
-
var callToActionSchema =
|
|
10979
|
-
type:
|
|
11072
|
+
var messageSchema = z10.string().min(1).max(META_LIMITS.creative.messageHardMax);
|
|
11073
|
+
var headlineSchema2 = z10.string().min(1).max(META_LIMITS.creative.headlineMax);
|
|
11074
|
+
var descriptionSchema = z10.string().min(1).max(META_LIMITS.creative.descriptionMax);
|
|
11075
|
+
var callToActionSchema = z10.object({
|
|
11076
|
+
type: z10.enum(CTA_TYPES2),
|
|
10980
11077
|
/** Overrides the base link for the CTA button; defaults to the ad's link. */
|
|
10981
11078
|
link: httpsUrlSchema3.optional()
|
|
10982
11079
|
});
|
|
10983
|
-
var creativeEnhancementsSchema =
|
|
10984
|
-
standardEnhancements:
|
|
10985
|
-
features:
|
|
11080
|
+
var creativeEnhancementsSchema = z10.object({
|
|
11081
|
+
standardEnhancements: z10.enum(ENROLL_STATUSES).optional(),
|
|
11082
|
+
features: z10.record(z10.string(), z10.enum(ENROLL_STATUSES)).optional()
|
|
10986
11083
|
});
|
|
10987
11084
|
var creativeSharedFields = {
|
|
10988
|
-
name:
|
|
11085
|
+
name: z10.string().max(META_LIMITS.creative.nameMax).optional(),
|
|
10989
11086
|
/** Facebook Page id backing the ad's identity. */
|
|
10990
11087
|
page_id: parentRefSchema2,
|
|
10991
11088
|
/** Instagram account id for IG placements (aka instagram_actor_id on read). */
|
|
10992
|
-
instagram_user_id:
|
|
11089
|
+
instagram_user_id: z10.string().regex(NUMERIC_ID_REGEX3).optional(),
|
|
10993
11090
|
/** URL tracking parameters appended to the destination, e.g. "utm_source=fb&utm_campaign=x". */
|
|
10994
|
-
url_tags:
|
|
11091
|
+
url_tags: z10.string().max(1e3).optional(),
|
|
10995
11092
|
enhancements: creativeEnhancementsSchema.optional()
|
|
10996
11093
|
};
|
|
10997
11094
|
var imageMediaFields = {
|
|
10998
|
-
imageHash:
|
|
11095
|
+
imageHash: z10.string().regex(IMAGE_HASH_REGEX).optional(),
|
|
10999
11096
|
imageRef: tempRefSchema3.optional()
|
|
11000
11097
|
};
|
|
11001
11098
|
var videoMediaFields = {
|
|
11002
|
-
videoId:
|
|
11099
|
+
videoId: z10.string().regex(NUMERIC_ID_REGEX3).optional(),
|
|
11003
11100
|
videoRef: tempRefSchema3.optional(),
|
|
11004
11101
|
/** Thumbnail for a video creative — image hash, ref, or public url. */
|
|
11005
|
-
thumbnailHash:
|
|
11006
|
-
imageUrl:
|
|
11102
|
+
thumbnailHash: z10.string().regex(IMAGE_HASH_REGEX).optional(),
|
|
11103
|
+
imageUrl: z10.string().url().optional()
|
|
11007
11104
|
};
|
|
11008
11105
|
function countImageRefs(p) {
|
|
11009
11106
|
return [p.imageHash, p.imageRef].filter(Boolean).length;
|
|
@@ -11011,8 +11108,8 @@ function countImageRefs(p) {
|
|
|
11011
11108
|
function countVideoRefs(p) {
|
|
11012
11109
|
return [p.videoId, p.videoRef].filter(Boolean).length;
|
|
11013
11110
|
}
|
|
11014
|
-
var singleCreativeSchema =
|
|
11015
|
-
creativeType:
|
|
11111
|
+
var singleCreativeSchema = z10.object({
|
|
11112
|
+
creativeType: z10.literal("single"),
|
|
11016
11113
|
...creativeSharedFields,
|
|
11017
11114
|
/** Primary text. */
|
|
11018
11115
|
message: messageSchema,
|
|
@@ -11021,7 +11118,7 @@ var singleCreativeSchema = z9.object({
|
|
|
11021
11118
|
headline: headlineSchema2.optional(),
|
|
11022
11119
|
description: descriptionSchema.optional(),
|
|
11023
11120
|
/** Display URL / caption shown under the headline. */
|
|
11024
|
-
caption:
|
|
11121
|
+
caption: z10.string().max(255).optional(),
|
|
11025
11122
|
call_to_action: callToActionSchema.optional(),
|
|
11026
11123
|
...imageMediaFields,
|
|
11027
11124
|
...videoMediaFields
|
|
@@ -11045,10 +11142,10 @@ var singleCreativeSchema = z9.object({
|
|
|
11045
11142
|
});
|
|
11046
11143
|
}
|
|
11047
11144
|
});
|
|
11048
|
-
var carouselCardSchema =
|
|
11145
|
+
var carouselCardSchema = z10.object({
|
|
11049
11146
|
link: httpsUrlSchema3,
|
|
11050
|
-
headline:
|
|
11051
|
-
description:
|
|
11147
|
+
headline: z10.string().max(META_LIMITS.creative.headlineMax).optional(),
|
|
11148
|
+
description: z10.string().max(META_LIMITS.creative.descriptionMax).optional(),
|
|
11052
11149
|
call_to_action: callToActionSchema.optional(),
|
|
11053
11150
|
...imageMediaFields,
|
|
11054
11151
|
...videoMediaFields
|
|
@@ -11068,35 +11165,35 @@ var carouselCardSchema = z9.object({
|
|
|
11068
11165
|
ctx.addIssue({ code: "custom", path: ["videoId"], message: "each card is an image OR a video, not both" });
|
|
11069
11166
|
}
|
|
11070
11167
|
});
|
|
11071
|
-
var carouselCreativeSchema2 =
|
|
11072
|
-
creativeType:
|
|
11168
|
+
var carouselCreativeSchema2 = z10.object({
|
|
11169
|
+
creativeType: z10.literal("carousel"),
|
|
11073
11170
|
...creativeSharedFields,
|
|
11074
11171
|
message: messageSchema,
|
|
11075
11172
|
/** Optional "see more" card destination applied when a card has no own link. */
|
|
11076
11173
|
link: httpsUrlSchema3.optional(),
|
|
11077
11174
|
call_to_action: callToActionSchema.optional(),
|
|
11078
|
-
cards:
|
|
11175
|
+
cards: z10.array(carouselCardSchema).min(META_LIMITS.creative.carouselCardsMin).max(META_LIMITS.creative.carouselCardsMax)
|
|
11079
11176
|
});
|
|
11080
|
-
var dynamicImageSchema =
|
|
11081
|
-
var dynamicVideoSchema =
|
|
11177
|
+
var dynamicImageSchema = z10.object({ ...imageMediaFields }).refine((p) => countImageRefs(p) === 1, "each dynamic image needs exactly one reference");
|
|
11178
|
+
var dynamicVideoSchema = z10.object({
|
|
11082
11179
|
videoId: videoMediaFields.videoId,
|
|
11083
11180
|
videoRef: videoMediaFields.videoRef,
|
|
11084
11181
|
thumbnailHash: videoMediaFields.thumbnailHash
|
|
11085
11182
|
}).refine((p) => countVideoRefs(p) === 1, "each dynamic video needs exactly one reference");
|
|
11086
11183
|
var DYN = META_LIMITS.creative;
|
|
11087
|
-
var dynamicCreativeSchema =
|
|
11088
|
-
creativeType:
|
|
11184
|
+
var dynamicCreativeSchema = z10.object({
|
|
11185
|
+
creativeType: z10.literal("dynamic"),
|
|
11089
11186
|
...creativeSharedFields,
|
|
11090
|
-
bodies:
|
|
11091
|
-
titles:
|
|
11092
|
-
descriptions:
|
|
11093
|
-
images:
|
|
11094
|
-
videos:
|
|
11095
|
-
ad_formats:
|
|
11096
|
-
call_to_action_types:
|
|
11097
|
-
link_urls:
|
|
11187
|
+
bodies: z10.array(z10.object({ text: messageSchema })).min(DYN.dynamicTextsMin).max(DYN.dynamicTextsMax),
|
|
11188
|
+
titles: z10.array(z10.object({ text: headlineSchema2 })).min(DYN.dynamicTextsMin).max(DYN.dynamicTextsMax),
|
|
11189
|
+
descriptions: z10.array(z10.object({ text: descriptionSchema })).max(DYN.dynamicTextsMax).optional(),
|
|
11190
|
+
images: z10.array(dynamicImageSchema).optional(),
|
|
11191
|
+
videos: z10.array(dynamicVideoSchema).optional(),
|
|
11192
|
+
ad_formats: z10.array(z10.enum(AD_FORMATS2)).min(1),
|
|
11193
|
+
call_to_action_types: z10.array(z10.enum(CTA_TYPES2)).optional(),
|
|
11194
|
+
link_urls: z10.array(z10.object({ website_url: httpsUrlSchema3, display_url: z10.string().optional() })).min(1),
|
|
11098
11195
|
/** Multi-language / placement customization — structural passthrough for v1. */
|
|
11099
|
-
asset_customization_rules:
|
|
11196
|
+
asset_customization_rules: z10.array(z10.record(z10.string(), z10.unknown())).optional()
|
|
11100
11197
|
}).superRefine((p, ctx) => {
|
|
11101
11198
|
if (!(p.images?.length || p.videos?.length)) {
|
|
11102
11199
|
ctx.addIssue({
|
|
@@ -11106,57 +11203,57 @@ var dynamicCreativeSchema = z9.object({
|
|
|
11106
11203
|
});
|
|
11107
11204
|
}
|
|
11108
11205
|
});
|
|
11109
|
-
var existingPostCreativeSchema =
|
|
11110
|
-
creativeType:
|
|
11206
|
+
var existingPostCreativeSchema = z10.object({
|
|
11207
|
+
creativeType: z10.literal("existing_post"),
|
|
11111
11208
|
name: creativeSharedFields.name,
|
|
11112
11209
|
/** "<page_id>_<post_id>" object story id of the post to promote. */
|
|
11113
|
-
object_story_id:
|
|
11210
|
+
object_story_id: z10.string().regex(/^\d+_\d+$/, 'expected "<page_id>_<post_id>"'),
|
|
11114
11211
|
instagram_user_id: creativeSharedFields.instagram_user_id,
|
|
11115
11212
|
url_tags: creativeSharedFields.url_tags,
|
|
11116
11213
|
enhancements: creativeSharedFields.enhancements
|
|
11117
11214
|
});
|
|
11118
|
-
var creativeContentSchema2 =
|
|
11215
|
+
var creativeContentSchema2 = z10.discriminatedUnion("creativeType", [
|
|
11119
11216
|
singleCreativeSchema,
|
|
11120
11217
|
carouselCreativeSchema2,
|
|
11121
11218
|
dynamicCreativeSchema,
|
|
11122
11219
|
existingPostCreativeSchema
|
|
11123
11220
|
]);
|
|
11124
11221
|
var adCreativeCreateSchema = creativeContentSchema2;
|
|
11125
|
-
var adCreativeUpdateSchema =
|
|
11126
|
-
name:
|
|
11222
|
+
var adCreativeUpdateSchema = z10.object({
|
|
11223
|
+
name: z10.string().max(META_LIMITS.creative.nameMax).optional(),
|
|
11127
11224
|
status: updateStatusSchema.optional(),
|
|
11128
11225
|
/** Content patch — only honored when the target is a staged meta_temp_* creative. */
|
|
11129
|
-
content:
|
|
11226
|
+
content: z10.record(z10.string(), z10.unknown()).optional()
|
|
11130
11227
|
}).refine((p) => Object.values(p).some((val) => val !== void 0), "update needs at least one field");
|
|
11131
|
-
var adCreateSchema2 =
|
|
11132
|
-
name:
|
|
11228
|
+
var adCreateSchema2 = z10.object({
|
|
11229
|
+
name: z10.string().min(1).max(META_LIMITS.ad.nameMax),
|
|
11133
11230
|
adset_id: parentRefSchema2,
|
|
11134
11231
|
status: stageableStatusSchema3.default("PAUSED"),
|
|
11135
|
-
creative:
|
|
11232
|
+
creative: z10.object({ creative_id: parentRefSchema2 }),
|
|
11136
11233
|
/** Conversion pixel / offline event set / view tags — structural passthrough. */
|
|
11137
|
-
tracking_specs:
|
|
11234
|
+
tracking_specs: z10.array(z10.record(z10.string(), z10.unknown())).optional()
|
|
11138
11235
|
});
|
|
11139
|
-
var adUpdateSchema2 =
|
|
11140
|
-
name:
|
|
11236
|
+
var adUpdateSchema2 = z10.object({
|
|
11237
|
+
name: z10.string().min(1).max(META_LIMITS.ad.nameMax).optional(),
|
|
11141
11238
|
status: updateStatusSchema.optional(),
|
|
11142
11239
|
/** Swapping the creative is the Meta way to "edit" an ad's creative. */
|
|
11143
|
-
creative:
|
|
11144
|
-
tracking_specs:
|
|
11240
|
+
creative: z10.object({ creative_id: parentRefSchema2 }).optional(),
|
|
11241
|
+
tracking_specs: z10.array(z10.record(z10.string(), z10.unknown())).optional()
|
|
11145
11242
|
}).refine((p) => Object.values(p).some((val) => val !== void 0), "update needs at least one field");
|
|
11146
|
-
var lookalikeSpecSchema =
|
|
11147
|
-
origin:
|
|
11148
|
-
ratio:
|
|
11149
|
-
country:
|
|
11150
|
-
});
|
|
11151
|
-
var customAudienceCreateSchema =
|
|
11152
|
-
name:
|
|
11153
|
-
subtype:
|
|
11154
|
-
description:
|
|
11155
|
-
customer_file_source:
|
|
11156
|
-
retention_days:
|
|
11243
|
+
var lookalikeSpecSchema = z10.object({
|
|
11244
|
+
origin: z10.array(z10.object({ id: parentRefSchema2 })).min(1),
|
|
11245
|
+
ratio: z10.number().min(0.01).max(0.2).optional(),
|
|
11246
|
+
country: z10.string().length(2).optional()
|
|
11247
|
+
});
|
|
11248
|
+
var customAudienceCreateSchema = z10.object({
|
|
11249
|
+
name: z10.string().min(1).max(META_LIMITS.audience.nameMax),
|
|
11250
|
+
subtype: z10.enum(CUSTOM_AUDIENCE_SUBTYPES),
|
|
11251
|
+
description: z10.string().max(500).optional(),
|
|
11252
|
+
customer_file_source: z10.string().optional(),
|
|
11253
|
+
retention_days: z10.number().int().min(1).max(META_LIMITS.audience.retentionDaysMax).optional(),
|
|
11157
11254
|
lookalike_spec: lookalikeSpecSchema.optional(),
|
|
11158
11255
|
/** Website/engagement rule — structural passthrough validated by Meta. */
|
|
11159
|
-
rule:
|
|
11256
|
+
rule: z10.record(z10.string(), z10.unknown()).optional()
|
|
11160
11257
|
}).superRefine((p, ctx) => {
|
|
11161
11258
|
if (p.subtype === "LOOKALIKE" && !p.lookalike_spec) {
|
|
11162
11259
|
ctx.addIssue({ code: "custom", path: ["lookalike_spec"], message: "LOOKALIKE audiences need a lookalike_spec" });
|
|
@@ -11165,16 +11262,16 @@ var customAudienceCreateSchema = z9.object({
|
|
|
11165
11262
|
ctx.addIssue({ code: "custom", path: ["rule"], message: `${p.subtype} audiences need a rule (use --file)` });
|
|
11166
11263
|
}
|
|
11167
11264
|
});
|
|
11168
|
-
var customAudienceUpdateSchema =
|
|
11169
|
-
name:
|
|
11170
|
-
description:
|
|
11265
|
+
var customAudienceUpdateSchema = z10.object({
|
|
11266
|
+
name: z10.string().min(1).max(META_LIMITS.audience.nameMax).optional(),
|
|
11267
|
+
description: z10.string().max(500).optional()
|
|
11171
11268
|
}).refine((p) => Object.values(p).some((val) => val !== void 0), "update needs at least one field");
|
|
11172
|
-
var mediaUploadSchema =
|
|
11173
|
-
kind:
|
|
11269
|
+
var mediaUploadSchema = z10.object({
|
|
11270
|
+
kind: z10.enum(MEDIA_KINDS),
|
|
11174
11271
|
bakerImageId: bakerMediaIdSchema2.optional(),
|
|
11175
11272
|
bakerVideoId: bakerMediaIdSchema2.optional(),
|
|
11176
11273
|
/** Optional display name / filename hint. */
|
|
11177
|
-
name:
|
|
11274
|
+
name: z10.string().max(255).optional()
|
|
11178
11275
|
}).superRefine((p, ctx) => {
|
|
11179
11276
|
if (p.kind === "image" && !p.bakerImageId) {
|
|
11180
11277
|
ctx.addIssue({ code: "custom", path: ["bakerImageId"], message: "image uploads need a bakerImageId" });
|
|
@@ -11196,16 +11293,16 @@ var META_DRAFT_OP_KINDS = [
|
|
|
11196
11293
|
"customAudience.update",
|
|
11197
11294
|
"media.upload"
|
|
11198
11295
|
];
|
|
11199
|
-
var metaDraftOpKindSchema =
|
|
11200
|
-
var accountIdSchema2 =
|
|
11201
|
-
var updateTargetSchema2 =
|
|
11296
|
+
var metaDraftOpKindSchema = z10.enum(META_DRAFT_OP_KINDS);
|
|
11297
|
+
var accountIdSchema2 = z10.string().regex(NUMERIC_ID_REGEX3, "accountId must be the bare numeric ad account id");
|
|
11298
|
+
var updateTargetSchema2 = z10.union([z10.string().regex(NUMERIC_ID_REGEX3), tempRefSchema3]);
|
|
11202
11299
|
function createOp3(kind, payload) {
|
|
11203
|
-
return
|
|
11300
|
+
return z10.object({ kind: z10.literal(kind), accountId: accountIdSchema2, payload });
|
|
11204
11301
|
}
|
|
11205
11302
|
function updateOp3(kind, payload) {
|
|
11206
|
-
return
|
|
11303
|
+
return z10.object({ kind: z10.literal(kind), accountId: accountIdSchema2, target: updateTargetSchema2, payload });
|
|
11207
11304
|
}
|
|
11208
|
-
var metaDraftOpInputSchema =
|
|
11305
|
+
var metaDraftOpInputSchema = z10.discriminatedUnion("kind", [
|
|
11209
11306
|
createOp3("campaign.create", campaignCreateSchema3),
|
|
11210
11307
|
updateOp3("campaign.update", campaignUpdateSchema3),
|
|
11211
11308
|
createOp3("adSet.create", adSetCreateSchema),
|
|
@@ -11220,89 +11317,89 @@ var metaDraftOpInputSchema = z9.discriminatedUnion("kind", [
|
|
|
11220
11317
|
]);
|
|
11221
11318
|
|
|
11222
11319
|
// ../api/src/ads-meta/wire.ts
|
|
11223
|
-
import { z as
|
|
11224
|
-
var metaWriteModeSchema =
|
|
11225
|
-
var metaDraftOpResultSchema =
|
|
11226
|
-
status:
|
|
11320
|
+
import { z as z11 } from "zod";
|
|
11321
|
+
var metaWriteModeSchema = z11.enum(["live", "simulated"]);
|
|
11322
|
+
var metaDraftOpResultSchema = z11.object({
|
|
11323
|
+
status: z11.enum(["applied", "simulated", "failed", "skipped"]),
|
|
11227
11324
|
/** The resulting Meta node id (campaign/adset/creative/ad/audience) or simulated id. */
|
|
11228
|
-
id:
|
|
11325
|
+
id: z11.string().optional(),
|
|
11229
11326
|
/** For media.upload ops: the resulting image hash. */
|
|
11230
|
-
hash:
|
|
11231
|
-
error:
|
|
11232
|
-
skippedBecause:
|
|
11233
|
-
executedAt:
|
|
11327
|
+
hash: z11.string().optional(),
|
|
11328
|
+
error: z11.string().optional(),
|
|
11329
|
+
skippedBecause: z11.string().optional(),
|
|
11330
|
+
executedAt: z11.number().optional()
|
|
11234
11331
|
});
|
|
11235
|
-
var metaDraftStageRequestSchema =
|
|
11236
|
-
chatId:
|
|
11332
|
+
var metaDraftStageRequestSchema = z11.object({
|
|
11333
|
+
chatId: z11.string(),
|
|
11237
11334
|
op: metaDraftOpInputSchema
|
|
11238
11335
|
});
|
|
11239
|
-
var metaDraftStageResponseSchema =
|
|
11240
|
-
staged:
|
|
11241
|
-
ref:
|
|
11336
|
+
var metaDraftStageResponseSchema = z11.object({
|
|
11337
|
+
staged: z11.literal(true),
|
|
11338
|
+
ref: z11.string(),
|
|
11242
11339
|
kind: metaDraftOpKindSchema,
|
|
11243
11340
|
mode: metaWriteModeSchema,
|
|
11244
|
-
dependsOn:
|
|
11245
|
-
summary:
|
|
11246
|
-
warnings:
|
|
11341
|
+
dependsOn: z11.array(z11.string()),
|
|
11342
|
+
summary: z11.string(),
|
|
11343
|
+
warnings: z11.array(z11.string()),
|
|
11247
11344
|
/** True when the op amended an already-staged op in place instead of appending a new one. */
|
|
11248
|
-
amended:
|
|
11249
|
-
});
|
|
11250
|
-
var metaDraftDuplicateRequestSchema =
|
|
11251
|
-
chatId:
|
|
11252
|
-
accountId:
|
|
11253
|
-
entity:
|
|
11254
|
-
sourceId:
|
|
11255
|
-
overrides:
|
|
11345
|
+
amended: z11.boolean().optional()
|
|
11346
|
+
});
|
|
11347
|
+
var metaDraftDuplicateRequestSchema = z11.object({
|
|
11348
|
+
chatId: z11.string(),
|
|
11349
|
+
accountId: z11.string(),
|
|
11350
|
+
entity: z11.enum(["campaign", "adSet", "ad"]),
|
|
11351
|
+
sourceId: z11.string(),
|
|
11352
|
+
overrides: z11.record(z11.string(), z11.unknown()).optional(),
|
|
11256
11353
|
/** Pause the original after the copy publishes. */
|
|
11257
|
-
replace:
|
|
11354
|
+
replace: z11.boolean().optional()
|
|
11258
11355
|
});
|
|
11259
|
-
var metaDraftOpViewSchema =
|
|
11260
|
-
ref:
|
|
11356
|
+
var metaDraftOpViewSchema = z11.object({
|
|
11357
|
+
ref: z11.string(),
|
|
11261
11358
|
kind: metaDraftOpKindSchema,
|
|
11262
|
-
accountId:
|
|
11263
|
-
target:
|
|
11264
|
-
dependsOn:
|
|
11265
|
-
summary:
|
|
11266
|
-
stagedAt:
|
|
11359
|
+
accountId: z11.string(),
|
|
11360
|
+
target: z11.string().optional(),
|
|
11361
|
+
dependsOn: z11.array(z11.string()),
|
|
11362
|
+
summary: z11.string(),
|
|
11363
|
+
stagedAt: z11.number(),
|
|
11267
11364
|
result: metaDraftOpResultSchema.optional()
|
|
11268
11365
|
});
|
|
11269
|
-
var metaDraftListRequestSchema =
|
|
11270
|
-
chatId:
|
|
11366
|
+
var metaDraftListRequestSchema = z11.object({
|
|
11367
|
+
chatId: z11.string()
|
|
11271
11368
|
});
|
|
11272
|
-
var metaDraftAdvisorySchema =
|
|
11273
|
-
ref:
|
|
11274
|
-
message:
|
|
11369
|
+
var metaDraftAdvisorySchema = z11.object({
|
|
11370
|
+
ref: z11.string(),
|
|
11371
|
+
message: z11.string()
|
|
11275
11372
|
});
|
|
11276
|
-
var metaDraftListResponseSchema =
|
|
11277
|
-
status:
|
|
11373
|
+
var metaDraftListResponseSchema = z11.object({
|
|
11374
|
+
status: z11.enum(["active", "publishing", "applied", "discarded", "none"]),
|
|
11278
11375
|
mode: metaWriteModeSchema,
|
|
11279
|
-
count:
|
|
11280
|
-
ops:
|
|
11376
|
+
count: z11.number(),
|
|
11377
|
+
ops: z11.array(metaDraftOpViewSchema),
|
|
11281
11378
|
/** Non-blocking cross-op quality advisories — "good campaign, not just valid". */
|
|
11282
|
-
advisories:
|
|
11379
|
+
advisories: z11.array(metaDraftAdvisorySchema)
|
|
11283
11380
|
});
|
|
11284
|
-
var metaDraftRemoveRequestSchema =
|
|
11285
|
-
chatId:
|
|
11286
|
-
ref:
|
|
11381
|
+
var metaDraftRemoveRequestSchema = z11.object({
|
|
11382
|
+
chatId: z11.string(),
|
|
11383
|
+
ref: z11.string()
|
|
11287
11384
|
});
|
|
11288
|
-
var metaDraftRemoveResponseSchema =
|
|
11385
|
+
var metaDraftRemoveResponseSchema = z11.object({
|
|
11289
11386
|
/** The requested ref plus any dependents removed by cascade. */
|
|
11290
|
-
removed:
|
|
11387
|
+
removed: z11.array(z11.string())
|
|
11291
11388
|
});
|
|
11292
|
-
var metaDraftClearRequestSchema =
|
|
11293
|
-
chatId:
|
|
11389
|
+
var metaDraftClearRequestSchema = z11.object({
|
|
11390
|
+
chatId: z11.string()
|
|
11294
11391
|
});
|
|
11295
|
-
var metaDraftClearResponseSchema =
|
|
11296
|
-
cleared:
|
|
11392
|
+
var metaDraftClearResponseSchema = z11.object({
|
|
11393
|
+
cleared: z11.number()
|
|
11297
11394
|
});
|
|
11298
|
-
var metaFieldErrorSchema =
|
|
11299
|
-
path:
|
|
11300
|
-
message:
|
|
11395
|
+
var metaFieldErrorSchema = z11.object({
|
|
11396
|
+
path: z11.string(),
|
|
11397
|
+
message: z11.string()
|
|
11301
11398
|
});
|
|
11302
|
-
var metaDraftErrorResponseSchema =
|
|
11303
|
-
code:
|
|
11304
|
-
error:
|
|
11305
|
-
fields:
|
|
11399
|
+
var metaDraftErrorResponseSchema = z11.object({
|
|
11400
|
+
code: z11.string(),
|
|
11401
|
+
error: z11.string(),
|
|
11402
|
+
fields: z11.array(metaFieldErrorSchema).optional()
|
|
11306
11403
|
});
|
|
11307
11404
|
|
|
11308
11405
|
// src/commands/ads/meta/write-shared.ts
|
|
@@ -14579,27 +14676,27 @@ import path6 from "path";
|
|
|
14579
14676
|
import { defineCommand as defineCommand89 } from "citty";
|
|
14580
14677
|
|
|
14581
14678
|
// src/engine/scaffold/staticAd.ts
|
|
14582
|
-
import { z as
|
|
14679
|
+
import { z as z12 } from "zod";
|
|
14583
14680
|
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"]);
|
|
14584
14681
|
var DEFAULT_ASPECT_RATIO = "9:16";
|
|
14585
|
-
var Blueprint =
|
|
14586
|
-
meta:
|
|
14587
|
-
text_content:
|
|
14682
|
+
var Blueprint = z12.object({
|
|
14683
|
+
meta: z12.object({ estimated_aspect_ratio: z12.string().optional() }).loose().optional(),
|
|
14684
|
+
text_content: z12.array(z12.object({ text: z12.string().optional() }).loose()).optional()
|
|
14588
14685
|
}).loose();
|
|
14589
|
-
var ElementLocator =
|
|
14590
|
-
collection:
|
|
14591
|
-
index:
|
|
14686
|
+
var ElementLocator = z12.object({
|
|
14687
|
+
collection: z12.enum(["subjects", "people", "brands_logos"]),
|
|
14688
|
+
index: z12.number().int().nonnegative()
|
|
14592
14689
|
}).loose();
|
|
14593
|
-
var MainElement =
|
|
14690
|
+
var MainElement = z12.object({
|
|
14594
14691
|
// logo | product | person | animal | badge | other
|
|
14595
|
-
type:
|
|
14596
|
-
label:
|
|
14597
|
-
description:
|
|
14598
|
-
expression:
|
|
14599
|
-
reason:
|
|
14692
|
+
type: z12.string(),
|
|
14693
|
+
label: z12.string().optional(),
|
|
14694
|
+
description: z12.string().optional(),
|
|
14695
|
+
expression: z12.string().nullable().optional(),
|
|
14696
|
+
reason: z12.string().optional(),
|
|
14600
14697
|
locator: ElementLocator.optional()
|
|
14601
14698
|
}).loose();
|
|
14602
|
-
var MainElements =
|
|
14699
|
+
var MainElements = z12.array(MainElement);
|
|
14603
14700
|
function sanitizeId(raw, fallback) {
|
|
14604
14701
|
const id = raw.toLowerCase().replace(/[^a-z0-9]+/g, "_").replace(/^_+|_+$/g, "");
|
|
14605
14702
|
return /^[a-z]/.test(id) ? id : `${fallback}_${id}`.replace(/_+$/g, "") || fallback;
|
|
@@ -15135,7 +15232,7 @@ import { toCardinal as nwKo } from "n2words/ko-KR";
|
|
|
15135
15232
|
import { toCardinal as nwNl } from "n2words/nl-NL";
|
|
15136
15233
|
import { toCardinal as nwPl } from "n2words/pl-PL";
|
|
15137
15234
|
import { toCardinal as nwPt } from "n2words/pt-PT";
|
|
15138
|
-
import { z as
|
|
15235
|
+
import { z as z13 } from "zod";
|
|
15139
15236
|
|
|
15140
15237
|
// src/engine/scaffold/lib/shoot-modes.ts
|
|
15141
15238
|
var SHOOT_MODES = [
|
|
@@ -15448,71 +15545,71 @@ function trimArgs(durationS, offsetS = 0, dims) {
|
|
|
15448
15545
|
"{{out.video}}"
|
|
15449
15546
|
];
|
|
15450
15547
|
}
|
|
15451
|
-
var FrameAsset =
|
|
15452
|
-
var DialogueLine =
|
|
15453
|
-
speaker:
|
|
15454
|
-
line:
|
|
15548
|
+
var FrameAsset = z13.object({ url: z13.string().optional() }).loose().optional();
|
|
15549
|
+
var DialogueLine = z13.object({
|
|
15550
|
+
speaker: z13.string().optional(),
|
|
15551
|
+
line: z13.string().optional(),
|
|
15455
15552
|
// Absolute seconds on the source timeline (the deconstruct emits both).
|
|
15456
|
-
start_s:
|
|
15457
|
-
end_s:
|
|
15458
|
-
delivery:
|
|
15459
|
-
voice_description:
|
|
15553
|
+
start_s: z13.number().optional(),
|
|
15554
|
+
end_s: z13.number().optional(),
|
|
15555
|
+
delivery: z13.string().optional(),
|
|
15556
|
+
voice_description: z13.string().optional(),
|
|
15460
15557
|
// DECON-supplied: is this speaker's FACE visibly speaking in THIS scene? Element
|
|
15461
15558
|
// presence alone can't answer that — a founder pictured in a polaroid close-up is
|
|
15462
15559
|
// "present" yet the line is voiceover, and treating it as on-camera produced a
|
|
15463
15560
|
// native Seedance lip-sync clip of a still photograph. `false` pins the line to
|
|
15464
15561
|
// the VO path; absent keeps the presence-based decision (old blueprints).
|
|
15465
|
-
on_camera:
|
|
15562
|
+
on_camera: z13.boolean().optional()
|
|
15466
15563
|
}).loose();
|
|
15467
|
-
var Sfx =
|
|
15468
|
-
at_s:
|
|
15469
|
-
duration_s:
|
|
15470
|
-
sound_effect_prompt:
|
|
15471
|
-
description:
|
|
15564
|
+
var Sfx = z13.object({
|
|
15565
|
+
at_s: z13.number().optional(),
|
|
15566
|
+
duration_s: z13.number().optional(),
|
|
15567
|
+
sound_effect_prompt: z13.string().optional(),
|
|
15568
|
+
description: z13.string().optional()
|
|
15472
15569
|
}).loose();
|
|
15473
|
-
var CompositionRegion =
|
|
15570
|
+
var CompositionRegion = z13.object({
|
|
15474
15571
|
// full | top | bottom | left | right | inset
|
|
15475
|
-
panel:
|
|
15572
|
+
panel: z13.string().optional(),
|
|
15476
15573
|
// 9-grid anchor for an `inset` presenter box.
|
|
15477
|
-
position:
|
|
15478
|
-
is_presenter:
|
|
15574
|
+
position: z13.string().optional(),
|
|
15575
|
+
is_presenter: z13.boolean().optional(),
|
|
15479
15576
|
// The cast id shown/speaking in this region (routes lip-sync + element refs).
|
|
15480
|
-
cast_ref:
|
|
15577
|
+
cast_ref: z13.string().optional(),
|
|
15481
15578
|
// What the region's content IS: camera | screen_capture | static_graphic |
|
|
15482
15579
|
// generated. Authoritative for routing when present (regex-over-prose fallback
|
|
15483
15580
|
// otherwise): screen_capture/static_graphic are rebuilt from REAL surfaces on the
|
|
15484
15581
|
// overlay layer, never AI-generated.
|
|
15485
|
-
kind:
|
|
15582
|
+
kind: z13.string().optional(),
|
|
15486
15583
|
// Opaque id naming the SPECIFIC on-screen document/note/app-state this
|
|
15487
15584
|
// screen_capture region shows. Two scenes share it only when they show the SAME
|
|
15488
15585
|
// recording continuing (scrolling/typing/waiting within it) — a genuinely
|
|
15489
15586
|
// DIFFERENT document/note/recording (a source video splicing two screen captures)
|
|
15490
15587
|
// gets a different id. Breaks a persistent-layout run into separate surface stubs
|
|
15491
15588
|
// instead of asking the operator for one screenshot that can't cover both.
|
|
15492
|
-
surface_id:
|
|
15589
|
+
surface_id: z13.string().optional(),
|
|
15493
15590
|
// Camera bubble(s)/inset(s) embedded INSIDE this region's surface (a Loom-style
|
|
15494
15591
|
// presenter bubble inside a screen recording) — video-in-video the reproduction
|
|
15495
15592
|
// must re-composite, not paint into the surface.
|
|
15496
|
-
nested:
|
|
15497
|
-
summary:
|
|
15498
|
-
frame_prompt:
|
|
15499
|
-
motion_prompt:
|
|
15593
|
+
nested: z13.array(z13.object({}).loose()).optional(),
|
|
15594
|
+
summary: z13.string().optional(),
|
|
15595
|
+
frame_prompt: z13.string().optional(),
|
|
15596
|
+
motion_prompt: z13.string().optional()
|
|
15500
15597
|
}).loose();
|
|
15501
|
-
var SceneComposition =
|
|
15598
|
+
var SceneComposition = z13.object({
|
|
15502
15599
|
// full_frame (default) | split_screen | pip | keyed_overlay
|
|
15503
|
-
layout:
|
|
15600
|
+
layout: z13.string().optional(),
|
|
15504
15601
|
// split_screen only: vertical (top/bottom) | horizontal (left/right).
|
|
15505
|
-
split_axis:
|
|
15506
|
-
regions:
|
|
15602
|
+
split_axis: z13.string().optional(),
|
|
15603
|
+
regions: z13.array(CompositionRegion).optional()
|
|
15507
15604
|
}).loose();
|
|
15508
|
-
var CameraMotion =
|
|
15509
|
-
var TranscriptWord =
|
|
15510
|
-
var Scene =
|
|
15511
|
-
start_s:
|
|
15512
|
-
end_s:
|
|
15513
|
-
duration_s:
|
|
15514
|
-
summary:
|
|
15515
|
-
action_detail:
|
|
15605
|
+
var CameraMotion = z13.object({ movement: z13.string().optional(), detail: z13.string().optional() }).loose();
|
|
15606
|
+
var TranscriptWord = z13.object({ text: z13.string().optional() }).loose();
|
|
15607
|
+
var Scene = z13.object({
|
|
15608
|
+
start_s: z13.number().optional(),
|
|
15609
|
+
end_s: z13.number().optional(),
|
|
15610
|
+
duration_s: z13.number().optional(),
|
|
15611
|
+
summary: z13.string().optional(),
|
|
15612
|
+
action_detail: z13.string().optional(),
|
|
15516
15613
|
// The scene's spatial layout. Absent/full_frame ⇒ one uncut shot (default path).
|
|
15517
15614
|
// A layered layout (split_screen/pip/keyed_overlay) with regions ⇒ the scaffold
|
|
15518
15615
|
// builds one clip per region and stacks/overlays them into the scene picture.
|
|
@@ -15520,82 +15617,82 @@ var Scene = z12.object({
|
|
|
15520
15617
|
// The capture "look" for this scene — selected from the ad-native shoot-mode
|
|
15521
15618
|
// grammar (see lib/shoot-modes.ts). When absent the scaffold auto-derives a
|
|
15522
15619
|
// UGC/product mode; a human can override per scene by setting this.
|
|
15523
|
-
shoot_mode:
|
|
15620
|
+
shoot_mode: z13.string().optional(),
|
|
15524
15621
|
// Diegetic ambient the clip's native audio should carry (no music). When
|
|
15525
15622
|
// absent the scene falls back to its shoot mode's default ambience.
|
|
15526
|
-
ambient:
|
|
15623
|
+
ambient: z13.string().optional(),
|
|
15527
15624
|
camera_motion: CameraMotion.optional(),
|
|
15528
|
-
start_frame_prompt:
|
|
15529
|
-
end_frame_prompt:
|
|
15530
|
-
motion_prompt:
|
|
15625
|
+
start_frame_prompt: z13.string().optional(),
|
|
15626
|
+
end_frame_prompt: z13.string().optional(),
|
|
15627
|
+
motion_prompt: z13.string().optional(),
|
|
15531
15628
|
// The scene's role in the ad's persuasion arc (DECON-supplied); drives the
|
|
15532
15629
|
// script re-craft checklist. Inferred from position when absent.
|
|
15533
|
-
narrative_role:
|
|
15630
|
+
narrative_role: z13.string().optional(),
|
|
15534
15631
|
// DECON-supplied on the HOOK scene: the engineered physical/emotional state that
|
|
15535
15632
|
// makes the first frame stop the scroll (sweaty/breathless/urgent …). Injected
|
|
15536
15633
|
// into the hook's start-frame description so the generator renders that state,
|
|
15537
15634
|
// not a calm influencer (CCA-11).
|
|
15538
|
-
hook_mechanic:
|
|
15635
|
+
hook_mechanic: z13.object({ mechanic: z13.string().optional(), why_it_stops_scroll: z13.string().optional() }).loose().optional(),
|
|
15539
15636
|
// DECON-supplied per-scene location (so a gym hook isn't flattened to "home").
|
|
15540
|
-
scene_setting:
|
|
15637
|
+
scene_setting: z13.string().optional(),
|
|
15541
15638
|
// How this scene cuts to the next (DECON-supplied). A recognized non-cut type
|
|
15542
15639
|
// (fade/whip/zoom/dissolve/swipe) is reproduced as an ffmpeg xfade at the
|
|
15543
15640
|
// boundary; cut/match_cut/none/other stay hard cuts. The last scene's value is
|
|
15544
15641
|
// ignored (nothing follows it).
|
|
15545
|
-
transition_out:
|
|
15546
|
-
dialogue:
|
|
15547
|
-
sfx:
|
|
15548
|
-
overlays:
|
|
15549
|
-
floating_elements:
|
|
15642
|
+
transition_out: z13.object({ type: z13.string().optional(), description: z13.string().optional() }).loose().optional(),
|
|
15643
|
+
dialogue: z13.array(DialogueLine).optional(),
|
|
15644
|
+
sfx: z13.array(Sfx).optional(),
|
|
15645
|
+
overlays: z13.array(z13.unknown()).optional(),
|
|
15646
|
+
floating_elements: z13.array(z13.unknown()).optional(),
|
|
15550
15647
|
// DECON-supplied: how much the picture itself moves within the shot. Gates the
|
|
15551
15648
|
// flash-hold optimization — a sub-2s b-roll flash with REAL subject motion
|
|
15552
15649
|
// (pouring, spreading, hands working) must stay a real clip; freezing it turns
|
|
15553
15650
|
// a montage into a slideshow. Absent (old blueprints) keeps the cheap still.
|
|
15554
|
-
motion_level:
|
|
15555
|
-
transcript_slice:
|
|
15651
|
+
motion_level: z13.enum(["static", "subtle", "dynamic"]).optional(),
|
|
15652
|
+
transcript_slice: z13.array(TranscriptWord).optional(),
|
|
15556
15653
|
start_frame_asset: FrameAsset,
|
|
15557
15654
|
end_frame_asset: FrameAsset,
|
|
15558
15655
|
// DECON-supplied: true when this scene is a length-split CONTINUATION of the
|
|
15559
15656
|
// previous one (the SAME physical shot, broken up only because it exceeded the
|
|
15560
15657
|
// clip ceiling). The scaffold then shares the splice keyframe — this scene's
|
|
15561
15658
|
// start frame IS the previous scene's end frame — so the join is seamless.
|
|
15562
|
-
continues_previous:
|
|
15659
|
+
continues_previous: z13.boolean().optional()
|
|
15563
15660
|
}).loose();
|
|
15564
|
-
var VideoBlueprint =
|
|
15565
|
-
source:
|
|
15566
|
-
global:
|
|
15567
|
-
music:
|
|
15568
|
-
present:
|
|
15569
|
-
music_prompt:
|
|
15661
|
+
var VideoBlueprint = z13.object({
|
|
15662
|
+
source: z13.object({ aspect_ratio: z13.string().optional(), duration_s: z13.number().optional() }).loose().optional(),
|
|
15663
|
+
global: z13.object({
|
|
15664
|
+
music: z13.object({
|
|
15665
|
+
present: z13.boolean().optional(),
|
|
15666
|
+
music_prompt: z13.string().optional(),
|
|
15570
15667
|
// Absolute second the music enters in the reference (the bed often
|
|
15571
15668
|
// kicks in mid-ad, after the hook). We start the regenerated track here
|
|
15572
15669
|
// instead of at 0 so the timing matches.
|
|
15573
|
-
starts_at_s:
|
|
15670
|
+
starts_at_s: z13.number().optional(),
|
|
15574
15671
|
// Populated by the deconstruct when AudD (Shazam-style) recognizes the
|
|
15575
15672
|
// reference track. We never reuse it — only style the regenerated bed.
|
|
15576
|
-
identified_track:
|
|
15673
|
+
identified_track: z13.object({ title: z13.string().optional(), artist: z13.string().optional() }).loose().nullish()
|
|
15577
15674
|
}).loose().optional(),
|
|
15578
|
-
cast:
|
|
15579
|
-
|
|
15580
|
-
id:
|
|
15581
|
-
description:
|
|
15675
|
+
cast: z13.array(
|
|
15676
|
+
z13.object({
|
|
15677
|
+
id: z13.string().optional(),
|
|
15678
|
+
description: z13.string().optional(),
|
|
15582
15679
|
// The deconstruct's note on the target-market localization (e.g. "native
|
|
15583
15680
|
// French speaker") — read to derive the spoken-track language code.
|
|
15584
|
-
market_localization_note:
|
|
15681
|
+
market_localization_note: z13.string().optional()
|
|
15585
15682
|
}).loose()
|
|
15586
15683
|
).optional(),
|
|
15587
|
-
voiceover:
|
|
15684
|
+
voiceover: z13.object({
|
|
15588
15685
|
// on_camera | mixed → mouths are on screen (lip-sync candidates);
|
|
15589
15686
|
// voiceover | none → narration over the picture (no lip-sync).
|
|
15590
|
-
mode:
|
|
15591
|
-
voice_description:
|
|
15592
|
-
persona:
|
|
15687
|
+
mode: z13.string().optional(),
|
|
15688
|
+
voice_description: z13.string().optional(),
|
|
15689
|
+
persona: z13.string().optional()
|
|
15593
15690
|
}).loose().optional(),
|
|
15594
15691
|
// Visual palette — read only to colour a clean brand-card/CTA plate (the
|
|
15595
15692
|
// first hex is the dominant brand colour); never to drive frame generation.
|
|
15596
|
-
style:
|
|
15693
|
+
style: z13.object({ palette: z13.array(z13.object({ hex: z13.string().optional() }).loose()).optional() }).loose().optional()
|
|
15597
15694
|
}).loose().optional(),
|
|
15598
|
-
scenes:
|
|
15695
|
+
scenes: z13.array(Scene).min(1)
|
|
15599
15696
|
}).loose();
|
|
15600
15697
|
function injectHookPhysicality(blueprint) {
|
|
15601
15698
|
for (const scene of blueprint.scenes) {
|
|
@@ -15605,26 +15702,26 @@ function injectHookPhysicality(blueprint) {
|
|
|
15605
15702
|
scene.start_frame_prompt = `${prompt} The subject's physical state IS the scroll-stopper \u2014 render it explicitly, not a calm pose: ${why}.`;
|
|
15606
15703
|
}
|
|
15607
15704
|
}
|
|
15608
|
-
var AppearsItem =
|
|
15609
|
-
var RecurringElement =
|
|
15705
|
+
var AppearsItem = z13.union([z13.number(), z13.object({ scene: z13.number(), edge: z13.string().optional() }).loose()]);
|
|
15706
|
+
var RecurringElement = z13.object({
|
|
15610
15707
|
// person | animal | product | logo | badge | other
|
|
15611
|
-
type:
|
|
15612
|
-
label:
|
|
15613
|
-
description:
|
|
15614
|
-
expression:
|
|
15708
|
+
type: z13.string(),
|
|
15709
|
+
label: z13.string().optional(),
|
|
15710
|
+
description: z13.string().optional(),
|
|
15711
|
+
expression: z13.string().nullable().optional(),
|
|
15615
15712
|
// When the element maps to a global cast entry, its stable id (for annotation).
|
|
15616
|
-
cast_id:
|
|
15713
|
+
cast_id: z13.string().nullable().optional(),
|
|
15617
15714
|
// The label of another element that is the SAME individual as this one, shown
|
|
15618
15715
|
// in a DIFFERENT wardrobe/persona/state (e.g. one creator playing skeptic in a
|
|
15619
15716
|
// pink shirt and believer in a white shirt). Each look gets its own reference
|
|
15620
15717
|
// slot, but the face/identity must stay identical across them.
|
|
15621
|
-
same_as:
|
|
15718
|
+
same_as: z13.string().nullable().optional(),
|
|
15622
15719
|
// Scenes the element appears in. Either a bare list of scene indices (both
|
|
15623
15720
|
// edges) or per-{scene,edge} entries. Both forms are accepted and merged.
|
|
15624
|
-
scenes:
|
|
15625
|
-
appears_in:
|
|
15721
|
+
scenes: z13.array(z13.number()).optional(),
|
|
15722
|
+
appears_in: z13.array(AppearsItem).optional()
|
|
15626
15723
|
}).loose();
|
|
15627
|
-
var RecurringElements =
|
|
15724
|
+
var RecurringElements = z13.array(RecurringElement);
|
|
15628
15725
|
function sanitizeId2(raw, fallback) {
|
|
15629
15726
|
const id = raw.toLowerCase().replace(/[^a-z0-9]+/g, "_").replace(/^_+|_+$/g, "");
|
|
15630
15727
|
return /^[a-z]/.test(id) ? id : `${fallback}_${id}`.replace(/_+$/g, "") || fallback;
|
|
@@ -16042,7 +16139,7 @@ function scrubFloatSentences(text, floatDescs) {
|
|
|
16042
16139
|
return kept;
|
|
16043
16140
|
}
|
|
16044
16141
|
function sceneFloatDescs(scene) {
|
|
16045
|
-
const floats =
|
|
16142
|
+
const floats = z13.array(FloatingElement).safeParse(scene.floating_elements ?? []);
|
|
16046
16143
|
if (!floats.success) return [];
|
|
16047
16144
|
return floats.data.map((f) => f.description?.trim() ?? "").filter(Boolean);
|
|
16048
16145
|
}
|
|
@@ -17382,25 +17479,25 @@ function buildSfxMusic(blueprint, nodes) {
|
|
|
17382
17479
|
}
|
|
17383
17480
|
return tracks;
|
|
17384
17481
|
}
|
|
17385
|
-
var OverlayStyle =
|
|
17386
|
-
var Overlay =
|
|
17387
|
-
text:
|
|
17388
|
-
appears_at_s:
|
|
17389
|
-
duration_s:
|
|
17390
|
-
position:
|
|
17391
|
-
role:
|
|
17392
|
-
animation:
|
|
17393
|
-
animation_detail:
|
|
17482
|
+
var OverlayStyle = z13.object({ color_hex: z13.string().optional(), background: z13.string().optional(), size: z13.string().optional() }).loose();
|
|
17483
|
+
var Overlay = z13.object({
|
|
17484
|
+
text: z13.string().optional(),
|
|
17485
|
+
appears_at_s: z13.number().optional(),
|
|
17486
|
+
duration_s: z13.number().optional(),
|
|
17487
|
+
position: z13.string().optional(),
|
|
17488
|
+
role: z13.string().optional(),
|
|
17489
|
+
animation: z13.string().optional(),
|
|
17490
|
+
animation_detail: z13.string().optional(),
|
|
17394
17491
|
style: OverlayStyle.optional()
|
|
17395
17492
|
}).loose();
|
|
17396
|
-
var FloatingElement =
|
|
17397
|
-
kind:
|
|
17398
|
-
description:
|
|
17399
|
-
brand_name:
|
|
17400
|
-
what_it_represents:
|
|
17401
|
-
appears_at_s:
|
|
17402
|
-
duration_s:
|
|
17403
|
-
position:
|
|
17493
|
+
var FloatingElement = z13.object({
|
|
17494
|
+
kind: z13.string().optional(),
|
|
17495
|
+
description: z13.string().optional(),
|
|
17496
|
+
brand_name: z13.string().nullish(),
|
|
17497
|
+
what_it_represents: z13.string().optional(),
|
|
17498
|
+
appears_at_s: z13.number().optional(),
|
|
17499
|
+
duration_s: z13.number().optional(),
|
|
17500
|
+
position: z13.string().optional()
|
|
17404
17501
|
}).loose();
|
|
17405
17502
|
function escapeHtml(s) {
|
|
17406
17503
|
return s.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
@@ -17432,7 +17529,7 @@ function positionClass(position) {
|
|
|
17432
17529
|
function collectCaptions(blueprint) {
|
|
17433
17530
|
return blueprint.scenes.flatMap((scene) => {
|
|
17434
17531
|
const sceneStart = scene.start_s ?? 0;
|
|
17435
|
-
const overlays =
|
|
17532
|
+
const overlays = z13.array(Overlay).safeParse(scene.overlays ?? []);
|
|
17436
17533
|
return overlays.success ? overlays.data.filter((ov) => Boolean(ov.text?.trim())).map((ov) => {
|
|
17437
17534
|
const at = ov.appears_at_s ?? sceneStart;
|
|
17438
17535
|
return { text: ov.text.trim(), at, end: at + (ov.duration_s ?? 2.5), ov };
|
|
@@ -17512,7 +17609,7 @@ function collectFloatWindows(blueprint, uiRouted) {
|
|
|
17512
17609
|
const windows = /* @__PURE__ */ new Map();
|
|
17513
17610
|
blueprint.scenes.forEach((scene, i) => {
|
|
17514
17611
|
const sceneStart = scene.start_s ?? 0;
|
|
17515
|
-
const floats =
|
|
17612
|
+
const floats = z13.array(FloatingElement).safeParse(scene.floating_elements ?? []);
|
|
17516
17613
|
if (!floats.success) return;
|
|
17517
17614
|
for (const fe of floats.data) {
|
|
17518
17615
|
const at = fe.appears_at_s ?? sceneStart;
|
|
@@ -17898,8 +17995,8 @@ function buildMotionBoard(blueprint) {
|
|
|
17898
17995
|
const end_s = scene.end_s ?? start_s + sceneDurationS(scene);
|
|
17899
17996
|
cursor = end_s;
|
|
17900
17997
|
const spoken = sceneSpokenText(scene);
|
|
17901
|
-
const overlays =
|
|
17902
|
-
const floats =
|
|
17998
|
+
const overlays = z13.array(Overlay).safeParse(scene.overlays ?? []);
|
|
17999
|
+
const floats = z13.array(FloatingElement).safeParse(scene.floating_elements ?? []);
|
|
17903
18000
|
const graphics = [
|
|
17904
18001
|
...(overlays.success ? overlays.data : []).filter((ov) => ov.text?.trim()).map((ov) => ({
|
|
17905
18002
|
kind: "text",
|
|
@@ -23815,11 +23912,121 @@ var schemaCommand = defineCommand147({
|
|
|
23815
23912
|
}
|
|
23816
23913
|
});
|
|
23817
23914
|
|
|
23915
|
+
// src/commands/tags/index.ts
|
|
23916
|
+
import { defineCommand as defineCommand148 } from "citty";
|
|
23917
|
+
|
|
23918
|
+
// src/commands/tags/shared.ts
|
|
23919
|
+
function failApi3(err) {
|
|
23920
|
+
if (err instanceof ApiError) {
|
|
23921
|
+
writeJson({ ok: false, error: { code: err.code, message: err.message } });
|
|
23922
|
+
process.exit(1);
|
|
23923
|
+
}
|
|
23924
|
+
if (err instanceof Error) {
|
|
23925
|
+
writeJson({ ok: false, error: { code: "INTERNAL_ERROR", message: err.message } });
|
|
23926
|
+
process.exit(1);
|
|
23927
|
+
}
|
|
23928
|
+
writeJson({ ok: false, error: { code: "INTERNAL_ERROR", message: "Unexpected error" } });
|
|
23929
|
+
process.exit(1);
|
|
23930
|
+
}
|
|
23931
|
+
function renderEffectiveEntry(entry) {
|
|
23932
|
+
const parts = [entry.ref, entry.type];
|
|
23933
|
+
if (entry.identifier !== void 0) {
|
|
23934
|
+
parts.push(entry.identifier);
|
|
23935
|
+
}
|
|
23936
|
+
if (entry.staged !== void 0) {
|
|
23937
|
+
parts.push(`[staged: ${entry.staged}]`);
|
|
23938
|
+
}
|
|
23939
|
+
const secretBits = [
|
|
23940
|
+
...entry.secretsSet.map((field) => `${field} \u2713 set`),
|
|
23941
|
+
...entry.secretsPending.map((field) => `${field} \u23F3 pending`)
|
|
23942
|
+
];
|
|
23943
|
+
if (secretBits.length > 0) {
|
|
23944
|
+
parts.push(`[secrets: ${secretBits.join(", ")}]`);
|
|
23945
|
+
}
|
|
23946
|
+
return parts.join(" ");
|
|
23947
|
+
}
|
|
23948
|
+
|
|
23949
|
+
// src/commands/tags/index.ts
|
|
23950
|
+
registerSchema({
|
|
23951
|
+
command: "tags.list",
|
|
23952
|
+
description: "Effective marketing tags for this chat: production tags overlaid with the changes staged in this chat. The printed refs (tag ids or tag_temp_*) are exactly what flow side-effect tagIds should reference. Read-only \u2014 every tag change (create, edit, delete) goes through the request_tag_input approval tool.",
|
|
23953
|
+
args: {
|
|
23954
|
+
json: { type: "boolean", description: "Print the raw JSON envelope instead of the readable list", required: false }
|
|
23955
|
+
}
|
|
23956
|
+
});
|
|
23957
|
+
async function listTags(json) {
|
|
23958
|
+
try {
|
|
23959
|
+
const chatId = requireChatId();
|
|
23960
|
+
const response = await apiPost("/api/tags/list", { chatId });
|
|
23961
|
+
if (json) {
|
|
23962
|
+
writeJson({ ok: true, data: response });
|
|
23963
|
+
return;
|
|
23964
|
+
}
|
|
23965
|
+
if (response.tags.length === 0) {
|
|
23966
|
+
process.stdout.write("No tags configured. Propose one with the request_tag_input tool (baker_ui).\n");
|
|
23967
|
+
return;
|
|
23968
|
+
}
|
|
23969
|
+
process.stdout.write(`${response.tags.map(renderEffectiveEntry).join("\n")}
|
|
23970
|
+
`);
|
|
23971
|
+
} catch (err) {
|
|
23972
|
+
failApi3(err);
|
|
23973
|
+
}
|
|
23974
|
+
}
|
|
23975
|
+
var listCommand7 = defineCommand148({
|
|
23976
|
+
meta: {
|
|
23977
|
+
name: "list",
|
|
23978
|
+
description: "Effective tags for this chat (production + staged). Refs printed here are what flow side-effect tagIds should use. Example: baker tags list"
|
|
23979
|
+
},
|
|
23980
|
+
args: { json: { type: "boolean", description: "Print the raw JSON envelope instead of the readable list" } },
|
|
23981
|
+
run: async ({ args }) => {
|
|
23982
|
+
await listTags(args.json === true);
|
|
23983
|
+
}
|
|
23984
|
+
});
|
|
23985
|
+
async function listDraft3() {
|
|
23986
|
+
try {
|
|
23987
|
+
const chatId = requireChatId();
|
|
23988
|
+
const response = await apiPost("/api/tags/draft", { chatId });
|
|
23989
|
+
writeJson({ ok: true, data: response });
|
|
23990
|
+
} catch (err) {
|
|
23991
|
+
failApi3(err);
|
|
23992
|
+
}
|
|
23993
|
+
}
|
|
23994
|
+
var draftCommand3 = defineCommand148({
|
|
23995
|
+
meta: {
|
|
23996
|
+
name: "draft",
|
|
23997
|
+
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)."
|
|
23998
|
+
},
|
|
23999
|
+
run: async () => {
|
|
24000
|
+
await listDraft3();
|
|
24001
|
+
}
|
|
24002
|
+
});
|
|
24003
|
+
var tagsCommand3 = defineCommand148({
|
|
24004
|
+
meta: {
|
|
24005
|
+
name: "tags",
|
|
24006
|
+
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.
|
|
24007
|
+
|
|
24008
|
+
This command is READ-ONLY. Every tag change \u2014 create, edit, or delete \u2014 goes through the request_tag_input tool (baker_ui MCP server): propose one or more changes (each becomes a tab in one approval form), pre-fill the non-secret fields you know, and the user reviews, fills secrets, and approves or skips each. Secret values (accessToken, apiSecret, authorizationToken, apiKey, conversionToken, OAuth connections) never pass through the CLI or the chat.
|
|
24009
|
+
|
|
24010
|
+
Refs: \`baker tags list\` prints each tag's ref \u2014 a real tag id, or tag_temp_* for creates staged in this chat. Use these refs as flow side-effect tagIds; they keep resolving after publish.
|
|
24011
|
+
|
|
24012
|
+
Examples:
|
|
24013
|
+
baker tags list # production + staged, with secret status
|
|
24014
|
+
baker tags draft # review the staged changes awaiting publish`
|
|
24015
|
+
},
|
|
24016
|
+
subCommands: {
|
|
24017
|
+
list: listCommand7,
|
|
24018
|
+
draft: draftCommand3
|
|
24019
|
+
},
|
|
24020
|
+
run: async () => {
|
|
24021
|
+
await listTags(false);
|
|
24022
|
+
}
|
|
24023
|
+
});
|
|
24024
|
+
|
|
23818
24025
|
// src/commands/testimonials/index.ts
|
|
23819
|
-
import { defineCommand as
|
|
24026
|
+
import { defineCommand as defineCommand152 } from "citty";
|
|
23820
24027
|
|
|
23821
24028
|
// src/commands/testimonials/get.ts
|
|
23822
|
-
import { defineCommand as
|
|
24029
|
+
import { defineCommand as defineCommand149 } from "citty";
|
|
23823
24030
|
registerSchema({
|
|
23824
24031
|
command: "testimonials.get",
|
|
23825
24032
|
description: "Get a single testimonial by ID",
|
|
@@ -23827,7 +24034,7 @@ registerSchema({
|
|
|
23827
24034
|
id: { type: "string", description: "Testimonial ID", required: true }
|
|
23828
24035
|
}
|
|
23829
24036
|
});
|
|
23830
|
-
var getCommand4 =
|
|
24037
|
+
var getCommand4 = defineCommand149({
|
|
23831
24038
|
meta: { name: "get", description: "Get a single testimonial by ID. Example: baker testimonials get j571abc123" },
|
|
23832
24039
|
args: {
|
|
23833
24040
|
id: { type: "positional", description: "Testimonial ID", required: false },
|
|
@@ -23864,7 +24071,7 @@ var getCommand4 = defineCommand148({
|
|
|
23864
24071
|
});
|
|
23865
24072
|
|
|
23866
24073
|
// src/commands/testimonials/list.ts
|
|
23867
|
-
import { defineCommand as
|
|
24074
|
+
import { defineCommand as defineCommand150 } from "citty";
|
|
23868
24075
|
registerSchema({
|
|
23869
24076
|
command: "testimonials.list",
|
|
23870
24077
|
description: "List testimonials with optional filters.",
|
|
@@ -23894,7 +24101,7 @@ registerSchema({
|
|
|
23894
24101
|
limit: { type: "number", description: "Max results (default 50)", required: false, default: 50 }
|
|
23895
24102
|
}
|
|
23896
24103
|
});
|
|
23897
|
-
var
|
|
24104
|
+
var listCommand8 = defineCommand150({
|
|
23898
24105
|
meta: {
|
|
23899
24106
|
name: "list",
|
|
23900
24107
|
description: "List testimonials with optional filters. Example: baker testimonials list --source google --sentiment positive"
|
|
@@ -23943,7 +24150,7 @@ var listCommand7 = defineCommand149({
|
|
|
23943
24150
|
});
|
|
23944
24151
|
|
|
23945
24152
|
// src/commands/testimonials/search.ts
|
|
23946
|
-
import { defineCommand as
|
|
24153
|
+
import { defineCommand as defineCommand151 } from "citty";
|
|
23947
24154
|
registerSchema({
|
|
23948
24155
|
command: "testimonials.search",
|
|
23949
24156
|
description: "Search testimonials by text query. Uses hybrid BM25 + vector + reranking.",
|
|
@@ -23974,7 +24181,7 @@ registerSchema({
|
|
|
23974
24181
|
tags: { type: "string", description: "Comma-separated tags to filter by", required: false }
|
|
23975
24182
|
}
|
|
23976
24183
|
});
|
|
23977
|
-
var searchCommand2 =
|
|
24184
|
+
var searchCommand2 = defineCommand151({
|
|
23978
24185
|
meta: {
|
|
23979
24186
|
name: "search",
|
|
23980
24187
|
description: "Semantic search testimonials by text query. Uses hybrid BM25 + vector + reranking. Example: baker testimonials search 'great service' --rating-min 4"
|
|
@@ -24045,10 +24252,10 @@ var searchCommand2 = defineCommand150({
|
|
|
24045
24252
|
});
|
|
24046
24253
|
|
|
24047
24254
|
// src/commands/testimonials/tags.ts
|
|
24048
|
-
var
|
|
24255
|
+
var tagsCommand4 = makeTagsCommand("testimonials", "testimonial", "/api/testimonials/tags");
|
|
24049
24256
|
|
|
24050
24257
|
// src/commands/testimonials/index.ts
|
|
24051
|
-
var testimonialsCommand =
|
|
24258
|
+
var testimonialsCommand = defineCommand152({
|
|
24052
24259
|
meta: {
|
|
24053
24260
|
name: "testimonials",
|
|
24054
24261
|
description: `Find and browse testimonials in Baker. Subcommands: search, get, list, tags.
|
|
@@ -24063,16 +24270,16 @@ Examples:
|
|
|
24063
24270
|
subCommands: {
|
|
24064
24271
|
get: getCommand4,
|
|
24065
24272
|
search: searchCommand2,
|
|
24066
|
-
list:
|
|
24067
|
-
tags:
|
|
24273
|
+
list: listCommand8,
|
|
24274
|
+
tags: tagsCommand4
|
|
24068
24275
|
}
|
|
24069
24276
|
});
|
|
24070
24277
|
|
|
24071
24278
|
// src/commands/videos/index.ts
|
|
24072
|
-
import { defineCommand as
|
|
24279
|
+
import { defineCommand as defineCommand157 } from "citty";
|
|
24073
24280
|
|
|
24074
24281
|
// src/commands/videos/delete.ts
|
|
24075
|
-
import { defineCommand as
|
|
24282
|
+
import { defineCommand as defineCommand153 } from "citty";
|
|
24076
24283
|
registerSchema({
|
|
24077
24284
|
command: "videos.delete",
|
|
24078
24285
|
description: "Delete a video by ID",
|
|
@@ -24086,7 +24293,7 @@ registerSchema({
|
|
|
24086
24293
|
}
|
|
24087
24294
|
}
|
|
24088
24295
|
});
|
|
24089
|
-
var deleteCommand3 =
|
|
24296
|
+
var deleteCommand3 = defineCommand153({
|
|
24090
24297
|
meta: {
|
|
24091
24298
|
name: "delete",
|
|
24092
24299
|
description: "Delete a video by ID. Use --dry-run to preview. Example: baker videos delete j571abc123 --dry-run"
|
|
@@ -24127,7 +24334,7 @@ var deleteCommand3 = defineCommand152({
|
|
|
24127
24334
|
});
|
|
24128
24335
|
|
|
24129
24336
|
// src/commands/videos/get.ts
|
|
24130
|
-
import { defineCommand as
|
|
24337
|
+
import { defineCommand as defineCommand154 } from "citty";
|
|
24131
24338
|
registerSchema({
|
|
24132
24339
|
command: "videos.get",
|
|
24133
24340
|
description: "Get a single video by ID",
|
|
@@ -24135,7 +24342,7 @@ registerSchema({
|
|
|
24135
24342
|
id: { type: "string", description: "Video ID", required: true }
|
|
24136
24343
|
}
|
|
24137
24344
|
});
|
|
24138
|
-
var getCommand5 =
|
|
24345
|
+
var getCommand5 = defineCommand154({
|
|
24139
24346
|
meta: { name: "get", description: "Get a single video by ID. Example: baker videos get j571abc123" },
|
|
24140
24347
|
args: {
|
|
24141
24348
|
id: { type: "positional", description: "Video ID", required: false },
|
|
@@ -24172,7 +24379,7 @@ var getCommand5 = defineCommand153({
|
|
|
24172
24379
|
});
|
|
24173
24380
|
|
|
24174
24381
|
// src/commands/videos/search.ts
|
|
24175
|
-
import { defineCommand as
|
|
24382
|
+
import { defineCommand as defineCommand155 } from "citty";
|
|
24176
24383
|
registerSchema({
|
|
24177
24384
|
command: "videos.search",
|
|
24178
24385
|
description: "Search videos by text query. Only returns ready videos.",
|
|
@@ -24182,7 +24389,7 @@ registerSchema({
|
|
|
24182
24389
|
tags: { type: "string", description: "Comma-separated tags to filter by", required: false }
|
|
24183
24390
|
}
|
|
24184
24391
|
});
|
|
24185
|
-
var searchCommand3 =
|
|
24392
|
+
var searchCommand3 = defineCommand155({
|
|
24186
24393
|
meta: {
|
|
24187
24394
|
name: "search",
|
|
24188
24395
|
description: "Semantic search videos by text query. Uses hybrid BM25 + vector + reranking. Example: baker videos search 'product demo' --tags tutorial"
|
|
@@ -24229,12 +24436,12 @@ var searchCommand3 = defineCommand154({
|
|
|
24229
24436
|
});
|
|
24230
24437
|
|
|
24231
24438
|
// src/commands/videos/tags.ts
|
|
24232
|
-
var
|
|
24439
|
+
var tagsCommand5 = makeTagsCommand("videos", "video", "/api/videos/tags");
|
|
24233
24440
|
|
|
24234
24441
|
// src/commands/videos/upload.ts
|
|
24235
24442
|
import { readFile as readFile12, stat as stat3 } from "fs/promises";
|
|
24236
24443
|
import { extname as extname3 } from "path";
|
|
24237
|
-
import { defineCommand as
|
|
24444
|
+
import { defineCommand as defineCommand156 } from "citty";
|
|
24238
24445
|
var MIME_MAP = {
|
|
24239
24446
|
".mp4": "video/mp4",
|
|
24240
24447
|
".mov": "video/quicktime",
|
|
@@ -24268,7 +24475,7 @@ function detectContentType(filePath) {
|
|
|
24268
24475
|
}
|
|
24269
24476
|
return mime;
|
|
24270
24477
|
}
|
|
24271
|
-
var uploadCommand2 =
|
|
24478
|
+
var uploadCommand2 = defineCommand156({
|
|
24272
24479
|
meta: {
|
|
24273
24480
|
name: "upload",
|
|
24274
24481
|
description: "Upload a video file to Baker via Mux direct upload. Auto-detects content type. Example: baker videos upload ./demo.mp4"
|
|
@@ -24322,7 +24529,7 @@ var uploadCommand2 = defineCommand155({
|
|
|
24322
24529
|
});
|
|
24323
24530
|
|
|
24324
24531
|
// src/commands/videos/index.ts
|
|
24325
|
-
var videosCommand =
|
|
24532
|
+
var videosCommand = defineCommand157({
|
|
24326
24533
|
meta: {
|
|
24327
24534
|
name: "videos",
|
|
24328
24535
|
description: `Find and manage videos in Baker. Subcommands: search, get, upload, delete, tags.
|
|
@@ -24340,15 +24547,15 @@ Examples:
|
|
|
24340
24547
|
search: searchCommand3,
|
|
24341
24548
|
upload: uploadCommand2,
|
|
24342
24549
|
delete: deleteCommand3,
|
|
24343
|
-
tags:
|
|
24550
|
+
tags: tagsCommand5
|
|
24344
24551
|
}
|
|
24345
24552
|
});
|
|
24346
24553
|
|
|
24347
24554
|
// src/commands/winning-ads/index.ts
|
|
24348
|
-
import { defineCommand as
|
|
24555
|
+
import { defineCommand as defineCommand160 } from "citty";
|
|
24349
24556
|
|
|
24350
24557
|
// src/commands/winning-ads/advertisers.ts
|
|
24351
|
-
import { defineCommand as
|
|
24558
|
+
import { defineCommand as defineCommand158 } from "citty";
|
|
24352
24559
|
registerSchema({
|
|
24353
24560
|
command: "winning-ads.advertisers",
|
|
24354
24561
|
description: "Resolve a brand name to advertiser_id(s) in the ad-dna corpus \u2014 to find your OWN advertiser (to --exclude-advertiser) or a competitor (to --advertiser-id).",
|
|
@@ -24361,7 +24568,7 @@ registerSchema({
|
|
|
24361
24568
|
function identity(record) {
|
|
24362
24569
|
return record;
|
|
24363
24570
|
}
|
|
24364
|
-
var advertisersCommand2 =
|
|
24571
|
+
var advertisersCommand2 = defineCommand158({
|
|
24365
24572
|
meta: {
|
|
24366
24573
|
name: "advertisers",
|
|
24367
24574
|
description: 'Resolve a brand name to advertiser_id(s). Use it to find your own advertiser for --exclude-advertiser, or a competitor for --advertiser-id. Example: baker winning-ads advertisers "Deel" --output md'
|
|
@@ -24412,7 +24619,7 @@ var advertisersCommand2 = defineCommand157({
|
|
|
24412
24619
|
});
|
|
24413
24620
|
|
|
24414
24621
|
// src/commands/winning-ads/search.ts
|
|
24415
|
-
import { defineCommand as
|
|
24622
|
+
import { defineCommand as defineCommand159 } from "citty";
|
|
24416
24623
|
registerSchema({
|
|
24417
24624
|
command: "winning-ads.search",
|
|
24418
24625
|
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.",
|
|
@@ -24520,7 +24727,7 @@ function buildSearchBody(args) {
|
|
|
24520
24727
|
}
|
|
24521
24728
|
return body;
|
|
24522
24729
|
}
|
|
24523
|
-
var searchCommand4 =
|
|
24730
|
+
var searchCommand4 = defineCommand159({
|
|
24524
24731
|
meta: {
|
|
24525
24732
|
name: "search",
|
|
24526
24733
|
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"
|
|
@@ -24632,7 +24839,7 @@ var searchCommand4 = defineCommand158({
|
|
|
24632
24839
|
});
|
|
24633
24840
|
|
|
24634
24841
|
// src/commands/winning-ads/index.ts
|
|
24635
|
-
var winningAdsCommand =
|
|
24842
|
+
var winningAdsCommand = defineCommand160({
|
|
24636
24843
|
meta: {
|
|
24637
24844
|
name: "winning-ads",
|
|
24638
24845
|
description: `Search the ad-dna corpus of scored "winning" ads for reference creatives to reproduce. Proxied through the Baker backend (BAKER_API_KEY) \u2014 no separate token needed.
|
|
@@ -24672,11 +24879,11 @@ function getCliVersion() {
|
|
|
24672
24879
|
}
|
|
24673
24880
|
|
|
24674
24881
|
// src/cli.ts
|
|
24675
|
-
var main =
|
|
24882
|
+
var main = defineCommand161({
|
|
24676
24883
|
meta: {
|
|
24677
24884
|
name: "baker",
|
|
24678
24885
|
version: getCliVersion(),
|
|
24679
|
-
description: `AI-agent CLI for finding and managing images, videos, testimonials, action items, scheduled actions, and ad platform data in Baker.
|
|
24886
|
+
description: `AI-agent CLI for finding and managing images, videos, testimonials, action items, scheduled actions, marketing tags, and ad platform data in Baker.
|
|
24680
24887
|
|
|
24681
24888
|
Auth: Set BAKER_API_KEY (starts with bk_) and BAKER_API_URL environment variables.
|
|
24682
24889
|
Chat: Set BAKER_CHAT_ID for action and scheduled-action commands that stage changes against a chat.
|
|
@@ -24696,6 +24903,7 @@ Introspection: Run 'baker schema <command>' to inspect argument schemas.`
|
|
|
24696
24903
|
videos: videosCommand,
|
|
24697
24904
|
testimonials: testimonialsCommand,
|
|
24698
24905
|
canvas: canvasCommand,
|
|
24906
|
+
tags: tagsCommand3,
|
|
24699
24907
|
"winning-ads": winningAdsCommand,
|
|
24700
24908
|
mcp: mcpCommand,
|
|
24701
24909
|
schema: schemaCommand
|