@adaas/a-concept 0.3.3 → 0.3.5
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/browser/index.d.mts +37 -12
- package/dist/browser/index.mjs +2 -2
- package/dist/browser/index.mjs.map +1 -1
- package/dist/node/index.cjs +78 -26
- package/dist/node/index.cjs.map +1 -1
- package/dist/node/index.d.mts +37 -12
- package/dist/node/index.d.ts +37 -12
- package/dist/node/index.mjs +78 -26
- package/dist/node/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/lib/A-Abstraction/A-Abstraction-Extend.decorator.ts +1 -1
- package/src/lib/A-Component/A-Component.meta.ts +1 -1
- package/src/lib/A-Container/A-Container.meta.ts +1 -1
- package/src/lib/A-Context/A-Context.class.ts +14 -2
- package/src/lib/A-Entity/A-Entity.class.ts +10 -9
- package/src/lib/A-Entity/A-Entity.constants.ts +5 -5
- package/src/lib/A-Entity/A-Entity.meta.ts +1 -1
- package/src/lib/A-Entity/A-Entity.types.ts +2 -1
- package/src/lib/A-Scope/A-Scope.class.ts +8 -3
- package/src/lib/A-StepManager/A-StepManager.class.ts +59 -5
- package/tests/A-Feature.test.ts +76 -0
package/dist/node/index.d.mts
CHANGED
|
@@ -856,11 +856,11 @@ declare enum A_TYPES__EntityMetaKey {
|
|
|
856
856
|
ABSTRACTIONS = "a-component-abstractions",
|
|
857
857
|
INJECTIONS = "a-component-injections"
|
|
858
858
|
}
|
|
859
|
-
declare
|
|
860
|
-
SAVE
|
|
861
|
-
DESTROY
|
|
862
|
-
LOAD
|
|
863
|
-
}
|
|
859
|
+
declare const A_TYPES__EntityFeatures: {
|
|
860
|
+
readonly SAVE: "_A_Entity__Save";
|
|
861
|
+
readonly DESTROY: "_A_Entity__Destroy";
|
|
862
|
+
readonly LOAD: "_A_Entity__Load";
|
|
863
|
+
};
|
|
864
864
|
|
|
865
865
|
/**
|
|
866
866
|
* Entity interface
|
|
@@ -924,6 +924,7 @@ type A_TYPES__EntityMeta = {
|
|
|
924
924
|
[Key: string]: A_TYPES__A_InjectDecorator_Meta;
|
|
925
925
|
}>;
|
|
926
926
|
};
|
|
927
|
+
type A_TYPES__EntityFeatureNames = typeof A_TYPES__EntityFeatures[keyof typeof A_TYPES__EntityFeatures];
|
|
927
928
|
|
|
928
929
|
/**
|
|
929
930
|
* A_Entity is another abstraction that describes all major participants in the system business logic.
|
|
@@ -1082,15 +1083,15 @@ declare class A_Entity<_ConstructorType extends A_TYPES__Entity_Init = A_TYPES__
|
|
|
1082
1083
|
/**
|
|
1083
1084
|
* The default method that can be called and extended to load entity data.
|
|
1084
1085
|
*/
|
|
1085
|
-
load(scope?: A_Scope): Promise<
|
|
1086
|
+
load(scope?: A_Scope): Promise<void> | void;
|
|
1086
1087
|
/**
|
|
1087
1088
|
* The default method that can be called and extended to destroy entity data.
|
|
1088
1089
|
*/
|
|
1089
|
-
destroy(scope?: A_Scope): Promise<
|
|
1090
|
+
destroy(scope?: A_Scope): Promise<void> | void;
|
|
1090
1091
|
/**
|
|
1091
1092
|
* The default method that can be called and extended to save entity data.
|
|
1092
1093
|
*/
|
|
1093
|
-
save(scope?: A_Scope): Promise<
|
|
1094
|
+
save(scope?: A_Scope): Promise<void> | void;
|
|
1094
1095
|
/**
|
|
1095
1096
|
* Create a new entity from ASEID string or instance
|
|
1096
1097
|
* [!] Executed when the constructor is called with a string or ASEID instance that represents the ASEID
|
|
@@ -1146,7 +1147,7 @@ declare class A_Entity<_ConstructorType extends A_TYPES__Entity_Init = A_TYPES__
|
|
|
1146
1147
|
toString(): string;
|
|
1147
1148
|
}
|
|
1148
1149
|
|
|
1149
|
-
declare class A_EntityMeta extends A_Meta<
|
|
1150
|
+
declare class A_EntityMeta<T extends A_TYPES__EntityMeta = A_TYPES__EntityMeta> extends A_Meta<T> {
|
|
1150
1151
|
/**
|
|
1151
1152
|
* Returns all features defined in the Container
|
|
1152
1153
|
*
|
|
@@ -1782,10 +1783,29 @@ declare class A_StepsManager {
|
|
|
1782
1783
|
visited: Set<string>;
|
|
1783
1784
|
tempMark: Set<string>;
|
|
1784
1785
|
sortedEntities: string[];
|
|
1786
|
+
/**
|
|
1787
|
+
* Maps each step instance to a unique ID.
|
|
1788
|
+
* Duplicate steps (same dependency.name + handler) get indexed suffixes (e.g., #1, #2).
|
|
1789
|
+
*/
|
|
1790
|
+
private _uniqueIdMap;
|
|
1785
1791
|
private _isBuilt;
|
|
1786
1792
|
constructor(entities: Array<A_TYPES__FeatureDefineDecoratorTemplateItem>);
|
|
1787
1793
|
private prepareSteps;
|
|
1794
|
+
/**
|
|
1795
|
+
* Returns the base (non-unique) ID for a step: `dependency.name.handler`
|
|
1796
|
+
*/
|
|
1797
|
+
private baseID;
|
|
1798
|
+
/**
|
|
1799
|
+
* Returns the unique ID assigned to a specific step instance.
|
|
1800
|
+
* Falls back to baseID if not yet assigned.
|
|
1801
|
+
*/
|
|
1788
1802
|
private ID;
|
|
1803
|
+
/**
|
|
1804
|
+
* Assigns unique IDs to all steps.
|
|
1805
|
+
* Duplicate base IDs get an index suffix (#0, #1, ...).
|
|
1806
|
+
* Steps with unique base IDs keep their original ID (no suffix).
|
|
1807
|
+
*/
|
|
1808
|
+
private assignUniqueIds;
|
|
1789
1809
|
private buildGraph;
|
|
1790
1810
|
private matchEntities;
|
|
1791
1811
|
private visit;
|
|
@@ -2861,7 +2881,7 @@ declare class A_Container {
|
|
|
2861
2881
|
scope?: A_Scope): Promise<void>;
|
|
2862
2882
|
}
|
|
2863
2883
|
|
|
2864
|
-
declare class A_ContainerMeta extends A_Meta<
|
|
2884
|
+
declare class A_ContainerMeta<T extends A_TYPES__ContainerMeta = A_TYPES__ContainerMeta> extends A_Meta<T> {
|
|
2865
2885
|
/**
|
|
2866
2886
|
* Allows to get all the injections for a given handler
|
|
2867
2887
|
*
|
|
@@ -3729,6 +3749,11 @@ declare class A_Scope<_MetaItems extends Record<string, any> = any, _ComponentTy
|
|
|
3729
3749
|
* Provide an entity instance to deregister it in the scope
|
|
3730
3750
|
*/
|
|
3731
3751
|
entity: A_Entity): void;
|
|
3752
|
+
deregister<T extends A_TYPES__A_DependencyInjectable>(
|
|
3753
|
+
/**
|
|
3754
|
+
* Provide an entity instance to register it in the scope
|
|
3755
|
+
*/
|
|
3756
|
+
component: T): void;
|
|
3732
3757
|
/**
|
|
3733
3758
|
* This method is useful when you want to serialize the scope to JSON
|
|
3734
3759
|
*
|
|
@@ -4247,7 +4272,7 @@ declare class A_Context {
|
|
|
4247
4272
|
* Get meta for the specific component class by constructor.
|
|
4248
4273
|
*/
|
|
4249
4274
|
component: A_TYPES__Component_Constructor): T;
|
|
4250
|
-
static meta<T extends A_ComponentMeta
|
|
4275
|
+
static meta<T extends A_ComponentMeta<any>, S extends A_Component>(
|
|
4251
4276
|
/**
|
|
4252
4277
|
* Get meta for the specific component instance.
|
|
4253
4278
|
*/
|
|
@@ -5027,4 +5052,4 @@ declare const A_CONSTANTS__DEFAULT_ENV_VARIABLES: {
|
|
|
5027
5052
|
type A_TYPES__ConceptENVVariables = (typeof A_CONSTANTS__DEFAULT_ENV_VARIABLES)[keyof typeof A_CONSTANTS__DEFAULT_ENV_VARIABLES][];
|
|
5028
5053
|
declare const A_CONSTANTS__DEFAULT_ENV_VARIABLES_ARRAY: readonly ["A_CONCEPT_NAME", "A_CONCEPT_ROOT_SCOPE", "A_CONCEPT_ENVIRONMENT", "A_CONCEPT_RUNTIME_ENVIRONMENT", "A_CONCEPT_ROOT_FOLDER", "A_ERROR_DEFAULT_DESCRIPTION"];
|
|
5029
5054
|
|
|
5030
|
-
export { ASEID, A_Abstraction, A_AbstractionError, A_Abstraction_Extend, A_BasicTypeGuards, A_CONCEPT_ENV, A_CONSTANTS__DEFAULT_ENV_VARIABLES, A_CONSTANTS__DEFAULT_ENV_VARIABLES_ARRAY, A_CONSTANTS__ERROR_CODES, A_CONSTANTS__ERROR_DESCRIPTION, A_Caller, A_CallerError, A_CommonHelper, A_Component, A_ComponentMeta, A_Concept, A_ConceptMeta, A_Container, A_ContainerMeta, A_Context, A_ContextError, A_Dependency, A_DependencyError, A_Dependency_All, A_Dependency_Default, A_Dependency_Flat, A_Dependency_Load, A_Dependency_Parent, A_Dependency_Query, A_Dependency_Require, A_Entity, A_EntityError, A_EntityMeta, A_Error, A_Feature, A_FeatureError, A_Feature_Define, A_Feature_Extend, A_FormatterHelper, A_Fragment, type A_ID_TYPES__TimeId_Parts, A_IdentityHelper, A_Inject, A_InjectError, A_Meta, A_MetaDecorator, A_Scope, A_ScopeError, A_Stage, A_StageError, A_StepManagerError, A_StepsManager, type A_TYPES_ScopeDependentComponents, type A_TYPES_ScopeIndependentComponents, type A_TYPES_StageExecutionBehavior, type A_TYPES__ASEID_Constructor, type A_TYPES__ASEID_ConstructorConfig, type A_TYPES__ASEID_JSON, type A_TYPES__A_DependencyConstructor, type A_TYPES__A_DependencyInjectable, type A_TYPES__A_DependencyResolutionStrategy, type A_TYPES__A_DependencyResolutionType, type A_TYPES__A_Dependency_AllDecoratorReturn, type A_TYPES__A_Dependency_DefaultDecoratorReturn, type A_TYPES__A_Dependency_EntityInjectionPagination, type A_TYPES__A_Dependency_EntityInjectionQuery, type A_TYPES__A_Dependency_EntityResolutionConfig, type A_TYPES__A_Dependency_FlatDecoratorReturn, type A_TYPES__A_Dependency_LoadDecoratorReturn, type A_TYPES__A_Dependency_ParentDecoratorReturn, type A_TYPES__A_Dependency_QueryDecoratorReturn, type A_TYPES__A_Dependency_QueryTarget, type A_TYPES__A_Dependency_RequireDecoratorReturn, type A_TYPES__A_Dependency_Serialized, type A_TYPES__A_InjectDecoratorDescriptor, type A_TYPES__A_InjectDecoratorReturn, type A_TYPES__A_InjectDecorator_Meta, type A_TYPES__A_StageStep, type A_TYPES__A_StageStepProcessingExtraParams, A_TYPES__A_Stage_Status, type A_TYPES__AbstractionAvailableComponents, type A_TYPES__AbstractionDecoratorConfig, type A_TYPES__AbstractionDecoratorDescriptor, type A_TYPES__Abstraction_Constructor, type A_TYPES__Abstraction_Init, type A_TYPES__Abstraction_Serialized, type A_TYPES__CallerComponent, type A_TYPES__Caller_Constructor, type A_TYPES__Caller_Init, type A_TYPES__Caller_Serialized, type A_TYPES__ComponentMeta, type A_TYPES__ComponentMetaExtension, A_TYPES__ComponentMetaKey, type A_TYPES__Component_Constructor, type A_TYPES__Component_Init, type A_TYPES__Component_Serialized, type A_TYPES__ConceptAbstraction, type A_TYPES__ConceptAbstractionMeta, A_TYPES__ConceptAbstractions, type A_TYPES__ConceptENVVariables, A_TYPES__ConceptMetaKey, type A_TYPES__Concept_Constructor, type A_TYPES__Concept_Init, type A_TYPES__Concept_Serialized, type A_TYPES__ContainerMeta, type A_TYPES__ContainerMetaExtension, A_TYPES__ContainerMetaKey, type A_TYPES__Container_Constructor, type A_TYPES__Container_Init, type A_TYPES__Container_Serialized, type A_TYPES__ContextEnvironment, type A_TYPES__Ctor, type A_TYPES__DeepPartial, type A_TYPES__Dictionary, A_TYPES__EntityFeatures, type A_TYPES__EntityMeta, A_TYPES__EntityMetaKey, type A_TYPES__Entity_Constructor, type A_TYPES__Entity_Init, type A_TYPES__Entity_Serialized, type A_TYPES__Error_Constructor, type A_TYPES__Error_Init, type A_TYPES__Error_Serialized, type A_TYPES__ExtractNested, type A_TYPES__ExtractProperties, type A_TYPES__FeatureAvailableComponents, type A_TYPES__FeatureAvailableConstructors, type A_TYPES__FeatureDefineDecoratorConfig, type A_TYPES__FeatureDefineDecoratorDescriptor, type A_TYPES__FeatureDefineDecoratorMeta, type A_TYPES__FeatureDefineDecoratorTarget, type A_TYPES__FeatureDefineDecoratorTemplateItem, type A_TYPES__FeatureError_Init, type A_TYPES__FeatureExtendDecoratorConfig, type A_TYPES__FeatureExtendDecoratorDescriptor, type A_TYPES__FeatureExtendDecoratorMeta, type A_TYPES__FeatureExtendDecoratorScopeConfig, type A_TYPES__FeatureExtendDecoratorScopeItem, type A_TYPES__FeatureExtendDecoratorTarget, type A_TYPES__FeatureExtendableMeta, A_TYPES__FeatureState, type A_TYPES__Feature_Constructor, type A_TYPES__Feature_Init, type A_TYPES__Feature_InitWithComponent, type A_TYPES__Feature_InitWithTemplate, type A_TYPES__Feature_Serialized, type A_TYPES__Fragment_Constructor, type A_TYPES__Fragment_Init, type A_TYPES__Fragment_Serialized, type A_TYPES__IEntity, type A_TYPES__InjectableTargets, type A_TYPES__MetaLinkedComponentConstructors, type A_TYPES__MetaLinkedComponents, type A_TYPES__Meta_Constructor, type A_TYPES__NonObjectPaths, type A_TYPES__ObjectKeyEnum, type A_TYPES__Paths, type A_TYPES__PathsToObject, type A_TYPES__Required, type A_TYPES__ScopeConfig, type A_TYPES__ScopeLinkedComponents, type A_TYPES__ScopeLinkedConstructors, type A_TYPES__Scope_Constructor, type A_TYPES__Scope_Init, type A_TYPES__Scope_Serialized, type A_TYPES__Stage_Serialized, type A_TYPES__UnionToIntersection, A_TypeGuards };
|
|
5055
|
+
export { ASEID, A_Abstraction, A_AbstractionError, A_Abstraction_Extend, A_BasicTypeGuards, A_CONCEPT_ENV, A_CONSTANTS__DEFAULT_ENV_VARIABLES, A_CONSTANTS__DEFAULT_ENV_VARIABLES_ARRAY, A_CONSTANTS__ERROR_CODES, A_CONSTANTS__ERROR_DESCRIPTION, A_Caller, A_CallerError, A_CommonHelper, A_Component, A_ComponentMeta, A_Concept, A_ConceptMeta, A_Container, A_ContainerMeta, A_Context, A_ContextError, A_Dependency, A_DependencyError, A_Dependency_All, A_Dependency_Default, A_Dependency_Flat, A_Dependency_Load, A_Dependency_Parent, A_Dependency_Query, A_Dependency_Require, A_Entity, A_EntityError, A_EntityMeta, A_Error, A_Feature, A_FeatureError, A_Feature_Define, A_Feature_Extend, A_FormatterHelper, A_Fragment, type A_ID_TYPES__TimeId_Parts, A_IdentityHelper, A_Inject, A_InjectError, A_Meta, A_MetaDecorator, A_Scope, A_ScopeError, A_Stage, A_StageError, A_StepManagerError, A_StepsManager, type A_TYPES_ScopeDependentComponents, type A_TYPES_ScopeIndependentComponents, type A_TYPES_StageExecutionBehavior, type A_TYPES__ASEID_Constructor, type A_TYPES__ASEID_ConstructorConfig, type A_TYPES__ASEID_JSON, type A_TYPES__A_DependencyConstructor, type A_TYPES__A_DependencyInjectable, type A_TYPES__A_DependencyResolutionStrategy, type A_TYPES__A_DependencyResolutionType, type A_TYPES__A_Dependency_AllDecoratorReturn, type A_TYPES__A_Dependency_DefaultDecoratorReturn, type A_TYPES__A_Dependency_EntityInjectionPagination, type A_TYPES__A_Dependency_EntityInjectionQuery, type A_TYPES__A_Dependency_EntityResolutionConfig, type A_TYPES__A_Dependency_FlatDecoratorReturn, type A_TYPES__A_Dependency_LoadDecoratorReturn, type A_TYPES__A_Dependency_ParentDecoratorReturn, type A_TYPES__A_Dependency_QueryDecoratorReturn, type A_TYPES__A_Dependency_QueryTarget, type A_TYPES__A_Dependency_RequireDecoratorReturn, type A_TYPES__A_Dependency_Serialized, type A_TYPES__A_InjectDecoratorDescriptor, type A_TYPES__A_InjectDecoratorReturn, type A_TYPES__A_InjectDecorator_Meta, type A_TYPES__A_StageStep, type A_TYPES__A_StageStepProcessingExtraParams, A_TYPES__A_Stage_Status, type A_TYPES__AbstractionAvailableComponents, type A_TYPES__AbstractionDecoratorConfig, type A_TYPES__AbstractionDecoratorDescriptor, type A_TYPES__Abstraction_Constructor, type A_TYPES__Abstraction_Init, type A_TYPES__Abstraction_Serialized, type A_TYPES__CallerComponent, type A_TYPES__Caller_Constructor, type A_TYPES__Caller_Init, type A_TYPES__Caller_Serialized, type A_TYPES__ComponentMeta, type A_TYPES__ComponentMetaExtension, A_TYPES__ComponentMetaKey, type A_TYPES__Component_Constructor, type A_TYPES__Component_Init, type A_TYPES__Component_Serialized, type A_TYPES__ConceptAbstraction, type A_TYPES__ConceptAbstractionMeta, A_TYPES__ConceptAbstractions, type A_TYPES__ConceptENVVariables, A_TYPES__ConceptMetaKey, type A_TYPES__Concept_Constructor, type A_TYPES__Concept_Init, type A_TYPES__Concept_Serialized, type A_TYPES__ContainerMeta, type A_TYPES__ContainerMetaExtension, A_TYPES__ContainerMetaKey, type A_TYPES__Container_Constructor, type A_TYPES__Container_Init, type A_TYPES__Container_Serialized, type A_TYPES__ContextEnvironment, type A_TYPES__Ctor, type A_TYPES__DeepPartial, type A_TYPES__Dictionary, type A_TYPES__EntityFeatureNames, A_TYPES__EntityFeatures, type A_TYPES__EntityMeta, A_TYPES__EntityMetaKey, type A_TYPES__Entity_Constructor, type A_TYPES__Entity_Init, type A_TYPES__Entity_Serialized, type A_TYPES__Error_Constructor, type A_TYPES__Error_Init, type A_TYPES__Error_Serialized, type A_TYPES__ExtractNested, type A_TYPES__ExtractProperties, type A_TYPES__FeatureAvailableComponents, type A_TYPES__FeatureAvailableConstructors, type A_TYPES__FeatureDefineDecoratorConfig, type A_TYPES__FeatureDefineDecoratorDescriptor, type A_TYPES__FeatureDefineDecoratorMeta, type A_TYPES__FeatureDefineDecoratorTarget, type A_TYPES__FeatureDefineDecoratorTemplateItem, type A_TYPES__FeatureError_Init, type A_TYPES__FeatureExtendDecoratorConfig, type A_TYPES__FeatureExtendDecoratorDescriptor, type A_TYPES__FeatureExtendDecoratorMeta, type A_TYPES__FeatureExtendDecoratorScopeConfig, type A_TYPES__FeatureExtendDecoratorScopeItem, type A_TYPES__FeatureExtendDecoratorTarget, type A_TYPES__FeatureExtendableMeta, A_TYPES__FeatureState, type A_TYPES__Feature_Constructor, type A_TYPES__Feature_Init, type A_TYPES__Feature_InitWithComponent, type A_TYPES__Feature_InitWithTemplate, type A_TYPES__Feature_Serialized, type A_TYPES__Fragment_Constructor, type A_TYPES__Fragment_Init, type A_TYPES__Fragment_Serialized, type A_TYPES__IEntity, type A_TYPES__InjectableTargets, type A_TYPES__MetaLinkedComponentConstructors, type A_TYPES__MetaLinkedComponents, type A_TYPES__Meta_Constructor, type A_TYPES__NonObjectPaths, type A_TYPES__ObjectKeyEnum, type A_TYPES__Paths, type A_TYPES__PathsToObject, type A_TYPES__Required, type A_TYPES__ScopeConfig, type A_TYPES__ScopeLinkedComponents, type A_TYPES__ScopeLinkedConstructors, type A_TYPES__Scope_Constructor, type A_TYPES__Scope_Init, type A_TYPES__Scope_Serialized, type A_TYPES__Stage_Serialized, type A_TYPES__UnionToIntersection, A_TypeGuards };
|
package/dist/node/index.d.ts
CHANGED
|
@@ -856,11 +856,11 @@ declare enum A_TYPES__EntityMetaKey {
|
|
|
856
856
|
ABSTRACTIONS = "a-component-abstractions",
|
|
857
857
|
INJECTIONS = "a-component-injections"
|
|
858
858
|
}
|
|
859
|
-
declare
|
|
860
|
-
SAVE
|
|
861
|
-
DESTROY
|
|
862
|
-
LOAD
|
|
863
|
-
}
|
|
859
|
+
declare const A_TYPES__EntityFeatures: {
|
|
860
|
+
readonly SAVE: "_A_Entity__Save";
|
|
861
|
+
readonly DESTROY: "_A_Entity__Destroy";
|
|
862
|
+
readonly LOAD: "_A_Entity__Load";
|
|
863
|
+
};
|
|
864
864
|
|
|
865
865
|
/**
|
|
866
866
|
* Entity interface
|
|
@@ -924,6 +924,7 @@ type A_TYPES__EntityMeta = {
|
|
|
924
924
|
[Key: string]: A_TYPES__A_InjectDecorator_Meta;
|
|
925
925
|
}>;
|
|
926
926
|
};
|
|
927
|
+
type A_TYPES__EntityFeatureNames = typeof A_TYPES__EntityFeatures[keyof typeof A_TYPES__EntityFeatures];
|
|
927
928
|
|
|
928
929
|
/**
|
|
929
930
|
* A_Entity is another abstraction that describes all major participants in the system business logic.
|
|
@@ -1082,15 +1083,15 @@ declare class A_Entity<_ConstructorType extends A_TYPES__Entity_Init = A_TYPES__
|
|
|
1082
1083
|
/**
|
|
1083
1084
|
* The default method that can be called and extended to load entity data.
|
|
1084
1085
|
*/
|
|
1085
|
-
load(scope?: A_Scope): Promise<
|
|
1086
|
+
load(scope?: A_Scope): Promise<void> | void;
|
|
1086
1087
|
/**
|
|
1087
1088
|
* The default method that can be called and extended to destroy entity data.
|
|
1088
1089
|
*/
|
|
1089
|
-
destroy(scope?: A_Scope): Promise<
|
|
1090
|
+
destroy(scope?: A_Scope): Promise<void> | void;
|
|
1090
1091
|
/**
|
|
1091
1092
|
* The default method that can be called and extended to save entity data.
|
|
1092
1093
|
*/
|
|
1093
|
-
save(scope?: A_Scope): Promise<
|
|
1094
|
+
save(scope?: A_Scope): Promise<void> | void;
|
|
1094
1095
|
/**
|
|
1095
1096
|
* Create a new entity from ASEID string or instance
|
|
1096
1097
|
* [!] Executed when the constructor is called with a string or ASEID instance that represents the ASEID
|
|
@@ -1146,7 +1147,7 @@ declare class A_Entity<_ConstructorType extends A_TYPES__Entity_Init = A_TYPES__
|
|
|
1146
1147
|
toString(): string;
|
|
1147
1148
|
}
|
|
1148
1149
|
|
|
1149
|
-
declare class A_EntityMeta extends A_Meta<
|
|
1150
|
+
declare class A_EntityMeta<T extends A_TYPES__EntityMeta = A_TYPES__EntityMeta> extends A_Meta<T> {
|
|
1150
1151
|
/**
|
|
1151
1152
|
* Returns all features defined in the Container
|
|
1152
1153
|
*
|
|
@@ -1782,10 +1783,29 @@ declare class A_StepsManager {
|
|
|
1782
1783
|
visited: Set<string>;
|
|
1783
1784
|
tempMark: Set<string>;
|
|
1784
1785
|
sortedEntities: string[];
|
|
1786
|
+
/**
|
|
1787
|
+
* Maps each step instance to a unique ID.
|
|
1788
|
+
* Duplicate steps (same dependency.name + handler) get indexed suffixes (e.g., #1, #2).
|
|
1789
|
+
*/
|
|
1790
|
+
private _uniqueIdMap;
|
|
1785
1791
|
private _isBuilt;
|
|
1786
1792
|
constructor(entities: Array<A_TYPES__FeatureDefineDecoratorTemplateItem>);
|
|
1787
1793
|
private prepareSteps;
|
|
1794
|
+
/**
|
|
1795
|
+
* Returns the base (non-unique) ID for a step: `dependency.name.handler`
|
|
1796
|
+
*/
|
|
1797
|
+
private baseID;
|
|
1798
|
+
/**
|
|
1799
|
+
* Returns the unique ID assigned to a specific step instance.
|
|
1800
|
+
* Falls back to baseID if not yet assigned.
|
|
1801
|
+
*/
|
|
1788
1802
|
private ID;
|
|
1803
|
+
/**
|
|
1804
|
+
* Assigns unique IDs to all steps.
|
|
1805
|
+
* Duplicate base IDs get an index suffix (#0, #1, ...).
|
|
1806
|
+
* Steps with unique base IDs keep their original ID (no suffix).
|
|
1807
|
+
*/
|
|
1808
|
+
private assignUniqueIds;
|
|
1789
1809
|
private buildGraph;
|
|
1790
1810
|
private matchEntities;
|
|
1791
1811
|
private visit;
|
|
@@ -2861,7 +2881,7 @@ declare class A_Container {
|
|
|
2861
2881
|
scope?: A_Scope): Promise<void>;
|
|
2862
2882
|
}
|
|
2863
2883
|
|
|
2864
|
-
declare class A_ContainerMeta extends A_Meta<
|
|
2884
|
+
declare class A_ContainerMeta<T extends A_TYPES__ContainerMeta = A_TYPES__ContainerMeta> extends A_Meta<T> {
|
|
2865
2885
|
/**
|
|
2866
2886
|
* Allows to get all the injections for a given handler
|
|
2867
2887
|
*
|
|
@@ -3729,6 +3749,11 @@ declare class A_Scope<_MetaItems extends Record<string, any> = any, _ComponentTy
|
|
|
3729
3749
|
* Provide an entity instance to deregister it in the scope
|
|
3730
3750
|
*/
|
|
3731
3751
|
entity: A_Entity): void;
|
|
3752
|
+
deregister<T extends A_TYPES__A_DependencyInjectable>(
|
|
3753
|
+
/**
|
|
3754
|
+
* Provide an entity instance to register it in the scope
|
|
3755
|
+
*/
|
|
3756
|
+
component: T): void;
|
|
3732
3757
|
/**
|
|
3733
3758
|
* This method is useful when you want to serialize the scope to JSON
|
|
3734
3759
|
*
|
|
@@ -4247,7 +4272,7 @@ declare class A_Context {
|
|
|
4247
4272
|
* Get meta for the specific component class by constructor.
|
|
4248
4273
|
*/
|
|
4249
4274
|
component: A_TYPES__Component_Constructor): T;
|
|
4250
|
-
static meta<T extends A_ComponentMeta
|
|
4275
|
+
static meta<T extends A_ComponentMeta<any>, S extends A_Component>(
|
|
4251
4276
|
/**
|
|
4252
4277
|
* Get meta for the specific component instance.
|
|
4253
4278
|
*/
|
|
@@ -5027,4 +5052,4 @@ declare const A_CONSTANTS__DEFAULT_ENV_VARIABLES: {
|
|
|
5027
5052
|
type A_TYPES__ConceptENVVariables = (typeof A_CONSTANTS__DEFAULT_ENV_VARIABLES)[keyof typeof A_CONSTANTS__DEFAULT_ENV_VARIABLES][];
|
|
5028
5053
|
declare const A_CONSTANTS__DEFAULT_ENV_VARIABLES_ARRAY: readonly ["A_CONCEPT_NAME", "A_CONCEPT_ROOT_SCOPE", "A_CONCEPT_ENVIRONMENT", "A_CONCEPT_RUNTIME_ENVIRONMENT", "A_CONCEPT_ROOT_FOLDER", "A_ERROR_DEFAULT_DESCRIPTION"];
|
|
5029
5054
|
|
|
5030
|
-
export { ASEID, A_Abstraction, A_AbstractionError, A_Abstraction_Extend, A_BasicTypeGuards, A_CONCEPT_ENV, A_CONSTANTS__DEFAULT_ENV_VARIABLES, A_CONSTANTS__DEFAULT_ENV_VARIABLES_ARRAY, A_CONSTANTS__ERROR_CODES, A_CONSTANTS__ERROR_DESCRIPTION, A_Caller, A_CallerError, A_CommonHelper, A_Component, A_ComponentMeta, A_Concept, A_ConceptMeta, A_Container, A_ContainerMeta, A_Context, A_ContextError, A_Dependency, A_DependencyError, A_Dependency_All, A_Dependency_Default, A_Dependency_Flat, A_Dependency_Load, A_Dependency_Parent, A_Dependency_Query, A_Dependency_Require, A_Entity, A_EntityError, A_EntityMeta, A_Error, A_Feature, A_FeatureError, A_Feature_Define, A_Feature_Extend, A_FormatterHelper, A_Fragment, type A_ID_TYPES__TimeId_Parts, A_IdentityHelper, A_Inject, A_InjectError, A_Meta, A_MetaDecorator, A_Scope, A_ScopeError, A_Stage, A_StageError, A_StepManagerError, A_StepsManager, type A_TYPES_ScopeDependentComponents, type A_TYPES_ScopeIndependentComponents, type A_TYPES_StageExecutionBehavior, type A_TYPES__ASEID_Constructor, type A_TYPES__ASEID_ConstructorConfig, type A_TYPES__ASEID_JSON, type A_TYPES__A_DependencyConstructor, type A_TYPES__A_DependencyInjectable, type A_TYPES__A_DependencyResolutionStrategy, type A_TYPES__A_DependencyResolutionType, type A_TYPES__A_Dependency_AllDecoratorReturn, type A_TYPES__A_Dependency_DefaultDecoratorReturn, type A_TYPES__A_Dependency_EntityInjectionPagination, type A_TYPES__A_Dependency_EntityInjectionQuery, type A_TYPES__A_Dependency_EntityResolutionConfig, type A_TYPES__A_Dependency_FlatDecoratorReturn, type A_TYPES__A_Dependency_LoadDecoratorReturn, type A_TYPES__A_Dependency_ParentDecoratorReturn, type A_TYPES__A_Dependency_QueryDecoratorReturn, type A_TYPES__A_Dependency_QueryTarget, type A_TYPES__A_Dependency_RequireDecoratorReturn, type A_TYPES__A_Dependency_Serialized, type A_TYPES__A_InjectDecoratorDescriptor, type A_TYPES__A_InjectDecoratorReturn, type A_TYPES__A_InjectDecorator_Meta, type A_TYPES__A_StageStep, type A_TYPES__A_StageStepProcessingExtraParams, A_TYPES__A_Stage_Status, type A_TYPES__AbstractionAvailableComponents, type A_TYPES__AbstractionDecoratorConfig, type A_TYPES__AbstractionDecoratorDescriptor, type A_TYPES__Abstraction_Constructor, type A_TYPES__Abstraction_Init, type A_TYPES__Abstraction_Serialized, type A_TYPES__CallerComponent, type A_TYPES__Caller_Constructor, type A_TYPES__Caller_Init, type A_TYPES__Caller_Serialized, type A_TYPES__ComponentMeta, type A_TYPES__ComponentMetaExtension, A_TYPES__ComponentMetaKey, type A_TYPES__Component_Constructor, type A_TYPES__Component_Init, type A_TYPES__Component_Serialized, type A_TYPES__ConceptAbstraction, type A_TYPES__ConceptAbstractionMeta, A_TYPES__ConceptAbstractions, type A_TYPES__ConceptENVVariables, A_TYPES__ConceptMetaKey, type A_TYPES__Concept_Constructor, type A_TYPES__Concept_Init, type A_TYPES__Concept_Serialized, type A_TYPES__ContainerMeta, type A_TYPES__ContainerMetaExtension, A_TYPES__ContainerMetaKey, type A_TYPES__Container_Constructor, type A_TYPES__Container_Init, type A_TYPES__Container_Serialized, type A_TYPES__ContextEnvironment, type A_TYPES__Ctor, type A_TYPES__DeepPartial, type A_TYPES__Dictionary, A_TYPES__EntityFeatures, type A_TYPES__EntityMeta, A_TYPES__EntityMetaKey, type A_TYPES__Entity_Constructor, type A_TYPES__Entity_Init, type A_TYPES__Entity_Serialized, type A_TYPES__Error_Constructor, type A_TYPES__Error_Init, type A_TYPES__Error_Serialized, type A_TYPES__ExtractNested, type A_TYPES__ExtractProperties, type A_TYPES__FeatureAvailableComponents, type A_TYPES__FeatureAvailableConstructors, type A_TYPES__FeatureDefineDecoratorConfig, type A_TYPES__FeatureDefineDecoratorDescriptor, type A_TYPES__FeatureDefineDecoratorMeta, type A_TYPES__FeatureDefineDecoratorTarget, type A_TYPES__FeatureDefineDecoratorTemplateItem, type A_TYPES__FeatureError_Init, type A_TYPES__FeatureExtendDecoratorConfig, type A_TYPES__FeatureExtendDecoratorDescriptor, type A_TYPES__FeatureExtendDecoratorMeta, type A_TYPES__FeatureExtendDecoratorScopeConfig, type A_TYPES__FeatureExtendDecoratorScopeItem, type A_TYPES__FeatureExtendDecoratorTarget, type A_TYPES__FeatureExtendableMeta, A_TYPES__FeatureState, type A_TYPES__Feature_Constructor, type A_TYPES__Feature_Init, type A_TYPES__Feature_InitWithComponent, type A_TYPES__Feature_InitWithTemplate, type A_TYPES__Feature_Serialized, type A_TYPES__Fragment_Constructor, type A_TYPES__Fragment_Init, type A_TYPES__Fragment_Serialized, type A_TYPES__IEntity, type A_TYPES__InjectableTargets, type A_TYPES__MetaLinkedComponentConstructors, type A_TYPES__MetaLinkedComponents, type A_TYPES__Meta_Constructor, type A_TYPES__NonObjectPaths, type A_TYPES__ObjectKeyEnum, type A_TYPES__Paths, type A_TYPES__PathsToObject, type A_TYPES__Required, type A_TYPES__ScopeConfig, type A_TYPES__ScopeLinkedComponents, type A_TYPES__ScopeLinkedConstructors, type A_TYPES__Scope_Constructor, type A_TYPES__Scope_Init, type A_TYPES__Scope_Serialized, type A_TYPES__Stage_Serialized, type A_TYPES__UnionToIntersection, A_TypeGuards };
|
|
5055
|
+
export { ASEID, A_Abstraction, A_AbstractionError, A_Abstraction_Extend, A_BasicTypeGuards, A_CONCEPT_ENV, A_CONSTANTS__DEFAULT_ENV_VARIABLES, A_CONSTANTS__DEFAULT_ENV_VARIABLES_ARRAY, A_CONSTANTS__ERROR_CODES, A_CONSTANTS__ERROR_DESCRIPTION, A_Caller, A_CallerError, A_CommonHelper, A_Component, A_ComponentMeta, A_Concept, A_ConceptMeta, A_Container, A_ContainerMeta, A_Context, A_ContextError, A_Dependency, A_DependencyError, A_Dependency_All, A_Dependency_Default, A_Dependency_Flat, A_Dependency_Load, A_Dependency_Parent, A_Dependency_Query, A_Dependency_Require, A_Entity, A_EntityError, A_EntityMeta, A_Error, A_Feature, A_FeatureError, A_Feature_Define, A_Feature_Extend, A_FormatterHelper, A_Fragment, type A_ID_TYPES__TimeId_Parts, A_IdentityHelper, A_Inject, A_InjectError, A_Meta, A_MetaDecorator, A_Scope, A_ScopeError, A_Stage, A_StageError, A_StepManagerError, A_StepsManager, type A_TYPES_ScopeDependentComponents, type A_TYPES_ScopeIndependentComponents, type A_TYPES_StageExecutionBehavior, type A_TYPES__ASEID_Constructor, type A_TYPES__ASEID_ConstructorConfig, type A_TYPES__ASEID_JSON, type A_TYPES__A_DependencyConstructor, type A_TYPES__A_DependencyInjectable, type A_TYPES__A_DependencyResolutionStrategy, type A_TYPES__A_DependencyResolutionType, type A_TYPES__A_Dependency_AllDecoratorReturn, type A_TYPES__A_Dependency_DefaultDecoratorReturn, type A_TYPES__A_Dependency_EntityInjectionPagination, type A_TYPES__A_Dependency_EntityInjectionQuery, type A_TYPES__A_Dependency_EntityResolutionConfig, type A_TYPES__A_Dependency_FlatDecoratorReturn, type A_TYPES__A_Dependency_LoadDecoratorReturn, type A_TYPES__A_Dependency_ParentDecoratorReturn, type A_TYPES__A_Dependency_QueryDecoratorReturn, type A_TYPES__A_Dependency_QueryTarget, type A_TYPES__A_Dependency_RequireDecoratorReturn, type A_TYPES__A_Dependency_Serialized, type A_TYPES__A_InjectDecoratorDescriptor, type A_TYPES__A_InjectDecoratorReturn, type A_TYPES__A_InjectDecorator_Meta, type A_TYPES__A_StageStep, type A_TYPES__A_StageStepProcessingExtraParams, A_TYPES__A_Stage_Status, type A_TYPES__AbstractionAvailableComponents, type A_TYPES__AbstractionDecoratorConfig, type A_TYPES__AbstractionDecoratorDescriptor, type A_TYPES__Abstraction_Constructor, type A_TYPES__Abstraction_Init, type A_TYPES__Abstraction_Serialized, type A_TYPES__CallerComponent, type A_TYPES__Caller_Constructor, type A_TYPES__Caller_Init, type A_TYPES__Caller_Serialized, type A_TYPES__ComponentMeta, type A_TYPES__ComponentMetaExtension, A_TYPES__ComponentMetaKey, type A_TYPES__Component_Constructor, type A_TYPES__Component_Init, type A_TYPES__Component_Serialized, type A_TYPES__ConceptAbstraction, type A_TYPES__ConceptAbstractionMeta, A_TYPES__ConceptAbstractions, type A_TYPES__ConceptENVVariables, A_TYPES__ConceptMetaKey, type A_TYPES__Concept_Constructor, type A_TYPES__Concept_Init, type A_TYPES__Concept_Serialized, type A_TYPES__ContainerMeta, type A_TYPES__ContainerMetaExtension, A_TYPES__ContainerMetaKey, type A_TYPES__Container_Constructor, type A_TYPES__Container_Init, type A_TYPES__Container_Serialized, type A_TYPES__ContextEnvironment, type A_TYPES__Ctor, type A_TYPES__DeepPartial, type A_TYPES__Dictionary, type A_TYPES__EntityFeatureNames, A_TYPES__EntityFeatures, type A_TYPES__EntityMeta, A_TYPES__EntityMetaKey, type A_TYPES__Entity_Constructor, type A_TYPES__Entity_Init, type A_TYPES__Entity_Serialized, type A_TYPES__Error_Constructor, type A_TYPES__Error_Init, type A_TYPES__Error_Serialized, type A_TYPES__ExtractNested, type A_TYPES__ExtractProperties, type A_TYPES__FeatureAvailableComponents, type A_TYPES__FeatureAvailableConstructors, type A_TYPES__FeatureDefineDecoratorConfig, type A_TYPES__FeatureDefineDecoratorDescriptor, type A_TYPES__FeatureDefineDecoratorMeta, type A_TYPES__FeatureDefineDecoratorTarget, type A_TYPES__FeatureDefineDecoratorTemplateItem, type A_TYPES__FeatureError_Init, type A_TYPES__FeatureExtendDecoratorConfig, type A_TYPES__FeatureExtendDecoratorDescriptor, type A_TYPES__FeatureExtendDecoratorMeta, type A_TYPES__FeatureExtendDecoratorScopeConfig, type A_TYPES__FeatureExtendDecoratorScopeItem, type A_TYPES__FeatureExtendDecoratorTarget, type A_TYPES__FeatureExtendableMeta, A_TYPES__FeatureState, type A_TYPES__Feature_Constructor, type A_TYPES__Feature_Init, type A_TYPES__Feature_InitWithComponent, type A_TYPES__Feature_InitWithTemplate, type A_TYPES__Feature_Serialized, type A_TYPES__Fragment_Constructor, type A_TYPES__Fragment_Init, type A_TYPES__Fragment_Serialized, type A_TYPES__IEntity, type A_TYPES__InjectableTargets, type A_TYPES__MetaLinkedComponentConstructors, type A_TYPES__MetaLinkedComponents, type A_TYPES__Meta_Constructor, type A_TYPES__NonObjectPaths, type A_TYPES__ObjectKeyEnum, type A_TYPES__Paths, type A_TYPES__PathsToObject, type A_TYPES__Required, type A_TYPES__ScopeConfig, type A_TYPES__ScopeLinkedComponents, type A_TYPES__ScopeLinkedConstructors, type A_TYPES__Scope_Constructor, type A_TYPES__Scope_Init, type A_TYPES__Scope_Serialized, type A_TYPES__Stage_Serialized, type A_TYPES__UnionToIntersection, A_TypeGuards };
|
package/dist/node/index.mjs
CHANGED
|
@@ -962,6 +962,20 @@ var A_EntityError = class extends A_Error {
|
|
|
962
962
|
*/
|
|
963
963
|
A_EntityError.ValidationError = "A-Entity Validation Error";
|
|
964
964
|
|
|
965
|
+
// src/lib/A-Entity/A-Entity.constants.ts
|
|
966
|
+
var A_TYPES__EntityMetaKey = /* @__PURE__ */ ((A_TYPES__EntityMetaKey2) => {
|
|
967
|
+
A_TYPES__EntityMetaKey2["EXTENSIONS"] = "a-component-extensions";
|
|
968
|
+
A_TYPES__EntityMetaKey2["FEATURES"] = "a-component-features";
|
|
969
|
+
A_TYPES__EntityMetaKey2["ABSTRACTIONS"] = "a-component-abstractions";
|
|
970
|
+
A_TYPES__EntityMetaKey2["INJECTIONS"] = "a-component-injections";
|
|
971
|
+
return A_TYPES__EntityMetaKey2;
|
|
972
|
+
})(A_TYPES__EntityMetaKey || {});
|
|
973
|
+
var A_TYPES__EntityFeatures = {
|
|
974
|
+
SAVE: "_A_Entity__Save",
|
|
975
|
+
DESTROY: "_A_Entity__Destroy",
|
|
976
|
+
LOAD: "_A_Entity__Load"
|
|
977
|
+
};
|
|
978
|
+
|
|
965
979
|
// src/lib/A-Entity/A-Entity.class.ts
|
|
966
980
|
var A_Entity = class {
|
|
967
981
|
// ====================================================================
|
|
@@ -1117,20 +1131,20 @@ var A_Entity = class {
|
|
|
1117
1131
|
/**
|
|
1118
1132
|
* The default method that can be called and extended to load entity data.
|
|
1119
1133
|
*/
|
|
1120
|
-
|
|
1121
|
-
return this.call(
|
|
1134
|
+
load(scope) {
|
|
1135
|
+
return this.call(A_TYPES__EntityFeatures.LOAD, scope);
|
|
1122
1136
|
}
|
|
1123
1137
|
/**
|
|
1124
1138
|
* The default method that can be called and extended to destroy entity data.
|
|
1125
1139
|
*/
|
|
1126
|
-
|
|
1127
|
-
return this.call(
|
|
1140
|
+
destroy(scope) {
|
|
1141
|
+
return this.call(A_TYPES__EntityFeatures.DESTROY, scope);
|
|
1128
1142
|
}
|
|
1129
1143
|
/**
|
|
1130
1144
|
* The default method that can be called and extended to save entity data.
|
|
1131
1145
|
*/
|
|
1132
|
-
|
|
1133
|
-
return this.call(
|
|
1146
|
+
save(scope) {
|
|
1147
|
+
return this.call(A_TYPES__EntityFeatures.SAVE, scope);
|
|
1134
1148
|
}
|
|
1135
1149
|
// ====================================================================
|
|
1136
1150
|
// ================== Entity Serialization ============================
|
|
@@ -1429,21 +1443,6 @@ var A_Meta = class _A_Meta {
|
|
|
1429
1443
|
}
|
|
1430
1444
|
};
|
|
1431
1445
|
|
|
1432
|
-
// src/lib/A-Entity/A-Entity.constants.ts
|
|
1433
|
-
var A_TYPES__EntityMetaKey = /* @__PURE__ */ ((A_TYPES__EntityMetaKey2) => {
|
|
1434
|
-
A_TYPES__EntityMetaKey2["EXTENSIONS"] = "a-component-extensions";
|
|
1435
|
-
A_TYPES__EntityMetaKey2["FEATURES"] = "a-component-features";
|
|
1436
|
-
A_TYPES__EntityMetaKey2["ABSTRACTIONS"] = "a-component-abstractions";
|
|
1437
|
-
A_TYPES__EntityMetaKey2["INJECTIONS"] = "a-component-injections";
|
|
1438
|
-
return A_TYPES__EntityMetaKey2;
|
|
1439
|
-
})(A_TYPES__EntityMetaKey || {});
|
|
1440
|
-
var A_TYPES__EntityFeatures = /* @__PURE__ */ ((A_TYPES__EntityFeatures2) => {
|
|
1441
|
-
A_TYPES__EntityFeatures2["SAVE"] = "save";
|
|
1442
|
-
A_TYPES__EntityFeatures2["DESTROY"] = "destroy";
|
|
1443
|
-
A_TYPES__EntityFeatures2["LOAD"] = "load";
|
|
1444
|
-
return A_TYPES__EntityFeatures2;
|
|
1445
|
-
})(A_TYPES__EntityFeatures || {});
|
|
1446
|
-
|
|
1447
1446
|
// src/lib/A-Entity/A-Entity.meta.ts
|
|
1448
1447
|
var A_EntityMeta = class extends A_Meta {
|
|
1449
1448
|
/**
|
|
@@ -3054,12 +3053,18 @@ A_StepManagerError.CircularDependencyError = "A-StepManager Circular Dependency
|
|
|
3054
3053
|
// src/lib/A-StepManager/A-StepManager.class.ts
|
|
3055
3054
|
var A_StepsManager = class {
|
|
3056
3055
|
constructor(entities) {
|
|
3056
|
+
/**
|
|
3057
|
+
* Maps each step instance to a unique ID.
|
|
3058
|
+
* Duplicate steps (same dependency.name + handler) get indexed suffixes (e.g., #1, #2).
|
|
3059
|
+
*/
|
|
3060
|
+
this._uniqueIdMap = /* @__PURE__ */ new Map();
|
|
3057
3061
|
this._isBuilt = false;
|
|
3058
3062
|
this.entities = this.prepareSteps(entities);
|
|
3059
3063
|
this.graph = /* @__PURE__ */ new Map();
|
|
3060
3064
|
this.visited = /* @__PURE__ */ new Set();
|
|
3061
3065
|
this.tempMark = /* @__PURE__ */ new Set();
|
|
3062
3066
|
this.sortedEntities = [];
|
|
3067
|
+
this.assignUniqueIds();
|
|
3063
3068
|
}
|
|
3064
3069
|
prepareSteps(entities) {
|
|
3065
3070
|
return entities.map((step) => ({
|
|
@@ -3071,15 +3076,54 @@ var A_StepsManager = class {
|
|
|
3071
3076
|
throwOnError: false
|
|
3072
3077
|
}));
|
|
3073
3078
|
}
|
|
3074
|
-
|
|
3079
|
+
/**
|
|
3080
|
+
* Returns the base (non-unique) ID for a step: `dependency.name.handler`
|
|
3081
|
+
*/
|
|
3082
|
+
baseID(step) {
|
|
3075
3083
|
return `${step.dependency.name}.${step.handler}`;
|
|
3076
3084
|
}
|
|
3085
|
+
/**
|
|
3086
|
+
* Returns the unique ID assigned to a specific step instance.
|
|
3087
|
+
* Falls back to baseID if not yet assigned.
|
|
3088
|
+
*/
|
|
3089
|
+
ID(step) {
|
|
3090
|
+
return this._uniqueIdMap.get(step) || this.baseID(step);
|
|
3091
|
+
}
|
|
3092
|
+
/**
|
|
3093
|
+
* Assigns unique IDs to all steps.
|
|
3094
|
+
* Duplicate base IDs get an index suffix (#0, #1, ...).
|
|
3095
|
+
* Steps with unique base IDs keep their original ID (no suffix).
|
|
3096
|
+
*/
|
|
3097
|
+
assignUniqueIds() {
|
|
3098
|
+
const counts = /* @__PURE__ */ new Map();
|
|
3099
|
+
for (const step of this.entities) {
|
|
3100
|
+
const base = this.baseID(step);
|
|
3101
|
+
counts.set(base, (counts.get(base) || 0) + 1);
|
|
3102
|
+
}
|
|
3103
|
+
const indexTracker = /* @__PURE__ */ new Map();
|
|
3104
|
+
for (const step of this.entities) {
|
|
3105
|
+
const base = this.baseID(step);
|
|
3106
|
+
if (counts.get(base) > 1) {
|
|
3107
|
+
const idx = indexTracker.get(base) || 0;
|
|
3108
|
+
this._uniqueIdMap.set(step, `${base}#${idx}`);
|
|
3109
|
+
indexTracker.set(base, idx + 1);
|
|
3110
|
+
} else {
|
|
3111
|
+
this._uniqueIdMap.set(step, base);
|
|
3112
|
+
}
|
|
3113
|
+
}
|
|
3114
|
+
}
|
|
3077
3115
|
buildGraph() {
|
|
3078
3116
|
if (this._isBuilt) return;
|
|
3079
3117
|
this._isBuilt = true;
|
|
3080
3118
|
this.entities = this.entities.filter(
|
|
3081
|
-
(step, i, self) => !self.some((s) =>
|
|
3119
|
+
(step, i, self) => !self.some((s, j) => {
|
|
3120
|
+
if (i === j || !s.override) return false;
|
|
3121
|
+
const re = new RegExp(s.override);
|
|
3122
|
+
return re.test(this.baseID(step)) || re.test(step.handler);
|
|
3123
|
+
})
|
|
3082
3124
|
);
|
|
3125
|
+
this._uniqueIdMap.clear();
|
|
3126
|
+
this.assignUniqueIds();
|
|
3083
3127
|
this.entities.forEach((entity) => this.graph.set(this.ID(entity), /* @__PURE__ */ new Set()));
|
|
3084
3128
|
this.entities.forEach((entity) => {
|
|
3085
3129
|
const entityId = this.ID(entity);
|
|
@@ -3099,10 +3143,10 @@ var A_StepsManager = class {
|
|
|
3099
3143
|
}
|
|
3100
3144
|
});
|
|
3101
3145
|
}
|
|
3102
|
-
// Match entities by name or regex
|
|
3146
|
+
// Match entities by name or regex — matches against the base ID for pattern compatibility
|
|
3103
3147
|
matchEntities(entityId, pattern) {
|
|
3104
3148
|
const regex = new RegExp(pattern);
|
|
3105
|
-
return this.entities.filter((entity) => regex.test(this.
|
|
3149
|
+
return this.entities.filter((entity) => regex.test(this.baseID(entity)) && this.ID(entity) !== entityId).map((entity) => this.ID(entity));
|
|
3106
3150
|
}
|
|
3107
3151
|
// Topological sort with cycle detection
|
|
3108
3152
|
visit(node) {
|
|
@@ -3592,7 +3636,7 @@ var A_ComponentMeta = class extends A_Meta {
|
|
|
3592
3636
|
before: extension.before || "",
|
|
3593
3637
|
after: extension.after || "",
|
|
3594
3638
|
throwOnError: extension.throwOnError || true,
|
|
3595
|
-
override: ""
|
|
3639
|
+
override: extension.override || ""
|
|
3596
3640
|
});
|
|
3597
3641
|
});
|
|
3598
3642
|
});
|
|
@@ -5169,6 +5213,14 @@ var A_Context = class _A_Context {
|
|
|
5169
5213
|
if (inherited) {
|
|
5170
5214
|
steps.delete(`${A_CommonHelper.getComponentName(inherited)}.${declaration.handler}`);
|
|
5171
5215
|
}
|
|
5216
|
+
if (declaration.override) {
|
|
5217
|
+
const overrideRegexp = new RegExp(declaration.override);
|
|
5218
|
+
for (const [stepKey, step] of steps) {
|
|
5219
|
+
if (overrideRegexp.test(stepKey) || overrideRegexp.test(step.handler)) {
|
|
5220
|
+
steps.delete(stepKey);
|
|
5221
|
+
}
|
|
5222
|
+
}
|
|
5223
|
+
}
|
|
5172
5224
|
steps.set(`${A_CommonHelper.getComponentName(cmp)}.${declaration.handler}`, {
|
|
5173
5225
|
dependency: new A_Dependency(cmp),
|
|
5174
5226
|
...declaration
|