@adaas/a-utils 0.1.22 → 0.1.24
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/dist/index.cjs +4 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +71 -34
- package/dist/index.d.ts +71 -34
- package/dist/index.mjs +4 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/lib/A-Channel/A-Channel.constants.ts +12 -12
- package/src/lib/A-Command/A-Command.constants.ts +60 -18
- package/src/lib/A-Command/A-Command.entity.ts +21 -14
- package/src/lib/A-Command/A-Command.types.ts +2 -2
- package/src/lib/A-Memory/A-Memory.constants.ts +10 -10
- package/src/lib/A-StateMachine/A-StateMachine.constants.ts +4 -4
- package/tests/A-Command.test.ts +6 -6
package/dist/index.d.mts
CHANGED
|
@@ -66,53 +66,53 @@ declare enum A_ChannelFeatures {
|
|
|
66
66
|
/**
|
|
67
67
|
* Allows to extend timeout logic and behavior
|
|
68
68
|
*/
|
|
69
|
-
onTimeout = "
|
|
69
|
+
onTimeout = "_A_Channel_onTimeout",
|
|
70
70
|
/**
|
|
71
71
|
* Allows to extend retry logic and behavior
|
|
72
72
|
*/
|
|
73
|
-
onRetry = "
|
|
73
|
+
onRetry = "_A_Channel_onRetry",
|
|
74
74
|
/**
|
|
75
75
|
* Allows to extend circuit breaker logic and behavior
|
|
76
76
|
*/
|
|
77
|
-
onCircuitBreakerOpen = "
|
|
77
|
+
onCircuitBreakerOpen = "_A_Channel_onCircuitBreakerOpen",
|
|
78
78
|
/**
|
|
79
79
|
* Allows to extend cache logic and behavior
|
|
80
80
|
*/
|
|
81
|
-
onCache = "
|
|
81
|
+
onCache = "_A_Channel_onCache",
|
|
82
82
|
/**
|
|
83
83
|
* Allows to extend connection logic and behavior
|
|
84
84
|
*/
|
|
85
|
-
onConnect = "
|
|
85
|
+
onConnect = "_A_Channel_onConnect",
|
|
86
86
|
/**
|
|
87
87
|
* Allows to extend disconnection logic and behavior
|
|
88
88
|
*/
|
|
89
|
-
onDisconnect = "
|
|
89
|
+
onDisconnect = "_A_Channel_onDisconnect",
|
|
90
90
|
/**
|
|
91
91
|
* Allows to extend request preparation logic and behavior
|
|
92
92
|
*/
|
|
93
|
-
onBeforeRequest = "
|
|
93
|
+
onBeforeRequest = "_A_Channel_onBeforeRequest",
|
|
94
94
|
/**
|
|
95
95
|
* Allows to extend request sending logic and behavior
|
|
96
96
|
*/
|
|
97
|
-
onRequest = "
|
|
97
|
+
onRequest = "_A_Channel_onRequest",
|
|
98
98
|
/**
|
|
99
99
|
* Allows to extend request post-processing logic and behavior
|
|
100
100
|
*/
|
|
101
|
-
onAfterRequest = "
|
|
101
|
+
onAfterRequest = "_A_Channel_onAfterRequest",
|
|
102
102
|
/**
|
|
103
103
|
* Allows to extend error handling logic and behavior
|
|
104
104
|
*
|
|
105
105
|
* [!] The same approach uses for ALL errors within the channel
|
|
106
106
|
*/
|
|
107
|
-
onError = "
|
|
107
|
+
onError = "_A_Channel_onError",
|
|
108
108
|
/**
|
|
109
109
|
* Allows to extend send logic and behavior
|
|
110
110
|
*/
|
|
111
|
-
onSend = "
|
|
111
|
+
onSend = "_A_Channel_onSend",
|
|
112
112
|
/**
|
|
113
113
|
* Allows to extend consume logic and behavior
|
|
114
114
|
*/
|
|
115
|
-
onConsume = "
|
|
115
|
+
onConsume = "_A_Channel_onConsume"
|
|
116
116
|
}
|
|
117
117
|
declare enum A_ChannelRequestStatuses {
|
|
118
118
|
/**
|
|
@@ -572,6 +572,43 @@ declare enum A_CommandTransitions {
|
|
|
572
572
|
* to inject custom logic into command execution.
|
|
573
573
|
*/
|
|
574
574
|
declare enum A_CommandFeatures {
|
|
575
|
+
/**
|
|
576
|
+
* Triggered during command initialization phase
|
|
577
|
+
* Use to set up execution environment, validate parameters, or prepare resources
|
|
578
|
+
*/
|
|
579
|
+
onInit = "_A_Command_onInit",
|
|
580
|
+
/**
|
|
581
|
+
* Triggered before command execution starts
|
|
582
|
+
* Use for pre-execution validation, logging, or setup tasks
|
|
583
|
+
*/
|
|
584
|
+
onBeforeExecute = "_A_Command_onBeforeExecute",
|
|
585
|
+
/**
|
|
586
|
+
* Main command execution logic
|
|
587
|
+
* Core business logic should be implemented here
|
|
588
|
+
*/
|
|
589
|
+
onExecute = "_A_Command_onExecute",
|
|
590
|
+
/**
|
|
591
|
+
* Triggered after command execution completes (success or failure)
|
|
592
|
+
* Use for cleanup, logging, or post-processing tasks
|
|
593
|
+
*/
|
|
594
|
+
onAfterExecute = "_A_Command_onAfterExecute",
|
|
595
|
+
/**
|
|
596
|
+
* Triggered when command completes successfully
|
|
597
|
+
* Use for success-specific operations like notifications or result processing
|
|
598
|
+
*/
|
|
599
|
+
onComplete = "_A_Command_onComplete",
|
|
600
|
+
/**
|
|
601
|
+
* Triggered when command execution fails
|
|
602
|
+
* Use for error handling, cleanup, or failure notifications
|
|
603
|
+
*/
|
|
604
|
+
onFail = "_A_Command_onFail",
|
|
605
|
+
/**
|
|
606
|
+
* Triggered when an error occurs during execution
|
|
607
|
+
* Use for error logging, transformation, or recovery attempts
|
|
608
|
+
*/
|
|
609
|
+
onError = "_A_Command_onError"
|
|
610
|
+
}
|
|
611
|
+
declare enum A_CommandEvent {
|
|
575
612
|
/**
|
|
576
613
|
* Triggered during command initialization phase
|
|
577
614
|
* Use to set up execution environment, validate parameters, or prepare resources
|
|
@@ -612,7 +649,7 @@ declare enum A_CommandFeatures {
|
|
|
612
649
|
* Type alias for command lifecycle event names
|
|
613
650
|
* Represents all available events that can be listened to on a command instance
|
|
614
651
|
*/
|
|
615
|
-
type
|
|
652
|
+
type A_CommandEvents = keyof typeof A_CommandEvent;
|
|
616
653
|
|
|
617
654
|
/**
|
|
618
655
|
* Command Constructor Type
|
|
@@ -719,7 +756,7 @@ type A_TYPES__Command_Serialized<ParamsType extends Record<string, any> = Record
|
|
|
719
756
|
* command.on('onExecute', listener);
|
|
720
757
|
* ```
|
|
721
758
|
*/
|
|
722
|
-
type A_TYPES__Command_Listener<InvokeType extends A_TYPES__Command_Init = A_TYPES__Command_Init, ResultType extends Record<string, any> = Record<string, any>, LifecycleEvents extends string =
|
|
759
|
+
type A_TYPES__Command_Listener<InvokeType extends A_TYPES__Command_Init = A_TYPES__Command_Init, ResultType extends Record<string, any> = Record<string, any>, LifecycleEvents extends string = keyof typeof A_CommandEvent> = (command?: A_Command<InvokeType, ResultType, LifecycleEvents>) => void;
|
|
723
760
|
type A_Command_ExecutionContext<InvokeType extends A_TYPES__Command_Init = A_TYPES__Command_Init, ResultType extends Record<string, any> = Record<string, any>> = {
|
|
724
761
|
result: ResultType;
|
|
725
762
|
params: InvokeType;
|
|
@@ -729,19 +766,19 @@ declare enum A_StateMachineFeatures {
|
|
|
729
766
|
/**
|
|
730
767
|
* Allows to extend error handling logic and behavior
|
|
731
768
|
*/
|
|
732
|
-
onError = "
|
|
769
|
+
onError = "_A_StateMachine_onError",
|
|
733
770
|
/**
|
|
734
771
|
* Allows to extend initialization logic and behavior
|
|
735
772
|
*/
|
|
736
|
-
onInitialize = "
|
|
773
|
+
onInitialize = "_A_StateMachine_onInitialize",
|
|
737
774
|
/**
|
|
738
775
|
* Allows to extend transition validation logic and behavior
|
|
739
776
|
*/
|
|
740
|
-
onBeforeTransition = "
|
|
777
|
+
onBeforeTransition = "_A_StateMachine_onBeforeTransition",
|
|
741
778
|
/**
|
|
742
779
|
* Allows to extend post-transition logic and behavior
|
|
743
780
|
*/
|
|
744
|
-
onAfterTransition = "
|
|
781
|
+
onAfterTransition = "_A_StateMachine_onAfterTransition"
|
|
745
782
|
}
|
|
746
783
|
|
|
747
784
|
/**
|
|
@@ -1379,7 +1416,7 @@ declare class A_StateMachineTransition<_ParamsType = any, _ResultType = any> ext
|
|
|
1379
1416
|
* console.log('Status:', command.status);
|
|
1380
1417
|
* ```
|
|
1381
1418
|
*/
|
|
1382
|
-
declare class A_Command<InvokeType extends A_TYPES__Command_Init = A_TYPES__Command_Init, ResultType extends Record<string, any> = Record<string, any>, LifecycleEvents extends string |
|
|
1419
|
+
declare class A_Command<InvokeType extends A_TYPES__Command_Init = A_TYPES__Command_Init, ResultType extends Record<string, any> = Record<string, any>, LifecycleEvents extends string | keyof typeof A_CommandEvent = keyof typeof A_CommandEvent> extends A_Entity<InvokeType, A_TYPES__Command_Serialized<InvokeType, ResultType>> {
|
|
1383
1420
|
/**
|
|
1384
1421
|
* Static command identifier derived from the class name
|
|
1385
1422
|
* Used for command registration and serialization
|
|
@@ -1398,7 +1435,7 @@ declare class A_Command<InvokeType extends A_TYPES__Command_Init = A_TYPES__Comm
|
|
|
1398
1435
|
/** Current lifecycle status of the command */
|
|
1399
1436
|
protected _status: A_Command_Status;
|
|
1400
1437
|
/** Map of event listeners organized by event name */
|
|
1401
|
-
protected _listeners: Map<LifecycleEvents |
|
|
1438
|
+
protected _listeners: Map<LifecycleEvents | keyof typeof A_CommandEvent, Set<A_TYPES__Command_Listener<InvokeType, ResultType, LifecycleEvents>>>;
|
|
1402
1439
|
/** Timestamp when command execution started */
|
|
1403
1440
|
protected _startTime?: Date;
|
|
1404
1441
|
/** Timestamp when command execution ended */
|
|
@@ -1567,20 +1604,20 @@ declare class A_Command<InvokeType extends A_TYPES__Command_Init = A_TYPES__Comm
|
|
|
1567
1604
|
* @param event
|
|
1568
1605
|
* @param listener
|
|
1569
1606
|
*/
|
|
1570
|
-
on(event: LifecycleEvents |
|
|
1607
|
+
on(event: LifecycleEvents | A_CommandEvent, listener: A_TYPES__Command_Listener<InvokeType, ResultType, LifecycleEvents>): void;
|
|
1571
1608
|
/**
|
|
1572
1609
|
* Removes an event listener for a specific event
|
|
1573
1610
|
*
|
|
1574
1611
|
* @param event
|
|
1575
1612
|
* @param listener
|
|
1576
1613
|
*/
|
|
1577
|
-
off(event: LifecycleEvents |
|
|
1614
|
+
off(event: LifecycleEvents | A_CommandEvent, listener: A_TYPES__Command_Listener<InvokeType, ResultType, LifecycleEvents>): void;
|
|
1578
1615
|
/**
|
|
1579
1616
|
* Emits an event to all registered listeners
|
|
1580
1617
|
*
|
|
1581
1618
|
* @param event
|
|
1582
1619
|
*/
|
|
1583
|
-
emit(event: LifecycleEvents |
|
|
1620
|
+
emit(event: LifecycleEvents | keyof typeof A_CommandEvent): void;
|
|
1584
1621
|
/**
|
|
1585
1622
|
* Allows to create a Command instance from new data
|
|
1586
1623
|
*
|
|
@@ -2121,43 +2158,43 @@ declare enum A_MemoryFeatures {
|
|
|
2121
2158
|
/**
|
|
2122
2159
|
* Allows to extend initialization logic and behavior
|
|
2123
2160
|
*/
|
|
2124
|
-
onInit = "
|
|
2161
|
+
onInit = "_A_Memory_onInit",
|
|
2125
2162
|
/**
|
|
2126
2163
|
* Allows to extend destruction logic and behavior
|
|
2127
2164
|
*/
|
|
2128
|
-
onDestroy = "
|
|
2165
|
+
onDestroy = "_A_Memory_onDestroy",
|
|
2129
2166
|
/**
|
|
2130
2167
|
* Allows to extend expiration logic and behavior
|
|
2131
2168
|
*/
|
|
2132
|
-
onExpire = "
|
|
2169
|
+
onExpire = "_A_Memory_onExpire",
|
|
2133
2170
|
/**
|
|
2134
2171
|
* Allows to extend error handling logic and behavior
|
|
2135
2172
|
*/
|
|
2136
|
-
onError = "
|
|
2173
|
+
onError = "_A_Memory_onError",
|
|
2137
2174
|
/**
|
|
2138
2175
|
* Allows to extend serialization logic and behavior
|
|
2139
2176
|
*/
|
|
2140
|
-
onSerialize = "
|
|
2177
|
+
onSerialize = "_A_Memory_onSerialize",
|
|
2141
2178
|
/**
|
|
2142
2179
|
* Allows to extend set operation logic and behavior
|
|
2143
2180
|
*/
|
|
2144
|
-
onSet = "
|
|
2181
|
+
onSet = "_A_Memory_onSet",
|
|
2145
2182
|
/**
|
|
2146
2183
|
* Allows to extend get operation logic and behavior
|
|
2147
2184
|
*/
|
|
2148
|
-
onGet = "
|
|
2185
|
+
onGet = "_A_Memory_onGet",
|
|
2149
2186
|
/**
|
|
2150
2187
|
* Allows to extend drop operation logic and behavior
|
|
2151
2188
|
*/
|
|
2152
|
-
onDrop = "
|
|
2189
|
+
onDrop = "_A_Memory_onDrop",
|
|
2153
2190
|
/**
|
|
2154
2191
|
* Allows to extend clear operation logic and behavior
|
|
2155
2192
|
*/
|
|
2156
|
-
onClear = "
|
|
2193
|
+
onClear = "_A_Memory_onClear",
|
|
2157
2194
|
/**
|
|
2158
2195
|
* Allows to extend has operation logic and behavior
|
|
2159
2196
|
*/
|
|
2160
|
-
onHas = "
|
|
2197
|
+
onHas = "_A_Memory_onHas"
|
|
2161
2198
|
}
|
|
2162
2199
|
|
|
2163
2200
|
declare class A_MemoryContext<_MemoryType extends Record<string, any> = Record<string, any>, _SerializedType extends A_TYPES__Fragment_Serialized = A_TYPES__Fragment_Serialized> extends A_Fragment {
|
|
@@ -2385,4 +2422,4 @@ declare class A_StateMachineError extends A_Error {
|
|
|
2385
2422
|
static readonly TransitionError = "A-StateMachine Transition Error";
|
|
2386
2423
|
}
|
|
2387
2424
|
|
|
2388
|
-
export { A_CONSTANTS__CONFIG_ENV_VARIABLES, A_CONSTANTS__CONFIG_ENV_VARIABLES_ARRAY, A_Channel, A_ChannelError, A_ChannelFeatures, A_ChannelRequest, A_ChannelRequestStatuses, A_Command, A_CommandError,
|
|
2425
|
+
export { A_CONSTANTS__CONFIG_ENV_VARIABLES, A_CONSTANTS__CONFIG_ENV_VARIABLES_ARRAY, A_Channel, A_ChannelError, A_ChannelFeatures, A_ChannelRequest, A_ChannelRequestStatuses, A_Command, A_CommandError, A_CommandEvent, type A_CommandEvents, A_CommandFeatures, A_CommandTransitions, type A_Command_ExecutionContext, A_Command_Status, A_Config, A_ConfigError, A_ConfigLoader, A_Deferred, A_ExecutionContext, A_LOGGER_ANSI, A_LOGGER_COLORS, A_LOGGER_DEFAULT_LEVEL, A_LOGGER_DEFAULT_SCOPE_LENGTH, A_LOGGER_ENV_KEYS, A_LOGGER_FORMAT, A_LOGGER_SAFE_RANDOM_COLORS, A_LOGGER_TIME_FORMAT, A_Logger, A_LoggerEnvVariables, A_LoggerEnvVariablesArray, type A_LoggerEnvVariablesType, type A_LoggerLevel, A_Manifest, A_ManifestChecker, A_ManifestError, A_Memory, A_MemoryContext, type A_MemoryContextMeta, A_MemoryError, A_MemoryFeatures, type A_MemoryOperationContext, type A_MemoryOperationContextMeta, type A_MemoryOperations, type A_Memory_Storage, A_OperationContext, type A_Operation_Serialized, type A_Operation_Storage, A_Polyfill, A_Schedule, A_ScheduleObject, A_StateMachine, A_StateMachineError, A_StateMachineFeatures, A_StateMachineTransition, type A_StateMachineTransitionParams, type A_StateMachineTransitionStorage, type A_TYPES__Command_Constructor, type A_TYPES__Command_Init, type A_TYPES__Command_Listener, type A_TYPES__Command_Serialized, type A_TYPES__ConfigContainerConstructor, type A_TYPES__ConfigENVVariables, A_TYPES__ConfigFeature, type A_UTILS_TYPES__ManifestQuery, type A_UTILS_TYPES__ManifestRule, type A_UTILS_TYPES__Manifest_AllowedComponents, type A_UTILS_TYPES__Manifest_ComponentLevelConfig, type A_UTILS_TYPES__Manifest_Init, type A_UTILS_TYPES__Manifest_MethodLevelConfig, type A_UTILS_TYPES__Manifest_Rules, type A_UTILS_TYPES__ScheduleObjectCallback, type A_UTILS_TYPES__ScheduleObjectConfig, ConfigReader, ENVConfigReader, FileConfigReader, type IbufferInterface, type IcryptoInterface, type Ifspolyfill, type IhttpInterface, type IhttpsInterface, type IpathInterface, type IprocessInterface, type IurlInterface };
|
package/dist/index.d.ts
CHANGED
|
@@ -66,53 +66,53 @@ declare enum A_ChannelFeatures {
|
|
|
66
66
|
/**
|
|
67
67
|
* Allows to extend timeout logic and behavior
|
|
68
68
|
*/
|
|
69
|
-
onTimeout = "
|
|
69
|
+
onTimeout = "_A_Channel_onTimeout",
|
|
70
70
|
/**
|
|
71
71
|
* Allows to extend retry logic and behavior
|
|
72
72
|
*/
|
|
73
|
-
onRetry = "
|
|
73
|
+
onRetry = "_A_Channel_onRetry",
|
|
74
74
|
/**
|
|
75
75
|
* Allows to extend circuit breaker logic and behavior
|
|
76
76
|
*/
|
|
77
|
-
onCircuitBreakerOpen = "
|
|
77
|
+
onCircuitBreakerOpen = "_A_Channel_onCircuitBreakerOpen",
|
|
78
78
|
/**
|
|
79
79
|
* Allows to extend cache logic and behavior
|
|
80
80
|
*/
|
|
81
|
-
onCache = "
|
|
81
|
+
onCache = "_A_Channel_onCache",
|
|
82
82
|
/**
|
|
83
83
|
* Allows to extend connection logic and behavior
|
|
84
84
|
*/
|
|
85
|
-
onConnect = "
|
|
85
|
+
onConnect = "_A_Channel_onConnect",
|
|
86
86
|
/**
|
|
87
87
|
* Allows to extend disconnection logic and behavior
|
|
88
88
|
*/
|
|
89
|
-
onDisconnect = "
|
|
89
|
+
onDisconnect = "_A_Channel_onDisconnect",
|
|
90
90
|
/**
|
|
91
91
|
* Allows to extend request preparation logic and behavior
|
|
92
92
|
*/
|
|
93
|
-
onBeforeRequest = "
|
|
93
|
+
onBeforeRequest = "_A_Channel_onBeforeRequest",
|
|
94
94
|
/**
|
|
95
95
|
* Allows to extend request sending logic and behavior
|
|
96
96
|
*/
|
|
97
|
-
onRequest = "
|
|
97
|
+
onRequest = "_A_Channel_onRequest",
|
|
98
98
|
/**
|
|
99
99
|
* Allows to extend request post-processing logic and behavior
|
|
100
100
|
*/
|
|
101
|
-
onAfterRequest = "
|
|
101
|
+
onAfterRequest = "_A_Channel_onAfterRequest",
|
|
102
102
|
/**
|
|
103
103
|
* Allows to extend error handling logic and behavior
|
|
104
104
|
*
|
|
105
105
|
* [!] The same approach uses for ALL errors within the channel
|
|
106
106
|
*/
|
|
107
|
-
onError = "
|
|
107
|
+
onError = "_A_Channel_onError",
|
|
108
108
|
/**
|
|
109
109
|
* Allows to extend send logic and behavior
|
|
110
110
|
*/
|
|
111
|
-
onSend = "
|
|
111
|
+
onSend = "_A_Channel_onSend",
|
|
112
112
|
/**
|
|
113
113
|
* Allows to extend consume logic and behavior
|
|
114
114
|
*/
|
|
115
|
-
onConsume = "
|
|
115
|
+
onConsume = "_A_Channel_onConsume"
|
|
116
116
|
}
|
|
117
117
|
declare enum A_ChannelRequestStatuses {
|
|
118
118
|
/**
|
|
@@ -572,6 +572,43 @@ declare enum A_CommandTransitions {
|
|
|
572
572
|
* to inject custom logic into command execution.
|
|
573
573
|
*/
|
|
574
574
|
declare enum A_CommandFeatures {
|
|
575
|
+
/**
|
|
576
|
+
* Triggered during command initialization phase
|
|
577
|
+
* Use to set up execution environment, validate parameters, or prepare resources
|
|
578
|
+
*/
|
|
579
|
+
onInit = "_A_Command_onInit",
|
|
580
|
+
/**
|
|
581
|
+
* Triggered before command execution starts
|
|
582
|
+
* Use for pre-execution validation, logging, or setup tasks
|
|
583
|
+
*/
|
|
584
|
+
onBeforeExecute = "_A_Command_onBeforeExecute",
|
|
585
|
+
/**
|
|
586
|
+
* Main command execution logic
|
|
587
|
+
* Core business logic should be implemented here
|
|
588
|
+
*/
|
|
589
|
+
onExecute = "_A_Command_onExecute",
|
|
590
|
+
/**
|
|
591
|
+
* Triggered after command execution completes (success or failure)
|
|
592
|
+
* Use for cleanup, logging, or post-processing tasks
|
|
593
|
+
*/
|
|
594
|
+
onAfterExecute = "_A_Command_onAfterExecute",
|
|
595
|
+
/**
|
|
596
|
+
* Triggered when command completes successfully
|
|
597
|
+
* Use for success-specific operations like notifications or result processing
|
|
598
|
+
*/
|
|
599
|
+
onComplete = "_A_Command_onComplete",
|
|
600
|
+
/**
|
|
601
|
+
* Triggered when command execution fails
|
|
602
|
+
* Use for error handling, cleanup, or failure notifications
|
|
603
|
+
*/
|
|
604
|
+
onFail = "_A_Command_onFail",
|
|
605
|
+
/**
|
|
606
|
+
* Triggered when an error occurs during execution
|
|
607
|
+
* Use for error logging, transformation, or recovery attempts
|
|
608
|
+
*/
|
|
609
|
+
onError = "_A_Command_onError"
|
|
610
|
+
}
|
|
611
|
+
declare enum A_CommandEvent {
|
|
575
612
|
/**
|
|
576
613
|
* Triggered during command initialization phase
|
|
577
614
|
* Use to set up execution environment, validate parameters, or prepare resources
|
|
@@ -612,7 +649,7 @@ declare enum A_CommandFeatures {
|
|
|
612
649
|
* Type alias for command lifecycle event names
|
|
613
650
|
* Represents all available events that can be listened to on a command instance
|
|
614
651
|
*/
|
|
615
|
-
type
|
|
652
|
+
type A_CommandEvents = keyof typeof A_CommandEvent;
|
|
616
653
|
|
|
617
654
|
/**
|
|
618
655
|
* Command Constructor Type
|
|
@@ -719,7 +756,7 @@ type A_TYPES__Command_Serialized<ParamsType extends Record<string, any> = Record
|
|
|
719
756
|
* command.on('onExecute', listener);
|
|
720
757
|
* ```
|
|
721
758
|
*/
|
|
722
|
-
type A_TYPES__Command_Listener<InvokeType extends A_TYPES__Command_Init = A_TYPES__Command_Init, ResultType extends Record<string, any> = Record<string, any>, LifecycleEvents extends string =
|
|
759
|
+
type A_TYPES__Command_Listener<InvokeType extends A_TYPES__Command_Init = A_TYPES__Command_Init, ResultType extends Record<string, any> = Record<string, any>, LifecycleEvents extends string = keyof typeof A_CommandEvent> = (command?: A_Command<InvokeType, ResultType, LifecycleEvents>) => void;
|
|
723
760
|
type A_Command_ExecutionContext<InvokeType extends A_TYPES__Command_Init = A_TYPES__Command_Init, ResultType extends Record<string, any> = Record<string, any>> = {
|
|
724
761
|
result: ResultType;
|
|
725
762
|
params: InvokeType;
|
|
@@ -729,19 +766,19 @@ declare enum A_StateMachineFeatures {
|
|
|
729
766
|
/**
|
|
730
767
|
* Allows to extend error handling logic and behavior
|
|
731
768
|
*/
|
|
732
|
-
onError = "
|
|
769
|
+
onError = "_A_StateMachine_onError",
|
|
733
770
|
/**
|
|
734
771
|
* Allows to extend initialization logic and behavior
|
|
735
772
|
*/
|
|
736
|
-
onInitialize = "
|
|
773
|
+
onInitialize = "_A_StateMachine_onInitialize",
|
|
737
774
|
/**
|
|
738
775
|
* Allows to extend transition validation logic and behavior
|
|
739
776
|
*/
|
|
740
|
-
onBeforeTransition = "
|
|
777
|
+
onBeforeTransition = "_A_StateMachine_onBeforeTransition",
|
|
741
778
|
/**
|
|
742
779
|
* Allows to extend post-transition logic and behavior
|
|
743
780
|
*/
|
|
744
|
-
onAfterTransition = "
|
|
781
|
+
onAfterTransition = "_A_StateMachine_onAfterTransition"
|
|
745
782
|
}
|
|
746
783
|
|
|
747
784
|
/**
|
|
@@ -1379,7 +1416,7 @@ declare class A_StateMachineTransition<_ParamsType = any, _ResultType = any> ext
|
|
|
1379
1416
|
* console.log('Status:', command.status);
|
|
1380
1417
|
* ```
|
|
1381
1418
|
*/
|
|
1382
|
-
declare class A_Command<InvokeType extends A_TYPES__Command_Init = A_TYPES__Command_Init, ResultType extends Record<string, any> = Record<string, any>, LifecycleEvents extends string |
|
|
1419
|
+
declare class A_Command<InvokeType extends A_TYPES__Command_Init = A_TYPES__Command_Init, ResultType extends Record<string, any> = Record<string, any>, LifecycleEvents extends string | keyof typeof A_CommandEvent = keyof typeof A_CommandEvent> extends A_Entity<InvokeType, A_TYPES__Command_Serialized<InvokeType, ResultType>> {
|
|
1383
1420
|
/**
|
|
1384
1421
|
* Static command identifier derived from the class name
|
|
1385
1422
|
* Used for command registration and serialization
|
|
@@ -1398,7 +1435,7 @@ declare class A_Command<InvokeType extends A_TYPES__Command_Init = A_TYPES__Comm
|
|
|
1398
1435
|
/** Current lifecycle status of the command */
|
|
1399
1436
|
protected _status: A_Command_Status;
|
|
1400
1437
|
/** Map of event listeners organized by event name */
|
|
1401
|
-
protected _listeners: Map<LifecycleEvents |
|
|
1438
|
+
protected _listeners: Map<LifecycleEvents | keyof typeof A_CommandEvent, Set<A_TYPES__Command_Listener<InvokeType, ResultType, LifecycleEvents>>>;
|
|
1402
1439
|
/** Timestamp when command execution started */
|
|
1403
1440
|
protected _startTime?: Date;
|
|
1404
1441
|
/** Timestamp when command execution ended */
|
|
@@ -1567,20 +1604,20 @@ declare class A_Command<InvokeType extends A_TYPES__Command_Init = A_TYPES__Comm
|
|
|
1567
1604
|
* @param event
|
|
1568
1605
|
* @param listener
|
|
1569
1606
|
*/
|
|
1570
|
-
on(event: LifecycleEvents |
|
|
1607
|
+
on(event: LifecycleEvents | A_CommandEvent, listener: A_TYPES__Command_Listener<InvokeType, ResultType, LifecycleEvents>): void;
|
|
1571
1608
|
/**
|
|
1572
1609
|
* Removes an event listener for a specific event
|
|
1573
1610
|
*
|
|
1574
1611
|
* @param event
|
|
1575
1612
|
* @param listener
|
|
1576
1613
|
*/
|
|
1577
|
-
off(event: LifecycleEvents |
|
|
1614
|
+
off(event: LifecycleEvents | A_CommandEvent, listener: A_TYPES__Command_Listener<InvokeType, ResultType, LifecycleEvents>): void;
|
|
1578
1615
|
/**
|
|
1579
1616
|
* Emits an event to all registered listeners
|
|
1580
1617
|
*
|
|
1581
1618
|
* @param event
|
|
1582
1619
|
*/
|
|
1583
|
-
emit(event: LifecycleEvents |
|
|
1620
|
+
emit(event: LifecycleEvents | keyof typeof A_CommandEvent): void;
|
|
1584
1621
|
/**
|
|
1585
1622
|
* Allows to create a Command instance from new data
|
|
1586
1623
|
*
|
|
@@ -2121,43 +2158,43 @@ declare enum A_MemoryFeatures {
|
|
|
2121
2158
|
/**
|
|
2122
2159
|
* Allows to extend initialization logic and behavior
|
|
2123
2160
|
*/
|
|
2124
|
-
onInit = "
|
|
2161
|
+
onInit = "_A_Memory_onInit",
|
|
2125
2162
|
/**
|
|
2126
2163
|
* Allows to extend destruction logic and behavior
|
|
2127
2164
|
*/
|
|
2128
|
-
onDestroy = "
|
|
2165
|
+
onDestroy = "_A_Memory_onDestroy",
|
|
2129
2166
|
/**
|
|
2130
2167
|
* Allows to extend expiration logic and behavior
|
|
2131
2168
|
*/
|
|
2132
|
-
onExpire = "
|
|
2169
|
+
onExpire = "_A_Memory_onExpire",
|
|
2133
2170
|
/**
|
|
2134
2171
|
* Allows to extend error handling logic and behavior
|
|
2135
2172
|
*/
|
|
2136
|
-
onError = "
|
|
2173
|
+
onError = "_A_Memory_onError",
|
|
2137
2174
|
/**
|
|
2138
2175
|
* Allows to extend serialization logic and behavior
|
|
2139
2176
|
*/
|
|
2140
|
-
onSerialize = "
|
|
2177
|
+
onSerialize = "_A_Memory_onSerialize",
|
|
2141
2178
|
/**
|
|
2142
2179
|
* Allows to extend set operation logic and behavior
|
|
2143
2180
|
*/
|
|
2144
|
-
onSet = "
|
|
2181
|
+
onSet = "_A_Memory_onSet",
|
|
2145
2182
|
/**
|
|
2146
2183
|
* Allows to extend get operation logic and behavior
|
|
2147
2184
|
*/
|
|
2148
|
-
onGet = "
|
|
2185
|
+
onGet = "_A_Memory_onGet",
|
|
2149
2186
|
/**
|
|
2150
2187
|
* Allows to extend drop operation logic and behavior
|
|
2151
2188
|
*/
|
|
2152
|
-
onDrop = "
|
|
2189
|
+
onDrop = "_A_Memory_onDrop",
|
|
2153
2190
|
/**
|
|
2154
2191
|
* Allows to extend clear operation logic and behavior
|
|
2155
2192
|
*/
|
|
2156
|
-
onClear = "
|
|
2193
|
+
onClear = "_A_Memory_onClear",
|
|
2157
2194
|
/**
|
|
2158
2195
|
* Allows to extend has operation logic and behavior
|
|
2159
2196
|
*/
|
|
2160
|
-
onHas = "
|
|
2197
|
+
onHas = "_A_Memory_onHas"
|
|
2161
2198
|
}
|
|
2162
2199
|
|
|
2163
2200
|
declare class A_MemoryContext<_MemoryType extends Record<string, any> = Record<string, any>, _SerializedType extends A_TYPES__Fragment_Serialized = A_TYPES__Fragment_Serialized> extends A_Fragment {
|
|
@@ -2385,4 +2422,4 @@ declare class A_StateMachineError extends A_Error {
|
|
|
2385
2422
|
static readonly TransitionError = "A-StateMachine Transition Error";
|
|
2386
2423
|
}
|
|
2387
2424
|
|
|
2388
|
-
export { A_CONSTANTS__CONFIG_ENV_VARIABLES, A_CONSTANTS__CONFIG_ENV_VARIABLES_ARRAY, A_Channel, A_ChannelError, A_ChannelFeatures, A_ChannelRequest, A_ChannelRequestStatuses, A_Command, A_CommandError,
|
|
2425
|
+
export { A_CONSTANTS__CONFIG_ENV_VARIABLES, A_CONSTANTS__CONFIG_ENV_VARIABLES_ARRAY, A_Channel, A_ChannelError, A_ChannelFeatures, A_ChannelRequest, A_ChannelRequestStatuses, A_Command, A_CommandError, A_CommandEvent, type A_CommandEvents, A_CommandFeatures, A_CommandTransitions, type A_Command_ExecutionContext, A_Command_Status, A_Config, A_ConfigError, A_ConfigLoader, A_Deferred, A_ExecutionContext, A_LOGGER_ANSI, A_LOGGER_COLORS, A_LOGGER_DEFAULT_LEVEL, A_LOGGER_DEFAULT_SCOPE_LENGTH, A_LOGGER_ENV_KEYS, A_LOGGER_FORMAT, A_LOGGER_SAFE_RANDOM_COLORS, A_LOGGER_TIME_FORMAT, A_Logger, A_LoggerEnvVariables, A_LoggerEnvVariablesArray, type A_LoggerEnvVariablesType, type A_LoggerLevel, A_Manifest, A_ManifestChecker, A_ManifestError, A_Memory, A_MemoryContext, type A_MemoryContextMeta, A_MemoryError, A_MemoryFeatures, type A_MemoryOperationContext, type A_MemoryOperationContextMeta, type A_MemoryOperations, type A_Memory_Storage, A_OperationContext, type A_Operation_Serialized, type A_Operation_Storage, A_Polyfill, A_Schedule, A_ScheduleObject, A_StateMachine, A_StateMachineError, A_StateMachineFeatures, A_StateMachineTransition, type A_StateMachineTransitionParams, type A_StateMachineTransitionStorage, type A_TYPES__Command_Constructor, type A_TYPES__Command_Init, type A_TYPES__Command_Listener, type A_TYPES__Command_Serialized, type A_TYPES__ConfigContainerConstructor, type A_TYPES__ConfigENVVariables, A_TYPES__ConfigFeature, type A_UTILS_TYPES__ManifestQuery, type A_UTILS_TYPES__ManifestRule, type A_UTILS_TYPES__Manifest_AllowedComponents, type A_UTILS_TYPES__Manifest_ComponentLevelConfig, type A_UTILS_TYPES__Manifest_Init, type A_UTILS_TYPES__Manifest_MethodLevelConfig, type A_UTILS_TYPES__Manifest_Rules, type A_UTILS_TYPES__ScheduleObjectCallback, type A_UTILS_TYPES__ScheduleObjectConfig, ConfigReader, ENVConfigReader, FileConfigReader, type IbufferInterface, type IcryptoInterface, type Ifspolyfill, type IhttpInterface, type IhttpsInterface, type IpathInterface, type IprocessInterface, type IurlInterface };
|