@koda-sl/baker-cli 0.121.0-dev.ea15b0199 → 0.121.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -26
- package/dist/{chunk-MWFJ5NOP.js → chunk-IWPAXJC3.js} +4 -4
- package/dist/chunk-IWPAXJC3.js.map +1 -0
- package/dist/cli.js +812 -1307
- package/dist/cli.js.map +1 -1
- package/dist/engine/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-MWFJ5NOP.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-IWPAXJC3.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 defineCommand160, 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,307 +1916,142 @@ var imagesIngestResponseSchema = z4.object({
|
|
|
1918
1916
|
contentHash: z4.string()
|
|
1919
1917
|
});
|
|
1920
1918
|
|
|
1921
|
-
// ../api/src/tags.ts
|
|
1922
|
-
import { z as z5 } from "zod";
|
|
1923
|
-
var TAG_TYPES = [
|
|
1924
|
-
"meta",
|
|
1925
|
-
"amplitude",
|
|
1926
|
-
"googleAds",
|
|
1927
|
-
"tiktok",
|
|
1928
|
-
"vwo",
|
|
1929
|
-
"hotjar",
|
|
1930
|
-
"clarity",
|
|
1931
|
-
"pinterest",
|
|
1932
|
-
"code",
|
|
1933
|
-
"googleAnalytics",
|
|
1934
|
-
"googleTagManager",
|
|
1935
|
-
"hubspot",
|
|
1936
|
-
"linkedinInsightTag",
|
|
1937
|
-
"onetrust",
|
|
1938
|
-
"posthog",
|
|
1939
|
-
"datafast",
|
|
1940
|
-
"recaptcha",
|
|
1941
|
-
"twitterAds"
|
|
1942
|
-
];
|
|
1943
|
-
var tagTypeSchema = z5.enum(TAG_TYPES);
|
|
1944
|
-
var TAG_SECRET_FIELDS = {
|
|
1945
|
-
meta: ["accessToken"],
|
|
1946
|
-
amplitude: [],
|
|
1947
|
-
googleAds: ["oauthProviderId", "customerAccountId", "customerId", "loginCustomerId"],
|
|
1948
|
-
tiktok: ["accessToken"],
|
|
1949
|
-
vwo: [],
|
|
1950
|
-
hotjar: [],
|
|
1951
|
-
clarity: [],
|
|
1952
|
-
pinterest: ["conversionToken"],
|
|
1953
|
-
code: [],
|
|
1954
|
-
googleAnalytics: ["apiSecret"],
|
|
1955
|
-
googleTagManager: ["authorizationToken"],
|
|
1956
|
-
hubspot: [],
|
|
1957
|
-
linkedinInsightTag: ["oauthProviderId"],
|
|
1958
|
-
onetrust: [],
|
|
1959
|
-
posthog: [],
|
|
1960
|
-
datafast: ["apiKey"],
|
|
1961
|
-
recaptcha: [],
|
|
1962
|
-
twitterAds: ["oauthProviderId"]
|
|
1963
|
-
};
|
|
1964
|
-
var TAG_REQUESTABLE_SECRET_FIELDS = {
|
|
1965
|
-
meta: ["accessToken"],
|
|
1966
|
-
amplitude: [],
|
|
1967
|
-
googleAds: ["oauthProviderId", "customerAccountId"],
|
|
1968
|
-
tiktok: ["accessToken"],
|
|
1969
|
-
vwo: [],
|
|
1970
|
-
hotjar: [],
|
|
1971
|
-
clarity: [],
|
|
1972
|
-
pinterest: ["conversionToken"],
|
|
1973
|
-
code: [],
|
|
1974
|
-
googleAnalytics: ["apiSecret"],
|
|
1975
|
-
googleTagManager: ["authorizationToken"],
|
|
1976
|
-
hubspot: [],
|
|
1977
|
-
linkedinInsightTag: ["oauthProviderId"],
|
|
1978
|
-
onetrust: [],
|
|
1979
|
-
posthog: [],
|
|
1980
|
-
datafast: ["apiKey"],
|
|
1981
|
-
recaptcha: [],
|
|
1982
|
-
twitterAds: ["oauthProviderId"]
|
|
1983
|
-
};
|
|
1984
|
-
var tagDraftOpKindSchema = z5.enum(["create", "update", "delete"]);
|
|
1985
|
-
var tagDraftOpViewSchema = z5.object({
|
|
1986
|
-
/** `tag_temp_*` for staged creates; the real tag id for update/delete ops. */
|
|
1987
|
-
ref: z5.string(),
|
|
1988
|
-
kind: tagDraftOpKindSchema,
|
|
1989
|
-
type: tagTypeSchema,
|
|
1990
|
-
/** Present on update/delete ops — the real tag this op targets. */
|
|
1991
|
-
tagId: z5.string().optional(),
|
|
1992
|
-
/** Non-secret config (create: full; update: the staged patch). Secrets are structurally absent. */
|
|
1993
|
-
config: z5.record(z5.string(), z5.string()),
|
|
1994
|
-
/** Update only — fields the op explicitly clears. */
|
|
1995
|
-
clearFields: z5.array(z5.string()).optional(),
|
|
1996
|
-
/** Names of secret fields already provided via the dashboard secure form. Never values. */
|
|
1997
|
-
secretsSet: z5.array(z5.string()),
|
|
1998
|
-
/** Names of secret fields still awaiting user input. */
|
|
1999
|
-
secretsPending: z5.array(z5.string()),
|
|
2000
|
-
summary: z5.string(),
|
|
2001
|
-
stagedAt: z5.number()
|
|
2002
|
-
});
|
|
2003
|
-
var tagsEffectiveEntrySchema = z5.object({
|
|
2004
|
-
/** Real tag id, or `tag_temp_*` for staged creates. Use as flow side-effect `tagIds` value. */
|
|
2005
|
-
ref: z5.string(),
|
|
2006
|
-
tagId: z5.string().optional(),
|
|
2007
|
-
type: tagTypeSchema,
|
|
2008
|
-
/** Value of the type's identifying field, when set. */
|
|
2009
|
-
identifier: z5.string().optional(),
|
|
2010
|
-
/** Redacted config; for staged updates, production config with the patch merged. */
|
|
2011
|
-
config: z5.record(z5.string(), z5.string()),
|
|
2012
|
-
/** Absent = live production tag with no staged changes in this chat. */
|
|
2013
|
-
staged: tagDraftOpKindSchema.optional(),
|
|
2014
|
-
secretsSet: z5.array(z5.string()),
|
|
2015
|
-
secretsPending: z5.array(z5.string())
|
|
2016
|
-
});
|
|
2017
|
-
var tagsListRequestSchema = z5.object({ chatId: z5.string() });
|
|
2018
|
-
var tagsListResponseSchema = z5.object({ tags: z5.array(tagsEffectiveEntrySchema) });
|
|
2019
|
-
var tagsDraftStageRequestSchema = z5.discriminatedUnion("kind", [
|
|
2020
|
-
z5.object({
|
|
2021
|
-
kind: z5.literal("create"),
|
|
2022
|
-
chatId: z5.string(),
|
|
2023
|
-
type: tagTypeSchema,
|
|
2024
|
-
config: z5.record(z5.string(), z5.string()),
|
|
2025
|
-
requestSecrets: z5.array(z5.string()).optional(),
|
|
2026
|
-
summary: z5.string().optional()
|
|
2027
|
-
}),
|
|
2028
|
-
z5.object({
|
|
2029
|
-
kind: z5.literal("update"),
|
|
2030
|
-
chatId: z5.string(),
|
|
2031
|
-
ref: z5.string(),
|
|
2032
|
-
config: z5.record(z5.string(), z5.string()).optional(),
|
|
2033
|
-
clearFields: z5.array(z5.string()).optional(),
|
|
2034
|
-
requestSecrets: z5.array(z5.string()).optional(),
|
|
2035
|
-
summary: z5.string().optional()
|
|
2036
|
-
}),
|
|
2037
|
-
z5.object({
|
|
2038
|
-
kind: z5.literal("delete"),
|
|
2039
|
-
chatId: z5.string(),
|
|
2040
|
-
ref: z5.string()
|
|
2041
|
-
})
|
|
2042
|
-
]);
|
|
2043
|
-
var tagsDraftStageResponseSchema = z5.object({
|
|
2044
|
-
/** Null when the request dissolved a staged create (delete/clearing an unpublished temp ref). */
|
|
2045
|
-
op: tagDraftOpViewSchema.nullable(),
|
|
2046
|
-
/** True when a `delete <tag_temp_*>` dropped the staged create instead of staging a delete. */
|
|
2047
|
-
removedStagedCreate: z5.boolean().optional()
|
|
2048
|
-
});
|
|
2049
|
-
var tagsDraftListRequestSchema = z5.object({ chatId: z5.string() });
|
|
2050
|
-
var tagsDraftListResponseSchema = z5.object({
|
|
2051
|
-
status: z5.enum(["active", "publishing", "applied", "discarded", "none"]),
|
|
2052
|
-
ops: z5.array(tagDraftOpViewSchema)
|
|
2053
|
-
});
|
|
2054
|
-
var tagsDraftRemoveRequestSchema = z5.object({ chatId: z5.string(), ref: z5.string() });
|
|
2055
|
-
var tagsDraftRemoveResponseSchema = z5.object({ removed: z5.boolean() });
|
|
2056
|
-
var tagsDraftClearRequestSchema = z5.object({ chatId: z5.string() });
|
|
2057
|
-
var tagsDraftClearResponseSchema = z5.object({ cleared: z5.number() });
|
|
2058
|
-
var tagInputRequestSchema = z5.object({
|
|
2059
|
-
mode: z5.enum(["create", "edit"]),
|
|
2060
|
-
tagType: tagTypeSchema,
|
|
2061
|
-
/** Edit mode — the real tag id or `tag_temp_*` ref being edited. */
|
|
2062
|
-
ref: z5.string().optional(),
|
|
2063
|
-
/** Non-secret values the agent proposes to prefill. Secret keys are stripped at every boundary. */
|
|
2064
|
-
prefilledConfig: z5.record(z5.string(), z5.string()).optional(),
|
|
2065
|
-
/** Secret field names the agent asks the user to provide. */
|
|
2066
|
-
requestedSecretFields: z5.array(z5.string()).optional(),
|
|
2067
|
-
/** Short message shown above the form explaining why the input is needed. */
|
|
2068
|
-
message: z5.string().optional()
|
|
2069
|
-
});
|
|
2070
|
-
var tagInputResultSchema = z5.discriminatedUnion("status", [
|
|
2071
|
-
z5.object({
|
|
2072
|
-
status: z5.literal("submitted"),
|
|
2073
|
-
ref: z5.string(),
|
|
2074
|
-
type: tagTypeSchema,
|
|
2075
|
-
/** Identifying field name → value (non-secret), when the type has one. */
|
|
2076
|
-
identifier: z5.record(z5.string(), z5.string()).optional(),
|
|
2077
|
-
secretFieldsSet: z5.array(z5.string()),
|
|
2078
|
-
note: z5.string().optional()
|
|
2079
|
-
}),
|
|
2080
|
-
z5.object({
|
|
2081
|
-
status: z5.literal("declined"),
|
|
2082
|
-
reason: z5.string().optional()
|
|
2083
|
-
})
|
|
2084
|
-
]);
|
|
2085
|
-
|
|
2086
1919
|
// ../api/src/testimonials.ts
|
|
2087
|
-
import { z as
|
|
2088
|
-
var testimonialSourceTypeSchema =
|
|
2089
|
-
var testimonialStatusSchema =
|
|
2090
|
-
var testimonialSentimentSchema =
|
|
2091
|
-
var testimonialDocSchema =
|
|
2092
|
-
_id:
|
|
2093
|
-
_creationTime:
|
|
2094
|
-
companyId:
|
|
2095
|
-
sourceId:
|
|
1920
|
+
import { z as z5 } from "zod";
|
|
1921
|
+
var testimonialSourceTypeSchema = z5.enum(["google", "trustpilot"]);
|
|
1922
|
+
var testimonialStatusSchema = z5.enum(["pending", "processing", "ready", "error"]);
|
|
1923
|
+
var testimonialSentimentSchema = z5.enum(["positive", "neutral", "negative"]);
|
|
1924
|
+
var testimonialDocSchema = z5.object({
|
|
1925
|
+
_id: z5.string(),
|
|
1926
|
+
_creationTime: z5.number(),
|
|
1927
|
+
companyId: z5.string(),
|
|
1928
|
+
sourceId: z5.string(),
|
|
2096
1929
|
sourceType: testimonialSourceTypeSchema,
|
|
2097
|
-
reviewText:
|
|
2098
|
-
reviewTitle:
|
|
2099
|
-
searchText:
|
|
2100
|
-
reviewerName:
|
|
2101
|
-
reviewerImageUrl:
|
|
2102
|
-
reviewerImageId:
|
|
2103
|
-
reviewerLocation:
|
|
2104
|
-
rating:
|
|
2105
|
-
reviewDate:
|
|
2106
|
-
ownerAnswer:
|
|
2107
|
-
mediaUrls:
|
|
2108
|
-
imageIds:
|
|
2109
|
-
videoIds:
|
|
2110
|
-
sourceUrl:
|
|
2111
|
-
rawData:
|
|
2112
|
-
tags:
|
|
2113
|
-
highlight:
|
|
2114
|
-
language:
|
|
2115
|
-
summary:
|
|
1930
|
+
reviewText: z5.string(),
|
|
1931
|
+
reviewTitle: z5.string().optional(),
|
|
1932
|
+
searchText: z5.string().optional(),
|
|
1933
|
+
reviewerName: z5.string().optional(),
|
|
1934
|
+
reviewerImageUrl: z5.string().optional(),
|
|
1935
|
+
reviewerImageId: z5.string().optional(),
|
|
1936
|
+
reviewerLocation: z5.string().optional(),
|
|
1937
|
+
rating: z5.number().optional(),
|
|
1938
|
+
reviewDate: z5.number().optional(),
|
|
1939
|
+
ownerAnswer: z5.string().optional(),
|
|
1940
|
+
mediaUrls: z5.array(z5.string()).optional(),
|
|
1941
|
+
imageIds: z5.array(z5.string()).optional(),
|
|
1942
|
+
videoIds: z5.array(z5.string()).optional(),
|
|
1943
|
+
sourceUrl: z5.string().optional(),
|
|
1944
|
+
rawData: z5.unknown().optional(),
|
|
1945
|
+
tags: z5.array(z5.string()),
|
|
1946
|
+
highlight: z5.string().optional(),
|
|
1947
|
+
language: z5.string().optional(),
|
|
1948
|
+
summary: z5.string().optional(),
|
|
2116
1949
|
sentiment: testimonialSentimentSchema.optional(),
|
|
2117
|
-
textEmbedding:
|
|
2118
|
-
externalId:
|
|
2119
|
-
contentHash:
|
|
1950
|
+
textEmbedding: z5.array(z5.number()).optional(),
|
|
1951
|
+
externalId: z5.string().optional(),
|
|
1952
|
+
contentHash: z5.string().optional(),
|
|
2120
1953
|
status: testimonialStatusSchema,
|
|
2121
|
-
errorMessage:
|
|
2122
|
-
createdAt:
|
|
2123
|
-
updatedAt:
|
|
1954
|
+
errorMessage: z5.string().optional(),
|
|
1955
|
+
createdAt: z5.number(),
|
|
1956
|
+
updatedAt: z5.number()
|
|
2124
1957
|
});
|
|
2125
|
-
var testimonialsListRequestSchema =
|
|
1958
|
+
var testimonialsListRequestSchema = z5.object({
|
|
2126
1959
|
source: testimonialSourceTypeSchema.optional(),
|
|
2127
|
-
rating_min:
|
|
2128
|
-
rating_max:
|
|
2129
|
-
tags:
|
|
1960
|
+
rating_min: z5.coerce.number().int().min(1).max(5).optional(),
|
|
1961
|
+
rating_max: z5.coerce.number().int().min(1).max(5).optional(),
|
|
1962
|
+
tags: z5.string().transform((s) => s.split(",").filter(Boolean)).optional(),
|
|
2130
1963
|
status: testimonialStatusSchema.optional(),
|
|
2131
1964
|
sentiment: testimonialSentimentSchema.optional(),
|
|
2132
|
-
language:
|
|
2133
|
-
limit:
|
|
2134
|
-
});
|
|
2135
|
-
var testimonialsListResponseSchema =
|
|
2136
|
-
var testimonialsGetRequestSchema =
|
|
2137
|
-
var testimonialsSearchRequestSchema =
|
|
2138
|
-
query:
|
|
2139
|
-
limit:
|
|
1965
|
+
language: z5.string().min(2).max(5).optional(),
|
|
1966
|
+
limit: z5.coerce.number().int().positive().max(200).optional()
|
|
1967
|
+
});
|
|
1968
|
+
var testimonialsListResponseSchema = z5.array(testimonialDocSchema);
|
|
1969
|
+
var testimonialsGetRequestSchema = z5.object({ id: z5.string().min(1, "Missing id parameter") });
|
|
1970
|
+
var testimonialsSearchRequestSchema = z5.object({
|
|
1971
|
+
query: z5.string().min(1),
|
|
1972
|
+
limit: z5.coerce.number().int().positive().max(100).optional(),
|
|
2140
1973
|
source: testimonialSourceTypeSchema.optional(),
|
|
2141
|
-
rating_min:
|
|
2142
|
-
rating_max:
|
|
2143
|
-
tags:
|
|
1974
|
+
rating_min: z5.coerce.number().int().min(1).max(5).optional(),
|
|
1975
|
+
rating_max: z5.coerce.number().int().min(1).max(5).optional(),
|
|
1976
|
+
tags: z5.array(z5.string()).optional(),
|
|
2144
1977
|
status: testimonialStatusSchema.optional(),
|
|
2145
1978
|
sentiment: testimonialSentimentSchema.optional(),
|
|
2146
|
-
language:
|
|
1979
|
+
language: z5.string().min(2).max(5).optional()
|
|
2147
1980
|
}).refine(
|
|
2148
1981
|
(data) => data.rating_min === void 0 || data.rating_max === void 0 || data.rating_min <= data.rating_max,
|
|
2149
1982
|
{ message: "rating_min must be less than or equal to rating_max" }
|
|
2150
1983
|
);
|
|
2151
|
-
var testimonialsSearchResponseSchema =
|
|
2152
|
-
var testimonialsOutscraperWebhookResponseSchema =
|
|
2153
|
-
ok:
|
|
2154
|
-
note:
|
|
1984
|
+
var testimonialsSearchResponseSchema = z5.array(testimonialDocSchema);
|
|
1985
|
+
var testimonialsOutscraperWebhookResponseSchema = z5.object({
|
|
1986
|
+
ok: z5.literal(true),
|
|
1987
|
+
note: z5.string().optional()
|
|
2155
1988
|
});
|
|
2156
1989
|
|
|
2157
1990
|
// ../api/src/videos.ts
|
|
2158
|
-
import { z as
|
|
2159
|
-
var videoStatusSchema =
|
|
2160
|
-
var videoTranscriptSegmentSchema =
|
|
2161
|
-
text:
|
|
2162
|
-
startSecond:
|
|
2163
|
-
endSecond:
|
|
2164
|
-
});
|
|
2165
|
-
var videoSceneSchema =
|
|
2166
|
-
title:
|
|
2167
|
-
description:
|
|
2168
|
-
startSecond:
|
|
2169
|
-
endSecond:
|
|
2170
|
-
thumbnailTime:
|
|
2171
|
-
});
|
|
2172
|
-
var videoDocSchema =
|
|
2173
|
-
_id:
|
|
2174
|
-
_creationTime:
|
|
2175
|
-
companyId:
|
|
2176
|
-
muxAssetId:
|
|
2177
|
-
muxPlaybackId:
|
|
2178
|
-
muxUploadId:
|
|
2179
|
-
name:
|
|
2180
|
-
description:
|
|
2181
|
-
tags:
|
|
2182
|
-
source:
|
|
2183
|
-
externalId:
|
|
2184
|
-
sourceId:
|
|
2185
|
-
width:
|
|
2186
|
-
height:
|
|
2187
|
-
aspectRatio:
|
|
2188
|
-
duration:
|
|
2189
|
-
transcript:
|
|
2190
|
-
transcriptSegments:
|
|
2191
|
-
scenes:
|
|
2192
|
-
descriptionEmbedding:
|
|
2193
|
-
searchText:
|
|
1991
|
+
import { z as z6 } from "zod";
|
|
1992
|
+
var videoStatusSchema = z6.enum(["uploading", "uploaded", "processing", "ready", "error"]);
|
|
1993
|
+
var videoTranscriptSegmentSchema = z6.object({
|
|
1994
|
+
text: z6.string(),
|
|
1995
|
+
startSecond: z6.number(),
|
|
1996
|
+
endSecond: z6.number()
|
|
1997
|
+
});
|
|
1998
|
+
var videoSceneSchema = z6.object({
|
|
1999
|
+
title: z6.string(),
|
|
2000
|
+
description: z6.string(),
|
|
2001
|
+
startSecond: z6.number(),
|
|
2002
|
+
endSecond: z6.number(),
|
|
2003
|
+
thumbnailTime: z6.number()
|
|
2004
|
+
});
|
|
2005
|
+
var videoDocSchema = z6.object({
|
|
2006
|
+
_id: z6.string(),
|
|
2007
|
+
_creationTime: z6.number(),
|
|
2008
|
+
companyId: z6.string(),
|
|
2009
|
+
muxAssetId: z6.string(),
|
|
2010
|
+
muxPlaybackId: z6.string(),
|
|
2011
|
+
muxUploadId: z6.string(),
|
|
2012
|
+
name: z6.string(),
|
|
2013
|
+
description: z6.string(),
|
|
2014
|
+
tags: z6.array(z6.string()),
|
|
2015
|
+
source: z6.string(),
|
|
2016
|
+
externalId: z6.string().optional(),
|
|
2017
|
+
sourceId: z6.string().optional(),
|
|
2018
|
+
width: z6.number().optional(),
|
|
2019
|
+
height: z6.number().optional(),
|
|
2020
|
+
aspectRatio: z6.number().optional(),
|
|
2021
|
+
duration: z6.number().optional(),
|
|
2022
|
+
transcript: z6.string().optional(),
|
|
2023
|
+
transcriptSegments: z6.array(videoTranscriptSegmentSchema).optional(),
|
|
2024
|
+
scenes: z6.array(videoSceneSchema).optional(),
|
|
2025
|
+
descriptionEmbedding: z6.array(z6.number()).optional(),
|
|
2026
|
+
searchText: z6.string().optional(),
|
|
2194
2027
|
status: videoStatusSchema,
|
|
2195
|
-
errorMessage:
|
|
2196
|
-
createdAt:
|
|
2197
|
-
updatedAt:
|
|
2198
|
-
thumbnailUrl:
|
|
2199
|
-
});
|
|
2200
|
-
var videosWebhookResponseSchema =
|
|
2201
|
-
var videosGetRequestSchema =
|
|
2202
|
-
var videosSearchRequestSchema =
|
|
2203
|
-
query:
|
|
2204
|
-
limit:
|
|
2205
|
-
tags:
|
|
2206
|
-
});
|
|
2207
|
-
var videoSearchResultSchema =
|
|
2208
|
-
_id:
|
|
2209
|
-
thumbnailUrl:
|
|
2210
|
-
name:
|
|
2211
|
-
description:
|
|
2212
|
-
tags:
|
|
2213
|
-
status:
|
|
2214
|
-
duration:
|
|
2215
|
-
muxPlaybackId:
|
|
2216
|
-
createdAt:
|
|
2217
|
-
});
|
|
2218
|
-
var videosSearchResponseSchema =
|
|
2219
|
-
var videosUploadResponseSchema =
|
|
2220
|
-
var videosDeleteRequestSchema =
|
|
2221
|
-
var videosDeleteResponseSchema =
|
|
2028
|
+
errorMessage: z6.string().optional(),
|
|
2029
|
+
createdAt: z6.number(),
|
|
2030
|
+
updatedAt: z6.number(),
|
|
2031
|
+
thumbnailUrl: z6.string()
|
|
2032
|
+
});
|
|
2033
|
+
var videosWebhookResponseSchema = z6.object({ ok: z6.literal(true) });
|
|
2034
|
+
var videosGetRequestSchema = z6.object({ id: z6.string().min(1, "Missing id parameter") });
|
|
2035
|
+
var videosSearchRequestSchema = z6.object({
|
|
2036
|
+
query: z6.string().min(1),
|
|
2037
|
+
limit: z6.coerce.number().int().positive().max(100).optional(),
|
|
2038
|
+
tags: z6.array(z6.string()).optional()
|
|
2039
|
+
});
|
|
2040
|
+
var videoSearchResultSchema = z6.object({
|
|
2041
|
+
_id: z6.string(),
|
|
2042
|
+
thumbnailUrl: z6.string(),
|
|
2043
|
+
name: z6.string(),
|
|
2044
|
+
description: z6.string(),
|
|
2045
|
+
tags: z6.array(z6.string()),
|
|
2046
|
+
status: z6.string(),
|
|
2047
|
+
duration: z6.number().optional(),
|
|
2048
|
+
muxPlaybackId: z6.string(),
|
|
2049
|
+
createdAt: z6.number()
|
|
2050
|
+
});
|
|
2051
|
+
var videosSearchResponseSchema = z6.array(videoSearchResultSchema);
|
|
2052
|
+
var videosUploadResponseSchema = z6.object({ uploadUrl: z6.string(), videoId: z6.string() });
|
|
2053
|
+
var videosDeleteRequestSchema = z6.object({ id: z6.string().min(1, "Missing video ID") });
|
|
2054
|
+
var videosDeleteResponseSchema = z6.object({ ok: z6.literal(true) });
|
|
2222
2055
|
|
|
2223
2056
|
// src/commands/actions/complete.ts
|
|
2224
2057
|
import { defineCommand as defineCommand2 } from "citty";
|
|
@@ -4031,37 +3864,37 @@ var GEO_TARGET_CONSTANT_REGEX = /^geoTargetConstants\/\d+$/;
|
|
|
4031
3864
|
var LANGUAGE_CONSTANT_REGEX = /^languageConstants\/\d+$/;
|
|
4032
3865
|
|
|
4033
3866
|
// ../api/src/ads-google/ops.ts
|
|
4034
|
-
import { z as
|
|
4035
|
-
var tempRefSchema2 =
|
|
4036
|
-
var refSchema =
|
|
4037
|
-
|
|
4038
|
-
|
|
3867
|
+
import { z as z7 } from "zod";
|
|
3868
|
+
var tempRefSchema2 = z7.string().regex(TEMP_REF_REGEX2, "expected a g_temp_* reference");
|
|
3869
|
+
var refSchema = z7.union([
|
|
3870
|
+
z7.string().regex(RESOURCE_NAME_REGEX, "expected a customers/\u2026/\u2026/\u2026 resource name"),
|
|
3871
|
+
z7.string().regex(NUMERIC_ID_REGEX2, "expected a numeric id"),
|
|
4039
3872
|
tempRefSchema2
|
|
4040
3873
|
]);
|
|
4041
3874
|
var targetRefSchema = refSchema;
|
|
4042
|
-
var microsSchema =
|
|
4043
|
-
var httpsUrlSchema2 =
|
|
4044
|
-
var customerIdSchema =
|
|
4045
|
-
var stageableStatusSchema2 =
|
|
4046
|
-
var matchTypeSchema =
|
|
4047
|
-
var keywordTextSchema =
|
|
4048
|
-
var budgetCreateSchema =
|
|
4049
|
-
name:
|
|
3875
|
+
var microsSchema = z7.number().int().positive("expected a positive micros amount");
|
|
3876
|
+
var httpsUrlSchema2 = z7.string().url().refine((u) => u.startsWith("https://"), "final URLs must be https");
|
|
3877
|
+
var customerIdSchema = z7.string().regex(NUMERIC_ID_REGEX2, "customerId must be the bare numeric customer id");
|
|
3878
|
+
var stageableStatusSchema2 = z7.enum(STAGEABLE_CREATE_STATUSES2);
|
|
3879
|
+
var matchTypeSchema = z7.enum(KEYWORD_MATCH_TYPES);
|
|
3880
|
+
var keywordTextSchema = z7.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");
|
|
3881
|
+
var budgetCreateSchema = z7.object({
|
|
3882
|
+
name: z7.string().min(1).max(GOOGLE_ADS_LIMITS.budget.nameMax),
|
|
4050
3883
|
amountMicros: microsSchema,
|
|
4051
|
-
deliveryMethod:
|
|
4052
|
-
explicitlyShared:
|
|
3884
|
+
deliveryMethod: z7.enum(BUDGET_DELIVERY_METHODS).default("STANDARD"),
|
|
3885
|
+
explicitlyShared: z7.boolean().default(false)
|
|
4053
3886
|
});
|
|
4054
|
-
var budgetUpdateSchema =
|
|
4055
|
-
name:
|
|
3887
|
+
var budgetUpdateSchema = z7.object({
|
|
3888
|
+
name: z7.string().min(1).max(GOOGLE_ADS_LIMITS.budget.nameMax).optional(),
|
|
4056
3889
|
amountMicros: microsSchema.optional(),
|
|
4057
|
-
deliveryMethod:
|
|
3890
|
+
deliveryMethod: z7.enum(BUDGET_DELIVERY_METHODS).optional()
|
|
4058
3891
|
}).refine((p) => Object.values(p).some((v) => v !== void 0), "update needs at least one field");
|
|
4059
|
-
var biddingConfigSchema =
|
|
4060
|
-
type:
|
|
3892
|
+
var biddingConfigSchema = z7.object({
|
|
3893
|
+
type: z7.enum(BIDDING_STRATEGY_TYPES),
|
|
4061
3894
|
targetCpaMicros: microsSchema.optional(),
|
|
4062
|
-
targetRoas:
|
|
3895
|
+
targetRoas: z7.number().positive().optional(),
|
|
4063
3896
|
cpcBidCeilingMicros: microsSchema.optional(),
|
|
4064
|
-
enhancedCpcEnabled:
|
|
3897
|
+
enhancedCpcEnabled: z7.boolean().optional()
|
|
4065
3898
|
}).superRefine((p, ctx) => {
|
|
4066
3899
|
if (p.type === "TARGET_CPA" && p.targetCpaMicros === void 0) {
|
|
4067
3900
|
ctx.addIssue({ code: "custom", path: ["targetCpaMicros"], message: "TARGET_CPA needs targetCpaMicros" });
|
|
@@ -4070,17 +3903,17 @@ var biddingConfigSchema = z8.object({
|
|
|
4070
3903
|
ctx.addIssue({ code: "custom", path: ["targetRoas"], message: "TARGET_ROAS needs targetRoas" });
|
|
4071
3904
|
}
|
|
4072
3905
|
});
|
|
4073
|
-
var networkSettingsSchema =
|
|
4074
|
-
targetGoogleSearch:
|
|
4075
|
-
targetSearchNetwork:
|
|
4076
|
-
targetContentNetwork:
|
|
4077
|
-
targetPartnerSearchNetwork:
|
|
3906
|
+
var networkSettingsSchema = z7.object({
|
|
3907
|
+
targetGoogleSearch: z7.boolean().optional(),
|
|
3908
|
+
targetSearchNetwork: z7.boolean().optional(),
|
|
3909
|
+
targetContentNetwork: z7.boolean().optional(),
|
|
3910
|
+
targetPartnerSearchNetwork: z7.boolean().optional()
|
|
4078
3911
|
});
|
|
4079
|
-
var dateSchema =
|
|
4080
|
-
var campaignCreateSchema2 =
|
|
4081
|
-
name:
|
|
4082
|
-
channelType:
|
|
4083
|
-
channelSubType:
|
|
3912
|
+
var dateSchema = z7.string().regex(/^\d{4}-\d{2}-\d{2}$/, "expected a YYYY-MM-DD date");
|
|
3913
|
+
var campaignCreateSchema2 = z7.object({
|
|
3914
|
+
name: z7.string().min(1).max(GOOGLE_ADS_LIMITS.campaign.nameMax),
|
|
3915
|
+
channelType: z7.enum(ADVERTISING_CHANNEL_TYPES),
|
|
3916
|
+
channelSubType: z7.enum(ADVERTISING_CHANNEL_SUB_TYPES).optional(),
|
|
4084
3917
|
budget: refSchema,
|
|
4085
3918
|
/** Inline standard bidding, or a portfolio strategy ref via biddingStrategy. */
|
|
4086
3919
|
bidding: biddingConfigSchema.optional(),
|
|
@@ -4089,7 +3922,7 @@ var campaignCreateSchema2 = z8.object({
|
|
|
4089
3922
|
startDate: dateSchema.optional(),
|
|
4090
3923
|
endDate: dateSchema.optional(),
|
|
4091
3924
|
/** Advisory Google Ads UI objective — drives warnings, not sent to the API. */
|
|
4092
|
-
objective:
|
|
3925
|
+
objective: z7.enum(CAMPAIGN_OBJECTIVES).optional(),
|
|
4093
3926
|
status: stageableStatusSchema2.default("PAUSED")
|
|
4094
3927
|
}).superRefine((p, ctx) => {
|
|
4095
3928
|
if (!p.bidding && !p.biddingStrategy) {
|
|
@@ -4113,129 +3946,129 @@ var campaignCreateSchema2 = z8.object({
|
|
|
4113
3946
|
ctx.addIssue({ code: "custom", path: ["endDate"], message: "endDate must be after startDate" });
|
|
4114
3947
|
}
|
|
4115
3948
|
});
|
|
4116
|
-
var campaignUpdateSchema2 =
|
|
4117
|
-
name:
|
|
3949
|
+
var campaignUpdateSchema2 = z7.object({
|
|
3950
|
+
name: z7.string().min(1).max(GOOGLE_ADS_LIMITS.campaign.nameMax).optional(),
|
|
4118
3951
|
budget: refSchema.optional(),
|
|
4119
3952
|
bidding: biddingConfigSchema.optional(),
|
|
4120
3953
|
networkSettings: networkSettingsSchema.optional(),
|
|
4121
3954
|
startDate: dateSchema.optional(),
|
|
4122
3955
|
endDate: dateSchema.optional(),
|
|
4123
|
-
status:
|
|
3956
|
+
status: z7.enum(["ENABLED", "PAUSED", "REMOVED"]).optional()
|
|
4124
3957
|
}).refine((p) => Object.values(p).some((v) => v !== void 0), "update needs at least one field");
|
|
4125
|
-
var adGroupCreateSchema =
|
|
4126
|
-
name:
|
|
3958
|
+
var adGroupCreateSchema = z7.object({
|
|
3959
|
+
name: z7.string().min(1).max(GOOGLE_ADS_LIMITS.adGroup.nameMax),
|
|
4127
3960
|
campaign: refSchema,
|
|
4128
|
-
type:
|
|
3961
|
+
type: z7.enum(AD_GROUP_TYPES).default("SEARCH_STANDARD"),
|
|
4129
3962
|
cpcBidMicros: microsSchema.optional(),
|
|
4130
3963
|
status: stageableStatusSchema2.default("PAUSED")
|
|
4131
3964
|
});
|
|
4132
|
-
var adGroupUpdateSchema =
|
|
4133
|
-
name:
|
|
3965
|
+
var adGroupUpdateSchema = z7.object({
|
|
3966
|
+
name: z7.string().min(1).max(GOOGLE_ADS_LIMITS.adGroup.nameMax).optional(),
|
|
4134
3967
|
cpcBidMicros: microsSchema.optional(),
|
|
4135
|
-
status:
|
|
3968
|
+
status: z7.enum(["ENABLED", "PAUSED", "REMOVED"]).optional()
|
|
4136
3969
|
}).refine((p) => Object.values(p).some((v) => v !== void 0), "update needs at least one field");
|
|
4137
|
-
var keywordAddSchema =
|
|
3970
|
+
var keywordAddSchema = z7.object({
|
|
4138
3971
|
adGroup: refSchema,
|
|
4139
3972
|
text: keywordTextSchema,
|
|
4140
3973
|
matchType: matchTypeSchema,
|
|
4141
3974
|
cpcBidMicros: microsSchema.optional(),
|
|
4142
|
-
finalUrls:
|
|
3975
|
+
finalUrls: z7.array(httpsUrlSchema2).optional(),
|
|
4143
3976
|
status: stageableStatusSchema2.default("ENABLED")
|
|
4144
3977
|
});
|
|
4145
|
-
var keywordUpdateSchema =
|
|
3978
|
+
var keywordUpdateSchema = z7.object({
|
|
4146
3979
|
cpcBidMicros: microsSchema.optional(),
|
|
4147
|
-
finalUrls:
|
|
4148
|
-
status:
|
|
3980
|
+
finalUrls: z7.array(httpsUrlSchema2).optional(),
|
|
3981
|
+
status: z7.enum(["ENABLED", "PAUSED", "REMOVED"]).optional()
|
|
4149
3982
|
}).refine((p) => Object.values(p).some((v) => v !== void 0), "update needs at least one field");
|
|
4150
|
-
var negativeKeywordAddSchema =
|
|
4151
|
-
level:
|
|
3983
|
+
var negativeKeywordAddSchema = z7.object({
|
|
3984
|
+
level: z7.enum(["adGroup", "campaign"]),
|
|
4152
3985
|
parent: refSchema,
|
|
4153
3986
|
text: keywordTextSchema,
|
|
4154
3987
|
matchType: matchTypeSchema
|
|
4155
3988
|
});
|
|
4156
|
-
var sharedSetCreateSchema =
|
|
4157
|
-
name:
|
|
4158
|
-
type:
|
|
3989
|
+
var sharedSetCreateSchema = z7.object({
|
|
3990
|
+
name: z7.string().min(1).max(GOOGLE_ADS_LIMITS.sharedSet.nameMax),
|
|
3991
|
+
type: z7.enum(SHARED_SET_TYPES).default("NEGATIVE_KEYWORDS")
|
|
4159
3992
|
});
|
|
4160
|
-
var sharedSetMemberAddSchema =
|
|
3993
|
+
var sharedSetMemberAddSchema = z7.object({
|
|
4161
3994
|
sharedSet: refSchema,
|
|
4162
3995
|
text: keywordTextSchema,
|
|
4163
3996
|
matchType: matchTypeSchema
|
|
4164
3997
|
});
|
|
4165
|
-
var campaignSharedSetAttachSchema =
|
|
3998
|
+
var campaignSharedSetAttachSchema = z7.object({
|
|
4166
3999
|
campaign: refSchema,
|
|
4167
4000
|
sharedSet: refSchema
|
|
4168
4001
|
});
|
|
4169
|
-
var adTextAssetSchema =
|
|
4170
|
-
text:
|
|
4171
|
-
pinnedField:
|
|
4002
|
+
var adTextAssetSchema = z7.object({
|
|
4003
|
+
text: z7.string().min(1),
|
|
4004
|
+
pinnedField: z7.enum(PINNED_FIELDS).optional()
|
|
4172
4005
|
});
|
|
4173
|
-
var responsiveSearchAdSchema =
|
|
4174
|
-
format:
|
|
4175
|
-
headlines:
|
|
4006
|
+
var responsiveSearchAdSchema = z7.object({
|
|
4007
|
+
format: z7.literal("responsiveSearch"),
|
|
4008
|
+
headlines: z7.array(
|
|
4176
4009
|
adTextAssetSchema.refine(
|
|
4177
4010
|
(a) => a.text.length <= GOOGLE_ADS_LIMITS.responsiveSearchAd.headlineTextMax,
|
|
4178
4011
|
"headline exceeds 30 chars"
|
|
4179
4012
|
)
|
|
4180
4013
|
).min(GOOGLE_ADS_LIMITS.responsiveSearchAd.headlinesMin).max(GOOGLE_ADS_LIMITS.responsiveSearchAd.headlinesMax),
|
|
4181
|
-
descriptions:
|
|
4014
|
+
descriptions: z7.array(
|
|
4182
4015
|
adTextAssetSchema.refine(
|
|
4183
4016
|
(a) => a.text.length <= GOOGLE_ADS_LIMITS.responsiveSearchAd.descriptionTextMax,
|
|
4184
4017
|
"description exceeds 90 chars"
|
|
4185
4018
|
)
|
|
4186
4019
|
).min(GOOGLE_ADS_LIMITS.responsiveSearchAd.descriptionsMin).max(GOOGLE_ADS_LIMITS.responsiveSearchAd.descriptionsMax),
|
|
4187
|
-
path1:
|
|
4188
|
-
path2:
|
|
4189
|
-
finalUrls:
|
|
4190
|
-
});
|
|
4191
|
-
var responsiveDisplayAdSchema =
|
|
4192
|
-
format:
|
|
4193
|
-
headlines:
|
|
4194
|
-
longHeadline:
|
|
4195
|
-
descriptions:
|
|
4196
|
-
businessName:
|
|
4020
|
+
path1: z7.string().max(GOOGLE_ADS_LIMITS.responsiveSearchAd.pathMax).optional(),
|
|
4021
|
+
path2: z7.string().max(GOOGLE_ADS_LIMITS.responsiveSearchAd.pathMax).optional(),
|
|
4022
|
+
finalUrls: z7.array(httpsUrlSchema2).min(1)
|
|
4023
|
+
});
|
|
4024
|
+
var responsiveDisplayAdSchema = z7.object({
|
|
4025
|
+
format: z7.literal("responsiveDisplay"),
|
|
4026
|
+
headlines: z7.array(z7.object({ text: z7.string().min(1).max(GOOGLE_ADS_LIMITS.responsiveDisplayAd.headlineTextMax) })).min(1).max(5),
|
|
4027
|
+
longHeadline: z7.object({ text: z7.string().min(1).max(GOOGLE_ADS_LIMITS.responsiveDisplayAd.longHeadlineTextMax) }),
|
|
4028
|
+
descriptions: z7.array(z7.object({ text: z7.string().min(1).max(GOOGLE_ADS_LIMITS.responsiveDisplayAd.descriptionTextMax) })).min(1).max(5),
|
|
4029
|
+
businessName: z7.string().min(1).max(GOOGLE_ADS_LIMITS.responsiveDisplayAd.businessNameMax),
|
|
4197
4030
|
// A Responsive Display Ad's images are fields on the ad's own content (never campaign-level
|
|
4198
4031
|
// asset links). Google requires ≥1 landscape marketing image (1.91:1) AND ≥1 square marketing
|
|
4199
4032
|
// image (1:1) to serve; the logo images are optional.
|
|
4200
|
-
marketingImageAssets:
|
|
4201
|
-
squareMarketingImageAssets:
|
|
4202
|
-
logoImageAssets:
|
|
4203
|
-
finalUrls:
|
|
4204
|
-
});
|
|
4205
|
-
var callAdSchema =
|
|
4206
|
-
format:
|
|
4207
|
-
countryCode:
|
|
4208
|
-
phoneNumber:
|
|
4209
|
-
headline1:
|
|
4210
|
-
headline2:
|
|
4211
|
-
description1:
|
|
4212
|
-
description2:
|
|
4213
|
-
businessName:
|
|
4214
|
-
finalUrls:
|
|
4215
|
-
});
|
|
4216
|
-
var appAdSchema =
|
|
4217
|
-
format:
|
|
4218
|
-
headlines:
|
|
4219
|
-
descriptions:
|
|
4220
|
-
});
|
|
4221
|
-
var videoAdSchema =
|
|
4222
|
-
format:
|
|
4033
|
+
marketingImageAssets: z7.array(refSchema).optional(),
|
|
4034
|
+
squareMarketingImageAssets: z7.array(refSchema).optional(),
|
|
4035
|
+
logoImageAssets: z7.array(refSchema).optional(),
|
|
4036
|
+
finalUrls: z7.array(httpsUrlSchema2).min(1)
|
|
4037
|
+
});
|
|
4038
|
+
var callAdSchema = z7.object({
|
|
4039
|
+
format: z7.literal("call"),
|
|
4040
|
+
countryCode: z7.string().length(2),
|
|
4041
|
+
phoneNumber: z7.string().min(3),
|
|
4042
|
+
headline1: z7.string().min(1).max(30),
|
|
4043
|
+
headline2: z7.string().min(1).max(30),
|
|
4044
|
+
description1: z7.string().min(1).max(90),
|
|
4045
|
+
description2: z7.string().min(1).max(90),
|
|
4046
|
+
businessName: z7.string().min(1).max(25),
|
|
4047
|
+
finalUrls: z7.array(httpsUrlSchema2).min(1)
|
|
4048
|
+
});
|
|
4049
|
+
var appAdSchema = z7.object({
|
|
4050
|
+
format: z7.literal("app"),
|
|
4051
|
+
headlines: z7.array(z7.object({ text: z7.string().min(1).max(30) })).min(1),
|
|
4052
|
+
descriptions: z7.array(z7.object({ text: z7.string().min(1).max(90) })).min(1)
|
|
4053
|
+
});
|
|
4054
|
+
var videoAdSchema = z7.object({
|
|
4055
|
+
format: z7.literal("video"),
|
|
4223
4056
|
// A raw YouTube id is not a publishable Google Ads reference — the video must be staged as
|
|
4224
4057
|
// its own `google.asset.create` (type: youtubeVideo) first, then referenced here by asset ref.
|
|
4225
|
-
videoAssets:
|
|
4226
|
-
finalUrls:
|
|
4227
|
-
});
|
|
4228
|
-
var demandGenAdSchema =
|
|
4229
|
-
format:
|
|
4230
|
-
headlines:
|
|
4231
|
-
descriptions:
|
|
4232
|
-
businessName:
|
|
4233
|
-
finalUrls:
|
|
4234
|
-
imageAssets:
|
|
4235
|
-
squareImageAssets:
|
|
4236
|
-
logoImageAssets:
|
|
4237
|
-
});
|
|
4238
|
-
var adContentSchema =
|
|
4058
|
+
videoAssets: z7.array(refSchema).min(1),
|
|
4059
|
+
finalUrls: z7.array(httpsUrlSchema2).min(1)
|
|
4060
|
+
});
|
|
4061
|
+
var demandGenAdSchema = z7.object({
|
|
4062
|
+
format: z7.literal("demandGen"),
|
|
4063
|
+
headlines: z7.array(z7.object({ text: z7.string().min(1).max(40) })).min(1).max(5),
|
|
4064
|
+
descriptions: z7.array(z7.object({ text: z7.string().min(1).max(90) })).min(1).max(5),
|
|
4065
|
+
businessName: z7.string().min(1).max(25),
|
|
4066
|
+
finalUrls: z7.array(httpsUrlSchema2).min(1),
|
|
4067
|
+
imageAssets: z7.array(refSchema).optional(),
|
|
4068
|
+
squareImageAssets: z7.array(refSchema).optional(),
|
|
4069
|
+
logoImageAssets: z7.array(refSchema).optional()
|
|
4070
|
+
});
|
|
4071
|
+
var adContentSchema = z7.discriminatedUnion("format", [
|
|
4239
4072
|
responsiveSearchAdSchema,
|
|
4240
4073
|
responsiveDisplayAdSchema,
|
|
4241
4074
|
callAdSchema,
|
|
@@ -4243,45 +4076,45 @@ var adContentSchema = z8.discriminatedUnion("format", [
|
|
|
4243
4076
|
videoAdSchema,
|
|
4244
4077
|
demandGenAdSchema
|
|
4245
4078
|
]);
|
|
4246
|
-
var adCreateSchema =
|
|
4079
|
+
var adCreateSchema = z7.object({
|
|
4247
4080
|
adGroup: refSchema,
|
|
4248
4081
|
status: stageableStatusSchema2.default("PAUSED"),
|
|
4249
4082
|
content: adContentSchema
|
|
4250
4083
|
});
|
|
4251
|
-
var adUpdateSchema =
|
|
4252
|
-
status:
|
|
4084
|
+
var adUpdateSchema = z7.object({
|
|
4085
|
+
status: z7.enum(["ENABLED", "PAUSED", "REMOVED"]).optional(),
|
|
4253
4086
|
/** Whole-content replacement for RSA-like formats; re-validated against adContentSchema. */
|
|
4254
|
-
content:
|
|
4087
|
+
content: z7.record(z7.string(), z7.unknown()).optional()
|
|
4255
4088
|
}).refine((p) => Object.values(p).some((v) => v !== void 0), "update needs at least one field");
|
|
4256
|
-
var textAssetSchema =
|
|
4257
|
-
var imageAssetSchema =
|
|
4258
|
-
type:
|
|
4259
|
-
imageId:
|
|
4260
|
-
name:
|
|
4261
|
-
});
|
|
4262
|
-
var youtubeVideoAssetSchema =
|
|
4263
|
-
type:
|
|
4264
|
-
youtubeVideoId:
|
|
4265
|
-
name:
|
|
4266
|
-
});
|
|
4267
|
-
var sitelinkAssetSchema =
|
|
4268
|
-
type:
|
|
4269
|
-
linkText:
|
|
4270
|
-
description1:
|
|
4271
|
-
description2:
|
|
4272
|
-
finalUrls:
|
|
4273
|
-
});
|
|
4274
|
-
var calloutAssetSchema =
|
|
4275
|
-
type:
|
|
4276
|
-
calloutText:
|
|
4277
|
-
});
|
|
4278
|
-
var structuredSnippetAssetSchema =
|
|
4279
|
-
type:
|
|
4280
|
-
header:
|
|
4281
|
-
values:
|
|
4282
|
-
});
|
|
4283
|
-
var callToActionAssetSchema =
|
|
4284
|
-
var assetCreateSchema =
|
|
4089
|
+
var textAssetSchema = z7.object({ type: z7.literal("text"), text: z7.string().min(1) });
|
|
4090
|
+
var imageAssetSchema = z7.object({
|
|
4091
|
+
type: z7.literal("image"),
|
|
4092
|
+
imageId: z7.string().min(1),
|
|
4093
|
+
name: z7.string().optional()
|
|
4094
|
+
});
|
|
4095
|
+
var youtubeVideoAssetSchema = z7.object({
|
|
4096
|
+
type: z7.literal("youtubeVideo"),
|
|
4097
|
+
youtubeVideoId: z7.string().min(1),
|
|
4098
|
+
name: z7.string().optional()
|
|
4099
|
+
});
|
|
4100
|
+
var sitelinkAssetSchema = z7.object({
|
|
4101
|
+
type: z7.literal("sitelink"),
|
|
4102
|
+
linkText: z7.string().min(1).max(GOOGLE_ADS_LIMITS.asset.sitelinkLinkTextMax),
|
|
4103
|
+
description1: z7.string().max(GOOGLE_ADS_LIMITS.asset.sitelinkDescriptionMax).optional(),
|
|
4104
|
+
description2: z7.string().max(GOOGLE_ADS_LIMITS.asset.sitelinkDescriptionMax).optional(),
|
|
4105
|
+
finalUrls: z7.array(httpsUrlSchema2).min(1)
|
|
4106
|
+
});
|
|
4107
|
+
var calloutAssetSchema = z7.object({
|
|
4108
|
+
type: z7.literal("callout"),
|
|
4109
|
+
calloutText: z7.string().min(1).max(GOOGLE_ADS_LIMITS.asset.calloutTextMax)
|
|
4110
|
+
});
|
|
4111
|
+
var structuredSnippetAssetSchema = z7.object({
|
|
4112
|
+
type: z7.literal("structuredSnippet"),
|
|
4113
|
+
header: z7.string().min(1).max(GOOGLE_ADS_LIMITS.asset.structuredSnippetHeaderMax),
|
|
4114
|
+
values: z7.array(z7.string().min(1)).min(GOOGLE_ADS_LIMITS.asset.structuredSnippetValuesMin).max(GOOGLE_ADS_LIMITS.asset.structuredSnippetValuesMax)
|
|
4115
|
+
});
|
|
4116
|
+
var callToActionAssetSchema = z7.object({ type: z7.literal("callToAction"), callToAction: z7.string().min(1) });
|
|
4117
|
+
var assetCreateSchema = z7.discriminatedUnion("type", [
|
|
4285
4118
|
textAssetSchema,
|
|
4286
4119
|
imageAssetSchema,
|
|
4287
4120
|
youtubeVideoAssetSchema,
|
|
@@ -4290,136 +4123,136 @@ var assetCreateSchema = z8.discriminatedUnion("type", [
|
|
|
4290
4123
|
structuredSnippetAssetSchema,
|
|
4291
4124
|
callToActionAssetSchema
|
|
4292
4125
|
]);
|
|
4293
|
-
var assetUpdateSchema =
|
|
4294
|
-
name:
|
|
4295
|
-
linkText:
|
|
4296
|
-
description1:
|
|
4297
|
-
description2:
|
|
4298
|
-
finalUrls:
|
|
4299
|
-
calloutText:
|
|
4300
|
-
header:
|
|
4301
|
-
values:
|
|
4302
|
-
callToAction:
|
|
4303
|
-
text:
|
|
4126
|
+
var assetUpdateSchema = z7.object({
|
|
4127
|
+
name: z7.string().min(1).optional(),
|
|
4128
|
+
linkText: z7.string().min(1).max(GOOGLE_ADS_LIMITS.asset.sitelinkLinkTextMax).optional(),
|
|
4129
|
+
description1: z7.string().max(GOOGLE_ADS_LIMITS.asset.sitelinkDescriptionMax).optional(),
|
|
4130
|
+
description2: z7.string().max(GOOGLE_ADS_LIMITS.asset.sitelinkDescriptionMax).optional(),
|
|
4131
|
+
finalUrls: z7.array(httpsUrlSchema2).min(1).optional(),
|
|
4132
|
+
calloutText: z7.string().min(1).max(GOOGLE_ADS_LIMITS.asset.calloutTextMax).optional(),
|
|
4133
|
+
header: z7.string().min(1).max(GOOGLE_ADS_LIMITS.asset.structuredSnippetHeaderMax).optional(),
|
|
4134
|
+
values: z7.array(z7.string().min(1)).min(GOOGLE_ADS_LIMITS.asset.structuredSnippetValuesMin).max(GOOGLE_ADS_LIMITS.asset.structuredSnippetValuesMax).optional(),
|
|
4135
|
+
callToAction: z7.string().min(1).optional(),
|
|
4136
|
+
text: z7.string().min(1).optional()
|
|
4304
4137
|
}).refine((p) => Object.values(p).some((v) => v !== void 0), "update needs at least one field");
|
|
4305
|
-
var assetLinkAttachSchema =
|
|
4306
|
-
level:
|
|
4138
|
+
var assetLinkAttachSchema = z7.object({
|
|
4139
|
+
level: z7.enum(["campaign", "adGroup", "customer"]),
|
|
4307
4140
|
parent: refSchema.optional(),
|
|
4308
4141
|
asset: refSchema,
|
|
4309
|
-
fieldType:
|
|
4142
|
+
fieldType: z7.enum(ASSET_FIELD_TYPES)
|
|
4310
4143
|
}).superRefine((value, ctx) => {
|
|
4311
4144
|
if (value.level !== "customer" && !value.parent) {
|
|
4312
4145
|
ctx.addIssue({
|
|
4313
|
-
code:
|
|
4146
|
+
code: z7.ZodIssueCode.custom,
|
|
4314
4147
|
path: ["parent"],
|
|
4315
4148
|
message: `parent is required for a ${value.level}-level asset link (--parent-ref)`
|
|
4316
4149
|
});
|
|
4317
4150
|
}
|
|
4318
4151
|
});
|
|
4319
|
-
var assetGroupCreateSchema =
|
|
4152
|
+
var assetGroupCreateSchema = z7.object({
|
|
4320
4153
|
campaign: refSchema,
|
|
4321
|
-
name:
|
|
4322
|
-
finalUrls:
|
|
4323
|
-
headlines:
|
|
4324
|
-
longHeadlines:
|
|
4325
|
-
descriptions:
|
|
4326
|
-
businessName:
|
|
4327
|
-
imageAssets:
|
|
4328
|
-
squareImageAssets:
|
|
4329
|
-
logoAssets:
|
|
4330
|
-
status:
|
|
4331
|
-
});
|
|
4332
|
-
var assetGroupUpdateSchema =
|
|
4333
|
-
name:
|
|
4334
|
-
finalUrls:
|
|
4335
|
-
status:
|
|
4154
|
+
name: z7.string().min(1).max(GOOGLE_ADS_LIMITS.assetGroup.nameMax),
|
|
4155
|
+
finalUrls: z7.array(httpsUrlSchema2).min(1),
|
|
4156
|
+
headlines: z7.array(z7.object({ text: z7.string().min(1).max(GOOGLE_ADS_LIMITS.assetGroup.headlineTextMax) })).min(GOOGLE_ADS_LIMITS.assetGroup.headlinesMin).max(GOOGLE_ADS_LIMITS.assetGroup.headlinesMax),
|
|
4157
|
+
longHeadlines: z7.array(z7.object({ text: z7.string().min(1).max(GOOGLE_ADS_LIMITS.assetGroup.longHeadlineTextMax) })).min(GOOGLE_ADS_LIMITS.assetGroup.longHeadlinesMin).max(GOOGLE_ADS_LIMITS.assetGroup.longHeadlinesMax),
|
|
4158
|
+
descriptions: z7.array(z7.object({ text: z7.string().min(1).max(GOOGLE_ADS_LIMITS.assetGroup.descriptionTextMax) })).min(GOOGLE_ADS_LIMITS.assetGroup.descriptionsMin).max(GOOGLE_ADS_LIMITS.assetGroup.descriptionsMax),
|
|
4159
|
+
businessName: z7.string().min(1).max(GOOGLE_ADS_LIMITS.assetGroup.businessNameMax),
|
|
4160
|
+
imageAssets: z7.array(refSchema).optional(),
|
|
4161
|
+
squareImageAssets: z7.array(refSchema).optional(),
|
|
4162
|
+
logoAssets: z7.array(refSchema).optional(),
|
|
4163
|
+
status: z7.enum(["ENABLED", "PAUSED"]).default("PAUSED")
|
|
4164
|
+
});
|
|
4165
|
+
var assetGroupUpdateSchema = z7.object({
|
|
4166
|
+
name: z7.string().min(1).max(GOOGLE_ADS_LIMITS.assetGroup.nameMax).optional(),
|
|
4167
|
+
finalUrls: z7.array(httpsUrlSchema2).min(1).optional(),
|
|
4168
|
+
status: z7.enum(["ENABLED", "PAUSED", "REMOVED"]).optional()
|
|
4336
4169
|
}).refine((p) => Object.values(p).some((v) => v !== void 0), "update needs at least one field");
|
|
4337
|
-
var audienceCreateSchema2 =
|
|
4338
|
-
name:
|
|
4339
|
-
type:
|
|
4340
|
-
description:
|
|
4170
|
+
var audienceCreateSchema2 = z7.object({
|
|
4171
|
+
name: z7.string().min(1).max(GOOGLE_ADS_LIMITS.audience.nameMax),
|
|
4172
|
+
type: z7.enum(USER_LIST_TYPES).default("BASIC"),
|
|
4173
|
+
description: z7.string().optional(),
|
|
4341
4174
|
/** Customer-match members (crm-based) — file-first for large lists. */
|
|
4342
|
-
members:
|
|
4343
|
-
sourceFileRef:
|
|
4175
|
+
members: z7.array(z7.record(z7.string(), z7.string())).optional(),
|
|
4176
|
+
sourceFileRef: z7.string().optional()
|
|
4344
4177
|
});
|
|
4345
|
-
var audienceCriterionAttachSchema =
|
|
4346
|
-
level:
|
|
4178
|
+
var audienceCriterionAttachSchema = z7.object({
|
|
4179
|
+
level: z7.enum(["campaign", "adGroup"]),
|
|
4347
4180
|
parent: refSchema,
|
|
4348
4181
|
userList: refSchema,
|
|
4349
|
-
negative:
|
|
4182
|
+
negative: z7.boolean().default(false)
|
|
4350
4183
|
});
|
|
4351
|
-
var conversionActionCreateSchema =
|
|
4352
|
-
name:
|
|
4353
|
-
type:
|
|
4354
|
-
category:
|
|
4355
|
-
countingType:
|
|
4184
|
+
var conversionActionCreateSchema = z7.object({
|
|
4185
|
+
name: z7.string().min(1).max(GOOGLE_ADS_LIMITS.conversionAction.nameMax),
|
|
4186
|
+
type: z7.enum(CONVERSION_ACTION_TYPES).default("WEBPAGE"),
|
|
4187
|
+
category: z7.enum(CONVERSION_ACTION_CATEGORIES).default("DEFAULT"),
|
|
4188
|
+
countingType: z7.enum(CONVERSION_COUNTING_TYPES).default("ONE_PER_CLICK"),
|
|
4356
4189
|
defaultValueMicros: microsSchema.optional(),
|
|
4357
|
-
defaultCurrencyCode:
|
|
4358
|
-
clickThroughLookbackWindowDays:
|
|
4359
|
-
viewThroughLookbackWindowDays:
|
|
4360
|
-
status:
|
|
4361
|
-
});
|
|
4362
|
-
var conversionActionUpdateSchema =
|
|
4363
|
-
name:
|
|
4364
|
-
category:
|
|
4365
|
-
countingType:
|
|
4190
|
+
defaultCurrencyCode: z7.string().length(3).optional(),
|
|
4191
|
+
clickThroughLookbackWindowDays: z7.number().int().positive().optional(),
|
|
4192
|
+
viewThroughLookbackWindowDays: z7.number().int().positive().optional(),
|
|
4193
|
+
status: z7.enum(["ENABLED", "PAUSED"]).default("ENABLED")
|
|
4194
|
+
});
|
|
4195
|
+
var conversionActionUpdateSchema = z7.object({
|
|
4196
|
+
name: z7.string().min(1).max(GOOGLE_ADS_LIMITS.conversionAction.nameMax).optional(),
|
|
4197
|
+
category: z7.enum(CONVERSION_ACTION_CATEGORIES).optional(),
|
|
4198
|
+
countingType: z7.enum(CONVERSION_COUNTING_TYPES).optional(),
|
|
4366
4199
|
defaultValueMicros: microsSchema.optional(),
|
|
4367
|
-
defaultCurrencyCode:
|
|
4368
|
-
clickThroughLookbackWindowDays:
|
|
4369
|
-
viewThroughLookbackWindowDays:
|
|
4370
|
-
status:
|
|
4200
|
+
defaultCurrencyCode: z7.string().length(3).optional(),
|
|
4201
|
+
clickThroughLookbackWindowDays: z7.number().int().positive().optional(),
|
|
4202
|
+
viewThroughLookbackWindowDays: z7.number().int().positive().optional(),
|
|
4203
|
+
status: z7.enum(["ENABLED", "REMOVED", "HIDDEN"]).optional()
|
|
4371
4204
|
}).refine((p) => Object.values(p).some((v) => v !== void 0), "update needs at least one field");
|
|
4372
|
-
var biddingStrategyCreateSchema =
|
|
4373
|
-
name:
|
|
4205
|
+
var biddingStrategyCreateSchema = z7.object({
|
|
4206
|
+
name: z7.string().min(1).max(GOOGLE_ADS_LIMITS.biddingStrategy.nameMax),
|
|
4374
4207
|
config: biddingConfigSchema
|
|
4375
4208
|
}).superRefine((p, ctx) => {
|
|
4376
4209
|
if (p.config.type === "MANUAL_CPC") {
|
|
4377
4210
|
ctx.addIssue({ code: "custom", path: ["config", "type"], message: "portfolio strategies cannot be Manual CPC" });
|
|
4378
4211
|
}
|
|
4379
4212
|
});
|
|
4380
|
-
var biddingStrategyUpdateSchema =
|
|
4381
|
-
name:
|
|
4213
|
+
var biddingStrategyUpdateSchema = z7.object({
|
|
4214
|
+
name: z7.string().min(1).max(GOOGLE_ADS_LIMITS.biddingStrategy.nameMax).optional(),
|
|
4382
4215
|
config: biddingConfigSchema.optional()
|
|
4383
4216
|
}).refine((p) => Object.values(p).some((v) => v !== void 0), "update needs at least one field");
|
|
4384
|
-
var labelCreateSchema =
|
|
4385
|
-
name:
|
|
4386
|
-
backgroundColor:
|
|
4387
|
-
description:
|
|
4217
|
+
var labelCreateSchema = z7.object({
|
|
4218
|
+
name: z7.string().min(1).max(GOOGLE_ADS_LIMITS.label.nameMax),
|
|
4219
|
+
backgroundColor: z7.string().regex(/^#[0-9A-Fa-f]{6}$/).optional(),
|
|
4220
|
+
description: z7.string().optional()
|
|
4388
4221
|
});
|
|
4389
|
-
var labelAttachSchema =
|
|
4390
|
-
level:
|
|
4222
|
+
var labelAttachSchema = z7.object({
|
|
4223
|
+
level: z7.enum(["campaign", "adGroup", "ad"]),
|
|
4391
4224
|
parent: refSchema,
|
|
4392
4225
|
label: refSchema
|
|
4393
4226
|
});
|
|
4394
|
-
var locationCriterionSchema =
|
|
4395
|
-
criterionType:
|
|
4396
|
-
geoTargetConstant:
|
|
4397
|
-
});
|
|
4398
|
-
var languageCriterionSchema =
|
|
4399
|
-
criterionType:
|
|
4400
|
-
languageConstant:
|
|
4401
|
-
});
|
|
4402
|
-
var adScheduleCriterionSchema =
|
|
4403
|
-
criterionType:
|
|
4404
|
-
dayOfWeek:
|
|
4405
|
-
startHour:
|
|
4406
|
-
startMinute:
|
|
4407
|
-
endHour:
|
|
4408
|
-
endMinute:
|
|
4409
|
-
});
|
|
4410
|
-
var deviceCriterionSchema =
|
|
4411
|
-
criterionType:
|
|
4412
|
-
device:
|
|
4227
|
+
var locationCriterionSchema = z7.object({
|
|
4228
|
+
criterionType: z7.literal("location"),
|
|
4229
|
+
geoTargetConstant: z7.union([z7.string().regex(GEO_TARGET_CONSTANT_REGEX), z7.string().regex(NUMERIC_ID_REGEX2)])
|
|
4230
|
+
});
|
|
4231
|
+
var languageCriterionSchema = z7.object({
|
|
4232
|
+
criterionType: z7.literal("language"),
|
|
4233
|
+
languageConstant: z7.union([z7.string().regex(LANGUAGE_CONSTANT_REGEX), z7.string().regex(NUMERIC_ID_REGEX2)])
|
|
4234
|
+
});
|
|
4235
|
+
var adScheduleCriterionSchema = z7.object({
|
|
4236
|
+
criterionType: z7.literal("adSchedule"),
|
|
4237
|
+
dayOfWeek: z7.enum(DAYS_OF_WEEK),
|
|
4238
|
+
startHour: z7.number().int().min(0).max(23),
|
|
4239
|
+
startMinute: z7.enum(["ZERO", "FIFTEEN", "THIRTY", "FORTY_FIVE"]).default("ZERO"),
|
|
4240
|
+
endHour: z7.number().int().min(0).max(24),
|
|
4241
|
+
endMinute: z7.enum(["ZERO", "FIFTEEN", "THIRTY", "FORTY_FIVE"]).default("ZERO")
|
|
4242
|
+
});
|
|
4243
|
+
var deviceCriterionSchema = z7.object({
|
|
4244
|
+
criterionType: z7.literal("device"),
|
|
4245
|
+
device: z7.enum(DEVICE_TYPES),
|
|
4413
4246
|
// Google's `CampaignCriterion.bid_modifier`: "The modifier must be in the range 0.1 - 10.0. Use 0
|
|
4414
4247
|
// 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.
|
|
4415
|
-
bidModifier:
|
|
4248
|
+
bidModifier: z7.number().min(0).max(10).optional().refine((v) => v === void 0 || v === 0 || v >= 0.1, {
|
|
4416
4249
|
message: "bid modifier must be 0 (exclude the device) or between 0.1 and 10.0"
|
|
4417
4250
|
})
|
|
4418
4251
|
});
|
|
4419
|
-
var campaignCriterionAddSchema =
|
|
4252
|
+
var campaignCriterionAddSchema = z7.object({
|
|
4420
4253
|
campaign: refSchema,
|
|
4421
|
-
negative:
|
|
4422
|
-
criterion:
|
|
4254
|
+
negative: z7.boolean().default(false),
|
|
4255
|
+
criterion: z7.discriminatedUnion("criterionType", [
|
|
4423
4256
|
locationCriterionSchema,
|
|
4424
4257
|
languageCriterionSchema,
|
|
4425
4258
|
adScheduleCriterionSchema,
|
|
@@ -4429,7 +4262,7 @@ var campaignCriterionAddSchema = z8.object({
|
|
|
4429
4262
|
const c = val.criterion;
|
|
4430
4263
|
if (c.criterionType === "adSchedule" && c.endHour === 24 && c.endMinute !== "ZERO") {
|
|
4431
4264
|
ctx.addIssue({
|
|
4432
|
-
code:
|
|
4265
|
+
code: z7.ZodIssueCode.custom,
|
|
4433
4266
|
message: "endHour 24 (midnight) cannot have a non-zero endMinute",
|
|
4434
4267
|
path: ["criterion", "endMinute"]
|
|
4435
4268
|
});
|
|
@@ -4481,17 +4314,17 @@ var GOOGLE_DRAFT_OP_KINDS = [
|
|
|
4481
4314
|
"google.campaignCriterion.add",
|
|
4482
4315
|
"google.campaignCriterion.remove"
|
|
4483
4316
|
];
|
|
4484
|
-
var googleDraftOpKindSchema =
|
|
4317
|
+
var googleDraftOpKindSchema = z7.enum(GOOGLE_DRAFT_OP_KINDS);
|
|
4485
4318
|
function createOp2(kind, payload) {
|
|
4486
|
-
return
|
|
4319
|
+
return z7.object({ kind: z7.literal(kind), customerId: customerIdSchema, payload });
|
|
4487
4320
|
}
|
|
4488
4321
|
function updateOp2(kind, payload) {
|
|
4489
|
-
return
|
|
4322
|
+
return z7.object({ kind: z7.literal(kind), customerId: customerIdSchema, target: targetRefSchema, payload });
|
|
4490
4323
|
}
|
|
4491
4324
|
function targetOp(kind) {
|
|
4492
|
-
return
|
|
4325
|
+
return z7.object({ kind: z7.literal(kind), customerId: customerIdSchema, target: targetRefSchema });
|
|
4493
4326
|
}
|
|
4494
|
-
var googleDraftOpInputSchema =
|
|
4327
|
+
var googleDraftOpInputSchema = z7.discriminatedUnion("kind", [
|
|
4495
4328
|
createOp2("google.budget.create", budgetCreateSchema),
|
|
4496
4329
|
updateOp2("google.budget.update", budgetUpdateSchema),
|
|
4497
4330
|
createOp2("google.campaign.create", campaignCreateSchema2),
|
|
@@ -4539,132 +4372,132 @@ var googleDraftOpInputSchema = z8.discriminatedUnion("kind", [
|
|
|
4539
4372
|
]);
|
|
4540
4373
|
|
|
4541
4374
|
// ../api/src/ads-google/wire.ts
|
|
4542
|
-
import { z as
|
|
4543
|
-
var googleWriteModeSchema =
|
|
4544
|
-
var googleDraftOpResultSchema =
|
|
4545
|
-
status:
|
|
4546
|
-
resourceName:
|
|
4547
|
-
error:
|
|
4548
|
-
skippedBecause:
|
|
4549
|
-
executedAt:
|
|
4550
|
-
});
|
|
4551
|
-
var googleDraftStageRequestSchema =
|
|
4552
|
-
chatId:
|
|
4375
|
+
import { z as z8 } from "zod";
|
|
4376
|
+
var googleWriteModeSchema = z8.enum(["live", "simulated"]);
|
|
4377
|
+
var googleDraftOpResultSchema = z8.object({
|
|
4378
|
+
status: z8.enum(["applied", "simulated", "failed", "skipped"]),
|
|
4379
|
+
resourceName: z8.string().optional(),
|
|
4380
|
+
error: z8.string().optional(),
|
|
4381
|
+
skippedBecause: z8.string().optional(),
|
|
4382
|
+
executedAt: z8.number().optional()
|
|
4383
|
+
});
|
|
4384
|
+
var googleDraftStageRequestSchema = z8.object({
|
|
4385
|
+
chatId: z8.string(),
|
|
4553
4386
|
op: googleDraftOpInputSchema
|
|
4554
4387
|
});
|
|
4555
|
-
var googleDraftStageResponseSchema =
|
|
4556
|
-
staged:
|
|
4557
|
-
ref:
|
|
4388
|
+
var googleDraftStageResponseSchema = z8.object({
|
|
4389
|
+
staged: z8.literal(true),
|
|
4390
|
+
ref: z8.string(),
|
|
4558
4391
|
kind: googleDraftOpKindSchema,
|
|
4559
4392
|
mode: googleWriteModeSchema,
|
|
4560
|
-
dependsOn:
|
|
4561
|
-
summary:
|
|
4562
|
-
warnings:
|
|
4393
|
+
dependsOn: z8.array(z8.string()),
|
|
4394
|
+
summary: z8.string(),
|
|
4395
|
+
warnings: z8.array(z8.string()),
|
|
4563
4396
|
/** True when the op amended an already-staged op in place instead of appending a new one. */
|
|
4564
|
-
amended:
|
|
4397
|
+
amended: z8.boolean().optional()
|
|
4565
4398
|
});
|
|
4566
|
-
var googleDraftAmendRequestSchema =
|
|
4567
|
-
chatId:
|
|
4568
|
-
ref:
|
|
4569
|
-
patch:
|
|
4399
|
+
var googleDraftAmendRequestSchema = z8.object({
|
|
4400
|
+
chatId: z8.string(),
|
|
4401
|
+
ref: z8.string(),
|
|
4402
|
+
patch: z8.record(z8.string(), z8.unknown())
|
|
4570
4403
|
});
|
|
4571
|
-
var googleDraftShowRequestSchema =
|
|
4572
|
-
chatId:
|
|
4573
|
-
ref:
|
|
4404
|
+
var googleDraftShowRequestSchema = z8.object({
|
|
4405
|
+
chatId: z8.string(),
|
|
4406
|
+
ref: z8.string()
|
|
4574
4407
|
});
|
|
4575
4408
|
var GOOGLE_DRAFT_BATCH_MAX = 500;
|
|
4576
|
-
var googleDraftStageBatchRequestSchema =
|
|
4577
|
-
chatId:
|
|
4578
|
-
ops:
|
|
4409
|
+
var googleDraftStageBatchRequestSchema = z8.object({
|
|
4410
|
+
chatId: z8.string(),
|
|
4411
|
+
ops: z8.array(googleDraftOpInputSchema).min(1).max(GOOGLE_DRAFT_BATCH_MAX)
|
|
4579
4412
|
});
|
|
4580
|
-
var googleDraftStageBatchResponseSchema =
|
|
4581
|
-
staged:
|
|
4413
|
+
var googleDraftStageBatchResponseSchema = z8.object({
|
|
4414
|
+
staged: z8.literal(true),
|
|
4582
4415
|
mode: googleWriteModeSchema,
|
|
4583
|
-
count:
|
|
4584
|
-
ops:
|
|
4585
|
-
|
|
4586
|
-
ref:
|
|
4416
|
+
count: z8.number(),
|
|
4417
|
+
ops: z8.array(
|
|
4418
|
+
z8.object({
|
|
4419
|
+
ref: z8.string(),
|
|
4587
4420
|
kind: googleDraftOpKindSchema,
|
|
4588
|
-
dependsOn:
|
|
4589
|
-
summary:
|
|
4590
|
-
warnings:
|
|
4421
|
+
dependsOn: z8.array(z8.string()),
|
|
4422
|
+
summary: z8.string(),
|
|
4423
|
+
warnings: z8.array(z8.string())
|
|
4591
4424
|
})
|
|
4592
4425
|
)
|
|
4593
4426
|
});
|
|
4594
|
-
var googleDraftOpViewSchema =
|
|
4595
|
-
ref:
|
|
4427
|
+
var googleDraftOpViewSchema = z8.object({
|
|
4428
|
+
ref: z8.string(),
|
|
4596
4429
|
kind: googleDraftOpKindSchema,
|
|
4597
|
-
customerId:
|
|
4598
|
-
target:
|
|
4599
|
-
dependsOn:
|
|
4600
|
-
summary:
|
|
4601
|
-
stagedAt:
|
|
4430
|
+
customerId: z8.string(),
|
|
4431
|
+
target: z8.string().optional(),
|
|
4432
|
+
dependsOn: z8.array(z8.string()),
|
|
4433
|
+
summary: z8.string(),
|
|
4434
|
+
stagedAt: z8.number(),
|
|
4602
4435
|
result: googleDraftOpResultSchema.optional()
|
|
4603
4436
|
});
|
|
4604
|
-
var googleDraftShowResponseSchema =
|
|
4437
|
+
var googleDraftShowResponseSchema = z8.object({
|
|
4605
4438
|
op: googleDraftOpViewSchema.extend({
|
|
4606
|
-
payload:
|
|
4607
|
-
warnings:
|
|
4608
|
-
annotations:
|
|
4439
|
+
payload: z8.unknown().optional(),
|
|
4440
|
+
warnings: z8.array(z8.string()).optional(),
|
|
4441
|
+
annotations: z8.unknown().optional()
|
|
4609
4442
|
})
|
|
4610
4443
|
});
|
|
4611
|
-
var googleDraftListRequestSchema =
|
|
4612
|
-
chatId:
|
|
4444
|
+
var googleDraftListRequestSchema = z8.object({
|
|
4445
|
+
chatId: z8.string()
|
|
4613
4446
|
});
|
|
4614
|
-
var googleDraftAdvisorySchema =
|
|
4615
|
-
scope:
|
|
4616
|
-
message:
|
|
4447
|
+
var googleDraftAdvisorySchema = z8.object({
|
|
4448
|
+
scope: z8.enum(["campaign", "adGroup"]),
|
|
4449
|
+
message: z8.string()
|
|
4617
4450
|
});
|
|
4618
|
-
var googleDraftStatusCollectionSchema =
|
|
4619
|
-
label:
|
|
4620
|
-
added:
|
|
4621
|
-
removed:
|
|
4622
|
-
existing:
|
|
4451
|
+
var googleDraftStatusCollectionSchema = z8.object({
|
|
4452
|
+
label: z8.string(),
|
|
4453
|
+
added: z8.number(),
|
|
4454
|
+
removed: z8.number(),
|
|
4455
|
+
existing: z8.number()
|
|
4623
4456
|
});
|
|
4624
|
-
var googleDraftChangeOperationSchema =
|
|
4625
|
-
var googleDraftStatusNodeSchema =
|
|
4626
|
-
() =>
|
|
4627
|
-
entity:
|
|
4628
|
-
name:
|
|
4457
|
+
var googleDraftChangeOperationSchema = z8.enum(["create", "update", "pause", "resume", "remove"]);
|
|
4458
|
+
var googleDraftStatusNodeSchema = z8.lazy(
|
|
4459
|
+
() => z8.object({
|
|
4460
|
+
entity: z8.string(),
|
|
4461
|
+
name: z8.string(),
|
|
4629
4462
|
operation: googleDraftChangeOperationSchema.optional(),
|
|
4630
|
-
existing:
|
|
4631
|
-
collections:
|
|
4632
|
-
children:
|
|
4633
|
-
warnings:
|
|
4463
|
+
existing: z8.boolean(),
|
|
4464
|
+
collections: z8.array(googleDraftStatusCollectionSchema),
|
|
4465
|
+
children: z8.array(googleDraftStatusNodeSchema),
|
|
4466
|
+
warnings: z8.array(z8.string()).optional()
|
|
4634
4467
|
})
|
|
4635
4468
|
);
|
|
4636
|
-
var googleDraftListResponseSchema =
|
|
4637
|
-
status:
|
|
4469
|
+
var googleDraftListResponseSchema = z8.object({
|
|
4470
|
+
status: z8.enum(["active", "publishing", "applied", "discarded", "none"]),
|
|
4638
4471
|
mode: googleWriteModeSchema,
|
|
4639
|
-
count:
|
|
4640
|
-
ops:
|
|
4472
|
+
count: z8.number(),
|
|
4473
|
+
ops: z8.array(googleDraftOpViewSchema),
|
|
4641
4474
|
/** Grouped campaign ▸ ad group ▸ ad tree for the readable CLI status view. */
|
|
4642
|
-
tree:
|
|
4475
|
+
tree: z8.array(googleDraftStatusNodeSchema).optional(),
|
|
4643
4476
|
/** Non-blocking completeness advisories for the whole draft. */
|
|
4644
|
-
advisories:
|
|
4477
|
+
advisories: z8.array(googleDraftAdvisorySchema).optional()
|
|
4645
4478
|
});
|
|
4646
|
-
var googleDraftRemoveRequestSchema =
|
|
4647
|
-
chatId:
|
|
4648
|
-
ref:
|
|
4479
|
+
var googleDraftRemoveRequestSchema = z8.object({
|
|
4480
|
+
chatId: z8.string(),
|
|
4481
|
+
ref: z8.string()
|
|
4649
4482
|
});
|
|
4650
|
-
var googleDraftRemoveResponseSchema =
|
|
4483
|
+
var googleDraftRemoveResponseSchema = z8.object({
|
|
4651
4484
|
/** The requested ref plus any dependents removed by cascade. */
|
|
4652
|
-
removed:
|
|
4485
|
+
removed: z8.array(z8.string())
|
|
4653
4486
|
});
|
|
4654
|
-
var googleDraftClearRequestSchema =
|
|
4655
|
-
chatId:
|
|
4487
|
+
var googleDraftClearRequestSchema = z8.object({
|
|
4488
|
+
chatId: z8.string()
|
|
4656
4489
|
});
|
|
4657
|
-
var googleDraftClearResponseSchema =
|
|
4658
|
-
cleared:
|
|
4490
|
+
var googleDraftClearResponseSchema = z8.object({
|
|
4491
|
+
cleared: z8.number()
|
|
4659
4492
|
});
|
|
4660
|
-
var googleFieldErrorSchema =
|
|
4661
|
-
path:
|
|
4662
|
-
message:
|
|
4493
|
+
var googleFieldErrorSchema = z8.object({
|
|
4494
|
+
path: z8.string(),
|
|
4495
|
+
message: z8.string()
|
|
4663
4496
|
});
|
|
4664
|
-
var googleDraftErrorResponseSchema =
|
|
4665
|
-
code:
|
|
4666
|
-
error:
|
|
4667
|
-
fields:
|
|
4497
|
+
var googleDraftErrorResponseSchema = z8.object({
|
|
4498
|
+
code: z8.string(),
|
|
4499
|
+
error: z8.string(),
|
|
4500
|
+
fields: z8.array(googleFieldErrorSchema).optional()
|
|
4668
4501
|
});
|
|
4669
4502
|
|
|
4670
4503
|
// src/commands/ads/google/draft-status.ts
|
|
@@ -9548,7 +9381,7 @@ var leadFormsCreateCommand = defineCommand38({
|
|
|
9548
9381
|
Required: name, headline (\u226460), privacyPolicyUrl, questions[] (\u226412; playbook: \u22644 for completion).
|
|
9549
9382
|
Each question is a predefined profile field ({ name, predefinedField: "EMAIL" }) or a custom question ({ name, questionType: "MULTIPLE_CHOICE", options: [...] }; \u22643 custom).
|
|
9550
9383
|
Best-practice fields the preview will nudge for if missing: 1-3 qualifying questions, consents[] (disclosure checkboxes), thankYou.message + thankYou.landingUrl|appointmentUrl.
|
|
9551
|
-
Also supported: locale, formImageId|formImageUrn,
|
|
9384
|
+
Also supported: locale, formImageId|formImageUrn, hiddenFields[], legalDisclaimer, thankYou.cta. Example: baker ads linkedin lead-forms create --file form.json`
|
|
9552
9385
|
},
|
|
9553
9386
|
args: {
|
|
9554
9387
|
...accountArgs,
|
|
@@ -10972,17 +10805,17 @@ var NUMERIC_ID_REGEX3 = /^\d+$/;
|
|
|
10972
10805
|
var IMAGE_HASH_REGEX = /^[A-Fa-f0-9]{16,}$/;
|
|
10973
10806
|
|
|
10974
10807
|
// ../api/src/ads-meta/ops.ts
|
|
10975
|
-
import { z as
|
|
10976
|
-
var tempRefSchema3 =
|
|
10977
|
-
var parentRefSchema2 =
|
|
10978
|
-
var moneySchema2 =
|
|
10979
|
-
amount:
|
|
10980
|
-
currencyCode:
|
|
10981
|
-
});
|
|
10982
|
-
var httpsUrlSchema3 =
|
|
10983
|
-
var bakerMediaIdSchema2 =
|
|
10984
|
-
var stageableStatusSchema3 =
|
|
10985
|
-
var updateStatusSchema =
|
|
10808
|
+
import { z as z9 } from "zod";
|
|
10809
|
+
var tempRefSchema3 = z9.string().regex(TEMP_REF_REGEX3, "expected a meta_temp_* reference");
|
|
10810
|
+
var parentRefSchema2 = z9.union([z9.string().regex(NUMERIC_ID_REGEX3, "expected a numeric id"), tempRefSchema3]);
|
|
10811
|
+
var moneySchema2 = z9.object({
|
|
10812
|
+
amount: z9.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"),
|
|
10813
|
+
currencyCode: z9.string().length(3).optional()
|
|
10814
|
+
});
|
|
10815
|
+
var httpsUrlSchema3 = z9.string().url().refine((u) => u.startsWith("https://"), "destination URLs must be https");
|
|
10816
|
+
var bakerMediaIdSchema2 = z9.string().min(1);
|
|
10817
|
+
var stageableStatusSchema3 = z9.enum(STAGEABLE_CREATE_STATUSES3);
|
|
10818
|
+
var updateStatusSchema = z9.enum(UPDATE_STATUSES);
|
|
10986
10819
|
function currencyMinimums2(currencyCode) {
|
|
10987
10820
|
return CURRENCY_MINIMUMS2[currencyCode] ?? DEFAULT_CURRENCY_MINIMUM2;
|
|
10988
10821
|
}
|
|
@@ -10994,50 +10827,50 @@ function validateDailyBudgetFloor(money, ctx, path12) {
|
|
|
10994
10827
|
}
|
|
10995
10828
|
}
|
|
10996
10829
|
}
|
|
10997
|
-
var geoLocationsSchema =
|
|
10998
|
-
countries:
|
|
10999
|
-
regions:
|
|
11000
|
-
cities:
|
|
11001
|
-
zips:
|
|
11002
|
-
location_types:
|
|
11003
|
-
}).catchall(
|
|
11004
|
-
var idNameSchema =
|
|
11005
|
-
var metaTargetingSchema =
|
|
10830
|
+
var geoLocationsSchema = z9.object({
|
|
10831
|
+
countries: z9.array(z9.string().length(2)).optional(),
|
|
10832
|
+
regions: z9.array(z9.object({ key: z9.string() })).optional(),
|
|
10833
|
+
cities: z9.array(z9.object({ key: z9.string(), radius: z9.number().optional(), distance_unit: z9.string().optional() })).optional(),
|
|
10834
|
+
zips: z9.array(z9.object({ key: z9.string() })).optional(),
|
|
10835
|
+
location_types: z9.array(z9.string()).optional()
|
|
10836
|
+
}).catchall(z9.unknown());
|
|
10837
|
+
var idNameSchema = z9.object({ id: z9.string(), name: z9.string().optional() });
|
|
10838
|
+
var metaTargetingSchema = z9.object({
|
|
11006
10839
|
geo_locations: geoLocationsSchema.optional(),
|
|
11007
10840
|
excluded_geo_locations: geoLocationsSchema.optional(),
|
|
11008
|
-
age_min:
|
|
11009
|
-
age_max:
|
|
11010
|
-
genders:
|
|
11011
|
-
locales:
|
|
11012
|
-
interests:
|
|
11013
|
-
behaviors:
|
|
11014
|
-
custom_audiences:
|
|
11015
|
-
excluded_custom_audiences:
|
|
11016
|
-
flexible_spec:
|
|
11017
|
-
exclusions:
|
|
11018
|
-
publisher_platforms:
|
|
11019
|
-
facebook_positions:
|
|
11020
|
-
instagram_positions:
|
|
11021
|
-
audience_network_positions:
|
|
11022
|
-
messenger_positions:
|
|
11023
|
-
device_platforms:
|
|
11024
|
-
targeting_automation:
|
|
11025
|
-
}).catchall(
|
|
11026
|
-
var specialAdCategoriesSchema =
|
|
11027
|
-
var campaignCreateSchema3 =
|
|
11028
|
-
name:
|
|
11029
|
-
objective:
|
|
10841
|
+
age_min: z9.number().int().min(13).max(65).optional(),
|
|
10842
|
+
age_max: z9.number().int().min(13).max(65).optional(),
|
|
10843
|
+
genders: z9.array(z9.union([z9.literal(1), z9.literal(2)])).optional(),
|
|
10844
|
+
locales: z9.array(z9.number().int()).optional(),
|
|
10845
|
+
interests: z9.array(idNameSchema).optional(),
|
|
10846
|
+
behaviors: z9.array(idNameSchema).optional(),
|
|
10847
|
+
custom_audiences: z9.array(z9.object({ id: parentRefSchema2 })).optional(),
|
|
10848
|
+
excluded_custom_audiences: z9.array(z9.object({ id: parentRefSchema2 })).optional(),
|
|
10849
|
+
flexible_spec: z9.array(z9.record(z9.string(), z9.unknown())).optional(),
|
|
10850
|
+
exclusions: z9.record(z9.string(), z9.unknown()).optional(),
|
|
10851
|
+
publisher_platforms: z9.array(z9.string()).optional(),
|
|
10852
|
+
facebook_positions: z9.array(z9.string()).optional(),
|
|
10853
|
+
instagram_positions: z9.array(z9.string()).optional(),
|
|
10854
|
+
audience_network_positions: z9.array(z9.string()).optional(),
|
|
10855
|
+
messenger_positions: z9.array(z9.string()).optional(),
|
|
10856
|
+
device_platforms: z9.array(z9.string()).optional(),
|
|
10857
|
+
targeting_automation: z9.object({ advantage_audience: z9.union([z9.literal(0), z9.literal(1)]) }).partial().optional()
|
|
10858
|
+
}).catchall(z9.unknown());
|
|
10859
|
+
var specialAdCategoriesSchema = z9.array(z9.enum(SPECIAL_AD_CATEGORIES)).default(["NONE"]);
|
|
10860
|
+
var campaignCreateSchema3 = z9.object({
|
|
10861
|
+
name: z9.string().min(1).max(META_LIMITS.campaign.nameMax),
|
|
10862
|
+
objective: z9.enum(OBJECTIVES),
|
|
11030
10863
|
status: stageableStatusSchema3.default("PAUSED"),
|
|
11031
10864
|
special_ad_categories: specialAdCategoriesSchema,
|
|
11032
|
-
special_ad_category_country:
|
|
11033
|
-
buying_type:
|
|
11034
|
-
bid_strategy:
|
|
10865
|
+
special_ad_category_country: z9.array(z9.string().length(2)).optional(),
|
|
10866
|
+
buying_type: z9.enum(BUYING_TYPES).default("AUCTION"),
|
|
10867
|
+
bid_strategy: z9.enum(BID_STRATEGIES).optional(),
|
|
11035
10868
|
/** Campaign Budget Optimization (Advantage campaign budget) — mutually exclusive with ad-set budgets. */
|
|
11036
10869
|
dailyBudget: moneySchema2.optional(),
|
|
11037
10870
|
lifetimeBudget: moneySchema2.optional(),
|
|
11038
10871
|
spendCap: moneySchema2.optional(),
|
|
11039
|
-
start_time:
|
|
11040
|
-
stop_time:
|
|
10872
|
+
start_time: z9.number().int().positive().optional(),
|
|
10873
|
+
stop_time: z9.number().int().positive().optional()
|
|
11041
10874
|
}).superRefine((p, ctx) => {
|
|
11042
10875
|
if (p.dailyBudget && p.lifetimeBudget) {
|
|
11043
10876
|
ctx.addIssue({ code: "custom", path: ["dailyBudget"], message: "set only one of dailyBudget or lifetimeBudget" });
|
|
@@ -11047,15 +10880,15 @@ var campaignCreateSchema3 = z10.object({
|
|
|
11047
10880
|
ctx.addIssue({ code: "custom", path: ["stop_time"], message: "stop_time must be after start_time" });
|
|
11048
10881
|
}
|
|
11049
10882
|
});
|
|
11050
|
-
var campaignUpdateSchema3 =
|
|
11051
|
-
name:
|
|
10883
|
+
var campaignUpdateSchema3 = z9.object({
|
|
10884
|
+
name: z9.string().min(1).max(META_LIMITS.campaign.nameMax).optional(),
|
|
11052
10885
|
status: updateStatusSchema.optional(),
|
|
11053
|
-
bid_strategy:
|
|
10886
|
+
bid_strategy: z9.enum(BID_STRATEGIES).optional(),
|
|
11054
10887
|
dailyBudget: moneySchema2.optional(),
|
|
11055
10888
|
lifetimeBudget: moneySchema2.optional(),
|
|
11056
10889
|
spendCap: moneySchema2.optional(),
|
|
11057
|
-
start_time:
|
|
11058
|
-
stop_time:
|
|
10890
|
+
start_time: z9.number().int().positive().optional(),
|
|
10891
|
+
stop_time: z9.number().int().positive().optional()
|
|
11059
10892
|
}).superRefine((p, ctx) => {
|
|
11060
10893
|
if (!Object.values(p).some((val) => val !== void 0)) {
|
|
11061
10894
|
ctx.addIssue({ code: "custom", message: "update needs at least one field" });
|
|
@@ -11065,38 +10898,38 @@ var campaignUpdateSchema3 = z10.object({
|
|
|
11065
10898
|
}
|
|
11066
10899
|
validateDailyBudgetFloor(p.dailyBudget, ctx, ["dailyBudget", "amount"]);
|
|
11067
10900
|
});
|
|
11068
|
-
var promotedObjectSchema =
|
|
10901
|
+
var promotedObjectSchema = z9.object({
|
|
11069
10902
|
page_id: parentRefSchema2.optional(),
|
|
11070
|
-
pixel_id:
|
|
11071
|
-
custom_event_type:
|
|
11072
|
-
application_id:
|
|
11073
|
-
object_store_url:
|
|
11074
|
-
product_catalog_id:
|
|
11075
|
-
product_set_id:
|
|
11076
|
-
whatsapp_phone_number:
|
|
11077
|
-
offline_conversion_data_set_id:
|
|
10903
|
+
pixel_id: z9.string().regex(NUMERIC_ID_REGEX3).optional(),
|
|
10904
|
+
custom_event_type: z9.enum(CUSTOM_EVENT_TYPES).optional(),
|
|
10905
|
+
application_id: z9.string().regex(NUMERIC_ID_REGEX3).optional(),
|
|
10906
|
+
object_store_url: z9.string().url().optional(),
|
|
10907
|
+
product_catalog_id: z9.string().regex(NUMERIC_ID_REGEX3).optional(),
|
|
10908
|
+
product_set_id: z9.string().regex(NUMERIC_ID_REGEX3).optional(),
|
|
10909
|
+
whatsapp_phone_number: z9.string().optional(),
|
|
10910
|
+
offline_conversion_data_set_id: z9.string().regex(NUMERIC_ID_REGEX3).optional()
|
|
11078
10911
|
}).partial();
|
|
11079
|
-
var attributionSpecSchema =
|
|
11080
|
-
|
|
11081
|
-
event_type:
|
|
11082
|
-
window_days:
|
|
10912
|
+
var attributionSpecSchema = z9.array(
|
|
10913
|
+
z9.object({
|
|
10914
|
+
event_type: z9.enum(ATTRIBUTION_EVENT_TYPES),
|
|
10915
|
+
window_days: z9.union([z9.literal(1), z9.literal(7), z9.literal(28)])
|
|
11083
10916
|
})
|
|
11084
10917
|
);
|
|
11085
10918
|
var adSetFields = {
|
|
11086
|
-
name:
|
|
10919
|
+
name: z9.string().min(1).max(META_LIMITS.adSet.nameMax),
|
|
11087
10920
|
campaign_id: parentRefSchema2,
|
|
11088
10921
|
status: stageableStatusSchema3.default("PAUSED"),
|
|
11089
10922
|
dailyBudget: moneySchema2.optional(),
|
|
11090
10923
|
lifetimeBudget: moneySchema2.optional(),
|
|
11091
10924
|
bidAmount: moneySchema2.optional(),
|
|
11092
|
-
bid_strategy:
|
|
11093
|
-
billing_event:
|
|
11094
|
-
optimization_goal:
|
|
11095
|
-
destination_type:
|
|
10925
|
+
bid_strategy: z9.enum(BID_STRATEGIES).optional(),
|
|
10926
|
+
billing_event: z9.enum(BILLING_EVENTS),
|
|
10927
|
+
optimization_goal: z9.enum(OPTIMIZATION_GOALS),
|
|
10928
|
+
destination_type: z9.enum(DESTINATION_TYPES).optional(),
|
|
11096
10929
|
promoted_object: promotedObjectSchema.optional(),
|
|
11097
10930
|
attribution_spec: attributionSpecSchema.optional(),
|
|
11098
|
-
start_time:
|
|
11099
|
-
end_time:
|
|
10931
|
+
start_time: z9.number().int().positive().optional(),
|
|
10932
|
+
end_time: z9.number().int().positive().optional(),
|
|
11100
10933
|
targeting: metaTargetingSchema
|
|
11101
10934
|
};
|
|
11102
10935
|
function validateAdSetBudgetAndBid(p, ctx) {
|
|
@@ -11114,22 +10947,22 @@ function validateAdSetBudgetAndBid(p, ctx) {
|
|
|
11114
10947
|
ctx.addIssue({ code: "custom", path: ["end_time"], message: "end_time must be after start_time" });
|
|
11115
10948
|
}
|
|
11116
10949
|
}
|
|
11117
|
-
var adSetCreateSchema =
|
|
10950
|
+
var adSetCreateSchema = z9.object(adSetFields).superRefine((p, ctx) => {
|
|
11118
10951
|
validateAdSetBudgetAndBid(p, ctx);
|
|
11119
10952
|
});
|
|
11120
|
-
var adSetUpdateSchema =
|
|
10953
|
+
var adSetUpdateSchema = z9.object({
|
|
11121
10954
|
name: adSetFields.name.optional(),
|
|
11122
10955
|
status: updateStatusSchema.optional(),
|
|
11123
10956
|
dailyBudget: moneySchema2.optional(),
|
|
11124
10957
|
lifetimeBudget: moneySchema2.optional(),
|
|
11125
10958
|
bidAmount: moneySchema2.optional(),
|
|
11126
|
-
bid_strategy:
|
|
11127
|
-
optimization_goal:
|
|
11128
|
-
destination_type:
|
|
10959
|
+
bid_strategy: z9.enum(BID_STRATEGIES).optional(),
|
|
10960
|
+
optimization_goal: z9.enum(OPTIMIZATION_GOALS).optional(),
|
|
10961
|
+
destination_type: z9.enum(DESTINATION_TYPES).optional(),
|
|
11129
10962
|
promoted_object: promotedObjectSchema.optional(),
|
|
11130
10963
|
attribution_spec: attributionSpecSchema.optional(),
|
|
11131
|
-
start_time:
|
|
11132
|
-
end_time:
|
|
10964
|
+
start_time: z9.number().int().positive().optional(),
|
|
10965
|
+
end_time: z9.number().int().positive().optional(),
|
|
11133
10966
|
targeting: metaTargetingSchema.optional()
|
|
11134
10967
|
}).superRefine((p, ctx) => {
|
|
11135
10968
|
if (!Object.values(p).some((val) => val !== void 0)) {
|
|
@@ -11137,38 +10970,38 @@ var adSetUpdateSchema = z10.object({
|
|
|
11137
10970
|
}
|
|
11138
10971
|
validateAdSetBudgetAndBid(p, ctx);
|
|
11139
10972
|
});
|
|
11140
|
-
var messageSchema =
|
|
11141
|
-
var headlineSchema2 =
|
|
11142
|
-
var descriptionSchema =
|
|
11143
|
-
var callToActionSchema =
|
|
11144
|
-
type:
|
|
10973
|
+
var messageSchema = z9.string().min(1).max(META_LIMITS.creative.messageHardMax);
|
|
10974
|
+
var headlineSchema2 = z9.string().min(1).max(META_LIMITS.creative.headlineMax);
|
|
10975
|
+
var descriptionSchema = z9.string().min(1).max(META_LIMITS.creative.descriptionMax);
|
|
10976
|
+
var callToActionSchema = z9.object({
|
|
10977
|
+
type: z9.enum(CTA_TYPES2),
|
|
11145
10978
|
/** Overrides the base link for the CTA button; defaults to the ad's link. */
|
|
11146
10979
|
link: httpsUrlSchema3.optional()
|
|
11147
10980
|
});
|
|
11148
|
-
var creativeEnhancementsSchema =
|
|
11149
|
-
standardEnhancements:
|
|
11150
|
-
features:
|
|
10981
|
+
var creativeEnhancementsSchema = z9.object({
|
|
10982
|
+
standardEnhancements: z9.enum(ENROLL_STATUSES).optional(),
|
|
10983
|
+
features: z9.record(z9.string(), z9.enum(ENROLL_STATUSES)).optional()
|
|
11151
10984
|
});
|
|
11152
10985
|
var creativeSharedFields = {
|
|
11153
|
-
name:
|
|
10986
|
+
name: z9.string().max(META_LIMITS.creative.nameMax).optional(),
|
|
11154
10987
|
/** Facebook Page id backing the ad's identity. */
|
|
11155
10988
|
page_id: parentRefSchema2,
|
|
11156
10989
|
/** Instagram account id for IG placements (aka instagram_actor_id on read). */
|
|
11157
|
-
instagram_user_id:
|
|
10990
|
+
instagram_user_id: z9.string().regex(NUMERIC_ID_REGEX3).optional(),
|
|
11158
10991
|
/** URL tracking parameters appended to the destination, e.g. "utm_source=fb&utm_campaign=x". */
|
|
11159
|
-
url_tags:
|
|
10992
|
+
url_tags: z9.string().max(1e3).optional(),
|
|
11160
10993
|
enhancements: creativeEnhancementsSchema.optional()
|
|
11161
10994
|
};
|
|
11162
10995
|
var imageMediaFields = {
|
|
11163
|
-
imageHash:
|
|
10996
|
+
imageHash: z9.string().regex(IMAGE_HASH_REGEX).optional(),
|
|
11164
10997
|
imageRef: tempRefSchema3.optional()
|
|
11165
10998
|
};
|
|
11166
10999
|
var videoMediaFields = {
|
|
11167
|
-
videoId:
|
|
11000
|
+
videoId: z9.string().regex(NUMERIC_ID_REGEX3).optional(),
|
|
11168
11001
|
videoRef: tempRefSchema3.optional(),
|
|
11169
11002
|
/** Thumbnail for a video creative — image hash, ref, or public url. */
|
|
11170
|
-
thumbnailHash:
|
|
11171
|
-
imageUrl:
|
|
11003
|
+
thumbnailHash: z9.string().regex(IMAGE_HASH_REGEX).optional(),
|
|
11004
|
+
imageUrl: z9.string().url().optional()
|
|
11172
11005
|
};
|
|
11173
11006
|
function countImageRefs(p) {
|
|
11174
11007
|
return [p.imageHash, p.imageRef].filter(Boolean).length;
|
|
@@ -11176,8 +11009,8 @@ function countImageRefs(p) {
|
|
|
11176
11009
|
function countVideoRefs(p) {
|
|
11177
11010
|
return [p.videoId, p.videoRef].filter(Boolean).length;
|
|
11178
11011
|
}
|
|
11179
|
-
var singleCreativeSchema =
|
|
11180
|
-
creativeType:
|
|
11012
|
+
var singleCreativeSchema = z9.object({
|
|
11013
|
+
creativeType: z9.literal("single"),
|
|
11181
11014
|
...creativeSharedFields,
|
|
11182
11015
|
/** Primary text. */
|
|
11183
11016
|
message: messageSchema,
|
|
@@ -11186,7 +11019,7 @@ var singleCreativeSchema = z10.object({
|
|
|
11186
11019
|
headline: headlineSchema2.optional(),
|
|
11187
11020
|
description: descriptionSchema.optional(),
|
|
11188
11021
|
/** Display URL / caption shown under the headline. */
|
|
11189
|
-
caption:
|
|
11022
|
+
caption: z9.string().max(255).optional(),
|
|
11190
11023
|
call_to_action: callToActionSchema.optional(),
|
|
11191
11024
|
...imageMediaFields,
|
|
11192
11025
|
...videoMediaFields
|
|
@@ -11210,10 +11043,10 @@ var singleCreativeSchema = z10.object({
|
|
|
11210
11043
|
});
|
|
11211
11044
|
}
|
|
11212
11045
|
});
|
|
11213
|
-
var carouselCardSchema =
|
|
11046
|
+
var carouselCardSchema = z9.object({
|
|
11214
11047
|
link: httpsUrlSchema3,
|
|
11215
|
-
headline:
|
|
11216
|
-
description:
|
|
11048
|
+
headline: z9.string().max(META_LIMITS.creative.headlineMax).optional(),
|
|
11049
|
+
description: z9.string().max(META_LIMITS.creative.descriptionMax).optional(),
|
|
11217
11050
|
call_to_action: callToActionSchema.optional(),
|
|
11218
11051
|
...imageMediaFields,
|
|
11219
11052
|
...videoMediaFields
|
|
@@ -11233,35 +11066,35 @@ var carouselCardSchema = z10.object({
|
|
|
11233
11066
|
ctx.addIssue({ code: "custom", path: ["videoId"], message: "each card is an image OR a video, not both" });
|
|
11234
11067
|
}
|
|
11235
11068
|
});
|
|
11236
|
-
var carouselCreativeSchema2 =
|
|
11237
|
-
creativeType:
|
|
11069
|
+
var carouselCreativeSchema2 = z9.object({
|
|
11070
|
+
creativeType: z9.literal("carousel"),
|
|
11238
11071
|
...creativeSharedFields,
|
|
11239
11072
|
message: messageSchema,
|
|
11240
11073
|
/** Optional "see more" card destination applied when a card has no own link. */
|
|
11241
11074
|
link: httpsUrlSchema3.optional(),
|
|
11242
11075
|
call_to_action: callToActionSchema.optional(),
|
|
11243
|
-
cards:
|
|
11076
|
+
cards: z9.array(carouselCardSchema).min(META_LIMITS.creative.carouselCardsMin).max(META_LIMITS.creative.carouselCardsMax)
|
|
11244
11077
|
});
|
|
11245
|
-
var dynamicImageSchema =
|
|
11246
|
-
var dynamicVideoSchema =
|
|
11078
|
+
var dynamicImageSchema = z9.object({ ...imageMediaFields }).refine((p) => countImageRefs(p) === 1, "each dynamic image needs exactly one reference");
|
|
11079
|
+
var dynamicVideoSchema = z9.object({
|
|
11247
11080
|
videoId: videoMediaFields.videoId,
|
|
11248
11081
|
videoRef: videoMediaFields.videoRef,
|
|
11249
11082
|
thumbnailHash: videoMediaFields.thumbnailHash
|
|
11250
11083
|
}).refine((p) => countVideoRefs(p) === 1, "each dynamic video needs exactly one reference");
|
|
11251
11084
|
var DYN = META_LIMITS.creative;
|
|
11252
|
-
var dynamicCreativeSchema =
|
|
11253
|
-
creativeType:
|
|
11085
|
+
var dynamicCreativeSchema = z9.object({
|
|
11086
|
+
creativeType: z9.literal("dynamic"),
|
|
11254
11087
|
...creativeSharedFields,
|
|
11255
|
-
bodies:
|
|
11256
|
-
titles:
|
|
11257
|
-
descriptions:
|
|
11258
|
-
images:
|
|
11259
|
-
videos:
|
|
11260
|
-
ad_formats:
|
|
11261
|
-
call_to_action_types:
|
|
11262
|
-
link_urls:
|
|
11088
|
+
bodies: z9.array(z9.object({ text: messageSchema })).min(DYN.dynamicTextsMin).max(DYN.dynamicTextsMax),
|
|
11089
|
+
titles: z9.array(z9.object({ text: headlineSchema2 })).min(DYN.dynamicTextsMin).max(DYN.dynamicTextsMax),
|
|
11090
|
+
descriptions: z9.array(z9.object({ text: descriptionSchema })).max(DYN.dynamicTextsMax).optional(),
|
|
11091
|
+
images: z9.array(dynamicImageSchema).optional(),
|
|
11092
|
+
videos: z9.array(dynamicVideoSchema).optional(),
|
|
11093
|
+
ad_formats: z9.array(z9.enum(AD_FORMATS2)).min(1),
|
|
11094
|
+
call_to_action_types: z9.array(z9.enum(CTA_TYPES2)).optional(),
|
|
11095
|
+
link_urls: z9.array(z9.object({ website_url: httpsUrlSchema3, display_url: z9.string().optional() })).min(1),
|
|
11263
11096
|
/** Multi-language / placement customization — structural passthrough for v1. */
|
|
11264
|
-
asset_customization_rules:
|
|
11097
|
+
asset_customization_rules: z9.array(z9.record(z9.string(), z9.unknown())).optional()
|
|
11265
11098
|
}).superRefine((p, ctx) => {
|
|
11266
11099
|
if (!(p.images?.length || p.videos?.length)) {
|
|
11267
11100
|
ctx.addIssue({
|
|
@@ -11271,57 +11104,57 @@ var dynamicCreativeSchema = z10.object({
|
|
|
11271
11104
|
});
|
|
11272
11105
|
}
|
|
11273
11106
|
});
|
|
11274
|
-
var existingPostCreativeSchema =
|
|
11275
|
-
creativeType:
|
|
11107
|
+
var existingPostCreativeSchema = z9.object({
|
|
11108
|
+
creativeType: z9.literal("existing_post"),
|
|
11276
11109
|
name: creativeSharedFields.name,
|
|
11277
11110
|
/** "<page_id>_<post_id>" object story id of the post to promote. */
|
|
11278
|
-
object_story_id:
|
|
11111
|
+
object_story_id: z9.string().regex(/^\d+_\d+$/, 'expected "<page_id>_<post_id>"'),
|
|
11279
11112
|
instagram_user_id: creativeSharedFields.instagram_user_id,
|
|
11280
11113
|
url_tags: creativeSharedFields.url_tags,
|
|
11281
11114
|
enhancements: creativeSharedFields.enhancements
|
|
11282
11115
|
});
|
|
11283
|
-
var creativeContentSchema2 =
|
|
11116
|
+
var creativeContentSchema2 = z9.discriminatedUnion("creativeType", [
|
|
11284
11117
|
singleCreativeSchema,
|
|
11285
11118
|
carouselCreativeSchema2,
|
|
11286
11119
|
dynamicCreativeSchema,
|
|
11287
11120
|
existingPostCreativeSchema
|
|
11288
11121
|
]);
|
|
11289
11122
|
var adCreativeCreateSchema = creativeContentSchema2;
|
|
11290
|
-
var adCreativeUpdateSchema =
|
|
11291
|
-
name:
|
|
11123
|
+
var adCreativeUpdateSchema = z9.object({
|
|
11124
|
+
name: z9.string().max(META_LIMITS.creative.nameMax).optional(),
|
|
11292
11125
|
status: updateStatusSchema.optional(),
|
|
11293
11126
|
/** Content patch — only honored when the target is a staged meta_temp_* creative. */
|
|
11294
|
-
content:
|
|
11127
|
+
content: z9.record(z9.string(), z9.unknown()).optional()
|
|
11295
11128
|
}).refine((p) => Object.values(p).some((val) => val !== void 0), "update needs at least one field");
|
|
11296
|
-
var adCreateSchema2 =
|
|
11297
|
-
name:
|
|
11129
|
+
var adCreateSchema2 = z9.object({
|
|
11130
|
+
name: z9.string().min(1).max(META_LIMITS.ad.nameMax),
|
|
11298
11131
|
adset_id: parentRefSchema2,
|
|
11299
11132
|
status: stageableStatusSchema3.default("PAUSED"),
|
|
11300
|
-
creative:
|
|
11133
|
+
creative: z9.object({ creative_id: parentRefSchema2 }),
|
|
11301
11134
|
/** Conversion pixel / offline event set / view tags — structural passthrough. */
|
|
11302
|
-
tracking_specs:
|
|
11135
|
+
tracking_specs: z9.array(z9.record(z9.string(), z9.unknown())).optional()
|
|
11303
11136
|
});
|
|
11304
|
-
var adUpdateSchema2 =
|
|
11305
|
-
name:
|
|
11137
|
+
var adUpdateSchema2 = z9.object({
|
|
11138
|
+
name: z9.string().min(1).max(META_LIMITS.ad.nameMax).optional(),
|
|
11306
11139
|
status: updateStatusSchema.optional(),
|
|
11307
11140
|
/** Swapping the creative is the Meta way to "edit" an ad's creative. */
|
|
11308
|
-
creative:
|
|
11309
|
-
tracking_specs:
|
|
11141
|
+
creative: z9.object({ creative_id: parentRefSchema2 }).optional(),
|
|
11142
|
+
tracking_specs: z9.array(z9.record(z9.string(), z9.unknown())).optional()
|
|
11310
11143
|
}).refine((p) => Object.values(p).some((val) => val !== void 0), "update needs at least one field");
|
|
11311
|
-
var lookalikeSpecSchema =
|
|
11312
|
-
origin:
|
|
11313
|
-
ratio:
|
|
11314
|
-
country:
|
|
11315
|
-
});
|
|
11316
|
-
var customAudienceCreateSchema =
|
|
11317
|
-
name:
|
|
11318
|
-
subtype:
|
|
11319
|
-
description:
|
|
11320
|
-
customer_file_source:
|
|
11321
|
-
retention_days:
|
|
11144
|
+
var lookalikeSpecSchema = z9.object({
|
|
11145
|
+
origin: z9.array(z9.object({ id: parentRefSchema2 })).min(1),
|
|
11146
|
+
ratio: z9.number().min(0.01).max(0.2).optional(),
|
|
11147
|
+
country: z9.string().length(2).optional()
|
|
11148
|
+
});
|
|
11149
|
+
var customAudienceCreateSchema = z9.object({
|
|
11150
|
+
name: z9.string().min(1).max(META_LIMITS.audience.nameMax),
|
|
11151
|
+
subtype: z9.enum(CUSTOM_AUDIENCE_SUBTYPES),
|
|
11152
|
+
description: z9.string().max(500).optional(),
|
|
11153
|
+
customer_file_source: z9.string().optional(),
|
|
11154
|
+
retention_days: z9.number().int().min(1).max(META_LIMITS.audience.retentionDaysMax).optional(),
|
|
11322
11155
|
lookalike_spec: lookalikeSpecSchema.optional(),
|
|
11323
11156
|
/** Website/engagement rule — structural passthrough validated by Meta. */
|
|
11324
|
-
rule:
|
|
11157
|
+
rule: z9.record(z9.string(), z9.unknown()).optional()
|
|
11325
11158
|
}).superRefine((p, ctx) => {
|
|
11326
11159
|
if (p.subtype === "LOOKALIKE" && !p.lookalike_spec) {
|
|
11327
11160
|
ctx.addIssue({ code: "custom", path: ["lookalike_spec"], message: "LOOKALIKE audiences need a lookalike_spec" });
|
|
@@ -11330,16 +11163,16 @@ var customAudienceCreateSchema = z10.object({
|
|
|
11330
11163
|
ctx.addIssue({ code: "custom", path: ["rule"], message: `${p.subtype} audiences need a rule (use --file)` });
|
|
11331
11164
|
}
|
|
11332
11165
|
});
|
|
11333
|
-
var customAudienceUpdateSchema =
|
|
11334
|
-
name:
|
|
11335
|
-
description:
|
|
11166
|
+
var customAudienceUpdateSchema = z9.object({
|
|
11167
|
+
name: z9.string().min(1).max(META_LIMITS.audience.nameMax).optional(),
|
|
11168
|
+
description: z9.string().max(500).optional()
|
|
11336
11169
|
}).refine((p) => Object.values(p).some((val) => val !== void 0), "update needs at least one field");
|
|
11337
|
-
var mediaUploadSchema =
|
|
11338
|
-
kind:
|
|
11170
|
+
var mediaUploadSchema = z9.object({
|
|
11171
|
+
kind: z9.enum(MEDIA_KINDS),
|
|
11339
11172
|
bakerImageId: bakerMediaIdSchema2.optional(),
|
|
11340
11173
|
bakerVideoId: bakerMediaIdSchema2.optional(),
|
|
11341
11174
|
/** Optional display name / filename hint. */
|
|
11342
|
-
name:
|
|
11175
|
+
name: z9.string().max(255).optional()
|
|
11343
11176
|
}).superRefine((p, ctx) => {
|
|
11344
11177
|
if (p.kind === "image" && !p.bakerImageId) {
|
|
11345
11178
|
ctx.addIssue({ code: "custom", path: ["bakerImageId"], message: "image uploads need a bakerImageId" });
|
|
@@ -11361,16 +11194,16 @@ var META_DRAFT_OP_KINDS = [
|
|
|
11361
11194
|
"customAudience.update",
|
|
11362
11195
|
"media.upload"
|
|
11363
11196
|
];
|
|
11364
|
-
var metaDraftOpKindSchema =
|
|
11365
|
-
var accountIdSchema2 =
|
|
11366
|
-
var updateTargetSchema2 =
|
|
11197
|
+
var metaDraftOpKindSchema = z9.enum(META_DRAFT_OP_KINDS);
|
|
11198
|
+
var accountIdSchema2 = z9.string().regex(NUMERIC_ID_REGEX3, "accountId must be the bare numeric ad account id");
|
|
11199
|
+
var updateTargetSchema2 = z9.union([z9.string().regex(NUMERIC_ID_REGEX3), tempRefSchema3]);
|
|
11367
11200
|
function createOp3(kind, payload) {
|
|
11368
|
-
return
|
|
11201
|
+
return z9.object({ kind: z9.literal(kind), accountId: accountIdSchema2, payload });
|
|
11369
11202
|
}
|
|
11370
11203
|
function updateOp3(kind, payload) {
|
|
11371
|
-
return
|
|
11204
|
+
return z9.object({ kind: z9.literal(kind), accountId: accountIdSchema2, target: updateTargetSchema2, payload });
|
|
11372
11205
|
}
|
|
11373
|
-
var metaDraftOpInputSchema =
|
|
11206
|
+
var metaDraftOpInputSchema = z9.discriminatedUnion("kind", [
|
|
11374
11207
|
createOp3("campaign.create", campaignCreateSchema3),
|
|
11375
11208
|
updateOp3("campaign.update", campaignUpdateSchema3),
|
|
11376
11209
|
createOp3("adSet.create", adSetCreateSchema),
|
|
@@ -11385,89 +11218,89 @@ var metaDraftOpInputSchema = z10.discriminatedUnion("kind", [
|
|
|
11385
11218
|
]);
|
|
11386
11219
|
|
|
11387
11220
|
// ../api/src/ads-meta/wire.ts
|
|
11388
|
-
import { z as
|
|
11389
|
-
var metaWriteModeSchema =
|
|
11390
|
-
var metaDraftOpResultSchema =
|
|
11391
|
-
status:
|
|
11221
|
+
import { z as z10 } from "zod";
|
|
11222
|
+
var metaWriteModeSchema = z10.enum(["live", "simulated"]);
|
|
11223
|
+
var metaDraftOpResultSchema = z10.object({
|
|
11224
|
+
status: z10.enum(["applied", "simulated", "failed", "skipped"]),
|
|
11392
11225
|
/** The resulting Meta node id (campaign/adset/creative/ad/audience) or simulated id. */
|
|
11393
|
-
id:
|
|
11226
|
+
id: z10.string().optional(),
|
|
11394
11227
|
/** For media.upload ops: the resulting image hash. */
|
|
11395
|
-
hash:
|
|
11396
|
-
error:
|
|
11397
|
-
skippedBecause:
|
|
11398
|
-
executedAt:
|
|
11228
|
+
hash: z10.string().optional(),
|
|
11229
|
+
error: z10.string().optional(),
|
|
11230
|
+
skippedBecause: z10.string().optional(),
|
|
11231
|
+
executedAt: z10.number().optional()
|
|
11399
11232
|
});
|
|
11400
|
-
var metaDraftStageRequestSchema =
|
|
11401
|
-
chatId:
|
|
11233
|
+
var metaDraftStageRequestSchema = z10.object({
|
|
11234
|
+
chatId: z10.string(),
|
|
11402
11235
|
op: metaDraftOpInputSchema
|
|
11403
11236
|
});
|
|
11404
|
-
var metaDraftStageResponseSchema =
|
|
11405
|
-
staged:
|
|
11406
|
-
ref:
|
|
11237
|
+
var metaDraftStageResponseSchema = z10.object({
|
|
11238
|
+
staged: z10.literal(true),
|
|
11239
|
+
ref: z10.string(),
|
|
11407
11240
|
kind: metaDraftOpKindSchema,
|
|
11408
11241
|
mode: metaWriteModeSchema,
|
|
11409
|
-
dependsOn:
|
|
11410
|
-
summary:
|
|
11411
|
-
warnings:
|
|
11242
|
+
dependsOn: z10.array(z10.string()),
|
|
11243
|
+
summary: z10.string(),
|
|
11244
|
+
warnings: z10.array(z10.string()),
|
|
11412
11245
|
/** True when the op amended an already-staged op in place instead of appending a new one. */
|
|
11413
|
-
amended:
|
|
11414
|
-
});
|
|
11415
|
-
var metaDraftDuplicateRequestSchema =
|
|
11416
|
-
chatId:
|
|
11417
|
-
accountId:
|
|
11418
|
-
entity:
|
|
11419
|
-
sourceId:
|
|
11420
|
-
overrides:
|
|
11246
|
+
amended: z10.boolean().optional()
|
|
11247
|
+
});
|
|
11248
|
+
var metaDraftDuplicateRequestSchema = z10.object({
|
|
11249
|
+
chatId: z10.string(),
|
|
11250
|
+
accountId: z10.string(),
|
|
11251
|
+
entity: z10.enum(["campaign", "adSet", "ad"]),
|
|
11252
|
+
sourceId: z10.string(),
|
|
11253
|
+
overrides: z10.record(z10.string(), z10.unknown()).optional(),
|
|
11421
11254
|
/** Pause the original after the copy publishes. */
|
|
11422
|
-
replace:
|
|
11255
|
+
replace: z10.boolean().optional()
|
|
11423
11256
|
});
|
|
11424
|
-
var metaDraftOpViewSchema =
|
|
11425
|
-
ref:
|
|
11257
|
+
var metaDraftOpViewSchema = z10.object({
|
|
11258
|
+
ref: z10.string(),
|
|
11426
11259
|
kind: metaDraftOpKindSchema,
|
|
11427
|
-
accountId:
|
|
11428
|
-
target:
|
|
11429
|
-
dependsOn:
|
|
11430
|
-
summary:
|
|
11431
|
-
stagedAt:
|
|
11260
|
+
accountId: z10.string(),
|
|
11261
|
+
target: z10.string().optional(),
|
|
11262
|
+
dependsOn: z10.array(z10.string()),
|
|
11263
|
+
summary: z10.string(),
|
|
11264
|
+
stagedAt: z10.number(),
|
|
11432
11265
|
result: metaDraftOpResultSchema.optional()
|
|
11433
11266
|
});
|
|
11434
|
-
var metaDraftListRequestSchema =
|
|
11435
|
-
chatId:
|
|
11267
|
+
var metaDraftListRequestSchema = z10.object({
|
|
11268
|
+
chatId: z10.string()
|
|
11436
11269
|
});
|
|
11437
|
-
var metaDraftAdvisorySchema =
|
|
11438
|
-
ref:
|
|
11439
|
-
message:
|
|
11270
|
+
var metaDraftAdvisorySchema = z10.object({
|
|
11271
|
+
ref: z10.string(),
|
|
11272
|
+
message: z10.string()
|
|
11440
11273
|
});
|
|
11441
|
-
var metaDraftListResponseSchema =
|
|
11442
|
-
status:
|
|
11274
|
+
var metaDraftListResponseSchema = z10.object({
|
|
11275
|
+
status: z10.enum(["active", "publishing", "applied", "discarded", "none"]),
|
|
11443
11276
|
mode: metaWriteModeSchema,
|
|
11444
|
-
count:
|
|
11445
|
-
ops:
|
|
11277
|
+
count: z10.number(),
|
|
11278
|
+
ops: z10.array(metaDraftOpViewSchema),
|
|
11446
11279
|
/** Non-blocking cross-op quality advisories — "good campaign, not just valid". */
|
|
11447
|
-
advisories:
|
|
11280
|
+
advisories: z10.array(metaDraftAdvisorySchema)
|
|
11448
11281
|
});
|
|
11449
|
-
var metaDraftRemoveRequestSchema =
|
|
11450
|
-
chatId:
|
|
11451
|
-
ref:
|
|
11282
|
+
var metaDraftRemoveRequestSchema = z10.object({
|
|
11283
|
+
chatId: z10.string(),
|
|
11284
|
+
ref: z10.string()
|
|
11452
11285
|
});
|
|
11453
|
-
var metaDraftRemoveResponseSchema =
|
|
11286
|
+
var metaDraftRemoveResponseSchema = z10.object({
|
|
11454
11287
|
/** The requested ref plus any dependents removed by cascade. */
|
|
11455
|
-
removed:
|
|
11288
|
+
removed: z10.array(z10.string())
|
|
11456
11289
|
});
|
|
11457
|
-
var metaDraftClearRequestSchema =
|
|
11458
|
-
chatId:
|
|
11290
|
+
var metaDraftClearRequestSchema = z10.object({
|
|
11291
|
+
chatId: z10.string()
|
|
11459
11292
|
});
|
|
11460
|
-
var metaDraftClearResponseSchema =
|
|
11461
|
-
cleared:
|
|
11293
|
+
var metaDraftClearResponseSchema = z10.object({
|
|
11294
|
+
cleared: z10.number()
|
|
11462
11295
|
});
|
|
11463
|
-
var metaFieldErrorSchema =
|
|
11464
|
-
path:
|
|
11465
|
-
message:
|
|
11296
|
+
var metaFieldErrorSchema = z10.object({
|
|
11297
|
+
path: z10.string(),
|
|
11298
|
+
message: z10.string()
|
|
11466
11299
|
});
|
|
11467
|
-
var metaDraftErrorResponseSchema =
|
|
11468
|
-
code:
|
|
11469
|
-
error:
|
|
11470
|
-
fields:
|
|
11300
|
+
var metaDraftErrorResponseSchema = z10.object({
|
|
11301
|
+
code: z10.string(),
|
|
11302
|
+
error: z10.string(),
|
|
11303
|
+
fields: z10.array(metaFieldErrorSchema).optional()
|
|
11471
11304
|
});
|
|
11472
11305
|
|
|
11473
11306
|
// src/commands/ads/meta/write-shared.ts
|
|
@@ -14744,27 +14577,27 @@ import path6 from "path";
|
|
|
14744
14577
|
import { defineCommand as defineCommand89 } from "citty";
|
|
14745
14578
|
|
|
14746
14579
|
// src/engine/scaffold/staticAd.ts
|
|
14747
|
-
import { z as
|
|
14580
|
+
import { z as z11 } from "zod";
|
|
14748
14581
|
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"]);
|
|
14749
14582
|
var DEFAULT_ASPECT_RATIO = "9:16";
|
|
14750
|
-
var Blueprint =
|
|
14751
|
-
meta:
|
|
14752
|
-
text_content:
|
|
14583
|
+
var Blueprint = z11.object({
|
|
14584
|
+
meta: z11.object({ estimated_aspect_ratio: z11.string().optional() }).loose().optional(),
|
|
14585
|
+
text_content: z11.array(z11.object({ text: z11.string().optional() }).loose()).optional()
|
|
14753
14586
|
}).loose();
|
|
14754
|
-
var ElementLocator =
|
|
14755
|
-
collection:
|
|
14756
|
-
index:
|
|
14587
|
+
var ElementLocator = z11.object({
|
|
14588
|
+
collection: z11.enum(["subjects", "people", "brands_logos"]),
|
|
14589
|
+
index: z11.number().int().nonnegative()
|
|
14757
14590
|
}).loose();
|
|
14758
|
-
var MainElement =
|
|
14591
|
+
var MainElement = z11.object({
|
|
14759
14592
|
// logo | product | person | animal | badge | other
|
|
14760
|
-
type:
|
|
14761
|
-
label:
|
|
14762
|
-
description:
|
|
14763
|
-
expression:
|
|
14764
|
-
reason:
|
|
14593
|
+
type: z11.string(),
|
|
14594
|
+
label: z11.string().optional(),
|
|
14595
|
+
description: z11.string().optional(),
|
|
14596
|
+
expression: z11.string().nullable().optional(),
|
|
14597
|
+
reason: z11.string().optional(),
|
|
14765
14598
|
locator: ElementLocator.optional()
|
|
14766
14599
|
}).loose();
|
|
14767
|
-
var MainElements =
|
|
14600
|
+
var MainElements = z11.array(MainElement);
|
|
14768
14601
|
function sanitizeId(raw, fallback) {
|
|
14769
14602
|
const id = raw.toLowerCase().replace(/[^a-z0-9]+/g, "_").replace(/^_+|_+$/g, "");
|
|
14770
14603
|
return /^[a-z]/.test(id) ? id : `${fallback}_${id}`.replace(/_+$/g, "") || fallback;
|
|
@@ -15300,7 +15133,7 @@ import { toCardinal as nwKo } from "n2words/ko-KR";
|
|
|
15300
15133
|
import { toCardinal as nwNl } from "n2words/nl-NL";
|
|
15301
15134
|
import { toCardinal as nwPl } from "n2words/pl-PL";
|
|
15302
15135
|
import { toCardinal as nwPt } from "n2words/pt-PT";
|
|
15303
|
-
import { z as
|
|
15136
|
+
import { z as z12 } from "zod";
|
|
15304
15137
|
|
|
15305
15138
|
// src/engine/scaffold/lib/shoot-modes.ts
|
|
15306
15139
|
var SHOOT_MODES = [
|
|
@@ -15613,71 +15446,71 @@ function trimArgs(durationS, offsetS = 0, dims) {
|
|
|
15613
15446
|
"{{out.video}}"
|
|
15614
15447
|
];
|
|
15615
15448
|
}
|
|
15616
|
-
var FrameAsset =
|
|
15617
|
-
var DialogueLine =
|
|
15618
|
-
speaker:
|
|
15619
|
-
line:
|
|
15449
|
+
var FrameAsset = z12.object({ url: z12.string().optional() }).loose().optional();
|
|
15450
|
+
var DialogueLine = z12.object({
|
|
15451
|
+
speaker: z12.string().optional(),
|
|
15452
|
+
line: z12.string().optional(),
|
|
15620
15453
|
// Absolute seconds on the source timeline (the deconstruct emits both).
|
|
15621
|
-
start_s:
|
|
15622
|
-
end_s:
|
|
15623
|
-
delivery:
|
|
15624
|
-
voice_description:
|
|
15454
|
+
start_s: z12.number().optional(),
|
|
15455
|
+
end_s: z12.number().optional(),
|
|
15456
|
+
delivery: z12.string().optional(),
|
|
15457
|
+
voice_description: z12.string().optional(),
|
|
15625
15458
|
// DECON-supplied: is this speaker's FACE visibly speaking in THIS scene? Element
|
|
15626
15459
|
// presence alone can't answer that — a founder pictured in a polaroid close-up is
|
|
15627
15460
|
// "present" yet the line is voiceover, and treating it as on-camera produced a
|
|
15628
15461
|
// native Seedance lip-sync clip of a still photograph. `false` pins the line to
|
|
15629
15462
|
// the VO path; absent keeps the presence-based decision (old blueprints).
|
|
15630
|
-
on_camera:
|
|
15463
|
+
on_camera: z12.boolean().optional()
|
|
15631
15464
|
}).loose();
|
|
15632
|
-
var Sfx =
|
|
15633
|
-
at_s:
|
|
15634
|
-
duration_s:
|
|
15635
|
-
sound_effect_prompt:
|
|
15636
|
-
description:
|
|
15465
|
+
var Sfx = z12.object({
|
|
15466
|
+
at_s: z12.number().optional(),
|
|
15467
|
+
duration_s: z12.number().optional(),
|
|
15468
|
+
sound_effect_prompt: z12.string().optional(),
|
|
15469
|
+
description: z12.string().optional()
|
|
15637
15470
|
}).loose();
|
|
15638
|
-
var CompositionRegion =
|
|
15471
|
+
var CompositionRegion = z12.object({
|
|
15639
15472
|
// full | top | bottom | left | right | inset
|
|
15640
|
-
panel:
|
|
15473
|
+
panel: z12.string().optional(),
|
|
15641
15474
|
// 9-grid anchor for an `inset` presenter box.
|
|
15642
|
-
position:
|
|
15643
|
-
is_presenter:
|
|
15475
|
+
position: z12.string().optional(),
|
|
15476
|
+
is_presenter: z12.boolean().optional(),
|
|
15644
15477
|
// The cast id shown/speaking in this region (routes lip-sync + element refs).
|
|
15645
|
-
cast_ref:
|
|
15478
|
+
cast_ref: z12.string().optional(),
|
|
15646
15479
|
// What the region's content IS: camera | screen_capture | static_graphic |
|
|
15647
15480
|
// generated. Authoritative for routing when present (regex-over-prose fallback
|
|
15648
15481
|
// otherwise): screen_capture/static_graphic are rebuilt from REAL surfaces on the
|
|
15649
15482
|
// overlay layer, never AI-generated.
|
|
15650
|
-
kind:
|
|
15483
|
+
kind: z12.string().optional(),
|
|
15651
15484
|
// Opaque id naming the SPECIFIC on-screen document/note/app-state this
|
|
15652
15485
|
// screen_capture region shows. Two scenes share it only when they show the SAME
|
|
15653
15486
|
// recording continuing (scrolling/typing/waiting within it) — a genuinely
|
|
15654
15487
|
// DIFFERENT document/note/recording (a source video splicing two screen captures)
|
|
15655
15488
|
// gets a different id. Breaks a persistent-layout run into separate surface stubs
|
|
15656
15489
|
// instead of asking the operator for one screenshot that can't cover both.
|
|
15657
|
-
surface_id:
|
|
15490
|
+
surface_id: z12.string().optional(),
|
|
15658
15491
|
// Camera bubble(s)/inset(s) embedded INSIDE this region's surface (a Loom-style
|
|
15659
15492
|
// presenter bubble inside a screen recording) — video-in-video the reproduction
|
|
15660
15493
|
// must re-composite, not paint into the surface.
|
|
15661
|
-
nested:
|
|
15662
|
-
summary:
|
|
15663
|
-
frame_prompt:
|
|
15664
|
-
motion_prompt:
|
|
15494
|
+
nested: z12.array(z12.object({}).loose()).optional(),
|
|
15495
|
+
summary: z12.string().optional(),
|
|
15496
|
+
frame_prompt: z12.string().optional(),
|
|
15497
|
+
motion_prompt: z12.string().optional()
|
|
15665
15498
|
}).loose();
|
|
15666
|
-
var SceneComposition =
|
|
15499
|
+
var SceneComposition = z12.object({
|
|
15667
15500
|
// full_frame (default) | split_screen | pip | keyed_overlay
|
|
15668
|
-
layout:
|
|
15501
|
+
layout: z12.string().optional(),
|
|
15669
15502
|
// split_screen only: vertical (top/bottom) | horizontal (left/right).
|
|
15670
|
-
split_axis:
|
|
15671
|
-
regions:
|
|
15503
|
+
split_axis: z12.string().optional(),
|
|
15504
|
+
regions: z12.array(CompositionRegion).optional()
|
|
15672
15505
|
}).loose();
|
|
15673
|
-
var CameraMotion =
|
|
15674
|
-
var TranscriptWord =
|
|
15675
|
-
var Scene =
|
|
15676
|
-
start_s:
|
|
15677
|
-
end_s:
|
|
15678
|
-
duration_s:
|
|
15679
|
-
summary:
|
|
15680
|
-
action_detail:
|
|
15506
|
+
var CameraMotion = z12.object({ movement: z12.string().optional(), detail: z12.string().optional() }).loose();
|
|
15507
|
+
var TranscriptWord = z12.object({ text: z12.string().optional() }).loose();
|
|
15508
|
+
var Scene = z12.object({
|
|
15509
|
+
start_s: z12.number().optional(),
|
|
15510
|
+
end_s: z12.number().optional(),
|
|
15511
|
+
duration_s: z12.number().optional(),
|
|
15512
|
+
summary: z12.string().optional(),
|
|
15513
|
+
action_detail: z12.string().optional(),
|
|
15681
15514
|
// The scene's spatial layout. Absent/full_frame ⇒ one uncut shot (default path).
|
|
15682
15515
|
// A layered layout (split_screen/pip/keyed_overlay) with regions ⇒ the scaffold
|
|
15683
15516
|
// builds one clip per region and stacks/overlays them into the scene picture.
|
|
@@ -15685,82 +15518,82 @@ var Scene = z13.object({
|
|
|
15685
15518
|
// The capture "look" for this scene — selected from the ad-native shoot-mode
|
|
15686
15519
|
// grammar (see lib/shoot-modes.ts). When absent the scaffold auto-derives a
|
|
15687
15520
|
// UGC/product mode; a human can override per scene by setting this.
|
|
15688
|
-
shoot_mode:
|
|
15521
|
+
shoot_mode: z12.string().optional(),
|
|
15689
15522
|
// Diegetic ambient the clip's native audio should carry (no music). When
|
|
15690
15523
|
// absent the scene falls back to its shoot mode's default ambience.
|
|
15691
|
-
ambient:
|
|
15524
|
+
ambient: z12.string().optional(),
|
|
15692
15525
|
camera_motion: CameraMotion.optional(),
|
|
15693
|
-
start_frame_prompt:
|
|
15694
|
-
end_frame_prompt:
|
|
15695
|
-
motion_prompt:
|
|
15526
|
+
start_frame_prompt: z12.string().optional(),
|
|
15527
|
+
end_frame_prompt: z12.string().optional(),
|
|
15528
|
+
motion_prompt: z12.string().optional(),
|
|
15696
15529
|
// The scene's role in the ad's persuasion arc (DECON-supplied); drives the
|
|
15697
15530
|
// script re-craft checklist. Inferred from position when absent.
|
|
15698
|
-
narrative_role:
|
|
15531
|
+
narrative_role: z12.string().optional(),
|
|
15699
15532
|
// DECON-supplied on the HOOK scene: the engineered physical/emotional state that
|
|
15700
15533
|
// makes the first frame stop the scroll (sweaty/breathless/urgent …). Injected
|
|
15701
15534
|
// into the hook's start-frame description so the generator renders that state,
|
|
15702
15535
|
// not a calm influencer (CCA-11).
|
|
15703
|
-
hook_mechanic:
|
|
15536
|
+
hook_mechanic: z12.object({ mechanic: z12.string().optional(), why_it_stops_scroll: z12.string().optional() }).loose().optional(),
|
|
15704
15537
|
// DECON-supplied per-scene location (so a gym hook isn't flattened to "home").
|
|
15705
|
-
scene_setting:
|
|
15538
|
+
scene_setting: z12.string().optional(),
|
|
15706
15539
|
// How this scene cuts to the next (DECON-supplied). A recognized non-cut type
|
|
15707
15540
|
// (fade/whip/zoom/dissolve/swipe) is reproduced as an ffmpeg xfade at the
|
|
15708
15541
|
// boundary; cut/match_cut/none/other stay hard cuts. The last scene's value is
|
|
15709
15542
|
// ignored (nothing follows it).
|
|
15710
|
-
transition_out:
|
|
15711
|
-
dialogue:
|
|
15712
|
-
sfx:
|
|
15713
|
-
overlays:
|
|
15714
|
-
floating_elements:
|
|
15543
|
+
transition_out: z12.object({ type: z12.string().optional(), description: z12.string().optional() }).loose().optional(),
|
|
15544
|
+
dialogue: z12.array(DialogueLine).optional(),
|
|
15545
|
+
sfx: z12.array(Sfx).optional(),
|
|
15546
|
+
overlays: z12.array(z12.unknown()).optional(),
|
|
15547
|
+
floating_elements: z12.array(z12.unknown()).optional(),
|
|
15715
15548
|
// DECON-supplied: how much the picture itself moves within the shot. Gates the
|
|
15716
15549
|
// flash-hold optimization — a sub-2s b-roll flash with REAL subject motion
|
|
15717
15550
|
// (pouring, spreading, hands working) must stay a real clip; freezing it turns
|
|
15718
15551
|
// a montage into a slideshow. Absent (old blueprints) keeps the cheap still.
|
|
15719
|
-
motion_level:
|
|
15720
|
-
transcript_slice:
|
|
15552
|
+
motion_level: z12.enum(["static", "subtle", "dynamic"]).optional(),
|
|
15553
|
+
transcript_slice: z12.array(TranscriptWord).optional(),
|
|
15721
15554
|
start_frame_asset: FrameAsset,
|
|
15722
15555
|
end_frame_asset: FrameAsset,
|
|
15723
15556
|
// DECON-supplied: true when this scene is a length-split CONTINUATION of the
|
|
15724
15557
|
// previous one (the SAME physical shot, broken up only because it exceeded the
|
|
15725
15558
|
// clip ceiling). The scaffold then shares the splice keyframe — this scene's
|
|
15726
15559
|
// start frame IS the previous scene's end frame — so the join is seamless.
|
|
15727
|
-
continues_previous:
|
|
15560
|
+
continues_previous: z12.boolean().optional()
|
|
15728
15561
|
}).loose();
|
|
15729
|
-
var VideoBlueprint =
|
|
15730
|
-
source:
|
|
15731
|
-
global:
|
|
15732
|
-
music:
|
|
15733
|
-
present:
|
|
15734
|
-
music_prompt:
|
|
15562
|
+
var VideoBlueprint = z12.object({
|
|
15563
|
+
source: z12.object({ aspect_ratio: z12.string().optional(), duration_s: z12.number().optional() }).loose().optional(),
|
|
15564
|
+
global: z12.object({
|
|
15565
|
+
music: z12.object({
|
|
15566
|
+
present: z12.boolean().optional(),
|
|
15567
|
+
music_prompt: z12.string().optional(),
|
|
15735
15568
|
// Absolute second the music enters in the reference (the bed often
|
|
15736
15569
|
// kicks in mid-ad, after the hook). We start the regenerated track here
|
|
15737
15570
|
// instead of at 0 so the timing matches.
|
|
15738
|
-
starts_at_s:
|
|
15571
|
+
starts_at_s: z12.number().optional(),
|
|
15739
15572
|
// Populated by the deconstruct when AudD (Shazam-style) recognizes the
|
|
15740
15573
|
// reference track. We never reuse it — only style the regenerated bed.
|
|
15741
|
-
identified_track:
|
|
15574
|
+
identified_track: z12.object({ title: z12.string().optional(), artist: z12.string().optional() }).loose().nullish()
|
|
15742
15575
|
}).loose().optional(),
|
|
15743
|
-
cast:
|
|
15744
|
-
|
|
15745
|
-
id:
|
|
15746
|
-
description:
|
|
15576
|
+
cast: z12.array(
|
|
15577
|
+
z12.object({
|
|
15578
|
+
id: z12.string().optional(),
|
|
15579
|
+
description: z12.string().optional(),
|
|
15747
15580
|
// The deconstruct's note on the target-market localization (e.g. "native
|
|
15748
15581
|
// French speaker") — read to derive the spoken-track language code.
|
|
15749
|
-
market_localization_note:
|
|
15582
|
+
market_localization_note: z12.string().optional()
|
|
15750
15583
|
}).loose()
|
|
15751
15584
|
).optional(),
|
|
15752
|
-
voiceover:
|
|
15585
|
+
voiceover: z12.object({
|
|
15753
15586
|
// on_camera | mixed → mouths are on screen (lip-sync candidates);
|
|
15754
15587
|
// voiceover | none → narration over the picture (no lip-sync).
|
|
15755
|
-
mode:
|
|
15756
|
-
voice_description:
|
|
15757
|
-
persona:
|
|
15588
|
+
mode: z12.string().optional(),
|
|
15589
|
+
voice_description: z12.string().optional(),
|
|
15590
|
+
persona: z12.string().optional()
|
|
15758
15591
|
}).loose().optional(),
|
|
15759
15592
|
// Visual palette — read only to colour a clean brand-card/CTA plate (the
|
|
15760
15593
|
// first hex is the dominant brand colour); never to drive frame generation.
|
|
15761
|
-
style:
|
|
15594
|
+
style: z12.object({ palette: z12.array(z12.object({ hex: z12.string().optional() }).loose()).optional() }).loose().optional()
|
|
15762
15595
|
}).loose().optional(),
|
|
15763
|
-
scenes:
|
|
15596
|
+
scenes: z12.array(Scene).min(1)
|
|
15764
15597
|
}).loose();
|
|
15765
15598
|
function injectHookPhysicality(blueprint) {
|
|
15766
15599
|
for (const scene of blueprint.scenes) {
|
|
@@ -15770,26 +15603,26 @@ function injectHookPhysicality(blueprint) {
|
|
|
15770
15603
|
scene.start_frame_prompt = `${prompt} The subject's physical state IS the scroll-stopper \u2014 render it explicitly, not a calm pose: ${why}.`;
|
|
15771
15604
|
}
|
|
15772
15605
|
}
|
|
15773
|
-
var AppearsItem =
|
|
15774
|
-
var RecurringElement =
|
|
15606
|
+
var AppearsItem = z12.union([z12.number(), z12.object({ scene: z12.number(), edge: z12.string().optional() }).loose()]);
|
|
15607
|
+
var RecurringElement = z12.object({
|
|
15775
15608
|
// person | animal | product | logo | badge | other
|
|
15776
|
-
type:
|
|
15777
|
-
label:
|
|
15778
|
-
description:
|
|
15779
|
-
expression:
|
|
15609
|
+
type: z12.string(),
|
|
15610
|
+
label: z12.string().optional(),
|
|
15611
|
+
description: z12.string().optional(),
|
|
15612
|
+
expression: z12.string().nullable().optional(),
|
|
15780
15613
|
// When the element maps to a global cast entry, its stable id (for annotation).
|
|
15781
|
-
cast_id:
|
|
15614
|
+
cast_id: z12.string().nullable().optional(),
|
|
15782
15615
|
// The label of another element that is the SAME individual as this one, shown
|
|
15783
15616
|
// in a DIFFERENT wardrobe/persona/state (e.g. one creator playing skeptic in a
|
|
15784
15617
|
// pink shirt and believer in a white shirt). Each look gets its own reference
|
|
15785
15618
|
// slot, but the face/identity must stay identical across them.
|
|
15786
|
-
same_as:
|
|
15619
|
+
same_as: z12.string().nullable().optional(),
|
|
15787
15620
|
// Scenes the element appears in. Either a bare list of scene indices (both
|
|
15788
15621
|
// edges) or per-{scene,edge} entries. Both forms are accepted and merged.
|
|
15789
|
-
scenes:
|
|
15790
|
-
appears_in:
|
|
15622
|
+
scenes: z12.array(z12.number()).optional(),
|
|
15623
|
+
appears_in: z12.array(AppearsItem).optional()
|
|
15791
15624
|
}).loose();
|
|
15792
|
-
var RecurringElements =
|
|
15625
|
+
var RecurringElements = z12.array(RecurringElement);
|
|
15793
15626
|
function sanitizeId2(raw, fallback) {
|
|
15794
15627
|
const id = raw.toLowerCase().replace(/[^a-z0-9]+/g, "_").replace(/^_+|_+$/g, "");
|
|
15795
15628
|
return /^[a-z]/.test(id) ? id : `${fallback}_${id}`.replace(/_+$/g, "") || fallback;
|
|
@@ -16207,7 +16040,7 @@ function scrubFloatSentences(text, floatDescs) {
|
|
|
16207
16040
|
return kept;
|
|
16208
16041
|
}
|
|
16209
16042
|
function sceneFloatDescs(scene) {
|
|
16210
|
-
const floats =
|
|
16043
|
+
const floats = z12.array(FloatingElement).safeParse(scene.floating_elements ?? []);
|
|
16211
16044
|
if (!floats.success) return [];
|
|
16212
16045
|
return floats.data.map((f) => f.description?.trim() ?? "").filter(Boolean);
|
|
16213
16046
|
}
|
|
@@ -17547,25 +17380,25 @@ function buildSfxMusic(blueprint, nodes) {
|
|
|
17547
17380
|
}
|
|
17548
17381
|
return tracks;
|
|
17549
17382
|
}
|
|
17550
|
-
var OverlayStyle =
|
|
17551
|
-
var Overlay =
|
|
17552
|
-
text:
|
|
17553
|
-
appears_at_s:
|
|
17554
|
-
duration_s:
|
|
17555
|
-
position:
|
|
17556
|
-
role:
|
|
17557
|
-
animation:
|
|
17558
|
-
animation_detail:
|
|
17383
|
+
var OverlayStyle = z12.object({ color_hex: z12.string().optional(), background: z12.string().optional(), size: z12.string().optional() }).loose();
|
|
17384
|
+
var Overlay = z12.object({
|
|
17385
|
+
text: z12.string().optional(),
|
|
17386
|
+
appears_at_s: z12.number().optional(),
|
|
17387
|
+
duration_s: z12.number().optional(),
|
|
17388
|
+
position: z12.string().optional(),
|
|
17389
|
+
role: z12.string().optional(),
|
|
17390
|
+
animation: z12.string().optional(),
|
|
17391
|
+
animation_detail: z12.string().optional(),
|
|
17559
17392
|
style: OverlayStyle.optional()
|
|
17560
17393
|
}).loose();
|
|
17561
|
-
var FloatingElement =
|
|
17562
|
-
kind:
|
|
17563
|
-
description:
|
|
17564
|
-
brand_name:
|
|
17565
|
-
what_it_represents:
|
|
17566
|
-
appears_at_s:
|
|
17567
|
-
duration_s:
|
|
17568
|
-
position:
|
|
17394
|
+
var FloatingElement = z12.object({
|
|
17395
|
+
kind: z12.string().optional(),
|
|
17396
|
+
description: z12.string().optional(),
|
|
17397
|
+
brand_name: z12.string().nullish(),
|
|
17398
|
+
what_it_represents: z12.string().optional(),
|
|
17399
|
+
appears_at_s: z12.number().optional(),
|
|
17400
|
+
duration_s: z12.number().optional(),
|
|
17401
|
+
position: z12.string().optional()
|
|
17569
17402
|
}).loose();
|
|
17570
17403
|
function escapeHtml(s) {
|
|
17571
17404
|
return s.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
@@ -17597,7 +17430,7 @@ function positionClass(position) {
|
|
|
17597
17430
|
function collectCaptions(blueprint) {
|
|
17598
17431
|
return blueprint.scenes.flatMap((scene) => {
|
|
17599
17432
|
const sceneStart = scene.start_s ?? 0;
|
|
17600
|
-
const overlays =
|
|
17433
|
+
const overlays = z12.array(Overlay).safeParse(scene.overlays ?? []);
|
|
17601
17434
|
return overlays.success ? overlays.data.filter((ov) => Boolean(ov.text?.trim())).map((ov) => {
|
|
17602
17435
|
const at = ov.appears_at_s ?? sceneStart;
|
|
17603
17436
|
return { text: ov.text.trim(), at, end: at + (ov.duration_s ?? 2.5), ov };
|
|
@@ -17677,7 +17510,7 @@ function collectFloatWindows(blueprint, uiRouted) {
|
|
|
17677
17510
|
const windows = /* @__PURE__ */ new Map();
|
|
17678
17511
|
blueprint.scenes.forEach((scene, i) => {
|
|
17679
17512
|
const sceneStart = scene.start_s ?? 0;
|
|
17680
|
-
const floats =
|
|
17513
|
+
const floats = z12.array(FloatingElement).safeParse(scene.floating_elements ?? []);
|
|
17681
17514
|
if (!floats.success) return;
|
|
17682
17515
|
for (const fe of floats.data) {
|
|
17683
17516
|
const at = fe.appears_at_s ?? sceneStart;
|
|
@@ -18063,8 +17896,8 @@ function buildMotionBoard(blueprint) {
|
|
|
18063
17896
|
const end_s = scene.end_s ?? start_s + sceneDurationS(scene);
|
|
18064
17897
|
cursor = end_s;
|
|
18065
17898
|
const spoken = sceneSpokenText(scene);
|
|
18066
|
-
const overlays =
|
|
18067
|
-
const floats =
|
|
17899
|
+
const overlays = z12.array(Overlay).safeParse(scene.overlays ?? []);
|
|
17900
|
+
const floats = z12.array(FloatingElement).safeParse(scene.floating_elements ?? []);
|
|
18068
17901
|
const graphics = [
|
|
18069
17902
|
...(overlays.success ? overlays.data : []).filter((ov) => ov.text?.trim()).map((ov) => ({
|
|
18070
17903
|
kind: "text",
|
|
@@ -23980,338 +23813,11 @@ var schemaCommand = defineCommand147({
|
|
|
23980
23813
|
}
|
|
23981
23814
|
});
|
|
23982
23815
|
|
|
23983
|
-
// src/commands/tags/index.ts
|
|
23984
|
-
import { defineCommand as defineCommand148 } from "citty";
|
|
23985
|
-
|
|
23986
|
-
// src/commands/tags/shared.ts
|
|
23987
|
-
function failValidation3(message) {
|
|
23988
|
-
writeJson({ ok: false, error: { code: "VALIDATION_ERROR", message } });
|
|
23989
|
-
process.exit(1);
|
|
23990
|
-
}
|
|
23991
|
-
function failApi3(err) {
|
|
23992
|
-
if (err instanceof ApiError) {
|
|
23993
|
-
writeJson({ ok: false, error: { code: err.code, message: err.message } });
|
|
23994
|
-
process.exit(1);
|
|
23995
|
-
}
|
|
23996
|
-
if (err instanceof Error) {
|
|
23997
|
-
writeJson({ ok: false, error: { code: "INTERNAL_ERROR", message: err.message } });
|
|
23998
|
-
process.exit(1);
|
|
23999
|
-
}
|
|
24000
|
-
writeJson({ ok: false, error: { code: "INTERNAL_ERROR", message: "Unexpected error" } });
|
|
24001
|
-
process.exit(1);
|
|
24002
|
-
}
|
|
24003
|
-
function parseTagType(value) {
|
|
24004
|
-
const parsed = tagTypeSchema.safeParse(value);
|
|
24005
|
-
if (!parsed.success) {
|
|
24006
|
-
failValidation3(`Unknown tag type "${value}". Valid types: ${TAG_TYPES.join(", ")}.`);
|
|
24007
|
-
}
|
|
24008
|
-
return parsed.data;
|
|
24009
|
-
}
|
|
24010
|
-
function toArray(value) {
|
|
24011
|
-
if (value === void 0 || typeof value === "boolean") {
|
|
24012
|
-
return [];
|
|
24013
|
-
}
|
|
24014
|
-
return Array.isArray(value) ? value : [value];
|
|
24015
|
-
}
|
|
24016
|
-
function parseSetArgs(value) {
|
|
24017
|
-
const config = {};
|
|
24018
|
-
for (const entry of toArray(value)) {
|
|
24019
|
-
const eq = entry.indexOf("=");
|
|
24020
|
-
if (eq <= 0) {
|
|
24021
|
-
failValidation3(`--set expects key=value, got "${entry}".`);
|
|
24022
|
-
}
|
|
24023
|
-
config[entry.slice(0, eq)] = entry.slice(eq + 1);
|
|
24024
|
-
}
|
|
24025
|
-
return config;
|
|
24026
|
-
}
|
|
24027
|
-
function parseListArg(value) {
|
|
24028
|
-
return toArray(value).flatMap(
|
|
24029
|
-
(entry) => entry.split(",").map((item) => item.trim()).filter((item) => item !== "")
|
|
24030
|
-
);
|
|
24031
|
-
}
|
|
24032
|
-
function rejectSecretSets(type, config) {
|
|
24033
|
-
const secretFields = TAG_SECRET_FIELDS[type];
|
|
24034
|
-
const offending = Object.keys(config).filter((key) => secretFields.includes(key));
|
|
24035
|
-
if (offending.length > 0) {
|
|
24036
|
-
failValidation3(
|
|
24037
|
-
`${offending.join(", ")} ${offending.length === 1 ? "is a secret field" : "are secret fields"} \u2014 never pass secret values on the command line. Re-run with --request-secret ${offending[0]} and the user will provide it via the secure tag form in the chat.`
|
|
24038
|
-
);
|
|
24039
|
-
}
|
|
24040
|
-
}
|
|
24041
|
-
function validateRequestSecrets(type, fields) {
|
|
24042
|
-
const requestable = TAG_REQUESTABLE_SECRET_FIELDS[type];
|
|
24043
|
-
const invalid = fields.filter((field) => !requestable.includes(field));
|
|
24044
|
-
if (invalid.length > 0) {
|
|
24045
|
-
failValidation3(
|
|
24046
|
-
`Cannot request ${invalid.join(", ")} for a ${type} tag. Requestable secret fields: ${requestable.length > 0 ? requestable.join(", ") : "(none \u2014 this type has no secret fields)"}.`
|
|
24047
|
-
);
|
|
24048
|
-
}
|
|
24049
|
-
}
|
|
24050
|
-
function renderEffectiveEntry(entry) {
|
|
24051
|
-
const parts = [entry.ref, entry.type];
|
|
24052
|
-
if (entry.identifier !== void 0) {
|
|
24053
|
-
parts.push(entry.identifier);
|
|
24054
|
-
}
|
|
24055
|
-
if (entry.staged !== void 0) {
|
|
24056
|
-
parts.push(`[staged: ${entry.staged}]`);
|
|
24057
|
-
}
|
|
24058
|
-
const secretBits = [
|
|
24059
|
-
...entry.secretsSet.map((field) => `${field} \u2713 set`),
|
|
24060
|
-
...entry.secretsPending.map((field) => `${field} \u23F3 pending`)
|
|
24061
|
-
];
|
|
24062
|
-
if (secretBits.length > 0) {
|
|
24063
|
-
parts.push(`[secrets: ${secretBits.join(", ")}]`);
|
|
24064
|
-
}
|
|
24065
|
-
return parts.join(" ");
|
|
24066
|
-
}
|
|
24067
|
-
|
|
24068
|
-
// src/commands/tags/index.ts
|
|
24069
|
-
registerSchema({
|
|
24070
|
-
command: "tags.list",
|
|
24071
|
-
description: "Effective marketing tags for this chat: production tags overlaid with the ops staged in this chat's draft. The printed refs (tag ids or tag_temp_*) are exactly what flow side-effect tagIds should reference.",
|
|
24072
|
-
args: {
|
|
24073
|
-
json: { type: "boolean", description: "Print the raw JSON envelope instead of the readable list", required: false }
|
|
24074
|
-
}
|
|
24075
|
-
});
|
|
24076
|
-
registerSchema({
|
|
24077
|
-
command: "tags.add",
|
|
24078
|
-
description: "Stage creation of a marketing tag (applies when the chat publishes). Set every non-secret field with --set; request secret fields (API keys, tokens, OAuth connections) with --request-secret \u2014 the user provides them via the secure tag form in the chat, never through the CLI.",
|
|
24079
|
-
args: {
|
|
24080
|
-
type: {
|
|
24081
|
-
type: "positional",
|
|
24082
|
-
description: "Tag type (see `baker tags list` output / meta, googleAnalytics, clarity, \u2026)",
|
|
24083
|
-
required: true
|
|
24084
|
-
},
|
|
24085
|
-
set: { type: "string", description: "Repeatable key=value for non-secret config fields", required: false },
|
|
24086
|
-
"request-secret": {
|
|
24087
|
-
type: "string",
|
|
24088
|
-
description: "Repeatable secret field name to request from the user",
|
|
24089
|
-
required: false
|
|
24090
|
-
}
|
|
24091
|
-
}
|
|
24092
|
-
});
|
|
24093
|
-
registerSchema({
|
|
24094
|
-
command: "tags.update",
|
|
24095
|
-
description: "Stage an update to a tag by ref (real tag id, or tag_temp_* to amend a create staged in this chat). --set patches fields, --clear removes them, --request-secret asks the user for secret values.",
|
|
24096
|
-
args: {
|
|
24097
|
-
ref: { type: "positional", description: "Tag ref from `baker tags list`", required: true },
|
|
24098
|
-
set: { type: "string", description: "Repeatable key=value for non-secret config fields", required: false },
|
|
24099
|
-
clear: { type: "string", description: "Repeatable field name to clear", required: false },
|
|
24100
|
-
"request-secret": {
|
|
24101
|
-
type: "string",
|
|
24102
|
-
description: "Repeatable secret field name to request from the user",
|
|
24103
|
-
required: false
|
|
24104
|
-
}
|
|
24105
|
-
}
|
|
24106
|
-
});
|
|
24107
|
-
registerSchema({
|
|
24108
|
-
command: "tags.remove",
|
|
24109
|
-
description: "Stage deletion of a tag by ref (applies on publish). Removing a tag_temp_* ref drops the staged create instead.",
|
|
24110
|
-
args: { ref: { type: "positional", description: "Tag ref from `baker tags list`", required: true } }
|
|
24111
|
-
});
|
|
24112
|
-
async function listTags(json) {
|
|
24113
|
-
try {
|
|
24114
|
-
const chatId = requireChatId();
|
|
24115
|
-
const response = await apiPost("/api/tags/list", { chatId });
|
|
24116
|
-
if (json) {
|
|
24117
|
-
writeJson({ ok: true, data: response });
|
|
24118
|
-
return;
|
|
24119
|
-
}
|
|
24120
|
-
if (response.tags.length === 0) {
|
|
24121
|
-
process.stdout.write("No tags configured. Stage one with `baker tags add <type> --set key=value`.\n");
|
|
24122
|
-
return;
|
|
24123
|
-
}
|
|
24124
|
-
process.stdout.write(`${response.tags.map(renderEffectiveEntry).join("\n")}
|
|
24125
|
-
`);
|
|
24126
|
-
} catch (err) {
|
|
24127
|
-
failApi3(err);
|
|
24128
|
-
}
|
|
24129
|
-
}
|
|
24130
|
-
var listCommand7 = defineCommand148({
|
|
24131
|
-
meta: {
|
|
24132
|
-
name: "list",
|
|
24133
|
-
description: "Effective tags for this chat (production + staged). Refs printed here are what flow side-effect tagIds should use. Example: baker tags list"
|
|
24134
|
-
},
|
|
24135
|
-
args: { json: { type: "boolean", description: "Print the raw JSON envelope instead of the readable list" } },
|
|
24136
|
-
run: async ({ args }) => {
|
|
24137
|
-
await listTags(args.json === true);
|
|
24138
|
-
}
|
|
24139
|
-
});
|
|
24140
|
-
async function stage(body) {
|
|
24141
|
-
try {
|
|
24142
|
-
const response = await apiPost("/api/tags/draft/stage", body);
|
|
24143
|
-
writeJson({ ok: true, data: response });
|
|
24144
|
-
} catch (err) {
|
|
24145
|
-
failApi3(err);
|
|
24146
|
-
}
|
|
24147
|
-
}
|
|
24148
|
-
var addCommand2 = defineCommand148({
|
|
24149
|
-
meta: {
|
|
24150
|
-
name: "add",
|
|
24151
|
-
description: "Stage a new tag (applies on publish). Secret fields are never passed here \u2014 use --request-secret and the user fills them in the chat's secure tag form. Example: baker tags add meta --set pixelId=123456 --request-secret accessToken"
|
|
24152
|
-
},
|
|
24153
|
-
args: {
|
|
24154
|
-
type: {
|
|
24155
|
-
type: "positional",
|
|
24156
|
-
description: "Tag type (meta, googleAnalytics, googleAds, clarity, \u2026)",
|
|
24157
|
-
required: true
|
|
24158
|
-
},
|
|
24159
|
-
set: { type: "string", description: "key=value for a non-secret config field (repeatable)" },
|
|
24160
|
-
"request-secret": { type: "string", description: "Secret field name the user should provide (repeatable)" }
|
|
24161
|
-
},
|
|
24162
|
-
run: async ({ args }) => {
|
|
24163
|
-
const type = parseTagType(args.type);
|
|
24164
|
-
const config = parseSetArgs(args.set);
|
|
24165
|
-
const requestSecrets = parseListArg(args["request-secret"]);
|
|
24166
|
-
rejectSecretSets(type, config);
|
|
24167
|
-
validateRequestSecrets(type, requestSecrets);
|
|
24168
|
-
const chatId = requireChatId();
|
|
24169
|
-
await stage({
|
|
24170
|
-
kind: "create",
|
|
24171
|
-
chatId,
|
|
24172
|
-
type,
|
|
24173
|
-
config,
|
|
24174
|
-
...requestSecrets.length > 0 ? { requestSecrets } : {}
|
|
24175
|
-
});
|
|
24176
|
-
}
|
|
24177
|
-
});
|
|
24178
|
-
var updateCommand3 = defineCommand148({
|
|
24179
|
-
meta: {
|
|
24180
|
-
name: "update",
|
|
24181
|
-
description: "Stage an update to a tag. A tag_temp_* ref amends the create staged in this chat. Example: baker tags update <ref> --set pixelId=999 --clear testEventCode"
|
|
24182
|
-
},
|
|
24183
|
-
args: {
|
|
24184
|
-
ref: { type: "positional", description: "Tag ref from `baker tags list`", required: true },
|
|
24185
|
-
set: { type: "string", description: "key=value patch for a non-secret config field (repeatable)" },
|
|
24186
|
-
clear: { type: "string", description: "Field name to clear (repeatable)" },
|
|
24187
|
-
"request-secret": { type: "string", description: "Secret field name the user should provide (repeatable)" }
|
|
24188
|
-
},
|
|
24189
|
-
run: async ({ args }) => {
|
|
24190
|
-
const config = parseSetArgs(args.set);
|
|
24191
|
-
const clearFields = parseListArg(args.clear);
|
|
24192
|
-
const requestSecrets = parseListArg(args["request-secret"]);
|
|
24193
|
-
if (Object.keys(config).length === 0 && clearFields.length === 0 && requestSecrets.length === 0) {
|
|
24194
|
-
failValidation3("Nothing to update \u2014 pass --set, --clear, or --request-secret.");
|
|
24195
|
-
}
|
|
24196
|
-
const chatId = requireChatId();
|
|
24197
|
-
await stage({
|
|
24198
|
-
kind: "update",
|
|
24199
|
-
chatId,
|
|
24200
|
-
ref: args.ref,
|
|
24201
|
-
...Object.keys(config).length > 0 ? { config } : {},
|
|
24202
|
-
...clearFields.length > 0 ? { clearFields } : {},
|
|
24203
|
-
...requestSecrets.length > 0 ? { requestSecrets } : {}
|
|
24204
|
-
});
|
|
24205
|
-
}
|
|
24206
|
-
});
|
|
24207
|
-
var removeCommand5 = defineCommand148({
|
|
24208
|
-
meta: {
|
|
24209
|
-
name: "remove",
|
|
24210
|
-
description: "Stage deletion of a tag (applies on publish). Removing a tag_temp_* ref drops the staged create instead. Example: baker tags remove <ref>"
|
|
24211
|
-
},
|
|
24212
|
-
args: { ref: { type: "positional", description: "Tag ref from `baker tags list`", required: true } },
|
|
24213
|
-
run: async ({ args }) => {
|
|
24214
|
-
const chatId = requireChatId();
|
|
24215
|
-
await stage({ kind: "delete", chatId, ref: args.ref });
|
|
24216
|
-
}
|
|
24217
|
-
});
|
|
24218
|
-
async function listDraft3() {
|
|
24219
|
-
try {
|
|
24220
|
-
const chatId = requireChatId();
|
|
24221
|
-
const response = await apiPost("/api/tags/draft", { chatId });
|
|
24222
|
-
writeJson({ ok: true, data: response });
|
|
24223
|
-
} catch (err) {
|
|
24224
|
-
failApi3(err);
|
|
24225
|
-
}
|
|
24226
|
-
}
|
|
24227
|
-
var draftListCommand = defineCommand148({
|
|
24228
|
-
meta: { name: "list", description: "Review the tag ops staged in this chat. Example: baker tags draft" },
|
|
24229
|
-
run: async () => {
|
|
24230
|
-
await listDraft3();
|
|
24231
|
-
}
|
|
24232
|
-
});
|
|
24233
|
-
var draftRemoveCommand = defineCommand148({
|
|
24234
|
-
meta: {
|
|
24235
|
-
name: "remove",
|
|
24236
|
-
description: "Drop one staged tag op by ref. Example: baker tags draft remove tag_temp_abc123"
|
|
24237
|
-
},
|
|
24238
|
-
args: { ref: { type: "positional", description: "Staged op ref", required: true } },
|
|
24239
|
-
run: async ({ args }) => {
|
|
24240
|
-
try {
|
|
24241
|
-
const chatId = requireChatId();
|
|
24242
|
-
const response = await apiPost("/api/tags/draft/remove", {
|
|
24243
|
-
chatId,
|
|
24244
|
-
ref: args.ref
|
|
24245
|
-
});
|
|
24246
|
-
writeJson({ ok: true, data: response });
|
|
24247
|
-
} catch (err) {
|
|
24248
|
-
failApi3(err);
|
|
24249
|
-
}
|
|
24250
|
-
}
|
|
24251
|
-
});
|
|
24252
|
-
var draftClearCommand = defineCommand148({
|
|
24253
|
-
meta: {
|
|
24254
|
-
name: "clear",
|
|
24255
|
-
description: "Drop ALL tag ops staged in this chat \u2014 nothing will apply on publish. Example: baker tags draft clear"
|
|
24256
|
-
},
|
|
24257
|
-
run: async () => {
|
|
24258
|
-
try {
|
|
24259
|
-
const chatId = requireChatId();
|
|
24260
|
-
const response = await apiPost("/api/tags/draft/clear", { chatId });
|
|
24261
|
-
writeJson({ ok: true, data: response });
|
|
24262
|
-
} catch (err) {
|
|
24263
|
-
failApi3(err);
|
|
24264
|
-
}
|
|
24265
|
-
}
|
|
24266
|
-
});
|
|
24267
|
-
var draftCommand3 = defineCommand148({
|
|
24268
|
-
meta: {
|
|
24269
|
-
name: "draft",
|
|
24270
|
-
description: "Review and edit the tag ops staged in this chat BEFORE publish. Subcommands: list (default), remove, clear. Ops never touch production tags until the chat is published."
|
|
24271
|
-
},
|
|
24272
|
-
subCommands: {
|
|
24273
|
-
list: draftListCommand,
|
|
24274
|
-
remove: draftRemoveCommand,
|
|
24275
|
-
clear: draftClearCommand
|
|
24276
|
-
},
|
|
24277
|
-
run: async () => {
|
|
24278
|
-
await listDraft3();
|
|
24279
|
-
}
|
|
24280
|
-
});
|
|
24281
|
-
var tagsCommand3 = defineCommand148({
|
|
24282
|
-
meta: {
|
|
24283
|
-
name: "tags",
|
|
24284
|
-
description: `Manage the client's marketing/analytics tags (Meta pixel, GA4, Google Ads, GTM, Clarity, Hotjar, \u2026) as per-chat STAGED changes \u2014 nothing touches production until the chat is published.
|
|
24285
|
-
|
|
24286
|
-
Secrets: secret fields (accessToken, apiSecret, authorizationToken, apiKey, conversionToken, oauthProviderId) are NEVER typed into chat or passed to this CLI. Stage with --request-secret <field>, then invoke the request_tag_input tool (baker_ui) so the user fills them in the dashboard's secure tag form.
|
|
24287
|
-
|
|
24288
|
-
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.
|
|
24289
|
-
|
|
24290
|
-
Examples:
|
|
24291
|
-
baker tags list # production + staged, with secret status
|
|
24292
|
-
baker tags add clarity --set projectId=abcde12345 # client-only tag, no secrets needed
|
|
24293
|
-
baker tags add meta --set pixelId=123 --request-secret accessToken
|
|
24294
|
-
baker tags update <ref> --set pixelId=999 --clear testEventCode
|
|
24295
|
-
baker tags remove <ref> # stage deletion (temp ref = drop the create)
|
|
24296
|
-
baker tags draft # review staged ops before finishing`
|
|
24297
|
-
},
|
|
24298
|
-
subCommands: {
|
|
24299
|
-
list: listCommand7,
|
|
24300
|
-
add: addCommand2,
|
|
24301
|
-
update: updateCommand3,
|
|
24302
|
-
remove: removeCommand5,
|
|
24303
|
-
draft: draftCommand3
|
|
24304
|
-
},
|
|
24305
|
-
run: async () => {
|
|
24306
|
-
await listTags(false);
|
|
24307
|
-
}
|
|
24308
|
-
});
|
|
24309
|
-
|
|
24310
23816
|
// src/commands/testimonials/index.ts
|
|
24311
|
-
import { defineCommand as
|
|
23817
|
+
import { defineCommand as defineCommand151 } from "citty";
|
|
24312
23818
|
|
|
24313
23819
|
// src/commands/testimonials/get.ts
|
|
24314
|
-
import { defineCommand as
|
|
23820
|
+
import { defineCommand as defineCommand148 } from "citty";
|
|
24315
23821
|
registerSchema({
|
|
24316
23822
|
command: "testimonials.get",
|
|
24317
23823
|
description: "Get a single testimonial by ID",
|
|
@@ -24319,7 +23825,7 @@ registerSchema({
|
|
|
24319
23825
|
id: { type: "string", description: "Testimonial ID", required: true }
|
|
24320
23826
|
}
|
|
24321
23827
|
});
|
|
24322
|
-
var getCommand4 =
|
|
23828
|
+
var getCommand4 = defineCommand148({
|
|
24323
23829
|
meta: { name: "get", description: "Get a single testimonial by ID. Example: baker testimonials get j571abc123" },
|
|
24324
23830
|
args: {
|
|
24325
23831
|
id: { type: "positional", description: "Testimonial ID", required: false },
|
|
@@ -24356,7 +23862,7 @@ var getCommand4 = defineCommand149({
|
|
|
24356
23862
|
});
|
|
24357
23863
|
|
|
24358
23864
|
// src/commands/testimonials/list.ts
|
|
24359
|
-
import { defineCommand as
|
|
23865
|
+
import { defineCommand as defineCommand149 } from "citty";
|
|
24360
23866
|
registerSchema({
|
|
24361
23867
|
command: "testimonials.list",
|
|
24362
23868
|
description: "List testimonials with optional filters.",
|
|
@@ -24386,7 +23892,7 @@ registerSchema({
|
|
|
24386
23892
|
limit: { type: "number", description: "Max results (default 50)", required: false, default: 50 }
|
|
24387
23893
|
}
|
|
24388
23894
|
});
|
|
24389
|
-
var
|
|
23895
|
+
var listCommand7 = defineCommand149({
|
|
24390
23896
|
meta: {
|
|
24391
23897
|
name: "list",
|
|
24392
23898
|
description: "List testimonials with optional filters. Example: baker testimonials list --source google --sentiment positive"
|
|
@@ -24435,7 +23941,7 @@ var listCommand8 = defineCommand150({
|
|
|
24435
23941
|
});
|
|
24436
23942
|
|
|
24437
23943
|
// src/commands/testimonials/search.ts
|
|
24438
|
-
import { defineCommand as
|
|
23944
|
+
import { defineCommand as defineCommand150 } from "citty";
|
|
24439
23945
|
registerSchema({
|
|
24440
23946
|
command: "testimonials.search",
|
|
24441
23947
|
description: "Search testimonials by text query. Uses hybrid BM25 + vector + reranking.",
|
|
@@ -24466,7 +23972,7 @@ registerSchema({
|
|
|
24466
23972
|
tags: { type: "string", description: "Comma-separated tags to filter by", required: false }
|
|
24467
23973
|
}
|
|
24468
23974
|
});
|
|
24469
|
-
var searchCommand2 =
|
|
23975
|
+
var searchCommand2 = defineCommand150({
|
|
24470
23976
|
meta: {
|
|
24471
23977
|
name: "search",
|
|
24472
23978
|
description: "Semantic search testimonials by text query. Uses hybrid BM25 + vector + reranking. Example: baker testimonials search 'great service' --rating-min 4"
|
|
@@ -24537,10 +24043,10 @@ var searchCommand2 = defineCommand151({
|
|
|
24537
24043
|
});
|
|
24538
24044
|
|
|
24539
24045
|
// src/commands/testimonials/tags.ts
|
|
24540
|
-
var
|
|
24046
|
+
var tagsCommand3 = makeTagsCommand("testimonials", "testimonial", "/api/testimonials/tags");
|
|
24541
24047
|
|
|
24542
24048
|
// src/commands/testimonials/index.ts
|
|
24543
|
-
var testimonialsCommand =
|
|
24049
|
+
var testimonialsCommand = defineCommand151({
|
|
24544
24050
|
meta: {
|
|
24545
24051
|
name: "testimonials",
|
|
24546
24052
|
description: `Find and browse testimonials in Baker. Subcommands: search, get, list, tags.
|
|
@@ -24555,16 +24061,16 @@ Examples:
|
|
|
24555
24061
|
subCommands: {
|
|
24556
24062
|
get: getCommand4,
|
|
24557
24063
|
search: searchCommand2,
|
|
24558
|
-
list:
|
|
24559
|
-
tags:
|
|
24064
|
+
list: listCommand7,
|
|
24065
|
+
tags: tagsCommand3
|
|
24560
24066
|
}
|
|
24561
24067
|
});
|
|
24562
24068
|
|
|
24563
24069
|
// src/commands/videos/index.ts
|
|
24564
|
-
import { defineCommand as
|
|
24070
|
+
import { defineCommand as defineCommand156 } from "citty";
|
|
24565
24071
|
|
|
24566
24072
|
// src/commands/videos/delete.ts
|
|
24567
|
-
import { defineCommand as
|
|
24073
|
+
import { defineCommand as defineCommand152 } from "citty";
|
|
24568
24074
|
registerSchema({
|
|
24569
24075
|
command: "videos.delete",
|
|
24570
24076
|
description: "Delete a video by ID",
|
|
@@ -24578,7 +24084,7 @@ registerSchema({
|
|
|
24578
24084
|
}
|
|
24579
24085
|
}
|
|
24580
24086
|
});
|
|
24581
|
-
var deleteCommand3 =
|
|
24087
|
+
var deleteCommand3 = defineCommand152({
|
|
24582
24088
|
meta: {
|
|
24583
24089
|
name: "delete",
|
|
24584
24090
|
description: "Delete a video by ID. Use --dry-run to preview. Example: baker videos delete j571abc123 --dry-run"
|
|
@@ -24619,7 +24125,7 @@ var deleteCommand3 = defineCommand153({
|
|
|
24619
24125
|
});
|
|
24620
24126
|
|
|
24621
24127
|
// src/commands/videos/get.ts
|
|
24622
|
-
import { defineCommand as
|
|
24128
|
+
import { defineCommand as defineCommand153 } from "citty";
|
|
24623
24129
|
registerSchema({
|
|
24624
24130
|
command: "videos.get",
|
|
24625
24131
|
description: "Get a single video by ID",
|
|
@@ -24627,7 +24133,7 @@ registerSchema({
|
|
|
24627
24133
|
id: { type: "string", description: "Video ID", required: true }
|
|
24628
24134
|
}
|
|
24629
24135
|
});
|
|
24630
|
-
var getCommand5 =
|
|
24136
|
+
var getCommand5 = defineCommand153({
|
|
24631
24137
|
meta: { name: "get", description: "Get a single video by ID. Example: baker videos get j571abc123" },
|
|
24632
24138
|
args: {
|
|
24633
24139
|
id: { type: "positional", description: "Video ID", required: false },
|
|
@@ -24664,7 +24170,7 @@ var getCommand5 = defineCommand154({
|
|
|
24664
24170
|
});
|
|
24665
24171
|
|
|
24666
24172
|
// src/commands/videos/search.ts
|
|
24667
|
-
import { defineCommand as
|
|
24173
|
+
import { defineCommand as defineCommand154 } from "citty";
|
|
24668
24174
|
registerSchema({
|
|
24669
24175
|
command: "videos.search",
|
|
24670
24176
|
description: "Search videos by text query. Only returns ready videos.",
|
|
@@ -24674,7 +24180,7 @@ registerSchema({
|
|
|
24674
24180
|
tags: { type: "string", description: "Comma-separated tags to filter by", required: false }
|
|
24675
24181
|
}
|
|
24676
24182
|
});
|
|
24677
|
-
var searchCommand3 =
|
|
24183
|
+
var searchCommand3 = defineCommand154({
|
|
24678
24184
|
meta: {
|
|
24679
24185
|
name: "search",
|
|
24680
24186
|
description: "Semantic search videos by text query. Uses hybrid BM25 + vector + reranking. Example: baker videos search 'product demo' --tags tutorial"
|
|
@@ -24721,12 +24227,12 @@ var searchCommand3 = defineCommand155({
|
|
|
24721
24227
|
});
|
|
24722
24228
|
|
|
24723
24229
|
// src/commands/videos/tags.ts
|
|
24724
|
-
var
|
|
24230
|
+
var tagsCommand4 = makeTagsCommand("videos", "video", "/api/videos/tags");
|
|
24725
24231
|
|
|
24726
24232
|
// src/commands/videos/upload.ts
|
|
24727
24233
|
import { readFile as readFile12, stat as stat3 } from "fs/promises";
|
|
24728
24234
|
import { extname as extname3 } from "path";
|
|
24729
|
-
import { defineCommand as
|
|
24235
|
+
import { defineCommand as defineCommand155 } from "citty";
|
|
24730
24236
|
var MIME_MAP = {
|
|
24731
24237
|
".mp4": "video/mp4",
|
|
24732
24238
|
".mov": "video/quicktime",
|
|
@@ -24760,7 +24266,7 @@ function detectContentType(filePath) {
|
|
|
24760
24266
|
}
|
|
24761
24267
|
return mime;
|
|
24762
24268
|
}
|
|
24763
|
-
var uploadCommand2 =
|
|
24269
|
+
var uploadCommand2 = defineCommand155({
|
|
24764
24270
|
meta: {
|
|
24765
24271
|
name: "upload",
|
|
24766
24272
|
description: "Upload a video file to Baker via Mux direct upload. Auto-detects content type. Example: baker videos upload ./demo.mp4"
|
|
@@ -24814,7 +24320,7 @@ var uploadCommand2 = defineCommand156({
|
|
|
24814
24320
|
});
|
|
24815
24321
|
|
|
24816
24322
|
// src/commands/videos/index.ts
|
|
24817
|
-
var videosCommand =
|
|
24323
|
+
var videosCommand = defineCommand156({
|
|
24818
24324
|
meta: {
|
|
24819
24325
|
name: "videos",
|
|
24820
24326
|
description: `Find and manage videos in Baker. Subcommands: search, get, upload, delete, tags.
|
|
@@ -24832,15 +24338,15 @@ Examples:
|
|
|
24832
24338
|
search: searchCommand3,
|
|
24833
24339
|
upload: uploadCommand2,
|
|
24834
24340
|
delete: deleteCommand3,
|
|
24835
|
-
tags:
|
|
24341
|
+
tags: tagsCommand4
|
|
24836
24342
|
}
|
|
24837
24343
|
});
|
|
24838
24344
|
|
|
24839
24345
|
// src/commands/winning-ads/index.ts
|
|
24840
|
-
import { defineCommand as
|
|
24346
|
+
import { defineCommand as defineCommand159 } from "citty";
|
|
24841
24347
|
|
|
24842
24348
|
// src/commands/winning-ads/advertisers.ts
|
|
24843
|
-
import { defineCommand as
|
|
24349
|
+
import { defineCommand as defineCommand157 } from "citty";
|
|
24844
24350
|
registerSchema({
|
|
24845
24351
|
command: "winning-ads.advertisers",
|
|
24846
24352
|
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).",
|
|
@@ -24853,7 +24359,7 @@ registerSchema({
|
|
|
24853
24359
|
function identity(record) {
|
|
24854
24360
|
return record;
|
|
24855
24361
|
}
|
|
24856
|
-
var advertisersCommand2 =
|
|
24362
|
+
var advertisersCommand2 = defineCommand157({
|
|
24857
24363
|
meta: {
|
|
24858
24364
|
name: "advertisers",
|
|
24859
24365
|
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'
|
|
@@ -24904,7 +24410,7 @@ var advertisersCommand2 = defineCommand158({
|
|
|
24904
24410
|
});
|
|
24905
24411
|
|
|
24906
24412
|
// src/commands/winning-ads/search.ts
|
|
24907
|
-
import { defineCommand as
|
|
24413
|
+
import { defineCommand as defineCommand158 } from "citty";
|
|
24908
24414
|
registerSchema({
|
|
24909
24415
|
command: "winning-ads.search",
|
|
24910
24416
|
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.",
|
|
@@ -25012,7 +24518,7 @@ function buildSearchBody(args) {
|
|
|
25012
24518
|
}
|
|
25013
24519
|
return body;
|
|
25014
24520
|
}
|
|
25015
|
-
var searchCommand4 =
|
|
24521
|
+
var searchCommand4 = defineCommand158({
|
|
25016
24522
|
meta: {
|
|
25017
24523
|
name: "search",
|
|
25018
24524
|
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"
|
|
@@ -25124,7 +24630,7 @@ var searchCommand4 = defineCommand159({
|
|
|
25124
24630
|
});
|
|
25125
24631
|
|
|
25126
24632
|
// src/commands/winning-ads/index.ts
|
|
25127
|
-
var winningAdsCommand =
|
|
24633
|
+
var winningAdsCommand = defineCommand159({
|
|
25128
24634
|
meta: {
|
|
25129
24635
|
name: "winning-ads",
|
|
25130
24636
|
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.
|
|
@@ -25164,11 +24670,11 @@ function getCliVersion() {
|
|
|
25164
24670
|
}
|
|
25165
24671
|
|
|
25166
24672
|
// src/cli.ts
|
|
25167
|
-
var main =
|
|
24673
|
+
var main = defineCommand160({
|
|
25168
24674
|
meta: {
|
|
25169
24675
|
name: "baker",
|
|
25170
24676
|
version: getCliVersion(),
|
|
25171
|
-
description: `AI-agent CLI for finding and managing images, videos, testimonials, action items, scheduled actions,
|
|
24677
|
+
description: `AI-agent CLI for finding and managing images, videos, testimonials, action items, scheduled actions, and ad platform data in Baker.
|
|
25172
24678
|
|
|
25173
24679
|
Auth: Set BAKER_API_KEY (starts with bk_) and BAKER_API_URL environment variables.
|
|
25174
24680
|
Chat: Set BAKER_CHAT_ID for action and scheduled-action commands that stage changes against a chat.
|
|
@@ -25188,7 +24694,6 @@ Introspection: Run 'baker schema <command>' to inspect argument schemas.`
|
|
|
25188
24694
|
videos: videosCommand,
|
|
25189
24695
|
testimonials: testimonialsCommand,
|
|
25190
24696
|
canvas: canvasCommand,
|
|
25191
|
-
tags: tagsCommand3,
|
|
25192
24697
|
"winning-ads": winningAdsCommand,
|
|
25193
24698
|
mcp: mcpCommand,
|
|
25194
24699
|
schema: schemaCommand
|