@koda-sl/baker-cli 0.145.0 → 0.147.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
@@ -34,7 +34,7 @@ import {
34
34
  toModelSafeImage,
35
35
  ulid,
36
36
  validateCanvasDeep
37
- } from "./chunk-TAGQCU36.js";
37
+ } from "./chunk-2F5SCTNS.js";
38
38
  import {
39
39
  csvOrJson,
40
40
  daysAgoIso,
@@ -7099,17 +7099,34 @@ var budgetsCommand = defineCommand29({
7099
7099
  })
7100
7100
  }
7101
7101
  });
7102
+ var MAX_CPC_STRATEGIES = ["TARGET_IMPRESSION_SHARE", "TARGET_SPEND", "PERCENT_CPC"];
7102
7103
  function biddingFromFlags(args) {
7103
7104
  const type = args["bidding-strategy"];
7105
+ const maxCpcMicros = microsFlag(args["max-cpc"], "--max-cpc");
7104
7106
  if (!type) {
7107
+ if (maxCpcMicros !== void 0) {
7108
+ failWriteValidation(
7109
+ "--max-cpc needs --bidding-strategy too (the ceiling belongs to a strategy) \u2014 e.g. --bidding-strategy TARGET_IMPRESSION_SHARE --max-cpc 12"
7110
+ );
7111
+ }
7105
7112
  return void 0;
7106
7113
  }
7114
+ if (maxCpcMicros !== void 0 && !MAX_CPC_STRATEGIES.includes(type.toUpperCase())) {
7115
+ failWriteValidation(`${type} does not take --max-cpc \u2014 only ${MAX_CPC_STRATEGIES.join(", ")} carry a bid ceiling`);
7116
+ }
7107
7117
  return {
7108
7118
  type,
7109
7119
  targetCpaMicros: microsFlag(args["target-cpa"], "--target-cpa"),
7110
- targetRoas: args["target-roas"] !== void 0 ? Number(args["target-roas"]) : void 0
7120
+ targetRoas: args["target-roas"] !== void 0 ? Number(args["target-roas"]) : void 0,
7121
+ cpcBidCeilingMicros: maxCpcMicros
7111
7122
  };
7112
7123
  }
7124
+ var maxCpcArg = {
7125
+ "max-cpc": {
7126
+ type: "string",
7127
+ description: "Max CPC bid ceiling (major units) for TARGET_IMPRESSION_SHARE, TARGET_SPEND or PERCENT_CPC"
7128
+ }
7129
+ };
7113
7130
  var campaignsCommand = defineCommand29({
7114
7131
  meta: { name: "campaigns", description: "Stage campaign create/update/pause/resume/remove" },
7115
7132
  subCommands: {
@@ -7131,6 +7148,7 @@ var campaignsCommand = defineCommand29({
7131
7148
  },
7132
7149
  "target-cpa": { type: "string", description: "Target CPA (major units) for TARGET_CPA" },
7133
7150
  "target-roas": { type: "string", description: "Target ROAS (e.g. 4.0) for TARGET_ROAS" },
7151
+ ...maxCpcArg,
7134
7152
  objective: { type: "string", description: "Advisory UI objective (SALES, LEADS, \u2026)" },
7135
7153
  "start-date": { type: "string", description: "YYYY-MM-DD" },
7136
7154
  "end-date": { type: "string", description: "YYYY-MM-DD" },
@@ -7162,6 +7180,7 @@ var campaignsCommand = defineCommand29({
7162
7180
  "bidding-strategy": { type: "string" },
7163
7181
  "target-cpa": { type: "string" },
7164
7182
  "target-roas": { type: "string" },
7183
+ ...maxCpcArg,
7165
7184
  status: { type: "string" }
7166
7185
  },
7167
7186
  run: async ({ args }) => {
@@ -19680,7 +19699,7 @@ var runCommand = defineCommand88({
19680
19699
  "cache-policy": { type: "string", description: "read_write | bypass | read_only" },
19681
19700
  regenerate: {
19682
19701
  type: "string",
19683
- description: "Comma-separated node ids to force fresh THIS run (e.g. --regenerate gen_4x5,gen_9x16), bypassing the content cache for just those nodes + everything downstream. For a persistent re-render, bump a node's `regenerate` field in the canvas JSON instead."
19702
+ description: "Comma-separated node ids to force fresh THIS run (e.g. --regenerate gen,adapt), bypassing the content cache for just those nodes + everything downstream. For a persistent re-render, bump a node's `regenerate` field in the canvas JSON instead."
19684
19703
  },
19685
19704
  concurrency: {
19686
19705
  type: "string",
@@ -19853,6 +19872,10 @@ async function executeCanvasRun(opts) {
19853
19872
  );
19854
19873
  process.exit(2);
19855
19874
  }
19875
+ for (const w of validation.warnings ?? []) {
19876
+ process.stdout.write(`[warn] ${w.code}: ${w.message}
19877
+ `);
19878
+ }
19856
19879
  const canvasSha = sha256Hex(Buffer.from(raw));
19857
19880
  const creativeSlug = creativeSlugFromCanvasPath(filePath) ?? void 0;
19858
19881
  const client = opts.record === false ? null : buildBackendClient();