@koda-sl/baker-cli 0.366.0-dev.b6091bc9b → 0.366.0-dev.efa067f23
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 +3 -4
- package/dist/{chunk-A2LM5EDF.js → chunk-FXVELNAS.js} +6 -3
- package/dist/{chunk-A2LM5EDF.js.map → chunk-FXVELNAS.js.map} +1 -1
- package/dist/{chunk-BLMXG42J.js → chunk-L4QXAYIC.js} +15 -3
- package/dist/{chunk-BLMXG42J.js.map → chunk-L4QXAYIC.js.map} +1 -1
- package/dist/cli.js +169 -317
- package/dist/cli.js.map +1 -1
- package/dist/{output-M2DBCZFG.js → output-AT5SRVH7.js} +2 -2
- package/dist/{shared-BROA3UXS.js → shared-HZ44PY2F.js} +5 -3
- package/package.json +1 -1
- /package/dist/{output-M2DBCZFG.js.map → output-AT5SRVH7.js.map} +0 -0
- /package/dist/{shared-BROA3UXS.js.map → shared-HZ44PY2F.js.map} +0 -0
package/dist/cli.js
CHANGED
|
@@ -77,8 +77,9 @@ import {
|
|
|
77
77
|
handleMetaError,
|
|
78
78
|
resolveAccountIdArg,
|
|
79
79
|
resolveEffectiveStatus,
|
|
80
|
+
statusFilterHints,
|
|
80
81
|
todayIso
|
|
81
|
-
} from "./chunk-
|
|
82
|
+
} from "./chunk-L4QXAYIC.js";
|
|
82
83
|
import {
|
|
83
84
|
buildQueryCacheKey,
|
|
84
85
|
cacheGet,
|
|
@@ -94,7 +95,7 @@ import {
|
|
|
94
95
|
writeAdsJson,
|
|
95
96
|
writeAdsOutput,
|
|
96
97
|
writeJsonEnvelope
|
|
97
|
-
} from "./chunk-
|
|
98
|
+
} from "./chunk-FXVELNAS.js";
|
|
98
99
|
import {
|
|
99
100
|
ApiError,
|
|
100
101
|
apiGet,
|
|
@@ -9223,7 +9224,7 @@ var linkCommand = defineCommand7({
|
|
|
9223
9224
|
import { defineCommand as defineCommand8 } from "citty";
|
|
9224
9225
|
registerSchema({
|
|
9225
9226
|
command: "actions.list",
|
|
9226
|
-
description: 'List actions for the current company. Default: pre-bucketed (claimable/myClaims/blocked/claimedByOthers/completed/discarded), each bucket ordered do-first (blockers before blocked, then highest-leverage). The bucketed view reads the whole open backlog, so nothing pending is ever hidden from it. Set --bucketed=false for a flat list filterable by --status, orderable by --sort, and windowed by --limit. Looking for one Task by name? --search "conversion goal" --output md returns only the matching Tasks instead of the whole backlog.',
|
|
9227
|
+
description: 'List actions for the current company. Compact by default: each Task is its id, name, status, hint and a one-line `summary` of its description; add --full for whole descriptions (or `baker actions get <id>` for one Task). Default: pre-bucketed (claimable/myClaims/blocked/claimedByOthers/completed/discarded), each bucket ordered do-first (blockers before blocked, then highest-leverage). The bucketed view reads the whole open backlog, so nothing pending is ever hidden from it. Set --bucketed=false for a flat list filterable by --status, orderable by --sort, and windowed by --limit. Looking for one Task by name? --search "conversion goal" --output md returns only the matching Tasks instead of the whole backlog.',
|
|
9227
9228
|
args: {
|
|
9228
9229
|
search: {
|
|
9229
9230
|
type: "string",
|
|
@@ -9251,13 +9252,19 @@ registerSchema({
|
|
|
9251
9252
|
description: `How many Tasks a flat list reads, newest first (only with --bucketed=false). Default: ${ACTIONS_LIST_DEFAULT_LIMIT}. When the read comes back full, hints[] says so \u2014 raise --limit to reach older Tasks.`,
|
|
9252
9253
|
required: false
|
|
9253
9254
|
},
|
|
9255
|
+
full: {
|
|
9256
|
+
type: "boolean",
|
|
9257
|
+
description: "Print every Task's whole description (and the flat list's full record) instead of a one-line summary. Large on a real backlog \u2014 prefer --search, or `baker actions get <id>` for one Task.",
|
|
9258
|
+
required: false,
|
|
9259
|
+
default: false
|
|
9260
|
+
},
|
|
9254
9261
|
output: { type: "string", description: "Output format: json|md. Default: json", required: false }
|
|
9255
9262
|
}
|
|
9256
9263
|
});
|
|
9257
9264
|
var listCommand2 = defineCommand8({
|
|
9258
9265
|
meta: {
|
|
9259
9266
|
name: "list",
|
|
9260
|
-
description: "List actions. Default: bucketed view (claimable, myClaims, blocked, claimedByOthers). Use --bucketed=false for raw filter by --status,
|
|
9267
|
+
description: "List actions, one short row per Task (id, name, status, one-line summary). Default: bucketed view (claimable, myClaims, blocked, claimedByOthers). Use --bucketed=false for raw filter by --status, --search <text> to find Tasks by name, --full for whole descriptions."
|
|
9261
9268
|
},
|
|
9262
9269
|
args: {
|
|
9263
9270
|
search: { type: "string", description: "Find Tasks by words in name/description/tags", required: false },
|
|
@@ -9265,6 +9272,12 @@ var listCommand2 = defineCommand8({
|
|
|
9265
9272
|
status: { type: "string", description: "Status filter (raw mode)", required: false },
|
|
9266
9273
|
sort: { type: "string", description: "Order (raw mode): priority|recent", required: false },
|
|
9267
9274
|
limit: { type: "string", description: "How many Tasks to read (raw mode)", required: false },
|
|
9275
|
+
full: {
|
|
9276
|
+
type: "boolean",
|
|
9277
|
+
description: "Whole descriptions instead of a summary line",
|
|
9278
|
+
required: false,
|
|
9279
|
+
default: false
|
|
9280
|
+
},
|
|
9268
9281
|
output: { type: "string", description: "Output format: json|md", required: false }
|
|
9269
9282
|
},
|
|
9270
9283
|
run: async ({ args: args5 }) => {
|
|
@@ -9272,7 +9285,8 @@ var listCommand2 = defineCommand8({
|
|
|
9272
9285
|
const body = buildListRequest(args5, getEnv().BAKER_CHAT_ID);
|
|
9273
9286
|
const response = await apiPost("/api/actions/list", body);
|
|
9274
9287
|
const hints2 = body.bucketed === false && body.limit !== void 0 && response.ok && Array.isArray(response.data) ? buildListHints({ returned: response.data.length, limit: body.limit }) : [];
|
|
9275
|
-
const
|
|
9288
|
+
const shaped = args5.full || !response.ok ? response : { ...response, data: compactListData(response.data) };
|
|
9289
|
+
const envelope = hints2.length > 0 ? { ...shaped, hints: hints2 } : shaped;
|
|
9276
9290
|
if (args5.output === "md" && envelope.ok) {
|
|
9277
9291
|
process.stdout.write(renderMarkdown(envelope.data, hints2));
|
|
9278
9292
|
return;
|
|
@@ -9304,6 +9318,52 @@ function buildListRequest(args5, chatId) {
|
|
|
9304
9318
|
}
|
|
9305
9319
|
return body;
|
|
9306
9320
|
}
|
|
9321
|
+
var SUMMARY_MAX_CHARS = 100;
|
|
9322
|
+
function summarizeDescription(description) {
|
|
9323
|
+
const line = description.split("\n").filter((raw) => !/^\s*#{1,6}\s/.test(raw)).map(
|
|
9324
|
+
(raw) => raw.replace(/^\s*(?:[-*+>]|\d+[.)])\s+/, "").replace(/[*_`]/g, "").replace(/\s+/g, " ").trim()
|
|
9325
|
+
).find((text2) => text2.length > 0) ?? "";
|
|
9326
|
+
if (line.length <= SUMMARY_MAX_CHARS) {
|
|
9327
|
+
return line;
|
|
9328
|
+
}
|
|
9329
|
+
const cut = line.slice(0, SUMMARY_MAX_CHARS - 1);
|
|
9330
|
+
const lastSpace = cut.lastIndexOf(" ");
|
|
9331
|
+
return `${(lastSpace > SUMMARY_MAX_CHARS / 2 ? cut.slice(0, lastSpace) : cut).trimEnd()}\u2026`;
|
|
9332
|
+
}
|
|
9333
|
+
function compactBucketEntry(entry) {
|
|
9334
|
+
const { description, ...rest } = entry;
|
|
9335
|
+
return { ...rest, summary: summarizeDescription(typeof description === "string" ? description : "") };
|
|
9336
|
+
}
|
|
9337
|
+
function compactFlatRow(entry) {
|
|
9338
|
+
const nested = entry.action;
|
|
9339
|
+
const doc = nested && typeof nested === "object" ? nested : entry;
|
|
9340
|
+
const { id, name, status, hint } = toRow(entry);
|
|
9341
|
+
const assignee = entry.assignee && typeof entry.assignee === "object" ? entry.assignee : null;
|
|
9342
|
+
return {
|
|
9343
|
+
id,
|
|
9344
|
+
name,
|
|
9345
|
+
status,
|
|
9346
|
+
...typeof doc.priority === "string" ? { priority: doc.priority } : {},
|
|
9347
|
+
...Array.isArray(doc.tags) && doc.tags.length > 0 ? { tags: doc.tags } : {},
|
|
9348
|
+
summary: summarizeDescription(typeof doc.description === "string" ? doc.description : ""),
|
|
9349
|
+
...hint ? { hint } : {},
|
|
9350
|
+
...typeof assignee?.name === "string" ? { assignee: assignee.name } : {}
|
|
9351
|
+
};
|
|
9352
|
+
}
|
|
9353
|
+
function compactListData(data) {
|
|
9354
|
+
if (Array.isArray(data)) {
|
|
9355
|
+
return data.map((entry) => compactFlatRow(entry));
|
|
9356
|
+
}
|
|
9357
|
+
if (!data || typeof data !== "object") {
|
|
9358
|
+
return data;
|
|
9359
|
+
}
|
|
9360
|
+
return Object.fromEntries(
|
|
9361
|
+
Object.entries(data).map(([bucket, entries]) => [
|
|
9362
|
+
bucket,
|
|
9363
|
+
Array.isArray(entries) ? entries.map((entry) => compactBucketEntry(entry)) : entries
|
|
9364
|
+
])
|
|
9365
|
+
);
|
|
9366
|
+
}
|
|
9307
9367
|
function toRow(entry) {
|
|
9308
9368
|
const nested = entry.action;
|
|
9309
9369
|
const doc = nested && typeof nested === "object" ? nested : entry;
|
|
@@ -9325,6 +9385,14 @@ function renderEntry(entry) {
|
|
|
9325
9385
|
const row = toRow(entry);
|
|
9326
9386
|
const suffix = row.status ? ` [${row.status}]` : "";
|
|
9327
9387
|
const lines = [`- \`${row.id}\` ${row.name}${suffix}`];
|
|
9388
|
+
const nested = entry.action;
|
|
9389
|
+
const doc = nested && typeof nested === "object" ? nested : entry;
|
|
9390
|
+
const text2 = typeof entry.summary === "string" ? entry.summary : doc.description;
|
|
9391
|
+
if (typeof text2 === "string" && text2.trim()) {
|
|
9392
|
+
lines.push(
|
|
9393
|
+
...text2.trim().split("\n").map((line) => line ? ` ${line}` : "")
|
|
9394
|
+
);
|
|
9395
|
+
}
|
|
9328
9396
|
if (row.hint) {
|
|
9329
9397
|
lines.push(` ${row.hint}`);
|
|
9330
9398
|
}
|
|
@@ -22955,49 +23023,9 @@ Subcommands:
|
|
|
22955
23023
|
|
|
22956
23024
|
// src/commands/ads/linkedin/creatives.ts
|
|
22957
23025
|
import { defineCommand as defineCommand44 } from "citty";
|
|
22958
|
-
|
|
22959
|
-
// src/commands/ads/list-rows.ts
|
|
22960
23026
|
function asRecord(value) {
|
|
22961
23027
|
return typeof value === "object" && value !== null && !Array.isArray(value) ? value : void 0;
|
|
22962
23028
|
}
|
|
22963
|
-
function readPath2(row, path48) {
|
|
22964
|
-
let current = row;
|
|
22965
|
-
for (const segment of path48.split(".")) {
|
|
22966
|
-
const record = asRecord(current);
|
|
22967
|
-
if (!record) return void 0;
|
|
22968
|
-
current = record[segment];
|
|
22969
|
-
}
|
|
22970
|
-
return current;
|
|
22971
|
-
}
|
|
22972
|
-
function projectFields(rows, paths) {
|
|
22973
|
-
return rows.map((row) => {
|
|
22974
|
-
const projected = {};
|
|
22975
|
-
for (const path48 of paths) {
|
|
22976
|
-
const value = readPath2(row, path48);
|
|
22977
|
-
if (value !== void 0) {
|
|
22978
|
-
projected[path48] = value;
|
|
22979
|
-
}
|
|
22980
|
-
}
|
|
22981
|
-
return projected;
|
|
22982
|
-
});
|
|
22983
|
-
}
|
|
22984
|
-
function shapeListRows(rows, args5, compact3) {
|
|
22985
|
-
const raw = rows;
|
|
22986
|
-
const fields = typeof args5.fields === "string" ? args5.fields : void 0;
|
|
22987
|
-
if (fields) {
|
|
22988
|
-
const paths = fields.split(",").map((field) => field.trim()).filter((field) => field.length > 0);
|
|
22989
|
-
if (paths.length > 0) {
|
|
22990
|
-
return { rows: projectFields(raw, paths), fields: paths };
|
|
22991
|
-
}
|
|
22992
|
-
}
|
|
22993
|
-
if (args5.full) return { rows: raw };
|
|
22994
|
-
return { rows: rows.map(compact3.row), fields: [...compact3.columns] };
|
|
22995
|
-
}
|
|
22996
|
-
|
|
22997
|
-
// src/commands/ads/linkedin/creatives.ts
|
|
22998
|
-
function asRecord2(value) {
|
|
22999
|
-
return typeof value === "object" && value !== null && !Array.isArray(value) ? value : void 0;
|
|
23000
|
-
}
|
|
23001
23029
|
function asString(value) {
|
|
23002
23030
|
return typeof value === "string" && value.length > 0 ? value : void 0;
|
|
23003
23031
|
}
|
|
@@ -23005,12 +23033,12 @@ function creativeDestination(content) {
|
|
|
23005
23033
|
if (!content) return { format: "unknown" };
|
|
23006
23034
|
const reference = asString(content.reference);
|
|
23007
23035
|
if (reference) return { format: "post", postUrn: reference };
|
|
23008
|
-
const textAd =
|
|
23036
|
+
const textAd = asRecord(content.textAd);
|
|
23009
23037
|
if (textAd) return { format: "text", landingUrl: asString(textAd.landingPage) };
|
|
23010
|
-
const spotlight =
|
|
23038
|
+
const spotlight = asRecord(content.spotlight);
|
|
23011
23039
|
if (spotlight) return { format: "spotlight", landingUrl: asString(spotlight.landingPage) };
|
|
23012
|
-
if (
|
|
23013
|
-
if (
|
|
23040
|
+
if (asRecord(content.follower)) return { format: "follower" };
|
|
23041
|
+
if (asRecord(content.jobs)) return { format: "jobs" };
|
|
23014
23042
|
return { format: "unknown" };
|
|
23015
23043
|
}
|
|
23016
23044
|
var COMPACT_COLUMNS = [
|
|
@@ -23038,6 +23066,27 @@ function compactRow(row) {
|
|
|
23038
23066
|
...destination.postUrn ? { postUrn: destination.postUrn } : {}
|
|
23039
23067
|
};
|
|
23040
23068
|
}
|
|
23069
|
+
function readPath2(row, path48) {
|
|
23070
|
+
let current = row;
|
|
23071
|
+
for (const segment of path48.split(".")) {
|
|
23072
|
+
const record = asRecord(current);
|
|
23073
|
+
if (!record) return void 0;
|
|
23074
|
+
current = record[segment];
|
|
23075
|
+
}
|
|
23076
|
+
return current;
|
|
23077
|
+
}
|
|
23078
|
+
function projectFields(rows, paths) {
|
|
23079
|
+
return rows.map((row) => {
|
|
23080
|
+
const projected = {};
|
|
23081
|
+
for (const path48 of paths) {
|
|
23082
|
+
const value = readPath2(row, path48);
|
|
23083
|
+
if (value !== void 0) {
|
|
23084
|
+
projected[path48] = value;
|
|
23085
|
+
}
|
|
23086
|
+
}
|
|
23087
|
+
return projected;
|
|
23088
|
+
});
|
|
23089
|
+
}
|
|
23041
23090
|
function unmappedShapeWarnings(rows, rawContentReturned) {
|
|
23042
23091
|
const unmapped = rows.filter((row) => row.content && creativeDestination(row.content).format === "unknown");
|
|
23043
23092
|
if (unmapped.length === 0) return [];
|
|
@@ -23049,6 +23098,18 @@ function unmappedShapeWarnings(rows, rawContentReturned) {
|
|
|
23049
23098
|
}
|
|
23050
23099
|
];
|
|
23051
23100
|
}
|
|
23101
|
+
function shapeRows(rows, args5) {
|
|
23102
|
+
const raw = rows;
|
|
23103
|
+
const fields = typeof args5.fields === "string" ? args5.fields : void 0;
|
|
23104
|
+
if (fields) {
|
|
23105
|
+
const paths = fields.split(",").map((field) => field.trim()).filter((field) => field.length > 0);
|
|
23106
|
+
if (paths.length > 0) {
|
|
23107
|
+
return { rows: projectFields(raw, paths), fields: paths };
|
|
23108
|
+
}
|
|
23109
|
+
}
|
|
23110
|
+
if (args5.full) return { rows: raw };
|
|
23111
|
+
return { rows: rows.map(compactRow), fields: [...COMPACT_COLUMNS] };
|
|
23112
|
+
}
|
|
23052
23113
|
var listArgs3 = {
|
|
23053
23114
|
"account-id": { type: "string", description: "Numeric account ID or urn:li:sponsoredAccount:N" },
|
|
23054
23115
|
"account-urn": { type: "string", description: "Alias for --account-id" },
|
|
@@ -23080,10 +23141,7 @@ var creativesListCommand = defineCommand44({
|
|
|
23080
23141
|
if (args5.limit) params.limit = String(args5.limit);
|
|
23081
23142
|
if (args5["no-cache"]) params["skip-cache"] = "true";
|
|
23082
23143
|
const data = await apiGet("/api/ads/linkedin/creatives", params);
|
|
23083
|
-
const shaped =
|
|
23084
|
-
row: compactRow,
|
|
23085
|
-
columns: COMPACT_COLUMNS
|
|
23086
|
-
});
|
|
23144
|
+
const shaped = shapeRows(data, args5);
|
|
23087
23145
|
const fmt = csvOrJson2(args5);
|
|
23088
23146
|
if (fmt !== "json") {
|
|
23089
23147
|
writeAdsOutput(shaped.rows, fmt, shaped.fields);
|
|
@@ -24101,198 +24159,22 @@ Examples:
|
|
|
24101
24159
|
|
|
24102
24160
|
// src/commands/ads/meta/activities.ts
|
|
24103
24161
|
import { defineCommand as defineCommand56 } from "citty";
|
|
24104
|
-
|
|
24105
|
-
// src/commands/ads/meta/list-rows.ts
|
|
24106
|
-
function pick(row, keys) {
|
|
24107
|
-
const picked = {};
|
|
24108
|
-
for (const key of keys) {
|
|
24109
|
-
if (row[key] !== void 0) picked[key] = row[key];
|
|
24110
|
-
}
|
|
24111
|
-
return picked;
|
|
24112
|
-
}
|
|
24113
|
-
function asRecord3(value) {
|
|
24114
|
-
return typeof value === "object" && value !== null && !Array.isArray(value) ? value : void 0;
|
|
24115
|
-
}
|
|
24116
|
-
var CAMPAIGN_COLUMNS = ["id", "name", "effective_status", "daily_budget", "lifetime_budget", "created_date"];
|
|
24117
|
-
function compactCampaign(row) {
|
|
24118
|
-
const created = row.created_time;
|
|
24119
|
-
return {
|
|
24120
|
-
...pick(row, ["id", "name", "effective_status", "daily_budget", "lifetime_budget"]),
|
|
24121
|
-
...typeof created === "string" ? { created_date: created.slice(0, 10) } : {}
|
|
24122
|
-
};
|
|
24123
|
-
}
|
|
24124
|
-
var ADSET_KEYS = [
|
|
24125
|
-
"id",
|
|
24126
|
-
"name",
|
|
24127
|
-
"campaign_id",
|
|
24128
|
-
"effective_status",
|
|
24129
|
-
"optimization_goal",
|
|
24130
|
-
"billing_event",
|
|
24131
|
-
"bid_strategy",
|
|
24132
|
-
"daily_budget",
|
|
24133
|
-
"lifetime_budget",
|
|
24134
|
-
"destination_type",
|
|
24135
|
-
// A Dynamic Creative ad set refuses every new ad, which changes the plan before anything is staged.
|
|
24136
|
-
"is_dynamic_creative"
|
|
24137
|
-
];
|
|
24138
|
-
var ADSET_COLUMNS = [...ADSET_KEYS, "learning_stage", "end_time", "created_time"];
|
|
24139
|
-
function compactAdSet(row) {
|
|
24140
|
-
const learning = asRecord3(row.learning_stage_info)?.status;
|
|
24141
|
-
return {
|
|
24142
|
-
...pick(row, ADSET_KEYS),
|
|
24143
|
-
...typeof learning === "string" ? { learning_stage: learning } : {},
|
|
24144
|
-
...pick(row, ["end_time", "created_time"])
|
|
24145
|
-
};
|
|
24146
|
-
}
|
|
24147
|
-
var AD_COLUMNS = [
|
|
24148
|
-
"id",
|
|
24149
|
-
"name",
|
|
24150
|
-
"adset_id",
|
|
24151
|
-
"campaign_id",
|
|
24152
|
-
"effective_status",
|
|
24153
|
-
"creative_id",
|
|
24154
|
-
"issues",
|
|
24155
|
-
"created_time"
|
|
24156
|
-
];
|
|
24157
|
-
function adIssues(value) {
|
|
24158
|
-
if (!Array.isArray(value)) return [];
|
|
24159
|
-
return value.flatMap((entry) => {
|
|
24160
|
-
const issue = asRecord3(entry);
|
|
24161
|
-
const text2 = issue?.error_summary ?? issue?.error_message;
|
|
24162
|
-
return typeof text2 === "string" && text2 ? [text2] : [];
|
|
24163
|
-
});
|
|
24164
|
-
}
|
|
24165
|
-
function compactAd(row) {
|
|
24166
|
-
const creativeId = asRecord3(row.creative)?.id;
|
|
24167
|
-
const issues = adIssues(row.issues_info);
|
|
24168
|
-
return {
|
|
24169
|
-
...pick(row, ["id", "name", "adset_id", "campaign_id", "effective_status"]),
|
|
24170
|
-
...creativeId !== void 0 ? { creative_id: creativeId } : {},
|
|
24171
|
-
...issues.length > 0 ? { issues } : {},
|
|
24172
|
-
...pick(row, ["created_time"])
|
|
24173
|
-
};
|
|
24174
|
-
}
|
|
24175
|
-
var ACTIVITY_COLUMNS = [
|
|
24176
|
-
"event_time",
|
|
24177
|
-
"event_type",
|
|
24178
|
-
"actor_name",
|
|
24179
|
-
"object_type",
|
|
24180
|
-
"object_name",
|
|
24181
|
-
"object_id",
|
|
24182
|
-
"change"
|
|
24183
|
-
];
|
|
24184
|
-
function isScalar(value) {
|
|
24185
|
-
return value === null || typeof value === "string" || typeof value === "number";
|
|
24186
|
-
}
|
|
24187
|
-
function activityChange(extraData) {
|
|
24188
|
-
if (typeof extraData !== "string") return void 0;
|
|
24189
|
-
let parsed;
|
|
24190
|
-
try {
|
|
24191
|
-
parsed = JSON.parse(extraData);
|
|
24192
|
-
} catch {
|
|
24193
|
-
return void 0;
|
|
24194
|
-
}
|
|
24195
|
-
const data = asRecord3(parsed);
|
|
24196
|
-
if (!data || !("new_value" in data) || !isScalar(data.new_value) || !isScalar(data.old_value ?? null)) {
|
|
24197
|
-
return void 0;
|
|
24198
|
-
}
|
|
24199
|
-
const show = (value) => value === null || value === void 0 ? "(none)" : String(value);
|
|
24200
|
-
return `${show(data.old_value)} \u2192 ${show(data.new_value)}`;
|
|
24201
|
-
}
|
|
24202
|
-
function compactActivity(row) {
|
|
24203
|
-
const change = activityChange(row.extra_data);
|
|
24204
|
-
return {
|
|
24205
|
-
...pick(row, ["event_time", "event_type", "actor_name", "object_type", "object_name", "object_id"]),
|
|
24206
|
-
...change !== void 0 ? { change } : {}
|
|
24207
|
-
};
|
|
24208
|
-
}
|
|
24209
|
-
var PROJECTIONS = {
|
|
24210
|
-
campaigns: { row: compactCampaign, columns: CAMPAIGN_COLUMNS },
|
|
24211
|
-
adsets: { row: compactAdSet, columns: ADSET_COLUMNS },
|
|
24212
|
-
ads: { row: compactAd, columns: AD_COLUMNS },
|
|
24213
|
-
activities: { row: compactActivity, columns: ACTIVITY_COLUMNS }
|
|
24214
|
-
};
|
|
24215
|
-
function shapeMetaListRows(kind, rows, args5) {
|
|
24216
|
-
return shapeListRows(rows, args5, PROJECTIONS[kind]);
|
|
24217
|
-
}
|
|
24218
|
-
var NOUNS = {
|
|
24219
|
-
campaigns: "campaigns",
|
|
24220
|
-
adsets: "ad sets",
|
|
24221
|
-
ads: "ads",
|
|
24222
|
-
activities: "activities"
|
|
24223
|
-
};
|
|
24224
|
-
function writeMetaListRows(kind, shaped, format) {
|
|
24225
|
-
if (format === "json") {
|
|
24226
|
-
writeAdsJson({ ok: true, data: shaped.rows });
|
|
24227
|
-
return;
|
|
24228
|
-
}
|
|
24229
|
-
if (format === "md" && shaped.rows.length === 0) {
|
|
24230
|
-
process.stdout.write(`No ${NOUNS[kind]} matched.
|
|
24231
|
-
`);
|
|
24232
|
-
return;
|
|
24233
|
-
}
|
|
24234
|
-
writeAdsOutput(shaped.rows, format, shaped.fields);
|
|
24235
|
-
}
|
|
24236
|
-
var META_LIST_SHAPE_ARGS = {
|
|
24237
|
-
fields: {
|
|
24238
|
-
type: "string",
|
|
24239
|
-
description: "CSV of dotted paths to return instead of the compact row, e.g. id,name,targeting.geo_locations"
|
|
24240
|
-
},
|
|
24241
|
-
full: { type: "boolean", description: "Return every field Meta sent (targeting, tracking specs, raw extra_data)" },
|
|
24242
|
-
output: {
|
|
24243
|
-
type: "string",
|
|
24244
|
-
description: "md|json|csv|jsonl \u2014 md (default) prints a table; json returns the rows in the { ok, data } envelope",
|
|
24245
|
-
default: "md"
|
|
24246
|
-
}
|
|
24247
|
-
};
|
|
24248
|
-
function registerMetaListSchema(kind, description, args5) {
|
|
24249
|
-
registerSchema({
|
|
24250
|
-
command: `ads.meta.${kind}`,
|
|
24251
|
-
description,
|
|
24252
|
-
args: Object.fromEntries(
|
|
24253
|
-
Object.entries(args5).map(([name, def]) => [
|
|
24254
|
-
name,
|
|
24255
|
-
{
|
|
24256
|
-
type: def.type,
|
|
24257
|
-
description: def.description ?? "",
|
|
24258
|
-
required: false,
|
|
24259
|
-
...def.default !== void 0 ? { default: def.default } : {}
|
|
24260
|
-
}
|
|
24261
|
-
])
|
|
24262
|
-
)
|
|
24263
|
-
});
|
|
24264
|
-
}
|
|
24265
|
-
|
|
24266
|
-
// src/commands/ads/meta/activities.ts
|
|
24267
|
-
var listArgs4 = {
|
|
24268
|
-
"account-id": { type: "string", description: "Meta ad account ID" },
|
|
24269
|
-
days: { type: "string", description: "Lookback days (default 7)" },
|
|
24270
|
-
limit: { type: "string", description: "Max rows" },
|
|
24271
|
-
"no-cache": NO_CACHE_ARG,
|
|
24272
|
-
...META_LIST_SHAPE_ARGS
|
|
24273
|
-
};
|
|
24274
|
-
registerMetaListSchema(
|
|
24275
|
-
"activities",
|
|
24276
|
-
"Account change log, as a table by default, one row per event: event_time, event_type, actor_name, object_type, object_name, object_id, and change ('old \u2192 new' when the change is a single value). Start here: baker ads meta activities --account-id act_123 --days 2. --fields event_time,object_name,extra_data or --full for the raw change payload; --output json returns the rows in the envelope.",
|
|
24277
|
-
listArgs4
|
|
24278
|
-
);
|
|
24279
24162
|
var activitiesCommand = defineCommand56({
|
|
24280
24163
|
meta: {
|
|
24281
24164
|
name: "activities",
|
|
24282
24165
|
description: `Audit log of recent ad-account changes (created, paused, edited). Default lookback 7 days,
|
|
24283
24166
|
~90 day retention server-side.
|
|
24284
24167
|
|
|
24285
|
-
A table by default, one row per event: event_time, event_type, actor_name, object_type,
|
|
24286
|
-
object_name, object_id, and change ("old \u2192 new" when the change is a single value: status,
|
|
24287
|
-
name, budget, goal). --fields takes dotted paths (extra_data holds the raw change); --full returns
|
|
24288
|
-
every field Meta sent; --output json returns the rows as JSON.
|
|
24289
|
-
|
|
24290
24168
|
Examples:
|
|
24291
|
-
baker ads meta activities --account-id act_123 --days 14
|
|
24292
|
-
|
|
24293
|
-
|
|
24169
|
+
baker ads meta activities --account-id act_123 --days 14`
|
|
24170
|
+
},
|
|
24171
|
+
args: {
|
|
24172
|
+
"account-id": { type: "string", description: "Meta ad account ID" },
|
|
24173
|
+
days: { type: "string", description: "Lookback days (default 7)" },
|
|
24174
|
+
limit: { type: "string", description: "Max rows" },
|
|
24175
|
+
"no-cache": NO_CACHE_ARG,
|
|
24176
|
+
output: { type: "string", description: "Output format", default: "json" }
|
|
24294
24177
|
},
|
|
24295
|
-
args: listArgs4,
|
|
24296
24178
|
run: async ({ args: args5 }) => {
|
|
24297
24179
|
const accountId = resolveAccountIdArg(args5);
|
|
24298
24180
|
try {
|
|
@@ -24301,8 +24183,12 @@ Examples:
|
|
|
24301
24183
|
if (args5.limit) params.limit = args5.limit;
|
|
24302
24184
|
if (args5["no-cache"]) params["skip-cache"] = "true";
|
|
24303
24185
|
const data = await apiGet("/api/ads/meta/activities", params);
|
|
24304
|
-
const
|
|
24305
|
-
|
|
24186
|
+
const fmt = csvOrJson(args5);
|
|
24187
|
+
if (fmt !== "json") {
|
|
24188
|
+
writeAdsOutput(data, fmt);
|
|
24189
|
+
return;
|
|
24190
|
+
}
|
|
24191
|
+
writeAdsJson({ ok: true, data });
|
|
24306
24192
|
} catch (err) {
|
|
24307
24193
|
handleMetaError(err);
|
|
24308
24194
|
}
|
|
@@ -26563,8 +26449,8 @@ Example: baker ads meta ads retag 120252158038400247 --url-tags "utm_source={{si
|
|
|
26563
26449
|
run: async ({ args: args5 }) => {
|
|
26564
26450
|
const { apiPost: apiPost2 } = await import("./client-3DGBQ2H3.js");
|
|
26565
26451
|
const { requireChatId: requireChatId2 } = await import("./env-BSG7TY5Y.js");
|
|
26566
|
-
const { writeJsonEnvelope: writeJsonEnvelope2 } = await import("./output-
|
|
26567
|
-
const { handleMetaError: handleMetaError2 } = await import("./shared-
|
|
26452
|
+
const { writeJsonEnvelope: writeJsonEnvelope2 } = await import("./output-AT5SRVH7.js");
|
|
26453
|
+
const { handleMetaError: handleMetaError2 } = await import("./shared-HZ44PY2F.js");
|
|
26568
26454
|
try {
|
|
26569
26455
|
const accountId = bareAccountId2(args5);
|
|
26570
26456
|
const urlTags = typeof args5["url-tags"] === "string" ? args5["url-tags"] : void 0;
|
|
@@ -26711,8 +26597,8 @@ function duplicateCommand2(entity, label) {
|
|
|
26711
26597
|
run: async ({ args: args5 }) => {
|
|
26712
26598
|
const { apiPost: apiPost2 } = await import("./client-3DGBQ2H3.js");
|
|
26713
26599
|
const { requireChatId: requireChatId2 } = await import("./env-BSG7TY5Y.js");
|
|
26714
|
-
const { writeJsonEnvelope: writeJsonEnvelope2 } = await import("./output-
|
|
26715
|
-
const { handleMetaError: handleMetaError2 } = await import("./shared-
|
|
26600
|
+
const { writeJsonEnvelope: writeJsonEnvelope2 } = await import("./output-AT5SRVH7.js");
|
|
26601
|
+
const { handleMetaError: handleMetaError2 } = await import("./shared-HZ44PY2F.js");
|
|
26716
26602
|
try {
|
|
26717
26603
|
const accountId = bareAccountId2(args5);
|
|
26718
26604
|
const chatId = requireChatId2();
|
|
@@ -26745,7 +26631,7 @@ var adsArchiveCommand = statusCommand3("archive", "ad.update", "ad");
|
|
|
26745
26631
|
var adsDuplicateCommand = duplicateCommand2("ad", "ad");
|
|
26746
26632
|
|
|
26747
26633
|
// src/commands/ads/meta/ads.ts
|
|
26748
|
-
var
|
|
26634
|
+
var listArgs4 = {
|
|
26749
26635
|
"account-id": { type: "string", description: "Meta ad account ID" },
|
|
26750
26636
|
"adset-id": { type: "string", description: "Filter to one adset" },
|
|
26751
26637
|
"campaign-id": { type: "string", description: "Filter to one campaign" },
|
|
@@ -26753,19 +26639,14 @@ var listArgs5 = {
|
|
|
26753
26639
|
"all-statuses": { type: "boolean", description: "Drop the default ACTIVE filter" },
|
|
26754
26640
|
limit: { type: "string", description: "Max rows (default 1000)" },
|
|
26755
26641
|
"no-cache": NO_CACHE_ARG,
|
|
26756
|
-
|
|
26642
|
+
output: { type: "string", description: "Output format", default: "json" }
|
|
26757
26643
|
};
|
|
26758
|
-
registerMetaListSchema(
|
|
26759
|
-
"ads",
|
|
26760
|
-
"List ads in a Meta ad account, as a table by default: id, name, adset_id, campaign_id, effective_status, creative_id, issues (why an ad is WITH_ISSUES), created_time. Start here: baker ads meta ads --adset-id 6123. --fields takes dotted paths (e.g. id,tracking_specs); --full returns every field Meta sent; --output json returns the rows in the envelope.",
|
|
26761
|
-
listArgs5
|
|
26762
|
-
);
|
|
26763
26644
|
var listCommand4 = defineCommand58({
|
|
26764
26645
|
meta: {
|
|
26765
26646
|
name: "list",
|
|
26766
26647
|
description: "List ads in a Meta ad account. Runs by default when no subcommand is given. Example: baker ads meta ads --account-id act_123"
|
|
26767
26648
|
},
|
|
26768
|
-
args:
|
|
26649
|
+
args: listArgs4,
|
|
26769
26650
|
run: async ({ args: args5 }) => {
|
|
26770
26651
|
const accountId = resolveAccountIdArg(args5);
|
|
26771
26652
|
const effectiveStatus = resolveEffectiveStatus(args5);
|
|
@@ -26777,8 +26658,7 @@ var listCommand4 = defineCommand58({
|
|
|
26777
26658
|
if (args5.limit) params.limit = args5.limit;
|
|
26778
26659
|
if (args5["no-cache"]) params["skip-cache"] = "true";
|
|
26779
26660
|
const data = await apiGet("/api/ads/meta/ads", params);
|
|
26780
|
-
|
|
26781
|
-
writeMetaListRows("ads", shaped, csvOrJson(args5));
|
|
26661
|
+
writeAdsOutput(data, csvOrJson(args5), void 0, statusFilterHints(data, effectiveStatus, "ads"));
|
|
26782
26662
|
} catch (err) {
|
|
26783
26663
|
handleMetaError(err);
|
|
26784
26664
|
}
|
|
@@ -26792,14 +26672,9 @@ Defaults to ACTIVE only \u2014 pass --all-statuses to widen. Write subcommands s
|
|
|
26792
26672
|
|
|
26793
26673
|
The dashboard shows effective_status (e.g. WITH_ISSUES, PENDING_REVIEW, DISAPPROVED, ADSET_PAUSED), not status.
|
|
26794
26674
|
|
|
26795
|
-
Listings print a table by default: id, name, adset_id, campaign_id, effective_status, creative_id, issues
|
|
26796
|
-
(why an ad is WITH_ISSUES), created_time. --fields takes dotted paths (e.g. tracking_specs,
|
|
26797
|
-
preview_shareable_link); --full returns every field; --output json returns the rows as JSON.
|
|
26798
|
-
|
|
26799
26675
|
Examples:
|
|
26800
26676
|
baker ads meta ads --account-id act_123
|
|
26801
26677
|
baker ads meta ads --adset-id 6123
|
|
26802
|
-
baker ads meta ads --adset-id 6123 --fields id,name,preview_shareable_link
|
|
26803
26678
|
baker ads meta ads create --name "Ad 1" --adset meta_temp_as01 --creative meta_temp_cr01
|
|
26804
26679
|
baker ads meta ads pause 6123 --account-id act_123
|
|
26805
26680
|
baker ads meta ads retag 6123 --set "utm_medium=paid-social" \u2014 fix tracking on a LIVE ad, keeping everything else`
|
|
@@ -26818,32 +26693,27 @@ Examples:
|
|
|
26818
26693
|
// subcommand name using THIS command's arg defs, so without them `--account-id act_1`
|
|
26819
26694
|
// would read `act_1` as a subcommand. `default` (not `run`) dispatches the bare
|
|
26820
26695
|
// invocation — citty falls through to `run` after a subcommand, double-executing it.
|
|
26821
|
-
args:
|
|
26696
|
+
args: listArgs4,
|
|
26822
26697
|
default: "list"
|
|
26823
26698
|
});
|
|
26824
26699
|
|
|
26825
26700
|
// src/commands/ads/meta/adsets.ts
|
|
26826
26701
|
import { defineCommand as defineCommand59 } from "citty";
|
|
26827
|
-
var
|
|
26702
|
+
var listArgs5 = {
|
|
26828
26703
|
"account-id": { type: "string", description: "Meta ad account ID" },
|
|
26829
26704
|
"campaign-id": { type: "string", description: "Filter to one campaign" },
|
|
26830
26705
|
"effective-status": { type: "string", description: "Comma-separated effective_status filter (overrides default)" },
|
|
26831
26706
|
"all-statuses": { type: "boolean", description: "Drop the default ACTIVE filter" },
|
|
26832
26707
|
limit: { type: "string", description: "Max rows (default 1000)" },
|
|
26833
26708
|
"no-cache": NO_CACHE_ARG,
|
|
26834
|
-
|
|
26709
|
+
output: { type: "string", description: "Output format", default: "json" }
|
|
26835
26710
|
};
|
|
26836
|
-
registerMetaListSchema(
|
|
26837
|
-
"adsets",
|
|
26838
|
-
"List ad sets in a Meta ad account, as a table by default: id, name, campaign_id, effective_status, optimization_goal, billing_event, bid_strategy, budgets, destination_type, is_dynamic_creative, learning_stage, end_time, created_time. Targeting is not in the compact row \u2014 ask for it with --fields id,name,targeting (or --full). Start here: baker ads meta adsets --campaign-id 6123 --all-statuses. --output json returns the rows in the envelope.",
|
|
26839
|
-
listArgs6
|
|
26840
|
-
);
|
|
26841
26711
|
var listCommand5 = defineCommand59({
|
|
26842
26712
|
meta: {
|
|
26843
26713
|
name: "list",
|
|
26844
26714
|
description: "List ad sets in a Meta ad account. Runs by default when no subcommand is given. Example: baker ads meta adsets --account-id act_123"
|
|
26845
26715
|
},
|
|
26846
|
-
args:
|
|
26716
|
+
args: listArgs5,
|
|
26847
26717
|
run: async ({ args: args5 }) => {
|
|
26848
26718
|
const accountId = resolveAccountIdArg(args5);
|
|
26849
26719
|
const effectiveStatus = resolveEffectiveStatus(args5);
|
|
@@ -26854,8 +26724,7 @@ var listCommand5 = defineCommand59({
|
|
|
26854
26724
|
if (args5.limit) params.limit = args5.limit;
|
|
26855
26725
|
if (args5["no-cache"]) params["skip-cache"] = "true";
|
|
26856
26726
|
const data = await apiGet("/api/ads/meta/adsets", params);
|
|
26857
|
-
|
|
26858
|
-
writeMetaListRows("adsets", shaped, csvOrJson(args5));
|
|
26727
|
+
writeAdsOutput(data, csvOrJson(args5), void 0, statusFilterHints(data, effectiveStatus, "ad sets"));
|
|
26859
26728
|
} catch (err) {
|
|
26860
26729
|
handleMetaError(err);
|
|
26861
26730
|
}
|
|
@@ -26867,14 +26736,9 @@ var adsetsCommand = defineCommand59({
|
|
|
26867
26736
|
description: `List ad sets in a Meta ad account, or stage writes (create/update/pause/resume/archive/duplicate).
|
|
26868
26737
|
Defaults to ACTIVE only. Write subcommands stage ops on this chat's draft.
|
|
26869
26738
|
|
|
26870
|
-
Listings print a table by default: id, name, campaign_id, effective_status, optimization_goal, billing_event,
|
|
26871
|
-
bid_strategy, budgets, destination_type, is_dynamic_creative, learning_stage, end_time, created_time. Targeting
|
|
26872
|
-
is not in the compact row \u2014 ask for it with --fields (dotted paths) or --full. --output json returns the rows as JSON.
|
|
26873
|
-
|
|
26874
26739
|
Examples:
|
|
26875
26740
|
baker ads meta adsets --account-id act_123
|
|
26876
26741
|
baker ads meta adsets --campaign-id 6123456789
|
|
26877
|
-
baker ads meta adsets --campaign-id 6123456789 --fields id,name,targeting.geo_locations
|
|
26878
26742
|
baker ads meta adsets create --campaign meta_temp_ab12 --name "US 25-54" --optimization-goal LINK_CLICKS --billing-event IMPRESSIONS --daily-budget 50 --targeting-file t.json`
|
|
26879
26743
|
},
|
|
26880
26744
|
subCommands: {
|
|
@@ -26890,13 +26754,13 @@ Examples:
|
|
|
26890
26754
|
// subcommand name using THIS command's arg defs, so without them `--account-id act_1`
|
|
26891
26755
|
// would read `act_1` as a subcommand. `default` (not `run`) dispatches the bare
|
|
26892
26756
|
// invocation — citty falls through to `run` after a subcommand, double-executing it.
|
|
26893
|
-
args:
|
|
26757
|
+
args: listArgs5,
|
|
26894
26758
|
default: "list"
|
|
26895
26759
|
});
|
|
26896
26760
|
|
|
26897
26761
|
// src/commands/ads/meta/audiences.ts
|
|
26898
26762
|
import { defineCommand as defineCommand60 } from "citty";
|
|
26899
|
-
var
|
|
26763
|
+
var listArgs6 = {
|
|
26900
26764
|
"account-id": { type: "string", description: "Meta ad account ID" },
|
|
26901
26765
|
limit: { type: "string", description: "Max rows" },
|
|
26902
26766
|
"no-cache": NO_CACHE_ARG,
|
|
@@ -26907,7 +26771,7 @@ var listCommand6 = defineCommand60({
|
|
|
26907
26771
|
name: "list",
|
|
26908
26772
|
description: "List custom audiences. Runs by default when no subcommand is given. Example: baker ads meta audiences --account-id act_123"
|
|
26909
26773
|
},
|
|
26910
|
-
args:
|
|
26774
|
+
args: listArgs6,
|
|
26911
26775
|
run: async ({ args: args5 }) => {
|
|
26912
26776
|
const accountId = resolveAccountIdArg(args5);
|
|
26913
26777
|
try {
|
|
@@ -26945,7 +26809,7 @@ Examples:
|
|
|
26945
26809
|
// subcommand name using THIS command's arg defs, so without them `--account-id act_1`
|
|
26946
26810
|
// would read `act_1` as a subcommand. `default` (not `run`) dispatches the bare
|
|
26947
26811
|
// invocation — citty falls through to `run` after a subcommand, double-executing it.
|
|
26948
|
-
args:
|
|
26812
|
+
args: listArgs6,
|
|
26949
26813
|
default: "list"
|
|
26950
26814
|
});
|
|
26951
26815
|
|
|
@@ -26982,25 +26846,20 @@ Examples:
|
|
|
26982
26846
|
|
|
26983
26847
|
// src/commands/ads/meta/campaigns.ts
|
|
26984
26848
|
import { defineCommand as defineCommand62 } from "citty";
|
|
26985
|
-
var
|
|
26849
|
+
var listArgs7 = {
|
|
26986
26850
|
"account-id": { type: "string", description: "Meta ad account ID" },
|
|
26987
26851
|
"effective-status": { type: "string", description: "Comma-separated effective_status filter (overrides default)" },
|
|
26988
26852
|
"all-statuses": { type: "boolean", description: "Drop the default ACTIVE filter and return everything" },
|
|
26989
26853
|
limit: { type: "string", description: "Max rows (default 1000)" },
|
|
26990
26854
|
"no-cache": NO_CACHE_ARG,
|
|
26991
|
-
|
|
26855
|
+
output: { type: "string", description: "Output format", default: "json" }
|
|
26992
26856
|
};
|
|
26993
|
-
registerMetaListSchema(
|
|
26994
|
-
"campaigns",
|
|
26995
|
-
"List campaigns in a Meta ad account, as a table by default: id, name, effective_status, daily_budget, lifetime_budget, created_date. ACTIVE only unless --all-statuses. Start here: baker ads meta campaigns --account-id act_123 --all-statuses. --fields takes dotted paths for anything else (e.g. id,name,objective,bid_strategy,special_ad_categories); --full returns every field Meta sent; --output json returns the rows in the envelope.",
|
|
26996
|
-
listArgs8
|
|
26997
|
-
);
|
|
26998
26857
|
var listCommand7 = defineCommand62({
|
|
26999
26858
|
meta: {
|
|
27000
26859
|
name: "list",
|
|
27001
26860
|
description: "List campaigns for a Meta ad account. Runs by default when no subcommand is given. Example: baker ads meta campaigns --account-id act_123"
|
|
27002
26861
|
},
|
|
27003
|
-
args:
|
|
26862
|
+
args: listArgs7,
|
|
27004
26863
|
run: async ({ args: args5 }) => {
|
|
27005
26864
|
const accountId = resolveAccountIdArg(args5);
|
|
27006
26865
|
const effectiveStatus = resolveEffectiveStatus(args5);
|
|
@@ -27010,8 +26869,7 @@ var listCommand7 = defineCommand62({
|
|
|
27010
26869
|
if (args5.limit) params.limit = args5.limit;
|
|
27011
26870
|
if (args5["no-cache"]) params["skip-cache"] = "true";
|
|
27012
26871
|
const data = await apiGet("/api/ads/meta/campaigns", params);
|
|
27013
|
-
|
|
27014
|
-
writeMetaListRows("campaigns", shaped, csvOrJson(args5));
|
|
26872
|
+
writeAdsOutput(data, csvOrJson(args5), void 0, statusFilterHints(data, effectiveStatus, "campaigns"));
|
|
27015
26873
|
} catch (err) {
|
|
27016
26874
|
handleMetaError(err);
|
|
27017
26875
|
}
|
|
@@ -27027,15 +26885,9 @@ apply only when the chat is published.
|
|
|
27027
26885
|
In Meta's API "campaign" is the top-of-tree object (what marketers usually call a campaign group).
|
|
27028
26886
|
The dashboard shows effective_status: ACTIVE, PAUSED, DELETED, ARCHIVED, IN_PROCESS, WITH_ISSUES, etc.
|
|
27029
26887
|
|
|
27030
|
-
Listings print a table by default: id, name, effective_status, daily/lifetime budget, created_date.
|
|
27031
|
-
--fields takes dotted paths for anything else (objective, bid_strategy, special_ad_categories, created_time);
|
|
27032
|
-
--full returns every field; --output json returns the same rows in the { ok, data } envelope.
|
|
27033
|
-
|
|
27034
26888
|
Examples:
|
|
27035
26889
|
baker ads meta campaigns --account-id act_123 # ACTIVE only
|
|
27036
26890
|
baker ads meta campaigns --account-id act_123 --all-statuses # everything
|
|
27037
|
-
baker ads meta campaigns --account-id act_123 --fields id,name,objective,bid_strategy,special_ad_categories
|
|
27038
|
-
baker ads meta campaigns --account-id act_123 --output json # rows as JSON
|
|
27039
26891
|
baker ads meta campaigns create --account-id act_123 --name "Q3" --objective OUTCOME_LEADS --daily-budget 50
|
|
27040
26892
|
baker ads meta campaigns pause 6123 --account-id act_123`
|
|
27041
26893
|
},
|
|
@@ -27052,13 +26904,13 @@ Examples:
|
|
|
27052
26904
|
// subcommand name using THIS command's arg defs, so without them `--account-id act_1`
|
|
27053
26905
|
// would read `act_1` as a subcommand. `default` (not `run`) dispatches the bare
|
|
27054
26906
|
// invocation — citty falls through to `run` after a subcommand, double-executing it.
|
|
27055
|
-
args:
|
|
26907
|
+
args: listArgs7,
|
|
27056
26908
|
default: "list"
|
|
27057
26909
|
});
|
|
27058
26910
|
|
|
27059
26911
|
// src/commands/ads/meta/creatives.ts
|
|
27060
26912
|
import { defineCommand as defineCommand63 } from "citty";
|
|
27061
|
-
var
|
|
26913
|
+
var listArgs8 = {
|
|
27062
26914
|
"account-id": { type: "string", description: "Meta ad account ID (required if no --creative-id)" },
|
|
27063
26915
|
"creative-id": { type: "string", description: "Single creative ID" },
|
|
27064
26916
|
limit: { type: "string", description: "Max rows (default 500)" },
|
|
@@ -27070,7 +26922,7 @@ var listCommand8 = defineCommand63({
|
|
|
27070
26922
|
name: "list",
|
|
27071
26923
|
description: "List ad creatives, or fetch one by ID. Runs by default when no subcommand is given. Example: baker ads meta creatives --account-id act_123"
|
|
27072
26924
|
},
|
|
27073
|
-
args:
|
|
26925
|
+
args: listArgs8,
|
|
27074
26926
|
run: async ({ args: args5 }) => {
|
|
27075
26927
|
try {
|
|
27076
26928
|
const params = {};
|
|
@@ -27116,7 +26968,7 @@ Examples:
|
|
|
27116
26968
|
// subcommand name using THIS command's arg defs, so without them `--account-id act_1`
|
|
27117
26969
|
// would read `act_1` as a subcommand. `default` (not `run`) dispatches the bare
|
|
27118
26970
|
// invocation — citty falls through to `run` after a subcommand, double-executing it.
|
|
27119
|
-
args:
|
|
26971
|
+
args: listArgs8,
|
|
27120
26972
|
default: "list"
|
|
27121
26973
|
});
|
|
27122
26974
|
|
|
@@ -27164,7 +27016,7 @@ registerSchema({
|
|
|
27164
27016
|
output: { type: "string", description: "json|csv", required: false, default: "json" }
|
|
27165
27017
|
}
|
|
27166
27018
|
});
|
|
27167
|
-
var
|
|
27019
|
+
var listArgs9 = {
|
|
27168
27020
|
"account-id": { type: "string", description: "Meta ad account ID" },
|
|
27169
27021
|
full: { type: "boolean", description: "Include the raw rule JSON, retention and creation times" },
|
|
27170
27022
|
limit: { type: "string", description: "Max rows" },
|
|
@@ -27176,7 +27028,7 @@ var listCommand9 = defineCommand64({
|
|
|
27176
27028
|
name: "list",
|
|
27177
27029
|
description: "List custom conversions. Runs by default when no subcommand is given. Example: baker ads meta custom-conversions --account-id act_123"
|
|
27178
27030
|
},
|
|
27179
|
-
args:
|
|
27031
|
+
args: listArgs9,
|
|
27180
27032
|
run: async ({ args: args5 }) => {
|
|
27181
27033
|
const accountId = resolveAccountIdArg(args5);
|
|
27182
27034
|
try {
|
|
@@ -27214,7 +27066,7 @@ Examples:
|
|
|
27214
27066
|
// `args` stays even though the parent has no `run`: citty scans rawArgs for
|
|
27215
27067
|
// the subcommand name using THIS command's arg defs. `default` (not `run`)
|
|
27216
27068
|
// dispatches the bare invocation.
|
|
27217
|
-
args:
|
|
27069
|
+
args: listArgs9,
|
|
27218
27070
|
default: "list"
|
|
27219
27071
|
});
|
|
27220
27072
|
|
|
@@ -28926,7 +28778,7 @@ registerSchema({
|
|
|
28926
28778
|
output: { type: "string", description: "Format: json|csv|md", required: false, default: "json" }
|
|
28927
28779
|
}
|
|
28928
28780
|
});
|
|
28929
|
-
var
|
|
28781
|
+
var listArgs10 = {
|
|
28930
28782
|
"account-id": { type: "string", description: "X Ads account ID" },
|
|
28931
28783
|
"funding-instrument-ids": { type: "string", description: "CSV of funding instrument IDs" },
|
|
28932
28784
|
"campaign-ids": { type: "string", description: "CSV of campaign IDs" },
|
|
@@ -28996,7 +28848,7 @@ Examples:
|
|
|
28996
28848
|
},
|
|
28997
28849
|
// A parent must never declare `run`: citty falls through to it AFTER the
|
|
28998
28850
|
// matched subcommand, so every write would also trigger a full live list.
|
|
28999
|
-
args:
|
|
28851
|
+
args: listArgs10,
|
|
29000
28852
|
default: "list"
|
|
29001
28853
|
});
|
|
29002
28854
|
|
|
@@ -43192,12 +43044,12 @@ function fail3(code, message) {
|
|
|
43192
43044
|
process.exit(2);
|
|
43193
43045
|
}
|
|
43194
43046
|
function resolveModels(args5) {
|
|
43195
|
-
const
|
|
43047
|
+
const pick = (flag, kind, fallback) => args5[flag] ? String(args5[flag]) : resolveModel(kind, fallback);
|
|
43196
43048
|
return {
|
|
43197
|
-
describeModel:
|
|
43198
|
-
selectModel:
|
|
43199
|
-
layoutModel:
|
|
43200
|
-
genModel:
|
|
43049
|
+
describeModel: pick("describe-model", "image_describe", "~google/gemini-pro-latest"),
|
|
43050
|
+
selectModel: pick("select-model", "text_generate", "~google/gemini-flash-latest"),
|
|
43051
|
+
layoutModel: pick("layout-model", "text_generate", "~google/gemini-flash-latest"),
|
|
43052
|
+
genModel: pick("gen-model", "image_generate", "openai/gpt-image-2")
|
|
43201
43053
|
};
|
|
43202
43054
|
}
|
|
43203
43055
|
var PLATFORM_PLACEMENTS = {
|
|
@@ -45231,18 +45083,18 @@ function parseBudget(raw) {
|
|
|
45231
45083
|
throw new Error(`--budget must be one of ${VIDEO_BUDGETS.join(", ")} (got "${v}")`);
|
|
45232
45084
|
}
|
|
45233
45085
|
function resolveModels2(args5) {
|
|
45234
|
-
const
|
|
45086
|
+
const pick = (flag, kind, fallback) => args5[flag] ? String(args5[flag]) : resolveModel2(kind, fallback);
|
|
45235
45087
|
return {
|
|
45236
45088
|
// Flash by default: ~2-3× faster per call than Pro, which keeps each
|
|
45237
45089
|
// per-scene deconstruct step well inside the action time budget and turns a
|
|
45238
45090
|
// ~9 min run into ~3-4 min. Override with --deconstruct-model
|
|
45239
45091
|
// ~google/gemini-pro-latest for the densest extraction when speed matters less.
|
|
45240
|
-
deconstructModel:
|
|
45241
|
-
selectModel:
|
|
45092
|
+
deconstructModel: pick("deconstruct-model", "video_deconstruct", "~google/gemini-flash-latest"),
|
|
45093
|
+
selectModel: pick("select-model", "text_generate", "~google/gemini-flash-latest"),
|
|
45242
45094
|
// Default to the strongest image model (matches the static-ad scaffold); the
|
|
45243
45095
|
// frame generators need the most faithful text/identity reproduction. Override
|
|
45244
45096
|
// with --image-model for a cheaper/faster pass.
|
|
45245
|
-
imageModel:
|
|
45097
|
+
imageModel: pick("image-model", "image_generate", "openai/gpt-image-2.5-sunburst")
|
|
45246
45098
|
};
|
|
45247
45099
|
}
|
|
45248
45100
|
function hasPhotorealCast(elements) {
|
|
@@ -54331,7 +54183,7 @@ var extractCommand = defineCommand149({
|
|
|
54331
54183
|
import { defineCommand as defineCommand150 } from "citty";
|
|
54332
54184
|
|
|
54333
54185
|
// src/commands/images/providerHits.ts
|
|
54334
|
-
function
|
|
54186
|
+
function asRecord2(value) {
|
|
54335
54187
|
return value && typeof value === "object" ? value : {};
|
|
54336
54188
|
}
|
|
54337
54189
|
function str(value) {
|
|
@@ -54356,7 +54208,7 @@ function providerHitNormalizer(record, full) {
|
|
|
54356
54208
|
if (!full) {
|
|
54357
54209
|
return compact3;
|
|
54358
54210
|
}
|
|
54359
|
-
const group =
|
|
54211
|
+
const group = asRecord2(record.group);
|
|
54360
54212
|
return {
|
|
54361
54213
|
...compact3,
|
|
54362
54214
|
externalUrl: str(record.externalUrl),
|
|
@@ -66619,7 +66471,7 @@ async function listTags(json) {
|
|
|
66619
66471
|
failApi3(err);
|
|
66620
66472
|
}
|
|
66621
66473
|
}
|
|
66622
|
-
var
|
|
66474
|
+
var listArgs11 = {
|
|
66623
66475
|
json: { type: "boolean", description: "Print the raw JSON envelope instead of the readable list" }
|
|
66624
66476
|
};
|
|
66625
66477
|
var listCommand19 = defineCommand222({
|
|
@@ -66627,7 +66479,7 @@ var listCommand19 = defineCommand222({
|
|
|
66627
66479
|
name: "list",
|
|
66628
66480
|
description: "Effective tags for this chat (production + staged), with each tag's full readable config (secrets excluded) \u2014 reuse a stored value to pre-fill a change rather than asking the user. Refs printed here are what flow side-effect tagIds should use. Example: baker tags list"
|
|
66629
66481
|
},
|
|
66630
|
-
args:
|
|
66482
|
+
args: listArgs11,
|
|
66631
66483
|
run: async ({ args: args5 }) => {
|
|
66632
66484
|
await listTags(args5.json === true);
|
|
66633
66485
|
}
|
|
@@ -66675,7 +66527,7 @@ Full guide: __tooling__/docs/tools/baker/tags.md`
|
|
|
66675
66527
|
// command's flags when it scans rawArgs for a subcommand name, and `default` (not
|
|
66676
66528
|
// `run`) dispatches the bare invocation — citty falls through to `run` after a
|
|
66677
66529
|
// subcommand, so a `run` here would also list on every `baker tags draft`.
|
|
66678
|
-
args:
|
|
66530
|
+
args: listArgs11,
|
|
66679
66531
|
default: "list"
|
|
66680
66532
|
});
|
|
66681
66533
|
|