hierarchical-approval 1.4.0 → 1.5.0

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.
Files changed (57) hide show
  1. package/CHANGELOG.md +37 -0
  2. package/README.md +30 -0
  3. package/dist/{ApprovalEngine-NN6Dqf6E.d.ts → ApprovalEngine-CyZJDbjP.d.ts} +54 -8
  4. package/dist/{ApprovalEngine-D8kKuapR.d.cts → ApprovalEngine-SI-IRUMY.d.cts} +54 -8
  5. package/dist/{IAuditAdapter-B2I3CjaJ.d.cts → IAuditAdapter-Cr0dLoVP.d.cts} +1 -1
  6. package/dist/{IAuditAdapter-GixC9zS1.d.ts → IAuditAdapter-wfOcN3Zf.d.ts} +1 -1
  7. package/dist/{IAuthorizationPolicy-BHDZK9QL.d.cts → IAuthorizationPolicy-BHybAsq5.d.cts} +2 -2
  8. package/dist/{IAuthorizationPolicy-4ge9Gnxj.d.ts → IAuthorizationPolicy-CdvoZsGC.d.ts} +2 -2
  9. package/dist/{IMetricsAdapter-QvyaKQCc.d.cts → IMetricsAdapter-JZVK3QUq.d.cts} +1 -1
  10. package/dist/{IMetricsAdapter-QvyaKQCc.d.ts → IMetricsAdapter-JZVK3QUq.d.ts} +1 -1
  11. package/dist/{INotificationAdapter-BmSeB7FZ.d.ts → INotificationAdapter-Cn-LNPtD.d.cts} +22 -2
  12. package/dist/{INotificationAdapter-BKMeGmaG.d.cts → INotificationAdapter-Cyo0cvXU.d.ts} +22 -2
  13. package/dist/{IOperationMiddleware-BLw9Oc-S.d.cts → IOperationMiddleware-DrJy9UtL.d.cts} +1 -1
  14. package/dist/{IOperationMiddleware-BW9t8wPn.d.ts → IOperationMiddleware-rx7XAPrW.d.ts} +1 -1
  15. package/dist/{IStorageAdapter-DVclp9cn.d.ts → IStorageAdapter-CXRyeUOK.d.ts} +1 -1
  16. package/dist/{IStorageAdapter-C7isBXJF.d.cts → IStorageAdapter-Dz8jrIAK.d.cts} +1 -1
  17. package/dist/adapters/MemoryAdapter.d.cts +2 -2
  18. package/dist/adapters/MemoryAdapter.d.ts +2 -2
  19. package/dist/adapters/PostgresAdapter.d.cts +2 -2
  20. package/dist/adapters/PostgresAdapter.d.ts +2 -2
  21. package/dist/index.cjs +213 -0
  22. package/dist/index.cjs.map +1 -1
  23. package/dist/index.d.cts +9 -9
  24. package/dist/index.d.ts +9 -9
  25. package/dist/index.js +213 -0
  26. package/dist/index.js.map +1 -1
  27. package/dist/{instance-BsM0DUPf.d.cts → instance-SA0BU-Gb.d.cts} +20 -2
  28. package/dist/{instance-BsM0DUPf.d.ts → instance-SA0BU-Gb.d.ts} +20 -2
  29. package/dist/nestjs.cjs +213 -0
  30. package/dist/nestjs.cjs.map +1 -1
  31. package/dist/nestjs.d.cts +8 -8
  32. package/dist/nestjs.d.ts +8 -8
  33. package/dist/nestjs.js +213 -0
  34. package/dist/nestjs.js.map +1 -1
  35. package/dist/plugins/audit.d.cts +2 -2
  36. package/dist/plugins/audit.d.ts +2 -2
  37. package/dist/plugins/metrics.cjs +2 -0
  38. package/dist/plugins/metrics.cjs.map +1 -1
  39. package/dist/plugins/metrics.d.cts +1 -1
  40. package/dist/plugins/metrics.d.ts +1 -1
  41. package/dist/plugins/metrics.js +2 -0
  42. package/dist/plugins/metrics.js.map +1 -1
  43. package/dist/plugins/notify.d.cts +2 -2
  44. package/dist/plugins/notify.d.ts +2 -2
  45. package/dist/plugins/resilience.d.cts +3 -3
  46. package/dist/plugins/resilience.d.ts +3 -3
  47. package/dist/plugins/tracing.d.cts +2 -2
  48. package/dist/plugins/tracing.d.ts +2 -2
  49. package/dist/plugins/webhook.d.cts +2 -2
  50. package/dist/plugins/webhook.d.ts +2 -2
  51. package/dist/testing.cjs +213 -0
  52. package/dist/testing.cjs.map +1 -1
  53. package/dist/testing.d.cts +8 -8
  54. package/dist/testing.d.ts +8 -8
  55. package/dist/testing.js +213 -0
  56. package/dist/testing.js.map +1 -1
  57. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -7,6 +7,43 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
8
  _Nothing yet._
9
9
 
10
+ ## [1.5.0] - 2026-09-04
11
+
12
+ ### Added — request for information
13
+
14
+ - **`requestInfo()` / `provideInfo()` let an approver ask the submitter a
15
+ question without rejecting.** Approvers routinely need one fact before they
16
+ can decide, and there was no way to say so: rejecting throws away every
17
+ approval already collected and forces a resubmit, while chasing the question
18
+ by email leaves the request sitting and quietly burns the SLA the approver is
19
+ measured on.
20
+
21
+ ```ts
22
+ await engine.requestInfo(id, { approverId: 'mgr-1', question: 'Which cost centre?' });
23
+ await engine.provideInfo(id, { respondedBy: 'buyer-1', response: 'CC-42' });
24
+ ```
25
+
26
+ The instance stays `pending` and keeps its approvers — this is a question, not
27
+ a decision.
28
+
29
+ - **Deadlines are paused for the duration of the hold.** The scheduler skips a
30
+ held instance entirely, so escalation, reminders, SLA breach and expiry cannot
31
+ fire while the submitter owes an answer; on answer, every deadline that was
32
+ set is pushed out by exactly how long the question was open. An approver gets
33
+ back the time they had before asking rather than being penalised for asking.
34
+ A deadline that was never configured is not invented by being held.
35
+
36
+ - **Wiring:** emits `approval:info_requested` (addressed to the submitter) and
37
+ `approval:info_provided` (addressed to the waiting approvers, carrying
38
+ `heldForMs`); records `info_requested` / `info_provided` audit entries;
39
+ increments `approval.info_requested` / `approval.info_provided`; and adds both
40
+ operations to the authorization-policy set. Only one question may be open at a
41
+ time.
42
+
43
+ New exports: `InfoRequest`, `InfoRequestedEvent`, `InfoProvidedEvent`,
44
+ `RequestInfoOptions`, `ProvideInfoOptions`. `ApprovalInstance` gains
45
+ `infoRequest`.
46
+
10
47
  ## [1.4.0] - 2026-09-04
11
48
 
12
49
  ### Added — filter instances by document data
package/README.md CHANGED
@@ -399,6 +399,36 @@ engine.registerConditionOperator('between', (actual, expected) => {
399
399
  });
400
400
  ```
401
401
 
402
+ ### Asking the submitter a question
403
+
404
+ Approvers routinely need one fact before they can decide. `requestInfo()` puts
405
+ the approval on hold without rejecting it:
406
+
407
+ ```ts
408
+ await engine.requestInfo(instance.id, {
409
+ approverId: 'mgr-1',
410
+ question: 'Which cost centre should this book to?',
411
+ });
412
+
413
+ // ...later
414
+ await engine.provideInfo(instance.id, {
415
+ respondedBy: 'buyer-1',
416
+ response: 'CC-42',
417
+ });
418
+ ```
419
+
420
+ The instance stays `pending` and keeps its approvers — this is a question, not a
421
+ decision. What changes is the clock: **escalation, SLA, reminder and expiry
422
+ deadlines stop advancing while the question is open**, and on answer every one
423
+ is pushed out by exactly how long the hold lasted. An approver gets back the
424
+ time they had before asking, rather than being penalised for asking.
425
+
426
+ Emits `approval:info_requested` (addressed to the submitter) and
427
+ `approval:info_provided` (addressed to the waiting approvers, carrying
428
+ `heldForMs`), and records `info_requested` / `info_provided` audit entries.
429
+
430
+ Only one question can be open at a time; answer it before asking another.
431
+
402
432
  ### Filtering by document data
403
433
 
404
434
  Every query filter accepts `data`, matching against the document body itself —
@@ -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-DVclp9cn.js';
2
- import { k as ConditionExpression, o as ResolverFn, g as ApprovalTemplateConfig, A as ApprovalTemplate, j as AuditContext, a as ApprovalInstance, e as ApprovalMode, b as AuditEntry } from './instance-BsM0DUPf.js';
3
- import { I as INotificationAdapter, b as ApprovalEventName, a as ApprovalEventMap } from './INotificationAdapter-BmSeB7FZ.js';
1
+ import { I as IStorageAdapter, P as PaginationOpts, a as PaginatedResult, b as InstanceFilter, C as CursorPaginationOpts, c as CursorPaginatedResult } from './IStorageAdapter-CXRyeUOK.js';
2
+ import { k as ConditionExpression, o as ResolverFn, g as ApprovalTemplateConfig, A as ApprovalTemplate, j as AuditContext, a as ApprovalInstance, e as ApprovalMode, b as AuditEntry } from './instance-SA0BU-Gb.js';
3
+ import { I as INotificationAdapter, b as ApprovalEventName, a as ApprovalEventMap } from './INotificationAdapter-Cyo0cvXU.js';
4
4
  import { z } from 'zod';
5
5
  import { L as Logger } from './Logger-BplhlU7l.js';
6
6
  import { C as Clock } from './Clock-3FnOczFJ.js';
7
- import { I as IOperationMiddleware, a as ApprovalError } from './IOperationMiddleware-BW9t8wPn.js';
8
- import { I as IAuditAdapter } from './IAuditAdapter-GixC9zS1.js';
9
- import { I as IMetricsAdapter } from './IMetricsAdapter-QvyaKQCc.js';
7
+ import { I as IOperationMiddleware, a as ApprovalError } from './IOperationMiddleware-rx7XAPrW.js';
8
+ import { I as IAuditAdapter } from './IAuditAdapter-wfOcN3Zf.js';
9
+ import { I as IMetricsAdapter } from './IMetricsAdapter-JZVK3QUq.js';
10
10
  import { I as ISchedulerAdapter } from './ISchedulerAdapter-DKv_QjVN.js';
11
- import { I as IAuthorizationPolicy } from './IAuthorizationPolicy-4ge9Gnxj.js';
11
+ import { I as IAuthorizationPolicy } from './IAuthorizationPolicy-CdvoZsGC.js';
12
12
 
13
13
  declare const SubmitOptionsSchema: z.ZodObject<{
14
14
  templateName: z.ZodString;
@@ -69,6 +69,15 @@ declare const OverrideOptionsSchema: z.ZodObject<{
69
69
  overriddenBy: z.ZodString;
70
70
  justification: z.ZodString;
71
71
  }, z.core.$strip>;
72
+ declare const RequestInfoOptionsSchema: z.ZodObject<{
73
+ approverId: z.ZodString;
74
+ question: z.ZodString;
75
+ level: z.ZodOptional<z.ZodNumber>;
76
+ }, z.core.$strip>;
77
+ declare const ProvideInfoOptionsSchema: z.ZodObject<{
78
+ respondedBy: z.ZodString;
79
+ response: z.ZodString;
80
+ }, z.core.$strip>;
72
81
  declare const UpdateDataOptionsSchema: z.ZodObject<{
73
82
  updatedBy: z.ZodString;
74
83
  data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
@@ -90,6 +99,8 @@ type ResubmitOptions = z.infer<typeof ResubmitOptionsSchema>;
90
99
  type AddCommentOptions = z.infer<typeof AddCommentOptionsSchema>;
91
100
  type OverrideOptions = z.infer<typeof OverrideOptionsSchema>;
92
101
  type UpdateDataOptions = z.infer<typeof UpdateDataOptionsSchema>;
102
+ type RequestInfoOptions = z.infer<typeof RequestInfoOptionsSchema>;
103
+ type ProvideInfoOptions = z.infer<typeof ProvideInfoOptionsSchema>;
93
104
 
94
105
  /**
95
106
  * Computes deadline dates from a number of days. The default engine behaviour
@@ -444,6 +455,41 @@ declare class ApprovalEngine {
444
455
  * {@link updateData} for why.
445
456
  */
446
457
  private recomputeFutureChain;
458
+ /**
459
+ * Ask the submitter for clarification without rejecting.
460
+ *
461
+ * Approvers routinely need one fact before they can decide. The only ways to
462
+ * express that were to reject — which throws away every approval already
463
+ * collected and forces a resubmit — or to leave the request sitting while the
464
+ * question is chased by email, which quietly burns the SLA the approver is
465
+ * measured on.
466
+ *
467
+ * The instance stays `pending` and keeps its approvers: this is a question,
468
+ * not a decision. What changes is the clock — escalation, SLA and expiry
469
+ * deadlines stop advancing while the question is open, because time spent
470
+ * waiting on the submitter is not time the approver is sitting on their hands.
471
+ *
472
+ * @throws ApprovalError if the instance is not pending, or a question is already open.
473
+ */
474
+ requestInfo(instanceId: string, raw: RequestInfoOptions, auditCtx?: AuditContext): Promise<ApprovalInstance>;
475
+ /**
476
+ * Answer an open clarification request and take the instance off hold.
477
+ *
478
+ * Every deadline that was paused is pushed out by exactly how long the
479
+ * question was open, so an approver gets back the full remaining time they
480
+ * had before asking rather than being penalised for asking at all.
481
+ *
482
+ * @throws ApprovalError if no question is open.
483
+ */
484
+ provideInfo(instanceId: string, raw: ProvideInfoOptions, auditCtx?: AuditContext): Promise<ApprovalInstance>;
485
+ /**
486
+ * Push every pending deadline out by `ms`.
487
+ *
488
+ * Used to give back time an instance spent on hold. Deadlines that are not
489
+ * set stay unset — a level with no escalation configured does not acquire one
490
+ * by being held.
491
+ */
492
+ private extendDeadlinesBy;
447
493
  /** Add a comment to an instance without approving or rejecting. */
448
494
  addComment(instanceId: string, raw: AddCommentOptions, auditCtx?: AuditContext): Promise<void>;
449
495
  /** Resubmit a rejected instance, creating a new linked instance from level 1. */
@@ -568,4 +614,4 @@ declare class ApprovalEngine {
568
614
  private runExternalAudit;
569
615
  }
570
616
 
571
- export { type AddCommentOptions as A, type BulkResult as B, type CanApproveResult as C, type DelegateOptions as D, type EscalateOptions as E, type HealthResult as H, type IdGeneratorFn as I, type OrgProvider as O, type PreviewChainLevel as P, type ReassignOptions as R, type SubmitOptions as S, type UpdateDataOptions as U, type ValidationResult as V, type WeekendCalendarOptions as W, ApprovalEngine as a, type ApprovalEngineOptions as b, type ApprovalStatistics as c, type ApproveOptions as d, type ApproverResolverFn as e, type BusinessCalendar as f, type CancelOptions as g, type ConditionOperatorFn as h, type CycleTimeStats as i, type IdempotencyKeyFn as j, type OutOfOfficeProvider as k, type OverrideOptions as l, type PreviewResult as m, type RejectOptions as n, type ResubmitOptions as o, type RetryPolicy as p, defaultIdGenerator as q, toComparableNumber as t, validateConditionExpression as v, weekendCalendar as w };
617
+ export { type AddCommentOptions as A, type BulkResult as B, type CanApproveResult as C, type DelegateOptions as D, type EscalateOptions as E, type HealthResult as H, type IdGeneratorFn as I, type OrgProvider as O, type PreviewChainLevel as P, type ReassignOptions as R, type SubmitOptions as S, type UpdateDataOptions as U, type ValidationResult as V, type WeekendCalendarOptions as W, ApprovalEngine as a, type ApprovalEngineOptions as b, type ApprovalStatistics as c, type ApproveOptions as d, type ApproverResolverFn as e, type BusinessCalendar as f, type CancelOptions as g, type ConditionOperatorFn as h, type CycleTimeStats as i, type IdempotencyKeyFn as j, type OutOfOfficeProvider as k, type OverrideOptions as l, type PreviewResult as m, type ProvideInfoOptions as n, type RejectOptions as o, type RequestInfoOptions as p, type ResubmitOptions as q, type RetryPolicy as r, defaultIdGenerator as s, toComparableNumber as t, validateConditionExpression as v, weekendCalendar as w };
@@ -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-C7isBXJF.cjs';
2
- import { k as ConditionExpression, o as ResolverFn, g as ApprovalTemplateConfig, A as ApprovalTemplate, j as AuditContext, a as ApprovalInstance, e as ApprovalMode, b as AuditEntry } from './instance-BsM0DUPf.cjs';
3
- import { I as INotificationAdapter, b as ApprovalEventName, a as ApprovalEventMap } from './INotificationAdapter-BKMeGmaG.cjs';
1
+ import { I as IStorageAdapter, P as PaginationOpts, a as PaginatedResult, b as InstanceFilter, C as CursorPaginationOpts, c as CursorPaginatedResult } from './IStorageAdapter-Dz8jrIAK.cjs';
2
+ import { k as ConditionExpression, o as ResolverFn, g as ApprovalTemplateConfig, A as ApprovalTemplate, j as AuditContext, a as ApprovalInstance, e as ApprovalMode, b as AuditEntry } from './instance-SA0BU-Gb.cjs';
3
+ import { I as INotificationAdapter, b as ApprovalEventName, a as ApprovalEventMap } from './INotificationAdapter-Cn-LNPtD.cjs';
4
4
  import { z } from 'zod';
5
5
  import { L as Logger } from './Logger-BplhlU7l.cjs';
6
6
  import { C as Clock } from './Clock-3FnOczFJ.cjs';
7
- import { I as IOperationMiddleware, a as ApprovalError } from './IOperationMiddleware-BLw9Oc-S.cjs';
8
- import { I as IAuditAdapter } from './IAuditAdapter-B2I3CjaJ.cjs';
9
- import { I as IMetricsAdapter } from './IMetricsAdapter-QvyaKQCc.cjs';
7
+ import { I as IOperationMiddleware, a as ApprovalError } from './IOperationMiddleware-DrJy9UtL.cjs';
8
+ import { I as IAuditAdapter } from './IAuditAdapter-Cr0dLoVP.cjs';
9
+ import { I as IMetricsAdapter } from './IMetricsAdapter-JZVK3QUq.cjs';
10
10
  import { I as ISchedulerAdapter } from './ISchedulerAdapter-DKv_QjVN.cjs';
11
- import { I as IAuthorizationPolicy } from './IAuthorizationPolicy-BHDZK9QL.cjs';
11
+ import { I as IAuthorizationPolicy } from './IAuthorizationPolicy-BHybAsq5.cjs';
12
12
 
13
13
  declare const SubmitOptionsSchema: z.ZodObject<{
14
14
  templateName: z.ZodString;
@@ -69,6 +69,15 @@ declare const OverrideOptionsSchema: z.ZodObject<{
69
69
  overriddenBy: z.ZodString;
70
70
  justification: z.ZodString;
71
71
  }, z.core.$strip>;
72
+ declare const RequestInfoOptionsSchema: z.ZodObject<{
73
+ approverId: z.ZodString;
74
+ question: z.ZodString;
75
+ level: z.ZodOptional<z.ZodNumber>;
76
+ }, z.core.$strip>;
77
+ declare const ProvideInfoOptionsSchema: z.ZodObject<{
78
+ respondedBy: z.ZodString;
79
+ response: z.ZodString;
80
+ }, z.core.$strip>;
72
81
  declare const UpdateDataOptionsSchema: z.ZodObject<{
73
82
  updatedBy: z.ZodString;
74
83
  data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
@@ -90,6 +99,8 @@ type ResubmitOptions = z.infer<typeof ResubmitOptionsSchema>;
90
99
  type AddCommentOptions = z.infer<typeof AddCommentOptionsSchema>;
91
100
  type OverrideOptions = z.infer<typeof OverrideOptionsSchema>;
92
101
  type UpdateDataOptions = z.infer<typeof UpdateDataOptionsSchema>;
102
+ type RequestInfoOptions = z.infer<typeof RequestInfoOptionsSchema>;
103
+ type ProvideInfoOptions = z.infer<typeof ProvideInfoOptionsSchema>;
93
104
 
94
105
  /**
95
106
  * Computes deadline dates from a number of days. The default engine behaviour
@@ -444,6 +455,41 @@ declare class ApprovalEngine {
444
455
  * {@link updateData} for why.
445
456
  */
446
457
  private recomputeFutureChain;
458
+ /**
459
+ * Ask the submitter for clarification without rejecting.
460
+ *
461
+ * Approvers routinely need one fact before they can decide. The only ways to
462
+ * express that were to reject — which throws away every approval already
463
+ * collected and forces a resubmit — or to leave the request sitting while the
464
+ * question is chased by email, which quietly burns the SLA the approver is
465
+ * measured on.
466
+ *
467
+ * The instance stays `pending` and keeps its approvers: this is a question,
468
+ * not a decision. What changes is the clock — escalation, SLA and expiry
469
+ * deadlines stop advancing while the question is open, because time spent
470
+ * waiting on the submitter is not time the approver is sitting on their hands.
471
+ *
472
+ * @throws ApprovalError if the instance is not pending, or a question is already open.
473
+ */
474
+ requestInfo(instanceId: string, raw: RequestInfoOptions, auditCtx?: AuditContext): Promise<ApprovalInstance>;
475
+ /**
476
+ * Answer an open clarification request and take the instance off hold.
477
+ *
478
+ * Every deadline that was paused is pushed out by exactly how long the
479
+ * question was open, so an approver gets back the full remaining time they
480
+ * had before asking rather than being penalised for asking at all.
481
+ *
482
+ * @throws ApprovalError if no question is open.
483
+ */
484
+ provideInfo(instanceId: string, raw: ProvideInfoOptions, auditCtx?: AuditContext): Promise<ApprovalInstance>;
485
+ /**
486
+ * Push every pending deadline out by `ms`.
487
+ *
488
+ * Used to give back time an instance spent on hold. Deadlines that are not
489
+ * set stay unset — a level with no escalation configured does not acquire one
490
+ * by being held.
491
+ */
492
+ private extendDeadlinesBy;
447
493
  /** Add a comment to an instance without approving or rejecting. */
448
494
  addComment(instanceId: string, raw: AddCommentOptions, auditCtx?: AuditContext): Promise<void>;
449
495
  /** Resubmit a rejected instance, creating a new linked instance from level 1. */
@@ -568,4 +614,4 @@ declare class ApprovalEngine {
568
614
  private runExternalAudit;
569
615
  }
570
616
 
571
- export { type AddCommentOptions as A, type BulkResult as B, type CanApproveResult as C, type DelegateOptions as D, type EscalateOptions as E, type HealthResult as H, type IdGeneratorFn as I, type OrgProvider as O, type PreviewChainLevel as P, type ReassignOptions as R, type SubmitOptions as S, type UpdateDataOptions as U, type ValidationResult as V, type WeekendCalendarOptions as W, ApprovalEngine as a, type ApprovalEngineOptions as b, type ApprovalStatistics as c, type ApproveOptions as d, type ApproverResolverFn as e, type BusinessCalendar as f, type CancelOptions as g, type ConditionOperatorFn as h, type CycleTimeStats as i, type IdempotencyKeyFn as j, type OutOfOfficeProvider as k, type OverrideOptions as l, type PreviewResult as m, type RejectOptions as n, type ResubmitOptions as o, type RetryPolicy as p, defaultIdGenerator as q, toComparableNumber as t, validateConditionExpression as v, weekendCalendar as w };
617
+ export { type AddCommentOptions as A, type BulkResult as B, type CanApproveResult as C, type DelegateOptions as D, type EscalateOptions as E, type HealthResult as H, type IdGeneratorFn as I, type OrgProvider as O, type PreviewChainLevel as P, type ReassignOptions as R, type SubmitOptions as S, type UpdateDataOptions as U, type ValidationResult as V, type WeekendCalendarOptions as W, ApprovalEngine as a, type ApprovalEngineOptions as b, type ApprovalStatistics as c, type ApproveOptions as d, type ApproverResolverFn as e, type BusinessCalendar as f, type CancelOptions as g, type ConditionOperatorFn as h, type CycleTimeStats as i, type IdempotencyKeyFn as j, type OutOfOfficeProvider as k, type OverrideOptions as l, type PreviewResult as m, type ProvideInfoOptions as n, type RejectOptions as o, type RequestInfoOptions as p, type ResubmitOptions as q, type RetryPolicy as r, defaultIdGenerator as s, toComparableNumber as t, validateConditionExpression as v, weekendCalendar as w };
@@ -1,4 +1,4 @@
1
- import { b as AuditEntry, a as ApprovalInstance } from './instance-BsM0DUPf.cjs';
1
+ import { b as AuditEntry, a as ApprovalInstance } from './instance-SA0BU-Gb.cjs';
2
2
 
3
3
  interface IAuditAdapter {
4
4
  /**
@@ -1,4 +1,4 @@
1
- import { b as AuditEntry, a as ApprovalInstance } from './instance-BsM0DUPf.js';
1
+ import { b as AuditEntry, a as ApprovalInstance } from './instance-SA0BU-Gb.js';
2
2
 
3
3
  interface IAuditAdapter {
4
4
  /**
@@ -1,7 +1,7 @@
1
- import { a as ApprovalInstance, d as ApprovalLevelInstance } from './instance-BsM0DUPf.cjs';
1
+ import { a as ApprovalInstance, d as ApprovalLevelInstance } from './instance-SA0BU-Gb.cjs';
2
2
 
3
3
  interface AuthorizationContext {
4
- operation: 'submit' | 'approve' | 'reject' | 'delegate' | 'reassign' | 'cancel' | 'escalate' | 'override' | 'resubmit' | 'addComment' | 'updateData';
4
+ operation: 'submit' | 'approve' | 'reject' | 'delegate' | 'reassign' | 'cancel' | 'escalate' | 'override' | 'resubmit' | 'addComment' | 'updateData' | 'requestInfo' | 'provideInfo';
5
5
  actorId: string;
6
6
  instance: Readonly<ApprovalInstance>;
7
7
  level?: Readonly<ApprovalLevelInstance>;
@@ -1,7 +1,7 @@
1
- import { a as ApprovalInstance, d as ApprovalLevelInstance } from './instance-BsM0DUPf.js';
1
+ import { a as ApprovalInstance, d as ApprovalLevelInstance } from './instance-SA0BU-Gb.js';
2
2
 
3
3
  interface AuthorizationContext {
4
- operation: 'submit' | 'approve' | 'reject' | 'delegate' | 'reassign' | 'cancel' | 'escalate' | 'override' | 'resubmit' | 'addComment' | 'updateData';
4
+ operation: 'submit' | 'approve' | 'reject' | 'delegate' | 'reassign' | 'cancel' | 'escalate' | 'override' | 'resubmit' | 'addComment' | 'updateData' | 'requestInfo' | 'provideInfo';
5
5
  actorId: string;
6
6
  instance: Readonly<ApprovalInstance>;
7
7
  level?: Readonly<ApprovalLevelInstance>;
@@ -1,4 +1,4 @@
1
- type MetricName = 'approval.submitted' | 'approval.approved' | 'approval.rejected' | 'approval.cancelled' | 'approval.expired' | 'approval.sla_breached' | 'approval.escalated' | 'approval.reassigned' | 'approval.overridden' | 'approval.data_updated' | 'approval.reminded' | 'approval.conflict_retry' | 'approval.operation_duration_ms';
1
+ type MetricName = 'approval.submitted' | 'approval.approved' | 'approval.rejected' | 'approval.cancelled' | 'approval.expired' | 'approval.sla_breached' | 'approval.escalated' | 'approval.reassigned' | 'approval.overridden' | 'approval.data_updated' | 'approval.reminded' | 'approval.info_requested' | 'approval.info_provided' | 'approval.conflict_retry' | 'approval.operation_duration_ms';
2
2
  interface IMetricsAdapter {
3
3
  /** Increment a counter. Synchronous — never awaited. */
4
4
  increment(metric: MetricName, labels?: Record<string, string>): void;
@@ -1,4 +1,4 @@
1
- type MetricName = 'approval.submitted' | 'approval.approved' | 'approval.rejected' | 'approval.cancelled' | 'approval.expired' | 'approval.sla_breached' | 'approval.escalated' | 'approval.reassigned' | 'approval.overridden' | 'approval.data_updated' | 'approval.reminded' | 'approval.conflict_retry' | 'approval.operation_duration_ms';
1
+ type MetricName = 'approval.submitted' | 'approval.approved' | 'approval.rejected' | 'approval.cancelled' | 'approval.expired' | 'approval.sla_breached' | 'approval.escalated' | 'approval.reassigned' | 'approval.overridden' | 'approval.data_updated' | 'approval.reminded' | 'approval.info_requested' | 'approval.info_provided' | 'approval.conflict_retry' | 'approval.operation_duration_ms';
2
2
  interface IMetricsAdapter {
3
3
  /** Increment a counter. Synchronous — never awaited. */
4
4
  increment(metric: MetricName, labels?: Record<string, string>): void;
@@ -1,4 +1,4 @@
1
- import { a as ApprovalInstance, b as AuditEntry } from './instance-BsM0DUPf.js';
1
+ import { a as ApprovalInstance, b as AuditEntry } from './instance-SA0BU-Gb.cjs';
2
2
 
3
3
  interface ApprovalEvent {
4
4
  instanceId: string;
@@ -86,6 +86,24 @@ interface ReminderEvent extends ApprovalEvent {
86
86
  /** 1 for the first reminder on this level, 2 for the next, and so on. */
87
87
  reminderNumber: number;
88
88
  }
89
+ /** Emitted when an approver asks the submitter for clarification. */
90
+ interface InfoRequestedEvent extends ApprovalEvent {
91
+ askedBy: string;
92
+ question: string;
93
+ level: number;
94
+ /** Who is expected to answer — the submitter. */
95
+ recipients: string[];
96
+ }
97
+ /** Emitted when the question is answered and the instance comes off hold. */
98
+ interface InfoProvidedEvent extends ApprovalEvent {
99
+ respondedBy: string;
100
+ response: string;
101
+ level: number;
102
+ /** How long the instance spent on hold; deadlines were extended by this much. */
103
+ heldForMs: number;
104
+ /** The approvers waiting again now that the question is answered. */
105
+ recipients: string[];
106
+ }
89
107
  interface ApprovalEventMap {
90
108
  'approval:submitted': SubmittedEvent;
91
109
  'approval:approved': ApprovedEvent;
@@ -102,6 +120,8 @@ interface ApprovalEventMap {
102
120
  'approval:sla_breached': SlaBreachedEvent;
103
121
  'approval:data_updated': DataUpdatedEvent;
104
122
  'approval:reminder': ReminderEvent;
123
+ 'approval:info_requested': InfoRequestedEvent;
124
+ 'approval:info_provided': InfoProvidedEvent;
105
125
  }
106
126
  type ApprovalEventName = keyof ApprovalEventMap;
107
127
  interface HistoryEntry extends AuditEntry {
@@ -125,4 +145,4 @@ interface INotificationAdapter {
125
145
  notify(event: NotificationEvent): Promise<void>;
126
146
  }
127
147
 
128
- export type { ApprovalEvent as A, CancelledEvent as C, DataUpdatedEvent as D, EscalatedEvent as E, HistoryEntry as H, INotificationAdapter as I, LevelAdvancedEvent as L, NotificationEvent as N, OverriddenEvent as O, ReassignedEvent as R, SlaBreachedEvent as S, ApprovalEventMap as a, ApprovalEventName as b, ApprovedEvent as c, DelegatedEvent as d, ExpiredEvent as e, RejectedEvent as f, ReminderEvent as g, ResubmittedEvent as h, SubmittedEvent as i };
148
+ export type { ApprovalEvent as A, CancelledEvent as C, DataUpdatedEvent as D, EscalatedEvent as E, HistoryEntry as H, INotificationAdapter as I, LevelAdvancedEvent as L, NotificationEvent as N, OverriddenEvent as O, ReassignedEvent as R, SlaBreachedEvent as S, ApprovalEventMap as a, ApprovalEventName as b, ApprovedEvent as c, DelegatedEvent as d, ExpiredEvent as e, InfoProvidedEvent as f, InfoRequestedEvent as g, RejectedEvent as h, ReminderEvent as i, ResubmittedEvent as j, SubmittedEvent as k };
@@ -1,4 +1,4 @@
1
- import { a as ApprovalInstance, b as AuditEntry } from './instance-BsM0DUPf.cjs';
1
+ import { a as ApprovalInstance, b as AuditEntry } from './instance-SA0BU-Gb.js';
2
2
 
3
3
  interface ApprovalEvent {
4
4
  instanceId: string;
@@ -86,6 +86,24 @@ interface ReminderEvent extends ApprovalEvent {
86
86
  /** 1 for the first reminder on this level, 2 for the next, and so on. */
87
87
  reminderNumber: number;
88
88
  }
89
+ /** Emitted when an approver asks the submitter for clarification. */
90
+ interface InfoRequestedEvent extends ApprovalEvent {
91
+ askedBy: string;
92
+ question: string;
93
+ level: number;
94
+ /** Who is expected to answer — the submitter. */
95
+ recipients: string[];
96
+ }
97
+ /** Emitted when the question is answered and the instance comes off hold. */
98
+ interface InfoProvidedEvent extends ApprovalEvent {
99
+ respondedBy: string;
100
+ response: string;
101
+ level: number;
102
+ /** How long the instance spent on hold; deadlines were extended by this much. */
103
+ heldForMs: number;
104
+ /** The approvers waiting again now that the question is answered. */
105
+ recipients: string[];
106
+ }
89
107
  interface ApprovalEventMap {
90
108
  'approval:submitted': SubmittedEvent;
91
109
  'approval:approved': ApprovedEvent;
@@ -102,6 +120,8 @@ interface ApprovalEventMap {
102
120
  'approval:sla_breached': SlaBreachedEvent;
103
121
  'approval:data_updated': DataUpdatedEvent;
104
122
  'approval:reminder': ReminderEvent;
123
+ 'approval:info_requested': InfoRequestedEvent;
124
+ 'approval:info_provided': InfoProvidedEvent;
105
125
  }
106
126
  type ApprovalEventName = keyof ApprovalEventMap;
107
127
  interface HistoryEntry extends AuditEntry {
@@ -125,4 +145,4 @@ interface INotificationAdapter {
125
145
  notify(event: NotificationEvent): Promise<void>;
126
146
  }
127
147
 
128
- export type { ApprovalEvent as A, CancelledEvent as C, DataUpdatedEvent as D, EscalatedEvent as E, HistoryEntry as H, INotificationAdapter as I, LevelAdvancedEvent as L, NotificationEvent as N, OverriddenEvent as O, ReassignedEvent as R, SlaBreachedEvent as S, ApprovalEventMap as a, ApprovalEventName as b, ApprovedEvent as c, DelegatedEvent as d, ExpiredEvent as e, RejectedEvent as f, ReminderEvent as g, ResubmittedEvent as h, SubmittedEvent as i };
148
+ export type { ApprovalEvent as A, CancelledEvent as C, DataUpdatedEvent as D, EscalatedEvent as E, HistoryEntry as H, INotificationAdapter as I, LevelAdvancedEvent as L, NotificationEvent as N, OverriddenEvent as O, ReassignedEvent as R, SlaBreachedEvent as S, ApprovalEventMap as a, ApprovalEventName as b, ApprovedEvent as c, DelegatedEvent as d, ExpiredEvent as e, InfoProvidedEvent as f, InfoRequestedEvent as g, RejectedEvent as h, ReminderEvent as i, ResubmittedEvent as j, SubmittedEvent as k };
@@ -1,4 +1,4 @@
1
- import { a as ApprovalInstance } from './instance-BsM0DUPf.cjs';
1
+ import { a as ApprovalInstance } from './instance-SA0BU-Gb.cjs';
2
2
 
3
3
  declare class ApprovalError extends Error {
4
4
  readonly code: string;
@@ -1,4 +1,4 @@
1
- import { a as ApprovalInstance } from './instance-BsM0DUPf.js';
1
+ import { a as ApprovalInstance } from './instance-SA0BU-Gb.js';
2
2
 
3
3
  declare class ApprovalError extends Error {
4
4
  readonly code: string;
@@ -1,4 +1,4 @@
1
- import { A as ApprovalTemplate, a as ApprovalInstance, f as ApprovalStatus, b as AuditEntry } from './instance-BsM0DUPf.js';
1
+ import { A as ApprovalTemplate, a as ApprovalInstance, f as ApprovalStatus, b as AuditEntry } from './instance-SA0BU-Gb.js';
2
2
 
3
3
  interface PaginationOpts {
4
4
  limit: number;
@@ -1,4 +1,4 @@
1
- import { A as ApprovalTemplate, a as ApprovalInstance, f as ApprovalStatus, b as AuditEntry } from './instance-BsM0DUPf.cjs';
1
+ import { A as ApprovalTemplate, a as ApprovalInstance, f as ApprovalStatus, b as AuditEntry } from './instance-SA0BU-Gb.cjs';
2
2
 
3
3
  interface PaginationOpts {
4
4
  limit: number;
@@ -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-C7isBXJF.cjs';
2
- import { A as ApprovalTemplate, a as ApprovalInstance, b as AuditEntry } from '../instance-BsM0DUPf.cjs';
1
+ import { I as IStorageAdapter, P as PaginationOpts, a as PaginatedResult, b as InstanceFilter, C as CursorPaginationOpts, c as CursorPaginatedResult } from '../IStorageAdapter-Dz8jrIAK.cjs';
2
+ import { A as ApprovalTemplate, a as ApprovalInstance, b as AuditEntry } from '../instance-SA0BU-Gb.cjs';
3
3
 
4
4
  declare class MemoryAdapter implements IStorageAdapter {
5
5
  private templates;
@@ -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-DVclp9cn.js';
2
- import { A as ApprovalTemplate, a as ApprovalInstance, b as AuditEntry } from '../instance-BsM0DUPf.js';
1
+ import { I as IStorageAdapter, P as PaginationOpts, a as PaginatedResult, b as InstanceFilter, C as CursorPaginationOpts, c as CursorPaginatedResult } from '../IStorageAdapter-CXRyeUOK.js';
2
+ import { A as ApprovalTemplate, a as ApprovalInstance, b as AuditEntry } from '../instance-SA0BU-Gb.js';
3
3
 
4
4
  declare class MemoryAdapter implements IStorageAdapter {
5
5
  private templates;
@@ -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-C7isBXJF.cjs';
4
- import { A as ApprovalTemplate, a as ApprovalInstance, b as AuditEntry } from '../instance-BsM0DUPf.cjs';
3
+ import { I as IStorageAdapter, P as PaginationOpts, a as PaginatedResult, b as InstanceFilter, C as CursorPaginationOpts, c as CursorPaginatedResult } from '../IStorageAdapter-Dz8jrIAK.cjs';
4
+ import { A as ApprovalTemplate, a as ApprovalInstance, b as AuditEntry } from '../instance-SA0BU-Gb.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-DVclp9cn.js';
4
- import { A as ApprovalTemplate, a as ApprovalInstance, b as AuditEntry } from '../instance-BsM0DUPf.js';
3
+ import { I as IStorageAdapter, P as PaginationOpts, a as PaginatedResult, b as InstanceFilter, C as CursorPaginationOpts, c as CursorPaginatedResult } from '../IStorageAdapter-CXRyeUOK.js';
4
+ import { A as ApprovalTemplate, a as ApprovalInstance, b as AuditEntry } from '../instance-SA0BU-Gb.js';
5
5
 
6
6
  interface PostgresAdapterOptions {
7
7
  connectionString?: string;