@happyvertical/smrt-places 0.44.1 → 0.45.0

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