@koda-sl/baker-cli 0.352.0-dev.fabc18041 → 0.352.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
|
@@ -68,7 +68,7 @@ import {
|
|
|
68
68
|
validateCanvasDeep,
|
|
69
69
|
withoutCastName,
|
|
70
70
|
ytDlpBlockSignal
|
|
71
|
-
} from "./chunk-
|
|
71
|
+
} from "./chunk-4HRJQGVW.js";
|
|
72
72
|
import {
|
|
73
73
|
csvOrJson,
|
|
74
74
|
daysAgoIso,
|
|
@@ -11035,41 +11035,6 @@ function adCopyHints(payload) {
|
|
|
11035
11035
|
return tells.slice(0, MAX_HINTS).map(hintFor);
|
|
11036
11036
|
}
|
|
11037
11037
|
|
|
11038
|
-
// src/commands/ads/google/copy-list-usage.ts
|
|
11039
|
-
var AD_COPY_LIST_USAGE = `repeat the flag once per item, or pass one comma-separated list and wrap an item that contains a comma in double quotes: '"Fast, free quotes",Book today'. A flag given once is read as a list, so a lone item with a comma needs its double quotes too: '"Fast, free quotes"'`;
|
|
11040
|
-
var COPY_LIST_FLAG = {
|
|
11041
|
-
headlines: "--headlines",
|
|
11042
|
-
descriptions: "--descriptions",
|
|
11043
|
-
longHeadlines: "--long-headlines"
|
|
11044
|
-
};
|
|
11045
|
-
function valueAt(root, path48) {
|
|
11046
|
-
let node = root;
|
|
11047
|
-
for (const key of path48) {
|
|
11048
|
-
if (node === null || typeof node !== "object") return void 0;
|
|
11049
|
-
node = node[key];
|
|
11050
|
-
}
|
|
11051
|
-
return node;
|
|
11052
|
-
}
|
|
11053
|
-
function countRefusal(op, issue) {
|
|
11054
|
-
if (issue.code !== "too_big" && issue.code !== "too_small" || issue.origin !== "array") return void 0;
|
|
11055
|
-
const flag = COPY_LIST_FLAG[String(issue.path.at(-1))];
|
|
11056
|
-
if (!flag) return void 0;
|
|
11057
|
-
const value = valueAt(op, issue.path);
|
|
11058
|
-
const count2 = Array.isArray(value) ? value.length : void 0;
|
|
11059
|
-
return issue.code === "too_big" ? { flag, count: count2, bound: `at most ${issue.maximum}`, tooMany: true } : { flag, count: count2, bound: `at least ${issue.minimum}`, tooMany: false };
|
|
11060
|
-
}
|
|
11061
|
-
function copyListCountFix(op, issues) {
|
|
11062
|
-
const refusals = issues.map((issue) => countRefusal(op, issue));
|
|
11063
|
-
if (refusals.length === 0 || refusals.some((refusal) => refusal === void 0)) return void 0;
|
|
11064
|
-
const counted = refusals.filter((refusal) => refusal !== void 0);
|
|
11065
|
-
const limits = counted.map(({ flag, count: count2, bound }) => `${flag} has ${count2 ?? "the wrong number of"} items; this ad takes ${bound}.`).join(" ");
|
|
11066
|
-
const commaCause = counted.some((refusal) => refusal.tooMany) ? ` If you meant fewer items, the copy was cut at its commas: a flag given once is read as a comma-separated list, so an item with a comma in it ("Fast, free quotes", a decimal like "4,5/5") becomes two. To keep a comma, ${AD_COPY_LIST_USAGE} \u2014 or put the content in --file as JSON.` : "";
|
|
11067
|
-
return {
|
|
11068
|
-
action: "fix_copy_list_count",
|
|
11069
|
-
explanation: `${limits}${commaCause} ${commaCause ? "Otherwise add" : "Add"} or drop items to fit the limit, then stage again; the field names are right.`
|
|
11070
|
-
};
|
|
11071
|
-
}
|
|
11072
|
-
|
|
11073
11038
|
// src/commands/ads/google/draft-status.ts
|
|
11074
11039
|
var OPERATION_LABELS = {
|
|
11075
11040
|
create: "Creating",
|
|
@@ -11390,7 +11355,7 @@ async function stageGoogleOp(raw, hints2) {
|
|
|
11390
11355
|
code: "VALIDATION_ERROR",
|
|
11391
11356
|
message: fields.map((f) => f.path ? `${f.path}: ${f.message}` : f.message).join("; "),
|
|
11392
11357
|
fields,
|
|
11393
|
-
fix:
|
|
11358
|
+
fix: capabilityFix("google-ads")
|
|
11394
11359
|
}
|
|
11395
11360
|
});
|
|
11396
11361
|
process.exit(1);
|
|
@@ -11426,7 +11391,7 @@ async function stageGoogleOps(rawOps, hints2) {
|
|
|
11426
11391
|
code: "VALIDATION_ERROR",
|
|
11427
11392
|
message: fields.map((f) => `${f.path}: ${f.message}`).join("; "),
|
|
11428
11393
|
fields,
|
|
11429
|
-
fix:
|
|
11394
|
+
fix: capabilityFix("google-ads")
|
|
11430
11395
|
}
|
|
11431
11396
|
});
|
|
11432
11397
|
process.exit(1);
|
|
@@ -16833,6 +16798,7 @@ import { defineCommand as defineCommand31 } from "citty";
|
|
|
16833
16798
|
|
|
16834
16799
|
// src/commands/ads/google/ad-copy-flags.ts
|
|
16835
16800
|
var AD_COPY_LIST_FLAGS = ["headlines", "descriptions", "long-headlines"];
|
|
16801
|
+
var AD_COPY_LIST_USAGE = `repeat the flag once per item, or pass one comma-separated list and wrap an item that contains a comma in double quotes: '"Fast, free quotes",Book today'. A flag given once is read as a list, so a lone item with a comma needs its double quotes too: '"Fast, free quotes"'`;
|
|
16836
16802
|
function skipBlanks(value, at) {
|
|
16837
16803
|
let i = at;
|
|
16838
16804
|
while (value[i] === " " || value[i] === " ") i++;
|