@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.
Files changed (72) hide show
  1. package/AGENTS.md +68 -0
  2. package/CLAUDE.md +1 -0
  3. package/LICENSE +7 -0
  4. package/README.md +131 -0
  5. package/dist/__smrt-register__.d.ts +2 -0
  6. package/dist/__smrt-register__.d.ts.map +1 -0
  7. package/dist/collections/AnalyticsDataStreamCollection.d.ts +69 -0
  8. package/dist/collections/AnalyticsDataStreamCollection.d.ts.map +1 -0
  9. package/dist/collections/AnalyticsEventCollection.d.ts +131 -0
  10. package/dist/collections/AnalyticsEventCollection.d.ts.map +1 -0
  11. package/dist/collections/AnalyticsPropertyCollection.d.ts +66 -0
  12. package/dist/collections/AnalyticsPropertyCollection.d.ts.map +1 -0
  13. package/dist/collections/AnalyticsReportCollection.d.ts +69 -0
  14. package/dist/collections/AnalyticsReportCollection.d.ts.map +1 -0
  15. package/dist/collections/index.d.ts +8 -0
  16. package/dist/collections/index.d.ts.map +1 -0
  17. package/dist/index.d.ts +6 -0
  18. package/dist/index.d.ts.map +1 -0
  19. package/dist/index.js +1623 -0
  20. package/dist/index.js.map +1 -0
  21. package/dist/manifest.json +4161 -0
  22. package/dist/models/AnalyticsDataStream.d.ts +94 -0
  23. package/dist/models/AnalyticsDataStream.d.ts.map +1 -0
  24. package/dist/models/AnalyticsEvent.d.ts +142 -0
  25. package/dist/models/AnalyticsEvent.d.ts.map +1 -0
  26. package/dist/models/AnalyticsProperty.d.ts +142 -0
  27. package/dist/models/AnalyticsProperty.d.ts.map +1 -0
  28. package/dist/models/AnalyticsReport.d.ts +206 -0
  29. package/dist/models/AnalyticsReport.d.ts.map +1 -0
  30. package/dist/models/index.d.ts +8 -0
  31. package/dist/models/index.d.ts.map +1 -0
  32. package/dist/playground.d.ts +2 -0
  33. package/dist/playground.d.ts.map +1 -0
  34. package/dist/playground.js +99 -0
  35. package/dist/playground.js.map +1 -0
  36. package/dist/prompts.d.ts +57 -0
  37. package/dist/prompts.d.ts.map +1 -0
  38. package/dist/smrt-knowledge.json +1570 -0
  39. package/dist/svelte/AnalyticsSummary.svelte +63 -0
  40. package/dist/svelte/AnalyticsSummary.svelte.d.ts +8 -0
  41. package/dist/svelte/AnalyticsSummary.svelte.d.ts.map +1 -0
  42. package/dist/svelte/EventsTable.svelte +161 -0
  43. package/dist/svelte/EventsTable.svelte.d.ts +16 -0
  44. package/dist/svelte/EventsTable.svelte.d.ts.map +1 -0
  45. package/dist/svelte/PropertyInfo.svelte +139 -0
  46. package/dist/svelte/PropertyInfo.svelte.d.ts +12 -0
  47. package/dist/svelte/PropertyInfo.svelte.d.ts.map +1 -0
  48. package/dist/svelte/PropertyStatusBadge.svelte +65 -0
  49. package/dist/svelte/PropertyStatusBadge.svelte.d.ts +7 -0
  50. package/dist/svelte/PropertyStatusBadge.svelte.d.ts.map +1 -0
  51. package/dist/svelte/StatCard.svelte +63 -0
  52. package/dist/svelte/StatCard.svelte.d.ts +11 -0
  53. package/dist/svelte/StatCard.svelte.d.ts.map +1 -0
  54. package/dist/svelte/TrendBadge.svelte +49 -0
  55. package/dist/svelte/TrendBadge.svelte.d.ts +8 -0
  56. package/dist/svelte/TrendBadge.svelte.d.ts.map +1 -0
  57. package/dist/svelte/i18n.d.ts +10 -0
  58. package/dist/svelte/i18n.d.ts.map +1 -0
  59. package/dist/svelte/i18n.js +10 -0
  60. package/dist/svelte/index.d.ts +29 -0
  61. package/dist/svelte/index.d.ts.map +1 -0
  62. package/dist/svelte/index.js +39 -0
  63. package/dist/svelte/playground.d.ts +88 -0
  64. package/dist/svelte/playground.d.ts.map +1 -0
  65. package/dist/svelte/playground.js +95 -0
  66. package/dist/types/index.d.ts +267 -0
  67. package/dist/types/index.d.ts.map +1 -0
  68. package/dist/ui.d.ts +10 -0
  69. package/dist/ui.d.ts.map +1 -0
  70. package/dist/ui.js +79 -0
  71. package/dist/ui.js.map +1 -0
  72. package/package.json +95 -0
@@ -0,0 +1,1570 @@
1
+ {
2
+ "schemaVersion": 1,
3
+ "generatedAt": "2026-06-23T01:11:29.174Z",
4
+ "packageName": "@happyvertical/smrt-analytics",
5
+ "packageVersion": "0.30.0",
6
+ "sourceManifestPath": "dist/manifest.json",
7
+ "agentDocPath": "AGENTS.md",
8
+ "sourceHashes": {
9
+ "manifest": "e302add9be82e57957b9671541b9aa95626ee255d0e708efe0bd9b6d8607784a",
10
+ "packageJson": "4d240a84df509b34acc572b3051d7bd65967d9b1764e4bcf7b32989b16917ed2",
11
+ "agents": "c529837279bd11914a91124b475e177a17fab2a572cc5341589a4d4f122f6b8b"
12
+ },
13
+ "exports": [
14
+ ".",
15
+ "./manifest",
16
+ "./manifest.json",
17
+ "./playground",
18
+ "./svelte",
19
+ "./ui"
20
+ ],
21
+ "dependencies": {
22
+ "@happyvertical/smrt-core": "workspace:*",
23
+ "@happyvertical/smrt-prompts": "workspace:*",
24
+ "@happyvertical/smrt-tenancy": "workspace:*",
25
+ "@happyvertical/smrt-types": "workspace:*",
26
+ "@happyvertical/smrt-ui": "workspace:*",
27
+ "@happyvertical/smrt-vitest": "workspace:*",
28
+ "@happyvertical/sql": "catalog:",
29
+ "@sveltejs/package": "^2.5.7",
30
+ "@types/node": "25.0.9",
31
+ "fast-glob": "3.3.3",
32
+ "svelte-check": "^4.3.5",
33
+ "svelte": "^5.18.0",
34
+ "typescript": "^5.9.3",
35
+ "vite": "^7.3.1",
36
+ "vitest": "^4.0.17"
37
+ },
38
+ "smrtDependencies": [
39
+ "@happyvertical/smrt-core",
40
+ "@happyvertical/smrt-prompts",
41
+ "@happyvertical/smrt-tenancy",
42
+ "@happyvertical/smrt-types",
43
+ "@happyvertical/smrt-ui",
44
+ "@happyvertical/smrt-vitest"
45
+ ],
46
+ "sdkDependencies": [
47
+ "@happyvertical/sql"
48
+ ],
49
+ "tags": [],
50
+ "risks": [],
51
+ "objects": [
52
+ {
53
+ "name": "AnalyticsDataStreamCollection",
54
+ "qualifiedName": "@happyvertical/smrt-analytics:AnalyticsDataStreamCollection",
55
+ "collection": "analyticsdatastreams",
56
+ "tableName": "analytics_data_stream_collections",
57
+ "packageName": "@happyvertical/smrt-analytics",
58
+ "extends": "SmrtCollection",
59
+ "fields": [],
60
+ "relationships": [],
61
+ "methods": [
62
+ "findActive",
63
+ "findActiveByProperty",
64
+ "findAndroidStreams",
65
+ "findByExternalId",
66
+ "findByMeasurementId",
67
+ "findByProperty",
68
+ "findByStatus",
69
+ "findByType",
70
+ "findIOSStreams",
71
+ "findMobileStreams",
72
+ "findWebStreams"
73
+ ],
74
+ "surfaces": [],
75
+ "relationshipFeatures": [
76
+ "uuidColumns"
77
+ ],
78
+ "tags": [],
79
+ "risks": []
80
+ },
81
+ {
82
+ "name": "AnalyticsEventCollection",
83
+ "qualifiedName": "@happyvertical/smrt-analytics:AnalyticsEventCollection",
84
+ "collection": "analyticsevents",
85
+ "tableName": "analytics_event_collections",
86
+ "packageName": "@happyvertical/smrt-analytics",
87
+ "extends": "SmrtCollection",
88
+ "fields": [],
89
+ "relationships": [],
90
+ "methods": [
91
+ "countByEventName",
92
+ "findByClientId",
93
+ "findByDateRange",
94
+ "findByEventName",
95
+ "findByProperty",
96
+ "findByStatus",
97
+ "findByUserId",
98
+ "findConversions",
99
+ "findFailed",
100
+ "findForRetry",
101
+ "findPageviews",
102
+ "findPending",
103
+ "findPendingByProperty",
104
+ "findSent",
105
+ "getBatchPropertyStats",
106
+ "getPropertyStats",
107
+ "getPropertyStatsWithTrend"
108
+ ],
109
+ "surfaces": [],
110
+ "relationshipFeatures": [
111
+ "uuidColumns"
112
+ ],
113
+ "tags": [],
114
+ "risks": []
115
+ },
116
+ {
117
+ "name": "AnalyticsPropertyCollection",
118
+ "qualifiedName": "@happyvertical/smrt-analytics:AnalyticsPropertyCollection",
119
+ "collection": "analyticsproperties",
120
+ "tableName": "analytics_property_collections",
121
+ "packageName": "@happyvertical/smrt-analytics",
122
+ "extends": "SmrtCollection",
123
+ "fields": [],
124
+ "relationships": [],
125
+ "methods": [
126
+ "findActive",
127
+ "findByExternalId",
128
+ "findByMeasurementId",
129
+ "findByProvider",
130
+ "findBySiteDomain",
131
+ "findByStatus",
132
+ "findGA4Properties",
133
+ "findMatomoSites",
134
+ "findNeedingSync",
135
+ "findPlausibleSites"
136
+ ],
137
+ "surfaces": [],
138
+ "relationshipFeatures": [
139
+ "uuidColumns"
140
+ ],
141
+ "tags": [],
142
+ "risks": []
143
+ },
144
+ {
145
+ "name": "AnalyticsReportCollection",
146
+ "qualifiedName": "@happyvertical/smrt-analytics:AnalyticsReportCollection",
147
+ "collection": "analyticsreports",
148
+ "tableName": "analytics_report_collections",
149
+ "packageName": "@happyvertical/smrt-analytics",
150
+ "extends": "SmrtCollection",
151
+ "fields": [],
152
+ "relationships": [],
153
+ "methods": [
154
+ "findByFrequency",
155
+ "findByProperty",
156
+ "findByPropertyAndStatus",
157
+ "findByStatus",
158
+ "findCompleted",
159
+ "findDrafts",
160
+ "findDue",
161
+ "findFailed",
162
+ "findRecentlyRun",
163
+ "findRecurring",
164
+ "findScheduled"
165
+ ],
166
+ "surfaces": [],
167
+ "relationshipFeatures": [
168
+ "uuidColumns"
169
+ ],
170
+ "tags": [],
171
+ "risks": []
172
+ },
173
+ {
174
+ "name": "AnalyticsDataStream",
175
+ "qualifiedName": "@happyvertical/smrt-analytics:AnalyticsDataStream",
176
+ "collection": "analyticsdatastreams",
177
+ "tableName": "analytics_data_streams",
178
+ "packageName": "@happyvertical/smrt-analytics",
179
+ "extends": "SmrtObject",
180
+ "fields": [
181
+ {
182
+ "name": "created_at",
183
+ "type": "datetime",
184
+ "required": false,
185
+ "columnType": "TIMESTAMP"
186
+ },
187
+ {
188
+ "name": "updated_at",
189
+ "type": "datetime",
190
+ "required": false,
191
+ "columnType": "TIMESTAMP"
192
+ },
193
+ {
194
+ "name": "tenantId",
195
+ "type": "text",
196
+ "required": false,
197
+ "columnType": "UUID"
198
+ },
199
+ {
200
+ "name": "propertyId",
201
+ "type": "foreignKey",
202
+ "required": false,
203
+ "related": "AnalyticsProperty",
204
+ "columnType": "UUID"
205
+ },
206
+ {
207
+ "name": "displayName",
208
+ "type": "text",
209
+ "required": false,
210
+ "columnType": "TEXT"
211
+ },
212
+ {
213
+ "name": "streamType",
214
+ "type": "text",
215
+ "required": false,
216
+ "columnType": "TEXT"
217
+ },
218
+ {
219
+ "name": "externalId",
220
+ "type": "text",
221
+ "required": false,
222
+ "columnType": "TEXT"
223
+ },
224
+ {
225
+ "name": "measurementId",
226
+ "type": "text",
227
+ "required": false,
228
+ "columnType": "TEXT"
229
+ },
230
+ {
231
+ "name": "firebaseAppId",
232
+ "type": "text",
233
+ "required": false,
234
+ "columnType": "TEXT"
235
+ },
236
+ {
237
+ "name": "defaultUri",
238
+ "type": "text",
239
+ "required": false,
240
+ "columnType": "TEXT"
241
+ },
242
+ {
243
+ "name": "bundleId",
244
+ "type": "text",
245
+ "required": false,
246
+ "columnType": "TEXT"
247
+ },
248
+ {
249
+ "name": "packageName",
250
+ "type": "text",
251
+ "required": false,
252
+ "columnType": "TEXT"
253
+ },
254
+ {
255
+ "name": "status",
256
+ "type": "text",
257
+ "required": false,
258
+ "columnType": "TEXT"
259
+ },
260
+ {
261
+ "name": "enhancedMeasurement",
262
+ "type": "boolean",
263
+ "required": false,
264
+ "columnType": "BOOLEAN"
265
+ }
266
+ ],
267
+ "relationships": [
268
+ {
269
+ "name": "propertyId",
270
+ "type": "foreignKey",
271
+ "required": false,
272
+ "related": "AnalyticsProperty",
273
+ "columnType": "UUID"
274
+ }
275
+ ],
276
+ "methods": [
277
+ "classifyConstraintError",
278
+ "clearEmbeddings",
279
+ "delete",
280
+ "describe",
281
+ "destroy",
282
+ "do",
283
+ "executeToolCall",
284
+ "forget",
285
+ "forgetScope",
286
+ "generateEmbeddings",
287
+ "getAiUsageSnapshot",
288
+ "getAvailableTools",
289
+ "getEmbedding",
290
+ "getFields",
291
+ "getId",
292
+ "getPlatformId",
293
+ "getRelated",
294
+ "getSavedId",
295
+ "getSlug",
296
+ "hasStaleEmbeddings",
297
+ "initialize",
298
+ "is",
299
+ "isAndroid",
300
+ "isIOS",
301
+ "isMobileApp",
302
+ "isRelatedLoaded",
303
+ "isSaved",
304
+ "isWeb",
305
+ "listAiUsage",
306
+ "loadDataFromDb",
307
+ "loadFromId",
308
+ "loadFromSlug",
309
+ "loadRelated",
310
+ "loadRelatedMany",
311
+ "markAsPersisted",
312
+ "recall",
313
+ "recallAll",
314
+ "remember",
315
+ "resetAiUsage",
316
+ "save",
317
+ "summarizeAiUsage",
318
+ "toJSON",
319
+ "toPlainObject",
320
+ "toPublicJSON"
321
+ ],
322
+ "surfaces": [
323
+ {
324
+ "kind": "api",
325
+ "name": "analyticsdatastreams.list",
326
+ "operation": "list",
327
+ "objectName": "@happyvertical/smrt-analytics:AnalyticsDataStream",
328
+ "path": "/analyticsdatastreams",
329
+ "method": "GET"
330
+ },
331
+ {
332
+ "kind": "api",
333
+ "name": "analyticsdatastreams.get",
334
+ "operation": "get",
335
+ "objectName": "@happyvertical/smrt-analytics:AnalyticsDataStream",
336
+ "path": "/analyticsdatastreams/[id]",
337
+ "method": "GET"
338
+ },
339
+ {
340
+ "kind": "api",
341
+ "name": "analyticsdatastreams.create",
342
+ "operation": "create",
343
+ "objectName": "@happyvertical/smrt-analytics:AnalyticsDataStream",
344
+ "path": "/analyticsdatastreams",
345
+ "method": "POST"
346
+ },
347
+ {
348
+ "kind": "api",
349
+ "name": "analyticsdatastreams.update",
350
+ "operation": "update",
351
+ "objectName": "@happyvertical/smrt-analytics:AnalyticsDataStream",
352
+ "path": "/analyticsdatastreams/[id]",
353
+ "method": "PATCH"
354
+ },
355
+ {
356
+ "kind": "cli",
357
+ "name": "analyticsdatastream_list",
358
+ "operation": "list",
359
+ "objectName": "@happyvertical/smrt-analytics:AnalyticsDataStream"
360
+ },
361
+ {
362
+ "kind": "cli",
363
+ "name": "analyticsdatastream_get",
364
+ "operation": "get",
365
+ "objectName": "@happyvertical/smrt-analytics:AnalyticsDataStream"
366
+ },
367
+ {
368
+ "kind": "cli",
369
+ "name": "analyticsdatastream_create",
370
+ "operation": "create",
371
+ "objectName": "@happyvertical/smrt-analytics:AnalyticsDataStream"
372
+ },
373
+ {
374
+ "kind": "cli",
375
+ "name": "analyticsdatastream_update",
376
+ "operation": "update",
377
+ "objectName": "@happyvertical/smrt-analytics:AnalyticsDataStream"
378
+ },
379
+ {
380
+ "kind": "cli",
381
+ "name": "analyticsdatastream_delete",
382
+ "operation": "delete",
383
+ "objectName": "@happyvertical/smrt-analytics:AnalyticsDataStream"
384
+ },
385
+ {
386
+ "kind": "mcp",
387
+ "name": "analyticsdatastream_list",
388
+ "operation": "list",
389
+ "objectName": "@happyvertical/smrt-analytics:AnalyticsDataStream"
390
+ },
391
+ {
392
+ "kind": "mcp",
393
+ "name": "analyticsdatastream_get",
394
+ "operation": "get",
395
+ "objectName": "@happyvertical/smrt-analytics:AnalyticsDataStream"
396
+ }
397
+ ],
398
+ "relationshipFeatures": [
399
+ "foreignKey",
400
+ "uuidColumns"
401
+ ],
402
+ "tags": [],
403
+ "risks": []
404
+ },
405
+ {
406
+ "name": "AnalyticsEvent",
407
+ "qualifiedName": "@happyvertical/smrt-analytics:AnalyticsEvent",
408
+ "collection": "analyticsevents",
409
+ "tableName": "analytics_events",
410
+ "packageName": "@happyvertical/smrt-analytics",
411
+ "extends": "SmrtObject",
412
+ "fields": [
413
+ {
414
+ "name": "created_at",
415
+ "type": "datetime",
416
+ "required": false,
417
+ "columnType": "TIMESTAMP"
418
+ },
419
+ {
420
+ "name": "updated_at",
421
+ "type": "datetime",
422
+ "required": false,
423
+ "columnType": "TIMESTAMP"
424
+ },
425
+ {
426
+ "name": "tenantId",
427
+ "type": "text",
428
+ "required": false,
429
+ "columnType": "UUID"
430
+ },
431
+ {
432
+ "name": "propertyId",
433
+ "type": "foreignKey",
434
+ "required": false,
435
+ "related": "AnalyticsProperty",
436
+ "columnType": "UUID"
437
+ },
438
+ {
439
+ "name": "eventName",
440
+ "type": "text",
441
+ "required": false,
442
+ "columnType": "TEXT"
443
+ },
444
+ {
445
+ "name": "clientId",
446
+ "type": "text",
447
+ "required": false,
448
+ "columnType": "TEXT"
449
+ },
450
+ {
451
+ "name": "userId",
452
+ "type": "text",
453
+ "required": false,
454
+ "columnType": "TEXT"
455
+ },
456
+ {
457
+ "name": "params",
458
+ "type": "text",
459
+ "required": false,
460
+ "columnType": "TEXT"
461
+ },
462
+ {
463
+ "name": "eventTimestamp",
464
+ "type": "datetime",
465
+ "required": false,
466
+ "columnType": "TIMESTAMP"
467
+ },
468
+ {
469
+ "name": "status",
470
+ "type": "text",
471
+ "required": false,
472
+ "columnType": "TEXT"
473
+ },
474
+ {
475
+ "name": "sentAt",
476
+ "type": "datetime",
477
+ "required": false,
478
+ "columnType": "TIMESTAMP"
479
+ },
480
+ {
481
+ "name": "errorMessage",
482
+ "type": "text",
483
+ "required": false,
484
+ "columnType": "TEXT"
485
+ },
486
+ {
487
+ "name": "retryCount",
488
+ "type": "integer",
489
+ "required": false,
490
+ "columnType": "INTEGER"
491
+ },
492
+ {
493
+ "name": "nonPersonalizedAds",
494
+ "type": "boolean",
495
+ "required": false,
496
+ "columnType": "BOOLEAN"
497
+ },
498
+ {
499
+ "name": "sessionId",
500
+ "type": "text",
501
+ "required": false,
502
+ "columnType": "TEXT"
503
+ },
504
+ {
505
+ "name": "pagePath",
506
+ "type": "text",
507
+ "required": false,
508
+ "columnType": "TEXT"
509
+ },
510
+ {
511
+ "name": "pageTitle",
512
+ "type": "text",
513
+ "required": false,
514
+ "columnType": "TEXT"
515
+ },
516
+ {
517
+ "name": "userAgent",
518
+ "type": "text",
519
+ "required": false,
520
+ "columnType": "TEXT"
521
+ },
522
+ {
523
+ "name": "ipAddress",
524
+ "type": "text",
525
+ "required": false,
526
+ "columnType": "TEXT"
527
+ }
528
+ ],
529
+ "relationships": [
530
+ {
531
+ "name": "propertyId",
532
+ "type": "foreignKey",
533
+ "required": false,
534
+ "related": "AnalyticsProperty",
535
+ "columnType": "UUID"
536
+ }
537
+ ],
538
+ "methods": [
539
+ "addParam",
540
+ "classifyConstraintError",
541
+ "clearEmbeddings",
542
+ "delete",
543
+ "describe",
544
+ "destroy",
545
+ "do",
546
+ "executeToolCall",
547
+ "forget",
548
+ "forgetScope",
549
+ "generateEmbeddings",
550
+ "getAiUsageSnapshot",
551
+ "getAvailableTools",
552
+ "getEmbedding",
553
+ "getFields",
554
+ "getId",
555
+ "getParams",
556
+ "getRelated",
557
+ "getSavedId",
558
+ "getSlug",
559
+ "hasStaleEmbeddings",
560
+ "initialize",
561
+ "is",
562
+ "isConversion",
563
+ "isPageview",
564
+ "isRelatedLoaded",
565
+ "isSaved",
566
+ "listAiUsage",
567
+ "loadDataFromDb",
568
+ "loadFromId",
569
+ "loadFromSlug",
570
+ "loadRelated",
571
+ "loadRelatedMany",
572
+ "markAsPersisted",
573
+ "markFailed",
574
+ "markSent",
575
+ "recall",
576
+ "recallAll",
577
+ "remember",
578
+ "resetAiUsage",
579
+ "resetForRetry",
580
+ "save",
581
+ "setParams",
582
+ "shouldRetry",
583
+ "summarizeAiUsage",
584
+ "toJSON",
585
+ "toPlainObject",
586
+ "toPublicJSON",
587
+ "toTrackEvent"
588
+ ],
589
+ "surfaces": [
590
+ {
591
+ "kind": "api",
592
+ "name": "analyticsevents.list",
593
+ "operation": "list",
594
+ "objectName": "@happyvertical/smrt-analytics:AnalyticsEvent",
595
+ "path": "/analyticsevents",
596
+ "method": "GET"
597
+ },
598
+ {
599
+ "kind": "api",
600
+ "name": "analyticsevents.get",
601
+ "operation": "get",
602
+ "objectName": "@happyvertical/smrt-analytics:AnalyticsEvent",
603
+ "path": "/analyticsevents/[id]",
604
+ "method": "GET"
605
+ },
606
+ {
607
+ "kind": "api",
608
+ "name": "analyticsevents.create",
609
+ "operation": "create",
610
+ "objectName": "@happyvertical/smrt-analytics:AnalyticsEvent",
611
+ "path": "/analyticsevents",
612
+ "method": "POST"
613
+ },
614
+ {
615
+ "kind": "cli",
616
+ "name": "analyticsevent_list",
617
+ "operation": "list",
618
+ "objectName": "@happyvertical/smrt-analytics:AnalyticsEvent"
619
+ },
620
+ {
621
+ "kind": "cli",
622
+ "name": "analyticsevent_get",
623
+ "operation": "get",
624
+ "objectName": "@happyvertical/smrt-analytics:AnalyticsEvent"
625
+ },
626
+ {
627
+ "kind": "cli",
628
+ "name": "analyticsevent_create",
629
+ "operation": "create",
630
+ "objectName": "@happyvertical/smrt-analytics:AnalyticsEvent"
631
+ },
632
+ {
633
+ "kind": "cli",
634
+ "name": "analyticsevent_update",
635
+ "operation": "update",
636
+ "objectName": "@happyvertical/smrt-analytics:AnalyticsEvent"
637
+ },
638
+ {
639
+ "kind": "cli",
640
+ "name": "analyticsevent_delete",
641
+ "operation": "delete",
642
+ "objectName": "@happyvertical/smrt-analytics:AnalyticsEvent"
643
+ },
644
+ {
645
+ "kind": "mcp",
646
+ "name": "analyticsevent_list",
647
+ "operation": "list",
648
+ "objectName": "@happyvertical/smrt-analytics:AnalyticsEvent"
649
+ },
650
+ {
651
+ "kind": "mcp",
652
+ "name": "analyticsevent_get",
653
+ "operation": "get",
654
+ "objectName": "@happyvertical/smrt-analytics:AnalyticsEvent"
655
+ },
656
+ {
657
+ "kind": "mcp",
658
+ "name": "analyticsevent_track",
659
+ "operation": "track",
660
+ "objectName": "@happyvertical/smrt-analytics:AnalyticsEvent"
661
+ }
662
+ ],
663
+ "relationshipFeatures": [
664
+ "foreignKey",
665
+ "uuidColumns"
666
+ ],
667
+ "tags": [],
668
+ "risks": []
669
+ },
670
+ {
671
+ "name": "AnalyticsProperty",
672
+ "qualifiedName": "@happyvertical/smrt-analytics:AnalyticsProperty",
673
+ "collection": "analyticsproperties",
674
+ "tableName": "analytics_properties",
675
+ "packageName": "@happyvertical/smrt-analytics",
676
+ "extends": "SmrtObject",
677
+ "fields": [
678
+ {
679
+ "name": "created_at",
680
+ "type": "datetime",
681
+ "required": false,
682
+ "columnType": "TIMESTAMP"
683
+ },
684
+ {
685
+ "name": "updated_at",
686
+ "type": "datetime",
687
+ "required": false,
688
+ "columnType": "TIMESTAMP"
689
+ },
690
+ {
691
+ "name": "tenantId",
692
+ "type": "text",
693
+ "required": false,
694
+ "columnType": "UUID"
695
+ },
696
+ {
697
+ "name": "name",
698
+ "type": "text",
699
+ "required": false,
700
+ "columnType": "TEXT"
701
+ },
702
+ {
703
+ "name": "displayName",
704
+ "type": "text",
705
+ "required": false,
706
+ "columnType": "TEXT"
707
+ },
708
+ {
709
+ "name": "provider",
710
+ "type": "text",
711
+ "required": false,
712
+ "columnType": "TEXT"
713
+ },
714
+ {
715
+ "name": "externalId",
716
+ "type": "text",
717
+ "required": false,
718
+ "columnType": "TEXT"
719
+ },
720
+ {
721
+ "name": "measurementId",
722
+ "type": "text",
723
+ "required": false,
724
+ "columnType": "TEXT"
725
+ },
726
+ {
727
+ "name": "apiSecret",
728
+ "type": "text",
729
+ "required": false,
730
+ "columnType": "TEXT"
731
+ },
732
+ {
733
+ "name": "siteDomain",
734
+ "type": "text",
735
+ "required": false,
736
+ "columnType": "TEXT"
737
+ },
738
+ {
739
+ "name": "timeZone",
740
+ "type": "text",
741
+ "required": false,
742
+ "columnType": "TEXT"
743
+ },
744
+ {
745
+ "name": "currencyCode",
746
+ "type": "text",
747
+ "required": false,
748
+ "columnType": "TEXT"
749
+ },
750
+ {
751
+ "name": "industryCategory",
752
+ "type": "text",
753
+ "required": false,
754
+ "columnType": "TEXT"
755
+ },
756
+ {
757
+ "name": "serviceLevel",
758
+ "type": "text",
759
+ "required": false,
760
+ "columnType": "TEXT"
761
+ },
762
+ {
763
+ "name": "status",
764
+ "type": "text",
765
+ "required": false,
766
+ "columnType": "TEXT"
767
+ },
768
+ {
769
+ "name": "lastSyncAt",
770
+ "type": "datetime",
771
+ "required": false,
772
+ "columnType": "TIMESTAMP"
773
+ },
774
+ {
775
+ "name": "providerMetadata",
776
+ "type": "text",
777
+ "required": false,
778
+ "columnType": "TEXT"
779
+ }
780
+ ],
781
+ "relationships": [],
782
+ "methods": [
783
+ "analyzePerformance",
784
+ "classifyConstraintError",
785
+ "clearEmbeddings",
786
+ "delete",
787
+ "describe",
788
+ "destroy",
789
+ "do",
790
+ "executeToolCall",
791
+ "forget",
792
+ "forgetScope",
793
+ "generateEmbeddings",
794
+ "getAiUsageSnapshot",
795
+ "getAvailableTools",
796
+ "getEmbedding",
797
+ "getFields",
798
+ "getId",
799
+ "getProviderMetadata",
800
+ "getRelated",
801
+ "getSavedId",
802
+ "getSlug",
803
+ "hasStaleEmbeddings",
804
+ "initialize",
805
+ "is",
806
+ "isGA4",
807
+ "isMatomo",
808
+ "isPerformingWell",
809
+ "isPlausible",
810
+ "isRelatedLoaded",
811
+ "isSaved",
812
+ "listAiUsage",
813
+ "loadDataFromDb",
814
+ "loadFromId",
815
+ "loadFromSlug",
816
+ "loadRelated",
817
+ "loadRelatedMany",
818
+ "markAsPersisted",
819
+ "markSynced",
820
+ "recall",
821
+ "recallAll",
822
+ "remember",
823
+ "resetAiUsage",
824
+ "save",
825
+ "setProviderMetadata",
826
+ "summarizeAiUsage",
827
+ "toJSON",
828
+ "toPlainObject",
829
+ "toPublicJSON"
830
+ ],
831
+ "surfaces": [
832
+ {
833
+ "kind": "api",
834
+ "name": "analyticsproperties.list",
835
+ "operation": "list",
836
+ "objectName": "@happyvertical/smrt-analytics:AnalyticsProperty",
837
+ "path": "/analyticsproperties",
838
+ "method": "GET"
839
+ },
840
+ {
841
+ "kind": "api",
842
+ "name": "analyticsproperties.get",
843
+ "operation": "get",
844
+ "objectName": "@happyvertical/smrt-analytics:AnalyticsProperty",
845
+ "path": "/analyticsproperties/[id]",
846
+ "method": "GET"
847
+ },
848
+ {
849
+ "kind": "api",
850
+ "name": "analyticsproperties.create",
851
+ "operation": "create",
852
+ "objectName": "@happyvertical/smrt-analytics:AnalyticsProperty",
853
+ "path": "/analyticsproperties",
854
+ "method": "POST"
855
+ },
856
+ {
857
+ "kind": "api",
858
+ "name": "analyticsproperties.update",
859
+ "operation": "update",
860
+ "objectName": "@happyvertical/smrt-analytics:AnalyticsProperty",
861
+ "path": "/analyticsproperties/[id]",
862
+ "method": "PATCH"
863
+ },
864
+ {
865
+ "kind": "cli",
866
+ "name": "analyticsproperty_list",
867
+ "operation": "list",
868
+ "objectName": "@happyvertical/smrt-analytics:AnalyticsProperty"
869
+ },
870
+ {
871
+ "kind": "cli",
872
+ "name": "analyticsproperty_get",
873
+ "operation": "get",
874
+ "objectName": "@happyvertical/smrt-analytics:AnalyticsProperty"
875
+ },
876
+ {
877
+ "kind": "cli",
878
+ "name": "analyticsproperty_create",
879
+ "operation": "create",
880
+ "objectName": "@happyvertical/smrt-analytics:AnalyticsProperty"
881
+ },
882
+ {
883
+ "kind": "cli",
884
+ "name": "analyticsproperty_update",
885
+ "operation": "update",
886
+ "objectName": "@happyvertical/smrt-analytics:AnalyticsProperty"
887
+ },
888
+ {
889
+ "kind": "cli",
890
+ "name": "analyticsproperty_delete",
891
+ "operation": "delete",
892
+ "objectName": "@happyvertical/smrt-analytics:AnalyticsProperty"
893
+ },
894
+ {
895
+ "kind": "mcp",
896
+ "name": "analyticsproperty_list",
897
+ "operation": "list",
898
+ "objectName": "@happyvertical/smrt-analytics:AnalyticsProperty"
899
+ },
900
+ {
901
+ "kind": "mcp",
902
+ "name": "analyticsproperty_get",
903
+ "operation": "get",
904
+ "objectName": "@happyvertical/smrt-analytics:AnalyticsProperty"
905
+ },
906
+ {
907
+ "kind": "mcp",
908
+ "name": "analyticsproperty_sync",
909
+ "operation": "sync",
910
+ "objectName": "@happyvertical/smrt-analytics:AnalyticsProperty"
911
+ },
912
+ {
913
+ "kind": "mcp",
914
+ "name": "analyticsproperty_runReport",
915
+ "operation": "runReport",
916
+ "objectName": "@happyvertical/smrt-analytics:AnalyticsProperty"
917
+ }
918
+ ],
919
+ "relationshipFeatures": [
920
+ "uuidColumns"
921
+ ],
922
+ "tags": [],
923
+ "risks": []
924
+ },
925
+ {
926
+ "name": "AnalyticsReport",
927
+ "qualifiedName": "@happyvertical/smrt-analytics:AnalyticsReport",
928
+ "collection": "analyticsreports",
929
+ "tableName": "analytics_reports",
930
+ "packageName": "@happyvertical/smrt-analytics",
931
+ "extends": "SmrtObject",
932
+ "fields": [
933
+ {
934
+ "name": "created_at",
935
+ "type": "datetime",
936
+ "required": false,
937
+ "columnType": "TIMESTAMP"
938
+ },
939
+ {
940
+ "name": "updated_at",
941
+ "type": "datetime",
942
+ "required": false,
943
+ "columnType": "TIMESTAMP"
944
+ },
945
+ {
946
+ "name": "tenantId",
947
+ "type": "text",
948
+ "required": false,
949
+ "columnType": "UUID"
950
+ },
951
+ {
952
+ "name": "propertyId",
953
+ "type": "foreignKey",
954
+ "required": false,
955
+ "related": "AnalyticsProperty",
956
+ "columnType": "UUID"
957
+ },
958
+ {
959
+ "name": "name",
960
+ "type": "text",
961
+ "required": false,
962
+ "columnType": "TEXT"
963
+ },
964
+ {
965
+ "name": "description",
966
+ "type": "text",
967
+ "required": false,
968
+ "columnType": "TEXT"
969
+ },
970
+ {
971
+ "name": "dimensions",
972
+ "type": "text",
973
+ "required": false,
974
+ "columnType": "TEXT"
975
+ },
976
+ {
977
+ "name": "metrics",
978
+ "type": "text",
979
+ "required": false,
980
+ "columnType": "TEXT"
981
+ },
982
+ {
983
+ "name": "dateRangeStart",
984
+ "type": "text",
985
+ "required": false,
986
+ "columnType": "TEXT"
987
+ },
988
+ {
989
+ "name": "dateRangeEnd",
990
+ "type": "text",
991
+ "required": false,
992
+ "columnType": "TEXT"
993
+ },
994
+ {
995
+ "name": "dimensionFilter",
996
+ "type": "text",
997
+ "required": false,
998
+ "columnType": "TEXT"
999
+ },
1000
+ {
1001
+ "name": "metricFilter",
1002
+ "type": "text",
1003
+ "required": false,
1004
+ "columnType": "TEXT"
1005
+ },
1006
+ {
1007
+ "name": "orderBy",
1008
+ "type": "text",
1009
+ "required": false,
1010
+ "columnType": "TEXT"
1011
+ },
1012
+ {
1013
+ "name": "maxResults",
1014
+ "type": "integer",
1015
+ "required": false,
1016
+ "columnType": "INTEGER"
1017
+ },
1018
+ {
1019
+ "name": "status",
1020
+ "type": "text",
1021
+ "required": false,
1022
+ "columnType": "TEXT"
1023
+ },
1024
+ {
1025
+ "name": "frequency",
1026
+ "type": "text",
1027
+ "required": false,
1028
+ "columnType": "TEXT"
1029
+ },
1030
+ {
1031
+ "name": "lastRunAt",
1032
+ "type": "datetime",
1033
+ "required": false,
1034
+ "columnType": "TIMESTAMP"
1035
+ },
1036
+ {
1037
+ "name": "nextRunAt",
1038
+ "type": "datetime",
1039
+ "required": false,
1040
+ "columnType": "TIMESTAMP"
1041
+ },
1042
+ {
1043
+ "name": "resultData",
1044
+ "type": "text",
1045
+ "required": false,
1046
+ "columnType": "TEXT"
1047
+ },
1048
+ {
1049
+ "name": "rowCount",
1050
+ "type": "integer",
1051
+ "required": false,
1052
+ "columnType": "INTEGER"
1053
+ },
1054
+ {
1055
+ "name": "lastError",
1056
+ "type": "text",
1057
+ "required": false,
1058
+ "columnType": "TEXT"
1059
+ }
1060
+ ],
1061
+ "relationships": [
1062
+ {
1063
+ "name": "propertyId",
1064
+ "type": "foreignKey",
1065
+ "required": false,
1066
+ "related": "AnalyticsProperty",
1067
+ "columnType": "UUID"
1068
+ }
1069
+ ],
1070
+ "methods": [
1071
+ "analyzeResults",
1072
+ "calculateNextRun",
1073
+ "classifyConstraintError",
1074
+ "clearEmbeddings",
1075
+ "delete",
1076
+ "describe",
1077
+ "destroy",
1078
+ "do",
1079
+ "executeToolCall",
1080
+ "forget",
1081
+ "forgetScope",
1082
+ "generateEmbeddings",
1083
+ "getAiUsageSnapshot",
1084
+ "getAvailableTools",
1085
+ "getDimensions",
1086
+ "getEmbedding",
1087
+ "getFields",
1088
+ "getId",
1089
+ "getMetrics",
1090
+ "getRelated",
1091
+ "getResultData",
1092
+ "getSavedId",
1093
+ "getSlug",
1094
+ "hasPositiveTrends",
1095
+ "hasStaleEmbeddings",
1096
+ "initialize",
1097
+ "is",
1098
+ "isDue",
1099
+ "isRelatedLoaded",
1100
+ "isSaved",
1101
+ "listAiUsage",
1102
+ "loadDataFromDb",
1103
+ "loadFromId",
1104
+ "loadFromSlug",
1105
+ "loadRelated",
1106
+ "loadRelatedMany",
1107
+ "markAsPersisted",
1108
+ "markCompleted",
1109
+ "markFailed",
1110
+ "markRunning",
1111
+ "recall",
1112
+ "recallAll",
1113
+ "remember",
1114
+ "resetAiUsage",
1115
+ "save",
1116
+ "setDimensions",
1117
+ "setMetrics",
1118
+ "setResultData",
1119
+ "summarizeAiUsage",
1120
+ "toJSON",
1121
+ "toPlainObject",
1122
+ "toPublicJSON"
1123
+ ],
1124
+ "surfaces": [
1125
+ {
1126
+ "kind": "api",
1127
+ "name": "analyticsreports.list",
1128
+ "operation": "list",
1129
+ "objectName": "@happyvertical/smrt-analytics:AnalyticsReport",
1130
+ "path": "/analyticsreports",
1131
+ "method": "GET"
1132
+ },
1133
+ {
1134
+ "kind": "api",
1135
+ "name": "analyticsreports.get",
1136
+ "operation": "get",
1137
+ "objectName": "@happyvertical/smrt-analytics:AnalyticsReport",
1138
+ "path": "/analyticsreports/[id]",
1139
+ "method": "GET"
1140
+ },
1141
+ {
1142
+ "kind": "api",
1143
+ "name": "analyticsreports.create",
1144
+ "operation": "create",
1145
+ "objectName": "@happyvertical/smrt-analytics:AnalyticsReport",
1146
+ "path": "/analyticsreports",
1147
+ "method": "POST"
1148
+ },
1149
+ {
1150
+ "kind": "api",
1151
+ "name": "analyticsreports.update",
1152
+ "operation": "update",
1153
+ "objectName": "@happyvertical/smrt-analytics:AnalyticsReport",
1154
+ "path": "/analyticsreports/[id]",
1155
+ "method": "PATCH"
1156
+ },
1157
+ {
1158
+ "kind": "api",
1159
+ "name": "analyticsreports.run",
1160
+ "operation": "run",
1161
+ "objectName": "@happyvertical/smrt-analytics:AnalyticsReport",
1162
+ "path": "/analyticsreports/run",
1163
+ "method": "POST"
1164
+ },
1165
+ {
1166
+ "kind": "cli",
1167
+ "name": "analyticsreport_list",
1168
+ "operation": "list",
1169
+ "objectName": "@happyvertical/smrt-analytics:AnalyticsReport"
1170
+ },
1171
+ {
1172
+ "kind": "cli",
1173
+ "name": "analyticsreport_get",
1174
+ "operation": "get",
1175
+ "objectName": "@happyvertical/smrt-analytics:AnalyticsReport"
1176
+ },
1177
+ {
1178
+ "kind": "cli",
1179
+ "name": "analyticsreport_create",
1180
+ "operation": "create",
1181
+ "objectName": "@happyvertical/smrt-analytics:AnalyticsReport"
1182
+ },
1183
+ {
1184
+ "kind": "cli",
1185
+ "name": "analyticsreport_update",
1186
+ "operation": "update",
1187
+ "objectName": "@happyvertical/smrt-analytics:AnalyticsReport"
1188
+ },
1189
+ {
1190
+ "kind": "cli",
1191
+ "name": "analyticsreport_delete",
1192
+ "operation": "delete",
1193
+ "objectName": "@happyvertical/smrt-analytics:AnalyticsReport"
1194
+ },
1195
+ {
1196
+ "kind": "mcp",
1197
+ "name": "analyticsreport_list",
1198
+ "operation": "list",
1199
+ "objectName": "@happyvertical/smrt-analytics:AnalyticsReport"
1200
+ },
1201
+ {
1202
+ "kind": "mcp",
1203
+ "name": "analyticsreport_get",
1204
+ "operation": "get",
1205
+ "objectName": "@happyvertical/smrt-analytics:AnalyticsReport"
1206
+ },
1207
+ {
1208
+ "kind": "mcp",
1209
+ "name": "analyticsreport_run",
1210
+ "operation": "run",
1211
+ "objectName": "@happyvertical/smrt-analytics:AnalyticsReport"
1212
+ },
1213
+ {
1214
+ "kind": "mcp",
1215
+ "name": "analyticsreport_analyze",
1216
+ "operation": "analyze",
1217
+ "objectName": "@happyvertical/smrt-analytics:AnalyticsReport"
1218
+ }
1219
+ ],
1220
+ "relationshipFeatures": [
1221
+ "foreignKey",
1222
+ "uuidColumns"
1223
+ ],
1224
+ "tags": [],
1225
+ "risks": []
1226
+ }
1227
+ ],
1228
+ "surfaces": [
1229
+ {
1230
+ "kind": "api",
1231
+ "name": "analyticsdatastreams.list",
1232
+ "operation": "list",
1233
+ "objectName": "@happyvertical/smrt-analytics:AnalyticsDataStream",
1234
+ "path": "/analyticsdatastreams",
1235
+ "method": "GET"
1236
+ },
1237
+ {
1238
+ "kind": "api",
1239
+ "name": "analyticsdatastreams.get",
1240
+ "operation": "get",
1241
+ "objectName": "@happyvertical/smrt-analytics:AnalyticsDataStream",
1242
+ "path": "/analyticsdatastreams/[id]",
1243
+ "method": "GET"
1244
+ },
1245
+ {
1246
+ "kind": "api",
1247
+ "name": "analyticsdatastreams.create",
1248
+ "operation": "create",
1249
+ "objectName": "@happyvertical/smrt-analytics:AnalyticsDataStream",
1250
+ "path": "/analyticsdatastreams",
1251
+ "method": "POST"
1252
+ },
1253
+ {
1254
+ "kind": "api",
1255
+ "name": "analyticsdatastreams.update",
1256
+ "operation": "update",
1257
+ "objectName": "@happyvertical/smrt-analytics:AnalyticsDataStream",
1258
+ "path": "/analyticsdatastreams/[id]",
1259
+ "method": "PATCH"
1260
+ },
1261
+ {
1262
+ "kind": "cli",
1263
+ "name": "analyticsdatastream_list",
1264
+ "operation": "list",
1265
+ "objectName": "@happyvertical/smrt-analytics:AnalyticsDataStream"
1266
+ },
1267
+ {
1268
+ "kind": "cli",
1269
+ "name": "analyticsdatastream_get",
1270
+ "operation": "get",
1271
+ "objectName": "@happyvertical/smrt-analytics:AnalyticsDataStream"
1272
+ },
1273
+ {
1274
+ "kind": "cli",
1275
+ "name": "analyticsdatastream_create",
1276
+ "operation": "create",
1277
+ "objectName": "@happyvertical/smrt-analytics:AnalyticsDataStream"
1278
+ },
1279
+ {
1280
+ "kind": "cli",
1281
+ "name": "analyticsdatastream_update",
1282
+ "operation": "update",
1283
+ "objectName": "@happyvertical/smrt-analytics:AnalyticsDataStream"
1284
+ },
1285
+ {
1286
+ "kind": "cli",
1287
+ "name": "analyticsdatastream_delete",
1288
+ "operation": "delete",
1289
+ "objectName": "@happyvertical/smrt-analytics:AnalyticsDataStream"
1290
+ },
1291
+ {
1292
+ "kind": "mcp",
1293
+ "name": "analyticsdatastream_list",
1294
+ "operation": "list",
1295
+ "objectName": "@happyvertical/smrt-analytics:AnalyticsDataStream"
1296
+ },
1297
+ {
1298
+ "kind": "mcp",
1299
+ "name": "analyticsdatastream_get",
1300
+ "operation": "get",
1301
+ "objectName": "@happyvertical/smrt-analytics:AnalyticsDataStream"
1302
+ },
1303
+ {
1304
+ "kind": "api",
1305
+ "name": "analyticsevents.list",
1306
+ "operation": "list",
1307
+ "objectName": "@happyvertical/smrt-analytics:AnalyticsEvent",
1308
+ "path": "/analyticsevents",
1309
+ "method": "GET"
1310
+ },
1311
+ {
1312
+ "kind": "api",
1313
+ "name": "analyticsevents.get",
1314
+ "operation": "get",
1315
+ "objectName": "@happyvertical/smrt-analytics:AnalyticsEvent",
1316
+ "path": "/analyticsevents/[id]",
1317
+ "method": "GET"
1318
+ },
1319
+ {
1320
+ "kind": "api",
1321
+ "name": "analyticsevents.create",
1322
+ "operation": "create",
1323
+ "objectName": "@happyvertical/smrt-analytics:AnalyticsEvent",
1324
+ "path": "/analyticsevents",
1325
+ "method": "POST"
1326
+ },
1327
+ {
1328
+ "kind": "cli",
1329
+ "name": "analyticsevent_list",
1330
+ "operation": "list",
1331
+ "objectName": "@happyvertical/smrt-analytics:AnalyticsEvent"
1332
+ },
1333
+ {
1334
+ "kind": "cli",
1335
+ "name": "analyticsevent_get",
1336
+ "operation": "get",
1337
+ "objectName": "@happyvertical/smrt-analytics:AnalyticsEvent"
1338
+ },
1339
+ {
1340
+ "kind": "cli",
1341
+ "name": "analyticsevent_create",
1342
+ "operation": "create",
1343
+ "objectName": "@happyvertical/smrt-analytics:AnalyticsEvent"
1344
+ },
1345
+ {
1346
+ "kind": "cli",
1347
+ "name": "analyticsevent_update",
1348
+ "operation": "update",
1349
+ "objectName": "@happyvertical/smrt-analytics:AnalyticsEvent"
1350
+ },
1351
+ {
1352
+ "kind": "cli",
1353
+ "name": "analyticsevent_delete",
1354
+ "operation": "delete",
1355
+ "objectName": "@happyvertical/smrt-analytics:AnalyticsEvent"
1356
+ },
1357
+ {
1358
+ "kind": "mcp",
1359
+ "name": "analyticsevent_list",
1360
+ "operation": "list",
1361
+ "objectName": "@happyvertical/smrt-analytics:AnalyticsEvent"
1362
+ },
1363
+ {
1364
+ "kind": "mcp",
1365
+ "name": "analyticsevent_get",
1366
+ "operation": "get",
1367
+ "objectName": "@happyvertical/smrt-analytics:AnalyticsEvent"
1368
+ },
1369
+ {
1370
+ "kind": "mcp",
1371
+ "name": "analyticsevent_track",
1372
+ "operation": "track",
1373
+ "objectName": "@happyvertical/smrt-analytics:AnalyticsEvent"
1374
+ },
1375
+ {
1376
+ "kind": "api",
1377
+ "name": "analyticsproperties.list",
1378
+ "operation": "list",
1379
+ "objectName": "@happyvertical/smrt-analytics:AnalyticsProperty",
1380
+ "path": "/analyticsproperties",
1381
+ "method": "GET"
1382
+ },
1383
+ {
1384
+ "kind": "api",
1385
+ "name": "analyticsproperties.get",
1386
+ "operation": "get",
1387
+ "objectName": "@happyvertical/smrt-analytics:AnalyticsProperty",
1388
+ "path": "/analyticsproperties/[id]",
1389
+ "method": "GET"
1390
+ },
1391
+ {
1392
+ "kind": "api",
1393
+ "name": "analyticsproperties.create",
1394
+ "operation": "create",
1395
+ "objectName": "@happyvertical/smrt-analytics:AnalyticsProperty",
1396
+ "path": "/analyticsproperties",
1397
+ "method": "POST"
1398
+ },
1399
+ {
1400
+ "kind": "api",
1401
+ "name": "analyticsproperties.update",
1402
+ "operation": "update",
1403
+ "objectName": "@happyvertical/smrt-analytics:AnalyticsProperty",
1404
+ "path": "/analyticsproperties/[id]",
1405
+ "method": "PATCH"
1406
+ },
1407
+ {
1408
+ "kind": "cli",
1409
+ "name": "analyticsproperty_list",
1410
+ "operation": "list",
1411
+ "objectName": "@happyvertical/smrt-analytics:AnalyticsProperty"
1412
+ },
1413
+ {
1414
+ "kind": "cli",
1415
+ "name": "analyticsproperty_get",
1416
+ "operation": "get",
1417
+ "objectName": "@happyvertical/smrt-analytics:AnalyticsProperty"
1418
+ },
1419
+ {
1420
+ "kind": "cli",
1421
+ "name": "analyticsproperty_create",
1422
+ "operation": "create",
1423
+ "objectName": "@happyvertical/smrt-analytics:AnalyticsProperty"
1424
+ },
1425
+ {
1426
+ "kind": "cli",
1427
+ "name": "analyticsproperty_update",
1428
+ "operation": "update",
1429
+ "objectName": "@happyvertical/smrt-analytics:AnalyticsProperty"
1430
+ },
1431
+ {
1432
+ "kind": "cli",
1433
+ "name": "analyticsproperty_delete",
1434
+ "operation": "delete",
1435
+ "objectName": "@happyvertical/smrt-analytics:AnalyticsProperty"
1436
+ },
1437
+ {
1438
+ "kind": "mcp",
1439
+ "name": "analyticsproperty_list",
1440
+ "operation": "list",
1441
+ "objectName": "@happyvertical/smrt-analytics:AnalyticsProperty"
1442
+ },
1443
+ {
1444
+ "kind": "mcp",
1445
+ "name": "analyticsproperty_get",
1446
+ "operation": "get",
1447
+ "objectName": "@happyvertical/smrt-analytics:AnalyticsProperty"
1448
+ },
1449
+ {
1450
+ "kind": "mcp",
1451
+ "name": "analyticsproperty_sync",
1452
+ "operation": "sync",
1453
+ "objectName": "@happyvertical/smrt-analytics:AnalyticsProperty"
1454
+ },
1455
+ {
1456
+ "kind": "mcp",
1457
+ "name": "analyticsproperty_runReport",
1458
+ "operation": "runReport",
1459
+ "objectName": "@happyvertical/smrt-analytics:AnalyticsProperty"
1460
+ },
1461
+ {
1462
+ "kind": "api",
1463
+ "name": "analyticsreports.list",
1464
+ "operation": "list",
1465
+ "objectName": "@happyvertical/smrt-analytics:AnalyticsReport",
1466
+ "path": "/analyticsreports",
1467
+ "method": "GET"
1468
+ },
1469
+ {
1470
+ "kind": "api",
1471
+ "name": "analyticsreports.get",
1472
+ "operation": "get",
1473
+ "objectName": "@happyvertical/smrt-analytics:AnalyticsReport",
1474
+ "path": "/analyticsreports/[id]",
1475
+ "method": "GET"
1476
+ },
1477
+ {
1478
+ "kind": "api",
1479
+ "name": "analyticsreports.create",
1480
+ "operation": "create",
1481
+ "objectName": "@happyvertical/smrt-analytics:AnalyticsReport",
1482
+ "path": "/analyticsreports",
1483
+ "method": "POST"
1484
+ },
1485
+ {
1486
+ "kind": "api",
1487
+ "name": "analyticsreports.update",
1488
+ "operation": "update",
1489
+ "objectName": "@happyvertical/smrt-analytics:AnalyticsReport",
1490
+ "path": "/analyticsreports/[id]",
1491
+ "method": "PATCH"
1492
+ },
1493
+ {
1494
+ "kind": "api",
1495
+ "name": "analyticsreports.run",
1496
+ "operation": "run",
1497
+ "objectName": "@happyvertical/smrt-analytics:AnalyticsReport",
1498
+ "path": "/analyticsreports/run",
1499
+ "method": "POST"
1500
+ },
1501
+ {
1502
+ "kind": "cli",
1503
+ "name": "analyticsreport_list",
1504
+ "operation": "list",
1505
+ "objectName": "@happyvertical/smrt-analytics:AnalyticsReport"
1506
+ },
1507
+ {
1508
+ "kind": "cli",
1509
+ "name": "analyticsreport_get",
1510
+ "operation": "get",
1511
+ "objectName": "@happyvertical/smrt-analytics:AnalyticsReport"
1512
+ },
1513
+ {
1514
+ "kind": "cli",
1515
+ "name": "analyticsreport_create",
1516
+ "operation": "create",
1517
+ "objectName": "@happyvertical/smrt-analytics:AnalyticsReport"
1518
+ },
1519
+ {
1520
+ "kind": "cli",
1521
+ "name": "analyticsreport_update",
1522
+ "operation": "update",
1523
+ "objectName": "@happyvertical/smrt-analytics:AnalyticsReport"
1524
+ },
1525
+ {
1526
+ "kind": "cli",
1527
+ "name": "analyticsreport_delete",
1528
+ "operation": "delete",
1529
+ "objectName": "@happyvertical/smrt-analytics:AnalyticsReport"
1530
+ },
1531
+ {
1532
+ "kind": "mcp",
1533
+ "name": "analyticsreport_list",
1534
+ "operation": "list",
1535
+ "objectName": "@happyvertical/smrt-analytics:AnalyticsReport"
1536
+ },
1537
+ {
1538
+ "kind": "mcp",
1539
+ "name": "analyticsreport_get",
1540
+ "operation": "get",
1541
+ "objectName": "@happyvertical/smrt-analytics:AnalyticsReport"
1542
+ },
1543
+ {
1544
+ "kind": "mcp",
1545
+ "name": "analyticsreport_run",
1546
+ "operation": "run",
1547
+ "objectName": "@happyvertical/smrt-analytics:AnalyticsReport"
1548
+ },
1549
+ {
1550
+ "kind": "mcp",
1551
+ "name": "analyticsreport_analyze",
1552
+ "operation": "analyze",
1553
+ "objectName": "@happyvertical/smrt-analytics:AnalyticsReport"
1554
+ }
1555
+ ],
1556
+ "prompts": [
1557
+ {
1558
+ "filePath": "src/prompts.ts"
1559
+ }
1560
+ ],
1561
+ "relationshipsV2": {
1562
+ "foreignKeyFields": 3,
1563
+ "crossPackageRefFields": 0,
1564
+ "junctionCollections": 0,
1565
+ "hierarchicalObjects": 0,
1566
+ "polymorphicAssociations": 0,
1567
+ "uuidColumns": 15
1568
+ },
1569
+ "agentDoc": "# @happyvertical/smrt-analytics\n\nGA4/Plausible/Matomo analytics integration with server-side event tracking and AI-powered reporting.\n\n## Models\n\n- **AnalyticsProperty**: GA4 property, Plausible site, or Matomo site. Provider metadata, status, sync timestamps.\n- **AnalyticsDataStream**: web/iOS/Android data streams. Measurement IDs (G-XXXXXX for GA4, Firebase app ID for mobile).\n- **AnalyticsEvent**: tracked events with params (JSON), retry queue, conversion classification.\n- **AnalyticsReport**: saved report configs with dimensions/metrics (JSON), scheduling (daily/weekly/monthly), result caching.\n\nAll models use STI (`tableStrategy: 'sti'`).\n\nAll 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.\n\n## Key Collection Methods\n\n`findByExternalId()`, `findByProvider()`, `findNeedingSync()`, `findGA4Properties()`, `findPlausibleSites()`, `findMatomoSites()`\n\n## AI Operations\n\n`analyzePerformance()`, `analyzeResults()`, `hasPositiveTrends()` route through registered prompts (see Prompt Registry below) so tenant overrides apply via `resolvePrompt()`. `isPerformingWell()` still uses the inline `is()` shortcut.\n\n## Prompt Registry\n\nThree prompts are registered at module-load time via `definePrompt()` from `@happyvertical/smrt-prompts`. Re-exported from the package root for tenant override targeting.\n\n| Key | Method | Variables (PII-conscious) |\n|-----|--------|---------------------------|\n| `smrtAnalytics.property.analyzePerformance` | `AnalyticsProperty.analyzePerformance()` | `period`, `propertyDisplayName`, `propertyProvider` |\n| `smrtAnalytics.report.analyzeResults` | `AnalyticsReport.analyzeResults()` | `reportName`, `reportDimensions`, `reportMetrics`, `dateRangeStart`, `dateRangeEnd`, `rowCount`, `reportData` |\n| `smrtAnalytics.report.hasPositiveTrends` | `AnalyticsReport.hasPositiveTrends()` | `reportMetrics`, `reportData` |\n\n**Excluded from variables (never reach the AI provider):**\n- `id`, `propertyId`, `tenantId`, `externalId` — internal foreign keys / UUIDs that link to identifying records.\n- `apiSecret`, `measurementId`, `siteDomain` — provider credentials and platform-specific identifiers (GA4 API secrets, Matomo `idSite`, custom `G-XXXX` measurement IDs).\n- `providerMetadata` — extensible JSON blob that may contain credentials, account IDs, or other configuration secrets.\n- `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.\n\n**`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:\n\n- exclude PII-bearing dimensions before persisting `resultData` (e.g. don't request `userPseudoId` as a GA4 dimension), or\n- apply a column allowlist at the call site before invoking `analyzeResults()`, or\n- override the prompt template via `PromptOverride` to redact rows.\n\nThe forwarding contract is pinned by a regression test in `src/__tests__/analytics-report-prompt.test.ts`.\n\nSee `src/prompts.ts` for the full rationale block.\n\n## UI Registry\n\nSvelte components live in `src/svelte/` and auto-register with `ModuleUIRegistry` from `@happyvertical/smrt-svelte/registry` when `@happyvertical/smrt-analytics/svelte` is imported.\n\nSlot 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).\n\n```typescript\nimport '@happyvertical/smrt-analytics/svelte'; // side-effect: registers slots\nimport { ModuleUIRegistry } from '@happyvertical/smrt-svelte/registry';\nconst StatCard = ModuleUIRegistry.get('@happyvertical/smrt-analytics', 'stat-card');\n```\n\n## Gotchas\n\n- **`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).\n- **Event retry at model level**: no background job integration\n- **JSON fields**: params, dimensions, metrics use string storage with getter/setter helpers\n- **Measurement IDs differ per platform**: G-XXXXXX (GA4 web) vs Firebase app ID (mobile)\n- **`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.\n"
1570
+ }