@albatrossai/albatross-sdk 0.2.1 → 0.2.3

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.
package/dist/index.d.cts CHANGED
@@ -258,7 +258,7 @@ interface ContentSelectionResponse {
258
258
  interface FilterCondition {
259
259
  /** field name to filter on */
260
260
  field: string;
261
- /** filter condition (Match, Range, or GeoRadius) */
261
+ /** filter condition (Match, Range, DatetimeRange, or GeoRadius) */
262
262
  condition: {
263
263
  type: "Match";
264
264
  value: string | number | boolean;
@@ -270,6 +270,14 @@ interface FilterCondition {
270
270
  gt?: number;
271
271
  lt?: number;
272
272
  };
273
+ } | {
274
+ type: "DatetimeRange";
275
+ value: {
276
+ gte?: string;
277
+ lte?: string;
278
+ gt?: string;
279
+ lt?: string;
280
+ };
273
281
  } | {
274
282
  type: "GeoRadius";
275
283
  value: {
@@ -891,6 +899,40 @@ declare class FilterBuilder {
891
899
  gt?: number;
892
900
  lt?: number;
893
901
  }, type?: "must" | "should" | "must_not"): this;
902
+ /**
903
+ * add datetime range filter condition
904
+ *
905
+ * filters items where datetime field falls within specified range.
906
+ * values should be RFC 3339 formatted strings (e.g., "2025-12-15T00:00:00Z").
907
+ *
908
+ * @param field - datetime field name to filter on
909
+ * @param value - range specification with operators (RFC 3339 strings)
910
+ * @param value.gte - greater than or equal to
911
+ * @param value.lte - less than or equal to
912
+ * @param value.gt - greater than
913
+ * @param value.lt - less than
914
+ * @param type - filter type: "must", "should", or "must_not". default: "must"
915
+ *
916
+ * @returns this filter builder for method chaining
917
+ *
918
+ * @example
919
+ * ```typescript
920
+ * // events between two dates
921
+ * builder.datetimeRange("start_date", {
922
+ * gte: "2025-12-15T00:00:00Z",
923
+ * lte: "2025-12-31T23:59:59Z"
924
+ * });
925
+ *
926
+ * // events after a specific date
927
+ * builder.datetimeRange("created_at", { gt: "2025-01-01T00:00:00Z" });
928
+ * ```
929
+ */
930
+ datetimeRange(field: string, value: {
931
+ gte?: string;
932
+ lte?: string;
933
+ gt?: string;
934
+ lt?: string;
935
+ }, type?: "must" | "should" | "must_not"): this;
894
936
  /**
895
937
  * add geo-radius filter condition
896
938
  *
@@ -1012,6 +1054,14 @@ declare const FilterConditionSchema: z.ZodObject<{
1012
1054
  gt: z.ZodOptional<z.ZodNumber>;
1013
1055
  lt: z.ZodOptional<z.ZodNumber>;
1014
1056
  }, z.core.$strip>;
1057
+ }, z.core.$strip>, z.ZodObject<{
1058
+ type: z.ZodLiteral<"DatetimeRange">;
1059
+ value: z.ZodObject<{
1060
+ gte: z.ZodOptional<z.ZodString>;
1061
+ lte: z.ZodOptional<z.ZodString>;
1062
+ gt: z.ZodOptional<z.ZodString>;
1063
+ lt: z.ZodOptional<z.ZodString>;
1064
+ }, z.core.$strip>;
1015
1065
  }, z.core.$strip>, z.ZodObject<{
1016
1066
  type: z.ZodLiteral<"GeoRadius">;
1017
1067
  value: z.ZodObject<{
@@ -1035,6 +1085,14 @@ declare const ContentSelectionFilterSchema: z.ZodObject<{
1035
1085
  gt: z.ZodOptional<z.ZodNumber>;
1036
1086
  lt: z.ZodOptional<z.ZodNumber>;
1037
1087
  }, z.core.$strip>;
1088
+ }, z.core.$strip>, z.ZodObject<{
1089
+ type: z.ZodLiteral<"DatetimeRange">;
1090
+ value: z.ZodObject<{
1091
+ gte: z.ZodOptional<z.ZodString>;
1092
+ lte: z.ZodOptional<z.ZodString>;
1093
+ gt: z.ZodOptional<z.ZodString>;
1094
+ lt: z.ZodOptional<z.ZodString>;
1095
+ }, z.core.$strip>;
1038
1096
  }, z.core.$strip>, z.ZodObject<{
1039
1097
  type: z.ZodLiteral<"GeoRadius">;
1040
1098
  value: z.ZodObject<{
@@ -1057,6 +1115,14 @@ declare const ContentSelectionFilterSchema: z.ZodObject<{
1057
1115
  gt: z.ZodOptional<z.ZodNumber>;
1058
1116
  lt: z.ZodOptional<z.ZodNumber>;
1059
1117
  }, z.core.$strip>;
1118
+ }, z.core.$strip>, z.ZodObject<{
1119
+ type: z.ZodLiteral<"DatetimeRange">;
1120
+ value: z.ZodObject<{
1121
+ gte: z.ZodOptional<z.ZodString>;
1122
+ lte: z.ZodOptional<z.ZodString>;
1123
+ gt: z.ZodOptional<z.ZodString>;
1124
+ lt: z.ZodOptional<z.ZodString>;
1125
+ }, z.core.$strip>;
1060
1126
  }, z.core.$strip>, z.ZodObject<{
1061
1127
  type: z.ZodLiteral<"GeoRadius">;
1062
1128
  value: z.ZodObject<{
@@ -1079,6 +1145,14 @@ declare const ContentSelectionFilterSchema: z.ZodObject<{
1079
1145
  gt: z.ZodOptional<z.ZodNumber>;
1080
1146
  lt: z.ZodOptional<z.ZodNumber>;
1081
1147
  }, z.core.$strip>;
1148
+ }, z.core.$strip>, z.ZodObject<{
1149
+ type: z.ZodLiteral<"DatetimeRange">;
1150
+ value: z.ZodObject<{
1151
+ gte: z.ZodOptional<z.ZodString>;
1152
+ lte: z.ZodOptional<z.ZodString>;
1153
+ gt: z.ZodOptional<z.ZodString>;
1154
+ lt: z.ZodOptional<z.ZodString>;
1155
+ }, z.core.$strip>;
1082
1156
  }, z.core.$strip>, z.ZodObject<{
1083
1157
  type: z.ZodLiteral<"GeoRadius">;
1084
1158
  value: z.ZodObject<{
@@ -1120,6 +1194,14 @@ declare const ContentSelectionRequestSchema: z.ZodObject<{
1120
1194
  gt: z.ZodOptional<z.ZodNumber>;
1121
1195
  lt: z.ZodOptional<z.ZodNumber>;
1122
1196
  }, z.core.$strip>;
1197
+ }, z.core.$strip>, z.ZodObject<{
1198
+ type: z.ZodLiteral<"DatetimeRange">;
1199
+ value: z.ZodObject<{
1200
+ gte: z.ZodOptional<z.ZodString>;
1201
+ lte: z.ZodOptional<z.ZodString>;
1202
+ gt: z.ZodOptional<z.ZodString>;
1203
+ lt: z.ZodOptional<z.ZodString>;
1204
+ }, z.core.$strip>;
1123
1205
  }, z.core.$strip>, z.ZodObject<{
1124
1206
  type: z.ZodLiteral<"GeoRadius">;
1125
1207
  value: z.ZodObject<{
@@ -1142,6 +1224,14 @@ declare const ContentSelectionRequestSchema: z.ZodObject<{
1142
1224
  gt: z.ZodOptional<z.ZodNumber>;
1143
1225
  lt: z.ZodOptional<z.ZodNumber>;
1144
1226
  }, z.core.$strip>;
1227
+ }, z.core.$strip>, z.ZodObject<{
1228
+ type: z.ZodLiteral<"DatetimeRange">;
1229
+ value: z.ZodObject<{
1230
+ gte: z.ZodOptional<z.ZodString>;
1231
+ lte: z.ZodOptional<z.ZodString>;
1232
+ gt: z.ZodOptional<z.ZodString>;
1233
+ lt: z.ZodOptional<z.ZodString>;
1234
+ }, z.core.$strip>;
1145
1235
  }, z.core.$strip>, z.ZodObject<{
1146
1236
  type: z.ZodLiteral<"GeoRadius">;
1147
1237
  value: z.ZodObject<{
@@ -1164,6 +1254,14 @@ declare const ContentSelectionRequestSchema: z.ZodObject<{
1164
1254
  gt: z.ZodOptional<z.ZodNumber>;
1165
1255
  lt: z.ZodOptional<z.ZodNumber>;
1166
1256
  }, z.core.$strip>;
1257
+ }, z.core.$strip>, z.ZodObject<{
1258
+ type: z.ZodLiteral<"DatetimeRange">;
1259
+ value: z.ZodObject<{
1260
+ gte: z.ZodOptional<z.ZodString>;
1261
+ lte: z.ZodOptional<z.ZodString>;
1262
+ gt: z.ZodOptional<z.ZodString>;
1263
+ lt: z.ZodOptional<z.ZodString>;
1264
+ }, z.core.$strip>;
1167
1265
  }, z.core.$strip>, z.ZodObject<{
1168
1266
  type: z.ZodLiteral<"GeoRadius">;
1169
1267
  value: z.ZodObject<{
@@ -1218,6 +1316,14 @@ declare const SearchParamsSchema: z.ZodObject<{
1218
1316
  gt: z.ZodOptional<z.ZodNumber>;
1219
1317
  lt: z.ZodOptional<z.ZodNumber>;
1220
1318
  }, z.core.$strip>;
1319
+ }, z.core.$strip>, z.ZodObject<{
1320
+ type: z.ZodLiteral<"DatetimeRange">;
1321
+ value: z.ZodObject<{
1322
+ gte: z.ZodOptional<z.ZodString>;
1323
+ lte: z.ZodOptional<z.ZodString>;
1324
+ gt: z.ZodOptional<z.ZodString>;
1325
+ lt: z.ZodOptional<z.ZodString>;
1326
+ }, z.core.$strip>;
1221
1327
  }, z.core.$strip>, z.ZodObject<{
1222
1328
  type: z.ZodLiteral<"GeoRadius">;
1223
1329
  value: z.ZodObject<{
@@ -1240,6 +1346,14 @@ declare const SearchParamsSchema: z.ZodObject<{
1240
1346
  gt: z.ZodOptional<z.ZodNumber>;
1241
1347
  lt: z.ZodOptional<z.ZodNumber>;
1242
1348
  }, z.core.$strip>;
1349
+ }, z.core.$strip>, z.ZodObject<{
1350
+ type: z.ZodLiteral<"DatetimeRange">;
1351
+ value: z.ZodObject<{
1352
+ gte: z.ZodOptional<z.ZodString>;
1353
+ lte: z.ZodOptional<z.ZodString>;
1354
+ gt: z.ZodOptional<z.ZodString>;
1355
+ lt: z.ZodOptional<z.ZodString>;
1356
+ }, z.core.$strip>;
1243
1357
  }, z.core.$strip>, z.ZodObject<{
1244
1358
  type: z.ZodLiteral<"GeoRadius">;
1245
1359
  value: z.ZodObject<{
@@ -1262,6 +1376,14 @@ declare const SearchParamsSchema: z.ZodObject<{
1262
1376
  gt: z.ZodOptional<z.ZodNumber>;
1263
1377
  lt: z.ZodOptional<z.ZodNumber>;
1264
1378
  }, z.core.$strip>;
1379
+ }, z.core.$strip>, z.ZodObject<{
1380
+ type: z.ZodLiteral<"DatetimeRange">;
1381
+ value: z.ZodObject<{
1382
+ gte: z.ZodOptional<z.ZodString>;
1383
+ lte: z.ZodOptional<z.ZodString>;
1384
+ gt: z.ZodOptional<z.ZodString>;
1385
+ lt: z.ZodOptional<z.ZodString>;
1386
+ }, z.core.$strip>;
1265
1387
  }, z.core.$strip>, z.ZodObject<{
1266
1388
  type: z.ZodLiteral<"GeoRadius">;
1267
1389
  value: z.ZodObject<{
@@ -1299,6 +1421,14 @@ declare const RecommendationsParamsSchema: z.ZodObject<{
1299
1421
  gt: z.ZodOptional<z.ZodNumber>;
1300
1422
  lt: z.ZodOptional<z.ZodNumber>;
1301
1423
  }, z.core.$strip>;
1424
+ }, z.core.$strip>, z.ZodObject<{
1425
+ type: z.ZodLiteral<"DatetimeRange">;
1426
+ value: z.ZodObject<{
1427
+ gte: z.ZodOptional<z.ZodString>;
1428
+ lte: z.ZodOptional<z.ZodString>;
1429
+ gt: z.ZodOptional<z.ZodString>;
1430
+ lt: z.ZodOptional<z.ZodString>;
1431
+ }, z.core.$strip>;
1302
1432
  }, z.core.$strip>, z.ZodObject<{
1303
1433
  type: z.ZodLiteral<"GeoRadius">;
1304
1434
  value: z.ZodObject<{
@@ -1321,6 +1451,14 @@ declare const RecommendationsParamsSchema: z.ZodObject<{
1321
1451
  gt: z.ZodOptional<z.ZodNumber>;
1322
1452
  lt: z.ZodOptional<z.ZodNumber>;
1323
1453
  }, z.core.$strip>;
1454
+ }, z.core.$strip>, z.ZodObject<{
1455
+ type: z.ZodLiteral<"DatetimeRange">;
1456
+ value: z.ZodObject<{
1457
+ gte: z.ZodOptional<z.ZodString>;
1458
+ lte: z.ZodOptional<z.ZodString>;
1459
+ gt: z.ZodOptional<z.ZodString>;
1460
+ lt: z.ZodOptional<z.ZodString>;
1461
+ }, z.core.$strip>;
1324
1462
  }, z.core.$strip>, z.ZodObject<{
1325
1463
  type: z.ZodLiteral<"GeoRadius">;
1326
1464
  value: z.ZodObject<{
@@ -1343,6 +1481,14 @@ declare const RecommendationsParamsSchema: z.ZodObject<{
1343
1481
  gt: z.ZodOptional<z.ZodNumber>;
1344
1482
  lt: z.ZodOptional<z.ZodNumber>;
1345
1483
  }, z.core.$strip>;
1484
+ }, z.core.$strip>, z.ZodObject<{
1485
+ type: z.ZodLiteral<"DatetimeRange">;
1486
+ value: z.ZodObject<{
1487
+ gte: z.ZodOptional<z.ZodString>;
1488
+ lte: z.ZodOptional<z.ZodString>;
1489
+ gt: z.ZodOptional<z.ZodString>;
1490
+ lt: z.ZodOptional<z.ZodString>;
1491
+ }, z.core.$strip>;
1346
1492
  }, z.core.$strip>, z.ZodObject<{
1347
1493
  type: z.ZodLiteral<"GeoRadius">;
1348
1494
  value: z.ZodObject<{
@@ -1389,6 +1535,14 @@ declare const SearchByImageParamsSchema: z.ZodObject<{
1389
1535
  gt: z.ZodOptional<z.ZodNumber>;
1390
1536
  lt: z.ZodOptional<z.ZodNumber>;
1391
1537
  }, z.core.$strip>;
1538
+ }, z.core.$strip>, z.ZodObject<{
1539
+ type: z.ZodLiteral<"DatetimeRange">;
1540
+ value: z.ZodObject<{
1541
+ gte: z.ZodOptional<z.ZodString>;
1542
+ lte: z.ZodOptional<z.ZodString>;
1543
+ gt: z.ZodOptional<z.ZodString>;
1544
+ lt: z.ZodOptional<z.ZodString>;
1545
+ }, z.core.$strip>;
1392
1546
  }, z.core.$strip>, z.ZodObject<{
1393
1547
  type: z.ZodLiteral<"GeoRadius">;
1394
1548
  value: z.ZodObject<{
@@ -1411,6 +1565,14 @@ declare const SearchByImageParamsSchema: z.ZodObject<{
1411
1565
  gt: z.ZodOptional<z.ZodNumber>;
1412
1566
  lt: z.ZodOptional<z.ZodNumber>;
1413
1567
  }, z.core.$strip>;
1568
+ }, z.core.$strip>, z.ZodObject<{
1569
+ type: z.ZodLiteral<"DatetimeRange">;
1570
+ value: z.ZodObject<{
1571
+ gte: z.ZodOptional<z.ZodString>;
1572
+ lte: z.ZodOptional<z.ZodString>;
1573
+ gt: z.ZodOptional<z.ZodString>;
1574
+ lt: z.ZodOptional<z.ZodString>;
1575
+ }, z.core.$strip>;
1414
1576
  }, z.core.$strip>, z.ZodObject<{
1415
1577
  type: z.ZodLiteral<"GeoRadius">;
1416
1578
  value: z.ZodObject<{
@@ -1433,6 +1595,14 @@ declare const SearchByImageParamsSchema: z.ZodObject<{
1433
1595
  gt: z.ZodOptional<z.ZodNumber>;
1434
1596
  lt: z.ZodOptional<z.ZodNumber>;
1435
1597
  }, z.core.$strip>;
1598
+ }, z.core.$strip>, z.ZodObject<{
1599
+ type: z.ZodLiteral<"DatetimeRange">;
1600
+ value: z.ZodObject<{
1601
+ gte: z.ZodOptional<z.ZodString>;
1602
+ lte: z.ZodOptional<z.ZodString>;
1603
+ gt: z.ZodOptional<z.ZodString>;
1604
+ lt: z.ZodOptional<z.ZodString>;
1605
+ }, z.core.$strip>;
1436
1606
  }, z.core.$strip>, z.ZodObject<{
1437
1607
  type: z.ZodLiteral<"GeoRadius">;
1438
1608
  value: z.ZodObject<{
@@ -1467,6 +1637,14 @@ declare const SearchByVectorParamsSchema: z.ZodObject<{
1467
1637
  gt: z.ZodOptional<z.ZodNumber>;
1468
1638
  lt: z.ZodOptional<z.ZodNumber>;
1469
1639
  }, z.core.$strip>;
1640
+ }, z.core.$strip>, z.ZodObject<{
1641
+ type: z.ZodLiteral<"DatetimeRange">;
1642
+ value: z.ZodObject<{
1643
+ gte: z.ZodOptional<z.ZodString>;
1644
+ lte: z.ZodOptional<z.ZodString>;
1645
+ gt: z.ZodOptional<z.ZodString>;
1646
+ lt: z.ZodOptional<z.ZodString>;
1647
+ }, z.core.$strip>;
1470
1648
  }, z.core.$strip>, z.ZodObject<{
1471
1649
  type: z.ZodLiteral<"GeoRadius">;
1472
1650
  value: z.ZodObject<{
@@ -1489,6 +1667,14 @@ declare const SearchByVectorParamsSchema: z.ZodObject<{
1489
1667
  gt: z.ZodOptional<z.ZodNumber>;
1490
1668
  lt: z.ZodOptional<z.ZodNumber>;
1491
1669
  }, z.core.$strip>;
1670
+ }, z.core.$strip>, z.ZodObject<{
1671
+ type: z.ZodLiteral<"DatetimeRange">;
1672
+ value: z.ZodObject<{
1673
+ gte: z.ZodOptional<z.ZodString>;
1674
+ lte: z.ZodOptional<z.ZodString>;
1675
+ gt: z.ZodOptional<z.ZodString>;
1676
+ lt: z.ZodOptional<z.ZodString>;
1677
+ }, z.core.$strip>;
1492
1678
  }, z.core.$strip>, z.ZodObject<{
1493
1679
  type: z.ZodLiteral<"GeoRadius">;
1494
1680
  value: z.ZodObject<{
@@ -1511,6 +1697,14 @@ declare const SearchByVectorParamsSchema: z.ZodObject<{
1511
1697
  gt: z.ZodOptional<z.ZodNumber>;
1512
1698
  lt: z.ZodOptional<z.ZodNumber>;
1513
1699
  }, z.core.$strip>;
1700
+ }, z.core.$strip>, z.ZodObject<{
1701
+ type: z.ZodLiteral<"DatetimeRange">;
1702
+ value: z.ZodObject<{
1703
+ gte: z.ZodOptional<z.ZodString>;
1704
+ lte: z.ZodOptional<z.ZodString>;
1705
+ gt: z.ZodOptional<z.ZodString>;
1706
+ lt: z.ZodOptional<z.ZodString>;
1707
+ }, z.core.$strip>;
1514
1708
  }, z.core.$strip>, z.ZodObject<{
1515
1709
  type: z.ZodLiteral<"GeoRadius">;
1516
1710
  value: z.ZodObject<{