@koda-sl/baker-cli 0.25.0-dev.f89d9a60 → 0.25.1
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 +78 -55
- package/dist/cli.js +1 -1
- package/dist/commands/ads/index.d.ts.map +1 -1
- package/dist/commands/ads/index.js +8 -7
- 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 +36 -0
- package/dist/commands/ads/meta/ads.d.ts.map +1 -0
- package/dist/commands/ads/meta/ads.js +57 -0
- package/dist/commands/ads/meta/ads.js.map +1 -0
- package/dist/commands/ads/meta/adsets.d.ts +32 -0
- package/dist/commands/ads/meta/adsets.d.ts.map +1 -0
- package/dist/commands/ads/meta/adsets.js +50 -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 +28 -0
- package/dist/commands/ads/meta/campaigns.d.ts.map +1 -0
- package/dist/commands/ads/meta/campaigns.js +51 -0
- package/dist/commands/ads/meta/campaigns.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/index.d.ts +17 -0
- package/dist/commands/ads/meta/index.d.ts.map +1 -0
- package/dist/commands/ads/meta/index.js +79 -0
- package/dist/commands/ads/meta/index.js.map +1 -0
- package/dist/commands/ads/meta/insights.d.ts +92 -0
- package/dist/commands/ads/meta/insights.d.ts.map +1 -0
- package/dist/commands/ads/meta/insights.js +260 -0
- package/dist/commands/ads/meta/insights.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 +76 -0
- package/dist/commands/ads/meta/pixels.js.map +1 -0
- package/dist/commands/ads/meta/presets.d.ts +30 -0
- package/dist/commands/ads/meta/presets.d.ts.map +1 -0
- package/dist/commands/ads/meta/presets.js +86 -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 +18 -0
- package/dist/commands/ads/meta/shared.d.ts.map +1 -0
- package/dist/commands/ads/meta/shared.js +86 -0
- package/dist/commands/ads/meta/shared.js.map +1 -0
- package/dist/env.d.ts +1 -1
- package/dist/env.d.ts.map +1 -1
- package/dist/env.js +1 -4
- 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 -3
- package/dist/error-handler.js.map +1 -1
- package/package.json +1 -1
- package/dist/commands/ads/x/accounts.d.ts +0 -14
- package/dist/commands/ads/x/accounts.d.ts.map +0 -1
- package/dist/commands/ads/x/accounts.js +0 -73
- package/dist/commands/ads/x/accounts.js.map +0 -1
- package/dist/commands/ads/x/active-entities.d.ts +0 -43
- package/dist/commands/ads/x/active-entities.d.ts.map +0 -1
- package/dist/commands/ads/x/active-entities.js +0 -88
- package/dist/commands/ads/x/active-entities.js.map +0 -1
- package/dist/commands/ads/x/audiences.d.ts +0 -19
- package/dist/commands/ads/x/audiences.d.ts.map +0 -1
- package/dist/commands/ads/x/audiences.js +0 -65
- package/dist/commands/ads/x/audiences.js.map +0 -1
- package/dist/commands/ads/x/campaigns.d.ts +0 -34
- package/dist/commands/ads/x/campaigns.d.ts.map +0 -1
- package/dist/commands/ads/x/campaigns.js +0 -56
- package/dist/commands/ads/x/campaigns.js.map +0 -1
- package/dist/commands/ads/x/cards.d.ts +0 -19
- package/dist/commands/ads/x/cards.d.ts.map +0 -1
- package/dist/commands/ads/x/cards.js +0 -65
- package/dist/commands/ads/x/cards.js.map +0 -1
- package/dist/commands/ads/x/error-parser.d.ts +0 -3
- package/dist/commands/ads/x/error-parser.d.ts.map +0 -1
- package/dist/commands/ads/x/error-parser.js +0 -80
- package/dist/commands/ads/x/error-parser.js.map +0 -1
- package/dist/commands/ads/x/funding.d.ts +0 -19
- package/dist/commands/ads/x/funding.d.ts.map +0 -1
- package/dist/commands/ads/x/funding.js +0 -65
- package/dist/commands/ads/x/funding.js.map +0 -1
- package/dist/commands/ads/x/index.d.ts +0 -2
- package/dist/commands/ads/x/index.d.ts.map +0 -1
- package/dist/commands/ads/x/index.js +0 -50
- package/dist/commands/ads/x/index.js.map +0 -1
- package/dist/commands/ads/x/line-items.d.ts +0 -34
- package/dist/commands/ads/x/line-items.d.ts.map +0 -1
- package/dist/commands/ads/x/line-items.js +0 -55
- package/dist/commands/ads/x/line-items.js.map +0 -1
- package/dist/commands/ads/x/media.d.ts +0 -24
- package/dist/commands/ads/x/media.d.ts.map +0 -1
- package/dist/commands/ads/x/media.js +0 -70
- package/dist/commands/ads/x/media.js.map +0 -1
- package/dist/commands/ads/x/output.d.ts +0 -13
- package/dist/commands/ads/x/output.d.ts.map +0 -1
- package/dist/commands/ads/x/output.js +0 -75
- package/dist/commands/ads/x/output.js.map +0 -1
- package/dist/commands/ads/x/presets.d.ts +0 -15
- package/dist/commands/ads/x/presets.d.ts.map +0 -1
- package/dist/commands/ads/x/presets.js +0 -60
- package/dist/commands/ads/x/presets.js.map +0 -1
- package/dist/commands/ads/x/promoted-tweets.d.ts +0 -29
- package/dist/commands/ads/x/promoted-tweets.d.ts.map +0 -1
- package/dist/commands/ads/x/promoted-tweets.js +0 -74
- package/dist/commands/ads/x/promoted-tweets.js.map +0 -1
- package/dist/commands/ads/x/run-list.d.ts +0 -17
- package/dist/commands/ads/x/run-list.d.ts.map +0 -1
- package/dist/commands/ads/x/run-list.js +0 -60
- package/dist/commands/ads/x/run-list.js.map +0 -1
- package/dist/commands/ads/x/stats/index.d.ts +0 -2
- package/dist/commands/ads/x/stats/index.d.ts.map +0 -1
- package/dist/commands/ads/x/stats/index.js +0 -32
- package/dist/commands/ads/x/stats/index.js.map +0 -1
- package/dist/commands/ads/x/stats/job-create.d.ts +0 -58
- package/dist/commands/ads/x/stats/job-create.d.ts.map +0 -1
- package/dist/commands/ads/x/stats/job-create.js +0 -95
- package/dist/commands/ads/x/stats/job-create.js.map +0 -1
- package/dist/commands/ads/x/stats/job-status.d.ts +0 -18
- package/dist/commands/ads/x/stats/job-status.d.ts.map +0 -1
- package/dist/commands/ads/x/stats/job-status.js +0 -58
- package/dist/commands/ads/x/stats/job-status.js.map +0 -1
- package/dist/commands/ads/x/stats/job.d.ts +0 -63
- package/dist/commands/ads/x/stats/job.d.ts.map +0 -1
- package/dist/commands/ads/x/stats/job.js +0 -183
- package/dist/commands/ads/x/stats/job.js.map +0 -1
- package/dist/commands/ads/x/stats/sync.d.ts +0 -73
- package/dist/commands/ads/x/stats/sync.d.ts.map +0 -1
- package/dist/commands/ads/x/stats/sync.js +0 -151
- package/dist/commands/ads/x/stats/sync.js.map +0 -1
- package/dist/commands/ads/x/targeting-constants.d.ts +0 -34
- package/dist/commands/ads/x/targeting-constants.d.ts.map +0 -1
- package/dist/commands/ads/x/targeting-constants.js +0 -80
- package/dist/commands/ads/x/targeting-constants.js.map +0 -1
- package/dist/commands/ads/x/targeting-criteria.d.ts +0 -24
- package/dist/commands/ads/x/targeting-criteria.d.ts.map +0 -1
- package/dist/commands/ads/x/targeting-criteria.js +0 -69
- package/dist/commands/ads/x/targeting-criteria.js.map +0 -1
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export interface XAccountInfo {
|
|
2
|
-
id: string;
|
|
3
|
-
name: string;
|
|
4
|
-
approval_status?: string;
|
|
5
|
-
timezone?: string;
|
|
6
|
-
currency?: string;
|
|
7
|
-
}
|
|
8
|
-
/**
|
|
9
|
-
* Resolve an X Ads account_id from either --account-id, BAKER_X_ADS_ACCOUNT_ID, or
|
|
10
|
-
* (if exactly one account is connected) auto-detect.
|
|
11
|
-
*/
|
|
12
|
-
export declare function resolveXAccountId(args: Record<string, unknown>): Promise<string>;
|
|
13
|
-
//# sourceMappingURL=output.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"output.d.ts","sourceRoot":"","sources":["../../../../src/commands/ads/x/output.ts"],"names":[],"mappings":"AAMA,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAiBD;;;GAGG;AACH,wBAAsB,iBAAiB,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,CAmDtF"}
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import { ApiError, apiGet } from "../../../client.js";
|
|
2
|
-
import { getEnv } from "../../../env.js";
|
|
3
|
-
import { handleConnectionError } from "../../../error-handler.js";
|
|
4
|
-
import { cacheGet, cacheSet } from "../cache.js";
|
|
5
|
-
import { writeAdsJson } from "../output.js";
|
|
6
|
-
const ACCOUNTS_CACHE_TTL_MS = 60 * 60 * 1000;
|
|
7
|
-
async function fetchXAccounts(useCache) {
|
|
8
|
-
if (useCache) {
|
|
9
|
-
const cached = cacheGet("x-accounts", "list");
|
|
10
|
-
if (cached)
|
|
11
|
-
return cached.data;
|
|
12
|
-
}
|
|
13
|
-
const params = !useCache ? { "skip-cache": "true" } : undefined;
|
|
14
|
-
const data = await apiGet("/api/ads/x/accounts", params);
|
|
15
|
-
if (useCache) {
|
|
16
|
-
cacheSet("x-accounts", "list", data, ACCOUNTS_CACHE_TTL_MS);
|
|
17
|
-
}
|
|
18
|
-
return data;
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Resolve an X Ads account_id from either --account-id, BAKER_X_ADS_ACCOUNT_ID, or
|
|
22
|
-
* (if exactly one account is connected) auto-detect.
|
|
23
|
-
*/
|
|
24
|
-
export async function resolveXAccountId(args) {
|
|
25
|
-
const fromArgs = args["account-id"];
|
|
26
|
-
const accountId = fromArgs || getEnv().BAKER_X_ADS_ACCOUNT_ID;
|
|
27
|
-
if (accountId) {
|
|
28
|
-
if (!/^[a-z0-9]+$/.test(accountId)) {
|
|
29
|
-
writeAdsJson({
|
|
30
|
-
ok: false,
|
|
31
|
-
error: {
|
|
32
|
-
code: "INVALID_ACCOUNT_ID",
|
|
33
|
-
message: "X Ads account ID must be a base36 string (lowercase letters and digits). Pass --account-id or set BAKER_X_ADS_ACCOUNT_ID.",
|
|
34
|
-
},
|
|
35
|
-
});
|
|
36
|
-
process.exit(1);
|
|
37
|
-
}
|
|
38
|
-
return accountId;
|
|
39
|
-
}
|
|
40
|
-
const useCache = !args["no-cache"];
|
|
41
|
-
try {
|
|
42
|
-
const accounts = await fetchXAccounts(useCache);
|
|
43
|
-
const [single] = accounts;
|
|
44
|
-
if (accounts.length === 1 && single) {
|
|
45
|
-
process.stderr.write(`Using account "${single.name}" (${single.id})\n`);
|
|
46
|
-
return single.id;
|
|
47
|
-
}
|
|
48
|
-
if (accounts.length === 0) {
|
|
49
|
-
handleConnectionError("x_ads");
|
|
50
|
-
}
|
|
51
|
-
const list = accounts.map((a) => ` ${a.id} ${a.name}`).join("\n");
|
|
52
|
-
writeAdsJson({
|
|
53
|
-
ok: false,
|
|
54
|
-
error: {
|
|
55
|
-
code: "MULTIPLE_ACCOUNTS",
|
|
56
|
-
message: `Multiple X Ads accounts found. Pass --account-id or set BAKER_X_ADS_ACCOUNT_ID:\n${list}`,
|
|
57
|
-
},
|
|
58
|
-
});
|
|
59
|
-
process.exit(1);
|
|
60
|
-
}
|
|
61
|
-
catch (err) {
|
|
62
|
-
if (err instanceof ApiError && (err.code === "UNAUTHORIZED" || err.code === "NOT_FOUND")) {
|
|
63
|
-
handleConnectionError("x_ads", err.message);
|
|
64
|
-
}
|
|
65
|
-
writeAdsJson({
|
|
66
|
-
ok: false,
|
|
67
|
-
error: {
|
|
68
|
-
code: "INVALID_ACCOUNT_ID",
|
|
69
|
-
message: "Could not auto-detect account. Pass --account-id or set BAKER_X_ADS_ACCOUNT_ID.",
|
|
70
|
-
},
|
|
71
|
-
});
|
|
72
|
-
process.exit(1);
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
//# sourceMappingURL=output.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"output.js","sourceRoot":"","sources":["../../../../src/commands/ads/x/output.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAClE,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OAAO,EAAE,iFAAiF;aAC3F;SACF,CAAC,CAAC;QACH,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
interface XStatsPreset {
|
|
2
|
-
name: string;
|
|
3
|
-
description: string;
|
|
4
|
-
entity: string;
|
|
5
|
-
metricGroups: string[];
|
|
6
|
-
granularity: "TOTAL" | "DAY" | "HOUR";
|
|
7
|
-
defaultDays: number;
|
|
8
|
-
placement: "ALL_ON_TWITTER" | "PUBLISHER_NETWORK";
|
|
9
|
-
}
|
|
10
|
-
export declare const X_STATS_PRESETS: XStatsPreset[];
|
|
11
|
-
export declare function getPreset(name: string): XStatsPreset | undefined;
|
|
12
|
-
/** Hour-aligned ISO 8601 string `daysAgo` days before now (UTC). */
|
|
13
|
-
export declare function isoHourFloor(daysAgo: number): string;
|
|
14
|
-
export {};
|
|
15
|
-
//# sourceMappingURL=presets.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"presets.d.ts","sourceRoot":"","sources":["../../../../src/commands/ads/x/presets.ts"],"names":[],"mappings":"AAAA,UAAU,YAAY;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,WAAW,EAAE,OAAO,GAAG,KAAK,GAAG,MAAM,CAAC;IACtC,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,gBAAgB,GAAG,mBAAmB,CAAC;CACnD;AAED,eAAO,MAAM,eAAe,EAAE,YAAY,EA8CzC,CAAC;AAEF,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,YAAY,GAAG,SAAS,CAEhE;AAED,oEAAoE;AACpE,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAOpD"}
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
export const X_STATS_PRESETS = [
|
|
2
|
-
{
|
|
3
|
-
name: "campaign-engagement-7d",
|
|
4
|
-
description: "Campaign-level engagements + impressions over the last 7 days, daily granularity",
|
|
5
|
-
entity: "CAMPAIGN",
|
|
6
|
-
metricGroups: ["ENGAGEMENT"],
|
|
7
|
-
granularity: "DAY",
|
|
8
|
-
defaultDays: 7,
|
|
9
|
-
placement: "ALL_ON_TWITTER",
|
|
10
|
-
},
|
|
11
|
-
{
|
|
12
|
-
name: "campaign-spend-30d",
|
|
13
|
-
description: "Campaign-level billed engagements + spend over the last 30 days, daily",
|
|
14
|
-
entity: "CAMPAIGN",
|
|
15
|
-
metricGroups: ["BILLING"],
|
|
16
|
-
granularity: "DAY",
|
|
17
|
-
defaultDays: 30,
|
|
18
|
-
placement: "ALL_ON_TWITTER",
|
|
19
|
-
},
|
|
20
|
-
{
|
|
21
|
-
name: "tweet-performance-7d",
|
|
22
|
-
description: "Promoted tweet engagement + media metrics over the last 7 days, daily",
|
|
23
|
-
entity: "PROMOTED_TWEET",
|
|
24
|
-
metricGroups: ["ENGAGEMENT", "MEDIA"],
|
|
25
|
-
granularity: "DAY",
|
|
26
|
-
defaultDays: 7,
|
|
27
|
-
placement: "ALL_ON_TWITTER",
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
name: "video-performance-30d",
|
|
31
|
-
description: "Promoted tweet video views/CTAs + engagement over the last 30 days, daily",
|
|
32
|
-
entity: "PROMOTED_TWEET",
|
|
33
|
-
metricGroups: ["VIDEO", "ENGAGEMENT"],
|
|
34
|
-
granularity: "DAY",
|
|
35
|
-
defaultDays: 30,
|
|
36
|
-
placement: "ALL_ON_TWITTER",
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
name: "line-item-conversions-30d",
|
|
40
|
-
description: "Line item web conversions + billing over the last 30 days, daily",
|
|
41
|
-
entity: "LINE_ITEM",
|
|
42
|
-
metricGroups: ["WEB_CONVERSION", "BILLING"],
|
|
43
|
-
granularity: "DAY",
|
|
44
|
-
defaultDays: 30,
|
|
45
|
-
placement: "ALL_ON_TWITTER",
|
|
46
|
-
},
|
|
47
|
-
];
|
|
48
|
-
export function getPreset(name) {
|
|
49
|
-
return X_STATS_PRESETS.find((p) => p.name === name);
|
|
50
|
-
}
|
|
51
|
-
/** Hour-aligned ISO 8601 string `daysAgo` days before now (UTC). */
|
|
52
|
-
export function isoHourFloor(daysAgo) {
|
|
53
|
-
const d = new Date();
|
|
54
|
-
d.setUTCMilliseconds(0);
|
|
55
|
-
d.setUTCSeconds(0);
|
|
56
|
-
d.setUTCMinutes(0);
|
|
57
|
-
d.setUTCDate(d.getUTCDate() - daysAgo);
|
|
58
|
-
return d.toISOString();
|
|
59
|
-
}
|
|
60
|
-
//# sourceMappingURL=presets.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"presets.js","sourceRoot":"","sources":["../../../../src/commands/ads/x/presets.ts"],"names":[],"mappings":"AAUA,MAAM,CAAC,MAAM,eAAe,GAAmB;IAC7C;QACE,IAAI,EAAE,wBAAwB;QAC9B,WAAW,EAAE,kFAAkF;QAC/F,MAAM,EAAE,UAAU;QAClB,YAAY,EAAE,CAAC,YAAY,CAAC;QAC5B,WAAW,EAAE,KAAK;QAClB,WAAW,EAAE,CAAC;QACd,SAAS,EAAE,gBAAgB;KAC5B;IACD;QACE,IAAI,EAAE,oBAAoB;QAC1B,WAAW,EAAE,wEAAwE;QACrF,MAAM,EAAE,UAAU;QAClB,YAAY,EAAE,CAAC,SAAS,CAAC;QACzB,WAAW,EAAE,KAAK;QAClB,WAAW,EAAE,EAAE;QACf,SAAS,EAAE,gBAAgB;KAC5B;IACD;QACE,IAAI,EAAE,sBAAsB;QAC5B,WAAW,EAAE,uEAAuE;QACpF,MAAM,EAAE,gBAAgB;QACxB,YAAY,EAAE,CAAC,YAAY,EAAE,OAAO,CAAC;QACrC,WAAW,EAAE,KAAK;QAClB,WAAW,EAAE,CAAC;QACd,SAAS,EAAE,gBAAgB;KAC5B;IACD;QACE,IAAI,EAAE,uBAAuB;QAC7B,WAAW,EAAE,2EAA2E;QACxF,MAAM,EAAE,gBAAgB;QACxB,YAAY,EAAE,CAAC,OAAO,EAAE,YAAY,CAAC;QACrC,WAAW,EAAE,KAAK;QAClB,WAAW,EAAE,EAAE;QACf,SAAS,EAAE,gBAAgB;KAC5B;IACD;QACE,IAAI,EAAE,2BAA2B;QACjC,WAAW,EAAE,kEAAkE;QAC/E,MAAM,EAAE,WAAW;QACnB,YAAY,EAAE,CAAC,gBAAgB,EAAE,SAAS,CAAC;QAC3C,WAAW,EAAE,KAAK;QAClB,WAAW,EAAE,EAAE;QACf,SAAS,EAAE,gBAAgB;KAC5B;CACF,CAAC;AAEF,MAAM,UAAU,SAAS,CAAC,IAAY;IACpC,OAAO,eAAe,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC;AACtD,CAAC;AAED,oEAAoE;AACpE,MAAM,UAAU,YAAY,CAAC,OAAe;IAC1C,MAAM,CAAC,GAAG,IAAI,IAAI,EAAE,CAAC;IACrB,CAAC,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC;IACxB,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;IACnB,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;IACnB,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,UAAU,EAAE,GAAG,OAAO,CAAC,CAAC;IACvC,OAAO,CAAC,CAAC,WAAW,EAAE,CAAC;AACzB,CAAC"}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
export declare const promotedTweetsCommand: 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 "line-item-ids": {
|
|
8
|
-
readonly type: "string";
|
|
9
|
-
readonly description: "CSV of line item IDs";
|
|
10
|
-
readonly required: false;
|
|
11
|
-
};
|
|
12
|
-
readonly "with-deleted": {
|
|
13
|
-
readonly type: "boolean";
|
|
14
|
-
readonly description: "Include deleted";
|
|
15
|
-
readonly required: false;
|
|
16
|
-
};
|
|
17
|
-
readonly "no-cache": {
|
|
18
|
-
readonly type: "boolean";
|
|
19
|
-
readonly description: "Skip cache";
|
|
20
|
-
readonly required: false;
|
|
21
|
-
};
|
|
22
|
-
readonly output: {
|
|
23
|
-
readonly type: "string";
|
|
24
|
-
readonly description: "Format: json|csv|md";
|
|
25
|
-
readonly required: false;
|
|
26
|
-
readonly default: "json";
|
|
27
|
-
};
|
|
28
|
-
}>;
|
|
29
|
-
//# sourceMappingURL=promoted-tweets.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"promoted-tweets.d.ts","sourceRoot":"","sources":["../../../../src/commands/ads/x/promoted-tweets.ts"],"names":[],"mappings":"AAoBA,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;EAoDhC,CAAC"}
|
|
@@ -1,74 +0,0 @@
|
|
|
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.promotedTweets",
|
|
10
|
-
description: "List promoted tweets for an X Ads account. Returns id, line_item_id, tweet_id, approval_status. Filter by line-item-ids (CSV).",
|
|
11
|
-
args: {
|
|
12
|
-
"account-id": { type: "string", description: "X Ads account ID", required: false },
|
|
13
|
-
"line-item-ids": { type: "string", description: "CSV of line item IDs", required: false },
|
|
14
|
-
"with-deleted": { type: "boolean", description: "Include deleted", required: false },
|
|
15
|
-
"no-cache": { type: "boolean", description: "Skip cache", required: false },
|
|
16
|
-
},
|
|
17
|
-
});
|
|
18
|
-
export const promotedTweetsCommand = defineCommand({
|
|
19
|
-
meta: {
|
|
20
|
-
name: "promoted-tweets",
|
|
21
|
-
description: `List X Ads promoted tweets.
|
|
22
|
-
|
|
23
|
-
Examples:
|
|
24
|
-
baker ads x promoted-tweets --account-id 18ce53xyz --line-item-ids abc,def`,
|
|
25
|
-
},
|
|
26
|
-
args: {
|
|
27
|
-
"account-id": { type: "string", description: "X Ads account ID", 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 = `promoted-tweets:${accountId}:${today}:${args["line-item-ids"] ?? ""}:${args["with-deleted"] ? "1" : "0"}`;
|
|
38
|
-
if (useCache) {
|
|
39
|
-
const cached = cacheGet("x-account-data", cacheKey);
|
|
40
|
-
if (cached) {
|
|
41
|
-
writeAdsJson({ ok: true, data: cached.data, cached: true });
|
|
42
|
-
return;
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
try {
|
|
46
|
-
const params = { "account-id": accountId };
|
|
47
|
-
if (args["line-item-ids"])
|
|
48
|
-
params["line-item-ids"] = args["line-item-ids"];
|
|
49
|
-
if (args["with-deleted"])
|
|
50
|
-
params["with-deleted"] = "true";
|
|
51
|
-
if (!useCache)
|
|
52
|
-
params["skip-cache"] = "true";
|
|
53
|
-
const data = await apiGet("/api/ads/x/promoted-tweets", params);
|
|
54
|
-
if (useCache) {
|
|
55
|
-
cacheSet("x-account-data", cacheKey, data, 60 * 60 * 1000);
|
|
56
|
-
}
|
|
57
|
-
const format = args.output || "json";
|
|
58
|
-
if (format !== "json") {
|
|
59
|
-
writeAdsOutput(data, format);
|
|
60
|
-
return;
|
|
61
|
-
}
|
|
62
|
-
writeAdsJson({ ok: true, data });
|
|
63
|
-
}
|
|
64
|
-
catch (err) {
|
|
65
|
-
if (err instanceof ApiError) {
|
|
66
|
-
writeAdsJson(parseXApiError(err.message, accountId));
|
|
67
|
-
process.exit(1);
|
|
68
|
-
}
|
|
69
|
-
writeAdsJson({ ok: false, error: { code: "NETWORK_ERROR", message: "Unexpected error" } });
|
|
70
|
-
process.exit(1);
|
|
71
|
-
}
|
|
72
|
-
},
|
|
73
|
-
});
|
|
74
|
-
//# sourceMappingURL=promoted-tweets.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"promoted-tweets.js","sourceRoot":"","sources":["../../../../src/commands/ads/x/promoted-tweets.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,sBAAsB;IAC/B,WAAW,EACT,gIAAgI;IAClI,IAAI,EAAE;QACJ,YAAY,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,kBAAkB,EAAE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tB,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"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
interface ListParams {
|
|
2
|
-
path: string;
|
|
3
|
-
cacheCategory: string;
|
|
4
|
-
cacheKey: string;
|
|
5
|
-
cacheTtlMs?: number;
|
|
6
|
-
params: Record<string, string | undefined>;
|
|
7
|
-
format: string;
|
|
8
|
-
accountId?: string;
|
|
9
|
-
useCache: boolean;
|
|
10
|
-
}
|
|
11
|
-
/**
|
|
12
|
-
* Shared GET-list flow: cache check → request → cache set → format-aware output.
|
|
13
|
-
* Centralizing this keeps each CLI command file under Biome's complexity budget.
|
|
14
|
-
*/
|
|
15
|
-
export declare function runListCommand(opts: ListParams): Promise<void>;
|
|
16
|
-
export {};
|
|
17
|
-
//# sourceMappingURL=run-list.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"run-list.d.ts","sourceRoot":"","sources":["../../../../src/commands/ads/x/run-list.ts"],"names":[],"mappings":"AAKA,UAAU,UAAU;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,EAAE,MAAM,CAAC;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;IAC3C,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,OAAO,CAAC;CACnB;AAwCD;;;GAGG;AACH,wBAAsB,cAAc,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CAYpE"}
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import { ApiError, apiGet } from "../../../client.js";
|
|
2
|
-
import { cacheGet, cacheSet } from "../cache.js";
|
|
3
|
-
import { writeAdsJson, writeAdsOutput } from "../output.js";
|
|
4
|
-
import { parseXApiError } from "./error-parser.js";
|
|
5
|
-
function buildCleanParams(opts) {
|
|
6
|
-
const out = {};
|
|
7
|
-
for (const [k, v] of Object.entries(opts.params)) {
|
|
8
|
-
if (v !== undefined && v !== "") {
|
|
9
|
-
out[k] = v;
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
if (!opts.useCache) {
|
|
13
|
-
out["skip-cache"] = "true";
|
|
14
|
-
}
|
|
15
|
-
return out;
|
|
16
|
-
}
|
|
17
|
-
function emitFromCache(opts) {
|
|
18
|
-
if (!opts.useCache || opts.cacheTtlMs === undefined)
|
|
19
|
-
return false;
|
|
20
|
-
const cached = cacheGet(opts.cacheCategory, opts.cacheKey);
|
|
21
|
-
if (!cached)
|
|
22
|
-
return false;
|
|
23
|
-
writeAdsJson({ ok: true, data: cached.data, cached: true });
|
|
24
|
-
return true;
|
|
25
|
-
}
|
|
26
|
-
function emitData(opts, data) {
|
|
27
|
-
if (opts.format !== "json") {
|
|
28
|
-
writeAdsOutput(data, opts.format);
|
|
29
|
-
return;
|
|
30
|
-
}
|
|
31
|
-
writeAdsJson({ ok: true, data });
|
|
32
|
-
}
|
|
33
|
-
function emitError(opts, err) {
|
|
34
|
-
if (err instanceof ApiError) {
|
|
35
|
-
writeAdsJson(parseXApiError(err.message, opts.accountId ?? "—"));
|
|
36
|
-
process.exit(1);
|
|
37
|
-
}
|
|
38
|
-
writeAdsJson({ ok: false, error: { code: "NETWORK_ERROR", message: "Unexpected error" } });
|
|
39
|
-
process.exit(1);
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* Shared GET-list flow: cache check → request → cache set → format-aware output.
|
|
43
|
-
* Centralizing this keeps each CLI command file under Biome's complexity budget.
|
|
44
|
-
*/
|
|
45
|
-
export async function runListCommand(opts) {
|
|
46
|
-
if (emitFromCache(opts))
|
|
47
|
-
return;
|
|
48
|
-
const params = buildCleanParams(opts);
|
|
49
|
-
try {
|
|
50
|
-
const data = await apiGet(opts.path, params);
|
|
51
|
-
if (opts.useCache && opts.cacheTtlMs !== undefined) {
|
|
52
|
-
cacheSet(opts.cacheCategory, opts.cacheKey, data, opts.cacheTtlMs);
|
|
53
|
-
}
|
|
54
|
-
emitData(opts, data);
|
|
55
|
-
}
|
|
56
|
-
catch (err) {
|
|
57
|
-
emitError(opts, err);
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
//# sourceMappingURL=run-list.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"run-list.js","sourceRoot":"","sources":["../../../../src/commands/ads/x/run-list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACtD,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;AAanD,SAAS,gBAAgB,CAAC,IAAgB;IACxC,MAAM,GAAG,GAA2B,EAAE,CAAC;IACvC,KAAK,MAAM,CAAC,C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CAAC,CAAC,CAAC;QACjE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IACD,YAAY,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,eAAe,EAAE,OAAO,EAAE,kBAAkB,EAAE,EAAE,CAAC,CAAC;IAC3F,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,cAAc,CAAC,IAAgB;IACnD,IAAI,aAAa,CAAC,IAAI,CAAC;QAAE,OAAO;IAChC,MAAM,MAAM,GAAG,gBAAgB,CAAC,IAAI,CAAC,CAAC;IACtC,IAAI,CAAC;QACH,MAAM,IAAI,GAAG,MAAM,MAAM,CAAY,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QACxD,IAAI,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,UAAU,KAAK,SAAS,EAAE,CAAC;YACnD,QAAQ,CAAC,IAAI,CAAC,aAAa,EAAE,IAAI,CAAC,QAAQ,EAAE,IAAI,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;QACrE,CAAC;QACD,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IACvB,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,SAAS,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;IACvB,CAAC;AACH,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/commands/ads/x/stats/index.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,YAAY,qDAyBvB,CAAC"}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { defineCommand } from "citty";
|
|
2
|
-
import { statsJobCommand } from "./job.js";
|
|
3
|
-
import { statsJobCreateCommand } from "./job-create.js";
|
|
4
|
-
import { statsJobStatusCommand } from "./job-status.js";
|
|
5
|
-
import { statsSyncCommand } from "./sync.js";
|
|
6
|
-
export const statsCommand = defineCommand({
|
|
7
|
-
meta: {
|
|
8
|
-
name: "stats",
|
|
9
|
-
description: `X Ads analytics. Sync (≤7 days, no segmentation) or async jobs (≤90 days, segmentable).
|
|
10
|
-
|
|
11
|
-
Subcommands:
|
|
12
|
-
sync — synchronous stats (max 7 days). Cheapest, fastest.
|
|
13
|
-
job — async stats job, end-to-end (creates + polls + downloads). Must run in the background.
|
|
14
|
-
Use for ranges >7 days, segmented stats, or when sync limits are hit.
|
|
15
|
-
job-create — low-level: create an async stats job and return the ID immediately
|
|
16
|
-
job-status — low-level: poll job status / get the download URL
|
|
17
|
-
|
|
18
|
-
Examples:
|
|
19
|
-
baker ads x stats sync --preset campaign-engagement-7d --entity-ids abc,def
|
|
20
|
-
baker ads x stats job --account-id 18ce53xyz --entity CAMPAIGN \\
|
|
21
|
-
--entity-ids abc,def --start-time 2026-04-01T00:00:00Z \\
|
|
22
|
-
--end-time 2026-05-01T00:00:00Z --metric-groups ENGAGEMENT,BILLING
|
|
23
|
-
baker ads x stats job-status --account-id 18ce53xyz --job-id abc`,
|
|
24
|
-
},
|
|
25
|
-
subCommands: {
|
|
26
|
-
sync: statsSyncCommand,
|
|
27
|
-
job: statsJobCommand,
|
|
28
|
-
"job-create": statsJobCreateCommand,
|
|
29
|
-
"job-status": statsJobStatusCommand,
|
|
30
|
-
},
|
|
31
|
-
});
|
|
32
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/commands/ads/x/stats/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAC3C,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAE7C,MAAM,CAAC,MAAM,YAAY,GAAG,aAAa,CAAC;IACxC,IAAI,EAAE;QACJ,IAAI,EAAE,OAAO;QACb,WAAW,EAAE;;;;;;;;;;;;;;mEAckD;KAChE;IACD,WAAW,EAAE;QACX,IAAI,EAAE,gBAAgB;QACtB,GAAG,EAAE,eAAe;QACpB,YAAY,EAAE,qBAAqB;QACnC,YAAY,EAAE,qBAAqB;KACpC;CACF,CAAC,CAAC"}
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
export declare const statsJobCreateCommand: 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 entity: {
|
|
8
|
-
readonly type: "string";
|
|
9
|
-
readonly description: "Entity type";
|
|
10
|
-
readonly required: true;
|
|
11
|
-
};
|
|
12
|
-
readonly "entity-ids": {
|
|
13
|
-
readonly type: "string";
|
|
14
|
-
readonly description: "CSV of entity IDs";
|
|
15
|
-
readonly required: true;
|
|
16
|
-
};
|
|
17
|
-
readonly "start-time": {
|
|
18
|
-
readonly type: "string";
|
|
19
|
-
readonly description: "ISO start";
|
|
20
|
-
readonly required: true;
|
|
21
|
-
};
|
|
22
|
-
readonly "end-time": {
|
|
23
|
-
readonly type: "string";
|
|
24
|
-
readonly description: "ISO end";
|
|
25
|
-
readonly required: true;
|
|
26
|
-
};
|
|
27
|
-
readonly granularity: {
|
|
28
|
-
readonly type: "string";
|
|
29
|
-
readonly description: "Granularity";
|
|
30
|
-
readonly required: false;
|
|
31
|
-
};
|
|
32
|
-
readonly "metric-groups": {
|
|
33
|
-
readonly type: "string";
|
|
34
|
-
readonly description: "Metric groups CSV";
|
|
35
|
-
readonly required: true;
|
|
36
|
-
};
|
|
37
|
-
readonly placement: {
|
|
38
|
-
readonly type: "string";
|
|
39
|
-
readonly description: "Placement";
|
|
40
|
-
readonly required: false;
|
|
41
|
-
};
|
|
42
|
-
readonly "segmentation-type": {
|
|
43
|
-
readonly type: "string";
|
|
44
|
-
readonly description: "Segmentation type";
|
|
45
|
-
readonly required: false;
|
|
46
|
-
};
|
|
47
|
-
readonly country: {
|
|
48
|
-
readonly type: "string";
|
|
49
|
-
readonly description: "Country filter";
|
|
50
|
-
readonly required: false;
|
|
51
|
-
};
|
|
52
|
-
readonly platform: {
|
|
53
|
-
readonly type: "string";
|
|
54
|
-
readonly description: "Platform filter";
|
|
55
|
-
readonly required: false;
|
|
56
|
-
};
|
|
57
|
-
}>;
|
|
58
|
-
//# sourceMappingURL=job-create.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"job-create.d.ts","sourceRoot":"","sources":["../../../../../src/commands/ads/x/stats/job-create.ts"],"names":[],"mappings":"AAmCA,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4DhC,CAAC"}
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
import { defineCommand } from "citty";
|
|
2
|
-
import { ApiError, apiPost } from "../../../../client.js";
|
|
3
|
-
import { registerSchema } from "../../../../schemas.js";
|
|
4
|
-
import { writeAdsJson } from "../../output.js";
|
|
5
|
-
import { parseXApiError } from "../error-parser.js";
|
|
6
|
-
import { resolveXAccountId } from "../output.js";
|
|
7
|
-
registerSchema({
|
|
8
|
-
command: "ads.x.statsJobCreate",
|
|
9
|
-
description: "Create an asynchronous X Ads stats job (range up to 90 days non-segmented, 45 days segmented). Returns a job id; poll with `stats job-status`. Times must be ISO 8601 hour-aligned.",
|
|
10
|
-
args: {
|
|
11
|
-
"account-id": { type: "string", description: "X Ads account ID", required: false },
|
|
12
|
-
entity: { type: "string", description: "CAMPAIGN | LINE_ITEM | PROMOTED_TWEET | ...", required: true },
|
|
13
|
-
"entity-ids": { type: "string", description: "CSV of entity IDs (max 20)", required: true },
|
|
14
|
-
"start-time": { type: "string", description: "ISO 8601 hour-aligned start", required: true },
|
|
15
|
-
"end-time": { type: "string", description: "ISO 8601 hour-aligned end", required: true },
|
|
16
|
-
granularity: { type: "string", description: "TOTAL | DAY | HOUR", required: false },
|
|
17
|
-
"metric-groups": { type: "string", description: "CSV of metric groups", required: true },
|
|
18
|
-
placement: { type: "string", description: "ALL_ON_TWITTER | PUBLISHER_NETWORK", required: false },
|
|
19
|
-
"segmentation-type": { type: "string", description: "Segmentation (e.g. AGE, GENDER, LOCATIONS)", required: false },
|
|
20
|
-
country: { type: "string", description: "Country filter", required: false },
|
|
21
|
-
platform: { type: "string", description: "Platform filter", required: false },
|
|
22
|
-
},
|
|
23
|
-
});
|
|
24
|
-
function parseCsv(v) {
|
|
25
|
-
if (typeof v !== "string" || v.length === 0)
|
|
26
|
-
return undefined;
|
|
27
|
-
const parts = v
|
|
28
|
-
.split(",")
|
|
29
|
-
.map((s) => s.trim())
|
|
30
|
-
.filter(Boolean);
|
|
31
|
-
return parts.length > 0 ? parts : undefined;
|
|
32
|
-
}
|
|
33
|
-
export const statsJobCreateCommand = defineCommand({
|
|
34
|
-
meta: {
|
|
35
|
-
name: "job-create",
|
|
36
|
-
description: `Create an async X Ads stats job (up to 90 days, supports segmentation).
|
|
37
|
-
|
|
38
|
-
Examples:
|
|
39
|
-
baker ads x stats job-create --account-id 18ce53xyz --entity CAMPAIGN \\
|
|
40
|
-
--entity-ids abc,def --start-time 2026-04-01T00:00:00Z \\
|
|
41
|
-
--end-time 2026-05-01T00:00:00Z --metric-groups ENGAGEMENT,BILLING \\
|
|
42
|
-
--segmentation-type LOCATIONS`,
|
|
43
|
-
},
|
|
44
|
-
args: {
|
|
45
|
-
"account-id": { type: "string", description: "X Ads account ID", required: false },
|
|
46
|
-
entity: { type: "string", description: "Entity type", required: true },
|
|
47
|
-
"entity-ids": { type: "string", description: "CSV of entity IDs", required: true },
|
|
48
|
-
"start-time": { type: "string", description: "ISO start", required: true },
|
|
49
|
-
"end-time": { type: "string", description: "ISO end", required: true },
|
|
50
|
-
granularity: { type: "string", description: "Granularity", required: false },
|
|
51
|
-
"metric-groups": { type: "string", description: "Metric groups CSV", required: true },
|
|
52
|
-
placement: { type: "string", description: "Placement", required: false },
|
|
53
|
-
"segmentation-type": { type: "string", description: "Segmentation type", required: false },
|
|
54
|
-
country: { type: "string", description: "Country filter", required: false },
|
|
55
|
-
platform: { type: "string", description: "Platform filter", required: false },
|
|
56
|
-
},
|
|
57
|
-
run: async ({ args }) => {
|
|
58
|
-
const accountId = await resolveXAccountId(args);
|
|
59
|
-
const entityIds = parseCsv(args["entity-ids"]);
|
|
60
|
-
const metricGroups = parseCsv(args["metric-groups"]);
|
|
61
|
-
if (!entityIds || !metricGroups) {
|
|
62
|
-
writeAdsJson({
|
|
63
|
-
ok: false,
|
|
64
|
-
error: { code: "MISSING_PARAMETER", message: "entity-ids and metric-groups are required" },
|
|
65
|
-
});
|
|
66
|
-
process.exit(1);
|
|
67
|
-
}
|
|
68
|
-
const body = {
|
|
69
|
-
accountId,
|
|
70
|
-
entity: args.entity,
|
|
71
|
-
entityIds,
|
|
72
|
-
startTime: args["start-time"],
|
|
73
|
-
endTime: args["end-time"],
|
|
74
|
-
granularity: args.granularity ?? "DAY",
|
|
75
|
-
metricGroups,
|
|
76
|
-
placement: args.placement ?? "ALL_ON_TWITTER",
|
|
77
|
-
segmentationType: args["segmentation-type"],
|
|
78
|
-
country: args.country,
|
|
79
|
-
platform: args.platform,
|
|
80
|
-
};
|
|
81
|
-
try {
|
|
82
|
-
const data = await apiPost("/api/ads/x/stats/jobs", body);
|
|
83
|
-
writeAdsJson({ ok: true, data });
|
|
84
|
-
}
|
|
85
|
-
catch (err) {
|
|
86
|
-
if (err instanceof ApiError) {
|
|
87
|
-
writeAdsJson(parseXApiError(err.message, accountId));
|
|
88
|
-
process.exit(1);
|
|
89
|
-
}
|
|
90
|
-
writeAdsJson({ ok: false, error: { code: "NETWORK_ERROR", message: "Unexpected error" } });
|
|
91
|
-
process.exit(1);
|
|
92
|
-
}
|
|
93
|
-
},
|
|
94
|
-
});
|
|
95
|
-
//# sourceMappingURL=job-create.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"job-create.js","sourceRoot":"","sources":["../../../../../src/commands/ads/x/stats/job-create.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAEjD,cAAc,CAAC;IACb,OAAO,EAAE,sBAAsB;IAC/B,WAAW,EACT,qLAAqL;IACvL,IAAI,EAAE;QACJ,YAAY,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,kBAAkB,EAAE,QAAQ,EAAE,KAAK,EAAE;QAClF,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,6CAA6C,EAAE,QAAQ,EAAE,IAAI,EAAE;QACtG,YAAY,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,4BAA4B,EAAE,QAAQ,EAAE,IAAI,EAAE;QAC3F,YAAY,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,6BAA6B,EAAE,QAAQ,EAAE,IAAI,EAAE;QAC5F,UAAU,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,2BAA2B,EAAE,QAAQ,EAAE,IAAI,EAAE;QACxF,WAAW,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,o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AE,CAAC,CAAC;YAC3F,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;IACH,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
export declare const statsJobStatusCommand: 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 "job-id": {
|
|
8
|
-
readonly type: "string";
|
|
9
|
-
readonly description: "Job ID";
|
|
10
|
-
readonly required: false;
|
|
11
|
-
};
|
|
12
|
-
readonly "job-ids": {
|
|
13
|
-
readonly type: "string";
|
|
14
|
-
readonly description: "CSV of job IDs";
|
|
15
|
-
readonly required: false;
|
|
16
|
-
};
|
|
17
|
-
}>;
|
|
18
|
-
//# sourceMappingURL=job-status.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"job-status.d.ts","sourceRoot":"","sources":["../../../../../src/commands/ads/x/stats/job-status.ts"],"names":[],"mappings":"AAkBA,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;EAsChC,CAAC"}
|