@koda-sl/baker-cli 0.22.0-dev.ecc541fb → 0.25.0-dev.f89d9a60
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 +75 -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 -3
- package/dist/commands/ads/index.js.map +1 -1
- package/dist/commands/ads/x/accounts.d.ts +14 -0
- package/dist/commands/ads/x/accounts.d.ts.map +1 -0
- package/dist/commands/ads/x/accounts.js +73 -0
- package/dist/commands/ads/x/accounts.js.map +1 -0
- package/dist/commands/ads/x/active-entities.d.ts +43 -0
- package/dist/commands/ads/x/active-entities.d.ts.map +1 -0
- package/dist/commands/ads/x/active-entities.js +88 -0
- package/dist/commands/ads/x/active-entities.js.map +1 -0
- package/dist/commands/ads/x/audiences.d.ts +19 -0
- package/dist/commands/ads/x/audiences.d.ts.map +1 -0
- package/dist/commands/ads/x/audiences.js +65 -0
- package/dist/commands/ads/x/audiences.js.map +1 -0
- package/dist/commands/ads/x/campaigns.d.ts +34 -0
- package/dist/commands/ads/x/campaigns.d.ts.map +1 -0
- package/dist/commands/ads/x/campaigns.js +56 -0
- package/dist/commands/ads/x/campaigns.js.map +1 -0
- package/dist/commands/ads/x/cards.d.ts +19 -0
- package/dist/commands/ads/x/cards.d.ts.map +1 -0
- package/dist/commands/ads/x/cards.js +65 -0
- package/dist/commands/ads/x/cards.js.map +1 -0
- package/dist/commands/ads/x/error-parser.d.ts +3 -0
- package/dist/commands/ads/x/error-parser.d.ts.map +1 -0
- package/dist/commands/ads/x/error-parser.js +80 -0
- package/dist/commands/ads/x/error-parser.js.map +1 -0
- package/dist/commands/ads/x/funding.d.ts +19 -0
- package/dist/commands/ads/x/funding.d.ts.map +1 -0
- package/dist/commands/ads/x/funding.js +65 -0
- package/dist/commands/ads/x/funding.js.map +1 -0
- package/dist/commands/ads/x/index.d.ts +2 -0
- package/dist/commands/ads/x/index.d.ts.map +1 -0
- package/dist/commands/ads/x/index.js +50 -0
- package/dist/commands/ads/x/index.js.map +1 -0
- package/dist/commands/ads/x/line-items.d.ts +34 -0
- package/dist/commands/ads/x/line-items.d.ts.map +1 -0
- package/dist/commands/ads/x/line-items.js +55 -0
- package/dist/commands/ads/x/line-items.js.map +1 -0
- package/dist/commands/ads/x/media.d.ts +24 -0
- package/dist/commands/ads/x/media.d.ts.map +1 -0
- package/dist/commands/ads/x/media.js +70 -0
- package/dist/commands/ads/x/media.js.map +1 -0
- package/dist/commands/ads/x/output.d.ts +13 -0
- package/dist/commands/ads/x/output.d.ts.map +1 -0
- package/dist/commands/ads/x/output.js +75 -0
- package/dist/commands/ads/x/output.js.map +1 -0
- package/dist/commands/ads/x/presets.d.ts +15 -0
- package/dist/commands/ads/x/presets.d.ts.map +1 -0
- package/dist/commands/ads/x/presets.js +60 -0
- package/dist/commands/ads/x/presets.js.map +1 -0
- package/dist/commands/ads/x/promoted-tweets.d.ts +29 -0
- package/dist/commands/ads/x/promoted-tweets.d.ts.map +1 -0
- package/dist/commands/ads/x/promoted-tweets.js +74 -0
- package/dist/commands/ads/x/promoted-tweets.js.map +1 -0
- package/dist/commands/ads/x/run-list.d.ts +17 -0
- package/dist/commands/ads/x/run-list.d.ts.map +1 -0
- package/dist/commands/ads/x/run-list.js +60 -0
- package/dist/commands/ads/x/run-list.js.map +1 -0
- package/dist/commands/ads/x/stats/index.d.ts +2 -0
- package/dist/commands/ads/x/stats/index.d.ts.map +1 -0
- package/dist/commands/ads/x/stats/index.js +32 -0
- package/dist/commands/ads/x/stats/index.js.map +1 -0
- package/dist/commands/ads/x/stats/job-create.d.ts +58 -0
- package/dist/commands/ads/x/stats/job-create.d.ts.map +1 -0
- package/dist/commands/ads/x/stats/job-create.js +95 -0
- package/dist/commands/ads/x/stats/job-create.js.map +1 -0
- package/dist/commands/ads/x/stats/job-status.d.ts +18 -0
- package/dist/commands/ads/x/stats/job-status.d.ts.map +1 -0
- package/dist/commands/ads/x/stats/job-status.js +58 -0
- package/dist/commands/ads/x/stats/job-status.js.map +1 -0
- package/dist/commands/ads/x/stats/job.d.ts +63 -0
- package/dist/commands/ads/x/stats/job.d.ts.map +1 -0
- package/dist/commands/ads/x/stats/job.js +183 -0
- package/dist/commands/ads/x/stats/job.js.map +1 -0
- package/dist/commands/ads/x/stats/sync.d.ts +73 -0
- package/dist/commands/ads/x/stats/sync.d.ts.map +1 -0
- package/dist/commands/ads/x/stats/sync.js +151 -0
- package/dist/commands/ads/x/stats/sync.js.map +1 -0
- package/dist/commands/ads/x/targeting-constants.d.ts +34 -0
- package/dist/commands/ads/x/targeting-constants.d.ts.map +1 -0
- package/dist/commands/ads/x/targeting-constants.js +80 -0
- package/dist/commands/ads/x/targeting-constants.js.map +1 -0
- package/dist/commands/ads/x/targeting-criteria.d.ts +24 -0
- package/dist/commands/ads/x/targeting-criteria.d.ts.map +1 -0
- package/dist/commands/ads/x/targeting-criteria.js +69 -0
- package/dist/commands/ads/x/targeting-criteria.js.map +1 -0
- package/dist/env.d.ts +1 -0
- package/dist/env.d.ts.map +1 -1
- package/dist/env.js +4 -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,65 @@
|
|
|
1
|
+
import { defineCommand } from "citty";
|
|
2
|
+
import { ApiError, apiGet } from "../../../client.js";
|
|
3
|
+
import { registerSchema } from "../../../schemas.js";
|
|
4
|
+
import { cacheGet, cacheSet } from "../cache.js";
|
|
5
|
+
import { writeAdsJson, writeAdsOutput } from "../output.js";
|
|
6
|
+
import { parseXApiError } from "./error-parser.js";
|
|
7
|
+
import { resolveXAccountId } from "./output.js";
|
|
8
|
+
registerSchema({
|
|
9
|
+
command: "ads.x.audiences",
|
|
10
|
+
description: "List custom audiences for an X Ads account. Returns id, name, audience_size, audience_type, targetable status. Audiences need 100+ active users in the past 90 days to be targetable.",
|
|
11
|
+
args: {
|
|
12
|
+
"account-id": { type: "string", description: "X Ads account ID", required: false },
|
|
13
|
+
"no-cache": { type: "boolean", description: "Skip cache", required: false },
|
|
14
|
+
},
|
|
15
|
+
});
|
|
16
|
+
export const audiencesCommand = defineCommand({
|
|
17
|
+
meta: {
|
|
18
|
+
name: "audiences",
|
|
19
|
+
description: `List X Ads custom audiences.
|
|
20
|
+
|
|
21
|
+
Examples:
|
|
22
|
+
baker ads x audiences --account-id 18ce53xyz`,
|
|
23
|
+
},
|
|
24
|
+
args: {
|
|
25
|
+
"account-id": { type: "string", description: "X Ads account ID", required: false },
|
|
26
|
+
"no-cache": { type: "boolean", description: "Skip cache", required: false },
|
|
27
|
+
output: { type: "string", description: "Format: json|csv|md", required: false, default: "json" },
|
|
28
|
+
},
|
|
29
|
+
run: async ({ args }) => {
|
|
30
|
+
const accountId = await resolveXAccountId(args);
|
|
31
|
+
const useCache = !args["no-cache"];
|
|
32
|
+
const cacheKey = `audiences:${accountId}`;
|
|
33
|
+
if (useCache) {
|
|
34
|
+
const cached = cacheGet("x-account-data", cacheKey);
|
|
35
|
+
if (cached) {
|
|
36
|
+
writeAdsJson({ ok: true, data: cached.data, cached: true });
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
try {
|
|
41
|
+
const params = { "account-id": accountId };
|
|
42
|
+
if (!useCache)
|
|
43
|
+
params["skip-cache"] = "true";
|
|
44
|
+
const data = await apiGet("/api/ads/x/custom-audiences", params);
|
|
45
|
+
if (useCache) {
|
|
46
|
+
cacheSet("x-account-data", cacheKey, data, 6 * 60 * 60 * 1000);
|
|
47
|
+
}
|
|
48
|
+
const format = args.output || "json";
|
|
49
|
+
if (format !== "json") {
|
|
50
|
+
writeAdsOutput(data, format);
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
writeAdsJson({ ok: true, data });
|
|
54
|
+
}
|
|
55
|
+
catch (err) {
|
|
56
|
+
if (err instanceof ApiError) {
|
|
57
|
+
writeAdsJson(parseXApiError(err.message, accountId));
|
|
58
|
+
process.exit(1);
|
|
59
|
+
}
|
|
60
|
+
writeAdsJson({ ok: false, error: { code: "NETWORK_ERROR", message: "Unexpected error" } });
|
|
61
|
+
process.exit(1);
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
});
|
|
65
|
+
//# sourceMappingURL=audiences.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"audiences.js","sourceRoot":"","sources":["../../../../src/commands/ads/x/audiences.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAEhD,cAAc,CAAC;IACb,OAAO,EAAE,iBAAiB;IAC1B,WAAW,EACT,uLAAuL;IACzL,IAAI,EAAE;QACJ,YAAY,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,kBAAkB,EAAE,QAAQ,EAAE,KAAK,EAAE;QAClF,UAAU,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,W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AAM,IAAI,GAAG,MAAM,MAAM,CAAY,6BAA6B,EAAE,MAAM,CAAC,CAAC;YAC5E,IAAI,QAAQ,EAAE,CAAC;gBACb,QAAQ,CAAC,gBAAgB,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC;YACjE,CAAC;YACD,MAAM,MAAM,GAAI,IAAI,CAAC,MAAiB,IAAI,MAAM,CAAC;YACjD,IAAI,MAAM,KAAK,MAAM,EAAE,CAAC;gBACtB,cAAc,CAAC,IAAsC,EAAE,MAAM,CAAC,CAAC;gBAC/D,OAAO;YACT,CAAC;YACD,YAAY,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;QACnC,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,IAAI,GAAG,YAAY,QAAQ,EAAE,CAAC;gBAC5B,YAAY,CAAC,cAAc,CAAC,GAAG,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC,CAAC;gBACrD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YAClB,CAAC;YACD,YAAY,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,eAAe,EAAE,OAAO,EAAE,kBAAkB,EAAE,EAAE,CAAC,CAAC;YAC3F,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;IACH,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export declare const campaignsCommand: import("citty").CommandDef<{
|
|
2
|
+
readonly "account-id": {
|
|
3
|
+
readonly type: "string";
|
|
4
|
+
readonly description: "X Ads account ID";
|
|
5
|
+
readonly required: false;
|
|
6
|
+
};
|
|
7
|
+
readonly "funding-instrument-ids": {
|
|
8
|
+
readonly type: "string";
|
|
9
|
+
readonly description: "CSV of funding instrument IDs";
|
|
10
|
+
readonly required: false;
|
|
11
|
+
};
|
|
12
|
+
readonly "campaign-ids": {
|
|
13
|
+
readonly type: "string";
|
|
14
|
+
readonly description: "CSV of campaign IDs";
|
|
15
|
+
readonly required: false;
|
|
16
|
+
};
|
|
17
|
+
readonly "with-deleted": {
|
|
18
|
+
readonly type: "boolean";
|
|
19
|
+
readonly description: "Include deleted";
|
|
20
|
+
readonly required: false;
|
|
21
|
+
};
|
|
22
|
+
readonly "no-cache": {
|
|
23
|
+
readonly type: "boolean";
|
|
24
|
+
readonly description: "Skip cache";
|
|
25
|
+
readonly required: false;
|
|
26
|
+
};
|
|
27
|
+
readonly output: {
|
|
28
|
+
readonly type: "string";
|
|
29
|
+
readonly description: "Format: json|csv|md";
|
|
30
|
+
readonly required: false;
|
|
31
|
+
readonly default: "json";
|
|
32
|
+
};
|
|
33
|
+
}>;
|
|
34
|
+
//# sourceMappingURL=campaigns.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"campaigns.d.ts","sourceRoot":"","sources":["../../../../src/commands/ads/x/campaigns.ts"],"names":[],"mappings":"AAkBA,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAuC3B,CAAC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { defineCommand } from "citty";
|
|
2
|
+
import { registerSchema } from "../../../schemas.js";
|
|
3
|
+
import { resolveXAccountId } from "./output.js";
|
|
4
|
+
import { runListCommand } from "./run-list.js";
|
|
5
|
+
registerSchema({
|
|
6
|
+
command: "ads.x.campaigns",
|
|
7
|
+
description: "List campaigns for an X Ads account. Optionally filter by funding-instrument-ids or campaign-ids (comma-separated). Includes deleted with --with-deleted. Falls back to BAKER_X_ADS_ACCOUNT_ID.",
|
|
8
|
+
args: {
|
|
9
|
+
"account-id": { type: "string", description: "X Ads account ID", required: false },
|
|
10
|
+
"funding-instrument-ids": { type: "string", description: "CSV of funding instrument IDs", required: false },
|
|
11
|
+
"campaign-ids": { type: "string", description: "CSV of campaign IDs", required: false },
|
|
12
|
+
"with-deleted": { type: "boolean", description: "Include deleted campaigns", required: false },
|
|
13
|
+
"no-cache": { type: "boolean", description: "Skip cache", required: false },
|
|
14
|
+
},
|
|
15
|
+
});
|
|
16
|
+
export const campaignsCommand = defineCommand({
|
|
17
|
+
meta: {
|
|
18
|
+
name: "campaigns",
|
|
19
|
+
description: `List X Ads campaigns. Returns budget, schedule, funding instrument, status.
|
|
20
|
+
|
|
21
|
+
Examples:
|
|
22
|
+
baker ads x campaigns --account-id 18ce53xyz
|
|
23
|
+
baker ads x campaigns --account-id 18ce53xyz --campaign-ids abc,def
|
|
24
|
+
baker ads x campaigns --account-id 18ce53xyz --with-deleted`,
|
|
25
|
+
},
|
|
26
|
+
args: {
|
|
27
|
+
"account-id": { type: "string", description: "X Ads account ID", required: false },
|
|
28
|
+
"funding-instrument-ids": { type: "string", description: "CSV of funding instrument IDs", required: false },
|
|
29
|
+
"campaign-ids": { type: "string", description: "CSV of campaign IDs", required: false },
|
|
30
|
+
"with-deleted": { type: "boolean", description: "Include deleted", required: false },
|
|
31
|
+
"no-cache": { type: "boolean", description: "Skip cache", required: false },
|
|
32
|
+
output: { type: "string", description: "Format: json|csv|md", required: false, default: "json" },
|
|
33
|
+
},
|
|
34
|
+
run: async ({ args }) => {
|
|
35
|
+
const accountId = await resolveXAccountId(args);
|
|
36
|
+
const useCache = !args["no-cache"];
|
|
37
|
+
const today = new Date().toISOString().slice(0, 10);
|
|
38
|
+
const cacheKey = `campaigns:${accountId}:${today}:${args["funding-instrument-ids"] ?? ""}:${args["campaign-ids"] ?? ""}:${args["with-deleted"] ? "1" : "0"}`;
|
|
39
|
+
await runListCommand({
|
|
40
|
+
path: "/api/ads/x/campaigns",
|
|
41
|
+
cacheCategory: "x-account-data",
|
|
42
|
+
cacheKey,
|
|
43
|
+
cacheTtlMs: 60 * 60 * 1000,
|
|
44
|
+
params: {
|
|
45
|
+
"account-id": accountId,
|
|
46
|
+
"funding-instrument-ids": args["funding-instrument-ids"],
|
|
47
|
+
"campaign-ids": args["campaign-ids"],
|
|
48
|
+
"with-deleted": args["with-deleted"] ? "true" : undefined,
|
|
49
|
+
},
|
|
50
|
+
format: args.output || "json",
|
|
51
|
+
accountId,
|
|
52
|
+
useCache,
|
|
53
|
+
});
|
|
54
|
+
},
|
|
55
|
+
});
|
|
56
|
+
//# sourceMappingURL=campaigns.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"campaigns.js","sourceRoot":"","sources":["../../../../src/commands/ads/x/campaigns.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAE/C,cAAc,CAAC;IACb,OAAO,EAAE,iBAAiB;IAC1B,WAAW,EACT,iMAAiM;IACnM,IAAI,EAAE;QACJ,YAAY,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,kBAAkB,EAAE,QAAQ,EAAE,KAAK,EAAE;QAClF,wBAAwB,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,+BAA+B,EAAE,QAAQ,EAAE,KAAK,EAAE;QAC3G,cAAc,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,qBAAqB,EAAE,QAAQ,EAAE,KAAK,EAAE;QACvF,cAAc,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,WAAW,EAAE,2BAA2B,EAAE,QAAQ,EAAE,KAAK,EAAE;QAC9F,UAAU,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,WAAW,EAAE,YAAY,EAAE,QAAQ,EAAE,KAAK,EAAE;KAC5E;CACF,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,gBAAgB,GAAG,aAAa,CAAC;IAC5C,IAAI,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,CAAC;QAC7J,MAAM,cAAc,CAAC;YACnB,IAAI,EAAE,sBAAsB;YAC5B,aAAa,EAAE,gBAAgB;YAC/B,QAAQ;YACR,UAAU,EAAE,EAAE,GAAG,EAAE,GAAG,IAAI;YAC1B,MAAM,EAAE;gBACN,YAAY,EAAE,SAAS;gBACvB,wBAAwB,EAAE,IAAI,CAAC,wBAAwB,CAAuB;gBAC9E,cAAc,EAAE,IAAI,CAAC,cAAc,CAAuB;gBAC1D,cAAc,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS;aAC1D;YACD,MAAM,EAAG,IAAI,CAAC,MAAiB,IAAI,MAAM;YACzC,SAAS;YACT,QAAQ;SACT,CAAC,CAAC;IACL,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export declare const cardsCommand: import("citty").CommandDef<{
|
|
2
|
+
readonly "account-id": {
|
|
3
|
+
readonly type: "string";
|
|
4
|
+
readonly description: "X Ads account ID";
|
|
5
|
+
readonly required: false;
|
|
6
|
+
};
|
|
7
|
+
readonly "no-cache": {
|
|
8
|
+
readonly type: "boolean";
|
|
9
|
+
readonly description: "Skip cache";
|
|
10
|
+
readonly required: false;
|
|
11
|
+
};
|
|
12
|
+
readonly output: {
|
|
13
|
+
readonly type: "string";
|
|
14
|
+
readonly description: "Format: json|csv|md";
|
|
15
|
+
readonly required: false;
|
|
16
|
+
readonly default: "json";
|
|
17
|
+
};
|
|
18
|
+
}>;
|
|
19
|
+
//# sourceMappingURL=cards.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cards.d.ts","sourceRoot":"","sources":["../../../../src/commands/ads/x/cards.ts"],"names":[],"mappings":"AAiBA,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;EA+CvB,CAAC"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { defineCommand } from "citty";
|
|
2
|
+
import { ApiError, apiGet } from "../../../client.js";
|
|
3
|
+
import { registerSchema } from "../../../schemas.js";
|
|
4
|
+
import { cacheGet, cacheSet } from "../cache.js";
|
|
5
|
+
import { writeAdsJson, writeAdsOutput } from "../output.js";
|
|
6
|
+
import { parseXApiError } from "./error-parser.js";
|
|
7
|
+
import { resolveXAccountId } from "./output.js";
|
|
8
|
+
registerSchema({
|
|
9
|
+
command: "ads.x.cards",
|
|
10
|
+
description: "List website cards, video cards, and carousels for an X Ads account.",
|
|
11
|
+
args: {
|
|
12
|
+
"account-id": { type: "string", description: "X Ads account ID", required: false },
|
|
13
|
+
"no-cache": { type: "boolean", description: "Skip cache", required: false },
|
|
14
|
+
},
|
|
15
|
+
});
|
|
16
|
+
export const cardsCommand = defineCommand({
|
|
17
|
+
meta: {
|
|
18
|
+
name: "cards",
|
|
19
|
+
description: `List X Ads cards (rich creatives).
|
|
20
|
+
|
|
21
|
+
Examples:
|
|
22
|
+
baker ads x cards --account-id 18ce53xyz`,
|
|
23
|
+
},
|
|
24
|
+
args: {
|
|
25
|
+
"account-id": { type: "string", description: "X Ads account ID", required: false },
|
|
26
|
+
"no-cache": { type: "boolean", description: "Skip cache", required: false },
|
|
27
|
+
output: { type: "string", description: "Format: json|csv|md", required: false, default: "json" },
|
|
28
|
+
},
|
|
29
|
+
run: async ({ args }) => {
|
|
30
|
+
const accountId = await resolveXAccountId(args);
|
|
31
|
+
const useCache = !args["no-cache"];
|
|
32
|
+
const cacheKey = `cards:${accountId}`;
|
|
33
|
+
if (useCache) {
|
|
34
|
+
const cached = cacheGet("x-account-data", cacheKey);
|
|
35
|
+
if (cached) {
|
|
36
|
+
writeAdsJson({ ok: true, data: cached.data, cached: true });
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
try {
|
|
41
|
+
const params = { "account-id": accountId };
|
|
42
|
+
if (!useCache)
|
|
43
|
+
params["skip-cache"] = "true";
|
|
44
|
+
const data = await apiGet("/api/ads/x/cards", params);
|
|
45
|
+
if (useCache) {
|
|
46
|
+
cacheSet("x-account-data", cacheKey, data, 6 * 60 * 60 * 1000);
|
|
47
|
+
}
|
|
48
|
+
const format = args.output || "json";
|
|
49
|
+
if (format !== "json") {
|
|
50
|
+
writeAdsOutput(data, format);
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
writeAdsJson({ ok: true, data });
|
|
54
|
+
}
|
|
55
|
+
catch (err) {
|
|
56
|
+
if (err instanceof ApiError) {
|
|
57
|
+
writeAdsJson(parseXApiError(err.message, accountId));
|
|
58
|
+
process.exit(1);
|
|
59
|
+
}
|
|
60
|
+
writeAdsJson({ ok: false, error: { code: "NETWORK_ERROR", message: "Unexpected error" } });
|
|
61
|
+
process.exit(1);
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
});
|
|
65
|
+
//# sourceMappingURL=cards.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cards.js","sourceRoot":"","sources":["../../../../src/commands/ads/x/cards.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAEhD,cAAc,CAAC;IACb,OAAO,EAAE,aAAa;IACtB,WAAW,EAAE,sEAAsE;IACnF,IAAI,EAAE;QACJ,YAAY,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,kBAAkB,EAAE,QAAQ,EAAE,KAAK,EAAE;QAClF,UAAU,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 -0,0 +1,80 @@
|
|
|
1
|
+
function mapXErrorCode(message) {
|
|
2
|
+
if (/UNAUTHORIZED_ACCESS|authentication/i.test(message))
|
|
3
|
+
return "AUTH_ERROR";
|
|
4
|
+
if (/UNAUTHORIZED_CLIENT_APPLICATION/i.test(message))
|
|
5
|
+
return "PERMISSION_DENIED";
|
|
6
|
+
if (/ACCOUNT_NOT_FOUND|NOT_FOUND/i.test(message))
|
|
7
|
+
return "ACCOUNT_NOT_FOUND";
|
|
8
|
+
if (/CAMPAIGN_NOT_FOUND/i.test(message))
|
|
9
|
+
return "CAMPAIGN_NOT_FOUND";
|
|
10
|
+
if (/LINE_ITEM_NOT_FOUND/i.test(message))
|
|
11
|
+
return "LINE_ITEM_NOT_FOUND";
|
|
12
|
+
if (/MEDIA_NOT_FOUND|TWEET_NOT_FOUND|TAILORED_AUDIENCE_NOT_FOUND/i.test(message))
|
|
13
|
+
return "RESOURCE_NOT_FOUND";
|
|
14
|
+
if (/TOO_MANY_REQUESTS|TWEET_RATE_LIMIT_EXCEEDED|rate.*limit/i.test(message))
|
|
15
|
+
return "QUOTA_EXCEEDED";
|
|
16
|
+
if (/SPEND_EXCEEDS_BUDGET/i.test(message))
|
|
17
|
+
return "BUDGET_EXCEEDED";
|
|
18
|
+
if (/INVALID_PARAMETER|MISSING_PARAMETER|EXCLUSIVE_PARAMETERS|INCLUSIVE_PARAMETERS/i.test(message))
|
|
19
|
+
return "INVALID_PARAMETER";
|
|
20
|
+
if (/SERVICE_UNAVAILABLE|OVER_CAPACITY|INTERNAL_ERROR/i.test(message))
|
|
21
|
+
return "SERVICE_UNAVAILABLE";
|
|
22
|
+
if (/CANCELLED_REQUEST|timeout|DEADLINE_EXCEEDED/i.test(message))
|
|
23
|
+
return "TIMEOUT";
|
|
24
|
+
return "API_ERROR";
|
|
25
|
+
}
|
|
26
|
+
function isRetryable(code) {
|
|
27
|
+
return code === "QUOTA_EXCEEDED" || code === "TIMEOUT" || code === "SERVICE_UNAVAILABLE";
|
|
28
|
+
}
|
|
29
|
+
function getRetryDelay(code) {
|
|
30
|
+
if (code === "QUOTA_EXCEEDED")
|
|
31
|
+
return 60_000;
|
|
32
|
+
if (code === "SERVICE_UNAVAILABLE")
|
|
33
|
+
return 15_000;
|
|
34
|
+
if (code === "TIMEOUT")
|
|
35
|
+
return 5_000;
|
|
36
|
+
return undefined;
|
|
37
|
+
}
|
|
38
|
+
export function parseXApiError(errorMessage, accountId) {
|
|
39
|
+
const code = mapXErrorCode(errorMessage);
|
|
40
|
+
return {
|
|
41
|
+
ok: false,
|
|
42
|
+
error: {
|
|
43
|
+
code,
|
|
44
|
+
message: errorMessage,
|
|
45
|
+
fix: {
|
|
46
|
+
action: code === "AUTH_ERROR"
|
|
47
|
+
? "authenticate"
|
|
48
|
+
: code === "PERMISSION_DENIED"
|
|
49
|
+
? "authenticate"
|
|
50
|
+
: isRetryable(code)
|
|
51
|
+
? "wait_and_retry"
|
|
52
|
+
: "reject",
|
|
53
|
+
explanation: explainFix(code, accountId, errorMessage),
|
|
54
|
+
},
|
|
55
|
+
retryable: isRetryable(code),
|
|
56
|
+
retryAfterMs: getRetryDelay(code),
|
|
57
|
+
},
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
function explainFix(code, accountId, message) {
|
|
61
|
+
switch (code) {
|
|
62
|
+
case "AUTH_ERROR":
|
|
63
|
+
return "Token rejected by X. Reconnect the X Ads provider in Baker dashboard settings.";
|
|
64
|
+
case "PERMISSION_DENIED":
|
|
65
|
+
return "App not authorized for this resource. Verify Ads API access at ads.x.com/help and reconnect the provider.";
|
|
66
|
+
case "ACCOUNT_NOT_FOUND":
|
|
67
|
+
return `Account ${accountId} not accessible. Run 'baker ads x accounts' to list visible accounts.`;
|
|
68
|
+
case "QUOTA_EXCEEDED":
|
|
69
|
+
return "X Ads rate limit exceeded. Wait until the x-rate-limit-reset window passes and retry.";
|
|
70
|
+
case "INVALID_PARAMETER":
|
|
71
|
+
return `Invalid parameter sent to X Ads API: ${message}`;
|
|
72
|
+
case "BUDGET_EXCEEDED":
|
|
73
|
+
return "Spend exceeds available budget on the funding instrument.";
|
|
74
|
+
case "SERVICE_UNAVAILABLE":
|
|
75
|
+
return "X Ads API is temporarily unavailable. Retry after a short backoff.";
|
|
76
|
+
default:
|
|
77
|
+
return `Unrecognized X Ads error — verify request shape against X Ads API docs (${code}).`;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
//# sourceMappingURL=error-parser.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error-parser.js","sourceRoot":"","sources":["../../../../src/commands/ads/x/error-parser.ts"],"names":[],"mappings":"AAEA,SAAS,aAAa,CAAC,OAAe;IACpC,IAAI,qCAAqC,CAAC,IAAI,CAAC,OAAO,CAAC;QAAE,OAAO,YAAY,CAAC;IAC7E,IAAI,kCAAkC,CAAC,IAAI,CAAC,OAAO,CAAC;QAAE,OAAO,mBAAmB,CAAC;IACjF,IAAI,8BAA8B,CAAC,IAAI,CAAC,OAAO,CAAC;QAAE,OAAO,mBAAmB,CAAC;IAC7E,IAAI,qBAAqB,CAAC,IAAI,CAAC,OAAO,CAAC;QAAE,OAAO,oBAAoB,CAAC;IACrE,IAAI,sBAAsB,CAAC,IAAI,CAAC,OAAO,CAAC;QAAE,OAAO,qBAAqB,CAAC;IACvE,IAAI,8DAA8D,CAAC,IAAI,CAAC,OAAO,CAAC;QAAE,OAAO,oBAAoB,CAAC;IAC9G,IAAI,0DAA0D,CAAC,IAAI,CAAC,OAAO,CAAC;QAAE,OAAO,gBAAgB,CAAC;IACtG,IAAI,uBAAuB,CAAC,IAAI,CAAC,OAAO,CAAC;QAAE,OAAO,iBAAiB,CAAC;IACpE,IAAI,gFAAgF,CAAC,IAAI,CAAC,OAAO,CAAC;QAChG,OAAO,mBAAmB,CAAC;IAC7B,IAAI,mDAAmD,CAAC,IAAI,CAAC,OAAO,CAAC;QAAE,OAAO,qBAAqB,CAAC;IACpG,IAAI,8CAA8C,C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AO,2GAA2G,CAAC;QACrH,KAAK,mBAAmB;YACtB,OAAO,WAAW,SAAS,uEAAuE,CAAC;QACrG,KAAK,gBAAgB;YACnB,OAAO,uFAAuF,CAAC;QACjG,KAAK,mBAAmB;YACtB,OAAO,wCAAwC,OAAO,EAAE,CAAC;QAC3D,KAAK,iBAAiB;YACpB,OAAO,2DAA2D,CAAC;QACrE,KAAK,qBAAqB;YACxB,OAAO,oEAAoE,CAAC;QAC9E;YACE,OAAO,2EAA2E,IAAI,IAAI,CAAC;IAC/F,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export declare const fundingCommand: import("citty").CommandDef<{
|
|
2
|
+
readonly "account-id": {
|
|
3
|
+
readonly type: "string";
|
|
4
|
+
readonly description: "X Ads account ID";
|
|
5
|
+
readonly required: false;
|
|
6
|
+
};
|
|
7
|
+
readonly "no-cache": {
|
|
8
|
+
readonly type: "boolean";
|
|
9
|
+
readonly description: "Skip cache";
|
|
10
|
+
readonly required: false;
|
|
11
|
+
};
|
|
12
|
+
readonly output: {
|
|
13
|
+
readonly type: "string";
|
|
14
|
+
readonly description: "Format: json|csv|md";
|
|
15
|
+
readonly required: false;
|
|
16
|
+
readonly default: "json";
|
|
17
|
+
};
|
|
18
|
+
}>;
|
|
19
|
+
//# sourceMappingURL=funding.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"funding.d.ts","sourceRoot":"","sources":["../../../../src/commands/ads/x/funding.ts"],"names":[],"mappings":"AAkBA,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;EA+CzB,CAAC"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { defineCommand } from "citty";
|
|
2
|
+
import { ApiError, apiGet } from "../../../client.js";
|
|
3
|
+
import { registerSchema } from "../../../schemas.js";
|
|
4
|
+
import { cacheGet, cacheSet } from "../cache.js";
|
|
5
|
+
import { writeAdsJson, writeAdsOutput } from "../output.js";
|
|
6
|
+
import { parseXApiError } from "./error-parser.js";
|
|
7
|
+
import { resolveXAccountId } from "./output.js";
|
|
8
|
+
registerSchema({
|
|
9
|
+
command: "ads.x.funding",
|
|
10
|
+
description: "List funding instruments for an X Ads account. Returns id, type, currency, credit_limit_local_micro, funded_amount_local_micro, status. Falls back to BAKER_X_ADS_ACCOUNT_ID env var.",
|
|
11
|
+
args: {
|
|
12
|
+
"account-id": { type: "string", description: "X Ads account ID (base36)", required: false },
|
|
13
|
+
"no-cache": { type: "boolean", description: "Skip cache", required: false },
|
|
14
|
+
},
|
|
15
|
+
});
|
|
16
|
+
export const fundingCommand = defineCommand({
|
|
17
|
+
meta: {
|
|
18
|
+
name: "funding",
|
|
19
|
+
description: `List funding instruments for an X Ads account.
|
|
20
|
+
|
|
21
|
+
Examples:
|
|
22
|
+
baker ads x funding --account-id 18ce53xyz`,
|
|
23
|
+
},
|
|
24
|
+
args: {
|
|
25
|
+
"account-id": { type: "string", description: "X Ads account ID", required: false },
|
|
26
|
+
"no-cache": { type: "boolean", description: "Skip cache", required: false },
|
|
27
|
+
output: { type: "string", description: "Format: json|csv|md", required: false, default: "json" },
|
|
28
|
+
},
|
|
29
|
+
run: async ({ args }) => {
|
|
30
|
+
const accountId = await resolveXAccountId(args);
|
|
31
|
+
const useCache = !args["no-cache"];
|
|
32
|
+
const cacheKey = `funding:${accountId}`;
|
|
33
|
+
if (useCache) {
|
|
34
|
+
const cached = cacheGet("x-account-data", cacheKey);
|
|
35
|
+
if (cached) {
|
|
36
|
+
writeAdsJson({ ok: true, data: cached.data, cached: true });
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
try {
|
|
41
|
+
const params = { "account-id": accountId };
|
|
42
|
+
if (!useCache)
|
|
43
|
+
params["skip-cache"] = "true";
|
|
44
|
+
const data = await apiGet("/api/ads/x/funding-instruments", params);
|
|
45
|
+
if (useCache) {
|
|
46
|
+
cacheSet("x-account-data", cacheKey, data, 60 * 60 * 1000);
|
|
47
|
+
}
|
|
48
|
+
const format = args.output || "json";
|
|
49
|
+
if (format !== "json") {
|
|
50
|
+
writeAdsOutput(data, format);
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
writeAdsJson({ ok: true, data });
|
|
54
|
+
}
|
|
55
|
+
catch (err) {
|
|
56
|
+
if (err instanceof ApiError) {
|
|
57
|
+
writeAdsJson(parseXApiError(err.message, accountId));
|
|
58
|
+
process.exit(1);
|
|
59
|
+
}
|
|
60
|
+
writeAdsJson({ ok: false, error: { code: "NETWORK_ERROR", message: "Unexpected error" } });
|
|
61
|
+
process.exit(1);
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
});
|
|
65
|
+
//# sourceMappingURL=funding.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"funding.js","sourceRoot":"","sources":["../../../../src/commands/ads/x/funding.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAEhD,cAAc,CAAC;IACb,OAAO,EAAE,eAAe;IACxB,WAAW,EACT,uLAAuL;IACzL,IAAI,EAAE;QACJ,YAAY,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,2BAA2B,EAAE,QAAQ,EAAE,KAAK,EAAE;QAC3F,UAAU,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,WAAW,EAAE,YAAY,EAAE,QAAQ,EAAE,KAAK,EAAE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AM,CAAC,CAAC;YAC/E,IAAI,QAAQ,EAAE,CAAC;gBACb,QAAQ,CAAC,gBAAgB,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC;YAC7D,CAAC;YACD,MAAM,MAAM,GAAI,IAAI,CAAC,MAAiB,IAAI,MAAM,CAAC;YACjD,IAAI,MAAM,KAAK,MAAM,EAAE,CAAC;gBACtB,cAAc,CAAC,IAAsC,EAAE,MAAM,CAAC,CAAC;gBAC/D,OAAO;YACT,CAAC;YACD,YAAY,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;QACnC,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,IAAI,GAAG,YAAY,QAAQ,EAAE,CAAC;gBAC5B,YAAY,CAAC,cAAc,CAAC,GAAG,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC,CAAC;gBACrD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YAClB,CAAC;YACD,YAAY,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,eAAe,EAAE,OAAO,EAAE,kBAAkB,EAAE,EAAE,CAAC,CAAC;YAC3F,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;IACH,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/commands/ads/x/index.ts"],"names":[],"mappings":"AAcA,eAAO,MAAM,QAAQ,qDAmCnB,CAAC"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { defineCommand } from "citty";
|
|
2
|
+
import { accountsCommand } from "./accounts.js";
|
|
3
|
+
import { activeEntitiesCommand } from "./active-entities.js";
|
|
4
|
+
import { audiencesCommand } from "./audiences.js";
|
|
5
|
+
import { campaignsCommand } from "./campaigns.js";
|
|
6
|
+
import { cardsCommand } from "./cards.js";
|
|
7
|
+
import { fundingCommand } from "./funding.js";
|
|
8
|
+
import { lineItemsCommand } from "./line-items.js";
|
|
9
|
+
import { mediaCommand } from "./media.js";
|
|
10
|
+
import { promotedTweetsCommand } from "./promoted-tweets.js";
|
|
11
|
+
import { statsCommand } from "./stats/index.js";
|
|
12
|
+
import { targetingConstantsCommand } from "./targeting-constants.js";
|
|
13
|
+
import { targetingCriteriaCommand } from "./targeting-criteria.js";
|
|
14
|
+
export const xCommand = defineCommand({
|
|
15
|
+
meta: {
|
|
16
|
+
name: "x",
|
|
17
|
+
description: `X (Twitter) Ads commands. Read campaigns, line items, promoted tweets, creatives, audiences, and analytics.
|
|
18
|
+
|
|
19
|
+
Start here:
|
|
20
|
+
baker ads x accounts — list accessible X Ads accounts
|
|
21
|
+
baker ads x stats sync --list-presets — see available stats presets
|
|
22
|
+
baker ads x targeting-constants --constant locations --q "Madrid"
|
|
23
|
+
|
|
24
|
+
Examples:
|
|
25
|
+
baker ads x campaigns --account-id 18ce53xyz
|
|
26
|
+
baker ads x line-items --account-id 18ce53xyz --campaign-ids abc
|
|
27
|
+
baker ads x promoted-tweets --account-id 18ce53xyz
|
|
28
|
+
baker ads x stats sync --preset campaign-engagement-7d --entity-ids abc,def
|
|
29
|
+
baker ads x stats job-create --entity CAMPAIGN --entity-ids abc \\
|
|
30
|
+
--start-time 2026-04-01T00:00:00Z --end-time 2026-05-01T00:00:00Z \\
|
|
31
|
+
--metric-groups ENGAGEMENT,BILLING --segmentation-type LOCATIONS
|
|
32
|
+
|
|
33
|
+
The CLI auto-detects --account-id when exactly one X Ads account is connected, or via BAKER_X_ADS_ACCOUNT_ID.`,
|
|
34
|
+
},
|
|
35
|
+
subCommands: {
|
|
36
|
+
accounts: accountsCommand,
|
|
37
|
+
funding: fundingCommand,
|
|
38
|
+
campaigns: campaignsCommand,
|
|
39
|
+
"line-items": lineItemsCommand,
|
|
40
|
+
"promoted-tweets": promotedTweetsCommand,
|
|
41
|
+
cards: cardsCommand,
|
|
42
|
+
media: mediaCommand,
|
|
43
|
+
audiences: audiencesCommand,
|
|
44
|
+
"targeting-criteria": targetingCriteriaCommand,
|
|
45
|
+
"targeting-constants": targetingConstantsCommand,
|
|
46
|
+
"active-entities": activeEntitiesCommand,
|
|
47
|
+
stats: statsCommand,
|
|
48
|
+
},
|
|
49
|
+
});
|
|
50
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/commands/ads/x/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAC;AACrE,OAAO,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;AAEnE,MAAM,CAAC,MAAM,QAAQ,GAAG,aAAa,CAAC;IACpC,IAAI,EAAE;QACJ,IAAI,EAAE,GAAG;QACT,WAAW,EAAE;;;;;;;;;;;;;;;;8GAgB6F;KAC3G;IACD,WAAW,EAAE;QACX,QAAQ,EAAE,eAAe;QACzB,OAAO,EAAE,cAAc;QACvB,SAAS,EAAE,gBAAgB;QAC3B,YAAY,EAAE,gBAAgB;QAC9B,iBAAiB,EAAE,qBAAqB;QACxC,KAAK,EAAE,YAAY;QACnB,KAAK,EAAE,YAAY;QACnB,SAAS,EAAE,gBAAgB;QAC3B,oBAAoB,EAAE,wBAAwB;QAC9C,qBAAqB,EAAE,yBAAyB;QAChD,iBAAiB,EAAE,qBAAqB;QACxC,KAAK,EAAE,YAAY;KACpB;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export declare const lineItemsCommand: import("citty").CommandDef<{
|
|
2
|
+
readonly "account-id": {
|
|
3
|
+
readonly type: "string";
|
|
4
|
+
readonly description: "X Ads account ID";
|
|
5
|
+
readonly required: false;
|
|
6
|
+
};
|
|
7
|
+
readonly "campaign-ids": {
|
|
8
|
+
readonly type: "string";
|
|
9
|
+
readonly description: "CSV of campaign IDs";
|
|
10
|
+
readonly required: false;
|
|
11
|
+
};
|
|
12
|
+
readonly "line-item-ids": {
|
|
13
|
+
readonly type: "string";
|
|
14
|
+
readonly description: "CSV of line item IDs";
|
|
15
|
+
readonly required: false;
|
|
16
|
+
};
|
|
17
|
+
readonly "with-deleted": {
|
|
18
|
+
readonly type: "boolean";
|
|
19
|
+
readonly description: "Include deleted";
|
|
20
|
+
readonly required: false;
|
|
21
|
+
};
|
|
22
|
+
readonly "no-cache": {
|
|
23
|
+
readonly type: "boolean";
|
|
24
|
+
readonly description: "Skip cache";
|
|
25
|
+
readonly required: false;
|
|
26
|
+
};
|
|
27
|
+
readonly output: {
|
|
28
|
+
readonly type: "string";
|
|
29
|
+
readonly description: "Format: json|csv|md";
|
|
30
|
+
readonly required: false;
|
|
31
|
+
readonly default: "json";
|
|
32
|
+
};
|
|
33
|
+
}>;
|
|
34
|
+
//# sourceMappingURL=line-items.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"line-items.d.ts","sourceRoot":"","sources":["../../../../src/commands/ads/x/line-items.ts"],"names":[],"mappings":"AAkBA,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAsC3B,CAAC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { defineCommand } from "citty";
|
|
2
|
+
import { registerSchema } from "../../../schemas.js";
|
|
3
|
+
import { resolveXAccountId } from "./output.js";
|
|
4
|
+
import { runListCommand } from "./run-list.js";
|
|
5
|
+
registerSchema({
|
|
6
|
+
command: "ads.x.lineItems",
|
|
7
|
+
description: "List line items (ad groups) for an X Ads account. Returns bid, product_type, objective, placements, schedule. Filter by campaign-ids or line-item-ids (CSV).",
|
|
8
|
+
args: {
|
|
9
|
+
"account-id": { type: "string", description: "X Ads account ID", required: false },
|
|
10
|
+
"campaign-ids": { type: "string", description: "CSV of campaign IDs", required: false },
|
|
11
|
+
"line-item-ids": { type: "string", description: "CSV of line item IDs", required: false },
|
|
12
|
+
"with-deleted": { type: "boolean", description: "Include deleted", required: false },
|
|
13
|
+
"no-cache": { type: "boolean", description: "Skip cache", required: false },
|
|
14
|
+
},
|
|
15
|
+
});
|
|
16
|
+
export const lineItemsCommand = defineCommand({
|
|
17
|
+
meta: {
|
|
18
|
+
name: "line-items",
|
|
19
|
+
description: `List X Ads line items (ad groups).
|
|
20
|
+
|
|
21
|
+
Examples:
|
|
22
|
+
baker ads x line-items --account-id 18ce53xyz --campaign-ids abc
|
|
23
|
+
baker ads x line-items --account-id 18ce53xyz --with-deleted`,
|
|
24
|
+
},
|
|
25
|
+
args: {
|
|
26
|
+
"account-id": { type: "string", description: "X Ads account ID", required: false },
|
|
27
|
+
"campaign-ids": { type: "string", description: "CSV of campaign IDs", required: false },
|
|
28
|
+
"line-item-ids": { type: "string", description: "CSV of line item IDs", required: false },
|
|
29
|
+
"with-deleted": { type: "boolean", description: "Include deleted", required: false },
|
|
30
|
+
"no-cache": { type: "boolean", description: "Skip cache", required: false },
|
|
31
|
+
output: { type: "string", description: "Format: json|csv|md", required: false, default: "json" },
|
|
32
|
+
},
|
|
33
|
+
run: async ({ args }) => {
|
|
34
|
+
const accountId = await resolveXAccountId(args);
|
|
35
|
+
const useCache = !args["no-cache"];
|
|
36
|
+
const today = new Date().toISOString().slice(0, 10);
|
|
37
|
+
const cacheKey = `line-items:${accountId}:${today}:${args["campaign-ids"] ?? ""}:${args["line-item-ids"] ?? ""}:${args["with-deleted"] ? "1" : "0"}`;
|
|
38
|
+
await runListCommand({
|
|
39
|
+
path: "/api/ads/x/line-items",
|
|
40
|
+
cacheCategory: "x-account-data",
|
|
41
|
+
cacheKey,
|
|
42
|
+
cacheTtlMs: 60 * 60 * 1000,
|
|
43
|
+
params: {
|
|
44
|
+
"account-id": accountId,
|
|
45
|
+
"campaign-ids": args["campaign-ids"],
|
|
46
|
+
"line-item-ids": args["line-item-ids"],
|
|
47
|
+
"with-deleted": args["with-deleted"] ? "true" : undefined,
|
|
48
|
+
},
|
|
49
|
+
format: args.output || "json",
|
|
50
|
+
accountId,
|
|
51
|
+
useCache,
|
|
52
|
+
});
|
|
53
|
+
},
|
|
54
|
+
});
|
|
55
|
+
//# sourceMappingURL=line-items.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"line-items.js","sourceRoot":"","sources":["../../../../src/commands/ads/x/line-items.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAE/C,cAAc,CAAC;IACb,OAAO,EAAE,iBAAiB;IAC1B,WAAW,EACT,8JAA8J;IAChK,IAAI,EAAE;QACJ,YAAY,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,kBAAkB,EAAE,QAAQ,EAAE,KAAK,EAAE;QAClF,cAAc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