@happyvertical/smrt-analytics 0.40.6 → 0.40.7

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.
@@ -1,655 +1,462 @@
1
1
  {
2
2
  "version": "1.0.0",
3
- "timestamp": 1784159516390,
3
+ "timestamp": 1784269685040,
4
4
  "packageName": "@happyvertical/smrt-analytics",
5
- "packageVersion": "0.40.6",
5
+ "packageVersion": "0.40.7",
6
6
  "objects": {
7
- "@happyvertical/smrt-analytics:AnalyticsDataStream": {
8
- "name": "analyticsdatastream",
9
- "className": "AnalyticsDataStream",
10
- "qualifiedName": "@happyvertical/smrt-analytics:AnalyticsDataStream",
7
+ "@happyvertical/smrt-analytics:AnalyticsDataStreamCollection": {
8
+ "name": "analyticsdatastreamcollection",
9
+ "className": "AnalyticsDataStreamCollection",
10
+ "qualifiedName": "@happyvertical/smrt-analytics:AnalyticsDataStreamCollection",
11
11
  "collection": "analyticsdatastreams",
12
- "filePath": "/home/runner/_work/smrt/smrt/packages/analytics/src/models/AnalyticsDataStream.ts",
12
+ "filePath": "/home/runner/_work/smrt/smrt/packages/analytics/src/collections/AnalyticsDataStreamCollection.ts",
13
13
  "packageName": "@happyvertical/smrt-analytics",
14
- "fields": {
15
- "created_at": {
16
- "type": "datetime",
17
- "required": false
18
- },
19
- "updated_at": {
20
- "type": "datetime",
21
- "required": false
22
- },
23
- "tenantId": {
24
- "type": "text",
25
- "required": false,
26
- "_meta": {
27
- "sqlType": "UUID",
28
- "nullable": true,
29
- "__tenancy": {
30
- "isTenantIdField": true,
31
- "autoFilter": true,
32
- "required": false,
33
- "autoPopulate": true,
34
- "nullable": true,
35
- "mode": "optional",
36
- "field": "tenantId",
37
- "allowSuperAdminBypass": false
38
- }
39
- }
40
- },
41
- "propertyId": {
42
- "type": "foreignKey",
43
- "required": false,
44
- "related": "AnalyticsProperty"
45
- },
46
- "displayName": {
47
- "type": "text",
48
- "required": false,
49
- "default": ""
50
- },
51
- "streamType": {
52
- "type": "text",
53
- "required": false
54
- },
55
- "externalId": {
56
- "type": "text",
57
- "required": false,
58
- "default": ""
59
- },
60
- "measurementId": {
61
- "type": "text",
62
- "required": false,
63
- "default": ""
64
- },
65
- "firebaseAppId": {
66
- "type": "text",
67
- "required": false,
68
- "default": ""
69
- },
70
- "defaultUri": {
71
- "type": "text",
72
- "required": false,
73
- "default": ""
74
- },
75
- "bundleId": {
76
- "type": "text",
77
- "required": false,
78
- "default": ""
79
- },
80
- "packageName": {
81
- "type": "text",
82
- "required": false,
83
- "default": ""
84
- },
85
- "status": {
86
- "type": "text",
87
- "required": false
88
- },
89
- "enhancedMeasurement": {
90
- "type": "boolean",
91
- "required": false,
92
- "default": true
93
- }
94
- },
14
+ "fields": {},
95
15
  "methods": {
96
- "getAiUsageSnapshot": {
97
- "name": "getAiUsageSnapshot",
98
- "async": false,
99
- "parameters": [],
100
- "returnType": "AiUsageSnapshot | undefined",
101
- "isStatic": false,
102
- "isPublic": true
103
- },
104
- "resetAiUsage": {
105
- "name": "resetAiUsage",
106
- "async": false,
107
- "parameters": [],
108
- "returnType": "void",
109
- "isStatic": false,
110
- "isPublic": true
111
- },
112
- "listAiUsage": {
113
- "name": "listAiUsage",
16
+ "findByProperty": {
17
+ "name": "findByProperty",
114
18
  "async": true,
115
19
  "parameters": [
116
20
  {
117
- "name": "options",
118
- "type": "AiUsageListOptions",
119
- "optional": true
21
+ "name": "propertyId",
22
+ "type": "string",
23
+ "optional": false
120
24
  }
121
25
  ],
122
- "returnType": "Promise<SmrtAiUsageRecord[]>",
26
+ "returnType": "Promise<AnalyticsDataStream[]>",
123
27
  "isStatic": false,
124
28
  "isPublic": true
125
29
  },
126
- "summarizeAiUsage": {
127
- "name": "summarizeAiUsage",
30
+ "findByExternalId": {
31
+ "name": "findByExternalId",
128
32
  "async": true,
129
33
  "parameters": [
130
34
  {
131
- "name": "options",
132
- "type": "AiUsageSummaryOptions",
133
- "optional": true
35
+ "name": "externalId",
36
+ "type": "string",
37
+ "optional": false
134
38
  }
135
39
  ],
136
- "returnType": "Promise<Record<string, AiUsageStats>>",
137
- "isStatic": false,
138
- "isPublic": true
139
- },
140
- "destroy": {
141
- "name": "destroy",
142
- "async": false,
143
- "parameters": [],
144
- "returnType": "void",
145
- "isStatic": false,
146
- "isPublic": true
147
- },
148
- "markAsPersisted": {
149
- "name": "markAsPersisted",
150
- "async": false,
151
- "parameters": [],
152
- "returnType": "void",
153
- "isStatic": false,
154
- "isPublic": true
155
- },
156
- "requireInsertOnSave": {
157
- "name": "requireInsertOnSave",
158
- "async": false,
159
- "parameters": [],
160
- "returnType": "void",
161
- "isStatic": false,
162
- "isPublic": true
163
- },
164
- "initialize": {
165
- "name": "initialize",
166
- "async": true,
167
- "parameters": [],
168
- "returnType": "Promise",
40
+ "returnType": "Promise<AnalyticsDataStream | null>",
169
41
  "isStatic": false,
170
42
  "isPublic": true
171
43
  },
172
- "loadDataFromDb": {
173
- "name": "loadDataFromDb",
44
+ "findByMeasurementId": {
45
+ "name": "findByMeasurementId",
174
46
  "async": true,
175
47
  "parameters": [
176
48
  {
177
- "name": "data",
178
- "type": "Record<string>",
49
+ "name": "measurementId",
50
+ "type": "string",
179
51
  "optional": false
180
52
  }
181
53
  ],
182
- "returnType": "any",
54
+ "returnType": "Promise<AnalyticsDataStream | null>",
183
55
  "isStatic": false,
184
56
  "isPublic": true
185
57
  },
186
- "getFields": {
187
- "name": "getFields",
58
+ "findByType": {
59
+ "name": "findByType",
188
60
  "async": true,
189
- "parameters": [],
190
- "returnType": "Promise<any>",
191
- "isStatic": false,
192
- "isPublic": true
193
- },
194
- "toJSON": {
195
- "name": "toJSON",
196
- "async": false,
197
- "parameters": [],
198
- "returnType": "any",
199
- "isStatic": false,
200
- "isPublic": true
201
- },
202
- "toPlainObject": {
203
- "name": "toPlainObject",
204
- "async": false,
205
- "parameters": [],
206
- "returnType": "Record<string>",
207
- "isStatic": false,
208
- "isPublic": true
209
- },
210
- "toPublicJSON": {
211
- "name": "toPublicJSON",
212
- "async": false,
213
61
  "parameters": [
214
62
  {
215
- "name": "options",
216
- "type": "PublicJsonOptions",
217
- "optional": true
63
+ "name": "streamType",
64
+ "type": "DataStreamType",
65
+ "optional": false
218
66
  }
219
67
  ],
220
- "returnType": "Record<string>",
68
+ "returnType": "Promise<AnalyticsDataStream[]>",
221
69
  "isStatic": false,
222
70
  "isPublic": true
223
71
  },
224
- "getId": {
225
- "name": "getId",
72
+ "findWebStreams": {
73
+ "name": "findWebStreams",
226
74
  "async": true,
227
75
  "parameters": [],
228
- "returnType": "any",
76
+ "returnType": "Promise<AnalyticsDataStream[]>",
229
77
  "isStatic": false,
230
78
  "isPublic": true
231
79
  },
232
- "getSlug": {
233
- "name": "getSlug",
80
+ "findIOSStreams": {
81
+ "name": "findIOSStreams",
234
82
  "async": true,
235
83
  "parameters": [],
236
- "returnType": "any",
84
+ "returnType": "Promise<AnalyticsDataStream[]>",
237
85
  "isStatic": false,
238
86
  "isPublic": true
239
87
  },
240
- "getSavedId": {
241
- "name": "getSavedId",
88
+ "findAndroidStreams": {
89
+ "name": "findAndroidStreams",
242
90
  "async": true,
243
91
  "parameters": [],
244
- "returnType": "any",
92
+ "returnType": "Promise<AnalyticsDataStream[]>",
245
93
  "isStatic": false,
246
94
  "isPublic": true
247
95
  },
248
- "isSaved": {
249
- "name": "isSaved",
96
+ "findMobileStreams": {
97
+ "name": "findMobileStreams",
250
98
  "async": true,
251
99
  "parameters": [],
252
- "returnType": "any",
100
+ "returnType": "Promise<AnalyticsDataStream[]>",
253
101
  "isStatic": false,
254
102
  "isPublic": true
255
103
  },
256
- "save": {
257
- "name": "save",
104
+ "findByStatus": {
105
+ "name": "findByStatus",
258
106
  "async": true,
259
- "parameters": [],
260
- "returnType": "any",
261
- "isStatic": false,
262
- "isPublic": true
263
- },
264
- "classifyConstraintError": {
265
- "name": "classifyConstraintError",
266
- "async": false,
267
107
  "parameters": [
268
108
  {
269
- "name": "message",
270
- "type": "string",
109
+ "name": "status",
110
+ "type": "DataStreamStatus",
271
111
  "optional": false
272
112
  }
273
113
  ],
274
- "returnType": "'unique' | 'not_null' | null",
275
- "isStatic": true,
114
+ "returnType": "Promise<AnalyticsDataStream[]>",
115
+ "isStatic": false,
276
116
  "isPublic": true
277
117
  },
278
- "loadFromId": {
279
- "name": "loadFromId",
280
- "async": true,
281
- "parameters": [],
282
- "returnType": "any",
283
- "isStatic": false,
284
- "isPublic": true
285
- },
286
- "loadFromSlug": {
287
- "name": "loadFromSlug",
118
+ "findActive": {
119
+ "name": "findActive",
288
120
  "async": true,
289
121
  "parameters": [],
290
- "returnType": "any",
122
+ "returnType": "Promise<AnalyticsDataStream[]>",
291
123
  "isStatic": false,
292
124
  "isPublic": true
293
125
  },
294
- "is": {
295
- "name": "is",
126
+ "findActiveByProperty": {
127
+ "name": "findActiveByProperty",
296
128
  "async": true,
297
129
  "parameters": [
298
130
  {
299
- "name": "criteria",
131
+ "name": "propertyId",
300
132
  "type": "string",
301
133
  "optional": false
302
- },
303
- {
304
- "name": "options",
305
- "type": "AiOperationOptions",
306
- "optional": true
307
134
  }
308
135
  ],
309
- "returnType": "any",
136
+ "returnType": "Promise<AnalyticsDataStream[]>",
310
137
  "isStatic": false,
311
138
  "isPublic": true
139
+ }
140
+ },
141
+ "decoratorConfig": {},
142
+ "extends": "SmrtCollection",
143
+ "extendsTypeArg": "AnalyticsDataStream",
144
+ "exportName": "AnalyticsDataStreamCollection",
145
+ "collectionExportName": "AnalyticsDataStreamCollectionCollection",
146
+ "schema": {
147
+ "tableName": "analytics_data_stream_collections",
148
+ "ddl": "CREATE TABLE IF NOT EXISTS \"analytics_data_stream_collections\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp\n);",
149
+ "columns": {
150
+ "id": {
151
+ "type": "UUID",
152
+ "primaryKey": true,
153
+ "referenceKind": "id",
154
+ "notNull": true
155
+ },
156
+ "slug": {
157
+ "type": "TEXT",
158
+ "notNull": true
159
+ },
160
+ "context": {
161
+ "type": "TEXT",
162
+ "notNull": true,
163
+ "default": ""
164
+ },
165
+ "created_at": {
166
+ "type": "TIMESTAMP",
167
+ "notNull": true,
168
+ "default": "current_timestamp"
169
+ },
170
+ "updated_at": {
171
+ "type": "TIMESTAMP",
172
+ "notNull": true,
173
+ "default": "current_timestamp"
174
+ }
312
175
  },
313
- "do": {
314
- "name": "do",
176
+ "indexes": [
177
+ {
178
+ "name": "analytics_data_stream_collections_id_idx",
179
+ "columns": [
180
+ "id"
181
+ ]
182
+ },
183
+ {
184
+ "name": "analytics_data_stream_collections_slug_context_idx",
185
+ "columns": [
186
+ "slug",
187
+ "context"
188
+ ],
189
+ "unique": true
190
+ }
191
+ ],
192
+ "version": "12ef5a9a"
193
+ }
194
+ },
195
+ "@happyvertical/smrt-analytics:AnalyticsEventCollection": {
196
+ "name": "analyticseventcollection",
197
+ "className": "AnalyticsEventCollection",
198
+ "qualifiedName": "@happyvertical/smrt-analytics:AnalyticsEventCollection",
199
+ "collection": "analyticsevents",
200
+ "filePath": "/home/runner/_work/smrt/smrt/packages/analytics/src/collections/AnalyticsEventCollection.ts",
201
+ "packageName": "@happyvertical/smrt-analytics",
202
+ "fields": {},
203
+ "methods": {
204
+ "findByProperty": {
205
+ "name": "findByProperty",
315
206
  "async": true,
316
207
  "parameters": [
317
208
  {
318
- "name": "instructions",
209
+ "name": "propertyId",
319
210
  "type": "string",
320
211
  "optional": false
321
- },
322
- {
323
- "name": "options",
324
- "type": "AiOperationOptions",
325
- "optional": true
326
212
  }
327
213
  ],
328
- "returnType": "any",
214
+ "returnType": "Promise<AnalyticsEvent[]>",
329
215
  "isStatic": false,
330
216
  "isPublic": true
331
217
  },
332
- "describe": {
333
- "name": "describe",
218
+ "findByEventName": {
219
+ "name": "findByEventName",
334
220
  "async": true,
335
221
  "parameters": [
336
222
  {
337
- "name": "options",
338
- "type": "AiOperationOptions",
339
- "optional": true
223
+ "name": "eventName",
224
+ "type": "string",
225
+ "optional": false
340
226
  }
341
227
  ],
342
- "returnType": "any",
228
+ "returnType": "Promise<AnalyticsEvent[]>",
343
229
  "isStatic": false,
344
230
  "isPublic": true
345
231
  },
346
- "delete": {
347
- "name": "delete",
232
+ "findByClientId": {
233
+ "name": "findByClientId",
348
234
  "async": true,
349
- "parameters": [],
350
- "returnType": "Promise<void>",
351
- "isStatic": false,
352
- "isPublic": true
353
- },
354
- "isRelatedLoaded": {
355
- "name": "isRelatedLoaded",
356
- "async": false,
357
235
  "parameters": [
358
236
  {
359
- "name": "fieldName",
237
+ "name": "clientId",
360
238
  "type": "string",
361
239
  "optional": false
362
240
  }
363
241
  ],
364
- "returnType": "boolean",
242
+ "returnType": "Promise<AnalyticsEvent[]>",
365
243
  "isStatic": false,
366
244
  "isPublic": true
367
245
  },
368
- "_setLoadedRelationship": {
369
- "name": "_setLoadedRelationship",
370
- "async": false,
246
+ "findByUserId": {
247
+ "name": "findByUserId",
248
+ "async": true,
371
249
  "parameters": [
372
250
  {
373
- "name": "fieldName",
251
+ "name": "userId",
374
252
  "type": "string",
375
253
  "optional": false
376
- },
377
- {
378
- "name": "value",
379
- "type": "any",
380
- "optional": false
381
254
  }
382
255
  ],
383
- "returnType": "void",
256
+ "returnType": "Promise<AnalyticsEvent[]>",
384
257
  "isStatic": false,
385
258
  "isPublic": true
386
259
  },
387
- "loadRelated": {
388
- "name": "loadRelated",
260
+ "findByStatus": {
261
+ "name": "findByStatus",
389
262
  "async": true,
390
263
  "parameters": [
391
264
  {
392
- "name": "fieldName",
393
- "type": "string",
265
+ "name": "status",
266
+ "type": "TrackingEventStatus",
394
267
  "optional": false
395
- },
396
- {
397
- "name": "opts",
398
- "type": "LoadRelatedOptions",
399
- "optional": true
400
268
  }
401
269
  ],
402
- "returnType": "Promise<any>",
270
+ "returnType": "Promise<AnalyticsEvent[]>",
403
271
  "isStatic": false,
404
272
  "isPublic": true
405
273
  },
406
- "loadRelatedMany": {
407
- "name": "loadRelatedMany",
274
+ "findPending": {
275
+ "name": "findPending",
408
276
  "async": true,
409
- "parameters": [
410
- {
411
- "name": "fieldName",
412
- "type": "string",
413
- "optional": false
414
- },
415
- {
416
- "name": "opts",
417
- "type": "LoadRelatedOptions",
418
- "optional": true
419
- }
420
- ],
421
- "returnType": "Promise<any[]>",
277
+ "parameters": [],
278
+ "returnType": "Promise<AnalyticsEvent[]>",
422
279
  "isStatic": false,
423
280
  "isPublic": true
424
281
  },
425
- "getRelated": {
426
- "name": "getRelated",
282
+ "findSent": {
283
+ "name": "findSent",
427
284
  "async": true,
428
- "parameters": [
429
- {
430
- "name": "fieldName",
431
- "type": "string",
432
- "optional": false
433
- },
434
- {
435
- "name": "opts",
436
- "type": "LoadRelatedOptions",
437
- "optional": true
438
- }
439
- ],
440
- "returnType": "Promise<any>",
285
+ "parameters": [],
286
+ "returnType": "Promise<AnalyticsEvent[]>",
441
287
  "isStatic": false,
442
288
  "isPublic": true
443
289
  },
444
- "getAvailableTools": {
445
- "name": "getAvailableTools",
446
- "async": false,
290
+ "findFailed": {
291
+ "name": "findFailed",
292
+ "async": true,
447
293
  "parameters": [],
448
- "returnType": "AITool[]",
294
+ "returnType": "Promise<AnalyticsEvent[]>",
449
295
  "isStatic": false,
450
296
  "isPublic": true
451
297
  },
452
- "executeToolCall": {
453
- "name": "executeToolCall",
298
+ "findForRetry": {
299
+ "name": "findForRetry",
454
300
  "async": true,
455
301
  "parameters": [
456
302
  {
457
- "name": "toolCall",
458
- "type": "ToolCall",
459
- "optional": false
303
+ "name": "maxRetries",
304
+ "type": "number",
305
+ "optional": true
460
306
  }
461
307
  ],
462
- "returnType": "Promise<ToolCallResult>",
308
+ "returnType": "Promise<AnalyticsEvent[]>",
463
309
  "isStatic": false,
464
310
  "isPublic": true
465
311
  },
466
- "remember": {
467
- "name": "remember",
312
+ "findPendingByProperty": {
313
+ "name": "findPendingByProperty",
468
314
  "async": true,
469
315
  "parameters": [
470
316
  {
471
- "name": "options",
472
- "type": "object",
317
+ "name": "propertyId",
318
+ "type": "string",
473
319
  "optional": false
474
320
  }
475
321
  ],
476
- "returnType": "Promise<void>",
322
+ "returnType": "Promise<AnalyticsEvent[]>",
477
323
  "isStatic": false,
478
324
  "isPublic": true
479
325
  },
480
- "recall": {
481
- "name": "recall",
326
+ "findByDateRange": {
327
+ "name": "findByDateRange",
482
328
  "async": true,
483
329
  "parameters": [
484
330
  {
485
- "name": "options",
486
- "type": "object",
331
+ "name": "startDate",
332
+ "type": "Date",
333
+ "optional": false
334
+ },
335
+ {
336
+ "name": "endDate",
337
+ "type": "Date",
487
338
  "optional": false
488
339
  }
489
340
  ],
490
- "returnType": "Promise",
341
+ "returnType": "Promise<AnalyticsEvent[]>",
491
342
  "isStatic": false,
492
343
  "isPublic": true
493
344
  },
494
- "recallAll": {
495
- "name": "recallAll",
345
+ "findConversions": {
346
+ "name": "findConversions",
496
347
  "async": true,
497
348
  "parameters": [
498
349
  {
499
- "name": "options",
500
- "type": "object",
350
+ "name": "propertyId",
351
+ "type": "string",
501
352
  "optional": true
502
353
  }
503
354
  ],
504
- "returnType": "Promise<Map<string>>",
355
+ "returnType": "Promise<AnalyticsEvent[]>",
505
356
  "isStatic": false,
506
357
  "isPublic": true
507
358
  },
508
- "forget": {
509
- "name": "forget",
510
- "async": true,
359
+ "findPageviews": {
360
+ "name": "findPageviews",
361
+ "async": true,
511
362
  "parameters": [
512
363
  {
513
- "name": "options",
514
- "type": "object",
515
- "optional": false
364
+ "name": "propertyId",
365
+ "type": "string",
366
+ "optional": true
516
367
  }
517
368
  ],
518
- "returnType": "Promise<void>",
369
+ "returnType": "Promise<AnalyticsEvent[]>",
519
370
  "isStatic": false,
520
371
  "isPublic": true
521
372
  },
522
- "forgetScope": {
523
- "name": "forgetScope",
373
+ "countByEventName": {
374
+ "name": "countByEventName",
524
375
  "async": true,
525
376
  "parameters": [
526
377
  {
527
- "name": "options",
528
- "type": "object",
378
+ "name": "propertyId",
379
+ "type": "string",
529
380
  "optional": false
530
381
  }
531
382
  ],
532
- "returnType": "Promise<number>",
383
+ "returnType": "Promise<Map<string, number>>",
533
384
  "isStatic": false,
534
385
  "isPublic": true
535
386
  },
536
- "generateEmbeddings": {
537
- "name": "generateEmbeddings",
387
+ "getPropertyStats": {
388
+ "name": "getPropertyStats",
538
389
  "async": true,
539
390
  "parameters": [
540
391
  {
541
- "name": "options",
542
- "type": "GenerateEmbeddingsOptions",
543
- "optional": true
392
+ "name": "propertyId",
393
+ "type": "string",
394
+ "optional": false
544
395
  }
545
396
  ],
546
- "returnType": "Promise<void>",
397
+ "returnType": "Promise<object>",
547
398
  "isStatic": false,
548
399
  "isPublic": true
549
400
  },
550
- "getEmbedding": {
551
- "name": "getEmbedding",
401
+ "getPropertyStatsWithTrend": {
402
+ "name": "getPropertyStatsWithTrend",
552
403
  "async": true,
553
404
  "parameters": [
554
405
  {
555
- "name": "fieldName",
406
+ "name": "propertyId",
556
407
  "type": "string",
557
408
  "optional": false
558
409
  },
559
410
  {
560
- "name": "model",
561
- "type": "string",
411
+ "name": "now",
412
+ "type": "Date",
562
413
  "optional": true
414
+ },
415
+ {
416
+ "name": "timeZone",
417
+ "type": "string",
418
+ "optional": true,
419
+ "default": "UTC"
563
420
  }
564
421
  ],
565
- "returnType": "Promise<number[] | null>",
566
- "isStatic": false,
567
- "isPublic": true
568
- },
569
- "hasStaleEmbeddings": {
570
- "name": "hasStaleEmbeddings",
571
- "async": true,
572
- "parameters": [],
573
- "returnType": "Promise<boolean>",
422
+ "returnType": "Promise<PropertyStatsWithTrend>",
574
423
  "isStatic": false,
575
424
  "isPublic": true
576
425
  },
577
- "clearEmbeddings": {
578
- "name": "clearEmbeddings",
426
+ "getBatchPropertyStats": {
427
+ "name": "getBatchPropertyStats",
579
428
  "async": true,
580
- "parameters": [],
581
- "returnType": "Promise<void>",
582
- "isStatic": false,
583
- "isPublic": true
584
- },
585
- "isWeb": {
586
- "name": "isWeb",
587
- "async": false,
588
- "parameters": [],
589
- "returnType": "boolean",
590
- "isStatic": false,
591
- "isPublic": true
592
- },
593
- "isIOS": {
594
- "name": "isIOS",
595
- "async": false,
596
- "parameters": [],
597
- "returnType": "boolean",
598
- "isStatic": false,
599
- "isPublic": true
600
- },
601
- "isAndroid": {
602
- "name": "isAndroid",
603
- "async": false,
604
- "parameters": [],
605
- "returnType": "boolean",
606
- "isStatic": false,
607
- "isPublic": true
608
- },
609
- "isMobileApp": {
610
- "name": "isMobileApp",
611
- "async": false,
612
- "parameters": [],
613
- "returnType": "boolean",
614
- "isStatic": false,
615
- "isPublic": true
616
- },
617
- "getPlatformId": {
618
- "name": "getPlatformId",
619
- "async": false,
620
- "parameters": [],
621
- "returnType": "string",
429
+ "parameters": [
430
+ {
431
+ "name": "propertyIds",
432
+ "type": "string[]",
433
+ "optional": false
434
+ },
435
+ {
436
+ "name": "now",
437
+ "type": "Date",
438
+ "optional": true
439
+ },
440
+ {
441
+ "name": "timeZone",
442
+ "type": "string",
443
+ "optional": true,
444
+ "default": "UTC"
445
+ }
446
+ ],
447
+ "returnType": "Promise<Map<string, PropertyStatsWithTrend>>",
622
448
  "isStatic": false,
623
449
  "isPublic": true
624
450
  }
625
451
  },
626
- "decoratorConfig": {
627
- "tableStrategy": "sti",
628
- "api": {
629
- "include": [
630
- "list",
631
- "get",
632
- "create",
633
- "update"
634
- ]
635
- },
636
- "mcp": {
637
- "include": [
638
- "list",
639
- "get"
640
- ]
641
- },
642
- "cli": true,
643
- "tenantScoped": {
644
- "mode": "optional"
645
- }
646
- },
647
- "extends": "SmrtObject",
648
- "exportName": "AnalyticsDataStream",
649
- "collectionExportName": "AnalyticsDataStreamCollection",
452
+ "decoratorConfig": {},
453
+ "extends": "SmrtCollection",
454
+ "extendsTypeArg": "AnalyticsEvent",
455
+ "exportName": "AnalyticsEventCollection",
456
+ "collectionExportName": "AnalyticsEventCollectionCollection",
650
457
  "schema": {
651
- "tableName": "analytics_data_streams",
652
- "ddl": "CREATE TABLE IF NOT EXISTS \"analytics_data_streams\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"_meta_type\" TEXT NOT NULL,\n \"_meta_data\" JSON,\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID,\n \"property_id\" UUID,\n \"display_name\" TEXT DEFAULT '',\n \"stream_type\" TEXT,\n \"external_id\" TEXT DEFAULT '',\n \"measurement_id\" TEXT DEFAULT '',\n \"firebase_app_id\" TEXT DEFAULT '',\n \"default_uri\" TEXT DEFAULT '',\n \"bundle_id\" TEXT DEFAULT '',\n \"package_name\" TEXT DEFAULT '',\n \"status\" TEXT,\n \"enhanced_measurement\" BOOLEAN DEFAULT TRUE\n);",
458
+ "tableName": "analytics_event_collections",
459
+ "ddl": "CREATE TABLE IF NOT EXISTS \"analytics_event_collections\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp\n);",
653
460
  "columns": {
654
461
  "id": {
655
462
  "type": "UUID",
@@ -666,14 +473,6 @@
666
473
  "notNull": true,
667
474
  "default": ""
668
475
  },
669
- "_meta_type": {
670
- "type": "TEXT",
671
- "notNull": true
672
- },
673
- "_meta_data": {
674
- "type": "JSON",
675
- "notNull": false
676
- },
677
476
  "created_at": {
678
477
  "type": "TIMESTAMP",
679
478
  "notNull": true,
@@ -683,558 +482,841 @@
683
482
  "type": "TIMESTAMP",
684
483
  "notNull": true,
685
484
  "default": "current_timestamp"
686
- },
687
- "tenant_id": {
688
- "type": "UUID",
689
- "referenceKind": "tenantId",
690
- "notNull": false
691
- },
692
- "property_id": {
693
- "type": "UUID",
694
- "referenceKind": "foreignKey",
695
- "notNull": false
696
- },
697
- "display_name": {
698
- "type": "TEXT",
699
- "notNull": false,
700
- "default": ""
701
- },
702
- "stream_type": {
703
- "type": "TEXT",
704
- "notNull": false
705
- },
706
- "external_id": {
707
- "type": "TEXT",
708
- "notNull": false,
709
- "default": ""
710
- },
711
- "measurement_id": {
712
- "type": "TEXT",
713
- "notNull": false,
714
- "default": ""
715
- },
716
- "firebase_app_id": {
717
- "type": "TEXT",
718
- "notNull": false,
719
- "default": ""
720
- },
721
- "default_uri": {
722
- "type": "TEXT",
723
- "notNull": false,
724
- "default": ""
725
- },
726
- "bundle_id": {
727
- "type": "TEXT",
728
- "notNull": false,
729
- "default": ""
730
- },
731
- "package_name": {
732
- "type": "TEXT",
733
- "notNull": false,
734
- "default": ""
735
- },
736
- "status": {
737
- "type": "TEXT",
738
- "notNull": false
739
- },
740
- "enhanced_measurement": {
741
- "type": "BOOLEAN",
742
- "notNull": false,
743
- "default": true
744
485
  }
745
486
  },
746
487
  "indexes": [
747
488
  {
748
- "name": "analytics_data_streams_id_idx",
489
+ "name": "analytics_event_collections_id_idx",
749
490
  "columns": [
750
491
  "id"
751
492
  ]
752
493
  },
753
494
  {
754
- "name": "analytics_data_streams_slug_context_meta_type_idx",
495
+ "name": "analytics_event_collections_slug_context_idx",
755
496
  "columns": [
756
497
  "slug",
757
- "context",
758
- "_meta_type"
498
+ "context"
759
499
  ],
760
500
  "unique": true
761
- },
762
- {
763
- "name": "analytics_data_streams_meta_type_idx",
764
- "columns": [
765
- "_meta_type"
766
- ]
767
501
  }
768
502
  ],
769
- "version": "e1ae416d"
503
+ "version": "13d03b2a"
770
504
  }
771
505
  },
772
- "@happyvertical/smrt-analytics:AnalyticsEvent": {
773
- "name": "analyticsevent",
774
- "className": "AnalyticsEvent",
775
- "qualifiedName": "@happyvertical/smrt-analytics:AnalyticsEvent",
776
- "collection": "analyticsevents",
777
- "filePath": "/home/runner/_work/smrt/smrt/packages/analytics/src/models/AnalyticsEvent.ts",
506
+ "@happyvertical/smrt-analytics:AnalyticsPropertyCollection": {
507
+ "name": "analyticspropertycollection",
508
+ "className": "AnalyticsPropertyCollection",
509
+ "qualifiedName": "@happyvertical/smrt-analytics:AnalyticsPropertyCollection",
510
+ "collection": "analyticsproperties",
511
+ "filePath": "/home/runner/_work/smrt/smrt/packages/analytics/src/collections/AnalyticsPropertyCollection.ts",
778
512
  "packageName": "@happyvertical/smrt-analytics",
779
- "fields": {
780
- "created_at": {
781
- "type": "datetime",
782
- "required": false
783
- },
784
- "updated_at": {
785
- "type": "datetime",
786
- "required": false
787
- },
788
- "tenantId": {
789
- "type": "text",
790
- "required": false,
791
- "_meta": {
792
- "sqlType": "UUID",
793
- "nullable": true,
794
- "__tenancy": {
795
- "isTenantIdField": true,
796
- "autoFilter": true,
797
- "required": false,
798
- "autoPopulate": true,
799
- "nullable": true,
800
- "mode": "optional",
801
- "field": "tenantId",
802
- "allowSuperAdminBypass": false
803
- }
804
- }
805
- },
806
- "propertyId": {
807
- "type": "foreignKey",
808
- "required": false,
809
- "related": "AnalyticsProperty"
810
- },
811
- "eventName": {
812
- "type": "text",
813
- "required": false,
814
- "default": ""
815
- },
816
- "clientId": {
817
- "type": "text",
818
- "required": false,
819
- "default": ""
820
- },
821
- "userId": {
822
- "type": "text",
823
- "required": false,
824
- "default": ""
825
- },
826
- "params": {
827
- "type": "text",
828
- "required": false,
829
- "default": "{}"
830
- },
831
- "eventTimestamp": {
832
- "type": "datetime",
833
- "required": false
834
- },
835
- "status": {
836
- "type": "text",
837
- "required": false
838
- },
839
- "sentAt": {
840
- "type": "datetime",
841
- "required": false
842
- },
843
- "errorMessage": {
844
- "type": "text",
845
- "required": false,
846
- "default": ""
847
- },
848
- "retryCount": {
849
- "type": "integer",
850
- "required": false,
851
- "default": 0
852
- },
853
- "nonPersonalizedAds": {
854
- "type": "boolean",
855
- "required": false,
856
- "default": false
857
- },
858
- "sessionId": {
859
- "type": "text",
860
- "required": false,
861
- "default": ""
862
- },
863
- "pagePath": {
864
- "type": "text",
865
- "required": false,
866
- "default": ""
867
- },
868
- "pageTitle": {
869
- "type": "text",
870
- "required": false,
871
- "default": ""
872
- },
873
- "userAgent": {
874
- "type": "text",
875
- "required": false,
876
- "default": ""
877
- },
878
- "ipAddress": {
879
- "type": "text",
880
- "required": false,
881
- "default": ""
882
- }
883
- },
513
+ "fields": {},
884
514
  "methods": {
885
- "getAiUsageSnapshot": {
886
- "name": "getAiUsageSnapshot",
887
- "async": false,
888
- "parameters": [],
889
- "returnType": "AiUsageSnapshot | undefined",
890
- "isStatic": false,
891
- "isPublic": true
892
- },
893
- "resetAiUsage": {
894
- "name": "resetAiUsage",
895
- "async": false,
896
- "parameters": [],
897
- "returnType": "void",
898
- "isStatic": false,
899
- "isPublic": true
900
- },
901
- "listAiUsage": {
902
- "name": "listAiUsage",
515
+ "findByExternalId": {
516
+ "name": "findByExternalId",
903
517
  "async": true,
904
518
  "parameters": [
905
519
  {
906
- "name": "options",
907
- "type": "AiUsageListOptions",
908
- "optional": true
520
+ "name": "externalId",
521
+ "type": "string",
522
+ "optional": false
909
523
  }
910
524
  ],
911
- "returnType": "Promise<SmrtAiUsageRecord[]>",
525
+ "returnType": "Promise<AnalyticsProperty | null>",
912
526
  "isStatic": false,
913
527
  "isPublic": true
914
528
  },
915
- "summarizeAiUsage": {
916
- "name": "summarizeAiUsage",
529
+ "findByMeasurementId": {
530
+ "name": "findByMeasurementId",
917
531
  "async": true,
918
532
  "parameters": [
919
533
  {
920
- "name": "options",
921
- "type": "AiUsageSummaryOptions",
922
- "optional": true
534
+ "name": "measurementId",
535
+ "type": "string",
536
+ "optional": false
923
537
  }
924
538
  ],
925
- "returnType": "Promise<Record<string, AiUsageStats>>",
926
- "isStatic": false,
927
- "isPublic": true
928
- },
929
- "destroy": {
930
- "name": "destroy",
931
- "async": false,
932
- "parameters": [],
933
- "returnType": "void",
934
- "isStatic": false,
935
- "isPublic": true
936
- },
937
- "markAsPersisted": {
938
- "name": "markAsPersisted",
939
- "async": false,
940
- "parameters": [],
941
- "returnType": "void",
942
- "isStatic": false,
943
- "isPublic": true
944
- },
945
- "requireInsertOnSave": {
946
- "name": "requireInsertOnSave",
947
- "async": false,
948
- "parameters": [],
949
- "returnType": "void",
539
+ "returnType": "Promise<AnalyticsProperty | null>",
950
540
  "isStatic": false,
951
541
  "isPublic": true
952
542
  },
953
- "initialize": {
954
- "name": "initialize",
543
+ "findBySiteDomain": {
544
+ "name": "findBySiteDomain",
955
545
  "async": true,
956
- "parameters": [],
957
- "returnType": "Promise",
546
+ "parameters": [
547
+ {
548
+ "name": "siteDomain",
549
+ "type": "string",
550
+ "optional": false
551
+ },
552
+ {
553
+ "name": "provider",
554
+ "type": "AnalyticsProvider",
555
+ "optional": true
556
+ }
557
+ ],
558
+ "returnType": "Promise<AnalyticsProperty | null>",
958
559
  "isStatic": false,
959
560
  "isPublic": true
960
561
  },
961
- "loadDataFromDb": {
962
- "name": "loadDataFromDb",
562
+ "findByProvider": {
563
+ "name": "findByProvider",
963
564
  "async": true,
964
565
  "parameters": [
965
566
  {
966
- "name": "data",
967
- "type": "Record<string>",
567
+ "name": "provider",
568
+ "type": "AnalyticsProvider",
968
569
  "optional": false
969
570
  }
970
571
  ],
971
- "returnType": "any",
572
+ "returnType": "Promise<AnalyticsProperty[]>",
972
573
  "isStatic": false,
973
574
  "isPublic": true
974
575
  },
975
- "getFields": {
976
- "name": "getFields",
576
+ "findGA4Properties": {
577
+ "name": "findGA4Properties",
977
578
  "async": true,
978
579
  "parameters": [],
979
- "returnType": "Promise<any>",
580
+ "returnType": "Promise<AnalyticsProperty[]>",
980
581
  "isStatic": false,
981
582
  "isPublic": true
982
583
  },
983
- "toJSON": {
984
- "name": "toJSON",
985
- "async": false,
584
+ "findPlausibleSites": {
585
+ "name": "findPlausibleSites",
586
+ "async": true,
986
587
  "parameters": [],
987
- "returnType": "any",
588
+ "returnType": "Promise<AnalyticsProperty[]>",
988
589
  "isStatic": false,
989
590
  "isPublic": true
990
591
  },
991
- "toPlainObject": {
992
- "name": "toPlainObject",
993
- "async": false,
592
+ "findMatomoSites": {
593
+ "name": "findMatomoSites",
594
+ "async": true,
994
595
  "parameters": [],
995
- "returnType": "Record<string>",
596
+ "returnType": "Promise<AnalyticsProperty[]>",
996
597
  "isStatic": false,
997
598
  "isPublic": true
998
599
  },
999
- "toPublicJSON": {
1000
- "name": "toPublicJSON",
1001
- "async": false,
600
+ "findByStatus": {
601
+ "name": "findByStatus",
602
+ "async": true,
1002
603
  "parameters": [
1003
604
  {
1004
- "name": "options",
1005
- "type": "PublicJsonOptions",
1006
- "optional": true
605
+ "name": "status",
606
+ "type": "AnalyticsPropertyStatus",
607
+ "optional": false
1007
608
  }
1008
609
  ],
1009
- "returnType": "Record<string>",
610
+ "returnType": "Promise<AnalyticsProperty[]>",
1010
611
  "isStatic": false,
1011
612
  "isPublic": true
1012
613
  },
1013
- "getId": {
1014
- "name": "getId",
614
+ "findActive": {
615
+ "name": "findActive",
1015
616
  "async": true,
1016
617
  "parameters": [],
1017
- "returnType": "any",
618
+ "returnType": "Promise<AnalyticsProperty[]>",
1018
619
  "isStatic": false,
1019
620
  "isPublic": true
1020
621
  },
1021
- "getSlug": {
1022
- "name": "getSlug",
622
+ "findNeedingSync": {
623
+ "name": "findNeedingSync",
1023
624
  "async": true,
1024
- "parameters": [],
1025
- "returnType": "any",
1026
- "isStatic": false,
1027
- "isPublic": true
1028
- },
1029
- "getSavedId": {
1030
- "name": "getSavedId",
1031
- "async": true,
1032
- "parameters": [],
1033
- "returnType": "any",
1034
- "isStatic": false,
1035
- "isPublic": true
1036
- },
1037
- "isSaved": {
1038
- "name": "isSaved",
1039
- "async": true,
1040
- "parameters": [],
1041
- "returnType": "any",
625
+ "parameters": [
626
+ {
627
+ "name": "hoursAgo",
628
+ "type": "number",
629
+ "optional": true
630
+ }
631
+ ],
632
+ "returnType": "Promise<AnalyticsProperty[]>",
1042
633
  "isStatic": false,
1043
634
  "isPublic": true
635
+ }
636
+ },
637
+ "decoratorConfig": {},
638
+ "extends": "SmrtCollection",
639
+ "extendsTypeArg": "AnalyticsProperty",
640
+ "exportName": "AnalyticsPropertyCollection",
641
+ "collectionExportName": "AnalyticsPropertyCollectionCollection",
642
+ "schema": {
643
+ "tableName": "analytics_property_collections",
644
+ "ddl": "CREATE TABLE IF NOT EXISTS \"analytics_property_collections\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp\n);",
645
+ "columns": {
646
+ "id": {
647
+ "type": "UUID",
648
+ "primaryKey": true,
649
+ "referenceKind": "id",
650
+ "notNull": true
651
+ },
652
+ "slug": {
653
+ "type": "TEXT",
654
+ "notNull": true
655
+ },
656
+ "context": {
657
+ "type": "TEXT",
658
+ "notNull": true,
659
+ "default": ""
660
+ },
661
+ "created_at": {
662
+ "type": "TIMESTAMP",
663
+ "notNull": true,
664
+ "default": "current_timestamp"
665
+ },
666
+ "updated_at": {
667
+ "type": "TIMESTAMP",
668
+ "notNull": true,
669
+ "default": "current_timestamp"
670
+ }
1044
671
  },
1045
- "save": {
1046
- "name": "save",
672
+ "indexes": [
673
+ {
674
+ "name": "analytics_property_collections_id_idx",
675
+ "columns": [
676
+ "id"
677
+ ]
678
+ },
679
+ {
680
+ "name": "analytics_property_collections_slug_context_idx",
681
+ "columns": [
682
+ "slug",
683
+ "context"
684
+ ],
685
+ "unique": true
686
+ }
687
+ ],
688
+ "version": "a1c264b1"
689
+ }
690
+ },
691
+ "@happyvertical/smrt-analytics:AnalyticsReportCollection": {
692
+ "name": "analyticsreportcollection",
693
+ "className": "AnalyticsReportCollection",
694
+ "qualifiedName": "@happyvertical/smrt-analytics:AnalyticsReportCollection",
695
+ "collection": "analyticsreports",
696
+ "filePath": "/home/runner/_work/smrt/smrt/packages/analytics/src/collections/AnalyticsReportCollection.ts",
697
+ "packageName": "@happyvertical/smrt-analytics",
698
+ "fields": {},
699
+ "methods": {
700
+ "findByProperty": {
701
+ "name": "findByProperty",
1047
702
  "async": true,
1048
- "parameters": [],
1049
- "returnType": "any",
1050
- "isStatic": false,
1051
- "isPublic": true
1052
- },
1053
- "classifyConstraintError": {
1054
- "name": "classifyConstraintError",
1055
- "async": false,
1056
703
  "parameters": [
1057
704
  {
1058
- "name": "message",
705
+ "name": "propertyId",
1059
706
  "type": "string",
1060
707
  "optional": false
1061
708
  }
1062
709
  ],
1063
- "returnType": "'unique' | 'not_null' | null",
1064
- "isStatic": true,
1065
- "isPublic": true
1066
- },
1067
- "loadFromId": {
1068
- "name": "loadFromId",
1069
- "async": true,
1070
- "parameters": [],
1071
- "returnType": "any",
1072
- "isStatic": false,
1073
- "isPublic": true
1074
- },
1075
- "loadFromSlug": {
1076
- "name": "loadFromSlug",
1077
- "async": true,
1078
- "parameters": [],
1079
- "returnType": "any",
710
+ "returnType": "Promise<AnalyticsReport[]>",
1080
711
  "isStatic": false,
1081
712
  "isPublic": true
1082
713
  },
1083
- "is": {
1084
- "name": "is",
714
+ "findByStatus": {
715
+ "name": "findByStatus",
1085
716
  "async": true,
1086
717
  "parameters": [
1087
718
  {
1088
- "name": "criteria",
1089
- "type": "string",
719
+ "name": "status",
720
+ "type": "ReportStatus",
1090
721
  "optional": false
1091
- },
1092
- {
1093
- "name": "options",
1094
- "type": "AiOperationOptions",
1095
- "optional": true
1096
722
  }
1097
723
  ],
1098
- "returnType": "any",
724
+ "returnType": "Promise<AnalyticsReport[]>",
1099
725
  "isStatic": false,
1100
726
  "isPublic": true
1101
727
  },
1102
- "do": {
1103
- "name": "do",
728
+ "findDrafts": {
729
+ "name": "findDrafts",
1104
730
  "async": true,
1105
- "parameters": [
1106
- {
1107
- "name": "instructions",
1108
- "type": "string",
1109
- "optional": false
1110
- },
1111
- {
1112
- "name": "options",
1113
- "type": "AiOperationOptions",
1114
- "optional": true
1115
- }
1116
- ],
1117
- "returnType": "any",
731
+ "parameters": [],
732
+ "returnType": "Promise<AnalyticsReport[]>",
1118
733
  "isStatic": false,
1119
734
  "isPublic": true
1120
735
  },
1121
- "describe": {
1122
- "name": "describe",
736
+ "findScheduled": {
737
+ "name": "findScheduled",
1123
738
  "async": true,
1124
- "parameters": [
1125
- {
1126
- "name": "options",
1127
- "type": "AiOperationOptions",
1128
- "optional": true
1129
- }
1130
- ],
1131
- "returnType": "any",
739
+ "parameters": [],
740
+ "returnType": "Promise<AnalyticsReport[]>",
1132
741
  "isStatic": false,
1133
742
  "isPublic": true
1134
743
  },
1135
- "delete": {
1136
- "name": "delete",
744
+ "findCompleted": {
745
+ "name": "findCompleted",
1137
746
  "async": true,
1138
747
  "parameters": [],
1139
- "returnType": "Promise<void>",
748
+ "returnType": "Promise<AnalyticsReport[]>",
1140
749
  "isStatic": false,
1141
750
  "isPublic": true
1142
751
  },
1143
- "isRelatedLoaded": {
1144
- "name": "isRelatedLoaded",
1145
- "async": false,
1146
- "parameters": [
1147
- {
1148
- "name": "fieldName",
1149
- "type": "string",
1150
- "optional": false
1151
- }
1152
- ],
1153
- "returnType": "boolean",
752
+ "findFailed": {
753
+ "name": "findFailed",
754
+ "async": true,
755
+ "parameters": [],
756
+ "returnType": "Promise<AnalyticsReport[]>",
1154
757
  "isStatic": false,
1155
758
  "isPublic": true
1156
759
  },
1157
- "_setLoadedRelationship": {
1158
- "name": "_setLoadedRelationship",
1159
- "async": false,
760
+ "findByFrequency": {
761
+ "name": "findByFrequency",
762
+ "async": true,
1160
763
  "parameters": [
1161
764
  {
1162
- "name": "fieldName",
1163
- "type": "string",
1164
- "optional": false
1165
- },
1166
- {
1167
- "name": "value",
1168
- "type": "any",
765
+ "name": "frequency",
766
+ "type": "ReportFrequency",
1169
767
  "optional": false
1170
768
  }
1171
769
  ],
1172
- "returnType": "void",
770
+ "returnType": "Promise<AnalyticsReport[]>",
1173
771
  "isStatic": false,
1174
772
  "isPublic": true
1175
773
  },
1176
- "loadRelated": {
1177
- "name": "loadRelated",
774
+ "findRecurring": {
775
+ "name": "findRecurring",
1178
776
  "async": true,
1179
- "parameters": [
1180
- {
1181
- "name": "fieldName",
1182
- "type": "string",
1183
- "optional": false
1184
- },
1185
- {
1186
- "name": "opts",
1187
- "type": "LoadRelatedOptions",
1188
- "optional": true
1189
- }
1190
- ],
1191
- "returnType": "Promise<any>",
777
+ "parameters": [],
778
+ "returnType": "Promise<AnalyticsReport[]>",
1192
779
  "isStatic": false,
1193
780
  "isPublic": true
1194
781
  },
1195
- "loadRelatedMany": {
1196
- "name": "loadRelatedMany",
782
+ "findDue": {
783
+ "name": "findDue",
784
+ "async": true,
785
+ "parameters": [],
786
+ "returnType": "Promise<AnalyticsReport[]>",
787
+ "isStatic": false,
788
+ "isPublic": true
789
+ },
790
+ "findByPropertyAndStatus": {
791
+ "name": "findByPropertyAndStatus",
1197
792
  "async": true,
1198
793
  "parameters": [
1199
794
  {
1200
- "name": "fieldName",
795
+ "name": "propertyId",
1201
796
  "type": "string",
1202
797
  "optional": false
1203
798
  },
1204
799
  {
1205
- "name": "opts",
1206
- "type": "LoadRelatedOptions",
1207
- "optional": true
800
+ "name": "status",
801
+ "type": "ReportStatus",
802
+ "optional": false
1208
803
  }
1209
804
  ],
1210
- "returnType": "Promise<any[]>",
805
+ "returnType": "Promise<AnalyticsReport[]>",
1211
806
  "isStatic": false,
1212
807
  "isPublic": true
1213
808
  },
1214
- "getRelated": {
1215
- "name": "getRelated",
809
+ "findRecentlyRun": {
810
+ "name": "findRecentlyRun",
1216
811
  "async": true,
1217
812
  "parameters": [
1218
813
  {
1219
- "name": "fieldName",
1220
- "type": "string",
1221
- "optional": false
1222
- },
1223
- {
1224
- "name": "opts",
1225
- "type": "LoadRelatedOptions",
814
+ "name": "hoursAgo",
815
+ "type": "number",
1226
816
  "optional": true
1227
817
  }
1228
818
  ],
1229
- "returnType": "Promise<any>",
1230
- "isStatic": false,
1231
- "isPublic": true
1232
- },
1233
- "getAvailableTools": {
1234
- "name": "getAvailableTools",
1235
- "async": false,
1236
- "parameters": [],
1237
- "returnType": "AITool[]",
819
+ "returnType": "Promise<AnalyticsReport[]>",
820
+ "isStatic": false,
821
+ "isPublic": true
822
+ }
823
+ },
824
+ "decoratorConfig": {},
825
+ "extends": "SmrtCollection",
826
+ "extendsTypeArg": "AnalyticsReport",
827
+ "exportName": "AnalyticsReportCollection",
828
+ "collectionExportName": "AnalyticsReportCollectionCollection",
829
+ "schema": {
830
+ "tableName": "analytics_report_collections",
831
+ "ddl": "CREATE TABLE IF NOT EXISTS \"analytics_report_collections\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp\n);",
832
+ "columns": {
833
+ "id": {
834
+ "type": "UUID",
835
+ "primaryKey": true,
836
+ "referenceKind": "id",
837
+ "notNull": true
838
+ },
839
+ "slug": {
840
+ "type": "TEXT",
841
+ "notNull": true
842
+ },
843
+ "context": {
844
+ "type": "TEXT",
845
+ "notNull": true,
846
+ "default": ""
847
+ },
848
+ "created_at": {
849
+ "type": "TIMESTAMP",
850
+ "notNull": true,
851
+ "default": "current_timestamp"
852
+ },
853
+ "updated_at": {
854
+ "type": "TIMESTAMP",
855
+ "notNull": true,
856
+ "default": "current_timestamp"
857
+ }
858
+ },
859
+ "indexes": [
860
+ {
861
+ "name": "analytics_report_collections_id_idx",
862
+ "columns": [
863
+ "id"
864
+ ]
865
+ },
866
+ {
867
+ "name": "analytics_report_collections_slug_context_idx",
868
+ "columns": [
869
+ "slug",
870
+ "context"
871
+ ],
872
+ "unique": true
873
+ }
874
+ ],
875
+ "version": "74445ee1"
876
+ }
877
+ },
878
+ "@happyvertical/smrt-analytics:AnalyticsDataStream": {
879
+ "name": "analyticsdatastream",
880
+ "className": "AnalyticsDataStream",
881
+ "qualifiedName": "@happyvertical/smrt-analytics:AnalyticsDataStream",
882
+ "collection": "analyticsdatastreams",
883
+ "filePath": "/home/runner/_work/smrt/smrt/packages/analytics/src/models/AnalyticsDataStream.ts",
884
+ "packageName": "@happyvertical/smrt-analytics",
885
+ "fields": {
886
+ "created_at": {
887
+ "type": "datetime",
888
+ "required": false
889
+ },
890
+ "updated_at": {
891
+ "type": "datetime",
892
+ "required": false
893
+ },
894
+ "tenantId": {
895
+ "type": "text",
896
+ "required": false,
897
+ "_meta": {
898
+ "sqlType": "UUID",
899
+ "nullable": true,
900
+ "__tenancy": {
901
+ "isTenantIdField": true,
902
+ "autoFilter": true,
903
+ "required": false,
904
+ "autoPopulate": true,
905
+ "nullable": true,
906
+ "mode": "optional",
907
+ "field": "tenantId",
908
+ "allowSuperAdminBypass": false
909
+ }
910
+ }
911
+ },
912
+ "propertyId": {
913
+ "type": "foreignKey",
914
+ "required": false,
915
+ "related": "AnalyticsProperty"
916
+ },
917
+ "displayName": {
918
+ "type": "text",
919
+ "required": false,
920
+ "default": ""
921
+ },
922
+ "streamType": {
923
+ "type": "text",
924
+ "required": false
925
+ },
926
+ "externalId": {
927
+ "type": "text",
928
+ "required": false,
929
+ "default": ""
930
+ },
931
+ "measurementId": {
932
+ "type": "text",
933
+ "required": false,
934
+ "default": ""
935
+ },
936
+ "firebaseAppId": {
937
+ "type": "text",
938
+ "required": false,
939
+ "default": ""
940
+ },
941
+ "defaultUri": {
942
+ "type": "text",
943
+ "required": false,
944
+ "default": ""
945
+ },
946
+ "bundleId": {
947
+ "type": "text",
948
+ "required": false,
949
+ "default": ""
950
+ },
951
+ "packageName": {
952
+ "type": "text",
953
+ "required": false,
954
+ "default": ""
955
+ },
956
+ "status": {
957
+ "type": "text",
958
+ "required": false
959
+ },
960
+ "enhancedMeasurement": {
961
+ "type": "boolean",
962
+ "required": false,
963
+ "default": true
964
+ }
965
+ },
966
+ "methods": {
967
+ "getAiUsageSnapshot": {
968
+ "name": "getAiUsageSnapshot",
969
+ "async": false,
970
+ "parameters": [],
971
+ "returnType": "AiUsageSnapshot | undefined",
972
+ "isStatic": false,
973
+ "isPublic": true
974
+ },
975
+ "resetAiUsage": {
976
+ "name": "resetAiUsage",
977
+ "async": false,
978
+ "parameters": [],
979
+ "returnType": "void",
980
+ "isStatic": false,
981
+ "isPublic": true
982
+ },
983
+ "listAiUsage": {
984
+ "name": "listAiUsage",
985
+ "async": true,
986
+ "parameters": [
987
+ {
988
+ "name": "options",
989
+ "type": "AiUsageListOptions",
990
+ "optional": true
991
+ }
992
+ ],
993
+ "returnType": "Promise<SmrtAiUsageRecord[]>",
994
+ "isStatic": false,
995
+ "isPublic": true
996
+ },
997
+ "summarizeAiUsage": {
998
+ "name": "summarizeAiUsage",
999
+ "async": true,
1000
+ "parameters": [
1001
+ {
1002
+ "name": "options",
1003
+ "type": "AiUsageSummaryOptions",
1004
+ "optional": true
1005
+ }
1006
+ ],
1007
+ "returnType": "Promise<Record<string, AiUsageStats>>",
1008
+ "isStatic": false,
1009
+ "isPublic": true
1010
+ },
1011
+ "destroy": {
1012
+ "name": "destroy",
1013
+ "async": false,
1014
+ "parameters": [],
1015
+ "returnType": "void",
1016
+ "isStatic": false,
1017
+ "isPublic": true
1018
+ },
1019
+ "markAsPersisted": {
1020
+ "name": "markAsPersisted",
1021
+ "async": false,
1022
+ "parameters": [],
1023
+ "returnType": "void",
1024
+ "isStatic": false,
1025
+ "isPublic": true
1026
+ },
1027
+ "requireInsertOnSave": {
1028
+ "name": "requireInsertOnSave",
1029
+ "async": false,
1030
+ "parameters": [],
1031
+ "returnType": "void",
1032
+ "isStatic": false,
1033
+ "isPublic": true
1034
+ },
1035
+ "initialize": {
1036
+ "name": "initialize",
1037
+ "async": true,
1038
+ "parameters": [],
1039
+ "returnType": "Promise",
1040
+ "isStatic": false,
1041
+ "isPublic": true
1042
+ },
1043
+ "loadDataFromDb": {
1044
+ "name": "loadDataFromDb",
1045
+ "async": true,
1046
+ "parameters": [
1047
+ {
1048
+ "name": "data",
1049
+ "type": "Record<string>",
1050
+ "optional": false
1051
+ }
1052
+ ],
1053
+ "returnType": "any",
1054
+ "isStatic": false,
1055
+ "isPublic": true
1056
+ },
1057
+ "getFields": {
1058
+ "name": "getFields",
1059
+ "async": true,
1060
+ "parameters": [],
1061
+ "returnType": "Promise<any>",
1062
+ "isStatic": false,
1063
+ "isPublic": true
1064
+ },
1065
+ "toJSON": {
1066
+ "name": "toJSON",
1067
+ "async": false,
1068
+ "parameters": [],
1069
+ "returnType": "any",
1070
+ "isStatic": false,
1071
+ "isPublic": true
1072
+ },
1073
+ "toPlainObject": {
1074
+ "name": "toPlainObject",
1075
+ "async": false,
1076
+ "parameters": [],
1077
+ "returnType": "Record<string>",
1078
+ "isStatic": false,
1079
+ "isPublic": true
1080
+ },
1081
+ "toPublicJSON": {
1082
+ "name": "toPublicJSON",
1083
+ "async": false,
1084
+ "parameters": [
1085
+ {
1086
+ "name": "options",
1087
+ "type": "PublicJsonOptions",
1088
+ "optional": true
1089
+ }
1090
+ ],
1091
+ "returnType": "Record<string>",
1092
+ "isStatic": false,
1093
+ "isPublic": true
1094
+ },
1095
+ "getId": {
1096
+ "name": "getId",
1097
+ "async": true,
1098
+ "parameters": [],
1099
+ "returnType": "any",
1100
+ "isStatic": false,
1101
+ "isPublic": true
1102
+ },
1103
+ "getSlug": {
1104
+ "name": "getSlug",
1105
+ "async": true,
1106
+ "parameters": [],
1107
+ "returnType": "any",
1108
+ "isStatic": false,
1109
+ "isPublic": true
1110
+ },
1111
+ "getSavedId": {
1112
+ "name": "getSavedId",
1113
+ "async": true,
1114
+ "parameters": [],
1115
+ "returnType": "any",
1116
+ "isStatic": false,
1117
+ "isPublic": true
1118
+ },
1119
+ "isSaved": {
1120
+ "name": "isSaved",
1121
+ "async": true,
1122
+ "parameters": [],
1123
+ "returnType": "any",
1124
+ "isStatic": false,
1125
+ "isPublic": true
1126
+ },
1127
+ "save": {
1128
+ "name": "save",
1129
+ "async": true,
1130
+ "parameters": [],
1131
+ "returnType": "any",
1132
+ "isStatic": false,
1133
+ "isPublic": true
1134
+ },
1135
+ "classifyConstraintError": {
1136
+ "name": "classifyConstraintError",
1137
+ "async": false,
1138
+ "parameters": [
1139
+ {
1140
+ "name": "message",
1141
+ "type": "string",
1142
+ "optional": false
1143
+ }
1144
+ ],
1145
+ "returnType": "'unique' | 'not_null' | null",
1146
+ "isStatic": true,
1147
+ "isPublic": true
1148
+ },
1149
+ "loadFromId": {
1150
+ "name": "loadFromId",
1151
+ "async": true,
1152
+ "parameters": [],
1153
+ "returnType": "any",
1154
+ "isStatic": false,
1155
+ "isPublic": true
1156
+ },
1157
+ "loadFromSlug": {
1158
+ "name": "loadFromSlug",
1159
+ "async": true,
1160
+ "parameters": [],
1161
+ "returnType": "any",
1162
+ "isStatic": false,
1163
+ "isPublic": true
1164
+ },
1165
+ "is": {
1166
+ "name": "is",
1167
+ "async": true,
1168
+ "parameters": [
1169
+ {
1170
+ "name": "criteria",
1171
+ "type": "string",
1172
+ "optional": false
1173
+ },
1174
+ {
1175
+ "name": "options",
1176
+ "type": "AiOperationOptions",
1177
+ "optional": true
1178
+ }
1179
+ ],
1180
+ "returnType": "any",
1181
+ "isStatic": false,
1182
+ "isPublic": true
1183
+ },
1184
+ "do": {
1185
+ "name": "do",
1186
+ "async": true,
1187
+ "parameters": [
1188
+ {
1189
+ "name": "instructions",
1190
+ "type": "string",
1191
+ "optional": false
1192
+ },
1193
+ {
1194
+ "name": "options",
1195
+ "type": "AiOperationOptions",
1196
+ "optional": true
1197
+ }
1198
+ ],
1199
+ "returnType": "any",
1200
+ "isStatic": false,
1201
+ "isPublic": true
1202
+ },
1203
+ "describe": {
1204
+ "name": "describe",
1205
+ "async": true,
1206
+ "parameters": [
1207
+ {
1208
+ "name": "options",
1209
+ "type": "AiOperationOptions",
1210
+ "optional": true
1211
+ }
1212
+ ],
1213
+ "returnType": "any",
1214
+ "isStatic": false,
1215
+ "isPublic": true
1216
+ },
1217
+ "delete": {
1218
+ "name": "delete",
1219
+ "async": true,
1220
+ "parameters": [],
1221
+ "returnType": "Promise<void>",
1222
+ "isStatic": false,
1223
+ "isPublic": true
1224
+ },
1225
+ "isRelatedLoaded": {
1226
+ "name": "isRelatedLoaded",
1227
+ "async": false,
1228
+ "parameters": [
1229
+ {
1230
+ "name": "fieldName",
1231
+ "type": "string",
1232
+ "optional": false
1233
+ }
1234
+ ],
1235
+ "returnType": "boolean",
1236
+ "isStatic": false,
1237
+ "isPublic": true
1238
+ },
1239
+ "_setLoadedRelationship": {
1240
+ "name": "_setLoadedRelationship",
1241
+ "async": false,
1242
+ "parameters": [
1243
+ {
1244
+ "name": "fieldName",
1245
+ "type": "string",
1246
+ "optional": false
1247
+ },
1248
+ {
1249
+ "name": "value",
1250
+ "type": "any",
1251
+ "optional": false
1252
+ }
1253
+ ],
1254
+ "returnType": "void",
1255
+ "isStatic": false,
1256
+ "isPublic": true
1257
+ },
1258
+ "loadRelated": {
1259
+ "name": "loadRelated",
1260
+ "async": true,
1261
+ "parameters": [
1262
+ {
1263
+ "name": "fieldName",
1264
+ "type": "string",
1265
+ "optional": false
1266
+ },
1267
+ {
1268
+ "name": "opts",
1269
+ "type": "LoadRelatedOptions",
1270
+ "optional": true
1271
+ }
1272
+ ],
1273
+ "returnType": "Promise<any>",
1274
+ "isStatic": false,
1275
+ "isPublic": true
1276
+ },
1277
+ "loadRelatedMany": {
1278
+ "name": "loadRelatedMany",
1279
+ "async": true,
1280
+ "parameters": [
1281
+ {
1282
+ "name": "fieldName",
1283
+ "type": "string",
1284
+ "optional": false
1285
+ },
1286
+ {
1287
+ "name": "opts",
1288
+ "type": "LoadRelatedOptions",
1289
+ "optional": true
1290
+ }
1291
+ ],
1292
+ "returnType": "Promise<any[]>",
1293
+ "isStatic": false,
1294
+ "isPublic": true
1295
+ },
1296
+ "getRelated": {
1297
+ "name": "getRelated",
1298
+ "async": true,
1299
+ "parameters": [
1300
+ {
1301
+ "name": "fieldName",
1302
+ "type": "string",
1303
+ "optional": false
1304
+ },
1305
+ {
1306
+ "name": "opts",
1307
+ "type": "LoadRelatedOptions",
1308
+ "optional": true
1309
+ }
1310
+ ],
1311
+ "returnType": "Promise<any>",
1312
+ "isStatic": false,
1313
+ "isPublic": true
1314
+ },
1315
+ "getAvailableTools": {
1316
+ "name": "getAvailableTools",
1317
+ "async": false,
1318
+ "parameters": [],
1319
+ "returnType": "AITool[]",
1238
1320
  "isStatic": false,
1239
1321
  "isPublic": true
1240
1322
  },
@@ -1371,112 +1453,43 @@
1371
1453
  "isStatic": false,
1372
1454
  "isPublic": true
1373
1455
  },
1374
- "getParams": {
1375
- "name": "getParams",
1376
- "async": false,
1377
- "parameters": [],
1378
- "returnType": "Record<string, string | number | boolean>",
1379
- "isStatic": false,
1380
- "isPublic": true
1381
- },
1382
- "setParams": {
1383
- "name": "setParams",
1384
- "async": false,
1385
- "parameters": [
1386
- {
1387
- "name": "params",
1388
- "type": "Record<string, string | number | boolean>",
1389
- "optional": false
1390
- }
1391
- ],
1392
- "returnType": "void",
1393
- "isStatic": false,
1394
- "isPublic": true
1395
- },
1396
- "addParam": {
1397
- "name": "addParam",
1398
- "async": false,
1399
- "parameters": [
1400
- {
1401
- "name": "key",
1402
- "type": "string",
1403
- "optional": false
1404
- },
1405
- {
1406
- "name": "value",
1407
- "type": "string | number | boolean",
1408
- "optional": false
1409
- }
1410
- ],
1411
- "returnType": "void",
1412
- "isStatic": false,
1413
- "isPublic": true
1414
- },
1415
- "isPageview": {
1416
- "name": "isPageview",
1456
+ "isWeb": {
1457
+ "name": "isWeb",
1417
1458
  "async": false,
1418
1459
  "parameters": [],
1419
1460
  "returnType": "boolean",
1420
1461
  "isStatic": false,
1421
1462
  "isPublic": true
1422
1463
  },
1423
- "isConversion": {
1424
- "name": "isConversion",
1464
+ "isIOS": {
1465
+ "name": "isIOS",
1425
1466
  "async": false,
1426
1467
  "parameters": [],
1427
1468
  "returnType": "boolean",
1428
1469
  "isStatic": false,
1429
1470
  "isPublic": true
1430
- },
1431
- "markSent": {
1432
- "name": "markSent",
1433
- "async": false,
1434
- "parameters": [],
1435
- "returnType": "void",
1436
- "isStatic": false,
1437
- "isPublic": true
1438
- },
1439
- "markFailed": {
1440
- "name": "markFailed",
1441
- "async": false,
1442
- "parameters": [
1443
- {
1444
- "name": "error",
1445
- "type": "string",
1446
- "optional": false
1447
- }
1448
- ],
1449
- "returnType": "void",
1450
- "isStatic": false,
1451
- "isPublic": true
1452
- },
1453
- "resetForRetry": {
1454
- "name": "resetForRetry",
1471
+ },
1472
+ "isAndroid": {
1473
+ "name": "isAndroid",
1455
1474
  "async": false,
1456
1475
  "parameters": [],
1457
- "returnType": "void",
1476
+ "returnType": "boolean",
1458
1477
  "isStatic": false,
1459
1478
  "isPublic": true
1460
1479
  },
1461
- "shouldRetry": {
1462
- "name": "shouldRetry",
1480
+ "isMobileApp": {
1481
+ "name": "isMobileApp",
1463
1482
  "async": false,
1464
- "parameters": [
1465
- {
1466
- "name": "maxRetries",
1467
- "type": "number",
1468
- "optional": true
1469
- }
1470
- ],
1483
+ "parameters": [],
1471
1484
  "returnType": "boolean",
1472
1485
  "isStatic": false,
1473
1486
  "isPublic": true
1474
1487
  },
1475
- "toTrackEvent": {
1476
- "name": "toTrackEvent",
1488
+ "getPlatformId": {
1489
+ "name": "getPlatformId",
1477
1490
  "async": false,
1478
1491
  "parameters": [],
1479
- "returnType": "object",
1492
+ "returnType": "string",
1480
1493
  "isStatic": false,
1481
1494
  "isPublic": true
1482
1495
  }
@@ -1487,14 +1500,14 @@
1487
1500
  "include": [
1488
1501
  "list",
1489
1502
  "get",
1490
- "create"
1503
+ "create",
1504
+ "update"
1491
1505
  ]
1492
1506
  },
1493
1507
  "mcp": {
1494
1508
  "include": [
1495
1509
  "list",
1496
- "get",
1497
- "track"
1510
+ "get"
1498
1511
  ]
1499
1512
  },
1500
1513
  "cli": true,
@@ -1503,11 +1516,11 @@
1503
1516
  }
1504
1517
  },
1505
1518
  "extends": "SmrtObject",
1506
- "exportName": "AnalyticsEvent",
1507
- "collectionExportName": "AnalyticsEventCollection",
1519
+ "exportName": "AnalyticsDataStream",
1520
+ "collectionExportName": "AnalyticsDataStreamCollection",
1508
1521
  "schema": {
1509
- "tableName": "analytics_events",
1510
- "ddl": "CREATE TABLE IF NOT EXISTS \"analytics_events\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"_meta_type\" TEXT NOT NULL,\n \"_meta_data\" JSON,\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID,\n \"property_id\" UUID,\n \"event_name\" TEXT DEFAULT '',\n \"client_id\" TEXT DEFAULT '',\n \"user_id\" TEXT DEFAULT '',\n \"params\" TEXT DEFAULT '{}',\n \"event_timestamp\" TIMESTAMP,\n \"status\" TEXT,\n \"sent_at\" TIMESTAMP,\n \"error_message\" TEXT DEFAULT '',\n \"retry_count\" INTEGER DEFAULT 0,\n \"non_personalized_ads\" BOOLEAN DEFAULT FALSE,\n \"session_id\" TEXT DEFAULT '',\n \"page_path\" TEXT DEFAULT '',\n \"page_title\" TEXT DEFAULT '',\n \"user_agent\" TEXT DEFAULT '',\n \"ip_address\" TEXT DEFAULT ''\n);",
1522
+ "tableName": "analytics_data_streams",
1523
+ "ddl": "CREATE TABLE IF NOT EXISTS \"analytics_data_streams\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"_meta_type\" TEXT NOT NULL,\n \"_meta_data\" JSON,\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID,\n \"property_id\" UUID,\n \"display_name\" TEXT DEFAULT '',\n \"stream_type\" TEXT,\n \"external_id\" TEXT DEFAULT '',\n \"measurement_id\" TEXT DEFAULT '',\n \"firebase_app_id\" TEXT DEFAULT '',\n \"default_uri\" TEXT DEFAULT '',\n \"bundle_id\" TEXT DEFAULT '',\n \"package_name\" TEXT DEFAULT '',\n \"status\" TEXT,\n \"enhanced_measurement\" BOOLEAN DEFAULT TRUE\n);",
1511
1524
  "columns": {
1512
1525
  "id": {
1513
1526
  "type": "UUID",
@@ -1552,88 +1565,64 @@
1552
1565
  "referenceKind": "foreignKey",
1553
1566
  "notNull": false
1554
1567
  },
1555
- "event_name": {
1568
+ "display_name": {
1556
1569
  "type": "TEXT",
1557
1570
  "notNull": false,
1558
1571
  "default": ""
1559
1572
  },
1560
- "client_id": {
1573
+ "stream_type": {
1561
1574
  "type": "TEXT",
1562
- "notNull": false,
1563
- "default": ""
1575
+ "notNull": false
1564
1576
  },
1565
- "user_id": {
1577
+ "external_id": {
1566
1578
  "type": "TEXT",
1567
1579
  "notNull": false,
1568
1580
  "default": ""
1569
1581
  },
1570
- "params": {
1571
- "type": "TEXT",
1572
- "notNull": false,
1573
- "default": "{}"
1574
- },
1575
- "event_timestamp": {
1576
- "type": "TIMESTAMP",
1577
- "notNull": false
1578
- },
1579
- "status": {
1580
- "type": "TEXT",
1581
- "notNull": false
1582
- },
1583
- "sent_at": {
1584
- "type": "TIMESTAMP",
1585
- "notNull": false
1586
- },
1587
- "error_message": {
1582
+ "measurement_id": {
1588
1583
  "type": "TEXT",
1589
1584
  "notNull": false,
1590
1585
  "default": ""
1591
1586
  },
1592
- "retry_count": {
1593
- "type": "INTEGER",
1594
- "notNull": false,
1595
- "default": 0
1596
- },
1597
- "non_personalized_ads": {
1598
- "type": "BOOLEAN",
1599
- "notNull": false,
1600
- "default": false
1601
- },
1602
- "session_id": {
1587
+ "firebase_app_id": {
1603
1588
  "type": "TEXT",
1604
1589
  "notNull": false,
1605
1590
  "default": ""
1606
1591
  },
1607
- "page_path": {
1592
+ "default_uri": {
1608
1593
  "type": "TEXT",
1609
1594
  "notNull": false,
1610
1595
  "default": ""
1611
1596
  },
1612
- "page_title": {
1597
+ "bundle_id": {
1613
1598
  "type": "TEXT",
1614
1599
  "notNull": false,
1615
1600
  "default": ""
1616
1601
  },
1617
- "user_agent": {
1602
+ "package_name": {
1618
1603
  "type": "TEXT",
1619
1604
  "notNull": false,
1620
1605
  "default": ""
1621
1606
  },
1622
- "ip_address": {
1607
+ "status": {
1623
1608
  "type": "TEXT",
1609
+ "notNull": false
1610
+ },
1611
+ "enhanced_measurement": {
1612
+ "type": "BOOLEAN",
1624
1613
  "notNull": false,
1625
- "default": ""
1614
+ "default": true
1626
1615
  }
1627
1616
  },
1628
1617
  "indexes": [
1629
1618
  {
1630
- "name": "analytics_events_id_idx",
1619
+ "name": "analytics_data_streams_id_idx",
1631
1620
  "columns": [
1632
1621
  "id"
1633
1622
  ]
1634
1623
  },
1635
1624
  {
1636
- "name": "analytics_events_slug_context_meta_type_idx",
1625
+ "name": "analytics_data_streams_slug_context_meta_type_idx",
1637
1626
  "columns": [
1638
1627
  "slug",
1639
1628
  "context",
@@ -1642,21 +1631,21 @@
1642
1631
  "unique": true
1643
1632
  },
1644
1633
  {
1645
- "name": "analytics_events_meta_type_idx",
1634
+ "name": "analytics_data_streams_meta_type_idx",
1646
1635
  "columns": [
1647
1636
  "_meta_type"
1648
1637
  ]
1649
1638
  }
1650
1639
  ],
1651
- "version": "8c2447ff"
1640
+ "version": "e1ae416d"
1652
1641
  }
1653
1642
  },
1654
- "@happyvertical/smrt-analytics:AnalyticsProperty": {
1655
- "name": "analyticsproperty",
1656
- "className": "AnalyticsProperty",
1657
- "qualifiedName": "@happyvertical/smrt-analytics:AnalyticsProperty",
1658
- "collection": "analyticsproperties",
1659
- "filePath": "/home/runner/_work/smrt/smrt/packages/analytics/src/models/AnalyticsProperty.ts",
1643
+ "@happyvertical/smrt-analytics:AnalyticsEvent": {
1644
+ "name": "analyticsevent",
1645
+ "className": "AnalyticsEvent",
1646
+ "qualifiedName": "@happyvertical/smrt-analytics:AnalyticsEvent",
1647
+ "collection": "analyticsevents",
1648
+ "filePath": "/home/runner/_work/smrt/smrt/packages/analytics/src/models/AnalyticsEvent.ts",
1660
1649
  "packageName": "@happyvertical/smrt-analytics",
1661
1650
  "fields": {
1662
1651
  "created_at": {
@@ -1685,80 +1674,82 @@
1685
1674
  }
1686
1675
  }
1687
1676
  },
1688
- "name": {
1689
- "type": "text",
1677
+ "propertyId": {
1678
+ "type": "foreignKey",
1690
1679
  "required": false,
1691
- "default": ""
1680
+ "related": "AnalyticsProperty"
1692
1681
  },
1693
- "displayName": {
1682
+ "eventName": {
1694
1683
  "type": "text",
1695
1684
  "required": false,
1696
1685
  "default": ""
1697
1686
  },
1698
- "provider": {
1699
- "type": "text",
1700
- "required": false
1701
- },
1702
- "externalId": {
1687
+ "clientId": {
1703
1688
  "type": "text",
1704
1689
  "required": false,
1705
1690
  "default": ""
1706
1691
  },
1707
- "measurementId": {
1692
+ "userId": {
1708
1693
  "type": "text",
1709
1694
  "required": false,
1710
1695
  "default": ""
1711
1696
  },
1712
- "apiSecret": {
1697
+ "params": {
1713
1698
  "type": "text",
1714
1699
  "required": false,
1715
- "default": "",
1716
- "_meta": {
1717
- "sensitive": true
1718
- },
1719
- "sensitive": true
1700
+ "default": "{}"
1720
1701
  },
1721
- "siteDomain": {
1702
+ "eventTimestamp": {
1703
+ "type": "datetime",
1704
+ "required": false
1705
+ },
1706
+ "status": {
1707
+ "type": "text",
1708
+ "required": false
1709
+ },
1710
+ "sentAt": {
1711
+ "type": "datetime",
1712
+ "required": false
1713
+ },
1714
+ "errorMessage": {
1722
1715
  "type": "text",
1723
1716
  "required": false,
1724
1717
  "default": ""
1725
1718
  },
1726
- "timeZone": {
1727
- "type": "text",
1719
+ "retryCount": {
1720
+ "type": "integer",
1728
1721
  "required": false,
1729
- "default": "America/Los_Angeles"
1722
+ "default": 0
1730
1723
  },
1731
- "currencyCode": {
1732
- "type": "text",
1724
+ "nonPersonalizedAds": {
1725
+ "type": "boolean",
1733
1726
  "required": false,
1734
- "default": "USD"
1727
+ "default": false
1735
1728
  },
1736
- "industryCategory": {
1729
+ "sessionId": {
1737
1730
  "type": "text",
1738
1731
  "required": false,
1739
1732
  "default": ""
1740
1733
  },
1741
- "serviceLevel": {
1734
+ "pagePath": {
1742
1735
  "type": "text",
1743
1736
  "required": false,
1744
- "default": "STANDARD"
1737
+ "default": ""
1745
1738
  },
1746
- "status": {
1739
+ "pageTitle": {
1747
1740
  "type": "text",
1748
- "required": false
1741
+ "required": false,
1742
+ "default": ""
1749
1743
  },
1750
- "lastSyncAt": {
1751
- "type": "datetime",
1752
- "required": false
1744
+ "userAgent": {
1745
+ "type": "text",
1746
+ "required": false,
1747
+ "default": ""
1753
1748
  },
1754
- "providerMetadata": {
1749
+ "ipAddress": {
1755
1750
  "type": "text",
1756
1751
  "required": false,
1757
- "default": "{}",
1758
- "_meta": {
1759
- "sensitive": true
1760
- },
1761
- "sensitive": true
1752
+ "default": ""
1762
1753
  }
1763
1754
  },
1764
1755
  "methods": {
@@ -2251,45 +2242,78 @@
2251
2242
  "isStatic": false,
2252
2243
  "isPublic": true
2253
2244
  },
2254
- "isGA4": {
2255
- "name": "isGA4",
2245
+ "getParams": {
2246
+ "name": "getParams",
2256
2247
  "async": false,
2257
2248
  "parameters": [],
2258
- "returnType": "boolean",
2249
+ "returnType": "Record<string, string | number | boolean>",
2259
2250
  "isStatic": false,
2260
2251
  "isPublic": true
2261
2252
  },
2262
- "isPlausible": {
2263
- "name": "isPlausible",
2253
+ "setParams": {
2254
+ "name": "setParams",
2255
+ "async": false,
2256
+ "parameters": [
2257
+ {
2258
+ "name": "params",
2259
+ "type": "Record<string, string | number | boolean>",
2260
+ "optional": false
2261
+ }
2262
+ ],
2263
+ "returnType": "void",
2264
+ "isStatic": false,
2265
+ "isPublic": true
2266
+ },
2267
+ "addParam": {
2268
+ "name": "addParam",
2269
+ "async": false,
2270
+ "parameters": [
2271
+ {
2272
+ "name": "key",
2273
+ "type": "string",
2274
+ "optional": false
2275
+ },
2276
+ {
2277
+ "name": "value",
2278
+ "type": "string | number | boolean",
2279
+ "optional": false
2280
+ }
2281
+ ],
2282
+ "returnType": "void",
2283
+ "isStatic": false,
2284
+ "isPublic": true
2285
+ },
2286
+ "isPageview": {
2287
+ "name": "isPageview",
2264
2288
  "async": false,
2265
2289
  "parameters": [],
2266
2290
  "returnType": "boolean",
2267
2291
  "isStatic": false,
2268
2292
  "isPublic": true
2269
2293
  },
2270
- "isMatomo": {
2271
- "name": "isMatomo",
2294
+ "isConversion": {
2295
+ "name": "isConversion",
2272
2296
  "async": false,
2273
2297
  "parameters": [],
2274
2298
  "returnType": "boolean",
2275
2299
  "isStatic": false,
2276
2300
  "isPublic": true
2277
2301
  },
2278
- "getProviderMetadata": {
2279
- "name": "getProviderMetadata",
2302
+ "markSent": {
2303
+ "name": "markSent",
2280
2304
  "async": false,
2281
2305
  "parameters": [],
2282
- "returnType": "Record<string>",
2306
+ "returnType": "void",
2283
2307
  "isStatic": false,
2284
2308
  "isPublic": true
2285
2309
  },
2286
- "setProviderMetadata": {
2287
- "name": "setProviderMetadata",
2310
+ "markFailed": {
2311
+ "name": "markFailed",
2288
2312
  "async": false,
2289
2313
  "parameters": [
2290
2314
  {
2291
- "name": "metadata",
2292
- "type": "Record<string>",
2315
+ "name": "error",
2316
+ "type": "string",
2293
2317
  "optional": false
2294
2318
  }
2295
2319
  ],
@@ -2297,33 +2321,33 @@
2297
2321
  "isStatic": false,
2298
2322
  "isPublic": true
2299
2323
  },
2300
- "markSynced": {
2301
- "name": "markSynced",
2324
+ "resetForRetry": {
2325
+ "name": "resetForRetry",
2302
2326
  "async": false,
2303
2327
  "parameters": [],
2304
2328
  "returnType": "void",
2305
2329
  "isStatic": false,
2306
2330
  "isPublic": true
2307
2331
  },
2308
- "analyzePerformance": {
2309
- "name": "analyzePerformance",
2310
- "async": true,
2332
+ "shouldRetry": {
2333
+ "name": "shouldRetry",
2334
+ "async": false,
2311
2335
  "parameters": [
2312
2336
  {
2313
- "name": "options",
2314
- "type": "object",
2337
+ "name": "maxRetries",
2338
+ "type": "number",
2315
2339
  "optional": true
2316
2340
  }
2317
2341
  ],
2318
- "returnType": "Promise<object>",
2342
+ "returnType": "boolean",
2319
2343
  "isStatic": false,
2320
2344
  "isPublic": true
2321
2345
  },
2322
- "isPerformingWell": {
2323
- "name": "isPerformingWell",
2324
- "async": true,
2346
+ "toTrackEvent": {
2347
+ "name": "toTrackEvent",
2348
+ "async": false,
2325
2349
  "parameters": [],
2326
- "returnType": "Promise<boolean>",
2350
+ "returnType": "object",
2327
2351
  "isStatic": false,
2328
2352
  "isPublic": true
2329
2353
  }
@@ -2334,16 +2358,14 @@
2334
2358
  "include": [
2335
2359
  "list",
2336
2360
  "get",
2337
- "create",
2338
- "update"
2361
+ "create"
2339
2362
  ]
2340
2363
  },
2341
2364
  "mcp": {
2342
2365
  "include": [
2343
2366
  "list",
2344
2367
  "get",
2345
- "sync",
2346
- "runReport"
2368
+ "track"
2347
2369
  ]
2348
2370
  },
2349
2371
  "cli": true,
@@ -2352,11 +2374,11 @@
2352
2374
  }
2353
2375
  },
2354
2376
  "extends": "SmrtObject",
2355
- "exportName": "AnalyticsProperty",
2356
- "collectionExportName": "AnalyticsPropertyCollection",
2377
+ "exportName": "AnalyticsEvent",
2378
+ "collectionExportName": "AnalyticsEventCollection",
2357
2379
  "schema": {
2358
- "tableName": "analytics_properties",
2359
- "ddl": "CREATE TABLE IF NOT EXISTS \"analytics_properties\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"_meta_type\" TEXT NOT NULL,\n \"_meta_data\" JSON,\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID,\n \"name\" TEXT DEFAULT '',\n \"display_name\" TEXT DEFAULT '',\n \"provider\" TEXT,\n \"external_id\" TEXT DEFAULT '',\n \"measurement_id\" TEXT DEFAULT '',\n \"api_secret\" TEXT DEFAULT '',\n \"site_domain\" TEXT DEFAULT '',\n \"time_zone\" TEXT DEFAULT 'America/Los_Angeles',\n \"currency_code\" TEXT DEFAULT 'USD',\n \"industry_category\" TEXT DEFAULT '',\n \"service_level\" TEXT DEFAULT 'STANDARD',\n \"status\" TEXT,\n \"last_sync_at\" TIMESTAMP,\n \"provider_metadata\" TEXT DEFAULT '{}'\n);",
2380
+ "tableName": "analytics_events",
2381
+ "ddl": "CREATE TABLE IF NOT EXISTS \"analytics_events\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"_meta_type\" TEXT NOT NULL,\n \"_meta_data\" JSON,\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID,\n \"property_id\" UUID,\n \"event_name\" TEXT DEFAULT '',\n \"client_id\" TEXT DEFAULT '',\n \"user_id\" TEXT DEFAULT '',\n \"params\" TEXT DEFAULT '{}',\n \"event_timestamp\" TIMESTAMP,\n \"status\" TEXT,\n \"sent_at\" TIMESTAMP,\n \"error_message\" TEXT DEFAULT '',\n \"retry_count\" INTEGER DEFAULT 0,\n \"non_personalized_ads\" BOOLEAN DEFAULT FALSE,\n \"session_id\" TEXT DEFAULT '',\n \"page_path\" TEXT DEFAULT '',\n \"page_title\" TEXT DEFAULT '',\n \"user_agent\" TEXT DEFAULT '',\n \"ip_address\" TEXT DEFAULT ''\n);",
2360
2382
  "columns": {
2361
2383
  "id": {
2362
2384
  "type": "UUID",
@@ -2396,83 +2418,93 @@
2396
2418
  "referenceKind": "tenantId",
2397
2419
  "notNull": false
2398
2420
  },
2399
- "name": {
2421
+ "property_id": {
2422
+ "type": "UUID",
2423
+ "referenceKind": "foreignKey",
2424
+ "notNull": false
2425
+ },
2426
+ "event_name": {
2400
2427
  "type": "TEXT",
2401
2428
  "notNull": false,
2402
2429
  "default": ""
2403
2430
  },
2404
- "display_name": {
2431
+ "client_id": {
2405
2432
  "type": "TEXT",
2406
2433
  "notNull": false,
2407
2434
  "default": ""
2408
2435
  },
2409
- "provider": {
2410
- "type": "TEXT",
2411
- "notNull": false
2412
- },
2413
- "external_id": {
2436
+ "user_id": {
2414
2437
  "type": "TEXT",
2415
2438
  "notNull": false,
2416
2439
  "default": ""
2417
2440
  },
2418
- "measurement_id": {
2441
+ "params": {
2419
2442
  "type": "TEXT",
2420
2443
  "notNull": false,
2421
- "default": ""
2444
+ "default": "{}"
2422
2445
  },
2423
- "api_secret": {
2446
+ "event_timestamp": {
2447
+ "type": "TIMESTAMP",
2448
+ "notNull": false
2449
+ },
2450
+ "status": {
2424
2451
  "type": "TEXT",
2425
- "notNull": false,
2426
- "default": ""
2452
+ "notNull": false
2427
2453
  },
2428
- "site_domain": {
2454
+ "sent_at": {
2455
+ "type": "TIMESTAMP",
2456
+ "notNull": false
2457
+ },
2458
+ "error_message": {
2429
2459
  "type": "TEXT",
2430
2460
  "notNull": false,
2431
2461
  "default": ""
2432
2462
  },
2433
- "time_zone": {
2434
- "type": "TEXT",
2463
+ "retry_count": {
2464
+ "type": "INTEGER",
2435
2465
  "notNull": false,
2436
- "default": "America/Los_Angeles"
2466
+ "default": 0
2437
2467
  },
2438
- "currency_code": {
2439
- "type": "TEXT",
2468
+ "non_personalized_ads": {
2469
+ "type": "BOOLEAN",
2440
2470
  "notNull": false,
2441
- "default": "USD"
2471
+ "default": false
2442
2472
  },
2443
- "industry_category": {
2473
+ "session_id": {
2444
2474
  "type": "TEXT",
2445
2475
  "notNull": false,
2446
2476
  "default": ""
2447
2477
  },
2448
- "service_level": {
2478
+ "page_path": {
2449
2479
  "type": "TEXT",
2450
2480
  "notNull": false,
2451
- "default": "STANDARD"
2481
+ "default": ""
2452
2482
  },
2453
- "status": {
2483
+ "page_title": {
2454
2484
  "type": "TEXT",
2455
- "notNull": false
2485
+ "notNull": false,
2486
+ "default": ""
2456
2487
  },
2457
- "last_sync_at": {
2458
- "type": "TIMESTAMP",
2459
- "notNull": false
2488
+ "user_agent": {
2489
+ "type": "TEXT",
2490
+ "notNull": false,
2491
+ "default": ""
2460
2492
  },
2461
- "provider_metadata": {
2493
+ "ip_address": {
2462
2494
  "type": "TEXT",
2463
2495
  "notNull": false,
2464
- "default": "{}"
2496
+ "default": ""
2465
2497
  }
2466
2498
  },
2467
2499
  "indexes": [
2468
2500
  {
2469
- "name": "analytics_properties_id_idx",
2501
+ "name": "analytics_events_id_idx",
2470
2502
  "columns": [
2471
2503
  "id"
2472
2504
  ]
2473
2505
  },
2474
2506
  {
2475
- "name": "analytics_properties_slug_context_meta_type_idx",
2507
+ "name": "analytics_events_slug_context_meta_type_idx",
2476
2508
  "columns": [
2477
2509
  "slug",
2478
2510
  "context",
@@ -2481,21 +2513,21 @@
2481
2513
  "unique": true
2482
2514
  },
2483
2515
  {
2484
- "name": "analytics_properties_meta_type_idx",
2516
+ "name": "analytics_events_meta_type_idx",
2485
2517
  "columns": [
2486
2518
  "_meta_type"
2487
2519
  ]
2488
2520
  }
2489
2521
  ],
2490
- "version": "f38a20b9"
2522
+ "version": "8c2447ff"
2491
2523
  }
2492
2524
  },
2493
- "@happyvertical/smrt-analytics:AnalyticsReport": {
2494
- "name": "analyticsreport",
2495
- "className": "AnalyticsReport",
2496
- "qualifiedName": "@happyvertical/smrt-analytics:AnalyticsReport",
2497
- "collection": "analyticsreports",
2498
- "filePath": "/home/runner/_work/smrt/smrt/packages/analytics/src/models/AnalyticsReport.ts",
2525
+ "@happyvertical/smrt-analytics:AnalyticsProperty": {
2526
+ "name": "analyticsproperty",
2527
+ "className": "AnalyticsProperty",
2528
+ "qualifiedName": "@happyvertical/smrt-analytics:AnalyticsProperty",
2529
+ "collection": "analyticsproperties",
2530
+ "filePath": "/home/runner/_work/smrt/smrt/packages/analytics/src/models/AnalyticsProperty.ts",
2499
2531
  "packageName": "@happyvertical/smrt-analytics",
2500
2532
  "fields": {
2501
2533
  "created_at": {
@@ -2524,91 +2556,80 @@
2524
2556
  }
2525
2557
  }
2526
2558
  },
2527
- "propertyId": {
2528
- "type": "foreignKey",
2529
- "required": false,
2530
- "related": "AnalyticsProperty"
2531
- },
2532
2559
  "name": {
2533
2560
  "type": "text",
2534
2561
  "required": false,
2535
2562
  "default": ""
2536
2563
  },
2537
- "description": {
2564
+ "displayName": {
2538
2565
  "type": "text",
2539
2566
  "required": false,
2540
2567
  "default": ""
2541
2568
  },
2542
- "dimensions": {
2569
+ "provider": {
2543
2570
  "type": "text",
2544
- "required": false,
2545
- "default": "[]"
2571
+ "required": false
2546
2572
  },
2547
- "metrics": {
2573
+ "externalId": {
2548
2574
  "type": "text",
2549
2575
  "required": false,
2550
- "default": "[]"
2576
+ "default": ""
2551
2577
  },
2552
- "dateRangeStart": {
2578
+ "measurementId": {
2553
2579
  "type": "text",
2554
2580
  "required": false,
2555
- "default": "7daysAgo"
2581
+ "default": ""
2556
2582
  },
2557
- "dateRangeEnd": {
2583
+ "apiSecret": {
2558
2584
  "type": "text",
2559
2585
  "required": false,
2560
- "default": "today"
2586
+ "default": "",
2587
+ "_meta": {
2588
+ "sensitive": true
2589
+ },
2590
+ "sensitive": true
2561
2591
  },
2562
- "dimensionFilter": {
2592
+ "siteDomain": {
2563
2593
  "type": "text",
2564
2594
  "required": false,
2565
2595
  "default": ""
2566
2596
  },
2567
- "metricFilter": {
2597
+ "timeZone": {
2568
2598
  "type": "text",
2569
2599
  "required": false,
2570
- "default": ""
2600
+ "default": "America/Los_Angeles"
2571
2601
  },
2572
- "orderBy": {
2602
+ "currencyCode": {
2573
2603
  "type": "text",
2574
2604
  "required": false,
2575
- "default": "[]"
2605
+ "default": "USD"
2576
2606
  },
2577
- "maxResults": {
2578
- "type": "integer",
2607
+ "industryCategory": {
2608
+ "type": "text",
2579
2609
  "required": false,
2580
- "default": 0
2610
+ "default": ""
2581
2611
  },
2582
- "status": {
2612
+ "serviceLevel": {
2583
2613
  "type": "text",
2584
- "required": false
2614
+ "required": false,
2615
+ "default": "STANDARD"
2585
2616
  },
2586
- "frequency": {
2617
+ "status": {
2587
2618
  "type": "text",
2588
2619
  "required": false
2589
2620
  },
2590
- "lastRunAt": {
2591
- "type": "datetime",
2592
- "required": false
2593
- },
2594
- "nextRunAt": {
2621
+ "lastSyncAt": {
2595
2622
  "type": "datetime",
2596
2623
  "required": false
2597
2624
  },
2598
- "resultData": {
2599
- "type": "text",
2600
- "required": false,
2601
- "default": ""
2602
- },
2603
- "rowCount": {
2604
- "type": "integer",
2605
- "required": false,
2606
- "default": 0
2607
- },
2608
- "lastError": {
2625
+ "providerMetadata": {
2609
2626
  "type": "text",
2610
2627
  "required": false,
2611
- "default": ""
2628
+ "default": "{}",
2629
+ "_meta": {
2630
+ "sensitive": true
2631
+ },
2632
+ "sensitive": true
2612
2633
  }
2613
2634
  },
2614
2635
  "methods": {
@@ -3101,101 +3122,45 @@
3101
3122
  "isStatic": false,
3102
3123
  "isPublic": true
3103
3124
  },
3104
- "getDimensions": {
3105
- "name": "getDimensions",
3106
- "async": false,
3107
- "parameters": [],
3108
- "returnType": "Array<object>",
3109
- "isStatic": false,
3110
- "isPublic": true
3111
- },
3112
- "setDimensions": {
3113
- "name": "setDimensions",
3114
- "async": false,
3115
- "parameters": [
3116
- {
3117
- "name": "dimensions",
3118
- "type": "Array<object>",
3119
- "optional": false
3120
- }
3121
- ],
3122
- "returnType": "void",
3123
- "isStatic": false,
3124
- "isPublic": true
3125
- },
3126
- "getMetrics": {
3127
- "name": "getMetrics",
3128
- "async": false,
3129
- "parameters": [],
3130
- "returnType": "Array<object>",
3131
- "isStatic": false,
3132
- "isPublic": true
3133
- },
3134
- "setMetrics": {
3135
- "name": "setMetrics",
3136
- "async": false,
3137
- "parameters": [
3138
- {
3139
- "name": "metrics",
3140
- "type": "Array<object>",
3141
- "optional": false
3142
- }
3143
- ],
3144
- "returnType": "void",
3145
- "isStatic": false,
3146
- "isPublic": true
3147
- },
3148
- "getResultData": {
3149
- "name": "getResultData",
3125
+ "isGA4": {
3126
+ "name": "isGA4",
3150
3127
  "async": false,
3151
3128
  "parameters": [],
3152
- "returnType": "Record<string> | null",
3129
+ "returnType": "boolean",
3153
3130
  "isStatic": false,
3154
- "isPublic": true
3155
- },
3156
- "setResultData": {
3157
- "name": "setResultData",
3158
- "async": false,
3159
- "parameters": [
3160
- {
3161
- "name": "data",
3162
- "type": "Record<string>",
3163
- "optional": false
3164
- }
3165
- ],
3166
- "returnType": "void",
3131
+ "isPublic": true
3132
+ },
3133
+ "isPlausible": {
3134
+ "name": "isPlausible",
3135
+ "async": false,
3136
+ "parameters": [],
3137
+ "returnType": "boolean",
3167
3138
  "isStatic": false,
3168
3139
  "isPublic": true
3169
3140
  },
3170
- "markRunning": {
3171
- "name": "markRunning",
3141
+ "isMatomo": {
3142
+ "name": "isMatomo",
3172
3143
  "async": false,
3173
3144
  "parameters": [],
3174
- "returnType": "void",
3145
+ "returnType": "boolean",
3175
3146
  "isStatic": false,
3176
3147
  "isPublic": true
3177
3148
  },
3178
- "markCompleted": {
3179
- "name": "markCompleted",
3149
+ "getProviderMetadata": {
3150
+ "name": "getProviderMetadata",
3180
3151
  "async": false,
3181
- "parameters": [
3182
- {
3183
- "name": "rowCount",
3184
- "type": "number",
3185
- "optional": false
3186
- }
3187
- ],
3188
- "returnType": "void",
3152
+ "parameters": [],
3153
+ "returnType": "Record<string>",
3189
3154
  "isStatic": false,
3190
3155
  "isPublic": true
3191
3156
  },
3192
- "markFailed": {
3193
- "name": "markFailed",
3157
+ "setProviderMetadata": {
3158
+ "name": "setProviderMetadata",
3194
3159
  "async": false,
3195
3160
  "parameters": [
3196
3161
  {
3197
- "name": "error",
3198
- "type": "string",
3162
+ "name": "metadata",
3163
+ "type": "Record<string>",
3199
3164
  "optional": false
3200
3165
  }
3201
3166
  ],
@@ -3203,29 +3168,21 @@
3203
3168
  "isStatic": false,
3204
3169
  "isPublic": true
3205
3170
  },
3206
- "calculateNextRun": {
3207
- "name": "calculateNextRun",
3171
+ "markSynced": {
3172
+ "name": "markSynced",
3208
3173
  "async": false,
3209
3174
  "parameters": [],
3210
3175
  "returnType": "void",
3211
3176
  "isStatic": false,
3212
3177
  "isPublic": true
3213
3178
  },
3214
- "isDue": {
3215
- "name": "isDue",
3216
- "async": false,
3217
- "parameters": [],
3218
- "returnType": "boolean",
3219
- "isStatic": false,
3220
- "isPublic": true
3221
- },
3222
- "analyzeResults": {
3223
- "name": "analyzeResults",
3179
+ "analyzePerformance": {
3180
+ "name": "analyzePerformance",
3224
3181
  "async": true,
3225
3182
  "parameters": [
3226
3183
  {
3227
- "name": "_options",
3228
- "type": "Record<string>",
3184
+ "name": "options",
3185
+ "type": "object",
3229
3186
  "optional": true
3230
3187
  }
3231
3188
  ],
@@ -3233,8 +3190,8 @@
3233
3190
  "isStatic": false,
3234
3191
  "isPublic": true
3235
3192
  },
3236
- "hasPositiveTrends": {
3237
- "name": "hasPositiveTrends",
3193
+ "isPerformingWell": {
3194
+ "name": "isPerformingWell",
3238
3195
  "async": true,
3239
3196
  "parameters": [],
3240
3197
  "returnType": "Promise<boolean>",
@@ -3249,16 +3206,15 @@
3249
3206
  "list",
3250
3207
  "get",
3251
3208
  "create",
3252
- "update",
3253
- "run"
3209
+ "update"
3254
3210
  ]
3255
3211
  },
3256
3212
  "mcp": {
3257
3213
  "include": [
3258
3214
  "list",
3259
3215
  "get",
3260
- "run",
3261
- "analyze"
3216
+ "sync",
3217
+ "runReport"
3262
3218
  ]
3263
3219
  },
3264
3220
  "cli": true,
@@ -3267,11 +3223,11 @@
3267
3223
  }
3268
3224
  },
3269
3225
  "extends": "SmrtObject",
3270
- "exportName": "AnalyticsReport",
3271
- "collectionExportName": "AnalyticsReportCollection",
3226
+ "exportName": "AnalyticsProperty",
3227
+ "collectionExportName": "AnalyticsPropertyCollection",
3272
3228
  "schema": {
3273
- "tableName": "analytics_reports",
3274
- "ddl": "CREATE TABLE IF NOT EXISTS \"analytics_reports\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"_meta_type\" TEXT NOT NULL,\n \"_meta_data\" JSON,\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID,\n \"property_id\" UUID,\n \"name\" TEXT DEFAULT '',\n \"description\" TEXT DEFAULT '',\n \"dimensions\" TEXT DEFAULT '[]',\n \"metrics\" TEXT DEFAULT '[]',\n \"date_range_start\" TEXT DEFAULT '7daysAgo',\n \"date_range_end\" TEXT DEFAULT 'today',\n \"dimension_filter\" TEXT DEFAULT '',\n \"metric_filter\" TEXT DEFAULT '',\n \"order_by\" TEXT DEFAULT '[]',\n \"max_results\" INTEGER DEFAULT 0,\n \"status\" TEXT,\n \"frequency\" TEXT,\n \"last_run_at\" TIMESTAMP,\n \"next_run_at\" TIMESTAMP,\n \"result_data\" TEXT DEFAULT '',\n \"row_count\" INTEGER DEFAULT 0,\n \"last_error\" TEXT DEFAULT ''\n);",
3229
+ "tableName": "analytics_properties",
3230
+ "ddl": "CREATE TABLE IF NOT EXISTS \"analytics_properties\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"_meta_type\" TEXT NOT NULL,\n \"_meta_data\" JSON,\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID,\n \"name\" TEXT DEFAULT '',\n \"display_name\" TEXT DEFAULT '',\n \"provider\" TEXT,\n \"external_id\" TEXT DEFAULT '',\n \"measurement_id\" TEXT DEFAULT '',\n \"api_secret\" TEXT DEFAULT '',\n \"site_domain\" TEXT DEFAULT '',\n \"time_zone\" TEXT DEFAULT 'America/Los_Angeles',\n \"currency_code\" TEXT DEFAULT 'USD',\n \"industry_category\" TEXT DEFAULT '',\n \"service_level\" TEXT DEFAULT 'STANDARD',\n \"status\" TEXT,\n \"last_sync_at\" TIMESTAMP,\n \"provider_metadata\" TEXT DEFAULT '{}'\n);",
3275
3231
  "columns": {
3276
3232
  "id": {
3277
3233
  "type": "UUID",
@@ -3311,102 +3267,83 @@
3311
3267
  "referenceKind": "tenantId",
3312
3268
  "notNull": false
3313
3269
  },
3314
- "property_id": {
3315
- "type": "UUID",
3316
- "referenceKind": "foreignKey",
3317
- "notNull": false
3318
- },
3319
3270
  "name": {
3320
3271
  "type": "TEXT",
3321
3272
  "notNull": false,
3322
3273
  "default": ""
3323
3274
  },
3324
- "description": {
3275
+ "display_name": {
3325
3276
  "type": "TEXT",
3326
3277
  "notNull": false,
3327
3278
  "default": ""
3328
3279
  },
3329
- "dimensions": {
3280
+ "provider": {
3330
3281
  "type": "TEXT",
3331
- "notNull": false,
3332
- "default": "[]"
3282
+ "notNull": false
3333
3283
  },
3334
- "metrics": {
3284
+ "external_id": {
3335
3285
  "type": "TEXT",
3336
3286
  "notNull": false,
3337
- "default": "[]"
3287
+ "default": ""
3338
3288
  },
3339
- "date_range_start": {
3289
+ "measurement_id": {
3340
3290
  "type": "TEXT",
3341
3291
  "notNull": false,
3342
- "default": "7daysAgo"
3292
+ "default": ""
3343
3293
  },
3344
- "date_range_end": {
3294
+ "api_secret": {
3345
3295
  "type": "TEXT",
3346
3296
  "notNull": false,
3347
- "default": "today"
3297
+ "default": ""
3348
3298
  },
3349
- "dimension_filter": {
3299
+ "site_domain": {
3350
3300
  "type": "TEXT",
3351
3301
  "notNull": false,
3352
3302
  "default": ""
3353
3303
  },
3354
- "metric_filter": {
3304
+ "time_zone": {
3355
3305
  "type": "TEXT",
3356
3306
  "notNull": false,
3357
- "default": ""
3307
+ "default": "America/Los_Angeles"
3358
3308
  },
3359
- "order_by": {
3309
+ "currency_code": {
3360
3310
  "type": "TEXT",
3361
3311
  "notNull": false,
3362
- "default": "[]"
3312
+ "default": "USD"
3363
3313
  },
3364
- "max_results": {
3365
- "type": "INTEGER",
3314
+ "industry_category": {
3315
+ "type": "TEXT",
3366
3316
  "notNull": false,
3367
- "default": 0
3317
+ "default": ""
3368
3318
  },
3369
- "status": {
3319
+ "service_level": {
3370
3320
  "type": "TEXT",
3371
- "notNull": false
3321
+ "notNull": false,
3322
+ "default": "STANDARD"
3372
3323
  },
3373
- "frequency": {
3324
+ "status": {
3374
3325
  "type": "TEXT",
3375
3326
  "notNull": false
3376
3327
  },
3377
- "last_run_at": {
3378
- "type": "TIMESTAMP",
3379
- "notNull": false
3380
- },
3381
- "next_run_at": {
3328
+ "last_sync_at": {
3382
3329
  "type": "TIMESTAMP",
3383
3330
  "notNull": false
3384
3331
  },
3385
- "result_data": {
3386
- "type": "TEXT",
3387
- "notNull": false,
3388
- "default": ""
3389
- },
3390
- "row_count": {
3391
- "type": "INTEGER",
3392
- "notNull": false,
3393
- "default": 0
3394
- },
3395
- "last_error": {
3332
+ "provider_metadata": {
3396
3333
  "type": "TEXT",
3397
3334
  "notNull": false,
3398
- "default": ""
3335
+ "default": "{}"
3399
3336
  }
3400
3337
  },
3401
3338
  "indexes": [
3402
3339
  {
3403
- "name": "analytics_reports_id_idx",
3340
+ "name": "analytics_properties_id_idx",
3404
3341
  "columns": [
3405
3342
  "id"
3406
3343
  ]
3407
3344
  },
3408
3345
  {
3409
- "name": "analytics_reports_slug_context_meta_type_idx",
3346
+ "name": "analytics_properties_slug_context_meta_type_idx",
3410
3347
  "columns": [
3411
3348
  "slug",
3412
3349
  "context",
@@ -3415,840 +3352,797 @@
3415
3352
  "unique": true
3416
3353
  },
3417
3354
  {
3418
- "name": "analytics_reports_meta_type_idx",
3355
+ "name": "analytics_properties_meta_type_idx",
3419
3356
  "columns": [
3420
3357
  "_meta_type"
3421
3358
  ]
3422
3359
  }
3423
3360
  ],
3424
- "version": "cecde8c6"
3361
+ "version": "f38a20b9"
3425
3362
  }
3426
3363
  },
3427
- "@happyvertical/smrt-analytics:AnalyticsDataStreamCollection": {
3428
- "name": "analyticsdatastreamcollection",
3429
- "className": "AnalyticsDataStreamCollection",
3430
- "qualifiedName": "@happyvertical/smrt-analytics:AnalyticsDataStreamCollection",
3431
- "collection": "analyticsdatastreams",
3432
- "filePath": "/home/runner/_work/smrt/smrt/packages/analytics/src/collections/AnalyticsDataStreamCollection.ts",
3364
+ "@happyvertical/smrt-analytics:AnalyticsReport": {
3365
+ "name": "analyticsreport",
3366
+ "className": "AnalyticsReport",
3367
+ "qualifiedName": "@happyvertical/smrt-analytics:AnalyticsReport",
3368
+ "collection": "analyticsreports",
3369
+ "filePath": "/home/runner/_work/smrt/smrt/packages/analytics/src/models/AnalyticsReport.ts",
3433
3370
  "packageName": "@happyvertical/smrt-analytics",
3434
- "fields": {},
3371
+ "fields": {
3372
+ "created_at": {
3373
+ "type": "datetime",
3374
+ "required": false
3375
+ },
3376
+ "updated_at": {
3377
+ "type": "datetime",
3378
+ "required": false
3379
+ },
3380
+ "tenantId": {
3381
+ "type": "text",
3382
+ "required": false,
3383
+ "_meta": {
3384
+ "sqlType": "UUID",
3385
+ "nullable": true,
3386
+ "__tenancy": {
3387
+ "isTenantIdField": true,
3388
+ "autoFilter": true,
3389
+ "required": false,
3390
+ "autoPopulate": true,
3391
+ "nullable": true,
3392
+ "mode": "optional",
3393
+ "field": "tenantId",
3394
+ "allowSuperAdminBypass": false
3395
+ }
3396
+ }
3397
+ },
3398
+ "propertyId": {
3399
+ "type": "foreignKey",
3400
+ "required": false,
3401
+ "related": "AnalyticsProperty"
3402
+ },
3403
+ "name": {
3404
+ "type": "text",
3405
+ "required": false,
3406
+ "default": ""
3407
+ },
3408
+ "description": {
3409
+ "type": "text",
3410
+ "required": false,
3411
+ "default": ""
3412
+ },
3413
+ "dimensions": {
3414
+ "type": "text",
3415
+ "required": false,
3416
+ "default": "[]"
3417
+ },
3418
+ "metrics": {
3419
+ "type": "text",
3420
+ "required": false,
3421
+ "default": "[]"
3422
+ },
3423
+ "dateRangeStart": {
3424
+ "type": "text",
3425
+ "required": false,
3426
+ "default": "7daysAgo"
3427
+ },
3428
+ "dateRangeEnd": {
3429
+ "type": "text",
3430
+ "required": false,
3431
+ "default": "today"
3432
+ },
3433
+ "dimensionFilter": {
3434
+ "type": "text",
3435
+ "required": false,
3436
+ "default": ""
3437
+ },
3438
+ "metricFilter": {
3439
+ "type": "text",
3440
+ "required": false,
3441
+ "default": ""
3442
+ },
3443
+ "orderBy": {
3444
+ "type": "text",
3445
+ "required": false,
3446
+ "default": "[]"
3447
+ },
3448
+ "maxResults": {
3449
+ "type": "integer",
3450
+ "required": false,
3451
+ "default": 0
3452
+ },
3453
+ "status": {
3454
+ "type": "text",
3455
+ "required": false
3456
+ },
3457
+ "frequency": {
3458
+ "type": "text",
3459
+ "required": false
3460
+ },
3461
+ "lastRunAt": {
3462
+ "type": "datetime",
3463
+ "required": false
3464
+ },
3465
+ "nextRunAt": {
3466
+ "type": "datetime",
3467
+ "required": false
3468
+ },
3469
+ "resultData": {
3470
+ "type": "text",
3471
+ "required": false,
3472
+ "default": ""
3473
+ },
3474
+ "rowCount": {
3475
+ "type": "integer",
3476
+ "required": false,
3477
+ "default": 0
3478
+ },
3479
+ "lastError": {
3480
+ "type": "text",
3481
+ "required": false,
3482
+ "default": ""
3483
+ }
3484
+ },
3435
3485
  "methods": {
3436
- "findByProperty": {
3437
- "name": "findByProperty",
3438
- "async": true,
3439
- "parameters": [
3440
- {
3441
- "name": "propertyId",
3442
- "type": "string",
3443
- "optional": false
3444
- }
3445
- ],
3446
- "returnType": "Promise<AnalyticsDataStream[]>",
3486
+ "getAiUsageSnapshot": {
3487
+ "name": "getAiUsageSnapshot",
3488
+ "async": false,
3489
+ "parameters": [],
3490
+ "returnType": "AiUsageSnapshot | undefined",
3447
3491
  "isStatic": false,
3448
3492
  "isPublic": true
3449
3493
  },
3450
- "findByExternalId": {
3451
- "name": "findByExternalId",
3452
- "async": true,
3453
- "parameters": [
3454
- {
3455
- "name": "externalId",
3456
- "type": "string",
3457
- "optional": false
3458
- }
3459
- ],
3460
- "returnType": "Promise<AnalyticsDataStream | null>",
3494
+ "resetAiUsage": {
3495
+ "name": "resetAiUsage",
3496
+ "async": false,
3497
+ "parameters": [],
3498
+ "returnType": "void",
3461
3499
  "isStatic": false,
3462
3500
  "isPublic": true
3463
3501
  },
3464
- "findByMeasurementId": {
3465
- "name": "findByMeasurementId",
3502
+ "listAiUsage": {
3503
+ "name": "listAiUsage",
3466
3504
  "async": true,
3467
3505
  "parameters": [
3468
3506
  {
3469
- "name": "measurementId",
3470
- "type": "string",
3471
- "optional": false
3507
+ "name": "options",
3508
+ "type": "AiUsageListOptions",
3509
+ "optional": true
3472
3510
  }
3473
3511
  ],
3474
- "returnType": "Promise<AnalyticsDataStream | null>",
3512
+ "returnType": "Promise<SmrtAiUsageRecord[]>",
3475
3513
  "isStatic": false,
3476
3514
  "isPublic": true
3477
3515
  },
3478
- "findByType": {
3479
- "name": "findByType",
3516
+ "summarizeAiUsage": {
3517
+ "name": "summarizeAiUsage",
3480
3518
  "async": true,
3481
3519
  "parameters": [
3482
3520
  {
3483
- "name": "streamType",
3484
- "type": "DataStreamType",
3485
- "optional": false
3521
+ "name": "options",
3522
+ "type": "AiUsageSummaryOptions",
3523
+ "optional": true
3486
3524
  }
3487
3525
  ],
3488
- "returnType": "Promise<AnalyticsDataStream[]>",
3526
+ "returnType": "Promise<Record<string, AiUsageStats>>",
3489
3527
  "isStatic": false,
3490
3528
  "isPublic": true
3491
3529
  },
3492
- "findWebStreams": {
3493
- "name": "findWebStreams",
3494
- "async": true,
3530
+ "destroy": {
3531
+ "name": "destroy",
3532
+ "async": false,
3495
3533
  "parameters": [],
3496
- "returnType": "Promise<AnalyticsDataStream[]>",
3534
+ "returnType": "void",
3497
3535
  "isStatic": false,
3498
3536
  "isPublic": true
3499
3537
  },
3500
- "findIOSStreams": {
3501
- "name": "findIOSStreams",
3502
- "async": true,
3538
+ "markAsPersisted": {
3539
+ "name": "markAsPersisted",
3540
+ "async": false,
3503
3541
  "parameters": [],
3504
- "returnType": "Promise<AnalyticsDataStream[]>",
3542
+ "returnType": "void",
3505
3543
  "isStatic": false,
3506
3544
  "isPublic": true
3507
3545
  },
3508
- "findAndroidStreams": {
3509
- "name": "findAndroidStreams",
3510
- "async": true,
3546
+ "requireInsertOnSave": {
3547
+ "name": "requireInsertOnSave",
3548
+ "async": false,
3511
3549
  "parameters": [],
3512
- "returnType": "Promise<AnalyticsDataStream[]>",
3550
+ "returnType": "void",
3513
3551
  "isStatic": false,
3514
3552
  "isPublic": true
3515
3553
  },
3516
- "findMobileStreams": {
3517
- "name": "findMobileStreams",
3554
+ "initialize": {
3555
+ "name": "initialize",
3518
3556
  "async": true,
3519
3557
  "parameters": [],
3520
- "returnType": "Promise<AnalyticsDataStream[]>",
3558
+ "returnType": "Promise",
3521
3559
  "isStatic": false,
3522
3560
  "isPublic": true
3523
3561
  },
3524
- "findByStatus": {
3525
- "name": "findByStatus",
3562
+ "loadDataFromDb": {
3563
+ "name": "loadDataFromDb",
3526
3564
  "async": true,
3527
3565
  "parameters": [
3528
3566
  {
3529
- "name": "status",
3530
- "type": "DataStreamStatus",
3567
+ "name": "data",
3568
+ "type": "Record<string>",
3531
3569
  "optional": false
3532
3570
  }
3533
3571
  ],
3534
- "returnType": "Promise<AnalyticsDataStream[]>",
3572
+ "returnType": "any",
3535
3573
  "isStatic": false,
3536
3574
  "isPublic": true
3537
3575
  },
3538
- "findActive": {
3539
- "name": "findActive",
3576
+ "getFields": {
3577
+ "name": "getFields",
3540
3578
  "async": true,
3541
3579
  "parameters": [],
3542
- "returnType": "Promise<AnalyticsDataStream[]>",
3543
- "isStatic": false,
3544
- "isPublic": true
3545
- },
3546
- "findActiveByProperty": {
3547
- "name": "findActiveByProperty",
3548
- "async": true,
3549
- "parameters": [
3550
- {
3551
- "name": "propertyId",
3552
- "type": "string",
3553
- "optional": false
3554
- }
3555
- ],
3556
- "returnType": "Promise<AnalyticsDataStream[]>",
3557
- "isStatic": false,
3558
- "isPublic": true
3559
- }
3560
- },
3561
- "decoratorConfig": {},
3562
- "extends": "SmrtCollection",
3563
- "extendsTypeArg": "AnalyticsDataStream",
3564
- "exportName": "AnalyticsDataStreamCollection",
3565
- "collectionExportName": "AnalyticsDataStreamCollectionCollection",
3566
- "schema": {
3567
- "tableName": "analytics_data_stream_collections",
3568
- "ddl": "CREATE TABLE IF NOT EXISTS \"analytics_data_stream_collections\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp\n);",
3569
- "columns": {
3570
- "id": {
3571
- "type": "UUID",
3572
- "primaryKey": true,
3573
- "referenceKind": "id",
3574
- "notNull": true
3575
- },
3576
- "slug": {
3577
- "type": "TEXT",
3578
- "notNull": true
3579
- },
3580
- "context": {
3581
- "type": "TEXT",
3582
- "notNull": true,
3583
- "default": ""
3584
- },
3585
- "created_at": {
3586
- "type": "TIMESTAMP",
3587
- "notNull": true,
3588
- "default": "current_timestamp"
3589
- },
3590
- "updated_at": {
3591
- "type": "TIMESTAMP",
3592
- "notNull": true,
3593
- "default": "current_timestamp"
3594
- }
3595
- },
3596
- "indexes": [
3597
- {
3598
- "name": "analytics_data_stream_collections_id_idx",
3599
- "columns": [
3600
- "id"
3601
- ]
3602
- },
3603
- {
3604
- "name": "analytics_data_stream_collections_slug_context_idx",
3605
- "columns": [
3606
- "slug",
3607
- "context"
3608
- ],
3609
- "unique": true
3610
- }
3611
- ],
3612
- "version": "12ef5a9a"
3613
- }
3614
- },
3615
- "@happyvertical/smrt-analytics:AnalyticsEventCollection": {
3616
- "name": "analyticseventcollection",
3617
- "className": "AnalyticsEventCollection",
3618
- "qualifiedName": "@happyvertical/smrt-analytics:AnalyticsEventCollection",
3619
- "collection": "analyticsevents",
3620
- "filePath": "/home/runner/_work/smrt/smrt/packages/analytics/src/collections/AnalyticsEventCollection.ts",
3621
- "packageName": "@happyvertical/smrt-analytics",
3622
- "fields": {},
3623
- "methods": {
3624
- "findByProperty": {
3625
- "name": "findByProperty",
3626
- "async": true,
3627
- "parameters": [
3628
- {
3629
- "name": "propertyId",
3630
- "type": "string",
3631
- "optional": false
3632
- }
3633
- ],
3634
- "returnType": "Promise<AnalyticsEvent[]>",
3635
- "isStatic": false,
3636
- "isPublic": true
3637
- },
3638
- "findByEventName": {
3639
- "name": "findByEventName",
3640
- "async": true,
3641
- "parameters": [
3642
- {
3643
- "name": "eventName",
3644
- "type": "string",
3645
- "optional": false
3646
- }
3647
- ],
3648
- "returnType": "Promise<AnalyticsEvent[]>",
3580
+ "returnType": "Promise<any>",
3649
3581
  "isStatic": false,
3650
3582
  "isPublic": true
3651
3583
  },
3652
- "findByClientId": {
3653
- "name": "findByClientId",
3654
- "async": true,
3655
- "parameters": [
3656
- {
3657
- "name": "clientId",
3658
- "type": "string",
3659
- "optional": false
3660
- }
3661
- ],
3662
- "returnType": "Promise<AnalyticsEvent[]>",
3584
+ "toJSON": {
3585
+ "name": "toJSON",
3586
+ "async": false,
3587
+ "parameters": [],
3588
+ "returnType": "any",
3663
3589
  "isStatic": false,
3664
3590
  "isPublic": true
3665
3591
  },
3666
- "findByUserId": {
3667
- "name": "findByUserId",
3668
- "async": true,
3669
- "parameters": [
3670
- {
3671
- "name": "userId",
3672
- "type": "string",
3673
- "optional": false
3674
- }
3675
- ],
3676
- "returnType": "Promise<AnalyticsEvent[]>",
3592
+ "toPlainObject": {
3593
+ "name": "toPlainObject",
3594
+ "async": false,
3595
+ "parameters": [],
3596
+ "returnType": "Record<string>",
3677
3597
  "isStatic": false,
3678
3598
  "isPublic": true
3679
3599
  },
3680
- "findByStatus": {
3681
- "name": "findByStatus",
3682
- "async": true,
3600
+ "toPublicJSON": {
3601
+ "name": "toPublicJSON",
3602
+ "async": false,
3683
3603
  "parameters": [
3684
3604
  {
3685
- "name": "status",
3686
- "type": "TrackingEventStatus",
3687
- "optional": false
3605
+ "name": "options",
3606
+ "type": "PublicJsonOptions",
3607
+ "optional": true
3688
3608
  }
3689
3609
  ],
3690
- "returnType": "Promise<AnalyticsEvent[]>",
3610
+ "returnType": "Record<string>",
3691
3611
  "isStatic": false,
3692
3612
  "isPublic": true
3693
3613
  },
3694
- "findPending": {
3695
- "name": "findPending",
3614
+ "getId": {
3615
+ "name": "getId",
3696
3616
  "async": true,
3697
3617
  "parameters": [],
3698
- "returnType": "Promise<AnalyticsEvent[]>",
3618
+ "returnType": "any",
3699
3619
  "isStatic": false,
3700
3620
  "isPublic": true
3701
3621
  },
3702
- "findSent": {
3703
- "name": "findSent",
3622
+ "getSlug": {
3623
+ "name": "getSlug",
3704
3624
  "async": true,
3705
3625
  "parameters": [],
3706
- "returnType": "Promise<AnalyticsEvent[]>",
3626
+ "returnType": "any",
3707
3627
  "isStatic": false,
3708
3628
  "isPublic": true
3709
3629
  },
3710
- "findFailed": {
3711
- "name": "findFailed",
3630
+ "getSavedId": {
3631
+ "name": "getSavedId",
3712
3632
  "async": true,
3713
3633
  "parameters": [],
3714
- "returnType": "Promise<AnalyticsEvent[]>",
3634
+ "returnType": "any",
3715
3635
  "isStatic": false,
3716
3636
  "isPublic": true
3717
3637
  },
3718
- "findForRetry": {
3719
- "name": "findForRetry",
3638
+ "isSaved": {
3639
+ "name": "isSaved",
3720
3640
  "async": true,
3721
- "parameters": [
3722
- {
3723
- "name": "maxRetries",
3724
- "type": "number",
3725
- "optional": true
3726
- }
3727
- ],
3728
- "returnType": "Promise<AnalyticsEvent[]>",
3641
+ "parameters": [],
3642
+ "returnType": "any",
3729
3643
  "isStatic": false,
3730
3644
  "isPublic": true
3731
3645
  },
3732
- "findPendingByProperty": {
3733
- "name": "findPendingByProperty",
3646
+ "save": {
3647
+ "name": "save",
3734
3648
  "async": true,
3649
+ "parameters": [],
3650
+ "returnType": "any",
3651
+ "isStatic": false,
3652
+ "isPublic": true
3653
+ },
3654
+ "classifyConstraintError": {
3655
+ "name": "classifyConstraintError",
3656
+ "async": false,
3735
3657
  "parameters": [
3736
3658
  {
3737
- "name": "propertyId",
3659
+ "name": "message",
3738
3660
  "type": "string",
3739
3661
  "optional": false
3740
3662
  }
3741
3663
  ],
3742
- "returnType": "Promise<AnalyticsEvent[]>",
3664
+ "returnType": "'unique' | 'not_null' | null",
3665
+ "isStatic": true,
3666
+ "isPublic": true
3667
+ },
3668
+ "loadFromId": {
3669
+ "name": "loadFromId",
3670
+ "async": true,
3671
+ "parameters": [],
3672
+ "returnType": "any",
3743
3673
  "isStatic": false,
3744
3674
  "isPublic": true
3745
3675
  },
3746
- "findByDateRange": {
3747
- "name": "findByDateRange",
3676
+ "loadFromSlug": {
3677
+ "name": "loadFromSlug",
3678
+ "async": true,
3679
+ "parameters": [],
3680
+ "returnType": "any",
3681
+ "isStatic": false,
3682
+ "isPublic": true
3683
+ },
3684
+ "is": {
3685
+ "name": "is",
3748
3686
  "async": true,
3749
3687
  "parameters": [
3750
3688
  {
3751
- "name": "startDate",
3752
- "type": "Date",
3689
+ "name": "criteria",
3690
+ "type": "string",
3753
3691
  "optional": false
3754
3692
  },
3755
3693
  {
3756
- "name": "endDate",
3757
- "type": "Date",
3758
- "optional": false
3694
+ "name": "options",
3695
+ "type": "AiOperationOptions",
3696
+ "optional": true
3759
3697
  }
3760
3698
  ],
3761
- "returnType": "Promise<AnalyticsEvent[]>",
3699
+ "returnType": "any",
3762
3700
  "isStatic": false,
3763
3701
  "isPublic": true
3764
3702
  },
3765
- "findConversions": {
3766
- "name": "findConversions",
3703
+ "do": {
3704
+ "name": "do",
3767
3705
  "async": true,
3768
3706
  "parameters": [
3769
3707
  {
3770
- "name": "propertyId",
3708
+ "name": "instructions",
3771
3709
  "type": "string",
3710
+ "optional": false
3711
+ },
3712
+ {
3713
+ "name": "options",
3714
+ "type": "AiOperationOptions",
3772
3715
  "optional": true
3773
3716
  }
3774
3717
  ],
3775
- "returnType": "Promise<AnalyticsEvent[]>",
3718
+ "returnType": "any",
3776
3719
  "isStatic": false,
3777
3720
  "isPublic": true
3778
3721
  },
3779
- "findPageviews": {
3780
- "name": "findPageviews",
3722
+ "describe": {
3723
+ "name": "describe",
3781
3724
  "async": true,
3782
3725
  "parameters": [
3783
3726
  {
3784
- "name": "propertyId",
3785
- "type": "string",
3727
+ "name": "options",
3728
+ "type": "AiOperationOptions",
3786
3729
  "optional": true
3787
3730
  }
3788
3731
  ],
3789
- "returnType": "Promise<AnalyticsEvent[]>",
3732
+ "returnType": "any",
3790
3733
  "isStatic": false,
3791
3734
  "isPublic": true
3792
3735
  },
3793
- "countByEventName": {
3794
- "name": "countByEventName",
3736
+ "delete": {
3737
+ "name": "delete",
3795
3738
  "async": true,
3739
+ "parameters": [],
3740
+ "returnType": "Promise<void>",
3741
+ "isStatic": false,
3742
+ "isPublic": true
3743
+ },
3744
+ "isRelatedLoaded": {
3745
+ "name": "isRelatedLoaded",
3746
+ "async": false,
3796
3747
  "parameters": [
3797
3748
  {
3798
- "name": "propertyId",
3749
+ "name": "fieldName",
3799
3750
  "type": "string",
3800
3751
  "optional": false
3801
3752
  }
3802
3753
  ],
3803
- "returnType": "Promise<Map<string, number>>",
3754
+ "returnType": "boolean",
3804
3755
  "isStatic": false,
3805
3756
  "isPublic": true
3806
3757
  },
3807
- "getPropertyStats": {
3808
- "name": "getPropertyStats",
3809
- "async": true,
3758
+ "_setLoadedRelationship": {
3759
+ "name": "_setLoadedRelationship",
3760
+ "async": false,
3810
3761
  "parameters": [
3811
3762
  {
3812
- "name": "propertyId",
3763
+ "name": "fieldName",
3813
3764
  "type": "string",
3814
3765
  "optional": false
3766
+ },
3767
+ {
3768
+ "name": "value",
3769
+ "type": "any",
3770
+ "optional": false
3815
3771
  }
3816
3772
  ],
3817
- "returnType": "Promise<object>",
3773
+ "returnType": "void",
3818
3774
  "isStatic": false,
3819
3775
  "isPublic": true
3820
3776
  },
3821
- "getPropertyStatsWithTrend": {
3822
- "name": "getPropertyStatsWithTrend",
3777
+ "loadRelated": {
3778
+ "name": "loadRelated",
3823
3779
  "async": true,
3824
3780
  "parameters": [
3825
3781
  {
3826
- "name": "propertyId",
3782
+ "name": "fieldName",
3827
3783
  "type": "string",
3828
3784
  "optional": false
3829
3785
  },
3830
3786
  {
3831
- "name": "now",
3832
- "type": "Date",
3787
+ "name": "opts",
3788
+ "type": "LoadRelatedOptions",
3833
3789
  "optional": true
3834
- },
3835
- {
3836
- "name": "timeZone",
3837
- "type": "string",
3838
- "optional": true,
3839
- "default": "UTC"
3840
3790
  }
3841
3791
  ],
3842
- "returnType": "Promise<PropertyStatsWithTrend>",
3792
+ "returnType": "Promise<any>",
3843
3793
  "isStatic": false,
3844
3794
  "isPublic": true
3845
3795
  },
3846
- "getBatchPropertyStats": {
3847
- "name": "getBatchPropertyStats",
3796
+ "loadRelatedMany": {
3797
+ "name": "loadRelatedMany",
3848
3798
  "async": true,
3849
3799
  "parameters": [
3850
3800
  {
3851
- "name": "propertyIds",
3852
- "type": "string[]",
3801
+ "name": "fieldName",
3802
+ "type": "string",
3853
3803
  "optional": false
3854
3804
  },
3855
3805
  {
3856
- "name": "now",
3857
- "type": "Date",
3806
+ "name": "opts",
3807
+ "type": "LoadRelatedOptions",
3858
3808
  "optional": true
3859
- },
3860
- {
3861
- "name": "timeZone",
3862
- "type": "string",
3863
- "optional": true,
3864
- "default": "UTC"
3865
3809
  }
3866
3810
  ],
3867
- "returnType": "Promise<Map<string, PropertyStatsWithTrend>>",
3811
+ "returnType": "Promise<any[]>",
3868
3812
  "isStatic": false,
3869
3813
  "isPublic": true
3870
- }
3871
- },
3872
- "decoratorConfig": {},
3873
- "extends": "SmrtCollection",
3874
- "extendsTypeArg": "AnalyticsEvent",
3875
- "exportName": "AnalyticsEventCollection",
3876
- "collectionExportName": "AnalyticsEventCollectionCollection",
3877
- "schema": {
3878
- "tableName": "analytics_event_collections",
3879
- "ddl": "CREATE TABLE IF NOT EXISTS \"analytics_event_collections\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp\n);",
3880
- "columns": {
3881
- "id": {
3882
- "type": "UUID",
3883
- "primaryKey": true,
3884
- "referenceKind": "id",
3885
- "notNull": true
3886
- },
3887
- "slug": {
3888
- "type": "TEXT",
3889
- "notNull": true
3890
- },
3891
- "context": {
3892
- "type": "TEXT",
3893
- "notNull": true,
3894
- "default": ""
3895
- },
3896
- "created_at": {
3897
- "type": "TIMESTAMP",
3898
- "notNull": true,
3899
- "default": "current_timestamp"
3900
- },
3901
- "updated_at": {
3902
- "type": "TIMESTAMP",
3903
- "notNull": true,
3904
- "default": "current_timestamp"
3905
- }
3906
3814
  },
3907
- "indexes": [
3908
- {
3909
- "name": "analytics_event_collections_id_idx",
3910
- "columns": [
3911
- "id"
3912
- ]
3913
- },
3914
- {
3915
- "name": "analytics_event_collections_slug_context_idx",
3916
- "columns": [
3917
- "slug",
3918
- "context"
3919
- ],
3920
- "unique": true
3921
- }
3922
- ],
3923
- "version": "13d03b2a"
3924
- }
3925
- },
3926
- "@happyvertical/smrt-analytics:AnalyticsPropertyCollection": {
3927
- "name": "analyticspropertycollection",
3928
- "className": "AnalyticsPropertyCollection",
3929
- "qualifiedName": "@happyvertical/smrt-analytics:AnalyticsPropertyCollection",
3930
- "collection": "analyticsproperties",
3931
- "filePath": "/home/runner/_work/smrt/smrt/packages/analytics/src/collections/AnalyticsPropertyCollection.ts",
3932
- "packageName": "@happyvertical/smrt-analytics",
3933
- "fields": {},
3934
- "methods": {
3935
- "findByExternalId": {
3936
- "name": "findByExternalId",
3815
+ "getRelated": {
3816
+ "name": "getRelated",
3937
3817
  "async": true,
3938
3818
  "parameters": [
3939
3819
  {
3940
- "name": "externalId",
3820
+ "name": "fieldName",
3941
3821
  "type": "string",
3942
3822
  "optional": false
3823
+ },
3824
+ {
3825
+ "name": "opts",
3826
+ "type": "LoadRelatedOptions",
3827
+ "optional": true
3943
3828
  }
3944
3829
  ],
3945
- "returnType": "Promise<AnalyticsProperty | null>",
3830
+ "returnType": "Promise<any>",
3946
3831
  "isStatic": false,
3947
3832
  "isPublic": true
3948
3833
  },
3949
- "findByMeasurementId": {
3950
- "name": "findByMeasurementId",
3834
+ "getAvailableTools": {
3835
+ "name": "getAvailableTools",
3836
+ "async": false,
3837
+ "parameters": [],
3838
+ "returnType": "AITool[]",
3839
+ "isStatic": false,
3840
+ "isPublic": true
3841
+ },
3842
+ "executeToolCall": {
3843
+ "name": "executeToolCall",
3951
3844
  "async": true,
3952
3845
  "parameters": [
3953
3846
  {
3954
- "name": "measurementId",
3955
- "type": "string",
3847
+ "name": "toolCall",
3848
+ "type": "ToolCall",
3956
3849
  "optional": false
3957
3850
  }
3958
3851
  ],
3959
- "returnType": "Promise<AnalyticsProperty | null>",
3852
+ "returnType": "Promise<ToolCallResult>",
3960
3853
  "isStatic": false,
3961
3854
  "isPublic": true
3962
3855
  },
3963
- "findBySiteDomain": {
3964
- "name": "findBySiteDomain",
3856
+ "remember": {
3857
+ "name": "remember",
3965
3858
  "async": true,
3966
3859
  "parameters": [
3967
3860
  {
3968
- "name": "siteDomain",
3969
- "type": "string",
3861
+ "name": "options",
3862
+ "type": "object",
3970
3863
  "optional": false
3971
- },
3972
- {
3973
- "name": "provider",
3974
- "type": "AnalyticsProvider",
3975
- "optional": true
3976
3864
  }
3977
3865
  ],
3978
- "returnType": "Promise<AnalyticsProperty | null>",
3866
+ "returnType": "Promise<void>",
3979
3867
  "isStatic": false,
3980
3868
  "isPublic": true
3981
3869
  },
3982
- "findByProvider": {
3983
- "name": "findByProvider",
3870
+ "recall": {
3871
+ "name": "recall",
3984
3872
  "async": true,
3985
3873
  "parameters": [
3986
3874
  {
3987
- "name": "provider",
3988
- "type": "AnalyticsProvider",
3875
+ "name": "options",
3876
+ "type": "object",
3989
3877
  "optional": false
3990
3878
  }
3991
3879
  ],
3992
- "returnType": "Promise<AnalyticsProperty[]>",
3880
+ "returnType": "Promise",
3993
3881
  "isStatic": false,
3994
3882
  "isPublic": true
3995
3883
  },
3996
- "findGA4Properties": {
3997
- "name": "findGA4Properties",
3884
+ "recallAll": {
3885
+ "name": "recallAll",
3998
3886
  "async": true,
3999
- "parameters": [],
4000
- "returnType": "Promise<AnalyticsProperty[]>",
3887
+ "parameters": [
3888
+ {
3889
+ "name": "options",
3890
+ "type": "object",
3891
+ "optional": true
3892
+ }
3893
+ ],
3894
+ "returnType": "Promise<Map<string>>",
4001
3895
  "isStatic": false,
4002
3896
  "isPublic": true
4003
3897
  },
4004
- "findPlausibleSites": {
4005
- "name": "findPlausibleSites",
3898
+ "forget": {
3899
+ "name": "forget",
4006
3900
  "async": true,
4007
- "parameters": [],
4008
- "returnType": "Promise<AnalyticsProperty[]>",
3901
+ "parameters": [
3902
+ {
3903
+ "name": "options",
3904
+ "type": "object",
3905
+ "optional": false
3906
+ }
3907
+ ],
3908
+ "returnType": "Promise<void>",
4009
3909
  "isStatic": false,
4010
3910
  "isPublic": true
4011
3911
  },
4012
- "findMatomoSites": {
4013
- "name": "findMatomoSites",
3912
+ "forgetScope": {
3913
+ "name": "forgetScope",
4014
3914
  "async": true,
4015
- "parameters": [],
4016
- "returnType": "Promise<AnalyticsProperty[]>",
3915
+ "parameters": [
3916
+ {
3917
+ "name": "options",
3918
+ "type": "object",
3919
+ "optional": false
3920
+ }
3921
+ ],
3922
+ "returnType": "Promise<number>",
4017
3923
  "isStatic": false,
4018
3924
  "isPublic": true
4019
3925
  },
4020
- "findByStatus": {
4021
- "name": "findByStatus",
3926
+ "generateEmbeddings": {
3927
+ "name": "generateEmbeddings",
4022
3928
  "async": true,
4023
3929
  "parameters": [
4024
3930
  {
4025
- "name": "status",
4026
- "type": "AnalyticsPropertyStatus",
3931
+ "name": "options",
3932
+ "type": "GenerateEmbeddingsOptions",
3933
+ "optional": true
3934
+ }
3935
+ ],
3936
+ "returnType": "Promise<void>",
3937
+ "isStatic": false,
3938
+ "isPublic": true
3939
+ },
3940
+ "getEmbedding": {
3941
+ "name": "getEmbedding",
3942
+ "async": true,
3943
+ "parameters": [
3944
+ {
3945
+ "name": "fieldName",
3946
+ "type": "string",
4027
3947
  "optional": false
3948
+ },
3949
+ {
3950
+ "name": "model",
3951
+ "type": "string",
3952
+ "optional": true
4028
3953
  }
4029
3954
  ],
4030
- "returnType": "Promise<AnalyticsProperty[]>",
3955
+ "returnType": "Promise<number[] | null>",
4031
3956
  "isStatic": false,
4032
3957
  "isPublic": true
4033
3958
  },
4034
- "findActive": {
4035
- "name": "findActive",
3959
+ "hasStaleEmbeddings": {
3960
+ "name": "hasStaleEmbeddings",
4036
3961
  "async": true,
4037
3962
  "parameters": [],
4038
- "returnType": "Promise<AnalyticsProperty[]>",
3963
+ "returnType": "Promise<boolean>",
4039
3964
  "isStatic": false,
4040
3965
  "isPublic": true
4041
3966
  },
4042
- "findNeedingSync": {
4043
- "name": "findNeedingSync",
3967
+ "clearEmbeddings": {
3968
+ "name": "clearEmbeddings",
4044
3969
  "async": true,
3970
+ "parameters": [],
3971
+ "returnType": "Promise<void>",
3972
+ "isStatic": false,
3973
+ "isPublic": true
3974
+ },
3975
+ "getDimensions": {
3976
+ "name": "getDimensions",
3977
+ "async": false,
3978
+ "parameters": [],
3979
+ "returnType": "Array<object>",
3980
+ "isStatic": false,
3981
+ "isPublic": true
3982
+ },
3983
+ "setDimensions": {
3984
+ "name": "setDimensions",
3985
+ "async": false,
4045
3986
  "parameters": [
4046
3987
  {
4047
- "name": "hoursAgo",
4048
- "type": "number",
4049
- "optional": true
3988
+ "name": "dimensions",
3989
+ "type": "Array<object>",
3990
+ "optional": false
4050
3991
  }
4051
3992
  ],
4052
- "returnType": "Promise<AnalyticsProperty[]>",
3993
+ "returnType": "void",
4053
3994
  "isStatic": false,
4054
3995
  "isPublic": true
4055
- }
4056
- },
4057
- "decoratorConfig": {},
4058
- "extends": "SmrtCollection",
4059
- "extendsTypeArg": "AnalyticsProperty",
4060
- "exportName": "AnalyticsPropertyCollection",
4061
- "collectionExportName": "AnalyticsPropertyCollectionCollection",
4062
- "schema": {
4063
- "tableName": "analytics_property_collections",
4064
- "ddl": "CREATE TABLE IF NOT EXISTS \"analytics_property_collections\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp\n);",
4065
- "columns": {
4066
- "id": {
4067
- "type": "UUID",
4068
- "primaryKey": true,
4069
- "referenceKind": "id",
4070
- "notNull": true
4071
- },
4072
- "slug": {
4073
- "type": "TEXT",
4074
- "notNull": true
4075
- },
4076
- "context": {
4077
- "type": "TEXT",
4078
- "notNull": true,
4079
- "default": ""
4080
- },
4081
- "created_at": {
4082
- "type": "TIMESTAMP",
4083
- "notNull": true,
4084
- "default": "current_timestamp"
4085
- },
4086
- "updated_at": {
4087
- "type": "TIMESTAMP",
4088
- "notNull": true,
4089
- "default": "current_timestamp"
4090
- }
4091
3996
  },
4092
- "indexes": [
4093
- {
4094
- "name": "analytics_property_collections_id_idx",
4095
- "columns": [
4096
- "id"
4097
- ]
4098
- },
4099
- {
4100
- "name": "analytics_property_collections_slug_context_idx",
4101
- "columns": [
4102
- "slug",
4103
- "context"
4104
- ],
4105
- "unique": true
4106
- }
4107
- ],
4108
- "version": "a1c264b1"
4109
- }
4110
- },
4111
- "@happyvertical/smrt-analytics:AnalyticsReportCollection": {
4112
- "name": "analyticsreportcollection",
4113
- "className": "AnalyticsReportCollection",
4114
- "qualifiedName": "@happyvertical/smrt-analytics:AnalyticsReportCollection",
4115
- "collection": "analyticsreports",
4116
- "filePath": "/home/runner/_work/smrt/smrt/packages/analytics/src/collections/AnalyticsReportCollection.ts",
4117
- "packageName": "@happyvertical/smrt-analytics",
4118
- "fields": {},
4119
- "methods": {
4120
- "findByProperty": {
4121
- "name": "findByProperty",
4122
- "async": true,
3997
+ "getMetrics": {
3998
+ "name": "getMetrics",
3999
+ "async": false,
4000
+ "parameters": [],
4001
+ "returnType": "Array<object>",
4002
+ "isStatic": false,
4003
+ "isPublic": true
4004
+ },
4005
+ "setMetrics": {
4006
+ "name": "setMetrics",
4007
+ "async": false,
4123
4008
  "parameters": [
4124
4009
  {
4125
- "name": "propertyId",
4126
- "type": "string",
4010
+ "name": "metrics",
4011
+ "type": "Array<object>",
4127
4012
  "optional": false
4128
4013
  }
4129
4014
  ],
4130
- "returnType": "Promise<AnalyticsReport[]>",
4015
+ "returnType": "void",
4131
4016
  "isStatic": false,
4132
4017
  "isPublic": true
4133
4018
  },
4134
- "findByStatus": {
4135
- "name": "findByStatus",
4136
- "async": true,
4019
+ "getResultData": {
4020
+ "name": "getResultData",
4021
+ "async": false,
4022
+ "parameters": [],
4023
+ "returnType": "Record<string> | null",
4024
+ "isStatic": false,
4025
+ "isPublic": true
4026
+ },
4027
+ "setResultData": {
4028
+ "name": "setResultData",
4029
+ "async": false,
4137
4030
  "parameters": [
4138
4031
  {
4139
- "name": "status",
4140
- "type": "ReportStatus",
4032
+ "name": "data",
4033
+ "type": "Record<string>",
4141
4034
  "optional": false
4142
4035
  }
4143
4036
  ],
4144
- "returnType": "Promise<AnalyticsReport[]>",
4145
- "isStatic": false,
4146
- "isPublic": true
4147
- },
4148
- "findDrafts": {
4149
- "name": "findDrafts",
4150
- "async": true,
4151
- "parameters": [],
4152
- "returnType": "Promise<AnalyticsReport[]>",
4153
- "isStatic": false,
4154
- "isPublic": true
4155
- },
4156
- "findScheduled": {
4157
- "name": "findScheduled",
4158
- "async": true,
4159
- "parameters": [],
4160
- "returnType": "Promise<AnalyticsReport[]>",
4037
+ "returnType": "void",
4161
4038
  "isStatic": false,
4162
4039
  "isPublic": true
4163
4040
  },
4164
- "findCompleted": {
4165
- "name": "findCompleted",
4166
- "async": true,
4041
+ "markRunning": {
4042
+ "name": "markRunning",
4043
+ "async": false,
4167
4044
  "parameters": [],
4168
- "returnType": "Promise<AnalyticsReport[]>",
4045
+ "returnType": "void",
4169
4046
  "isStatic": false,
4170
4047
  "isPublic": true
4171
4048
  },
4172
- "findFailed": {
4173
- "name": "findFailed",
4174
- "async": true,
4175
- "parameters": [],
4176
- "returnType": "Promise<AnalyticsReport[]>",
4049
+ "markCompleted": {
4050
+ "name": "markCompleted",
4051
+ "async": false,
4052
+ "parameters": [
4053
+ {
4054
+ "name": "rowCount",
4055
+ "type": "number",
4056
+ "optional": false
4057
+ }
4058
+ ],
4059
+ "returnType": "void",
4177
4060
  "isStatic": false,
4178
4061
  "isPublic": true
4179
4062
  },
4180
- "findByFrequency": {
4181
- "name": "findByFrequency",
4182
- "async": true,
4063
+ "markFailed": {
4064
+ "name": "markFailed",
4065
+ "async": false,
4183
4066
  "parameters": [
4184
4067
  {
4185
- "name": "frequency",
4186
- "type": "ReportFrequency",
4068
+ "name": "error",
4069
+ "type": "string",
4187
4070
  "optional": false
4188
4071
  }
4189
4072
  ],
4190
- "returnType": "Promise<AnalyticsReport[]>",
4073
+ "returnType": "void",
4191
4074
  "isStatic": false,
4192
4075
  "isPublic": true
4193
4076
  },
4194
- "findRecurring": {
4195
- "name": "findRecurring",
4196
- "async": true,
4077
+ "calculateNextRun": {
4078
+ "name": "calculateNextRun",
4079
+ "async": false,
4197
4080
  "parameters": [],
4198
- "returnType": "Promise<AnalyticsReport[]>",
4081
+ "returnType": "void",
4199
4082
  "isStatic": false,
4200
4083
  "isPublic": true
4201
4084
  },
4202
- "findDue": {
4203
- "name": "findDue",
4204
- "async": true,
4085
+ "isDue": {
4086
+ "name": "isDue",
4087
+ "async": false,
4205
4088
  "parameters": [],
4206
- "returnType": "Promise<AnalyticsReport[]>",
4089
+ "returnType": "boolean",
4207
4090
  "isStatic": false,
4208
4091
  "isPublic": true
4209
4092
  },
4210
- "findByPropertyAndStatus": {
4211
- "name": "findByPropertyAndStatus",
4093
+ "analyzeResults": {
4094
+ "name": "analyzeResults",
4212
4095
  "async": true,
4213
4096
  "parameters": [
4214
4097
  {
4215
- "name": "propertyId",
4216
- "type": "string",
4217
- "optional": false
4218
- },
4219
- {
4220
- "name": "status",
4221
- "type": "ReportStatus",
4222
- "optional": false
4098
+ "name": "_options",
4099
+ "type": "Record<string>",
4100
+ "optional": true
4223
4101
  }
4224
4102
  ],
4225
- "returnType": "Promise<AnalyticsReport[]>",
4103
+ "returnType": "Promise<object>",
4226
4104
  "isStatic": false,
4227
4105
  "isPublic": true
4228
4106
  },
4229
- "findRecentlyRun": {
4230
- "name": "findRecentlyRun",
4107
+ "hasPositiveTrends": {
4108
+ "name": "hasPositiveTrends",
4231
4109
  "async": true,
4232
- "parameters": [
4233
- {
4234
- "name": "hoursAgo",
4235
- "type": "number",
4236
- "optional": true
4237
- }
4238
- ],
4239
- "returnType": "Promise<AnalyticsReport[]>",
4110
+ "parameters": [],
4111
+ "returnType": "Promise<boolean>",
4240
4112
  "isStatic": false,
4241
4113
  "isPublic": true
4242
4114
  }
4243
4115
  },
4244
- "decoratorConfig": {},
4245
- "extends": "SmrtCollection",
4246
- "extendsTypeArg": "AnalyticsReport",
4247
- "exportName": "AnalyticsReportCollection",
4248
- "collectionExportName": "AnalyticsReportCollectionCollection",
4116
+ "decoratorConfig": {
4117
+ "tableStrategy": "sti",
4118
+ "api": {
4119
+ "include": [
4120
+ "list",
4121
+ "get",
4122
+ "create",
4123
+ "update",
4124
+ "run"
4125
+ ]
4126
+ },
4127
+ "mcp": {
4128
+ "include": [
4129
+ "list",
4130
+ "get",
4131
+ "run",
4132
+ "analyze"
4133
+ ]
4134
+ },
4135
+ "cli": true,
4136
+ "tenantScoped": {
4137
+ "mode": "optional"
4138
+ }
4139
+ },
4140
+ "extends": "SmrtObject",
4141
+ "exportName": "AnalyticsReport",
4142
+ "collectionExportName": "AnalyticsReportCollection",
4249
4143
  "schema": {
4250
- "tableName": "analytics_report_collections",
4251
- "ddl": "CREATE TABLE IF NOT EXISTS \"analytics_report_collections\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp\n);",
4144
+ "tableName": "analytics_reports",
4145
+ "ddl": "CREATE TABLE IF NOT EXISTS \"analytics_reports\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"_meta_type\" TEXT NOT NULL,\n \"_meta_data\" JSON,\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID,\n \"property_id\" UUID,\n \"name\" TEXT DEFAULT '',\n \"description\" TEXT DEFAULT '',\n \"dimensions\" TEXT DEFAULT '[]',\n \"metrics\" TEXT DEFAULT '[]',\n \"date_range_start\" TEXT DEFAULT '7daysAgo',\n \"date_range_end\" TEXT DEFAULT 'today',\n \"dimension_filter\" TEXT DEFAULT '',\n \"metric_filter\" TEXT DEFAULT '',\n \"order_by\" TEXT DEFAULT '[]',\n \"max_results\" INTEGER DEFAULT 0,\n \"status\" TEXT,\n \"frequency\" TEXT,\n \"last_run_at\" TIMESTAMP,\n \"next_run_at\" TIMESTAMP,\n \"result_data\" TEXT DEFAULT '',\n \"row_count\" INTEGER DEFAULT 0,\n \"last_error\" TEXT DEFAULT ''\n);",
4252
4146
  "columns": {
4253
4147
  "id": {
4254
4148
  "type": "UUID",
@@ -4265,6 +4159,14 @@
4265
4159
  "notNull": true,
4266
4160
  "default": ""
4267
4161
  },
4162
+ "_meta_type": {
4163
+ "type": "TEXT",
4164
+ "notNull": true
4165
+ },
4166
+ "_meta_data": {
4167
+ "type": "JSON",
4168
+ "notNull": false
4169
+ },
4268
4170
  "created_at": {
4269
4171
  "type": "TIMESTAMP",
4270
4172
  "notNull": true,
@@ -4274,25 +4176,123 @@
4274
4176
  "type": "TIMESTAMP",
4275
4177
  "notNull": true,
4276
4178
  "default": "current_timestamp"
4179
+ },
4180
+ "tenant_id": {
4181
+ "type": "UUID",
4182
+ "referenceKind": "tenantId",
4183
+ "notNull": false
4184
+ },
4185
+ "property_id": {
4186
+ "type": "UUID",
4187
+ "referenceKind": "foreignKey",
4188
+ "notNull": false
4189
+ },
4190
+ "name": {
4191
+ "type": "TEXT",
4192
+ "notNull": false,
4193
+ "default": ""
4194
+ },
4195
+ "description": {
4196
+ "type": "TEXT",
4197
+ "notNull": false,
4198
+ "default": ""
4199
+ },
4200
+ "dimensions": {
4201
+ "type": "TEXT",
4202
+ "notNull": false,
4203
+ "default": "[]"
4204
+ },
4205
+ "metrics": {
4206
+ "type": "TEXT",
4207
+ "notNull": false,
4208
+ "default": "[]"
4209
+ },
4210
+ "date_range_start": {
4211
+ "type": "TEXT",
4212
+ "notNull": false,
4213
+ "default": "7daysAgo"
4214
+ },
4215
+ "date_range_end": {
4216
+ "type": "TEXT",
4217
+ "notNull": false,
4218
+ "default": "today"
4219
+ },
4220
+ "dimension_filter": {
4221
+ "type": "TEXT",
4222
+ "notNull": false,
4223
+ "default": ""
4224
+ },
4225
+ "metric_filter": {
4226
+ "type": "TEXT",
4227
+ "notNull": false,
4228
+ "default": ""
4229
+ },
4230
+ "order_by": {
4231
+ "type": "TEXT",
4232
+ "notNull": false,
4233
+ "default": "[]"
4234
+ },
4235
+ "max_results": {
4236
+ "type": "INTEGER",
4237
+ "notNull": false,
4238
+ "default": 0
4239
+ },
4240
+ "status": {
4241
+ "type": "TEXT",
4242
+ "notNull": false
4243
+ },
4244
+ "frequency": {
4245
+ "type": "TEXT",
4246
+ "notNull": false
4247
+ },
4248
+ "last_run_at": {
4249
+ "type": "TIMESTAMP",
4250
+ "notNull": false
4251
+ },
4252
+ "next_run_at": {
4253
+ "type": "TIMESTAMP",
4254
+ "notNull": false
4255
+ },
4256
+ "result_data": {
4257
+ "type": "TEXT",
4258
+ "notNull": false,
4259
+ "default": ""
4260
+ },
4261
+ "row_count": {
4262
+ "type": "INTEGER",
4263
+ "notNull": false,
4264
+ "default": 0
4265
+ },
4266
+ "last_error": {
4267
+ "type": "TEXT",
4268
+ "notNull": false,
4269
+ "default": ""
4277
4270
  }
4278
4271
  },
4279
4272
  "indexes": [
4280
4273
  {
4281
- "name": "analytics_report_collections_id_idx",
4274
+ "name": "analytics_reports_id_idx",
4282
4275
  "columns": [
4283
4276
  "id"
4284
4277
  ]
4285
4278
  },
4286
4279
  {
4287
- "name": "analytics_report_collections_slug_context_idx",
4280
+ "name": "analytics_reports_slug_context_meta_type_idx",
4288
4281
  "columns": [
4289
4282
  "slug",
4290
- "context"
4283
+ "context",
4284
+ "_meta_type"
4291
4285
  ],
4292
4286
  "unique": true
4287
+ },
4288
+ {
4289
+ "name": "analytics_reports_meta_type_idx",
4290
+ "columns": [
4291
+ "_meta_type"
4292
+ ]
4293
4293
  }
4294
4294
  ],
4295
- "version": "74445ee1"
4295
+ "version": "cecde8c6"
4296
4296
  }
4297
4297
  }
4298
4298
  },