@10x-media/analytics 1.0.0-beta.9 → 4.0.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +710 -0
- package/README.md +35 -36
- package/dist/access/adminUser.d.ts +15 -0
- package/dist/access/adminUser.js +13 -0
- package/dist/access/adminUser.js.map +1 -0
- package/dist/access/decideOnce.js +16 -0
- package/dist/access/decideOnce.js.map +1 -0
- package/dist/access/membership.d.ts +23 -0
- package/dist/access/membership.js +63 -0
- package/dist/access/membership.js.map +1 -0
- package/dist/access/principal.d.ts +37 -0
- package/dist/access/principal.js +29 -0
- package/dist/access/principal.js.map +1 -0
- package/dist/access/readGate.js +16 -0
- package/dist/access/readGate.js.map +1 -0
- package/dist/adapters/ga4/disableKey.js +19 -0
- package/dist/adapters/ga4/disableKey.js.map +1 -0
- package/dist/adapters/ga4/eventName.d.ts +2 -8
- package/dist/adapters/ga4/eventName.js +2 -8
- package/dist/adapters/ga4/eventName.js.map +1 -1
- package/dist/adapters/ga4/ga4.d.ts +24 -0
- package/dist/adapters/ga4/ga4.js +226 -122
- package/dist/adapters/ga4/ga4.js.map +1 -1
- package/dist/adapters/ga4/measurementId.js +2 -3
- package/dist/adapters/ga4/measurementId.js.map +1 -1
- package/dist/adapters/goalRead.js +15 -29
- package/dist/adapters/goalRead.js.map +1 -1
- package/dist/adapters/http/baseUrl.js +15 -0
- package/dist/adapters/http/baseUrl.js.map +1 -0
- package/dist/adapters/http/fetchJson.d.ts +19 -0
- package/dist/adapters/http/fetchJson.js +27 -8
- package/dist/adapters/http/fetchJson.js.map +1 -1
- package/dist/adapters/mapping.js +52 -0
- package/dist/adapters/mapping.js.map +1 -0
- package/dist/adapters/plausible/plausible.d.ts +25 -13
- package/dist/adapters/plausible/plausible.js +144 -124
- package/dist/adapters/plausible/plausible.js.map +1 -1
- package/dist/adapters/plausible/scriptId.js +19 -0
- package/dist/adapters/plausible/scriptId.js.map +1 -0
- package/dist/adapters/posthog/posthog.d.ts +33 -9
- package/dist/adapters/posthog/posthog.js +279 -121
- package/dist/adapters/posthog/posthog.js.map +1 -1
- package/dist/adapters/posthog/projectCheck.js +56 -0
- package/dist/adapters/posthog/projectCheck.js.map +1 -0
- package/dist/adapters/readTime.js +7 -0
- package/dist/adapters/readTime.js.map +1 -0
- package/dist/adapters/series.js +14 -8
- package/dist/adapters/series.js.map +1 -1
- package/dist/adapters/umami/umami.d.ts +19 -9
- package/dist/adapters/umami/umami.js +196 -166
- package/dist/adapters/umami/umami.js.map +1 -1
- package/dist/adapters/upstream.js +16 -0
- package/dist/adapters/upstream.js.map +1 -0
- package/dist/binding/report.d.ts +8 -0
- package/dist/binding/report.js +24 -0
- package/dist/binding/report.js.map +1 -0
- package/dist/binding/resolvePath.js +28 -25
- package/dist/binding/resolvePath.js.map +1 -1
- package/dist/binding/types.d.ts +14 -29
- package/dist/capture/captureRequest.js +28 -0
- package/dist/capture/captureRequest.js.map +1 -0
- package/dist/capture/exclusionEndpoint.js +98 -0
- package/dist/capture/exclusionEndpoint.js.map +1 -0
- package/dist/capture/exclusionPrelude.js +14 -0
- package/dist/capture/exclusionPrelude.js.map +1 -0
- package/dist/capture/exclusionToken.js +23 -0
- package/dist/capture/exclusionToken.js.map +1 -0
- package/dist/capture/jsLiteral.js +19 -0
- package/dist/capture/jsLiteral.js.map +1 -0
- package/dist/capture/mountPath.js +2 -3
- package/dist/capture/mountPath.js.map +1 -1
- package/dist/capture/proxyEndpoint.js +49 -92
- package/dist/capture/proxyEndpoint.js.map +1 -1
- package/dist/capture/proxyRoutes.js +58 -21
- package/dist/capture/proxyRoutes.js.map +1 -1
- package/dist/capture/relay.js +91 -0
- package/dist/capture/relay.js.map +1 -0
- package/dist/capture/requestBody.js +2 -6
- package/dist/capture/requestBody.js.map +1 -1
- package/dist/capture/requestTrust.js +45 -0
- package/dist/capture/requestTrust.js.map +1 -0
- package/dist/capture/sameSite.js +40 -0
- package/dist/capture/sameSite.js.map +1 -0
- package/dist/capture/slots.js +50 -25
- package/dist/capture/slots.js.map +1 -1
- package/dist/capture/trackerConfig.js +131 -36
- package/dist/capture/trackerConfig.js.map +1 -1
- package/dist/capture/trackerEndpoint.js +22 -21
- package/dist/capture/trackerEndpoint.js.map +1 -1
- package/dist/capture/withoutConsent.js +91 -0
- package/dist/capture/withoutConsent.js.map +1 -0
- package/dist/charts/BarList.d.ts +27 -13
- package/dist/charts/BarList.js +38 -83
- package/dist/charts/BarList.js.map +1 -1
- package/dist/charts/TrendChart.d.ts +40 -7
- package/dist/charts/TrendChart.js +243 -215
- package/dist/charts/TrendChart.js.map +1 -1
- package/dist/charts/bars.d.ts +17 -1
- package/dist/charts/bars.js +12 -11
- package/dist/charts/bars.js.map +1 -1
- package/dist/charts/bucket.js +106 -73
- package/dist/charts/bucket.js.map +1 -1
- package/dist/charts/inProgress.js +22 -0
- package/dist/charts/inProgress.js.map +1 -0
- package/dist/charts/series.d.ts +15 -0
- package/dist/charts/series.js +123 -0
- package/dist/charts/series.js.map +1 -0
- package/dist/charts/spline.js +91 -25
- package/dist/charts/spline.js.map +1 -1
- package/dist/charts/trendGeometry.js +91 -0
- package/dist/charts/trendGeometry.js.map +1 -0
- package/dist/core/adminOptions.d.ts +1 -0
- package/dist/core/adminOptions.js +198 -0
- package/dist/core/adminOptions.js.map +1 -0
- package/dist/core/budget.js +24 -0
- package/dist/core/budget.js.map +1 -0
- package/dist/core/cacheKey.d.ts +1 -0
- package/dist/core/cacheKey.js +48 -36
- package/dist/core/cacheKey.js.map +1 -1
- package/dist/core/cacheOptions.js +165 -0
- package/dist/core/cacheOptions.js.map +1 -0
- package/dist/core/capabilities.d.ts +24 -11
- package/dist/core/capabilities.js +96 -17
- package/dist/core/capabilities.js.map +1 -1
- package/dist/core/capture.d.ts +59 -26
- package/dist/core/captureOptions.d.ts +1 -0
- package/dist/core/captureOptions.js +347 -0
- package/dist/core/captureOptions.js.map +1 -0
- package/dist/core/clock.js +13 -0
- package/dist/core/clock.js.map +1 -0
- package/dist/core/collectionOption.d.ts +17 -0
- package/dist/core/collectionOption.js +105 -0
- package/dist/core/collectionOption.js.map +1 -0
- package/dist/core/collectionSlug.js +7 -0
- package/dist/core/collectionSlug.js.map +1 -0
- package/dist/core/contract.d.ts +321 -60
- package/dist/core/contract.js +7 -4
- package/dist/core/contract.js.map +1 -1
- package/dist/core/cron.js +57 -0
- package/dist/core/cron.js.map +1 -0
- package/dist/core/fetch.d.ts +17 -0
- package/dist/core/goalOptions.d.ts +1 -0
- package/dist/core/goalOptions.js +166 -0
- package/dist/core/goalOptions.js.map +1 -0
- package/dist/core/granularity.js +3 -2
- package/dist/core/granularity.js.map +1 -1
- package/dist/core/guards.js +17 -0
- package/dist/core/guards.js.map +1 -0
- package/dist/core/jobs.d.ts +40 -0
- package/dist/core/jobs.js +132 -0
- package/dist/core/jobs.js.map +1 -0
- package/dist/core/legacyOptions.js +145 -0
- package/dist/core/legacyOptions.js.map +1 -0
- package/dist/core/metricAliases.js +81 -0
- package/dist/core/metricAliases.js.map +1 -0
- package/dist/core/metricValues.js +57 -0
- package/dist/core/metricValues.js.map +1 -0
- package/dist/core/monotonic.js +10 -0
- package/dist/core/monotonic.js.map +1 -0
- package/dist/core/optionChecks.js +51 -0
- package/dist/core/optionChecks.js.map +1 -0
- package/dist/core/options.d.ts +530 -152
- package/dist/core/options.js +158 -216
- package/dist/core/options.js.map +1 -1
- package/dist/core/registry.js +45 -5
- package/dist/core/registry.js.map +1 -1
- package/dist/core/scopeList.js +7 -9
- package/dist/core/scopeList.js.map +1 -1
- package/dist/core/scopeOptions.d.ts +1 -0
- package/dist/core/scopeOptions.js +114 -0
- package/dist/core/scopeOptions.js.map +1 -0
- package/dist/core/scopedRead.js +349 -36
- package/dist/core/scopedRead.js.map +1 -1
- package/dist/core/sdks.d.ts +81 -0
- package/dist/core/sdks.js +23 -0
- package/dist/core/sdks.js.map +1 -0
- package/dist/core/serverEvent.d.ts +50 -16
- package/dist/core/serverEvent.js.map +1 -1
- package/dist/core/siteAddress.js +20 -0
- package/dist/core/siteAddress.js.map +1 -0
- package/dist/core/sourceErrors.js +109 -0
- package/dist/core/sourceErrors.js.map +1 -0
- package/dist/core/sourceLabel.d.ts +10 -0
- package/dist/core/sourceLabel.js +63 -0
- package/dist/core/sourceLabel.js.map +1 -0
- package/dist/core/sourceOptions.js +107 -0
- package/dist/core/sourceOptions.js.map +1 -0
- package/dist/core/sourcePolicy.d.ts +55 -0
- package/dist/core/sourcePolicy.js +51 -0
- package/dist/core/sourcePolicy.js.map +1 -0
- package/dist/core/throttle.js +18 -0
- package/dist/core/throttle.js.map +1 -0
- package/dist/core/values.js +61 -0
- package/dist/core/values.js.map +1 -0
- package/dist/core/widgetSlugs.d.ts +17 -0
- package/dist/core/widgetSlugs.js +29 -0
- package/dist/core/widgetSlugs.js.map +1 -0
- package/dist/db/detachedWrite.js +36 -0
- package/dist/db/detachedWrite.js.map +1 -0
- package/dist/db/errors.js +182 -0
- package/dist/db/errors.js.map +1 -0
- package/dist/db/kind.js +32 -0
- package/dist/db/kind.js.map +1 -0
- package/dist/db/openTransaction.js +51 -0
- package/dist/db/openTransaction.js.map +1 -0
- package/dist/exports/adapters/contract.d.ts +15 -0
- package/dist/exports/adapters/ga4.d.ts +16 -1
- package/dist/exports/adapters/native.d.ts +29 -2
- package/dist/exports/adapters/native.js +5 -1
- package/dist/exports/adapters/plausible.d.ts +16 -1
- package/dist/exports/adapters/posthog.d.ts +16 -1
- package/dist/exports/adapters/umami.d.ts +16 -1
- package/dist/exports/attributes.d.ts +42 -0
- package/dist/exports/attributes.js +83 -0
- package/dist/exports/attributes.js.map +1 -0
- package/dist/exports/client.d.ts +43 -12
- package/dist/exports/client.js +22 -8
- package/dist/exports/geo.d.ts +4 -2
- package/dist/exports/geo.js +1 -1
- package/dist/exports/i18n.d.ts +2 -2
- package/dist/exports/i18n.js +2 -2
- package/dist/exports/migrations.d.ts +2 -0
- package/dist/exports/migrations.js +2 -0
- package/dist/exports/react.d.ts +5 -3
- package/dist/exports/react.js +1 -2
- package/dist/exports/routes.d.ts +19 -0
- package/dist/exports/routes.js +3 -0
- package/dist/exports/rsc.d.ts +32 -14
- package/dist/exports/rsc.js +11 -6
- package/dist/exports/site.d.ts +5 -0
- package/dist/exports/site.js +3 -0
- package/dist/exports/testing.d.ts +18 -0
- package/dist/exports/testing.js +3 -0
- package/dist/exports/tracker.d.ts +6 -18
- package/dist/exports/tracker.js +3 -12
- package/dist/exports/types.d.ts +45 -14
- package/dist/exports/types.js +6 -1
- package/dist/fields/AnalyticsPanelClient.js +265 -154
- package/dist/fields/AnalyticsPanelClient.js.map +1 -1
- package/dist/fields/AnalyticsPanelField.d.ts +19 -7
- package/dist/fields/AnalyticsPanelField.js +123 -30
- package/dist/fields/AnalyticsPanelField.js.map +1 -1
- package/dist/fields/AnalyticsStatField.d.ts +17 -6
- package/dist/fields/AnalyticsStatField.js +98 -63
- package/dist/fields/AnalyticsStatField.js.map +1 -1
- package/dist/fields/FieldShimmer.js +15 -0
- package/dist/fields/FieldShimmer.js.map +1 -0
- package/dist/fields/PanelContent.js +222 -0
- package/dist/fields/PanelContent.js.map +1 -0
- package/dist/fields/PanelList.js +82 -0
- package/dist/fields/PanelList.js.map +1 -0
- package/dist/fields/PanelLiveCounter.js +63 -0
- package/dist/fields/PanelLiveCounter.js.map +1 -0
- package/dist/fields/PanelSkeleton.js +63 -0
- package/dist/fields/PanelSkeleton.js.map +1 -0
- package/dist/fields/componentPaths.js +8 -0
- package/dist/fields/componentPaths.js.map +1 -0
- package/dist/fields/config/FilterDimensionSelectField.d.ts +2 -2
- package/dist/fields/config/FilterDimensionSelectField.js +26 -54
- package/dist/fields/config/FilterDimensionSelectField.js.map +1 -1
- package/dist/fields/config/FilterKeySelect.js +66 -0
- package/dist/fields/config/FilterKeySelect.js.map +1 -0
- package/dist/fields/config/FilterOperatorSelectField.d.ts +7 -2
- package/dist/fields/config/FilterOperatorSelectField.js +37 -53
- package/dist/fields/config/FilterOperatorSelectField.js.map +1 -1
- package/dist/fields/config/FilterValueField.d.ts +17 -0
- package/dist/fields/config/FilterValueField.js +130 -0
- package/dist/fields/config/FilterValueField.js.map +1 -0
- package/dist/fields/config/MetricSelectField.d.ts +5 -12
- package/dist/fields/config/MetricSelectField.js +18 -30
- package/dist/fields/config/MetricSelectField.js.map +1 -1
- package/dist/fields/config/OptionSelect.js +52 -0
- package/dist/fields/config/OptionSelect.js.map +1 -0
- package/dist/fields/config/SourceSelectField.js +16 -31
- package/dist/fields/config/SourceSelectField.js.map +1 -1
- package/dist/fields/config/fetchSources.d.ts +3 -0
- package/dist/fields/config/fetchSources.js +17 -23
- package/dist/fields/config/fetchSources.js.map +1 -1
- package/dist/fields/config/filterValues.js +106 -0
- package/dist/fields/config/filterValues.js.map +1 -0
- package/dist/fields/config/narrow.js +8 -10
- package/dist/fields/config/narrow.js.map +1 -1
- package/dist/fields/config/retiredPickers.d.ts +45 -0
- package/dist/fields/config/retiredPickers.js +46 -0
- package/dist/fields/config/retiredPickers.js.map +1 -0
- package/dist/fields/config/scopedFields.d.ts +40 -0
- package/dist/fields/config/scopedFields.js +68 -0
- package/dist/fields/config/scopedFields.js.map +1 -0
- package/dist/fields/config/toSelectOption.js +13 -7
- package/dist/fields/config/toSelectOption.js.map +1 -1
- package/dist/fields/config/useAnalyticsSources.d.ts +5 -7
- package/dist/fields/config/useAnalyticsSources.js +17 -21
- package/dist/fields/config/useAnalyticsSources.js.map +1 -1
- package/dist/fields/config/useFilterCapabilities.d.ts +9 -6
- package/dist/fields/config/useFilterCapabilities.js +23 -15
- package/dist/fields/config/useFilterCapabilities.js.map +1 -1
- package/dist/fields/config/useFormString.js +12 -0
- package/dist/fields/config/useFormString.js.map +1 -0
- package/dist/fields/dateRange/field.js +7 -19
- package/dist/fields/dateRange/field.js.map +1 -1
- package/dist/fields/dateRange/types.d.ts +5 -1
- package/dist/fields/dateRange/ui.d.ts +3 -2
- package/dist/fields/dateRange/ui.js +57 -319
- package/dist/fields/dateRange/ui.js.map +1 -1
- package/dist/fields/documentScope.js +21 -0
- package/dist/fields/documentScope.js.map +1 -0
- package/dist/fields/emptyState.js +30 -26
- package/dist/fields/emptyState.js.map +1 -1
- package/dist/fields/factories.d.ts +35 -16
- package/dist/fields/factories.js +67 -38
- package/dist/fields/factories.js.map +1 -1
- package/dist/fields/format.d.ts +12 -3
- package/dist/fields/format.js +77 -13
- package/dist/fields/format.js.map +1 -1
- package/dist/fields/itemReport.js +45 -0
- package/dist/fields/itemReport.js.map +1 -0
- package/dist/fields/readForDocument.d.ts +79 -26
- package/dist/fields/readForDocument.js +450 -116
- package/dist/fields/readForDocument.js.map +1 -1
- package/dist/fields/stateKeys.js +20 -0
- package/dist/fields/stateKeys.js.map +1 -0
- package/dist/goals/GoalAmountField.d.ts +10 -0
- package/dist/goals/GoalAmountField.js +179 -0
- package/dist/goals/GoalAmountField.js.map +1 -0
- package/dist/goals/GoalSelectField.js +89 -40
- package/dist/goals/GoalSelectField.js.map +1 -1
- package/dist/goals/GoalSelectFieldServer.d.ts +13 -0
- package/dist/goals/GoalSelectFieldServer.js +21 -0
- package/dist/goals/GoalSelectFieldServer.js.map +1 -0
- package/dist/goals/amountField.d.ts +20 -0
- package/dist/goals/amountField.js +37 -0
- package/dist/goals/amountField.js.map +1 -0
- package/dist/goals/builtin.js +17 -0
- package/dist/goals/builtin.js.map +1 -0
- package/dist/goals/collection.d.ts +22 -0
- package/dist/goals/collection.js +143 -124
- package/dist/goals/collection.js.map +1 -1
- package/dist/goals/constants.d.ts +38 -0
- package/dist/goals/constants.js +49 -0
- package/dist/goals/constants.js.map +1 -0
- package/dist/goals/currency.d.ts +16 -0
- package/dist/goals/currency.js +46 -4
- package/dist/goals/currency.js.map +1 -1
- package/dist/goals/currencyOptions.js +70 -0
- package/dist/goals/currencyOptions.js.map +1 -0
- package/dist/goals/fetchGoals.d.ts +10 -0
- package/dist/goals/fetchGoals.js +12 -22
- package/dist/goals/fetchGoals.js.map +1 -1
- package/dist/goals/goalField.d.ts +4 -6
- package/dist/goals/goalField.js +9 -19
- package/dist/goals/goalField.js.map +1 -1
- package/dist/goals/goalsEndpoint.js +40 -38
- package/dist/goals/goalsEndpoint.js.map +1 -1
- package/dist/goals/items.js +35 -0
- package/dist/goals/items.js.map +1 -0
- package/dist/goals/latent.js +9 -0
- package/dist/goals/latent.js.map +1 -0
- package/dist/goals/linkFields.d.ts +35 -0
- package/dist/goals/linkFields.js +31 -0
- package/dist/goals/linkFields.js.map +1 -0
- package/dist/goals/match.d.ts +14 -0
- package/dist/goals/match.js +67 -46
- package/dist/goals/match.js.map +1 -1
- package/dist/goals/moneyFields.js +56 -0
- package/dist/goals/moneyFields.js.map +1 -0
- package/dist/goals/pathMatch.js +122 -0
- package/dist/goals/pathMatch.js.map +1 -0
- package/dist/goals/placeholder.js +12 -0
- package/dist/goals/placeholder.js.map +1 -0
- package/dist/goals/resolver.d.ts +3 -3
- package/dist/goals/resolver.js +155 -47
- package/dist/goals/resolver.js.map +1 -1
- package/dist/goals/serverRevenue.d.ts +60 -0
- package/dist/goals/serverRevenue.js +41 -0
- package/dist/goals/serverRevenue.js.map +1 -0
- package/dist/goals/trackGoalAction.d.ts +26 -25
- package/dist/goals/trackGoalAction.js +71 -66
- package/dist/goals/trackGoalAction.js.map +1 -1
- package/dist/goals/types.d.ts +13 -28
- package/dist/goals/types.js +1 -1
- package/dist/goals/types.js.map +1 -1
- package/dist/goals/useAnalyticsGoals.d.ts +6 -5
- package/dist/goals/useAnalyticsGoals.js +17 -18
- package/dist/goals/useAnalyticsGoals.js.map +1 -1
- package/dist/index.d.ts +68 -12
- package/dist/index.js +261 -192
- package/dist/index.js.map +1 -1
- package/dist/items/collectionIdType.js +20 -0
- package/dist/items/collectionIdType.js.map +1 -0
- package/dist/items/idType.js +31 -0
- package/dist/items/idType.js.map +1 -0
- package/dist/items/ref.js +73 -0
- package/dist/items/ref.js.map +1 -0
- package/dist/maintenance/apiTaskState.js +141 -0
- package/dist/maintenance/apiTaskState.js.map +1 -0
- package/dist/maintenance/heartbeat.js +51 -0
- package/dist/maintenance/heartbeat.js.map +1 -0
- package/dist/maintenance/lease.d.ts +1 -0
- package/dist/maintenance/lease.js +79 -0
- package/dist/maintenance/lease.js.map +1 -0
- package/dist/maintenance/taskSchedule.js +27 -0
- package/dist/maintenance/taskSchedule.js.map +1 -0
- package/dist/maintenance/underLease.js +35 -0
- package/dist/maintenance/underLease.js.map +1 -0
- package/dist/migrations/legacy.d.ts +54 -0
- package/dist/migrations/legacy.js +117 -0
- package/dist/migrations/legacy.js.map +1 -0
- package/dist/migrations/predefined/dropLegacyMongo.d.ts +11 -0
- package/dist/migrations/predefined/dropLegacyMongo.js +12 -0
- package/dist/migrations/predefined/dropLegacyMongo.js.map +1 -0
- package/dist/native/collections/aggregates.js +54 -0
- package/dist/native/collections/aggregates.js.map +1 -0
- package/dist/native/collections/hits.js +103 -0
- package/dist/native/collections/hits.js.map +1 -0
- package/dist/native/collections/slugs.d.ts +10 -0
- package/dist/native/collections/slugs.js +16 -0
- package/dist/native/collections/slugs.js.map +1 -0
- package/dist/native/collections/state.js +84 -0
- package/dist/native/collections/state.js.map +1 -0
- package/dist/native/collections/storeCollection.js +31 -0
- package/dist/native/collections/storeCollection.js.map +1 -0
- package/dist/native/engine/buckets.d.ts +1 -0
- package/dist/native/engine/buckets.js +53 -0
- package/dist/native/engine/buckets.js.map +1 -0
- package/dist/native/engine/capabilities.js +87 -0
- package/dist/native/engine/capabilities.js.map +1 -0
- package/dist/native/engine/cost.js +72 -0
- package/dist/native/engine/cost.js.map +1 -0
- package/dist/native/engine/days.d.ts +1 -0
- package/dist/native/engine/days.js +182 -0
- package/dist/native/engine/days.js.map +1 -0
- package/dist/native/engine/engine.d.ts +1 -0
- package/dist/native/engine/engine.js +1627 -0
- package/dist/native/engine/engine.js.map +1 -0
- package/dist/native/engine/instance.js +58 -0
- package/dist/native/engine/instance.js.map +1 -0
- package/dist/native/engine/maintenance.d.ts +1 -0
- package/dist/native/engine/maintenance.js +677 -0
- package/dist/native/engine/maintenance.js.map +1 -0
- package/dist/native/engine/merge.js +41 -0
- package/dist/native/engine/merge.js.map +1 -0
- package/dist/native/engine/nudge.js +26 -0
- package/dist/native/engine/nudge.js.map +1 -0
- package/dist/native/engine/planner.js +199 -0
- package/dist/native/engine/planner.js.map +1 -0
- package/dist/native/engine/rebuild.d.ts +22 -0
- package/dist/native/engine/rebuild.js +76 -0
- package/dist/native/engine/rebuild.js.map +1 -0
- package/dist/native/engine/recent.js +17 -0
- package/dist/native/engine/recent.js.map +1 -0
- package/dist/native/engine/salt.d.ts +1 -0
- package/dist/native/engine/salt.js +98 -0
- package/dist/native/engine/salt.js.map +1 -0
- package/dist/native/engine/siteHosts.d.ts +1 -0
- package/dist/native/engine/siteHosts.js +58 -0
- package/dist/native/engine/siteHosts.js.map +1 -0
- package/dist/native/engine/toHit.js +110 -0
- package/dist/native/engine/toHit.js.map +1 -0
- package/dist/native/engine/writeBuffer.d.ts +14 -0
- package/dist/native/engine/writeBuffer.js +317 -0
- package/dist/native/engine/writeBuffer.js.map +1 -0
- package/dist/native/geo/composeGeoResolvers.d.ts +1 -0
- package/dist/native/geo/composeGeoResolvers.js +5 -2
- package/dist/native/geo/composeGeoResolvers.js.map +1 -1
- package/dist/native/geo/geoResolver.d.ts +27 -2
- package/dist/native/geo/geoResolver.js +42 -6
- package/dist/native/geo/geoResolver.js.map +1 -1
- package/dist/native/geo/maxmindResolver.d.ts +8 -4
- package/dist/native/geo/maxmindResolver.js +20 -16
- package/dist/native/geo/maxmindResolver.js.map +1 -1
- package/dist/native/geo/resolveGeo.js +31 -0
- package/dist/native/geo/resolveGeo.js.map +1 -0
- package/dist/native/ingest/bots.d.ts +10 -0
- package/dist/native/ingest/bots.js +66 -0
- package/dist/native/ingest/bots.js.map +1 -0
- package/dist/native/ingest/browser.js +4 -6
- package/dist/native/ingest/browser.js.map +1 -1
- package/dist/native/ingest/clientIp.js +34 -8
- package/dist/native/ingest/clientIp.js.map +1 -1
- package/dist/native/ingest/device.js +4 -6
- package/dist/native/ingest/device.js.map +1 -1
- package/dist/native/ingest/endpoint.d.ts +1 -1
- package/dist/native/ingest/endpoint.js +185 -32
- package/dist/native/ingest/endpoint.js.map +1 -1
- package/dist/native/ingest/itemSignature.d.ts +26 -0
- package/dist/native/ingest/itemSignature.js +45 -0
- package/dist/native/ingest/itemSignature.js.map +1 -0
- package/dist/native/ingest/language.js +2 -3
- package/dist/native/ingest/language.js.map +1 -1
- package/dist/native/ingest/normalizeEvent.d.ts +70 -8
- package/dist/native/ingest/normalizeEvent.js +239 -60
- package/dist/native/ingest/normalizeEvent.js.map +1 -1
- package/dist/native/ingest/orderSignature.d.ts +13 -0
- package/dist/native/ingest/orderSignature.js +50 -0
- package/dist/native/ingest/orderSignature.js.map +1 -0
- package/dist/native/ingest/referrer.js +30 -32
- package/dist/native/ingest/referrer.js.map +1 -1
- package/dist/native/ingest/requestHost.js +44 -0
- package/dist/native/ingest/requestHost.js.map +1 -0
- package/dist/native/ingest/resolveHostname.d.ts +20 -0
- package/dist/native/ingest/resolveHostname.js +51 -0
- package/dist/native/ingest/resolveHostname.js.map +1 -0
- package/dist/native/ingest/revenue.d.ts +1 -0
- package/dist/native/ingest/revenue.js +121 -0
- package/dist/native/ingest/revenue.js.map +1 -0
- package/dist/native/ingest/route.d.ts +10 -0
- package/dist/native/ingest/route.js +85 -0
- package/dist/native/ingest/route.js.map +1 -0
- package/dist/native/ingest/serverTrack.d.ts +2 -10
- package/dist/native/ingest/serverTrack.js +188 -69
- package/dist/native/ingest/serverTrack.js.map +1 -1
- package/dist/native/ingest/signature.js +28 -0
- package/dist/native/ingest/signature.js.map +1 -0
- package/dist/native/ingest/source.d.ts +5 -2
- package/dist/native/ingest/source.js +163 -59
- package/dist/native/ingest/source.js.map +1 -1
- package/dist/native/ingest/utm.js +9 -9
- package/dist/native/ingest/utm.js.map +1 -1
- package/dist/native/ingest/validate.js +25 -13
- package/dist/native/ingest/validate.js.map +1 -1
- package/dist/native/ingest/visitorHash.js +6 -8
- package/dist/native/ingest/visitorHash.js.map +1 -1
- package/dist/native/nativeAdapter.d.ts +128 -9
- package/dist/native/nativeAdapter.js +396 -288
- package/dist/native/nativeAdapter.js.map +1 -1
- package/dist/native/rebuildDays.d.ts +12 -0
- package/dist/native/rebuildDays.js +16 -0
- package/dist/native/rebuildDays.js.map +1 -0
- package/dist/native/store/aggregate.js +450 -0
- package/dist/native/store/aggregate.js.map +1 -0
- package/dist/native/store/caps.d.ts +18 -0
- package/dist/native/store/caps.js +76 -0
- package/dist/native/store/caps.js.map +1 -0
- package/dist/native/store/chunks.js +34 -0
- package/dist/native/store/chunks.js.map +1 -0
- package/dist/native/store/columnValues.js +31 -0
- package/dist/native/store/columnValues.js.map +1 -0
- package/dist/native/store/dialect.js +106 -0
- package/dist/native/store/dialect.js.map +1 -0
- package/dist/native/store/eventStore.js +44 -0
- package/dist/native/store/eventStore.js.map +1 -0
- package/dist/native/store/hitRow.js +119 -0
- package/dist/native/store/hitRow.js.map +1 -0
- package/dist/native/store/hits.js +65 -0
- package/dist/native/store/hits.js.map +1 -0
- package/dist/native/store/ids.js +105 -0
- package/dist/native/store/ids.js.map +1 -0
- package/dist/native/store/mongo/aggregatePipelines.js +438 -0
- package/dist/native/store/mongo/aggregatePipelines.js.map +1 -0
- package/dist/native/store/mongo/mongoState.js +375 -0
- package/dist/native/store/mongo/mongoState.js.map +1 -0
- package/dist/native/store/mongo/mongoStore.js +618 -0
- package/dist/native/store/mongo/mongoStore.js.map +1 -0
- package/dist/native/store/mongo/pipelines.js +705 -0
- package/dist/native/store/mongo/pipelines.js.map +1 -0
- package/dist/native/store/mongo/results.js +20 -0
- package/dist/native/store/mongo/results.js.map +1 -0
- package/dist/native/store/parts.d.ts +1 -0
- package/dist/native/store/parts.js +101 -0
- package/dist/native/store/parts.js.map +1 -0
- package/dist/native/store/pattern.js +213 -0
- package/dist/native/store/pattern.js.map +1 -0
- package/dist/native/store/rawRead.d.ts +23 -0
- package/dist/native/store/rawRead.js +387 -0
- package/dist/native/store/rawRead.js.map +1 -0
- package/dist/native/store/reclassify.js +53 -0
- package/dist/native/store/reclassify.js.map +1 -0
- package/dist/native/store/sql/aggregateSql.js +349 -0
- package/dist/native/store/sql/aggregateSql.js.map +1 -0
- package/dist/native/store/sql/columns.js +49 -0
- package/dist/native/store/sql/columns.js.map +1 -0
- package/dist/native/store/sql/compile.js +668 -0
- package/dist/native/store/sql/compile.js.map +1 -0
- package/dist/native/store/sql/drivers.js +218 -0
- package/dist/native/store/sql/drivers.js.map +1 -0
- package/dist/native/store/sql/executor.js +132 -0
- package/dist/native/store/sql/executor.js.map +1 -0
- package/dist/native/store/sql/fragment.js +104 -0
- package/dist/native/store/sql/fragment.js.map +1 -0
- package/dist/native/store/sql/maintenanceSql.js +59 -0
- package/dist/native/store/sql/maintenanceSql.js.map +1 -0
- package/dist/native/store/sql/ownConnection.js +107 -0
- package/dist/native/store/sql/ownConnection.js.map +1 -0
- package/dist/native/store/sql/poolShare.js +101 -0
- package/dist/native/store/sql/poolShare.js.map +1 -0
- package/dist/native/store/sql/sqlState.js +325 -0
- package/dist/native/store/sql/sqlState.js.map +1 -0
- package/dist/native/store/sql/sqlStore.js +355 -0
- package/dist/native/store/sql/sqlStore.js.map +1 -0
- package/dist/native/store/sql/sqliteThread.d.ts +9 -0
- package/dist/native/store/sql/sqliteThread.js +314 -0
- package/dist/native/store/sql/sqliteThread.js.map +1 -0
- package/dist/native/store/sql/sqliteWorker.js +327 -0
- package/dist/native/store/sql/sqliteWorker.js.map +1 -0
- package/dist/native/store/sql/sqliteWorkerSource.js +347 -0
- package/dist/native/store/sql/sqliteWorkerSource.js.map +1 -0
- package/dist/native/store/state.js +151 -0
- package/dist/native/store/state.js.map +1 -0
- package/dist/native/store/stateStore.js +29 -0
- package/dist/native/store/stateStore.js.map +1 -0
- package/dist/native/store/types.d.ts +15 -0
- package/dist/native/store/types.js +10 -0
- package/dist/native/store/types.js.map +1 -0
- package/dist/native/tasks/maintainTask.d.ts +19 -0
- package/dist/native/tasks/maintainTask.js +57 -0
- package/dist/native/tasks/maintainTask.js.map +1 -0
- package/dist/net/guardedFetch.d.ts +32 -0
- package/dist/net/guardedFetch.js +220 -0
- package/dist/net/guardedFetch.js.map +1 -0
- package/dist/net/origin.js +40 -0
- package/dist/net/origin.js.map +1 -0
- package/dist/net/platform.d.ts +9 -0
- package/dist/net/platform.js +35 -0
- package/dist/net/platform.js.map +1 -0
- package/dist/plugin/adminDependencies.js +34 -0
- package/dist/plugin/adminDependencies.js.map +1 -0
- package/dist/plugin/apiPath.js +23 -0
- package/dist/plugin/apiPath.js.map +1 -0
- package/dist/plugin/boundDocument.js +58 -0
- package/dist/plugin/boundDocument.js.map +1 -0
- package/dist/plugin/buildPhase.js +10 -0
- package/dist/plugin/buildPhase.js.map +1 -0
- package/dist/plugin/collectionChecks.js +232 -0
- package/dist/plugin/collectionChecks.js.map +1 -0
- package/dist/plugin/collectionFields.d.ts +13 -0
- package/dist/plugin/collectionFields.js +22 -0
- package/dist/plugin/collectionFields.js.map +1 -0
- package/dist/plugin/createRuntime.js +346 -0
- package/dist/plugin/createRuntime.js.map +1 -0
- package/dist/plugin/destroy.js +58 -0
- package/dist/plugin/destroy.js.map +1 -0
- package/dist/plugin/documentEndpoint.js +105 -71
- package/dist/plugin/documentEndpoint.js.map +1 -1
- package/dist/plugin/documentScopes.js +37 -0
- package/dist/plugin/documentScopes.js.map +1 -0
- package/dist/plugin/encrypted.js +25 -0
- package/dist/plugin/encrypted.js.map +1 -0
- package/dist/plugin/errors.d.ts +24 -0
- package/dist/plugin/errors.js +86 -0
- package/dist/plugin/errors.js.map +1 -0
- package/dist/plugin/flagsEndpoint.js +41 -0
- package/dist/plugin/flagsEndpoint.js.map +1 -0
- package/dist/plugin/goalHint.js +22 -11
- package/dist/plugin/goalHint.js.map +1 -1
- package/dist/plugin/itemLabels.js +114 -0
- package/dist/plugin/itemLabels.js.map +1 -0
- package/dist/plugin/keepAlive.js +48 -0
- package/dist/plugin/keepAlive.js.map +1 -0
- package/dist/plugin/peerImportError.js +3 -6
- package/dist/plugin/peerImportError.js.map +1 -1
- package/dist/plugin/peers.js +64 -0
- package/dist/plugin/peers.js.map +1 -0
- package/dist/plugin/pluginCollections.js +161 -0
- package/dist/plugin/pluginCollections.js.map +1 -0
- package/dist/plugin/queryEndpoint.js +80 -51
- package/dist/plugin/queryEndpoint.js.map +1 -1
- package/dist/plugin/queryParams.js +7 -0
- package/dist/plugin/queryParams.js.map +1 -0
- package/dist/plugin/readContextForRequest.d.ts +11 -0
- package/dist/plugin/readContextForRequest.js +79 -32
- package/dist/plugin/readContextForRequest.js.map +1 -1
- package/dist/plugin/readFailure.js +22 -0
- package/dist/plugin/readFailure.js.map +1 -0
- package/dist/plugin/readableProviders.js +67 -0
- package/dist/plugin/readableProviders.js.map +1 -0
- package/dist/plugin/realtimeEndpoint.js +79 -34
- package/dist/plugin/realtimeEndpoint.js.map +1 -1
- package/dist/plugin/refreshEndpoint.js +138 -0
- package/dist/plugin/refreshEndpoint.js.map +1 -0
- package/dist/plugin/relabelFields.js +36 -0
- package/dist/plugin/relabelFields.js.map +1 -0
- package/dist/plugin/requestMemo.js +35 -0
- package/dist/plugin/requestMemo.js.map +1 -0
- package/dist/plugin/routeChecks.js +39 -0
- package/dist/plugin/routeChecks.js.map +1 -0
- package/dist/plugin/routes.d.ts +53 -0
- package/dist/plugin/routes.js +92 -0
- package/dist/plugin/routes.js.map +1 -0
- package/dist/plugin/runtime.d.ts +1 -1
- package/dist/plugin/runtime.js +235 -29
- package/dist/plugin/runtime.js.map +1 -1
- package/dist/plugin/schemaOnly.js +61 -0
- package/dist/plugin/schemaOnly.js.map +1 -0
- package/dist/plugin/scopeChange.js +23 -0
- package/dist/plugin/scopeChange.js.map +1 -0
- package/dist/plugin/scopeFieldBoot.js +4 -4
- package/dist/plugin/scopeFieldBoot.js.map +1 -1
- package/dist/plugin/scopeToken.js +33 -0
- package/dist/plugin/scopeToken.js.map +1 -0
- package/dist/plugin/sourcesEndpoint.js +50 -23
- package/dist/plugin/sourcesEndpoint.js.map +1 -1
- package/dist/plugin/unbundledLanguages.js +25 -0
- package/dist/plugin/unbundledLanguages.js.map +1 -0
- package/dist/plugin/walkFields.js +24 -0
- package/dist/plugin/walkFields.js.map +1 -0
- package/dist/plugin/warmTask.js +0 -0
- package/dist/plugin/warmTask.js.map +1 -1
- package/dist/providers/ProvidersListNotice.d.ts +11 -0
- package/dist/providers/ProvidersListNotice.js +36 -0
- package/dist/providers/ProvidersListNotice.js.map +1 -0
- package/dist/providers/access.d.ts +1 -0
- package/dist/providers/access.js +35 -26
- package/dist/providers/access.js.map +1 -1
- package/dist/providers/adapterPool.js +121 -0
- package/dist/providers/adapterPool.js.map +1 -0
- package/dist/providers/collection.d.ts +63 -0
- package/dist/providers/collection.js +369 -150
- package/dist/providers/collection.js.map +1 -1
- package/dist/providers/factory.d.ts +84 -0
- package/dist/providers/factory.js +84 -25
- package/dist/providers/factory.js.map +1 -1
- package/dist/providers/hosts.d.ts +25 -0
- package/dist/providers/hosts.js +128 -0
- package/dist/providers/hosts.js.map +1 -0
- package/dist/providers/probe.d.ts +1 -0
- package/dist/providers/probe.js +105 -0
- package/dist/providers/probe.js.map +1 -0
- package/dist/providers/refresh.d.ts +18 -0
- package/dist/providers/refresh.js +49 -0
- package/dist/providers/refresh.js.map +1 -0
- package/dist/providers/registry.js +329 -0
- package/dist/providers/registry.js.map +1 -0
- package/dist/providers/resolver.js +26 -88
- package/dist/providers/resolver.js.map +1 -1
- package/dist/providers/retarget.js +45 -0
- package/dist/providers/retarget.js.map +1 -0
- package/dist/providers/scopeUnique.js +41 -0
- package/dist/providers/scopeUnique.js.map +1 -0
- package/dist/providers/secrets.d.ts +26 -0
- package/dist/providers/secrets.js +61 -4
- package/dist/providers/secrets.js.map +1 -1
- package/dist/providers/stampScope.js +9 -6
- package/dist/providers/stampScope.js.map +1 -1
- package/dist/query/dates.js +10 -12
- package/dist/query/dates.js.map +1 -1
- package/dist/query/errors.d.ts +6 -13
- package/dist/query/fetchQuery.d.ts +36 -23
- package/dist/query/fetchQuery.js +96 -89
- package/dist/query/fetchQuery.js.map +1 -1
- package/dist/query/limits.js +8 -0
- package/dist/query/limits.js.map +1 -0
- package/dist/query/parse.d.ts +8 -2
- package/dist/query/parse.js +155 -108
- package/dist/query/parse.js.map +1 -1
- package/dist/query/response.d.ts +23 -3
- package/dist/query/response.js +12 -5
- package/dist/query/response.js.map +1 -1
- package/dist/react/AnalyticsProvider.d.ts +42 -20
- package/dist/react/AnalyticsProvider.js +24 -22
- package/dist/react/AnalyticsProvider.js.map +1 -1
- package/dist/react/TrackerBoot.js +15 -9
- package/dist/react/TrackerBoot.js.map +1 -1
- package/dist/react/useAnalytics.d.ts +2 -8
- package/dist/react/useAnalytics.js +31 -13
- package/dist/react/useAnalytics.js.map +1 -1
- package/dist/routes/captureRoute.d.ts +28 -0
- package/dist/routes/captureRoute.js +67 -0
- package/dist/routes/captureRoute.js.map +1 -0
- package/dist/routes/ingestRoute.d.ts +17 -0
- package/dist/routes/ingestRoute.js +17 -0
- package/dist/routes/ingestRoute.js.map +1 -0
- package/dist/site/AnalyticsScripts.d.ts +35 -0
- package/dist/site/AnalyticsScripts.js +44 -0
- package/dist/site/AnalyticsScripts.js.map +1 -0
- package/dist/site/getTrackerConfig.d.ts +15 -0
- package/dist/site/getTrackerConfig.js +43 -0
- package/dist/site/getTrackerConfig.js.map +1 -0
- package/dist/surfacing/afterRead.d.ts +37 -0
- package/dist/surfacing/bounded.js +38 -0
- package/dist/surfacing/bounded.js.map +1 -0
- package/dist/surfacing/breaker.js +107 -0
- package/dist/surfacing/breaker.js.map +1 -0
- package/dist/surfacing/cacheCollection.d.ts +8 -0
- package/dist/surfacing/cacheCollection.js +71 -0
- package/dist/surfacing/cacheCollection.js.map +1 -0
- package/dist/surfacing/cacheStore.d.ts +71 -1
- package/dist/surfacing/cacheStore.js +16 -37
- package/dist/surfacing/cacheStore.js.map +1 -1
- package/dist/surfacing/cacheSweep.d.ts +1 -0
- package/dist/surfacing/cacheSweep.js +59 -0
- package/dist/surfacing/cacheSweep.js.map +1 -0
- package/dist/surfacing/classifyError.js +282 -0
- package/dist/surfacing/classifyError.js.map +1 -0
- package/dist/surfacing/coalesce.js +2 -1
- package/dist/surfacing/coalesce.js.map +1 -1
- package/dist/surfacing/coldBudget.js +60 -0
- package/dist/surfacing/coldBudget.js.map +1 -0
- package/dist/surfacing/collectionCacheStore.js +183 -0
- package/dist/surfacing/collectionCacheStore.js.map +1 -0
- package/dist/surfacing/engine.d.ts +1 -1
- package/dist/surfacing/engine.js +514 -71
- package/dist/surfacing/engine.js.map +1 -1
- package/dist/surfacing/epoch.d.ts +1 -0
- package/dist/surfacing/epoch.js +116 -0
- package/dist/surfacing/epoch.js.map +1 -0
- package/dist/surfacing/lanes.d.ts +1 -0
- package/dist/surfacing/lanes.js +297 -0
- package/dist/surfacing/lanes.js.map +1 -0
- package/dist/surfacing/memo.js +40 -0
- package/dist/surfacing/memo.js.map +1 -0
- package/dist/surfacing/rateLimiter.d.ts +1 -0
- package/dist/surfacing/rateLimiter.js +69 -94
- package/dist/surfacing/rateLimiter.js.map +1 -1
- package/dist/surfacing/rebucket.js +178 -0
- package/dist/surfacing/rebucket.js.map +1 -0
- package/dist/surfacing/recipe.js +28 -0
- package/dist/surfacing/recipe.js.map +1 -0
- package/dist/surfacing/shape.js +22 -0
- package/dist/surfacing/shape.js.map +1 -0
- package/dist/surfacing/todaySplit.js +119 -0
- package/dist/surfacing/todaySplit.js.map +1 -0
- package/dist/sync/collection.d.ts +8 -0
- package/dist/sync/collection.js +30 -18
- package/dist/sync/collection.js.map +1 -1
- package/dist/sync/rekeyDurations.js +70 -0
- package/dist/sync/rekeyDurations.js.map +1 -0
- package/dist/sync/syncTask.js +222 -109
- package/dist/sync/syncTask.js.map +1 -1
- package/dist/testing/memoryAdapter.d.ts +6 -3
- package/dist/testing/memoryAdapter.js +12 -10
- package/dist/testing/memoryAdapter.js.map +1 -1
- package/dist/testing/settle.d.ts +11 -0
- package/dist/testing/settle.js +19 -0
- package/dist/testing/settle.js.map +1 -0
- package/dist/timeframe/calendar.js +65 -0
- package/dist/timeframe/calendar.js.map +1 -0
- package/dist/timeframe/comparison.js +46 -0
- package/dist/timeframe/comparison.js.map +1 -0
- package/dist/timeframe/presets.d.ts +1 -1
- package/dist/timeframe/presets.js +5 -5
- package/dist/timeframe/presets.js.map +1 -1
- package/dist/timeframe/reportingTimezone.d.ts +1 -0
- package/dist/timeframe/reportingTimezone.js +64 -0
- package/dist/timeframe/reportingTimezone.js.map +1 -0
- package/dist/timeframe/tz.js +55 -39
- package/dist/timeframe/tz.js.map +1 -1
- package/dist/tracker/autoCapture.js +125 -38
- package/dist/tracker/autoCapture.js.map +1 -1
- package/dist/tracker/campaign.js +52 -0
- package/dist/tracker/campaign.js.map +1 -0
- package/dist/tracker/config.d.ts +174 -0
- package/dist/tracker/config.js +25 -0
- package/dist/tracker/config.js.map +1 -0
- package/dist/tracker/createTracker.d.ts +5 -10
- package/dist/tracker/createTracker.js +434 -91
- package/dist/tracker/createTracker.js.map +1 -1
- package/dist/tracker/digest.js +28 -0
- package/dist/tracker/digest.js.map +1 -0
- package/dist/tracker/engagement.js +100 -0
- package/dist/tracker/engagement.js.map +1 -0
- package/dist/tracker/events.js +37 -0
- package/dist/tracker/events.js.map +1 -0
- package/dist/tracker/exclusion.d.ts +8 -0
- package/dist/tracker/exclusion.js +82 -0
- package/dist/tracker/exclusion.js.map +1 -0
- package/dist/tracker/gate.d.ts +8 -0
- package/dist/tracker/gate.js +244 -0
- package/dist/tracker/gate.js.map +1 -0
- package/dist/tracker/initTracker.d.ts +5 -8
- package/dist/tracker/initTracker.js +42 -14
- package/dist/tracker/initTracker.js.map +1 -1
- package/dist/tracker/itemCapture.js +224 -0
- package/dist/tracker/itemCapture.js.map +1 -0
- package/dist/tracker/loadScript.js +23 -15
- package/dist/tracker/loadScript.js.map +1 -1
- package/dist/tracker/pageTracking.js +6 -6
- package/dist/tracker/pageTracking.js.map +1 -1
- package/dist/tracker/registry.js +129 -30
- package/dist/tracker/registry.js.map +1 -1
- package/dist/tracker/sinks/createSink.js +60 -0
- package/dist/tracker/sinks/createSink.js.map +1 -0
- package/dist/tracker/sinks/ga4.js +97 -17
- package/dist/tracker/sinks/ga4.js.map +1 -1
- package/dist/tracker/sinks/native.js +21 -42
- package/dist/tracker/sinks/native.js.map +1 -1
- package/dist/tracker/sinks/plausible.js +36 -18
- package/dist/tracker/sinks/plausible.js.map +1 -1
- package/dist/tracker/sinks/posthog.js +145 -9
- package/dist/tracker/sinks/posthog.js.map +1 -1
- package/dist/tracker/sinks/umami.js +18 -10
- package/dist/tracker/sinks/umami.js.map +1 -1
- package/dist/tracker/sinks/vendor.js +54 -22
- package/dist/tracker/sinks/vendor.js.map +1 -1
- package/dist/tracker/skip.js +81 -0
- package/dist/tracker/skip.js.map +1 -0
- package/dist/tracker/storage.js +23 -0
- package/dist/tracker/storage.js.map +1 -0
- package/dist/tracker/transport.js +2 -5
- package/dist/tracker/transport.js.map +1 -1
- package/dist/tracker/types.d.ts +99 -49
- package/dist/tracker/window.js +7 -0
- package/dist/tracker/window.js.map +1 -0
- package/dist/translations/ar.js +255 -74
- package/dist/translations/ar.js.map +1 -1
- package/dist/translations/de.js +243 -71
- package/dist/translations/de.js.map +1 -1
- package/dist/translations/en.js +238 -70
- package/dist/translations/en.js.map +1 -1
- package/dist/translations/es.js +246 -71
- package/dist/translations/es.js.map +1 -1
- package/dist/translations/fr.js +250 -75
- package/dist/translations/fr.js.map +1 -1
- package/dist/translations/id.js +241 -70
- package/dist/translations/id.js.map +1 -1
- package/dist/translations/index.d.ts +1 -1
- package/dist/translations/index.js +5 -7
- package/dist/translations/index.js.map +1 -1
- package/dist/translations/intl.js +71 -0
- package/dist/translations/intl.js.map +1 -0
- package/dist/translations/keys.d.ts +214 -17
- package/dist/translations/keys.js +219 -17
- package/dist/translations/keys.js.map +1 -1
- package/dist/translations/ko.js +243 -72
- package/dist/translations/ko.js.map +1 -1
- package/dist/translations/labelMap.d.ts +10 -0
- package/dist/translations/labelMap.js +22 -0
- package/dist/translations/labelMap.js.map +1 -0
- package/dist/translations/metricKeys.js +10 -2
- package/dist/translations/metricKeys.js.map +1 -1
- package/dist/translations/parts.js +20 -0
- package/dist/translations/parts.js.map +1 -0
- package/dist/translations/plural.js +61 -0
- package/dist/translations/plural.js.map +1 -0
- package/dist/translations/pt.js +255 -80
- package/dist/translations/pt.js.map +1 -1
- package/dist/translations/ru.js +246 -69
- package/dist/translations/ru.js.map +1 -1
- package/dist/translations/server.d.ts +1 -0
- package/dist/translations/server.js +2 -3
- package/dist/translations/server.js.map +1 -1
- package/dist/translations/staticLabel.js +69 -0
- package/dist/translations/staticLabel.js.map +1 -0
- package/dist/translations/uk.js +246 -69
- package/dist/translations/uk.js.map +1 -1
- package/dist/translations/zh.js +241 -70
- package/dist/translations/zh.js.map +1 -1
- package/dist/ui/RangePicker.js +110 -0
- package/dist/ui/RangePicker.js.map +1 -0
- package/dist/ui/analytics.css +1667 -0
- package/dist/ui/calendarDays.js +27 -0
- package/dist/ui/calendarDays.js.map +1 -0
- package/dist/ui/classNames.js +7 -0
- package/dist/ui/classNames.js.map +1 -0
- package/dist/ui/components/Card.d.ts +28 -0
- package/dist/ui/components/Card.js +21 -0
- package/dist/ui/components/Card.js.map +1 -0
- package/dist/ui/components/ChartDataTable.d.ts +41 -0
- package/dist/ui/components/ChartDataTable.js +48 -0
- package/dist/ui/components/ChartDataTable.js.map +1 -0
- package/dist/ui/components/ChoiceMenu.js +48 -0
- package/dist/ui/components/ChoiceMenu.js.map +1 -0
- package/dist/ui/components/DataTable.d.ts +82 -0
- package/dist/ui/components/DataTable.js +214 -0
- package/dist/ui/components/DataTable.js.map +1 -0
- package/dist/ui/components/LabeledSelect.js +62 -0
- package/dist/ui/components/LabeledSelect.js.map +1 -0
- package/dist/ui/components/LiveAnnouncement.js +21 -0
- package/dist/ui/components/LiveAnnouncement.js.map +1 -0
- package/dist/ui/components/MetricCard.d.ts +38 -0
- package/dist/ui/components/MetricCard.js +39 -0
- package/dist/ui/components/MetricCard.js.map +1 -0
- package/dist/ui/components/NoValue.js +22 -0
- package/dist/ui/components/NoValue.js.map +1 -0
- package/dist/ui/components/ReadState.js +27 -0
- package/dist/ui/components/ReadState.js.map +1 -0
- package/dist/ui/components/RefreshButton.js +25 -0
- package/dist/ui/components/RefreshButton.js.map +1 -0
- package/dist/ui/components/SourcesNoticeBanner.js +20 -0
- package/dist/ui/components/SourcesNoticeBanner.js.map +1 -0
- package/dist/ui/cssVars.js +7 -0
- package/dist/ui/cssVars.js.map +1 -0
- package/dist/ui/data/WithScopeToken.d.ts +20 -0
- package/dist/ui/data/WithScopeToken.js +20 -0
- package/dist/ui/data/WithScopeToken.js.map +1 -0
- package/dist/ui/data/clientFieldProps.js +16 -0
- package/dist/ui/data/clientFieldProps.js.map +1 -0
- package/dist/ui/data/request.d.ts +46 -0
- package/dist/ui/data/request.js +119 -0
- package/dist/ui/data/request.js.map +1 -0
- package/dist/ui/data/scopeTokenContext.js +18 -0
- package/dist/ui/data/scopeTokenContext.js.map +1 -0
- package/dist/ui/data/sharedCache.js +48 -0
- package/dist/ui/data/sharedCache.js.map +1 -0
- package/dist/ui/data/useRequest.d.ts +19 -0
- package/dist/ui/data/useRequest.js +123 -0
- package/dist/ui/data/useRequest.js.map +1 -0
- package/dist/ui/data/useRequestScope.js +25 -0
- package/dist/ui/data/useRequestScope.js.map +1 -0
- package/dist/ui/hooks/useDirection.js +47 -0
- package/dist/ui/hooks/useDirection.js.map +1 -0
- package/dist/ui/hooks/useDismissOnEscape.js +25 -0
- package/dist/ui/hooks/useDismissOnEscape.js.map +1 -0
- package/dist/ui/hooks/useLiveAnnouncement.js +57 -0
- package/dist/ui/hooks/useLiveAnnouncement.js.map +1 -0
- package/dist/ui/hooks/useRealtimePoll.js +112 -0
- package/dist/ui/hooks/useRealtimePoll.js.map +1 -0
- package/dist/ui/readState.js +19 -0
- package/dist/ui/readState.js.map +1 -0
- package/dist/ui/rows/toDisplayRows.js +49 -0
- package/dist/ui/rows/toDisplayRows.js.map +1 -0
- package/dist/ui/viewerClock.js +7 -0
- package/dist/ui/viewerClock.js.map +1 -0
- package/dist/view/AnalyticsNavLink.d.ts +5 -3
- package/dist/view/AnalyticsNavLink.js +12 -8
- package/dist/view/AnalyticsNavLink.js.map +1 -1
- package/dist/view/AnalyticsView.d.ts +9 -10
- package/dist/view/AnalyticsView.js +47 -19
- package/dist/view/AnalyticsView.js.map +1 -1
- package/dist/view/AnalyticsViewClient.d.ts +4 -7
- package/dist/view/AnalyticsViewClient.js +15 -185
- package/dist/view/AnalyticsViewClient.js.map +1 -1
- package/dist/view/CountryFlag.d.ts +27 -0
- package/dist/view/CountryFlag.js +44 -0
- package/dist/view/CountryFlag.js.map +1 -0
- package/dist/view/DocumentTitle.js +27 -0
- package/dist/view/DocumentTitle.js.map +1 -0
- package/dist/view/ViewRoot.d.ts +21 -0
- package/dist/view/ViewRoot.js +155 -0
- package/dist/view/ViewRoot.js.map +1 -0
- package/dist/view/ViewSections.d.ts +38 -0
- package/dist/view/ViewSections.js +190 -0
- package/dist/view/ViewSections.js.map +1 -0
- package/dist/view/authRedirect.js +2 -4
- package/dist/view/authRedirect.js.map +1 -1
- package/dist/view/consentShare.js +15 -0
- package/dist/view/consentShare.js.map +1 -0
- package/dist/view/conversionRate.js +9 -7
- package/dist/view/conversionRate.js.map +1 -1
- package/dist/view/dayRange.js +6 -10
- package/dist/view/dayRange.js.map +1 -1
- package/dist/view/exclusionLink.d.ts +27 -0
- package/dist/view/exclusionLink.js +46 -0
- package/dist/view/exclusionLink.js.map +1 -0
- package/dist/view/flagSrc.js +14 -0
- package/dist/view/flagSrc.js.map +1 -0
- package/dist/view/gating.d.ts +15 -1
- package/dist/view/gating.js +67 -32
- package/dist/view/gating.js.map +1 -1
- package/dist/view/hostCountryFlag.js +41 -0
- package/dist/view/hostCountryFlag.js.map +1 -0
- package/dist/view/labels.js +113 -16
- package/dist/view/labels.js.map +1 -1
- package/dist/view/metricAliases.js +10 -0
- package/dist/view/metricAliases.js.map +1 -0
- package/dist/view/navLabel.js +15 -0
- package/dist/view/navLabel.js.map +1 -0
- package/dist/view/registerView.js +13 -11
- package/dist/view/registerView.js.map +1 -1
- package/dist/view/scopeLabel.js +21 -0
- package/dist/view/scopeLabel.js.map +1 -0
- package/dist/view/sections/Breakdowns.js +195 -132
- package/dist/view/sections/Breakdowns.js.map +1 -1
- package/dist/view/sections/EmptyStates.js +120 -32
- package/dist/view/sections/EmptyStates.js.map +1 -1
- package/dist/view/sections/ExcludeBrowser.js +188 -0
- package/dist/view/sections/ExcludeBrowser.js.map +1 -0
- package/dist/view/sections/FilterChips.js +127 -27
- package/dist/view/sections/FilterChips.js.map +1 -1
- package/dist/view/sections/GoalsPanel.js +68 -60
- package/dist/view/sections/GoalsPanel.js.map +1 -1
- package/dist/view/sections/OverviewCards.js +42 -36
- package/dist/view/sections/OverviewCards.js.map +1 -1
- package/dist/view/sections/RealtimeStrip.js +70 -59
- package/dist/view/sections/RealtimeStrip.js.map +1 -1
- package/dist/view/sections/SectionBoundary.js +34 -0
- package/dist/view/sections/SectionBoundary.js.map +1 -0
- package/dist/view/sections/Toolbar.d.ts +11 -0
- package/dist/view/sections/Toolbar.js +181 -122
- package/dist/view/sections/Toolbar.js.map +1 -1
- package/dist/view/sections/Trend.js +176 -76
- package/dist/view/sections/Trend.js.map +1 -1
- package/dist/view/state.d.ts +42 -0
- package/dist/view/state.js +93 -54
- package/dist/view/state.js.map +1 -1
- package/dist/view/useViewClock.js +31 -0
- package/dist/view/useViewClock.js.map +1 -0
- package/dist/view/useViewQueries.d.ts +21 -0
- package/dist/view/useViewQueries.js +45 -77
- package/dist/view/useViewQueries.js.map +1 -1
- package/dist/view/useViewState.js +42 -0
- package/dist/view/useViewState.js.map +1 -0
- package/dist/view/useViewUrl.js +52 -0
- package/dist/view/useViewUrl.js.map +1 -0
- package/dist/view/viewBody.js +30 -0
- package/dist/view/viewBody.js.map +1 -0
- package/dist/view/viewContext.d.ts +81 -0
- package/dist/view/viewContext.js +49 -0
- package/dist/view/viewContext.js.map +1 -0
- package/dist/view/viewProps.d.ts +65 -8
- package/dist/view/viewProps.js +123 -36
- package/dist/view/viewProps.js.map +1 -1
- package/dist/widgets/AnalyticsBreakdownWidget.d.ts +7 -3
- package/dist/widgets/AnalyticsBreakdownWidget.js +144 -118
- package/dist/widgets/AnalyticsBreakdownWidget.js.map +1 -1
- package/dist/widgets/AnalyticsGoalsWidget.d.ts +6 -7
- package/dist/widgets/AnalyticsGoalsWidget.js +126 -167
- package/dist/widgets/AnalyticsGoalsWidget.js.map +1 -1
- package/dist/widgets/AnalyticsMetricWidget.d.ts +7 -3
- package/dist/widgets/AnalyticsMetricWidget.js +81 -106
- package/dist/widgets/AnalyticsMetricWidget.js.map +1 -1
- package/dist/widgets/AnalyticsRealtimeWidget.d.ts +7 -3
- package/dist/widgets/AnalyticsRealtimeWidget.js +81 -63
- package/dist/widgets/AnalyticsRealtimeWidget.js.map +1 -1
- package/dist/widgets/AnalyticsTrendWidget.d.ts +7 -3
- package/dist/widgets/AnalyticsTrendWidget.js +130 -123
- package/dist/widgets/AnalyticsTrendWidget.js.map +1 -1
- package/dist/widgets/ComparisonDelta.js +33 -42
- package/dist/widgets/ComparisonDelta.js.map +1 -1
- package/dist/widgets/RealtimeCounter.d.ts +24 -4
- package/dist/widgets/RealtimeCounter.js +90 -71
- package/dist/widgets/RealtimeCounter.js.map +1 -1
- package/dist/widgets/WidgetCard.d.ts +80 -0
- package/dist/widgets/WidgetCard.js +99 -0
- package/dist/widgets/WidgetCard.js.map +1 -0
- package/dist/widgets/WidgetFrame.js +42 -0
- package/dist/widgets/WidgetFrame.js.map +1 -0
- package/dist/widgets/WidgetShimmer.d.ts +55 -0
- package/dist/widgets/WidgetShimmer.js +86 -0
- package/dist/widgets/WidgetShimmer.js.map +1 -0
- package/dist/widgets/breakdownTypes.js +18 -2
- package/dist/widgets/breakdownTypes.js.map +1 -1
- package/dist/widgets/customWidget.d.ts +5 -1
- package/dist/widgets/customWidget.js +6 -7
- package/dist/widgets/customWidget.js.map +1 -1
- package/dist/widgets/defaultLayout.d.ts +26 -0
- package/dist/widgets/defaultLayout.js +51 -0
- package/dist/widgets/defaultLayout.js.map +1 -0
- package/dist/widgets/defaults.d.ts +4 -7
- package/dist/widgets/defaults.js +12 -7
- package/dist/widgets/defaults.js.map +1 -1
- package/dist/widgets/fieldRows.js +14 -0
- package/dist/widgets/fieldRows.js.map +1 -0
- package/dist/widgets/filterCaption.js +6 -7
- package/dist/widgets/filterCaption.js.map +1 -1
- package/dist/widgets/filterField.d.ts +3 -7
- package/dist/widgets/filterField.js +46 -35
- package/dist/widgets/filterField.js.map +1 -1
- package/dist/widgets/filterValueLabel.d.ts +1 -0
- package/dist/widgets/filterValueLabel.js +45 -0
- package/dist/widgets/filterValueLabel.js.map +1 -0
- package/dist/widgets/notices.js +79 -0
- package/dist/widgets/notices.js.map +1 -0
- package/dist/widgets/prepareWidgetRead.d.ts +19 -2
- package/dist/widgets/prepareWidgetRead.js +63 -27
- package/dist/widgets/prepareWidgetRead.js.map +1 -1
- package/dist/widgets/range.js +26 -21
- package/dist/widgets/range.js.map +1 -1
- package/dist/widgets/readForWidget.d.ts +28 -19
- package/dist/widgets/readForWidget.js +33 -29
- package/dist/widgets/readForWidget.js.map +1 -1
- package/dist/widgets/readForWidgetBreakdown.d.ts +40 -29
- package/dist/widgets/readForWidgetBreakdown.js +48 -22
- package/dist/widgets/readForWidgetBreakdown.js.map +1 -1
- package/dist/widgets/readForWidgetGoals.d.ts +18 -24
- package/dist/widgets/readForWidgetGoals.js +52 -46
- package/dist/widgets/readForWidgetGoals.js.map +1 -1
- package/dist/widgets/readForWidgetRealtime.d.ts +22 -17
- package/dist/widgets/readForWidgetRealtime.js +54 -27
- package/dist/widgets/readForWidgetRealtime.js.map +1 -1
- package/dist/widgets/readForWidgetSeries.d.ts +27 -32
- package/dist/widgets/readForWidgetSeries.js +45 -82
- package/dist/widgets/readForWidgetSeries.js.map +1 -1
- package/dist/widgets/readMeta.d.ts +48 -0
- package/dist/widgets/readMeta.js +52 -4
- package/dist/widgets/readMeta.js.map +1 -1
- package/dist/widgets/realtimePoll.d.ts +1 -0
- package/dist/widgets/realtimePoll.js +56 -16
- package/dist/widgets/realtimePoll.js.map +1 -1
- package/dist/widgets/registerWidgets.js +207 -127
- package/dist/widgets/registerWidgets.js.map +1 -1
- package/dist/widgets/stateKeys.js +30 -0
- package/dist/widgets/stateKeys.js.map +1 -0
- package/dist/widgets/titleForecast.js +89 -0
- package/dist/widgets/titleForecast.js.map +1 -0
- package/dist/widgets/types.d.ts +4 -3
- package/dist/widgets/types.js +2 -0
- package/dist/widgets/types.js.map +1 -1
- package/dist/widgets/viewLink.d.ts +24 -6
- package/dist/widgets/viewLink.js +31 -24
- package/dist/widgets/viewLink.js.map +1 -1
- package/dist/widgets/widgetData.js +34 -0
- package/dist/widgets/widgetData.js.map +1 -0
- package/dist/widgets/widgetWindow.d.ts +1 -0
- package/dist/widgets/widgetWindow.js +51 -0
- package/dist/widgets/widgetWindow.js.map +1 -0
- package/package.json +61 -42
- package/dist/capture/getTrackerConfig.d.ts +0 -20
- package/dist/capture/getTrackerConfig.js +0 -31
- package/dist/capture/getTrackerConfig.js.map +0 -1
- package/dist/capture/slots.d.ts +0 -8
- package/dist/capture/trackerConfig.d.ts +0 -33
- package/dist/charts/styles.js +0 -59
- package/dist/charts/styles.js.map +0 -1
- package/dist/exports/next.d.ts +0 -3
- package/dist/exports/next.js +0 -3
- package/dist/fields/config/SourceSelectField.d.ts +0 -14
- package/dist/fields/dateRange/styles.js +0 -23
- package/dist/fields/dateRange/styles.js.map +0 -1
- package/dist/goals/GoalSelectField.d.ts +0 -7
- package/dist/native/collections/events.js +0 -157
- package/dist/native/collections/events.js.map +0 -1
- package/dist/native/collections/rollups.js +0 -151
- package/dist/native/collections/rollups.js.map +0 -1
- package/dist/native/collections/seen.js +0 -47
- package/dist/native/collections/seen.js.map +0 -1
- package/dist/native/eventScan.js +0 -25
- package/dist/native/eventScan.js.map +0 -1
- package/dist/native/ingest/flushBatch.js +0 -60
- package/dist/native/ingest/flushBatch.js.map +0 -1
- package/dist/native/ingest/salt.js +0 -14
- package/dist/native/ingest/salt.js.map +0 -1
- package/dist/native/ingest/writeBuffer.js +0 -55
- package/dist/native/ingest/writeBuffer.js.map +0 -1
- package/dist/native/ingest/writeEvent.js +0 -14
- package/dist/native/ingest/writeEvent.js.map +0 -1
- package/dist/native/query/eventAgg.js +0 -174
- package/dist/native/query/eventAgg.js.map +0 -1
- package/dist/native/realtime/buildRealtime.js +0 -53
- package/dist/native/realtime/buildRealtime.js.map +0 -1
- package/dist/native/retention/pruneTask.js +0 -29
- package/dist/native/retention/pruneTask.js.map +0 -1
- package/dist/native/rollupAcc.js +0 -64
- package/dist/native/rollupAcc.js.map +0 -1
- package/dist/native/rollups/bucketKey.js +0 -15
- package/dist/native/rollups/bucketKey.js.map +0 -1
- package/dist/native/rollups/bumpRollups.js +0 -116
- package/dist/native/rollups/bumpRollups.js.map +0 -1
- package/dist/native/rollups/deltas.js +0 -105
- package/dist/native/rollups/deltas.js.map +0 -1
- package/dist/native/rollups/insertManyIfNew.js +0 -93
- package/dist/native/rollups/insertManyIfNew.js.map +0 -1
- package/dist/next/captureRewrites.d.ts +0 -42
- package/dist/next/captureRewrites.js +0 -57
- package/dist/next/captureRewrites.js.map +0 -1
- package/dist/next/posthogProxyRewrites.d.ts +0 -41
- package/dist/next/posthogProxyRewrites.js +0 -45
- package/dist/next/posthogProxyRewrites.js.map +0 -1
- package/dist/plugin/paths.js +0 -27
- package/dist/plugin/paths.js.map +0 -1
- package/dist/plugin/responses.js +0 -17
- package/dist/plugin/responses.js.map +0 -1
- package/dist/query/errors.js +0 -10
- package/dist/query/errors.js.map +0 -1
- package/dist/react/TrackerBoot.d.ts +0 -22
- package/dist/rsc/AnalyticsScripts.d.ts +0 -30
- package/dist/rsc/AnalyticsScripts.js +0 -41
- package/dist/rsc/AnalyticsScripts.js.map +0 -1
- package/dist/surfacing/queue.js +0 -60
- package/dist/surfacing/queue.js.map +0 -1
- package/dist/surfacing/retryPolicy.js +0 -15
- package/dist/surfacing/retryPolicy.js.map +0 -1
- package/dist/tracker/autoCapture.d.ts +0 -48
- package/dist/tracker/consent.d.ts +0 -24
- package/dist/tracker/consent.js +0 -48
- package/dist/tracker/consent.js.map +0 -1
- package/dist/tracker/loadScript.d.ts +0 -14
- package/dist/tracker/pageTracking.d.ts +0 -17
- package/dist/tracker/registry.d.ts +0 -27
- package/dist/tracker/sinks/ga4.d.ts +0 -21
- package/dist/tracker/sinks/native.d.ts +0 -22
- package/dist/tracker/sinks/plausible.d.ts +0 -14
- package/dist/tracker/sinks/posthog.d.ts +0 -14
- package/dist/tracker/sinks/umami.d.ts +0 -13
- package/dist/tracker/sinks/vendor.d.ts +0 -14
- package/dist/view/sections/styles.js +0 -74
- package/dist/view/sections/styles.js.map +0 -1
- package/dist/widgets/WidgetViewLink.js +0 -17
- package/dist/widgets/WidgetViewLink.js.map +0 -1
- package/dist/widgets/cardChrome.d.ts +0 -8
- package/dist/widgets/cardChrome.js +0 -46
- package/dist/widgets/cardChrome.js.map +0 -1
- package/dist/widgets/comparison.js +0 -57
- package/dist/widgets/comparison.js.map +0 -1
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { kindOf } from "./values.js";
|
|
2
|
+
import { flatFieldName, keysOf, optionsObject } from "./optionChecks.js";
|
|
3
|
+
//#region src/core/collectionOption.ts
|
|
4
|
+
/** Only that it is a function can be checked at run time; the option's type promises the rest. */
|
|
5
|
+
const isOverrides = (value) => typeof value === "function";
|
|
6
|
+
/** `overrides` checked at boot: a function or nothing, since no object is ever merged in. */
|
|
7
|
+
const overridesOf = (value, path) => {
|
|
8
|
+
if (value === void 0) return;
|
|
9
|
+
if (!isOverrides(value)) throw new Error(`analytics: ${path} must be a function, (collection) => collection, got ${kindOf(value)}`);
|
|
10
|
+
return value;
|
|
11
|
+
};
|
|
12
|
+
/** A collection slug option checked at boot, trimmed, or the default when unset. */
|
|
13
|
+
const slugOf = (value, path, fallback) => {
|
|
14
|
+
if (value === void 0) return fallback;
|
|
15
|
+
if (typeof value !== "string" || value.trim() === "") throw new Error(`analytics: ${path} must be a non-empty collection slug, got ${kindOf(value)}`);
|
|
16
|
+
return value.trim();
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* One `{ slug, overrides }` option checked at boot. `path` names it in every refusal, and `extra`
|
|
20
|
+
* lists the other keys the option takes beside those two.
|
|
21
|
+
*/
|
|
22
|
+
const resolveCollectionOption = (value, where) => {
|
|
23
|
+
const { path, fallback, extra = [] } = where;
|
|
24
|
+
if (value === void 0) return { slug: fallback };
|
|
25
|
+
const shaped = optionsObject(value, {
|
|
26
|
+
path,
|
|
27
|
+
known: [
|
|
28
|
+
"slug",
|
|
29
|
+
"overrides",
|
|
30
|
+
...extra
|
|
31
|
+
],
|
|
32
|
+
example: `an object such as { slug: '${fallback}' }`
|
|
33
|
+
});
|
|
34
|
+
const overrides = overridesOf(shaped.overrides, `${path}.overrides`);
|
|
35
|
+
return {
|
|
36
|
+
slug: slugOf(shaped.slug, `${path}.slug`, fallback),
|
|
37
|
+
...overrides ? { overrides } : {}
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
/** The field a scoped plugin collection stamps each document's scope into, by default. */
|
|
41
|
+
const DEFAULT_SCOPE_FIELD = "scope";
|
|
42
|
+
const COLLECTION_ACCESS_KEYS = keysOf({
|
|
43
|
+
admin: true,
|
|
44
|
+
create: true,
|
|
45
|
+
delete: true,
|
|
46
|
+
read: true,
|
|
47
|
+
readVersions: true,
|
|
48
|
+
unlock: true,
|
|
49
|
+
update: true,
|
|
50
|
+
validate: true
|
|
51
|
+
});
|
|
52
|
+
/** `access` on one of the plugin's collections: a Payload access function per operation. */
|
|
53
|
+
const assertCollectionAccess = (value, path) => {
|
|
54
|
+
if (value === void 0) return;
|
|
55
|
+
const access = optionsObject(value, {
|
|
56
|
+
path,
|
|
57
|
+
known: COLLECTION_ACCESS_KEYS,
|
|
58
|
+
example: "an object such as { read }"
|
|
59
|
+
});
|
|
60
|
+
for (const [operation, fn] of Object.entries(access)) if (fn !== void 0 && typeof fn !== "function") throw new Error(`analytics: ${path}.${operation} must be an access function, got ${kindOf(fn)}`);
|
|
61
|
+
};
|
|
62
|
+
/** A collection's `fields` overrides: one function per field it may replace. */
|
|
63
|
+
const assertFieldOverrides = (value, path, known) => {
|
|
64
|
+
if (value === void 0) return;
|
|
65
|
+
const fields = optionsObject(value, {
|
|
66
|
+
path,
|
|
67
|
+
known,
|
|
68
|
+
example: "an object such as { name: ({ defaultField }) => defaultField }"
|
|
69
|
+
});
|
|
70
|
+
for (const [name, override] of Object.entries(fields)) if (override !== void 0 && typeof override !== "function") throw new Error(`analytics: ${path}.${name} must be a function receiving { defaultField }, got ${kindOf(override)}`);
|
|
71
|
+
};
|
|
72
|
+
/**
|
|
73
|
+
* A scoped collection option: off when unset or false, on under its defaults for `true`, and an
|
|
74
|
+
* object checked for its keys, `fields`, `access`, `overrides`, slug and scope field.
|
|
75
|
+
*/
|
|
76
|
+
const resolveScopedCollection = (option, at) => {
|
|
77
|
+
if (option === void 0 || typeof option === "boolean") return {
|
|
78
|
+
enabled: option === true,
|
|
79
|
+
slug: at.fallback,
|
|
80
|
+
scopeField: DEFAULT_SCOPE_FIELD
|
|
81
|
+
};
|
|
82
|
+
const shaped = optionsObject(option, {
|
|
83
|
+
path: at.path,
|
|
84
|
+
known: at.known,
|
|
85
|
+
example: `true, or an object such as { slug: '${at.exampleSlug}' }`
|
|
86
|
+
});
|
|
87
|
+
assertFieldOverrides(shaped.fields, `${at.path}.fields`, at.fieldKeys);
|
|
88
|
+
assertCollectionAccess(shaped.access, `${at.path}.access`);
|
|
89
|
+
const overrides = overridesOf(option.overrides, `${at.path}.overrides`);
|
|
90
|
+
return {
|
|
91
|
+
enabled: true,
|
|
92
|
+
slug: slugOf(option.slug, `${at.path}.slug`, at.fallback),
|
|
93
|
+
scopeField: flatFieldName(option.scopeField ?? DEFAULT_SCOPE_FIELD, {
|
|
94
|
+
path: `${at.path}.scopeField`,
|
|
95
|
+
reason: "the scope stamp writes it as a flat key"
|
|
96
|
+
}),
|
|
97
|
+
...option.fields ? { fields: option.fields } : {},
|
|
98
|
+
...overrides ? { overrides } : {},
|
|
99
|
+
...option.access ? { access: option.access } : {}
|
|
100
|
+
};
|
|
101
|
+
};
|
|
102
|
+
//#endregion
|
|
103
|
+
export { resolveCollectionOption, resolveScopedCollection };
|
|
104
|
+
|
|
105
|
+
//# sourceMappingURL=collectionOption.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collectionOption.js","names":[],"sources":["../../src/core/collectionOption.ts"],"sourcesContent":["import type { CollectionConfig } from 'payload'\nimport { flatFieldName, keysOf, optionsObject } from './optionChecks'\nimport { kindOf } from './values'\n\n/** Reshapes one of the plugin's generated collections; handed the finished config, it returns one. */\nexport type CollectionOverrides = (collection: CollectionConfig) => CollectionConfig\n\n/** A plugin collection's name and shape, as each option naming one takes them. */\nexport type AnalyticsCollectionOptions = {\n\t/** The slug every part of the plugin reads the collection under. */\n\tslug?: string\n\t/**\n\t * Reshapes the generated collection last. It may not rename it (`slug` does that) nor take away\n\t * what the plugin reads and writes: the boot checks both, naming the collection and the field.\n\t */\n\toverrides?: CollectionOverrides\n}\n\nexport interface ResolvedCollectionOption {\n\tslug: string\n\toverrides?: CollectionOverrides\n}\n\n/** Only that it is a function can be checked at run time; the option's type promises the rest. */\nconst isOverrides = (value: unknown): value is CollectionOverrides => typeof value === 'function'\n\n/** `overrides` checked at boot: a function or nothing, since no object is ever merged in. */\nexport const overridesOf = (value: unknown, path: string): CollectionOverrides | undefined => {\n\tif (value === undefined) {\n\t\treturn undefined\n\t}\n\tif (!isOverrides(value)) {\n\t\tthrow new Error(\n\t\t\t`analytics: ${path} must be a function, (collection) => collection, got ${kindOf(value)}`\n\t\t)\n\t}\n\treturn value\n}\n\n/** A collection slug option checked at boot, trimmed, or the default when unset. */\nexport const slugOf = (value: unknown, path: string, fallback: string): string => {\n\tif (value === undefined) {\n\t\treturn fallback\n\t}\n\tif (typeof value !== 'string' || value.trim() === '') {\n\t\tthrow new Error(`analytics: ${path} must be a non-empty collection slug, got ${kindOf(value)}`)\n\t}\n\treturn value.trim()\n}\n\n/**\n * One `{ slug, overrides }` option checked at boot. `path` names it in every refusal, and `extra`\n * lists the other keys the option takes beside those two.\n */\nexport const resolveCollectionOption = (\n\tvalue: unknown,\n\twhere: { path: string; fallback: string; extra?: readonly string[] }\n): ResolvedCollectionOption => {\n\tconst { path, fallback, extra = [] } = where\n\tif (value === undefined) {\n\t\treturn { slug: fallback }\n\t}\n\tconst shaped = optionsObject(value, {\n\t\tpath,\n\t\tknown: ['slug', 'overrides', ...extra],\n\t\texample: `an object such as { slug: '${fallback}' }`,\n\t})\n\tconst overrides = overridesOf(shaped.overrides, `${path}.overrides`)\n\treturn {\n\t\tslug: slugOf(shaped.slug, `${path}.slug`, fallback),\n\t\t...(overrides ? { overrides } : {}),\n\t}\n}\n\n/** The field a scoped plugin collection stamps each document's scope into, by default. */\nconst DEFAULT_SCOPE_FIELD = 'scope'\n\ntype CollectionAccess = Partial<CollectionConfig['access']>\n\nconst COLLECTION_ACCESS_KEYS = keysOf<NonNullable<CollectionConfig['access']>>({\n\tadmin: true,\n\tcreate: true,\n\tdelete: true,\n\tread: true,\n\treadVersions: true,\n\tunlock: true,\n\tupdate: true,\n\tvalidate: true,\n})\n\n/** `access` on one of the plugin's collections: a Payload access function per operation. */\nconst assertCollectionAccess = (value: unknown, path: string): void => {\n\tif (value === undefined) {\n\t\treturn\n\t}\n\tconst access = optionsObject(value, {\n\t\tpath,\n\t\tknown: COLLECTION_ACCESS_KEYS,\n\t\texample: 'an object such as { read }',\n\t})\n\tfor (const [operation, fn] of Object.entries(access)) {\n\t\tif (fn !== undefined && typeof fn !== 'function') {\n\t\t\tthrow new Error(\n\t\t\t\t`analytics: ${path}.${operation} must be an access function, got ${kindOf(fn)}`\n\t\t\t)\n\t\t}\n\t}\n}\n\n/** A collection's `fields` overrides: one function per field it may replace. */\nconst assertFieldOverrides = (value: unknown, path: string, known: readonly string[]): void => {\n\tif (value === undefined) {\n\t\treturn\n\t}\n\tconst fields = optionsObject(value, {\n\t\tpath,\n\t\tknown,\n\t\texample: 'an object such as { name: ({ defaultField }) => defaultField }',\n\t})\n\tfor (const [name, override] of Object.entries(fields)) {\n\t\tif (override !== undefined && typeof override !== 'function') {\n\t\t\tthrow new Error(\n\t\t\t\t`analytics: ${path}.${name} must be a function receiving { defaultField }, got ${kindOf(override)}`\n\t\t\t)\n\t\t}\n\t}\n}\n\n/** What an opt-in collection whose documents belong to a scope takes (goals, providers). */\ninterface ScopedCollectionOptions<TFields> {\n\tslug?: string\n\tscopeField?: string\n\tfields?: TFields\n\toverrides?: CollectionOverrides\n\taccess?: CollectionAccess\n}\n\n/** A scoped collection option resolved: on or off, its slug and scope field filled. */\nexport interface ResolvedScopedCollection<TFields> {\n\tenabled: boolean\n\tslug: string\n\tscopeField: string\n\tfields?: TFields\n\toverrides?: CollectionOverrides\n\taccess?: CollectionAccess\n}\n\n/** Where a scoped collection option sits, and what it takes. */\ninterface ScopedCollectionAt {\n\tpath: string\n\tfallback: string\n\t/** Every key the option takes. */\n\tknown: readonly string[]\n\t/** The fields its `fields` may replace. */\n\tfieldKeys: readonly string[]\n\t/** The custom slug a refusal shows as an example. */\n\texampleSlug: string\n}\n\n/**\n * A scoped collection option: off when unset or false, on under its defaults for `true`, and an\n * object checked for its keys, `fields`, `access`, `overrides`, slug and scope field.\n */\nexport const resolveScopedCollection = <TFields>(\n\toption: boolean | ScopedCollectionOptions<TFields> | undefined,\n\tat: ScopedCollectionAt\n): ResolvedScopedCollection<TFields> => {\n\tif (option === undefined || typeof option === 'boolean') {\n\t\treturn { enabled: option === true, slug: at.fallback, scopeField: DEFAULT_SCOPE_FIELD }\n\t}\n\tconst shaped = optionsObject(option, {\n\t\tpath: at.path,\n\t\tknown: at.known,\n\t\texample: `true, or an object such as { slug: '${at.exampleSlug}' }`,\n\t})\n\tassertFieldOverrides(shaped.fields, `${at.path}.fields`, at.fieldKeys)\n\tassertCollectionAccess(shaped.access, `${at.path}.access`)\n\tconst overrides = overridesOf(option.overrides, `${at.path}.overrides`)\n\treturn {\n\t\tenabled: true,\n\t\tslug: slugOf(option.slug, `${at.path}.slug`, at.fallback),\n\t\tscopeField: flatFieldName(option.scopeField ?? DEFAULT_SCOPE_FIELD, {\n\t\t\tpath: `${at.path}.scopeField`,\n\t\t\treason: 'the scope stamp writes it as a flat key',\n\t\t}),\n\t\t...(option.fields ? { fields: option.fields } : {}),\n\t\t...(overrides ? { overrides } : {}),\n\t\t...(option.access ? { access: option.access } : {}),\n\t}\n}\n"],"mappings":";;;;AAwBA,MAAM,eAAe,UAAiD,OAAO,UAAU;;AAGvF,MAAa,eAAe,OAAgB,SAAkD;CAC7F,IAAI,UAAU,KAAA,GACb;CAED,IAAI,CAAC,YAAY,KAAK,GACrB,MAAM,IAAI,MACT,cAAc,KAAK,uDAAuD,OAAO,KAAK,GACvF;CAED,OAAO;AACR;;AAGA,MAAa,UAAU,OAAgB,MAAc,aAA6B;CACjF,IAAI,UAAU,KAAA,GACb,OAAO;CAER,IAAI,OAAO,UAAU,YAAY,MAAM,KAAK,MAAM,IACjD,MAAM,IAAI,MAAM,cAAc,KAAK,4CAA4C,OAAO,KAAK,GAAG;CAE/F,OAAO,MAAM,KAAK;AACnB;;;;;AAMA,MAAa,2BACZ,OACA,UAC8B;CAC9B,MAAM,EAAE,MAAM,UAAU,QAAQ,CAAC,MAAM;CACvC,IAAI,UAAU,KAAA,GACb,OAAO,EAAE,MAAM,SAAS;CAEzB,MAAM,SAAS,cAAc,OAAO;EACnC;EACA,OAAO;GAAC;GAAQ;GAAa,GAAG;EAAK;EACrC,SAAS,8BAA8B,SAAS;CACjD,CAAC;CACD,MAAM,YAAY,YAAY,OAAO,WAAW,GAAG,KAAK,WAAW;CACnE,OAAO;EACN,MAAM,OAAO,OAAO,MAAM,GAAG,KAAK,QAAQ,QAAQ;EAClD,GAAI,YAAY,EAAE,UAAU,IAAI,CAAC;CAClC;AACD;;AAGA,MAAM,sBAAsB;AAI5B,MAAM,yBAAyB,OAAgD;CAC9E,OAAO;CACP,QAAQ;CACR,QAAQ;CACR,MAAM;CACN,cAAc;CACd,QAAQ;CACR,QAAQ;CACR,UAAU;AACX,CAAC;;AAGD,MAAM,0BAA0B,OAAgB,SAAuB;CACtE,IAAI,UAAU,KAAA,GACb;CAED,MAAM,SAAS,cAAc,OAAO;EACnC;EACA,OAAO;EACP,SAAS;CACV,CAAC;CACD,KAAK,MAAM,CAAC,WAAW,OAAO,OAAO,QAAQ,MAAM,GAClD,IAAI,OAAO,KAAA,KAAa,OAAO,OAAO,YACrC,MAAM,IAAI,MACT,cAAc,KAAK,GAAG,UAAU,mCAAmC,OAAO,EAAE,GAC7E;AAGH;;AAGA,MAAM,wBAAwB,OAAgB,MAAc,UAAmC;CAC9F,IAAI,UAAU,KAAA,GACb;CAED,MAAM,SAAS,cAAc,OAAO;EACnC;EACA;EACA,SAAS;CACV,CAAC;CACD,KAAK,MAAM,CAAC,MAAM,aAAa,OAAO,QAAQ,MAAM,GACnD,IAAI,aAAa,KAAA,KAAa,OAAO,aAAa,YACjD,MAAM,IAAI,MACT,cAAc,KAAK,GAAG,KAAK,sDAAsD,OAAO,QAAQ,GACjG;AAGH;;;;;AAqCA,MAAa,2BACZ,QACA,OACuC;CACvC,IAAI,WAAW,KAAA,KAAa,OAAO,WAAW,WAC7C,OAAO;EAAE,SAAS,WAAW;EAAM,MAAM,GAAG;EAAU,YAAY;CAAoB;CAEvF,MAAM,SAAS,cAAc,QAAQ;EACpC,MAAM,GAAG;EACT,OAAO,GAAG;EACV,SAAS,uCAAuC,GAAG,YAAY;CAChE,CAAC;CACD,qBAAqB,OAAO,QAAQ,GAAG,GAAG,KAAK,UAAU,GAAG,SAAS;CACrE,uBAAuB,OAAO,QAAQ,GAAG,GAAG,KAAK,QAAQ;CACzD,MAAM,YAAY,YAAY,OAAO,WAAW,GAAG,GAAG,KAAK,WAAW;CACtE,OAAO;EACN,SAAS;EACT,MAAM,OAAO,OAAO,MAAM,GAAG,GAAG,KAAK,QAAQ,GAAG,QAAQ;EACxD,YAAY,cAAc,OAAO,cAAc,qBAAqB;GACnE,MAAM,GAAG,GAAG,KAAK;GACjB,QAAQ;EACT,CAAC;EACD,GAAI,OAAO,SAAS,EAAE,QAAQ,OAAO,OAAO,IAAI,CAAC;EACjD,GAAI,YAAY,EAAE,UAAU,IAAI,CAAC;EACjC,GAAI,OAAO,SAAS,EAAE,QAAQ,OAAO,OAAO,IAAI,CAAC;CAClD;AACD"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
//#region src/core/collectionSlug.ts
|
|
2
|
+
/** Whether the instance registered a collection under `slug`. */
|
|
3
|
+
const isCollectionSlug = (payload, slug) => Object.hasOwn(payload.collections, slug);
|
|
4
|
+
//#endregion
|
|
5
|
+
export { isCollectionSlug };
|
|
6
|
+
|
|
7
|
+
//# sourceMappingURL=collectionSlug.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collectionSlug.js","names":[],"sources":["../../src/core/collectionSlug.ts"],"sourcesContent":["import type { CollectionSlug, Payload } from 'payload'\n\n/** Whether the instance registered a collection under `slug`. */\nexport const isCollectionSlug = (payload: Payload, slug: string): slug is CollectionSlug =>\n\tObject.hasOwn(payload.collections, slug)\n"],"mappings":";;AAGA,MAAa,oBAAoB,SAAkB,SAClD,OAAO,OAAO,QAAQ,aAAa,IAAI"}
|
package/dist/core/contract.d.ts
CHANGED
|
@@ -1,24 +1,37 @@
|
|
|
1
|
+
import { CurrencyConverter } from "../goals/currency.js";
|
|
1
2
|
import { Goal } from "../goals/types.js";
|
|
3
|
+
import { BrowserAmounts, OrderSignatureMode } from "../goals/match.js";
|
|
4
|
+
import { TrustedPlatform } from "../net/platform.js";
|
|
5
|
+
import { RoutePaths } from "../plugin/routes.js";
|
|
2
6
|
import { CaptureSupport } from "./capture.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
7
|
+
import { AdapterJobs, AnalyticsTaskName, ScheduledTask } from "./jobs.js";
|
|
8
|
+
import { AnalyticsSdks } from "./sdks.js";
|
|
9
|
+
import { IngestHostnameResolver, ServerTrack } from "./serverEvent.js";
|
|
10
|
+
import { Config, Payload, PayloadRequest } from "payload";
|
|
5
11
|
|
|
6
12
|
//#region src/core/contract.d.ts
|
|
7
13
|
/**
|
|
8
14
|
* Explicit cross-scope read marker: pass as a read's `scope` to aggregate over every
|
|
9
|
-
* scope. Gated by `access.
|
|
15
|
+
* scope. Gated by `access.crossScope.aggregate`; the query reaches the adapter unscoped.
|
|
10
16
|
*/
|
|
11
17
|
declare const PLATFORM_SCOPE = "*";
|
|
12
|
-
type MetricKey = 'pageviews' | 'visitors' | 'visits' | 'sessions' | 'bounceRate' | 'avgDuration' | 'scrollDepth' | 'events' | 'conversions' | 'revenue';
|
|
13
|
-
/**
|
|
14
|
-
|
|
18
|
+
type MetricKey = 'pageviews' | 'visitors' | 'visits' | 'sessions' | 'bounceRate' /** Time on page: engaged time per pageview, an average in milliseconds over the pageviews it is read for. */ | 'avgDuration' /** Time per visit: engaged time per visit, an average in milliseconds over the visits it is read for. */ | 'visitDuration' | 'scrollDepth' | 'events' | 'conversions' | 'revenue' /** Times a content item was seen on screen. Counted per item only, never per page or site. */ | 'impressions' /** Clicks on a content item, the first per item and pageview. */ | 'interactions';
|
|
19
|
+
/**
|
|
20
|
+
* One metric's reading. `null` is an average or a share with nothing to average over (no
|
|
21
|
+
* pageviews to time, no scroll reported, no sessions to bounce): no data, not zero.
|
|
22
|
+
*/
|
|
23
|
+
type MetricValue = number | null;
|
|
24
|
+
/** A row's or a read's metrics. A metric the source did not report is absent. */
|
|
25
|
+
type MetricValues = Partial<Record<MetricKey, MetricValue>>;
|
|
26
|
+
/** Every breakdown key the contract defines, the list request parsers validate against. */
|
|
27
|
+
declare const DIMENSION_KEYS: readonly ["page", "referrer", "source", "channel", "medium", "campaign", "utmSource", "utmMedium", "utmCampaign", "utmContent", "utmTerm", "device", "browser", "os", "country", "region", "city", "language", "event", "goal", "currency", "item"];
|
|
15
28
|
type DimensionKey = (typeof DIMENSION_KEYS)[number];
|
|
16
29
|
type Granularity = 'minute' | 'hour' | 'day' | 'week' | 'month';
|
|
17
30
|
interface DateRange {
|
|
18
31
|
start: Date;
|
|
19
32
|
end: Date;
|
|
20
33
|
}
|
|
21
|
-
/** Every filter operator the contract defines
|
|
34
|
+
/** Every filter operator the contract defines, the list request parsers validate against. */
|
|
22
35
|
declare const FILTER_OPERATORS: readonly ["eq", "contains", "matches"];
|
|
23
36
|
type FilterOperator = (typeof FILTER_OPERATORS)[number];
|
|
24
37
|
interface AnalyticsFilter {
|
|
@@ -29,86 +42,195 @@ interface AnalyticsFilter {
|
|
|
29
42
|
interface AnalyticsQuery {
|
|
30
43
|
path?: string;
|
|
31
44
|
hostname?: string;
|
|
45
|
+
/**
|
|
46
|
+
* One content item's ref (`<collection>:<id>`): the read answers about that item, wherever
|
|
47
|
+
* it was shown. Only a source declaring `capabilities.perItemQuery` can serve it.
|
|
48
|
+
*/
|
|
49
|
+
item?: string;
|
|
32
50
|
metrics: MetricKey[];
|
|
33
51
|
dimensions?: DimensionKey[];
|
|
34
52
|
dateRange: DateRange;
|
|
35
53
|
granularity?: Granularity;
|
|
36
54
|
filters?: AnalyticsFilter[];
|
|
37
55
|
limit?: number;
|
|
56
|
+
/**
|
|
57
|
+
* How a breakdown is ranked before `limit` cuts it. The metric belongs in `metrics`: ranked by
|
|
58
|
+
* one the read did not ask for, rows keep the source's order.
|
|
59
|
+
*/
|
|
38
60
|
order?: {
|
|
39
61
|
metric: MetricKey;
|
|
40
62
|
direction: 'asc' | 'desc';
|
|
41
63
|
};
|
|
42
64
|
/**
|
|
43
|
-
* Analytics boundary
|
|
44
|
-
*
|
|
45
|
-
* ignore it. Always part of the surfacing cache key, so per-scope adapter
|
|
46
|
-
* instances sharing an id never share cached results.
|
|
65
|
+
* Analytics boundary of the read (tenant id, site key); undefined means install-wide. Adapters
|
|
66
|
+
* that can filter by scope apply it, and it is always part of the cache key.
|
|
47
67
|
*/
|
|
48
68
|
scope?: string;
|
|
49
69
|
/**
|
|
50
|
-
* IANA
|
|
51
|
-
*
|
|
52
|
-
* others report in their own account timezone. Part of the cache key when set.
|
|
70
|
+
* IANA timezone the read's day boundaries align to; undefined means UTC. Adapters that can bucket
|
|
71
|
+
* in a zone apply it, others report in their account's own.
|
|
53
72
|
*/
|
|
54
73
|
timezone?: string;
|
|
55
74
|
/**
|
|
56
|
-
* The scope's goal slugs,
|
|
57
|
-
* `
|
|
58
|
-
* adapters restrict goal rows to it, since nothing in a provider marks which of its
|
|
59
|
-
* events are this install's goals; the native engine ignores it and matches completions
|
|
60
|
-
* itself. `'unresolved'` is the sentinel for a goal resolver that failed: the read keeps
|
|
61
|
-
* its site numbers, reports `goalsUnresolved`, and never shares a healthy cache key.
|
|
62
|
-
* Part of the surfacing cache key when set.
|
|
75
|
+
* The scope's goal slugs, which provider adapters restrict goal rows to (native matches goals
|
|
76
|
+
* itself). `'unresolved'` marks a failed goal resolver and never shares a healthy cache key.
|
|
63
77
|
*/
|
|
64
78
|
goalSlugs?: string[] | 'unresolved';
|
|
65
79
|
}
|
|
66
80
|
interface AnalyticsRow {
|
|
67
81
|
dimensions?: Partial<Record<DimensionKey, string>>;
|
|
68
|
-
metrics:
|
|
82
|
+
metrics: MetricValues;
|
|
69
83
|
timestamp?: string;
|
|
84
|
+
/**
|
|
85
|
+
* How many observations each average in `metrics` was taken over, which folds days into weeks
|
|
86
|
+
* exactly. An average without one is weighted by its row's matching count.
|
|
87
|
+
*/
|
|
88
|
+
samples?: Partial<Record<MetricKey, number>>;
|
|
70
89
|
}
|
|
90
|
+
/** How a read's `visitors` were counted. */
|
|
91
|
+
type VisitorCounting = 'distinct' | 'sumOfDaily';
|
|
92
|
+
/** Why a stale answer's source needs a look: its settings were refused, or its host is not allowed. */
|
|
93
|
+
type SourceErrorKind = 'misconfigured' | 'host-refused';
|
|
71
94
|
interface AnalyticsResult {
|
|
72
95
|
rows: AnalyticsRow[];
|
|
73
|
-
totals?:
|
|
96
|
+
totals?: MetricValues;
|
|
74
97
|
meta: {
|
|
75
|
-
provider: string;
|
|
76
|
-
sampled?: boolean;
|
|
77
|
-
clamped?: boolean;
|
|
78
|
-
|
|
98
|
+
provider: string; /** The source counted from a sample of its data (GA4 on a large property), so the numbers are estimates. */
|
|
99
|
+
sampled?: boolean; /** The read covers less than it asked for: from `dataFrom` and up to `dataTo`, where set. */
|
|
100
|
+
clamped?: boolean; /** ISO instant the data starts at, set with `clamped` when later than the range's start. */
|
|
101
|
+
dataFrom?: string;
|
|
102
|
+
/**
|
|
103
|
+
* ISO instant the data ends at, set with `clamped` when earlier than the range's end: a day
|
|
104
|
+
* the range cuts lies past raw retention in a scope's own zone.
|
|
105
|
+
*/
|
|
106
|
+
dataTo?: string;
|
|
107
|
+
/**
|
|
108
|
+
* `distinct` counts each person once per number; `sumOfDaily` means some number adds up daily
|
|
109
|
+
* visitors, so a person who came on two days counts twice.
|
|
110
|
+
*/
|
|
111
|
+
visitorsAre?: VisitorCounting; /** Some days of the range could not be read yet, so the numbers are a floor. */
|
|
112
|
+
partial?: {
|
|
113
|
+
missingDays: number;
|
|
114
|
+
};
|
|
115
|
+
/**
|
|
116
|
+
* On this many days of the range a value the read asks about was folded into the `(other)`
|
|
117
|
+
* row of its daily totals, and its raw hits are no longer kept: the numbers are a floor.
|
|
118
|
+
*/
|
|
119
|
+
capped?: {
|
|
120
|
+
days: number;
|
|
121
|
+
};
|
|
122
|
+
/**
|
|
123
|
+
* On this many days of the range counting failed again and again and was given up: each is
|
|
124
|
+
* read from an earlier count when it had one, and left out otherwise.
|
|
125
|
+
*/
|
|
126
|
+
failed?: {
|
|
127
|
+
days: number;
|
|
128
|
+
};
|
|
129
|
+
/**
|
|
130
|
+
* The scope's reporting timezone could not be resolved and none was ever recorded, so this
|
|
131
|
+
* read cut its days in UTC and counted nothing for later reads.
|
|
132
|
+
*/
|
|
133
|
+
timezoneUnresolved?: true; /** ISO instant the numbers were last brought up to date, when older than `fetchedAt`. */
|
|
134
|
+
asOf?: string;
|
|
135
|
+
/**
|
|
136
|
+
* ISO instant the source was read (`ctx.now`), never later than the engine got the answer; a
|
|
137
|
+
* cached answer keeps it.
|
|
138
|
+
*/
|
|
139
|
+
fetchedAt: string;
|
|
140
|
+
/**
|
|
141
|
+
* ISO 4217 code `revenue` is reported in: the vendor's own, else the install's
|
|
142
|
+
* `revenue.currency` or the read's `currency` filter. Absent, revenue is a plain sum as sent.
|
|
143
|
+
*/
|
|
144
|
+
currency?: string;
|
|
145
|
+
/**
|
|
146
|
+
* The currencies the read's revenue adds unconverted amounts of, when more than one. Native
|
|
147
|
+
* sets it.
|
|
148
|
+
*/
|
|
149
|
+
mixedCurrencies?: string[];
|
|
150
|
+
/**
|
|
151
|
+
* Served from a cache entry past its TTL: at once while a refresh runs, or because the refresh
|
|
152
|
+
* failed. `asOf` then says when the entry was fetched.
|
|
153
|
+
*/
|
|
79
154
|
stale?: boolean;
|
|
155
|
+
/**
|
|
156
|
+
* Set on a stale answer whose source last failed as set up rather than as an outage:
|
|
157
|
+
* credentials refused (`misconfigured`) or host not allowed (`host-refused`).
|
|
158
|
+
*/
|
|
159
|
+
sourceError?: SourceErrorKind;
|
|
80
160
|
/**
|
|
81
161
|
* Filters the source could not carry, so the rows are wider than the query asked for.
|
|
82
162
|
* A provider whose API takes one value per dimension reports the ones it dropped here.
|
|
83
163
|
*/
|
|
84
164
|
unappliedFilters?: AnalyticsFilter[];
|
|
85
165
|
/**
|
|
86
|
-
* The read's goal numbers are absent because resolving them failed
|
|
87
|
-
*
|
|
88
|
-
* request and the rest of the read was served without it. A scope that configured no
|
|
89
|
-
* goals is an empty result instead, not this flag.
|
|
166
|
+
* The read's goal numbers are absent because resolving them failed. A scope with no goals gets
|
|
167
|
+
* an empty result instead, not this flag.
|
|
90
168
|
*/
|
|
91
169
|
goalsUnresolved?: true;
|
|
170
|
+
/**
|
|
171
|
+
* Pageviews of the read counted without consent, at a cookieless or anonymous level, which
|
|
172
|
+
* the view shows as a share of all pageviews. Absent when the source cannot tell or found none.
|
|
173
|
+
*/
|
|
174
|
+
withoutConsent?: {
|
|
175
|
+
pageviews: number;
|
|
176
|
+
};
|
|
177
|
+
/**
|
|
178
|
+
* Pageviews of the read recorded without a visitor (native's anonymous level): they count as
|
|
179
|
+
* pageviews, and toward no visitor, visit, bounce rate or time.
|
|
180
|
+
*/
|
|
181
|
+
withoutVisitor?: {
|
|
182
|
+
pageviews: number;
|
|
183
|
+
};
|
|
184
|
+
/**
|
|
185
|
+
* The vendor drops what a slot counts without consent, so those visits are missing from every
|
|
186
|
+
* number: PostHog with its project's cookieless tracking setting off.
|
|
187
|
+
*/
|
|
188
|
+
withoutConsentDropped?: true;
|
|
92
189
|
};
|
|
93
190
|
}
|
|
94
191
|
/**
|
|
95
|
-
*
|
|
96
|
-
*
|
|
192
|
+
* The vendor's limits the source's lane keeps to, one token per upstream request per window. A read
|
|
193
|
+
* with conversions may cost a second, goal-filtered request.
|
|
97
194
|
*/
|
|
98
195
|
interface RateLimitDescriptor {
|
|
99
196
|
requestsPerMinute?: number;
|
|
100
197
|
requestsPerHour?: number;
|
|
198
|
+
/** Upstream requests the source may have in flight; `cache.concurrency.perSource` when unset. */
|
|
101
199
|
maxConcurrent?: number;
|
|
200
|
+
/** Whether reads also spend the provider's write or ingest quota. */
|
|
201
|
+
readsCountAsUsage?: boolean;
|
|
202
|
+
}
|
|
203
|
+
/**
|
|
204
|
+
* Which operators each dimension can be filtered with. A dimension absent here, or listed with
|
|
205
|
+
* no operator, cannot be filtered at all.
|
|
206
|
+
*/
|
|
207
|
+
type FilterOperatorMap = Partial<Record<DimensionKey, readonly FilterOperator[]>>;
|
|
208
|
+
/** Where a source reads one metric, when it cannot read it under every breakdown it offers. */
|
|
209
|
+
interface MetricReach {
|
|
102
210
|
/**
|
|
103
|
-
*
|
|
104
|
-
*
|
|
211
|
+
* The breakdowns the metric is read under; empty when only whole-site numbers carry it.
|
|
212
|
+
* Absent: every dimension the source declares.
|
|
105
213
|
*/
|
|
106
|
-
|
|
107
|
-
/**
|
|
108
|
-
|
|
214
|
+
dimensions?: readonly DimensionKey[];
|
|
215
|
+
/**
|
|
216
|
+
* A dimension the read must break down or filter by for the metric to have a value at all.
|
|
217
|
+
* A read of one page (`AnalyticsQuery.path`) counts as filtering by `page`.
|
|
218
|
+
*/
|
|
219
|
+
requires?: DimensionKey;
|
|
220
|
+
}
|
|
221
|
+
/** What the numbers of a source mean where sources differ. */
|
|
222
|
+
interface MetricSemantics {
|
|
223
|
+
/**
|
|
224
|
+
* `distinct` counts each person once over a range; `sumOfDaily` adds up each day's visitors.
|
|
225
|
+
* Either may be per hostname: native's visitor id is, so two hostnames add up.
|
|
226
|
+
*/
|
|
227
|
+
visitors: VisitorCounting;
|
|
228
|
+
/** `inactivity30m` ends a visit after 30 minutes without activity; `provider` is the vendor's own rule. */
|
|
229
|
+
sessions: 'inactivity30m' | 'provider';
|
|
109
230
|
}
|
|
110
231
|
interface AnalyticsCapabilities {
|
|
111
|
-
|
|
232
|
+
/** The source answers `AnalyticsQuery.item`: one content item's views, clicks and outcomes. */
|
|
233
|
+
perItemQuery?: boolean;
|
|
112
234
|
realtime: boolean;
|
|
113
235
|
realtimeWindowMinutes?: number;
|
|
114
236
|
/**
|
|
@@ -117,70 +239,209 @@ interface AnalyticsCapabilities {
|
|
|
117
239
|
*/
|
|
118
240
|
comparison?: boolean;
|
|
119
241
|
minGranularity: Granularity;
|
|
242
|
+
/**
|
|
243
|
+
* The source answers `week` and `month` series itself, exactly. Without it the engine reads
|
|
244
|
+
* days and folds them into weeks and months in the read's reporting timezone.
|
|
245
|
+
*/
|
|
246
|
+
calendarBuckets?: boolean;
|
|
120
247
|
maxLookbackDays: number | null;
|
|
248
|
+
/**
|
|
249
|
+
* How far back a filtered read reaches, when that is shorter than `maxLookbackDays`: the
|
|
250
|
+
* source narrows a longer one itself and marks it `clamped`. Absent or null: as far as any read.
|
|
251
|
+
*/
|
|
252
|
+
filterLookbackDays?: number | null;
|
|
121
253
|
metrics: ReadonlySet<MetricKey>;
|
|
122
254
|
dimensions: ReadonlySet<DimensionKey>;
|
|
123
|
-
/**
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
255
|
+
/**
|
|
256
|
+
* Metrics the source reads only under some breakdowns or only for a page; any other is read under
|
|
257
|
+
* every dimension. Reads outside a metric's reach are refused and hidden by pickers.
|
|
258
|
+
*/
|
|
259
|
+
metricReach?: Partial<Record<MetricKey, MetricReach>>;
|
|
260
|
+
/**
|
|
261
|
+
* The `AnalyticsQuery.filters` the source applies, per dimension. A read carrying any other
|
|
262
|
+
* pair is refused before it reaches the adapter. Absent: no filter at all.
|
|
263
|
+
*/
|
|
264
|
+
filters?: FilterOperatorMap;
|
|
265
|
+
/** What `visitors` and `sessions` mean here. Absent: not declared. */
|
|
266
|
+
semantics?: MetricSemantics;
|
|
128
267
|
rateLimit: RateLimitDescriptor | null;
|
|
268
|
+
/**
|
|
269
|
+
* Seconds an answer stays fresh. `today`, for a source cheap to read again, caps a window that
|
|
270
|
+
* reaches into the current day whatever `cache.ttl` says; such an answer is never served stale.
|
|
271
|
+
*/
|
|
129
272
|
recommendedTtl: {
|
|
130
273
|
realtime: number;
|
|
131
274
|
aggregate: number;
|
|
275
|
+
today?: number;
|
|
132
276
|
};
|
|
133
277
|
/**
|
|
134
|
-
* The adapter applies `AnalyticsQuery.scope` as a
|
|
135
|
-
*
|
|
136
|
-
* a shared platform adapter would expose cross-scope data, so such reads are
|
|
137
|
-
* gated by `access.platformRead`.
|
|
278
|
+
* The adapter applies `AnalyticsQuery.scope` as a native filter. Without it a scoped read through
|
|
279
|
+
* a shared adapter would see other scopes, so it is gated by `access.crossScope.unscopedSource`.
|
|
138
280
|
*/
|
|
139
281
|
scopedQueries?: boolean;
|
|
282
|
+
/**
|
|
283
|
+
* The adapter sends every vendor request through `AdapterContext.upstream`, so each one spends
|
|
284
|
+
* its own rate token and slot. Without it the engine counts a whole read as one request.
|
|
285
|
+
*/
|
|
286
|
+
upstreamAware?: boolean;
|
|
140
287
|
}
|
|
141
288
|
interface AdapterContext {
|
|
142
289
|
signal?: AbortSignal;
|
|
290
|
+
/**
|
|
291
|
+
* The Payload instance the read is for, which the surfacing engine always passes. An adapter
|
|
292
|
+
* that stores its data in Payload's database reads through it.
|
|
293
|
+
*/
|
|
294
|
+
payload?: Payload;
|
|
295
|
+
/**
|
|
296
|
+
* Sends one vendor request through the source's lane: rate token, slot, retries on outage,
|
|
297
|
+
* circuit breaker. Absent outside the engine, where `fn(ctx.signal)` is called directly.
|
|
298
|
+
*/
|
|
299
|
+
upstream?: <T>(fn: (signal?: AbortSignal) => Promise<T>) => Promise<T>;
|
|
300
|
+
/**
|
|
301
|
+
* Milliseconds the read has left before it gives up, for a vendor SDK that takes a deadline of
|
|
302
|
+
* its own rather than a signal. Absent outside the engine.
|
|
303
|
+
*/
|
|
304
|
+
remainingMs?: () => number;
|
|
305
|
+
/**
|
|
306
|
+
* What time it is by the plugin's clock (Payload's), which an adapter stamps `meta.fetchedAt`
|
|
307
|
+
* with. The engine always passes it; absent outside the engine.
|
|
308
|
+
*/
|
|
309
|
+
now?: () => Date;
|
|
143
310
|
}
|
|
144
311
|
/** Extra context the plugin hands adapters when they register config surface. */
|
|
145
312
|
interface AdapterRegisterContext {
|
|
146
|
-
/** True when the plugin has
|
|
313
|
+
/** True when the plugin has `scope.resolve` configured. */
|
|
147
314
|
scoped: boolean;
|
|
148
|
-
/**
|
|
315
|
+
/**
|
|
316
|
+
* `scope.resolve` at the `capture` call site, for ingest stamping: the host's resolver sees no
|
|
317
|
+
* user, cookies or authorization header, so a hit files under the site it landed on.
|
|
318
|
+
*/
|
|
149
319
|
resolveScope: (req: PayloadRequest) => Promise<string | null>;
|
|
150
320
|
/**
|
|
151
|
-
* The plugin's reportingTimezone bound for adapter use
|
|
152
|
-
*
|
|
321
|
+
* The plugin's reportingTimezone bound for adapter use, for what is shown in it. Resolves to
|
|
322
|
+
* `'UTC'` when no reportingTimezone is set, and when the host's resolver fails.
|
|
153
323
|
*/
|
|
154
324
|
resolveTimezone: (req: PayloadRequest, scope?: string | null) => Promise<string>;
|
|
155
325
|
/**
|
|
156
|
-
* The
|
|
157
|
-
*
|
|
158
|
-
|
|
326
|
+
* The same timezone, thrown rather than falling back to UTC: for an adapter storing days counted
|
|
327
|
+
* in it, where recounting a day in UTC would move its numbers.
|
|
328
|
+
*/
|
|
329
|
+
resolveTimezoneStrict: (req: PayloadRequest, scope?: string | null) => Promise<string>;
|
|
330
|
+
/** The install's `revenue` settings, for adapters that declare or reconcile revenue. */
|
|
331
|
+
revenue: {
|
|
332
|
+
enabled: boolean;
|
|
333
|
+
dimension: boolean; /** `revenue.currency` bound for adapter use: `undefined` when none is set, revenue a plain number. */
|
|
334
|
+
currency: (req: PayloadRequest, scope?: string | null) => Promise<string | undefined>; /** `revenue.convert`, for adapters that reconcile revenue at ingest. */
|
|
335
|
+
convert?: CurrencyConverter; /** `revenue.browserAmounts`, for an adapter that takes amounts from the browser itself. */
|
|
336
|
+
browserAmounts?: BrowserAmounts; /** `revenue.orderSignature`, for an adapter that takes the browser's order ids. */
|
|
337
|
+
orderSignature?: OrderSignatureMode;
|
|
338
|
+
};
|
|
339
|
+
/**
|
|
340
|
+
* The install's goals for a request's scope (config goals, the collection's merged over them),
|
|
341
|
+
* for adapters that match completions themselves.
|
|
159
342
|
*/
|
|
160
343
|
resolveGoals: (req: PayloadRequest, scope?: string | null) => Promise<Goal[]>;
|
|
344
|
+
/**
|
|
345
|
+
* Whether a scope's own provider documents grant it this adapter; present only when the providers
|
|
346
|
+
* collection runs under `scope.resolve`. Native ingest stores nothing for a scope it denies.
|
|
347
|
+
*/
|
|
348
|
+
adapterGrantedForScope?: (req: PayloadRequest, scope: string | null, adapterId: string) => Promise<boolean>;
|
|
349
|
+
/** The plugin's `trustedProxyHops`, for adapters that read a request's client address. */
|
|
350
|
+
trustedProxyHops?: number;
|
|
351
|
+
/**
|
|
352
|
+
* The plugin's `trustedPlatform`, for adapters that read a request's client address or
|
|
353
|
+
* location: the only platform whose edge headers may be believed.
|
|
354
|
+
*/
|
|
355
|
+
trustedPlatform?: TrustedPlatform;
|
|
356
|
+
/**
|
|
357
|
+
* `capture.allowedOrigins`, normalized, for adapters that register a public POST endpoint: the
|
|
358
|
+
* only other sites whose pages may send to it from a visitor's browser.
|
|
359
|
+
*/
|
|
360
|
+
allowedOrigins?: ReadonlySet<string>;
|
|
361
|
+
/**
|
|
362
|
+
* False when this adapter fills no slot `capture.gate` holds that can count without consent, as
|
|
363
|
+
* far as the boot can tell, so it need not check its vendor accepts such events. Absent reads as
|
|
364
|
+
* true.
|
|
365
|
+
*/
|
|
366
|
+
adapterCountsWithoutConsent?: boolean;
|
|
367
|
+
/**
|
|
368
|
+
* The collections bound as content items, the only ones whose refs ingest keeps, and whether
|
|
369
|
+
* an item is also counted per page it appeared on. Absent means no item is bound.
|
|
370
|
+
*/
|
|
371
|
+
items?: {
|
|
372
|
+
collections: ReadonlySet<string>;
|
|
373
|
+
pages: boolean;
|
|
374
|
+
};
|
|
375
|
+
/** The plugin's mounts under `routes.api`, for adapters that register an endpoint of their own. */
|
|
376
|
+
routes?: RoutePaths;
|
|
377
|
+
/**
|
|
378
|
+
* The packages the host handed the plugin as `sdks`, for adapters that would otherwise load
|
|
379
|
+
* them at runtime: GA4's Data API client, the native engine's MaxMind reader.
|
|
380
|
+
*/
|
|
381
|
+
sdks?: AnalyticsSdks;
|
|
382
|
+
/**
|
|
383
|
+
* The plugin's `jobs`: the queue and schedule of the maintenance task an adapter registers, or
|
|
384
|
+
* false when the install registers no task and the adapter's own requests do that work instead.
|
|
385
|
+
*/
|
|
386
|
+
jobs?: AdapterJobs;
|
|
387
|
+
/** Says something at init, once the instance can log: what the boot warns about rather than refuses. */
|
|
388
|
+
notice?: (message: string) => void;
|
|
389
|
+
}
|
|
390
|
+
/** What a switched-off install hands an adapter that keeps its schema (`disabled: true`). */
|
|
391
|
+
interface AdapterSchemaContext {
|
|
392
|
+
/** The plugin's `jobs`, which decides whether the adapter's task slug is in the jobs enum. */
|
|
393
|
+
jobs: AdapterJobs;
|
|
394
|
+
/** What the boot would warn about, which a switched-off install never says. */
|
|
395
|
+
notice?: (message: string) => void;
|
|
396
|
+
}
|
|
397
|
+
/** Whom a source's label is read for: the request, and the scope its sources were listed for. */
|
|
398
|
+
interface AdapterLabelArgs {
|
|
399
|
+
req: PayloadRequest;
|
|
400
|
+
/** Null is install-wide, `*` is cross-scope. */
|
|
401
|
+
scope: string | null;
|
|
161
402
|
}
|
|
162
403
|
interface AnalyticsAdapter {
|
|
163
404
|
readonly id: string;
|
|
405
|
+
/** The source's name wherever no reader is known (boot-time pickers, logs). */
|
|
164
406
|
readonly label: string;
|
|
407
|
+
/**
|
|
408
|
+
* The source's name for one reader, where it differs by language or by who reads. Read through
|
|
409
|
+
* `sourceLabelFor`, which falls back to `label` when this fails.
|
|
410
|
+
*/
|
|
411
|
+
readonly labelFor?: (args: AdapterLabelArgs) => string | Promise<string>;
|
|
165
412
|
readonly capabilities: AnalyticsCapabilities;
|
|
166
413
|
/** Browser-tracker proxying/boot descriptor. Absent when no public capture field is set. */
|
|
167
414
|
readonly capture?: CaptureSupport;
|
|
168
415
|
/**
|
|
169
|
-
* Where
|
|
170
|
-
*
|
|
171
|
-
* pipeline without an HTTP round trip. Server-side only: the tracker learns the path
|
|
172
|
-
* from `TrackerConfig.ingestPath`, and this object is never serialized.
|
|
416
|
+
* Where the adapter's own ingest endpoint listens, relative to `routes.api`, and how server code
|
|
417
|
+
* reaches that pipeline directly. Server-side only, never serialized.
|
|
173
418
|
*/
|
|
174
419
|
readonly ingest?: {
|
|
175
420
|
path: string;
|
|
176
421
|
track?: ServerTrack;
|
|
422
|
+
hostname?: IngestHostnameResolver;
|
|
177
423
|
};
|
|
178
424
|
isConfigured(): boolean;
|
|
179
425
|
query(query: AnalyticsQuery, ctx: AdapterContext): Promise<AnalyticsResult>;
|
|
180
426
|
realtime?(query: AnalyticsQuery, ctx: AdapterContext): Promise<AnalyticsResult>;
|
|
181
427
|
register?(config: Config, context?: AdapterRegisterContext): void;
|
|
428
|
+
/**
|
|
429
|
+
* For `disabled: true`: adds exactly the schema `register` would (collections, fields, indexes,
|
|
430
|
+
* task slugs) and nothing that runs, so a switched-off install keeps its tables.
|
|
431
|
+
*/
|
|
432
|
+
registerSchema?(config: Config, context: AdapterSchemaContext): void;
|
|
433
|
+
/**
|
|
434
|
+
* Binds the adapter to the Payload instance a runtime is built for, whenever one is, with or
|
|
435
|
+
* without `onInit`. Called again for every rebuild, so it must be idempotent per instance.
|
|
436
|
+
*/
|
|
437
|
+
attach?(payload: Payload): void;
|
|
438
|
+
/**
|
|
439
|
+
* Releases what the adapter holds for one instance (buffers, clients, timers) once that
|
|
440
|
+
* instance's runtime is retired; another instance the adapter serves keeps what it holds.
|
|
441
|
+
*/
|
|
442
|
+
close?(payload: Payload): void | Promise<void>;
|
|
182
443
|
}
|
|
183
444
|
type AnalyticsAdapterFactory<Config> = (config: Config) => AnalyticsAdapter;
|
|
184
445
|
//#endregion
|
|
185
|
-
export { AdapterContext, AdapterRegisterContext, AnalyticsAdapter, AnalyticsAdapterFactory, AnalyticsCapabilities, AnalyticsFilter, AnalyticsQuery, AnalyticsResult, AnalyticsRow, DIMENSION_KEYS, DateRange, DimensionKey, FILTER_OPERATORS, FilterOperator, Granularity, MetricKey, PLATFORM_SCOPE, RateLimitDescriptor };
|
|
446
|
+
export { AdapterContext, AdapterLabelArgs, AdapterRegisterContext, AdapterSchemaContext, AnalyticsAdapter, AnalyticsAdapterFactory, AnalyticsCapabilities, AnalyticsFilter, AnalyticsQuery, AnalyticsResult, AnalyticsRow, DIMENSION_KEYS, DateRange, DimensionKey, FILTER_OPERATORS, FilterOperator, FilterOperatorMap, Granularity, MetricKey, MetricReach, MetricSemantics, MetricValue, MetricValues, PLATFORM_SCOPE, RateLimitDescriptor, SourceErrorKind, VisitorCounting };
|
|
186
447
|
//# sourceMappingURL=contract.d.ts.map
|