@koda-sl/baker-cli 0.23.0 → 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 +63 -0
- package/dist/cli.js +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
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { defineCommand } from "citty";
|
|
2
|
+
import { apiGet } from "../../../client.js";
|
|
3
|
+
import { writeAdsJson, writeAdsOutput } from "../output.js";
|
|
4
|
+
import { csvOrJson, handleMetaError } from "./shared.js";
|
|
5
|
+
export const businessesCommand = defineCommand({
|
|
6
|
+
meta: {
|
|
7
|
+
name: "businesses",
|
|
8
|
+
description: `List Meta Business Manager accounts the connected user has access to. Required for ad-studies and product-catalogs commands.
|
|
9
|
+
|
|
10
|
+
Examples:
|
|
11
|
+
baker ads meta businesses`,
|
|
12
|
+
},
|
|
13
|
+
args: {
|
|
14
|
+
"skip-cache": { type: "boolean", description: "Bypass server-side cache" },
|
|
15
|
+
output: { type: "string", description: "Output format", default: "json" },
|
|
16
|
+
},
|
|
17
|
+
run: async ({ args }) => {
|
|
18
|
+
try {
|
|
19
|
+
const params = {};
|
|
20
|
+
if (args["skip-cache"])
|
|
21
|
+
params["skip-cache"] = "true";
|
|
22
|
+
const data = await apiGet("/api/ads/meta/businesses", params);
|
|
23
|
+
const fmt = csvOrJson(args);
|
|
24
|
+
if (fmt !== "json") {
|
|
25
|
+
writeAdsOutput(data, fmt);
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
writeAdsJson({ ok: true, data });
|
|
29
|
+
}
|
|
30
|
+
catch (err) {
|
|
31
|
+
handleMetaError(err);
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
});
|
|
35
|
+
//# sourceMappingURL=businesses.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"businesses.js","sourceRoot":"","sources":["../../../../src/commands/ads/meta/businesses.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,MAAM,aAAa,CAAC;AAEzD,MAAM,CAAC,MAAM,iBAAiB,GAAG,aAAa,CAAC;IAC7C,IAAI,EAAE;QACJ,IAAI,EAAE,YAAY;QAClB,WAAW,EAAE;;;4BAGW;KACzB;IACD,IAAI,EAAE;QACJ,YAAY,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,WAAW,EAAE,0BAA0B,EAAE;QAC1E,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,EAAE;KAC1E;IACD,GAAG,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE;QACtB,IAAI,CAAC;YACH,MAAM,MAAM,GAA2B,EAAE,CAAC;YAC1C,IAAI,IAAI,CAAC,YAAY,CAAC;gBAAE,MAAM,CAAC,YAAY,CAAC,GAAG,MAAM,CAAC;YACtD,MAAM,IAAI,GAAG,MAAM,MAAM,CAAiC,0BAA0B,EAAE,MAAM,CAAC,CAAC;YAC9F,MAAM,GAAG,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC;YAC5B,IAAI,GAAG,KAAK,MAAM,EAAE,CAAC;gBACnB,cAAc,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;gBAC1B,OAAO;YACT,CAAC;YACD,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,24 @@
|
|
|
1
|
+
export declare const campaignsCommand: import("citty").CommandDef<{
|
|
2
|
+
readonly "account-id": {
|
|
3
|
+
readonly type: "string";
|
|
4
|
+
readonly description: "Meta ad account ID";
|
|
5
|
+
};
|
|
6
|
+
readonly "effective-status": {
|
|
7
|
+
readonly type: "string";
|
|
8
|
+
readonly description: "Comma-separated effective_status filter";
|
|
9
|
+
};
|
|
10
|
+
readonly limit: {
|
|
11
|
+
readonly type: "string";
|
|
12
|
+
readonly description: "Max rows (default 1000)";
|
|
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=campaigns.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"campaigns.d.ts","sourceRoot":"","sources":["../../../../src/commands/ads/meta/campaigns.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;EAsC3B,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
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 campaignsCommand = defineCommand({
|
|
6
|
+
meta: {
|
|
7
|
+
name: "campaigns",
|
|
8
|
+
description: `List campaigns for a Meta ad account.
|
|
9
|
+
|
|
10
|
+
Note: in Meta's API, "campaign" is what we'd call a campaign group. Status uses effective_status (filterable),
|
|
11
|
+
which can be ACTIVE, PAUSED, DELETED, ARCHIVED, IN_PROCESS, WITH_ISSUES, etc.
|
|
12
|
+
|
|
13
|
+
Examples:
|
|
14
|
+
baker ads meta campaigns --account-id act_123
|
|
15
|
+
baker ads meta campaigns --account-id act_123 --effective-status ACTIVE,PAUSED
|
|
16
|
+
baker ads meta campaigns --account-id act_123 --output csv`,
|
|
17
|
+
},
|
|
18
|
+
args: {
|
|
19
|
+
"account-id": { type: "string", description: "Meta ad account ID" },
|
|
20
|
+
"effective-status": { type: "string", description: "Comma-separated effective_status filter" },
|
|
21
|
+
limit: { type: "string", description: "Max rows (default 1000)" },
|
|
22
|
+
"skip-cache": { type: "boolean", description: "Bypass server-side cache" },
|
|
23
|
+
output: { type: "string", description: "Output format", default: "json" },
|
|
24
|
+
},
|
|
25
|
+
run: async ({ args }) => {
|
|
26
|
+
const accountId = resolveAccountIdArg(args);
|
|
27
|
+
try {
|
|
28
|
+
const params = { "account-id": accountId };
|
|
29
|
+
if (args["effective-status"])
|
|
30
|
+
params["effective-status"] = args["effective-status"];
|
|
31
|
+
if (args.limit)
|
|
32
|
+
params.limit = args.limit;
|
|
33
|
+
if (args["skip-cache"])
|
|
34
|
+
params["skip-cache"] = "true";
|
|
35
|
+
const data = await apiGet("/api/ads/meta/campaigns", params);
|
|
36
|
+
const fmt = csvOrJson(args);
|
|
37
|
+
if (fmt !== "json") {
|
|
38
|
+
writeAdsOutput(data, fmt);
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
writeAdsJson({ ok: true, data });
|
|
42
|
+
}
|
|
43
|
+
catch (err) {
|
|
44
|
+
handleMetaError(err);
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
});
|
|
48
|
+
//# sourceMappingURL=campaigns.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"campaigns.js","sourceRoot":"","sources":["../../../../src/commands/ads/meta/campaigns.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,gBAAgB,GAAG,aAAa,CAAC;IAC5C,IAAI,EAAE;QACJ,IAAI,EAAE,WAAW;QACjB,WAAW,EAAE;;;;;;;;6DAQ4C;KAC1D;IACD,IAAI,EAAE;QACJ,YAAY,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,oBAAoB,EAAE;QACnE,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,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,EAAE;KAC1E;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,kBAAkB,CAAC;gBAAE,MAAM,CAAC,kBAAkB,CAAC,GAAG,IAAI,CAAC,kBAAkB,CAAW,CAAC;YAC9F,IAAI,IAAI,CAAC,KAAK;gBAAE,MAAM,CAAC,KAAK,GAAG,IAAI,CAAC,KAAe,CAAC;YACpD,IAAI,IAAI,CAAC,YAAY,CAAC;gBAAE,MAAM,CAAC,YAAY,CAAC,GAAG,MAAM,CAAC;YACtD,MAAM,IAAI,GAAG,MAAM,MAAM,CAAiC,yBAAyB,EAAE,MAAM,CAAC,CAAC;YAC7F,MAAM,GAAG,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC;YAC5B,IAAI,GAAG,KAAK,MAAM,EAAE,CAAC;gBACnB,cAAc,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;gBAC1B,OAAO;YACT,CAAC;YACD,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,17 @@
|
|
|
1
|
+
export declare const catalogsCommand: import("citty").CommandDef<{
|
|
2
|
+
readonly "business-id": {
|
|
3
|
+
readonly type: "string";
|
|
4
|
+
readonly description: "Meta Business Manager ID";
|
|
5
|
+
readonly required: true;
|
|
6
|
+
};
|
|
7
|
+
readonly "skip-cache": {
|
|
8
|
+
readonly type: "boolean";
|
|
9
|
+
readonly description: "Bypass server-side cache";
|
|
10
|
+
};
|
|
11
|
+
readonly output: {
|
|
12
|
+
readonly type: "string";
|
|
13
|
+
readonly description: "Output format";
|
|
14
|
+
readonly default: "json";
|
|
15
|
+
};
|
|
16
|
+
}>;
|
|
17
|
+
//# sourceMappingURL=catalogs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"catalogs.d.ts","sourceRoot":"","sources":["../../../../src/commands/ads/meta/catalogs.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;EA6B1B,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { defineCommand } from "citty";
|
|
2
|
+
import { apiGet } from "../../../client.js";
|
|
3
|
+
import { writeAdsJson, writeAdsOutput } from "../output.js";
|
|
4
|
+
import { csvOrJson, handleMetaError } from "./shared.js";
|
|
5
|
+
export const catalogsCommand = defineCommand({
|
|
6
|
+
meta: {
|
|
7
|
+
name: "catalogs",
|
|
8
|
+
description: `List product catalogs owned by a Meta Business. Vertical (commerce, hotels, vehicles, etc.)
|
|
9
|
+
is immutable once set.
|
|
10
|
+
|
|
11
|
+
Examples:
|
|
12
|
+
baker ads meta catalogs --business-id 1234567890`,
|
|
13
|
+
},
|
|
14
|
+
args: {
|
|
15
|
+
"business-id": { type: "string", description: "Meta Business Manager ID", required: true },
|
|
16
|
+
"skip-cache": { type: "boolean", description: "Bypass server-side cache" },
|
|
17
|
+
output: { type: "string", description: "Output format", default: "json" },
|
|
18
|
+
},
|
|
19
|
+
run: async ({ args }) => {
|
|
20
|
+
try {
|
|
21
|
+
const params = { "business-id": args["business-id"] };
|
|
22
|
+
if (args["skip-cache"])
|
|
23
|
+
params["skip-cache"] = "true";
|
|
24
|
+
const data = await apiGet("/api/ads/meta/catalogs", params);
|
|
25
|
+
const fmt = csvOrJson(args);
|
|
26
|
+
if (fmt !== "json") {
|
|
27
|
+
writeAdsOutput(data, fmt);
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
writeAdsJson({ ok: true, data });
|
|
31
|
+
}
|
|
32
|
+
catch (err) {
|
|
33
|
+
handleMetaError(err);
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
});
|
|
37
|
+
//# sourceMappingURL=catalogs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"catalogs.js","sourceRoot":"","sources":["../../../../src/commands/ads/meta/catalogs.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,MAAM,aAAa,CAAC;AAEzD,MAAM,CAAC,MAAM,eAAe,GAAG,aAAa,CAAC;IAC3C,IAAI,EAAE;QACJ,IAAI,EAAE,UAAU;QAChB,WAAW,EAAE;;;;mDAIkC;KAChD;IACD,IAAI,EAAE;QACJ,aAAa,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,0BAA0B,EAAE,QAAQ,EAAE,IAAI,EAAE;QAC1F,YAAY,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,WAAW,EAAE,0BAA0B,EAAE;QAC1E,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,EAAE;KAC1E;IACD,GAAG,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE;QACtB,IAAI,CAAC;YACH,MAAM,MAAM,GAA2B,EAAE,aAAa,EAAE,IAAI,CAAC,aAAa,CAAW,EAAE,CAAC;YACxF,IAAI,IAAI,CAAC,YAAY,CAAC;gBAAE,MAAM,CAAC,YAAY,CAAC,GAAG,MAAM,CAAC;YACtD,MAAM,IAAI,GAAG,MAAM,MAAM,CAAiC,wBAAwB,EAAE,MAAM,CAAC,CAAC;YAC5F,MAAM,GAAG,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC;YAC5B,IAAI,GAAG,KAAK,MAAM,EAAE,CAAC;gBACnB,cAAc,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;gBAC1B,OAAO;YACT,CAAC;YACD,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,24 @@
|
|
|
1
|
+
export declare const creativesCommand: import("citty").CommandDef<{
|
|
2
|
+
readonly "account-id": {
|
|
3
|
+
readonly type: "string";
|
|
4
|
+
readonly description: "Meta ad account ID (required if no --creative-id)";
|
|
5
|
+
};
|
|
6
|
+
readonly "creative-id": {
|
|
7
|
+
readonly type: "string";
|
|
8
|
+
readonly description: "Single creative ID";
|
|
9
|
+
};
|
|
10
|
+
readonly limit: {
|
|
11
|
+
readonly type: "string";
|
|
12
|
+
readonly description: "Max rows (default 500)";
|
|
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=creatives.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"creatives.d.ts","sourceRoot":"","sources":["../../../../src/commands/ads/meta/creatives.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;EAyC3B,CAAC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
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 creativesCommand = defineCommand({
|
|
6
|
+
meta: {
|
|
7
|
+
name: "creatives",
|
|
8
|
+
description: `List ad creatives in an account, or fetch a single creative by ID.
|
|
9
|
+
|
|
10
|
+
Important: Meta creatives are effectively immutable once attached to an ad. Editing copy/image/CTA = create
|
|
11
|
+
a new creative + reattach. Bake this into any agentic edit workflow.
|
|
12
|
+
|
|
13
|
+
Examples:
|
|
14
|
+
baker ads meta creatives --account-id act_123
|
|
15
|
+
baker ads meta creatives --creative-id 23842... # fetch one`,
|
|
16
|
+
},
|
|
17
|
+
args: {
|
|
18
|
+
"account-id": { type: "string", description: "Meta ad account ID (required if no --creative-id)" },
|
|
19
|
+
"creative-id": { type: "string", description: "Single creative ID" },
|
|
20
|
+
limit: { type: "string", description: "Max rows (default 500)" },
|
|
21
|
+
"skip-cache": { type: "boolean", description: "Bypass server-side cache" },
|
|
22
|
+
output: { type: "string", description: "Output format", default: "json" },
|
|
23
|
+
},
|
|
24
|
+
run: async ({ args }) => {
|
|
25
|
+
try {
|
|
26
|
+
const params = {};
|
|
27
|
+
if (args["creative-id"]) {
|
|
28
|
+
params["creative-id"] = args["creative-id"];
|
|
29
|
+
}
|
|
30
|
+
else {
|
|
31
|
+
const accountId = resolveAccountIdArg(args);
|
|
32
|
+
params["account-id"] = accountId;
|
|
33
|
+
}
|
|
34
|
+
if (args.limit)
|
|
35
|
+
params.limit = args.limit;
|
|
36
|
+
if (args["skip-cache"])
|
|
37
|
+
params["skip-cache"] = "true";
|
|
38
|
+
const data = await apiGet("/api/ads/meta/creatives", params);
|
|
39
|
+
const fmt = csvOrJson(args);
|
|
40
|
+
if (Array.isArray(data) && fmt !== "json") {
|
|
41
|
+
writeAdsOutput(data, fmt);
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
writeAdsJson({ ok: true, data });
|
|
45
|
+
}
|
|
46
|
+
catch (err) {
|
|
47
|
+
handleMetaError(err);
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
});
|
|
51
|
+
//# sourceMappingURL=creatives.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"creatives.js","sourceRoot":"","sources":["../../../../src/commands/ads/meta/creatives.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,gBAAgB,GAAG,aAAa,CAAC;IAC5C,IAAI,EAAE;QACJ,IAAI,EAAE,WAAW;QACjB,WAAW,EAAE;;;;;;;gEAO+C;KAC7D;IACD,IAAI,EAAE;QACJ,YAAY,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,mDAAmD,EAAE;QAClG,aAAa,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,oBAAoB,EAAE;QACpE,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,wBAAwB,EAAE;QAChE,YAAY,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,WAAW,EAAE,0BAA0B,EAAE;QAC1E,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,EAAE;KAC1E;IACD,GAAG,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE;QACtB,IAAI,CAAC;YACH,MAAM,MAAM,GAA2B,EAAE,CAAC;YAC1C,IAAI,IAAI,CAAC,aAAa,CAAC,EAAE,CAAC;gBACxB,MAAM,CAAC,aAAa,CAAC,GAAG,IAAI,CAAC,aAAa,CAAW,CAAC;YACxD,CAAC;iBAAM,CAAC;gBACN,MAAM,SAAS,GAAG,mBAAmB,CAAC,IAAI,CAAC,CAAC;gBAC5C,MAAM,CAAC,YAAY,CAAC,GAAG,SAAS,CAAC;YACnC,CAAC;YACD,IAAI,IAAI,CAAC,KAAK;gBAAE,MAAM,CAAC,KAAK,GAAG,IAAI,CAAC,KAAe,CAAC;YACpD,IAAI,IAAI,CAAC,YAAY,CAAC;gBAAE,MAAM,CAAC,YAAY,CAAC,GAAG,MAAM,CAAC;YACtD,MAAM,IAAI,GAAG,MAAM,MAAM,CAAU,yBAAyB,EAAE,MAAM,CAAC,CAAC;YACtE,MAAM,GAAG,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC;YAC5B,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,GAAG,KAAK,MAAM,EAAE,CAAC;gBAC1C,cAAc,CAAC,IAAsC,EAAE,GAAG,CAAC,CAAC;gBAC5D,OAAO;YACT,CAAC;YACD,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,11 @@
|
|
|
1
|
+
export declare const currencyCommand: import("citty").CommandDef<{
|
|
2
|
+
readonly "account-id": {
|
|
3
|
+
readonly type: "string";
|
|
4
|
+
readonly description: "Meta ad account ID";
|
|
5
|
+
};
|
|
6
|
+
readonly "skip-cache": {
|
|
7
|
+
readonly type: "boolean";
|
|
8
|
+
readonly description: "Bypass server-side cache";
|
|
9
|
+
};
|
|
10
|
+
}>;
|
|
11
|
+
//# sourceMappingURL=currency.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"currency.d.ts","sourceRoot":"","sources":["../../../../src/commands/ads/meta/currency.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,eAAe;;;;;;;;;EA0B1B,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
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 currencyCommand = defineCommand({
|
|
6
|
+
meta: {
|
|
7
|
+
name: "currency",
|
|
8
|
+
description: `Lookup the currency + timezone for a Meta ad account. Lightweight wrapper around the account detail endpoint, cached 1 day.
|
|
9
|
+
|
|
10
|
+
Examples:
|
|
11
|
+
baker ads meta currency --account-id act_123`,
|
|
12
|
+
},
|
|
13
|
+
args: {
|
|
14
|
+
"account-id": { type: "string", description: "Meta ad account ID" },
|
|
15
|
+
"skip-cache": { type: "boolean", description: "Bypass server-side cache" },
|
|
16
|
+
},
|
|
17
|
+
run: async ({ args }) => {
|
|
18
|
+
const accountId = resolveAccountIdArg(args);
|
|
19
|
+
try {
|
|
20
|
+
const params = { "account-id": accountId };
|
|
21
|
+
if (args["skip-cache"])
|
|
22
|
+
params["skip-cache"] = "true";
|
|
23
|
+
const data = await apiGet("/api/ads/meta/currency", params);
|
|
24
|
+
writeAdsJson({ ok: true, data });
|
|
25
|
+
}
|
|
26
|
+
catch (err) {
|
|
27
|
+
handleMetaError(err);
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
});
|
|
31
|
+
//# sourceMappingURL=currency.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"currency.js","sourceRoot":"","sources":["../../../../src/commands/ads/meta/currency.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,eAAe,GAAG,aAAa,CAAC;IAC3C,IAAI,EAAE;QACJ,IAAI,EAAE,UAAU;QAChB,WAAW,EAAE;;;+CAG8B;KAC5C;IACD,IAAI,EAAE;QACJ,YAAY,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,oBAAoB,EAAE;QACnE,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,CACvB,wBAAwB,EACxB,MAAM,CACP,CAAC;YACF,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,17 @@
|
|
|
1
|
+
export declare const highDemandPeriodsCommand: import("citty").CommandDef<{
|
|
2
|
+
readonly "campaign-id": {
|
|
3
|
+
readonly type: "string";
|
|
4
|
+
readonly description: "Meta campaign ID";
|
|
5
|
+
readonly required: true;
|
|
6
|
+
};
|
|
7
|
+
readonly "skip-cache": {
|
|
8
|
+
readonly type: "boolean";
|
|
9
|
+
readonly description: "Bypass server-side cache";
|
|
10
|
+
};
|
|
11
|
+
readonly output: {
|
|
12
|
+
readonly type: "string";
|
|
13
|
+
readonly description: "Output format";
|
|
14
|
+
readonly default: "json";
|
|
15
|
+
};
|
|
16
|
+
}>;
|
|
17
|
+
//# sourceMappingURL=high-demand-periods.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"high-demand-periods.d.ts","sourceRoot":"","sources":["../../../../src/commands/ads/meta/high-demand-periods.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;EAyBnC,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { defineCommand } from "citty";
|
|
2
|
+
import { apiGet } from "../../../client.js";
|
|
3
|
+
import { writeAdsJson, writeAdsOutput } from "../output.js";
|
|
4
|
+
import { csvOrJson, handleMetaError } from "./shared.js";
|
|
5
|
+
export const highDemandPeriodsCommand = defineCommand({
|
|
6
|
+
meta: {
|
|
7
|
+
name: "high-demand-periods",
|
|
8
|
+
description: `List scheduled budget bumps (e.g. Black Friday windows) on a campaign.`,
|
|
9
|
+
},
|
|
10
|
+
args: {
|
|
11
|
+
"campaign-id": { type: "string", description: "Meta campaign ID", required: true },
|
|
12
|
+
"skip-cache": { type: "boolean", description: "Bypass server-side cache" },
|
|
13
|
+
output: { type: "string", description: "Output format", default: "json" },
|
|
14
|
+
},
|
|
15
|
+
run: async ({ args }) => {
|
|
16
|
+
try {
|
|
17
|
+
const params = { "campaign-id": args["campaign-id"] };
|
|
18
|
+
if (args["skip-cache"])
|
|
19
|
+
params["skip-cache"] = "true";
|
|
20
|
+
const data = await apiGet("/api/ads/meta/high-demand-periods", params);
|
|
21
|
+
const fmt = csvOrJson(args);
|
|
22
|
+
if (fmt !== "json") {
|
|
23
|
+
writeAdsOutput(data, fmt);
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
writeAdsJson({ ok: true, data });
|
|
27
|
+
}
|
|
28
|
+
catch (err) {
|
|
29
|
+
handleMetaError(err);
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
});
|
|
33
|
+
//# sourceMappingURL=high-demand-periods.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"high-demand-periods.js","sourceRoot":"","sources":["../../../../src/commands/ads/meta/high-demand-periods.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,MAAM,aAAa,CAAC;AAEzD,MAAM,CAAC,MAAM,wBAAwB,GAAG,aAAa,CAAC;IACpD,IAAI,EAAE;QACJ,IAAI,EAAE,qBAAqB;QAC3B,WAAW,EAAE,wEAAwE;KACtF;IACD,IAAI,EAAE;QACJ,aAAa,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,kBAAkB,EAAE,QAAQ,EAAE,IAAI,EAAE;QAClF,YAAY,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,WAAW,EAAE,0BAA0B,EAAE;QAC1E,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,EAAE;KAC1E;IACD,GAAG,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE;QACtB,IAAI,CAAC;YACH,MAAM,MAAM,GAA2B,EAAE,aAAa,EAAE,IAAI,CAAC,aAAa,CAAW,EAAE,CAAC;YACxF,IAAI,IAAI,CAAC,YAAY,CAAC;gBAAE,MAAM,CAAC,YAAY,CAAC,GAAG,MAAM,CAAC;YACtD,MAAM,IAAI,GAAG,MAAM,MAAM,CAAiC,mCAAmC,EAAE,MAAM,CAAC,CAAC;YACvG,MAAM,GAAG,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC;YAC5B,IAAI,GAAG,KAAK,MAAM,EAAE,CAAC;gBACnB,cAAc,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;gBAC1B,OAAO;YACT,CAAC;YACD,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,24 @@
|
|
|
1
|
+
export declare const imagesCommand: import("citty").CommandDef<{
|
|
2
|
+
readonly "account-id": {
|
|
3
|
+
readonly type: "string";
|
|
4
|
+
readonly description: "Meta ad account ID";
|
|
5
|
+
};
|
|
6
|
+
readonly hash: {
|
|
7
|
+
readonly type: "string";
|
|
8
|
+
readonly description: "Filter to one image hash";
|
|
9
|
+
};
|
|
10
|
+
readonly limit: {
|
|
11
|
+
readonly type: "string";
|
|
12
|
+
readonly description: "Max rows (default 500)";
|
|
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=images.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"images.d.ts","sourceRoot":"","sources":["../../../../src/commands/ads/meta/images.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;EAmCxB,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
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 imagesCommand = defineCommand({
|
|
6
|
+
meta: {
|
|
7
|
+
name: "images",
|
|
8
|
+
description: `List ad images in a Meta ad account. AdImages are keyed by per-account hash — references in
|
|
9
|
+
creatives use image_hash, not URL.
|
|
10
|
+
|
|
11
|
+
Examples:
|
|
12
|
+
baker ads meta images --account-id act_123
|
|
13
|
+
baker ads meta images --account-id act_123 --hash a1b2c3...`,
|
|
14
|
+
},
|
|
15
|
+
args: {
|
|
16
|
+
"account-id": { type: "string", description: "Meta ad account ID" },
|
|
17
|
+
hash: { type: "string", description: "Filter to one image hash" },
|
|
18
|
+
limit: { type: "string", description: "Max rows (default 500)" },
|
|
19
|
+
"skip-cache": { type: "boolean", description: "Bypass server-side cache" },
|
|
20
|
+
output: { type: "string", description: "Output format", default: "json" },
|
|
21
|
+
},
|
|
22
|
+
run: async ({ args }) => {
|
|
23
|
+
const accountId = resolveAccountIdArg(args);
|
|
24
|
+
try {
|
|
25
|
+
const params = { "account-id": accountId };
|
|
26
|
+
if (args.hash)
|
|
27
|
+
params.hash = args.hash;
|
|
28
|
+
if (args.limit)
|
|
29
|
+
params.limit = args.limit;
|
|
30
|
+
if (args["skip-cache"])
|
|
31
|
+
params["skip-cache"] = "true";
|
|
32
|
+
const data = await apiGet("/api/ads/meta/images", params);
|
|
33
|
+
const fmt = csvOrJson(args);
|
|
34
|
+
if (fmt !== "json") {
|
|
35
|
+
writeAdsOutput(data, fmt);
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
writeAdsJson({ ok: true, data });
|
|
39
|
+
}
|
|
40
|
+
catch (err) {
|
|
41
|
+
handleMetaError(err);
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
});
|
|
45
|
+
//# sourceMappingURL=images.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"images.js","sourceRoot":"","sources":["../../../../src/commands/ads/meta/images.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,aAAa,GAAG,aAAa,CAAC;IACzC,IAAI,EAAE;QACJ,IAAI,EAAE,QAAQ;QACd,WAAW,EAAE;;;;;8DAK6C;KAC3D;IACD,IAAI,EAAE;QACJ,YAAY,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,oBAAoB,EAAE;QACnE,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,0BAA0B,EAAE;QACjE,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,wBAAwB,EAAE;QAChE,YAAY,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,WAAW,EAAE,0BAA0B,EAAE;QAC1E,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,EAAE;KAC1E;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,IAAI;gBAAE,MAAM,CAAC,IAAI,GAAG,IAAI,CAAC,IAAc,CAAC;YACjD,IAAI,IAAI,CAAC,KAAK;gBAAE,MAAM,CAAC,KAAK,GAAG,IAAI,CAAC,KAAe,CAAC;YACpD,IAAI,IAAI,CAAC,YAAY,CAAC;gBAAE,MAAM,CAAC,YAAY,CAAC,GAAG,MAAM,CAAC;YACtD,MAAM,IAAI,GAAG,MAAM,MAAM,CAAiC,sBAAsB,EAAE,MAAM,CAAC,CAAC;YAC1F,MAAM,GAAG,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC;YAC5B,IAAI,GAAG,KAAK,MAAM,EAAE,CAAC;gBACnB,cAAc,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;gBAC1B,OAAO;YACT,CAAC;YACD,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 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/commands/ads/meta/index.ts"],"names":[],"mappings":"AAoBA,eAAO,MAAM,WAAW,qDAuDtB,CAAC"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { defineCommand } from "citty";
|
|
2
|
+
import { accountCommand } from "./account.js";
|
|
3
|
+
import { accountsCommand } from "./accounts.js";
|
|
4
|
+
import { activitiesCommand } from "./activities.js";
|
|
5
|
+
import { adsListCommand } from "./ads.js";
|
|
6
|
+
import { adsetsCommand } from "./adsets.js";
|
|
7
|
+
import { audiencesCommand } from "./audiences.js";
|
|
8
|
+
import { businessesCommand } from "./businesses.js";
|
|
9
|
+
import { campaignsCommand } from "./campaigns.js";
|
|
10
|
+
import { catalogsCommand } from "./catalogs.js";
|
|
11
|
+
import { creativesCommand } from "./creatives.js";
|
|
12
|
+
import { currencyCommand } from "./currency.js";
|
|
13
|
+
import { highDemandPeriodsCommand } from "./high-demand-periods.js";
|
|
14
|
+
import { imagesCommand } from "./images.js";
|
|
15
|
+
import { insightsCommand } from "./insights.js";
|
|
16
|
+
import { labelsCommand } from "./labels.js";
|
|
17
|
+
import { pixelsCommand } from "./pixels.js";
|
|
18
|
+
import { previewCommand } from "./preview.js";
|
|
19
|
+
import { studiesCommand } from "./studies.js";
|
|
20
|
+
export const metaCommand = defineCommand({
|
|
21
|
+
meta: {
|
|
22
|
+
name: "meta",
|
|
23
|
+
description: `Meta Marketing API (Facebook + Instagram ads).
|
|
24
|
+
|
|
25
|
+
Discovery:
|
|
26
|
+
baker ads meta accounts — accounts in this company's connected scope
|
|
27
|
+
baker ads meta accounts --include-all — every account the token can see
|
|
28
|
+
baker ads meta businesses — Business Manager IDs
|
|
29
|
+
|
|
30
|
+
Account-scoped:
|
|
31
|
+
baker ads meta account --account-id act_123
|
|
32
|
+
baker ads meta currency --account-id act_123
|
|
33
|
+
baker ads meta campaigns --account-id act_123 --effective-status ACTIVE
|
|
34
|
+
baker ads meta adsets --campaign-id 6123
|
|
35
|
+
baker ads meta ads --account-id act_123 --effective-status ACTIVE
|
|
36
|
+
baker ads meta creatives --account-id act_123
|
|
37
|
+
baker ads meta images --account-id act_123
|
|
38
|
+
baker ads meta labels --account-id act_123
|
|
39
|
+
baker ads meta audiences --account-id act_123
|
|
40
|
+
baker ads meta pixels --account-id act_123
|
|
41
|
+
baker ads meta activities --account-id act_123 --days 14
|
|
42
|
+
|
|
43
|
+
Insights + previews:
|
|
44
|
+
baker ads meta insights --object act_123 --preset campaign-performance
|
|
45
|
+
baker ads meta insights --object act_123 --preset placement-breakdown --async
|
|
46
|
+
baker ads meta preview --creative-id 6123 --ad-format MOBILE_FEED_STANDARD --out-file /tmp/p.html
|
|
47
|
+
|
|
48
|
+
Business-scoped:
|
|
49
|
+
baker ads meta studies --business-id 12345
|
|
50
|
+
baker ads meta catalogs --business-id 12345
|
|
51
|
+
|
|
52
|
+
Other:
|
|
53
|
+
baker ads meta high-demand-periods --campaign-id 6123`,
|
|
54
|
+
},
|
|
55
|
+
subCommands: {
|
|
56
|
+
accounts: accountsCommand,
|
|
57
|
+
account: accountCommand,
|
|
58
|
+
currency: currencyCommand,
|
|
59
|
+
businesses: businessesCommand,
|
|
60
|
+
campaigns: campaignsCommand,
|
|
61
|
+
adsets: adsetsCommand,
|
|
62
|
+
ads: adsListCommand,
|
|
63
|
+
creatives: creativesCommand,
|
|
64
|
+
images: imagesCommand,
|
|
65
|
+
labels: labelsCommand,
|
|
66
|
+
audiences: audiencesCommand,
|
|
67
|
+
pixels: pixelsCommand,
|
|
68
|
+
studies: studiesCommand,
|
|
69
|
+
catalogs: catalogsCommand,
|
|
70
|
+
"high-demand-periods": highDemandPeriodsCommand,
|
|
71
|
+
activities: activitiesCommand,
|
|
72
|
+
insights: insightsCommand,
|
|
73
|
+
preview: previewCommand,
|
|
74
|
+
},
|
|
75
|
+
});
|
|
76
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/commands/ads/meta/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAE,wBAAwB,EAAE,MAAM,0BAA0B,CAAC;AACpE,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAE9C,MAAM,CAAC,MAAM,WAAW,GAAG,aAAa,CAAC;IACvC,IAAI,EAAE;QACJ,IAAI,EAAE,MAAM;QACZ,WAAW,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wDA8BuC;KACrD;IACD,WAAW,EAAE;QACX,QAAQ,EAAE,eAAe;QACzB,OAAO,EAAE,cAAc;QACvB,QAAQ,EAAE,eAAe;QACzB,UAAU,EAAE,iBAAiB;QAC7B,SAAS,EAAE,gBAAgB;QAC3B,MAAM,EAAE,aAAa;QACrB,GAAG,EAAE,cAAc;QACnB,SAAS,EAAE,gBAAgB;QAC3B,MAAM,EAAE,aAAa;QACrB,MAAM,EAAE,aAAa;QACrB,SAAS,EAAE,gBAAgB;QAC3B,MAAM,EAAE,aAAa;QACrB,OAAO,EAAE,cAAc;QACvB,QAAQ,EAAE,eAAe;QACzB,qBAAqB,EAAE,wBAAwB;QAC/C,UAAU,EAAE,iBAAiB;QAC7B,QAAQ,EAAE,eAAe;QACzB,OAAO,EAAE,cAAc;KACxB;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
export declare const insightsCommand: import("citty").CommandDef<{
|
|
2
|
+
readonly object: {
|
|
3
|
+
readonly type: "string";
|
|
4
|
+
readonly description: "Object ID — act_<id> for account, or campaign/adset/ad ID";
|
|
5
|
+
readonly required: true;
|
|
6
|
+
};
|
|
7
|
+
readonly level: {
|
|
8
|
+
readonly type: "string";
|
|
9
|
+
readonly description: "account|campaign|adset|ad";
|
|
10
|
+
};
|
|
11
|
+
readonly fields: {
|
|
12
|
+
readonly type: "string";
|
|
13
|
+
readonly description: "Comma-separated fields list";
|
|
14
|
+
};
|
|
15
|
+
readonly preset: {
|
|
16
|
+
readonly type: "string";
|
|
17
|
+
readonly description: "Insights preset name";
|
|
18
|
+
};
|
|
19
|
+
readonly "list-presets": {
|
|
20
|
+
readonly type: "boolean";
|
|
21
|
+
readonly description: "List available presets and exit";
|
|
22
|
+
};
|
|
23
|
+
readonly "date-preset": {
|
|
24
|
+
readonly type: "string";
|
|
25
|
+
readonly description: "Meta date preset (last_7d, last_28d, today, ...)";
|
|
26
|
+
};
|
|
27
|
+
readonly since: {
|
|
28
|
+
readonly type: "string";
|
|
29
|
+
readonly description: "Custom start date YYYY-MM-DD";
|
|
30
|
+
};
|
|
31
|
+
readonly until: {
|
|
32
|
+
readonly type: "string";
|
|
33
|
+
readonly description: "Custom end date YYYY-MM-DD";
|
|
34
|
+
};
|
|
35
|
+
readonly "time-increment": {
|
|
36
|
+
readonly type: "string";
|
|
37
|
+
readonly description: "1 (day) | monthly | all_days";
|
|
38
|
+
};
|
|
39
|
+
readonly breakdowns: {
|
|
40
|
+
readonly type: "string";
|
|
41
|
+
readonly description: "Comma-separated breakdowns";
|
|
42
|
+
};
|
|
43
|
+
readonly "action-breakdowns": {
|
|
44
|
+
readonly type: "string";
|
|
45
|
+
readonly description: "Comma-separated action_breakdowns";
|
|
46
|
+
};
|
|
47
|
+
readonly filtering: {
|
|
48
|
+
readonly type: "string";
|
|
49
|
+
readonly description: "JSON array of {field,operator,value}";
|
|
50
|
+
};
|
|
51
|
+
readonly "attribution-windows": {
|
|
52
|
+
readonly type: "string";
|
|
53
|
+
readonly description: "Comma-separated. Only 1d_view, 1d_click, 7d_click, 28d_click work as of Jan 2026";
|
|
54
|
+
};
|
|
55
|
+
readonly "use-account-attribution": {
|
|
56
|
+
readonly type: "boolean";
|
|
57
|
+
readonly description: "Use account-saved attribution setting";
|
|
58
|
+
};
|
|
59
|
+
readonly "use-unified-attribution": {
|
|
60
|
+
readonly type: "boolean";
|
|
61
|
+
readonly description: "Use ad-set unified attribution setting";
|
|
62
|
+
};
|
|
63
|
+
readonly limit: {
|
|
64
|
+
readonly type: "string";
|
|
65
|
+
readonly description: "Max rows (default per preset)";
|
|
66
|
+
};
|
|
67
|
+
readonly async: {
|
|
68
|
+
readonly type: "boolean";
|
|
69
|
+
readonly description: "Submit as async job, poll, then dump results";
|
|
70
|
+
};
|
|
71
|
+
readonly "skip-cache": {
|
|
72
|
+
readonly type: "boolean";
|
|
73
|
+
readonly description: "Bypass server-side cache";
|
|
74
|
+
};
|
|
75
|
+
readonly output: {
|
|
76
|
+
readonly type: "string";
|
|
77
|
+
readonly description: "Output format";
|
|
78
|
+
readonly default: "json";
|
|
79
|
+
};
|
|
80
|
+
}>;
|
|
81
|
+
//# sourceMappingURL=insights.d.ts.map
|