@koda-sl/baker-cli 0.449.0 → 0.450.0-dev.b454c3dd2

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 (878) hide show
  1. package/README.md +11 -2
  2. package/dist/account-4H7QVBRK.js +80 -0
  3. package/dist/account-XQXC7BR6.js +80 -0
  4. package/dist/account-XQXC7BR6.js.map +1 -0
  5. package/dist/account-writes-AK42HGRM.js +66 -0
  6. package/dist/accounts-722UY53A.js +78 -0
  7. package/dist/accounts-722UY53A.js.map +1 -0
  8. package/dist/accounts-E67BMK7T.js +612 -0
  9. package/dist/accounts-E67BMK7T.js.map +1 -0
  10. package/dist/actions-6TQMSVWD.js +55 -0
  11. package/dist/ad-group-writes-QQS4223F.js +170 -0
  12. package/dist/ad-groups-WGPDPUI2.js +68 -0
  13. package/dist/ad-writes-XE2IE4DS.js +174 -0
  14. package/dist/add-2BEGRHUX.js +303 -0
  15. package/dist/add-2BEGRHUX.js.map +1 -0
  16. package/dist/add-LEMKEOPO.js +105 -0
  17. package/dist/add-LEMKEOPO.js.map +1 -0
  18. package/dist/ads-AGYCVD62.js +40 -0
  19. package/dist/ads-BCOSQALY.js +77 -0
  20. package/dist/advertisers-2VQKAYKG.js +121 -0
  21. package/dist/advertisers-2VQKAYKG.js.map +1 -0
  22. package/dist/analytics-IFELDWLL.js +1962 -0
  23. package/dist/analytics-IFELDWLL.js.map +1 -0
  24. package/dist/analytics-OH5QEH7F.js +434 -0
  25. package/dist/analytics-OH5QEH7F.js.map +1 -0
  26. package/dist/animate-AIZ3GS4J.js +480 -0
  27. package/dist/assign-PTUJUCEL.js +78 -0
  28. package/dist/assign-PTUJUCEL.js.map +1 -0
  29. package/dist/audience-size-LRI6GJRT.js +95 -0
  30. package/dist/audience-size-LRI6GJRT.js.map +1 -0
  31. package/dist/audiences-TGD5US2M.js +268 -0
  32. package/dist/audit-HWP7OPB7.js +152 -0
  33. package/dist/audit-HWP7OPB7.js.map +1 -0
  34. package/dist/autocomplete-J6DHU6MR.js +112 -0
  35. package/dist/autocomplete-J6DHU6MR.js.map +1 -0
  36. package/dist/avatars-467OSBD6.js +38 -0
  37. package/dist/bid-pricing-EO5WLHGV.js +100 -0
  38. package/dist/bid-pricing-EO5WLHGV.js.map +1 -0
  39. package/dist/brand-YRTEPGBK.js +22 -0
  40. package/dist/brief-OSFJ2V7F.js +478 -0
  41. package/dist/brief-OSFJ2V7F.js.map +1 -0
  42. package/dist/campaign-groups-PQ6KSQJR.js +96 -0
  43. package/dist/campaign-groups-PQ6KSQJR.js.map +1 -0
  44. package/dist/campaign-writes-5OVLUD5E.js +166 -0
  45. package/dist/campaign-writes-5OVLUD5E.js.map +1 -0
  46. package/dist/campaign-writes-SXLZFYF6.js +170 -0
  47. package/dist/campaigns-6T3NSUT2.js +110 -0
  48. package/dist/campaigns-6T3NSUT2.js.map +1 -0
  49. package/dist/campaigns-OYMXDGWX.js +107 -0
  50. package/dist/campaigns-YS3OGQXO.js +76 -0
  51. package/dist/canvas-YQFG52IG.js +46 -0
  52. package/dist/capabilities-PXBKUN2G.js +145 -0
  53. package/dist/capabilities-PXBKUN2G.js.map +1 -0
  54. package/dist/catalog-XLXIM7IW.js +65 -0
  55. package/dist/catalogs-BRXEDE56.js +128 -0
  56. package/dist/chatgpt-7W75X3ER.js +47 -0
  57. package/dist/chats-UK47UE7C.js +263 -0
  58. package/dist/chats-UK47UE7C.js.map +1 -0
  59. package/dist/chunk-24EB7EDR.js +433 -0
  60. package/dist/chunk-2AOE2MZQ.js +159 -0
  61. package/dist/chunk-2VPBIT65.js +509 -0
  62. package/dist/chunk-4PDHHHUJ.js +537 -0
  63. package/dist/chunk-4PDHHHUJ.js.map +1 -0
  64. package/dist/chunk-54C6YDGJ.js +622 -0
  65. package/dist/chunk-5WCSKQ7Z.js +188 -0
  66. package/dist/chunk-5ZNTADVR.js +197 -0
  67. package/dist/chunk-6F7DVPOS.js +310 -0
  68. package/dist/chunk-6NY2GPR4.js +304 -0
  69. package/dist/chunk-6Y7ZBENQ.js +207 -0
  70. package/dist/chunk-7CTMH5AK.js +111 -0
  71. package/dist/chunk-7EPXVICM.js +6184 -0
  72. package/dist/chunk-7EPXVICM.js.map +1 -0
  73. package/dist/chunk-7J6EHOH6.js +274 -0
  74. package/dist/chunk-ASI4P6X2.js +6667 -0
  75. package/dist/chunk-C46GUI2S.js +19 -0
  76. package/dist/chunk-CAMX6OHF.js +3182 -0
  77. package/dist/chunk-CAMX6OHF.js.map +1 -0
  78. package/dist/chunk-CWYAELVG.js +60 -0
  79. package/dist/chunk-DCRPXOJJ.js +363 -0
  80. package/dist/chunk-EAP4O4FE.js +440 -0
  81. package/dist/chunk-FPOGPFAG.js +4383 -0
  82. package/dist/chunk-FTWJFDIN.js +23992 -0
  83. package/dist/chunk-FTWJFDIN.js.map +1 -0
  84. package/dist/chunk-FUHN4MFY.js +103 -0
  85. package/dist/chunk-FYGR3I2A.js +297 -0
  86. package/dist/chunk-H3427GPU.js +206 -0
  87. package/dist/chunk-HDLYPC6K.js +172 -0
  88. package/dist/chunk-HDLYPC6K.js.map +1 -0
  89. package/dist/chunk-HR6IWNKE.js +2942 -0
  90. package/dist/chunk-HR6IWNKE.js.map +1 -0
  91. package/dist/chunk-HROZYQ5H.js +275 -0
  92. package/dist/chunk-HROZYQ5H.js.map +1 -0
  93. package/dist/chunk-HZUDRKGR.js +98 -0
  94. package/dist/chunk-I3ZR655O.js +382 -0
  95. package/dist/chunk-KMKEYI37.js +96 -0
  96. package/dist/chunk-KS2QY6MK.js +139 -0
  97. package/dist/chunk-LYQJ4PZW.js +5189 -0
  98. package/dist/chunk-MACCF4JZ.js +3147 -0
  99. package/dist/chunk-N4LAYIIN.js +175 -0
  100. package/dist/chunk-NA63BH7V.js +346 -0
  101. package/dist/chunk-NCWCZY5P.js +1441 -0
  102. package/dist/chunk-NDEE6G2J.js +494 -0
  103. package/dist/chunk-NJXNU2G6.js +819 -0
  104. package/dist/chunk-NYIGXDUG.js +178 -0
  105. package/dist/chunk-NYIGXDUG.js.map +1 -0
  106. package/dist/chunk-P5T7OZKV.js +26 -0
  107. package/dist/chunk-PZXCWSKV.js +1830 -0
  108. package/dist/chunk-QE7W555R.js +541 -0
  109. package/dist/chunk-QE7W555R.js.map +1 -0
  110. package/dist/chunk-R25YLW6H.js +20 -0
  111. package/dist/chunk-RL5CP7N6.js +57 -0
  112. package/dist/chunk-RX2DKU3W.js +592 -0
  113. package/dist/chunk-SJYEY5MV.js +172 -0
  114. package/dist/chunk-SJYEY5MV.js.map +1 -0
  115. package/dist/chunk-ULG4QRTV.js +92 -0
  116. package/dist/chunk-VL43TNIP.js +455 -0
  117. package/dist/chunk-VLMBTPXU.js +51 -0
  118. package/dist/chunk-VNUNE5AB.js +160 -0
  119. package/dist/chunk-VYQ3QJ3C.js +169 -0
  120. package/dist/chunk-WGUQHAJY.js +23 -0
  121. package/dist/chunk-WKQG6TER.js +1079 -0
  122. package/dist/chunk-XFGAUP5B.js +76 -0
  123. package/dist/chunk-ZDMTXQ2Q.js +337 -0
  124. package/dist/claim-W6G6VEG5.js +198 -0
  125. package/dist/claim-W6G6VEG5.js.map +1 -0
  126. package/dist/cli.js +30 -30
  127. package/dist/companies-TS6KBATJ.js +196 -0
  128. package/dist/companies-TS6KBATJ.js.map +1 -0
  129. package/dist/complete-LYR2HMQU.js +82 -0
  130. package/dist/complete-LYR2HMQU.js.map +1 -0
  131. package/dist/connect-FCXNVTXG.js +43 -0
  132. package/dist/conversation-6ZJGPCXM.js +94 -0
  133. package/dist/conversation-6ZJGPCXM.js.map +1 -0
  134. package/dist/conversion-report-XQBJ6LG4.js +125 -0
  135. package/dist/conversion-writes-UBCVXP2E.js +120 -0
  136. package/dist/conversions-D236RTUK.js +76 -0
  137. package/dist/conversions-UHB55MMQ.js +136 -0
  138. package/dist/conversions-UHB55MMQ.js.map +1 -0
  139. package/dist/create-EX6OWLNM.js +208 -0
  140. package/dist/create-EX6OWLNM.js.map +1 -0
  141. package/dist/create-JCA7JPLP.js +131 -0
  142. package/dist/create-JCA7JPLP.js.map +1 -0
  143. package/dist/create-JFSK4BOP.js +60 -0
  144. package/dist/create-JFSK4BOP.js.map +1 -0
  145. package/dist/create-WU22YYU2.js +236 -0
  146. package/dist/create-WU22YYU2.js.map +1 -0
  147. package/dist/creatives-FXUQ5WSD.js +51 -0
  148. package/dist/creatives-KGXUOYPE.js +183 -0
  149. package/dist/creatives-KGXUOYPE.js.map +1 -0
  150. package/dist/credentials-MJC7PGKR.js +1056 -0
  151. package/dist/credentials-MJC7PGKR.js.map +1 -0
  152. package/dist/critique-GS5VV5ZC.js +214 -0
  153. package/dist/critique-GS5VV5ZC.js.map +1 -0
  154. package/dist/critique-TPHR27KH.js +1450 -0
  155. package/dist/critique-TPHR27KH.js.map +1 -0
  156. package/dist/crm-AVCM5D4G.js +319 -0
  157. package/dist/crm-AVCM5D4G.js.map +1 -0
  158. package/dist/crm-VK44O3ED.js +225 -0
  159. package/dist/crm-VK44O3ED.js.map +1 -0
  160. package/dist/customers-XH2DMTFH.js +57 -0
  161. package/dist/delete-E3R3TKIL.js +67 -0
  162. package/dist/delete-E3R3TKIL.js.map +1 -0
  163. package/dist/delete-KRH2YMSZ.js +55 -0
  164. package/dist/delete-KRH2YMSZ.js.map +1 -0
  165. package/dist/delete-WI5E3DR3.js +64 -0
  166. package/dist/delete-WI5E3DR3.js.map +1 -0
  167. package/dist/demographics-XV5PBA77.js +139 -0
  168. package/dist/demographics-XV5PBA77.js.map +1 -0
  169. package/dist/discard-HTQUUHJR.js +67 -0
  170. package/dist/discard-HTQUUHJR.js.map +1 -0
  171. package/dist/domain-RECGZXJB.js +99 -0
  172. package/dist/domain-RECGZXJB.js.map +1 -0
  173. package/dist/draft-2IBSJEKC.js +218 -0
  174. package/dist/draft-2IBSJEKC.js.map +1 -0
  175. package/dist/draft-MNFJ4G3C.js +281 -0
  176. package/dist/draft-PVTX6QT6.js +329 -0
  177. package/dist/draft-PVTX6QT6.js.map +1 -0
  178. package/dist/draft-Q546QPPU.js +307 -0
  179. package/dist/draft-Q546QPPU.js.map +1 -0
  180. package/dist/engine/index.js +6 -6
  181. package/dist/facets-7EVPJMKS.js +115 -0
  182. package/dist/facets-7EVPJMKS.js.map +1 -0
  183. package/dist/feedback-EIZKS4JU.js +66 -0
  184. package/dist/feedback-record-TKO54BOE.js +176 -0
  185. package/dist/feedback-record-TKO54BOE.js.map +1 -0
  186. package/dist/fetch-4BY6HYUM.js +177 -0
  187. package/dist/fetch-4BY6HYUM.js.map +1 -0
  188. package/dist/find-FRRHAPWX.js +134 -0
  189. package/dist/fit-UOFYFJ4Q.js +45 -0
  190. package/dist/flows-KTFAML22.js +248 -0
  191. package/dist/flows-KTFAML22.js.map +1 -0
  192. package/dist/fonts-MXR3ZKDX.js +35 -0
  193. package/dist/forecast-3QTJYVND.js +105 -0
  194. package/dist/forecast-3QTJYVND.js.map +1 -0
  195. package/dist/funnel-I6XIAEHG.js +393 -0
  196. package/dist/funnel-I6XIAEHG.js.map +1 -0
  197. package/dist/ga4-DV2AXCSL.js +55 -0
  198. package/dist/generate-3XYYITU6.js +262 -0
  199. package/dist/get-5PKNKJ5S.js +57 -0
  200. package/dist/get-5PKNKJ5S.js.map +1 -0
  201. package/dist/get-72YPHJGV.js +79 -0
  202. package/dist/get-72YPHJGV.js.map +1 -0
  203. package/dist/google-6OGZX47I.js +1872 -0
  204. package/dist/google-QYYYSSXI.js +136 -0
  205. package/dist/google-ads-QGMQKZQD.js +196 -0
  206. package/dist/google-ads-QGMQKZQD.js.map +1 -0
  207. package/dist/gsc-TAKOF7J5.js +30 -0
  208. package/dist/history-6AVQX2OQ.js +134 -0
  209. package/dist/history-6AVQX2OQ.js.map +1 -0
  210. package/dist/history-Q3QCT64S.js +67 -0
  211. package/dist/hubspot-SVEMFK5S.js +780 -0
  212. package/dist/hubspot-SVEMFK5S.js.map +1 -0
  213. package/dist/icon-L4RSS6PZ.js +137 -0
  214. package/dist/ideas-NFOW3HKJ.js +33 -0
  215. package/dist/images-2EFFUNNV.js +90 -0
  216. package/dist/ingest-2EIKN4QC.js +24 -0
  217. package/dist/ingest-2SO62RRI.js +108 -0
  218. package/dist/ingest-2SO62RRI.js.map +1 -0
  219. package/dist/insights-LNAXV2CG.js +122 -0
  220. package/dist/inspect-4OOS4APT.js +190 -0
  221. package/dist/inspect-4OOS4APT.js.map +1 -0
  222. package/dist/inspiration-S3DU4CMQ.js +53 -0
  223. package/dist/keyword-metrics-SF4CSNZ2.js +198 -0
  224. package/dist/keyword-metrics-SF4CSNZ2.js.map +1 -0
  225. package/dist/keywords-for-site-WDAOPNKC.js +129 -0
  226. package/dist/keywords-for-site-WDAOPNKC.js.map +1 -0
  227. package/dist/landing-2ZB46LXH.js +28 -0
  228. package/dist/leads-A4W5KTWB.js +91 -0
  229. package/dist/leads-A4W5KTWB.js.map +1 -0
  230. package/dist/learn-IPULBCOD.js +204 -0
  231. package/dist/learn-IPULBCOD.js.map +1 -0
  232. package/dist/line-item-writes-EMYSOJKM.js +209 -0
  233. package/dist/line-item-writes-EMYSOJKM.js.map +1 -0
  234. package/dist/line-items-5NECXUZT.js +103 -0
  235. package/dist/link-CI45HWFN.js +65 -0
  236. package/dist/link-CI45HWFN.js.map +1 -0
  237. package/dist/linkedin-B7SYR75X.js +1009 -0
  238. package/dist/linkedin-B7SYR75X.js.map +1 -0
  239. package/dist/list-2BARXOT5.js +152 -0
  240. package/dist/list-2BARXOT5.js.map +1 -0
  241. package/dist/list-BIEVLEHS.js +304 -0
  242. package/dist/list-BIEVLEHS.js.map +1 -0
  243. package/dist/list-ZBT3EBVZ.js +64 -0
  244. package/dist/list-ZBT3EBVZ.js.map +1 -0
  245. package/dist/locations-2NKBJKBT.js +67 -0
  246. package/dist/log-C23OOAJZ.js +93 -0
  247. package/dist/log-C23OOAJZ.js.map +1 -0
  248. package/dist/logo-Q5D7PZY6.js +18 -0
  249. package/dist/lookup-ETWY47F7.js +23 -0
  250. package/dist/make-TPKKJXGL.js +594 -0
  251. package/dist/make-TPKKJXGL.js.map +1 -0
  252. package/dist/map-SYZMPHLL.js +405 -0
  253. package/dist/map-SYZMPHLL.js.map +1 -0
  254. package/dist/mcp-6FQBVJ6F.js +477 -0
  255. package/dist/mcp-6FQBVJ6F.js.map +1 -0
  256. package/dist/media-sources-ZXHEEP6T.js +32 -0
  257. package/dist/members-UDY4OOJW.js +45 -0
  258. package/dist/members-UDY4OOJW.js.map +1 -0
  259. package/dist/models-3Z6MDHQW.js +155 -0
  260. package/dist/normalize-DAKHYS3V.js +142 -0
  261. package/dist/normalize-DAKHYS3V.js.map +1 -0
  262. package/dist/options-QL3ULED5.js +122 -0
  263. package/dist/options-QL3ULED5.js.map +1 -0
  264. package/dist/performance-UF5VTY2U.js +25 -0
  265. package/dist/pixels-TZPF746S.js +60 -0
  266. package/dist/plan-FT632COT.js +51 -0
  267. package/dist/plan-FT632COT.js.map +1 -0
  268. package/dist/promoted-tweet-writes-7HGESJ46.js +181 -0
  269. package/dist/promoted-tweet-writes-7HGESJ46.js.map +1 -0
  270. package/dist/promoted-tweets-LZKS5JIF.js +119 -0
  271. package/dist/publish-NPD3SMZL.js +323 -0
  272. package/dist/publish-NPD3SMZL.js.map +1 -0
  273. package/dist/questionnaire-JNGYJTAY.js +37 -0
  274. package/dist/questionnaire-JNGYJTAY.js.map +1 -0
  275. package/dist/reddit-NU2N3LZD.js +27 -0
  276. package/dist/refresh-EBVJ2C6L.js +95 -0
  277. package/dist/refresh-EBVJ2C6L.js.map +1 -0
  278. package/dist/release-V43YB2PY.js +61 -0
  279. package/dist/release-V43YB2PY.js.map +1 -0
  280. package/dist/remove-QPSWLFI4.js +51 -0
  281. package/dist/remove-QPSWLFI4.js.map +1 -0
  282. package/dist/reopen-GQ66NMWF.js +64 -0
  283. package/dist/reopen-GQ66NMWF.js.map +1 -0
  284. package/dist/rerun-PZK275DY.js +86 -0
  285. package/dist/rerun-PZK275DY.js.map +1 -0
  286. package/dist/research-FMM6AWZC.js +62 -0
  287. package/dist/research-GEOCUBXB.js +263 -0
  288. package/dist/research-GEOCUBXB.js.map +1 -0
  289. package/dist/reset-REXJ6AUK.js +55 -0
  290. package/dist/reset-REXJ6AUK.js.map +1 -0
  291. package/dist/reset-Y72IVESB.js +55 -0
  292. package/dist/reset-Y72IVESB.js.map +1 -0
  293. package/dist/resolve-OGX7C4TV.js +122 -0
  294. package/dist/resolve-OGX7C4TV.js.map +1 -0
  295. package/dist/retry-CD6JAQ3F.js +61 -0
  296. package/dist/retry-CD6JAQ3F.js.map +1 -0
  297. package/dist/retry-TCUBBFR5.js +63 -0
  298. package/dist/retry-TCUBBFR5.js.map +1 -0
  299. package/dist/run-A5ZDXTOI.js +66 -0
  300. package/dist/run-A5ZDXTOI.js.map +1 -0
  301. package/dist/run-EUO34T2J.js +61 -0
  302. package/dist/scaffold-ad-SW2HEWM3.js +1550 -0
  303. package/dist/scaffold-ad-SW2HEWM3.js.map +1 -0
  304. package/dist/scaffold-static-ad-ECTJL54Y.js +967 -0
  305. package/dist/scaffold-static-ad-ECTJL54Y.js.map +1 -0
  306. package/dist/scaffold-video-EI7U7RBK.js +874 -0
  307. package/dist/scaffold-video-EI7U7RBK.js.map +1 -0
  308. package/dist/schedule-S5YZJZ5U.js +62 -0
  309. package/dist/schedule-S5YZJZ5U.js.map +1 -0
  310. package/dist/scheduled-agents-N4LJRM4C.js +49 -0
  311. package/dist/schema-R7JWWOF4.js +133 -0
  312. package/dist/schema-R7JWWOF4.js.map +1 -0
  313. package/dist/search-KHMQH3AT.js +175 -0
  314. package/dist/search-KHMQH3AT.js.map +1 -0
  315. package/dist/select-O2FN2JEQ.js +95 -0
  316. package/dist/select-O2FN2JEQ.js.map +1 -0
  317. package/dist/sends-BQZM5PLS.js +310 -0
  318. package/dist/sends-BQZM5PLS.js.map +1 -0
  319. package/dist/set-prompt-2HASHGWC.js +187 -0
  320. package/dist/set-prompt-2HASHGWC.js.map +1 -0
  321. package/dist/setup-links-GYSE56GX.js +142 -0
  322. package/dist/setup-links-GYSE56GX.js.map +1 -0
  323. package/dist/site-4SKM7RKG.js +178 -0
  324. package/dist/site-4SKM7RKG.js.map +1 -0
  325. package/dist/sources-FQ2UZTHL.js +30 -0
  326. package/dist/sources-R2NKNC6J.js +422 -0
  327. package/dist/sources-R2NKNC6J.js.map +1 -0
  328. package/dist/stale-W756ACKC.js +64 -0
  329. package/dist/stale-W756ACKC.js.map +1 -0
  330. package/dist/status-SE2VZJJB.js +63 -0
  331. package/dist/status-SE2VZJJB.js.map +1 -0
  332. package/dist/stock-KXJ26BY4.js +179 -0
  333. package/dist/studio-SYKOSNDB.js +49 -0
  334. package/dist/sync-LJGSODK3.js +55 -0
  335. package/dist/sync-LJGSODK3.js.map +1 -0
  336. package/dist/sync-definition-QR2N233R.js +54 -0
  337. package/dist/tags-4BAVFH4S.js +225 -0
  338. package/dist/tags-4BAVFH4S.js.map +1 -0
  339. package/dist/tags-5SBMRC2A.js +21 -0
  340. package/dist/tags-5SBMRC2A.js.map +1 -0
  341. package/dist/tags-PYWFSBTR.js +26 -0
  342. package/dist/tags-QQU3OKMZ.js +21 -0
  343. package/dist/tags-QQU3OKMZ.js.map +1 -0
  344. package/dist/tags-YYLNF3PK.js +21 -0
  345. package/dist/tags-YYLNF3PK.js.map +1 -0
  346. package/dist/targeting-criteria-RJFLFICN.js +113 -0
  347. package/dist/targets-S2MT2PNB.js +103 -0
  348. package/dist/targets-S2MT2PNB.js.map +1 -0
  349. package/dist/templates-ZE5TOGRT.js +179 -0
  350. package/dist/templates-ZE5TOGRT.js.map +1 -0
  351. package/dist/testimonials-DII5DYLR.js +32 -0
  352. package/dist/top-companies-PGIAEHDF.js +109 -0
  353. package/dist/top-companies-PGIAEHDF.js.map +1 -0
  354. package/dist/translate-GXTS633J.js +599 -0
  355. package/dist/translate-GXTS633J.js.map +1 -0
  356. package/dist/triggers-2PTONXRU.js +142 -0
  357. package/dist/triggers-2PTONXRU.js.map +1 -0
  358. package/dist/unlink-XRMYJ6DB.js +68 -0
  359. package/dist/unlink-XRMYJ6DB.js.map +1 -0
  360. package/dist/unstage-FY7A3YFF.js +85 -0
  361. package/dist/unstage-FY7A3YFF.js.map +1 -0
  362. package/dist/unstage-RM2RLXKD.js +96 -0
  363. package/dist/unstage-RM2RLXKD.js.map +1 -0
  364. package/dist/update-E5SRBXQR.js +143 -0
  365. package/dist/update-E5SRBXQR.js.map +1 -0
  366. package/dist/update-PJ67D2OG.js +156 -0
  367. package/dist/update-PJ67D2OG.js.map +1 -0
  368. package/dist/update-S4562V3O.js +64 -0
  369. package/dist/update-S4562V3O.js.map +1 -0
  370. package/dist/update-V6YVEUI2.js +99 -0
  371. package/dist/update-V6YVEUI2.js.map +1 -0
  372. package/dist/upload-R6CQVLKF.js +127 -0
  373. package/dist/upload-R6CQVLKF.js.map +1 -0
  374. package/dist/url-options-JOKU46F2.js +128 -0
  375. package/dist/url-options-JOKU46F2.js.map +1 -0
  376. package/dist/url-params-7U2XMOWF.js +99 -0
  377. package/dist/url-params-7U2XMOWF.js.map +1 -0
  378. package/dist/validate-7YPOUKPB.js +90 -0
  379. package/dist/validate-7YPOUKPB.js.map +1 -0
  380. package/dist/videos-LICG6ACJ.js +39 -0
  381. package/dist/viewer-check-L4B4LIAX.js +69 -0
  382. package/dist/web-BA2PGTWU.js +141 -0
  383. package/dist/web-BA2PGTWU.js.map +1 -0
  384. package/dist/winning-ads-C6S2C5VP.js +62 -0
  385. package/dist/write-commands-7SJ3BOW5.js +1016 -0
  386. package/dist/write-commands-7SJ3BOW5.js.map +1 -0
  387. package/dist/x-CZHRC6U7.js +47 -0
  388. package/package.json +1 -1
  389. package/dist/account-AL2ZDSR7.js +0 -79
  390. package/dist/account-AL2ZDSR7.js.map +0 -1
  391. package/dist/account-F6MHQ64I.js +0 -80
  392. package/dist/account-writes-ISE4U2FQ.js +0 -66
  393. package/dist/accounts-HAFCLSR5.js +0 -77
  394. package/dist/accounts-HAFCLSR5.js.map +0 -1
  395. package/dist/accounts-O5MFO3QQ.js +0 -611
  396. package/dist/accounts-O5MFO3QQ.js.map +0 -1
  397. package/dist/actions-P35MEMGN.js +0 -55
  398. package/dist/ad-group-writes-UU5NNKSO.js +0 -170
  399. package/dist/ad-groups-CGFXZNIA.js +0 -68
  400. package/dist/ad-writes-NALDYWOR.js +0 -174
  401. package/dist/add-5GAN6CVO.js +0 -280
  402. package/dist/add-5GAN6CVO.js.map +0 -1
  403. package/dist/add-6DTC6X5G.js +0 -104
  404. package/dist/add-6DTC6X5G.js.map +0 -1
  405. package/dist/ads-C47NA2HH.js +0 -40
  406. package/dist/ads-PV7GZXPR.js +0 -77
  407. package/dist/advertisers-AE75CGVE.js +0 -120
  408. package/dist/advertisers-AE75CGVE.js.map +0 -1
  409. package/dist/analytics-FKCXIMPO.js +0 -1958
  410. package/dist/analytics-FKCXIMPO.js.map +0 -1
  411. package/dist/analytics-FPWQQGRM.js +0 -433
  412. package/dist/analytics-FPWQQGRM.js.map +0 -1
  413. package/dist/animate-FWWHSYPL.js +0 -480
  414. package/dist/assign-ABN2AQ4J.js +0 -77
  415. package/dist/assign-ABN2AQ4J.js.map +0 -1
  416. package/dist/audience-size-GNBJY35X.js +0 -94
  417. package/dist/audience-size-GNBJY35X.js.map +0 -1
  418. package/dist/audiences-VEKGLWBG.js +0 -268
  419. package/dist/audit-3VS63TBW.js +0 -151
  420. package/dist/audit-3VS63TBW.js.map +0 -1
  421. package/dist/autocomplete-VS3XG3B7.js +0 -111
  422. package/dist/autocomplete-VS3XG3B7.js.map +0 -1
  423. package/dist/avatars-EKCKHCC3.js +0 -38
  424. package/dist/bid-pricing-Q72B65AY.js +0 -99
  425. package/dist/bid-pricing-Q72B65AY.js.map +0 -1
  426. package/dist/brand-C6PFGGQN.js +0 -22
  427. package/dist/brief-UO52ZHFI.js +0 -477
  428. package/dist/brief-UO52ZHFI.js.map +0 -1
  429. package/dist/campaign-groups-KFFYQPU3.js +0 -95
  430. package/dist/campaign-groups-KFFYQPU3.js.map +0 -1
  431. package/dist/campaign-writes-FHOS5XZY.js +0 -165
  432. package/dist/campaign-writes-FHOS5XZY.js.map +0 -1
  433. package/dist/campaign-writes-SX52CJYW.js +0 -170
  434. package/dist/campaigns-2NHWBF5C.js +0 -109
  435. package/dist/campaigns-2NHWBF5C.js.map +0 -1
  436. package/dist/campaigns-KZYZTXDS.js +0 -107
  437. package/dist/campaigns-X3DPCCSN.js +0 -76
  438. package/dist/canvas-DPCBGW7K.js +0 -46
  439. package/dist/capabilities-DJFTRJKS.js +0 -144
  440. package/dist/capabilities-DJFTRJKS.js.map +0 -1
  441. package/dist/catalog-ME44ZRZF.js +0 -65
  442. package/dist/catalogs-G3YEVG6S.js +0 -128
  443. package/dist/chatgpt-QNUN63YS.js +0 -47
  444. package/dist/chats-D2CSDX5Q.js +0 -262
  445. package/dist/chats-D2CSDX5Q.js.map +0 -1
  446. package/dist/chunk-2QHODRR6.js +0 -19
  447. package/dist/chunk-35XWJEWH.js +0 -274
  448. package/dist/chunk-3G3ZDLMI.js +0 -197
  449. package/dist/chunk-3HJLHTWP.js +0 -163
  450. package/dist/chunk-3HJLHTWP.js.map +0 -1
  451. package/dist/chunk-3IBYKLXR.js +0 -337
  452. package/dist/chunk-4AUMTNVB.js +0 -346
  453. package/dist/chunk-4BQXAE7Z.js +0 -494
  454. package/dist/chunk-54UVGFX3.js +0 -440
  455. package/dist/chunk-5Y5UAJWD.js +0 -111
  456. package/dist/chunk-5ZDLTE5T.js +0 -159
  457. package/dist/chunk-647RO73Q.js +0 -92
  458. package/dist/chunk-7YCRFMXF.js +0 -433
  459. package/dist/chunk-7ZHMGXE2.js +0 -819
  460. package/dist/chunk-A4LOJ2VD.js +0 -23
  461. package/dist/chunk-AEOSAVVL.js +0 -310
  462. package/dist/chunk-CHSNHVYF.js +0 -3182
  463. package/dist/chunk-CHSNHVYF.js.map +0 -1
  464. package/dist/chunk-CSYSX4D2.js +0 -175
  465. package/dist/chunk-DWHIOO7E.js +0 -390
  466. package/dist/chunk-DWHIOO7E.js.map +0 -1
  467. package/dist/chunk-EDLZGTGN.js +0 -216
  468. package/dist/chunk-EDLZGTGN.js.map +0 -1
  469. package/dist/chunk-FD27ZDVP.js +0 -304
  470. package/dist/chunk-GBMP4F45.js +0 -3147
  471. package/dist/chunk-GLCPTMPG.js +0 -5189
  472. package/dist/chunk-HBTF25YG.js +0 -592
  473. package/dist/chunk-HQSCJYZO.js +0 -26
  474. package/dist/chunk-IBURXTL4.js +0 -509
  475. package/dist/chunk-IR6D7K4H.js +0 -382
  476. package/dist/chunk-J5IY3GVE.js +0 -96
  477. package/dist/chunk-JQJDXPCO.js +0 -103
  478. package/dist/chunk-K66OLA6Y.js +0 -4383
  479. package/dist/chunk-K7FZXIOZ.js +0 -60
  480. package/dist/chunk-KFE3S63W.js +0 -1441
  481. package/dist/chunk-KHRXPQID.js +0 -169
  482. package/dist/chunk-KLBTXETO.js +0 -23992
  483. package/dist/chunk-KLBTXETO.js.map +0 -1
  484. package/dist/chunk-KQTYTCKQ.js +0 -98
  485. package/dist/chunk-LYBXCXJB.js +0 -160
  486. package/dist/chunk-LZ73CZGP.js +0 -188
  487. package/dist/chunk-MELOSESI.js +0 -20
  488. package/dist/chunk-MXYBTMKB.js +0 -363
  489. package/dist/chunk-NPY4QUMQ.js +0 -622
  490. package/dist/chunk-OZRUJVIQ.js +0 -206
  491. package/dist/chunk-QRP3PXWN.js +0 -455
  492. package/dist/chunk-RPUSTYHL.js +0 -170
  493. package/dist/chunk-RPUSTYHL.js.map +0 -1
  494. package/dist/chunk-S77PZVYM.js +0 -297
  495. package/dist/chunk-SHL7LOC3.js +0 -51
  496. package/dist/chunk-SSJK7FEV.js +0 -2886
  497. package/dist/chunk-SSJK7FEV.js.map +0 -1
  498. package/dist/chunk-TT5R35PJ.js +0 -207
  499. package/dist/chunk-ULJ5RFOV.js +0 -76
  500. package/dist/chunk-VB6WJJR3.js +0 -1830
  501. package/dist/chunk-W3ZHJJVT.js +0 -139
  502. package/dist/chunk-XF4JUKVF.js +0 -6151
  503. package/dist/chunk-XF4JUKVF.js.map +0 -1
  504. package/dist/chunk-Y6O7EWYY.js +0 -57
  505. package/dist/chunk-YRQYA2LR.js +0 -217
  506. package/dist/chunk-YRQYA2LR.js.map +0 -1
  507. package/dist/chunk-Z2EOC6PL.js +0 -6667
  508. package/dist/chunk-ZEYEWPK6.js +0 -1079
  509. package/dist/claim-FZ5OQLMU.js +0 -197
  510. package/dist/claim-FZ5OQLMU.js.map +0 -1
  511. package/dist/companies-DNI634RC.js +0 -195
  512. package/dist/companies-DNI634RC.js.map +0 -1
  513. package/dist/complete-2FZMGJV5.js +0 -81
  514. package/dist/complete-2FZMGJV5.js.map +0 -1
  515. package/dist/connect-QCOGEPP4.js +0 -36
  516. package/dist/conversation-6IOGV7B7.js +0 -93
  517. package/dist/conversation-6IOGV7B7.js.map +0 -1
  518. package/dist/conversion-report-N4HANYOB.js +0 -125
  519. package/dist/conversion-writes-LW4HQKK5.js +0 -120
  520. package/dist/conversions-4SRZPBBX.js +0 -135
  521. package/dist/conversions-4SRZPBBX.js.map +0 -1
  522. package/dist/conversions-TS723AZV.js +0 -76
  523. package/dist/create-BJNMO6HT.js +0 -207
  524. package/dist/create-BJNMO6HT.js.map +0 -1
  525. package/dist/create-FX4OJ2XF.js +0 -59
  526. package/dist/create-FX4OJ2XF.js.map +0 -1
  527. package/dist/create-RM7HV77Y.js +0 -130
  528. package/dist/create-RM7HV77Y.js.map +0 -1
  529. package/dist/create-VXM34ZWH.js +0 -235
  530. package/dist/create-VXM34ZWH.js.map +0 -1
  531. package/dist/creatives-JSWBFQ5R.js +0 -182
  532. package/dist/creatives-JSWBFQ5R.js.map +0 -1
  533. package/dist/creatives-SJTJU6VT.js +0 -51
  534. package/dist/credentials-VOZTILFO.js +0 -1055
  535. package/dist/credentials-VOZTILFO.js.map +0 -1
  536. package/dist/critique-65W63MFZ.js +0 -213
  537. package/dist/critique-65W63MFZ.js.map +0 -1
  538. package/dist/critique-ZS4ON3SU.js +0 -1449
  539. package/dist/critique-ZS4ON3SU.js.map +0 -1
  540. package/dist/crm-52ROSWH5.js +0 -224
  541. package/dist/crm-52ROSWH5.js.map +0 -1
  542. package/dist/crm-R5IXIFIV.js +0 -318
  543. package/dist/crm-R5IXIFIV.js.map +0 -1
  544. package/dist/customers-4AWBFDUF.js +0 -56
  545. package/dist/delete-AIGE4Y4H.js +0 -63
  546. package/dist/delete-AIGE4Y4H.js.map +0 -1
  547. package/dist/delete-HGHXY24R.js +0 -54
  548. package/dist/delete-HGHXY24R.js.map +0 -1
  549. package/dist/delete-M2GDLPYN.js +0 -66
  550. package/dist/delete-M2GDLPYN.js.map +0 -1
  551. package/dist/demographics-NTWB2IMG.js +0 -138
  552. package/dist/demographics-NTWB2IMG.js.map +0 -1
  553. package/dist/discard-2WWQG6OU.js +0 -66
  554. package/dist/discard-2WWQG6OU.js.map +0 -1
  555. package/dist/domain-Y2LT6JLT.js +0 -98
  556. package/dist/domain-Y2LT6JLT.js.map +0 -1
  557. package/dist/draft-EJXNNJ3Y.js +0 -306
  558. package/dist/draft-EJXNNJ3Y.js.map +0 -1
  559. package/dist/draft-FJ7WHIXW.js +0 -328
  560. package/dist/draft-FJ7WHIXW.js.map +0 -1
  561. package/dist/draft-SLHAKJ2A.js +0 -217
  562. package/dist/draft-SLHAKJ2A.js.map +0 -1
  563. package/dist/draft-THPZFASM.js +0 -281
  564. package/dist/facets-U7AQC4H6.js +0 -114
  565. package/dist/facets-U7AQC4H6.js.map +0 -1
  566. package/dist/feedback-XNJQ63DS.js +0 -66
  567. package/dist/feedback-record-FDLMWMDG.js +0 -175
  568. package/dist/feedback-record-FDLMWMDG.js.map +0 -1
  569. package/dist/fetch-W7NULDEO.js +0 -176
  570. package/dist/fetch-W7NULDEO.js.map +0 -1
  571. package/dist/find-OTDIX6V4.js +0 -134
  572. package/dist/fit-7237F5EB.js +0 -45
  573. package/dist/flows-KABCBS3S.js +0 -244
  574. package/dist/flows-KABCBS3S.js.map +0 -1
  575. package/dist/fonts-EMMX3KII.js +0 -34
  576. package/dist/forecast-GNODEIIC.js +0 -104
  577. package/dist/forecast-GNODEIIC.js.map +0 -1
  578. package/dist/funnel-AAX27NH4.js +0 -837
  579. package/dist/funnel-AAX27NH4.js.map +0 -1
  580. package/dist/ga4-UDQ2HA2J.js +0 -55
  581. package/dist/generate-MMBYB44G.js +0 -262
  582. package/dist/get-QEYJRLV3.js +0 -54
  583. package/dist/get-QEYJRLV3.js.map +0 -1
  584. package/dist/get-RTVUZM6E.js +0 -78
  585. package/dist/get-RTVUZM6E.js.map +0 -1
  586. package/dist/google-KTO3PLEU.js +0 -136
  587. package/dist/google-M7KEXVK5.js +0 -1872
  588. package/dist/google-ads-OK6IG3UV.js +0 -195
  589. package/dist/google-ads-OK6IG3UV.js.map +0 -1
  590. package/dist/gsc-P3QYGDV2.js +0 -30
  591. package/dist/history-DBIEYQHY.js +0 -67
  592. package/dist/history-PQUJKK26.js +0 -133
  593. package/dist/history-PQUJKK26.js.map +0 -1
  594. package/dist/hubspot-Y77VLY6Y.js +0 -779
  595. package/dist/hubspot-Y77VLY6Y.js.map +0 -1
  596. package/dist/icon-I43F77FV.js +0 -137
  597. package/dist/ideas-MIDU7YOA.js +0 -32
  598. package/dist/images-S254MS6O.js +0 -90
  599. package/dist/ingest-J4I3HKM3.js +0 -107
  600. package/dist/ingest-J4I3HKM3.js.map +0 -1
  601. package/dist/ingest-YV2NLDBE.js +0 -23
  602. package/dist/insights-ZIU6FJMS.js +0 -122
  603. package/dist/inspect-Q5NHBBHX.js +0 -189
  604. package/dist/inspect-Q5NHBBHX.js.map +0 -1
  605. package/dist/inspiration-P265QJ2H.js +0 -53
  606. package/dist/keyword-metrics-PDY4ZXSP.js +0 -197
  607. package/dist/keyword-metrics-PDY4ZXSP.js.map +0 -1
  608. package/dist/keywords-for-site-GALSCV77.js +0 -128
  609. package/dist/keywords-for-site-GALSCV77.js.map +0 -1
  610. package/dist/landing-CJYGWCK4.js +0 -28
  611. package/dist/leads-PHKG6CP3.js +0 -90
  612. package/dist/leads-PHKG6CP3.js.map +0 -1
  613. package/dist/learn-3VO6DXUX.js +0 -203
  614. package/dist/learn-3VO6DXUX.js.map +0 -1
  615. package/dist/line-item-writes-E6MZPIZZ.js +0 -208
  616. package/dist/line-item-writes-E6MZPIZZ.js.map +0 -1
  617. package/dist/line-items-7ZGIKEF2.js +0 -103
  618. package/dist/link-QYAW6A2W.js +0 -64
  619. package/dist/link-QYAW6A2W.js.map +0 -1
  620. package/dist/linkedin-FFSDSGGS.js +0 -1008
  621. package/dist/linkedin-FFSDSGGS.js.map +0 -1
  622. package/dist/list-5IC6KIKO.js +0 -63
  623. package/dist/list-5IC6KIKO.js.map +0 -1
  624. package/dist/list-NVQC5SNY.js +0 -151
  625. package/dist/list-NVQC5SNY.js.map +0 -1
  626. package/dist/list-SAV3LQHY.js +0 -303
  627. package/dist/list-SAV3LQHY.js.map +0 -1
  628. package/dist/locations-74TPQWAT.js +0 -67
  629. package/dist/log-XZPVOALD.js +0 -92
  630. package/dist/log-XZPVOALD.js.map +0 -1
  631. package/dist/logo-2IP663QO.js +0 -18
  632. package/dist/lookup-XK45W2SH.js +0 -22
  633. package/dist/make-LCNP76OF.js +0 -593
  634. package/dist/make-LCNP76OF.js.map +0 -1
  635. package/dist/map-4J5WIWIG.js +0 -404
  636. package/dist/map-4J5WIWIG.js.map +0 -1
  637. package/dist/mcp-XXD7ZQCP.js +0 -476
  638. package/dist/mcp-XXD7ZQCP.js.map +0 -1
  639. package/dist/media-sources-O6ZRUA3N.js +0 -32
  640. package/dist/members-D5ZYLS4Y.js +0 -44
  641. package/dist/members-D5ZYLS4Y.js.map +0 -1
  642. package/dist/models-7U3GRYHF.js +0 -155
  643. package/dist/normalize-PCNC6E2N.js +0 -138
  644. package/dist/normalize-PCNC6E2N.js.map +0 -1
  645. package/dist/options-MQ65VEVD.js +0 -121
  646. package/dist/options-MQ65VEVD.js.map +0 -1
  647. package/dist/performance-6QW2KEEQ.js +0 -24
  648. package/dist/pixels-45A55MOP.js +0 -60
  649. package/dist/promoted-tweet-writes-JPLHY3GM.js +0 -180
  650. package/dist/promoted-tweet-writes-JPLHY3GM.js.map +0 -1
  651. package/dist/promoted-tweets-SURKMHFI.js +0 -119
  652. package/dist/publish-HCQ6MXLB.js +0 -322
  653. package/dist/publish-HCQ6MXLB.js.map +0 -1
  654. package/dist/reddit-GIP3ADMS.js +0 -26
  655. package/dist/refresh-UXQSLCR3.js +0 -94
  656. package/dist/refresh-UXQSLCR3.js.map +0 -1
  657. package/dist/release-5KVLXNP6.js +0 -60
  658. package/dist/release-5KVLXNP6.js.map +0 -1
  659. package/dist/remove-6FIVKCJI.js +0 -50
  660. package/dist/remove-6FIVKCJI.js.map +0 -1
  661. package/dist/reopen-YM5LNOLB.js +0 -63
  662. package/dist/reopen-YM5LNOLB.js.map +0 -1
  663. package/dist/rerun-CET74VPF.js +0 -85
  664. package/dist/rerun-CET74VPF.js.map +0 -1
  665. package/dist/research-EY7C7JJY.js +0 -62
  666. package/dist/research-YOGE7GT2.js +0 -262
  667. package/dist/research-YOGE7GT2.js.map +0 -1
  668. package/dist/reset-C4UHQ3EU.js +0 -54
  669. package/dist/reset-C4UHQ3EU.js.map +0 -1
  670. package/dist/reset-OLVB6AE6.js +0 -54
  671. package/dist/reset-OLVB6AE6.js.map +0 -1
  672. package/dist/resolve-XYH2GDAE.js +0 -121
  673. package/dist/resolve-XYH2GDAE.js.map +0 -1
  674. package/dist/retry-726GKI6V.js +0 -62
  675. package/dist/retry-726GKI6V.js.map +0 -1
  676. package/dist/retry-7EELDEQP.js +0 -60
  677. package/dist/retry-7EELDEQP.js.map +0 -1
  678. package/dist/run-P4KR2MXC.js +0 -65
  679. package/dist/run-P4KR2MXC.js.map +0 -1
  680. package/dist/run-XQ7EM3JT.js +0 -60
  681. package/dist/scaffold-ad-U2KSHKBC.js +0 -1549
  682. package/dist/scaffold-ad-U2KSHKBC.js.map +0 -1
  683. package/dist/scaffold-static-ad-63LQKUSO.js +0 -966
  684. package/dist/scaffold-static-ad-63LQKUSO.js.map +0 -1
  685. package/dist/scaffold-video-MUS6LHJQ.js +0 -873
  686. package/dist/scaffold-video-MUS6LHJQ.js.map +0 -1
  687. package/dist/schedule-RDK4GEPI.js +0 -61
  688. package/dist/schedule-RDK4GEPI.js.map +0 -1
  689. package/dist/scheduled-agents-6U44QE76.js +0 -49
  690. package/dist/schema-CHJDC7GQ.js +0 -129
  691. package/dist/schema-CHJDC7GQ.js.map +0 -1
  692. package/dist/search-PMJRU3C4.js +0 -174
  693. package/dist/search-PMJRU3C4.js.map +0 -1
  694. package/dist/select-4Z7BW5RH.js +0 -94
  695. package/dist/select-4Z7BW5RH.js.map +0 -1
  696. package/dist/sends-WGJVQUMF.js +0 -309
  697. package/dist/sends-WGJVQUMF.js.map +0 -1
  698. package/dist/set-prompt-OB2V3XJP.js +0 -186
  699. package/dist/set-prompt-OB2V3XJP.js.map +0 -1
  700. package/dist/setup-links-REPREN3C.js +0 -141
  701. package/dist/setup-links-REPREN3C.js.map +0 -1
  702. package/dist/site-WFSWIA3S.js +0 -177
  703. package/dist/site-WFSWIA3S.js.map +0 -1
  704. package/dist/sources-AMI2AWKZ.js +0 -421
  705. package/dist/sources-AMI2AWKZ.js.map +0 -1
  706. package/dist/sources-YBQ6KPFM.js +0 -30
  707. package/dist/stale-DAYXOY3Z.js +0 -63
  708. package/dist/stale-DAYXOY3Z.js.map +0 -1
  709. package/dist/status-7F2KHFGA.js +0 -62
  710. package/dist/status-7F2KHFGA.js.map +0 -1
  711. package/dist/stock-2YCDN3N6.js +0 -179
  712. package/dist/studio-C5K3YX3P.js +0 -49
  713. package/dist/sync-GWTLKZTU.js +0 -54
  714. package/dist/sync-GWTLKZTU.js.map +0 -1
  715. package/dist/sync-definition-ILS2B2BJ.js +0 -53
  716. package/dist/tags-3WPW6PTV.js +0 -26
  717. package/dist/tags-6342FQEB.js +0 -20
  718. package/dist/tags-6342FQEB.js.map +0 -1
  719. package/dist/tags-ABHSX6M5.js +0 -20
  720. package/dist/tags-ABHSX6M5.js.map +0 -1
  721. package/dist/tags-FJIBBBRG.js +0 -20
  722. package/dist/tags-FJIBBBRG.js.map +0 -1
  723. package/dist/tags-KFYLZLB3.js +0 -224
  724. package/dist/tags-KFYLZLB3.js.map +0 -1
  725. package/dist/targeting-criteria-NR47AF5C.js +0 -113
  726. package/dist/targets-L56KOVQE.js +0 -102
  727. package/dist/targets-L56KOVQE.js.map +0 -1
  728. package/dist/templates-B6XGDYUF.js +0 -178
  729. package/dist/templates-B6XGDYUF.js.map +0 -1
  730. package/dist/testimonials-CVC4YIXO.js +0 -32
  731. package/dist/top-companies-45X3DT7Z.js +0 -108
  732. package/dist/top-companies-45X3DT7Z.js.map +0 -1
  733. package/dist/translate-TA5KQIU7.js +0 -598
  734. package/dist/translate-TA5KQIU7.js.map +0 -1
  735. package/dist/triggers-22EMIVFD.js +0 -141
  736. package/dist/triggers-22EMIVFD.js.map +0 -1
  737. package/dist/unlink-65KUN6ID.js +0 -67
  738. package/dist/unlink-65KUN6ID.js.map +0 -1
  739. package/dist/unstage-2E3I5SWF.js +0 -84
  740. package/dist/unstage-2E3I5SWF.js.map +0 -1
  741. package/dist/unstage-4ZEULXEQ.js +0 -95
  742. package/dist/unstage-4ZEULXEQ.js.map +0 -1
  743. package/dist/update-2S7CSEAW.js +0 -63
  744. package/dist/update-2S7CSEAW.js.map +0 -1
  745. package/dist/update-7NCOTAQZ.js +0 -98
  746. package/dist/update-7NCOTAQZ.js.map +0 -1
  747. package/dist/update-D6DJC6T7.js +0 -155
  748. package/dist/update-D6DJC6T7.js.map +0 -1
  749. package/dist/update-KREBPGBH.js +0 -142
  750. package/dist/update-KREBPGBH.js.map +0 -1
  751. package/dist/upload-O6NHRPS7.js +0 -126
  752. package/dist/upload-O6NHRPS7.js.map +0 -1
  753. package/dist/url-options-GGXAL3J4.js +0 -127
  754. package/dist/url-options-GGXAL3J4.js.map +0 -1
  755. package/dist/url-params-3EFGVTZZ.js +0 -98
  756. package/dist/url-params-3EFGVTZZ.js.map +0 -1
  757. package/dist/validate-LDBAAXQO.js +0 -89
  758. package/dist/validate-LDBAAXQO.js.map +0 -1
  759. package/dist/videos-YSXYGTBM.js +0 -39
  760. package/dist/viewer-check-45T2HLAH.js +0 -69
  761. package/dist/web-IGIGVEKS.js +0 -140
  762. package/dist/web-IGIGVEKS.js.map +0 -1
  763. package/dist/winning-ads-ASH5DSV3.js +0 -62
  764. package/dist/write-commands-5C7FUOVN.js +0 -1015
  765. package/dist/write-commands-5C7FUOVN.js.map +0 -1
  766. package/dist/x-BFSKFCZD.js +0 -47
  767. /package/dist/{account-F6MHQ64I.js.map → account-4H7QVBRK.js.map} +0 -0
  768. /package/dist/{account-writes-ISE4U2FQ.js.map → account-writes-AK42HGRM.js.map} +0 -0
  769. /package/dist/{actions-P35MEMGN.js.map → actions-6TQMSVWD.js.map} +0 -0
  770. /package/dist/{ad-group-writes-UU5NNKSO.js.map → ad-group-writes-QQS4223F.js.map} +0 -0
  771. /package/dist/{ad-groups-CGFXZNIA.js.map → ad-groups-WGPDPUI2.js.map} +0 -0
  772. /package/dist/{ad-writes-NALDYWOR.js.map → ad-writes-XE2IE4DS.js.map} +0 -0
  773. /package/dist/{ads-C47NA2HH.js.map → ads-AGYCVD62.js.map} +0 -0
  774. /package/dist/{ads-PV7GZXPR.js.map → ads-BCOSQALY.js.map} +0 -0
  775. /package/dist/{animate-FWWHSYPL.js.map → animate-AIZ3GS4J.js.map} +0 -0
  776. /package/dist/{audiences-VEKGLWBG.js.map → audiences-TGD5US2M.js.map} +0 -0
  777. /package/dist/{avatars-EKCKHCC3.js.map → avatars-467OSBD6.js.map} +0 -0
  778. /package/dist/{brand-C6PFGGQN.js.map → brand-YRTEPGBK.js.map} +0 -0
  779. /package/dist/{campaign-writes-SX52CJYW.js.map → campaign-writes-SXLZFYF6.js.map} +0 -0
  780. /package/dist/{campaigns-KZYZTXDS.js.map → campaigns-OYMXDGWX.js.map} +0 -0
  781. /package/dist/{campaigns-X3DPCCSN.js.map → campaigns-YS3OGQXO.js.map} +0 -0
  782. /package/dist/{canvas-DPCBGW7K.js.map → canvas-YQFG52IG.js.map} +0 -0
  783. /package/dist/{catalog-ME44ZRZF.js.map → catalog-XLXIM7IW.js.map} +0 -0
  784. /package/dist/{catalogs-G3YEVG6S.js.map → catalogs-BRXEDE56.js.map} +0 -0
  785. /package/dist/{chatgpt-QNUN63YS.js.map → chatgpt-7W75X3ER.js.map} +0 -0
  786. /package/dist/{chunk-7YCRFMXF.js.map → chunk-24EB7EDR.js.map} +0 -0
  787. /package/dist/{chunk-5ZDLTE5T.js.map → chunk-2AOE2MZQ.js.map} +0 -0
  788. /package/dist/{chunk-IBURXTL4.js.map → chunk-2VPBIT65.js.map} +0 -0
  789. /package/dist/{chunk-NPY4QUMQ.js.map → chunk-54C6YDGJ.js.map} +0 -0
  790. /package/dist/{chunk-LZ73CZGP.js.map → chunk-5WCSKQ7Z.js.map} +0 -0
  791. /package/dist/{chunk-3G3ZDLMI.js.map → chunk-5ZNTADVR.js.map} +0 -0
  792. /package/dist/{chunk-AEOSAVVL.js.map → chunk-6F7DVPOS.js.map} +0 -0
  793. /package/dist/{chunk-FD27ZDVP.js.map → chunk-6NY2GPR4.js.map} +0 -0
  794. /package/dist/{chunk-TT5R35PJ.js.map → chunk-6Y7ZBENQ.js.map} +0 -0
  795. /package/dist/{chunk-5Y5UAJWD.js.map → chunk-7CTMH5AK.js.map} +0 -0
  796. /package/dist/{chunk-35XWJEWH.js.map → chunk-7J6EHOH6.js.map} +0 -0
  797. /package/dist/{chunk-Z2EOC6PL.js.map → chunk-ASI4P6X2.js.map} +0 -0
  798. /package/dist/{chunk-2QHODRR6.js.map → chunk-C46GUI2S.js.map} +0 -0
  799. /package/dist/{chunk-K7FZXIOZ.js.map → chunk-CWYAELVG.js.map} +0 -0
  800. /package/dist/{chunk-MXYBTMKB.js.map → chunk-DCRPXOJJ.js.map} +0 -0
  801. /package/dist/{chunk-54UVGFX3.js.map → chunk-EAP4O4FE.js.map} +0 -0
  802. /package/dist/{chunk-K66OLA6Y.js.map → chunk-FPOGPFAG.js.map} +0 -0
  803. /package/dist/{chunk-JQJDXPCO.js.map → chunk-FUHN4MFY.js.map} +0 -0
  804. /package/dist/{chunk-S77PZVYM.js.map → chunk-FYGR3I2A.js.map} +0 -0
  805. /package/dist/{chunk-OZRUJVIQ.js.map → chunk-H3427GPU.js.map} +0 -0
  806. /package/dist/{chunk-KQTYTCKQ.js.map → chunk-HZUDRKGR.js.map} +0 -0
  807. /package/dist/{chunk-IR6D7K4H.js.map → chunk-I3ZR655O.js.map} +0 -0
  808. /package/dist/{chunk-J5IY3GVE.js.map → chunk-KMKEYI37.js.map} +0 -0
  809. /package/dist/{chunk-W3ZHJJVT.js.map → chunk-KS2QY6MK.js.map} +0 -0
  810. /package/dist/{chunk-GLCPTMPG.js.map → chunk-LYQJ4PZW.js.map} +0 -0
  811. /package/dist/{chunk-GBMP4F45.js.map → chunk-MACCF4JZ.js.map} +0 -0
  812. /package/dist/{chunk-CSYSX4D2.js.map → chunk-N4LAYIIN.js.map} +0 -0
  813. /package/dist/{chunk-4AUMTNVB.js.map → chunk-NA63BH7V.js.map} +0 -0
  814. /package/dist/{chunk-KFE3S63W.js.map → chunk-NCWCZY5P.js.map} +0 -0
  815. /package/dist/{chunk-4BQXAE7Z.js.map → chunk-NDEE6G2J.js.map} +0 -0
  816. /package/dist/{chunk-7ZHMGXE2.js.map → chunk-NJXNU2G6.js.map} +0 -0
  817. /package/dist/{chunk-HQSCJYZO.js.map → chunk-P5T7OZKV.js.map} +0 -0
  818. /package/dist/{chunk-VB6WJJR3.js.map → chunk-PZXCWSKV.js.map} +0 -0
  819. /package/dist/{chunk-MELOSESI.js.map → chunk-R25YLW6H.js.map} +0 -0
  820. /package/dist/{chunk-Y6O7EWYY.js.map → chunk-RL5CP7N6.js.map} +0 -0
  821. /package/dist/{chunk-HBTF25YG.js.map → chunk-RX2DKU3W.js.map} +0 -0
  822. /package/dist/{chunk-647RO73Q.js.map → chunk-ULG4QRTV.js.map} +0 -0
  823. /package/dist/{chunk-QRP3PXWN.js.map → chunk-VL43TNIP.js.map} +0 -0
  824. /package/dist/{chunk-SHL7LOC3.js.map → chunk-VLMBTPXU.js.map} +0 -0
  825. /package/dist/{chunk-LYBXCXJB.js.map → chunk-VNUNE5AB.js.map} +0 -0
  826. /package/dist/{chunk-KHRXPQID.js.map → chunk-VYQ3QJ3C.js.map} +0 -0
  827. /package/dist/{chunk-A4LOJ2VD.js.map → chunk-WGUQHAJY.js.map} +0 -0
  828. /package/dist/{chunk-ZEYEWPK6.js.map → chunk-WKQG6TER.js.map} +0 -0
  829. /package/dist/{chunk-ULJ5RFOV.js.map → chunk-XFGAUP5B.js.map} +0 -0
  830. /package/dist/{chunk-3IBYKLXR.js.map → chunk-ZDMTXQ2Q.js.map} +0 -0
  831. /package/dist/{connect-QCOGEPP4.js.map → connect-FCXNVTXG.js.map} +0 -0
  832. /package/dist/{conversion-report-N4HANYOB.js.map → conversion-report-XQBJ6LG4.js.map} +0 -0
  833. /package/dist/{conversion-writes-LW4HQKK5.js.map → conversion-writes-UBCVXP2E.js.map} +0 -0
  834. /package/dist/{conversions-TS723AZV.js.map → conversions-D236RTUK.js.map} +0 -0
  835. /package/dist/{creatives-SJTJU6VT.js.map → creatives-FXUQ5WSD.js.map} +0 -0
  836. /package/dist/{customers-4AWBFDUF.js.map → customers-XH2DMTFH.js.map} +0 -0
  837. /package/dist/{draft-THPZFASM.js.map → draft-MNFJ4G3C.js.map} +0 -0
  838. /package/dist/{feedback-XNJQ63DS.js.map → feedback-EIZKS4JU.js.map} +0 -0
  839. /package/dist/{find-OTDIX6V4.js.map → find-FRRHAPWX.js.map} +0 -0
  840. /package/dist/{fit-7237F5EB.js.map → fit-UOFYFJ4Q.js.map} +0 -0
  841. /package/dist/{fonts-EMMX3KII.js.map → fonts-MXR3ZKDX.js.map} +0 -0
  842. /package/dist/{ga4-UDQ2HA2J.js.map → ga4-DV2AXCSL.js.map} +0 -0
  843. /package/dist/{generate-MMBYB44G.js.map → generate-3XYYITU6.js.map} +0 -0
  844. /package/dist/{google-M7KEXVK5.js.map → google-6OGZX47I.js.map} +0 -0
  845. /package/dist/{google-KTO3PLEU.js.map → google-QYYYSSXI.js.map} +0 -0
  846. /package/dist/{gsc-P3QYGDV2.js.map → gsc-TAKOF7J5.js.map} +0 -0
  847. /package/dist/{history-DBIEYQHY.js.map → history-Q3QCT64S.js.map} +0 -0
  848. /package/dist/{icon-I43F77FV.js.map → icon-L4RSS6PZ.js.map} +0 -0
  849. /package/dist/{ideas-MIDU7YOA.js.map → ideas-NFOW3HKJ.js.map} +0 -0
  850. /package/dist/{images-S254MS6O.js.map → images-2EFFUNNV.js.map} +0 -0
  851. /package/dist/{ingest-YV2NLDBE.js.map → ingest-2EIKN4QC.js.map} +0 -0
  852. /package/dist/{insights-ZIU6FJMS.js.map → insights-LNAXV2CG.js.map} +0 -0
  853. /package/dist/{inspiration-P265QJ2H.js.map → inspiration-S3DU4CMQ.js.map} +0 -0
  854. /package/dist/{landing-CJYGWCK4.js.map → landing-2ZB46LXH.js.map} +0 -0
  855. /package/dist/{line-items-7ZGIKEF2.js.map → line-items-5NECXUZT.js.map} +0 -0
  856. /package/dist/{locations-74TPQWAT.js.map → locations-2NKBJKBT.js.map} +0 -0
  857. /package/dist/{logo-2IP663QO.js.map → logo-Q5D7PZY6.js.map} +0 -0
  858. /package/dist/{lookup-XK45W2SH.js.map → lookup-ETWY47F7.js.map} +0 -0
  859. /package/dist/{media-sources-O6ZRUA3N.js.map → media-sources-ZXHEEP6T.js.map} +0 -0
  860. /package/dist/{models-7U3GRYHF.js.map → models-3Z6MDHQW.js.map} +0 -0
  861. /package/dist/{performance-6QW2KEEQ.js.map → performance-UF5VTY2U.js.map} +0 -0
  862. /package/dist/{pixels-45A55MOP.js.map → pixels-TZPF746S.js.map} +0 -0
  863. /package/dist/{promoted-tweets-SURKMHFI.js.map → promoted-tweets-LZKS5JIF.js.map} +0 -0
  864. /package/dist/{reddit-GIP3ADMS.js.map → reddit-NU2N3LZD.js.map} +0 -0
  865. /package/dist/{research-EY7C7JJY.js.map → research-FMM6AWZC.js.map} +0 -0
  866. /package/dist/{run-XQ7EM3JT.js.map → run-EUO34T2J.js.map} +0 -0
  867. /package/dist/{scheduled-agents-6U44QE76.js.map → scheduled-agents-N4LJRM4C.js.map} +0 -0
  868. /package/dist/{sources-YBQ6KPFM.js.map → sources-FQ2UZTHL.js.map} +0 -0
  869. /package/dist/{stock-2YCDN3N6.js.map → stock-KXJ26BY4.js.map} +0 -0
  870. /package/dist/{studio-C5K3YX3P.js.map → studio-SYKOSNDB.js.map} +0 -0
  871. /package/dist/{sync-definition-ILS2B2BJ.js.map → sync-definition-QR2N233R.js.map} +0 -0
  872. /package/dist/{tags-3WPW6PTV.js.map → tags-PYWFSBTR.js.map} +0 -0
  873. /package/dist/{targeting-criteria-NR47AF5C.js.map → targeting-criteria-RJFLFICN.js.map} +0 -0
  874. /package/dist/{testimonials-CVC4YIXO.js.map → testimonials-DII5DYLR.js.map} +0 -0
  875. /package/dist/{videos-YSXYGTBM.js.map → videos-LICG6ACJ.js.map} +0 -0
  876. /package/dist/{viewer-check-45T2HLAH.js.map → viewer-check-L4B4LIAX.js.map} +0 -0
  877. /package/dist/{winning-ads-ASH5DSV3.js.map → winning-ads-C6S2C5VP.js.map} +0 -0
  878. /package/dist/{x-BFSKFCZD.js.map → x-CZHRC6U7.js.map} +0 -0
@@ -0,0 +1,2942 @@
1
+ // ../api/src/analytics/eventKey.ts
2
+ var SEP = ":";
3
+ function formEventKey(flowSlug, nodeId, triggerId) {
4
+ return ["form", flowSlug, nodeId, triggerId].join(SEP);
5
+ }
6
+ function isLandingViewKey(key2) {
7
+ return parseEventKey(key2)?.family === "view";
8
+ }
9
+ function parseEventKey(key2) {
10
+ const cut = key2.indexOf(SEP);
11
+ if (cut <= 0) return null;
12
+ const family = key2.slice(0, cut);
13
+ const rest = key2.slice(cut + 1);
14
+ if (rest === "") return null;
15
+ switch (family) {
16
+ case "form": {
17
+ const [flowSlug, nodeId, ...triggerParts] = rest.split(SEP);
18
+ const triggerId = triggerParts.join(SEP);
19
+ if (!flowSlug || !nodeId || triggerId === "") return null;
20
+ return { family: "form", flowSlug, nodeId, triggerId };
21
+ }
22
+ case "submit":
23
+ return { family: "submit", flowSlug: rest };
24
+ case "page":
25
+ return { family: "page", eventName: rest };
26
+ case "exit":
27
+ return { family: "exit", host: rest };
28
+ case "view":
29
+ return { family: "view", landingId: rest };
30
+ default:
31
+ return null;
32
+ }
33
+ }
34
+
35
+ // ../api/src/analytics/adParams.ts
36
+ var AD_PARAM_ROLES = [
37
+ "campaign_id",
38
+ "campaign_name",
39
+ "adgroup_id",
40
+ "adgroup_name",
41
+ "ad_id",
42
+ "ad_name",
43
+ "keyword",
44
+ "match_type",
45
+ "search_query",
46
+ "audience",
47
+ "placement",
48
+ "network",
49
+ "site_source",
50
+ "device",
51
+ "product_id",
52
+ "account_name",
53
+ "other",
54
+ "ignore"
55
+ ];
56
+ var AD_PARAM_ROLE_SPECS = {
57
+ campaign_id: { role: "campaign_id", label: "Campaign ID", description: "The top level of this account's structure." },
58
+ campaign_name: { role: "campaign_name", label: "Campaign name", description: "The campaign's name." },
59
+ adgroup_id: { role: "adgroup_id", label: "Ad group ID", description: "The targeting container inside a campaign." },
60
+ adgroup_name: { role: "adgroup_name", label: "Ad group name", description: "The ad group's name." },
61
+ ad_id: { role: "ad_id", label: "Ad ID", description: "The individual ad that was clicked." },
62
+ ad_name: { role: "ad_name", label: "Ad name", description: "The individual ad's name." },
63
+ keyword: {
64
+ role: "keyword",
65
+ label: "Keyword",
66
+ description: "The keyword that matched, as it is written in the account \u2014 not what the visitor typed."
67
+ },
68
+ match_type: {
69
+ role: "match_type",
70
+ label: "Match type",
71
+ description: "How loosely the keyword matched: broad, phrase or exact."
72
+ },
73
+ search_query: { role: "search_query", label: "Search query", description: "What the visitor actually typed." },
74
+ audience: {
75
+ role: "audience",
76
+ label: "Audience",
77
+ description: "The remarketing list or interest segment the visitor was in."
78
+ },
79
+ placement: {
80
+ role: "placement",
81
+ label: "Placement",
82
+ description: "Where the ad appeared \u2014 a feed, a story, a site on the display network."
83
+ },
84
+ network: {
85
+ role: "network",
86
+ label: "Network",
87
+ description: "Which network served it: search, a search partner, display, or a video surface."
88
+ },
89
+ site_source: {
90
+ role: "site_source",
91
+ label: "App",
92
+ description: "Which app the click came from, on platforms that span several."
93
+ },
94
+ device: { role: "device", label: "Device", description: "Mobile, tablet or desktop, as the platform saw it." },
95
+ product_id: { role: "product_id", label: "Product ID", description: "The shopping item that was clicked." },
96
+ account_name: {
97
+ role: "account_name",
98
+ label: "Account name",
99
+ description: "Which ad account paid for the click, where an agency runs several."
100
+ },
101
+ other: {
102
+ role: "other",
103
+ label: "Something else",
104
+ description: "Keep the values and let me filter by this name, without saying what it means."
105
+ },
106
+ ignore: {
107
+ role: "ignore",
108
+ label: "Ignore it",
109
+ description: "Not campaign information. Baker stops storing it and stops asking about it."
110
+ }
111
+ };
112
+ var RESERVED_PARAM_NAMES = [
113
+ "utm_source",
114
+ "utm_medium",
115
+ "utm_campaign",
116
+ "utm_content",
117
+ "utm_term",
118
+ "utm_id"
119
+ ];
120
+ var AD_PLATFORMS = [
121
+ "google",
122
+ "meta",
123
+ "microsoft",
124
+ "linkedin",
125
+ "tiktok",
126
+ "reddit",
127
+ "pinterest",
128
+ "snapchat",
129
+ "chatgpt"
130
+ ];
131
+ function isAdPlatform(value) {
132
+ return AD_PLATFORMS.includes(value);
133
+ }
134
+ var GOOGLE = {
135
+ platform: "google",
136
+ label: "Google Ads",
137
+ docs: "https://developers.google.com/google-ads/api/docs/reporting/valuetrack-mapping",
138
+ dimensions: [
139
+ { role: "campaign_id", macro: "{campaignid}", names: ["campaign_id", "campaignid", "gad_campaignid"] },
140
+ { role: "adgroup_id", macro: "{adgroupid}", names: ["adgroup_id", "adgroupid"] },
141
+ {
142
+ role: "ad_id",
143
+ macro: "{creative}",
144
+ names: ["ad_id", "creative", "adid"],
145
+ note: "ValueTrack calls the ad id {creative}."
146
+ },
147
+ { role: "keyword", macro: "{keyword}", names: ["keyword", "kw"] },
148
+ {
149
+ role: "match_type",
150
+ macro: "{matchtype}",
151
+ names: ["match_type", "matchtype", "mt"],
152
+ note: "b broad, p phrase, e exact, a AI Max."
153
+ },
154
+ {
155
+ role: "network",
156
+ macro: "{network}",
157
+ names: ["network", "gad_source"],
158
+ note: "g search, s partner, d display, ytv YouTube."
159
+ },
160
+ { role: "device", macro: "{device}", names: ["device"] },
161
+ { role: "placement", macro: "{placement}", names: ["placement"] },
162
+ { role: "product_id", macro: "{product_id}", names: ["product_id"], note: "Shopping campaigns only." }
163
+ ]
164
+ };
165
+ var META = {
166
+ platform: "meta",
167
+ label: "Meta Ads",
168
+ docs: "https://www.facebook.com/business/help/2360940870872492",
169
+ dimensions: [
170
+ { role: "campaign_id", macro: "{{campaign.id}}", names: ["campaign_id", "campaignid"] },
171
+ { role: "campaign_name", macro: "{{campaign.name}}", names: ["campaign_name", "campaignname"] },
172
+ {
173
+ role: "adgroup_id",
174
+ macro: "{{adset.id}}",
175
+ names: ["adset_id", "adgroup_id", "adsetid"],
176
+ note: "Meta calls an ad group an ad set."
177
+ },
178
+ { role: "adgroup_name", macro: "{{adset.name}}", names: ["adset_name", "adgroup_name"] },
179
+ { role: "ad_id", macro: "{{ad.id}}", names: ["ad_id", "adid"] },
180
+ { role: "ad_name", macro: "{{ad.name}}", names: ["ad_name", "adname"] },
181
+ {
182
+ role: "placement",
183
+ macro: "{{placement}}",
184
+ names: ["placement", "placement_id"],
185
+ note: "feed, story, reels and the rest."
186
+ },
187
+ {
188
+ role: "site_source",
189
+ macro: "{{site_source_name}}",
190
+ names: ["site_source", "site_source_name"],
191
+ note: "fb, ig, an or msg."
192
+ }
193
+ ]
194
+ };
195
+ var MICROSOFT = {
196
+ platform: "microsoft",
197
+ label: "Microsoft Advertising",
198
+ docs: "https://learn.microsoft.com/en-us/advertising/guides/url-tracking-upgraded-urls",
199
+ dimensions: [
200
+ { role: "campaign_id", macro: "{CampaignId}", names: ["campaign_id", "campaignid"] },
201
+ { role: "campaign_name", macro: "{Campaign}", names: ["campaign_name", "campaignname"] },
202
+ { role: "adgroup_id", macro: "{AdGroupId}", names: ["adgroup_id", "adgroupid"] },
203
+ { role: "adgroup_name", macro: "{AdGroup}", names: ["adgroup_name", "adgroupname"] },
204
+ { role: "ad_id", macro: "{AdId}", names: ["ad_id", "adid"] },
205
+ { role: "keyword", macro: "{Keyword}", names: ["keyword", "kw"] },
206
+ { role: "match_type", macro: "{MatchType}", names: ["match_type", "matchtype", "mt"] },
207
+ {
208
+ role: "search_query",
209
+ macro: "{QueryString}",
210
+ names: ["search_query", "querystring"],
211
+ note: "What the visitor typed. Google has no equivalent."
212
+ },
213
+ { role: "network", macro: "{Network}", names: ["network"] },
214
+ { role: "device", macro: "{Device}", names: ["device"] }
215
+ ]
216
+ };
217
+ var LINKEDIN = {
218
+ platform: "linkedin",
219
+ label: "LinkedIn Ads",
220
+ docs: "https://learn.microsoft.com/en-us/linkedin/marketing/integrations/ads-reporting/dynamic-utm-tracking",
221
+ dimensions: [
222
+ { role: "account_name", macro: "{{ACCOUNT_NAME}}", names: ["account_name"] },
223
+ {
224
+ role: "campaign_id",
225
+ macro: "{{CAMPAIGN_GROUP_ID}}",
226
+ names: ["campaign_group_id", "campaign_id"],
227
+ note: "LinkedIn's campaign group is the level other platforms call a campaign."
228
+ },
229
+ { role: "campaign_name", macro: "{{CAMPAIGN_GROUP_NAME}}", names: ["campaign_group_name", "campaign_name"] },
230
+ {
231
+ role: "adgroup_id",
232
+ macro: "{{CAMPAIGN_ID}}",
233
+ names: ["adgroup_id"],
234
+ note: "LinkedIn's campaign is the level other platforms call an ad group."
235
+ },
236
+ { role: "adgroup_name", macro: "{{CAMPAIGN_NAME}}", names: ["adgroup_name"] },
237
+ { role: "ad_id", macro: "{{CREATIVE_ID}}", names: ["creative_id", "ad_id"] },
238
+ { role: "ad_name", macro: "{{CREATIVE_NAME}}", names: ["creative_name", "ad_name"] }
239
+ ]
240
+ };
241
+ var TIKTOK = {
242
+ platform: "tiktok",
243
+ label: "TikTok Ads",
244
+ docs: "https://ads.tiktok.com/help/article/track-offsite-web-events-with-utm-parameters",
245
+ dimensions: [
246
+ { role: "campaign_id", macro: "__CAMPAIGN_ID__", names: ["campaign_id", "campaignid"] },
247
+ { role: "campaign_name", macro: "__CAMPAIGN_NAME__", names: ["campaign_name", "campaignname"] },
248
+ {
249
+ role: "adgroup_id",
250
+ macro: "__AID__",
251
+ names: ["adgroup_id", "aid"],
252
+ note: "__AID__ is the ad GROUP id, not the ad id."
253
+ },
254
+ { role: "adgroup_name", macro: "__AID_NAME__", names: ["adgroup_name"] },
255
+ {
256
+ role: "ad_id",
257
+ macro: "__CID__",
258
+ names: ["ad_id", "cid"],
259
+ note: "__CID__ is the creative id, not the campaign id."
260
+ },
261
+ { role: "ad_name", macro: "__CID_NAME__", names: ["ad_name"] },
262
+ { role: "placement", macro: "__PLACEMENT__", names: ["placement"], note: "TikTok or TikTok Pangle." }
263
+ ]
264
+ };
265
+ var REDDIT = {
266
+ platform: "reddit",
267
+ label: "Reddit Ads",
268
+ docs: "https://business.reddithelp.com/s/article/URL-Parameters",
269
+ dimensions: [
270
+ { role: "campaign_id", macro: "{{CAMPAIGN_ID}}", names: ["campaign_id", "campaignid"] },
271
+ { role: "campaign_name", macro: "{{CAMPAIGN_NAME}}", names: ["campaign_name"] },
272
+ { role: "adgroup_id", macro: "{{ADGROUP_ID}}", names: ["adgroup_id", "ad_group_id"] },
273
+ { role: "adgroup_name", macro: "{{ADGROUP_NAME}}", names: ["adgroup_name", "ad_group_name"] },
274
+ { role: "ad_id", macro: "{{AD_ID}}", names: ["ad_id", "adid"] },
275
+ { role: "ad_name", macro: "{{AD_NAME}}", names: ["ad_name"] },
276
+ { role: "device", macro: "{{DEVICE_GROUP}}", names: ["device", "device_group"] }
277
+ ]
278
+ };
279
+ var PINTEREST = {
280
+ platform: "pinterest",
281
+ label: "Pinterest Ads",
282
+ docs: "https://help.pinterest.com/en/business/article/third-party-and-dynamic-tracking",
283
+ dimensions: [
284
+ { role: "campaign_id", macro: "{campaignid}", names: ["campaign_id", "campaignid"] },
285
+ { role: "campaign_name", macro: "{campaign_name}", names: ["campaign_name", "campaignname"] },
286
+ { role: "adgroup_id", macro: "{adgroupid}", names: ["adgroup_id", "adgroupid"] },
287
+ { role: "adgroup_name", macro: "{ad_group_name}", names: ["adgroup_name", "adgroupname"] },
288
+ {
289
+ role: "ad_id",
290
+ macro: "{adid}",
291
+ names: ["ad_id", "adid", "creative_id"],
292
+ note: "The promoted Pin, not the Pin itself."
293
+ },
294
+ { role: "device", macro: "{device}", names: ["device"], note: "c computer, m mobile, t tablet." },
295
+ { role: "product_id", macro: "{product_id}", names: ["product_id"], note: "Shopping campaigns only." }
296
+ ]
297
+ };
298
+ var SNAPCHAT = {
299
+ platform: "snapchat",
300
+ label: "Snapchat Ads",
301
+ docs: "https://businesshelp.snapchat.com/s/article/url-parameters",
302
+ dimensions: [
303
+ { role: "campaign_id", macro: "{{campaign.id}}", names: ["campaign_id", "campaignid"] },
304
+ { role: "campaign_name", macro: "{{campaign.name}}", names: ["campaign_name"] },
305
+ {
306
+ role: "adgroup_id",
307
+ macro: "{{adSet.id}}",
308
+ names: ["adset_id", "adgroup_id"],
309
+ note: "Case-sensitive: {{adset.id}} does not resolve."
310
+ },
311
+ { role: "adgroup_name", macro: "{{adSet.name}}", names: ["adset_name", "adgroup_name"] },
312
+ { role: "ad_id", macro: "{{ad.id}}", names: ["ad_id", "adid"] },
313
+ { role: "ad_name", macro: "{{creative.name}}", names: ["ad_name", "creative_name"] }
314
+ ]
315
+ };
316
+ var CHATGPT = {
317
+ platform: "chatgpt",
318
+ label: "ChatGPT Ads",
319
+ docs: "https://help.openai.com/en/articles/20001212-create-ads-for-chatgpt",
320
+ dimensions: [
321
+ { role: "campaign_id", macro: "{campaign_id}", names: ["campaign_id", "campaignid"] },
322
+ { role: "adgroup_id", macro: "{ad_group_id}", names: ["ad_group_id", "adgroup_id"] },
323
+ { role: "ad_id", macro: "{ad_id}", names: ["ad_id", "adid"] }
324
+ ]
325
+ };
326
+ var AD_PLATFORM_DEFINITIONS = {
327
+ google: GOOGLE,
328
+ meta: META,
329
+ microsoft: MICROSOFT,
330
+ linkedin: LINKEDIN,
331
+ tiktok: TIKTOK,
332
+ reddit: REDDIT,
333
+ pinterest: PINTEREST,
334
+ snapchat: SNAPCHAT,
335
+ chatgpt: CHATGPT
336
+ };
337
+ var ESSENTIAL_ROLES = ["campaign_id", "adgroup_id", "ad_id", "keyword", "match_type"];
338
+ function essentialAdDimensions(platform) {
339
+ return AD_PLATFORM_DEFINITIONS[platform].dimensions.filter((entry) => ESSENTIAL_ROLES.includes(entry.role));
340
+ }
341
+ function normalizeAdParamName(raw) {
342
+ return raw.trim().toLowerCase().slice(0, 64);
343
+ }
344
+ function builtinFor(platform) {
345
+ const mapping = {};
346
+ for (const dimension of AD_PLATFORM_DEFINITIONS[platform].dimensions) {
347
+ for (const name of dimension.names) mapping[normalizeAdParamName(name)] = dimension.role;
348
+ }
349
+ return mapping;
350
+ }
351
+ var BUILTIN = Object.fromEntries(
352
+ AD_PLATFORMS.map((platform) => [platform, builtinFor(platform)])
353
+ );
354
+ function builtinAdParamMapping(platform) {
355
+ return BUILTIN[platform];
356
+ }
357
+ var EVERY_BUILTIN_AD_PARAM_NAME = [
358
+ ...new Set(AD_PLATFORMS.flatMap((platform) => Object.keys(BUILTIN[platform])))
359
+ ].sort();
360
+ var CAPTURED_WITHOUT_ROLE = [
361
+ "account_id",
362
+ "audience",
363
+ "device_model",
364
+ "devicemodel",
365
+ "experiment",
366
+ "extensionid",
367
+ "feed_item_id",
368
+ "feeditemid",
369
+ "loc_interest_ms",
370
+ "loc_physical_ms",
371
+ "location_interest",
372
+ "location_physical",
373
+ "target_id",
374
+ "targetid"
375
+ ].sort();
376
+
377
+ // ../api/src/analytics/peopleSearch.ts
378
+ import { z } from "zod";
379
+
380
+ // ../api/src/identity/digest.ts
381
+ var SHA256_HEX = /^[0-9a-fA-F]{64}$/;
382
+ function isSha256Hex(value) {
383
+ return SHA256_HEX.test(value);
384
+ }
385
+
386
+ // ../api/src/identity/email.ts
387
+ function normalizeEmailV1(raw) {
388
+ const trimmed = raw.trim().toLowerCase();
389
+ return trimmed === "" ? null : trimmed;
390
+ }
391
+ var EMAIL = /^[^\s@]+@[^\s@.]+(?:\.[^\s@.]+)+$/;
392
+ function normalizeEmailV2(raw) {
393
+ const trimmed = raw.trim().toLowerCase();
394
+ return EMAIL.test(trimmed) ? trimmed : null;
395
+ }
396
+
397
+ // ../api/src/identity/phone.ts
398
+ function normalizePhoneV1(raw) {
399
+ const digits = raw.trim().toLowerCase().replace(/[^0-9]/g, "");
400
+ return digits === "" ? null : `+${digits}`;
401
+ }
402
+ var PHONE_PUNCTUATION = /[\s()./-]/g;
403
+ var E164 = /^\+[1-9]\d{7,14}$/;
404
+ function normalizePhoneV2(raw) {
405
+ const compact = raw.replace(PHONE_PUNCTUATION, "");
406
+ const e164 = compact.startsWith("00") ? `+${compact.slice(2)}` : compact;
407
+ return E164.test(e164) ? e164 : null;
408
+ }
409
+
410
+ // ../api/src/identity/index.ts
411
+ function normalizeIdentity(raw, version) {
412
+ const value = raw.kind === "email" ? version === 1 ? normalizeEmailV1(raw.value) : normalizeEmailV2(raw.value) : version === 1 ? normalizePhoneV1(raw.value) : normalizePhoneV2(raw.value);
413
+ return value === null ? null : { kind: raw.kind, value, normalizationVersion: version };
414
+ }
415
+
416
+ // ../api/src/analytics/peopleSearch.ts
417
+ var PEOPLE_SEARCH_MAX_TERMS = 50;
418
+ var VERBATIM_KINDS = [
419
+ "browser",
420
+ "gclid",
421
+ "wbraid",
422
+ "gbraid",
423
+ "dclid",
424
+ "fbclid",
425
+ "ttclid",
426
+ "twclid",
427
+ "li_fat_id",
428
+ "msclkid",
429
+ "rdt_cid",
430
+ "epik",
431
+ "sccid",
432
+ "oppref",
433
+ "fbp",
434
+ "fbc"
435
+ ];
436
+ var PREFIXES = {
437
+ email: "email",
438
+ mail: "email",
439
+ phone: "phone",
440
+ tel: "phone",
441
+ external: "external",
442
+ contact: "external",
443
+ hubspot: "external",
444
+ id: "external",
445
+ deal: "deal",
446
+ digest: "digest",
447
+ hash: "digest",
448
+ browser: "browser",
449
+ anon: "browser",
450
+ ...Object.fromEntries(VERBATIM_KINDS.map((kind) => [kind, kind]))
451
+ };
452
+ var TERM_SEPARATORS = /[\n\r\t,;]+/;
453
+ var EMAIL_SHAPE = /^[^\s@]+@[^\s@]+$/;
454
+ var DIGITS = /^\d+$/;
455
+ var INTERNATIONAL_PHONE = /^(\+|00)[\d\s().-]{7,}$/;
456
+ var META_COOKIE = /^fb\.\d\./;
457
+ function kindOf(value) {
458
+ if (EMAIL_SHAPE.test(value)) return "email";
459
+ if (isSha256Hex(value)) return "digest";
460
+ if (INTERNATIONAL_PHONE.test(value)) return "phone";
461
+ if (DIGITS.test(value)) return "number";
462
+ if (META_COOKIE.test(value)) return "fbc";
463
+ return "key";
464
+ }
465
+ function readTerm(input) {
466
+ const colon = input.indexOf(":");
467
+ if (colon > 0) {
468
+ const kind = PREFIXES[input.slice(0, colon).trim().toLowerCase()];
469
+ const value = input.slice(colon + 1).trim();
470
+ if (kind !== void 0 && value !== "") return { input, kind, value };
471
+ }
472
+ return { input, kind: kindOf(input), value: input };
473
+ }
474
+ function sameness(term) {
475
+ switch (term.kind) {
476
+ case "email":
477
+ case "phone":
478
+ return `${term.kind}|${normalizeIdentity({ kind: term.kind, value: term.value }, 1)?.value ?? term.value}`;
479
+ case "external":
480
+ case "digest":
481
+ return `${term.kind}|${term.value.toLowerCase()}`;
482
+ default:
483
+ return `${term.kind}|${term.value}`;
484
+ }
485
+ }
486
+ function parsePeopleQuery(text2) {
487
+ const inputs = (typeof text2 === "string" ? [text2] : text2).flatMap((part) => part.split(TERM_SEPARATORS));
488
+ const seen = /* @__PURE__ */ new Set();
489
+ const terms = [];
490
+ for (const raw of inputs) {
491
+ const input = raw.trim();
492
+ if (input === "") continue;
493
+ const term = readTerm(input);
494
+ const identity = sameness(term);
495
+ if (seen.has(identity)) continue;
496
+ seen.add(identity);
497
+ terms.push(term);
498
+ }
499
+ return {
500
+ terms: terms.slice(0, PEOPLE_SEARCH_MAX_TERMS),
501
+ dropped: Math.max(0, terms.length - PEOPLE_SEARCH_MAX_TERMS)
502
+ };
503
+ }
504
+ var personTermInputSchema = z.string().trim().min(1).max(320);
505
+ var peopleSearchInputSchema = z.array(personTermInputSchema).min(1).max(PEOPLE_SEARCH_MAX_TERMS * 4);
506
+ var peopleLookupRequestSchema = z.object({ people: peopleSearchInputSchema });
507
+ var peopleSearchTermSchema = z.object({
508
+ /** Position in the search; what `personTerms` on a feed row points at. */
509
+ term: z.number().int(),
510
+ input: z.string(),
511
+ kind: z.string(),
512
+ /**
513
+ * Why this line could not be looked up as asked, in the reader's words — a
514
+ * deal HubSpot does not know, HubSpot not connected. Empty when it was.
515
+ */
516
+ problem: z.string().default(""),
517
+ /** A deal's contacts, as found in the CRM. Empty for every other kind. */
518
+ contacts: z.array(z.string()).default([])
519
+ });
520
+ var peopleLookupRowSchema = peopleSearchTermSchema.extend({
521
+ found: z.boolean(),
522
+ events: z.number(),
523
+ firstSeen: z.string(),
524
+ lastSeen: z.string(),
525
+ pageViews: z.number(),
526
+ landings: z.number(),
527
+ visits: z.number(),
528
+ formSubmits: z.number(),
529
+ /** What the company's own systems reported about them, by event name — CRM stages, orders. */
530
+ systemEvents: z.array(z.string()),
531
+ pageEvents: z.array(z.string()),
532
+ uploads: z.number(),
533
+ uploadedTo: z.array(z.string()),
534
+ googleClick: z.boolean(),
535
+ metaClick: z.boolean(),
536
+ /** `utm_source`, else the referrer, of the first visit Baker saw. Empty when it saw none. */
537
+ firstSource: z.string(),
538
+ /** Every kind of key they are linked by: `email`, `phone`, `external`, `browser`, a click id. */
539
+ knownBy: z.array(z.string())
540
+ });
541
+ var peopleLookupDataSchema = z.object({
542
+ people: z.array(peopleLookupRowSchema),
543
+ /** Lines past the limit, not looked up. */
544
+ dropped: z.number()
545
+ });
546
+
547
+ // ../api/src/analytics/wire.ts
548
+ import { z as z2 } from "zod";
549
+
550
+ // ../api/src/analytics/conversions.ts
551
+ var CONVERSION_COUNT_MODES = ["once_per_visit", "every_time"];
552
+ var PRIMARY_CONVERSION_TRIGGER = {
553
+ calendly: "calendlyEvent.eventScheduled",
554
+ customForm: "customForm.onFormSubmitted",
555
+ highlevel: "highlevelEvent.appointmentScheduled",
556
+ highlevelForm: "highlevelFormEvent.formSubmitted",
557
+ hubspot: "hubspotForm.onFormSubmitted",
558
+ hubspotMeeting: "hubspotMeeting.onMeetingScheduled",
559
+ link: "link.onClick",
560
+ savvycal: "savvycalEvent.scheduled",
561
+ text: "text.onButtonClicked"
562
+ };
563
+ var NON_SUBMIT_NODE_TYPES = ["link", "text"];
564
+ var STEP_SUBMIT_TRIGGERS = Object.fromEntries(
565
+ Object.entries(PRIMARY_CONVERSION_TRIGGER).filter(([nodeType]) => !NON_SUBMIT_NODE_TYPES.includes(nodeType))
566
+ );
567
+ var MAX_CONVERSION_NAME = 80;
568
+
569
+ // ../api/src/analytics/submissionAnswers.ts
570
+ var MAX_ANSWER_CHARS = 16384;
571
+ var MAX_ANSWER_NAME_CHARS = 120;
572
+ var TRUNCATED = "\u2026";
573
+ function cutToLength(value, max) {
574
+ if (value.length <= max) return value;
575
+ return `${[...value].slice(0, max - 1).join("")}${TRUNCATED}`;
576
+ }
577
+ function boundSubmissionAnswers(answers) {
578
+ const kept = {};
579
+ for (const [name, value] of Object.entries(answers)) {
580
+ kept[cutToLength(name, MAX_ANSWER_NAME_CHARS)] = cutToLength(value, MAX_ANSWER_CHARS);
581
+ }
582
+ return kept;
583
+ }
584
+
585
+ // ../api/src/analytics/wire.ts
586
+ var SEND_FILTERS = ["any", "failed", "skipped"];
587
+ var adParamRoleSchema = z2.enum(AD_PARAM_ROLES);
588
+ var ANALYTICS_MAX_PAGE_SIZE = 200;
589
+ var ANALYTICS_MAX_PAGE = 500;
590
+ function isResolvableTimeZone(value) {
591
+ try {
592
+ new Intl.DateTimeFormat("en-US", { timeZone: value });
593
+ return true;
594
+ } catch {
595
+ return false;
596
+ }
597
+ }
598
+ var analyticsPresetSchema = z2.enum([
599
+ /** Everything that matters in one call — the default entry point. */
600
+ "overview",
601
+ /** Traffic shape: trend, sources, geo, device. */
602
+ "traffic",
603
+ /** Per-step drop-off for the company's Forms. */
604
+ "funnel",
605
+ /**
606
+ * One Form in depth: its steps, where people went between them, and how many
607
+ * converted at the node that actually produced the conversion.
608
+ *
609
+ * Distinct from `funnel`, which is a per-step table across every Form.
610
+ * A Form with branches is not a table — a visitor who leaves step two for
611
+ * the booking branch and a visitor who leaves it for nothing are the same
612
+ * row there, and they are the whole question. `paths` returns the edges
613
+ * between steps, which is what a Sankey draws.
614
+ */
615
+ "flow",
616
+ /** One page in detail. */
617
+ "page",
618
+ /**
619
+ * Every Form trigger that fired, and how much of it produced a side effect.
620
+ *
621
+ * Separate from `funnel` because it answers a different question: the funnel
622
+ * measures the steps a visitor walked, this measures the things they *did* —
623
+ * clicking the link that redirects them out, an embedded checkout posting
624
+ * back — most of which have nothing configured against them and none of
625
+ * which appear as a step.
626
+ */
627
+ "triggers",
628
+ /** What each published build did, so a change can be attributed to a publish. */
629
+ "releases",
630
+ /**
631
+ * One ad dimension broken down, plus what is actually on the URLs.
632
+ *
633
+ * Answers the question the ad platform cannot: not how many clicks a keyword
634
+ * bought, but whether the people it brought read the page, filled the Form
635
+ * or left immediately. Pair it with `adRole` to choose the dimension; the
636
+ * parameter inventory comes back either way, because on a half-tagged
637
+ * account "there is no keyword on 80% of your paid traffic" is the finding.
638
+ */
639
+ "ads",
640
+ /**
641
+ * Every landing side by side: traffic, entrances, conversion rate, and a
642
+ * sparkline each, joined to the landing's real name and tags.
643
+ *
644
+ * The list view. `page` answers one page in depth and needs to be told which
645
+ * one; this answers "which of my pages is working" without knowing the
646
+ * answer first, and is what a landings screen renders.
647
+ */
648
+ "landings",
649
+ /**
650
+ * The same numbers grouped by the tag a landing is filed under.
651
+ *
652
+ * The unit a campaign is actually run at. Nobody asks how `/pricing-b` did;
653
+ * they ask how the September push did, and September was six landings.
654
+ */
655
+ "tags",
656
+ /**
657
+ * Events a page defined for itself — a section seen, a video played, a
658
+ * pricing toggle flipped.
659
+ *
660
+ * Separate from every other preset because the vocabulary is the page's
661
+ * rather than the product's. Mixing them into `traffic` would produce a list
662
+ * half of which the reader has to already know is bespoke.
663
+ */
664
+ "events",
665
+ /**
666
+ * Browser, OS, engine and viewport of real visitors.
667
+ *
668
+ * `traffic` reports the device family, which is enough to notice that mobile
669
+ * converts worse and not enough to do anything about it. This is narrow
670
+ * enough to reproduce a bug on.
671
+ */
672
+ "devices",
673
+ /**
674
+ * Paid acquisition, grouped the way money is spent.
675
+ *
676
+ * Distinct from `traffic` in two ways that matter. It groups by SESSION, so a
677
+ * visitor counts once for the campaign they arrived on rather than once per
678
+ * page they read. And it reports leads that were actually DELIVERED, not
679
+ * `form_submit` events — a campaign whose forms all submit and whose CRM is
680
+ * rejecting every one of them reads as converting perfectly on every other
681
+ * preset here, and reads as zero delivered on this one.
682
+ */
683
+ "paid",
684
+ /**
685
+ * Where each submission actually went, and what each destination made of it.
686
+ *
687
+ * The preset for "I filled in the form, where is my lead?". One row per
688
+ * submission listing every destination, its outcome, and the id the
689
+ * destination gave the record it created — which is what turns "it says
690
+ * success" into something a client can open and check.
691
+ */
692
+ "delivery",
693
+ /**
694
+ * Every attempt anybody made at a Form, delivered or not.
695
+ *
696
+ * The wider companion to `delivery`, and the one that answers "I filled in
697
+ * my own form, where is it?" honestly. `delivery` starts from the dispatch,
698
+ * so a Form wired to no destination produces no row in it at all — which is
699
+ * correct for "what did we hand to their CRM" and reads as data loss to
700
+ * everybody else. The grain here is the attempt: one visitor, one Form, one
701
+ * visit, whether they finished, gave up halfway, or completed a Form that
702
+ * sends nowhere.
703
+ */
704
+ "submissions",
705
+ /**
706
+ * Where the people who convert actually are, at whatever resolution is asked
707
+ * for.
708
+ *
709
+ * `traffic` breaks acquisition down by country, which is the right grain for
710
+ * "which market is this campaign working in" and the wrong one for every
711
+ * decision a local advertiser makes. A dentist buying a five-mile radius or a
712
+ * franchise choosing where to open is asking about postcodes, which is also
713
+ * how the ad platforms sell that targeting.
714
+ */
715
+ "geo",
716
+ /**
717
+ * Which machines are fetching this site.
718
+ *
719
+ * Every other preset here excludes them, which is correct — a crawler is not
720
+ * an audience — and a verify check now enforces that rather than trusting it. The rows are kept, though, and this is what
721
+ * they are kept for: whether Google is still crawling a page that was
722
+ * republished, whether Meta fetched the link preview before spend went
723
+ * behind the URL, and how much of the traffic is now AI answer engines.
724
+ */
725
+ "bots",
726
+ /**
727
+ * One visit, replayed end to end — and every visit the same person made
728
+ * before it.
729
+ *
730
+ * The only preset that answers about a *person* rather than a population.
731
+ * Every other report here aggregates, which is the right shape for "is the
732
+ * campaign working" and useless for the question a marketer asks the moment
733
+ * a lead arrives: who was this, where did they come from, what did they read,
734
+ * and did their details reach the CRM. Answering that from an aggregate is
735
+ * impossible by construction.
736
+ *
737
+ * Needs `sessionId`. Give `identityHash` as well and it also returns the
738
+ * person's earlier visits, including the anonymous ones from before they ever
739
+ * identified themselves — which is the difference between "converted on the
740
+ * first visit" and "converted on the fourth", two very different businesses.
741
+ */
742
+ "session",
743
+ /**
744
+ * Everybody who visited, one row per person — converted or not.
745
+ *
746
+ * The unit here is a *person*, which no other preset has. `traffic` counts
747
+ * visitors and cannot name one; `delivery` names the ones who became a lead
748
+ * and is silent about the ninety-odd percent who did not; `session` describes
749
+ * one visit and has to be told which. This is the list those are read from.
750
+ *
751
+ * Grouped by browser cookie, so somebody who came back on Wednesday is one
752
+ * row and not two. Pass `onlyConverted` for the converted-only cut, and
753
+ * `landingId` to ask who visited one page.
754
+ *
755
+ * Not offered as a `baker analytics` preset, for the same reason `realtime`
756
+ * is not: it answers about individuals, and an agent writing a client report
757
+ * should be reading the population.
758
+ */
759
+ "people",
760
+ /**
761
+ * Who is on the site right now.
762
+ *
763
+ * The only preset measured from `now()` rather than over a date window, and
764
+ * the only one meant to be polled. Kept out of `overview` for exactly that
765
+ * reason: a live counter has to refresh every few seconds and the rest of the
766
+ * page must not refetch with it.
767
+ *
768
+ * Deliberately not offered as a `baker analytics` preset. The sandbox agent
769
+ * works asynchronously — by the time it reads an answer, "the last five
770
+ * minutes" names a window that has passed — so the only thing listing it
771
+ * would do is add a choice the agent can never usefully pick to the menu it
772
+ * reads before picking one.
773
+ */
774
+ "realtime",
775
+ /**
776
+ * What this company counts as a conversion, and everything it could count.
777
+ *
778
+ * The two halves of one question, which is why they are one preset: the list
779
+ * of definitions with what each produced, and the catalogue of every event
780
+ * these pages actually emitted with whether it is already counted. Reading
781
+ * the first without the second is how the previous design failed — a
782
+ * marketer could see that nothing was counted and had no way to find out what
783
+ * was available to count.
784
+ */
785
+ "conversions",
786
+ /**
787
+ * Every event as it was stored, newest first — the one preset that does not
788
+ * reduce.
789
+ *
790
+ * Deliberately not offered as a `baker analytics` preset. It is the raw feed
791
+ * a person watches while wiring something up, and an agent asked to describe
792
+ * an account wants the counts rather than the tape.
793
+ */
794
+ "stream"
795
+ ]);
796
+ var ANALYTICS_PRESETS = analyticsPresetSchema.options;
797
+ var ANALYTICS_EVENT_DOORS = ["pages", "website", "server", "integrations"];
798
+ var analyticsQueryRequestSchema = z2.object({
799
+ preset: analyticsPresetSchema,
800
+ /** Lookback in days. Ignored when `startDate` is given. */
801
+ days: z2.coerce.number().int().positive().max(400).optional(),
802
+ startDate: z2.iso.date().optional(),
803
+ endDate: z2.iso.date().optional(),
804
+ /** Required by the `page` preset; ignored by the others. */
805
+ path: z2.string().max(1024).optional(),
806
+ /** Narrows `funnel` to one Form. Omitted means every Form. */
807
+ flowSlug: z2.string().max(120).optional(),
808
+ /**
809
+ * How far down the `geo` preset looks. Ignored by every other preset.
810
+ *
811
+ * A closed set rather than a column name, because it names a column and a
812
+ * column name taken from a request must never reach the SQL.
813
+ */
814
+ grain: z2.enum(["country", "region", "city", "postal_code", "metro_code"]).optional(),
815
+ /**
816
+ * Narrows `geo` to one country before going finer.
817
+ *
818
+ * Not optional decoration below country level: postcodes collide across
819
+ * markets, so a bare `28001` is a Madrid postcode and a US ZIP at once.
820
+ */
821
+ country: z2.string().max(8).optional(),
822
+ /**
823
+ * Which ad dimension to break down by, or to narrow every other report to.
824
+ *
825
+ * A role from the closed vocabulary — `keyword`, `match_type`,
826
+ * `campaign_id` — never a raw parameter name. The company's own spellings
827
+ * are resolved from its mapping server-side, so a caller asking for
828
+ * "keyword" gets `kw` rows from before a rename as well as `keyword` rows
829
+ * after it, and no request can name a column.
830
+ */
831
+ adRole: adParamRoleSchema.optional(),
832
+ /**
833
+ * Narrows to one value of `adRole`. Requires `adRole`.
834
+ *
835
+ * An empty string with `adRole` set is a real query — "arrived carrying
836
+ * none of these" — which is how you size the untagged half of an account.
837
+ * Omit both to leave the report unnarrowed.
838
+ */
839
+ adValue: z2.string().max(255).optional(),
840
+ /**
841
+ * Read this report in one ad platform's vocabulary, and from its traffic.
842
+ *
843
+ * Two effects, and they belong together. A role resolves against the
844
+ * mapping in force for that platform — so `cid` is TikTok's ad here and
845
+ * nobody's campaign — and the report narrows to the sessions that arrived
846
+ * from it, matched on the click id the platform stamps and, failing that,
847
+ * on `utm_source`. Asking a platform's question of another platform's
848
+ * traffic is how a keyword report ends up counting Meta visits that could
849
+ * not have carried a keyword.
850
+ *
851
+ * Omit it for the union across every platform, which is the honest
852
+ * superset and the right default for "how is paid doing".
853
+ */
854
+ adPlatform: z2.enum(AD_PLATFORMS).optional(),
855
+ /**
856
+ * Read only what came in by one door. See {@link ANALYTICS_EVENT_DOORS}.
857
+ *
858
+ * Omit it for all of it, which is the default and the honest superset.
859
+ * Only the reads where the split is a question somebody asks honour it —
860
+ * the totals, the trend, the two page-event reads, the conversion
861
+ * breakdown and the events catalogue. A session-scoped report cannot: an
862
+ * ingest row carries no `session_id`, deliberately, so there is no visit
863
+ * for it to be counted in.
864
+ */
865
+ eventOrigin: z2.enum(ANALYTICS_EVENT_DOORS).optional(),
866
+ /**
867
+ * `stream` only: keep just one kind of event, named by the key
868
+ * `conversions` hands back in its catalogue.
869
+ *
870
+ * The key rather than `eventName`, because three of the four families have
871
+ * no name of their own — a Form's trigger, a submit, an outbound click —
872
+ * and a filter that could only name the fourth would be a filter that hides
873
+ * most of the feed from itself.
874
+ */
875
+ eventKey: z2.string().optional(),
876
+ /**
877
+ * `stream` only: keep just what one source sent, by the source's name —
878
+ * the `baker_source` every event from an address or a HubSpot read
879
+ * carries. Names come from `baker analytics sources`.
880
+ */
881
+ sourceName: z2.string().optional(),
882
+ /**
883
+ * `stream` only: keep just the uploads a conversion's sends made —
884
+ * `any` for every upload, `failed` for the ones the platform refused.
885
+ */
886
+ sends: z2.enum(SEND_FILTERS).optional(),
887
+ /** `stream` only: keep just the uploads one send made, by its id (`s1`). */
888
+ sendId: z2.string().optional(),
889
+ /** `stream` only: keep what went to one destination (`meta`, `httpWebhook`) — a Form's deliveries and sends' uploads alike. */
890
+ sentTo: z2.string().max(64).optional(),
891
+ /** `stream` only: one event by its uid, and every upload made for it — with the platform's verdict on each. */
892
+ eventUid: z2.string().optional(),
893
+ /** Return the long breakdowns and the per-day trend. */
894
+ full: z2.boolean().optional(),
895
+ /**
896
+ * IANA zone the day boundaries are drawn in. Defaults to UTC.
897
+ *
898
+ * Not cosmetic. Bucketing a Madrid client's traffic by UTC days moves two
899
+ * hours of every evening into the following day, so "Tuesday" is not
900
+ * Tuesday and a day-of-week comparison is wrong by however much traffic
901
+ * arrives after 22:00 — which on a consumer landing is a lot of it.
902
+ *
903
+ * Validated against the platform's own zone database rather than an enum,
904
+ * because the list is the platform's and not ours — but validated it must
905
+ * be. The zone is substituted into the query as a string literal and
906
+ * ClickHouse rejects one it cannot resolve, so an unrecognised zone used to
907
+ * fail the whole report as an INTERNAL_ERROR with nothing naming the cause.
908
+ *
909
+ * Rejected rather than quietly defaulted to UTC. A silent fallback returns
910
+ * a report that looks like the one that was asked for and is bucketed on
911
+ * different days, which is the exact error this parameter exists to
912
+ * prevent — better to say the zone is unknown than to answer for the wrong
913
+ * one.
914
+ */
915
+ timezone: z2.string().max(64).refine(isResolvableTimeZone, { message: "Unknown timezone \u2014 pass an IANA zone such as Europe/Madrid" }).optional(),
916
+ /**
917
+ * How wide one point of a series is.
918
+ *
919
+ * Chosen by the caller rather than derived from the window, because the
920
+ * caller knows what it is drawing: the same 30 days is 30 points on a
921
+ * dashboard and 4 on a slide. A 24-hour window at `day` granularity is one
922
+ * bar, which is the shape this exists to prevent.
923
+ */
924
+ granularity: z2.enum(["hour", "day", "week", "month"]).optional(),
925
+ /**
926
+ * Narrow to one landing by its `internalId`.
927
+ *
928
+ * The reference where `path` is a description: it survives the page being
929
+ * renamed or moved, which is exactly when a before-and-after comparison
930
+ * matters most and is exactly when `path` stops matching.
931
+ */
932
+ landingId: z2.string().max(120).optional(),
933
+ /** Narrows `landings` to the landings carrying one tag. */
934
+ tag: z2.string().max(32).optional(),
935
+ /**
936
+ * Which visit the `session` preset replays.
937
+ *
938
+ * Ignored by every other preset. Not a filter on the aggregates: narrowing
939
+ * a population report to one visitor produces numbers that are individually
940
+ * true and collectively meaningless.
941
+ */
942
+ sessionId: z2.string().max(120).optional(),
943
+ /**
944
+ * Whose earlier visits to resolve, as a lowercase hex digest.
945
+ *
946
+ * A digest and never an address: the identity a page sends is hashed in the
947
+ * browser, and nothing downstream of that ever holds the original.
948
+ */
949
+ identityHash: z2.string().max(128).optional(),
950
+ /** Which page-defined event the `events` preset breaks down. */
951
+ eventName: z2.string().max(120).optional(),
952
+ /** Which of that event's own properties to break it down by. */
953
+ property: z2.string().max(64).optional(),
954
+ /**
955
+ * Narrow the breakdown to the rows carrying one property value.
956
+ *
957
+ * Not the same as breaking down by a second key. Video is the case that
958
+ * demanded it: every milestone carries `autoplay`, and the retention curve
959
+ * of the videos a visitor chose to play is a different curve from the one a
960
+ * muted hero produces by playing to nobody. Grouping gives the two totals;
961
+ * only filtering gives either curve.
962
+ */
963
+ where: z2.object({ property: z2.string().max(64), value: z2.string().max(120) }).optional(),
964
+ /**
965
+ * An ordered funnel over page-defined event names.
966
+ *
967
+ * Data rather than schema, deliberately: defining a new funnel is a
968
+ * parameter on a request, not a migration and a deploy. The order is the
969
+ * caller's and is enforced — a session counts at step N only if it produced
970
+ * step N after step N-1, or "saw pricing then clicked demo" and the reverse
971
+ * would be the same number.
972
+ */
973
+ steps: z2.array(z2.string().max(120)).max(10).optional(),
974
+ /**
975
+ * Also return the immediately preceding window of the same length.
976
+ *
977
+ * The first question anyone asks of a number is "compared to what". Served
978
+ * as a second full totals read rather than a delta computed in SQL, so the
979
+ * comparison window is described in the response and a caller can render
980
+ * either side of it.
981
+ */
982
+ compare: z2.boolean().optional(),
983
+ /** `devices` only: which facet to group on. */
984
+ deviceGrain: z2.enum(["browser", "os", "engine", "device", "viewport"]).optional(),
985
+ /**
986
+ * One browser, by its cookie id.
987
+ *
988
+ * Narrows `people` to a single person, narrows `stream` to everything
989
+ * that person did, and replays that person's whole history on `session` —
990
+ * every visit they made, not just the one. Given with `sessionId`, the
991
+ * session wins and this is ignored.
992
+ *
993
+ * On `stream` it is a seed rather than a cookie filter: the browser plus
994
+ * every address, phone, click id and platform cookie ever seen beside it.
995
+ * Filtering on the cookie alone would drop exactly the rows the reader
996
+ * came for — a deal a CRM posted names the person and carries no cookie.
997
+ */
998
+ anonId: z2.string().max(120).optional(),
999
+ /**
1000
+ * `stream` and `session`: one person by any key the store recognises them
1001
+ * by — a contact digest, a CRM id, a click id, a platform cookie — for the
1002
+ * rows a system posted about somebody no browser has named yet. A browser
1003
+ * wins when both are given.
1004
+ */
1005
+ personKind: z2.string().max(40).optional(),
1006
+ personValue: z2.string().max(255).optional(),
1007
+ /**
1008
+ * `stream` only: several people, each by whatever the reader holds about
1009
+ * them — an email, a phone, a CRM contact or deal id, a click id, a browser
1010
+ * id, `kind:value` to say which. Emails and phones are hashed by the
1011
+ * server; the plaintext never reaches the store. Wins over the single
1012
+ * person above, and every row comes back naming which of these it is
1013
+ * (`personTerms`), with how each was read in `peopleSearch`.
1014
+ */
1015
+ people: peopleSearchInputSchema.optional(),
1016
+ /**
1017
+ * `people` only: keep only the visitors who converted.
1018
+ *
1019
+ * A parameter rather than a client-side filter because the list is capped:
1020
+ * filtering the most recent 200 visitors down to the ones who converted
1021
+ * usually leaves two, and reads as "we had two leads".
1022
+ */
1023
+ onlyConverted: z2.boolean().optional(),
1024
+ /**
1025
+ * Which page of a list-shaped report to read, 1-based.
1026
+ *
1027
+ * Only three reports are lists of individual things rather than
1028
+ * breakdowns — `people`, `submissions` and `delivery` — and only those
1029
+ * three take this. A breakdown is a top-N by construction: page two of
1030
+ * "your busiest countries" is not a thing anybody wants.
1031
+ *
1032
+ * It exists because the alternative silently stopped being true. Every one
1033
+ * of those lists was capped, the cap was invisible, and the summary line
1034
+ * above the list counted the rows it had been handed — so an account with
1035
+ * four thousand visitors read "200 people visited in this period" with no
1036
+ * indication that the number was the cap talking. A cap that is reported is
1037
+ * a page; a cap that is not is a wrong answer.
1038
+ */
1039
+ page: z2.coerce.number().int().min(1).max(ANALYTICS_MAX_PAGE).optional(),
1040
+ /**
1041
+ * How many rows one page holds. Bounded, because the reader is a browser.
1042
+ *
1043
+ * Omitted, a list keeps the size it had before pagination existed, which is
1044
+ * what keeps `baker analytics submissions --full` returning the same 800
1045
+ * rows it always did for an agent that reads the whole thing in one go.
1046
+ */
1047
+ pageSize: z2.coerce.number().int().min(1).max(ANALYTICS_MAX_PAGE_SIZE).optional()
1048
+ }).refine((value) => value.preset !== "page" || typeof value.path === "string", {
1049
+ message: "The 'page' preset needs --path",
1050
+ path: ["path"]
1051
+ }).refine(
1052
+ (value) => value.preset !== "session" || typeof value.sessionId === "string" || typeof value.anonId === "string" || typeof value.personValue === "string",
1053
+ {
1054
+ message: "The 'session' preset needs --session, a browser id or a person key",
1055
+ path: ["sessionId"]
1056
+ }
1057
+ ).refine((value) => value.property === void 0 || typeof value.eventName === "string", {
1058
+ message: "Breaking an event down by a property needs --event too",
1059
+ path: ["property"]
1060
+ }).refine((value) => value.where === void 0 || typeof value.property === "string", {
1061
+ message: "Narrowing with --where needs --event and --property too",
1062
+ path: ["where"]
1063
+ });
1064
+ var analyticsWindowSchema = z2.object({
1065
+ startDate: z2.iso.date(),
1066
+ endDate: z2.iso.date(),
1067
+ days: z2.number().int().positive(),
1068
+ /** True when the window reaches past the datasource TTL, so part of it is simply gone. */
1069
+ beyondRetention: z2.boolean()
1070
+ });
1071
+ var analyticsTotalsSchema = z2.object({
1072
+ /** Counted from `visitor_new`. */
1073
+ visitors: z2.number().int().nonnegative(),
1074
+ /** Counted from `session_start`. */
1075
+ sessions: z2.number().int().nonnegative(),
1076
+ pageViews: z2.number().int().nonnegative(),
1077
+ /**
1078
+ * Every conversion, counting a visit twice when it converted twice.
1079
+ *
1080
+ * A Form's author can mark an outcome as counting every time it happens — a
1081
+ * download, a repeatable action — so this legitimately runs ahead of
1082
+ * {@link convertingSessions}, and of `sessions`.
1083
+ */
1084
+ conversions: z2.number().int().nonnegative(),
1085
+ /**
1086
+ * Conversions in the window that no landing earned — by people none of the
1087
+ * company's pages saw. Not in `conversions`, which is a page metric; shown
1088
+ * beside it so a deal a CRM reported is never a silent zero. Zero under any
1089
+ * scope.
1090
+ */
1091
+ unplacedConversions: z2.number().int().nonnegative().default(0),
1092
+ /** Visits that produced at least one conversion. Never above `sessions`. */
1093
+ convertingSessions: z2.number().int().nonnegative(),
1094
+ /**
1095
+ * Converting visits per visit, 0–1. Null when there were no visits.
1096
+ *
1097
+ * Over converting visits rather than over conversions, because the second
1098
+ * ratio passes 1 the moment one visit converts twice — and a headline card
1099
+ * reading "125%" is read as a broken report, not as a visitor who did the
1100
+ * thing twice. The count above still says how often it happened.
1101
+ */
1102
+ conversionRate: z2.number().min(0).max(1).nullable(),
1103
+ avgEngagementMs: z2.number().nonnegative().nullable(),
1104
+ /** Page views per session. At or near 1 means visitors leave from the page they land on. */
1105
+ pagesPerSession: z2.number().nonnegative().nullable()
1106
+ });
1107
+ var analyticsTrendPointSchema = z2.object({
1108
+ /**
1109
+ * The bucket's start, as an ISO instant.
1110
+ *
1111
+ * A full instant rather than a date, because a series is no longer always
1112
+ * daily: at `hour` granularity `2026-08-22` names twenty-four points, and at
1113
+ * `month` it names one that started three weeks earlier. It is also now
1114
+ * timezone-aware, so the same instant is a different calendar day depending
1115
+ * on the zone the caller asked for — which a bare `YYYY-MM-DD` cannot
1116
+ * express without silently choosing one.
1117
+ */
1118
+ bucket: z2.string(),
1119
+ visitors: z2.number().int().nonnegative(),
1120
+ sessions: z2.number().int().nonnegative(),
1121
+ pageViews: z2.number().int().nonnegative(),
1122
+ conversions: z2.number().int().nonnegative()
1123
+ });
1124
+ var analyticsLandingRowSchema = z2.object({
1125
+ /** The landing's `internalId` — the reference every event carries. */
1126
+ landingId: z2.string(),
1127
+ /** The Convex `landings._id`, so a dashboard can link straight to the row. */
1128
+ landingRef: z2.string(),
1129
+ /**
1130
+ * What a person calls it, or `""` when the dimension has not been mirrored
1131
+ * yet.
1132
+ *
1133
+ * Empty is a real and temporary state — a landing published before the
1134
+ * mirror existed, or one whose sync has not run — and it is reported rather
1135
+ * than papered over with the id, so a caller can say "not synced yet"
1136
+ * instead of showing something that looks like a name and is not.
1137
+ */
1138
+ name: z2.string(),
1139
+ slug: z2.string(),
1140
+ tags: z2.array(z2.string()),
1141
+ views: z2.number().int().nonnegative(),
1142
+ sessions: z2.number().int().nonnegative(),
1143
+ /** Sessions that BEGAN here. The honest denominator for this page's rate. */
1144
+ entrances: z2.number().int().nonnegative(),
1145
+ visitors: z2.number().int().nonnegative(),
1146
+ /**
1147
+ * Conversions that fired ON this landing — rarely the number to show.
1148
+ *
1149
+ * A landing's outcome usually happens somewhere else: the client's checkout,
1150
+ * their shop, a CRM days later. None of those rows carries a landing id, so
1151
+ * this reads 0 for a page whose visits convert reliably.
1152
+ */
1153
+ conversions: z2.number().int().nonnegative(),
1154
+ /** Visits that converted on this page at least once. */
1155
+ convertingSessions: z2.number().int().nonnegative(),
1156
+ /**
1157
+ * Conversions this landing led to — what the page is bought for.
1158
+ *
1159
+ * The landing rule: a conversion on the page, or anywhere else when this was
1160
+ * the last landing its person viewed, up to 90 days before. So it includes
1161
+ * the sale a returning visitor made next week and the deal a CRM posted with
1162
+ * no cookie at all, and the landings add up to the headline.
1163
+ */
1164
+ creditedConversions: z2.number().int().nonnegative(),
1165
+ /** People whose conversions are credited here. */
1166
+ creditedVisitors: z2.number().int().nonnegative(),
1167
+ outboundClicks: z2.number().int().nonnegative(),
1168
+ /**
1169
+ * Visits credited a conversion, per visit. Null when nobody visited.
1170
+ *
1171
+ * Converting visits, not conversions: see {@link analyticsTotalsSchema}.
1172
+ */
1173
+ conversionRate: z2.number().min(0).max(1).nullable(),
1174
+ avgEngagementMs: z2.number().nonnegative().nullable(),
1175
+ /**
1176
+ * Views per bucket, zero-filled against the same axis every other landing
1177
+ * in the response uses — so the arrays are the same length and can be drawn
1178
+ * side by side without asking what each element means.
1179
+ */
1180
+ sparkline: z2.array(z2.number().int().nonnegative()),
1181
+ /**
1182
+ * The ad platforms actually sending this page traffic — `google`, `meta`,
1183
+ * `linkedin`, `tiktok`, `x`, `microsoft`.
1184
+ *
1185
+ * Derived from the click ids a visit arrived with, never from `utm_source`:
1186
+ * a label is whatever somebody typed into a tracking template, a `gclid` is a
1187
+ * click. Ordered by traffic, busiest first.
1188
+ */
1189
+ channels: z2.array(z2.string()),
1190
+ /**
1191
+ * Visits per entry of {@link channels}, in the same order.
1192
+ *
1193
+ * The half that makes a mark readable. A mark on its own says "advertised
1194
+ * here", which is why it used to be withheld until three visits had arrived —
1195
+ * and withholding it is what made a page whose whole day was five Meta clicks
1196
+ * show nothing at all. The count says how much, so one test click and a live
1197
+ * campaign are distinguishable by reading rather than by absence.
1198
+ */
1199
+ channelSessions: z2.array(z2.number().int().nonnegative())
1200
+ });
1201
+ var analyticsTagRowSchema = z2.object({
1202
+ tag: z2.string(),
1203
+ landings: z2.number().int().nonnegative(),
1204
+ views: z2.number().int().nonnegative(),
1205
+ sessions: z2.number().int().nonnegative(),
1206
+ entrances: z2.number().int().nonnegative(),
1207
+ conversions: z2.number().int().nonnegative(),
1208
+ /** Visits that converted on one of this tag's pages. */
1209
+ convertingSessions: z2.number().int().nonnegative(),
1210
+ /** Converting visits per entrance. */
1211
+ conversionRate: z2.number().min(0).max(1).nullable()
1212
+ });
1213
+ var ANALYTICS_EVENT_ORIGINS = ["site", "systems", "both"];
1214
+ var analyticsCustomEventRowSchema = z2.object({
1215
+ eventName: z2.string(),
1216
+ events: z2.number().int().nonnegative(),
1217
+ sessions: z2.number().int().nonnegative(),
1218
+ visitors: z2.number().int().nonnegative(),
1219
+ /**
1220
+ * The property keys this event carries.
1221
+ *
1222
+ * The keys, not the values: a caller has to know what it can break the event
1223
+ * down BY before it can ask, and the values are unbounded where the keys are
1224
+ * capped. This is what lets a dashboard offer the breakdown without the
1225
+ * reader already knowing what the page chose to record.
1226
+ */
1227
+ propertyKeys: z2.array(z2.string()),
1228
+ /**
1229
+ * What these events were worth, per currency.
1230
+ *
1231
+ * A map and never one number, for the reason the person card's `money` is
1232
+ * one: a name carrying 99,882.50 EUR and 1,000 USD is not worth 100,882.50
1233
+ * of anything, and there is no rate in this product to make it so.
1234
+ *
1235
+ * The `''` key is a value a *page* reported — `value` with no currency,
1236
+ * which is a score on the page's own terms rather than money. Kept rather
1237
+ * than dropped, because for those events it is the only number there is.
1238
+ */
1239
+ money: z2.record(z2.string(), z2.number()).default({}),
1240
+ landings: z2.array(z2.string()),
1241
+ /** Which collector produced this name — and `both` when more than one did. */
1242
+ origin: z2.enum(ANALYTICS_EVENT_ORIGINS)
1243
+ });
1244
+ var analyticsEventBreakdownRowSchema = z2.object({
1245
+ value: z2.string(),
1246
+ events: z2.number().int().nonnegative(),
1247
+ sessions: z2.number().int().nonnegative(),
1248
+ /** Per currency, exactly as {@link analyticsCustomEventRowSchema.money}. */
1249
+ money: z2.record(z2.string(), z2.number()).default({})
1250
+ });
1251
+ var analyticsCustomFunnelStepSchema = z2.object({
1252
+ stepIndex: z2.number().int().positive(),
1253
+ stepName: z2.string(),
1254
+ sessions: z2.number().int().nonnegative(),
1255
+ /** Share of the sessions that reached the previous step. Null on the first. */
1256
+ stepRate: z2.number().min(0).max(1).nullable(),
1257
+ /** Share of the sessions that reached step one. Null on the first. */
1258
+ overallRate: z2.number().min(0).max(1).nullable()
1259
+ });
1260
+ var analyticsDeviceRowSchema = z2.object({
1261
+ /** The bucket label — `Chrome 120.0`, `iOS 17.4`, `380–767`. */
1262
+ bucket: z2.string(),
1263
+ sessions: z2.number().int().nonnegative(),
1264
+ pageViews: z2.number().int().nonnegative(),
1265
+ convertingSessions: z2.number().int().nonnegative(),
1266
+ conversions: z2.number().int().nonnegative(),
1267
+ /**
1268
+ * Converting sessions over sessions.
1269
+ *
1270
+ * Over sessions rather than conversions over sessions, because one session
1271
+ * can submit twice and a rate above 1 in a browser-comparison table reads as
1272
+ * a bug in the report rather than as a visitor who filled two forms.
1273
+ */
1274
+ conversionRate: z2.number().min(0).max(1).nullable(),
1275
+ avgEngagementMs: z2.number().nonnegative().nullable()
1276
+ });
1277
+ var analyticsPageRowSchema = z2.object({
1278
+ path: z2.string(),
1279
+ /**
1280
+ * The landing's own `internalId`, straight out of its `_definition.md`.
1281
+ *
1282
+ * The path says where the page is; this says which page it is, so a number
1283
+ * here lines up with a file the agent can open — and with the same page after
1284
+ * it has been renamed, which the path does not. Empty for a path with no
1285
+ * landing behind it.
1286
+ */
1287
+ landingId: z2.string(),
1288
+ pageViews: z2.number().int().nonnegative(),
1289
+ /** Sessions that began on this page — its value as a landing page. */
1290
+ entrances: z2.number().int().nonnegative(),
1291
+ /**
1292
+ * Conversions that fired ON this page — "which page converts".
1293
+ *
1294
+ * Almost never the number to put beside Entrances. A landing page's job is to
1295
+ * start a visit that converts, and the conversion is usually somewhere else:
1296
+ * the shop, the checkout, a CRM a week later. Read alone this makes every
1297
+ * landing page of a real funnel report zero.
1298
+ */
1299
+ conversions: z2.number().int().nonnegative(),
1300
+ /** Visits that converted on this page at least once. */
1301
+ convertingSessions: z2.number().int().nonnegative(),
1302
+ /**
1303
+ * Conversions credited to this landing page by the landing rule — on it, or
1304
+ * anywhere when it was the last landing page its person viewed, up to 90
1305
+ * days before. The number a landing-page table means by "conversions".
1306
+ */
1307
+ creditedConversions: z2.number().int().nonnegative(),
1308
+ /** People whose conversions are credited here. */
1309
+ creditedVisitors: z2.number().int().nonnegative(),
1310
+ /** Credited people per entrance, 0–1. Null when nobody landed here. */
1311
+ conversionRate: z2.number().min(0).max(1).nullable(),
1312
+ avgEngagementMs: z2.number().nonnegative().nullable()
1313
+ });
1314
+ var analyticsSourceRowSchema = z2.object({
1315
+ source: z2.string(),
1316
+ medium: z2.string(),
1317
+ sessions: z2.number().int().nonnegative(),
1318
+ conversions: z2.number().int().nonnegative(),
1319
+ conversionRate: z2.number().min(0).max(1).nullable()
1320
+ });
1321
+ var analyticsCampaignRowSchema = z2.object({
1322
+ utmSource: z2.string(),
1323
+ utmMedium: z2.string(),
1324
+ utmCampaign: z2.string(),
1325
+ /**
1326
+ * The platform a click id proves, or `""` when the visit carried none.
1327
+ *
1328
+ * What separates a campaign the ad breakdown already reports — with its
1329
+ * platform proven and its ad set and ad underneath — from one nothing else
1330
+ * can show: the newsletter, the partner link, the hand-tagged post. The two
1331
+ * are otherwise identical, because `utm_campaign={campaignid}` is the normal
1332
+ * tagging convention and produces the same ids in both places.
1333
+ *
1334
+ * Kept on the row rather than filtered out here: a CLI hint reads an empty
1335
+ * campaign list as "no campaign tagging on any traffic", and dropping the
1336
+ * paid ones would make that fire on a perfectly tagged account.
1337
+ */
1338
+ clickPlatform: z2.string(),
1339
+ sessions: z2.number().int().nonnegative(),
1340
+ conversions: z2.number().int().nonnegative(),
1341
+ conversionRate: z2.number().min(0).max(1).nullable()
1342
+ });
1343
+ var analyticsRealtimeMinuteSchema = z2.object({
1344
+ /** The minute, as an ISO instant. */
1345
+ minute: z2.string(),
1346
+ visitors: z2.number().int().nonnegative(),
1347
+ pageViews: z2.number().int().nonnegative()
1348
+ });
1349
+ var analyticsRealtimePageSchema = z2.object({
1350
+ path: z2.string(),
1351
+ /** The landing this path belongs to; empty when no landing claims it. */
1352
+ landingId: z2.string(),
1353
+ visitors: z2.number().int().nonnegative()
1354
+ });
1355
+ var analyticsRealtimeSchema = z2.object({
1356
+ /** Distinct visitors with any activity inside the active window. */
1357
+ activeNow: z2.number().int().nonnegative(),
1358
+ /** How recently a visitor must have acted to be counted, in minutes. */
1359
+ activeWithinMinutes: z2.number().int().positive(),
1360
+ minutes: z2.array(analyticsRealtimeMinuteSchema),
1361
+ pages: z2.array(analyticsRealtimePageSchema)
1362
+ });
1363
+ var analyticsDimensionRowSchema = z2.object({
1364
+ key: z2.string(),
1365
+ sessions: z2.number().int().nonnegative(),
1366
+ conversions: z2.number().int().nonnegative(),
1367
+ conversionRate: z2.number().min(0).max(1).nullable()
1368
+ });
1369
+ var analyticsFunnelStepSchema = z2.object({
1370
+ stepId: z2.string(),
1371
+ stepIndex: z2.number().int().nonnegative(),
1372
+ /** Visits that moved forward into this step. Never events — see `visits`. */
1373
+ views: z2.number().int().nonnegative(),
1374
+ /** Visits that finished this step and moved on. */
1375
+ completions: z2.number().int().nonnegative(),
1376
+ /** Share of viewers who did not complete this step, 0–1. */
1377
+ dropRate: z2.number().min(0).max(1).nullable(),
1378
+ /**
1379
+ * Visits that converted AT this step — the node kind's own outcome trigger
1380
+ * fired here, or the Form was submitted here.
1381
+ *
1382
+ * Usually zero on every step but one. That is the point: a Form has one
1383
+ * conversion, and knowing which step owns it is what stops a drop-off chart
1384
+ * treating the booking widget's "profile viewed" as a funnel stage.
1385
+ */
1386
+ convertedSessions: z2.number().int().nonnegative(),
1387
+ /**
1388
+ * This step is where the Form ends — a confirmation screen, not a loss.
1389
+ *
1390
+ * Stated rather than left to be inferred. The dashboard used to read it off
1391
+ * `dropRate === null`, which is also how a step nobody viewed arrives, so a
1392
+ * converting link node in the middle of a Form was labelled its ending.
1393
+ */
1394
+ isEnding: z2.boolean()
1395
+ });
1396
+ var analyticsFunnelSchema = z2.object({
1397
+ flowSlug: z2.string(),
1398
+ /**
1399
+ * Visits that saw the Form at all — the denominator for every share here.
1400
+ *
1401
+ * Read this, not `starts`, whenever the question is "out of how many". A
1402
+ * start is recorded at the visitor's FIRST INTERACTION, so the two differ by
1403
+ * exactly the people who looked at the Form and never touched it — usually
1404
+ * most of them, and always the group a drop-off chart exists to find.
1405
+ *
1406
+ * Every count in this object is distinct visits, including each step's
1407
+ * `views` and `completions`. That is load-bearing rather than incidental:
1408
+ * the screen divides these by each other, and while the steps counted events
1409
+ * a Form four people had opened reported one step reached fifteen times and
1410
+ * fourteen people lost.
1411
+ */
1412
+ visits: z2.number().int().nonnegative(),
1413
+ /** Visits that interacted with the Form at all — typed, picked, or advanced. */
1414
+ starts: z2.number().int().nonnegative(),
1415
+ submits: z2.number().int().nonnegative(),
1416
+ /** Conversions per visit that opened the Form, 0–1. */
1417
+ completionRate: z2.number().min(0).max(1).nullable(),
1418
+ /** The step losing the most people. The single most useful field here. */
1419
+ worstStep: analyticsFunnelStepSchema.nullable(),
1420
+ steps: z2.array(analyticsFunnelStepSchema),
1421
+ /**
1422
+ * Visits that converted, counted once each at whichever node did it.
1423
+ *
1424
+ * Read this rather than `submits` whenever the two disagree. `submits` only
1425
+ * fires when a flow runs out of nodes, so a Form that books a call on a
1426
+ * mid-flow Calendly node reports zero submits and every one of its real
1427
+ * bookings here.
1428
+ */
1429
+ convertedSessions: z2.number().int().nonnegative()
1430
+ });
1431
+ var analyticsPaidRowSchema = z2.object({
1432
+ source: z2.string(),
1433
+ medium: z2.string(),
1434
+ campaign: z2.string(),
1435
+ content: z2.string(),
1436
+ term: z2.string(),
1437
+ /** `google` | `meta` | `tiktok` | `x` | `linkedin` | `microsoft` | `""`. */
1438
+ clickPlatform: z2.string(),
1439
+ sessions: z2.number().int().nonnegative(),
1440
+ convertingSessions: z2.number().int().nonnegative(),
1441
+ conversions: z2.number().int().nonnegative(),
1442
+ /** Leads whose server-side delivery reported success. */
1443
+ delivered: z2.number().int().nonnegative(),
1444
+ /** Leads whose delivery reported failure. Non-zero here is a broken integration. */
1445
+ failedDeliveries: z2.number().int().nonnegative(),
1446
+ /** Distinct people, across devices — only countable where visitors identified themselves. */
1447
+ identifiedPeople: z2.number().int().nonnegative(),
1448
+ /** Converting sessions per session, 0–1. */
1449
+ conversionRate: z2.number().min(0).max(1).nullable(),
1450
+ /** Delivered leads per conversion, 0–1. Below 1 means leads are being lost after submit. */
1451
+ deliveryRate: z2.number().min(0).max(1).nullable()
1452
+ });
1453
+ var analyticsDeliveryRowSchema = z2.object({
1454
+ eventId: z2.string(),
1455
+ submittedAt: z2.string(),
1456
+ /**
1457
+ * The visit the submission was made in, so a lead can be opened as a story.
1458
+ *
1459
+ * The whole reason a delivery row is worth clicking. Without it a submission
1460
+ * is a timestamp and a CRM outcome, and the questions anybody actually has —
1461
+ * which ad brought them, what they read first, how long they took — are all
1462
+ * on the other side of this one join.
1463
+ */
1464
+ sessionId: z2.string(),
1465
+ /** Lowercase hex digest of who submitted, when the page could identify them. */
1466
+ identityHash: z2.string(),
1467
+ flowSlug: z2.string(),
1468
+ stepId: z2.string(),
1469
+ landingId: z2.string(),
1470
+ destinations: z2.array(z2.string()),
1471
+ dispatched: z2.number().int().nonnegative(),
1472
+ succeeded: z2.number().int().nonnegative(),
1473
+ failed: z2.number().int().nonnegative(),
1474
+ /** Dispatched and never settled. Distinguishing this from failed is "wait" vs "act". */
1475
+ pending: z2.number().int().nonnegative(),
1476
+ /**
1477
+ * The ids the destinations gave back.
1478
+ *
1479
+ * A submission that succeeded everywhere and carries none of these is a real
1480
+ * and previously invisible failure: the integration accepted the call and
1481
+ * dropped the record.
1482
+ */
1483
+ providerRefs: z2.array(z2.string()),
1484
+ sampleError: z2.string()
1485
+ });
1486
+ var analyticsTriggerRowSchema = z2.object({
1487
+ flowSlug: z2.string(),
1488
+ /** `link`, `customForm`, `iframe`, `hubspotMeeting`, … */
1489
+ nodeType: z2.string(),
1490
+ /** The trigger, verbatim: `link.onClick`, `iframe.checkout_completed`. */
1491
+ triggerId: z2.string(),
1492
+ fires: z2.number().int().nonnegative(),
1493
+ sessions: z2.number().int().nonnegative(),
1494
+ /** How many of those fires produced a side effect. Often zero, on purpose. */
1495
+ sideEffectsFired: z2.number().int().nonnegative()
1496
+ });
1497
+ var analyticsReleaseRowSchema = z2.object({
1498
+ /** The commit the build came from. */
1499
+ release: z2.string(),
1500
+ firstSeen: z2.string(),
1501
+ lastSeen: z2.string(),
1502
+ sessions: z2.number().int().nonnegative(),
1503
+ pageViews: z2.number().int().nonnegative(),
1504
+ conversions: z2.number().int().nonnegative(),
1505
+ /** Visits that converted on this build at least once. */
1506
+ convertingSessions: z2.number().int().nonnegative(),
1507
+ /** Converting visits per session, 0–1. Null below a usable sample. */
1508
+ conversionRate: z2.number().min(0).max(1).nullable()
1509
+ });
1510
+ var analyticsGeoRowSchema = z2.object({
1511
+ /** The place itself, at whatever grain was asked for. */
1512
+ place: z2.string(),
1513
+ /** Always carried: a postcode without its country is ambiguous, a city twice over. */
1514
+ country: z2.string(),
1515
+ region: z2.string(),
1516
+ sessions: z2.number().int().nonnegative(),
1517
+ conversions: z2.number().int().nonnegative(),
1518
+ /** Conversions per session, 0–1. Null below a usable sample. */
1519
+ conversionRate: z2.number().min(0).max(1).nullable(),
1520
+ /** People rather than browsers, where the visit identified itself. */
1521
+ identifiedPeople: z2.number().int().nonnegative()
1522
+ });
1523
+ var analyticsBotRowSchema = z2.object({
1524
+ /** The crawler's name, or `unidentified` for a machine we could not name. */
1525
+ bot: z2.string(),
1526
+ /** `search` | `ai` | `social` | `seo` | `monitoring` | `tool` | `automation`. */
1527
+ category: z2.string(),
1528
+ hits: z2.number().int().nonnegative(),
1529
+ pages: z2.number().int().nonnegative(),
1530
+ lastSeen: z2.string(),
1531
+ samplePaths: z2.array(z2.string())
1532
+ });
1533
+ var analyticsWarningSchema = z2.object({
1534
+ /**
1535
+ * `AD_ROLE_UNMAPPED` is the one that reports a *question* rather than the
1536
+ * data. A role resolves to the parameter names that carry it, and when a
1537
+ * company has mapped none the list is empty — which the filter reads as
1538
+ * "arrived carrying none of these" and answers with a confident zero across
1539
+ * the whole report. Zero is a far more expensive conclusion than "nobody has
1540
+ * said which parameter that is", so the narrowing is dropped and this says so.
1541
+ */
1542
+ code: z2.enum(["LOW_SAMPLE", "NO_DATA", "BEYOND_RETENTION", "AD_ROLE_UNMAPPED"]),
1543
+ message: z2.string()
1544
+ });
1545
+ var analyticsFlowSummarySchema = z2.object({
1546
+ flowSlug: z2.string(),
1547
+ sessions: z2.number().int().nonnegative(),
1548
+ starts: z2.number().int().nonnegative(),
1549
+ convertedSessions: z2.number().int().nonnegative(),
1550
+ submits: z2.number().int().nonnegative(),
1551
+ stepViews: z2.number().int().nonnegative(),
1552
+ /** Distinct steps anyone reached, across all visits. */
1553
+ stepsSeen: z2.number().int().nonnegative(),
1554
+ deepestStepIndex: z2.number().int().nonnegative(),
1555
+ /** Steps reached per visit, averaged — "how much of this Form do people read". */
1556
+ avgStepsReached: z2.number().nonnegative(),
1557
+ /** Conversions per visit that started, 0–1. */
1558
+ conversionRate: z2.number().min(0).max(1).nullable(),
1559
+ /** Which node ids produced the conversions. Usually one; two means two offers. */
1560
+ conversionSteps: z2.array(z2.string()),
1561
+ /** And by what — `calendlyEvent.eventScheduled`, `customForm.onFormSubmitted`. */
1562
+ conversionTriggers: z2.array(z2.string()),
1563
+ conversionNodeTypes: z2.array(z2.string()),
1564
+ lastSeen: z2.string()
1565
+ });
1566
+ var analyticsFlowEdgeSchema = z2.object({
1567
+ flowSlug: z2.string(),
1568
+ fromStep: z2.string(),
1569
+ toStep: z2.string(),
1570
+ sessions: z2.number().int().nonnegative()
1571
+ });
1572
+ var analyticsConversionRowSchema = z2.object({
1573
+ /** What a person calls this outcome. */
1574
+ name: z2.string(),
1575
+ /** Every event counted under this name. One entry unless the name is shared. */
1576
+ eventKeys: z2.array(z2.string()),
1577
+ /**
1578
+ * `once_per_visit` | `every_time` — how repeats inside one visit are counted.
1579
+ *
1580
+ * `mixed` when a shared name spans both, which is a real state and an editing
1581
+ * accident; saying so is what makes it findable.
1582
+ */
1583
+ countMode: z2.string(),
1584
+ /** Counted the way each definition asked to be counted, and credited to a landing. */
1585
+ conversions: z2.number(),
1586
+ /**
1587
+ * Times it happened that no landing earned: by people none of the company's
1588
+ * pages saw, within 90 days. Zero under a landing or an ad scope, where the
1589
+ * gap would mean something else. Absent on a row built before it existed.
1590
+ */
1591
+ unplaced: z2.number().default(0),
1592
+ /** Distinct visits that produced it, never mode-adjusted. The gap between the two is the repeat behaviour. */
1593
+ convertingVisits: z2.number(),
1594
+ /** Null when it has never fired. */
1595
+ lastSeen: z2.string().nullable(),
1596
+ /**
1597
+ * The doors its events came in by in the window, in
1598
+ * {@link ANALYTICS_EVENT_DOORS} order. Empty when it has not fired.
1599
+ */
1600
+ doors: z2.array(z2.enum(ANALYTICS_EVENT_DOORS)).default([]),
1601
+ /** Proposed in this chat: counted from when it is published, so every report reads it as nothing until then. */
1602
+ staged: z2.boolean().optional()
1603
+ });
1604
+ var analyticsEventCatalogRowSchema = z2.object({
1605
+ /** `form:…` | `submit:…` | `page:…` | `exit:…` — parse with `parseEventKey`. */
1606
+ eventKey: z2.string(),
1607
+ /**
1608
+ * Which collector produced this key — and `both` when more than one did.
1609
+ *
1610
+ * On the row rather than in the key, which is the whole shape of the change
1611
+ * that removed the `server:` family: a picker can say where an event came
1612
+ * from without a filter round-trip, and a report can still separate the two
1613
+ * populations at any grain, but nothing downstream has to learn a second
1614
+ * vocabulary to count one.
1615
+ */
1616
+ origin: z2.enum(ANALYTICS_EVENT_ORIGINS),
1617
+ events: z2.number(),
1618
+ sessions: z2.number(),
1619
+ /** The Form node's kind, for a `form:` key. Empty otherwise. */
1620
+ nodeType: z2.string(),
1621
+ /** The Form this happened in, for a `form:` or `submit:` key. Empty otherwise. */
1622
+ flowSlug: z2.string(),
1623
+ /** Null when it has never fired — only possible for a row we already count. */
1624
+ lastSeen: z2.string().nullable(),
1625
+ /** Already counted as a conversion. Shown, never hidden: a row that vanished on being counted reads as a bug. */
1626
+ isCounted: z2.boolean(),
1627
+ /** The name it is counted under, when it is. */
1628
+ countedAs: z2.string(),
1629
+ /**
1630
+ * The doors on Sources this key's events came through, by name — the
1631
+ * `baker_source` each event carries. Empty for a key nothing on Sources
1632
+ * sent; more than one when two doors used one name.
1633
+ */
1634
+ sources: z2.array(z2.string()),
1635
+ /**
1636
+ * The doors this key's events came in by, in {@link ANALYTICS_EVENT_DOORS}
1637
+ * order, each with its own volume — only the doors it actually used.
1638
+ *
1639
+ * `origin` says site or systems; this says which of the four, which is the
1640
+ * question every picker is read to answer. Defaulted, so a store that
1641
+ * predates the column parses as "no door known" rather than failing.
1642
+ */
1643
+ doors: z2.array(z2.object({ door: z2.enum(ANALYTICS_EVENT_DOORS), events: z2.number(), sessions: z2.number() })).default([])
1644
+ });
1645
+ var analyticsAdDimensionRowSchema = z2.object({
1646
+ /** The dimension's value. Empty means "arrived carrying none of these". */
1647
+ value: z2.string(),
1648
+ /** Which platform stamped the click, from the click id rather than a label. */
1649
+ platform: z2.string(),
1650
+ sessions: z2.number(),
1651
+ convertingSessions: z2.number(),
1652
+ conversions: z2.number(),
1653
+ bouncedSessions: z2.number(),
1654
+ identifiedPeople: z2.number(),
1655
+ pageViews: z2.number(),
1656
+ engagementMs: z2.number(),
1657
+ /** Conversions per session, or null when nothing arrived. */
1658
+ conversionRate: z2.number().nullable(),
1659
+ /** Bounces per session, or null when nothing arrived. */
1660
+ bounceRate: z2.number().nullable()
1661
+ });
1662
+ var analyticsAdParamRowSchema = z2.object({
1663
+ name: z2.string(),
1664
+ /** Whether the value is stored, or only the fact that the name appeared. */
1665
+ captured: z2.boolean(),
1666
+ /** The role in force for the platform asked about, built-in or configured. */
1667
+ role: adParamRoleSchema.optional(),
1668
+ /**
1669
+ * True when this company said what it means, rather than Baker knowing it.
1670
+ *
1671
+ * The difference between a row that can be reset to a sensible default and
1672
+ * one where clearing it means "nobody has said".
1673
+ */
1674
+ configured: z2.boolean(),
1675
+ /**
1676
+ * Visits carrying this parameter **that arrived from the platform asked
1677
+ * about**, not visits carrying it anywhere.
1678
+ *
1679
+ * This used to be the second: one inventory of every parameter on every
1680
+ * visit, shown identically under each platform tab. That is wrong on the
1681
+ * facts, and confidently so. A visit arrives from one platform — it has one
1682
+ * click id — so `gclid` traffic cannot also be Meta traffic, and a Meta tab
1683
+ * listing `gad_campaignid` on 1,204 visits invited somebody to name a Google
1684
+ * parameter in Meta's vocabulary and then wonder why no report ever used it.
1685
+ * The count belongs to the platform or it is not a count of anything.
1686
+ */
1687
+ sessions: z2.number(),
1688
+ events: z2.number(),
1689
+ /** Up to five distinct values. Always empty for an uncaptured parameter. */
1690
+ sampleValues: z2.array(z2.string()),
1691
+ lastSeen: z2.string().optional(),
1692
+ /**
1693
+ * True when this row is here because somebody configured it, not because it
1694
+ * arrived.
1695
+ *
1696
+ * The row a mapping made before its first click. A tracking setup is
1697
+ * routinely written the week before the campaign runs, and a tool that can
1698
+ * only describe traffic it has already seen cannot be used at the one moment
1699
+ * somebody sits down to do this properly. Such a row has no visits and no
1700
+ * values, and says so rather than reading as a parameter that stopped
1701
+ * arriving.
1702
+ */
1703
+ awaitingTraffic: z2.boolean().optional()
1704
+ });
1705
+ var analyticsFlowDestinationsSchema = z2.object({
1706
+ flowSlug: z2.string(),
1707
+ /** Destination types seen — `meta`, `httpWebhook`, `hubspotForm`. */
1708
+ destinations: z2.array(z2.string()),
1709
+ lastSeen: z2.string().optional()
1710
+ });
1711
+ var analyticsAdPlatformTrafficSchema = z2.object({
1712
+ platform: z2.string(),
1713
+ sessions: z2.number(),
1714
+ conversions: z2.number(),
1715
+ /** How many of those visits carried any campaign parameter at all. */
1716
+ taggedSessions: z2.number()
1717
+ });
1718
+ var analyticsPageInfoSchema = z2.object({
1719
+ /** Which field of the response was paged. */
1720
+ block: z2.enum(["visitors", "submissions", "deliveries", "stream"]),
1721
+ page: z2.number().int(),
1722
+ pageSize: z2.number().int(),
1723
+ returned: z2.number().int(),
1724
+ hasMore: z2.boolean()
1725
+ });
1726
+ var analyticsTimelineRowSchema = z2.object({
1727
+ timestamp: z2.string(),
1728
+ /**
1729
+ * The visit this event belongs to, and the browser that made it.
1730
+ *
1731
+ * Empty on anything that belongs to neither — a settlement, and an event a
1732
+ * client's own server posted about somebody who was never on a page. Carried
1733
+ * because the raw feed (`stream`) is a company-wide list rather than one
1734
+ * visit's, so a row has to say who it was about before a reader can get from
1735
+ * it to the person. On a replay both are constant and simply confirm it.
1736
+ */
1737
+ sessionId: z2.string(),
1738
+ anonId: z2.string(),
1739
+ /**
1740
+ * Where the producer put this event in its own order, from 1. `0` means it
1741
+ * did not number this one.
1742
+ *
1743
+ * The tie-break that makes the replay a replay. The timestamp is
1744
+ * milliseconds and the Form engine emits several events in one synchronous
1745
+ * block, so a step completing, the identities it revealed and the next step
1746
+ * coming into view routinely share one — and sorted on the timestamp alone
1747
+ * they came back in an order that matched nothing that happened.
1748
+ */
1749
+ eventSeq: z2.number().int().nonnegative(),
1750
+ /** This event's identity, so two rows can be said to be the same event. */
1751
+ eventUid: z2.string(),
1752
+ /** `page_view`, `form_step_view`, `side_effect_dispatched`, … */
1753
+ eventType: z2.string(),
1754
+ /** `edge`, `beacon`, `server` — where the row was written from. */
1755
+ source: z2.string(),
1756
+ /**
1757
+ * `baker`, `external`, `export` — where the page was, which `source` does
1758
+ * not say. The two together are what decide the row's door; see
1759
+ * `ANALYTICS_EVENT_DOORS`.
1760
+ *
1761
+ * Defaulted rather than required: the column arrived after the corpus did
1762
+ * and carries no default of its own, so a row older than it reads `""`, and
1763
+ * that has to mean "Baker's, as everything was then" rather than fail the
1764
+ * whole row's parse.
1765
+ */
1766
+ deployment: z2.string().default(""),
1767
+ environment: z2.string(),
1768
+ /** The build the page was published from. */
1769
+ release: z2.string(),
1770
+ path: z2.string(),
1771
+ host: z2.string(),
1772
+ landingId: z2.string(),
1773
+ flowSlug: z2.string(),
1774
+ stepId: z2.string(),
1775
+ stepIndex: z2.number().int().nonnegative(),
1776
+ nodeType: z2.string(),
1777
+ triggerId: z2.string(),
1778
+ /** A page-defined event's own name, when this row is one. */
1779
+ eventName: z2.string(),
1780
+ /** Whatever the page attached to a custom event. Strings only, by design. */
1781
+ properties: z2.record(z2.string(), z2.string()),
1782
+ /** Where an outbound click or a link node was going, in full. */
1783
+ targetUrl: z2.string(),
1784
+ /** A number the page reported alongside the event. */
1785
+ value: z2.number(),
1786
+ /**
1787
+ * The currency that number is in, when it has one.
1788
+ *
1789
+ * Only a server-sent event carries it — a page reports a `value` on its own
1790
+ * terms, a CRM reports a deal in euros — and without it the replay prints a
1791
+ * bare `4200.5` beside a closed deal, which is a number nobody can act on.
1792
+ */
1793
+ valueCurrency: z2.string().default(""),
1794
+ /** The visitor's digest, when they had identified themselves by this point. */
1795
+ identityHash: z2.string(),
1796
+ /**
1797
+ * The browser to attribute this row to, once the identity has been resolved.
1798
+ *
1799
+ * `anonId` when the row has one, and otherwise the browser {@link identityHash}
1800
+ * resolves to through `identities`. Empty when neither exists.
1801
+ *
1802
+ * It is a separate field rather than a coalesce into `anonId` because the two
1803
+ * claims are not the same: `anonId` is the cookie the row was written with,
1804
+ * and a server-sent event was written with none and must not start claiming
1805
+ * one. This is the *read's* answer to "who was that", and it is retroactive
1806
+ * and cross-device by construction — a "Deal won" posted in March attaches to
1807
+ * the person the moment they type that address into a Form in April, and to
1808
+ * every browser they have used here.
1809
+ *
1810
+ * Only `event_stream` fills it. Empty everywhere else, which is honest: a
1811
+ * session replay deliberately does not resolve, because an event that
1812
+ * happened during no visit must not be placed inside one.
1813
+ */
1814
+ personAnonId: z2.string().default(""),
1815
+ /**
1816
+ * What this row knows the person by, when it does not know their browser:
1817
+ * `email` | `phone` | `external` | `click` | `cookie`, or empty.
1818
+ *
1819
+ * The feed's Who column reads it. A row naming a person by a means that has
1820
+ * no face here yet — a digest nobody has typed into a Form, an ad click, one
1821
+ * of Meta's cookies — is not a row about nobody, and rendering it as one is
1822
+ * what made the server-sent half of the feed look unattached to the rest.
1823
+ */
1824
+ knownBy: z2.string().default(""),
1825
+ /**
1826
+ * What this row counts as under the company's own conversion definitions, or
1827
+ * empty when it counts as nothing.
1828
+ *
1829
+ * The store's own key, projected rather than rebuilt here, so the feed and
1830
+ * the reports cannot disagree about what one event was. Two rows carrying the
1831
+ * same non-empty key are **one** conversion — the second is stored, listed,
1832
+ * and marked as already counted rather than hidden, because a sender who
1833
+ * posted a deal twice needs to see that the second request arrived.
1834
+ *
1835
+ * Only `event_stream` fills it; empty everywhere else.
1836
+ */
1837
+ conversionKey: z2.string().default(""),
1838
+ /**
1839
+ * Which lines of a people search this row belongs to, by position in
1840
+ * `peopleSearch`. Empty when nobody was searched for.
1841
+ */
1842
+ personTerms: z2.array(z2.number()).optional(),
1843
+ /**
1844
+ * `email` | `phone` — which of the two they gave.
1845
+ *
1846
+ * Load-bearing rather than trivia: a visitor who fills in both fields
1847
+ * produces two `identify` rows in the same millisecond, and without the kind
1848
+ * a replay renders the same sentence twice and reads as a duplicated event.
1849
+ */
1850
+ identityKind: z2.string(),
1851
+ /**
1852
+ * The `user_data` block this event carried, exactly as it arrived.
1853
+ *
1854
+ * The contact digests (`email_sha256`, `phone_sha256`, `external_id_sha256`),
1855
+ * the click ids, Meta's cookies, and the advanced-matching /
1856
+ * enhanced-conversions fields — first name, city, postcode, country. Empty on
1857
+ * everything a page produced, which is most rows.
1858
+ *
1859
+ * **Per event, and deliberately not merged** — unlike the person card, which
1860
+ * merges the same fields newest-wins across everything anyone ever sent. The
1861
+ * question one event answers is "what did *this request* contain", and the
1862
+ * answer has to be allowed to be *worse* than what is known about the person
1863
+ * overall. That is how a sender finds the field they forgot to map: the
1864
+ * person has a postcode, and this event does not.
1865
+ */
1866
+ userData: z2.record(z2.string(), z2.string()).default({}),
1867
+ sideEffectType: z2.string(),
1868
+ sideEffectName: z2.string(),
1869
+ sideEffectId: z2.string(),
1870
+ tagId: z2.string(),
1871
+ messageId: z2.string(),
1872
+ /**
1873
+ * The submission this row belongs to.
1874
+ *
1875
+ * What ties a browser pixel and a server dispatch of the SAME submit
1876
+ * together. Without it they read as two unrelated things that happened to
1877
+ * occur in the same second.
1878
+ */
1879
+ eventId: z2.string(),
1880
+ runId: z2.string(),
1881
+ engagementMs: z2.number().int().nonnegative(),
1882
+ scrollDepth: z2.number().int().nonnegative(),
1883
+ /**
1884
+ * The A/B test this row was stamped into, and which side the edge served —
1885
+ * `a` for the page as it is, `b` for the new variant.
1886
+ *
1887
+ * Set only on rows a page under test produced, which is how a person's story
1888
+ * can say which version they were shown. Empty on a server-sent row: a CRM
1889
+ * knows nothing about the split, and the conversion it posts is attributed
1890
+ * to a side by WHO did it (see `experiment_conversions`), never by a stamp.
1891
+ */
1892
+ experimentId: z2.string().default(""),
1893
+ variant: z2.string().default(""),
1894
+ /** `success` | `failed` | `""` for a dispatch that has not settled yet. */
1895
+ outcome: z2.string(),
1896
+ /** What the destination said when it refused. Empty on success. */
1897
+ error: z2.string(),
1898
+ /** The destination's own id for the record it created, when it gave one. */
1899
+ providerRef: z2.string(),
1900
+ /** When the destination answered, so "it took eleven seconds" is sayable. */
1901
+ settledAt: z2.string()
1902
+ });
1903
+ var analyticsSubmissionRowSchema = z2.object({
1904
+ sessionId: z2.string(),
1905
+ flowSlug: z2.string(),
1906
+ startedAt: z2.string(),
1907
+ lastAt: z2.string(),
1908
+ anonId: z2.string(),
1909
+ identityHash: z2.string(),
1910
+ identityKind: z2.string(),
1911
+ landingId: z2.string(),
1912
+ path: z2.string(),
1913
+ /** Steps they saw. The denominator for "how far did they get". */
1914
+ stepsReached: z2.number().int().nonnegative(),
1915
+ /** Steps they actually handed something over on. Zero means no attempt. */
1916
+ stepsSubmitted: z2.number().int().nonnegative(),
1917
+ submittedStepIds: z2.array(z2.string()),
1918
+ /** The furthest step they reached, for naming where they stopped. */
1919
+ lastStepId: z2.string(),
1920
+ /** Whether the Form reached an ending, by any of its three routes. */
1921
+ finished: z2.boolean(),
1922
+ conversions: z2.number().int().nonnegative(),
1923
+ destinations: z2.array(z2.string()),
1924
+ /** Destinations that fired as a pixel in the page. */
1925
+ browserDestinations: z2.array(z2.string()),
1926
+ /** Destinations Baker dispatched from the server. */
1927
+ serverDestinations: z2.array(z2.string()),
1928
+ /**
1929
+ * Server-side dispatch runs — the counterpart of `serverDestinations`, NOT of
1930
+ * `destinations`.
1931
+ *
1932
+ * Zero is not "this went nowhere", and reading it that way is a mistake
1933
+ * already made once: it is zero for an attempt abandoned before the step that
1934
+ * fires a destination, and zero for a Form whose only destination is a
1935
+ * browser pixel. `destinations` is the union of both sides and is the column
1936
+ * that answers "did this reach anything at all".
1937
+ */
1938
+ dispatched: z2.number().int().nonnegative(),
1939
+ succeeded: z2.number().int().nonnegative(),
1940
+ failed: z2.number().int().nonnegative(),
1941
+ /** Dispatched and never settled — "wait", as against "act". */
1942
+ pending: z2.number().int().nonnegative(),
1943
+ sampleError: z2.string(),
1944
+ providerRefs: z2.array(z2.string()),
1945
+ /** The submission ids, which is how the panel opens the sealed payload. */
1946
+ eventIds: z2.array(z2.string())
1947
+ });
1948
+ var analyticsVisitorSessionSchema = z2.object({
1949
+ sessionId: z2.string(),
1950
+ startedAt: z2.string(),
1951
+ endedAt: z2.string(),
1952
+ entryPath: z2.string(),
1953
+ entryLandingId: z2.string(),
1954
+ utmCampaign: z2.string(),
1955
+ referrerSource: z2.string(),
1956
+ deviceType: z2.string(),
1957
+ pageViews: z2.number().int().nonnegative(),
1958
+ conversions: z2.number().int().nonnegative(),
1959
+ /**
1960
+ * True for the visits made BEFORE we knew who this was.
1961
+ *
1962
+ * Shown rather than smoothed over: a history without it invites the reading
1963
+ * that we recognised them all along, when in fact these visits were only
1964
+ * attributed backwards through the browser after they identified themselves.
1965
+ */
1966
+ wasAnonymous: z2.boolean(),
1967
+ engagementMs: z2.number().int().nonnegative()
1968
+ });
1969
+ var analyticsVisitProfileSchema = z2.object({
1970
+ sessionId: z2.string(),
1971
+ startedAt: z2.string(),
1972
+ endedAt: z2.string(),
1973
+ entryPath: z2.string(),
1974
+ entryLandingId: z2.string(),
1975
+ country: z2.string(),
1976
+ region: z2.string(),
1977
+ city: z2.string(),
1978
+ timezone: z2.string(),
1979
+ /** The network the visit came from. What separates a datacentre from a person. */
1980
+ asOrganization: z2.string(),
1981
+ deviceType: z2.string(),
1982
+ browser: z2.string(),
1983
+ os: z2.string(),
1984
+ referrerSource: z2.string(),
1985
+ referrerDomain: z2.string(),
1986
+ utmSource: z2.string(),
1987
+ utmMedium: z2.string(),
1988
+ utmCampaign: z2.string(),
1989
+ /**
1990
+ * Which platform the click id proves, in the `AD_PLATFORMS` vocabulary —
1991
+ * `google` | `meta` | `tiktok` | `x` | `linkedin` | `microsoft` | `""`.
1992
+ *
1993
+ * The same spelling every mark, mapping and report uses. It briefly said
1994
+ * `google_ads` / `meta_ads` here alone, which meant every logo lookup on the
1995
+ * People screen missed and a paid visit drew a neutral globe.
1996
+ */
1997
+ clickPlatform: z2.string(),
1998
+ /** Every ValueTrack-style parameter the URL carried, unresolved. */
1999
+ campaignParams: z2.record(z2.string(), z2.string()),
2000
+ /** The browser's own cookie id. One person can have several. */
2001
+ anonId: z2.string(),
2002
+ identityHash: z2.string(),
2003
+ /** What the digest was made of — `email`, `phone`. Never the value. */
2004
+ identityKind: z2.string(),
2005
+ pageViews: z2.number().int().nonnegative(),
2006
+ conversions: z2.number().int().nonnegative(),
2007
+ engagementMs: z2.number().int().nonnegative()
2008
+ });
2009
+ var analyticsPersonKeySchema = z2.object({
2010
+ /** `email` | `phone` | `external` | `browser` | a click-id name | `fbp` | `fbc`. */
2011
+ kind: z2.string(),
2012
+ /** A digest for a contact detail, the value itself for a cookie or a click id. */
2013
+ value: z2.string(),
2014
+ firstSeen: z2.string(),
2015
+ lastSeen: z2.string(),
2016
+ /** How many times it was observed beside another key — every submission repeats it. */
2017
+ observations: z2.number().int().nonnegative(),
2018
+ sessions: z2.number().int().nonnegative(),
2019
+ /** `client` | `edge` | `server` | `ingest` — which collector first saw it. */
2020
+ source: z2.string(),
2021
+ /** The Form it was first seen on, where it came from one. */
2022
+ flowSlug: z2.string(),
2023
+ landingId: z2.string()
2024
+ });
2025
+ var analyticsPersonProfileSchema = z2.object({
2026
+ firstSeen: z2.string(),
2027
+ lastSeen: z2.string(),
2028
+ sessions: z2.number().int().nonnegative(),
2029
+ /** How many browsers resolved to this person. More than one is cross-device. */
2030
+ devices: z2.number().int().nonnegative(),
2031
+ pageViews: z2.number().int().nonnegative(),
2032
+ conversions: z2.number().int().nonnegative(),
2033
+ /**
2034
+ * What they are worth, per currency — `{ EUR: 4753 }`.
2035
+ *
2036
+ * A map rather than an amount and a code, because the two-column shape had
2037
+ * no honest answer for somebody with a deal in each of two currencies: it
2038
+ * summed them and labelled the total with whichever code came back first.
2039
+ * Only a server event ever carries money, and a retried post is counted
2040
+ * once, on `event_uid`.
2041
+ */
2042
+ money: z2.record(z2.string(), z2.number()),
2043
+ engagementMs: z2.number().int().nonnegative(),
2044
+ /** How many of their events a client's own server posted. */
2045
+ serverEvents: z2.number().int().nonnegative(),
2046
+ country: z2.string(),
2047
+ region: z2.string(),
2048
+ city: z2.string(),
2049
+ deviceType: z2.string(),
2050
+ browser: z2.string(),
2051
+ os: z2.string(),
2052
+ utmSource: z2.string(),
2053
+ utmMedium: z2.string(),
2054
+ utmCampaign: z2.string(),
2055
+ referrerSource: z2.string(),
2056
+ entryLandingId: z2.string(),
2057
+ entryPath: z2.string(),
2058
+ /**
2059
+ * The customer-matching block, merged newest-wins across everything anyone
2060
+ * has ever told us about them — `city`, `postal_code`, `country`,
2061
+ * `first_name_sha256`, `fbp`. Keyed exactly as the store holds it, so a key
2062
+ * ending `_sha256` says its value is a digest and cannot be shown.
2063
+ */
2064
+ matchKeys: z2.record(z2.string(), z2.string())
2065
+ });
2066
+ var analyticsVisitorRowSchema = z2.object({
2067
+ anonId: z2.string(),
2068
+ firstSeen: z2.string(),
2069
+ lastSeen: z2.string(),
2070
+ sessions: z2.number().int().nonnegative(),
2071
+ pageViews: z2.number().int().nonnegative(),
2072
+ conversions: z2.number().int().nonnegative(),
2073
+ formTriggers: z2.number().int().nonnegative(),
2074
+ outboundClicks: z2.number().int().nonnegative(),
2075
+ engagementMs: z2.number().int().nonnegative(),
2076
+ /** The visit to open by default — the most recent one. */
2077
+ lastSessionId: z2.string(),
2078
+ entryPath: z2.string(),
2079
+ entryLandingId: z2.string(),
2080
+ lastPath: z2.string(),
2081
+ referrerSource: z2.string(),
2082
+ referrerDomain: z2.string(),
2083
+ utmSource: z2.string(),
2084
+ utmMedium: z2.string(),
2085
+ utmCampaign: z2.string(),
2086
+ clickPlatform: z2.string(),
2087
+ campaignParams: z2.record(z2.string(), z2.string()),
2088
+ /**
2089
+ * The click ids this person arrived on, by their own names — `gclid`,
2090
+ * `fbclid`, `msclkid`, `li_fat_id`, `ttclid`, `twclid`, `wbraid`, `gbraid`,
2091
+ * `dclid`, `rdt_cid`, `epik`, `sccid`, `oppref`.
2092
+ *
2093
+ * Only the ones that were present. The endpoint has always returned all eight
2094
+ * columns and nothing above it carried them, so the one screen whose subject
2095
+ * is a person could name the platform that paid for the click and not the
2096
+ * click — which is the value a platform's own reporting is matched on, and
2097
+ * therefore the value somebody is looking for when a conversion did not show
2098
+ * up on the other side.
2099
+ */
2100
+ clickIds: z2.record(z2.string(), z2.string()),
2101
+ country: z2.string(),
2102
+ region: z2.string(),
2103
+ city: z2.string(),
2104
+ timezone: z2.string(),
2105
+ asOrganization: z2.string(),
2106
+ deviceType: z2.string(),
2107
+ browser: z2.string(),
2108
+ os: z2.string(),
2109
+ identityHash: z2.string(),
2110
+ identityKind: z2.string()
2111
+ });
2112
+ var analyticsMeasureScopeSchema = z2.object({
2113
+ scope: z2.enum(["campaigns", "outcomes", "all", "unknown"]),
2114
+ /** Every event the tag on the client's own site sent in this window. */
2115
+ websiteEvents: z2.number(),
2116
+ /** Browser ids it minted off-Baker. Any at all means the tag is on `all`. */
2117
+ websiteNewVisitors: z2.number()
2118
+ });
2119
+ var analyticsQueryDataSchema = z2.object({
2120
+ preset: analyticsPresetSchema,
2121
+ window: analyticsWindowSchema,
2122
+ totals: analyticsTotalsSchema,
2123
+ trend: z2.array(analyticsTrendPointSchema).optional(),
2124
+ topPages: z2.array(analyticsPageRowSchema).optional(),
2125
+ topSources: z2.array(analyticsSourceRowSchema).optional(),
2126
+ topCampaigns: z2.array(analyticsCampaignRowSchema).optional(),
2127
+ countries: z2.array(analyticsDimensionRowSchema).optional(),
2128
+ devices: z2.array(analyticsDimensionRowSchema).optional(),
2129
+ funnels: z2.array(analyticsFunnelSchema).optional(),
2130
+ flowSummary: z2.array(analyticsFlowSummarySchema).optional(),
2131
+ flowPaths: z2.array(analyticsFlowEdgeSchema).optional(),
2132
+ triggers: z2.array(analyticsTriggerRowSchema).optional(),
2133
+ releases: z2.array(analyticsReleaseRowSchema).optional(),
2134
+ paid: z2.array(analyticsPaidRowSchema).optional(),
2135
+ measureScope: analyticsMeasureScopeSchema.optional(),
2136
+ deliveries: z2.array(analyticsDeliveryRowSchema).optional(),
2137
+ submissions: z2.array(analyticsSubmissionRowSchema).optional(),
2138
+ geo: z2.array(analyticsGeoRowSchema).optional(),
2139
+ bots: z2.array(analyticsBotRowSchema).optional(),
2140
+ landings: z2.array(analyticsLandingRowSchema).optional(),
2141
+ tags: z2.array(analyticsTagRowSchema).optional(),
2142
+ customEvents: z2.array(analyticsCustomEventRowSchema).optional(),
2143
+ eventBreakdown: z2.array(analyticsEventBreakdownRowSchema).optional(),
2144
+ customFunnel: z2.array(analyticsCustomFunnelStepSchema).optional(),
2145
+ deviceBreakdown: z2.array(analyticsDeviceRowSchema).optional(),
2146
+ realtime: analyticsRealtimeSchema.optional(),
2147
+ adDimensions: z2.array(analyticsAdDimensionRowSchema).optional(),
2148
+ adParams: z2.array(analyticsAdParamRowSchema).optional(),
2149
+ /**
2150
+ * Parameters arriving on visits no platform can be named for.
2151
+ *
2152
+ * Kept apart rather than folded into the platform's own list, and kept rather
2153
+ * than dropped. Folding them in is what made every tab identical; dropping
2154
+ * them would lose a parameter that arrives on hand-tagged links, on an email
2155
+ * campaign, or on paid traffic whose click id an ad blocker removed — and
2156
+ * losing it silently, which is the one outcome worse than showing it in the
2157
+ * wrong place. They are evidence, not a to-do list: there is no platform to
2158
+ * map them under, so a reader who recognises one adds it by name to the
2159
+ * platform they know it belongs to.
2160
+ */
2161
+ adParamsUnattributed: z2.array(analyticsAdParamRowSchema).optional(),
2162
+ adPlatformTraffic: z2.array(analyticsAdPlatformTrafficSchema).optional(),
2163
+ flowDestinations: z2.array(analyticsFlowDestinationsSchema).optional(),
2164
+ /** Present only on a report that was asked for by the page. */
2165
+ pageInfo: analyticsPageInfoSchema.optional(),
2166
+ conversions: z2.array(analyticsConversionRowSchema).optional(),
2167
+ /** Every event these pages produced, counted or not. The "add a conversion" picker. */
2168
+ eventCatalog: z2.array(analyticsEventCatalogRowSchema).optional(),
2169
+ timeline: z2.array(analyticsTimelineRowSchema).optional(),
2170
+ /**
2171
+ * The raw feed. Same row shape as a replay, because it is the same rows —
2172
+ * what changes is that this one is bounded by a window rather than by a visit.
2173
+ */
2174
+ stream: z2.array(analyticsTimelineRowSchema).optional(),
2175
+ /** How each line of a people search on `stream` was read — what `personTerms` points at. */
2176
+ peopleSearch: z2.array(peopleSearchTermSchema).optional(),
2177
+ visitorSessions: z2.array(analyticsVisitorSessionSchema).optional(),
2178
+ /** Every key this person is known by — contact details, browsers, clicks, cookies. */
2179
+ personKeys: z2.array(analyticsPersonKeySchema).optional(),
2180
+ /** The same person, rolled up: their totals across every device, and what is known about them. */
2181
+ personProfile: analyticsPersonProfileSchema.optional(),
2182
+ visitProfile: analyticsVisitProfileSchema.optional(),
2183
+ visitors: z2.array(analyticsVisitorRowSchema).optional(),
2184
+ /**
2185
+ * The same totals for the window immediately before this one, when asked for.
2186
+ *
2187
+ * The comparison window is returned alongside rather than reduced to a set of
2188
+ * deltas, so a caller can show either side of it and does not have to trust
2189
+ * our arithmetic to render "1,240 vs 980".
2190
+ */
2191
+ previous: z2.object({
2192
+ window: analyticsWindowSchema,
2193
+ totals: analyticsTotalsSchema
2194
+ }).optional()
2195
+ });
2196
+ var analyticsQueryResponseSchema = z2.object({
2197
+ ok: z2.literal(true),
2198
+ data: analyticsQueryDataSchema,
2199
+ warnings: z2.array(analyticsWarningSchema).optional(),
2200
+ hints: z2.array(z2.string()).optional()
2201
+ });
2202
+ var analyticsConversionsRequestSchema = z2.object({
2203
+ set: z2.array(
2204
+ z2.object({
2205
+ /** `form:<flow>:<step>:<trigger>` | `submit:<flow>` | `page:<name>` | `exit:<host>`. */
2206
+ eventKey: z2.string().max(320),
2207
+ name: z2.string().max(MAX_CONVERSION_NAME),
2208
+ countMode: z2.enum(CONVERSION_COUNT_MODES).optional()
2209
+ })
2210
+ ).max(60).optional(),
2211
+ remove: z2.array(z2.string().max(320)).max(60).optional(),
2212
+ /** Every key counted under `from` moves to `to`, and the sends under the name go with it. */
2213
+ rename: z2.object({ from: z2.string().min(1).max(MAX_CONVERSION_NAME), to: z2.string().min(1).max(MAX_CONVERSION_NAME) }).optional()
2214
+ });
2215
+ var analyticsConversionsResponseSchema = z2.object({
2216
+ ok: z2.literal(true),
2217
+ data: z2.object({
2218
+ /**
2219
+ * What the company counts — inside a chat, with this chat's proposal on
2220
+ * top: `staged` marks a definition that applies when the chat is published.
2221
+ */
2222
+ definitions: z2.array(
2223
+ z2.object({
2224
+ eventKey: z2.string(),
2225
+ name: z2.string(),
2226
+ countMode: z2.string(),
2227
+ updatedAt: z2.number(),
2228
+ staged: z2.boolean().optional()
2229
+ })
2230
+ ),
2231
+ /** This chat's proposal, when it has one: counted from Publish, and gone if the chat is discarded. */
2232
+ staged: z2.object({
2233
+ set: z2.array(z2.object({ eventKey: z2.string(), name: z2.string() })),
2234
+ remove: z2.array(z2.string())
2235
+ }).optional()
2236
+ }),
2237
+ hints: z2.array(z2.string()).optional()
2238
+ });
2239
+ var analyticsMappingRequestSchema = z2.object({
2240
+ /**
2241
+ * Which platform these operations are about. Required for a change.
2242
+ *
2243
+ * There is no cross-platform entry to write: the platforms do not describe
2244
+ * the same world, so `cid` is TikTok's ad and half the internet's campaign,
2245
+ * and a keyword on Meta traffic is not a thing that can exist. Omit it only
2246
+ * to read the mapping back.
2247
+ */
2248
+ platform: z2.enum(AD_PLATFORMS).optional(),
2249
+ /** Parameter name → role, on `platform`. Merged over what is stored. */
2250
+ set: z2.record(z2.string().max(64), adParamRoleSchema).optional(),
2251
+ /** Parameter names to stop reading, on `platform`. Applied after `set`. */
2252
+ remove: z2.array(z2.string().max(64)).max(64).optional()
2253
+ });
2254
+ var analyticsMappingResponseSchema = z2.object({
2255
+ ok: z2.literal(true),
2256
+ data: z2.object({
2257
+ /**
2258
+ * This company's own entries after the change, keyed `<platform>/<name>`.
2259
+ *
2260
+ * Every platform's, not only the one the request named: a caller that has
2261
+ * just mapped `cid` on TikTok is usually about to be asked the same
2262
+ * question about Google, and the answer there is different.
2263
+ */
2264
+ params: z2.record(z2.string(), adParamRoleSchema),
2265
+ /**
2266
+ * Names that are understood without being configured.
2267
+ *
2268
+ * Returned so a caller can tell "already handled" from "not mapped" without
2269
+ * shipping a copy of the built-in list, and so an agent does not spend a
2270
+ * turn configuring `keyword` to mean keyword.
2271
+ */
2272
+ builtIn: z2.array(z2.string()),
2273
+ /**
2274
+ * What the client's own ad account says about each parameter just staged.
2275
+ *
2276
+ * Present only when a Session staged a `set` on a platform whose tracking
2277
+ * configuration Baker can read. `contradicted` is the entry worth stopping
2278
+ * for: the account fills that name with a placeholder meaning something
2279
+ * else, so the answer just given would produce a report that is wrong and
2280
+ * looks entirely plausible.
2281
+ */
2282
+ evidence: z2.record(
2283
+ z2.string(),
2284
+ z2.object({
2285
+ status: z2.enum(["confirmed", "contradicted", "unseen", "not_read"]),
2286
+ macro: z2.string().optional(),
2287
+ suggestedRole: adParamRoleSchema.optional(),
2288
+ source: z2.string().optional(),
2289
+ reason: z2.string().optional()
2290
+ })
2291
+ ).optional(),
2292
+ updatedAt: z2.number().nullable()
2293
+ }),
2294
+ hints: z2.array(z2.string()).optional()
2295
+ });
2296
+ var analyticsTrackingRequestSchema = z2.object({
2297
+ platform: z2.enum(AD_PLATFORMS).optional(),
2298
+ days: z2.number().int().min(1).max(365).optional()
2299
+ });
2300
+ var trackingDimensionSchema = z2.object({
2301
+ role: adParamRoleSchema,
2302
+ /** The platform's own macro for it — what goes in the URL. */
2303
+ macro: z2.string(),
2304
+ /** The account's own spelling where it has one, else the canonical name. */
2305
+ name: z2.string(),
2306
+ /**
2307
+ * What has to happen for this dimension to reach a report.
2308
+ *
2309
+ * Four states rather than a boolean, because two of them need opposite fixes
2310
+ * and one of them is not a finding at all. `unmapped` is one
2311
+ * `baker analytics map` call and repairs the history with it; `missing` is a
2312
+ * change to the ad account and everything before it stays unattributable;
2313
+ * `unknown` means no visit arrived and the account could not be read, which
2314
+ * must never be reported as untagged.
2315
+ */
2316
+ state: z2.enum(["covered", "unmapped", "missing", "unknown"]),
2317
+ evidence: z2.string().optional(),
2318
+ note: z2.string().optional()
2319
+ });
2320
+ var analyticsTrackingPlatformSchema = z2.object({
2321
+ platform: z2.enum(AD_PLATFORMS),
2322
+ label: z2.string(),
2323
+ sessions: z2.number(),
2324
+ /** Whether the ad account itself could be read, and why not when it could not. */
2325
+ account: z2.object({ read: z2.boolean(), templates: z2.number(), reason: z2.string().optional() }),
2326
+ dimensions: z2.array(trackingDimensionSchema),
2327
+ /** Names the URLs already carry that Baker does not read yet. */
2328
+ unmapped: z2.record(z2.string(), adParamRoleSchema),
2329
+ mapCommand: z2.string(),
2330
+ unexplained: z2.array(z2.object({ name: z2.string(), value: z2.string() })),
2331
+ /** The pairs to append to the account's tagging, or `""`. */
2332
+ suffix: z2.string(),
2333
+ whereItGoes: z2.string(),
2334
+ /** Which level to put them at, who can write it, and how an existing value is treated. */
2335
+ fix: z2.string()
2336
+ });
2337
+ var analyticsTrackingResponseSchema = z2.object({
2338
+ ok: z2.literal(true),
2339
+ data: z2.object({ days: z2.number(), platforms: z2.array(analyticsTrackingPlatformSchema) }),
2340
+ hints: z2.array(z2.string()).optional()
2341
+ });
2342
+ var boundedReference = (max) => z2.string().transform((value) => cutToLength(value, max));
2343
+ var submissionRecordRequestSchema = z2.object({
2344
+ /**
2345
+ * Injected by the Worker from the host or the site key. Never from the page.
2346
+ *
2347
+ * One of the two fields that is still required, because a copy that cannot
2348
+ * be filed under a company cannot be found again by anybody. Bounding it
2349
+ * would produce a row belonging to a company that does not exist, which is
2350
+ * worse than refusing — this is the case where refusing is right.
2351
+ */
2352
+ companyId: z2.string().min(1),
2353
+ /** Shared with every destination this submit was sent to, and with its event. */
2354
+ submissionId: z2.string().min(1).pipe(boundedReference(128)),
2355
+ /**
2356
+ * The Form execution this step belongs to, or `""` from a page published
2357
+ * before attempts existed.
2358
+ *
2359
+ * `submissionId` is minted per node, so two steps of one filling produce two
2360
+ * copies with nothing joining them. This is that join. It changes nothing
2361
+ * else here: a sealed copy is still per step, and still the only payload
2362
+ * anybody keeps.
2363
+ */
2364
+ attemptId: boundedReference(128).default(""),
2365
+ flowSlug: boundedReference(120).default(""),
2366
+ nodeId: boundedReference(120).default(""),
2367
+ nodeType: boundedReference(40).default(""),
2368
+ landingId: boundedReference(120).default(""),
2369
+ release: boundedReference(64).default(""),
2370
+ pageUrl: boundedReference(2048).default(""),
2371
+ /**
2372
+ * A SHA-256 digest, or absent. Never an address.
2373
+ *
2374
+ * The join from a recovered copy to every session the same person had,
2375
+ * without anybody having to open the copy to get there.
2376
+ */
2377
+ identityHash: boundedReference(128).optional(),
2378
+ /**
2379
+ * Degraded rather than refused, like everything else here: an unrecognised
2380
+ * kind costs the copy one label, and refusing it would cost the copy.
2381
+ */
2382
+ identityKind: z2.enum(["email", "phone"]).optional().catch(void 0),
2383
+ /** Injected by the Worker's edge. Kept exactly here and as a /24 everywhere else. */
2384
+ clientIp: boundedReference(64).nullish(),
2385
+ /**
2386
+ * Every answer on the step, free text included. Sealed on arrival.
2387
+ *
2388
+ * Bounded rather than length-checked, and that is the whole of it: a `max()`
2389
+ * here refused the **entire copy** over one long answer, so a visitor who
2390
+ * pasted a paragraph into a free-text field lost the email and the budget
2391
+ * beside it too. See {@link boundSubmissionAnswers}.
2392
+ */
2393
+ answers: z2.record(z2.string(), z2.string()).transform(boundSubmissionAnswers)
2394
+ });
2395
+
2396
+ // ../api/src/analytics/trackingPlan.ts
2397
+ import { z as z4 } from "zod";
2398
+
2399
+ // ../api/src/funnel/wire.ts
2400
+ import { z as z3 } from "zod";
2401
+
2402
+ // ../api/src/funnel/stepTemplates.ts
2403
+ var FUNNEL_STEP_TEMPLATES = [
2404
+ {
2405
+ key: "saw_offer",
2406
+ displayName: "Saw the offer",
2407
+ meaning: "Someone opened one of your landing pages \u2014 where most journeys start",
2408
+ stepClass: "visited",
2409
+ classNote: "The only `visited` template: a landing being viewed is a step, never an outcome.",
2410
+ aliases: ["saw the offer", "visited", "landing viewed", "page viewed", "visit", "visitor"],
2411
+ // Never sent anywhere: every platform already counts its own page views,
2412
+ // and uploading a view as a conversion would teach it to optimise for
2413
+ // nothing.
2414
+ platformDefaults: {}
2415
+ },
2416
+ {
2417
+ key: "lead",
2418
+ displayName: "Lead",
2419
+ meaning: "Someone left their details \u2014 the starting point of most journeys",
2420
+ stepClass: "lead",
2421
+ aliases: ["lead", "new lead", "inbound lead", "enquiry", "inquiry", "form submission"],
2422
+ platformDefaults: {
2423
+ meta: { eventName: "Lead", standard: true },
2424
+ googleAds: { category: "Submit lead form" },
2425
+ linkedin: { type: "LEAD", verified: true }
2426
+ }
2427
+ },
2428
+ {
2429
+ key: "signed_up",
2430
+ displayName: "Signed up",
2431
+ meaning: "Someone created an account",
2432
+ stepClass: "lead",
2433
+ classNote: "Same fact as a lead reached a different way \u2014 we now know who they are.",
2434
+ aliases: ["signed up", "sign up", "registered", "registration", "account created", "new user"],
2435
+ platformDefaults: {
2436
+ meta: { eventName: "CompleteRegistration", standard: true },
2437
+ googleAds: { category: "Sign-up" },
2438
+ linkedin: { type: "SIGN_UP", verified: true }
2439
+ }
2440
+ },
2441
+ {
2442
+ key: "add_to_cart",
2443
+ displayName: "Added to cart",
2444
+ meaning: "Something went into the cart",
2445
+ stepClass: "engaged",
2446
+ aliases: ["added to cart", "add to cart", "cart"],
2447
+ platformDefaults: {
2448
+ meta: { eventName: "AddToCart", standard: true },
2449
+ googleAds: { category: "Add to cart" },
2450
+ linkedin: { type: "ADD_TO_CART", verified: true }
2451
+ }
2452
+ },
2453
+ {
2454
+ key: "checkout_started",
2455
+ displayName: "Started checkout",
2456
+ meaning: "The checkout began",
2457
+ stepClass: "engaged",
2458
+ aliases: ["started checkout", "checkout started", "checkout", "begin checkout"],
2459
+ platformDefaults: {
2460
+ meta: { eventName: "InitiateCheckout", standard: true },
2461
+ googleAds: { category: "Begin checkout" },
2462
+ // Written from the documentation and never checked against the live
2463
+ // enum, which is what `verified: false` is for — carried as a caveat
2464
+ // rather than quietly resolved.
2465
+ linkedin: { type: "START_CHECKOUT", verified: false, fallback: "OTHER" }
2466
+ }
2467
+ },
2468
+ {
2469
+ key: "trial_started",
2470
+ displayName: "Trial started",
2471
+ meaning: "A free trial began",
2472
+ stepClass: "engaged",
2473
+ classNote: "A trial is use, not payment \u2014 engaged, never customer.",
2474
+ aliases: ["trial", "trial started", "free trial", "in trial"],
2475
+ platformDefaults: {
2476
+ meta: { eventName: "StartTrial", standard: true },
2477
+ googleAds: { category: "Sign-up" },
2478
+ linkedin: { type: "OTHER", verified: true }
2479
+ }
2480
+ },
2481
+ {
2482
+ key: "qualified_lead",
2483
+ displayName: "Qualified lead",
2484
+ meaning: "The lead matches who you sell to",
2485
+ stepClass: "engaged",
2486
+ aliases: ["qualified lead", "qualified", "mql", "sql", "sales qualified lead", "marketing qualified lead"],
2487
+ platformDefaults: {
2488
+ meta: { eventName: "QualifiedLead", standard: false },
2489
+ googleAds: { category: "Qualified lead" },
2490
+ linkedin: { type: "QUALIFIED_LEAD", verified: true }
2491
+ }
2492
+ },
2493
+ {
2494
+ key: "contacted",
2495
+ displayName: "Contacted",
2496
+ meaning: "Your team reached out",
2497
+ stepClass: "engaged",
2498
+ classNote: "Engaged even though the move came from the seller: it is a real forward interaction.",
2499
+ aliases: ["contacted", "contact", "outreach", "follow up", "first contact", "attempting contact"],
2500
+ platformDefaults: {
2501
+ meta: { eventName: "Contact", standard: true },
2502
+ googleAds: { category: "Contact" },
2503
+ linkedin: { type: "CONTACT", verified: true }
2504
+ }
2505
+ },
2506
+ {
2507
+ key: "meeting_scheduled",
2508
+ displayName: "Meeting booked",
2509
+ meaning: "A meeting is on the calendar",
2510
+ stepClass: "engaged",
2511
+ aliases: [
2512
+ "meeting booked",
2513
+ "meeting scheduled",
2514
+ "demo scheduled",
2515
+ "demo booked",
2516
+ "appointment booked",
2517
+ "call booked"
2518
+ ],
2519
+ platformDefaults: {
2520
+ meta: { eventName: "Schedule", standard: true },
2521
+ googleAds: { category: "Book appointment" },
2522
+ // LinkedIn has SCHEDULE and BOOK_APPOINTMENT separately; the second is the
2523
+ // one that means a reservation.
2524
+ linkedin: { type: "BOOK_APPOINTMENT", verified: true }
2525
+ }
2526
+ },
2527
+ {
2528
+ key: "meeting_held",
2529
+ displayName: "Meeting held",
2530
+ meaning: "The meeting actually happened \u2014 kept apart from booking because no-show is a real number",
2531
+ stepClass: "engaged",
2532
+ aliases: ["meeting held", "meeting done", "demo held", "demo done", "demo completed", "call held"],
2533
+ platformDefaults: {
2534
+ meta: { eventName: "MeetingHeld", standard: false },
2535
+ googleAds: { category: "Other" },
2536
+ linkedin: { type: "OTHER", verified: true }
2537
+ }
2538
+ },
2539
+ {
2540
+ key: "opportunity",
2541
+ displayName: "Opportunity open",
2542
+ meaning: "A deal is open \u2014 send the estimated value if you have one",
2543
+ stepClass: "engaged",
2544
+ classNote: "A number behind an intention is still no money, so engaged rather than customer.",
2545
+ aliases: ["opportunity", "proposal sent", "proposal", "negotiation", "in negotiation", "quote sent", "deal open"],
2546
+ platformDefaults: {
2547
+ meta: { eventName: "Opportunity", standard: false },
2548
+ googleAds: { category: "Request quote" },
2549
+ linkedin: { type: "REQUEST_QUOTE", verified: true }
2550
+ }
2551
+ },
2552
+ {
2553
+ key: "won",
2554
+ displayName: "Deal won",
2555
+ meaning: "The deal closed \u2014 the amount is required here",
2556
+ stepClass: "customer",
2557
+ aliases: ["won", "closed won", "deal won", "purchase", "sale"],
2558
+ platformDefaults: {
2559
+ meta: { eventName: "Purchase", standard: true },
2560
+ // Which of the two depends on whether the company reports a revenue
2561
+ // amount. It is a per-company answer, so it stays a fork, not a constant.
2562
+ googleAds: { category: "Purchase", alternative: "Converted lead" },
2563
+ linkedin: { type: "PURCHASE", verified: true }
2564
+ }
2565
+ },
2566
+ {
2567
+ key: "subscribed",
2568
+ displayName: "Subscription started",
2569
+ meaning: "A paying subscription began \u2014 the amount is the recurring one",
2570
+ stepClass: "customer",
2571
+ classNote: "Customer, not repeat: it is the first money. Repeat is what happens after \u2014 see the renewed template.",
2572
+ aliases: ["subscribed", "subscription started", "new subscription", "paying"],
2573
+ platformDefaults: {
2574
+ meta: { eventName: "Subscribe", standard: true },
2575
+ googleAds: { category: "Purchase" },
2576
+ linkedin: { type: "PURCHASE", verified: true }
2577
+ }
2578
+ },
2579
+ {
2580
+ key: "renewed",
2581
+ displayName: "Subscription renewed",
2582
+ meaning: "An existing customer paid again or expanded \u2014 the amount is what they paid this time",
2583
+ stepClass: "repeat",
2584
+ classNote: "The smallest honest member of `repeat`. Without it every SaaS funnel drawn from this library ends at `subscribed` and the stage has nothing to hold. The recurring lifecycle beyond renewal \u2014 upgrades, churn, refunds \u2014 is a bigger conversation than a template.",
2585
+ aliases: ["renewed", "renewal", "subscription renewed", "expansion", "upsell"],
2586
+ platformDefaults: {
2587
+ meta: { eventName: "Renewed", standard: false },
2588
+ googleAds: { category: "Purchase" },
2589
+ linkedin: { type: "PURCHASE", verified: true }
2590
+ }
2591
+ },
2592
+ {
2593
+ key: "application_submitted",
2594
+ displayName: "Application submitted",
2595
+ meaning: "Someone submitted an application \u2014 a course, a policy, a credit line",
2596
+ stepClass: "engaged",
2597
+ classNote: "For education, events, fintech and insurance. Strong intent, no money yet.",
2598
+ aliases: ["application submitted", "application", "applied", "application received"],
2599
+ platformDefaults: {
2600
+ meta: { eventName: "SubmitApplication", standard: true },
2601
+ googleAds: { category: "Submit lead form" },
2602
+ linkedin: { type: "SUBMIT_APPLICATION", verified: true }
2603
+ }
2604
+ },
2605
+ {
2606
+ key: "lost",
2607
+ displayName: "Lost",
2608
+ meaning: "It did not go ahead \u2014 the deal fell through, or the lead was never a fit",
2609
+ stepClass: "lost",
2610
+ classNote: "Terminal and never sent anywhere. It can happen at any depth, which is why the order check leaves it alone.",
2611
+ aliases: [
2612
+ "lost",
2613
+ "closed lost",
2614
+ "deal lost",
2615
+ "no budget",
2616
+ "not interested",
2617
+ "disqualified",
2618
+ "unqualified",
2619
+ "not a fit",
2620
+ "spam",
2621
+ "duplicate",
2622
+ "junk"
2623
+ ],
2624
+ platformDefaults: {}
2625
+ }
2626
+ ];
2627
+ var TEMPLATES_BY_KEY = new Map(
2628
+ FUNNEL_STEP_TEMPLATES.map((template) => [template.key, template])
2629
+ );
2630
+ var FUNNEL_VERTICALS = [
2631
+ "b2b_sales",
2632
+ "b2b_inbound",
2633
+ "saas_self_serve",
2634
+ "saas_sales_assisted",
2635
+ "ecommerce_purchase"
2636
+ ];
2637
+
2638
+ // ../api/src/funnel/vocabulary.ts
2639
+ var FUNNEL_STEP_CLASSES = [
2640
+ /** Saw the offer: a landing opened, an ad clicked through. */
2641
+ "visited",
2642
+ /** We know who they are: a form sent, an account created. */
2643
+ "lead",
2644
+ /** Something real happened: a call booked, a trial started, a quote asked for, a cart filled. */
2645
+ "engaged",
2646
+ /** Paid, or signed. */
2647
+ "customer",
2648
+ /** Paid again, renewed, or grew. */
2649
+ "repeat",
2650
+ /** Terminal. Did not go ahead, or was never a fit. */
2651
+ "lost"
2652
+ ];
2653
+
2654
+ // ../api/src/funnel/wire.ts
2655
+ var MAX_STEPS = 40;
2656
+ var MAX_PER_STEP = 20;
2657
+ var funnelTriggerSchema = z3.discriminatedUnion("kind", [
2658
+ z3.object({
2659
+ id: z3.string().min(1).max(64),
2660
+ kind: z3.literal("event"),
2661
+ /** The event's key, from `--moments`: `form:…`, `submit:…`, `page:…`, `exit:…`. */
2662
+ eventKey: z3.string().min(1).max(320)
2663
+ }),
2664
+ z3.object({
2665
+ id: z3.string().min(1).max(64),
2666
+ kind: z3.literal("landing"),
2667
+ /** The landing's internal id — what the page stamps on its rows, never its slug. */
2668
+ landingId: z3.string().min(1).max(120)
2669
+ }),
2670
+ /** Any landing being viewed — what a funnel's first step usually listens for. */
2671
+ z3.object({
2672
+ id: z3.string().min(1).max(64),
2673
+ kind: z3.literal("any_landing")
2674
+ })
2675
+ ]);
2676
+ var funnelStepSchema = z3.object({
2677
+ /** Lowercase letters, digits and underscores. Stable — renaming never changes it. */
2678
+ key: z3.string().min(1).max(64),
2679
+ /** The client's own words for this step. Shown everywhere; unconstrained. */
2680
+ displayName: z3.string().min(1).max(120),
2681
+ stepClass: z3.enum(FUNNEL_STEP_CLASSES),
2682
+ /** Predecessor keys. Empty means people come in here. */
2683
+ after: z3.array(z3.string().max(64)).max(MAX_STEPS).default([]),
2684
+ /** What moves somebody onto this step. Any one of them is enough. */
2685
+ triggers: z3.array(funnelTriggerSchema).max(MAX_PER_STEP).default([])
2686
+ });
2687
+ var funnelRequestSchema = z3.object({
2688
+ steps: z3.array(funnelStepSchema).max(MAX_STEPS).optional(),
2689
+ /** One step, added or replaced by its key. Everything else is untouched. */
2690
+ step: funnelStepSchema.optional(),
2691
+ /** One step taken out by key; whatever came after it moves up to whatever came before it. */
2692
+ removeStep: z3.string().min(1).max(64).optional(),
2693
+ /**
2694
+ * ONE way in added to a step, leaving the rest of that step alone.
2695
+ *
2696
+ * `step` takes a whole step, so adding a way in through it means restating
2697
+ * the step's name, stage, `after[]` and every trigger it already had — and a
2698
+ * trigger left out of that restatement is silently removed. This is the door
2699
+ * for the thing that is actually being asked ("this Form's booking should
2700
+ * count here"), and it cannot drop anything.
2701
+ */
2702
+ addTrigger: z3.object({ stepKey: z3.string().min(1).max(64), eventKey: z3.string().min(1).max(320) }).optional(),
2703
+ /** ONE way in taken off a step, by the event key it listens for. */
2704
+ removeTrigger: z3.object({ stepKey: z3.string().min(1).max(64), eventKey: z3.string().min(1).max(320) }).optional(),
2705
+ /** One of the ready-made graphs, instead of stating steps. */
2706
+ preset: z3.enum(FUNNEL_VERTICALS).optional(),
2707
+ /** Also return the suggestion library and the presets. */
2708
+ templates: z3.boolean().optional(),
2709
+ /**
2710
+ * Also return everything a trigger can name: every event this company's
2711
+ * Forms, pages and systems have actually produced, its sources, and its
2712
+ * landings. The list to pick a trigger FROM, so nobody has to guess.
2713
+ */
2714
+ moments: z3.boolean().optional(),
2715
+ /** How many days the counts beside each step cover. Default 30. */
2716
+ days: z3.number().int().min(1).max(400).optional(),
2717
+ /**
2718
+ * The Forms, by slug, the caller names itself when no step counts them —
2719
+ * `baker funnel` reads its own workspace and names each with the key that
2720
+ * places it. The backend leaves them out of its own hint, so no Form is
2721
+ * named twice.
2722
+ */
2723
+ namedByCaller: z3.array(z3.string().min(1).max(200)).max(1e3).optional()
2724
+ });
2725
+ var funnelResponseSchema = z3.object({
2726
+ ok: z3.literal(true),
2727
+ data: z3.object({
2728
+ /** The published version, or 0 when this company has never drawn a funnel. */
2729
+ version: z3.number(),
2730
+ /** Whether `steps` is a proposal waiting on this chat's publish rather than what is live. */
2731
+ staged: z3.boolean(),
2732
+ steps: z3.array(
2733
+ z3.object({
2734
+ key: z3.string(),
2735
+ displayName: z3.string(),
2736
+ stepClass: z3.string(),
2737
+ after: z3.array(z3.string()),
2738
+ triggers: z3.array(z3.record(z3.string(), z3.unknown())),
2739
+ /**
2740
+ * Where the people who reach this step are sent: the sends of every
2741
+ * system event among its triggers. Read-only here — a send belongs to
2742
+ * the event and is set with `baker analytics sends`.
2743
+ */
2744
+ sends: z3.array(
2745
+ z3.object({
2746
+ id: z3.string(),
2747
+ eventKey: z3.string(),
2748
+ platform: z3.string(),
2749
+ event: z3.string(),
2750
+ /** What happened to it in the window, in one line. */
2751
+ outcome: z3.string().optional()
2752
+ })
2753
+ ),
2754
+ /** How many people reached this step in the window. Counted in people, across visits and devices. */
2755
+ people: z3.number().optional(),
2756
+ /** How many reached this step or any step after it. */
2757
+ atLeast: z3.number().optional(),
2758
+ /** How many got as far as the step before it. Absent for a way in. */
2759
+ before: z3.number().optional(),
2760
+ /** `atLeast / before`, 0–1. Absent where there is no before. */
2761
+ share: z3.number().optional(),
2762
+ events: z3.number().optional(),
2763
+ money: z3.record(z3.string(), z3.number()).optional()
2764
+ })
2765
+ ),
2766
+ /** The window `people` and friends were counted over. */
2767
+ window: z3.object({ startDate: z3.string(), endDate: z3.string(), days: z3.number() }).optional(),
2768
+ /** The step that loses the most people, by key. Absent while nothing is lost. */
2769
+ worstStep: z3.string().optional(),
2770
+ /**
2771
+ * The steps this write took off the funnel, by key. Present on every write,
2772
+ * empty when nothing was dropped — the answer to "did my restatement forget
2773
+ * one", given in the same turn.
2774
+ */
2775
+ removed: z3.array(z3.string()).optional(),
2776
+ /**
2777
+ * What this company counts as page conversions, this chat's staged counts
2778
+ * included, by event key and name. Here so a Form's ending can say it is
2779
+ * already counted — the agent choosing a step's way in should use that
2780
+ * same key — and outside `moments` because the plain read's hints say it too.
2781
+ */
2782
+ counted: z3.array(z3.object({ eventKey: z3.string(), name: z3.string() })).optional(),
2783
+ /** Everything a trigger can name, when asked for with `moments`. */
2784
+ moments: z3.object({
2785
+ events: z3.array(
2786
+ z3.object({
2787
+ eventKey: z3.string(),
2788
+ /** `site` for a page or Form, `systems` for the client's own server, `both` when both sent it. */
2789
+ origin: z3.string().optional(),
2790
+ /** The Form it belongs to, when it belongs to one. */
2791
+ flowSlug: z3.string().optional(),
2792
+ nodeType: z3.string().optional(),
2793
+ events: z3.number(),
2794
+ sessions: z3.number(),
2795
+ /** The name it is counted under as a page conversion, when the company counts it. Informational. */
2796
+ countedAs: z3.string().optional(),
2797
+ /**
2798
+ * The step of the Form this happens on, in the Form's own words —
2799
+ * never a node id. Present on a Form's ending read from the Form
2800
+ * itself, which is the only place the name is known.
2801
+ */
2802
+ step: z3.string().optional(),
2803
+ /**
2804
+ * `false` on an ending a Form raises natively but nobody has fired
2805
+ * yet — derived from the Form, offered at zero, exactly as a
2806
+ * Source is offered before its first send. Absent means it came
2807
+ * from the event store and therefore happened.
2808
+ */
2809
+ seen: z3.boolean().optional()
2810
+ })
2811
+ ),
2812
+ /** The company's sources: a system of theirs that posts events to Baker, by the event name it raises. */
2813
+ sources: z3.array(z3.object({ eventKey: z3.string(), name: z3.string(), status: z3.string() })),
2814
+ landings: z3.array(z3.object({ landingId: z3.string(), title: z3.string(), slug: z3.string() }))
2815
+ }).optional(),
2816
+ templates: z3.array(
2817
+ z3.object({
2818
+ key: z3.string(),
2819
+ displayName: z3.string(),
2820
+ meaning: z3.string(),
2821
+ stepClass: z3.string()
2822
+ })
2823
+ ).optional(),
2824
+ presets: z3.array(z3.object({ vertical: z3.string(), label: z3.string(), description: z3.string(), steps: z3.array(z3.string()) })).optional(),
2825
+ /**
2826
+ * What each stage means, the test to apply, and the same stage in three
2827
+ * shapes of business.
2828
+ *
2829
+ * The stage is the one thing in a funnel a company does not invent, so it
2830
+ * is the one thing the agent has to get right on the company's behalf —
2831
+ * and "engaged: did something real" cannot settle whether a trial is
2832
+ * engaged or customer. Same source as the dashboard's stage picker, so the
2833
+ * two cannot teach it differently.
2834
+ */
2835
+ stages: z3.array(
2836
+ z3.object({
2837
+ stepClass: z3.string(),
2838
+ title: z3.string(),
2839
+ meaning: z3.string(),
2840
+ test: z3.string(),
2841
+ examples: z3.object({ shop: z3.string(), selfServe: z3.string(), salesLed: z3.string() })
2842
+ })
2843
+ ).optional()
2844
+ }),
2845
+ hints: z3.array(z3.string()).optional()
2846
+ });
2847
+
2848
+ // ../api/src/analytics/trackingPlan.ts
2849
+ var text = z4.string().trim().min(1).max(2e3);
2850
+ var key = z4.string().trim().min(1).max(100);
2851
+ var webUrl = z4.url().refine((value) => ["https:", "http:"].includes(new URL(value).protocol), "Use a website address");
2852
+ var trackingEventSchema = z4.object({
2853
+ eventKey: key.refine((value) => parseEventKey(value) !== null, "Use an existing Baker event key"),
2854
+ name: text,
2855
+ purpose: z4.enum(["conversion", "progress", "diagnostic", "uncounted"]),
2856
+ door: z4.enum(ANALYTICS_EVENT_DOORS),
2857
+ sourceEvent: key.optional(),
2858
+ emitterEvidence: text.optional(),
2859
+ status: z4.enum(["prepared", "waiting", "published", "verified"]),
2860
+ requirement: text.optional(),
2861
+ owner: text.optional(),
2862
+ verificationEvidence: text.optional()
2863
+ }).superRefine((event, ctx) => {
2864
+ if (event.status === "waiting") {
2865
+ if (!event.requirement || !event.owner) ctx.addIssue({ code: "custom", message: "A waiting event needs its requirement and owner" });
2866
+ } else if (!event.emitterEvidence) {
2867
+ ctx.addIssue({ code: "custom", message: "A prepared event needs evidence that the source emits it" });
2868
+ }
2869
+ if (["published", "verified"].includes(event.status) && !event.verificationEvidence) {
2870
+ ctx.addIssue({ code: "custom", message: "Published or verified tracking needs evidence; a staged tag is only prepared" });
2871
+ }
2872
+ });
2873
+ var trackingJourneySchema = z4.object({
2874
+ key,
2875
+ name: text,
2876
+ entryUrls: z4.array(webUrl).max(50),
2877
+ destinationUrl: webUrl,
2878
+ strategy: z4.enum(["native", "embed", "api", "link"]),
2879
+ status: z4.enum(["supported", "waiting"]),
2880
+ requiredFields: z4.array(key).max(100),
2881
+ attribution: text,
2882
+ acceptanceEvidence: text.optional(),
2883
+ continuationEvidence: text.optional(),
2884
+ requirement: text.optional(),
2885
+ owner: text.optional()
2886
+ }).superRefine((journey, ctx) => {
2887
+ if (journey.strategy === "link" && journey.requiredFields.length > 0) ctx.addIssue({ code: "custom", message: "A link handoff must not capture details that the destination asks for again" });
2888
+ if (journey.status === "waiting" && (!journey.requirement || !journey.owner)) ctx.addIssue({ code: "custom", message: "A waiting journey needs its requirement and owner" });
2889
+ if (journey.status === "supported" && journey.strategy === "api" && (!journey.acceptanceEvidence || !journey.continuationEvidence)) ctx.addIssue({ code: "custom", message: "An API replacement needs accepted-submission and continuation evidence" });
2890
+ });
2891
+ var trackingPlanSchema = z4.object({
2892
+ journeys: z4.array(trackingJourneySchema).max(30),
2893
+ events: z4.array(trackingEventSchema).max(100)
2894
+ }).superRefine((plan, ctx) => {
2895
+ for (const entries of [plan.journeys.map((journey) => journey.key), plan.events.map((event) => event.eventKey)]) {
2896
+ if (new Set(entries).size !== entries.length) ctx.addIssue({ code: "custom", message: "Each journey and event must appear once" });
2897
+ }
2898
+ });
2899
+ var variableName = z4.string().trim().min(1).max(200).refine((value) => !/[{}<>"'\\\r\n]/.test(value), "Use a plain container variable name");
2900
+ var trackingInstallationSchema = z4.object({
2901
+ containerId: key,
2902
+ baseTagName: key,
2903
+ folderId: key.optional(),
2904
+ consent: z4.enum(["auto", "strict"]).default("auto"),
2905
+ measure: z4.enum(["campaigns", "outcomes", "all"]).default("campaigns"),
2906
+ events: z4.array(z4.object({
2907
+ eventKey: key.refine((value) => parseEventKey(value) !== null, "Use an existing Baker event key"),
2908
+ tagName: key,
2909
+ triggerId: key,
2910
+ properties: z4.record(key, variableName).default({}),
2911
+ eventIdVariable: variableName.optional()
2912
+ })).max(50)
2913
+ });
2914
+ var trackingPlanRequestSchema = z4.object({ chatId: z4.string().optional(), plan: trackingPlanSchema.optional(), wireConversions: z4.boolean().default(false), steps: z4.array(funnelStepSchema).max(30).optional(), installation: trackingInstallationSchema.optional() }).superRefine((request, ctx) => {
2915
+ if (!request.plan && (request.installation || request.wireConversions || request.steps)) ctx.addIssue({ code: "custom", message: "Preparation needs the agreed tracking plan" });
2916
+ });
2917
+ var trackingPlanResponseSchema = z4.object({ ok: z4.literal(true), data: z4.object({ plan: trackingPlanSchema.nullable(), staged: z4.boolean() }), hints: z4.array(z4.string()).optional() });
2918
+
2919
+ export {
2920
+ formEventKey,
2921
+ isLandingViewKey,
2922
+ parseEventKey,
2923
+ FUNNEL_VERTICALS,
2924
+ funnelRequestSchema,
2925
+ AD_PARAM_ROLE_SPECS,
2926
+ RESERVED_PARAM_NAMES,
2927
+ isAdPlatform,
2928
+ AD_PLATFORM_DEFINITIONS,
2929
+ essentialAdDimensions,
2930
+ builtinAdParamMapping,
2931
+ CONVERSION_COUNT_MODES,
2932
+ STEP_SUBMIT_TRIGGERS,
2933
+ PEOPLE_SEARCH_MAX_TERMS,
2934
+ parsePeopleQuery,
2935
+ peopleLookupRequestSchema,
2936
+ SEND_FILTERS,
2937
+ ANALYTICS_EVENT_DOORS,
2938
+ trackingPlanSchema,
2939
+ trackingPlanRequestSchema,
2940
+ trackingPlanResponseSchema
2941
+ };
2942
+ //# sourceMappingURL=chunk-HR6IWNKE.js.map