@koda-sl/baker-cli 0.105.0-dev.2a665c873 → 0.105.1

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
@@ -9,7 +9,7 @@ import {
9
9
  defaultRegistry,
10
10
  generateCatalog,
11
11
  validateCanvasDeep
12
- } from "./chunk-26K7V346.js";
12
+ } from "./chunk-3JVYU72O.js";
13
13
 
14
14
  // src/cli.ts
15
15
  import { defineCommand as defineCommand152, runMain } from "citty";
@@ -2623,12 +2623,12 @@ function buildCommand(query, ctx) {
2623
2623
  return `baker ads google query "${query}" --customer-id ${ctx.customerId}`;
2624
2624
  }
2625
2625
  var CORRECTION_RULES = [
2626
- // 1. keyword.text → ad_group_criterion.keyword.text
2626
+ // 1. bare keyword.text → ad_group_criterion.keyword.text (leaves <resource>.keyword.text untouched)
2627
2627
  {
2628
- matchQuery: /\bkeyword\.text\b/,
2628
+ matchQuery: /(?<![\w.])keyword\.text\b/,
2629
2629
  matchApiError: /keyword\.text/i,
2630
2630
  fix: (ctx) => {
2631
- const corrected = ctx.originalQuery.replace(/\bkeyword\.text\b/g, "ad_group_criterion.keyword.text");
2631
+ const corrected = ctx.originalQuery.replace(/(?<![\w.])keyword\.text\b/g, "ad_group_criterion.keyword.text");
2632
2632
  return {
2633
2633
  action: "retry_with_modified_query",
2634
2634
  correctedCommand: buildCommand(corrected, ctx),
@@ -2636,12 +2636,15 @@ var CORRECTION_RULES = [
2636
2636
  };
2637
2637
  }
2638
2638
  },
2639
- // 2. keyword.match_type → ad_group_criterion.keyword.match_type
2639
+ // 2. bare keyword.match_type → ad_group_criterion.keyword.match_type (leaves <resource>.keyword.match_type untouched)
2640
2640
  {
2641
- matchQuery: /\bkeyword\.match_type\b/,
2641
+ matchQuery: /(?<![\w.])keyword\.match_type\b/,
2642
2642
  matchApiError: /keyword\.match_type/i,
2643
2643
  fix: (ctx) => {
2644
- const corrected = ctx.originalQuery.replace(/\bkeyword\.match_type\b/g, "ad_group_criterion.keyword.match_type");
2644
+ const corrected = ctx.originalQuery.replace(
2645
+ /(?<![\w.])keyword\.match_type\b/g,
2646
+ "ad_group_criterion.keyword.match_type"
2647
+ );
2645
2648
  return {
2646
2649
  action: "retry_with_modified_query",
2647
2650
  correctedCommand: buildCommand(corrected, ctx),
@@ -3993,12 +3996,12 @@ function buildCommand2(query, customerId) {
3993
3996
  function applyAutoFixes(query, limit) {
3994
3997
  let corrected = query;
3995
3998
  const warnings = [];
3996
- if (/\bkeyword\.text\b/.test(corrected) && !/ad_group_criterion\.keyword\.text/.test(corrected)) {
3997
- corrected = corrected.replace(/\bkeyword\.text\b/g, "ad_group_criterion.keyword.text");
3999
+ if (/(?<![\w.])keyword\.text\b/.test(corrected)) {
4000
+ corrected = corrected.replace(/(?<![\w.])keyword\.text\b/g, "ad_group_criterion.keyword.text");
3998
4001
  warnings.push({ code: "FIELD_RENAMED", message: "keyword.text \u2192 ad_group_criterion.keyword.text" });
3999
4002
  }
4000
- if (/\bkeyword\.match_type\b/.test(corrected) && !/ad_group_criterion\.keyword\.match_type/.test(corrected)) {
4001
- corrected = corrected.replace(/\bkeyword\.match_type\b/g, "ad_group_criterion.keyword.match_type");
4003
+ if (/(?<![\w.])keyword\.match_type\b/.test(corrected)) {
4004
+ corrected = corrected.replace(/(?<![\w.])keyword\.match_type\b/g, "ad_group_criterion.keyword.match_type");
4002
4005
  warnings.push({ code: "FIELD_RENAMED", message: "keyword.match_type \u2192 ad_group_criterion.keyword.match_type" });
4003
4006
  }
4004
4007
  if (/shopping_performance_view\.product_\w+/.test(corrected)) {