@koda-sl/baker-cli 0.379.0-dev.bfd923423 → 0.379.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 -2
- package/dist/{chunk-CHJOTJTZ.js → chunk-FGHMWBUD.js} +4 -4
- package/dist/chunk-FGHMWBUD.js.map +1 -0
- package/dist/{chunk-KAOU6QLP.js → chunk-VLUGGVJL.js} +9 -58
- package/dist/chunk-VLUGGVJL.js.map +1 -0
- package/dist/cli.js +107 -94
- package/dist/cli.js.map +1 -1
- package/dist/engine/index.js +1 -1
- package/dist/{shared-TD76Z3W2.js → shared-J7DQZ2ED.js} +2 -2
- package/package.json +1 -1
- package/dist/chunk-CHJOTJTZ.js.map +0 -1
- package/dist/chunk-KAOU6QLP.js.map +0 -1
- /package/dist/{shared-TD76Z3W2.js.map → shared-J7DQZ2ED.js.map} +0 -0
package/dist/cli.js
CHANGED
|
@@ -70,7 +70,7 @@ import {
|
|
|
70
70
|
validateCanvasDeep,
|
|
71
71
|
withoutCastName,
|
|
72
72
|
ytDlpBlockSignal
|
|
73
|
-
} from "./chunk-
|
|
73
|
+
} from "./chunk-FGHMWBUD.js";
|
|
74
74
|
import {
|
|
75
75
|
NAME_CONTAINS_ARG,
|
|
76
76
|
csvOrJson,
|
|
@@ -81,7 +81,7 @@ import {
|
|
|
81
81
|
resolveEffectiveStatus,
|
|
82
82
|
statusFilterHints,
|
|
83
83
|
todayIso
|
|
84
|
-
} from "./chunk-
|
|
84
|
+
} from "./chunk-VLUGGVJL.js";
|
|
85
85
|
import {
|
|
86
86
|
buildQueryCacheKey,
|
|
87
87
|
cacheGet,
|
|
@@ -24295,14 +24295,11 @@ Examples:
|
|
|
24295
24295
|
BAKER_META_AD_ACCOUNT_ID=act_123 baker ads meta account`
|
|
24296
24296
|
},
|
|
24297
24297
|
args: {
|
|
24298
|
-
"account-id": {
|
|
24299
|
-
type: "string",
|
|
24300
|
-
description: "Meta ad account ID (act_...); defaults to the only connected account"
|
|
24301
|
-
},
|
|
24298
|
+
"account-id": { type: "string", description: "Meta ad account ID (act_...)" },
|
|
24302
24299
|
"no-cache": NO_CACHE_ARG
|
|
24303
24300
|
},
|
|
24304
24301
|
run: async ({ args: args5 }) => {
|
|
24305
|
-
const accountId =
|
|
24302
|
+
const accountId = resolveAccountIdArg(args5);
|
|
24306
24303
|
try {
|
|
24307
24304
|
const params = { "account-id": accountId };
|
|
24308
24305
|
if (args5["no-cache"]) params["skip-cache"] = "true";
|
|
@@ -24540,7 +24537,7 @@ function registerMetaListSchema(kind, description, args5) {
|
|
|
24540
24537
|
|
|
24541
24538
|
// src/commands/ads/meta/activities.ts
|
|
24542
24539
|
var listArgs4 = {
|
|
24543
|
-
"account-id": { type: "string", description: "Meta ad account ID
|
|
24540
|
+
"account-id": { type: "string", description: "Meta ad account ID" },
|
|
24544
24541
|
days: { type: "string", description: "Lookback days (default 7)" },
|
|
24545
24542
|
limit: { type: "string", description: "Max rows" },
|
|
24546
24543
|
"no-cache": NO_CACHE_ARG,
|
|
@@ -24569,7 +24566,7 @@ Examples:
|
|
|
24569
24566
|
},
|
|
24570
24567
|
args: listArgs4,
|
|
24571
24568
|
run: async ({ args: args5 }) => {
|
|
24572
|
-
const accountId =
|
|
24569
|
+
const accountId = resolveAccountIdArg(args5);
|
|
24573
24570
|
try {
|
|
24574
24571
|
const params = { "account-id": accountId };
|
|
24575
24572
|
if (args5.days) params.days = args5.days;
|
|
@@ -25149,7 +25146,8 @@ var LEAD_FORM_CTA_TYPES = [
|
|
|
25149
25146
|
var AD_FORMATS2 = ["SINGLE_IMAGE", "CAROUSEL", "SINGLE_VIDEO"];
|
|
25150
25147
|
var ENROLL_STATUSES = ["OPT_IN", "OPT_OUT"];
|
|
25151
25148
|
var STAGEABLE_CREATE_STATUSES4 = ["ACTIVE", "PAUSED"];
|
|
25152
|
-
var UPDATE_STATUSES = ["ACTIVE", "PAUSED", "ARCHIVED"];
|
|
25149
|
+
var UPDATE_STATUSES = ["ACTIVE", "PAUSED", "ARCHIVED", "DELETED"];
|
|
25150
|
+
var CREATIVE_UPDATE_STATUSES = ["ACTIVE", "PAUSED", "ARCHIVED"];
|
|
25153
25151
|
var CUSTOM_AUDIENCE_SUBTYPES = ["CUSTOM", "WEBSITE", "ENGAGEMENT", "LOOKALIKE"];
|
|
25154
25152
|
var CUSTOMER_FILE_SOURCES = [
|
|
25155
25153
|
"USER_PROVIDED_ONLY",
|
|
@@ -25372,7 +25370,7 @@ function positionsMissingRequiredFeed(targeting) {
|
|
|
25372
25370
|
// ../api/src/ads-meta/ops.ts
|
|
25373
25371
|
var tempRefSchema4 = z37.string().regex(TEMP_REF_REGEX4, "expected a meta_temp_* reference");
|
|
25374
25372
|
var parentRefSchema3 = z37.union([z37.string().regex(NUMERIC_ID_REGEX3, "expected a numeric id"), tempRefSchema4]);
|
|
25375
|
-
var moneySchema2 = z37.
|
|
25373
|
+
var moneySchema2 = z37.strictObject({
|
|
25376
25374
|
amount: z37.string().regex(/^\d+(\.\d{1,3})?$/, "expected a decimal amount like 50 or 50.00").refine((val) => Number(val) > 0, "amount must be greater than zero"),
|
|
25377
25375
|
currencyCode: z37.string().length(3).optional()
|
|
25378
25376
|
});
|
|
@@ -25460,7 +25458,7 @@ function targetingHardLimitsDemographics(t) {
|
|
|
25460
25458
|
return narrowsAgeMax || narrowsAgeMin || narrowsGender;
|
|
25461
25459
|
}
|
|
25462
25460
|
var specialAdCategoriesSchema = z37.array(z37.enum(SPECIAL_AD_CATEGORIES)).default(["NONE"]);
|
|
25463
|
-
var campaignCreateSchema4 = z37.
|
|
25461
|
+
var campaignCreateSchema4 = z37.strictObject({
|
|
25464
25462
|
name: z37.string().min(1).max(META_LIMITS.campaign.nameMax),
|
|
25465
25463
|
objective: z37.enum(OBJECTIVES2),
|
|
25466
25464
|
status: stageableStatusSchema3.default("PAUSED"),
|
|
@@ -25498,7 +25496,7 @@ var campaignCreateSchema4 = z37.object({
|
|
|
25498
25496
|
});
|
|
25499
25497
|
}
|
|
25500
25498
|
});
|
|
25501
|
-
var campaignUpdateSchema4 = z37.
|
|
25499
|
+
var campaignUpdateSchema4 = z37.strictObject({
|
|
25502
25500
|
name: z37.string().min(1).max(META_LIMITS.campaign.nameMax).optional(),
|
|
25503
25501
|
status: updateStatusSchema.optional(),
|
|
25504
25502
|
bid_strategy: z37.enum(BID_STRATEGIES2).optional(),
|
|
@@ -25516,7 +25514,7 @@ var campaignUpdateSchema4 = z37.object({
|
|
|
25516
25514
|
}
|
|
25517
25515
|
validateDailyBudgetFloor(p.dailyBudget, ctx, ["dailyBudget", "amount"]);
|
|
25518
25516
|
});
|
|
25519
|
-
var
|
|
25517
|
+
var promotedObjectFields = {
|
|
25520
25518
|
page_id: parentRefSchema3.optional(),
|
|
25521
25519
|
pixel_id: z37.string().regex(NUMERIC_ID_REGEX3).optional(),
|
|
25522
25520
|
custom_event_type: z37.enum(CUSTOM_EVENT_TYPES).optional(),
|
|
@@ -25536,9 +25534,12 @@ var promotedObjectSchema = z37.object({
|
|
|
25536
25534
|
product_set_id: z37.string().regex(NUMERIC_ID_REGEX3).optional(),
|
|
25537
25535
|
whatsapp_phone_number: z37.string().optional(),
|
|
25538
25536
|
offline_conversion_data_set_id: z37.string().regex(NUMERIC_ID_REGEX3).optional()
|
|
25539
|
-
}
|
|
25537
|
+
};
|
|
25538
|
+
var promotedObjectSchema = z37.strictObject(promotedObjectFields, {
|
|
25539
|
+
error: (issue) => issue.code === "unrecognized_keys" ? `promoted_object does not take ${issue.keys.map((key) => `"${key}"`).join(", ")} \u2014 it takes ${Object.keys(promotedObjectFields).join(", ")}` : void 0
|
|
25540
|
+
});
|
|
25540
25541
|
var attributionSpecSchema = z37.array(
|
|
25541
|
-
z37.
|
|
25542
|
+
z37.strictObject({
|
|
25542
25543
|
event_type: z37.enum(ATTRIBUTION_EVENT_TYPES),
|
|
25543
25544
|
window_days: z37.union([z37.literal(1), z37.literal(7), z37.literal(28)])
|
|
25544
25545
|
})
|
|
@@ -25703,7 +25704,7 @@ function validateAdSetPlacements(p, ctx) {
|
|
|
25703
25704
|
ctx.addIssue({ code: "custom", path: ["targeting"], message: `${message} (${PLACEMENT_TARGETING_DOC})` });
|
|
25704
25705
|
}
|
|
25705
25706
|
}
|
|
25706
|
-
var adSetCreateSchema = z37.
|
|
25707
|
+
var adSetCreateSchema = z37.strictObject(adSetFields).superRefine((p, ctx) => {
|
|
25707
25708
|
validateAdSetBudgetAndBid(p, ctx);
|
|
25708
25709
|
validateAdSetPromotedObject(p, ctx);
|
|
25709
25710
|
validateAdvantageAudience(p, ctx);
|
|
@@ -25716,7 +25717,7 @@ var adSetCreateSchema = z37.object(adSetFields).superRefine((p, ctx) => {
|
|
|
25716
25717
|
});
|
|
25717
25718
|
}
|
|
25718
25719
|
});
|
|
25719
|
-
var adSetUpdateSchema = z37.
|
|
25720
|
+
var adSetUpdateSchema = z37.strictObject({
|
|
25720
25721
|
name: adSetFields.name.optional(),
|
|
25721
25722
|
status: updateStatusSchema.optional(),
|
|
25722
25723
|
dailyBudget: moneySchema2.optional(),
|
|
@@ -25746,7 +25747,7 @@ var adSetUpdateSchema = z37.object({
|
|
|
25746
25747
|
var messageSchema = z37.string().min(1).max(META_LIMITS.creative.messageHardMax);
|
|
25747
25748
|
var headlineSchema2 = z37.string().min(1).max(META_LIMITS.creative.headlineMax);
|
|
25748
25749
|
var descriptionSchema = z37.string().min(1).max(META_LIMITS.creative.descriptionMax);
|
|
25749
|
-
var callToActionSchema = z37.
|
|
25750
|
+
var callToActionSchema = z37.strictObject({
|
|
25750
25751
|
type: z37.enum(CTA_TYPES2),
|
|
25751
25752
|
/** Overrides the base link for the CTA button; defaults to the ad's link. */
|
|
25752
25753
|
link: httpsUrlSchema3.optional(),
|
|
@@ -25767,7 +25768,7 @@ var callToActionSchema = z37.object({
|
|
|
25767
25768
|
});
|
|
25768
25769
|
}
|
|
25769
25770
|
});
|
|
25770
|
-
var creativeEnhancementsSchema = z37.
|
|
25771
|
+
var creativeEnhancementsSchema = z37.strictObject({
|
|
25771
25772
|
standardEnhancements: z37.enum(ENROLL_STATUSES).optional(),
|
|
25772
25773
|
features: z37.record(z37.string(), z37.enum(ENROLL_STATUSES)).optional()
|
|
25773
25774
|
});
|
|
@@ -25798,7 +25799,7 @@ function countImageRefs(p) {
|
|
|
25798
25799
|
function countVideoRefs(p) {
|
|
25799
25800
|
return [p.videoId, p.videoRef].filter(Boolean).length;
|
|
25800
25801
|
}
|
|
25801
|
-
var singleCreativeSchema = z37.
|
|
25802
|
+
var singleCreativeSchema = z37.strictObject({
|
|
25802
25803
|
creativeType: z37.literal("single"),
|
|
25803
25804
|
...creativeSharedFields,
|
|
25804
25805
|
/** Primary text. */
|
|
@@ -25832,7 +25833,7 @@ var singleCreativeSchema = z37.object({
|
|
|
25832
25833
|
});
|
|
25833
25834
|
}
|
|
25834
25835
|
});
|
|
25835
|
-
var carouselCardSchema = z37.
|
|
25836
|
+
var carouselCardSchema = z37.strictObject({
|
|
25836
25837
|
link: httpsUrlSchema3,
|
|
25837
25838
|
headline: z37.string().max(META_LIMITS.creative.headlineMax).optional(),
|
|
25838
25839
|
description: z37.string().max(META_LIMITS.creative.descriptionMax).optional(),
|
|
@@ -25855,7 +25856,7 @@ var carouselCardSchema = z37.object({
|
|
|
25855
25856
|
ctx.addIssue({ code: "custom", path: ["videoId"], message: "each card is an image OR a video, not both" });
|
|
25856
25857
|
}
|
|
25857
25858
|
});
|
|
25858
|
-
var carouselCreativeSchema2 = z37.
|
|
25859
|
+
var carouselCreativeSchema2 = z37.strictObject({
|
|
25859
25860
|
creativeType: z37.literal("carousel"),
|
|
25860
25861
|
...creativeSharedFields,
|
|
25861
25862
|
message: messageSchema,
|
|
@@ -25877,19 +25878,19 @@ var carouselCreativeSchema2 = z37.object({
|
|
|
25877
25878
|
});
|
|
25878
25879
|
}
|
|
25879
25880
|
});
|
|
25880
|
-
var dynamicImageSchema = z37.
|
|
25881
|
-
var dynamicVideoSchema = z37.
|
|
25881
|
+
var dynamicImageSchema = z37.strictObject({ ...imageMediaFields }).refine((p) => countImageRefs(p) === 1, "each dynamic image needs exactly one reference");
|
|
25882
|
+
var dynamicVideoSchema = z37.strictObject({
|
|
25882
25883
|
videoId: videoMediaFields.videoId,
|
|
25883
25884
|
videoRef: videoMediaFields.videoRef,
|
|
25884
25885
|
thumbnailHash: videoMediaFields.thumbnailHash
|
|
25885
25886
|
}).refine((p) => countVideoRefs(p) === 1, "each dynamic video needs exactly one reference");
|
|
25886
25887
|
var DYN = META_LIMITS.creative;
|
|
25887
|
-
var dynamicCreativeSchema = z37.
|
|
25888
|
+
var dynamicCreativeSchema = z37.strictObject({
|
|
25888
25889
|
creativeType: z37.literal("dynamic"),
|
|
25889
25890
|
...creativeSharedFields,
|
|
25890
|
-
bodies: z37.array(z37.
|
|
25891
|
-
titles: z37.array(z37.
|
|
25892
|
-
descriptions: z37.array(z37.
|
|
25891
|
+
bodies: z37.array(z37.strictObject({ text: messageSchema })).min(DYN.dynamicTextsMin).max(DYN.dynamicTextsMax),
|
|
25892
|
+
titles: z37.array(z37.strictObject({ text: headlineSchema2 })).min(DYN.dynamicTextsMin).max(DYN.dynamicTextsMax),
|
|
25893
|
+
descriptions: z37.array(z37.strictObject({ text: descriptionSchema })).max(DYN.dynamicTextsMax).optional(),
|
|
25893
25894
|
images: z37.array(dynamicImageSchema).optional(),
|
|
25894
25895
|
videos: z37.array(dynamicVideoSchema).optional(),
|
|
25895
25896
|
/**
|
|
@@ -25905,7 +25906,7 @@ var dynamicCreativeSchema = z37.object({
|
|
|
25905
25906
|
* different enums.
|
|
25906
25907
|
*/
|
|
25907
25908
|
call_to_action: callToActionSchema.optional(),
|
|
25908
|
-
link_urls: z37.array(z37.
|
|
25909
|
+
link_urls: z37.array(z37.strictObject({ website_url: httpsUrlSchema3, display_url: z37.string().optional() })).min(1),
|
|
25909
25910
|
/**
|
|
25910
25911
|
* `asset_feed_spec.optimization_type` — passed through as a free string on
|
|
25911
25912
|
* purpose. Meta's own 400 enumerates ten values and then accepts
|
|
@@ -25936,7 +25937,7 @@ var dynamicCreativeSchema = z37.object({
|
|
|
25936
25937
|
});
|
|
25937
25938
|
});
|
|
25938
25939
|
});
|
|
25939
|
-
var existingPostCreativeSchema = z37.
|
|
25940
|
+
var existingPostCreativeSchema = z37.strictObject({
|
|
25940
25941
|
creativeType: z37.literal("existing_post"),
|
|
25941
25942
|
name: creativeSharedFields.name,
|
|
25942
25943
|
/** "<page_id>_<post_id>" object story id of the post to promote. */
|
|
@@ -25945,7 +25946,7 @@ var existingPostCreativeSchema = z37.object({
|
|
|
25945
25946
|
url_tags: creativeSharedFields.url_tags,
|
|
25946
25947
|
enhancements: creativeSharedFields.enhancements
|
|
25947
25948
|
});
|
|
25948
|
-
var specCreativeSchema = z37.
|
|
25949
|
+
var specCreativeSchema = z37.strictObject({
|
|
25949
25950
|
creativeType: z37.literal("spec"),
|
|
25950
25951
|
name: creativeSharedFields.name,
|
|
25951
25952
|
url_tags: creativeSharedFields.url_tags,
|
|
@@ -25974,29 +25975,29 @@ var creativeContentSchema2 = z37.discriminatedUnion("creativeType", [
|
|
|
25974
25975
|
specCreativeSchema
|
|
25975
25976
|
]);
|
|
25976
25977
|
var adCreativeCreateSchema = creativeContentSchema2;
|
|
25977
|
-
var adCreativeUpdateSchema = z37.
|
|
25978
|
+
var adCreativeUpdateSchema = z37.strictObject({
|
|
25978
25979
|
name: z37.string().max(META_LIMITS.creative.nameMax).optional(),
|
|
25979
|
-
status:
|
|
25980
|
+
status: z37.enum(CREATIVE_UPDATE_STATUSES).optional(),
|
|
25980
25981
|
/** Content patch — only honored when the target is a staged meta_temp_* creative. */
|
|
25981
25982
|
content: z37.record(z37.string(), z37.unknown()).optional()
|
|
25982
25983
|
}).refine((p) => Object.values(p).some((val) => val !== void 0), "update needs at least one field");
|
|
25983
|
-
var adCreateSchema2 = z37.
|
|
25984
|
+
var adCreateSchema2 = z37.strictObject({
|
|
25984
25985
|
name: z37.string().min(1).max(META_LIMITS.ad.nameMax),
|
|
25985
25986
|
adset_id: parentRefSchema3,
|
|
25986
25987
|
status: stageableStatusSchema3.default("PAUSED"),
|
|
25987
|
-
creative: z37.
|
|
25988
|
+
creative: z37.strictObject({ creative_id: parentRefSchema3 }),
|
|
25988
25989
|
/** Conversion pixel / offline event set / view tags — structural passthrough. */
|
|
25989
25990
|
tracking_specs: z37.array(z37.record(z37.string(), z37.unknown())).optional()
|
|
25990
25991
|
});
|
|
25991
|
-
var adUpdateSchema2 = z37.
|
|
25992
|
+
var adUpdateSchema2 = z37.strictObject({
|
|
25992
25993
|
name: z37.string().min(1).max(META_LIMITS.ad.nameMax).optional(),
|
|
25993
25994
|
status: updateStatusSchema.optional(),
|
|
25994
25995
|
/** Swapping the creative is the Meta way to "edit" an ad's creative. */
|
|
25995
|
-
creative: z37.
|
|
25996
|
+
creative: z37.strictObject({ creative_id: parentRefSchema3 }).optional(),
|
|
25996
25997
|
tracking_specs: z37.array(z37.record(z37.string(), z37.unknown())).optional()
|
|
25997
25998
|
}).refine((p) => Object.values(p).some((val) => val !== void 0), "update needs at least one field");
|
|
25998
|
-
var lookalikeSpecSchema = z37.
|
|
25999
|
-
origin: z37.array(z37.
|
|
25999
|
+
var lookalikeSpecSchema = z37.strictObject({
|
|
26000
|
+
origin: z37.array(z37.strictObject({ id: parentRefSchema3 })).min(1),
|
|
26000
26001
|
ratio: z37.number().min(0.01).max(0.2).optional(),
|
|
26001
26002
|
country: z37.string().length(2).optional()
|
|
26002
26003
|
});
|
|
@@ -26014,7 +26015,7 @@ function mixedEventSourceTypes(rule) {
|
|
|
26014
26015
|
const distinct = [...new Set(types)].sort();
|
|
26015
26016
|
return distinct.length > 1 ? distinct : [];
|
|
26016
26017
|
}
|
|
26017
|
-
var customAudienceCreateSchema = z37.
|
|
26018
|
+
var customAudienceCreateSchema = z37.strictObject({
|
|
26018
26019
|
name: z37.string().min(1).max(META_LIMITS.audience.nameMax),
|
|
26019
26020
|
subtype: z37.enum(CUSTOM_AUDIENCE_SUBTYPES),
|
|
26020
26021
|
description: z37.string().max(500).optional(),
|
|
@@ -26046,11 +26047,11 @@ var customAudienceCreateSchema = z37.object({
|
|
|
26046
26047
|
});
|
|
26047
26048
|
}
|
|
26048
26049
|
});
|
|
26049
|
-
var customAudienceUpdateSchema = z37.
|
|
26050
|
+
var customAudienceUpdateSchema = z37.strictObject({
|
|
26050
26051
|
name: z37.string().min(1).max(META_LIMITS.audience.nameMax).optional(),
|
|
26051
26052
|
description: z37.string().max(500).optional()
|
|
26052
26053
|
}).refine((p) => Object.values(p).some((val) => val !== void 0), "update needs at least one field");
|
|
26053
|
-
var customConversionCreateSchema = z37.
|
|
26054
|
+
var customConversionCreateSchema = z37.strictObject({
|
|
26054
26055
|
name: z37.string().min(1).max(META_LIMITS.customConversion.nameMax),
|
|
26055
26056
|
description: z37.string().max(META_LIMITS.customConversion.descriptionMax).optional(),
|
|
26056
26057
|
/** The pixel the conversion counts from — `event_source_id` on the wire. Baker never creates pixels, so this is always a real id. */
|
|
@@ -26066,7 +26067,7 @@ var customConversionCreateSchema = z37.object({
|
|
|
26066
26067
|
ctx.addIssue({ code: "custom", path: ["rule"], message: refusal });
|
|
26067
26068
|
}
|
|
26068
26069
|
});
|
|
26069
|
-
var mediaUploadSchema = z37.
|
|
26070
|
+
var mediaUploadSchema = z37.strictObject({
|
|
26070
26071
|
kind: z37.enum(MEDIA_KINDS),
|
|
26071
26072
|
bakerImageId: bakerMediaIdSchema2.optional(),
|
|
26072
26073
|
bakerVideoId: bakerMediaIdSchema2.optional(),
|
|
@@ -26242,13 +26243,20 @@ import { defineCommand as defineCommand57 } from "citty";
|
|
|
26242
26243
|
|
|
26243
26244
|
// src/commands/ads/meta/write-shared.ts
|
|
26244
26245
|
import { readFileSync as readFileSync9 } from "fs";
|
|
26245
|
-
|
|
26246
|
-
return
|
|
26246
|
+
function bareAccountId2(args5) {
|
|
26247
|
+
return resolveAccountIdArg(args5).replace(/^act_/, "");
|
|
26247
26248
|
}
|
|
26248
26249
|
function failWriteValidation3(message) {
|
|
26249
26250
|
writeJsonEnvelope({ ok: false, error: { code: "VALIDATION_ERROR", message } });
|
|
26250
26251
|
process.exit(1);
|
|
26251
26252
|
}
|
|
26253
|
+
function refuseDeleteByUpdate(payload, group) {
|
|
26254
|
+
if (payload.status === "DELETED") {
|
|
26255
|
+
failWriteValidation3(
|
|
26256
|
+
`update does not delete \u2014 deleting is permanent. Use \`baker ads meta ${group} delete <id>\` if the user asked to delete; otherwise pause or archive.`
|
|
26257
|
+
);
|
|
26258
|
+
}
|
|
26259
|
+
}
|
|
26252
26260
|
function loadJsonFileArg3(path48) {
|
|
26253
26261
|
if (typeof path48 !== "string" || path48.length === 0) {
|
|
26254
26262
|
return {};
|
|
@@ -26369,7 +26377,7 @@ async function stageStatusChange2(input) {
|
|
|
26369
26377
|
// src/commands/ads/meta/write-commands.ts
|
|
26370
26378
|
var STAGED_NOTE2 = "Staged until publish \u2014 review with `baker ads meta draft`.";
|
|
26371
26379
|
var accountArgs2 = {
|
|
26372
|
-
"account-id": { type: "string", description: "Numeric account ID or act_N
|
|
26380
|
+
"account-id": { type: "string", description: "Numeric account ID or act_N" }
|
|
26373
26381
|
};
|
|
26374
26382
|
function campaignPayloadFromFlags2(args5) {
|
|
26375
26383
|
return {
|
|
@@ -26425,7 +26433,7 @@ Example: baker ads meta campaigns create --name "Q3 Prospecting" --objective OUT
|
|
|
26425
26433
|
file: { type: "string", description: "JSON file with the full payload; flags override file keys" }
|
|
26426
26434
|
},
|
|
26427
26435
|
run: async ({ args: args5 }) => {
|
|
26428
|
-
const accountId =
|
|
26436
|
+
const accountId = bareAccountId2(args5);
|
|
26429
26437
|
const payload = mergePayload3(loadJsonFileArg3(args5.file), campaignPayloadFromFlags2(args5));
|
|
26430
26438
|
await stageOp2({ kind: "campaign.create", accountId, payload });
|
|
26431
26439
|
}
|
|
@@ -26445,7 +26453,7 @@ Pass a meta_temp_* ref to amend a campaign staged in this chat. Example: baker a
|
|
|
26445
26453
|
file: { type: "string", description: "JSON file with fields to change" }
|
|
26446
26454
|
},
|
|
26447
26455
|
run: async ({ args: args5 }) => {
|
|
26448
|
-
const accountId =
|
|
26456
|
+
const accountId = bareAccountId2(args5);
|
|
26449
26457
|
const payload = mergePayload3(loadJsonFileArg3(args5.file), {
|
|
26450
26458
|
name: args5.name,
|
|
26451
26459
|
status: upper(args5.status),
|
|
@@ -26456,6 +26464,7 @@ Pass a meta_temp_* ref to amend a campaign staged in this chat. Example: baker a
|
|
|
26456
26464
|
start_time: parseDateFlag2(args5.start, "--start"),
|
|
26457
26465
|
stop_time: parseDateFlag2(args5.stop, "--stop")
|
|
26458
26466
|
});
|
|
26467
|
+
refuseDeleteByUpdate(payload, "campaigns");
|
|
26459
26468
|
await stageOp2({
|
|
26460
26469
|
kind: "campaign.update",
|
|
26461
26470
|
accountId,
|
|
@@ -26538,7 +26547,7 @@ Example: baker ads meta custom-conversions create --name "Lead formulario" --pix
|
|
|
26538
26547
|
value: { type: "string", description: "Default value of one conversion, when the site sends no value" }
|
|
26539
26548
|
},
|
|
26540
26549
|
run: async ({ args: args5 }) => {
|
|
26541
|
-
const accountId =
|
|
26550
|
+
const accountId = bareAccountId2(args5);
|
|
26542
26551
|
await stageOp2({
|
|
26543
26552
|
kind: "customConversion.create",
|
|
26544
26553
|
accountId,
|
|
@@ -26595,7 +26604,7 @@ Example: baker ads meta adsets create --campaign meta_temp_ab12 --name "US 25-54
|
|
|
26595
26604
|
},
|
|
26596
26605
|
args: { campaign: { type: "string", description: "Parent campaign id or meta_temp_* ref" }, ...adSetWriteArgs },
|
|
26597
26606
|
run: async ({ args: args5 }) => {
|
|
26598
|
-
const accountId =
|
|
26607
|
+
const accountId = bareAccountId2(args5);
|
|
26599
26608
|
const payload = mergePayload3(loadJsonFileArg3(args5.file), adSetPayloadFromFlags(args5));
|
|
26600
26609
|
await stageOp2({ kind: "adSet.create", accountId, payload });
|
|
26601
26610
|
}
|
|
@@ -26609,13 +26618,14 @@ Example: baker ads meta adsets update 6123 --daily-budget 80`
|
|
|
26609
26618
|
},
|
|
26610
26619
|
args: { id: { type: "positional", description: "Ad set id or meta_temp_* ref", required: true }, ...adSetWriteArgs },
|
|
26611
26620
|
run: async ({ args: args5 }) => {
|
|
26612
|
-
const accountId =
|
|
26621
|
+
const accountId = bareAccountId2(args5);
|
|
26613
26622
|
const {
|
|
26614
26623
|
campaign_id: _drop,
|
|
26615
26624
|
billing_event: _be,
|
|
26616
26625
|
...payload
|
|
26617
26626
|
} = adSetPayloadFromFlags(args5);
|
|
26618
26627
|
const merged = mergePayload3(loadJsonFileArg3(args5.file), payload);
|
|
26628
|
+
refuseDeleteByUpdate(merged, "adsets");
|
|
26619
26629
|
await stageOp2({
|
|
26620
26630
|
kind: "adSet.update",
|
|
26621
26631
|
accountId,
|
|
@@ -26711,7 +26721,7 @@ Example: baker ads meta creatives create --page 555 --message "Save now" --link
|
|
|
26711
26721
|
file: { type: "string", description: "JSON file with the full creative payload (carousel cards / dynamic assets)" }
|
|
26712
26722
|
},
|
|
26713
26723
|
run: async ({ args: args5 }) => {
|
|
26714
|
-
const accountId =
|
|
26724
|
+
const accountId = bareAccountId2(args5);
|
|
26715
26725
|
const payload = mergePayload3(loadJsonFileArg3(args5.file), creativePayloadFromFlags(args5));
|
|
26716
26726
|
if (payload.creativeType === void 0) {
|
|
26717
26727
|
payload.creativeType = "single";
|
|
@@ -26742,7 +26752,7 @@ Amending a staged (meta_temp_*) creative merges fields into the create. Example:
|
|
|
26742
26752
|
}
|
|
26743
26753
|
},
|
|
26744
26754
|
run: async ({ args: args5 }) => {
|
|
26745
|
-
const accountId =
|
|
26755
|
+
const accountId = bareAccountId2(args5);
|
|
26746
26756
|
const file = loadJsonFileArg3(args5.file);
|
|
26747
26757
|
const payload = mergePayload3(file, {
|
|
26748
26758
|
name: args5.name,
|
|
@@ -26776,7 +26786,7 @@ Example: baker ads meta ads create --name "Ad 1" --adset meta_temp_as01 --creati
|
|
|
26776
26786
|
file: { type: "string", description: "JSON file with the full payload" }
|
|
26777
26787
|
},
|
|
26778
26788
|
run: async ({ args: args5 }) => {
|
|
26779
|
-
const accountId =
|
|
26789
|
+
const accountId = bareAccountId2(args5);
|
|
26780
26790
|
const tracking = args5["tracking-file"] ? loadJsonFileArg3(args5["tracking-file"]).tracking_specs : void 0;
|
|
26781
26791
|
const payload = mergePayload3(loadJsonFileArg3(args5.file), {
|
|
26782
26792
|
name: args5.name,
|
|
@@ -26803,12 +26813,13 @@ Example: baker ads meta ads update 6123 --creative meta_temp_cr02`
|
|
|
26803
26813
|
file: { type: "string", description: "JSON file with fields to change" }
|
|
26804
26814
|
},
|
|
26805
26815
|
run: async ({ args: args5 }) => {
|
|
26806
|
-
const accountId =
|
|
26816
|
+
const accountId = bareAccountId2(args5);
|
|
26807
26817
|
const payload = mergePayload3(loadJsonFileArg3(args5.file), {
|
|
26808
26818
|
name: args5.name,
|
|
26809
26819
|
status: upper(args5.status),
|
|
26810
26820
|
creative: args5.creative ? { creative_id: String(args5.creative) } : void 0
|
|
26811
26821
|
});
|
|
26822
|
+
refuseDeleteByUpdate(payload, "ads");
|
|
26812
26823
|
await stageOp2({
|
|
26813
26824
|
kind: "ad.update",
|
|
26814
26825
|
accountId,
|
|
@@ -26839,9 +26850,9 @@ Example: baker ads meta ads retag 120252158038400247 --url-tags "utm_source={{si
|
|
|
26839
26850
|
const { apiPost: apiPost2 } = await import("./client-GR6YL3YX.js");
|
|
26840
26851
|
const { requireChatId: requireChatId2 } = await import("./env-4P5HOGNA.js");
|
|
26841
26852
|
const { writeJsonEnvelope: writeJsonEnvelope2 } = await import("./output-NMQXZF3Z.js");
|
|
26842
|
-
const { handleMetaError: handleMetaError2 } = await import("./shared-
|
|
26853
|
+
const { handleMetaError: handleMetaError2 } = await import("./shared-J7DQZ2ED.js");
|
|
26843
26854
|
try {
|
|
26844
|
-
const accountId =
|
|
26855
|
+
const accountId = bareAccountId2(args5);
|
|
26845
26856
|
const urlTags = typeof args5["url-tags"] === "string" ? args5["url-tags"] : void 0;
|
|
26846
26857
|
const setRaw = typeof args5.set === "string" ? args5.set : void 0;
|
|
26847
26858
|
if (urlTags === void 0 === (setRaw === void 0)) {
|
|
@@ -26895,7 +26906,7 @@ Example: baker ads meta audiences create --name "Site visitors 30d" --subtype WE
|
|
|
26895
26906
|
file: { type: "string", description: "JSON file with lookalike_spec / rule / full payload" }
|
|
26896
26907
|
},
|
|
26897
26908
|
run: async ({ args: args5 }) => {
|
|
26898
|
-
const accountId =
|
|
26909
|
+
const accountId = bareAccountId2(args5);
|
|
26899
26910
|
const payload = mergePayload3(loadJsonFileArg3(args5.file), {
|
|
26900
26911
|
name: args5.name,
|
|
26901
26912
|
subtype: upper(args5.subtype),
|
|
@@ -26918,7 +26929,7 @@ var audiencesUpdateCommand = defineCommand57({
|
|
|
26918
26929
|
file: { type: "string", description: "JSON file with fields to change" }
|
|
26919
26930
|
},
|
|
26920
26931
|
run: async ({ args: args5 }) => {
|
|
26921
|
-
const accountId =
|
|
26932
|
+
const accountId = bareAccountId2(args5);
|
|
26922
26933
|
const payload = mergePayload3(loadJsonFileArg3(args5.file), { name: args5.name, description: args5.description });
|
|
26923
26934
|
await stageOp2({
|
|
26924
26935
|
kind: "customAudience.update",
|
|
@@ -26942,7 +26953,7 @@ Example: baker ads meta media upload --kind image --image-id <bakerImageId>`
|
|
|
26942
26953
|
name: { type: "string", description: "Display name / filename hint" }
|
|
26943
26954
|
},
|
|
26944
26955
|
run: async ({ args: args5 }) => {
|
|
26945
|
-
const accountId =
|
|
26956
|
+
const accountId = bareAccountId2(args5);
|
|
26946
26957
|
const kind = String(args5.kind ?? "").toLowerCase();
|
|
26947
26958
|
if (kind !== "image" && kind !== "video") {
|
|
26948
26959
|
failWriteValidation3("--kind must be image or video");
|
|
@@ -26954,13 +26965,19 @@ Example: baker ads meta media upload --kind image --image-id <bakerImageId>`
|
|
|
26954
26965
|
});
|
|
26955
26966
|
}
|
|
26956
26967
|
});
|
|
26968
|
+
var STATUS_BY_COMMAND = { pause: "PAUSED", resume: "ACTIVE", archive: "ARCHIVED", delete: "DELETED" };
|
|
26969
|
+
var STATUS_COMMAND_NOTE = {
|
|
26970
|
+
archive: "Archived stays readable in Ads Manager and can be found with --effective-status ARCHIVED.",
|
|
26971
|
+
delete: "Deleting is permanent and cannot be undone \u2014 Meta removes it and everything under it. Prefer pause or archive unless the user asked to delete."
|
|
26972
|
+
};
|
|
26957
26973
|
function statusCommand3(name, kind, label) {
|
|
26958
|
-
const status = name
|
|
26974
|
+
const status = STATUS_BY_COMMAND[name];
|
|
26975
|
+
const note = STATUS_COMMAND_NOTE[name];
|
|
26959
26976
|
return defineCommand57({
|
|
26960
|
-
meta: { name, description: `Stage ${name} for a ${label}. ${STAGED_NOTE2}` },
|
|
26977
|
+
meta: { name, description: `Stage ${name} for a ${label}. ${note ? `${note} ` : ""}${STAGED_NOTE2}` },
|
|
26961
26978
|
args: { id: { type: "positional", description: `${label} id`, required: true }, ...accountArgs2 },
|
|
26962
26979
|
run: async ({ args: args5 }) => {
|
|
26963
|
-
const accountId =
|
|
26980
|
+
const accountId = bareAccountId2(args5);
|
|
26964
26981
|
await stageStatusChange2({
|
|
26965
26982
|
kind,
|
|
26966
26983
|
accountId,
|
|
@@ -26987,9 +27004,9 @@ function duplicateCommand2(entity, label) {
|
|
|
26987
27004
|
const { apiPost: apiPost2 } = await import("./client-GR6YL3YX.js");
|
|
26988
27005
|
const { requireChatId: requireChatId2 } = await import("./env-4P5HOGNA.js");
|
|
26989
27006
|
const { writeJsonEnvelope: writeJsonEnvelope2 } = await import("./output-NMQXZF3Z.js");
|
|
26990
|
-
const { handleMetaError: handleMetaError2 } = await import("./shared-
|
|
27007
|
+
const { handleMetaError: handleMetaError2 } = await import("./shared-J7DQZ2ED.js");
|
|
26991
27008
|
try {
|
|
26992
|
-
const accountId =
|
|
27009
|
+
const accountId = bareAccountId2(args5);
|
|
26993
27010
|
const chatId = requireChatId2();
|
|
26994
27011
|
const response = await apiPost2("/api/ads/meta/draft/duplicate", {
|
|
26995
27012
|
chatId,
|
|
@@ -27009,19 +27026,22 @@ function duplicateCommand2(entity, label) {
|
|
|
27009
27026
|
var campaignsPauseCommand2 = statusCommand3("pause", "campaign.update", "campaign");
|
|
27010
27027
|
var campaignsResumeCommand2 = statusCommand3("resume", "campaign.update", "campaign");
|
|
27011
27028
|
var campaignsArchiveCommand2 = statusCommand3("archive", "campaign.update", "campaign");
|
|
27029
|
+
var campaignsDeleteCommand = statusCommand3("delete", "campaign.update", "campaign");
|
|
27012
27030
|
var campaignsDuplicateCommand2 = duplicateCommand2("campaign", "campaign");
|
|
27013
27031
|
var adSetsPauseCommand = statusCommand3("pause", "adSet.update", "ad set");
|
|
27014
27032
|
var adSetsResumeCommand = statusCommand3("resume", "adSet.update", "ad set");
|
|
27015
27033
|
var adSetsArchiveCommand = statusCommand3("archive", "adSet.update", "ad set");
|
|
27034
|
+
var adSetsDeleteCommand = statusCommand3("delete", "adSet.update", "ad set");
|
|
27016
27035
|
var adSetsDuplicateCommand = duplicateCommand2("adSet", "ad set");
|
|
27017
27036
|
var adsPauseCommand = statusCommand3("pause", "ad.update", "ad");
|
|
27018
27037
|
var adsResumeCommand = statusCommand3("resume", "ad.update", "ad");
|
|
27019
27038
|
var adsArchiveCommand = statusCommand3("archive", "ad.update", "ad");
|
|
27039
|
+
var adsDeleteCommand = statusCommand3("delete", "ad.update", "ad");
|
|
27020
27040
|
var adsDuplicateCommand = duplicateCommand2("ad", "ad");
|
|
27021
27041
|
|
|
27022
27042
|
// src/commands/ads/meta/ads.ts
|
|
27023
27043
|
var listArgs5 = {
|
|
27024
|
-
"account-id": { type: "string", description: "Meta ad account ID
|
|
27044
|
+
"account-id": { type: "string", description: "Meta ad account ID" },
|
|
27025
27045
|
"adset-id": { type: "string", description: "Filter to one adset" },
|
|
27026
27046
|
"campaign-id": { type: "string", description: "Filter to one campaign" },
|
|
27027
27047
|
"effective-status": { type: "string", description: "Comma-separated effective_status filter (overrides default)" },
|
|
@@ -27043,7 +27063,7 @@ var listCommand4 = defineCommand58({
|
|
|
27043
27063
|
},
|
|
27044
27064
|
args: listArgs5,
|
|
27045
27065
|
run: async ({ args: args5 }) => {
|
|
27046
|
-
const accountId =
|
|
27066
|
+
const accountId = resolveAccountIdArg(args5);
|
|
27047
27067
|
const effectiveStatus = resolveEffectiveStatus(args5);
|
|
27048
27068
|
try {
|
|
27049
27069
|
const params = { "account-id": accountId };
|
|
@@ -27064,7 +27084,7 @@ var listCommand4 = defineCommand58({
|
|
|
27064
27084
|
var adsListCommand = defineCommand58({
|
|
27065
27085
|
meta: {
|
|
27066
27086
|
name: "ads",
|
|
27067
|
-
description: `List ads in a Meta ad account, or stage writes (create/update/pause/resume/archive/duplicate/retag).
|
|
27087
|
+
description: `List ads in a Meta ad account, or stage writes (create/update/pause/resume/archive/delete/duplicate/retag).
|
|
27068
27088
|
Defaults to ACTIVE only \u2014 pass --all-statuses to widen. Write subcommands stage ops on this chat's draft.
|
|
27069
27089
|
|
|
27070
27090
|
The dashboard shows effective_status (e.g. WITH_ISSUES, PENDING_REVIEW, DISAPPROVED, ADSET_PAUSED), not status.
|
|
@@ -27089,6 +27109,7 @@ Examples:
|
|
|
27089
27109
|
pause: adsPauseCommand,
|
|
27090
27110
|
resume: adsResumeCommand,
|
|
27091
27111
|
archive: adsArchiveCommand,
|
|
27112
|
+
delete: adsDeleteCommand,
|
|
27092
27113
|
duplicate: adsDuplicateCommand,
|
|
27093
27114
|
retag: adsRetagCommand
|
|
27094
27115
|
},
|
|
@@ -27103,7 +27124,7 @@ Examples:
|
|
|
27103
27124
|
// src/commands/ads/meta/adsets.ts
|
|
27104
27125
|
import { defineCommand as defineCommand59 } from "citty";
|
|
27105
27126
|
var listArgs6 = {
|
|
27106
|
-
"account-id": { type: "string", description: "Meta ad account ID
|
|
27127
|
+
"account-id": { type: "string", description: "Meta ad account ID" },
|
|
27107
27128
|
"campaign-id": { type: "string", description: "Filter to one campaign" },
|
|
27108
27129
|
"effective-status": { type: "string", description: "Comma-separated effective_status filter (overrides default)" },
|
|
27109
27130
|
"all-statuses": { type: "boolean", description: "Drop the default ACTIVE filter" },
|
|
@@ -27124,7 +27145,7 @@ var listCommand5 = defineCommand59({
|
|
|
27124
27145
|
},
|
|
27125
27146
|
args: listArgs6,
|
|
27126
27147
|
run: async ({ args: args5 }) => {
|
|
27127
|
-
const accountId =
|
|
27148
|
+
const accountId = resolveAccountIdArg(args5);
|
|
27128
27149
|
const effectiveStatus = resolveEffectiveStatus(args5);
|
|
27129
27150
|
try {
|
|
27130
27151
|
const params = { "account-id": accountId };
|
|
@@ -27144,7 +27165,7 @@ var listCommand5 = defineCommand59({
|
|
|
27144
27165
|
var adsetsCommand = defineCommand59({
|
|
27145
27166
|
meta: {
|
|
27146
27167
|
name: "adsets",
|
|
27147
|
-
description: `List ad sets in a Meta ad account, or stage writes (create/update/pause/resume/archive/duplicate).
|
|
27168
|
+
description: `List ad sets in a Meta ad account, or stage writes (create/update/pause/resume/archive/delete/duplicate).
|
|
27148
27169
|
Defaults to ACTIVE only. Write subcommands stage ops on this chat's draft.
|
|
27149
27170
|
|
|
27150
27171
|
Listings print a table by default: id, name, campaign_id, effective_status, optimization_goal, billing_event,
|
|
@@ -27165,6 +27186,7 @@ Examples:
|
|
|
27165
27186
|
pause: adSetsPauseCommand,
|
|
27166
27187
|
resume: adSetsResumeCommand,
|
|
27167
27188
|
archive: adSetsArchiveCommand,
|
|
27189
|
+
delete: adSetsDeleteCommand,
|
|
27168
27190
|
duplicate: adSetsDuplicateCommand
|
|
27169
27191
|
},
|
|
27170
27192
|
// `args` stays even though the parent has no `run`: citty scans rawArgs for the
|
|
@@ -27178,7 +27200,7 @@ Examples:
|
|
|
27178
27200
|
// src/commands/ads/meta/audiences.ts
|
|
27179
27201
|
import { defineCommand as defineCommand60 } from "citty";
|
|
27180
27202
|
var listArgs7 = {
|
|
27181
|
-
"account-id": { type: "string", description: "Meta ad account ID
|
|
27203
|
+
"account-id": { type: "string", description: "Meta ad account ID" },
|
|
27182
27204
|
limit: { type: "string", description: "Max rows" },
|
|
27183
27205
|
"no-cache": NO_CACHE_ARG,
|
|
27184
27206
|
output: { type: "string", description: "Output format", default: "json" }
|
|
@@ -27190,7 +27212,7 @@ var listCommand6 = defineCommand60({
|
|
|
27190
27212
|
},
|
|
27191
27213
|
args: listArgs7,
|
|
27192
27214
|
run: async ({ args: args5 }) => {
|
|
27193
|
-
const accountId =
|
|
27215
|
+
const accountId = resolveAccountIdArg(args5);
|
|
27194
27216
|
try {
|
|
27195
27217
|
const params = { "account-id": accountId };
|
|
27196
27218
|
if (args5.limit) params.limit = args5.limit;
|
|
@@ -27264,7 +27286,7 @@ Examples:
|
|
|
27264
27286
|
// src/commands/ads/meta/campaigns.ts
|
|
27265
27287
|
import { defineCommand as defineCommand62 } from "citty";
|
|
27266
27288
|
var listArgs8 = {
|
|
27267
|
-
"account-id": { type: "string", description: "Meta ad account ID
|
|
27289
|
+
"account-id": { type: "string", description: "Meta ad account ID" },
|
|
27268
27290
|
"effective-status": { type: "string", description: "Comma-separated effective_status filter (overrides default)" },
|
|
27269
27291
|
"all-statuses": { type: "boolean", description: "Drop the default ACTIVE filter and return everything" },
|
|
27270
27292
|
"name-contains": NAME_CONTAINS_ARG,
|
|
@@ -27284,7 +27306,7 @@ var listCommand7 = defineCommand62({
|
|
|
27284
27306
|
},
|
|
27285
27307
|
args: listArgs8,
|
|
27286
27308
|
run: async ({ args: args5 }) => {
|
|
27287
|
-
const accountId =
|
|
27309
|
+
const accountId = resolveAccountIdArg(args5);
|
|
27288
27310
|
const effectiveStatus = resolveEffectiveStatus(args5);
|
|
27289
27311
|
try {
|
|
27290
27312
|
const params = { "account-id": accountId };
|
|
@@ -27303,7 +27325,7 @@ var listCommand7 = defineCommand62({
|
|
|
27303
27325
|
var campaignsCommand3 = defineCommand62({
|
|
27304
27326
|
meta: {
|
|
27305
27327
|
name: "campaigns",
|
|
27306
|
-
description: `List campaigns for a Meta ad account, or stage writes (create/update/pause/resume/archive/duplicate).
|
|
27328
|
+
description: `List campaigns for a Meta ad account, or stage writes (create/update/pause/resume/archive/delete/duplicate).
|
|
27307
27329
|
Defaults to ACTIVE only \u2014 pass --all-statuses to widen. Write subcommands stage ops on this chat's draft and
|
|
27308
27330
|
apply only when the chat is published.
|
|
27309
27331
|
|
|
@@ -27330,6 +27352,7 @@ Examples:
|
|
|
27330
27352
|
pause: campaignsPauseCommand2,
|
|
27331
27353
|
resume: campaignsResumeCommand2,
|
|
27332
27354
|
archive: campaignsArchiveCommand2,
|
|
27355
|
+
delete: campaignsDeleteCommand,
|
|
27333
27356
|
duplicate: campaignsDuplicateCommand2
|
|
27334
27357
|
},
|
|
27335
27358
|
// `args` stays even though the parent has no `run`: citty scans rawArgs for the
|
|
@@ -27343,10 +27366,7 @@ Examples:
|
|
|
27343
27366
|
// src/commands/ads/meta/creatives.ts
|
|
27344
27367
|
import { defineCommand as defineCommand63 } from "citty";
|
|
27345
27368
|
var listArgs9 = {
|
|
27346
|
-
"account-id": {
|
|
27347
|
-
type: "string",
|
|
27348
|
-
description: "Meta ad account ID (act_...) when listing without --creative-id; defaults to the only connected account"
|
|
27349
|
-
},
|
|
27369
|
+
"account-id": { type: "string", description: "Meta ad account ID (required if no --creative-id)" },
|
|
27350
27370
|
"creative-id": { type: "string", description: "Single creative ID" },
|
|
27351
27371
|
limit: { type: "string", description: "Max rows (default 500)" },
|
|
27352
27372
|
"no-cache": NO_CACHE_ARG,
|
|
@@ -27364,7 +27384,7 @@ var listCommand8 = defineCommand63({
|
|
|
27364
27384
|
if (args5["creative-id"]) {
|
|
27365
27385
|
params["creative-id"] = args5["creative-id"];
|
|
27366
27386
|
} else {
|
|
27367
|
-
const accountId =
|
|
27387
|
+
const accountId = resolveAccountIdArg(args5);
|
|
27368
27388
|
params["account-id"] = accountId;
|
|
27369
27389
|
}
|
|
27370
27390
|
if (args5.limit) params.limit = args5.limit;
|
|
@@ -27444,11 +27464,7 @@ registerSchema({
|
|
|
27444
27464
|
command: "ads.meta.custom-conversions",
|
|
27445
27465
|
description: "List the Custom Conversions defined on a Meta ad account \u2014 the measurement objects a marketer sets up in Events Manager (a pixel event narrowed by a rule, e.g. 'PageView on /thank-you'). Start here whenever the user talks about their own conversions rather than a standard event: an ad set optimizes toward one with `adsets create --custom-conversion-id <id>`.",
|
|
27446
27466
|
args: {
|
|
27447
|
-
"account-id": {
|
|
27448
|
-
type: "string",
|
|
27449
|
-
description: "Meta ad account ID (act_...); defaults to the only connected account",
|
|
27450
|
-
required: false
|
|
27451
|
-
},
|
|
27467
|
+
"account-id": { type: "string", description: "Meta ad account ID (act_123)", required: false },
|
|
27452
27468
|
full: { type: "boolean", description: "Include the raw rule JSON, retention and creation times", required: false },
|
|
27453
27469
|
limit: { type: "string", description: "Max rows", required: false },
|
|
27454
27470
|
"no-cache": { type: "boolean", description: "Bypass the cache", required: false },
|
|
@@ -27456,7 +27472,7 @@ registerSchema({
|
|
|
27456
27472
|
}
|
|
27457
27473
|
});
|
|
27458
27474
|
var listArgs10 = {
|
|
27459
|
-
"account-id": { type: "string", description: "Meta ad account ID
|
|
27475
|
+
"account-id": { type: "string", description: "Meta ad account ID" },
|
|
27460
27476
|
full: { type: "boolean", description: "Include the raw rule JSON, retention and creation times" },
|
|
27461
27477
|
limit: { type: "string", description: "Max rows" },
|
|
27462
27478
|
"no-cache": NO_CACHE_ARG,
|
|
@@ -27469,7 +27485,7 @@ var listCommand9 = defineCommand64({
|
|
|
27469
27485
|
},
|
|
27470
27486
|
args: listArgs10,
|
|
27471
27487
|
run: async ({ args: args5 }) => {
|
|
27472
|
-
const accountId =
|
|
27488
|
+
const accountId = resolveAccountIdArg(args5);
|
|
27473
27489
|
try {
|
|
27474
27490
|
const params = { "account-id": accountId };
|
|
27475
27491
|
if (args5.limit) params.limit = args5.limit;
|
|
@@ -28346,10 +28362,7 @@ Examples:
|
|
|
28346
28362
|
baker ads meta pixels --account-id act_123 --pixel-id 9876 --stats --days 7`
|
|
28347
28363
|
},
|
|
28348
28364
|
args: {
|
|
28349
|
-
"account-id": {
|
|
28350
|
-
type: "string",
|
|
28351
|
-
description: "Meta ad account ID (act_...); defaults to the only connected account"
|
|
28352
|
-
},
|
|
28365
|
+
"account-id": { type: "string", description: "Meta ad account ID" },
|
|
28353
28366
|
"pixel-id": { type: "string", description: "Pixel ID for --stats" },
|
|
28354
28367
|
stats: { type: "boolean", description: "Fetch firing stats for the pixel" },
|
|
28355
28368
|
aggregation: {
|
|
@@ -28393,7 +28406,7 @@ async function runStats(args5) {
|
|
|
28393
28406
|
emit(data, args5);
|
|
28394
28407
|
}
|
|
28395
28408
|
async function runList(args5) {
|
|
28396
|
-
const accountId =
|
|
28409
|
+
const accountId = resolveAccountIdArg(args5);
|
|
28397
28410
|
const params = { "account-id": accountId };
|
|
28398
28411
|
if (args5["no-cache"]) params["skip-cache"] = "true";
|
|
28399
28412
|
const { pixels, restrictedFields } = await apiGet("/api/ads/meta/pixels", params);
|