hierarchical-approval 4.1.3 → 4.1.4
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/CHANGELOG.md +12 -0
- package/dist/index.cjs +6 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +6 -3
- package/dist/index.js.map +1 -1
- package/dist/plugins/scheduler.cjs +26 -2
- package/dist/plugins/scheduler.cjs.map +1 -1
- package/dist/plugins/scheduler.js +26 -2
- package/dist/plugins/scheduler.js.map +1 -1
- package/package.json +9 -9
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,18 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
|
5
5
|
|
|
6
6
|
## [Unreleased]
|
|
7
7
|
|
|
8
|
+
## [4.1.4] - 2026-11-01
|
|
9
|
+
|
|
10
|
+
### Changed
|
|
11
|
+
|
|
12
|
+
- `InMemorySchedulerAdapter.scheduleAt` now rejects after `shutdown()` with an `ApprovalError`
|
|
13
|
+
(code `SCHEDULER_SHUTDOWN`) instead of a plain `Error`; the message is unchanged.
|
|
14
|
+
|
|
15
|
+
### Fixed
|
|
16
|
+
|
|
17
|
+
- `weekendCalendar` and `businessHoursCalendar` now report an invalid start date as `Invalid Date`
|
|
18
|
+
in their `ApprovalValidationError` messages instead of failing with a bare `RangeError`.
|
|
19
|
+
|
|
8
20
|
## [4.1.3] - 2026-10-28
|
|
9
21
|
|
|
10
22
|
### Fixed
|
package/dist/index.cjs
CHANGED
|
@@ -5226,6 +5226,9 @@ function parseOrThrow(fn) {
|
|
|
5226
5226
|
var DAY_MS = 864e5;
|
|
5227
5227
|
var MAX_SCAN_DAYS = 3660;
|
|
5228
5228
|
var MAX_BUSINESS_DAYS = 36600;
|
|
5229
|
+
function describeDate(d) {
|
|
5230
|
+
return Number.isNaN(d.getTime()) ? "Invalid Date" : d.toISOString();
|
|
5231
|
+
}
|
|
5229
5232
|
function dayKey(d) {
|
|
5230
5233
|
const y = d.getFullYear();
|
|
5231
5234
|
const m = String(d.getMonth() + 1).padStart(2, "0");
|
|
@@ -5241,7 +5244,7 @@ function weekendCalendar(options = {}) {
|
|
|
5241
5244
|
if (days <= 0 || Number.isNaN(days)) return new Date(from.getTime());
|
|
5242
5245
|
if (days > MAX_BUSINESS_DAYS) {
|
|
5243
5246
|
throw new ApprovalValidationError(
|
|
5244
|
-
`weekendCalendar: cannot add ${days} business days to ${from
|
|
5247
|
+
`weekendCalendar: cannot add ${days} business days to ${describeDate(from)} \u2014 days must be at most ${MAX_BUSINESS_DAYS}.`
|
|
5245
5248
|
);
|
|
5246
5249
|
}
|
|
5247
5250
|
const whole = Math.floor(days);
|
|
@@ -5258,7 +5261,7 @@ function weekendCalendar(options = {}) {
|
|
|
5258
5261
|
}
|
|
5259
5262
|
if (++idleDays >= MAX_SCAN_DAYS) {
|
|
5260
5263
|
throw new ApprovalValidationError(
|
|
5261
|
-
`weekendCalendar: no business day found within 10 years of ${from
|
|
5264
|
+
`weekendCalendar: no business day found within 10 years of ${describeDate(from)} \u2014 check weekendDays and holidays.`
|
|
5262
5265
|
);
|
|
5263
5266
|
}
|
|
5264
5267
|
}
|
|
@@ -5305,7 +5308,7 @@ function businessHoursCalendar(options = {}) {
|
|
|
5305
5308
|
return cursor;
|
|
5306
5309
|
}
|
|
5307
5310
|
throw new ApprovalValidationError(
|
|
5308
|
-
`businessHoursCalendar: no working day found within 10 years of ${from
|
|
5311
|
+
`businessHoursCalendar: no working day found within 10 years of ${describeDate(from)} \u2014 check weekendDays and holidays.`
|
|
5309
5312
|
);
|
|
5310
5313
|
};
|
|
5311
5314
|
const base = weekendCalendar(options);
|