@happyvertical/smrt-analytics 0.44.1 → 0.45.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,7 +2,7 @@
2
2
  "version": "1.0.0",
3
3
  "timestamp": 0,
4
4
  "packageName": "@happyvertical/smrt-analytics",
5
- "packageVersion": "0.44.1",
5
+ "packageVersion": "0.45.0",
6
6
  "objects": {
7
7
  "@happyvertical/smrt-analytics:AnalyticsDataStreamCollection": {
8
8
  "name": "analyticsdatastreamcollection",
@@ -964,591 +964,432 @@
964
964
  }
965
965
  },
966
966
  "methods": {
967
- "withDatabase": {
968
- "name": "withDatabase",
969
- "async": true,
970
- "parameters": [
971
- {
972
- "name": "db",
973
- "type": "DatabaseInterface",
974
- "optional": false
975
- },
976
- {
977
- "name": "operation",
978
- "type": "Function",
979
- "optional": false
980
- }
981
- ],
982
- "returnType": "Promise<T>",
983
- "isStatic": false,
984
- "isPublic": true
985
- },
986
- "getAiUsageSnapshot": {
987
- "name": "getAiUsageSnapshot",
967
+ "isWeb": {
968
+ "name": "isWeb",
988
969
  "async": false,
989
970
  "parameters": [],
990
- "returnType": "AiUsageSnapshot | undefined",
971
+ "returnType": "boolean",
991
972
  "isStatic": false,
992
973
  "isPublic": true
993
974
  },
994
- "resetAiUsage": {
995
- "name": "resetAiUsage",
975
+ "isIOS": {
976
+ "name": "isIOS",
996
977
  "async": false,
997
978
  "parameters": [],
998
- "returnType": "void",
999
- "isStatic": false,
1000
- "isPublic": true
1001
- },
1002
- "listAiUsage": {
1003
- "name": "listAiUsage",
1004
- "async": true,
1005
- "parameters": [
1006
- {
1007
- "name": "options",
1008
- "type": "AiUsageListOptions",
1009
- "optional": true
1010
- }
1011
- ],
1012
- "returnType": "Promise<SmrtAiUsageRecord[]>",
1013
- "isStatic": false,
1014
- "isPublic": true
1015
- },
1016
- "summarizeAiUsage": {
1017
- "name": "summarizeAiUsage",
1018
- "async": true,
1019
- "parameters": [
1020
- {
1021
- "name": "options",
1022
- "type": "AiUsageSummaryOptions",
1023
- "optional": true
1024
- }
1025
- ],
1026
- "returnType": "Promise<Record<string, AiUsageStats>>",
979
+ "returnType": "boolean",
1027
980
  "isStatic": false,
1028
981
  "isPublic": true
1029
982
  },
1030
- "destroy": {
1031
- "name": "destroy",
983
+ "isAndroid": {
984
+ "name": "isAndroid",
1032
985
  "async": false,
1033
986
  "parameters": [],
1034
- "returnType": "void",
987
+ "returnType": "boolean",
1035
988
  "isStatic": false,
1036
989
  "isPublic": true
1037
990
  },
1038
- "markAsPersisted": {
1039
- "name": "markAsPersisted",
991
+ "isMobileApp": {
992
+ "name": "isMobileApp",
1040
993
  "async": false,
1041
994
  "parameters": [],
1042
- "returnType": "void",
995
+ "returnType": "boolean",
1043
996
  "isStatic": false,
1044
997
  "isPublic": true
1045
998
  },
1046
- "requireInsertOnSave": {
1047
- "name": "requireInsertOnSave",
999
+ "getPlatformId": {
1000
+ "name": "getPlatformId",
1048
1001
  "async": false,
1049
1002
  "parameters": [],
1050
- "returnType": "void",
1003
+ "returnType": "string",
1051
1004
  "isStatic": false,
1052
1005
  "isPublic": true
1006
+ }
1007
+ },
1008
+ "decoratorConfig": {
1009
+ "tableStrategy": "sti",
1010
+ "api": {
1011
+ "include": [
1012
+ "list",
1013
+ "get",
1014
+ "create",
1015
+ "update"
1016
+ ]
1053
1017
  },
1054
- "withTransaction": {
1055
- "name": "withTransaction",
1056
- "async": true,
1057
- "parameters": [
1058
- {
1059
- "name": "operation",
1060
- "type": "Function",
1061
- "optional": false
1062
- }
1063
- ],
1064
- "returnType": "Promise<T>",
1065
- "isStatic": false,
1066
- "isPublic": true
1018
+ "mcp": {
1019
+ "include": [
1020
+ "list",
1021
+ "get"
1022
+ ]
1067
1023
  },
1068
- "initialize": {
1069
- "name": "initialize",
1070
- "async": true,
1071
- "parameters": [],
1072
- "returnType": "Promise",
1073
- "isStatic": false,
1074
- "isPublic": true
1024
+ "cli": true,
1025
+ "tenantScoped": {
1026
+ "mode": "optional"
1075
1027
  },
1076
- "loadDataFromDb": {
1077
- "name": "loadDataFromDb",
1078
- "async": true,
1079
- "parameters": [
1080
- {
1081
- "name": "data",
1082
- "type": "Record<string>",
1083
- "optional": false
1028
+ "conflictColumns": [
1029
+ "tenant_id",
1030
+ "slug",
1031
+ "context",
1032
+ "_meta_type"
1033
+ ]
1034
+ },
1035
+ "extends": "SmrtObject",
1036
+ "exportName": "AnalyticsDataStream",
1037
+ "collectionExportName": "AnalyticsDataStreamCollection",
1038
+ "schema": {
1039
+ "tableName": "analytics_data_streams",
1040
+ "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);",
1041
+ "columns": {
1042
+ "id": {
1043
+ "type": "UUID",
1044
+ "primaryKey": true,
1045
+ "referenceKind": "id",
1046
+ "notNull": true
1047
+ },
1048
+ "slug": {
1049
+ "type": "TEXT",
1050
+ "notNull": true
1051
+ },
1052
+ "context": {
1053
+ "type": "TEXT",
1054
+ "notNull": true,
1055
+ "default": ""
1056
+ },
1057
+ "_meta_type": {
1058
+ "type": "TEXT",
1059
+ "notNull": true
1060
+ },
1061
+ "_meta_data": {
1062
+ "type": "JSON",
1063
+ "notNull": false
1064
+ },
1065
+ "created_at": {
1066
+ "type": "TIMESTAMP",
1067
+ "notNull": true,
1068
+ "default": "current_timestamp"
1069
+ },
1070
+ "updated_at": {
1071
+ "type": "TIMESTAMP",
1072
+ "notNull": true,
1073
+ "default": "current_timestamp"
1074
+ },
1075
+ "tenant_id": {
1076
+ "type": "UUID",
1077
+ "referenceKind": "tenantId",
1078
+ "notNull": false
1079
+ },
1080
+ "property_id": {
1081
+ "type": "UUID",
1082
+ "referenceKind": "foreignKey",
1083
+ "notNull": false,
1084
+ "foreignKey": {
1085
+ "table": "analytics_properties",
1086
+ "column": "id",
1087
+ "onDelete": "NO ACTION",
1088
+ "onUpdate": "CASCADE"
1084
1089
  }
1085
- ],
1086
- "returnType": "any",
1087
- "isStatic": false,
1088
- "isPublic": true
1089
- },
1090
- "getFields": {
1091
- "name": "getFields",
1092
- "async": true,
1093
- "parameters": [],
1094
- "returnType": "Promise<any>",
1095
- "isStatic": false,
1096
- "isPublic": true
1090
+ },
1091
+ "display_name": {
1092
+ "type": "TEXT",
1093
+ "notNull": false,
1094
+ "default": ""
1095
+ },
1096
+ "stream_type": {
1097
+ "type": "TEXT",
1098
+ "notNull": false
1099
+ },
1100
+ "external_id": {
1101
+ "type": "TEXT",
1102
+ "notNull": false,
1103
+ "default": ""
1104
+ },
1105
+ "measurement_id": {
1106
+ "type": "TEXT",
1107
+ "notNull": false,
1108
+ "default": ""
1109
+ },
1110
+ "firebase_app_id": {
1111
+ "type": "TEXT",
1112
+ "notNull": false,
1113
+ "default": ""
1114
+ },
1115
+ "default_uri": {
1116
+ "type": "TEXT",
1117
+ "notNull": false,
1118
+ "default": ""
1119
+ },
1120
+ "bundle_id": {
1121
+ "type": "TEXT",
1122
+ "notNull": false,
1123
+ "default": ""
1124
+ },
1125
+ "package_name": {
1126
+ "type": "TEXT",
1127
+ "notNull": false,
1128
+ "default": ""
1129
+ },
1130
+ "status": {
1131
+ "type": "TEXT",
1132
+ "notNull": false
1133
+ },
1134
+ "enhanced_measurement": {
1135
+ "type": "BOOLEAN",
1136
+ "notNull": false,
1137
+ "default": true
1138
+ }
1097
1139
  },
1098
- "toJSON": {
1099
- "name": "toJSON",
1100
- "async": false,
1101
- "parameters": [],
1102
- "returnType": "any",
1103
- "isStatic": false,
1104
- "isPublic": true
1140
+ "indexes": [
1141
+ {
1142
+ "name": "analytics_data_streams_slug_context_meta_type_idx",
1143
+ "columns": [
1144
+ "tenant_id",
1145
+ "slug",
1146
+ "context",
1147
+ "_meta_type"
1148
+ ],
1149
+ "unique": true
1150
+ },
1151
+ {
1152
+ "name": "analytics_data_streams_meta_type_idx",
1153
+ "columns": [
1154
+ "_meta_type"
1155
+ ]
1156
+ },
1157
+ {
1158
+ "name": "analytics_data_streams_tenant_id_created_at_idx",
1159
+ "columns": [
1160
+ "tenant_id",
1161
+ "created_at"
1162
+ ]
1163
+ },
1164
+ {
1165
+ "name": "analytics_data_streams_property_id_idx",
1166
+ "columns": [
1167
+ "property_id"
1168
+ ]
1169
+ }
1170
+ ],
1171
+ "version": "851609ba"
1172
+ }
1173
+ },
1174
+ "@happyvertical/smrt-analytics:AnalyticsEvent": {
1175
+ "name": "analyticsevent",
1176
+ "className": "AnalyticsEvent",
1177
+ "qualifiedName": "@happyvertical/smrt-analytics:AnalyticsEvent",
1178
+ "collection": "analyticsevents",
1179
+ "filePath": "/home/runner/work/smrt/smrt/packages/analytics/src/models/AnalyticsEvent.ts",
1180
+ "packageName": "@happyvertical/smrt-analytics",
1181
+ "fields": {
1182
+ "created_at": {
1183
+ "type": "datetime",
1184
+ "required": false
1105
1185
  },
1106
- "toPlainObject": {
1107
- "name": "toPlainObject",
1108
- "async": false,
1109
- "parameters": [],
1110
- "returnType": "Record<string>",
1111
- "isStatic": false,
1112
- "isPublic": true
1186
+ "updated_at": {
1187
+ "type": "datetime",
1188
+ "required": false
1113
1189
  },
1114
- "toPublicJSON": {
1115
- "name": "toPublicJSON",
1116
- "async": false,
1117
- "parameters": [
1118
- {
1119
- "name": "options",
1120
- "type": "PublicJsonOptions",
1121
- "optional": true
1190
+ "tenantId": {
1191
+ "type": "text",
1192
+ "required": false,
1193
+ "_meta": {
1194
+ "sqlType": "UUID",
1195
+ "nullable": true,
1196
+ "__tenancy": {
1197
+ "isTenantIdField": true,
1198
+ "autoFilter": true,
1199
+ "required": false,
1200
+ "autoPopulate": true,
1201
+ "nullable": true,
1202
+ "mode": "optional",
1203
+ "field": "tenantId",
1204
+ "allowSuperAdminBypass": false
1122
1205
  }
1123
- ],
1124
- "returnType": "Record<string>",
1125
- "isStatic": false,
1126
- "isPublic": true
1206
+ }
1127
1207
  },
1128
- "getId": {
1129
- "name": "getId",
1130
- "async": true,
1131
- "parameters": [],
1132
- "returnType": "any",
1133
- "isStatic": false,
1134
- "isPublic": true
1208
+ "propertyId": {
1209
+ "type": "foreignKey",
1210
+ "required": false,
1211
+ "related": "AnalyticsProperty"
1135
1212
  },
1136
- "getSlug": {
1137
- "name": "getSlug",
1138
- "async": true,
1139
- "parameters": [],
1140
- "returnType": "any",
1141
- "isStatic": false,
1142
- "isPublic": true
1213
+ "eventName": {
1214
+ "type": "text",
1215
+ "required": false,
1216
+ "default": ""
1143
1217
  },
1144
- "getSavedId": {
1145
- "name": "getSavedId",
1146
- "async": true,
1147
- "parameters": [],
1148
- "returnType": "any",
1149
- "isStatic": false,
1150
- "isPublic": true
1218
+ "clientId": {
1219
+ "type": "text",
1220
+ "required": false,
1221
+ "default": ""
1151
1222
  },
1152
- "isSaved": {
1153
- "name": "isSaved",
1154
- "async": true,
1155
- "parameters": [],
1156
- "returnType": "any",
1157
- "isStatic": false,
1158
- "isPublic": true
1223
+ "userId": {
1224
+ "type": "text",
1225
+ "required": false,
1226
+ "default": ""
1159
1227
  },
1160
- "save": {
1161
- "name": "save",
1162
- "async": true,
1163
- "parameters": [
1164
- {
1165
- "name": "options",
1166
- "type": "SmrtSaveOptions",
1167
- "optional": true
1168
- }
1169
- ],
1170
- "returnType": "any",
1171
- "isStatic": false,
1172
- "isPublic": true
1228
+ "params": {
1229
+ "type": "text",
1230
+ "required": false,
1231
+ "default": "{}"
1173
1232
  },
1174
- "claimRevision": {
1175
- "name": "claimRevision",
1176
- "async": true,
1177
- "parameters": [
1178
- {
1179
- "name": "expectedUpdatedAt",
1180
- "type": "Date | string",
1181
- "optional": false
1182
- }
1183
- ],
1184
- "returnType": "Promise",
1185
- "isStatic": false,
1186
- "isPublic": true
1233
+ "eventTimestamp": {
1234
+ "type": "datetime",
1235
+ "required": false
1187
1236
  },
1188
- "classifyConstraintError": {
1189
- "name": "classifyConstraintError",
1190
- "async": false,
1191
- "parameters": [
1192
- {
1193
- "name": "message",
1194
- "type": "string",
1195
- "optional": false
1196
- }
1197
- ],
1198
- "returnType": "'unique' | 'not_null' | null",
1199
- "isStatic": true,
1200
- "isPublic": true
1237
+ "status": {
1238
+ "type": "text",
1239
+ "required": false
1201
1240
  },
1202
- "loadFromId": {
1203
- "name": "loadFromId",
1204
- "async": true,
1205
- "parameters": [],
1206
- "returnType": "any",
1207
- "isStatic": false,
1208
- "isPublic": true
1241
+ "sentAt": {
1242
+ "type": "datetime",
1243
+ "required": false
1209
1244
  },
1210
- "loadFromSlug": {
1211
- "name": "loadFromSlug",
1212
- "async": true,
1245
+ "errorMessage": {
1246
+ "type": "text",
1247
+ "required": false,
1248
+ "default": ""
1249
+ },
1250
+ "retryCount": {
1251
+ "type": "integer",
1252
+ "required": false,
1253
+ "default": 0
1254
+ },
1255
+ "nonPersonalizedAds": {
1256
+ "type": "boolean",
1257
+ "required": false,
1258
+ "default": false
1259
+ },
1260
+ "sessionId": {
1261
+ "type": "text",
1262
+ "required": false,
1263
+ "default": ""
1264
+ },
1265
+ "pagePath": {
1266
+ "type": "text",
1267
+ "required": false,
1268
+ "default": ""
1269
+ },
1270
+ "pageTitle": {
1271
+ "type": "text",
1272
+ "required": false,
1273
+ "default": ""
1274
+ },
1275
+ "userAgent": {
1276
+ "type": "text",
1277
+ "required": false,
1278
+ "default": ""
1279
+ },
1280
+ "ipAddress": {
1281
+ "type": "text",
1282
+ "required": false,
1283
+ "default": ""
1284
+ }
1285
+ },
1286
+ "methods": {
1287
+ "getParams": {
1288
+ "name": "getParams",
1289
+ "async": false,
1213
1290
  "parameters": [],
1214
- "returnType": "any",
1291
+ "returnType": "Record<string, string | number | boolean>",
1215
1292
  "isStatic": false,
1216
1293
  "isPublic": true
1217
1294
  },
1218
- "is": {
1219
- "name": "is",
1220
- "async": true,
1295
+ "setParams": {
1296
+ "name": "setParams",
1297
+ "async": false,
1221
1298
  "parameters": [
1222
1299
  {
1223
- "name": "criteria",
1224
- "type": "string",
1300
+ "name": "params",
1301
+ "type": "Record<string, string | number | boolean>",
1225
1302
  "optional": false
1226
- },
1227
- {
1228
- "name": "options",
1229
- "type": "AiOperationOptions",
1230
- "optional": true
1231
1303
  }
1232
1304
  ],
1233
- "returnType": "any",
1305
+ "returnType": "void",
1234
1306
  "isStatic": false,
1235
1307
  "isPublic": true
1236
1308
  },
1237
- "do": {
1238
- "name": "do",
1239
- "async": true,
1309
+ "addParam": {
1310
+ "name": "addParam",
1311
+ "async": false,
1240
1312
  "parameters": [
1241
1313
  {
1242
- "name": "instructions",
1314
+ "name": "key",
1243
1315
  "type": "string",
1244
1316
  "optional": false
1245
1317
  },
1246
1318
  {
1247
- "name": "options",
1248
- "type": "AiOperationOptions",
1249
- "optional": true
1250
- }
1251
- ],
1252
- "returnType": "any",
1253
- "isStatic": false,
1254
- "isPublic": true
1255
- },
1256
- "describe": {
1257
- "name": "describe",
1258
- "async": true,
1259
- "parameters": [
1260
- {
1261
- "name": "options",
1262
- "type": "AiOperationOptions",
1263
- "optional": true
1319
+ "name": "value",
1320
+ "type": "string | number | boolean",
1321
+ "optional": false
1264
1322
  }
1265
1323
  ],
1266
- "returnType": "any",
1324
+ "returnType": "void",
1267
1325
  "isStatic": false,
1268
1326
  "isPublic": true
1269
1327
  },
1270
- "delete": {
1271
- "name": "delete",
1272
- "async": true,
1273
- "parameters": [
1274
- {
1275
- "name": "options",
1276
- "type": "SmrtDeleteOptions",
1277
- "optional": true
1278
- }
1279
- ],
1280
- "returnType": "Promise<void>",
1328
+ "isPageview": {
1329
+ "name": "isPageview",
1330
+ "async": false,
1331
+ "parameters": [],
1332
+ "returnType": "boolean",
1281
1333
  "isStatic": false,
1282
1334
  "isPublic": true
1283
1335
  },
1284
- "isRelatedLoaded": {
1285
- "name": "isRelatedLoaded",
1336
+ "isConversion": {
1337
+ "name": "isConversion",
1286
1338
  "async": false,
1287
- "parameters": [
1288
- {
1289
- "name": "fieldName",
1290
- "type": "string",
1291
- "optional": false
1292
- }
1293
- ],
1339
+ "parameters": [],
1294
1340
  "returnType": "boolean",
1295
1341
  "isStatic": false,
1296
1342
  "isPublic": true
1297
1343
  },
1298
- "_setLoadedRelationship": {
1299
- "name": "_setLoadedRelationship",
1344
+ "markSent": {
1345
+ "name": "markSent",
1300
1346
  "async": false,
1301
- "parameters": [
1302
- {
1303
- "name": "fieldName",
1304
- "type": "string",
1305
- "optional": false
1306
- },
1307
- {
1308
- "name": "value",
1309
- "type": "any",
1310
- "optional": false
1311
- }
1312
- ],
1347
+ "parameters": [],
1313
1348
  "returnType": "void",
1314
1349
  "isStatic": false,
1315
1350
  "isPublic": true
1316
1351
  },
1317
- "loadRelated": {
1318
- "name": "loadRelated",
1319
- "async": true,
1352
+ "markFailed": {
1353
+ "name": "markFailed",
1354
+ "async": false,
1320
1355
  "parameters": [
1321
1356
  {
1322
- "name": "fieldName",
1357
+ "name": "error",
1323
1358
  "type": "string",
1324
1359
  "optional": false
1325
- },
1326
- {
1327
- "name": "opts",
1328
- "type": "LoadRelatedOptions",
1329
- "optional": true
1330
1360
  }
1331
1361
  ],
1332
- "returnType": "Promise<any>",
1362
+ "returnType": "void",
1333
1363
  "isStatic": false,
1334
1364
  "isPublic": true
1335
1365
  },
1336
- "loadRelatedMany": {
1337
- "name": "loadRelatedMany",
1338
- "async": true,
1339
- "parameters": [
1340
- {
1341
- "name": "fieldName",
1342
- "type": "string",
1343
- "optional": false
1344
- },
1345
- {
1346
- "name": "opts",
1347
- "type": "LoadRelatedOptions",
1348
- "optional": true
1349
- }
1350
- ],
1351
- "returnType": "Promise<any[]>",
1366
+ "resetForRetry": {
1367
+ "name": "resetForRetry",
1368
+ "async": false,
1369
+ "parameters": [],
1370
+ "returnType": "void",
1352
1371
  "isStatic": false,
1353
1372
  "isPublic": true
1354
1373
  },
1355
- "getRelated": {
1356
- "name": "getRelated",
1357
- "async": true,
1374
+ "shouldRetry": {
1375
+ "name": "shouldRetry",
1376
+ "async": false,
1358
1377
  "parameters": [
1359
1378
  {
1360
- "name": "fieldName",
1361
- "type": "string",
1362
- "optional": false
1363
- },
1364
- {
1365
- "name": "opts",
1366
- "type": "LoadRelatedOptions",
1379
+ "name": "maxRetries",
1380
+ "type": "number",
1367
1381
  "optional": true
1368
1382
  }
1369
1383
  ],
1370
- "returnType": "Promise<any>",
1384
+ "returnType": "boolean",
1371
1385
  "isStatic": false,
1372
1386
  "isPublic": true
1373
1387
  },
1374
- "getAvailableTools": {
1375
- "name": "getAvailableTools",
1376
- "async": false,
1377
- "parameters": [],
1378
- "returnType": "AITool[]",
1379
- "isStatic": false,
1380
- "isPublic": true
1381
- },
1382
- "executeToolCall": {
1383
- "name": "executeToolCall",
1384
- "async": true,
1385
- "parameters": [
1386
- {
1387
- "name": "toolCall",
1388
- "type": "ToolCall",
1389
- "optional": false
1390
- }
1391
- ],
1392
- "returnType": "Promise<ToolCallResult>",
1393
- "isStatic": false,
1394
- "isPublic": true
1395
- },
1396
- "remember": {
1397
- "name": "remember",
1398
- "async": true,
1399
- "parameters": [
1400
- {
1401
- "name": "options",
1402
- "type": "object",
1403
- "optional": false
1404
- }
1405
- ],
1406
- "returnType": "Promise<void>",
1407
- "isStatic": false,
1408
- "isPublic": true
1409
- },
1410
- "recall": {
1411
- "name": "recall",
1412
- "async": true,
1413
- "parameters": [
1414
- {
1415
- "name": "options",
1416
- "type": "object",
1417
- "optional": false
1418
- }
1419
- ],
1420
- "returnType": "Promise",
1421
- "isStatic": false,
1422
- "isPublic": true
1423
- },
1424
- "recallAll": {
1425
- "name": "recallAll",
1426
- "async": true,
1427
- "parameters": [
1428
- {
1429
- "name": "options",
1430
- "type": "object",
1431
- "optional": true
1432
- }
1433
- ],
1434
- "returnType": "Promise<Map<string>>",
1435
- "isStatic": false,
1436
- "isPublic": true
1437
- },
1438
- "forget": {
1439
- "name": "forget",
1440
- "async": true,
1441
- "parameters": [
1442
- {
1443
- "name": "options",
1444
- "type": "object",
1445
- "optional": false
1446
- }
1447
- ],
1448
- "returnType": "Promise<void>",
1449
- "isStatic": false,
1450
- "isPublic": true
1451
- },
1452
- "forgetScope": {
1453
- "name": "forgetScope",
1454
- "async": true,
1455
- "parameters": [
1456
- {
1457
- "name": "options",
1458
- "type": "object",
1459
- "optional": false
1460
- }
1461
- ],
1462
- "returnType": "Promise<number>",
1463
- "isStatic": false,
1464
- "isPublic": true
1465
- },
1466
- "generateEmbeddings": {
1467
- "name": "generateEmbeddings",
1468
- "async": true,
1469
- "parameters": [
1470
- {
1471
- "name": "options",
1472
- "type": "GenerateEmbeddingsOptions",
1473
- "optional": true
1474
- }
1475
- ],
1476
- "returnType": "Promise<void>",
1477
- "isStatic": false,
1478
- "isPublic": true
1479
- },
1480
- "getEmbedding": {
1481
- "name": "getEmbedding",
1482
- "async": true,
1483
- "parameters": [
1484
- {
1485
- "name": "fieldName",
1486
- "type": "string",
1487
- "optional": false
1488
- },
1489
- {
1490
- "name": "model",
1491
- "type": "string",
1492
- "optional": true
1493
- }
1494
- ],
1495
- "returnType": "Promise<number[] | null>",
1496
- "isStatic": false,
1497
- "isPublic": true
1498
- },
1499
- "hasStaleEmbeddings": {
1500
- "name": "hasStaleEmbeddings",
1501
- "async": true,
1502
- "parameters": [],
1503
- "returnType": "Promise<boolean>",
1504
- "isStatic": false,
1505
- "isPublic": true
1506
- },
1507
- "clearEmbeddings": {
1508
- "name": "clearEmbeddings",
1509
- "async": true,
1510
- "parameters": [],
1511
- "returnType": "Promise<void>",
1512
- "isStatic": false,
1513
- "isPublic": true
1514
- },
1515
- "isWeb": {
1516
- "name": "isWeb",
1517
- "async": false,
1518
- "parameters": [],
1519
- "returnType": "boolean",
1520
- "isStatic": false,
1521
- "isPublic": true
1522
- },
1523
- "isIOS": {
1524
- "name": "isIOS",
1525
- "async": false,
1526
- "parameters": [],
1527
- "returnType": "boolean",
1528
- "isStatic": false,
1529
- "isPublic": true
1530
- },
1531
- "isAndroid": {
1532
- "name": "isAndroid",
1533
- "async": false,
1534
- "parameters": [],
1535
- "returnType": "boolean",
1536
- "isStatic": false,
1537
- "isPublic": true
1538
- },
1539
- "isMobileApp": {
1540
- "name": "isMobileApp",
1541
- "async": false,
1542
- "parameters": [],
1543
- "returnType": "boolean",
1544
- "isStatic": false,
1545
- "isPublic": true
1546
- },
1547
- "getPlatformId": {
1548
- "name": "getPlatformId",
1388
+ "toTrackEvent": {
1389
+ "name": "toTrackEvent",
1549
1390
  "async": false,
1550
1391
  "parameters": [],
1551
- "returnType": "string",
1392
+ "returnType": "object",
1552
1393
  "isStatic": false,
1553
1394
  "isPublic": true
1554
1395
  }
@@ -1559,14 +1400,14 @@
1559
1400
  "include": [
1560
1401
  "list",
1561
1402
  "get",
1562
- "create",
1563
- "update"
1403
+ "create"
1564
1404
  ]
1565
1405
  },
1566
1406
  "mcp": {
1567
1407
  "include": [
1568
1408
  "list",
1569
- "get"
1409
+ "get",
1410
+ "track"
1570
1411
  ]
1571
1412
  },
1572
1413
  "cli": true,
@@ -1581,11 +1422,11 @@
1581
1422
  ]
1582
1423
  },
1583
1424
  "extends": "SmrtObject",
1584
- "exportName": "AnalyticsDataStream",
1585
- "collectionExportName": "AnalyticsDataStreamCollection",
1425
+ "exportName": "AnalyticsEvent",
1426
+ "collectionExportName": "AnalyticsEventCollection",
1586
1427
  "schema": {
1587
- "tableName": "analytics_data_streams",
1588
- "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);",
1428
+ "tableName": "analytics_events",
1429
+ "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);",
1589
1430
  "columns": {
1590
1431
  "id": {
1591
1432
  "type": "UUID",
@@ -1636,58 +1477,82 @@
1636
1477
  "onUpdate": "CASCADE"
1637
1478
  }
1638
1479
  },
1639
- "display_name": {
1480
+ "event_name": {
1640
1481
  "type": "TEXT",
1641
1482
  "notNull": false,
1642
1483
  "default": ""
1643
1484
  },
1644
- "stream_type": {
1485
+ "client_id": {
1645
1486
  "type": "TEXT",
1646
- "notNull": false
1487
+ "notNull": false,
1488
+ "default": ""
1647
1489
  },
1648
- "external_id": {
1490
+ "user_id": {
1649
1491
  "type": "TEXT",
1650
1492
  "notNull": false,
1651
1493
  "default": ""
1652
1494
  },
1653
- "measurement_id": {
1495
+ "params": {
1654
1496
  "type": "TEXT",
1655
1497
  "notNull": false,
1656
- "default": ""
1498
+ "default": "{}"
1657
1499
  },
1658
- "firebase_app_id": {
1500
+ "event_timestamp": {
1501
+ "type": "TIMESTAMP",
1502
+ "notNull": false
1503
+ },
1504
+ "status": {
1505
+ "type": "TEXT",
1506
+ "notNull": false
1507
+ },
1508
+ "sent_at": {
1509
+ "type": "TIMESTAMP",
1510
+ "notNull": false
1511
+ },
1512
+ "error_message": {
1659
1513
  "type": "TEXT",
1660
1514
  "notNull": false,
1661
1515
  "default": ""
1662
1516
  },
1663
- "default_uri": {
1517
+ "retry_count": {
1518
+ "type": "INTEGER",
1519
+ "notNull": false,
1520
+ "default": 0
1521
+ },
1522
+ "non_personalized_ads": {
1523
+ "type": "BOOLEAN",
1524
+ "notNull": false,
1525
+ "default": false
1526
+ },
1527
+ "session_id": {
1664
1528
  "type": "TEXT",
1665
1529
  "notNull": false,
1666
1530
  "default": ""
1667
1531
  },
1668
- "bundle_id": {
1532
+ "page_path": {
1669
1533
  "type": "TEXT",
1670
1534
  "notNull": false,
1671
1535
  "default": ""
1672
1536
  },
1673
- "package_name": {
1537
+ "page_title": {
1674
1538
  "type": "TEXT",
1675
1539
  "notNull": false,
1676
1540
  "default": ""
1677
1541
  },
1678
- "status": {
1542
+ "user_agent": {
1679
1543
  "type": "TEXT",
1680
- "notNull": false
1544
+ "notNull": false,
1545
+ "default": ""
1681
1546
  },
1682
- "enhanced_measurement": {
1683
- "type": "BOOLEAN",
1547
+ "ip_address": {
1548
+ "type": "TEXT",
1684
1549
  "notNull": false,
1685
- "default": true
1550
+ "default": ""
1686
1551
  }
1687
1552
  },
1688
1553
  "indexes": [
1689
1554
  {
1690
- "name": "analytics_data_streams_slug_context_meta_type_idx",
1555
+ "name": "analytics_events_slug_context_meta_type_idx",
1691
1556
  "columns": [
1692
1557
  "tenant_id",
1693
1558
  "slug",
@@ -1697,34 +1562,34 @@
1697
1562
  "unique": true
1698
1563
  },
1699
1564
  {
1700
- "name": "analytics_data_streams_meta_type_idx",
1565
+ "name": "analytics_events_meta_type_idx",
1701
1566
  "columns": [
1702
1567
  "_meta_type"
1703
1568
  ]
1704
1569
  },
1705
1570
  {
1706
- "name": "analytics_data_streams_tenant_id_created_at_idx",
1571
+ "name": "analytics_events_tenant_id_created_at_idx",
1707
1572
  "columns": [
1708
1573
  "tenant_id",
1709
1574
  "created_at"
1710
1575
  ]
1711
1576
  },
1712
1577
  {
1713
- "name": "analytics_data_streams_property_id_idx",
1578
+ "name": "analytics_events_property_id_idx",
1714
1579
  "columns": [
1715
1580
  "property_id"
1716
1581
  ]
1717
1582
  }
1718
1583
  ],
1719
- "version": "851609ba"
1584
+ "version": "bee09e1d"
1720
1585
  }
1721
1586
  },
1722
- "@happyvertical/smrt-analytics:AnalyticsEvent": {
1723
- "name": "analyticsevent",
1724
- "className": "AnalyticsEvent",
1725
- "qualifiedName": "@happyvertical/smrt-analytics:AnalyticsEvent",
1726
- "collection": "analyticsevents",
1727
- "filePath": "/home/runner/work/smrt/smrt/packages/analytics/src/models/AnalyticsEvent.ts",
1587
+ "@happyvertical/smrt-analytics:AnalyticsProperty": {
1588
+ "name": "analyticsproperty",
1589
+ "className": "AnalyticsProperty",
1590
+ "qualifiedName": "@happyvertical/smrt-analytics:AnalyticsProperty",
1591
+ "collection": "analyticsproperties",
1592
+ "filePath": "/home/runner/work/smrt/smrt/packages/analytics/src/models/AnalyticsProperty.ts",
1728
1593
  "packageName": "@happyvertical/smrt-analytics",
1729
1594
  "fields": {
1730
1595
  "created_at": {
@@ -1753,2509 +1618,452 @@
1753
1618
  }
1754
1619
  }
1755
1620
  },
1756
- "propertyId": {
1757
- "type": "foreignKey",
1621
+ "name": {
1622
+ "type": "text",
1758
1623
  "required": false,
1759
- "related": "AnalyticsProperty"
1624
+ "default": ""
1760
1625
  },
1761
- "eventName": {
1626
+ "displayName": {
1762
1627
  "type": "text",
1763
1628
  "required": false,
1764
1629
  "default": ""
1765
1630
  },
1766
- "clientId": {
1631
+ "provider": {
1632
+ "type": "text",
1633
+ "required": false
1634
+ },
1635
+ "externalId": {
1767
1636
  "type": "text",
1768
1637
  "required": false,
1769
1638
  "default": ""
1770
1639
  },
1771
- "userId": {
1640
+ "measurementId": {
1772
1641
  "type": "text",
1773
1642
  "required": false,
1774
1643
  "default": ""
1775
1644
  },
1776
- "params": {
1645
+ "apiSecret": {
1777
1646
  "type": "text",
1778
1647
  "required": false,
1779
- "default": "{}"
1648
+ "default": "",
1649
+ "_meta": {
1650
+ "sensitive": true
1651
+ },
1652
+ "sensitive": true
1780
1653
  },
1781
- "eventTimestamp": {
1782
- "type": "datetime",
1783
- "required": false
1784
- },
1785
- "status": {
1786
- "type": "text",
1787
- "required": false
1788
- },
1789
- "sentAt": {
1790
- "type": "datetime",
1791
- "required": false
1792
- },
1793
- "errorMessage": {
1654
+ "siteDomain": {
1794
1655
  "type": "text",
1795
1656
  "required": false,
1796
1657
  "default": ""
1797
1658
  },
1798
- "retryCount": {
1799
- "type": "integer",
1800
- "required": false,
1801
- "default": 0
1802
- },
1803
- "nonPersonalizedAds": {
1804
- "type": "boolean",
1659
+ "timeZone": {
1660
+ "type": "text",
1805
1661
  "required": false,
1806
- "default": false
1662
+ "default": "America/Los_Angeles"
1807
1663
  },
1808
- "sessionId": {
1664
+ "currencyCode": {
1809
1665
  "type": "text",
1810
1666
  "required": false,
1811
- "default": ""
1667
+ "default": "USD"
1812
1668
  },
1813
- "pagePath": {
1669
+ "industryCategory": {
1814
1670
  "type": "text",
1815
1671
  "required": false,
1816
1672
  "default": ""
1817
1673
  },
1818
- "pageTitle": {
1674
+ "serviceLevel": {
1819
1675
  "type": "text",
1820
1676
  "required": false,
1821
- "default": ""
1677
+ "default": "STANDARD"
1822
1678
  },
1823
- "userAgent": {
1679
+ "status": {
1824
1680
  "type": "text",
1825
- "required": false,
1826
- "default": ""
1681
+ "required": false
1827
1682
  },
1828
- "ipAddress": {
1683
+ "lastSyncAt": {
1684
+ "type": "datetime",
1685
+ "required": false
1686
+ },
1687
+ "providerMetadata": {
1829
1688
  "type": "text",
1830
1689
  "required": false,
1831
- "default": ""
1690
+ "default": "{}",
1691
+ "_meta": {
1692
+ "sensitive": true
1693
+ },
1694
+ "sensitive": true
1832
1695
  }
1833
1696
  },
1834
1697
  "methods": {
1835
- "withDatabase": {
1836
- "name": "withDatabase",
1837
- "async": true,
1838
- "parameters": [
1839
- {
1840
- "name": "db",
1841
- "type": "DatabaseInterface",
1842
- "optional": false
1843
- },
1844
- {
1845
- "name": "operation",
1846
- "type": "Function",
1847
- "optional": false
1848
- }
1849
- ],
1850
- "returnType": "Promise<T>",
1851
- "isStatic": false,
1852
- "isPublic": true
1853
- },
1854
- "getAiUsageSnapshot": {
1855
- "name": "getAiUsageSnapshot",
1698
+ "isGA4": {
1699
+ "name": "isGA4",
1856
1700
  "async": false,
1857
1701
  "parameters": [],
1858
- "returnType": "AiUsageSnapshot | undefined",
1702
+ "returnType": "boolean",
1859
1703
  "isStatic": false,
1860
1704
  "isPublic": true
1861
1705
  },
1862
- "resetAiUsage": {
1863
- "name": "resetAiUsage",
1706
+ "isPlausible": {
1707
+ "name": "isPlausible",
1864
1708
  "async": false,
1865
1709
  "parameters": [],
1866
- "returnType": "void",
1867
- "isStatic": false,
1868
- "isPublic": true
1869
- },
1870
- "listAiUsage": {
1871
- "name": "listAiUsage",
1872
- "async": true,
1873
- "parameters": [
1874
- {
1875
- "name": "options",
1876
- "type": "AiUsageListOptions",
1877
- "optional": true
1878
- }
1879
- ],
1880
- "returnType": "Promise<SmrtAiUsageRecord[]>",
1881
- "isStatic": false,
1882
- "isPublic": true
1883
- },
1884
- "summarizeAiUsage": {
1885
- "name": "summarizeAiUsage",
1886
- "async": true,
1887
- "parameters": [
1888
- {
1889
- "name": "options",
1890
- "type": "AiUsageSummaryOptions",
1891
- "optional": true
1892
- }
1893
- ],
1894
- "returnType": "Promise<Record<string, AiUsageStats>>",
1710
+ "returnType": "boolean",
1895
1711
  "isStatic": false,
1896
1712
  "isPublic": true
1897
1713
  },
1898
- "destroy": {
1899
- "name": "destroy",
1714
+ "isMatomo": {
1715
+ "name": "isMatomo",
1900
1716
  "async": false,
1901
1717
  "parameters": [],
1902
- "returnType": "void",
1718
+ "returnType": "boolean",
1903
1719
  "isStatic": false,
1904
1720
  "isPublic": true
1905
1721
  },
1906
- "markAsPersisted": {
1907
- "name": "markAsPersisted",
1722
+ "getProviderMetadata": {
1723
+ "name": "getProviderMetadata",
1908
1724
  "async": false,
1909
1725
  "parameters": [],
1910
- "returnType": "void",
1726
+ "returnType": "Record<string>",
1911
1727
  "isStatic": false,
1912
1728
  "isPublic": true
1913
1729
  },
1914
- "requireInsertOnSave": {
1915
- "name": "requireInsertOnSave",
1730
+ "setProviderMetadata": {
1731
+ "name": "setProviderMetadata",
1916
1732
  "async": false,
1917
- "parameters": [],
1918
- "returnType": "void",
1919
- "isStatic": false,
1920
- "isPublic": true
1921
- },
1922
- "withTransaction": {
1923
- "name": "withTransaction",
1924
- "async": true,
1925
- "parameters": [
1926
- {
1927
- "name": "operation",
1928
- "type": "Function",
1929
- "optional": false
1930
- }
1931
- ],
1932
- "returnType": "Promise<T>",
1933
- "isStatic": false,
1934
- "isPublic": true
1935
- },
1936
- "initialize": {
1937
- "name": "initialize",
1938
- "async": true,
1939
- "parameters": [],
1940
- "returnType": "Promise",
1941
- "isStatic": false,
1942
- "isPublic": true
1943
- },
1944
- "loadDataFromDb": {
1945
- "name": "loadDataFromDb",
1946
- "async": true,
1947
1733
  "parameters": [
1948
1734
  {
1949
- "name": "data",
1735
+ "name": "metadata",
1950
1736
  "type": "Record<string>",
1951
1737
  "optional": false
1952
1738
  }
1953
1739
  ],
1954
- "returnType": "any",
1955
- "isStatic": false,
1956
- "isPublic": true
1957
- },
1958
- "getFields": {
1959
- "name": "getFields",
1960
- "async": true,
1961
- "parameters": [],
1962
- "returnType": "Promise<any>",
1963
- "isStatic": false,
1964
- "isPublic": true
1965
- },
1966
- "toJSON": {
1967
- "name": "toJSON",
1968
- "async": false,
1969
- "parameters": [],
1970
- "returnType": "any",
1971
- "isStatic": false,
1972
- "isPublic": true
1973
- },
1974
- "toPlainObject": {
1975
- "name": "toPlainObject",
1976
- "async": false,
1977
- "parameters": [],
1978
- "returnType": "Record<string>",
1740
+ "returnType": "void",
1979
1741
  "isStatic": false,
1980
1742
  "isPublic": true
1981
1743
  },
1982
- "toPublicJSON": {
1983
- "name": "toPublicJSON",
1744
+ "markSynced": {
1745
+ "name": "markSynced",
1984
1746
  "async": false,
1985
- "parameters": [
1986
- {
1987
- "name": "options",
1988
- "type": "PublicJsonOptions",
1989
- "optional": true
1990
- }
1991
- ],
1992
- "returnType": "Record<string>",
1993
- "isStatic": false,
1994
- "isPublic": true
1995
- },
1996
- "getId": {
1997
- "name": "getId",
1998
- "async": true,
1999
- "parameters": [],
2000
- "returnType": "any",
2001
- "isStatic": false,
2002
- "isPublic": true
2003
- },
2004
- "getSlug": {
2005
- "name": "getSlug",
2006
- "async": true,
2007
- "parameters": [],
2008
- "returnType": "any",
2009
- "isStatic": false,
2010
- "isPublic": true
2011
- },
2012
- "getSavedId": {
2013
- "name": "getSavedId",
2014
- "async": true,
2015
- "parameters": [],
2016
- "returnType": "any",
2017
- "isStatic": false,
2018
- "isPublic": true
2019
- },
2020
- "isSaved": {
2021
- "name": "isSaved",
2022
- "async": true,
2023
1747
  "parameters": [],
2024
- "returnType": "any",
1748
+ "returnType": "void",
2025
1749
  "isStatic": false,
2026
1750
  "isPublic": true
2027
1751
  },
2028
- "save": {
2029
- "name": "save",
1752
+ "analyzePerformance": {
1753
+ "name": "analyzePerformance",
2030
1754
  "async": true,
2031
1755
  "parameters": [
2032
1756
  {
2033
1757
  "name": "options",
2034
- "type": "SmrtSaveOptions",
1758
+ "type": "object",
2035
1759
  "optional": true
2036
1760
  }
2037
1761
  ],
2038
- "returnType": "any",
2039
- "isStatic": false,
2040
- "isPublic": true
2041
- },
2042
- "claimRevision": {
2043
- "name": "claimRevision",
2044
- "async": true,
2045
- "parameters": [
2046
- {
2047
- "name": "expectedUpdatedAt",
2048
- "type": "Date | string",
2049
- "optional": false
2050
- }
2051
- ],
2052
- "returnType": "Promise",
2053
- "isStatic": false,
2054
- "isPublic": true
2055
- },
2056
- "classifyConstraintError": {
2057
- "name": "classifyConstraintError",
2058
- "async": false,
2059
- "parameters": [
2060
- {
2061
- "name": "message",
2062
- "type": "string",
2063
- "optional": false
2064
- }
2065
- ],
2066
- "returnType": "'unique' | 'not_null' | null",
2067
- "isStatic": true,
2068
- "isPublic": true
2069
- },
2070
- "loadFromId": {
2071
- "name": "loadFromId",
2072
- "async": true,
2073
- "parameters": [],
2074
- "returnType": "any",
1762
+ "returnType": "Promise<object>",
2075
1763
  "isStatic": false,
2076
1764
  "isPublic": true
2077
1765
  },
2078
- "loadFromSlug": {
2079
- "name": "loadFromSlug",
1766
+ "isPerformingWell": {
1767
+ "name": "isPerformingWell",
2080
1768
  "async": true,
2081
1769
  "parameters": [],
2082
- "returnType": "any",
2083
- "isStatic": false,
2084
- "isPublic": true
2085
- },
2086
- "is": {
2087
- "name": "is",
2088
- "async": true,
2089
- "parameters": [
2090
- {
2091
- "name": "criteria",
2092
- "type": "string",
2093
- "optional": false
2094
- },
2095
- {
2096
- "name": "options",
2097
- "type": "AiOperationOptions",
2098
- "optional": true
2099
- }
2100
- ],
2101
- "returnType": "any",
1770
+ "returnType": "Promise<boolean>",
2102
1771
  "isStatic": false,
2103
1772
  "isPublic": true
1773
+ }
1774
+ },
1775
+ "decoratorConfig": {
1776
+ "tableStrategy": "sti",
1777
+ "api": {
1778
+ "include": [
1779
+ "list",
1780
+ "get",
1781
+ "create",
1782
+ "update"
1783
+ ]
2104
1784
  },
2105
- "do": {
2106
- "name": "do",
2107
- "async": true,
2108
- "parameters": [
2109
- {
2110
- "name": "instructions",
2111
- "type": "string",
2112
- "optional": false
2113
- },
2114
- {
2115
- "name": "options",
2116
- "type": "AiOperationOptions",
2117
- "optional": true
2118
- }
2119
- ],
2120
- "returnType": "any",
2121
- "isStatic": false,
2122
- "isPublic": true
1785
+ "mcp": {
1786
+ "include": [
1787
+ "list",
1788
+ "get",
1789
+ "sync",
1790
+ "runReport"
1791
+ ]
2123
1792
  },
2124
- "describe": {
2125
- "name": "describe",
2126
- "async": true,
2127
- "parameters": [
2128
- {
2129
- "name": "options",
2130
- "type": "AiOperationOptions",
2131
- "optional": true
2132
- }
2133
- ],
2134
- "returnType": "any",
2135
- "isStatic": false,
2136
- "isPublic": true
1793
+ "cli": true,
1794
+ "tenantScoped": {
1795
+ "mode": "optional"
2137
1796
  },
2138
- "delete": {
2139
- "name": "delete",
2140
- "async": true,
2141
- "parameters": [
2142
- {
2143
- "name": "options",
2144
- "type": "SmrtDeleteOptions",
2145
- "optional": true
2146
- }
2147
- ],
2148
- "returnType": "Promise<void>",
2149
- "isStatic": false,
2150
- "isPublic": true
2151
- },
2152
- "isRelatedLoaded": {
2153
- "name": "isRelatedLoaded",
2154
- "async": false,
2155
- "parameters": [
2156
- {
2157
- "name": "fieldName",
2158
- "type": "string",
2159
- "optional": false
2160
- }
2161
- ],
2162
- "returnType": "boolean",
2163
- "isStatic": false,
2164
- "isPublic": true
2165
- },
2166
- "_setLoadedRelationship": {
2167
- "name": "_setLoadedRelationship",
2168
- "async": false,
2169
- "parameters": [
2170
- {
2171
- "name": "fieldName",
2172
- "type": "string",
2173
- "optional": false
2174
- },
2175
- {
2176
- "name": "value",
2177
- "type": "any",
2178
- "optional": false
2179
- }
2180
- ],
2181
- "returnType": "void",
2182
- "isStatic": false,
2183
- "isPublic": true
2184
- },
2185
- "loadRelated": {
2186
- "name": "loadRelated",
2187
- "async": true,
2188
- "parameters": [
2189
- {
2190
- "name": "fieldName",
2191
- "type": "string",
2192
- "optional": false
2193
- },
2194
- {
2195
- "name": "opts",
2196
- "type": "LoadRelatedOptions",
2197
- "optional": true
2198
- }
2199
- ],
2200
- "returnType": "Promise<any>",
2201
- "isStatic": false,
2202
- "isPublic": true
2203
- },
2204
- "loadRelatedMany": {
2205
- "name": "loadRelatedMany",
2206
- "async": true,
2207
- "parameters": [
2208
- {
2209
- "name": "fieldName",
2210
- "type": "string",
2211
- "optional": false
2212
- },
2213
- {
2214
- "name": "opts",
2215
- "type": "LoadRelatedOptions",
2216
- "optional": true
2217
- }
2218
- ],
2219
- "returnType": "Promise<any[]>",
2220
- "isStatic": false,
2221
- "isPublic": true
2222
- },
2223
- "getRelated": {
2224
- "name": "getRelated",
2225
- "async": true,
2226
- "parameters": [
2227
- {
2228
- "name": "fieldName",
2229
- "type": "string",
2230
- "optional": false
2231
- },
2232
- {
2233
- "name": "opts",
2234
- "type": "LoadRelatedOptions",
2235
- "optional": true
2236
- }
2237
- ],
2238
- "returnType": "Promise<any>",
2239
- "isStatic": false,
2240
- "isPublic": true
2241
- },
2242
- "getAvailableTools": {
2243
- "name": "getAvailableTools",
2244
- "async": false,
2245
- "parameters": [],
2246
- "returnType": "AITool[]",
2247
- "isStatic": false,
2248
- "isPublic": true
2249
- },
2250
- "executeToolCall": {
2251
- "name": "executeToolCall",
2252
- "async": true,
2253
- "parameters": [
2254
- {
2255
- "name": "toolCall",
2256
- "type": "ToolCall",
2257
- "optional": false
2258
- }
2259
- ],
2260
- "returnType": "Promise<ToolCallResult>",
2261
- "isStatic": false,
2262
- "isPublic": true
2263
- },
2264
- "remember": {
2265
- "name": "remember",
2266
- "async": true,
2267
- "parameters": [
2268
- {
2269
- "name": "options",
2270
- "type": "object",
2271
- "optional": false
2272
- }
2273
- ],
2274
- "returnType": "Promise<void>",
2275
- "isStatic": false,
2276
- "isPublic": true
2277
- },
2278
- "recall": {
2279
- "name": "recall",
2280
- "async": true,
2281
- "parameters": [
2282
- {
2283
- "name": "options",
2284
- "type": "object",
2285
- "optional": false
2286
- }
2287
- ],
2288
- "returnType": "Promise",
2289
- "isStatic": false,
2290
- "isPublic": true
2291
- },
2292
- "recallAll": {
2293
- "name": "recallAll",
2294
- "async": true,
2295
- "parameters": [
2296
- {
2297
- "name": "options",
2298
- "type": "object",
2299
- "optional": true
2300
- }
2301
- ],
2302
- "returnType": "Promise<Map<string>>",
2303
- "isStatic": false,
2304
- "isPublic": true
2305
- },
2306
- "forget": {
2307
- "name": "forget",
2308
- "async": true,
2309
- "parameters": [
2310
- {
2311
- "name": "options",
2312
- "type": "object",
2313
- "optional": false
2314
- }
2315
- ],
2316
- "returnType": "Promise<void>",
2317
- "isStatic": false,
2318
- "isPublic": true
2319
- },
2320
- "forgetScope": {
2321
- "name": "forgetScope",
2322
- "async": true,
2323
- "parameters": [
2324
- {
2325
- "name": "options",
2326
- "type": "object",
2327
- "optional": false
2328
- }
2329
- ],
2330
- "returnType": "Promise<number>",
2331
- "isStatic": false,
2332
- "isPublic": true
2333
- },
2334
- "generateEmbeddings": {
2335
- "name": "generateEmbeddings",
2336
- "async": true,
2337
- "parameters": [
2338
- {
2339
- "name": "options",
2340
- "type": "GenerateEmbeddingsOptions",
2341
- "optional": true
2342
- }
2343
- ],
2344
- "returnType": "Promise<void>",
2345
- "isStatic": false,
2346
- "isPublic": true
2347
- },
2348
- "getEmbedding": {
2349
- "name": "getEmbedding",
2350
- "async": true,
2351
- "parameters": [
2352
- {
2353
- "name": "fieldName",
2354
- "type": "string",
2355
- "optional": false
2356
- },
2357
- {
2358
- "name": "model",
2359
- "type": "string",
2360
- "optional": true
2361
- }
2362
- ],
2363
- "returnType": "Promise<number[] | null>",
2364
- "isStatic": false,
2365
- "isPublic": true
2366
- },
2367
- "hasStaleEmbeddings": {
2368
- "name": "hasStaleEmbeddings",
2369
- "async": true,
2370
- "parameters": [],
2371
- "returnType": "Promise<boolean>",
2372
- "isStatic": false,
2373
- "isPublic": true
2374
- },
2375
- "clearEmbeddings": {
2376
- "name": "clearEmbeddings",
2377
- "async": true,
2378
- "parameters": [],
2379
- "returnType": "Promise<void>",
2380
- "isStatic": false,
2381
- "isPublic": true
2382
- },
2383
- "getParams": {
2384
- "name": "getParams",
2385
- "async": false,
2386
- "parameters": [],
2387
- "returnType": "Record<string, string | number | boolean>",
2388
- "isStatic": false,
2389
- "isPublic": true
2390
- },
2391
- "setParams": {
2392
- "name": "setParams",
2393
- "async": false,
2394
- "parameters": [
2395
- {
2396
- "name": "params",
2397
- "type": "Record<string, string | number | boolean>",
2398
- "optional": false
2399
- }
2400
- ],
2401
- "returnType": "void",
2402
- "isStatic": false,
2403
- "isPublic": true
2404
- },
2405
- "addParam": {
2406
- "name": "addParam",
2407
- "async": false,
2408
- "parameters": [
2409
- {
2410
- "name": "key",
2411
- "type": "string",
2412
- "optional": false
2413
- },
2414
- {
2415
- "name": "value",
2416
- "type": "string | number | boolean",
2417
- "optional": false
2418
- }
2419
- ],
2420
- "returnType": "void",
2421
- "isStatic": false,
2422
- "isPublic": true
2423
- },
2424
- "isPageview": {
2425
- "name": "isPageview",
2426
- "async": false,
2427
- "parameters": [],
2428
- "returnType": "boolean",
2429
- "isStatic": false,
2430
- "isPublic": true
2431
- },
2432
- "isConversion": {
2433
- "name": "isConversion",
2434
- "async": false,
2435
- "parameters": [],
2436
- "returnType": "boolean",
2437
- "isStatic": false,
2438
- "isPublic": true
2439
- },
2440
- "markSent": {
2441
- "name": "markSent",
2442
- "async": false,
2443
- "parameters": [],
2444
- "returnType": "void",
2445
- "isStatic": false,
2446
- "isPublic": true
2447
- },
2448
- "markFailed": {
2449
- "name": "markFailed",
2450
- "async": false,
2451
- "parameters": [
2452
- {
2453
- "name": "error",
2454
- "type": "string",
2455
- "optional": false
2456
- }
2457
- ],
2458
- "returnType": "void",
2459
- "isStatic": false,
2460
- "isPublic": true
2461
- },
2462
- "resetForRetry": {
2463
- "name": "resetForRetry",
2464
- "async": false,
2465
- "parameters": [],
2466
- "returnType": "void",
2467
- "isStatic": false,
2468
- "isPublic": true
2469
- },
2470
- "shouldRetry": {
2471
- "name": "shouldRetry",
2472
- "async": false,
2473
- "parameters": [
2474
- {
2475
- "name": "maxRetries",
2476
- "type": "number",
2477
- "optional": true
2478
- }
2479
- ],
2480
- "returnType": "boolean",
2481
- "isStatic": false,
2482
- "isPublic": true
2483
- },
2484
- "toTrackEvent": {
2485
- "name": "toTrackEvent",
2486
- "async": false,
2487
- "parameters": [],
2488
- "returnType": "object",
2489
- "isStatic": false,
2490
- "isPublic": true
2491
- }
2492
- },
2493
- "decoratorConfig": {
2494
- "tableStrategy": "sti",
2495
- "api": {
2496
- "include": [
2497
- "list",
2498
- "get",
2499
- "create"
2500
- ]
2501
- },
2502
- "mcp": {
2503
- "include": [
2504
- "list",
2505
- "get",
2506
- "track"
2507
- ]
2508
- },
2509
- "cli": true,
2510
- "tenantScoped": {
2511
- "mode": "optional"
2512
- },
2513
- "conflictColumns": [
2514
- "tenant_id",
2515
- "slug",
2516
- "context",
2517
- "_meta_type"
2518
- ]
2519
- },
2520
- "extends": "SmrtObject",
2521
- "exportName": "AnalyticsEvent",
2522
- "collectionExportName": "AnalyticsEventCollection",
2523
- "schema": {
2524
- "tableName": "analytics_events",
2525
- "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);",
2526
- "columns": {
2527
- "id": {
2528
- "type": "UUID",
2529
- "primaryKey": true,
2530
- "referenceKind": "id",
2531
- "notNull": true
2532
- },
2533
- "slug": {
2534
- "type": "TEXT",
2535
- "notNull": true
2536
- },
2537
- "context": {
2538
- "type": "TEXT",
2539
- "notNull": true,
2540
- "default": ""
2541
- },
2542
- "_meta_type": {
2543
- "type": "TEXT",
2544
- "notNull": true
2545
- },
2546
- "_meta_data": {
2547
- "type": "JSON",
2548
- "notNull": false
2549
- },
2550
- "created_at": {
2551
- "type": "TIMESTAMP",
2552
- "notNull": true,
2553
- "default": "current_timestamp"
2554
- },
2555
- "updated_at": {
2556
- "type": "TIMESTAMP",
2557
- "notNull": true,
2558
- "default": "current_timestamp"
2559
- },
2560
- "tenant_id": {
2561
- "type": "UUID",
2562
- "referenceKind": "tenantId",
2563
- "notNull": false
2564
- },
2565
- "property_id": {
2566
- "type": "UUID",
2567
- "referenceKind": "foreignKey",
2568
- "notNull": false,
2569
- "foreignKey": {
2570
- "table": "analytics_properties",
2571
- "column": "id",
2572
- "onDelete": "NO ACTION",
2573
- "onUpdate": "CASCADE"
2574
- }
2575
- },
2576
- "event_name": {
2577
- "type": "TEXT",
2578
- "notNull": false,
2579
- "default": ""
2580
- },
2581
- "client_id": {
2582
- "type": "TEXT",
2583
- "notNull": false,
2584
- "default": ""
2585
- },
2586
- "user_id": {
2587
- "type": "TEXT",
2588
- "notNull": false,
2589
- "default": ""
2590
- },
2591
- "params": {
2592
- "type": "TEXT",
2593
- "notNull": false,
2594
- "default": "{}"
2595
- },
2596
- "event_timestamp": {
2597
- "type": "TIMESTAMP",
2598
- "notNull": false
2599
- },
2600
- "status": {
2601
- "type": "TEXT",
2602
- "notNull": false
2603
- },
2604
- "sent_at": {
2605
- "type": "TIMESTAMP",
2606
- "notNull": false
2607
- },
2608
- "error_message": {
2609
- "type": "TEXT",
2610
- "notNull": false,
2611
- "default": ""
2612
- },
2613
- "retry_count": {
2614
- "type": "INTEGER",
2615
- "notNull": false,
2616
- "default": 0
2617
- },
2618
- "non_personalized_ads": {
2619
- "type": "BOOLEAN",
2620
- "notNull": false,
2621
- "default": false
2622
- },
2623
- "session_id": {
2624
- "type": "TEXT",
2625
- "notNull": false,
2626
- "default": ""
2627
- },
2628
- "page_path": {
2629
- "type": "TEXT",
2630
- "notNull": false,
2631
- "default": ""
2632
- },
2633
- "page_title": {
2634
- "type": "TEXT",
2635
- "notNull": false,
2636
- "default": ""
2637
- },
2638
- "user_agent": {
2639
- "type": "TEXT",
2640
- "notNull": false,
2641
- "default": ""
2642
- },
2643
- "ip_address": {
2644
- "type": "TEXT",
2645
- "notNull": false,
2646
- "default": ""
2647
- }
2648
- },
2649
- "indexes": [
2650
- {
2651
- "name": "analytics_events_slug_context_meta_type_idx",
2652
- "columns": [
2653
- "tenant_id",
2654
- "slug",
2655
- "context",
2656
- "_meta_type"
2657
- ],
2658
- "unique": true
2659
- },
2660
- {
2661
- "name": "analytics_events_meta_type_idx",
2662
- "columns": [
2663
- "_meta_type"
2664
- ]
2665
- },
2666
- {
2667
- "name": "analytics_events_tenant_id_created_at_idx",
2668
- "columns": [
2669
- "tenant_id",
2670
- "created_at"
2671
- ]
2672
- },
2673
- {
2674
- "name": "analytics_events_property_id_idx",
2675
- "columns": [
2676
- "property_id"
2677
- ]
2678
- }
2679
- ],
2680
- "version": "bee09e1d"
2681
- }
2682
- },
2683
- "@happyvertical/smrt-analytics:AnalyticsProperty": {
2684
- "name": "analyticsproperty",
2685
- "className": "AnalyticsProperty",
2686
- "qualifiedName": "@happyvertical/smrt-analytics:AnalyticsProperty",
2687
- "collection": "analyticsproperties",
2688
- "filePath": "/home/runner/work/smrt/smrt/packages/analytics/src/models/AnalyticsProperty.ts",
2689
- "packageName": "@happyvertical/smrt-analytics",
2690
- "fields": {
2691
- "created_at": {
2692
- "type": "datetime",
2693
- "required": false
2694
- },
2695
- "updated_at": {
2696
- "type": "datetime",
2697
- "required": false
2698
- },
2699
- "tenantId": {
2700
- "type": "text",
2701
- "required": false,
2702
- "_meta": {
2703
- "sqlType": "UUID",
2704
- "nullable": true,
2705
- "__tenancy": {
2706
- "isTenantIdField": true,
2707
- "autoFilter": true,
2708
- "required": false,
2709
- "autoPopulate": true,
2710
- "nullable": true,
2711
- "mode": "optional",
2712
- "field": "tenantId",
2713
- "allowSuperAdminBypass": false
2714
- }
2715
- }
2716
- },
2717
- "name": {
2718
- "type": "text",
2719
- "required": false,
2720
- "default": ""
2721
- },
2722
- "displayName": {
2723
- "type": "text",
2724
- "required": false,
2725
- "default": ""
2726
- },
2727
- "provider": {
2728
- "type": "text",
2729
- "required": false
2730
- },
2731
- "externalId": {
2732
- "type": "text",
2733
- "required": false,
2734
- "default": ""
2735
- },
2736
- "measurementId": {
2737
- "type": "text",
2738
- "required": false,
2739
- "default": ""
2740
- },
2741
- "apiSecret": {
2742
- "type": "text",
2743
- "required": false,
2744
- "default": "",
2745
- "_meta": {
2746
- "sensitive": true
2747
- },
2748
- "sensitive": true
2749
- },
2750
- "siteDomain": {
2751
- "type": "text",
2752
- "required": false,
2753
- "default": ""
2754
- },
2755
- "timeZone": {
2756
- "type": "text",
2757
- "required": false,
2758
- "default": "America/Los_Angeles"
2759
- },
2760
- "currencyCode": {
2761
- "type": "text",
2762
- "required": false,
2763
- "default": "USD"
2764
- },
2765
- "industryCategory": {
2766
- "type": "text",
2767
- "required": false,
2768
- "default": ""
2769
- },
2770
- "serviceLevel": {
2771
- "type": "text",
2772
- "required": false,
2773
- "default": "STANDARD"
2774
- },
2775
- "status": {
2776
- "type": "text",
2777
- "required": false
2778
- },
2779
- "lastSyncAt": {
2780
- "type": "datetime",
2781
- "required": false
2782
- },
2783
- "providerMetadata": {
2784
- "type": "text",
2785
- "required": false,
2786
- "default": "{}",
2787
- "_meta": {
2788
- "sensitive": true
2789
- },
2790
- "sensitive": true
2791
- }
2792
- },
2793
- "methods": {
2794
- "withDatabase": {
2795
- "name": "withDatabase",
2796
- "async": true,
2797
- "parameters": [
2798
- {
2799
- "name": "db",
2800
- "type": "DatabaseInterface",
2801
- "optional": false
2802
- },
2803
- {
2804
- "name": "operation",
2805
- "type": "Function",
2806
- "optional": false
2807
- }
2808
- ],
2809
- "returnType": "Promise<T>",
2810
- "isStatic": false,
2811
- "isPublic": true
2812
- },
2813
- "getAiUsageSnapshot": {
2814
- "name": "getAiUsageSnapshot",
2815
- "async": false,
2816
- "parameters": [],
2817
- "returnType": "AiUsageSnapshot | undefined",
2818
- "isStatic": false,
2819
- "isPublic": true
2820
- },
2821
- "resetAiUsage": {
2822
- "name": "resetAiUsage",
2823
- "async": false,
2824
- "parameters": [],
2825
- "returnType": "void",
2826
- "isStatic": false,
2827
- "isPublic": true
2828
- },
2829
- "listAiUsage": {
2830
- "name": "listAiUsage",
2831
- "async": true,
2832
- "parameters": [
2833
- {
2834
- "name": "options",
2835
- "type": "AiUsageListOptions",
2836
- "optional": true
2837
- }
2838
- ],
2839
- "returnType": "Promise<SmrtAiUsageRecord[]>",
2840
- "isStatic": false,
2841
- "isPublic": true
2842
- },
2843
- "summarizeAiUsage": {
2844
- "name": "summarizeAiUsage",
2845
- "async": true,
2846
- "parameters": [
2847
- {
2848
- "name": "options",
2849
- "type": "AiUsageSummaryOptions",
2850
- "optional": true
2851
- }
2852
- ],
2853
- "returnType": "Promise<Record<string, AiUsageStats>>",
2854
- "isStatic": false,
2855
- "isPublic": true
2856
- },
2857
- "destroy": {
2858
- "name": "destroy",
2859
- "async": false,
2860
- "parameters": [],
2861
- "returnType": "void",
2862
- "isStatic": false,
2863
- "isPublic": true
2864
- },
2865
- "markAsPersisted": {
2866
- "name": "markAsPersisted",
2867
- "async": false,
2868
- "parameters": [],
2869
- "returnType": "void",
2870
- "isStatic": false,
2871
- "isPublic": true
2872
- },
2873
- "requireInsertOnSave": {
2874
- "name": "requireInsertOnSave",
2875
- "async": false,
2876
- "parameters": [],
2877
- "returnType": "void",
2878
- "isStatic": false,
2879
- "isPublic": true
2880
- },
2881
- "withTransaction": {
2882
- "name": "withTransaction",
2883
- "async": true,
2884
- "parameters": [
2885
- {
2886
- "name": "operation",
2887
- "type": "Function",
2888
- "optional": false
2889
- }
2890
- ],
2891
- "returnType": "Promise<T>",
2892
- "isStatic": false,
2893
- "isPublic": true
2894
- },
2895
- "initialize": {
2896
- "name": "initialize",
2897
- "async": true,
2898
- "parameters": [],
2899
- "returnType": "Promise",
2900
- "isStatic": false,
2901
- "isPublic": true
2902
- },
2903
- "loadDataFromDb": {
2904
- "name": "loadDataFromDb",
2905
- "async": true,
2906
- "parameters": [
2907
- {
2908
- "name": "data",
2909
- "type": "Record<string>",
2910
- "optional": false
2911
- }
2912
- ],
2913
- "returnType": "any",
2914
- "isStatic": false,
2915
- "isPublic": true
2916
- },
2917
- "getFields": {
2918
- "name": "getFields",
2919
- "async": true,
2920
- "parameters": [],
2921
- "returnType": "Promise<any>",
2922
- "isStatic": false,
2923
- "isPublic": true
2924
- },
2925
- "toJSON": {
2926
- "name": "toJSON",
2927
- "async": false,
2928
- "parameters": [],
2929
- "returnType": "any",
2930
- "isStatic": false,
2931
- "isPublic": true
2932
- },
2933
- "toPlainObject": {
2934
- "name": "toPlainObject",
2935
- "async": false,
2936
- "parameters": [],
2937
- "returnType": "Record<string>",
2938
- "isStatic": false,
2939
- "isPublic": true
2940
- },
2941
- "toPublicJSON": {
2942
- "name": "toPublicJSON",
2943
- "async": false,
2944
- "parameters": [
2945
- {
2946
- "name": "options",
2947
- "type": "PublicJsonOptions",
2948
- "optional": true
2949
- }
2950
- ],
2951
- "returnType": "Record<string>",
2952
- "isStatic": false,
2953
- "isPublic": true
2954
- },
2955
- "getId": {
2956
- "name": "getId",
2957
- "async": true,
2958
- "parameters": [],
2959
- "returnType": "any",
2960
- "isStatic": false,
2961
- "isPublic": true
2962
- },
2963
- "getSlug": {
2964
- "name": "getSlug",
2965
- "async": true,
2966
- "parameters": [],
2967
- "returnType": "any",
2968
- "isStatic": false,
2969
- "isPublic": true
2970
- },
2971
- "getSavedId": {
2972
- "name": "getSavedId",
2973
- "async": true,
2974
- "parameters": [],
2975
- "returnType": "any",
2976
- "isStatic": false,
2977
- "isPublic": true
2978
- },
2979
- "isSaved": {
2980
- "name": "isSaved",
2981
- "async": true,
2982
- "parameters": [],
2983
- "returnType": "any",
2984
- "isStatic": false,
2985
- "isPublic": true
2986
- },
2987
- "save": {
2988
- "name": "save",
2989
- "async": true,
2990
- "parameters": [
2991
- {
2992
- "name": "options",
2993
- "type": "SmrtSaveOptions",
2994
- "optional": true
2995
- }
2996
- ],
2997
- "returnType": "any",
2998
- "isStatic": false,
2999
- "isPublic": true
3000
- },
3001
- "claimRevision": {
3002
- "name": "claimRevision",
3003
- "async": true,
3004
- "parameters": [
3005
- {
3006
- "name": "expectedUpdatedAt",
3007
- "type": "Date | string",
3008
- "optional": false
3009
- }
3010
- ],
3011
- "returnType": "Promise",
3012
- "isStatic": false,
3013
- "isPublic": true
3014
- },
3015
- "classifyConstraintError": {
3016
- "name": "classifyConstraintError",
3017
- "async": false,
3018
- "parameters": [
3019
- {
3020
- "name": "message",
3021
- "type": "string",
3022
- "optional": false
3023
- }
3024
- ],
3025
- "returnType": "'unique' | 'not_null' | null",
3026
- "isStatic": true,
3027
- "isPublic": true
3028
- },
3029
- "loadFromId": {
3030
- "name": "loadFromId",
3031
- "async": true,
3032
- "parameters": [],
3033
- "returnType": "any",
3034
- "isStatic": false,
3035
- "isPublic": true
3036
- },
3037
- "loadFromSlug": {
3038
- "name": "loadFromSlug",
3039
- "async": true,
3040
- "parameters": [],
3041
- "returnType": "any",
3042
- "isStatic": false,
3043
- "isPublic": true
3044
- },
3045
- "is": {
3046
- "name": "is",
3047
- "async": true,
3048
- "parameters": [
3049
- {
3050
- "name": "criteria",
3051
- "type": "string",
3052
- "optional": false
3053
- },
3054
- {
3055
- "name": "options",
3056
- "type": "AiOperationOptions",
3057
- "optional": true
3058
- }
3059
- ],
3060
- "returnType": "any",
3061
- "isStatic": false,
3062
- "isPublic": true
3063
- },
3064
- "do": {
3065
- "name": "do",
3066
- "async": true,
3067
- "parameters": [
3068
- {
3069
- "name": "instructions",
3070
- "type": "string",
3071
- "optional": false
3072
- },
3073
- {
3074
- "name": "options",
3075
- "type": "AiOperationOptions",
3076
- "optional": true
3077
- }
3078
- ],
3079
- "returnType": "any",
3080
- "isStatic": false,
3081
- "isPublic": true
3082
- },
3083
- "describe": {
3084
- "name": "describe",
3085
- "async": true,
3086
- "parameters": [
3087
- {
3088
- "name": "options",
3089
- "type": "AiOperationOptions",
3090
- "optional": true
3091
- }
3092
- ],
3093
- "returnType": "any",
3094
- "isStatic": false,
3095
- "isPublic": true
3096
- },
3097
- "delete": {
3098
- "name": "delete",
3099
- "async": true,
3100
- "parameters": [
3101
- {
3102
- "name": "options",
3103
- "type": "SmrtDeleteOptions",
3104
- "optional": true
3105
- }
3106
- ],
3107
- "returnType": "Promise<void>",
3108
- "isStatic": false,
3109
- "isPublic": true
3110
- },
3111
- "isRelatedLoaded": {
3112
- "name": "isRelatedLoaded",
3113
- "async": false,
3114
- "parameters": [
3115
- {
3116
- "name": "fieldName",
3117
- "type": "string",
3118
- "optional": false
3119
- }
3120
- ],
3121
- "returnType": "boolean",
3122
- "isStatic": false,
3123
- "isPublic": true
3124
- },
3125
- "_setLoadedRelationship": {
3126
- "name": "_setLoadedRelationship",
3127
- "async": false,
3128
- "parameters": [
3129
- {
3130
- "name": "fieldName",
3131
- "type": "string",
3132
- "optional": false
3133
- },
3134
- {
3135
- "name": "value",
3136
- "type": "any",
3137
- "optional": false
3138
- }
3139
- ],
3140
- "returnType": "void",
3141
- "isStatic": false,
3142
- "isPublic": true
3143
- },
3144
- "loadRelated": {
3145
- "name": "loadRelated",
3146
- "async": true,
3147
- "parameters": [
3148
- {
3149
- "name": "fieldName",
3150
- "type": "string",
3151
- "optional": false
3152
- },
3153
- {
3154
- "name": "opts",
3155
- "type": "LoadRelatedOptions",
3156
- "optional": true
3157
- }
3158
- ],
3159
- "returnType": "Promise<any>",
3160
- "isStatic": false,
3161
- "isPublic": true
3162
- },
3163
- "loadRelatedMany": {
3164
- "name": "loadRelatedMany",
3165
- "async": true,
3166
- "parameters": [
3167
- {
3168
- "name": "fieldName",
3169
- "type": "string",
3170
- "optional": false
3171
- },
3172
- {
3173
- "name": "opts",
3174
- "type": "LoadRelatedOptions",
3175
- "optional": true
3176
- }
3177
- ],
3178
- "returnType": "Promise<any[]>",
3179
- "isStatic": false,
3180
- "isPublic": true
3181
- },
3182
- "getRelated": {
3183
- "name": "getRelated",
3184
- "async": true,
3185
- "parameters": [
3186
- {
3187
- "name": "fieldName",
3188
- "type": "string",
3189
- "optional": false
3190
- },
3191
- {
3192
- "name": "opts",
3193
- "type": "LoadRelatedOptions",
3194
- "optional": true
3195
- }
3196
- ],
3197
- "returnType": "Promise<any>",
3198
- "isStatic": false,
3199
- "isPublic": true
3200
- },
3201
- "getAvailableTools": {
3202
- "name": "getAvailableTools",
3203
- "async": false,
3204
- "parameters": [],
3205
- "returnType": "AITool[]",
3206
- "isStatic": false,
3207
- "isPublic": true
3208
- },
3209
- "executeToolCall": {
3210
- "name": "executeToolCall",
3211
- "async": true,
3212
- "parameters": [
3213
- {
3214
- "name": "toolCall",
3215
- "type": "ToolCall",
3216
- "optional": false
3217
- }
3218
- ],
3219
- "returnType": "Promise<ToolCallResult>",
3220
- "isStatic": false,
3221
- "isPublic": true
3222
- },
3223
- "remember": {
3224
- "name": "remember",
3225
- "async": true,
3226
- "parameters": [
3227
- {
3228
- "name": "options",
3229
- "type": "object",
3230
- "optional": false
3231
- }
3232
- ],
3233
- "returnType": "Promise<void>",
3234
- "isStatic": false,
3235
- "isPublic": true
3236
- },
3237
- "recall": {
3238
- "name": "recall",
3239
- "async": true,
3240
- "parameters": [
3241
- {
3242
- "name": "options",
3243
- "type": "object",
3244
- "optional": false
3245
- }
3246
- ],
3247
- "returnType": "Promise",
3248
- "isStatic": false,
3249
- "isPublic": true
3250
- },
3251
- "recallAll": {
3252
- "name": "recallAll",
3253
- "async": true,
3254
- "parameters": [
3255
- {
3256
- "name": "options",
3257
- "type": "object",
3258
- "optional": true
3259
- }
3260
- ],
3261
- "returnType": "Promise<Map<string>>",
3262
- "isStatic": false,
3263
- "isPublic": true
3264
- },
3265
- "forget": {
3266
- "name": "forget",
3267
- "async": true,
3268
- "parameters": [
3269
- {
3270
- "name": "options",
3271
- "type": "object",
3272
- "optional": false
3273
- }
3274
- ],
3275
- "returnType": "Promise<void>",
3276
- "isStatic": false,
3277
- "isPublic": true
3278
- },
3279
- "forgetScope": {
3280
- "name": "forgetScope",
3281
- "async": true,
3282
- "parameters": [
3283
- {
3284
- "name": "options",
3285
- "type": "object",
3286
- "optional": false
3287
- }
3288
- ],
3289
- "returnType": "Promise<number>",
3290
- "isStatic": false,
3291
- "isPublic": true
3292
- },
3293
- "generateEmbeddings": {
3294
- "name": "generateEmbeddings",
3295
- "async": true,
3296
- "parameters": [
3297
- {
3298
- "name": "options",
3299
- "type": "GenerateEmbeddingsOptions",
3300
- "optional": true
3301
- }
3302
- ],
3303
- "returnType": "Promise<void>",
3304
- "isStatic": false,
3305
- "isPublic": true
3306
- },
3307
- "getEmbedding": {
3308
- "name": "getEmbedding",
3309
- "async": true,
3310
- "parameters": [
3311
- {
3312
- "name": "fieldName",
3313
- "type": "string",
3314
- "optional": false
3315
- },
3316
- {
3317
- "name": "model",
3318
- "type": "string",
3319
- "optional": true
3320
- }
3321
- ],
3322
- "returnType": "Promise<number[] | null>",
3323
- "isStatic": false,
3324
- "isPublic": true
3325
- },
3326
- "hasStaleEmbeddings": {
3327
- "name": "hasStaleEmbeddings",
3328
- "async": true,
3329
- "parameters": [],
3330
- "returnType": "Promise<boolean>",
3331
- "isStatic": false,
3332
- "isPublic": true
3333
- },
3334
- "clearEmbeddings": {
3335
- "name": "clearEmbeddings",
3336
- "async": true,
3337
- "parameters": [],
3338
- "returnType": "Promise<void>",
3339
- "isStatic": false,
3340
- "isPublic": true
3341
- },
3342
- "isGA4": {
3343
- "name": "isGA4",
3344
- "async": false,
3345
- "parameters": [],
3346
- "returnType": "boolean",
3347
- "isStatic": false,
3348
- "isPublic": true
3349
- },
3350
- "isPlausible": {
3351
- "name": "isPlausible",
3352
- "async": false,
3353
- "parameters": [],
3354
- "returnType": "boolean",
3355
- "isStatic": false,
3356
- "isPublic": true
3357
- },
3358
- "isMatomo": {
3359
- "name": "isMatomo",
3360
- "async": false,
3361
- "parameters": [],
3362
- "returnType": "boolean",
3363
- "isStatic": false,
3364
- "isPublic": true
3365
- },
3366
- "getProviderMetadata": {
3367
- "name": "getProviderMetadata",
3368
- "async": false,
3369
- "parameters": [],
3370
- "returnType": "Record<string>",
3371
- "isStatic": false,
3372
- "isPublic": true
3373
- },
3374
- "setProviderMetadata": {
3375
- "name": "setProviderMetadata",
3376
- "async": false,
3377
- "parameters": [
3378
- {
3379
- "name": "metadata",
3380
- "type": "Record<string>",
3381
- "optional": false
3382
- }
3383
- ],
3384
- "returnType": "void",
3385
- "isStatic": false,
3386
- "isPublic": true
3387
- },
3388
- "markSynced": {
3389
- "name": "markSynced",
3390
- "async": false,
3391
- "parameters": [],
3392
- "returnType": "void",
3393
- "isStatic": false,
3394
- "isPublic": true
3395
- },
3396
- "analyzePerformance": {
3397
- "name": "analyzePerformance",
3398
- "async": true,
3399
- "parameters": [
3400
- {
3401
- "name": "options",
3402
- "type": "object",
3403
- "optional": true
3404
- }
3405
- ],
3406
- "returnType": "Promise<object>",
3407
- "isStatic": false,
3408
- "isPublic": true
3409
- },
3410
- "isPerformingWell": {
3411
- "name": "isPerformingWell",
3412
- "async": true,
3413
- "parameters": [],
3414
- "returnType": "Promise<boolean>",
3415
- "isStatic": false,
3416
- "isPublic": true
3417
- }
3418
- },
3419
- "decoratorConfig": {
3420
- "tableStrategy": "sti",
3421
- "api": {
3422
- "include": [
3423
- "list",
3424
- "get",
3425
- "create",
3426
- "update"
3427
- ]
3428
- },
3429
- "mcp": {
3430
- "include": [
3431
- "list",
3432
- "get",
3433
- "sync",
3434
- "runReport"
3435
- ]
3436
- },
3437
- "cli": true,
3438
- "tenantScoped": {
3439
- "mode": "optional"
3440
- },
3441
- "conflictColumns": [
3442
- "tenant_id",
3443
- "slug",
3444
- "context",
3445
- "_meta_type"
3446
- ]
3447
- },
3448
- "extends": "SmrtObject",
3449
- "exportName": "AnalyticsProperty",
3450
- "collectionExportName": "AnalyticsPropertyCollection",
3451
- "schema": {
3452
- "tableName": "analytics_properties",
3453
- "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);",
3454
- "columns": {
3455
- "id": {
3456
- "type": "UUID",
3457
- "primaryKey": true,
3458
- "referenceKind": "id",
3459
- "notNull": true
3460
- },
3461
- "slug": {
3462
- "type": "TEXT",
3463
- "notNull": true
3464
- },
3465
- "context": {
3466
- "type": "TEXT",
3467
- "notNull": true,
3468
- "default": ""
3469
- },
3470
- "_meta_type": {
3471
- "type": "TEXT",
3472
- "notNull": true
3473
- },
3474
- "_meta_data": {
3475
- "type": "JSON",
3476
- "notNull": false
3477
- },
3478
- "created_at": {
3479
- "type": "TIMESTAMP",
3480
- "notNull": true,
3481
- "default": "current_timestamp"
3482
- },
3483
- "updated_at": {
3484
- "type": "TIMESTAMP",
3485
- "notNull": true,
3486
- "default": "current_timestamp"
3487
- },
3488
- "tenant_id": {
3489
- "type": "UUID",
3490
- "referenceKind": "tenantId",
3491
- "notNull": false
3492
- },
3493
- "name": {
3494
- "type": "TEXT",
3495
- "notNull": false,
3496
- "default": ""
3497
- },
3498
- "display_name": {
3499
- "type": "TEXT",
3500
- "notNull": false,
3501
- "default": ""
3502
- },
3503
- "provider": {
3504
- "type": "TEXT",
3505
- "notNull": false
3506
- },
3507
- "external_id": {
3508
- "type": "TEXT",
3509
- "notNull": false,
3510
- "default": ""
3511
- },
3512
- "measurement_id": {
3513
- "type": "TEXT",
3514
- "notNull": false,
3515
- "default": ""
3516
- },
3517
- "api_secret": {
3518
- "type": "TEXT",
3519
- "notNull": false,
3520
- "default": ""
3521
- },
3522
- "site_domain": {
3523
- "type": "TEXT",
3524
- "notNull": false,
3525
- "default": ""
3526
- },
3527
- "time_zone": {
3528
- "type": "TEXT",
3529
- "notNull": false,
3530
- "default": "America/Los_Angeles"
3531
- },
3532
- "currency_code": {
3533
- "type": "TEXT",
3534
- "notNull": false,
3535
- "default": "USD"
3536
- },
3537
- "industry_category": {
3538
- "type": "TEXT",
3539
- "notNull": false,
3540
- "default": ""
3541
- },
3542
- "service_level": {
3543
- "type": "TEXT",
3544
- "notNull": false,
3545
- "default": "STANDARD"
3546
- },
3547
- "status": {
3548
- "type": "TEXT",
3549
- "notNull": false
3550
- },
3551
- "last_sync_at": {
3552
- "type": "TIMESTAMP",
3553
- "notNull": false
3554
- },
3555
- "provider_metadata": {
3556
- "type": "TEXT",
3557
- "notNull": false,
3558
- "default": "{}"
3559
- }
3560
- },
3561
- "indexes": [
3562
- {
3563
- "name": "analytics_properties_slug_context_meta_type_idx",
3564
- "columns": [
3565
- "tenant_id",
3566
- "slug",
3567
- "context",
3568
- "_meta_type"
3569
- ],
3570
- "unique": true
3571
- },
3572
- {
3573
- "name": "analytics_properties_meta_type_idx",
3574
- "columns": [
3575
- "_meta_type"
3576
- ]
3577
- },
3578
- {
3579
- "name": "analytics_properties_tenant_id_created_at_idx",
3580
- "columns": [
3581
- "tenant_id",
3582
- "created_at"
3583
- ]
3584
- }
3585
- ],
3586
- "version": "f38a20b9"
3587
- }
3588
- },
3589
- "@happyvertical/smrt-analytics:AnalyticsReport": {
3590
- "name": "analyticsreport",
3591
- "className": "AnalyticsReport",
3592
- "qualifiedName": "@happyvertical/smrt-analytics:AnalyticsReport",
3593
- "collection": "analyticsreports",
3594
- "filePath": "/home/runner/work/smrt/smrt/packages/analytics/src/models/AnalyticsReport.ts",
3595
- "packageName": "@happyvertical/smrt-analytics",
3596
- "fields": {
3597
- "created_at": {
3598
- "type": "datetime",
3599
- "required": false
3600
- },
3601
- "updated_at": {
3602
- "type": "datetime",
3603
- "required": false
3604
- },
3605
- "tenantId": {
3606
- "type": "text",
3607
- "required": false,
3608
- "_meta": {
3609
- "sqlType": "UUID",
3610
- "nullable": true,
3611
- "__tenancy": {
3612
- "isTenantIdField": true,
3613
- "autoFilter": true,
3614
- "required": false,
3615
- "autoPopulate": true,
3616
- "nullable": true,
3617
- "mode": "optional",
3618
- "field": "tenantId",
3619
- "allowSuperAdminBypass": false
3620
- }
3621
- }
3622
- },
3623
- "propertyId": {
3624
- "type": "foreignKey",
3625
- "required": false,
3626
- "related": "AnalyticsProperty"
3627
- },
3628
- "name": {
3629
- "type": "text",
3630
- "required": false,
3631
- "default": ""
3632
- },
3633
- "description": {
3634
- "type": "text",
3635
- "required": false,
3636
- "default": ""
3637
- },
3638
- "dimensions": {
3639
- "type": "text",
3640
- "required": false,
3641
- "default": "[]"
3642
- },
3643
- "metrics": {
3644
- "type": "text",
3645
- "required": false,
3646
- "default": "[]"
3647
- },
3648
- "dateRangeStart": {
3649
- "type": "text",
3650
- "required": false,
3651
- "default": "7daysAgo"
3652
- },
3653
- "dateRangeEnd": {
3654
- "type": "text",
3655
- "required": false,
3656
- "default": "today"
3657
- },
3658
- "dimensionFilter": {
3659
- "type": "text",
3660
- "required": false,
3661
- "default": ""
3662
- },
3663
- "metricFilter": {
3664
- "type": "text",
3665
- "required": false,
3666
- "default": ""
3667
- },
3668
- "orderBy": {
3669
- "type": "text",
3670
- "required": false,
3671
- "default": "[]"
3672
- },
3673
- "maxResults": {
3674
- "type": "integer",
3675
- "required": false,
3676
- "default": 0
3677
- },
3678
- "status": {
3679
- "type": "text",
3680
- "required": false
3681
- },
3682
- "frequency": {
3683
- "type": "text",
3684
- "required": false
3685
- },
3686
- "lastRunAt": {
3687
- "type": "datetime",
3688
- "required": false
3689
- },
3690
- "nextRunAt": {
3691
- "type": "datetime",
3692
- "required": false
3693
- },
3694
- "resultData": {
3695
- "type": "text",
3696
- "required": false,
3697
- "default": ""
3698
- },
3699
- "rowCount": {
3700
- "type": "integer",
3701
- "required": false,
3702
- "default": 0
3703
- },
3704
- "lastError": {
3705
- "type": "text",
3706
- "required": false,
3707
- "default": ""
3708
- }
3709
- },
3710
- "methods": {
3711
- "withDatabase": {
3712
- "name": "withDatabase",
3713
- "async": true,
3714
- "parameters": [
3715
- {
3716
- "name": "db",
3717
- "type": "DatabaseInterface",
3718
- "optional": false
3719
- },
3720
- {
3721
- "name": "operation",
3722
- "type": "Function",
3723
- "optional": false
3724
- }
3725
- ],
3726
- "returnType": "Promise<T>",
3727
- "isStatic": false,
3728
- "isPublic": true
3729
- },
3730
- "getAiUsageSnapshot": {
3731
- "name": "getAiUsageSnapshot",
3732
- "async": false,
3733
- "parameters": [],
3734
- "returnType": "AiUsageSnapshot | undefined",
3735
- "isStatic": false,
3736
- "isPublic": true
3737
- },
3738
- "resetAiUsage": {
3739
- "name": "resetAiUsage",
3740
- "async": false,
3741
- "parameters": [],
3742
- "returnType": "void",
3743
- "isStatic": false,
3744
- "isPublic": true
3745
- },
3746
- "listAiUsage": {
3747
- "name": "listAiUsage",
3748
- "async": true,
3749
- "parameters": [
3750
- {
3751
- "name": "options",
3752
- "type": "AiUsageListOptions",
3753
- "optional": true
3754
- }
3755
- ],
3756
- "returnType": "Promise<SmrtAiUsageRecord[]>",
3757
- "isStatic": false,
3758
- "isPublic": true
3759
- },
3760
- "summarizeAiUsage": {
3761
- "name": "summarizeAiUsage",
3762
- "async": true,
3763
- "parameters": [
3764
- {
3765
- "name": "options",
3766
- "type": "AiUsageSummaryOptions",
3767
- "optional": true
3768
- }
3769
- ],
3770
- "returnType": "Promise<Record<string, AiUsageStats>>",
3771
- "isStatic": false,
3772
- "isPublic": true
3773
- },
3774
- "destroy": {
3775
- "name": "destroy",
3776
- "async": false,
3777
- "parameters": [],
3778
- "returnType": "void",
3779
- "isStatic": false,
3780
- "isPublic": true
3781
- },
3782
- "markAsPersisted": {
3783
- "name": "markAsPersisted",
3784
- "async": false,
3785
- "parameters": [],
3786
- "returnType": "void",
3787
- "isStatic": false,
3788
- "isPublic": true
3789
- },
3790
- "requireInsertOnSave": {
3791
- "name": "requireInsertOnSave",
3792
- "async": false,
3793
- "parameters": [],
3794
- "returnType": "void",
3795
- "isStatic": false,
3796
- "isPublic": true
3797
- },
3798
- "withTransaction": {
3799
- "name": "withTransaction",
3800
- "async": true,
3801
- "parameters": [
3802
- {
3803
- "name": "operation",
3804
- "type": "Function",
3805
- "optional": false
3806
- }
3807
- ],
3808
- "returnType": "Promise<T>",
3809
- "isStatic": false,
3810
- "isPublic": true
3811
- },
3812
- "initialize": {
3813
- "name": "initialize",
3814
- "async": true,
3815
- "parameters": [],
3816
- "returnType": "Promise",
3817
- "isStatic": false,
3818
- "isPublic": true
3819
- },
3820
- "loadDataFromDb": {
3821
- "name": "loadDataFromDb",
3822
- "async": true,
3823
- "parameters": [
3824
- {
3825
- "name": "data",
3826
- "type": "Record<string>",
3827
- "optional": false
3828
- }
3829
- ],
3830
- "returnType": "any",
3831
- "isStatic": false,
3832
- "isPublic": true
3833
- },
3834
- "getFields": {
3835
- "name": "getFields",
3836
- "async": true,
3837
- "parameters": [],
3838
- "returnType": "Promise<any>",
3839
- "isStatic": false,
3840
- "isPublic": true
3841
- },
3842
- "toJSON": {
3843
- "name": "toJSON",
3844
- "async": false,
3845
- "parameters": [],
3846
- "returnType": "any",
3847
- "isStatic": false,
3848
- "isPublic": true
3849
- },
3850
- "toPlainObject": {
3851
- "name": "toPlainObject",
3852
- "async": false,
3853
- "parameters": [],
3854
- "returnType": "Record<string>",
3855
- "isStatic": false,
3856
- "isPublic": true
3857
- },
3858
- "toPublicJSON": {
3859
- "name": "toPublicJSON",
3860
- "async": false,
3861
- "parameters": [
3862
- {
3863
- "name": "options",
3864
- "type": "PublicJsonOptions",
3865
- "optional": true
3866
- }
3867
- ],
3868
- "returnType": "Record<string>",
3869
- "isStatic": false,
3870
- "isPublic": true
3871
- },
3872
- "getId": {
3873
- "name": "getId",
3874
- "async": true,
3875
- "parameters": [],
3876
- "returnType": "any",
3877
- "isStatic": false,
3878
- "isPublic": true
3879
- },
3880
- "getSlug": {
3881
- "name": "getSlug",
3882
- "async": true,
3883
- "parameters": [],
3884
- "returnType": "any",
3885
- "isStatic": false,
3886
- "isPublic": true
3887
- },
3888
- "getSavedId": {
3889
- "name": "getSavedId",
3890
- "async": true,
3891
- "parameters": [],
3892
- "returnType": "any",
3893
- "isStatic": false,
3894
- "isPublic": true
3895
- },
3896
- "isSaved": {
3897
- "name": "isSaved",
3898
- "async": true,
3899
- "parameters": [],
3900
- "returnType": "any",
3901
- "isStatic": false,
3902
- "isPublic": true
3903
- },
3904
- "save": {
3905
- "name": "save",
3906
- "async": true,
3907
- "parameters": [
3908
- {
3909
- "name": "options",
3910
- "type": "SmrtSaveOptions",
3911
- "optional": true
3912
- }
3913
- ],
3914
- "returnType": "any",
3915
- "isStatic": false,
3916
- "isPublic": true
3917
- },
3918
- "claimRevision": {
3919
- "name": "claimRevision",
3920
- "async": true,
3921
- "parameters": [
3922
- {
3923
- "name": "expectedUpdatedAt",
3924
- "type": "Date | string",
3925
- "optional": false
3926
- }
3927
- ],
3928
- "returnType": "Promise",
3929
- "isStatic": false,
3930
- "isPublic": true
3931
- },
3932
- "classifyConstraintError": {
3933
- "name": "classifyConstraintError",
3934
- "async": false,
3935
- "parameters": [
3936
- {
3937
- "name": "message",
3938
- "type": "string",
3939
- "optional": false
3940
- }
3941
- ],
3942
- "returnType": "'unique' | 'not_null' | null",
3943
- "isStatic": true,
3944
- "isPublic": true
3945
- },
3946
- "loadFromId": {
3947
- "name": "loadFromId",
3948
- "async": true,
3949
- "parameters": [],
3950
- "returnType": "any",
3951
- "isStatic": false,
3952
- "isPublic": true
3953
- },
3954
- "loadFromSlug": {
3955
- "name": "loadFromSlug",
3956
- "async": true,
3957
- "parameters": [],
3958
- "returnType": "any",
3959
- "isStatic": false,
3960
- "isPublic": true
3961
- },
3962
- "is": {
3963
- "name": "is",
3964
- "async": true,
3965
- "parameters": [
3966
- {
3967
- "name": "criteria",
3968
- "type": "string",
3969
- "optional": false
3970
- },
3971
- {
3972
- "name": "options",
3973
- "type": "AiOperationOptions",
3974
- "optional": true
3975
- }
3976
- ],
3977
- "returnType": "any",
3978
- "isStatic": false,
3979
- "isPublic": true
3980
- },
3981
- "do": {
3982
- "name": "do",
3983
- "async": true,
3984
- "parameters": [
3985
- {
3986
- "name": "instructions",
3987
- "type": "string",
3988
- "optional": false
3989
- },
3990
- {
3991
- "name": "options",
3992
- "type": "AiOperationOptions",
3993
- "optional": true
3994
- }
3995
- ],
3996
- "returnType": "any",
3997
- "isStatic": false,
3998
- "isPublic": true
1797
+ "conflictColumns": [
1798
+ "tenant_id",
1799
+ "slug",
1800
+ "context",
1801
+ "_meta_type"
1802
+ ]
1803
+ },
1804
+ "extends": "SmrtObject",
1805
+ "exportName": "AnalyticsProperty",
1806
+ "collectionExportName": "AnalyticsPropertyCollection",
1807
+ "schema": {
1808
+ "tableName": "analytics_properties",
1809
+ "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);",
1810
+ "columns": {
1811
+ "id": {
1812
+ "type": "UUID",
1813
+ "primaryKey": true,
1814
+ "referenceKind": "id",
1815
+ "notNull": true
1816
+ },
1817
+ "slug": {
1818
+ "type": "TEXT",
1819
+ "notNull": true
1820
+ },
1821
+ "context": {
1822
+ "type": "TEXT",
1823
+ "notNull": true,
1824
+ "default": ""
1825
+ },
1826
+ "_meta_type": {
1827
+ "type": "TEXT",
1828
+ "notNull": true
1829
+ },
1830
+ "_meta_data": {
1831
+ "type": "JSON",
1832
+ "notNull": false
1833
+ },
1834
+ "created_at": {
1835
+ "type": "TIMESTAMP",
1836
+ "notNull": true,
1837
+ "default": "current_timestamp"
1838
+ },
1839
+ "updated_at": {
1840
+ "type": "TIMESTAMP",
1841
+ "notNull": true,
1842
+ "default": "current_timestamp"
1843
+ },
1844
+ "tenant_id": {
1845
+ "type": "UUID",
1846
+ "referenceKind": "tenantId",
1847
+ "notNull": false
1848
+ },
1849
+ "name": {
1850
+ "type": "TEXT",
1851
+ "notNull": false,
1852
+ "default": ""
1853
+ },
1854
+ "display_name": {
1855
+ "type": "TEXT",
1856
+ "notNull": false,
1857
+ "default": ""
1858
+ },
1859
+ "provider": {
1860
+ "type": "TEXT",
1861
+ "notNull": false
1862
+ },
1863
+ "external_id": {
1864
+ "type": "TEXT",
1865
+ "notNull": false,
1866
+ "default": ""
1867
+ },
1868
+ "measurement_id": {
1869
+ "type": "TEXT",
1870
+ "notNull": false,
1871
+ "default": ""
1872
+ },
1873
+ "api_secret": {
1874
+ "type": "TEXT",
1875
+ "notNull": false,
1876
+ "default": ""
1877
+ },
1878
+ "site_domain": {
1879
+ "type": "TEXT",
1880
+ "notNull": false,
1881
+ "default": ""
1882
+ },
1883
+ "time_zone": {
1884
+ "type": "TEXT",
1885
+ "notNull": false,
1886
+ "default": "America/Los_Angeles"
1887
+ },
1888
+ "currency_code": {
1889
+ "type": "TEXT",
1890
+ "notNull": false,
1891
+ "default": "USD"
1892
+ },
1893
+ "industry_category": {
1894
+ "type": "TEXT",
1895
+ "notNull": false,
1896
+ "default": ""
1897
+ },
1898
+ "service_level": {
1899
+ "type": "TEXT",
1900
+ "notNull": false,
1901
+ "default": "STANDARD"
1902
+ },
1903
+ "status": {
1904
+ "type": "TEXT",
1905
+ "notNull": false
1906
+ },
1907
+ "last_sync_at": {
1908
+ "type": "TIMESTAMP",
1909
+ "notNull": false
1910
+ },
1911
+ "provider_metadata": {
1912
+ "type": "TEXT",
1913
+ "notNull": false,
1914
+ "default": "{}"
1915
+ }
3999
1916
  },
4000
- "describe": {
4001
- "name": "describe",
4002
- "async": true,
4003
- "parameters": [
4004
- {
4005
- "name": "options",
4006
- "type": "AiOperationOptions",
4007
- "optional": true
4008
- }
4009
- ],
4010
- "returnType": "any",
4011
- "isStatic": false,
4012
- "isPublic": true
1917
+ "indexes": [
1918
+ {
1919
+ "name": "analytics_properties_slug_context_meta_type_idx",
1920
+ "columns": [
1921
+ "tenant_id",
1922
+ "slug",
1923
+ "context",
1924
+ "_meta_type"
1925
+ ],
1926
+ "unique": true
1927
+ },
1928
+ {
1929
+ "name": "analytics_properties_meta_type_idx",
1930
+ "columns": [
1931
+ "_meta_type"
1932
+ ]
1933
+ },
1934
+ {
1935
+ "name": "analytics_properties_tenant_id_created_at_idx",
1936
+ "columns": [
1937
+ "tenant_id",
1938
+ "created_at"
1939
+ ]
1940
+ }
1941
+ ],
1942
+ "version": "f38a20b9"
1943
+ }
1944
+ },
1945
+ "@happyvertical/smrt-analytics:AnalyticsReport": {
1946
+ "name": "analyticsreport",
1947
+ "className": "AnalyticsReport",
1948
+ "qualifiedName": "@happyvertical/smrt-analytics:AnalyticsReport",
1949
+ "collection": "analyticsreports",
1950
+ "filePath": "/home/runner/work/smrt/smrt/packages/analytics/src/models/AnalyticsReport.ts",
1951
+ "packageName": "@happyvertical/smrt-analytics",
1952
+ "fields": {
1953
+ "created_at": {
1954
+ "type": "datetime",
1955
+ "required": false
4013
1956
  },
4014
- "delete": {
4015
- "name": "delete",
4016
- "async": true,
4017
- "parameters": [
4018
- {
4019
- "name": "options",
4020
- "type": "SmrtDeleteOptions",
4021
- "optional": true
4022
- }
4023
- ],
4024
- "returnType": "Promise<void>",
4025
- "isStatic": false,
4026
- "isPublic": true
1957
+ "updated_at": {
1958
+ "type": "datetime",
1959
+ "required": false
4027
1960
  },
4028
- "isRelatedLoaded": {
4029
- "name": "isRelatedLoaded",
4030
- "async": false,
4031
- "parameters": [
4032
- {
4033
- "name": "fieldName",
4034
- "type": "string",
4035
- "optional": false
1961
+ "tenantId": {
1962
+ "type": "text",
1963
+ "required": false,
1964
+ "_meta": {
1965
+ "sqlType": "UUID",
1966
+ "nullable": true,
1967
+ "__tenancy": {
1968
+ "isTenantIdField": true,
1969
+ "autoFilter": true,
1970
+ "required": false,
1971
+ "autoPopulate": true,
1972
+ "nullable": true,
1973
+ "mode": "optional",
1974
+ "field": "tenantId",
1975
+ "allowSuperAdminBypass": false
4036
1976
  }
4037
- ],
4038
- "returnType": "boolean",
4039
- "isStatic": false,
4040
- "isPublic": true
1977
+ }
4041
1978
  },
4042
- "_setLoadedRelationship": {
4043
- "name": "_setLoadedRelationship",
4044
- "async": false,
4045
- "parameters": [
4046
- {
4047
- "name": "fieldName",
4048
- "type": "string",
4049
- "optional": false
4050
- },
4051
- {
4052
- "name": "value",
4053
- "type": "any",
4054
- "optional": false
4055
- }
4056
- ],
4057
- "returnType": "void",
4058
- "isStatic": false,
4059
- "isPublic": true
1979
+ "propertyId": {
1980
+ "type": "foreignKey",
1981
+ "required": false,
1982
+ "related": "AnalyticsProperty"
4060
1983
  },
4061
- "loadRelated": {
4062
- "name": "loadRelated",
4063
- "async": true,
4064
- "parameters": [
4065
- {
4066
- "name": "fieldName",
4067
- "type": "string",
4068
- "optional": false
4069
- },
4070
- {
4071
- "name": "opts",
4072
- "type": "LoadRelatedOptions",
4073
- "optional": true
4074
- }
4075
- ],
4076
- "returnType": "Promise<any>",
4077
- "isStatic": false,
4078
- "isPublic": true
1984
+ "name": {
1985
+ "type": "text",
1986
+ "required": false,
1987
+ "default": ""
4079
1988
  },
4080
- "loadRelatedMany": {
4081
- "name": "loadRelatedMany",
4082
- "async": true,
4083
- "parameters": [
4084
- {
4085
- "name": "fieldName",
4086
- "type": "string",
4087
- "optional": false
4088
- },
4089
- {
4090
- "name": "opts",
4091
- "type": "LoadRelatedOptions",
4092
- "optional": true
4093
- }
4094
- ],
4095
- "returnType": "Promise<any[]>",
4096
- "isStatic": false,
4097
- "isPublic": true
1989
+ "description": {
1990
+ "type": "text",
1991
+ "required": false,
1992
+ "default": ""
4098
1993
  },
4099
- "getRelated": {
4100
- "name": "getRelated",
4101
- "async": true,
4102
- "parameters": [
4103
- {
4104
- "name": "fieldName",
4105
- "type": "string",
4106
- "optional": false
4107
- },
4108
- {
4109
- "name": "opts",
4110
- "type": "LoadRelatedOptions",
4111
- "optional": true
4112
- }
4113
- ],
4114
- "returnType": "Promise<any>",
4115
- "isStatic": false,
4116
- "isPublic": true
1994
+ "dimensions": {
1995
+ "type": "text",
1996
+ "required": false,
1997
+ "default": "[]"
4117
1998
  },
4118
- "getAvailableTools": {
4119
- "name": "getAvailableTools",
4120
- "async": false,
4121
- "parameters": [],
4122
- "returnType": "AITool[]",
4123
- "isStatic": false,
4124
- "isPublic": true
1999
+ "metrics": {
2000
+ "type": "text",
2001
+ "required": false,
2002
+ "default": "[]"
4125
2003
  },
4126
- "executeToolCall": {
4127
- "name": "executeToolCall",
4128
- "async": true,
4129
- "parameters": [
4130
- {
4131
- "name": "toolCall",
4132
- "type": "ToolCall",
4133
- "optional": false
4134
- }
4135
- ],
4136
- "returnType": "Promise<ToolCallResult>",
4137
- "isStatic": false,
4138
- "isPublic": true
2004
+ "dateRangeStart": {
2005
+ "type": "text",
2006
+ "required": false,
2007
+ "default": "7daysAgo"
4139
2008
  },
4140
- "remember": {
4141
- "name": "remember",
4142
- "async": true,
4143
- "parameters": [
4144
- {
4145
- "name": "options",
4146
- "type": "object",
4147
- "optional": false
4148
- }
4149
- ],
4150
- "returnType": "Promise<void>",
4151
- "isStatic": false,
4152
- "isPublic": true
2009
+ "dateRangeEnd": {
2010
+ "type": "text",
2011
+ "required": false,
2012
+ "default": "today"
4153
2013
  },
4154
- "recall": {
4155
- "name": "recall",
4156
- "async": true,
4157
- "parameters": [
4158
- {
4159
- "name": "options",
4160
- "type": "object",
4161
- "optional": false
4162
- }
4163
- ],
4164
- "returnType": "Promise",
4165
- "isStatic": false,
4166
- "isPublic": true
2014
+ "dimensionFilter": {
2015
+ "type": "text",
2016
+ "required": false,
2017
+ "default": ""
4167
2018
  },
4168
- "recallAll": {
4169
- "name": "recallAll",
4170
- "async": true,
4171
- "parameters": [
4172
- {
4173
- "name": "options",
4174
- "type": "object",
4175
- "optional": true
4176
- }
4177
- ],
4178
- "returnType": "Promise<Map<string>>",
4179
- "isStatic": false,
4180
- "isPublic": true
2019
+ "metricFilter": {
2020
+ "type": "text",
2021
+ "required": false,
2022
+ "default": ""
4181
2023
  },
4182
- "forget": {
4183
- "name": "forget",
4184
- "async": true,
4185
- "parameters": [
4186
- {
4187
- "name": "options",
4188
- "type": "object",
4189
- "optional": false
4190
- }
4191
- ],
4192
- "returnType": "Promise<void>",
4193
- "isStatic": false,
4194
- "isPublic": true
2024
+ "orderBy": {
2025
+ "type": "text",
2026
+ "required": false,
2027
+ "default": "[]"
4195
2028
  },
4196
- "forgetScope": {
4197
- "name": "forgetScope",
4198
- "async": true,
4199
- "parameters": [
4200
- {
4201
- "name": "options",
4202
- "type": "object",
4203
- "optional": false
4204
- }
4205
- ],
4206
- "returnType": "Promise<number>",
4207
- "isStatic": false,
4208
- "isPublic": true
2029
+ "maxResults": {
2030
+ "type": "integer",
2031
+ "required": false,
2032
+ "default": 0
4209
2033
  },
4210
- "generateEmbeddings": {
4211
- "name": "generateEmbeddings",
4212
- "async": true,
4213
- "parameters": [
4214
- {
4215
- "name": "options",
4216
- "type": "GenerateEmbeddingsOptions",
4217
- "optional": true
4218
- }
4219
- ],
4220
- "returnType": "Promise<void>",
4221
- "isStatic": false,
4222
- "isPublic": true
2034
+ "status": {
2035
+ "type": "text",
2036
+ "required": false
4223
2037
  },
4224
- "getEmbedding": {
4225
- "name": "getEmbedding",
4226
- "async": true,
4227
- "parameters": [
4228
- {
4229
- "name": "fieldName",
4230
- "type": "string",
4231
- "optional": false
4232
- },
4233
- {
4234
- "name": "model",
4235
- "type": "string",
4236
- "optional": true
4237
- }
4238
- ],
4239
- "returnType": "Promise<number[] | null>",
4240
- "isStatic": false,
4241
- "isPublic": true
2038
+ "frequency": {
2039
+ "type": "text",
2040
+ "required": false
4242
2041
  },
4243
- "hasStaleEmbeddings": {
4244
- "name": "hasStaleEmbeddings",
4245
- "async": true,
4246
- "parameters": [],
4247
- "returnType": "Promise<boolean>",
4248
- "isStatic": false,
4249
- "isPublic": true
2042
+ "lastRunAt": {
2043
+ "type": "datetime",
2044
+ "required": false
4250
2045
  },
4251
- "clearEmbeddings": {
4252
- "name": "clearEmbeddings",
4253
- "async": true,
4254
- "parameters": [],
4255
- "returnType": "Promise<void>",
4256
- "isStatic": false,
4257
- "isPublic": true
2046
+ "nextRunAt": {
2047
+ "type": "datetime",
2048
+ "required": false
2049
+ },
2050
+ "resultData": {
2051
+ "type": "text",
2052
+ "required": false,
2053
+ "default": ""
2054
+ },
2055
+ "rowCount": {
2056
+ "type": "integer",
2057
+ "required": false,
2058
+ "default": 0
4258
2059
  },
2060
+ "lastError": {
2061
+ "type": "text",
2062
+ "required": false,
2063
+ "default": ""
2064
+ }
2065
+ },
2066
+ "methods": {
4259
2067
  "getDimensions": {
4260
2068
  "name": "getDimensions",
4261
2069
  "async": false,