@koda-sl/baker-cli 0.307.0-dev.25b4836d3 → 0.307.0-dev.ddf2902ef

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
@@ -23163,20 +23163,6 @@ var lookalikeSpecSchema = z31.object({
23163
23163
  ratio: z31.number().min(0.01).max(0.2).optional(),
23164
23164
  country: z31.string().length(2).optional()
23165
23165
  });
23166
- function valuesOfKey(node, key) {
23167
- if (Array.isArray(node)) return node.flatMap((entry) => valuesOfKey(entry, key));
23168
- if (!node || typeof node !== "object") return [];
23169
- const record = node;
23170
- return [
23171
- ...key in record ? [record[key]] : [],
23172
- ...Object.values(record).flatMap((value) => valuesOfKey(value, key))
23173
- ];
23174
- }
23175
- function mixedEventSourceTypes(rule) {
23176
- const types = valuesOfKey(rule, "event_sources").flatMap((sources) => Array.isArray(sources) ? sources : []).map((source) => source?.type).filter((type) => typeof type === "string");
23177
- const distinct = [...new Set(types)].sort();
23178
- return distinct.length > 1 ? distinct : [];
23179
- }
23180
23166
  var customAudienceCreateSchema = z31.object({
23181
23167
  name: z31.string().min(1).max(META_LIMITS.audience.nameMax),
23182
23168
  subtype: z31.enum(CUSTOM_AUDIENCE_SUBTYPES),
@@ -23193,21 +23179,6 @@ var customAudienceCreateSchema = z31.object({
23193
23179
  if ((p.subtype === "WEBSITE" || p.subtype === "ENGAGEMENT") && !p.rule) {
23194
23180
  ctx.addIssue({ code: "custom", path: ["rule"], message: `${p.subtype} audiences need a rule (use --file)` });
23195
23181
  }
23196
- if (p.rule && p.retention_days !== void 0) {
23197
- ctx.addIssue({
23198
- code: "custom",
23199
- path: ["retention_days"],
23200
- message: "a rule carries its own window in retention_seconds, so drop retention_days \u2014 Meta takes it only on a customer-file audience, and sending both leaves the review showing a window the audience will not have"
23201
- });
23202
- }
23203
- const mixed = mixedEventSourceTypes(p.rule);
23204
- if (mixed.length > 0) {
23205
- ctx.addIssue({
23206
- code: "custom",
23207
- path: ["rule"],
23208
- message: `one audience covers one kind of source, but this rule mixes ${mixed.join(" and ")} \u2014 split it into one audience per source`
23209
- });
23210
- }
23211
23182
  });
23212
23183
  var customAudienceUpdateSchema = z31.object({
23213
23184
  name: z31.string().min(1).max(META_LIMITS.audience.nameMax).optional(),
@@ -23948,7 +23919,6 @@ var audiencesCreateCommand2 = defineCommand57({
23948
23919
  name: "create",
23949
23920
  description: `Stage a new custom audience shell. ${STAGED_NOTE2}
23950
23921
  LOOKALIKE/WEBSITE/ENGAGEMENT specifics go via --file (lookalike_spec / rule). Member-list upload is not staged in v1.
23951
- A WEBSITE/ENGAGEMENT rule carries its own window in retention_seconds, so --retention-days is refused next to one, and one audience covers one kind of event source (a Page and an Instagram profile are two audiences).
23952
23922
  Example: baker ads meta audiences create --name "Site visitors 30d" --subtype WEBSITE --file rule.json`
23953
23923
  },
23954
23924
  args: {
@@ -23956,10 +23926,7 @@ Example: baker ads meta audiences create --name "Site visitors 30d" --subtype WE
23956
23926
  name: { type: "string", description: "Audience name" },
23957
23927
  subtype: { type: "string", description: "CUSTOM|WEBSITE|ENGAGEMENT|LOOKALIKE" },
23958
23928
  description: { type: "string", description: "Description" },
23959
- "retention-days": {
23960
- type: "string",
23961
- description: "Retention window in days \u2014 customer-file audiences only; a rule carries its own retention_seconds"
23962
- },
23929
+ "retention-days": { type: "string", description: "Retention window in days" },
23963
23930
  file: { type: "string", description: "JSON file with lookalike_spec / rule / full payload" }
23964
23931
  },
23965
23932
  run: async ({ args: args4 }) => {
@@ -59541,7 +59508,7 @@ registerSchema({
59541
59508
  },
59542
59509
  sort: {
59543
59510
  type: "string",
59544
- description: "Sort: search_volume, competition, cpc (default: search_volume)",
59511
+ description: "Sort: relevance, search_volume, competition, cpc (default: search_volume)",
59545
59512
  required: false
59546
59513
  },
59547
59514
  type: { type: "string", description: "Filter: paid, organic, all (default: all)", required: false },
@@ -59570,7 +59537,7 @@ Examples:
59570
59537
  target: { type: "positional", description: "Domain or URL to analyze", required: true },
59571
59538
  location: { type: "string", description: "Country code or location code (default: us)", required: false },
59572
59539
  language: { type: "string", description: "Language code or name (default: en)", required: false },
59573
- sort: { type: "string", description: "Sort: search_volume, competition, cpc", required: false },
59540
+ sort: { type: "string", description: "Sort: relevance, search_volume, competition, cpc", required: false },
59574
59541
  type: { type: "string", description: "Filter: paid, organic, all (default: all)", required: false },
59575
59542
  limit: { type: "string", description: "Max results (default: 50, max: 1000)", required: false },
59576
59543
  output: { type: "string", description: "Format: json|csv|md|jsonl", required: false, default: "json" },