@adkit/cli 1.12.22 → 1.12.23

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.
Files changed (2) hide show
  1. package/dist/cli.js +27 -15
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -4117,7 +4117,7 @@ var FLAG = {
4117
4117
  budgetDaily: " --budget-daily <n> Daily budget in account currency",
4118
4118
  cta: " --cta <type> sign_up, learn_more, shop_now, download, get_offer, contact_us, subscribe, get_quote, book_now, apply_now"
4119
4119
  };
4120
- var RAW_PLATFORM_LABELS = { google: "Google", meta: "Meta", reddit: "Reddit", tiktok: "TikTok" };
4120
+ var RAW_PLATFORM_LABELS = { google: "Google", meta: "Meta", reddit: "Reddit", tiktok: "TikTok", x: "X" };
4121
4121
  function rawPlatformCommandLine(platform2) {
4122
4122
  return `Raw ${RAW_PLATFORM_LABELS[platform2] ?? platform2} API calls use the shared command: adkit manage platform-api-requests --platform ${platform2} ...`;
4123
4123
  }
@@ -5629,20 +5629,20 @@ Examples:
5629
5629
  "platform-api-requests": `adkit manage platform-api-requests \u2014 Send raw API requests to ad platforms
5630
5630
 
5631
5631
  Bypasses normalized AdKit entity validation, but still runs account and safety checks.
5632
- GET requests execute immediately. POST/PATCH/DELETE create drafts by default; add --publish to execute mutating requests immediately.
5632
+ GET requests execute immediately. POST/PUT/PATCH/DELETE create drafts by default; add --publish to execute mutating requests immediately.
5633
5633
  Must be enabled in Agent Permissions first.
5634
5634
  Use this for unsupported native platform resources/workflows. Use platformOverrides instead when you only need raw fields on a supported normalized resource.
5635
5635
  Use the selected platform's official endpoint paths, field names, enum values, and resource shapes. Do not translate normalized AdKit field names into raw API payloads by guessing.
5636
5636
 
5637
5637
  Flags:
5638
5638
  --data <json> Full request object (preferred for agents)
5639
- --platform <meta|google|tiktok|reddit> Target platform (required)
5639
+ --platform <meta|google|tiktok|reddit|x> Target platform (required)
5640
5640
  --endpoint <path> Relative API path (required)
5641
- --payload <json> JSON body for POST/PATCH, query params for GET, omit for DELETE
5642
- --method <GET|POST|PATCH|DELETE> HTTP method (default: POST)
5641
+ --payload <json> JSON body for POST/PUT/PATCH, query params for GET, omit for DELETE
5642
+ --method <GET|POST|PUT|PATCH|DELETE> HTTP method (default: POST)
5643
5643
  --request-description <text> What this request does (required)
5644
5644
  --account <id> Ad account ID (required)
5645
- --publish Execute POST/PATCH/DELETE immediately instead of creating a draft
5645
+ --publish Execute POST/PUT/PATCH/DELETE immediately instead of creating a draft
5646
5646
 
5647
5647
  --data fields:
5648
5648
  platform, endpoint, payload, description, accountId, method, publish
@@ -5652,7 +5652,8 @@ Examples:
5652
5652
  adkit manage platform-api-requests --platform meta --endpoint "act_123/campaigns" --payload '{"name":"Test","objective":"OUTCOME_TRAFFIC","status":"PAUSED","special_ad_categories":[]}' --request-description "Create campaign" --account act_123 --publish
5653
5653
  adkit manage platform-api-requests --platform google --endpoint "customers/123/googleAds:mutate" --payload '{"mutateOperations":[...]}' --request-description "Pause ad" --account 123
5654
5654
  adkit manage platform-api-requests --platform tiktok --endpoint "campaign/get/" --method GET --payload '{"advertiser_id":"123"}' --request-description "List TikTok campaigns" --account 123
5655
- adkit manage platform-api-requests --platform reddit --endpoint "ad_accounts/a2_example/campaigns" --payload '{"name":"Test","objective":"TRAFFIC","configured_status":"PAUSED"}' --request-description "Create paused Reddit campaign" --account a2_example`.trim(),
5655
+ adkit manage platform-api-requests --platform reddit --endpoint "ad_accounts/a2_example/campaigns" --payload '{"name":"Test","objective":"TRAFFIC","configured_status":"PAUSED"}' --request-description "Create paused Reddit campaign" --account a2_example
5656
+ adkit manage platform-api-requests --platform x --endpoint "accounts/18ce54d4x5t/campaigns" --method GET --request-description "List X campaigns" --account 18ce54d4x5t`.trim(),
5656
5657
  manage: `adkit manage \u2014 Ad platform management
5657
5658
 
5658
5659
  Platforms:
@@ -5660,6 +5661,7 @@ Platforms:
5660
5661
  google Google Ads
5661
5662
  tiktok TikTok Ads
5662
5663
  reddit Reddit Ads
5664
+ x X Ads raw API access
5663
5665
  drafts Manage drafts across platforms
5664
5666
  platform-api-requests Send raw API requests (escape hatch)
5665
5667
 
@@ -5743,6 +5745,15 @@ General flags:
5743
5745
  ${FLAG.account}
5744
5746
 
5745
5747
  Run adkit manage reddit accounts --help for account setup.`.trim(),
5748
+ x: `adkit manage x \u2014 X Ads raw API access
5749
+
5750
+ X is currently exposed through Advanced Platform Access only.
5751
+ Use platform-api-requests with official X Ads API endpoint paths.
5752
+
5753
+ ${rawPlatformCommandLine("x")}
5754
+
5755
+ Examples:
5756
+ adkit manage platform-api-requests --platform x --endpoint "accounts/18ce54d4x5t/campaigns" --method GET --request-description "List X campaigns" --account 18ce54d4x5t`.trim(),
5746
5757
  drafts: `adkit manage drafts \u2014 Manage drafts
5747
5758
 
5748
5759
  list List all drafts
@@ -6669,7 +6680,7 @@ function readRawRequestData(flags) {
6669
6680
  };
6670
6681
  }
6671
6682
  function readRawRequestFlags(flags) {
6672
- const platform2 = requireFlag(flags, "platform", "Required: --platform meta, google, tiktok, or reddit");
6683
+ const platform2 = requireFlag(flags, "platform", "Required: --platform meta, google, tiktok, reddit, or x");
6673
6684
  const method = readRawRequestMethod(flags.method);
6674
6685
  const rawPayload = readRawRequestFlagPayload(flags);
6675
6686
  const payload = readRawRequestPayload({ method, payload: rawPayload, source: "flag" });
@@ -6704,12 +6715,12 @@ function readRawRequestString(input) {
6704
6715
  throw new CliError("MISSING_FLAG", `Missing required field: \`${input.field}\``, input.hint);
6705
6716
  }
6706
6717
  function readRawRequestPlatform(value) {
6707
- if (value === "meta" || value === "google" || value === "tiktok" || value === "reddit") return value;
6708
- throw new CliError("INVALID_VALUE", `Invalid platform: ${String(value)}`, "Use meta, google, tiktok, or reddit");
6718
+ if (value === "meta" || value === "google" || value === "tiktok" || value === "reddit" || value === "x") return value;
6719
+ throw new CliError("INVALID_VALUE", `Invalid platform: ${String(value)}`, "Use meta, google, tiktok, reddit, or x");
6709
6720
  }
6710
6721
  function readRawRequestMethod(value) {
6711
6722
  const method = typeof value === "string" ? value.toUpperCase() : "POST";
6712
- if (method !== "GET" && method !== "POST" && method !== "PATCH" && method !== "DELETE") throw new CliError("INVALID_VALUE", `Invalid method: ${method}`, "Use GET, POST, PATCH, or DELETE");
6723
+ if (method !== "GET" && method !== "POST" && method !== "PUT" && method !== "PATCH" && method !== "DELETE") throw new CliError("INVALID_VALUE", `Invalid method: ${method}`, "Use GET, POST, PUT, PATCH, or DELETE");
6713
6724
  return method;
6714
6725
  }
6715
6726
  function readRawRequestPublish(input) {
@@ -6727,8 +6738,8 @@ function readRawRequestFlagPayload(flags) {
6727
6738
  }
6728
6739
  function readRawRequestPayload(input) {
6729
6740
  if (input.method !== "GET" && input.method !== "DELETE" && (input.payload === void 0 || input.payload === null)) {
6730
- if (input.source === "data") throw new CliError("MISSING_FLAG", "POST/PATCH requests require payload in --data", 'Include "payload": {"key":"value"}');
6731
- throw new CliError("MISSING_FLAG", "POST/PATCH requests require --payload", `Add --payload '{"key":"value"}'`);
6741
+ if (input.source === "data") throw new CliError("MISSING_FLAG", "POST/PUT/PATCH requests require payload in --data", 'Include "payload": {"key":"value"}');
6742
+ throw new CliError("MISSING_FLAG", "POST/PUT/PATCH requests require --payload", `Add --payload '{"key":"value"}'`);
6732
6743
  }
6733
6744
  if (input.method === "DELETE" && input.payload !== void 0 && input.payload !== null) throw new CliError("INVALID_VALUE", "DELETE requests do not support payload", "Put identifiers in the endpoint path");
6734
6745
  return input.payload ?? null;
@@ -6875,7 +6886,7 @@ async function main() {
6875
6886
  return;
6876
6887
  }
6877
6888
  const platform2 = manageTarget;
6878
- if (platform2 !== "meta" && platform2 !== "google" && platform2 !== "tiktok" && platform2 !== "reddit") throw new CliError("UNKNOWN_COMMAND", `Unknown platform: ${platform2}`, "Available: meta, google, tiktok, reddit, drafts, platform-api-requests");
6889
+ if (platform2 !== "meta" && platform2 !== "google" && platform2 !== "tiktok" && platform2 !== "reddit" && platform2 !== "x") throw new CliError("UNKNOWN_COMMAND", `Unknown platform: ${platform2}`, "Available: meta, google, tiktok, reddit, x, drafts, platform-api-requests");
6879
6890
  const entity = args[2];
6880
6891
  const action = args[3];
6881
6892
  const restArgs = args.slice(4);
@@ -7502,7 +7513,8 @@ async function main() {
7502
7513
  default:
7503
7514
  throw new CliError("UNKNOWN_COMMAND", `Unknown entity: reddit ${entity}`, "Available: accounts, platform-api-requests");
7504
7515
  }
7505
- } else throw new CliError("UNKNOWN_COMMAND", "Unknown platform", "Available: meta, google, tiktok, reddit, drafts, platform-api-requests");
7516
+ } else if (platform2 === "x") throw new CliError("UNKNOWN_COMMAND", `Unknown entity: x ${entity}`, "Available: platform-api-requests");
7517
+ else throw new CliError("UNKNOWN_COMMAND", "Unknown platform", "Available: meta, google, tiktok, reddit, x, drafts, platform-api-requests");
7506
7518
  printResult(data, flags, emptyHint, detailEntity);
7507
7519
  return;
7508
7520
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adkit/cli",
3
- "version": "1.12.22",
3
+ "version": "1.12.23",
4
4
  "description": "The Ads CLI for AI agents — manage Meta & Google ad campaigns, browse the ad library, and generate creatives from your terminal.",
5
5
  "keywords": [
6
6
  "ads cli",