ngx-t-workflow-typings 1.0.2 → 3.1.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.
- package/README.md +201 -89
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -18
- package/dist/interfaces/Backend/EscalationLevel.interface.d.ts +40 -2
- package/dist/interfaces/Backend/EscalationLevel.interface.js +14 -7
- package/dist/interfaces/Backend/FollowUpOperation.interface.js +1 -2
- package/dist/interfaces/Backend/index.d.ts +1 -3
- package/dist/interfaces/Backend/index.js +32 -6
- package/dist/interfaces/Config/ElementEditorConfig.interface.d.ts +1 -1
- package/dist/interfaces/Config/ElementEditorConfig.interface.js +2 -5
- package/dist/interfaces/Config/ElementEditorConfigSection.interface.d.ts +67 -4
- package/dist/interfaces/Config/ElementEditorConfigSection.interface.js +1 -2
- package/dist/interfaces/Config/ExtendedDbForm.interface.js +1 -2
- package/dist/interfaces/Config/NgxTWorkflowsConfig.interface.d.ts +52 -5
- package/dist/interfaces/Config/NgxTWorkflowsConfig.interface.js +1 -2
- package/dist/interfaces/Config/index.d.ts +7 -5
- package/dist/interfaces/Config/index.js +1 -5
- package/dist/interfaces/Diagram/WorkflowDiagram.interface.d.ts +24 -1
- package/dist/interfaces/Diagram/WorkflowDiagram.interface.js +1 -2
- package/dist/interfaces/Diagram/index.d.ts +1 -14
- package/dist/interfaces/Diagram/index.js +12 -2
- package/dist/interfaces/Dialog/ConfirmDialog.interface.d.ts +13 -0
- package/dist/interfaces/Dialog/ConfirmDialog.interface.js +1 -0
- package/dist/interfaces/Dialog/index.d.ts +1 -0
- package/dist/interfaces/Dialog/index.js +1 -0
- package/dist/interfaces/Document/WorkFlowDocument.interface.d.ts +55 -3
- package/dist/interfaces/Document/WorkFlowDocument.interface.js +18 -5
- package/dist/interfaces/Document/index.d.ts +4 -2
- package/dist/interfaces/Document/index.js +1 -5
- package/dist/interfaces/DocumentSection/DocumentSectionConfigurations.interface.d.ts +101 -3
- package/dist/interfaces/DocumentSection/DocumentSectionConfigurations.interface.js +53 -7
- package/dist/interfaces/DocumentSection/index.d.ts +2 -2
- package/dist/interfaces/DocumentSection/index.js +1 -6
- package/dist/interfaces/ProcessStep/DocumentWorkflowStep.interface.d.ts +166 -6
- package/dist/interfaces/ProcessStep/DocumentWorkflowStep.interface.js +1 -2
- package/dist/interfaces/ProcessStep/NodeConfig.interface.d.ts +1 -1
- package/dist/interfaces/ProcessStep/NodeConfig.interface.js +1 -2
- package/dist/interfaces/ProcessStep/ProcessStep.interface.d.ts +203 -14
- package/dist/interfaces/ProcessStep/ProcessStep.interface.js +77 -5
- package/dist/interfaces/ProcessStep/WorkflowStepType.interface.d.ts +48 -0
- package/dist/interfaces/ProcessStep/WorkflowStepType.interface.js +43 -7
- package/dist/interfaces/ProcessStep/index.d.ts +25 -12
- package/dist/interfaces/ProcessStep/index.js +16 -11
- package/dist/interfaces/Requirements/StepReferenceRules.constant.d.ts +77 -0
- package/dist/interfaces/Requirements/StepReferenceRules.constant.js +889 -0
- package/dist/interfaces/Requirements/StepReferenceRules.interface.d.ts +623 -0
- package/dist/interfaces/Requirements/StepReferenceRules.interface.js +219 -0
- package/dist/interfaces/Requirements/StepTypeRequirements.constant.d.ts +43 -0
- package/dist/interfaces/Requirements/StepTypeRequirements.constant.js +1212 -0
- package/dist/interfaces/Requirements/StepTypeRequirements.interface.d.ts +352 -0
- package/dist/interfaces/Requirements/StepTypeRequirements.interface.js +74 -0
- package/dist/interfaces/Requirements/index.d.ts +9 -0
- package/dist/interfaces/Requirements/index.js +9 -0
- package/dist/interfaces/Requirements/stepPath.d.ts +22 -0
- package/dist/interfaces/Requirements/stepPath.js +84 -0
- package/dist/interfaces/Requirements/validateStepReferences.d.ts +70 -0
- package/dist/interfaces/Requirements/validateStepReferences.js +845 -0
- package/dist/interfaces/Schedule/WorkflowSchedule.interface.js +1 -2
- package/dist/interfaces/Schedule/index.d.ts +1 -1
- package/dist/interfaces/Schedule/index.js +1 -2
- package/dist/interfaces/Tag/TransactionTag.interface.d.ts +16 -1
- package/dist/interfaces/Tag/TransactionTag.interface.js +1 -2
- package/dist/interfaces/Tag/index.d.ts +1 -1
- package/dist/interfaces/Tag/index.js +1 -2
- package/dist/interfaces/TransactionReportEditor/ClickableVariable.interface.d.ts +18 -0
- package/dist/interfaces/TransactionReportEditor/ClickableVariable.interface.js +1 -0
- package/dist/interfaces/TransactionReportEditor/ContentType.interface.d.ts +40 -0
- package/dist/interfaces/TransactionReportEditor/ContentType.interface.js +46 -0
- package/dist/interfaces/TransactionReportEditor/ElementEditorTypesTransactionReport.interface.d.ts +17 -0
- package/dist/interfaces/TransactionReportEditor/ElementEditorTypesTransactionReport.interface.js +10 -0
- package/dist/interfaces/TransactionReportEditor/OrganizationHeader.interface.d.ts +49 -0
- package/dist/interfaces/TransactionReportEditor/OrganizationHeader.interface.js +1 -0
- package/dist/interfaces/TransactionReportEditor/Size.type.d.ts +10 -0
- package/dist/interfaces/TransactionReportEditor/Size.type.js +1 -0
- package/dist/interfaces/TransactionReportEditor/index.d.ts +6 -0
- package/dist/interfaces/TransactionReportEditor/index.js +2 -0
- package/dist/interfaces/Workflow/WorkflowModel.interface.d.ts +90 -3
- package/dist/interfaces/Workflow/WorkflowModel.interface.js +1 -2
- package/dist/interfaces/Workflow/WorkflowPointingRule.interface.js +1 -2
- package/dist/interfaces/Workflow/index.d.ts +2 -3
- package/dist/interfaces/Workflow/index.js +12 -2
- package/dist/interfaces/index.d.ts +12 -9
- package/dist/interfaces/index.js +12 -25
- package/dist/schemas/Backend/EscalationLevel.schema.js +8 -15
- package/dist/schemas/Backend/FollowUpOperation.schema.js +13 -20
- package/dist/schemas/Backend/index.d.ts +1 -2
- package/dist/schemas/Backend/index.js +10 -10
- package/dist/schemas/Document/WorkFlowDocument.schema.js +61 -66
- package/dist/schemas/Document/index.d.ts +1 -1
- package/dist/schemas/Document/index.js +1 -8
- package/dist/schemas/ProcessStep/ProcessStep.schema.d.ts +7 -0
- package/dist/schemas/ProcessStep/ProcessStep.schema.js +120 -94
- package/dist/schemas/ProcessStep/ProcessStepByType.schema.d.ts +66 -0
- package/dist/schemas/ProcessStep/ProcessStepByType.schema.js +439 -0
- package/dist/schemas/ProcessStep/index.d.ts +2 -1
- package/dist/schemas/ProcessStep/index.js +2 -8
- package/dist/schemas/Schedule/WorkflowSchedule.schema.js +27 -36
- package/dist/schemas/Schedule/index.d.ts +1 -1
- package/dist/schemas/Schedule/index.js +1 -10
- package/dist/schemas/Tag/TransactionTag.schema.js +33 -40
- package/dist/schemas/Tag/index.d.ts +1 -1
- package/dist/schemas/Tag/index.js +1 -9
- package/dist/schemas/Workflow/WorkflowModel.schema.d.ts +9 -0
- package/dist/schemas/Workflow/WorkflowModel.schema.js +52 -35
- package/dist/schemas/Workflow/index.d.ts +1 -1
- package/dist/schemas/Workflow/index.js +1 -6
- package/dist/schemas/index.d.ts +6 -6
- package/dist/schemas/index.js +6 -22
- package/dist/types/util.type.js +1 -2
- package/package.json +26 -7
- package/dist/interfaces/Workflow/WorkflowNodeData.interface.d.ts +0 -23
- package/dist/interfaces/Workflow/WorkflowNodeData.interface.js +0 -2
package/README.md
CHANGED
|
@@ -1,89 +1,201 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
Typings and interfaces for the [ngx-t-workflows](https://github.com/mashegoTerrence/ngx-t-workflows) library. Provides TypeScript interfaces, enums, and Joi schemas for workflow-related data structures and runtime validation.
|
|
4
|
-
|
|
5
|
-
## Installation
|
|
6
|
-
|
|
7
|
-
```bash
|
|
8
|
-
npm install
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
### Peer Dependencies
|
|
12
|
-
|
|
13
|
-
- `ngx-t-forms-types`
|
|
14
|
-
- `rxjs`
|
|
15
|
-
|
|
16
|
-
##
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
```
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
```
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
1
|
+
# ngx-t-workflow-typings
|
|
2
|
+
|
|
3
|
+
Typings and interfaces for the [ngx-t-workflows](https://github.com/mashegoTerrence/ngx-t-workflows) library. Provides TypeScript interfaces, enums, and Joi schemas for workflow-related data structures and runtime validation.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install ngx-t-workflow-typings
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
### Peer Dependencies
|
|
12
|
+
|
|
13
|
+
- `ngx-t-forms-types` >=0.0.16
|
|
14
|
+
- `rxjs` >=7.8.0
|
|
15
|
+
|
|
16
|
+
## Entry points
|
|
17
|
+
|
|
18
|
+
Three subpaths. Import types from `./interfaces` in a browser bundle — the root
|
|
19
|
+
entry re-exports the Joi schemas, so importing a type from it drags `joi` into
|
|
20
|
+
the module graph.
|
|
21
|
+
|
|
22
|
+
| Specifier | Contents | Pulls `joi`? |
|
|
23
|
+
|---|---|---|
|
|
24
|
+
| `ngx-t-workflow-typings` | interfaces + enums + Joi schemas (back-compat) | yes |
|
|
25
|
+
| `ngx-t-workflow-typings/interfaces` | interfaces + enums only | **no** |
|
|
26
|
+
| `ngx-t-workflow-typings/schemas` | Joi schemas and `validate*` helpers | yes |
|
|
27
|
+
|
|
28
|
+
`main`/`types` still point at the root build for resolvers that ignore
|
|
29
|
+
`exports`, and `./dist/*` stays addressable so existing deep imports keep working.
|
|
30
|
+
|
|
31
|
+
```typescript
|
|
32
|
+
// Angular app / anything bundled for the browser
|
|
33
|
+
import { WorkflowStepStatus, type ProcessStep } from 'ngx-t-workflow-typings/interfaces';
|
|
34
|
+
|
|
35
|
+
// Backend validation
|
|
36
|
+
import { validateProcessStep } from 'ngx-t-workflow-typings/schemas';
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Strict enums
|
|
40
|
+
|
|
41
|
+
Fields with a well-defined value set are typed with real enums, not string
|
|
42
|
+
literals. Assigning a raw literal is a compile error by design:
|
|
43
|
+
|
|
44
|
+
```typescript
|
|
45
|
+
step.status = 'complete'; // ✗ error
|
|
46
|
+
step.status = WorkflowStepStatus.COMPLETE; // ✓
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
The permissive predecessors (`WorkflowStepStatusValue`, `EscalationLevelType`,
|
|
50
|
+
`EscalationLevelPeriodType`, `RecentlyViewedStatusType`, `AdjudicationValue`,
|
|
51
|
+
`LegacyBulkEmailConfig`, `LegacyDocumentWorkflowStep`,
|
|
52
|
+
`LegacyDocumentActivityLog`, `LooseDeepBindPath`, and
|
|
53
|
+
`StepValidationOverride.attachment.type`) remain exported and are each tagged
|
|
54
|
+
`@deprecated` naming the replacement. They are removed in the next major.
|
|
55
|
+
|
|
56
|
+
### Persisted vs. presentation step kinds
|
|
57
|
+
|
|
58
|
+
`WorkflowStepTypeEnum` is DB-constrained (`stepType: { type: String, enum:
|
|
59
|
+
Object.values(WorkflowStepTypeEnum) }`) and holds only the 12 persisted kinds.
|
|
60
|
+
Client-synthesised placeholder rows (`'upcoming'`, `'error'`) live in a separate
|
|
61
|
+
`SyntheticStepType` enum, and `DisplayStepType` is the union of both. Use
|
|
62
|
+
`DisplayStepType` for view models; never for anything written to the database.
|
|
63
|
+
|
|
64
|
+
## Usage
|
|
65
|
+
|
|
66
|
+
### Interfaces and Types
|
|
67
|
+
|
|
68
|
+
```typescript
|
|
69
|
+
import {
|
|
70
|
+
WorkflowModel,
|
|
71
|
+
ProcessStep,
|
|
72
|
+
DocumentWorkflowStep,
|
|
73
|
+
WorkFlowDocumentInterface,
|
|
74
|
+
WorkflowStepTypeEnum,
|
|
75
|
+
WorkflowStepStatus,
|
|
76
|
+
} from 'ngx-t-workflow-typings';
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
### Runtime Validation (Joi Schemas)
|
|
80
|
+
|
|
81
|
+
```typescript
|
|
82
|
+
import {
|
|
83
|
+
validateProcessStep,
|
|
84
|
+
validateWorkflowModel,
|
|
85
|
+
validateWorkFlowDocument,
|
|
86
|
+
validateTaskSLAConfig,
|
|
87
|
+
validateITransactionTag,
|
|
88
|
+
} from 'ngx-t-workflow-typings';
|
|
89
|
+
|
|
90
|
+
const errors = validateProcessStep(stepData);
|
|
91
|
+
if (errors.length > 0) {
|
|
92
|
+
console.error('Validation failed:', errors);
|
|
93
|
+
}
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
### Schemas (for custom validation)
|
|
97
|
+
|
|
98
|
+
```typescript
|
|
99
|
+
import {
|
|
100
|
+
processStepSchema,
|
|
101
|
+
workflowModelSchema,
|
|
102
|
+
workFlowDocumentSchema,
|
|
103
|
+
} from 'ngx-t-workflow-typings';
|
|
104
|
+
|
|
105
|
+
const { error, value } = processStepSchema.validate(data);
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
## Step validation — two layers
|
|
109
|
+
|
|
110
|
+
| Layer | API | Asks | Import from |
|
|
111
|
+
|---|---|---|---|
|
|
112
|
+
| Per-field | `validateProcessStepForType(step, stepType)` | Is this field filled in and correctly typed? | `/schemas` (pulls `joi`) |
|
|
113
|
+
| Cross-reference | `validateStepReferences(step, ctx?)` | Does what it points AT exist, and is it the right kind of thing? | `/interfaces` (**no `joi`**) |
|
|
114
|
+
|
|
115
|
+
Run both; they do not overlap. An empty field is reported only by the per-field
|
|
116
|
+
layer, a dangling pointer only by the cross-reference layer.
|
|
117
|
+
|
|
118
|
+
### Cross-reference validation is tri-state
|
|
119
|
+
|
|
120
|
+
The forms catalog is unsound for negative conclusions — the host filters it to
|
|
121
|
+
the user's department and swallows load errors into empty pools — so
|
|
122
|
+
"not in the pool" never means "does not exist". Every check resolves to
|
|
123
|
+
`satisfied | violated | indeterminate`.
|
|
124
|
+
|
|
125
|
+
**`indeterminate` never enters `errors`, never makes `valid` false, and must
|
|
126
|
+
never render as an error.** It is also not a pass. Omit the context and
|
|
127
|
+
everything catalog-dependent is `indeterminate`.
|
|
128
|
+
|
|
129
|
+
```typescript
|
|
130
|
+
import {
|
|
131
|
+
validateStepReferences,
|
|
132
|
+
ReferenceCatalogStatus,
|
|
133
|
+
} from 'ngx-t-workflow-typings/interfaces';
|
|
134
|
+
|
|
135
|
+
const result = validateStepReferences(step, {
|
|
136
|
+
forms: formIndex, // Map<formId, { byControlName: Map<name, input> }>
|
|
137
|
+
workflows: workflowIndex, // Map<workflowId, { initiateStepId, initiateFormId, initiateReference }>
|
|
138
|
+
processTree: stepIndex, // Map<String(stepId), step>
|
|
139
|
+
workflowControlNames: unionSet, // Set<formControlName>
|
|
140
|
+
});
|
|
141
|
+
|
|
142
|
+
if (!result.valid) blockSave(result.errors); // never contains `indeterminate`
|
|
143
|
+
showPending(result.indeterminate); // "not checked yet"
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
### The caller owns the indexes
|
|
147
|
+
|
|
148
|
+
The validator builds nothing. Build these once per emission and memoise them —
|
|
149
|
+
with them every check is O(1); a full pass over a step is O(rules), max 6.
|
|
150
|
+
|
|
151
|
+
| Context member | Shape | Rebuild when | Cost |
|
|
152
|
+
|---|---|---|---|
|
|
153
|
+
| `forms` | `Map<formId, { byControlName: Map<name, input> }>` | forms catalog emits | O(F × cols) |
|
|
154
|
+
| `workflows` | `Map<workflowId, { initiateStepId, initiateFormId, initiateReference }>` | workflow pool emits | O(W + V′) |
|
|
155
|
+
| `processTree` | `Map<String(stepId), step>` (an array also works, at O(V) per link) | steps change | O(V) |
|
|
156
|
+
| `workflowControlNames` | `Set<formControlName>` unioned over bound forms | forms catalog emits | O(F × cols) |
|
|
157
|
+
|
|
158
|
+
Pass `status: ReferenceCatalogStatus.Pending | Ready | Failed` explicitly — do
|
|
159
|
+
not let the validator infer readiness from `size === 0`, because an empty pool is
|
|
160
|
+
a legitimate outcome of both the department filter and the error fallback.
|
|
161
|
+
|
|
162
|
+
### Catalog-free rules
|
|
163
|
+
|
|
164
|
+
The five step→step rules (`CATALOG_FREE_STEP_REFERENCE_RULES`) resolve against
|
|
165
|
+
the workflow's own `processTree` and are definitive the moment you pass it — no
|
|
166
|
+
external catalog, no async, safe in a synchronous per-keystroke validation pass.
|
|
167
|
+
|
|
168
|
+
`EXCLUDED_STEP_REFERENCES` records, as data, the references that look
|
|
169
|
+
validatable and deliberately are not, with the evidence for each.
|
|
170
|
+
|
|
171
|
+
## Package Structure
|
|
172
|
+
|
|
173
|
+
| Path | Contents |
|
|
174
|
+
|------|----------|
|
|
175
|
+
| `interfaces/Backend` | Follow-up operations, escalation levels |
|
|
176
|
+
| `interfaces/Config` | NgxTWorkflowsConfig, element editor config |
|
|
177
|
+
| `interfaces/Document` | WorkFlowDocument, IRecentlyViewed |
|
|
178
|
+
| `interfaces/DocumentSection` | Document section configurations |
|
|
179
|
+
| `interfaces/Diagram` | Workflow diagram nodes, connections, reference pools |
|
|
180
|
+
| `interfaces/ProcessStep` | ProcessStep, DocumentWorkflowStep, step types |
|
|
181
|
+
| `interfaces/Requirements` | Per-field requirements map, cross-reference rules, both validators |
|
|
182
|
+
| `interfaces/Schedule` | Duration, WorkSchedule, TaskSLAConfig |
|
|
183
|
+
| `interfaces/Tag` | Transaction tags, metadata, assignments |
|
|
184
|
+
| `interfaces/Workflow` | WorkflowModel (lean), DbWorkflowModel |
|
|
185
|
+
| `schemas/*` | Joi schemas and `validate*` helpers |
|
|
186
|
+
|
|
187
|
+
## Development
|
|
188
|
+
|
|
189
|
+
```bash
|
|
190
|
+
npm install
|
|
191
|
+
npm run build
|
|
192
|
+
npm run typecheck
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
## Publishing
|
|
196
|
+
|
|
197
|
+
See [PUBLISH-CHECKLIST.md](./PUBLISH-CHECKLIST.md) for step-by-step publishing instructions. See [RULES.md](./RULES.md) for versioning guidelines and security practices.
|
|
198
|
+
|
|
199
|
+
## License
|
|
200
|
+
|
|
201
|
+
ISC
|
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './interfaces/index';
|
|
2
|
-
export * from './schemas/index';
|
|
1
|
+
export * from './interfaces/index.js';
|
|
2
|
+
export * from './schemas/index.js';
|
package/dist/index.js
CHANGED
|
@@ -1,18 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./interfaces/index"), exports);
|
|
18
|
-
__exportStar(require("./schemas/index"), exports);
|
|
1
|
+
export * from './interfaces/index.js';
|
|
2
|
+
export * from './schemas/index.js';
|
|
@@ -1,16 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Escalation mechanism for a workflow step.
|
|
3
|
+
*
|
|
4
|
+
* NOTE: `SeniorEscalation = 'seniorEsalation'` is misspelled in its VALUE. The
|
|
5
|
+
* spelling is preserved verbatim because it is what is persisted in the database
|
|
6
|
+
* (`iserve-shared-types/src/schemas/Workflow/WorkflowSubSchemas.schema.ts` ->
|
|
7
|
+
* `DbEscalationLevelSchema.type.enum = Object.values(EscalationType)`).
|
|
8
|
+
* Do not "fix" it without a data migration.
|
|
9
|
+
*/
|
|
1
10
|
export declare enum EscalationType {
|
|
2
11
|
Auto = "auto",
|
|
3
12
|
Manual = "manual",
|
|
4
13
|
SeniorEscalation = "seniorEsalation"
|
|
5
14
|
}
|
|
15
|
+
/** Unit the `period` on an escalation level is expressed in. */
|
|
6
16
|
export declare enum PeriodType {
|
|
7
17
|
Days = "days",
|
|
8
18
|
Months = "months",
|
|
9
19
|
Years = "years"
|
|
10
20
|
}
|
|
21
|
+
/**
|
|
22
|
+
* @deprecated Use the {@link EscalationType} enum. This permissive alias is the
|
|
23
|
+
* string-literal projection `` `${EscalationType}` `` — it accepts raw string
|
|
24
|
+
* literals (`'auto'`) and enforces nothing beyond the spelling. Kept exported
|
|
25
|
+
* only so in-flight consumer code compiles during the migration; removed in the
|
|
26
|
+
* next major.
|
|
27
|
+
*
|
|
28
|
+
* Migration: `type: 'auto'` -> `type: EscalationType.Auto`.
|
|
29
|
+
*/
|
|
30
|
+
export type EscalationLevelType = `${EscalationType}`;
|
|
31
|
+
/**
|
|
32
|
+
* @deprecated Use the {@link PeriodType} enum. String-literal projection
|
|
33
|
+
* `` `${PeriodType}` ``; see {@link EscalationLevelType} for the rationale and
|
|
34
|
+
* removal plan.
|
|
35
|
+
*
|
|
36
|
+
* Migration: `periodType: 'days'` -> `periodType: PeriodType.Days`.
|
|
37
|
+
*/
|
|
38
|
+
export type EscalationLevelPeriodType = `${PeriodType}`;
|
|
11
39
|
export interface EscalationLevelInterface {
|
|
12
|
-
|
|
13
|
-
|
|
40
|
+
/**
|
|
41
|
+
* Escalation mechanism. Strictly {@link EscalationType} — the DB column is
|
|
42
|
+
* constrained to `Object.values(EscalationType)`
|
|
43
|
+
* (`iserve-shared-types/src/schemas/Workflow/WorkflowSubSchemas.schema.ts:41`),
|
|
44
|
+
* so the enum is the enforced truth and raw literals are a compile error.
|
|
45
|
+
*/
|
|
46
|
+
type: EscalationType;
|
|
47
|
+
/**
|
|
48
|
+
* Unit `period` is expressed in. Strictly {@link PeriodType}; same DB
|
|
49
|
+
* constraint (`WorkflowSubSchemas.schema.ts:42`).
|
|
50
|
+
*/
|
|
51
|
+
periodType: PeriodType;
|
|
14
52
|
members: string[];
|
|
15
53
|
period: number;
|
|
16
54
|
}
|
|
@@ -1,15 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Escalation mechanism for a workflow step.
|
|
3
|
+
*
|
|
4
|
+
* NOTE: `SeniorEscalation = 'seniorEsalation'` is misspelled in its VALUE. The
|
|
5
|
+
* spelling is preserved verbatim because it is what is persisted in the database
|
|
6
|
+
* (`iserve-shared-types/src/schemas/Workflow/WorkflowSubSchemas.schema.ts` ->
|
|
7
|
+
* `DbEscalationLevelSchema.type.enum = Object.values(EscalationType)`).
|
|
8
|
+
* Do not "fix" it without a data migration.
|
|
9
|
+
*/
|
|
10
|
+
export var EscalationType;
|
|
5
11
|
(function (EscalationType) {
|
|
6
12
|
EscalationType["Auto"] = "auto";
|
|
7
13
|
EscalationType["Manual"] = "manual";
|
|
8
14
|
EscalationType["SeniorEscalation"] = "seniorEsalation";
|
|
9
|
-
})(EscalationType || (
|
|
10
|
-
|
|
15
|
+
})(EscalationType || (EscalationType = {}));
|
|
16
|
+
/** Unit the `period` on an escalation level is expressed in. */
|
|
17
|
+
export var PeriodType;
|
|
11
18
|
(function (PeriodType) {
|
|
12
19
|
PeriodType["Days"] = "days";
|
|
13
20
|
PeriodType["Months"] = "months";
|
|
14
21
|
PeriodType["Years"] = "years";
|
|
15
|
-
})(PeriodType || (
|
|
22
|
+
})(PeriodType || (PeriodType = {}));
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
export {};
|
|
@@ -1,3 +1 @@
|
|
|
1
|
-
export type { BackendApiRequiredParams, BackEndFollowUpOperationInterface, } from './FollowUpOperation.interface';
|
|
2
|
-
export { EscalationType, PeriodType, } from './EscalationLevel.interface';
|
|
3
|
-
export type { EscalationLevelInterface } from './EscalationLevel.interface';
|
|
1
|
+
export type { BackendApiRequiredParams, BackEndFollowUpOperationInterface, } from './FollowUpOperation.interface.js';
|
|
@@ -1,6 +1,32 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
export {};
|
|
2
|
+
/*
|
|
3
|
+
* ESCALATION — WITHDRAWN, PENDING A PROPER FEATURE.
|
|
4
|
+
*
|
|
5
|
+
* Nothing is re-exported from `./EscalationLevel.interface` while the feature is
|
|
6
|
+
* out. The declarations in that file are kept (also commented) so reintroduction
|
|
7
|
+
* is a diff rather than a rewrite.
|
|
8
|
+
*
|
|
9
|
+
* The feature never worked end to end:
|
|
10
|
+
* - this package and the Mongoose column spelled the field `escalationRulee`;
|
|
11
|
+
* - the engine reads `escalationRules`
|
|
12
|
+
* (`osproc-be/src/services/workflow.ts:748,934,966,984`);
|
|
13
|
+
* - the only editor control that could author either spelling is commented out
|
|
14
|
+
* (`processStepEditorConfig.ts:480-497`).
|
|
15
|
+
* There was no producer, and the reader dereferenced a key nothing writes —
|
|
16
|
+
* `undefined` every time, so no auto-escalation was ever scheduled.
|
|
17
|
+
*
|
|
18
|
+
* Withdrawing it removes a public surface that promised behaviour the system
|
|
19
|
+
* could not deliver. `ENGINE_INTEGRITY_NOTES` records the full history.
|
|
20
|
+
*
|
|
21
|
+
* export {
|
|
22
|
+
* EscalationType,
|
|
23
|
+
* PeriodType,
|
|
24
|
+
* } from './EscalationLevel.interface.js';
|
|
25
|
+
* export type { EscalationLevelInterface } from './EscalationLevel.interface.js';
|
|
26
|
+
*
|
|
27
|
+
* // @deprecated Use the EscalationType / PeriodType enums.
|
|
28
|
+
* export type {
|
|
29
|
+
* EscalationLevelType,
|
|
30
|
+
* EscalationLevelPeriodType,
|
|
31
|
+
* } from './EscalationLevel.interface.js';
|
|
32
|
+
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ElementEditorConfigSectionInterface } from 'ngx-t-forms-types';
|
|
2
|
-
import type { ElementEditorStepConfigSectionInterface } from './ElementEditorConfigSection.interface';
|
|
2
|
+
import type { ElementEditorStepConfigSectionInterface } from './ElementEditorConfigSection.interface.js';
|
|
3
3
|
export declare enum ConfigTypes {
|
|
4
4
|
BasicDetail = "basicDetail",
|
|
5
5
|
EditProcessStep = "editProcessStep"
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ConfigTypes = void 0;
|
|
4
|
-
var ConfigTypes;
|
|
1
|
+
export var ConfigTypes;
|
|
5
2
|
(function (ConfigTypes) {
|
|
6
3
|
ConfigTypes["BasicDetail"] = "basicDetail";
|
|
7
4
|
ConfigTypes["EditProcessStep"] = "editProcessStep";
|
|
8
|
-
})(ConfigTypes || (
|
|
5
|
+
})(ConfigTypes || (ConfigTypes = {}));
|
|
@@ -1,11 +1,55 @@
|
|
|
1
1
|
import type { BlurHandleTypes, ConfigurationValidTestInterface, ElementEditorTypes, IGetTreeResponse, IPostmanCollectionConfig, IWorkflowOption, ValidationError } from 'ngx-t-forms-types';
|
|
2
|
-
import type { ProcessStep } from '../ProcessStep/ProcessStep.interface';
|
|
2
|
+
import type { ProcessStep } from '../ProcessStep/ProcessStep.interface.js';
|
|
3
|
+
import type { HttpRequestOptions } from './NgxTWorkflowsConfig.interface.js';
|
|
4
|
+
/**
|
|
5
|
+
* Recursion budget for {@link DeepBindPath}. `_PathDepth[D]` is `D - 1`, and
|
|
6
|
+
* `_PathDepth[0]` is `never`, which terminates the recursion.
|
|
7
|
+
*/
|
|
8
|
+
type _PathDepth = [never, 0, 1, 2, 3];
|
|
9
|
+
/**
|
|
10
|
+
* Every valid property path into `T`, as a tuple of keys.
|
|
11
|
+
*
|
|
12
|
+
* `[K]` binds the whole field; `[K, ...rest]` descends into a nested object.
|
|
13
|
+
* Arrays, `Date`s and functions TERMINATE a path — the editor binds those
|
|
14
|
+
* wholesale (`deepBind: ['outputs']`), never into their members, and descending
|
|
15
|
+
* into them would explode the union with things like `['duration','toISOString']`.
|
|
16
|
+
*
|
|
17
|
+
* WHY: `deepBind` was `[keyof ProcessStep, ...string[]]`, which type-checked only
|
|
18
|
+
* the FIRST segment. That is how `deepBind: ['bulkEmail', ' emailBodyFormKey']`
|
|
19
|
+
* (leading space) survived in the library's editor config as a silent no-op
|
|
20
|
+
* write. Every segment is now checked.
|
|
21
|
+
*
|
|
22
|
+
* DEPTH: default 3, i.e. paths of up to three segments. Every real `deepBind` in
|
|
23
|
+
* `ngx-t-workflows` is one or two segments, and `ProcessStep`'s deepest nested
|
|
24
|
+
* object (`bulkEmail`, `duration`, `position`) is one level of descent, so 3 is
|
|
25
|
+
* already one level of headroom. Raise it only with a compile-time measurement.
|
|
26
|
+
*
|
|
27
|
+
* INDEX SIGNATURES: a field typed `Record<string, …>` degrades this to accepting
|
|
28
|
+
* any string for that branch, because `Extract<keyof T, string>` yields `string`.
|
|
29
|
+
* `ProcessStep` has none left — `bulkEmail` was the only one and is now the
|
|
30
|
+
* concrete `BulkEmailConfig`. Do not reintroduce one without re-checking here.
|
|
31
|
+
*/
|
|
32
|
+
export type DeepBindPath<T, D extends number = 3> = [D] extends [never] ? never : T extends object ? {
|
|
33
|
+
[K in Extract<keyof T, string>]: [K] | (NonNullable<T[K]> extends readonly unknown[] ? never : NonNullable<T[K]> extends Date ? never : NonNullable<T[K]> extends (...args: never[]) => unknown ? never : NonNullable<T[K]> extends object ? [K, ...DeepBindPath<NonNullable<T[K]>, _PathDepth[D]>] : never);
|
|
34
|
+
}[Extract<keyof T, string>] : never;
|
|
35
|
+
/**
|
|
36
|
+
* @deprecated Escape hatch for a `deepBind` whose path is genuinely dynamic and
|
|
37
|
+
* therefore not expressible as a {@link DeepBindPath}. Prefer fixing the path.
|
|
38
|
+
* Nothing in `ngx-t-workflows` needs this today; it exists so a single
|
|
39
|
+
* unrepresentable binding never forces `deepBind` back to `...string[]` for
|
|
40
|
+
* everyone. Removed in the next major.
|
|
41
|
+
*/
|
|
42
|
+
export type LooseDeepBindPath = [string, ...string[]];
|
|
3
43
|
export interface ElementEditorInnerSectionStepElementInterface {
|
|
4
44
|
id: string;
|
|
5
45
|
name: keyof ProcessStep | 'default';
|
|
6
46
|
hint?: string;
|
|
7
47
|
editType: ElementEditorTypes;
|
|
8
|
-
|
|
48
|
+
/**
|
|
49
|
+
* Property path this editor element writes to, verified segment-by-segment.
|
|
50
|
+
* @see DeepBindPath
|
|
51
|
+
*/
|
|
52
|
+
deepBind: DeepBindPath<ProcessStep>;
|
|
9
53
|
limitTo?: number;
|
|
10
54
|
additionalTest?: ConfigurationValidTestInterface[];
|
|
11
55
|
disabled?: ConfigurationValidTestInterface[];
|
|
@@ -25,9 +69,27 @@ export interface ElementEditorInnerSectionStepElementInterface {
|
|
|
25
69
|
min?: number;
|
|
26
70
|
max?: number;
|
|
27
71
|
step?: number;
|
|
28
|
-
|
|
72
|
+
/**
|
|
73
|
+
* Value formatter for the bound editor element.
|
|
74
|
+
*
|
|
75
|
+
* Declared with METHOD shorthand (`format?(value): number`), not property-arrow
|
|
76
|
+
* shorthand (`format?: (value) => number`). This is load-bearing: `strictFunctionTypes`
|
|
77
|
+
* checks function-typed *properties* contravariantly but leaves *methods* bivariant.
|
|
78
|
+
* The consuming library supplies concrete narrow formatters — `(value: string) => number`,
|
|
79
|
+
* `(value: number) => number` — which are NOT assignable to a contravariant
|
|
80
|
+
* `(value: unknown) => number` property. Method form keeps `unknown` (per RULES.md
|
|
81
|
+
* "no `any`") while still accepting every existing formatter, so migrating the
|
|
82
|
+
* library to this package does not require rewriting its formatter callbacks.
|
|
83
|
+
*/
|
|
84
|
+
format?(value: unknown): number;
|
|
29
85
|
postmanCollectionConfig?: IPostmanCollectionConfig;
|
|
30
|
-
|
|
86
|
+
/**
|
|
87
|
+
* Host-provided HTTP GET. `options` is an Angular `HttpClient` option bag, NOT a
|
|
88
|
+
* fetch `RequestInit` — see {@link HttpRequestOptions}. Method shorthand for the
|
|
89
|
+
* same bivariance reason as {@link ElementEditorInnerSectionStepElementInterface.format}:
|
|
90
|
+
* the library's call sites are declared `(url: string, options: any) => Observable<any>`.
|
|
91
|
+
*/
|
|
92
|
+
httpGetDataFunction?(url: string, options?: HttpRequestOptions): import('rxjs').Observable<unknown>;
|
|
31
93
|
getWorkflowOptions?: import('rxjs').Observable<IWorkflowOption[]> | undefined;
|
|
32
94
|
getMscoaTree?: import('rxjs').Observable<IGetTreeResponse> | undefined;
|
|
33
95
|
}
|
|
@@ -38,3 +100,4 @@ export interface ElementEditorStepConfigSectionInterface {
|
|
|
38
100
|
additionalTest?: ConfigurationValidTestInterface[];
|
|
39
101
|
elements: ElementEditorInnerSectionStepElementInterface[];
|
|
40
102
|
}
|
|
103
|
+
export {};
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
export {};
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
export {};
|
|
@@ -1,10 +1,57 @@
|
|
|
1
1
|
import type { Observable } from 'rxjs';
|
|
2
|
-
import type { DatabaseFormInterface } from 'ngx-t-forms-types';
|
|
3
|
-
import type {
|
|
2
|
+
import type { DatabaseFormInterface, FormColumnInputs } from 'ngx-t-forms-types';
|
|
3
|
+
import type { DbWorkflowModel } from '../Workflow/WorkflowModel.interface.js';
|
|
4
|
+
import type { INodeMembers } from '../Diagram/WorkflowDiagram.interface.js';
|
|
5
|
+
import type { ExtendedDbFormInterface } from './ExtendedDbForm.interface.js';
|
|
6
|
+
/**
|
|
7
|
+
* Options bag forwarded to the host's HTTP layer.
|
|
8
|
+
*
|
|
9
|
+
* Deliberately NOT `RequestInit`: every real caller is an Angular application
|
|
10
|
+
* that forwards these straight to `HttpClient.get`/`HttpClient.post`, whose
|
|
11
|
+
* option bag (`headers`, `params`, `withCredentials`, `observe`, `responseType`,
|
|
12
|
+
* …) is unrelated to the `fetch` API. Typing it as `RequestInit` made the host's
|
|
13
|
+
* genuine call sites fail to compile. Kept permissive on purpose — this package
|
|
14
|
+
* must not take a dependency on `@angular/common/http`.
|
|
15
|
+
*/
|
|
16
|
+
export type HttpRequestOptions = Record<string, unknown>;
|
|
17
|
+
/**
|
|
18
|
+
* Typed reference data the canvas joins against to hydrate steps into nodes and
|
|
19
|
+
* populate pickers.
|
|
20
|
+
*
|
|
21
|
+
* Replaces the previous stringly-typed `dataIntegration(): Observable<Record<string, unknown>>`
|
|
22
|
+
* bag, which was the root cause of a production defect (the `ALL_`/`All_` forms-key
|
|
23
|
+
* casing incident). Do not reintroduce the untyped variant.
|
|
24
|
+
*
|
|
25
|
+
* Shape is copied verbatim from the Angular library's
|
|
26
|
+
* `src/lib/interfaces/NgxTWorkflowsConfig.ts`, which is the authority here.
|
|
27
|
+
*/
|
|
28
|
+
export interface WorkflowReferenceData {
|
|
29
|
+
/** Members available for assignment to steps. */
|
|
30
|
+
members: INodeMembers[];
|
|
31
|
+
/** Forms available for attachment / micro-flow resolution. */
|
|
32
|
+
forms: ExtendedDbFormInterface[];
|
|
33
|
+
/** All possible form inputs, used by decision gates and label pickers. */
|
|
34
|
+
inputs: FormColumnInputs[];
|
|
35
|
+
/** Optional organisation financial-cycle window. */
|
|
36
|
+
currentFinancialCycle?: {
|
|
37
|
+
start?: string;
|
|
38
|
+
end?: string;
|
|
39
|
+
};
|
|
40
|
+
}
|
|
4
41
|
export interface NgxTWorkflowsConfig {
|
|
5
42
|
runPipeLine: (pipeline: unknown[], workflowId: string) => Observable<unknown>;
|
|
6
|
-
postToServer: (url: string, data: unknown, options?:
|
|
7
|
-
|
|
8
|
-
|
|
43
|
+
postToServer: (url: string, data: unknown, options?: HttpRequestOptions) => Observable<unknown>;
|
|
44
|
+
/**
|
|
45
|
+
* Typed reference snapshot. The host applies its own `shareReplay`/caching.
|
|
46
|
+
*
|
|
47
|
+
* @see WorkflowReferenceData
|
|
48
|
+
*/
|
|
49
|
+
referenceData: () => Observable<WorkflowReferenceData>;
|
|
50
|
+
/**
|
|
51
|
+
* `DbWorkflowModel`, not the lean `WorkflowModel`: the host's implementation
|
|
52
|
+
* branches on `workflow._id` to decide create-vs-update
|
|
53
|
+
* (`iserve-procurement/src/app/app-configs/ngx-t-workflows-config.service.ts`).
|
|
54
|
+
*/
|
|
55
|
+
saveWorkflow: (workflow: DbWorkflowModel) => Observable<DbWorkflowModel | undefined>;
|
|
9
56
|
cloneForm: (formId: string, title: string, baseControlNameAdapter: string) => Observable<DatabaseFormInterface>;
|
|
10
57
|
}
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
export {};
|