@adaas/a-concept 0.1.45 → 0.1.47
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 +2 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +64 -7
- package/dist/index.d.ts +64 -7
- package/dist/index.mjs +2 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/global/A-Entity/A-Entity.class.ts +2 -2
- package/src/global/A-Entity/A-Entity.error.ts +1 -1
- package/src/global/A-Scope/A-Scope.class.ts +22 -8
- package/src/global/A-Scope/A-Scope.types.ts +3 -0
- package/src/index.ts +16 -10
- package/tests/A-Scope.test.ts +27 -0
package/dist/index.d.mts
CHANGED
|
@@ -482,6 +482,11 @@ declare enum A_TYPES__EntityMetaKey {
|
|
|
482
482
|
ABSTRACTIONS = "a-component-abstractions",
|
|
483
483
|
INJECTIONS = "a-component-injections"
|
|
484
484
|
}
|
|
485
|
+
declare enum A_TYPES__EntityFeatures {
|
|
486
|
+
SAVE = "save",
|
|
487
|
+
DESTROY = "destroy",
|
|
488
|
+
LOAD = "load"
|
|
489
|
+
}
|
|
485
490
|
|
|
486
491
|
/**
|
|
487
492
|
* Entity interface
|
|
@@ -2010,6 +2015,9 @@ declare enum A_TYPES__ConceptAbstractions {
|
|
|
2010
2015
|
*/
|
|
2011
2016
|
Stop = "stop"
|
|
2012
2017
|
}
|
|
2018
|
+
declare enum A_TYPES__ConceptMetaKey {
|
|
2019
|
+
LIFECYCLE = "a-component-extensions"
|
|
2020
|
+
}
|
|
2013
2021
|
|
|
2014
2022
|
/**
|
|
2015
2023
|
* A-Abstraction Extend decorator allows to extends behavior of each concept abstraction execution.
|
|
@@ -2718,7 +2726,7 @@ declare class A_Scope<_MetaItems extends Record<string, any> = any, _ComponentTy
|
|
|
2718
2726
|
/**
|
|
2719
2727
|
* A set of constructors that are allowed in the scope
|
|
2720
2728
|
*/
|
|
2721
|
-
params: Partial<A_TYPES__Scope_Init<_ComponentType, _ErrorType, _EntityType, _FragmentType>>,
|
|
2729
|
+
params: Partial<A_TYPES__Scope_Init<_MetaItems, _ComponentType, _ErrorType, _EntityType, _FragmentType>>,
|
|
2722
2730
|
/**
|
|
2723
2731
|
* Configuration options for the scope
|
|
2724
2732
|
*/
|
|
@@ -2729,8 +2737,8 @@ declare class A_Scope<_MetaItems extends Record<string, any> = any, _ComponentTy
|
|
|
2729
2737
|
* @param param1
|
|
2730
2738
|
* @returns
|
|
2731
2739
|
*/
|
|
2732
|
-
protected getInitializer(param1?: Partial<A_TYPES__Scope_Init<_ComponentType, _ErrorType, _EntityType, _FragmentType>>, param2?: Partial<A_TYPES__ScopeConfig>): (param1: any, param2: any) => void | (() => void);
|
|
2733
|
-
protected defaultInitialized(params?: Partial<A_TYPES__Scope_Init<_ComponentType, _ErrorType, _EntityType, _FragmentType>>, config?: Partial<A_TYPES__ScopeConfig>): void;
|
|
2740
|
+
protected getInitializer(param1?: Partial<A_TYPES__Scope_Init<_MetaItems, _ComponentType, _ErrorType, _EntityType, _FragmentType>>, param2?: Partial<A_TYPES__ScopeConfig>): (param1: any, param2: any) => void | (() => void);
|
|
2741
|
+
protected defaultInitialized(params?: Partial<A_TYPES__Scope_Init<_MetaItems, _ComponentType, _ErrorType, _EntityType, _FragmentType>>, config?: Partial<A_TYPES__ScopeConfig>): void;
|
|
2734
2742
|
/**
|
|
2735
2743
|
* This method is used to initialize the components in the scope
|
|
2736
2744
|
* To save memory components are initialized only when they are requested
|
|
@@ -2767,6 +2775,14 @@ declare class A_Scope<_MetaItems extends Record<string, any> = any, _ComponentTy
|
|
|
2767
2775
|
* @param _fragments
|
|
2768
2776
|
*/
|
|
2769
2777
|
protected initFragments(_fragments?: _FragmentType): void;
|
|
2778
|
+
/**
|
|
2779
|
+
* This method is used to initialize the meta in the scope
|
|
2780
|
+
*
|
|
2781
|
+
* This method only sets the meta values in the scope in case they are not set yet
|
|
2782
|
+
*
|
|
2783
|
+
* @param _meta
|
|
2784
|
+
*/
|
|
2785
|
+
protected initMeta(_meta?: Partial<_MetaItems>): void;
|
|
2770
2786
|
/**
|
|
2771
2787
|
* This method is used to destroy the scope and all its registered components, fragments and entities
|
|
2772
2788
|
*
|
|
@@ -2788,7 +2804,7 @@ declare class A_Scope<_MetaItems extends Record<string, any> = any, _ComponentTy
|
|
|
2788
2804
|
* }
|
|
2789
2805
|
* ```
|
|
2790
2806
|
*/
|
|
2791
|
-
get(param:
|
|
2807
|
+
get<K extends keyof _MetaItems>(param: K): _MetaItems[K] | undefined;
|
|
2792
2808
|
/**
|
|
2793
2809
|
* Stores a value in the scope's meta.
|
|
2794
2810
|
*
|
|
@@ -2801,7 +2817,7 @@ declare class A_Scope<_MetaItems extends Record<string, any> = any, _ComponentTy
|
|
|
2801
2817
|
* scope.set('role', 'admin');
|
|
2802
2818
|
* ```
|
|
2803
2819
|
*/
|
|
2804
|
-
set(param:
|
|
2820
|
+
set<K extends keyof _MetaItems>(param: K, value: _MetaItems[K]): void;
|
|
2805
2821
|
/**
|
|
2806
2822
|
* Returns the issuer of the scope, useful for debugging and tracking purposes
|
|
2807
2823
|
*
|
|
@@ -3209,7 +3225,7 @@ type A_TYPES__Scope_Constructor<T = A_Scope> = new (...args: any[]) => T;
|
|
|
3209
3225
|
/**
|
|
3210
3226
|
* Scope initialization type
|
|
3211
3227
|
*/
|
|
3212
|
-
type A_TYPES__Scope_Init<_ComponentType extends A_TYPES__Component_Constructor[] = A_TYPES__Component_Constructor[], _ErrorType extends A_TYPES__Error_Constructor[] = A_TYPES__Error_Constructor[], _EntityType extends A_TYPES__Entity_Constructor[] = A_TYPES__Entity_Constructor[], _FragmentType extends A_Fragment[] = A_Fragment[]> = {
|
|
3228
|
+
type A_TYPES__Scope_Init<_MetaItems extends Record<string, any> = any, _ComponentType extends A_TYPES__Component_Constructor[] = A_TYPES__Component_Constructor[], _ErrorType extends A_TYPES__Error_Constructor[] = A_TYPES__Error_Constructor[], _EntityType extends A_TYPES__Entity_Constructor[] = A_TYPES__Entity_Constructor[], _FragmentType extends A_Fragment[] = A_Fragment[]> = {
|
|
3213
3229
|
/**
|
|
3214
3230
|
* Scope Name
|
|
3215
3231
|
*/
|
|
@@ -3234,6 +3250,7 @@ type A_TYPES__Scope_Init<_ComponentType extends A_TYPES__Component_Constructor[]
|
|
|
3234
3250
|
..._EntityType,
|
|
3235
3251
|
...InstanceType<_EntityType[number]>[]
|
|
3236
3252
|
];
|
|
3253
|
+
meta: Partial<_MetaItems>;
|
|
3237
3254
|
};
|
|
3238
3255
|
/**
|
|
3239
3256
|
* Scope configuration type
|
|
@@ -3726,11 +3743,40 @@ declare class A_Context {
|
|
|
3726
3743
|
static isAllowedForMetaConstructor(param: any): param is A_TYPES__MetaLinkedComponentConstructors;
|
|
3727
3744
|
}
|
|
3728
3745
|
|
|
3746
|
+
declare class A_ContextError extends A_Error {
|
|
3747
|
+
static NotAllowedForScopeAllocationError: string;
|
|
3748
|
+
static ComponentAlreadyHasScopeAllocatedError: string;
|
|
3749
|
+
static InvalidMetaParameterError: string;
|
|
3750
|
+
static InvalidScopeParameterError: string;
|
|
3751
|
+
static ScopeNotFoundError: string;
|
|
3752
|
+
static InvalidFeatureParameterError: string;
|
|
3753
|
+
static InvalidFeatureDefinitionParameterError: string;
|
|
3754
|
+
static InvalidFeatureTemplateParameterError: string;
|
|
3755
|
+
static InvalidFeatureExtensionParameterError: string;
|
|
3756
|
+
static InvalidAbstractionParameterError: string;
|
|
3757
|
+
static InvalidAbstractionDefinitionParameterError: string;
|
|
3758
|
+
static InvalidAbstractionTemplateParameterError: string;
|
|
3759
|
+
static InvalidAbstractionExtensionParameterError: string;
|
|
3760
|
+
static InvalidInjectionParameterError: string;
|
|
3761
|
+
static InvalidExtensionParameterError: string;
|
|
3762
|
+
static InvalidRegisterParameterError: string;
|
|
3763
|
+
static InvalidComponentParameterError: string;
|
|
3764
|
+
static ComponentNotRegisteredError: string;
|
|
3765
|
+
static InvalidDeregisterParameterError: string;
|
|
3766
|
+
}
|
|
3767
|
+
|
|
3729
3768
|
declare class A_ConceptMeta extends A_Meta<any> {
|
|
3730
3769
|
private containers;
|
|
3731
3770
|
constructor(containers: Array<A_Container>);
|
|
3732
3771
|
}
|
|
3733
3772
|
|
|
3773
|
+
declare class A_EntityError extends A_Error {
|
|
3774
|
+
/**
|
|
3775
|
+
* Error code for validation errors.
|
|
3776
|
+
*/
|
|
3777
|
+
static readonly ValidationError = "A-Entity Validation Error";
|
|
3778
|
+
}
|
|
3779
|
+
|
|
3734
3780
|
declare class A_AbstractionError extends A_Error {
|
|
3735
3781
|
/**
|
|
3736
3782
|
* This error code indicates that there was an issue extending the abstraction execution
|
|
@@ -3745,6 +3791,12 @@ declare class A_CallerError extends A_Error {
|
|
|
3745
3791
|
static readonly CallerInitializationError = "Unable to initialize A-Caller";
|
|
3746
3792
|
}
|
|
3747
3793
|
|
|
3794
|
+
declare const A_CONSTANTS__ERROR_CODES: {
|
|
3795
|
+
readonly UNEXPECTED_ERROR: "A-Error Unexpected Error";
|
|
3796
|
+
readonly VALIDATION_ERROR: "A-Error Validation Error";
|
|
3797
|
+
};
|
|
3798
|
+
declare const A_CONSTANTS__ERROR_DESCRIPTION = "If you see this error please let us know.";
|
|
3799
|
+
|
|
3748
3800
|
declare class ASEID_Error extends A_Error {
|
|
3749
3801
|
static readonly ASEIDInitializationError = "ASEID Initialization Error";
|
|
3750
3802
|
static readonly ASEIDValidationError = "ASEID Validation Error";
|
|
@@ -3825,6 +3877,11 @@ declare class A_DependencyError extends A_Error {
|
|
|
3825
3877
|
static readonly InvalidDefaultTarget = "Invalid Default Target";
|
|
3826
3878
|
}
|
|
3827
3879
|
|
|
3880
|
+
declare class A_InjectError extends A_Error {
|
|
3881
|
+
static readonly InvalidInjectionTarget = "Invalid target for A-Inject decorator";
|
|
3882
|
+
static readonly MissingInjectionTarget = "Missing target for A-Inject decorator";
|
|
3883
|
+
}
|
|
3884
|
+
|
|
3828
3885
|
/**
|
|
3829
3886
|
* A-Inject decorator
|
|
3830
3887
|
*
|
|
@@ -4203,4 +4260,4 @@ declare class A_TypeGuards {
|
|
|
4203
4260
|
static isErrorSerializedType<T extends A_TYPES__Error_Serialized>(param: any): param is T;
|
|
4204
4261
|
}
|
|
4205
4262
|
|
|
4206
|
-
export { ASEID, ASEID_Error, A_Abstraction, A_AbstractionError, A_Abstraction_Extend, A_CONSTANTS__DEFAULT_ENV_VARIABLES, A_CONSTANTS__DEFAULT_ENV_VARIABLES_ARRAY, A_Caller, A_CallerError, A_CommonHelper, A_Component, A_ComponentMeta, A_Concept, A_ConceptMeta, A_Container, A_ContainerMeta, A_Context, A_Dependency, A_DependencyError, A_Dependency_Default, A_Dependency_Load, A_Dependency_Require, A_Entity, 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_Meta, 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_Dependency_DefaultDecoratorReturn, type A_TYPES__A_Dependency_LoadDecoratorReturn, type A_TYPES__A_Dependency_RequireDecoratorReturn, type A_TYPES__A_InjectDecoratorDescriptor, type A_TYPES__A_InjectDecoratorReturn, type A_TYPES__A_InjectDecorator_EntityInjectionInstructions, type A_TYPES__A_InjectDecorator_EntityInjectionPagination, type A_TYPES__A_InjectDecorator_EntityInjectionQuery, 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, type A_TYPES__Component_Constructor, type A_TYPES__Component_Init, type A_TYPES__Component_Serialized, type A_TYPES__ConceptAbstraction, type A_TYPES__ConceptAbstractionMeta, type A_TYPES__ConceptENVVariables, type A_TYPES__Concept_Constructor, type A_TYPES__Concept_Init, type A_TYPES__Concept_Serialized, type A_TYPES__ContainerMeta, type A_TYPES__ContainerMetaExtension, type A_TYPES__Container_Constructor, type A_TYPES__Container_Init, type A_TYPES__Container_Serialized, type A_TYPES__ContextEnvironment, type A_TYPES__DeepPartial, type A_TYPES__Dictionary, type A_TYPES__EntityMeta, 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__InjectableConstructors, type A_TYPES__InjectableTargets, type A_TYPES__MetaLinkedComponentConstructors, type A_TYPES__MetaLinkedComponents, 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__ScopeResolvableComponents, 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 };
|
|
4263
|
+
export { ASEID, ASEID_Error, A_Abstraction, A_AbstractionError, A_Abstraction_Extend, 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_Default, A_Dependency_Load, 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_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_Dependency_DefaultDecoratorReturn, type A_TYPES__A_Dependency_LoadDecoratorReturn, type A_TYPES__A_Dependency_RequireDecoratorReturn, type A_TYPES__A_InjectDecoratorDescriptor, type A_TYPES__A_InjectDecoratorReturn, type A_TYPES__A_InjectDecorator_EntityInjectionInstructions, type A_TYPES__A_InjectDecorator_EntityInjectionPagination, type A_TYPES__A_InjectDecorator_EntityInjectionQuery, 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__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__InjectableConstructors, type A_TYPES__InjectableTargets, type A_TYPES__MetaLinkedComponentConstructors, type A_TYPES__MetaLinkedComponents, 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__ScopeResolvableComponents, 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/index.d.ts
CHANGED
|
@@ -482,6 +482,11 @@ declare enum A_TYPES__EntityMetaKey {
|
|
|
482
482
|
ABSTRACTIONS = "a-component-abstractions",
|
|
483
483
|
INJECTIONS = "a-component-injections"
|
|
484
484
|
}
|
|
485
|
+
declare enum A_TYPES__EntityFeatures {
|
|
486
|
+
SAVE = "save",
|
|
487
|
+
DESTROY = "destroy",
|
|
488
|
+
LOAD = "load"
|
|
489
|
+
}
|
|
485
490
|
|
|
486
491
|
/**
|
|
487
492
|
* Entity interface
|
|
@@ -2010,6 +2015,9 @@ declare enum A_TYPES__ConceptAbstractions {
|
|
|
2010
2015
|
*/
|
|
2011
2016
|
Stop = "stop"
|
|
2012
2017
|
}
|
|
2018
|
+
declare enum A_TYPES__ConceptMetaKey {
|
|
2019
|
+
LIFECYCLE = "a-component-extensions"
|
|
2020
|
+
}
|
|
2013
2021
|
|
|
2014
2022
|
/**
|
|
2015
2023
|
* A-Abstraction Extend decorator allows to extends behavior of each concept abstraction execution.
|
|
@@ -2718,7 +2726,7 @@ declare class A_Scope<_MetaItems extends Record<string, any> = any, _ComponentTy
|
|
|
2718
2726
|
/**
|
|
2719
2727
|
* A set of constructors that are allowed in the scope
|
|
2720
2728
|
*/
|
|
2721
|
-
params: Partial<A_TYPES__Scope_Init<_ComponentType, _ErrorType, _EntityType, _FragmentType>>,
|
|
2729
|
+
params: Partial<A_TYPES__Scope_Init<_MetaItems, _ComponentType, _ErrorType, _EntityType, _FragmentType>>,
|
|
2722
2730
|
/**
|
|
2723
2731
|
* Configuration options for the scope
|
|
2724
2732
|
*/
|
|
@@ -2729,8 +2737,8 @@ declare class A_Scope<_MetaItems extends Record<string, any> = any, _ComponentTy
|
|
|
2729
2737
|
* @param param1
|
|
2730
2738
|
* @returns
|
|
2731
2739
|
*/
|
|
2732
|
-
protected getInitializer(param1?: Partial<A_TYPES__Scope_Init<_ComponentType, _ErrorType, _EntityType, _FragmentType>>, param2?: Partial<A_TYPES__ScopeConfig>): (param1: any, param2: any) => void | (() => void);
|
|
2733
|
-
protected defaultInitialized(params?: Partial<A_TYPES__Scope_Init<_ComponentType, _ErrorType, _EntityType, _FragmentType>>, config?: Partial<A_TYPES__ScopeConfig>): void;
|
|
2740
|
+
protected getInitializer(param1?: Partial<A_TYPES__Scope_Init<_MetaItems, _ComponentType, _ErrorType, _EntityType, _FragmentType>>, param2?: Partial<A_TYPES__ScopeConfig>): (param1: any, param2: any) => void | (() => void);
|
|
2741
|
+
protected defaultInitialized(params?: Partial<A_TYPES__Scope_Init<_MetaItems, _ComponentType, _ErrorType, _EntityType, _FragmentType>>, config?: Partial<A_TYPES__ScopeConfig>): void;
|
|
2734
2742
|
/**
|
|
2735
2743
|
* This method is used to initialize the components in the scope
|
|
2736
2744
|
* To save memory components are initialized only when they are requested
|
|
@@ -2767,6 +2775,14 @@ declare class A_Scope<_MetaItems extends Record<string, any> = any, _ComponentTy
|
|
|
2767
2775
|
* @param _fragments
|
|
2768
2776
|
*/
|
|
2769
2777
|
protected initFragments(_fragments?: _FragmentType): void;
|
|
2778
|
+
/**
|
|
2779
|
+
* This method is used to initialize the meta in the scope
|
|
2780
|
+
*
|
|
2781
|
+
* This method only sets the meta values in the scope in case they are not set yet
|
|
2782
|
+
*
|
|
2783
|
+
* @param _meta
|
|
2784
|
+
*/
|
|
2785
|
+
protected initMeta(_meta?: Partial<_MetaItems>): void;
|
|
2770
2786
|
/**
|
|
2771
2787
|
* This method is used to destroy the scope and all its registered components, fragments and entities
|
|
2772
2788
|
*
|
|
@@ -2788,7 +2804,7 @@ declare class A_Scope<_MetaItems extends Record<string, any> = any, _ComponentTy
|
|
|
2788
2804
|
* }
|
|
2789
2805
|
* ```
|
|
2790
2806
|
*/
|
|
2791
|
-
get(param:
|
|
2807
|
+
get<K extends keyof _MetaItems>(param: K): _MetaItems[K] | undefined;
|
|
2792
2808
|
/**
|
|
2793
2809
|
* Stores a value in the scope's meta.
|
|
2794
2810
|
*
|
|
@@ -2801,7 +2817,7 @@ declare class A_Scope<_MetaItems extends Record<string, any> = any, _ComponentTy
|
|
|
2801
2817
|
* scope.set('role', 'admin');
|
|
2802
2818
|
* ```
|
|
2803
2819
|
*/
|
|
2804
|
-
set(param:
|
|
2820
|
+
set<K extends keyof _MetaItems>(param: K, value: _MetaItems[K]): void;
|
|
2805
2821
|
/**
|
|
2806
2822
|
* Returns the issuer of the scope, useful for debugging and tracking purposes
|
|
2807
2823
|
*
|
|
@@ -3209,7 +3225,7 @@ type A_TYPES__Scope_Constructor<T = A_Scope> = new (...args: any[]) => T;
|
|
|
3209
3225
|
/**
|
|
3210
3226
|
* Scope initialization type
|
|
3211
3227
|
*/
|
|
3212
|
-
type A_TYPES__Scope_Init<_ComponentType extends A_TYPES__Component_Constructor[] = A_TYPES__Component_Constructor[], _ErrorType extends A_TYPES__Error_Constructor[] = A_TYPES__Error_Constructor[], _EntityType extends A_TYPES__Entity_Constructor[] = A_TYPES__Entity_Constructor[], _FragmentType extends A_Fragment[] = A_Fragment[]> = {
|
|
3228
|
+
type A_TYPES__Scope_Init<_MetaItems extends Record<string, any> = any, _ComponentType extends A_TYPES__Component_Constructor[] = A_TYPES__Component_Constructor[], _ErrorType extends A_TYPES__Error_Constructor[] = A_TYPES__Error_Constructor[], _EntityType extends A_TYPES__Entity_Constructor[] = A_TYPES__Entity_Constructor[], _FragmentType extends A_Fragment[] = A_Fragment[]> = {
|
|
3213
3229
|
/**
|
|
3214
3230
|
* Scope Name
|
|
3215
3231
|
*/
|
|
@@ -3234,6 +3250,7 @@ type A_TYPES__Scope_Init<_ComponentType extends A_TYPES__Component_Constructor[]
|
|
|
3234
3250
|
..._EntityType,
|
|
3235
3251
|
...InstanceType<_EntityType[number]>[]
|
|
3236
3252
|
];
|
|
3253
|
+
meta: Partial<_MetaItems>;
|
|
3237
3254
|
};
|
|
3238
3255
|
/**
|
|
3239
3256
|
* Scope configuration type
|
|
@@ -3726,11 +3743,40 @@ declare class A_Context {
|
|
|
3726
3743
|
static isAllowedForMetaConstructor(param: any): param is A_TYPES__MetaLinkedComponentConstructors;
|
|
3727
3744
|
}
|
|
3728
3745
|
|
|
3746
|
+
declare class A_ContextError extends A_Error {
|
|
3747
|
+
static NotAllowedForScopeAllocationError: string;
|
|
3748
|
+
static ComponentAlreadyHasScopeAllocatedError: string;
|
|
3749
|
+
static InvalidMetaParameterError: string;
|
|
3750
|
+
static InvalidScopeParameterError: string;
|
|
3751
|
+
static ScopeNotFoundError: string;
|
|
3752
|
+
static InvalidFeatureParameterError: string;
|
|
3753
|
+
static InvalidFeatureDefinitionParameterError: string;
|
|
3754
|
+
static InvalidFeatureTemplateParameterError: string;
|
|
3755
|
+
static InvalidFeatureExtensionParameterError: string;
|
|
3756
|
+
static InvalidAbstractionParameterError: string;
|
|
3757
|
+
static InvalidAbstractionDefinitionParameterError: string;
|
|
3758
|
+
static InvalidAbstractionTemplateParameterError: string;
|
|
3759
|
+
static InvalidAbstractionExtensionParameterError: string;
|
|
3760
|
+
static InvalidInjectionParameterError: string;
|
|
3761
|
+
static InvalidExtensionParameterError: string;
|
|
3762
|
+
static InvalidRegisterParameterError: string;
|
|
3763
|
+
static InvalidComponentParameterError: string;
|
|
3764
|
+
static ComponentNotRegisteredError: string;
|
|
3765
|
+
static InvalidDeregisterParameterError: string;
|
|
3766
|
+
}
|
|
3767
|
+
|
|
3729
3768
|
declare class A_ConceptMeta extends A_Meta<any> {
|
|
3730
3769
|
private containers;
|
|
3731
3770
|
constructor(containers: Array<A_Container>);
|
|
3732
3771
|
}
|
|
3733
3772
|
|
|
3773
|
+
declare class A_EntityError extends A_Error {
|
|
3774
|
+
/**
|
|
3775
|
+
* Error code for validation errors.
|
|
3776
|
+
*/
|
|
3777
|
+
static readonly ValidationError = "A-Entity Validation Error";
|
|
3778
|
+
}
|
|
3779
|
+
|
|
3734
3780
|
declare class A_AbstractionError extends A_Error {
|
|
3735
3781
|
/**
|
|
3736
3782
|
* This error code indicates that there was an issue extending the abstraction execution
|
|
@@ -3745,6 +3791,12 @@ declare class A_CallerError extends A_Error {
|
|
|
3745
3791
|
static readonly CallerInitializationError = "Unable to initialize A-Caller";
|
|
3746
3792
|
}
|
|
3747
3793
|
|
|
3794
|
+
declare const A_CONSTANTS__ERROR_CODES: {
|
|
3795
|
+
readonly UNEXPECTED_ERROR: "A-Error Unexpected Error";
|
|
3796
|
+
readonly VALIDATION_ERROR: "A-Error Validation Error";
|
|
3797
|
+
};
|
|
3798
|
+
declare const A_CONSTANTS__ERROR_DESCRIPTION = "If you see this error please let us know.";
|
|
3799
|
+
|
|
3748
3800
|
declare class ASEID_Error extends A_Error {
|
|
3749
3801
|
static readonly ASEIDInitializationError = "ASEID Initialization Error";
|
|
3750
3802
|
static readonly ASEIDValidationError = "ASEID Validation Error";
|
|
@@ -3825,6 +3877,11 @@ declare class A_DependencyError extends A_Error {
|
|
|
3825
3877
|
static readonly InvalidDefaultTarget = "Invalid Default Target";
|
|
3826
3878
|
}
|
|
3827
3879
|
|
|
3880
|
+
declare class A_InjectError extends A_Error {
|
|
3881
|
+
static readonly InvalidInjectionTarget = "Invalid target for A-Inject decorator";
|
|
3882
|
+
static readonly MissingInjectionTarget = "Missing target for A-Inject decorator";
|
|
3883
|
+
}
|
|
3884
|
+
|
|
3828
3885
|
/**
|
|
3829
3886
|
* A-Inject decorator
|
|
3830
3887
|
*
|
|
@@ -4203,4 +4260,4 @@ declare class A_TypeGuards {
|
|
|
4203
4260
|
static isErrorSerializedType<T extends A_TYPES__Error_Serialized>(param: any): param is T;
|
|
4204
4261
|
}
|
|
4205
4262
|
|
|
4206
|
-
export { ASEID, ASEID_Error, A_Abstraction, A_AbstractionError, A_Abstraction_Extend, A_CONSTANTS__DEFAULT_ENV_VARIABLES, A_CONSTANTS__DEFAULT_ENV_VARIABLES_ARRAY, A_Caller, A_CallerError, A_CommonHelper, A_Component, A_ComponentMeta, A_Concept, A_ConceptMeta, A_Container, A_ContainerMeta, A_Context, A_Dependency, A_DependencyError, A_Dependency_Default, A_Dependency_Load, A_Dependency_Require, A_Entity, 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_Meta, 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_Dependency_DefaultDecoratorReturn, type A_TYPES__A_Dependency_LoadDecoratorReturn, type A_TYPES__A_Dependency_RequireDecoratorReturn, type A_TYPES__A_InjectDecoratorDescriptor, type A_TYPES__A_InjectDecoratorReturn, type A_TYPES__A_InjectDecorator_EntityInjectionInstructions, type A_TYPES__A_InjectDecorator_EntityInjectionPagination, type A_TYPES__A_InjectDecorator_EntityInjectionQuery, 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, type A_TYPES__Component_Constructor, type A_TYPES__Component_Init, type A_TYPES__Component_Serialized, type A_TYPES__ConceptAbstraction, type A_TYPES__ConceptAbstractionMeta, type A_TYPES__ConceptENVVariables, type A_TYPES__Concept_Constructor, type A_TYPES__Concept_Init, type A_TYPES__Concept_Serialized, type A_TYPES__ContainerMeta, type A_TYPES__ContainerMetaExtension, type A_TYPES__Container_Constructor, type A_TYPES__Container_Init, type A_TYPES__Container_Serialized, type A_TYPES__ContextEnvironment, type A_TYPES__DeepPartial, type A_TYPES__Dictionary, type A_TYPES__EntityMeta, 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__InjectableConstructors, type A_TYPES__InjectableTargets, type A_TYPES__MetaLinkedComponentConstructors, type A_TYPES__MetaLinkedComponents, 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__ScopeResolvableComponents, 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 };
|
|
4263
|
+
export { ASEID, ASEID_Error, A_Abstraction, A_AbstractionError, A_Abstraction_Extend, 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_Default, A_Dependency_Load, 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_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_Dependency_DefaultDecoratorReturn, type A_TYPES__A_Dependency_LoadDecoratorReturn, type A_TYPES__A_Dependency_RequireDecoratorReturn, type A_TYPES__A_InjectDecoratorDescriptor, type A_TYPES__A_InjectDecoratorReturn, type A_TYPES__A_InjectDecorator_EntityInjectionInstructions, type A_TYPES__A_InjectDecorator_EntityInjectionPagination, type A_TYPES__A_InjectDecorator_EntityInjectionQuery, 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__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__InjectableConstructors, type A_TYPES__InjectableTargets, type A_TYPES__MetaLinkedComponentConstructors, type A_TYPES__MetaLinkedComponents, 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__ScopeResolvableComponents, 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 };
|