shred-api-client 2.4.8 → 2.4.9

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.ts CHANGED
@@ -800,8 +800,11 @@ type QueryOrderBy<T> = {
800
800
  };
801
801
  type QueryWhere<T> = {
802
802
  field: keyof T | "modified";
803
- operation: "==" | "!=" | ">" | "<" | ">=" | "<=" | "in" | "array-contains";
804
- value: T[keyof T] | T[keyof T][];
803
+ operation: "==" | "!=" | ">" | "<" | ">=" | "<=" | "in" | "array-contains" | "between";
804
+ value: T[keyof T] | T[keyof T][] | {
805
+ from: number;
806
+ to: number;
807
+ };
805
808
  };
806
809
  type QueryOptions<T> = {
807
810
  perPage?: number;
package/dist/index.js CHANGED
@@ -4714,9 +4714,10 @@ var buildQueryString = (query) => {
4714
4714
  ];
4715
4715
  }
4716
4716
  if (query.wheres && query.wheres.length > 0) {
4717
- params["wheres"] = query.wheres.map(
4718
- (w) => `${String(w.field)}:${String(w.operation)}:${String(w.value)}`
4719
- );
4717
+ params["wheres"] = query.wheres.map((w) => {
4718
+ const value = w.operation === "between" ? `${w.value.from}|${w.value.to}` : String(w.value);
4719
+ return `${String(w.field)}:${String(w.operation)}:${value}`;
4720
+ });
4720
4721
  }
4721
4722
  const queryString = Object.entries(params).flatMap(
4722
4723
  ([key, values]) => values.map((value) => `${key}=${encodeURIComponent(value)}`)