@koda-sl/baker-cli 0.386.0 → 0.387.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
@@ -24660,7 +24660,22 @@ function buildCustomConversionRule(input) {
24660
24660
  };
24661
24661
  }
24662
24662
  function customConversionRuleRefusal(rule) {
24663
- return ruleNodeRefusal(rule, "rule");
24663
+ const refusal = ruleNodeRefusal(rule, "rule");
24664
+ if (refusal) {
24665
+ return refusal;
24666
+ }
24667
+ if (!ruleFields(rule).some((field) => field !== "event")) {
24668
+ return 'rule only names the event, and Meta refuses a custom conversion with no condition beyond it \u2014 narrow it with a URL, referrer or event parameter the event carries, e.g. {"and":[{"event":{"eq":"Lead"}},{"URL":{"i_contains":"/gracias"}}]}';
24669
+ }
24670
+ return void 0;
24671
+ }
24672
+ function ruleFields(node) {
24673
+ if (!isRecord2(node)) {
24674
+ return [];
24675
+ }
24676
+ return Object.entries(node).flatMap(
24677
+ ([key, value]) => (key === "and" || key === "or") && Array.isArray(value) ? value.flatMap(ruleFields) : [key]
24678
+ );
24664
24679
  }
24665
24680
  function branchRefusal(key, value, path48) {
24666
24681
  if (!Array.isArray(value) || value.length === 0) {