@10x-media/analytics 1.0.0-beta.12 → 1.0.0-beta.13
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 +67 -0
- package/dist/adapters/ga4/ga4.d.ts +6 -0
- package/dist/adapters/ga4/ga4.js +3 -2
- package/dist/adapters/ga4/ga4.js.map +1 -1
- package/dist/adapters/plausible/plausible.d.ts +6 -0
- package/dist/adapters/plausible/plausible.js +2 -1
- package/dist/adapters/plausible/plausible.js.map +1 -1
- package/dist/adapters/posthog/posthog.d.ts +6 -0
- package/dist/adapters/posthog/posthog.js +21 -8
- package/dist/adapters/posthog/posthog.js.map +1 -1
- package/dist/adapters/umami/umami.d.ts +6 -0
- package/dist/adapters/umami/umami.js +2 -1
- package/dist/adapters/umami/umami.js.map +1 -1
- package/dist/capture/exclusionEndpoint.js +1 -1
- package/dist/capture/exclusionEndpoint.js.map +1 -1
- package/dist/capture/slots.js +3 -3
- package/dist/capture/slots.js.map +1 -1
- package/dist/capture/trackerConfig.js +11 -3
- package/dist/capture/trackerConfig.js.map +1 -1
- package/dist/charts/series.js +1 -1
- package/dist/core/adminOptions.js +6 -1
- package/dist/core/adminOptions.js.map +1 -1
- package/dist/core/capture.d.ts +3 -1
- package/dist/core/contract.d.ts +13 -1
- package/dist/core/contract.js.map +1 -1
- package/dist/core/options.d.ts +37 -5
- package/dist/core/options.js +6 -2
- package/dist/core/options.js.map +1 -1
- package/dist/core/registry.js.map +1 -1
- package/dist/core/scopeOptions.js +2 -0
- package/dist/core/scopeOptions.js.map +1 -1
- package/dist/core/scopedRead.js +170 -21
- package/dist/core/scopedRead.js.map +1 -1
- package/dist/core/sourceLabel.d.ts +10 -0
- package/dist/core/sourceLabel.js +63 -0
- package/dist/core/sourceLabel.js.map +1 -0
- package/dist/core/sourceOptions.js +18 -6
- package/dist/core/sourceOptions.js.map +1 -1
- package/dist/core/sourcePolicy.d.ts +55 -0
- package/dist/core/sourcePolicy.js +51 -0
- package/dist/core/sourcePolicy.js.map +1 -0
- package/dist/exports/adapters/contract.d.ts +2 -1
- package/dist/exports/adapters/ga4.d.ts +3 -2
- package/dist/exports/adapters/native.d.ts +3 -2
- package/dist/exports/adapters/plausible.d.ts +3 -2
- package/dist/exports/adapters/posthog.d.ts +3 -2
- package/dist/exports/adapters/umami.d.ts +3 -2
- package/dist/exports/client.d.ts +7 -5
- package/dist/exports/client.js +2 -1
- package/dist/exports/next.d.ts +3 -2
- package/dist/exports/rsc.d.ts +7 -6
- package/dist/exports/testing.d.ts +3 -2
- package/dist/exports/types.d.ts +12 -8
- package/dist/fields/AnalyticsPanelClient.js.map +1 -1
- package/dist/fields/AnalyticsPanelField.d.ts +1 -1
- package/dist/fields/AnalyticsPanelField.js +3 -1
- package/dist/fields/AnalyticsPanelField.js.map +1 -1
- package/dist/fields/AnalyticsStatField.d.ts +1 -1
- package/dist/fields/AnalyticsStatField.js +1 -1
- package/dist/fields/PanelContent.js +6 -1
- package/dist/fields/PanelContent.js.map +1 -1
- package/dist/fields/config/fetchSources.d.ts +3 -0
- package/dist/fields/config/fetchSources.js +5 -3
- package/dist/fields/config/fetchSources.js.map +1 -1
- package/dist/fields/readForDocument.d.ts +5 -4
- package/dist/fields/readForDocument.js +6 -2
- package/dist/fields/readForDocument.js.map +1 -1
- package/dist/goals/collection.js +4 -31
- package/dist/goals/collection.js.map +1 -1
- package/dist/goals/resolver.js +2 -2
- package/dist/goals/trackGoalAction.js +1 -1
- package/dist/index.d.ts +14 -11
- package/dist/index.js +6 -5
- package/dist/index.js.map +1 -1
- package/dist/native/geo/maxmindResolver.js +1 -1
- package/dist/native/ingest/normalizeEvent.js +1 -1
- package/dist/native/nativeAdapter.d.ts +6 -0
- package/dist/native/nativeAdapter.js +3 -2
- package/dist/native/nativeAdapter.js.map +1 -1
- package/dist/plugin/createRuntime.js +6 -3
- package/dist/plugin/createRuntime.js.map +1 -1
- package/dist/plugin/documentEndpoint.js +1 -0
- package/dist/plugin/documentEndpoint.js.map +1 -1
- package/dist/plugin/pluginCollections.js +11 -5
- package/dist/plugin/pluginCollections.js.map +1 -1
- package/dist/plugin/queryEndpoint.js +1 -1
- package/dist/plugin/queryEndpoint.js.map +1 -1
- package/dist/plugin/readContextForRequest.d.ts +11 -0
- package/dist/plugin/readContextForRequest.js +25 -15
- package/dist/plugin/readContextForRequest.js.map +1 -1
- package/dist/plugin/runtime.js +13 -5
- package/dist/plugin/runtime.js.map +1 -1
- package/dist/plugin/sourcesEndpoint.js +8 -9
- package/dist/plugin/sourcesEndpoint.js.map +1 -1
- package/dist/providers/ProvidersListNotice.d.ts +11 -0
- package/dist/providers/ProvidersListNotice.js +36 -0
- package/dist/providers/ProvidersListNotice.js.map +1 -0
- package/dist/providers/collection.d.ts +9 -1
- package/dist/providers/collection.js +107 -42
- package/dist/providers/collection.js.map +1 -1
- package/dist/providers/factory.d.ts +1 -1
- package/dist/providers/factory.js +8 -11
- package/dist/providers/factory.js.map +1 -1
- package/dist/providers/probe.js +5 -1
- package/dist/providers/probe.js.map +1 -1
- package/dist/providers/registry.js +49 -39
- package/dist/providers/registry.js.map +1 -1
- package/dist/providers/resolver.js +6 -3
- package/dist/providers/resolver.js.map +1 -1
- package/dist/providers/scopeUnique.js +41 -0
- package/dist/providers/scopeUnique.js.map +1 -0
- package/dist/query/fetchQuery.d.ts +1 -1
- package/dist/surfacing/rebucket.js +1 -1
- package/dist/tracker/config.d.ts +5 -0
- package/dist/tracker/config.js.map +1 -1
- package/dist/tracker/sinks/createSink.js +4 -1
- package/dist/tracker/sinks/createSink.js.map +1 -1
- package/dist/tracker/sinks/ga4.js +2 -2
- package/dist/tracker/sinks/posthog.js +30 -2
- package/dist/tracker/sinks/posthog.js.map +1 -1
- package/dist/tracker/sinks/vendor.js +2 -2
- package/dist/tracker/sinks/vendor.js.map +1 -1
- package/dist/translations/ar.js +6 -0
- package/dist/translations/ar.js.map +1 -1
- package/dist/translations/de.js +6 -0
- package/dist/translations/de.js.map +1 -1
- package/dist/translations/en.js +6 -0
- package/dist/translations/en.js.map +1 -1
- package/dist/translations/es.js +6 -0
- package/dist/translations/es.js.map +1 -1
- package/dist/translations/fr.js +6 -0
- package/dist/translations/fr.js.map +1 -1
- package/dist/translations/id.js +6 -0
- package/dist/translations/id.js.map +1 -1
- package/dist/translations/keys.d.ts +6 -0
- package/dist/translations/keys.js +7 -1
- package/dist/translations/keys.js.map +1 -1
- package/dist/translations/ko.js +6 -0
- package/dist/translations/ko.js.map +1 -1
- package/dist/translations/pt.js +6 -0
- package/dist/translations/pt.js.map +1 -1
- package/dist/translations/ru.js +6 -0
- package/dist/translations/ru.js.map +1 -1
- package/dist/translations/uk.js +6 -0
- package/dist/translations/uk.js.map +1 -1
- package/dist/translations/zh.js +6 -0
- package/dist/translations/zh.js.map +1 -1
- package/dist/ui/analytics.css +5 -0
- package/dist/ui/components/SourcesNoticeBanner.js +20 -0
- package/dist/ui/components/SourcesNoticeBanner.js.map +1 -0
- package/dist/view/ViewRoot.js +2 -0
- package/dist/view/ViewRoot.js.map +1 -1
- package/dist/view/registerView.js +5 -4
- package/dist/view/registerView.js.map +1 -1
- package/dist/view/viewContext.d.ts +1 -1
- package/dist/view/viewProps.d.ts +1 -1
- package/dist/view/viewProps.js +3 -2
- package/dist/view/viewProps.js.map +1 -1
- package/dist/widgets/AnalyticsBreakdownWidget.js +1 -0
- package/dist/widgets/AnalyticsBreakdownWidget.js.map +1 -1
- package/dist/widgets/AnalyticsGoalsWidget.js +1 -0
- package/dist/widgets/AnalyticsGoalsWidget.js.map +1 -1
- package/dist/widgets/AnalyticsMetricWidget.js +1 -0
- package/dist/widgets/AnalyticsMetricWidget.js.map +1 -1
- package/dist/widgets/AnalyticsRealtimeWidget.js +15 -7
- package/dist/widgets/AnalyticsRealtimeWidget.js.map +1 -1
- package/dist/widgets/AnalyticsTrendWidget.js +1 -0
- package/dist/widgets/AnalyticsTrendWidget.js.map +1 -1
- package/dist/widgets/defaultLayout.d.ts +26 -0
- package/dist/widgets/defaultLayout.js +51 -0
- package/dist/widgets/defaultLayout.js.map +1 -0
- package/dist/widgets/notices.js +1 -0
- package/dist/widgets/notices.js.map +1 -1
- package/dist/widgets/prepareWidgetRead.d.ts +14 -1
- package/dist/widgets/prepareWidgetRead.js +6 -2
- package/dist/widgets/prepareWidgetRead.js.map +1 -1
- package/dist/widgets/readForWidget.d.ts +4 -4
- package/dist/widgets/readForWidget.js +3 -1
- package/dist/widgets/readForWidget.js.map +1 -1
- package/dist/widgets/readForWidgetBreakdown.d.ts +4 -4
- package/dist/widgets/readForWidgetBreakdown.js +3 -1
- package/dist/widgets/readForWidgetBreakdown.js.map +1 -1
- package/dist/widgets/readForWidgetGoals.d.ts +4 -4
- package/dist/widgets/readForWidgetGoals.js +3 -1
- package/dist/widgets/readForWidgetGoals.js.map +1 -1
- package/dist/widgets/readForWidgetRealtime.d.ts +4 -3
- package/dist/widgets/readForWidgetRealtime.js +3 -1
- package/dist/widgets/readForWidgetRealtime.js.map +1 -1
- package/dist/widgets/readForWidgetSeries.d.ts +4 -4
- package/dist/widgets/readForWidgetSeries.js +3 -1
- package/dist/widgets/readForWidgetSeries.js.map +1 -1
- package/dist/widgets/registerWidgets.js +3 -1
- package/dist/widgets/registerWidgets.js.map +1 -1
- package/package.json +2 -2
|
@@ -2,7 +2,8 @@ import { isRecord, kindOf, listOf } from "./values.js";
|
|
|
2
2
|
import { keysOf, optionalFunction, optionalList, optionsObject } from "./optionChecks.js";
|
|
3
3
|
import { resolveScopedCollection } from "./collectionOption.js";
|
|
4
4
|
import { resolveHostPolicy } from "../providers/hosts.js";
|
|
5
|
-
import {
|
|
5
|
+
import { PROVIDER_IDS } from "../providers/factory.js";
|
|
6
|
+
import { PROVIDERS_SLUG, connectionFieldAccess, servedProviderTypes } from "../providers/collection.js";
|
|
6
7
|
//#region src/core/sourceOptions.ts
|
|
7
8
|
const PROVIDERS_KEYS = keysOf({
|
|
8
9
|
collection: true,
|
|
@@ -17,12 +18,15 @@ const PROVIDERS_COLLECTION_KEYS = keysOf({
|
|
|
17
18
|
access: true,
|
|
18
19
|
encryption: true,
|
|
19
20
|
connectionAccess: true,
|
|
21
|
+
defaultAccess: true,
|
|
22
|
+
types: true,
|
|
20
23
|
sourceAccess: true
|
|
21
24
|
});
|
|
22
25
|
const PROVIDER_FIELD_KEYS = keysOf({
|
|
23
26
|
name: true,
|
|
24
27
|
provider: true,
|
|
25
|
-
enabled: true
|
|
28
|
+
enabled: true,
|
|
29
|
+
isDefault: true
|
|
26
30
|
});
|
|
27
31
|
const ENCRYPTION_KEYS = keysOf({ keys: true });
|
|
28
32
|
const isAdapterShaped = (value) => isRecord(value) && typeof value.id === "string" && value.id !== "" && typeof value.isConfigured === "function" && typeof value.query === "function" && isRecord(value.capabilities);
|
|
@@ -51,8 +55,10 @@ const assertEncryption = (value) => {
|
|
|
51
55
|
});
|
|
52
56
|
if (keys !== void 0 && (!isRecord(keys) || typeof keys.active !== "string" || !isRecord(keys.keys))) throw new Error(`analytics: providers.collection.encryption.keys must be a key set such as { active: 'k1', keys: { k1: process.env.PROVIDER_KEY } }, got ${kindOf(keys)}`);
|
|
53
57
|
};
|
|
58
|
+
/** A `native` document lends the config native(), so the type is served only beside one. */
|
|
59
|
+
const availableTypes = (adapters) => PROVIDER_IDS.filter((type) => type !== "native" || adapters.some((a) => a.id === "native"));
|
|
54
60
|
/** `providers.collection` turned on, with what only that collection takes. */
|
|
55
|
-
const resolveProvidersCollection = (option) => {
|
|
61
|
+
const resolveProvidersCollection = (option, available) => {
|
|
56
62
|
const collection = resolveScopedCollection(option, {
|
|
57
63
|
path: "providers.collection",
|
|
58
64
|
fallback: PROVIDERS_SLUG,
|
|
@@ -60,26 +66,32 @@ const resolveProvidersCollection = (option) => {
|
|
|
60
66
|
fieldKeys: PROVIDER_FIELD_KEYS,
|
|
61
67
|
exampleSlug: "providers"
|
|
62
68
|
});
|
|
63
|
-
if (option === void 0 || typeof option === "boolean") return
|
|
69
|
+
if (option === void 0 || typeof option === "boolean") return {
|
|
70
|
+
...collection,
|
|
71
|
+
types: available
|
|
72
|
+
};
|
|
64
73
|
assertEncryption(option.encryption);
|
|
65
74
|
const connectionAccess = connectionFieldAccess("providers.collection.connectionAccess", option.connectionAccess);
|
|
75
|
+
const defaultAccess = connectionFieldAccess("providers.collection.defaultAccess", option.defaultAccess);
|
|
66
76
|
const sourceAccess = optionalFunction(option.sourceAccess, "providers.collection.sourceAccess");
|
|
67
77
|
return {
|
|
68
78
|
...collection,
|
|
79
|
+
types: servedProviderTypes("providers.collection.types", option.types, available),
|
|
69
80
|
...option.encryption ? { encryption: option.encryption } : {},
|
|
70
81
|
...connectionAccess ? { connectionAccess } : {},
|
|
82
|
+
...defaultAccess ? { defaultAccess } : {},
|
|
71
83
|
...sourceAccess ? { sourceAccess } : {}
|
|
72
84
|
};
|
|
73
85
|
};
|
|
74
86
|
/** `providers`: the collection or `resolve` (never both), and the hosts either may reach. */
|
|
75
|
-
const resolveProviders = (option) => {
|
|
87
|
+
const resolveProviders = (option, adapters) => {
|
|
76
88
|
if (option !== void 0) optionsObject(option, {
|
|
77
89
|
path: "providers",
|
|
78
90
|
known: PROVIDERS_KEYS,
|
|
79
91
|
example: "an object such as { collection: true }"
|
|
80
92
|
});
|
|
81
93
|
const resolve = optionalFunction(option?.resolve, "providers.resolve");
|
|
82
|
-
const collection = resolveProvidersCollection(option?.collection);
|
|
94
|
+
const collection = resolveProvidersCollection(option?.collection, availableTypes(adapters));
|
|
83
95
|
if (resolve && collection.enabled) throw new Error("analytics: providers.resolve and providers.collection cannot both be set. resolve replaces the collection lookup, so the adapters it returns would be filtered by provider document ids no reader holds, and the collection's sourceAccess and connectionAccess would do nothing. Keep one of them.");
|
|
84
96
|
if (option?.hosts !== void 0 && !collection.enabled && !resolve) throw new Error("analytics: providers.hosts only applies to provider documents, so it needs providers.collection or providers.resolve. Set one of them, or remove it.");
|
|
85
97
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sourceOptions.js","names":[],"sources":["../../src/core/sourceOptions.ts"],"sourcesContent":["import {\n\tconnectionFieldAccess,\n\tPROVIDERS_SLUG,\n\ttype ProviderCollectionFieldOverrides,\n} from '../providers/collection'\nimport { resolveHostPolicy } from '../providers/hosts'\nimport { resolveScopedCollection } from './collectionOption'\nimport { keysOf, optionalFunction, optionalList, optionsObject } from './optionChecks'\nimport type { ProvidersCollectionOptions, ProvidersOptions, ResolvedOptions } from './options'\nimport { isRecord, kindOf, listOf } from './values'\n\nconst PROVIDERS_KEYS = keysOf<ProvidersOptions>({ collection: true, resolve: true, hosts: true })\nconst PROVIDERS_COLLECTION_KEYS = keysOf<ProvidersCollectionOptions>({\n\tslug: true,\n\tscopeField: true,\n\tfields: true,\n\toverrides: true,\n\taccess: true,\n\tencryption: true,\n\tconnectionAccess: true,\n\tsourceAccess: true,\n})\nconst PROVIDER_FIELD_KEYS = keysOf<ProviderCollectionFieldOverrides>({\n\tname: true,\n\tprovider: true,\n\tenabled: true,\n})\nconst ENCRYPTION_KEYS = keysOf<NonNullable<ProvidersCollectionOptions['encryption']>>({\n\tkeys: true,\n})\n\nconst isAdapterShaped = (value: unknown): value is { id: string } =>\n\tisRecord(value) &&\n\ttypeof value.id === 'string' &&\n\tvalue.id !== '' &&\n\ttypeof value.isConfigured === 'function' &&\n\ttypeof value.query === 'function' &&\n\tisRecord(value.capabilities)\n\n/** `adapters`: a list of adapters with an id each, no two sharing one. */\nexport const assertAdapters = (value: unknown): void => {\n\tconst ids = new Set<string>()\n\tfor (const [index, adapter] of optionalList(value, 'adapters', '[native()]').entries()) {\n\t\tif (!isAdapterShaped(adapter)) {\n\t\t\tthrow new Error(\n\t\t\t\t`analytics: adapters[${index}] must be an adapter such as native() or plausible({ siteId, apiKey }), got ${kindOf(adapter)}`\n\t\t\t)\n\t\t}\n\t\tif (ids.has(adapter.id)) {\n\t\t\tthrow new Error(\n\t\t\t\t`analytics: adapters lists two adapters with the id \"${adapter.id}\"; every source is read by its id, so give each its own`\n\t\t\t)\n\t\t}\n\t\tids.add(adapter.id)\n\t}\n}\n\n/** An option naming one of `adapters` by its id. */\nexport const assertNamesAdapter = (\n\tvalue: unknown,\n\tpath: string,\n\tadapters: readonly { id: string }[]\n): void => {\n\tif (value === undefined) {\n\t\treturn\n\t}\n\tif (typeof value !== 'string') {\n\t\tthrow new Error(\n\t\t\t`analytics: ${path} must be the id of an adapter in adapters, got ${kindOf(value)}`\n\t\t)\n\t}\n\tif (!adapters.some((adapter) => adapter.id === value)) {\n\t\tthrow new Error(\n\t\t\t`analytics: ${path} \"${value}\" names no adapter in adapters, whose ids are ${listOf(adapters.map((adapter) => `\"${adapter.id}\"`))}`\n\t\t)\n\t}\n}\n\n/** `providers.collection.encryption`: a dedicated key ring, or nothing. */\nconst assertEncryption = (value: unknown): void => {\n\tif (value === undefined) {\n\t\treturn\n\t}\n\tconst { keys } = optionsObject(value, {\n\t\tpath: 'providers.collection.encryption',\n\t\tknown: ENCRYPTION_KEYS,\n\t\texample: 'an object such as { keys }',\n\t})\n\tif (\n\t\tkeys !== undefined &&\n\t\t(!isRecord(keys) || typeof keys.active !== 'string' || !isRecord(keys.keys))\n\t) {\n\t\tthrow new Error(\n\t\t\t`analytics: providers.collection.encryption.keys must be a key set such as { active: 'k1', keys: { k1: process.env.PROVIDER_KEY } }, got ${kindOf(keys)}`\n\t\t)\n\t}\n}\n\n/** `providers.collection` turned on, with what only that collection takes. */\nconst resolveProvidersCollection = (\n\toption: ProvidersOptions['collection']\n): ResolvedOptions['providers']['collection'] => {\n\tconst collection = resolveScopedCollection(option, {\n\t\tpath: 'providers.collection',\n\t\tfallback: PROVIDERS_SLUG,\n\t\tknown: PROVIDERS_COLLECTION_KEYS,\n\t\tfieldKeys: PROVIDER_FIELD_KEYS,\n\t\texampleSlug: 'providers',\n\t})\n\tif (option === undefined || typeof option === 'boolean') {\n\t\treturn collection\n\t}\n\tassertEncryption(option.encryption)\n\tconst connectionAccess = connectionFieldAccess(\n\t\t'providers.collection.connectionAccess',\n\t\toption.connectionAccess\n\t)\n\tconst sourceAccess = optionalFunction(option.sourceAccess, 'providers.collection.sourceAccess')\n\treturn {\n\t\t...collection,\n\t\t...(option.encryption ? { encryption: option.encryption } : {}),\n\t\t...(connectionAccess ? { connectionAccess } : {}),\n\t\t...(sourceAccess ? { sourceAccess } : {}),\n\t}\n}\n\n/** `providers`: the collection or `resolve` (never both), and the hosts either may reach. */\nexport const resolveProviders = (\n\toption: ProvidersOptions | undefined\n): ResolvedOptions['providers'] => {\n\tif (option !== undefined) {\n\t\toptionsObject(option, {\n\t\t\tpath: 'providers',\n\t\t\tknown: PROVIDERS_KEYS,\n\t\t\texample: 'an object such as { collection: true }',\n\t\t})\n\t}\n\tconst resolve = optionalFunction(option?.resolve, 'providers.resolve')\n\tconst collection = resolveProvidersCollection(option?.collection)\n\tif (resolve && collection.enabled) {\n\t\tthrow new Error(\n\t\t\t\"analytics: providers.resolve and providers.collection cannot both be set. resolve replaces the collection lookup, so the adapters it returns would be filtered by provider document ids no reader holds, and the collection's sourceAccess and connectionAccess would do nothing. Keep one of them.\"\n\t\t)\n\t}\n\tif (option?.hosts !== undefined && !collection.enabled && !resolve) {\n\t\tthrow new Error(\n\t\t\t'analytics: providers.hosts only applies to provider documents, so it needs providers.collection or providers.resolve. Set one of them, or remove it.'\n\t\t)\n\t}\n\treturn {\n\t\tcollection,\n\t\t...(resolve ? { resolve } : {}),\n\t\thosts: resolveHostPolicy(option?.hosts),\n\t}\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"sourceOptions.js","names":[],"sources":["../../src/core/sourceOptions.ts"],"sourcesContent":["import {\n\tconnectionFieldAccess,\n\tPROVIDERS_SLUG,\n\ttype ProviderCollectionFieldOverrides,\n\tservedProviderTypes,\n} from '../providers/collection'\nimport { PROVIDER_IDS, type ProviderId } from '../providers/factory'\nimport { resolveHostPolicy } from '../providers/hosts'\nimport { resolveScopedCollection } from './collectionOption'\nimport { keysOf, optionalFunction, optionalList, optionsObject } from './optionChecks'\nimport type { ProvidersCollectionOptions, ProvidersOptions, ResolvedOptions } from './options'\nimport { isRecord, kindOf, listOf } from './values'\n\nconst PROVIDERS_KEYS = keysOf<ProvidersOptions>({ collection: true, resolve: true, hosts: true })\nconst PROVIDERS_COLLECTION_KEYS = keysOf<ProvidersCollectionOptions>({\n\tslug: true,\n\tscopeField: true,\n\tfields: true,\n\toverrides: true,\n\taccess: true,\n\tencryption: true,\n\tconnectionAccess: true,\n\tdefaultAccess: true,\n\ttypes: true,\n\tsourceAccess: true,\n})\nconst PROVIDER_FIELD_KEYS = keysOf<ProviderCollectionFieldOverrides>({\n\tname: true,\n\tprovider: true,\n\tenabled: true,\n\tisDefault: true,\n})\nconst ENCRYPTION_KEYS = keysOf<NonNullable<ProvidersCollectionOptions['encryption']>>({\n\tkeys: true,\n})\n\nconst isAdapterShaped = (value: unknown): value is { id: string } =>\n\tisRecord(value) &&\n\ttypeof value.id === 'string' &&\n\tvalue.id !== '' &&\n\ttypeof value.isConfigured === 'function' &&\n\ttypeof value.query === 'function' &&\n\tisRecord(value.capabilities)\n\n/** `adapters`: a list of adapters with an id each, no two sharing one. */\nexport const assertAdapters = (value: unknown): void => {\n\tconst ids = new Set<string>()\n\tfor (const [index, adapter] of optionalList(value, 'adapters', '[native()]').entries()) {\n\t\tif (!isAdapterShaped(adapter)) {\n\t\t\tthrow new Error(\n\t\t\t\t`analytics: adapters[${index}] must be an adapter such as native() or plausible({ siteId, apiKey }), got ${kindOf(adapter)}`\n\t\t\t)\n\t\t}\n\t\tif (ids.has(adapter.id)) {\n\t\t\tthrow new Error(\n\t\t\t\t`analytics: adapters lists two adapters with the id \"${adapter.id}\"; every source is read by its id, so give each its own`\n\t\t\t)\n\t\t}\n\t\tids.add(adapter.id)\n\t}\n}\n\n/** An option naming one of `adapters` by its id. */\nexport const assertNamesAdapter = (\n\tvalue: unknown,\n\tpath: string,\n\tadapters: readonly { id: string }[]\n): void => {\n\tif (value === undefined) {\n\t\treturn\n\t}\n\tif (typeof value !== 'string') {\n\t\tthrow new Error(\n\t\t\t`analytics: ${path} must be the id of an adapter in adapters, got ${kindOf(value)}`\n\t\t)\n\t}\n\tif (!adapters.some((adapter) => adapter.id === value)) {\n\t\tthrow new Error(\n\t\t\t`analytics: ${path} \"${value}\" names no adapter in adapters, whose ids are ${listOf(adapters.map((adapter) => `\"${adapter.id}\"`))}`\n\t\t)\n\t}\n}\n\n/** `providers.collection.encryption`: a dedicated key ring, or nothing. */\nconst assertEncryption = (value: unknown): void => {\n\tif (value === undefined) {\n\t\treturn\n\t}\n\tconst { keys } = optionsObject(value, {\n\t\tpath: 'providers.collection.encryption',\n\t\tknown: ENCRYPTION_KEYS,\n\t\texample: 'an object such as { keys }',\n\t})\n\tif (\n\t\tkeys !== undefined &&\n\t\t(!isRecord(keys) || typeof keys.active !== 'string' || !isRecord(keys.keys))\n\t) {\n\t\tthrow new Error(\n\t\t\t`analytics: providers.collection.encryption.keys must be a key set such as { active: 'k1', keys: { k1: process.env.PROVIDER_KEY } }, got ${kindOf(keys)}`\n\t\t)\n\t}\n}\n\n/** A `native` document lends the config native(), so the type is served only beside one. */\nconst availableTypes = (adapters: readonly { id: string }[]): ProviderId[] =>\n\tPROVIDER_IDS.filter((type) => type !== 'native' || adapters.some((a) => a.id === 'native'))\n\n/** `providers.collection` turned on, with what only that collection takes. */\nconst resolveProvidersCollection = (\n\toption: ProvidersOptions['collection'],\n\tavailable: readonly ProviderId[]\n): ResolvedOptions['providers']['collection'] => {\n\tconst collection = resolveScopedCollection(option, {\n\t\tpath: 'providers.collection',\n\t\tfallback: PROVIDERS_SLUG,\n\t\tknown: PROVIDERS_COLLECTION_KEYS,\n\t\tfieldKeys: PROVIDER_FIELD_KEYS,\n\t\texampleSlug: 'providers',\n\t})\n\tif (option === undefined || typeof option === 'boolean') {\n\t\treturn { ...collection, types: available }\n\t}\n\tassertEncryption(option.encryption)\n\tconst connectionAccess = connectionFieldAccess(\n\t\t'providers.collection.connectionAccess',\n\t\toption.connectionAccess\n\t)\n\tconst defaultAccess = connectionFieldAccess(\n\t\t'providers.collection.defaultAccess',\n\t\toption.defaultAccess\n\t)\n\tconst sourceAccess = optionalFunction(option.sourceAccess, 'providers.collection.sourceAccess')\n\treturn {\n\t\t...collection,\n\t\ttypes: servedProviderTypes('providers.collection.types', option.types, available),\n\t\t...(option.encryption ? { encryption: option.encryption } : {}),\n\t\t...(connectionAccess ? { connectionAccess } : {}),\n\t\t...(defaultAccess ? { defaultAccess } : {}),\n\t\t...(sourceAccess ? { sourceAccess } : {}),\n\t}\n}\n\n/** `providers`: the collection or `resolve` (never both), and the hosts either may reach. */\nexport const resolveProviders = (\n\toption: ProvidersOptions | undefined,\n\tadapters: readonly { id: string }[]\n): ResolvedOptions['providers'] => {\n\tif (option !== undefined) {\n\t\toptionsObject(option, {\n\t\t\tpath: 'providers',\n\t\t\tknown: PROVIDERS_KEYS,\n\t\t\texample: 'an object such as { collection: true }',\n\t\t})\n\t}\n\tconst resolve = optionalFunction(option?.resolve, 'providers.resolve')\n\tconst collection = resolveProvidersCollection(option?.collection, availableTypes(adapters))\n\tif (resolve && collection.enabled) {\n\t\tthrow new Error(\n\t\t\t\"analytics: providers.resolve and providers.collection cannot both be set. resolve replaces the collection lookup, so the adapters it returns would be filtered by provider document ids no reader holds, and the collection's sourceAccess and connectionAccess would do nothing. Keep one of them.\"\n\t\t)\n\t}\n\tif (option?.hosts !== undefined && !collection.enabled && !resolve) {\n\t\tthrow new Error(\n\t\t\t'analytics: providers.hosts only applies to provider documents, so it needs providers.collection or providers.resolve. Set one of them, or remove it.'\n\t\t)\n\t}\n\treturn {\n\t\tcollection,\n\t\t...(resolve ? { resolve } : {}),\n\t\thosts: resolveHostPolicy(option?.hosts),\n\t}\n}\n"],"mappings":";;;;;;;AAaA,MAAM,iBAAiB,OAAyB;CAAE,YAAY;CAAM,SAAS;CAAM,OAAO;AAAK,CAAC;AAChG,MAAM,4BAA4B,OAAmC;CACpE,MAAM;CACN,YAAY;CACZ,QAAQ;CACR,WAAW;CACX,QAAQ;CACR,YAAY;CACZ,kBAAkB;CAClB,eAAe;CACf,OAAO;CACP,cAAc;AACf,CAAC;AACD,MAAM,sBAAsB,OAAyC;CACpE,MAAM;CACN,UAAU;CACV,SAAS;CACT,WAAW;AACZ,CAAC;AACD,MAAM,kBAAkB,OAA8D,EACrF,MAAM,KACP,CAAC;AAED,MAAM,mBAAmB,UACxB,SAAS,KAAK,KACd,OAAO,MAAM,OAAO,YACpB,MAAM,OAAO,MACb,OAAO,MAAM,iBAAiB,cAC9B,OAAO,MAAM,UAAU,cACvB,SAAS,MAAM,YAAY;;AAG5B,MAAa,kBAAkB,UAAyB;CACvD,MAAM,sBAAM,IAAI,IAAY;CAC5B,KAAK,MAAM,CAAC,OAAO,YAAY,aAAa,OAAO,YAAY,YAAY,EAAE,QAAQ,GAAG;EACvF,IAAI,CAAC,gBAAgB,OAAO,GAC3B,MAAM,IAAI,MACT,uBAAuB,MAAM,8EAA8E,OAAO,OAAO,GAC1H;EAED,IAAI,IAAI,IAAI,QAAQ,EAAE,GACrB,MAAM,IAAI,MACT,uDAAuD,QAAQ,GAAG,wDACnE;EAED,IAAI,IAAI,QAAQ,EAAE;CACnB;AACD;;AAGA,MAAa,sBACZ,OACA,MACA,aACU;CACV,IAAI,UAAU,KAAA,GACb;CAED,IAAI,OAAO,UAAU,UACpB,MAAM,IAAI,MACT,cAAc,KAAK,iDAAiD,OAAO,KAAK,GACjF;CAED,IAAI,CAAC,SAAS,MAAM,YAAY,QAAQ,OAAO,KAAK,GACnD,MAAM,IAAI,MACT,cAAc,KAAK,IAAI,MAAM,gDAAgD,OAAO,SAAS,KAAK,YAAY,IAAI,QAAQ,GAAG,EAAE,CAAC,GACjI;AAEF;;AAGA,MAAM,oBAAoB,UAAyB;CAClD,IAAI,UAAU,KAAA,GACb;CAED,MAAM,EAAE,SAAS,cAAc,OAAO;EACrC,MAAM;EACN,OAAO;EACP,SAAS;CACV,CAAC;CACD,IACC,SAAS,KAAA,MACR,CAAC,SAAS,IAAI,KAAK,OAAO,KAAK,WAAW,YAAY,CAAC,SAAS,KAAK,IAAI,IAE1E,MAAM,IAAI,MACT,2IAA2I,OAAO,IAAI,GACvJ;AAEF;;AAGA,MAAM,kBAAkB,aACvB,aAAa,QAAQ,SAAS,SAAS,YAAY,SAAS,MAAM,MAAM,EAAE,OAAO,QAAQ,CAAC;;AAG3F,MAAM,8BACL,QACA,cACgD;CAChD,MAAM,aAAa,wBAAwB,QAAQ;EAClD,MAAM;EACN,UAAU;EACV,OAAO;EACP,WAAW;EACX,aAAa;CACd,CAAC;CACD,IAAI,WAAW,KAAA,KAAa,OAAO,WAAW,WAC7C,OAAO;EAAE,GAAG;EAAY,OAAO;CAAU;CAE1C,iBAAiB,OAAO,UAAU;CAClC,MAAM,mBAAmB,sBACxB,yCACA,OAAO,gBACR;CACA,MAAM,gBAAgB,sBACrB,sCACA,OAAO,aACR;CACA,MAAM,eAAe,iBAAiB,OAAO,cAAc,mCAAmC;CAC9F,OAAO;EACN,GAAG;EACH,OAAO,oBAAoB,8BAA8B,OAAO,OAAO,SAAS;EAChF,GAAI,OAAO,aAAa,EAAE,YAAY,OAAO,WAAW,IAAI,CAAC;EAC7D,GAAI,mBAAmB,EAAE,iBAAiB,IAAI,CAAC;EAC/C,GAAI,gBAAgB,EAAE,cAAc,IAAI,CAAC;EACzC,GAAI,eAAe,EAAE,aAAa,IAAI,CAAC;CACxC;AACD;;AAGA,MAAa,oBACZ,QACA,aACkC;CAClC,IAAI,WAAW,KAAA,GACd,cAAc,QAAQ;EACrB,MAAM;EACN,OAAO;EACP,SAAS;CACV,CAAC;CAEF,MAAM,UAAU,iBAAiB,QAAQ,SAAS,mBAAmB;CACrE,MAAM,aAAa,2BAA2B,QAAQ,YAAY,eAAe,QAAQ,CAAC;CAC1F,IAAI,WAAW,WAAW,SACzB,MAAM,IAAI,MACT,qSACD;CAED,IAAI,QAAQ,UAAU,KAAA,KAAa,CAAC,WAAW,WAAW,CAAC,SAC1D,MAAM,IAAI,MACT,sJACD;CAED,OAAO;EACN;EACA,GAAI,UAAU,EAAE,QAAQ,IAAI,CAAC;EAC7B,OAAO,kBAAkB,QAAQ,KAAK;CACvC;AACD"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { PayloadRequest } from "payload";
|
|
2
|
+
|
|
3
|
+
//#region src/core/sourcePolicy.d.ts
|
|
4
|
+
/** A source one scope reads through, as `defaultSource` is shown it. */
|
|
5
|
+
interface SourceRef {
|
|
6
|
+
id: string;
|
|
7
|
+
label: string;
|
|
8
|
+
/** `config` for an adapter every scope shares, `runtime` for one resolved per scope. */
|
|
9
|
+
kind: 'config' | 'runtime';
|
|
10
|
+
/** The provider document granting it to the scope; absent for a shared adapter none grants. */
|
|
11
|
+
docId?: string;
|
|
12
|
+
}
|
|
13
|
+
/** A source the reader reads a scope through by one of that scope's own provider documents. */
|
|
14
|
+
interface OwnSource {
|
|
15
|
+
id: string;
|
|
16
|
+
label: string;
|
|
17
|
+
docId: string;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Decides whether a member of `scope` reads it through the shared adapter `adapterId`. Asked at
|
|
21
|
+
* most once per request, scope and adapter; a throw counts as no.
|
|
22
|
+
*/
|
|
23
|
+
type SourcePolicyFunction = (args: {
|
|
24
|
+
req: PayloadRequest;
|
|
25
|
+
scope: string;
|
|
26
|
+
adapterId: string; /** Sources the reader already reads the scope through by its own provider documents. */
|
|
27
|
+
ownSources: OwnSource[];
|
|
28
|
+
}) => boolean | Promise<boolean>;
|
|
29
|
+
/**
|
|
30
|
+
* Who besides `access.crossScope.unscopedSource` reads a tenant through a shared adapter: `staff`
|
|
31
|
+
* nobody else, `tenant` the scope's members, `fallback` its members until they have a source of their own.
|
|
32
|
+
*/
|
|
33
|
+
type SourcePolicy = 'staff' | 'tenant' | 'fallback' | SourcePolicyFunction;
|
|
34
|
+
/** How tenants reach one shared config adapter. */
|
|
35
|
+
interface AnalyticsSourceOptions {
|
|
36
|
+
/**
|
|
37
|
+
* Which of a tenant's own users read it, narrowed to their tenant. Default `staff`. Anything else
|
|
38
|
+
* needs an adapter that narrows a query to one scope (`capabilities.scopedQueries`).
|
|
39
|
+
*/
|
|
40
|
+
tenants?: SourcePolicy;
|
|
41
|
+
}
|
|
42
|
+
/** Picks a tenant scope's default source by id; an id it cannot read leaves the default alone. */
|
|
43
|
+
type DefaultSourceFunction = (args: {
|
|
44
|
+
req: PayloadRequest;
|
|
45
|
+
scope: string;
|
|
46
|
+
sources: SourceRef[];
|
|
47
|
+
}) => string | undefined | Promise<string | undefined>;
|
|
48
|
+
/**
|
|
49
|
+
* A tenant scope's default source when no provider document of it is flagged the default:
|
|
50
|
+
* `tenantFirst` its own first, `platformFirst` the `platformAdapter`, or a function.
|
|
51
|
+
*/
|
|
52
|
+
type DefaultSourceRule = 'tenantFirst' | 'platformFirst' | DefaultSourceFunction;
|
|
53
|
+
//#endregion
|
|
54
|
+
export { AnalyticsSourceOptions, DefaultSourceFunction, DefaultSourceRule, OwnSource, SourcePolicy, SourcePolicyFunction, SourceRef };
|
|
55
|
+
//# sourceMappingURL=sourcePolicy.d.ts.map
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { isRecord, kindOf, listOf } from "./values.js";
|
|
2
|
+
import { keysOf, optionsObject } from "./optionChecks.js";
|
|
3
|
+
//#region src/core/sourcePolicy.ts
|
|
4
|
+
const SOURCE_KEYS = keysOf({ tenants: true });
|
|
5
|
+
const POLICY_NAMES = [
|
|
6
|
+
"staff",
|
|
7
|
+
"tenant",
|
|
8
|
+
"fallback"
|
|
9
|
+
];
|
|
10
|
+
const DEFAULT_RULES = ["tenantFirst", "platformFirst"];
|
|
11
|
+
const isPolicy = (value) => typeof value === "function" || typeof value === "string" && POLICY_NAMES.includes(value);
|
|
12
|
+
const isDefaultRule = (value) => typeof value === "function" || typeof value === "string" && DEFAULT_RULES.includes(value);
|
|
13
|
+
const resolvePolicy = (id, entry, adapter) => {
|
|
14
|
+
const { tenants } = optionsObject(entry, {
|
|
15
|
+
path: `sources.${id}`,
|
|
16
|
+
known: SOURCE_KEYS,
|
|
17
|
+
example: "an object such as { tenants: 'fallback' }"
|
|
18
|
+
});
|
|
19
|
+
if (tenants === void 0) return;
|
|
20
|
+
if (!isPolicy(tenants)) throw new Error(`analytics: sources.${id}.tenants must be 'staff', 'tenant', 'fallback' or a function, got ${kindOf(tenants)}`);
|
|
21
|
+
if (tenants === "staff") return;
|
|
22
|
+
if (adapter.capabilities.scopedQueries !== true) throw new Error(`analytics: sources.${id}.tenants lets a tenant's own users read through the "${id}" adapter, which cannot narrow a query to one scope (it lacks capabilities.scopedQueries), so a tenant would read every tenant's totals. Leave it 'staff', or give it to an adapter that supports scoped queries.`);
|
|
23
|
+
return tenants;
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* `sources` and `defaultSource`. A switched-off plugin given no adapters has nothing to check
|
|
27
|
+
* the keys against, and reads through nothing anyway.
|
|
28
|
+
*/
|
|
29
|
+
const resolveSources = (options) => {
|
|
30
|
+
const { sources, defaultSource } = options;
|
|
31
|
+
if (defaultSource !== void 0 && !isDefaultRule(defaultSource)) throw new Error(`analytics: defaultSource must be 'tenantFirst', 'platformFirst' or a function, got ${kindOf(defaultSource)}`);
|
|
32
|
+
if (defaultSource === "platformFirst" && options.platformAdapter === void 0) throw new Error("analytics: defaultSource 'platformFirst' opens each tenant on the platformAdapter, which is not set; set platformAdapter or pick another rule");
|
|
33
|
+
const policies = /* @__PURE__ */ new Map();
|
|
34
|
+
if (sources !== void 0 && (!isRecord(sources) || Array.isArray(sources))) throw new Error(`analytics: sources must be an object keyed by adapter id, such as { posthog: { tenants: 'fallback' } }, got ${kindOf(sources)}`);
|
|
35
|
+
const adapters = options.adapters ?? [];
|
|
36
|
+
if (adapters.length > 0) for (const [id, entry] of Object.entries(sources ?? {})) {
|
|
37
|
+
if (entry === void 0) continue;
|
|
38
|
+
const adapter = adapters.find((candidate) => candidate.id === id);
|
|
39
|
+
if (!adapter) throw new Error(`analytics: sources.${id} names no adapter in adapters, whose ids are ${listOf(adapters.map((known) => `"${known.id}"`))}; sources is keyed by the id of a config adapter`);
|
|
40
|
+
const policy = resolvePolicy(id, entry, adapter);
|
|
41
|
+
if (policy !== void 0) policies.set(id, policy);
|
|
42
|
+
}
|
|
43
|
+
return {
|
|
44
|
+
policies,
|
|
45
|
+
...defaultSource === void 0 ? {} : { defaultSource }
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
//#endregion
|
|
49
|
+
export { resolveSources };
|
|
50
|
+
|
|
51
|
+
//# sourceMappingURL=sourcePolicy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sourcePolicy.js","names":[],"sources":["../../src/core/sourcePolicy.ts"],"sourcesContent":["import type { PayloadRequest } from 'payload'\nimport type { AnalyticsAdapter } from './contract'\nimport { keysOf, optionsObject } from './optionChecks'\nimport { isRecord, kindOf, listOf } from './values'\n\n/** A source one scope reads through, as `defaultSource` is shown it. */\nexport interface SourceRef {\n\tid: string\n\tlabel: string\n\t/** `config` for an adapter every scope shares, `runtime` for one resolved per scope. */\n\tkind: 'config' | 'runtime'\n\t/** The provider document granting it to the scope; absent for a shared adapter none grants. */\n\tdocId?: string\n}\n\n/** A source the reader reads a scope through by one of that scope's own provider documents. */\nexport interface OwnSource {\n\tid: string\n\tlabel: string\n\tdocId: string\n}\n\n/**\n * Decides whether a member of `scope` reads it through the shared adapter `adapterId`. Asked at\n * most once per request, scope and adapter; a throw counts as no.\n */\nexport type SourcePolicyFunction = (args: {\n\treq: PayloadRequest\n\tscope: string\n\tadapterId: string\n\t/** Sources the reader already reads the scope through by its own provider documents. */\n\townSources: OwnSource[]\n}) => boolean | Promise<boolean>\n\n/**\n * Who besides `access.crossScope.unscopedSource` reads a tenant through a shared adapter: `staff`\n * nobody else, `tenant` the scope's members, `fallback` its members until they have a source of their own.\n */\nexport type SourcePolicy = 'staff' | 'tenant' | 'fallback' | SourcePolicyFunction\n\n/** How tenants reach one shared config adapter. */\nexport interface AnalyticsSourceOptions {\n\t/**\n\t * Which of a tenant's own users read it, narrowed to their tenant. Default `staff`. Anything else\n\t * needs an adapter that narrows a query to one scope (`capabilities.scopedQueries`).\n\t */\n\ttenants?: SourcePolicy\n}\n\n/** Picks a tenant scope's default source by id; an id it cannot read leaves the default alone. */\nexport type DefaultSourceFunction = (args: {\n\treq: PayloadRequest\n\tscope: string\n\tsources: SourceRef[]\n}) => string | undefined | Promise<string | undefined>\n\n/**\n * A tenant scope's default source when no provider document of it is flagged the default:\n * `tenantFirst` its own first, `platformFirst` the `platformAdapter`, or a function.\n */\nexport type DefaultSourceRule = 'tenantFirst' | 'platformFirst' | DefaultSourceFunction\n\n/** `sources` and `defaultSource`, checked against the adapters they name. */\nexport interface ResolvedSources {\n\t/** Each config adapter whose tenants read under a policy other than `staff`. */\n\tpolicies: ReadonlyMap<string, Exclude<SourcePolicy, 'staff'>>\n\tdefaultSource?: DefaultSourceRule\n}\n\nconst SOURCE_KEYS = keysOf<AnalyticsSourceOptions>({ tenants: true })\nconst POLICY_NAMES: readonly string[] = ['staff', 'tenant', 'fallback']\nconst DEFAULT_RULES: readonly string[] = ['tenantFirst', 'platformFirst']\n\nconst isPolicy = (value: unknown): value is SourcePolicy =>\n\ttypeof value === 'function' || (typeof value === 'string' && POLICY_NAMES.includes(value))\n\nconst isDefaultRule = (value: unknown): value is DefaultSourceRule =>\n\ttypeof value === 'function' || (typeof value === 'string' && DEFAULT_RULES.includes(value))\n\nconst resolvePolicy = (\n\tid: string,\n\tentry: unknown,\n\tadapter: AnalyticsAdapter\n): Exclude<SourcePolicy, 'staff'> | undefined => {\n\tconst { tenants } = optionsObject(entry, {\n\t\tpath: `sources.${id}`,\n\t\tknown: SOURCE_KEYS,\n\t\texample: \"an object such as { tenants: 'fallback' }\",\n\t})\n\tif (tenants === undefined) {\n\t\treturn undefined\n\t}\n\tif (!isPolicy(tenants)) {\n\t\tthrow new Error(\n\t\t\t`analytics: sources.${id}.tenants must be 'staff', 'tenant', 'fallback' or a function, got ${kindOf(tenants)}`\n\t\t)\n\t}\n\tif (tenants === 'staff') {\n\t\treturn undefined\n\t}\n\tif (adapter.capabilities.scopedQueries !== true) {\n\t\tthrow new Error(\n\t\t\t`analytics: sources.${id}.tenants lets a tenant's own users read through the \"${id}\" adapter, which cannot narrow a query to one scope (it lacks capabilities.scopedQueries), so a tenant would read every tenant's totals. Leave it 'staff', or give it to an adapter that supports scoped queries.`\n\t\t)\n\t}\n\treturn tenants\n}\n\n/**\n * `sources` and `defaultSource`. A switched-off plugin given no adapters has nothing to check\n * the keys against, and reads through nothing anyway.\n */\nexport const resolveSources = (options: {\n\tadapters?: readonly AnalyticsAdapter[]\n\tplatformAdapter?: string\n\tsources?: unknown\n\tdefaultSource?: unknown\n}): ResolvedSources => {\n\tconst { sources, defaultSource } = options\n\tif (defaultSource !== undefined && !isDefaultRule(defaultSource)) {\n\t\tthrow new Error(\n\t\t\t`analytics: defaultSource must be 'tenantFirst', 'platformFirst' or a function, got ${kindOf(defaultSource)}`\n\t\t)\n\t}\n\tif (defaultSource === 'platformFirst' && options.platformAdapter === undefined) {\n\t\tthrow new Error(\n\t\t\t\"analytics: defaultSource 'platformFirst' opens each tenant on the platformAdapter, which is not set; set platformAdapter or pick another rule\"\n\t\t)\n\t}\n\tconst policies = new Map<string, Exclude<SourcePolicy, 'staff'>>()\n\tif (sources !== undefined && (!isRecord(sources) || Array.isArray(sources))) {\n\t\tthrow new Error(\n\t\t\t`analytics: sources must be an object keyed by adapter id, such as { posthog: { tenants: 'fallback' } }, got ${kindOf(sources)}`\n\t\t)\n\t}\n\tconst adapters = options.adapters ?? []\n\tif (adapters.length > 0) {\n\t\tfor (const [id, entry] of Object.entries(sources ?? {})) {\n\t\t\tif (entry === undefined) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tconst adapter = adapters.find((candidate) => candidate.id === id)\n\t\t\tif (!adapter) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t`analytics: sources.${id} names no adapter in adapters, whose ids are ${listOf(adapters.map((known) => `\"${known.id}\"`))}; sources is keyed by the id of a config adapter`\n\t\t\t\t)\n\t\t\t}\n\t\t\tconst policy = resolvePolicy(id, entry, adapter)\n\t\t\tif (policy !== undefined) {\n\t\t\t\tpolicies.set(id, policy)\n\t\t\t}\n\t\t}\n\t}\n\treturn { policies, ...(defaultSource === undefined ? {} : { defaultSource }) }\n}\n"],"mappings":";;;AAqEA,MAAM,cAAc,OAA+B,EAAE,SAAS,KAAK,CAAC;AACpE,MAAM,eAAkC;CAAC;CAAS;CAAU;AAAU;AACtE,MAAM,gBAAmC,CAAC,eAAe,eAAe;AAExE,MAAM,YAAY,UACjB,OAAO,UAAU,cAAe,OAAO,UAAU,YAAY,aAAa,SAAS,KAAK;AAEzF,MAAM,iBAAiB,UACtB,OAAO,UAAU,cAAe,OAAO,UAAU,YAAY,cAAc,SAAS,KAAK;AAE1F,MAAM,iBACL,IACA,OACA,YACgD;CAChD,MAAM,EAAE,YAAY,cAAc,OAAO;EACxC,MAAM,WAAW;EACjB,OAAO;EACP,SAAS;CACV,CAAC;CACD,IAAI,YAAY,KAAA,GACf;CAED,IAAI,CAAC,SAAS,OAAO,GACpB,MAAM,IAAI,MACT,sBAAsB,GAAG,oEAAoE,OAAO,OAAO,GAC5G;CAED,IAAI,YAAY,SACf;CAED,IAAI,QAAQ,aAAa,kBAAkB,MAC1C,MAAM,IAAI,MACT,sBAAsB,GAAG,uDAAuD,GAAG,kNACpF;CAED,OAAO;AACR;;;;;AAMA,MAAa,kBAAkB,YAKR;CACtB,MAAM,EAAE,SAAS,kBAAkB;CACnC,IAAI,kBAAkB,KAAA,KAAa,CAAC,cAAc,aAAa,GAC9D,MAAM,IAAI,MACT,sFAAsF,OAAO,aAAa,GAC3G;CAED,IAAI,kBAAkB,mBAAmB,QAAQ,oBAAoB,KAAA,GACpE,MAAM,IAAI,MACT,+IACD;CAED,MAAM,2BAAW,IAAI,IAA4C;CACjE,IAAI,YAAY,KAAA,MAAc,CAAC,SAAS,OAAO,KAAK,MAAM,QAAQ,OAAO,IACxE,MAAM,IAAI,MACT,+GAA+G,OAAO,OAAO,GAC9H;CAED,MAAM,WAAW,QAAQ,YAAY,CAAC;CACtC,IAAI,SAAS,SAAS,GACrB,KAAK,MAAM,CAAC,IAAI,UAAU,OAAO,QAAQ,WAAW,CAAC,CAAC,GAAG;EACxD,IAAI,UAAU,KAAA,GACb;EAED,MAAM,UAAU,SAAS,MAAM,cAAc,UAAU,OAAO,EAAE;EAChE,IAAI,CAAC,SACJ,MAAM,IAAI,MACT,sBAAsB,GAAG,+CAA+C,OAAO,SAAS,KAAK,UAAU,IAAI,MAAM,GAAG,EAAE,CAAC,EAAE,iDAC1H;EAED,MAAM,SAAS,cAAc,IAAI,OAAO,OAAO;EAC/C,IAAI,WAAW,KAAA,GACd,SAAS,IAAI,IAAI,MAAM;CAEzB;CAED,OAAO;EAAE;EAAU,GAAI,kBAAkB,KAAA,IAAY,CAAC,IAAI,EAAE,cAAc;CAAG;AAC9E"}
|
|
@@ -11,4 +11,5 @@ import { AnalyticsSdks, Ga4Client, Ga4ClientOptions, Ga4ReportResponse, Ga4Repor
|
|
|
11
11
|
import { 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
|
-
import { AdapterContext, 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";
|
|
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
|
+
import { AdapterLabelOption } from "../../core/sourceLabel.js";
|
|
@@ -12,6 +12,7 @@ import { AnalyticsSdks, Ga4Client, Ga4ClientOptions, Ga4ReportResponse, Ga4Repor
|
|
|
12
12
|
import { HitType } from "../../native/store/types.js";
|
|
13
13
|
import { RawEventInput } from "../../native/ingest/normalizeEvent.js";
|
|
14
14
|
import { IngestHostnameResolver, ServerEventInput, ServerTrack, ServerTrackIdentity, ServerTrackOptions } from "../../core/serverEvent.js";
|
|
15
|
-
import { AdapterContext, 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
|
+
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";
|
|
16
|
+
import { AdapterLabelOption } from "../../core/sourceLabel.js";
|
|
16
17
|
import { Ga4Config, ga4 } from "../../adapters/ga4/ga4.js";
|
|
17
|
-
export { type AdapterContext, type AdapterJobs, 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 Ga4Config, 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 VisitorCounting, ga4, ga4EventName };
|
|
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 Ga4Config, 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 VisitorCounting, ga4, ga4EventName };
|
|
@@ -16,7 +16,8 @@ import { HitType } from "../../native/store/types.js";
|
|
|
16
16
|
import { ItemSignatureMode } from "../../native/ingest/itemSignature.js";
|
|
17
17
|
import { RawEventInput } from "../../native/ingest/normalizeEvent.js";
|
|
18
18
|
import { IngestHostnameResolver, ServerEventInput, ServerTrack, ServerTrackIdentity, ServerTrackOptions } from "../../core/serverEvent.js";
|
|
19
|
-
import { AdapterContext, 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";
|
|
19
|
+
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";
|
|
20
|
+
import { AdapterLabelOption } from "../../core/sourceLabel.js";
|
|
20
21
|
import { AGGREGATES_SLUG, HITS_SLUG } from "../../native/collections/slugs.js";
|
|
21
22
|
import { RebuildDaysInput, RebuildDaysReport } from "../../native/engine/rebuild.js";
|
|
22
23
|
import { WriteBufferLimits, WriteBufferOption } from "../../native/engine/writeBuffer.js";
|
|
@@ -25,4 +26,4 @@ import { EventHostnameResolver, HostnameOption } from "../../native/ingest/resol
|
|
|
25
26
|
import { SqliteThread } from "../../native/store/sql/sqliteThread.js";
|
|
26
27
|
import { NativeAdapter, NativeCollections, NativeOptions, NativeRetention, NativeSqlite, NativeToday, native } from "../../native/nativeAdapter.js";
|
|
27
28
|
import { MAINTAIN_TASK_SLUG, MaintainTaskInput } from "../../native/tasks/maintainTask.js";
|
|
28
|
-
export { AGGREGATES_SLUG, type AdapterContext, type AdapterJobs, type AdapterRegisterContext, type AdapterSchemaContext, type AnalyticsAdapter, type AnalyticsCapabilities, type AnalyticsCollectionOptions, type AnalyticsFilter, type AnalyticsQuery, type AnalyticsResult, type AnalyticsRow, type AnalyticsSdks, type AnalyticsTaskName, type BotFilter, type BrowserAmounts, type CapKey, type CapsOption, type CaptureClientKind, type CaptureSlot, type CaptureSnippet, type CaptureSupport, type CardinalityCaps, type CollectionOverrides, type CurrencyConverter, type DIMENSION_KEYS, type DateRange, type DimensionKey, type EventHostnameResolver, type FILTER_OPERATORS, type FetchInit, type FetchLike, type FilterOperator, type FilterOperatorMap, type Ga4Client, type Ga4ClientOptions, type Ga4ReportResponse, type Ga4ReportRow, type Ga4Sdk, type Geo, type GeoResolver, type GeoResolverOptions, type Goal, type GoalMatch, type Granularity, HITS_SLUG, type HitType, type HostnameOption, type IngestHostnameResolver, type ItemSignatureMode, MAINTAIN_TASK_SLUG, type MaintainTaskInput, type MaxmindReader, type MaxmindSdk, type MetricKey, type MetricReach, type MetricSemantics, type MetricValue, type MetricValues, type NativeAdapter, type NativeCollections, type NativeOptions, type NativeRetention, type NativeSqlite, type NativeToday, type OrderSignatureMode, type ProxyDescriptor, type ProxyRoute, type ProxyRouteKind, type RateLimitDescriptor, type RawEventInput, type RebuildDaysInput, type RebuildDaysReport, type RouteBase, type RoutePaths, SESSION_DIMENSIONS, type ScheduledTask, type ServerEventInput, type ServerTrack, type ServerTrackIdentity, type ServerTrackOptions, type SessionDimension, type SnippetScript, type SourceErrorKind, type SqliteThread, type TASK_NAMES, type TrackerGoal, type TrackerSlotConfig, type TrustedPlatform, type VisitorCounting, type WriteBufferLimits, type WriteBufferOption, isBot, native };
|
|
29
|
+
export { AGGREGATES_SLUG, type AdapterContext, type AdapterJobs, type AdapterLabelArgs, type AdapterLabelOption, type AdapterRegisterContext, type AdapterSchemaContext, type AnalyticsAdapter, type AnalyticsCapabilities, type AnalyticsCollectionOptions, type AnalyticsFilter, type AnalyticsQuery, type AnalyticsResult, type AnalyticsRow, type AnalyticsSdks, type AnalyticsTaskName, type BotFilter, type BrowserAmounts, type CapKey, type CapsOption, type CaptureClientKind, type CaptureSlot, type CaptureSnippet, type CaptureSupport, type CardinalityCaps, type CollectionOverrides, type CurrencyConverter, type DIMENSION_KEYS, type DateRange, type DimensionKey, type EventHostnameResolver, type FILTER_OPERATORS, type FetchInit, type FetchLike, type FilterOperator, type FilterOperatorMap, type Ga4Client, type Ga4ClientOptions, type Ga4ReportResponse, type Ga4ReportRow, type Ga4Sdk, type Geo, type GeoResolver, type GeoResolverOptions, type Goal, type GoalMatch, type Granularity, HITS_SLUG, type HitType, type HostnameOption, type IngestHostnameResolver, type ItemSignatureMode, MAINTAIN_TASK_SLUG, type MaintainTaskInput, type MaxmindReader, type MaxmindSdk, type MetricKey, type MetricReach, type MetricSemantics, type MetricValue, type MetricValues, type NativeAdapter, type NativeCollections, type NativeOptions, type NativeRetention, type NativeSqlite, type NativeToday, type OrderSignatureMode, type ProxyDescriptor, type ProxyRoute, type ProxyRouteKind, type RateLimitDescriptor, type RawEventInput, type RebuildDaysInput, type RebuildDaysReport, type RouteBase, type RoutePaths, SESSION_DIMENSIONS, type ScheduledTask, type ServerEventInput, type ServerTrack, type ServerTrackIdentity, type ServerTrackOptions, type SessionDimension, type SnippetScript, type SourceErrorKind, type SqliteThread, type TASK_NAMES, type TrackerGoal, type TrackerSlotConfig, type TrustedPlatform, type VisitorCounting, type WriteBufferLimits, type WriteBufferOption, isBot, native };
|
|
@@ -11,6 +11,7 @@ import { AnalyticsSdks, Ga4Client, Ga4ClientOptions, Ga4ReportResponse, Ga4Repor
|
|
|
11
11
|
import { 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
|
-
import { AdapterContext, 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";
|
|
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
|
+
import { AdapterLabelOption } from "../../core/sourceLabel.js";
|
|
15
16
|
import { PlausibleConfig, plausible } from "../../adapters/plausible/plausible.js";
|
|
16
|
-
export { type AdapterContext, type AdapterJobs, 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 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 };
|
|
@@ -11,6 +11,7 @@ import { AnalyticsSdks, Ga4Client, Ga4ClientOptions, Ga4ReportResponse, Ga4Repor
|
|
|
11
11
|
import { 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
|
-
import { AdapterContext, 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";
|
|
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
|
+
import { AdapterLabelOption } from "../../core/sourceLabel.js";
|
|
15
16
|
import { PosthogConfig, posthog } from "../../adapters/posthog/posthog.js";
|
|
16
|
-
export { type AdapterContext, type AdapterJobs, 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 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 };
|
|
@@ -11,6 +11,7 @@ import { AnalyticsSdks, Ga4Client, Ga4ClientOptions, Ga4ReportResponse, Ga4Repor
|
|
|
11
11
|
import { 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
|
-
import { AdapterContext, 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";
|
|
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
|
+
import { AdapterLabelOption } from "../../core/sourceLabel.js";
|
|
15
16
|
import { UmamiConfig, umami } from "../../adapters/umami/umami.js";
|
|
16
|
-
export { type AdapterContext, type AdapterJobs, 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 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 };
|
package/dist/exports/client.d.ts
CHANGED
|
@@ -7,6 +7,11 @@ import { CapabilityRequirement, FilterPair, SerializedCapabilities } from "../co
|
|
|
7
7
|
import { FilterDimensionSelectFieldProps } from "../fields/config/FilterDimensionSelectField.js";
|
|
8
8
|
import { FilterOperatorSelectFieldProps } from "../fields/config/FilterOperatorSelectField.js";
|
|
9
9
|
import { FilterValueField, FilterValueFieldProps } from "../fields/config/FilterValueField.js";
|
|
10
|
+
import { ANALYTICS_ERROR_CODES, AnalyticsError, AnalyticsErrorCode, readErrorCode, readResponseError } from "../plugin/errors.js";
|
|
11
|
+
import { ItemLabels, QueryResponse, QuerySourceRef, SerializedAnalyticsQuery } from "../query/response.js";
|
|
12
|
+
import { TIMEFRAME_PRESETS, TimeframePreset } from "../timeframe/presets.js";
|
|
13
|
+
import { GoalSource } from "../goals/resolver.js";
|
|
14
|
+
import { SourcesNotice } from "../plugin/readContextForRequest.js";
|
|
10
15
|
import { SourcesResponse, WireSource } from "../fields/config/fetchSources.js";
|
|
11
16
|
import { MetricSelectFieldProps } from "../fields/config/MetricSelectField.js";
|
|
12
17
|
import { FilterDimensionSelectField, FilterOperatorSelectField, GoalSelectField, MetricSelectField, SourceSelectField } from "../fields/config/retiredPickers.js";
|
|
@@ -16,13 +21,10 @@ import { DateRangeFieldOptions, DateRangePickerAppearance } from "../fields/date
|
|
|
16
21
|
import { DateRangeField, DateRangeFieldComponentProps } from "../fields/dateRange/ui.js";
|
|
17
22
|
import { MetricFormat, formatMetricValue } from "../fields/format.js";
|
|
18
23
|
import { GoalAmountFieldOptions } from "../goals/amountField.js";
|
|
19
|
-
import { GoalSource } from "../goals/resolver.js";
|
|
20
24
|
import { GoalsResponse, WireGoal } from "../goals/fetchGoals.js";
|
|
21
25
|
import { GoalAmountField, GoalAmountFieldProps } from "../goals/GoalAmountField.js";
|
|
22
26
|
import { AnalyticsGoals, useAnalyticsGoals } from "../goals/useAnalyticsGoals.js";
|
|
23
|
-
import {
|
|
24
|
-
import { TIMEFRAME_PRESETS, TimeframePreset } from "../timeframe/presets.js";
|
|
25
|
-
import { ItemLabels, QueryResponse, QuerySourceRef, SerializedAnalyticsQuery } from "../query/response.js";
|
|
27
|
+
import { ProvidersListNotice } from "../providers/ProvidersListNotice.js";
|
|
26
28
|
import { QueryFetchError, RequestFailure } from "../ui/data/request.js";
|
|
27
29
|
import { FetchQueryInit, QueryRequest, RefreshRequest, RefreshResponse, buildQueryUrl, fetchQuery, refreshCache } from "../query/fetchQuery.js";
|
|
28
30
|
import { Card, CardProps } from "../ui/components/Card.js";
|
|
@@ -44,4 +46,4 @@ import { ReadNotices } from "../widgets/readMeta.js";
|
|
|
44
46
|
import { ReadonlyViewGate, ViewAnswers, ViewContextValue, ViewRefresh, useView } from "../view/viewContext.js";
|
|
45
47
|
import { RealtimePoint } from "../widgets/readForWidgetRealtime.js";
|
|
46
48
|
import { RealtimeCounter, RealtimeCounterProps } from "../widgets/RealtimeCounter.js";
|
|
47
|
-
export { ANALYTICS_ERROR_CODES, type AnalyticsError, type AnalyticsErrorCode, type AnalyticsFilter, type AnalyticsGoals, AnalyticsNavLink, type AnalyticsNavLinkProps, type AnalyticsQuery, type AnalyticsResult, type AnalyticsRow, type AnalyticsSources, AnalyticsViewClient, type AnalyticsViewClientProps, type BarDatum, BarList, type BarListHeaders, type BarListProps, type BreakdownTab, type CapabilityRequirement, Card, type CardProps, type ChartDataRow, ChartDataTable, type ChartDataTableProps, type CountryFlagProps, type CountryFlags, DEFAULT_ROUTE_BASE, DIMENSION_KEYS, DataTable, type DataTableColumn, type DataTableProps, type DataTableRow, type DateRange, DateRangeField, type DateRangeFieldComponentProps, type DateRangeFieldOptions, type DateRangePickerAppearance, type DayRange, type DimensionKey, FILTER_OPERATORS, type FetchQueryInit, type FilterCapabilities, FilterDimensionSelectField, type FilterDimensionSelectFieldProps, type FilterOperator, FilterOperatorSelectField, type FilterOperatorSelectFieldProps, type FilterPair, FilterValueField, type FilterValueFieldProps, GoalAmountField, type GoalAmountFieldOptions, type GoalAmountFieldProps, GoalSelectField, type GoalSource, type GoalsResponse, type Granularity, type HostCountryFlag, type ItemLabels, MetricCard, type MetricCardProps, type MetricFormat, type MetricKey, MetricSelectField, type MetricSelectFieldProps, type MetricValue, type MetricValues, QueryFetchError, type QueryRequest, type QueryResponse, type QuerySourceRef, type QueryState, type ReadNotices, type ReadonlyViewGate, RealtimeCounter, type RealtimeCounterProps, type RealtimePoint, type RefreshRequest, type RefreshResponse, type RequestFailure, type RequestState, type RouteBase, type RoutePaths, type RoutesConfigSource, type SerializedAnalyticsQuery, type SerializedCapabilities, type SortDirection, type SourceErrorKind, SourceSelectField, type SourcesResponse, TIMEFRAME_PRESETS, type TimeframePreset, Toolbar, TrendChart, type TrendChartProps, type TrendPoint, VIEW_LIMITS, type ViewAnswers, ViewBreakdowns, type ViewContextValue, type ViewEndpoints, type ViewGoal, ViewGoals, type ViewLimit, ViewOverview, type ViewQueries, ViewRealtime, type ViewRefresh, ViewRoot, type ViewRootProps, type ViewScopes, type ViewState, ViewTrend, type VisitorCounting, type WireGoal, type WireSource, analyticsRoutes, buildQueryUrl, fetchQuery, formatMetricValue, readErrorCode, readResponseError, refreshCache, routePaths, useAnalyticsGoals, useAnalyticsSources, useFilterCapabilities, useView };
|
|
49
|
+
export { ANALYTICS_ERROR_CODES, type AnalyticsError, type AnalyticsErrorCode, type AnalyticsFilter, type AnalyticsGoals, AnalyticsNavLink, type AnalyticsNavLinkProps, type AnalyticsQuery, type AnalyticsResult, type AnalyticsRow, type AnalyticsSources, AnalyticsViewClient, type AnalyticsViewClientProps, type BarDatum, BarList, type BarListHeaders, type BarListProps, type BreakdownTab, type CapabilityRequirement, Card, type CardProps, type ChartDataRow, ChartDataTable, type ChartDataTableProps, type CountryFlagProps, type CountryFlags, DEFAULT_ROUTE_BASE, DIMENSION_KEYS, DataTable, type DataTableColumn, type DataTableProps, type DataTableRow, type DateRange, DateRangeField, type DateRangeFieldComponentProps, type DateRangeFieldOptions, type DateRangePickerAppearance, type DayRange, type DimensionKey, FILTER_OPERATORS, type FetchQueryInit, type FilterCapabilities, FilterDimensionSelectField, type FilterDimensionSelectFieldProps, type FilterOperator, FilterOperatorSelectField, type FilterOperatorSelectFieldProps, type FilterPair, FilterValueField, type FilterValueFieldProps, GoalAmountField, type GoalAmountFieldOptions, type GoalAmountFieldProps, GoalSelectField, type GoalSource, type GoalsResponse, type Granularity, type HostCountryFlag, type ItemLabels, MetricCard, type MetricCardProps, type MetricFormat, type MetricKey, MetricSelectField, type MetricSelectFieldProps, type MetricValue, type MetricValues, ProvidersListNotice, QueryFetchError, type QueryRequest, type QueryResponse, type QuerySourceRef, type QueryState, type ReadNotices, type ReadonlyViewGate, RealtimeCounter, type RealtimeCounterProps, type RealtimePoint, type RefreshRequest, type RefreshResponse, type RequestFailure, type RequestState, type RouteBase, type RoutePaths, type RoutesConfigSource, type SerializedAnalyticsQuery, type SerializedCapabilities, type SortDirection, type SourceErrorKind, SourceSelectField, type SourcesNotice, type SourcesResponse, TIMEFRAME_PRESETS, type TimeframePreset, Toolbar, TrendChart, type TrendChartProps, type TrendPoint, VIEW_LIMITS, type ViewAnswers, ViewBreakdowns, type ViewContextValue, type ViewEndpoints, type ViewGoal, ViewGoals, type ViewLimit, ViewOverview, type ViewQueries, ViewRealtime, type ViewRefresh, ViewRoot, type ViewRootProps, type ViewScopes, type ViewState, ViewTrend, type VisitorCounting, type WireGoal, type WireSource, analyticsRoutes, buildQueryUrl, fetchQuery, formatMetricValue, readErrorCode, readResponseError, refreshCache, routePaths, useAnalyticsGoals, useAnalyticsSources, useFilterCapabilities, useView };
|
package/dist/exports/client.js
CHANGED
|
@@ -17,6 +17,7 @@ import { FilterDimensionSelectField, FilterOperatorSelectField, GoalSelectField,
|
|
|
17
17
|
import { DateRangeField } from "../fields/dateRange/ui.js";
|
|
18
18
|
import { formatMetricValue } from "../fields/format.js";
|
|
19
19
|
import { GoalAmountField } from "../goals/GoalAmountField.js";
|
|
20
|
+
import { ProvidersListNotice } from "../providers/ProvidersListNotice.js";
|
|
20
21
|
import { Card } from "../ui/components/Card.js";
|
|
21
22
|
import { MetricCard } from "../ui/components/MetricCard.js";
|
|
22
23
|
import { AnalyticsNavLink } from "../view/AnalyticsNavLink.js";
|
|
@@ -27,4 +28,4 @@ import { ViewRoot } from "../view/ViewRoot.js";
|
|
|
27
28
|
import { RealtimeCounter } from "../widgets/RealtimeCounter.js";
|
|
28
29
|
import { ViewBreakdowns, ViewGoals, ViewOverview, ViewRealtime, ViewTrend } from "../view/ViewSections.js";
|
|
29
30
|
import { AnalyticsViewClient } from "../view/AnalyticsViewClient.js";
|
|
30
|
-
export { ANALYTICS_ERROR_CODES, AnalyticsNavLink, AnalyticsViewClient, BarList, Card, ChartDataTable, DEFAULT_ROUTE_BASE, DIMENSION_KEYS, DataTable, DateRangeField, FILTER_OPERATORS, FilterDimensionSelectField, FilterOperatorSelectField, FilterValueField, GoalAmountField, GoalSelectField, MetricCard, MetricSelectField, QueryFetchError, RealtimeCounter, SourceSelectField, TIMEFRAME_PRESETS, Toolbar, TrendChart, VIEW_LIMITS, ViewBreakdowns, ViewGoals, ViewOverview, ViewRealtime, ViewRoot, ViewTrend, analyticsRoutes, buildQueryUrl, fetchQuery, formatMetricValue, readErrorCode, readResponseError, refreshCache, routePaths, useAnalyticsGoals, useAnalyticsSources, useFilterCapabilities, useView };
|
|
31
|
+
export { ANALYTICS_ERROR_CODES, AnalyticsNavLink, AnalyticsViewClient, BarList, Card, ChartDataTable, DEFAULT_ROUTE_BASE, DIMENSION_KEYS, DataTable, DateRangeField, FILTER_OPERATORS, FilterDimensionSelectField, FilterOperatorSelectField, FilterValueField, GoalAmountField, GoalSelectField, MetricCard, MetricSelectField, ProvidersListNotice, QueryFetchError, RealtimeCounter, SourceSelectField, TIMEFRAME_PRESETS, Toolbar, TrendChart, VIEW_LIMITS, ViewBreakdowns, ViewGoals, ViewOverview, ViewRealtime, ViewRoot, ViewTrend, analyticsRoutes, buildQueryUrl, fetchQuery, formatMetricValue, readErrorCode, readResponseError, refreshCache, routePaths, useAnalyticsGoals, useAnalyticsSources, useFilterCapabilities, useView };
|
package/dist/exports/next.d.ts
CHANGED
|
@@ -11,10 +11,11 @@ import { AnalyticsSdks, Ga4Client, Ga4ClientOptions, Ga4ReportResponse, Ga4Repor
|
|
|
11
11
|
import { 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
|
-
import { AdapterContext, 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";
|
|
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
|
+
import { AdapterLabelOption } from "../core/sourceLabel.js";
|
|
15
16
|
import { CaptureRewrite, CaptureRewriteMount, captureRewrites } from "../next/captureRewrites.js";
|
|
16
17
|
import { CaptureRouteOptions, captureRoute } from "../next/captureRoute.js";
|
|
17
18
|
import { IngestRouteOptions } from "../native/ingest/route.js";
|
|
18
19
|
import { ingestPreflight, ingestRoute } from "../next/ingestRoute.js";
|
|
19
20
|
import { PosthogProxyRegion, PosthogProxyRewrite, PosthogProxyRewritesOptions, posthogProxyRewrites } from "../next/posthogProxyRewrites.js";
|
|
20
|
-
export { type AdapterContext, type AdapterJobs, 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 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 };
|
package/dist/exports/rsc.d.ts
CHANGED
|
@@ -3,16 +3,18 @@ import { CapabilityRequirement, FilterPair, SerializedCapabilities } from "../co
|
|
|
3
3
|
import { FilterDimensionSelectFieldProps } from "../fields/config/FilterDimensionSelectField.js";
|
|
4
4
|
import { FilterOperatorSelectFieldProps } from "../fields/config/FilterOperatorSelectField.js";
|
|
5
5
|
import { FilterValueFieldProps } from "../fields/config/FilterValueField.js";
|
|
6
|
+
import { GatedScope, ReadPrincipal, SYSTEM } from "../access/principal.js";
|
|
7
|
+
import { BindingDoc } from "../binding/types.js";
|
|
8
|
+
import { TIMEFRAME_PRESETS, TimeframePreset } from "../timeframe/presets.js";
|
|
9
|
+
import { AnalyticsComponent, AnalyticsCountryFlags } from "../core/options.js";
|
|
10
|
+
import { SourcesNotice } from "../plugin/readContextForRequest.js";
|
|
6
11
|
import { SourcesResponse, WireSource } from "../fields/config/fetchSources.js";
|
|
7
12
|
import { MetricSelectFieldProps } from "../fields/config/MetricSelectField.js";
|
|
8
13
|
import { MetricFormat, formatMetricValue } from "../fields/format.js";
|
|
9
|
-
import { TIMEFRAME_PRESETS, TimeframePreset } from "../timeframe/presets.js";
|
|
10
|
-
import { BindingDoc } from "../binding/types.js";
|
|
11
|
-
import { AnalyticsComponent, AnalyticsCountryFlags } from "../core/options.js";
|
|
12
14
|
import { CountryFlagProps, CountryFlags, HostCountryFlag } from "../view/CountryFlag.js";
|
|
13
15
|
import { AnalyticsViewClientProps, ViewEndpoints, ViewGoal, ViewScopes } from "../view/viewProps.js";
|
|
14
16
|
import { ReadNotices } from "../widgets/readMeta.js";
|
|
15
|
-
import {
|
|
17
|
+
import { StoredSourceRead, SubstitutedSource, WidgetReadStatus } from "../widgets/prepareWidgetRead.js";
|
|
16
18
|
import { ReadForWidgetRealtimeArgs, RealtimePoint, WidgetRealtimeResult, WidgetRealtimeStatus, readForWidgetRealtime } from "../widgets/readForWidgetRealtime.js";
|
|
17
19
|
import { ReportMode, ReportOption } from "../binding/report.js";
|
|
18
20
|
import { FallbackLanguage } from "../translations/labelMap.js";
|
|
@@ -31,11 +33,10 @@ import { AnalyticsGoalsWidget } from "../widgets/AnalyticsGoalsWidget.js";
|
|
|
31
33
|
import { AnalyticsMetricWidget } from "../widgets/AnalyticsMetricWidget.js";
|
|
32
34
|
import { AnalyticsRealtimeWidget } from "../widgets/AnalyticsRealtimeWidget.js";
|
|
33
35
|
import { AnalyticsTrendWidget } from "../widgets/AnalyticsTrendWidget.js";
|
|
34
|
-
import { WidgetReadStatus } from "../widgets/prepareWidgetRead.js";
|
|
35
36
|
import { ReadForWidgetArgs, WidgetReadResult, readForWidget } from "../widgets/readForWidget.js";
|
|
36
37
|
import { BreakdownRow, ReadForWidgetBreakdownArgs, WidgetBreakdownResult, readForWidgetBreakdown } from "../widgets/readForWidgetBreakdown.js";
|
|
37
38
|
import { GoalRow, ReadForWidgetGoalsArgs, WidgetGoalsResult, readForWidgetGoals } from "../widgets/readForWidgetGoals.js";
|
|
38
39
|
import { ReadForWidgetSeriesArgs, WidgetSeriesResult, readForWidgetSeries } from "../widgets/readForWidgetSeries.js";
|
|
39
40
|
import { WidgetBody, WidgetCard, WidgetCardProps, WidgetEmpty, WidgetNote, WidgetValue } from "../widgets/WidgetCard.js";
|
|
40
41
|
import { WidgetShimmer, WidgetShimmerKind, WidgetShimmerProps, WidgetSuspense } from "../widgets/WidgetShimmer.js";
|
|
41
|
-
export { AnalyticsBreakdownWidget, type AnalyticsComponent, type AnalyticsCountryFlags, type AnalyticsFilter, AnalyticsGoalsWidget, type AnalyticsMetricLabel, type AnalyticsMetricLabels, AnalyticsMetricWidget, AnalyticsPanelField, type AnalyticsPanelFieldProps, AnalyticsRealtimeWidget, AnalyticsStatField, type AnalyticsStatFieldProps, AnalyticsTrendWidget, AnalyticsView, type AnalyticsViewClientProps, type AnalyticsViewProps, type AnalyticsWidgetProps, type BindingDoc, type BreakdownRow, type CapabilityRequirement, type CountryFlagProps, type CountryFlags, DIMENSION_KEYS, type DateRange, type DimensionKey, FILTER_OPERATORS, type FallbackLanguage, type FieldBreakdown, type FieldBreakdownRow, type FieldReadResult, type FieldReadStatus, type FilterDimensionSelectFieldProps, FilterDimensionSelectFieldServer, type FilterOperator, type FilterOperatorSelectFieldProps, FilterOperatorSelectFieldServer, type FilterPair, type FilterValueFieldProps, FilterValueFieldServer, type GatedScope, type GoalRow, GoalSelectFieldServer, type Granularity, type HostCountryFlag, type MetricFormat, type MetricKey, type MetricSelectFieldProps, MetricSelectFieldServer, type MetricValue, type MetricValues, type ReadForFieldArgs, type ReadForWidgetArgs, type ReadForWidgetBreakdownArgs, type ReadForWidgetGoalsArgs, type ReadForWidgetRealtimeArgs, type ReadForWidgetSeriesArgs, type ReadNotices, type ReadPrincipal, type RealtimePoint, type ReportMode, type ReportOption, SYSTEM, type SerializedCapabilities, type SeriesGranularity, type SeriesPoint, SourceSelectFieldServer, type SourcesResponse, type StatFieldI18n, TIMEFRAME_PRESETS, type TimeframePreset, type ViewEndpoints, type ViewGoal, type ViewScopes, WidgetBody, type WidgetBreakdownResult, WidgetCard, type WidgetCardProps, WidgetEmpty, type WidgetGoalsResult, WidgetNote, type WidgetReadResult, type WidgetReadStatus, type WidgetRealtimeResult, type WidgetRealtimeStatus, type WidgetSeriesResult, WidgetShimmer, type WidgetShimmerKind, type WidgetShimmerProps, WidgetSuspense, WidgetValue, type WidgetView, type WidgetViewProps, type WireSource, WithScopeToken, formatMetricValue, readForField, readForWidget, readForWidgetBreakdown, readForWidgetGoals, readForWidgetRealtime, readForWidgetSeries };
|
|
42
|
+
export { AnalyticsBreakdownWidget, type AnalyticsComponent, type AnalyticsCountryFlags, type AnalyticsFilter, AnalyticsGoalsWidget, type AnalyticsMetricLabel, type AnalyticsMetricLabels, AnalyticsMetricWidget, AnalyticsPanelField, type AnalyticsPanelFieldProps, AnalyticsRealtimeWidget, AnalyticsStatField, type AnalyticsStatFieldProps, AnalyticsTrendWidget, AnalyticsView, type AnalyticsViewClientProps, type AnalyticsViewProps, type AnalyticsWidgetProps, type BindingDoc, type BreakdownRow, type CapabilityRequirement, type CountryFlagProps, type CountryFlags, DIMENSION_KEYS, type DateRange, type DimensionKey, FILTER_OPERATORS, type FallbackLanguage, type FieldBreakdown, type FieldBreakdownRow, type FieldReadResult, type FieldReadStatus, type FilterDimensionSelectFieldProps, FilterDimensionSelectFieldServer, type FilterOperator, type FilterOperatorSelectFieldProps, FilterOperatorSelectFieldServer, type FilterPair, type FilterValueFieldProps, FilterValueFieldServer, type GatedScope, type GoalRow, GoalSelectFieldServer, type Granularity, type HostCountryFlag, type MetricFormat, type MetricKey, type MetricSelectFieldProps, MetricSelectFieldServer, type MetricValue, type MetricValues, type ReadForFieldArgs, type ReadForWidgetArgs, type ReadForWidgetBreakdownArgs, type ReadForWidgetGoalsArgs, type ReadForWidgetRealtimeArgs, type ReadForWidgetSeriesArgs, type ReadNotices, type ReadPrincipal, type RealtimePoint, type ReportMode, type ReportOption, SYSTEM, type SerializedCapabilities, type SeriesGranularity, type SeriesPoint, SourceSelectFieldServer, type SourcesNotice, type SourcesResponse, type StatFieldI18n, type StoredSourceRead, type SubstitutedSource, TIMEFRAME_PRESETS, type TimeframePreset, type ViewEndpoints, type ViewGoal, type ViewScopes, WidgetBody, type WidgetBreakdownResult, WidgetCard, type WidgetCardProps, WidgetEmpty, type WidgetGoalsResult, WidgetNote, type WidgetReadResult, type WidgetReadStatus, type WidgetRealtimeResult, type WidgetRealtimeStatus, type WidgetSeriesResult, WidgetShimmer, type WidgetShimmerKind, type WidgetShimmerProps, WidgetSuspense, WidgetValue, type WidgetView, type WidgetViewProps, type WireSource, WithScopeToken, formatMetricValue, readForField, readForWidget, readForWidgetBreakdown, readForWidgetGoals, readForWidgetRealtime, readForWidgetSeries };
|
|
@@ -11,7 +11,8 @@ import { AnalyticsSdks, Ga4Client, Ga4ClientOptions, Ga4ReportResponse, Ga4Repor
|
|
|
11
11
|
import { 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
|
-
import { AdapterContext, 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";
|
|
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
|
+
import { AdapterLabelOption } from "../core/sourceLabel.js";
|
|
15
16
|
import { MemoryAnalyticsAdapter, MemoryEvent, memoryAdapter } from "../testing/memoryAdapter.js";
|
|
16
17
|
import { settleAnalytics } from "../testing/settle.js";
|
|
17
|
-
export { type AdapterContext, type AdapterJobs, 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 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 };
|
package/dist/exports/types.d.ts
CHANGED
|
@@ -13,26 +13,30 @@ import { 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";
|
|
16
|
-
import { AdapterContext, AdapterRegisterContext, AdapterSchemaContext, AnalyticsAdapter, AnalyticsAdapterFactory, AnalyticsCapabilities, AnalyticsFilter, AnalyticsQuery, AnalyticsResult, AnalyticsRow, DIMENSION_KEYS, DateRange, DimensionKey, FILTER_OPERATORS, FilterOperator, FilterOperatorMap, Granularity, MetricKey, MetricReach, MetricSemantics, MetricValue, MetricValues, PLATFORM_SCOPE, RateLimitDescriptor, SourceErrorKind, VisitorCounting } from "../core/contract.js";
|
|
16
|
+
import { AdapterContext, AdapterLabelArgs, AdapterRegisterContext, AdapterSchemaContext, AnalyticsAdapter, AnalyticsAdapterFactory, AnalyticsCapabilities, AnalyticsFilter, AnalyticsQuery, AnalyticsResult, AnalyticsRow, DIMENSION_KEYS, DateRange, DimensionKey, FILTER_OPERATORS, FilterOperator, FilterOperatorMap, Granularity, MetricKey, MetricReach, MetricSemantics, MetricValue, MetricValues, PLATFORM_SCOPE, RateLimitDescriptor, SourceErrorKind, VisitorCounting } from "../core/contract.js";
|
|
17
|
+
import { AnalyticsSourceOptions, DefaultSourceFunction, DefaultSourceRule, OwnSource, SourcePolicy, SourcePolicyFunction, SourceRef } from "../core/sourcePolicy.js";
|
|
18
|
+
import { AdapterLabelOption } from "../core/sourceLabel.js";
|
|
17
19
|
import { CapabilityRequirement, FilterPair, SerializedCapabilities } from "../core/capabilities.js";
|
|
18
|
-
import { SourcesResponse, WireSource } from "../fields/config/fetchSources.js";
|
|
19
20
|
import { ANALYTICS_ERROR_CODES, AnalyticsError, AnalyticsErrorCode, readErrorCode } from "../plugin/errors.js";
|
|
20
|
-
import { TIMEFRAME_PRESETS, TimeframePreset } from "../timeframe/presets.js";
|
|
21
21
|
import { QueryError, QueryErrorCode } from "../query/errors.js";
|
|
22
22
|
import { ItemLabels, QueryErrorResponse, QueryResponse, QuerySourceRef, SerializedAnalyticsQuery } from "../query/response.js";
|
|
23
|
-
import { FetchQueryInit, QueryRequest, RefreshRequest, RefreshResponse } from "../query/fetchQuery.js";
|
|
24
23
|
import { AnalyticsBinding, BindingContext, BindingDoc, HostnameResolver, PathResolver } from "../binding/types.js";
|
|
25
24
|
import { CollectionFieldOverride } from "../plugin/collectionFields.js";
|
|
26
25
|
import { PluralCategory, PluralName, PluralVariant, SingularKey, TranslationKey, keys, pluralKeys } from "../translations/keys.js";
|
|
27
26
|
import { TranslationsOption } from "../translations/index.js";
|
|
28
27
|
import { GoalCollectionFieldOverrides, GoalFieldOverride } from "../goals/collection.js";
|
|
29
|
-
import { CacheEntry, CacheSetOptions, CacheStore, ReadRecipe, RecipeWindow } from "../surfacing/cacheStore.js";
|
|
30
|
-
import { AfterReadAnswer, AfterReadArgs, AfterReadHook, ReadOrigin } from "../surfacing/afterRead.js";
|
|
31
|
-
import { ConnectionAccess, ConnectionFieldAccess, ProviderCollectionFieldOverrides, ProviderFieldOverride } from "../providers/collection.js";
|
|
32
28
|
import { HostPattern, ProviderHostPolicy } from "../providers/hosts.js";
|
|
29
|
+
import { ProviderId } from "../providers/factory.js";
|
|
30
|
+
import { ConnectionAccess, ConnectionFieldAccess, ProviderCollectionFieldOverrides, ProviderFieldOverride } from "../providers/collection.js";
|
|
31
|
+
import { AfterReadAnswer, AfterReadArgs, AfterReadHook, ReadOrigin } from "../surfacing/afterRead.js";
|
|
32
|
+
import { TIMEFRAME_PRESETS, TimeframePreset } from "../timeframe/presets.js";
|
|
33
|
+
import { CacheEntry, CacheSetOptions, CacheStore, ReadRecipe, RecipeWindow } from "../surfacing/cacheStore.js";
|
|
33
34
|
import { CustomWidgetDef } from "../widgets/customWidget.js";
|
|
34
35
|
import { BUILT_IN_WIDGET_SLUGS, BuiltInWidgetSlug } from "../core/widgetSlugs.js";
|
|
35
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";
|
|
37
|
+
import { SourcesNotice } from "../plugin/readContextForRequest.js";
|
|
38
|
+
import { SourcesResponse, WireSource } from "../fields/config/fetchSources.js";
|
|
39
|
+
import { FetchQueryInit, QueryRequest, RefreshRequest, RefreshResponse } from "../query/fetchQuery.js";
|
|
36
40
|
import { CountryFlagProps, CountryFlags, HostCountryFlag } from "../view/CountryFlag.js";
|
|
37
41
|
import { AnalyticsViewClientProps, ViewEndpoints, ViewGoal, ViewScopes } from "../view/viewProps.js";
|
|
38
42
|
import { ReportMode, ReportOption } from "../binding/report.js";
|
|
@@ -43,4 +47,4 @@ import { GoalActionDefinition, GoalActionRunArgs, TrackGoalActionOptions } from
|
|
|
43
47
|
import { TRAFFIC_CHANNELS, TrafficChannel } from "../native/ingest/source.js";
|
|
44
48
|
import { ParseResult, ParsedQuery } from "../query/parse.js";
|
|
45
49
|
import { ExclusionResponse, ExclusionSite } from "../view/exclusionLink.js";
|
|
46
|
-
export { ANALYTICS_ERROR_CODES, AdapterContext, type AdapterJobs, 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 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, 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, PLATFORM_SCOPE, type ParseResult, type ParsedQuery, type PathResolver, type PluralCategory, type PluralName, type PluralVariant, type ProviderCollectionFieldOverrides, type ProviderFieldOverride, type ProviderHostPolicy, type ProviderHostsOptions, 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 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 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 };
|