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