@getsupervisor/agents-studio-sdk 1.41.2-patch.12 → 1.41.2-patch.14
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 +14 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +14 -2
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -1840,16 +1840,28 @@ function appendCondition(query, factory) {
|
|
|
1840
1840
|
}
|
|
1841
1841
|
return new import_api_query_builder.Query(factory);
|
|
1842
1842
|
}
|
|
1843
|
+
var DATE_ONLY = /^\d{4}-\d{2}-\d{2}$/;
|
|
1844
|
+
function toISOString(value) {
|
|
1845
|
+
const input = DATE_ONLY.test(value) ? `${value}T00:00:00` : value;
|
|
1846
|
+
const date = new Date(input);
|
|
1847
|
+
if (Number.isNaN(date.getTime())) {
|
|
1848
|
+
return value;
|
|
1849
|
+
}
|
|
1850
|
+
return date.toISOString();
|
|
1851
|
+
}
|
|
1843
1852
|
function buildUsageFilter(resource, from, to) {
|
|
1844
1853
|
let query;
|
|
1845
1854
|
if (resource) {
|
|
1846
1855
|
query = appendCondition(query, (qb) => qb.eq("resource", resource));
|
|
1847
1856
|
}
|
|
1848
1857
|
if (from) {
|
|
1849
|
-
query = appendCondition(
|
|
1858
|
+
query = appendCondition(
|
|
1859
|
+
query,
|
|
1860
|
+
(qb) => qb.mte("createdAt", toISOString(from))
|
|
1861
|
+
);
|
|
1850
1862
|
}
|
|
1851
1863
|
if (to) {
|
|
1852
|
-
query = appendCondition(query, (qb) => qb.lt("createdAt", to));
|
|
1864
|
+
query = appendCondition(query, (qb) => qb.lt("createdAt", toISOString(to)));
|
|
1853
1865
|
}
|
|
1854
1866
|
return query;
|
|
1855
1867
|
}
|