@koda-sl/baker-cli 0.364.0-dev.24387b84c → 0.364.0-dev.addc883a2
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/dist/{chunk-BLMXG42J.js → chunk-UWCUB3DJ.js} +6 -1
- package/dist/{chunk-BLMXG42J.js.map → chunk-UWCUB3DJ.js.map} +1 -1
- package/dist/cli.js +13 -3
- package/dist/cli.js.map +1 -1
- package/dist/{shared-BROA3UXS.js → shared-HOMSTQMP.js} +4 -2
- package/package.json +1 -1
- /package/dist/{shared-BROA3UXS.js.map → shared-HOMSTQMP.js.map} +0 -0
|
@@ -87,6 +87,10 @@ function daysAgoIso(days) {
|
|
|
87
87
|
function csvOrJson(args) {
|
|
88
88
|
return args.output ?? "json";
|
|
89
89
|
}
|
|
90
|
+
var NAME_CONTAINS_ARG = {
|
|
91
|
+
type: "string",
|
|
92
|
+
description: "Only rows whose name contains this text, matched by Meta before anything is returned. Start here to find one entity by name: --name-contains octubre --all-statuses"
|
|
93
|
+
};
|
|
90
94
|
function resolveEffectiveStatus(args) {
|
|
91
95
|
if (args["all-statuses"]) {
|
|
92
96
|
return void 0;
|
|
@@ -106,6 +110,7 @@ export {
|
|
|
106
110
|
todayIso,
|
|
107
111
|
daysAgoIso,
|
|
108
112
|
csvOrJson,
|
|
113
|
+
NAME_CONTAINS_ARG,
|
|
109
114
|
resolveEffectiveStatus
|
|
110
115
|
};
|
|
111
|
-
//# sourceMappingURL=chunk-
|
|
116
|
+
//# sourceMappingURL=chunk-UWCUB3DJ.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/commands/ads/meta/shared.ts"],"sourcesContent":["import { ApiError } from \"../../../client.ts\";\nimport { getEnv } from \"../../../env.ts\";\nimport { handleConnectionError, needsConnectionFix } from \"../../../error-handler.ts\";\nimport { writeAdsJson } from \"../output.ts\";\nimport type { AdsErrorEnvelope, QueryFix } from \"../types.ts\";\n\nconst DAY_MS = 86_400_000;\n\n/**\n * Meta answers a permission refusal (Graph codes 200/10/294) with a bare\n * \"Permissions error\" that covers two causes needing opposite remedies: a\n * consent grant the connection never got — nothing validates Meta's granted\n * scopes after connect, unlike HubSpot's `requireCapability` — or a role the\n * user lacks on one asset, since a Pixel/Dataset, Page or catalog lives in a\n * Business and is assigned separately from the ad account. Only the blast radius\n * separates them, so hand the agent that test rather than a verdict: guessing\n * \"reconnect\" wastes the user's time on an unassigned asset, and ruling it out\n * strands a connection that really is short a scope.\n */\nexport function metaForbiddenFix(message: string): QueryFix {\n return {\n action: \"reject\",\n explanation: [\n message,\n \"This is a permission refusal, not a dead connection, and Meta returns the same code for two causes with opposite remedies. Tell them apart by how much else works before you answer.\",\n \"If other reads on this account are ALSO refused (campaigns, ad sets, insights), the connection is short a permission it was never granted. Only the user can widen it, by reconnecting Meta from the dashboard.\",\n \"If those reads work and only this object is refused, the asset (pixel/dataset, Page, or catalog) belongs to a Business the connected user holds no role in. Ad-account access does not carry asset access and reconnecting cannot grant it — the client assigns that asset to the connected user or partner in Meta Business settings, under the asset's own section (Data sources → Datasets for a pixel).\",\n \"Either way do not retry the same call, and do not abort the wider job. Continue with what you can read, and state in your answer that this specific check could not run and why — never present the task as verified when this step was skipped.\",\n ].join(\"\\n\\n\"),\n };\n}\n\nexport function handleMetaError(err: unknown): never {\n if (err instanceof ApiError) {\n if (needsConnectionFix(err.code, err.message)) {\n handleConnectionError(\"meta_ads\", err.message);\n }\n const envelope: AdsErrorEnvelope = {\n ok: false,\n error: {\n code: err.code,\n message: err.message,\n fix: err.code === \"FORBIDDEN\" ? metaForbiddenFix(err.message) : { action: \"reject\", explanation: err.message },\n retryable: err.code === \"RATE_LIMITED\" || err.code === \"UNAVAILABLE\" || err.code === \"INTERNAL_ERROR\",\n },\n };\n writeAdsJson(envelope);\n process.exit(1);\n }\n const message = err instanceof Error ? err.message : \"Unexpected error\";\n writeAdsJson({ ok: false, error: { code: \"NETWORK_ERROR\", message } });\n process.exit(1);\n}\n\nconst ACCOUNT_ID_RE = /^(act_)?[0-9]+$/;\n\n/** Pull the default Meta ad account ID from `--account-id` arg or `BAKER_META_AD_ACCOUNT_ID` env. */\nexport function resolveAccountIdArg(args: Record<string, unknown>): string {\n const fromArgs = args[\"account-id\"] as string | undefined;\n const id = fromArgs || getEnv().BAKER_META_AD_ACCOUNT_ID;\n if (!id) {\n writeAdsJson({\n ok: false,\n error: {\n code: \"MISSING_ACCOUNT_ID\",\n message: \"Pass --account-id or set BAKER_META_AD_ACCOUNT_ID. Run `baker ads meta accounts` to find IDs.\",\n },\n });\n process.exit(1);\n }\n if (!ACCOUNT_ID_RE.test(id)) {\n writeAdsJson({\n ok: false,\n error: {\n code: \"INVALID_ACCOUNT_ID\",\n message: `Invalid account ID \"${id}\". Expected numeric ID, optionally prefixed with \"act_\".`,\n },\n });\n process.exit(1);\n }\n return id.startsWith(\"act_\") ? id : `act_${id}`;\n}\n\nexport function getDateRange(args: Record<string, unknown>): { datePreset?: string; since?: string; until?: string } {\n const datePreset = args[\"date-preset\"] as string | undefined;\n const since = args.since as string | undefined;\n const until = args.until as string | undefined;\n if (since && until) return { since, until };\n return { datePreset: datePreset ?? \"last_7d\" };\n}\n\nexport function todayIso(): string {\n return new Date().toISOString().slice(0, 10);\n}\n\nexport function daysAgoIso(days: number): string {\n return new Date(Date.now() - days * DAY_MS).toISOString().slice(0, 10);\n}\n\nexport function csvOrJson(args: Record<string, unknown>): string {\n return (args.output as string | undefined) ?? \"json\";\n}\n\n/**\n * Default to ACTIVE-only on listings — that's almost always what an AI agent or\n * a human glance wants. Pass `--effective-status ACTIVE,PAUSED` to override, or\n * `--all-statuses` to drop the filter entirely.\n */\nexport function resolveEffectiveStatus(args: Record<string, unknown>): string | undefined {\n if (args[\"all-statuses\"]) {\n return undefined;\n }\n const explicit = args[\"effective-status\"] as string | undefined;\n if (explicit) {\n return explicit;\n }\n return \"ACTIVE\";\n}\n"],"mappings":";;;;;;;;;;;;;AAMA,IAAM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,SAAS,uBAAuB,EAAE;AAAA,MACpC;AAAA,IACF,CAAC;AACD,YAAQ,KAAK,CAAC;AAAA,EAChB;AACA,SAAO,GAAG,WAAW,MAAM,IAAI,KAAK,OAAO,EAAE;AAC/C;AAEO,SAAS,aAAa,MAAwF;AACnH,QAAM,aAAa,KAAK,aAAa;AACrC,QAAM,QAAQ,KAAK;AACnB,QAAM,QAAQ,KAAK;AACnB,MAAI,SAAS,MAAO,QAAO,EAAE,OAAO,MAAM;AAC1C,SAAO,EAAE,YAAY,cAAc,UAAU;AAC/C;AAEO,SAAS,WAAmB;AACjC,UAAO,oBAAI,KAAK,GAAE,YAAY,EAAE,MAAM,GAAG,EAAE;AAC7C;AAEO,SAAS,WAAW,MAAsB;AAC/C,SAAO,IAAI,KAAK,KAAK,IAAI,IAAI,OAAO,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,EAAE;AACvE;AAEO,SAAS,UAAU,MAAuC;AAC/D,SAAQ,KAAK,UAAiC;AAChD;AAOO,SAAS,uBAAuB,MAAmD;AACxF,MAAI,KAAK,cAAc,GAAG;AACxB,WAAO;AAAA,EACT;AACA,QAAM,WAAW,KAAK,kBAAkB;AACxC,MAAI,UAAU;AACZ,WAAO;AAAA,EACT;AACA,SAAO;AACT;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../src/commands/ads/meta/shared.ts"],"sourcesContent":["import { ApiError } from \"../../../client.ts\";\nimport { getEnv } from \"../../../env.ts\";\nimport { handleConnectionError, needsConnectionFix } from \"../../../error-handler.ts\";\nimport { writeAdsJson } from \"../output.ts\";\nimport type { AdsErrorEnvelope, QueryFix } from \"../types.ts\";\n\nconst DAY_MS = 86_400_000;\n\n/**\n * Meta answers a permission refusal (Graph codes 200/10/294) with a bare\n * \"Permissions error\" that covers two causes needing opposite remedies: a\n * consent grant the connection never got — nothing validates Meta's granted\n * scopes after connect, unlike HubSpot's `requireCapability` — or a role the\n * user lacks on one asset, since a Pixel/Dataset, Page or catalog lives in a\n * Business and is assigned separately from the ad account. Only the blast radius\n * separates them, so hand the agent that test rather than a verdict: guessing\n * \"reconnect\" wastes the user's time on an unassigned asset, and ruling it out\n * strands a connection that really is short a scope.\n */\nexport function metaForbiddenFix(message: string): QueryFix {\n return {\n action: \"reject\",\n explanation: [\n message,\n \"This is a permission refusal, not a dead connection, and Meta returns the same code for two causes with opposite remedies. Tell them apart by how much else works before you answer.\",\n \"If other reads on this account are ALSO refused (campaigns, ad sets, insights), the connection is short a permission it was never granted. Only the user can widen it, by reconnecting Meta from the dashboard.\",\n \"If those reads work and only this object is refused, the asset (pixel/dataset, Page, or catalog) belongs to a Business the connected user holds no role in. Ad-account access does not carry asset access and reconnecting cannot grant it — the client assigns that asset to the connected user or partner in Meta Business settings, under the asset's own section (Data sources → Datasets for a pixel).\",\n \"Either way do not retry the same call, and do not abort the wider job. Continue with what you can read, and state in your answer that this specific check could not run and why — never present the task as verified when this step was skipped.\",\n ].join(\"\\n\\n\"),\n };\n}\n\nexport function handleMetaError(err: unknown): never {\n if (err instanceof ApiError) {\n if (needsConnectionFix(err.code, err.message)) {\n handleConnectionError(\"meta_ads\", err.message);\n }\n const envelope: AdsErrorEnvelope = {\n ok: false,\n error: {\n code: err.code,\n message: err.message,\n fix: err.code === \"FORBIDDEN\" ? metaForbiddenFix(err.message) : { action: \"reject\", explanation: err.message },\n retryable: err.code === \"RATE_LIMITED\" || err.code === \"UNAVAILABLE\" || err.code === \"INTERNAL_ERROR\",\n },\n };\n writeAdsJson(envelope);\n process.exit(1);\n }\n const message = err instanceof Error ? err.message : \"Unexpected error\";\n writeAdsJson({ ok: false, error: { code: \"NETWORK_ERROR\", message } });\n process.exit(1);\n}\n\nconst ACCOUNT_ID_RE = /^(act_)?[0-9]+$/;\n\n/** Pull the default Meta ad account ID from `--account-id` arg or `BAKER_META_AD_ACCOUNT_ID` env. */\nexport function resolveAccountIdArg(args: Record<string, unknown>): string {\n const fromArgs = args[\"account-id\"] as string | undefined;\n const id = fromArgs || getEnv().BAKER_META_AD_ACCOUNT_ID;\n if (!id) {\n writeAdsJson({\n ok: false,\n error: {\n code: \"MISSING_ACCOUNT_ID\",\n message: \"Pass --account-id or set BAKER_META_AD_ACCOUNT_ID. Run `baker ads meta accounts` to find IDs.\",\n },\n });\n process.exit(1);\n }\n if (!ACCOUNT_ID_RE.test(id)) {\n writeAdsJson({\n ok: false,\n error: {\n code: \"INVALID_ACCOUNT_ID\",\n message: `Invalid account ID \"${id}\". Expected numeric ID, optionally prefixed with \"act_\".`,\n },\n });\n process.exit(1);\n }\n return id.startsWith(\"act_\") ? id : `act_${id}`;\n}\n\nexport function getDateRange(args: Record<string, unknown>): { datePreset?: string; since?: string; until?: string } {\n const datePreset = args[\"date-preset\"] as string | undefined;\n const since = args.since as string | undefined;\n const until = args.until as string | undefined;\n if (since && until) return { since, until };\n return { datePreset: datePreset ?? \"last_7d\" };\n}\n\nexport function todayIso(): string {\n return new Date().toISOString().slice(0, 10);\n}\n\nexport function daysAgoIso(days: number): string {\n return new Date(Date.now() - days * DAY_MS).toISOString().slice(0, 10);\n}\n\nexport function csvOrJson(args: Record<string, unknown>): string {\n return (args.output as string | undefined) ?? \"json\";\n}\n\n/**\n * Matched by Meta itself, so finding one entity by name reads only the rows that\n * match instead of the whole account.\n */\nexport const NAME_CONTAINS_ARG = {\n type: \"string\",\n description:\n \"Only rows whose name contains this text, matched by Meta before anything is returned. Start here to find one entity by name: --name-contains octubre --all-statuses\",\n} as const;\n\n/**\n * Default to ACTIVE-only on listings — that's almost always what an AI agent or\n * a human glance wants. Pass `--effective-status ACTIVE,PAUSED` to override, or\n * `--all-statuses` to drop the filter entirely.\n */\nexport function resolveEffectiveStatus(args: Record<string, unknown>): string | undefined {\n if (args[\"all-statuses\"]) {\n return undefined;\n }\n const explicit = args[\"effective-status\"] as string | undefined;\n if (explicit) {\n return explicit;\n }\n return \"ACTIVE\";\n}\n"],"mappings":";;;;;;;;;;;;;AAMA,IAAM,SAAS;AAaR,SAAS,iBAAiB,SAA2B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AAAA,IACF,CAAC;AACD,YAAQ,KAAK,CAAC;AAAA,EAChB;AACA,SAAO,GAAG,WAAW,MAAM,IAAI,KAAK,OAAO,EAAE;AAC/C;AAEO,SAAS,aAAa,MAAwF;AACnH,QAAM,aAAa,KAAK,aAAa;AACrC,QAAM,QAAQ,KAAK;AACnB,QAAM,QAAQ,KAAK;AACnB,MAAI,SAAS,MAAO,QAAO,EAAE,OAAO,MAAM;AAC1C,SAAO,EAAE,YAAY,cAAc,UAAU;AAC/C;AAEO,SAAS,WAAmB;AACjC,UAAO,oBAAI,KAAK,GAAE,YAAY,EAAE,MAAM,GAAG,EAAE;AAC7C;AAEO,SAAS,WAAW,MAAsB;AAC/C,SAAO,IAAI,KAAK,KAAK,IAAI,IAAI,OAAO,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,EAAE;AACvE;AAEO,SAAS,UAAU,MAAuC;AAC/D,SAAQ,KAAK,UAAiC;AAChD;AAMO,IAAM,oBAAoB;AAAA,EAC/B,MAAM;AAAA,EACN,aACE;AACJ;AAOO,SAAS,uBAAuB,MAAmD;AACxF,MAAI,KAAK,cAAc,GAAG;AACxB,WAAO;AAAA,EACT;AACA,QAAM,WAAW,KAAK,kBAAkB;AACxC,MAAI,UAAU;AACZ,WAAO;AAAA,EACT;AACA,SAAO;AACT;","names":[]}
|
package/dist/cli.js
CHANGED
|
@@ -71,6 +71,7 @@ import {
|
|
|
71
71
|
ytDlpBlockSignal
|
|
72
72
|
} from "./chunk-K2IKLMCM.js";
|
|
73
73
|
import {
|
|
74
|
+
NAME_CONTAINS_ARG,
|
|
74
75
|
csvOrJson,
|
|
75
76
|
daysAgoIso,
|
|
76
77
|
getDateRange,
|
|
@@ -78,7 +79,7 @@ import {
|
|
|
78
79
|
resolveAccountIdArg,
|
|
79
80
|
resolveEffectiveStatus,
|
|
80
81
|
todayIso
|
|
81
|
-
} from "./chunk-
|
|
82
|
+
} from "./chunk-UWCUB3DJ.js";
|
|
82
83
|
import {
|
|
83
84
|
buildQueryCacheKey,
|
|
84
85
|
cacheGet,
|
|
@@ -26382,7 +26383,7 @@ Example: baker ads meta ads retag 120252158038400247 --url-tags "utm_source={{si
|
|
|
26382
26383
|
const { apiPost: apiPost2 } = await import("./client-3DGBQ2H3.js");
|
|
26383
26384
|
const { requireChatId: requireChatId2 } = await import("./env-BSG7TY5Y.js");
|
|
26384
26385
|
const { writeJsonEnvelope: writeJsonEnvelope2 } = await import("./output-M2DBCZFG.js");
|
|
26385
|
-
const { handleMetaError: handleMetaError2 } = await import("./shared-
|
|
26386
|
+
const { handleMetaError: handleMetaError2 } = await import("./shared-HOMSTQMP.js");
|
|
26386
26387
|
try {
|
|
26387
26388
|
const accountId = bareAccountId2(args5);
|
|
26388
26389
|
const urlTags = typeof args5["url-tags"] === "string" ? args5["url-tags"] : void 0;
|
|
@@ -26530,7 +26531,7 @@ function duplicateCommand2(entity, label) {
|
|
|
26530
26531
|
const { apiPost: apiPost2 } = await import("./client-3DGBQ2H3.js");
|
|
26531
26532
|
const { requireChatId: requireChatId2 } = await import("./env-BSG7TY5Y.js");
|
|
26532
26533
|
const { writeJsonEnvelope: writeJsonEnvelope2 } = await import("./output-M2DBCZFG.js");
|
|
26533
|
-
const { handleMetaError: handleMetaError2 } = await import("./shared-
|
|
26534
|
+
const { handleMetaError: handleMetaError2 } = await import("./shared-HOMSTQMP.js");
|
|
26534
26535
|
try {
|
|
26535
26536
|
const accountId = bareAccountId2(args5);
|
|
26536
26537
|
const chatId = requireChatId2();
|
|
@@ -26569,6 +26570,7 @@ var listArgs4 = {
|
|
|
26569
26570
|
"campaign-id": { type: "string", description: "Filter to one campaign" },
|
|
26570
26571
|
"effective-status": { type: "string", description: "Comma-separated effective_status filter (overrides default)" },
|
|
26571
26572
|
"all-statuses": { type: "boolean", description: "Drop the default ACTIVE filter" },
|
|
26573
|
+
"name-contains": NAME_CONTAINS_ARG,
|
|
26572
26574
|
limit: { type: "string", description: "Max rows (default 1000)" },
|
|
26573
26575
|
"no-cache": NO_CACHE_ARG,
|
|
26574
26576
|
output: { type: "string", description: "Output format", default: "json" }
|
|
@@ -26587,6 +26589,7 @@ var listCommand4 = defineCommand58({
|
|
|
26587
26589
|
if (args5["adset-id"]) params["adset-id"] = args5["adset-id"];
|
|
26588
26590
|
if (args5["campaign-id"]) params["campaign-id"] = args5["campaign-id"];
|
|
26589
26591
|
if (effectiveStatus) params["effective-status"] = effectiveStatus;
|
|
26592
|
+
if (args5["name-contains"]) params["name-contains"] = args5["name-contains"];
|
|
26590
26593
|
if (args5.limit) params.limit = args5.limit;
|
|
26591
26594
|
if (args5["no-cache"]) params["skip-cache"] = "true";
|
|
26592
26595
|
const data = await apiGet("/api/ads/meta/ads", params);
|
|
@@ -26612,6 +26615,7 @@ The dashboard shows effective_status (e.g. WITH_ISSUES, PENDING_REVIEW, DISAPPRO
|
|
|
26612
26615
|
Examples:
|
|
26613
26616
|
baker ads meta ads --account-id act_123
|
|
26614
26617
|
baker ads meta ads --adset-id 6123
|
|
26618
|
+
baker ads meta ads --account-id act_123 --all-statuses --name-contains octubre \u2014 find one ad by name
|
|
26615
26619
|
baker ads meta ads create --name "Ad 1" --adset meta_temp_as01 --creative meta_temp_cr01
|
|
26616
26620
|
baker ads meta ads pause 6123 --account-id act_123
|
|
26617
26621
|
baker ads meta ads retag 6123 --set "utm_medium=paid-social" \u2014 fix tracking on a LIVE ad, keeping everything else`
|
|
@@ -26641,6 +26645,7 @@ var listArgs5 = {
|
|
|
26641
26645
|
"campaign-id": { type: "string", description: "Filter to one campaign" },
|
|
26642
26646
|
"effective-status": { type: "string", description: "Comma-separated effective_status filter (overrides default)" },
|
|
26643
26647
|
"all-statuses": { type: "boolean", description: "Drop the default ACTIVE filter" },
|
|
26648
|
+
"name-contains": NAME_CONTAINS_ARG,
|
|
26644
26649
|
limit: { type: "string", description: "Max rows (default 1000)" },
|
|
26645
26650
|
"no-cache": NO_CACHE_ARG,
|
|
26646
26651
|
output: { type: "string", description: "Output format", default: "json" }
|
|
@@ -26658,6 +26663,7 @@ var listCommand5 = defineCommand59({
|
|
|
26658
26663
|
const params = { "account-id": accountId };
|
|
26659
26664
|
if (args5["campaign-id"]) params["campaign-id"] = args5["campaign-id"];
|
|
26660
26665
|
if (effectiveStatus) params["effective-status"] = effectiveStatus;
|
|
26666
|
+
if (args5["name-contains"]) params["name-contains"] = args5["name-contains"];
|
|
26661
26667
|
if (args5.limit) params.limit = args5.limit;
|
|
26662
26668
|
if (args5["no-cache"]) params["skip-cache"] = "true";
|
|
26663
26669
|
const data = await apiGet("/api/ads/meta/adsets", params);
|
|
@@ -26681,6 +26687,7 @@ Defaults to ACTIVE only. Write subcommands stage ops on this chat's draft.
|
|
|
26681
26687
|
Examples:
|
|
26682
26688
|
baker ads meta adsets --account-id act_123
|
|
26683
26689
|
baker ads meta adsets --campaign-id 6123456789
|
|
26690
|
+
baker ads meta adsets --account-id act_123 --all-statuses --name-contains retargeting \u2014 find one ad set by name
|
|
26684
26691
|
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`
|
|
26685
26692
|
},
|
|
26686
26693
|
subCommands: {
|
|
@@ -26792,6 +26799,7 @@ var listArgs7 = {
|
|
|
26792
26799
|
"account-id": { type: "string", description: "Meta ad account ID" },
|
|
26793
26800
|
"effective-status": { type: "string", description: "Comma-separated effective_status filter (overrides default)" },
|
|
26794
26801
|
"all-statuses": { type: "boolean", description: "Drop the default ACTIVE filter and return everything" },
|
|
26802
|
+
"name-contains": NAME_CONTAINS_ARG,
|
|
26795
26803
|
limit: { type: "string", description: "Max rows (default 1000)" },
|
|
26796
26804
|
"no-cache": NO_CACHE_ARG,
|
|
26797
26805
|
output: { type: "string", description: "Output format", default: "json" }
|
|
@@ -26808,6 +26816,7 @@ var listCommand7 = defineCommand62({
|
|
|
26808
26816
|
try {
|
|
26809
26817
|
const params = { "account-id": accountId };
|
|
26810
26818
|
if (effectiveStatus) params["effective-status"] = effectiveStatus;
|
|
26819
|
+
if (args5["name-contains"]) params["name-contains"] = args5["name-contains"];
|
|
26811
26820
|
if (args5.limit) params.limit = args5.limit;
|
|
26812
26821
|
if (args5["no-cache"]) params["skip-cache"] = "true";
|
|
26813
26822
|
const data = await apiGet("/api/ads/meta/campaigns", params);
|
|
@@ -26835,6 +26844,7 @@ The dashboard shows effective_status: ACTIVE, PAUSED, DELETED, ARCHIVED, IN_PROC
|
|
|
26835
26844
|
Examples:
|
|
26836
26845
|
baker ads meta campaigns --account-id act_123 # ACTIVE only
|
|
26837
26846
|
baker ads meta campaigns --account-id act_123 --all-statuses # everything
|
|
26847
|
+
baker ads meta campaigns --account-id act_123 --all-statuses --name-contains Q3 # find one by name
|
|
26838
26848
|
baker ads meta campaigns create --account-id act_123 --name "Q3" --objective OUTCOME_LEADS --daily-budget 50
|
|
26839
26849
|
baker ads meta campaigns pause 6123 --account-id act_123`
|
|
26840
26850
|
},
|