@adaas/a-concept 0.3.1 → 0.3.2
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 +25 -3
- package/dist/browser/index.mjs +2 -2
- package/dist/browser/index.mjs.map +1 -1
- package/dist/node/index.cjs +62 -9
- package/dist/node/index.cjs.map +1 -1
- package/dist/node/index.d.mts +25 -3
- package/dist/node/index.d.ts +25 -3
- package/dist/node/index.mjs +62 -10
- package/dist/node/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/env/env.base.ts +1 -1
- package/src/lib/A-Context/A-Context.class.ts +17 -14
- package/src/lib/A-Dependency/A-Dependency-Query.decorator.ts +90 -0
- package/src/lib/A-Dependency/A-Dependency.class.ts +11 -0
- package/src/lib/A-Dependency/A-Dependency.types.ts +12 -1
- package/src/lib/A-Dependency/index.ts +1 -0
- package/src/lib/A-Scope/A-Scope.class.ts +3 -1
- package/src/lib/A-Scope/A-Scope.types.ts +1 -1
- package/tests/A-Dependency.test.ts +67 -0
- package/tests/A-Entity.test.ts +101 -0
package/dist/node/index.d.mts
CHANGED
|
@@ -2174,6 +2174,11 @@ type A_TYPES__A_Dependency_FlatDecoratorReturn<T = any> = (target: T, propertyKe
|
|
|
2174
2174
|
* A-Dependency All decorator return type
|
|
2175
2175
|
*/
|
|
2176
2176
|
type A_TYPES__A_Dependency_AllDecoratorReturn<T = any> = (target: T, propertyKey: string | symbol | undefined, parameterIndex: number) => void;
|
|
2177
|
+
type A_TYPES__A_Dependency_QueryTarget<T extends A_Entity = A_Entity> = T | A_TYPES__Entity_Constructor<T>;
|
|
2178
|
+
/**
|
|
2179
|
+
* A-Dependency Query decorator return type
|
|
2180
|
+
*/
|
|
2181
|
+
type A_TYPES__A_Dependency_QueryDecoratorReturn<T = any> = (target: T, propertyKey: string | symbol | undefined, parameterIndex: number) => void;
|
|
2177
2182
|
|
|
2178
2183
|
/**
|
|
2179
2184
|
* Should indicate which Default is required
|
|
@@ -2215,6 +2220,15 @@ declare function A_Dependency_Require(): A_TYPES__A_Dependency_RequireDecoratorR
|
|
|
2215
2220
|
*/
|
|
2216
2221
|
declare function A_Dependency_All(): A_TYPES__A_Dependency_AllDecoratorReturn;
|
|
2217
2222
|
|
|
2223
|
+
/**
|
|
2224
|
+
* Query Decorator is only applicable for Entities since Scope instance may have multiple entities but only one component or container, so there is no need for such complex resolution strategies for them, but for entities it is a common case to have multiple instances and need to specify which one(s) to inject.
|
|
2225
|
+
*
|
|
2226
|
+
*
|
|
2227
|
+
* @param query
|
|
2228
|
+
* @returns
|
|
2229
|
+
*/
|
|
2230
|
+
declare function A_Dependency_Query<T extends A_Entity = A_Entity>(query: Partial<A_TYPES__A_Dependency_EntityInjectionQuery<T>>, pagination?: Partial<A_TYPES__A_Dependency_EntityInjectionPagination>): A_TYPES__A_Dependency_QueryDecoratorReturn;
|
|
2231
|
+
|
|
2218
2232
|
declare class A_Dependency<T extends A_TYPES__A_DependencyInjectable = A_TYPES__A_DependencyInjectable> {
|
|
2219
2233
|
/**
|
|
2220
2234
|
* Allows to indicate which Injected parameter is required
|
|
@@ -2256,6 +2270,13 @@ declare class A_Dependency<T extends A_TYPES__A_DependencyInjectable = A_TYPES__
|
|
|
2256
2270
|
* @returns
|
|
2257
2271
|
*/
|
|
2258
2272
|
static get All(): typeof A_Dependency_All;
|
|
2273
|
+
/**
|
|
2274
|
+
* Allows to indicate that the dependency should be resolved by specific query parameters
|
|
2275
|
+
* e.g. by ASEID, name, type, custom properties, etc.
|
|
2276
|
+
*
|
|
2277
|
+
* @returns
|
|
2278
|
+
*/
|
|
2279
|
+
static get Query(): typeof A_Dependency_Query;
|
|
2259
2280
|
protected _name: string;
|
|
2260
2281
|
protected _target?: A_TYPES__Ctor<T>;
|
|
2261
2282
|
protected _resolutionStrategy: A_TYPES__A_DependencyResolutionStrategy;
|
|
@@ -2908,7 +2929,7 @@ type A_TYPES__ScopeLinkedConstructors = A_TYPES__Container_Constructor | A_TYPES
|
|
|
2908
2929
|
/**
|
|
2909
2930
|
* A list of components that can have a scope associated with them
|
|
2910
2931
|
*/
|
|
2911
|
-
type A_TYPES__ScopeLinkedComponents = A_Container | A_Feature;
|
|
2932
|
+
type A_TYPES__ScopeLinkedComponents = A_Container | A_Feature | A_Entity;
|
|
2912
2933
|
/**
|
|
2913
2934
|
* A list of components that are dependent on a scope and do not have their own scope
|
|
2914
2935
|
*/
|
|
@@ -3032,7 +3053,8 @@ declare class A_Scope<_MetaItems extends Record<string, any> = any, _ComponentTy
|
|
|
3032
3053
|
*/
|
|
3033
3054
|
get parent(): A_Scope | undefined;
|
|
3034
3055
|
/**
|
|
3035
|
-
* A_Scope
|
|
3056
|
+
* A_Scope is a unique A-Concept Structure that allows to operate with A-Concept Primitives and Models in a specific context and with specific rules.
|
|
3057
|
+
* It refers to the visibility and accessibility of :
|
|
3036
3058
|
* - variables,
|
|
3037
3059
|
* - Components,
|
|
3038
3060
|
* - Context Fragments
|
|
@@ -4968,4 +4990,4 @@ declare const A_CONSTANTS__DEFAULT_ENV_VARIABLES: {
|
|
|
4968
4990
|
type A_TYPES__ConceptENVVariables = (typeof A_CONSTANTS__DEFAULT_ENV_VARIABLES)[keyof typeof A_CONSTANTS__DEFAULT_ENV_VARIABLES][];
|
|
4969
4991
|
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"];
|
|
4970
4992
|
|
|
4971
|
-
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_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_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 };
|
|
4993
|
+
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 };
|
package/dist/node/index.d.ts
CHANGED
|
@@ -2174,6 +2174,11 @@ type A_TYPES__A_Dependency_FlatDecoratorReturn<T = any> = (target: T, propertyKe
|
|
|
2174
2174
|
* A-Dependency All decorator return type
|
|
2175
2175
|
*/
|
|
2176
2176
|
type A_TYPES__A_Dependency_AllDecoratorReturn<T = any> = (target: T, propertyKey: string | symbol | undefined, parameterIndex: number) => void;
|
|
2177
|
+
type A_TYPES__A_Dependency_QueryTarget<T extends A_Entity = A_Entity> = T | A_TYPES__Entity_Constructor<T>;
|
|
2178
|
+
/**
|
|
2179
|
+
* A-Dependency Query decorator return type
|
|
2180
|
+
*/
|
|
2181
|
+
type A_TYPES__A_Dependency_QueryDecoratorReturn<T = any> = (target: T, propertyKey: string | symbol | undefined, parameterIndex: number) => void;
|
|
2177
2182
|
|
|
2178
2183
|
/**
|
|
2179
2184
|
* Should indicate which Default is required
|
|
@@ -2215,6 +2220,15 @@ declare function A_Dependency_Require(): A_TYPES__A_Dependency_RequireDecoratorR
|
|
|
2215
2220
|
*/
|
|
2216
2221
|
declare function A_Dependency_All(): A_TYPES__A_Dependency_AllDecoratorReturn;
|
|
2217
2222
|
|
|
2223
|
+
/**
|
|
2224
|
+
* Query Decorator is only applicable for Entities since Scope instance may have multiple entities but only one component or container, so there is no need for such complex resolution strategies for them, but for entities it is a common case to have multiple instances and need to specify which one(s) to inject.
|
|
2225
|
+
*
|
|
2226
|
+
*
|
|
2227
|
+
* @param query
|
|
2228
|
+
* @returns
|
|
2229
|
+
*/
|
|
2230
|
+
declare function A_Dependency_Query<T extends A_Entity = A_Entity>(query: Partial<A_TYPES__A_Dependency_EntityInjectionQuery<T>>, pagination?: Partial<A_TYPES__A_Dependency_EntityInjectionPagination>): A_TYPES__A_Dependency_QueryDecoratorReturn;
|
|
2231
|
+
|
|
2218
2232
|
declare class A_Dependency<T extends A_TYPES__A_DependencyInjectable = A_TYPES__A_DependencyInjectable> {
|
|
2219
2233
|
/**
|
|
2220
2234
|
* Allows to indicate which Injected parameter is required
|
|
@@ -2256,6 +2270,13 @@ declare class A_Dependency<T extends A_TYPES__A_DependencyInjectable = A_TYPES__
|
|
|
2256
2270
|
* @returns
|
|
2257
2271
|
*/
|
|
2258
2272
|
static get All(): typeof A_Dependency_All;
|
|
2273
|
+
/**
|
|
2274
|
+
* Allows to indicate that the dependency should be resolved by specific query parameters
|
|
2275
|
+
* e.g. by ASEID, name, type, custom properties, etc.
|
|
2276
|
+
*
|
|
2277
|
+
* @returns
|
|
2278
|
+
*/
|
|
2279
|
+
static get Query(): typeof A_Dependency_Query;
|
|
2259
2280
|
protected _name: string;
|
|
2260
2281
|
protected _target?: A_TYPES__Ctor<T>;
|
|
2261
2282
|
protected _resolutionStrategy: A_TYPES__A_DependencyResolutionStrategy;
|
|
@@ -2908,7 +2929,7 @@ type A_TYPES__ScopeLinkedConstructors = A_TYPES__Container_Constructor | A_TYPES
|
|
|
2908
2929
|
/**
|
|
2909
2930
|
* A list of components that can have a scope associated with them
|
|
2910
2931
|
*/
|
|
2911
|
-
type A_TYPES__ScopeLinkedComponents = A_Container | A_Feature;
|
|
2932
|
+
type A_TYPES__ScopeLinkedComponents = A_Container | A_Feature | A_Entity;
|
|
2912
2933
|
/**
|
|
2913
2934
|
* A list of components that are dependent on a scope and do not have their own scope
|
|
2914
2935
|
*/
|
|
@@ -3032,7 +3053,8 @@ declare class A_Scope<_MetaItems extends Record<string, any> = any, _ComponentTy
|
|
|
3032
3053
|
*/
|
|
3033
3054
|
get parent(): A_Scope | undefined;
|
|
3034
3055
|
/**
|
|
3035
|
-
* A_Scope
|
|
3056
|
+
* A_Scope is a unique A-Concept Structure that allows to operate with A-Concept Primitives and Models in a specific context and with specific rules.
|
|
3057
|
+
* It refers to the visibility and accessibility of :
|
|
3036
3058
|
* - variables,
|
|
3037
3059
|
* - Components,
|
|
3038
3060
|
* - Context Fragments
|
|
@@ -4968,4 +4990,4 @@ declare const A_CONSTANTS__DEFAULT_ENV_VARIABLES: {
|
|
|
4968
4990
|
type A_TYPES__ConceptENVVariables = (typeof A_CONSTANTS__DEFAULT_ENV_VARIABLES)[keyof typeof A_CONSTANTS__DEFAULT_ENV_VARIABLES][];
|
|
4969
4991
|
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"];
|
|
4970
4992
|
|
|
4971
|
-
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_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_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 };
|
|
4993
|
+
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 };
|
package/dist/node/index.mjs
CHANGED
|
@@ -505,7 +505,7 @@ var A_CONCEPT_BASE_ENV = class {
|
|
|
505
505
|
* Environment of the application e.g. development, production, staging
|
|
506
506
|
*/
|
|
507
507
|
static get A_CONCEPT_ENVIRONMENT() {
|
|
508
|
-
return "
|
|
508
|
+
return "development";
|
|
509
509
|
}
|
|
510
510
|
/**
|
|
511
511
|
* Runtime environment of the application e.g. browser, node
|
|
@@ -2134,6 +2134,49 @@ function A_Dependency_All() {
|
|
|
2134
2134
|
};
|
|
2135
2135
|
}
|
|
2136
2136
|
|
|
2137
|
+
// src/lib/A-Dependency/A-Dependency-Query.decorator.ts
|
|
2138
|
+
function A_Dependency_Query(query, pagination) {
|
|
2139
|
+
return function(target, methodName, parameterIndex) {
|
|
2140
|
+
const componentName = A_CommonHelper.getComponentName(target);
|
|
2141
|
+
if (!A_TypeGuards.isTargetAvailableForInjection(target)) {
|
|
2142
|
+
throw new A_DependencyError(
|
|
2143
|
+
A_DependencyError.InvalidDependencyTarget,
|
|
2144
|
+
`A-All cannot be used on the target of type ${typeof target} (${componentName})`
|
|
2145
|
+
);
|
|
2146
|
+
}
|
|
2147
|
+
const method = methodName ? String(methodName) : "constructor";
|
|
2148
|
+
let metaKey;
|
|
2149
|
+
switch (true) {
|
|
2150
|
+
case (A_TypeGuards.isComponentConstructor(target) || A_TypeGuards.isComponentInstance(target)):
|
|
2151
|
+
metaKey = "a-component-injections" /* INJECTIONS */;
|
|
2152
|
+
break;
|
|
2153
|
+
case A_TypeGuards.isContainerInstance(target):
|
|
2154
|
+
metaKey = "a-container-injections" /* INJECTIONS */;
|
|
2155
|
+
break;
|
|
2156
|
+
case A_TypeGuards.isEntityInstance(target):
|
|
2157
|
+
metaKey = "a-component-injections" /* INJECTIONS */;
|
|
2158
|
+
break;
|
|
2159
|
+
}
|
|
2160
|
+
const existedMeta = A_Context.meta(target).get(metaKey) || new A_Meta();
|
|
2161
|
+
const paramsArray = existedMeta.get(method) || [];
|
|
2162
|
+
paramsArray[parameterIndex].resolutionStrategy = {
|
|
2163
|
+
query: {
|
|
2164
|
+
...paramsArray[parameterIndex].resolutionStrategy.query,
|
|
2165
|
+
...query
|
|
2166
|
+
},
|
|
2167
|
+
pagination: {
|
|
2168
|
+
...paramsArray[parameterIndex].resolutionStrategy.pagination,
|
|
2169
|
+
...pagination
|
|
2170
|
+
}
|
|
2171
|
+
};
|
|
2172
|
+
existedMeta.set(method, paramsArray);
|
|
2173
|
+
A_Context.meta(target).set(
|
|
2174
|
+
metaKey,
|
|
2175
|
+
existedMeta
|
|
2176
|
+
);
|
|
2177
|
+
};
|
|
2178
|
+
}
|
|
2179
|
+
|
|
2137
2180
|
// src/lib/A-Dependency/A-Dependency.class.ts
|
|
2138
2181
|
var A_Dependency = class {
|
|
2139
2182
|
/**
|
|
@@ -2213,6 +2256,15 @@ var A_Dependency = class {
|
|
|
2213
2256
|
static get All() {
|
|
2214
2257
|
return A_Dependency_All;
|
|
2215
2258
|
}
|
|
2259
|
+
/**
|
|
2260
|
+
* Allows to indicate that the dependency should be resolved by specific query parameters
|
|
2261
|
+
* e.g. by ASEID, name, type, custom properties, etc.
|
|
2262
|
+
*
|
|
2263
|
+
* @returns
|
|
2264
|
+
*/
|
|
2265
|
+
static get Query() {
|
|
2266
|
+
return A_Dependency_Query;
|
|
2267
|
+
}
|
|
2216
2268
|
get flat() {
|
|
2217
2269
|
return this._resolutionStrategy.flat;
|
|
2218
2270
|
}
|
|
@@ -5004,13 +5056,6 @@ var A_Context = class _A_Context {
|
|
|
5004
5056
|
if (!this.isAllowedForScopeAllocation(param1) && !this.isAllowedToBeRegistered(param1))
|
|
5005
5057
|
throw new A_ContextError(A_ContextError.InvalidScopeParameterError, `Invalid parameter provided to get scope. Component of type ${name} is not allowed for scope allocation.`);
|
|
5006
5058
|
switch (true) {
|
|
5007
|
-
case this.isAllowedForScopeAllocation(param1):
|
|
5008
|
-
if (!instance._registry.has(param1))
|
|
5009
|
-
throw new A_ContextError(
|
|
5010
|
-
A_ContextError.ScopeNotFoundError,
|
|
5011
|
-
`Invalid parameter provided to get scope. Component of type ${name} does not have a scope allocated. Make sure to allocate a scope using A_Context.allocate() method before trying to get the scope.`
|
|
5012
|
-
);
|
|
5013
|
-
return instance._registry.get(param1);
|
|
5014
5059
|
case this.isAllowedToBeRegistered(param1):
|
|
5015
5060
|
if (!instance._scopeStorage.has(param1))
|
|
5016
5061
|
throw new A_ContextError(
|
|
@@ -5018,6 +5063,13 @@ var A_Context = class _A_Context {
|
|
|
5018
5063
|
`Invalid parameter provided to get scope. Component of type ${name} does not have a scope registered. Make sure to register the component using A_Context.register() method before trying to get the scope.`
|
|
5019
5064
|
);
|
|
5020
5065
|
return instance._scopeStorage.get(param1);
|
|
5066
|
+
case this.isAllowedForScopeAllocation(param1):
|
|
5067
|
+
if (!instance._registry.has(param1))
|
|
5068
|
+
throw new A_ContextError(
|
|
5069
|
+
A_ContextError.ScopeNotFoundError,
|
|
5070
|
+
`Invalid parameter provided to get scope. Component of type ${name} does not have a scope allocated. Make sure to allocate a scope using A_Context.allocate() method before trying to get the scope.`
|
|
5071
|
+
);
|
|
5072
|
+
return instance._registry.get(param1);
|
|
5021
5073
|
default:
|
|
5022
5074
|
throw new A_ContextError(A_ContextError.InvalidScopeParameterError, `Invalid parameter provided to get scope. Component of type ${name} is not allowed to be registered.`);
|
|
5023
5075
|
}
|
|
@@ -5235,7 +5287,7 @@ var A_Context = class _A_Context {
|
|
|
5235
5287
|
* @returns
|
|
5236
5288
|
*/
|
|
5237
5289
|
static isAllowedForScopeAllocation(param) {
|
|
5238
|
-
return A_TypeGuards.isContainerInstance(param) || A_TypeGuards.isFeatureInstance(param);
|
|
5290
|
+
return A_TypeGuards.isContainerInstance(param) || A_TypeGuards.isFeatureInstance(param) || A_TypeGuards.isEntityInstance(param);
|
|
5239
5291
|
}
|
|
5240
5292
|
/**
|
|
5241
5293
|
* Type guard to check if the param is allowed to be registered in the context.
|
|
@@ -5696,6 +5748,6 @@ function A_Inject(param1, param2) {
|
|
|
5696
5748
|
};
|
|
5697
5749
|
}
|
|
5698
5750
|
|
|
5699
|
-
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_Require, A_Entity, A_EntityError, A_EntityMeta, A_Error, A_Feature, A_FeatureError, A_Feature_Define, A_Feature_Extend, A_FormatterHelper, A_Fragment, A_IdentityHelper, A_Inject, A_InjectError, A_Meta, A_MetaDecorator, A_Scope, A_ScopeError, A_Stage, A_StageError, A_StepManagerError, A_StepsManager, A_TYPES__A_Stage_Status, A_TYPES__ComponentMetaKey, A_TYPES__ConceptAbstractions, A_TYPES__ConceptMetaKey, A_TYPES__ContainerMetaKey, A_TYPES__EntityFeatures, A_TYPES__EntityMetaKey, A_TYPES__FeatureState, A_TypeGuards };
|
|
5751
|
+
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, A_IdentityHelper, A_Inject, A_InjectError, A_Meta, A_MetaDecorator, A_Scope, A_ScopeError, A_Stage, A_StageError, A_StepManagerError, A_StepsManager, A_TYPES__A_Stage_Status, A_TYPES__ComponentMetaKey, A_TYPES__ConceptAbstractions, A_TYPES__ConceptMetaKey, A_TYPES__ContainerMetaKey, A_TYPES__EntityFeatures, A_TYPES__EntityMetaKey, A_TYPES__FeatureState, A_TypeGuards };
|
|
5700
5752
|
//# sourceMappingURL=index.mjs.map
|
|
5701
5753
|
//# sourceMappingURL=index.mjs.map
|