@kosdev-code/kos-ui-sdk 2.1.16 → 2.1.18
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/core/core/companion-instantiator.d.ts +71 -0
- package/core/core/companion-instantiator.d.ts.map +1 -0
- package/core/core/decorators/fsm-injection-utils.d.ts +16 -0
- package/core/core/decorators/fsm-injection-utils.d.ts.map +1 -0
- package/core/core/decorators/index.d.ts +4 -0
- package/core/core/decorators/index.d.ts.map +1 -1
- package/core/core/decorators/kos-companion.d.ts +19 -0
- package/core/core/decorators/kos-companion.d.ts.map +1 -1
- package/core/core/decorators/kos-execution-context.d.ts +60 -0
- package/core/core/decorators/kos-execution-context.d.ts.map +1 -0
- package/core/core/decorators/kos-service-request.d.ts +381 -0
- package/core/core/decorators/kos-service-request.d.ts.map +1 -0
- package/core/core/decorators/kos-state-machine.d.ts +466 -0
- package/core/core/decorators/kos-state-machine.d.ts.map +1 -0
- package/core/core/decorators/kosModel.d.ts.map +1 -1
- package/core/core/decorators/kosTopicHandler.d.ts +33 -5
- package/core/core/decorators/kosTopicHandler.d.ts.map +1 -1
- package/core/core/decorators/propKeys.d.ts +4 -0
- package/core/core/decorators/propKeys.d.ts.map +1 -1
- package/core/core/kos-registration.d.ts.map +1 -1
- package/core/core/kos-singleton-registration.d.ts.map +1 -1
- package/core/core/kosCore.d.ts.map +1 -1
- package/core/core/kosModel.d.ts +14 -0
- package/core/core/kosModel.d.ts.map +1 -1
- package/core/core/kosModelManager.d.ts +11 -1
- package/core/core/kosModelManager.d.ts.map +1 -1
- package/core/core/model/kos-model-component-factory.d.ts +4 -0
- package/core/core/model/kos-model-component-factory.d.ts.map +1 -1
- package/core/core/model/kos-offline-queue.d.ts +78 -1
- package/core/core/model/kos-offline-queue.d.ts.map +1 -1
- package/core/core/model/kos-service-request-manager.d.ts +102 -0
- package/core/core/model/kos-service-request-manager.d.ts.map +1 -0
- package/core/core/model/kos-subscription-manager.d.ts +18 -0
- package/core/core/model/kos-subscription-manager.d.ts.map +1 -1
- package/core/core/model/model-introspection-utils.d.ts +1 -0
- package/core/core/model/model-introspection-utils.d.ts.map +1 -1
- package/core/core/model/service-response-store.d.ts +164 -0
- package/core/core/model/service-response-store.d.ts.map +1 -0
- package/core/core/model-instantiator.d.ts +19 -0
- package/core/core/model-instantiator.d.ts.map +1 -1
- package/core/core/types/registration.d.ts +7 -0
- package/core/core/types/registration.d.ts.map +1 -1
- package/core/types/index.d.ts +1 -0
- package/core/types/index.d.ts.map +1 -1
- package/core/types/service-response-store.d.ts +152 -0
- package/core/types/service-response-store.d.ts.map +1 -0
- package/core/util/index.d.ts +1 -0
- package/core/util/index.d.ts.map +1 -1
- package/core/util/kos-service-request.d.ts +8 -0
- package/core/util/kos-service-request.d.ts.map +1 -1
- package/core/util/service-response.d.ts +110 -0
- package/core/util/service-response.d.ts.map +1 -0
- package/index.cjs +79 -79
- package/index.cjs.map +1 -1
- package/index.js +8175 -6796
- package/index.js.map +1 -1
- package/models/decorators/future-service.d.ts +7 -0
- package/models/decorators/future-service.d.ts.map +1 -1
- package/models/models/storage-device/services/storage-device-services.d.ts +1 -0
- package/models/models/storage-device/services/storage-device-services.d.ts.map +1 -1
- package/models/models/storage-device/storage-device-container-model.d.ts.map +1 -1
- package/models/models/translation/translation-model.d.ts.map +1 -1
- package/models/utils/client.d.ts +8 -8
- package/models/utils/service.d.ts +66 -10
- package/models/utils/service.d.ts.map +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,466 @@
|
|
|
1
|
+
import { DependencyLifecycle } from '../../types';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Configuration for a KOS state machine.
|
|
5
|
+
*
|
|
6
|
+
* @template TState Union type of valid state strings
|
|
7
|
+
* @template TEvent Union type of valid event strings
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```typescript
|
|
11
|
+
* const config: KosStateMachineConfig<'idle' | 'active', 'START' | 'STOP'> = {
|
|
12
|
+
* initial: 'idle',
|
|
13
|
+
* initializeAt: DependencyLifecycle.READY,
|
|
14
|
+
* states: {
|
|
15
|
+
* idle: { on: { START: 'active' } },
|
|
16
|
+
* active: { on: { STOP: 'idle' } }
|
|
17
|
+
* }
|
|
18
|
+
* };
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
export interface KosStateMachineConfig<TState extends string, TEvent extends string> {
|
|
22
|
+
/**
|
|
23
|
+
* The initial state when the state machine is initialized.
|
|
24
|
+
* This state will be set when the FSM reaches its configured lifecycle phase.
|
|
25
|
+
*/
|
|
26
|
+
initial: TState;
|
|
27
|
+
/**
|
|
28
|
+
* The lifecycle phase at which the state machine should be initialized.
|
|
29
|
+
* Before this phase, currentState will be undefined and isFsmInitialized will be false.
|
|
30
|
+
*
|
|
31
|
+
* @default DependencyLifecycle.READY
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* ```typescript
|
|
35
|
+
* // FSM initializes when model is ready (most common)
|
|
36
|
+
* initializeAt: DependencyLifecycle.READY
|
|
37
|
+
*
|
|
38
|
+
* // FSM initializes only when UI activates the model
|
|
39
|
+
* initializeAt: DependencyLifecycle.ACTIVATE
|
|
40
|
+
*
|
|
41
|
+
* // FSM initializes during model initialization (rare)
|
|
42
|
+
* initializeAt: DependencyLifecycle.INIT
|
|
43
|
+
* ```
|
|
44
|
+
*/
|
|
45
|
+
initializeAt?: DependencyLifecycle;
|
|
46
|
+
/**
|
|
47
|
+
* State machine definition mapping states to their allowed transitions.
|
|
48
|
+
*
|
|
49
|
+
* @example
|
|
50
|
+
* ```typescript
|
|
51
|
+
* states: {
|
|
52
|
+
* idle: { on: { PREPARE: 'preparing' } },
|
|
53
|
+
* preparing: { on: { READY: 'ready', ERROR: 'error' } },
|
|
54
|
+
* ready: { on: { POUR: 'pouring' } },
|
|
55
|
+
* pouring: { on: { COMPLETE: 'idle', ERROR: 'error' } },
|
|
56
|
+
* error: { on: { RESET: 'idle' } }
|
|
57
|
+
* }
|
|
58
|
+
* ```
|
|
59
|
+
*/
|
|
60
|
+
states: Record<TState, {
|
|
61
|
+
/**
|
|
62
|
+
* Mapping of events to target states.
|
|
63
|
+
* When an event occurs in this state, transition to the target state.
|
|
64
|
+
*/
|
|
65
|
+
on?: Partial<Record<TEvent, TState>>;
|
|
66
|
+
}>;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Options for configuring state machine behavior.
|
|
70
|
+
*/
|
|
71
|
+
export interface KosStateMachineOptions {
|
|
72
|
+
/**
|
|
73
|
+
* Property name for storing the current state.
|
|
74
|
+
*
|
|
75
|
+
* @default "currentState"
|
|
76
|
+
*/
|
|
77
|
+
stateProperty?: string;
|
|
78
|
+
/**
|
|
79
|
+
* Whether to track state history.
|
|
80
|
+
* When enabled, a stateHistory array is maintained with timestamps and events.
|
|
81
|
+
*
|
|
82
|
+
* @default false
|
|
83
|
+
*/
|
|
84
|
+
trackHistory?: boolean;
|
|
85
|
+
/**
|
|
86
|
+
* Whether to throw errors on invalid transitions.
|
|
87
|
+
* When false, invalid transitions are logged as warnings instead.
|
|
88
|
+
*
|
|
89
|
+
* @default true
|
|
90
|
+
*/
|
|
91
|
+
throwOnInvalid?: boolean;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Interface for models using the @kosStateMachine decorator.
|
|
95
|
+
*
|
|
96
|
+
* **IMPORTANT**: Use TypeScript interface merging to add FSM properties to your model class.
|
|
97
|
+
* This provides full type safety and IntelliSense support for all injected FSM functionality.
|
|
98
|
+
*
|
|
99
|
+
* ## Interface Merging Pattern
|
|
100
|
+
*
|
|
101
|
+
* ```typescript
|
|
102
|
+
* // 1. Define state and event types
|
|
103
|
+
* type PourState = 'idle' | 'preparing' | 'ready' | 'pouring' | 'error';
|
|
104
|
+
* type PourEvent = 'PREPARE' | 'READY' | 'POUR' | 'COMPLETE' | 'ERROR';
|
|
105
|
+
*
|
|
106
|
+
* // 2. Declare interface merging BEFORE the class
|
|
107
|
+
* interface DispenserModelImpl extends KosStateMachineAware<PourState, PourEvent> {}
|
|
108
|
+
*
|
|
109
|
+
* // 3. Apply decorators and implement the class
|
|
110
|
+
* @kosModel({ modelTypeId: "dispenser-model" })
|
|
111
|
+
* @kosStateMachine<PourState, PourEvent>({
|
|
112
|
+
* initial: 'idle',
|
|
113
|
+
* initializeAt: DependencyLifecycle.READY,
|
|
114
|
+
* states: {
|
|
115
|
+
* idle: { on: { PREPARE: 'preparing' } },
|
|
116
|
+
* preparing: { on: { READY: 'ready', ERROR: 'error' } },
|
|
117
|
+
* ready: { on: { POUR: 'pouring' } },
|
|
118
|
+
* pouring: { on: { COMPLETE: 'idle', ERROR: 'error' } },
|
|
119
|
+
* error: {}
|
|
120
|
+
* }
|
|
121
|
+
* })
|
|
122
|
+
* export class DispenserModelImpl implements IKosDataModel {
|
|
123
|
+
* // All FSM properties are now available with full type safety
|
|
124
|
+
* }
|
|
125
|
+
* ```
|
|
126
|
+
*
|
|
127
|
+
* ## Lifecycle-Aware Initialization
|
|
128
|
+
*
|
|
129
|
+
* The FSM is uninitialized until the configured lifecycle phase:
|
|
130
|
+
* - Before initialization: `currentState === undefined`, `isFsmInitialized === false`
|
|
131
|
+
* - After initialization: `currentState === initial`, `isFsmInitialized === true`
|
|
132
|
+
*
|
|
133
|
+
* ```typescript
|
|
134
|
+
* @kosStateMachine({
|
|
135
|
+
* initial: 'idle',
|
|
136
|
+
* initializeAt: DependencyLifecycle.READY, // FSM starts when model is ready
|
|
137
|
+
* states: { ... }
|
|
138
|
+
* })
|
|
139
|
+
* class MyModel {
|
|
140
|
+
* async ready(): Promise<void> {
|
|
141
|
+
* // Before this completes: this.currentState === undefined
|
|
142
|
+
* // After this completes: this.currentState === 'idle'
|
|
143
|
+
* }
|
|
144
|
+
* }
|
|
145
|
+
* ```
|
|
146
|
+
*
|
|
147
|
+
* ## Injected Properties and Methods
|
|
148
|
+
*
|
|
149
|
+
* The decorator automatically injects the following members:
|
|
150
|
+
*
|
|
151
|
+
* - **`currentState`**: Current state (undefined until FSM initialized, observable)
|
|
152
|
+
* - **`isFsmInitialized`**: Boolean indicating if FSM has been initialized
|
|
153
|
+
* - **`isTransitioning`**: Boolean indicating if a transition is in progress
|
|
154
|
+
* - **`allowedTransitions`**: Computed array of valid events for current state
|
|
155
|
+
* - **`transition(event)`**: Method to trigger state transitions
|
|
156
|
+
* - **`canTransition(event)`**: Check if a transition is valid from current state
|
|
157
|
+
* - **`isInState(state)`**: Check if currently in a specific state
|
|
158
|
+
* - **`stateHistory`**: Array of historical states (if trackHistory enabled)
|
|
159
|
+
*
|
|
160
|
+
* All properties are reactive and will automatically update UI components when state changes.
|
|
161
|
+
*
|
|
162
|
+
* @template TState Union type of valid state strings
|
|
163
|
+
* @template TEvent Union type of valid event strings
|
|
164
|
+
*
|
|
165
|
+
* @see {@link kosStateMachine} - The decorator function
|
|
166
|
+
* @see {@link KosStateMachineConfig} - Configuration interface
|
|
167
|
+
* @see {@link KosStateMachineOptions} - Options interface
|
|
168
|
+
*/
|
|
169
|
+
export interface KosStateMachineAware<TState extends string, TEvent extends string> {
|
|
170
|
+
/**
|
|
171
|
+
* Current state of the state machine.
|
|
172
|
+
* Observable property that updates automatically via @kosModel.
|
|
173
|
+
* Always initialized to the initial state immediately.
|
|
174
|
+
*/
|
|
175
|
+
currentState: TState;
|
|
176
|
+
/**
|
|
177
|
+
* Indicates whether the state machine has been initialized.
|
|
178
|
+
* FSM initializes at the configured lifecycle phase (READY, ACTIVATE, etc.).
|
|
179
|
+
*
|
|
180
|
+
* - Before initialization: `false`, `currentState === undefined`
|
|
181
|
+
* - After initialization: `true`, `currentState === initial`
|
|
182
|
+
*/
|
|
183
|
+
readonly isFsmInitialized: boolean;
|
|
184
|
+
/**
|
|
185
|
+
* Indicates whether a state transition is currently in progress.
|
|
186
|
+
* Observable property that updates during transitions.
|
|
187
|
+
*/
|
|
188
|
+
isTransitioning: boolean;
|
|
189
|
+
/**
|
|
190
|
+
* Computed array of valid events that can be triggered from the current state.
|
|
191
|
+
* Updates automatically when state changes.
|
|
192
|
+
* Returns empty array if FSM is not initialized.
|
|
193
|
+
*/
|
|
194
|
+
readonly allowedTransitions: TEvent[];
|
|
195
|
+
/**
|
|
196
|
+
* Trigger a state transition by event.
|
|
197
|
+
*
|
|
198
|
+
* @param event The event to trigger
|
|
199
|
+
* @throws Error if FSM not initialized (unless `throwOnInvalid` is false)
|
|
200
|
+
* @throws Error if transition is invalid (unless `throwOnInvalid` is false)
|
|
201
|
+
*
|
|
202
|
+
* @example
|
|
203
|
+
* ```typescript
|
|
204
|
+
* this.transition('START'); // idle -> active
|
|
205
|
+
* this.transition('STOP'); // active -> idle
|
|
206
|
+
* ```
|
|
207
|
+
*/
|
|
208
|
+
transition(event: TEvent): void;
|
|
209
|
+
/**
|
|
210
|
+
* Check if a transition is valid from the current state.
|
|
211
|
+
* Returns false if FSM is not initialized.
|
|
212
|
+
*
|
|
213
|
+
* @param event The event to check
|
|
214
|
+
* @returns true if the transition is valid, false otherwise
|
|
215
|
+
*
|
|
216
|
+
* @example
|
|
217
|
+
* ```typescript
|
|
218
|
+
* if (this.canTransition('START')) {
|
|
219
|
+
* this.transition('START');
|
|
220
|
+
* }
|
|
221
|
+
* ```
|
|
222
|
+
*/
|
|
223
|
+
canTransition(event: TEvent): boolean;
|
|
224
|
+
/**
|
|
225
|
+
* Check if the state machine is currently in a specific state.
|
|
226
|
+
* Returns false if FSM is not initialized.
|
|
227
|
+
*
|
|
228
|
+
* @param state The state to check
|
|
229
|
+
* @returns true if currently in the specified state, false otherwise
|
|
230
|
+
*
|
|
231
|
+
* @example
|
|
232
|
+
* ```typescript
|
|
233
|
+
* if (this.isInState('idle')) {
|
|
234
|
+
* console.log('System is idle');
|
|
235
|
+
* }
|
|
236
|
+
* ```
|
|
237
|
+
*/
|
|
238
|
+
isInState(state: TState): boolean;
|
|
239
|
+
/**
|
|
240
|
+
* History of state transitions (if trackHistory is enabled).
|
|
241
|
+
* Each entry contains the state, timestamp, and optional event that caused the transition.
|
|
242
|
+
*
|
|
243
|
+
* Only available when `trackHistory: true` is set in options.
|
|
244
|
+
*/
|
|
245
|
+
stateHistory?: Array<{
|
|
246
|
+
state: TState;
|
|
247
|
+
timestamp: Date;
|
|
248
|
+
event?: TEvent;
|
|
249
|
+
}>;
|
|
250
|
+
}
|
|
251
|
+
/**
|
|
252
|
+
* Class decorator that adds finite state machine capabilities to a KOS model.
|
|
253
|
+
*
|
|
254
|
+
* This decorator eliminates manual state management boilerplate by:
|
|
255
|
+
* - **Adding lifecycle-aware FSM initialization** at configured phase (READY, ACTIVATE, etc.)
|
|
256
|
+
* - **Managing state transitions** automatically with validation
|
|
257
|
+
* - **Providing observable state** that integrates with @kosModel reactive system
|
|
258
|
+
* - **Supporting entry/exit handlers** via @kosStateEntry and @kosStateExit decorators
|
|
259
|
+
* - **Enabling state guards** via @kosStateGuard decorator
|
|
260
|
+
*
|
|
261
|
+
* ## Two-Level State System
|
|
262
|
+
*
|
|
263
|
+
* **Framework Lifecycle (Universal, Not Customizable):**
|
|
264
|
+
* - CREATED → INIT → LOAD → READY → ACTIVATE → UNLOAD → DESTROY
|
|
265
|
+
* - Managed by KOS framework
|
|
266
|
+
* - Same for all models
|
|
267
|
+
*
|
|
268
|
+
* **Application FSM (This Decorator):**
|
|
269
|
+
* - Runs WITHIN an active model
|
|
270
|
+
* - Application-specific business logic
|
|
271
|
+
* - Different for each model type
|
|
272
|
+
* - Examples: Pour states, connection states, workflow states
|
|
273
|
+
*
|
|
274
|
+
* ## Lifecycle Integration
|
|
275
|
+
*
|
|
276
|
+
* The FSM initializes at the configured lifecycle phase:
|
|
277
|
+
*
|
|
278
|
+
* ```typescript
|
|
279
|
+
* @kosStateMachine({
|
|
280
|
+
* initial: 'idle',
|
|
281
|
+
* initializeAt: DependencyLifecycle.READY, // Default
|
|
282
|
+
* states: { ... }
|
|
283
|
+
* })
|
|
284
|
+
* ```
|
|
285
|
+
*
|
|
286
|
+
* - **INIT**: FSM needs to be active during model initialization (rare)
|
|
287
|
+
* - **READY**: FSM operational as soon as data loaded (most common)
|
|
288
|
+
* - **ACTIVATE**: FSM only relevant when UI is active (UI-bound models)
|
|
289
|
+
*
|
|
290
|
+
* ## TypeScript Usage
|
|
291
|
+
*
|
|
292
|
+
* **IMPORTANT**: Use TypeScript interface merging to get proper type information:
|
|
293
|
+
*
|
|
294
|
+
* ```typescript
|
|
295
|
+
* type MyState = 'idle' | 'active';
|
|
296
|
+
* type MyEvent = 'START' | 'STOP';
|
|
297
|
+
*
|
|
298
|
+
* interface MyModelImpl extends KosStateMachineAware<MyState, MyEvent> {}
|
|
299
|
+
*
|
|
300
|
+
* @kosStateMachine<MyState, MyEvent>({ ... })
|
|
301
|
+
* class MyModelImpl implements IKosDataModel {
|
|
302
|
+
* // All FSM properties are now available with full type safety
|
|
303
|
+
* }
|
|
304
|
+
* ```
|
|
305
|
+
*
|
|
306
|
+
* @param config State machine configuration
|
|
307
|
+
* @param options Optional configuration for FSM behavior
|
|
308
|
+
* @returns A class decorator that modifies the target class prototype
|
|
309
|
+
*
|
|
310
|
+
* @see {@link KosStateMachineAware} - Interface for TypeScript merging
|
|
311
|
+
* @see {@link KosStateMachineConfig} - Configuration interface
|
|
312
|
+
* @see {@link KosStateMachineOptions} - Options interface
|
|
313
|
+
*
|
|
314
|
+
* @example
|
|
315
|
+
* ```typescript
|
|
316
|
+
* // Basic FSM with default READY initialization
|
|
317
|
+
* type PourState = 'idle' | 'pouring' | 'complete';
|
|
318
|
+
* type PourEvent = 'START' | 'FINISH';
|
|
319
|
+
*
|
|
320
|
+
* interface PourModelImpl extends KosStateMachineAware<PourState, PourEvent> {}
|
|
321
|
+
*
|
|
322
|
+
* @kosModel({ modelTypeId: "pour-model" })
|
|
323
|
+
* @kosStateMachine<PourState, PourEvent>({
|
|
324
|
+
* initial: 'idle',
|
|
325
|
+
* states: {
|
|
326
|
+
* idle: { on: { START: 'pouring' } },
|
|
327
|
+
* pouring: { on: { FINISH: 'complete' } },
|
|
328
|
+
* complete: {}
|
|
329
|
+
* }
|
|
330
|
+
* })
|
|
331
|
+
* class PourModelImpl implements IKosDataModel {
|
|
332
|
+
* async ready(): Promise<void> {
|
|
333
|
+
* // After this completes, FSM is initialized to 'idle'
|
|
334
|
+
* }
|
|
335
|
+
*
|
|
336
|
+
* startPour(): void {
|
|
337
|
+
* this.transition('START'); // idle -> pouring
|
|
338
|
+
* }
|
|
339
|
+
* }
|
|
340
|
+
* ```
|
|
341
|
+
*
|
|
342
|
+
* @example
|
|
343
|
+
* ```typescript
|
|
344
|
+
* // UI-bound FSM with ACTIVATE initialization
|
|
345
|
+
* type WorkflowState = 'draft' | 'review' | 'approved';
|
|
346
|
+
* type WorkflowEvent = 'SUBMIT' | 'APPROVE' | 'REJECT';
|
|
347
|
+
*
|
|
348
|
+
* interface DocumentModelImpl extends KosStateMachineAware<WorkflowState, WorkflowEvent> {}
|
|
349
|
+
*
|
|
350
|
+
* @kosModel({ modelTypeId: "document-model" })
|
|
351
|
+
* @kosStateMachine<WorkflowState, WorkflowEvent>({
|
|
352
|
+
* initial: 'draft',
|
|
353
|
+
* initializeAt: DependencyLifecycle.ACTIVATE, // UI-bound
|
|
354
|
+
* states: {
|
|
355
|
+
* draft: { on: { SUBMIT: 'review' } },
|
|
356
|
+
* review: { on: { APPROVE: 'approved', REJECT: 'draft' } },
|
|
357
|
+
* approved: {}
|
|
358
|
+
* }
|
|
359
|
+
* })
|
|
360
|
+
* class DocumentModelImpl implements IKosDataModel {
|
|
361
|
+
* // FSM only initializes when UI activates this model
|
|
362
|
+
* }
|
|
363
|
+
* ```
|
|
364
|
+
*
|
|
365
|
+
* @example
|
|
366
|
+
* ```typescript
|
|
367
|
+
* // FSM with history tracking
|
|
368
|
+
* interface HistoryModelImpl extends KosStateMachineAware<'idle' | 'active', 'TOGGLE'> {}
|
|
369
|
+
*
|
|
370
|
+
* @kosStateMachine<'idle' | 'active', 'TOGGLE'>(
|
|
371
|
+
* {
|
|
372
|
+
* initial: 'idle',
|
|
373
|
+
* states: {
|
|
374
|
+
* idle: { on: { TOGGLE: 'active' } },
|
|
375
|
+
* active: { on: { TOGGLE: 'idle' } }
|
|
376
|
+
* }
|
|
377
|
+
* },
|
|
378
|
+
* {
|
|
379
|
+
* trackHistory: true,
|
|
380
|
+
* stateProperty: 'status'
|
|
381
|
+
* }
|
|
382
|
+
* )
|
|
383
|
+
* class HistoryModelImpl implements IKosDataModel {
|
|
384
|
+
* // Access via this.stateHistory
|
|
385
|
+
* }
|
|
386
|
+
* ```
|
|
387
|
+
*
|
|
388
|
+
* @category KOS Model Decorator
|
|
389
|
+
* @since 2.1.0
|
|
390
|
+
*/
|
|
391
|
+
export declare function kosStateMachine<TState extends string, TEvent extends string>(config: KosStateMachineConfig<TState, TEvent>, options?: KosStateMachineOptions): ClassDecorator;
|
|
392
|
+
/**
|
|
393
|
+
* Method decorator that marks a method as a state entry handler.
|
|
394
|
+
* The decorated method will be called when the state machine enters the specified state.
|
|
395
|
+
*
|
|
396
|
+
* @param state The state to handle entry for
|
|
397
|
+
* @returns A method decorator
|
|
398
|
+
*
|
|
399
|
+
* @example
|
|
400
|
+
* ```typescript
|
|
401
|
+
* @kosStateEntry('pouring')
|
|
402
|
+
* handlePouringStart(): void {
|
|
403
|
+
* this.logger.info('Pour started');
|
|
404
|
+
* EventBus.publish(TOPIC_POUR_STARTED, { id: this.id });
|
|
405
|
+
* }
|
|
406
|
+
* ```
|
|
407
|
+
*/
|
|
408
|
+
export declare function kosStateEntry<TState extends string>(state: TState): MethodDecorator;
|
|
409
|
+
/**
|
|
410
|
+
* Method decorator that marks a method as a state exit handler.
|
|
411
|
+
* The decorated method will be called when the state machine exits the specified state.
|
|
412
|
+
*
|
|
413
|
+
* @param state The state to handle exit for
|
|
414
|
+
* @returns A method decorator
|
|
415
|
+
*
|
|
416
|
+
* @example
|
|
417
|
+
* ```typescript
|
|
418
|
+
* @kosStateExit('pouring')
|
|
419
|
+
* handlePouringEnd(): void {
|
|
420
|
+
* this.logger.info('Pour ended');
|
|
421
|
+
* EventBus.publish(TOPIC_POUR_ENDED, { id: this.id });
|
|
422
|
+
* }
|
|
423
|
+
* ```
|
|
424
|
+
*/
|
|
425
|
+
export declare function kosStateExit<TState extends string>(state: TState): MethodDecorator;
|
|
426
|
+
/**
|
|
427
|
+
* Options for @kosStateGuard decorator.
|
|
428
|
+
*/
|
|
429
|
+
export interface KosStateGuardOptions<TState extends string> {
|
|
430
|
+
/**
|
|
431
|
+
* Array of states in which the decorated method can be called.
|
|
432
|
+
* The method will throw an error (or log a warning) if called from any other state.
|
|
433
|
+
*/
|
|
434
|
+
allowedStates: TState[];
|
|
435
|
+
/**
|
|
436
|
+
* Whether to throw an error on invalid state.
|
|
437
|
+
* When false, logs a warning instead.
|
|
438
|
+
*
|
|
439
|
+
* @default true (uses the FSM's throwOnInvalid setting)
|
|
440
|
+
*/
|
|
441
|
+
throwOnInvalid?: boolean;
|
|
442
|
+
}
|
|
443
|
+
/**
|
|
444
|
+
* Method decorator that guards a method with state validation.
|
|
445
|
+
* The decorated method can only be called when the state machine is in one of the allowed states.
|
|
446
|
+
*
|
|
447
|
+
* **IMPORTANT**: This decorator gracefully handles uninitialized FSM:
|
|
448
|
+
* - If FSM is not yet initialized, the guard allows the method to proceed
|
|
449
|
+
* - Once FSM is initialized, the guard enforces state validation
|
|
450
|
+
*
|
|
451
|
+
* @param options Guard configuration
|
|
452
|
+
* @returns A method decorator
|
|
453
|
+
*
|
|
454
|
+
* @example
|
|
455
|
+
* ```typescript
|
|
456
|
+
* @kosStateGuard({ allowedStates: ['ready'] })
|
|
457
|
+
* async pourBeverage(bevId: string): Promise<void> {
|
|
458
|
+
* // This method can only be called when currentState === 'ready'
|
|
459
|
+
* this.transition('POUR');
|
|
460
|
+
* await this.deviceService.dispense(bevId);
|
|
461
|
+
* this.transition('COMPLETE');
|
|
462
|
+
* }
|
|
463
|
+
* ```
|
|
464
|
+
*/
|
|
465
|
+
export declare function kosStateGuard<TState extends string>(options: KosStateGuardOptions<TState>): MethodDecorator;
|
|
466
|
+
//# sourceMappingURL=kos-state-machine.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"kos-state-machine.d.ts","sourceRoot":"","sources":["../../../../../../../packages/sdk/kos-ui-sdk/src/core/core/decorators/kos-state-machine.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AASlD;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,WAAW,qBAAqB,CACpC,MAAM,SAAS,MAAM,EACrB,MAAM,SAAS,MAAM;IAErB;;;OAGG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;;;;;;;;;;;;;;;;OAiBG;IACH,YAAY,CAAC,EAAE,mBAAmB,CAAC;IAEnC;;;;;;;;;;;;;OAaG;IACH,MAAM,EAAE,MAAM,CACZ,MAAM,EACN;QACE;;;WAGG;QACH,EAAE,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;KACtC,CACF,CAAC;CACH;AAED;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC;;;;OAIG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB;;;;;OAKG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IAEvB;;;;;OAKG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2EG;AACH,MAAM,WAAW,oBAAoB,CACnC,MAAM,SAAS,MAAM,EACrB,MAAM,SAAS,MAAM;IAErB;;;;OAIG;IACH,YAAY,EAAE,MAAM,CAAC;IAErB;;;;;;OAMG;IACH,QAAQ,CAAC,gBAAgB,EAAE,OAAO,CAAC;IAEnC;;;OAGG;IACH,eAAe,EAAE,OAAO,CAAC;IAEzB;;;;OAIG;IACH,QAAQ,CAAC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AqBG;AACH,wBAAgB,aAAa,CAAC,MAAM,SAAS,MAAM,EACjD,OAAO,EAAE,oBAAoB,CAAC,MAAM,CAAC,GACpC,eAAe,CAkDjB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kosModel.d.ts","sourceRoot":"","sources":["../../../../../../../packages/sdk/kos-ui-sdk/src/core/core/decorators/kosModel.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"kosModel.d.ts","sourceRoot":"","sources":["../../../../../../../packages/sdk/kos-ui-sdk/src/core/core/decorators/kosModel.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAilB5C,UAAU,cAAc;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAED;;;;;GAKG;AACH,wBAAgB,QAAQ,CACtB,CAAC,SAAS,aAAa,EACvB,CAAC,SAAS,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EACtC,MAAM,EAAE,MAAM,GAAG,cAAc,GAAG,cAAc,CAqDjD"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { FlowControlOptions } from './kos-topic-handler-flow-control';
|
|
2
2
|
import { IKosDataModel } from '../kosModel';
|
|
3
|
+
import { BaselineDependency } from '../../types/service-response-store';
|
|
3
4
|
import { DependencyLifecycle } from '../../types';
|
|
4
5
|
import { ApiCallback } from '../../../common/events';
|
|
5
6
|
|
|
@@ -10,15 +11,15 @@ export interface ApiCallbackWithWildcard<T = string> extends ApiCallback<T> {
|
|
|
10
11
|
wildcardCapture?: Record<string, string>;
|
|
11
12
|
}
|
|
12
13
|
/**
|
|
13
|
-
*
|
|
14
|
+
* Zone 3: Parses wildcard segment from topic pattern and actual topic
|
|
14
15
|
* @internal - exported for testing
|
|
15
16
|
*/
|
|
16
|
-
export declare function
|
|
17
|
+
export declare function parseWildcardSegment(pattern: string, actualTopic: string, wildcardName?: string): Record<string, string>;
|
|
17
18
|
/**
|
|
18
|
-
*
|
|
19
|
+
* Zone 3: Checks if topic pattern has trailing wildcard
|
|
19
20
|
* @internal - exported for testing
|
|
20
21
|
*/
|
|
21
|
-
export declare function
|
|
22
|
+
export declare function checkWildcardPattern(pattern: string): boolean;
|
|
22
23
|
/**
|
|
23
24
|
* Configuration parameters for defining a Kos topic handler function within a Kos Data Model class.
|
|
24
25
|
*
|
|
@@ -153,6 +154,33 @@ export interface IKosTopicHandlerParams<Response = any, Model extends IKosDataMo
|
|
|
153
154
|
* ```
|
|
154
155
|
*/
|
|
155
156
|
flow?: FlowControlOptions<Response, TransformedResponse>;
|
|
157
|
+
/**
|
|
158
|
+
* Baseline dependency configuration for baseline-delta race condition handling.
|
|
159
|
+
* When specified, this handler will wait for the baseline service request to complete
|
|
160
|
+
* before processing events, and will intelligently replay queued events based on
|
|
161
|
+
* temporal comparison with the baseline request/response timing.
|
|
162
|
+
*
|
|
163
|
+
* @example
|
|
164
|
+
* ```typescript
|
|
165
|
+
* @kosTopicHandler({
|
|
166
|
+
* topic: TOPIC_INGREDIENT_UPDATE,
|
|
167
|
+
* websocket: true,
|
|
168
|
+
* lifecycle: DependencyLifecycle.READY,
|
|
169
|
+
* requiresBaseline: {
|
|
170
|
+
* path: PATH_INGREDIENTS,
|
|
171
|
+
* method: 'get',
|
|
172
|
+
* replayStrategy: 'after-request'
|
|
173
|
+
* }
|
|
174
|
+
* })
|
|
175
|
+
* handleIngredientUpdate(payload: IngredientUpdatePayload) {
|
|
176
|
+
* // Framework guarantees:
|
|
177
|
+
* // 1. Baseline loaded before this handler executes
|
|
178
|
+
* // 2. Queued events replayed with temporal filtering
|
|
179
|
+
* // 3. Only events newer than baseline are processed
|
|
180
|
+
* }
|
|
181
|
+
* ```
|
|
182
|
+
*/
|
|
183
|
+
requiresBaseline?: BaselineDependency;
|
|
156
184
|
}
|
|
157
185
|
/**
|
|
158
186
|
* Decorator for defining a Kos topic handler function within a Kos Data Model class.
|
|
@@ -216,5 +244,5 @@ export interface IKosTopicHandlerParams<Response = any, Model extends IKosDataMo
|
|
|
216
244
|
* ```
|
|
217
245
|
* @category KOS Model Decorator
|
|
218
246
|
*/
|
|
219
|
-
export declare function kosTopicHandler<Response = any, Model extends IKosDataModel = any, TransformedResponse = Response>(
|
|
247
|
+
export declare function kosTopicHandler<Response = any, Model extends IKosDataModel = any, TransformedResponse = Response>(params: IKosTopicHandlerParams<Response, Model, TransformedResponse>): (target: any, _propertyKey: string, descriptor: PropertyDescriptor) => void;
|
|
220
248
|
//# sourceMappingURL=kosTopicHandler.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kosTopicHandler.d.ts","sourceRoot":"","sources":["../../../../../../../packages/sdk/kos-ui-sdk/src/core/core/decorators/kosTopicHandler.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAE1D,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"kosTopicHandler.d.ts","sourceRoot":"","sources":["../../../../../../../packages/sdk/kos-ui-sdk/src/core/core/decorators/kosTopicHandler.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAE1D,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAC;AAC7E,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AAG3E;;GAEG;AACH,MAAM,WAAW,uBAAuB,CAAC,CAAC,GAAG,MAAM,CAAE,SAAQ,WAAW,CAAC,CAAC,CAAC;IACzE,eAAe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;QAChG,mBAAmB,CAAC,EAAE,OAAO,CAAC;KAC/B,CAAC;IAEN;;OAEG;IACH,MAAM,CAAC,EAAE;QACP,yCAAyC;QACzC,IAAI,EAAE,MAAM,CAAC;QACb,yCAAyC;QACzC,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB,CAAC;IAEF;;;OAGG;IACH,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,QAAQ,KAAK,OAAO,CAAC;IAExC;;OAEG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IAEf;;OAEG;IACH,MAAM,CAAC,EAAE;QACP,8CAA8C;QAC9C,UAAU,EAAE,MAAM,CAAC;KACpB,CAAC;IAEF;;;;;;;;;;;;;;;;OAgBG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,IAAI,CAAC,EAAE,kBAAkB,CAAC,QAAQ,EAAE,mBAAmB,CAAC,CAAC;IAEzD;;;;;;;;;;;;;;;;;;;;;;;;;OAyBG;IACH,gBAAgB,CAAC,EAAE,kBAAkB,CAAC;CACvC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6DG;AACH,wBAAgB,eAAe,CAC7B,QAAQ,GAAG,GAAG,EACd,KAAK,SAAS,aAAa,GAAG,GAAG,EACjC,mBAAmB,GAAG,QAAQ,EAC9B,MAAM,EAAE,sBAAsB,CAAC,QAAQ,EAAE,KAAK,EAAE,mBAAmB,CAAC,YAE1D,GAAG,gBACG,MAAM,cACR,kBAAkB,UASjC"}
|
|
@@ -17,4 +17,8 @@ export declare const FutureAliases: unique symbol;
|
|
|
17
17
|
export declare const TroubleAwareSetup: unique symbol;
|
|
18
18
|
export declare const LoggerSetup: unique symbol;
|
|
19
19
|
export declare const ContainerAwareSetup: unique symbol;
|
|
20
|
+
export declare const StateMachineSetup: unique symbol;
|
|
21
|
+
export declare const StateEntryHandlers: unique symbol;
|
|
22
|
+
export declare const StateExitHandlers: unique symbol;
|
|
23
|
+
export declare const StateActionHandlers: unique symbol;
|
|
20
24
|
//# sourceMappingURL=propKeys.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"propKeys.d.ts","sourceRoot":"","sources":["../../../../../../../packages/sdk/kos-ui-sdk/src/core/core/decorators/propKeys.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,oBAAoB,eAAiC,CAAC;AACnE,eAAO,MAAM,gBAAgB,eAA6B,CAAC;AAC3D,eAAO,MAAM,aAAa,eAA0B,CAAC;AACrD,eAAO,MAAM,WAAW,eAAwB,CAAC;AACjD,eAAO,MAAM,WAAW,eAAwB,CAAC;AACjD,eAAO,MAAM,SAAS,eAAsB,CAAC;AAC7C,eAAO,MAAM,eAAe,eAA4B,CAAC;AACzD,eAAO,MAAM,cAAc,eAA2B,CAAC;AACvD,eAAO,MAAM,YAAY,eAAyB,CAAC;AACnD,eAAO,MAAM,oBAAoB,eAAiC,CAAC;AACnE,eAAO,MAAM,oBAAoB,eAAiC,CAAC;AACnE,eAAO,MAAM,4BAA4B,eAExC,CAAC;AACF,eAAO,MAAM,aAAa,eAA0B,CAAC;AACrD,eAAO,MAAM,iBAAiB,eAA8B,CAAC;AAC7D,eAAO,MAAM,WAAW,eAAwB,CAAC;AACjD,eAAO,MAAM,mBAAmB,eAAgC,CAAC"}
|
|
1
|
+
{"version":3,"file":"propKeys.d.ts","sourceRoot":"","sources":["../../../../../../../packages/sdk/kos-ui-sdk/src/core/core/decorators/propKeys.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,oBAAoB,eAAiC,CAAC;AACnE,eAAO,MAAM,gBAAgB,eAA6B,CAAC;AAC3D,eAAO,MAAM,aAAa,eAA0B,CAAC;AACrD,eAAO,MAAM,WAAW,eAAwB,CAAC;AACjD,eAAO,MAAM,WAAW,eAAwB,CAAC;AACjD,eAAO,MAAM,SAAS,eAAsB,CAAC;AAC7C,eAAO,MAAM,eAAe,eAA4B,CAAC;AACzD,eAAO,MAAM,cAAc,eAA2B,CAAC;AACvD,eAAO,MAAM,YAAY,eAAyB,CAAC;AACnD,eAAO,MAAM,oBAAoB,eAAiC,CAAC;AACnE,eAAO,MAAM,oBAAoB,eAAiC,CAAC;AACnE,eAAO,MAAM,4BAA4B,eAExC,CAAC;AACF,eAAO,MAAM,aAAa,eAA0B,CAAC;AACrD,eAAO,MAAM,iBAAiB,eAA8B,CAAC;AAC7D,eAAO,MAAM,WAAW,eAAwB,CAAC;AACjD,eAAO,MAAM,mBAAmB,eAAgC,CAAC;AACjE,eAAO,MAAM,iBAAiB,eAA8B,CAAC;AAC7D,eAAO,MAAM,kBAAkB,eAA+B,CAAC;AAC/D,eAAO,MAAM,iBAAiB,eAA8B,CAAC;AAC7D,eAAO,MAAM,mBAAmB,eAAgC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kos-registration.d.ts","sourceRoot":"","sources":["../../../../../../packages/sdk/kos-ui-sdk/src/core/core/kos-registration.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,wBAAwB,EACxB,gCAAgC,EAIjC,MAAM,UAAU,CAAC;AAGlB,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"kos-registration.d.ts","sourceRoot":"","sources":["../../../../../../packages/sdk/kos-ui-sdk/src/core/core/kos-registration.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,wBAAwB,EACxB,gCAAgC,EAIjC,MAAM,UAAU,CAAC;AAGlB,OAAO,KAAK,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAuBpE,KAAK,GAAG,CACN,CAAC,SAAS,aAAa,EACvB,CAAC,SAAS,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,IACpC,gCAAgC,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG;IAC3C,SAAS,EAAE,KAAK,CAAC;IACjB,OAAO,EAAE,wBAAwB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;CACzC,CAAC;AACF,UAAU,iBAAiB,CACzB,CAAC,SAAS,aAAa,EACvB,CAAC,SAAS,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;IAEtC,CAAC,CAAC,EAAE,MAAM,GAAG,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;CACxB;AACD,UAAU,iBAAiB,CACzB,CAAC,SAAS,aAAa,EACvB,CAAC,SAAS,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;IAEtC,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,KAAK,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,EAAE,kBAAkB,KAAK,CAAC,CAAC;IAC3E,iBAAiB,CAAC,EAAE,GAAG,CAAC;CACzB;AACD,qBAAa,eAAe,CAC1B,CAAC,SAAS,aAAa,EACvB,CAAC,SAAS,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;IAEtC,IAAI,EAAE,MAAM,CAAC;IACb,iBAAiB,CAAC,EAAE,GAAG,CAAC;IACxB,KAAK,EAAE,KAAK,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,EAAE,kBAAkB,KAAK,CAAC,CAAC;gBAC/D,EAAE,IAAI,EAAE,KAAK,EAAE,iBAAiB,EAAE,EAAE,iBAAiB,CAAC,CAAC,EAAE,CAAC,CAAC;IAMvE,IAAI,OAAO,kFAEV;IAED,IAAI,YAAY,IAAI,iBAAiB,CAAC,CAAC,EAAE,CAAC,CAAC,CAS1C;IAED,IAAI,SAAS,+BAEZ;CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kos-singleton-registration.d.ts","sourceRoot":"","sources":["../../../../../../packages/sdk/kos-ui-sdk/src/core/core/kos-singleton-registration.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,kCAAkC,EAClC,gBAAgB,EACjB,MAAM,UAAU,CAAC;AAGlB,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"kos-singleton-registration.d.ts","sourceRoot":"","sources":["../../../../../../packages/sdk/kos-ui-sdk/src/core/core/kos-singleton-registration.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,kCAAkC,EAClC,gBAAgB,EACjB,MAAM,UAAU,CAAC;AAGlB,OAAO,KAAK,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAqBpE,KAAK,GAAG,CACN,CAAC,SAAS,aAAa,EACvB,CAAC,SAAS,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,IACpC,kCAAkC,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG;IAC7C,OAAO,EAAE,gBAAgB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;CACjC,CAAC;AACF,UAAU,SAAS,CACjB,CAAC,SAAS,aAAa,EACvB,CAAC,SAAS,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;IAEtC,CAAC,CAAC,EAAE,MAAM,GAAG,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;CACxB;AAED,UAAU,iBAAiB,CACzB,CAAC,SAAS,aAAa,EACvB,CAAC,SAAS,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;IAEtC,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,KAAK,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,EAAE,kBAAkB,KAAK,CAAC,CAAC;IAC3E,iBAAiB,CAAC,EAAE,GAAG,CAAC;CACzB;AACD,qBAAa,wBAAwB,CACnC,CAAC,SAAS,aAAa,EACvB,CAAC,SAAS,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;IAEtC,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,KAAK,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,EAAE,kBAAkB,KAAK,CAAC,CAAC;IAC3E,iBAAiB,CAAC,EAAE,GAAG,CAAC;gBACZ,EAAE,IAAI,EAAE,KAAK,EAAE,iBAAiB,EAAE,EAAE,iBAAiB,CAAC,CAAC,EAAE,CAAC,CAAC;IAMvE,IAAI,OAAO,kEAEV;IAED,IAAI,YAAY,IAAI,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,CASlC;IAED,IAAI,SAAS,+BAEZ;CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kosCore.d.ts","sourceRoot":"","sources":["../../../../../../packages/sdk/kos-ui-sdk/src/core/core/kosCore.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"kosCore.d.ts","sourceRoot":"","sources":["../../../../../../packages/sdk/kos-ui-sdk/src/core/core/kosCore.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,oBAAoB,EAGrB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAKpD,OAAO,yBAAyB,CAAC;AAGjC,OAAO,EAEL,YAAY,EACZ,OAAO,EACR,MAAM,8BAA8B,CAAC;AAGtC,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAInE,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,OAAO,EAAE,eAAe,CAAC;KAC1B;CACF;AAkGD,MAAM,WAAW,iBAAiB;IAChC;;;;OAIG;IACH,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAEtB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAEtB,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAExB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAEvB,MAAM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C;IAwCvB,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC;IAOvB,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAKxB,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC;IAmBvB,SAAS;IAGT,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAsC5B,IAAI,OAAO,YAEV;IACD,IAAI,SAAS,CAAC,SAAS,EAAE,oBAAoB,EAE5C;IACD,IAAI,SAAS,IAHY,oBAAoB,CAK5C;IAED,IAAI,eAAe,YAElB;IAED,IAAI,YAAY,YAEf;IAEK,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAYrB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;WASb,MAAM,CAClB,QAAQ,EAAE,YAAY,EACtB,KAAK,CAAC,EAAE,OAAO,EACf,eAAe,CAAC,EAAE,MAAM;WA8EZ,WAAW,CAAC,IAAI,CAAC,EAAE;QAC/B,KAAK,CAAC,EAAE,OAAO,CAAC;QAChB,eAAe,CAAC,EAAE,MAAM,CAAC;KAC1B,GAAG,eAAe;CASpB"}
|
package/core/core/kosModel.d.ts
CHANGED
|
@@ -117,6 +117,8 @@ export declare class KosModel<DataDef extends IKosDataModel = IKosDataModel> imp
|
|
|
117
117
|
effectManager?: KosEffectManager;
|
|
118
118
|
httpRouteManager?: KosHttpRouteManager;
|
|
119
119
|
onlineLifecycleManager?: KosOnlineLifecycleManager;
|
|
120
|
+
serviceResponses: any;
|
|
121
|
+
serviceRequestManager?: any;
|
|
120
122
|
companionManager: KosCompanionModelManager;
|
|
121
123
|
childResolver: KosChildResolver;
|
|
122
124
|
fsm: KosFSMManager;
|
|
@@ -144,6 +146,18 @@ export declare class KosModel<DataDef extends IKosDataModel = IKosDataModel> imp
|
|
|
144
146
|
unload(): Promise<void>;
|
|
145
147
|
init(): Promise<void>;
|
|
146
148
|
registerSubscribers(lifecycle?: DependencyLifecycle): Promise<void>;
|
|
149
|
+
/**
|
|
150
|
+
* Initialize the state machine for a specific lifecycle phase.
|
|
151
|
+
* Called from lifecycle hooks (init, load, ready, activate).
|
|
152
|
+
* @internal
|
|
153
|
+
*/
|
|
154
|
+
initializeStateMachineForLifecycle(lifecycle: DependencyLifecycle): void;
|
|
155
|
+
/**
|
|
156
|
+
* Creates lifecycle-deferred companion models at the appropriate phase.
|
|
157
|
+
* Called from lifecycle hooks (init, load, ready, activate, online).
|
|
158
|
+
* @internal
|
|
159
|
+
*/
|
|
160
|
+
private createLifecycleCompanions;
|
|
147
161
|
online(): Promise<void>;
|
|
148
162
|
offline(): Promise<void>;
|
|
149
163
|
accept(visitor: IKosVisitor<IKosModel>): void;
|