@adaas/a-utils 0.1.40 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. package/dist/index.cjs +16 -16
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.d.mts +6 -0
  4. package/dist/index.d.ts +6 -0
  5. package/dist/index.mjs +16 -16
  6. package/dist/index.mjs.map +1 -1
  7. package/package.json +3 -2
  8. package/src/lib/A-Channel/A-Channel.component.ts +6 -0
  9. package/src/lib/A-Channel/A-ChannelRequest.context.ts +7 -0
  10. package/src/lib/A-Command/A-Command.entity.ts +7 -1
  11. package/src/lib/A-Command/A-Command.error.ts +0 -1
  12. package/src/lib/A-Config/A-Config.container.ts +7 -0
  13. package/src/lib/A-Config/A-Config.context.ts +7 -0
  14. package/src/lib/A-Config/components/ConfigReader.component.ts +6 -0
  15. package/src/lib/A-Config/components/ENVConfigReader.component.ts +7 -0
  16. package/src/lib/A-Config/components/FileConfigReader.component.ts +8 -0
  17. package/src/lib/A-Execution/A-Execution.context.ts +7 -0
  18. package/src/lib/A-Logger/A-Logger.component.ts +30 -24
  19. package/src/lib/A-Manifest/A-Manifest.context.ts +6 -0
  20. package/src/lib/A-Memory/A-Memory.component.ts +7 -0
  21. package/src/lib/A-Memory/A-Memory.context.ts +6 -0
  22. package/src/lib/A-Operation/A-Operation.context.ts +8 -0
  23. package/src/lib/A-Polyfill/A-Polyfill.component.ts +9 -0
  24. package/src/lib/A-Route/A-Route.entity.ts +7 -0
  25. package/src/lib/A-Schedule/A-Schedule.component.ts +8 -1
  26. package/src/lib/A-Service/A-Service.container.ts +6 -0
  27. package/src/lib/A-Signal/components/A-SignalBus.component.ts +6 -0
  28. package/src/lib/A-Signal/context/A-SignalConfig.context.ts +6 -0
  29. package/src/lib/A-Signal/context/A-SignalState.context.ts +6 -0
  30. package/src/lib/A-Signal/entities/A-Signal.entity.ts +6 -0
  31. package/src/lib/A-Signal/entities/A-SignalVector.entity.ts +6 -0
  32. package/src/lib/A-StateMachine/A-StateMachine.component.ts +11 -0
  33. package/src/lib/A-StateMachine/A-StateMachineTransition.context.ts +11 -5
  34. package/src/lib/A-Command/A-CommandExecution.context.ts +0 -0
@@ -2,6 +2,7 @@ import { A_Component, A_Context, A_Feature, A_FormatterHelper, A_Scope } from "@
2
2
  import { A_StateMachineError } from "./A-StateMachine.error";
3
3
  import { A_StateMachineFeatures } from "./A-StateMachine.constants";
4
4
  import { A_StateMachineTransition } from "./A-StateMachineTransition.context";
5
+ import { A_Frame } from "@adaas/a-frame";
5
6
 
6
7
  /**
7
8
  * A_StateMachine is a powerful state machine implementation that allows you to define and manage
@@ -29,6 +30,12 @@ import { A_StateMachineTransition } from "./A-StateMachineTransition.context";
29
30
  * }
30
31
  * ```
31
32
  */
33
+
34
+ @A_Frame.Namespace('A-Utils')
35
+ @A_Frame.Component({
36
+ name: 'A-StateMachine',
37
+ description: 'A powerful state machine component for managing complex state transitions.'
38
+ })
32
39
  export class A_StateMachine<
33
40
  T extends Record<string, any> = Record<string, any>
34
41
  > extends A_Component {
@@ -195,6 +202,10 @@ export class A_StateMachine<
195
202
  *
196
203
  * If any step fails, the onError hook is called and a wrapped error is thrown.
197
204
  */
205
+ @A_Frame.Method({
206
+ name: 'transition',
207
+ description: 'Executes a state transition from one state to another.'
208
+ })
198
209
  async transition(
199
210
  /**
200
211
  * The state to transition from
@@ -1,8 +1,13 @@
1
+ import { A_Frame } from "@adaas/a-frame";
1
2
  import { A_OperationContext } from "../A-Operation/A-Operation.context";
2
3
  import { A_StateMachineTransitionParams, A_StateMachineTransitionStorage } from "./A-StateMachine.types";
3
4
 
4
5
 
5
6
 
7
+ @A_Frame.Fragment({
8
+ name: 'A-StateMachineTransition',
9
+ description: 'Context for managing state machine transitions.'
10
+ })
6
11
  export class A_StateMachineTransition<
7
12
  _ParamsType = any,
8
13
  _ResultType = any
@@ -13,7 +18,6 @@ export class A_StateMachineTransition<
13
18
  A_StateMachineTransitionStorage<_ResultType, _ParamsType>
14
19
  > {
15
20
 
16
-
17
21
  constructor(
18
22
  params: A_StateMachineTransitionParams<_ParamsType>
19
23
  ) {
@@ -26,14 +30,16 @@ export class A_StateMachineTransition<
26
30
  this._meta.set('to', params.to);
27
31
  }
28
32
 
29
-
30
-
33
+ /**
34
+ * The state to transition from
35
+ */
31
36
  get from(): string {
32
37
  return this._meta.get('from')!;
33
38
  }
34
39
 
35
-
36
-
40
+ /**
41
+ * The state to transition to
42
+ */
37
43
  get to(): string {
38
44
  return this._meta.get('to')!;
39
45
  }
File without changes