@owlmeans/flow 0.1.2 → 0.1.3
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 +35 -480
- package/package.json +8 -7
- package/tsconfig.json +5 -10
package/README.md
CHANGED
|
@@ -1,514 +1,69 @@
|
|
|
1
1
|
# @owlmeans/flow
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
State machine for multi-step user flows, primarily used for OIDC authentication flows.
|
|
4
4
|
|
|
5
5
|
## Overview
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
-
|
|
10
|
-
-
|
|
11
|
-
- **Cross-Service Coordination**: Coordinate workflows across different microservices
|
|
12
|
-
- **Configurable Transitions**: Define conditional transitions between workflow steps
|
|
13
|
-
- **Payload Management**: Handle data passing between workflow steps
|
|
14
|
-
- **Reversible Steps**: Support for backward navigation in workflows
|
|
15
|
-
- **Serialization**: Persistent workflow state through URL parameters or storage
|
|
16
|
-
- **Internationalization**: Built-in i18n support for workflow content
|
|
7
|
+
- Defines flow configurations as sequences of steps and transitions
|
|
8
|
+
- `STD_OIDC_FLOW` is the standard OIDC authentication flow constant
|
|
9
|
+
- `stdOidcFlow()` creates the preconfigured OIDC flow definition
|
|
10
|
+
- Flows are started via `flowService.begin(flowAlias)` and progress through steps as the user authenticates
|
|
17
11
|
|
|
18
12
|
## Installation
|
|
19
13
|
|
|
20
14
|
```bash
|
|
21
|
-
|
|
22
|
-
```
|
|
23
|
-
|
|
24
|
-
## Core Concepts
|
|
25
|
-
|
|
26
|
-
### Flow Definition
|
|
27
|
-
|
|
28
|
-
A flow is a structured definition of a multi-step process with:
|
|
29
|
-
- **Steps**: Individual stages in the workflow
|
|
30
|
-
- **Transitions**: Connections between steps with conditions
|
|
31
|
-
- **Configuration**: Global settings and service mappings
|
|
32
|
-
- **Payload Mapping**: Data transformation rules between steps
|
|
33
|
-
|
|
34
|
-
### Flow State
|
|
35
|
-
|
|
36
|
-
The current state of a workflow execution including:
|
|
37
|
-
- Current step
|
|
38
|
-
- Previous step (for reversible flows)
|
|
39
|
-
- Payload data
|
|
40
|
-
- Target service
|
|
41
|
-
- Status information
|
|
42
|
-
|
|
43
|
-
### Flow Model
|
|
44
|
-
|
|
45
|
-
A runtime instance that provides methods to:
|
|
46
|
-
- Navigate between steps
|
|
47
|
-
- Execute transitions
|
|
48
|
-
- Manage state and payload
|
|
49
|
-
- Serialize/deserialize flow state
|
|
50
|
-
|
|
51
|
-
## API Reference
|
|
52
|
-
|
|
53
|
-
### Types
|
|
54
|
-
|
|
55
|
-
#### `Flow`
|
|
56
|
-
Complete flow definition with configuration and prefabs.
|
|
57
|
-
|
|
58
|
-
```typescript
|
|
59
|
-
interface Flow extends ShallowFlow {
|
|
60
|
-
config: FlowConfig
|
|
61
|
-
prefabs: { [step: string]: string }
|
|
62
|
-
}
|
|
63
|
-
```
|
|
64
|
-
|
|
65
|
-
#### `ShallowFlow`
|
|
66
|
-
Basic flow structure without configuration.
|
|
67
|
-
|
|
68
|
-
```typescript
|
|
69
|
-
interface ShallowFlow {
|
|
70
|
-
flow: string
|
|
71
|
-
initialStep: string
|
|
72
|
-
steps: { [key: string]: FlowStep }
|
|
73
|
-
}
|
|
74
|
-
```
|
|
75
|
-
|
|
76
|
-
#### `FlowStep`
|
|
77
|
-
Individual step definition in a workflow.
|
|
78
|
-
|
|
79
|
-
```typescript
|
|
80
|
-
interface FlowStep {
|
|
81
|
-
index: number
|
|
82
|
-
step: string
|
|
83
|
-
service: string
|
|
84
|
-
path?: string
|
|
85
|
-
module?: string
|
|
86
|
-
initial?: boolean
|
|
87
|
-
payloadMap?: { [key: string]: number }
|
|
88
|
-
transitions: { [key: string]: FlowTransition }
|
|
89
|
-
}
|
|
90
|
-
```
|
|
91
|
-
|
|
92
|
-
#### `FlowTransition`
|
|
93
|
-
Transition between workflow steps.
|
|
94
|
-
|
|
95
|
-
```typescript
|
|
96
|
-
interface FlowTransition {
|
|
97
|
-
transition: string
|
|
98
|
-
step: string
|
|
99
|
-
explicit?: boolean // User can choose this transition
|
|
100
|
-
reversible?: boolean // User can go back
|
|
101
|
-
}
|
|
102
|
-
```
|
|
103
|
-
|
|
104
|
-
#### `FlowState`
|
|
105
|
-
Current state of workflow execution.
|
|
106
|
-
|
|
107
|
-
```typescript
|
|
108
|
-
interface FlowState {
|
|
109
|
-
flow: string
|
|
110
|
-
step: string
|
|
111
|
-
previous?: string
|
|
112
|
-
entityId?: string | null
|
|
113
|
-
service: string
|
|
114
|
-
payload?: FlowPayload
|
|
115
|
-
message?: string
|
|
116
|
-
ok: boolean
|
|
117
|
-
}
|
|
118
|
-
```
|
|
119
|
-
|
|
120
|
-
#### `FlowConfig`
|
|
121
|
-
Global configuration for flow behavior.
|
|
122
|
-
|
|
123
|
-
```typescript
|
|
124
|
-
interface FlowConfig {
|
|
125
|
-
queryParam?: string // URL parameter name for flow state
|
|
126
|
-
services?: { [ref: string]: string } // Service reference mappings
|
|
127
|
-
modules?: { [ref: string]: string } // Module reference mappings
|
|
128
|
-
pathes?: { [ref: string]: string } // Path reference mappings
|
|
129
|
-
defaultFlow?: string // Default flow to use
|
|
130
|
-
}
|
|
131
|
-
```
|
|
132
|
-
|
|
133
|
-
#### `FlowModel`
|
|
134
|
-
Runtime workflow management interface.
|
|
135
|
-
|
|
136
|
-
```typescript
|
|
137
|
-
interface FlowModel {
|
|
138
|
-
target: (service: string) => FlowModel
|
|
139
|
-
entity: (entityId: string) => FlowModel
|
|
140
|
-
enter: (step?: string) => FlowModel
|
|
141
|
-
steps: (enter?: boolean) => FlowStep[]
|
|
142
|
-
state: () => FlowState
|
|
143
|
-
setState: (state: FlowState | null) => FlowModel
|
|
144
|
-
payload: <T extends FlowPayload>() => T
|
|
145
|
-
step: (step?: string) => FlowStep
|
|
146
|
-
transitions: (explicit?: boolean) => FlowTransition[]
|
|
147
|
-
transition: (transition: string) => FlowTransition
|
|
148
|
-
next: () => FlowTransition
|
|
149
|
-
transit: (transition: string, ok: boolean, message?: string | FlowPayload, payload?: FlowPayload) => string
|
|
150
|
-
serialize: () => string
|
|
151
|
-
}
|
|
152
|
-
```
|
|
153
|
-
|
|
154
|
-
### Factory Functions
|
|
155
|
-
|
|
156
|
-
#### `makeFlowModel(flow: string | ShallowFlow, provider?: FlowProvider): Promise<FlowModel>`
|
|
157
|
-
Creates a flow model instance from flow definition or serialized state.
|
|
158
|
-
|
|
159
|
-
**Parameters:**
|
|
160
|
-
- `flow`: Flow name, definition, or serialized state
|
|
161
|
-
- `provider`: Optional flow provider function
|
|
162
|
-
|
|
163
|
-
**Returns:** Promise resolving to FlowModel instance
|
|
164
|
-
|
|
165
|
-
### Helper Functions
|
|
166
|
-
|
|
167
|
-
#### `flow<C>(cfg: C, flow: ShallowFlow): C`
|
|
168
|
-
Adds a flow definition to configuration.
|
|
169
|
-
|
|
170
|
-
#### `configureFlows<C>(cfg: C & WithFlowConfig, config: FlowConfig): C & WithFlowConfig`
|
|
171
|
-
Adds flow configuration to application config.
|
|
172
|
-
|
|
173
|
-
### Error Types
|
|
174
|
-
|
|
175
|
-
The package provides specialized error types for flow operations:
|
|
176
|
-
|
|
177
|
-
#### `FlowError`
|
|
178
|
-
Base error class for all flow-related errors.
|
|
179
|
-
|
|
180
|
-
#### `FlowUnsupported`
|
|
181
|
-
Error for unsupported flow operations.
|
|
182
|
-
|
|
183
|
-
#### `FlowTargetError`
|
|
184
|
-
Error related to flow target service issues.
|
|
185
|
-
|
|
186
|
-
#### `UnknownFlow`
|
|
187
|
-
Error when referenced flow doesn't exist.
|
|
188
|
-
|
|
189
|
-
#### `FlowStepError`
|
|
190
|
-
Base error for step-related issues.
|
|
191
|
-
|
|
192
|
-
#### `FlowStepMissconfigured`
|
|
193
|
-
Error for misconfigured flow steps.
|
|
194
|
-
|
|
195
|
-
#### `UnknownFlowStep`
|
|
196
|
-
Error when referenced step doesn't exist.
|
|
197
|
-
|
|
198
|
-
#### `UnknownTransition`
|
|
199
|
-
Error when referenced transition doesn't exist.
|
|
200
|
-
|
|
201
|
-
### Constants
|
|
202
|
-
|
|
203
|
-
```typescript
|
|
204
|
-
// Standard flow types
|
|
205
|
-
const STD_AUTH_FLOW = '_oa' // Authentication flow
|
|
206
|
-
const STD_OIDC_FLOW = '_oidc' // OIDC flow
|
|
207
|
-
const STD_STAB_FLOW = '_stb' // Stabilization flow
|
|
208
|
-
const STD_OIDP_FLOW = '_oidp' // OIDC Provider flow
|
|
209
|
-
|
|
210
|
-
// Configuration
|
|
211
|
-
const CFG_FLOW_PREFIX = 'flow'
|
|
212
|
-
const FLOW_RECORD = 'flow'
|
|
213
|
-
const TARGET_SERVICE = '-'
|
|
214
|
-
```
|
|
215
|
-
|
|
216
|
-
## Usage Examples
|
|
217
|
-
|
|
218
|
-
### Basic Flow Definition
|
|
219
|
-
|
|
220
|
-
```typescript
|
|
221
|
-
import { flow, makeFlowModel } from '@owlmeans/flow'
|
|
222
|
-
|
|
223
|
-
const registrationFlow: ShallowFlow = {
|
|
224
|
-
flow: 'user-registration',
|
|
225
|
-
initialStep: 'start',
|
|
226
|
-
steps: {
|
|
227
|
-
start: {
|
|
228
|
-
index: 0,
|
|
229
|
-
step: 'start',
|
|
230
|
-
service: 'auth-service',
|
|
231
|
-
path: '/register/start',
|
|
232
|
-
initial: true,
|
|
233
|
-
transitions: {
|
|
234
|
-
next: { transition: 'next', step: 'credentials' },
|
|
235
|
-
cancel: { transition: 'cancel', step: 'cancelled' }
|
|
236
|
-
}
|
|
237
|
-
},
|
|
238
|
-
credentials: {
|
|
239
|
-
index: 1,
|
|
240
|
-
step: 'credentials',
|
|
241
|
-
service: 'auth-service',
|
|
242
|
-
path: '/register/credentials',
|
|
243
|
-
transitions: {
|
|
244
|
-
submit: { transition: 'submit', step: 'verify' },
|
|
245
|
-
back: { transition: 'back', step: 'start', reversible: true }
|
|
246
|
-
}
|
|
247
|
-
},
|
|
248
|
-
verify: {
|
|
249
|
-
index: 2,
|
|
250
|
-
step: 'verify',
|
|
251
|
-
service: 'auth-service',
|
|
252
|
-
path: '/register/verify',
|
|
253
|
-
transitions: {
|
|
254
|
-
confirmed: { transition: 'confirmed', step: 'complete' },
|
|
255
|
-
resend: { transition: 'resend', step: 'verify' }
|
|
256
|
-
}
|
|
257
|
-
},
|
|
258
|
-
complete: {
|
|
259
|
-
index: 3,
|
|
260
|
-
step: 'complete',
|
|
261
|
-
service: 'auth-service',
|
|
262
|
-
path: '/register/complete',
|
|
263
|
-
transitions: {}
|
|
264
|
-
}
|
|
265
|
-
}
|
|
266
|
-
}
|
|
267
|
-
|
|
268
|
-
// Add to configuration
|
|
269
|
-
const config = flow(baseConfig, registrationFlow)
|
|
270
|
-
```
|
|
271
|
-
|
|
272
|
-
### Flow Execution
|
|
273
|
-
|
|
274
|
-
```typescript
|
|
275
|
-
// Create flow model
|
|
276
|
-
const flowModel = await makeFlowModel('user-registration', flowProvider)
|
|
277
|
-
|
|
278
|
-
// Target a specific service
|
|
279
|
-
flowModel.target('auth-service')
|
|
280
|
-
|
|
281
|
-
// Set entity context
|
|
282
|
-
flowModel.entity('user123')
|
|
283
|
-
|
|
284
|
-
// Get current step
|
|
285
|
-
const currentStep = flowModel.step()
|
|
286
|
-
console.log(`Current step: ${currentStep.step}`)
|
|
287
|
-
|
|
288
|
-
// Get available transitions
|
|
289
|
-
const transitions = flowModel.transitions(true) // Only explicit transitions
|
|
290
|
-
console.log('Available actions:', transitions.map(t => t.transition))
|
|
291
|
-
|
|
292
|
-
// Execute transition
|
|
293
|
-
const nextState = flowModel.transit('submit', true, 'Success', {
|
|
294
|
-
username: 'john_doe',
|
|
295
|
-
email: 'john@example.com'
|
|
296
|
-
})
|
|
297
|
-
|
|
298
|
-
// Serialize state for URL or storage
|
|
299
|
-
const serializedState = flowModel.serialize()
|
|
300
|
-
```
|
|
301
|
-
|
|
302
|
-
### Flow State Management
|
|
303
|
-
|
|
304
|
-
```typescript
|
|
305
|
-
// Load from serialized state
|
|
306
|
-
const flowModel = await makeFlowModel(serializedState, flowProvider)
|
|
307
|
-
|
|
308
|
-
// Check if flow completed successfully
|
|
309
|
-
const state = flowModel.state()
|
|
310
|
-
if (state.ok && state.step === 'complete') {
|
|
311
|
-
console.log('Registration completed successfully')
|
|
312
|
-
}
|
|
313
|
-
|
|
314
|
-
// Handle errors
|
|
315
|
-
if (!state.ok && state.message) {
|
|
316
|
-
console.error('Flow error:', state.message)
|
|
317
|
-
}
|
|
318
|
-
|
|
319
|
-
// Access payload data
|
|
320
|
-
const payload = flowModel.payload<{username: string, email: string}>()
|
|
321
|
-
console.log('User data:', payload)
|
|
322
|
-
```
|
|
323
|
-
|
|
324
|
-
### Cross-Service Flow
|
|
325
|
-
|
|
326
|
-
```typescript
|
|
327
|
-
const crossServiceFlow: ShallowFlow = {
|
|
328
|
-
flow: 'order-fulfillment',
|
|
329
|
-
initialStep: 'create-order',
|
|
330
|
-
steps: {
|
|
331
|
-
'create-order': {
|
|
332
|
-
index: 0,
|
|
333
|
-
step: 'create-order',
|
|
334
|
-
service: 'order-service',
|
|
335
|
-
transitions: {
|
|
336
|
-
created: { transition: 'created', step: 'process-payment' }
|
|
337
|
-
}
|
|
338
|
-
},
|
|
339
|
-
'process-payment': {
|
|
340
|
-
index: 1,
|
|
341
|
-
step: 'process-payment',
|
|
342
|
-
service: 'payment-service',
|
|
343
|
-
transitions: {
|
|
344
|
-
paid: { transition: 'paid', step: 'ship-order' },
|
|
345
|
-
failed: { transition: 'failed', step: 'payment-failed' }
|
|
346
|
-
}
|
|
347
|
-
},
|
|
348
|
-
'ship-order': {
|
|
349
|
-
index: 2,
|
|
350
|
-
step: 'ship-order',
|
|
351
|
-
service: 'shipping-service',
|
|
352
|
-
transitions: {
|
|
353
|
-
shipped: { transition: 'shipped', step: 'complete' }
|
|
354
|
-
}
|
|
355
|
-
}
|
|
356
|
-
}
|
|
357
|
-
}
|
|
15
|
+
bun add @owlmeans/flow
|
|
358
16
|
```
|
|
359
17
|
|
|
360
|
-
|
|
18
|
+
## Usage
|
|
361
19
|
|
|
362
|
-
|
|
363
|
-
import { configureFlows } from '@owlmeans/flow'
|
|
364
|
-
|
|
365
|
-
const config = configureFlows(baseConfig, {
|
|
366
|
-
queryParam: 'flow',
|
|
367
|
-
defaultFlow: 'user-registration',
|
|
368
|
-
services: {
|
|
369
|
-
auth: 'auth-service',
|
|
370
|
-
payment: 'payment-service'
|
|
371
|
-
},
|
|
372
|
-
modules: {
|
|
373
|
-
login: 'auth:login',
|
|
374
|
-
register: 'auth:register'
|
|
375
|
-
},
|
|
376
|
-
pathes: {
|
|
377
|
-
home: '/dashboard',
|
|
378
|
-
login: '/auth/login'
|
|
379
|
-
}
|
|
380
|
-
})
|
|
381
|
-
```
|
|
382
|
-
|
|
383
|
-
### Flow Provider Implementation
|
|
20
|
+
Register the OIDC flow in app config:
|
|
384
21
|
|
|
385
22
|
```typescript
|
|
386
|
-
import {
|
|
387
|
-
|
|
388
|
-
const flowProvider: FlowProvider = async (flowName: string) => {
|
|
389
|
-
// Load from database, configuration, or static definitions
|
|
390
|
-
const flowRecord = await flowRepository.get(flowName)
|
|
391
|
-
|
|
392
|
-
return {
|
|
393
|
-
...flowRecord,
|
|
394
|
-
config: {
|
|
395
|
-
queryParam: 'f',
|
|
396
|
-
services: { auth: 'auth-service' }
|
|
397
|
-
},
|
|
398
|
-
prefabs: {
|
|
399
|
-
start: 'welcome-template',
|
|
400
|
-
complete: 'success-template'
|
|
401
|
-
}
|
|
402
|
-
}
|
|
403
|
-
}
|
|
404
|
-
```
|
|
405
|
-
|
|
406
|
-
### Error Handling
|
|
23
|
+
import { STD_OIDC_FLOW, stdOidcFlow } from '@owlmeans/flow'
|
|
407
24
|
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
console.error('Flow not found')
|
|
416
|
-
} else if (error instanceof FlowStepError) {
|
|
417
|
-
console.error('Step configuration error:', error.message)
|
|
418
|
-
}
|
|
419
|
-
}
|
|
420
|
-
```
|
|
421
|
-
|
|
422
|
-
## Advanced Features
|
|
423
|
-
|
|
424
|
-
### Payload Mapping
|
|
425
|
-
|
|
426
|
-
Configure how data flows between steps:
|
|
427
|
-
|
|
428
|
-
```typescript
|
|
429
|
-
const step: FlowStep = {
|
|
430
|
-
index: 1,
|
|
431
|
-
step: 'credentials',
|
|
432
|
-
service: 'auth-service',
|
|
433
|
-
payloadMap: {
|
|
434
|
-
username: 0, // Map to first payload parameter
|
|
435
|
-
email: 1, // Map to second payload parameter
|
|
436
|
-
phone: 2 // Map to third payload parameter
|
|
437
|
-
},
|
|
438
|
-
transitions: { /* ... */ }
|
|
439
|
-
}
|
|
25
|
+
// In app config (added as a config record)
|
|
26
|
+
const appConfig = config(
|
|
27
|
+
AppType.Frontend,
|
|
28
|
+
'manager-web',
|
|
29
|
+
// ... other config
|
|
30
|
+
{ [FLOW_RECORD]: [stdOidcFlow()] }
|
|
31
|
+
)
|
|
440
32
|
```
|
|
441
33
|
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
Implement business logic in transitions:
|
|
34
|
+
Start a flow in a component:
|
|
445
35
|
|
|
446
36
|
```typescript
|
|
447
|
-
|
|
37
|
+
import { STD_OIDC_FLOW } from '@owlmeans/flow'
|
|
448
38
|
|
|
449
|
-
//
|
|
450
|
-
const
|
|
451
|
-
|
|
452
|
-
canProceed ? 'submit' : 'error',
|
|
453
|
-
canProceed,
|
|
454
|
-
canProceed ? 'Validation passed' : 'Please fix errors'
|
|
455
|
-
)
|
|
39
|
+
// In a UI action handler
|
|
40
|
+
const flowService = context.service(FLOW_SERVICE_ALIAS)
|
|
41
|
+
await flowService.begin(STD_OIDC_FLOW)
|
|
456
42
|
```
|
|
457
43
|
|
|
458
|
-
|
|
44
|
+
## API
|
|
459
45
|
|
|
460
|
-
|
|
461
|
-
// Extract flow state from URL
|
|
462
|
-
const urlParams = new URLSearchParams(window.location.search)
|
|
463
|
-
const flowState = urlParams.get('flow')
|
|
46
|
+
### `STD_OIDC_FLOW`
|
|
464
47
|
|
|
465
|
-
|
|
466
|
-
const flowModel = await makeFlowModel(flowState, flowProvider)
|
|
467
|
-
// Resume flow from URL state
|
|
468
|
-
}
|
|
48
|
+
Constant: `'_oidc'` — alias for the standard OIDC flow.
|
|
469
49
|
|
|
470
|
-
|
|
471
|
-
const currentState = flowModel.serialize()
|
|
472
|
-
const newUrl = `${window.location.pathname}?flow=${currentState}`
|
|
473
|
-
window.history.pushState({}, '', newUrl)
|
|
474
|
-
```
|
|
50
|
+
### `stdOidcFlow(): FlowConfig`
|
|
475
51
|
|
|
476
|
-
|
|
52
|
+
Returns a pre-built `FlowConfig` for the standard OIDC authentication flow.
|
|
477
53
|
|
|
478
|
-
|
|
54
|
+
### `FlowConfig`
|
|
479
55
|
|
|
480
|
-
|
|
481
|
-
- **@owlmeans/error**: Resilient error handling system
|
|
482
|
-
- **@owlmeans/resource**: Flow state persistence and retrieval
|
|
483
|
-
- **@owlmeans/i18n**: Internationalization for flow content
|
|
484
|
-
- **@owlmeans/client-flow**: Client-side flow execution
|
|
485
|
-
- **@owlmeans/server-flow**: Server-side flow management
|
|
486
|
-
- **@owlmeans/web-flow**: Web-specific flow features
|
|
56
|
+
A flow configuration object with `alias`, `steps: FlowStep[]`, and `transitions: FlowTransition[]`.
|
|
487
57
|
|
|
488
|
-
|
|
58
|
+
### `FlowStep`
|
|
489
59
|
|
|
490
|
-
|
|
491
|
-
- Keep steps focused on single responsibilities
|
|
492
|
-
- Design for both forward and backward navigation
|
|
493
|
-
- Use meaningful step and transition names
|
|
494
|
-
- Plan for error scenarios and recovery paths
|
|
60
|
+
A named step in a flow with optional `service` and `module` references.
|
|
495
61
|
|
|
496
|
-
###
|
|
497
|
-
- Minimize payload size for URL serialization
|
|
498
|
-
- Use appropriate TTL for flow state persistence
|
|
499
|
-
- Handle state corruption gracefully
|
|
500
|
-
- Implement proper cleanup for abandoned flows
|
|
62
|
+
### `FLOW_RECORD`
|
|
501
63
|
|
|
502
|
-
|
|
503
|
-
- Validate payload data at each step
|
|
504
|
-
- Implement proper authorization for step access
|
|
505
|
-
- Sanitize flow state when exposing in URLs
|
|
506
|
-
- Use secure channels for sensitive flow data
|
|
64
|
+
Config record type key for registering flows in the application config.
|
|
507
65
|
|
|
508
|
-
|
|
509
|
-
- Cache flow definitions for better performance
|
|
510
|
-
- Implement efficient flow provider lookups
|
|
511
|
-
- Use pagination for large step lists
|
|
512
|
-
- Optimize serialization for large payloads
|
|
66
|
+
## Related Packages
|
|
513
67
|
|
|
514
|
-
|
|
68
|
+
- [`@owlmeans/client-flow`](../client-flow) — client-side flow service that executes flow steps
|
|
69
|
+
- [`@owlmeans/web-flow`](../web-flow) — React components for flow UI rendering
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@owlmeans/flow",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
@@ -21,17 +21,18 @@
|
|
|
21
21
|
}
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@owlmeans/auth": "^0.1.
|
|
25
|
-
"@owlmeans/config": "^0.1.
|
|
26
|
-
"@owlmeans/error": "^0.1.
|
|
27
|
-
"@owlmeans/i18n": "^0.1.
|
|
28
|
-
"@owlmeans/resource": "^0.1.
|
|
24
|
+
"@owlmeans/auth": "^0.1.3",
|
|
25
|
+
"@owlmeans/config": "^0.1.3",
|
|
26
|
+
"@owlmeans/error": "^0.1.3",
|
|
27
|
+
"@owlmeans/i18n": "^0.1.3",
|
|
28
|
+
"@owlmeans/resource": "^0.1.3",
|
|
29
29
|
"@scure/base": "^1.1.9"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
|
+
"@owlmeans/dep-config": "workspace:*",
|
|
32
33
|
"nodemon": "^3.1.11",
|
|
33
34
|
"npm-check": "^6.0.1",
|
|
34
|
-
"typescript": "^
|
|
35
|
+
"typescript": "^6.0.2"
|
|
35
36
|
},
|
|
36
37
|
"publishConfig": {
|
|
37
38
|
"access": "public"
|
package/tsconfig.json
CHANGED
|
@@ -1,15 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"extends": [
|
|
3
|
-
"
|
|
3
|
+
"@owlmeans/dep-config/tsconfig.base.json"
|
|
4
4
|
],
|
|
5
5
|
"compilerOptions": {
|
|
6
|
-
"rootDir": "./src/",
|
|
7
|
-
"outDir": "./build/"
|
|
8
|
-
"moduleResolution": "Bundler"
|
|
6
|
+
"rootDir": "./src/",
|
|
7
|
+
"outDir": "./build/"
|
|
9
8
|
},
|
|
10
|
-
"exclude": [
|
|
11
|
-
|
|
12
|
-
"./build/**/*",
|
|
13
|
-
"./*.ts"
|
|
14
|
-
]
|
|
15
|
-
}
|
|
9
|
+
"exclude": ["./dist/**/*", "./build/**/*", "./*.ts"]
|
|
10
|
+
}
|