@exulu/backend 1.69.2 → 1.69.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.
|
@@ -892,6 +892,11 @@ function subtractDuration(date, duration) {
|
|
|
892
892
|
}
|
|
893
893
|
return new Date(date.getTime() - durationToDays(duration) * DAY_MS);
|
|
894
894
|
}
|
|
895
|
+
function subtractOneCalendarMonth(date) {
|
|
896
|
+
const result = new Date(date);
|
|
897
|
+
result.setUTCMonth(result.getUTCMonth() - 1);
|
|
898
|
+
return result;
|
|
899
|
+
}
|
|
895
900
|
function windowStartYmd(reset_at, duration) {
|
|
896
901
|
const now = Date.now();
|
|
897
902
|
const reset = reset_at ? new Date(reset_at) : null;
|
|
@@ -899,7 +904,7 @@ function windowStartYmd(reset_at, duration) {
|
|
|
899
904
|
const trailingStart = subtractDuration(new Date(now), duration);
|
|
900
905
|
if (resetMs !== null) {
|
|
901
906
|
if (resetMs > now) {
|
|
902
|
-
const periodStart = subtractDuration(reset, duration);
|
|
907
|
+
const periodStart = reset.getUTCDate() === 1 ? subtractOneCalendarMonth(reset) : subtractDuration(reset, duration);
|
|
903
908
|
return ymd(periodStart > trailingStart ? periodStart : trailingStart);
|
|
904
909
|
} else {
|
|
905
910
|
return ymd(reset > trailingStart ? reset : trailingStart);
|
|
@@ -1630,7 +1635,7 @@ var ExuluTool = class _ExuluTool {
|
|
|
1630
1635
|
});
|
|
1631
1636
|
providerapikey = resolved.apiKey;
|
|
1632
1637
|
}
|
|
1633
|
-
const { convertExuluToolsToAiSdkTools: convertExuluToolsToAiSdkTools2 } = await import("./convert-exulu-tools-to-ai-sdk-tools-
|
|
1638
|
+
const { convertExuluToolsToAiSdkTools: convertExuluToolsToAiSdkTools2 } = await import("./convert-exulu-tools-to-ai-sdk-tools-GQ3UIYP7.js");
|
|
1634
1639
|
const tools = await convertExuluToolsToAiSdkTools2(
|
|
1635
1640
|
[this],
|
|
1636
1641
|
[],
|
package/dist/index.cjs
CHANGED
|
@@ -2758,6 +2758,11 @@ function subtractDuration(date, duration) {
|
|
|
2758
2758
|
}
|
|
2759
2759
|
return new Date(date.getTime() - durationToDays(duration) * DAY_MS);
|
|
2760
2760
|
}
|
|
2761
|
+
function subtractOneCalendarMonth(date) {
|
|
2762
|
+
const result = new Date(date);
|
|
2763
|
+
result.setUTCMonth(result.getUTCMonth() - 1);
|
|
2764
|
+
return result;
|
|
2765
|
+
}
|
|
2761
2766
|
function windowStartYmd(reset_at, duration) {
|
|
2762
2767
|
const now = Date.now();
|
|
2763
2768
|
const reset = reset_at ? new Date(reset_at) : null;
|
|
@@ -2765,7 +2770,7 @@ function windowStartYmd(reset_at, duration) {
|
|
|
2765
2770
|
const trailingStart = subtractDuration(new Date(now), duration);
|
|
2766
2771
|
if (resetMs !== null) {
|
|
2767
2772
|
if (resetMs > now) {
|
|
2768
|
-
const periodStart = subtractDuration(reset, duration);
|
|
2773
|
+
const periodStart = reset.getUTCDate() === 1 ? subtractOneCalendarMonth(reset) : subtractDuration(reset, duration);
|
|
2769
2774
|
return ymd(periodStart > trailingStart ? periodStart : trailingStart);
|
|
2770
2775
|
} else {
|
|
2771
2776
|
return ymd(reset > trailingStart ? reset : trailingStart);
|
package/dist/index.js
CHANGED