hierarchical-approval 4.0.5 → 4.0.6

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 (52) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/dist/{ApprovalEngine-BaJ2PNB7.d.cts → ApprovalEngine-BnMpoQB2.d.cts} +6 -6
  3. package/dist/{ApprovalEngine-CeBKYLz4.d.ts → ApprovalEngine-BqKSm1gG.d.ts} +6 -6
  4. package/dist/{IAuditAdapter-Dqpkg-Tz.d.cts → IAuditAdapter-DR-WIAK6.d.cts} +1 -1
  5. package/dist/{IAuditAdapter-ggCTPf02.d.ts → IAuditAdapter-SNpV2hdt.d.ts} +1 -1
  6. package/dist/{IAuthorizationPolicy-BUHKvalu.d.ts → IAuthorizationPolicy-BMl0xS-j.d.ts} +1 -1
  7. package/dist/{IAuthorizationPolicy-D5mAFBTC.d.cts → IAuthorizationPolicy-BwYBOQM3.d.cts} +1 -1
  8. package/dist/{INotificationAdapter-D9IOl9G_.d.cts → INotificationAdapter-BO6kmkyC.d.cts} +13 -1
  9. package/dist/{INotificationAdapter-B_9JFH1i.d.ts → INotificationAdapter-DKLEDgAk.d.ts} +13 -1
  10. package/dist/{IOperationMiddleware-C-N8MpHV.d.ts → IOperationMiddleware-CUI6VG6r.d.ts} +2 -1
  11. package/dist/{IOperationMiddleware-CsF_xD4b.d.cts → IOperationMiddleware-oYhWMKMn.d.cts} +2 -1
  12. package/dist/{IStorageAdapter-CrbVtEE-.d.cts → IStorageAdapter-DN78GD-1.d.ts} +15 -1
  13. package/dist/{IStorageAdapter-DDOW9z0L.d.ts → IStorageAdapter-_PjAgjFA.d.cts} +15 -1
  14. package/dist/adapters/MemoryAdapter.d.cts +2 -2
  15. package/dist/adapters/MemoryAdapter.d.ts +2 -2
  16. package/dist/adapters/PostgresAdapter.cjs.map +1 -1
  17. package/dist/adapters/PostgresAdapter.d.cts +2 -2
  18. package/dist/adapters/PostgresAdapter.d.ts +2 -2
  19. package/dist/adapters/PostgresAdapter.js.map +1 -1
  20. package/dist/index.cjs +6 -5
  21. package/dist/index.cjs.map +1 -1
  22. package/dist/index.d.cts +8 -8
  23. package/dist/index.d.ts +8 -8
  24. package/dist/index.js +6 -5
  25. package/dist/index.js.map +1 -1
  26. package/dist/{instance-Cu6-qPxs.d.cts → instance-MWXPSsA6.d.cts} +20 -5
  27. package/dist/{instance-Cu6-qPxs.d.ts → instance-MWXPSsA6.d.ts} +20 -5
  28. package/dist/nestjs.cjs +6 -5
  29. package/dist/nestjs.cjs.map +1 -1
  30. package/dist/nestjs.d.cts +7 -7
  31. package/dist/nestjs.d.ts +7 -7
  32. package/dist/nestjs.js +6 -5
  33. package/dist/nestjs.js.map +1 -1
  34. package/dist/plugins/audit.d.cts +2 -2
  35. package/dist/plugins/audit.d.ts +2 -2
  36. package/dist/plugins/notify.d.cts +2 -2
  37. package/dist/plugins/notify.d.ts +2 -2
  38. package/dist/plugins/resilience.d.cts +3 -3
  39. package/dist/plugins/resilience.d.ts +3 -3
  40. package/dist/plugins/tracing.cjs.map +1 -1
  41. package/dist/plugins/tracing.d.cts +8 -2
  42. package/dist/plugins/tracing.d.ts +8 -2
  43. package/dist/plugins/tracing.js.map +1 -1
  44. package/dist/plugins/webhook.d.cts +2 -2
  45. package/dist/plugins/webhook.d.ts +2 -2
  46. package/dist/testing.cjs +6 -5
  47. package/dist/testing.cjs.map +1 -1
  48. package/dist/testing.d.cts +7 -7
  49. package/dist/testing.d.ts +7 -7
  50. package/dist/testing.js +6 -5
  51. package/dist/testing.js.map +1 -1
  52. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -5,6 +5,17 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
5
5
 
6
6
  ## [Unreleased]
7
7
 
8
+ ## [4.0.6] - 2026-09-26
9
+
10
+ ### Fixed
11
+
12
+ - `LevelResolver.resolveApprovers`'s empty-result error now names how many
13
+ approver configs were attempted, instead of a message that gave no clue
14
+ whether the level was misconfigured or its role/resolver simply had no
15
+ members.
16
+ - `transferApprovals`'s same-approver guard now names the offending id,
17
+ instead of a message that gave no clue which approver was passed twice.
18
+
8
19
  ## [4.0.5] - 2026-09-25
9
20
 
10
21
  ### 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-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';
1
+ import { I as IStorageAdapter, P as PaginationOpts, a as PaginatedResult, b as InstanceFilter, C as CursorPaginationOpts, c as CursorPaginatedResult } from './IStorageAdapter-_PjAgjFA.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-MWXPSsA6.cjs';
3
+ import { I as INotificationAdapter, b as ApprovalEventName, a as ApprovalEventMap } from './INotificationAdapter-BO6kmkyC.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-CsF_xD4b.cjs';
8
- import { I as IAuditAdapter } from './IAuditAdapter-Dqpkg-Tz.cjs';
7
+ import { I as IOperationMiddleware, a as ApprovalError } from './IOperationMiddleware-oYhWMKMn.cjs';
8
+ import { I as IAuditAdapter } from './IAuditAdapter-DR-WIAK6.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-D5mAFBTC.cjs';
11
+ import { I as IAuthorizationPolicy } from './IAuthorizationPolicy-BwYBOQM3.cjs';
12
12
 
13
13
  declare const SubmitOptionsSchema: z.ZodObject<{
14
14
  templateName: z.ZodString;
@@ -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-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';
1
+ import { I as IStorageAdapter, P as PaginationOpts, a as PaginatedResult, b as InstanceFilter, C as CursorPaginationOpts, c as CursorPaginatedResult } from './IStorageAdapter-DN78GD-1.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-MWXPSsA6.js';
3
+ import { I as INotificationAdapter, b as ApprovalEventName, a as ApprovalEventMap } from './INotificationAdapter-DKLEDgAk.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-C-N8MpHV.js';
8
- import { I as IAuditAdapter } from './IAuditAdapter-ggCTPf02.js';
7
+ import { I as IOperationMiddleware, a as ApprovalError } from './IOperationMiddleware-CUI6VG6r.js';
8
+ import { I as IAuditAdapter } from './IAuditAdapter-SNpV2hdt.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-BUHKvalu.js';
11
+ import { I as IAuthorizationPolicy } from './IAuthorizationPolicy-BMl0xS-j.js';
12
12
 
13
13
  declare const SubmitOptionsSchema: z.ZodObject<{
14
14
  templateName: z.ZodString;
@@ -1,4 +1,4 @@
1
- import { b as AuditEntry, a as ApprovalInstance } from './instance-Cu6-qPxs.cjs';
1
+ import { b as AuditEntry, a as ApprovalInstance } from './instance-MWXPSsA6.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-Cu6-qPxs.js';
1
+ import { b as AuditEntry, a as ApprovalInstance } from './instance-MWXPSsA6.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-Cu6-qPxs.js';
1
+ import { a as ApprovalInstance, d as ApprovalLevelInstance } from './instance-MWXPSsA6.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-Cu6-qPxs.cjs';
1
+ import { a as ApprovalInstance, d as ApprovalLevelInstance } from './instance-MWXPSsA6.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-Cu6-qPxs.cjs';
1
+ import { a as ApprovalInstance, b as AuditEntry } from './instance-MWXPSsA6.cjs';
2
2
 
3
3
  /** Common fields carried by every lifecycle event emitted for an approval instance. */
4
4
  interface ApprovalEvent {
@@ -14,6 +14,7 @@ interface ApprovalEvent {
14
14
  /** Emitted as `approval:submitted` when a new instance is raised. */
15
15
  interface SubmittedEvent extends ApprovalEvent {
16
16
  submittedBy: string;
17
+ /** Deduplicated union of every pending level's approvers in the opening group. */
17
18
  currentApprovers: string[];
18
19
  }
19
20
  /** Emitted as `approval:approved` when an approver accepts a level. */
@@ -21,6 +22,7 @@ interface ApprovedEvent extends ApprovalEvent {
21
22
  approverId: string;
22
23
  level: number;
23
24
  comment?: string;
25
+ /** True only when this was the last open branch — the instance is now fully approved. */
24
26
  isFinal: boolean;
25
27
  }
26
28
  /** Emitted as `approval:rejected` when an approver rejects a level. */
@@ -28,6 +30,11 @@ interface RejectedEvent extends ApprovalEvent {
28
30
  approverId: string;
29
31
  level: number;
30
32
  reason: string;
33
+ /**
34
+ * `'previous'` resets the chain to replay from an earlier level — the instance
35
+ * stays `pending`. `'originator'` and `null` are the same terminal outcome: the
36
+ * instance becomes `rejected`; `null` is just what an unset `returnTo` produces.
37
+ */
31
38
  returnTo: 'originator' | 'previous' | null;
32
39
  }
33
40
  /** Emitted as `approval:delegated` when an approver hands their decision to someone else. */
@@ -86,7 +93,9 @@ interface SlaBreachedEvent extends ApprovalEvent {
86
93
  * did not affect it.
87
94
  */
88
95
  interface DataUpdatedEvent extends ApprovalEvent {
96
+ /** Caller-supplied; not checked against the instance's submitter or approvers. */
89
97
  updatedBy: string;
98
+ /** Caller-supplied explanation for the change, if any. */
90
99
  reason?: string;
91
100
  /** Field paths whose values differ after the update. */
92
101
  changedFields: string[];
@@ -97,6 +106,7 @@ interface DataUpdatedEvent extends ApprovalEvent {
97
106
  }
98
107
  /** Emitted when a pending level's approvers are nudged. */
99
108
  interface ReminderEvent extends ApprovalEvent {
109
+ /** The level number being reminded. */
100
110
  level: number;
101
111
  /** Approvers who still owe a decision on this level. */
102
112
  recipients: string[];
@@ -105,8 +115,10 @@ interface ReminderEvent extends ApprovalEvent {
105
115
  }
106
116
  /** Emitted when an approver asks the submitter for clarification. */
107
117
  interface InfoRequestedEvent extends ApprovalEvent {
118
+ /** Must be an approver on `level` — enforced by requestInfo() before this is recorded. */
108
119
  askedBy: string;
109
120
  question: string;
121
+ /** The level `askedBy` was acting on when they asked. */
110
122
  level: number;
111
123
  /** Who is expected to answer — the submitter. */
112
124
  recipients: string[];
@@ -1,4 +1,4 @@
1
- import { a as ApprovalInstance, b as AuditEntry } from './instance-Cu6-qPxs.js';
1
+ import { a as ApprovalInstance, b as AuditEntry } from './instance-MWXPSsA6.js';
2
2
 
3
3
  /** Common fields carried by every lifecycle event emitted for an approval instance. */
4
4
  interface ApprovalEvent {
@@ -14,6 +14,7 @@ interface ApprovalEvent {
14
14
  /** Emitted as `approval:submitted` when a new instance is raised. */
15
15
  interface SubmittedEvent extends ApprovalEvent {
16
16
  submittedBy: string;
17
+ /** Deduplicated union of every pending level's approvers in the opening group. */
17
18
  currentApprovers: string[];
18
19
  }
19
20
  /** Emitted as `approval:approved` when an approver accepts a level. */
@@ -21,6 +22,7 @@ interface ApprovedEvent extends ApprovalEvent {
21
22
  approverId: string;
22
23
  level: number;
23
24
  comment?: string;
25
+ /** True only when this was the last open branch — the instance is now fully approved. */
24
26
  isFinal: boolean;
25
27
  }
26
28
  /** Emitted as `approval:rejected` when an approver rejects a level. */
@@ -28,6 +30,11 @@ interface RejectedEvent extends ApprovalEvent {
28
30
  approverId: string;
29
31
  level: number;
30
32
  reason: string;
33
+ /**
34
+ * `'previous'` resets the chain to replay from an earlier level — the instance
35
+ * stays `pending`. `'originator'` and `null` are the same terminal outcome: the
36
+ * instance becomes `rejected`; `null` is just what an unset `returnTo` produces.
37
+ */
31
38
  returnTo: 'originator' | 'previous' | null;
32
39
  }
33
40
  /** Emitted as `approval:delegated` when an approver hands their decision to someone else. */
@@ -86,7 +93,9 @@ interface SlaBreachedEvent extends ApprovalEvent {
86
93
  * did not affect it.
87
94
  */
88
95
  interface DataUpdatedEvent extends ApprovalEvent {
96
+ /** Caller-supplied; not checked against the instance's submitter or approvers. */
89
97
  updatedBy: string;
98
+ /** Caller-supplied explanation for the change, if any. */
90
99
  reason?: string;
91
100
  /** Field paths whose values differ after the update. */
92
101
  changedFields: string[];
@@ -97,6 +106,7 @@ interface DataUpdatedEvent extends ApprovalEvent {
97
106
  }
98
107
  /** Emitted when a pending level's approvers are nudged. */
99
108
  interface ReminderEvent extends ApprovalEvent {
109
+ /** The level number being reminded. */
100
110
  level: number;
101
111
  /** Approvers who still owe a decision on this level. */
102
112
  recipients: string[];
@@ -105,8 +115,10 @@ interface ReminderEvent extends ApprovalEvent {
105
115
  }
106
116
  /** Emitted when an approver asks the submitter for clarification. */
107
117
  interface InfoRequestedEvent extends ApprovalEvent {
118
+ /** Must be an approver on `level` — enforced by requestInfo() before this is recorded. */
108
119
  askedBy: string;
109
120
  question: string;
121
+ /** The level `askedBy` was acting on when they asked. */
110
122
  level: number;
111
123
  /** Who is expected to answer — the submitter. */
112
124
  recipients: string[];
@@ -1,4 +1,4 @@
1
- import { a as ApprovalInstance } from './instance-Cu6-qPxs.js';
1
+ import { a as ApprovalInstance } from './instance-MWXPSsA6.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 {
@@ -37,6 +37,7 @@ declare class ApprovalTemplateNotFoundError extends ApprovalError {
37
37
  type EngineOperation = 'submit' | 'approve' | 'reject' | 'delegate' | 'reassign' | 'cancel' | 'updateData' | 'requestInfo' | 'provideInfo' | 'addAttachment' | 'removeAttachment' | 'addComment' | 'resubmit' | 'override';
38
38
  /** Context passed to an {@link IOperationMiddleware} hook for one engine call. */
39
39
  interface OperationContext<T = unknown> {
40
+ /** Which engine method is running; see {@link EngineOperation}. */
40
41
  operation: EngineOperation;
41
42
  /** The target instance's id, for operations that act on an existing instance. */
42
43
  instanceId?: string;
@@ -1,4 +1,4 @@
1
- import { a as ApprovalInstance } from './instance-Cu6-qPxs.cjs';
1
+ import { a as ApprovalInstance } from './instance-MWXPSsA6.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 {
@@ -37,6 +37,7 @@ declare class ApprovalTemplateNotFoundError extends ApprovalError {
37
37
  type EngineOperation = 'submit' | 'approve' | 'reject' | 'delegate' | 'reassign' | 'cancel' | 'updateData' | 'requestInfo' | 'provideInfo' | 'addAttachment' | 'removeAttachment' | 'addComment' | 'resubmit' | 'override';
38
38
  /** Context passed to an {@link IOperationMiddleware} hook for one engine call. */
39
39
  interface OperationContext<T = unknown> {
40
+ /** Which engine method is running; see {@link EngineOperation}. */
40
41
  operation: EngineOperation;
41
42
  /** The target instance's id, for operations that act on an existing instance. */
42
43
  instanceId?: string;
@@ -1,23 +1,31 @@
1
- import { A as ApprovalTemplate, a as ApprovalInstance, f as ApprovalStatus, b as AuditEntry } from './instance-Cu6-qPxs.cjs';
1
+ import { A as ApprovalTemplate, a as ApprovalInstance, f as ApprovalStatus, b as AuditEntry } from './instance-MWXPSsA6.js';
2
2
 
3
3
  /** Offset-based pagination request. */
4
4
  interface PaginationOpts {
5
+ /** Maximum number of items to return. */
5
6
  limit: number;
7
+ /** Number of matching items to skip before the page starts. */
6
8
  offset: number;
7
9
  }
8
10
  /** Offset-based pagination response, including the total matching count. */
9
11
  interface PaginatedResult<T> {
12
+ /** The requested page's items. */
10
13
  items: T[];
14
+ /** Total number of items matching the query, across all pages. */
11
15
  total: number;
12
16
  }
13
17
  /** Opaque cursor: base64(updatedAt_iso:id). Use the value from nextCursor/prevCursor. */
14
18
  interface CursorPaginationOpts {
19
+ /** Cursor from a previous page's `nextCursor`/`prevCursor`; omit to start from the first page. */
15
20
  cursor?: string;
21
+ /** Maximum number of items to return. */
16
22
  limit: number;
23
+ /** Which way to page from `cursor`. Defaults to `'forward'`. */
17
24
  direction?: 'forward' | 'backward';
18
25
  }
19
26
  /** Cursor-based pagination response. */
20
27
  interface CursorPaginatedResult<T> {
28
+ /** The requested page's items. */
21
29
  items: T[];
22
30
  /** Pass as `cursor` with `direction: 'forward'` to fetch the next page, if any. */
23
31
  nextCursor?: string;
@@ -27,11 +35,17 @@ interface CursorPaginatedResult<T> {
27
35
  hasMore: boolean;
28
36
  }
29
37
  interface InstanceFilter {
38
+ /** Match only instances in this status. */
30
39
  status?: ApprovalStatus;
40
+ /** Match only instances of this document type. */
31
41
  documentType?: string;
42
+ /** Match only instances submitted by this user or system id. */
32
43
  submittedBy?: string;
44
+ /** Match only instances created from this template. */
33
45
  templateName?: string;
46
+ /** Match only instances created on or after this date. */
34
47
  fromDate?: Date;
48
+ /** Match only instances created on or before this date. */
35
49
  toDate?: Date;
36
50
  /**
37
51
  * Match instances whose document `data` contains these field/value pairs —
@@ -1,23 +1,31 @@
1
- import { A as ApprovalTemplate, a as ApprovalInstance, f as ApprovalStatus, b as AuditEntry } from './instance-Cu6-qPxs.js';
1
+ import { A as ApprovalTemplate, a as ApprovalInstance, f as ApprovalStatus, b as AuditEntry } from './instance-MWXPSsA6.cjs';
2
2
 
3
3
  /** Offset-based pagination request. */
4
4
  interface PaginationOpts {
5
+ /** Maximum number of items to return. */
5
6
  limit: number;
7
+ /** Number of matching items to skip before the page starts. */
6
8
  offset: number;
7
9
  }
8
10
  /** Offset-based pagination response, including the total matching count. */
9
11
  interface PaginatedResult<T> {
12
+ /** The requested page's items. */
10
13
  items: T[];
14
+ /** Total number of items matching the query, across all pages. */
11
15
  total: number;
12
16
  }
13
17
  /** Opaque cursor: base64(updatedAt_iso:id). Use the value from nextCursor/prevCursor. */
14
18
  interface CursorPaginationOpts {
19
+ /** Cursor from a previous page's `nextCursor`/`prevCursor`; omit to start from the first page. */
15
20
  cursor?: string;
21
+ /** Maximum number of items to return. */
16
22
  limit: number;
23
+ /** Which way to page from `cursor`. Defaults to `'forward'`. */
17
24
  direction?: 'forward' | 'backward';
18
25
  }
19
26
  /** Cursor-based pagination response. */
20
27
  interface CursorPaginatedResult<T> {
28
+ /** The requested page's items. */
21
29
  items: T[];
22
30
  /** Pass as `cursor` with `direction: 'forward'` to fetch the next page, if any. */
23
31
  nextCursor?: string;
@@ -27,11 +35,17 @@ interface CursorPaginatedResult<T> {
27
35
  hasMore: boolean;
28
36
  }
29
37
  interface InstanceFilter {
38
+ /** Match only instances in this status. */
30
39
  status?: ApprovalStatus;
40
+ /** Match only instances of this document type. */
31
41
  documentType?: string;
42
+ /** Match only instances submitted by this user or system id. */
32
43
  submittedBy?: string;
44
+ /** Match only instances created from this template. */
33
45
  templateName?: string;
46
+ /** Match only instances created on or after this date. */
34
47
  fromDate?: Date;
48
+ /** Match only instances created on or before this date. */
35
49
  toDate?: Date;
36
50
  /**
37
51
  * Match instances whose document `data` contains these field/value pairs —
@@ -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-CrbVtEE-.cjs';
2
- import { A as ApprovalTemplate, a as ApprovalInstance, b as AuditEntry } from '../instance-Cu6-qPxs.cjs';
1
+ import { I as IStorageAdapter, P as PaginationOpts, a as PaginatedResult, b as InstanceFilter, C as CursorPaginationOpts, c as CursorPaginatedResult } from '../IStorageAdapter-_PjAgjFA.cjs';
2
+ import { A as ApprovalTemplate, a as ApprovalInstance, b as AuditEntry } from '../instance-MWXPSsA6.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-DDOW9z0L.js';
2
- import { A as ApprovalTemplate, a as ApprovalInstance, b as AuditEntry } from '../instance-Cu6-qPxs.js';
1
+ import { I as IStorageAdapter, P as PaginationOpts, a as PaginatedResult, b as InstanceFilter, C as CursorPaginationOpts, c as CursorPaginatedResult } from '../IStorageAdapter-DN78GD-1.js';
2
+ import { A as ApprovalTemplate, a as ApprovalInstance, b as AuditEntry } from '../instance-MWXPSsA6.js';
3
3
 
4
4
  /**
5
5
  * In-process {@link IStorageAdapter} backed by two `Map`s, keyed by