@happyvertical/smrt-ads 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-ads",
5
- "packageVersion": "0.44.0",
5
+ "packageVersion": "0.45.0",
6
6
  "objects": {
7
7
  "@happyvertical/smrt-ads:AdDeliveryTierCollection": {
8
8
  "name": "addeliverytiercollection",
@@ -1157,343 +1157,524 @@
1157
1157
  }
1158
1158
  },
1159
1159
  "methods": {
1160
- "withDatabase": {
1161
- "name": "withDatabase",
1162
- "async": true,
1163
- "parameters": [
1164
- {
1165
- "name": "db",
1166
- "type": "DatabaseInterface",
1167
- "optional": false
1168
- },
1169
- {
1170
- "name": "operation",
1171
- "type": "Function",
1172
- "optional": false
1173
- }
1174
- ],
1175
- "returnType": "Promise<T>",
1176
- "isStatic": false,
1177
- "isPublic": true
1178
- },
1179
- "getAiUsageSnapshot": {
1180
- "name": "getAiUsageSnapshot",
1160
+ "getMetadata": {
1161
+ "name": "getMetadata",
1181
1162
  "async": false,
1182
1163
  "parameters": [],
1183
- "returnType": "AiUsageSnapshot | undefined",
1164
+ "returnType": "Record<string>",
1184
1165
  "isStatic": false,
1185
1166
  "isPublic": true
1186
1167
  },
1187
- "resetAiUsage": {
1188
- "name": "resetAiUsage",
1168
+ "setMetadata": {
1169
+ "name": "setMetadata",
1189
1170
  "async": false,
1190
- "parameters": [],
1191
- "returnType": "void",
1192
- "isStatic": false,
1193
- "isPublic": true
1194
- },
1195
- "listAiUsage": {
1196
- "name": "listAiUsage",
1197
- "async": true,
1198
- "parameters": [
1199
- {
1200
- "name": "options",
1201
- "type": "AiUsageListOptions",
1202
- "optional": true
1203
- }
1204
- ],
1205
- "returnType": "Promise<SmrtAiUsageRecord[]>",
1206
- "isStatic": false,
1207
- "isPublic": true
1208
- },
1209
- "summarizeAiUsage": {
1210
- "name": "summarizeAiUsage",
1211
- "async": true,
1212
1171
  "parameters": [
1213
1172
  {
1214
- "name": "options",
1215
- "type": "AiUsageSummaryOptions",
1216
- "optional": true
1173
+ "name": "data",
1174
+ "type": "Record<string>",
1175
+ "optional": false
1217
1176
  }
1218
1177
  ],
1219
- "returnType": "Promise<Record<string, AiUsageStats>>",
1178
+ "returnType": "void",
1220
1179
  "isStatic": false,
1221
1180
  "isPublic": true
1222
1181
  },
1223
- "destroy": {
1224
- "name": "destroy",
1182
+ "isImpression": {
1183
+ "name": "isImpression",
1225
1184
  "async": false,
1226
1185
  "parameters": [],
1227
- "returnType": "void",
1186
+ "returnType": "boolean",
1228
1187
  "isStatic": false,
1229
1188
  "isPublic": true
1230
1189
  },
1231
- "markAsPersisted": {
1232
- "name": "markAsPersisted",
1190
+ "isClick": {
1191
+ "name": "isClick",
1233
1192
  "async": false,
1234
1193
  "parameters": [],
1235
- "returnType": "void",
1194
+ "returnType": "boolean",
1236
1195
  "isStatic": false,
1237
1196
  "isPublic": true
1238
1197
  },
1239
- "requireInsertOnSave": {
1240
- "name": "requireInsertOnSave",
1198
+ "isConversion": {
1199
+ "name": "isConversion",
1241
1200
  "async": false,
1242
1201
  "parameters": [],
1243
- "returnType": "void",
1202
+ "returnType": "boolean",
1244
1203
  "isStatic": false,
1245
1204
  "isPublic": true
1205
+ }
1206
+ },
1207
+ "decoratorConfig": {
1208
+ "tableStrategy": "sti",
1209
+ "api": {
1210
+ "include": [
1211
+ "create",
1212
+ "list"
1213
+ ]
1246
1214
  },
1247
- "withTransaction": {
1248
- "name": "withTransaction",
1249
- "async": true,
1250
- "parameters": [
1251
- {
1252
- "name": "operation",
1253
- "type": "Function",
1254
- "optional": false
1215
+ "mcp": {
1216
+ "include": [
1217
+ "create"
1218
+ ]
1219
+ },
1220
+ "cli": false,
1221
+ "tenantScoped": {
1222
+ "mode": "optional"
1223
+ },
1224
+ "conflictColumns": [
1225
+ "tenant_id",
1226
+ "slug",
1227
+ "context",
1228
+ "_meta_type"
1229
+ ]
1230
+ },
1231
+ "extends": "SmrtObject",
1232
+ "exportName": "AdEvent",
1233
+ "collectionExportName": "AdEventCollection",
1234
+ "schema": {
1235
+ "tableName": "ad_events",
1236
+ "ddl": "CREATE TABLE IF NOT EXISTS \"ad_events\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"_meta_type\" TEXT NOT NULL,\n \"_meta_data\" JSON,\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID,\n \"variation_id\" UUID,\n \"zone_id\" UUID,\n \"site_id\" TEXT DEFAULT '',\n \"event_type\" TEXT,\n \"timestamp\" TIMESTAMP,\n \"metadata\" TEXT DEFAULT ''\n);",
1237
+ "columns": {
1238
+ "id": {
1239
+ "type": "UUID",
1240
+ "primaryKey": true,
1241
+ "referenceKind": "id",
1242
+ "notNull": true
1243
+ },
1244
+ "slug": {
1245
+ "type": "TEXT",
1246
+ "notNull": true
1247
+ },
1248
+ "context": {
1249
+ "type": "TEXT",
1250
+ "notNull": true,
1251
+ "default": ""
1252
+ },
1253
+ "_meta_type": {
1254
+ "type": "TEXT",
1255
+ "notNull": true
1256
+ },
1257
+ "_meta_data": {
1258
+ "type": "JSON",
1259
+ "notNull": false
1260
+ },
1261
+ "created_at": {
1262
+ "type": "TIMESTAMP",
1263
+ "notNull": true,
1264
+ "default": "current_timestamp"
1265
+ },
1266
+ "updated_at": {
1267
+ "type": "TIMESTAMP",
1268
+ "notNull": true,
1269
+ "default": "current_timestamp"
1270
+ },
1271
+ "tenant_id": {
1272
+ "type": "UUID",
1273
+ "referenceKind": "tenantId",
1274
+ "notNull": false
1275
+ },
1276
+ "variation_id": {
1277
+ "type": "UUID",
1278
+ "referenceKind": "foreignKey",
1279
+ "notNull": false,
1280
+ "foreignKey": {
1281
+ "table": "ad_variations",
1282
+ "column": "id",
1283
+ "onDelete": "NO ACTION",
1284
+ "onUpdate": "CASCADE"
1255
1285
  }
1256
- ],
1257
- "returnType": "Promise<T>",
1258
- "isStatic": false,
1259
- "isPublic": true
1286
+ },
1287
+ "zone_id": {
1288
+ "type": "UUID",
1289
+ "referenceKind": "crossPackageRef",
1290
+ "notNull": false
1291
+ },
1292
+ "site_id": {
1293
+ "type": "TEXT",
1294
+ "notNull": false,
1295
+ "default": ""
1296
+ },
1297
+ "event_type": {
1298
+ "type": "TEXT",
1299
+ "notNull": false
1300
+ },
1301
+ "timestamp": {
1302
+ "type": "TIMESTAMP",
1303
+ "notNull": false
1304
+ },
1305
+ "metadata": {
1306
+ "type": "TEXT",
1307
+ "notNull": false,
1308
+ "default": ""
1309
+ }
1260
1310
  },
1261
- "initialize": {
1262
- "name": "initialize",
1263
- "async": true,
1311
+ "indexes": [
1312
+ {
1313
+ "name": "ad_events_slug_context_meta_type_idx",
1314
+ "columns": [
1315
+ "tenant_id",
1316
+ "slug",
1317
+ "context",
1318
+ "_meta_type"
1319
+ ],
1320
+ "unique": true
1321
+ },
1322
+ {
1323
+ "name": "ad_events_meta_type_idx",
1324
+ "columns": [
1325
+ "_meta_type"
1326
+ ]
1327
+ },
1328
+ {
1329
+ "name": "ad_events_tenant_id_created_at_idx",
1330
+ "columns": [
1331
+ "tenant_id",
1332
+ "created_at"
1333
+ ]
1334
+ },
1335
+ {
1336
+ "name": "ad_events_variation_id_idx",
1337
+ "columns": [
1338
+ "variation_id"
1339
+ ]
1340
+ },
1341
+ {
1342
+ "name": "ad_events_zone_id_idx",
1343
+ "columns": [
1344
+ "zone_id"
1345
+ ]
1346
+ }
1347
+ ],
1348
+ "version": "306d8050"
1349
+ }
1350
+ },
1351
+ "@happyvertical/smrt-ads:AdFormat": {
1352
+ "name": "adformat",
1353
+ "className": "AdFormat",
1354
+ "qualifiedName": "@happyvertical/smrt-ads:AdFormat",
1355
+ "collection": "adformats",
1356
+ "filePath": "/home/runner/work/smrt/smrt/packages/ads/src/models/AdFormat.ts",
1357
+ "packageName": "@happyvertical/smrt-ads",
1358
+ "fields": {
1359
+ "name": {
1360
+ "type": "text",
1361
+ "required": false,
1362
+ "default": ""
1363
+ },
1364
+ "width": {
1365
+ "type": "integer",
1366
+ "required": false,
1367
+ "default": 0
1368
+ },
1369
+ "height": {
1370
+ "type": "integer",
1371
+ "required": false,
1372
+ "default": 0
1373
+ },
1374
+ "formatType": {
1375
+ "type": "text",
1376
+ "required": false
1377
+ },
1378
+ "description": {
1379
+ "type": "text",
1380
+ "required": false,
1381
+ "default": ""
1382
+ }
1383
+ },
1384
+ "methods": {
1385
+ "getDimensions": {
1386
+ "name": "getDimensions",
1387
+ "async": false,
1264
1388
  "parameters": [],
1265
- "returnType": "Promise",
1389
+ "returnType": "string",
1266
1390
  "isStatic": false,
1267
1391
  "isPublic": true
1268
1392
  },
1269
- "loadDataFromDb": {
1270
- "name": "loadDataFromDb",
1271
- "async": true,
1393
+ "matchesDimensions": {
1394
+ "name": "matchesDimensions",
1395
+ "async": false,
1272
1396
  "parameters": [
1273
1397
  {
1274
- "name": "data",
1275
- "type": "Record<string>",
1398
+ "name": "width",
1399
+ "type": "number",
1400
+ "optional": false
1401
+ },
1402
+ {
1403
+ "name": "height",
1404
+ "type": "number",
1276
1405
  "optional": false
1277
1406
  }
1278
1407
  ],
1279
- "returnType": "any",
1280
- "isStatic": false,
1281
- "isPublic": true
1282
- },
1283
- "getFields": {
1284
- "name": "getFields",
1285
- "async": true,
1286
- "parameters": [],
1287
- "returnType": "Promise<any>",
1408
+ "returnType": "boolean",
1288
1409
  "isStatic": false,
1289
1410
  "isPublic": true
1411
+ }
1412
+ },
1413
+ "decoratorConfig": {
1414
+ "api": {
1415
+ "include": [
1416
+ "list",
1417
+ "get",
1418
+ "create",
1419
+ "update"
1420
+ ]
1290
1421
  },
1291
- "toJSON": {
1292
- "name": "toJSON",
1293
- "async": false,
1294
- "parameters": [],
1295
- "returnType": "any",
1296
- "isStatic": false,
1297
- "isPublic": true
1422
+ "mcp": {
1423
+ "include": [
1424
+ "list",
1425
+ "get"
1426
+ ]
1298
1427
  },
1299
- "toPlainObject": {
1300
- "name": "toPlainObject",
1301
- "async": false,
1302
- "parameters": [],
1303
- "returnType": "Record<string>",
1304
- "isStatic": false,
1305
- "isPublic": true
1428
+ "cli": true
1429
+ },
1430
+ "extends": "SmrtObject",
1431
+ "exportName": "AdFormat",
1432
+ "collectionExportName": "AdFormatCollection",
1433
+ "schema": {
1434
+ "tableName": "ad_formats",
1435
+ "ddl": "CREATE TABLE IF NOT EXISTS \"ad_formats\" (\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 \"name\" TEXT DEFAULT '',\n \"width\" INTEGER DEFAULT 0,\n \"height\" INTEGER DEFAULT 0,\n \"format_type\" TEXT,\n \"description\" TEXT DEFAULT ''\n);",
1436
+ "columns": {
1437
+ "id": {
1438
+ "type": "UUID",
1439
+ "primaryKey": true,
1440
+ "referenceKind": "id",
1441
+ "notNull": true
1442
+ },
1443
+ "slug": {
1444
+ "type": "TEXT",
1445
+ "notNull": true
1446
+ },
1447
+ "context": {
1448
+ "type": "TEXT",
1449
+ "notNull": true,
1450
+ "default": ""
1451
+ },
1452
+ "created_at": {
1453
+ "type": "TIMESTAMP",
1454
+ "notNull": true,
1455
+ "default": "current_timestamp"
1456
+ },
1457
+ "updated_at": {
1458
+ "type": "TIMESTAMP",
1459
+ "notNull": true,
1460
+ "default": "current_timestamp"
1461
+ },
1462
+ "name": {
1463
+ "type": "TEXT",
1464
+ "notNull": false,
1465
+ "unique": false,
1466
+ "default": ""
1467
+ },
1468
+ "width": {
1469
+ "type": "INTEGER",
1470
+ "notNull": false,
1471
+ "unique": false,
1472
+ "default": 0
1473
+ },
1474
+ "height": {
1475
+ "type": "INTEGER",
1476
+ "notNull": false,
1477
+ "unique": false,
1478
+ "default": 0
1479
+ },
1480
+ "format_type": {
1481
+ "type": "TEXT",
1482
+ "notNull": false,
1483
+ "unique": false
1484
+ },
1485
+ "description": {
1486
+ "type": "TEXT",
1487
+ "notNull": false,
1488
+ "unique": false,
1489
+ "default": ""
1490
+ }
1306
1491
  },
1307
- "toPublicJSON": {
1308
- "name": "toPublicJSON",
1309
- "async": false,
1310
- "parameters": [
1311
- {
1312
- "name": "options",
1313
- "type": "PublicJsonOptions",
1314
- "optional": true
1492
+ "indexes": [
1493
+ {
1494
+ "name": "ad_formats_slug_context_idx",
1495
+ "columns": [
1496
+ "slug",
1497
+ "context"
1498
+ ],
1499
+ "unique": true
1500
+ },
1501
+ {
1502
+ "name": "ad_formats_created_at_idx",
1503
+ "columns": [
1504
+ "created_at"
1505
+ ]
1506
+ }
1507
+ ],
1508
+ "version": "df40cc03"
1509
+ }
1510
+ },
1511
+ "@happyvertical/smrt-ads:AdGroup": {
1512
+ "name": "adgroup",
1513
+ "className": "AdGroup",
1514
+ "qualifiedName": "@happyvertical/smrt-ads:AdGroup",
1515
+ "collection": "adgroups",
1516
+ "filePath": "/home/runner/work/smrt/smrt/packages/ads/src/models/AdGroup.ts",
1517
+ "packageName": "@happyvertical/smrt-ads",
1518
+ "fields": {
1519
+ "created_at": {
1520
+ "type": "datetime",
1521
+ "required": false
1522
+ },
1523
+ "updated_at": {
1524
+ "type": "datetime",
1525
+ "required": false
1526
+ },
1527
+ "tenantId": {
1528
+ "type": "text",
1529
+ "required": false,
1530
+ "_meta": {
1531
+ "sqlType": "UUID",
1532
+ "nullable": true,
1533
+ "__tenancy": {
1534
+ "isTenantIdField": true,
1535
+ "autoFilter": true,
1536
+ "required": false,
1537
+ "autoPopulate": true,
1538
+ "nullable": true,
1539
+ "mode": "optional",
1540
+ "field": "tenantId",
1541
+ "allowSuperAdminBypass": false
1315
1542
  }
1316
- ],
1317
- "returnType": "Record<string>",
1318
- "isStatic": false,
1319
- "isPublic": true
1543
+ }
1320
1544
  },
1321
- "getId": {
1322
- "name": "getId",
1323
- "async": true,
1324
- "parameters": [],
1325
- "returnType": "any",
1326
- "isStatic": false,
1327
- "isPublic": true
1545
+ "contractId": {
1546
+ "type": "crossPackageRef",
1547
+ "required": false,
1548
+ "related": "@happyvertical/smrt-commerce:Contract"
1328
1549
  },
1329
- "getSlug": {
1330
- "name": "getSlug",
1331
- "async": true,
1332
- "parameters": [],
1333
- "returnType": "any",
1334
- "isStatic": false,
1335
- "isPublic": true
1550
+ "tierId": {
1551
+ "type": "foreignKey",
1552
+ "required": false,
1553
+ "related": "AdDeliveryTier"
1336
1554
  },
1337
- "getSavedId": {
1338
- "name": "getSavedId",
1339
- "async": true,
1340
- "parameters": [],
1341
- "returnType": "any",
1342
- "isStatic": false,
1343
- "isPublic": true
1555
+ "name": {
1556
+ "type": "text",
1557
+ "required": false,
1558
+ "default": ""
1344
1559
  },
1345
- "isSaved": {
1346
- "name": "isSaved",
1347
- "async": true,
1560
+ "verticalSlug": {
1561
+ "type": "text",
1562
+ "required": false,
1563
+ "default": ""
1564
+ },
1565
+ "targeting": {
1566
+ "type": "text",
1567
+ "required": false,
1568
+ "default": ""
1569
+ },
1570
+ "zoneIds": {
1571
+ "type": "text",
1572
+ "required": false,
1573
+ "default": ""
1574
+ },
1575
+ "startDate": {
1576
+ "type": "datetime",
1577
+ "required": false
1578
+ },
1579
+ "endDate": {
1580
+ "type": "datetime",
1581
+ "required": false
1582
+ },
1583
+ "dailyBudget": {
1584
+ "type": "decimal",
1585
+ "required": false,
1586
+ "default": 0
1587
+ },
1588
+ "totalBudget": {
1589
+ "type": "decimal",
1590
+ "required": false,
1591
+ "default": 0
1592
+ },
1593
+ "status": {
1594
+ "type": "text",
1595
+ "required": false
1596
+ }
1597
+ },
1598
+ "methods": {
1599
+ "getZoneIds": {
1600
+ "name": "getZoneIds",
1601
+ "async": false,
1348
1602
  "parameters": [],
1349
- "returnType": "any",
1603
+ "returnType": "string[]",
1350
1604
  "isStatic": false,
1351
1605
  "isPublic": true
1352
1606
  },
1353
- "save": {
1354
- "name": "save",
1355
- "async": true,
1607
+ "setZoneIds": {
1608
+ "name": "setZoneIds",
1609
+ "async": false,
1356
1610
  "parameters": [
1357
1611
  {
1358
- "name": "options",
1359
- "type": "SmrtSaveOptions",
1360
- "optional": true
1612
+ "name": "ids",
1613
+ "type": "string[]",
1614
+ "optional": false
1361
1615
  }
1362
1616
  ],
1363
- "returnType": "any",
1617
+ "returnType": "void",
1364
1618
  "isStatic": false,
1365
1619
  "isPublic": true
1366
1620
  },
1367
- "claimRevision": {
1368
- "name": "claimRevision",
1369
- "async": true,
1621
+ "addZoneId": {
1622
+ "name": "addZoneId",
1623
+ "async": false,
1370
1624
  "parameters": [
1371
1625
  {
1372
- "name": "expectedUpdatedAt",
1373
- "type": "Date | string",
1626
+ "name": "zoneId",
1627
+ "type": "string",
1374
1628
  "optional": false
1375
1629
  }
1376
1630
  ],
1377
- "returnType": "Promise",
1631
+ "returnType": "void",
1378
1632
  "isStatic": false,
1379
1633
  "isPublic": true
1380
1634
  },
1381
- "classifyConstraintError": {
1382
- "name": "classifyConstraintError",
1635
+ "removeZoneId": {
1636
+ "name": "removeZoneId",
1383
1637
  "async": false,
1384
1638
  "parameters": [
1385
1639
  {
1386
- "name": "message",
1640
+ "name": "zoneId",
1387
1641
  "type": "string",
1388
1642
  "optional": false
1389
1643
  }
1390
1644
  ],
1391
- "returnType": "'unique' | 'not_null' | null",
1392
- "isStatic": true,
1393
- "isPublic": true
1394
- },
1395
- "loadFromId": {
1396
- "name": "loadFromId",
1397
- "async": true,
1398
- "parameters": [],
1399
- "returnType": "any",
1400
- "isStatic": false,
1401
- "isPublic": true
1402
- },
1403
- "loadFromSlug": {
1404
- "name": "loadFromSlug",
1405
- "async": true,
1406
- "parameters": [],
1407
- "returnType": "any",
1645
+ "returnType": "void",
1408
1646
  "isStatic": false,
1409
1647
  "isPublic": true
1410
1648
  },
1411
- "is": {
1412
- "name": "is",
1413
- "async": true,
1649
+ "hasZoneId": {
1650
+ "name": "hasZoneId",
1651
+ "async": false,
1414
1652
  "parameters": [
1415
1653
  {
1416
- "name": "criteria",
1654
+ "name": "zoneId",
1417
1655
  "type": "string",
1418
1656
  "optional": false
1419
- },
1420
- {
1421
- "name": "options",
1422
- "type": "AiOperationOptions",
1423
- "optional": true
1424
1657
  }
1425
1658
  ],
1426
- "returnType": "any",
1659
+ "returnType": "boolean",
1427
1660
  "isStatic": false,
1428
1661
  "isPublic": true
1429
1662
  },
1430
- "do": {
1431
- "name": "do",
1432
- "async": true,
1433
- "parameters": [
1434
- {
1435
- "name": "instructions",
1436
- "type": "string",
1437
- "optional": false
1438
- },
1439
- {
1440
- "name": "options",
1441
- "type": "AiOperationOptions",
1442
- "optional": true
1443
- }
1444
- ],
1445
- "returnType": "any",
1446
- "isStatic": false,
1447
- "isPublic": true
1448
- },
1449
- "describe": {
1450
- "name": "describe",
1451
- "async": true,
1452
- "parameters": [
1453
- {
1454
- "name": "options",
1455
- "type": "AiOperationOptions",
1456
- "optional": true
1457
- }
1458
- ],
1459
- "returnType": "any",
1460
- "isStatic": false,
1461
- "isPublic": true
1462
- },
1463
- "delete": {
1464
- "name": "delete",
1465
- "async": true,
1466
- "parameters": [],
1467
- "returnType": "Promise<void>",
1468
- "isStatic": false,
1469
- "isPublic": true
1470
- },
1471
- "isRelatedLoaded": {
1472
- "name": "isRelatedLoaded",
1663
+ "getTargeting": {
1664
+ "name": "getTargeting",
1473
1665
  "async": false,
1474
- "parameters": [
1475
- {
1476
- "name": "fieldName",
1477
- "type": "string",
1478
- "optional": false
1479
- }
1480
- ],
1481
- "returnType": "boolean",
1666
+ "parameters": [],
1667
+ "returnType": "Record<string>",
1482
1668
  "isStatic": false,
1483
1669
  "isPublic": true
1484
1670
  },
1485
- "_setLoadedRelationship": {
1486
- "name": "_setLoadedRelationship",
1671
+ "setTargeting": {
1672
+ "name": "setTargeting",
1487
1673
  "async": false,
1488
1674
  "parameters": [
1489
1675
  {
1490
- "name": "fieldName",
1491
- "type": "string",
1492
- "optional": false
1493
- },
1494
- {
1495
- "name": "value",
1496
- "type": "any",
1676
+ "name": "rules",
1677
+ "type": "Record<string>",
1497
1678
  "optional": false
1498
1679
  }
1499
1680
  ],
@@ -1501,244 +1682,48 @@
1501
1682
  "isStatic": false,
1502
1683
  "isPublic": true
1503
1684
  },
1504
- "loadRelated": {
1505
- "name": "loadRelated",
1506
- "async": true,
1507
- "parameters": [
1508
- {
1509
- "name": "fieldName",
1510
- "type": "string",
1511
- "optional": false
1512
- },
1513
- {
1514
- "name": "opts",
1515
- "type": "LoadRelatedOptions",
1516
- "optional": true
1517
- }
1518
- ],
1519
- "returnType": "Promise<any>",
1520
- "isStatic": false,
1521
- "isPublic": true
1522
- },
1523
- "loadRelatedMany": {
1524
- "name": "loadRelatedMany",
1525
- "async": true,
1526
- "parameters": [
1527
- {
1528
- "name": "fieldName",
1529
- "type": "string",
1530
- "optional": false
1531
- },
1532
- {
1533
- "name": "opts",
1534
- "type": "LoadRelatedOptions",
1535
- "optional": true
1536
- }
1537
- ],
1538
- "returnType": "Promise<any[]>",
1539
- "isStatic": false,
1540
- "isPublic": true
1541
- },
1542
- "getRelated": {
1543
- "name": "getRelated",
1544
- "async": true,
1545
- "parameters": [
1546
- {
1547
- "name": "fieldName",
1548
- "type": "string",
1549
- "optional": false
1550
- },
1551
- {
1552
- "name": "opts",
1553
- "type": "LoadRelatedOptions",
1554
- "optional": true
1555
- }
1556
- ],
1557
- "returnType": "Promise<any>",
1558
- "isStatic": false,
1559
- "isPublic": true
1560
- },
1561
- "getAvailableTools": {
1562
- "name": "getAvailableTools",
1685
+ "isActive": {
1686
+ "name": "isActive",
1563
1687
  "async": false,
1564
1688
  "parameters": [],
1565
- "returnType": "AITool[]",
1566
- "isStatic": false,
1567
- "isPublic": true
1568
- },
1569
- "executeToolCall": {
1570
- "name": "executeToolCall",
1571
- "async": true,
1572
- "parameters": [
1573
- {
1574
- "name": "toolCall",
1575
- "type": "ToolCall",
1576
- "optional": false
1577
- }
1578
- ],
1579
- "returnType": "Promise<ToolCallResult>",
1580
- "isStatic": false,
1581
- "isPublic": true
1582
- },
1583
- "remember": {
1584
- "name": "remember",
1585
- "async": true,
1586
- "parameters": [
1587
- {
1588
- "name": "options",
1589
- "type": "object",
1590
- "optional": false
1591
- }
1592
- ],
1593
- "returnType": "Promise<void>",
1594
- "isStatic": false,
1595
- "isPublic": true
1596
- },
1597
- "recall": {
1598
- "name": "recall",
1599
- "async": true,
1600
- "parameters": [
1601
- {
1602
- "name": "options",
1603
- "type": "object",
1604
- "optional": false
1605
- }
1606
- ],
1607
- "returnType": "Promise",
1608
- "isStatic": false,
1609
- "isPublic": true
1610
- },
1611
- "recallAll": {
1612
- "name": "recallAll",
1613
- "async": true,
1614
- "parameters": [
1615
- {
1616
- "name": "options",
1617
- "type": "object",
1618
- "optional": true
1619
- }
1620
- ],
1621
- "returnType": "Promise<Map<string>>",
1622
- "isStatic": false,
1623
- "isPublic": true
1624
- },
1625
- "forget": {
1626
- "name": "forget",
1627
- "async": true,
1628
- "parameters": [
1629
- {
1630
- "name": "options",
1631
- "type": "object",
1632
- "optional": false
1633
- }
1634
- ],
1635
- "returnType": "Promise<void>",
1636
- "isStatic": false,
1637
- "isPublic": true
1638
- },
1639
- "forgetScope": {
1640
- "name": "forgetScope",
1641
- "async": true,
1642
- "parameters": [
1643
- {
1644
- "name": "options",
1645
- "type": "object",
1646
- "optional": false
1647
- }
1648
- ],
1649
- "returnType": "Promise<number>",
1650
- "isStatic": false,
1651
- "isPublic": true
1652
- },
1653
- "generateEmbeddings": {
1654
- "name": "generateEmbeddings",
1655
- "async": true,
1656
- "parameters": [
1657
- {
1658
- "name": "options",
1659
- "type": "GenerateEmbeddingsOptions",
1660
- "optional": true
1661
- }
1662
- ],
1663
- "returnType": "Promise<void>",
1664
- "isStatic": false,
1665
- "isPublic": true
1666
- },
1667
- "getEmbedding": {
1668
- "name": "getEmbedding",
1669
- "async": true,
1670
- "parameters": [
1671
- {
1672
- "name": "fieldName",
1673
- "type": "string",
1674
- "optional": false
1675
- },
1676
- {
1677
- "name": "model",
1678
- "type": "string",
1679
- "optional": true
1680
- }
1681
- ],
1682
- "returnType": "Promise<number[] | null>",
1683
- "isStatic": false,
1684
- "isPublic": true
1685
- },
1686
- "hasStaleEmbeddings": {
1687
- "name": "hasStaleEmbeddings",
1688
- "async": true,
1689
- "parameters": [],
1690
- "returnType": "Promise<boolean>",
1691
- "isStatic": false,
1692
- "isPublic": true
1693
- },
1694
- "clearEmbeddings": {
1695
- "name": "clearEmbeddings",
1696
- "async": true,
1697
- "parameters": [],
1698
- "returnType": "Promise<void>",
1689
+ "returnType": "boolean",
1699
1690
  "isStatic": false,
1700
1691
  "isPublic": true
1701
1692
  },
1702
- "getMetadata": {
1703
- "name": "getMetadata",
1693
+ "isDraft": {
1694
+ "name": "isDraft",
1704
1695
  "async": false,
1705
1696
  "parameters": [],
1706
- "returnType": "Record<string>",
1697
+ "returnType": "boolean",
1707
1698
  "isStatic": false,
1708
1699
  "isPublic": true
1709
1700
  },
1710
- "setMetadata": {
1711
- "name": "setMetadata",
1701
+ "isPaused": {
1702
+ "name": "isPaused",
1712
1703
  "async": false,
1713
- "parameters": [
1714
- {
1715
- "name": "data",
1716
- "type": "Record<string>",
1717
- "optional": false
1718
- }
1719
- ],
1720
- "returnType": "void",
1704
+ "parameters": [],
1705
+ "returnType": "boolean",
1721
1706
  "isStatic": false,
1722
1707
  "isPublic": true
1723
1708
  },
1724
- "isImpression": {
1725
- "name": "isImpression",
1709
+ "isCompleted": {
1710
+ "name": "isCompleted",
1726
1711
  "async": false,
1727
1712
  "parameters": [],
1728
1713
  "returnType": "boolean",
1729
1714
  "isStatic": false,
1730
1715
  "isPublic": true
1731
1716
  },
1732
- "isClick": {
1733
- "name": "isClick",
1717
+ "hasEnded": {
1718
+ "name": "hasEnded",
1734
1719
  "async": false,
1735
1720
  "parameters": [],
1736
1721
  "returnType": "boolean",
1737
1722
  "isStatic": false,
1738
1723
  "isPublic": true
1739
1724
  },
1740
- "isConversion": {
1741
- "name": "isConversion",
1725
+ "hasStarted": {
1726
+ "name": "hasStarted",
1742
1727
  "async": false,
1743
1728
  "parameters": [],
1744
1729
  "returnType": "boolean",
@@ -1750,16 +1735,20 @@
1750
1735
  "tableStrategy": "sti",
1751
1736
  "api": {
1752
1737
  "include": [
1738
+ "list",
1739
+ "get",
1753
1740
  "create",
1754
- "list"
1741
+ "update"
1755
1742
  ]
1756
1743
  },
1757
1744
  "mcp": {
1758
1745
  "include": [
1746
+ "list",
1747
+ "get",
1759
1748
  "create"
1760
1749
  ]
1761
1750
  },
1762
- "cli": false,
1751
+ "cli": true,
1763
1752
  "tenantScoped": {
1764
1753
  "mode": "optional"
1765
1754
  },
@@ -1771,11 +1760,11 @@
1771
1760
  ]
1772
1761
  },
1773
1762
  "extends": "SmrtObject",
1774
- "exportName": "AdEvent",
1775
- "collectionExportName": "AdEventCollection",
1763
+ "exportName": "AdGroup",
1764
+ "collectionExportName": "AdGroupCollection",
1776
1765
  "schema": {
1777
- "tableName": "ad_events",
1778
- "ddl": "CREATE TABLE IF NOT EXISTS \"ad_events\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"_meta_type\" TEXT NOT NULL,\n \"_meta_data\" JSON,\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID,\n \"variation_id\" UUID,\n \"zone_id\" UUID,\n \"site_id\" TEXT DEFAULT '',\n \"event_type\" TEXT,\n \"timestamp\" TIMESTAMP,\n \"metadata\" TEXT DEFAULT ''\n);",
1766
+ "tableName": "ad_groups",
1767
+ "ddl": "CREATE TABLE IF NOT EXISTS \"ad_groups\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"_meta_type\" TEXT NOT NULL,\n \"_meta_data\" JSON,\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID,\n \"contract_id\" UUID,\n \"tier_id\" UUID,\n \"name\" TEXT DEFAULT '',\n \"vertical_slug\" TEXT DEFAULT '',\n \"targeting\" TEXT DEFAULT '',\n \"zone_ids\" TEXT DEFAULT '',\n \"start_date\" TIMESTAMP,\n \"end_date\" TIMESTAMP,\n \"daily_budget\" REAL DEFAULT 0,\n \"total_budget\" REAL DEFAULT 0,\n \"status\" TEXT\n);",
1779
1768
  "columns": {
1780
1769
  "id": {
1781
1770
  "type": "UUID",
@@ -1815,44 +1804,68 @@
1815
1804
  "referenceKind": "tenantId",
1816
1805
  "notNull": false
1817
1806
  },
1818
- "variation_id": {
1807
+ "contract_id": {
1808
+ "type": "UUID",
1809
+ "referenceKind": "crossPackageRef",
1810
+ "notNull": false
1811
+ },
1812
+ "tier_id": {
1819
1813
  "type": "UUID",
1820
1814
  "referenceKind": "foreignKey",
1821
1815
  "notNull": false,
1822
1816
  "foreignKey": {
1823
- "table": "ad_variations",
1817
+ "table": "ad_delivery_tiers",
1824
1818
  "column": "id",
1825
1819
  "onDelete": "NO ACTION",
1826
1820
  "onUpdate": "CASCADE"
1827
1821
  }
1828
1822
  },
1829
- "zone_id": {
1830
- "type": "UUID",
1831
- "referenceKind": "crossPackageRef",
1832
- "notNull": false
1823
+ "name": {
1824
+ "type": "TEXT",
1825
+ "notNull": false,
1826
+ "default": ""
1833
1827
  },
1834
- "site_id": {
1828
+ "vertical_slug": {
1835
1829
  "type": "TEXT",
1836
1830
  "notNull": false,
1837
1831
  "default": ""
1838
1832
  },
1839
- "event_type": {
1833
+ "targeting": {
1834
+ "type": "TEXT",
1835
+ "notNull": false,
1836
+ "default": ""
1837
+ },
1838
+ "zone_ids": {
1840
1839
  "type": "TEXT",
1840
+ "notNull": false,
1841
+ "default": ""
1842
+ },
1843
+ "start_date": {
1844
+ "type": "TIMESTAMP",
1841
1845
  "notNull": false
1842
1846
  },
1843
- "timestamp": {
1847
+ "end_date": {
1844
1848
  "type": "TIMESTAMP",
1845
1849
  "notNull": false
1846
1850
  },
1847
- "metadata": {
1848
- "type": "TEXT",
1851
+ "daily_budget": {
1852
+ "type": "REAL",
1849
1853
  "notNull": false,
1850
- "default": ""
1854
+ "default": 0
1855
+ },
1856
+ "total_budget": {
1857
+ "type": "REAL",
1858
+ "notNull": false,
1859
+ "default": 0
1860
+ },
1861
+ "status": {
1862
+ "type": "TEXT",
1863
+ "notNull": false
1851
1864
  }
1852
1865
  },
1853
1866
  "indexes": [
1854
1867
  {
1855
- "name": "ad_events_slug_context_meta_type_idx",
1868
+ "name": "ad_groups_slug_context_meta_type_idx",
1856
1869
  "columns": [
1857
1870
  "tenant_id",
1858
1871
  "slug",
@@ -1862,200 +1875,40 @@
1862
1875
  "unique": true
1863
1876
  },
1864
1877
  {
1865
- "name": "ad_events_meta_type_idx",
1878
+ "name": "ad_groups_meta_type_idx",
1866
1879
  "columns": [
1867
1880
  "_meta_type"
1868
1881
  ]
1869
1882
  },
1870
1883
  {
1871
- "name": "ad_events_tenant_id_created_at_idx",
1884
+ "name": "ad_groups_tenant_id_created_at_idx",
1872
1885
  "columns": [
1873
1886
  "tenant_id",
1874
1887
  "created_at"
1875
1888
  ]
1876
1889
  },
1877
1890
  {
1878
- "name": "ad_events_variation_id_idx",
1879
- "columns": [
1880
- "variation_id"
1881
- ]
1882
- },
1883
- {
1884
- "name": "ad_events_zone_id_idx",
1891
+ "name": "ad_groups_contract_id_idx",
1885
1892
  "columns": [
1886
- "zone_id"
1893
+ "contract_id"
1887
1894
  ]
1888
- }
1889
- ],
1890
- "version": "306d8050"
1891
- }
1892
- },
1893
- "@happyvertical/smrt-ads:AdFormat": {
1894
- "name": "adformat",
1895
- "className": "AdFormat",
1896
- "qualifiedName": "@happyvertical/smrt-ads:AdFormat",
1897
- "collection": "adformats",
1898
- "filePath": "/home/runner/work/smrt/smrt/packages/ads/src/models/AdFormat.ts",
1899
- "packageName": "@happyvertical/smrt-ads",
1900
- "fields": {
1901
- "name": {
1902
- "type": "text",
1903
- "required": false,
1904
- "default": ""
1905
- },
1906
- "width": {
1907
- "type": "integer",
1908
- "required": false,
1909
- "default": 0
1910
- },
1911
- "height": {
1912
- "type": "integer",
1913
- "required": false,
1914
- "default": 0
1915
- },
1916
- "formatType": {
1917
- "type": "text",
1918
- "required": false
1919
- },
1920
- "description": {
1921
- "type": "text",
1922
- "required": false,
1923
- "default": ""
1924
- }
1925
- },
1926
- "methods": {
1927
- "getDimensions": {
1928
- "name": "getDimensions",
1929
- "async": false,
1930
- "parameters": [],
1931
- "returnType": "string",
1932
- "isStatic": false,
1933
- "isPublic": true
1934
- },
1935
- "matchesDimensions": {
1936
- "name": "matchesDimensions",
1937
- "async": false,
1938
- "parameters": [
1939
- {
1940
- "name": "width",
1941
- "type": "number",
1942
- "optional": false
1943
- },
1944
- {
1945
- "name": "height",
1946
- "type": "number",
1947
- "optional": false
1948
- }
1949
- ],
1950
- "returnType": "boolean",
1951
- "isStatic": false,
1952
- "isPublic": true
1953
- }
1954
- },
1955
- "decoratorConfig": {
1956
- "api": {
1957
- "include": [
1958
- "list",
1959
- "get",
1960
- "create",
1961
- "update"
1962
- ]
1963
- },
1964
- "mcp": {
1965
- "include": [
1966
- "list",
1967
- "get"
1968
- ]
1969
- },
1970
- "cli": true
1971
- },
1972
- "extends": "SmrtObject",
1973
- "exportName": "AdFormat",
1974
- "collectionExportName": "AdFormatCollection",
1975
- "schema": {
1976
- "tableName": "ad_formats",
1977
- "ddl": "CREATE TABLE IF NOT EXISTS \"ad_formats\" (\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 \"name\" TEXT DEFAULT '',\n \"width\" INTEGER DEFAULT 0,\n \"height\" INTEGER DEFAULT 0,\n \"format_type\" TEXT,\n \"description\" TEXT DEFAULT ''\n);",
1978
- "columns": {
1979
- "id": {
1980
- "type": "UUID",
1981
- "primaryKey": true,
1982
- "referenceKind": "id",
1983
- "notNull": true
1984
- },
1985
- "slug": {
1986
- "type": "TEXT",
1987
- "notNull": true
1988
- },
1989
- "context": {
1990
- "type": "TEXT",
1991
- "notNull": true,
1992
- "default": ""
1993
- },
1994
- "created_at": {
1995
- "type": "TIMESTAMP",
1996
- "notNull": true,
1997
- "default": "current_timestamp"
1998
- },
1999
- "updated_at": {
2000
- "type": "TIMESTAMP",
2001
- "notNull": true,
2002
- "default": "current_timestamp"
2003
- },
2004
- "name": {
2005
- "type": "TEXT",
2006
- "notNull": false,
2007
- "unique": false,
2008
- "default": ""
2009
- },
2010
- "width": {
2011
- "type": "INTEGER",
2012
- "notNull": false,
2013
- "unique": false,
2014
- "default": 0
2015
- },
2016
- "height": {
2017
- "type": "INTEGER",
2018
- "notNull": false,
2019
- "unique": false,
2020
- "default": 0
2021
- },
2022
- "format_type": {
2023
- "type": "TEXT",
2024
- "notNull": false,
2025
- "unique": false
2026
- },
2027
- "description": {
2028
- "type": "TEXT",
2029
- "notNull": false,
2030
- "unique": false,
2031
- "default": ""
2032
- }
2033
- },
2034
- "indexes": [
2035
- {
2036
- "name": "ad_formats_slug_context_idx",
2037
- "columns": [
2038
- "slug",
2039
- "context"
2040
- ],
2041
- "unique": true
2042
1895
  },
2043
1896
  {
2044
- "name": "ad_formats_created_at_idx",
1897
+ "name": "ad_groups_tier_id_idx",
2045
1898
  "columns": [
2046
- "created_at"
1899
+ "tier_id"
2047
1900
  ]
2048
1901
  }
2049
1902
  ],
2050
- "version": "df40cc03"
1903
+ "version": "3f8a3fea"
2051
1904
  }
2052
1905
  },
2053
- "@happyvertical/smrt-ads:AdGroup": {
2054
- "name": "adgroup",
2055
- "className": "AdGroup",
2056
- "qualifiedName": "@happyvertical/smrt-ads:AdGroup",
2057
- "collection": "adgroups",
2058
- "filePath": "/home/runner/work/smrt/smrt/packages/ads/src/models/AdGroup.ts",
1906
+ "@happyvertical/smrt-ads:AdVariation": {
1907
+ "name": "advariation",
1908
+ "className": "AdVariation",
1909
+ "qualifiedName": "@happyvertical/smrt-ads:AdVariation",
1910
+ "collection": "advariations",
1911
+ "filePath": "/home/runner/work/smrt/smrt/packages/ads/src/models/AdVariation.ts",
2059
1912
  "packageName": "@happyvertical/smrt-ads",
2060
1913
  "fields": {
2061
1914
  "created_at": {
@@ -2084,1536 +1937,57 @@
2084
1937
  }
2085
1938
  }
2086
1939
  },
2087
- "contractId": {
2088
- "type": "crossPackageRef",
1940
+ "groupId": {
1941
+ "type": "foreignKey",
2089
1942
  "required": false,
2090
- "related": "@happyvertical/smrt-commerce:Contract"
1943
+ "related": "AdGroup"
2091
1944
  },
2092
- "tierId": {
1945
+ "formatId": {
2093
1946
  "type": "foreignKey",
2094
1947
  "required": false,
2095
- "related": "AdDeliveryTier"
1948
+ "related": "AdFormat"
2096
1949
  },
2097
- "name": {
2098
- "type": "text",
1950
+ "assetId": {
1951
+ "type": "crossPackageRef",
2099
1952
  "required": false,
2100
- "default": ""
1953
+ "related": "@happyvertical/smrt-assets:Asset"
2101
1954
  },
2102
- "verticalSlug": {
1955
+ "name": {
2103
1956
  "type": "text",
2104
1957
  "required": false,
2105
1958
  "default": ""
2106
1959
  },
2107
- "targeting": {
1960
+ "clickUrl": {
2108
1961
  "type": "text",
2109
1962
  "required": false,
2110
1963
  "default": ""
2111
1964
  },
2112
- "zoneIds": {
1965
+ "altText": {
2113
1966
  "type": "text",
2114
1967
  "required": false,
2115
1968
  "default": ""
2116
1969
  },
2117
- "startDate": {
2118
- "type": "datetime",
2119
- "required": false
1970
+ "weight": {
1971
+ "type": "integer",
1972
+ "required": false,
1973
+ "default": 1
2120
1974
  },
2121
- "endDate": {
2122
- "type": "datetime",
1975
+ "status": {
1976
+ "type": "text",
2123
1977
  "required": false
2124
1978
  },
2125
- "dailyBudget": {
2126
- "type": "decimal",
1979
+ "impressions": {
1980
+ "type": "integer",
2127
1981
  "required": false,
2128
1982
  "default": 0
2129
1983
  },
2130
- "totalBudget": {
2131
- "type": "decimal",
1984
+ "clicks": {
1985
+ "type": "integer",
2132
1986
  "required": false,
2133
1987
  "default": 0
2134
- },
2135
- "status": {
2136
- "type": "text",
2137
- "required": false
2138
1988
  }
2139
1989
  },
2140
1990
  "methods": {
2141
- "withDatabase": {
2142
- "name": "withDatabase",
2143
- "async": true,
2144
- "parameters": [
2145
- {
2146
- "name": "db",
2147
- "type": "DatabaseInterface",
2148
- "optional": false
2149
- },
2150
- {
2151
- "name": "operation",
2152
- "type": "Function",
2153
- "optional": false
2154
- }
2155
- ],
2156
- "returnType": "Promise<T>",
2157
- "isStatic": false,
2158
- "isPublic": true
2159
- },
2160
- "getAiUsageSnapshot": {
2161
- "name": "getAiUsageSnapshot",
2162
- "async": false,
2163
- "parameters": [],
2164
- "returnType": "AiUsageSnapshot | undefined",
2165
- "isStatic": false,
2166
- "isPublic": true
2167
- },
2168
- "resetAiUsage": {
2169
- "name": "resetAiUsage",
2170
- "async": false,
2171
- "parameters": [],
2172
- "returnType": "void",
2173
- "isStatic": false,
2174
- "isPublic": true
2175
- },
2176
- "listAiUsage": {
2177
- "name": "listAiUsage",
2178
- "async": true,
2179
- "parameters": [
2180
- {
2181
- "name": "options",
2182
- "type": "AiUsageListOptions",
2183
- "optional": true
2184
- }
2185
- ],
2186
- "returnType": "Promise<SmrtAiUsageRecord[]>",
2187
- "isStatic": false,
2188
- "isPublic": true
2189
- },
2190
- "summarizeAiUsage": {
2191
- "name": "summarizeAiUsage",
2192
- "async": true,
2193
- "parameters": [
2194
- {
2195
- "name": "options",
2196
- "type": "AiUsageSummaryOptions",
2197
- "optional": true
2198
- }
2199
- ],
2200
- "returnType": "Promise<Record<string, AiUsageStats>>",
2201
- "isStatic": false,
2202
- "isPublic": true
2203
- },
2204
- "destroy": {
2205
- "name": "destroy",
2206
- "async": false,
2207
- "parameters": [],
2208
- "returnType": "void",
2209
- "isStatic": false,
2210
- "isPublic": true
2211
- },
2212
- "markAsPersisted": {
2213
- "name": "markAsPersisted",
2214
- "async": false,
2215
- "parameters": [],
2216
- "returnType": "void",
2217
- "isStatic": false,
2218
- "isPublic": true
2219
- },
2220
- "requireInsertOnSave": {
2221
- "name": "requireInsertOnSave",
2222
- "async": false,
2223
- "parameters": [],
2224
- "returnType": "void",
2225
- "isStatic": false,
2226
- "isPublic": true
2227
- },
2228
- "withTransaction": {
2229
- "name": "withTransaction",
2230
- "async": true,
2231
- "parameters": [
2232
- {
2233
- "name": "operation",
2234
- "type": "Function",
2235
- "optional": false
2236
- }
2237
- ],
2238
- "returnType": "Promise<T>",
2239
- "isStatic": false,
2240
- "isPublic": true
2241
- },
2242
- "initialize": {
2243
- "name": "initialize",
2244
- "async": true,
2245
- "parameters": [],
2246
- "returnType": "Promise",
2247
- "isStatic": false,
2248
- "isPublic": true
2249
- },
2250
- "loadDataFromDb": {
2251
- "name": "loadDataFromDb",
2252
- "async": true,
2253
- "parameters": [
2254
- {
2255
- "name": "data",
2256
- "type": "Record<string>",
2257
- "optional": false
2258
- }
2259
- ],
2260
- "returnType": "any",
2261
- "isStatic": false,
2262
- "isPublic": true
2263
- },
2264
- "getFields": {
2265
- "name": "getFields",
2266
- "async": true,
2267
- "parameters": [],
2268
- "returnType": "Promise<any>",
2269
- "isStatic": false,
2270
- "isPublic": true
2271
- },
2272
- "toJSON": {
2273
- "name": "toJSON",
2274
- "async": false,
2275
- "parameters": [],
2276
- "returnType": "any",
2277
- "isStatic": false,
2278
- "isPublic": true
2279
- },
2280
- "toPlainObject": {
2281
- "name": "toPlainObject",
2282
- "async": false,
2283
- "parameters": [],
2284
- "returnType": "Record<string>",
2285
- "isStatic": false,
2286
- "isPublic": true
2287
- },
2288
- "toPublicJSON": {
2289
- "name": "toPublicJSON",
2290
- "async": false,
2291
- "parameters": [
2292
- {
2293
- "name": "options",
2294
- "type": "PublicJsonOptions",
2295
- "optional": true
2296
- }
2297
- ],
2298
- "returnType": "Record<string>",
2299
- "isStatic": false,
2300
- "isPublic": true
2301
- },
2302
- "getId": {
2303
- "name": "getId",
2304
- "async": true,
2305
- "parameters": [],
2306
- "returnType": "any",
2307
- "isStatic": false,
2308
- "isPublic": true
2309
- },
2310
- "getSlug": {
2311
- "name": "getSlug",
2312
- "async": true,
2313
- "parameters": [],
2314
- "returnType": "any",
2315
- "isStatic": false,
2316
- "isPublic": true
2317
- },
2318
- "getSavedId": {
2319
- "name": "getSavedId",
2320
- "async": true,
2321
- "parameters": [],
2322
- "returnType": "any",
2323
- "isStatic": false,
2324
- "isPublic": true
2325
- },
2326
- "isSaved": {
2327
- "name": "isSaved",
2328
- "async": true,
2329
- "parameters": [],
2330
- "returnType": "any",
2331
- "isStatic": false,
2332
- "isPublic": true
2333
- },
2334
- "save": {
2335
- "name": "save",
2336
- "async": true,
2337
- "parameters": [
2338
- {
2339
- "name": "options",
2340
- "type": "SmrtSaveOptions",
2341
- "optional": true
2342
- }
2343
- ],
2344
- "returnType": "any",
2345
- "isStatic": false,
2346
- "isPublic": true
2347
- },
2348
- "claimRevision": {
2349
- "name": "claimRevision",
2350
- "async": true,
2351
- "parameters": [
2352
- {
2353
- "name": "expectedUpdatedAt",
2354
- "type": "Date | string",
2355
- "optional": false
2356
- }
2357
- ],
2358
- "returnType": "Promise",
2359
- "isStatic": false,
2360
- "isPublic": true
2361
- },
2362
- "classifyConstraintError": {
2363
- "name": "classifyConstraintError",
2364
- "async": false,
2365
- "parameters": [
2366
- {
2367
- "name": "message",
2368
- "type": "string",
2369
- "optional": false
2370
- }
2371
- ],
2372
- "returnType": "'unique' | 'not_null' | null",
2373
- "isStatic": true,
2374
- "isPublic": true
2375
- },
2376
- "loadFromId": {
2377
- "name": "loadFromId",
2378
- "async": true,
2379
- "parameters": [],
2380
- "returnType": "any",
2381
- "isStatic": false,
2382
- "isPublic": true
2383
- },
2384
- "loadFromSlug": {
2385
- "name": "loadFromSlug",
2386
- "async": true,
2387
- "parameters": [],
2388
- "returnType": "any",
2389
- "isStatic": false,
2390
- "isPublic": true
2391
- },
2392
- "is": {
2393
- "name": "is",
2394
- "async": true,
2395
- "parameters": [
2396
- {
2397
- "name": "criteria",
2398
- "type": "string",
2399
- "optional": false
2400
- },
2401
- {
2402
- "name": "options",
2403
- "type": "AiOperationOptions",
2404
- "optional": true
2405
- }
2406
- ],
2407
- "returnType": "any",
2408
- "isStatic": false,
2409
- "isPublic": true
2410
- },
2411
- "do": {
2412
- "name": "do",
2413
- "async": true,
2414
- "parameters": [
2415
- {
2416
- "name": "instructions",
2417
- "type": "string",
2418
- "optional": false
2419
- },
2420
- {
2421
- "name": "options",
2422
- "type": "AiOperationOptions",
2423
- "optional": true
2424
- }
2425
- ],
2426
- "returnType": "any",
2427
- "isStatic": false,
2428
- "isPublic": true
2429
- },
2430
- "describe": {
2431
- "name": "describe",
2432
- "async": true,
2433
- "parameters": [
2434
- {
2435
- "name": "options",
2436
- "type": "AiOperationOptions",
2437
- "optional": true
2438
- }
2439
- ],
2440
- "returnType": "any",
2441
- "isStatic": false,
2442
- "isPublic": true
2443
- },
2444
- "delete": {
2445
- "name": "delete",
2446
- "async": true,
2447
- "parameters": [],
2448
- "returnType": "Promise<void>",
2449
- "isStatic": false,
2450
- "isPublic": true
2451
- },
2452
- "isRelatedLoaded": {
2453
- "name": "isRelatedLoaded",
2454
- "async": false,
2455
- "parameters": [
2456
- {
2457
- "name": "fieldName",
2458
- "type": "string",
2459
- "optional": false
2460
- }
2461
- ],
2462
- "returnType": "boolean",
2463
- "isStatic": false,
2464
- "isPublic": true
2465
- },
2466
- "_setLoadedRelationship": {
2467
- "name": "_setLoadedRelationship",
2468
- "async": false,
2469
- "parameters": [
2470
- {
2471
- "name": "fieldName",
2472
- "type": "string",
2473
- "optional": false
2474
- },
2475
- {
2476
- "name": "value",
2477
- "type": "any",
2478
- "optional": false
2479
- }
2480
- ],
2481
- "returnType": "void",
2482
- "isStatic": false,
2483
- "isPublic": true
2484
- },
2485
- "loadRelated": {
2486
- "name": "loadRelated",
2487
- "async": true,
2488
- "parameters": [
2489
- {
2490
- "name": "fieldName",
2491
- "type": "string",
2492
- "optional": false
2493
- },
2494
- {
2495
- "name": "opts",
2496
- "type": "LoadRelatedOptions",
2497
- "optional": true
2498
- }
2499
- ],
2500
- "returnType": "Promise<any>",
2501
- "isStatic": false,
2502
- "isPublic": true
2503
- },
2504
- "loadRelatedMany": {
2505
- "name": "loadRelatedMany",
2506
- "async": true,
2507
- "parameters": [
2508
- {
2509
- "name": "fieldName",
2510
- "type": "string",
2511
- "optional": false
2512
- },
2513
- {
2514
- "name": "opts",
2515
- "type": "LoadRelatedOptions",
2516
- "optional": true
2517
- }
2518
- ],
2519
- "returnType": "Promise<any[]>",
2520
- "isStatic": false,
2521
- "isPublic": true
2522
- },
2523
- "getRelated": {
2524
- "name": "getRelated",
2525
- "async": true,
2526
- "parameters": [
2527
- {
2528
- "name": "fieldName",
2529
- "type": "string",
2530
- "optional": false
2531
- },
2532
- {
2533
- "name": "opts",
2534
- "type": "LoadRelatedOptions",
2535
- "optional": true
2536
- }
2537
- ],
2538
- "returnType": "Promise<any>",
2539
- "isStatic": false,
2540
- "isPublic": true
2541
- },
2542
- "getAvailableTools": {
2543
- "name": "getAvailableTools",
2544
- "async": false,
2545
- "parameters": [],
2546
- "returnType": "AITool[]",
2547
- "isStatic": false,
2548
- "isPublic": true
2549
- },
2550
- "executeToolCall": {
2551
- "name": "executeToolCall",
2552
- "async": true,
2553
- "parameters": [
2554
- {
2555
- "name": "toolCall",
2556
- "type": "ToolCall",
2557
- "optional": false
2558
- }
2559
- ],
2560
- "returnType": "Promise<ToolCallResult>",
2561
- "isStatic": false,
2562
- "isPublic": true
2563
- },
2564
- "remember": {
2565
- "name": "remember",
2566
- "async": true,
2567
- "parameters": [
2568
- {
2569
- "name": "options",
2570
- "type": "object",
2571
- "optional": false
2572
- }
2573
- ],
2574
- "returnType": "Promise<void>",
2575
- "isStatic": false,
2576
- "isPublic": true
2577
- },
2578
- "recall": {
2579
- "name": "recall",
2580
- "async": true,
2581
- "parameters": [
2582
- {
2583
- "name": "options",
2584
- "type": "object",
2585
- "optional": false
2586
- }
2587
- ],
2588
- "returnType": "Promise",
2589
- "isStatic": false,
2590
- "isPublic": true
2591
- },
2592
- "recallAll": {
2593
- "name": "recallAll",
2594
- "async": true,
2595
- "parameters": [
2596
- {
2597
- "name": "options",
2598
- "type": "object",
2599
- "optional": true
2600
- }
2601
- ],
2602
- "returnType": "Promise<Map<string>>",
2603
- "isStatic": false,
2604
- "isPublic": true
2605
- },
2606
- "forget": {
2607
- "name": "forget",
2608
- "async": true,
2609
- "parameters": [
2610
- {
2611
- "name": "options",
2612
- "type": "object",
2613
- "optional": false
2614
- }
2615
- ],
2616
- "returnType": "Promise<void>",
2617
- "isStatic": false,
2618
- "isPublic": true
2619
- },
2620
- "forgetScope": {
2621
- "name": "forgetScope",
2622
- "async": true,
2623
- "parameters": [
2624
- {
2625
- "name": "options",
2626
- "type": "object",
2627
- "optional": false
2628
- }
2629
- ],
2630
- "returnType": "Promise<number>",
2631
- "isStatic": false,
2632
- "isPublic": true
2633
- },
2634
- "generateEmbeddings": {
2635
- "name": "generateEmbeddings",
2636
- "async": true,
2637
- "parameters": [
2638
- {
2639
- "name": "options",
2640
- "type": "GenerateEmbeddingsOptions",
2641
- "optional": true
2642
- }
2643
- ],
2644
- "returnType": "Promise<void>",
2645
- "isStatic": false,
2646
- "isPublic": true
2647
- },
2648
- "getEmbedding": {
2649
- "name": "getEmbedding",
2650
- "async": true,
2651
- "parameters": [
2652
- {
2653
- "name": "fieldName",
2654
- "type": "string",
2655
- "optional": false
2656
- },
2657
- {
2658
- "name": "model",
2659
- "type": "string",
2660
- "optional": true
2661
- }
2662
- ],
2663
- "returnType": "Promise<number[] | null>",
2664
- "isStatic": false,
2665
- "isPublic": true
2666
- },
2667
- "hasStaleEmbeddings": {
2668
- "name": "hasStaleEmbeddings",
2669
- "async": true,
2670
- "parameters": [],
2671
- "returnType": "Promise<boolean>",
2672
- "isStatic": false,
2673
- "isPublic": true
2674
- },
2675
- "clearEmbeddings": {
2676
- "name": "clearEmbeddings",
2677
- "async": true,
2678
- "parameters": [],
2679
- "returnType": "Promise<void>",
2680
- "isStatic": false,
2681
- "isPublic": true
2682
- },
2683
- "getZoneIds": {
2684
- "name": "getZoneIds",
2685
- "async": false,
2686
- "parameters": [],
2687
- "returnType": "string[]",
2688
- "isStatic": false,
2689
- "isPublic": true
2690
- },
2691
- "setZoneIds": {
2692
- "name": "setZoneIds",
2693
- "async": false,
2694
- "parameters": [
2695
- {
2696
- "name": "ids",
2697
- "type": "string[]",
2698
- "optional": false
2699
- }
2700
- ],
2701
- "returnType": "void",
2702
- "isStatic": false,
2703
- "isPublic": true
2704
- },
2705
- "addZoneId": {
2706
- "name": "addZoneId",
2707
- "async": false,
2708
- "parameters": [
2709
- {
2710
- "name": "zoneId",
2711
- "type": "string",
2712
- "optional": false
2713
- }
2714
- ],
2715
- "returnType": "void",
2716
- "isStatic": false,
2717
- "isPublic": true
2718
- },
2719
- "removeZoneId": {
2720
- "name": "removeZoneId",
2721
- "async": false,
2722
- "parameters": [
2723
- {
2724
- "name": "zoneId",
2725
- "type": "string",
2726
- "optional": false
2727
- }
2728
- ],
2729
- "returnType": "void",
2730
- "isStatic": false,
2731
- "isPublic": true
2732
- },
2733
- "hasZoneId": {
2734
- "name": "hasZoneId",
2735
- "async": false,
2736
- "parameters": [
2737
- {
2738
- "name": "zoneId",
2739
- "type": "string",
2740
- "optional": false
2741
- }
2742
- ],
2743
- "returnType": "boolean",
2744
- "isStatic": false,
2745
- "isPublic": true
2746
- },
2747
- "getTargeting": {
2748
- "name": "getTargeting",
2749
- "async": false,
2750
- "parameters": [],
2751
- "returnType": "Record<string>",
2752
- "isStatic": false,
2753
- "isPublic": true
2754
- },
2755
- "setTargeting": {
2756
- "name": "setTargeting",
2757
- "async": false,
2758
- "parameters": [
2759
- {
2760
- "name": "rules",
2761
- "type": "Record<string>",
2762
- "optional": false
2763
- }
2764
- ],
2765
- "returnType": "void",
2766
- "isStatic": false,
2767
- "isPublic": true
2768
- },
2769
- "isActive": {
2770
- "name": "isActive",
2771
- "async": false,
2772
- "parameters": [],
2773
- "returnType": "boolean",
2774
- "isStatic": false,
2775
- "isPublic": true
2776
- },
2777
- "isDraft": {
2778
- "name": "isDraft",
2779
- "async": false,
2780
- "parameters": [],
2781
- "returnType": "boolean",
2782
- "isStatic": false,
2783
- "isPublic": true
2784
- },
2785
- "isPaused": {
2786
- "name": "isPaused",
2787
- "async": false,
2788
- "parameters": [],
2789
- "returnType": "boolean",
2790
- "isStatic": false,
2791
- "isPublic": true
2792
- },
2793
- "isCompleted": {
2794
- "name": "isCompleted",
2795
- "async": false,
2796
- "parameters": [],
2797
- "returnType": "boolean",
2798
- "isStatic": false,
2799
- "isPublic": true
2800
- },
2801
- "hasEnded": {
2802
- "name": "hasEnded",
2803
- "async": false,
2804
- "parameters": [],
2805
- "returnType": "boolean",
2806
- "isStatic": false,
2807
- "isPublic": true
2808
- },
2809
- "hasStarted": {
2810
- "name": "hasStarted",
2811
- "async": false,
2812
- "parameters": [],
2813
- "returnType": "boolean",
2814
- "isStatic": false,
2815
- "isPublic": true
2816
- }
2817
- },
2818
- "decoratorConfig": {
2819
- "tableStrategy": "sti",
2820
- "api": {
2821
- "include": [
2822
- "list",
2823
- "get",
2824
- "create",
2825
- "update"
2826
- ]
2827
- },
2828
- "mcp": {
2829
- "include": [
2830
- "list",
2831
- "get",
2832
- "create"
2833
- ]
2834
- },
2835
- "cli": true,
2836
- "tenantScoped": {
2837
- "mode": "optional"
2838
- },
2839
- "conflictColumns": [
2840
- "tenant_id",
2841
- "slug",
2842
- "context",
2843
- "_meta_type"
2844
- ]
2845
- },
2846
- "extends": "SmrtObject",
2847
- "exportName": "AdGroup",
2848
- "collectionExportName": "AdGroupCollection",
2849
- "schema": {
2850
- "tableName": "ad_groups",
2851
- "ddl": "CREATE TABLE IF NOT EXISTS \"ad_groups\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"_meta_type\" TEXT NOT NULL,\n \"_meta_data\" JSON,\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID,\n \"contract_id\" UUID,\n \"tier_id\" UUID,\n \"name\" TEXT DEFAULT '',\n \"vertical_slug\" TEXT DEFAULT '',\n \"targeting\" TEXT DEFAULT '',\n \"zone_ids\" TEXT DEFAULT '',\n \"start_date\" TIMESTAMP,\n \"end_date\" TIMESTAMP,\n \"daily_budget\" REAL DEFAULT 0,\n \"total_budget\" REAL DEFAULT 0,\n \"status\" TEXT\n);",
2852
- "columns": {
2853
- "id": {
2854
- "type": "UUID",
2855
- "primaryKey": true,
2856
- "referenceKind": "id",
2857
- "notNull": true
2858
- },
2859
- "slug": {
2860
- "type": "TEXT",
2861
- "notNull": true
2862
- },
2863
- "context": {
2864
- "type": "TEXT",
2865
- "notNull": true,
2866
- "default": ""
2867
- },
2868
- "_meta_type": {
2869
- "type": "TEXT",
2870
- "notNull": true
2871
- },
2872
- "_meta_data": {
2873
- "type": "JSON",
2874
- "notNull": false
2875
- },
2876
- "created_at": {
2877
- "type": "TIMESTAMP",
2878
- "notNull": true,
2879
- "default": "current_timestamp"
2880
- },
2881
- "updated_at": {
2882
- "type": "TIMESTAMP",
2883
- "notNull": true,
2884
- "default": "current_timestamp"
2885
- },
2886
- "tenant_id": {
2887
- "type": "UUID",
2888
- "referenceKind": "tenantId",
2889
- "notNull": false
2890
- },
2891
- "contract_id": {
2892
- "type": "UUID",
2893
- "referenceKind": "crossPackageRef",
2894
- "notNull": false
2895
- },
2896
- "tier_id": {
2897
- "type": "UUID",
2898
- "referenceKind": "foreignKey",
2899
- "notNull": false,
2900
- "foreignKey": {
2901
- "table": "ad_delivery_tiers",
2902
- "column": "id",
2903
- "onDelete": "NO ACTION",
2904
- "onUpdate": "CASCADE"
2905
- }
2906
- },
2907
- "name": {
2908
- "type": "TEXT",
2909
- "notNull": false,
2910
- "default": ""
2911
- },
2912
- "vertical_slug": {
2913
- "type": "TEXT",
2914
- "notNull": false,
2915
- "default": ""
2916
- },
2917
- "targeting": {
2918
- "type": "TEXT",
2919
- "notNull": false,
2920
- "default": ""
2921
- },
2922
- "zone_ids": {
2923
- "type": "TEXT",
2924
- "notNull": false,
2925
- "default": ""
2926
- },
2927
- "start_date": {
2928
- "type": "TIMESTAMP",
2929
- "notNull": false
2930
- },
2931
- "end_date": {
2932
- "type": "TIMESTAMP",
2933
- "notNull": false
2934
- },
2935
- "daily_budget": {
2936
- "type": "REAL",
2937
- "notNull": false,
2938
- "default": 0
2939
- },
2940
- "total_budget": {
2941
- "type": "REAL",
2942
- "notNull": false,
2943
- "default": 0
2944
- },
2945
- "status": {
2946
- "type": "TEXT",
2947
- "notNull": false
2948
- }
2949
- },
2950
- "indexes": [
2951
- {
2952
- "name": "ad_groups_slug_context_meta_type_idx",
2953
- "columns": [
2954
- "tenant_id",
2955
- "slug",
2956
- "context",
2957
- "_meta_type"
2958
- ],
2959
- "unique": true
2960
- },
2961
- {
2962
- "name": "ad_groups_meta_type_idx",
2963
- "columns": [
2964
- "_meta_type"
2965
- ]
2966
- },
2967
- {
2968
- "name": "ad_groups_tenant_id_created_at_idx",
2969
- "columns": [
2970
- "tenant_id",
2971
- "created_at"
2972
- ]
2973
- },
2974
- {
2975
- "name": "ad_groups_contract_id_idx",
2976
- "columns": [
2977
- "contract_id"
2978
- ]
2979
- },
2980
- {
2981
- "name": "ad_groups_tier_id_idx",
2982
- "columns": [
2983
- "tier_id"
2984
- ]
2985
- }
2986
- ],
2987
- "version": "3f8a3fea"
2988
- }
2989
- },
2990
- "@happyvertical/smrt-ads:AdVariation": {
2991
- "name": "advariation",
2992
- "className": "AdVariation",
2993
- "qualifiedName": "@happyvertical/smrt-ads:AdVariation",
2994
- "collection": "advariations",
2995
- "filePath": "/home/runner/work/smrt/smrt/packages/ads/src/models/AdVariation.ts",
2996
- "packageName": "@happyvertical/smrt-ads",
2997
- "fields": {
2998
- "created_at": {
2999
- "type": "datetime",
3000
- "required": false
3001
- },
3002
- "updated_at": {
3003
- "type": "datetime",
3004
- "required": false
3005
- },
3006
- "tenantId": {
3007
- "type": "text",
3008
- "required": false,
3009
- "_meta": {
3010
- "sqlType": "UUID",
3011
- "nullable": true,
3012
- "__tenancy": {
3013
- "isTenantIdField": true,
3014
- "autoFilter": true,
3015
- "required": false,
3016
- "autoPopulate": true,
3017
- "nullable": true,
3018
- "mode": "optional",
3019
- "field": "tenantId",
3020
- "allowSuperAdminBypass": false
3021
- }
3022
- }
3023
- },
3024
- "groupId": {
3025
- "type": "foreignKey",
3026
- "required": false,
3027
- "related": "AdGroup"
3028
- },
3029
- "formatId": {
3030
- "type": "foreignKey",
3031
- "required": false,
3032
- "related": "AdFormat"
3033
- },
3034
- "assetId": {
3035
- "type": "crossPackageRef",
3036
- "required": false,
3037
- "related": "@happyvertical/smrt-assets:Asset"
3038
- },
3039
- "name": {
3040
- "type": "text",
3041
- "required": false,
3042
- "default": ""
3043
- },
3044
- "clickUrl": {
3045
- "type": "text",
3046
- "required": false,
3047
- "default": ""
3048
- },
3049
- "altText": {
3050
- "type": "text",
3051
- "required": false,
3052
- "default": ""
3053
- },
3054
- "weight": {
3055
- "type": "integer",
3056
- "required": false,
3057
- "default": 1
3058
- },
3059
- "status": {
3060
- "type": "text",
3061
- "required": false
3062
- },
3063
- "impressions": {
3064
- "type": "integer",
3065
- "required": false,
3066
- "default": 0
3067
- },
3068
- "clicks": {
3069
- "type": "integer",
3070
- "required": false,
3071
- "default": 0
3072
- }
3073
- },
3074
- "methods": {
3075
- "withDatabase": {
3076
- "name": "withDatabase",
3077
- "async": true,
3078
- "parameters": [
3079
- {
3080
- "name": "db",
3081
- "type": "DatabaseInterface",
3082
- "optional": false
3083
- },
3084
- {
3085
- "name": "operation",
3086
- "type": "Function",
3087
- "optional": false
3088
- }
3089
- ],
3090
- "returnType": "Promise<T>",
3091
- "isStatic": false,
3092
- "isPublic": true
3093
- },
3094
- "getAiUsageSnapshot": {
3095
- "name": "getAiUsageSnapshot",
3096
- "async": false,
3097
- "parameters": [],
3098
- "returnType": "AiUsageSnapshot | undefined",
3099
- "isStatic": false,
3100
- "isPublic": true
3101
- },
3102
- "resetAiUsage": {
3103
- "name": "resetAiUsage",
3104
- "async": false,
3105
- "parameters": [],
3106
- "returnType": "void",
3107
- "isStatic": false,
3108
- "isPublic": true
3109
- },
3110
- "listAiUsage": {
3111
- "name": "listAiUsage",
3112
- "async": true,
3113
- "parameters": [
3114
- {
3115
- "name": "options",
3116
- "type": "AiUsageListOptions",
3117
- "optional": true
3118
- }
3119
- ],
3120
- "returnType": "Promise<SmrtAiUsageRecord[]>",
3121
- "isStatic": false,
3122
- "isPublic": true
3123
- },
3124
- "summarizeAiUsage": {
3125
- "name": "summarizeAiUsage",
3126
- "async": true,
3127
- "parameters": [
3128
- {
3129
- "name": "options",
3130
- "type": "AiUsageSummaryOptions",
3131
- "optional": true
3132
- }
3133
- ],
3134
- "returnType": "Promise<Record<string, AiUsageStats>>",
3135
- "isStatic": false,
3136
- "isPublic": true
3137
- },
3138
- "destroy": {
3139
- "name": "destroy",
3140
- "async": false,
3141
- "parameters": [],
3142
- "returnType": "void",
3143
- "isStatic": false,
3144
- "isPublic": true
3145
- },
3146
- "markAsPersisted": {
3147
- "name": "markAsPersisted",
3148
- "async": false,
3149
- "parameters": [],
3150
- "returnType": "void",
3151
- "isStatic": false,
3152
- "isPublic": true
3153
- },
3154
- "requireInsertOnSave": {
3155
- "name": "requireInsertOnSave",
3156
- "async": false,
3157
- "parameters": [],
3158
- "returnType": "void",
3159
- "isStatic": false,
3160
- "isPublic": true
3161
- },
3162
- "withTransaction": {
3163
- "name": "withTransaction",
3164
- "async": true,
3165
- "parameters": [
3166
- {
3167
- "name": "operation",
3168
- "type": "Function",
3169
- "optional": false
3170
- }
3171
- ],
3172
- "returnType": "Promise<T>",
3173
- "isStatic": false,
3174
- "isPublic": true
3175
- },
3176
- "initialize": {
3177
- "name": "initialize",
3178
- "async": true,
3179
- "parameters": [],
3180
- "returnType": "Promise",
3181
- "isStatic": false,
3182
- "isPublic": true
3183
- },
3184
- "loadDataFromDb": {
3185
- "name": "loadDataFromDb",
3186
- "async": true,
3187
- "parameters": [
3188
- {
3189
- "name": "data",
3190
- "type": "Record<string>",
3191
- "optional": false
3192
- }
3193
- ],
3194
- "returnType": "any",
3195
- "isStatic": false,
3196
- "isPublic": true
3197
- },
3198
- "getFields": {
3199
- "name": "getFields",
3200
- "async": true,
3201
- "parameters": [],
3202
- "returnType": "Promise<any>",
3203
- "isStatic": false,
3204
- "isPublic": true
3205
- },
3206
- "toJSON": {
3207
- "name": "toJSON",
3208
- "async": false,
3209
- "parameters": [],
3210
- "returnType": "any",
3211
- "isStatic": false,
3212
- "isPublic": true
3213
- },
3214
- "toPlainObject": {
3215
- "name": "toPlainObject",
3216
- "async": false,
3217
- "parameters": [],
3218
- "returnType": "Record<string>",
3219
- "isStatic": false,
3220
- "isPublic": true
3221
- },
3222
- "toPublicJSON": {
3223
- "name": "toPublicJSON",
3224
- "async": false,
3225
- "parameters": [
3226
- {
3227
- "name": "options",
3228
- "type": "PublicJsonOptions",
3229
- "optional": true
3230
- }
3231
- ],
3232
- "returnType": "Record<string>",
3233
- "isStatic": false,
3234
- "isPublic": true
3235
- },
3236
- "getId": {
3237
- "name": "getId",
3238
- "async": true,
3239
- "parameters": [],
3240
- "returnType": "any",
3241
- "isStatic": false,
3242
- "isPublic": true
3243
- },
3244
- "getSlug": {
3245
- "name": "getSlug",
3246
- "async": true,
3247
- "parameters": [],
3248
- "returnType": "any",
3249
- "isStatic": false,
3250
- "isPublic": true
3251
- },
3252
- "getSavedId": {
3253
- "name": "getSavedId",
3254
- "async": true,
3255
- "parameters": [],
3256
- "returnType": "any",
3257
- "isStatic": false,
3258
- "isPublic": true
3259
- },
3260
- "isSaved": {
3261
- "name": "isSaved",
3262
- "async": true,
3263
- "parameters": [],
3264
- "returnType": "any",
3265
- "isStatic": false,
3266
- "isPublic": true
3267
- },
3268
- "save": {
3269
- "name": "save",
3270
- "async": true,
3271
- "parameters": [
3272
- {
3273
- "name": "options",
3274
- "type": "SmrtSaveOptions",
3275
- "optional": true
3276
- }
3277
- ],
3278
- "returnType": "any",
3279
- "isStatic": false,
3280
- "isPublic": true
3281
- },
3282
- "claimRevision": {
3283
- "name": "claimRevision",
3284
- "async": true,
3285
- "parameters": [
3286
- {
3287
- "name": "expectedUpdatedAt",
3288
- "type": "Date | string",
3289
- "optional": false
3290
- }
3291
- ],
3292
- "returnType": "Promise",
3293
- "isStatic": false,
3294
- "isPublic": true
3295
- },
3296
- "classifyConstraintError": {
3297
- "name": "classifyConstraintError",
3298
- "async": false,
3299
- "parameters": [
3300
- {
3301
- "name": "message",
3302
- "type": "string",
3303
- "optional": false
3304
- }
3305
- ],
3306
- "returnType": "'unique' | 'not_null' | null",
3307
- "isStatic": true,
3308
- "isPublic": true
3309
- },
3310
- "loadFromId": {
3311
- "name": "loadFromId",
3312
- "async": true,
3313
- "parameters": [],
3314
- "returnType": "any",
3315
- "isStatic": false,
3316
- "isPublic": true
3317
- },
3318
- "loadFromSlug": {
3319
- "name": "loadFromSlug",
3320
- "async": true,
3321
- "parameters": [],
3322
- "returnType": "any",
3323
- "isStatic": false,
3324
- "isPublic": true
3325
- },
3326
- "is": {
3327
- "name": "is",
3328
- "async": true,
3329
- "parameters": [
3330
- {
3331
- "name": "criteria",
3332
- "type": "string",
3333
- "optional": false
3334
- },
3335
- {
3336
- "name": "options",
3337
- "type": "AiOperationOptions",
3338
- "optional": true
3339
- }
3340
- ],
3341
- "returnType": "any",
3342
- "isStatic": false,
3343
- "isPublic": true
3344
- },
3345
- "do": {
3346
- "name": "do",
3347
- "async": true,
3348
- "parameters": [
3349
- {
3350
- "name": "instructions",
3351
- "type": "string",
3352
- "optional": false
3353
- },
3354
- {
3355
- "name": "options",
3356
- "type": "AiOperationOptions",
3357
- "optional": true
3358
- }
3359
- ],
3360
- "returnType": "any",
3361
- "isStatic": false,
3362
- "isPublic": true
3363
- },
3364
- "describe": {
3365
- "name": "describe",
3366
- "async": true,
3367
- "parameters": [
3368
- {
3369
- "name": "options",
3370
- "type": "AiOperationOptions",
3371
- "optional": true
3372
- }
3373
- ],
3374
- "returnType": "any",
3375
- "isStatic": false,
3376
- "isPublic": true
3377
- },
3378
- "delete": {
3379
- "name": "delete",
3380
- "async": true,
3381
- "parameters": [],
3382
- "returnType": "Promise<void>",
3383
- "isStatic": false,
3384
- "isPublic": true
3385
- },
3386
- "isRelatedLoaded": {
3387
- "name": "isRelatedLoaded",
3388
- "async": false,
3389
- "parameters": [
3390
- {
3391
- "name": "fieldName",
3392
- "type": "string",
3393
- "optional": false
3394
- }
3395
- ],
3396
- "returnType": "boolean",
3397
- "isStatic": false,
3398
- "isPublic": true
3399
- },
3400
- "_setLoadedRelationship": {
3401
- "name": "_setLoadedRelationship",
3402
- "async": false,
3403
- "parameters": [
3404
- {
3405
- "name": "fieldName",
3406
- "type": "string",
3407
- "optional": false
3408
- },
3409
- {
3410
- "name": "value",
3411
- "type": "any",
3412
- "optional": false
3413
- }
3414
- ],
3415
- "returnType": "void",
3416
- "isStatic": false,
3417
- "isPublic": true
3418
- },
3419
- "loadRelated": {
3420
- "name": "loadRelated",
3421
- "async": true,
3422
- "parameters": [
3423
- {
3424
- "name": "fieldName",
3425
- "type": "string",
3426
- "optional": false
3427
- },
3428
- {
3429
- "name": "opts",
3430
- "type": "LoadRelatedOptions",
3431
- "optional": true
3432
- }
3433
- ],
3434
- "returnType": "Promise<any>",
3435
- "isStatic": false,
3436
- "isPublic": true
3437
- },
3438
- "loadRelatedMany": {
3439
- "name": "loadRelatedMany",
3440
- "async": true,
3441
- "parameters": [
3442
- {
3443
- "name": "fieldName",
3444
- "type": "string",
3445
- "optional": false
3446
- },
3447
- {
3448
- "name": "opts",
3449
- "type": "LoadRelatedOptions",
3450
- "optional": true
3451
- }
3452
- ],
3453
- "returnType": "Promise<any[]>",
3454
- "isStatic": false,
3455
- "isPublic": true
3456
- },
3457
- "getRelated": {
3458
- "name": "getRelated",
3459
- "async": true,
3460
- "parameters": [
3461
- {
3462
- "name": "fieldName",
3463
- "type": "string",
3464
- "optional": false
3465
- },
3466
- {
3467
- "name": "opts",
3468
- "type": "LoadRelatedOptions",
3469
- "optional": true
3470
- }
3471
- ],
3472
- "returnType": "Promise<any>",
3473
- "isStatic": false,
3474
- "isPublic": true
3475
- },
3476
- "getAvailableTools": {
3477
- "name": "getAvailableTools",
3478
- "async": false,
3479
- "parameters": [],
3480
- "returnType": "AITool[]",
3481
- "isStatic": false,
3482
- "isPublic": true
3483
- },
3484
- "executeToolCall": {
3485
- "name": "executeToolCall",
3486
- "async": true,
3487
- "parameters": [
3488
- {
3489
- "name": "toolCall",
3490
- "type": "ToolCall",
3491
- "optional": false
3492
- }
3493
- ],
3494
- "returnType": "Promise<ToolCallResult>",
3495
- "isStatic": false,
3496
- "isPublic": true
3497
- },
3498
- "remember": {
3499
- "name": "remember",
3500
- "async": true,
3501
- "parameters": [
3502
- {
3503
- "name": "options",
3504
- "type": "object",
3505
- "optional": false
3506
- }
3507
- ],
3508
- "returnType": "Promise<void>",
3509
- "isStatic": false,
3510
- "isPublic": true
3511
- },
3512
- "recall": {
3513
- "name": "recall",
3514
- "async": true,
3515
- "parameters": [
3516
- {
3517
- "name": "options",
3518
- "type": "object",
3519
- "optional": false
3520
- }
3521
- ],
3522
- "returnType": "Promise",
3523
- "isStatic": false,
3524
- "isPublic": true
3525
- },
3526
- "recallAll": {
3527
- "name": "recallAll",
3528
- "async": true,
3529
- "parameters": [
3530
- {
3531
- "name": "options",
3532
- "type": "object",
3533
- "optional": true
3534
- }
3535
- ],
3536
- "returnType": "Promise<Map<string>>",
3537
- "isStatic": false,
3538
- "isPublic": true
3539
- },
3540
- "forget": {
3541
- "name": "forget",
3542
- "async": true,
3543
- "parameters": [
3544
- {
3545
- "name": "options",
3546
- "type": "object",
3547
- "optional": false
3548
- }
3549
- ],
3550
- "returnType": "Promise<void>",
3551
- "isStatic": false,
3552
- "isPublic": true
3553
- },
3554
- "forgetScope": {
3555
- "name": "forgetScope",
3556
- "async": true,
3557
- "parameters": [
3558
- {
3559
- "name": "options",
3560
- "type": "object",
3561
- "optional": false
3562
- }
3563
- ],
3564
- "returnType": "Promise<number>",
3565
- "isStatic": false,
3566
- "isPublic": true
3567
- },
3568
- "generateEmbeddings": {
3569
- "name": "generateEmbeddings",
3570
- "async": true,
3571
- "parameters": [
3572
- {
3573
- "name": "options",
3574
- "type": "GenerateEmbeddingsOptions",
3575
- "optional": true
3576
- }
3577
- ],
3578
- "returnType": "Promise<void>",
3579
- "isStatic": false,
3580
- "isPublic": true
3581
- },
3582
- "getEmbedding": {
3583
- "name": "getEmbedding",
3584
- "async": true,
3585
- "parameters": [
3586
- {
3587
- "name": "fieldName",
3588
- "type": "string",
3589
- "optional": false
3590
- },
3591
- {
3592
- "name": "model",
3593
- "type": "string",
3594
- "optional": true
3595
- }
3596
- ],
3597
- "returnType": "Promise<number[] | null>",
3598
- "isStatic": false,
3599
- "isPublic": true
3600
- },
3601
- "hasStaleEmbeddings": {
3602
- "name": "hasStaleEmbeddings",
3603
- "async": true,
3604
- "parameters": [],
3605
- "returnType": "Promise<boolean>",
3606
- "isStatic": false,
3607
- "isPublic": true
3608
- },
3609
- "clearEmbeddings": {
3610
- "name": "clearEmbeddings",
3611
- "async": true,
3612
- "parameters": [],
3613
- "returnType": "Promise<void>",
3614
- "isStatic": false,
3615
- "isPublic": true
3616
- },
3617
1991
  "isActive": {
3618
1992
  "name": "isActive",
3619
1993
  "async": false,