@adaas/a-utils 0.1.21 → 0.1.23
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 +5 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +136 -54
- package/dist/index.d.ts +136 -54
- package/dist/index.mjs +5 -5
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
- package/src/index.ts +6 -0
- 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 +33 -16
- package/src/lib/A-Command/A-Command.types.ts +21 -13
- package/src/lib/A-Config/A-Config.context.ts +38 -59
- package/src/lib/A-Config/components/ConfigReader.component.ts +17 -15
- package/src/lib/A-Execution/A-Execution.context.ts +67 -0
- package/src/lib/A-Execution/A-Execution.types.ts +0 -0
- package/src/lib/A-Memory/A-Memory.component.ts +1 -1
- package/src/lib/A-Memory/A-Memory.constants.ts +10 -10
- package/src/lib/A-Memory/A-Memory.context.ts +18 -9
- package/src/lib/A-Memory/A-Memory.types.ts +12 -1
- package/src/lib/A-Operation/A-Operation.context.ts +3 -2
- package/src/lib/A-StateMachine/A-StateMachine.constants.ts +4 -4
- package/tests/A-Command.test.ts +6 -6
- package/tests/A-Config.test.ts +5 -11
- package/tests/A-Manifest.test.ts +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A_Error, A_TYPES__Error_Serialized, A_Fragment, A_Component, A_TYPES__Entity_Serialized, A_TYPES__ConceptENVVariables, A_TYPES__Fragment_Constructor, A_Scope, A_Entity, A_Container, A_Feature, A_TYPES__Component_Constructor, A_TYPES__Entity_Constructor, A_TYPES__Container_Constructor
|
|
1
|
+
import { A_Error, A_TYPES__Error_Serialized, A_Fragment, A_Meta, A_TYPES__Fragment_Serialized, A_Component, A_TYPES__Entity_Serialized, A_TYPES__ConceptENVVariables, A_TYPES__Fragment_Constructor, A_CONSTANTS__DEFAULT_ENV_VARIABLES_ARRAY, A_Scope, A_Entity, A_Container, A_Feature, A_TYPES__Component_Constructor, A_TYPES__Entity_Constructor, A_TYPES__Container_Constructor } from '@adaas/a-concept';
|
|
2
2
|
|
|
3
3
|
type A_Operation_Storage<_Result_type extends any = any, _ParamsType extends Record<string, any> = Record<string, any>> = {
|
|
4
4
|
/**
|
|
@@ -37,7 +37,21 @@ type A_Operation_Serialized<_Result_type extends any = any, _ParamsType extends
|
|
|
37
37
|
error?: A_TYPES__Error_Serialized;
|
|
38
38
|
};
|
|
39
39
|
|
|
40
|
-
declare class
|
|
40
|
+
declare class A_ExecutionContext<_MetaType extends Record<string, any> = Record<string, any>, _SerializedType extends Record<string, any> = Record<string, any>> extends A_Fragment {
|
|
41
|
+
protected _meta: A_Meta<_MetaType, _SerializedType>;
|
|
42
|
+
constructor(name: string, defaults?: Partial<_MetaType>);
|
|
43
|
+
[Symbol.iterator](): Iterator<[keyof _MetaType, _MetaType[keyof _MetaType]]>;
|
|
44
|
+
get meta(): A_Meta<_MetaType>;
|
|
45
|
+
get(key: keyof _MetaType): _MetaType[keyof _MetaType] | undefined;
|
|
46
|
+
set(key: keyof _MetaType, value: _MetaType[keyof _MetaType]): void;
|
|
47
|
+
has(key: keyof _MetaType): boolean;
|
|
48
|
+
drop(key: keyof _MetaType): void;
|
|
49
|
+
clear(): void;
|
|
50
|
+
toRaw(): _SerializedType;
|
|
51
|
+
toJSON(): A_TYPES__Fragment_Serialized;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
declare class A_OperationContext<_AllowedOperations extends string = string, _ParamsType extends Record<string, any> = Record<string, any>, _ResultType = any, _StorageType extends A_Operation_Storage<_ResultType, _ParamsType> = A_Operation_Storage<_ResultType, _ParamsType>> extends A_ExecutionContext<_StorageType, A_Operation_Serialized<_ResultType, _ParamsType>> {
|
|
41
55
|
constructor(operation: _AllowedOperations, params?: _ParamsType);
|
|
42
56
|
get name(): _AllowedOperations;
|
|
43
57
|
get result(): _ResultType | undefined;
|
|
@@ -52,53 +66,53 @@ declare enum A_ChannelFeatures {
|
|
|
52
66
|
/**
|
|
53
67
|
* Allows to extend timeout logic and behavior
|
|
54
68
|
*/
|
|
55
|
-
onTimeout = "
|
|
69
|
+
onTimeout = "_A_Channel_onTimeout",
|
|
56
70
|
/**
|
|
57
71
|
* Allows to extend retry logic and behavior
|
|
58
72
|
*/
|
|
59
|
-
onRetry = "
|
|
73
|
+
onRetry = "_A_Channel_onRetry",
|
|
60
74
|
/**
|
|
61
75
|
* Allows to extend circuit breaker logic and behavior
|
|
62
76
|
*/
|
|
63
|
-
onCircuitBreakerOpen = "
|
|
77
|
+
onCircuitBreakerOpen = "_A_Channel_onCircuitBreakerOpen",
|
|
64
78
|
/**
|
|
65
79
|
* Allows to extend cache logic and behavior
|
|
66
80
|
*/
|
|
67
|
-
onCache = "
|
|
81
|
+
onCache = "_A_Channel_onCache",
|
|
68
82
|
/**
|
|
69
83
|
* Allows to extend connection logic and behavior
|
|
70
84
|
*/
|
|
71
|
-
onConnect = "
|
|
85
|
+
onConnect = "_A_Channel_onConnect",
|
|
72
86
|
/**
|
|
73
87
|
* Allows to extend disconnection logic and behavior
|
|
74
88
|
*/
|
|
75
|
-
onDisconnect = "
|
|
89
|
+
onDisconnect = "_A_Channel_onDisconnect",
|
|
76
90
|
/**
|
|
77
91
|
* Allows to extend request preparation logic and behavior
|
|
78
92
|
*/
|
|
79
|
-
onBeforeRequest = "
|
|
93
|
+
onBeforeRequest = "_A_Channel_onBeforeRequest",
|
|
80
94
|
/**
|
|
81
95
|
* Allows to extend request sending logic and behavior
|
|
82
96
|
*/
|
|
83
|
-
onRequest = "
|
|
97
|
+
onRequest = "_A_Channel_onRequest",
|
|
84
98
|
/**
|
|
85
99
|
* Allows to extend request post-processing logic and behavior
|
|
86
100
|
*/
|
|
87
|
-
onAfterRequest = "
|
|
101
|
+
onAfterRequest = "_A_Channel_onAfterRequest",
|
|
88
102
|
/**
|
|
89
103
|
* Allows to extend error handling logic and behavior
|
|
90
104
|
*
|
|
91
105
|
* [!] The same approach uses for ALL errors within the channel
|
|
92
106
|
*/
|
|
93
|
-
onError = "
|
|
107
|
+
onError = "_A_Channel_onError",
|
|
94
108
|
/**
|
|
95
109
|
* Allows to extend send logic and behavior
|
|
96
110
|
*/
|
|
97
|
-
onSend = "
|
|
111
|
+
onSend = "_A_Channel_onSend",
|
|
98
112
|
/**
|
|
99
113
|
* Allows to extend consume logic and behavior
|
|
100
114
|
*/
|
|
101
|
-
onConsume = "
|
|
115
|
+
onConsume = "_A_Channel_onConsume"
|
|
102
116
|
}
|
|
103
117
|
declare enum A_ChannelRequestStatuses {
|
|
104
118
|
/**
|
|
@@ -558,6 +572,43 @@ declare enum A_CommandTransitions {
|
|
|
558
572
|
* to inject custom logic into command execution.
|
|
559
573
|
*/
|
|
560
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 {
|
|
561
612
|
/**
|
|
562
613
|
* Triggered during command initialization phase
|
|
563
614
|
* Use to set up execution environment, validate parameters, or prepare resources
|
|
@@ -598,7 +649,7 @@ declare enum A_CommandFeatures {
|
|
|
598
649
|
* Type alias for command lifecycle event names
|
|
599
650
|
* Represents all available events that can be listened to on a command instance
|
|
600
651
|
*/
|
|
601
|
-
type
|
|
652
|
+
type A_CommandEvents = keyof typeof A_CommandEvent;
|
|
602
653
|
|
|
603
654
|
/**
|
|
604
655
|
* Command Constructor Type
|
|
@@ -705,25 +756,29 @@ type A_TYPES__Command_Serialized<ParamsType extends Record<string, any> = Record
|
|
|
705
756
|
* command.on('onExecute', listener);
|
|
706
757
|
* ```
|
|
707
758
|
*/
|
|
708
|
-
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;
|
|
760
|
+
type A_Command_ExecutionContext<InvokeType extends A_TYPES__Command_Init = A_TYPES__Command_Init, ResultType extends Record<string, any> = Record<string, any>> = {
|
|
761
|
+
result: ResultType;
|
|
762
|
+
params: InvokeType;
|
|
763
|
+
};
|
|
709
764
|
|
|
710
765
|
declare enum A_StateMachineFeatures {
|
|
711
766
|
/**
|
|
712
767
|
* Allows to extend error handling logic and behavior
|
|
713
768
|
*/
|
|
714
|
-
onError = "
|
|
769
|
+
onError = "_A_StateMachine_onError",
|
|
715
770
|
/**
|
|
716
771
|
* Allows to extend initialization logic and behavior
|
|
717
772
|
*/
|
|
718
|
-
onInitialize = "
|
|
773
|
+
onInitialize = "_A_StateMachine_onInitialize",
|
|
719
774
|
/**
|
|
720
775
|
* Allows to extend transition validation logic and behavior
|
|
721
776
|
*/
|
|
722
|
-
onBeforeTransition = "
|
|
777
|
+
onBeforeTransition = "_A_StateMachine_onBeforeTransition",
|
|
723
778
|
/**
|
|
724
779
|
* Allows to extend post-transition logic and behavior
|
|
725
780
|
*/
|
|
726
|
-
onAfterTransition = "
|
|
781
|
+
onAfterTransition = "_A_StateMachine_onAfterTransition"
|
|
727
782
|
}
|
|
728
783
|
|
|
729
784
|
/**
|
|
@@ -921,20 +976,28 @@ type A_TYPES__ConfigContainerConstructor<T extends Array<string | A_TYPES__Conce
|
|
|
921
976
|
};
|
|
922
977
|
} & A_TYPES__Fragment_Constructor;
|
|
923
978
|
|
|
924
|
-
declare
|
|
979
|
+
declare const A_CONSTANTS__CONFIG_ENV_VARIABLES: {};
|
|
980
|
+
type A_TYPES__ConfigENVVariables = (typeof A_CONSTANTS__CONFIG_ENV_VARIABLES)[keyof typeof A_CONSTANTS__CONFIG_ENV_VARIABLES][];
|
|
981
|
+
declare const A_CONSTANTS__CONFIG_ENV_VARIABLES_ARRAY: readonly [];
|
|
982
|
+
|
|
983
|
+
declare class A_Config<T extends Array<string | A_TYPES__ConceptENVVariables[number]> = any[]> extends A_ExecutionContext<{
|
|
925
984
|
[key in T[number]]: any;
|
|
985
|
+
} & {
|
|
986
|
+
[key in typeof A_CONSTANTS__DEFAULT_ENV_VARIABLES_ARRAY[number]]: any;
|
|
987
|
+
} & {
|
|
988
|
+
[key in typeof A_CONSTANTS__CONFIG_ENV_VARIABLES_ARRAY[number]]: any;
|
|
926
989
|
}> {
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
CONFIG_PROPERTIES: T;
|
|
990
|
+
protected _strict: boolean;
|
|
991
|
+
protected _configProperties: T;
|
|
930
992
|
protected DEFAULT_ALLOWED_TO_READ_PROPERTIES: ("A_CONCEPT_NAME" | "A_CONCEPT_ROOT_SCOPE" | "A_CONCEPT_ENVIRONMENT" | "A_CONCEPT_ROOT_FOLDER" | "A_ERROR_DEFAULT_DESCRIPTION")[];
|
|
931
993
|
constructor(config: Partial<A_TYPES__ConfigContainerConstructor<T>>);
|
|
994
|
+
get strict(): boolean;
|
|
932
995
|
/**
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
996
|
+
* This method is used to get the configuration property by name
|
|
997
|
+
*
|
|
998
|
+
* @param property
|
|
999
|
+
* @returns
|
|
1000
|
+
*/
|
|
938
1001
|
get<K extends T[number]>(property: K | typeof this.DEFAULT_ALLOWED_TO_READ_PROPERTIES[number]): {
|
|
939
1002
|
[key in T[number]]: any;
|
|
940
1003
|
}[K] | undefined;
|
|
@@ -1353,7 +1416,7 @@ declare class A_StateMachineTransition<_ParamsType = any, _ResultType = any> ext
|
|
|
1353
1416
|
* console.log('Status:', command.status);
|
|
1354
1417
|
* ```
|
|
1355
1418
|
*/
|
|
1356
|
-
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>> {
|
|
1357
1420
|
/**
|
|
1358
1421
|
* Static command identifier derived from the class name
|
|
1359
1422
|
* Used for command registration and serialization
|
|
@@ -1372,7 +1435,7 @@ declare class A_Command<InvokeType extends A_TYPES__Command_Init = A_TYPES__Comm
|
|
|
1372
1435
|
/** Current lifecycle status of the command */
|
|
1373
1436
|
protected _status: A_Command_Status;
|
|
1374
1437
|
/** Map of event listeners organized by event name */
|
|
1375
|
-
protected _listeners: Map<LifecycleEvents |
|
|
1438
|
+
protected _listeners: Map<LifecycleEvents | keyof typeof A_CommandEvent, Set<A_TYPES__Command_Listener<InvokeType, ResultType, LifecycleEvents>>>;
|
|
1376
1439
|
/** Timestamp when command execution started */
|
|
1377
1440
|
protected _startTime?: Date;
|
|
1378
1441
|
/** Timestamp when command execution ended */
|
|
@@ -1402,6 +1465,10 @@ declare class A_Command<InvokeType extends A_TYPES__Command_Init = A_TYPES__Comm
|
|
|
1402
1465
|
* command was registered.
|
|
1403
1466
|
*/
|
|
1404
1467
|
get scope(): A_Scope;
|
|
1468
|
+
/**
|
|
1469
|
+
* Execution context associated with the command
|
|
1470
|
+
*/
|
|
1471
|
+
get context(): A_ExecutionContext<A_Command_ExecutionContext<InvokeType, ResultType>>;
|
|
1405
1472
|
/**
|
|
1406
1473
|
* Unique command type identifier
|
|
1407
1474
|
*
|
|
@@ -1504,7 +1571,7 @@ declare class A_Command<InvokeType extends A_TYPES__Command_Init = A_TYPES__Comm
|
|
|
1504
1571
|
protected [A_CommandFeatures.onExecute](...args: any[]): Promise<void>;
|
|
1505
1572
|
protected [A_CommandFeatures.onAfterExecute](...args: any[]): Promise<void>;
|
|
1506
1573
|
protected [A_CommandFeatures.onComplete](stateMachine: A_StateMachine, ...args: any[]): Promise<void>;
|
|
1507
|
-
protected [A_CommandFeatures.onFail](stateMachine: A_StateMachine, operation:
|
|
1574
|
+
protected [A_CommandFeatures.onFail](stateMachine: A_StateMachine, operation: A_ExecutionContext<A_Command_ExecutionContext<InvokeType, ResultType>>, ...args: any[]): Promise<void>;
|
|
1508
1575
|
/**
|
|
1509
1576
|
* Initializes the command before execution.
|
|
1510
1577
|
*/
|
|
@@ -1515,6 +1582,16 @@ declare class A_Command<InvokeType extends A_TYPES__Command_Init = A_TYPES__Comm
|
|
|
1515
1582
|
execute(): Promise<any>;
|
|
1516
1583
|
/**
|
|
1517
1584
|
* Marks the command as completed
|
|
1585
|
+
*
|
|
1586
|
+
*
|
|
1587
|
+
* Calling This method will set the command status to COMPLETED, record the end time,
|
|
1588
|
+
* store the result, emit the onComplete event, and destroy the execution scope.
|
|
1589
|
+
*
|
|
1590
|
+
* [!] After Calling this method, the command is considered fully processed And further processing will be INTERRUPTED.
|
|
1591
|
+
* [!] If the command is already processed (COMPLETED or FAILED), this method does nothing.
|
|
1592
|
+
* [!] This method can be called with optional result data to store with the command.
|
|
1593
|
+
*
|
|
1594
|
+
* @param result - Optional result data to store with the command
|
|
1518
1595
|
*/
|
|
1519
1596
|
complete(result?: ResultType): Promise<void>;
|
|
1520
1597
|
/**
|
|
@@ -1527,20 +1604,20 @@ declare class A_Command<InvokeType extends A_TYPES__Command_Init = A_TYPES__Comm
|
|
|
1527
1604
|
* @param event
|
|
1528
1605
|
* @param listener
|
|
1529
1606
|
*/
|
|
1530
|
-
on(event: LifecycleEvents |
|
|
1607
|
+
on(event: LifecycleEvents | A_CommandEvent, listener: A_TYPES__Command_Listener<InvokeType, ResultType, LifecycleEvents>): void;
|
|
1531
1608
|
/**
|
|
1532
1609
|
* Removes an event listener for a specific event
|
|
1533
1610
|
*
|
|
1534
1611
|
* @param event
|
|
1535
1612
|
* @param listener
|
|
1536
1613
|
*/
|
|
1537
|
-
off(event: LifecycleEvents |
|
|
1614
|
+
off(event: LifecycleEvents | A_CommandEvent, listener: A_TYPES__Command_Listener<InvokeType, ResultType, LifecycleEvents>): void;
|
|
1538
1615
|
/**
|
|
1539
1616
|
* Emits an event to all registered listeners
|
|
1540
1617
|
*
|
|
1541
1618
|
* @param event
|
|
1542
1619
|
*/
|
|
1543
|
-
emit(event: LifecycleEvents |
|
|
1620
|
+
emit(event: LifecycleEvents | keyof typeof A_CommandEvent): void;
|
|
1544
1621
|
/**
|
|
1545
1622
|
* Allows to create a Command instance from new data
|
|
1546
1623
|
*
|
|
@@ -1831,8 +1908,9 @@ declare class A_ConfigError extends A_Error {
|
|
|
1831
1908
|
*/
|
|
1832
1909
|
declare class ConfigReader extends A_Component {
|
|
1833
1910
|
protected polyfill: A_Polyfill;
|
|
1911
|
+
protected DEFAULT_ALLOWED_TO_READ_PROPERTIES: ("A_CONCEPT_NAME" | "A_CONCEPT_ROOT_SCOPE" | "A_CONCEPT_ENVIRONMENT" | "A_CONCEPT_ROOT_FOLDER" | "A_ERROR_DEFAULT_DESCRIPTION")[];
|
|
1834
1912
|
constructor(polyfill: A_Polyfill);
|
|
1835
|
-
attachContext(container: A_Container,
|
|
1913
|
+
attachContext(container: A_Container, context: A_Scope, config?: A_Config<any>): Promise<void>;
|
|
1836
1914
|
initialize(config: A_Config): Promise<void>;
|
|
1837
1915
|
/**
|
|
1838
1916
|
* Get the configuration property by Name
|
|
@@ -1876,10 +1954,6 @@ declare class FileConfigReader extends ConfigReader {
|
|
|
1876
1954
|
read<T extends string>(variables?: Array<T>): Promise<Record<T, any>>;
|
|
1877
1955
|
}
|
|
1878
1956
|
|
|
1879
|
-
declare const A_CONSTANTS__CONFIG_ENV_VARIABLES: {};
|
|
1880
|
-
type A_TYPES__ConfigENVVariables = (typeof A_CONSTANTS__CONFIG_ENV_VARIABLES)[keyof typeof A_CONSTANTS__CONFIG_ENV_VARIABLES][];
|
|
1881
|
-
declare const A_CONSTANTS__CONFIG_ENV_VARIABLES_ARRAY: readonly [];
|
|
1882
|
-
|
|
1883
1957
|
type A_LoggerLevel = 'debug' | 'info' | 'warn' | 'error' | 'all';
|
|
1884
1958
|
|
|
1885
1959
|
/**
|
|
@@ -2084,50 +2158,52 @@ declare enum A_MemoryFeatures {
|
|
|
2084
2158
|
/**
|
|
2085
2159
|
* Allows to extend initialization logic and behavior
|
|
2086
2160
|
*/
|
|
2087
|
-
onInit = "
|
|
2161
|
+
onInit = "_A_Memory_onInit",
|
|
2088
2162
|
/**
|
|
2089
2163
|
* Allows to extend destruction logic and behavior
|
|
2090
2164
|
*/
|
|
2091
|
-
onDestroy = "
|
|
2165
|
+
onDestroy = "_A_Memory_onDestroy",
|
|
2092
2166
|
/**
|
|
2093
2167
|
* Allows to extend expiration logic and behavior
|
|
2094
2168
|
*/
|
|
2095
|
-
onExpire = "
|
|
2169
|
+
onExpire = "_A_Memory_onExpire",
|
|
2096
2170
|
/**
|
|
2097
2171
|
* Allows to extend error handling logic and behavior
|
|
2098
2172
|
*/
|
|
2099
|
-
onError = "
|
|
2173
|
+
onError = "_A_Memory_onError",
|
|
2100
2174
|
/**
|
|
2101
2175
|
* Allows to extend serialization logic and behavior
|
|
2102
2176
|
*/
|
|
2103
|
-
onSerialize = "
|
|
2177
|
+
onSerialize = "_A_Memory_onSerialize",
|
|
2104
2178
|
/**
|
|
2105
2179
|
* Allows to extend set operation logic and behavior
|
|
2106
2180
|
*/
|
|
2107
|
-
onSet = "
|
|
2181
|
+
onSet = "_A_Memory_onSet",
|
|
2108
2182
|
/**
|
|
2109
2183
|
* Allows to extend get operation logic and behavior
|
|
2110
2184
|
*/
|
|
2111
|
-
onGet = "
|
|
2185
|
+
onGet = "_A_Memory_onGet",
|
|
2112
2186
|
/**
|
|
2113
2187
|
* Allows to extend drop operation logic and behavior
|
|
2114
2188
|
*/
|
|
2115
|
-
onDrop = "
|
|
2189
|
+
onDrop = "_A_Memory_onDrop",
|
|
2116
2190
|
/**
|
|
2117
2191
|
* Allows to extend clear operation logic and behavior
|
|
2118
2192
|
*/
|
|
2119
|
-
onClear = "
|
|
2193
|
+
onClear = "_A_Memory_onClear",
|
|
2120
2194
|
/**
|
|
2121
2195
|
* Allows to extend has operation logic and behavior
|
|
2122
2196
|
*/
|
|
2123
|
-
onHas = "
|
|
2197
|
+
onHas = "_A_Memory_onHas"
|
|
2124
2198
|
}
|
|
2125
2199
|
|
|
2126
|
-
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
|
|
2127
|
-
|
|
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 {
|
|
2201
|
+
protected _storage: Map<keyof _MemoryType, _MemoryType[keyof _MemoryType]>;
|
|
2128
2202
|
set<K extends keyof _MemoryType>(param: K, value: _MemoryType[K]): void;
|
|
2129
|
-
get<K extends keyof A_Error>(param: 'error'): A_Error | undefined;
|
|
2130
2203
|
get<K extends keyof _MemoryType>(param: K): _MemoryType[K] | undefined;
|
|
2204
|
+
delete<K extends keyof _MemoryType>(param: K): void;
|
|
2205
|
+
has<K extends keyof _MemoryType>(param: K): boolean;
|
|
2206
|
+
clear(): void;
|
|
2131
2207
|
}
|
|
2132
2208
|
|
|
2133
2209
|
type A_MemoryContextMeta<T extends Record<string, any> = Record<string, any>> = Omit<T, 'error'> & {
|
|
@@ -2141,6 +2217,12 @@ type A_MemoryOperationContext<T extends any = any> = A_OperationContext<A_Memory
|
|
|
2141
2217
|
key: string;
|
|
2142
2218
|
value?: any;
|
|
2143
2219
|
}, T>;
|
|
2220
|
+
type A_MemoryOperationContextMeta<T extends any = any, I extends any = any> = {
|
|
2221
|
+
result: T;
|
|
2222
|
+
operation: A_MemoryOperations;
|
|
2223
|
+
key: string;
|
|
2224
|
+
value?: I;
|
|
2225
|
+
};
|
|
2144
2226
|
|
|
2145
2227
|
declare class A_Memory<_StorageType extends Record<string, any> = Record<string, any>, _SerializedType extends Record<string, any> = Record<string, any>> extends A_Component {
|
|
2146
2228
|
protected _ready?: Promise<void>;
|
|
@@ -2340,4 +2422,4 @@ declare class A_StateMachineError extends A_Error {
|
|
|
2340
2422
|
static readonly TransitionError = "A-StateMachine Transition Error";
|
|
2341
2423
|
}
|
|
2342
2424
|
|
|
2343
|
-
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_CommandFeatures, A_CommandTransitions, type
|
|
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 };
|