@happyvertical/analytics 0.74.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,49 @@
1
+ import { AnalyticsCapabilities, AnalyticsInterface, ConfigOptions, CreateDataStreamOptions, CreatePropertyOptions, CustomDimension, CustomDimensionOptions, CustomMetric, CustomMetricOptions, DataStream, DimensionMetadata, KeyEvent, KeyEventOptions, ListPropertiesOptions, MatomoOptions, MetricMetadata, PageviewEvent, Property, RealtimeReportOptions, ReportOptions, ReportResult, SnippetOptions, TrackEvent, TrackingSnippet, UpdatePropertyOptions } from '../types.js';
2
+ import { MatomoAdmin } from './matomo-admin.js';
3
+ export declare class MatomoProvider implements AnalyticsInterface {
4
+ private readonly baseUrl;
5
+ private readonly reportingTransport;
6
+ readonly admin: MatomoAdmin;
7
+ constructor(options: MatomoOptions);
8
+ createProperty(_options: CreatePropertyOptions): Promise<Property>;
9
+ listProperties(_options?: ListPropertiesOptions): Promise<Property[]>;
10
+ getProperty(propertyId: string): Promise<Property>;
11
+ updateProperty(_propertyId: string, _data: UpdatePropertyOptions): Promise<Property>;
12
+ deleteProperty(propertyId: string): Promise<void>;
13
+ getCapabilities(): Promise<AnalyticsCapabilities>;
14
+ /**
15
+ * Generate a Matomo `_paq` tracking snippet.
16
+ *
17
+ * Note on `SnippetOptions.anonymizeIp`: Matomo handles IP anonymization
18
+ * **server-side** via the PrivacyManager plugin (Matomo admin → Privacy →
19
+ * Anonymize visitors' IP addresses). The JS tracker has no equivalent
20
+ * client-side directive — `setDoNotTrack` respects the browser's DNT
21
+ * signal but does not anonymize IPs, so we deliberately do not emit it
22
+ * here. The flag is preserved on the returned `config` object as a
23
+ * caller-visible signal, but its enforcement is the operator's
24
+ * responsibility on the Matomo install.
25
+ */
26
+ generateTrackingSnippet(propertyId: string, options?: SnippetOptions): TrackingSnippet;
27
+ generateConfig(propertyId: string, options?: ConfigOptions): Record<string, unknown>;
28
+ getDataStreams(_propertyId: string): Promise<DataStream[]>;
29
+ createDataStream(_propertyId: string, _options: CreateDataStreamOptions): Promise<DataStream>;
30
+ deleteDataStream(_propertyId: string, _streamId: string): Promise<void>;
31
+ getCustomDimensions(_propertyId: string): Promise<CustomDimension[]>;
32
+ createCustomDimension(_propertyId: string, _options: CustomDimensionOptions): Promise<CustomDimension>;
33
+ archiveCustomDimension(_propertyId: string, _dimensionId: string): Promise<void>;
34
+ getCustomMetrics(_propertyId: string): Promise<CustomMetric[]>;
35
+ createCustomMetric(_propertyId: string, _options: CustomMetricOptions): Promise<CustomMetric>;
36
+ archiveCustomMetric(_propertyId: string, _metricId: string): Promise<void>;
37
+ getKeyEvents(_propertyId: string): Promise<KeyEvent[]>;
38
+ createKeyEvent(_propertyId: string, _options: KeyEventOptions): Promise<KeyEvent>;
39
+ deleteKeyEvent(_propertyId: string, _eventId: string): Promise<void>;
40
+ runReport(propertyId: string, options: ReportOptions): Promise<ReportResult>;
41
+ runRealtimeReport(propertyId: string, options?: RealtimeReportOptions): Promise<ReportResult>;
42
+ getMetrics(_propertyId: string): Promise<MetricMetadata[]>;
43
+ getDimensions(_propertyId: string): Promise<DimensionMetadata[]>;
44
+ track(_event: TrackEvent): Promise<void>;
45
+ trackPageview(_pageview: PageviewEvent): Promise<void>;
46
+ trackBatch(_events: TrackEvent[]): Promise<void>;
47
+ identify(_userId: string, _traits?: Record<string, unknown>): Promise<void>;
48
+ }
49
+ //# sourceMappingURL=matomo.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"matomo.d.ts","sourceRoot":"","sources":["../../../src/shared/providers/matomo.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EACL,KAAK,qBAAqB,EAC1B,KAAK,kBAAkB,EACvB,KAAK,aAAa,EAClB,KAAK,uBAAuB,EAC5B,KAAK,qBAAqB,EAC1B,KAAK,eAAe,EACpB,KAAK,sBAAsB,EAC3B,KAAK,YAAY,EACjB,KAAK,mBAAm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DxB,UAAU,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC;IAG1D,aAAa,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,EAAE,CAAC;IAGhE,KAAK,CAAC,MAAM,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC;IAGxC,aAAa,CAAC,SAAS,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC;IAGtD,UAAU,CAAC,OAAO,EAAE,UAAU,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAGhD,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;CAG5E"}
@@ -0,0 +1,50 @@
1
+ import { AnalyticsCapabilities, AnalyticsInterface, ConfigOptions, CreateDataStreamOptions, CreatePropertyOptions, CustomDimension, CustomDimensionOptions, CustomMetric, CustomMetricOptions, DataStream, DimensionMetadata, KeyEvent, KeyEventOptions, ListPropertiesOptions, MetricMetadata, PageviewEvent, PlausibleOptions, Property, RealtimeReportOptions, ReportOptions, ReportResult, SnippetOptions, TrackEvent, TrackingSnippet, UpdatePropertyOptions } from '../types.js';
2
+ /**
3
+ * Plausible Analytics provider
4
+ */
5
+ export declare class PlausibleProvider implements AnalyticsInterface {
6
+ private options;
7
+ private baseUrl;
8
+ constructor(options: PlausibleOptions);
9
+ /**
10
+ * Make an authenticated API request
11
+ */
12
+ private request;
13
+ createProperty(options: CreatePropertyOptions): Promise<Property>;
14
+ listProperties(_options?: ListPropertiesOptions): Promise<Property[]>;
15
+ getProperty(propertyId: string): Promise<Property>;
16
+ updateProperty(_propertyId: string, _data: UpdatePropertyOptions): Promise<Property>;
17
+ deleteProperty(propertyId: string): Promise<void>;
18
+ getDataStreams(_propertyId: string): Promise<DataStream[]>;
19
+ createDataStream(_propertyId: string, _options: CreateDataStreamOptions): Promise<DataStream>;
20
+ deleteDataStream(_propertyId: string, _streamId: string): Promise<void>;
21
+ getCustomDimensions(_propertyId: string): Promise<CustomDimension[]>;
22
+ createCustomDimension(_propertyId: string, _options: CustomDimensionOptions): Promise<CustomDimension>;
23
+ archiveCustomDimension(_propertyId: string, _dimensionId: string): Promise<void>;
24
+ getCustomMetrics(_propertyId: string): Promise<CustomMetric[]>;
25
+ createCustomMetric(_propertyId: string, _options: CustomMetricOptions): Promise<CustomMetric>;
26
+ archiveCustomMetric(_propertyId: string, _metricId: string): Promise<void>;
27
+ getKeyEvents(_propertyId: string): Promise<KeyEvent[]>;
28
+ createKeyEvent(propertyId: string, options: KeyEventOptions): Promise<KeyEvent>;
29
+ deleteKeyEvent(propertyId: string, eventId: string): Promise<void>;
30
+ runReport(propertyId: string, options: ReportOptions): Promise<ReportResult>;
31
+ runRealtimeReport(propertyId: string, _options?: RealtimeReportOptions): Promise<ReportResult>;
32
+ getMetrics(_propertyId: string): Promise<MetricMetadata[]>;
33
+ getDimensions(_propertyId: string): Promise<DimensionMetadata[]>;
34
+ /**
35
+ * Map GA4-style metric names to Plausible format
36
+ */
37
+ private mapMetricName;
38
+ /**
39
+ * Map GA4-style dimension names to Plausible format
40
+ */
41
+ private mapDimensionName;
42
+ track(event: TrackEvent): Promise<void>;
43
+ trackPageview(pageview: PageviewEvent): Promise<void>;
44
+ trackBatch(events: TrackEvent[]): Promise<void>;
45
+ identify(_userId: string, _traits?: Record<string, unknown>): Promise<void>;
46
+ generateTrackingSnippet(propertyId: string, _options?: SnippetOptions): TrackingSnippet;
47
+ generateConfig(propertyId: string, _options?: ConfigOptions): Record<string, unknown>;
48
+ getCapabilities(): Promise<AnalyticsCapabilities>;
49
+ }
50
+ //# sourceMappingURL=plausible.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plausible.d.ts","sourceRoot":"","sources":["../../../src/shared/providers/plausible.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EACV,qBAA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