@happyvertical/smrt-places 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-places",
5
- "packageVersion": "0.44.0",
5
+ "packageVersion": "0.45.0",
6
6
  "objects": {
7
7
  "@happyvertical/smrt-places:PlaceAssetCollection": {
8
8
  "name": "placeassetcollection",
@@ -794,1690 +794,606 @@
794
794
  }
795
795
  },
796
796
  "methods": {
797
- "withDatabase": {
798
- "name": "withDatabase",
797
+ "getParent": {
798
+ "name": "getParent",
799
799
  "async": true,
800
- "parameters": [
801
- {
802
- "name": "db",
803
- "type": "DatabaseInterface",
804
- "optional": false
805
- },
806
- {
807
- "name": "operation",
808
- "type": "Function",
809
- "optional": false
810
- }
811
- ],
812
- "returnType": "Promise<T>",
813
- "isStatic": false,
814
- "isPublic": true
815
- },
816
- "getAiUsageSnapshot": {
817
- "name": "getAiUsageSnapshot",
818
- "async": false,
819
- "parameters": [],
820
- "returnType": "AiUsageSnapshot | undefined",
821
- "isStatic": false,
822
- "isPublic": true
823
- },
824
- "resetAiUsage": {
825
- "name": "resetAiUsage",
826
- "async": false,
827
800
  "parameters": [],
828
- "returnType": "void",
829
- "isStatic": false,
830
- "isPublic": true
831
- },
832
- "listAiUsage": {
833
- "name": "listAiUsage",
834
- "async": true,
835
- "parameters": [
836
- {
837
- "name": "options",
838
- "type": "AiUsageListOptions",
839
- "optional": true
840
- }
841
- ],
842
- "returnType": "Promise<SmrtAiUsageRecord[]>",
801
+ "returnType": "Promise<null>",
843
802
  "isStatic": false,
844
803
  "isPublic": true
845
804
  },
846
- "summarizeAiUsage": {
847
- "name": "summarizeAiUsage",
805
+ "getChildren": {
806
+ "name": "getChildren",
848
807
  "async": true,
849
- "parameters": [
850
- {
851
- "name": "options",
852
- "type": "AiUsageSummaryOptions",
853
- "optional": true
854
- }
855
- ],
856
- "returnType": "Promise<Record<string, AiUsageStats>>",
857
- "isStatic": false,
858
- "isPublic": true
859
- },
860
- "destroy": {
861
- "name": "destroy",
862
- "async": false,
863
- "parameters": [],
864
- "returnType": "void",
865
- "isStatic": false,
866
- "isPublic": true
867
- },
868
- "markAsPersisted": {
869
- "name": "markAsPersisted",
870
- "async": false,
871
808
  "parameters": [],
872
- "returnType": "void",
809
+ "returnType": "Promise",
873
810
  "isStatic": false,
874
811
  "isPublic": true
875
812
  },
876
- "requireInsertOnSave": {
877
- "name": "requireInsertOnSave",
878
- "async": false,
813
+ "getAncestors": {
814
+ "name": "getAncestors",
815
+ "async": true,
879
816
  "parameters": [],
880
- "returnType": "void",
817
+ "returnType": "Promise",
881
818
  "isStatic": false,
882
819
  "isPublic": true
883
820
  },
884
- "withTransaction": {
885
- "name": "withTransaction",
821
+ "getDescendants": {
822
+ "name": "getDescendants",
886
823
  "async": true,
887
- "parameters": [
888
- {
889
- "name": "operation",
890
- "type": "Function",
891
- "optional": false
892
- }
893
- ],
894
- "returnType": "Promise<T>",
824
+ "parameters": [],
825
+ "returnType": "Promise",
895
826
  "isStatic": false,
896
827
  "isPublic": true
897
828
  },
898
- "initialize": {
899
- "name": "initialize",
829
+ "getHierarchy": {
830
+ "name": "getHierarchy",
900
831
  "async": true,
901
832
  "parameters": [],
902
- "returnType": "Promise",
833
+ "returnType": "Promise<HierarchyView>",
903
834
  "isStatic": false,
904
835
  "isPublic": true
905
836
  },
906
- "loadDataFromDb": {
907
- "name": "loadDataFromDb",
837
+ "moveTo": {
838
+ "name": "moveTo",
908
839
  "async": true,
909
840
  "parameters": [
910
841
  {
911
- "name": "data",
912
- "type": "Record<string>",
842
+ "name": "newParent",
843
+ "type": "string | null",
913
844
  "optional": false
914
845
  }
915
846
  ],
916
- "returnType": "any",
847
+ "returnType": "Promise<void>",
917
848
  "isStatic": false,
918
849
  "isPublic": true
919
850
  },
920
- "getFields": {
921
- "name": "getFields",
922
- "async": true,
851
+ "getGeoData": {
852
+ "name": "getGeoData",
853
+ "async": false,
923
854
  "parameters": [],
924
- "returnType": "Promise<any>",
855
+ "returnType": "GeoData",
925
856
  "isStatic": false,
926
857
  "isPublic": true
927
858
  },
928
- "toJSON": {
929
- "name": "toJSON",
859
+ "hasCoordinates": {
860
+ "name": "hasCoordinates",
930
861
  "async": false,
931
862
  "parameters": [],
932
- "returnType": "any",
863
+ "returnType": "boolean",
933
864
  "isStatic": false,
934
865
  "isPublic": true
935
866
  },
936
- "toPlainObject": {
937
- "name": "toPlainObject",
867
+ "getMetadata": {
868
+ "name": "getMetadata",
938
869
  "async": false,
939
870
  "parameters": [],
940
871
  "returnType": "Record<string>",
941
872
  "isStatic": false,
942
873
  "isPublic": true
943
874
  },
944
- "toPublicJSON": {
945
- "name": "toPublicJSON",
875
+ "setMetadata": {
876
+ "name": "setMetadata",
946
877
  "async": false,
947
878
  "parameters": [
948
879
  {
949
- "name": "options",
950
- "type": "PublicJsonOptions",
951
- "optional": true
952
- }
953
- ],
954
- "returnType": "Record<string>",
955
- "isStatic": false,
956
- "isPublic": true
957
- },
958
- "getId": {
959
- "name": "getId",
960
- "async": true,
961
- "parameters": [],
962
- "returnType": "any",
963
- "isStatic": false,
964
- "isPublic": true
965
- },
966
- "getSlug": {
967
- "name": "getSlug",
968
- "async": true,
969
- "parameters": [],
970
- "returnType": "any",
971
- "isStatic": false,
972
- "isPublic": true
973
- },
974
- "getSavedId": {
975
- "name": "getSavedId",
976
- "async": true,
977
- "parameters": [],
978
- "returnType": "any",
979
- "isStatic": false,
980
- "isPublic": true
981
- },
982
- "isSaved": {
983
- "name": "isSaved",
984
- "async": true,
985
- "parameters": [],
986
- "returnType": "any",
987
- "isStatic": false,
988
- "isPublic": true
989
- },
990
- "save": {
991
- "name": "save",
992
- "async": true,
993
- "parameters": [
994
- {
995
- "name": "options",
996
- "type": "SmrtSaveOptions",
997
- "optional": true
998
- }
999
- ],
1000
- "returnType": "any",
1001
- "isStatic": false,
1002
- "isPublic": true
1003
- },
1004
- "claimRevision": {
1005
- "name": "claimRevision",
1006
- "async": true,
1007
- "parameters": [
1008
- {
1009
- "name": "expectedUpdatedAt",
1010
- "type": "Date | string",
880
+ "name": "data",
881
+ "type": "Record<string>",
1011
882
  "optional": false
1012
883
  }
1013
884
  ],
1014
- "returnType": "Promise",
885
+ "returnType": "void",
1015
886
  "isStatic": false,
1016
887
  "isPublic": true
1017
888
  },
1018
- "classifyConstraintError": {
1019
- "name": "classifyConstraintError",
889
+ "updateMetadata": {
890
+ "name": "updateMetadata",
1020
891
  "async": false,
1021
892
  "parameters": [
1022
893
  {
1023
- "name": "message",
1024
- "type": "string",
894
+ "name": "updates",
895
+ "type": "Record<string>",
1025
896
  "optional": false
1026
897
  }
1027
898
  ],
1028
- "returnType": "'unique' | 'not_null' | null",
1029
- "isStatic": true,
1030
- "isPublic": true
1031
- },
1032
- "loadFromId": {
1033
- "name": "loadFromId",
1034
- "async": true,
1035
- "parameters": [],
1036
- "returnType": "any",
899
+ "returnType": "void",
1037
900
  "isStatic": false,
1038
901
  "isPublic": true
1039
902
  },
1040
- "loadFromSlug": {
1041
- "name": "loadFromSlug",
903
+ "getType": {
904
+ "name": "getType",
1042
905
  "async": true,
1043
906
  "parameters": [],
1044
907
  "returnType": "any",
1045
908
  "isStatic": false,
1046
909
  "isPublic": true
1047
910
  },
1048
- "is": {
1049
- "name": "is",
1050
- "async": true,
1051
- "parameters": [
1052
- {
1053
- "name": "criteria",
1054
- "type": "string",
1055
- "optional": false
1056
- },
1057
- {
1058
- "name": "options",
1059
- "type": "AiOperationOptions",
1060
- "optional": true
1061
- }
1062
- ],
1063
- "returnType": "any",
1064
- "isStatic": false,
1065
- "isPublic": true
1066
- },
1067
- "do": {
1068
- "name": "do",
911
+ "getAssets": {
912
+ "name": "getAssets",
1069
913
  "async": true,
1070
914
  "parameters": [
1071
915
  {
1072
- "name": "instructions",
916
+ "name": "relationship",
1073
917
  "type": "string",
1074
- "optional": false
1075
- },
1076
- {
1077
- "name": "options",
1078
- "type": "AiOperationOptions",
1079
- "optional": true
1080
- }
1081
- ],
1082
- "returnType": "any",
1083
- "isStatic": false,
1084
- "isPublic": true
1085
- },
1086
- "describe": {
1087
- "name": "describe",
1088
- "async": true,
1089
- "parameters": [
1090
- {
1091
- "name": "options",
1092
- "type": "AiOperationOptions",
1093
918
  "optional": true
1094
919
  }
1095
920
  ],
1096
- "returnType": "any",
921
+ "returnType": "Promise<Asset[]>",
1097
922
  "isStatic": false,
1098
923
  "isPublic": true
1099
924
  },
1100
- "delete": {
1101
- "name": "delete",
925
+ "addAsset": {
926
+ "name": "addAsset",
1102
927
  "async": true,
1103
- "parameters": [],
1104
- "returnType": "Promise<void>",
1105
- "isStatic": false,
1106
- "isPublic": true
1107
- },
1108
- "isRelatedLoaded": {
1109
- "name": "isRelatedLoaded",
1110
- "async": false,
1111
- "parameters": [
1112
- {
1113
- "name": "fieldName",
1114
- "type": "string",
1115
- "optional": false
1116
- }
1117
- ],
1118
- "returnType": "boolean",
1119
- "isStatic": false,
1120
- "isPublic": true
1121
- },
1122
- "_setLoadedRelationship": {
1123
- "name": "_setLoadedRelationship",
1124
- "async": false,
1125
928
  "parameters": [
1126
929
  {
1127
- "name": "fieldName",
1128
- "type": "string",
930
+ "name": "asset",
931
+ "type": "Asset",
1129
932
  "optional": false
1130
933
  },
1131
934
  {
1132
- "name": "value",
935
+ "name": "relationship",
1133
936
  "type": "any",
1134
- "optional": false
1135
- }
1136
- ],
1137
- "returnType": "void",
1138
- "isStatic": false,
1139
- "isPublic": true
1140
- },
1141
- "loadRelated": {
1142
- "name": "loadRelated",
1143
- "async": true,
1144
- "parameters": [
1145
- {
1146
- "name": "fieldName",
1147
- "type": "string",
1148
- "optional": false
937
+ "optional": true,
938
+ "default": "attachment"
1149
939
  },
1150
940
  {
1151
- "name": "opts",
1152
- "type": "LoadRelatedOptions",
941
+ "name": "sortOrder",
942
+ "type": "any",
1153
943
  "optional": true
1154
944
  }
1155
945
  ],
1156
- "returnType": "Promise<any>",
946
+ "returnType": "Promise<void>",
1157
947
  "isStatic": false,
1158
948
  "isPublic": true
1159
949
  },
1160
- "loadRelatedMany": {
1161
- "name": "loadRelatedMany",
950
+ "removeAsset": {
951
+ "name": "removeAsset",
1162
952
  "async": true,
1163
953
  "parameters": [
1164
954
  {
1165
- "name": "fieldName",
955
+ "name": "assetId",
1166
956
  "type": "string",
1167
957
  "optional": false
1168
958
  },
1169
959
  {
1170
- "name": "opts",
1171
- "type": "LoadRelatedOptions",
1172
- "optional": true
1173
- }
1174
- ],
1175
- "returnType": "Promise<any[]>",
1176
- "isStatic": false,
1177
- "isPublic": true
1178
- },
1179
- "getRelated": {
1180
- "name": "getRelated",
1181
- "async": true,
1182
- "parameters": [
1183
- {
1184
- "name": "fieldName",
960
+ "name": "relationship",
1185
961
  "type": "string",
1186
- "optional": false
1187
- },
1188
- {
1189
- "name": "opts",
1190
- "type": "LoadRelatedOptions",
1191
962
  "optional": true
1192
963
  }
1193
964
  ],
1194
- "returnType": "Promise<any>",
1195
- "isStatic": false,
1196
- "isPublic": true
1197
- },
1198
- "getAvailableTools": {
1199
- "name": "getAvailableTools",
1200
- "async": false,
1201
- "parameters": [],
1202
- "returnType": "AITool[]",
1203
- "isStatic": false,
1204
- "isPublic": true
1205
- },
1206
- "executeToolCall": {
1207
- "name": "executeToolCall",
1208
- "async": true,
1209
- "parameters": [
1210
- {
1211
- "name": "toolCall",
1212
- "type": "ToolCall",
1213
- "optional": false
1214
- }
1215
- ],
1216
- "returnType": "Promise<ToolCallResult>",
1217
- "isStatic": false,
1218
- "isPublic": true
1219
- },
1220
- "remember": {
1221
- "name": "remember",
1222
- "async": true,
1223
- "parameters": [
1224
- {
1225
- "name": "options",
1226
- "type": "object",
1227
- "optional": false
1228
- }
1229
- ],
1230
- "returnType": "Promise<void>",
1231
- "isStatic": false,
1232
- "isPublic": true
1233
- },
1234
- "recall": {
1235
- "name": "recall",
1236
- "async": true,
1237
- "parameters": [
1238
- {
1239
- "name": "options",
1240
- "type": "object",
1241
- "optional": false
1242
- }
1243
- ],
1244
- "returnType": "Promise",
1245
- "isStatic": false,
1246
- "isPublic": true
1247
- },
1248
- "recallAll": {
1249
- "name": "recallAll",
1250
- "async": true,
1251
- "parameters": [
1252
- {
1253
- "name": "options",
1254
- "type": "object",
1255
- "optional": true
1256
- }
1257
- ],
1258
- "returnType": "Promise<Map<string>>",
1259
- "isStatic": false,
1260
- "isPublic": true
1261
- },
1262
- "forget": {
1263
- "name": "forget",
1264
- "async": true,
1265
- "parameters": [
1266
- {
1267
- "name": "options",
1268
- "type": "object",
1269
- "optional": false
1270
- }
1271
- ],
1272
- "returnType": "Promise<void>",
1273
- "isStatic": false,
1274
- "isPublic": true
1275
- },
1276
- "forgetScope": {
1277
- "name": "forgetScope",
1278
- "async": true,
1279
- "parameters": [
1280
- {
1281
- "name": "options",
1282
- "type": "object",
1283
- "optional": false
1284
- }
1285
- ],
1286
- "returnType": "Promise<number>",
1287
- "isStatic": false,
1288
- "isPublic": true
1289
- },
1290
- "generateEmbeddings": {
1291
- "name": "generateEmbeddings",
1292
- "async": true,
1293
- "parameters": [
1294
- {
1295
- "name": "options",
1296
- "type": "GenerateEmbeddingsOptions",
1297
- "optional": true
1298
- }
1299
- ],
1300
- "returnType": "Promise<void>",
1301
- "isStatic": false,
1302
- "isPublic": true
1303
- },
1304
- "getEmbedding": {
1305
- "name": "getEmbedding",
1306
- "async": true,
1307
- "parameters": [
1308
- {
1309
- "name": "fieldName",
1310
- "type": "string",
1311
- "optional": false
1312
- },
1313
- {
1314
- "name": "model",
1315
- "type": "string",
1316
- "optional": true
1317
- }
1318
- ],
1319
- "returnType": "Promise<number[] | null>",
1320
- "isStatic": false,
1321
- "isPublic": true
1322
- },
1323
- "hasStaleEmbeddings": {
1324
- "name": "hasStaleEmbeddings",
1325
- "async": true,
1326
- "parameters": [],
1327
- "returnType": "Promise<boolean>",
1328
- "isStatic": false,
1329
- "isPublic": true
1330
- },
1331
- "clearEmbeddings": {
1332
- "name": "clearEmbeddings",
1333
- "async": true,
1334
- "parameters": [],
1335
- "returnType": "Promise<void>",
1336
- "isStatic": false,
1337
- "isPublic": true
1338
- },
1339
- "getParent": {
1340
- "name": "getParent",
1341
- "async": true,
1342
- "parameters": [],
1343
- "returnType": "Promise<null>",
1344
- "isStatic": false,
1345
- "isPublic": true
1346
- },
1347
- "getChildren": {
1348
- "name": "getChildren",
1349
- "async": true,
1350
- "parameters": [],
1351
- "returnType": "Promise",
1352
- "isStatic": false,
1353
- "isPublic": true
1354
- },
1355
- "getAncestors": {
1356
- "name": "getAncestors",
1357
- "async": true,
1358
- "parameters": [],
1359
- "returnType": "Promise",
1360
- "isStatic": false,
1361
- "isPublic": true
1362
- },
1363
- "getDescendants": {
1364
- "name": "getDescendants",
1365
- "async": true,
1366
- "parameters": [],
1367
- "returnType": "Promise",
1368
- "isStatic": false,
1369
- "isPublic": true
1370
- },
1371
- "getHierarchy": {
1372
- "name": "getHierarchy",
1373
- "async": true,
1374
- "parameters": [],
1375
- "returnType": "Promise<HierarchyView>",
1376
- "isStatic": false,
1377
- "isPublic": true
1378
- },
1379
- "moveTo": {
1380
- "name": "moveTo",
1381
- "async": true,
1382
- "parameters": [
1383
- {
1384
- "name": "newParent",
1385
- "type": "string | null",
1386
- "optional": false
1387
- }
1388
- ],
1389
- "returnType": "Promise<void>",
1390
- "isStatic": false,
1391
- "isPublic": true
1392
- },
1393
- "getGeoData": {
1394
- "name": "getGeoData",
1395
- "async": false,
1396
- "parameters": [],
1397
- "returnType": "GeoData",
1398
- "isStatic": false,
1399
- "isPublic": true
1400
- },
1401
- "hasCoordinates": {
1402
- "name": "hasCoordinates",
1403
- "async": false,
1404
- "parameters": [],
1405
- "returnType": "boolean",
1406
- "isStatic": false,
1407
- "isPublic": true
1408
- },
1409
- "getMetadata": {
1410
- "name": "getMetadata",
1411
- "async": false,
1412
- "parameters": [],
1413
- "returnType": "Record<string>",
1414
- "isStatic": false,
1415
- "isPublic": true
1416
- },
1417
- "setMetadata": {
1418
- "name": "setMetadata",
1419
- "async": false,
1420
- "parameters": [
1421
- {
1422
- "name": "data",
1423
- "type": "Record<string>",
1424
- "optional": false
1425
- }
1426
- ],
1427
- "returnType": "void",
1428
- "isStatic": false,
1429
- "isPublic": true
1430
- },
1431
- "updateMetadata": {
1432
- "name": "updateMetadata",
1433
- "async": false,
1434
- "parameters": [
1435
- {
1436
- "name": "updates",
1437
- "type": "Record<string>",
1438
- "optional": false
1439
- }
1440
- ],
1441
- "returnType": "void",
1442
- "isStatic": false,
1443
- "isPublic": true
1444
- },
1445
- "getType": {
1446
- "name": "getType",
1447
- "async": true,
1448
- "parameters": [],
1449
- "returnType": "any",
1450
- "isStatic": false,
1451
- "isPublic": true
1452
- },
1453
- "getAssets": {
1454
- "name": "getAssets",
1455
- "async": true,
1456
- "parameters": [
1457
- {
1458
- "name": "relationship",
1459
- "type": "string",
1460
- "optional": true
1461
- }
1462
- ],
1463
- "returnType": "Promise<Asset[]>",
1464
- "isStatic": false,
1465
- "isPublic": true
1466
- },
1467
- "addAsset": {
1468
- "name": "addAsset",
1469
- "async": true,
1470
- "parameters": [
1471
- {
1472
- "name": "asset",
1473
- "type": "Asset",
1474
- "optional": false
1475
- },
1476
- {
1477
- "name": "relationship",
1478
- "type": "any",
1479
- "optional": true,
1480
- "default": "attachment"
1481
- },
1482
- {
1483
- "name": "sortOrder",
1484
- "type": "any",
1485
- "optional": true
1486
- }
1487
- ],
1488
- "returnType": "Promise<void>",
1489
- "isStatic": false,
1490
- "isPublic": true
1491
- },
1492
- "removeAsset": {
1493
- "name": "removeAsset",
1494
- "async": true,
1495
- "parameters": [
1496
- {
1497
- "name": "assetId",
1498
- "type": "string",
1499
- "optional": false
1500
- },
1501
- {
1502
- "name": "relationship",
1503
- "type": "string",
1504
- "optional": true
1505
- }
1506
- ],
1507
- "returnType": "Promise<void>",
1508
- "isStatic": false,
1509
- "isPublic": true
1510
- }
1511
- },
1512
- "decoratorConfig": {
1513
- "tableStrategy": "sti",
1514
- "api": {
1515
- "include": [
1516
- "list",
1517
- "get",
1518
- "create",
1519
- "update",
1520
- "delete"
1521
- ]
1522
- },
1523
- "mcp": {
1524
- "include": [
1525
- "list",
1526
- "get",
1527
- "create",
1528
- "update"
1529
- ]
1530
- },
1531
- "cli": true,
1532
- "tenantScoped": {
1533
- "mode": "optional"
1534
- },
1535
- "conflictColumns": [
1536
- "tenant_id",
1537
- "slug",
1538
- "context",
1539
- "_meta_type"
1540
- ]
1541
- },
1542
- "extends": "SmrtHierarchical",
1543
- "exportName": "Place",
1544
- "collectionExportName": "PlaceCollection",
1545
- "schema": {
1546
- "tableName": "places",
1547
- "ddl": "CREATE TABLE IF NOT EXISTS \"places\" (\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 \"parent_id\" UUID,\n \"tenant_id\" UUID,\n \"type_id\" UUID,\n \"name\" TEXT,\n \"description\" TEXT,\n \"latitude\" REAL,\n \"longitude\" REAL,\n \"street_number\" TEXT,\n \"street_name\" TEXT,\n \"city\" TEXT,\n \"region\" TEXT,\n \"country\" TEXT,\n \"postal_code\" TEXT,\n \"country_code\" TEXT,\n \"timezone\" TEXT,\n \"external_id\" TEXT,\n \"source\" TEXT,\n \"metadata\" TEXT\n);",
1548
- "columns": {
1549
- "id": {
1550
- "type": "UUID",
1551
- "primaryKey": true,
1552
- "referenceKind": "id",
1553
- "notNull": true
1554
- },
1555
- "slug": {
1556
- "type": "TEXT",
1557
- "notNull": true
1558
- },
1559
- "context": {
1560
- "type": "TEXT",
1561
- "notNull": true,
1562
- "default": ""
1563
- },
1564
- "_meta_type": {
1565
- "type": "TEXT",
1566
- "notNull": true
1567
- },
1568
- "_meta_data": {
1569
- "type": "JSON",
1570
- "notNull": false
1571
- },
1572
- "created_at": {
1573
- "type": "TIMESTAMP",
1574
- "notNull": true,
1575
- "default": "current_timestamp"
1576
- },
1577
- "updated_at": {
1578
- "type": "TIMESTAMP",
1579
- "notNull": true,
1580
- "default": "current_timestamp"
1581
- },
1582
- "parent_id": {
1583
- "type": "UUID",
1584
- "referenceKind": "foreignKey",
1585
- "notNull": false,
1586
- "foreignKey": {
1587
- "table": "places",
1588
- "column": "id",
1589
- "onDelete": "NO ACTION",
1590
- "onUpdate": "CASCADE"
1591
- }
1592
- },
1593
- "tenant_id": {
1594
- "type": "UUID",
1595
- "referenceKind": "tenantId",
1596
- "notNull": false
1597
- },
1598
- "type_id": {
1599
- "type": "UUID",
1600
- "referenceKind": "foreignKey",
1601
- "notNull": false,
1602
- "foreignKey": {
1603
- "table": "place_types",
1604
- "column": "id",
1605
- "onDelete": "NO ACTION",
1606
- "onUpdate": "CASCADE"
1607
- }
1608
- },
1609
- "name": {
1610
- "type": "TEXT",
1611
- "notNull": false
1612
- },
1613
- "description": {
1614
- "type": "TEXT",
1615
- "notNull": false
1616
- },
1617
- "latitude": {
1618
- "type": "REAL",
1619
- "notNull": false
1620
- },
1621
- "longitude": {
1622
- "type": "REAL",
1623
- "notNull": false
1624
- },
1625
- "street_number": {
1626
- "type": "TEXT",
1627
- "notNull": false
1628
- },
1629
- "street_name": {
1630
- "type": "TEXT",
1631
- "notNull": false
1632
- },
1633
- "city": {
1634
- "type": "TEXT",
1635
- "notNull": false
1636
- },
1637
- "region": {
1638
- "type": "TEXT",
1639
- "notNull": false
1640
- },
1641
- "country": {
1642
- "type": "TEXT",
1643
- "notNull": false
1644
- },
1645
- "postal_code": {
1646
- "type": "TEXT",
1647
- "notNull": false
1648
- },
1649
- "country_code": {
1650
- "type": "TEXT",
1651
- "notNull": false
1652
- },
1653
- "timezone": {
1654
- "type": "TEXT",
1655
- "notNull": false
1656
- },
1657
- "external_id": {
1658
- "type": "TEXT",
1659
- "notNull": false
1660
- },
1661
- "source": {
1662
- "type": "TEXT",
1663
- "notNull": false
1664
- },
1665
- "metadata": {
1666
- "type": "TEXT",
1667
- "notNull": false
1668
- }
1669
- },
1670
- "indexes": [
1671
- {
1672
- "name": "places_slug_context_meta_type_idx",
1673
- "columns": [
1674
- "tenant_id",
1675
- "slug",
1676
- "context",
1677
- "_meta_type"
1678
- ],
1679
- "unique": true
1680
- },
1681
- {
1682
- "name": "places_meta_type_idx",
1683
- "columns": [
1684
- "_meta_type"
1685
- ]
1686
- },
1687
- {
1688
- "name": "places_tenant_id_created_at_idx",
1689
- "columns": [
1690
- "tenant_id",
1691
- "created_at"
1692
- ]
1693
- },
1694
- {
1695
- "name": "places_parent_id_idx",
1696
- "columns": [
1697
- "parent_id"
1698
- ]
1699
- },
1700
- {
1701
- "name": "places_type_id_idx",
1702
- "columns": [
1703
- "type_id"
1704
- ]
1705
- }
1706
- ],
1707
- "version": "f670088c"
1708
- }
1709
- },
1710
- "@happyvertical/smrt-places:PlaceAsset": {
1711
- "name": "placeasset",
1712
- "className": "PlaceAsset",
1713
- "qualifiedName": "@happyvertical/smrt-places:PlaceAsset",
1714
- "collection": "placeassets",
1715
- "filePath": "/home/runner/work/smrt/smrt/packages/places/src/models/PlaceAsset.ts",
1716
- "packageName": "@happyvertical/smrt-places",
1717
- "fields": {
1718
- "tenantId": {
1719
- "type": "text",
1720
- "required": false,
1721
- "_meta": {
1722
- "sqlType": "UUID",
1723
- "nullable": true,
1724
- "__tenancy": {
1725
- "isTenantIdField": true,
1726
- "autoFilter": true,
1727
- "required": false,
1728
- "autoPopulate": true,
1729
- "nullable": true,
1730
- "mode": "optional",
1731
- "field": "tenantId",
1732
- "allowSuperAdminBypass": false
1733
- }
1734
- }
1735
- },
1736
- "placeId": {
1737
- "type": "foreignKey",
1738
- "required": true,
1739
- "related": "Place",
1740
- "_meta": {
1741
- "required": true
1742
- }
1743
- },
1744
- "assetId": {
1745
- "type": "crossPackageRef",
1746
- "required": true,
1747
- "related": "@happyvertical/smrt-assets:Asset"
1748
- },
1749
- "relationship": {
1750
- "type": "text",
1751
- "required": true,
1752
- "_meta": {
1753
- "required": true
1754
- }
1755
- },
1756
- "sortOrder": {
1757
- "type": "integer",
1758
- "required": true,
1759
- "default": 0
1760
- }
1761
- },
1762
- "methods": {},
1763
- "decoratorConfig": {
1764
- "tableName": "place_assets",
1765
- "conflictColumns": [
1766
- "place_id",
1767
- "asset_id",
1768
- "relationship"
1769
- ],
1770
- "api": false,
1771
- "mcp": false,
1772
- "cli": false,
1773
- "tenantScoped": {
1774
- "mode": "optional"
1775
- }
1776
- },
1777
- "extends": "SmrtObject",
1778
- "exportName": "PlaceAsset",
1779
- "collectionExportName": "PlaceAssetCollection",
1780
- "validationRules": [
1781
- {
1782
- "field": "placeId",
1783
- "rule": "required",
1784
- "fieldType": "foreignKey"
1785
- },
1786
- {
1787
- "field": "assetId",
1788
- "rule": "required",
1789
- "fieldType": "crossPackageRef"
1790
- },
1791
- {
1792
- "field": "relationship",
1793
- "rule": "required",
1794
- "fieldType": "text"
1795
- },
1796
- {
1797
- "field": "sortOrder",
1798
- "rule": "required",
1799
- "fieldType": "integer"
1800
- }
1801
- ],
1802
- "schema": {
1803
- "tableName": "place_assets",
1804
- "ddl": "CREATE TABLE IF NOT EXISTS \"place_assets\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID,\n \"place_id\" UUID NOT NULL,\n \"asset_id\" UUID NOT NULL,\n \"relationship\" TEXT NOT NULL,\n \"sort_order\" INTEGER NOT NULL DEFAULT 0\n);",
1805
- "columns": {
1806
- "id": {
1807
- "type": "UUID",
1808
- "primaryKey": true,
1809
- "referenceKind": "id",
1810
- "notNull": true
1811
- },
1812
- "slug": {
1813
- "type": "TEXT",
1814
- "notNull": true
1815
- },
1816
- "context": {
1817
- "type": "TEXT",
1818
- "notNull": true,
1819
- "default": ""
1820
- },
1821
- "created_at": {
1822
- "type": "TIMESTAMP",
1823
- "notNull": true,
1824
- "default": "current_timestamp"
1825
- },
1826
- "updated_at": {
1827
- "type": "TIMESTAMP",
1828
- "notNull": true,
1829
- "default": "current_timestamp"
1830
- },
1831
- "tenant_id": {
1832
- "type": "UUID",
1833
- "referenceKind": "tenantId",
1834
- "notNull": false,
1835
- "unique": false
1836
- },
1837
- "place_id": {
1838
- "type": "UUID",
1839
- "referenceKind": "foreignKey",
1840
- "notNull": true,
1841
- "unique": false,
1842
- "foreignKey": {
1843
- "table": "places",
1844
- "column": "id",
1845
- "onDelete": "CASCADE",
1846
- "onUpdate": "CASCADE"
1847
- }
1848
- },
1849
- "asset_id": {
1850
- "type": "UUID",
1851
- "referenceKind": "crossPackageRef",
1852
- "notNull": true,
1853
- "unique": false
1854
- },
1855
- "relationship": {
1856
- "type": "TEXT",
1857
- "notNull": true,
1858
- "unique": false
1859
- },
1860
- "sort_order": {
1861
- "type": "INTEGER",
1862
- "notNull": true,
1863
- "unique": false,
1864
- "default": 0
1865
- }
1866
- },
1867
- "indexes": [
1868
- {
1869
- "name": "place_assets_place_id_asset_id_idx",
1870
- "columns": [
1871
- "place_id",
1872
- "asset_id",
1873
- "relationship"
1874
- ],
1875
- "unique": true
1876
- },
1877
- {
1878
- "name": "place_assets_slug_context_idx",
1879
- "columns": [
1880
- "slug",
1881
- "context"
1882
- ]
1883
- },
1884
- {
1885
- "name": "place_assets_tenant_id_created_at_idx",
1886
- "columns": [
1887
- "tenant_id",
1888
- "created_at"
1889
- ]
1890
- },
1891
- {
1892
- "name": "place_assets_asset_id_idx",
1893
- "columns": [
1894
- "asset_id"
1895
- ]
1896
- }
1897
- ],
1898
- "version": "adf47666"
1899
- }
1900
- },
1901
- "@happyvertical/smrt-places:PlaceType": {
1902
- "name": "placetype",
1903
- "className": "PlaceType",
1904
- "qualifiedName": "@happyvertical/smrt-places:PlaceType",
1905
- "collection": "placetypes",
1906
- "filePath": "/home/runner/work/smrt/smrt/packages/places/src/models/PlaceType.ts",
1907
- "packageName": "@happyvertical/smrt-places",
1908
- "fields": {
1909
- "created_at": {
1910
- "type": "datetime",
1911
- "required": false
1912
- },
1913
- "updated_at": {
1914
- "type": "datetime",
1915
- "required": false
1916
- },
1917
- "name": {
1918
- "type": "text",
1919
- "required": true,
1920
- "default": "",
1921
- "_meta": {
1922
- "required": true
1923
- }
1924
- },
1925
- "description": {
1926
- "type": "text",
1927
- "required": false
1928
- },
1929
- "createdAt": {
1930
- "type": "text",
1931
- "required": false
1932
- },
1933
- "updatedAt": {
1934
- "type": "text",
1935
- "required": false
1936
- }
1937
- },
1938
- "methods": {
1939
- "withDatabase": {
1940
- "name": "withDatabase",
1941
- "async": true,
1942
- "parameters": [
1943
- {
1944
- "name": "db",
1945
- "type": "DatabaseInterface",
1946
- "optional": false
1947
- },
1948
- {
1949
- "name": "operation",
1950
- "type": "Function",
1951
- "optional": false
1952
- }
1953
- ],
1954
- "returnType": "Promise<T>",
1955
- "isStatic": false,
1956
- "isPublic": true
1957
- },
1958
- "getAiUsageSnapshot": {
1959
- "name": "getAiUsageSnapshot",
1960
- "async": false,
1961
- "parameters": [],
1962
- "returnType": "AiUsageSnapshot | undefined",
1963
- "isStatic": false,
1964
- "isPublic": true
1965
- },
1966
- "resetAiUsage": {
1967
- "name": "resetAiUsage",
1968
- "async": false,
1969
- "parameters": [],
1970
- "returnType": "void",
1971
- "isStatic": false,
1972
- "isPublic": true
1973
- },
1974
- "listAiUsage": {
1975
- "name": "listAiUsage",
1976
- "async": true,
1977
- "parameters": [
1978
- {
1979
- "name": "options",
1980
- "type": "AiUsageListOptions",
1981
- "optional": true
1982
- }
1983
- ],
1984
- "returnType": "Promise<SmrtAiUsageRecord[]>",
1985
- "isStatic": false,
1986
- "isPublic": true
1987
- },
1988
- "summarizeAiUsage": {
1989
- "name": "summarizeAiUsage",
1990
- "async": true,
1991
- "parameters": [
1992
- {
1993
- "name": "options",
1994
- "type": "AiUsageSummaryOptions",
1995
- "optional": true
1996
- }
1997
- ],
1998
- "returnType": "Promise<Record<string, AiUsageStats>>",
1999
- "isStatic": false,
2000
- "isPublic": true
2001
- },
2002
- "destroy": {
2003
- "name": "destroy",
2004
- "async": false,
2005
- "parameters": [],
2006
- "returnType": "void",
2007
- "isStatic": false,
2008
- "isPublic": true
2009
- },
2010
- "markAsPersisted": {
2011
- "name": "markAsPersisted",
2012
- "async": false,
2013
- "parameters": [],
2014
- "returnType": "void",
2015
- "isStatic": false,
2016
- "isPublic": true
2017
- },
2018
- "requireInsertOnSave": {
2019
- "name": "requireInsertOnSave",
2020
- "async": false,
2021
- "parameters": [],
2022
- "returnType": "void",
2023
- "isStatic": false,
2024
- "isPublic": true
2025
- },
2026
- "withTransaction": {
2027
- "name": "withTransaction",
2028
- "async": true,
2029
- "parameters": [
2030
- {
2031
- "name": "operation",
2032
- "type": "Function",
2033
- "optional": false
2034
- }
2035
- ],
2036
- "returnType": "Promise<T>",
2037
- "isStatic": false,
2038
- "isPublic": true
2039
- },
2040
- "initialize": {
2041
- "name": "initialize",
2042
- "async": true,
2043
- "parameters": [],
2044
- "returnType": "Promise",
2045
- "isStatic": false,
2046
- "isPublic": true
2047
- },
2048
- "loadDataFromDb": {
2049
- "name": "loadDataFromDb",
2050
- "async": true,
2051
- "parameters": [
2052
- {
2053
- "name": "data",
2054
- "type": "Record<string>",
2055
- "optional": false
2056
- }
2057
- ],
2058
- "returnType": "any",
2059
- "isStatic": false,
2060
- "isPublic": true
2061
- },
2062
- "getFields": {
2063
- "name": "getFields",
2064
- "async": true,
2065
- "parameters": [],
2066
- "returnType": "Promise<any>",
2067
- "isStatic": false,
2068
- "isPublic": true
2069
- },
2070
- "toJSON": {
2071
- "name": "toJSON",
2072
- "async": false,
2073
- "parameters": [],
2074
- "returnType": "any",
2075
- "isStatic": false,
2076
- "isPublic": true
2077
- },
2078
- "toPlainObject": {
2079
- "name": "toPlainObject",
2080
- "async": false,
2081
- "parameters": [],
2082
- "returnType": "Record<string>",
2083
- "isStatic": false,
2084
- "isPublic": true
2085
- },
2086
- "toPublicJSON": {
2087
- "name": "toPublicJSON",
2088
- "async": false,
2089
- "parameters": [
2090
- {
2091
- "name": "options",
2092
- "type": "PublicJsonOptions",
2093
- "optional": true
2094
- }
2095
- ],
2096
- "returnType": "Record<string>",
2097
- "isStatic": false,
2098
- "isPublic": true
2099
- },
2100
- "getId": {
2101
- "name": "getId",
2102
- "async": true,
2103
- "parameters": [],
2104
- "returnType": "any",
2105
- "isStatic": false,
2106
- "isPublic": true
2107
- },
2108
- "getSlug": {
2109
- "name": "getSlug",
2110
- "async": true,
2111
- "parameters": [],
2112
- "returnType": "any",
2113
- "isStatic": false,
2114
- "isPublic": true
2115
- },
2116
- "getSavedId": {
2117
- "name": "getSavedId",
2118
- "async": true,
2119
- "parameters": [],
2120
- "returnType": "any",
2121
- "isStatic": false,
2122
- "isPublic": true
2123
- },
2124
- "isSaved": {
2125
- "name": "isSaved",
2126
- "async": true,
2127
- "parameters": [],
2128
- "returnType": "any",
2129
- "isStatic": false,
2130
- "isPublic": true
2131
- },
2132
- "save": {
2133
- "name": "save",
2134
- "async": true,
2135
- "parameters": [
2136
- {
2137
- "name": "options",
2138
- "type": "SmrtSaveOptions",
2139
- "optional": true
2140
- }
2141
- ],
2142
- "returnType": "any",
2143
- "isStatic": false,
2144
- "isPublic": true
2145
- },
2146
- "claimRevision": {
2147
- "name": "claimRevision",
2148
- "async": true,
2149
- "parameters": [
2150
- {
2151
- "name": "expectedUpdatedAt",
2152
- "type": "Date | string",
2153
- "optional": false
2154
- }
2155
- ],
2156
- "returnType": "Promise",
2157
- "isStatic": false,
2158
- "isPublic": true
2159
- },
2160
- "classifyConstraintError": {
2161
- "name": "classifyConstraintError",
2162
- "async": false,
2163
- "parameters": [
2164
- {
2165
- "name": "message",
2166
- "type": "string",
2167
- "optional": false
2168
- }
2169
- ],
2170
- "returnType": "'unique' | 'not_null' | null",
2171
- "isStatic": true,
2172
- "isPublic": true
2173
- },
2174
- "loadFromId": {
2175
- "name": "loadFromId",
2176
- "async": true,
2177
- "parameters": [],
2178
- "returnType": "any",
2179
- "isStatic": false,
2180
- "isPublic": true
2181
- },
2182
- "loadFromSlug": {
2183
- "name": "loadFromSlug",
2184
- "async": true,
2185
- "parameters": [],
2186
- "returnType": "any",
2187
- "isStatic": false,
2188
- "isPublic": true
2189
- },
2190
- "is": {
2191
- "name": "is",
2192
- "async": true,
2193
- "parameters": [
2194
- {
2195
- "name": "criteria",
2196
- "type": "string",
2197
- "optional": false
2198
- },
2199
- {
2200
- "name": "options",
2201
- "type": "AiOperationOptions",
2202
- "optional": true
2203
- }
2204
- ],
2205
- "returnType": "any",
2206
- "isStatic": false,
2207
- "isPublic": true
2208
- },
2209
- "do": {
2210
- "name": "do",
2211
- "async": true,
2212
- "parameters": [
2213
- {
2214
- "name": "instructions",
2215
- "type": "string",
2216
- "optional": false
2217
- },
2218
- {
2219
- "name": "options",
2220
- "type": "AiOperationOptions",
2221
- "optional": true
2222
- }
2223
- ],
2224
- "returnType": "any",
2225
- "isStatic": false,
2226
- "isPublic": true
2227
- },
2228
- "describe": {
2229
- "name": "describe",
2230
- "async": true,
2231
- "parameters": [
2232
- {
2233
- "name": "options",
2234
- "type": "AiOperationOptions",
2235
- "optional": true
2236
- }
2237
- ],
2238
- "returnType": "any",
965
+ "returnType": "Promise<void>",
2239
966
  "isStatic": false,
2240
967
  "isPublic": true
968
+ }
969
+ },
970
+ "decoratorConfig": {
971
+ "tableStrategy": "sti",
972
+ "api": {
973
+ "include": [
974
+ "list",
975
+ "get",
976
+ "create",
977
+ "update",
978
+ "delete"
979
+ ]
2241
980
  },
2242
- "delete": {
2243
- "name": "delete",
2244
- "async": true,
2245
- "parameters": [],
2246
- "returnType": "Promise<void>",
2247
- "isStatic": false,
2248
- "isPublic": true
981
+ "mcp": {
982
+ "include": [
983
+ "list",
984
+ "get",
985
+ "create",
986
+ "update"
987
+ ]
2249
988
  },
2250
- "isRelatedLoaded": {
2251
- "name": "isRelatedLoaded",
2252
- "async": false,
2253
- "parameters": [
2254
- {
2255
- "name": "fieldName",
2256
- "type": "string",
2257
- "optional": false
2258
- }
2259
- ],
2260
- "returnType": "boolean",
2261
- "isStatic": false,
2262
- "isPublic": true
989
+ "cli": true,
990
+ "tenantScoped": {
991
+ "mode": "optional"
2263
992
  },
2264
- "_setLoadedRelationship": {
2265
- "name": "_setLoadedRelationship",
2266
- "async": false,
2267
- "parameters": [
2268
- {
2269
- "name": "fieldName",
2270
- "type": "string",
2271
- "optional": false
2272
- },
2273
- {
2274
- "name": "value",
2275
- "type": "any",
2276
- "optional": false
993
+ "conflictColumns": [
994
+ "tenant_id",
995
+ "slug",
996
+ "context",
997
+ "_meta_type"
998
+ ]
999
+ },
1000
+ "extends": "SmrtHierarchical",
1001
+ "exportName": "Place",
1002
+ "collectionExportName": "PlaceCollection",
1003
+ "schema": {
1004
+ "tableName": "places",
1005
+ "ddl": "CREATE TABLE IF NOT EXISTS \"places\" (\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 \"parent_id\" UUID,\n \"tenant_id\" UUID,\n \"type_id\" UUID,\n \"name\" TEXT,\n \"description\" TEXT,\n \"latitude\" REAL,\n \"longitude\" REAL,\n \"street_number\" TEXT,\n \"street_name\" TEXT,\n \"city\" TEXT,\n \"region\" TEXT,\n \"country\" TEXT,\n \"postal_code\" TEXT,\n \"country_code\" TEXT,\n \"timezone\" TEXT,\n \"external_id\" TEXT,\n \"source\" TEXT,\n \"metadata\" TEXT\n);",
1006
+ "columns": {
1007
+ "id": {
1008
+ "type": "UUID",
1009
+ "primaryKey": true,
1010
+ "referenceKind": "id",
1011
+ "notNull": true
1012
+ },
1013
+ "slug": {
1014
+ "type": "TEXT",
1015
+ "notNull": true
1016
+ },
1017
+ "context": {
1018
+ "type": "TEXT",
1019
+ "notNull": true,
1020
+ "default": ""
1021
+ },
1022
+ "_meta_type": {
1023
+ "type": "TEXT",
1024
+ "notNull": true
1025
+ },
1026
+ "_meta_data": {
1027
+ "type": "JSON",
1028
+ "notNull": false
1029
+ },
1030
+ "created_at": {
1031
+ "type": "TIMESTAMP",
1032
+ "notNull": true,
1033
+ "default": "current_timestamp"
1034
+ },
1035
+ "updated_at": {
1036
+ "type": "TIMESTAMP",
1037
+ "notNull": true,
1038
+ "default": "current_timestamp"
1039
+ },
1040
+ "parent_id": {
1041
+ "type": "UUID",
1042
+ "referenceKind": "foreignKey",
1043
+ "notNull": false,
1044
+ "foreignKey": {
1045
+ "table": "places",
1046
+ "column": "id",
1047
+ "onDelete": "NO ACTION",
1048
+ "onUpdate": "CASCADE"
2277
1049
  }
2278
- ],
2279
- "returnType": "void",
2280
- "isStatic": false,
2281
- "isPublic": true
2282
- },
2283
- "loadRelated": {
2284
- "name": "loadRelated",
2285
- "async": true,
2286
- "parameters": [
2287
- {
2288
- "name": "fieldName",
2289
- "type": "string",
2290
- "optional": false
2291
- },
2292
- {
2293
- "name": "opts",
2294
- "type": "LoadRelatedOptions",
2295
- "optional": true
1050
+ },
1051
+ "tenant_id": {
1052
+ "type": "UUID",
1053
+ "referenceKind": "tenantId",
1054
+ "notNull": false
1055
+ },
1056
+ "type_id": {
1057
+ "type": "UUID",
1058
+ "referenceKind": "foreignKey",
1059
+ "notNull": false,
1060
+ "foreignKey": {
1061
+ "table": "place_types",
1062
+ "column": "id",
1063
+ "onDelete": "NO ACTION",
1064
+ "onUpdate": "CASCADE"
2296
1065
  }
2297
- ],
2298
- "returnType": "Promise<any>",
2299
- "isStatic": false,
2300
- "isPublic": true
1066
+ },
1067
+ "name": {
1068
+ "type": "TEXT",
1069
+ "notNull": false
1070
+ },
1071
+ "description": {
1072
+ "type": "TEXT",
1073
+ "notNull": false
1074
+ },
1075
+ "latitude": {
1076
+ "type": "REAL",
1077
+ "notNull": false
1078
+ },
1079
+ "longitude": {
1080
+ "type": "REAL",
1081
+ "notNull": false
1082
+ },
1083
+ "street_number": {
1084
+ "type": "TEXT",
1085
+ "notNull": false
1086
+ },
1087
+ "street_name": {
1088
+ "type": "TEXT",
1089
+ "notNull": false
1090
+ },
1091
+ "city": {
1092
+ "type": "TEXT",
1093
+ "notNull": false
1094
+ },
1095
+ "region": {
1096
+ "type": "TEXT",
1097
+ "notNull": false
1098
+ },
1099
+ "country": {
1100
+ "type": "TEXT",
1101
+ "notNull": false
1102
+ },
1103
+ "postal_code": {
1104
+ "type": "TEXT",
1105
+ "notNull": false
1106
+ },
1107
+ "country_code": {
1108
+ "type": "TEXT",
1109
+ "notNull": false
1110
+ },
1111
+ "timezone": {
1112
+ "type": "TEXT",
1113
+ "notNull": false
1114
+ },
1115
+ "external_id": {
1116
+ "type": "TEXT",
1117
+ "notNull": false
1118
+ },
1119
+ "source": {
1120
+ "type": "TEXT",
1121
+ "notNull": false
1122
+ },
1123
+ "metadata": {
1124
+ "type": "TEXT",
1125
+ "notNull": false
1126
+ }
2301
1127
  },
2302
- "loadRelatedMany": {
2303
- "name": "loadRelatedMany",
2304
- "async": true,
2305
- "parameters": [
2306
- {
2307
- "name": "fieldName",
2308
- "type": "string",
2309
- "optional": false
2310
- },
2311
- {
2312
- "name": "opts",
2313
- "type": "LoadRelatedOptions",
2314
- "optional": true
1128
+ "indexes": [
1129
+ {
1130
+ "name": "places_slug_context_meta_type_idx",
1131
+ "columns": [
1132
+ "tenant_id",
1133
+ "slug",
1134
+ "context",
1135
+ "_meta_type"
1136
+ ],
1137
+ "unique": true
1138
+ },
1139
+ {
1140
+ "name": "places_meta_type_idx",
1141
+ "columns": [
1142
+ "_meta_type"
1143
+ ]
1144
+ },
1145
+ {
1146
+ "name": "places_tenant_id_created_at_idx",
1147
+ "columns": [
1148
+ "tenant_id",
1149
+ "created_at"
1150
+ ]
1151
+ },
1152
+ {
1153
+ "name": "places_parent_id_idx",
1154
+ "columns": [
1155
+ "parent_id"
1156
+ ]
1157
+ },
1158
+ {
1159
+ "name": "places_type_id_idx",
1160
+ "columns": [
1161
+ "type_id"
1162
+ ]
1163
+ }
1164
+ ],
1165
+ "version": "f670088c"
1166
+ }
1167
+ },
1168
+ "@happyvertical/smrt-places:PlaceAsset": {
1169
+ "name": "placeasset",
1170
+ "className": "PlaceAsset",
1171
+ "qualifiedName": "@happyvertical/smrt-places:PlaceAsset",
1172
+ "collection": "placeassets",
1173
+ "filePath": "/home/runner/work/smrt/smrt/packages/places/src/models/PlaceAsset.ts",
1174
+ "packageName": "@happyvertical/smrt-places",
1175
+ "fields": {
1176
+ "tenantId": {
1177
+ "type": "text",
1178
+ "required": false,
1179
+ "_meta": {
1180
+ "sqlType": "UUID",
1181
+ "nullable": true,
1182
+ "__tenancy": {
1183
+ "isTenantIdField": true,
1184
+ "autoFilter": true,
1185
+ "required": false,
1186
+ "autoPopulate": true,
1187
+ "nullable": true,
1188
+ "mode": "optional",
1189
+ "field": "tenantId",
1190
+ "allowSuperAdminBypass": false
2315
1191
  }
2316
- ],
2317
- "returnType": "Promise<any[]>",
2318
- "isStatic": false,
2319
- "isPublic": true
1192
+ }
2320
1193
  },
2321
- "getRelated": {
2322
- "name": "getRelated",
2323
- "async": true,
2324
- "parameters": [
2325
- {
2326
- "name": "fieldName",
2327
- "type": "string",
2328
- "optional": false
2329
- },
2330
- {
2331
- "name": "opts",
2332
- "type": "LoadRelatedOptions",
2333
- "optional": true
2334
- }
2335
- ],
2336
- "returnType": "Promise<any>",
2337
- "isStatic": false,
2338
- "isPublic": true
1194
+ "placeId": {
1195
+ "type": "foreignKey",
1196
+ "required": true,
1197
+ "related": "Place",
1198
+ "_meta": {
1199
+ "required": true
1200
+ }
2339
1201
  },
2340
- "getAvailableTools": {
2341
- "name": "getAvailableTools",
2342
- "async": false,
2343
- "parameters": [],
2344
- "returnType": "AITool[]",
2345
- "isStatic": false,
2346
- "isPublic": true
1202
+ "assetId": {
1203
+ "type": "crossPackageRef",
1204
+ "required": true,
1205
+ "related": "@happyvertical/smrt-assets:Asset"
2347
1206
  },
2348
- "executeToolCall": {
2349
- "name": "executeToolCall",
2350
- "async": true,
2351
- "parameters": [
2352
- {
2353
- "name": "toolCall",
2354
- "type": "ToolCall",
2355
- "optional": false
2356
- }
2357
- ],
2358
- "returnType": "Promise<ToolCallResult>",
2359
- "isStatic": false,
2360
- "isPublic": true
1207
+ "relationship": {
1208
+ "type": "text",
1209
+ "required": true,
1210
+ "_meta": {
1211
+ "required": true
1212
+ }
2361
1213
  },
2362
- "remember": {
2363
- "name": "remember",
2364
- "async": true,
2365
- "parameters": [
2366
- {
2367
- "name": "options",
2368
- "type": "object",
2369
- "optional": false
2370
- }
2371
- ],
2372
- "returnType": "Promise<void>",
2373
- "isStatic": false,
2374
- "isPublic": true
1214
+ "sortOrder": {
1215
+ "type": "integer",
1216
+ "required": true,
1217
+ "default": 0
1218
+ }
1219
+ },
1220
+ "methods": {},
1221
+ "decoratorConfig": {
1222
+ "tableName": "place_assets",
1223
+ "conflictColumns": [
1224
+ "place_id",
1225
+ "asset_id",
1226
+ "relationship"
1227
+ ],
1228
+ "api": false,
1229
+ "mcp": false,
1230
+ "cli": false,
1231
+ "tenantScoped": {
1232
+ "mode": "optional"
1233
+ }
1234
+ },
1235
+ "extends": "SmrtObject",
1236
+ "exportName": "PlaceAsset",
1237
+ "collectionExportName": "PlaceAssetCollection",
1238
+ "validationRules": [
1239
+ {
1240
+ "field": "placeId",
1241
+ "rule": "required",
1242
+ "fieldType": "foreignKey"
2375
1243
  },
2376
- "recall": {
2377
- "name": "recall",
2378
- "async": true,
2379
- "parameters": [
2380
- {
2381
- "name": "options",
2382
- "type": "object",
2383
- "optional": false
2384
- }
2385
- ],
2386
- "returnType": "Promise",
2387
- "isStatic": false,
2388
- "isPublic": true
1244
+ {
1245
+ "field": "assetId",
1246
+ "rule": "required",
1247
+ "fieldType": "crossPackageRef"
2389
1248
  },
2390
- "recallAll": {
2391
- "name": "recallAll",
2392
- "async": true,
2393
- "parameters": [
2394
- {
2395
- "name": "options",
2396
- "type": "object",
2397
- "optional": true
2398
- }
2399
- ],
2400
- "returnType": "Promise<Map<string>>",
2401
- "isStatic": false,
2402
- "isPublic": true
1249
+ {
1250
+ "field": "relationship",
1251
+ "rule": "required",
1252
+ "fieldType": "text"
2403
1253
  },
2404
- "forget": {
2405
- "name": "forget",
2406
- "async": true,
2407
- "parameters": [
2408
- {
2409
- "name": "options",
2410
- "type": "object",
2411
- "optional": false
1254
+ {
1255
+ "field": "sortOrder",
1256
+ "rule": "required",
1257
+ "fieldType": "integer"
1258
+ }
1259
+ ],
1260
+ "schema": {
1261
+ "tableName": "place_assets",
1262
+ "ddl": "CREATE TABLE IF NOT EXISTS \"place_assets\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID,\n \"place_id\" UUID NOT NULL,\n \"asset_id\" UUID NOT NULL,\n \"relationship\" TEXT NOT NULL,\n \"sort_order\" INTEGER NOT NULL DEFAULT 0\n);",
1263
+ "columns": {
1264
+ "id": {
1265
+ "type": "UUID",
1266
+ "primaryKey": true,
1267
+ "referenceKind": "id",
1268
+ "notNull": true
1269
+ },
1270
+ "slug": {
1271
+ "type": "TEXT",
1272
+ "notNull": true
1273
+ },
1274
+ "context": {
1275
+ "type": "TEXT",
1276
+ "notNull": true,
1277
+ "default": ""
1278
+ },
1279
+ "created_at": {
1280
+ "type": "TIMESTAMP",
1281
+ "notNull": true,
1282
+ "default": "current_timestamp"
1283
+ },
1284
+ "updated_at": {
1285
+ "type": "TIMESTAMP",
1286
+ "notNull": true,
1287
+ "default": "current_timestamp"
1288
+ },
1289
+ "tenant_id": {
1290
+ "type": "UUID",
1291
+ "referenceKind": "tenantId",
1292
+ "notNull": false,
1293
+ "unique": false
1294
+ },
1295
+ "place_id": {
1296
+ "type": "UUID",
1297
+ "referenceKind": "foreignKey",
1298
+ "notNull": true,
1299
+ "unique": false,
1300
+ "foreignKey": {
1301
+ "table": "places",
1302
+ "column": "id",
1303
+ "onDelete": "CASCADE",
1304
+ "onUpdate": "CASCADE"
2412
1305
  }
2413
- ],
2414
- "returnType": "Promise<void>",
2415
- "isStatic": false,
2416
- "isPublic": true
1306
+ },
1307
+ "asset_id": {
1308
+ "type": "UUID",
1309
+ "referenceKind": "crossPackageRef",
1310
+ "notNull": true,
1311
+ "unique": false
1312
+ },
1313
+ "relationship": {
1314
+ "type": "TEXT",
1315
+ "notNull": true,
1316
+ "unique": false
1317
+ },
1318
+ "sort_order": {
1319
+ "type": "INTEGER",
1320
+ "notNull": true,
1321
+ "unique": false,
1322
+ "default": 0
1323
+ }
2417
1324
  },
2418
- "forgetScope": {
2419
- "name": "forgetScope",
2420
- "async": true,
2421
- "parameters": [
2422
- {
2423
- "name": "options",
2424
- "type": "object",
2425
- "optional": false
2426
- }
2427
- ],
2428
- "returnType": "Promise<number>",
2429
- "isStatic": false,
2430
- "isPublic": true
1325
+ "indexes": [
1326
+ {
1327
+ "name": "place_assets_place_id_asset_id_idx",
1328
+ "columns": [
1329
+ "place_id",
1330
+ "asset_id",
1331
+ "relationship"
1332
+ ],
1333
+ "unique": true
1334
+ },
1335
+ {
1336
+ "name": "place_assets_slug_context_idx",
1337
+ "columns": [
1338
+ "slug",
1339
+ "context"
1340
+ ]
1341
+ },
1342
+ {
1343
+ "name": "place_assets_tenant_id_created_at_idx",
1344
+ "columns": [
1345
+ "tenant_id",
1346
+ "created_at"
1347
+ ]
1348
+ },
1349
+ {
1350
+ "name": "place_assets_asset_id_idx",
1351
+ "columns": [
1352
+ "asset_id"
1353
+ ]
1354
+ }
1355
+ ],
1356
+ "version": "adf47666"
1357
+ }
1358
+ },
1359
+ "@happyvertical/smrt-places:PlaceType": {
1360
+ "name": "placetype",
1361
+ "className": "PlaceType",
1362
+ "qualifiedName": "@happyvertical/smrt-places:PlaceType",
1363
+ "collection": "placetypes",
1364
+ "filePath": "/home/runner/work/smrt/smrt/packages/places/src/models/PlaceType.ts",
1365
+ "packageName": "@happyvertical/smrt-places",
1366
+ "fields": {
1367
+ "created_at": {
1368
+ "type": "datetime",
1369
+ "required": false
2431
1370
  },
2432
- "generateEmbeddings": {
2433
- "name": "generateEmbeddings",
2434
- "async": true,
2435
- "parameters": [
2436
- {
2437
- "name": "options",
2438
- "type": "GenerateEmbeddingsOptions",
2439
- "optional": true
2440
- }
2441
- ],
2442
- "returnType": "Promise<void>",
2443
- "isStatic": false,
2444
- "isPublic": true
1371
+ "updated_at": {
1372
+ "type": "datetime",
1373
+ "required": false
2445
1374
  },
2446
- "getEmbedding": {
2447
- "name": "getEmbedding",
2448
- "async": true,
2449
- "parameters": [
2450
- {
2451
- "name": "fieldName",
2452
- "type": "string",
2453
- "optional": false
2454
- },
2455
- {
2456
- "name": "model",
2457
- "type": "string",
2458
- "optional": true
2459
- }
2460
- ],
2461
- "returnType": "Promise<number[] | null>",
2462
- "isStatic": false,
2463
- "isPublic": true
1375
+ "name": {
1376
+ "type": "text",
1377
+ "required": true,
1378
+ "default": "",
1379
+ "_meta": {
1380
+ "required": true
1381
+ }
2464
1382
  },
2465
- "hasStaleEmbeddings": {
2466
- "name": "hasStaleEmbeddings",
2467
- "async": true,
2468
- "parameters": [],
2469
- "returnType": "Promise<boolean>",
2470
- "isStatic": false,
2471
- "isPublic": true
1383
+ "description": {
1384
+ "type": "text",
1385
+ "required": false
2472
1386
  },
2473
- "clearEmbeddings": {
2474
- "name": "clearEmbeddings",
2475
- "async": true,
2476
- "parameters": [],
2477
- "returnType": "Promise<void>",
2478
- "isStatic": false,
2479
- "isPublic": true
1387
+ "createdAt": {
1388
+ "type": "text",
1389
+ "required": false
2480
1390
  },
1391
+ "updatedAt": {
1392
+ "type": "text",
1393
+ "required": false
1394
+ }
1395
+ },
1396
+ "methods": {
2481
1397
  "getBySlug": {
2482
1398
  "name": "getBySlug",
2483
1399
  "async": true,