@10x-media/analytics 1.0.0-beta.8 → 4.0.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1273) hide show
  1. package/CHANGELOG.md +780 -0
  2. package/LICENSE +21 -21
  3. package/README.md +35 -36
  4. package/dist/access/adminUser.d.ts +15 -0
  5. package/dist/access/adminUser.js +13 -0
  6. package/dist/access/adminUser.js.map +1 -0
  7. package/dist/access/decideOnce.js +16 -0
  8. package/dist/access/decideOnce.js.map +1 -0
  9. package/dist/access/membership.d.ts +23 -0
  10. package/dist/access/membership.js +63 -0
  11. package/dist/access/membership.js.map +1 -0
  12. package/dist/access/principal.d.ts +37 -0
  13. package/dist/access/principal.js +29 -0
  14. package/dist/access/principal.js.map +1 -0
  15. package/dist/access/readGate.js +16 -0
  16. package/dist/access/readGate.js.map +1 -0
  17. package/dist/adapters/ga4/disableKey.js +19 -0
  18. package/dist/adapters/ga4/disableKey.js.map +1 -0
  19. package/dist/adapters/ga4/eventName.d.ts +9 -0
  20. package/dist/adapters/ga4/eventName.js +13 -0
  21. package/dist/adapters/ga4/eventName.js.map +1 -0
  22. package/dist/adapters/ga4/ga4.d.ts +29 -0
  23. package/dist/adapters/ga4/ga4.js +324 -112
  24. package/dist/adapters/ga4/ga4.js.map +1 -1
  25. package/dist/adapters/ga4/measurementId.js +14 -0
  26. package/dist/adapters/ga4/measurementId.js.map +1 -0
  27. package/dist/adapters/goalRead.js +112 -0
  28. package/dist/adapters/goalRead.js.map +1 -0
  29. package/dist/adapters/http/baseUrl.js +15 -0
  30. package/dist/adapters/http/baseUrl.js.map +1 -0
  31. package/dist/adapters/http/fetchJson.d.ts +19 -0
  32. package/dist/adapters/http/fetchJson.js +27 -8
  33. package/dist/adapters/http/fetchJson.js.map +1 -1
  34. package/dist/adapters/mapping.js +52 -0
  35. package/dist/adapters/mapping.js.map +1 -0
  36. package/dist/adapters/plausible/plausible.d.ts +30 -3
  37. package/dist/adapters/plausible/plausible.js +198 -110
  38. package/dist/adapters/plausible/plausible.js.map +1 -1
  39. package/dist/adapters/plausible/scriptId.js +19 -0
  40. package/dist/adapters/plausible/scriptId.js.map +1 -0
  41. package/dist/adapters/posthog/posthog.d.ts +33 -9
  42. package/dist/adapters/posthog/posthog.js +307 -127
  43. package/dist/adapters/posthog/posthog.js.map +1 -1
  44. package/dist/adapters/posthog/projectCheck.js +56 -0
  45. package/dist/adapters/posthog/projectCheck.js.map +1 -0
  46. package/dist/adapters/readTime.js +7 -0
  47. package/dist/adapters/readTime.js.map +1 -0
  48. package/dist/adapters/series.js +14 -8
  49. package/dist/adapters/series.js.map +1 -1
  50. package/dist/adapters/umami/umami.d.ts +21 -3
  51. package/dist/adapters/umami/umami.js +334 -95
  52. package/dist/adapters/umami/umami.js.map +1 -1
  53. package/dist/adapters/upstream.js +16 -0
  54. package/dist/adapters/upstream.js.map +1 -0
  55. package/dist/binding/report.d.ts +8 -0
  56. package/dist/binding/report.js +24 -0
  57. package/dist/binding/report.js.map +1 -0
  58. package/dist/binding/resolvePath.js +28 -25
  59. package/dist/binding/resolvePath.js.map +1 -1
  60. package/dist/binding/types.d.ts +14 -29
  61. package/dist/capture/captureRequest.js +28 -0
  62. package/dist/capture/captureRequest.js.map +1 -0
  63. package/dist/capture/exclusionEndpoint.js +98 -0
  64. package/dist/capture/exclusionEndpoint.js.map +1 -0
  65. package/dist/capture/exclusionPrelude.js +14 -0
  66. package/dist/capture/exclusionPrelude.js.map +1 -0
  67. package/dist/capture/exclusionToken.js +23 -0
  68. package/dist/capture/exclusionToken.js.map +1 -0
  69. package/dist/capture/jsLiteral.js +19 -0
  70. package/dist/capture/jsLiteral.js.map +1 -0
  71. package/dist/capture/mountPath.js +2 -3
  72. package/dist/capture/mountPath.js.map +1 -1
  73. package/dist/capture/proxyEndpoint.js +49 -92
  74. package/dist/capture/proxyEndpoint.js.map +1 -1
  75. package/dist/capture/proxyRoutes.js +58 -21
  76. package/dist/capture/proxyRoutes.js.map +1 -1
  77. package/dist/capture/relay.js +91 -0
  78. package/dist/capture/relay.js.map +1 -0
  79. package/dist/capture/requestBody.js +2 -6
  80. package/dist/capture/requestBody.js.map +1 -1
  81. package/dist/capture/requestTrust.js +45 -0
  82. package/dist/capture/requestTrust.js.map +1 -0
  83. package/dist/capture/sameSite.js +40 -0
  84. package/dist/capture/sameSite.js.map +1 -0
  85. package/dist/capture/slots.js +50 -25
  86. package/dist/capture/slots.js.map +1 -1
  87. package/dist/capture/trackerConfig.js +131 -36
  88. package/dist/capture/trackerConfig.js.map +1 -1
  89. package/dist/capture/trackerEndpoint.js +22 -21
  90. package/dist/capture/trackerEndpoint.js.map +1 -1
  91. package/dist/capture/withoutConsent.js +91 -0
  92. package/dist/capture/withoutConsent.js.map +1 -0
  93. package/dist/charts/BarList.d.ts +27 -13
  94. package/dist/charts/BarList.js +38 -77
  95. package/dist/charts/BarList.js.map +1 -1
  96. package/dist/charts/TrendChart.d.ts +40 -7
  97. package/dist/charts/TrendChart.js +243 -215
  98. package/dist/charts/TrendChart.js.map +1 -1
  99. package/dist/charts/bars.d.ts +17 -1
  100. package/dist/charts/bars.js +12 -11
  101. package/dist/charts/bars.js.map +1 -1
  102. package/dist/charts/bucket.js +106 -73
  103. package/dist/charts/bucket.js.map +1 -1
  104. package/dist/charts/inProgress.js +22 -0
  105. package/dist/charts/inProgress.js.map +1 -0
  106. package/dist/charts/series.d.ts +15 -0
  107. package/dist/charts/series.js +123 -0
  108. package/dist/charts/series.js.map +1 -0
  109. package/dist/charts/spline.js +91 -25
  110. package/dist/charts/spline.js.map +1 -1
  111. package/dist/charts/trendGeometry.js +91 -0
  112. package/dist/charts/trendGeometry.js.map +1 -0
  113. package/dist/core/adminOptions.d.ts +1 -0
  114. package/dist/core/adminOptions.js +198 -0
  115. package/dist/core/adminOptions.js.map +1 -0
  116. package/dist/core/budget.js +24 -0
  117. package/dist/core/budget.js.map +1 -0
  118. package/dist/core/cacheKey.d.ts +1 -0
  119. package/dist/core/cacheKey.js +51 -29
  120. package/dist/core/cacheKey.js.map +1 -1
  121. package/dist/core/cacheOptions.js +165 -0
  122. package/dist/core/cacheOptions.js.map +1 -0
  123. package/dist/core/capabilities.d.ts +24 -11
  124. package/dist/core/capabilities.js +101 -17
  125. package/dist/core/capabilities.js.map +1 -1
  126. package/dist/core/capture.d.ts +59 -26
  127. package/dist/core/captureOptions.d.ts +1 -0
  128. package/dist/core/captureOptions.js +347 -0
  129. package/dist/core/captureOptions.js.map +1 -0
  130. package/dist/core/clock.js +13 -0
  131. package/dist/core/clock.js.map +1 -0
  132. package/dist/core/collectionOption.d.ts +17 -0
  133. package/dist/core/collectionOption.js +105 -0
  134. package/dist/core/collectionOption.js.map +1 -0
  135. package/dist/core/collectionSlug.js +7 -0
  136. package/dist/core/collectionSlug.js.map +1 -0
  137. package/dist/core/contract.d.ts +340 -49
  138. package/dist/core/contract.js +7 -4
  139. package/dist/core/contract.js.map +1 -1
  140. package/dist/core/cron.js +57 -0
  141. package/dist/core/cron.js.map +1 -0
  142. package/dist/core/fetch.d.ts +17 -0
  143. package/dist/core/goalOptions.d.ts +1 -0
  144. package/dist/core/goalOptions.js +166 -0
  145. package/dist/core/goalOptions.js.map +1 -0
  146. package/dist/core/granularity.js +3 -2
  147. package/dist/core/granularity.js.map +1 -1
  148. package/dist/core/guards.js +17 -0
  149. package/dist/core/guards.js.map +1 -0
  150. package/dist/core/jobs.d.ts +40 -0
  151. package/dist/core/jobs.js +132 -0
  152. package/dist/core/jobs.js.map +1 -0
  153. package/dist/core/legacyOptions.js +145 -0
  154. package/dist/core/legacyOptions.js.map +1 -0
  155. package/dist/core/metricAliases.js +81 -0
  156. package/dist/core/metricAliases.js.map +1 -0
  157. package/dist/core/metricValues.js +57 -0
  158. package/dist/core/metricValues.js.map +1 -0
  159. package/dist/core/monotonic.js +10 -0
  160. package/dist/core/monotonic.js.map +1 -0
  161. package/dist/core/optionChecks.js +51 -0
  162. package/dist/core/optionChecks.js.map +1 -0
  163. package/dist/core/options.d.ts +535 -151
  164. package/dist/core/options.js +158 -214
  165. package/dist/core/options.js.map +1 -1
  166. package/dist/core/registry.js +45 -5
  167. package/dist/core/registry.js.map +1 -1
  168. package/dist/core/scopeList.js +7 -9
  169. package/dist/core/scopeList.js.map +1 -1
  170. package/dist/core/scopeOptions.d.ts +1 -0
  171. package/dist/core/scopeOptions.js +114 -0
  172. package/dist/core/scopeOptions.js.map +1 -0
  173. package/dist/core/scopedRead.js +349 -36
  174. package/dist/core/scopedRead.js.map +1 -1
  175. package/dist/core/sdks.d.ts +81 -0
  176. package/dist/core/sdks.js +23 -0
  177. package/dist/core/sdks.js.map +1 -0
  178. package/dist/core/serverEvent.d.ts +50 -14
  179. package/dist/core/serverEvent.js.map +1 -1
  180. package/dist/core/siteAddress.js +20 -0
  181. package/dist/core/siteAddress.js.map +1 -0
  182. package/dist/core/sourceErrors.js +109 -0
  183. package/dist/core/sourceErrors.js.map +1 -0
  184. package/dist/core/sourceLabel.d.ts +10 -0
  185. package/dist/core/sourceLabel.js +63 -0
  186. package/dist/core/sourceLabel.js.map +1 -0
  187. package/dist/core/sourceOptions.js +107 -0
  188. package/dist/core/sourceOptions.js.map +1 -0
  189. package/dist/core/sourcePolicy.d.ts +55 -0
  190. package/dist/core/sourcePolicy.js +51 -0
  191. package/dist/core/sourcePolicy.js.map +1 -0
  192. package/dist/core/throttle.js +18 -0
  193. package/dist/core/throttle.js.map +1 -0
  194. package/dist/core/values.js +61 -0
  195. package/dist/core/values.js.map +1 -0
  196. package/dist/core/widgetSlugs.d.ts +17 -0
  197. package/dist/core/widgetSlugs.js +29 -0
  198. package/dist/core/widgetSlugs.js.map +1 -0
  199. package/dist/db/detachedWrite.js +36 -0
  200. package/dist/db/detachedWrite.js.map +1 -0
  201. package/dist/db/errors.js +182 -0
  202. package/dist/db/errors.js.map +1 -0
  203. package/dist/db/kind.js +32 -0
  204. package/dist/db/kind.js.map +1 -0
  205. package/dist/db/openTransaction.js +51 -0
  206. package/dist/db/openTransaction.js.map +1 -0
  207. package/dist/exports/adapters/contract.d.ts +15 -0
  208. package/dist/exports/adapters/ga4.d.ts +17 -1
  209. package/dist/exports/adapters/ga4.js +2 -1
  210. package/dist/exports/adapters/native.d.ts +29 -2
  211. package/dist/exports/adapters/native.js +5 -1
  212. package/dist/exports/adapters/plausible.d.ts +16 -1
  213. package/dist/exports/adapters/posthog.d.ts +16 -1
  214. package/dist/exports/adapters/umami.d.ts +16 -1
  215. package/dist/exports/attributes.d.ts +42 -0
  216. package/dist/exports/attributes.js +83 -0
  217. package/dist/exports/attributes.js.map +1 -0
  218. package/dist/exports/client.d.ts +45 -11
  219. package/dist/exports/client.js +23 -6
  220. package/dist/exports/geo.d.ts +4 -2
  221. package/dist/exports/geo.js +1 -1
  222. package/dist/exports/i18n.d.ts +2 -2
  223. package/dist/exports/i18n.js +2 -2
  224. package/dist/exports/migrations.d.ts +2 -0
  225. package/dist/exports/migrations.js +2 -0
  226. package/dist/exports/react.d.ts +5 -3
  227. package/dist/exports/react.js +1 -2
  228. package/dist/exports/routes.d.ts +19 -0
  229. package/dist/exports/routes.js +3 -0
  230. package/dist/exports/rsc.d.ts +33 -14
  231. package/dist/exports/rsc.js +11 -6
  232. package/dist/exports/site.d.ts +5 -0
  233. package/dist/exports/site.js +3 -0
  234. package/dist/exports/testing.d.ts +18 -0
  235. package/dist/exports/testing.js +3 -0
  236. package/dist/exports/tracker.d.ts +6 -17
  237. package/dist/exports/tracker.js +3 -11
  238. package/dist/exports/types.d.ts +46 -14
  239. package/dist/exports/types.js +7 -1
  240. package/dist/fields/AnalyticsPanelClient.js +265 -154
  241. package/dist/fields/AnalyticsPanelClient.js.map +1 -1
  242. package/dist/fields/AnalyticsPanelField.d.ts +19 -7
  243. package/dist/fields/AnalyticsPanelField.js +123 -30
  244. package/dist/fields/AnalyticsPanelField.js.map +1 -1
  245. package/dist/fields/AnalyticsStatField.d.ts +17 -6
  246. package/dist/fields/AnalyticsStatField.js +98 -63
  247. package/dist/fields/AnalyticsStatField.js.map +1 -1
  248. package/dist/fields/FieldShimmer.js +15 -0
  249. package/dist/fields/FieldShimmer.js.map +1 -0
  250. package/dist/fields/PanelContent.js +222 -0
  251. package/dist/fields/PanelContent.js.map +1 -0
  252. package/dist/fields/PanelList.js +82 -0
  253. package/dist/fields/PanelList.js.map +1 -0
  254. package/dist/fields/PanelLiveCounter.js +63 -0
  255. package/dist/fields/PanelLiveCounter.js.map +1 -0
  256. package/dist/fields/PanelSkeleton.js +63 -0
  257. package/dist/fields/PanelSkeleton.js.map +1 -0
  258. package/dist/fields/componentPaths.js +8 -0
  259. package/dist/fields/componentPaths.js.map +1 -0
  260. package/dist/fields/config/FilterDimensionSelectField.d.ts +14 -0
  261. package/dist/fields/config/FilterDimensionSelectField.js +49 -0
  262. package/dist/fields/config/FilterDimensionSelectField.js.map +1 -0
  263. package/dist/fields/config/FilterKeySelect.js +66 -0
  264. package/dist/fields/config/FilterKeySelect.js.map +1 -0
  265. package/dist/fields/config/FilterOperatorSelectField.d.ts +19 -0
  266. package/dist/fields/config/FilterOperatorSelectField.js +59 -0
  267. package/dist/fields/config/FilterOperatorSelectField.js.map +1 -0
  268. package/dist/fields/config/FilterValueField.d.ts +17 -0
  269. package/dist/fields/config/FilterValueField.js +130 -0
  270. package/dist/fields/config/FilterValueField.js.map +1 -0
  271. package/dist/fields/config/MetricSelectField.d.ts +5 -12
  272. package/dist/fields/config/MetricSelectField.js +19 -31
  273. package/dist/fields/config/MetricSelectField.js.map +1 -1
  274. package/dist/fields/config/OptionSelect.js +52 -0
  275. package/dist/fields/config/OptionSelect.js.map +1 -0
  276. package/dist/fields/config/SourceSelectField.js +16 -31
  277. package/dist/fields/config/SourceSelectField.js.map +1 -1
  278. package/dist/fields/config/fetchSources.d.ts +3 -0
  279. package/dist/fields/config/fetchSources.js +17 -23
  280. package/dist/fields/config/fetchSources.js.map +1 -1
  281. package/dist/fields/config/filterValues.js +106 -0
  282. package/dist/fields/config/filterValues.js.map +1 -0
  283. package/dist/fields/config/narrow.js +8 -10
  284. package/dist/fields/config/narrow.js.map +1 -1
  285. package/dist/fields/config/retiredPickers.d.ts +45 -0
  286. package/dist/fields/config/retiredPickers.js +46 -0
  287. package/dist/fields/config/retiredPickers.js.map +1 -0
  288. package/dist/fields/config/scopedFields.d.ts +40 -0
  289. package/dist/fields/config/scopedFields.js +68 -0
  290. package/dist/fields/config/scopedFields.js.map +1 -0
  291. package/dist/fields/config/sourcesState.js +19 -3
  292. package/dist/fields/config/sourcesState.js.map +1 -1
  293. package/dist/fields/config/toSelectOption.js +13 -7
  294. package/dist/fields/config/toSelectOption.js.map +1 -1
  295. package/dist/fields/config/useAnalyticsSources.d.ts +10 -7
  296. package/dist/fields/config/useAnalyticsSources.js +23 -24
  297. package/dist/fields/config/useAnalyticsSources.js.map +1 -1
  298. package/dist/fields/config/useFilterCapabilities.d.ts +31 -0
  299. package/dist/fields/config/useFilterCapabilities.js +60 -0
  300. package/dist/fields/config/useFilterCapabilities.js.map +1 -0
  301. package/dist/fields/config/useFormString.js +12 -0
  302. package/dist/fields/config/useFormString.js.map +1 -0
  303. package/dist/fields/dateRange/field.js +7 -19
  304. package/dist/fields/dateRange/field.js.map +1 -1
  305. package/dist/fields/dateRange/types.d.ts +5 -1
  306. package/dist/fields/dateRange/ui.d.ts +3 -2
  307. package/dist/fields/dateRange/ui.js +57 -319
  308. package/dist/fields/dateRange/ui.js.map +1 -1
  309. package/dist/fields/documentScope.js +21 -0
  310. package/dist/fields/documentScope.js.map +1 -0
  311. package/dist/fields/emptyState.js +30 -26
  312. package/dist/fields/emptyState.js.map +1 -1
  313. package/dist/fields/factories.d.ts +35 -16
  314. package/dist/fields/factories.js +67 -38
  315. package/dist/fields/factories.js.map +1 -1
  316. package/dist/fields/format.d.ts +12 -3
  317. package/dist/fields/format.js +77 -13
  318. package/dist/fields/format.js.map +1 -1
  319. package/dist/fields/itemReport.js +45 -0
  320. package/dist/fields/itemReport.js.map +1 -0
  321. package/dist/fields/readForDocument.d.ts +79 -26
  322. package/dist/fields/readForDocument.js +451 -105
  323. package/dist/fields/readForDocument.js.map +1 -1
  324. package/dist/fields/stateKeys.js +20 -0
  325. package/dist/fields/stateKeys.js.map +1 -0
  326. package/dist/goals/GoalAmountField.d.ts +10 -0
  327. package/dist/goals/GoalAmountField.js +179 -0
  328. package/dist/goals/GoalAmountField.js.map +1 -0
  329. package/dist/goals/GoalSelectField.js +89 -40
  330. package/dist/goals/GoalSelectField.js.map +1 -1
  331. package/dist/goals/GoalSelectFieldServer.d.ts +13 -0
  332. package/dist/goals/GoalSelectFieldServer.js +21 -0
  333. package/dist/goals/GoalSelectFieldServer.js.map +1 -0
  334. package/dist/goals/amountField.d.ts +20 -0
  335. package/dist/goals/amountField.js +37 -0
  336. package/dist/goals/amountField.js.map +1 -0
  337. package/dist/goals/builtin.js +17 -0
  338. package/dist/goals/builtin.js.map +1 -0
  339. package/dist/goals/collection.d.ts +22 -0
  340. package/dist/goals/collection.js +143 -124
  341. package/dist/goals/collection.js.map +1 -1
  342. package/dist/goals/constants.d.ts +38 -0
  343. package/dist/goals/constants.js +49 -0
  344. package/dist/goals/constants.js.map +1 -0
  345. package/dist/goals/currency.d.ts +16 -0
  346. package/dist/goals/currency.js +46 -4
  347. package/dist/goals/currency.js.map +1 -1
  348. package/dist/goals/currencyOptions.js +70 -0
  349. package/dist/goals/currencyOptions.js.map +1 -0
  350. package/dist/goals/fetchGoals.d.ts +10 -0
  351. package/dist/goals/fetchGoals.js +12 -22
  352. package/dist/goals/fetchGoals.js.map +1 -1
  353. package/dist/goals/goalField.d.ts +4 -6
  354. package/dist/goals/goalField.js +9 -19
  355. package/dist/goals/goalField.js.map +1 -1
  356. package/dist/goals/goalsEndpoint.js +40 -38
  357. package/dist/goals/goalsEndpoint.js.map +1 -1
  358. package/dist/goals/items.js +35 -0
  359. package/dist/goals/items.js.map +1 -0
  360. package/dist/goals/latent.js +9 -0
  361. package/dist/goals/latent.js.map +1 -0
  362. package/dist/goals/linkFields.d.ts +35 -0
  363. package/dist/goals/linkFields.js +31 -0
  364. package/dist/goals/linkFields.js.map +1 -0
  365. package/dist/goals/match.d.ts +14 -0
  366. package/dist/goals/match.js +67 -46
  367. package/dist/goals/match.js.map +1 -1
  368. package/dist/goals/moneyFields.js +56 -0
  369. package/dist/goals/moneyFields.js.map +1 -0
  370. package/dist/goals/pathMatch.js +122 -0
  371. package/dist/goals/pathMatch.js.map +1 -0
  372. package/dist/goals/placeholder.js +12 -0
  373. package/dist/goals/placeholder.js.map +1 -0
  374. package/dist/goals/resolver.d.ts +3 -3
  375. package/dist/goals/resolver.js +155 -47
  376. package/dist/goals/resolver.js.map +1 -1
  377. package/dist/goals/serverRevenue.d.ts +60 -0
  378. package/dist/goals/serverRevenue.js +41 -0
  379. package/dist/goals/serverRevenue.js.map +1 -0
  380. package/dist/goals/trackGoalAction.d.ts +26 -25
  381. package/dist/goals/trackGoalAction.js +71 -66
  382. package/dist/goals/trackGoalAction.js.map +1 -1
  383. package/dist/goals/types.d.ts +13 -28
  384. package/dist/goals/types.js +1 -1
  385. package/dist/goals/types.js.map +1 -1
  386. package/dist/goals/useAnalyticsGoals.d.ts +6 -5
  387. package/dist/goals/useAnalyticsGoals.js +17 -18
  388. package/dist/goals/useAnalyticsGoals.js.map +1 -1
  389. package/dist/index.d.ts +69 -11
  390. package/dist/index.js +262 -192
  391. package/dist/index.js.map +1 -1
  392. package/dist/items/collectionIdType.js +20 -0
  393. package/dist/items/collectionIdType.js.map +1 -0
  394. package/dist/items/idType.js +31 -0
  395. package/dist/items/idType.js.map +1 -0
  396. package/dist/items/ref.js +73 -0
  397. package/dist/items/ref.js.map +1 -0
  398. package/dist/maintenance/apiTaskState.js +141 -0
  399. package/dist/maintenance/apiTaskState.js.map +1 -0
  400. package/dist/maintenance/heartbeat.js +51 -0
  401. package/dist/maintenance/heartbeat.js.map +1 -0
  402. package/dist/maintenance/lease.d.ts +1 -0
  403. package/dist/maintenance/lease.js +79 -0
  404. package/dist/maintenance/lease.js.map +1 -0
  405. package/dist/maintenance/taskSchedule.js +27 -0
  406. package/dist/maintenance/taskSchedule.js.map +1 -0
  407. package/dist/maintenance/underLease.js +35 -0
  408. package/dist/maintenance/underLease.js.map +1 -0
  409. package/dist/migrations/legacy.d.ts +54 -0
  410. package/dist/migrations/legacy.js +117 -0
  411. package/dist/migrations/legacy.js.map +1 -0
  412. package/dist/migrations/predefined/dropLegacyMongo.d.ts +11 -0
  413. package/dist/migrations/predefined/dropLegacyMongo.js +12 -0
  414. package/dist/migrations/predefined/dropLegacyMongo.js.map +1 -0
  415. package/dist/native/collections/aggregates.js +54 -0
  416. package/dist/native/collections/aggregates.js.map +1 -0
  417. package/dist/native/collections/hits.js +103 -0
  418. package/dist/native/collections/hits.js.map +1 -0
  419. package/dist/native/collections/slugs.d.ts +10 -0
  420. package/dist/native/collections/slugs.js +16 -0
  421. package/dist/native/collections/slugs.js.map +1 -0
  422. package/dist/native/collections/state.js +84 -0
  423. package/dist/native/collections/state.js.map +1 -0
  424. package/dist/native/collections/storeCollection.js +31 -0
  425. package/dist/native/collections/storeCollection.js.map +1 -0
  426. package/dist/native/engine/buckets.d.ts +1 -0
  427. package/dist/native/engine/buckets.js +53 -0
  428. package/dist/native/engine/buckets.js.map +1 -0
  429. package/dist/native/engine/capabilities.js +87 -0
  430. package/dist/native/engine/capabilities.js.map +1 -0
  431. package/dist/native/engine/cost.js +72 -0
  432. package/dist/native/engine/cost.js.map +1 -0
  433. package/dist/native/engine/days.d.ts +1 -0
  434. package/dist/native/engine/days.js +182 -0
  435. package/dist/native/engine/days.js.map +1 -0
  436. package/dist/native/engine/engine.d.ts +1 -0
  437. package/dist/native/engine/engine.js +1627 -0
  438. package/dist/native/engine/engine.js.map +1 -0
  439. package/dist/native/engine/instance.js +58 -0
  440. package/dist/native/engine/instance.js.map +1 -0
  441. package/dist/native/engine/maintenance.d.ts +1 -0
  442. package/dist/native/engine/maintenance.js +677 -0
  443. package/dist/native/engine/maintenance.js.map +1 -0
  444. package/dist/native/engine/merge.js +41 -0
  445. package/dist/native/engine/merge.js.map +1 -0
  446. package/dist/native/engine/nudge.js +26 -0
  447. package/dist/native/engine/nudge.js.map +1 -0
  448. package/dist/native/engine/planner.js +199 -0
  449. package/dist/native/engine/planner.js.map +1 -0
  450. package/dist/native/engine/rebuild.d.ts +22 -0
  451. package/dist/native/engine/rebuild.js +76 -0
  452. package/dist/native/engine/rebuild.js.map +1 -0
  453. package/dist/native/engine/recent.js +17 -0
  454. package/dist/native/engine/recent.js.map +1 -0
  455. package/dist/native/engine/salt.d.ts +1 -0
  456. package/dist/native/engine/salt.js +98 -0
  457. package/dist/native/engine/salt.js.map +1 -0
  458. package/dist/native/engine/siteHosts.d.ts +1 -0
  459. package/dist/native/engine/siteHosts.js +58 -0
  460. package/dist/native/engine/siteHosts.js.map +1 -0
  461. package/dist/native/engine/toHit.js +110 -0
  462. package/dist/native/engine/toHit.js.map +1 -0
  463. package/dist/native/engine/writeBuffer.d.ts +14 -0
  464. package/dist/native/engine/writeBuffer.js +317 -0
  465. package/dist/native/engine/writeBuffer.js.map +1 -0
  466. package/dist/native/geo/composeGeoResolvers.d.ts +1 -0
  467. package/dist/native/geo/composeGeoResolvers.js +5 -2
  468. package/dist/native/geo/composeGeoResolvers.js.map +1 -1
  469. package/dist/native/geo/geoResolver.d.ts +27 -2
  470. package/dist/native/geo/geoResolver.js +42 -6
  471. package/dist/native/geo/geoResolver.js.map +1 -1
  472. package/dist/native/geo/maxmindResolver.d.ts +8 -4
  473. package/dist/native/geo/maxmindResolver.js +20 -16
  474. package/dist/native/geo/maxmindResolver.js.map +1 -1
  475. package/dist/native/geo/resolveGeo.js +31 -0
  476. package/dist/native/geo/resolveGeo.js.map +1 -0
  477. package/dist/native/ingest/bots.d.ts +10 -0
  478. package/dist/native/ingest/bots.js +66 -0
  479. package/dist/native/ingest/bots.js.map +1 -0
  480. package/dist/native/ingest/browser.js +45 -0
  481. package/dist/native/ingest/browser.js.map +1 -0
  482. package/dist/native/ingest/clientIp.js +34 -8
  483. package/dist/native/ingest/clientIp.js.map +1 -1
  484. package/dist/native/ingest/device.js +4 -6
  485. package/dist/native/ingest/device.js.map +1 -1
  486. package/dist/native/ingest/endpoint.d.ts +1 -1
  487. package/dist/native/ingest/endpoint.js +185 -32
  488. package/dist/native/ingest/endpoint.js.map +1 -1
  489. package/dist/native/ingest/itemSignature.d.ts +26 -0
  490. package/dist/native/ingest/itemSignature.js +45 -0
  491. package/dist/native/ingest/itemSignature.js.map +1 -0
  492. package/dist/native/ingest/language.js +13 -0
  493. package/dist/native/ingest/language.js.map +1 -0
  494. package/dist/native/ingest/normalizeEvent.d.ts +73 -5
  495. package/dist/native/ingest/normalizeEvent.js +257 -51
  496. package/dist/native/ingest/normalizeEvent.js.map +1 -1
  497. package/dist/native/ingest/orderSignature.d.ts +13 -0
  498. package/dist/native/ingest/orderSignature.js +50 -0
  499. package/dist/native/ingest/orderSignature.js.map +1 -0
  500. package/dist/native/ingest/referrer.js +46 -0
  501. package/dist/native/ingest/referrer.js.map +1 -0
  502. package/dist/native/ingest/requestHost.js +44 -0
  503. package/dist/native/ingest/requestHost.js.map +1 -0
  504. package/dist/native/ingest/resolveHostname.d.ts +20 -0
  505. package/dist/native/ingest/resolveHostname.js +51 -0
  506. package/dist/native/ingest/resolveHostname.js.map +1 -0
  507. package/dist/native/ingest/revenue.d.ts +1 -0
  508. package/dist/native/ingest/revenue.js +121 -0
  509. package/dist/native/ingest/revenue.js.map +1 -0
  510. package/dist/native/ingest/route.d.ts +10 -0
  511. package/dist/native/ingest/route.js +85 -0
  512. package/dist/native/ingest/route.js.map +1 -0
  513. package/dist/native/ingest/serverTrack.d.ts +2 -10
  514. package/dist/native/ingest/serverTrack.js +188 -68
  515. package/dist/native/ingest/serverTrack.js.map +1 -1
  516. package/dist/native/ingest/signature.js +28 -0
  517. package/dist/native/ingest/signature.js.map +1 -0
  518. package/dist/native/ingest/source.d.ts +10 -0
  519. package/dist/native/ingest/source.js +245 -16
  520. package/dist/native/ingest/source.js.map +1 -1
  521. package/dist/native/ingest/utm.js +33 -0
  522. package/dist/native/ingest/utm.js.map +1 -0
  523. package/dist/native/ingest/validate.js +25 -13
  524. package/dist/native/ingest/validate.js.map +1 -1
  525. package/dist/native/ingest/visitorHash.js +6 -8
  526. package/dist/native/ingest/visitorHash.js.map +1 -1
  527. package/dist/native/nativeAdapter.d.ts +128 -9
  528. package/dist/native/nativeAdapter.js +395 -281
  529. package/dist/native/nativeAdapter.js.map +1 -1
  530. package/dist/native/rebuildDays.d.ts +12 -0
  531. package/dist/native/rebuildDays.js +16 -0
  532. package/dist/native/rebuildDays.js.map +1 -0
  533. package/dist/native/store/aggregate.js +450 -0
  534. package/dist/native/store/aggregate.js.map +1 -0
  535. package/dist/native/store/caps.d.ts +18 -0
  536. package/dist/native/store/caps.js +76 -0
  537. package/dist/native/store/caps.js.map +1 -0
  538. package/dist/native/store/chunks.js +34 -0
  539. package/dist/native/store/chunks.js.map +1 -0
  540. package/dist/native/store/columnValues.js +31 -0
  541. package/dist/native/store/columnValues.js.map +1 -0
  542. package/dist/native/store/dialect.js +106 -0
  543. package/dist/native/store/dialect.js.map +1 -0
  544. package/dist/native/store/eventStore.js +44 -0
  545. package/dist/native/store/eventStore.js.map +1 -0
  546. package/dist/native/store/hitRow.js +119 -0
  547. package/dist/native/store/hitRow.js.map +1 -0
  548. package/dist/native/store/hits.js +65 -0
  549. package/dist/native/store/hits.js.map +1 -0
  550. package/dist/native/store/ids.js +105 -0
  551. package/dist/native/store/ids.js.map +1 -0
  552. package/dist/native/store/mongo/aggregatePipelines.js +438 -0
  553. package/dist/native/store/mongo/aggregatePipelines.js.map +1 -0
  554. package/dist/native/store/mongo/mongoState.js +375 -0
  555. package/dist/native/store/mongo/mongoState.js.map +1 -0
  556. package/dist/native/store/mongo/mongoStore.js +618 -0
  557. package/dist/native/store/mongo/mongoStore.js.map +1 -0
  558. package/dist/native/store/mongo/pipelines.js +705 -0
  559. package/dist/native/store/mongo/pipelines.js.map +1 -0
  560. package/dist/native/store/mongo/results.js +20 -0
  561. package/dist/native/store/mongo/results.js.map +1 -0
  562. package/dist/native/store/parts.d.ts +1 -0
  563. package/dist/native/store/parts.js +101 -0
  564. package/dist/native/store/parts.js.map +1 -0
  565. package/dist/native/store/pattern.js +213 -0
  566. package/dist/native/store/pattern.js.map +1 -0
  567. package/dist/native/store/rawRead.d.ts +23 -0
  568. package/dist/native/store/rawRead.js +387 -0
  569. package/dist/native/store/rawRead.js.map +1 -0
  570. package/dist/native/store/reclassify.js +53 -0
  571. package/dist/native/store/reclassify.js.map +1 -0
  572. package/dist/native/store/sql/aggregateSql.js +349 -0
  573. package/dist/native/store/sql/aggregateSql.js.map +1 -0
  574. package/dist/native/store/sql/columns.js +49 -0
  575. package/dist/native/store/sql/columns.js.map +1 -0
  576. package/dist/native/store/sql/compile.js +668 -0
  577. package/dist/native/store/sql/compile.js.map +1 -0
  578. package/dist/native/store/sql/drivers.js +218 -0
  579. package/dist/native/store/sql/drivers.js.map +1 -0
  580. package/dist/native/store/sql/executor.js +132 -0
  581. package/dist/native/store/sql/executor.js.map +1 -0
  582. package/dist/native/store/sql/fragment.js +104 -0
  583. package/dist/native/store/sql/fragment.js.map +1 -0
  584. package/dist/native/store/sql/maintenanceSql.js +59 -0
  585. package/dist/native/store/sql/maintenanceSql.js.map +1 -0
  586. package/dist/native/store/sql/ownConnection.js +107 -0
  587. package/dist/native/store/sql/ownConnection.js.map +1 -0
  588. package/dist/native/store/sql/poolShare.js +101 -0
  589. package/dist/native/store/sql/poolShare.js.map +1 -0
  590. package/dist/native/store/sql/sqlState.js +325 -0
  591. package/dist/native/store/sql/sqlState.js.map +1 -0
  592. package/dist/native/store/sql/sqlStore.js +355 -0
  593. package/dist/native/store/sql/sqlStore.js.map +1 -0
  594. package/dist/native/store/sql/sqliteThread.d.ts +9 -0
  595. package/dist/native/store/sql/sqliteThread.js +314 -0
  596. package/dist/native/store/sql/sqliteThread.js.map +1 -0
  597. package/dist/native/store/sql/sqliteWorker.js +327 -0
  598. package/dist/native/store/sql/sqliteWorker.js.map +1 -0
  599. package/dist/native/store/sql/sqliteWorkerSource.js +347 -0
  600. package/dist/native/store/sql/sqliteWorkerSource.js.map +1 -0
  601. package/dist/native/store/state.js +151 -0
  602. package/dist/native/store/state.js.map +1 -0
  603. package/dist/native/store/stateStore.js +29 -0
  604. package/dist/native/store/stateStore.js.map +1 -0
  605. package/dist/native/store/types.d.ts +15 -0
  606. package/dist/native/store/types.js +10 -0
  607. package/dist/native/store/types.js.map +1 -0
  608. package/dist/native/tasks/maintainTask.d.ts +19 -0
  609. package/dist/native/tasks/maintainTask.js +57 -0
  610. package/dist/native/tasks/maintainTask.js.map +1 -0
  611. package/dist/net/guardedFetch.d.ts +32 -0
  612. package/dist/net/guardedFetch.js +220 -0
  613. package/dist/net/guardedFetch.js.map +1 -0
  614. package/dist/net/origin.js +40 -0
  615. package/dist/net/origin.js.map +1 -0
  616. package/dist/net/platform.d.ts +9 -0
  617. package/dist/net/platform.js +35 -0
  618. package/dist/net/platform.js.map +1 -0
  619. package/dist/plugin/adminDependencies.js +34 -0
  620. package/dist/plugin/adminDependencies.js.map +1 -0
  621. package/dist/plugin/apiPath.js +23 -0
  622. package/dist/plugin/apiPath.js.map +1 -0
  623. package/dist/plugin/boundDocument.js +58 -0
  624. package/dist/plugin/boundDocument.js.map +1 -0
  625. package/dist/plugin/buildPhase.js +10 -0
  626. package/dist/plugin/buildPhase.js.map +1 -0
  627. package/dist/plugin/collectionChecks.js +232 -0
  628. package/dist/plugin/collectionChecks.js.map +1 -0
  629. package/dist/plugin/collectionFields.d.ts +13 -0
  630. package/dist/plugin/collectionFields.js +22 -0
  631. package/dist/plugin/collectionFields.js.map +1 -0
  632. package/dist/plugin/createRuntime.js +346 -0
  633. package/dist/plugin/createRuntime.js.map +1 -0
  634. package/dist/plugin/destroy.js +58 -0
  635. package/dist/plugin/destroy.js.map +1 -0
  636. package/dist/plugin/documentEndpoint.js +106 -53
  637. package/dist/plugin/documentEndpoint.js.map +1 -1
  638. package/dist/plugin/documentScopes.js +37 -0
  639. package/dist/plugin/documentScopes.js.map +1 -0
  640. package/dist/plugin/encrypted.js +25 -0
  641. package/dist/plugin/encrypted.js.map +1 -0
  642. package/dist/plugin/errors.d.ts +24 -0
  643. package/dist/plugin/errors.js +86 -0
  644. package/dist/plugin/errors.js.map +1 -0
  645. package/dist/plugin/flagsEndpoint.js +41 -0
  646. package/dist/plugin/flagsEndpoint.js.map +1 -0
  647. package/dist/plugin/goalHint.d.ts +1 -0
  648. package/dist/plugin/goalHint.js +35 -0
  649. package/dist/plugin/goalHint.js.map +1 -0
  650. package/dist/plugin/itemLabels.js +114 -0
  651. package/dist/plugin/itemLabels.js.map +1 -0
  652. package/dist/plugin/keepAlive.js +48 -0
  653. package/dist/plugin/keepAlive.js.map +1 -0
  654. package/dist/plugin/peerImportError.js +3 -6
  655. package/dist/plugin/peerImportError.js.map +1 -1
  656. package/dist/plugin/peers.js +64 -0
  657. package/dist/plugin/peers.js.map +1 -0
  658. package/dist/plugin/pluginCollections.js +161 -0
  659. package/dist/plugin/pluginCollections.js.map +1 -0
  660. package/dist/plugin/queryEndpoint.js +88 -52
  661. package/dist/plugin/queryEndpoint.js.map +1 -1
  662. package/dist/plugin/queryParams.js +7 -0
  663. package/dist/plugin/queryParams.js.map +1 -0
  664. package/dist/plugin/readContextForRequest.d.ts +11 -0
  665. package/dist/plugin/readContextForRequest.js +79 -32
  666. package/dist/plugin/readContextForRequest.js.map +1 -1
  667. package/dist/plugin/readFailure.js +22 -0
  668. package/dist/plugin/readFailure.js.map +1 -0
  669. package/dist/plugin/readableProviders.js +67 -0
  670. package/dist/plugin/readableProviders.js.map +1 -0
  671. package/dist/plugin/realtimeEndpoint.js +91 -21
  672. package/dist/plugin/realtimeEndpoint.js.map +1 -1
  673. package/dist/plugin/refreshEndpoint.js +138 -0
  674. package/dist/plugin/refreshEndpoint.js.map +1 -0
  675. package/dist/plugin/relabelFields.js +36 -0
  676. package/dist/plugin/relabelFields.js.map +1 -0
  677. package/dist/plugin/requestMemo.js +35 -0
  678. package/dist/plugin/requestMemo.js.map +1 -0
  679. package/dist/plugin/routeChecks.js +39 -0
  680. package/dist/plugin/routeChecks.js.map +1 -0
  681. package/dist/plugin/routes.d.ts +53 -0
  682. package/dist/plugin/routes.js +92 -0
  683. package/dist/plugin/routes.js.map +1 -0
  684. package/dist/plugin/runtime.d.ts +1 -1
  685. package/dist/plugin/runtime.js +235 -29
  686. package/dist/plugin/runtime.js.map +1 -1
  687. package/dist/plugin/schemaOnly.js +61 -0
  688. package/dist/plugin/schemaOnly.js.map +1 -0
  689. package/dist/plugin/scopeChange.js +23 -0
  690. package/dist/plugin/scopeChange.js.map +1 -0
  691. package/dist/plugin/scopeFieldBoot.js +4 -4
  692. package/dist/plugin/scopeFieldBoot.js.map +1 -1
  693. package/dist/plugin/scopeToken.js +33 -0
  694. package/dist/plugin/scopeToken.js.map +1 -0
  695. package/dist/plugin/sourcesEndpoint.js +50 -16
  696. package/dist/plugin/sourcesEndpoint.js.map +1 -1
  697. package/dist/plugin/unbundledLanguages.js +25 -0
  698. package/dist/plugin/unbundledLanguages.js.map +1 -0
  699. package/dist/plugin/walkFields.js +24 -0
  700. package/dist/plugin/walkFields.js.map +1 -0
  701. package/dist/plugin/warmTask.js +0 -0
  702. package/dist/plugin/warmTask.js.map +1 -1
  703. package/dist/providers/ProvidersListNotice.d.ts +11 -0
  704. package/dist/providers/ProvidersListNotice.js +36 -0
  705. package/dist/providers/ProvidersListNotice.js.map +1 -0
  706. package/dist/providers/access.d.ts +1 -0
  707. package/dist/providers/access.js +35 -26
  708. package/dist/providers/access.js.map +1 -1
  709. package/dist/providers/adapterPool.js +121 -0
  710. package/dist/providers/adapterPool.js.map +1 -0
  711. package/dist/providers/collection.d.ts +63 -0
  712. package/dist/providers/collection.js +372 -143
  713. package/dist/providers/collection.js.map +1 -1
  714. package/dist/providers/factory.d.ts +84 -0
  715. package/dist/providers/factory.js +86 -25
  716. package/dist/providers/factory.js.map +1 -1
  717. package/dist/providers/hosts.d.ts +25 -0
  718. package/dist/providers/hosts.js +128 -0
  719. package/dist/providers/hosts.js.map +1 -0
  720. package/dist/providers/probe.d.ts +1 -0
  721. package/dist/providers/probe.js +105 -0
  722. package/dist/providers/probe.js.map +1 -0
  723. package/dist/providers/refresh.d.ts +18 -0
  724. package/dist/providers/refresh.js +49 -0
  725. package/dist/providers/refresh.js.map +1 -0
  726. package/dist/providers/registry.js +329 -0
  727. package/dist/providers/registry.js.map +1 -0
  728. package/dist/providers/resolver.js +26 -88
  729. package/dist/providers/resolver.js.map +1 -1
  730. package/dist/providers/retarget.js +45 -0
  731. package/dist/providers/retarget.js.map +1 -0
  732. package/dist/providers/scopeUnique.js +41 -0
  733. package/dist/providers/scopeUnique.js.map +1 -0
  734. package/dist/providers/secrets.d.ts +26 -0
  735. package/dist/providers/secrets.js +61 -4
  736. package/dist/providers/secrets.js.map +1 -1
  737. package/dist/providers/stampScope.js +9 -6
  738. package/dist/providers/stampScope.js.map +1 -1
  739. package/dist/query/dates.js +10 -12
  740. package/dist/query/dates.js.map +1 -1
  741. package/dist/query/errors.d.ts +6 -13
  742. package/dist/query/fetchQuery.d.ts +36 -23
  743. package/dist/query/fetchQuery.js +96 -89
  744. package/dist/query/fetchQuery.js.map +1 -1
  745. package/dist/query/limits.js +8 -0
  746. package/dist/query/limits.js.map +1 -0
  747. package/dist/query/parse.d.ts +8 -2
  748. package/dist/query/parse.js +155 -108
  749. package/dist/query/parse.js.map +1 -1
  750. package/dist/query/response.d.ts +27 -4
  751. package/dist/query/response.js +18 -0
  752. package/dist/query/response.js.map +1 -0
  753. package/dist/react/AnalyticsProvider.d.ts +42 -20
  754. package/dist/react/AnalyticsProvider.js +24 -22
  755. package/dist/react/AnalyticsProvider.js.map +1 -1
  756. package/dist/react/TrackerBoot.js +15 -9
  757. package/dist/react/TrackerBoot.js.map +1 -1
  758. package/dist/react/useAnalytics.d.ts +2 -8
  759. package/dist/react/useAnalytics.js +31 -13
  760. package/dist/react/useAnalytics.js.map +1 -1
  761. package/dist/routes/captureRoute.d.ts +28 -0
  762. package/dist/routes/captureRoute.js +67 -0
  763. package/dist/routes/captureRoute.js.map +1 -0
  764. package/dist/routes/ingestRoute.d.ts +17 -0
  765. package/dist/routes/ingestRoute.js +17 -0
  766. package/dist/routes/ingestRoute.js.map +1 -0
  767. package/dist/site/AnalyticsScripts.d.ts +35 -0
  768. package/dist/site/AnalyticsScripts.js +44 -0
  769. package/dist/site/AnalyticsScripts.js.map +1 -0
  770. package/dist/site/getTrackerConfig.d.ts +15 -0
  771. package/dist/site/getTrackerConfig.js +43 -0
  772. package/dist/site/getTrackerConfig.js.map +1 -0
  773. package/dist/surfacing/afterRead.d.ts +37 -0
  774. package/dist/surfacing/bounded.js +38 -0
  775. package/dist/surfacing/bounded.js.map +1 -0
  776. package/dist/surfacing/breaker.js +107 -0
  777. package/dist/surfacing/breaker.js.map +1 -0
  778. package/dist/surfacing/cacheCollection.d.ts +8 -0
  779. package/dist/surfacing/cacheCollection.js +71 -0
  780. package/dist/surfacing/cacheCollection.js.map +1 -0
  781. package/dist/surfacing/cacheStore.d.ts +71 -1
  782. package/dist/surfacing/cacheStore.js +16 -37
  783. package/dist/surfacing/cacheStore.js.map +1 -1
  784. package/dist/surfacing/cacheSweep.d.ts +1 -0
  785. package/dist/surfacing/cacheSweep.js +59 -0
  786. package/dist/surfacing/cacheSweep.js.map +1 -0
  787. package/dist/surfacing/classifyError.js +282 -0
  788. package/dist/surfacing/classifyError.js.map +1 -0
  789. package/dist/surfacing/coalesce.js +2 -1
  790. package/dist/surfacing/coalesce.js.map +1 -1
  791. package/dist/surfacing/coldBudget.js +60 -0
  792. package/dist/surfacing/coldBudget.js.map +1 -0
  793. package/dist/surfacing/collectionCacheStore.js +183 -0
  794. package/dist/surfacing/collectionCacheStore.js.map +1 -0
  795. package/dist/surfacing/engine.d.ts +1 -1
  796. package/dist/surfacing/engine.js +514 -71
  797. package/dist/surfacing/engine.js.map +1 -1
  798. package/dist/surfacing/epoch.d.ts +1 -0
  799. package/dist/surfacing/epoch.js +116 -0
  800. package/dist/surfacing/epoch.js.map +1 -0
  801. package/dist/surfacing/lanes.d.ts +1 -0
  802. package/dist/surfacing/lanes.js +297 -0
  803. package/dist/surfacing/lanes.js.map +1 -0
  804. package/dist/surfacing/memo.js +40 -0
  805. package/dist/surfacing/memo.js.map +1 -0
  806. package/dist/surfacing/rateLimiter.d.ts +1 -0
  807. package/dist/surfacing/rateLimiter.js +69 -94
  808. package/dist/surfacing/rateLimiter.js.map +1 -1
  809. package/dist/surfacing/rebucket.js +178 -0
  810. package/dist/surfacing/rebucket.js.map +1 -0
  811. package/dist/surfacing/recipe.js +28 -0
  812. package/dist/surfacing/recipe.js.map +1 -0
  813. package/dist/surfacing/shape.js +22 -0
  814. package/dist/surfacing/shape.js.map +1 -0
  815. package/dist/surfacing/todaySplit.js +119 -0
  816. package/dist/surfacing/todaySplit.js.map +1 -0
  817. package/dist/sync/collection.d.ts +8 -0
  818. package/dist/sync/collection.js +30 -18
  819. package/dist/sync/collection.js.map +1 -1
  820. package/dist/sync/rekeyDurations.js +70 -0
  821. package/dist/sync/rekeyDurations.js.map +1 -0
  822. package/dist/sync/syncTask.js +222 -109
  823. package/dist/sync/syncTask.js.map +1 -1
  824. package/dist/testing/memoryAdapter.d.ts +6 -3
  825. package/dist/testing/memoryAdapter.js +12 -11
  826. package/dist/testing/memoryAdapter.js.map +1 -1
  827. package/dist/testing/settle.d.ts +11 -0
  828. package/dist/testing/settle.js +19 -0
  829. package/dist/testing/settle.js.map +1 -0
  830. package/dist/timeframe/calendar.js +65 -0
  831. package/dist/timeframe/calendar.js.map +1 -0
  832. package/dist/timeframe/comparison.js +46 -0
  833. package/dist/timeframe/comparison.js.map +1 -0
  834. package/dist/timeframe/presets.d.ts +1 -1
  835. package/dist/timeframe/presets.js +5 -5
  836. package/dist/timeframe/presets.js.map +1 -1
  837. package/dist/timeframe/reportingTimezone.d.ts +1 -0
  838. package/dist/timeframe/reportingTimezone.js +64 -0
  839. package/dist/timeframe/reportingTimezone.js.map +1 -0
  840. package/dist/timeframe/tz.js +55 -39
  841. package/dist/timeframe/tz.js.map +1 -1
  842. package/dist/tracker/autoCapture.js +125 -38
  843. package/dist/tracker/autoCapture.js.map +1 -1
  844. package/dist/tracker/campaign.js +52 -0
  845. package/dist/tracker/campaign.js.map +1 -0
  846. package/dist/tracker/config.d.ts +174 -0
  847. package/dist/tracker/config.js +25 -0
  848. package/dist/tracker/config.js.map +1 -0
  849. package/dist/tracker/createTracker.d.ts +5 -10
  850. package/dist/tracker/createTracker.js +437 -82
  851. package/dist/tracker/createTracker.js.map +1 -1
  852. package/dist/tracker/digest.js +28 -0
  853. package/dist/tracker/digest.js.map +1 -0
  854. package/dist/tracker/engagement.js +100 -0
  855. package/dist/tracker/engagement.js.map +1 -0
  856. package/dist/tracker/events.js +37 -0
  857. package/dist/tracker/events.js.map +1 -0
  858. package/dist/tracker/exclusion.d.ts +8 -0
  859. package/dist/tracker/exclusion.js +82 -0
  860. package/dist/tracker/exclusion.js.map +1 -0
  861. package/dist/tracker/gate.d.ts +8 -0
  862. package/dist/tracker/gate.js +244 -0
  863. package/dist/tracker/gate.js.map +1 -0
  864. package/dist/tracker/initTracker.d.ts +5 -8
  865. package/dist/tracker/initTracker.js +42 -14
  866. package/dist/tracker/initTracker.js.map +1 -1
  867. package/dist/tracker/itemCapture.js +224 -0
  868. package/dist/tracker/itemCapture.js.map +1 -0
  869. package/dist/tracker/loadScript.js +23 -15
  870. package/dist/tracker/loadScript.js.map +1 -1
  871. package/dist/tracker/pageTracking.js +6 -6
  872. package/dist/tracker/pageTracking.js.map +1 -1
  873. package/dist/tracker/registry.js +129 -30
  874. package/dist/tracker/registry.js.map +1 -1
  875. package/dist/tracker/sinks/createSink.js +60 -0
  876. package/dist/tracker/sinks/createSink.js.map +1 -0
  877. package/dist/tracker/sinks/ga4.js +106 -0
  878. package/dist/tracker/sinks/ga4.js.map +1 -0
  879. package/dist/tracker/sinks/native.js +21 -42
  880. package/dist/tracker/sinks/native.js.map +1 -1
  881. package/dist/tracker/sinks/plausible.js +36 -18
  882. package/dist/tracker/sinks/plausible.js.map +1 -1
  883. package/dist/tracker/sinks/posthog.js +145 -9
  884. package/dist/tracker/sinks/posthog.js.map +1 -1
  885. package/dist/tracker/sinks/umami.js +18 -10
  886. package/dist/tracker/sinks/umami.js.map +1 -1
  887. package/dist/tracker/sinks/vendor.js +54 -22
  888. package/dist/tracker/sinks/vendor.js.map +1 -1
  889. package/dist/tracker/skip.js +81 -0
  890. package/dist/tracker/skip.js.map +1 -0
  891. package/dist/tracker/storage.js +23 -0
  892. package/dist/tracker/storage.js.map +1 -0
  893. package/dist/tracker/transport.js +2 -5
  894. package/dist/tracker/transport.js.map +1 -1
  895. package/dist/tracker/types.d.ts +99 -44
  896. package/dist/tracker/window.js +7 -0
  897. package/dist/tracker/window.js.map +1 -0
  898. package/dist/translations/ar.js +266 -56
  899. package/dist/translations/ar.js.map +1 -1
  900. package/dist/translations/de.js +256 -55
  901. package/dist/translations/de.js.map +1 -1
  902. package/dist/translations/en.js +253 -56
  903. package/dist/translations/en.js.map +1 -1
  904. package/dist/translations/es.js +261 -57
  905. package/dist/translations/es.js.map +1 -1
  906. package/dist/translations/fr.js +265 -61
  907. package/dist/translations/fr.js.map +1 -1
  908. package/dist/translations/id.js +256 -56
  909. package/dist/translations/id.js.map +1 -1
  910. package/dist/translations/index.d.ts +1 -1
  911. package/dist/translations/index.js +5 -7
  912. package/dist/translations/index.js.map +1 -1
  913. package/dist/translations/intl.js +71 -0
  914. package/dist/translations/intl.js.map +1 -0
  915. package/dist/translations/keys.d.ts +240 -14
  916. package/dist/translations/keys.js +245 -14
  917. package/dist/translations/keys.js.map +1 -1
  918. package/dist/translations/ko.js +258 -58
  919. package/dist/translations/ko.js.map +1 -1
  920. package/dist/translations/labelMap.d.ts +10 -0
  921. package/dist/translations/labelMap.js +22 -0
  922. package/dist/translations/labelMap.js.map +1 -0
  923. package/dist/translations/metricKeys.js +16 -2
  924. package/dist/translations/metricKeys.js.map +1 -1
  925. package/dist/translations/parts.js +20 -0
  926. package/dist/translations/parts.js.map +1 -0
  927. package/dist/translations/plural.js +61 -0
  928. package/dist/translations/plural.js.map +1 -0
  929. package/dist/translations/pt.js +270 -66
  930. package/dist/translations/pt.js.map +1 -1
  931. package/dist/translations/ru.js +261 -55
  932. package/dist/translations/ru.js.map +1 -1
  933. package/dist/translations/server.d.ts +1 -0
  934. package/dist/translations/server.js +2 -3
  935. package/dist/translations/server.js.map +1 -1
  936. package/dist/translations/staticLabel.js +69 -0
  937. package/dist/translations/staticLabel.js.map +1 -0
  938. package/dist/translations/uk.js +261 -55
  939. package/dist/translations/uk.js.map +1 -1
  940. package/dist/translations/zh.js +256 -56
  941. package/dist/translations/zh.js.map +1 -1
  942. package/dist/ui/RangePicker.js +110 -0
  943. package/dist/ui/RangePicker.js.map +1 -0
  944. package/dist/ui/analytics.css +1667 -0
  945. package/dist/ui/calendarDays.js +27 -0
  946. package/dist/ui/calendarDays.js.map +1 -0
  947. package/dist/ui/classNames.js +7 -0
  948. package/dist/ui/classNames.js.map +1 -0
  949. package/dist/ui/components/Card.d.ts +28 -0
  950. package/dist/ui/components/Card.js +21 -0
  951. package/dist/ui/components/Card.js.map +1 -0
  952. package/dist/ui/components/ChartDataTable.d.ts +41 -0
  953. package/dist/ui/components/ChartDataTable.js +48 -0
  954. package/dist/ui/components/ChartDataTable.js.map +1 -0
  955. package/dist/ui/components/ChoiceMenu.js +48 -0
  956. package/dist/ui/components/ChoiceMenu.js.map +1 -0
  957. package/dist/ui/components/DataTable.d.ts +82 -0
  958. package/dist/ui/components/DataTable.js +214 -0
  959. package/dist/ui/components/DataTable.js.map +1 -0
  960. package/dist/ui/components/LabeledSelect.js +62 -0
  961. package/dist/ui/components/LabeledSelect.js.map +1 -0
  962. package/dist/ui/components/LiveAnnouncement.js +21 -0
  963. package/dist/ui/components/LiveAnnouncement.js.map +1 -0
  964. package/dist/ui/components/MetricCard.d.ts +38 -0
  965. package/dist/ui/components/MetricCard.js +39 -0
  966. package/dist/ui/components/MetricCard.js.map +1 -0
  967. package/dist/ui/components/NoValue.js +22 -0
  968. package/dist/ui/components/NoValue.js.map +1 -0
  969. package/dist/ui/components/ReadState.js +27 -0
  970. package/dist/ui/components/ReadState.js.map +1 -0
  971. package/dist/ui/components/RefreshButton.js +25 -0
  972. package/dist/ui/components/RefreshButton.js.map +1 -0
  973. package/dist/ui/components/SourcesNoticeBanner.js +20 -0
  974. package/dist/ui/components/SourcesNoticeBanner.js.map +1 -0
  975. package/dist/ui/cssVars.js +7 -0
  976. package/dist/ui/cssVars.js.map +1 -0
  977. package/dist/ui/data/WithScopeToken.d.ts +20 -0
  978. package/dist/ui/data/WithScopeToken.js +20 -0
  979. package/dist/ui/data/WithScopeToken.js.map +1 -0
  980. package/dist/ui/data/clientFieldProps.js +16 -0
  981. package/dist/ui/data/clientFieldProps.js.map +1 -0
  982. package/dist/ui/data/request.d.ts +46 -0
  983. package/dist/ui/data/request.js +119 -0
  984. package/dist/ui/data/request.js.map +1 -0
  985. package/dist/ui/data/scopeTokenContext.js +18 -0
  986. package/dist/ui/data/scopeTokenContext.js.map +1 -0
  987. package/dist/ui/data/sharedCache.js +48 -0
  988. package/dist/ui/data/sharedCache.js.map +1 -0
  989. package/dist/ui/data/useRequest.d.ts +19 -0
  990. package/dist/ui/data/useRequest.js +123 -0
  991. package/dist/ui/data/useRequest.js.map +1 -0
  992. package/dist/ui/data/useRequestScope.js +25 -0
  993. package/dist/ui/data/useRequestScope.js.map +1 -0
  994. package/dist/ui/hooks/useDirection.js +47 -0
  995. package/dist/ui/hooks/useDirection.js.map +1 -0
  996. package/dist/ui/hooks/useDismissOnEscape.js +25 -0
  997. package/dist/ui/hooks/useDismissOnEscape.js.map +1 -0
  998. package/dist/ui/hooks/useLiveAnnouncement.js +57 -0
  999. package/dist/ui/hooks/useLiveAnnouncement.js.map +1 -0
  1000. package/dist/ui/hooks/useRealtimePoll.js +112 -0
  1001. package/dist/ui/hooks/useRealtimePoll.js.map +1 -0
  1002. package/dist/ui/readState.js +19 -0
  1003. package/dist/ui/readState.js.map +1 -0
  1004. package/dist/ui/rows/toDisplayRows.js +49 -0
  1005. package/dist/ui/rows/toDisplayRows.js.map +1 -0
  1006. package/dist/ui/viewerClock.js +7 -0
  1007. package/dist/ui/viewerClock.js.map +1 -0
  1008. package/dist/view/AnalyticsNavLink.d.ts +5 -3
  1009. package/dist/view/AnalyticsNavLink.js +12 -8
  1010. package/dist/view/AnalyticsNavLink.js.map +1 -1
  1011. package/dist/view/AnalyticsView.d.ts +9 -10
  1012. package/dist/view/AnalyticsView.js +47 -19
  1013. package/dist/view/AnalyticsView.js.map +1 -1
  1014. package/dist/view/AnalyticsViewClient.d.ts +4 -7
  1015. package/dist/view/AnalyticsViewClient.js +15 -174
  1016. package/dist/view/AnalyticsViewClient.js.map +1 -1
  1017. package/dist/view/CountryFlag.d.ts +27 -0
  1018. package/dist/view/CountryFlag.js +44 -0
  1019. package/dist/view/CountryFlag.js.map +1 -0
  1020. package/dist/view/DocumentTitle.js +27 -0
  1021. package/dist/view/DocumentTitle.js.map +1 -0
  1022. package/dist/view/ViewRoot.d.ts +21 -0
  1023. package/dist/view/ViewRoot.js +155 -0
  1024. package/dist/view/ViewRoot.js.map +1 -0
  1025. package/dist/view/ViewSections.d.ts +38 -0
  1026. package/dist/view/ViewSections.js +190 -0
  1027. package/dist/view/ViewSections.js.map +1 -0
  1028. package/dist/view/authRedirect.js +2 -4
  1029. package/dist/view/authRedirect.js.map +1 -1
  1030. package/dist/view/consentShare.js +15 -0
  1031. package/dist/view/consentShare.js.map +1 -0
  1032. package/dist/view/conversionRate.js +9 -7
  1033. package/dist/view/conversionRate.js.map +1 -1
  1034. package/dist/view/dayRange.js +6 -10
  1035. package/dist/view/dayRange.js.map +1 -1
  1036. package/dist/view/exclusionLink.d.ts +27 -0
  1037. package/dist/view/exclusionLink.js +46 -0
  1038. package/dist/view/exclusionLink.js.map +1 -0
  1039. package/dist/view/flagSrc.js +14 -0
  1040. package/dist/view/flagSrc.js.map +1 -0
  1041. package/dist/view/gating.d.ts +15 -1
  1042. package/dist/view/gating.js +92 -20
  1043. package/dist/view/gating.js.map +1 -1
  1044. package/dist/view/hostCountryFlag.js +41 -0
  1045. package/dist/view/hostCountryFlag.js.map +1 -0
  1046. package/dist/view/labels.js +120 -3
  1047. package/dist/view/labels.js.map +1 -1
  1048. package/dist/view/metricAliases.js +10 -0
  1049. package/dist/view/metricAliases.js.map +1 -0
  1050. package/dist/view/navLabel.js +15 -0
  1051. package/dist/view/navLabel.js.map +1 -0
  1052. package/dist/view/registerView.js +13 -11
  1053. package/dist/view/registerView.js.map +1 -1
  1054. package/dist/view/scopeLabel.js +21 -0
  1055. package/dist/view/scopeLabel.js.map +1 -0
  1056. package/dist/view/sections/Breakdowns.js +221 -118
  1057. package/dist/view/sections/Breakdowns.js.map +1 -1
  1058. package/dist/view/sections/EmptyStates.js +120 -32
  1059. package/dist/view/sections/EmptyStates.js.map +1 -1
  1060. package/dist/view/sections/ExcludeBrowser.js +188 -0
  1061. package/dist/view/sections/ExcludeBrowser.js.map +1 -0
  1062. package/dist/view/sections/FilterChips.js +130 -25
  1063. package/dist/view/sections/FilterChips.js.map +1 -1
  1064. package/dist/view/sections/GoalsPanel.js +68 -59
  1065. package/dist/view/sections/GoalsPanel.js.map +1 -1
  1066. package/dist/view/sections/OverviewCards.js +42 -36
  1067. package/dist/view/sections/OverviewCards.js.map +1 -1
  1068. package/dist/view/sections/RealtimeStrip.js +70 -56
  1069. package/dist/view/sections/RealtimeStrip.js.map +1 -1
  1070. package/dist/view/sections/SectionBoundary.js +34 -0
  1071. package/dist/view/sections/SectionBoundary.js.map +1 -0
  1072. package/dist/view/sections/Toolbar.d.ts +11 -0
  1073. package/dist/view/sections/Toolbar.js +182 -116
  1074. package/dist/view/sections/Toolbar.js.map +1 -1
  1075. package/dist/view/sections/Trend.js +179 -73
  1076. package/dist/view/sections/Trend.js.map +1 -1
  1077. package/dist/view/state.d.ts +42 -0
  1078. package/dist/view/state.js +97 -53
  1079. package/dist/view/state.js.map +1 -1
  1080. package/dist/view/useViewClock.js +31 -0
  1081. package/dist/view/useViewClock.js.map +1 -0
  1082. package/dist/view/useViewQueries.d.ts +21 -0
  1083. package/dist/view/useViewQueries.js +50 -79
  1084. package/dist/view/useViewQueries.js.map +1 -1
  1085. package/dist/view/useViewState.js +42 -0
  1086. package/dist/view/useViewState.js.map +1 -0
  1087. package/dist/view/useViewUrl.js +52 -0
  1088. package/dist/view/useViewUrl.js.map +1 -0
  1089. package/dist/view/viewBody.js +30 -0
  1090. package/dist/view/viewBody.js.map +1 -0
  1091. package/dist/view/viewContext.d.ts +81 -0
  1092. package/dist/view/viewContext.js +49 -0
  1093. package/dist/view/viewContext.js.map +1 -0
  1094. package/dist/view/viewProps.d.ts +65 -8
  1095. package/dist/view/viewProps.js +123 -36
  1096. package/dist/view/viewProps.js.map +1 -1
  1097. package/dist/widgets/AnalyticsBreakdownWidget.d.ts +7 -3
  1098. package/dist/widgets/AnalyticsBreakdownWidget.js +153 -78
  1099. package/dist/widgets/AnalyticsBreakdownWidget.js.map +1 -1
  1100. package/dist/widgets/AnalyticsGoalsWidget.d.ts +6 -7
  1101. package/dist/widgets/AnalyticsGoalsWidget.js +126 -159
  1102. package/dist/widgets/AnalyticsGoalsWidget.js.map +1 -1
  1103. package/dist/widgets/AnalyticsMetricWidget.d.ts +7 -3
  1104. package/dist/widgets/AnalyticsMetricWidget.js +85 -83
  1105. package/dist/widgets/AnalyticsMetricWidget.js.map +1 -1
  1106. package/dist/widgets/AnalyticsRealtimeWidget.d.ts +7 -3
  1107. package/dist/widgets/AnalyticsRealtimeWidget.js +81 -61
  1108. package/dist/widgets/AnalyticsRealtimeWidget.js.map +1 -1
  1109. package/dist/widgets/AnalyticsTrendWidget.d.ts +7 -3
  1110. package/dist/widgets/AnalyticsTrendWidget.js +134 -100
  1111. package/dist/widgets/AnalyticsTrendWidget.js.map +1 -1
  1112. package/dist/widgets/ComparisonDelta.js +33 -42
  1113. package/dist/widgets/ComparisonDelta.js.map +1 -1
  1114. package/dist/widgets/RealtimeCounter.d.ts +27 -3
  1115. package/dist/widgets/RealtimeCounter.js +90 -62
  1116. package/dist/widgets/RealtimeCounter.js.map +1 -1
  1117. package/dist/widgets/WidgetCard.d.ts +80 -0
  1118. package/dist/widgets/WidgetCard.js +99 -0
  1119. package/dist/widgets/WidgetCard.js.map +1 -0
  1120. package/dist/widgets/WidgetFrame.js +42 -0
  1121. package/dist/widgets/WidgetFrame.js.map +1 -0
  1122. package/dist/widgets/WidgetShimmer.d.ts +55 -0
  1123. package/dist/widgets/WidgetShimmer.js +86 -0
  1124. package/dist/widgets/WidgetShimmer.js.map +1 -0
  1125. package/dist/widgets/breakdownTypes.js +18 -2
  1126. package/dist/widgets/breakdownTypes.js.map +1 -1
  1127. package/dist/widgets/customWidget.d.ts +5 -1
  1128. package/dist/widgets/customWidget.js +6 -7
  1129. package/dist/widgets/customWidget.js.map +1 -1
  1130. package/dist/widgets/defaultLayout.d.ts +26 -0
  1131. package/dist/widgets/defaultLayout.js +51 -0
  1132. package/dist/widgets/defaultLayout.js.map +1 -0
  1133. package/dist/widgets/defaults.d.ts +4 -3
  1134. package/dist/widgets/defaults.js +76 -24
  1135. package/dist/widgets/defaults.js.map +1 -1
  1136. package/dist/widgets/fieldRows.js +14 -0
  1137. package/dist/widgets/fieldRows.js.map +1 -0
  1138. package/dist/widgets/filterCaption.js +26 -0
  1139. package/dist/widgets/filterCaption.js.map +1 -0
  1140. package/dist/widgets/filterField.d.ts +15 -0
  1141. package/dist/widgets/filterField.js +86 -0
  1142. package/dist/widgets/filterField.js.map +1 -0
  1143. package/dist/widgets/filterValueLabel.d.ts +1 -0
  1144. package/dist/widgets/filterValueLabel.js +45 -0
  1145. package/dist/widgets/filterValueLabel.js.map +1 -0
  1146. package/dist/widgets/notices.js +79 -0
  1147. package/dist/widgets/notices.js.map +1 -0
  1148. package/dist/widgets/prepareWidgetRead.d.ts +24 -0
  1149. package/dist/widgets/prepareWidgetRead.js +110 -0
  1150. package/dist/widgets/prepareWidgetRead.js.map +1 -0
  1151. package/dist/widgets/range.js +26 -21
  1152. package/dist/widgets/range.js.map +1 -1
  1153. package/dist/widgets/readForWidget.d.ts +32 -13
  1154. package/dist/widgets/readForWidget.js +52 -63
  1155. package/dist/widgets/readForWidget.js.map +1 -1
  1156. package/dist/widgets/readForWidgetBreakdown.d.ts +45 -18
  1157. package/dist/widgets/readForWidgetBreakdown.js +71 -58
  1158. package/dist/widgets/readForWidgetBreakdown.js.map +1 -1
  1159. package/dist/widgets/readForWidgetGoals.d.ts +21 -17
  1160. package/dist/widgets/readForWidgetGoals.js +72 -52
  1161. package/dist/widgets/readForWidgetGoals.js.map +1 -1
  1162. package/dist/widgets/readForWidgetRealtime.d.ts +24 -11
  1163. package/dist/widgets/readForWidgetRealtime.js +69 -41
  1164. package/dist/widgets/readForWidgetRealtime.js.map +1 -1
  1165. package/dist/widgets/readForWidgetSeries.d.ts +29 -24
  1166. package/dist/widgets/readForWidgetSeries.js +66 -114
  1167. package/dist/widgets/readForWidgetSeries.js.map +1 -1
  1168. package/dist/widgets/readMeta.d.ts +48 -0
  1169. package/dist/widgets/readMeta.js +66 -0
  1170. package/dist/widgets/readMeta.js.map +1 -0
  1171. package/dist/widgets/realtimePoll.d.ts +1 -0
  1172. package/dist/widgets/realtimePoll.js +56 -16
  1173. package/dist/widgets/realtimePoll.js.map +1 -1
  1174. package/dist/widgets/registerWidgets.js +207 -124
  1175. package/dist/widgets/registerWidgets.js.map +1 -1
  1176. package/dist/widgets/stateKeys.js +30 -0
  1177. package/dist/widgets/stateKeys.js.map +1 -0
  1178. package/dist/widgets/titleForecast.js +89 -0
  1179. package/dist/widgets/titleForecast.js.map +1 -0
  1180. package/dist/widgets/types.d.ts +16 -0
  1181. package/dist/widgets/types.js +2 -0
  1182. package/dist/widgets/types.js.map +1 -1
  1183. package/dist/widgets/viewLink.d.ts +24 -6
  1184. package/dist/widgets/viewLink.js +36 -26
  1185. package/dist/widgets/viewLink.js.map +1 -1
  1186. package/dist/widgets/widgetData.js +34 -0
  1187. package/dist/widgets/widgetData.js.map +1 -0
  1188. package/dist/widgets/widgetWindow.d.ts +1 -0
  1189. package/dist/widgets/widgetWindow.js +51 -0
  1190. package/dist/widgets/widgetWindow.js.map +1 -0
  1191. package/package.json +61 -42
  1192. package/dist/capture/getTrackerConfig.d.ts +0 -20
  1193. package/dist/capture/getTrackerConfig.js +0 -31
  1194. package/dist/capture/getTrackerConfig.js.map +0 -1
  1195. package/dist/capture/slots.d.ts +0 -8
  1196. package/dist/capture/trackerConfig.d.ts +0 -33
  1197. package/dist/charts/styles.js +0 -59
  1198. package/dist/charts/styles.js.map +0 -1
  1199. package/dist/exports/next.d.ts +0 -3
  1200. package/dist/exports/next.js +0 -3
  1201. package/dist/fields/config/SourceSelectField.d.ts +0 -14
  1202. package/dist/fields/dateRange/styles.js +0 -23
  1203. package/dist/fields/dateRange/styles.js.map +0 -1
  1204. package/dist/goals/GoalSelectField.d.ts +0 -7
  1205. package/dist/native/collections/events.js +0 -121
  1206. package/dist/native/collections/events.js.map +0 -1
  1207. package/dist/native/collections/rollups.js +0 -151
  1208. package/dist/native/collections/rollups.js.map +0 -1
  1209. package/dist/native/collections/seen.js +0 -47
  1210. package/dist/native/collections/seen.js.map +0 -1
  1211. package/dist/native/ingest/flushBatch.js +0 -60
  1212. package/dist/native/ingest/flushBatch.js.map +0 -1
  1213. package/dist/native/ingest/salt.js +0 -14
  1214. package/dist/native/ingest/salt.js.map +0 -1
  1215. package/dist/native/ingest/writeBuffer.js +0 -55
  1216. package/dist/native/ingest/writeBuffer.js.map +0 -1
  1217. package/dist/native/ingest/writeEvent.js +0 -14
  1218. package/dist/native/ingest/writeEvent.js.map +0 -1
  1219. package/dist/native/query/eventAgg.js +0 -161
  1220. package/dist/native/query/eventAgg.js.map +0 -1
  1221. package/dist/native/realtime/buildRealtime.js +0 -53
  1222. package/dist/native/realtime/buildRealtime.js.map +0 -1
  1223. package/dist/native/retention/pruneTask.js +0 -29
  1224. package/dist/native/retention/pruneTask.js.map +0 -1
  1225. package/dist/native/rollupAcc.js +0 -64
  1226. package/dist/native/rollupAcc.js.map +0 -1
  1227. package/dist/native/rollups/applyDistinctDeltas.js +0 -9
  1228. package/dist/native/rollups/applyDistinctDeltas.js.map +0 -1
  1229. package/dist/native/rollups/bumpRollup.js +0 -73
  1230. package/dist/native/rollups/bumpRollup.js.map +0 -1
  1231. package/dist/native/rollups/deltas.js +0 -90
  1232. package/dist/native/rollups/deltas.js.map +0 -1
  1233. package/dist/native/rollups/insertIfNew.js +0 -53
  1234. package/dist/native/rollups/insertIfNew.js.map +0 -1
  1235. package/dist/next/captureRewrites.d.ts +0 -41
  1236. package/dist/next/captureRewrites.js +0 -56
  1237. package/dist/next/captureRewrites.js.map +0 -1
  1238. package/dist/next/posthogProxyRewrites.d.ts +0 -41
  1239. package/dist/next/posthogProxyRewrites.js +0 -45
  1240. package/dist/next/posthogProxyRewrites.js.map +0 -1
  1241. package/dist/plugin/paths.js +0 -27
  1242. package/dist/plugin/paths.js.map +0 -1
  1243. package/dist/query/errors.js +0 -10
  1244. package/dist/query/errors.js.map +0 -1
  1245. package/dist/react/TrackerBoot.d.ts +0 -22
  1246. package/dist/rsc/AnalyticsScripts.d.ts +0 -30
  1247. package/dist/rsc/AnalyticsScripts.js +0 -41
  1248. package/dist/rsc/AnalyticsScripts.js.map +0 -1
  1249. package/dist/surfacing/queue.js +0 -60
  1250. package/dist/surfacing/queue.js.map +0 -1
  1251. package/dist/surfacing/retryPolicy.js +0 -15
  1252. package/dist/surfacing/retryPolicy.js.map +0 -1
  1253. package/dist/tracker/autoCapture.d.ts +0 -48
  1254. package/dist/tracker/consent.d.ts +0 -24
  1255. package/dist/tracker/consent.js +0 -48
  1256. package/dist/tracker/consent.js.map +0 -1
  1257. package/dist/tracker/loadScript.d.ts +0 -14
  1258. package/dist/tracker/pageTracking.d.ts +0 -17
  1259. package/dist/tracker/registry.d.ts +0 -27
  1260. package/dist/tracker/sinks/native.d.ts +0 -22
  1261. package/dist/tracker/sinks/plausible.d.ts +0 -14
  1262. package/dist/tracker/sinks/posthog.d.ts +0 -14
  1263. package/dist/tracker/sinks/umami.d.ts +0 -13
  1264. package/dist/tracker/sinks/vendor.d.ts +0 -14
  1265. package/dist/view/sections/styles.js +0 -74
  1266. package/dist/view/sections/styles.js.map +0 -1
  1267. package/dist/widgets/WidgetViewLink.js +0 -17
  1268. package/dist/widgets/WidgetViewLink.js.map +0 -1
  1269. package/dist/widgets/cardChrome.d.ts +0 -8
  1270. package/dist/widgets/cardChrome.js +0 -46
  1271. package/dist/widgets/cardChrome.js.map +0 -1
  1272. package/dist/widgets/comparison.js +0 -43
  1273. package/dist/widgets/comparison.js.map +0 -1
@@ -1,24 +1,37 @@
1
+ import { CurrencyConverter } from "../goals/currency.js";
1
2
  import { Goal } from "../goals/types.js";
3
+ import { BrowserAmounts, OrderSignatureMode } from "../goals/match.js";
4
+ import { TrustedPlatform } from "../net/platform.js";
5
+ import { RoutePaths } from "../plugin/routes.js";
2
6
  import { CaptureSupport } from "./capture.js";
3
- import { ServerTrack } from "./serverEvent.js";
4
- import { Config, PayloadRequest } from "payload";
7
+ import { AdapterJobs, AnalyticsTaskName, ScheduledTask } from "./jobs.js";
8
+ import { AnalyticsSdks } from "./sdks.js";
9
+ import { IngestHostnameResolver, ServerTrack } from "./serverEvent.js";
10
+ import { Config, Payload, PayloadRequest } from "payload";
5
11
 
6
12
  //#region src/core/contract.d.ts
7
13
  /**
8
14
  * Explicit cross-scope read marker: pass as a read's `scope` to aggregate over every
9
- * scope. Gated by `access.platformRead`; the query reaches the adapter unscoped.
15
+ * scope. Gated by `access.crossScope.aggregate`; the query reaches the adapter unscoped.
10
16
  */
11
17
  declare const PLATFORM_SCOPE = "*";
12
- type MetricKey = 'pageviews' | 'visitors' | 'visits' | 'sessions' | 'bounceRate' | 'avgDuration' | 'scrollDepth' | 'events' | 'conversions' | 'revenue';
13
- /** Every breakdown key the contract defines; the registry request parsers validate against. */
14
- declare const DIMENSION_KEYS: readonly ["page", "referrer", "source", "medium", "campaign", "utmSource", "utmMedium", "utmCampaign", "utmContent", "utmTerm", "device", "browser", "os", "country", "region", "city", "language", "event", "goal"];
18
+ type MetricKey = 'pageviews' | 'visitors' | 'visits' | 'sessions' | 'bounceRate' /** Time on page: engaged time per pageview, an average in milliseconds over the pageviews it is read for. */ | 'avgDuration' /** Time per visit: engaged time per visit, an average in milliseconds over the visits it is read for. */ | 'visitDuration' | 'scrollDepth' | 'events' | 'conversions' | 'revenue' /** Times a content item was seen on screen. Counted per item only, never per page or site. */ | 'impressions' /** Clicks on a content item, the first per item and pageview. */ | 'interactions';
19
+ /**
20
+ * One metric's reading. `null` is an average or a share with nothing to average over (no
21
+ * pageviews to time, no scroll reported, no sessions to bounce): no data, not zero.
22
+ */
23
+ type MetricValue = number | null;
24
+ /** A row's or a read's metrics. A metric the source did not report is absent. */
25
+ type MetricValues = Partial<Record<MetricKey, MetricValue>>;
26
+ /** Every breakdown key the contract defines, the list request parsers validate against. */
27
+ declare const DIMENSION_KEYS: readonly ["page", "referrer", "source", "channel", "medium", "campaign", "utmSource", "utmMedium", "utmCampaign", "utmContent", "utmTerm", "device", "browser", "os", "country", "region", "city", "language", "event", "goal", "currency", "item"];
15
28
  type DimensionKey = (typeof DIMENSION_KEYS)[number];
16
29
  type Granularity = 'minute' | 'hour' | 'day' | 'week' | 'month';
17
30
  interface DateRange {
18
31
  start: Date;
19
32
  end: Date;
20
33
  }
21
- /** Every filter operator the contract defines; the registry request parsers validate against. */
34
+ /** Every filter operator the contract defines, the list request parsers validate against. */
22
35
  declare const FILTER_OPERATORS: readonly ["eq", "contains", "matches"];
23
36
  type FilterOperator = (typeof FILTER_OPERATORS)[number];
24
37
  interface AnalyticsFilter {
@@ -29,128 +42,406 @@ interface AnalyticsFilter {
29
42
  interface AnalyticsQuery {
30
43
  path?: string;
31
44
  hostname?: string;
45
+ /**
46
+ * One content item's ref (`<collection>:<id>`): the read answers about that item, wherever
47
+ * it was shown. Only a source declaring `capabilities.perItemQuery` can serve it.
48
+ */
49
+ item?: string;
32
50
  metrics: MetricKey[];
33
51
  dimensions?: DimensionKey[];
34
52
  dateRange: DateRange;
35
53
  granularity?: Granularity;
36
54
  filters?: AnalyticsFilter[];
37
55
  limit?: number;
56
+ /**
57
+ * How a breakdown is ranked before `limit` cuts it. The metric belongs in `metrics`: ranked by
58
+ * one the read did not ask for, rows keep the source's order.
59
+ */
38
60
  order?: {
39
61
  metric: MetricKey;
40
62
  direction: 'asc' | 'desc';
41
63
  };
42
64
  /**
43
- * Analytics boundary this read belongs to (tenant id, site key). Undefined means
44
- * install-wide (the default). Adapters that can filter by scope apply it; others
45
- * ignore it. Always part of the surfacing cache key, so per-scope adapter
46
- * instances sharing an id never share cached results.
65
+ * Analytics boundary of the read (tenant id, site key); undefined means install-wide. Adapters
66
+ * that can filter by scope apply it, and it is always part of the cache key.
47
67
  */
48
68
  scope?: string;
49
69
  /**
50
- * IANA reporting timezone the read's day boundaries are aligned to. Undefined
51
- * means UTC. Adapters that can bucket in a timezone apply it (PostHog, Umami);
52
- * others report in their own account timezone. Part of the cache key when set.
70
+ * IANA timezone the read's day boundaries align to; undefined means UTC. Adapters that can bucket
71
+ * in a zone apply it, others report in their account's own.
53
72
  */
54
73
  timezone?: string;
74
+ /**
75
+ * The scope's goal slugs, which provider adapters restrict goal rows to (native matches goals
76
+ * itself). `'unresolved'` marks a failed goal resolver and never shares a healthy cache key.
77
+ */
78
+ goalSlugs?: string[] | 'unresolved';
55
79
  }
56
80
  interface AnalyticsRow {
57
81
  dimensions?: Partial<Record<DimensionKey, string>>;
58
- metrics: Partial<Record<MetricKey, number>>;
82
+ metrics: MetricValues;
59
83
  timestamp?: string;
84
+ /**
85
+ * How many observations each average in `metrics` was taken over, which folds days into weeks
86
+ * exactly. An average without one is weighted by its row's matching count.
87
+ */
88
+ samples?: Partial<Record<MetricKey, number>>;
60
89
  }
90
+ /** How a read's `visitors` were counted. */
91
+ type VisitorCounting = 'distinct' | 'sumOfDaily';
92
+ /** Why a stale answer's source needs a look: its settings were refused, or its host is not allowed. */
93
+ type SourceErrorKind = 'misconfigured' | 'host-refused';
61
94
  interface AnalyticsResult {
62
95
  rows: AnalyticsRow[];
63
- totals?: Partial<Record<MetricKey, number>>;
96
+ totals?: MetricValues;
64
97
  meta: {
65
- provider: string;
66
- sampled?: boolean;
67
- clamped?: boolean;
68
- fetchedAt: string; /** Served from an expired cache entry because the live refresh failed. */
98
+ provider: string; /** The source counted from a sample of its data (GA4 on a large property), so the numbers are estimates. */
99
+ sampled?: boolean; /** The read covers less than it asked for: from `dataFrom` and up to `dataTo`, where set. */
100
+ clamped?: boolean; /** ISO instant the data starts at, set with `clamped` when later than the range's start. */
101
+ dataFrom?: string;
102
+ /**
103
+ * ISO instant the data ends at, set with `clamped` when earlier than the range's end: a day
104
+ * the range cuts lies past raw retention in a scope's own zone.
105
+ */
106
+ dataTo?: string;
107
+ /**
108
+ * `distinct` counts each person once per number; `sumOfDaily` means some number adds up daily
109
+ * visitors, so a person who came on two days counts twice.
110
+ */
111
+ visitorsAre?: VisitorCounting; /** Some days of the range could not be read yet, so the numbers are a floor. */
112
+ partial?: {
113
+ missingDays: number;
114
+ };
115
+ /**
116
+ * On this many days of the range a value the read asks about was folded into the `(other)`
117
+ * row of its daily totals, and its raw hits are no longer kept: the numbers are a floor.
118
+ */
119
+ capped?: {
120
+ days: number;
121
+ };
122
+ /**
123
+ * On this many days of the range counting failed again and again and was given up: each is
124
+ * read from an earlier count when it had one, and left out otherwise.
125
+ */
126
+ failed?: {
127
+ days: number;
128
+ };
129
+ /**
130
+ * The scope's reporting timezone could not be resolved and none was ever recorded, so this
131
+ * read cut its days in UTC and counted nothing for later reads.
132
+ */
133
+ timezoneUnresolved?: true; /** ISO instant the numbers were last brought up to date, when older than `fetchedAt`. */
134
+ asOf?: string;
135
+ /**
136
+ * ISO instant the source was read (`ctx.now`), never later than the engine got the answer; a
137
+ * cached answer keeps it.
138
+ */
139
+ fetchedAt: string;
140
+ /**
141
+ * ISO 4217 code `revenue` is reported in: the vendor's own, else the install's
142
+ * `revenue.currency` or the read's `currency` filter. Absent, revenue is a plain sum as sent.
143
+ */
144
+ currency?: string;
145
+ /**
146
+ * The currencies the read's revenue adds unconverted amounts of, when more than one. Native
147
+ * sets it.
148
+ */
149
+ mixedCurrencies?: string[];
150
+ /**
151
+ * Served from a cache entry past its TTL: at once while a refresh runs, or because the refresh
152
+ * failed. `asOf` then says when the entry was fetched.
153
+ */
69
154
  stale?: boolean;
155
+ /**
156
+ * Set on a stale answer whose source last failed as set up rather than as an outage:
157
+ * credentials refused (`misconfigured`) or host not allowed (`host-refused`).
158
+ */
159
+ sourceError?: SourceErrorKind;
160
+ /**
161
+ * Filters the source could not carry, so the rows are wider than the query asked for.
162
+ * A provider whose API takes one value per dimension reports the ones it dropped here.
163
+ */
164
+ unappliedFilters?: AnalyticsFilter[];
165
+ /**
166
+ * The read's goal numbers are absent because resolving them failed. A scope with no goals gets
167
+ * an empty result instead, not this flag.
168
+ */
169
+ goalsUnresolved?: true;
170
+ /**
171
+ * Pageviews of the read counted without consent, at a cookieless or anonymous level, which
172
+ * the view shows as a share of all pageviews. Absent when the source cannot tell or found none.
173
+ */
174
+ withoutConsent?: {
175
+ pageviews: number;
176
+ };
177
+ /**
178
+ * Pageviews of the read recorded without a visitor (native's anonymous level): they count as
179
+ * pageviews, and toward no visitor, visit, bounce rate or time.
180
+ */
181
+ withoutVisitor?: {
182
+ pageviews: number;
183
+ };
184
+ /**
185
+ * The vendor drops what a slot counts without consent, so those visits are missing from every
186
+ * number: PostHog with its project's cookieless tracking setting off.
187
+ */
188
+ withoutConsentDropped?: true;
70
189
  };
71
190
  }
191
+ /**
192
+ * The vendor's limits the source's lane keeps to, one token per upstream request per window. A read
193
+ * with conversions may cost a second, goal-filtered request.
194
+ */
72
195
  interface RateLimitDescriptor {
73
196
  requestsPerMinute?: number;
74
197
  requestsPerHour?: number;
198
+ /** Upstream requests the source may have in flight; `cache.concurrency.perSource` when unset. */
75
199
  maxConcurrent?: number;
200
+ /** Whether reads also spend the provider's write or ingest quota. */
201
+ readsCountAsUsage?: boolean;
202
+ }
203
+ /**
204
+ * Which operators each dimension can be filtered with. A dimension absent here, or listed with
205
+ * no operator, cannot be filtered at all.
206
+ */
207
+ type FilterOperatorMap = Partial<Record<DimensionKey, readonly FilterOperator[]>>;
208
+ /** Where a source reads one metric, when it cannot read it under every breakdown it offers. */
209
+ interface MetricReach {
76
210
  /**
77
- * Describes the provider's quota model for documentation; the limiter always
78
- * throttles by request count regardless of this value.
211
+ * The breakdowns the metric is read under; empty when only whole-site numbers carry it.
212
+ * Absent: every dimension the source declares.
79
213
  */
80
- quotaModel?: 'requests' | 'tokens';
81
- /** Documents whether reads consume the provider's write/ingest quota too. */
82
- readsCountAsUsage?: boolean;
214
+ dimensions?: readonly DimensionKey[];
215
+ /**
216
+ * A dimension the read must break down or filter by for the metric to have a value at all.
217
+ * A read of one page (`AnalyticsQuery.path`) counts as filtering by `page`.
218
+ */
219
+ requires?: DimensionKey;
220
+ }
221
+ /** What the numbers of a source mean where sources differ. */
222
+ interface MetricSemantics {
223
+ /**
224
+ * `distinct` counts each person once over a range; `sumOfDaily` adds up each day's visitors.
225
+ * Either may be per hostname: native's visitor id is, so two hostnames add up.
226
+ */
227
+ visitors: VisitorCounting;
228
+ /** `inactivity30m` ends a visit after 30 minutes without activity; `provider` is the vendor's own rule. */
229
+ sessions: 'inactivity30m' | 'provider';
83
230
  }
84
231
  interface AnalyticsCapabilities {
85
- perPageQuery: boolean;
232
+ /** The source answers `AnalyticsQuery.item`: one content item's views, clicks and outcomes. */
233
+ perItemQuery?: boolean;
86
234
  realtime: boolean;
87
235
  realtimeWindowMinutes?: number;
88
- comparison: boolean;
236
+ /**
237
+ * Period-over-period comparison, which the engine serves for every source by reading the
238
+ * previous window itself. Adapters omit this; set it false only to opt a source out.
239
+ */
240
+ comparison?: boolean;
89
241
  minGranularity: Granularity;
242
+ /**
243
+ * The source answers `week` and `month` series itself, exactly. Without it the engine reads
244
+ * days and folds them into weeks and months in the read's reporting timezone.
245
+ */
246
+ calendarBuckets?: boolean;
90
247
  maxLookbackDays: number | null;
248
+ /**
249
+ * How far back a filtered read reaches, when that is shorter than `maxLookbackDays`: the
250
+ * source narrows a longer one itself and marks it `clamped`. Absent or null: as far as any read.
251
+ */
252
+ filterLookbackDays?: number | null;
91
253
  metrics: ReadonlySet<MetricKey>;
92
254
  dimensions: ReadonlySet<DimensionKey>;
93
- /** Dimensions the adapter can apply AnalyticsQuery.filters on; empty = filters unsupported. */
94
- filters: ReadonlySet<DimensionKey>;
95
- /** Operators the adapter honors in filters; adapters ignore filters whose operator they lack. */
96
- filterOperators: ReadonlySet<FilterOperator>;
97
- batchPageReport: boolean;
255
+ /**
256
+ * Metrics the source reads only under some breakdowns or only for a page; any other is read under
257
+ * every dimension. Reads outside a metric's reach are refused and hidden by pickers.
258
+ */
259
+ metricReach?: Partial<Record<MetricKey, MetricReach>>;
260
+ /**
261
+ * The `AnalyticsQuery.filters` the source applies, per dimension. A read carrying any other
262
+ * pair is refused before it reaches the adapter. Absent: no filter at all.
263
+ */
264
+ filters?: FilterOperatorMap;
265
+ /** What `visitors` and `sessions` mean here. Absent: not declared. */
266
+ semantics?: MetricSemantics;
98
267
  rateLimit: RateLimitDescriptor | null;
268
+ /**
269
+ * Seconds an answer stays fresh. `today`, for a source cheap to read again, caps a window that
270
+ * reaches into the current day whatever `cache.ttl` says; such an answer is never served stale.
271
+ */
99
272
  recommendedTtl: {
100
273
  realtime: number;
101
274
  aggregate: number;
275
+ today?: number;
102
276
  };
103
277
  /**
104
- * The adapter applies `AnalyticsQuery.scope` as a provider-native filter (native
105
- * scope column, PostHog `scopeProperty`, ...). Without it, a scoped read through
106
- * a shared platform adapter would expose cross-scope data, so such reads are
107
- * gated by `access.platformRead`.
278
+ * The adapter applies `AnalyticsQuery.scope` as a native filter. Without it a scoped read through
279
+ * a shared adapter would see other scopes, so it is gated by `access.crossScope.unscopedSource`.
108
280
  */
109
281
  scopedQueries?: boolean;
282
+ /**
283
+ * The adapter sends every vendor request through `AdapterContext.upstream`, so each one spends
284
+ * its own rate token and slot. Without it the engine counts a whole read as one request.
285
+ */
286
+ upstreamAware?: boolean;
110
287
  }
111
288
  interface AdapterContext {
112
289
  signal?: AbortSignal;
290
+ /**
291
+ * The Payload instance the read is for, which the surfacing engine always passes. An adapter
292
+ * that stores its data in Payload's database reads through it.
293
+ */
294
+ payload?: Payload;
295
+ /**
296
+ * Sends one vendor request through the source's lane: rate token, slot, retries on outage,
297
+ * circuit breaker. Absent outside the engine, where `fn(ctx.signal)` is called directly.
298
+ */
299
+ upstream?: <T>(fn: (signal?: AbortSignal) => Promise<T>) => Promise<T>;
300
+ /**
301
+ * Milliseconds the read has left before it gives up, for a vendor SDK that takes a deadline of
302
+ * its own rather than a signal. Absent outside the engine.
303
+ */
304
+ remainingMs?: () => number;
305
+ /**
306
+ * What time it is by the plugin's clock (Payload's), which an adapter stamps `meta.fetchedAt`
307
+ * with. The engine always passes it; absent outside the engine.
308
+ */
309
+ now?: () => Date;
113
310
  }
114
311
  /** Extra context the plugin hands adapters when they register config surface. */
115
312
  interface AdapterRegisterContext {
116
- /** True when the plugin has a scopeResolver configured. */
313
+ /** True when the plugin has `scope.resolve` configured. */
117
314
  scoped: boolean;
118
- /** The plugin's scopeResolver bound for adapter use (e.g. ingest stamping). */
315
+ /**
316
+ * `scope.resolve` at the `capture` call site, for ingest stamping: the host's resolver sees no
317
+ * user, cookies or authorization header, so a hit files under the site it landed on.
318
+ */
119
319
  resolveScope: (req: PayloadRequest) => Promise<string | null>;
120
320
  /**
121
- * The plugin's reportingTimezone bound for adapter use (e.g. bucketing native
122
- * rollups at ingest). Resolves to `'UTC'` when no reportingTimezone is set.
321
+ * The plugin's reportingTimezone bound for adapter use, for what is shown in it. Resolves to
322
+ * `'UTC'` when no reportingTimezone is set, and when the host's resolver fails.
123
323
  */
124
324
  resolveTimezone: (req: PayloadRequest, scope?: string | null) => Promise<string>;
125
325
  /**
126
- * The install's goals for a request's scope, for adapters that match completions
127
- * themselves (the native engine, at ingest). Config goals, with the goals collection
128
- * merged over them per scope once the install enables it.
326
+ * The same timezone, thrown rather than falling back to UTC: for an adapter storing days counted
327
+ * in it, where recounting a day in UTC would move its numbers.
328
+ */
329
+ resolveTimezoneStrict: (req: PayloadRequest, scope?: string | null) => Promise<string>;
330
+ /** The install's `revenue` settings, for adapters that declare or reconcile revenue. */
331
+ revenue: {
332
+ enabled: boolean;
333
+ dimension: boolean; /** `revenue.currency` bound for adapter use: `undefined` when none is set, revenue a plain number. */
334
+ currency: (req: PayloadRequest, scope?: string | null) => Promise<string | undefined>; /** `revenue.convert`, for adapters that reconcile revenue at ingest. */
335
+ convert?: CurrencyConverter; /** `revenue.browserAmounts`, for an adapter that takes amounts from the browser itself. */
336
+ browserAmounts?: BrowserAmounts; /** `revenue.orderSignature`, for an adapter that takes the browser's order ids. */
337
+ orderSignature?: OrderSignatureMode;
338
+ };
339
+ /**
340
+ * The install's goals for a request's scope (config goals, the collection's merged over them),
341
+ * for adapters that match completions themselves.
129
342
  */
130
343
  resolveGoals: (req: PayloadRequest, scope?: string | null) => Promise<Goal[]>;
344
+ /**
345
+ * Whether a scope's own provider documents grant it this adapter; present only when the providers
346
+ * collection runs under `scope.resolve`. Native ingest stores nothing for a scope it denies.
347
+ */
348
+ adapterGrantedForScope?: (req: PayloadRequest, scope: string | null, adapterId: string) => Promise<boolean>;
349
+ /** The plugin's `trustedProxyHops`, for adapters that read a request's client address. */
350
+ trustedProxyHops?: number;
351
+ /**
352
+ * The plugin's `trustedPlatform`, for adapters that read a request's client address or
353
+ * location: the only platform whose edge headers may be believed.
354
+ */
355
+ trustedPlatform?: TrustedPlatform;
356
+ /**
357
+ * `capture.allowedOrigins`, normalized, for adapters that register a public POST endpoint: the
358
+ * only other sites whose pages may send to it from a visitor's browser.
359
+ */
360
+ allowedOrigins?: ReadonlySet<string>;
361
+ /**
362
+ * False when this adapter fills no slot `capture.gate` holds that can count without consent, as
363
+ * far as the boot can tell, so it need not check its vendor accepts such events. Absent reads as
364
+ * true.
365
+ */
366
+ adapterCountsWithoutConsent?: boolean;
367
+ /**
368
+ * The collections bound as content items, the only ones whose refs ingest keeps, and whether
369
+ * an item is also counted per page it appeared on. Absent means no item is bound.
370
+ */
371
+ items?: {
372
+ collections: ReadonlySet<string>;
373
+ pages: boolean;
374
+ };
375
+ /** The plugin's mounts under `routes.api`, for adapters that register an endpoint of their own. */
376
+ routes?: RoutePaths;
377
+ /**
378
+ * The packages the host handed the plugin as `sdks`, for adapters that would otherwise load
379
+ * them at runtime: GA4's Data API client, the native engine's MaxMind reader.
380
+ */
381
+ sdks?: AnalyticsSdks;
382
+ /**
383
+ * The plugin's `jobs`: the queue and schedule of the maintenance task an adapter registers, or
384
+ * false when the install registers no task and the adapter's own requests do that work instead.
385
+ */
386
+ jobs?: AdapterJobs;
387
+ /** Says something at init, once the instance can log: what the boot warns about rather than refuses. */
388
+ notice?: (message: string) => void;
389
+ }
390
+ /** What a switched-off install hands an adapter that keeps its schema (`disabled: true`). */
391
+ interface AdapterSchemaContext {
392
+ /** The plugin's `jobs`, which decides whether the adapter's task slug is in the jobs enum. */
393
+ jobs: AdapterJobs;
394
+ /** What the boot would warn about, which a switched-off install never says. */
395
+ notice?: (message: string) => void;
396
+ }
397
+ /** Whom a source's label is read for: the request, and the scope its sources were listed for. */
398
+ interface AdapterLabelArgs {
399
+ req: PayloadRequest;
400
+ /** Null is install-wide, `*` is cross-scope. */
401
+ scope: string | null;
131
402
  }
132
403
  interface AnalyticsAdapter {
133
404
  readonly id: string;
405
+ /** The source's name wherever no reader is known (boot-time pickers, logs). */
134
406
  readonly label: string;
407
+ /**
408
+ * The source's name for one reader, where it differs by language or by who reads. Read through
409
+ * `sourceLabelFor`, which falls back to `label` when this fails.
410
+ */
411
+ readonly labelFor?: (args: AdapterLabelArgs) => string | Promise<string>;
135
412
  readonly capabilities: AnalyticsCapabilities;
136
- /** Browser-tracker proxying/boot descriptor. Absent when the adapter has no client-side script (GA4). */
413
+ /** Browser-tracker proxying/boot descriptor. Absent when no public capture field is set. */
137
414
  readonly capture?: CaptureSupport;
138
415
  /**
139
- * Where this adapter's own ingest endpoint listens, relative to `routes.api`, for the
140
- * adapters that register one (the native engine), and how server code reaches the same
141
- * pipeline without an HTTP round trip. Server-side only: the tracker learns the path
142
- * from `TrackerConfig.ingestPath`, and this object is never serialized.
416
+ * Where the adapter's own ingest endpoint listens, relative to `routes.api`, and how server code
417
+ * reaches that pipeline directly. Server-side only, never serialized.
143
418
  */
144
419
  readonly ingest?: {
145
420
  path: string;
146
421
  track?: ServerTrack;
422
+ hostname?: IngestHostnameResolver;
147
423
  };
148
424
  isConfigured(): boolean;
149
425
  query(query: AnalyticsQuery, ctx: AdapterContext): Promise<AnalyticsResult>;
150
426
  realtime?(query: AnalyticsQuery, ctx: AdapterContext): Promise<AnalyticsResult>;
151
427
  register?(config: Config, context?: AdapterRegisterContext): void;
428
+ /**
429
+ * For `disabled: true`: adds exactly the schema `register` would (collections, fields, indexes,
430
+ * task slugs) and nothing that runs, so a switched-off install keeps its tables.
431
+ */
432
+ registerSchema?(config: Config, context: AdapterSchemaContext): void;
433
+ /**
434
+ * Binds the adapter to the Payload instance a runtime is built for, whenever one is, with or
435
+ * without `onInit`. Called again for every rebuild, so it must be idempotent per instance.
436
+ */
437
+ attach?(payload: Payload): void;
438
+ /**
439
+ * Releases what the adapter holds for one instance (buffers, clients, timers) once that
440
+ * instance's runtime is retired; another instance the adapter serves keeps what it holds.
441
+ */
442
+ close?(payload: Payload): void | Promise<void>;
152
443
  }
153
444
  type AnalyticsAdapterFactory<Config> = (config: Config) => AnalyticsAdapter;
154
445
  //#endregion
155
- export { AdapterContext, AdapterRegisterContext, AnalyticsAdapter, AnalyticsAdapterFactory, AnalyticsCapabilities, AnalyticsFilter, AnalyticsQuery, AnalyticsResult, AnalyticsRow, DIMENSION_KEYS, DateRange, DimensionKey, FILTER_OPERATORS, FilterOperator, Granularity, MetricKey, PLATFORM_SCOPE, RateLimitDescriptor };
446
+ export { AdapterContext, AdapterLabelArgs, AdapterRegisterContext, AdapterSchemaContext, AnalyticsAdapter, AnalyticsAdapterFactory, AnalyticsCapabilities, AnalyticsFilter, AnalyticsQuery, AnalyticsResult, AnalyticsRow, DIMENSION_KEYS, DateRange, DimensionKey, FILTER_OPERATORS, FilterOperator, FilterOperatorMap, Granularity, MetricKey, MetricReach, MetricSemantics, MetricValue, MetricValues, PLATFORM_SCOPE, RateLimitDescriptor, SourceErrorKind, VisitorCounting };
156
447
  //# sourceMappingURL=contract.d.ts.map
@@ -1,14 +1,15 @@
1
1
  //#region src/core/contract.ts
2
2
  /**
3
3
  * Explicit cross-scope read marker: pass as a read's `scope` to aggregate over every
4
- * scope. Gated by `access.platformRead`; the query reaches the adapter unscoped.
4
+ * scope. Gated by `access.crossScope.aggregate`; the query reaches the adapter unscoped.
5
5
  */
6
6
  const PLATFORM_SCOPE = "*";
7
- /** Every breakdown key the contract defines; the registry request parsers validate against. */
7
+ /** Every breakdown key the contract defines, the list request parsers validate against. */
8
8
  const DIMENSION_KEYS = [
9
9
  "page",
10
10
  "referrer",
11
11
  "source",
12
+ "channel",
12
13
  "medium",
13
14
  "campaign",
14
15
  "utmSource",
@@ -24,9 +25,11 @@ const DIMENSION_KEYS = [
24
25
  "city",
25
26
  "language",
26
27
  "event",
27
- "goal"
28
+ "goal",
29
+ "currency",
30
+ "item"
28
31
  ];
29
- /** Every filter operator the contract defines; the registry request parsers validate against. */
32
+ /** Every filter operator the contract defines, the list request parsers validate against. */
30
33
  const FILTER_OPERATORS = [
31
34
  "eq",
32
35
  "contains",
@@ -1 +1 @@
1
- {"version":3,"file":"contract.js","names":[],"sources":["../../src/core/contract.ts"],"sourcesContent":["import type { Config, PayloadRequest } from 'payload'\nimport type { Goal } from '../goals/types'\nimport type { CaptureSupport } from './capture'\nimport type { ServerTrack } from './serverEvent'\n\n/**\n * Explicit cross-scope read marker: pass as a read's `scope` to aggregate over every\n * scope. Gated by `access.platformRead`; the query reaches the adapter unscoped.\n */\nexport const PLATFORM_SCOPE = '*'\n\nexport type MetricKey =\n\t| 'pageviews'\n\t| 'visitors'\n\t| 'visits'\n\t| 'sessions'\n\t| 'bounceRate'\n\t| 'avgDuration'\n\t| 'scrollDepth'\n\t| 'events'\n\t| 'conversions'\n\t| 'revenue'\n\n/** Every breakdown key the contract defines; the registry request parsers validate against. */\nexport const DIMENSION_KEYS = [\n\t'page',\n\t'referrer',\n\t'source',\n\t'medium',\n\t'campaign',\n\t'utmSource',\n\t'utmMedium',\n\t'utmCampaign',\n\t'utmContent',\n\t'utmTerm',\n\t'device',\n\t'browser',\n\t'os',\n\t'country',\n\t'region',\n\t'city',\n\t'language',\n\t'event',\n\t'goal',\n] as const\n\nexport type DimensionKey = (typeof DIMENSION_KEYS)[number]\n\nexport type Granularity = 'minute' | 'hour' | 'day' | 'week' | 'month'\n\nexport interface DateRange {\n\tstart: Date\n\tend: Date\n}\n\n/** Every filter operator the contract defines; the registry request parsers validate against. */\nexport const FILTER_OPERATORS = ['eq', 'contains', 'matches'] as const\n\nexport type FilterOperator = (typeof FILTER_OPERATORS)[number]\n\nexport interface AnalyticsFilter {\n\tdimension: DimensionKey\n\toperator: FilterOperator\n\tvalue: string\n}\n\nexport interface AnalyticsQuery {\n\tpath?: string\n\thostname?: string\n\tmetrics: MetricKey[]\n\tdimensions?: DimensionKey[]\n\tdateRange: DateRange\n\tgranularity?: Granularity\n\tfilters?: AnalyticsFilter[]\n\tlimit?: number\n\torder?: { metric: MetricKey; direction: 'asc' | 'desc' }\n\t/**\n\t * Analytics boundary this read belongs to (tenant id, site key). Undefined means\n\t * install-wide (the default). Adapters that can filter by scope apply it; others\n\t * ignore it. Always part of the surfacing cache key, so per-scope adapter\n\t * instances sharing an id never share cached results.\n\t */\n\tscope?: string\n\t/**\n\t * IANA reporting timezone the read's day boundaries are aligned to. Undefined\n\t * means UTC. Adapters that can bucket in a timezone apply it (PostHog, Umami);\n\t * others report in their own account timezone. Part of the cache key when set.\n\t */\n\ttimezone?: string\n}\n\nexport interface AnalyticsRow {\n\tdimensions?: Partial<Record<DimensionKey, string>>\n\tmetrics: Partial<Record<MetricKey, number>>\n\ttimestamp?: string\n}\n\nexport interface AnalyticsResult {\n\trows: AnalyticsRow[]\n\ttotals?: Partial<Record<MetricKey, number>>\n\tmeta: {\n\t\tprovider: string\n\t\tsampled?: boolean\n\t\tclamped?: boolean\n\t\tfetchedAt: string\n\t\t/** Served from an expired cache entry because the live refresh failed. */\n\t\tstale?: boolean\n\t}\n}\n\nexport interface RateLimitDescriptor {\n\trequestsPerMinute?: number\n\trequestsPerHour?: number\n\tmaxConcurrent?: number\n\t/**\n\t * Describes the provider's quota model for documentation; the limiter always\n\t * throttles by request count regardless of this value.\n\t */\n\tquotaModel?: 'requests' | 'tokens'\n\t/** Documents whether reads consume the provider's write/ingest quota too. */\n\treadsCountAsUsage?: boolean\n}\n\nexport interface AnalyticsCapabilities {\n\tperPageQuery: boolean\n\trealtime: boolean\n\trealtimeWindowMinutes?: number\n\tcomparison: boolean\n\tminGranularity: Granularity\n\tmaxLookbackDays: number | null\n\tmetrics: ReadonlySet<MetricKey>\n\tdimensions: ReadonlySet<DimensionKey>\n\t/** Dimensions the adapter can apply AnalyticsQuery.filters on; empty = filters unsupported. */\n\tfilters: ReadonlySet<DimensionKey>\n\t/** Operators the adapter honors in filters; adapters ignore filters whose operator they lack. */\n\tfilterOperators: ReadonlySet<FilterOperator>\n\tbatchPageReport: boolean\n\trateLimit: RateLimitDescriptor | null\n\trecommendedTtl: { realtime: number; aggregate: number }\n\t/**\n\t * The adapter applies `AnalyticsQuery.scope` as a provider-native filter (native\n\t * scope column, PostHog `scopeProperty`, ...). Without it, a scoped read through\n\t * a shared platform adapter would expose cross-scope data, so such reads are\n\t * gated by `access.platformRead`.\n\t */\n\tscopedQueries?: boolean\n}\n\nexport interface AdapterContext {\n\tsignal?: AbortSignal\n}\n\n/** Extra context the plugin hands adapters when they register config surface. */\nexport interface AdapterRegisterContext {\n\t/** True when the plugin has a scopeResolver configured. */\n\tscoped: boolean\n\t/** The plugin's scopeResolver bound for adapter use (e.g. ingest stamping). */\n\tresolveScope: (req: PayloadRequest) => Promise<string | null>\n\t/**\n\t * The plugin's reportingTimezone bound for adapter use (e.g. bucketing native\n\t * rollups at ingest). Resolves to `'UTC'` when no reportingTimezone is set.\n\t */\n\tresolveTimezone: (req: PayloadRequest, scope?: string | null) => Promise<string>\n\t/**\n\t * The install's goals for a request's scope, for adapters that match completions\n\t * themselves (the native engine, at ingest). Config goals, with the goals collection\n\t * merged over them per scope once the install enables it.\n\t */\n\tresolveGoals: (req: PayloadRequest, scope?: string | null) => Promise<Goal[]>\n}\n\nexport interface AnalyticsAdapter {\n\treadonly id: string\n\treadonly label: string\n\treadonly capabilities: AnalyticsCapabilities\n\t/** Browser-tracker proxying/boot descriptor. Absent when the adapter has no client-side script (GA4). */\n\treadonly capture?: CaptureSupport\n\t/**\n\t * Where this adapter's own ingest endpoint listens, relative to `routes.api`, for the\n\t * adapters that register one (the native engine), and how server code reaches the same\n\t * pipeline without an HTTP round trip. Server-side only: the tracker learns the path\n\t * from `TrackerConfig.ingestPath`, and this object is never serialized.\n\t */\n\treadonly ingest?: { path: string; track?: ServerTrack }\n\tisConfigured(): boolean\n\tquery(query: AnalyticsQuery, ctx: AdapterContext): Promise<AnalyticsResult>\n\trealtime?(query: AnalyticsQuery, ctx: AdapterContext): Promise<AnalyticsResult>\n\tregister?(config: Config, context?: AdapterRegisterContext): void\n}\n\nexport type AnalyticsAdapterFactory<Config> = (config: Config) => AnalyticsAdapter\n"],"mappings":";;;;;AASA,MAAa,iBAAiB;;AAe9B,MAAa,iBAAiB;CAC7B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACD;;AAYA,MAAa,mBAAmB;CAAC;CAAM;CAAY;AAAS"}
1
+ {"version":3,"file":"contract.js","names":[],"sources":["../../src/core/contract.ts"],"sourcesContent":["import type { Config, Payload, PayloadRequest } from 'payload'\nimport type { CurrencyConverter } from '../goals/currency'\nimport type { BrowserAmounts, OrderSignatureMode } from '../goals/match'\nimport type { Goal } from '../goals/types'\nimport type { TrustedPlatform } from '../net/platform'\nimport type { RoutePaths } from '../plugin/routes'\nimport type { CaptureSupport } from './capture'\nimport type { AdapterJobs } from './jobs'\nimport type { AnalyticsSdks } from './sdks'\nimport type { IngestHostnameResolver, ServerTrack } from './serverEvent'\n\n/**\n * Explicit cross-scope read marker: pass as a read's `scope` to aggregate over every\n * scope. Gated by `access.crossScope.aggregate`; the query reaches the adapter unscoped.\n */\nexport const PLATFORM_SCOPE = '*'\n\nexport type { AdapterJobs, AnalyticsTaskName, ScheduledTask } from './jobs'\n\nexport type MetricKey =\n\t| 'pageviews'\n\t| 'visitors'\n\t| 'visits'\n\t| 'sessions'\n\t| 'bounceRate'\n\t/** Time on page: engaged time per pageview, an average in milliseconds over the pageviews it is read for. */\n\t| 'avgDuration'\n\t/** Time per visit: engaged time per visit, an average in milliseconds over the visits it is read for. */\n\t| 'visitDuration'\n\t| 'scrollDepth'\n\t| 'events'\n\t| 'conversions'\n\t| 'revenue'\n\t/** Times a content item was seen on screen. Counted per item only, never per page or site. */\n\t| 'impressions'\n\t/** Clicks on a content item, the first per item and pageview. */\n\t| 'interactions'\n\n/**\n * One metric's reading. `null` is an average or a share with nothing to average over (no\n * pageviews to time, no scroll reported, no sessions to bounce): no data, not zero.\n */\nexport type MetricValue = number | null\n\n/** A row's or a read's metrics. A metric the source did not report is absent. */\nexport type MetricValues = Partial<Record<MetricKey, MetricValue>>\n\n/** Every breakdown key the contract defines, the list request parsers validate against. */\nexport const DIMENSION_KEYS = [\n\t'page',\n\t'referrer',\n\t'source',\n\t'channel',\n\t'medium',\n\t'campaign',\n\t'utmSource',\n\t'utmMedium',\n\t'utmCampaign',\n\t'utmContent',\n\t'utmTerm',\n\t'device',\n\t'browser',\n\t'os',\n\t'country',\n\t'region',\n\t'city',\n\t'language',\n\t'event',\n\t'goal',\n\t'currency',\n\t'item',\n] as const\n\nexport type DimensionKey = (typeof DIMENSION_KEYS)[number]\n\nexport type Granularity = 'minute' | 'hour' | 'day' | 'week' | 'month'\n\nexport interface DateRange {\n\tstart: Date\n\tend: Date\n}\n\n/** Every filter operator the contract defines, the list request parsers validate against. */\nexport const FILTER_OPERATORS = ['eq', 'contains', 'matches'] as const\n\nexport type FilterOperator = (typeof FILTER_OPERATORS)[number]\n\nexport interface AnalyticsFilter {\n\tdimension: DimensionKey\n\toperator: FilterOperator\n\tvalue: string\n}\n\nexport interface AnalyticsQuery {\n\tpath?: string\n\thostname?: string\n\t/**\n\t * One content item's ref (`<collection>:<id>`): the read answers about that item, wherever\n\t * it was shown. Only a source declaring `capabilities.perItemQuery` can serve it.\n\t */\n\titem?: string\n\tmetrics: MetricKey[]\n\tdimensions?: DimensionKey[]\n\tdateRange: DateRange\n\tgranularity?: Granularity\n\tfilters?: AnalyticsFilter[]\n\tlimit?: number\n\t/**\n\t * How a breakdown is ranked before `limit` cuts it. The metric belongs in `metrics`: ranked by\n\t * one the read did not ask for, rows keep the source's order.\n\t */\n\torder?: { metric: MetricKey; direction: 'asc' | 'desc' }\n\t/**\n\t * Analytics boundary of the read (tenant id, site key); undefined means install-wide. Adapters\n\t * that can filter by scope apply it, and it is always part of the cache key.\n\t */\n\tscope?: string\n\t/**\n\t * IANA timezone the read's day boundaries align to; undefined means UTC. Adapters that can bucket\n\t * in a zone apply it, others report in their account's own.\n\t */\n\ttimezone?: string\n\t/**\n\t * The scope's goal slugs, which provider adapters restrict goal rows to (native matches goals\n\t * itself). `'unresolved'` marks a failed goal resolver and never shares a healthy cache key.\n\t */\n\tgoalSlugs?: string[] | 'unresolved'\n}\n\nexport interface AnalyticsRow {\n\tdimensions?: Partial<Record<DimensionKey, string>>\n\tmetrics: MetricValues\n\ttimestamp?: string\n\t/**\n\t * How many observations each average in `metrics` was taken over, which folds days into weeks\n\t * exactly. An average without one is weighted by its row's matching count.\n\t */\n\tsamples?: Partial<Record<MetricKey, number>>\n}\n\n/** How a read's `visitors` were counted. */\nexport type VisitorCounting = 'distinct' | 'sumOfDaily'\n\n/** Why a stale answer's source needs a look: its settings were refused, or its host is not allowed. */\nexport type SourceErrorKind = 'misconfigured' | 'host-refused'\n\nexport interface AnalyticsResult {\n\trows: AnalyticsRow[]\n\ttotals?: MetricValues\n\tmeta: {\n\t\tprovider: string\n\t\t/** The source counted from a sample of its data (GA4 on a large property), so the numbers are estimates. */\n\t\tsampled?: boolean\n\t\t/** The read covers less than it asked for: from `dataFrom` and up to `dataTo`, where set. */\n\t\tclamped?: boolean\n\t\t/** ISO instant the data starts at, set with `clamped` when later than the range's start. */\n\t\tdataFrom?: string\n\t\t/**\n\t\t * ISO instant the data ends at, set with `clamped` when earlier than the range's end: a day\n\t\t * the range cuts lies past raw retention in a scope's own zone.\n\t\t */\n\t\tdataTo?: string\n\t\t/**\n\t\t * `distinct` counts each person once per number; `sumOfDaily` means some number adds up daily\n\t\t * visitors, so a person who came on two days counts twice.\n\t\t */\n\t\tvisitorsAre?: VisitorCounting\n\t\t/** Some days of the range could not be read yet, so the numbers are a floor. */\n\t\tpartial?: { missingDays: number }\n\t\t/**\n\t\t * On this many days of the range a value the read asks about was folded into the `(other)`\n\t\t * row of its daily totals, and its raw hits are no longer kept: the numbers are a floor.\n\t\t */\n\t\tcapped?: { days: number }\n\t\t/**\n\t\t * On this many days of the range counting failed again and again and was given up: each is\n\t\t * read from an earlier count when it had one, and left out otherwise.\n\t\t */\n\t\tfailed?: { days: number }\n\t\t/**\n\t\t * The scope's reporting timezone could not be resolved and none was ever recorded, so this\n\t\t * read cut its days in UTC and counted nothing for later reads.\n\t\t */\n\t\ttimezoneUnresolved?: true\n\t\t/** ISO instant the numbers were last brought up to date, when older than `fetchedAt`. */\n\t\tasOf?: string\n\t\t/**\n\t\t * ISO instant the source was read (`ctx.now`), never later than the engine got the answer; a\n\t\t * cached answer keeps it.\n\t\t */\n\t\tfetchedAt: string\n\t\t/**\n\t\t * ISO 4217 code `revenue` is reported in: the vendor's own, else the install's\n\t\t * `revenue.currency` or the read's `currency` filter. Absent, revenue is a plain sum as sent.\n\t\t */\n\t\tcurrency?: string\n\t\t/**\n\t\t * The currencies the read's revenue adds unconverted amounts of, when more than one. Native\n\t\t * sets it.\n\t\t */\n\t\tmixedCurrencies?: string[]\n\t\t/**\n\t\t * Served from a cache entry past its TTL: at once while a refresh runs, or because the refresh\n\t\t * failed. `asOf` then says when the entry was fetched.\n\t\t */\n\t\tstale?: boolean\n\t\t/**\n\t\t * Set on a stale answer whose source last failed as set up rather than as an outage:\n\t\t * credentials refused (`misconfigured`) or host not allowed (`host-refused`).\n\t\t */\n\t\tsourceError?: SourceErrorKind\n\t\t/**\n\t\t * Filters the source could not carry, so the rows are wider than the query asked for.\n\t\t * A provider whose API takes one value per dimension reports the ones it dropped here.\n\t\t */\n\t\tunappliedFilters?: AnalyticsFilter[]\n\t\t/**\n\t\t * The read's goal numbers are absent because resolving them failed. A scope with no goals gets\n\t\t * an empty result instead, not this flag.\n\t\t */\n\t\tgoalsUnresolved?: true\n\t\t/**\n\t\t * Pageviews of the read counted without consent, at a cookieless or anonymous level, which\n\t\t * the view shows as a share of all pageviews. Absent when the source cannot tell or found none.\n\t\t */\n\t\twithoutConsent?: { pageviews: number }\n\t\t/**\n\t\t * Pageviews of the read recorded without a visitor (native's anonymous level): they count as\n\t\t * pageviews, and toward no visitor, visit, bounce rate or time.\n\t\t */\n\t\twithoutVisitor?: { pageviews: number }\n\t\t/**\n\t\t * The vendor drops what a slot counts without consent, so those visits are missing from every\n\t\t * number: PostHog with its project's cookieless tracking setting off.\n\t\t */\n\t\twithoutConsentDropped?: true\n\t}\n}\n\n/**\n * The vendor's limits the source's lane keeps to, one token per upstream request per window. A read\n * with conversions may cost a second, goal-filtered request.\n */\nexport interface RateLimitDescriptor {\n\trequestsPerMinute?: number\n\trequestsPerHour?: number\n\t/** Upstream requests the source may have in flight; `cache.concurrency.perSource` when unset. */\n\tmaxConcurrent?: number\n\t/** Whether reads also spend the provider's write or ingest quota. */\n\treadsCountAsUsage?: boolean\n}\n\n/**\n * Which operators each dimension can be filtered with. A dimension absent here, or listed with\n * no operator, cannot be filtered at all.\n */\nexport type FilterOperatorMap = Partial<Record<DimensionKey, readonly FilterOperator[]>>\n\n/** Where a source reads one metric, when it cannot read it under every breakdown it offers. */\nexport interface MetricReach {\n\t/**\n\t * The breakdowns the metric is read under; empty when only whole-site numbers carry it.\n\t * Absent: every dimension the source declares.\n\t */\n\tdimensions?: readonly DimensionKey[]\n\t/**\n\t * A dimension the read must break down or filter by for the metric to have a value at all.\n\t * A read of one page (`AnalyticsQuery.path`) counts as filtering by `page`.\n\t */\n\trequires?: DimensionKey\n}\n\n/** What the numbers of a source mean where sources differ. */\nexport interface MetricSemantics {\n\t/**\n\t * `distinct` counts each person once over a range; `sumOfDaily` adds up each day's visitors.\n\t * Either may be per hostname: native's visitor id is, so two hostnames add up.\n\t */\n\tvisitors: VisitorCounting\n\t/** `inactivity30m` ends a visit after 30 minutes without activity; `provider` is the vendor's own rule. */\n\tsessions: 'inactivity30m' | 'provider'\n}\n\nexport interface AnalyticsCapabilities {\n\t/** The source answers `AnalyticsQuery.item`: one content item's views, clicks and outcomes. */\n\tperItemQuery?: boolean\n\trealtime: boolean\n\trealtimeWindowMinutes?: number\n\t/**\n\t * Period-over-period comparison, which the engine serves for every source by reading the\n\t * previous window itself. Adapters omit this; set it false only to opt a source out.\n\t */\n\tcomparison?: boolean\n\tminGranularity: Granularity\n\t/**\n\t * The source answers `week` and `month` series itself, exactly. Without it the engine reads\n\t * days and folds them into weeks and months in the read's reporting timezone.\n\t */\n\tcalendarBuckets?: boolean\n\tmaxLookbackDays: number | null\n\t/**\n\t * How far back a filtered read reaches, when that is shorter than `maxLookbackDays`: the\n\t * source narrows a longer one itself and marks it `clamped`. Absent or null: as far as any read.\n\t */\n\tfilterLookbackDays?: number | null\n\tmetrics: ReadonlySet<MetricKey>\n\tdimensions: ReadonlySet<DimensionKey>\n\t/**\n\t * Metrics the source reads only under some breakdowns or only for a page; any other is read under\n\t * every dimension. Reads outside a metric's reach are refused and hidden by pickers.\n\t */\n\tmetricReach?: Partial<Record<MetricKey, MetricReach>>\n\t/**\n\t * The `AnalyticsQuery.filters` the source applies, per dimension. A read carrying any other\n\t * pair is refused before it reaches the adapter. Absent: no filter at all.\n\t */\n\tfilters?: FilterOperatorMap\n\t/** What `visitors` and `sessions` mean here. Absent: not declared. */\n\tsemantics?: MetricSemantics\n\trateLimit: RateLimitDescriptor | null\n\t/**\n\t * Seconds an answer stays fresh. `today`, for a source cheap to read again, caps a window that\n\t * reaches into the current day whatever `cache.ttl` says; such an answer is never served stale.\n\t */\n\trecommendedTtl: { realtime: number; aggregate: number; today?: number }\n\t/**\n\t * The adapter applies `AnalyticsQuery.scope` as a native filter. Without it a scoped read through\n\t * a shared adapter would see other scopes, so it is gated by `access.crossScope.unscopedSource`.\n\t */\n\tscopedQueries?: boolean\n\t/**\n\t * The adapter sends every vendor request through `AdapterContext.upstream`, so each one spends\n\t * its own rate token and slot. Without it the engine counts a whole read as one request.\n\t */\n\tupstreamAware?: boolean\n}\n\nexport interface AdapterContext {\n\tsignal?: AbortSignal\n\t/**\n\t * The Payload instance the read is for, which the surfacing engine always passes. An adapter\n\t * that stores its data in Payload's database reads through it.\n\t */\n\tpayload?: Payload\n\t/**\n\t * Sends one vendor request through the source's lane: rate token, slot, retries on outage,\n\t * circuit breaker. Absent outside the engine, where `fn(ctx.signal)` is called directly.\n\t */\n\tupstream?: <T>(fn: (signal?: AbortSignal) => Promise<T>) => Promise<T>\n\t/**\n\t * Milliseconds the read has left before it gives up, for a vendor SDK that takes a deadline of\n\t * its own rather than a signal. Absent outside the engine.\n\t */\n\tremainingMs?: () => number\n\t/**\n\t * What time it is by the plugin's clock (Payload's), which an adapter stamps `meta.fetchedAt`\n\t * with. The engine always passes it; absent outside the engine.\n\t */\n\tnow?: () => Date\n}\n\n/** Extra context the plugin hands adapters when they register config surface. */\nexport interface AdapterRegisterContext {\n\t/** True when the plugin has `scope.resolve` configured. */\n\tscoped: boolean\n\t/**\n\t * `scope.resolve` at the `capture` call site, for ingest stamping: the host's resolver sees no\n\t * user, cookies or authorization header, so a hit files under the site it landed on.\n\t */\n\tresolveScope: (req: PayloadRequest) => Promise<string | null>\n\t/**\n\t * The plugin's reportingTimezone bound for adapter use, for what is shown in it. Resolves to\n\t * `'UTC'` when no reportingTimezone is set, and when the host's resolver fails.\n\t */\n\tresolveTimezone: (req: PayloadRequest, scope?: string | null) => Promise<string>\n\t/**\n\t * The same timezone, thrown rather than falling back to UTC: for an adapter storing days counted\n\t * in it, where recounting a day in UTC would move its numbers.\n\t */\n\tresolveTimezoneStrict: (req: PayloadRequest, scope?: string | null) => Promise<string>\n\t/** The install's `revenue` settings, for adapters that declare or reconcile revenue. */\n\trevenue: {\n\t\tenabled: boolean\n\t\tdimension: boolean\n\t\t/** `revenue.currency` bound for adapter use: `undefined` when none is set, revenue a plain number. */\n\t\tcurrency: (req: PayloadRequest, scope?: string | null) => Promise<string | undefined>\n\t\t/** `revenue.convert`, for adapters that reconcile revenue at ingest. */\n\t\tconvert?: CurrencyConverter\n\t\t/** `revenue.browserAmounts`, for an adapter that takes amounts from the browser itself. */\n\t\tbrowserAmounts?: BrowserAmounts\n\t\t/** `revenue.orderSignature`, for an adapter that takes the browser's order ids. */\n\t\torderSignature?: OrderSignatureMode\n\t}\n\t/**\n\t * The install's goals for a request's scope (config goals, the collection's merged over them),\n\t * for adapters that match completions themselves.\n\t */\n\tresolveGoals: (req: PayloadRequest, scope?: string | null) => Promise<Goal[]>\n\t/**\n\t * Whether a scope's own provider documents grant it this adapter; present only when the providers\n\t * collection runs under `scope.resolve`. Native ingest stores nothing for a scope it denies.\n\t */\n\tadapterGrantedForScope?: (\n\t\treq: PayloadRequest,\n\t\tscope: string | null,\n\t\tadapterId: string\n\t) => Promise<boolean>\n\t/** The plugin's `trustedProxyHops`, for adapters that read a request's client address. */\n\ttrustedProxyHops?: number\n\t/**\n\t * The plugin's `trustedPlatform`, for adapters that read a request's client address or\n\t * location: the only platform whose edge headers may be believed.\n\t */\n\ttrustedPlatform?: TrustedPlatform\n\t/**\n\t * `capture.allowedOrigins`, normalized, for adapters that register a public POST endpoint: the\n\t * only other sites whose pages may send to it from a visitor's browser.\n\t */\n\tallowedOrigins?: ReadonlySet<string>\n\t/**\n\t * False when this adapter fills no slot `capture.gate` holds that can count without consent, as\n\t * far as the boot can tell, so it need not check its vendor accepts such events. Absent reads as\n\t * true.\n\t */\n\tadapterCountsWithoutConsent?: boolean\n\t/**\n\t * The collections bound as content items, the only ones whose refs ingest keeps, and whether\n\t * an item is also counted per page it appeared on. Absent means no item is bound.\n\t */\n\titems?: { collections: ReadonlySet<string>; pages: boolean }\n\t/** The plugin's mounts under `routes.api`, for adapters that register an endpoint of their own. */\n\troutes?: RoutePaths\n\t/**\n\t * The packages the host handed the plugin as `sdks`, for adapters that would otherwise load\n\t * them at runtime: GA4's Data API client, the native engine's MaxMind reader.\n\t */\n\tsdks?: AnalyticsSdks\n\t/**\n\t * The plugin's `jobs`: the queue and schedule of the maintenance task an adapter registers, or\n\t * false when the install registers no task and the adapter's own requests do that work instead.\n\t */\n\tjobs?: AdapterJobs\n\t/** Says something at init, once the instance can log: what the boot warns about rather than refuses. */\n\tnotice?: (message: string) => void\n}\n\n/** What a switched-off install hands an adapter that keeps its schema (`disabled: true`). */\nexport interface AdapterSchemaContext {\n\t/** The plugin's `jobs`, which decides whether the adapter's task slug is in the jobs enum. */\n\tjobs: AdapterJobs\n\t/** What the boot would warn about, which a switched-off install never says. */\n\tnotice?: (message: string) => void\n}\n\n/** Whom a source's label is read for: the request, and the scope its sources were listed for. */\nexport interface AdapterLabelArgs {\n\treq: PayloadRequest\n\t/** Null is install-wide, `*` is cross-scope. */\n\tscope: string | null\n}\n\nexport interface AnalyticsAdapter {\n\treadonly id: string\n\t/** The source's name wherever no reader is known (boot-time pickers, logs). */\n\treadonly label: string\n\t/**\n\t * The source's name for one reader, where it differs by language or by who reads. Read through\n\t * `sourceLabelFor`, which falls back to `label` when this fails.\n\t */\n\treadonly labelFor?: (args: AdapterLabelArgs) => string | Promise<string>\n\treadonly capabilities: AnalyticsCapabilities\n\t/** Browser-tracker proxying/boot descriptor. Absent when no public capture field is set. */\n\treadonly capture?: CaptureSupport\n\t/**\n\t * Where the adapter's own ingest endpoint listens, relative to `routes.api`, and how server code\n\t * reaches that pipeline directly. Server-side only, never serialized.\n\t */\n\treadonly ingest?: { path: string; track?: ServerTrack; hostname?: IngestHostnameResolver }\n\tisConfigured(): boolean\n\tquery(query: AnalyticsQuery, ctx: AdapterContext): Promise<AnalyticsResult>\n\trealtime?(query: AnalyticsQuery, ctx: AdapterContext): Promise<AnalyticsResult>\n\tregister?(config: Config, context?: AdapterRegisterContext): void\n\t/**\n\t * For `disabled: true`: adds exactly the schema `register` would (collections, fields, indexes,\n\t * task slugs) and nothing that runs, so a switched-off install keeps its tables.\n\t */\n\tregisterSchema?(config: Config, context: AdapterSchemaContext): void\n\t/**\n\t * Binds the adapter to the Payload instance a runtime is built for, whenever one is, with or\n\t * without `onInit`. Called again for every rebuild, so it must be idempotent per instance.\n\t */\n\tattach?(payload: Payload): void\n\t/**\n\t * Releases what the adapter holds for one instance (buffers, clients, timers) once that\n\t * instance's runtime is retired; another instance the adapter serves keeps what it holds.\n\t */\n\tclose?(payload: Payload): void | Promise<void>\n}\n\nexport type AnalyticsAdapterFactory<Config> = (config: Config) => AnalyticsAdapter\n"],"mappings":";;;;;AAeA,MAAa,iBAAiB;;AAiC9B,MAAa,iBAAiB;CAC7B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACD;;AAYA,MAAa,mBAAmB;CAAC;CAAM;CAAY;AAAS"}