hierarchical-approval 4.0.4 → 4.0.5
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 +24 -0
- package/dist/{ApprovalEngine-D0_F5OPZ.d.cts → ApprovalEngine-BaJ2PNB7.d.cts} +7 -6
- package/dist/{ApprovalEngine-D4bXQrKD.d.ts → ApprovalEngine-CeBKYLz4.d.ts} +7 -6
- package/dist/{IAuditAdapter-D9WE0t7A.d.cts → IAuditAdapter-Dqpkg-Tz.d.cts} +1 -1
- package/dist/{IAuditAdapter-FI_RF_XU.d.ts → IAuditAdapter-ggCTPf02.d.ts} +1 -1
- package/dist/{IAuthorizationPolicy-BKKw7jGN.d.ts → IAuthorizationPolicy-BUHKvalu.d.ts} +1 -1
- package/dist/{IAuthorizationPolicy-DDmjeYV-.d.cts → IAuthorizationPolicy-D5mAFBTC.d.cts} +1 -1
- package/dist/{INotificationAdapter-CLROEfRd.d.ts → INotificationAdapter-B_9JFH1i.d.ts} +1 -1
- package/dist/{INotificationAdapter-J0wSPLIC.d.cts → INotificationAdapter-D9IOl9G_.d.cts} +1 -1
- package/dist/{IOperationMiddleware-B32a2dwP.d.ts → IOperationMiddleware-C-N8MpHV.d.ts} +1 -1
- package/dist/{IOperationMiddleware-UUKqztxM.d.cts → IOperationMiddleware-CsF_xD4b.d.cts} +1 -1
- package/dist/{IStorageAdapter-Dhrc4ES6.d.cts → IStorageAdapter-CrbVtEE-.d.cts} +1 -1
- package/dist/{IStorageAdapter-DSKJ1onF.d.ts → IStorageAdapter-DDOW9z0L.d.ts} +1 -1
- package/dist/adapters/MemoryAdapter.d.cts +2 -2
- package/dist/adapters/MemoryAdapter.d.ts +2 -2
- package/dist/adapters/PostgresAdapter.d.cts +2 -2
- package/dist/adapters/PostgresAdapter.d.ts +2 -2
- package/dist/index.cjs +8 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +8 -8
- package/dist/index.d.ts +8 -8
- package/dist/index.js +8 -8
- package/dist/index.js.map +1 -1
- package/dist/{instance-CUZcHWK2.d.cts → instance-Cu6-qPxs.d.cts} +18 -0
- package/dist/{instance-CUZcHWK2.d.ts → instance-Cu6-qPxs.d.ts} +18 -0
- package/dist/nestjs.cjs +5 -5
- package/dist/nestjs.cjs.map +1 -1
- package/dist/nestjs.d.cts +7 -7
- package/dist/nestjs.d.ts +7 -7
- package/dist/nestjs.js +5 -5
- package/dist/nestjs.js.map +1 -1
- package/dist/plugins/audit.cjs +30 -1
- package/dist/plugins/audit.cjs.map +1 -1
- package/dist/plugins/audit.d.cts +4 -4
- package/dist/plugins/audit.d.ts +4 -4
- package/dist/plugins/audit.js +30 -1
- package/dist/plugins/audit.js.map +1 -1
- package/dist/plugins/notify.cjs +30 -1
- package/dist/plugins/notify.cjs.map +1 -1
- package/dist/plugins/notify.d.cts +2 -2
- package/dist/plugins/notify.d.ts +2 -2
- package/dist/plugins/notify.js +30 -1
- package/dist/plugins/notify.js.map +1 -1
- package/dist/plugins/resilience.cjs +11 -4
- package/dist/plugins/resilience.cjs.map +1 -1
- package/dist/plugins/resilience.d.cts +3 -3
- package/dist/plugins/resilience.d.ts +3 -3
- package/dist/plugins/resilience.js +11 -4
- package/dist/plugins/resilience.js.map +1 -1
- package/dist/plugins/tracing.d.cts +2 -2
- package/dist/plugins/tracing.d.ts +2 -2
- package/dist/plugins/webhook.d.cts +2 -2
- package/dist/plugins/webhook.d.ts +2 -2
- package/dist/testing.cjs +5 -5
- package/dist/testing.cjs.map +1 -1
- package/dist/testing.d.cts +7 -7
- package/dist/testing.d.ts +7 -7
- package/dist/testing.js +5 -5
- package/dist/testing.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,8 +5,32 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
|
5
5
|
|
|
6
6
|
## [Unreleased]
|
|
7
7
|
|
|
8
|
+
## [4.0.5] - 2026-09-25
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
|
|
12
|
+
- `RateLimitMiddleware`'s constructor validation now throws
|
|
13
|
+
`ApprovalValidationError`, instead of a plain `Error` a caller catching
|
|
14
|
+
`ApprovalValidationError` to distinguish config problems would miss.
|
|
15
|
+
- `DigestNotificationAdapter`'s `intervalMs` validation now throws
|
|
16
|
+
`ApprovalValidationError` for the same reason.
|
|
17
|
+
- `HashChainAuditAdapter`'s missing-`reader` validation now throws
|
|
18
|
+
`ApprovalValidationError` for the same reason.
|
|
19
|
+
- `businessHoursCalendar`'s three configuration guards now throw
|
|
20
|
+
`ApprovalValidationError` for the same reason.
|
|
21
|
+
|
|
8
22
|
## [4.0.4] - 2026-09-24
|
|
9
23
|
|
|
24
|
+
### Fixed
|
|
25
|
+
|
|
26
|
+
- `resubmit`'s duplicate-level error now names the offending level numbers,
|
|
27
|
+
instead of a message that gave no clue which levels collided.
|
|
28
|
+
- `purgeInstances`'s date-validation error now names the offending value,
|
|
29
|
+
instead of a message that gave no clue which value failed.
|
|
30
|
+
- `delegate`'s, `reassign`'s, and `override`'s self-action guards now name
|
|
31
|
+
the offending id, matching every sibling guard in the same methods that
|
|
32
|
+
already named theirs.
|
|
33
|
+
|
|
10
34
|
## [4.0.3] - 2026-09-22
|
|
11
35
|
|
|
12
36
|
### Fixed
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { I as IStorageAdapter, P as PaginationOpts, a as PaginatedResult, b as InstanceFilter, C as CursorPaginationOpts, c as CursorPaginatedResult } from './IStorageAdapter-
|
|
2
|
-
import { m as ConditionExpression, r as ResolverFn, g as ApprovalTemplateConfig, A as ApprovalTemplate, k as AuditContext, a as ApprovalInstance, C as Comment, e as ApprovalMode, f as ApprovalStatus, L as LevelStatus, b as AuditEntry } from './instance-
|
|
3
|
-
import { I as INotificationAdapter, b as ApprovalEventName, a as ApprovalEventMap } from './INotificationAdapter-
|
|
1
|
+
import { I as IStorageAdapter, P as PaginationOpts, a as PaginatedResult, b as InstanceFilter, C as CursorPaginationOpts, c as CursorPaginatedResult } from './IStorageAdapter-CrbVtEE-.cjs';
|
|
2
|
+
import { m as ConditionExpression, r as ResolverFn, g as ApprovalTemplateConfig, A as ApprovalTemplate, k as AuditContext, a as ApprovalInstance, C as Comment, e as ApprovalMode, f as ApprovalStatus, L as LevelStatus, b as AuditEntry } from './instance-Cu6-qPxs.cjs';
|
|
3
|
+
import { I as INotificationAdapter, b as ApprovalEventName, a as ApprovalEventMap } from './INotificationAdapter-D9IOl9G_.cjs';
|
|
4
4
|
import { z } from 'zod';
|
|
5
5
|
import { L as Logger } from './Logger-hqFbBCtB.cjs';
|
|
6
6
|
import { C as Clock } from './Clock-D8Qp39q_.cjs';
|
|
7
|
-
import { I as IOperationMiddleware, a as ApprovalError } from './IOperationMiddleware-
|
|
8
|
-
import { I as IAuditAdapter } from './IAuditAdapter-
|
|
7
|
+
import { I as IOperationMiddleware, a as ApprovalError } from './IOperationMiddleware-CsF_xD4b.cjs';
|
|
8
|
+
import { I as IAuditAdapter } from './IAuditAdapter-Dqpkg-Tz.cjs';
|
|
9
9
|
import { I as IMetricsAdapter } from './IMetricsAdapter-WROxYSXd.cjs';
|
|
10
10
|
import { I as ISchedulerAdapter } from './ISchedulerAdapter-CLMdBA-5.cjs';
|
|
11
|
-
import { I as IAuthorizationPolicy } from './IAuthorizationPolicy-
|
|
11
|
+
import { I as IAuthorizationPolicy } from './IAuthorizationPolicy-D5mAFBTC.cjs';
|
|
12
12
|
|
|
13
13
|
declare const SubmitOptionsSchema: z.ZodObject<{
|
|
14
14
|
templateName: z.ZodString;
|
|
@@ -587,6 +587,7 @@ interface ApprovalEngineOptions {
|
|
|
587
587
|
*/
|
|
588
588
|
outOfOfficeProvider?: OutOfOfficeProvider;
|
|
589
589
|
logger?: Logger;
|
|
590
|
+
/** Interval, in milliseconds, between automatic escalation sweeps. Default: 60000 (1 minute). */
|
|
590
591
|
escalationPollIntervalMs?: number;
|
|
591
592
|
/** Maximum number of instances allowed in a single bulk operation. Default: 200. */
|
|
592
593
|
maxBulkItems?: number;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { I as IStorageAdapter, P as PaginationOpts, a as PaginatedResult, b as InstanceFilter, C as CursorPaginationOpts, c as CursorPaginatedResult } from './IStorageAdapter-
|
|
2
|
-
import { m as ConditionExpression, r as ResolverFn, g as ApprovalTemplateConfig, A as ApprovalTemplate, k as AuditContext, a as ApprovalInstance, C as Comment, e as ApprovalMode, f as ApprovalStatus, L as LevelStatus, b as AuditEntry } from './instance-
|
|
3
|
-
import { I as INotificationAdapter, b as ApprovalEventName, a as ApprovalEventMap } from './INotificationAdapter-
|
|
1
|
+
import { I as IStorageAdapter, P as PaginationOpts, a as PaginatedResult, b as InstanceFilter, C as CursorPaginationOpts, c as CursorPaginatedResult } from './IStorageAdapter-DDOW9z0L.js';
|
|
2
|
+
import { m as ConditionExpression, r as ResolverFn, g as ApprovalTemplateConfig, A as ApprovalTemplate, k as AuditContext, a as ApprovalInstance, C as Comment, e as ApprovalMode, f as ApprovalStatus, L as LevelStatus, b as AuditEntry } from './instance-Cu6-qPxs.js';
|
|
3
|
+
import { I as INotificationAdapter, b as ApprovalEventName, a as ApprovalEventMap } from './INotificationAdapter-B_9JFH1i.js';
|
|
4
4
|
import { z } from 'zod';
|
|
5
5
|
import { L as Logger } from './Logger-hqFbBCtB.js';
|
|
6
6
|
import { C as Clock } from './Clock-D8Qp39q_.js';
|
|
7
|
-
import { I as IOperationMiddleware, a as ApprovalError } from './IOperationMiddleware-
|
|
8
|
-
import { I as IAuditAdapter } from './IAuditAdapter-
|
|
7
|
+
import { I as IOperationMiddleware, a as ApprovalError } from './IOperationMiddleware-C-N8MpHV.js';
|
|
8
|
+
import { I as IAuditAdapter } from './IAuditAdapter-ggCTPf02.js';
|
|
9
9
|
import { I as IMetricsAdapter } from './IMetricsAdapter-WROxYSXd.js';
|
|
10
10
|
import { I as ISchedulerAdapter } from './ISchedulerAdapter-CLMdBA-5.js';
|
|
11
|
-
import { I as IAuthorizationPolicy } from './IAuthorizationPolicy-
|
|
11
|
+
import { I as IAuthorizationPolicy } from './IAuthorizationPolicy-BUHKvalu.js';
|
|
12
12
|
|
|
13
13
|
declare const SubmitOptionsSchema: z.ZodObject<{
|
|
14
14
|
templateName: z.ZodString;
|
|
@@ -587,6 +587,7 @@ interface ApprovalEngineOptions {
|
|
|
587
587
|
*/
|
|
588
588
|
outOfOfficeProvider?: OutOfOfficeProvider;
|
|
589
589
|
logger?: Logger;
|
|
590
|
+
/** Interval, in milliseconds, between automatic escalation sweeps. Default: 60000 (1 minute). */
|
|
590
591
|
escalationPollIntervalMs?: number;
|
|
591
592
|
/** Maximum number of instances allowed in a single bulk operation. Default: 200. */
|
|
592
593
|
maxBulkItems?: number;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { b as AuditEntry, a as ApprovalInstance } from './instance-
|
|
1
|
+
import { b as AuditEntry, a as ApprovalInstance } from './instance-Cu6-qPxs.cjs';
|
|
2
2
|
|
|
3
3
|
/** Secondary write sink for audit entries, alongside the primary storage adapter. */
|
|
4
4
|
interface IAuditAdapter {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { b as AuditEntry, a as ApprovalInstance } from './instance-
|
|
1
|
+
import { b as AuditEntry, a as ApprovalInstance } from './instance-Cu6-qPxs.js';
|
|
2
2
|
|
|
3
3
|
/** Secondary write sink for audit entries, alongside the primary storage adapter. */
|
|
4
4
|
interface IAuditAdapter {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as ApprovalInstance, d as ApprovalLevelInstance } from './instance-
|
|
1
|
+
import { a as ApprovalInstance, d as ApprovalLevelInstance } from './instance-Cu6-qPxs.js';
|
|
2
2
|
|
|
3
3
|
interface AuthorizationContext {
|
|
4
4
|
/** The engine method the actor is attempting to call. */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as ApprovalInstance, d as ApprovalLevelInstance } from './instance-
|
|
1
|
+
import { a as ApprovalInstance, d as ApprovalLevelInstance } from './instance-Cu6-qPxs.cjs';
|
|
2
2
|
|
|
3
3
|
interface AuthorizationContext {
|
|
4
4
|
/** The engine method the actor is attempting to call. */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as ApprovalInstance, b as AuditEntry } from './instance-
|
|
1
|
+
import { a as ApprovalInstance, b as AuditEntry } from './instance-Cu6-qPxs.js';
|
|
2
2
|
|
|
3
3
|
/** Common fields carried by every lifecycle event emitted for an approval instance. */
|
|
4
4
|
interface ApprovalEvent {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as ApprovalInstance, b as AuditEntry } from './instance-
|
|
1
|
+
import { a as ApprovalInstance, b as AuditEntry } from './instance-Cu6-qPxs.cjs';
|
|
2
2
|
|
|
3
3
|
/** Common fields carried by every lifecycle event emitted for an approval instance. */
|
|
4
4
|
interface ApprovalEvent {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as ApprovalInstance } from './instance-
|
|
1
|
+
import { a as ApprovalInstance } from './instance-Cu6-qPxs.js';
|
|
2
2
|
|
|
3
3
|
/** Base class for all errors thrown by this library; carries a stable machine-readable `code`. */
|
|
4
4
|
declare class ApprovalError extends Error {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as ApprovalInstance } from './instance-
|
|
1
|
+
import { a as ApprovalInstance } from './instance-Cu6-qPxs.cjs';
|
|
2
2
|
|
|
3
3
|
/** Base class for all errors thrown by this library; carries a stable machine-readable `code`. */
|
|
4
4
|
declare class ApprovalError extends Error {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as ApprovalTemplate, a as ApprovalInstance, f as ApprovalStatus, b as AuditEntry } from './instance-
|
|
1
|
+
import { A as ApprovalTemplate, a as ApprovalInstance, f as ApprovalStatus, b as AuditEntry } from './instance-Cu6-qPxs.cjs';
|
|
2
2
|
|
|
3
3
|
/** Offset-based pagination request. */
|
|
4
4
|
interface PaginationOpts {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as ApprovalTemplate, a as ApprovalInstance, f as ApprovalStatus, b as AuditEntry } from './instance-
|
|
1
|
+
import { A as ApprovalTemplate, a as ApprovalInstance, f as ApprovalStatus, b as AuditEntry } from './instance-Cu6-qPxs.js';
|
|
2
2
|
|
|
3
3
|
/** Offset-based pagination request. */
|
|
4
4
|
interface PaginationOpts {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { I as IStorageAdapter, P as PaginationOpts, a as PaginatedResult, b as InstanceFilter, C as CursorPaginationOpts, c as CursorPaginatedResult } from '../IStorageAdapter-
|
|
2
|
-
import { A as ApprovalTemplate, a as ApprovalInstance, b as AuditEntry } from '../instance-
|
|
1
|
+
import { I as IStorageAdapter, P as PaginationOpts, a as PaginatedResult, b as InstanceFilter, C as CursorPaginationOpts, c as CursorPaginatedResult } from '../IStorageAdapter-CrbVtEE-.cjs';
|
|
2
|
+
import { A as ApprovalTemplate, a as ApprovalInstance, b as AuditEntry } from '../instance-Cu6-qPxs.cjs';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* In-process {@link IStorageAdapter} backed by two `Map`s, keyed by
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { I as IStorageAdapter, P as PaginationOpts, a as PaginatedResult, b as InstanceFilter, C as CursorPaginationOpts, c as CursorPaginatedResult } from '../IStorageAdapter-
|
|
2
|
-
import { A as ApprovalTemplate, a as ApprovalInstance, b as AuditEntry } from '../instance-
|
|
1
|
+
import { I as IStorageAdapter, P as PaginationOpts, a as PaginatedResult, b as InstanceFilter, C as CursorPaginationOpts, c as CursorPaginatedResult } from '../IStorageAdapter-DDOW9z0L.js';
|
|
2
|
+
import { A as ApprovalTemplate, a as ApprovalInstance, b as AuditEntry } from '../instance-Cu6-qPxs.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* In-process {@link IStorageAdapter} backed by two `Map`s, keyed by
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as tls from 'tls';
|
|
2
2
|
import * as pg from 'pg';
|
|
3
|
-
import { I as IStorageAdapter, P as PaginationOpts, a as PaginatedResult, b as InstanceFilter, C as CursorPaginationOpts, c as CursorPaginatedResult } from '../IStorageAdapter-
|
|
4
|
-
import { A as ApprovalTemplate, a as ApprovalInstance, b as AuditEntry } from '../instance-
|
|
3
|
+
import { I as IStorageAdapter, P as PaginationOpts, a as PaginatedResult, b as InstanceFilter, C as CursorPaginationOpts, c as CursorPaginatedResult } from '../IStorageAdapter-CrbVtEE-.cjs';
|
|
4
|
+
import { A as ApprovalTemplate, a as ApprovalInstance, b as AuditEntry } from '../instance-Cu6-qPxs.cjs';
|
|
5
5
|
|
|
6
6
|
interface PostgresAdapterOptions {
|
|
7
7
|
connectionString?: string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as tls from 'tls';
|
|
2
2
|
import * as pg from 'pg';
|
|
3
|
-
import { I as IStorageAdapter, P as PaginationOpts, a as PaginatedResult, b as InstanceFilter, C as CursorPaginationOpts, c as CursorPaginatedResult } from '../IStorageAdapter-
|
|
4
|
-
import { A as ApprovalTemplate, a as ApprovalInstance, b as AuditEntry } from '../instance-
|
|
3
|
+
import { I as IStorageAdapter, P as PaginationOpts, a as PaginatedResult, b as InstanceFilter, C as CursorPaginationOpts, c as CursorPaginatedResult } from '../IStorageAdapter-DDOW9z0L.js';
|
|
4
|
+
import { A as ApprovalTemplate, a as ApprovalInstance, b as AuditEntry } from '../instance-Cu6-qPxs.js';
|
|
5
5
|
|
|
6
6
|
interface PostgresAdapterOptions {
|
|
7
7
|
connectionString?: string;
|
package/dist/index.cjs
CHANGED
|
@@ -674,7 +674,7 @@ var LevelResolver = class {
|
|
|
674
674
|
break;
|
|
675
675
|
case "role": {
|
|
676
676
|
if (!orgProvider) {
|
|
677
|
-
throw new
|
|
677
|
+
throw new ApprovalValidationError(
|
|
678
678
|
`Cannot resolve role "${approver.role}" without an orgProvider configured on ApprovalEngine.`
|
|
679
679
|
);
|
|
680
680
|
}
|
|
@@ -689,7 +689,7 @@ var LevelResolver = class {
|
|
|
689
689
|
approver.resolver
|
|
690
690
|
);
|
|
691
691
|
if (!fn) {
|
|
692
|
-
throw new
|
|
692
|
+
throw new ApprovalValidationError(
|
|
693
693
|
`No resolver registered for "${approver.resolver}". Call engine.registerResolver("${approver.resolver}", fn) first.`
|
|
694
694
|
);
|
|
695
695
|
}
|
|
@@ -2573,7 +2573,7 @@ var ApprovalEngine = class _ApprovalEngine {
|
|
|
2573
2573
|
assertStatus(instance, "pending");
|
|
2574
2574
|
if (instance.infoRequest) {
|
|
2575
2575
|
throw new ApprovalError(
|
|
2576
|
-
`A clarification request is already open on
|
|
2576
|
+
`A clarification request is already open on instance "${instance.id}" (asked by "${instance.infoRequest.askedBy}"). Answer it with provideInfo() first.`,
|
|
2577
2577
|
"INFO_ALREADY_REQUESTED"
|
|
2578
2578
|
);
|
|
2579
2579
|
}
|
|
@@ -2660,7 +2660,7 @@ var ApprovalEngine = class _ApprovalEngine {
|
|
|
2660
2660
|
const open = instance.infoRequest;
|
|
2661
2661
|
if (!open) {
|
|
2662
2662
|
throw new ApprovalError(
|
|
2663
|
-
|
|
2663
|
+
`No clarification request is open on instance "${instance.id}".`,
|
|
2664
2664
|
"NO_INFO_REQUESTED"
|
|
2665
2665
|
);
|
|
2666
2666
|
}
|
|
@@ -4533,7 +4533,7 @@ var ApprovalEngine = class _ApprovalEngine {
|
|
|
4533
4533
|
const pending = this.pendingLevels(instance);
|
|
4534
4534
|
if (pending.length === 0) {
|
|
4535
4535
|
throw new ApprovalError(
|
|
4536
|
-
`Instance has no level awaiting a decision (status: ${instance.status}).`,
|
|
4536
|
+
`Instance "${instance.id}" has no level awaiting a decision (status: ${instance.status}).`,
|
|
4537
4537
|
"INVALID_LEVEL"
|
|
4538
4538
|
);
|
|
4539
4539
|
}
|
|
@@ -5179,7 +5179,7 @@ function businessHoursCalendar(options = {}) {
|
|
|
5179
5179
|
const startHour = options.workdayStartHour ?? 9;
|
|
5180
5180
|
const endHour = options.workdayEndHour ?? 17;
|
|
5181
5181
|
if (!(endHour > startHour)) {
|
|
5182
|
-
throw new
|
|
5182
|
+
throw new ApprovalValidationError(
|
|
5183
5183
|
`businessHoursCalendar: workdayEndHour (${endHour}) must be greater than workdayStartHour (${startHour}).`
|
|
5184
5184
|
);
|
|
5185
5185
|
}
|
|
@@ -5212,7 +5212,7 @@ function businessHoursCalendar(options = {}) {
|
|
|
5212
5212
|
}
|
|
5213
5213
|
return cursor;
|
|
5214
5214
|
}
|
|
5215
|
-
throw new
|
|
5215
|
+
throw new ApprovalValidationError(
|
|
5216
5216
|
`businessHoursCalendar: no working day found within 10 years of ${from.toISOString()} \u2014 check weekendDays and holidays.`
|
|
5217
5217
|
);
|
|
5218
5218
|
};
|
|
@@ -5235,7 +5235,7 @@ function businessHoursCalendar(options = {}) {
|
|
|
5235
5235
|
next.setHours(startHour, 0, 0, 0);
|
|
5236
5236
|
cursor = toWorkingMoment(next);
|
|
5237
5237
|
}
|
|
5238
|
-
throw new
|
|
5238
|
+
throw new ApprovalValidationError(
|
|
5239
5239
|
`businessHoursCalendar: ${hours} working hours could not be scheduled within 10 years \u2014 check weekendDays and holidays.`
|
|
5240
5240
|
);
|
|
5241
5241
|
}
|