@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.cjs CHANGED
@@ -809,6 +809,15 @@ var FilterConditionSchema = zod.z.object({
809
809
  lt: zod.z.number().optional()
810
810
  })
811
811
  }),
812
+ zod.z.object({
813
+ type: zod.z.literal("DatetimeRange"),
814
+ value: zod.z.object({
815
+ gte: zod.z.string().optional(),
816
+ lte: zod.z.string().optional(),
817
+ gt: zod.z.string().optional(),
818
+ lt: zod.z.string().optional()
819
+ })
820
+ }),
812
821
  zod.z.object({
813
822
  type: zod.z.literal("GeoRadius"),
814
823
  value: zod.z.object({
@@ -1611,6 +1620,44 @@ var FilterBuilder = class {
1611
1620
  else this.must_not.push(condition);
1612
1621
  return this;
1613
1622
  }
1623
+ /**
1624
+ * add datetime range filter condition
1625
+ *
1626
+ * filters items where datetime field falls within specified range.
1627
+ * values should be RFC 3339 formatted strings (e.g., "2025-12-15T00:00:00Z").
1628
+ *
1629
+ * @param field - datetime field name to filter on
1630
+ * @param value - range specification with operators (RFC 3339 strings)
1631
+ * @param value.gte - greater than or equal to
1632
+ * @param value.lte - less than or equal to
1633
+ * @param value.gt - greater than
1634
+ * @param value.lt - less than
1635
+ * @param type - filter type: "must", "should", or "must_not". default: "must"
1636
+ *
1637
+ * @returns this filter builder for method chaining
1638
+ *
1639
+ * @example
1640
+ * ```typescript
1641
+ * // events between two dates
1642
+ * builder.datetimeRange("start_date", {
1643
+ * gte: "2025-12-15T00:00:00Z",
1644
+ * lte: "2025-12-31T23:59:59Z"
1645
+ * });
1646
+ *
1647
+ * // events after a specific date
1648
+ * builder.datetimeRange("created_at", { gt: "2025-01-01T00:00:00Z" });
1649
+ * ```
1650
+ */
1651
+ datetimeRange(field, value, type = "must") {
1652
+ const condition = {
1653
+ field,
1654
+ condition: { type: "DatetimeRange", value }
1655
+ };
1656
+ if (type === "must") this.must.push(condition);
1657
+ else if (type === "should") this.should.push(condition);
1658
+ else this.must_not.push(condition);
1659
+ return this;
1660
+ }
1614
1661
  /**
1615
1662
  * add geo-radius filter condition
1616
1663
  *