@10x-media/analytics 1.0.0-beta.14 → 1.0.0-beta.15
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 +45 -0
- package/dist/adapters/ga4/ga4.d.ts +7 -0
- package/dist/adapters/ga4/ga4.js +17 -3
- package/dist/adapters/ga4/ga4.js.map +1 -1
- package/dist/adapters/plausible/plausible.d.ts +6 -0
- package/dist/adapters/plausible/plausible.js +6 -3
- package/dist/adapters/plausible/plausible.js.map +1 -1
- package/dist/adapters/posthog/posthog.d.ts +7 -0
- package/dist/adapters/posthog/posthog.js +92 -19
- 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/umami/umami.d.ts +6 -0
- package/dist/adapters/umami/umami.js +3 -1
- package/dist/adapters/umami/umami.js.map +1 -1
- package/dist/capture/trackerConfig.js +29 -6
- package/dist/capture/trackerConfig.js.map +1 -1
- package/dist/capture/withoutConsent.js +91 -0
- package/dist/capture/withoutConsent.js.map +1 -0
- package/dist/core/capture.d.ts +41 -11
- package/dist/core/captureOptions.js +97 -8
- package/dist/core/captureOptions.js.map +1 -1
- package/dist/core/contract.d.ts +25 -0
- package/dist/core/contract.js.map +1 -1
- package/dist/core/options.d.ts +24 -2
- package/dist/core/options.js.map +1 -1
- package/dist/core/sourceOptions.js +2 -1
- package/dist/core/sourceOptions.js.map +1 -1
- package/dist/exports/adapters/contract.d.ts +3 -3
- package/dist/exports/adapters/ga4.d.ts +4 -4
- package/dist/exports/adapters/native.d.ts +5 -5
- package/dist/exports/adapters/plausible.d.ts +4 -4
- package/dist/exports/adapters/posthog.d.ts +4 -4
- package/dist/exports/adapters/umami.d.ts +4 -4
- package/dist/exports/next.d.ts +4 -4
- package/dist/exports/react.d.ts +3 -2
- package/dist/exports/site.d.ts +2 -2
- package/dist/exports/testing.d.ts +4 -4
- package/dist/exports/tracker.d.ts +3 -2
- package/dist/exports/types.d.ts +5 -5
- package/dist/index.d.ts +5 -5
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/native/collections/hits.js +1 -0
- package/dist/native/collections/hits.js.map +1 -1
- package/dist/native/engine/engine.js +5 -1
- package/dist/native/engine/engine.js.map +1 -1
- package/dist/native/engine/planner.js +2 -1
- package/dist/native/engine/planner.js.map +1 -1
- package/dist/native/engine/toHit.js +4 -2
- package/dist/native/engine/toHit.js.map +1 -1
- package/dist/native/ingest/endpoint.js +5 -2
- package/dist/native/ingest/endpoint.js.map +1 -1
- package/dist/native/ingest/normalizeEvent.d.ts +6 -1
- package/dist/native/ingest/normalizeEvent.js +17 -7
- package/dist/native/ingest/normalizeEvent.js.map +1 -1
- package/dist/native/ingest/serverTrack.js +2 -1
- package/dist/native/ingest/serverTrack.js.map +1 -1
- package/dist/native/ingest/validate.js +3 -0
- package/dist/native/ingest/validate.js.map +1 -1
- package/dist/native/nativeAdapter.d.ts +10 -1
- package/dist/native/nativeAdapter.js +11 -1
- package/dist/native/nativeAdapter.js.map +1 -1
- package/dist/native/store/aggregate.js +1 -1
- package/dist/native/store/aggregate.js.map +1 -1
- package/dist/native/store/hitRow.js +3 -0
- package/dist/native/store/hitRow.js.map +1 -1
- package/dist/native/store/hits.js +3 -1
- package/dist/native/store/hits.js.map +1 -1
- package/dist/native/store/mongo/aggregatePipelines.js +10 -2
- package/dist/native/store/mongo/aggregatePipelines.js.map +1 -1
- package/dist/native/store/mongo/pipelines.js +15 -5
- package/dist/native/store/mongo/pipelines.js.map +1 -1
- package/dist/native/store/parts.js +9 -3
- package/dist/native/store/parts.js.map +1 -1
- package/dist/native/store/rawRead.js +6 -3
- package/dist/native/store/rawRead.js.map +1 -1
- package/dist/native/store/sql/aggregateSql.js +6 -2
- package/dist/native/store/sql/aggregateSql.js.map +1 -1
- package/dist/native/store/sql/columns.js +1 -0
- package/dist/native/store/sql/columns.js.map +1 -1
- package/dist/native/store/sql/compile.js +19 -7
- package/dist/native/store/sql/compile.js.map +1 -1
- package/dist/native/store/types.d.ts +7 -1
- package/dist/native/store/types.js +10 -0
- package/dist/native/store/types.js.map +1 -0
- package/dist/plugin/createRuntime.js +10 -1
- package/dist/plugin/createRuntime.js.map +1 -1
- package/dist/plugin/runtime.js.map +1 -1
- package/dist/providers/collection.d.ts +2 -0
- package/dist/providers/collection.js +22 -1
- package/dist/providers/collection.js.map +1 -1
- package/dist/providers/factory.d.ts +9 -1
- package/dist/providers/factory.js +14 -5
- package/dist/providers/factory.js.map +1 -1
- package/dist/providers/registry.js +2 -1
- package/dist/providers/registry.js.map +1 -1
- package/dist/react/AnalyticsProvider.d.ts +6 -0
- package/dist/react/AnalyticsProvider.js.map +1 -1
- package/dist/react/useAnalytics.js +9 -5
- package/dist/react/useAnalytics.js.map +1 -1
- package/dist/site/AnalyticsScripts.d.ts +4 -3
- package/dist/site/AnalyticsScripts.js +18 -4
- package/dist/site/AnalyticsScripts.js.map +1 -1
- package/dist/surfacing/todaySplit.js +7 -1
- package/dist/surfacing/todaySplit.js.map +1 -1
- package/dist/tracker/config.d.ts +26 -1
- package/dist/tracker/config.js.map +1 -1
- package/dist/tracker/createTracker.d.ts +2 -1
- package/dist/tracker/createTracker.js +91 -59
- package/dist/tracker/createTracker.js.map +1 -1
- package/dist/tracker/gate.d.ts +8 -0
- package/dist/tracker/gate.js +61 -11
- package/dist/tracker/gate.js.map +1 -1
- package/dist/tracker/loadScript.js +2 -1
- package/dist/tracker/loadScript.js.map +1 -1
- package/dist/tracker/registry.js +14 -3
- package/dist/tracker/registry.js.map +1 -1
- package/dist/tracker/sinks/createSink.js +27 -8
- package/dist/tracker/sinks/createSink.js.map +1 -1
- package/dist/tracker/sinks/ga4.js +38 -6
- package/dist/tracker/sinks/ga4.js.map +1 -1
- package/dist/tracker/sinks/native.js +17 -3
- package/dist/tracker/sinks/native.js.map +1 -1
- package/dist/tracker/sinks/plausible.js +8 -2
- package/dist/tracker/sinks/plausible.js.map +1 -1
- package/dist/tracker/sinks/posthog.js +108 -16
- package/dist/tracker/sinks/posthog.js.map +1 -1
- package/dist/tracker/sinks/umami.js +2 -2
- package/dist/tracker/sinks/umami.js.map +1 -1
- package/dist/tracker/sinks/vendor.js +25 -11
- package/dist/tracker/sinks/vendor.js.map +1 -1
- package/dist/tracker/types.d.ts +10 -3
- package/dist/translations/ar.js +7 -0
- package/dist/translations/ar.js.map +1 -1
- package/dist/translations/de.js +7 -0
- package/dist/translations/de.js.map +1 -1
- package/dist/translations/en.js +7 -0
- package/dist/translations/en.js.map +1 -1
- package/dist/translations/es.js +7 -0
- package/dist/translations/es.js.map +1 -1
- package/dist/translations/fr.js +7 -0
- package/dist/translations/fr.js.map +1 -1
- package/dist/translations/id.js +7 -0
- package/dist/translations/id.js.map +1 -1
- package/dist/translations/keys.d.ts +7 -0
- package/dist/translations/keys.js +8 -1
- package/dist/translations/keys.js.map +1 -1
- package/dist/translations/ko.js +7 -0
- package/dist/translations/ko.js.map +1 -1
- package/dist/translations/pt.js +7 -0
- package/dist/translations/pt.js.map +1 -1
- package/dist/translations/ru.js +7 -0
- package/dist/translations/ru.js.map +1 -1
- package/dist/translations/uk.js +7 -0
- package/dist/translations/uk.js.map +1 -1
- package/dist/translations/zh.js +7 -0
- package/dist/translations/zh.js.map +1 -1
- package/dist/view/consentShare.js +15 -0
- package/dist/view/consentShare.js.map +1 -0
- package/dist/view/sections/OverviewCards.js +38 -28
- package/dist/view/sections/OverviewCards.js.map +1 -1
- package/dist/widgets/notices.js +6 -1
- package/dist/widgets/notices.js.map +1 -1
- package/dist/widgets/readMeta.d.ts +4 -0
- package/dist/widgets/readMeta.js +5 -0
- package/dist/widgets/readMeta.js.map +1 -1
- package/package.json +4 -4
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { CurrencyConverter } from "../../goals/currency.js";
|
|
2
|
-
import { CaptureClientKind, CaptureSlot, CaptureSnippet, GoalMatch, SnippetScript, TrackerGoal, TrackerSlotConfig } from "../../tracker/config.js";
|
|
2
|
+
import { CaptureClientKind, CaptureSlot, CaptureSnippet, ConsentPhase, GoalMatch, HeldSlotMode, SlotMode, SlotWithoutConsent, SnippetScript, TrackerGoal, TrackerSlotConfig, WithoutConsentLevel } from "../../tracker/config.js";
|
|
3
3
|
import { Goal } from "../../goals/types.js";
|
|
4
4
|
import { BrowserAmounts, OrderSignatureMode } from "../../goals/match.js";
|
|
5
5
|
import { TrustedPlatform } from "../../net/platform.js";
|
|
6
6
|
import { RouteBase, RoutePaths } from "../../plugin/routes.js";
|
|
7
7
|
import { FetchInit, FetchLike } from "../../core/fetch.js";
|
|
8
|
-
import { CaptureSupport, ProxyDescriptor, ProxyRoute, ProxyRouteKind } from "../../core/capture.js";
|
|
8
|
+
import { CaptureSupport, CookielessSupport, ProxyDescriptor, ProxyRoute, ProxyRouteKind, SnippetArgs, SnippetMode } from "../../core/capture.js";
|
|
9
9
|
import { AdapterJobs, AnalyticsTaskName, ScheduledTask, TASK_NAMES } from "../../core/jobs.js";
|
|
10
10
|
import { AnalyticsSdks, Ga4Client, Ga4ClientOptions, Ga4ReportResponse, Ga4ReportRow, Ga4Sdk, MaxmindReader, MaxmindSdk } from "../../core/sdks.js";
|
|
11
|
-
import { HitType } from "../../native/store/types.js";
|
|
11
|
+
import { HitMode, HitType } from "../../native/store/types.js";
|
|
12
12
|
import { RawEventInput } from "../../native/ingest/normalizeEvent.js";
|
|
13
13
|
import { IngestHostnameResolver, ServerEventInput, ServerTrack, ServerTrackIdentity, ServerTrackOptions } from "../../core/serverEvent.js";
|
|
14
14
|
import { AdapterContext, AdapterLabelArgs, AdapterRegisterContext, AdapterSchemaContext, AnalyticsAdapter, AnalyticsCapabilities, AnalyticsFilter, AnalyticsQuery, AnalyticsResult, AnalyticsRow, DIMENSION_KEYS, DateRange, DimensionKey, FILTER_OPERATORS, FilterOperator, FilterOperatorMap, Granularity, MetricKey, MetricReach, MetricSemantics, MetricValue, MetricValues, RateLimitDescriptor, SourceErrorKind, VisitorCounting } from "../../core/contract.js";
|
|
15
15
|
import { AdapterLabelOption } from "../../core/sourceLabel.js";
|
|
16
16
|
import { PlausibleConfig, plausible } from "../../adapters/plausible/plausible.js";
|
|
17
|
-
export { type AdapterContext, type AdapterJobs, type AdapterLabelArgs, type AdapterLabelOption, type AdapterRegisterContext, type AdapterSchemaContext, type AnalyticsAdapter, type AnalyticsCapabilities, type AnalyticsFilter, type AnalyticsQuery, type AnalyticsResult, type AnalyticsRow, type AnalyticsSdks, type AnalyticsTaskName, type BrowserAmounts, type CaptureClientKind, type CaptureSlot, type CaptureSnippet, type CaptureSupport, type CurrencyConverter, type DIMENSION_KEYS, type DateRange, type DimensionKey, type FILTER_OPERATORS, type FetchInit, type FetchLike, type FilterOperator, type FilterOperatorMap, type Ga4Client, type Ga4ClientOptions, type Ga4ReportResponse, type Ga4ReportRow, type Ga4Sdk, type Goal, type GoalMatch, type Granularity, type HitType, type IngestHostnameResolver, type MaxmindReader, type MaxmindSdk, type MetricKey, type MetricReach, type MetricSemantics, type MetricValue, type MetricValues, type OrderSignatureMode, type PlausibleConfig, type ProxyDescriptor, type ProxyRoute, type ProxyRouteKind, type RateLimitDescriptor, type RawEventInput, type RouteBase, type RoutePaths, type ScheduledTask, type ServerEventInput, type ServerTrack, type ServerTrackIdentity, type ServerTrackOptions, type SnippetScript, type SourceErrorKind, type TASK_NAMES, type TrackerGoal, type TrackerSlotConfig, type TrustedPlatform, type VisitorCounting, plausible };
|
|
17
|
+
export { type AdapterContext, type AdapterJobs, type AdapterLabelArgs, type AdapterLabelOption, type AdapterRegisterContext, type AdapterSchemaContext, type AnalyticsAdapter, type AnalyticsCapabilities, type AnalyticsFilter, type AnalyticsQuery, type AnalyticsResult, type AnalyticsRow, type AnalyticsSdks, type AnalyticsTaskName, type BrowserAmounts, type CaptureClientKind, type CaptureSlot, type CaptureSnippet, type CaptureSupport, type ConsentPhase, type CookielessSupport, type CurrencyConverter, type DIMENSION_KEYS, type DateRange, type DimensionKey, type FILTER_OPERATORS, type FetchInit, type FetchLike, type FilterOperator, type FilterOperatorMap, type Ga4Client, type Ga4ClientOptions, type Ga4ReportResponse, type Ga4ReportRow, type Ga4Sdk, type Goal, type GoalMatch, type Granularity, type HeldSlotMode, type HitMode, type HitType, type IngestHostnameResolver, type MaxmindReader, type MaxmindSdk, type MetricKey, type MetricReach, type MetricSemantics, type MetricValue, type MetricValues, type OrderSignatureMode, type PlausibleConfig, type ProxyDescriptor, type ProxyRoute, type ProxyRouteKind, type RateLimitDescriptor, type RawEventInput, type RouteBase, type RoutePaths, type ScheduledTask, type ServerEventInput, type ServerTrack, type ServerTrackIdentity, type ServerTrackOptions, type SlotMode, type SlotWithoutConsent, type SnippetArgs, type SnippetMode, type SnippetScript, type SourceErrorKind, type TASK_NAMES, type TrackerGoal, type TrackerSlotConfig, type TrustedPlatform, type VisitorCounting, type WithoutConsentLevel, plausible };
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { CurrencyConverter } from "../../goals/currency.js";
|
|
2
|
-
import { CaptureClientKind, CaptureSlot, CaptureSnippet, GoalMatch, SnippetScript, TrackerGoal, TrackerSlotConfig } from "../../tracker/config.js";
|
|
2
|
+
import { CaptureClientKind, CaptureSlot, CaptureSnippet, ConsentPhase, GoalMatch, HeldSlotMode, SlotMode, SlotWithoutConsent, SnippetScript, TrackerGoal, TrackerSlotConfig, WithoutConsentLevel } from "../../tracker/config.js";
|
|
3
3
|
import { Goal } from "../../goals/types.js";
|
|
4
4
|
import { BrowserAmounts, OrderSignatureMode } from "../../goals/match.js";
|
|
5
5
|
import { TrustedPlatform } from "../../net/platform.js";
|
|
6
6
|
import { RouteBase, RoutePaths } from "../../plugin/routes.js";
|
|
7
7
|
import { FetchInit, FetchLike } from "../../core/fetch.js";
|
|
8
|
-
import { CaptureSupport, ProxyDescriptor, ProxyRoute, ProxyRouteKind } from "../../core/capture.js";
|
|
8
|
+
import { CaptureSupport, CookielessSupport, ProxyDescriptor, ProxyRoute, ProxyRouteKind, SnippetArgs, SnippetMode } from "../../core/capture.js";
|
|
9
9
|
import { AdapterJobs, AnalyticsTaskName, ScheduledTask, TASK_NAMES } from "../../core/jobs.js";
|
|
10
10
|
import { AnalyticsSdks, Ga4Client, Ga4ClientOptions, Ga4ReportResponse, Ga4ReportRow, Ga4Sdk, MaxmindReader, MaxmindSdk } from "../../core/sdks.js";
|
|
11
|
-
import { HitType } from "../../native/store/types.js";
|
|
11
|
+
import { HitMode, HitType } from "../../native/store/types.js";
|
|
12
12
|
import { RawEventInput } from "../../native/ingest/normalizeEvent.js";
|
|
13
13
|
import { IngestHostnameResolver, ServerEventInput, ServerTrack, ServerTrackIdentity, ServerTrackOptions } from "../../core/serverEvent.js";
|
|
14
14
|
import { AdapterContext, AdapterLabelArgs, AdapterRegisterContext, AdapterSchemaContext, AnalyticsAdapter, AnalyticsCapabilities, AnalyticsFilter, AnalyticsQuery, AnalyticsResult, AnalyticsRow, DIMENSION_KEYS, DateRange, DimensionKey, FILTER_OPERATORS, FilterOperator, FilterOperatorMap, Granularity, MetricKey, MetricReach, MetricSemantics, MetricValue, MetricValues, RateLimitDescriptor, SourceErrorKind, VisitorCounting } from "../../core/contract.js";
|
|
15
15
|
import { AdapterLabelOption } from "../../core/sourceLabel.js";
|
|
16
16
|
import { PosthogConfig, posthog } from "../../adapters/posthog/posthog.js";
|
|
17
|
-
export { type AdapterContext, type AdapterJobs, type AdapterLabelArgs, type AdapterLabelOption, type AdapterRegisterContext, type AdapterSchemaContext, type AnalyticsAdapter, type AnalyticsCapabilities, type AnalyticsFilter, type AnalyticsQuery, type AnalyticsResult, type AnalyticsRow, type AnalyticsSdks, type AnalyticsTaskName, type BrowserAmounts, type CaptureClientKind, type CaptureSlot, type CaptureSnippet, type CaptureSupport, type CurrencyConverter, type DIMENSION_KEYS, type DateRange, type DimensionKey, type FILTER_OPERATORS, type FetchInit, type FetchLike, type FilterOperator, type FilterOperatorMap, type Ga4Client, type Ga4ClientOptions, type Ga4ReportResponse, type Ga4ReportRow, type Ga4Sdk, type Goal, type GoalMatch, type Granularity, type HitType, type IngestHostnameResolver, type MaxmindReader, type MaxmindSdk, type MetricKey, type MetricReach, type MetricSemantics, type MetricValue, type MetricValues, type OrderSignatureMode, type PosthogConfig, type ProxyDescriptor, type ProxyRoute, type ProxyRouteKind, type RateLimitDescriptor, type RawEventInput, type RouteBase, type RoutePaths, type ScheduledTask, type ServerEventInput, type ServerTrack, type ServerTrackIdentity, type ServerTrackOptions, type SnippetScript, type SourceErrorKind, type TASK_NAMES, type TrackerGoal, type TrackerSlotConfig, type TrustedPlatform, type VisitorCounting, posthog };
|
|
17
|
+
export { type AdapterContext, type AdapterJobs, type AdapterLabelArgs, type AdapterLabelOption, type AdapterRegisterContext, type AdapterSchemaContext, type AnalyticsAdapter, type AnalyticsCapabilities, type AnalyticsFilter, type AnalyticsQuery, type AnalyticsResult, type AnalyticsRow, type AnalyticsSdks, type AnalyticsTaskName, type BrowserAmounts, type CaptureClientKind, type CaptureSlot, type CaptureSnippet, type CaptureSupport, type ConsentPhase, type CookielessSupport, type CurrencyConverter, type DIMENSION_KEYS, type DateRange, type DimensionKey, type FILTER_OPERATORS, type FetchInit, type FetchLike, type FilterOperator, type FilterOperatorMap, type Ga4Client, type Ga4ClientOptions, type Ga4ReportResponse, type Ga4ReportRow, type Ga4Sdk, type Goal, type GoalMatch, type Granularity, type HeldSlotMode, type HitMode, type HitType, type IngestHostnameResolver, type MaxmindReader, type MaxmindSdk, type MetricKey, type MetricReach, type MetricSemantics, type MetricValue, type MetricValues, type OrderSignatureMode, type PosthogConfig, type ProxyDescriptor, type ProxyRoute, type ProxyRouteKind, type RateLimitDescriptor, type RawEventInput, type RouteBase, type RoutePaths, type ScheduledTask, type ServerEventInput, type ServerTrack, type ServerTrackIdentity, type ServerTrackOptions, type SlotMode, type SlotWithoutConsent, type SnippetArgs, type SnippetMode, type SnippetScript, type SourceErrorKind, type TASK_NAMES, type TrackerGoal, type TrackerSlotConfig, type TrustedPlatform, type VisitorCounting, type WithoutConsentLevel, posthog };
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { CurrencyConverter } from "../../goals/currency.js";
|
|
2
|
-
import { CaptureClientKind, CaptureSlot, CaptureSnippet, GoalMatch, SnippetScript, TrackerGoal, TrackerSlotConfig } from "../../tracker/config.js";
|
|
2
|
+
import { CaptureClientKind, CaptureSlot, CaptureSnippet, ConsentPhase, GoalMatch, HeldSlotMode, SlotMode, SlotWithoutConsent, SnippetScript, TrackerGoal, TrackerSlotConfig, WithoutConsentLevel } from "../../tracker/config.js";
|
|
3
3
|
import { Goal } from "../../goals/types.js";
|
|
4
4
|
import { BrowserAmounts, OrderSignatureMode } from "../../goals/match.js";
|
|
5
5
|
import { TrustedPlatform } from "../../net/platform.js";
|
|
6
6
|
import { RouteBase, RoutePaths } from "../../plugin/routes.js";
|
|
7
7
|
import { FetchInit, FetchLike } from "../../core/fetch.js";
|
|
8
|
-
import { CaptureSupport, ProxyDescriptor, ProxyRoute, ProxyRouteKind } from "../../core/capture.js";
|
|
8
|
+
import { CaptureSupport, CookielessSupport, ProxyDescriptor, ProxyRoute, ProxyRouteKind, SnippetArgs, SnippetMode } from "../../core/capture.js";
|
|
9
9
|
import { AdapterJobs, AnalyticsTaskName, ScheduledTask, TASK_NAMES } from "../../core/jobs.js";
|
|
10
10
|
import { AnalyticsSdks, Ga4Client, Ga4ClientOptions, Ga4ReportResponse, Ga4ReportRow, Ga4Sdk, MaxmindReader, MaxmindSdk } from "../../core/sdks.js";
|
|
11
|
-
import { HitType } from "../../native/store/types.js";
|
|
11
|
+
import { HitMode, HitType } from "../../native/store/types.js";
|
|
12
12
|
import { RawEventInput } from "../../native/ingest/normalizeEvent.js";
|
|
13
13
|
import { IngestHostnameResolver, ServerEventInput, ServerTrack, ServerTrackIdentity, ServerTrackOptions } from "../../core/serverEvent.js";
|
|
14
14
|
import { AdapterContext, AdapterLabelArgs, AdapterRegisterContext, AdapterSchemaContext, AnalyticsAdapter, AnalyticsCapabilities, AnalyticsFilter, AnalyticsQuery, AnalyticsResult, AnalyticsRow, DIMENSION_KEYS, DateRange, DimensionKey, FILTER_OPERATORS, FilterOperator, FilterOperatorMap, Granularity, MetricKey, MetricReach, MetricSemantics, MetricValue, MetricValues, RateLimitDescriptor, SourceErrorKind, VisitorCounting } from "../../core/contract.js";
|
|
15
15
|
import { AdapterLabelOption } from "../../core/sourceLabel.js";
|
|
16
16
|
import { UmamiConfig, umami } from "../../adapters/umami/umami.js";
|
|
17
|
-
export { type AdapterContext, type AdapterJobs, type AdapterLabelArgs, type AdapterLabelOption, type AdapterRegisterContext, type AdapterSchemaContext, type AnalyticsAdapter, type AnalyticsCapabilities, type AnalyticsFilter, type AnalyticsQuery, type AnalyticsResult, type AnalyticsRow, type AnalyticsSdks, type AnalyticsTaskName, type BrowserAmounts, type CaptureClientKind, type CaptureSlot, type CaptureSnippet, type CaptureSupport, type CurrencyConverter, type DIMENSION_KEYS, type DateRange, type DimensionKey, type FILTER_OPERATORS, type FetchInit, type FetchLike, type FilterOperator, type FilterOperatorMap, type Ga4Client, type Ga4ClientOptions, type Ga4ReportResponse, type Ga4ReportRow, type Ga4Sdk, type Goal, type GoalMatch, type Granularity, type HitType, type IngestHostnameResolver, type MaxmindReader, type MaxmindSdk, type MetricKey, type MetricReach, type MetricSemantics, type MetricValue, type MetricValues, type OrderSignatureMode, type ProxyDescriptor, type ProxyRoute, type ProxyRouteKind, type RateLimitDescriptor, type RawEventInput, type RouteBase, type RoutePaths, type ScheduledTask, type ServerEventInput, type ServerTrack, type ServerTrackIdentity, type ServerTrackOptions, type SnippetScript, type SourceErrorKind, type TASK_NAMES, type TrackerGoal, type TrackerSlotConfig, type TrustedPlatform, type UmamiConfig, type VisitorCounting, umami };
|
|
17
|
+
export { type AdapterContext, type AdapterJobs, type AdapterLabelArgs, type AdapterLabelOption, type AdapterRegisterContext, type AdapterSchemaContext, type AnalyticsAdapter, type AnalyticsCapabilities, type AnalyticsFilter, type AnalyticsQuery, type AnalyticsResult, type AnalyticsRow, type AnalyticsSdks, type AnalyticsTaskName, type BrowserAmounts, type CaptureClientKind, type CaptureSlot, type CaptureSnippet, type CaptureSupport, type ConsentPhase, type CookielessSupport, type CurrencyConverter, type DIMENSION_KEYS, type DateRange, type DimensionKey, type FILTER_OPERATORS, type FetchInit, type FetchLike, type FilterOperator, type FilterOperatorMap, type Ga4Client, type Ga4ClientOptions, type Ga4ReportResponse, type Ga4ReportRow, type Ga4Sdk, type Goal, type GoalMatch, type Granularity, type HeldSlotMode, type HitMode, type HitType, type IngestHostnameResolver, type MaxmindReader, type MaxmindSdk, type MetricKey, type MetricReach, type MetricSemantics, type MetricValue, type MetricValues, type OrderSignatureMode, type ProxyDescriptor, type ProxyRoute, type ProxyRouteKind, type RateLimitDescriptor, type RawEventInput, type RouteBase, type RoutePaths, type ScheduledTask, type ServerEventInput, type ServerTrack, type ServerTrackIdentity, type ServerTrackOptions, type SlotMode, type SlotWithoutConsent, type SnippetArgs, type SnippetMode, type SnippetScript, type SourceErrorKind, type TASK_NAMES, type TrackerGoal, type TrackerSlotConfig, type TrustedPlatform, type UmamiConfig, type VisitorCounting, type WithoutConsentLevel, umami };
|
package/dist/exports/next.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { CurrencyConverter } from "../goals/currency.js";
|
|
2
|
-
import { CaptureClientKind, CaptureSlot, CaptureSnippet, GoalMatch, SnippetScript, TrackerGoal, TrackerSlotConfig } from "../tracker/config.js";
|
|
2
|
+
import { CaptureClientKind, CaptureSlot, CaptureSnippet, ConsentPhase, GoalMatch, HeldSlotMode, SlotMode, SlotWithoutConsent, SnippetScript, TrackerGoal, TrackerSlotConfig, WithoutConsentLevel } from "../tracker/config.js";
|
|
3
3
|
import { Goal } from "../goals/types.js";
|
|
4
4
|
import { BrowserAmounts, OrderSignatureMode } from "../goals/match.js";
|
|
5
5
|
import { TrustedPlatform } from "../net/platform.js";
|
|
6
6
|
import { RouteBase, RoutePaths } from "../plugin/routes.js";
|
|
7
7
|
import { FetchInit, FetchLike } from "../core/fetch.js";
|
|
8
|
-
import { CaptureSupport, ProxyDescriptor, ProxyRoute, ProxyRouteKind } from "../core/capture.js";
|
|
8
|
+
import { CaptureSupport, CookielessSupport, ProxyDescriptor, ProxyRoute, ProxyRouteKind, SnippetArgs, SnippetMode } from "../core/capture.js";
|
|
9
9
|
import { AdapterJobs, AnalyticsTaskName, ScheduledTask, TASK_NAMES } from "../core/jobs.js";
|
|
10
10
|
import { AnalyticsSdks, Ga4Client, Ga4ClientOptions, Ga4ReportResponse, Ga4ReportRow, Ga4Sdk, MaxmindReader, MaxmindSdk } from "../core/sdks.js";
|
|
11
|
-
import { HitType } from "../native/store/types.js";
|
|
11
|
+
import { HitMode, HitType } from "../native/store/types.js";
|
|
12
12
|
import { RawEventInput } from "../native/ingest/normalizeEvent.js";
|
|
13
13
|
import { IngestHostnameResolver, ServerEventInput, ServerTrack, ServerTrackIdentity, ServerTrackOptions } from "../core/serverEvent.js";
|
|
14
14
|
import { AdapterContext, AdapterLabelArgs, AdapterRegisterContext, AdapterSchemaContext, AnalyticsAdapter, AnalyticsCapabilities, AnalyticsFilter, AnalyticsQuery, AnalyticsResult, AnalyticsRow, DIMENSION_KEYS, DateRange, DimensionKey, FILTER_OPERATORS, FilterOperator, FilterOperatorMap, Granularity, MetricKey, MetricReach, MetricSemantics, MetricValue, MetricValues, RateLimitDescriptor, SourceErrorKind, VisitorCounting } from "../core/contract.js";
|
|
@@ -18,4 +18,4 @@ import { CaptureRouteOptions, captureRoute } from "../next/captureRoute.js";
|
|
|
18
18
|
import { IngestRouteOptions } from "../native/ingest/route.js";
|
|
19
19
|
import { ingestPreflight, ingestRoute } from "../next/ingestRoute.js";
|
|
20
20
|
import { PosthogProxyRegion, PosthogProxyRewrite, PosthogProxyRewritesOptions, posthogProxyRewrites } from "../next/posthogProxyRewrites.js";
|
|
21
|
-
export { type AdapterContext, type AdapterJobs, type AdapterLabelArgs, type AdapterLabelOption, type AdapterRegisterContext, type AdapterSchemaContext, type AnalyticsAdapter, type AnalyticsCapabilities, type AnalyticsFilter, type AnalyticsQuery, type AnalyticsResult, type AnalyticsRow, type AnalyticsSdks, type AnalyticsTaskName, type BrowserAmounts, type CaptureClientKind, type CaptureRewrite, type CaptureRewriteMount, type CaptureRouteOptions, type CaptureSlot, type CaptureSnippet, type CaptureSupport, type CurrencyConverter, type DIMENSION_KEYS, type DateRange, type DimensionKey, type FILTER_OPERATORS, type FetchInit, type FetchLike, type FilterOperator, type FilterOperatorMap, type Ga4Client, type Ga4ClientOptions, type Ga4ReportResponse, type Ga4ReportRow, type Ga4Sdk, type Goal, type GoalMatch, type Granularity, type HitType, type IngestHostnameResolver, type IngestRouteOptions, type MaxmindReader, type MaxmindSdk, type MetricKey, type MetricReach, type MetricSemantics, type MetricValue, type MetricValues, type OrderSignatureMode, type PosthogProxyRegion, type PosthogProxyRewrite, type PosthogProxyRewritesOptions, type ProxyDescriptor, type ProxyRoute, type ProxyRouteKind, type RateLimitDescriptor, type RawEventInput, type RouteBase, type RoutePaths, type ScheduledTask, type ServerEventInput, type ServerTrack, type ServerTrackIdentity, type ServerTrackOptions, type SnippetScript, type SourceErrorKind, type TASK_NAMES, type TrackerGoal, type TrackerSlotConfig, type TrustedPlatform, type VisitorCounting, captureRewrites, captureRoute, ingestPreflight, ingestRoute, posthogProxyRewrites };
|
|
21
|
+
export { type AdapterContext, type AdapterJobs, type AdapterLabelArgs, type AdapterLabelOption, type AdapterRegisterContext, type AdapterSchemaContext, type AnalyticsAdapter, type AnalyticsCapabilities, type AnalyticsFilter, type AnalyticsQuery, type AnalyticsResult, type AnalyticsRow, type AnalyticsSdks, type AnalyticsTaskName, type BrowserAmounts, type CaptureClientKind, type CaptureRewrite, type CaptureRewriteMount, type CaptureRouteOptions, type CaptureSlot, type CaptureSnippet, type CaptureSupport, type ConsentPhase, type CookielessSupport, type CurrencyConverter, type DIMENSION_KEYS, type DateRange, type DimensionKey, type FILTER_OPERATORS, type FetchInit, type FetchLike, type FilterOperator, type FilterOperatorMap, type Ga4Client, type Ga4ClientOptions, type Ga4ReportResponse, type Ga4ReportRow, type Ga4Sdk, type Goal, type GoalMatch, type Granularity, type HeldSlotMode, type HitMode, type HitType, type IngestHostnameResolver, type IngestRouteOptions, type MaxmindReader, type MaxmindSdk, type MetricKey, type MetricReach, type MetricSemantics, type MetricValue, type MetricValues, type OrderSignatureMode, type PosthogProxyRegion, type PosthogProxyRewrite, type PosthogProxyRewritesOptions, type ProxyDescriptor, type ProxyRoute, type ProxyRouteKind, type RateLimitDescriptor, type RawEventInput, type RouteBase, type RoutePaths, type ScheduledTask, type ServerEventInput, type ServerTrack, type ServerTrackIdentity, type ServerTrackOptions, type SlotMode, type SlotWithoutConsent, type SnippetArgs, type SnippetMode, type SnippetScript, type SourceErrorKind, type TASK_NAMES, type TrackerGoal, type TrackerSlotConfig, type TrustedPlatform, type VisitorCounting, type WithoutConsentLevel, captureRewrites, captureRoute, ingestPreflight, ingestRoute, posthogProxyRewrites };
|
package/dist/exports/react.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { AdminDigest, CaptureClientKind, CaptureSlot, CaptureSnippet, GoalMatch, ResolvedAutoCapture, ResolvedItemCapture, RevenueItem, SnippetScript, TrackerConfig, TrackerExclusion, TrackerGoal, TrackerSkip, TrackerSlotConfig } from "../tracker/config.js";
|
|
1
|
+
import { AdminDigest, CaptureClientKind, CaptureSlot, CaptureSnippet, ConsentPhase, GoalMatch, HeldSlotMode, ResolvedAutoCapture, ResolvedItemCapture, RevenueItem, SlotMode, SlotWithoutConsent, SnippetScript, TrackerConfig, TrackerExclusion, TrackerGoal, TrackerSkip, TrackerSlotConfig } from "../tracker/config.js";
|
|
2
2
|
import { GateState, GateStatus, ItemOptions, LoadScript, PurchaseInput, RefundInput, TrackGoalOptions, Tracker } from "../tracker/types.js";
|
|
3
|
+
import { ModeSnapshot } from "../tracker/gate.js";
|
|
3
4
|
import { AnalyticsApi, AnalyticsCommands, AnalyticsProvider, AnalyticsProviderProps } from "../react/AnalyticsProvider.js";
|
|
4
5
|
import { useAnalytics } from "../react/useAnalytics.js";
|
|
5
|
-
export { type AdminDigest, type AnalyticsApi, type AnalyticsCommands, AnalyticsProvider, type AnalyticsProviderProps, type CaptureClientKind, type CaptureSlot, type CaptureSnippet, type GateState, type GateStatus, type GoalMatch, type ItemOptions, type LoadScript, type PurchaseInput, type RefundInput, type ResolvedAutoCapture, type ResolvedItemCapture, type RevenueItem, type SnippetScript, type TrackGoalOptions, type Tracker, type TrackerConfig, type TrackerExclusion, type TrackerGoal, type TrackerSkip, type TrackerSlotConfig, useAnalytics };
|
|
6
|
+
export { type AdminDigest, type AnalyticsApi, type AnalyticsCommands, AnalyticsProvider, type AnalyticsProviderProps, type CaptureClientKind, type CaptureSlot, type CaptureSnippet, type ConsentPhase, type GateState, type GateStatus, type GoalMatch, type HeldSlotMode, type ItemOptions, type LoadScript, type ModeSnapshot, type PurchaseInput, type RefundInput, type ResolvedAutoCapture, type ResolvedItemCapture, type RevenueItem, type SlotMode, type SlotWithoutConsent, type SnippetScript, type TrackGoalOptions, type Tracker, type TrackerConfig, type TrackerExclusion, type TrackerGoal, type TrackerSkip, type TrackerSlotConfig, useAnalytics };
|
package/dist/exports/site.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { AdminDigest, CaptureClientKind, CaptureSlot, CaptureSnippet, GoalMatch, ResolvedAutoCapture, ResolvedItemCapture, SnippetScript, TrackerConfig, TrackerExclusion, TrackerGoal, TrackerSkip, TrackerSlotConfig } from "../tracker/config.js";
|
|
1
|
+
import { AdminDigest, CaptureClientKind, CaptureSlot, CaptureSnippet, ConsentPhase, GoalMatch, HeldSlotMode, ResolvedAutoCapture, ResolvedItemCapture, SlotMode, SlotWithoutConsent, SnippetScript, TrackerConfig, TrackerExclusion, TrackerGoal, TrackerSkip, TrackerSlotConfig } from "../tracker/config.js";
|
|
2
2
|
import { GateState, GateStatus } from "../tracker/types.js";
|
|
3
3
|
import { AnalyticsScripts, AnalyticsScriptsProps } from "../site/AnalyticsScripts.js";
|
|
4
4
|
import { getTrackerConfig } from "../site/getTrackerConfig.js";
|
|
5
|
-
export { type AdminDigest, AnalyticsScripts, type AnalyticsScriptsProps, type CaptureClientKind, type CaptureSlot, type CaptureSnippet, type GateState, type GateStatus, type GoalMatch, type ResolvedAutoCapture, type ResolvedItemCapture, type SnippetScript, type TrackerConfig, type TrackerExclusion, type TrackerGoal, type TrackerSkip, type TrackerSlotConfig, getTrackerConfig };
|
|
5
|
+
export { type AdminDigest, AnalyticsScripts, type AnalyticsScriptsProps, type CaptureClientKind, type CaptureSlot, type CaptureSnippet, type ConsentPhase, type GateState, type GateStatus, type GoalMatch, type HeldSlotMode, type ResolvedAutoCapture, type ResolvedItemCapture, type SlotMode, type SlotWithoutConsent, type SnippetScript, type TrackerConfig, type TrackerExclusion, type TrackerGoal, type TrackerSkip, type TrackerSlotConfig, getTrackerConfig };
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { CurrencyConverter } from "../goals/currency.js";
|
|
2
|
-
import { CaptureClientKind, CaptureSlot, CaptureSnippet, GoalMatch, SnippetScript, TrackerGoal, TrackerSlotConfig } from "../tracker/config.js";
|
|
2
|
+
import { CaptureClientKind, CaptureSlot, CaptureSnippet, ConsentPhase, GoalMatch, HeldSlotMode, SlotMode, SlotWithoutConsent, SnippetScript, TrackerGoal, TrackerSlotConfig, WithoutConsentLevel } from "../tracker/config.js";
|
|
3
3
|
import { Goal } from "../goals/types.js";
|
|
4
4
|
import { BrowserAmounts, OrderSignatureMode } from "../goals/match.js";
|
|
5
5
|
import { TrustedPlatform } from "../net/platform.js";
|
|
6
6
|
import { RouteBase, RoutePaths } from "../plugin/routes.js";
|
|
7
7
|
import { FetchInit, FetchLike } from "../core/fetch.js";
|
|
8
|
-
import { CaptureSupport, ProxyDescriptor, ProxyRoute, ProxyRouteKind } from "../core/capture.js";
|
|
8
|
+
import { CaptureSupport, CookielessSupport, ProxyDescriptor, ProxyRoute, ProxyRouteKind, SnippetArgs, SnippetMode } from "../core/capture.js";
|
|
9
9
|
import { AdapterJobs, AnalyticsTaskName, ScheduledTask, TASK_NAMES } from "../core/jobs.js";
|
|
10
10
|
import { AnalyticsSdks, Ga4Client, Ga4ClientOptions, Ga4ReportResponse, Ga4ReportRow, Ga4Sdk, MaxmindReader, MaxmindSdk } from "../core/sdks.js";
|
|
11
|
-
import { HitType } from "../native/store/types.js";
|
|
11
|
+
import { HitMode, HitType } from "../native/store/types.js";
|
|
12
12
|
import { RawEventInput } from "../native/ingest/normalizeEvent.js";
|
|
13
13
|
import { IngestHostnameResolver, ServerEventInput, ServerTrack, ServerTrackIdentity, ServerTrackOptions } from "../core/serverEvent.js";
|
|
14
14
|
import { AdapterContext, AdapterLabelArgs, AdapterRegisterContext, AdapterSchemaContext, AnalyticsAdapter, AnalyticsCapabilities, AnalyticsFilter, AnalyticsQuery, AnalyticsResult, AnalyticsRow, DIMENSION_KEYS, DateRange, DimensionKey, FILTER_OPERATORS, FilterOperator, FilterOperatorMap, Granularity, MetricKey, MetricReach, MetricSemantics, MetricValue, MetricValues, RateLimitDescriptor, SourceErrorKind, VisitorCounting } from "../core/contract.js";
|
|
15
15
|
import { AdapterLabelOption } from "../core/sourceLabel.js";
|
|
16
16
|
import { MemoryAnalyticsAdapter, MemoryEvent, memoryAdapter } from "../testing/memoryAdapter.js";
|
|
17
17
|
import { settleAnalytics } from "../testing/settle.js";
|
|
18
|
-
export { type AdapterContext, type AdapterJobs, type AdapterLabelArgs, type AdapterLabelOption, type AdapterRegisterContext, type AdapterSchemaContext, type AnalyticsAdapter, type AnalyticsCapabilities, type AnalyticsFilter, type AnalyticsQuery, type AnalyticsResult, type AnalyticsRow, type AnalyticsSdks, type AnalyticsTaskName, type BrowserAmounts, type CaptureClientKind, type CaptureSlot, type CaptureSnippet, type CaptureSupport, type CurrencyConverter, type DIMENSION_KEYS, type DateRange, type DimensionKey, type FILTER_OPERATORS, type FetchInit, type FetchLike, type FilterOperator, type FilterOperatorMap, type Ga4Client, type Ga4ClientOptions, type Ga4ReportResponse, type Ga4ReportRow, type Ga4Sdk, type Goal, type GoalMatch, type Granularity, type HitType, type IngestHostnameResolver, type MaxmindReader, type MaxmindSdk, type MemoryAnalyticsAdapter, type MemoryEvent, type MetricKey, type MetricReach, type MetricSemantics, type MetricValue, type MetricValues, type OrderSignatureMode, type ProxyDescriptor, type ProxyRoute, type ProxyRouteKind, type RateLimitDescriptor, type RawEventInput, type RouteBase, type RoutePaths, type ScheduledTask, type ServerEventInput, type ServerTrack, type ServerTrackIdentity, type ServerTrackOptions, type SnippetScript, type SourceErrorKind, type TASK_NAMES, type TrackerGoal, type TrackerSlotConfig, type TrustedPlatform, type VisitorCounting, memoryAdapter, settleAnalytics };
|
|
18
|
+
export { type AdapterContext, type AdapterJobs, type AdapterLabelArgs, type AdapterLabelOption, type AdapterRegisterContext, type AdapterSchemaContext, type AnalyticsAdapter, type AnalyticsCapabilities, type AnalyticsFilter, type AnalyticsQuery, type AnalyticsResult, type AnalyticsRow, type AnalyticsSdks, type AnalyticsTaskName, type BrowserAmounts, type CaptureClientKind, type CaptureSlot, type CaptureSnippet, type CaptureSupport, type ConsentPhase, type CookielessSupport, type CurrencyConverter, type DIMENSION_KEYS, type DateRange, type DimensionKey, type FILTER_OPERATORS, type FetchInit, type FetchLike, type FilterOperator, type FilterOperatorMap, type Ga4Client, type Ga4ClientOptions, type Ga4ReportResponse, type Ga4ReportRow, type Ga4Sdk, type Goal, type GoalMatch, type Granularity, type HeldSlotMode, type HitMode, type HitType, type IngestHostnameResolver, type MaxmindReader, type MaxmindSdk, type MemoryAnalyticsAdapter, type MemoryEvent, type MetricKey, type MetricReach, type MetricSemantics, type MetricValue, type MetricValues, type OrderSignatureMode, type ProxyDescriptor, type ProxyRoute, type ProxyRouteKind, type RateLimitDescriptor, type RawEventInput, type RouteBase, type RoutePaths, type ScheduledTask, type ServerEventInput, type ServerTrack, type ServerTrackIdentity, type ServerTrackOptions, type SlotMode, type SlotWithoutConsent, type SnippetArgs, type SnippetMode, type SnippetScript, type SourceErrorKind, type TASK_NAMES, type TrackerGoal, type TrackerSlotConfig, type TrustedPlatform, type VisitorCounting, type WithoutConsentLevel, memoryAdapter, settleAnalytics };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { AdminDigest, CaptureClientKind, CaptureSlot, CaptureSnippet, GoalMatch, ResolvedAutoCapture, ResolvedItemCapture, RevenueItem, SnippetScript, TrackerConfig, TrackerExclusion, TrackerGoal, TrackerSkip, TrackerSlotConfig } from "../tracker/config.js";
|
|
1
|
+
import { AdminDigest, CaptureClientKind, CaptureSlot, CaptureSnippet, ConsentPhase, GoalMatch, HeldSlotMode, ResolvedAutoCapture, ResolvedItemCapture, RevenueItem, SlotMode, SlotWithoutConsent, SnippetScript, TrackerConfig, TrackerExclusion, TrackerGoal, TrackerSkip, TrackerSlotConfig } from "../tracker/config.js";
|
|
2
2
|
import { GateState, GateStatus, ItemOptions, LoadScript, PurchaseInput, RefundInput, TrackGoalOptions, Tracker, TrackerOptions, TrackerWindow } from "../tracker/types.js";
|
|
3
|
+
import { ModeSnapshot } from "../tracker/gate.js";
|
|
3
4
|
import { createTracker } from "../tracker/createTracker.js";
|
|
4
5
|
import { DEFAULT_EXCLUSION_PARAM, EXCLUSION_STORAGE_KEY } from "../tracker/exclusion.js";
|
|
5
6
|
import { DEFAULT_TRACKER_ENDPOINT, InitTrackerArgs, initTracker } from "../tracker/initTracker.js";
|
|
6
|
-
export { type AdminDigest, type CaptureClientKind, type CaptureSlot, type CaptureSnippet, DEFAULT_EXCLUSION_PARAM, DEFAULT_TRACKER_ENDPOINT, EXCLUSION_STORAGE_KEY, type GateState, type GateStatus, type GoalMatch, type InitTrackerArgs, type ItemOptions, type LoadScript, type PurchaseInput, type RefundInput, type ResolvedAutoCapture, type ResolvedItemCapture, type RevenueItem, type SnippetScript, type TrackGoalOptions, type Tracker, type TrackerConfig, type TrackerExclusion, type TrackerGoal, type TrackerOptions, type TrackerSkip, type TrackerSlotConfig, type TrackerWindow, createTracker, initTracker };
|
|
7
|
+
export { type AdminDigest, type CaptureClientKind, type CaptureSlot, type CaptureSnippet, type ConsentPhase, DEFAULT_EXCLUSION_PARAM, DEFAULT_TRACKER_ENDPOINT, EXCLUSION_STORAGE_KEY, type GateState, type GateStatus, type GoalMatch, type HeldSlotMode, type InitTrackerArgs, type ItemOptions, type LoadScript, type ModeSnapshot, type PurchaseInput, type RefundInput, type ResolvedAutoCapture, type ResolvedItemCapture, type RevenueItem, type SlotMode, type SlotWithoutConsent, type SnippetScript, type TrackGoalOptions, type Tracker, type TrackerConfig, type TrackerExclusion, type TrackerGoal, type TrackerOptions, type TrackerSkip, type TrackerSlotConfig, type TrackerWindow, createTracker, initTracker };
|
package/dist/exports/types.d.ts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { CurrencyConverter } from "../goals/currency.js";
|
|
2
|
-
import { AdminDigest, CaptureClientKind, CaptureSlot, CaptureSnippet, GoalMatch, ResolvedAutoCapture, ResolvedItemCapture, SnippetScript, TrackerConfig, TrackerExclusion, TrackerGoal, TrackerSkip, TrackerSlotConfig } from "../tracker/config.js";
|
|
2
|
+
import { AdminDigest, CaptureClientKind, CaptureSlot, CaptureSnippet, ConsentPhase, GoalMatch, HeldSlotMode, ResolvedAutoCapture, ResolvedItemCapture, SlotMode, SlotWithoutConsent, SnippetScript, TrackerConfig, TrackerExclusion, TrackerGoal, TrackerSkip, TrackerSlotConfig, WithoutConsentLevel } from "../tracker/config.js";
|
|
3
3
|
import { Goal } from "../goals/types.js";
|
|
4
4
|
import { BrowserAmounts, OrderSignatureMode } from "../goals/match.js";
|
|
5
5
|
import { TrustedPlatform } from "../net/platform.js";
|
|
6
6
|
import { RouteBase, RoutePaths } from "../plugin/routes.js";
|
|
7
7
|
import { FetchInit, FetchLike } from "../core/fetch.js";
|
|
8
|
-
import { CaptureSupport, ProxyDescriptor, ProxyRoute, ProxyRouteKind } from "../core/capture.js";
|
|
8
|
+
import { CaptureSupport, CookielessSupport, ProxyDescriptor, ProxyRoute, ProxyRouteKind, SnippetArgs, SnippetMode } from "../core/capture.js";
|
|
9
9
|
import { AnalyticsCollectionOptions, CollectionOverrides } from "../core/collectionOption.js";
|
|
10
10
|
import { AdapterJobs, AnalyticsJobsOptions, AnalyticsTaskName, AnalyticsTaskOptions, ScheduledTask, TASK_NAMES } from "../core/jobs.js";
|
|
11
11
|
import { AnalyticsSdks, Ga4Client, Ga4ClientOptions, Ga4ReportResponse, Ga4ReportRow, Ga4Sdk, MaxmindReader, MaxmindSdk } from "../core/sdks.js";
|
|
12
|
-
import { HitType } from "../native/store/types.js";
|
|
12
|
+
import { HitMode, HitType } from "../native/store/types.js";
|
|
13
13
|
import { GOAL_ACTION_TYPE } from "../goals/constants.js";
|
|
14
14
|
import { RawEventInput } from "../native/ingest/normalizeEvent.js";
|
|
15
15
|
import { IngestHostnameResolver, ServerEventInput, ServerTrack, ServerTrackIdentity, ServerTrackOptions } from "../core/serverEvent.js";
|
|
@@ -33,7 +33,7 @@ import { TIMEFRAME_PRESETS, TimeframePreset } from "../timeframe/presets.js";
|
|
|
33
33
|
import { CacheEntry, CacheSetOptions, CacheStore, ReadRecipe, RecipeWindow } from "../surfacing/cacheStore.js";
|
|
34
34
|
import { CustomWidgetDef } from "../widgets/customWidget.js";
|
|
35
35
|
import { BUILT_IN_WIDGET_SLUGS, BuiltInWidgetSlug } from "../core/widgetSlugs.js";
|
|
36
|
-
import { AnalyticsAccessOptions, AnalyticsCacheCollectionOptions, AnalyticsCacheOptions, AnalyticsCaptureOptions, AnalyticsComponent, AnalyticsConcurrencyOptions, AnalyticsCountryFlags, AnalyticsCrossScopeOptions, AnalyticsExclusionOptions, AnalyticsGoalsCollectionOptions, AnalyticsGoalsOptions, AnalyticsHooksOptions, AnalyticsPluginOptions, AnalyticsReadAccess, AnalyticsRevenueOptions, AnalyticsRoutesOptions, AnalyticsScopeOptions, AnalyticsSyncCollectionOptions, AnalyticsSyncOptions, AnalyticsViewAccess, AnalyticsViewOptions, AnalyticsWarmOptions, AnalyticsWidgetOverride, AnalyticsWidgetOverrides, AnalyticsWidgetsOptions, AutoCaptureOptions, CaptureGate, CaptureGateArgs, CaptureSlotOption, CrossScopeAccess, CurrencyResolver, ExclusionSitesResolver, ItemCaptureOptions, ProviderHostsOptions, ProvidersCollectionOptions, ProvidersOptions, ProvidersResolve, ProvidersResolveArgs, ScopeCallSite, ScopeLabelResolver, ScopeListResolver, ScopeMemberAccess, ScopeResolver, TimezoneResolver } from "../core/options.js";
|
|
36
|
+
import { AnalyticsAccessOptions, AnalyticsCacheCollectionOptions, AnalyticsCacheOptions, AnalyticsCaptureOptions, AnalyticsComponent, AnalyticsConcurrencyOptions, AnalyticsCountryFlags, AnalyticsCrossScopeOptions, AnalyticsExclusionOptions, AnalyticsGoalsCollectionOptions, AnalyticsGoalsOptions, AnalyticsHooksOptions, AnalyticsPluginOptions, AnalyticsReadAccess, AnalyticsRevenueOptions, AnalyticsRoutesOptions, AnalyticsScopeOptions, AnalyticsSyncCollectionOptions, AnalyticsSyncOptions, AnalyticsViewAccess, AnalyticsViewOptions, AnalyticsWarmOptions, AnalyticsWidgetOverride, AnalyticsWidgetOverrides, AnalyticsWidgetsOptions, AutoCaptureOptions, CaptureGate, CaptureGateArgs, CaptureSlotOption, CrossScopeAccess, CurrencyResolver, ExclusionSitesResolver, ItemCaptureOptions, ProviderHostsOptions, ProvidersCollectionOptions, ProvidersOptions, ProvidersResolve, ProvidersResolveArgs, ScopeCallSite, ScopeLabelResolver, ScopeListResolver, ScopeMemberAccess, ScopeResolver, TimezoneResolver, WithoutConsentArgs, WithoutConsentFunction, WithoutConsentOption } from "../core/options.js";
|
|
37
37
|
import { SourcesNotice } from "../plugin/readContextForRequest.js";
|
|
38
38
|
import { SourcesResponse, WireSource } from "../fields/config/fetchSources.js";
|
|
39
39
|
import { FetchQueryInit, QueryRequest, RefreshRequest, RefreshResponse } from "../query/fetchQuery.js";
|
|
@@ -47,4 +47,4 @@ import { GoalActionDefinition, GoalActionRunArgs, TrackGoalActionOptions } from
|
|
|
47
47
|
import { TRAFFIC_CHANNELS, TrafficChannel } from "../native/ingest/source.js";
|
|
48
48
|
import { ParseResult, ParsedQuery } from "../query/parse.js";
|
|
49
49
|
import { ExclusionResponse, ExclusionSite } from "../view/exclusionLink.js";
|
|
50
|
-
export { ANALYTICS_ERROR_CODES, AdapterContext, type AdapterJobs, AdapterLabelArgs, type AdapterLabelOption, AdapterRegisterContext, AdapterSchemaContext, type AdminDigest, type AfterReadAnswer, type AfterReadArgs, type AfterReadHook, type AnalyticsAccessOptions, AnalyticsAdapter, AnalyticsAdapterFactory, type AnalyticsBinding, type AnalyticsCacheCollectionOptions, type AnalyticsCacheOptions, AnalyticsCapabilities, type AnalyticsCaptureOptions, type AnalyticsCollectionOptions, type AnalyticsComponent, type AnalyticsConcurrencyOptions, type AnalyticsCountryFlags, type AnalyticsCrossScopeOptions, type AnalyticsError, type AnalyticsErrorCode, type AnalyticsExclusionOptions, type AnalyticsFieldsOptions, AnalyticsFilter, type AnalyticsGoalsCollectionOptions, type AnalyticsGoalsOptions, type AnalyticsHooksOptions, type AnalyticsJobsOptions, type AnalyticsMetricLabel, type AnalyticsMetricLabels, type AnalyticsPluginOptions, AnalyticsQuery, type AnalyticsReadAccess, AnalyticsResult, type AnalyticsRevenueOptions, type AnalyticsRoutesOptions, AnalyticsRow, type AnalyticsScopeOptions, type AnalyticsSdks, type AnalyticsSourceOptions, type AnalyticsStatBaseOptions, type AnalyticsStatOptions, type AnalyticsStatRowOptions, type AnalyticsSyncCollectionOptions, type AnalyticsSyncOptions, type AnalyticsTabOptions, type AnalyticsTaskName, type AnalyticsTaskOptions, type AnalyticsViewAccess, type AnalyticsViewClientProps, type AnalyticsViewOptions, type AnalyticsWarmOptions, type AnalyticsWidgetOverride, type AnalyticsWidgetOverrides, type AnalyticsWidgetsOptions, type AutoCaptureOptions, BUILT_IN_WIDGET_SLUGS, type BindingContext, type BindingDoc, type BrowserAmounts, type BuiltInWidgetSlug, type CacheEntry, type CacheSetOptions, type CacheStore, type CapabilityRequirement, type CaptureClientKind, type CaptureGate, type CaptureGateArgs, type CaptureSlot, type CaptureSlotOption, type CaptureSnippet, CaptureSupport, type CollectionFieldOverride, type CollectionOverrides, type ConnectionAccess, type ConnectionFieldAccess, type CountryFlagProps, type CountryFlags, type CrossScopeAccess, type CurrencyConverter, type CurrencyResolver, type CustomWidgetDef, DIMENSION_KEYS, DateRange, type DefaultSourceFunction, type DefaultSourceRule, DimensionKey, type ExclusionResponse, type ExclusionSite, type ExclusionSitesResolver, FILTER_OPERATORS, type FetchInit, type FetchLike, type FetchQueryInit, FilterOperator, FilterOperatorMap, type FilterPair, GOAL_ACTION_TYPE, type Ga4Client, type Ga4ClientOptions, type Ga4ReportResponse, type Ga4ReportRow, type Ga4Sdk, type Goal, type GoalActionDefinition, type GoalActionRunArgs, type GoalCollectionFieldOverrides, type GoalFieldOptions, type GoalFieldOverride, type GoalMatch, Granularity, type HitType, type HostCountryFlag, type HostPattern, type HostnameResolver, type IngestHostnameResolver, type ItemCaptureOptions, type ItemLabels, type MaxmindReader, type MaxmindSdk, MetricKey, MetricReach, MetricSemantics, MetricValue, MetricValues, type OrderSignatureMode, type OwnSource, PLATFORM_SCOPE, type ParseResult, type ParsedQuery, type PathResolver, type PluralCategory, type PluralName, type PluralVariant, type ProviderCollectionFieldOverrides, type ProviderFieldOverride, type ProviderHostPolicy, type ProviderHostsOptions, type ProviderId, type ProvidersCollectionOptions, type ProvidersOptions, type ProvidersResolve, type ProvidersResolveArgs, ProxyDescriptor, ProxyRoute, ProxyRouteKind, type QueryError, type QueryErrorCode, type QueryErrorResponse, type QueryRequest, type QueryResponse, type QuerySourceRef, RateLimitDescriptor, type RawEventInput, type ReadOrigin, type ReadRecipe, type RecipeWindow, type RefreshRequest, type RefreshResponse, type ReportMode, type ReportOption, type ResolvedAutoCapture, type ResolvedItemCapture, type RouteBase, type RoutePaths, type ScheduledTask, type ScopeCallSite, type ScopeLabelResolver, type ScopeListResolver, type ScopeMemberAccess, type ScopeResolver, type SerializedAnalyticsQuery, type SerializedCapabilities, type ServerEventInput, type ServerTrack, type ServerTrackIdentity, type ServerTrackOptions, type SingularKey, type SnippetScript, SourceErrorKind, type SourcePolicy, type SourcePolicyFunction, type SourceRef, type SourcesNotice, type SourcesResponse, type TASK_NAMES, TIMEFRAME_PRESETS, TRAFFIC_CHANNELS, type TimeframePreset, type TimezoneResolver, type TrackGoalActionOptions, type TrackerConfig, type TrackerExclusion, type TrackerGoal, type TrackerSkip, type TrackerSlotConfig, type TrafficChannel, type TranslationKey, type TranslationsOption, type TrustedPlatform, type ViewEndpoints, type ViewGoal, type ViewScopes, VisitorCounting, type WidgetView, type WidgetViewProps, type WireSource, keys, pluralKeys, readErrorCode };
|
|
50
|
+
export { ANALYTICS_ERROR_CODES, AdapterContext, type AdapterJobs, AdapterLabelArgs, type AdapterLabelOption, AdapterRegisterContext, AdapterSchemaContext, type AdminDigest, type AfterReadAnswer, type AfterReadArgs, type AfterReadHook, type AnalyticsAccessOptions, AnalyticsAdapter, AnalyticsAdapterFactory, type AnalyticsBinding, type AnalyticsCacheCollectionOptions, type AnalyticsCacheOptions, AnalyticsCapabilities, type AnalyticsCaptureOptions, type AnalyticsCollectionOptions, type AnalyticsComponent, type AnalyticsConcurrencyOptions, type AnalyticsCountryFlags, type AnalyticsCrossScopeOptions, type AnalyticsError, type AnalyticsErrorCode, type AnalyticsExclusionOptions, type AnalyticsFieldsOptions, AnalyticsFilter, type AnalyticsGoalsCollectionOptions, type AnalyticsGoalsOptions, type AnalyticsHooksOptions, type AnalyticsJobsOptions, type AnalyticsMetricLabel, type AnalyticsMetricLabels, type AnalyticsPluginOptions, AnalyticsQuery, type AnalyticsReadAccess, AnalyticsResult, type AnalyticsRevenueOptions, type AnalyticsRoutesOptions, AnalyticsRow, type AnalyticsScopeOptions, type AnalyticsSdks, type AnalyticsSourceOptions, type AnalyticsStatBaseOptions, type AnalyticsStatOptions, type AnalyticsStatRowOptions, type AnalyticsSyncCollectionOptions, type AnalyticsSyncOptions, type AnalyticsTabOptions, type AnalyticsTaskName, type AnalyticsTaskOptions, type AnalyticsViewAccess, type AnalyticsViewClientProps, type AnalyticsViewOptions, type AnalyticsWarmOptions, type AnalyticsWidgetOverride, type AnalyticsWidgetOverrides, type AnalyticsWidgetsOptions, type AutoCaptureOptions, BUILT_IN_WIDGET_SLUGS, type BindingContext, type BindingDoc, type BrowserAmounts, type BuiltInWidgetSlug, type CacheEntry, type CacheSetOptions, type CacheStore, type CapabilityRequirement, type CaptureClientKind, type CaptureGate, type CaptureGateArgs, type CaptureSlot, type CaptureSlotOption, type CaptureSnippet, CaptureSupport, type CollectionFieldOverride, type CollectionOverrides, type ConnectionAccess, type ConnectionFieldAccess, type ConsentPhase, CookielessSupport, type CountryFlagProps, type CountryFlags, type CrossScopeAccess, type CurrencyConverter, type CurrencyResolver, type CustomWidgetDef, DIMENSION_KEYS, DateRange, type DefaultSourceFunction, type DefaultSourceRule, DimensionKey, type ExclusionResponse, type ExclusionSite, type ExclusionSitesResolver, FILTER_OPERATORS, type FetchInit, type FetchLike, type FetchQueryInit, FilterOperator, FilterOperatorMap, type FilterPair, GOAL_ACTION_TYPE, type Ga4Client, type Ga4ClientOptions, type Ga4ReportResponse, type Ga4ReportRow, type Ga4Sdk, type Goal, type GoalActionDefinition, type GoalActionRunArgs, type GoalCollectionFieldOverrides, type GoalFieldOptions, type GoalFieldOverride, type GoalMatch, Granularity, type HeldSlotMode, type HitMode, type HitType, type HostCountryFlag, type HostPattern, type HostnameResolver, type IngestHostnameResolver, type ItemCaptureOptions, type ItemLabels, type MaxmindReader, type MaxmindSdk, MetricKey, MetricReach, MetricSemantics, MetricValue, MetricValues, type OrderSignatureMode, type OwnSource, PLATFORM_SCOPE, type ParseResult, type ParsedQuery, type PathResolver, type PluralCategory, type PluralName, type PluralVariant, type ProviderCollectionFieldOverrides, type ProviderFieldOverride, type ProviderHostPolicy, type ProviderHostsOptions, type ProviderId, type ProvidersCollectionOptions, type ProvidersOptions, type ProvidersResolve, type ProvidersResolveArgs, ProxyDescriptor, ProxyRoute, ProxyRouteKind, type QueryError, type QueryErrorCode, type QueryErrorResponse, type QueryRequest, type QueryResponse, type QuerySourceRef, RateLimitDescriptor, type RawEventInput, type ReadOrigin, type ReadRecipe, type RecipeWindow, type RefreshRequest, type RefreshResponse, type ReportMode, type ReportOption, type ResolvedAutoCapture, type ResolvedItemCapture, type RouteBase, type RoutePaths, type ScheduledTask, type ScopeCallSite, type ScopeLabelResolver, type ScopeListResolver, type ScopeMemberAccess, type ScopeResolver, type SerializedAnalyticsQuery, type SerializedCapabilities, type ServerEventInput, type ServerTrack, type ServerTrackIdentity, type ServerTrackOptions, type SingularKey, type SlotMode, type SlotWithoutConsent, SnippetArgs, SnippetMode, type SnippetScript, SourceErrorKind, type SourcePolicy, type SourcePolicyFunction, type SourceRef, type SourcesNotice, type SourcesResponse, type TASK_NAMES, TIMEFRAME_PRESETS, TRAFFIC_CHANNELS, type TimeframePreset, type TimezoneResolver, type TrackGoalActionOptions, type TrackerConfig, type TrackerExclusion, type TrackerGoal, type TrackerSkip, type TrackerSlotConfig, type TrafficChannel, type TranslationKey, type TranslationsOption, type TrustedPlatform, type ViewEndpoints, type ViewGoal, type ViewScopes, VisitorCounting, type WidgetView, type WidgetViewProps, type WireSource, type WithoutConsentArgs, type WithoutConsentFunction, type WithoutConsentLevel, type WithoutConsentOption, keys, pluralKeys, readErrorCode };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { CurrencyConverter } from "./goals/currency.js";
|
|
2
|
-
import { CaptureClientKind, CaptureSlot, CaptureSnippet, GoalMatch, RevenueItem, SnippetScript, TrackerGoal, TrackerSlotConfig } from "./tracker/config.js";
|
|
2
|
+
import { CaptureClientKind, CaptureSlot, CaptureSnippet, ConsentPhase, GoalMatch, HeldSlotMode, RevenueItem, SlotMode, SlotWithoutConsent, SnippetScript, TrackerGoal, TrackerSlotConfig, WithoutConsentLevel } from "./tracker/config.js";
|
|
3
3
|
import { Goal } from "./goals/types.js";
|
|
4
4
|
import { BrowserAmounts, OrderSignatureMode } from "./goals/match.js";
|
|
5
5
|
import { TrustedPlatform } from "./net/platform.js";
|
|
6
6
|
import { DEFAULT_ROUTE_BASE, RouteBase, RoutePaths, RoutesConfigSource, analyticsRoutes, routePaths } from "./plugin/routes.js";
|
|
7
7
|
import { FetchInit, FetchLike } from "./core/fetch.js";
|
|
8
|
-
import { CaptureSupport, ProxyDescriptor, ProxyRoute, ProxyRouteKind } from "./core/capture.js";
|
|
8
|
+
import { CaptureSupport, CookielessSupport, ProxyDescriptor, ProxyRoute, ProxyRouteKind, SnippetArgs, SnippetMode } from "./core/capture.js";
|
|
9
9
|
import { AnalyticsCollectionOptions, CollectionOverrides } from "./core/collectionOption.js";
|
|
10
10
|
import { AdapterJobs, AnalyticsJobsOptions, AnalyticsTaskName, AnalyticsTaskOptions, ScheduledTask, TASK_NAMES } from "./core/jobs.js";
|
|
11
11
|
import { AnalyticsSdks, Ga4Client, Ga4ClientOptions, Ga4ReportResponse, Ga4ReportRow, Ga4Sdk, MaxmindReader, MaxmindSdk } from "./core/sdks.js";
|
|
12
|
-
import { HitType } from "./native/store/types.js";
|
|
12
|
+
import { HitMode, HitType } from "./native/store/types.js";
|
|
13
13
|
import { CURRENCY_ATTRIBUTE, EVENT_ATTRIBUTE, EVENT_PROP_PREFIX, GOAL_ACTION_TYPE, GOAL_ATTRIBUTE, ITEM_ATTRIBUTE, ITEM_CLICK_EVENT, ITEM_NAME_ATTRIBUTE, MAX_ITEMS_PER_BEACON, PURCHASE_GOAL_SLUG, VALUE_ATTRIBUTE } from "./goals/constants.js";
|
|
14
14
|
import { AnalyticsAttributes } from "./exports/attributes.js";
|
|
15
15
|
import { ItemSignatureMode, itemAttributesFor, signItemRef } from "./native/ingest/itemSignature.js";
|
|
@@ -38,7 +38,7 @@ import { TIMEFRAME_PRESETS, TimeframePreset } from "./timeframe/presets.js";
|
|
|
38
38
|
import { CacheEntry, CacheSetOptions, CacheStore, ReadRecipe, RecipeWindow } from "./surfacing/cacheStore.js";
|
|
39
39
|
import { CustomWidgetDef } from "./widgets/customWidget.js";
|
|
40
40
|
import { BUILT_IN_WIDGET_SLUGS, BuiltInWidgetSlug } from "./core/widgetSlugs.js";
|
|
41
|
-
import { AnalyticsAccessOptions, AnalyticsCacheCollectionOptions, AnalyticsCacheOptions, AnalyticsCaptureOptions, AnalyticsComponent, AnalyticsConcurrencyOptions, AnalyticsCountryFlags, AnalyticsCrossScopeOptions, AnalyticsExclusionOptions, AnalyticsGoalsCollectionOptions, AnalyticsGoalsOptions, AnalyticsHooksOptions, AnalyticsPluginOptions, AnalyticsReadAccess, AnalyticsRevenueOptions, AnalyticsRoutesOptions, AnalyticsScopeOptions, AnalyticsSyncCollectionOptions, AnalyticsSyncOptions, AnalyticsViewAccess, AnalyticsViewOptions, AnalyticsWarmOptions, AnalyticsWidgetOverride, AnalyticsWidgetOverrides, AnalyticsWidgetsOptions, AutoCaptureOptions, CaptureGate, CaptureGateArgs, CaptureSlotOption, CrossScopeAccess, CurrencyResolver, ExclusionSitesResolver, ItemCaptureOptions, ProviderHostsOptions, ProvidersCollectionOptions, ProvidersOptions, ProvidersResolve, ProvidersResolveArgs, ScopeCallSite, ScopeLabelResolver, ScopeListResolver, ScopeMemberAccess, ScopeResolver, TimezoneResolver } from "./core/options.js";
|
|
41
|
+
import { AnalyticsAccessOptions, AnalyticsCacheCollectionOptions, AnalyticsCacheOptions, AnalyticsCaptureOptions, AnalyticsComponent, AnalyticsConcurrencyOptions, AnalyticsCountryFlags, AnalyticsCrossScopeOptions, AnalyticsExclusionOptions, AnalyticsGoalsCollectionOptions, AnalyticsGoalsOptions, AnalyticsHooksOptions, AnalyticsPluginOptions, AnalyticsReadAccess, AnalyticsRevenueOptions, AnalyticsRoutesOptions, AnalyticsScopeOptions, AnalyticsSyncCollectionOptions, AnalyticsSyncOptions, AnalyticsViewAccess, AnalyticsViewOptions, AnalyticsWarmOptions, AnalyticsWidgetOverride, AnalyticsWidgetOverrides, AnalyticsWidgetsOptions, AutoCaptureOptions, CaptureGate, CaptureGateArgs, CaptureSlotOption, CrossScopeAccess, CurrencyResolver, ExclusionSitesResolver, ItemCaptureOptions, ProviderHostsOptions, ProvidersCollectionOptions, ProvidersOptions, ProvidersResolve, ProvidersResolveArgs, ScopeCallSite, ScopeLabelResolver, ScopeListResolver, ScopeMemberAccess, ScopeResolver, TimezoneResolver, WithoutConsentArgs, WithoutConsentFunction, WithoutConsentOption } from "./core/options.js";
|
|
42
42
|
import { GoalSource } from "./goals/resolver.js";
|
|
43
43
|
import { GoalsResponse, WireGoal } from "./goals/fetchGoals.js";
|
|
44
44
|
import { ReadNotices } from "./widgets/readMeta.js";
|
|
@@ -80,5 +80,5 @@ declare module 'payload' {
|
|
|
80
80
|
}
|
|
81
81
|
declare const analytics: (options: AnalyticsPluginOptions) => import("payload").Plugin;
|
|
82
82
|
//#endregion
|
|
83
|
-
export { ANALYTICS_ERROR_CODES, type AdapterContext, type AdapterJobs, type AdapterLabelArgs, type AdapterLabelOption, type AdapterRegisterContext, type AdapterSchemaContext, type AfterReadAnswer, type AfterReadArgs, type AfterReadHook, type AnalyticsAccessOptions, type AnalyticsAdapter, type AnalyticsAttributes, type AnalyticsBinding, type AnalyticsCacheCollectionOptions, type AnalyticsCacheOptions, type AnalyticsCapabilities, type AnalyticsCaptureOptions, type AnalyticsCollectionOptions, type AnalyticsComponent, type AnalyticsConcurrencyOptions, type AnalyticsCountryFlags, type AnalyticsCrossScopeOptions, type AnalyticsDefaultLayoutOptions, type AnalyticsError, type AnalyticsErrorCode, type AnalyticsExclusionOptions, type AnalyticsFieldsOptions, type AnalyticsFilter, type AnalyticsGoalsCollectionOptions, type AnalyticsGoalsOptions, type AnalyticsHooksOptions, type AnalyticsJobsOptions, type AnalyticsLinkFieldsOptions, type AnalyticsMetricLabel, type AnalyticsMetricLabels, type AnalyticsPluginOptions, type AnalyticsQuery, type AnalyticsReadAccess, type AnalyticsResult, type AnalyticsRevenueOptions, type AnalyticsRoutesOptions, type AnalyticsRow, type AnalyticsScopeOptions, type AnalyticsSdks, type AnalyticsSourceOptions, type AnalyticsStatBaseOptions, type AnalyticsStatOptions, type AnalyticsStatRowOptions, type AnalyticsSyncCollectionOptions, type AnalyticsSyncOptions, type AnalyticsTabOptions, type AnalyticsTaskName, type AnalyticsTaskOptions, AnalyticsTrackError, type AnalyticsViewAccess, type AnalyticsViewOptions, type AnalyticsWarmOptions, type AnalyticsWidgetOverride, type AnalyticsWidgetOverrides, type AnalyticsWidgetsOptions, type AutoCaptureOptions, BUILT_IN_WIDGET_SLUGS, type BindingContext, type BindingDoc, type BreakdownRow, type BrowserAmounts, type BuildSecretField, type BuiltInWidgetSlug, CACHE_SLUG, CONNECTION_PATHS, CURRENCY_ATTRIBUTE, type CacheEntry, type CacheSetOptions, type CacheStore, type CapabilityRequirement, type CaptureClientKind, type CaptureGate, type CaptureGateArgs, type CaptureSlot, type CaptureSlotOption, type CaptureSnippet, type CaptureSupport, type CollectionFieldOverride, type CollectionOverrides, type ConnectionAccess, type ConnectionFieldAccess, type CrossScopeAccess, type CurrencyConverter, type CurrencyResolver, type CustomWidgetDef, DEFAULT_ROUTE_BASE, type DIMENSION_KEYS, type DateRange, type DefaultSourceFunction, type DefaultSourceRule, type DimensionKey, EVENT_ATTRIBUTE, EVENT_PROP_PREFIX, type ExclusionSitesResolver, type FILTER_OPERATORS, type FetchInit, type FetchLike, type FieldBreakdown, type FieldBreakdownRow, type FieldReadResult, type FieldReadStatus, type FilterOperator, type FilterOperatorMap, type FilterPair, GOALS_SLUG, GOAL_ACTION_TYPE, GOAL_ATTRIBUTE, type Ga4Client, type Ga4ClientOptions, type Ga4ReportResponse, type Ga4ReportRow, type Ga4Sdk, type GatedScope, type Goal, type GoalActionDefinition, type GoalActionRunArgs, type GoalCollectionFieldOverrides, type GoalFieldOptions, type GoalFieldOverride, type GoalMatch, type GoalRow, type GoalSource, type GoalsResponse, type Granularity, type GuardedFetch, type GuardedFetchOptions, type HitType, type HostPattern, type HostnameResolver, ITEM_ATTRIBUTE, ITEM_CLICK_EVENT, ITEM_NAME_ATTRIBUTE, type IngestHostnameResolver, type ItemCaptureOptions, type ItemLabels, type ItemSignatureMode, MAX_ITEMS_PER_BEACON, type MaxmindReader, type MaxmindSdk, type MetricKey, type MetricReach, type MetricSemantics, type MetricValue, type MetricValues, type OrderSignatureMode, type OwnSource, PLATFORM_SCOPE, PROVIDERS_SLUG, PROVIDER_IDS, PURCHASE_GOAL_SLUG, type PathResolver, type AnalyticsPluginOptions as PluginOptions, type PluralCategory, type PluralName, type PluralVariant, type ProviderCollectionFieldOverrides, type ProviderDoc, type ProviderFactoryContext, type ProviderFieldOverride, type ProviderFieldsOptions, type ProviderHostPolicy, type ProviderHostsOptions, ProviderHttpError, type ProviderId, type ProvidersCollectionOptions, type ProvidersOptions, type ProvidersResolve, type ProvidersResolveArgs, type ProxyDescriptor, type ProxyRoute, type ProxyRouteKind, type QueryError, type QueryErrorCode, type QueryErrorResponse, type QueryResponse, type QuerySourceRef, type RateLimitDescriptor, type RawEventInput, type ReadForFieldArgs, type ReadForWidgetArgs, type ReadForWidgetBreakdownArgs, type ReadForWidgetGoalsArgs, type ReadForWidgetRealtimeArgs, type ReadForWidgetSeriesArgs, type ReadNotices, type ReadOrigin, type ReadPrincipal, type ReadRecipe, type RealtimePoint, type RebuildDaysInput, type RebuildDaysReport, type RecipeWindow, type RefreshProvidersOptions, type ReportMode, type ReportOption, type RevenueItem, type RouteBase, type RoutePaths, type RoutesConfigSource, SECRET_PATHS, STATE_SLUG, SYNC_SLUG, SYSTEM, type ScheduledTask, type ScopeCallSite, type ScopeLabelResolver, type ScopeListResolver, type ScopeMemberAccess, type ScopeResolver, type SerializedAnalyticsQuery, type SerializedCapabilities, type SeriesGranularity, type SeriesPoint, type ServerEventInput, type PurchaseInput as ServerPurchaseInput, type RefundInput as ServerRefundInput, type ServerTrack, type ServerTrackIdentity, type ServerTrackOptions, type SingularKey, type SnippetScript, type SourceErrorKind, type SourcePolicy, type SourcePolicyFunction, type SourceRef, type StoredSourceRead, type SubstitutedSource, type TASK_NAMES, TIMEFRAME_PRESETS, type TenantMembershipOptions, type TimeframePreset, type TimezoneResolver, type TrackGoalActionOptions, type TrackerGoal, type TrackerSlotConfig, type TranslationKey, type TranslationsOption, type TrustedPlatform, VALUE_ATTRIBUTE, type VisitorCounting, type WidgetBreakdownResult, type WidgetFilter, type WidgetGoalsResult, type WidgetReadResult, type WidgetReadStatus, type WidgetRealtimeResult, type WidgetRealtimeStatus, type WidgetSeriesResult, type WireGoal, adapterFromProviderDoc, analytics, analyticsDefaultLayout, analyticsDefaultWidgets, analyticsError, analyticsFields, analyticsLinkFields, analyticsProviderFields, analyticsRoutes, analyticsStat, analyticsStatRow, analyticsTab, analyticsTabsField, createGuardedFetch, goalField, goalSlug, isAdminUser, itemAttributesFor, keys, parseRetryAfter, pluralKeys, purchase, readErrorCode, readForField, readForWidget, readForWidgetBreakdown, readForWidgetGoals, readForWidgetRealtime, readForWidgetSeries, rebuildDays, refreshProviders, refund, resolveHostPolicy, routePaths, signItemRef, signOrderId, tenantMembership, trackGoalAction, trackServerEvent, widgetFilters };
|
|
83
|
+
export { ANALYTICS_ERROR_CODES, type AdapterContext, type AdapterJobs, type AdapterLabelArgs, type AdapterLabelOption, type AdapterRegisterContext, type AdapterSchemaContext, type AfterReadAnswer, type AfterReadArgs, type AfterReadHook, type AnalyticsAccessOptions, type AnalyticsAdapter, type AnalyticsAttributes, type AnalyticsBinding, type AnalyticsCacheCollectionOptions, type AnalyticsCacheOptions, type AnalyticsCapabilities, type AnalyticsCaptureOptions, type AnalyticsCollectionOptions, type AnalyticsComponent, type AnalyticsConcurrencyOptions, type AnalyticsCountryFlags, type AnalyticsCrossScopeOptions, type AnalyticsDefaultLayoutOptions, type AnalyticsError, type AnalyticsErrorCode, type AnalyticsExclusionOptions, type AnalyticsFieldsOptions, type AnalyticsFilter, type AnalyticsGoalsCollectionOptions, type AnalyticsGoalsOptions, type AnalyticsHooksOptions, type AnalyticsJobsOptions, type AnalyticsLinkFieldsOptions, type AnalyticsMetricLabel, type AnalyticsMetricLabels, type AnalyticsPluginOptions, type AnalyticsQuery, type AnalyticsReadAccess, type AnalyticsResult, type AnalyticsRevenueOptions, type AnalyticsRoutesOptions, type AnalyticsRow, type AnalyticsScopeOptions, type AnalyticsSdks, type AnalyticsSourceOptions, type AnalyticsStatBaseOptions, type AnalyticsStatOptions, type AnalyticsStatRowOptions, type AnalyticsSyncCollectionOptions, type AnalyticsSyncOptions, type AnalyticsTabOptions, type AnalyticsTaskName, type AnalyticsTaskOptions, AnalyticsTrackError, type AnalyticsViewAccess, type AnalyticsViewOptions, type AnalyticsWarmOptions, type AnalyticsWidgetOverride, type AnalyticsWidgetOverrides, type AnalyticsWidgetsOptions, type AutoCaptureOptions, BUILT_IN_WIDGET_SLUGS, type BindingContext, type BindingDoc, type BreakdownRow, type BrowserAmounts, type BuildSecretField, type BuiltInWidgetSlug, CACHE_SLUG, CONNECTION_PATHS, CURRENCY_ATTRIBUTE, type CacheEntry, type CacheSetOptions, type CacheStore, type CapabilityRequirement, type CaptureClientKind, type CaptureGate, type CaptureGateArgs, type CaptureSlot, type CaptureSlotOption, type CaptureSnippet, type CaptureSupport, type CollectionFieldOverride, type CollectionOverrides, type ConnectionAccess, type ConnectionFieldAccess, type ConsentPhase, type CookielessSupport, type CrossScopeAccess, type CurrencyConverter, type CurrencyResolver, type CustomWidgetDef, DEFAULT_ROUTE_BASE, type DIMENSION_KEYS, type DateRange, type DefaultSourceFunction, type DefaultSourceRule, type DimensionKey, EVENT_ATTRIBUTE, EVENT_PROP_PREFIX, type ExclusionSitesResolver, type FILTER_OPERATORS, type FetchInit, type FetchLike, type FieldBreakdown, type FieldBreakdownRow, type FieldReadResult, type FieldReadStatus, type FilterOperator, type FilterOperatorMap, type FilterPair, GOALS_SLUG, GOAL_ACTION_TYPE, GOAL_ATTRIBUTE, type Ga4Client, type Ga4ClientOptions, type Ga4ReportResponse, type Ga4ReportRow, type Ga4Sdk, type GatedScope, type Goal, type GoalActionDefinition, type GoalActionRunArgs, type GoalCollectionFieldOverrides, type GoalFieldOptions, type GoalFieldOverride, type GoalMatch, type GoalRow, type GoalSource, type GoalsResponse, type Granularity, type GuardedFetch, type GuardedFetchOptions, type HeldSlotMode, type HitMode, type HitType, type HostPattern, type HostnameResolver, ITEM_ATTRIBUTE, ITEM_CLICK_EVENT, ITEM_NAME_ATTRIBUTE, type IngestHostnameResolver, type ItemCaptureOptions, type ItemLabels, type ItemSignatureMode, MAX_ITEMS_PER_BEACON, type MaxmindReader, type MaxmindSdk, type MetricKey, type MetricReach, type MetricSemantics, type MetricValue, type MetricValues, type OrderSignatureMode, type OwnSource, PLATFORM_SCOPE, PROVIDERS_SLUG, PROVIDER_IDS, PURCHASE_GOAL_SLUG, type PathResolver, type AnalyticsPluginOptions as PluginOptions, type PluralCategory, type PluralName, type PluralVariant, type ProviderCollectionFieldOverrides, type ProviderDoc, type ProviderFactoryContext, type ProviderFieldOverride, type ProviderFieldsOptions, type ProviderHostPolicy, type ProviderHostsOptions, ProviderHttpError, type ProviderId, type ProvidersCollectionOptions, type ProvidersOptions, type ProvidersResolve, type ProvidersResolveArgs, type ProxyDescriptor, type ProxyRoute, type ProxyRouteKind, type QueryError, type QueryErrorCode, type QueryErrorResponse, type QueryResponse, type QuerySourceRef, type RateLimitDescriptor, type RawEventInput, type ReadForFieldArgs, type ReadForWidgetArgs, type ReadForWidgetBreakdownArgs, type ReadForWidgetGoalsArgs, type ReadForWidgetRealtimeArgs, type ReadForWidgetSeriesArgs, type ReadNotices, type ReadOrigin, type ReadPrincipal, type ReadRecipe, type RealtimePoint, type RebuildDaysInput, type RebuildDaysReport, type RecipeWindow, type RefreshProvidersOptions, type ReportMode, type ReportOption, type RevenueItem, type RouteBase, type RoutePaths, type RoutesConfigSource, SECRET_PATHS, STATE_SLUG, SYNC_SLUG, SYSTEM, type ScheduledTask, type ScopeCallSite, type ScopeLabelResolver, type ScopeListResolver, type ScopeMemberAccess, type ScopeResolver, type SerializedAnalyticsQuery, type SerializedCapabilities, type SeriesGranularity, type SeriesPoint, type ServerEventInput, type PurchaseInput as ServerPurchaseInput, type RefundInput as ServerRefundInput, type ServerTrack, type ServerTrackIdentity, type ServerTrackOptions, type SingularKey, type SlotMode, type SlotWithoutConsent, type SnippetArgs, type SnippetMode, type SnippetScript, type SourceErrorKind, type SourcePolicy, type SourcePolicyFunction, type SourceRef, type StoredSourceRead, type SubstitutedSource, type TASK_NAMES, TIMEFRAME_PRESETS, type TenantMembershipOptions, type TimeframePreset, type TimezoneResolver, type TrackGoalActionOptions, type TrackerGoal, type TrackerSlotConfig, type TranslationKey, type TranslationsOption, type TrustedPlatform, VALUE_ATTRIBUTE, type VisitorCounting, type WidgetBreakdownResult, type WidgetFilter, type WidgetGoalsResult, type WidgetReadResult, type WidgetReadStatus, type WidgetRealtimeResult, type WidgetRealtimeStatus, type WidgetSeriesResult, type WireGoal, type WithoutConsentArgs, type WithoutConsentFunction, type WithoutConsentLevel, type WithoutConsentOption, adapterFromProviderDoc, analytics, analyticsDefaultLayout, analyticsDefaultWidgets, analyticsError, analyticsFields, analyticsLinkFields, analyticsProviderFields, analyticsRoutes, analyticsStat, analyticsStatRow, analyticsTab, analyticsTabsField, createGuardedFetch, goalField, goalSlug, isAdminUser, itemAttributesFor, keys, parseRetryAfter, pluralKeys, purchase, readErrorCode, readForField, readForWidget, readForWidgetBreakdown, readForWidgetGoals, readForWidgetRealtime, readForWidgetSeries, rebuildDays, refreshProviders, refund, resolveHostPolicy, routePaths, signItemRef, signOrderId, tenantMembership, trackGoalAction, trackServerEvent, widgetFilters };
|
|
84
84
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.js
CHANGED
|
@@ -26,6 +26,7 @@ import { resolveHostPolicy } from "./providers/hosts.js";
|
|
|
26
26
|
import { PROVIDER_IDS, adapterFromProviderDoc } from "./providers/factory.js";
|
|
27
27
|
import { CONNECTION_PATHS, SECRET_PATHS } from "./providers/secrets.js";
|
|
28
28
|
import { PROVIDERS_SLUG, analyticsProviderFields } from "./providers/collection.js";
|
|
29
|
+
import { adapterCountsWithoutConsent } from "./core/captureOptions.js";
|
|
29
30
|
import { applyConfigRevenueVisibility } from "./goals/moneyFields.js";
|
|
30
31
|
import { GOALS_SLUG } from "./goals/collection.js";
|
|
31
32
|
import { resolveOptions } from "./core/options.js";
|
|
@@ -191,6 +192,7 @@ const analytics = definePlugin({
|
|
|
191
192
|
trustedProxyHops: resolved.trustedProxyHops,
|
|
192
193
|
trustedPlatform: resolved.trustedPlatform,
|
|
193
194
|
allowedOrigins: resolved.capture.allowedOrigins,
|
|
195
|
+
adapterCountsWithoutConsent: adapterCountsWithoutConsent(resolved, adapter),
|
|
194
196
|
...itemCollections.size > 0 ? { items: {
|
|
195
197
|
collections: itemCollections,
|
|
196
198
|
pages: resolved.capture.autoCapture.items.pages
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../src/index.ts"],"sourcesContent":["import { type Config, definePlugin, type Endpoint, type PayloadRequest } from 'payload'\n\nimport { itemCollectionsOf } from './binding/report'\nimport { captureRequest } from './capture/captureRequest'\nimport { makeExclusionHandler } from './capture/exclusionEndpoint'\nimport { proxyEndpoints } from './capture/proxyEndpoint'\nimport { trackerEndpoint } from './capture/trackerEndpoint'\nimport { assertMaintainRegistered, TASK_SLUGS } from './core/jobs'\nimport { type AnalyticsPluginOptions, resolveOptions, type ScopeCallSite } from './core/options'\nimport { createRegistry, withoutRevenue } from './core/registry'\nimport { CURRENCY_PATTERN } from './goals/currency'\nimport { makeGoalsHandler } from './goals/goalsEndpoint'\nimport { applyConfigRevenueVisibility } from './goals/moneyFields'\nimport { configGoalsResolver } from './goals/resolver'\nimport type { Goal } from './goals/types'\nimport { addComponentDependency, FLAG_DEPENDENCY } from './plugin/adminDependencies'\nimport { expectedCollections } from './plugin/collectionChecks'\nimport { createRuntimeFactory } from './plugin/createRuntime'\nimport { makeDocumentHandler } from './plugin/documentEndpoint'\nimport { makeFlagsHandler } from './plugin/flagsEndpoint'\nimport { restrictJobControls } from './plugin/jobsAccess'\nimport {\n\taddStateCollection,\n\ttype CollectionContext,\n\tcacheCollectionOf,\n\tconfigCollections,\n\tsyncCollectionOf,\n} from './plugin/pluginCollections'\nimport { makeQueryHandler } from './plugin/queryEndpoint'\nimport { makeRealtimeHandler } from './plugin/realtimeEndpoint'\nimport { makeRefreshHandler } from './plugin/refreshEndpoint'\nimport { registerTranslations } from './plugin/registerTranslations'\nimport { relabelFactoryFields } from './plugin/relabelFields'\nimport { assertRoutesReachable } from './plugin/routeChecks'\nimport {\n\tANALYTICS_CONFIG_KEY,\n\ttype AnalyticsAdminCustom,\n\tpluginEndpoint,\n\troutePaths,\n} from './plugin/routes'\nimport { getRuntime, resolveGoalsFor, resolveRegistryFor, runtimeFactoryOf } from './plugin/runtime'\nimport { addTask, schemaOnly } from './plugin/schemaOnly'\nimport { changedScopes, type ScopeChange } from './plugin/scopeChange'\nimport { makeSourcesHandler } from './plugin/sourcesEndpoint'\nimport { fillUnbundledLanguages, unbundledLanguages } from './plugin/unbundledLanguages'\nimport { warmTask } from './plugin/warmTask'\nimport { syncTask } from './sync/syncTask'\nimport { createStrictTimezoneResolver, createTimezoneResolver } from './timeframe/reportingTimezone'\nimport { keys } from './translations/keys'\nimport { createStaticLabels } from './translations/staticLabel'\nimport { registerView } from './view/registerView'\nimport { registerWidgets } from './widgets/registerWidgets'\n\ndeclare module 'payload' {\n\tinterface RegisteredPlugins {\n\t\t'@10x-media/analytics': AnalyticsPluginOptions\n\t}\n}\n\n/**\n * Rereads the scopes a providers or goals save touched, on the instance that wrote; every other\n * instance catches up through its own probe.\n */\nconst configChanged =\n\t(collection: 'providers' | 'goals') =>\n\t(change: ScopeChange, req: PayloadRequest): void => {\n\t\tgetRuntime(req.payload)?.configChanged?.(collection, changedScopes(change))\n\t}\n\nconst addEndpoints = (config: Config, ...endpoints: Endpoint[]): void => {\n\tconfig.endpoints = [...(config.endpoints ?? []), ...endpoints]\n}\n\nexport const analytics = definePlugin<AnalyticsPluginOptions>({\n\tslug: '@10x-media/analytics',\n\tplugin: async ({ config, plugins: _plugins, ...options }): Promise<Config> => {\n\t\tconst disabled = options.disabled === true\n\t\t// Switched off, nothing reads through the adapters: they are only asked for their schema.\n\t\tconst resolved = resolveOptions(options, { requireAdapters: !disabled })\n\t\tconst resolveScope = async (req: PayloadRequest, callSite: ScopeCallSite) =>\n\t\t\tresolved.scope.resolve({ req, callSite })\n\t\tconst resolveAdminScope = (req: PayloadRequest) => resolveScope(req, 'admin')\n\t\t// What the collection checks warn about waits for the instance's logger, at init.\n\t\tconst notices: string[] = []\n\t\t// Read before the plugin merges its own strings in, so the app's own still win.\n\t\tconst staticLabel = createStaticLabels({\n\t\t\tapp: config.i18n?.translations,\n\t\t\tplugin: options.translations,\n\t\t\tunbundled: unbundledLanguages(config),\n\t\t})\n\t\tconst context: CollectionContext = {\n\t\t\tdb: config.db?.name,\n\t\t\tnotice: (message) => {\n\t\t\t\tnotices.push(message)\n\t\t\t},\n\t\t\tstaticLabel,\n\t\t}\n\t\tconst collections = await configCollections(\n\t\t\tresolved,\n\t\t\t{ resolveAdminScope, onChange: configChanged },\n\t\t\tcontext\n\t\t)\n\t\tconst sync = syncCollectionOf(resolved, resolveAdminScope, context)\n\t\tif (disabled) {\n\t\t\treturn schemaOnly(config, {\n\t\t\t\tresolved,\n\t\t\t\tcollections,\n\t\t\t\tcontext,\n\t\t\t\t...(sync ? { sync } : {}),\n\t\t\t\t...(options.translations ? { translations: options.translations } : {}),\n\t\t\t})\n\t\t}\n\t\tconst routes = routePaths(resolved.routes.base)\n\t\t// Whatever is mounted before the plugin runs belongs to the host or an earlier plugin.\n\t\tconst earlierEndpoints = new Set(config.endpoints ?? [])\n\t\tconst money = resolved.revenue.enabled\n\t\t// A runtime provider's capabilities are unknown at config time, so providers open the\n\t\t// widget and endpoint gates that otherwise follow the config adapters' capabilities.\n\t\tconst providersEnabled =\n\t\t\tresolved.providers.collection.enabled || Boolean(resolved.providers.resolve)\n\t\t// Read before the adapters register: only a host that turned it on may carry concurrency keys.\n\t\tconst jobsConcurrency = config.jobs?.enableConcurrencyControl === true\n\t\tregisterTranslations(config, options.translations)\n\t\tfillUnbundledLanguages(config)\n\t\tconst registry = createRegistry(resolved.adapters, resolved.defaultAdapter)\n\t\t// Adapters ask for a scope to stamp a visitor's hit with, so theirs is the capture call\n\t\t// site, asked without the signed-in user or their cookies.\n\t\tconst resolveCaptureScope = (req: PayloadRequest) =>\n\t\t\tresolveScope(captureRequest(req), 'capture')\n\t\t/**\n\t\t * Whether a scope's own committed provider documents grant it this adapter (a beacon decrypts\n\t\t * nothing). Handed to adapters only when `scope.resolve` and the providers collection both run.\n\t\t */\n\t\tconst adapterGrantedForScope = async (\n\t\t\treq: PayloadRequest,\n\t\t\tscope: string | null,\n\t\t\tadapterId: string\n\t\t): Promise<boolean> => {\n\t\t\tconst runtime = getRuntime(req.payload)\n\t\t\tif (!runtime) {\n\t\t\t\treturn true\n\t\t\t}\n\t\t\tif (runtime.providerGranted) {\n\t\t\t\treturn runtime.providerGranted(scope, adapterId)\n\t\t\t}\n\t\t\tconst { grants } = await resolveRegistryFor(runtime, { payload: req.payload, req, scope })\n\t\t\treturn grants.has(adapterId)\n\t\t}\n\t\tconst configGoals = configGoalsResolver(resolved.goals, resolved.purchaseGoal)\n\t\t/** The goals of the instance a request reached, which adapters resolve at ingest. */\n\t\tconst resolveGoals = (req: PayloadRequest, scope?: string | null): Promise<Goal[]> => {\n\t\t\tconst runtime = getRuntime(req.payload)\n\t\t\treturn runtime ? resolveGoalsFor(runtime, req, scope) : configGoals.resolve(req, scope)\n\t\t}\n\t\tconfig.collections = [...(config.collections ?? []), ...collections]\n\t\tconst timezoneArgs = { option: resolved.reportingTimezone, resolveScope: resolveAdminScope }\n\t\tconst resolveTimezone = createTimezoneResolver(timezoneArgs)\n\t\tconst resolveTimezoneStrict = createStrictTimezoneResolver(timezoneArgs)\n\t\tconst resolveCurrency = async (\n\t\t\treq: PayloadRequest,\n\t\t\tscope?: string | null\n\t\t): Promise<string | undefined> => {\n\t\t\tconst opt = resolved.revenue.currency\n\t\t\tif (opt === undefined) {\n\t\t\t\treturn undefined\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tconst code =\n\t\t\t\t\ttypeof opt === 'string'\n\t\t\t\t\t\t? opt\n\t\t\t\t\t\t: await opt({ req, scope: scope !== undefined ? scope : await resolveAdminScope(req) })\n\t\t\t\treturn code && CURRENCY_PATTERN.test(code) ? code : undefined\n\t\t\t} catch (err) {\n\t\t\t\treq.payload?.logger?.warn?.(\n\t\t\t\t\t`analytics: revenue.currency resolution failed, reporting revenue unformatted: ${String(err)}`\n\t\t\t\t)\n\t\t\t\treturn undefined\n\t\t\t}\n\t\t}\n\t\tconst itemCollections = itemCollectionsOf(resolved.bindings)\n\t\tfor (const adapter of resolved.adapters) {\n\t\t\tadapter.register?.(config, {\n\t\t\t\tscoped: resolved.scoped,\n\t\t\t\tresolveScope: resolveCaptureScope,\n\t\t\t\tresolveTimezone,\n\t\t\t\tresolveTimezoneStrict,\n\t\t\t\trevenue: {\n\t\t\t\t\tenabled: money,\n\t\t\t\t\tdimension: resolved.revenue.dimension,\n\t\t\t\t\tcurrency: resolveCurrency,\n\t\t\t\t\tconvert: resolved.revenue.convert,\n\t\t\t\t\tbrowserAmounts: resolved.revenue.browserAmounts,\n\t\t\t\t\torderSignature: resolved.revenue.orderSignature,\n\t\t\t\t},\n\t\t\t\tresolveGoals,\n\t\t\t\t...(resolved.scoped && resolved.providers.collection.enabled\n\t\t\t\t\t? { adapterGrantedForScope }\n\t\t\t\t\t: {}),\n\t\t\t\ttrustedProxyHops: resolved.trustedProxyHops,\n\t\t\t\ttrustedPlatform: resolved.trustedPlatform,\n\t\t\t\tallowedOrigins: resolved.capture.allowedOrigins,\n\t\t\t\t...(itemCollections.size > 0\n\t\t\t\t\t? {\n\t\t\t\t\t\t\titems: {\n\t\t\t\t\t\t\t\tcollections: itemCollections,\n\t\t\t\t\t\t\t\tpages: resolved.capture.autoCapture.items.pages,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t}\n\t\t\t\t\t: {}),\n\t\t\t\troutes,\n\t\t\t\tsdks: resolved.sdks,\n\t\t\t\tjobs: resolved.jobs,\n\t\t\t\tjobsConcurrency,\n\t\t\t\tnotice: context.notice,\n\t\t\t})\n\t\t}\n\t\tassertMaintainRegistered(\n\t\t\tresolved.jobs,\n\t\t\t(config.jobs?.tasks ?? []).some((task) => task.slug === TASK_SLUGS.maintain)\n\t\t)\n\t\t// After registration: an adapter declares what the install measures once it is registered,\n\t\t// and one that declares no revenue then is read as it is rather than as a copy.\n\t\tconst readRegistry = money ? registry : withoutRevenue(registry)\n\t\tif (\n\t\t\tresolved.adapters.some((a) => a.capabilities.realtime && typeof a.realtime === 'function') ||\n\t\t\tprovidersEnabled\n\t\t) {\n\t\t\taddEndpoints(config, { method: 'get', path: routes.live, handler: makeRealtimeHandler() })\n\t\t}\n\t\tif (Object.keys(resolved.bindings).length > 0) {\n\t\t\taddEndpoints(config, { method: 'get', path: routes.document, handler: makeDocumentHandler() })\n\t\t}\n\t\taddEndpoints(\n\t\t\tconfig,\n\t\t\t{ method: 'get', path: routes.sources, handler: makeSourcesHandler() },\n\t\t\t{ method: 'get', path: routes.goals, handler: makeGoalsHandler() },\n\t\t\t{ method: 'get', path: routes.query, handler: makeQueryHandler() },\n\t\t\t{ method: 'post', path: routes.refresh, handler: makeRefreshHandler() }\n\t\t)\n\t\tif (resolved.capture.exclusion) {\n\t\t\taddEndpoints(config, {\n\t\t\t\tmethod: 'get',\n\t\t\t\tpath: routes.exclusion,\n\t\t\t\thandler: makeExclusionHandler(),\n\t\t\t})\n\t\t}\n\t\t// One answer serves the view, the widgets and the route, so the flags an install draws and\n\t\t// the route serving them cannot diverge. A host's own flag needs no route, only the import map.\n\t\tconst countryFlags = resolved.countryFlags\n\t\tif (countryFlags === true) {\n\t\t\taddEndpoints(config, {\n\t\t\t\tmethod: 'get',\n\t\t\t\tpath: routes.flagsPattern,\n\t\t\t\thandler: makeFlagsHandler(),\n\t\t\t})\n\t\t} else if (countryFlags !== false) {\n\t\t\taddComponentDependency(config, FLAG_DEPENDENCY, countryFlags.Component)\n\t\t}\n\t\t// A runtime provider's capture support is unknown at config time, so providers\n\t\t// alone are enough to mount the proxy; every slot is still resolved per request.\n\t\tif (resolved.adapters.some((a) => a.capture) || providersEnabled) {\n\t\t\taddEndpoints(config, ...proxyEndpoints(routes), trackerEndpoint(routes))\n\t\t}\n\t\tif (resolved.widgets.enabled) {\n\t\t\tconst multiProvider = registry.isMultiProvider() || providersEnabled\n\t\t\tregisterWidgets(config, {\n\t\t\t\tadapters: resolved.adapters,\n\t\t\t\tmultiProvider,\n\t\t\t\tprovidersEnabled,\n\t\t\t\trevenue: money,\n\t\t\t\tdisabled: resolved.widgets.disabled,\n\t\t\t\tregister: resolved.widgets.register,\n\t\t\t\tlocalizeText: resolved.widgets.localizeText,\n\t\t\t\tdefaultId: resolved.defaultAdapter,\n\t\t\t\tcomparison: resolved.widgets.comparison,\n\t\t\t\tcountryFlags,\n\t\t\t\tstaticLabel,\n\t\t\t\toverrides: resolved.widgets.overrides,\n\t\t\t\tview:\n\t\t\t\t\tresolved.view === false\n\t\t\t\t\t\t? false\n\t\t\t\t\t\t: {\n\t\t\t\t\t\t\t\tpath: resolved.view.path,\n\t\t\t\t\t\t\t\tdefaultRange: resolved.view.defaultRange,\n\t\t\t\t\t\t\t\tdefaultMetric: resolved.view.defaultMetric,\n\t\t\t\t\t\t\t},\n\t\t\t})\n\t\t}\n\t\tregisterView(config, { view: resolved.view, title: staticLabel(keys.viewTitle) })\n\t\tconst { jobs } = resolved\n\t\tif (jobs !== false && resolved.cache.warm.enabled) {\n\t\t\taddTask(\n\t\t\t\tconfig,\n\t\t\t\twarmTask({\n\t\t\t\t\tschedule: jobs.warm,\n\t\t\t\t\twindowHours: resolved.cache.warm.windowHours,\n\t\t\t\t\tmaxReads: resolved.cache.warm.maxReads,\n\t\t\t\t\tconcurrency: jobsConcurrency,\n\t\t\t\t})\n\t\t\t)\n\t\t}\n\t\tif (sync) {\n\t\t\tconfig.collections = [...(config.collections ?? []), sync]\n\t\t\tif (jobs !== false) {\n\t\t\t\taddTask(\n\t\t\t\t\tconfig,\n\t\t\t\t\tsyncTask({\n\t\t\t\t\t\tschedule: jobs.sync,\n\t\t\t\t\t\tlookbackDays: resolved.sync.lookbackDays,\n\t\t\t\t\t\tcollectionSlug: resolved.sync.collection.slug,\n\t\t\t\t\t\tadapterIds: resolved.sync.adapters,\n\t\t\t\t\t\tscopes: resolved.scope.list,\n\t\t\t\t\t\tconcurrency: jobsConcurrency,\n\t\t\t\t\t})\n\t\t\t\t)\n\t\t\t}\n\t\t}\n\t\tconst cache = cacheCollectionOf(resolved, context)\n\t\tif (cache) {\n\t\t\tconfig.collections = [...(config.collections ?? []), cache]\n\t\t}\n\t\taddStateCollection(config, resolved, context)\n\t\trestrictJobControls(config)\n\t\t// Hidden per config rather than per process, so two instances answer for themselves; a later\n\t\t// plugin's fields (form-builder's action blocks) take their factory's own `revenue` option.\n\t\tapplyConfigRevenueVisibility(config, money)\n\t\trelabelFactoryFields(config, staticLabel)\n\t\tconfig.endpoints = (config.endpoints ?? []).map((endpoint) =>\n\t\t\tearlierEndpoints.has(endpoint) ? endpoint : pluginEndpoint(endpoint)\n\t\t)\n\t\t// Checked against everything registered so far, the plugin's own collections included; what a\n\t\t// later plugin adds is caught when a runtime is built from the assembled config.\n\t\tassertRoutesReachable(resolved.routes.base, {\n\t\t\tcollections: config.collections ?? [],\n\t\t\tendpoints: config.endpoints,\n\t\t})\n\t\tconst factory = createRuntimeFactory({\n\t\t\tresolved,\n\t\t\tnotices,\n\t\t\tcollections: expectedCollections(config.collections),\n\t\t\tregistry: readRegistry,\n\t\t\tresolveScope,\n\t\t\tresolveTimezone,\n\t\t\tresolveCurrency,\n\t\t})\n\t\tconst adminCustom: AnalyticsAdminCustom = { routes: { base: resolved.routes.base } }\n\t\tconfig.custom = { ...config.custom, [ANALYTICS_CONFIG_KEY]: factory }\n\t\tconfig.admin = {\n\t\t\t...config.admin,\n\t\t\tcustom: { ...config.admin?.custom, [ANALYTICS_CONFIG_KEY]: adminCustom },\n\t\t}\n\t\tconst prevOnInit = config.onInit\n\t\t// Validation only: the runtime builds on first use either way, and is built here so consumer\n\t\t// init code (seeding, cache warming, sync passes) runs against a warm one.\n\t\tconfig.onInit = async (payload) => {\n\t\t\t// Without the factory every endpoint answers 503; a boot error names the cause instead.\n\t\t\tif (runtimeFactoryOf(payload.config) !== factory) {\n\t\t\t\tthrow new Error(RUNTIME_FACTORY_LOST)\n\t\t\t}\n\t\t\tawait factory.validate(payload)\n\t\t\tgetRuntime(payload)\n\t\t\tawait prevOnInit?.(payload)\n\t\t}\n\t\treturn config\n\t},\n})\n\n/** Said at boot when a step after the plugin dropped its runtime from `config.custom`. */\nconst RUNTIME_FACTORY_LOST = `analytics: config.custom[\"${ANALYTICS_CONFIG_KEY}\"] no longer holds the analytics runtime: a plugin or config step that runs after analytics replaced config.custom instead of spreading it. Spread the existing value there ({ ...config.custom, ... }), or list analytics after that plugin.`\n\nexport { isAdminUser } from './access/adminUser'\nexport { type TenantMembershipOptions, tenantMembership } from './access/membership'\nexport { type GatedScope, type ReadPrincipal, SYSTEM } from './access/principal'\nexport { ProviderHttpError, parseRetryAfter } from './adapters/http/fetchJson'\nexport type { ReportMode, ReportOption } from './binding/report'\nexport type {\n\tAnalyticsBinding,\n\tBindingContext,\n\tBindingDoc,\n\tHostnameResolver,\n\tPathResolver,\n} from './binding/types'\nexport type { CapabilityRequirement, FilterPair, SerializedCapabilities } from './core/capabilities'\nexport {\n\ttype AnalyticsQuery,\n\ttype AnalyticsResult,\n\tPLATFORM_SCOPE,\n} from './core/contract'\nexport type {\n\tAnalyticsAccessOptions,\n\tAnalyticsCacheCollectionOptions,\n\tAnalyticsCacheOptions,\n\tAnalyticsCaptureOptions,\n\tAnalyticsCollectionOptions,\n\tAnalyticsComponent,\n\tAnalyticsConcurrencyOptions,\n\tAnalyticsCountryFlags,\n\tAnalyticsCrossScopeOptions,\n\tAnalyticsExclusionOptions,\n\tAnalyticsGoalsCollectionOptions,\n\tAnalyticsGoalsOptions,\n\tAnalyticsHooksOptions,\n\tAnalyticsJobsOptions,\n\tAnalyticsPluginOptions,\n\tAnalyticsPluginOptions as PluginOptions,\n\tAnalyticsReadAccess,\n\tAnalyticsRevenueOptions,\n\tAnalyticsRoutesOptions,\n\tAnalyticsScopeOptions,\n\tAnalyticsSourceOptions,\n\tAnalyticsSyncCollectionOptions,\n\tAnalyticsSyncOptions,\n\tAnalyticsTaskOptions,\n\tAnalyticsViewAccess,\n\tAnalyticsViewOptions,\n\tAnalyticsWarmOptions,\n\tAnalyticsWidgetOverride,\n\tAnalyticsWidgetOverrides,\n\tAnalyticsWidgetsOptions,\n\tAutoCaptureOptions,\n\tCaptureGate,\n\tCaptureGateArgs,\n\tCaptureSlotOption,\n\tCollectionOverrides,\n\tCrossScopeAccess,\n\tCurrencyConverter,\n\tCurrencyResolver,\n\tDefaultSourceFunction,\n\tDefaultSourceRule,\n\tExclusionSitesResolver,\n\tItemCaptureOptions,\n\tOwnSource,\n\tProviderHostsOptions,\n\tProvidersCollectionOptions,\n\tProvidersOptions,\n\tProvidersResolve,\n\tProvidersResolveArgs,\n\tScopeCallSite,\n\tScopeLabelResolver,\n\tScopeListResolver,\n\tScopeMemberAccess,\n\tScopeResolver,\n\tSourcePolicy,\n\tSourcePolicyFunction,\n\tSourceRef,\n\tTimezoneResolver,\n} from './core/options'\nexport type {\n\tAnalyticsSdks,\n\tGa4Client,\n\tGa4ClientOptions,\n\tGa4ReportResponse,\n\tGa4ReportRow,\n\tGa4Sdk,\n\tMaxmindReader,\n\tMaxmindSdk,\n} from './core/sdks'\nexport type {\n\tServerEventInput,\n\tServerTrack,\n\tServerTrackIdentity,\n\tServerTrackOptions,\n} from './core/serverEvent'\nexport { AnalyticsTrackError } from './core/serverEvent'\nexport { BUILT_IN_WIDGET_SLUGS, type BuiltInWidgetSlug } from './core/widgetSlugs'\nexport type * from './exports/adapters/contract'\nexport type { AnalyticsAttributes } from './exports/attributes'\nexport type {\n\tAnalyticsFieldsOptions,\n\tAnalyticsMetricLabel,\n\tAnalyticsMetricLabels,\n\tAnalyticsStatBaseOptions,\n\tAnalyticsStatOptions,\n\tAnalyticsStatRowOptions,\n\tAnalyticsTabOptions,\n} from './fields/factories'\nexport {\n\tanalyticsFields,\n\tanalyticsStat,\n\tanalyticsStatRow,\n\tanalyticsTab,\n\tanalyticsTabsField,\n} from './fields/factories'\nexport type {\n\tFieldBreakdown,\n\tFieldBreakdownRow,\n\tFieldReadResult,\n\tFieldReadStatus,\n\tReadForFieldArgs,\n} from './fields/readForDocument'\nexport { readForField } from './fields/readForDocument'\nexport type {\n\tGoalCollectionFieldOverrides,\n\tGoalFieldOverride,\n} from './goals/collection'\nexport { GOALS_SLUG } from './goals/collection'\nexport {\n\tCURRENCY_ATTRIBUTE,\n\tEVENT_ATTRIBUTE,\n\tEVENT_PROP_PREFIX,\n\tGOAL_ATTRIBUTE,\n\tITEM_ATTRIBUTE,\n\tITEM_CLICK_EVENT,\n\tITEM_NAME_ATTRIBUTE,\n\tMAX_ITEMS_PER_BEACON,\n\tPURCHASE_GOAL_SLUG,\n\tVALUE_ATTRIBUTE,\n} from './goals/constants'\nexport type { GoalFieldOptions } from './goals/goalField'\nexport { goalField, goalSlug } from './goals/goalField'\nexport type { GoalsResponse, WireGoal } from './goals/goalsEndpoint'\nexport type { AnalyticsLinkFieldsOptions } from './goals/linkFields'\nexport { analyticsLinkFields } from './goals/linkFields'\nexport type { BrowserAmounts, OrderSignatureMode } from './goals/match'\nexport type { GoalSource } from './goals/resolver'\nexport type {\n\tPurchaseInput as ServerPurchaseInput,\n\tRefundInput as ServerRefundInput,\n} from './goals/serverRevenue'\nexport { purchase, refund } from './goals/serverRevenue'\nexport type {\n\tGoalActionDefinition,\n\tGoalActionRunArgs,\n\tTrackGoalActionOptions,\n} from './goals/trackGoalAction'\nexport { GOAL_ACTION_TYPE, trackGoalAction } from './goals/trackGoalAction'\nexport type { Goal } from './goals/types'\nexport { STATE_SLUG } from './native/collections/slugs'\nexport type { RebuildDaysInput, RebuildDaysReport } from './native/engine/rebuild'\nexport {\n\ttype ItemSignatureMode,\n\titemAttributesFor,\n\tsignItemRef,\n} from './native/ingest/itemSignature'\nexport { signOrderId } from './native/ingest/orderSignature'\nexport { trackServerEvent } from './native/ingest/serverTrack'\nexport { rebuildDays } from './native/rebuildDays'\nexport {\n\tcreateGuardedFetch,\n\ttype GuardedFetch,\n\ttype GuardedFetchOptions,\n} from './net/guardedFetch'\nexport type { TrustedPlatform } from './net/platform'\nexport type { CollectionFieldOverride } from './plugin/collectionFields'\nexport {\n\tANALYTICS_ERROR_CODES,\n\ttype AnalyticsError,\n\ttype AnalyticsErrorCode,\n\tanalyticsError,\n\treadErrorCode,\n} from './plugin/errors'\nexport type { RoutesConfigSource } from './plugin/routes'\nexport {\n\tanalyticsRoutes,\n\tDEFAULT_ROUTE_BASE,\n\ttype RouteBase,\n\ttype RoutePaths,\n\troutePaths,\n} from './plugin/routes'\nexport type {\n\tBuildSecretField,\n\tConnectionAccess,\n\tConnectionFieldAccess,\n\tProviderCollectionFieldOverrides,\n\tProviderFieldOverride,\n\tProviderFieldsOptions,\n} from './providers/collection'\nexport { analyticsProviderFields, PROVIDERS_SLUG } from './providers/collection'\nexport type { ProviderDoc, ProviderFactoryContext, ProviderId } from './providers/factory'\nexport { adapterFromProviderDoc, PROVIDER_IDS } from './providers/factory'\nexport type { HostPattern } from './providers/hosts'\nexport { type ProviderHostPolicy, resolveHostPolicy } from './providers/hosts'\nexport { type RefreshProvidersOptions, refreshProviders } from './providers/refresh'\nexport { CONNECTION_PATHS, SECRET_PATHS } from './providers/secrets'\nexport type { QueryError, QueryErrorCode } from './query/errors'\nexport type {\n\tItemLabels,\n\tQueryErrorResponse,\n\tQueryResponse,\n\tQuerySourceRef,\n\tSerializedAnalyticsQuery,\n} from './query/response'\nexport type {\n\tAfterReadAnswer,\n\tAfterReadArgs,\n\tAfterReadHook,\n\tReadOrigin,\n} from './surfacing/afterRead'\nexport { CACHE_SLUG } from './surfacing/cacheCollection'\nexport type {\n\tCacheEntry,\n\tCacheSetOptions,\n\tCacheStore,\n\tReadRecipe,\n\tRecipeWindow,\n} from './surfacing/cacheStore'\nexport { SYNC_SLUG } from './sync/collection'\nexport { TIMEFRAME_PRESETS, type TimeframePreset } from './timeframe/presets'\nexport type { GoalMatch, RevenueItem, TrackerGoal } from './tracker/config'\nexport type { TranslationsOption } from './translations'\nexport {\n\tkeys,\n\ttype PluralCategory,\n\ttype PluralName,\n\ttype PluralVariant,\n\tpluralKeys,\n\ttype SingularKey,\n\ttype TranslationKey,\n} from './translations/keys'\nexport type { CustomWidgetDef } from './widgets/customWidget'\nexport {\n\ttype AnalyticsDefaultLayoutOptions,\n\tanalyticsDefaultLayout,\n} from './widgets/defaultLayout'\nexport { analyticsDefaultWidgets } from './widgets/defaults'\nexport { widgetFilters } from './widgets/filterField'\nexport type { StoredSourceRead, SubstitutedSource } from './widgets/prepareWidgetRead'\nexport type {\n\tReadForWidgetArgs,\n\tWidgetReadResult,\n\tWidgetReadStatus,\n} from './widgets/readForWidget'\nexport { readForWidget } from './widgets/readForWidget'\nexport type {\n\tBreakdownRow,\n\tReadForWidgetBreakdownArgs,\n\tWidgetBreakdownResult,\n} from './widgets/readForWidgetBreakdown'\nexport { readForWidgetBreakdown } from './widgets/readForWidgetBreakdown'\nexport type {\n\tGoalRow,\n\tReadForWidgetGoalsArgs,\n\tWidgetGoalsResult,\n} from './widgets/readForWidgetGoals'\nexport { readForWidgetGoals } from './widgets/readForWidgetGoals'\nexport type {\n\tReadForWidgetRealtimeArgs,\n\tRealtimePoint,\n\tWidgetRealtimeResult,\n\tWidgetRealtimeStatus,\n} from './widgets/readForWidgetRealtime'\nexport { readForWidgetRealtime } from './widgets/readForWidgetRealtime'\nexport type {\n\tReadForWidgetSeriesArgs,\n\tSeriesGranularity,\n\tSeriesPoint,\n\tWidgetSeriesResult,\n} from './widgets/readForWidgetSeries'\nexport { readForWidgetSeries } from './widgets/readForWidgetSeries'\nexport type { ReadNotices } from './widgets/readMeta'\nexport type { WidgetFilter } from './widgets/types'\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+DA,MAAM,iBACJ,gBACA,QAAqB,QAA8B;CACnD,WAAW,IAAI,OAAO,GAAG,gBAAgB,YAAY,cAAc,MAAM,CAAC;AAC3E;AAED,MAAM,gBAAgB,QAAgB,GAAG,cAAgC;CACxE,OAAO,YAAY,CAAC,GAAI,OAAO,aAAa,CAAC,GAAI,GAAG,SAAS;AAC9D;AAEA,MAAa,YAAY,aAAqC;CAC7D,MAAM;CACN,QAAQ,OAAO,EAAE,QAAQ,SAAS,UAAU,GAAG,cAA+B;EAC7E,MAAM,WAAW,QAAQ,aAAa;EAEtC,MAAM,WAAW,eAAe,SAAS,EAAE,iBAAiB,CAAC,SAAS,CAAC;EACvE,MAAM,eAAe,OAAO,KAAqB,aAChD,SAAS,MAAM,QAAQ;GAAE;GAAK;EAAS,CAAC;EACzC,MAAM,qBAAqB,QAAwB,aAAa,KAAK,OAAO;EAE5E,MAAM,UAAoB,CAAC;EAE3B,MAAM,cAAc,mBAAmB;GACtC,KAAK,OAAO,MAAM;GAClB,QAAQ,QAAQ;GAChB,WAAW,mBAAmB,MAAM;EACrC,CAAC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,CACpE;EAGA,sBAAsB,SAAS,OAAO,MAAM;GAC3C,aAAa,OAAO,eAAe,CAAC;GACpC,WAAW,OAAO;EACnB,CAAC;EACD,MAAM,UAAU,qBAAqB;GACpC;GACA;GACA,aAAa,oBAAoB,OAAO,WAAW;GACnD,UAAU;GACV;GACA;GACA;EACD,CAAC;EACD,MAAM,cAAoC,EAAE,QAAQ,EAAE,MAAM,SAAS,OAAO,KAAK,EAAE;EACnF,OAAO,SAAS;GAAE,GAAG,OAAO;IAAS,uBAAuB;EAAQ;EACpE,OAAO,QAAQ;GACd,GAAG,OAAO;GACV,QAAQ;IAAE,GAAG,OAAO,OAAO;KAAS,uBAAuB;GAAY;EACxE;EACA,MAAM,aAAa,OAAO;EAG1B,OAAO,SAAS,OAAO,YAAY;GAElC,IAAI,iBAAiB,QAAQ,MAAM,MAAM,SACxC,MAAM,IAAI,MAAM,oBAAoB;GAErC,MAAM,QAAQ,SAAS,OAAO;GAC9B,WAAW,OAAO;GAClB,MAAM,aAAa,OAAO;EAC3B;EACA,OAAO;CACR;AACD,CAAC;;AAGD,MAAM,uBAAuB,6BAA6B,qBAAqB"}
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../src/index.ts"],"sourcesContent":["import { type Config, definePlugin, type Endpoint, type PayloadRequest } from 'payload'\n\nimport { itemCollectionsOf } from './binding/report'\nimport { captureRequest } from './capture/captureRequest'\nimport { makeExclusionHandler } from './capture/exclusionEndpoint'\nimport { proxyEndpoints } from './capture/proxyEndpoint'\nimport { trackerEndpoint } from './capture/trackerEndpoint'\nimport { assertMaintainRegistered, TASK_SLUGS } from './core/jobs'\nimport {\n\ttype AnalyticsPluginOptions,\n\tadapterCountsWithoutConsent,\n\tresolveOptions,\n\ttype ScopeCallSite,\n} from './core/options'\nimport { createRegistry, withoutRevenue } from './core/registry'\nimport { CURRENCY_PATTERN } from './goals/currency'\nimport { makeGoalsHandler } from './goals/goalsEndpoint'\nimport { applyConfigRevenueVisibility } from './goals/moneyFields'\nimport { configGoalsResolver } from './goals/resolver'\nimport type { Goal } from './goals/types'\nimport { addComponentDependency, FLAG_DEPENDENCY } from './plugin/adminDependencies'\nimport { expectedCollections } from './plugin/collectionChecks'\nimport { createRuntimeFactory } from './plugin/createRuntime'\nimport { makeDocumentHandler } from './plugin/documentEndpoint'\nimport { makeFlagsHandler } from './plugin/flagsEndpoint'\nimport { restrictJobControls } from './plugin/jobsAccess'\nimport {\n\taddStateCollection,\n\ttype CollectionContext,\n\tcacheCollectionOf,\n\tconfigCollections,\n\tsyncCollectionOf,\n} from './plugin/pluginCollections'\nimport { makeQueryHandler } from './plugin/queryEndpoint'\nimport { makeRealtimeHandler } from './plugin/realtimeEndpoint'\nimport { makeRefreshHandler } from './plugin/refreshEndpoint'\nimport { registerTranslations } from './plugin/registerTranslations'\nimport { relabelFactoryFields } from './plugin/relabelFields'\nimport { assertRoutesReachable } from './plugin/routeChecks'\nimport {\n\tANALYTICS_CONFIG_KEY,\n\ttype AnalyticsAdminCustom,\n\tpluginEndpoint,\n\troutePaths,\n} from './plugin/routes'\nimport { getRuntime, resolveGoalsFor, resolveRegistryFor, runtimeFactoryOf } from './plugin/runtime'\nimport { addTask, schemaOnly } from './plugin/schemaOnly'\nimport { changedScopes, type ScopeChange } from './plugin/scopeChange'\nimport { makeSourcesHandler } from './plugin/sourcesEndpoint'\nimport { fillUnbundledLanguages, unbundledLanguages } from './plugin/unbundledLanguages'\nimport { warmTask } from './plugin/warmTask'\nimport { syncTask } from './sync/syncTask'\nimport { createStrictTimezoneResolver, createTimezoneResolver } from './timeframe/reportingTimezone'\nimport { keys } from './translations/keys'\nimport { createStaticLabels } from './translations/staticLabel'\nimport { registerView } from './view/registerView'\nimport { registerWidgets } from './widgets/registerWidgets'\n\ndeclare module 'payload' {\n\tinterface RegisteredPlugins {\n\t\t'@10x-media/analytics': AnalyticsPluginOptions\n\t}\n}\n\n/**\n * Rereads the scopes a providers or goals save touched, on the instance that wrote; every other\n * instance catches up through its own probe.\n */\nconst configChanged =\n\t(collection: 'providers' | 'goals') =>\n\t(change: ScopeChange, req: PayloadRequest): void => {\n\t\tgetRuntime(req.payload)?.configChanged?.(collection, changedScopes(change))\n\t}\n\nconst addEndpoints = (config: Config, ...endpoints: Endpoint[]): void => {\n\tconfig.endpoints = [...(config.endpoints ?? []), ...endpoints]\n}\n\nexport const analytics = definePlugin<AnalyticsPluginOptions>({\n\tslug: '@10x-media/analytics',\n\tplugin: async ({ config, plugins: _plugins, ...options }): Promise<Config> => {\n\t\tconst disabled = options.disabled === true\n\t\t// Switched off, nothing reads through the adapters: they are only asked for their schema.\n\t\tconst resolved = resolveOptions(options, { requireAdapters: !disabled })\n\t\tconst resolveScope = async (req: PayloadRequest, callSite: ScopeCallSite) =>\n\t\t\tresolved.scope.resolve({ req, callSite })\n\t\tconst resolveAdminScope = (req: PayloadRequest) => resolveScope(req, 'admin')\n\t\t// What the collection checks warn about waits for the instance's logger, at init.\n\t\tconst notices: string[] = []\n\t\t// Read before the plugin merges its own strings in, so the app's own still win.\n\t\tconst staticLabel = createStaticLabels({\n\t\t\tapp: config.i18n?.translations,\n\t\t\tplugin: options.translations,\n\t\t\tunbundled: unbundledLanguages(config),\n\t\t})\n\t\tconst context: CollectionContext = {\n\t\t\tdb: config.db?.name,\n\t\t\tnotice: (message) => {\n\t\t\t\tnotices.push(message)\n\t\t\t},\n\t\t\tstaticLabel,\n\t\t}\n\t\tconst collections = await configCollections(\n\t\t\tresolved,\n\t\t\t{ resolveAdminScope, onChange: configChanged },\n\t\t\tcontext\n\t\t)\n\t\tconst sync = syncCollectionOf(resolved, resolveAdminScope, context)\n\t\tif (disabled) {\n\t\t\treturn schemaOnly(config, {\n\t\t\t\tresolved,\n\t\t\t\tcollections,\n\t\t\t\tcontext,\n\t\t\t\t...(sync ? { sync } : {}),\n\t\t\t\t...(options.translations ? { translations: options.translations } : {}),\n\t\t\t})\n\t\t}\n\t\tconst routes = routePaths(resolved.routes.base)\n\t\t// Whatever is mounted before the plugin runs belongs to the host or an earlier plugin.\n\t\tconst earlierEndpoints = new Set(config.endpoints ?? [])\n\t\tconst money = resolved.revenue.enabled\n\t\t// A runtime provider's capabilities are unknown at config time, so providers open the\n\t\t// widget and endpoint gates that otherwise follow the config adapters' capabilities.\n\t\tconst providersEnabled =\n\t\t\tresolved.providers.collection.enabled || Boolean(resolved.providers.resolve)\n\t\t// Read before the adapters register: only a host that turned it on may carry concurrency keys.\n\t\tconst jobsConcurrency = config.jobs?.enableConcurrencyControl === true\n\t\tregisterTranslations(config, options.translations)\n\t\tfillUnbundledLanguages(config)\n\t\tconst registry = createRegistry(resolved.adapters, resolved.defaultAdapter)\n\t\t// Adapters ask for a scope to stamp a visitor's hit with, so theirs is the capture call\n\t\t// site, asked without the signed-in user or their cookies.\n\t\tconst resolveCaptureScope = (req: PayloadRequest) =>\n\t\t\tresolveScope(captureRequest(req), 'capture')\n\t\t/**\n\t\t * Whether a scope's own committed provider documents grant it this adapter (a beacon decrypts\n\t\t * nothing). Handed to adapters only when `scope.resolve` and the providers collection both run.\n\t\t */\n\t\tconst adapterGrantedForScope = async (\n\t\t\treq: PayloadRequest,\n\t\t\tscope: string | null,\n\t\t\tadapterId: string\n\t\t): Promise<boolean> => {\n\t\t\tconst runtime = getRuntime(req.payload)\n\t\t\tif (!runtime) {\n\t\t\t\treturn true\n\t\t\t}\n\t\t\tif (runtime.providerGranted) {\n\t\t\t\treturn runtime.providerGranted(scope, adapterId)\n\t\t\t}\n\t\t\tconst { grants } = await resolveRegistryFor(runtime, { payload: req.payload, req, scope })\n\t\t\treturn grants.has(adapterId)\n\t\t}\n\t\tconst configGoals = configGoalsResolver(resolved.goals, resolved.purchaseGoal)\n\t\t/** The goals of the instance a request reached, which adapters resolve at ingest. */\n\t\tconst resolveGoals = (req: PayloadRequest, scope?: string | null): Promise<Goal[]> => {\n\t\t\tconst runtime = getRuntime(req.payload)\n\t\t\treturn runtime ? resolveGoalsFor(runtime, req, scope) : configGoals.resolve(req, scope)\n\t\t}\n\t\tconfig.collections = [...(config.collections ?? []), ...collections]\n\t\tconst timezoneArgs = { option: resolved.reportingTimezone, resolveScope: resolveAdminScope }\n\t\tconst resolveTimezone = createTimezoneResolver(timezoneArgs)\n\t\tconst resolveTimezoneStrict = createStrictTimezoneResolver(timezoneArgs)\n\t\tconst resolveCurrency = async (\n\t\t\treq: PayloadRequest,\n\t\t\tscope?: string | null\n\t\t): Promise<string | undefined> => {\n\t\t\tconst opt = resolved.revenue.currency\n\t\t\tif (opt === undefined) {\n\t\t\t\treturn undefined\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tconst code =\n\t\t\t\t\ttypeof opt === 'string'\n\t\t\t\t\t\t? opt\n\t\t\t\t\t\t: await opt({ req, scope: scope !== undefined ? scope : await resolveAdminScope(req) })\n\t\t\t\treturn code && CURRENCY_PATTERN.test(code) ? code : undefined\n\t\t\t} catch (err) {\n\t\t\t\treq.payload?.logger?.warn?.(\n\t\t\t\t\t`analytics: revenue.currency resolution failed, reporting revenue unformatted: ${String(err)}`\n\t\t\t\t)\n\t\t\t\treturn undefined\n\t\t\t}\n\t\t}\n\t\tconst itemCollections = itemCollectionsOf(resolved.bindings)\n\t\tfor (const adapter of resolved.adapters) {\n\t\t\tadapter.register?.(config, {\n\t\t\t\tscoped: resolved.scoped,\n\t\t\t\tresolveScope: resolveCaptureScope,\n\t\t\t\tresolveTimezone,\n\t\t\t\tresolveTimezoneStrict,\n\t\t\t\trevenue: {\n\t\t\t\t\tenabled: money,\n\t\t\t\t\tdimension: resolved.revenue.dimension,\n\t\t\t\t\tcurrency: resolveCurrency,\n\t\t\t\t\tconvert: resolved.revenue.convert,\n\t\t\t\t\tbrowserAmounts: resolved.revenue.browserAmounts,\n\t\t\t\t\torderSignature: resolved.revenue.orderSignature,\n\t\t\t\t},\n\t\t\t\tresolveGoals,\n\t\t\t\t...(resolved.scoped && resolved.providers.collection.enabled\n\t\t\t\t\t? { adapterGrantedForScope }\n\t\t\t\t\t: {}),\n\t\t\t\ttrustedProxyHops: resolved.trustedProxyHops,\n\t\t\t\ttrustedPlatform: resolved.trustedPlatform,\n\t\t\t\tallowedOrigins: resolved.capture.allowedOrigins,\n\t\t\t\tadapterCountsWithoutConsent: adapterCountsWithoutConsent(resolved, adapter),\n\t\t\t\t...(itemCollections.size > 0\n\t\t\t\t\t? {\n\t\t\t\t\t\t\titems: {\n\t\t\t\t\t\t\t\tcollections: itemCollections,\n\t\t\t\t\t\t\t\tpages: resolved.capture.autoCapture.items.pages,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t}\n\t\t\t\t\t: {}),\n\t\t\t\troutes,\n\t\t\t\tsdks: resolved.sdks,\n\t\t\t\tjobs: resolved.jobs,\n\t\t\t\tjobsConcurrency,\n\t\t\t\tnotice: context.notice,\n\t\t\t})\n\t\t}\n\t\tassertMaintainRegistered(\n\t\t\tresolved.jobs,\n\t\t\t(config.jobs?.tasks ?? []).some((task) => task.slug === TASK_SLUGS.maintain)\n\t\t)\n\t\t// After registration: an adapter declares what the install measures once it is registered,\n\t\t// and one that declares no revenue then is read as it is rather than as a copy.\n\t\tconst readRegistry = money ? registry : withoutRevenue(registry)\n\t\tif (\n\t\t\tresolved.adapters.some((a) => a.capabilities.realtime && typeof a.realtime === 'function') ||\n\t\t\tprovidersEnabled\n\t\t) {\n\t\t\taddEndpoints(config, { method: 'get', path: routes.live, handler: makeRealtimeHandler() })\n\t\t}\n\t\tif (Object.keys(resolved.bindings).length > 0) {\n\t\t\taddEndpoints(config, { method: 'get', path: routes.document, handler: makeDocumentHandler() })\n\t\t}\n\t\taddEndpoints(\n\t\t\tconfig,\n\t\t\t{ method: 'get', path: routes.sources, handler: makeSourcesHandler() },\n\t\t\t{ method: 'get', path: routes.goals, handler: makeGoalsHandler() },\n\t\t\t{ method: 'get', path: routes.query, handler: makeQueryHandler() },\n\t\t\t{ method: 'post', path: routes.refresh, handler: makeRefreshHandler() }\n\t\t)\n\t\tif (resolved.capture.exclusion) {\n\t\t\taddEndpoints(config, {\n\t\t\t\tmethod: 'get',\n\t\t\t\tpath: routes.exclusion,\n\t\t\t\thandler: makeExclusionHandler(),\n\t\t\t})\n\t\t}\n\t\t// One answer serves the view, the widgets and the route, so the flags an install draws and\n\t\t// the route serving them cannot diverge. A host's own flag needs no route, only the import map.\n\t\tconst countryFlags = resolved.countryFlags\n\t\tif (countryFlags === true) {\n\t\t\taddEndpoints(config, {\n\t\t\t\tmethod: 'get',\n\t\t\t\tpath: routes.flagsPattern,\n\t\t\t\thandler: makeFlagsHandler(),\n\t\t\t})\n\t\t} else if (countryFlags !== false) {\n\t\t\taddComponentDependency(config, FLAG_DEPENDENCY, countryFlags.Component)\n\t\t}\n\t\t// A runtime provider's capture support is unknown at config time, so providers\n\t\t// alone are enough to mount the proxy; every slot is still resolved per request.\n\t\tif (resolved.adapters.some((a) => a.capture) || providersEnabled) {\n\t\t\taddEndpoints(config, ...proxyEndpoints(routes), trackerEndpoint(routes))\n\t\t}\n\t\tif (resolved.widgets.enabled) {\n\t\t\tconst multiProvider = registry.isMultiProvider() || providersEnabled\n\t\t\tregisterWidgets(config, {\n\t\t\t\tadapters: resolved.adapters,\n\t\t\t\tmultiProvider,\n\t\t\t\tprovidersEnabled,\n\t\t\t\trevenue: money,\n\t\t\t\tdisabled: resolved.widgets.disabled,\n\t\t\t\tregister: resolved.widgets.register,\n\t\t\t\tlocalizeText: resolved.widgets.localizeText,\n\t\t\t\tdefaultId: resolved.defaultAdapter,\n\t\t\t\tcomparison: resolved.widgets.comparison,\n\t\t\t\tcountryFlags,\n\t\t\t\tstaticLabel,\n\t\t\t\toverrides: resolved.widgets.overrides,\n\t\t\t\tview:\n\t\t\t\t\tresolved.view === false\n\t\t\t\t\t\t? false\n\t\t\t\t\t\t: {\n\t\t\t\t\t\t\t\tpath: resolved.view.path,\n\t\t\t\t\t\t\t\tdefaultRange: resolved.view.defaultRange,\n\t\t\t\t\t\t\t\tdefaultMetric: resolved.view.defaultMetric,\n\t\t\t\t\t\t\t},\n\t\t\t})\n\t\t}\n\t\tregisterView(config, { view: resolved.view, title: staticLabel(keys.viewTitle) })\n\t\tconst { jobs } = resolved\n\t\tif (jobs !== false && resolved.cache.warm.enabled) {\n\t\t\taddTask(\n\t\t\t\tconfig,\n\t\t\t\twarmTask({\n\t\t\t\t\tschedule: jobs.warm,\n\t\t\t\t\twindowHours: resolved.cache.warm.windowHours,\n\t\t\t\t\tmaxReads: resolved.cache.warm.maxReads,\n\t\t\t\t\tconcurrency: jobsConcurrency,\n\t\t\t\t})\n\t\t\t)\n\t\t}\n\t\tif (sync) {\n\t\t\tconfig.collections = [...(config.collections ?? []), sync]\n\t\t\tif (jobs !== false) {\n\t\t\t\taddTask(\n\t\t\t\t\tconfig,\n\t\t\t\t\tsyncTask({\n\t\t\t\t\t\tschedule: jobs.sync,\n\t\t\t\t\t\tlookbackDays: resolved.sync.lookbackDays,\n\t\t\t\t\t\tcollectionSlug: resolved.sync.collection.slug,\n\t\t\t\t\t\tadapterIds: resolved.sync.adapters,\n\t\t\t\t\t\tscopes: resolved.scope.list,\n\t\t\t\t\t\tconcurrency: jobsConcurrency,\n\t\t\t\t\t})\n\t\t\t\t)\n\t\t\t}\n\t\t}\n\t\tconst cache = cacheCollectionOf(resolved, context)\n\t\tif (cache) {\n\t\t\tconfig.collections = [...(config.collections ?? []), cache]\n\t\t}\n\t\taddStateCollection(config, resolved, context)\n\t\trestrictJobControls(config)\n\t\t// Hidden per config rather than per process, so two instances answer for themselves; a later\n\t\t// plugin's fields (form-builder's action blocks) take their factory's own `revenue` option.\n\t\tapplyConfigRevenueVisibility(config, money)\n\t\trelabelFactoryFields(config, staticLabel)\n\t\tconfig.endpoints = (config.endpoints ?? []).map((endpoint) =>\n\t\t\tearlierEndpoints.has(endpoint) ? endpoint : pluginEndpoint(endpoint)\n\t\t)\n\t\t// Checked against everything registered so far, the plugin's own collections included; what a\n\t\t// later plugin adds is caught when a runtime is built from the assembled config.\n\t\tassertRoutesReachable(resolved.routes.base, {\n\t\t\tcollections: config.collections ?? [],\n\t\t\tendpoints: config.endpoints,\n\t\t})\n\t\tconst factory = createRuntimeFactory({\n\t\t\tresolved,\n\t\t\tnotices,\n\t\t\tcollections: expectedCollections(config.collections),\n\t\t\tregistry: readRegistry,\n\t\t\tresolveScope,\n\t\t\tresolveTimezone,\n\t\t\tresolveCurrency,\n\t\t})\n\t\tconst adminCustom: AnalyticsAdminCustom = { routes: { base: resolved.routes.base } }\n\t\tconfig.custom = { ...config.custom, [ANALYTICS_CONFIG_KEY]: factory }\n\t\tconfig.admin = {\n\t\t\t...config.admin,\n\t\t\tcustom: { ...config.admin?.custom, [ANALYTICS_CONFIG_KEY]: adminCustom },\n\t\t}\n\t\tconst prevOnInit = config.onInit\n\t\t// Validation only: the runtime builds on first use either way, and is built here so consumer\n\t\t// init code (seeding, cache warming, sync passes) runs against a warm one.\n\t\tconfig.onInit = async (payload) => {\n\t\t\t// Without the factory every endpoint answers 503; a boot error names the cause instead.\n\t\t\tif (runtimeFactoryOf(payload.config) !== factory) {\n\t\t\t\tthrow new Error(RUNTIME_FACTORY_LOST)\n\t\t\t}\n\t\t\tawait factory.validate(payload)\n\t\t\tgetRuntime(payload)\n\t\t\tawait prevOnInit?.(payload)\n\t\t}\n\t\treturn config\n\t},\n})\n\n/** Said at boot when a step after the plugin dropped its runtime from `config.custom`. */\nconst RUNTIME_FACTORY_LOST = `analytics: config.custom[\"${ANALYTICS_CONFIG_KEY}\"] no longer holds the analytics runtime: a plugin or config step that runs after analytics replaced config.custom instead of spreading it. Spread the existing value there ({ ...config.custom, ... }), or list analytics after that plugin.`\n\nexport { isAdminUser } from './access/adminUser'\nexport { type TenantMembershipOptions, tenantMembership } from './access/membership'\nexport { type GatedScope, type ReadPrincipal, SYSTEM } from './access/principal'\nexport { ProviderHttpError, parseRetryAfter } from './adapters/http/fetchJson'\nexport type { ReportMode, ReportOption } from './binding/report'\nexport type {\n\tAnalyticsBinding,\n\tBindingContext,\n\tBindingDoc,\n\tHostnameResolver,\n\tPathResolver,\n} from './binding/types'\nexport type { CapabilityRequirement, FilterPair, SerializedCapabilities } from './core/capabilities'\nexport {\n\ttype AnalyticsQuery,\n\ttype AnalyticsResult,\n\tPLATFORM_SCOPE,\n} from './core/contract'\nexport type {\n\tAnalyticsAccessOptions,\n\tAnalyticsCacheCollectionOptions,\n\tAnalyticsCacheOptions,\n\tAnalyticsCaptureOptions,\n\tAnalyticsCollectionOptions,\n\tAnalyticsComponent,\n\tAnalyticsConcurrencyOptions,\n\tAnalyticsCountryFlags,\n\tAnalyticsCrossScopeOptions,\n\tAnalyticsExclusionOptions,\n\tAnalyticsGoalsCollectionOptions,\n\tAnalyticsGoalsOptions,\n\tAnalyticsHooksOptions,\n\tAnalyticsJobsOptions,\n\tAnalyticsPluginOptions,\n\tAnalyticsPluginOptions as PluginOptions,\n\tAnalyticsReadAccess,\n\tAnalyticsRevenueOptions,\n\tAnalyticsRoutesOptions,\n\tAnalyticsScopeOptions,\n\tAnalyticsSourceOptions,\n\tAnalyticsSyncCollectionOptions,\n\tAnalyticsSyncOptions,\n\tAnalyticsTaskOptions,\n\tAnalyticsViewAccess,\n\tAnalyticsViewOptions,\n\tAnalyticsWarmOptions,\n\tAnalyticsWidgetOverride,\n\tAnalyticsWidgetOverrides,\n\tAnalyticsWidgetsOptions,\n\tAutoCaptureOptions,\n\tCaptureGate,\n\tCaptureGateArgs,\n\tCaptureSlotOption,\n\tCollectionOverrides,\n\tCrossScopeAccess,\n\tCurrencyConverter,\n\tCurrencyResolver,\n\tDefaultSourceFunction,\n\tDefaultSourceRule,\n\tExclusionSitesResolver,\n\tItemCaptureOptions,\n\tOwnSource,\n\tProviderHostsOptions,\n\tProvidersCollectionOptions,\n\tProvidersOptions,\n\tProvidersResolve,\n\tProvidersResolveArgs,\n\tScopeCallSite,\n\tScopeLabelResolver,\n\tScopeListResolver,\n\tScopeMemberAccess,\n\tScopeResolver,\n\tSourcePolicy,\n\tSourcePolicyFunction,\n\tSourceRef,\n\tTimezoneResolver,\n\tWithoutConsentArgs,\n\tWithoutConsentFunction,\n\tWithoutConsentOption,\n} from './core/options'\nexport type {\n\tAnalyticsSdks,\n\tGa4Client,\n\tGa4ClientOptions,\n\tGa4ReportResponse,\n\tGa4ReportRow,\n\tGa4Sdk,\n\tMaxmindReader,\n\tMaxmindSdk,\n} from './core/sdks'\nexport type {\n\tServerEventInput,\n\tServerTrack,\n\tServerTrackIdentity,\n\tServerTrackOptions,\n} from './core/serverEvent'\nexport { AnalyticsTrackError } from './core/serverEvent'\nexport { BUILT_IN_WIDGET_SLUGS, type BuiltInWidgetSlug } from './core/widgetSlugs'\nexport type * from './exports/adapters/contract'\nexport type { AnalyticsAttributes } from './exports/attributes'\nexport type {\n\tAnalyticsFieldsOptions,\n\tAnalyticsMetricLabel,\n\tAnalyticsMetricLabels,\n\tAnalyticsStatBaseOptions,\n\tAnalyticsStatOptions,\n\tAnalyticsStatRowOptions,\n\tAnalyticsTabOptions,\n} from './fields/factories'\nexport {\n\tanalyticsFields,\n\tanalyticsStat,\n\tanalyticsStatRow,\n\tanalyticsTab,\n\tanalyticsTabsField,\n} from './fields/factories'\nexport type {\n\tFieldBreakdown,\n\tFieldBreakdownRow,\n\tFieldReadResult,\n\tFieldReadStatus,\n\tReadForFieldArgs,\n} from './fields/readForDocument'\nexport { readForField } from './fields/readForDocument'\nexport type {\n\tGoalCollectionFieldOverrides,\n\tGoalFieldOverride,\n} from './goals/collection'\nexport { GOALS_SLUG } from './goals/collection'\nexport {\n\tCURRENCY_ATTRIBUTE,\n\tEVENT_ATTRIBUTE,\n\tEVENT_PROP_PREFIX,\n\tGOAL_ATTRIBUTE,\n\tITEM_ATTRIBUTE,\n\tITEM_CLICK_EVENT,\n\tITEM_NAME_ATTRIBUTE,\n\tMAX_ITEMS_PER_BEACON,\n\tPURCHASE_GOAL_SLUG,\n\tVALUE_ATTRIBUTE,\n} from './goals/constants'\nexport type { GoalFieldOptions } from './goals/goalField'\nexport { goalField, goalSlug } from './goals/goalField'\nexport type { GoalsResponse, WireGoal } from './goals/goalsEndpoint'\nexport type { AnalyticsLinkFieldsOptions } from './goals/linkFields'\nexport { analyticsLinkFields } from './goals/linkFields'\nexport type { BrowserAmounts, OrderSignatureMode } from './goals/match'\nexport type { GoalSource } from './goals/resolver'\nexport type {\n\tPurchaseInput as ServerPurchaseInput,\n\tRefundInput as ServerRefundInput,\n} from './goals/serverRevenue'\nexport { purchase, refund } from './goals/serverRevenue'\nexport type {\n\tGoalActionDefinition,\n\tGoalActionRunArgs,\n\tTrackGoalActionOptions,\n} from './goals/trackGoalAction'\nexport { GOAL_ACTION_TYPE, trackGoalAction } from './goals/trackGoalAction'\nexport type { Goal } from './goals/types'\nexport { STATE_SLUG } from './native/collections/slugs'\nexport type { RebuildDaysInput, RebuildDaysReport } from './native/engine/rebuild'\nexport {\n\ttype ItemSignatureMode,\n\titemAttributesFor,\n\tsignItemRef,\n} from './native/ingest/itemSignature'\nexport { signOrderId } from './native/ingest/orderSignature'\nexport { trackServerEvent } from './native/ingest/serverTrack'\nexport { rebuildDays } from './native/rebuildDays'\nexport {\n\tcreateGuardedFetch,\n\ttype GuardedFetch,\n\ttype GuardedFetchOptions,\n} from './net/guardedFetch'\nexport type { TrustedPlatform } from './net/platform'\nexport type { CollectionFieldOverride } from './plugin/collectionFields'\nexport {\n\tANALYTICS_ERROR_CODES,\n\ttype AnalyticsError,\n\ttype AnalyticsErrorCode,\n\tanalyticsError,\n\treadErrorCode,\n} from './plugin/errors'\nexport type { RoutesConfigSource } from './plugin/routes'\nexport {\n\tanalyticsRoutes,\n\tDEFAULT_ROUTE_BASE,\n\ttype RouteBase,\n\ttype RoutePaths,\n\troutePaths,\n} from './plugin/routes'\nexport type {\n\tBuildSecretField,\n\tConnectionAccess,\n\tConnectionFieldAccess,\n\tProviderCollectionFieldOverrides,\n\tProviderFieldOverride,\n\tProviderFieldsOptions,\n} from './providers/collection'\nexport { analyticsProviderFields, PROVIDERS_SLUG } from './providers/collection'\nexport type { ProviderDoc, ProviderFactoryContext, ProviderId } from './providers/factory'\nexport { adapterFromProviderDoc, PROVIDER_IDS } from './providers/factory'\nexport type { HostPattern } from './providers/hosts'\nexport { type ProviderHostPolicy, resolveHostPolicy } from './providers/hosts'\nexport { type RefreshProvidersOptions, refreshProviders } from './providers/refresh'\nexport { CONNECTION_PATHS, SECRET_PATHS } from './providers/secrets'\nexport type { QueryError, QueryErrorCode } from './query/errors'\nexport type {\n\tItemLabels,\n\tQueryErrorResponse,\n\tQueryResponse,\n\tQuerySourceRef,\n\tSerializedAnalyticsQuery,\n} from './query/response'\nexport type {\n\tAfterReadAnswer,\n\tAfterReadArgs,\n\tAfterReadHook,\n\tReadOrigin,\n} from './surfacing/afterRead'\nexport { CACHE_SLUG } from './surfacing/cacheCollection'\nexport type {\n\tCacheEntry,\n\tCacheSetOptions,\n\tCacheStore,\n\tReadRecipe,\n\tRecipeWindow,\n} from './surfacing/cacheStore'\nexport { SYNC_SLUG } from './sync/collection'\nexport { TIMEFRAME_PRESETS, type TimeframePreset } from './timeframe/presets'\nexport type { GoalMatch, RevenueItem, TrackerGoal } from './tracker/config'\nexport type { TranslationsOption } from './translations'\nexport {\n\tkeys,\n\ttype PluralCategory,\n\ttype PluralName,\n\ttype PluralVariant,\n\tpluralKeys,\n\ttype SingularKey,\n\ttype TranslationKey,\n} from './translations/keys'\nexport type { CustomWidgetDef } from './widgets/customWidget'\nexport {\n\ttype AnalyticsDefaultLayoutOptions,\n\tanalyticsDefaultLayout,\n} from './widgets/defaultLayout'\nexport { analyticsDefaultWidgets } from './widgets/defaults'\nexport { widgetFilters } from './widgets/filterField'\nexport type { StoredSourceRead, SubstitutedSource } from './widgets/prepareWidgetRead'\nexport type {\n\tReadForWidgetArgs,\n\tWidgetReadResult,\n\tWidgetReadStatus,\n} from './widgets/readForWidget'\nexport { readForWidget } from './widgets/readForWidget'\nexport type {\n\tBreakdownRow,\n\tReadForWidgetBreakdownArgs,\n\tWidgetBreakdownResult,\n} from './widgets/readForWidgetBreakdown'\nexport { readForWidgetBreakdown } from './widgets/readForWidgetBreakdown'\nexport type {\n\tGoalRow,\n\tReadForWidgetGoalsArgs,\n\tWidgetGoalsResult,\n} from './widgets/readForWidgetGoals'\nexport { readForWidgetGoals } from './widgets/readForWidgetGoals'\nexport type {\n\tReadForWidgetRealtimeArgs,\n\tRealtimePoint,\n\tWidgetRealtimeResult,\n\tWidgetRealtimeStatus,\n} from './widgets/readForWidgetRealtime'\nexport { readForWidgetRealtime } from './widgets/readForWidgetRealtime'\nexport type {\n\tReadForWidgetSeriesArgs,\n\tSeriesGranularity,\n\tSeriesPoint,\n\tWidgetSeriesResult,\n} from './widgets/readForWidgetSeries'\nexport { readForWidgetSeries } from './widgets/readForWidgetSeries'\nexport type { ReadNotices } from './widgets/readMeta'\nexport type { WidgetFilter } from './widgets/types'\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoEA,MAAM,iBACJ,gBACA,QAAqB,QAA8B;CACnD,WAAW,IAAI,OAAO,GAAG,gBAAgB,YAAY,cAAc,MAAM,CAAC;AAC3E;AAED,MAAM,gBAAgB,QAAgB,GAAG,cAAgC;CACxE,OAAO,YAAY,CAAC,GAAI,OAAO,aAAa,CAAC,GAAI,GAAG,SAAS;AAC9D;AAEA,MAAa,YAAY,aAAqC;CAC7D,MAAM;CACN,QAAQ,OAAO,EAAE,QAAQ,SAAS,UAAU,GAAG,cAA+B;EAC7E,MAAM,WAAW,QAAQ,aAAa;EAEtC,MAAM,WAAW,eAAe,SAAS,EAAE,iBAAiB,CAAC,SAAS,CAAC;EACvE,MAAM,eAAe,OAAO,KAAqB,aAChD,SAAS,MAAM,QAAQ;GAAE;GAAK;EAAS,CAAC;EACzC,MAAM,qBAAqB,QAAwB,aAAa,KAAK,OAAO;EAE5E,MAAM,UAAoB,CAAC;EAE3B,MAAM,cAAc,mBAAmB;GACtC,KAA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,WAAW;EACxC,OAAO,aAAa,OAAO,aAAa,CAAC,GAAG,KAAK,aAChD,iBAAiB,IAAI,QAAQ,IAAI,WAAW,eAAe,QAAQ,CACpE;EAGA,sBAAsB,SAAS,OAAO,MAAM;GAC3C,aAAa,OAAO,eAAe,CAAC;GACpC,WAAW,OAAO;EACnB,CAAC;EACD,MAAM,UAAU,qBAAqB;GACpC;GACA;GACA,aAAa,oBAAoB,OAAO,WAAW;GACnD,UAAU;GACV;GACA;GACA;EACD,CAAC;EACD,MAAM,cAAoC,EAAE,QAAQ,EAAE,MAAM,SAAS,OAAO,KAAK,EAAE;EACnF,OAAO,SAAS;GAAE,GAAG,OAAO;IAAS,uBAAuB;EAAQ;EACpE,OAAO,QAAQ;GACd,GAAG,OAAO;GACV,QAAQ;IAAE,GAAG,OAAO,OAAO;KAAS,uBAAuB;GAAY;EACxE;EACA,MAAM,aAAa,OAAO;EAG1B,OAAO,SAAS,OAAO,YAAY;GAElC,IAAI,iBAAiB,QAAQ,MAAM,MAAM,SACxC,MAAM,IAAI,MAAM,oBAAoB;GAErC,MAAM,QAAQ,SAAS,OAAO;GAC9B,WAAW,OAAO;GAClB,MAAM,aAAa,OAAO;EAC3B;EACA,OAAO;CACR;AACD,CAAC;;AAGD,MAAM,uBAAuB,6BAA6B,qBAAqB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hits.js","names":[],"sources":["../../../src/native/collections/hits.ts"],"sourcesContent":["import type { CollectionConfig, Field } from 'payload'\nimport { HITS_SLUG } from './slugs'\nimport { storeCollection } from './storeCollection'\n\nconst text = (name: string): Field => ({ name, type: 'text' })\nconst number = (name: string): Field => ({ name, type: 'number' })\nconst json = (name: string): Field => ({ name, type: 'json' })\nconst flag = (name: string): Field => ({\n\tname,\n\ttype: 'checkbox',\n\trequired: true,\n\tdefaultValue: false,\n})\n\n/**\n * One row per hit, keyed by a ULID of its time or `o` + an order's dedupe key, which is what\n * refuses a retried order. `type` is text, so a new hit type needs no Postgres enum migration.\n */\nexport const hitsCollection = (slug: string = HITS_SLUG): CollectionConfig =>\n\tstoreCollection({\n\t\tslug,\n\t\tfields: [\n\t\t\t{ name: 'scope', type: 'text', required: true, defaultValue: '' },\n\t\t\t{ name: 'ts', type: 'date', required: true },\n\t\t\t{ name: 'lastAt', type: 'date' },\n\t\t\t{ name: 'type', type: 'text', required: true },\n\t\t\t{ name: 'hostname', type: 'text', required: true },\n\t\t\t{ name: 'path', type: 'text', required: true },\n\t\t\t{ name: 'v', type: 'text', required: true },\n\t\t\tflag('landing'),\n\t\t\tflag('server'),\n\t\t\ttext('name'),\n\t\t\ttext('ref'),\n\t\t\ttext('source'),\n\t\t\ttext('channel'),\n\t\t\ttext('clickId'),\n\t\t\ttext('utmSource'),\n\t\t\ttext('utmMedium'),\n\t\t\ttext('utmCampaign'),\n\t\t\ttext('utmContent'),\n\t\t\ttext('utmTerm'),\n\t\t\tnumber('channelVersion'),\n\t\t\ttext('country'),\n\t\t\ttext('region'),\n\t\t\ttext('city'),\n\t\t\ttext('language'),\n\t\t\ttext('device'),\n\t\t\ttext('browser'),\n\t\t\ttext('os'),\n\t\t\tnumber('durationMs'),\n\t\t\tnumber('scrollDepth'),\n\t\t\tnumber('value'),\n\t\t\tnumber('originalValue'),\n\t\t\tnumber('conversions'),\n\t\t\tnumber('revenue'),\n\t\t\ttext('currency'),\n\t\t\ttext('originalCurrency'),\n\t\t\ttext('item'),\n\t\t\tjson('props'),\n\t\t\tjson('goals'),\n\t\t\tjson('impressions'),\n\t\t],\n\t\tindexes: [{ fields: ['scope', 'ts'] }],\n\t})\n"],"mappings":";;;AAIA,MAAM,QAAQ,UAAyB;CAAE;CAAM,MAAM;AAAO;AAC5D,MAAM,UAAU,UAAyB;CAAE;CAAM,MAAM;AAAS;AAChE,MAAM,QAAQ,UAAyB;CAAE;CAAM,MAAM;AAAO;AAC5D,MAAM,QAAQ,UAAyB;CACtC;CACA,MAAM;CACN,UAAU;CACV,cAAc;AACf;;;;;AAMA,MAAa,kBAAkB,OAAe,cAC7C,gBAAgB;CACf;CACA,QAAQ;EACP;GAAE,MAAM;GAAS,MAAM;GAAQ,UAAU;GAAM,cAAc;EAAG;EAChE;GAAE,MAAM;GAAM,MAAM;GAAQ,UAAU;EAAK;EAC3C;GAAE,MAAM;GAAU,MAAM;EAAO;EAC/B;GAAE,MAAM;GAAQ,MAAM;GAAQ,UAAU;EAAK;EAC7C;GAAE,MAAM;GAAY,MAAM;GAAQ,UAAU;EAAK;EACjD;GAAE,MAAM;GAAQ,MAAM;GAAQ,UAAU;EAAK;EAC7C;GAAE,MAAM;GAAK,MAAM;GAAQ,UAAU;EAAK;EAC1C,KAAK,SAAS;EACd,KAAK,QAAQ;EACb,KAAK,MAAM;EACX,KAAK,KAAK;EACV,KAAK,QAAQ;EACb,KAAK,SAAS;EACd,KAAK,SAAS;EACd,KAAK,WAAW;EAChB,KAAK,WAAW;EAChB,KAAK,aAAa;EAClB,KAAK,YAAY;EACjB,KAAK,SAAS;EACd,OAAO,gBAAgB;EACvB,KAAK,SAAS;EACd,KAAK,QAAQ;EACb,KAAK,MAAM;EACX,KAAK,UAAU;EACf,KAAK,QAAQ;EACb,KAAK,SAAS;EACd,KAAK,IAAI;EACT,OAAO,YAAY;EACnB,OAAO,aAAa;EACpB,OAAO,OAAO;EACd,OAAO,eAAe;EACtB,OAAO,aAAa;EACpB,OAAO,SAAS;EAChB,KAAK,UAAU;EACf,KAAK,kBAAkB;EACvB,KAAK,MAAM;EACX,KAAK,OAAO;EACZ,KAAK,OAAO;EACZ,KAAK,aAAa;CACnB;CACA,SAAS,CAAC,EAAE,QAAQ,CAAC,SAAS,IAAI,EAAE,CAAC;AACtC,CAAC"}
|
|
1
|
+
{"version":3,"file":"hits.js","names":[],"sources":["../../../src/native/collections/hits.ts"],"sourcesContent":["import type { CollectionConfig, Field } from 'payload'\nimport { HITS_SLUG } from './slugs'\nimport { storeCollection } from './storeCollection'\n\nconst text = (name: string): Field => ({ name, type: 'text' })\nconst number = (name: string): Field => ({ name, type: 'number' })\nconst json = (name: string): Field => ({ name, type: 'json' })\nconst flag = (name: string): Field => ({\n\tname,\n\ttype: 'checkbox',\n\trequired: true,\n\tdefaultValue: false,\n})\n\n/**\n * One row per hit, keyed by a ULID of its time or `o` + an order's dedupe key, which is what\n * refuses a retried order. `type` is text, so a new hit type needs no Postgres enum migration.\n */\nexport const hitsCollection = (slug: string = HITS_SLUG): CollectionConfig =>\n\tstoreCollection({\n\t\tslug,\n\t\tfields: [\n\t\t\t{ name: 'scope', type: 'text', required: true, defaultValue: '' },\n\t\t\t{ name: 'ts', type: 'date', required: true },\n\t\t\t{ name: 'lastAt', type: 'date' },\n\t\t\t{ name: 'type', type: 'text', required: true },\n\t\t\t{ name: 'hostname', type: 'text', required: true },\n\t\t\t{ name: 'path', type: 'text', required: true },\n\t\t\t{ name: 'v', type: 'text', required: true },\n\t\t\tflag('landing'),\n\t\t\tflag('server'),\n\t\t\ttext('mode'),\n\t\t\ttext('name'),\n\t\t\ttext('ref'),\n\t\t\ttext('source'),\n\t\t\ttext('channel'),\n\t\t\ttext('clickId'),\n\t\t\ttext('utmSource'),\n\t\t\ttext('utmMedium'),\n\t\t\ttext('utmCampaign'),\n\t\t\ttext('utmContent'),\n\t\t\ttext('utmTerm'),\n\t\t\tnumber('channelVersion'),\n\t\t\ttext('country'),\n\t\t\ttext('region'),\n\t\t\ttext('city'),\n\t\t\ttext('language'),\n\t\t\ttext('device'),\n\t\t\ttext('browser'),\n\t\t\ttext('os'),\n\t\t\tnumber('durationMs'),\n\t\t\tnumber('scrollDepth'),\n\t\t\tnumber('value'),\n\t\t\tnumber('originalValue'),\n\t\t\tnumber('conversions'),\n\t\t\tnumber('revenue'),\n\t\t\ttext('currency'),\n\t\t\ttext('originalCurrency'),\n\t\t\ttext('item'),\n\t\t\tjson('props'),\n\t\t\tjson('goals'),\n\t\t\tjson('impressions'),\n\t\t],\n\t\tindexes: [{ fields: ['scope', 'ts'] }],\n\t})\n"],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nB;CACA,SAAS,CAAC,EAAE,QAAQ,CAAC,SAAS,IAAI,EAAE,CAAC;AACtC,CAAC"}
|
|
@@ -1275,6 +1275,8 @@ const createEngine = (input) => {
|
|
|
1275
1275
|
const failed = Math.max(failedIn(plans), failedIn(totalsBy?.plans ?? []));
|
|
1276
1276
|
const missing = Math.max(ofRows.missing.count, ofTotals.missing.count);
|
|
1277
1277
|
const visitorsAre = dayCount <= 1 ? "distinct" : "sumOfDaily";
|
|
1278
|
+
const withoutVisitor = totals.pageviewsWithoutVisitor ?? 0;
|
|
1279
|
+
const withoutConsent = totals.pageviewsWithoutConsent ?? 0;
|
|
1278
1280
|
return {
|
|
1279
1281
|
rows,
|
|
1280
1282
|
totals: partsToMetrics(totals, query.metrics),
|
|
@@ -1290,7 +1292,9 @@ const createEngine = (input) => {
|
|
|
1290
1292
|
...failed > 0 ? { failed: { days: failed } } : {},
|
|
1291
1293
|
...asOf ? { asOf: asOf.toISOString() } : {},
|
|
1292
1294
|
...every.some((plan) => plan.standIn) ? { timezoneUnresolved: true } : {},
|
|
1293
|
-
...mixed.length > 1 ? { mixedCurrencies: mixed } : {}
|
|
1295
|
+
...mixed.length > 1 ? { mixedCurrencies: mixed } : {},
|
|
1296
|
+
...withoutVisitor > 0 ? { withoutVisitor: { pageviews: withoutVisitor } } : {},
|
|
1297
|
+
...withoutConsent > 0 ? { withoutConsent: { pageviews: withoutConsent } } : {}
|
|
1294
1298
|
}
|
|
1295
1299
|
};
|
|
1296
1300
|
};
|