@koda-sl/baker-cli 0.215.0 → 0.216.0

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/dist/cli.js CHANGED
@@ -110,6 +110,36 @@ import {
110
110
  // src/cli.ts
111
111
  import { defineCommand as defineCommand215, runMain } from "citty";
112
112
 
113
+ // src/cache-flag.ts
114
+ var NO_CACHE_ARG = {
115
+ type: "boolean",
116
+ description: "Skip cached results and read live from the platform (slower)",
117
+ required: false
118
+ };
119
+ var LEGACY = "--skip-cache";
120
+ var CANONICAL = "--no-cache";
121
+ var PARSEABLE = "--noCache";
122
+ function respell(token, from, to) {
123
+ if (token === from) {
124
+ return [to];
125
+ }
126
+ if (!token.startsWith(`${from}=`)) {
127
+ return [token];
128
+ }
129
+ return token.slice(from.length + 1) === "false" ? [] : [to];
130
+ }
131
+ function normalizeCacheFlag(argv) {
132
+ return rewriteBeforeDoubleDash(argv, (token) => respell(token, LEGACY, CANONICAL));
133
+ }
134
+ function cacheFlagForParser(argv) {
135
+ return rewriteBeforeDoubleDash(argv, (token) => respell(token, CANONICAL, PARSEABLE));
136
+ }
137
+ function rewriteBeforeDoubleDash(argv, rewrite) {
138
+ const end = argv.indexOf("--");
139
+ const limit = end === -1 ? argv.length : end;
140
+ return argv.flatMap((token, index) => index >= limit ? [token] : rewrite(token));
141
+ }
142
+
113
143
  // src/commands/actions/index.ts
114
144
  import { defineCommand as defineCommand18 } from "citty";
115
145
 
@@ -12354,8 +12384,7 @@ registerSchema({
12354
12384
  description: "List LinkedIn ad accounts in the company's connected scope. Pass --include-all to list every account the OAuth token can see.",
12355
12385
  args: {
12356
12386
  "include-all": { type: "boolean", description: "Ignore picker scope", required: false },
12357
- "no-cache": { type: "boolean", description: "Skip CLI-side cache", required: false },
12358
- "skip-cache": { type: "boolean", description: "Bypass server-side cache", required: false },
12387
+ "no-cache": NO_CACHE_ARG,
12359
12388
  output: { type: "string", description: "json|csv|jsonl|md", required: false, default: "json" }
12360
12389
  }
12361
12390
  });
@@ -12365,7 +12394,7 @@ registerSchema({
12365
12394
  args: {
12366
12395
  "account-id": { type: "string", description: "Numeric ID or urn:li:sponsoredAccount:N", required: false },
12367
12396
  "account-urn": { type: "string", description: "Alias for --account-id", required: false },
12368
- "skip-cache": { type: "boolean", description: "Bypass cache", required: false },
12397
+ "no-cache": NO_CACHE_ARG,
12369
12398
  output: { type: "string", description: "json|csv|jsonl|md", required: false, default: "json" }
12370
12399
  }
12371
12400
  });
@@ -12378,7 +12407,7 @@ registerSchema({
12378
12407
  "all-statuses": { type: "boolean", description: "Drop the ACTIVE filter", required: false },
12379
12408
  statuses: { type: "string", description: "CSV of statuses", required: false },
12380
12409
  limit: { type: "string", description: "Max rows (default 500)", required: false },
12381
- "skip-cache": { type: "boolean", description: "Bypass cache", required: false },
12410
+ "no-cache": NO_CACHE_ARG,
12382
12411
  output: { type: "string", description: "json|csv|jsonl|md", required: false, default: "json" }
12383
12412
  }
12384
12413
  });
@@ -12392,7 +12421,7 @@ registerSchema({
12392
12421
  "all-statuses": { type: "boolean", description: "Drop the ACTIVE filter", required: false },
12393
12422
  statuses: { type: "string", description: "CSV of statuses", required: false },
12394
12423
  limit: { type: "string", description: "Max rows", required: false },
12395
- "skip-cache": { type: "boolean", description: "Bypass cache", required: false },
12424
+ "no-cache": NO_CACHE_ARG,
12396
12425
  output: { type: "string", description: "json|csv|jsonl|md", required: false, default: "json" }
12397
12426
  }
12398
12427
  });
@@ -12416,7 +12445,7 @@ registerSchema({
12416
12445
  required: false
12417
12446
  },
12418
12447
  limit: { type: "string", description: "Max rows", required: false },
12419
- "skip-cache": { type: "boolean", description: "Bypass cache", required: false },
12448
+ "no-cache": NO_CACHE_ARG,
12420
12449
  output: { type: "string", description: "json|csv|jsonl|md", required: false, default: "json" }
12421
12450
  }
12422
12451
  });
@@ -12498,7 +12527,7 @@ registerSchema({
12498
12527
  "no-sort": { type: "boolean", description: "Skip default sort", required: false },
12499
12528
  "list-intents": { type: "boolean", description: "List intents and exit", required: false },
12500
12529
  "list-pivots": { type: "boolean", description: "List pivots and exit", required: false },
12501
- "skip-cache": { type: "boolean", description: "Bypass cache", required: false },
12530
+ "no-cache": NO_CACHE_ARG,
12502
12531
  output: { type: "string", description: "json|csv|jsonl|md", required: false, default: "json" }
12503
12532
  }
12504
12533
  });
@@ -12513,7 +12542,7 @@ registerSchema({
12513
12542
  start: { type: "string", description: "YYYY-MM-DD", required: false },
12514
12543
  end: { type: "string", description: "YYYY-MM-DD", required: false },
12515
12544
  "last-days": { type: "string", description: "Window (default 30)", required: false },
12516
- "skip-cache": { type: "boolean", description: "Bypass cache", required: false },
12545
+ "no-cache": NO_CACHE_ARG,
12517
12546
  output: { type: "string", description: "json", required: false, default: "json" }
12518
12547
  }
12519
12548
  });
@@ -12527,7 +12556,7 @@ registerSchema({
12527
12556
  start: { type: "string", description: "YYYY-MM-DD", required: false },
12528
12557
  end: { type: "string", description: "YYYY-MM-DD", required: false },
12529
12558
  "last-days": { type: "string", description: "Window (default 30)", required: false },
12530
- "skip-cache": { type: "boolean", description: "Bypass cache", required: false },
12559
+ "no-cache": NO_CACHE_ARG,
12531
12560
  output: { type: "string", description: "json|csv|jsonl|md", required: false, default: "json" }
12532
12561
  }
12533
12562
  });
@@ -12535,7 +12564,7 @@ registerSchema({
12535
12564
  command: "ads.linkedin.facets.list",
12536
12565
  description: "List every targeting facet LinkedIn supports (industries, seniorities, titles, employers, growthRate, etc).",
12537
12566
  args: {
12538
- "skip-cache": { type: "boolean", description: "Bypass cache", required: false },
12567
+ "no-cache": NO_CACHE_ARG,
12539
12568
  output: { type: "string", description: "json|csv|jsonl|md", required: false, default: "json" }
12540
12569
  }
12541
12570
  });
@@ -12547,7 +12576,7 @@ registerSchema({
12547
12576
  query: { type: "string", description: "Typeahead query (auto-switches finder)", required: false },
12548
12577
  finder: { type: "string", description: "adTargetingFacet|typeahead|similarEntities", required: false },
12549
12578
  locale: { type: "string", description: "Locale (default en_US)", required: false },
12550
- "skip-cache": { type: "boolean", description: "Bypass cache", required: false },
12579
+ "no-cache": NO_CACHE_ARG,
12551
12580
  output: { type: "string", description: "json|csv|jsonl|md", required: false, default: "json" }
12552
12581
  }
12553
12582
  });
@@ -12559,7 +12588,7 @@ registerSchema({
12559
12588
  "account-urn": { type: "string", description: "Alias", required: false },
12560
12589
  targeting: { type: "string", description: "Inline JSON targetingCriteria", required: false },
12561
12590
  "targeting-file": { type: "string", description: "Path to JSON file", required: false },
12562
- "skip-cache": { type: "boolean", description: "Bypass cache", required: false },
12591
+ "no-cache": NO_CACHE_ARG,
12563
12592
  output: { type: "string", description: "json", required: false, default: "json" }
12564
12593
  }
12565
12594
  });
@@ -12577,7 +12606,7 @@ registerSchema({
12577
12606
  "cost-type": { type: "string", description: "CPC|CPM|CPV|CPS", required: true, enum: ["CPC", "CPM", "CPV", "CPS"] },
12578
12607
  targeting: { type: "string", description: "Inline JSON targetingCriteria", required: false },
12579
12608
  "targeting-file": { type: "string", description: "Path to JSON file", required: false },
12580
- "skip-cache": { type: "boolean", description: "Bypass cache", required: false },
12609
+ "no-cache": NO_CACHE_ARG,
12581
12610
  output: { type: "string", description: "json", required: false, default: "json" }
12582
12611
  }
12583
12612
  });
@@ -12594,7 +12623,7 @@ registerSchema({
12594
12623
  bid: { type: "string", description: "Bid e.g. '8 USD'", required: false },
12595
12624
  targeting: { type: "string", description: "Inline JSON targetingCriteria", required: false },
12596
12625
  "targeting-file": { type: "string", description: "Path to JSON file", required: false },
12597
- "skip-cache": { type: "boolean", description: "Bypass cache", required: false },
12626
+ "no-cache": NO_CACHE_ARG,
12598
12627
  output: { type: "string", description: "json", required: false, default: "json" }
12599
12628
  }
12600
12629
  });
@@ -12609,7 +12638,7 @@ registerSchema({
12609
12638
  "since-days": { type: "string", description: "Last N days", required: false },
12610
12639
  "since-ms": { type: "string", description: "Epoch ms (alternative to --since-days)", required: false },
12611
12640
  limit: { type: "string", description: "Max rows", required: false },
12612
- "skip-cache": { type: "boolean", description: "Bypass cache", required: false },
12641
+ "no-cache": NO_CACHE_ARG,
12613
12642
  output: { type: "string", description: "json|csv|jsonl|md", required: false, default: "json" }
12614
12643
  }
12615
12644
  });
@@ -12619,7 +12648,7 @@ registerSchema({
12619
12648
  args: {
12620
12649
  "account-id": { type: "string", description: "Account ID", required: false },
12621
12650
  "account-urn": { type: "string", description: "Alias", required: false },
12622
- "skip-cache": { type: "boolean", description: "Bypass cache", required: false },
12651
+ "no-cache": NO_CACHE_ARG,
12623
12652
  output: { type: "string", description: "json|csv|jsonl|md", required: false, default: "json" }
12624
12653
  }
12625
12654
  });
@@ -12629,7 +12658,7 @@ registerSchema({
12629
12658
  args: {
12630
12659
  "account-id": { type: "string", description: "Account ID", required: false },
12631
12660
  "account-urn": { type: "string", description: "Alias", required: false },
12632
- "skip-cache": { type: "boolean", description: "Bypass cache", required: false },
12661
+ "no-cache": NO_CACHE_ARG,
12633
12662
  output: { type: "string", description: "json", required: false, default: "json" }
12634
12663
  }
12635
12664
  });
@@ -12641,7 +12670,7 @@ registerSchema({
12641
12670
  start: { type: "string", description: "YYYY-MM-DD", required: false },
12642
12671
  end: { type: "string", description: "YYYY-MM-DD", required: false },
12643
12672
  "last-days": { type: "string", description: "Window (default 30)", required: false },
12644
- "skip-cache": { type: "boolean", description: "Bypass cache", required: false },
12673
+ "no-cache": NO_CACHE_ARG,
12645
12674
  output: { type: "string", description: "json|csv|jsonl|md", required: false, default: "json" }
12646
12675
  }
12647
12676
  });
@@ -12656,7 +12685,7 @@ registerSchema({
12656
12685
  severity: { type: "string", description: "CSV severity filter (critical,high,medium,low)", required: false },
12657
12686
  area: { type: "string", description: "CSV area filter", required: false },
12658
12687
  format: { type: "string", description: "json | md", required: false, default: "json" },
12659
- "skip-cache": { type: "boolean", description: "Bypass cache", required: false }
12688
+ "no-cache": NO_CACHE_ARG
12660
12689
  }
12661
12690
  });
12662
12691
  var writeAccountArgs = {
@@ -13094,14 +13123,14 @@ Examples:
13094
13123
  args: {
13095
13124
  "account-id": { type: "string", description: "Numeric account ID or urn:li:sponsoredAccount:N" },
13096
13125
  "account-urn": { type: "string", description: "Alias for --account-id" },
13097
- "skip-cache": { type: "boolean", description: "Bypass server-side cache" },
13126
+ "no-cache": NO_CACHE_ARG,
13098
13127
  output: { type: "string", description: "json|csv|jsonl|md", default: "json" }
13099
13128
  },
13100
13129
  run: async ({ args }) => {
13101
13130
  const accountId = resolveAccountIdArg2(args);
13102
13131
  try {
13103
13132
  const params = { "account-id": accountId };
13104
- if (args["skip-cache"]) params["skip-cache"] = "true";
13133
+ if (args["no-cache"]) params["skip-cache"] = "true";
13105
13134
  const data = await apiGet("/api/ads/linkedin/account", params);
13106
13135
  const fmt = csvOrJson2(args);
13107
13136
  if (fmt !== "json") {
@@ -13141,8 +13170,7 @@ Examples:
13141
13170
  },
13142
13171
  args: {
13143
13172
  "include-all": { type: "boolean", description: "List all accessible accounts, ignoring picker scope" },
13144
- "no-cache": { type: "boolean", description: "Skip CLI-side cache" },
13145
- "skip-cache": { type: "boolean", description: "Bypass server-side cache (force re-fetch)" },
13173
+ "no-cache": NO_CACHE_ARG,
13146
13174
  output: { type: "string", description: "Output format: json|csv|jsonl|md", default: "json" }
13147
13175
  },
13148
13176
  run: async ({ args }) => {
@@ -13164,7 +13192,7 @@ Examples:
13164
13192
  try {
13165
13193
  const params = {};
13166
13194
  if (includeAll) params["include-all"] = "true";
13167
- if (args["skip-cache"]) params["skip-cache"] = "true";
13195
+ if (!useCache) params["skip-cache"] = "true";
13168
13196
  const data = await apiGet("/api/ads/linkedin/accounts", params);
13169
13197
  if (useCache) {
13170
13198
  cacheSet("linkedin-accounts", cacheKey, data, ACCOUNTS_TTL_MS);
@@ -13513,7 +13541,7 @@ Examples \u2014 common AI questions:
13513
13541
  granularity: { type: "string", description: "DAILY|MONTHLY|YEARLY|ALL (default: DAILY)" },
13514
13542
  limit: { type: "string", description: "Max rows (default: 1000)" },
13515
13543
  "no-sort": { type: "boolean", description: "Skip default sort by costInUsd desc" },
13516
- "skip-cache": { type: "boolean", description: "Bypass server-side cache" },
13544
+ "no-cache": NO_CACHE_ARG,
13517
13545
  output: { type: "string", description: "Output format json|csv|jsonl|md", default: "json" }
13518
13546
  },
13519
13547
  run: async ({ args }) => {
@@ -13555,7 +13583,7 @@ Examples \u2014 common AI questions:
13555
13583
  try {
13556
13584
  const data = await apiPost("/api/ads/linkedin/analytics", {
13557
13585
  request,
13558
- skipCache: Boolean(args["skip-cache"])
13586
+ skipCache: Boolean(args["no-cache"])
13559
13587
  });
13560
13588
  const rows = args["no-sort"] ? data.rows : sortRows(data.rows);
13561
13589
  const fmt = csvOrJson2(args);
@@ -13629,7 +13657,7 @@ Examples:
13629
13657
  "account-urn": { type: "string", description: "Alias for --account-id" },
13630
13658
  targeting: { type: "string", description: "Inline JSON targetingCriteria payload" },
13631
13659
  "targeting-file": { type: "string", description: "Path to JSON file with targetingCriteria" },
13632
- "skip-cache": { type: "boolean", description: "Bypass server-side cache" },
13660
+ "no-cache": NO_CACHE_ARG,
13633
13661
  output: { type: "string", description: "json", default: "json" }
13634
13662
  },
13635
13663
  run: async ({ args }) => {
@@ -13639,7 +13667,7 @@ Examples:
13639
13667
  const data = await apiPost("/api/ads/linkedin/audience-size", {
13640
13668
  accountId,
13641
13669
  targetingCriteria,
13642
- skipCache: Boolean(args["skip-cache"])
13670
+ skipCache: Boolean(args["no-cache"])
13643
13671
  });
13644
13672
  writeAdsJson({ ok: true, data });
13645
13673
  } catch (err) {
@@ -13740,7 +13768,7 @@ Examples:
13740
13768
  description: "CSV area filter: Settings,Tracking,Audience,Campaigns,Creative,Performance,Bidding,Compliance,Hygiene"
13741
13769
  },
13742
13770
  format: { type: "string", description: "Output format: json | md (default: json)" },
13743
- "skip-cache": { type: "boolean", description: "Bypass server-side cache" }
13771
+ "no-cache": NO_CACHE_ARG
13744
13772
  },
13745
13773
  run: async ({ args }) => {
13746
13774
  const accountId = resolveAccountIdArg2(args);
@@ -13753,7 +13781,7 @@ Examples:
13753
13781
  accountId,
13754
13782
  campaignId: args["campaign-id"] ? String(args["campaign-id"]) : void 0,
13755
13783
  windowDays,
13756
- skipCache: Boolean(args["skip-cache"])
13784
+ skipCache: Boolean(args["no-cache"])
13757
13785
  });
13758
13786
  const severityFilter = args.severity?.split(",").map((s) => s.trim().toLowerCase()).filter(Boolean);
13759
13787
  const areaFilter = args.area?.split(",").map((s) => s.trim()).filter(Boolean);
@@ -13825,7 +13853,7 @@ Examples:
13825
13853
  "cost-type": { type: "string", description: "CPC | CPM | CPV | CPS", required: true },
13826
13854
  targeting: { type: "string", description: "Inline JSON targetingCriteria" },
13827
13855
  "targeting-file": { type: "string", description: "Path to JSON file with targetingCriteria" },
13828
- "skip-cache": { type: "boolean", description: "Bypass server-side cache" },
13856
+ "no-cache": NO_CACHE_ARG,
13829
13857
  output: { type: "string", description: "json", default: "json" }
13830
13858
  },
13831
13859
  run: async ({ args }) => {
@@ -13837,7 +13865,7 @@ Examples:
13837
13865
  objectiveType: String(args.objective),
13838
13866
  costType: String(args["cost-type"]).toUpperCase(),
13839
13867
  targetingCriteria,
13840
- skipCache: Boolean(args["skip-cache"])
13868
+ skipCache: Boolean(args["no-cache"])
13841
13869
  });
13842
13870
  writeAdsJson({ ok: true, data });
13843
13871
  } catch (err) {
@@ -14602,7 +14630,7 @@ var listArgs = {
14602
14630
  "all-statuses": { type: "boolean", description: "Drop the default ACTIVE filter" },
14603
14631
  statuses: { type: "string", description: "CSV of statuses (ACTIVE,PAUSED,ARCHIVED,COMPLETED,DRAFT)" },
14604
14632
  limit: { type: "string", description: "Max rows (default: 500)" },
14605
- "skip-cache": { type: "boolean", description: "Bypass server-side cache" },
14633
+ "no-cache": NO_CACHE_ARG,
14606
14634
  output: { type: "string", description: "json|csv|jsonl|md", default: "json" }
14607
14635
  };
14608
14636
  var campaignGroupsListCommand = defineCommand39({
@@ -14618,7 +14646,7 @@ var campaignGroupsListCommand = defineCommand39({
14618
14646
  const statuses = resolveStatusFilter(args);
14619
14647
  if (statuses) params.statuses = statuses.join(",");
14620
14648
  if (args.limit) params.limit = String(args.limit);
14621
- if (args["skip-cache"]) params["skip-cache"] = "true";
14649
+ if (args["no-cache"]) params["skip-cache"] = "true";
14622
14650
  const data = await apiGet("/api/ads/linkedin/campaign-groups", params);
14623
14651
  const fmt = csvOrJson2(args);
14624
14652
  if (fmt !== "json") {
@@ -14668,7 +14696,7 @@ var listArgs2 = {
14668
14696
  "all-statuses": { type: "boolean", description: "Drop the default ACTIVE filter" },
14669
14697
  statuses: { type: "string", description: "CSV of statuses" },
14670
14698
  limit: { type: "string", description: "Max rows (default: 500)" },
14671
- "skip-cache": { type: "boolean", description: "Bypass server-side cache" },
14699
+ "no-cache": NO_CACHE_ARG,
14672
14700
  output: { type: "string", description: "json|csv|jsonl|md", default: "json" }
14673
14701
  };
14674
14702
  var campaignsListCommand = defineCommand40({
@@ -14685,7 +14713,7 @@ var campaignsListCommand = defineCommand40({
14685
14713
  if (statuses) params.statuses = statuses.join(",");
14686
14714
  if (args["campaign-group-id"]) params["campaign-group-id"] = String(args["campaign-group-id"]);
14687
14715
  if (args.limit) params.limit = String(args.limit);
14688
- if (args["skip-cache"]) params["skip-cache"] = "true";
14716
+ if (args["no-cache"]) params["skip-cache"] = "true";
14689
14717
  const data = await apiGet("/api/ads/linkedin/campaigns", params);
14690
14718
  const fmt = csvOrJson2(args);
14691
14719
  if (fmt !== "json") {
@@ -14759,7 +14787,7 @@ Examples:
14759
14787
  start: { type: "string", description: "Start date YYYY-MM-DD" },
14760
14788
  end: { type: "string", description: "End date YYYY-MM-DD" },
14761
14789
  "last-days": { type: "string", description: "Window relative to today (default: 30)" },
14762
- "skip-cache": { type: "boolean", description: "Bypass server-side cache" },
14790
+ "no-cache": NO_CACHE_ARG,
14763
14791
  output: { type: "string", description: "json|csv|jsonl|md", default: "json" }
14764
14792
  },
14765
14793
  run: async ({ args }) => {
@@ -14782,7 +14810,7 @@ Examples:
14782
14810
  granularity: "ALL",
14783
14811
  limit: 500
14784
14812
  },
14785
- skipCache: Boolean(args["skip-cache"])
14813
+ skipCache: Boolean(args["no-cache"])
14786
14814
  });
14787
14815
  const sorted = [...data.rows].sort((a, b) => Number(b.clicks ?? 0) - Number(a.clicks ?? 0));
14788
14816
  const fmt = csvOrJson2(args);
@@ -14835,14 +14863,14 @@ var listCmd = defineCommand42({
14835
14863
  args: {
14836
14864
  "account-id": { type: "string", description: "Numeric account ID or urn:li:sponsoredAccount:N" },
14837
14865
  "account-urn": { type: "string", description: "Alias for --account-id" },
14838
- "skip-cache": { type: "boolean", description: "Bypass server-side cache" },
14866
+ "no-cache": NO_CACHE_ARG,
14839
14867
  output: { type: "string", description: "json|csv|jsonl|md", default: "json" }
14840
14868
  },
14841
14869
  run: async ({ args }) => {
14842
14870
  const accountId = resolveAccountIdArg2(args);
14843
14871
  try {
14844
14872
  const params = { "account-id": accountId };
14845
- if (args["skip-cache"]) params["skip-cache"] = "true";
14873
+ if (args["no-cache"]) params["skip-cache"] = "true";
14846
14874
  const data = await apiGet("/api/ads/linkedin/conversions", params);
14847
14875
  const fmt = csvOrJson2(args);
14848
14876
  if (fmt !== "json") {
@@ -14870,14 +14898,14 @@ Surfaces:
14870
14898
  args: {
14871
14899
  "account-id": { type: "string", description: "Numeric account ID or urn:li:sponsoredAccount:N" },
14872
14900
  "account-urn": { type: "string", description: "Alias for --account-id" },
14873
- "skip-cache": { type: "boolean", description: "Bypass server-side cache" },
14901
+ "no-cache": NO_CACHE_ARG,
14874
14902
  output: { type: "string", description: "json", default: "json" }
14875
14903
  },
14876
14904
  run: async ({ args }) => {
14877
14905
  const accountId = resolveAccountIdArg2(args);
14878
14906
  try {
14879
14907
  const params = { "account-id": accountId };
14880
- if (args["skip-cache"]) params["skip-cache"] = "true";
14908
+ if (args["no-cache"]) params["skip-cache"] = "true";
14881
14909
  const data = await apiGet("/api/ads/linkedin/conversions", params);
14882
14910
  writeAdsJson({ ok: true, data: healthOf(data) });
14883
14911
  } catch (err) {
@@ -15004,7 +15032,7 @@ var listArgs3 = {
15004
15032
  },
15005
15033
  full: { type: "boolean", description: "Return the complete raw records, including the opaque 'content' block" },
15006
15034
  limit: { type: "string", description: "Max rows (default: 500)" },
15007
- "skip-cache": { type: "boolean", description: "Bypass server-side cache" },
15035
+ "no-cache": NO_CACHE_ARG,
15008
15036
  output: { type: "string", description: "json|csv|jsonl|md", default: "json" }
15009
15037
  };
15010
15038
  var creativesListCommand = defineCommand43({
@@ -15021,7 +15049,7 @@ var creativesListCommand = defineCommand43({
15021
15049
  if (statuses) params.statuses = statuses.join(",");
15022
15050
  if (args["campaign-id"]) params["campaign-id"] = String(args["campaign-id"]);
15023
15051
  if (args.limit) params.limit = String(args.limit);
15024
- if (args["skip-cache"]) params["skip-cache"] = "true";
15052
+ if (args["no-cache"]) params["skip-cache"] = "true";
15025
15053
  const data = await apiGet("/api/ads/linkedin/creatives", params);
15026
15054
  const shaped = shapeRows(data, args);
15027
15055
  const fmt = csvOrJson2(args);
@@ -15117,7 +15145,7 @@ Examples:
15117
15145
  start: { type: "string", description: "Start date YYYY-MM-DD" },
15118
15146
  end: { type: "string", description: "End date YYYY-MM-DD" },
15119
15147
  "last-days": { type: "string", description: "Window relative to today (default: 30)" },
15120
- "skip-cache": { type: "boolean", description: "Bypass server-side cache" },
15148
+ "no-cache": NO_CACHE_ARG,
15121
15149
  output: { type: "string", description: "json", default: "json" }
15122
15150
  },
15123
15151
  run: async ({ args }) => {
@@ -15156,7 +15184,7 @@ Examples:
15156
15184
  granularity: "ALL",
15157
15185
  limit: 500
15158
15186
  },
15159
- skipCache: Boolean(args["skip-cache"])
15187
+ skipCache: Boolean(args["no-cache"])
15160
15188
  });
15161
15189
  results.push({ pivot, rows: topByImpressions(data.rows, topN), warnings: data.warnings });
15162
15190
  }
@@ -15432,13 +15460,13 @@ Cached 7 days. Use this to discover what dimensions you can target on (industrie
15432
15460
  seniorities, titles, employers, growthRate, companyCategory, skills, etc.).`
15433
15461
  },
15434
15462
  args: {
15435
- "skip-cache": { type: "boolean", description: "Bypass server-side cache" },
15463
+ "no-cache": NO_CACHE_ARG,
15436
15464
  output: { type: "string", description: "json|csv|jsonl|md", default: "json" }
15437
15465
  },
15438
15466
  run: async ({ args }) => {
15439
15467
  try {
15440
15468
  const params = {};
15441
- if (args["skip-cache"]) params["skip-cache"] = "true";
15469
+ if (args["no-cache"]) params["skip-cache"] = "true";
15442
15470
  const data = await apiGet("/api/ads/linkedin/facets", params);
15443
15471
  const fmt = csvOrJson2(args);
15444
15472
  if (fmt !== "json") {
@@ -15469,7 +15497,7 @@ or the full URN (urn:li:adTargetingFacet:industries).`
15469
15497
  query: { type: "string", description: "Typeahead query (auto-switches finder to typeahead)" },
15470
15498
  finder: { type: "string", description: "adTargetingFacet | typeahead | similarEntities (default: auto)" },
15471
15499
  locale: { type: "string", description: "Locale (default: en_US)" },
15472
- "skip-cache": { type: "boolean", description: "Bypass server-side cache" },
15500
+ "no-cache": NO_CACHE_ARG,
15473
15501
  output: { type: "string", description: "json|csv|jsonl|md", default: "json" }
15474
15502
  },
15475
15503
  run: async ({ args }) => {
@@ -15479,7 +15507,7 @@ or the full URN (urn:li:adTargetingFacet:industries).`
15479
15507
  params.finder = finder;
15480
15508
  if (args.query) params.query = String(args.query);
15481
15509
  if (args.locale) params.locale = String(args.locale);
15482
- if (args["skip-cache"]) params["skip-cache"] = "true";
15510
+ if (args["no-cache"]) params["skip-cache"] = "true";
15483
15511
  const data = await apiGet("/api/ads/linkedin/facets/entities", params);
15484
15512
  const fmt = csvOrJson2(args);
15485
15513
  if (fmt !== "json") {
@@ -15562,7 +15590,7 @@ Examples:
15562
15590
  bid: { type: "string", description: "Bid e.g. '8 USD'" },
15563
15591
  targeting: { type: "string", description: "Inline JSON targetingCriteria" },
15564
15592
  "targeting-file": { type: "string", description: "Path to JSON file with targetingCriteria" },
15565
- "skip-cache": { type: "boolean", description: "Bypass server-side cache" },
15593
+ "no-cache": NO_CACHE_ARG,
15566
15594
  output: { type: "string", description: "json", default: "json" }
15567
15595
  },
15568
15596
  run: async ({ args }) => {
@@ -15577,7 +15605,7 @@ Examples:
15577
15605
  dailyBudget: parseMoney(args["daily-budget"]),
15578
15606
  totalBudget: parseMoney(args["total-budget"]),
15579
15607
  bid: parseMoney(args.bid),
15580
- skipCache: Boolean(args["skip-cache"])
15608
+ skipCache: Boolean(args["no-cache"])
15581
15609
  });
15582
15610
  writeAdsJson({ ok: true, data });
15583
15611
  } catch (err) {
@@ -15614,7 +15642,7 @@ Examples:
15614
15642
  description: "Only responses submitted at or after this epoch ms (alternative to --since-days)"
15615
15643
  },
15616
15644
  limit: { type: "string", description: "Max rows (default: 500)" },
15617
- "skip-cache": { type: "boolean", description: "Bypass server-side cache" },
15645
+ "no-cache": NO_CACHE_ARG,
15618
15646
  output: { type: "string", description: "json|csv|jsonl|md", default: "json" }
15619
15647
  },
15620
15648
  run: async ({ args }) => {
@@ -15627,7 +15655,7 @@ Examples:
15627
15655
  const sinceMs = args["since-ms"] ? Number(args["since-ms"]) : sinceDays ? Date.now() - sinceDays * DAY_MS4 : void 0;
15628
15656
  if (sinceMs) params["since-ms"] = String(sinceMs);
15629
15657
  if (args.limit) params.limit = String(args.limit);
15630
- if (args["skip-cache"]) params["skip-cache"] = "true";
15658
+ if (args["no-cache"]) params["skip-cache"] = "true";
15631
15659
  const data = await apiGet("/api/ads/linkedin/leads", params);
15632
15660
  const fmt = csvOrJson2(args);
15633
15661
  if (fmt !== "json") {
@@ -15675,7 +15703,7 @@ couldn't be resolved \u2014 typically an org outside LinkedIn's targetable set.`
15675
15703
  args: {
15676
15704
  urns: { type: "string", description: "Comma-separated org URNs (urn:li:organization:NNN)" },
15677
15705
  ids: { type: "string", description: "Comma-separated bare org ids (17719,19022)" },
15678
- "skip-cache": { type: "boolean", description: "Bypass server-side cache" },
15706
+ "no-cache": NO_CACHE_ARG,
15679
15707
  output: { type: "string", description: "json|csv|jsonl|md", default: "json" }
15680
15708
  },
15681
15709
  run: async ({ args }) => {
@@ -15687,7 +15715,7 @@ couldn't be resolved \u2014 typically an org outside LinkedIn's targetable set.`
15687
15715
  try {
15688
15716
  const data = await apiPost("/api/ads/linkedin/resolve-orgs", {
15689
15717
  urns,
15690
- skipCache: Boolean(args["skip-cache"])
15718
+ skipCache: Boolean(args["no-cache"])
15691
15719
  });
15692
15720
  const fmt = csvOrJson2(args);
15693
15721
  if (fmt !== "json") {
@@ -15726,7 +15754,7 @@ Examples:
15726
15754
  start: { type: "string", description: "Start date YYYY-MM-DD" },
15727
15755
  end: { type: "string", description: "End date YYYY-MM-DD" },
15728
15756
  "last-days": { type: "string", description: "Window relative to today (default: 30)" },
15729
- "skip-cache": { type: "boolean", description: "Bypass server-side cache" },
15757
+ "no-cache": NO_CACHE_ARG,
15730
15758
  output: { type: "string", description: "json|csv|jsonl|md", default: "json" }
15731
15759
  },
15732
15760
  run: async ({ args }) => {
@@ -15751,7 +15779,7 @@ Examples:
15751
15779
  granularity: "ALL",
15752
15780
  limit: 500
15753
15781
  },
15754
- skipCache: Boolean(args["skip-cache"])
15782
+ skipCache: Boolean(args["no-cache"])
15755
15783
  });
15756
15784
  const top = [...data.rows].sort((a, b) => Number(b.impressions ?? 0) - Number(a.impressions ?? 0)).slice(0, topN);
15757
15785
  const fmt = csvOrJson2(args);
@@ -15856,13 +15884,13 @@ Examples:
15856
15884
  },
15857
15885
  args: {
15858
15886
  "account-id": { type: "string", description: "Meta ad account ID (act_...)" },
15859
- "skip-cache": { type: "boolean", description: "Bypass server-side cache" }
15887
+ "no-cache": NO_CACHE_ARG
15860
15888
  },
15861
15889
  run: async ({ args }) => {
15862
15890
  const accountId = resolveAccountIdArg(args);
15863
15891
  try {
15864
15892
  const params = { "account-id": accountId };
15865
- if (args["skip-cache"]) params["skip-cache"] = "true";
15893
+ if (args["no-cache"]) params["skip-cache"] = "true";
15866
15894
  const data = await apiGet("/api/ads/meta/account", params);
15867
15895
  writeAdsJson({ ok: true, data });
15868
15896
  } catch (err) {
@@ -15899,8 +15927,7 @@ Examples:
15899
15927
  },
15900
15928
  args: {
15901
15929
  "include-all": { type: "boolean", description: "List all accessible accounts, ignoring picker scope" },
15902
- "no-cache": { type: "boolean", description: "Skip CLI-side cache" },
15903
- "skip-cache": { type: "boolean", description: "Bypass server-side cache (force re-fetch)" },
15930
+ "no-cache": NO_CACHE_ARG,
15904
15931
  output: { type: "string", description: "Output format: json|csv|jsonl|md", default: "json" }
15905
15932
  },
15906
15933
  run: async ({ args }) => {
@@ -15922,7 +15949,7 @@ Examples:
15922
15949
  try {
15923
15950
  const params = {};
15924
15951
  if (includeAll) params["include-all"] = "true";
15925
- if (args["skip-cache"]) params["skip-cache"] = "true";
15952
+ if (!useCache) params["skip-cache"] = "true";
15926
15953
  const data = await apiGet("/api/ads/meta/accounts", params);
15927
15954
  if (useCache) {
15928
15955
  cacheSet("meta-accounts", cacheKey, data, 60 * 60 * 1e3);
@@ -15954,7 +15981,7 @@ Examples:
15954
15981
  "account-id": { type: "string", description: "Meta ad account ID" },
15955
15982
  days: { type: "string", description: "Lookback days (default 7)" },
15956
15983
  limit: { type: "string", description: "Max rows" },
15957
- "skip-cache": { type: "boolean", description: "Bypass server-side cache" },
15984
+ "no-cache": NO_CACHE_ARG,
15958
15985
  output: { type: "string", description: "Output format", default: "json" }
15959
15986
  },
15960
15987
  run: async ({ args }) => {
@@ -15963,7 +15990,7 @@ Examples:
15963
15990
  const params = { "account-id": accountId };
15964
15991
  if (args.days) params.days = args.days;
15965
15992
  if (args.limit) params.limit = args.limit;
15966
- if (args["skip-cache"]) params["skip-cache"] = "true";
15993
+ if (args["no-cache"]) params["skip-cache"] = "true";
15967
15994
  const data = await apiGet("/api/ads/meta/activities", params);
15968
15995
  const fmt = csvOrJson(args);
15969
15996
  if (fmt !== "json") {
@@ -17521,7 +17548,7 @@ var listArgs4 = {
17521
17548
  "effective-status": { type: "string", description: "Comma-separated effective_status filter (overrides default)" },
17522
17549
  "all-statuses": { type: "boolean", description: "Drop the default ACTIVE filter" },
17523
17550
  limit: { type: "string", description: "Max rows (default 1000)" },
17524
- "skip-cache": { type: "boolean", description: "Bypass server-side cache" },
17551
+ "no-cache": NO_CACHE_ARG,
17525
17552
  output: { type: "string", description: "Output format", default: "json" }
17526
17553
  };
17527
17554
  var listCommand4 = defineCommand56({
@@ -17539,7 +17566,7 @@ var listCommand4 = defineCommand56({
17539
17566
  if (args["campaign-id"]) params["campaign-id"] = args["campaign-id"];
17540
17567
  if (effectiveStatus) params["effective-status"] = effectiveStatus;
17541
17568
  if (args.limit) params.limit = args.limit;
17542
- if (args["skip-cache"]) params["skip-cache"] = "true";
17569
+ if (args["no-cache"]) params["skip-cache"] = "true";
17543
17570
  const data = await apiGet("/api/ads/meta/ads", params);
17544
17571
  const fmt = csvOrJson(args);
17545
17572
  if (fmt !== "json") {
@@ -17591,7 +17618,7 @@ var listArgs5 = {
17591
17618
  "effective-status": { type: "string", description: "Comma-separated effective_status filter (overrides default)" },
17592
17619
  "all-statuses": { type: "boolean", description: "Drop the default ACTIVE filter" },
17593
17620
  limit: { type: "string", description: "Max rows (default 1000)" },
17594
- "skip-cache": { type: "boolean", description: "Bypass server-side cache" },
17621
+ "no-cache": NO_CACHE_ARG,
17595
17622
  output: { type: "string", description: "Output format", default: "json" }
17596
17623
  };
17597
17624
  var listCommand5 = defineCommand57({
@@ -17608,7 +17635,7 @@ var listCommand5 = defineCommand57({
17608
17635
  if (args["campaign-id"]) params["campaign-id"] = args["campaign-id"];
17609
17636
  if (effectiveStatus) params["effective-status"] = effectiveStatus;
17610
17637
  if (args.limit) params.limit = args.limit;
17611
- if (args["skip-cache"]) params["skip-cache"] = "true";
17638
+ if (args["no-cache"]) params["skip-cache"] = "true";
17612
17639
  const data = await apiGet("/api/ads/meta/adsets", params);
17613
17640
  const fmt = csvOrJson(args);
17614
17641
  if (fmt !== "json") {
@@ -17654,7 +17681,7 @@ import { defineCommand as defineCommand58 } from "citty";
17654
17681
  var listArgs6 = {
17655
17682
  "account-id": { type: "string", description: "Meta ad account ID" },
17656
17683
  limit: { type: "string", description: "Max rows" },
17657
- "skip-cache": { type: "boolean", description: "Bypass server-side cache" },
17684
+ "no-cache": NO_CACHE_ARG,
17658
17685
  output: { type: "string", description: "Output format", default: "json" }
17659
17686
  };
17660
17687
  var listCommand6 = defineCommand58({
@@ -17668,7 +17695,7 @@ var listCommand6 = defineCommand58({
17668
17695
  try {
17669
17696
  const params = { "account-id": accountId };
17670
17697
  if (args.limit) params.limit = args.limit;
17671
- if (args["skip-cache"]) params["skip-cache"] = "true";
17698
+ if (args["no-cache"]) params["skip-cache"] = "true";
17672
17699
  const data = await apiGet("/api/ads/meta/audiences", params);
17673
17700
  const fmt = csvOrJson(args);
17674
17701
  if (fmt !== "json") {
@@ -17715,13 +17742,13 @@ Examples:
17715
17742
  baker ads meta businesses`
17716
17743
  },
17717
17744
  args: {
17718
- "skip-cache": { type: "boolean", description: "Bypass server-side cache" },
17745
+ "no-cache": NO_CACHE_ARG,
17719
17746
  output: { type: "string", description: "Output format", default: "json" }
17720
17747
  },
17721
17748
  run: async ({ args }) => {
17722
17749
  try {
17723
17750
  const params = {};
17724
- if (args["skip-cache"]) params["skip-cache"] = "true";
17751
+ if (args["no-cache"]) params["skip-cache"] = "true";
17725
17752
  const data = await apiGet("/api/ads/meta/businesses", params);
17726
17753
  const fmt = csvOrJson(args);
17727
17754
  if (fmt !== "json") {
@@ -17742,7 +17769,7 @@ var listArgs7 = {
17742
17769
  "effective-status": { type: "string", description: "Comma-separated effective_status filter (overrides default)" },
17743
17770
  "all-statuses": { type: "boolean", description: "Drop the default ACTIVE filter and return everything" },
17744
17771
  limit: { type: "string", description: "Max rows (default 1000)" },
17745
- "skip-cache": { type: "boolean", description: "Bypass server-side cache" },
17772
+ "no-cache": NO_CACHE_ARG,
17746
17773
  output: { type: "string", description: "Output format", default: "json" }
17747
17774
  };
17748
17775
  var listCommand7 = defineCommand60({
@@ -17758,7 +17785,7 @@ var listCommand7 = defineCommand60({
17758
17785
  const params = { "account-id": accountId };
17759
17786
  if (effectiveStatus) params["effective-status"] = effectiveStatus;
17760
17787
  if (args.limit) params.limit = args.limit;
17761
- if (args["skip-cache"]) params["skip-cache"] = "true";
17788
+ if (args["no-cache"]) params["skip-cache"] = "true";
17762
17789
  const data = await apiGet("/api/ads/meta/campaigns", params);
17763
17790
  const fmt = csvOrJson(args);
17764
17791
  if (fmt !== "json") {
@@ -17810,7 +17837,7 @@ var listArgs8 = {
17810
17837
  "account-id": { type: "string", description: "Meta ad account ID (required if no --creative-id)" },
17811
17838
  "creative-id": { type: "string", description: "Single creative ID" },
17812
17839
  limit: { type: "string", description: "Max rows (default 500)" },
17813
- "skip-cache": { type: "boolean", description: "Bypass server-side cache" },
17840
+ "no-cache": NO_CACHE_ARG,
17814
17841
  output: { type: "string", description: "Output format", default: "json" }
17815
17842
  };
17816
17843
  var listCommand8 = defineCommand61({
@@ -17829,7 +17856,7 @@ var listCommand8 = defineCommand61({
17829
17856
  params["account-id"] = accountId;
17830
17857
  }
17831
17858
  if (args.limit) params.limit = args.limit;
17832
- if (args["skip-cache"]) params["skip-cache"] = "true";
17859
+ if (args["no-cache"]) params["skip-cache"] = "true";
17833
17860
  const data = await apiGet("/api/ads/meta/creatives", params);
17834
17861
  const fmt = csvOrJson(args);
17835
17862
  if (Array.isArray(data) && fmt !== "json") {
@@ -18207,7 +18234,7 @@ function buildBody(args) {
18207
18234
  useAccountAttributionSetting: Boolean(args["use-account-attribution"]),
18208
18235
  useUnifiedAttributionSetting: Boolean(args["use-unified-attribution"]),
18209
18236
  limit: args.limit ? Number(args.limit) : 1e3,
18210
- skipCache: Boolean(args["skip-cache"])
18237
+ skipCache: Boolean(args["no-cache"])
18211
18238
  };
18212
18239
  applyDateRange(body, args);
18213
18240
  return body;
@@ -18320,7 +18347,7 @@ Async is automatic for heavy queries; pass --async to force it, or --no-async to
18320
18347
  // while nothing consumes it.
18321
18348
  async: { type: "boolean", description: "Force the async submit-and-poll path (--no-async refuses it)" },
18322
18349
  "no-sort": { type: "boolean", description: "Skip default spend-desc sort" },
18323
- "skip-cache": { type: "boolean", description: "Bypass server-side cache" },
18350
+ "no-cache": NO_CACHE_ARG,
18324
18351
  output: { type: "string", description: "Output format", default: "json" }
18325
18352
  },
18326
18353
  run: async ({ args }) => {
@@ -18395,13 +18422,13 @@ Examples:
18395
18422
  baker ads meta pages`
18396
18423
  },
18397
18424
  args: {
18398
- "skip-cache": { type: "boolean", description: "Bypass server-side cache" },
18425
+ "no-cache": NO_CACHE_ARG,
18399
18426
  output: { type: "string", description: "Output format", default: "json" }
18400
18427
  },
18401
18428
  run: async ({ args }) => {
18402
18429
  try {
18403
18430
  const params = {};
18404
- if (args["skip-cache"]) params["skip-cache"] = "true";
18431
+ if (args["no-cache"]) params["skip-cache"] = "true";
18405
18432
  const data = await apiGet("/api/ads/meta/pages", params);
18406
18433
  const fmt = csvOrJson(args);
18407
18434
  if (fmt !== "json") {
@@ -18437,7 +18464,7 @@ Examples:
18437
18464
  default: "event"
18438
18465
  },
18439
18466
  days: { type: "string", description: "Lookback days for --stats (default 7)" },
18440
- "skip-cache": { type: "boolean", description: "Bypass server-side cache" },
18467
+ "no-cache": NO_CACHE_ARG,
18441
18468
  output: { type: "string", description: "Output format", default: "json" }
18442
18469
  },
18443
18470
  run: async ({ args }) => {
@@ -18467,14 +18494,14 @@ async function runStats(args) {
18467
18494
  "start-time": daysAgoIso(days),
18468
18495
  "end-time": todayIso()
18469
18496
  };
18470
- if (args["skip-cache"]) params["skip-cache"] = "true";
18497
+ if (args["no-cache"]) params["skip-cache"] = "true";
18471
18498
  const data = await apiGet("/api/ads/meta/pixel-stats", params);
18472
18499
  emit(data, args);
18473
18500
  }
18474
18501
  async function runList(args) {
18475
18502
  const accountId = resolveAccountIdArg(args);
18476
18503
  const params = { "account-id": accountId };
18477
- if (args["skip-cache"]) params["skip-cache"] = "true";
18504
+ if (args["no-cache"]) params["skip-cache"] = "true";
18478
18505
  const { pixels, restrictedFields } = await apiGet("/api/ads/meta/pixels", params);
18479
18506
  emit(pixels, args, pixelWarnings(restrictedFields));
18480
18507
  }
@@ -18592,7 +18619,7 @@ Examples:
18592
18619
  platform: { type: "string", description: "facebook|instagram \u2014 required for --placement feed, which both report" },
18593
18620
  "list-formats": { type: "boolean", description: "Print the ad_format values and placement mappings, then exit" },
18594
18621
  "out-file": { type: "string", description: "Save iframe HTML to this path" },
18595
- "skip-cache": { type: "boolean", description: "Bypass server-side cache" }
18622
+ "no-cache": NO_CACHE_ARG
18596
18623
  },
18597
18624
  run: async ({ args }) => {
18598
18625
  if (args["list-formats"]) {
@@ -18620,7 +18647,7 @@ Examples:
18620
18647
  if (args["ad-id"]) body.adId = args["ad-id"];
18621
18648
  if (args["account-id"]) body.accountId = args["account-id"];
18622
18649
  if (args.creative) body.creative = args.creative;
18623
- if (args["skip-cache"]) body.skipCache = true;
18650
+ if (args["no-cache"]) body.skipCache = true;
18624
18651
  try {
18625
18652
  const data = await apiPost("/api/ads/meta/preview", body);
18626
18653
  const html = data.map((d) => d.body).join("\n");
@@ -45061,8 +45088,10 @@ Introspection: Run 'baker schema <command>' to inspect argument schemas.`
45061
45088
  schema: schemaCommand
45062
45089
  }
45063
45090
  });
45091
+ process.argv = [...process.argv.slice(0, 2), ...normalizeCacheFlag(process.argv.slice(2))];
45064
45092
  installStreamTaps();
45065
45093
  logInvocation(process.argv.slice(2));
45066
45094
  refuseUnknownFlags(main, process.argv.slice(2));
45095
+ process.argv = [...process.argv.slice(0, 2), ...cacheFlagForParser(process.argv.slice(2))];
45067
45096
  runMain(main);
45068
45097
  //# sourceMappingURL=cli.js.map