@happyvertical/smrt-analytics 0.30.0
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/AGENTS.md +68 -0
- package/CLAUDE.md +1 -0
- package/LICENSE +7 -0
- package/README.md +131 -0
- package/dist/__smrt-register__.d.ts +2 -0
- package/dist/__smrt-register__.d.ts.map +1 -0
- package/dist/collections/AnalyticsDataStreamCollection.d.ts +69 -0
- package/dist/collections/AnalyticsDataStreamCollection.d.ts.map +1 -0
- package/dist/collections/AnalyticsEventCollection.d.ts +131 -0
- package/dist/collections/AnalyticsEventCollection.d.ts.map +1 -0
- package/dist/collections/AnalyticsPropertyCollection.d.ts +66 -0
- package/dist/collections/AnalyticsPropertyCollection.d.ts.map +1 -0
- package/dist/collections/AnalyticsReportCollection.d.ts +69 -0
- package/dist/collections/AnalyticsReportCollection.d.ts.map +1 -0
- package/dist/collections/index.d.ts +8 -0
- package/dist/collections/index.d.ts.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1623 -0
- package/dist/index.js.map +1 -0
- package/dist/manifest.json +4161 -0
- package/dist/models/AnalyticsDataStream.d.ts +94 -0
- package/dist/models/AnalyticsDataStream.d.ts.map +1 -0
- package/dist/models/AnalyticsEvent.d.ts +142 -0
- package/dist/models/AnalyticsEvent.d.ts.map +1 -0
- package/dist/models/AnalyticsProperty.d.ts +142 -0
- package/dist/models/AnalyticsProperty.d.ts.map +1 -0
- package/dist/models/AnalyticsReport.d.ts +206 -0
- package/dist/models/AnalyticsReport.d.ts.map +1 -0
- package/dist/models/index.d.ts +8 -0
- package/dist/models/index.d.ts.map +1 -0
- package/dist/playground.d.ts +2 -0
- package/dist/playground.d.ts.map +1 -0
- package/dist/playground.js +99 -0
- package/dist/playground.js.map +1 -0
- package/dist/prompts.d.ts +57 -0
- package/dist/prompts.d.ts.map +1 -0
- package/dist/smrt-knowledge.json +1570 -0
- package/dist/svelte/AnalyticsSummary.svelte +63 -0
- package/dist/svelte/AnalyticsSummary.svelte.d.ts +8 -0
- package/dist/svelte/AnalyticsSummary.svelte.d.ts.map +1 -0
- package/dist/svelte/EventsTable.svelte +161 -0
- package/dist/svelte/EventsTable.svelte.d.ts +16 -0
- package/dist/svelte/EventsTable.svelte.d.ts.map +1 -0
- package/dist/svelte/PropertyInfo.svelte +139 -0
- package/dist/svelte/PropertyInfo.svelte.d.ts +12 -0
- package/dist/svelte/PropertyInfo.svelte.d.ts.map +1 -0
- package/dist/svelte/PropertyStatusBadge.svelte +65 -0
- package/dist/svelte/PropertyStatusBadge.svelte.d.ts +7 -0
- package/dist/svelte/PropertyStatusBadge.svelte.d.ts.map +1 -0
- package/dist/svelte/StatCard.svelte +63 -0
- package/dist/svelte/StatCard.svelte.d.ts +11 -0
- package/dist/svelte/StatCard.svelte.d.ts.map +1 -0
- package/dist/svelte/TrendBadge.svelte +49 -0
- package/dist/svelte/TrendBadge.svelte.d.ts +8 -0
- package/dist/svelte/TrendBadge.svelte.d.ts.map +1 -0
- package/dist/svelte/i18n.d.ts +10 -0
- package/dist/svelte/i18n.d.ts.map +1 -0
- package/dist/svelte/i18n.js +10 -0
- package/dist/svelte/index.d.ts +29 -0
- package/dist/svelte/index.d.ts.map +1 -0
- package/dist/svelte/index.js +39 -0
- package/dist/svelte/playground.d.ts +88 -0
- package/dist/svelte/playground.d.ts.map +1 -0
- package/dist/svelte/playground.js +95 -0
- package/dist/types/index.d.ts +267 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/ui.d.ts +10 -0
- package/dist/ui.d.ts.map +1 -0
- package/dist/ui.js +79 -0
- package/dist/ui.js.map +1 -0
- package/package.json +95 -0
package/AGENTS.md
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
# @happyvertical/smrt-analytics
|
|
2
|
+
|
|
3
|
+
GA4/Plausible/Matomo analytics integration with server-side event tracking and AI-powered reporting.
|
|
4
|
+
|
|
5
|
+
## Models
|
|
6
|
+
|
|
7
|
+
- **AnalyticsProperty**: GA4 property, Plausible site, or Matomo site. Provider metadata, status, sync timestamps.
|
|
8
|
+
- **AnalyticsDataStream**: web/iOS/Android data streams. Measurement IDs (G-XXXXXX for GA4, Firebase app ID for mobile).
|
|
9
|
+
- **AnalyticsEvent**: tracked events with params (JSON), retry queue, conversion classification.
|
|
10
|
+
- **AnalyticsReport**: saved report configs with dimensions/metrics (JSON), scheduling (daily/weekly/monthly), result caching.
|
|
11
|
+
|
|
12
|
+
All models use STI (`tableStrategy: 'sti'`).
|
|
13
|
+
|
|
14
|
+
All four persisted models are `@TenantScoped({ mode: 'optional' })` with a nullable `tenantId` (#1410), matching the framework convention used by sibling domain packages (ads/jobs/commerce). **When a tenant context is active**, the interceptor auto-filters `list`/`get`/raw reads and binds `create`/`save` writes to that tenant, keeping one tenant's properties, data streams, events (end-user PII), and cached report rows from reaching another. Because the mode is `optional`, the interceptor intentionally passes **through unfiltered when no tenant context is established** — so a surface is only safe insofar as it establishes tenant context first. Generated SvelteKit routes do this (#1540); the CLI/MCP code paths do not yet, which is a known framework-level residual (fail-closed tenant context for CLI/MCP) tracked outside this package, not an analytics-specific gap.
|
|
15
|
+
|
|
16
|
+
## Key Collection Methods
|
|
17
|
+
|
|
18
|
+
`findByExternalId()`, `findByProvider()`, `findNeedingSync()`, `findGA4Properties()`, `findPlausibleSites()`, `findMatomoSites()`
|
|
19
|
+
|
|
20
|
+
## AI Operations
|
|
21
|
+
|
|
22
|
+
`analyzePerformance()`, `analyzeResults()`, `hasPositiveTrends()` route through registered prompts (see Prompt Registry below) so tenant overrides apply via `resolvePrompt()`. `isPerformingWell()` still uses the inline `is()` shortcut.
|
|
23
|
+
|
|
24
|
+
## Prompt Registry
|
|
25
|
+
|
|
26
|
+
Three prompts are registered at module-load time via `definePrompt()` from `@happyvertical/smrt-prompts`. Re-exported from the package root for tenant override targeting.
|
|
27
|
+
|
|
28
|
+
| Key | Method | Variables (PII-conscious) |
|
|
29
|
+
|-----|--------|---------------------------|
|
|
30
|
+
| `smrtAnalytics.property.analyzePerformance` | `AnalyticsProperty.analyzePerformance()` | `period`, `propertyDisplayName`, `propertyProvider` |
|
|
31
|
+
| `smrtAnalytics.report.analyzeResults` | `AnalyticsReport.analyzeResults()` | `reportName`, `reportDimensions`, `reportMetrics`, `dateRangeStart`, `dateRangeEnd`, `rowCount`, `reportData` |
|
|
32
|
+
| `smrtAnalytics.report.hasPositiveTrends` | `AnalyticsReport.hasPositiveTrends()` | `reportMetrics`, `reportData` |
|
|
33
|
+
|
|
34
|
+
**Excluded from variables (never reach the AI provider):**
|
|
35
|
+
- `id`, `propertyId`, `tenantId`, `externalId` — internal foreign keys / UUIDs that link to identifying records.
|
|
36
|
+
- `apiSecret`, `measurementId`, `siteDomain` — provider credentials and platform-specific identifiers (GA4 API secrets, Matomo `idSite`, custom `G-XXXX` measurement IDs).
|
|
37
|
+
- `providerMetadata` — extensible JSON blob that may contain credentials, account IDs, or other configuration secrets.
|
|
38
|
+
- `lastError`, raw `dimensionFilter` / `metricFilter` JSON — internal error strings (may contain auth tokens) and filter expressions that may reference cookie IDs, user-pseudo-IDs, or IP-derived geos.
|
|
39
|
+
|
|
40
|
+
**`resultData` is forwarded verbatim.** This package does not — and cannot — strip PII from result rows, because the row schema is determined by the dimensions/metrics the caller asked the analytics provider to return. If the caller persists rows containing a `userPseudoId`, `clientId`, IP-derived geolocation, or any other identifier, those fields WILL reach the AI provider. Callers must:
|
|
41
|
+
|
|
42
|
+
- exclude PII-bearing dimensions before persisting `resultData` (e.g. don't request `userPseudoId` as a GA4 dimension), or
|
|
43
|
+
- apply a column allowlist at the call site before invoking `analyzeResults()`, or
|
|
44
|
+
- override the prompt template via `PromptOverride` to redact rows.
|
|
45
|
+
|
|
46
|
+
The forwarding contract is pinned by a regression test in `src/__tests__/analytics-report-prompt.test.ts`.
|
|
47
|
+
|
|
48
|
+
See `src/prompts.ts` for the full rationale block.
|
|
49
|
+
|
|
50
|
+
## UI Registry
|
|
51
|
+
|
|
52
|
+
Svelte components live in `src/svelte/` and auto-register with `ModuleUIRegistry` from `@happyvertical/smrt-svelte/registry` when `@happyvertical/smrt-analytics/svelte` is imported.
|
|
53
|
+
|
|
54
|
+
Slot declarations live in `src/ui.ts`, exported via the `./ui` package subpath. The slots are: `analytics-summary`, `events-table`, `property-info`, `property-status-badge`, `stat-card`, `trend-badge` (see `ANALYTICS_UI_SLOTS` for icons / categories / display order).
|
|
55
|
+
|
|
56
|
+
```typescript
|
|
57
|
+
import '@happyvertical/smrt-analytics/svelte'; // side-effect: registers slots
|
|
58
|
+
import { ModuleUIRegistry } from '@happyvertical/smrt-svelte/registry';
|
|
59
|
+
const StatCard = ModuleUIRegistry.get('@happyvertical/smrt-analytics', 'stat-card');
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## Gotchas
|
|
63
|
+
|
|
64
|
+
- **`apiSecret` / `providerMetadata` stripped from API/MCP**: marked `@field({ sensitive: true })` (#1540) so they never appear in generated responses or `where` filters. They are still stored at rest **unencrypted** — envelope encryption via `@happyvertical/smrt-secrets` is a separate, breaking follow-up (tracked, not done here).
|
|
65
|
+
- **Event retry at model level**: no background job integration
|
|
66
|
+
- **JSON fields**: params, dimensions, metrics use string storage with getter/setter helpers
|
|
67
|
+
- **Measurement IDs differ per platform**: G-XXXXXX (GA4 web) vs Firebase app ID (mobile)
|
|
68
|
+
- **`analyzeResults` is now a single AI call**: previously issued a second freeform `do()` to summarize "top 3 insights"; folded into the registered template, and `insights` mirrors `analysis` in the response shape.
|
package/CLAUDE.md
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@AGENTS.md
|
package/LICENSE
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
Copyright <2025> <Happy Vertical Corporation>
|
|
2
|
+
|
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
4
|
+
|
|
5
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
6
|
+
|
|
7
|
+
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
# @happyvertical/smrt-analytics
|
|
2
|
+
|
|
3
|
+
Analytics integration models for the SMRT framework. Manages analytics properties (GA4, Plausible, Matomo), data streams, server-side event tracking with retry support, and AI-powered report generation with scheduling.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
pnpm add @happyvertical/smrt-analytics
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
```typescript
|
|
14
|
+
import {
|
|
15
|
+
AnalyticsProperty, AnalyticsPropertyCollection,
|
|
16
|
+
AnalyticsDataStream, AnalyticsDataStreamCollection,
|
|
17
|
+
AnalyticsEvent, AnalyticsEventCollection,
|
|
18
|
+
AnalyticsReport, AnalyticsReportCollection,
|
|
19
|
+
AnalyticsProvider, DataStreamType, ReportFrequency
|
|
20
|
+
} from '@happyvertical/smrt-analytics';
|
|
21
|
+
|
|
22
|
+
// Create a GA4 property
|
|
23
|
+
const properties = new AnalyticsPropertyCollection(db);
|
|
24
|
+
const property = await properties.create({
|
|
25
|
+
name: 'main-site',
|
|
26
|
+
displayName: 'Main Site Analytics',
|
|
27
|
+
provider: AnalyticsProvider.GA4,
|
|
28
|
+
externalId: 'properties/123456789',
|
|
29
|
+
measurementId: 'G-XXXXXXXXXX',
|
|
30
|
+
apiSecret: 'server-side-secret',
|
|
31
|
+
status: 'active',
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
// Add a web data stream
|
|
35
|
+
const streams = new AnalyticsDataStreamCollection(db);
|
|
36
|
+
await streams.create({
|
|
37
|
+
propertyId: property.id,
|
|
38
|
+
displayName: 'Web Traffic',
|
|
39
|
+
streamType: DataStreamType.WEB,
|
|
40
|
+
measurementId: 'G-XXXXXXXXXX',
|
|
41
|
+
defaultUri: 'https://example.com',
|
|
42
|
+
status: 'active',
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
// Track a server-side event with retry support
|
|
46
|
+
const events = new AnalyticsEventCollection(db);
|
|
47
|
+
const event = await events.create({
|
|
48
|
+
propertyId: property.id,
|
|
49
|
+
eventName: 'purchase',
|
|
50
|
+
clientId: 'client-uuid',
|
|
51
|
+
params: JSON.stringify({ value: 99.99, currency: 'USD' }),
|
|
52
|
+
status: 'pending',
|
|
53
|
+
});
|
|
54
|
+
// After sending: event.markSent() or event.markFailed('timeout')
|
|
55
|
+
// Retry logic: event.shouldRetry(3) checks retryCount < maxRetries
|
|
56
|
+
|
|
57
|
+
// Create a scheduled report with dimensions and metrics
|
|
58
|
+
const reports = new AnalyticsReportCollection(db);
|
|
59
|
+
const report = await reports.create({
|
|
60
|
+
propertyId: property.id,
|
|
61
|
+
name: 'Weekly Traffic Report',
|
|
62
|
+
dimensions: JSON.stringify([{ name: 'country' }, { name: 'deviceCategory' }]),
|
|
63
|
+
metrics: JSON.stringify([{ name: 'activeUsers' }, { name: 'sessions' }]),
|
|
64
|
+
dateRangeStart: '7daysAgo',
|
|
65
|
+
dateRangeEnd: 'today',
|
|
66
|
+
frequency: ReportFrequency.WEEKLY,
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
// AI-powered operations (uses do() and is() from SmrtObject)
|
|
70
|
+
const analysis = await property.analyzePerformance({ period: '30 days' });
|
|
71
|
+
const isHealthy = await property.isPerformingWell();
|
|
72
|
+
const insights = await report.analyzeResults();
|
|
73
|
+
const trending = await report.hasPositiveTrends();
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### Server-Side Event Lifecycle
|
|
77
|
+
|
|
78
|
+
Events track their delivery status with built-in retry support:
|
|
79
|
+
|
|
80
|
+
1. **PENDING** -- created, not yet sent to provider
|
|
81
|
+
2. **SENT** -- successfully delivered (`markSent()` sets `sentAt` timestamp)
|
|
82
|
+
3. **FAILED** -- delivery failed (`markFailed(error)` increments `retryCount`)
|
|
83
|
+
|
|
84
|
+
Use `shouldRetry(maxRetries)` to check if a failed event should be retried, and `resetForRetry()` to reset it to PENDING.
|
|
85
|
+
|
|
86
|
+
### Report Scheduling
|
|
87
|
+
|
|
88
|
+
Reports support automatic scheduling via `ReportFrequency`:
|
|
89
|
+
|
|
90
|
+
- `ONCE` -- single run, no rescheduling
|
|
91
|
+
- `DAILY` / `WEEKLY` / `MONTHLY` -- `calculateNextRun()` sets `nextRunAt` after each run
|
|
92
|
+
|
|
93
|
+
Use `isDue()` to check if a scheduled report needs to run.
|
|
94
|
+
|
|
95
|
+
## API
|
|
96
|
+
|
|
97
|
+
### Models
|
|
98
|
+
|
|
99
|
+
| Export | Description |
|
|
100
|
+
|--------|------------|
|
|
101
|
+
| `AnalyticsProperty` | GA4 property, Plausible site, or Matomo site. AI methods: `analyzePerformance()`, `isPerformingWell()` |
|
|
102
|
+
| `AnalyticsDataStream` | Data stream within a property (web/iOS/Android). `getPlatformId()` returns measurementId or firebaseAppId |
|
|
103
|
+
| `AnalyticsEvent` | Server-side tracking event with retry queue. `toTrackEvent()` builds SDK payload |
|
|
104
|
+
| `AnalyticsReport` | Saved report config with dimensions/metrics, scheduling, result caching. AI methods: `analyzeResults()`, `hasPositiveTrends()` |
|
|
105
|
+
|
|
106
|
+
### Collections
|
|
107
|
+
|
|
108
|
+
`AnalyticsPropertyCollection`, `AnalyticsDataStreamCollection`, `AnalyticsEventCollection`, `AnalyticsReportCollection`
|
|
109
|
+
|
|
110
|
+
### Enums
|
|
111
|
+
|
|
112
|
+
| Export | Description |
|
|
113
|
+
|--------|------------|
|
|
114
|
+
| `AnalyticsProvider` | `ga4`, `plausible`, `matomo` |
|
|
115
|
+
| `AnalyticsPropertyStatus` | `active`, `inactive`, `pending` |
|
|
116
|
+
| `DataStreamType` | `WEB_DATA_STREAM`, `ANDROID_APP_DATA_STREAM`, `IOS_APP_DATA_STREAM` |
|
|
117
|
+
| `DataStreamStatus` | `active`, `inactive` |
|
|
118
|
+
| `TrackingEventStatus` | `pending`, `sent`, `failed` |
|
|
119
|
+
| `ReportStatus` | `draft`, `scheduled`, `running`, `completed`, `failed` |
|
|
120
|
+
| `ReportFrequency` | `once`, `daily`, `weekly`, `monthly` |
|
|
121
|
+
| `CountingMethod` | `ONCE_PER_EVENT`, `ONCE_PER_SESSION` |
|
|
122
|
+
| `CustomDimensionScope` | `EVENT`, `USER`, `ITEM` |
|
|
123
|
+
|
|
124
|
+
### SDK Types
|
|
125
|
+
|
|
126
|
+
Re-exported from `./types` for SDK compatibility: `AnalyticsInterface`, `AnalyticsCapabilities`, `SDKProperty`, `SDKDataStream`, `SDKTrackEvent`, `SDKPageviewEvent`, `SDKReportOptions`, `SDKReportResult`, `SDKCustomDimension`, `SDKCustomMetric`, `SDKKeyEvent`, `PropertyStatsWithTrend`.
|
|
127
|
+
|
|
128
|
+
## Dependencies
|
|
129
|
+
|
|
130
|
+
- `@happyvertical/smrt-core` -- ORM and code generation
|
|
131
|
+
- Peer: `svelte` (optional, for Svelte components via `@happyvertical/smrt-analytics/svelte`)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"__smrt-register__.d.ts","sourceRoot":"","sources":["../src/__smrt-register__.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { SmrtCollection } from '@happyvertical/smrt-core';
|
|
2
|
+
import { AnalyticsDataStream } from '../models/AnalyticsDataStream.js';
|
|
3
|
+
import { DataStreamStatus, DataStreamType } from '../types/index.js';
|
|
4
|
+
export declare class AnalyticsDataStreamCollection extends SmrtCollection<AnalyticsDataStream> {
|
|
5
|
+
static readonly _itemClass: typeof AnalyticsDataStream;
|
|
6
|
+
/**
|
|
7
|
+
* Find streams by property
|
|
8
|
+
*
|
|
9
|
+
* @param propertyId - Parent property ID
|
|
10
|
+
* @returns Array of data streams
|
|
11
|
+
*/
|
|
12
|
+
findByProperty(propertyId: string): Promise<AnalyticsDataStream[]>;
|
|
13
|
+
/**
|
|
14
|
+
* Find stream by external ID
|
|
15
|
+
*
|
|
16
|
+
* @param externalId - External stream ID from provider
|
|
17
|
+
* @returns Matching stream or null
|
|
18
|
+
*/
|
|
19
|
+
findByExternalId(externalId: string): Promise<AnalyticsDataStream | null>;
|
|
20
|
+
/**
|
|
21
|
+
* Find stream by measurement ID (web streams)
|
|
22
|
+
*
|
|
23
|
+
* @param measurementId - GA4 measurement ID (G-XXXXXXX)
|
|
24
|
+
* @returns Matching stream or null
|
|
25
|
+
*/
|
|
26
|
+
findByMeasurementId(measurementId: string): Promise<AnalyticsDataStream | null>;
|
|
27
|
+
/**
|
|
28
|
+
* Find streams by type
|
|
29
|
+
*
|
|
30
|
+
* @param streamType - Stream type (WEB, ANDROID, IOS)
|
|
31
|
+
* @returns Array of matching streams
|
|
32
|
+
*/
|
|
33
|
+
findByType(streamType: DataStreamType): Promise<AnalyticsDataStream[]>;
|
|
34
|
+
/**
|
|
35
|
+
* Find all web streams
|
|
36
|
+
*/
|
|
37
|
+
findWebStreams(): Promise<AnalyticsDataStream[]>;
|
|
38
|
+
/**
|
|
39
|
+
* Find all iOS app streams
|
|
40
|
+
*/
|
|
41
|
+
findIOSStreams(): Promise<AnalyticsDataStream[]>;
|
|
42
|
+
/**
|
|
43
|
+
* Find all Android app streams
|
|
44
|
+
*/
|
|
45
|
+
findAndroidStreams(): Promise<AnalyticsDataStream[]>;
|
|
46
|
+
/**
|
|
47
|
+
* Find all mobile app streams (iOS + Android)
|
|
48
|
+
*/
|
|
49
|
+
findMobileStreams(): Promise<AnalyticsDataStream[]>;
|
|
50
|
+
/**
|
|
51
|
+
* Find streams by status
|
|
52
|
+
*
|
|
53
|
+
* @param status - Stream status
|
|
54
|
+
* @returns Array of matching streams
|
|
55
|
+
*/
|
|
56
|
+
findByStatus(status: DataStreamStatus): Promise<AnalyticsDataStream[]>;
|
|
57
|
+
/**
|
|
58
|
+
* Find all active streams
|
|
59
|
+
*/
|
|
60
|
+
findActive(): Promise<AnalyticsDataStream[]>;
|
|
61
|
+
/**
|
|
62
|
+
* Find active streams for a property
|
|
63
|
+
*
|
|
64
|
+
* @param propertyId - Parent property ID
|
|
65
|
+
* @returns Array of active streams
|
|
66
|
+
*/
|
|
67
|
+
findActiveByProperty(propertyId: string): Promise<AnalyticsDataStream[]>;
|
|
68
|
+
}
|
|
69
|
+
//# sourceMappingURL=AnalyticsDataStreamCollection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AnalyticsDataStreamCollection.d.ts","sourceRoot":"","sources":["../../src/collections/AnalyticsDataStreamCollection.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AACvE,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAErE,qBAAa,6BAA8B,SAAQ,cAAc,CAAC,mBAAmB,CAAC;IACpF,MAAM,CAAC,QAAQ,CAAC,UAAU,6BAAuB;IAEjD;;;;;OAKG;IACG,cAAc,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,mBAAmB,EAAE,CAAC;IAOxE;;;;;OAKG;IACG,gBAAgB,CACpB,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,mBAAmB,GAAG,IAAI,CAAC;IAQtC;;;;;OAKG;IACG,mBAAmB,CACvB,aAAa,EAAE,MAAM,GACpB,OAAO,CAAC,mBAAmB,GAAG,IAAI,CAAC;IAQtC;;;;;OAKG;IACG,UAAU,CAAC,UAAU,EAAE,cAAc,GAAG,OAAO,CAAC,mBAAmB,EAAE,CAAC;IAO5E;;OAEG;IACG,cAAc,IAAI,OAAO,CAAC,mBAAmB,EAAE,CAAC;IAItD;;OAEG;IACG,cAAc,IAAI,OAAO,CAAC,mBAAmB,EAAE,CAAC;IAItD;;OAEG;IACG,kBAAkB,IAAI,OAAO,CAAC,mBAAmB,EAAE,CAAC;IAI1D;;OAEG;IACG,iBAAiB,IAAI,OAAO,CAAC,mBAAmB,EAAE,CAAC;IAQzD;;;;;OAKG;IACG,YAAY,CAAC,MAAM,EAAE,gBAAgB,GAAG,OAAO,CAAC,mBAAmB,EAAE,CAAC;IAO5E;;OAEG;IACG,UAAU,IAAI,OAAO,CAAC,mBAAmB,EAAE,CAAC;IAIlD;;;;;OAKG;IACG,oBAAoB,CACxB,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,mBAAmB,EAAE,CAAC;CASlC"}
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import { SmrtCollection } from '@happyvertical/smrt-core';
|
|
2
|
+
import { AnalyticsEvent } from '../models/AnalyticsEvent.js';
|
|
3
|
+
import { PropertyStatsWithTrend, TrackingEventStatus } from '../types/index.js';
|
|
4
|
+
export declare class AnalyticsEventCollection extends SmrtCollection<AnalyticsEvent> {
|
|
5
|
+
static readonly _itemClass: typeof AnalyticsEvent;
|
|
6
|
+
/**
|
|
7
|
+
* Find events by property
|
|
8
|
+
*
|
|
9
|
+
* @param propertyId - Parent property ID
|
|
10
|
+
* @returns Array of events
|
|
11
|
+
*/
|
|
12
|
+
findByProperty(propertyId: string): Promise<AnalyticsEvent[]>;
|
|
13
|
+
/**
|
|
14
|
+
* Find events by event name
|
|
15
|
+
*
|
|
16
|
+
* @param eventName - Event name to filter by
|
|
17
|
+
* @returns Array of matching events
|
|
18
|
+
*/
|
|
19
|
+
findByEventName(eventName: string): Promise<AnalyticsEvent[]>;
|
|
20
|
+
/**
|
|
21
|
+
* Find events by client ID
|
|
22
|
+
*
|
|
23
|
+
* @param clientId - Client ID
|
|
24
|
+
* @returns Array of events for this client
|
|
25
|
+
*/
|
|
26
|
+
findByClientId(clientId: string): Promise<AnalyticsEvent[]>;
|
|
27
|
+
/**
|
|
28
|
+
* Find events by user ID
|
|
29
|
+
*
|
|
30
|
+
* @param userId - User ID
|
|
31
|
+
* @returns Array of events for this user
|
|
32
|
+
*/
|
|
33
|
+
findByUserId(userId: string): Promise<AnalyticsEvent[]>;
|
|
34
|
+
/**
|
|
35
|
+
* Find events by status
|
|
36
|
+
*
|
|
37
|
+
* @param status - Tracking event status
|
|
38
|
+
* @returns Array of matching events
|
|
39
|
+
*/
|
|
40
|
+
findByStatus(status: TrackingEventStatus): Promise<AnalyticsEvent[]>;
|
|
41
|
+
/**
|
|
42
|
+
* Find all pending events
|
|
43
|
+
*/
|
|
44
|
+
findPending(): Promise<AnalyticsEvent[]>;
|
|
45
|
+
/**
|
|
46
|
+
* Find all sent events
|
|
47
|
+
*/
|
|
48
|
+
findSent(): Promise<AnalyticsEvent[]>;
|
|
49
|
+
/**
|
|
50
|
+
* Find all failed events
|
|
51
|
+
*/
|
|
52
|
+
findFailed(): Promise<AnalyticsEvent[]>;
|
|
53
|
+
/**
|
|
54
|
+
* Find events that should be retried
|
|
55
|
+
*
|
|
56
|
+
* @param maxRetries - Maximum retry count
|
|
57
|
+
* @returns Array of events eligible for retry
|
|
58
|
+
*/
|
|
59
|
+
findForRetry(maxRetries?: number): Promise<AnalyticsEvent[]>;
|
|
60
|
+
/**
|
|
61
|
+
* Find pending events for a property
|
|
62
|
+
*
|
|
63
|
+
* @param propertyId - Parent property ID
|
|
64
|
+
* @returns Array of pending events
|
|
65
|
+
*/
|
|
66
|
+
findPendingByProperty(propertyId: string): Promise<AnalyticsEvent[]>;
|
|
67
|
+
/**
|
|
68
|
+
* Find events by date range
|
|
69
|
+
*
|
|
70
|
+
* @param startDate - Start date
|
|
71
|
+
* @param endDate - End date
|
|
72
|
+
* @returns Array of events in date range
|
|
73
|
+
*/
|
|
74
|
+
findByDateRange(startDate: Date, endDate: Date): Promise<AnalyticsEvent[]>;
|
|
75
|
+
/**
|
|
76
|
+
* Find conversion events
|
|
77
|
+
*
|
|
78
|
+
* @param propertyId - Optional property ID filter
|
|
79
|
+
* @returns Array of conversion events
|
|
80
|
+
*/
|
|
81
|
+
findConversions(propertyId?: string): Promise<AnalyticsEvent[]>;
|
|
82
|
+
/**
|
|
83
|
+
* Find pageview events
|
|
84
|
+
*
|
|
85
|
+
* @param propertyId - Optional property ID filter
|
|
86
|
+
* @returns Array of pageview events
|
|
87
|
+
*/
|
|
88
|
+
findPageviews(propertyId?: string): Promise<AnalyticsEvent[]>;
|
|
89
|
+
/**
|
|
90
|
+
* Count events by event name for a property
|
|
91
|
+
*
|
|
92
|
+
* @param propertyId - Property ID
|
|
93
|
+
* @returns Map of event name to count
|
|
94
|
+
*/
|
|
95
|
+
countByEventName(propertyId: string): Promise<Map<string, number>>;
|
|
96
|
+
/**
|
|
97
|
+
* Get event stats for a property
|
|
98
|
+
*
|
|
99
|
+
* @param propertyId - Property ID
|
|
100
|
+
* @returns Event statistics
|
|
101
|
+
*/
|
|
102
|
+
getPropertyStats(propertyId: string): Promise<{
|
|
103
|
+
total: number;
|
|
104
|
+
pending: number;
|
|
105
|
+
sent: number;
|
|
106
|
+
failed: number;
|
|
107
|
+
conversions: number;
|
|
108
|
+
pageviews: number;
|
|
109
|
+
}>;
|
|
110
|
+
/**
|
|
111
|
+
* Get day-over-day pageview stats with trend for a property.
|
|
112
|
+
*
|
|
113
|
+
* Compares today's pageview count against yesterday's to produce a
|
|
114
|
+
* trend direction and percentage change. A threshold of 5% is used
|
|
115
|
+
* to classify 'up' vs 'down' vs 'flat'.
|
|
116
|
+
*
|
|
117
|
+
* @param propertyId - Property ID
|
|
118
|
+
* @param now - Optional current date (for testing)
|
|
119
|
+
* @returns Stats with trend
|
|
120
|
+
*/
|
|
121
|
+
getPropertyStatsWithTrend(propertyId: string, now?: Date): Promise<PropertyStatsWithTrend>;
|
|
122
|
+
/**
|
|
123
|
+
* Get day-over-day stats for multiple properties in batch.
|
|
124
|
+
*
|
|
125
|
+
* @param propertyIds - Array of property IDs
|
|
126
|
+
* @param now - Optional current date (for testing)
|
|
127
|
+
* @returns Map of propertyId to stats
|
|
128
|
+
*/
|
|
129
|
+
getBatchPropertyStats(propertyIds: string[], now?: Date): Promise<Map<string, PropertyStatsWithTrend>>;
|
|
130
|
+
}
|
|
131
|
+
//# sourceMappingURL=AnalyticsEventCollection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AnalyticsEventCollection.d.ts","sourceRoot":"","sources":["../../src/collections/AnalyticsEventCollection.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EACL,KAAK,sBAAsB,EAC3B,mBAAmB,EACpB,MAAM,mBAAmB,CAAC;AAE3B,qBAAa,wBAAyB,SAAQ,cAAc,CAAC,cAAc,CAAC;IAC1E,MAAM,CAAC,QAAQ,CAAC,UAAU,wBAAkB;IAE5C;;;;;OAKG;IACG,cAAc,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC;IAOnE;;;;;OAKG;IACG,eAAe,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC;IAOnE;;;;;OAKG;IACG,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC;IAOjE;;;;;OAKG;IACG,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC;IAO7D;;;;;OAKG;IACG,YAAY,CAAC,MAAM,EAAE,mBAAmB,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC;IAO1E;;OAEG;IACG,WAAW,IAAI,OAAO,CAAC,cAAc,EAAE,CAAC;IAI9C;;OAEG;IACG,QAAQ,IAAI,OAAO,CAAC,cAAc,EAAE,CAAC;IAI3C;;OAEG;IACG,UAAU,IAAI,OAAO,CAAC,cAAc,EAAE,CAAC;IAI7C;;;;;OAKG;IACG,YAAY,CAAC,UAAU,GAAE,MAAU,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC;IAKrE;;;;;OAKG;IACG,qBAAqB,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC;IAU1E;;;;;;OAMG;IACG,eAAe,CACnB,SAAS,EAAE,IAAI,EACf,OAAO,EAAE,IAAI,GACZ,OAAO,CAAC,cAAc,EAAE,CAAC;IAU5B;;;;;OAKG;IACG,eAAe,CAAC,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC;IAcrE;;;;;OAKG;IACG,aAAa,CAAC,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC;IAWnE;;;;;OAKG;IACG,gBAAgB,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAYxE;;;;;OAKG;IACG,gBAAgB,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC;QAClD,KAAK,EAAE,MAAM,CAAC;QACd,OAAO,EAAE,MAAM,CAAC;QAChB,IAAI,EAAE,MAAM,CAAC;QACb,MAAM,EAAE,MAAM,CAAC;QACf,WAAW,EAAE,MAAM,CAAC;QACpB,SAAS,EAAE,MAAM,CAAC;KACnB,CAAC;IAeF;;;;;;;;;;OAUG;IACG,yBAAyB,CAC7B,UAAU,EAAE,MAAM,EAClB,GAAG,CAAC,EAAE,IAAI,GACT,OAAO,CAAC,sBAAsB,CAAC;IA2DlC;;;;;;OAMG;IACG,qBAAqB,CACzB,WAAW,EAAE,MAAM,EAAE,EACrB,GAAG,CAAC,EAAE,IAAI,GACT,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,sBAAsB,CAAC,CAAC;CAqEhD"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { SmrtCollection } from '@happyvertical/smrt-core';
|
|
2
|
+
import { AnalyticsProperty } from '../models/AnalyticsProperty.js';
|
|
3
|
+
import { AnalyticsPropertyStatus, AnalyticsProvider } from '../types/index.js';
|
|
4
|
+
export declare class AnalyticsPropertyCollection extends SmrtCollection<AnalyticsProperty> {
|
|
5
|
+
static readonly _itemClass: typeof AnalyticsProperty;
|
|
6
|
+
/**
|
|
7
|
+
* Find property by external ID
|
|
8
|
+
*
|
|
9
|
+
* @param externalId - External ID from provider
|
|
10
|
+
* @returns Matching property or null
|
|
11
|
+
*/
|
|
12
|
+
findByExternalId(externalId: string): Promise<AnalyticsProperty | null>;
|
|
13
|
+
/**
|
|
14
|
+
* Find property by measurement ID (GA4)
|
|
15
|
+
*
|
|
16
|
+
* @param measurementId - GA4 measurement ID (G-XXXXXXXXXX)
|
|
17
|
+
* @returns Matching property or null
|
|
18
|
+
*/
|
|
19
|
+
findByMeasurementId(measurementId: string): Promise<AnalyticsProperty | null>;
|
|
20
|
+
/**
|
|
21
|
+
* Find property by site domain and optional provider.
|
|
22
|
+
*
|
|
23
|
+
* @param siteDomain - Provider site domain
|
|
24
|
+
* @param provider - Optional provider discriminator for migration/coexistence
|
|
25
|
+
* @returns Matching property or null
|
|
26
|
+
*/
|
|
27
|
+
findBySiteDomain(siteDomain: string, provider?: AnalyticsProvider): Promise<AnalyticsProperty | null>;
|
|
28
|
+
/**
|
|
29
|
+
* Find properties by provider
|
|
30
|
+
*
|
|
31
|
+
* @param provider - Analytics provider
|
|
32
|
+
* @returns Array of matching properties
|
|
33
|
+
*/
|
|
34
|
+
findByProvider(provider: AnalyticsProvider): Promise<AnalyticsProperty[]>;
|
|
35
|
+
/**
|
|
36
|
+
* Find all GA4 properties
|
|
37
|
+
*/
|
|
38
|
+
findGA4Properties(): Promise<AnalyticsProperty[]>;
|
|
39
|
+
/**
|
|
40
|
+
* Find all Plausible sites
|
|
41
|
+
*/
|
|
42
|
+
findPlausibleSites(): Promise<AnalyticsProperty[]>;
|
|
43
|
+
/**
|
|
44
|
+
* Find all Matomo sites
|
|
45
|
+
*/
|
|
46
|
+
findMatomoSites(): Promise<AnalyticsProperty[]>;
|
|
47
|
+
/**
|
|
48
|
+
* Find properties by status
|
|
49
|
+
*
|
|
50
|
+
* @param status - Property status
|
|
51
|
+
* @returns Array of matching properties
|
|
52
|
+
*/
|
|
53
|
+
findByStatus(status: AnalyticsPropertyStatus): Promise<AnalyticsProperty[]>;
|
|
54
|
+
/**
|
|
55
|
+
* Find all active properties
|
|
56
|
+
*/
|
|
57
|
+
findActive(): Promise<AnalyticsProperty[]>;
|
|
58
|
+
/**
|
|
59
|
+
* Find properties that need syncing (not synced in last N hours)
|
|
60
|
+
*
|
|
61
|
+
* @param hoursAgo - Hours since last sync
|
|
62
|
+
* @returns Array of properties needing sync
|
|
63
|
+
*/
|
|
64
|
+
findNeedingSync(hoursAgo?: number): Promise<AnalyticsProperty[]>;
|
|
65
|
+
}
|
|
66
|
+
//# sourceMappingURL=AnalyticsPropertyCollection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AnalyticsPropertyCollection.d.ts","sourceRoot":"","sources":["../../src/collections/AnalyticsPropertyCollection.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACnE,OAAO,EAAE,uBAAuB,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAE/E,qBAAa,2BAA4B,SAAQ,cAAc,CAAC,iBAAiB,CAAC;IAChF,MAAM,CAAC,QAAQ,CAAC,UAAU,2BAAqB;IAE/C;;;;;OAKG;IACG,gBAAgB,CACpB,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,iBAAiB,GAAG,IAAI,CAAC;IAQpC;;;;;OAKG;IACG,mBAAmB,CACvB,aAAa,EAAE,MAAM,GACpB,OAAO,CAAC,iBAAiB,GAAG,IAAI,CAAC;IAQpC;;;;;;OAMG;IACG,gBAAgB,CACpB,UAAU,EAAE,MAAM,EAClB,QAAQ,CAAC,EAAE,iBAAiB,GAC3B,OAAO,CAAC,iBAAiB,GAAG,IAAI,CAAC;IAQpC;;;;;OAKG;IACG,cAAc,CAClB,QAAQ,EAAE,iBAAiB,GAC1B,OAAO,CAAC,iBAAiB,EAAE,CAAC;IAO/B;;OAEG;IACG,iBAAiB,IAAI,OAAO,CAAC,iBAAiB,EAAE,CAAC;IAIvD;;OAEG;IACG,kBAAkB,IAAI,OAAO,CAAC,iBAAiB,EAAE,CAAC;IAIxD;;OAEG;IACG,eAAe,IAAI,OAAO,CAAC,iBAAiB,EAAE,CAAC;IAIrD;;;;;OAKG;IACG,YAAY,CAChB,MAAM,EAAE,uBAAuB,GAC9B,OAAO,CAAC,iBAAiB,EAAE,CAAC;IAO/B;;OAEG;IACG,UAAU,IAAI,OAAO,CAAC,iBAAiB,EAAE,CAAC;IAIhD;;;;;OAKG;IACG,eAAe,CAAC,QAAQ,GAAE,MAAW,GAAG,OAAO,CAAC,iBAAiB,EAAE,CAAC;CAQ3E"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { SmrtCollection } from '@happyvertical/smrt-core';
|
|
2
|
+
import { AnalyticsReport } from '../models/AnalyticsReport.js';
|
|
3
|
+
import { ReportFrequency, ReportStatus } from '../types/index.js';
|
|
4
|
+
export declare class AnalyticsReportCollection extends SmrtCollection<AnalyticsReport> {
|
|
5
|
+
static readonly _itemClass: typeof AnalyticsReport;
|
|
6
|
+
/**
|
|
7
|
+
* Find reports by property
|
|
8
|
+
*
|
|
9
|
+
* @param propertyId - Parent property ID
|
|
10
|
+
* @returns Array of reports
|
|
11
|
+
*/
|
|
12
|
+
findByProperty(propertyId: string): Promise<AnalyticsReport[]>;
|
|
13
|
+
/**
|
|
14
|
+
* Find reports by status
|
|
15
|
+
*
|
|
16
|
+
* @param status - Report status
|
|
17
|
+
* @returns Array of matching reports
|
|
18
|
+
*/
|
|
19
|
+
findByStatus(status: ReportStatus): Promise<AnalyticsReport[]>;
|
|
20
|
+
/**
|
|
21
|
+
* Find all draft reports
|
|
22
|
+
*/
|
|
23
|
+
findDrafts(): Promise<AnalyticsReport[]>;
|
|
24
|
+
/**
|
|
25
|
+
* Find all scheduled reports
|
|
26
|
+
*/
|
|
27
|
+
findScheduled(): Promise<AnalyticsReport[]>;
|
|
28
|
+
/**
|
|
29
|
+
* Find all completed reports
|
|
30
|
+
*/
|
|
31
|
+
findCompleted(): Promise<AnalyticsReport[]>;
|
|
32
|
+
/**
|
|
33
|
+
* Find all failed reports
|
|
34
|
+
*/
|
|
35
|
+
findFailed(): Promise<AnalyticsReport[]>;
|
|
36
|
+
/**
|
|
37
|
+
* Find reports by frequency
|
|
38
|
+
*
|
|
39
|
+
* @param frequency - Report frequency
|
|
40
|
+
* @returns Array of matching reports
|
|
41
|
+
*/
|
|
42
|
+
findByFrequency(frequency: ReportFrequency): Promise<AnalyticsReport[]>;
|
|
43
|
+
/**
|
|
44
|
+
* Find all recurring reports (not one-time)
|
|
45
|
+
*/
|
|
46
|
+
findRecurring(): Promise<AnalyticsReport[]>;
|
|
47
|
+
/**
|
|
48
|
+
* Find reports due to run
|
|
49
|
+
*
|
|
50
|
+
* @returns Array of reports that are due
|
|
51
|
+
*/
|
|
52
|
+
findDue(): Promise<AnalyticsReport[]>;
|
|
53
|
+
/**
|
|
54
|
+
* Find reports for a property by status
|
|
55
|
+
*
|
|
56
|
+
* @param propertyId - Parent property ID
|
|
57
|
+
* @param status - Report status
|
|
58
|
+
* @returns Array of matching reports
|
|
59
|
+
*/
|
|
60
|
+
findByPropertyAndStatus(propertyId: string, status: ReportStatus): Promise<AnalyticsReport[]>;
|
|
61
|
+
/**
|
|
62
|
+
* Find recently run reports
|
|
63
|
+
*
|
|
64
|
+
* @param hoursAgo - Hours since last run
|
|
65
|
+
* @returns Array of recently run reports
|
|
66
|
+
*/
|
|
67
|
+
findRecentlyRun(hoursAgo?: number): Promise<AnalyticsReport[]>;
|
|
68
|
+
}
|
|
69
|
+
//# sourceMappingURL=AnalyticsReportCollection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AnalyticsReportCollection.d.ts","sourceRoot":"","sources":["../../src/collections/AnalyticsReportCollection.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAElE,qBAAa,yBAA0B,SAAQ,cAAc,CAAC,eAAe,CAAC;IAC5E,MAAM,CAAC,QAAQ,CAAC,UAAU,yBAAmB;IAE7C;;;;;OAKG;IACG,cAAc,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,EAAE,CAAC;IAOpE;;;;;OAKG;IACG,YAAY,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAAC,eAAe,EAAE,CAAC;IAOpE;;OAEG;IACG,UAAU,IAAI,OAAO,CAAC,eAAe,EAAE,CAAC;IAI9C;;OAEG;IACG,aAAa,IAAI,OAAO,CAAC,eAAe,EAAE,CAAC;IAIjD;;OAEG;IACG,aAAa,IAAI,OAAO,CAAC,eAAe,EAAE,CAAC;IAIjD;;OAEG;IACG,UAAU,IAAI,OAAO,CAAC,eAAe,EAAE,CAAC;IAI9C;;;;;OAKG;IACG,eAAe,CACnB,SAAS,EAAE,eAAe,GACzB,OAAO,CAAC,eAAe,EAAE,CAAC;IAO7B;;OAEG;IACG,aAAa,IAAI,OAAO,CAAC,eAAe,EAAE,CAAC;IAKjD;;;;OAIG;IACG,OAAO,IAAI,OAAO,CAAC,eAAe,EAAE,CAAC;IAO3C;;;;;;OAMG;IACG,uBAAuB,CAC3B,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,YAAY,GACnB,OAAO,CAAC,eAAe,EAAE,CAAC;IAO7B;;;;;OAKG;IACG,eAAe,CAAC,QAAQ,GAAE,MAAW,GAAG,OAAO,CAAC,eAAe,EAAE,CAAC;CAOzE"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Collection exports for smrt-analytics
|
|
3
|
+
*/
|
|
4
|
+
export { AnalyticsDataStreamCollection } from './AnalyticsDataStreamCollection.js';
|
|
5
|
+
export { AnalyticsEventCollection } from './AnalyticsEventCollection.js';
|
|
6
|
+
export { AnalyticsPropertyCollection } from './AnalyticsPropertyCollection.js';
|
|
7
|
+
export { AnalyticsReportCollection } from './AnalyticsReportCollection.js';
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/collections/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,6BAA6B,EAAE,MAAM,oCAAoC,CAAC;AACnF,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AACzE,OAAO,EAAE,2BAA2B,EAAE,MAAM,kCAAkC,CAAC;AAC/E,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { AnalyticsDataStreamCollection, AnalyticsEventCollection, AnalyticsPropertyCollection, AnalyticsReportCollection, } from './collections/index.js';
|
|
2
|
+
export { AnalyticsDataStream, AnalyticsEvent, AnalyticsProperty, AnalyticsReport, } from './models/index.js';
|
|
3
|
+
export { promptMessageOptions, smrtAnalyticsAnalyzePerformancePrompt, smrtAnalyticsAnalyzeResultsPrompt, smrtAnalyticsHasPositiveTrendsPrompt, } from './prompts.js';
|
|
4
|
+
export type { AnalyticsCapabilities, AnalyticsInterface, PropertyStatsWithTrend, SDKCustomDimension, SDKCustomMetric, SDKDataStream, SDKKeyEvent, SDKPageviewEvent, SDKProperty, SDKReportOptions, SDKReportResult, SDKTrackEvent, } from './types/index.js';
|
|
5
|
+
export { AnalyticsPropertyStatus, AnalyticsProvider, CountingMethod, CustomDimensionScope, DataStreamStatus, DataStreamType, ReportFrequency, ReportStatus, TrackingEventStatus, } from './types/index.js';
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAKH,OAAO,wBAAwB,CAAC;AAGhC,OAAO,cAAc,CAAC;AAGtB,OAAO,EACL,6BAA6B,EAC7B,wBAAwB,EACxB,2BAA2B,EAC3B,yBAAyB,GAC1B,MAAM,wBAAwB,CAAC;AAGhC,OAAO,EACL,mBAAmB,EACnB,cAAc,EACd,iBAAiB,EACjB,eAAe,GAChB,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EACL,oBAAoB,EACpB,qCAAqC,EACrC,iCAAiC,EACjC,oCAAoC,GACrC,MAAM,cAAc,CAAC;AAEtB,YAAY,EACV,qBAAqB,EACrB,kBAAkB,EAClB,sBAAsB,EACtB,kBAAkB,EAClB,eAAe,EACf,aAAa,EACb,WAAW,EACX,gBAAgB,EAChB,WAAW,EACX,gBAAgB,EAChB,eAAe,EACf,aAAa,GACd,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EACL,uBAAuB,EACvB,iBAAiB,EACjB,cAAc,EACd,oBAAoB,EACpB,gBAAgB,EAChB,cAAc,EACd,eAAe,EACf,YAAY,EACZ,mBAAmB,GACpB,MAAM,kBAAkB,CAAC"}
|