@koda-sl/baker-cli 0.240.0 → 0.242.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
@@ -12529,6 +12529,20 @@ var analyticsCampaignRowSchema = z24.object({
12529
12529
  utmSource: z24.string(),
12530
12530
  utmMedium: z24.string(),
12531
12531
  utmCampaign: z24.string(),
12532
+ /**
12533
+ * The platform a click id proves, or `""` when the visit carried none.
12534
+ *
12535
+ * What separates a campaign the ad breakdown already reports — with its
12536
+ * platform proven and its ad set and ad underneath — from one nothing else
12537
+ * can show: the newsletter, the partner link, the hand-tagged post. The two
12538
+ * are otherwise identical, because `utm_campaign={campaignid}` is the normal
12539
+ * tagging convention and produces the same ids in both places.
12540
+ *
12541
+ * Kept on the row rather than filtered out here: a CLI hint reads an empty
12542
+ * campaign list as "no campaign tagging on any traffic", and dropping the
12543
+ * paid ones would make that fire on a perfectly tagged account.
12544
+ */
12545
+ clickPlatform: z24.string(),
12532
12546
  sessions: z24.number().int().nonnegative(),
12533
12547
  conversions: z24.number().int().nonnegative(),
12534
12548
  conversionRate: z24.number().min(0).max(1).nullable()
@@ -13241,7 +13255,8 @@ var analyticsTrackingPlatformSchema = z24.object({
13241
13255
  /** The pairs to append to the account's tagging, or `""`. */
13242
13256
  suffix: z24.string(),
13243
13257
  whereItGoes: z24.string(),
13244
- fix: z24.string().optional()
13258
+ /** Which level to put them at, who can write it, and how an existing value is treated. */
13259
+ fix: z24.string()
13245
13260
  });
13246
13261
  var analyticsTrackingResponseSchema = z24.object({
13247
13262
  ok: z24.literal(true),
@@ -19159,6 +19174,13 @@ var campaignCreateSchema3 = z25.object({
19159
19174
  dailyBudget: moneySchema2.optional(),
19160
19175
  lifetimeBudget: moneySchema2.optional(),
19161
19176
  spendCap: moneySchema2.optional(),
19177
+ /**
19178
+ * Ad-set budget sharing: lets ad sets lend up to 20% of their budget to each
19179
+ * other. Meta requires an explicit true/false on any campaign that carries no
19180
+ * campaign budget (subcode 4834011); Baker sends false unless asked, because
19181
+ * turning it on moves real spend between ad sets nobody asked to move.
19182
+ */
19183
+ adSetBudgetSharing: z25.boolean().optional(),
19162
19184
  start_time: z25.number().int().positive().optional(),
19163
19185
  stop_time: z25.number().int().positive().optional()
19164
19186
  }).superRefine((p, ctx) => {
@@ -19871,6 +19893,7 @@ function campaignPayloadFromFlags2(args) {
19871
19893
  dailyBudget: parseMoneyFlag2(args["daily-budget"], args.currency, "--daily-budget"),
19872
19894
  lifetimeBudget: parseMoneyFlag2(args["lifetime-budget"], args.currency, "--lifetime-budget"),
19873
19895
  spendCap: parseMoneyFlag2(args["spend-cap"], args.currency, "--spend-cap"),
19896
+ adSetBudgetSharing: args["adset-budget-sharing"] === void 0 ? void 0 : Boolean(args["adset-budget-sharing"]),
19874
19897
  start_time: parseDateFlag2(args.start, "--start"),
19875
19898
  stop_time: parseDateFlag2(args.stop, "--stop")
19876
19899
  };
@@ -19904,6 +19927,10 @@ Example: baker ads meta campaigns create --name "Q3 Prospecting" --objective OUT
19904
19927
  "special-ad-categories": { type: "string", description: "CSV: NONE|HOUSING|EMPLOYMENT|CREDIT|\u2026 (default NONE)" },
19905
19928
  "special-ad-category-country": { type: "string", description: "CSV of 2-letter country codes" },
19906
19929
  "buying-type": { type: "string", description: "AUCTION|RESERVED (default AUCTION)" },
19930
+ "adset-budget-sharing": {
19931
+ type: "boolean",
19932
+ description: "Let ad sets lend up to 20% of their budget to each other (off unless set; ignored with a campaign budget)"
19933
+ },
19907
19934
  ...campaignBudgetArgs,
19908
19935
  file: { type: "string", description: "JSON file with the full payload; flags override file keys" }
19909
19936
  },
@@ -20055,6 +20082,7 @@ function creativePayloadFromFlags(args) {
20055
20082
  imageRef: args["image-ref"],
20056
20083
  videoId: args["video-id"],
20057
20084
  videoRef: args["video-ref"],
20085
+ thumbnailHash: args["thumbnail-hash"],
20058
20086
  url_tags: args["url-tags"],
20059
20087
  enhancements
20060
20088
  };
@@ -20089,6 +20117,10 @@ Example: baker ads meta creatives create --page 555 --message "Save now" --link
20089
20117
  "image-ref": { type: "string", description: "meta_temp_* ref of a staged media upload" },
20090
20118
  "video-id": { type: "string", description: "Meta video id (already uploaded)" },
20091
20119
  "video-ref": { type: "string", description: "meta_temp_* ref of a staged video upload" },
20120
+ "thumbnail-hash": {
20121
+ type: "string",
20122
+ description: "Cover image hash for a video ad (Meta's own cover is used when omitted)"
20123
+ },
20092
20124
  "url-tags": { type: "string", description: "URL tracking params (utm_source=fb&\u2026)" },
20093
20125
  "standard-enhancements": { type: "string", description: "Advantage+ Creative standard enhancements on|off" },
20094
20126
  file: { type: "string", description: "JSON file with the full creative payload (carousel cards / dynamic assets)" }
@@ -23279,8 +23311,18 @@ function buildAnalyticsHints(data, platform) {
23279
23311
  "No campaign tagging on any traffic \u2014 ad clicks cannot be attributed to a campaign until the destination URLs carry utm parameters."
23280
23312
  );
23281
23313
  }
23314
+ hints.push(...campaignOriginHints(data.topCampaigns));
23282
23315
  return hints;
23283
23316
  }
23317
+ function campaignOriginHints(rows) {
23318
+ const campaigns = rows ?? [];
23319
+ const fromAds = campaigns.filter((row) => row.clickPlatform !== "");
23320
+ if (fromAds.length === 0) return [];
23321
+ const own = campaigns.length - fromAds.length;
23322
+ return [
23323
+ `${fromAds.length} of these campaigns arrived on an ad click (\`clickPlatform\` is set). \`baker analytics ads --role campaign_id\` MAY report the same campaigns under the platform's own ids \u2014 check before you quote both, or you will count one campaign twice. It may equally report nothing: \`ads\` only reads parameters the account tags separately, and \`utm_campaign\` is reserved and never reaches it, so an account whose only campaign signal is \`utm_campaign\` has its campaigns HERE and nowhere else. Never report "no campaigns" on the strength of an empty \`ads\`. ${own === 0 ? "Every row here came from an ad." : `The other ${own} carry no click id at all \u2014 a newsletter, a partner link, a tagged post \u2014 and only this report can show them.`}`
23324
+ ];
23325
+ }
23284
23326
 
23285
23327
  // src/commands/analytics/presets.ts
23286
23328
  var ANALYTICS_PRESET_INFO = [
@@ -24002,7 +24044,7 @@ var trackingCommand = (() => {
24002
24044
  Read this before auditing an ad account and before answering any "which ad performed best" question. Each dimension comes back in one of four states, and they need different things:
24003
24045
  covered \u2014 arriving and understood, nothing to do
24004
24046
  unmapped \u2014 the URLs carry it under a name Baker does not read yet. Free to fix, and it repairs the traffic already collected: run the \`mapCommand\` in the response
24005
- missing \u2014 nothing carries it. Add \`suffix\` to the account's tagging (\`whereItGoes\` says where, \`fix\` says whether Baker can stage it). This one cannot be filled in later \u2014 a parameter's values are only stored once it starts arriving
24047
+ missing \u2014 nothing carries it. \`fix\` says which LEVELS that platform accepts tagging at (widest first \u2014 prefer it), which Baker can stage and which the user must do by hand, and how each field treats what is already in it. \`suffix\` is only the MISSING pairs, so read the current value, add them, write the union. This one cannot be filled in later \u2014 a parameter's values are only stored once it starts arriving
24006
24048
  unknown \u2014 no visit arrived AND the account could not be read. Not a finding; do not report it as untagged
24007
24049
 
24008
24050
  Baker reads the client's own Google tracking templates and Meta URL parameters, so a platform that has not run yet still gets a real answer.