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