@koda-sl/baker-cli 0.22.0-dev.ecc541fb → 0.24.0-dev.55a07065
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 +65 -9
- package/dist/cli.js +1 -1
- package/dist/commands/actions/create.d.ts +0 -5
- package/dist/commands/actions/create.d.ts.map +1 -1
- package/dist/commands/actions/create.js +0 -15
- package/dist/commands/actions/create.js.map +1 -1
- package/dist/commands/actions/update.d.ts +0 -5
- package/dist/commands/actions/update.d.ts.map +1 -1
- package/dist/commands/actions/update.js +3 -14
- package/dist/commands/actions/update.js.map +1 -1
- package/dist/commands/ads/index.d.ts.map +1 -1
- package/dist/commands/ads/index.js +8 -2
- package/dist/commands/ads/index.js.map +1 -1
- package/dist/commands/ads/meta/account.d.ts +11 -0
- package/dist/commands/ads/meta/account.d.ts.map +1 -0
- package/dist/commands/ads/meta/account.js +32 -0
- package/dist/commands/ads/meta/account.js.map +1 -0
- package/dist/commands/ads/meta/accounts.d.ts +20 -0
- package/dist/commands/ads/meta/accounts.d.ts.map +1 -0
- package/dist/commands/ads/meta/accounts.js +55 -0
- package/dist/commands/ads/meta/accounts.js.map +1 -0
- package/dist/commands/ads/meta/activities.d.ts +24 -0
- package/dist/commands/ads/meta/activities.d.ts.map +1 -0
- package/dist/commands/ads/meta/activities.js +44 -0
- package/dist/commands/ads/meta/activities.js.map +1 -0
- package/dist/commands/ads/meta/ads.d.ts +32 -0
- package/dist/commands/ads/meta/ads.d.ts.map +1 -0
- package/dist/commands/ads/meta/ads.js +54 -0
- package/dist/commands/ads/meta/ads.js.map +1 -0
- package/dist/commands/ads/meta/adsets.d.ts +28 -0
- package/dist/commands/ads/meta/adsets.d.ts.map +1 -0
- package/dist/commands/ads/meta/adsets.js +47 -0
- package/dist/commands/ads/meta/adsets.js.map +1 -0
- package/dist/commands/ads/meta/audiences.d.ts +20 -0
- package/dist/commands/ads/meta/audiences.d.ts.map +1 -0
- package/dist/commands/ads/meta/audiences.js +41 -0
- package/dist/commands/ads/meta/audiences.js.map +1 -0
- package/dist/commands/ads/meta/businesses.d.ts +12 -0
- package/dist/commands/ads/meta/businesses.d.ts.map +1 -0
- package/dist/commands/ads/meta/businesses.js +35 -0
- package/dist/commands/ads/meta/businesses.js.map +1 -0
- package/dist/commands/ads/meta/campaigns.d.ts +24 -0
- package/dist/commands/ads/meta/campaigns.d.ts.map +1 -0
- package/dist/commands/ads/meta/campaigns.js +48 -0
- package/dist/commands/ads/meta/campaigns.js.map +1 -0
- package/dist/commands/ads/meta/catalogs.d.ts +17 -0
- package/dist/commands/ads/meta/catalogs.d.ts.map +1 -0
- package/dist/commands/ads/meta/catalogs.js +37 -0
- package/dist/commands/ads/meta/catalogs.js.map +1 -0
- package/dist/commands/ads/meta/creatives.d.ts +24 -0
- package/dist/commands/ads/meta/creatives.d.ts.map +1 -0
- package/dist/commands/ads/meta/creatives.js +51 -0
- package/dist/commands/ads/meta/creatives.js.map +1 -0
- package/dist/commands/ads/meta/currency.d.ts +11 -0
- package/dist/commands/ads/meta/currency.d.ts.map +1 -0
- package/dist/commands/ads/meta/currency.js +31 -0
- package/dist/commands/ads/meta/currency.js.map +1 -0
- package/dist/commands/ads/meta/high-demand-periods.d.ts +17 -0
- package/dist/commands/ads/meta/high-demand-periods.d.ts.map +1 -0
- package/dist/commands/ads/meta/high-demand-periods.js +33 -0
- package/dist/commands/ads/meta/high-demand-periods.js.map +1 -0
- package/dist/commands/ads/meta/images.d.ts +24 -0
- package/dist/commands/ads/meta/images.d.ts.map +1 -0
- package/dist/commands/ads/meta/images.js +45 -0
- package/dist/commands/ads/meta/images.js.map +1 -0
- package/dist/commands/ads/meta/index.d.ts +2 -0
- package/dist/commands/ads/meta/index.d.ts.map +1 -0
- package/dist/commands/ads/meta/index.js +76 -0
- package/dist/commands/ads/meta/index.js.map +1 -0
- package/dist/commands/ads/meta/insights.d.ts +81 -0
- package/dist/commands/ads/meta/insights.d.ts.map +1 -0
- package/dist/commands/ads/meta/insights.js +178 -0
- package/dist/commands/ads/meta/insights.js.map +1 -0
- package/dist/commands/ads/meta/labels.d.ts +16 -0
- package/dist/commands/ads/meta/labels.d.ts.map +1 -0
- package/dist/commands/ads/meta/labels.js +34 -0
- package/dist/commands/ads/meta/labels.js.map +1 -0
- package/dist/commands/ads/meta/pixels.d.ts +33 -0
- package/dist/commands/ads/meta/pixels.d.ts.map +1 -0
- package/dist/commands/ads/meta/pixels.js +69 -0
- package/dist/commands/ads/meta/pixels.js.map +1 -0
- package/dist/commands/ads/meta/presets.d.ts +18 -0
- package/dist/commands/ads/meta/presets.d.ts.map +1 -0
- package/dist/commands/ads/meta/presets.js +110 -0
- package/dist/commands/ads/meta/presets.js.map +1 -0
- package/dist/commands/ads/meta/preview.d.ts +32 -0
- package/dist/commands/ads/meta/preview.d.ts.map +1 -0
- package/dist/commands/ads/meta/preview.js +90 -0
- package/dist/commands/ads/meta/preview.js.map +1 -0
- package/dist/commands/ads/meta/shared.d.ts +12 -0
- package/dist/commands/ads/meta/shared.d.ts.map +1 -0
- package/dist/commands/ads/meta/shared.js +59 -0
- package/dist/commands/ads/meta/shared.js.map +1 -0
- package/dist/commands/ads/meta/studies.d.ts +24 -0
- package/dist/commands/ads/meta/studies.d.ts.map +1 -0
- package/dist/commands/ads/meta/studies.js +56 -0
- package/dist/commands/ads/meta/studies.js.map +1 -0
- package/dist/env.d.ts +1 -0
- package/dist/env.d.ts.map +1 -1
- package/dist/env.js +1 -0
- package/dist/env.js.map +1 -1
- package/dist/error-handler.d.ts +1 -1
- package/dist/error-handler.d.ts.map +1 -1
- package/dist/error-handler.js +3 -0
- package/dist/error-handler.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -688,6 +688,69 @@ All errors include a `fix` object with `action`, `correctedCommand` (when applic
|
|
|
688
688
|
|
|
689
689
|
---
|
|
690
690
|
|
|
691
|
+
### Meta Ads (`baker ads meta`)
|
|
692
|
+
|
|
693
|
+
Meta Marketing API (Facebook + Instagram). Connect via OAuth in the dashboard, then pick which ad accounts to scope to. Default account ID: `BAKER_META_AD_ACCOUNT_ID` env var or `--account-id` flag (accepts both `act_123` and bare `123`).
|
|
694
|
+
|
|
695
|
+
Discovery:
|
|
696
|
+
```
|
|
697
|
+
baker ads meta accounts # accounts in the connected scope
|
|
698
|
+
baker ads meta accounts --include-all # every account the token can see
|
|
699
|
+
baker ads meta businesses # Business Manager IDs (needed for studies/catalogs)
|
|
700
|
+
```
|
|
701
|
+
|
|
702
|
+
Account-scoped reads:
|
|
703
|
+
```
|
|
704
|
+
baker ads meta account --account-id act_123 # currency, balance, business, status
|
|
705
|
+
baker ads meta currency --account-id act_123 # lightweight currency lookup
|
|
706
|
+
baker ads meta campaigns --account-id act_123 --effective-status ACTIVE,PAUSED
|
|
707
|
+
baker ads meta adsets --campaign-id 6123 # all adsets in one campaign
|
|
708
|
+
baker ads meta ads --adset-id 6123 # all ads in one adset
|
|
709
|
+
baker ads meta creatives --account-id act_123 # list creatives
|
|
710
|
+
baker ads meta creatives --creative-id 9988 # single creative
|
|
711
|
+
baker ads meta images --account-id act_123 # AdImages keyed by per-account hash
|
|
712
|
+
baker ads meta labels --account-id act_123
|
|
713
|
+
baker ads meta audiences --account-id act_123 # custom audiences (incl. lookalikes)
|
|
714
|
+
baker ads meta pixels --account-id act_123 # Meta Pixels
|
|
715
|
+
baker ads meta pixels --pixel-id 9988 --stats --days 7 # firing stats
|
|
716
|
+
baker ads meta activities --account-id act_123 --days 14 # account audit log (~90d retention)
|
|
717
|
+
baker ads meta high-demand-periods --campaign-id 6123 # scheduled budget bumps
|
|
718
|
+
```
|
|
719
|
+
|
|
720
|
+
Insights (sync + async):
|
|
721
|
+
```
|
|
722
|
+
baker ads meta insights --object act_123 --level ad --fields impressions,spend,ctr --date-preset last_7d
|
|
723
|
+
baker ads meta insights --object act_123 --preset campaign-performance
|
|
724
|
+
baker ads meta insights --object act_123 --preset placement-breakdown --since 2026-01-01 --until 2026-03-31 --async
|
|
725
|
+
baker ads meta insights --list-presets # list built-in presets
|
|
726
|
+
```
|
|
727
|
+
|
|
728
|
+
Presets bundled: `campaign-performance`, `creative-performance`, `placement-breakdown`, `device-breakdown`, `audience-breakdown`, `funnel`, `video-performance`. All Meta-native — not parity-aligned with the Google Ads presets.
|
|
729
|
+
|
|
730
|
+
Attribution windows: as of Jan 2026 only `1d_view, 1d_click, 7d_click, 28d_click` are functional. Others return empty.
|
|
731
|
+
|
|
732
|
+
Previews (creative review workflow):
|
|
733
|
+
```
|
|
734
|
+
baker ads meta preview --creative-id 6123 --ad-format MOBILE_FEED_STANDARD
|
|
735
|
+
baker ads meta preview --ad-id 9988 --ad-format INSTAGRAM_REELS --out-file /tmp/p.html
|
|
736
|
+
baker ads meta preview --account-id act_123 --creative '{"object_story_spec":{...}}' --ad-format MOBILE_FEED_STANDARD
|
|
737
|
+
```
|
|
738
|
+
|
|
739
|
+
Business-scoped:
|
|
740
|
+
```
|
|
741
|
+
baker ads meta studies --business-id 12345 # split tests + lift studies
|
|
742
|
+
baker ads meta studies --study-id 99 --results
|
|
743
|
+
baker ads meta catalogs --business-id 12345 # product catalogs (commerce DPA, hotels, etc.)
|
|
744
|
+
```
|
|
745
|
+
|
|
746
|
+
Notes:
|
|
747
|
+
- Money fields differ between read and write. `spend` is a decimal string in account currency. Budget writes (not yet supported) use integer minor units, with non-uniform offsets (JPY/KRW = 1, KWD/BHD = 1000, most = 100).
|
|
748
|
+
- `effective_status` ≠ `status`. UI should show `effective_status` (e.g. `WITH_ISSUES`, `PENDING_REVIEW`, `DISAPPROVED`, `ADSET_PAUSED`).
|
|
749
|
+
- Account scoping: backend validates every request against the picker selection. Pick accounts via the dashboard "Meta Ads" connection settings before calling these commands.
|
|
750
|
+
- Tokens auto-refresh server-side (60-day rolling long-lived user tokens). On `code 190` reconnect Meta from the dashboard.
|
|
751
|
+
|
|
752
|
+
---
|
|
753
|
+
|
|
691
754
|
### Google Analytics 4 (`baker ga4`)
|
|
692
755
|
|
|
693
756
|
GA4 commands for multi-channel audits. Playbook-aligned presets, property health audits, and free-form Data API queries.
|
|
@@ -1374,8 +1437,8 @@ baker actions get <action-id>
|
|
|
1374
1437
|
baker actions claim <action-id> # live — required before update/complete/discard
|
|
1375
1438
|
baker actions release <action-id>
|
|
1376
1439
|
|
|
1377
|
-
baker actions create --name "Build hero" --description "..." --
|
|
1378
|
-
baker actions update <action-id> --name "Better name"
|
|
1440
|
+
baker actions create --name "Build hero" --description "..." --tag copy,landing
|
|
1441
|
+
baker actions update <action-id> --name "Better name"
|
|
1379
1442
|
baker actions complete <action-id> --note "What was done" # stages — applies on chat publish
|
|
1380
1443
|
baker actions discard <action-id> --reason "obsolete"
|
|
1381
1444
|
|
|
@@ -1397,13 +1460,6 @@ Permissions enforced server-side:
|
|
|
1397
1460
|
- Claiming an action already claimed by another chat returns `CONFLICT` with the other chat's title — pick a different action.
|
|
1398
1461
|
- All staged ops are reverted automatically when the chat is discarded.
|
|
1399
1462
|
|
|
1400
|
-
`--executor` (required on `create`):
|
|
1401
|
-
|
|
1402
|
-
- `agent` — the action can be executed end-to-end by an AI agent inside the sandbox (repo edits, Baker CLI, knowledge writes).
|
|
1403
|
-
- `human` — the action requires a human: UI access (Google Ads, HubSpot), credentials/OAuth setup, billing, contracts, in-person work, or business judgment. Surfaces in the `humanOnly` bucket of `baker actions list` — agents must not claim these.
|
|
1404
|
-
|
|
1405
|
-
If you discover after claiming that an action actually needs the other type, run `baker actions update <id> --executor human|agent` and `release` so the right party can pick it up.
|
|
1406
|
-
|
|
1407
1463
|
---
|
|
1408
1464
|
|
|
1409
1465
|
### `baker schema [command]`
|
package/dist/cli.js
CHANGED
|
@@ -12,7 +12,7 @@ import { videosCommand } from "./commands/videos/index.js";
|
|
|
12
12
|
const main = defineCommand({
|
|
13
13
|
meta: {
|
|
14
14
|
name: "baker",
|
|
15
|
-
version: "0.
|
|
15
|
+
version: "0.24.0",
|
|
16
16
|
description: `AI-agent CLI for finding and managing images, videos, testimonials, action items, and ad platform data in Baker.
|
|
17
17
|
|
|
18
18
|
Auth: Set BAKER_API_KEY (starts with bk_) and BAKER_API_URL environment variables.
|
|
@@ -10,11 +10,6 @@ export declare const createCommand: import("citty").CommandDef<{
|
|
|
10
10
|
readonly required: false;
|
|
11
11
|
readonly default: "";
|
|
12
12
|
};
|
|
13
|
-
readonly executor: {
|
|
14
|
-
readonly type: "string";
|
|
15
|
-
readonly description: "'agent' or 'human' — who can execute this action. Required.";
|
|
16
|
-
readonly required: false;
|
|
17
|
-
};
|
|
18
13
|
readonly tag: {
|
|
19
14
|
readonly type: "string";
|
|
20
15
|
readonly description: "Tag slugs (comma-separated, repeatable)";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../../src/commands/actions/create.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../../src/commands/actions/create.ts"],"names":[],"mappings":"AAuBA,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;EAsCxB,CAAC"}
|
|
@@ -14,11 +14,6 @@ registerSchema({
|
|
|
14
14
|
description: "Context-complete description: what / why / where / done-when",
|
|
15
15
|
required: false,
|
|
16
16
|
},
|
|
17
|
-
executor: {
|
|
18
|
-
type: "string",
|
|
19
|
-
description: "Who can execute this: 'agent' (sandbox-doable: repo edits, baker CLI, knowledge writes) or 'human' (UI access, OAuth, billing, contracts, in-person, business judgment). Required.",
|
|
20
|
-
required: true,
|
|
21
|
-
},
|
|
22
17
|
tag: { type: "string", description: "Tag slugs (comma-separated)", required: false },
|
|
23
18
|
"temp-id": { type: "string", description: "Custom tempId (auto-generated if omitted)", required: false },
|
|
24
19
|
},
|
|
@@ -31,11 +26,6 @@ export const createCommand = defineCommand({
|
|
|
31
26
|
args: {
|
|
32
27
|
name: { type: "string", description: "Action name", required: false },
|
|
33
28
|
description: { type: "string", description: "Description", required: false, default: "" },
|
|
34
|
-
executor: {
|
|
35
|
-
type: "string",
|
|
36
|
-
description: "'agent' or 'human' — who can execute this action. Required.",
|
|
37
|
-
required: false,
|
|
38
|
-
},
|
|
39
29
|
tag: { type: "string", description: "Tag slugs (comma-separated, repeatable)", required: false },
|
|
40
30
|
"temp-id": { type: "string", description: "Optional custom tempId", required: false },
|
|
41
31
|
},
|
|
@@ -45,10 +35,6 @@ export const createCommand = defineCommand({
|
|
|
45
35
|
if (!name || name.trim().length === 0) {
|
|
46
36
|
failValidation("--name is required.");
|
|
47
37
|
}
|
|
48
|
-
const executor = args.executor;
|
|
49
|
-
if (executor !== "agent" && executor !== "human") {
|
|
50
|
-
failValidation("--executor is required: 'agent' (sandbox-doable) or 'human' (UI access, OAuth, billing, contracts, in-person, judgment).");
|
|
51
|
-
}
|
|
52
38
|
const chatId = requireChatId();
|
|
53
39
|
const tempId = args["temp-id"] || generateTempId();
|
|
54
40
|
const tagSlugs = args.tag
|
|
@@ -62,7 +48,6 @@ export const createCommand = defineCommand({
|
|
|
62
48
|
tempId,
|
|
63
49
|
name,
|
|
64
50
|
description: args.description ?? "",
|
|
65
|
-
requiresHuman: executor === "human",
|
|
66
51
|
tagSlugs,
|
|
67
52
|
});
|
|
68
53
|
writeJson(response);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create.js","sourceRoot":"","sources":["../../../src/commands/actions/create.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAEtE,cAAc,CAAC;IACb,OAAO,EAAE,gBAAgB;IACzB,W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,WAAW,EAAG,IAAI,CAAC,WAAsB,IAAI,EAAE;gBAC/C,QAAQ;aACT,CAAC,CAAC;YACH,SAAS,CAAC,QAAQ,CAAC,CAAC;QACtB,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,OAAO,CAAC,GAAG,CAAC,CAAC;QACf,CAAC;IACH,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -19,10 +19,5 @@ export declare const updateCommand: import("citty").CommandDef<{
|
|
|
19
19
|
readonly description: "New description";
|
|
20
20
|
readonly required: false;
|
|
21
21
|
};
|
|
22
|
-
readonly executor: {
|
|
23
|
-
readonly type: "string";
|
|
24
|
-
readonly description: "Reclassify: 'agent' or 'human'";
|
|
25
|
-
readonly required: false;
|
|
26
|
-
};
|
|
27
22
|
}>;
|
|
28
23
|
//# sourceMappingURL=update.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../../../src/commands/actions/update.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../../../src/commands/actions/update.ts"],"names":[],"mappings":"AAgBA,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;EAiCxB,CAAC"}
|
|
@@ -5,16 +5,11 @@ import { registerSchema } from "../../schemas.js";
|
|
|
5
5
|
import { failApi, failValidation, writeOk } from "./shared.js";
|
|
6
6
|
registerSchema({
|
|
7
7
|
command: "actions.update",
|
|
8
|
-
description: "Stage an update on a claimed action (name
|
|
8
|
+
description: "Stage an update on a claimed action (name and/or description). Applies on publish.",
|
|
9
9
|
args: {
|
|
10
10
|
id: { type: "string", description: "Action ID (must be claimed by current chat)", required: true },
|
|
11
11
|
name: { type: "string", description: "New name", required: false },
|
|
12
12
|
description: { type: "string", description: "New description", required: false },
|
|
13
|
-
executor: {
|
|
14
|
-
type: "string",
|
|
15
|
-
description: "Reclassify executor: 'agent' or 'human'.",
|
|
16
|
-
required: false,
|
|
17
|
-
},
|
|
18
13
|
},
|
|
19
14
|
});
|
|
20
15
|
export const updateCommand = defineCommand({
|
|
@@ -27,7 +22,6 @@ export const updateCommand = defineCommand({
|
|
|
27
22
|
"action-id": { type: "string", description: "Action ID", required: false },
|
|
28
23
|
name: { type: "string", description: "New name", required: false },
|
|
29
24
|
description: { type: "string", description: "New description", required: false },
|
|
30
|
-
executor: { type: "string", description: "Reclassify: 'agent' or 'human'", required: false },
|
|
31
25
|
},
|
|
32
26
|
run: async ({ args }) => {
|
|
33
27
|
try {
|
|
@@ -36,12 +30,8 @@ export const updateCommand = defineCommand({
|
|
|
36
30
|
failValidation("Action ID is required.");
|
|
37
31
|
}
|
|
38
32
|
validateConvexId(id);
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
failValidation("--executor must be 'agent' or 'human'.");
|
|
42
|
-
}
|
|
43
|
-
if (args.name === undefined && args.description === undefined && executor === undefined) {
|
|
44
|
-
failValidation("Provide at least one of --name, --description, --executor.");
|
|
33
|
+
if (args.name === undefined && args.description === undefined) {
|
|
34
|
+
failValidation("Provide at least one of --name, --description.");
|
|
45
35
|
}
|
|
46
36
|
const chatId = requireChatId();
|
|
47
37
|
await apiPost("/api/actions/update", {
|
|
@@ -49,7 +39,6 @@ export const updateCommand = defineCommand({
|
|
|
49
39
|
actionId: id,
|
|
50
40
|
name: args.name,
|
|
51
41
|
description: args.description,
|
|
52
|
-
...(executor !== undefined ? { requiresHuman: executor === "human" } : {}),
|
|
53
42
|
});
|
|
54
43
|
writeOk();
|
|
55
44
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update.js","sourceRoot":"","sources":["../../../src/commands/actions/update.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAE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,EAAE,WAAW,EAAE,QAAQ,EAAE,KAAK,EAAE;QAC1E,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,UAAU,EAAE,QAAQ,EAAE,KAAK,EAAE;QAClE,WAAW,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,iBAAiB,EAAE,QAAQ,EAAE,KAAK,EAAE;KACjF;IACD,GAAG,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE;QACtB,IAAI,CAAC;YACH,MAAM,EAAE,GAAI,IAAI,CAAC,EAAyB,IAAK,IAAI,CAAC,WAAW,CAAwB,CAAC;YACxF,IAAI,CAAC,EAAE,EAAE,CAAC;gBACR,cAAc,CAAC,wBAAwB,CAAC,CAAC;YAC3C,CAAC;YACD,gBAAgB,CAAC,EAAE,CAAC,CAAC;YACrB,IAAI,IAAI,CAAC,IAAI,KAAK,SAAS,IAAI,IAAI,CAAC,WAAW,KAAK,SAAS,EAAE,CAAC;gBAC9D,cAAc,CAAC,gDAAgD,CAAC,CAAC;YACnE,CAAC;YACD,MAAM,MAAM,GAAG,aAAa,EAAE,CAAC;YAC/B,MAAM,OAAO,CAAe,qBAAqB,EAAE;gBACjD,MAAM;gBACN,QAAQ,EAAE,EAAE;gBACZ,IAAI,EAAE,IAAI,CAAC,IAAI;gBACf,WAAW,EAAE,IAAI,CAAC,WAAW;aAC9B,CAAC,CAAC;YACH,OAAO,EAAE,CAAC;QACZ,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,OAAO,CAAC,GAAG,CAAC,CAAC;QACf,CAAC;IACH,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/ads/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/ads/index.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,UAAU,qDAoBrB,CAAC"}
|
|
@@ -1,19 +1,25 @@
|
|
|
1
1
|
import { defineCommand } from "citty";
|
|
2
2
|
import { googleCommand } from "./google/index.js";
|
|
3
|
+
import { metaCommand } from "./meta/index.js";
|
|
3
4
|
export const adsCommand = defineCommand({
|
|
4
5
|
meta: {
|
|
5
6
|
name: "ads",
|
|
6
|
-
description: `Ad platform commands.
|
|
7
|
+
description: `Ad platform commands. Each platform exposes its own native command surface — no forced parity.
|
|
7
8
|
|
|
8
9
|
Platforms:
|
|
9
10
|
google — Google Ads (GAQL queries, keywords, accounts)
|
|
11
|
+
meta — Meta Ads (campaigns, adsets, ads, insights, previews)
|
|
10
12
|
|
|
11
13
|
Examples:
|
|
12
14
|
baker ads google accounts
|
|
13
|
-
baker ads google query --preset campaign-performance --customer-id 1234567890
|
|
15
|
+
baker ads google query --preset campaign-performance --customer-id 1234567890
|
|
16
|
+
baker ads meta accounts
|
|
17
|
+
baker ads meta campaigns --account-id act_123 --effective-status ACTIVE
|
|
18
|
+
baker ads meta insights --object act_123 --level ad --date-preset last_7d --fields impressions,spend,ctr`,
|
|
14
19
|
},
|
|
15
20
|
subCommands: {
|
|
16
21
|
google: googleCommand,
|
|
22
|
+
meta: metaCommand,
|
|
17
23
|
},
|
|
18
24
|
});
|
|
19
25
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/ads/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/ads/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE9C,MAAM,CAAC,MAAM,UAAU,GAAG,aAAa,CAAC;IACtC,IAAI,EAAE;QACJ,IAAI,EAAE,KAAK;QACX,WAAW,EAAE;;;;;;;;;;;2GAW0F;KACxG;IACD,WAAW,EAAE;QACX,MAAM,EAAE,aAAa;QACrB,IAAI,EAAE,WAAW;KAClB;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare const accountCommand: import("citty").CommandDef<{
|
|
2
|
+
readonly "account-id": {
|
|
3
|
+
readonly type: "string";
|
|
4
|
+
readonly description: "Meta ad account ID (act_...)";
|
|
5
|
+
};
|
|
6
|
+
readonly "skip-cache": {
|
|
7
|
+
readonly type: "boolean";
|
|
8
|
+
readonly description: "Bypass server-side cache";
|
|
9
|
+
};
|
|
10
|
+
}>;
|
|
11
|
+
//# sourceMappingURL=account.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"account.d.ts","sourceRoot":"","sources":["../../../../src/commands/ads/meta/account.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,cAAc;;;;;;;;;EAwBzB,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { defineCommand } from "citty";
|
|
2
|
+
import { apiGet } from "../../../client.js";
|
|
3
|
+
import { writeAdsJson } from "../output.js";
|
|
4
|
+
import { handleMetaError, resolveAccountIdArg } from "./shared.js";
|
|
5
|
+
export const accountCommand = defineCommand({
|
|
6
|
+
meta: {
|
|
7
|
+
name: "account",
|
|
8
|
+
description: `Show single Meta ad account detail (currency, timezone, balance, business).
|
|
9
|
+
|
|
10
|
+
Examples:
|
|
11
|
+
baker ads meta account --account-id act_123
|
|
12
|
+
BAKER_META_AD_ACCOUNT_ID=act_123 baker ads meta account`,
|
|
13
|
+
},
|
|
14
|
+
args: {
|
|
15
|
+
"account-id": { type: "string", description: "Meta ad account ID (act_...)" },
|
|
16
|
+
"skip-cache": { type: "boolean", description: "Bypass server-side cache" },
|
|
17
|
+
},
|
|
18
|
+
run: async ({ args }) => {
|
|
19
|
+
const accountId = resolveAccountIdArg(args);
|
|
20
|
+
try {
|
|
21
|
+
const params = { "account-id": accountId };
|
|
22
|
+
if (args["skip-cache"])
|
|
23
|
+
params["skip-cache"] = "true";
|
|
24
|
+
const data = await apiGet("/api/ads/meta/account", params);
|
|
25
|
+
writeAdsJson({ ok: true, data });
|
|
26
|
+
}
|
|
27
|
+
catch (err) {
|
|
28
|
+
handleMetaError(err);
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
});
|
|
32
|
+
//# sourceMappingURL=account.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"account.js","sourceRoot":"","sources":["../../../../src/commands/ads/meta/account.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAEnE,MAAM,CAAC,MAAM,cAAc,GAAG,aAAa,CAAC;IAC1C,IAAI,EAAE;QACJ,IAAI,EAAE,SAAS;QACf,WAAW,EAAE;;;;0DAIyC;KACvD;IACD,IAAI,EAAE;QACJ,YAAY,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,8BAA8B,EAAE;QAC7E,YAAY,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,WAAW,EAAE,0BAA0B,EAAE;KAC3E;IACD,GAAG,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE;QACtB,MAAM,SAAS,GAAG,mBAAmB,CAAC,IAAI,CAAC,CAAC;QAC5C,IAAI,CAAC;YACH,MAAM,MAAM,GAA2B,EAAE,YAAY,EAAE,SAAS,EAAE,CAAC;YACnE,IAAI,IAAI,CAAC,YAAY,CAAC;gBAAE,MAAM,CAAC,YAAY,CAAC,GAAG,MAAM,CAAC;YACtD,MAAM,IAAI,GAAG,MAAM,MAAM,CAA0B,uBAAuB,EAAE,MAAM,CAAC,CAAC;YACpF,YAAY,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;QACnC,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,eAAe,CAAC,GAAG,CAAC,CAAC;QACvB,CAAC;IACH,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export declare const accountsCommand: import("citty").CommandDef<{
|
|
2
|
+
readonly "include-all": {
|
|
3
|
+
readonly type: "boolean";
|
|
4
|
+
readonly description: "List all accessible accounts, ignoring picker scope";
|
|
5
|
+
};
|
|
6
|
+
readonly "no-cache": {
|
|
7
|
+
readonly type: "boolean";
|
|
8
|
+
readonly description: "Skip CLI-side cache";
|
|
9
|
+
};
|
|
10
|
+
readonly "skip-cache": {
|
|
11
|
+
readonly type: "boolean";
|
|
12
|
+
readonly description: "Bypass server-side cache (force re-fetch)";
|
|
13
|
+
};
|
|
14
|
+
readonly output: {
|
|
15
|
+
readonly type: "string";
|
|
16
|
+
readonly description: "Output format: json|csv|jsonl|md";
|
|
17
|
+
readonly default: "json";
|
|
18
|
+
};
|
|
19
|
+
}>;
|
|
20
|
+
//# sourceMappingURL=accounts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"accounts.d.ts","sourceRoot":"","sources":["../../../../src/commands/ads/meta/accounts.ts"],"names":[],"mappings":"AAkBA,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;EA6C1B,CAAC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { defineCommand } from "citty";
|
|
2
|
+
import { apiGet } from "../../../client.js";
|
|
3
|
+
import { cacheGet, cacheSet } from "../cache.js";
|
|
4
|
+
import { writeAdsJson, writeAdsOutput } from "../output.js";
|
|
5
|
+
import { csvOrJson, handleMetaError } from "./shared.js";
|
|
6
|
+
export const accountsCommand = defineCommand({
|
|
7
|
+
meta: {
|
|
8
|
+
name: "accounts",
|
|
9
|
+
description: `List Meta ad accounts in this company's connected scope.
|
|
10
|
+
|
|
11
|
+
Examples:
|
|
12
|
+
baker ads meta accounts
|
|
13
|
+
baker ads meta accounts --include-all # ignore picker scope and list every account the token can see
|
|
14
|
+
baker ads meta accounts --output csv`,
|
|
15
|
+
},
|
|
16
|
+
args: {
|
|
17
|
+
"include-all": { type: "boolean", description: "List all accessible accounts, ignoring picker scope" },
|
|
18
|
+
"no-cache": { type: "boolean", description: "Skip CLI-side cache" },
|
|
19
|
+
"skip-cache": { type: "boolean", description: "Bypass server-side cache (force re-fetch)" },
|
|
20
|
+
output: { type: "string", description: "Output format: json|csv|jsonl|md", default: "json" },
|
|
21
|
+
},
|
|
22
|
+
run: async ({ args }) => {
|
|
23
|
+
const includeAll = args["include-all"] === true;
|
|
24
|
+
const useCache = !args["no-cache"];
|
|
25
|
+
const cacheKey = `accounts:${includeAll ? "all" : "scoped"}`;
|
|
26
|
+
if (useCache) {
|
|
27
|
+
const cached = cacheGet("meta-accounts", cacheKey);
|
|
28
|
+
if (cached) {
|
|
29
|
+
writeAdsJson({ ok: true, data: cached.data, cached: true });
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
try {
|
|
34
|
+
const params = {};
|
|
35
|
+
if (includeAll)
|
|
36
|
+
params["include-all"] = "true";
|
|
37
|
+
if (args["skip-cache"])
|
|
38
|
+
params["skip-cache"] = "true";
|
|
39
|
+
const data = await apiGet("/api/ads/meta/accounts", params);
|
|
40
|
+
if (useCache) {
|
|
41
|
+
cacheSet("meta-accounts", cacheKey, data, 60 * 60 * 1000);
|
|
42
|
+
}
|
|
43
|
+
const fmt = csvOrJson(args);
|
|
44
|
+
if (fmt !== "json") {
|
|
45
|
+
writeAdsOutput(data, fmt);
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
writeAdsJson({ ok: true, data });
|
|
49
|
+
}
|
|
50
|
+
catch (err) {
|
|
51
|
+
handleMetaError(err);
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
});
|
|
55
|
+
//# sourceMappingURL=accounts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"accounts.js","sourceRoot":"","sources":["../../../../src/commands/ads/meta/accounts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC5D,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAczD,MAAM,CAAC,MAAM,eAAe,GAAG,aAAa,CAAC;IAC3C,IAAI,EAAE;QACJ,IAAI,EAAE,UAAU;QAChB,WAAW,EAAE;;;;;uCAKsB;KACpC;IACD,IAAI,EAAE;QACJ,aAAa,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,WAAW,EAAE,qDAAqD,EAAE;QACtG,UAAU,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,WAAW,EAAE,qBAAqB,EAAE;QACnE,YAAY,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,WAAW,EAAE,2CAA2C,EAAE;QAC3F,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,kCAAkC,EAAE,OAAO,EAAE,MAAM,EAAE;KAC7F;IACD,GAAG,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE;QACtB,MAAM,UAAU,GAAG,IAAI,CAAC,aAAa,CAAC,KAAK,IAAI,CAAC;QAChD,MAAM,QAAQ,GAAG,CAAC,IAAI,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
|
+
export declare const activitiesCommand: import("citty").CommandDef<{
|
|
2
|
+
readonly "account-id": {
|
|
3
|
+
readonly type: "string";
|
|
4
|
+
readonly description: "Meta ad account ID";
|
|
5
|
+
};
|
|
6
|
+
readonly days: {
|
|
7
|
+
readonly type: "string";
|
|
8
|
+
readonly description: "Lookback days (default 7)";
|
|
9
|
+
};
|
|
10
|
+
readonly limit: {
|
|
11
|
+
readonly type: "string";
|
|
12
|
+
readonly description: "Max rows";
|
|
13
|
+
};
|
|
14
|
+
readonly "skip-cache": {
|
|
15
|
+
readonly type: "boolean";
|
|
16
|
+
readonly description: "Bypass server-side cache";
|
|
17
|
+
};
|
|
18
|
+
readonly output: {
|
|
19
|
+
readonly type: "string";
|
|
20
|
+
readonly description: "Output format";
|
|
21
|
+
readonly default: "json";
|
|
22
|
+
};
|
|
23
|
+
}>;
|
|
24
|
+
//# sourceMappingURL=activities.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"activities.d.ts","sourceRoot":"","sources":["../../../../src/commands/ads/meta/activities.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;EAkC5B,CAAC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { defineCommand } from "citty";
|
|
2
|
+
import { apiGet } from "../../../client.js";
|
|
3
|
+
import { writeAdsJson, writeAdsOutput } from "../output.js";
|
|
4
|
+
import { csvOrJson, handleMetaError, resolveAccountIdArg } from "./shared.js";
|
|
5
|
+
export const activitiesCommand = defineCommand({
|
|
6
|
+
meta: {
|
|
7
|
+
name: "activities",
|
|
8
|
+
description: `Audit log of recent ad-account changes (created, paused, edited). Default lookback 7 days,
|
|
9
|
+
~90 day retention server-side.
|
|
10
|
+
|
|
11
|
+
Examples:
|
|
12
|
+
baker ads meta activities --account-id act_123 --days 14`,
|
|
13
|
+
},
|
|
14
|
+
args: {
|
|
15
|
+
"account-id": { type: "string", description: "Meta ad account ID" },
|
|
16
|
+
days: { type: "string", description: "Lookback days (default 7)" },
|
|
17
|
+
limit: { type: "string", description: "Max rows" },
|
|
18
|
+
"skip-cache": { type: "boolean", description: "Bypass server-side cache" },
|
|
19
|
+
output: { type: "string", description: "Output format", default: "json" },
|
|
20
|
+
},
|
|
21
|
+
run: async ({ args }) => {
|
|
22
|
+
const accountId = resolveAccountIdArg(args);
|
|
23
|
+
try {
|
|
24
|
+
const params = { "account-id": accountId };
|
|
25
|
+
if (args.days)
|
|
26
|
+
params.days = args.days;
|
|
27
|
+
if (args.limit)
|
|
28
|
+
params.limit = args.limit;
|
|
29
|
+
if (args["skip-cache"])
|
|
30
|
+
params["skip-cache"] = "true";
|
|
31
|
+
const data = await apiGet("/api/ads/meta/activities", params);
|
|
32
|
+
const fmt = csvOrJson(args);
|
|
33
|
+
if (fmt !== "json") {
|
|
34
|
+
writeAdsOutput(data, fmt);
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
writeAdsJson({ ok: true, data });
|
|
38
|
+
}
|
|
39
|
+
catch (err) {
|
|
40
|
+
handleMetaError(err);
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
});
|
|
44
|
+
//# sourceMappingURL=activities.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"activities.js","sourceRoot":"","sources":["../../../../src/commands/ads/meta/activities.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC5D,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAE9E,MAAM,CAAC,MAAM,iBAAiB,GAAG,aAAa,CAAC;IAC7C,IAAI,EAAE;QACJ,IAAI,EAAE,YAAY;QAClB,WAAW,EAAE;;;;2DAI0C;KACxD;IACD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YACb,eAAe,CAAC,GAAG,CAAC,CAAC;QACvB,CAAC;IACH,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export declare const adsListCommand: import("citty").CommandDef<{
|
|
2
|
+
readonly "account-id": {
|
|
3
|
+
readonly type: "string";
|
|
4
|
+
readonly description: "Meta ad account ID";
|
|
5
|
+
};
|
|
6
|
+
readonly "adset-id": {
|
|
7
|
+
readonly type: "string";
|
|
8
|
+
readonly description: "Filter to one adset";
|
|
9
|
+
};
|
|
10
|
+
readonly "campaign-id": {
|
|
11
|
+
readonly type: "string";
|
|
12
|
+
readonly description: "Filter to one campaign";
|
|
13
|
+
};
|
|
14
|
+
readonly "effective-status": {
|
|
15
|
+
readonly type: "string";
|
|
16
|
+
readonly description: "Comma-separated effective_status filter";
|
|
17
|
+
};
|
|
18
|
+
readonly limit: {
|
|
19
|
+
readonly type: "string";
|
|
20
|
+
readonly description: "Max rows (default 1000)";
|
|
21
|
+
};
|
|
22
|
+
readonly "skip-cache": {
|
|
23
|
+
readonly type: "boolean";
|
|
24
|
+
readonly description: "Bypass server-side cache";
|
|
25
|
+
};
|
|
26
|
+
readonly output: {
|
|
27
|
+
readonly type: "string";
|
|
28
|
+
readonly description: "Output format";
|
|
29
|
+
readonly default: "json";
|
|
30
|
+
};
|
|
31
|
+
}>;
|
|
32
|
+
//# sourceMappingURL=ads.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ads.d.ts","sourceRoot":"","sources":["../../../../src/commands/ads/meta/ads.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA0CzB,CAAC"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { defineCommand } from "citty";
|
|
2
|
+
import { apiGet } from "../../../client.js";
|
|
3
|
+
import { writeAdsJson, writeAdsOutput } from "../output.js";
|
|
4
|
+
import { csvOrJson, handleMetaError, resolveAccountIdArg } from "./shared.js";
|
|
5
|
+
export const adsListCommand = defineCommand({
|
|
6
|
+
meta: {
|
|
7
|
+
name: "ads",
|
|
8
|
+
description: `List ads in a Meta ad account, optionally scoped by adset or campaign.
|
|
9
|
+
|
|
10
|
+
The dashboard shows effective_status (e.g. WITH_ISSUES, PENDING_REVIEW, DISAPPROVED, ADSET_PAUSED), not status.
|
|
11
|
+
preview_shareable_link returns a Meta-hosted URL useful for design review.
|
|
12
|
+
|
|
13
|
+
Examples:
|
|
14
|
+
baker ads meta ads --account-id act_123
|
|
15
|
+
baker ads meta ads --adset-id 6123 --effective-status ACTIVE
|
|
16
|
+
baker ads meta ads --campaign-id 6123 --output csv`,
|
|
17
|
+
},
|
|
18
|
+
args: {
|
|
19
|
+
"account-id": { type: "string", description: "Meta ad account ID" },
|
|
20
|
+
"adset-id": { type: "string", description: "Filter to one adset" },
|
|
21
|
+
"campaign-id": { type: "string", description: "Filter to one campaign" },
|
|
22
|
+
"effective-status": { type: "string", description: "Comma-separated effective_status filter" },
|
|
23
|
+
limit: { type: "string", description: "Max rows (default 1000)" },
|
|
24
|
+
"skip-cache": { type: "boolean", description: "Bypass server-side cache" },
|
|
25
|
+
output: { type: "string", description: "Output format", default: "json" },
|
|
26
|
+
},
|
|
27
|
+
run: async ({ args }) => {
|
|
28
|
+
const accountId = resolveAccountIdArg(args);
|
|
29
|
+
try {
|
|
30
|
+
const params = { "account-id": accountId };
|
|
31
|
+
if (args["adset-id"])
|
|
32
|
+
params["adset-id"] = args["adset-id"];
|
|
33
|
+
if (args["campaign-id"])
|
|
34
|
+
params["campaign-id"] = args["campaign-id"];
|
|
35
|
+
if (args["effective-status"])
|
|
36
|
+
params["effective-status"] = args["effective-status"];
|
|
37
|
+
if (args.limit)
|
|
38
|
+
params.limit = args.limit;
|
|
39
|
+
if (args["skip-cache"])
|
|
40
|
+
params["skip-cache"] = "true";
|
|
41
|
+
const data = await apiGet("/api/ads/meta/ads", params);
|
|
42
|
+
const fmt = csvOrJson(args);
|
|
43
|
+
if (fmt !== "json") {
|
|
44
|
+
writeAdsOutput(data, fmt);
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
writeAdsJson({ ok: true, data });
|
|
48
|
+
}
|
|
49
|
+
catch (err) {
|
|
50
|
+
handleMetaError(err);
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
});
|
|
54
|
+
//# sourceMappingURL=ads.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ads.js","sourceRoot":"","sources":["../../../../src/commands/ads/meta/ads.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC5D,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAE9E,MAAM,CAAC,MAAM,cAAc,GAAG,aAAa,CAAC;IAC1C,IAAI,EAAE;QACJ,IAAI,EAAE,KAAK;QACX,WAAW,EAAE;;;;;;;;qDAQoC;KAClD;IACD,IAAI,EAAE;QACJ,YAAY,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,oBAAoB,EAAE;QACnE,UAAU,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,qBAAqB,EAAE;QAClE,aAAa,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,wBAAwB,EAAE;QACxE,kBAAkB,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,yCAAyC,EAAE;QAC9F,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,yBAAyB,EAAE;QACjE,YAAY,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,WAAW,EAAE,0BAA0B,EAAE;QAC1E,MAAM,EA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