@koda-sl/baker-cli 0.841.0 → 0.842.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.
Files changed (40) hide show
  1. package/README.md +1 -1
  2. package/dist/{ads-LFNXWHBJ.js → ads-E4RUYTAG.js} +3 -3
  3. package/dist/{analytics-IPNVNP67.js → analytics-YJBTDPVB.js} +51 -31
  4. package/dist/analytics-YJBTDPVB.js.map +1 -0
  5. package/dist/{chunk-QKGQRVXD.js → chunk-2DVR6MUZ.js} +2 -2
  6. package/dist/{chunk-ZGNMTBAO.js → chunk-2GXFGP4M.js} +3 -3
  7. package/dist/{chunk-JURBC37M.js → chunk-B4JDDT7G.js} +2 -2
  8. package/dist/{chunk-AETMQGCV.js → chunk-CDF3COMO.js} +2 -2
  9. package/dist/{chunk-CCSSOEL2.js → chunk-LKTBIO3F.js} +2 -2
  10. package/dist/{chunk-4HSA54W5.js → chunk-PC37FCEC.js} +1 -2
  11. package/dist/cli.js +3 -3
  12. package/dist/{funnel-TBTIJT3T.js → funnel-H46LYEC2.js} +3 -3
  13. package/dist/{google-JB5IGONU.js → google-W4OMVHFC.js} +2 -2
  14. package/dist/{lookup-ESFT4PQW.js → lookup-4W7ERA4E.js} +4 -4
  15. package/dist/{performance-ZCGOHUSV.js → performance-HGAPL346.js} +2 -2
  16. package/dist/{plan-SP7AR5DF.js → plan-VHLLCF4R.js} +3 -3
  17. package/dist/{questionnaire-J7X7VA3U.js → questionnaire-47DIYMVE.js} +3 -3
  18. package/dist/{sends-WLSTRLBF.js → sends-JPPZJUBN.js} +3 -3
  19. package/dist/{sources-CDTMSNJZ.js → sources-I6M4K4DE.js} +4 -4
  20. package/dist/{unstage-ICRBPFH7.js → unstage-K7RYZLA2.js} +3 -3
  21. package/dist/{url-options-H5KOU27L.js → url-options-6ATRBK73.js} +2 -2
  22. package/package.json +1 -1
  23. package/dist/analytics-IPNVNP67.js.map +0 -1
  24. /package/dist/{ads-LFNXWHBJ.js.map → ads-E4RUYTAG.js.map} +0 -0
  25. /package/dist/{chunk-QKGQRVXD.js.map → chunk-2DVR6MUZ.js.map} +0 -0
  26. /package/dist/{chunk-ZGNMTBAO.js.map → chunk-2GXFGP4M.js.map} +0 -0
  27. /package/dist/{chunk-JURBC37M.js.map → chunk-B4JDDT7G.js.map} +0 -0
  28. /package/dist/{chunk-AETMQGCV.js.map → chunk-CDF3COMO.js.map} +0 -0
  29. /package/dist/{chunk-CCSSOEL2.js.map → chunk-LKTBIO3F.js.map} +0 -0
  30. /package/dist/{chunk-4HSA54W5.js.map → chunk-PC37FCEC.js.map} +0 -0
  31. /package/dist/{funnel-TBTIJT3T.js.map → funnel-H46LYEC2.js.map} +0 -0
  32. /package/dist/{google-JB5IGONU.js.map → google-W4OMVHFC.js.map} +0 -0
  33. /package/dist/{lookup-ESFT4PQW.js.map → lookup-4W7ERA4E.js.map} +0 -0
  34. /package/dist/{performance-ZCGOHUSV.js.map → performance-HGAPL346.js.map} +0 -0
  35. /package/dist/{plan-SP7AR5DF.js.map → plan-VHLLCF4R.js.map} +0 -0
  36. /package/dist/{questionnaire-J7X7VA3U.js.map → questionnaire-47DIYMVE.js.map} +0 -0
  37. /package/dist/{sends-WLSTRLBF.js.map → sends-JPPZJUBN.js.map} +0 -0
  38. /package/dist/{sources-CDTMSNJZ.js.map → sources-I6M4K4DE.js.map} +0 -0
  39. /package/dist/{unstage-ICRBPFH7.js.map → unstage-K7RYZLA2.js.map} +0 -0
  40. /package/dist/{url-options-H5KOU27L.js.map → url-options-6ATRBK73.js.map} +0 -0
package/README.md CHANGED
@@ -2174,7 +2174,7 @@ Shared flags: `--days <n>` (default 30) or `--start-date` / `--end-date` (`YYYY-
2174
2174
 
2175
2175
  `--measure` decides whose activity is measured and defaults to `campaigns` (only visitors a Baker landing brought). `--measure all` measures the client's entire website and is a decision somebody has to ask for. `host` is the client's own landing domain when one shares a domain with the site being measured, so the script and its events stay first-party; `firstParty` in the response says which, and removing that domain from Baker means re-running this command.
2176
2176
 
2177
- **Paging the list reports.** `people`, `submissions` and `delivery` are lists of individual things rather than breakdowns — `delivery` and `submissions` are the ones the CLI exposes, `people` backs the People section of the dashboard's landing Analytics screen over the same wire — and only they take `--page <n>` (1-based) and `--page-size <n>` (up to 200, default 50). `--limit <n>` is the same flag as `--page-size`: alone it reads the first n rows (`feed --limit 15` is the newest 15 events), so a list never needs cutting with `head`. The response carries `pageInfo` with `hasMore` — when it is true there **are** more rows, so a total must never be reported from one page. `feed` pages too (up to 200 a page, 1000 with `--fields`), and its page 1 alone also carries `pageInfo.total`: how many rows the whole feed holds under the same filters. Pass neither flag and a list comes back at the size it always did. A value that is not a whole positive number (`--page /pricing`) is refused before any request, naming `--landing` as the flag that narrows a report to one page of the site.
2177
+ **Paging the list reports.** `people`, `submissions` and `delivery` are lists of individual things rather than breakdowns — `delivery` and `submissions` are the ones the CLI exposes, `people` backs the People section of the dashboard's landing Analytics screen over the same wire — and only they take `--page <n>` (1-based) and `--page-size <n>` (up to 200, default 50). `--limit <n>` is the same flag as `--page-size`: alone it reads the first n rows (`feed --limit 15` is the newest 15 events), so a list never needs cutting with `head`. The response carries `pageInfo` with `hasMore` — when it is true there **are** more rows, so a total must never be reported from one page. `feed` pages too (up to 200 a page, 1000 with `--fields`), and its page 1 alone also carries `pageInfo.total`: how many rows the whole feed holds under the same filters. Pass neither flag and a list comes back at its compact size, and with `--full` as one page of 20 — `--full` widens what a list holds, not how many rows one page of it holds. A value that is not a whole positive number (`--page /pricing`) is refused before any request, naming `--landing` as the flag that narrows a report to one page of the site.
2178
2178
 
2179
2179
  **A conversion is a company-level named event, not a property of a Form.** `baker analytics conversions` is the only place "what counts" is decided, and an empty `definitions` list means every conversion number in every other report is zero — not because nobody converted, but because nothing is named as an outcome and Baker never guesses which event is the point of a page. `--candidates` lists every event these pages actually produced — each Form step and trigger, every `data-baker-*` event, every outbound destination — with volume and whether it is already counted; that list is where an event key comes from, so never invent one. The JSON is compact by default: each page or system event is one line (`eventKey`, `events`, `sessions`, `countedAs` when counted), and a Form's keys fold onto its `flows` row as `keys` fired and `events` — dropping that row's empty `counted` and `noConversion` — or onto a `formCandidates` row for a Form not in `flows`. `--candidates --flow <slug>` narrows the list to that Form's keys, and `--full` returns every field (`origin`, `nodeType`, `flowSlug`, `lastSeen`, `sources`, `doors`) of every key, unfolded. `--output md` always folds a Form's keys into one row per Form. `--event <key> --name "Booked a call"` starts counting it **immediately and retroactively**: the whole stored history is rescored, so naming the right event today also fixes last month. Nothing here is staged and publishing is not involved. Two events given the same `--name` become one row and one number, which is how a call booked on three different Forms reads as one outcome. `--count-mode every_time` is for the outcomes people genuinely repeat (a guide downloaded twice is two downloads); the default counts once per visit.
2180
2180
 
@@ -33,16 +33,16 @@ Examples:
33
33
  Full guides: __tooling__/docs/tools/baker/ads-<platform>.md (google|meta|linkedin|x|chatgpt|performance|terms)`
34
34
  },
35
35
  subCommands: {
36
- google: () => import("./google-JB5IGONU.js").then((m) => m.googleCommand),
36
+ google: () => import("./google-W4OMVHFC.js").then((m) => m.googleCommand),
37
37
  meta: () => import("./meta-2ZQ3CWLF.js").then((m) => m.metaCommand),
38
38
  linkedin: () => import("./linkedin-W3R7VFBJ.js").then((m) => m.linkedinCommand),
39
39
  x: () => import("./x-UMY7H7KD.js").then((m) => m.xCommand),
40
40
  chatgpt: () => import("./chatgpt-HBHB7HCD.js").then((m) => m.chatgptCommand),
41
- performance: () => import("./performance-ZCGOHUSV.js").then((m) => m.performanceCommand),
41
+ performance: () => import("./performance-HGAPL346.js").then((m) => m.performanceCommand),
42
42
  terms: () => import("./terms-J33CD7MY.js").then((m) => m.termsCommand)
43
43
  }
44
44
  });
45
45
  export {
46
46
  adsCommand
47
47
  };
48
- //# sourceMappingURL=ads-LFNXWHBJ.js.map
48
+ //# sourceMappingURL=ads-E4RUYTAG.js.map
@@ -15,7 +15,7 @@ import {
15
15
  serverFeedFields,
16
16
  withheldBreakdownHint,
17
17
  writeAnalyticsReport
18
- } from "./chunk-AETMQGCV.js";
18
+ } from "./chunk-CDF3COMO.js";
19
19
  import {
20
20
  flowDataPath,
21
21
  flowExists,
@@ -25,23 +25,23 @@ import {
25
25
  import {
26
26
  peopleArgs,
27
27
  peopleLimitError
28
- } from "./chunk-ZGNMTBAO.js";
28
+ } from "./chunk-2GXFGP4M.js";
29
29
  import {
30
30
  INGEST_ARRIVALS_MAX,
31
31
  eventIngestUrl,
32
32
  ingestBrief
33
- } from "./chunk-JURBC37M.js";
33
+ } from "./chunk-B4JDDT7G.js";
34
34
  import {
35
35
  ConversionArgsError,
36
36
  conversionsWrite,
37
37
  parseConversionsArgs
38
- } from "./chunk-QKGQRVXD.js";
38
+ } from "./chunk-2DVR6MUZ.js";
39
39
  import {
40
40
  TAG_MANAGER_TIMEOUT_MS
41
41
  } from "./chunk-ZWANN4QQ.js";
42
42
  import {
43
43
  analyticsErrorEnvelope
44
- } from "./chunk-CCSSOEL2.js";
44
+ } from "./chunk-LKTBIO3F.js";
45
45
  import {
46
46
  companyNameKey
47
47
  } from "./chunk-AYKV2B6X.js";
@@ -59,13 +59,12 @@ import {
59
59
  ANALYTICS_MAX_PROJECTED_PAGE_SIZE,
60
60
  SEND_FILTERS,
61
61
  STANDARD_CONVERSION_NAMES,
62
- analyticsPageSizeLimit,
63
62
  destinationName,
64
63
  essentialAdDimensions,
65
64
  isAdPlatform,
66
65
  isBookkeepingRow,
67
66
  rowMatchKeys
68
- } from "./chunk-4HSA54W5.js";
67
+ } from "./chunk-PC37FCEC.js";
69
68
  import "./chunk-5TURKO4J.js";
70
69
  import {
71
70
  withWindowSpellings
@@ -732,16 +731,9 @@ function percent(value) {
732
731
  return `${Math.round(value * 100)}%`;
733
732
  }
734
733
  var MIN_SESSIONS_FOR_TAGGING_CLAIM = 20;
735
- function largestDivisorUpTo(size, most) {
736
- for (let divisor = Math.min(size, most); divisor > 1; divisor--) {
737
- if (size % divisor === 0) return divisor;
738
- }
739
- return 1;
740
- }
741
- function nextPage(pageInfo, most) {
742
- const size = pageInfo.pageSize <= most ? pageInfo.pageSize : largestDivisorUpTo(pageInfo.pageSize, most);
743
- const page = pageInfo.page * pageInfo.pageSize / size + 1;
744
- return page <= ANALYTICS_MAX_PAGE ? { page, size } : null;
734
+ function nextPage(pageInfo) {
735
+ const page = pageInfo.page + 1;
736
+ return page <= ANALYTICS_MAX_PAGE ? { page, size: pageInfo.pageSize } : null;
745
737
  }
746
738
  function widenAdvice(read) {
747
739
  return read.full ? "This is already the --full list; narrow --start-date/--end-date or --landing to see past it." : "Pass --full for the longer list.";
@@ -763,17 +755,31 @@ function truncationHint(cut, read) {
763
755
  }
764
756
  function pageHint(data, pageInfo, read) {
765
757
  const last = (pageInfo.page - 1) * pageInfo.pageSize + pageInfo.returned;
766
- const next = nextPage(pageInfo, analyticsPageSizeLimit(data.preset, read.projected === true));
758
+ const next = nextPage(pageInfo);
767
759
  const full = read.full ? "--full " : "";
768
760
  const onward = next ? `pass ${full}--page ${next.page} --page-size ${next.size} for the rows after it, and keep that --page-size to the last page: changing it on the way skips or repeats rows` : "no page reaches the rows after it, so narrow --start-date/--end-date";
769
761
  if (pageInfo.block === "stream")
770
762
  return feedPageHint(pageInfo, { last, onward, size: next?.size ?? pageInfo.pageSize }, read, data);
771
763
  const totals = data.deliverySummary ? " The window's totals are in deliverySummary." : "";
772
- const larger = pageInfo.pageSize < ANALYTICS_MAX_PAGE_SIZE ? ` To read ${ANALYTICS_MAX_PAGE_SIZE} at a time, start again from --page 1 --page-size ${ANALYTICS_MAX_PAGE_SIZE} in place of the rows read so far.` : "";
764
+ const larger = pageInfo.pageSize < ANALYTICS_MAX_PAGE_SIZE && !read.full ? ` To read ${ANALYTICS_MAX_PAGE_SIZE} at a time, start again from --page 1 --page-size ${ANALYTICS_MAX_PAGE_SIZE} in place of the rows read so far.` : "";
765
+ if (pageInfo.block === "deliveries") {
766
+ return `deliveries stops at row ${last} and there are more. ${narrowerDeliveries(read.listNarrowedBy ?? [])} To read on, ${onward}.${larger} Do not report a total from one page.${totals}`;
767
+ }
773
768
  return `${pageInfo.block} stops at row ${last} and there are more \u2014 ${onward}.${larger} Do not report a total from one page.${totals}`;
774
769
  }
770
+ var DELIVERY_NARROWINGS = {
771
+ flow: "one Form with --flow <slug>",
772
+ landing: "one page with --landing <internalId>",
773
+ dates: "fewer days with --start-date/--end-date"
774
+ };
775
+ function narrowerDeliveries(narrowedBy) {
776
+ const left = Object.keys(DELIVERY_NARROWINGS).filter((key) => !narrowedBy.includes(key)).map((key) => DELIVERY_NARROWINGS[key]);
777
+ const narrow = left.length === 0 ? "" : `; narrow this list to ${left.length < 2 ? left.join("") : `${left.slice(0, -1).join(", ")} or ${left[left.length - 1]}`}`;
778
+ return `For one destination, \`baker analytics feed --sent-to <type>\` (meta, googleAds, hubspot\u2026) lists only what went there${narrow} before reading on.`;
779
+ }
775
780
  function feedPageHint(pageInfo, { last, onward, size }, read, { sendOutcomes, redelivery }) {
776
- return `The feed stops at row ${last} and there are more${feedSize(pageInfo.total, size)}. ${feedCountAdvice(read.feedNarrowedBy ?? [], sendOutcomes === void 0 ? void 0 : read.countBy ?? SEND_OUTCOME_KEYS, redelivery !== void 0)} To read more rows, ${onward}.${feedPageSizeAdvice(pageInfo.pageSize)}`;
781
+ const larger = read.full && !read.projected ? "" : feedPageSizeAdvice(pageInfo.pageSize);
782
+ return `The feed stops at row ${last} and there are more${feedSize(pageInfo.total, size)}. ${feedCountAdvice(read.feedNarrowedBy ?? [], sendOutcomes === void 0 ? void 0 : read.countBy ?? SEND_OUTCOME_KEYS, redelivery !== void 0)} To read more rows, ${onward}.${larger}`;
777
783
  }
778
784
  function feedSize(total, pageSize) {
779
785
  if (total === void 0) return "";
@@ -1250,7 +1256,7 @@ var SHARED_ARGS = withWindowSpellings({
1250
1256
  "page-size": {
1251
1257
  type: "string",
1252
1258
  alias: "limit",
1253
- description: "Rows per page, up to 200 (default 50 when --page is given) \u2014 up to 1000 on `feed` read with --fields. Alone it is the first N rows: `feed --limit 15` is the newest 15 events, with pageInfo.hasMore saying whether there are more \u2014 never cut a list with head. Without --page or --page-size a list comes back at its old size, so nothing that worked before changes",
1259
+ description: "Rows per page, up to 200 (default 50 when --page is given) \u2014 up to 1000 on `feed` read with --fields. Alone it is the first N rows: `feed --limit 15` is the newest 15 events, with pageInfo.hasMore saying whether there are more \u2014 never cut a list with head. Without --page or --page-size a list comes back at its compact size (`delivery` 20 rows, `feed` and `submissions` 40), and with --full as one page of 20",
1254
1260
  required: false
1255
1261
  },
1256
1262
  fields: {
@@ -1278,13 +1284,18 @@ function handleError(err) {
1278
1284
  writeJsonEnvelope({ ok: false, error: analyticsErrorEnvelope(err) });
1279
1285
  process.exit(1);
1280
1286
  }
1281
- function pageOf(args) {
1287
+ function pageOf(args, preset) {
1282
1288
  const size = args["page-size"];
1289
+ if (args.full === true && !args.page && !size && LIST_PRESETS.has(preset)) {
1290
+ return { pageSize: FULL_LIST_PAGE_SIZE };
1291
+ }
1283
1292
  return {
1284
1293
  ...args.page ? { page: Number(args.page) } : {},
1285
1294
  ...size ? { pageSize: Number(size) } : {}
1286
1295
  };
1287
1296
  }
1297
+ var LIST_PRESETS = /* @__PURE__ */ new Set(["delivery", "submissions", "stream"]);
1298
+ var FULL_LIST_PAGE_SIZE = 20;
1288
1299
  function isWholePositive(raw) {
1289
1300
  return /^[1-9]\d*$/.test(String(raw));
1290
1301
  }
@@ -1348,7 +1359,7 @@ function requestBody(args, options) {
1348
1359
  answerSplit: options.answerSplit,
1349
1360
  answerValues: options.answerValues,
1350
1361
  ...feedFieldsOf(args, options.preset),
1351
- ...pageOf(args)
1362
+ ...pageOf(args, options.preset)
1352
1363
  };
1353
1364
  return Object.fromEntries(
1354
1365
  Object.entries(candidates).filter(([key, value]) => value !== void 0 && (value !== "" || key === "adValue"))
@@ -1376,6 +1387,14 @@ function feedNarrowedBy(options) {
1376
1387
  ];
1377
1388
  return flags.filter(([, value]) => value !== void 0 && value !== false).map(([flag]) => flag);
1378
1389
  }
1390
+ function listNarrowedBy(args, options) {
1391
+ const used = [
1392
+ ["flow", options.flowSlug],
1393
+ ["landing", options.landingId ?? args.landing],
1394
+ ["dates", args["start-date"] ?? args["end-date"]]
1395
+ ];
1396
+ return used.filter(([, value]) => value !== void 0 && value !== "").map(([key]) => key);
1397
+ }
1379
1398
  function keepFieldsAsked(args, data, feed) {
1380
1399
  const fields = parseFields(args.fields);
1381
1400
  if (fields === void 0) return { data, hints: [] };
@@ -1458,6 +1477,7 @@ async function runPreset(args, options, refine) {
1458
1477
  projected: feedFieldsOf(args, options.preset).fields !== void 0,
1459
1478
  filtered: options.where !== void 0,
1460
1479
  feedNarrowedBy: feedNarrowedBy(options),
1480
+ listNarrowedBy: listNarrowedBy(args, options),
1461
1481
  countBy: options.countBy,
1462
1482
  sourceName: options.sourceName
1463
1483
  }),
@@ -1590,7 +1610,7 @@ var deliveryCommand = presetCommand({
1590
1610
  flow: { type: "string", description: "Form slug (default: every Form)", required: false },
1591
1611
  full: {
1592
1612
  type: "boolean",
1593
- description: "List every submission, the ones every destination accepted included, instead of only the failed ones. The counts in deliverySummary are the same either way",
1613
+ description: "List every submission, the ones every destination accepted included, instead of only the failed ones \u2014 20 to a page; pageInfo.hasMore says there are more. The counts in deliverySummary are the same either way. About one destination, `baker analytics feed --sent-to <type>` is the narrower read",
1594
1614
  required: false
1595
1615
  }
1596
1616
  },
@@ -2705,22 +2725,22 @@ Full guide: __tooling__/docs/tools/baker/analytics.md`
2705
2725
  tags: tagsCommand,
2706
2726
  events: eventsCommand,
2707
2727
  feed: feedCommand,
2708
- lookup: () => import("./lookup-ESFT4PQW.js").then((m) => m.lookupCommand),
2728
+ lookup: () => import("./lookup-4W7ERA4E.js").then((m) => m.lookupCommand),
2709
2729
  devices: devicesCommand,
2710
2730
  ads: adsCommand,
2711
2731
  conversions: conversionsCommand,
2712
- sends: () => import("./sends-WLSTRLBF.js").then((m) => m.sendsCommand),
2732
+ sends: () => import("./sends-JPPZJUBN.js").then((m) => m.sendsCommand),
2713
2733
  map: mapCommand,
2714
- unstage: () => import("./unstage-ICRBPFH7.js").then((m) => m.unstageCommand),
2734
+ unstage: () => import("./unstage-K7RYZLA2.js").then((m) => m.unstageCommand),
2715
2735
  tracking: trackingCommand,
2716
2736
  arrivals: arrivalsCommand,
2717
2737
  "sending-events": sendingEventsCommand,
2718
- sources: () => import("./sources-CDTMSNJZ.js").then((m) => m.sourcesCommand),
2738
+ sources: () => import("./sources-I6M4K4DE.js").then((m) => m.sourcesCommand),
2719
2739
  "website-tag": websiteTagCommand,
2720
2740
  debug: debugCommand,
2721
2741
  sites: sitesCommand,
2722
- plan: () => import("./plan-SP7AR5DF.js").then((m) => m.planCommand),
2723
- questionnaire: () => import("./questionnaire-J7X7VA3U.js").then((m) => m.questionnaireCommand),
2742
+ plan: () => import("./plan-VHLLCF4R.js").then((m) => m.planCommand),
2743
+ questionnaire: () => import("./questionnaire-47DIYMVE.js").then((m) => m.questionnaireCommand),
2724
2744
  presets: presetsCommand
2725
2745
  }
2726
2746
  });
@@ -2734,4 +2754,4 @@ export {
2734
2754
  requestBody,
2735
2755
  sendingEventsAddress
2736
2756
  };
2737
- //# sourceMappingURL=analytics-IPNVNP67.js.map
2757
+ //# sourceMappingURL=analytics-YJBTDPVB.js.map