@shware/analytics 13.1.0 → 14.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (408) hide show
  1. package/README.md +12 -0
  2. package/dist/_virtual/_rolldown/runtime.cjs +1 -2
  3. package/dist/_virtual/_rolldown/runtime.mjs +1 -2
  4. package/dist/ads/google.cjs +1 -2
  5. package/dist/ads/google.d.cts +0 -2
  6. package/dist/ads/google.d.cts.map +1 -1
  7. package/dist/ads/google.d.mts +0 -2
  8. package/dist/ads/google.d.mts.map +1 -1
  9. package/dist/ads/google.mjs +1 -2
  10. package/dist/ads/meta.cjs +1 -2
  11. package/dist/ads/meta.d.cts +0 -2
  12. package/dist/ads/meta.d.cts.map +1 -1
  13. package/dist/ads/meta.d.mts +0 -2
  14. package/dist/ads/meta.d.mts.map +1 -1
  15. package/dist/ads/meta.mjs +1 -2
  16. package/dist/ads/time.cjs +1 -2
  17. package/dist/ads/time.d.cts +0 -2
  18. package/dist/ads/time.d.cts.map +1 -1
  19. package/dist/ads/time.d.mts +0 -2
  20. package/dist/ads/time.d.mts.map +1 -1
  21. package/dist/ads/time.mjs +1 -2
  22. package/dist/ads/types.d.cts +0 -2
  23. package/dist/ads/types.d.cts.map +1 -1
  24. package/dist/ads/types.d.mts +0 -2
  25. package/dist/ads/types.d.mts.map +1 -1
  26. package/dist/attribution/classify.cjs +1 -2
  27. package/dist/attribution/classify.d.cts +0 -2
  28. package/dist/attribution/classify.d.cts.map +1 -1
  29. package/dist/attribution/classify.d.mts +0 -2
  30. package/dist/attribution/classify.d.mts.map +1 -1
  31. package/dist/attribution/classify.mjs +1 -2
  32. package/dist/attribution/vocabulary.cjs +1 -2
  33. package/dist/attribution/vocabulary.d.cts +0 -2
  34. package/dist/attribution/vocabulary.d.cts.map +1 -1
  35. package/dist/attribution/vocabulary.d.mts +0 -2
  36. package/dist/attribution/vocabulary.d.mts.map +1 -1
  37. package/dist/attribution/vocabulary.mjs +1 -2
  38. package/dist/bot/generic.cjs +1 -2
  39. package/dist/bot/generic.d.cts +0 -2
  40. package/dist/bot/generic.d.cts.map +1 -1
  41. package/dist/bot/generic.d.mts +0 -2
  42. package/dist/bot/generic.d.mts.map +1 -1
  43. package/dist/bot/generic.mjs +1 -2
  44. package/dist/bot/index.cjs +1 -2
  45. package/dist/bot/index.d.cts +0 -2
  46. package/dist/bot/index.d.cts.map +1 -1
  47. package/dist/bot/index.d.mts +0 -2
  48. package/dist/bot/index.d.mts.map +1 -1
  49. package/dist/bot/index.mjs +1 -2
  50. package/dist/click-id/index.cjs +1 -2
  51. package/dist/click-id/index.d.cts +0 -2
  52. package/dist/click-id/index.d.cts.map +1 -1
  53. package/dist/click-id/index.d.mts +0 -2
  54. package/dist/click-id/index.d.mts.map +1 -1
  55. package/dist/click-id/index.mjs +1 -2
  56. package/dist/constants/storage.cjs +1 -2
  57. package/dist/constants/storage.d.cts +0 -2
  58. package/dist/constants/storage.d.cts.map +1 -1
  59. package/dist/constants/storage.d.mts +0 -2
  60. package/dist/constants/storage.d.mts.map +1 -1
  61. package/dist/constants/storage.mjs +1 -2
  62. package/dist/feedback/index.cjs +7 -2
  63. package/dist/feedback/index.cjs.map +1 -1
  64. package/dist/feedback/index.d.cts +6 -2
  65. package/dist/feedback/index.d.cts.map +1 -1
  66. package/dist/feedback/index.d.mts +6 -2
  67. package/dist/feedback/index.d.mts.map +1 -1
  68. package/dist/feedback/index.mjs +7 -2
  69. package/dist/feedback/index.mjs.map +1 -1
  70. package/dist/hooks/use-app-analytics.cjs +1 -2
  71. package/dist/hooks/use-app-analytics.d.cts +0 -2
  72. package/dist/hooks/use-app-analytics.d.cts.map +1 -1
  73. package/dist/hooks/use-app-analytics.d.mts +0 -2
  74. package/dist/hooks/use-app-analytics.d.mts.map +1 -1
  75. package/dist/hooks/use-app-analytics.mjs +1 -2
  76. package/dist/hooks/use-outbound-click-analytics.cjs +1 -2
  77. package/dist/hooks/use-outbound-click-analytics.d.cts +0 -2
  78. package/dist/hooks/use-outbound-click-analytics.d.cts.map +1 -1
  79. package/dist/hooks/use-outbound-click-analytics.d.mts +0 -2
  80. package/dist/hooks/use-outbound-click-analytics.d.mts.map +1 -1
  81. package/dist/hooks/use-outbound-click-analytics.mjs +1 -2
  82. package/dist/hooks/use-report-web-vitals.cjs +1 -2
  83. package/dist/hooks/use-report-web-vitals.d.cts +0 -2
  84. package/dist/hooks/use-report-web-vitals.d.cts.map +1 -1
  85. package/dist/hooks/use-report-web-vitals.d.mts +0 -2
  86. package/dist/hooks/use-report-web-vitals.d.mts.map +1 -1
  87. package/dist/hooks/use-report-web-vitals.mjs +1 -2
  88. package/dist/hooks/use-track-impression.cjs +1 -2
  89. package/dist/hooks/use-track-impression.d.cts +0 -2
  90. package/dist/hooks/use-track-impression.d.cts.map +1 -1
  91. package/dist/hooks/use-track-impression.d.mts +0 -2
  92. package/dist/hooks/use-track-impression.d.mts.map +1 -1
  93. package/dist/hooks/use-track-impression.mjs +1 -2
  94. package/dist/hooks/use-uet-id-sync.cjs +1 -2
  95. package/dist/hooks/use-uet-id-sync.d.cts +0 -2
  96. package/dist/hooks/use-uet-id-sync.d.cts.map +1 -1
  97. package/dist/hooks/use-uet-id-sync.d.mts +0 -2
  98. package/dist/hooks/use-uet-id-sync.d.mts.map +1 -1
  99. package/dist/hooks/use-uet-id-sync.mjs +1 -2
  100. package/dist/hooks/use-web-analytics.cjs +1 -2
  101. package/dist/hooks/use-web-analytics.d.cts +0 -2
  102. package/dist/hooks/use-web-analytics.d.cts.map +1 -1
  103. package/dist/hooks/use-web-analytics.d.mts +0 -2
  104. package/dist/hooks/use-web-analytics.d.mts.map +1 -1
  105. package/dist/hooks/use-web-analytics.mjs +1 -2
  106. package/dist/link/index.cjs +1 -2
  107. package/dist/link/index.d.cts +0 -2
  108. package/dist/link/index.d.cts.map +1 -1
  109. package/dist/link/index.d.mts +0 -2
  110. package/dist/link/index.d.mts.map +1 -1
  111. package/dist/link/index.mjs +1 -2
  112. package/dist/native/deep-link.cjs +1 -2
  113. package/dist/native/deep-link.d.cts +0 -2
  114. package/dist/native/deep-link.d.cts.map +1 -1
  115. package/dist/native/deep-link.d.mts +0 -2
  116. package/dist/native/deep-link.d.mts.map +1 -1
  117. package/dist/native/deep-link.mjs +1 -2
  118. package/dist/native/fbsdk.cjs +1 -2
  119. package/dist/native/fbsdk.d.cts +0 -2
  120. package/dist/native/fbsdk.d.cts.map +1 -1
  121. package/dist/native/fbsdk.d.mts +0 -2
  122. package/dist/native/fbsdk.d.mts.map +1 -1
  123. package/dist/native/fbsdk.mjs +1 -2
  124. package/dist/native/fingerprint.cjs +1 -2
  125. package/dist/native/fingerprint.d.cts +0 -2
  126. package/dist/native/fingerprint.d.cts.map +1 -1
  127. package/dist/native/fingerprint.d.mts +0 -2
  128. package/dist/native/fingerprint.d.mts.map +1 -1
  129. package/dist/native/fingerprint.mjs +1 -2
  130. package/dist/native/firebase.cjs +1 -2
  131. package/dist/native/firebase.d.cts +0 -2
  132. package/dist/native/firebase.d.cts.map +1 -1
  133. package/dist/native/firebase.d.mts +0 -2
  134. package/dist/native/firebase.d.mts.map +1 -1
  135. package/dist/native/firebase.mjs +1 -2
  136. package/dist/native/index.cjs +1 -1
  137. package/dist/native/index.mjs +1 -1
  138. package/dist/native/posthog.cjs +1 -2
  139. package/dist/native/posthog.d.cts +0 -2
  140. package/dist/native/posthog.d.cts.map +1 -1
  141. package/dist/native/posthog.d.mts +0 -2
  142. package/dist/native/posthog.d.mts.map +1 -1
  143. package/dist/native/posthog.mjs +1 -2
  144. package/dist/native/setup.cjs +1 -2
  145. package/dist/native/setup.d.cts +0 -2
  146. package/dist/native/setup.d.cts.map +1 -1
  147. package/dist/native/setup.d.mts +0 -2
  148. package/dist/native/setup.d.mts.map +1 -1
  149. package/dist/native/setup.mjs +1 -2
  150. package/dist/next/index.cjs +1 -2
  151. package/dist/next/index.d.cts +0 -2
  152. package/dist/next/index.d.cts.map +1 -1
  153. package/dist/next/index.d.mts +0 -2
  154. package/dist/next/index.d.mts.map +1 -1
  155. package/dist/next/index.mjs +1 -2
  156. package/dist/node_modules/.pnpm/bowser@2.14.1/node_modules/bowser/es5.cjs +1 -2
  157. package/dist/node_modules/.pnpm/bowser@2.14.1/node_modules/bowser/es5.mjs +1 -2
  158. package/dist/react-router/index.cjs +2 -3
  159. package/dist/react-router/index.d.cts +0 -2
  160. package/dist/react-router/index.d.cts.map +1 -1
  161. package/dist/react-router/index.d.mts +0 -2
  162. package/dist/react-router/index.d.mts.map +1 -1
  163. package/dist/react-router/index.mjs +2 -3
  164. package/dist/schema/index.cjs +9 -3
  165. package/dist/schema/index.cjs.map +1 -1
  166. package/dist/schema/index.d.cts +1 -2
  167. package/dist/schema/index.d.cts.map +1 -1
  168. package/dist/schema/index.d.mts +1 -2
  169. package/dist/schema/index.d.mts.map +1 -1
  170. package/dist/schema/index.mjs +9 -3
  171. package/dist/schema/index.mjs.map +1 -1
  172. package/dist/server/action-source.cjs +1 -2
  173. package/dist/server/action-source.d.cts +0 -2
  174. package/dist/server/action-source.d.cts.map +1 -1
  175. package/dist/server/action-source.d.mts +0 -2
  176. package/dist/server/action-source.d.mts.map +1 -1
  177. package/dist/server/action-source.mjs +1 -2
  178. package/dist/server/click-ids.cjs +1 -2
  179. package/dist/server/click-ids.d.cts +0 -2
  180. package/dist/server/click-ids.d.cts.map +1 -1
  181. package/dist/server/click-ids.d.mts +0 -2
  182. package/dist/server/click-ids.d.mts.map +1 -1
  183. package/dist/server/click-ids.mjs +1 -2
  184. package/dist/server/google-data-manager.cjs +1 -2
  185. package/dist/server/google-data-manager.d.cts +0 -2
  186. package/dist/server/google-data-manager.d.cts.map +1 -1
  187. package/dist/server/google-data-manager.d.mts +0 -2
  188. package/dist/server/google-data-manager.d.mts.map +1 -1
  189. package/dist/server/google-data-manager.mjs +1 -2
  190. package/dist/server/linkedin-conversions-api.cjs +1 -2
  191. package/dist/server/linkedin-conversions-api.d.cts +0 -2
  192. package/dist/server/linkedin-conversions-api.d.cts.map +1 -1
  193. package/dist/server/linkedin-conversions-api.d.mts +0 -2
  194. package/dist/server/linkedin-conversions-api.d.mts.map +1 -1
  195. package/dist/server/linkedin-conversions-api.mjs +1 -2
  196. package/dist/server/meta-capi.cjs +1 -2
  197. package/dist/server/meta-capi.d.cts +0 -2
  198. package/dist/server/meta-capi.d.cts.map +1 -1
  199. package/dist/server/meta-capi.d.mts +0 -2
  200. package/dist/server/meta-capi.d.mts.map +1 -1
  201. package/dist/server/meta-capi.mjs +1 -2
  202. package/dist/server/meta-conversions-api.cjs +1 -2
  203. package/dist/server/meta-conversions-api.d.cts +0 -2
  204. package/dist/server/meta-conversions-api.d.cts.map +1 -1
  205. package/dist/server/meta-conversions-api.d.mts +0 -2
  206. package/dist/server/meta-conversions-api.d.mts.map +1 -1
  207. package/dist/server/meta-conversions-api.mjs +1 -2
  208. package/dist/server/microsoft-conversions-api.cjs +1 -2
  209. package/dist/server/microsoft-conversions-api.d.cts +0 -2
  210. package/dist/server/microsoft-conversions-api.d.cts.map +1 -1
  211. package/dist/server/microsoft-conversions-api.d.mts +0 -2
  212. package/dist/server/microsoft-conversions-api.d.mts.map +1 -1
  213. package/dist/server/microsoft-conversions-api.mjs +1 -2
  214. package/dist/server/openai-conversions-api.cjs +1 -2
  215. package/dist/server/openai-conversions-api.d.cts +0 -2
  216. package/dist/server/openai-conversions-api.d.cts.map +1 -1
  217. package/dist/server/openai-conversions-api.d.mts +0 -2
  218. package/dist/server/openai-conversions-api.d.mts.map +1 -1
  219. package/dist/server/openai-conversions-api.mjs +1 -2
  220. package/dist/server/page-location.cjs +1 -2
  221. package/dist/server/page-location.d.cts +0 -2
  222. package/dist/server/page-location.d.cts.map +1 -1
  223. package/dist/server/page-location.d.mts +0 -2
  224. package/dist/server/page-location.d.mts.map +1 -1
  225. package/dist/server/page-location.mjs +1 -2
  226. package/dist/server/reddit-conversions-api.cjs +1 -2
  227. package/dist/server/reddit-conversions-api.d.cts +0 -2
  228. package/dist/server/reddit-conversions-api.d.cts.map +1 -1
  229. package/dist/server/reddit-conversions-api.d.mts +0 -2
  230. package/dist/server/reddit-conversions-api.d.mts.map +1 -1
  231. package/dist/server/reddit-conversions-api.mjs +1 -2
  232. package/dist/setup/index.cjs +1 -2
  233. package/dist/setup/index.d.cts +0 -2
  234. package/dist/setup/index.d.cts.map +1 -1
  235. package/dist/setup/index.d.mts +0 -2
  236. package/dist/setup/index.d.mts.map +1 -1
  237. package/dist/setup/index.mjs +1 -2
  238. package/dist/setup/session.cjs +1 -2
  239. package/dist/setup/session.d.cts +0 -2
  240. package/dist/setup/session.d.cts.map +1 -1
  241. package/dist/setup/session.d.mts +0 -2
  242. package/dist/setup/session.d.mts.map +1 -1
  243. package/dist/setup/session.mjs +1 -2
  244. package/dist/tanstack/analytics.cjs +2 -3
  245. package/dist/tanstack/analytics.d.cts +0 -2
  246. package/dist/tanstack/analytics.d.cts.map +1 -1
  247. package/dist/tanstack/analytics.d.mts +0 -2
  248. package/dist/tanstack/analytics.d.mts.map +1 -1
  249. package/dist/tanstack/analytics.mjs +2 -3
  250. package/dist/tanstack/middleware.cjs +1 -2
  251. package/dist/tanstack/middleware.d.cts +0 -2
  252. package/dist/tanstack/middleware.d.cts.map +1 -1
  253. package/dist/tanstack/middleware.d.mts +0 -2
  254. package/dist/tanstack/middleware.d.mts.map +1 -1
  255. package/dist/tanstack/middleware.mjs +1 -2
  256. package/dist/test/native-modules.d.cts +0 -2
  257. package/dist/test/native-modules.d.mts +0 -2
  258. package/dist/test/setup.cjs +1 -2
  259. package/dist/test/setup.d.cts +0 -2
  260. package/dist/test/setup.d.cts.map +1 -1
  261. package/dist/test/setup.d.mts +0 -2
  262. package/dist/test/setup.d.mts.map +1 -1
  263. package/dist/test/setup.mjs +1 -2
  264. package/dist/third-parties/google-analytics.cjs +1 -2
  265. package/dist/third-parties/google-analytics.d.cts +0 -2
  266. package/dist/third-parties/google-analytics.d.cts.map +1 -1
  267. package/dist/third-parties/google-analytics.d.mts +0 -2
  268. package/dist/third-parties/google-analytics.d.mts.map +1 -1
  269. package/dist/third-parties/google-analytics.mjs +1 -2
  270. package/dist/third-parties/ignored-events.cjs +1 -2
  271. package/dist/third-parties/ignored-events.d.cts +0 -2
  272. package/dist/third-parties/ignored-events.d.cts.map +1 -1
  273. package/dist/third-parties/ignored-events.d.mts +0 -2
  274. package/dist/third-parties/ignored-events.d.mts.map +1 -1
  275. package/dist/third-parties/ignored-events.mjs +1 -2
  276. package/dist/third-parties/linkedin-insight-tag.cjs +1 -2
  277. package/dist/third-parties/linkedin-insight-tag.d.cts +0 -2
  278. package/dist/third-parties/linkedin-insight-tag.d.cts.map +1 -1
  279. package/dist/third-parties/linkedin-insight-tag.d.mts +0 -2
  280. package/dist/third-parties/linkedin-insight-tag.d.mts.map +1 -1
  281. package/dist/third-parties/linkedin-insight-tag.mjs +1 -2
  282. package/dist/third-parties/meta-pixel.cjs +2 -3
  283. package/dist/third-parties/meta-pixel.d.cts +0 -2
  284. package/dist/third-parties/meta-pixel.d.cts.map +1 -1
  285. package/dist/third-parties/meta-pixel.d.mts +0 -2
  286. package/dist/third-parties/meta-pixel.d.mts.map +1 -1
  287. package/dist/third-parties/meta-pixel.mjs +2 -3
  288. package/dist/third-parties/microsoft-uet.cjs +1 -2
  289. package/dist/third-parties/microsoft-uet.d.cts +0 -2
  290. package/dist/third-parties/microsoft-uet.d.cts.map +1 -1
  291. package/dist/third-parties/microsoft-uet.d.mts +0 -2
  292. package/dist/third-parties/microsoft-uet.d.mts.map +1 -1
  293. package/dist/third-parties/microsoft-uet.mjs +1 -2
  294. package/dist/third-parties/openai-pixel.cjs +1 -2
  295. package/dist/third-parties/openai-pixel.d.cts +0 -2
  296. package/dist/third-parties/openai-pixel.d.cts.map +1 -1
  297. package/dist/third-parties/openai-pixel.d.mts +0 -2
  298. package/dist/third-parties/openai-pixel.d.mts.map +1 -1
  299. package/dist/third-parties/openai-pixel.mjs +1 -2
  300. package/dist/third-parties/posthog.cjs +1 -2
  301. package/dist/third-parties/posthog.d.cts +0 -2
  302. package/dist/third-parties/posthog.d.cts.map +1 -1
  303. package/dist/third-parties/posthog.d.mts +0 -2
  304. package/dist/third-parties/posthog.d.mts.map +1 -1
  305. package/dist/third-parties/posthog.mjs +1 -2
  306. package/dist/third-parties/reddit-pixel.cjs +1 -2
  307. package/dist/third-parties/reddit-pixel.d.cts +0 -2
  308. package/dist/third-parties/reddit-pixel.d.cts.map +1 -1
  309. package/dist/third-parties/reddit-pixel.d.mts +0 -2
  310. package/dist/third-parties/reddit-pixel.d.mts.map +1 -1
  311. package/dist/third-parties/reddit-pixel.mjs +1 -2
  312. package/dist/track/fbq.cjs +1 -2
  313. package/dist/track/fbq.d.cts +0 -2
  314. package/dist/track/fbq.d.cts.map +1 -1
  315. package/dist/track/fbq.d.mts +0 -2
  316. package/dist/track/fbq.d.mts.map +1 -1
  317. package/dist/track/fbq.mjs +1 -2
  318. package/dist/track/gtag.cjs +1 -2
  319. package/dist/track/gtag.d.cts +0 -2
  320. package/dist/track/gtag.d.cts.map +1 -1
  321. package/dist/track/gtag.d.mts +0 -2
  322. package/dist/track/gtag.d.mts.map +1 -1
  323. package/dist/track/gtag.mjs +1 -2
  324. package/dist/track/index.cjs +1 -2
  325. package/dist/track/index.d.cts +0 -2
  326. package/dist/track/index.d.cts.map +1 -1
  327. package/dist/track/index.d.mts +0 -2
  328. package/dist/track/index.d.mts.map +1 -1
  329. package/dist/track/index.mjs +1 -2
  330. package/dist/track/lintrk.d.cts +0 -2
  331. package/dist/track/lintrk.d.cts.map +1 -1
  332. package/dist/track/lintrk.d.mts +0 -2
  333. package/dist/track/lintrk.d.mts.map +1 -1
  334. package/dist/track/oaiq.cjs +1 -2
  335. package/dist/track/oaiq.d.cts +0 -2
  336. package/dist/track/oaiq.d.cts.map +1 -1
  337. package/dist/track/oaiq.d.mts +0 -2
  338. package/dist/track/oaiq.d.mts.map +1 -1
  339. package/dist/track/oaiq.mjs +1 -2
  340. package/dist/track/once.cjs +1 -2
  341. package/dist/track/once.d.cts +0 -2
  342. package/dist/track/once.d.cts.map +1 -1
  343. package/dist/track/once.d.mts +0 -2
  344. package/dist/track/once.d.mts.map +1 -1
  345. package/dist/track/once.mjs +1 -2
  346. package/dist/track/rdt.cjs +1 -2
  347. package/dist/track/rdt.d.cts +0 -2
  348. package/dist/track/rdt.d.cts.map +1 -1
  349. package/dist/track/rdt.d.mts +0 -2
  350. package/dist/track/rdt.d.mts.map +1 -1
  351. package/dist/track/rdt.mjs +1 -2
  352. package/dist/track/types.d.cts +0 -2
  353. package/dist/track/types.d.cts.map +1 -1
  354. package/dist/track/types.d.mts +0 -2
  355. package/dist/track/types.d.mts.map +1 -1
  356. package/dist/track/uetq.cjs +1 -2
  357. package/dist/track/uetq.d.cts +0 -2
  358. package/dist/track/uetq.d.cts.map +1 -1
  359. package/dist/track/uetq.d.mts +0 -2
  360. package/dist/track/uetq.d.mts.map +1 -1
  361. package/dist/track/uetq.mjs +1 -2
  362. package/dist/utils/field.cjs +1 -2
  363. package/dist/utils/field.d.cts +0 -2
  364. package/dist/utils/field.d.cts.map +1 -1
  365. package/dist/utils/field.d.mts +0 -2
  366. package/dist/utils/field.d.mts.map +1 -1
  367. package/dist/utils/field.mjs +1 -2
  368. package/dist/utils/redact-url.cjs +1 -2
  369. package/dist/utils/redact-url.d.cts +0 -2
  370. package/dist/utils/redact-url.d.cts.map +1 -1
  371. package/dist/utils/redact-url.d.mts +0 -2
  372. package/dist/utils/redact-url.d.mts.map +1 -1
  373. package/dist/utils/redact-url.mjs +1 -2
  374. package/dist/utils/sha256.cjs +1 -2
  375. package/dist/utils/sha256.d.cts +0 -2
  376. package/dist/utils/sha256.d.cts.map +1 -1
  377. package/dist/utils/sha256.d.mts +0 -2
  378. package/dist/utils/sha256.d.mts.map +1 -1
  379. package/dist/utils/sha256.mjs +1 -2
  380. package/dist/visitor/id.cjs +1 -2
  381. package/dist/visitor/id.d.cts +0 -2
  382. package/dist/visitor/id.d.cts.map +1 -1
  383. package/dist/visitor/id.d.mts +0 -2
  384. package/dist/visitor/id.d.mts.map +1 -1
  385. package/dist/visitor/id.mjs +1 -2
  386. package/dist/visitor/index.cjs +1 -2
  387. package/dist/visitor/index.d.cts +0 -2
  388. package/dist/visitor/index.d.cts.map +1 -1
  389. package/dist/visitor/index.d.mts +0 -2
  390. package/dist/visitor/index.d.mts.map +1 -1
  391. package/dist/visitor/index.mjs +1 -2
  392. package/dist/visitor/types.d.cts +0 -2
  393. package/dist/visitor/types.d.cts.map +1 -1
  394. package/dist/visitor/types.d.mts +0 -2
  395. package/dist/visitor/types.d.mts.map +1 -1
  396. package/dist/web/index.cjs +2 -3
  397. package/dist/web/index.d.cts +0 -2
  398. package/dist/web/index.d.cts.map +1 -1
  399. package/dist/web/index.d.mts +0 -2
  400. package/dist/web/index.d.mts.map +1 -1
  401. package/dist/web/index.mjs +2 -3
  402. package/dist/web/page-key.cjs +1 -2
  403. package/dist/web/page-key.d.cts +0 -2
  404. package/dist/web/page-key.d.cts.map +1 -1
  405. package/dist/web/page-key.d.mts +0 -2
  406. package/dist/web/page-key.d.mts.map +1 -1
  407. package/dist/web/page-key.mjs +1 -2
  408. package/package.json +9 -9
@@ -1,11 +1,11 @@
1
1
  import { track } from "../track/index.mjs";
2
2
  import { useOutboundClickAnalytics } from "../hooks/use-outbound-click-analytics.mjs";
3
+ import { useReportWebVitals } from "../hooks/use-report-web-vitals.mjs";
3
4
  import { useUETIdSync } from "../hooks/use-uet-id-sync.mjs";
4
5
  import { useWebAnalytics } from "../hooks/use-web-analytics.mjs";
5
- import { useReportWebVitals } from "../hooks/use-report-web-vitals.mjs";
6
6
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
7
7
  import { useLocation } from "react-router";
8
- //#region src/react-router/index.tsx
8
+ // src/react-router/index.tsx
9
9
  function Analytics({ gaId, gaSrc, nonce, debugMode, metaPixelId, redditPixelId, linkedInPartnerId, uetTagId, uetCustomerId, hotjarId, facebookAppId, reportWebVitals = true }) {
10
10
  const { pathname, search } = useLocation();
11
11
  useWebAnalytics(pathname, search);
@@ -154,7 +154,6 @@ function Analytics({ gaId, gaSrc, nonce, debugMode, metaPixelId, redditPixelId,
154
154
  })
155
155
  ] });
156
156
  }
157
- //#endregion
158
157
  export { Analytics };
159
158
 
160
159
  //# sourceMappingURL=index.mjs.map
@@ -1,6 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  let zod_mini = require("zod/mini");
3
- //#region src/schema/index.ts
3
+ // src/schema/index.ts
4
4
  const MAX_KEY_LENGTH = 128;
5
5
  const MAX_VALUE_LENGTH = 512;
6
6
  const MAX_PROPERTIES = 64;
@@ -261,7 +261,14 @@ const updateVisitorSchema = (0, zod_mini.object)({
261
261
  const createFeedbackSchema = (0, zod_mini.object)({
262
262
  name: (0, zod_mini.string)().check((0, zod_mini.minLength)(1), (0, zod_mini.maxLength)(256)),
263
263
  email: emailValue,
264
- message: (0, zod_mini.string)().check((0, zod_mini.minLength)(1), (0, zod_mini.maxLength)(65536))
264
+ message: (0, zod_mini.string)().check((0, zod_mini.minLength)(1), (0, zod_mini.maxLength)(65536)),
265
+ /**
266
+ * The Cloudflare Turnstile token the host verifies before storing the feedback (the same field
267
+ * `@shware/security`'s email-code request carries). Required: without it `POST /feedback` is an
268
+ * open free-text write that only a rate limit protects. Single-use: Turnstile spends the token
269
+ * at verification, so the caller resets the widget after every submit, success or failure.
270
+ */
271
+ turnstileToken: (0, zod_mini.string)().check((0, zod_mini.minLength)(1), (0, zod_mini.maxLength)(2048))
265
272
  });
266
273
  const noEmptyString = (0, zod_mini.pipe)((0, zod_mini.string)().check((0, zod_mini.maxLength)(256)), (0, zod_mini.transform)((v) => v ? v : void 0));
267
274
  /**
@@ -307,7 +314,6 @@ const createLinkSchema = (0, zod_mini.object)({
307
314
  * */
308
315
  utm_marketing_tactic: (0, zod_mini.optional)(noEmptyString)
309
316
  });
310
- //#endregion
311
317
  exports.ALL_ENVIRONMENTS = ALL_ENVIRONMENTS;
312
318
  exports.ALL_PLATFORMS = ALL_PLATFORMS;
313
319
  exports.createFeedbackSchema = createFeedbackSchema;
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","names":["pipe","string","transform","array","record","union","number","boolean","_null","object","optional","trim","minLength","maxLength","regex","uuid","_enum","iso","toLowerCase","email","e164","toUpperCase","url"],"sources":["../../src/schema/index.ts"],"sourcesContent":["import {\n enum as _enum,\n null as _null,\n array,\n boolean,\n e164,\n email,\n iso,\n maxLength,\n minLength,\n number,\n object,\n optional,\n pipe,\n record,\n regex,\n string,\n toLowerCase,\n toUpperCase,\n transform,\n trim,\n union,\n url,\n uuid,\n type z,\n} from 'zod/mini';\nimport type { Environment, Platform } from '../track/types';\n\nconst MAX_KEY_LENGTH = 128;\nconst MAX_VALUE_LENGTH = 512;\nconst MAX_PROPERTIES = 64;\n\n/**\n * Truncated rather than rejected. These schemas validate a whole batch at once, so refusing one\n * oversized value costs every event that traveled with it — and the values that overrun are the\n * ones derived from the page (a link's text, a URL carrying a long query), which no client can\n * bound in advance. A shortened value is worth more than a lost batch.\n */\nconst propertyText = pipe(\n string(),\n transform((value) => value.slice(0, MAX_VALUE_LENGTH))\n);\n\n/**\n * Tags are truncated for the same reason property values are, and they are stored more than once\n * (on the event, the session and the visitor), so an unbounded one costs several times over.\n * 1024 sits just above what GA4 itself keeps (1000 characters of page_location, 420 of\n * page_referrer, 300 of page_title). Real tags stay under ~500 characters; the rare longer ones\n * are page_referrer values from search and ad redirect URLs, where the kept prefix — host and\n * path — is the part that matters.\n */\nconst MAX_TAG_LENGTH = 1024;\n\nconst tagText = pipe(\n string(),\n transform((value) => value.slice(0, MAX_TAG_LENGTH))\n);\n\n/**\n * Keys are written by hand in instrumentation code, so an unusable one is a mistake in the host\n * rather than something the visitor typed. It is still dropped rather than rejected, for the same\n * reason: the mistake should cost that property, not the batch it happens to be in. Truncating a\n * key is not an option — two long keys would silently become one field.\n *\n * The key schema below is deliberately permissive so that this transform is reached at all; the\n * trimming it used to do happens here instead. `MAX_PROPERTIES` keeps the first N in insertion\n * order.\n */\nfunction takeProperties<T>(data: Record<string, T>): Record<string, T> {\n const result: Record<string, T> = {};\n let count = 0;\n for (const [rawKey, value] of Object.entries(data)) {\n if (count >= MAX_PROPERTIES) break;\n const key = rawKey.trim();\n if (!key || key.length > MAX_KEY_LENGTH) continue;\n result[key] = value;\n count++;\n }\n return result;\n}\n\n/**\n * Capped at GA4's own item-list limit, and truncated rather than rejected like every other\n * property limit here: an unbounded array is the one field a caller could still blow a batch\n * up with after the value and key limits.\n */\nconst MAX_ITEMS = 200;\n\nconst items = pipe(\n array(\n pipe(\n record(string(), union([propertyText, number(), boolean(), _null()])),\n transform(takeProperties)\n )\n ),\n transform((list) => list.slice(0, MAX_ITEMS))\n);\n\nexport const ALL_PLATFORMS = [\n 'ios',\n 'android',\n 'web',\n 'macos',\n 'windows',\n 'linux',\n 'unknown',\n] as const satisfies Platform[];\n\nexport const ALL_ENVIRONMENTS = ['development', 'production'] as const satisfies Environment[];\n\nexport const tagsSchema = object({\n os: optional(tagText),\n os_name: optional(tagText),\n os_version: optional(tagText),\n browser: optional(tagText),\n browser_name: optional(tagText),\n browser_version: optional(tagText),\n device: optional(tagText),\n device_id: optional(string().check(trim(), minLength(1), maxLength(36))),\n device_type: optional(tagText),\n device_vendor: optional(tagText),\n device_pixel_ratio: optional(number()),\n screen_width: optional(number()),\n screen_height: optional(number()),\n screen_resolution: optional(\n pipe(\n string().check(regex(/^\\d+x\\d+$/)),\n transform((v) => v as `${number}x${number}`)\n )\n ),\n webdriver: optional(boolean()),\n release: optional(tagText),\n language: optional(tagText),\n time_zone: optional(tagText),\n page_location: optional(tagText),\n page_referrer: optional(tagText),\n page_title: optional(tagText),\n page_load_id: optional(tagText),\n /**\n * @deprecated Renamed to `page_location` in 7.0.0. Accepted so that events from clients\n * still on an older SDK are not stripped of their page URL at this boundary — a browser\n * bundle stays cached long after a backend deploys. Remove once those clients are gone;\n * `pageLocation` in `server/page-location.ts` is the only reader.\n */\n // oxlint-disable-next-line typescript/no-deprecated -- Legacy input from pre-7.0 clients must survive validation.\n source_url: optional(tagText),\n // app info\n advertising_id: optional(tagText),\n install_referrer: optional(tagText),\n // Ad click ids (URL parameters) and ad platform cookies (underscore names); see AdvertisingInfo.\n // Meta Ads\n fbclid: optional(tagText),\n ad_id: optional(tagText),\n ad_name: optional(tagText),\n adset_id: optional(tagText),\n adset_name: optional(tagText),\n campaign_id: optional(tagText),\n campaign_name: optional(tagText),\n placement: optional(tagText),\n _fbc: optional(tagText),\n _fbp: optional(tagText),\n /**\n * @deprecated `fbc` / `fbp` / `rdt_uuid` were renamed to `_fbc` / `_fbp` / `_rdt_uuid` in 9.0.0.\n * Accepted so that conversions from clients still on an older SDK keep their match keys; the\n * senders read them only as a fallback (`server/click-ids.ts`). Remove once those clients are\n * gone.\n */\n // oxlint-disable-next-line typescript/no-deprecated -- Legacy pre-9.0 click-id fields must survive validation.\n fbc: optional(tagText),\n fbp: optional(tagText),\n rdt_uuid: optional(tagText),\n // Google Ads\n gclid: optional(tagText),\n gclsrc: optional(tagText),\n gad_source: optional(tagText),\n gad_campaignid: optional(tagText),\n network: optional(tagText),\n match_type: optional(tagText),\n wbraid: optional(tagText),\n gbraid: optional(tagText),\n dclid: optional(tagText),\n _gcl_aw: optional(tagText),\n _gcl_gb: optional(tagText),\n // Microsoft Ads\n msclkid: optional(tagText),\n _uetmsclkid: optional(tagText),\n // Reddit Ads\n rdt_cid: optional(tagText),\n _rdt_cid: optional(tagText),\n _rdt_uuid: optional(tagText),\n // LinkedIn Ads\n li_fat_id: optional(tagText),\n _li_fat_id: optional(tagText),\n // OpenAI Ads\n oppref: optional(tagText),\n __oppref: optional(tagText),\n __obref: optional(tagText),\n // other click ids\n ko_click_id: optional(tagText),\n ScCid: optional(tagText),\n ttclid: optional(tagText),\n twclid: optional(tagText),\n yclid: optional(tagText),\n epik: optional(tagText),\n // utm params\n utm_source: optional(tagText),\n utm_medium: optional(tagText),\n utm_campaign: optional(tagText),\n utm_term: optional(tagText),\n utm_content: optional(tagText),\n utm_id: optional(tagText),\n utm_source_platform: optional(tagText),\n utm_creative_format: optional(tagText),\n utm_marketing_tactic: optional(tagText),\n});\n\nexport const propertiesSchema = optional(\n pipe(\n record(string(), union([propertyText, number(), boolean(), _null(), items])),\n transform(takeProperties)\n )\n);\n\n/**\n * How far an event's time may be from the server's before the client clock it was stamped with is\n * taken as wrong. A batch legitimately arrives late — a tab frozen in the background, a\n * session_start held back after a failed batch — by hours, not days; a phone set to another year\n * writes its sessions into that year.\n */\nconst MAX_CLOCK_SKEW = 24 * 60 * 60 * 1000;\n\n/**\n * Puts the events stamped by a wrong client clock onto the server's, where they are parsed. Only\n * the events outside `MAX_CLOCK_SKEW` move, so one bad event cannot drag the rest of its batch\n * along: they move together by their own latest one — the wrong clock at sending — keeping their\n * order and spacing, and one still out after that (a batch mixing two wrong clocks) is on no clock\n * at all and takes the server's time. Corrected rather than rejected, for the same reason values\n * are truncated: a wrong clock should cost the event its time, not the batch its events.\n */\nfunction alignClock<T extends { timestamp: string }>(events: T[], now = Date.now()): T[] {\n const within = (time: number) => Math.abs(now - time) <= MAX_CLOCK_SKEW;\n const times = events.map((event) => Date.parse(event.timestamp));\n const wrong = times.filter((time) => !within(time));\n if (wrong.length === 0) return events;\n const offset = now - Math.max(...wrong);\n return events.map((event, i) => {\n if (within(times[i])) return event;\n const shifted = times[i] + offset;\n return { ...event, timestamp: new Date(within(shifted) ? shifted : now).toISOString() };\n });\n}\n\nexport const createTrackEventSchema = pipe(\n array(\n object({\n /**\n * The event's id, generated by the client when the event was tracked (12.1) and given to\n * the browser pixels as their deduplication id. Store the event under it with\n * `on conflict (id) do nothing`: a batch retried after the server committed it then\n * stores nothing twice. Optional for clients before 12.1, which send none — generate one\n * on the server for those.\n */\n id: optional(uuid({ version: 'v7' })),\n name: string().check(trim(), minLength(1), maxLength(64)),\n // Generated by the SDK, like `id` (`visitorId()`, `Session`): uuidv7 as well, so the\n // constraint is checked here once and the server need not check it again.\n visitor_id: uuid({ version: 'v7' }),\n session_id: uuid({ version: 'v7' }),\n platform: _enum(ALL_PLATFORMS),\n environment: _enum(ALL_ENVIRONMENTS),\n timestamp: iso.datetime(),\n tags: tagsSchema,\n properties: propertiesSchema,\n })\n ).check(minLength(1), maxLength(100)),\n transform((events) => alignClock(events))\n);\n\n/**\n * `POST /visitors`, what clients before 11.0 create their visitor with; 11.0 generates the id\n * itself and the server creates the visitor from its first events (README, \"Visitors\").\n * Kept for servers that still serve older clients.\n */\nexport const createVisitorSchema = object({\n device_id: string().check(trim(), minLength(1), maxLength(36)),\n platform: _enum(ALL_PLATFORMS),\n environment: _enum(ALL_ENVIRONMENTS),\n tags: tagsSchema,\n});\n\nconst emailValue = pipe(string().check(trim(), toLowerCase(), maxLength(320)), email());\n\n/** E.164: a plus sign (+) prefix, country code, then digits only, no dashes/parens/spaces. */\nconst phoneValue = pipe(string().check(trim()), e164());\n\nconst addressValue = object({\n first_name: optional(string().check(trim(), maxLength(128))),\n last_name: optional(string().check(trim(), maxLength(128))),\n street: optional(string().check(trim(), maxLength(256))),\n city: optional(string().check(trim(), maxLength(128))),\n /** User province, state, or region. Example: `Hampshire` */\n region: optional(string().check(trim(), maxLength(128))),\n postal_code: optional(string().check(trim(), maxLength(32))),\n /** 2-letter country code, per the ISO 3166-1 alpha-2 standard. Example: `UK` */\n country: optional(string().check(trim(), toUpperCase(), regex(/^[A-Z]{2}$/))),\n});\n\n/**\n * User-provided data (UPD) used for enhanced conversions, Customer Match, and demographics.\n * Values are sent unhashed; Google normalizes and hashes them before they reach its servers.\n *\n * Multiple values may be sent to increase the match rate: up to 3 emails, 3 phone numbers, and\n * 2 addresses.\n *\n * @see https://support.google.com/analytics/answer/14078702\n * @see https://support.google.com/google-ads/answer/13258081\n */\nexport const userProvidedDataSchema = object({\n email: optional(union([emailValue, array(emailValue).check(minLength(1), maxLength(3))])),\n phone_number: optional(union([phoneValue, array(phoneValue).check(minLength(1), maxLength(3))])),\n address: optional(union([addressValue, array(addressValue).check(minLength(1), maxLength(2))])),\n});\n\nexport const updateVisitorSchema = object({\n user_id: optional(uuid()),\n user_data: optional(userProvidedDataSchema),\n /**\n * Sent by clients before 11.1, which PATCHed their tags on every page load. From 11.1 the\n * server refreshes `visitor.tags` from each `session_start` — the moment the visit arrives —\n * and `setVisitor` sends none: at sign-in the page is no longer where the visit came in.\n */\n tags: optional(tagsSchema),\n});\n\nexport const createFeedbackSchema = object({\n name: string().check(minLength(1), maxLength(256)),\n // Trimmed and lower-cased like every other email the SDK accepts, so a host stores the\n // normalized form without wrapping the schema.\n email: emailValue,\n message: string().check(minLength(1), maxLength(65536)),\n});\n\nconst noEmptyString = pipe(\n string().check(maxLength(256)),\n transform((v) => (v ? v : undefined))\n);\n\n/**\n * The schema for creating a link.\n * @see https://support.google.com/analytics/answer/10917952\n * */\nexport const createLinkSchema = object({\n /** The URL that the user is redirected to. */\n url: url().check(minLength(1), maxLength(1024)), // required\n\n /**\n * Campaign ID. Used to identify a specific campaign or promotion. This is a required key for GA4\n * data import. Use the same IDs that you use when uploading campaign cost data.\n */\n utm_id: optional(noEmptyString),\n\n /** Referrer, for example: google, newsletter4, billboard */\n utm_source: string().check(minLength(1), maxLength(256)), // required\n\n /** Marketing medium, for example: cpc, banner, email */\n utm_medium: string().check(minLength(1), maxLength(256)), // required\n\n /** Product, slogan, promo code, for example, spring_sale */\n utm_campaign: string().check(minLength(1), maxLength(256)), // required\n\n /** Paid keyword */\n utm_term: optional(noEmptyString),\n\n /**\n * Use to differentiate creatives. For example, if you have two call-to-action links within the\n * same email message, you can use utm_content and set different values for each so you can tell\n * which version is more effective.\n */\n utm_content: optional(noEmptyString),\n\n /**\n * The platform responsible for directing traffic to a given Analytics property (such as a buying\n * platform that sets budgets and targeting criteria or a platform that manages organic traffic\n * data). For example, Search Ads 360 or Display & Video 360.\n */\n utm_source_platform: optional(noEmptyString),\n\n /**\n * Type of creative, for example, display, native, video, search, utm_creative_format is not\n * currently reported in Google Analytics 4 properties.\n */\n utm_creative_format: optional(noEmptyString),\n\n /**\n * Targeting criteria applied to a campaign, for example, remarketing, prospecting,\n * utm_marketing_tactic is not currently reported in Google Analytics 4 properties.\n * */\n utm_marketing_tactic: optional(noEmptyString),\n});\n\nexport type CreateTrackEventDTO = z.output<typeof createTrackEventSchema>;\nexport type CreateFeedbackDTO = z.output<typeof createFeedbackSchema>;\nexport type CreateLinkDTO = z.output<typeof createLinkSchema>;\nexport type CreateVisitorDTO = z.output<typeof createVisitorSchema>;\nexport type UserProvidedDataDTO = z.output<typeof userProvidedDataSchema>;\nexport type UpdateVisitorDTO = z.output<typeof updateVisitorSchema>;\n"],"mappings":";;;AA4BA,MAAM,iBAAiB;AACvB,MAAM,mBAAmB;AACzB,MAAM,iBAAiB;;;;;;;AAQvB,MAAM,gBAAA,GAAeA,SAAAA,KAAAA,EAAAA,GACnBC,SAAAA,OAAAA,CAAO,IAAA,GACPC,SAAAA,UAAAA,EAAW,UAAU,MAAM,MAAM,GAAG,gBAAgB,CAAC,CACvD;;;;;;;;;AAUA,MAAM,iBAAiB;AAEvB,MAAM,WAAA,GAAUF,SAAAA,KAAAA,EAAAA,GACdC,SAAAA,OAAAA,CAAO,IAAA,GACPC,SAAAA,UAAAA,EAAW,UAAU,MAAM,MAAM,GAAG,cAAc,CAAC,CACrD;;;;;;;;;;;AAYA,SAAS,eAAkB,MAA4C;CACrE,MAAM,SAA4B,CAAC;CACnC,IAAI,QAAQ;CACZ,KAAK,MAAM,CAAC,QAAQ,UAAU,OAAO,QAAQ,IAAI,GAAG;EAClD,IAAI,SAAS,gBAAgB;EAC7B,MAAM,MAAM,OAAO,KAAK;EACxB,IAAI,CAAC,OAAO,IAAI,SAAS,gBAAgB;EACzC,OAAO,OAAO;EACd;CACF;CACA,OAAO;AACT;;;;;;AAOA,MAAM,YAAY;AAElB,MAAM,SAAA,GAAQF,SAAAA,KAAAA,EAAAA,GACZG,SAAAA,MAAAA,EAAAA,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AA,CAAI,CAAC,CAAC,OAAA,GAAMV,SAAAA,UAAAA,CAAU,CAAC,IAAA,GAAGC,SAAAA,UAAAA,CAAU,IAAI,CAAC;;;;;CAM9C,SAAA,GAAQH,SAAAA,SAAAA,CAAS,aAAa;;CAG9B,aAAA,GAAYT,SAAAA,OAAAA,CAAO,CAAC,CAAC,OAAA,GAAMW,SAAAA,UAAAA,CAAU,CAAC,IAAA,GAAGC,SAAAA,UAAAA,CAAU,GAAG,CAAC;;CAGvD,aAAA,GAAYZ,SAAAA,OAAAA,CAAO,CAAC,CAAC,OAAA,GAAMW,SAAAA,UAAAA,CAAU,CAAC,IAAA,GAAGC,SAAAA,UAAAA,CAAU,GAAG,CAAC;;CAGvD,eAAA,GAAcZ,SAAAA,OAAAA,CAAO,CAAC,CAAC,OAAA,GAAMW,SAAAA,UAAAA,CAAU,CAAC,IAAA,GAAGC,SAAAA,UAAAA,CAAU,GAAG,CAAC;;CAGzD,WAAA,GAAUH,SAAAA,SAAAA,CAAS,aAAa;;;;;;CAOhC,cAAA,GAAaA,SAAAA,SAAAA,CAAS,aAAa;;;;;;CAOnC,sBAAA,GAAqBA,SAAAA,SAAAA,CAAS,aAAa;;;;;CAM3C,sBAAA,GAAqBA,SAAAA,SAAAA,CAAS,aAAa;;;;;CAM3C,uBAAA,GAAsBA,SAAAA,SAAAA,CAAS,aAAa;AAC9C,CAAC"}
1
+ {"version":3,"file":"index.cjs","names":["pipe","string","transform","array","record","union","number","boolean","_null","object","optional","trim","minLength","maxLength","regex","uuid","_enum","iso","toLowerCase","email","e164","toUpperCase","url"],"sources":["../../src/schema/index.ts"],"sourcesContent":["import {\n enum as _enum,\n null as _null,\n array,\n boolean,\n e164,\n email,\n iso,\n maxLength,\n minLength,\n number,\n object,\n optional,\n pipe,\n record,\n regex,\n string,\n toLowerCase,\n toUpperCase,\n transform,\n trim,\n union,\n url,\n uuid,\n type z,\n} from 'zod/mini';\nimport type { Environment, Platform } from '../track/types';\n\nconst MAX_KEY_LENGTH = 128;\nconst MAX_VALUE_LENGTH = 512;\nconst MAX_PROPERTIES = 64;\n\n/**\n * Truncated rather than rejected. These schemas validate a whole batch at once, so refusing one\n * oversized value costs every event that traveled with it — and the values that overrun are the\n * ones derived from the page (a link's text, a URL carrying a long query), which no client can\n * bound in advance. A shortened value is worth more than a lost batch.\n */\nconst propertyText = pipe(\n string(),\n transform((value) => value.slice(0, MAX_VALUE_LENGTH))\n);\n\n/**\n * Tags are truncated for the same reason property values are, and they are stored more than once\n * (on the event, the session and the visitor), so an unbounded one costs several times over.\n * 1024 sits just above what GA4 itself keeps (1000 characters of page_location, 420 of\n * page_referrer, 300 of page_title). Real tags stay under ~500 characters; the rare longer ones\n * are page_referrer values from search and ad redirect URLs, where the kept prefix — host and\n * path — is the part that matters.\n */\nconst MAX_TAG_LENGTH = 1024;\n\nconst tagText = pipe(\n string(),\n transform((value) => value.slice(0, MAX_TAG_LENGTH))\n);\n\n/**\n * Keys are written by hand in instrumentation code, so an unusable one is a mistake in the host\n * rather than something the visitor typed. It is still dropped rather than rejected, for the same\n * reason: the mistake should cost that property, not the batch it happens to be in. Truncating a\n * key is not an option — two long keys would silently become one field.\n *\n * The key schema below is deliberately permissive so that this transform is reached at all; the\n * trimming it used to do happens here instead. `MAX_PROPERTIES` keeps the first N in insertion\n * order.\n */\nfunction takeProperties<T>(data: Record<string, T>): Record<string, T> {\n const result: Record<string, T> = {};\n let count = 0;\n for (const [rawKey, value] of Object.entries(data)) {\n if (count >= MAX_PROPERTIES) break;\n const key = rawKey.trim();\n if (!key || key.length > MAX_KEY_LENGTH) continue;\n result[key] = value;\n count++;\n }\n return result;\n}\n\n/**\n * Capped at GA4's own item-list limit, and truncated rather than rejected like every other\n * property limit here: an unbounded array is the one field a caller could still blow a batch\n * up with after the value and key limits.\n */\nconst MAX_ITEMS = 200;\n\nconst items = pipe(\n array(\n pipe(\n record(string(), union([propertyText, number(), boolean(), _null()])),\n transform(takeProperties)\n )\n ),\n transform((list) => list.slice(0, MAX_ITEMS))\n);\n\nexport const ALL_PLATFORMS = [\n 'ios',\n 'android',\n 'web',\n 'macos',\n 'windows',\n 'linux',\n 'unknown',\n] as const satisfies Platform[];\n\nexport const ALL_ENVIRONMENTS = ['development', 'production'] as const satisfies Environment[];\n\nexport const tagsSchema = object({\n os: optional(tagText),\n os_name: optional(tagText),\n os_version: optional(tagText),\n browser: optional(tagText),\n browser_name: optional(tagText),\n browser_version: optional(tagText),\n device: optional(tagText),\n device_id: optional(string().check(trim(), minLength(1), maxLength(36))),\n device_type: optional(tagText),\n device_vendor: optional(tagText),\n device_pixel_ratio: optional(number()),\n screen_width: optional(number()),\n screen_height: optional(number()),\n screen_resolution: optional(\n pipe(\n string().check(regex(/^\\d+x\\d+$/)),\n transform((v) => v as `${number}x${number}`)\n )\n ),\n webdriver: optional(boolean()),\n release: optional(tagText),\n language: optional(tagText),\n time_zone: optional(tagText),\n page_location: optional(tagText),\n page_referrer: optional(tagText),\n page_title: optional(tagText),\n page_load_id: optional(tagText),\n /**\n * @deprecated Renamed to `page_location` in 7.0.0. Accepted so that events from clients\n * still on an older SDK are not stripped of their page URL at this boundary — a browser\n * bundle stays cached long after a backend deploys. Remove once those clients are gone;\n * `pageLocation` in `server/page-location.ts` is the only reader.\n */\n // oxlint-disable-next-line typescript/no-deprecated -- Legacy input from pre-7.0 clients must survive validation.\n source_url: optional(tagText),\n // app info\n advertising_id: optional(tagText),\n install_referrer: optional(tagText),\n // Ad click ids (URL parameters) and ad platform cookies (underscore names); see AdvertisingInfo.\n // Meta Ads\n fbclid: optional(tagText),\n ad_id: optional(tagText),\n ad_name: optional(tagText),\n adset_id: optional(tagText),\n adset_name: optional(tagText),\n campaign_id: optional(tagText),\n campaign_name: optional(tagText),\n placement: optional(tagText),\n _fbc: optional(tagText),\n _fbp: optional(tagText),\n /**\n * @deprecated `fbc` / `fbp` / `rdt_uuid` were renamed to `_fbc` / `_fbp` / `_rdt_uuid` in 9.0.0.\n * Accepted so that conversions from clients still on an older SDK keep their match keys; the\n * senders read them only as a fallback (`server/click-ids.ts`). Remove once those clients are\n * gone.\n */\n // oxlint-disable-next-line typescript/no-deprecated -- Legacy pre-9.0 click-id fields must survive validation.\n fbc: optional(tagText),\n fbp: optional(tagText),\n rdt_uuid: optional(tagText),\n // Google Ads\n gclid: optional(tagText),\n gclsrc: optional(tagText),\n gad_source: optional(tagText),\n gad_campaignid: optional(tagText),\n network: optional(tagText),\n match_type: optional(tagText),\n wbraid: optional(tagText),\n gbraid: optional(tagText),\n dclid: optional(tagText),\n _gcl_aw: optional(tagText),\n _gcl_gb: optional(tagText),\n // Microsoft Ads\n msclkid: optional(tagText),\n _uetmsclkid: optional(tagText),\n // Reddit Ads\n rdt_cid: optional(tagText),\n _rdt_cid: optional(tagText),\n _rdt_uuid: optional(tagText),\n // LinkedIn Ads\n li_fat_id: optional(tagText),\n _li_fat_id: optional(tagText),\n // OpenAI Ads\n oppref: optional(tagText),\n __oppref: optional(tagText),\n __obref: optional(tagText),\n // other click ids\n ko_click_id: optional(tagText),\n ScCid: optional(tagText),\n ttclid: optional(tagText),\n twclid: optional(tagText),\n yclid: optional(tagText),\n epik: optional(tagText),\n // utm params\n utm_source: optional(tagText),\n utm_medium: optional(tagText),\n utm_campaign: optional(tagText),\n utm_term: optional(tagText),\n utm_content: optional(tagText),\n utm_id: optional(tagText),\n utm_source_platform: optional(tagText),\n utm_creative_format: optional(tagText),\n utm_marketing_tactic: optional(tagText),\n});\n\nexport const propertiesSchema = optional(\n pipe(\n record(string(), union([propertyText, number(), boolean(), _null(), items])),\n transform(takeProperties)\n )\n);\n\n/**\n * How far an event's time may be from the server's before the client clock it was stamped with is\n * taken as wrong. A batch legitimately arrives late — a tab frozen in the background, a\n * session_start held back after a failed batch — by hours, not days; a phone set to another year\n * writes its sessions into that year.\n */\nconst MAX_CLOCK_SKEW = 24 * 60 * 60 * 1000;\n\n/**\n * Puts the events stamped by a wrong client clock onto the server's, where they are parsed. Only\n * the events outside `MAX_CLOCK_SKEW` move, so one bad event cannot drag the rest of its batch\n * along: they move together by their own latest one — the wrong clock at sending — keeping their\n * order and spacing, and one still out after that (a batch mixing two wrong clocks) is on no clock\n * at all and takes the server's time. Corrected rather than rejected, for the same reason values\n * are truncated: a wrong clock should cost the event its time, not the batch its events.\n */\nfunction alignClock<T extends { timestamp: string }>(events: T[], now = Date.now()): T[] {\n const within = (time: number) => Math.abs(now - time) <= MAX_CLOCK_SKEW;\n const times = events.map((event) => Date.parse(event.timestamp));\n const wrong = times.filter((time) => !within(time));\n if (wrong.length === 0) return events;\n const offset = now - Math.max(...wrong);\n return events.map((event, i) => {\n if (within(times[i])) return event;\n const shifted = times[i] + offset;\n return { ...event, timestamp: new Date(within(shifted) ? shifted : now).toISOString() };\n });\n}\n\nexport const createTrackEventSchema = pipe(\n array(\n object({\n /**\n * The event's id, generated by the client when the event was tracked (12.1) and given to\n * the browser pixels as their deduplication id. Store the event under it with\n * `on conflict (id) do nothing`: a batch retried after the server committed it then\n * stores nothing twice. Optional for clients before 12.1, which send none — generate one\n * on the server for those.\n */\n id: optional(uuid({ version: 'v7' })),\n name: string().check(trim(), minLength(1), maxLength(64)),\n // Generated by the SDK, like `id` (`visitorId()`, `Session`): uuidv7 as well, so the\n // constraint is checked here once and the server need not check it again.\n visitor_id: uuid({ version: 'v7' }),\n session_id: uuid({ version: 'v7' }),\n platform: _enum(ALL_PLATFORMS),\n environment: _enum(ALL_ENVIRONMENTS),\n timestamp: iso.datetime(),\n tags: tagsSchema,\n properties: propertiesSchema,\n })\n ).check(minLength(1), maxLength(100)),\n transform((events) => alignClock(events))\n);\n\n/**\n * `POST /visitors`, what clients before 11.0 create their visitor with; 11.0 generates the id\n * itself and the server creates the visitor from its first events (README, \"Visitors\").\n * Kept for servers that still serve older clients.\n */\nexport const createVisitorSchema = object({\n device_id: string().check(trim(), minLength(1), maxLength(36)),\n platform: _enum(ALL_PLATFORMS),\n environment: _enum(ALL_ENVIRONMENTS),\n tags: tagsSchema,\n});\n\nconst emailValue = pipe(string().check(trim(), toLowerCase(), maxLength(320)), email());\n\n/** E.164: a plus sign (+) prefix, country code, then digits only, no dashes/parens/spaces. */\nconst phoneValue = pipe(string().check(trim()), e164());\n\nconst addressValue = object({\n first_name: optional(string().check(trim(), maxLength(128))),\n last_name: optional(string().check(trim(), maxLength(128))),\n street: optional(string().check(trim(), maxLength(256))),\n city: optional(string().check(trim(), maxLength(128))),\n /** User province, state, or region. Example: `Hampshire` */\n region: optional(string().check(trim(), maxLength(128))),\n postal_code: optional(string().check(trim(), maxLength(32))),\n /** 2-letter country code, per the ISO 3166-1 alpha-2 standard. Example: `UK` */\n country: optional(string().check(trim(), toUpperCase(), regex(/^[A-Z]{2}$/))),\n});\n\n/**\n * User-provided data (UPD) used for enhanced conversions, Customer Match, and demographics.\n * Values are sent unhashed; Google normalizes and hashes them before they reach its servers.\n *\n * Multiple values may be sent to increase the match rate: up to 3 emails, 3 phone numbers, and\n * 2 addresses.\n *\n * @see https://support.google.com/analytics/answer/14078702\n * @see https://support.google.com/google-ads/answer/13258081\n */\nexport const userProvidedDataSchema = object({\n email: optional(union([emailValue, array(emailValue).check(minLength(1), maxLength(3))])),\n phone_number: optional(union([phoneValue, array(phoneValue).check(minLength(1), maxLength(3))])),\n address: optional(union([addressValue, array(addressValue).check(minLength(1), maxLength(2))])),\n});\n\nexport const updateVisitorSchema = object({\n user_id: optional(uuid()),\n user_data: optional(userProvidedDataSchema),\n /**\n * Sent by clients before 11.1, which PATCHed their tags on every page load. From 11.1 the\n * server refreshes `visitor.tags` from each `session_start` — the moment the visit arrives —\n * and `setVisitor` sends none: at sign-in the page is no longer where the visit came in.\n */\n tags: optional(tagsSchema),\n});\n\nexport const createFeedbackSchema = object({\n name: string().check(minLength(1), maxLength(256)),\n // Trimmed and lower-cased like every other email the SDK accepts, so a host stores the\n // normalized form without wrapping the schema.\n email: emailValue,\n message: string().check(minLength(1), maxLength(65536)),\n /**\n * The Cloudflare Turnstile token the host verifies before storing the feedback (the same field\n * `@shware/security`'s email-code request carries). Required: without it `POST /feedback` is an\n * open free-text write that only a rate limit protects. Single-use: Turnstile spends the token\n * at verification, so the caller resets the widget after every submit, success or failure.\n */\n turnstileToken: string().check(minLength(1), maxLength(2048)),\n});\n\nconst noEmptyString = pipe(\n string().check(maxLength(256)),\n transform((v) => (v ? v : undefined))\n);\n\n/**\n * The schema for creating a link.\n * @see https://support.google.com/analytics/answer/10917952\n * */\nexport const createLinkSchema = object({\n /** The URL that the user is redirected to. */\n url: url().check(minLength(1), maxLength(1024)), // required\n\n /**\n * Campaign ID. Used to identify a specific campaign or promotion. This is a required key for GA4\n * data import. Use the same IDs that you use when uploading campaign cost data.\n */\n utm_id: optional(noEmptyString),\n\n /** Referrer, for example: google, newsletter4, billboard */\n utm_source: string().check(minLength(1), maxLength(256)), // required\n\n /** Marketing medium, for example: cpc, banner, email */\n utm_medium: string().check(minLength(1), maxLength(256)), // required\n\n /** Product, slogan, promo code, for example, spring_sale */\n utm_campaign: string().check(minLength(1), maxLength(256)), // required\n\n /** Paid keyword */\n utm_term: optional(noEmptyString),\n\n /**\n * Use to differentiate creatives. For example, if you have two call-to-action links within the\n * same email message, you can use utm_content and set different values for each so you can tell\n * which version is more effective.\n */\n utm_content: optional(noEmptyString),\n\n /**\n * The platform responsible for directing traffic to a given Analytics property (such as a buying\n * platform that sets budgets and targeting criteria or a platform that manages organic traffic\n * data). For example, Search Ads 360 or Display & Video 360.\n */\n utm_source_platform: optional(noEmptyString),\n\n /**\n * Type of creative, for example, display, native, video, search, utm_creative_format is not\n * currently reported in Google Analytics 4 properties.\n */\n utm_creative_format: optional(noEmptyString),\n\n /**\n * Targeting criteria applied to a campaign, for example, remarketing, prospecting,\n * utm_marketing_tactic is not currently reported in Google Analytics 4 properties.\n * */\n utm_marketing_tactic: optional(noEmptyString),\n});\n\nexport type CreateTrackEventDTO = z.output<typeof createTrackEventSchema>;\nexport type CreateFeedbackDTO = z.output<typeof createFeedbackSchema>;\nexport type CreateLinkDTO = z.output<typeof createLinkSchema>;\nexport type CreateVisitorDTO = z.output<typeof createVisitorSchema>;\nexport type UserProvidedDataDTO = z.output<typeof userProvidedDataSchema>;\nexport type UpdateVisitorDTO = z.output<typeof updateVisitorSchema>;\n"],"mappings":";;;AA4BA,MAAM,iBAAiB;AACvB,MAAM,mBAAmB;AACzB,MAAM,iBAAiB;;;;;;;AAQvB,MAAM,gBAAA,GAAeA,SAAAA,KAAAA,EAAAA,GACnBC,SAAAA,OAAAA,CAAO,IAAA,GACPC,SAAAA,UAAAA,EAAW,UAAU,MAAM,MAAM,GAAG,gBAAgB,CAAC,CACvD;;;;;;;;;AAUA,MAAM,iBAAiB;AAEvB,MAAM,WAAA,GAAUF,SAAAA,KAAAA,EAAAA,GACdC,SAAAA,OAAAA,CAAO,IAAA,GACPC,SAAAA,UAAAA,EAAW,UAAU,MAAM,MAAM,GAAG,cAAc,CAAC,CACrD;;;;;;;;;;;AAYA,SAAS,eAAkB,MAA4C;CACrE,MAAM,SAA4B,CAAC;CACnC,IAAI,QAAQ;CACZ,KAAK,MAAM,CAAC,QAAQ,UAAU,OAAO,QAAQ,IAAI,GAAG;EAClD,IAAI,SAAS,gBAAgB;EAC7B,MAAM,MAAM,OAAO,KAAK;EACxB,IAAI,CAAC,OAAO,IAAI,SAAS,gBAAgB;EACzC,OAAO,OAAO;EACd;CACF;CACA,OAAO;AACT;;;;;;AAOA,MAAM,YAAY;AAElB,MAAM,SAAA,GAAQF,SAAAA,KAAAA,EAAAA,GACZG,SAAAA,MAAAA,EAAAA,GACEH,SAAAA,KAAAA,EAAAA,GACEI,SAAAA,OAAAA,EAAAA,GAAOH,SAAAA,OAAAA,CAAO,IAAA,GAAGI,SAAAA,MAAAA,CAAM;CAAC;EAAcC,GAAAA,SAAAA,OAAAA,CAAO;EAAGC,GAAAA,SAAAA,QAAAA,CAAQ;EAAGC,GAAAA,SAAAA,KAAAA,CAAM;AAAC,CAAC,CAAC,IAAA,GACpEN,SAAAA,UAAAA,CAA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AQH,SAAAA,SAAAA,CAAS,aAAa;;CAG9B,aAAA,GAAYT,SAAAA,OAAAA,CAAO,CAAC,CAAC,OAAA,GAAMW,SAAAA,UAAAA,CAAU,CAAC,IAAA,GAAGC,SAAAA,UAAAA,CAAU,GAAG,CAAC;;CAGvD,aAAA,GAAYZ,SAAAA,OAAAA,CAAO,CAAC,CAAC,OAAA,GAAMW,SAAAA,UAAAA,CAAU,CAAC,IAAA,GAAGC,SAAAA,UAAAA,CAAU,GAAG,CAAC;;CAGvD,eAAA,GAAcZ,SAAAA,OAAAA,CAAO,CAAC,CAAC,OAAA,GAAMW,SAAAA,UAAAA,CAAU,CAAC,IAAA,GAAGC,SAAAA,UAAAA,CAAU,GAAG,CAAC;;CAGzD,WAAA,GAAUH,SAAAA,SAAAA,CAAS,aAAa;;;;;;CAOhC,cAAA,GAAaA,SAAAA,SAAAA,CAAS,aAAa;;;;;;CAOnC,sBAAA,GAAqBA,SAAAA,SAAAA,CAAS,aAAa;;;;;CAM3C,sBAAA,GAAqBA,SAAAA,SAAAA,CAAS,aAAa;;;;;CAM3C,uBAAA,GAAsBA,SAAAA,SAAAA,CAAS,aAAa;AAC9C,CAAC"}
@@ -1,5 +1,4 @@
1
1
  import { iso, z } from "zod/mini";
2
- //#region src/schema/index.d.ts
3
2
  export declare const ALL_PLATFORMS: ["ios", "android", "web", "macos", "windows", "linux", "unknown"];
4
3
  export declare const ALL_ENVIRONMENTS: ["development", "production"];
5
4
  export declare const tagsSchema: z.ZodMiniObject<{
@@ -578,6 +577,7 @@ export declare const createFeedbackSchema: z.ZodMiniObject<{
578
577
  name: z.ZodMiniString<string>;
579
578
  email: z.ZodMiniPipe<z.ZodMiniString<string>, z.ZodMiniEmail>;
580
579
  message: z.ZodMiniString<string>;
580
+ turnstileToken: z.ZodMiniString<string>;
581
581
  }, z.core.$strip>;
582
582
  /**
583
583
  * The schema for creating a link.
@@ -601,5 +601,4 @@ export type CreateLinkDTO = z.output<typeof createLinkSchema>;
601
601
  export type CreateVisitorDTO = z.output<typeof createVisitorSchema>;
602
602
  export type UserProvidedDataDTO = z.output<typeof userProvidedDataSchema>;
603
603
  export type UpdateVisitorDTO = z.output<typeof updateVisitorSchema>;
604
- //#endregion
605
604
  //# sourceMappingURL=index.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.cts","names":[],"sources":["../../src/schema/index.ts"],"mappings":";;qBAkGa;qBAUA;qBAEA,YAAU,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwGrB,EAAA,KAAA;qBAEW,kBAAgB,EAAA,gBAAA,EAAA,YAAA,EAAA,cAAA,EAAA,uBAAA,EAAA,uBAAA,EAAA,YAAA,EAAA,uBAAA,EAAA,mCAAA,EAAA,uBAAA,EAAA,yBAAA,EAAA,aAAA,EAAA,YAAA,EAAA,aAAA,EAAA,YAAA,EAAA,cAAA,EAAA,uBAAA,EAAA,uBAAA,EAAA,YAAA,EAAA,uBAAA,EAAA,mCAAA,EAAA,uBAAA,EAAA,yBAAA,EAAA,gBAAA,EAAA,iBAAA,kDAAA,qDAAA,EAAA,iBAAA,oDAAA,yDAAA,EAAA,iBAAA,2CAAA,4DAAA,2CAAA;qBAoChB,wBAAsB,EAAA,YAAA,EAAA,aAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBA+BtB,qBAAmB,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBA+BtB,qBAAmB,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAK9B,EAAA,KAAA;;;;;;;;;;;qBA6BW,wBAAsB,EAAA;;;;;;;;;;;;;;;;;;;;GAIjC,EAAA,KAAA;qBAEW,qBAAmB,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAS9B,EAAA,KAAA;qBAEW,sBAAoB,EAAA;;;;;GAa/B,EAAA,KAAA;;;;;qBAWW,kBAAgB,EAAA;;;;;;;;;;;GA+C3B,EAAA,KAAA;YAEU,sBAAsB,EAAE,cAAc;YACtC,oBAAoB,EAAE,cAAc;YACpC,gBAAgB,EAAE,cAAc;YAChC,mBAAmB,EAAE,cAAc;YACnC,sBAAsB,EAAE,cAAc;YACtC,mBAAmB,EAAE,cAAc"}
@@ -1,5 +1,4 @@
1
1
  import { iso, z } from "zod/mini";
2
- //#region src/schema/index.d.ts
3
2
  export declare const ALL_PLATFORMS: ["ios", "android", "web", "macos", "windows", "linux", "unknown"];
4
3
  export declare const ALL_ENVIRONMENTS: ["development", "production"];
5
4
  export declare const tagsSchema: z.ZodMiniObject<{
@@ -578,6 +577,7 @@ export declare const createFeedbackSchema: z.ZodMiniObject<{
578
577
  name: z.ZodMiniString<string>;
579
578
  email: z.ZodMiniPipe<z.ZodMiniString<string>, z.ZodMiniEmail>;
580
579
  message: z.ZodMiniString<string>;
580
+ turnstileToken: z.ZodMiniString<string>;
581
581
  }, z.core.$strip>;
582
582
  /**
583
583
  * The schema for creating a link.
@@ -601,5 +601,4 @@ export type CreateLinkDTO = z.output<typeof createLinkSchema>;
601
601
  export type CreateVisitorDTO = z.output<typeof createVisitorSchema>;
602
602
  export type UserProvidedDataDTO = z.output<typeof userProvidedDataSchema>;
603
603
  export type UpdateVisitorDTO = z.output<typeof updateVisitorSchema>;
604
- //#endregion
605
604
  //# sourceMappingURL=index.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","names":[],"sources":["../../src/schema/index.ts"],"mappings":";;qBAkGa;qBAUA;qBAEA,YAAU,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwGrB,EAAA,KAAA;qBAEW,kBAAgB,EAAA,gBAAA,EAAA,YAAA,EAAA,cAAA,EAAA,uBAAA,EAAA,uBAAA,EAAA,YAAA,EAAA,uBAAA,EAAA,mCAAA,EAAA,uBAAA,EAAA,yBAAA,EAAA,aAAA,EAAA,YAAA,EAAA,aAAA,EAAA,YAAA,EAAA,cAAA,EAAA,uBAAA,EAAA,uBAAA,EAAA,YAAA,EAAA,uBAAA,EAAA,mCAAA,EAAA,uBAAA,EAAA,yBAAA,EAAA,gBAAA,EAAA,iBAAA,kDAAA,qDAAA,EAAA,iBAAA,oDAAA,yDAAA,EAAA,iBAAA,2CAAA,4DAAA,2CAAA;qBAoChB,wBAAsB,EAAA,YAAA,EAAA,aAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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 +1,5 @@
1
1
  import { array, boolean, e164, email, enum as enum$1, iso, maxLength, minLength, null as null$1, number, object, optional, pipe, record, regex, string, toLowerCase, toUpperCase, transform, trim, union, url, uuid } from "zod/mini";
2
- //#region src/schema/index.ts
2
+ // src/schema/index.ts
3
3
  const MAX_KEY_LENGTH = 128;
4
4
  const MAX_VALUE_LENGTH = 512;
5
5
  const MAX_PROPERTIES = 64;
@@ -260,7 +260,14 @@ const updateVisitorSchema = object({
260
260
  const createFeedbackSchema = object({
261
261
  name: string().check(minLength(1), maxLength(256)),
262
262
  email: emailValue,
263
- message: string().check(minLength(1), maxLength(65536))
263
+ message: string().check(minLength(1), maxLength(65536)),
264
+ /**
265
+ * The Cloudflare Turnstile token the host verifies before storing the feedback (the same field
266
+ * `@shware/security`'s email-code request carries). Required: without it `POST /feedback` is an
267
+ * open free-text write that only a rate limit protects. Single-use: Turnstile spends the token
268
+ * at verification, so the caller resets the widget after every submit, success or failure.
269
+ */
270
+ turnstileToken: string().check(minLength(1), maxLength(2048))
264
271
  });
265
272
  const noEmptyString = pipe(string().check(maxLength(256)), transform((v) => v ? v : void 0));
266
273
  /**
@@ -306,7 +313,6 @@ const createLinkSchema = object({
306
313
  * */
307
314
  utm_marketing_tactic: optional(noEmptyString)
308
315
  });
309
- //#endregion
310
316
  export { ALL_ENVIRONMENTS, ALL_PLATFORMS, createFeedbackSchema, createLinkSchema, createTrackEventSchema, createVisitorSchema, propertiesSchema, tagsSchema, updateVisitorSchema, userProvidedDataSchema };
311
317
 
312
318
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":["_null","_enum"],"sources":["../../src/schema/index.ts"],"sourcesContent":["import {\n enum as _enum,\n null as _null,\n array,\n boolean,\n e164,\n email,\n iso,\n maxLength,\n minLength,\n number,\n object,\n optional,\n pipe,\n record,\n regex,\n string,\n toLowerCase,\n toUpperCase,\n transform,\n trim,\n union,\n url,\n uuid,\n type z,\n} from 'zod/mini';\nimport type { Environment, Platform } from '../track/types';\n\nconst MAX_KEY_LENGTH = 128;\nconst MAX_VALUE_LENGTH = 512;\nconst MAX_PROPERTIES = 64;\n\n/**\n * Truncated rather than rejected. These schemas validate a whole batch at once, so refusing one\n * oversized value costs every event that traveled with it — and the values that overrun are the\n * ones derived from the page (a link's text, a URL carrying a long query), which no client can\n * bound in advance. A shortened value is worth more than a lost batch.\n */\nconst propertyText = pipe(\n string(),\n transform((value) => value.slice(0, MAX_VALUE_LENGTH))\n);\n\n/**\n * Tags are truncated for the same reason property values are, and they are stored more than once\n * (on the event, the session and the visitor), so an unbounded one costs several times over.\n * 1024 sits just above what GA4 itself keeps (1000 characters of page_location, 420 of\n * page_referrer, 300 of page_title). Real tags stay under ~500 characters; the rare longer ones\n * are page_referrer values from search and ad redirect URLs, where the kept prefix — host and\n * path — is the part that matters.\n */\nconst MAX_TAG_LENGTH = 1024;\n\nconst tagText = pipe(\n string(),\n transform((value) => value.slice(0, MAX_TAG_LENGTH))\n);\n\n/**\n * Keys are written by hand in instrumentation code, so an unusable one is a mistake in the host\n * rather than something the visitor typed. It is still dropped rather than rejected, for the same\n * reason: the mistake should cost that property, not the batch it happens to be in. Truncating a\n * key is not an option — two long keys would silently become one field.\n *\n * The key schema below is deliberately permissive so that this transform is reached at all; the\n * trimming it used to do happens here instead. `MAX_PROPERTIES` keeps the first N in insertion\n * order.\n */\nfunction takeProperties<T>(data: Record<string, T>): Record<string, T> {\n const result: Record<string, T> = {};\n let count = 0;\n for (const [rawKey, value] of Object.entries(data)) {\n if (count >= MAX_PROPERTIES) break;\n const key = rawKey.trim();\n if (!key || key.length > MAX_KEY_LENGTH) continue;\n result[key] = value;\n count++;\n }\n return result;\n}\n\n/**\n * Capped at GA4's own item-list limit, and truncated rather than rejected like every other\n * property limit here: an unbounded array is the one field a caller could still blow a batch\n * up with after the value and key limits.\n */\nconst MAX_ITEMS = 200;\n\nconst items = pipe(\n array(\n pipe(\n record(string(), union([propertyText, number(), boolean(), _null()])),\n transform(takeProperties)\n )\n ),\n transform((list) => list.slice(0, MAX_ITEMS))\n);\n\nexport const ALL_PLATFORMS = [\n 'ios',\n 'android',\n 'web',\n 'macos',\n 'windows',\n 'linux',\n 'unknown',\n] as const satisfies Platform[];\n\nexport const ALL_ENVIRONMENTS = ['development', 'production'] as const satisfies Environment[];\n\nexport const tagsSchema = object({\n os: optional(tagText),\n os_name: optional(tagText),\n os_version: optional(tagText),\n browser: optional(tagText),\n browser_name: optional(tagText),\n browser_version: optional(tagText),\n device: optional(tagText),\n device_id: optional(string().check(trim(), minLength(1), maxLength(36))),\n device_type: optional(tagText),\n device_vendor: optional(tagText),\n device_pixel_ratio: optional(number()),\n screen_width: optional(number()),\n screen_height: optional(number()),\n screen_resolution: optional(\n pipe(\n string().check(regex(/^\\d+x\\d+$/)),\n transform((v) => v as `${number}x${number}`)\n )\n ),\n webdriver: optional(boolean()),\n release: optional(tagText),\n language: optional(tagText),\n time_zone: optional(tagText),\n page_location: optional(tagText),\n page_referrer: optional(tagText),\n page_title: optional(tagText),\n page_load_id: optional(tagText),\n /**\n * @deprecated Renamed to `page_location` in 7.0.0. Accepted so that events from clients\n * still on an older SDK are not stripped of their page URL at this boundary — a browser\n * bundle stays cached long after a backend deploys. Remove once those clients are gone;\n * `pageLocation` in `server/page-location.ts` is the only reader.\n */\n // oxlint-disable-next-line typescript/no-deprecated -- Legacy input from pre-7.0 clients must survive validation.\n source_url: optional(tagText),\n // app info\n advertising_id: optional(tagText),\n install_referrer: optional(tagText),\n // Ad click ids (URL parameters) and ad platform cookies (underscore names); see AdvertisingInfo.\n // Meta Ads\n fbclid: optional(tagText),\n ad_id: optional(tagText),\n ad_name: optional(tagText),\n adset_id: optional(tagText),\n adset_name: optional(tagText),\n campaign_id: optional(tagText),\n campaign_name: optional(tagText),\n placement: optional(tagText),\n _fbc: optional(tagText),\n _fbp: optional(tagText),\n /**\n * @deprecated `fbc` / `fbp` / `rdt_uuid` were renamed to `_fbc` / `_fbp` / `_rdt_uuid` in 9.0.0.\n * Accepted so that conversions from clients still on an older SDK keep their match keys; the\n * senders read them only as a fallback (`server/click-ids.ts`). Remove once those clients are\n * gone.\n */\n // oxlint-disable-next-line typescript/no-deprecated -- Legacy pre-9.0 click-id fields must survive validation.\n fbc: optional(tagText),\n fbp: optional(tagText),\n rdt_uuid: optional(tagText),\n // Google Ads\n gclid: optional(tagText),\n gclsrc: optional(tagText),\n gad_source: optional(tagText),\n gad_campaignid: optional(tagText),\n network: optional(tagText),\n match_type: optional(tagText),\n wbraid: optional(tagText),\n gbraid: optional(tagText),\n dclid: optional(tagText),\n _gcl_aw: optional(tagText),\n _gcl_gb: optional(tagText),\n // Microsoft Ads\n msclkid: optional(tagText),\n _uetmsclkid: optional(tagText),\n // Reddit Ads\n rdt_cid: optional(tagText),\n _rdt_cid: optional(tagText),\n _rdt_uuid: optional(tagText),\n // LinkedIn Ads\n li_fat_id: optional(tagText),\n _li_fat_id: optional(tagText),\n // OpenAI Ads\n oppref: optional(tagText),\n __oppref: optional(tagText),\n __obref: optional(tagText),\n // other click ids\n ko_click_id: optional(tagText),\n ScCid: optional(tagText),\n ttclid: optional(tagText),\n twclid: optional(tagText),\n yclid: optional(tagText),\n epik: optional(tagText),\n // utm params\n utm_source: optional(tagText),\n utm_medium: optional(tagText),\n utm_campaign: optional(tagText),\n utm_term: optional(tagText),\n utm_content: optional(tagText),\n utm_id: optional(tagText),\n utm_source_platform: optional(tagText),\n utm_creative_format: optional(tagText),\n utm_marketing_tactic: optional(tagText),\n});\n\nexport const propertiesSchema = optional(\n pipe(\n record(string(), union([propertyText, number(), boolean(), _null(), items])),\n transform(takeProperties)\n )\n);\n\n/**\n * How far an event's time may be from the server's before the client clock it was stamped with is\n * taken as wrong. A batch legitimately arrives late — a tab frozen in the background, a\n * session_start held back after a failed batch — by hours, not days; a phone set to another year\n * writes its sessions into that year.\n */\nconst MAX_CLOCK_SKEW = 24 * 60 * 60 * 1000;\n\n/**\n * Puts the events stamped by a wrong client clock onto the server's, where they are parsed. Only\n * the events outside `MAX_CLOCK_SKEW` move, so one bad event cannot drag the rest of its batch\n * along: they move together by their own latest one — the wrong clock at sending — keeping their\n * order and spacing, and one still out after that (a batch mixing two wrong clocks) is on no clock\n * at all and takes the server's time. Corrected rather than rejected, for the same reason values\n * are truncated: a wrong clock should cost the event its time, not the batch its events.\n */\nfunction alignClock<T extends { timestamp: string }>(events: T[], now = Date.now()): T[] {\n const within = (time: number) => Math.abs(now - time) <= MAX_CLOCK_SKEW;\n const times = events.map((event) => Date.parse(event.timestamp));\n const wrong = times.filter((time) => !within(time));\n if (wrong.length === 0) return events;\n const offset = now - Math.max(...wrong);\n return events.map((event, i) => {\n if (within(times[i])) return event;\n const shifted = times[i] + offset;\n return { ...event, timestamp: new Date(within(shifted) ? shifted : now).toISOString() };\n });\n}\n\nexport const createTrackEventSchema = pipe(\n array(\n object({\n /**\n * The event's id, generated by the client when the event was tracked (12.1) and given to\n * the browser pixels as their deduplication id. Store the event under it with\n * `on conflict (id) do nothing`: a batch retried after the server committed it then\n * stores nothing twice. Optional for clients before 12.1, which send none — generate one\n * on the server for those.\n */\n id: optional(uuid({ version: 'v7' })),\n name: string().check(trim(), minLength(1), maxLength(64)),\n // Generated by the SDK, like `id` (`visitorId()`, `Session`): uuidv7 as well, so the\n // constraint is checked here once and the server need not check it again.\n visitor_id: uuid({ version: 'v7' }),\n session_id: uuid({ version: 'v7' }),\n platform: _enum(ALL_PLATFORMS),\n environment: _enum(ALL_ENVIRONMENTS),\n timestamp: iso.datetime(),\n tags: tagsSchema,\n properties: propertiesSchema,\n })\n ).check(minLength(1), maxLength(100)),\n transform((events) => alignClock(events))\n);\n\n/**\n * `POST /visitors`, what clients before 11.0 create their visitor with; 11.0 generates the id\n * itself and the server creates the visitor from its first events (README, \"Visitors\").\n * Kept for servers that still serve older clients.\n */\nexport const createVisitorSchema = object({\n device_id: string().check(trim(), minLength(1), maxLength(36)),\n platform: _enum(ALL_PLATFORMS),\n environment: _enum(ALL_ENVIRONMENTS),\n tags: tagsSchema,\n});\n\nconst emailValue = pipe(string().check(trim(), toLowerCase(), maxLength(320)), email());\n\n/** E.164: a plus sign (+) prefix, country code, then digits only, no dashes/parens/spaces. */\nconst phoneValue = pipe(string().check(trim()), e164());\n\nconst addressValue = object({\n first_name: optional(string().check(trim(), maxLength(128))),\n last_name: optional(string().check(trim(), maxLength(128))),\n street: optional(string().check(trim(), maxLength(256))),\n city: optional(string().check(trim(), maxLength(128))),\n /** User province, state, or region. Example: `Hampshire` */\n region: optional(string().check(trim(), maxLength(128))),\n postal_code: optional(string().check(trim(), maxLength(32))),\n /** 2-letter country code, per the ISO 3166-1 alpha-2 standard. Example: `UK` */\n country: optional(string().check(trim(), toUpperCase(), regex(/^[A-Z]{2}$/))),\n});\n\n/**\n * User-provided data (UPD) used for enhanced conversions, Customer Match, and demographics.\n * Values are sent unhashed; Google normalizes and hashes them before they reach its servers.\n *\n * Multiple values may be sent to increase the match rate: up to 3 emails, 3 phone numbers, and\n * 2 addresses.\n *\n * @see https://support.google.com/analytics/answer/14078702\n * @see https://support.google.com/google-ads/answer/13258081\n */\nexport const userProvidedDataSchema = object({\n email: optional(union([emailValue, array(emailValue).check(minLength(1), maxLength(3))])),\n phone_number: optional(union([phoneValue, array(phoneValue).check(minLength(1), maxLength(3))])),\n address: optional(union([addressValue, array(addressValue).check(minLength(1), maxLength(2))])),\n});\n\nexport const updateVisitorSchema = object({\n user_id: optional(uuid()),\n user_data: optional(userProvidedDataSchema),\n /**\n * Sent by clients before 11.1, which PATCHed their tags on every page load. From 11.1 the\n * server refreshes `visitor.tags` from each `session_start` — the moment the visit arrives —\n * and `setVisitor` sends none: at sign-in the page is no longer where the visit came in.\n */\n tags: optional(tagsSchema),\n});\n\nexport const createFeedbackSchema = object({\n name: string().check(minLength(1), maxLength(256)),\n // Trimmed and lower-cased like every other email the SDK accepts, so a host stores the\n // normalized form without wrapping the schema.\n email: emailValue,\n message: string().check(minLength(1), maxLength(65536)),\n});\n\nconst noEmptyString = pipe(\n string().check(maxLength(256)),\n transform((v) => (v ? v : undefined))\n);\n\n/**\n * The schema for creating a link.\n * @see https://support.google.com/analytics/answer/10917952\n * */\nexport const createLinkSchema = object({\n /** The URL that the user is redirected to. */\n url: url().check(minLength(1), maxLength(1024)), // required\n\n /**\n * Campaign ID. Used to identify a specific campaign or promotion. This is a required key for GA4\n * data import. Use the same IDs that you use when uploading campaign cost data.\n */\n utm_id: optional(noEmptyString),\n\n /** Referrer, for example: google, newsletter4, billboard */\n utm_source: string().check(minLength(1), maxLength(256)), // required\n\n /** Marketing medium, for example: cpc, banner, email */\n utm_medium: string().check(minLength(1), maxLength(256)), // required\n\n /** Product, slogan, promo code, for example, spring_sale */\n utm_campaign: string().check(minLength(1), maxLength(256)), // required\n\n /** Paid keyword */\n utm_term: optional(noEmptyString),\n\n /**\n * Use to differentiate creatives. For example, if you have two call-to-action links within the\n * same email message, you can use utm_content and set different values for each so you can tell\n * which version is more effective.\n */\n utm_content: optional(noEmptyString),\n\n /**\n * The platform responsible for directing traffic to a given Analytics property (such as a buying\n * platform that sets budgets and targeting criteria or a platform that manages organic traffic\n * data). For example, Search Ads 360 or Display & Video 360.\n */\n utm_source_platform: optional(noEmptyString),\n\n /**\n * Type of creative, for example, display, native, video, search, utm_creative_format is not\n * currently reported in Google Analytics 4 properties.\n */\n utm_creative_format: optional(noEmptyString),\n\n /**\n * Targeting criteria applied to a campaign, for example, remarketing, prospecting,\n * utm_marketing_tactic is not currently reported in Google Analytics 4 properties.\n * */\n utm_marketing_tactic: optional(noEmptyString),\n});\n\nexport type CreateTrackEventDTO = z.output<typeof createTrackEventSchema>;\nexport type CreateFeedbackDTO = z.output<typeof createFeedbackSchema>;\nexport type CreateLinkDTO = z.output<typeof createLinkSchema>;\nexport type CreateVisitorDTO = z.output<typeof createVisitorSchema>;\nexport type UserProvidedDataDTO = z.output<typeof userProvidedDataSchema>;\nexport type UpdateVisitorDTO = z.output<typeof updateVisitorSchema>;\n"],"m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;;;;CAM9C,QAAQ,SAAS,aAAa;;CAG9B,YAAY,OAAO,CAAC,CAAC,MAAM,UAAU,CAAC,GAAG,UAAU,GAAG,CAAC;;CAGvD,YAAY,OAAO,CAAC,CAAC,MAAM,UAAU,CAAC,GAAG,UAAU,GAAG,CAAC;;CAGvD,cAAc,OAAO,CAAC,CAAC,MAAM,UAAU,CAAC,GAAG,UAAU,GAAG,CAAC;;CAGzD,UAAU,SAAS,aAAa;;;;;;CAOhC,aAAa,SAAS,aAAa;;;;;;CAOnC,qBAAqB,SAAS,aAAa;;;;;CAM3C,qBAAqB,SAAS,aAAa;;;;;CAM3C,sBAAsB,SAAS,aAAa;AAC9C,CAAC"}
1
+ {"version":3,"file":"index.mjs","names":["_null","_enum"],"sources":["../../src/schema/index.ts"],"sourcesContent":["import {\n enum as _enum,\n null as _null,\n array,\n boolean,\n e164,\n email,\n iso,\n maxLength,\n minLength,\n number,\n object,\n optional,\n pipe,\n record,\n regex,\n string,\n toLowerCase,\n toUpperCase,\n transform,\n trim,\n union,\n url,\n uuid,\n type z,\n} from 'zod/mini';\nimport type { Environment, Platform } from '../track/types';\n\nconst MAX_KEY_LENGTH = 128;\nconst MAX_VALUE_LENGTH = 512;\nconst MAX_PROPERTIES = 64;\n\n/**\n * Truncated rather than rejected. These schemas validate a whole batch at once, so refusing one\n * oversized value costs every event that traveled with it — and the values that overrun are the\n * ones derived from the page (a link's text, a URL carrying a long query), which no client can\n * bound in advance. A shortened value is worth more than a lost batch.\n */\nconst propertyText = pipe(\n string(),\n transform((value) => value.slice(0, MAX_VALUE_LENGTH))\n);\n\n/**\n * Tags are truncated for the same reason property values are, and they are stored more than once\n * (on the event, the session and the visitor), so an unbounded one costs several times over.\n * 1024 sits just above what GA4 itself keeps (1000 characters of page_location, 420 of\n * page_referrer, 300 of page_title). Real tags stay under ~500 characters; the rare longer ones\n * are page_referrer values from search and ad redirect URLs, where the kept prefix — host and\n * path — is the part that matters.\n */\nconst MAX_TAG_LENGTH = 1024;\n\nconst tagText = pipe(\n string(),\n transform((value) => value.slice(0, MAX_TAG_LENGTH))\n);\n\n/**\n * Keys are written by hand in instrumentation code, so an unusable one is a mistake in the host\n * rather than something the visitor typed. It is still dropped rather than rejected, for the same\n * reason: the mistake should cost that property, not the batch it happens to be in. Truncating a\n * key is not an option — two long keys would silently become one field.\n *\n * The key schema below is deliberately permissive so that this transform is reached at all; the\n * trimming it used to do happens here instead. `MAX_PROPERTIES` keeps the first N in insertion\n * order.\n */\nfunction takeProperties<T>(data: Record<string, T>): Record<string, T> {\n const result: Record<string, T> = {};\n let count = 0;\n for (const [rawKey, value] of Object.entries(data)) {\n if (count >= MAX_PROPERTIES) break;\n const key = rawKey.trim();\n if (!key || key.length > MAX_KEY_LENGTH) continue;\n result[key] = value;\n count++;\n }\n return result;\n}\n\n/**\n * Capped at GA4's own item-list limit, and truncated rather than rejected like every other\n * property limit here: an unbounded array is the one field a caller could still blow a batch\n * up with after the value and key limits.\n */\nconst MAX_ITEMS = 200;\n\nconst items = pipe(\n array(\n pipe(\n record(string(), union([propertyText, number(), boolean(), _null()])),\n transform(takeProperties)\n )\n ),\n transform((list) => list.slice(0, MAX_ITEMS))\n);\n\nexport const ALL_PLATFORMS = [\n 'ios',\n 'android',\n 'web',\n 'macos',\n 'windows',\n 'linux',\n 'unknown',\n] as const satisfies Platform[];\n\nexport const ALL_ENVIRONMENTS = ['development', 'production'] as const satisfies Environment[];\n\nexport const tagsSchema = object({\n os: optional(tagText),\n os_name: optional(tagText),\n os_version: optional(tagText),\n browser: optional(tagText),\n browser_name: optional(tagText),\n browser_version: optional(tagText),\n device: optional(tagText),\n device_id: optional(string().check(trim(), minLength(1), maxLength(36))),\n device_type: optional(tagText),\n device_vendor: optional(tagText),\n device_pixel_ratio: optional(number()),\n screen_width: optional(number()),\n screen_height: optional(number()),\n screen_resolution: optional(\n pipe(\n string().check(regex(/^\\d+x\\d+$/)),\n transform((v) => v as `${number}x${number}`)\n )\n ),\n webdriver: optional(boolean()),\n release: optional(tagText),\n language: optional(tagText),\n time_zone: optional(tagText),\n page_location: optional(tagText),\n page_referrer: optional(tagText),\n page_title: optional(tagText),\n page_load_id: optional(tagText),\n /**\n * @deprecated Renamed to `page_location` in 7.0.0. Accepted so that events from clients\n * still on an older SDK are not stripped of their page URL at this boundary — a browser\n * bundle stays cached long after a backend deploys. Remove once those clients are gone;\n * `pageLocation` in `server/page-location.ts` is the only reader.\n */\n // oxlint-disable-next-line typescript/no-deprecated -- Legacy input from pre-7.0 clients must survive validation.\n source_url: optional(tagText),\n // app info\n advertising_id: optional(tagText),\n install_referrer: optional(tagText),\n // Ad click ids (URL parameters) and ad platform cookies (underscore names); see AdvertisingInfo.\n // Meta Ads\n fbclid: optional(tagText),\n ad_id: optional(tagText),\n ad_name: optional(tagText),\n adset_id: optional(tagText),\n adset_name: optional(tagText),\n campaign_id: optional(tagText),\n campaign_name: optional(tagText),\n placement: optional(tagText),\n _fbc: optional(tagText),\n _fbp: optional(tagText),\n /**\n * @deprecated `fbc` / `fbp` / `rdt_uuid` were renamed to `_fbc` / `_fbp` / `_rdt_uuid` in 9.0.0.\n * Accepted so that conversions from clients still on an older SDK keep their match keys; the\n * senders read them only as a fallback (`server/click-ids.ts`). Remove once those clients are\n * gone.\n */\n // oxlint-disable-next-line typescript/no-deprecated -- Legacy pre-9.0 click-id fields must survive validation.\n fbc: optional(tagText),\n fbp: optional(tagText),\n rdt_uuid: optional(tagText),\n // Google Ads\n gclid: optional(tagText),\n gclsrc: optional(tagText),\n gad_source: optional(tagText),\n gad_campaignid: optional(tagText),\n network: optional(tagText),\n match_type: optional(tagText),\n wbraid: optional(tagText),\n gbraid: optional(tagText),\n dclid: optional(tagText),\n _gcl_aw: optional(tagText),\n _gcl_gb: optional(tagText),\n // Microsoft Ads\n msclkid: optional(tagText),\n _uetmsclkid: optional(tagText),\n // Reddit Ads\n rdt_cid: optional(tagText),\n _rdt_cid: optional(tagText),\n _rdt_uuid: optional(tagText),\n // LinkedIn Ads\n li_fat_id: optional(tagText),\n _li_fat_id: optional(tagText),\n // OpenAI Ads\n oppref: optional(tagText),\n __oppref: optional(tagText),\n __obref: optional(tagText),\n // other click ids\n ko_click_id: optional(tagText),\n ScCid: optional(tagText),\n ttclid: optional(tagText),\n twclid: optional(tagText),\n yclid: optional(tagText),\n epik: optional(tagText),\n // utm params\n utm_source: optional(tagText),\n utm_medium: optional(tagText),\n utm_campaign: optional(tagText),\n utm_term: optional(tagText),\n utm_content: optional(tagText),\n utm_id: optional(tagText),\n utm_source_platform: optional(tagText),\n utm_creative_format: optional(tagText),\n utm_marketing_tactic: optional(tagText),\n});\n\nexport const propertiesSchema = optional(\n pipe(\n record(string(), union([propertyText, number(), boolean(), _null(), items])),\n transform(takeProperties)\n )\n);\n\n/**\n * How far an event's time may be from the server's before the client clock it was stamped with is\n * taken as wrong. A batch legitimately arrives late — a tab frozen in the background, a\n * session_start held back after a failed batch — by hours, not days; a phone set to another year\n * writes its sessions into that year.\n */\nconst MAX_CLOCK_SKEW = 24 * 60 * 60 * 1000;\n\n/**\n * Puts the events stamped by a wrong client clock onto the server's, where they are parsed. Only\n * the events outside `MAX_CLOCK_SKEW` move, so one bad event cannot drag the rest of its batch\n * along: they move together by their own latest one — the wrong clock at sending — keeping their\n * order and spacing, and one still out after that (a batch mixing two wrong clocks) is on no clock\n * at all and takes the server's time. Corrected rather than rejected, for the same reason values\n * are truncated: a wrong clock should cost the event its time, not the batch its events.\n */\nfunction alignClock<T extends { timestamp: string }>(events: T[], now = Date.now()): T[] {\n const within = (time: number) => Math.abs(now - time) <= MAX_CLOCK_SKEW;\n const times = events.map((event) => Date.parse(event.timestamp));\n const wrong = times.filter((time) => !within(time));\n if (wrong.length === 0) return events;\n const offset = now - Math.max(...wrong);\n return events.map((event, i) => {\n if (within(times[i])) return event;\n const shifted = times[i] + offset;\n return { ...event, timestamp: new Date(within(shifted) ? shifted : now).toISOString() };\n });\n}\n\nexport const createTrackEventSchema = pipe(\n array(\n object({\n /**\n * The event's id, generated by the client when the event was tracked (12.1) and given to\n * the browser pixels as their deduplication id. Store the event under it with\n * `on conflict (id) do nothing`: a batch retried after the server committed it then\n * stores nothing twice. Optional for clients before 12.1, which send none — generate one\n * on the server for those.\n */\n id: optional(uuid({ version: 'v7' })),\n name: string().check(trim(), minLength(1), maxLength(64)),\n // Generated by the SDK, like `id` (`visitorId()`, `Session`): uuidv7 as well, so the\n // constraint is checked here once and the server need not check it again.\n visitor_id: uuid({ version: 'v7' }),\n session_id: uuid({ version: 'v7' }),\n platform: _enum(ALL_PLATFORMS),\n environment: _enum(ALL_ENVIRONMENTS),\n timestamp: iso.datetime(),\n tags: tagsSchema,\n properties: propertiesSchema,\n })\n ).check(minLength(1), maxLength(100)),\n transform((events) => alignClock(events))\n);\n\n/**\n * `POST /visitors`, what clients before 11.0 create their visitor with; 11.0 generates the id\n * itself and the server creates the visitor from its first events (README, \"Visitors\").\n * Kept for servers that still serve older clients.\n */\nexport const createVisitorSchema = object({\n device_id: string().check(trim(), minLength(1), maxLength(36)),\n platform: _enum(ALL_PLATFORMS),\n environment: _enum(ALL_ENVIRONMENTS),\n tags: tagsSchema,\n});\n\nconst emailValue = pipe(string().check(trim(), toLowerCase(), maxLength(320)), email());\n\n/** E.164: a plus sign (+) prefix, country code, then digits only, no dashes/parens/spaces. */\nconst phoneValue = pipe(string().check(trim()), e164());\n\nconst addressValue = object({\n first_name: optional(string().check(trim(), maxLength(128))),\n last_name: optional(string().check(trim(), maxLength(128))),\n street: optional(string().check(trim(), maxLength(256))),\n city: optional(string().check(trim(), maxLength(128))),\n /** User province, state, or region. Example: `Hampshire` */\n region: optional(string().check(trim(), maxLength(128))),\n postal_code: optional(string().check(trim(), maxLength(32))),\n /** 2-letter country code, per the ISO 3166-1 alpha-2 standard. Example: `UK` */\n country: optional(string().check(trim(), toUpperCase(), regex(/^[A-Z]{2}$/))),\n});\n\n/**\n * User-provided data (UPD) used for enhanced conversions, Customer Match, and demographics.\n * Values are sent unhashed; Google normalizes and hashes them before they reach its servers.\n *\n * Multiple values may be sent to increase the match rate: up to 3 emails, 3 phone numbers, and\n * 2 addresses.\n *\n * @see https://support.google.com/analytics/answer/14078702\n * @see https://support.google.com/google-ads/answer/13258081\n */\nexport const userProvidedDataSchema = object({\n email: optional(union([emailValue, array(emailValue).check(minLength(1), maxLength(3))])),\n phone_number: optional(union([phoneValue, array(phoneValue).check(minLength(1), maxLength(3))])),\n address: optional(union([addressValue, array(addressValue).check(minLength(1), maxLength(2))])),\n});\n\nexport const updateVisitorSchema = object({\n user_id: optional(uuid()),\n user_data: optional(userProvidedDataSchema),\n /**\n * Sent by clients before 11.1, which PATCHed their tags on every page load. From 11.1 the\n * server refreshes `visitor.tags` from each `session_start` — the moment the visit arrives —\n * and `setVisitor` sends none: at sign-in the page is no longer where the visit came in.\n */\n tags: optional(tagsSchema),\n});\n\nexport const createFeedbackSchema = object({\n name: string().check(minLength(1), maxLength(256)),\n // Trimmed and lower-cased like every other email the SDK accepts, so a host stores the\n // normalized form without wrapping the schema.\n email: emailValue,\n message: string().check(minLength(1), maxLength(65536)),\n /**\n * The Cloudflare Turnstile token the host verifies before storing the feedback (the same field\n * `@shware/security`'s email-code request carries). Required: without it `POST /feedback` is an\n * open free-text write that only a rate limit protects. Single-use: Turnstile spends the token\n * at verification, so the caller resets the widget after every submit, success or failure.\n */\n turnstileToken: string().check(minLength(1), maxLength(2048)),\n});\n\nconst noEmptyString = pipe(\n string().check(maxLength(256)),\n transform((v) => (v ? v : undefined))\n);\n\n/**\n * The schema for creating a link.\n * @see https://support.google.com/analytics/answer/10917952\n * */\nexport const createLinkSchema = object({\n /** The URL that the user is redirected to. */\n url: url().check(minLength(1), maxLength(1024)), // required\n\n /**\n * Campaign ID. Used to identify a specific campaign or promotion. This is a required key for GA4\n * data import. Use the same IDs that you use when uploading campaign cost data.\n */\n utm_id: optional(noEmptyString),\n\n /** Referrer, for example: google, newsletter4, billboard */\n utm_source: string().check(minLength(1), maxLength(256)), // required\n\n /** Marketing medium, for example: cpc, banner, email */\n utm_medium: string().check(minLength(1), maxLength(256)), // required\n\n /** Product, slogan, promo code, for example, spring_sale */\n utm_campaign: string().check(minLength(1), maxLength(256)), // required\n\n /** Paid keyword */\n utm_term: optional(noEmptyString),\n\n /**\n * Use to differentiate creatives. For example, if you have two call-to-action links within the\n * same email message, you can use utm_content and set different values for each so you can tell\n * which version is more effective.\n */\n utm_content: optional(noEmptyString),\n\n /**\n * The platform responsible for directing traffic to a given Analytics property (such as a buying\n * platform that sets budgets and targeting criteria or a platform that manages organic traffic\n * data). For example, Search Ads 360 or Display & Video 360.\n */\n utm_source_platform: optional(noEmptyString),\n\n /**\n * Type of creative, for example, display, native, video, search, utm_creative_format is not\n * currently reported in Google Analytics 4 properties.\n */\n utm_creative_format: optional(noEmptyString),\n\n /**\n * Targeting criteria applied to a campaign, for example, remarketing, prospecting,\n * utm_marketing_tactic is not currently reported in Google Analytics 4 properties.\n * */\n utm_marketing_tactic: optional(noEmptyString),\n});\n\nexport type CreateTrackEventDTO = z.output<typeof createTrackEventSchema>;\nexport type CreateFeedbackDTO = z.output<typeof createFeedbackSchema>;\nexport type CreateLinkDTO = z.output<typeof createLinkSchema>;\nexport type CreateVisitorDTO = z.output<typeof createVisitorSchema>;\nexport type UserProvidedDataDTO = z.output<typeof userProvidedDataSchema>;\nexport type UpdateVisitorDTO = z.output<typeof updateVisitorSchema>;\n"],"mappings":";;AA4BA,MAAM,iBAAiB;AACvB,MAAM,mBAAmB;AACzB,MAAM,iBAAiB;;;;;;;AAQvB,MAAM,eAAe,KACnB,OAAO,GACP,WAAW,UAAU,MAAM,MAAM,GAAG,gBAAgB,CAAC,CACvD;;;;;;;;;AAUA,MAAM,iBAAiB;AAEvB,MAAM,UAAU,KACd,OAAO,GACP,WAAW,UAAU,MAAM,MAAM,GAAG,cAAc,CAAC,CACrD;;;;;;;;;;;AAYA,SAAS,eAAkB,MAA4C;CACrE,MAAM,SAA4B,CAAC;CACnC,IAAI,QAAQ;CACZ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Aa;;;;;;CAOhC,aAAa,SAAS,aAAa;;;;;;CAOnC,qBAAqB,SAAS,aAAa;;;;;CAM3C,qBAAqB,SAAS,aAAa;;;;;CAM3C,sBAAsB,SAAS,aAAa;AAC9C,CAAC"}
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- //#region src/server/action-source.ts
2
+ // src/server/action-source.ts
3
3
  /**
4
4
  * An OS name means the event came from a native app, `web` means a browser page. A caller that
5
5
  * declares `macos`/`windows`/`linux` is declaring a desktop app — a page running in a webview
@@ -22,7 +22,6 @@ function getActionSource(platform) {
22
22
  function resolveActionSource(platform, actionSource) {
23
23
  return actionSource ?? getActionSource(platform);
24
24
  }
25
- //#endregion
26
25
  exports.resolveActionSource = resolveActionSource;
27
26
 
28
27
  //# sourceMappingURL=action-source.cjs.map
@@ -1,5 +1,4 @@
1
1
  import { Platform } from "../track/types.cjs";
2
- //#region src/server/action-source.d.ts
3
2
  /**
4
3
  * The coarse "where did this happen" categorization every conversions API asks for, under its
5
4
  * own name and its own spelling: Meta `action_source`, Reddit `action_source`, OpenAI
@@ -15,5 +14,4 @@ export type ActionSource = 'web' | 'app';
15
14
  export type EventActionSource = ActionSource | 'offline';
16
15
  /** An explicit action source always wins; otherwise it is derived from the event's platform. */
17
16
  export declare function resolveActionSource(platform: Platform, actionSource?: EventActionSource): EventActionSource | undefined;
18
- //#endregion
19
17
  //# sourceMappingURL=action-source.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"action-source.d.cts","names":[],"sources":["../../src/server/action-source.ts"],"mappings":";;;;;;;YAOY;;;;;;;YAQA,oBAAoB;;wBAyBhB,oBACd,UAAU,UACV,eAAe,oBACd"}
1
+ {"version":3,"file":"action-source.d.cts","names":[],"sources":["../../src/server/action-source.ts"],"mappings":";;;;;;YAOY;;;;;;;YAQA,oBAAoB;;wBAyBhB,oBACd,UAAU,UACV,eAAe,oBACd"}
@@ -1,5 +1,4 @@
1
1
  import { Platform } from "../track/types.mjs";
2
- //#region src/server/action-source.d.ts
3
2
  /**
4
3
  * The coarse "where did this happen" categorization every conversions API asks for, under its
5
4
  * own name and its own spelling: Meta `action_source`, Reddit `action_source`, OpenAI
@@ -15,5 +14,4 @@ export type ActionSource = 'web' | 'app';
15
14
  export type EventActionSource = ActionSource | 'offline';
16
15
  /** An explicit action source always wins; otherwise it is derived from the event's platform. */
17
16
  export declare function resolveActionSource(platform: Platform, actionSource?: EventActionSource): EventActionSource | undefined;
18
- //#endregion
19
17
  //# sourceMappingURL=action-source.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"action-source.d.mts","names":[],"sources":["../../src/server/action-source.ts"],"mappings":";;;;;;;YAOY;;;;;;;YAQA,oBAAoB;;wBAyBhB,oBACd,UAAU,UACV,eAAe,oBACd"}
1
+ {"version":3,"file":"action-source.d.mts","names":[],"sources":["../../src/server/action-source.ts"],"mappings":";;;;;;YAOY;;;;;;;YAQA,oBAAoB;;wBAyBhB,oBACd,UAAU,UACV,eAAe,oBACd"}
@@ -1,4 +1,4 @@
1
- //#region src/server/action-source.ts
1
+ // src/server/action-source.ts
2
2
  /**
3
3
  * An OS name means the event came from a native app, `web` means a browser page. A caller that
4
4
  * declares `macos`/`windows`/`linux` is declaring a desktop app — a page running in a webview
@@ -21,7 +21,6 @@ function getActionSource(platform) {
21
21
  function resolveActionSource(platform, actionSource) {
22
22
  return actionSource ?? getActionSource(platform);
23
23
  }
24
- //#endregion
25
24
  export { resolveActionSource };
26
25
 
27
26
  //# sourceMappingURL=action-source.mjs.map
@@ -1,6 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  const require_click_id_index = require("../click-id/index.cjs");
3
- //#region src/server/click-ids.ts
3
+ // src/server/click-ids.ts
4
4
  /**
5
5
  * The click id each conversion sender passes on, resolved from an event's tags.
6
6
  *
@@ -80,7 +80,6 @@ function linkedinFatId(tags) {
80
80
  function openaiOppref(tags) {
81
81
  return tags.oppref ?? tags.__oppref;
82
82
  }
83
- //#endregion
84
83
  exports.googleClickIds = googleClickIds;
85
84
  exports.linkedinFatId = linkedinFatId;
86
85
  exports.metaFbc = metaFbc;
@@ -1,5 +1,4 @@
1
1
  import { TrackTags } from "../track/types.cjs";
2
- //#region src/server/click-ids.d.ts
3
2
  /**
4
3
  * Meta's `fbc`: built from this page's `fbclid`, else the `_fbc` cookie. One exception on the
5
4
  * landing page: a cookie opened by that same `fbclid` is sent as it is, for its creationTime —
@@ -36,5 +35,4 @@ export declare function linkedinFatId(tags: TrackTags): string | undefined;
36
35
  * ref: https://developers.openai.com/ads/measurement-pixel#cookie-expiry
37
36
  */
38
37
  export declare function openaiOppref(tags: TrackTags): string | undefined;
39
- //#endregion
40
38
  //# sourceMappingURL=click-ids.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"click-ids.d.cts","names":[],"sources":["../../src/server/click-ids.ts"],"mappings":";;;;;;;wBA6BgB,QAAQ,MAAM,WAAW;;wBAezB,QAAQ,MAAM;;;;;;;;;wBAad,eAAe,MAAM;;;;;;;;;wBAerB,iBAAiB,MAAM;wBAKvB,cAAc,MAAM;;wBAKpB,WAAW,MAAM;wBAKjB,cAAc,MAAM;;;;;;wBASpB,aAAa,MAAM"}
1
+ {"version":3,"file":"click-ids.d.cts","names":[],"sources":["../../src/server/click-ids.ts"],"mappings":";;;;;;wBA6BgB,QAAQ,MAAM,WAAW;;wBAezB,QAAQ,MAAM;;;;;;;;;wBAad,eAAe,MAAM;;;;;;;;;wBAerB,iBAAiB,MAAM;wBAKvB,cAAc,MAAM;;wBAKpB,WAAW,MAAM;wBAKjB,cAAc,MAAM;;;;;;wBASpB,aAAa,MAAM"}
@@ -1,5 +1,4 @@
1
1
  import { TrackTags } from "../track/types.mjs";
2
- //#region src/server/click-ids.d.ts
3
2
  /**
4
3
  * Meta's `fbc`: built from this page's `fbclid`, else the `_fbc` cookie. One exception on the
5
4
  * landing page: a cookie opened by that same `fbclid` is sent as it is, for its creationTime —
@@ -36,5 +35,4 @@ export declare function linkedinFatId(tags: TrackTags): string | undefined;
36
35
  * ref: https://developers.openai.com/ads/measurement-pixel#cookie-expiry
37
36
  */
38
37
  export declare function openaiOppref(tags: TrackTags): string | undefined;
39
- //#endregion
40
38
  //# sourceMappingURL=click-ids.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"click-ids.d.mts","names":[],"sources":["../../src/server/click-ids.ts"],"mappings":";;;;;;;wBA6BgB,QAAQ,MAAM,WAAW;;wBAezB,QAAQ,MAAM;;;;;;;;;wBAad,eAAe,MAAM;;;;;;;;;wBAerB,iBAAiB,MAAM;wBAKvB,cAAc,MAAM;;wBAKpB,WAAW,MAAM;wBAKjB,cAAc,MAAM;;;;;;wBASpB,aAAa,MAAM"}
1
+ {"version":3,"file":"click-ids.d.mts","names":[],"sources":["../../src/server/click-ids.ts"],"mappings":";;;;;;wBA6BgB,QAAQ,MAAM,WAAW;;wBAezB,QAAQ,MAAM;;;;;;;;;wBAad,eAAe,MAAM;;;;;;;;;wBAerB,iBAAiB,MAAM;wBAKvB,cAAc,MAAM;;wBAKpB,WAAW,MAAM;wBAKjB,cAAc,MAAM;;;;;;wBASpB,aAAa,MAAM"}
@@ -1,5 +1,5 @@
1
1
  import { formatFbc, isGoogleAdsGclid, isMsclkid, parseFbc, parseGcl, parseUetMsclkid } from "../click-id/index.mjs";
2
- //#region src/server/click-ids.ts
2
+ // src/server/click-ids.ts
3
3
  /**
4
4
  * The click id each conversion sender passes on, resolved from an event's tags.
5
5
  *
@@ -79,7 +79,6 @@ function linkedinFatId(tags) {
79
79
  function openaiOppref(tags) {
80
80
  return tags.oppref ?? tags.__oppref;
81
81
  }
82
- //#endregion
83
82
  export { googleClickIds, linkedinFatId, metaFbc, metaFbp, microsoftMsclkid, openaiOppref, redditClickId, redditUuid };
84
83
 
85
84
  //# sourceMappingURL=click-ids.mjs.map
@@ -4,7 +4,7 @@ const require_server_action_source = require("./action-source.cjs");
4
4
  const require_server_click_ids = require("./click-ids.cjs");
5
5
  let _shware_utils = require("@shware/utils");
6
6
  let node_crypto = require("node:crypto");
7
- //#region src/server/google-data-manager.ts
7
+ // src/server/google-data-manager.ts
8
8
  /**
9
9
  * Google Ads conversion sender over the Data Manager API (`events:ingest`) — Google's
10
10
  * counterpart to Meta's Conversions API, and the mandated successor to the Google Ads API's
@@ -159,7 +159,6 @@ async function sendEvents(auth, config, events, data = {}, options = {}) {
159
159
  }
160
160
  return firstResponse;
161
161
  }
162
- //#endregion
163
162
  exports.getDataManagerEvent = getDataManagerEvent;
164
163
  exports.normalizeEmail = normalizeEmail;
165
164
  exports.sendEvents = sendEvents;
@@ -1,5 +1,4 @@
1
1
  import { TrackEvent, UserProvidedData } from "../track/types.cjs";
2
- //#region src/server/google-data-manager.d.ts
3
2
  /**
4
3
  * Event name → conversion action id, mirroring `LinkedinConversionConfig`: only configured
5
4
  * events upload, everything else is skipped silently. In the hybrid setup this is the id of
@@ -86,5 +85,4 @@ export interface DataManagerResponse {
86
85
  * 2000-event request cap goes out as sequential requests; the first response is returned.
87
86
  */
88
87
  export declare function sendEvents(auth: GoogleAdsAuth, config: GoogleAdsConversionConfig, events: TrackEvent<any>[], data?: UserProvidedData, options?: GoogleAdsConversionsOptions): Promise<DataManagerResponse | undefined>;
89
- //#endregion
90
88
  //# sourceMappingURL=google-data-manager.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"google-data-manager.d.cts","names":[],"sources":["../../src/server/google-data-manager.ts"],"mappings":";;;;;;;YAsCY,4BAA4B,OAAO;iBAE9B;;EAEf;;EAEA;;EAEA;;;;;;iBAOe;EACf;EACA;;;;;;;;;;;YAYU;iBAEK;;EAEf;EACA,UAAU;;EAEV,aAAa;;;;;;;;wBASC,eAAe;;iBA2Cd;EACf;EACA;;EAEA;;EAEA;EACA;EACA;EACA;IAAkB;IAAgB;IAAiB;;EACnD;IAAa,iBAAiB;;;;;;;;;;;;wBAYhB,oBAEd,OAAO,iBACP,QAAQ,2BACR,OAAM,kBACN,aAAY,sBACX;iBA+Cc;EACf;;;;;;;;;wBAaoB,WACpB,MAAM,eACN,QAAQ,2BAER,QAAQ,mBACR,OAAM,kBACN,UAAS,8BACR,QAAQ"}
1
+ {"version":3,"file":"google-data-manager.d.cts","names":[],"sources":["../../src/server/google-data-manager.ts"],"mappings":";;;;;;YAsCY,4BAA4B,OAAO;iBAE9B;;EAEf;;EAEA;;EAEA;;;;;;iBAOe;EACf;EACA;;;;;;;;;;;YAYU;iBAEK;;EAEf;EACA,UAAU;;EAEV,aAAa;;;;;;;;wBASC,eAAe;;iBA2Cd;EACf;EACA;;EAEA;;EAEA;EACA;EACA;EACA;IAAkB;IAAgB;IAAiB;;EACnD;IAAa,iBAAiB;;;;;;;;;;;;wBAYhB,oBAEd,OAAO,iBACP,QAAQ,2BACR,OAAM,kBACN,aAAY,sBACX;iBA+Cc;EACf;;;;;;;;;wBAaoB,WACpB,MAAM,eACN,QAAQ,2BAER,QAAQ,mBACR,OAAM,kBACN,UAAS,8BACR,QAAQ"}
@@ -1,5 +1,4 @@
1
1
  import { TrackEvent, UserProvidedData } from "../track/types.mjs";
2
- //#region src/server/google-data-manager.d.ts
3
2
  /**
4
3
  * Event name → conversion action id, mirroring `LinkedinConversionConfig`: only configured
5
4
  * events upload, everything else is skipped silently. In the hybrid setup this is the id of
@@ -86,5 +85,4 @@ export interface DataManagerResponse {
86
85
  * 2000-event request cap goes out as sequential requests; the first response is returned.
87
86
  */
88
87
  export declare function sendEvents(auth: GoogleAdsAuth, config: GoogleAdsConversionConfig, events: TrackEvent<any>[], data?: UserProvidedData, options?: GoogleAdsConversionsOptions): Promise<DataManagerResponse | undefined>;
89
- //#endregion
90
88
  //# sourceMappingURL=google-data-manager.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"google-data-manager.d.mts","names":[],"sources":["../../src/server/google-data-manager.ts"],"mappings":";;;;;;;YAsCY,4BAA4B,OAAO;iBAE9B;;EAEf;;EAEA;;EAEA;;;;;;iBAOe;EACf;EACA;;;;;;;;;;;YAYU;iBAEK;;EAEf;EACA,UAAU;;EAEV,aAAa;;;;;;;;wBASC,eAAe;;iBA2Cd;EACf;EACA;;EAEA;;EAEA;EACA;EACA;EACA;IAAkB;IAAgB;IAAiB;;EACnD;IAAa,iBAAiB;;;;;;;;;;;;wBAYhB,oBAEd,OAAO,iBACP,QAAQ,2BACR,OAAM,kBACN,aAAY,sBACX;iBA+Cc;EACf;;;;;;;;;wBAaoB,WACpB,MAAM,eACN,QAAQ,2BAER,QAAQ,mBACR,OAAM,kBACN,UAAS,8BACR,QAAQ"}
1
+ {"version":3,"file":"google-data-manager.d.mts","names":[],"sources":["../../src/server/google-data-manager.ts"],"mappings":";;;;;;YAsCY,4BAA4B,OAAO;iBAE9B;;EAEf;;EAEA;;EAEA;;;;;;iBAOe;EACf;EACA;;;;;;;;;;;YAYU;iBAEK;;EAEf;EACA,UAAU;;EAEV,aAAa;;;;;;;;wBASC,eAAe;;iBA2Cd;EACf;EACA;;EAEA;;EAEA;EACA;EACA;EACA;IAAkB;IAAgB;IAAiB;;EACnD;IAAa,iBAAiB;;;;;;;;;;;;wBAYhB,oBAEd,OAAO,iBACP,QAAQ,2BACR,OAAM,kBACN,aAAY,sBACX;iBA+Cc;EACf;;;;;;;;;wBAaoB,WACpB,MAAM,eACN,QAAQ,2BAER,QAAQ,mBACR,OAAM,kBACN,UAAS,8BACR,QAAQ"}
@@ -3,7 +3,7 @@ import { resolveActionSource } from "./action-source.mjs";
3
3
  import { googleClickIds } from "./click-ids.mjs";
4
4
  import { fetch } from "@shware/utils";
5
5
  import { createHash } from "node:crypto";
6
- //#region src/server/google-data-manager.ts
6
+ // src/server/google-data-manager.ts
7
7
  /**
8
8
  * Google Ads conversion sender over the Data Manager API (`events:ingest`) — Google's
9
9
  * counterpart to Meta's Conversions API, and the mandated successor to the Google Ads API's
@@ -158,7 +158,6 @@ async function sendEvents(auth, config, events, data = {}, options = {}) {
158
158
  }
159
159
  return firstResponse;
160
160
  }
161
- //#endregion
162
161
  export { getDataManagerEvent, normalizeEmail, sendEvents };
163
162
 
164
163
  //# sourceMappingURL=google-data-manager.mjs.map
@@ -5,7 +5,7 @@ const require_server_click_ids = require("./click-ids.cjs");
5
5
  let _shware_utils = require("@shware/utils");
6
6
  let node_crypto = require("node:crypto");
7
7
  let node_net = require("node:net");
8
- //#region src/server/linkedin-conversions-api.ts
8
+ // src/server/linkedin-conversions-api.ts
9
9
  /**
10
10
  * Conversions API Payload Builder: https://www.linkedin.com/developers/payload-builder
11
11
  * https://learn.microsoft.com/en-us/linkedin/marketing/conversions/conversions-overview?view=li-lms-2026-09
@@ -107,7 +107,6 @@ async function sendEvents(accessToken, config, events, data = {}) {
107
107
  console.error("Failed to send LinkedIn conversion, network error:", error);
108
108
  }
109
109
  }
110
- //#endregion
111
110
  exports.sendEvents = sendEvents;
112
111
 
113
112
  //# sourceMappingURL=linkedin-conversions-api.cjs.map