@10x-media/analytics 1.0.0-beta.6 → 1.0.0-beta.8

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 (391) hide show
  1. package/CHANGELOG.md +73 -0
  2. package/README.md +13 -3
  3. package/dist/adapters/ga4/ga4.js +3 -2
  4. package/dist/adapters/ga4/ga4.js.map +1 -1
  5. package/dist/adapters/http/fetchJson.js +1 -1
  6. package/dist/adapters/plausible/plausible.d.ts +10 -0
  7. package/dist/adapters/plausible/plausible.js +42 -1
  8. package/dist/adapters/plausible/plausible.js.map +1 -1
  9. package/dist/adapters/posthog/posthog.d.ts +10 -1
  10. package/dist/adapters/posthog/posthog.js +47 -0
  11. package/dist/adapters/posthog/posthog.js.map +1 -1
  12. package/dist/adapters/umami/umami.d.ts +5 -1
  13. package/dist/adapters/umami/umami.js +26 -0
  14. package/dist/adapters/umami/umami.js.map +1 -1
  15. package/dist/capture/getTrackerConfig.d.ts +20 -0
  16. package/dist/capture/getTrackerConfig.js +31 -0
  17. package/dist/capture/getTrackerConfig.js.map +1 -0
  18. package/dist/capture/mountPath.js +14 -0
  19. package/dist/capture/mountPath.js.map +1 -0
  20. package/dist/capture/proxyEndpoint.js +123 -0
  21. package/dist/capture/proxyEndpoint.js.map +1 -0
  22. package/dist/capture/proxyRoutes.js +108 -0
  23. package/dist/capture/proxyRoutes.js.map +1 -0
  24. package/dist/capture/requestBody.js +68 -0
  25. package/dist/capture/requestBody.js.map +1 -0
  26. package/dist/capture/slots.d.ts +8 -0
  27. package/dist/capture/slots.js +54 -0
  28. package/dist/capture/slots.js.map +1 -0
  29. package/dist/capture/trackerConfig.d.ts +33 -0
  30. package/dist/capture/trackerConfig.js +95 -0
  31. package/dist/capture/trackerConfig.js.map +1 -0
  32. package/dist/capture/trackerEndpoint.js +35 -0
  33. package/dist/capture/trackerEndpoint.js.map +1 -0
  34. package/dist/charts/BarList.d.ts +15 -1
  35. package/dist/charts/BarList.js +34 -18
  36. package/dist/charts/BarList.js.map +1 -1
  37. package/dist/charts/TrendChart.d.ts +16 -3
  38. package/dist/charts/TrendChart.js +172 -106
  39. package/dist/charts/TrendChart.js.map +1 -1
  40. package/dist/charts/bars.d.ts +2 -0
  41. package/dist/charts/bars.js +2 -1
  42. package/dist/charts/bars.js.map +1 -1
  43. package/dist/charts/bucket.js +10 -1
  44. package/dist/charts/bucket.js.map +1 -1
  45. package/dist/charts/spline.js +2 -2
  46. package/dist/charts/spline.js.map +1 -1
  47. package/dist/charts/styles.js +18 -1
  48. package/dist/charts/styles.js.map +1 -1
  49. package/dist/core/cacheKey.js +13 -1
  50. package/dist/core/cacheKey.js.map +1 -1
  51. package/dist/core/capture.d.ts +49 -0
  52. package/dist/core/contract.d.ts +35 -4
  53. package/dist/core/contract.js +29 -1
  54. package/dist/core/contract.js.map +1 -1
  55. package/dist/core/granularity.js +1 -1
  56. package/dist/core/options.d.ts +148 -4
  57. package/dist/core/options.js +121 -3
  58. package/dist/core/options.js.map +1 -1
  59. package/dist/core/registry.d.ts +1 -0
  60. package/dist/core/scopeList.js +32 -0
  61. package/dist/core/scopeList.js.map +1 -0
  62. package/dist/core/scopedRead.js +45 -28
  63. package/dist/core/scopedRead.js.map +1 -1
  64. package/dist/core/serverEvent.d.ts +42 -0
  65. package/dist/core/serverEvent.js +12 -0
  66. package/dist/core/serverEvent.js.map +1 -0
  67. package/dist/exports/client.d.ts +8 -2
  68. package/dist/exports/client.js +6 -1
  69. package/dist/exports/next.d.ts +2 -1
  70. package/dist/exports/next.js +2 -1
  71. package/dist/exports/react.d.ts +4 -0
  72. package/dist/exports/react.js +5 -0
  73. package/dist/exports/rsc.d.ts +8 -1
  74. package/dist/exports/rsc.js +7 -2
  75. package/dist/exports/tracker.d.ts +18 -0
  76. package/dist/exports/tracker.js +12 -0
  77. package/dist/exports/types.d.ts +14 -3
  78. package/dist/exports/types.js +2 -2
  79. package/dist/fields/AnalyticsPanelClient.js +2 -2
  80. package/dist/fields/AnalyticsPanelField.js +1 -1
  81. package/dist/fields/AnalyticsStatField.js +2 -2
  82. package/dist/fields/config/MetricSelectField.js +2 -2
  83. package/dist/fields/config/MetricSelectField.js.map +1 -1
  84. package/dist/fields/config/SourceSelectField.js +2 -2
  85. package/dist/fields/config/SourceSelectField.js.map +1 -1
  86. package/dist/fields/config/fetchSources.d.ts +5 -1
  87. package/dist/fields/config/narrow.js +2 -0
  88. package/dist/fields/config/narrow.js.map +1 -1
  89. package/dist/fields/readForDocument.d.ts +5 -0
  90. package/dist/fields/readForDocument.js +6 -6
  91. package/dist/fields/readForDocument.js.map +1 -1
  92. package/dist/goals/GoalSelectField.d.ts +7 -0
  93. package/dist/goals/GoalSelectField.js +77 -0
  94. package/dist/goals/GoalSelectField.js.map +1 -0
  95. package/dist/goals/collection.js +250 -0
  96. package/dist/goals/collection.js.map +1 -0
  97. package/dist/goals/currency.js +14 -0
  98. package/dist/goals/currency.js.map +1 -0
  99. package/dist/goals/fetchGoals.d.ts +18 -0
  100. package/dist/goals/fetchGoals.js +29 -0
  101. package/dist/goals/fetchGoals.js.map +1 -0
  102. package/dist/goals/goalField.d.ts +31 -0
  103. package/dist/goals/goalField.js +56 -0
  104. package/dist/goals/goalField.js.map +1 -0
  105. package/dist/goals/goalsEndpoint.d.ts +1 -0
  106. package/dist/goals/goalsEndpoint.js +55 -0
  107. package/dist/goals/goalsEndpoint.js.map +1 -0
  108. package/dist/goals/match.js +64 -0
  109. package/dist/goals/match.js.map +1 -0
  110. package/dist/goals/resolver.d.ts +8 -0
  111. package/dist/goals/resolver.js +147 -0
  112. package/dist/goals/resolver.js.map +1 -0
  113. package/dist/goals/trackGoalAction.d.ts +74 -0
  114. package/dist/goals/trackGoalAction.js +139 -0
  115. package/dist/goals/trackGoalAction.js.map +1 -0
  116. package/dist/goals/types.d.ts +33 -0
  117. package/dist/goals/types.js +7 -0
  118. package/dist/goals/types.js.map +1 -0
  119. package/dist/goals/useAnalyticsGoals.d.ts +20 -0
  120. package/dist/goals/useAnalyticsGoals.js +67 -0
  121. package/dist/goals/useAnalyticsGoals.js.map +1 -0
  122. package/dist/index.d.ts +11 -3
  123. package/dist/index.js +104 -17
  124. package/dist/index.js.map +1 -1
  125. package/dist/native/collections/events.js +21 -1
  126. package/dist/native/collections/events.js.map +1 -1
  127. package/dist/native/collections/rollups.js +24 -0
  128. package/dist/native/collections/rollups.js.map +1 -1
  129. package/dist/native/geo/maxmindResolver.js +2 -4
  130. package/dist/native/geo/maxmindResolver.js.map +1 -1
  131. package/dist/native/ingest/clientIp.js +15 -0
  132. package/dist/native/ingest/clientIp.js.map +1 -0
  133. package/dist/native/ingest/device.js +11 -3
  134. package/dist/native/ingest/device.js.map +1 -1
  135. package/dist/native/ingest/endpoint.d.ts +1 -0
  136. package/dist/native/ingest/endpoint.js +25 -4
  137. package/dist/native/ingest/endpoint.js.map +1 -1
  138. package/dist/native/ingest/flushBatch.js +4 -13
  139. package/dist/native/ingest/flushBatch.js.map +1 -1
  140. package/dist/native/ingest/normalizeEvent.d.ts +20 -0
  141. package/dist/native/ingest/normalizeEvent.js +78 -10
  142. package/dist/native/ingest/normalizeEvent.js.map +1 -1
  143. package/dist/native/ingest/serverTrack.d.ts +20 -0
  144. package/dist/native/ingest/serverTrack.js +99 -0
  145. package/dist/native/ingest/serverTrack.js.map +1 -0
  146. package/dist/native/ingest/validate.js +27 -0
  147. package/dist/native/ingest/validate.js.map +1 -0
  148. package/dist/native/nativeAdapter.d.ts +1 -1
  149. package/dist/native/nativeAdapter.js +38 -11
  150. package/dist/native/nativeAdapter.js.map +1 -1
  151. package/dist/native/query/eventAgg.js +39 -13
  152. package/dist/native/query/eventAgg.js.map +1 -1
  153. package/dist/native/retention/pruneTask.js +1 -1
  154. package/dist/native/rollupAcc.js +12 -1
  155. package/dist/native/rollupAcc.js.map +1 -1
  156. package/dist/native/rollups/bumpRollup.js +5 -1
  157. package/dist/native/rollups/bumpRollup.js.map +1 -1
  158. package/dist/native/rollups/deltas.js +28 -6
  159. package/dist/native/rollups/deltas.js.map +1 -1
  160. package/dist/native/rollups/insertIfNew.js +36 -2
  161. package/dist/native/rollups/insertIfNew.js.map +1 -1
  162. package/dist/next/captureRewrites.d.ts +41 -0
  163. package/dist/next/captureRewrites.js +56 -0
  164. package/dist/next/captureRewrites.js.map +1 -0
  165. package/dist/next/posthogProxyRewrites.d.ts +5 -0
  166. package/dist/next/posthogProxyRewrites.js +16 -21
  167. package/dist/next/posthogProxyRewrites.js.map +1 -1
  168. package/dist/plugin/documentEndpoint.js +28 -10
  169. package/dist/plugin/documentEndpoint.js.map +1 -1
  170. package/dist/plugin/paths.js +15 -1
  171. package/dist/plugin/paths.js.map +1 -1
  172. package/dist/plugin/queryEndpoint.js +113 -0
  173. package/dist/plugin/queryEndpoint.js.map +1 -0
  174. package/dist/plugin/readContextForRequest.js +71 -0
  175. package/dist/plugin/readContextForRequest.js.map +1 -0
  176. package/dist/plugin/realtimeEndpoint.js +6 -3
  177. package/dist/plugin/realtimeEndpoint.js.map +1 -1
  178. package/dist/plugin/runtime.d.ts +1 -0
  179. package/dist/plugin/runtime.js +31 -1
  180. package/dist/plugin/runtime.js.map +1 -1
  181. package/dist/plugin/scopeFieldBoot.js +22 -0
  182. package/dist/plugin/scopeFieldBoot.js.map +1 -0
  183. package/dist/plugin/sourcesEndpoint.js +13 -39
  184. package/dist/plugin/sourcesEndpoint.js.map +1 -1
  185. package/dist/plugin/warmTask.js +0 -0
  186. package/dist/plugin/warmTask.js.map +1 -1
  187. package/dist/providers/collection.js +71 -25
  188. package/dist/providers/collection.js.map +1 -1
  189. package/dist/providers/factory.js +8 -2
  190. package/dist/providers/factory.js.map +1 -1
  191. package/dist/providers/resolver.js.map +1 -1
  192. package/dist/query/dates.js +64 -0
  193. package/dist/query/dates.js.map +1 -0
  194. package/dist/query/errors.d.ts +17 -0
  195. package/dist/query/errors.js +10 -0
  196. package/dist/query/errors.js.map +1 -0
  197. package/dist/query/fetchQuery.d.ts +59 -0
  198. package/dist/query/fetchQuery.js +110 -0
  199. package/dist/query/fetchQuery.js.map +1 -0
  200. package/dist/query/parse.d.ts +22 -0
  201. package/dist/query/parse.js +168 -0
  202. package/dist/query/parse.js.map +1 -0
  203. package/dist/query/response.d.ts +36 -0
  204. package/dist/react/AnalyticsProvider.d.ts +43 -0
  205. package/dist/react/AnalyticsProvider.js +66 -0
  206. package/dist/react/AnalyticsProvider.js.map +1 -0
  207. package/dist/react/TrackerBoot.d.ts +22 -0
  208. package/dist/react/TrackerBoot.js +30 -0
  209. package/dist/react/TrackerBoot.js.map +1 -0
  210. package/dist/react/useAnalytics.d.ts +17 -0
  211. package/dist/react/useAnalytics.js +36 -0
  212. package/dist/react/useAnalytics.js.map +1 -0
  213. package/dist/rsc/AnalyticsScripts.d.ts +30 -0
  214. package/dist/rsc/AnalyticsScripts.js +41 -0
  215. package/dist/rsc/AnalyticsScripts.js.map +1 -0
  216. package/dist/surfacing/cacheStore.d.ts +1 -0
  217. package/dist/surfacing/cacheStore.js +18 -2
  218. package/dist/surfacing/cacheStore.js.map +1 -1
  219. package/dist/surfacing/engine.d.ts +1 -0
  220. package/dist/surfacing/engine.js +44 -4
  221. package/dist/surfacing/engine.js.map +1 -1
  222. package/dist/surfacing/queue.js +22 -6
  223. package/dist/surfacing/queue.js.map +1 -1
  224. package/dist/surfacing/rateLimiter.js +130 -0
  225. package/dist/surfacing/rateLimiter.js.map +1 -0
  226. package/dist/surfacing/retryPolicy.js +15 -0
  227. package/dist/surfacing/retryPolicy.js.map +1 -0
  228. package/dist/sync/syncTask.js +60 -33
  229. package/dist/sync/syncTask.js.map +1 -1
  230. package/dist/testing/memoryAdapter.d.ts +2 -0
  231. package/dist/testing/memoryAdapter.js +10 -0
  232. package/dist/testing/memoryAdapter.js.map +1 -1
  233. package/dist/timeframe/tz.js +17 -6
  234. package/dist/timeframe/tz.js.map +1 -1
  235. package/dist/tracker/autoCapture.d.ts +48 -0
  236. package/dist/tracker/autoCapture.js +129 -0
  237. package/dist/tracker/autoCapture.js.map +1 -0
  238. package/dist/tracker/consent.d.ts +24 -0
  239. package/dist/tracker/consent.js +48 -0
  240. package/dist/tracker/consent.js.map +1 -0
  241. package/dist/tracker/createTracker.d.ts +18 -0
  242. package/dist/tracker/createTracker.js +163 -0
  243. package/dist/tracker/createTracker.js.map +1 -0
  244. package/dist/tracker/initTracker.d.ts +22 -0
  245. package/dist/tracker/initTracker.js +33 -0
  246. package/dist/tracker/initTracker.js.map +1 -0
  247. package/dist/tracker/loadScript.d.ts +14 -0
  248. package/dist/tracker/loadScript.js +41 -0
  249. package/dist/tracker/loadScript.js.map +1 -0
  250. package/dist/tracker/pageTracking.d.ts +17 -0
  251. package/dist/tracker/pageTracking.js +38 -0
  252. package/dist/tracker/pageTracking.js.map +1 -0
  253. package/dist/tracker/registry.d.ts +27 -0
  254. package/dist/tracker/registry.js +73 -0
  255. package/dist/tracker/registry.js.map +1 -0
  256. package/dist/tracker/sinks/native.d.ts +22 -0
  257. package/dist/tracker/sinks/native.js +56 -0
  258. package/dist/tracker/sinks/native.js.map +1 -0
  259. package/dist/tracker/sinks/plausible.d.ts +14 -0
  260. package/dist/tracker/sinks/plausible.js +25 -0
  261. package/dist/tracker/sinks/plausible.js.map +1 -0
  262. package/dist/tracker/sinks/posthog.d.ts +14 -0
  263. package/dist/tracker/sinks/posthog.js +18 -0
  264. package/dist/tracker/sinks/posthog.js.map +1 -0
  265. package/dist/tracker/sinks/umami.d.ts +13 -0
  266. package/dist/tracker/sinks/umami.js +17 -0
  267. package/dist/tracker/sinks/umami.js.map +1 -0
  268. package/dist/tracker/sinks/vendor.d.ts +14 -0
  269. package/dist/tracker/sinks/vendor.js +66 -0
  270. package/dist/tracker/sinks/vendor.js.map +1 -0
  271. package/dist/tracker/transport.js +28 -0
  272. package/dist/tracker/transport.js.map +1 -0
  273. package/dist/tracker/types.d.ts +66 -0
  274. package/dist/translations/ar.js +104 -1
  275. package/dist/translations/ar.js.map +1 -1
  276. package/dist/translations/de.js +104 -1
  277. package/dist/translations/de.js.map +1 -1
  278. package/dist/translations/en.js +104 -1
  279. package/dist/translations/en.js.map +1 -1
  280. package/dist/translations/es.js +104 -1
  281. package/dist/translations/es.js.map +1 -1
  282. package/dist/translations/fr.js +104 -1
  283. package/dist/translations/fr.js.map +1 -1
  284. package/dist/translations/id.js +104 -1
  285. package/dist/translations/id.js.map +1 -1
  286. package/dist/translations/keys.d.ts +103 -0
  287. package/dist/translations/keys.js +104 -1
  288. package/dist/translations/keys.js.map +1 -1
  289. package/dist/translations/ko.js +104 -1
  290. package/dist/translations/ko.js.map +1 -1
  291. package/dist/translations/metricKeys.js +1 -1
  292. package/dist/translations/metricKeys.js.map +1 -1
  293. package/dist/translations/pt.js +104 -1
  294. package/dist/translations/pt.js.map +1 -1
  295. package/dist/translations/ru.js +104 -1
  296. package/dist/translations/ru.js.map +1 -1
  297. package/dist/translations/uk.js +104 -1
  298. package/dist/translations/uk.js.map +1 -1
  299. package/dist/translations/zh.js +104 -1
  300. package/dist/translations/zh.js.map +1 -1
  301. package/dist/view/AnalyticsNavLink.d.ts +19 -0
  302. package/dist/view/AnalyticsNavLink.js +40 -0
  303. package/dist/view/AnalyticsNavLink.js.map +1 -0
  304. package/dist/view/AnalyticsView.d.ts +23 -0
  305. package/dist/view/AnalyticsView.js +45 -0
  306. package/dist/view/AnalyticsView.js.map +1 -0
  307. package/dist/view/AnalyticsViewClient.d.ts +15 -0
  308. package/dist/view/AnalyticsViewClient.js +189 -0
  309. package/dist/view/AnalyticsViewClient.js.map +1 -0
  310. package/dist/view/authRedirect.js +32 -0
  311. package/dist/view/authRedirect.js.map +1 -0
  312. package/dist/view/conversionRate.js +18 -0
  313. package/dist/view/conversionRate.js.map +1 -0
  314. package/dist/view/dayRange.js +68 -0
  315. package/dist/view/dayRange.js.map +1 -0
  316. package/dist/view/gating.d.ts +1 -0
  317. package/dist/view/gating.js +105 -0
  318. package/dist/view/gating.js.map +1 -0
  319. package/dist/view/labels.js +44 -0
  320. package/dist/view/labels.js.map +1 -0
  321. package/dist/view/registerView.js +48 -0
  322. package/dist/view/registerView.js.map +1 -0
  323. package/dist/view/sections/Breakdowns.js +157 -0
  324. package/dist/view/sections/Breakdowns.js.map +1 -0
  325. package/dist/view/sections/EmptyStates.js +92 -0
  326. package/dist/view/sections/EmptyStates.js.map +1 -0
  327. package/dist/view/sections/FilterChips.js +41 -0
  328. package/dist/view/sections/FilterChips.js.map +1 -0
  329. package/dist/view/sections/GoalsPanel.js +81 -0
  330. package/dist/view/sections/GoalsPanel.js.map +1 -0
  331. package/dist/view/sections/OverviewCards.js +65 -0
  332. package/dist/view/sections/OverviewCards.js.map +1 -0
  333. package/dist/view/sections/RealtimeStrip.js +77 -0
  334. package/dist/view/sections/RealtimeStrip.js.map +1 -0
  335. package/dist/view/sections/Toolbar.js +179 -0
  336. package/dist/view/sections/Toolbar.js.map +1 -0
  337. package/dist/view/sections/Trend.js +119 -0
  338. package/dist/view/sections/Trend.js.map +1 -0
  339. package/dist/view/sections/styles.js +74 -0
  340. package/dist/view/sections/styles.js.map +1 -0
  341. package/dist/view/state.js +206 -0
  342. package/dist/view/state.js.map +1 -0
  343. package/dist/view/useViewQueries.js +150 -0
  344. package/dist/view/useViewQueries.js.map +1 -0
  345. package/dist/view/viewProps.d.ts +40 -0
  346. package/dist/view/viewProps.js +90 -0
  347. package/dist/view/viewProps.js.map +1 -0
  348. package/dist/widgets/AnalyticsBreakdownWidget.d.ts +2 -1
  349. package/dist/widgets/AnalyticsBreakdownWidget.js +22 -4
  350. package/dist/widgets/AnalyticsBreakdownWidget.js.map +1 -1
  351. package/dist/widgets/AnalyticsGoalsWidget.d.ts +14 -0
  352. package/dist/widgets/AnalyticsGoalsWidget.js +188 -0
  353. package/dist/widgets/AnalyticsGoalsWidget.js.map +1 -0
  354. package/dist/widgets/AnalyticsMetricWidget.d.ts +2 -1
  355. package/dist/widgets/AnalyticsMetricWidget.js +35 -12
  356. package/dist/widgets/AnalyticsMetricWidget.js.map +1 -1
  357. package/dist/widgets/AnalyticsRealtimeWidget.d.ts +2 -1
  358. package/dist/widgets/AnalyticsRealtimeWidget.js +42 -22
  359. package/dist/widgets/AnalyticsRealtimeWidget.js.map +1 -1
  360. package/dist/widgets/AnalyticsTrendWidget.d.ts +2 -1
  361. package/dist/widgets/AnalyticsTrendWidget.js +51 -15
  362. package/dist/widgets/AnalyticsTrendWidget.js.map +1 -1
  363. package/dist/widgets/WidgetViewLink.js +17 -0
  364. package/dist/widgets/WidgetViewLink.js.map +1 -0
  365. package/dist/widgets/breakdownTypes.js +32 -0
  366. package/dist/widgets/breakdownTypes.js.map +1 -1
  367. package/dist/widgets/cardChrome.js +31 -7
  368. package/dist/widgets/cardChrome.js.map +1 -1
  369. package/dist/widgets/range.js +43 -12
  370. package/dist/widgets/range.js.map +1 -1
  371. package/dist/widgets/readForWidget.d.ts +12 -0
  372. package/dist/widgets/readForWidget.js +30 -19
  373. package/dist/widgets/readForWidget.js.map +1 -1
  374. package/dist/widgets/readForWidgetBreakdown.d.ts +15 -0
  375. package/dist/widgets/readForWidgetBreakdown.js +32 -20
  376. package/dist/widgets/readForWidgetBreakdown.js.map +1 -1
  377. package/dist/widgets/readForWidgetGoals.d.ts +57 -0
  378. package/dist/widgets/readForWidgetGoals.js +126 -0
  379. package/dist/widgets/readForWidgetGoals.js.map +1 -0
  380. package/dist/widgets/readForWidgetRealtime.js +1 -1
  381. package/dist/widgets/readForWidgetSeries.d.ts +13 -0
  382. package/dist/widgets/readForWidgetSeries.js +56 -28
  383. package/dist/widgets/readForWidgetSeries.js.map +1 -1
  384. package/dist/widgets/registerWidgets.js +58 -9
  385. package/dist/widgets/registerWidgets.js.map +1 -1
  386. package/dist/widgets/types.js +16 -2
  387. package/dist/widgets/types.js.map +1 -1
  388. package/dist/widgets/viewLink.d.ts +22 -0
  389. package/dist/widgets/viewLink.js +83 -0
  390. package/dist/widgets/viewLink.js.map +1 -0
  391. package/package.json +25 -5
@@ -1 +1 @@
1
- {"version":3,"file":"scopedRead.js","names":[],"sources":["../../src/core/scopedRead.ts"],"sourcesContent":["import type { PayloadRequest } from 'payload'\nimport {\n\ttype AnalyticsRuntime,\n\tplatformReadFor,\n\tresolveRegistryFor,\n\tresolveScopeFor,\n} from '../plugin/runtime'\nimport { type AnalyticsAdapter, PLATFORM_SCOPE } from './contract'\n\nexport type ReadContext =\n\t| {\n\t\t\tok: true\n\t\t\tadapter: AnalyticsAdapter\n\t\t\tscope: string | null\n\t\t\t/** The scope to stamp on the adapter query; undefined for install-wide reads. */\n\t\t\tqueryScope?: string\n\t }\n\t| { ok: false }\n\nexport interface ResolveReadContextArgs {\n\truntime: AnalyticsRuntime\n\treq: PayloadRequest\n\tadapterId?: string\n\t/** Explicit scope override; undefined resolves via the plugin's scopeResolver. */\n\tscope?: string | null\n}\n\n/**\n * Resolve one read's scope and adapter: explicit scope wins over the request's\n * resolved scope, the registry is resolved per scope, then the adapter is picked\n * by id (or the registry default). Cross-scope reads fail closed behind\n * `platformRead`: an explicit `'*'` scope always, and any scoped read through a\n * shared config adapter that cannot narrow the query to one scope, whether or\n * not it is the designated platform adapter. A tenant's own runtime adapters\n * are never gated. Any resolution failure (unknown adapter id, a throwing\n * scopeResolver or provider lookup) degrades to `{ ok: false }` so read paths\n * render their unavailable state instead of throwing.\n */\nexport const resolveReadContext = async (args: ResolveReadContextArgs): Promise<ReadContext> => {\n\tconst { runtime, req, adapterId } = args\n\ttry {\n\t\tconst scope = args.scope !== undefined ? args.scope : await resolveScopeFor(runtime, req)\n\t\tconst registryScope = scope === PLATFORM_SCOPE ? null : scope\n\t\tconst registry = await resolveRegistryFor(runtime, {\n\t\t\tpayload: req.payload,\n\t\t\treq,\n\t\t\tscope: registryScope,\n\t\t})\n\t\tconst adapter = adapterId ? registry.get(adapterId) : registry.default()\n\t\tif (scope === PLATFORM_SCOPE) {\n\t\t\tif (!(await platformReadFor(runtime, req))) {\n\t\t\t\treturn { ok: false }\n\t\t\t}\n\t\t\treturn { ok: true, adapter, scope: null, queryScope: undefined }\n\t\t}\n\t\tif (\n\t\t\tscope !== null &&\n\t\t\truntime.configAdapterIds.has(adapter.id) &&\n\t\t\t!adapter.capabilities.scopedQueries\n\t\t) {\n\t\t\tif (!(await platformReadFor(runtime, req))) {\n\t\t\t\treturn { ok: false }\n\t\t\t}\n\t\t\treturn { ok: true, adapter, scope, queryScope: undefined }\n\t\t}\n\t\treturn { ok: true, adapter, scope, queryScope: scope ?? undefined }\n\t} catch (err) {\n\t\treq.payload.logger?.warn(`analytics: read context resolution failed: ${String(err)}`)\n\t\treturn { ok: false }\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;AAsCA,MAAa,qBAAqB,OAAO,SAAuD;CAC/F,MAAM,EAAE,SAAS,KAAK,cAAc;CACpC,IAAI;EACH,MAAM,QAAQ,KAAK,UAAU,KAAA,IAAY,KAAK,QAAQ,MAAM,gBAAgB,SAAS,GAAG;EACxF,MAAM,gBAAgB,UAAA,MAA2B,OAAO;EACxD,MAAM,WAAW,MAAM,mBAAmB,SAAS;GAClD,SAAS,IAAI;GACb;GACA,OAAO;EACR,CAAC;EACD,MAAM,UAAU,YAAY,SAAS,IAAI,SAAS,IAAI,SAAS,QAAQ;EACvE,IAAI,UAAA,KAA0B;GAC7B,IAAI,CAAE,MAAM,gBAAgB,SAAS,GAAG,GACvC,OAAO,EAAE,IAAI,MAAM;GAEpB,OAAO;IAAE,IAAI;IAAM;IAAS,OAAO;IAAM,YAAY,KAAA;GAAU;EAChE;EACA,IACC,UAAU,QACV,QAAQ,iBAAiB,IAAI,QAAQ,EAAE,KACvC,CAAC,QAAQ,aAAa,eACrB;GACD,IAAI,CAAE,MAAM,gBAAgB,SAAS,GAAG,GACvC,OAAO,EAAE,IAAI,MAAM;GAEpB,OAAO;IAAE,IAAI;IAAM;IAAS;IAAO,YAAY,KAAA;GAAU;EAC1D;EACA,OAAO;GAAE,IAAI;GAAM;GAAS;GAAO,YAAY,SAAS,KAAA;EAAU;CACnE,SAAS,KAAK;EACb,IAAI,QAAQ,QAAQ,KAAK,8CAA8C,OAAO,GAAG,GAAG;EACpF,OAAO,EAAE,IAAI,MAAM;CACpB;AACD"}
1
+ {"version":3,"file":"scopedRead.js","names":[],"sources":["../../src/core/scopedRead.ts"],"sourcesContent":["import type { PayloadRequest } from 'payload'\nimport {\n\ttype AnalyticsRuntime,\n\ttype PlatformReadGate,\n\tplatformReadGate,\n\tresolveRegistryFor,\n\tresolveScopeFor,\n} from '../plugin/runtime'\nimport { type AnalyticsAdapter, PLATFORM_SCOPE } from './contract'\n\nexport type ReadContext =\n\t| {\n\t\t\tok: true\n\t\t\tadapter: AnalyticsAdapter\n\t\t\tscope: string | null\n\t\t\t/** The scope to stamp on the adapter query; undefined for install-wide reads. */\n\t\t\tqueryScope?: string\n\t }\n\t| { ok: false }\n\nexport interface ResolveReadContextArgs {\n\truntime: AnalyticsRuntime\n\treq: PayloadRequest\n\tadapterId?: string\n\t/** Explicit scope override; undefined resolves via the plugin's scopeResolver. */\n\tscope?: string | null\n}\n\nexport interface QueryScopeArgs {\n\truntime: AnalyticsRuntime\n\treq: PayloadRequest\n\t/** The read's resolved scope; `'*'` is the explicit cross-scope marker. */\n\tscope: string | null\n\tadapter: AnalyticsAdapter\n\t/** Shared `platformRead` decision; one is created per call when omitted. */\n\tplatformRead?: PlatformReadGate\n}\n\n/**\n * The scope to stamp on one adapter query, or a refusal. Cross-scope reads fail closed\n * behind `platformRead`: the `'*'` marker, and any scoped read through a shared config\n * adapter that cannot narrow the query to one scope (whether or not it is the designated\n * platform adapter), which would otherwise answer with every scope's data. A tenant's own\n * runtime adapters are never gated. Every read path decides this here, so the widgets and\n * the query endpoint cannot drift apart on what counts as cross-scope.\n */\nexport const resolveQueryScope = async (\n\targs: QueryScopeArgs\n): Promise<{ ok: true; queryScope?: string } | { ok: false }> => {\n\tconst { runtime, req, scope, adapter } = args\n\tconst allowed = args.platformRead ?? platformReadGate(runtime, req)\n\tif (scope === PLATFORM_SCOPE) {\n\t\treturn (await allowed()) ? { ok: true } : { ok: false }\n\t}\n\tif (scope === null) {\n\t\treturn { ok: true }\n\t}\n\tif (runtime.configAdapterIds.has(adapter.id) && !adapter.capabilities.scopedQueries) {\n\t\treturn (await allowed()) ? { ok: true } : { ok: false }\n\t}\n\treturn { ok: true, queryScope: scope }\n}\n\n/**\n * Resolve one read's scope and adapter: explicit scope wins over the request's\n * resolved scope, the registry is resolved per scope, then the adapter is picked\n * by id (or the registry default). Cross-scope reads fail closed behind\n * `platformRead`: an explicit `'*'` scope always, any scoped read through a\n * shared config adapter that cannot narrow the query to one scope (whether or\n * not it is the designated platform adapter), and, on a scoped install, a\n * request that resolves no scope at all. That last case is ambiguous rather\n * than intentionally install-wide (a tenant's scopeResolver returning null\n * usually means \"no tenant selected\", not \"read everything\"), so it fails\n * closed the same way. An explicit `scope: null` override bypasses that gate:\n * it is the trusted server-side caller's path (cron passes, tests), never a\n * request's own resolution. A tenant's own runtime adapters are never gated.\n * Any resolution failure (unknown adapter id, a throwing scopeResolver or\n * provider lookup) degrades to `{ ok: false }` so read paths render their\n * unavailable state instead of throwing.\n */\nexport const resolveReadContext = async (args: ResolveReadContextArgs): Promise<ReadContext> => {\n\tconst { runtime, req, adapterId } = args\n\tconst allowed = platformReadGate(runtime, req)\n\ttry {\n\t\tconst scope = args.scope !== undefined ? args.scope : await resolveScopeFor(runtime, req)\n\t\tif (runtime.scoped && args.scope === undefined && scope === null && !(await allowed())) {\n\t\t\treturn { ok: false }\n\t\t}\n\t\tconst registryScope = scope === PLATFORM_SCOPE ? null : scope\n\t\tconst registry = await resolveRegistryFor(runtime, {\n\t\t\tpayload: req.payload,\n\t\t\treq,\n\t\t\tscope: registryScope,\n\t\t})\n\t\tconst adapter = adapterId ? registry.get(adapterId) : registry.default()\n\t\tconst decision = await resolveQueryScope({\n\t\t\truntime,\n\t\t\treq,\n\t\t\tscope,\n\t\t\tadapter,\n\t\t\tplatformRead: allowed,\n\t\t})\n\t\tif (!decision.ok) {\n\t\t\treturn { ok: false }\n\t\t}\n\t\treturn { ok: true, adapter, scope: registryScope, queryScope: decision.queryScope }\n\t} catch (err) {\n\t\treq.payload.logger?.warn(`analytics: read context resolution failed: ${String(err)}`)\n\t\treturn { ok: false }\n\t}\n}\n"],"mappings":";;;;;;;;;;;AA8CA,MAAa,oBAAoB,OAChC,SACgE;CAChE,MAAM,EAAE,SAAS,KAAK,OAAO,YAAY;CACzC,MAAM,UAAU,KAAK,gBAAgB,iBAAiB,SAAS,GAAG;CAClE,IAAI,UAAA,KACH,OAAQ,MAAM,QAAQ,IAAK,EAAE,IAAI,KAAK,IAAI,EAAE,IAAI,MAAM;CAEvD,IAAI,UAAU,MACb,OAAO,EAAE,IAAI,KAAK;CAEnB,IAAI,QAAQ,iBAAiB,IAAI,QAAQ,EAAE,KAAK,CAAC,QAAQ,aAAa,eACrE,OAAQ,MAAM,QAAQ,IAAK,EAAE,IAAI,KAAK,IAAI,EAAE,IAAI,MAAM;CAEvD,OAAO;EAAE,IAAI;EAAM,YAAY;CAAM;AACtC;;;;;;;;;;;;;;;;;;AAmBA,MAAa,qBAAqB,OAAO,SAAuD;CAC/F,MAAM,EAAE,SAAS,KAAK,cAAc;CACpC,MAAM,UAAU,iBAAiB,SAAS,GAAG;CAC7C,IAAI;EACH,MAAM,QAAQ,KAAK,UAAU,KAAA,IAAY,KAAK,QAAQ,MAAM,gBAAgB,SAAS,GAAG;EACxF,IAAI,QAAQ,UAAU,KAAK,UAAU,KAAA,KAAa,UAAU,QAAQ,CAAE,MAAM,QAAQ,GACnF,OAAO,EAAE,IAAI,MAAM;EAEpB,MAAM,gBAAgB,UAAA,MAA2B,OAAO;EACxD,MAAM,WAAW,MAAM,mBAAmB,SAAS;GAClD,SAAS,IAAI;GACb;GACA,OAAO;EACR,CAAC;EACD,MAAM,UAAU,YAAY,SAAS,IAAI,SAAS,IAAI,SAAS,QAAQ;EACvE,MAAM,WAAW,MAAM,kBAAkB;GACxC;GACA;GACA;GACA;GACA,cAAc;EACf,CAAC;EACD,IAAI,CAAC,SAAS,IACb,OAAO,EAAE,IAAI,MAAM;EAEpB,OAAO;GAAE,IAAI;GAAM;GAAS,OAAO;GAAe,YAAY,SAAS;EAAW;CACnF,SAAS,KAAK;EACb,IAAI,QAAQ,QAAQ,KAAK,8CAA8C,OAAO,GAAG,GAAG;EACpF,OAAO,EAAE,IAAI,MAAM;CACpB;AACD"}
@@ -0,0 +1,42 @@
1
+ import { RawEventInput } from "../native/ingest/normalizeEvent.js";
2
+ import { PayloadRequest } from "payload";
3
+
4
+ //#region src/core/serverEvent.d.ts
5
+ /**
6
+ * One event recorded from server code. The fields a browser event carries mean exactly what
7
+ * they mean on the wire (and go through the same sanitizers); the rest say what the server
8
+ * knows that a browser request would otherwise have said for itself.
9
+ */
10
+ type ServerEventInput = Pick<RawEventInput, 'type' | 'name' | 'path' | 'hostname' | 'referrer' | 'props' | 'value' | 'currency'> & {
11
+ /**
12
+ * Attribution inputs, overlaid on `opts.req`'s own headers when there is a request.
13
+ * With neither, the event is attributed to the day's synthetic server visitor and
14
+ * reports no device. No IP is ever fabricated.
15
+ */
16
+ ip?: string;
17
+ userAgent?: string;
18
+ /**
19
+ * Analytics boundary to stamp; null is install-wide. Unset resolves from `opts.req`.
20
+ * Ignored on an unscoped install, and never validated against the scopes that exist.
21
+ */
22
+ scope?: string | null; /** IANA reporting timezone the rollup day bucket is computed in. */
23
+ timezone?: string; /** Event time; defaults to now. */
24
+ now?: Date;
25
+ };
26
+ interface ServerTrackOptions {
27
+ /** The request the event belongs to: attribution, scope and timezone all come from it. */
28
+ req?: PayloadRequest;
29
+ /**
30
+ * Wait for the write to land. On an install with a write buffer the call otherwise
31
+ * resolves as soon as the event is queued, and a failed flush only reaches the logger.
32
+ */
33
+ flush?: boolean;
34
+ }
35
+ type ServerTrack = (event: ServerEventInput, opts?: ServerTrackOptions) => Promise<void>;
36
+ /** Thrown instead of dropping the event: a server caller can handle a rejected promise. */
37
+ declare class AnalyticsTrackError extends Error {
38
+ constructor(message: string);
39
+ }
40
+ //#endregion
41
+ export { AnalyticsTrackError, ServerEventInput, ServerTrack, ServerTrackOptions };
42
+ //# sourceMappingURL=serverEvent.d.ts.map
@@ -0,0 +1,12 @@
1
+ //#region src/core/serverEvent.ts
2
+ /** Thrown instead of dropping the event: a server caller can handle a rejected promise. */
3
+ var AnalyticsTrackError = class extends Error {
4
+ constructor(message) {
5
+ super(message);
6
+ this.name = "AnalyticsTrackError";
7
+ }
8
+ };
9
+ //#endregion
10
+ export { AnalyticsTrackError };
11
+
12
+ //# sourceMappingURL=serverEvent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"serverEvent.js","names":[],"sources":["../../src/core/serverEvent.ts"],"sourcesContent":["import type { PayloadRequest } from 'payload'\nimport type { RawEventInput } from '../native/ingest/normalizeEvent'\n\n/**\n * One event recorded from server code. The fields a browser event carries mean exactly what\n * they mean on the wire (and go through the same sanitizers); the rest say what the server\n * knows that a browser request would otherwise have said for itself.\n */\nexport type ServerEventInput = Pick<\n\tRawEventInput,\n\t'type' | 'name' | 'path' | 'hostname' | 'referrer' | 'props' | 'value' | 'currency'\n> & {\n\t/**\n\t * Attribution inputs, overlaid on `opts.req`'s own headers when there is a request.\n\t * With neither, the event is attributed to the day's synthetic server visitor and\n\t * reports no device. No IP is ever fabricated.\n\t */\n\tip?: string\n\tuserAgent?: string\n\t/**\n\t * Analytics boundary to stamp; null is install-wide. Unset resolves from `opts.req`.\n\t * Ignored on an unscoped install, and never validated against the scopes that exist.\n\t */\n\tscope?: string | null\n\t/** IANA reporting timezone the rollup day bucket is computed in. */\n\ttimezone?: string\n\t/** Event time; defaults to now. */\n\tnow?: Date\n}\n\nexport interface ServerTrackOptions {\n\t/** The request the event belongs to: attribution, scope and timezone all come from it. */\n\treq?: PayloadRequest\n\t/**\n\t * Wait for the write to land. On an install with a write buffer the call otherwise\n\t * resolves as soon as the event is queued, and a failed flush only reaches the logger.\n\t */\n\tflush?: boolean\n}\n\nexport type ServerTrack = (event: ServerEventInput, opts?: ServerTrackOptions) => Promise<void>\n\n/** Thrown instead of dropping the event: a server caller can handle a rejected promise. */\nexport class AnalyticsTrackError extends Error {\n\tconstructor(message: string) {\n\t\tsuper(message)\n\t\tthis.name = 'AnalyticsTrackError'\n\t}\n}\n"],"mappings":";;AA2CA,IAAa,sBAAb,cAAyC,MAAM;CAC9C,YAAY,SAAiB;EAC5B,MAAM,OAAO;EACb,KAAK,OAAO;CACb;AACD"}
@@ -1,9 +1,15 @@
1
1
  import { BarList, BarListProps } from "../charts/BarList.js";
2
- import { TrendChart, TrendChartProps } from "../charts/TrendChart.js";
2
+ import { TrendChart, TrendChartProps, TrendPoint } from "../charts/TrendChart.js";
3
3
  import { WireSource } from "../fields/config/fetchSources.js";
4
4
  import { MetricSelectField, MetricSelectFieldProps } from "../fields/config/MetricSelectField.js";
5
5
  import { SourceSelectField } from "../fields/config/SourceSelectField.js";
6
6
  import { useAnalyticsSources } from "../fields/config/useAnalyticsSources.js";
7
7
  import { DateRangeField } from "../fields/dateRange/ui.js";
8
+ import { GoalsResponse, WireGoal } from "../goals/fetchGoals.js";
9
+ import { GoalSelectField } from "../goals/GoalSelectField.js";
10
+ import { useAnalyticsGoals } from "../goals/useAnalyticsGoals.js";
11
+ import { QueryFetchError, QueryRequest, buildQueryUrl, fetchQuery } from "../query/fetchQuery.js";
12
+ import { AnalyticsNavLink, AnalyticsNavLinkProps } from "../view/AnalyticsNavLink.js";
13
+ import { AnalyticsViewClient } from "../view/AnalyticsViewClient.js";
8
14
  import { RealtimeCounter } from "../widgets/RealtimeCounter.js";
9
- export { BarList, type BarListProps, DateRangeField, MetricSelectField, type MetricSelectFieldProps, RealtimeCounter, SourceSelectField, TrendChart, type TrendChartProps, type WireSource, useAnalyticsSources };
15
+ export { AnalyticsNavLink, type AnalyticsNavLinkProps, AnalyticsViewClient, BarList, type BarListProps, DateRangeField, GoalSelectField, type GoalsResponse, MetricSelectField, type MetricSelectFieldProps, QueryFetchError, type QueryRequest, RealtimeCounter, SourceSelectField, TrendChart, type TrendChartProps, type TrendPoint, type WireGoal, type WireSource, buildQueryUrl, fetchQuery, useAnalyticsGoals, useAnalyticsSources };
@@ -5,5 +5,10 @@ import { useAnalyticsSources } from "../fields/config/useAnalyticsSources.js";
5
5
  import { MetricSelectField } from "../fields/config/MetricSelectField.js";
6
6
  import { SourceSelectField } from "../fields/config/SourceSelectField.js";
7
7
  import { DateRangeField } from "../fields/dateRange/ui.js";
8
+ import { useAnalyticsGoals } from "../goals/useAnalyticsGoals.js";
9
+ import { GoalSelectField } from "../goals/GoalSelectField.js";
10
+ import { QueryFetchError, buildQueryUrl, fetchQuery } from "../query/fetchQuery.js";
11
+ import { AnalyticsNavLink } from "../view/AnalyticsNavLink.js";
8
12
  import { RealtimeCounter } from "../widgets/RealtimeCounter.js";
9
- export { BarList, DateRangeField, MetricSelectField, RealtimeCounter, SourceSelectField, TrendChart, useAnalyticsSources };
13
+ import { AnalyticsViewClient } from "../view/AnalyticsViewClient.js";
14
+ export { AnalyticsNavLink, AnalyticsViewClient, BarList, DateRangeField, GoalSelectField, MetricSelectField, QueryFetchError, RealtimeCounter, SourceSelectField, TrendChart, buildQueryUrl, fetchQuery, useAnalyticsGoals, useAnalyticsSources };
@@ -1,2 +1,3 @@
1
+ import { CaptureRewrite, CaptureRewriteMount, captureRewrites } from "../next/captureRewrites.js";
1
2
  import { PosthogProxyRegion, PosthogProxyRewrite, PosthogProxyRewritesOptions, posthogProxyRewrites } from "../next/posthogProxyRewrites.js";
2
- export { type PosthogProxyRegion, type PosthogProxyRewrite, type PosthogProxyRewritesOptions, posthogProxyRewrites };
3
+ export { type CaptureRewrite, type CaptureRewriteMount, type PosthogProxyRegion, type PosthogProxyRewrite, type PosthogProxyRewritesOptions, captureRewrites, posthogProxyRewrites };
@@ -1,2 +1,3 @@
1
+ import { captureRewrites } from "../next/captureRewrites.js";
1
2
  import { posthogProxyRewrites } from "../next/posthogProxyRewrites.js";
2
- export { posthogProxyRewrites };
3
+ export { captureRewrites, posthogProxyRewrites };
@@ -0,0 +1,4 @@
1
+ import { AnalyticsApi, AnalyticsProvider, AnalyticsProviderProps } from "../react/AnalyticsProvider.js";
2
+ import { TrackerBoot, TrackerBootProps } from "../react/TrackerBoot.js";
3
+ import { useAnalytics } from "../react/useAnalytics.js";
4
+ export { type AnalyticsApi, AnalyticsProvider, type AnalyticsProviderProps, TrackerBoot, type TrackerBootProps, useAnalytics };
@@ -0,0 +1,5 @@
1
+ "use client";
2
+ import { TrackerBoot } from "../react/TrackerBoot.js";
3
+ import { AnalyticsProvider } from "../react/AnalyticsProvider.js";
4
+ import { useAnalytics } from "../react/useAnalytics.js";
5
+ export { AnalyticsProvider, TrackerBoot, useAnalytics };
@@ -1,16 +1,23 @@
1
1
  import { AnalyticsFilter, DateRange, DimensionKey, MetricKey } from "../core/contract.js";
2
2
  import { CapabilityRequirement } from "../core/capabilities.js";
3
+ import { AnalyticsViewClientProps, ViewGoal } from "../view/viewProps.js";
3
4
  import { ReadForWidgetRealtimeArgs, RealtimePoint, WidgetRealtimeResult, WidgetRealtimeStatus, readForWidgetRealtime } from "../widgets/readForWidgetRealtime.js";
5
+ import { TrackerConfig, TrackerSlotConfig } from "../capture/trackerConfig.js";
6
+ import { getTrackerConfig } from "../capture/getTrackerConfig.js";
4
7
  import { AnalyticsStatField } from "../fields/AnalyticsStatField.js";
5
8
  import { AnalyticsPanelField } from "../fields/AnalyticsPanelField.js";
6
9
  import { formatMetricValue } from "../fields/format.js";
7
10
  import { ReadForWidgetArgs, WidgetReadResult, WidgetReadStatus, readForWidget } from "../widgets/readForWidget.js";
8
11
  import { ReadForWidgetSeriesArgs, SeriesPoint, WidgetSeriesResult, readForWidgetSeries } from "../widgets/readForWidgetSeries.js";
9
12
  import { FieldReadResult, FieldReadStatus, ReadForFieldArgs, readForField } from "../fields/readForDocument.js";
13
+ import { AnalyticsScripts, AnalyticsScriptsProps } from "../rsc/AnalyticsScripts.js";
14
+ import { AnalyticsView, AnalyticsViewProps } from "../view/AnalyticsView.js";
10
15
  import { AnalyticsBreakdownWidget } from "../widgets/AnalyticsBreakdownWidget.js";
16
+ import { AnalyticsGoalsWidget } from "../widgets/AnalyticsGoalsWidget.js";
11
17
  import { AnalyticsMetricWidget } from "../widgets/AnalyticsMetricWidget.js";
12
18
  import { AnalyticsRealtimeWidget } from "../widgets/AnalyticsRealtimeWidget.js";
13
19
  import { AnalyticsTrendWidget } from "../widgets/AnalyticsTrendWidget.js";
14
20
  import { cardStyle, labelStyle } from "../widgets/cardChrome.js";
15
21
  import { BreakdownRow, ReadForWidgetBreakdownArgs, WidgetBreakdownResult, readForWidgetBreakdown } from "../widgets/readForWidgetBreakdown.js";
16
- export { AnalyticsBreakdownWidget, type AnalyticsFilter, AnalyticsMetricWidget, AnalyticsPanelField, AnalyticsRealtimeWidget, AnalyticsStatField, AnalyticsTrendWidget, type BreakdownRow, type CapabilityRequirement, type DateRange, type DimensionKey, type FieldReadResult, type FieldReadStatus, type MetricKey, type ReadForFieldArgs, type ReadForWidgetArgs, type ReadForWidgetBreakdownArgs, type ReadForWidgetRealtimeArgs, type ReadForWidgetSeriesArgs, type RealtimePoint, type SeriesPoint, type WidgetBreakdownResult, type WidgetReadResult, type WidgetReadStatus, type WidgetRealtimeResult, type WidgetRealtimeStatus, type WidgetSeriesResult, formatMetricValue, readForField, readForWidget, readForWidgetBreakdown, readForWidgetRealtime, readForWidgetSeries, cardStyle as widgetCardStyle, labelStyle as widgetLabelStyle };
22
+ import { GoalRow, ReadForWidgetGoalsArgs, WidgetGoalsResult, readForWidgetGoals } from "../widgets/readForWidgetGoals.js";
23
+ export { AnalyticsBreakdownWidget, type AnalyticsFilter, AnalyticsGoalsWidget, AnalyticsMetricWidget, AnalyticsPanelField, AnalyticsRealtimeWidget, AnalyticsScripts, type AnalyticsScriptsProps, AnalyticsStatField, AnalyticsTrendWidget, AnalyticsView, type AnalyticsViewClientProps, type AnalyticsViewProps, type BreakdownRow, type CapabilityRequirement, type DateRange, type DimensionKey, type FieldReadResult, type FieldReadStatus, type GoalRow, type MetricKey, type ReadForFieldArgs, type ReadForWidgetArgs, type ReadForWidgetBreakdownArgs, type ReadForWidgetGoalsArgs, type ReadForWidgetRealtimeArgs, type ReadForWidgetSeriesArgs, type RealtimePoint, type SeriesPoint, type TrackerConfig, type TrackerSlotConfig, type ViewGoal, type WidgetBreakdownResult, type WidgetGoalsResult, type WidgetReadResult, type WidgetReadStatus, type WidgetRealtimeResult, type WidgetRealtimeStatus, type WidgetSeriesResult, formatMetricValue, getTrackerConfig, readForField, readForWidget, readForWidgetBreakdown, readForWidgetGoals, readForWidgetRealtime, readForWidgetSeries, cardStyle as widgetCardStyle, labelStyle as widgetLabelStyle };
@@ -4,11 +4,16 @@ import { readForWidgetRealtime } from "../widgets/readForWidgetRealtime.js";
4
4
  import { readForWidget } from "../widgets/readForWidget.js";
5
5
  import { readForWidgetBreakdown } from "../widgets/readForWidgetBreakdown.js";
6
6
  import { formatMetricValue } from "../fields/format.js";
7
+ import { cardStyle, labelStyle } from "../widgets/cardChrome.js";
8
+ import { getTrackerConfig } from "../capture/getTrackerConfig.js";
7
9
  import { AnalyticsStatField } from "../fields/AnalyticsStatField.js";
8
10
  import { AnalyticsPanelField } from "../fields/AnalyticsPanelField.js";
9
- import { cardStyle, labelStyle } from "../widgets/cardChrome.js";
11
+ import { AnalyticsScripts } from "../rsc/AnalyticsScripts.js";
12
+ import { AnalyticsView } from "../view/AnalyticsView.js";
10
13
  import AnalyticsBreakdownWidget from "../widgets/AnalyticsBreakdownWidget.js";
14
+ import { readForWidgetGoals } from "../widgets/readForWidgetGoals.js";
15
+ import AnalyticsGoalsWidget from "../widgets/AnalyticsGoalsWidget.js";
11
16
  import AnalyticsMetricWidget from "../widgets/AnalyticsMetricWidget.js";
12
17
  import AnalyticsRealtimeWidget from "../widgets/AnalyticsRealtimeWidget.js";
13
18
  import AnalyticsTrendWidget from "../widgets/AnalyticsTrendWidget.js";
14
- export { AnalyticsBreakdownWidget, AnalyticsMetricWidget, AnalyticsPanelField, AnalyticsRealtimeWidget, AnalyticsStatField, AnalyticsTrendWidget, formatMetricValue, readForField, readForWidget, readForWidgetBreakdown, readForWidgetRealtime, readForWidgetSeries, cardStyle as widgetCardStyle, labelStyle as widgetLabelStyle };
19
+ export { AnalyticsBreakdownWidget, AnalyticsGoalsWidget, AnalyticsMetricWidget, AnalyticsPanelField, AnalyticsRealtimeWidget, AnalyticsScripts, AnalyticsStatField, AnalyticsTrendWidget, AnalyticsView, formatMetricValue, getTrackerConfig, readForField, readForWidget, readForWidgetBreakdown, readForWidgetGoals, readForWidgetRealtime, readForWidgetSeries, cardStyle as widgetCardStyle, labelStyle as widgetLabelStyle };
@@ -0,0 +1,18 @@
1
+ import { TrackerGoal } from "../goals/types.js";
2
+ import { CaptureSnippet, SnippetScript } from "../core/capture.js";
3
+ import { ResolvedAutoCapture } from "../core/options.js";
4
+ import { TrackerConfig, TrackerSlotConfig } from "../capture/trackerConfig.js";
5
+ import { ConsentState, LoadScript, Sink, Tracker, TrackerEvent, TrackerOptions, TrackerWindow } from "../tracker/types.js";
6
+ import { AutoCapture, AutoCaptureHandlers, DOWNLOAD_EVENT, GOAL_ATTRIBUTE, OUTBOUND_EVENT, SCROLL_EVENT, createAutoCapture } from "../tracker/autoCapture.js";
7
+ import { CONSENT_QUEUE_LIMIT, CONSENT_STORAGE_KEY, createConsentQueue, readConsent, writeConsent } from "../tracker/consent.js";
8
+ import { createNoopTracker, createTracker } from "../tracker/createTracker.js";
9
+ import { DEFAULT_TRACKER_ENDPOINT, InitTrackerArgs, initTracker } from "../tracker/initTracker.js";
10
+ import { createScriptLoader } from "../tracker/loadScript.js";
11
+ import { PageTracking, createPageTracking } from "../tracker/pageTracking.js";
12
+ import { TrackerLease, acquireTracker } from "../tracker/registry.js";
13
+ import { PAGEVIEW_BUFFER_MS, createNativeSink } from "../tracker/sinks/native.js";
14
+ import { VendorSinkArgs } from "../tracker/sinks/vendor.js";
15
+ import { createPlausibleSink } from "../tracker/sinks/plausible.js";
16
+ import { createPosthogSink } from "../tracker/sinks/posthog.js";
17
+ import { createUmamiSink } from "../tracker/sinks/umami.js";
18
+ export { type AutoCapture, type AutoCaptureHandlers, CONSENT_QUEUE_LIMIT, CONSENT_STORAGE_KEY, type CaptureSnippet, type ConsentState, DEFAULT_TRACKER_ENDPOINT, DOWNLOAD_EVENT, GOAL_ATTRIBUTE, type InitTrackerArgs, type LoadScript, OUTBOUND_EVENT, PAGEVIEW_BUFFER_MS, type PageTracking, type ResolvedAutoCapture, SCROLL_EVENT, type Sink, type SnippetScript, type Tracker, type TrackerConfig, type TrackerEvent, type TrackerGoal, type TrackerLease, type TrackerOptions, type TrackerSlotConfig, type TrackerWindow, type VendorSinkArgs, acquireTracker, createAutoCapture, createConsentQueue, createNativeSink, createNoopTracker, createPageTracking, createPlausibleSink, createPosthogSink, createScriptLoader, createTracker, createUmamiSink, initTracker, readConsent, writeConsent };
@@ -0,0 +1,12 @@
1
+ import { DOWNLOAD_EVENT, GOAL_ATTRIBUTE, OUTBOUND_EVENT, SCROLL_EVENT, createAutoCapture } from "../tracker/autoCapture.js";
2
+ import { CONSENT_QUEUE_LIMIT, CONSENT_STORAGE_KEY, createConsentQueue, readConsent, writeConsent } from "../tracker/consent.js";
3
+ import { createScriptLoader } from "../tracker/loadScript.js";
4
+ import { createPageTracking } from "../tracker/pageTracking.js";
5
+ import { PAGEVIEW_BUFFER_MS, createNativeSink } from "../tracker/sinks/native.js";
6
+ import { createPlausibleSink } from "../tracker/sinks/plausible.js";
7
+ import { createPosthogSink } from "../tracker/sinks/posthog.js";
8
+ import { createUmamiSink } from "../tracker/sinks/umami.js";
9
+ import { createNoopTracker, createTracker } from "../tracker/createTracker.js";
10
+ import { acquireTracker } from "../tracker/registry.js";
11
+ import { DEFAULT_TRACKER_ENDPOINT, initTracker } from "../tracker/initTracker.js";
12
+ export { CONSENT_QUEUE_LIMIT, CONSENT_STORAGE_KEY, DEFAULT_TRACKER_ENDPOINT, DOWNLOAD_EVENT, GOAL_ATTRIBUTE, OUTBOUND_EVENT, PAGEVIEW_BUFFER_MS, SCROLL_EVENT, acquireTracker, createAutoCapture, createConsentQueue, createNativeSink, createNoopTracker, createPageTracking, createPlausibleSink, createPosthogSink, createScriptLoader, createTracker, createUmamiSink, initTracker, readConsent, writeConsent };
@@ -1,7 +1,18 @@
1
- import { AdapterContext, AdapterRegisterContext, AnalyticsAdapter, AnalyticsAdapterFactory, AnalyticsCapabilities, AnalyticsFilter, AnalyticsQuery, AnalyticsResult, AnalyticsRow, DateRange, DimensionKey, FilterOperator, Granularity, MetricKey, PLATFORM_SCOPE, RateLimitDescriptor } from "../core/contract.js";
1
+ import { Goal, GoalMatch, TrackerGoal } from "../goals/types.js";
2
+ import { CaptureClientKind, CaptureSnippet, CaptureSupport, ProxyDescriptor, ProxyRoute, SnippetScript } from "../core/capture.js";
3
+ import { ServerEventInput, ServerTrack, ServerTrackOptions } from "../core/serverEvent.js";
4
+ import { AdapterContext, AdapterRegisterContext, AnalyticsAdapter, AnalyticsAdapterFactory, AnalyticsCapabilities, AnalyticsFilter, AnalyticsQuery, AnalyticsResult, AnalyticsRow, DIMENSION_KEYS, DateRange, DimensionKey, FILTER_OPERATORS, FilterOperator, Granularity, MetricKey, PLATFORM_SCOPE, RateLimitDescriptor } from "../core/contract.js";
2
5
  import { SerializedCapabilities } from "../core/capabilities.js";
6
+ import { QueryError, QueryErrorCode } from "../query/errors.js";
7
+ import { QueryErrorResponse, QueryResponse, QuerySourceRef, SerializedAnalyticsQuery } from "../query/response.js";
8
+ import { QueryRequest } from "../query/fetchQuery.js";
3
9
  import { AnalyticsBinding, BindingContext, HostnameResolver, PathResolver } from "../binding/types.js";
4
10
  import { TimeframePreset } from "../timeframe/presets.js";
11
+ import { AnalyticsPluginOptions, AnalyticsViewAccess, AnalyticsViewOptions, ResolvedAutoCapture } from "../core/options.js";
12
+ import { AnalyticsViewClientProps, ViewGoal } from "../view/viewProps.js";
13
+ import { TrackerConfig, TrackerSlotConfig } from "../capture/trackerConfig.js";
5
14
  import { AnalyticsFieldsOptions, AnalyticsMetricLabel, AnalyticsMetricLabels, AnalyticsStatOptions, AnalyticsStatRowOptions, AnalyticsTabOptions } from "../fields/factories.js";
6
- import { AnalyticsPluginOptions } from "../core/options.js";
7
- export { AdapterContext, AdapterRegisterContext, AnalyticsAdapter, AnalyticsAdapterFactory, type AnalyticsBinding, AnalyticsCapabilities, type AnalyticsFieldsOptions, AnalyticsFilter, type AnalyticsMetricLabel, type AnalyticsMetricLabels, type AnalyticsPluginOptions, AnalyticsQuery, AnalyticsResult, AnalyticsRow, type AnalyticsStatOptions, type AnalyticsStatRowOptions, type AnalyticsTabOptions, type BindingContext, DateRange, DimensionKey, FilterOperator, Granularity, type HostnameResolver, MetricKey, PLATFORM_SCOPE, type PathResolver, RateLimitDescriptor, type SerializedCapabilities, type TimeframePreset };
15
+ import { GoalFieldOptions } from "../goals/goalField.js";
16
+ import { GoalActionDefinition, GoalActionRunArgs, TrackGoalActionOptions } from "../goals/trackGoalAction.js";
17
+ import { ParseResult, ParsedQuery } from "../query/parse.js";
18
+ export { AdapterContext, AdapterRegisterContext, AnalyticsAdapter, AnalyticsAdapterFactory, type AnalyticsBinding, AnalyticsCapabilities, type AnalyticsFieldsOptions, AnalyticsFilter, type AnalyticsMetricLabel, type AnalyticsMetricLabels, type AnalyticsPluginOptions, AnalyticsQuery, AnalyticsResult, AnalyticsRow, type AnalyticsStatOptions, type AnalyticsStatRowOptions, type AnalyticsTabOptions, type AnalyticsViewAccess, type AnalyticsViewClientProps, type AnalyticsViewOptions, type BindingContext, CaptureClientKind, CaptureSnippet, CaptureSupport, DIMENSION_KEYS, DateRange, DimensionKey, FILTER_OPERATORS, FilterOperator, type Goal, type GoalActionDefinition, type GoalActionRunArgs, type GoalFieldOptions, type GoalMatch, Granularity, type HostnameResolver, MetricKey, PLATFORM_SCOPE, type ParseResult, type ParsedQuery, type PathResolver, ProxyDescriptor, ProxyRoute, type QueryError, type QueryErrorCode, type QueryErrorResponse, type QueryRequest, type QueryResponse, type QuerySourceRef, RateLimitDescriptor, type ResolvedAutoCapture, type SerializedAnalyticsQuery, type SerializedCapabilities, type ServerEventInput, type ServerTrack, type ServerTrackOptions, SnippetScript, type TimeframePreset, type TrackGoalActionOptions, type TrackerConfig, type TrackerGoal, type TrackerSlotConfig, type ViewGoal };
@@ -1,2 +1,2 @@
1
- import { PLATFORM_SCOPE } from "../core/contract.js";
2
- export { PLATFORM_SCOPE };
1
+ import { DIMENSION_KEYS, FILTER_OPERATORS, PLATFORM_SCOPE } from "../core/contract.js";
2
+ export { DIMENSION_KEYS, FILTER_OPERATORS, PLATFORM_SCOPE };
@@ -1,12 +1,12 @@
1
1
  "use client";
2
+ import { DOCUMENT_PATH } from "../plugin/paths.js";
2
3
  import { keys } from "../translations/keys.js";
3
4
  import { TIMEFRAME_PRESETS } from "../timeframe/presets.js";
4
5
  import { METRIC_KEYS, TIMEFRAME_KEYS } from "../translations/metricKeys.js";
5
- import { DOCUMENT_PATH } from "../plugin/paths.js";
6
6
  import { TrendChart } from "../charts/TrendChart.js";
7
7
  import { useTranslation as useTranslation$1 } from "../translations/useTranslation.js";
8
- import { AnalyticsEmptyState, isNewDocumentAnalytics } from "./emptyState.js";
9
8
  import { formatMetricValue } from "./format.js";
9
+ import { AnalyticsEmptyState, isNewDocumentAnalytics } from "./emptyState.js";
10
10
  import { ComparisonDelta } from "../widgets/ComparisonDelta.js";
11
11
  import { bucketSeries } from "../charts/bucket.js";
12
12
  import { useCallback, useState } from "react";
@@ -1,6 +1,6 @@
1
1
  import { asTranslate } from "../translations/server.js";
2
- import { readForField } from "./readForDocument.js";
3
2
  import { METRIC_KEYS } from "../translations/metricKeys.js";
3
+ import { readForField } from "./readForDocument.js";
4
4
  import { resolveMetricLabel } from "./AnalyticsStatField.js";
5
5
  import { jsx } from "react/jsx-runtime";
6
6
  //#region src/fields/AnalyticsPanelField.tsx
@@ -1,9 +1,9 @@
1
1
  import { keys } from "../translations/keys.js";
2
2
  import { asTranslate } from "../translations/server.js";
3
- import { readForField } from "./readForDocument.js";
4
3
  import { METRIC_KEYS, TIMEFRAME_KEYS } from "../translations/metricKeys.js";
5
- import { AnalyticsEmptyState, isNewDocumentAnalytics } from "./emptyState.js";
4
+ import { readForField } from "./readForDocument.js";
6
5
  import { formatMetricValue } from "./format.js";
6
+ import { AnalyticsEmptyState, isNewDocumentAnalytics } from "./emptyState.js";
7
7
  import { jsx, jsxs } from "react/jsx-runtime";
8
8
  //#region src/fields/AnalyticsStatField.tsx
9
9
  const resolveMetricLabel = (override, i18n, fallback) => {
@@ -14,10 +14,10 @@ import { SelectInput, useField, useFormFields } from "@payloadcms/ui";
14
14
  * narrowing filters out; the read path degrades that case on its own.
15
15
  */
16
16
  const MetricSelectField = (props) => {
17
- const { field, path, readOnly, requires, sourceFieldPath = "dataSource" } = props;
17
+ const { field, path: pathFromProps, readOnly, requires, sourceFieldPath = "dataSource" } = props;
18
18
  const { i18n } = useTranslation$1();
19
19
  const locale = i18n.language;
20
- const { setValue, showError, value } = useField({ path });
20
+ const { path, setValue, showError, value } = useField({ potentiallyStalePath: pathFromProps });
21
21
  const { sources } = useAnalyticsSources();
22
22
  const sourceId = useFormFields(([fields]) => fields?.[sourceFieldPath]?.value);
23
23
  const options = narrowMetricOptions({
@@ -1 +1 @@
1
- {"version":3,"file":"MetricSelectField.js","names":["useTranslation"],"sources":["../../../src/fields/config/MetricSelectField.tsx"],"sourcesContent":["'use client'\n\nimport { type ReactSelectOption, SelectInput, useField, useFormFields } from '@payloadcms/ui'\nimport type { SelectFieldClientProps } from 'payload'\nimport { useMemo } from 'react'\nimport type { CapabilityRequirement } from '../../core/capabilities'\nimport { useTranslation } from '../../translations/useTranslation'\nimport { narrowMetricOptions } from './narrow'\nimport { toSelectOption } from './toSelectOption'\nimport { useAnalyticsSources } from './useAnalyticsSources'\n\nexport type MetricSelectFieldProps = SelectFieldClientProps & {\n\t/** Extra capability requirement (beyond the picked metric) a widget's other config imposes, e.g. a breakdown dimension. */\n\trequires?: Omit<CapabilityRequirement, 'metrics'>\n\t/**\n\t * Path of the sibling source select this picker narrows against, for\n\t * custom widgets whose source field is named differently. Defaults to\n\t * `'dataSource'`.\n\t */\n\tsourceFieldPath?: string\n}\n\n/**\n * Metric picker for scoped widget config: narrows the static option list to\n * what the sibling source field's selected source can actually serve, once\n * the sources endpoint answers. Never clears an already-picked value that\n * narrowing filters out; the read path degrades that case on its own.\n */\nexport const MetricSelectField = (props: MetricSelectFieldProps) => {\n\tconst { field, path, readOnly, requires, sourceFieldPath = 'dataSource' } = props\n\tconst { i18n } = useTranslation()\n\tconst locale = i18n.language\n\tconst { setValue, showError, value } = useField<string>({ path })\n\tconst { sources } = useAnalyticsSources()\n\tconst sourceId = useFormFields(\n\t\t([fields]) => fields?.[sourceFieldPath]?.value as string | undefined\n\t)\n\n\tconst staticOptions = useMemo(\n\t\t() => field.options.map((option) => toSelectOption(option, locale)),\n\t\t[field.options, locale]\n\t)\n\n\tconst options = narrowMetricOptions({\n\t\toptions: staticOptions,\n\t\trequires,\n\t\tsourceId,\n\t\tsources: sources ?? [],\n\t}).map((option) => ({ label: option.label as string, value: option.value }))\n\n\treturn (\n\t\t<SelectInput\n\t\t\tisClearable={false}\n\t\t\tlabel={field.label}\n\t\t\tname={field.name}\n\t\t\tonChange={(selected: ReactSelectOption | ReactSelectOption[]) => {\n\t\t\t\tconst option = Array.isArray(selected) ? selected[0] : selected\n\t\t\t\tsetValue(option ? String(option.value) : null)\n\t\t\t}}\n\t\t\toptions={options}\n\t\t\tpath={path}\n\t\t\treadOnly={readOnly}\n\t\t\trequired={field.required}\n\t\t\tshowError={showError}\n\t\t\tvalue={value}\n\t\t/>\n\t)\n}\n"],"mappings":";;;;;;;;;;;;;;;AA4BA,MAAa,qBAAqB,UAAkC;CACnE,MAAM,EAAE,OAAO,MAAM,UAAU,UAAU,kBAAkB,iBAAiB;CAC5E,MAAM,EAAE,SAASA,iBAAe;CAChC,MAAM,SAAS,KAAK;CACpB,MAAM,EAAE,UAAU,WAAW,UAAU,SAAiB,EAAE,KAAK,CAAC;CAChE,MAAM,EAAE,YAAY,oBAAoB;CACxC,MAAM,WAAW,eACf,CAAC,YAAY,SAAS,kBAAkB,KAC1C;CAOA,MAAM,UAAU,oBAAoB;EACnC,SANqB,cACf,MAAM,QAAQ,KAAK,WAAW,eAAe,QAAQ,MAAM,CAAC,GAClE,CAAC,MAAM,SAAS,MAAM,CAID;EACrB;EACA;EACA,SAAS,WAAW,CAAC;CACtB,CAAC,EAAE,KAAK,YAAY;EAAE,OAAO,OAAO;EAAiB,OAAO,OAAO;CAAM,EAAE;CAE3E,OACC,oBAAC,aAAD;EACC,aAAa;EACb,OAAO,MAAM;EACb,MAAM,MAAM;EACZ,WAAW,aAAsD;GAChE,MAAM,SAAS,MAAM,QAAQ,QAAQ,IAAI,SAAS,KAAK;GACvD,SAAS,SAAS,OAAO,OAAO,KAAK,IAAI,IAAI;EAC9C;EACS;EACH;EACI;EACV,UAAU,MAAM;EACL;EACJ;CACP,CAAA;AAEH"}
1
+ {"version":3,"file":"MetricSelectField.js","names":["useTranslation"],"sources":["../../../src/fields/config/MetricSelectField.tsx"],"sourcesContent":["'use client'\n\nimport { type ReactSelectOption, SelectInput, useField, useFormFields } from '@payloadcms/ui'\nimport type { SelectFieldClientProps } from 'payload'\nimport { useMemo } from 'react'\nimport type { CapabilityRequirement } from '../../core/capabilities'\nimport { useTranslation } from '../../translations/useTranslation'\nimport { narrowMetricOptions } from './narrow'\nimport { toSelectOption } from './toSelectOption'\nimport { useAnalyticsSources } from './useAnalyticsSources'\n\nexport type MetricSelectFieldProps = SelectFieldClientProps & {\n\t/** Extra capability requirement (beyond the picked metric) a widget's other config imposes, e.g. a breakdown dimension. */\n\trequires?: Omit<CapabilityRequirement, 'metrics'>\n\t/**\n\t * Path of the sibling source select this picker narrows against, for\n\t * custom widgets whose source field is named differently. Defaults to\n\t * `'dataSource'`.\n\t */\n\tsourceFieldPath?: string\n}\n\n/**\n * Metric picker for scoped widget config: narrows the static option list to\n * what the sibling source field's selected source can actually serve, once\n * the sources endpoint answers. Never clears an already-picked value that\n * narrowing filters out; the read path degrades that case on its own.\n */\nexport const MetricSelectField = (props: MetricSelectFieldProps) => {\n\tconst { field, path: pathFromProps, readOnly, requires, sourceFieldPath = 'dataSource' } = props\n\tconst { i18n } = useTranslation()\n\tconst locale = i18n.language\n\tconst { path, setValue, showError, value } = useField<string>({\n\t\tpotentiallyStalePath: pathFromProps,\n\t})\n\tconst { sources } = useAnalyticsSources()\n\tconst sourceId = useFormFields(\n\t\t([fields]) => fields?.[sourceFieldPath]?.value as string | undefined\n\t)\n\n\tconst staticOptions = useMemo(\n\t\t() => field.options.map((option) => toSelectOption(option, locale)),\n\t\t[field.options, locale]\n\t)\n\n\tconst options = narrowMetricOptions({\n\t\toptions: staticOptions,\n\t\trequires,\n\t\tsourceId,\n\t\tsources: sources ?? [],\n\t}).map((option) => ({ label: option.label as string, value: option.value }))\n\n\treturn (\n\t\t<SelectInput\n\t\t\tisClearable={false}\n\t\t\tlabel={field.label}\n\t\t\tname={field.name}\n\t\t\tonChange={(selected: ReactSelectOption | ReactSelectOption[]) => {\n\t\t\t\tconst option = Array.isArray(selected) ? selected[0] : selected\n\t\t\t\tsetValue(option ? String(option.value) : null)\n\t\t\t}}\n\t\t\toptions={options}\n\t\t\tpath={path}\n\t\t\treadOnly={readOnly}\n\t\t\trequired={field.required}\n\t\t\tshowError={showError}\n\t\t\tvalue={value}\n\t\t/>\n\t)\n}\n"],"mappings":";;;;;;;;;;;;;;;AA4BA,MAAa,qBAAqB,UAAkC;CACnE,MAAM,EAAE,OAAO,MAAM,eAAe,UAAU,UAAU,kBAAkB,iBAAiB;CAC3F,MAAM,EAAE,SAASA,iBAAe;CAChC,MAAM,SAAS,KAAK;CACpB,MAAM,EAAE,MAAM,UAAU,WAAW,UAAU,SAAiB,EAC7D,sBAAsB,cACvB,CAAC;CACD,MAAM,EAAE,YAAY,oBAAoB;CACxC,MAAM,WAAW,eACf,CAAC,YAAY,SAAS,kBAAkB,KAC1C;CAOA,MAAM,UAAU,oBAAoB;EACnC,SANqB,cACf,MAAM,QAAQ,KAAK,WAAW,eAAe,QAAQ,MAAM,CAAC,GAClE,CAAC,MAAM,SAAS,MAAM,CAID;EACrB;EACA;EACA,SAAS,WAAW,CAAC;CACtB,CAAC,EAAE,KAAK,YAAY;EAAE,OAAO,OAAO;EAAiB,OAAO,OAAO;CAAM,EAAE;CAE3E,OACC,oBAAC,aAAD;EACC,aAAa;EACb,OAAO,MAAM;EACb,MAAM,MAAM;EACZ,WAAW,aAAsD;GAChE,MAAM,SAAS,MAAM,QAAQ,QAAQ,IAAI,SAAS,KAAK;GACvD,SAAS,SAAS,OAAO,OAAO,KAAK,IAAI,IAAI;EAC9C;EACS;EACH;EACI;EACV,UAAU,MAAM;EACL;EACJ;CACP,CAAA;AAEH"}
@@ -14,10 +14,10 @@ import { SelectInput, useField } from "@payloadcms/ui";
14
14
  * emptying the picker.
15
15
  */
16
16
  const SourceSelectField = (props) => {
17
- const { field, path, readOnly } = props;
17
+ const { field, path: pathFromProps, readOnly } = props;
18
18
  const { i18n } = useTranslation$1();
19
19
  const locale = i18n.language;
20
- const { setValue, showError, value } = useField({ path });
20
+ const { path, setValue, showError, value } = useField({ potentiallyStalePath: pathFromProps });
21
21
  const { sources } = useAnalyticsSources();
22
22
  const staticOptions = useMemo(() => field.options.map((option) => toSelectOption(option, locale)), [field.options, locale]);
23
23
  const options = sources && sources.length > 0 ? sources.map((source) => ({
@@ -1 +1 @@
1
- {"version":3,"file":"SourceSelectField.js","names":["useTranslation"],"sources":["../../../src/fields/config/SourceSelectField.tsx"],"sourcesContent":["'use client'\n\nimport { type ReactSelectOption, SelectInput, useField } from '@payloadcms/ui'\nimport type { SelectFieldClientProps } from 'payload'\nimport { useMemo } from 'react'\nimport { useTranslation } from '../../translations/useTranslation'\nimport { toSelectOption } from './toSelectOption'\nimport { useAnalyticsSources } from './useAnalyticsSources'\n\n/**\n * Source picker for scoped widget config: starts from the field's static\n * option list and, once the caller-scope sources endpoint answers, replaces\n * it with the live adapter list so a tenant only ever sees sources it can\n * actually read from. A failed fetch keeps the static list rather than\n * emptying the picker.\n */\nexport const SourceSelectField = (props: SelectFieldClientProps) => {\n\tconst { field, path, readOnly } = props\n\tconst { i18n } = useTranslation()\n\tconst locale = i18n.language\n\tconst { setValue, showError, value } = useField<string>({ path })\n\tconst { sources } = useAnalyticsSources()\n\n\tconst staticOptions = useMemo(\n\t\t() => field.options.map((option) => toSelectOption(option, locale)),\n\t\t[field.options, locale]\n\t)\n\n\tconst options =\n\t\tsources && sources.length > 0\n\t\t\t? sources.map((source) => ({ value: source.id, label: source.label }))\n\t\t\t: staticOptions\n\n\treturn (\n\t\t<SelectInput\n\t\t\tisClearable={false}\n\t\t\tlabel={field.label}\n\t\t\tname={field.name}\n\t\t\tonChange={(selected: ReactSelectOption | ReactSelectOption[]) => {\n\t\t\t\tconst option = Array.isArray(selected) ? selected[0] : selected\n\t\t\t\tsetValue(option ? String(option.value) : null)\n\t\t\t}}\n\t\t\toptions={options}\n\t\t\tpath={path}\n\t\t\treadOnly={readOnly}\n\t\t\trequired={field.required}\n\t\t\tshowError={showError}\n\t\t\tvalue={value}\n\t\t/>\n\t)\n}\n"],"mappings":";;;;;;;;;;;;;;;AAgBA,MAAa,qBAAqB,UAAkC;CACnE,MAAM,EAAE,OAAO,MAAM,aAAa;CAClC,MAAM,EAAE,SAASA,iBAAe;CAChC,MAAM,SAAS,KAAK;CACpB,MAAM,EAAE,UAAU,WAAW,UAAU,SAAiB,EAAE,KAAK,CAAC;CAChE,MAAM,EAAE,YAAY,oBAAoB;CAExC,MAAM,gBAAgB,cACf,MAAM,QAAQ,KAAK,WAAW,eAAe,QAAQ,MAAM,CAAC,GAClE,CAAC,MAAM,SAAS,MAAM,CACvB;CAEA,MAAM,UACL,WAAW,QAAQ,SAAS,IACzB,QAAQ,KAAK,YAAY;EAAE,OAAO,OAAO;EAAI,OAAO,OAAO;CAAM,EAAE,IACnE;CAEJ,OACC,oBAAC,aAAD;EACC,aAAa;EACb,OAAO,MAAM;EACb,MAAM,MAAM;EACZ,WAAW,aAAsD;GAChE,MAAM,SAAS,MAAM,QAAQ,QAAQ,IAAI,SAAS,KAAK;GACvD,SAAS,SAAS,OAAO,OAAO,KAAK,IAAI,IAAI;EAC9C;EACS;EACH;EACI;EACV,UAAU,MAAM;EACL;EACJ;CACP,CAAA;AAEH"}
1
+ {"version":3,"file":"SourceSelectField.js","names":["useTranslation"],"sources":["../../../src/fields/config/SourceSelectField.tsx"],"sourcesContent":["'use client'\n\nimport { type ReactSelectOption, SelectInput, useField } from '@payloadcms/ui'\nimport type { SelectFieldClientProps } from 'payload'\nimport { useMemo } from 'react'\nimport { useTranslation } from '../../translations/useTranslation'\nimport { toSelectOption } from './toSelectOption'\nimport { useAnalyticsSources } from './useAnalyticsSources'\n\n/**\n * Source picker for scoped widget config: starts from the field's static\n * option list and, once the caller-scope sources endpoint answers, replaces\n * it with the live adapter list so a tenant only ever sees sources it can\n * actually read from. A failed fetch keeps the static list rather than\n * emptying the picker.\n */\nexport const SourceSelectField = (props: SelectFieldClientProps) => {\n\tconst { field, path: pathFromProps, readOnly } = props\n\tconst { i18n } = useTranslation()\n\tconst locale = i18n.language\n\tconst { path, setValue, showError, value } = useField<string>({\n\t\tpotentiallyStalePath: pathFromProps,\n\t})\n\tconst { sources } = useAnalyticsSources()\n\n\tconst staticOptions = useMemo(\n\t\t() => field.options.map((option) => toSelectOption(option, locale)),\n\t\t[field.options, locale]\n\t)\n\n\tconst options =\n\t\tsources && sources.length > 0\n\t\t\t? sources.map((source) => ({ value: source.id, label: source.label }))\n\t\t\t: staticOptions\n\n\treturn (\n\t\t<SelectInput\n\t\t\tisClearable={false}\n\t\t\tlabel={field.label}\n\t\t\tname={field.name}\n\t\t\tonChange={(selected: ReactSelectOption | ReactSelectOption[]) => {\n\t\t\t\tconst option = Array.isArray(selected) ? selected[0] : selected\n\t\t\t\tsetValue(option ? String(option.value) : null)\n\t\t\t}}\n\t\t\toptions={options}\n\t\t\tpath={path}\n\t\t\treadOnly={readOnly}\n\t\t\trequired={field.required}\n\t\t\tshowError={showError}\n\t\t\tvalue={value}\n\t\t/>\n\t)\n}\n"],"mappings":";;;;;;;;;;;;;;;AAgBA,MAAa,qBAAqB,UAAkC;CACnE,MAAM,EAAE,OAAO,MAAM,eAAe,aAAa;CACjD,MAAM,EAAE,SAASA,iBAAe;CAChC,MAAM,SAAS,KAAK;CACpB,MAAM,EAAE,MAAM,UAAU,WAAW,UAAU,SAAiB,EAC7D,sBAAsB,cACvB,CAAC;CACD,MAAM,EAAE,YAAY,oBAAoB;CAExC,MAAM,gBAAgB,cACf,MAAM,QAAQ,KAAK,WAAW,eAAe,QAAQ,MAAM,CAAC,GAClE,CAAC,MAAM,SAAS,MAAM,CACvB;CAEA,MAAM,UACL,WAAW,QAAQ,SAAS,IACzB,QAAQ,KAAK,YAAY;EAAE,OAAO,OAAO;EAAI,OAAO,OAAO;CAAM,EAAE,IACnE;CAEJ,OACC,oBAAC,aAAD;EACC,aAAa;EACb,OAAO,MAAM;EACb,MAAM,MAAM;EACZ,WAAW,aAAsD;GAChE,MAAM,SAAS,MAAM,QAAQ,QAAQ,IAAI,SAAS,KAAK;GACvD,SAAS,SAAS,OAAO,OAAO,KAAK,IAAI,IAAI;EAC9C;EACS;EACH;EACI;EACV,UAAU,MAAM;EACL;EACJ;CACP,CAAA;AAEH"}
@@ -7,6 +7,10 @@ interface WireSource {
7
7
  kind: 'config' | 'runtime';
8
8
  capabilities: SerializedCapabilities;
9
9
  }
10
+ interface SourcesResponse {
11
+ defaultId: string | null;
12
+ sources: WireSource[];
13
+ }
10
14
  //#endregion
11
- export { WireSource };
15
+ export { SourcesResponse, WireSource };
12
16
  //# sourceMappingURL=fetchSources.d.ts.map
@@ -5,6 +5,8 @@ const satisfiesSerialized = (caps, req) => {
5
5
  if (req.perPageQuery && !caps.perPageQuery) return false;
6
6
  if (req.metrics?.some((m) => !caps.metrics.includes(m))) return false;
7
7
  if (req.dimensions?.some((d) => !caps.dimensions.includes(d))) return false;
8
+ if (req.filters?.some((d) => !caps.filters.includes(d))) return false;
9
+ if (req.filterOperators?.some((op) => !caps.filterOperators.includes(op))) return false;
8
10
  return true;
9
11
  };
10
12
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"narrow.js","names":[],"sources":["../../../src/fields/config/narrow.ts"],"sourcesContent":["import type { CapabilityRequirement, SerializedCapabilities } from '../../core/capabilities'\nimport type { WireSource } from './fetchSources'\n\nexport interface SelectOption {\n\tvalue: string\n\tlabel: unknown\n}\n\n/** satisfiesCapabilities over the wire form (arrays instead of Sets). */\nexport const satisfiesSerialized = (\n\tcaps: SerializedCapabilities,\n\treq: CapabilityRequirement\n): boolean => {\n\tif (req.realtime && !caps.realtime) return false\n\tif (req.perPageQuery && !caps.perPageQuery) return false\n\tif (req.metrics?.some((m) => !caps.metrics.includes(m))) return false\n\tif (req.dimensions?.some((d) => !caps.dimensions.includes(d))) return false\n\treturn true\n}\n\n/**\n * Options for the metric picker, narrowed to what the selected source can\n * serve. An unknown source id (a stale value, a source the endpoint could not\n * list) keeps the full static list, mirroring the server-side filterOptions\n * fallback, and a source that cannot meet the widget's extra requirements at\n * all falls back to the full list rather than an empty picker.\n */\nexport const narrowMetricOptions = (args: {\n\toptions: SelectOption[]\n\tsources: WireSource[]\n\tsourceId: string | undefined\n\trequires?: Omit<CapabilityRequirement, 'metrics'>\n}): SelectOption[] => {\n\tconst src = args.sourceId ? args.sources.find((s) => s.id === args.sourceId) : undefined\n\tif (!src) return args.options\n\tif (args.requires && !satisfiesSerialized(src.capabilities, args.requires)) {\n\t\treturn args.options\n\t}\n\tconst narrowed = args.options.filter((o) =>\n\t\tsatisfiesSerialized(src.capabilities, { ...args.requires, metrics: [o.value as never] })\n\t)\n\treturn narrowed.length > 0 ? narrowed : args.options\n}\n"],"mappings":";;AASA,MAAa,uBACZ,MACA,QACa;CACb,IAAI,IAAI,YAAY,CAAC,KAAK,UAAU,OAAO;CAC3C,IAAI,IAAI,gBAAgB,CAAC,KAAK,cAAc,OAAO;CACnD,IAAI,IAAI,SAAS,MAAM,MAAM,CAAC,KAAK,QAAQ,SAAS,CAAC,CAAC,GAAG,OAAO;CAChE,IAAI,IAAI,YAAY,MAAM,MAAM,CAAC,KAAK,WAAW,SAAS,CAAC,CAAC,GAAG,OAAO;CACtE,OAAO;AACR;;;;;;;;AASA,MAAa,uBAAuB,SAKd;CACrB,MAAM,MAAM,KAAK,WAAW,KAAK,QAAQ,MAAM,MAAM,EAAE,OAAO,KAAK,QAAQ,IAAI,KAAA;CAC/E,IAAI,CAAC,KAAK,OAAO,KAAK;CACtB,IAAI,KAAK,YAAY,CAAC,oBAAoB,IAAI,cAAc,KAAK,QAAQ,GACxE,OAAO,KAAK;CAEb,MAAM,WAAW,KAAK,QAAQ,QAAQ,MACrC,oBAAoB,IAAI,cAAc;EAAE,GAAG,KAAK;EAAU,SAAS,CAAC,EAAE,KAAc;CAAE,CAAC,CACxF;CACA,OAAO,SAAS,SAAS,IAAI,WAAW,KAAK;AAC9C"}
1
+ {"version":3,"file":"narrow.js","names":[],"sources":["../../../src/fields/config/narrow.ts"],"sourcesContent":["import type { CapabilityRequirement, SerializedCapabilities } from '../../core/capabilities'\nimport type { WireSource } from './fetchSources'\n\nexport interface SelectOption {\n\tvalue: string\n\tlabel: unknown\n}\n\n/** satisfiesCapabilities over the wire form (arrays instead of Sets). */\nexport const satisfiesSerialized = (\n\tcaps: SerializedCapabilities,\n\treq: CapabilityRequirement\n): boolean => {\n\tif (req.realtime && !caps.realtime) return false\n\tif (req.perPageQuery && !caps.perPageQuery) return false\n\tif (req.metrics?.some((m) => !caps.metrics.includes(m))) return false\n\tif (req.dimensions?.some((d) => !caps.dimensions.includes(d))) return false\n\tif (req.filters?.some((d) => !caps.filters.includes(d))) return false\n\tif (req.filterOperators?.some((op) => !caps.filterOperators.includes(op))) return false\n\treturn true\n}\n\n/**\n * Options for the metric picker, narrowed to what the selected source can\n * serve. An unknown source id (a stale value, a source the endpoint could not\n * list) keeps the full static list, mirroring the server-side filterOptions\n * fallback, and a source that cannot meet the widget's extra requirements at\n * all falls back to the full list rather than an empty picker.\n */\nexport const narrowMetricOptions = (args: {\n\toptions: SelectOption[]\n\tsources: WireSource[]\n\tsourceId: string | undefined\n\trequires?: Omit<CapabilityRequirement, 'metrics'>\n}): SelectOption[] => {\n\tconst src = args.sourceId ? args.sources.find((s) => s.id === args.sourceId) : undefined\n\tif (!src) return args.options\n\tif (args.requires && !satisfiesSerialized(src.capabilities, args.requires)) {\n\t\treturn args.options\n\t}\n\tconst narrowed = args.options.filter((o) =>\n\t\tsatisfiesSerialized(src.capabilities, { ...args.requires, metrics: [o.value as never] })\n\t)\n\treturn narrowed.length > 0 ? narrowed : args.options\n}\n"],"mappings":";;AASA,MAAa,uBACZ,MACA,QACa;CACb,IAAI,IAAI,YAAY,CAAC,KAAK,UAAU,OAAO;CAC3C,IAAI,IAAI,gBAAgB,CAAC,KAAK,cAAc,OAAO;CACnD,IAAI,IAAI,SAAS,MAAM,MAAM,CAAC,KAAK,QAAQ,SAAS,CAAC,CAAC,GAAG,OAAO;CAChE,IAAI,IAAI,YAAY,MAAM,MAAM,CAAC,KAAK,WAAW,SAAS,CAAC,CAAC,GAAG,OAAO;CACtE,IAAI,IAAI,SAAS,MAAM,MAAM,CAAC,KAAK,QAAQ,SAAS,CAAC,CAAC,GAAG,OAAO;CAChE,IAAI,IAAI,iBAAiB,MAAM,OAAO,CAAC,KAAK,gBAAgB,SAAS,EAAE,CAAC,GAAG,OAAO;CAClF,OAAO;AACR;;;;;;;;AASA,MAAa,uBAAuB,SAKd;CACrB,MAAM,MAAM,KAAK,WAAW,KAAK,QAAQ,MAAM,MAAM,EAAE,OAAO,KAAK,QAAQ,IAAI,KAAA;CAC/E,IAAI,CAAC,KAAK,OAAO,KAAK;CACtB,IAAI,KAAK,YAAY,CAAC,oBAAoB,IAAI,cAAc,KAAK,QAAQ,GACxE,OAAO,KAAK;CAEb,MAAM,WAAW,KAAK,QAAQ,QAAQ,MACrC,oBAAoB,IAAI,cAAc;EAAE,GAAG,KAAK;EAAU,SAAS,CAAC,EAAE,KAAc;CAAE,CAAC,CACxF;CACA,OAAO,SAAS,SAAS,IAAI,WAAW,KAAK;AAC9C"}
@@ -36,6 +36,11 @@ interface ReadForFieldArgs {
36
36
  now: Date;
37
37
  /** Explicit scope override; omitted resolves via the plugin's scopeResolver. */
38
38
  scope?: string | null;
39
+ /**
40
+ * Reporting timezone the caller already resolved, reused rather than resolved again so
41
+ * a caller-supplied `range` is read in the very timezone it was interpreted in.
42
+ */
43
+ timezone?: string;
39
44
  /** Also read the previous comparable window when the adapter supports comparison. */
40
45
  compare?: boolean;
41
46
  /** Also read a daily series for the first supported metric when the adapter can. */
@@ -1,9 +1,9 @@
1
+ import { getRuntime, resolveTimezoneFor } from "../plugin/runtime.js";
2
+ import { resolveTimeframe } from "../timeframe/presets.js";
1
3
  import { resolveHostname, resolvePathCached } from "../binding/resolvePath.js";
2
4
  import { satisfiesCapabilities } from "../core/capabilities.js";
3
5
  import { supportsGranularity } from "../core/granularity.js";
4
- import { getRuntime, resolveTimezoneFor } from "../plugin/runtime.js";
5
6
  import { resolveReadContext } from "../core/scopedRead.js";
6
- import { resolveTimeframe } from "../timeframe/presets.js";
7
7
  import { previousWindow } from "../widgets/comparison.js";
8
8
  import { fillDailySeries } from "../widgets/readForWidgetSeries.js";
9
9
  //#region src/fields/readForDocument.ts
@@ -30,7 +30,7 @@ const readForField = async (args) => {
30
30
  status: "not-bound",
31
31
  adapterId: adapterId ?? "",
32
32
  dateRange,
33
- timezone: "UTC",
33
+ timezone: args.timezone ?? "UTC",
34
34
  ...empty
35
35
  };
36
36
  const binding = runtime.bindings[collectionSlug];
@@ -38,7 +38,7 @@ const readForField = async (args) => {
38
38
  status: "not-bound",
39
39
  adapterId: adapterId ?? "",
40
40
  dateRange,
41
- timezone: "UTC",
41
+ timezone: args.timezone ?? "UTC",
42
42
  ...empty
43
43
  };
44
44
  const ctx = await resolveReadContext({
@@ -51,10 +51,10 @@ const readForField = async (args) => {
51
51
  status: "unavailable",
52
52
  adapterId: adapterId ?? "",
53
53
  dateRange,
54
- timezone: "UTC",
54
+ timezone: args.timezone ?? "UTC",
55
55
  ...empty
56
56
  };
57
- const tz = await resolveTimezoneFor(runtime, req, ctx.scope);
57
+ const tz = args.timezone ?? await resolveTimezoneFor(runtime, req, ctx.scope);
58
58
  dateRange = range ?? resolveTimeframe(timeframe, now, tz);
59
59
  const adapter = ctx.adapter;
60
60
  const bindingCtx = {
@@ -1 +1 @@
1
- {"version":3,"file":"readForDocument.js","names":[],"sources":["../../src/fields/readForDocument.ts"],"sourcesContent":["import type { PayloadRequest } from 'payload'\nimport { resolveHostname, resolvePathCached } from '../binding/resolvePath'\nimport type { BindingDoc } from '../binding/types'\nimport { satisfiesCapabilities } from '../core/capabilities'\nimport type { AnalyticsAdapter, DateRange, MetricKey } from '../core/contract'\nimport { supportsGranularity } from '../core/granularity'\nimport { resolveReadContext } from '../core/scopedRead'\nimport { getRuntime, resolveTimezoneFor } from '../plugin/runtime'\nimport { resolveTimeframe, type TimeframePreset } from '../timeframe/presets'\nimport { DEFAULT_TIMEZONE } from '../timeframe/tz'\nimport { previousWindow } from '../widgets/comparison'\nimport { fillDailySeries, type SeriesPoint } from '../widgets/readForWidgetSeries'\n\nexport type FieldReadStatus = 'ok' | 'no-path' | 'not-bound' | 'not-configured' | 'unavailable'\n\nexport interface FieldReadResult {\n\tstatus: FieldReadStatus\n\tadapterId: string\n\tdateRange: DateRange\n\t/** The reporting timezone the read resolved in; the trend axis buckets in it. */\n\ttimezone: string\n\tmetrics: Partial<Record<MetricKey, number>>\n\t/** Requested metrics the adapter supports, in request order; the set actually read. */\n\tsupportedMetrics: MetricKey[]\n\t/** Requested metrics the adapter cannot serve, dropped from the read. */\n\tdroppedMetrics: MetricKey[]\n\t/** Previous-window totals, present only when comparison was requested and supported. */\n\tpreviousMetrics?: Partial<Record<MetricKey, number>>\n\t/** The previous comparable window, present only when comparison ran. */\n\tcomparisonRange?: DateRange\n\t/** Per-day series for the first supported metric, present only when requested. */\n\tpoints?: SeriesPoint[]\n}\n\nexport interface ReadForFieldArgs {\n\treq: PayloadRequest\n\tcollectionSlug: string\n\tdata: BindingDoc\n\tmetrics: MetricKey[]\n\ttimeframe: TimeframePreset\n\t/** Overrides the preset window (custom range). */\n\trange?: DateRange\n\tadapterId?: string\n\tnow: Date\n\t/** Explicit scope override; omitted resolves via the plugin's scopeResolver. */\n\tscope?: string | null\n\t/** Also read the previous comparable window when the adapter supports comparison. */\n\tcompare?: boolean\n\t/** Also read a daily series for the first supported metric when the adapter can. */\n\tseries?: boolean\n}\n\n/**\n * Resolve a document's analytics for one display field: look up the runtime, resolve\n * the bound path, capability-gate the requested metrics against the active adapter,\n * then read through the surfacing engine. Returns a discriminated status so the\n * rendering component can show the right empty state without throwing.\n *\n * A metric the adapter does not support is dropped (with one warning per field\n * render), not fatal; `unavailable` is returned only when no requested metric\n * survives or the adapter cannot query per page at all.\n */\nexport const readForField = async (args: ReadForFieldArgs): Promise<FieldReadResult> => {\n\tconst { req, collectionSlug, data, metrics, timeframe, range, adapterId, now } = args\n\tlet dateRange = range ?? resolveTimeframe(timeframe, now)\n\tconst empty = { metrics: {}, supportedMetrics: [], droppedMetrics: [] }\n\tconst runtime = getRuntime(req.payload)\n\tif (!runtime) {\n\t\treturn {\n\t\t\tstatus: 'not-bound',\n\t\t\tadapterId: adapterId ?? '',\n\t\t\tdateRange,\n\t\t\ttimezone: DEFAULT_TIMEZONE,\n\t\t\t...empty,\n\t\t}\n\t}\n\tconst binding = runtime.bindings[collectionSlug]\n\tif (!binding) {\n\t\treturn {\n\t\t\tstatus: 'not-bound',\n\t\t\tadapterId: adapterId ?? '',\n\t\t\tdateRange,\n\t\t\ttimezone: DEFAULT_TIMEZONE,\n\t\t\t...empty,\n\t\t}\n\t}\n\tconst ctx = await resolveReadContext({ runtime, req, adapterId, scope: args.scope })\n\tif (!ctx.ok) {\n\t\treturn {\n\t\t\tstatus: 'unavailable',\n\t\t\tadapterId: adapterId ?? '',\n\t\t\tdateRange,\n\t\t\ttimezone: DEFAULT_TIMEZONE,\n\t\t\t...empty,\n\t\t}\n\t}\n\tconst tz = await resolveTimezoneFor(runtime, req, ctx.scope)\n\tdateRange = range ?? resolveTimeframe(timeframe, now, tz)\n\tconst adapter: AnalyticsAdapter = ctx.adapter\n\tconst bindingCtx = { req, locale: req.locale ?? undefined }\n\tlet path: string | null\n\ttry {\n\t\tpath = await resolvePathCached(binding, data, bindingCtx)\n\t} catch {\n\t\tpath = null\n\t}\n\tif (!path) {\n\t\treturn { status: 'no-path', adapterId: adapter.id, dateRange, timezone: tz, ...empty }\n\t}\n\tif (!adapter.isConfigured()) {\n\t\treturn { status: 'not-configured', adapterId: adapter.id, dateRange, timezone: tz, ...empty }\n\t}\n\tconst supportedMetrics = metrics.filter((m) => adapter.capabilities.metrics.has(m))\n\tconst droppedMetrics = metrics.filter((m) => !adapter.capabilities.metrics.has(m))\n\tif (droppedMetrics.length > 0) {\n\t\treq.payload.logger.warn(\n\t\t\t`analytics: adapter \"${adapter.id}\" does not support metric(s) ${droppedMetrics.join(', ')}; dropped from the \"${collectionSlug}\" display field`\n\t\t)\n\t}\n\tif (\n\t\tsupportedMetrics.length === 0 ||\n\t\t!satisfiesCapabilities(adapter.capabilities, { metrics: supportedMetrics, perPageQuery: true })\n\t) {\n\t\treturn {\n\t\t\tstatus: 'unavailable',\n\t\t\tadapterId: adapter.id,\n\t\t\tdateRange,\n\t\t\ttimezone: tz,\n\t\t\tmetrics: {},\n\t\t\tsupportedMetrics: [],\n\t\t\tdroppedMetrics: metrics,\n\t\t}\n\t}\n\tconst hostname = await resolveHostname(binding, data, bindingCtx)\n\tconst base = { path, hostname, timezone: tz, scope: ctx.queryScope }\n\tconst comparisonRange =\n\t\targs.compare && runtime.comparison && adapter.capabilities.comparison\n\t\t\t? (previousWindow(dateRange, tz) ?? undefined)\n\t\t\t: undefined\n\tconst wantsSeries = args.series && supportsGranularity(adapter.capabilities, 'day')\n\tconst [result, previous, seriesResult] = await Promise.all([\n\t\truntime.engine.read(adapter, { ...base, metrics: supportedMetrics, dateRange }),\n\t\tcomparisonRange\n\t\t\t? runtime.engine.read(adapter, {\n\t\t\t\t\t...base,\n\t\t\t\t\tmetrics: supportedMetrics,\n\t\t\t\t\tdateRange: comparisonRange,\n\t\t\t\t})\n\t\t\t: undefined,\n\t\twantsSeries\n\t\t\t? runtime.engine.read(adapter, {\n\t\t\t\t\t...base,\n\t\t\t\t\tmetrics: [supportedMetrics[0] as MetricKey],\n\t\t\t\t\tdateRange,\n\t\t\t\t\tgranularity: 'day',\n\t\t\t\t})\n\t\t\t: undefined,\n\t])\n\treturn {\n\t\tstatus: 'ok',\n\t\tadapterId: adapter.id,\n\t\tdateRange,\n\t\ttimezone: tz,\n\t\tmetrics: result.totals ?? {},\n\t\tsupportedMetrics,\n\t\tdroppedMetrics,\n\t\tpreviousMetrics: previous ? (previous.totals ?? {}) : undefined,\n\t\tcomparisonRange,\n\t\tpoints: seriesResult\n\t\t\t? fillDailySeries({\n\t\t\t\t\trows: seriesResult.rows,\n\t\t\t\t\tdateRange,\n\t\t\t\t\tmetric: supportedMetrics[0] as MetricKey,\n\t\t\t\t\ttz,\n\t\t\t\t})\n\t\t\t: undefined,\n\t}\n}\n"],"mappings":"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"}
1
+ {"version":3,"file":"readForDocument.js","names":[],"sources":["../../src/fields/readForDocument.ts"],"sourcesContent":["import type { PayloadRequest } from 'payload'\nimport { resolveHostname, resolvePathCached } from '../binding/resolvePath'\nimport type { BindingDoc } from '../binding/types'\nimport { satisfiesCapabilities } from '../core/capabilities'\nimport type { AnalyticsAdapter, DateRange, MetricKey } from '../core/contract'\nimport { supportsGranularity } from '../core/granularity'\nimport { resolveReadContext } from '../core/scopedRead'\nimport { getRuntime, resolveTimezoneFor } from '../plugin/runtime'\nimport { resolveTimeframe, type TimeframePreset } from '../timeframe/presets'\nimport { DEFAULT_TIMEZONE } from '../timeframe/tz'\nimport { previousWindow } from '../widgets/comparison'\nimport { fillDailySeries, type SeriesPoint } from '../widgets/readForWidgetSeries'\n\nexport type FieldReadStatus = 'ok' | 'no-path' | 'not-bound' | 'not-configured' | 'unavailable'\n\nexport interface FieldReadResult {\n\tstatus: FieldReadStatus\n\tadapterId: string\n\tdateRange: DateRange\n\t/** The reporting timezone the read resolved in; the trend axis buckets in it. */\n\ttimezone: string\n\tmetrics: Partial<Record<MetricKey, number>>\n\t/** Requested metrics the adapter supports, in request order; the set actually read. */\n\tsupportedMetrics: MetricKey[]\n\t/** Requested metrics the adapter cannot serve, dropped from the read. */\n\tdroppedMetrics: MetricKey[]\n\t/** Previous-window totals, present only when comparison was requested and supported. */\n\tpreviousMetrics?: Partial<Record<MetricKey, number>>\n\t/** The previous comparable window, present only when comparison ran. */\n\tcomparisonRange?: DateRange\n\t/** Per-day series for the first supported metric, present only when requested. */\n\tpoints?: SeriesPoint[]\n}\n\nexport interface ReadForFieldArgs {\n\treq: PayloadRequest\n\tcollectionSlug: string\n\tdata: BindingDoc\n\tmetrics: MetricKey[]\n\ttimeframe: TimeframePreset\n\t/** Overrides the preset window (custom range). */\n\trange?: DateRange\n\tadapterId?: string\n\tnow: Date\n\t/** Explicit scope override; omitted resolves via the plugin's scopeResolver. */\n\tscope?: string | null\n\t/**\n\t * Reporting timezone the caller already resolved, reused rather than resolved again so\n\t * a caller-supplied `range` is read in the very timezone it was interpreted in.\n\t */\n\ttimezone?: string\n\t/** Also read the previous comparable window when the adapter supports comparison. */\n\tcompare?: boolean\n\t/** Also read a daily series for the first supported metric when the adapter can. */\n\tseries?: boolean\n}\n\n/**\n * Resolve a document's analytics for one display field: look up the runtime, resolve\n * the bound path, capability-gate the requested metrics against the active adapter,\n * then read through the surfacing engine. Returns a discriminated status so the\n * rendering component can show the right empty state without throwing.\n *\n * A metric the adapter does not support is dropped (with one warning per field\n * render), not fatal; `unavailable` is returned only when no requested metric\n * survives or the adapter cannot query per page at all.\n */\nexport const readForField = async (args: ReadForFieldArgs): Promise<FieldReadResult> => {\n\tconst { req, collectionSlug, data, metrics, timeframe, range, adapterId, now } = args\n\tlet dateRange = range ?? resolveTimeframe(timeframe, now)\n\tconst empty = { metrics: {}, supportedMetrics: [], droppedMetrics: [] }\n\tconst runtime = getRuntime(req.payload)\n\tif (!runtime) {\n\t\treturn {\n\t\t\tstatus: 'not-bound',\n\t\t\tadapterId: adapterId ?? '',\n\t\t\tdateRange,\n\t\t\ttimezone: args.timezone ?? DEFAULT_TIMEZONE,\n\t\t\t...empty,\n\t\t}\n\t}\n\tconst binding = runtime.bindings[collectionSlug]\n\tif (!binding) {\n\t\treturn {\n\t\t\tstatus: 'not-bound',\n\t\t\tadapterId: adapterId ?? '',\n\t\t\tdateRange,\n\t\t\ttimezone: args.timezone ?? DEFAULT_TIMEZONE,\n\t\t\t...empty,\n\t\t}\n\t}\n\tconst ctx = await resolveReadContext({ runtime, req, adapterId, scope: args.scope })\n\tif (!ctx.ok) {\n\t\treturn {\n\t\t\tstatus: 'unavailable',\n\t\t\tadapterId: adapterId ?? '',\n\t\t\tdateRange,\n\t\t\ttimezone: args.timezone ?? DEFAULT_TIMEZONE,\n\t\t\t...empty,\n\t\t}\n\t}\n\tconst tz = args.timezone ?? (await resolveTimezoneFor(runtime, req, ctx.scope))\n\tdateRange = range ?? resolveTimeframe(timeframe, now, tz)\n\tconst adapter: AnalyticsAdapter = ctx.adapter\n\tconst bindingCtx = { req, locale: req.locale ?? undefined }\n\tlet path: string | null\n\ttry {\n\t\tpath = await resolvePathCached(binding, data, bindingCtx)\n\t} catch {\n\t\tpath = null\n\t}\n\tif (!path) {\n\t\treturn { status: 'no-path', adapterId: adapter.id, dateRange, timezone: tz, ...empty }\n\t}\n\tif (!adapter.isConfigured()) {\n\t\treturn { status: 'not-configured', adapterId: adapter.id, dateRange, timezone: tz, ...empty }\n\t}\n\tconst supportedMetrics = metrics.filter((m) => adapter.capabilities.metrics.has(m))\n\tconst droppedMetrics = metrics.filter((m) => !adapter.capabilities.metrics.has(m))\n\tif (droppedMetrics.length > 0) {\n\t\treq.payload.logger.warn(\n\t\t\t`analytics: adapter \"${adapter.id}\" does not support metric(s) ${droppedMetrics.join(', ')}; dropped from the \"${collectionSlug}\" display field`\n\t\t)\n\t}\n\tif (\n\t\tsupportedMetrics.length === 0 ||\n\t\t!satisfiesCapabilities(adapter.capabilities, { metrics: supportedMetrics, perPageQuery: true })\n\t) {\n\t\treturn {\n\t\t\tstatus: 'unavailable',\n\t\t\tadapterId: adapter.id,\n\t\t\tdateRange,\n\t\t\ttimezone: tz,\n\t\t\tmetrics: {},\n\t\t\tsupportedMetrics: [],\n\t\t\tdroppedMetrics: metrics,\n\t\t}\n\t}\n\tconst hostname = await resolveHostname(binding, data, bindingCtx)\n\tconst base = { path, hostname, timezone: tz, scope: ctx.queryScope }\n\tconst comparisonRange =\n\t\targs.compare && runtime.comparison && adapter.capabilities.comparison\n\t\t\t? (previousWindow(dateRange, tz) ?? undefined)\n\t\t\t: undefined\n\tconst wantsSeries = args.series && supportsGranularity(adapter.capabilities, 'day')\n\tconst [result, previous, seriesResult] = await Promise.all([\n\t\truntime.engine.read(adapter, { ...base, metrics: supportedMetrics, dateRange }),\n\t\tcomparisonRange\n\t\t\t? runtime.engine.read(adapter, {\n\t\t\t\t\t...base,\n\t\t\t\t\tmetrics: supportedMetrics,\n\t\t\t\t\tdateRange: comparisonRange,\n\t\t\t\t})\n\t\t\t: undefined,\n\t\twantsSeries\n\t\t\t? runtime.engine.read(adapter, {\n\t\t\t\t\t...base,\n\t\t\t\t\tmetrics: [supportedMetrics[0] as MetricKey],\n\t\t\t\t\tdateRange,\n\t\t\t\t\tgranularity: 'day',\n\t\t\t\t})\n\t\t\t: undefined,\n\t])\n\treturn {\n\t\tstatus: 'ok',\n\t\tadapterId: adapter.id,\n\t\tdateRange,\n\t\ttimezone: tz,\n\t\tmetrics: result.totals ?? {},\n\t\tsupportedMetrics,\n\t\tdroppedMetrics,\n\t\tpreviousMetrics: previous ? (previous.totals ?? {}) : undefined,\n\t\tcomparisonRange,\n\t\tpoints: seriesResult\n\t\t\t? fillDailySeries({\n\t\t\t\t\trows: seriesResult.rows,\n\t\t\t\t\tdateRange,\n\t\t\t\t\tmetric: supportedMetrics[0] as MetricKey,\n\t\t\t\t\ttz,\n\t\t\t\t})\n\t\t\t: undefined,\n\t}\n}\n"],"mappings":"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"}
@@ -0,0 +1,7 @@
1
+ import { TextFieldClientProps } from "payload";
2
+
3
+ //#region src/goals/GoalSelectField.d.ts
4
+ declare const GoalSelectField: import("react").FC<TextFieldClientProps>;
5
+ //#endregion
6
+ export { GoalSelectField };
7
+ //# sourceMappingURL=GoalSelectField.d.ts.map