@adaas/a-concept 0.2.13 → 0.3.1
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/.conf/tsconfig.base.json +91 -0
- package/.conf/tsconfig.browser.json +36 -0
- package/.conf/tsconfig.node.json +40 -0
- package/dist/browser/index.d.mts +4166 -212
- package/dist/browser/index.mjs +2 -67
- package/dist/browser/index.mjs.map +1 -1
- package/dist/node/index.cjs +5761 -0
- package/dist/node/index.cjs.map +1 -0
- package/dist/node/index.d.mts +4193 -212
- package/dist/node/index.d.ts +4193 -212
- package/dist/node/index.mjs +5699 -66
- package/dist/node/index.mjs.map +1 -1
- package/jest.config.ts +30 -15
- package/package.json +19 -18
- package/src/env/env-browser.ts +38 -1
- package/src/env/env-node.ts +26 -2
- package/src/env/env.base.ts +20 -1
- package/src/env/global.browser.d.ts +1 -1
- package/src/helpers/A_BasicTypeGuards.helper.ts +81 -0
- package/src/helpers/A_Common.helper.ts +2 -2
- package/src/helpers/A_Identity.helper.ts +2 -4
- package/src/helpers/A_TypeGuards.helper.ts +45 -30
- package/src/helpers/index.ts +5 -0
- package/src/index.ts +21 -94
- package/src/{global → lib}/A-Abstraction/A-Abstraction-Extend.decorator.ts +18 -13
- package/src/{global → lib}/A-Abstraction/A-Abstraction.class.ts +5 -5
- package/src/{global → lib}/A-Abstraction/A-Abstraction.error.ts +1 -1
- package/src/{global → lib}/A-Abstraction/A-Abstraction.types.ts +5 -5
- package/src/lib/A-Abstraction/index.ts +8 -0
- package/src/{global → lib}/A-Caller/A_Caller.class.ts +3 -4
- package/src/{global → lib}/A-Caller/A_Caller.error.ts +1 -4
- package/src/{global → lib}/A-Caller/A_Caller.types.ts +4 -4
- package/src/lib/A-Caller/index.ts +3 -0
- package/src/{global → lib}/A-Component/A-Component.class.ts +2 -3
- package/src/{global → lib}/A-Component/A-Component.meta.ts +5 -5
- package/src/{global → lib}/A-Component/A-Component.types.ts +5 -5
- package/src/lib/A-Component/index.ts +5 -0
- package/src/{global → lib}/A-Concept/A-Concept.class.ts +9 -7
- package/src/{global → lib}/A-Concept/A-Concept.meta.ts +2 -2
- package/src/{global → lib}/A-Concept/A-Concept.types.ts +7 -7
- package/src/lib/A-Concept/index.ts +4 -0
- package/src/{global → lib}/A-Container/A-Container.class.ts +3 -3
- package/src/{global → lib}/A-Container/A-Container.meta.ts +11 -6
- package/src/{global → lib}/A-Container/A-Container.types.ts +9 -6
- package/src/lib/A-Container/index.ts +5 -0
- package/src/{global → lib}/A-Context/A-Context.class.ts +41 -33
- package/src/{global → lib}/A-Context/A-Context.error.ts +1 -1
- package/src/lib/A-Context/A-Context.types.ts +14 -0
- package/src/lib/A-Context/index.ts +5 -0
- package/src/{global → lib}/A-Dependency/A-Dependency-All.decorator.ts +11 -11
- package/src/{global → lib}/A-Dependency/A-Dependency-Default.decorator.ts +11 -9
- package/src/{global → lib}/A-Dependency/A-Dependency-Flat.decorator.ts +11 -8
- package/src/{global → lib}/A-Dependency/A-Dependency-Load.decorator.ts +11 -9
- package/src/{global → lib}/A-Dependency/A-Dependency-Parent.decorator.ts +11 -9
- package/src/{global → lib}/A-Dependency/A-Dependency-Require.decorator.ts +11 -9
- package/src/{global → lib}/A-Dependency/A-Dependency.class.ts +9 -3
- package/src/{global → lib}/A-Dependency/A-Dependency.error.ts +1 -1
- package/src/{global → lib}/A-Dependency/A-Dependency.types.ts +9 -9
- package/src/lib/A-Dependency/index.ts +17 -0
- package/src/{global → lib}/A-Entity/A-Entity.class.ts +11 -9
- package/src/{global → lib}/A-Entity/A-Entity.error.ts +1 -1
- package/src/{global → lib}/A-Entity/A-Entity.meta.ts +3 -3
- package/src/{global → lib}/A-Entity/A-Entity.types.ts +5 -5
- package/src/lib/A-Entity/index.ts +5 -0
- package/src/{global → lib}/A-Error/A_Error.class.ts +13 -13
- package/src/{global → lib}/A-Error/A_Error.types.ts +2 -2
- package/src/lib/A-Error/index.ts +3 -0
- package/src/{global → lib}/A-Feature/A-Feature-Define.decorator.ts +16 -10
- package/src/{global → lib}/A-Feature/A-Feature-Extend.decorator.ts +13 -9
- package/src/{global → lib}/A-Feature/A-Feature.class.ts +15 -13
- package/src/{global → lib}/A-Feature/A-Feature.error.ts +2 -2
- package/src/{global → lib}/A-Feature/A-Feature.types.ts +21 -12
- package/src/lib/A-Feature/index.ts +13 -0
- package/src/{global → lib}/A-Fragment/A-Fragment.class.ts +0 -2
- package/src/{global → lib}/A-Fragment/A-Fragment.types.ts +1 -1
- package/src/lib/A-Fragment/index.ts +5 -0
- package/src/{global → lib}/A-Inject/A-Inject.decorator.ts +42 -24
- package/src/{global → lib}/A-Inject/A-Inject.error.ts +1 -1
- package/src/{global → lib}/A-Inject/A-Inject.types.ts +3 -9
- package/src/lib/A-Inject/index.ts +3 -0
- package/src/{global → lib}/A-Meta/A-Meta.decorator.ts +2 -2
- package/src/{global → lib}/A-Meta/A-Meta.types.ts +18 -10
- package/src/lib/A-Meta/index.ts +11 -0
- package/src/{global → lib}/A-Scope/A-Scope.class.ts +34 -24
- package/src/{global → lib}/A-Scope/A-Scope.error.ts +1 -1
- package/src/{global → lib}/A-Scope/A-Scope.types.ts +22 -14
- package/src/lib/A-Scope/index.ts +5 -0
- package/src/{global → lib}/A-Stage/A-Stage.class.ts +9 -10
- package/src/{global → lib}/A-Stage/A-Stage.error.ts +1 -1
- package/src/{global → lib}/A-Stage/A-Stage.types.ts +1 -4
- package/src/lib/A-Stage/index.ts +5 -0
- package/src/{global → lib}/A-StepManager/A-StepManager.class.ts +8 -4
- package/src/{global → lib}/A-StepManager/A-StepManager.error.ts +1 -1
- package/src/lib/A-StepManager/index.ts +4 -0
- package/src/{global → lib}/ASEID/ASEID.class.ts +20 -23
- package/src/lib/ASEID/ASEID.error.ts +12 -0
- package/src/lib/ASEID/index.ts +4 -0
- package/src/types/A_identity.types.ts +4 -0
- package/src/types/index.ts +2 -0
- package/tests/A-Abstraction.test.ts +6 -6
- package/tests/A-Common.test.ts +6 -4
- package/tests/A-Component.test.ts +7 -5
- package/tests/A-Concept.test.ts +13 -11
- package/tests/A-Container.test.ts +4 -3
- package/tests/A-Dependency.test.ts +6 -1
- package/tests/A-Entity.test.ts +7 -5
- package/tests/A-Error.test.ts +7 -4
- package/tests/A-Feature.test.ts +12 -8
- package/tests/A-Fragment.test.ts +1 -2
- package/tests/A-Inject.test.ts +4 -1
- package/tests/A-Meta.test.ts +12 -10
- package/tests/A-Scope.test.ts +11 -10
- package/tests/A-StepManager.test.ts +3 -3
- package/tests/ASEID.test.ts +2 -2
- package/tests/jest.setup.ts +23 -23
- package/tsconfig.json +59 -97
- package/tsup.config.ts +25 -13
- package/dist/browser/A-Context.types-BtR_HJ0j.d.mts +0 -3828
- package/dist/browser/env.d.mts +0 -64
- package/dist/browser/env.mjs +0 -3
- package/dist/browser/env.mjs.map +0 -1
- package/dist/node/A-Context.types-BtR_HJ0j.d.mts +0 -3828
- package/dist/node/A-Context.types-BtR_HJ0j.d.ts +0 -3828
- package/dist/node/env.d.mts +0 -91
- package/dist/node/env.d.ts +0 -91
- package/dist/node/env.js +0 -12
- package/dist/node/env.js.map +0 -1
- package/dist/node/env.mjs +0 -3
- package/dist/node/env.mjs.map +0 -1
- package/dist/node/index.js +0 -387
- package/dist/node/index.js.map +0 -1
- package/src/global/A-Context/A-Context.types.ts +0 -14
- package/src/global/ASEID/ASEID.error.ts +0 -12
- /package/src/{global → lib}/A-Component/A-Component.constants.ts +0 -0
- /package/src/{global → lib}/A-Concept/A-Concept.constants.ts +0 -0
- /package/src/{global → lib}/A-Container/A-Container.constants.ts +0 -0
- /package/src/{global → lib}/A-Entity/A-Entity.constants.ts +0 -0
- /package/src/{global → lib}/A-Error/A_Error.constants.ts +0 -0
- /package/src/{global → lib}/A-Meta/A-Meta.class.ts +0 -0
- /package/src/{global → lib}/ASEID/ASEID.constants.ts +0 -0
- /package/src/{global → lib}/ASEID/ASEID.types.ts +0 -0
package/dist/node/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.mjs","sourcesContent":[]}
|
|
1
|
+
{"version":3,"sources":["../../src/lib/A-Fragment/A-Fragment.class.ts","../../src/lib/A-Feature/A-Feature.types.ts","../../src/helpers/A_Formatter.helper.ts","../../src/helpers/A_Identity.helper.ts","../../src/helpers/A_BasicTypeGuards.helper.ts","../../src/lib/ASEID/ASEID.class.ts","../../src/lib/A-Error/A_Error.constants.ts","../../src/constants/env.constants.ts","../../src/env/env.base.ts","../../src/env/env-node.ts","../../src/lib/A-Error/A_Error.class.ts","../../src/lib/A-Entity/A-Entity.error.ts","../../src/lib/A-Entity/A-Entity.class.ts","../../src/lib/A-Meta/A-Meta.decorator.ts","../../src/lib/A-Meta/A-Meta.class.ts","../../src/lib/A-Entity/A-Entity.constants.ts","../../src/lib/A-Entity/A-Entity.meta.ts","../../src/lib/A-Container/A-Container.class.ts","../../src/lib/A-Container/A-Container.constants.ts","../../src/lib/A-Container/A-Container.meta.ts","../../src/lib/A-Feature/A-Feature.error.ts","../../src/helpers/A_Common.helper.ts","../../src/lib/A-Caller/A_Caller.error.ts","../../src/lib/A-Caller/A_Caller.class.ts","../../src/lib/A-Dependency/A-Dependency.error.ts","../../src/lib/A-Dependency/A-Dependency-Default.decorator.ts","../../src/lib/A-Dependency/A-Dependency-Flat.decorator.ts","../../src/lib/A-Dependency/A-Dependency-Load.decorator.ts","../../src/lib/A-Dependency/A-Dependency-Parent.decorator.ts","../../src/lib/A-Dependency/A-Dependency-Require.decorator.ts","../../src/lib/A-Dependency/A-Dependency-All.decorator.ts","../../src/lib/A-Dependency/A-Dependency.class.ts","../../src/helpers/A_TypeGuards.helper.ts","../../src/lib/A-Feature/A-Feature-Define.decorator.ts","../../src/lib/A-Feature/A-Feature-Extend.decorator.ts","../../src/lib/A-Stage/A-Stage.types.ts","../../src/lib/A-Stage/A-Stage.error.ts","../../src/lib/A-Stage/A-Stage.class.ts","../../src/lib/A-StepManager/A-StepManager.error.ts","../../src/lib/A-StepManager/A-StepManager.class.ts","../../src/lib/A-Feature/A-Feature.class.ts","../../src/lib/A-Component/A-Component.class.ts","../../src/lib/A-Component/A-Component.constants.ts","../../src/lib/A-Component/A-Component.meta.ts","../../src/lib/A-Scope/A-Scope.class.ts","../../src/lib/A-Scope/A-Scope.error.ts","../../src/lib/A-Context/A-Context.error.ts","../../src/lib/A-Context/A-Context.class.ts","../../src/lib/A-Abstraction/A-Abstraction.error.ts","../../src/lib/A-Abstraction/A-Abstraction-Extend.decorator.ts","../../src/lib/A-Abstraction/A-Abstraction.class.ts","../../src/lib/A-Concept/A-Concept.constants.ts","../../src/lib/A-Concept/A-Concept.class.ts","../../src/lib/A-Concept/A-Concept.meta.ts","../../src/lib/A-Inject/A-Inject.error.ts","../../src/lib/A-Inject/A-Inject.decorator.ts"],"names":["A_TYPES__FeatureState","A_TYPES__EntityMetaKey","A_TYPES__EntityFeatures","A_TYPES__ContainerMetaKey","extensions","A_TYPES__A_Stage_Status","A_TYPES__ComponentMetaKey","A_TYPES__ConceptAbstractions","A_TYPES__ConceptMetaKey"],"mappings":";AAwCO,IAAM,aAAN,MAEL;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAgCE,WAAA,CAAY,MAAA,GAA0C,EAAC,EAAG;AACtD,IAAA,IAAA,CAAK,KAAA,GAAQ,MAAA,CAAO,IAAA,IAAQ,IAAA,CAAK,WAAA,CAAY,IAAA;AAAA,EACjD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,IAAI,IAAA,GAAe;AACf,IAAA,OAAO,IAAA,CAAK,KAAA;AAAA,EAChB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;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A,MAAM,WAAA,GAA+C,WAAA,CAAY,GAAA,CAAI,MAAM,KAAK,EAAC;AAGjF,IAAA,WAAA,CAAY,cAAc,IAAI,MAAA,YAAkB,YAAA,GAAe,SAAS,IAAI,YAAA,CAAa,QAAQ,MAAM,CAAA;AAGvG,IAAA,WAAA,CAAY,GAAA,CAAI,QAAQ,WAAW,CAAA;AAGnC,IAAA,SAAA,CACK,IAAA,CAAK,MAAM,CAAA,CACX,GAAA;AAAA,MACG,OAAA;AAAA,MACA;AAAA,KACJ;AAAA,EACR,CAAA;AACJ","file":"index.mjs","sourcesContent":["import { A_TYPES__Fragment_Init, A_TYPES__Fragment_Serialized } from \"./A-Fragment.types\";\n\n\n/**\n * A_Fragment is a core architectural component that represents a singleton execution context\n * within the A-Concept framework. It serves as a shared memory container that can be passed\n * between Components, Entities, and Commands throughout the application pipeline.\n * \n * Key Features:\n * - Singleton pattern: Only one instance per fragment type per scope\n * - Meta storage: Built-in key-value storage for pipeline data\n * - Type-safe: Full TypeScript generics support for meta items and serialization\n * - Serializable: Can be converted to JSON for persistence or transmission\n * \n * @template _MetaItems - Type definition for the meta storage structure\n * @template _SerializedType - Type definition for the serialized output format\n * \n * @example\n * ```typescript\n * // Basic usage with typed meta\n * class UserFragment extends A_Fragment<{ userId: string; role: string }> {\n * constructor() {\n * super({ name: 'UserFragment' });\n * }\n * } \n * \n * // Custom serialization\n * class SessionFragment extends A_Fragment<\n * { sessionId: string; timestamp: number },\n * { name: string; sessionData: string }\n * > {\n * toJSON() {\n * return {\n * name: this.name,\n * sessionData: `${this.get('sessionId')}-${this.get('timestamp')}`\n * };\n * }\n * }\n * ```\n */\nexport class A_Fragment<\n _SerializedType extends A_TYPES__Fragment_Serialized = A_TYPES__Fragment_Serialized\n> {\n /**\n * The unique identifier/name for this fragment instance.\n * Used for identification and debugging purposes.\n */\n protected _name: string;\n\n /**\n * Creates a new A_Fragment instance.\n * \n * A_Fragment implements the singleton pattern for execution contexts, allowing\n * shared state management across different parts of the application pipeline.\n * Each fragment serves as a memory container that can store typed data and be\n * serialized for persistence or transmission.\n * \n * Key Benefits:\n * - Centralized state management for related operations\n * - Type-safe meta operations with full IntelliSense support\n * - Serialization support for data persistence \n * - Singleton pattern ensures consistent state within scope\n * \n * @param params - Initialization parameters\n * @param params.name - Optional custom name for the fragment (defaults to class name)\n * \n * @example\n * ```typescript\n * const fragment = new A_Fragment<{ userId: string }>({ \n * name: 'UserSessionFragment' \n * });\n * fragment.set('userId', '12345');\n * ```\n */\n constructor(params: Partial<A_TYPES__Fragment_Init> = {}) {\n this._name = params.name || this.constructor.name;\n }\n\n /**\n * Gets the fragment's unique name/identifier.\n * \n * @returns The fragment name\n */\n get name(): string {\n return this._name;\n }\n\n /**\n * Serializes the fragment to a JSON-compatible object.\n * \n * This method combines the fragment's name with all meta data to create\n * a serializable representation. The return type is determined by the\n * _SerializedType generic parameter, allowing for custom serialization formats.\n * \n * @returns A serialized representation of the fragment\n * \n * @example\n * ```typescript\n * const fragment = new A_Fragment<{ userId: string, role: string }>({\n * name: 'UserFragment'\n * });\n * fragment.set('userId', '12345');\n * fragment.set('role', 'admin');\n * \n * const json = fragment.toJSON();\n * // Result: { name: 'UserFragment', userId: '12345', role: 'admin' }\n * ```\n */\n toJSON(): _SerializedType {\n const result = {\n name: this.name,\n };\n\n return result as _SerializedType;\n }\n}","import {\n A_Stage,\n A_TYPES__A_StageStep,\n A_TYPES_StageExecutionBehavior\n} from \"@adaas/a-concept/a-stage\"\nimport { A_Entity } from \"@adaas/a-concept/a-entity\"\nimport {\n A_Container,\n A_TYPES__Container_Constructor\n} from \"@adaas/a-concept/a-container\"\nimport {\n A_Component,\n A_TYPES__Component_Constructor\n} from \"@adaas/a-concept/a-component\"\nimport { A_TYPES__Entity_Constructor } from \"@adaas/a-concept/a-entity\"\nimport { A_Feature } from \"./A-Feature.class\"\nimport {\n A_TYPES__Ctor,\n A_TYPES__Required\n} from \"@adaas/a-concept/types\";\nimport { A_Scope } from \"@adaas/a-concept/a-scope\"\nimport { A_TYPES__Error_Init } from \"@adaas/a-concept/a-error\"\n\n\n// ============================================================================\n// --------------------------- Primary Types ----------------------------------\n// ============================================================================\n/**\n * Feature constructor type\n * Uses the generic type T to specify the type of the feature\n */\nexport type A_TYPES__Feature_Constructor<T = A_Feature> = A_TYPES__Ctor<T>;\n/**\n * Feature initialization type\n */\nexport type A_TYPES__Feature_Init<T extends A_TYPES__FeatureAvailableComponents = A_TYPES__FeatureAvailableComponents> = A_TYPES__Feature_InitWithComponent<T> | A_TYPES__Feature_InitWithTemplate<T>\n/**\n * Feature initialization type using component\n */\nexport type A_TYPES__Feature_InitWithComponent<T extends A_TYPES__FeatureAvailableComponents = A_TYPES__FeatureAvailableComponents> = {\n /**\n * Feature Name\n */\n name: string,\n /**\n * The component from where the feature is calling. It's important for proper scoping. \n * Based on the component would be retrieved connected components, entities and containers.\n * \n * [!] Could be Container, Entity, Component or Command\n */\n component: T,\n\n /**\n * In case when Entity is not attached to the scope can be used to transparently show dependencies\n * \n * \n */\n scope?: A_Scope\n}\n/**\n * Feature initialization type using template\n */\nexport type A_TYPES__Feature_InitWithTemplate<T extends A_TYPES__FeatureAvailableComponents = A_TYPES__FeatureAvailableComponents> = {\n /**\n * Feature Name\n */\n name: string,\n /**\n * The scope from where to retrieve dependent components, entities and containers. \n * \n * [!] Important for proper scoping. \n */\n scope: A_Scope\n /**\n * The component from where the feature is calling. It's important for proper scoping. \n * Based on the component would be retrieved connected components, entities and containers.\n * \n * [!] Could be Container, Entity, Component or Command\n */\n component?: T,\n /**\n * Optional Feature template to be used instead of building it from decorators\n */\n template: Array<A_TYPES__FeatureDefineDecoratorTemplateItem>\n}\n\n/**\n * Feature serialized type\n */\nexport type A_TYPES__Feature_Serialized = {}\n\n\n/**\n * Feature lifecycle states\n */\nexport enum A_TYPES__FeatureState {\n /**\n * The feature has been initialized\n */\n INITIALIZED = \"INITIALIZED\",\n /**\n * The feature is currently being processed\n */\n PROCESSING = \"PROCESSING\",\n /**\n * The feature has been completed\n */\n COMPLETED = \"COMPLETED\",\n /**\n * The feature has been interrupted\n */\n INTERRUPTED = \"INTERRUPTED\",\n /**\n * The feature has failed\n */\n FAILED = \"FAILED\"\n}\n\n// ===========================================================================\n// --------------------------- Error Types ------------------------------------\n// ===========================================================================\n\nexport type A_TYPES__FeatureError_Init = {\n /**\n * Stage where the error occurred\n */\n stage?: A_Stage\n\n} & A_TYPES__Error_Init\n\n\n\n// ===========================================================================-\n// --------------------------- Available Types -------------------------------\n// ===========================================================================\n\n/**\n * A list of component where features can be Defined\n * \n * [!] On this component Feature Definition is Available\n */\nexport type A_TYPES__FeatureAvailableComponents = InstanceType<A_TYPES__FeatureAvailableConstructors>\n/**\n * A list of constructors where features can be Defined\n * \n * [!] On this component Feature Definition is Available\n */\nexport type A_TYPES__FeatureAvailableConstructors = A_TYPES__Component_Constructor\n | A_TYPES__Entity_Constructor\n | A_TYPES__Container_Constructor\n\n\n\n// ===========================================================================\n// --------------------------- Decorator Types -------------------------------\n// ===========================================================================\n// ---------------------------------------------------------------------------\n// --------------------Feature Define Decorator Types-------------------------\n// ---------------------------------------------------------------------------\n/**\n * Indicates a type of Feature Define decorator\n */\nexport type A_TYPES__FeatureDefineDecoratorDescriptor =\n TypedPropertyDescriptor<(...args: any[]) => any>\n | TypedPropertyDescriptor<(...args: any[]) => any>\n | TypedPropertyDescriptor<(...args: any[]) => Promise<any>>\n | TypedPropertyDescriptor<(...args: any[]) => Promise<any>>\n/**\n * Describes additional configuration properties to be used in Feature Define decorator\n */\nexport type A_TYPES__FeatureDefineDecoratorConfig = {\n /**\n * Feature name\n * \n * [!] By default uses the method name\n */\n name: string,\n /**\n * Indicates a default behavior of the feature. If true the feature will be automatically attached to the execution.\n * \n * [!] Before feature execution the method itself will be called to prepare the feature template\n * [!] Default is false\n */\n invoke: boolean,\n /**\n * Allows to add a default behavior or number of steps that will be part of the feature\n */\n template: Array<A_TYPES__FeatureDefineDecoratorTemplateItem>\n}\n/**\n * Describes a single template item used in Feature Define decorator\n */\nexport type A_TYPES__FeatureDefineDecoratorTemplateItem = A_TYPES__Required<Partial<A_TYPES__A_StageStep>, ['name', 'handler', 'dependency']>\n/**\n * Describes a target where Feature Define decorator can be applied\n * \n * [!] The feature can be defined on Container, Entity, Component or Command\n */\nexport type A_TYPES__FeatureDefineDecoratorTarget = A_Container\n | A_Entity\n | A_Component\n/**\n * A type of Meta information stored by Feature Define decorator\n * This information then uses by A-Context to build a proper feature template\n */\nexport type A_TYPES__FeatureDefineDecoratorMeta = {\n /**\n * Feature name\n * mainly it's a unique combination of the class name and method name\n */\n name: string,\n /**\n * Actual method name in the class\n */\n handler: string,\n /**\n * Indicates a default behavior of the feature. If true the feature will be automatically attached to the execution.\n * \n * [!] Before feature execution the method itself will be called to prepare the feature template\n * [!] Default is false\n */\n invoke: boolean,\n /**\n * Allows to add a default behavior or number of steps that will be part of the feature\n */\n template: Array<A_TYPES__A_StageStep>\n}\n// ---------------------------------------------------------------------------\n// --------------------Feature Extend Decorator Types-------------------------\n// ---------------------------------------------------------------------------\n/**\n * Descriptor type for A_Extend decorator\n */\nexport type A_TYPES__FeatureExtendDecoratorDescriptor =\n TypedPropertyDescriptor<() => any>\n | TypedPropertyDescriptor<(...args: any[]) => any>\n | TypedPropertyDescriptor<(...args: any[]) => Promise<any>>\n | TypedPropertyDescriptor<() => Promise<any>>\n/**\n * Target type for A_Extend decorator\n * \n * [!] Can be applied only on A-Components\n */\nexport type A_TYPES__FeatureExtendDecoratorTarget = A_Component | A_Container | A_Entity\n\n/**\n * Configuration type for A_Extend decorator\n * \n * This is an INPUT parameter provided by the user\n */\nexport type A_TYPES__FeatureExtendDecoratorConfig = {\n /**\n * Name of the container Lifecycle method to be extended.\n * \n * [!] If not provided will be used the name of the method.\n * [!!] If name contains \".\" dot it will be considered as a path to the method.\n */\n name: string,\n /**\n * Container class or container name uses to identify the proper container in case when the name is not unique.\n * \n * [!] If not provided will be applied to all containers with the same name.\n * [!!] By default uses OR to join all provided items. If you need more complex Logic, please use Regexp instead\n * \n * [!!!] In case if you need to exclude some containers, entities or components, please use \"exclude\" property\n * \n * Example:\n * \n * ```ts\n * @A_Feature.Extend({\n * name: 'load',\n * scope: {\n * include: [A_Container1, A_Entity1],\n * exclude: [A_Component1]\n * }\n * })\n * ```\n */\n scope: Array<A_TYPES__FeatureExtendDecoratorScopeItem> | Partial<A_TYPES__FeatureExtendDecoratorScopeConfig>,\n /**\n * The behavior of the method. \n * In case its async it will be executed independently from the main thread.\n * \n * [!] However, in case of sync, it will be executed in the main thread.in the order of the declaration.\n * \n */\n behavior: A_TYPES_StageExecutionBehavior\n /**\n * Allows to define the order of the execution of the method.\n * \n * [!] It applies for the following structure :'Component.methodName'\n * [!] In case the method has circular dependencies it will Throw an error.\n * \n * Example:\n * ```ts\n * @A_Feature.Extend({\n * name: 'load',\n * before: ['Component1.methodName', 'Component2.methodName2']\n * })\n * // OR\n * @A_Feature.Extend({\n * name: 'load',\n * before: /Component2\\..+/\n * })\n * ```\n */\n before: Array<string> | RegExp\n\n /**\n * Allows to define the order of the execution of the method.\n * \n * [!] It applies for the following structure :'Component.methodName'\n * [!] In case the method has circular dependencies it will Throw an error.\n * \n * Example:\n * ```ts\n * @A_Feature.Extend({\n * name: 'load',\n * after: ['Component1.methodName', 'Component2.methodName2']\n * })\n * // OR\n * @A_Feature.Extend({\n * name: 'load',\n * after: /Component2\\..+/\n * })\n * ```\n * \n */\n after: Array<string> | RegExp\n /**\n * Indicates whether to throw an error if the step fails.\n * \n * [!] By default is true\n */\n throwOnError: boolean\n\n /**\n * Allows to override particular steps in the feature sequence by provided names [Component].[Method] or by regexp\n */\n override: Array<string> | RegExp\n}\n/**\n * Scope item that can be used in A_Extend decorator configuration\n */\nexport type A_TYPES__FeatureExtendDecoratorScopeConfig = {\n /**\n * A list of components, entities or containers to include in the scope of the extension\n */\n include?: Array<A_TYPES__FeatureExtendDecoratorScopeItem>,\n /**\n * A list of components, entities or containers to exclude from the scope of the extension\n */\n exclude?: Array<A_TYPES__FeatureExtendDecoratorScopeItem>\n}\n/**\n * A single item that can be used in scope configuration\n */\nexport type A_TYPES__FeatureExtendDecoratorScopeItem = A_TYPES__Container_Constructor\n | A_TYPES__Entity_Constructor\n | A_TYPES__Component_Constructor\n\n\n\n// =======================================================================\n// --------------------------META TYPES-----------------------------------\n// =======================================================================\n/**\n * Meta type for A_Extend decorator\n */\nexport type A_TYPES__FeatureExtendDecoratorMeta = {\n /**\n * Original Feature Extension name\n * \n * [!] could be string or regex\n */\n name: string,\n /**\n * Actual method name in the class\n */\n handler: string\n /**\n * The behavior of the method. \n * In case its async it will be executed independently from the main thread.\n * \n * [!] However, in case of sync, it will be executed in the main thread.in the order of the declaration.\n * \n */\n behavior: A_TYPES_StageExecutionBehavior\n /**\n * Allows to define the order of the execution of the method.\n * \n * [!] In case the method has circular dependencies it will Throw an error.\n * \n */\n before: string\n /**\n * Allows to define the order of the execution of the method.\n * \n * [!] In case the method has circular dependencies it will Throw an error.\n * \n */\n after: string\n /**\n * Indicates whether to throw an error if the step fails.\n * \n * [!] By default is true\n */\n throwOnError: boolean,\n /**\n * Allows to override particular steps in the feature sequence by provided names [Component].[Method] or by regexp\n */\n override: string\n}\n\n\n","\n/**\n * A_FormatterHelper\n * \n * Helper class for formatting strings into different cases.\n */\nexport class A_FormatterHelper {\n /**\n * Convert string to UPPER_SNAKE_CASE\n * \n * @param str \n * @returns \n */\n static toUpperSnakeCase(str: string): string {\n return str\n .trim()\n .replace(/([a-z])([A-Z])/g, '$1_$2') // Handle camelCase\n .replace(/[^a-zA-Z0-9]+/g, '_') // Replace non-alphanumeric with underscores\n .replace(/_+/g, '_') // Collapse multiple underscores\n .replace(/^_|_$/g, '') // Remove leading/trailing underscores\n .toUpperCase();\n }\n /**\n * Convert string to camelCase\n * \n * @param str \n * @returns \n */\n static toCamelCase(str: string): string {\n return str\n .trim()\n .replace(/[^a-zA-Z0-9]+/g, ' ') // Replace non-alphanumeric with spaces\n .split(' ') // Split by spaces\n .filter(Boolean) // Remove empty items\n .map((part, index) => {\n if (index === 0) {\n return part.toLowerCase();\n }\n return part.charAt(0).toUpperCase() + part.slice(1).toLowerCase();\n })\n .join('');\n }\n /**\n * Convert string to PascalCase\n * \n * @param str \n * @returns \n */\n static toPascalCase(str: string): string {\n return str\n .trim()\n .replace(/([a-z])([A-Z])/g, '$1 $2') // Insert space before uppercase in camelCase\n .replace(/[^a-zA-Z0-9]+/g, ' ') // Replace non-alphanumeric with spaces\n .split(' ') // Split by spaces\n .filter(Boolean) // Remove empty items\n .map(part => part.charAt(0).toUpperCase() + part.slice(1).toLowerCase())\n .join('');\n }\n /**\n * Convert string to kebab-case\n * \n * @param str \n * @returns \n */\n static toKebabCase(str: string): string {\n return str\n // 1. Replace all non-alphanumeric (underscore, dot, etc.) with a space\n .replace(/[^a-zA-Z0-9]+/g, ' ')\n // 2. Insert space before any uppercase preceded by lowercase or digit\n .replace(/([a-z0-9])([A-Z])/g, '$1 $2')\n // 3. Trim spaces at both ends and replace remaining spaces with dashes\n .trim()\n .replace(/\\s+/g, '-')\n // 4. Lowercase everything\n .toLowerCase();\n }\n}","import { A_ID_TYPES__TimeId_Parts } from \"@adaas/a-concept/types\";\n\n\n\n\nexport class A_IdentityHelper {\n /**\n * Generates a short, time-based unique ID.\n * Encodes current time (ms since epoch) and random bits in base36.\n * Example: \"mb4f1g-7f9a1c\"\n */\n static generateTimeId(\n parts: A_ID_TYPES__TimeId_Parts = { timestamp: new Date(), random: Math.random().toString(36).slice(2, 8) }\n ): string {\n const time = parts.timestamp.getTime().toString(36); // base36-encoded timestamp\n const random = parts.random; // use provided random string\n return `${time}-${random}`;\n }\n\n /**\n * Parses a short ID back into its parts.\n * Returns an object with the original timestamp (as Date) and random string.\n */\n static parseTimeId(id: string): A_ID_TYPES__TimeId_Parts {\n const [timePart, randomPart] = id.split('-');\n const timestamp = new Date(parseInt(timePart, 36));\n return { timestamp, random: randomPart };\n }\n\n\n /**\n * Format a number with leading zeros to a fixed length\n * \n * @param number \n * @param maxZeros \n * @returns \n */\n static formatWithLeadingZeros(number, maxZeros = 10) {\n const formattedNumber = String(number).padStart(maxZeros + 1, '0');\n return formattedNumber.slice(-maxZeros);\n }\n\n /**\n * Remove leading zeros from a formatted number\n */\n static removeLeadingZeros(formattedNumber) {\n return String(Number(formattedNumber)); // Convert to number and back to string to remove leading zeros\n }\n\n /**\n * Generates a simple hash string from the input string.\n * \n * \n * @param input \n * @returns\n */\n static hashString(input: string): string {\n let hash = 0, i, chr;\n if (input.length === 0) return hash.toString();\n for (i = 0; i < input.length; i++) {\n chr = input.charCodeAt(i);\n hash = ((hash << 5) - hash) + chr;\n hash |= 0; // Convert to 32bit integer\n }\n return hash.toString();\n }\n\n\n}","/**\n * Basic TypeGuards that don't create circular dependencies\n * These are used by A_Error and other core classes\n */\nexport class A_BasicTypeGuards {\n\n /**\n * Check if value is a string\n * \n * @param value \n * @returns \n */\n static isString(value: any): value is string {\n return typeof value === 'string' || value instanceof String;\n }\n\n /**\n * Check if value is a number\n * \n * @param value \n * @returns \n */\n static isNumber(value: any): value is number {\n return typeof value === 'number' && isFinite(value);\n }\n\n /**\n * Check if value is a boolean\n * \n * @param value \n * @returns \n */\n static isBoolean(value: any): value is boolean {\n return typeof value === 'boolean';\n }\n\n /**\n * Check if value is an object\n * \n * @param value \n * @returns \n */\n static isObject<T = object>(value: any): value is T {\n return value !== null && typeof value === 'object' && !Array.isArray(value);\n }\n\n /**\n * Check if value is an array\n * \n * @param value \n * @returns \n */\n static isArray(value: any): value is any[] {\n return Array.isArray(value);\n }\n\n /**\n * Allows to check if the provided param is of constructor type.\n * \n * @param param \n * @returns \n */\n static isErrorConstructorType<T = any>(param: any): param is T {\n return !!param && A_BasicTypeGuards.isObject(param) && !(param instanceof Error) && \"title\" in param;\n }\n\n static isErrorSerializedType<T = any>(param: any): param is T {\n return !!param && A_BasicTypeGuards.isObject(param) && !(param instanceof Error) && \"aseid\" in param && A_BasicTypeGuards.isString((param as any).aseid);\n }\n\n /**\n * Check if scope is of type A_Scope instance\n * \n * @param scope \n * @returns \n */\n static isScopeInstance(scope: any): boolean {\n // Basic check without importing A_Scope to avoid circular dependency\n return !!scope && typeof scope === 'object' && 'name' in scope && 'aseid' in scope;\n }\n}","import {\n A_TYPES__ASEID_Constructor,\n A_TYPES__ASEID_JSON\n} from \"./ASEID.types\";\nimport { A_IdentityHelper} from \"@adaas/a-concept/helpers/A_Identity.helper\";\nimport { A_BasicTypeGuards} from \"@adaas/a-concept/helpers/A_BasicTypeGuards.helper\";\nimport { A_Context } from \"@adaas/a-concept/a-context\";\n// import { ASEID_Error } from \"./ASEID.error\";\nimport { A_TYPES__Required } from \"@adaas/a-concept/types\";\n\n\nexport class ASEID {\n\n\n //==========================================================================\n //============================= STATIC METHODS ===========================\n //==========================================================================\n /**\n * ASEID Regular Expression\n */\n static readonly regexp: RegExp = new RegExp(`^[a-z|A-Z|0-9|-]+@[a-z|A-Z|0-9|\\-]+:[a-z|A-Z|0-9|\\-]+:[a-z|A-Z|0-9|\\\\.|-]+(@v[0-9|\\\\.]+|@lts)?$`)\n /**\n * Tests if the identity string is an ASEID\n * \n * @param identity \n * @returns \n */\n static isASEID(identity: string): boolean {\n return this.regexp.test(identity)\n }\n\n\n static compare(aseid1: ASEID | string | undefined, aseid2: ASEID | string | undefined): boolean {\n\n if (!aseid1 || !aseid2) {\n return false;\n }\n\n if (A_BasicTypeGuards.isString(aseid1) && this.isASEID(aseid1) === false) {\n throw new Error(`Invalid ASEID format provided: ${aseid1}`);\n }\n\n if (A_BasicTypeGuards.isString(aseid2) && this.isASEID(aseid2) === false) {\n throw new Error(`Invalid ASEID format provided: ${aseid2}`);\n }\n\n const aseidObj1 = aseid1 instanceof ASEID ? aseid1 : new ASEID(aseid1);\n const aseidObj2 = aseid2 instanceof ASEID ? aseid2 : new ASEID(aseid2);\n\n return aseidObj1.toString() === aseidObj2.toString();\n }\n\n\n // ====================================================================\n // ==================== Hidden ASEID Information ======================\n // ====================================================================\n /**\n * Concept for the ASEID\n * Generally it is the application name or code, should correspond to the concept where the entity is used\n * Could be ID or ASEID\n */\n private _concept!: string;\n /**\n * Entity Scope the primary location of the resource \n * Organization, or organization Unit\n * Could be ID or ASEID\n * \n */\n private _scope!: string\n /**\n * Entity Type the type of the resource\n */\n private _entity!: string\n /**\n * Entity ID the unique identifier of the resource\n */\n private _id!: string\n /**\n * Version of the entity (optional)\n */\n private _version?: string\n /**\n * Shard of the entity (optional)\n */\n private _shard?: string\n\n\n\n\n\n\n /**\n * ASEID is a structured identifier for entities in the A-Concept system. \n * using the format:\n * A - A-Concept\n * S - System \n * E - Entity\n * I - Identifier\n * D - iDentifier\n * \n * Structure: CONCEPT_NAME + @ + SCOPE + : ENTITY_NAME + : + ID + @ + VERSION \n * \n * Example:\n * - root@core:usr:0000000001\n * \n * [!] Concept is optional, if not provided will be used the current concept name\n * [!] Scope is optional, if not provided will be used the root scope of the current concept\n * [!] Version is optional, if not provided will be considered as latest version\n * \n * @param aseid - ASEID string representation or ASEID components as object\n */\n constructor(\n /**\n * ASEID string representation\n */\n aseid: string\n )\n constructor(\n /**\n * ASEID components as object \n */\n props: A_TYPES__Required<Partial<A_TYPES__ASEID_Constructor>, ['id', 'entity']>\n )\n constructor(param1: string | A_TYPES__Required<Partial<A_TYPES__ASEID_Constructor>, ['id', 'entity']>) {\n this.verifyInput(param1);\n\n const initializer = this.getInitializer(param1);\n // the returned initializer is already bound to `this` (we used .bind(this)),\n // so calling it will run the appropriate logic on this instance:\n initializer.call(this, param1);\n }\n\n /**\n * Getters for ASEID components\n */\n get concept(): string {\n return this._concept || A_Context.concept;\n }\n /**\n * Get the scope of the ASEID\n */\n get scope(): string {\n return this._scope || A_Context.root.name;\n }\n /**\n * Get the entity of the ASEID\n */\n get entity(): string {\n return this._entity;\n }\n /**\n * Get the id of the ASEID\n */\n get id(): string {\n return this._id;\n }\n /**\n * Get the version of the ASEID (if any)\n */\n get version(): string | undefined {\n return this._version;\n }\n /**\n * Get the shard of the ASEID (if any)\n */\n get shard(): string | undefined {\n return this._shard;\n }\n\n /**\n * Get the hash of the ASEID, Unique identifier based on the ASEID string\n * Useful when aseid details should not be exposed directly\n */\n get hash(): string {\n return A_IdentityHelper.hashString(this.toString());\n }\n\n /**\n * get Internal Initializer based on the type of the parameter provided\n * \n * @param param1 \n * @returns \n */\n private getInitializer(\n param1: string | A_TYPES__Required<Partial<A_TYPES__ASEID_Constructor>, ['id', 'entity']>\n ): (param1: any) => void | (() => void) {\n switch (true) {\n case A_BasicTypeGuards.isString(param1):\n return this.fromString;\n\n case A_BasicTypeGuards.isObject<A_TYPES__ASEID_Constructor>(param1):\n return this.fromObject;\n\n default:\n throw new Error(\n 'Invalid parameters provided to ASEID constructor'\n );\n }\n }\n\n\n /**\n * Initialize ASEID from string\n * \n * @param param1 \n */\n private fromString(param1: string) {\n const [concept, body, version] = param1.split('@');\n const [scope, entity, idCandidate] = body.split(':');\n\n const shard = idCandidate.includes('.') ? idCandidate.split('.')[0] : undefined;\n const id = idCandidate.includes('.') ? idCandidate.split('.')[1] : idCandidate;\n\n this._concept = concept || A_Context.root.name;\n this._scope = scope || A_Context.root.name;\n this._entity = entity;\n this._id = id;\n this._version = version;\n this._shard = shard;\n }\n /**\n * Initialize ASEID from object\n * \n * @param param1 \n */\n private fromObject(param1: A_TYPES__Required<Partial<A_TYPES__ASEID_Constructor>, ['id', 'entity']>) {\n this._concept = param1.concept\n ? ASEID.isASEID(param1.concept)\n ? new ASEID(param1.concept).id\n : param1.concept\n : A_Context.concept;\n\n this._scope = param1.scope\n ? A_BasicTypeGuards.isNumber(param1.scope)\n ? A_IdentityHelper.formatWithLeadingZeros(param1.scope) :\n ASEID.isASEID(param1.scope)\n ? new ASEID(param1.scope).id\n : param1.scope\n : A_Context.root.name\n\n this._entity = param1.entity;\n\n this._id = A_BasicTypeGuards.isNumber(param1.id)\n ? A_IdentityHelper.formatWithLeadingZeros(param1.id)\n : param1.id;\n\n this._version = param1.version;\n this._shard = param1.shard;\n }\n\n\n /**\n * String representation of the ASEID\n * \n * @returns \n */\n toString(): string {\n return `${this.concept}@${this.scope}:${this.entity}:${this.shard ? (this.shard + '.' + this.id) : this.id}${this.version ? ('@' + this.version) : ''}`\n }\n\n /**\n * JSON representation of the ASEID\n * \n * @returns \n */\n toJSON(): A_TYPES__ASEID_JSON {\n return {\n concept: this._concept,\n scope: this._scope,\n entity: this._entity,\n id: this._id,\n version: this._version,\n shard: this._shard\n }\n }\n\n // --------------------------------------------------------------------------\n // ----------------------- PROTECTED HELPERS --------------------------------\n // --------------------------------------------------------------------------\n\n\n protected verifyInput(param1: string | A_TYPES__Required<Partial<A_TYPES__ASEID_Constructor>, ['id', 'entity']>) {\n\n switch (true) {\n // 1) check for string and validate it as ASEID\n case A_BasicTypeGuards.isString(param1) && !ASEID.isASEID(param1):\n throw new Error( 'Invalid ASEID format provided')\n\n // 2) check for object and validate required fields\n case A_BasicTypeGuards.isObject<A_TYPES__ASEID_Constructor>(param1) && !param1.id:\n throw new Error('ASEID id is required')\n // 3) check for object and validate required fields\n case A_BasicTypeGuards.isObject<A_TYPES__ASEID_Constructor>(param1) && !param1.entity:\n throw new Error('ASEID entity is required')\n\n }\n }\n}","\n\n\nexport const A_CONSTANTS__ERROR_CODES = {\n UNEXPECTED_ERROR: 'A-Error Unexpected Error',\n VALIDATION_ERROR: 'A-Error Validation Error',\n} as const;\n\n\n\nexport const A_CONSTANTS__ERROR_DESCRIPTION = 'If you see this error please let us know.'","export const A_CONSTANTS__DEFAULT_ENV_VARIABLES = {\n // ----------------------------------------------------------\n // A-Concept Core Environment Variables\n // ----------------------------------------------------------\n // These environment variables are used by A-Concept core to configure the application\n // ----------------------------------------------------------\n /**\n * Name of the application\n * \n * DEFAULT value is 'a-concept'\n * \n * [!] Provided name will be used for all aseids in the application by default\n */\n A_CONCEPT_NAME: 'A_CONCEPT_NAME',\n /**\n * Root scope of the application\n * \n * DEFAULT value is 'root'\n * \n * [!] Provided name will be used for all aseids in the application by default\n */\n A_CONCEPT_ROOT_SCOPE: 'A_CONCEPT_ROOT_SCOPE',\n /**\n * Environment of the application e.g. development, production, staging\n */\n A_CONCEPT_ENVIRONMENT: 'A_CONCEPT_ENVIRONMENT',\n /**\n * Runtime environment of the application e.g. browser, node\n */\n A_CONCEPT_RUNTIME_ENVIRONMENT: 'A_CONCEPT_RUNTIME_ENVIRONMENT',\n /**\n * Root folder of the application\n * [!] Automatically set by A-Concept when the application starts\n */\n A_CONCEPT_ROOT_FOLDER: 'A_CONCEPT_ROOT_FOLDER',\n /**\n * Allows to define a default error description for errors thrown without a description\n */\n A_ERROR_DEFAULT_DESCRIPTION: 'A_ERROR_DEFAULT_DESCRIPTION',\n} as const\n\n\n//should be an array\nexport type A_TYPES__ConceptENVVariables = (typeof A_CONSTANTS__DEFAULT_ENV_VARIABLES)[keyof typeof A_CONSTANTS__DEFAULT_ENV_VARIABLES][];\n\n\nexport const A_CONSTANTS__DEFAULT_ENV_VARIABLES_ARRAY = [\n A_CONSTANTS__DEFAULT_ENV_VARIABLES.A_CONCEPT_NAME,\n A_CONSTANTS__DEFAULT_ENV_VARIABLES.A_CONCEPT_ROOT_SCOPE,\n A_CONSTANTS__DEFAULT_ENV_VARIABLES.A_CONCEPT_ENVIRONMENT,\n A_CONSTANTS__DEFAULT_ENV_VARIABLES.A_CONCEPT_RUNTIME_ENVIRONMENT,\n A_CONSTANTS__DEFAULT_ENV_VARIABLES.A_CONCEPT_ROOT_FOLDER,\n\n A_CONSTANTS__DEFAULT_ENV_VARIABLES.A_ERROR_DEFAULT_DESCRIPTION,\n] as const;\n\n","import { A_TYPES__ContextEnvironment } from \"@adaas/a-concept/a-context\";\nimport { A_CONSTANTS__DEFAULT_ENV_VARIABLES_ARRAY } from \"../constants/env.constants\";\n\nexport class A_CONCEPT_BASE_ENV {\n // ----------------------------------------------------------\n // A-Concept Core Environment Variables\n // ----------------------------------------------------------\n // These environment variables are used by A-Concept core to configure the application\n // ----------------------------------------------------------\n /**\n * Name of the application\n * \n * DEFAULT value is 'a-concept'\n * \n * [!] Provided name will be used for all aseids in the application by default\n */\n static get A_CONCEPT_NAME() {\n return \"a-concept\";\n }\n /**\n * Root scope of the application\n * \n * DEFAULT value is 'root'\n * \n * [!] Provided name will be used for all aseids in the application by default\n */\n static get A_CONCEPT_ROOT_SCOPE() {\n return \"root\";\n }\n /**\n * Environment of the application e.g. development, production, staging\n */\n static get A_CONCEPT_ENVIRONMENT() {\n return \"production\";\n }\n /**\n * Runtime environment of the application e.g. browser, node\n */\n static get A_CONCEPT_RUNTIME_ENVIRONMENT(): A_TYPES__ContextEnvironment {\n return \"unknown\";\n }\n\n /**\n * Root folder of the application\n * [!] Automatically set by A-Concept when the application starts\n */\n static get A_CONCEPT_ROOT_FOLDER() {\n return \"/app\";\n }\n\n /**\n * Allows to define a default error description for errors thrown without a description\n */\n static get A_ERROR_DEFAULT_DESCRIPTION() {\n return \"If you see this error please let us know.\";\n }\n\n /**\n * Generic getter for environment variables. This allows to access environment variables dynamically by name. It will return undefined if the variable does not exist.\n * \n * @param name \n * @returns \n */\n static get(name: string) {\n return (this as any)[name];\n }\n /**\n * Generic setter for environment variables. This allows to set environment variables dynamically by name.\n * \n * @param name \n * @param value \n */\n static set(name: string, value: string) {\n (this as any)[name] = value;\n }\n\n /**\n * This method returns all the environment variables that are available in the application. It combines the variables from process.env and the default environment variables defined in A_CONSTANTS__DEFAULT_ENV_VARIABLES_ARRAY.\n * \n * @returns \n */\n static getAll<T extends Record<string, any>>(): T {\n return {} as T;\n }\n\n /**\n * This method returns all the keys of the environment variables that are available in the application. It combines the keys from process.env and the default environment variables defined in A_CONSTANTS__DEFAULT_ENV_VARIABLES_ARRAY.\n * \n * @returns \n */\n static getAllKeys<T extends Array<string>>(): T {\n return [] as any as T;\n }\n\n} \n","import { A_CONSTANTS__DEFAULT_ENV_VARIABLES, A_CONSTANTS__DEFAULT_ENV_VARIABLES_ARRAY } from \"@adaas/a-concept/constants/env.constants\";\nimport { A_TYPES__ContextEnvironment } from \"@adaas/a-concept/a-context\";\nimport { A_CONCEPT_BASE_ENV } from \"./env.base\";\n\nexport class A_CONCEPT_ENV extends A_CONCEPT_BASE_ENV {\n // ----------------------------------------------------------\n // A-Concept Core Environment Variables\n // ----------------------------------------------------------\n // These environment variables are used by A-Concept core to configure the application\n // ----------------------------------------------------------\n /**\n * Name of the application\n * \n * DEFAULT value is 'a-concept'\n * \n * [!] Provided name will be used for all aseids in the application by default\n */\n static get A_CONCEPT_NAME() {\n return process.env[A_CONSTANTS__DEFAULT_ENV_VARIABLES.A_CONCEPT_NAME] || super.A_CONCEPT_NAME\n }\n /**\n * Root scope of the application\n * \n * DEFAULT value is 'root'\n * \n * [!] Provided name will be used for all aseids in the application by default\n */\n static get A_CONCEPT_ROOT_SCOPE() {\n return process.env[A_CONSTANTS__DEFAULT_ENV_VARIABLES.A_CONCEPT_ROOT_SCOPE] || super.A_CONCEPT_ROOT_SCOPE;\n }\n /**\n * Environment of the application e.g. development, production, staging\n */\n static get A_CONCEPT_ENVIRONMENT() {\n return process.env[A_CONSTANTS__DEFAULT_ENV_VARIABLES.A_CONCEPT_ENVIRONMENT] || super.A_CONCEPT_ENVIRONMENT;\n }\n /**\n * Runtime environment of the application e.g. browser, node\n */\n static get A_CONCEPT_RUNTIME_ENVIRONMENT(): A_TYPES__ContextEnvironment {\n return 'server';\n }\n\n /**\n * Root folder of the application\n * [!] Automatically set by A-Concept when the application starts\n */\n static get A_CONCEPT_ROOT_FOLDER() {\n return process.env[A_CONSTANTS__DEFAULT_ENV_VARIABLES.A_CONCEPT_ROOT_FOLDER] || process.cwd();\n }\n\n /**\n * Allows to define a default error description for errors thrown without a description\n */\n static get A_ERROR_DEFAULT_DESCRIPTION() {\n return process.env[A_CONSTANTS__DEFAULT_ENV_VARIABLES.A_ERROR_DEFAULT_DESCRIPTION] || super.A_ERROR_DEFAULT_DESCRIPTION;\n }\n\n static get(name: string) {\n return process.env[name] || (this as A_CONCEPT_ENV)[name as keyof typeof A_CONCEPT_ENV];\n }\n\n static set(name: string, value: string): void {\n process.env[name] = value;\n }\n\n\n static getAll<T extends Record<string, any>>(): T {\n const allEnv: Record<string, any> = {};\n\n // Get all environment variables from process.env\n for (const key in process.env) {\n allEnv[key] = process.env[key];\n }\n\n // Get all default environment variables defined in A_CONSTANTS__DEFAULT_ENV_VARIABLES_ARRAY\n A_CONSTANTS__DEFAULT_ENV_VARIABLES_ARRAY.forEach((variable) => {\n allEnv[variable] = this.get(variable);\n });\n\n return allEnv as T\n }\n\n static getAllKeys<T extends Array<string>>(): T {\n return [\n ...Object.keys(process.env),\n ...A_CONSTANTS__DEFAULT_ENV_VARIABLES_ARRAY\n ] as T;\n }\n} \n","import { A_Context } from '@adaas/a-concept/a-context';\nimport {\n A_TYPES__Error_Init,\n A_TYPES__Error_Serialized\n} from './A_Error.types';\nimport {\n A_CONSTANTS__ERROR_CODES,\n A_CONSTANTS__ERROR_DESCRIPTION\n} from './A_Error.constants';\nimport { A_FormatterHelper } from '@adaas/a-concept/helpers/A_Formatter.helper';\nimport { A_BasicTypeGuards } from '@adaas/a-concept/helpers/A_BasicTypeGuards.helper';\nimport { ASEID } from '@adaas/a-concept/aseid';\nimport { A_CONCEPT_ENV } from '@adaas/a-concept/env';\n\n\nexport class A_Error<\n _ConstructorType extends A_TYPES__Error_Init = A_TYPES__Error_Init,\n _SerializedType extends A_TYPES__Error_Serialized = A_TYPES__Error_Serialized\n> extends Error {\n // ====================================================================\n // ================== Static A-Error Information ======================\n // ====================================================================\n /**\n * Error Identifier that corresponds to the class name\n */\n static get entity(): string {\n return A_FormatterHelper.toKebabCase(this.name);\n }\n /**\n * DEFAULT Namespace of the error from environment variable A_CONCEPT_NAMESPACE\n * \n * [!] If environment variable is not set, it will default to 'a-concept'\n */\n static get concept(): string {\n return A_Context.concept;\n }\n /**\n * DEFAULT Scope of the entity from environment variable A_CONCEPT_DEFAULT_SCOPE\n * \n * [!] If environment variable is not set, it will default to 'core'\n * [!] Scope is an application specific identifier that can be used to group entities together\n * [!] e.g. 'default', 'core', 'public', 'internal', etc\n */\n static get scope(): string {\n return A_Context.root.name;\n }\n\n // ====================================================================\n // ================== Hidden A-Error Information ======================\n // ====================================================================\n /**\n * ASEID of the error instance\n */\n protected _aseid!: ASEID;\n /**\n * Title of the error\n */\n protected _title!: string;\n /**\n * Possible Scope if needed to identify the error by it's execution environment\n */\n protected _scope?: string;\n /**\n * Unique code representing the type of error\n */\n protected _code?: string;\n /**\n * Detailed description of the error\n */\n protected _description?: string;\n /**\n * Original Error if any\n */\n protected _originalError?: Error | any\n /**\n * Link to the documentation or support page for the error\n */\n protected _link?: string;\n\n\n\n /**\n * A_Error is a custom error class for A_Concept framework.\n * This error allows to have more structured error handling.\n * Each error has a unique code, description and a link to the documentation.\n * \n * Example of usage: \n * ```typescript\n * \n * // 1) all parameters will be used as provided\n * throw new A_Error({\n * message: 'User not found',\n * code: 'USER_NOT_FOUND',\n * description: 'The user with the given ID was not found.',\n * link: 'https://support.adaas.org/error/USER_NOT_FOUND'\n * });\n * \n * // or\n * // 2) only message is provided, other parameters will be set to default values:\n * // - code: 'user-not-found' (kebab-case of the message)\n * // - description: 'User not found' (same as message)\n * // - link: Empty\n * throw new A_Error('User not found');\n * \n * // or\n * // 3) Provided Message and Description, other parameters will be set to default values:\n * // - code: 'user-not-found' (kebab-case of the message)\n * // - description: 'The user with the given ID was not found.' (as provided)\n * // - link: Empty\n * throw new A_Error('User not found', 'The user with the given ID was not found.');\n * \n * \n * ```\n * [!] Note: The behavior of A_Error is similar to the A_Entity however it cannot have own A_Features.\n * [!] Note: This class can be inherited to create custom error classes.\n * \n * @param message \n */\n constructor(\n /**\n * A_Error Constructor params\n */\n params: _ConstructorType\n )\n constructor(\n /**\n * Error message\n */\n message: string\n )\n constructor(\n /**\n * Original JS Error\n */\n error: Error\n )\n constructor(\n /**\n * Original JS Error\n */\n error: unknown\n )\n constructor(\n /**\n * Error message\n */\n title: string,\n /**\n * Detailed description of the error\n */\n description: string\n )\n constructor(\n param1: _ConstructorType | Error | string | A_Error | any,\n param2?: string\n ) {\n // to prevent errors accumulation in the stack trace it returns the original error if provided param1 is A_Error\n switch (true) {\n case param1 instanceof A_Error:\n return param1 as A_Error<_ConstructorType, _SerializedType>;\n\n case param1 instanceof Error:\n super(param1.message);\n break;\n\n case A_BasicTypeGuards.isErrorSerializedType<_SerializedType>(param1):\n super(param1.message);\n break;\n\n case A_BasicTypeGuards.isErrorConstructorType<_ConstructorType>(param1) && 'description' in param1:\n super(`[${param1.title}]: ${param1.description}`);\n break;\n\n case A_BasicTypeGuards.isErrorConstructorType<_ConstructorType>(param1) && !('description' in param1):\n super(param1.title);\n break;\n\n case A_BasicTypeGuards.isString(param1) && !param2:\n super(param1);\n break;\n\n case A_BasicTypeGuards.isString(param1) && !!param2:\n super(`[${param1}]: ${param2}`);\n break;\n\n default:\n super('An unknown error occurred.');\n }\n\n const initializer = this.getInitializer(param1, param2);\n // the returned initializer is already bound to `this` (we used .bind(this)),\n // so calling it will run the appropriate logic on this instance:\n initializer.call(this, param1, param2);\n }\n\n\n\n // ====================================================================\n // ================== Public A-Error Information ======================\n // ====================================================================\n /**\n * Returns the ASEID of the error instance\n */\n get aseid(): ASEID {\n return this._aseid;\n }\n /**\n * Returns the title of the error\n * \n * Example: 'User not found', 'Validation error', 'Unauthorized access', etc.\n * \n * [!] Note: This title should be short and concise, less than 60 characters\n * [!] Note: If title exceeds 60 characters, there would be an error thrown\n * [!] Note: This title is intended to be human-readable and can be displayed in UI or logs\n */\n get title(): string {\n return this._title;\n }\n /**\n * Returns an Error message what is a brief title of the error\n * \n */\n get message(): string {\n return super.message;\n }\n /**\n * Returns a unique code representing the type of error\n * \n * If code is not provided, it will generate a kebab-case of the message\n * \n * Example: 'validation-error', 'not-found', 'user-not-found', 'unauthorized' etc.\n * \n * [!] Note: It is recommended to use kebab-case for error codes\n * [!] Note: If not provided would be used a kebab-case message of the error\n */\n get code(): string {\n return this._code || A_FormatterHelper.toKebabCase(this.title);\n }\n /**\n * Returns the type of the error which corresponds to the static entity of the class\n * \n * Example: 'a-error', 'validation-error', 'not-found-error', 'user-error', etc.\n * \n * Defaults to the kebab-case of the class name\n * \n * [!] Note: naming ad separation are fully dependent on the architecture of the application\n * [!] Note: It is recommended to use kebab-case for error types\n * [!] Note: This type is intended to group similar errors together\n */\n get type() {\n return (this.constructor as typeof A_Error).entity;\n }\n /**\n * Returns a link with possible documentation or support page for the error\n * If link is not provided, it will generate a link based on the ASEID of the error that points to the A-Concept support page\n * \n * Example: https://adaas.support/a-concept/errors/{ASEID}\n * \n * [!] Note: ASEID is generated based on the static properties of the class (concept, scope, entity) and the code of the error\n */\n get link() {\n if (this._link)\n return this._link;\n\n const url = new URL(`https://adaas.support/a-concept/errors/${this.aseid.toString()}`);\n\n return url.toString();\n }\n /**\n * The scope name of the error instance\n * \n * If scope is not provided, it will use the static scope of the class\n * \n * [!] Note: Scope is an application specific identifier that can be used to group entities together\n * [!] e.g. 'default', 'core', 'public', 'internal', etc\n */\n get scope() {\n return this._aseid.scope\n }\n /**\n * A detailed description of the error\n * If description is not provided, it will use the environment variable A_ERROR_DEFAULT_DESCRIPTION or a generic message\n * \n * Example: 'The user with the given ID was not found.', 'The provided data is invalid.', 'You do not have permission to access this resource.', etc.\n * \n * [!] Note: This description is intended to provide more context about the error and can be used for debugging or logging purposes\n */\n get description(): string {\n return this._description || String(A_CONCEPT_ENV.A_ERROR_DEFAULT_DESCRIPTION) || A_CONSTANTS__ERROR_DESCRIPTION;\n }\n /**\n * Returns the original error if any\n * \n * This can be useful for debugging purposes to see the original stack trace or error message\n * \n * [!] Note: Original error is optional and may not be present in all cases\n */\n get originalError(): Error | any | undefined {\n return this._originalError;\n }\n\n\n\n /**\n * Determines which initializer method to use based on the type of the first parameter.\n * \n * @param param1 \n * @returns\n */\n protected getInitializer(\n param1: _ConstructorType | Error | string | any,\n param2?: string\n ): (param1: any, param2: any) => void | (() => void) {\n switch (true) {\n\n case A_BasicTypeGuards.isString(param1) && !param2:\n return this.fromMessage;\n\n case A_BasicTypeGuards.isString(param1) && !!param2:\n return this.fromTitle;\n\n case param1 instanceof Error:\n return this.fromError;\n\n case A_BasicTypeGuards.isErrorSerializedType<_SerializedType>(param1):\n return this.fromJSON;\n\n case A_BasicTypeGuards.isErrorConstructorType<_ConstructorType>(param1):\n return this.fromConstructor;\n\n default: {\n throw new A_Error(\n A_CONSTANTS__ERROR_CODES.VALIDATION_ERROR,\n 'Invalid parameters provided to A_Error constructor'\n );\n }\n }\n }\n\n /**\n * Initializes the A_Error instance from a standard Error object.\n * \n * @param error \n */\n protected fromError(error: Error): void {\n this._title = A_CONSTANTS__ERROR_CODES.UNEXPECTED_ERROR;\n\n this._aseid = new ASEID({\n concept: (this.constructor as typeof A_Error).concept,\n scope: (this.constructor as typeof A_Error).scope,\n entity: (this.constructor as typeof A_Error).entity,\n id: this.code\n });\n\n this._originalError = error;\n }\n /**\n * Initializes the A_Error instance from a message.\n * \n * @param title \n * @param description \n */\n protected fromMessage(message: string): void {\n this._title = A_CONSTANTS__ERROR_CODES.UNEXPECTED_ERROR;\n\n this._aseid = new ASEID({\n concept: (this.constructor as typeof A_Error).concept,\n scope: this._scope || (this.constructor as typeof A_Error).scope,\n entity: (this.constructor as typeof A_Error).entity,\n id: this.code\n });\n\n this._link = undefined;\n this._originalError = undefined;\n }\n /**\n * Initializes the A_Error instance from a serialized object.\n * \n * @param serialized\n */\n protected fromJSON(serialized: _SerializedType): void {\n this._aseid = new ASEID(serialized.aseid);\n super.message = serialized.message;\n this._title = serialized.title;\n this._code = serialized.code;\n this._scope = serialized.scope;\n this._description = serialized.description;\n // Note: originalError is deserialized as message only\n this._originalError = serialized.originalError ? new A_Error(serialized.originalError) : undefined;\n this._link = serialized.link;\n }\n\n\n\n fromTitle(title: string, description: string): void {\n this.validateTitle(title);\n\n this._title = title;\n this._description = description;\n\n this._aseid = new ASEID({\n concept: (this.constructor as typeof A_Error).concept,\n scope: this._scope || (this.constructor as typeof A_Error).scope,\n entity: (this.constructor as typeof A_Error).entity,\n id: this.code\n });\n\n this._link = undefined;\n this._originalError = undefined;\n }\n /**\n * Initializes the A_Error instance from a constructor parameters object.\n * \n * @param params \n */\n protected fromConstructor(params: _ConstructorType): void {\n this.validateTitle(params.title);\n\n this._title = params.title;\n this._code = params.code;\n this._scope = params.scope ? (A_BasicTypeGuards.isScopeInstance(params.scope) ? (params.scope as any).name : params.scope) : undefined;\n\n this._aseid = new ASEID({\n concept: (this.constructor as typeof A_Error).concept,\n scope: this._scope || (this.constructor as typeof A_Error).scope,\n entity: (this.constructor as typeof A_Error).entity,\n id: this.code\n });\n\n this._description = params.description;\n this._link = params.link;\n\n // Handle originalError: if it's an A_Error, we should trace back to the root cause\n // to avoid infinite nesting of A_Error instances\n if (params.originalError instanceof A_Error) {\n // Find the root original error by traversing the chain\n let rootError = params.originalError;\n while (rootError.originalError instanceof A_Error) {\n rootError = rootError.originalError;\n }\n // Set the root cause as the original error\n this._originalError = rootError.originalError || rootError;\n } else {\n this._originalError = params.originalError;\n }\n }\n\n /**\n * Serializes the A_Error instance to a plain object.\n * \n * \n * @returns \n */\n toJSON(): _SerializedType {\n return {\n aseid: this.aseid.toString(),\n title: this.title,\n code: this.code,\n type: this.type,\n message: this.message,\n link: this.link,\n scope: this.scope,\n description: this.description,\n originalError: this.originalError?.message\n } as _SerializedType;\n }\n\n\n\n // --------------------------------------------------------------------------\n // ----------------------- PROTECTED HELPERS --------------------------------\n // --------------------------------------------------------------------------\n /**\n * Checks if the provided title exceeds 60 characters.\n * If it does, throws a validation A_Error.\n * \n * @param title \n */\n protected validateTitle(title: string) {\n if (title.length > 60) {\n throw new A_Error(\n A_CONSTANTS__ERROR_CODES.VALIDATION_ERROR,\n 'A-Error title exceeds 60 characters limit.'\n );\n }\n if (title.length === 0) {\n throw new A_Error(\n A_CONSTANTS__ERROR_CODES.VALIDATION_ERROR,\n 'A-Error title cannot be empty.'\n );\n }\n }\n}\n\n\n\n\n\n// message = title + description for better printing in the console\n// description = detailed information about the error\n// code = kebabcase (title)\n\n","import { A_Error } from \"@adaas/a-concept/a-error\";\n\n\n\nexport class A_EntityError extends A_Error {\n\n /**\n * Error code for validation errors.\n */\n static readonly ValidationError = 'A-Entity Validation Error';\n\n}","import { A_Context } from \"@adaas/a-concept/a-context\";\nimport {\n A_TYPES__Entity_Serialized,\n A_TYPES__Entity_Init,\n A_TYPES__IEntity,\n} from \"./A-Entity.types\";\nimport { A_Scope } from \"@adaas/a-concept/a-scope\";\nimport { A_FormatterHelper} from \"@adaas/a-concept/helpers/A_Formatter.helper\";\nimport { A_IdentityHelper} from \"@adaas/a-concept/helpers/A_Identity.helper\";\nimport {\n ASEID,\n A_TYPES__ASEID_Constructor\n} from \"@adaas/a-concept/aseid\";\nimport { A_EntityError } from \"./A-Entity.error\";\nimport { A_Feature } from \"@adaas/a-concept/a-feature\";\n\n\n/**\n * A_Entity is another abstraction that describes all major participants in the system business logic.\n * Each Entity should have a clear definition and a clear set of responsibilities. \n * However, entity may hide some of its responsibilities behind the interface to prevent overload. \n * \n * Each entity should be connected to the ContextFragment (Scope) and should be able to communicate with other entities.\n */\nexport class A_Entity<\n _ConstructorType extends A_TYPES__Entity_Init = A_TYPES__Entity_Init,\n _SerializedType extends A_TYPES__Entity_Serialized = A_TYPES__Entity_Serialized\n>\n implements A_TYPES__IEntity {\n\n // ====================================================================\n // ================== Static A-Entity Information ============================\n // ====================================================================\n /**\n * Entity Identifier that corresponds to the class name\n */\n static get entity(): string {\n return A_FormatterHelper.toKebabCase(this.name);\n }\n /**\n * DEFAULT Concept Name (Application Name) of the entity from environment variable A_CONCEPT_NAME\n * [!] If environment variable is not set, it will default to 'a-concept'\n */\n static get concept(): string {\n return A_Context.concept;\n }\n /**\n * DEFAULT Scope of the entity from environment variable A_CONCEPT_DEFAULT_SCOPE\n * [!] If environment variable is not set, it will default to 'core'\n * [!] Scope is an application specific identifier that can be used to group entities together\n * [!] e.g. 'default', 'core', 'public', 'internal', etc\n */\n static get scope(): string {\n return A_Context.root.name;\n }\n\n\n\n // ====================================================================\n // ================== Instance A-Entity Information ====================\n // ====================================================================\n\n /**\n * ASEID is an entity identifier that is unique across the system\n * A - A_Concept or Application\n * S - System or Scope\n * E - Entity\n * ID - Identifier\n * \n * [!] ASEID is immutable and should not be changed after the entity is created\n * \n * [!] ASEID is composed of the following parts:\n * - concept: an application specific identifier from where the entity is coming from\n * - scope: the scope of the entity from concept\n * - entity: the name of the entity from concept\n * - id: the unique identifier of the entity\n *\n * [!] For more information about ASEID, please refer to the ASEID class documentation]\n */\n aseid!: ASEID;\n\n\n\n /**\n * Create a new A_entity instance from Aseid String\n * e.g. project@scope:entity:0000000001\n * \n * @param aseid \n */\n constructor(\n /**\n * ASEID string that represents the entity\n */\n aseid?: string\n )\n /**\n * Create a new A_entity instance from Aseid instance\n * e.g. new ASEID({concept: 'project', scope: 'default', entity: 'entity', id: '0000000001'})\n * \n * @param aseid \n */\n constructor(\n /**\n * ASEID instance that represents the entity\n */\n aseid: ASEID\n )\n /**\n * Create a new A_entity instance from serialized object\n * \n * @param serialized \n */\n constructor(\n /**\n * Serialized object that represents the entity\n */\n serialized: _SerializedType\n )\n /**\n * Create a new A_entity instance from constructor object\n * \n * @param newEntity \n */\n constructor(\n /**\n * Constructor object that represents the entity\n */\n newEntity?: _ConstructorType\n )\n constructor(props?: string | ASEID | _SerializedType | _ConstructorType) {\n\n const initializer = this.getInitializer(props);\n // the returned initializer is already bound to `this` (we used .bind(this)),\n // so calling it will run the appropriate logic on this instance:\n initializer.call(this, props);\n }\n // ====================================================================\n // ================== DUPLICATED ASEID Getters ========================\n // ====================================================================\n\n /**\n * Extracts the ID from the ASEID\n * ID is the unique identifier of the entity\n */\n get id(): string | number {\n return this.aseid.id;\n }\n\n // ====================================================================\n // ================== Constructor Helpers =============================\n // ====================================================================\n\n\n // --- Type guards used to classify `props` properly ---\n protected isStringASEID(x: unknown): x is string {\n return typeof x === \"string\" && ASEID.isASEID(x);\n }\n\n protected isASEIDInstance(x: unknown): x is ASEID {\n return x instanceof ASEID;\n }\n\n /**\n * A \"serialized\" object is considered such if it is a non-null object \n * and contains an \"aseid\" property (this mirrors your original check). \n * \n * @param x \n * @returns \n */\n protected isSerializedObject(x: unknown): x is _SerializedType {\n return !!x && typeof x === \"object\" && \"aseid\" in (x as object);\n }\n\n /**\n * Constructor-style props = a plain object which does NOT contain \"aseid\".\n * This is the \"create from provided fields\" case.\n * \n * @param x \n * @returns \n */\n protected isConstructorProps(x: unknown): x is _ConstructorType {\n return !!x && typeof x === \"object\" && !(\"aseid\" in (x as object));\n }\n\n /**\n * Determines the appropriate initializer method based on the type of `props`.\n * The method checks if `props` is: \n * 1) a string that matches ASEID format -> fromASEID\n * 2) an ASEID instance -> fromASEID\n * 3) a serialized object (has 'aseid') -> fromJSON\n * 4) a plain object with no 'aseid' -> treat as constructor props -> fromNew\n * \n * [!] If `props` is undefined, it will call fromUndefined method\n * \n * If none of the above, it throws an error indicating incorrect constructor usage.\n * \n * \n * To get a custom initializer, override this method in the child class.\n * Example:\n * ```typescript\n * protected getInitializer(\n * props?: string | ASEID | _SerializedType | _ConstructorType\n * ): (props: any) => void | (() => void) {\n * if('customField' in props) {\n * return this.fromCustomField.bind(this);\n * }\n * return super.getInitializer(props);\n * }\n * ```\n * @param props\n * @returns The appropriate initializer method\n */\n protected getInitializer(\n props?: string | ASEID | _SerializedType | _ConstructorType\n ): (props: any) => void | (() => void) {\n\n if (!props) {\n return this.fromUndefined\n }\n\n // 1) string that matches ASEID format -> fromASEID\n if (this.isStringASEID(props)) {\n return this.fromASEID as (p: string) => void;\n }\n\n // 2) ASEID instance -> fromASEID\n if (this.isASEIDInstance(props)) {\n return this.fromASEID as (p: ASEID) => void;\n }\n\n // 3) serialized object (has 'aseid') -> fromJSON\n if (this.isSerializedObject(props)) {\n return this.fromJSON as (p: _SerializedType) => void;\n }\n\n // 4) plain object with no 'aseid' -> treat as constructor props -> fromNew\n if (this.isConstructorProps(props)) {\n return this.fromNew as (p: _ConstructorType) => void;\n }\n\n // none of the above -> throw consistent error\n throw new A_EntityError(A_EntityError.ValidationError, 'Unable to determine A-Entity constructor initialization method. Please check the provided parameters.');\n }\n\n /**\n * Generates a new ASEID for the entity. \n * It uses class definitions for concept, scope, and entity,\n * and allows overriding any of these values.\n * \n * @param override \n * @returns \n */\n protected generateASEID(override?: Partial<A_TYPES__ASEID_Constructor>): ASEID {\n return new ASEID({\n concept: override?.concept || (this.constructor as typeof A_Entity).concept,\n scope: override?.scope || (this.constructor as typeof A_Entity).scope,\n entity: override?.entity || (this.constructor as typeof A_Entity).entity,\n id: override?.id || A_IdentityHelper.generateTimeId()\n });\n }\n\n\n /**\n * Call a feature of the component with the provided scope\n * \n * [!] If the provided scope is not inherited from the entity scope, it will be inherited\n * \n * @param lifecycleMethod \n * @param args \n */\n async call(\n feature: string,\n scope?: A_Scope\n ) {\n const newFeature = new A_Feature({\n name: feature,\n component: this,\n scope\n });\n\n return await newFeature.process(scope);\n }\n\n\n // ====================================================================\n // ================== Entity Base Methods =============================\n // ====================================================================\n\n /**\n * The default method that can be called and extended to load entity data.\n */\n async load(\n scope?: A_Scope,\n ) {\n return this.call('load', scope);\n }\n\n /**\n * The default method that can be called and extended to destroy entity data.\n */\n async destroy(scope?: A_Scope) {\n return this.call('destroy', scope);\n }\n\n /**\n * The default method that can be called and extended to save entity data.\n */\n async save(scope?: A_Scope) {\n return this.call('save', scope);\n }\n\n\n\n // ====================================================================\n // ================== Entity Serialization ============================\n // ====================================================================\n\n /**\n * Create a new entity from ASEID string or instance\n * [!] Executed when the constructor is called with a string or ASEID instance that represents the ASEID\n * [!] Executes By Default with new A_Entity('aseid-string') or new A_Entity(new ASEID(...)) if getInitializer has not been overridden\n * \n * @param aseid \n */\n fromASEID(aseid: string | ASEID): void {\n if (aseid instanceof ASEID)\n this.aseid = aseid;\n else\n this.aseid = new ASEID(aseid);\n }\n\n /**\n * Handles the case when no props are provided to the constructor.\n * This method can be overridden in child classes to set default values or perform specific initialization logic.\n * By default, it does nothing.\n * \n * \n * @returns \n */\n fromUndefined(): void {\n this.aseid = this.generateASEID();\n\n return;\n }\n\n /**\n * Create a new entity from constructor object\n * [!] Executed when the constructor is called with an object that does not contain \"aseid\" property\n * [!] Executes By Default with new A_Entity({}) if getInitializer has not been overridden\n * \n * @param newEntity \n * @returns \n */\n fromNew(newEntity: _ConstructorType): void {\n this.aseid = this.generateASEID();\n\n return;\n }\n\n\n /**\n * Creates a new entity from serialized object\n * \n * [!] Executed when the constructor is called with an object that contains \"aseid\" property\n * [!] Executes By Default with new A_Entity({ aseid: '...' }) if getInitializer has not been overridden\n * \n * \n * @param serialized \n * @returns \n */\n fromJSON(serialized: _SerializedType): void {\n this.aseid = new ASEID(serialized.aseid);\n return;\n }\n\n\n\n /**\n * Converts the entity to a JSON object \n * [!] This method should be extended in the child classes to include all properties of the entity\n * [!] Includes aseid by default \n * \n * \n * @returns \n */\n toJSON(): _SerializedType {\n return {\n aseid: this.aseid.toString()\n } as _SerializedType;\n }\n\n\n /**\n * Returns the string representation of the entity\n * what is basically the ASEID string\n * \n * @returns \n */\n toString(): string {\n return this.aseid ? this.aseid.toString() : this.constructor.name;\n }\n}","import { A_TYPES__Ctor } from \"@adaas/a-concept/types\";\nimport { A_Context } from \"@adaas/a-concept/a-context\";\nimport { A_Meta } from \"./A-Meta.class\";\nimport { A_TYPES__MetaLinkedComponentConstructors } from \"./A-Meta.types\";\n\n\n\n\n/**\n * \n * This decorator should allow to set a default meta type for the class, this helps to avoid\n * the need to create custom meta classes for each class.\n * \n * @returns \n */\nexport function A_MetaDecorator<T extends A_Meta>(\n constructor: A_TYPES__Ctor<T>\n) {\n return function <TTarget extends A_TYPES__MetaLinkedComponentConstructors>(\n target: TTarget\n ): TTarget {\n // Store meta info on the target class itself for the Meta decorator to pick up\n A_Context.setMeta(target, new constructor());\n\n return target;\n };\n}","import { A_MetaDecorator } from \"./A-Meta.decorator\";\nimport { A_TYPES__Meta_Constructor } from \"./A-Meta.types\";\n\n/**\n * A Meta is an entity that stores all the metadata for the specific entity like container, component, feature, etc. \n * \n * [!] Meta can be different depending on the type of input data\n */\nexport class A_Meta<\n _StorageItems extends Record<any, any> = any,\n _SerializedType extends Record<string, any> = Record<string, any>\n> implements Iterable<[keyof _StorageItems, _StorageItems[keyof _StorageItems]]> {\n\n /**\n * Allows to set a custom meta class for the Component or Container or Entity, or anything else. \n * \n * @param target \n * @returns \n */\n static Define<T extends A_Meta>(target: A_TYPES__Meta_Constructor<T>) {\n return A_MetaDecorator(target);\n }\n\n\n\n protected meta: Map<keyof _StorageItems, _StorageItems[keyof _StorageItems]> = new Map();\n\n\n /**\n * Method to get the iterator for the meta object\n * \n * @returns \n */\n [Symbol.iterator](): Iterator<[keyof _StorageItems, _StorageItems[keyof _StorageItems]]> {\n const iterator = this.meta.entries();\n return {\n next: () => iterator.next()\n };\n }\n\n\n\n // ===================================================================================================\n // ================================ META OPERATIONS ==================================================\n // ===================================================================================================\n /**\n * Allows to replicate received meta object by replacing internal meta to the received one\n * \n * @param meta \n * @returns \n */\n from(\n meta: A_Meta<_StorageItems>\n ): A_Meta<_StorageItems> {\n this.meta = new Map(meta.meta);\n\n return this;\n }\n\n\n /**\n * Method to set values in the map\n * \n * @param key \n * @param value \n */\n set<K extends keyof _StorageItems>(key: K, value: _StorageItems[K]) {\n\n const inheritedValue = this.meta.get(key)\n || Array.isArray(value)\n ? []\n : (value as any) instanceof Map\n ? new Map()\n : {};\n const targetValue = this.meta.get(key)\n || Array.isArray(value)\n ? [\n ...inheritedValue as any\n ] : (value as any) instanceof Map\n ? new Map(inheritedValue as any)\n : { ...inheritedValue };\n\n this.meta.set(key, value);\n\n }\n\n\n\n /**\n * Method to get values from the map\n * \n * @param key \n * @returns \n */\n get<K extends keyof _StorageItems>(key: K): _StorageItems[K] | undefined {\n return this.meta.get(key) as _StorageItems[K];\n }\n\n\n /**\n * Method to delete values from the map\n * \n * @param key \n * @returns \n */\n delete(key: keyof _StorageItems): boolean {\n return this.meta.delete(key);\n }\n\n\n /**\n * Method to get the size of the map\n * \n * @returns \n */\n size(): number {\n return this.meta.size;\n }\n\n\n /**\n * This method is needed to convert the key to a regular expression and cover cases like: \n * \n * simple * e.g. \"a*\" instead of \"a.*\"\n * \n * simple ? e.g. \"a?\" instead of \"a.\"\n * \n * etc. \n * \n * @param key \n * @returns \n */\n private convertToRegExp(key: string | RegExp): RegExp {\n return key instanceof RegExp\n ? key\n : new RegExp(key);\n }\n\n\n /**\n * Method to find values in the map by name.\n * \n * Converts the Key in Map to a regular expression and then compares to the name\n * \n * @param name \n * @returns \n */\n find(name: string) {\n const results: Array<[keyof _StorageItems, _StorageItems[keyof _StorageItems]]> = [];\n for (const [key, value] of this.meta.entries()) {\n if (this.convertToRegExp(String(key)).test(name)) {\n results.push([key, value]);\n }\n }\n return results;\n }\n\n\n /**\n * Method to find values in the map by regular expression\n * \n * Compares Map Key to the input regular expression\n * \n * @param regex \n * @returns \n */\n findByRegex(regex: RegExp): Array<[keyof _StorageItems, _StorageItems[keyof _StorageItems]]> {\n const results: Array<[keyof _StorageItems, _StorageItems[keyof _StorageItems]]> = [];\n for (const [key, value] of this.meta.entries()) {\n if (regex.test(String(key))) {\n results.push([key, value]);\n }\n }\n return results;\n }\n\n\n /**\n * Method to check if the map has a specific key\n * \n * @param key \n * @returns \n */\n has(key: keyof _StorageItems): boolean {\n return this.meta.has(key);\n }\n\n\n /**\n * Method to get the size of the map\n * \n * @returns \n */\n entries(): IterableIterator<[keyof _StorageItems, _StorageItems[keyof _StorageItems]]> {\n return this.meta.entries();\n }\n\n\n /**\n * Method to clear the map\n */\n clear(): void {\n this.meta.clear();\n }\n\n\n toArray(): Array<[keyof _StorageItems, _StorageItems[keyof _StorageItems]]> {\n return Array.from(this.meta.entries());\n }\n\n\n protected recursiveToJSON(value: any): any {\n switch (true) {\n case value instanceof A_Meta:\n return value.toJSON();\n\n case value instanceof Map:\n const obj: Record<string, any> = {};\n for (const [k, v] of value.entries()) {\n obj[String(k)] = this.recursiveToJSON(v);\n }\n return obj;\n\n case Array.isArray(value):\n return value.map((item) => this.recursiveToJSON(item));\n\n case !!value && typeof value === 'object':\n const res: Record<string, any> = {};\n for (const [k, v] of Object.entries(value)) {\n res[k] = this.recursiveToJSON(v);\n }\n return res;\n\n default:\n return value;\n }\n }\n\n /**\n * Serializes the meta to a JSON object\n * Uses internal storage to convert to JSON\n * \n * @returns \n */\n toJSON(): _SerializedType {\n const json: Record<string, any> = {};\n\n for (const [key, value] of this.meta.entries()) {\n json[String(key)] = this.recursiveToJSON(value);\n }\n return json as _SerializedType;\n }\n}","export enum A_TYPES__EntityMetaKey {\n EXTENSIONS = 'a-component-extensions',\n FEATURES = 'a-component-features',\n ABSTRACTIONS = 'a-component-abstractions',\n INJECTIONS = 'a-component-injections',\n}\n\nexport enum A_TYPES__EntityFeatures {\n SAVE = 'save',\n DESTROY = 'destroy',\n LOAD = 'load'\n}","import { A_Meta } from \"@adaas/a-concept/a-meta\";\nimport { A_TYPES__EntityMeta } from \"./A-Entity.types\";\nimport { A_TYPES__EntityMetaKey } from \"./A-Entity.constants\";\nimport { A_TYPES__FeatureDefineDecoratorMeta } from \"@adaas/a-concept/a-feature\";\nimport { A_TYPES__A_InjectDecorator_Meta } from \"@adaas/a-concept/a-inject\";\n\n\nexport class A_EntityMeta extends A_Meta<A_TYPES__EntityMeta> {\n\n /**\n * Returns all features defined in the Container\n * \n * @returns \n */\n features(): Array<A_TYPES__FeatureDefineDecoratorMeta> {\n\n const features = this.get(A_TYPES__EntityMetaKey.FEATURES);\n\n return features?.toArray()\n // returns all extensions that match the feature\n .map(([, feature]) => feature) || [];\n }\n\n\n /**\n * Allows to get all the injections for a given handler\n * \n * @param handler \n * @returns \n */\n injections(\n handler: string\n ): A_TYPES__A_InjectDecorator_Meta {\n const injections = this.get(A_TYPES__EntityMetaKey.INJECTIONS);\n\n const args = injections?.get(handler) || [];\n\n return args;\n }\n\n}","import { A_Context } from \"@adaas/a-concept/a-context\";\nimport { A_Feature } from \"@adaas/a-concept/a-feature\";\nimport { A_Scope } from \"@adaas/a-concept/a-scope\";\nimport { A_TYPES__Container_Init } from \"./A-Container.types\";\n\n\n\nexport class A_Container {\n\n /**\n * Configuration of the container that will be used to run it.\n */\n protected readonly config!: Partial<A_TYPES__Container_Init>;\n /**\n * Name of the container\n */\n get name() {\n return this.config?.name || this.constructor.name;\n }\n /**\n * Returns the scope where the container is registered\n */\n get scope(): A_Scope {\n return A_Context.scope(this);\n }\n\n\n /**\n * This class should combine Components to achieve the goal withing Concept\n * \n * Container is a direct container that should be \"run\" to make Concept work. \n * So because of that Container can be:\n * - HTTP Server\n * - BASH Script\n * - Database Connection\n * - Microservice\n * - etc.\n * \n * @param config - Configuration of the container that will be used to run it.\n */\n constructor(\n /**\n * Configuration of the container that will be used to run it.\n */\n config: Partial<A_TYPES__Container_Init> = {}\n ) {\n this.config = config;\n\n A_Context.allocate(this, this.config);\n }\n\n\n /**\n * Calls the feature with the given name in the given scope\n * \n * [!] Note: This method creates a new instance of the feature every time it is called\n * \n * @param feature - the name of the feature to call\n * @param scope - the scope in which to call the feature\n * @returns - void\n */\n async call(\n /**\n * Name of the feature to call\n */\n feature: string,\n /**\n * scope in which the feature will be executed\n */\n scope?: A_Scope\n ) {\n const newFeature = new A_Feature({\n name: feature,\n component: this\n });\n\n return await newFeature.process(scope);\n }\n}","export enum A_TYPES__ContainerMetaKey {\n FEATURES = 'a-container-features',\n INJECTIONS = 'a-container-injections',\n ABSTRACTIONS = 'a-container-abstractions',\n EXTENSIONS = 'a-container-extensions',\n}","import {\n A_TYPES__ContainerMeta,\n A_TYPES__ContainerMetaExtension,\n} from \"./A-Container.types\";\nimport { A_TYPES__A_InjectDecorator_Meta } from \"@adaas/a-concept/a-inject\";\nimport {\n A_TYPES__ConceptAbstractionMeta,\n A_TYPES__ConceptAbstractions\n} from \"@adaas/a-concept/a-concept\";\nimport { A_Meta } from \"@adaas/a-concept/a-meta\";\nimport { A_TYPES__ContainerMetaKey } from \"./A-Container.constants\";\nimport { A_TYPES__FeatureDefineDecoratorMeta } from \"@adaas/a-concept/a-feature\";\n\n\n\nexport class A_ContainerMeta extends A_Meta<A_TYPES__ContainerMeta> {\n\n\n\n /**\n * Allows to get all the injections for a given handler\n * \n * @param handler \n * @returns \n */\n injections(\n handler: string\n ): A_TYPES__A_InjectDecorator_Meta {\n const injections = this.get(A_TYPES__ContainerMetaKey.INJECTIONS);\n\n const args = injections?.get(handler) || [];\n\n return args;\n }\n\n /**\n * Returns all features defined in the Container\n * \n * @returns \n */\n features(): Array<A_TYPES__FeatureDefineDecoratorMeta> {\n\n const features = this.get(A_TYPES__ContainerMetaKey.FEATURES);\n\n return features?.toArray()\n // returns all extensions that match the feature\n .map(([, feature]) => feature) || [];\n }\n\n /**\n * Returns a set of instructions to run proper methods in Container during A-Concept Stage\n * \n * @param stage \n * @returns \n */\n abstractions(\n abstraction: A_TYPES__ConceptAbstractions\n ): A_TYPES__ConceptAbstractionMeta[] {\n const steps: A_TYPES__ConceptAbstractionMeta[] = [];\n\n const abstractions = this.get(A_TYPES__ContainerMetaKey.ABSTRACTIONS);\n const injections = this.get(A_TYPES__ContainerMetaKey.INJECTIONS);\n\n abstractions\n // returns all extensions that match the feature\n ?.find(`CONCEPT_ABSTRACTION::${abstraction}`)\n .forEach(([handler, extensions]) => {\n extensions.forEach(extension => {\n const args = injections?.get(extension.handler) || [];\n\n steps.push({\n ...extension,\n args,\n });\n\n });\n });\n\n\n return steps;\n }\n\n\n /**\n * Allows to get all the extensions for a given feature\n * \n * @param feature \n * @returns \n */\n extensions(\n feature: string\n ): A_TYPES__ContainerMetaExtension[] {\n const steps: A_TYPES__ContainerMetaExtension[] = [];\n\n const extensions = this.get(A_TYPES__ContainerMetaKey.EXTENSIONS);\n\n extensions\n // returns all extensions that match the feature\n ?.find(feature)\n .forEach(([handler, extensions]) => {\n extensions.forEach(extension => {\n steps.push({\n // component: constructor,\n name: extension.name,\n handler: extension.handler,\n behavior: extension.behavior,\n before: extension.before || '',\n after: extension.after || '',\n throwOnError: extension.throwOnError || true,\n override: ''\n\n });\n\n });\n });\n\n\n return steps;\n }\n\n}","import { A_Error } from \"@adaas/a-concept/a-error\";\nimport { A_Stage } from \"@adaas/a-concept/a-stage\";\nimport { A_TYPES__FeatureError_Init } from \"./A-Feature.types\";\n\n\n\nexport class A_FeatureError extends A_Error<A_TYPES__FeatureError_Init> {\n\n /**\n * Indicates that the Feature has been interrupted\n */\n static readonly Interruption = 'Feature Interrupted';\n /**\n * Indicates that there was an error initializing the Feature\n * \n * Failed during the A-Feature initialization process\n */\n static readonly FeatureInitializationError = 'Unable to initialize A-Feature';\n /**\n * Indicates that there was an error processing the Feature\n * \n * Failed during the A-Feature processing\n */\n static readonly FeatureProcessingError = 'Error occurred during A-Feature processing';\n\n // =======================================================================\n // ---------------------- Decorator Errors -----------------------------\n // =======================================================================\n /**\n * Indicates that there was an error defining the Feature\n * \n * Failed during the @A_Feature.Define() decorator execution\n */\n static readonly FeatureDefinitionError = 'Unable to define A-Feature';\n /**\n * Indicates that there was an error extending the Feature\n * \n * Failed during the @A_Feature.Extend() decorator execution\n */\n static readonly FeatureExtensionError = 'Unable to extend A-Feature';\n\n \n /**\n * Stage where the error occurred\n */\n stage?: A_Stage\n\n\n protected fromConstructor(params: A_TYPES__FeatureError_Init): void {\n super.fromConstructor(params);\n\n this.stage = params.stage;\n }\n}","import { A_TYPES__DeepPartial } from \"@adaas/a-concept/types\";\n\nexport class A_CommonHelper {\n\n /**\n * A simple promise that resolves immediately.\n * Can be used in async functions to create a resolved promise.\n */\n static resolve() {\n return new Promise<void>((resolve) => resolve());\n }\n\n /**\n * Check if a class is inherited from another class\n * \n * @param childClass \n * @param parentClass \n * @returns \n */\n static isInheritedFrom(childClass: any, parentClass: any): boolean {\n let current = childClass;\n\n // Traverse the prototype chain\n while (current) {\n if (current === parentClass) {\n return true;\n }\n current = Object.getPrototypeOf(current);\n }\n return false;\n }\n\n\n /**\n * Get all parent classes of a given class\n * \n * @param childClass \n * @returns \n */\n static getParentClasses(childClass: any): any[] {\n\n // first we need to check is that a constructor or instance\n let current = typeof childClass === 'function'\n ? Object.getPrototypeOf(childClass)\n : Object.getPrototypeOf(childClass.constructor);\n\n const parents = [] as any[];\n\n // Traverse the prototype chain\n while (current && current !== Function.prototype) {\n parents.push(current);\n current = Object.getPrototypeOf(current);\n }\n return parents;\n\n }\n\n /**\n * Get the class inheritance chain as an array of class names\n * \n * @param childClass \n * @returns \n */\n static getClassInheritanceChain(childClass: any): any[] {\n\n // first we need to check is that a constructor or instance\n let current = typeof childClass === 'function'\n ? Object.getPrototypeOf(childClass)\n : Object.getPrototypeOf(childClass.constructor);\n\n // then if input is instance we have to include its own class name\n const chain = typeof childClass === 'function'\n ? [childClass]\n : [childClass.constructor];\n\n\n // Traverse the prototype chain\n while (current && current !== Function.prototype) {\n chain.push(current);\n current = Object.getPrototypeOf(current);\n }\n return chain;\n }\n\n /**\n * Get the parent class of a given class\n * \n * @param childClass \n * @returns \n */\n static getParentClass(childClass: any): any {\n return Object.getPrototypeOf(childClass);\n }\n\n /**\n * Omit properties from an object or array with nested objects\n * \n * @param input \n * @param paths \n * @returns \n */\n static omitProperties<T, S extends string>(\n input: T,\n paths: string[]\n\n ): Omit<T, S> {\n\n // Deep clone the input object or array\n const result = JSON.parse(JSON.stringify(input));\n\n // Helper function to recursively remove properties\n function removeProperties(target: Record<string, any> | any[], currPath: string[]) {\n const currKey = currPath[0];\n if (currPath.length === 1) {\n // If current path has only one key, delete the property\n delete target[currKey];\n } else if (target[currKey] !== undefined && typeof target[currKey] === 'object') {\n // If current key exists and is an object, recursively call removeProperties\n removeProperties(target[currKey], currPath.slice(1));\n }\n }\n\n // Iterate through each path and remove corresponding properties from the result\n paths.forEach(path => {\n const pathKeys = path.split('.');\n removeProperties(result, pathKeys);\n });\n\n return result as Omit<T, S>;\n }\n\n\n static isObject(item: unknown): item is Record<string, any> {\n return item !== null && typeof item === 'object' && !Array.isArray(item);\n }\n\n static deepMerge<T = any>(target: any, source: any, visited = new Map<any, any>()): T {\n if (this.isObject(target) && this.isObject(source)) {\n for (const key in source) {\n if (this.isObject(source[key])) {\n if (!target[key]) {\n target[key] = {};\n }\n // Check if the source object has already been visited\n if (!visited.has(source[key])) {\n visited.set(source[key], {});\n this.deepMerge(target[key], source[key], visited);\n } else {\n target[key] = visited.get(source[key]);\n }\n } else {\n target[key] = source[key];\n }\n }\n }\n return target;\n }\n\n\n static deepClone<T>(target: T): T {\n // Check if the value is null or undefined\n if (target === null || target === undefined) {\n return target;\n }\n\n // Handle primitive types (string, number, boolean, etc.)\n if (typeof target !== 'object') {\n return target;\n }\n\n // Handle Date\n if (target instanceof Date) {\n return new Date(target.getTime()) as T;\n }\n\n // Handle Array\n if (Array.isArray(target)) {\n return target.map(item => this.deepClone(item)) as unknown as T;\n }\n\n // Handle Function\n if (typeof target === 'function') {\n return target;\n }\n\n // Handle Object\n if (target instanceof Object) {\n const clone = {} as T;\n for (const key in target) {\n if (target.hasOwnProperty(key)) {\n clone[key] = this.deepClone(target[key]);\n }\n }\n return clone;\n }\n\n // For any other cases\n throw new Error('Unable to clone the object. Unsupported type.');\n }\n\n\n static deepCloneAndMerge<T>(target: A_TYPES__DeepPartial<T>, source: T): T {\n if (\n (source === null || source === undefined) &&\n (target === null || target === undefined))\n return target;\n\n // Check if the value is null or undefined\n if ((target === null || target === undefined) &&\n source\n ) {\n return this.deepClone(source);\n }\n\n // Handle primitive types (string, number, boolean, etc.)\n if (typeof target !== 'object') {\n return target\n }\n\n\n // Handle Date\n if (target instanceof Date) {\n return new Date(target.getTime()) as T;\n }\n\n // Handle Array\n if (Array.isArray(target)) {\n return target.map(item => this.deepCloneAndMerge(item, source)) as unknown as T;\n }\n\n // Handle Function\n if (typeof target === 'function') {\n return target;\n }\n\n // Handle Object\n if (target instanceof Object) {\n const clone = {} as T;\n for (const key in target) {\n if (\n source[key] !== null\n &&\n source[key] !== undefined\n )\n clone[key] = this.deepCloneAndMerge(target[key as any], source[key]);\n else\n clone[key as any] = this.deepClone(target[key]);\n }\n\n for (const key in source) {\n if (\n target[key] !== undefined\n &&\n target[key] !== null\n )\n clone[key] = this.deepCloneAndMerge(target[key], source[key]);\n else\n clone[key] = this.deepClone(source[key]);\n }\n return clone;\n }\n\n // For any other cases\n throw new Error('Unable to clone the object. Unsupported type.');\n }\n\n /**\n * Get a readable name for a component (string, class, function, React element, instance, etc.)\n *\n * Covers:\n * - string tags (\"div\")\n * - symbols (Symbol.for('xxx'))\n * - functions and classes (with name or displayName)\n * - React elements (object with `type`)\n * - component instances (constructor.name)\n * - objects with custom toString returning meaningful info\n *\n * Falls back to sensible defaults (\"Unknown\" / \"Anonymous\").\n */\n static getComponentName(component: any): string {\n const UNKNOWN = 'Unknown';\n const ANONYMOUS = 'Anonymous';\n\n if (component === null || component === undefined) {\n return UNKNOWN;\n }\n\n // Strings (HTML tags or explicit names)\n if (typeof component === 'string') {\n return component || UNKNOWN;\n }\n\n // Symbols\n if (typeof component === 'symbol') {\n try {\n return component.toString();\n } catch {\n return UNKNOWN;\n }\n }\n\n // Arrays - try to derive from first element\n if (Array.isArray(component)) {\n if (component.length === 0) return UNKNOWN;\n return this.getComponentName(component[0]);\n }\n\n // Functions and classes\n if (typeof component === 'function') {\n const fnAny = component as any;\n // Common React convention\n if (fnAny.displayName) return String(fnAny.displayName);\n if (fnAny.name) return String(fnAny.name);\n\n if (fnAny.constructor && fnAny.constructor.name) {\n return String(fnAny.constructor.name);\n }\n\n // Try to extract a name from source if possible\n try {\n const src = Function.prototype.toString.call(component);\n // class Foo { ... } or function foo() { ... } or foo => ...\n const match = src.match(/^(?:class\\s+([A-Za-z0-9_$]+)|function\\s+([A-Za-z0-9_$]+)|([A-Za-z0-9_$]+)\\s*=>)/);\n if (match) {\n return match[1] || match[2] || match[3] || ANONYMOUS;\n }\n } catch {\n // fallthrough\n }\n return ANONYMOUS;\n }\n\n // Objects (instances, React elements, plain objects)\n if (typeof component === 'object') {\n const objAny = component as any;\n\n // React element: { type: ComponentOrString, props: ... }\n if (objAny.type) {\n return this.getComponentName(objAny.type);\n }\n\n // React forwardRef / memo wrappers often expose displayName\n if (objAny.displayName) return String(objAny.displayName);\n if (objAny.name) return String(objAny.name);\n\n // Instance: use constructor name if available and not Object\n if (objAny.constructor && objAny.constructor.name && objAny.constructor.name !== 'Object') {\n return String(objAny.constructor.name);\n }\n\n // If object implements a meaningful toString, try it\n try {\n const s = objAny.toString();\n if (typeof s === 'string' && s !== '[object Object]') {\n return s;\n }\n } catch {\n // ignore\n }\n\n return ANONYMOUS;\n }\n\n // Fallback for other types\n try {\n return String(component);\n } catch {\n return UNKNOWN;\n }\n }\n}","export class A_CallerError extends Error {\n\n /**\n * This error code indicates that there was an issue initializing the A-Caller\n */\n static readonly CallerInitializationError = 'Unable to initialize A-Caller';\n}","import { A_TypeGuards} from \"@adaas/a-concept/helpers/A_TypeGuards.helper\";\nimport { A_TYPES__FeatureAvailableComponents } from \"@adaas/a-concept/a-feature\";\nimport { A_CallerError } from \"./A_Caller.error\";\n\n\n\n/**\n * This is a common class that uses to return an entity that initiates a feature call\n * \n * It can be used then in @A_Inject(A_Caller) to get the entity that initiated the feature call\n * \n * [!] the class itself may be retrieved, but may require additional processing inside the feature\n * \n */\nexport class A_Caller<T extends A_TYPES__FeatureAvailableComponents = A_TYPES__FeatureAvailableComponents> {\n\n /**\n * The component that initiated the feature call\n */\n protected _component: T;\n\n\n /**\n * A_Caller allows to get the component that initiated the feature call\n * \n * It can be used then in @A_Inject(A_Caller) to get the entity that initiated the feature call\n * \n * [!] If Scope is not provided, a new empty scope will be created and inherited from the global scope\n * \n * @param component \n * @param scope \n */\n constructor(\n component: T\n ) {\n this.validateParams(component);\n\n this._component = component;\n }\n\n get component(): T {\n return this._component;\n }\n\n\n /**\n * Validates the provided parameters and Ensures that the component is of an allowed type\n * \n * @param component \n */\n protected validateParams(\n component: T\n ) {\n if (!A_TypeGuards.isAllowedForFeatureCall(component)) {\n throw new A_CallerError(\n `[${A_CallerError.CallerInitializationError}]: Invalid A-Caller component provided of type: ${typeof component} with value: ${JSON.stringify(component).slice(0, 100)}...`\n );\n }\n }\n}","import { A_Error } from \"@adaas/a-concept/a-error\";\n\nexport class A_DependencyError extends A_Error {\n\n static readonly InvalidDependencyTarget = 'Invalid Dependency Target';\n\n static readonly InvalidLoadTarget = 'Invalid Load Target';\n\n static readonly InvalidLoadPath = 'Invalid Load Path';\n\n\n static readonly InvalidDefaultTarget = 'Invalid Default Target';\n\n\n static readonly ResolutionParametersError = 'Dependency Resolution Parameters Error';\n}","import { A_Context } from \"@adaas/a-concept/a-context\";\nimport { A_Meta } from \"@adaas/a-concept/a-meta\";\nimport { A_TYPES__ComponentMetaKey } from \"@adaas/a-concept/a-component\";\nimport { A_TYPES__ContainerMetaKey } from \"@adaas/a-concept/a-container\";\nimport { A_TYPES__A_Dependency_DefaultDecoratorReturn } from \"./A-Dependency.types\";\nimport { A_DependencyError } from \"./A-Dependency.error\";\nimport { A_TYPES__EntityMetaKey } from \"@adaas/a-concept/a-entity\";\nimport {\n A_TYPES__A_InjectDecorator_Meta,\n A_TYPES__InjectableTargets\n} from \"@adaas/a-concept/a-inject\";\nimport { A_TypeGuards} from \"@adaas/a-concept/helpers/A_TypeGuards.helper\";\nimport { A_CommonHelper} from \"@adaas/a-concept/helpers/A_Common.helper\";\n\n\n/**\n * Should indicate which Default is required\n */\nexport function A_Dependency_Default(\n /**\n * Constructor Parameters that will be used to create the default instance\n */\n ...args: any[]\n): A_TYPES__A_Dependency_DefaultDecoratorReturn {\n\n\n return function (\n target: A_TYPES__InjectableTargets,\n methodName: string | symbol | undefined,\n parameterIndex: number\n ) {\n // for Error handling purposes\n const componentName = A_CommonHelper.getComponentName(target)\n\n if (!A_TypeGuards.isTargetAvailableForInjection(target)) {\n throw new A_DependencyError(\n A_DependencyError.InvalidDefaultTarget,\n `A-Default cannot be used on the target of type ${typeof target} (${componentName})`\n );\n }\n\n // determine the method name or 'constructor' for constructor injections\n const method = methodName ? String(methodName) : 'constructor';\n let metaKey;\n\n switch (true) {\n case A_TypeGuards.isComponentConstructor(target) || A_TypeGuards.isComponentInstance(target):\n metaKey = A_TYPES__ComponentMetaKey.INJECTIONS;\n break;\n\n case A_TypeGuards.isContainerInstance(target):\n metaKey = A_TYPES__ContainerMetaKey.INJECTIONS;\n break;\n\n case A_TypeGuards.isEntityInstance(target):\n metaKey = A_TYPES__EntityMetaKey.INJECTIONS;\n break;\n }\n\n // get existing meta or create a new one\n const existedMeta = A_Context.meta(target).get(metaKey) || new A_Meta();\n // get existing injections for the method or create a new array\n const paramsArray: A_TYPES__A_InjectDecorator_Meta = existedMeta.get(method) || [];\n\n // set the parameter injection info\n paramsArray[parameterIndex].resolutionStrategy = {\n create: true,\n args: args\n }\n\n // save back the updated injections array\n existedMeta.set(method, paramsArray);\n\n // save back the updated meta info\n A_Context\n .meta(target)\n .set(\n metaKey,\n existedMeta\n );\n }\n}","\nimport { A_Context } from \"@adaas/a-concept/a-context\";\nimport { A_Meta } from \"@adaas/a-concept/a-meta\";\nimport { A_TYPES__ComponentMetaKey } from \"@adaas/a-concept/a-component\";\nimport { A_TYPES__ContainerMetaKey } from \"@adaas/a-concept/a-container\";\nimport { A_TYPES__A_Dependency_FlatDecoratorReturn } from \"./A-Dependency.types\";\nimport { A_DependencyError } from \"./A-Dependency.error\";\nimport { A_TYPES__EntityMetaKey } from \"@adaas/a-concept/a-entity\";\nimport {\n A_TYPES__A_InjectDecorator_Meta,\n A_TYPES__InjectableTargets\n} from \"@adaas/a-concept/a-inject\";\nimport { A_TypeGuards} from \"@adaas/a-concept/helpers/A_TypeGuards.helper\";\nimport { A_CommonHelper} from \"@adaas/a-concept/helpers/A_Common.helper\";\n\n\n/**\n * Should indicate which dependency is required\n */\nexport function A_Dependency_Flat(): A_TYPES__A_Dependency_FlatDecoratorReturn {\n\n return function (\n target: A_TYPES__InjectableTargets,\n methodName: string | symbol | undefined,\n parameterIndex: number\n ) {\n // for Error handling purposes\n const componentName = A_CommonHelper.getComponentName(target)\n\n if (!A_TypeGuards.isTargetAvailableForInjection(target)) {\n throw new A_DependencyError(\n A_DependencyError.InvalidDependencyTarget,\n `A-Dependency cannot be used on the target of type ${typeof target} (${componentName})`\n );\n }\n\n // determine the method name or 'constructor' for constructor injections\n const method = methodName ? String(methodName) : 'constructor';\n let metaKey;\n\n switch (true) {\n case A_TypeGuards.isComponentConstructor(target) || A_TypeGuards.isComponentInstance(target):\n metaKey = A_TYPES__ComponentMetaKey.INJECTIONS;\n break;\n\n case A_TypeGuards.isContainerInstance(target):\n metaKey = A_TYPES__ContainerMetaKey.INJECTIONS;\n break;\n\n case A_TypeGuards.isEntityInstance(target):\n metaKey = A_TYPES__EntityMetaKey.INJECTIONS;\n break;\n }\n\n // get existing meta or create a new one\n const existedMeta = A_Context.meta(target).get(metaKey) || new A_Meta();\n // get existing injections for the method or create a new array\n const paramsArray: A_TYPES__A_InjectDecorator_Meta = existedMeta.get(method) || [];\n\n\n // set the parameter injection info\n paramsArray[parameterIndex].resolutionStrategy = {\n flat: true,\n }\n\n // save back the updated injections array\n existedMeta.set(method, paramsArray);\n\n // save back the updated meta info\n A_Context\n .meta(target)\n .set(\n metaKey,\n existedMeta\n );\n }\n}","import { A_Context } from \"@adaas/a-concept/a-context\";\nimport { A_Meta } from \"@adaas/a-concept/a-meta\";\nimport { A_TYPES__ComponentMetaKey } from \"@adaas/a-concept/a-component\";\nimport { A_TYPES__ContainerMetaKey } from \"@adaas/a-concept/a-container\";\nimport { A_TYPES__A_Dependency_LoadDecoratorReturn } from \"./A-Dependency.types\";\nimport { A_DependencyError } from \"./A-Dependency.error\";\nimport { A_TYPES__EntityMetaKey } from \"@adaas/a-concept/a-entity\";\nimport {\n A_TYPES__A_InjectDecorator_Meta,\n A_TYPES__InjectableTargets\n} from \"@adaas/a-concept/a-inject\";\nimport { A_TypeGuards} from \"@adaas/a-concept/helpers/A_TypeGuards.helper\";\nimport { A_CommonHelper} from \"@adaas/a-concept/helpers/A_Common.helper\";\n\n\n/**\n * Should indicate which Load is required\n */\nexport function A_Dependency_Load(\n\n): A_TYPES__A_Dependency_LoadDecoratorReturn {\n\n // if (!path || typeof path !== 'string') {\n // throw new A_DependencyError(\n // A_DependencyError.InvalidLoadPath,\n // `A-Load decorator requires a valid path string to the dependency`\n // );\n // }\n\n return function (\n target: A_TYPES__InjectableTargets,\n methodName: string | symbol | undefined,\n parameterIndex: number\n ) {\n // for Error handling purposes\n const componentName = A_CommonHelper.getComponentName(target);\n\n if (!A_TypeGuards.isTargetAvailableForInjection(target)) {\n throw new A_DependencyError(\n A_DependencyError.InvalidLoadTarget,\n `A-Load cannot be used on the target of type ${typeof target} (${componentName})`\n );\n }\n\n // determine the method name or 'constructor' for constructor injections\n const method = methodName ? String(methodName) : 'constructor';\n let metaKey;\n\n switch (true) {\n case A_TypeGuards.isComponentConstructor(target) || A_TypeGuards.isComponentInstance(target):\n metaKey = A_TYPES__ComponentMetaKey.INJECTIONS;\n break;\n\n case A_TypeGuards.isContainerInstance(target):\n metaKey = A_TYPES__ContainerMetaKey.INJECTIONS;\n break;\n\n case A_TypeGuards.isEntityInstance(target):\n metaKey = A_TYPES__EntityMetaKey.INJECTIONS;\n break;\n }\n\n // get existing meta or create a new one\n const existedMeta = A_Context.meta(target).get(metaKey) || new A_Meta();\n // get existing injections for the method or create a new array\n const paramsArray: A_TYPES__A_InjectDecorator_Meta = existedMeta.get(method) || [];\n\n // set the parameter injection info\n paramsArray[parameterIndex].resolutionStrategy = {\n load: true\n }\n // save back the updated injections array\n existedMeta.set(method, paramsArray);\n\n // save back the updated meta info\n A_Context\n .meta(target)\n .set(\n metaKey,\n existedMeta\n );\n }\n}","import { A_Context } from \"@adaas/a-concept/a-context\";\nimport { A_Meta } from \"@adaas/a-concept/a-meta\";\nimport { A_TYPES__ComponentMetaKey } from \"@adaas/a-concept/a-component\";\nimport { A_TYPES__ContainerMetaKey } from \"@adaas/a-concept/a-container\";\nimport { A_TYPES__A_Dependency_ParentDecoratorReturn } from \"./A-Dependency.types\";\nimport { A_DependencyError } from \"./A-Dependency.error\";\nimport { A_TYPES__EntityMetaKey } from \"@adaas/a-concept/a-entity\";\nimport {\n A_TYPES__A_InjectDecorator_Meta,\n A_TYPES__InjectableTargets\n} from \"@adaas/a-concept/a-inject\";\nimport { A_TypeGuards} from \"@adaas/a-concept/helpers/A_TypeGuards.helper\";\nimport { A_CommonHelper} from \"@adaas/a-concept/helpers/A_Common.helper\";\n\n\n/**\n * Should indicate which dependency is required\n */\nexport function A_Dependency_Parent(\n /**\n * Indicates how many layers up the parent dependency should be resolved from current dependency\n * \n * Default: -1 (one layer up)\n */\n layerOffset: number = -1\n): A_TYPES__A_Dependency_ParentDecoratorReturn {\n\n return function (\n target: A_TYPES__InjectableTargets,\n methodName: string | symbol | undefined,\n parameterIndex: number\n ) {\n // for Error handling purposes\n const componentName = A_CommonHelper.getComponentName(target)\n\n if (!A_TypeGuards.isTargetAvailableForInjection(target)) {\n throw new A_DependencyError(\n A_DependencyError.InvalidDependencyTarget,\n `A-Dependency cannot be used on the target of type ${typeof target} (${componentName})`\n );\n }\n\n // determine the method name or 'constructor' for constructor injections\n const method = methodName ? String(methodName) : 'constructor';\n let metaKey;\n\n switch (true) {\n case A_TypeGuards.isComponentConstructor(target) || A_TypeGuards.isComponentInstance(target):\n metaKey = A_TYPES__ComponentMetaKey.INJECTIONS;\n break;\n\n case A_TypeGuards.isContainerInstance(target):\n metaKey = A_TYPES__ContainerMetaKey.INJECTIONS;\n break;\n \n case A_TypeGuards.isEntityInstance(target):\n metaKey = A_TYPES__EntityMetaKey.INJECTIONS;\n break;\n }\n\n // get existing meta or create a new one\n const existedMeta = A_Context.meta(target).get(metaKey) || new A_Meta();\n // get existing injections for the method or create a new array\n const paramsArray: A_TYPES__A_InjectDecorator_Meta = existedMeta.get(method) || [];\n\n // set the parameter injection info\n paramsArray[parameterIndex].resolutionStrategy = {\n parent: layerOffset\n }\n // save back the updated injections array\n existedMeta.set(method, paramsArray);\n\n // save back the updated meta info\n A_Context\n .meta(target)\n .set(\n metaKey,\n existedMeta\n );\n }\n}","import { A_Context } from \"@adaas/a-concept/a-context\";\nimport { A_Meta } from \"@adaas/a-concept/a-meta\";\nimport { A_TYPES__ComponentMetaKey } from \"@adaas/a-concept/a-component\";\nimport { A_TYPES__ContainerMetaKey } from \"@adaas/a-concept/a-container\";\nimport { A_TYPES__A_Dependency_RequireDecoratorReturn } from \"./A-Dependency.types\";\nimport { A_DependencyError } from \"./A-Dependency.error\";\nimport { A_TYPES__EntityMetaKey } from \"@adaas/a-concept/a-entity\";\nimport {\n A_TYPES__A_InjectDecorator_Meta,\n A_TYPES__InjectableTargets\n} from \"@adaas/a-concept/a-inject\";\nimport { A_TypeGuards} from \"@adaas/a-concept/helpers/A_TypeGuards.helper\";\nimport { A_CommonHelper} from \"@adaas/a-concept/helpers/A_Common.helper\";\n\n\n/**\n * Should indicate which dependency is required\n */\nexport function A_Dependency_Require(): A_TYPES__A_Dependency_RequireDecoratorReturn {\n\n return function (\n target: A_TYPES__InjectableTargets,\n methodName: string | symbol | undefined,\n parameterIndex: number\n ) {\n // for Error handling purposes\n const componentName = A_CommonHelper.getComponentName(target)\n\n if (!A_TypeGuards.isTargetAvailableForInjection(target)) {\n throw new A_DependencyError(\n A_DependencyError.InvalidDependencyTarget,\n `A-Dependency cannot be used on the target of type ${typeof target} (${componentName})`\n );\n }\n\n // determine the method name or 'constructor' for constructor injections\n const method = methodName ? String(methodName) : 'constructor';\n let metaKey;\n\n switch (true) {\n case A_TypeGuards.isComponentConstructor(target) || A_TypeGuards.isComponentInstance(target):\n metaKey = A_TYPES__ComponentMetaKey.INJECTIONS;\n break;\n\n case A_TypeGuards.isContainerInstance(target):\n metaKey = A_TYPES__ContainerMetaKey.INJECTIONS;\n break;\n\n case A_TypeGuards.isEntityInstance(target):\n metaKey = A_TYPES__EntityMetaKey.INJECTIONS;\n break;\n }\n\n // get existing meta or create a new one\n const existedMeta = A_Context.meta(target).get(metaKey) || new A_Meta();\n // get existing injections for the method or create a new array\n const paramsArray: A_TYPES__A_InjectDecorator_Meta = existedMeta.get(method) || [];\n\n // set the parameter injection info\n paramsArray[parameterIndex].resolutionStrategy = {\n require: true\n }\n // save back the updated injections array\n existedMeta.set(method, paramsArray);\n\n // save back the updated meta info\n A_Context\n .meta(target)\n .set(\n metaKey,\n existedMeta\n );\n }\n}","\nimport { A_Context } from \"@adaas/a-concept/a-context\";\nimport { A_Meta } from \"@adaas/a-concept/a-meta\";\nimport { A_TYPES__ComponentMetaKey } from \"@adaas/a-concept/a-component\";\nimport { A_TYPES__ContainerMetaKey } from \"@adaas/a-concept/a-container\";\nimport { A_TYPES__A_Dependency_AllDecoratorReturn } from \"./A-Dependency.types\";\nimport { A_DependencyError } from \"./A-Dependency.error\";\nimport { A_TYPES__EntityMetaKey } from \"@adaas/a-concept/a-entity\";\nimport {\n A_TYPES__A_InjectDecorator_Meta,\n A_TYPES__InjectableTargets\n} from \"@adaas/a-concept/a-inject\";\nimport { A_TypeGuards} from \"@adaas/a-concept/helpers/A_TypeGuards.helper\";\nimport { A_CommonHelper} from \"@adaas/a-concept/helpers/A_Common.helper\";\n\n/**\n * Should indicate which All is required\n */\nexport function A_Dependency_All(): A_TYPES__A_Dependency_AllDecoratorReturn {\n\n return function (\n target: A_TYPES__InjectableTargets,\n methodName: string | symbol | undefined,\n parameterIndex: number\n ) {\n // for Error handling purposes\n const componentName = A_CommonHelper.getComponentName(target)\n\n if (!A_TypeGuards.isTargetAvailableForInjection(target)) {\n throw new A_DependencyError(\n A_DependencyError.InvalidDependencyTarget,\n `A-All cannot be used on the target of type ${typeof target} (${componentName})`\n );\n }\n\n // determine the method name or 'constructor' for constructor injections\n const method = methodName ? String(methodName) : 'constructor';\n let metaKey;\n\n switch (true) {\n case A_TypeGuards.isComponentConstructor(target) || A_TypeGuards.isComponentInstance(target):\n metaKey = A_TYPES__ComponentMetaKey.INJECTIONS;\n break;\n\n case A_TypeGuards.isContainerInstance(target):\n metaKey = A_TYPES__ContainerMetaKey.INJECTIONS;\n break;\n\n case A_TypeGuards.isEntityInstance(target):\n metaKey = A_TYPES__EntityMetaKey.INJECTIONS;\n break;\n }\n\n // get existing meta or create a new one\n const existedMeta = A_Context.meta(target).get(metaKey) || new A_Meta();\n // get existing injections for the method or create a new array\n const paramsArray: A_TYPES__A_InjectDecorator_Meta = existedMeta.get(method) || [];\n\n // set the parameter injection info\n paramsArray[parameterIndex].resolutionStrategy = {\n pagination: {\n ...paramsArray[parameterIndex].resolutionStrategy.pagination,\n count: -1\n }\n }\n // save back the updated injections array\n existedMeta.set(method, paramsArray);\n\n // save back the updated meta info\n A_Context\n .meta(target)\n .set(\n metaKey,\n existedMeta\n );\n }\n}","import { A_CommonHelper} from \"@adaas/a-concept/helpers/A_Common.helper\";\nimport { A_Dependency_Default } from \"./A-Dependency-Default.decorator\";\nimport { A_Dependency_Flat } from \"./A-Dependency-Flat.decorator\";\nimport { A_Dependency_Load } from \"./A-Dependency-Load.decorator\";\nimport { A_Dependency_Parent } from \"./A-Dependency-Parent.decorator\";\nimport { A_Dependency_Require } from \"./A-Dependency-Require.decorator\";\nimport { A_DependencyError } from \"./A-Dependency.error\";\nimport {\n A_TYPES__A_Dependency_EntityInjectionPagination,\n A_TYPES__A_Dependency_EntityInjectionQuery,\n A_TYPES__A_Dependency_Serialized,\n A_TYPES__A_DependencyInjectable,\n A_TYPES__A_DependencyResolutionStrategy\n} from \"./A-Dependency.types\";\nimport { A_TYPES__Ctor } from \"@adaas/a-concept/types\";\nimport { A_Dependency_All } from \"./A-Dependency-All.decorator\";\n\n\nexport class A_Dependency<\n T extends A_TYPES__A_DependencyInjectable = A_TYPES__A_DependencyInjectable\n> {\n /**\n * Allows to indicate which Injected parameter is required\n * \n * [!] If parameter marked as required is not provided, an error will be thrown\n * \n * @returns \n */\n static get Required(): typeof A_Dependency_Require {\n return A_Dependency_Require;\n }\n /**\n * Allows to indicate which dependency should be loaded from a specific path\n * \n * @returns \n */\n static get Loaded(): typeof A_Dependency_Load {\n return A_Dependency_Load;\n }\n /**\n * Allows to indicate which dependency default parameters should be used\n * \n * @returns \n */\n static get Default(): typeof A_Dependency_Default {\n return A_Dependency_Default;\n }\n /**\n * Allows to indicate which parent dependency should be resolved\n * e.g. from which layer up the parent should be taken\n * \n * @returns \n */\n static get Parent(): typeof A_Dependency_Parent {\n return A_Dependency_Parent;\n }\n\n /**\n * Allows to indicate that the dependency should be resolved in a flat manner\n * Only in the same scope, without going up to parent scopes\n * \n * @returns \n */\n static get Flat(): typeof A_Dependency_Flat {\n return A_Dependency_Flat;\n }\n\n /**\n * Allows to indicate that all instances of the dependency should be resolved\n * \n * @returns\n */\n static get All(): typeof A_Dependency_All {\n return A_Dependency_All;\n }\n\n protected _name: string;\n protected _target?: A_TYPES__Ctor<T>;\n protected _resolutionStrategy!: A_TYPES__A_DependencyResolutionStrategy;\n\n protected _defaultPagination: A_TYPES__A_DependencyResolutionStrategy['pagination'] = {\n count: 1,\n from: 'start',\n };\n protected _defaultResolutionStrategy: A_TYPES__A_DependencyResolutionStrategy = {\n require: false,\n load: false,\n parent: 0,\n flat: false,\n create: false,\n args: [],\n query: {},\n pagination: this._defaultPagination,\n };\n\n get flat(): boolean {\n return this._resolutionStrategy.flat;\n }\n get require(): boolean {\n return this._resolutionStrategy.require;\n }\n get load(): boolean {\n return this._resolutionStrategy.load;\n }\n /**\n * Indicates cases when it's necessary to search across all instances\n */\n get all(): boolean {\n return this._resolutionStrategy.pagination.count !== 1 || Object.keys(this._resolutionStrategy.query).length > 0\n }\n get parent(): number {\n return this._resolutionStrategy.parent;\n }\n get create(): any {\n return this._resolutionStrategy.create;\n }\n get args(): any[] {\n return this._resolutionStrategy.args;\n }\n get query(): Partial<A_TYPES__A_Dependency_EntityInjectionQuery<T>> {\n return this._resolutionStrategy.query as Partial<A_TYPES__A_Dependency_EntityInjectionQuery<T>>;\n }\n get pagination(): A_TYPES__A_Dependency_EntityInjectionPagination {\n return this._resolutionStrategy.pagination;\n }\n\n\n\n\n /**\n * Class instances allows to identify dependencies by name and use them for better type checking\n * \n * @param name \n */\n constructor(\n name: string | A_TYPES__Ctor<T>,\n resolutionStrategy?: Partial<Omit<A_TYPES__A_DependencyResolutionStrategy<T>, 'pagination'> & { pagination: Partial<A_TYPES__A_Dependency_EntityInjectionPagination> }>\n ) {\n this._name = typeof name === 'string' ? name : A_CommonHelper.getComponentName(name);\n\n this._target = typeof name === 'string' ? undefined : name;\n\n this.resolutionStrategy = resolutionStrategy || {};\n\n this.initCheck();\n }\n\n /**\n * Gets the dependency name\n * \n * Can be identifier, url or any string value\n * \n * @returns \n */\n get name(): string {\n return this._name;\n }\n\n /**\n * Returns the original class of the dependency if provided\n * \n */\n get target(): A_TYPES__Ctor<T> | undefined {\n return this._target;\n }\n\n /**\n * Gets the dependency resolution strategy\n */\n get resolutionStrategy(): A_TYPES__A_DependencyResolutionStrategy<T> {\n return this._resolutionStrategy!;\n }\n\n /**\n * Sets the dependency resolution strategy\n */\n set resolutionStrategy(strategy: Partial<Omit<A_TYPES__A_DependencyResolutionStrategy<T>, 'pagination'> & { pagination: Partial<A_TYPES__A_Dependency_EntityInjectionPagination> }>) {\n this._resolutionStrategy = {\n ...this._defaultResolutionStrategy,\n ...this._resolutionStrategy,\n ...strategy,\n pagination: {\n ...this._defaultPagination,\n ...(this._resolutionStrategy || {}).pagination,\n ...(strategy.pagination || {})\n },\n };\n }\n\n\n /**\n * Method for the parameters check and all input data before usage\n * \n * @returns \n */\n private initCheck(): this {\n if (!this._resolutionStrategy) {\n throw new A_DependencyError(\n A_DependencyError.ResolutionParametersError,\n `Resolution strategy parameters are not provided for dependency: ${this._name}`\n );\n }\n\n return this;\n }\n\n\n /**\n * Serializes the dependency to a JSON object\n * \n * @returns \n */\n toJSON(): A_TYPES__A_Dependency_Serialized<T> {\n return {\n name: this._name,\n all: this.all,\n require: this.require,\n load: this.load,\n parent: this.parent,\n flat: this.flat,\n create: this.create,\n args: this.args,\n query: this.query,\n pagination: this.pagination,\n }\n }\n}\n\n\n\n","import { A_CommonHelper } from \"./A_Common.helper\";\nimport {\n A_TYPES__Feature_Constructor,\n A_TYPES__FeatureAvailableComponents,\n A_TYPES__FeatureExtendDecoratorTarget\n} from \"@adaas/a-concept/a-feature\";\nimport {\n A_TYPES__Error_Constructor,\n A_TYPES__Error_Init,\n A_TYPES__Error_Serialized\n} from \"@adaas/a-concept/a-error\";\nimport {\n A_Component,\n A_ComponentMeta,\n A_TYPES__Component_Constructor\n} from \"@adaas/a-concept/a-component\";\nimport {\n A_Container,\n A_ContainerMeta,\n A_TYPES__Container_Constructor\n} from \"@adaas/a-concept/a-container\";\nimport {\n A_Entity,\n A_EntityMeta,\n A_TYPES__Entity_Constructor\n} from \"@adaas/a-concept/a-entity\";\nimport { A_Feature } from \"@adaas/a-concept/a-feature\";\nimport {\n A_TYPES__Fragment_Constructor,\n A_Fragment\n} from \"@adaas/a-concept/a-fragment\";\nimport {\n A_Scope,\n A_TYPES__Scope_Constructor,\n A_TYPES__ScopeLinkedComponents,\n A_TYPES__ScopeLinkedConstructors\n} from \"@adaas/a-concept/a-scope\";\nimport {\n A_Caller,\n A_TYPES__Caller_Constructor\n} from \"@adaas/a-concept/a-caller\";\nimport { A_TYPES__AbstractionAvailableComponents } from \"@adaas/a-concept/a-abstraction\";\nimport { A_TYPES__InjectableTargets } from \"@adaas/a-concept/a-inject\";\nimport { ASEID } from \"@adaas/a-concept/aseid\";\nimport {\n A_Dependency,\n A_TYPES__A_DependencyInjectable\n} from \"@adaas/a-concept/a-dependency\";\n\n\n\nexport class A_TypeGuards {\n // ===========================================================================\n // ============================= BASE Type Guards ============================\n // ===========================================================================\n /**\n * Check if value is a string\n * \n * @param value \n * @returns \n */\n static isString(value: any): value is string {\n return typeof value === 'string' || value instanceof String;\n }\n /**\n * Check if value is a number\n * \n * @param value \n * @returns \n */\n static isNumber(value: any): value is number {\n return typeof value === 'number' && isFinite(value);\n }\n /**\n * Check if value is a boolean\n * \n * @param value \n * @returns \n */\n static isBoolean(value: any): value is boolean {\n return typeof value === 'boolean';\n }\n /**\n * Check if value is an array\n * \n * @param value \n * @returns \n */\n static isArray(value: any): value is Array<any> {\n return Array.isArray(value);\n }\n /**\n * Check if value is an object\n * \n * @param value \n * @returns \n */\n static isObject<T extends Object = Object>(value: any): value is T {\n return value && typeof value === 'object' && !Array.isArray(value);\n }\n /**\n * Check if value is a function\n * \n * @param value \n * @returns \n */\n static isFunction(value: any): value is Function {\n return typeof value === 'function';\n }\n\n static isUndefined(value: any): value is undefined {\n return typeof value === 'undefined';\n }\n\n static isRegExp(value: any): value is RegExp {\n return value instanceof RegExp;\n }\n\n\n // ===========================================================================\n // ==========================A-Concept Type Guards ===========================\n // ===========================================================================\n /**\n * Type guard to check if the constructor is of type A_Container\n * \n * @param ctor \n * @returns \n */\n static isContainerConstructor(ctor: any): ctor is A_TYPES__Container_Constructor {\n return typeof ctor === 'function' && A_CommonHelper.isInheritedFrom(ctor, A_Container);\n }\n /**\n * Type guard to check if the constructor is of type A_Component\n * \n * @param ctor \n * @returns \n */\n static isComponentConstructor(ctor: any): ctor is A_TYPES__Component_Constructor {\n return typeof ctor === 'function' && A_CommonHelper.isInheritedFrom(ctor, A_Component);\n }\n /**\n * Type guard to check if the constructor is of type A_Fragment\n * \n * @param ctor \n * @returns \n */\n static isFragmentConstructor(ctor: any): ctor is A_TYPES__Fragment_Constructor {\n return typeof ctor === 'function' && A_CommonHelper.isInheritedFrom(ctor, A_Fragment);\n }\n /**\n * Type guard to check if the constructor is of type A_Entity\n * \n * @param ctor \n * @returns \n */\n static isEntityConstructor(ctor: any): ctor is A_TYPES__Entity_Constructor {\n return typeof ctor === 'function' && A_CommonHelper.isInheritedFrom(ctor, A_Entity);\n }\n /**\n * Type guard to check if the constructor is of type A_Scope\n * \n * @param ctor \n * @returns \n */\n static isScopeConstructor(ctor: any): ctor is A_TYPES__Scope_Constructor {\n return typeof ctor === 'function' && A_CommonHelper.isInheritedFrom(ctor, A_Scope);\n }\n /**\n * Type guard to check if the constructor is of type A_Scope\n * \n * @param ctor \n * @returns \n */\n static isErrorConstructor(ctor: any): ctor is A_TYPES__Error_Constructor {\n return typeof ctor === 'function' && A_CommonHelper.isInheritedFrom(ctor, Error);\n }\n /**\n * Type guard to check if the constructor is of type A_Feature\n * \n * @param ctor \n * @returns \n */\n static isFeatureConstructor(ctor: any): ctor is A_TYPES__Feature_Constructor {\n return typeof ctor === 'function' && A_CommonHelper.isInheritedFrom(ctor, A_Feature);\n }\n /**\n * Type guard to check if the constructor is of type A_Caller\n * \n * @param ctor \n * @returns \n */\n static isCallerConstructor(ctor: any): ctor is A_TYPES__Caller_Constructor {\n return typeof ctor === 'function' && A_CommonHelper.isInheritedFrom(ctor, A_Caller);\n }\n /**\n * Type guard to check if the constructor is of type A_Dependency\n * \n * @param ctor \n * @returns \n */\n static isDependencyConstructor<T extends A_TYPES__A_DependencyInjectable>(ctor: any): ctor is A_Dependency<T> {\n return typeof ctor === 'function' && A_CommonHelper.isInheritedFrom(ctor, A_Dependency);\n }\n // ----------------------------------------------------------------------------\n // Instance type guards\n // ----------------------------------------------------------------------------\n /**\n * Type guard to check if the instance is of type A_Dependency\n * \n * @param instance \n * @returns \n */\n static isDependencyInstance<T extends A_TYPES__A_DependencyInjectable>(instance: any): instance is A_Dependency<T> {\n return instance instanceof A_Dependency;\n }\n /**\n * Type guard to check if the instance is of type A_Container\n * \n * @param instance \n * @returns \n */\n static isContainerInstance(instance: any): instance is A_Container {\n return instance instanceof A_Container;\n }\n /**\n * Type guard to check if the instance is of type A_Component\n * \n * @param instance \n * @returns \n */\n static isComponentInstance(instance: any): instance is A_Component {\n return instance instanceof A_Component;\n }\n\n /**\n * Type guard to check if the instance is of type A_Feature\n * \n * @param instance \n * @returns \n */\n static isFeatureInstance(instance: any): instance is A_Feature {\n return instance instanceof A_Feature;\n }\n /**\n * Type guard to check if the instance is of type A_Fragment\n * \n * @param instance \n * @returns \n */\n static isFragmentInstance(instance: any): instance is A_Fragment {\n return instance instanceof A_Fragment;\n }\n /**\n * Type guard to check if the instance is of type A_Entity\n * \n * @param instance \n * @returns \n */\n static isEntityInstance(instance: any): instance is A_Entity {\n return instance instanceof A_Entity;\n }\n /**\n * Type guard to check if the instance is of type A_Scope\n * \n * @param instance \n * @returns \n */\n static isScopeInstance(instance: any): instance is A_Scope {\n return instance instanceof A_Scope;\n }\n /**\n * Type guard to check if the instance is of type A_Error\n * \n * @param instance \n * @returns \n */\n static isErrorInstance(instance: any): boolean {\n return instance instanceof Error;\n }\n /**\n * Type guard to check if the instance is of type A_ComponentMeta\n * \n * @param instance \n * @returns \n */\n static isComponentMetaInstance(instance: any): instance is A_ComponentMeta {\n return instance instanceof A_ComponentMeta;\n }\n /**\n * Type guard to check if the instance is of type A_ContainerMeta\n * \n * @param instance \n * @returns \n */\n static isContainerMetaInstance(instance: any): instance is A_ContainerMeta {\n return instance instanceof A_ContainerMeta;\n }\n /**\n * Type guard to check if the instance is of type A_EntityMeta\n * \n * @param instance \n * @returns \n */\n static isEntityMetaInstance(instance: any): instance is A_EntityMeta {\n return instance instanceof A_EntityMeta;\n }\n\n\n\n // ==========================================================================\n // ========================= SPECIAL Type Guards =============================\n // ===========================================================================\n static hasASEID(value: any): value is A_Entity | { aseid: any } {\n return value && typeof value === 'object' && 'aseid' in value && (A_TypeGuards.isEntityInstance(value) || A_TypeGuards.isErrorInstance(value));\n }\n\n\n static isConstructorAllowedForScopeAllocation(target: any): target is A_TYPES__ScopeLinkedConstructors {\n return A_TypeGuards.isContainerConstructor(target)\n || A_TypeGuards.isFeatureConstructor(target);\n }\n static isInstanceAllowedForScopeAllocation(target: any): target is A_TYPES__ScopeLinkedComponents {\n return A_TypeGuards.isContainerInstance(target)\n || A_TypeGuards.isFeatureInstance(target);\n }\n\n static isConstructorAvailableForAbstraction(target: any): target is A_TYPES__AbstractionAvailableComponents {\n return A_TypeGuards.isContainerInstance(target)\n || A_TypeGuards.isComponentInstance(target);\n }\n\n\n static isTargetAvailableForInjection(target: any): target is A_TYPES__InjectableTargets {\n return A_TypeGuards.isComponentConstructor(target)\n || A_TypeGuards.isComponentInstance(target)\n || A_TypeGuards.isContainerInstance(target)\n || A_TypeGuards.isEntityInstance(target)\n }\n\n static isAllowedForFeatureCall(param: any): param is A_TYPES__FeatureAvailableComponents {\n return A_TypeGuards.isContainerInstance(param)\n || A_TypeGuards.isComponentInstance(param)\n || A_TypeGuards.isEntityInstance(param);\n }\n\n static isAllowedForFeatureDefinition(param: any): param is A_TYPES__FeatureAvailableComponents {\n return A_TypeGuards.isContainerInstance(param)\n || A_TypeGuards.isComponentInstance(param)\n || A_TypeGuards.isEntityInstance(param);\n }\n\n static isAllowedForFeatureExtension(param: any): param is A_TYPES__FeatureExtendDecoratorTarget {\n return A_TypeGuards.isComponentInstance(param)\n || A_TypeGuards.isContainerInstance(param)\n || A_TypeGuards.isEntityInstance(param);\n }\n\n static isAllowedForAbstractionDefinition(param: any): param is A_TYPES__AbstractionAvailableComponents {\n return A_TypeGuards.isContainerInstance(param)\n || A_TypeGuards.isComponentInstance(param);\n }\n\n static isAllowedForDependencyDefaultCreation(param: any): param is A_TYPES__Entity_Constructor | A_TYPES__Fragment_Constructor {\n return A_TypeGuards.isFragmentConstructor(param)\n || A_CommonHelper.isInheritedFrom(param, A_Fragment)\n || A_TypeGuards.isEntityConstructor(param)\n || A_CommonHelper.isInheritedFrom(param, A_Entity)\n\n }\n\n /**\n * Allows to check if the provided param is of constructor type.\n * \n * @param param \n * @returns \n */\n static isErrorConstructorType<T extends A_TYPES__Error_Init>(param: any): param is T {\n return !!param && A_TypeGuards.isObject(param) && !(param instanceof Error) && \"title\" in param;\n }\n\n\n static isErrorSerializedType<T extends A_TYPES__Error_Serialized>(param: any): param is T {\n return !!param && A_TypeGuards.isObject(param) && !(param instanceof Error) && \"aseid\" in param && ASEID.isASEID(param.aseid);\n }\n\n\n static isPromiseInstance<T>(value: any): value is Promise<T> {\n return value instanceof Promise;\n }\n}","import {\n A_TYPES__FeatureDefineDecoratorConfig,\n A_TYPES__FeatureDefineDecoratorDescriptor,\n A_TYPES__FeatureDefineDecoratorMeta,\n A_TYPES__FeatureDefineDecoratorTarget\n} from \"./A-Feature.types\";\nimport { A_Context } from \"@adaas/a-concept/a-context\";\nimport {\n A_EntityMeta,\n A_TYPES__EntityMetaKey\n} from \"@adaas/a-concept/a-entity\";\nimport {\n A_ContainerMeta,\n A_TYPES__ContainerMetaKey\n} from \"@adaas/a-concept/a-container\";\nimport {\n A_ComponentMeta,\n A_TYPES__ComponentMetaKey\n} from \"@adaas/a-concept/a-component\";\nimport { A_Meta } from \"@adaas/a-concept/a-meta\";\nimport { A_FeatureError } from \"./A-Feature.error\";\nimport { A_TypeGuards} from \"@adaas/a-concept/helpers/A_TypeGuards.helper\";\nimport { A_CommonHelper} from \"@adaas/a-concept/helpers/A_Common.helper\";\n\n/**\n * A-Feature decorator\n * \n * This decorator allows to define a custom lifecycle stage for the Container.\n * These stages are executed in a container-specific order and can be extended by components that are injected into the container.\n * This approach allows to create a flexible and extendable architecture for the application.\n * \n * The main difference between the A-Feature and A-Feature decorators is that A-Feature methods can be inherited and overridden by child classes.\n * \n * \n * @param params \n * @returns \n */\nexport function A_Feature_Define(\n config: Partial<A_TYPES__FeatureDefineDecoratorConfig> = {}\n) {\n return function (\n target: A_TYPES__FeatureDefineDecoratorTarget,\n propertyKey: string,\n descriptor: A_TYPES__FeatureDefineDecoratorDescriptor\n ) {\n // for error messages\n const componentName = A_CommonHelper.getComponentName(target)\n\n\n if (!A_TypeGuards.isAllowedForFeatureDefinition(target))\n throw new A_FeatureError(\n A_FeatureError.FeatureDefinitionError,\n `A-Feature cannot be defined on the ${componentName} level`\n );\n\n const meta: A_EntityMeta | A_ContainerMeta | A_ComponentMeta = A_Context.meta(target.constructor as any);\n\n let metaKey;\n\n switch (true) {\n case A_TypeGuards.isEntityInstance(target):\n metaKey = A_TYPES__EntityMetaKey.FEATURES;\n break;\n case A_TypeGuards.isContainerInstance(target):\n metaKey = A_TYPES__ContainerMetaKey.FEATURES\n break;\n case A_TypeGuards.isComponentInstance(target):\n metaKey = A_TYPES__ComponentMetaKey.FEATURES\n break;\n }\n\n\n // Get the existed metadata or create a new one\n const existedMeta: A_Meta<{\n /**\n * Where Key is the name of the feature\n * \n * Where value is the list of features\n */\n [Key: string]: A_TYPES__FeatureDefineDecoratorMeta\n }> = meta.get(metaKey) || new A_Meta();\n\n\n const name = config.name || propertyKey;\n // default to false\n const invoke = config.invoke || false;\n\n\n // Set the metadata of the method to define a custom Feature with name \n existedMeta.set(propertyKey, {\n name: `${target.constructor.name}.${name}`,\n handler: propertyKey,\n invoke: invoke,\n template: config.template && config.template.length ? config.template.map(\n item => ({\n ...item,\n before: item.before || '',\n after: item.after || '',\n behavior: item.behavior || 'sync',\n throwOnError: true,\n override: item.override || ''\n })\n ) : [],\n });\n\n // Update the metadata of the container with the new Feature definition\n A_Context\n .meta(target.constructor as any)\n .set(\n metaKey,\n existedMeta\n );\n\n const originalMethod = descriptor.value!;\n\n // Wrap the original method to add the call to `call`\n // this helps to automatically call the container/entity/component method when it's called\n descriptor.value = function (...args: any[]) {\n\n // Call the original method\n if (!invoke)\n return originalMethod.apply(this, args);\n else\n originalMethod.apply(this, args);\n\n // Call your `call` with the function name\n if (typeof (this as A_TYPES__FeatureDefineDecoratorTarget).call === \"function\" && invoke)\n return (this as A_TYPES__FeatureDefineDecoratorTarget).call(name);\n\n };\n\n return descriptor;\n };\n}","import { A_Context } from \"@adaas/a-concept/a-context\";\nimport { A_Meta } from \"@adaas/a-concept/a-meta\";\nimport {\n A_TYPES__FeatureExtendDecoratorConfig,\n A_TYPES__FeatureExtendDecoratorDescriptor,\n A_TYPES__FeatureExtendDecoratorScopeItem,\n A_TYPES__FeatureExtendDecoratorTarget\n} from \"./A-Feature.types\";\nimport { A_TYPES__ComponentMetaKey } from \"@adaas/a-concept/a-component\";\nimport { A_FeatureError } from \"./A-Feature.error\";\nimport { A_TypeGuards} from \"@adaas/a-concept/helpers/A_TypeGuards.helper\";\nimport { A_CommonHelper} from \"@adaas/a-concept/helpers/A_Common.helper\";\nimport { A_TYPES__EntityMetaKey } from \"@adaas/a-concept/a-entity\";\nimport { A_TYPES__ContainerMetaKey } from \"@adaas/a-concept/a-container\";\n\n\n\n\n/**\n * A-Extend decorator\n * \n * This decorator allows to define a custom Extend stage for the Container.\n * These stages are executed in a container-specific order and can be extended by components that are injected into the container.\n * This approach allows to create a flexible and extendable architecture for the application.\n * \n * The main difference between the A-Extend and A-Extend decorators is that A-Extend methods can be inherited and overridden by child classes.\n * \n * \n * @param params \n * @returns \n */\n/**\n * Use regexp in case if you need more flexibility and control over the name of the method\n * \n * @param regexp \n */\nexport function A_Feature_Extend(\n /**\n * The regular expression to match the name of the Feature method to be extended\n * \n * Example:\n * \n * ```ts\n * @A_Feature.Extend(/.*\\.load/)\n * ```\n */\n regexp: RegExp\n)\n/**\n * In this case the name configurations will be used as an input to get scope and name of target function\n * [!] Not that for all SCOPE will be used OR operator\n * \n * @param config \n */\nexport function A_Feature_Extend(\n /**\n * Configuration for the A-Feature-Extend decorator\n */\n config: Partial<A_TYPES__FeatureExtendDecoratorConfig>\n)\n/**\n * In this case the name of function will be used as a name of the Feature.\n * [!] AND it will be applicable for ANY element where the name is the same as the name of the function\n */\nexport function A_Feature_Extend()\nexport function A_Feature_Extend(\n param1?: Partial<A_TYPES__FeatureExtendDecoratorConfig> | RegExp\n) {\n return function (\n target: A_TYPES__FeatureExtendDecoratorTarget,\n propertyKey: string,\n descriptor: A_TYPES__FeatureExtendDecoratorDescriptor\n ) {\n // for error messages\n const componentName = A_CommonHelper.getComponentName(target)\n\n if (!A_TypeGuards.isAllowedForFeatureExtension(target))\n throw new A_FeatureError(\n A_FeatureError.FeatureExtensionError,\n `A-Feature-Extend cannot be applied on the ${componentName} level`\n );\n\n let targetRegexp: RegExp;\n let behavior: 'sync' | 'async' = 'sync';\n let before: string = '';\n let after: string = '';\n let override: string = '';\n let include: Array<A_TYPES__FeatureExtendDecoratorScopeItem> = [];\n let exclude: Array<A_TYPES__FeatureExtendDecoratorScopeItem> = [];\n let throwOnError: boolean = true;\n let metaKey;\n\n\n switch (true) {\n case A_TypeGuards.isEntityInstance(target):\n metaKey = A_TYPES__EntityMetaKey.EXTENSIONS;\n break;\n case A_TypeGuards.isContainerInstance(target):\n metaKey = A_TYPES__ContainerMetaKey.EXTENSIONS\n break;\n case A_TypeGuards.isComponentInstance(target):\n metaKey = A_TYPES__ComponentMetaKey.EXTENSIONS\n break;\n }\n\n\n switch (true) {\n case A_TypeGuards.isRegExp(param1):\n targetRegexp = param1;\n break;\n\n case !!param1 && typeof param1 === 'object':\n\n if (Array.isArray(param1.scope))\n include = param1.scope;\n else if (!!param1.scope && typeof param1.scope === 'object') {\n if (Array.isArray(param1.scope.include))\n include = param1.scope.include;\n if (Array.isArray(param1.scope.exclude))\n exclude = param1.scope.exclude;\n }\n\n\n targetRegexp = buildTargetRegexp(param1, include, exclude, propertyKey);\n\n behavior = param1.behavior || behavior;\n throwOnError = param1.throwOnError !== undefined ? param1.throwOnError : throwOnError;\n\n before = A_TypeGuards.isArray(param1.before)\n ? new RegExp(`^${param1.before.join('|').replace(/\\./g, '\\\\.')}$`).source\n : param1.before instanceof RegExp\n ? param1.before.source\n : ''\n after = A_TypeGuards.isArray(param1.after)\n ? new RegExp(`^${param1.after.join('|').replace(/\\./g, '\\\\.')}$`).source\n : param1.after instanceof RegExp\n ? param1.after.source\n : ''\n\n override = A_TypeGuards.isArray(param1.override)\n ? new RegExp(`^${param1.override.join('|').replace(/\\./g, '\\\\.')}$`).source\n : param1.override instanceof RegExp\n ? param1.override.source\n : ''\n break;\n\n default:\n targetRegexp = new RegExp(`^.*${propertyKey.replace(/\\./g, '\\\\.')}$`);\n break;\n }\n\n\n const existedDefinitions = A_Context\n .meta(target)\n .get(metaKey);\n\n // Get the existed metadata or create a new one\n const meta = A_Context.meta(target)\n\n const existedMeta = meta.get(metaKey)\n ? new A_Meta().from(meta.get(metaKey)!)\n : new A_Meta();\n\n if (existedDefinitions\n && existedDefinitions.size()\n && existedDefinitions.has(propertyKey)\n && existedDefinitions.get(propertyKey)!.invoke\n ) {\n throw new A_FeatureError(\n A_FeatureError.FeatureExtensionError,\n `A-Feature-Extend cannot be used on the method \"${propertyKey}\" because it is already defined as a Feature with \"invoke\" set to true. Please remove the A-Feature-Extend decorator or set \"invoke\" to false in the A-Feature decorator.`\n );\n }\n\n const existedMetaValue = [\n ...(existedMeta.get(targetRegexp.source) || [])\n ];\n\n // ensure that other regexps are preserved\n for (const [key, handlers] of existedMeta.entries()) {\n\n const indexInAnother = handlers.findIndex(item => item.handler === propertyKey);\n\n // if the same handler exists in another regexp, remove it\n if (key !== targetRegexp.source && indexInAnother !== -1) {\n handlers.splice(indexInAnother, 1);\n // if no handlers left for this regexp, remove the regexp entry\n if (handlers.length === 0) {\n existedMeta.delete(key);\n } else {\n existedMeta.set(key, handlers);\n }\n }\n }\n\n const existedIndex = existedMetaValue.findIndex(item => item.handler === propertyKey);\n\n const extension = {\n name: targetRegexp.source,\n handler: propertyKey,\n behavior,\n before,\n after,\n throwOnError,\n override\n }\n\n if (existedIndex !== -1) {\n // Update the existing method in the metadata\n existedMetaValue[existedIndex] = extension;\n } else {\n // Add the new method to the metadata\n existedMetaValue.push(extension);\n }\n\n\n\n // Set the metadata of the method to define a custom Feature with name\n existedMeta.set(targetRegexp.source, existedMetaValue);\n\n // Update the metadata of the container with the new Feature definition\n A_Context\n .meta(target)\n .set(metaKey, existedMeta);\n };\n}\n\n\n/**\n * Builds a target regular expression based on the provided parameters.\n * \n * @param param1 - The first parameter, which can be a string or an object.\n * @param include - An array of items to include in the regular expression.\n * @param exclude - An array of items to exclude from the regular expression.\n * @param propertyKey - The property key to use in the regular expression.\n * @returns A regular expression object.\n */\nexport function buildTargetRegexp(\n param1: any,\n include: any[],\n exclude: any[],\n propertyKey: string\n) {\n const includePart = include.length\n ? `(${include.map(el => el.name).join('|')})`\n : `.*`;\n\n const excludePart = exclude.length\n ? `(?!${exclude.map(el => el.name).join('|')})`\n : ``;\n\n const pattern = param1.scope\n ? `^${excludePart}${includePart}\\\\.${param1.name || propertyKey}$`\n : `.*\\\\.${param1.name || propertyKey}$`;\n\n return new RegExp(pattern);\n}","import type { A_Dependency } from \"@adaas/a-concept/a-dependency\"\n\n\n\nexport enum A_TYPES__A_Stage_Status {\n /**\n * The stage is currently being processed\n */\n PROCESSING = 'PROCESSING',\n /**\n * The stage has been completed\n */\n COMPLETED = 'COMPLETED',\n /**\n * The stage has failed\n */\n FAILED = 'FAILED',\n /**\n * The stage has been skipped\n */\n SKIPPED = 'SKIPPED',\n /**\n * The stage has been paused\n */\n // PAUSED = 'PAUSED',\n /**\n * The stage has been stopped\n */\n // STOPPED = 'STOPPED',\n /**\n * The stage has been started\n */\n // STARTED = 'STARTED',\n /**\n * The stage has been initialized\n */\n INITIALIZED = 'INITIALIZED',\n /**\n * The stage has been aborted\n */\n ABORTED = 'ABORTED'\n}\n\nexport type A_TYPES_StageExecutionBehavior = 'async' | 'sync'\n\n\nexport type A_TYPES__A_StageStep = {\n /**\n * The component to be called\n */\n dependency: A_Dependency,\n /**\n * The method to be called on the component\n */\n handler: string,\n /**\n * Original Feature Extension name\n * \n * [!] could be string or regex\n * \n */\n name: string,\n\n /**\n * In case its async it will be executed independently from the main thread.\n * \n * [!] However, in case of sync, it will be executed in the main thread.in the order of the declaration.\n * \n */\n behavior: A_TYPES_StageExecutionBehavior\n\n /**\n * Allows to define the order of the execution of the method.\n * \n * [!] In case the method has circular dependencies it will Throw an error.\n * \n */\n before: string\n\n /**\n * Allows to define the order of the execution of the method.\n * \n * [!] In case the method has circular dependencies it will Throw an error.\n * \n */\n after: string,\n\n /**\n * Indicates whether to throw an error if the step fails.\n * \n * [!] By default is true\n */\n throwOnError: boolean\n\n /**\n * \n */\n override: string\n}\n\n\n\nexport type A_TYPES__Stage_Serialized = {\n\n /**\n * The name of the stage\n */\n name: string,\n\n /**\n * The status of the stage\n * \n */\n status: A_TYPES__A_Stage_Status,\n\n\n}\n\n\n\nexport type A_TYPES__A_StageStepProcessingExtraParams = {\n steps: A_TYPES__A_StageStep[]\n filter: (step: A_TYPES__A_StageStep) => boolean\n}\n","import { A_Error } from \"@adaas/a-concept/a-error\";\n\n\nexport class A_StageError extends A_Error {\n\n static readonly ArgumentsResolutionError = 'A-Stage Arguments Resolution Error';\n\n\n static get CompileError(): string {\n return 'Unable to compile A-Stage';\n }\n\n}\n","import {\n A_TYPES__A_Stage_Status,\n A_TYPES__A_StageStep,\n A_TYPES__Stage_Serialized\n} from \"./A-Stage.types\";\nimport { A_Context } from \"@adaas/a-concept/a-context\";\nimport type { A_Feature } from \"@adaas/a-concept/a-feature\";\nimport type { A_Scope } from \"@adaas/a-concept/a-scope\";\nimport { A_StageError } from \"./A-Stage.error\";\nimport { A_Error } from \"@adaas/a-concept/a-error\";\nimport { A_TypeGuards} from \"@adaas/a-concept/helpers/A_TypeGuards.helper\";\nimport type { A_TYPES__Container_Constructor } from \"@adaas/a-concept/a-container\";\nimport type { A_TYPES__Component_Constructor } from \"@adaas/a-concept/a-component\";\nimport type { A_TYPES__A_DependencyInjectable } from \"@adaas/a-concept/a-dependency\";\n\n\n\nexport class A_Stage {\n\n /**\n * The feature that owns this stage\n */\n private readonly _feature!: A_Feature;\n /**\n * Initial Instructions to process the stage\n */\n private readonly _definition!: A_TYPES__A_StageStep;\n /**\n * Possible errors during stage processing\n */\n private _error?: A_Error;\n /**\n * Indicates the current status of the stage\n */\n private _status: A_TYPES__A_Stage_Status = A_TYPES__A_Stage_Status.INITIALIZED;\n\n\n /**\n * A_Stage is a callable A_Function within A_Feature that should be run with specific parameters.\n * [!] Depending on the Stage Definition type sync/async function can be executed correspondingly.\n * \n * A-Stage is a common object that uses to simplify logic and re-use of A-Feature internals for better composition. \n */\n constructor(\n /**\n * The feature that owns this stage\n */\n feature: A_Feature,\n /**\n * The step definitions of the stage\n */\n step: A_TYPES__A_StageStep\n ) {\n this._feature = feature;\n this._definition = step;\n }\n\n /**\n * Returns the name of the stage\n */\n get name(): string {\n return this.toString();\n }\n /**\n * Returns the definition of the stage\n */\n get definition(): A_TYPES__A_StageStep {\n return this._definition;\n }\n /**\n * Returns the current status of the stage\n */\n get status(): A_TYPES__A_Stage_Status {\n return this._status;\n }\n /**\n * Returns the feature that owns this stage\n */\n get feature(): A_Feature {\n return this._feature;\n }\n /**\n * Returns true if the stage is processed (completed, failed, or skipped)\n */\n get isProcessed(): boolean {\n return this._status === A_TYPES__A_Stage_Status.COMPLETED\n || this._status === A_TYPES__A_Stage_Status.FAILED\n || this._status === A_TYPES__A_Stage_Status.SKIPPED;\n }\n /**\n * Returns the error of the stage\n */\n get error(): A_Error | undefined {\n return this._error;\n }\n\n /**\n * Resolves the arguments of the step\n * \n * @param step \n * @returns \n */\n protected getStepArgs(\n scope: A_Scope,\n step: A_TYPES__A_StageStep\n ) {\n let resolverConstructor: A_TYPES__Container_Constructor | A_TYPES__Component_Constructor =\n (step.dependency.target as A_TYPES__Container_Constructor | A_TYPES__Component_Constructor)\n || scope.resolveConstructor(step.dependency.name);\n\n return A_Context\n .meta(resolverConstructor)\n .injections(step.handler)\n .map(dependency => {\n switch (true) {\n case A_TypeGuards.isCallerConstructor(dependency.target):\n return this._feature.caller.component;\n\n case A_TypeGuards.isFeatureConstructor(dependency.target):\n return this._feature;\n\n default: {\n return scope.resolve(dependency);\n }\n }\n })\n }\n\n\n /**\n * Resolves the component of the step\n * \n * @param step \n * @returns \n */\n protected getStepComponent(\n scope: A_Scope,\n step: A_TYPES__A_StageStep\n ) {\n const { dependency, handler } = step;\n\n let instance: A_TYPES__A_DependencyInjectable | undefined =\n (scope.resolve(dependency) || this.feature.scope.resolve(dependency)) as A_TYPES__A_DependencyInjectable\n\n\n if (!instance)\n throw new A_StageError(\n A_StageError.CompileError,\n `Unable to resolve component ${dependency.name} from scope ${scope.name}`\n );\n\n if (!instance[handler])\n throw new A_StageError(\n A_StageError.CompileError,\n `Handler ${handler} not found in ${instance.constructor.name}`\n );\n\n return instance;\n }\n\n\n\n /**\n * Calls the handler of the step\n * \n * @param step \n * @returns \n */\n protected callStepHandler(\n step: A_TYPES__A_StageStep,\n scope: A_Scope\n ): {\n handler: Function,\n params: any[]\n } {\n // 1) Resolve component\n const component = this.getStepComponent(scope, step);\n // 2) Resolve arguments\n const callArgs = this.getStepArgs(scope, step);\n\n // 3) Call handler\n return {\n handler: component[step.handler].bind(component),\n params: callArgs\n }\n }\n\n\n skip() {\n this._status = A_TYPES__A_Stage_Status.SKIPPED;\n }\n\n\n /**\n * This method processes the stage by executing all the steps\n * \n * @param scope - Scope to be used to resolve the steps dependencies\n */\n process(\n /**\n * Scope to be used to resolve the steps dependencies\n */\n scope?: A_Scope,\n ): Promise<void> | void {\n\n const targetScope = A_TypeGuards.isScopeInstance(scope)\n ? scope\n : this._feature.scope;\n\n if (!this.isProcessed) {\n this._status = A_TYPES__A_Stage_Status.PROCESSING;\n\n const { handler, params } = this.callStepHandler(this._definition, targetScope);\n\n const result = handler(...params);\n\n if (A_TypeGuards.isPromiseInstance(result)) {\n\n return new Promise<void>(\n async (resolve, reject) => {\n try {\n await result;\n\n this.completed();\n\n return resolve();\n } catch (error) {\n const wrappedError = new A_Error(error as any);\n\n this.failed(wrappedError);\n\n if (this._definition.throwOnError) {\n return resolve();\n } else {\n return reject(wrappedError);\n }\n }\n });\n } else {\n this.completed();\n }\n }\n\n }\n\n\n // ==========================================\n // ============ Status methods =============\n // ==========================================\n\n protected completed() {\n this._status = A_TYPES__A_Stage_Status.COMPLETED;\n }\n\n protected failed(\n error: Error | A_Error | any\n ) {\n this._error = new A_Error(error);\n\n this._status = A_TYPES__A_Stage_Status.FAILED;\n }\n\n\n\n // ==========================================\n // ============ Serialization ===============\n // ==========================================\n /**\n * Serializes the stage to JSON\n * \n */\n toJSON(): A_TYPES__Stage_Serialized {\n return {\n name: this.name,\n status: this.status,\n }\n }\n\n /**\n * Returns a string representation of the stage\n * \n * @returns \n */\n toString() {\n return `A-Stage(${this._feature.name}::${this._definition.behavior}@${this._definition.handler})`;\n }\n} ","import { A_Error } from \"@adaas/a-concept/a-error\";\n\n\n\nexport class A_StepManagerError extends A_Error {\n\n\n static readonly CircularDependencyError = 'A-StepManager Circular Dependency Error';\n\n}","import type {\n A_Feature,\n A_TYPES__FeatureDefineDecoratorTemplateItem\n} from \"@adaas/a-concept/a-feature\";\nimport {\n A_Stage,\n A_TYPES__A_StageStep\n} from \"@adaas/a-concept/a-stage\";\nimport { A_StepManagerError } from \"./A-StepManager.error\";\n\nexport class A_StepsManager {\n\n public entities: A_TYPES__A_StageStep[];\n public graph: Map<string, Set<string>>;\n public visited: Set<string>;\n public tempMark: Set<string>;\n public sortedEntities: string[];\n\n\n private _isBuilt: boolean = false;\n\n constructor(entities: Array<A_TYPES__FeatureDefineDecoratorTemplateItem>) {\n this.entities = this.prepareSteps(entities);\n\n this.graph = new Map();\n this.visited = new Set();\n this.tempMark = new Set();\n this.sortedEntities = [];\n\n }\n\n private prepareSteps(\n entities: Array<A_TYPES__FeatureDefineDecoratorTemplateItem>\n ): Array<A_TYPES__A_StageStep> {\n return entities\n .map(step => ({\n ...step,\n\n behavior: step.behavior || 'sync',\n before: step.before || '',\n after: step.after || '',\n override: step.override || '',\n throwOnError: false\n }));\n }\n\n private ID(step: A_TYPES__A_StageStep) {\n return `${step.dependency.name}.${step.handler}`;\n }\n\n private buildGraph() {\n if (this._isBuilt) return;\n this._isBuilt = true;\n\n // Filter override\n this.entities = this.entities\n .filter((step, i, self) =>\n !self.some(s => s.override ? new RegExp(s.override).test(this.ID(step)) : false)\n );\n\n // Initialize graph nodes\n this.entities.forEach(entity => this.graph.set(this.ID(entity), new Set()));\n\n // Add directed edges based on 'before' and 'after'\n this.entities.forEach(entity => {\n const entityId = this.ID(entity);\n\n // Add edges for 'before' dependencies\n // If entity should execute before targets, then targets depend on entity\n // So we add edges: target -> entity (target depends on entity)\n if (entity.before) {\n const targets = this.matchEntities(entityId, entity.before);\n targets.forEach(target => {\n if (!this.graph.has(target)) this.graph.set(target, new Set());\n this.graph.get(target)!.add(entityId); // target depends on entity\n });\n }\n\n // Add edges for 'after' dependencies \n // If entity should execute after sources, then entity depends on sources\n // So we add edges: entity -> source (entity depends on source)\n if (entity.after) {\n const sources = this.matchEntities(entityId, entity.after);\n\n sources.forEach(source => {\n if (!this.graph.has(entityId)) this.graph.set(entityId, new Set());\n this.graph.get(entityId)!.add(source); // entity depends on source\n });\n }\n });\n }\n\n // Match entities by name or regex\n private matchEntities(entityId: string, pattern: string): string[] {\n const regex = new RegExp(pattern);\n\n return this.entities\n .filter(entity => regex.test(this.ID(entity)) && this.ID(entity) !== entityId)\n .map(entity => this.ID(entity));\n }\n\n // Topological sort with cycle detection\n private visit(node: string): void {\n if (this.tempMark.has(node)) {\n return;\n // TODO: maybe we have to keep this error but only for partial cases\n throw new A_StepManagerError(\n A_StepManagerError.CircularDependencyError,\n `Circular dependency detected involving step: ${node}. Make sure that your 'before' and 'after' dependencies do not create cycles.`\n );\n }\n\n if (!this.visited.has(node)) {\n this.tempMark.add(node);\n\n\n (this.graph.get(node) || []).forEach(neighbor => this.visit(neighbor));\n this.tempMark.delete(node);\n this.visited.add(node);\n this.sortedEntities.push(node);\n\n // // Visit neighbors in stable order (preserving original order)\n // const neighbors = Array.from(this.graph.get(node) || []);\n // // neighbors.sort((a, b) => {\n // // const orderA = this.originalOrder.get(a) || 0;\n // // const orderB = this.originalOrder.get(b) || 0;\n // // return orderA - orderB;\n // // });\n\n // neighbors.forEach(neighbor => this.visit(neighbor));\n // this.tempMark.delete(node);\n // this.visited.add(node);\n // this.sortedEntities.push(node);\n }\n }\n\n\n toSortedArray(): Array<string> {\n this.buildGraph();\n\n // Start topological sort\n this.entities.forEach(entity => {\n if (!this.visited.has(this.ID(entity))) this.visit(this.ID(entity));\n });\n\n return this.sortedEntities;\n }\n\n // Sort the entities based on dependencies\n toStages(feature: A_Feature): Array<A_Stage> {\n\n\n const sortedNames = this.toSortedArray();\n\n\n // Map sorted names back to entity objects\n return sortedNames\n .map(id => {\n const step = this.entities.find(entity => this.ID(entity) === id)!;\n\n\n return new A_Stage(feature, step);\n });\n }\n}\n\n\n","import {\n A_TYPES__Feature_Init,\n A_TYPES__Feature_InitWithComponent,\n A_TYPES__Feature_InitWithTemplate,\n A_TYPES__FeatureAvailableComponents,\n A_TYPES__FeatureState,\n} from \"./A-Feature.types\";\nimport { A_Feature_Define } from \"./A-Feature-Define.decorator\";\nimport { A_Feature_Extend } from \"./A-Feature-Extend.decorator\";\nimport {\n A_Stage,\n A_StageError\n} from \"@adaas/a-concept/a-stage\";\nimport { A_StepsManager } from \"@adaas/a-concept/a-step-manager\";\nimport { A_TypeGuards} from \"@adaas/a-concept/helpers/A_TypeGuards.helper\";\nimport { A_FeatureError } from \"./A-Feature.error\";\nimport { A_Context } from \"@adaas/a-concept/a-context\";\nimport { A_Caller } from \"@adaas/a-concept/a-caller\";\nimport { A_Scope } from \"@adaas/a-concept/a-scope\";\nimport { A_Component } from \"@adaas/a-concept/a-component\";\n\n\n/**\n * A_Feature is representing a feature that can be executed across multiple components\n * This class stores the steps of the feature and executes them in order of appearance\n * \n * Using A_Feature.Define and A_Feature.Extend decorators to define and extend the feature methods \n * across the different, distributed components\n * \n */\nexport class A_Feature<T extends A_TYPES__FeatureAvailableComponents = A_TYPES__FeatureAvailableComponents> {\n\n // =============================================================================\n // --------------------------- Static Methods ---------------------------------\n // =============================================================================\n /**\n * Define a new A-Feature\n */\n static get Define(): typeof A_Feature_Define {\n return A_Feature_Define;\n }\n\n /**\n * Extend an existing A-Feature\n */\n static get Extend(): typeof A_Feature_Extend {\n return A_Feature_Extend;\n }\n // =============================================================================\n // --------------------------- Internal Properties ----------------------------\n // =============================================================================\n /**\n * The name of the Feature\n */\n protected _name!: string;\n /**\n * List of stages that are part of this Feature\n */\n protected _stages: Array<A_Stage> = [];\n /**\n * The Stage currently being processed\n */\n protected _current?: A_Stage;\n /**\n * Actual Index of the current Stage being processed\n */\n protected _index: number = 0;\n /**\n * Steps Manager to organize the steps into stages\n */\n protected _SM!: A_StepsManager;\n /**\n * The Caller that initiated the Feature call\n */\n protected _caller!: A_Caller<T>;\n /**\n * The current state of the Feature\n */\n protected _state: A_TYPES__FeatureState = A_TYPES__FeatureState.INITIALIZED;\n /**\n * The error that caused the Feature to be interrupted\n */\n protected _error?: A_FeatureError\n\n\n\n /**\n * A-Feature is a pipeline distributed by multiple components that can be easily attached or detached from the scope. \n * Feature itself does not have scope, but attached to the caller who dictates how feature should be processed. \n * \n * Comparing to A-Command Feature does not store any state except statuses for better analysis. \n * \n * [!] Note: If A-Feature should have result use A-Fragment \n * \n * @param params \n */\n constructor(\n /**\n * Feature Initialization parameters\n */\n params: A_TYPES__Feature_Init<T>\n ) {\n this.validateParams(params);\n\n const initializer = this.getInitializer(params);\n // the returned initializer is already bound to `this` (we used .bind(this)),\n // so calling it will run the appropriate logic on this instance:\n initializer.call(this, params);\n }\n\n\n /**\n * The name of the Feature\n */\n get name(): string { return this._name; }\n /**\n * The error that caused the Feature to be interrupted\n */\n get error(): A_FeatureError | undefined { return this._error; }\n /**\n * The current state of the Feature\n */\n get state(): A_TYPES__FeatureState { return this._state; }\n /**\n * Sets the current state of the Feature\n */\n get index(): number { return this._index; }\n /**\n * Returns the current A-Feature Stage\n */\n get stage(): A_Stage | undefined { return this._current; }\n /**\n * The Caller that initiated the Feature call\n */\n get caller(): A_Caller<T> { return this._caller; }\n /**\n * The Scope allocated for the Feature Execution\n */\n get scope(): A_Scope { return A_Context.scope(this); }\n /**\n * The number of stages in the feature\n */\n get size(): number {\n return this._stages.length;\n }\n\n /**\n * This method checks if the A-Feature is done\n * \n * @returns \n */\n get isDone(): boolean {\n return !this.stage\n || this._index >= this._stages.length;\n }\n /**\n * Indicates whether the feature has been processed (completed, failed, or interrupted)\n */\n get isProcessed(): boolean {\n return this.state === A_TYPES__FeatureState.COMPLETED\n || this.state === A_TYPES__FeatureState.FAILED\n || this.state === A_TYPES__FeatureState.INTERRUPTED;\n }\n /**\n * Iterator to iterate over the steps of the feature\n * \n * @returns \n */\n [Symbol.iterator](): Iterator<A_Stage, any> {\n return {\n next: (): IteratorResult<A_Stage, any> => {\n if (!this.isDone) {\n this._current = this._stages[this._index];\n this._index++;\n\n return {\n value: this._current,\n done: false\n };\n } else {\n this._current = undefined; // Reset current on end\n\n return {\n value: undefined,\n done: true\n };\n }\n }\n };\n }\n\n // ============================================================================\n // ------------------------ Initialization Methods ----------------------------\n // ============================================================================\n /**\n * Validates the provided parameters for A-Feature initialization\n * \n * @param params \n */\n protected validateParams(\n params: A_TYPES__Feature_Init<T>\n ) {\n if (!params || typeof params !== 'object') {\n throw new A_FeatureError(\n A_FeatureError.FeatureInitializationError,\n `Invalid A-Feature initialization parameters of type: ${typeof params} with value: ${JSON.stringify(params).slice(0, 100)}...`\n );\n }\n }\n /**\n * Returns the appropriate initializer method based on the provided parameters\n * \n * @param params \n * @returns \n */\n protected getInitializer(\n params: A_TYPES__Feature_Init<T>\n ): (param1: any) => void | (() => void) {\n\n switch (true) {\n case !('template' in params):\n return this.fromComponent;\n\n case 'template' in params:\n return this.fromTemplate;\n default:\n throw new A_FeatureError(\n A_FeatureError.FeatureInitializationError,\n `Invalid A-Feature initialization parameters of type: ${typeof params} with value: ${JSON.stringify(params).slice(0, 100)}...`\n );\n }\n }\n /**\n * Initializes the A-Feature from the provided template\n * \n * @param params \n */\n protected fromTemplate(\n params: A_TYPES__Feature_InitWithTemplate<T>\n ) {\n if (!params.template || !Array.isArray(params.template)) {\n throw new A_FeatureError(\n A_FeatureError.FeatureInitializationError,\n `Invalid A-Feature template provided of type: ${typeof params.template} with value: ${JSON.stringify(params.template).slice(0, 100)}...`\n );\n }\n\n if (!params.component && (!params.scope || !(params.scope instanceof A_Scope))) {\n throw new A_FeatureError(\n A_FeatureError.FeatureInitializationError,\n `Invalid A-Feature scope provided of type: ${typeof params.scope} with value: ${JSON.stringify(params.scope).slice(0, 100)}...`\n );\n }\n\n // 1) save feature name\n this._name = params.name;\n\n // 2) get scope from where feature is called\n // 2) get scope from where feature is called\n let componentScope: A_Scope | undefined;\n // uses to extend a component scope if component is not registered in the context\n let externalScope: A_Scope | undefined = params.scope;\n\n try {\n if (params.component)\n componentScope = A_Context.scope(params.component);\n } catch (error) {\n if (!externalScope)\n throw error;\n }\n\n if (componentScope && externalScope && !externalScope.isInheritedFrom(componentScope)) {\n externalScope.inherit(componentScope);\n }\n\n // 3) create caller wrapper for the simple injection of the caller component\n // - Just to prevent issues with undefined caller in features without component\n // - TODO: maybe would be better to allow passing caller in params?\n this._caller = new A_Caller<T>(params.component || new A_Component() as T);\n\n // 4) allocate new scope for the feature\n const scope = A_Context.allocate(this);\n\n // 5) ensure that the scope of the caller component is inherited by the feature scope\n scope.inherit(componentScope || externalScope!);\n\n // 6) create steps manager to organize steps into stages\n this._SM = new A_StepsManager(params.template);\n\n // 7) create stages from the steps\n this._stages = this._SM.toStages(this);\n\n // 8) set the first stage as current\n this._current = this._stages[0];\n }\n /**\n * Initializes the A-Feature from the provided component\n * \n * @param params \n */\n protected fromComponent(\n params: A_TYPES__Feature_InitWithComponent<T>\n ) {\n if (!params.component || !A_TypeGuards.isAllowedForFeatureDefinition(params.component)) {\n throw new A_FeatureError(\n A_FeatureError.FeatureInitializationError,\n `Invalid A-Feature component provided of type: ${typeof params.component} with value: ${JSON.stringify(params.component).slice(0, 100)}...`\n );\n }\n\n // 1) save feature name\n this._name = params.name;\n\n // 2) get scope from where feature is called\n let componentScope: A_Scope | undefined;\n // uses to extend a component scope if component is not registered in the context\n let externalScope: A_Scope | undefined = params.scope;\n\n try {\n componentScope = A_Context.scope(params.component);\n } catch (error) {\n if (!externalScope)\n throw error;\n }\n\n if (componentScope && externalScope && !externalScope.isInheritedFrom(componentScope)) {\n externalScope.inherit(componentScope);\n }\n\n // 3) create caller wrapper for the simple injection of the caller component\n this._caller = new A_Caller<T>(params.component);\n\n // 4) allocate new scope for the feature\n const scope = A_Context.allocate(this);\n\n // 5) ensure that the scope of the caller component is inherited by the feature scope\n scope.inherit(componentScope || externalScope!);\n\n // 6) retrieve the template from the context\n const template = A_Context.featureTemplate(this._name, this._caller.component, scope);\n\n // 7) create steps manager to organize steps into stages\n this._SM = new A_StepsManager(template);\n\n // 8) create stages from the steps\n this._stages = this._SM.toStages(this);\n\n // 9) set the first stage as current\n this._current = this._stages[0];\n }\n\n\n // ============================================================================\n // ----------------------- Main Processing Methods ----------------------------\n // ============================================================================\n /**\n * This method processes the feature by executing all the stages\n * \n */\n process(\n /**\n * Optional scope to be used to resolve the steps dependencies\n * If not provided, the scope of the caller component will be used\n */\n scope?: A_Scope,\n ): Promise<void> | void {\n try {\n // It seems like this is a bad idea to enforce scope inheritance here\n // ---------------------------------------------------------------\n // if (scope && !scope.isInheritedFrom(A_Context.scope(this)))\n // scope.inherit(A_Context.scope(this));\n\n if (this.isProcessed)\n return;\n\n this._state = A_TYPES__FeatureState.PROCESSING;\n\n // Convert iterator to array to get all stages\n const stages = Array.from(this);\n\n return this.processStagesSequentially(stages, scope, 0);\n\n } catch (error) {\n throw this.failed(new A_FeatureError({\n title: A_FeatureError.FeatureProcessingError,\n description: `An error occurred while processing the A-Feature: ${this.name}. Failed at stage: ${this.stage?.name || 'N/A'}.`,\n stage: this.stage,\n originalError: error\n }));\n }\n }\n\n /**\n * Process stages one by one, ensuring each stage completes before starting the next\n */\n private processStagesSequentially(\n stages: A_Stage[],\n scope: A_Scope | undefined,\n index: number\n ): Promise<void> | void {\n try {\n // Check if feature has been interrupted before processing next stage\n if (this.state === A_TYPES__FeatureState.INTERRUPTED) {\n return;\n }\n\n // If we've processed all stages, complete the feature\n if (index >= stages.length) {\n this.completed();\n return;\n }\n\n const stage = stages[index];\n const result = stage.process(scope);\n\n if (A_TypeGuards.isPromiseInstance(result)) {\n // Async stage - return promise that processes remaining stages\n return result\n .then(() => {\n // Check for interruption after async stage completes\n if (this.state === A_TYPES__FeatureState.INTERRUPTED) {\n return;\n }\n return this.processStagesSequentially(stages, scope, index + 1);\n })\n .catch(error => {\n throw this.failed(new A_FeatureError({\n title: A_FeatureError.FeatureProcessingError,\n description: `An error occurred while processing the A-Feature: ${this.name}. Failed at stage: ${stage.name}.`,\n stage: stage,\n originalError: error\n }));\n });\n } else {\n // Sync stage - continue to next stage immediately\n return this.processStagesSequentially(stages, scope, index + 1);\n }\n } catch (error) {\n throw this.failed(new A_FeatureError({\n title: A_FeatureError.FeatureProcessingError,\n description: `An error occurred while processing the A-Feature: ${this.name}. Failed at stage: ${this.stage?.name || 'N/A'}.`,\n stage: this.stage,\n originalError: error\n }));\n }\n }\n /**\n * This method moves the feature to the next stage\n * \n * @param stage \n */\n next(stage) {\n const stageIndex = this._stages.indexOf(stage);\n\n this._index = stageIndex + 1;\n\n if (this._index >= this._stages.length) {\n this.completed();\n }\n }\n /**\n * This method marks the feature as completed and returns the result\n * Uses to interrupt or end the feature processing\n * \n * @param result \n * @returns \n */\n completed(): void {\n if (this.isProcessed) return;\n\n // Don't complete if interrupted\n if (this.state === A_TYPES__FeatureState.INTERRUPTED) {\n return;\n }\n\n this._state = A_TYPES__FeatureState.COMPLETED;\n\n this.scope.destroy();\n }\n /**\n * This method marks the feature as failed and returns the error\n * Uses to mark the feature as failed\n * \n * @param error \n * @returns The error that caused the failure\n */\n failed(error: A_FeatureError): A_FeatureError {\n if (this.isProcessed) return this._error!;\n\n this._state = A_TYPES__FeatureState.FAILED;\n\n this._error = error;\n\n this.scope.destroy();\n\n return this._error;\n }\n /**\n * This method marks the feature as interrupted and throws an error\n * Uses to interrupt or end the feature processing\n * \n * @param error \n */\n interrupt(\n /**\n * The reason of feature interruption\n */\n reason?: string | A_StageError | Error\n ): A_FeatureError {\n if (this.isProcessed) return this._error!;\n\n this._state = A_TYPES__FeatureState.INTERRUPTED;\n\n switch (true) {\n case A_TypeGuards.isString(reason):\n this._error = new A_FeatureError(A_FeatureError.Interruption, reason as string);\n break;\n\n case A_TypeGuards.isErrorInstance(reason):\n this._error = new A_FeatureError({\n code: A_FeatureError.Interruption,\n title: (reason as any).title || 'Feature Interrupted',\n description: (reason as any).description || (reason as Error).message,\n stage: this.stage,\n originalError: reason\n });\n break;\n\n default:\n this._error = new A_FeatureError(A_FeatureError.Interruption, 'Feature was interrupted');\n break;\n }\n\n this.scope.destroy();\n\n return this._error;\n }\n\n\n /**\n * Allows to chain the feature to another feature. \n * In this case the parent feature scope (if new not provided), stages, caller will be used.\n * \n * [!] Note: Chained feature will use the same caller as the parent feature.\n * \n * @param feature \n */\n chain(\n /**\n * A Feature to be chained\n */\n feature: A_Feature,\n /**\n * Optional scope to be used for the chained feature.\n */\n scope?: A_Scope\n )\n chain<T extends A_TYPES__FeatureAvailableComponents = A_TYPES__FeatureAvailableComponents>(\n /**\n * Component whose feature should be chained\n */\n component: A_TYPES__FeatureAvailableComponents,\n /**\n * A Feature Name to be chained\n */\n feature: string,\n /**\n * Optional scope to be used for the chained feature.\n */\n scope?: A_Scope\n )\n chain<T extends A_TYPES__FeatureAvailableComponents = A_TYPES__FeatureAvailableComponents>(\n param1: A_TYPES__FeatureAvailableComponents | A_Feature,\n param2?: string | A_Scope,\n param3?: A_Scope\n ) {\n let feature: A_Feature;\n let scope: A_Scope | undefined;\n\n if (param1 instanceof A_Feature) {\n feature = param1;\n scope = param2 instanceof A_Scope ? param2 : undefined;\n } else {\n feature = new A_Feature({\n name: param2 as string,\n component: param1 as T\n });\n scope = param3 instanceof A_Scope ? param3 : undefined;\n }\n\n const featureScope = scope || this.scope;\n\n // create new caller for the chained feature\n feature._caller = this._caller;\n\n const result = feature.process(featureScope);\n\n // If the chained feature processing returns a promise, ensure errors are propagated\n if (A_TypeGuards.isPromiseInstance(result)) {\n return result.catch(error => {\n // Re-throw to ensure chained feature errors propagate to caller\n throw error;\n });\n }\n\n return result;\n }\n\n\n\n\n toString(): string {\n return `A-Feature(${this.caller.component?.constructor?.name || 'Unknown'}::${this.name})`;\n }\n}","import { A_Feature } from \"@adaas/a-concept/a-feature\";\nimport { A_Scope } from \"@adaas/a-concept/a-scope\";\n\n\n\n/**\n * A-Component is a primary \"extendable\" object in the system\n * A unique combination of Components creates completely new functionality\n * \n * The most important thing is that A-Component is STATELESS, it means that it doesn't store any state in itself\n * \n * \n * [!] Every A-Component is a singleton, so if you need to create multiple instances of the same logic - use A-Container\n * [!] So one scope can have only one instance of the same A-Component\n * [!] Every A-Component can be extended by features and extensions\n * [!] ONLY A-Component can have A-Feature extensions\n *\n */\nexport class A_Component {\n\n\n /**\n * Calls the feature with the given name in the given scope\n * \n * [!] Note: This method creates a new instance of the feature every time it is called\n * \n * @param feature - the name of the feature to call\n * @param scope - the scope in which to call the feature\n * @returns - void\n */\n call(\n /**\n * Name of the feature to call\n */\n feature: string,\n /**\n * Scope in which the feature will be executed\n */\n scope?: A_Scope\n ): Promise<any> | void {\n const newFeature = new A_Feature({\n name: feature,\n component: this\n });\n\n return newFeature.process(scope);\n }\n}\n\n\n\n","\n\n\nexport enum A_TYPES__ComponentMetaKey {\n EXTENSIONS = 'a-component-extensions',\n FEATURES = 'a-component-features',\n INJECTIONS = 'a-component-injections',\n ABSTRACTIONS = 'a-component-abstractions',\n}","import { A_TYPES__A_InjectDecorator_Meta } from \"@adaas/a-concept/a-inject\";\nimport { A_TYPES__ConceptAbstractionMeta } from \"@adaas/a-concept/a-concept\";\nimport { A_Meta } from \"@adaas/a-concept/a-meta\";\nimport { A_TYPES__ComponentMeta, A_TYPES__ComponentMetaExtension } from \"./A-Component.types\";\nimport { A_TYPES__ComponentMetaKey } from \"./A-Component.constants\";\nimport { A_TYPES__FeatureDefineDecoratorMeta } from \"@adaas/a-concept/a-feature\";\n\n\nexport class A_ComponentMeta<T extends A_TYPES__ComponentMeta = A_TYPES__ComponentMeta> extends A_Meta<T> {\n\n /**\n * Allows to get all the injections for a given handler\n * \n * @param handler \n * @returns \n */\n injections(\n handler: string\n ): A_TYPES__A_InjectDecorator_Meta {\n const injections = this.get(A_TYPES__ComponentMetaKey.INJECTIONS);\n\n const args = injections?.get(handler) || [];\n\n return args;\n }\n\n /**\n * Allows to get all the extensions for a given feature\n * \n * @param feature \n * @returns \n */\n extensions(\n feature: string\n ): A_TYPES__ComponentMetaExtension[] {\n const steps: A_TYPES__ComponentMetaExtension[] = [];\n\n const extensions = this.get(A_TYPES__ComponentMetaKey.EXTENSIONS);\n\n extensions\n // returns all extensions that match the feature\n ?.find(feature)\n .forEach(([handler, extensions]) => {\n extensions.forEach(extension => {\n steps.push({\n // component: constructor,\n name: extension.name,\n handler: extension.handler,\n behavior: extension.behavior,\n before: extension.before || '',\n after: extension.after || '',\n throwOnError: extension.throwOnError || true,\n override: ''\n });\n\n });\n });\n\n\n return steps;\n }\n\n /**\n * Returns all features defined in the Component\n * \n * @returns \n */\n features(): Array<A_TYPES__FeatureDefineDecoratorMeta> {\n\n const features = this.get(A_TYPES__ComponentMetaKey.FEATURES);\n\n return features?.toArray()\n // returns all extensions that match the feature\n .map(([, feature]) => feature) || [];\n }\n\n /**\n * Returns a set of instructions to run proper methods in Component during A-Concept Stage\n * \n * @param stage \n * @returns \n */\n abstractions(\n abstraction: any\n ): A_TYPES__ConceptAbstractionMeta[] {\n const steps: A_TYPES__ConceptAbstractionMeta[] = [];\n\n const abstractions = this.get(A_TYPES__ComponentMetaKey.ABSTRACTIONS);\n const injections = this.get(A_TYPES__ComponentMetaKey.INJECTIONS);\n\n abstractions\n // returns all extensions that match the feature\n ?.find(`CONCEPT_ABSTRACTION::${abstraction}`)\n .forEach(([handler, extensions]) => {\n extensions.forEach(extension => {\n const args = injections?.get(extension.handler) || [];\n\n steps.push({\n ...extension,\n // component: constructor,\n args,\n });\n\n });\n });\n\n\n return steps;\n }\n}","import {\n A_TYPES__ScopeConfig,\n A_TYPES__Scope_Init,\n A_TYPES__ScopeLinkedComponents,\n A_TYPES__Scope_Constructor,\n A_TYPES__ScopeLinkedConstructors\n} from './A-Scope.types'\nimport {\n A_Fragment,\n A_TYPES__Fragment_Constructor\n} from \"@adaas/a-concept/a-fragment\";\nimport { A_Context } from \"@adaas/a-concept/a-context\";\nimport {\n A_Component,\n A_TYPES__Component_Constructor,\n A_TYPES__ComponentMetaKey\n} from \"@adaas/a-concept/a-component\";\nimport {\n A_Entity,\n A_TYPES__Entity_Constructor\n} from \"@adaas/a-concept/a-entity\";\nimport { A_TypeGuards} from \"@adaas/a-concept/helpers/A_TypeGuards.helper\";\nimport { A_FormatterHelper} from \"@adaas/a-concept/helpers/A_Formatter.helper\";\nimport { A_CommonHelper} from \"@adaas/a-concept/helpers/A_Common.helper\";\nimport {\n A_Error,\n A_TYPES__Error_Constructor\n} from \"@adaas/a-concept/a-error\";\nimport { A_ScopeError } from '@adaas/a-concept/a-scope';\nimport { A_Meta } from '@adaas/a-concept/a-meta';\nimport {\n A_Dependency,\n A_TYPES__A_DependencyInjectable\n} from '@adaas/a-concept/a-dependency';\nimport { A_TYPES__Ctor } from '@adaas/a-concept/types';\nimport { ASEID } from '@adaas/a-concept/aseid';\n\n\n\n\nexport class A_Scope<\n _MetaItems extends Record<string, any> = any,\n _ComponentType extends A_TYPES__Component_Constructor[] = A_TYPES__Component_Constructor[],\n _ErrorType extends A_TYPES__Error_Constructor[] = A_TYPES__Error_Constructor[],\n _EntityType extends A_TYPES__Entity_Constructor[] = A_TYPES__Entity_Constructor[],\n _FragmentType extends A_Fragment[] = A_Fragment[],\n> {\n\n /**\n * Scope Name uses for identification and logging purposes\n */\n protected _name!: string;\n /**\n * Parent scope reference, used for inheritance of components, fragments, entities and commands\n */\n protected _parent?: A_Scope;\n /**\n * Internal meta storage using A_Meta for type-safe key-value operations.\n * This stores all the scope's runtime data that can be accessed and modified\n * throughout the execution pipeline or within running containers.\n */\n protected _meta: A_Meta<_MetaItems> = new A_Meta<_MetaItems>();\n\n // ===========================================================================\n // --------------------ALLowed Constructors--------------------------------\n // ===========================================================================\n /**\n * A set of allowed components, A set of constructors that are allowed in the scope\n * \n */\n protected _allowedComponents = new Set<_ComponentType[number]>();\n /**\n * A set of allowed errors, A set of constructors that are allowed in the scope\n */\n protected _allowedErrors = new Set<_ErrorType[number]>();\n /**\n * A set of allowed entities, A set of constructors that are allowed in the scope\n */\n protected _allowedEntities = new Set<_EntityType[number]>();\n /**\n * A set of allowed fragments, A set of constructors that are allowed in the scope\n */\n protected _allowedFragments = new Set<A_TYPES__Fragment_Constructor<_FragmentType[number]>>();\n\n\n\n // ===========================================================================\n // --------------------Internal Storage--------------------------------\n // ===========================================================================\n /**\n * Storage for the components, should be strong as components are unique per scope\n */\n protected _components: Map<_ComponentType[number], InstanceType<_ComponentType[number]>> = new Map();\n /**\n * Storage for the errors, should be strong as errors are unique per code\n */\n protected _errors: Map<string, InstanceType<_ErrorType[number]>> = new Map();\n /**\n * Storage for the entities, should be strong as entities are unique per aseid\n */\n protected _entities: Map<string, InstanceType<_EntityType[number]>> = new Map();\n /**\n * Storage for the fragments, should be weak as fragments are singletons per scope\n */\n protected _fragments: Map<A_TYPES__Fragment_Constructor<_FragmentType[number]>, _FragmentType[number]> = new Map();\n /**\n * Storage for imported scopes \n */\n protected _imports: Set<A_Scope> = new Set();\n\n\n\n // ===========================================================================\n // --------------------Readonly Allowed Properties----------------------------\n // ===========================================================================\n /**\n * Returns the name of the scope\n */\n get name() { return this._name }\n /**\n * Returns the meta object of the scope\n */\n get meta() { return this._meta }\n /**\n * Returns a list of Constructors for A-Components that are available in the scope\n */\n get allowedComponents() { return this._allowedComponents }\n /**\n * Returns a list of Constructors for A-Entities that are available in the scope\n */\n get allowedEntities() { return this._allowedEntities }\n /**\n * Returns a list of Constructors for A-Fragments that are available in the scope\n */\n get allowedFragments() { return this._allowedFragments }\n /**\n * Returns a list of Constructors for A-Errors that are available in the scope\n */\n get allowedErrors() { return this._allowedErrors }\n // ===========================================================================\n // --------------------Readonly Registered Properties--------------------------\n // ===========================================================================\n /**\n * Returns an Array of entities registered in the scope\n * \n * [!] One entity per aseid\n */\n get entities(): Array<InstanceType<_EntityType[number]>> { return Array.from(this._entities.values()) }\n /**\n * Returns an Array of fragments registered in the scope\n * \n * [!] One fragment per scope\n */\n get fragments(): Array<_FragmentType[number]> { return Array.from(this._fragments.values()) }\n /**\n * Returns an Array of components registered in the scope\n * \n * [!] One component instance per scope\n */\n get components(): Array<InstanceType<_ComponentType[number]>> { return Array.from(this._components.values()) }\n /**\n * Returns an Array of errors registered in the scope\n * \n * [!] One error per code\n */\n get errors(): Array<InstanceType<_ErrorType[number]>> { return Array.from(this._errors.values()) }\n /**\n * Returns an Array of imported scopes\n * [!] Imported scopes are scopes that have been imported into the current scope using the import() method\n */\n get imports(): Array<A_Scope> { return Array.from(this._imports.values()) }\n\n /**\n * Returns the parent scope of the current scope\n * \n * @param setValue \n * @returns \n */\n get parent(): A_Scope | undefined {\n return this._parent;\n }\n /**\n * A_Scope refers to the visibility and accessibility of :\n * - variables, \n * - Components, \n * - Context Fragments \n * - Entities\n * - and objects in different parts of your code. \n * Scope determines where a particular piece of data (like a variable or function) \n * can be accessed, modified, or referenced, and it plays a crucial role in avoiding naming collisions and ensuring data integrity. \n * \n * [!] The scope behavior is similar to tree structure where each scope can have a parent scope and inherit its components, fragments, entities and errors\n * \n * @param params \n * @param config \n */\n constructor()\n constructor(\n /**\n * A set of constructors that are allowed in the scope\n */\n params: Partial<A_TYPES__Scope_Init<_MetaItems, _ComponentType, _ErrorType, _EntityType, _FragmentType>>,\n /**\n * Configuration options for the scope\n */\n config?: Partial<A_TYPES__ScopeConfig>\n )\n constructor(\n param1?: Partial<A_TYPES__Scope_Init<_MetaItems, _ComponentType, _ErrorType, _EntityType, _FragmentType>>,\n param2?: Partial<A_TYPES__ScopeConfig>\n ) {\n const initializer = this.getInitializer(param1);\n // the returned initializer is already bound to `this` (we used .bind(this)),\n // so calling it will run the appropriate logic on this instance:\n initializer.call(this, param1, param2);\n }\n\n /**\n * Generator to iterate through all parent scopes\n */\n *parents(): Generator<A_Scope> {\n let currentParent = this._parent;\n while (currentParent) {\n yield currentParent;\n currentParent = currentParent._parent;\n }\n }\n\n /**\n * This method is used to retrieve a parent scope at a specific level\n * \n * [!] Note that if the level is out of bounds, undefined is returned\n * [!!] Uses negative values for levels (e.g. -1 for immediate parent, -2 for grandparent, etc.)\n * \n * @param level \n * @returns \n */\n parentOffset<T extends A_Scope>(\n /**\n * Level of the parent scope to retrieve\n * \n * Examples:\n * - level 0 - this scope\n * - level -1 - parent\n * - level -2 - grandparent\n */\n layerOffset: number\n ): T | undefined {\n let parentScope: A_Scope | undefined = this;\n\n while (layerOffset <= -1 && parentScope) {\n parentScope = parentScope.parent;\n layerOffset++;\n }\n\n return parentScope as T\n }\n\n\n /**\n * Determines which initializer method to use based on the type of the first parameter.\n * \n * @param param1 \n * @returns\n */\n protected getInitializer(\n param1?: Partial<A_TYPES__Scope_Init<_MetaItems, _ComponentType, _ErrorType, _EntityType, _FragmentType>>,\n param2?: Partial<A_TYPES__ScopeConfig>\n ): (param1: any, param2: any) => void | (() => void) {\n switch (true) {\n case !param1 && !param2: ;\n return this.defaultInitialized;\n\n case !!param1:\n return this.defaultInitialized;\n default:\n throw new A_ScopeError(A_ScopeError.ConstructorError, 'Invalid parameters provided to A_Scope constructor');\n }\n }\n\n\n\n protected defaultInitialized(\n params: Partial<A_TYPES__Scope_Init<_MetaItems, _ComponentType, _ErrorType, _EntityType, _FragmentType>> = {},\n config: Partial<A_TYPES__ScopeConfig> = {}\n ) {\n this._name = params.name || this.constructor.name\n\n this.initComponents(params.components);\n this.initErrors(params.errors);\n this.initFragments(params.fragments);\n this.initEntities(params.entities);\n this.initMeta(params.meta);\n\n if (config.parent) {\n this._parent = config.parent;\n }\n }\n\n\n //==========================================================================\n // --------------------Scope Initialization Methods---------------------------\n //==========================================================================\n\n /**\n * This method is used to initialize the components in the scope\n * To save memory components are initialized only when they are requested\n * \n * This method only registers the component in the scope in case they are not registered yet\n * \n * @param _components \n */\n protected initComponents(_components?: _ComponentType) { _components?.forEach(this.register.bind(this)); }\n /**\n * This method is used to initialize the errors in the scope\n * \n * This method only registers the errors in the scope in case they are not registered yet\n * \n * @param _errors \n */\n protected initErrors(_errors?: _ErrorType) { _errors?.forEach(this.register.bind(this)); }\n /**\n * This method is used to initialize the entities in the scope\n * \n * This method only registers the entities in the scope in case they are not registered yet\n * \n * @param _entities \n */\n protected initEntities(_entities?: [\n ..._EntityType,\n ...InstanceType<_EntityType[number]>[]\n ]) { _entities?.forEach(ent => this.register(ent as any)); }\n /**\n * This method is used to initialize the fragments in the scope\n * \n * This method only registers the fragments in the scope in case they are not registered yet\n * \n * @param _fragments \n */\n protected initFragments(_fragments?: _FragmentType) { _fragments?.forEach(this.register.bind(this)); }\n /**\n * This method is used to initialize the meta in the scope\n * \n * This method only sets the meta values in the scope in case they are not set yet\n * \n * @param _meta \n */\n protected initMeta(_meta?: Partial<_MetaItems>) {\n if (_meta) {\n Object.entries(_meta).forEach(([key, value]) => {\n this._meta.set(key as keyof _MetaItems, value as _MetaItems[keyof _MetaItems]);\n });\n }\n }\n\n\n // ==========================================================================\n // --------------------Scope Public Methods-----------------------------------\n // ==========================================================================\n /**\n * This method is used to destroy the scope and all its registered components, fragments and entities\n * \n * [!] This method deregisters all components, fragments and entities from the A-Context\n * [!] This method also clears all internal registries and collections\n */\n destroy() {\n this._components.forEach(component => A_Context.deregister(component));\n this._fragments.forEach(fragment => A_Context.deregister(fragment));\n this._entities.forEach(entity => A_Context.deregister(entity));\n\n this._components.clear();\n this._errors.clear();\n this._fragments.clear();\n this._entities.clear();\n this._imports.clear();\n\n if (this.issuer()) {\n A_Context.deallocate(this);\n }\n }\n\n\n /**\n * Retrieves a value from the scope's meta.\n * \n * @param param - The key to retrieve\n * @returns The value associated with the key, or undefined if not found\n * \n * @example\n * ```typescript\n * const userId = scope.get('userId');\n * if (userId) {\n * console.log(`Current user: ${userId}`);\n * }\n * ```\n */\n get<K extends keyof _MetaItems>(param: K): _MetaItems[K] | undefined {\n return this._meta.get(param);\n }\n\n /**\n * Stores a value in the scope's meta.\n * \n * @param param - The key to store the value under\n * @param value - The value to store\n * \n * @example\n * ```typescript\n * scope.set('userId', '12345');\n * scope.set('role', 'admin');\n * ```\n */\n set<K extends keyof _MetaItems>(param: K, value: _MetaItems[K]): void {\n this._meta.set(param, value);\n }\n\n\n /**\n * Returns the issuer of the scope, useful for debugging and tracking purposes\n * \n * Issuer can be:\n * - A Container that allocated the scope\n * - A Feature that allocated the scope\n * \n * [!] Note that the issuer is the direct allocator of the scope, so if a Container allocated a Feature that allocated the scope, the issuer will be the Feature\n * \n * @returns \n */\n issuer<T extends A_TYPES__ScopeLinkedComponents>(): T | undefined {\n return A_Context.issuer(this) as T;\n }\n\n\n\n /**\n * This method is used to inherit from a parent scope\n * \n * [!] This method checks for circular inheritance and throws an error if detected\n * \n * @param parent \n * @returns \n */\n inherit(parent: A_Scope): A_Scope {\n if (!parent)\n throw new A_ScopeError(\n A_ScopeError.InitializationError,\n `Invalid parent scope provided`\n );\n\n if (parent === this)\n throw new A_ScopeError(\n A_ScopeError.CircularInheritanceError,\n `Unable to inherit scope ${this.name} from itself`\n );\n\n if (parent === this._parent)\n return this;\n\n // Prevent circular inheritance\n const circularCheck = this.checkCircularInheritance(parent);\n\n if (circularCheck)\n throw new A_ScopeError(\n A_ScopeError.CircularInheritanceError,\n `Circular inheritance detected: ${[...circularCheck, parent.name].join(' -> ')}`\n );\n\n\n this._parent = parent;\n return this;\n }\n\n\n /**\n * This method allows to import other scopes, to make their dependencies available in the current scope\n * \n * [!] Import doesn't create a parent-child relationship between scopes, it just copies the dependencies from the imported scopes\n * [!] It doesn't change the entities ownership, so entities remain unique to their original scopes\n * \n * @param scopes \n * @returns \n */\n import(...scopes: A_Scope[]): A_Scope {\n\n scopes.forEach(scope => {\n if (scope === this)\n throw new A_ScopeError(\n A_ScopeError.CircularImportError,\n `Unable to import scope ${this.name} into itself`\n );\n\n if (this._imports.has(scope))\n return;\n\n this._imports.add(scope);\n });\n\n return this;\n }\n\n /**\n * This method allows to deimport other scopes, to remove their dependencies from the current scope\n * \n * \n * @param scopes \n * @returns \n */\n deimport(...scopes: A_Scope[]): A_Scope {\n\n scopes.forEach(scope => {\n if (this._imports.has(scope))\n this._imports.delete(scope);\n });\n return this;\n }\n\n /**\n * This method is used to check if the component is available in the scope\n * \n * [!] Note that this method checks for the component in the current scope and all parent scopes\n * \n * @param component \n * @returns \n */\n has<T extends A_Component>(\n /**\n * Provide a component constructor to check if it's available in the scope\n */\n component: A_TYPES__Component_Constructor<T>\n ): boolean\n has<T extends A_Entity>(\n /**\n * Provide an entity constructor to check if it's available in the scope\n * \n * [!] Note that entities are unique per aseid, so this method checks if there's at least one entity of the provided type in the scope\n */\n entity: A_TYPES__Entity_Constructor<T>\n ): boolean\n has<T extends A_Fragment>(\n /**\n * Provide a fragment constructor to check if it's available in the scope\n */\n fragment: A_TYPES__Fragment_Constructor<T>\n ): boolean\n has<T extends A_Error>(\n /**\n * Provide an error constructor to check if it's available in the scope\n */\n error: A_TYPES__Error_Constructor<T>\n ): boolean\n has(\n /**\n * Provide a string to check if a component, entity or fragment with the provided name is available in the scope\n */\n constructor: string\n ): boolean\n has<T extends A_TYPES__A_DependencyInjectable>(\n ctor: A_TYPES__Ctor<T> | string\n ): boolean\n has<T extends A_TYPES__A_DependencyInjectable>(\n ctor: A_TYPES__Ctor<T> | string\n ): boolean {\n\n let found = this.hasFlat(ctor as any);\n\n if (!found && !!this._parent)\n try {\n return this._parent.has(ctor as any);\n } catch (error) {\n return false;\n }\n\n return found;\n }\n\n\n /**\n * This method is used to check if the component is available in the scope\n * \n * [!] Note that this method checks for the component ONLY in the current scope\n * \n * @param component \n * @returns \n */\n hasFlat<T extends A_Component>(\n /**\n * Provide a component constructor to check if it's available in the scope\n */\n component: A_TYPES__Component_Constructor<T>\n ): boolean\n hasFlat<T extends A_Entity>(\n /**\n * Provide an entity constructor to check if it's available in the scope\n * \n * [!] Note that entities are unique per aseid, so this method checks if there's at least one entity of the provided type in the scope\n */\n entity: A_TYPES__Entity_Constructor<T>\n ): boolean\n hasFlat<T extends A_Fragment>(\n /**\n * Provide a fragment constructor to check if it's available in the scope\n */\n fragment: A_TYPES__Fragment_Constructor<T>\n ): boolean\n hasFlat<T extends A_Error>(\n /**\n * Provide an error constructor to check if it's available in the scope\n */\n error: A_TYPES__Error_Constructor<T>\n ): boolean\n hasFlat(\n /**\n * Provide a string to check if a component, entity or fragment with the provided name is available in the scope\n */\n constructor: string\n ): boolean\n hasFlat(\n ctor: unknown\n ): boolean {\n\n let found = false;\n\n switch (true) {\n // 1) Check if it's a Scope. It's always true since it returns itself\n case A_TypeGuards.isScopeConstructor(ctor):\n return true;\n\n // 2) Check by string name. \n case A_TypeGuards.isString(ctor): {\n\n // 2.1 Check if it's a component name\n const possibleComponent = Array.from(this.allowedComponents).find(c => c.name === ctor);\n if (possibleComponent) found = true;\n\n // 2.2 Check if it's a fragment name\n const possibleFragment = Array.from(this.allowedFragments).find(f => f.name === ctor);\n if (possibleFragment) found = true;\n\n // 2.3 Check if it's an entity name or entity static entity property\n const possibleEntity = Array.from(this.allowedEntities).find(e => e.name === ctor);\n if (possibleEntity) found = true;\n\n // 2.4 Check if it's an error name\n const possibleError = Array.from(this.allowedErrors).find(e => e.name === ctor);\n if (possibleError) found = true;\n\n break;\n }\n // 3) Check if it's a Component\n case A_TypeGuards.isComponentConstructor(ctor): {\n found = this.isAllowedComponent(ctor)\n || !![...this.allowedComponents]\n .find(c => A_CommonHelper.isInheritedFrom(c, ctor));\n\n break;\n }\n // 4) Check if it's an Entity\n case A_TypeGuards.isEntityConstructor(ctor): {\n found = this.isAllowedEntity(ctor)\n || !![...this.allowedEntities]\n .find(e => A_CommonHelper.isInheritedFrom(e, ctor));\n\n break;\n }\n // 5) Check if it's a Fragment\n case A_TypeGuards.isFragmentConstructor(ctor): {\n found = this.isAllowedFragment(ctor)\n || !![...this.allowedFragments]\n .find(f => A_CommonHelper.isInheritedFrom(f, ctor));\n\n break;\n }\n\n // 6) Check if it's an Error\n case A_TypeGuards.isErrorConstructor(ctor): {\n found = this.isAllowedError(ctor)\n || !![...this.allowedErrors]\n .find(e => A_CommonHelper.isInheritedFrom(e, ctor));\n\n break;\n }\n\n // 7) Check scope issuer\n case this.issuer()\n && (this.issuer()!.constructor === ctor\n || A_CommonHelper.isInheritedFrom(this.issuer()!.constructor, ctor\n )\n ): {\n found = true;\n break;\n }\n }\n\n return found;\n }\n\n\n /**\n * Allows to resolve a specific dependency \n * \n * @param dependency \n * @returns \n */\n resolveDependency<T extends A_TYPES__A_DependencyInjectable>(\n dependency: A_Dependency<T>\n ): T | Array<T> | undefined {\n\n let result: Array<T> = [];\n let targetScope: A_Scope = this.parentOffset(dependency.parent) || this;\n\n // first deal with level conditions and \n switch (true) {\n // 1) Flat resolution\n case dependency.flat && !dependency.all: {\n const resolved = targetScope.resolveFlatOnce<T>(dependency.target || dependency.name);\n if (resolved)\n result = [resolved];\n break;\n }\n case dependency.flat && dependency.all: {\n result = targetScope.resolveFlatAll<T>(dependency.target || dependency.name);\n break;\n }\n case !dependency.flat && !dependency.all: {\n const resolved = targetScope.resolveOnce<T>(dependency.target || dependency.name);\n if (resolved)\n result = [resolved];\n break;\n }\n case !dependency.flat && dependency.all: {\n result = targetScope.resolveAll<T>(dependency.target || dependency.name);\n break;\n }\n\n default:\n result = [];\n }\n\n // 2) create if not found and allowed\n if (dependency.create\n && !result.length\n && A_TypeGuards.isAllowedForDependencyDefaultCreation(dependency.target)\n ) {\n\n const newDependency = new dependency.target(...dependency.args);\n\n targetScope.register(newDependency);\n\n result.push(newDependency as T);\n }\n\n // 3) handle required dependencies\n if (dependency.require && !result.length) {\n throw new A_ScopeError(\n A_ScopeError.ResolutionError,\n `Dependency ${dependency.name} is required but could not be resolved in scope ${targetScope.name}`\n );\n }\n\n\n // 4) Apply filters\n if (dependency.query.aseid)\n // in this case we should return only one dependency by aseid\n result = result.filter(dep => A_TypeGuards.hasASEID(dep) && ASEID.compare(dep.aseid, dependency.query.aseid));\n\n else if (Object.keys(dependency.query).length > 0)\n result = result\n .filter(dep => {\n const query = dependency.query;\n if (!query) return true;\n\n return Object.entries(query).every(([key, value]) => {\n return (dep as any)[key] === value;\n });\n });\n\n\n // 5) apply pagination\n\n const count = dependency.pagination.count;\n const from = dependency.pagination.from; // from start or from end\n\n\n\n const startSliceIndex = from === 'end'\n ? (count === -1 ? 0 : Math.max(result.length - count, 0))\n : 0;\n\n // end slice should handle -1 for all items\n const endSliceIndex = from === 'end'\n ? result.length\n : (count === -1 ? result.length : Math.min(count, result.length));\n\n const slice = result.slice(startSliceIndex, endSliceIndex);\n\n /**\n * Default behavior is to return single instance if count is 1\n * \n * If Directive All (-1) is provided or count > 1, an array is returned\n * \n * If no instances found, undefined is returned\n */\n return slice.length === 1\n && count !== -1\n ? slice[0]\n : slice.length\n ? slice\n : undefined;\n }\n\n\n /**\n * Allows to retrieve the constructor of the component or entity by its name\n * \n * [!] Notes:\n * - In case of search for A-Entity please ensure that provided string corresponds to the static entity property of the class. [!] By default it's the kebab-case of the class name\n * - In case of search for A_Component please ensure that provided string corresponds to the class name in PascalCase\n * \n * @param name \n * @returns \n */\n resolveConstructor<T extends A_Entity>(\n /**\n * Provide the entity name or static entity property to retrieve its constructor\n */\n name: string\n ): A_TYPES__Entity_Constructor<T>\n resolveConstructor<T extends A_Component>(\n /**\n * Provide the component name in PascalCase to retrieve its constructor\n */\n name: string\n ): A_TYPES__Component_Constructor<T>\n resolveConstructor<T extends A_Fragment>(\n /**\n * Provide the fragment name in PascalCase to retrieve its constructor\n */\n name: string\n ): A_TYPES__Fragment_Constructor<T>\n resolveConstructor<T extends A_TYPES__A_DependencyInjectable>(name: string): A_TYPES__Entity_Constructor<T> | A_TYPES__Component_Constructor<T> | A_TYPES__Fragment_Constructor<T> | undefined\n resolveConstructor<T extends A_TYPES__A_DependencyInjectable>(name: string): A_TYPES__Entity_Constructor<T> | A_TYPES__Component_Constructor<T> | A_TYPES__Fragment_Constructor<T> | undefined {\n // 1) Check components\n const component = Array.from(this.allowedComponents).find(\n c => c.name === name\n || c.name === A_FormatterHelper.toPascalCase(name)\n );\n\n if (component) return component as A_TYPES__Component_Constructor<T>;\n else\n // 1.2) Check components prototypes\n {\n const protoComponent = Array.from(this.allowedComponents).find(\n\n // it should go rthough prototyopes and check their names to be equal to the provided name\n c => {\n let current = c;\n\n while (current) {\n if (current.name === name\n || current.name === A_FormatterHelper.toPascalCase(name)\n ) {\n return true;\n }\n current = Object.getPrototypeOf(current);\n }\n\n return false;\n\n }\n );\n if (protoComponent) return protoComponent as A_TYPES__Component_Constructor<T>;\n }\n\n // 2) Check entities\n const entity = Array.from(this.allowedEntities).find(\n e => e.name === name\n || e.name === A_FormatterHelper.toPascalCase(name)\n || (e as any).entity === name\n || (e as any).entity === A_FormatterHelper.toKebabCase(name)\n );\n if (entity) return entity as A_TYPES__Entity_Constructor<T>;\n else\n // 2.2) Check entities prototypes\n {\n const protoEntity = Array.from(this.allowedEntities).find(\n e => A_CommonHelper.isInheritedFrom(e, name as any)\n );\n if (protoEntity) return protoEntity as A_TYPES__Entity_Constructor<T>;\n }\n\n // 3) Check fragments\n const fragment = Array.from(this.allowedFragments).find(f => f.name === name\n || f.name === A_FormatterHelper.toPascalCase(name)\n );\n if (fragment) return fragment as A_TYPES__Fragment_Constructor<T>;\n else\n // 3.2) Check fragments prototypes\n {\n const protoFragment = Array.from(this.allowedFragments).find(\n f => A_CommonHelper.isInheritedFrom(f, name as any)\n );\n if (protoFragment) return protoFragment as A_TYPES__Fragment_Constructor<T>;\n }\n\n // If not found in current scope, check imported scopes\n for (const importedScope of this._imports) {\n const importedConstructor = importedScope.resolveConstructor<T>(name);\n if (importedConstructor) {\n return importedConstructor;\n }\n }\n\n // Then, finally check parent scope\n if (!!this._parent) {\n return this._parent.resolveConstructor(name) as any;\n }\n\n return undefined;\n }\n\n\n\n\n /**\n * This method should resolve all instances of the components, or entities within the scope, by provided parent class\n * So in case of providing a base class it should return all instances that extends this base class\n * \n * [!] Applicable for the current scope ONLY, no parent scopes are checked\n * \n * @param component \n */\n resolveAll<T extends A_Component>(\n /**\n * Provide a component constructor to resolve its instance from the scope\n */\n component: A_TYPES__Component_Constructor<T>\n ): Array<T>\n resolveAll<T extends A_Fragment>(\n /**\n * Provide a fragment constructor to resolve its instance from the scope\n */\n fragment: A_TYPES__Fragment_Constructor<T>\n ): Array<T>\n resolveAll<T extends A_Entity>(\n /**\n * Provide an entity constructor to resolve its instance or an array of instances from the scope\n */\n entity: A_TYPES__Entity_Constructor<T>\n ): Array<T>\n resolveAll<T extends A_TYPES__A_DependencyInjectable>(\n /**\n * Provide a component, fragment or entity constructor to resolve its instance(s) from the scope\n */\n constructorName: string\n ): Array<T>\n resolveAll<T extends A_TYPES__A_DependencyInjectable>(\n /**\n * Provide a component, fragment or entity constructor or an array of constructors to resolve its instance(s) from the scope\n */\n ctor: A_TYPES__Ctor<A_TYPES__A_DependencyInjectable> | string\n ): Array<T>\n resolveAll<T extends A_TYPES__A_DependencyInjectable>(\n /**\n * Provide a component, fragment or entity constructor or an array of constructors to resolve its instance(s) from the scope\n */\n param1: A_TYPES__Ctor<A_TYPES__A_DependencyInjectable> | string\n ): Array<T> {\n\n const results: Set<T> = new Set();\n\n // 1) Resolve all in the current scope\n const currentResults = this.resolveFlatAll<T>(param1 as any);\n currentResults.forEach(result => results.add(result));\n\n // 2) resolve all in the imported scopes\n this._imports.forEach(importedScope => {\n\n if (importedScope.has(param1 as any)) {\n const importedResults = importedScope.resolveFlatAll<T>(param1 as any);\n\n\n importedResults.forEach(result => results.add(result));\n }\n });\n\n // 3) Resolve all in the parent scope\n let parentScope = this._parent;\n\n while (parentScope && parentScope.has(param1 as any)) {\n\n const parentResults = parentScope.resolveAll<T>(param1 as any);\n parentResults.forEach(result => results.add(result));\n\n // Move to the next parent scope\n parentScope = parentScope._parent;\n }\n\n\n\n return Array.from(results);\n }\n\n\n\n\n /**\n * This method should resolve all instances of the components, or entities within the scope, by provided parent class\n * So in case of providing a base class it should return all instances that extends this base class\n * \n * [!] Applicable for the current scope ONLY, no parent scopes are checked\n * \n * @param component \n */\n resolveFlatAll<T extends A_Component>(\n /**\n * Provide a component constructor to resolve its instance from the scope\n */\n component: A_TYPES__Component_Constructor<T>\n ): Array<T>\n resolveFlatAll<T extends A_Fragment>(\n /**\n * Provide a fragment constructor to resolve its instance from the scope\n */\n fragment: A_TYPES__Fragment_Constructor<T>\n ): Array<T>\n resolveFlatAll<T extends A_Entity>(\n /**\n * Provide an entity constructor to resolve its instance or an array of instances from the scope\n */\n entity: A_TYPES__Entity_Constructor<T>\n ): Array<T>\n resolveFlatAll<T extends A_TYPES__A_DependencyInjectable>(\n /**\n * Provide a component, fragment or entity constructor to resolve its instance(s) from the scope\n */\n constructorName: string\n ): Array<T>\n resolveFlatAll<T extends A_TYPES__A_DependencyInjectable>(\n /**\n * Provide a component, fragment or entity constructor or an array of constructors to resolve its instance(s) from the scope\n */\n ctor: A_TYPES__Ctor<A_TYPES__A_DependencyInjectable> | string,\n ): Array<T>\n resolveFlatAll<T extends A_TYPES__A_DependencyInjectable>(\n /**\n * Provide a component, fragment or entity constructor or an array of constructors to resolve its instance(s) from the scope\n */\n param1: A_TYPES__Ctor<A_TYPES__A_DependencyInjectable> | string,\n ): Array<T> {\n\n const results: Array<T> = [];\n\n switch (true) {\n // 1) if a parameter is a component constructor\n case A_TypeGuards.isComponentConstructor(param1): {\n // 1) Check components\n this.allowedComponents.forEach(ctor => {\n if (A_CommonHelper.isInheritedFrom(ctor, param1)) {\n const instance = this.resolveOnce<T>(ctor);\n if (instance) results.push(instance as T);\n }\n });\n break;\n }\n // 2) if a parameter is a fragment constructor\n case A_TypeGuards.isFragmentConstructor(param1): {\n // 2) Check fragments\n this.allowedFragments.forEach(ctor => {\n if (A_CommonHelper.isInheritedFrom(ctor, param1)) {\n const instance = this.resolveOnce<T>(ctor);\n if (instance) results.push(instance as T);\n }\n });\n break;\n }\n\n case A_TypeGuards.isEntityConstructor(param1): {\n // 3) Check entities\n this.entities.forEach(entity => {\n\n if (A_CommonHelper.isInheritedFrom(entity.constructor, param1)) {\n results.push(entity as T);\n }\n });\n break;\n }\n\n case A_TypeGuards.isString(param1): {\n // 4) Check by name\n const ctor = this.resolveConstructor(param1);\n if (!A_TypeGuards.isComponentConstructor(ctor)\n && !A_TypeGuards.isEntityConstructor(ctor)\n && !A_TypeGuards.isFragmentConstructor(ctor)\n )\n throw new A_ScopeError(\n A_ScopeError.ResolutionError,\n `Unable to resolve all instances for name: ${param1} in scope ${this.name} as no matching component, entity or fragment constructor found`);\n\n\n if (ctor) {\n const instances = this.resolveAll<T>(ctor as any);\n if (instances)\n results.push(...instances);\n }\n break;\n }\n\n default:\n throw new A_ScopeError(\n A_ScopeError.ResolutionError,\n `Invalid parameter provided to resolveAll method: ${param1} in scope ${this.name}`);\n }\n\n\n return results;\n }\n\n\n\n /**\n * This method allows to resolve/inject a component, fragment or entity from the scope\n * Depending on the provided parameters it can resolve:\n * - A single component/fragment/entity by its constructor or name\n * - An array of components/fragments/entities by providing an array of constructors\n * - An entity or an array of entities by providing the entity constructor and query instructions\n * \n * @param component \n * @returns \n */\n resolve<T extends A_TYPES__A_DependencyInjectable>(\n /**\n * Provide a component constructor to resolve its instance from the scope\n */\n component: A_TYPES__Ctor<T>\n ): T | undefined\n resolve<T extends A_TYPES__A_DependencyInjectable>(\n /**\n * Provide a target dependency to resolve its instance from the scope\n * \n * [!] In this case its possible to provide a custom resolution strategy via A_Dependency options\n */\n dependency: A_Dependency<T>\n ): T | Array<T> | undefined\n resolve<T extends A_TYPES__A_DependencyInjectable>(\n /**\n * Provide a component constructor to resolve its instance from the scope\n */\n component: string\n ): T | Array<T> | undefined\n resolve<T extends A_TYPES__A_DependencyInjectable>(\n /**\n * Provide a component, fragment or entity constructor or an array of constructors to resolve its instance(s) from the scope\n */\n param1: A_TYPES__Ctor<T> | A_Dependency<T> | string\n ): T | Array<T> | undefined {\n\n const dependency = A_TypeGuards.isDependencyInstance(param1) ?\n param1 as A_Dependency<T> :\n new A_Dependency<T>(param1)\n\n return this.resolveDependency<T>(dependency);\n }\n\n /**\n * This method allows to resolve/inject a component, fragment or entity from the scope\n * Depending on the provided parameters it can resolve:\n * - A single component/fragment/entity by its constructor or name\n * - An array of components/fragments/entities by providing an array of constructors\n * - An entity or an array of entities by providing the entity constructor and query instructions\n * \n * @param component \n * @returns \n */\n resolveOnce<T extends A_Component>(\n /**\n * Provide a component constructor to resolve its instance from the scope\n */\n component: A_TYPES__Component_Constructor<T>\n ): T | undefined\n resolveOnce<T extends A_Fragment>(\n /**\n * Provide a fragment constructor to resolve its instance from the scope\n */\n fragment: A_TYPES__Fragment_Constructor<T>\n ): T | undefined\n resolveOnce<T extends A_Entity>(\n /**\n * Provide an entity constructor to resolve its instance or an array of instances from the scope\n */\n entity: A_TYPES__Entity_Constructor<T>\n ): T | undefined\n resolveOnce<T extends A_Scope>(\n /**\n * Uses only in case of resolving a single entity\n * \n * Provide an entity constructor to resolve its instance from the scope\n */\n scope: A_TYPES__Scope_Constructor<T>\n ): T | undefined\n resolveOnce<T extends A_Error>(\n /**\n * Uses only in case of resolving a single entity\n * \n * Provide an entity constructor to resolve its instance from the scope\n */\n error: A_TYPES__Error_Constructor<T>\n ): T | undefined\n resolveOnce<T extends A_TYPES__A_DependencyInjectable>(\n /**\n * Provide a component, fragment or entity constructor to resolve its instance(s) from the scope\n */\n constructorName: string\n ): T | undefined\n resolveOnce<T extends A_TYPES__A_DependencyInjectable>(\n /**\n * Provide a component, fragment or entity constructor or an array of constructors to resolve its instance(s) from the scope\n */\n ctor: A_TYPES__Ctor<A_TYPES__A_DependencyInjectable> | string\n ): T | undefined\n resolveOnce<T extends A_TYPES__A_DependencyInjectable>(\n /**\n * Provide a component, fragment or entity constructor or an array of constructors to resolve its instance(s) from the scope\n */\n param1: A_TYPES__Ctor<A_TYPES__A_DependencyInjectable> | string\n ): T | undefined {\n\n const value = this.resolveFlatOnce(param1);\n\n // if not found in the current scope, check imported scopes\n if (!value) {\n for (const importedScope of this._imports) {\n if (importedScope.has(param1 as any)) {\n const importedValue = importedScope.resolveFlatOnce<T>(param1 as any);\n if (importedValue) {\n return importedValue;\n }\n }\n }\n }\n\n // The idea here that in case when Scope has no exact component we have to resolve it from the _parent\n // That means that we should ensure that there's no components that are children of the required component\n if (!value && !!this.parent) {\n return this.parent.resolveOnce<T>(param1);\n }\n\n return value as T;\n }\n\n\n /**\n * This polymorphic method allows to resolve/inject a component, fragment or entity from the scope\n * Depending on the provided parameters it can resolve:\n * - A single component/fragment/entity by its constructor or name\n * - An array of components/fragments/entities by providing an array of constructors\n * - An entity or an array of entities by providing the entity constructor and query instructions\n * \n * [!] Applicable for the current scope ONLY, no parent scopes are checked\n * \n * @param component \n */\n resolveFlat<T extends A_Component>(\n /**\n * Provide a component constructor to resolve its instance from the scope\n */\n component: A_TYPES__Component_Constructor<T>\n ): T | undefined\n resolveFlat<T extends A_Fragment>(\n /**\n * Provide a fragment constructor to resolve its instance from the scope\n */\n fragment: A_TYPES__Fragment_Constructor<T>\n ): T | undefined\n resolveFlat<T extends A_Entity>(\n /**\n * Provide an entity constructor to resolve its instance or an array of instances from the scope\n */\n entity: A_TYPES__Entity_Constructor<T>\n ): T | undefined\n resolveFlat<T extends A_Scope>(\n /**\n * Uses only in case of resolving a single entity\n * \n * Provide an entity constructor to resolve its instance from the scope\n */\n scope: A_TYPES__Scope_Constructor<T>\n ): T | undefined\n resolveFlat<T extends A_Error>(\n /**\n * Uses only in case of resolving a single entity\n * \n * Provide an entity constructor to resolve its instance from the scope\n */\n error: A_TYPES__Error_Constructor<T>\n ): T | undefined\n resolveFlat<T extends A_TYPES__A_DependencyInjectable>(\n /**\n * Provide a component, fragment or entity constructor to resolve its instance(s) from the scope\n */\n constructorName: string\n ): T | undefined\n resolveFlat<T extends A_TYPES__A_DependencyInjectable>(\n /**\n * Provide a component, fragment or entity constructor or an array of constructors to resolve its instance(s) from the scope\n */\n ctor: A_TYPES__Ctor<A_TYPES__A_DependencyInjectable>,\n ): T | undefined\n resolveFlat<T extends A_TYPES__A_DependencyInjectable>(\n /**\n * Provide a component, fragment or entity constructor or an array of constructors to resolve its instance(s) from the scope\n */\n param1: A_TYPES__Ctor<A_TYPES__A_DependencyInjectable> | string,\n ): T | undefined {\n return this.resolveFlatOnce(param1) as T;\n }\n\n\n /**\n * Resolves a component, fragment or entity from the scope without checking parent scopes\n * \n * @param component \n * @param instructions \n */\n resolveFlatOnce<T extends A_TYPES__A_DependencyInjectable>(\n component: A_TYPES__Ctor<A_TYPES__A_DependencyInjectable> | string,\n ): T | undefined {\n\n let value: T | undefined = undefined;\n\n const componentName = A_CommonHelper.getComponentName(component);\n\n\n if (!component || !this.has(component)) {\n return undefined;\n }\n\n switch (true) {\n case A_TypeGuards.isString(component): {\n value = this.resolveByName(component) as T;\n break;\n }\n case A_TypeGuards.isConstructorAllowedForScopeAllocation(component): {\n value = this.resolveIssuer(component) as T;\n break;\n }\n case A_TypeGuards.isScopeConstructor(component): {\n value = this.resolveScope(component) as T\n break;\n }\n case A_TypeGuards.isEntityConstructor(component): {\n value = this.resolveEntity(component) as T\n break;\n }\n case A_TypeGuards.isFragmentConstructor(component): {\n value = this.resolveFragment(component) as T;\n break;\n }\n case A_TypeGuards.isComponentConstructor(component): {\n value = this.resolveComponent(component) as T;\n break;\n }\n case A_TypeGuards.isErrorConstructor(component): {\n value = this.resolveError(component) as T;\n break;\n }\n default:\n throw new A_ScopeError(\n A_ScopeError.ResolutionError,\n `Injected Component ${componentName} not found in the scope`\n );\n }\n\n return value\n }\n\n\n\n // ==================================================================================================\n // --------------------------------------------------------------------------------------------------\n // -------------------------------------INTERNAL RESOLVERS-------------------------------------------\n // --------------------------------------------------------------------------------------------------\n // ==================================================================================================\n /**\n * This method is used internally to resolve a component, fragment or entity by its constructor name\n * \n * [!] Note that this method checks for the component, fragment or entity in the current scope and all parent scopes\n * [!!] Note: No parent scopes are checked\n * \n * @param name - name of the component, fragment or entity to resolve (constructor name for components and fragments, static entity property for entities, static code property for commands)\n * @returns \n */\n private resolveByName(\n /**\n * Provide the name of the component, fragment or entity to resolve\n */\n name: string\n ): _EntityType[number] | InstanceType<_ComponentType[number]> | _FragmentType[number] |\n InstanceType<_ErrorType[number]> | undefined {\n // 1) Check components\n const component = Array.from(this.allowedComponents).find(\n c => c.name === name\n || c.name === A_FormatterHelper.toPascalCase(name)\n );\n if (component) return this.resolveOnce(component) as InstanceType<_ComponentType[number]>;\n\n // 2) Check entities\n const entity = Array.from(this.allowedEntities).find(\n e => e.name === name\n || e.name === A_FormatterHelper.toPascalCase(name)\n || (e as any).entity === name\n || (e as any).entity === A_FormatterHelper.toKebabCase(name)\n );\n if (entity) return this.resolveOnce(entity) as InstanceType<_EntityType[number]>;\n\n // 3) Check fragments\n const fragment = Array.from(this.allowedFragments).find(f => f.name === name\n || f.name === A_FormatterHelper.toPascalCase(name)\n );\n if (fragment) return this.resolveOnce(fragment) as _FragmentType[number];\n\n // 4) Check errors\n const error = Array.from(this.allowedErrors).find(\n e => e.name === name\n || e.name === A_FormatterHelper.toPascalCase(name)\n || (e as any).code === name\n || (e as any).code === A_FormatterHelper.toKebabCase(name)\n );\n if (error) return this.resolveOnce(error) as InstanceType<_ErrorType[number]>;\n\n return undefined;\n }\n\n\n /**\n * Resolves the issuer of the scope by provided constructor\n * \n * [!] Note that this method checks ONLY for the direct issuer of the scope\n * [!!] No parent scopes are checked\n * \n * \n * @param ctor \n * @returns \n */\n private resolveIssuer(\n ctor: A_TYPES__ScopeLinkedConstructors\n ): A_TYPES__ScopeLinkedComponents | undefined {\n\n const issuer = this.issuer();\n\n if (issuer\n && (\n issuer.constructor === ctor\n || A_CommonHelper.isInheritedFrom(issuer?.constructor, ctor)\n )) {\n return issuer!;\n }\n\n\n return undefined;\n }\n\n /**\n * This method is used internally to resolve a single entity from the scope based on the provided instructions\n * \n * [!] Note that this method can return either a single entity or an array of entities depending on the instructions provided\n * [!!] Note: No parent scopes are checked \n * \n * @param entity \n * @param instructions \n * @returns \n */\n private resolveEntity<T extends A_Entity>(\n entity: A_TYPES__Entity_Constructor<T>\n ): T | Array<T> | undefined {\n\n /**\n * 1) In case when no instructions provided, return the first found entity of the provided type\n * \n * [!] Note that it returns ONLY ONE entity\n * [!!] In case when no entity found in the current scope, it tries to resolve it from the parent scope (if exists)\n */\n\n return this.entities.find(e => e instanceof entity) as T | undefined;\n\n }\n /**\n * This method is used internally to resolve a single error from the scope\n * \n * [!] Note that errors are singleton instances within the scope\n * [!!] No parent scopes are checked\n * \n * @param error \n * @returns \n */\n private resolveError<T extends A_Error>(error: A_TYPES__Error_Constructor<T>): T | undefined {\n\n return this.errors.find(e => e instanceof error) as T | undefined;\n }\n /**\n * This method is used internally to resolve a single fragment from the scope\n * \n * [!] Note that this method checks for the fragment in the current scope and all parent scopes\n * \n * @param fragment \n * @returns \n */\n private resolveFragment<T extends A_Fragment>(fragment: A_TYPES__Fragment_Constructor<T>): _FragmentType[number] | undefined {\n const fragmentInstancePresented = this._fragments.get(fragment);\n\n switch (true) {\n case fragmentInstancePresented && this._fragments.has(fragment):\n return fragmentInstancePresented;\n\n // 3) In case when there's a component that is inherited from the required component\n case !fragmentInstancePresented && Array.from(this._allowedFragments).some(el => A_CommonHelper.isInheritedFrom(el, fragment)): {\n const found = Array.from(this._allowedFragments).find(el => A_CommonHelper.isInheritedFrom(el, fragment))!;\n\n return this.resolveFragment(found);\n }\n\n default:\n return undefined;\n }\n }\n /**\n * This method is used internally to resolve a single scope from the current scope\n * \n * @param scope \n * @returns \n */\n private resolveScope(scope: A_TYPES__Scope_Constructor): A_Scope {\n return this;\n }\n\n /**\n * This method is used internally to resolve a single component from the scope\n * \n * [!!] Note: No parent scopes are checked \n * \n * @param component \n * @returns \n */\n private resolveComponent<T extends A_Component>(component: A_TYPES__Component_Constructor<T>): InstanceType<_ComponentType[number]> | undefined {\n\n\n switch (true) {\n // 1) In case when the component is available and exists in the scope\n case this.allowedComponents.has(component) && this._components.has(component): {\n return this._components.get(component)!;\n }\n\n // 2) In case the component available but does NOT exist in the scope\n case this.allowedComponents.has(component) && !this._components.has(component): {\n const componentMeta = A_Context.meta(component)\n\n const argsMeta = componentMeta.get(A_TYPES__ComponentMetaKey.INJECTIONS);\n\n const resolvedArgs = (argsMeta?.get('constructor') || [])\n .map(dependency => this.resolve(dependency));\n\n\n const newComponent = new component(...resolvedArgs)\n\n this.register(newComponent);\n\n return this._components.get(component)!;\n }\n\n // 3) In case when there's a component that is inherited from the required component\n case !this.allowedComponents.has(component) && Array.from(this.allowedComponents).some(el => A_CommonHelper.isInheritedFrom(el, component)): {\n const found = Array.from(this.allowedComponents).find(el => A_CommonHelper.isInheritedFrom(el, component))!;\n\n return this.resolveComponent(found);\n }\n\n default:\n return undefined;\n }\n }\n\n\n /**\n * This method is used to register the component in the scope\n * \n * @param fragment \n */\n register<T extends A_Component>(\n /**\n * Provide a component constructor to register it in the scope\n */\n component: A_TYPES__Component_Constructor<T>\n ): void\n register<T extends A_Component>(\n /**\n * Provide a command instance to register it in the scope\n */\n component: T\n ): void\n register<T extends A_Error>(\n /**\n * Provide an error constructor to register it in the scope\n */\n error: A_TYPES__Error_Constructor<T>\n ): void\n register<T extends A_Error>(\n /**\n * Provide an error instance to register it in the scope\n */\n error: T\n ): void\n register<T extends A_Fragment>(\n /**\n * Provide a command instance to register it in the scope\n */\n fragment: A_TYPES__Fragment_Constructor<T>\n ): void\n register<T extends A_Fragment>(\n /**\n * Provide a fragment instance to register it in the scope\n */\n fragment: T\n ): void\n register<T extends A_Entity>(\n /**\n * Provide an entity constructor to register it in the scope\n */\n entity: A_TYPES__Entity_Constructor<T>\n ): void\n register<T extends A_Entity>(\n /**\n * Provide an entity instance to register it in the scope\n */\n entity: T\n ): void\n register<T extends A_TYPES__A_DependencyInjectable>(\n /**\n * Provide an entity instance to register it in the scope\n */\n entity: T\n ): void\n register<T extends A_TYPES__A_DependencyInjectable>(\n /**\n * Provide an entity instance to register it in the scope\n */\n param1: T\n ): void {\n switch (true) {\n // ------------------------------------------\n // ------------ Instances ----------------\n // ------------------------------------------\n // 1) In case when it's a A-Component instance\n case param1 instanceof A_Component: {\n\n if (!this.allowedComponents.has(param1.constructor as _ComponentType[number]))\n this.allowedComponents.add(param1.constructor as _ComponentType[number]);\n\n this._components.set(\n param1.constructor as _ComponentType[number],\n param1 as InstanceType<_ComponentType[number]>\n );\n\n A_Context.register(this, param1);\n\n break;\n }\n // 3) In case when it's a A-Entity instance\n case A_TypeGuards.isEntityInstance(param1) && !this._entities.has(param1.aseid.toString()): {\n\n if (!this.allowedEntities.has(param1.constructor as _EntityType[number]))\n this.allowedEntities.add(param1.constructor as _EntityType[number]);\n\n this._entities.set(param1.aseid.toString(), param1 as InstanceType<_EntityType[number]>);\n A_Context.register(this, param1);\n break;\n }\n // 4) In case when it's a A-Fragment instance\n case A_TypeGuards.isFragmentInstance(param1): {\n\n if (!this.allowedFragments.has(param1.constructor as A_TYPES__Fragment_Constructor<_FragmentType[number]>))\n this.allowedFragments.add(param1.constructor as A_TYPES__Fragment_Constructor<_FragmentType[number]>);\n\n this._fragments.set(\n param1.constructor as A_TYPES__Fragment_Constructor<_FragmentType[number]>,\n param1 as _FragmentType[number]\n );\n\n A_Context.register(this, param1);\n\n break;\n }\n // 5) In case when it's a A-Error instance\n case A_TypeGuards.isErrorInstance(param1): {\n if (!this.allowedErrors.has(param1.constructor as _ErrorType[number]))\n this.allowedErrors.add(param1.constructor as _ErrorType[number]);\n\n this._errors.set(\n (param1 as any).code,\n param1 as InstanceType<_ErrorType[number]>\n );\n\n A_Context.register(this, (param1 as any));\n break;\n }\n\n // ------------------------------------------\n // ------------ Constructors ----------------\n // ------------------------------------------\n // 6) In case when it's a A-Component constructor\n case A_TypeGuards.isComponentConstructor(param1): {\n if (!this.allowedComponents.has(param1))\n this.allowedComponents.add(param1 as _ComponentType[number]);\n break;\n }\n // 8) In case when it's a A-Fragment constructor\n case A_TypeGuards.isFragmentConstructor(param1): {\n if (!this.allowedFragments.has(param1))\n this.allowedFragments.add(param1 as A_TYPES__Fragment_Constructor<_FragmentType[number]>);\n break;\n }\n // 9) In case when it's a A-Entity constructor\n case A_TypeGuards.isEntityConstructor(param1): {\n if (!this.allowedEntities.has(param1))\n this.allowedEntities.add(param1 as _EntityType[number]);\n break;\n }\n // 10) In case when it's a A-Error constructor\n case A_TypeGuards.isErrorConstructor(param1): {\n if (!this.allowedErrors.has(param1))\n this.allowedErrors.add(param1 as _ErrorType[number]);\n break;\n }\n\n // ------------------------------------------\n // ------------ Invalid Cases ----------------\n // ------------------------------------------\n\n default:\n if (param1 instanceof A_Entity)\n throw new A_ScopeError(\n A_ScopeError.RegistrationError,\n `Entity with ASEID ${param1.aseid.toString()} is already registered in the scope ${this.name}`\n );\n else if (param1 instanceof A_Fragment)\n throw new A_ScopeError(\n A_ScopeError.RegistrationError,\n `Fragment ${param1.constructor.name} is already registered in the scope ${this.name}`\n );\n else {\n const componentName = A_CommonHelper.getComponentName(param1);\n\n throw new A_ScopeError(\n A_ScopeError.RegistrationError,\n `Cannot register ${componentName} in the scope ${this.name}`\n );\n }\n }\n }\n\n\n /**\n * This method is used to deregister the component from the scope\n * \n * @param fragment \n */\n deregister<T extends A_Component>(\n /**\n * Provide a component constructor to deregister it in the scope\n */\n component: A_TYPES__Component_Constructor<T>\n ): void\n deregister(\n /**\n * Provide a command instance to deregister it in the scope\n */\n component: A_Component\n ): void\n deregister<T extends A_Error>(\n /**\n * Provide an error constructor to deregister it in the scope\n */\n error: A_TYPES__Error_Constructor<T>\n ): void\n deregister(\n /**\n * Provide an error instance to deregister it in the scope\n */\n error: A_Error\n ): void\n deregister<T extends A_Fragment>(\n /**\n * Provide a command instance to deregister it in the scope\n */\n fragment: A_TYPES__Fragment_Constructor<T>\n ): void\n deregister(\n /**\n * Provide a fragment instance to deregister it in the scope\n */\n fragment: A_Fragment\n ): void\n deregister<T extends A_Entity>(\n /**\n * Provide an entity constructor to deregister it in the scope\n */\n entity: A_TYPES__Entity_Constructor<T>\n ): void\n deregister(\n /**\n * Provide an entity instance to deregister it in the scope\n */\n entity: A_Entity\n ): void\n\n deregister(\n param1: unknown\n ): void {\n switch (true) {\n // ------------------------------------------\n // ------------ Instances ----------------\n // ------------------------------------------\n // 1) In case when it's a A-Component instance\n case param1 instanceof A_Component: {\n\n this._components.delete(param1.constructor as _ComponentType[number]);\n A_Context.deregister(param1);\n\n const ctor = param1.constructor as _ComponentType[number];\n\n const hasComponent = this._components.has(ctor);\n if (!hasComponent) {\n this.allowedComponents.delete(ctor);\n }\n\n break;\n }\n // 3) In case when it's a A-Entity instance\n case A_TypeGuards.isEntityInstance(param1): {\n\n this._entities.delete(param1.aseid.toString());\n A_Context.deregister(param1);\n\n const ctor = param1.constructor as _EntityType[number];\n\n const hasEntity = Array.from(this._entities.values()).some(entity => entity instanceof ctor);\n if (!hasEntity) {\n this.allowedEntities.delete(ctor);\n }\n\n break;\n }\n // 4) In case when it's a A-Fragment instance\n case A_TypeGuards.isFragmentInstance(param1): {\n this._fragments.delete(param1.constructor as A_TYPES__Fragment_Constructor<_FragmentType[number]>);\n A_Context.deregister(param1);\n\n const ctor = param1.constructor as A_TYPES__Fragment_Constructor<_FragmentType[number]>;\n\n const hasFragment = Array.from(this._fragments.values()).some(fragment => fragment instanceof ctor);\n if (!hasFragment) {\n this.allowedFragments.delete(ctor);\n }\n\n break;\n }\n // 5) In case when it's a A-Error instance\n case A_TypeGuards.isErrorInstance(param1): {\n\n this._errors.delete((param1 as any).code);\n A_Context.deregister((param1 as any));\n\n const ctor = (param1 as any).constructor as _ErrorType[number];\n\n const hasError = Array.from(this._errors.values()).some(error => error instanceof ctor);\n if (!hasError) {\n this.allowedErrors.delete(ctor);\n }\n\n break;\n }\n\n // ------------------------------------------\n // ------------ Constructors ----------------\n // ------------------------------------------\n // 6) In case when it's a A-Component constructor\n case A_TypeGuards.isComponentConstructor(param1): {\n this.allowedComponents.delete(param1 as _ComponentType[number]);\n break;\n }\n // 8) In case when it's a A-Fragment constructor\n case A_TypeGuards.isFragmentConstructor(param1): {\n this.allowedFragments.delete(param1 as A_TYPES__Fragment_Constructor<_FragmentType[number]>);\n // and then deregister all instances of this fragment\n Array.from(this._fragments.entries()).forEach(([ctor, instance]) => {\n if (A_CommonHelper.isInheritedFrom(ctor, param1)) {\n this._fragments.delete(ctor);\n A_Context.deregister(instance);\n }\n });\n\n break;\n }\n // 9) In case when it's a A-Entity constructor\n case A_TypeGuards.isEntityConstructor(param1): {\n this.allowedEntities.delete(param1 as _EntityType[number]);\n // and then deregister all instances of this entity\n Array.from(this._entities.entries()).forEach(([aseid, instance]) => {\n if (A_CommonHelper.isInheritedFrom(instance.constructor, param1)) {\n this._entities.delete(aseid);\n A_Context.deregister(instance);\n }\n });\n\n break;\n }\n // 10) In case when it's a A-Error constructor\n case A_TypeGuards.isErrorConstructor(param1): {\n this.allowedErrors.delete(param1 as _ErrorType[number]);\n // and then deregister all instances of this error\n Array.from(this._errors.entries()).forEach(([code, instance]) => {\n if (A_CommonHelper.isInheritedFrom(instance.constructor, param1)) {\n this._errors.delete(code);\n A_Context.deregister(instance);\n }\n });\n\n break;\n }\n\n // ------------------------------------------\n // ------------ Invalid Cases ----------------\n // ------------------------------------------\n\n default:\n const componentName = A_CommonHelper.getComponentName(param1);\n\n throw new A_ScopeError(\n A_ScopeError.DeregistrationError,\n `Cannot deregister ${componentName} from the scope ${this.name}`\n );\n }\n\n }\n\n /**\n * This method is useful when you want to serialize the scope to JSON\n * \n * [!] Note this is not a deep serialization, only the fragments are serialized\n * [!] Fragments are a storage for information which is relevant to the scope\n * \n * @returns \n */\n toJSON(): Record<string, any> {\n return this.fragments\n .reduce((acc, fragment) => {\n\n const serialized = fragment.toJSON()\n\n return {\n ...acc,\n [serialized.name]: serialized\n }\n }, {});\n }\n\n\n\n //==========================================================================\n // --------------------Scope Type Check Helpers---------------------------\n //==========================================================================\n /**\n * Type guard to check if the constructor is of type A_Component and is allowed in the scope\n * \n * @param ctor \n * @returns \n */\n protected isAllowedComponent(ctor: unknown): ctor is _ComponentType[number] {\n return A_TypeGuards.isComponentConstructor(ctor) && this.allowedComponents.has(ctor);\n }\n /**\n * Type guard to check if the constructor is of type A_Entity and is allowed in the scope\n * \n * @param ctor \n * @returns \n */\n protected isAllowedEntity(ctor: unknown): ctor is A_TYPES__Entity_Constructor<_EntityType[number]> {\n return A_TypeGuards.isEntityConstructor(ctor) && this.allowedEntities.has(ctor);\n }\n /**\n * Type guard to check if the constructor is of type A_Fragment and is allowed in the scope\n * \n * @param ctor \n * @returns \n */\n protected isAllowedFragment(ctor: unknown): ctor is A_TYPES__Fragment_Constructor<_FragmentType[number]> {\n return A_TypeGuards.isFragmentConstructor(ctor) && this.allowedFragments.has(ctor);\n }\n /**\n * Type guard to check if the constructor is of type A_Error and is allowed in the scope\n * \n * @param ctor \n * @returns \n */\n protected isAllowedError(ctor: unknown): ctor is A_TYPES__Error_Constructor<_ErrorType[number]> {\n return A_TypeGuards.isErrorConstructor(ctor) && this.allowedErrors.has(ctor);\n }\n\n\n\n\n // ==========================================================================\n // --------------------DEBUG & Helpers Methods--------------------------------\n // ===========================================================================\n /**\n * This method is used to check if the scope is inherited from another scope\n * \n * @param scope \n * @returns \n */\n isInheritedFrom(scope: A_Scope): boolean {\n let current: A_Scope | undefined = this;\n\n while (current) {\n if (current === scope) {\n return true;\n }\n current = current._parent;\n }\n\n return false;\n }\n\n /**\n * Helper method to check circular inheritance\n * Should return a full sequence of inheritance for logging purposes\n * \n * @param scope \n * @returns \n */\n checkCircularInheritance(scope: A_Scope): Array<string> | false {\n const inheritanceChain: Array<string> = [];\n let current: A_Scope | undefined = this._parent;\n\n while (current) {\n inheritanceChain.push(current.name);\n if (current === scope) {\n return inheritanceChain;\n }\n current = current._parent;\n }\n\n return false;\n }\n\n /**\n * Helper method to print the inheritance chain of the scope\n */\n printInheritanceChain(): void {\n const chain: Array<string> = [];\n let current: A_Scope | undefined = this;\n\n while (current) {\n chain.push(current.name);\n current = current._parent;\n }\n\n console.log(chain.join(' -> '));\n }\n}","import { A_Error } from \"@adaas/a-concept/a-error\";\n\nexport class A_ScopeError extends A_Error {\n\n\n static readonly InitializationError = 'A-Scope Initialization Error';\n\n static readonly ConstructorError = 'Unable to construct A-Scope instance';\n\n static readonly ResolutionError = 'A-Scope Resolution Error';\n\n static readonly RegistrationError = 'A-Scope Registration Error';\n\n static readonly CircularInheritanceError = 'A-Scope Circular Inheritance Error';\n\n static readonly CircularImportError = 'A-Scope Circular Import Error';\n\n static readonly DeregistrationError = 'A-Scope Deregistration Error';\n}","import { A_Error } from \"@adaas/a-concept/a-error\";\n\n\n\nexport class A_ContextError extends A_Error {\n\n\n static NotAllowedForScopeAllocationError = 'Component is not allowed for scope allocation';\n\n static ComponentAlreadyHasScopeAllocatedError = 'Component already has scope allocated';\n\n static InvalidMetaParameterError = 'Invalid parameter provided to get meta';\n\n static InvalidScopeParameterError = 'Invalid parameter provided to get scope';\n\n static ScopeNotFoundError = 'Scope not found';\n\n static InvalidFeatureParameterError = 'Invalid parameter provided to get feature';\n\n static InvalidFeatureDefinitionParameterError = 'Invalid parameter provided to define feature';\n\n static InvalidFeatureTemplateParameterError = 'Invalid parameter provided to get feature template';\n\n static InvalidFeatureExtensionParameterError = 'Invalid parameter provided to extend feature';\n\n\n static InvalidAbstractionParameterError = 'Invalid parameter provided to get abstraction';\n\n static InvalidAbstractionDefinitionParameterError = 'Invalid parameter provided to define abstraction';\n\n static InvalidAbstractionTemplateParameterError = 'Invalid parameter provided to get abstraction template';\n\n static InvalidAbstractionExtensionParameterError = 'Invalid parameter provided to extend abstraction';\n\n static InvalidInjectionParameterError = 'Invalid parameter provided to get injections';\n\n static InvalidExtensionParameterError = 'Invalid parameter provided to get extensions';\n\n\n static InvalidRegisterParameterError = 'Invalid parameter provided to register component';\n\n\n static InvalidComponentParameterError = 'Invalid component provided';\n\n static ComponentNotRegisteredError = 'Component not registered in the context';\n\n static InvalidDeregisterParameterError = 'Invalid parameter provided to deregister component';\n}","\nimport {\n A_Scope,\n A_TYPES__Scope_Init,\n A_TYPES__ScopeConfig,\n A_TYPES__ScopeLinkedComponents,\n A_TYPES_ScopeDependentComponents\n} from \"@adaas/a-concept/a-scope\";\nimport {\n A_Meta,\n A_TYPES__MetaLinkedComponentConstructors,\n A_TYPES__MetaLinkedComponents\n} from \"@adaas/a-concept/a-meta\";\nimport type {\n A_Feature,\n A_TYPES__FeatureAvailableComponents,\n A_TYPES__FeatureDefineDecoratorMeta\n} from \"@adaas/a-concept/a-feature\";\nimport {\n A_Component,\n A_TYPES__ComponentMetaKey,\n A_TYPES__Component_Constructor,\n A_ComponentMeta\n} from \"@adaas/a-concept/a-component\";\nimport {\n A_Container,\n A_TYPES__ContainerMetaKey,\n A_TYPES__Container_Constructor,\n A_ContainerMeta\n} from \"@adaas/a-concept/a-container\";\nimport {\n A_Entity,\n A_TYPES__EntityMetaKey,\n A_TYPES__Entity_Constructor,\n A_EntityMeta\n} from \"@adaas/a-concept/a-entity\";\nimport { A_TYPES__A_StageStep } from \"@adaas/a-concept/a-stage\";\nimport { A_TYPES__ContextEnvironment } from \"./A-Context.types\";\nimport { A_TypeGuards} from \"@adaas/a-concept/helpers/A_TypeGuards.helper\";\nimport { A_FormatterHelper} from \"@adaas/a-concept/helpers/A_Formatter.helper\";\nimport { A_CommonHelper} from \"@adaas/a-concept/helpers/A_Common.helper\";\nimport { A_ContextError } from \"./A-Context.error\";\nimport {\n A_Fragment,\n A_TYPES__Fragment_Constructor\n} from \"@adaas/a-concept/a-fragment\";\nimport { A_TYPES__ConceptAbstractions } from \"@adaas/a-concept/a-concept\";\nimport { A_Dependency } from \"@adaas/a-concept/a-dependency\";\nimport { A_TYPES__Ctor } from \"@adaas/a-concept/types\";\nimport { A_CONCEPT_ENV } from \"@adaas/a-concept/env\";\n\n\n\nexport class A_Context {\n // ====================================================================================================\n // ================================ STATIC PROPERTIES =================================================\n // ====================================================================================================\n /**\n * Default name of the application from environment variable A_CONCEPT_NAME\n * \n * [!] If environment variable is not set, it will default to 'a-concept'\n */\n static get concept() {\n return A_CONCEPT_ENV.A_CONCEPT_NAME || 'a-concept';\n }\n /**\n * Root scope of the application from environment variable A_CONCEPT_ROOT_SCOPE\n * \n * [!] If environment variable is not set, it will default to 'root'\n */\n static get root(): A_Scope {\n return this.getInstance()._root;\n }\n /**\n * Environment the application is running in.\n * Can be either 'server' or 'browser'.\n * [!] Determined by environment variable A_CONCEPT_RUNTIME_ENVIRONMENT that comes from the build tool or is set manually in the environment.\n */\n static get environment(): A_TYPES__ContextEnvironment {\n return A_CONCEPT_ENV.A_CONCEPT_RUNTIME_ENVIRONMENT\n }\n\n /**\n * Singleton instance of the Context\n */\n private static _instance: A_Context;\n // ====================================================================================================\n // ================================ INTERNAL REGISTRY =================================================\n // ====================================================================================================\n /**\n * Root Scope of the Concept and Environment\n *\n * Root scope is the top-level scope that all other scopes inherit from.\n * It stores global configurations and settings and ALL SHAREABLE RESOURCES.\n * \n * [!] Root scope is created automatically when the Context is initialized.\n * [!] Root scope name can be configured using environment variable A_CONCEPT_ROOT_SCOPE\n */\n private _root!: A_Scope\n /**\n * A registry that keeps track of scopes for all components (Containers, Features, Commands) \n * Which can issue a scope allocation.\n */\n protected _registry: WeakMap<A_TYPES__ScopeLinkedComponents, A_Scope> = new WeakMap();\n /**\n * This is a registry that stores an issuer of each scope allocation.\n * It helps to track which component (Container, Feature, Command) allocated a specific scope.\n */\n protected _scopeIssuers: WeakMap<A_Scope, A_TYPES__ScopeLinkedComponents> = new WeakMap();\n /**\n * Stores a context associated with a specific component that depends on a scope.\n * uses for quick retrieval of the scope for the component.\n */\n protected _scopeStorage: WeakMap<A_TYPES_ScopeDependentComponents, A_Scope> = new WeakMap();\n /**\n * Stores meta information for different component types by their constructors.\n * Meta provides to store extra information about the class behavior and configuration.\n */\n protected _metaStorage: Map<A_TYPES__MetaLinkedComponentConstructors, A_Meta> = new Map();\n\n\n\n\n protected _globals = new Map<string, any>();\n\n /**\n * Private constructor to enforce singleton pattern.\n * \n * [!] This class should not be instantiated directly. Use A_Context.getInstance() instead.\n */\n private constructor() {\n const name = String(A_CONCEPT_ENV.A_CONCEPT_ROOT_SCOPE) || 'root';\n\n this._root = new A_Scope({ name });\n }\n\n\n\n /**\n * Get the instance of the Namespace Provider.\n * \n * If the instance does not exist, it will be created.\n * \n * @returns \n */\n static getInstance() {\n if (!A_Context._instance) {\n A_Context._instance = new A_Context();\n }\n\n return A_Context._instance;\n }\n\n\n\n /**\n * Register method allows to register a component with a specific scope in the context.\n * \n * @param component - Component to register with a specific scope. Can be either A_Container, A_Feature.\n * @param scope - Scope to associate the component with.\n * @returns \n */\n static register(\n /**\n * Provide the scope that will be associated with the component.\n */\n scope: A_Scope,\n /**\n * Provide a component that needs to be registered with a specific scope.\n */\n component: A_TYPES_ScopeDependentComponents,\n\n ): A_Scope {\n // uses only for error messages\n const componentName = A_CommonHelper.getComponentName(component);\n\n const instance = this.getInstance();\n\n if (!component) throw new A_ContextError(\n A_ContextError.InvalidRegisterParameterError,\n `Unable to register component. Component cannot be null or undefined.`);\n\n if (!scope) throw new A_ContextError(\n A_ContextError.InvalidRegisterParameterError,\n `Unable to register component. Scope cannot be null or undefined.`);\n\n if (!this.isAllowedToBeRegistered(component)) throw new A_ContextError(\n A_ContextError.NotAllowedForScopeAllocationError,\n `Component ${componentName} is not allowed for scope allocation.`);\n\n instance._scopeStorage.set(component, scope);\n\n return scope;\n }\n\n /**\n * Deregister method allows to deregister a component from the context.\n * \n * @param component - Component to deregister from the context.\n */\n static deregister(\n /**\n * Provide a component that needs to be deregistered from the context.\n */\n component: A_TYPES_ScopeDependentComponents,\n ): void {\n // uses only for error messages\n const componentName = A_CommonHelper.getComponentName(component);\n\n const instance = this.getInstance();\n\n if (!component) throw new A_ContextError(\n A_ContextError.InvalidDeregisterParameterError,\n `Unable to deregister component. Component cannot be null or undefined.`);\n\n if (!instance._scopeStorage.has(component)) throw new A_ContextError(\n A_ContextError.ComponentNotRegisteredError,\n `Unable to deregister component. Component ${componentName} is not registered.`);\n\n instance._scopeStorage.delete(component);\n }\n\n /**\n * Allocate method instantiates a new scope for the given component and registers it in the context.\n * It bounds the component (Container, Feature) to a new scope that can be configured and used independently.\n * \n * \n * @param component - Component to allocate the scope for. Can be either A_Container, A_Feature.\n * @param importing - Configuration of the scope that will be created for the component.\n */\n static allocate(\n /**\n * Provide a component that needs a scope allocation.\n */\n component: A_TYPES__ScopeLinkedComponents,\n ): A_Scope\n static allocate(\n /**\n * Provide a component that needs a scope allocation.\n */\n component: A_TYPES__ScopeLinkedComponents,\n /**\n * Provide the scope that will be used as a base for the new scope.\n */\n importing: A_Scope\n ): A_Scope\n static allocate(\n /**\n * Provide a component that needs a scope allocation.\n */\n component: A_TYPES__ScopeLinkedComponents,\n /**\n * Provide configuration for the scope that will be created for the component.\n */\n config: Partial<A_TYPES__Scope_Init & A_TYPES__ScopeConfig>\n ): A_Scope\n static allocate(\n component: A_TYPES__ScopeLinkedComponents,\n importing?: Partial<A_TYPES__Scope_Init & A_TYPES__ScopeConfig> | A_Scope\n ): A_Scope {\n // uses only for error messages\n const componentName = A_CommonHelper.getComponentName(component);\n\n // ---------------------------------------------------------------------\n // ----------------------Input Validation-------------------------------\n // ---------------------------------------------------------------------\n // 1) check if component is valid\n if (!this.isAllowedForScopeAllocation(component))\n throw new A_ContextError(A_ContextError.NotAllowedForScopeAllocationError, `Component of type ${componentName} is not allowed for scope allocation. Only A_Container, A_Feature are allowed.`);\n const instance = this.getInstance();\n\n // 2) check if component already has a scope allocated\n if (instance._registry.has(component))\n throw new A_ContextError(A_ContextError.ComponentAlreadyHasScopeAllocatedError, `Component ${componentName} already has a scope allocated.`);\n\n\n // 3) Create a new scope for the component\n const newScope = A_TypeGuards.isScopeInstance(importing)\n ? importing\n : new A_Scope(importing || {\n name: componentName + '-scope'\n }, importing);\n\n // 4) Make sure that the new scope inherits from the root scope\n if (!newScope.isInheritedFrom(A_Context.root))\n newScope.inherit(A_Context.root);\n\n // 5) Register the component in the appropriate storage\n instance._registry.set(component, newScope);\n // Also register the issuer of the scope for faster tracking\n instance._scopeIssuers.set(newScope, component);\n\n // 6) Return the newly created scope\n return newScope;\n }\n\n /**\n * Deallocate method removes the scope allocation for the given component from the context.\n * \n * @param component \n * @returns \n */\n static deallocate(\n /**\n * A Scope that needs to be deallocated.\n */\n scope: A_Scope,\n )\n static deallocate(\n /**\n * Provide a component that needs to have its scope deallocated.\n */\n component: A_TYPES__ScopeLinkedComponents,\n )\n static deallocate(\n /**\n * Provide a component that needs to have its scope deallocated.\n */\n param1: A_TYPES__ScopeLinkedComponents | A_Scope,\n ) {\n const instance = this.getInstance();\n\n const scope = A_TypeGuards.isScopeInstance(param1)\n ? param1\n : instance._registry.get(param1);\n\n if (!scope) return;\n\n const component = A_TypeGuards.isComponentInstance(param1)\n ? param1\n : this.issuer(scope);\n\n if (component)\n instance._registry.delete(component);\n if (scope)\n instance._scopeIssuers.delete(scope);\n }\n\n\n\n /**\n * Get or Create Meta for the specific class or instance.\n * This method will return the existing meta if it exists, or create a new one if it doesn't.\n * \n * Meta object contains custom metadata based on the class type.\n * \n * @param container \n */\n static meta<T extends A_ContainerMeta>(\n /**\n * Get meta for the specific container class by constructor.\n */\n container: A_TYPES__Container_Constructor,\n ): T\n static meta<T extends A_ContainerMeta, S extends A_Container>(\n /**\n * Get meta for the specific container instance.\n */\n container: S,\n ): T\n static meta<T extends A_EntityMeta>(\n /**\n * Get meta for the specific entity class by constructor.\n */\n entity: A_TYPES__Entity_Constructor,\n ): T\n static meta<T extends A_EntityMeta>(\n /**\n * Get meta for the specific entity instance.\n */\n entity: A_Entity,\n ): T\n static meta<T extends A_ComponentMeta>(\n /**\n * Get meta for the specific component class by constructor.\n */\n component: A_TYPES__Component_Constructor,\n ): T\n static meta<T extends A_ComponentMeta, S extends A_Component>(\n /**\n * Get meta for the specific component instance.\n */\n component: S,\n ): T\n static meta<T extends A_Meta>(\n /**\n * Get meta for the specific component class by constructor.\n */\n fragment: A_TYPES__Fragment_Constructor,\n ): T\n static meta<T extends A_Meta>(\n /**\n * Get meta for the specific component instance.\n */\n fragment: A_Fragment,\n ): T\n static meta<T extends A_ComponentMeta>(\n /**\n * Get meta for the specific component by its name.\n */\n component: string,\n ): T\n static meta(\n /**\n * Get meta for the specific meta linked component (class or instance).\n */\n target: A_TYPES__MetaLinkedComponentConstructors | A_TYPES__MetaLinkedComponents,\n ): A_ComponentMeta\n static meta<T extends A_Meta>(\n /**\n * Get meta for the specific class or instance\n */\n constructor: A_TYPES__Ctor<any>\n ): T\n static meta<T extends Record<string, any>>(\n /**\n * Get meta for the specific class or instance\n */\n constructor: A_TYPES__Ctor<any>\n ): A_Meta<T>\n\n static meta<T extends Record<string, any>>(\n param1: A_TYPES__MetaLinkedComponentConstructors\n | A_TYPES__MetaLinkedComponents\n | string\n ): A_Meta<T> {\n\n // Get the component name for error messages\n const componentName = A_CommonHelper.getComponentName(param1);\n // Get the instance of the context\n const instance = this.getInstance();\n\n if (!param1) throw new A_ContextError(A_ContextError.InvalidMetaParameterError, `Invalid parameter provided to get meta. Parameter cannot be null or undefined.`);\n\n // Check if the parameter is allowed for meta storage\n if (!(\n this.isAllowedForMeta(param1)\n || this.isAllowedForMetaConstructor(param1)\n || A_TypeGuards.isString(param1)\n || A_TypeGuards.isFunction(param1\n ))\n ) throw new A_ContextError(A_ContextError.InvalidMetaParameterError, `Invalid parameter provided to get meta. Component of type ${componentName} is not allowed for meta storage. Only A_Container, A_Component and A_Entity are allowed.`);\n\n let property: A_TYPES__MetaLinkedComponentConstructors;\n let metaType: typeof A_Meta<T> | typeof A_ContainerMeta | typeof A_ComponentMeta | typeof A_EntityMeta\n\n switch (true) {\n // 1) If param1 is instance of A_Container\n case A_TypeGuards.isContainerInstance(param1): {\n property = param1.constructor as A_TYPES__Container_Constructor;\n metaType = A_ContainerMeta;\n\n break;\n }\n // 2) If param1 is class of A_Container\n case A_TypeGuards.isContainerConstructor(param1): {\n property = param1 as typeof A_Container;\n metaType = A_ContainerMeta;\n\n break;\n }\n // 3) If param1 is instance of A_Component\n case A_TypeGuards.isComponentInstance(param1): {\n property = param1.constructor as A_TYPES__Component_Constructor;\n metaType = A_ComponentMeta;\n\n break;\n }\n // 4) If param1 is class of A_Component\n case A_TypeGuards.isComponentConstructor(param1): {\n property = param1 as typeof A_Component;\n metaType = A_ComponentMeta;\n\n break;\n }\n // 5) If param1 is instance of A_Entity\n case A_TypeGuards.isEntityInstance(param1): {\n property = param1.constructor as A_TYPES__Entity_Constructor;\n metaType = A_ComponentMeta;\n\n break;\n }\n // 6) If param1 is class of A_Entity\n case A_TypeGuards.isEntityConstructor(param1): {\n property = param1;\n metaType = A_EntityMeta;\n\n break;\n }\n // 7) If param1 is instance of A_Fragment\n case A_TypeGuards.isFragmentInstance(param1): {\n property = param1.constructor as A_TYPES__Fragment_Constructor;\n metaType = A_ComponentMeta;\n\n break;\n }\n // 8) If param1 is class of A_Fragment\n case A_TypeGuards.isFragmentConstructor(param1): {\n property = param1;\n metaType = A_EntityMeta;\n\n break;\n }\n // 9) If param1 is string then we need to find the component by its name\n case typeof param1 === 'string': {\n const found = Array.from(instance._metaStorage)\n .find(([c]) => c.name === param1\n || c.name === A_FormatterHelper.toKebabCase(param1)\n || c.name === A_FormatterHelper.toPascalCase(param1)\n )!;\n if (!(found && found.length))\n throw new A_ContextError(A_ContextError.InvalidMetaParameterError, `Invalid parameter provided to get meta. Component with name ${param1} not found in the meta storage.`);\n\n property = found[0];\n metaType = A_ComponentMeta;\n\n break;\n }\n // 10) If param1 is any other class or function\n default: {\n property = param1;\n metaType = A_Meta;\n\n break;\n }\n }\n\n // Check if the meta already exists for the property, if not create a new one\n if (!instance._metaStorage.has(property)) {\n\n let inheritedMeta: A_Meta<any> | undefined = undefined;\n let currentProperty: any = property;\n\n // go up to the prototype chain and find if there is any meta to inherit from\n while (!inheritedMeta) {\n const parent = Object.getPrototypeOf(currentProperty);\n\n if (!parent) {\n break;\n }\n inheritedMeta = instance._metaStorage.get(parent);\n currentProperty = parent;\n }\n\n if (!inheritedMeta)\n inheritedMeta = new metaType();\n\n instance._metaStorage.set(property, new metaType().from(inheritedMeta as any));\n }\n\n // Return the meta for the property\n return instance._metaStorage.get(property)!;\n }\n\n\n\n /**\n * Allows to set meta for the specific class or instance.\n * \n * @param param1 \n * @param meta \n */\n static setMeta<T extends A_ContainerMeta, S extends A_Container>(\n param1: S,\n meta: T\n )\n static setMeta<T extends A_EntityMeta, S extends A_Entity>(\n param1: S,\n meta: T\n )\n static setMeta<T extends A_ComponentMeta, S extends A_Component>(\n param1: S,\n meta: T\n )\n static setMeta<T extends A_Meta>(\n param1: new (...args: any[]) => any,\n meta: T\n )\n static setMeta<T extends A_Meta>(\n param1: A_TYPES__MetaLinkedComponentConstructors | A_TYPES__MetaLinkedComponents,\n meta: T\n ) {\n const instance = A_Context.getInstance();\n\n const existingMeta = A_Context.meta(param1);\n\n const constructor = typeof param1 === 'function'\n ? param1\n : param1.constructor as A_TYPES__MetaLinkedComponentConstructors;\n\n instance._metaStorage.set(constructor, existingMeta ? meta.from(existingMeta) : meta);\n }\n\n\n\n\n /**\n * \n * This method allows to get the issuer of a specific scope.\n * \n * @param scope - Scope to get the issuer for.\n * @returns - Component that issued the scope.\n */\n static issuer(\n /**\n * Provide the scope to get its issuer.\n */\n scope: A_Scope\n ): A_TYPES__ScopeLinkedComponents | undefined {\n\n const instance = this.getInstance();\n\n if (!scope) throw new A_ContextError(\n A_ContextError.InvalidComponentParameterError,\n `Invalid parameter provided to get scope issuer. Parameter cannot be null or undefined.`\n );\n\n // if (!instance._scopeIssuers.has(scope)) throw new A_ContextError(\n // A_ContextError.ScopeNotFoundError,\n // `Invalid parameter provided to get scope issuer. Provided scope does not have an issuer registered.`\n // );\n\n return instance._scopeIssuers.get(scope)!;\n }\n\n\n\n /**\n * Get the scope of the specific class or instance.\n * \n * Every execution in Concept has its own scope.\n * \n * This method will return the scope of the specific class or instance.\n * \n * @param entity \n */\n static scope<T extends A_Entity>(\n /**\n * Provide an entity to get its scope.\n */\n entity: T\n ): A_Scope\n static scope<T extends A_Component>(\n /**\n * Provide a component to get its scope.\n */\n component: T\n ): A_Scope\n static scope<T extends A_Container>(\n /**\n * Provide a container to get its scope.\n */\n container: T\n ): A_Scope\n static scope<T extends A_Feature>(\n /**\n * Provide a feature to get its scope.\n */\n feature: T\n ): A_Scope\n static scope<T extends A_Fragment>(\n /**\n * Provide a fragment to get its scope.\n */\n fragment: T\n ): A_Scope\n static scope<T extends A_TYPES__ScopeLinkedComponents | A_TYPES_ScopeDependentComponents>(\n param1: T\n ): A_Scope {\n\n // for error messages\n const name = (param1 as any)?.constructor?.name || String(param1);\n\n // Get the instance of the context\n const instance = this.getInstance();\n\n // Input validation\n if (!param1) throw new A_ContextError(A_ContextError.InvalidScopeParameterError, `Invalid parameter provided to get scope. Parameter cannot be null or undefined.`);\n\n // Check if the parameter is allowed for scope allocation\n if (!this.isAllowedForScopeAllocation(param1)\n && !this.isAllowedToBeRegistered(param1)\n )\n throw new A_ContextError(A_ContextError.InvalidScopeParameterError, `Invalid parameter provided to get scope. Component of type ${name} is not allowed for scope allocation.`);\n\n switch (true) {\n case this.isAllowedForScopeAllocation(param1):\n\n // Check if the parameter has a scope allocated\n if (!instance._registry.has(param1))\n throw new A_ContextError(\n A_ContextError.ScopeNotFoundError,\n `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.`\n );\n\n // If the parameter is allowed for scope allocation, return the scope\n return instance._registry.get(param1)!;\n\n case this.isAllowedToBeRegistered(param1):\n\n // Check if the parameter has a scope registered\n if (!instance._scopeStorage.has(param1))\n throw new A_ContextError(\n A_ContextError.ScopeNotFoundError,\n `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.`\n );\n\n // If the parameter is allowed to be registered, return the scope from the storage\n return instance._scopeStorage.get(param1)!;\n default:\n throw new A_ContextError(A_ContextError.InvalidScopeParameterError, `Invalid parameter provided to get scope. Component of type ${name} is not allowed to be registered.`);\n }\n }\n\n\n // ==========================================================================================================\n // ================================== FEATURE MANAGEMENT ====================================================\n // ==========================================================================================================\n // ----------------------------------------------------------------------------------------------------------\n // -----------------------------------Primary Methods -------------------------------------------------------\n // ----------------------------------------------------------------------------------------------------------\n /**\n * Returns a template of the feature that can be then used to create a new A-Feature Instance\n * \n * [!] Note: Steps/Stages included are fully dependent on the scope provided since it dictates which components are active and can provide extensions for the feature.\n * \n * @param name \n */\n static featureTemplate(\n /**\n * Provide the name of the feature to get the template for. Regular expressions are also supported to match multiple features.\n */\n name: string | RegExp,\n /**\n * Provide the component to get the feature template from.\n */\n component: A_TYPES__FeatureAvailableComponents,\n /**\n * Provide the scope that dictates which components are active and can provide extensions for the feature.\n */\n scope: A_Scope = this.scope(component)\n ): Array<A_TYPES__A_StageStep> {\n // name for error messages\n const componentName = A_CommonHelper.getComponentName(component);\n\n // Input validation\n if (!component) throw new A_ContextError(A_ContextError.InvalidFeatureTemplateParameterError, `Unable to get feature template. Component cannot be null or undefined.`);\n if (!name) throw new A_ContextError(A_ContextError.InvalidFeatureTemplateParameterError, `Unable to get feature template. Feature name cannot be null or undefined.`);\n\n // Check if the parameter is allowed for feature definition\n if (!A_TypeGuards.isAllowedForFeatureDefinition(component))\n throw new A_ContextError(A_ContextError.InvalidFeatureTemplateParameterError, `Unable to get feature template. Component of type ${componentName} is not allowed for feature definition.`);\n\n const steps: A_TYPES__A_StageStep[] = [\n // 1) Get the base feature definition from the component\n ...this.featureDefinition(name, component),\n // 2) Get all extensions for the feature from other components in the scope\n ...this.featureExtensions(name, component, scope)\n ];\n\n return steps;\n }\n // ----------------------------------------------------------------------------------------------------------\n // -----------------------------------Helper Methods --------------------------------------------------------\n // ----------------------------------------------------------------------------------------------------------\n /**\n * Returns all extensions for the specific feature in the specific component within the provided scope.\n * Scope dictates which components are active and can provide extensions for the feature.\n * \n * [!] This method only returns extensions, not the base feature definition.\n * \n * @param scope \n * @returns \n */\n static featureExtensions(\n /**\n * Provide the name of the feature to get the template for. Regular expressions are also supported to match multiple features.\n */\n name: string | RegExp,\n /**\n * Provide the component to get the feature template from.\n */\n component: A_TYPES__FeatureAvailableComponents,\n /**\n * Provide the scope that dictates which components are active and can provide extensions for the feature.\n */\n scope: A_Scope\n ): Array<A_TYPES__A_StageStep> {\n\n const instance = this.getInstance();\n // name for error messages\n const componentName = A_CommonHelper.getComponentName(component);\n\n // Input validation\n if (!component) throw new A_ContextError(A_ContextError.InvalidFeatureExtensionParameterError, `Unable to get feature template. Component cannot be null or undefined.`);\n if (!name) throw new A_ContextError(A_ContextError.InvalidFeatureExtensionParameterError, `Unable to get feature template. Feature name cannot be null or undefined.`);\n\n // Check if the parameter is allowed for feature definition\n if (!A_TypeGuards.isAllowedForFeatureDefinition(component))\n throw new A_ContextError(A_ContextError.InvalidFeatureExtensionParameterError, `Unable to get feature template. Component of type ${componentName} is not allowed for feature definition.`);\n\n\n const callNames = A_CommonHelper.getClassInheritanceChain(component)\n .filter(c => c !== A_Component && c !== A_Container && c !== A_Entity)\n .map(c => `${c.name}.${name}`);\n\n // const callNames = [`${A_CommonHelper.getComponentName(component)}.${name}`];\n // const callNames = [`BaseComponent.testFeature`];\n\n const steps: Map<string, A_TYPES__A_StageStep> = new Map();\n\n const allowedComponents: Set<A_TYPES__MetaLinkedComponentConstructors> = new Set();\n\n for (const callName of callNames) {\n // We need to get all components that has extensions for the feature in component\n for (const [cmp, meta] of instance._metaStorage) {\n // Just try to make sure that component not only Indexed but also presented in scope\n if (scope.has(cmp) && (\n A_TypeGuards.isComponentMetaInstance(meta)\n ||\n A_TypeGuards.isContainerMetaInstance(meta)\n )) {\n allowedComponents.add(cmp);\n // Get all extensions for the feature\n meta\n .extensions(callName)\n .forEach((declaration) => {\n const inherited = Array.from(allowedComponents).reverse().find(c => A_CommonHelper.isInheritedFrom(cmp, c) && c !== cmp);\n\n if (inherited) {\n steps.delete(`${A_CommonHelper.getComponentName(inherited)}.${declaration.handler}`);\n }\n\n steps.set(`${A_CommonHelper.getComponentName(cmp)}.${declaration.handler}`, {\n dependency: new A_Dependency(cmp),\n ...declaration\n });\n });\n }\n }\n }\n\n return instance.filterToMostDerived(scope, Array.from(steps.values()));\n }\n\n\n /**\n * method helps to filter steps in a way that only the most derived classes are kept.\n * \n * @param scope \n * @param items \n * @returns \n */\n private filterToMostDerived(\n scope: A_Scope,\n items: A_TYPES__A_StageStep[]): Array<A_TYPES__A_StageStep> {\n return items.filter(item => {\n // const currentClass = scope.resolveConstructor(item.dependency.name)\n const currentClass = scope.resolveConstructor(item.dependency.name)\n\n // Check if this class is parent of any other in the list\n const isParentOfAnother = items.some(other => {\n if (other === item) return false;\n\n const otherClass = scope.resolveConstructor(other.dependency.name);\n\n if (!currentClass || !otherClass) return false;\n\n return currentClass.prototype.isPrototypeOf(otherClass.prototype);\n });\n\n // Keep only classes that are not parent of any other\n return !isParentOfAnother;\n });\n }\n\n\n /**\n * This method returns the feature template definition without any extensions.\n * It can be used to retrieve the base template for a feature before any modifications are applied.\n * \n * [!] This method does not consider extensions from other components.\n * \n * @param feature \n * @param component \n * @returns \n */\n static featureDefinition(\n /**\n * Name of the feature to get the template for.\n * Regular expressions are also supported to match multiple features.\n */\n feature: string | RegExp,\n /**\n * Component to get the feature template from.\n */\n component: A_TYPES__FeatureAvailableComponents,\n ): Array<A_TYPES__A_StageStep> {\n let metaKey;\n\n if (!feature)\n throw new A_ContextError(A_ContextError.InvalidFeatureTemplateParameterError, `Unable to get feature template. Feature name cannot be null or undefined.`);\n if (!component)\n throw new A_ContextError(A_ContextError.InvalidFeatureTemplateParameterError, `Unable to get feature template. Component cannot be null or undefined.`);\n\n\n switch (true) {\n case component instanceof A_Entity:\n metaKey = A_TYPES__EntityMetaKey.FEATURES;\n break;\n case component instanceof A_Container:\n metaKey = A_TYPES__ContainerMetaKey.FEATURES\n break;\n case component instanceof A_Component:\n metaKey = A_TYPES__ComponentMetaKey.FEATURES\n break;\n\n default:\n throw new A_ContextError(A_ContextError.InvalidFeatureTemplateParameterError, `A-Feature cannot be defined on the ${component} level`);\n }\n\n const featureDefinition: A_TYPES__FeatureDefineDecoratorMeta | undefined = this.meta(component)\n ?.get(metaKey)\n ?.get(feature);\n\n return [\n ...(featureDefinition?.template || [])\n ];\n }\n\n // ==========================================================================================================\n // ================================== ABSTRACTION MANAGEMENT =================================================\n // ==========================================================================================================\n // ----------------------------------------------------------------------------------------------------------\n // -----------------------------------Primary Methods -------------------------------------------------------\n // ----------------------------------------------------------------------------------------------------------\n /**\n * Returns a definition of the abstraction that can be then used to create a new A-Feature Instance\n * \n * [!] Note: Steps/Stages included are fully dependent on the scope provided since it dictates which components are active and can provide extensions for the abstraction.\n * \n * @param abstraction \n */\n static abstractionTemplate(\n /**\n * Provide the abstraction stage to get the definition for.\n */\n abstraction: A_TYPES__ConceptAbstractions,\n /**\n * Provide the component to get the abstraction definition from.\n */\n component: A_TYPES__FeatureAvailableComponents,\n ): Array<A_TYPES__A_StageStep> {\n // name for error messages\n const componentName = (A_CommonHelper.getComponentName(component));\n\n // Input validation\n if (!component) throw new A_ContextError(\n A_ContextError.InvalidAbstractionTemplateParameterError,\n `Unable to get feature template. Component cannot be null or undefined.`);\n\n if (!abstraction) throw new A_ContextError(\n A_ContextError.InvalidAbstractionTemplateParameterError,\n `Unable to get feature template. Abstraction stage cannot be null or undefined.`);\n\n // Check if the parameter is allowed for feature definition\n if (!A_TypeGuards.isAllowedForAbstractionDefinition(component))\n throw new A_ContextError(A_ContextError.InvalidAbstractionTemplateParameterError, `Unable to get feature template. Component of type ${componentName} is not allowed for feature definition.`);\n\n const steps: A_TYPES__A_StageStep[] = [\n // 1) Get the base abstraction definition from the component\n // [!] No abstraction Definitions -> They are limited to Concept Abstractions ONLY\n // ...this.abstractionDefinition(abstraction, component),\n\n // 2) Get all extensions for the abstraction from other components in the scope\n ...this.abstractionExtensions(abstraction, component)\n ];\n\n return steps;\n }\n\n // ----------------------------------------------------------------------------------------------------------\n // -----------------------------------Helper Methods --------------------------------------------------------\n // ----------------------------------------------------------------------------------------------------------\n\n static abstractionExtensions(\n /**\n * Provide the abstraction name to get the definition for.\n */\n abstraction: A_TYPES__ConceptAbstractions,\n /**\n * Provide the component to get the abstraction definition from.\n */\n component: A_TYPES__FeatureAvailableComponents,\n ): Array<A_TYPES__A_StageStep> {\n const instance = this.getInstance();\n // name for error messages\n const componentName = A_CommonHelper.getComponentName(component);\n\n // Input validation\n if (!component) throw new A_ContextError(\n A_ContextError.InvalidAbstractionExtensionParameterError,\n `Unable to get feature template. Component cannot be null or undefined.`\n );\n if (!abstraction) throw new A_ContextError(\n A_ContextError.InvalidAbstractionExtensionParameterError,\n `Unable to get feature template. Abstraction stage cannot be null or undefined.`\n );\n // Check if the parameter is allowed for feature definition\n if (!A_TypeGuards.isAllowedForAbstractionDefinition(component))\n throw new A_ContextError\n (A_ContextError.InvalidAbstractionExtensionParameterError,\n `Unable to get feature template. Component of type ${componentName} is not allowed for feature definition.`\n );\n\n const steps: Map<string, A_TYPES__A_StageStep> = new Map();\n\n const scope = this.scope(component);\n\n // We need to get all components that has extensions for the feature in component\n const allowedComponents: Set<A_TYPES__MetaLinkedComponentConstructors> = new Set();\n\n for (const [cmp, meta] of instance._metaStorage) {\n // Just try to make sure that component not only Indexed but also presented in scope\n if (scope.has(cmp) && (\n A_TypeGuards.isComponentMetaInstance(meta)\n || A_TypeGuards.isContainerMetaInstance(meta)\n )) {\n allowedComponents.add(cmp);\n // Get all extensions for the feature\n meta\n .abstractions(abstraction)\n .forEach((declaration) => {\n const inherited = Array.from(allowedComponents).reverse().find(c => A_CommonHelper.isInheritedFrom(cmp, c) && c !== cmp);\n\n if (inherited) {\n steps.delete(`${A_CommonHelper.getComponentName(inherited)}.${declaration.handler}`);\n }\n\n steps.set(`${A_CommonHelper.getComponentName(cmp)}.${declaration.handler}`, {\n dependency: new A_Dependency(cmp),\n ...declaration\n });\n });\n }\n }\n\n return instance.filterToMostDerived(scope, Array.from(steps.values()));\n }\n\n\n /**\n * Resets the Context to its initial state.\n */\n static reset() {\n const instance = A_Context.getInstance();\n\n instance._registry = new WeakMap();\n\n const name = String(A_CONCEPT_ENV.A_CONCEPT_ROOT_SCOPE) || 'root';\n\n instance._root = new A_Scope({ name });\n }\n\n\n\n\n // ====================================================================================================================\n // ====================================== HELPERS & GUARDS ============================================================\n // ====================================================================================================================\n /**\n * Type guard to check if the param is allowed for scope allocation.\n * \n * @param param \n * @returns \n */\n static isAllowedForScopeAllocation(param: any): param is A_TYPES__ScopeLinkedComponents {\n return A_TypeGuards.isContainerInstance(param)\n || A_TypeGuards.isFeatureInstance(param);\n }\n /**\n * Type guard to check if the param is allowed to be registered in the context.\n * \n * @param param \n * @returns \n */\n static isAllowedToBeRegistered(param: any): param is A_TYPES_ScopeDependentComponents {\n return A_TypeGuards.isEntityInstance(param)\n || A_TypeGuards.isComponentInstance(param)\n || A_TypeGuards.isFragmentInstance(param)\n || A_TypeGuards.isErrorInstance(param);\n }\n\n /**\n * Type guard to check if the param is allowed for meta storage.\n * \n * @param param \n * @returns \n */\n static isAllowedForMeta(param: any): param is A_TYPES__MetaLinkedComponents {\n return A_TypeGuards.isContainerInstance(param)\n || A_TypeGuards.isComponentInstance(param)\n || A_TypeGuards.isEntityInstance(param);\n }\n /**\n * Type guard to check if the param is allowed for meta storage by constructor.\n * \n * @param param \n * @returns \n */\n static isAllowedForMetaConstructor(param: any): param is A_TYPES__MetaLinkedComponentConstructors {\n return A_TypeGuards.isContainerConstructor(param)\n || A_TypeGuards.isComponentConstructor(param)\n || A_TypeGuards.isEntityConstructor(param);\n }\n\n\n\n}","import { A_Error } from \"@adaas/a-concept/a-error\";\n\nexport class A_AbstractionError extends A_Error {\n /**\n * This error code indicates that there was an issue extending the abstraction execution\n */\n static readonly AbstractionExtensionError = 'Unable to extend abstraction execution';\n\n}","import {\n A_TYPES__AbstractionDecoratorConfig,\n A_TYPES__AbstractionDecoratorDescriptor\n} from \"./A-Abstraction.types\";\nimport { A_Context } from \"@adaas/a-concept/a-context\";\nimport { A_Meta } from \"@adaas/a-concept/a-meta\";\nimport {\n A_Container,\n A_ContainerMeta,\n A_TYPES__ContainerMetaKey\n} from \"@adaas/a-concept/a-container\";\nimport {\n A_Component,\n A_TYPES__ComponentMetaKey,\n A_ComponentMeta\n} from \"@adaas/a-concept/a-component\";\nimport {\n A_TYPES__ConceptAbstraction,\n A_TYPES__ConceptAbstractions\n} from \"@adaas/a-concept/a-concept\";\nimport { A_AbstractionError } from \"./A-Abstraction.error\";\nimport { A_TypeGuards} from \"@adaas/a-concept/helpers/A_TypeGuards.helper\";\nimport { A_CommonHelper} from \"@adaas/a-concept/helpers/A_Common.helper\";\n\n/**\n * A-Abstraction Extend decorator allows to extends behavior of each concept abstraction execution. \n * In case some components or containers requires to extend the behavior of the abstraction like 'start', 'build' or 'deploy'\n * for example, this decorator allows to do so. \n * \n * @param name - abstraction name \n * @param config - configuration of the abstraction extension\n * @returns \n */\nexport function A_Abstraction_Extend(\n /**\n * Name of the Concept Abstraction to extend\n */\n name: A_TYPES__ConceptAbstractions,\n /**\n * Configuration of the Abstraction Extension\n * \n */\n config: Partial<A_TYPES__AbstractionDecoratorConfig> = {}\n) {\n return function (\n target: A_Container | A_Component,\n propertyKey: string,\n descriptor: A_TYPES__AbstractionDecoratorDescriptor\n ) {\n // for error messages\n const componentName = A_CommonHelper.getComponentName(target)\n\n if (!name)\n throw new A_AbstractionError(\n A_AbstractionError.AbstractionExtensionError,\n `Abstraction name must be provided to extend abstraction for '${componentName}'.`,\n );\n\n // Only Containers and Components can extend Concept Abstractions\n if (!A_TypeGuards.isConstructorAvailableForAbstraction(target)) {\n throw new A_AbstractionError(\n A_AbstractionError.AbstractionExtensionError,\n `Unable to extend Abstraction '${name}' for '${componentName}'. Only A-Containers and A-Components can extend Abstractions.`,\n );\n }\n\n let metaKey;\n const meta: A_ContainerMeta | A_ComponentMeta = A_Context.meta(target);\n\n switch (true) {\n case A_TypeGuards.isContainerConstructor(target) || A_TypeGuards.isContainerInstance(target):\n metaKey = A_TYPES__ContainerMetaKey.ABSTRACTIONS\n break;\n case A_TypeGuards.isComponentConstructor(target) || A_TypeGuards.isComponentInstance(target):\n metaKey = A_TYPES__ComponentMetaKey.ABSTRACTIONS\n break;\n }\n const setName = `CONCEPT_ABSTRACTION::${name}`;\n\n // Get the existed metadata or create a new one\n const existedMeta: A_Meta<{\n [Key: string]: A_TYPES__ConceptAbstraction[];\n }> = meta.get(metaKey) ?\n new A_Meta().from(meta.get(metaKey))\n : new A_Meta();\n\n // Set the metadata of the method to define a custom Stage with name\n const existedMetaValue = [\n ...(existedMeta.get(setName) || [])\n ];\n\n const existedIndex = existedMetaValue.findIndex(item => item.handler === propertyKey);\n\n const abstraction = {\n name: setName,\n handler: propertyKey,\n behavior: config.behavior || 'sync',\n throwOnError: config.throwOnError !== undefined ? config.throwOnError : true,\n\n before: A_TypeGuards.isArray(config.before)\n ? new RegExp(`^${config.before.join('|').replace(/\\./g, '\\\\.')}$`).source\n : config.before instanceof RegExp\n ? config.before.source\n : '',\n after: A_TypeGuards.isArray(config.after)\n ? new RegExp(`^${config.after.join('|').replace(/\\./g, '\\\\.')}$`).source\n : config.after instanceof RegExp\n ? config.after.source\n : '',\n\n override: A_TypeGuards.isArray(config.override)\n ? new RegExp(`^${config.override.join('|').replace(/\\./g, '\\\\.')}$`).source\n : config.after instanceof RegExp\n ? config.after.source\n : '',\n }\n\n if (existedIndex !== -1) {\n // Update the existing method in the metadata\n existedMetaValue[existedIndex] = abstraction;\n } else {\n // Add the new method to the metadata\n existedMetaValue.push(abstraction);\n }\n\n // Set the metadata of the method to define a custom Feature with name\n existedMeta.set(setName, existedMetaValue);\n\n // Update the metadata of the container with the new Stage definition\n A_Context\n .meta(target)\n .set(\n metaKey,\n existedMeta\n );\n };\n}\n","import { A_Abstraction_Extend } from \"./A-Abstraction-Extend.decorator\";\nimport { A_Feature } from \"@adaas/a-concept/a-feature\";\nimport { A_TYPES__Abstraction_Init } from \"./A-Abstraction.types\";\nimport { A_Scope } from \"@adaas/a-concept/a-scope\";\nimport { A_Context } from \"@adaas/a-concept/a-context\";\nimport { A_TYPES__ConceptAbstractions } from \"@adaas/a-concept/a-concept\";\n\n\n\nexport class A_Abstraction {\n\n /**\n * The name of the Abstraction e.g. 'deploy', 'start', 'test', etc.\n */\n protected _name: A_TYPES__ConceptAbstractions;\n /**\n * List of features that are part of this Abstraction\n */\n protected _features: A_Feature[] = [];\n /**\n * The Feature currently being processed\n */\n protected _current?: A_Feature;\n /**\n * Actual Index of the current Feature being processed\n */\n protected _index: number = 0;\n\n\n /**\n * Allows to extends A-Abstraction with additional methods\n */\n static get Extend(): typeof A_Abstraction_Extend {\n return A_Abstraction_Extend;\n }\n\n /**\n * A-Abstraction is an object that is common for any application. \n * By providing components and creating abstraction extensions it's possible to create a unique behavior of the whole solution.\n * \n * Every application has basic abstractions like 'start', 'stop', 'deploy', 'test', etc. \n * They can be easily extended with additional logic from both containers and components.\n * \n * \n * @param params \n */\n constructor(\n /**\n * Parameters to define the A-Abstraction\n */\n params: A_TYPES__Abstraction_Init\n ) {\n this._name = params.name;\n\n this._features = params.containers.map(container => {\n const template = A_Context.abstractionTemplate(\n this._name,\n container\n );\n return new A_Feature({\n name: this._name,\n component: container,\n template\n })\n });\n\n this._current = this._features[0];\n }\n\n /**\n * Returns the name of the Abstraction\n */\n get name(): string { return this._name; }\n /**\n * Returns the current Feature being processed\n */\n get feature(): A_Feature | undefined {\n return this._current;\n }\n /**\n * This method checks if the A-Feature is done\n * \n * @returns \n */\n get isDone(): boolean {\n return !this.feature\n || this._index >= this._features.length\n\n }\n\n\n [Symbol.iterator](): Iterator<A_Feature, any> {\n return {\n // Custom next method\n next: (): IteratorResult<A_Feature, any> => {\n if (!this.isDone) {\n\n this._current = this._features[this._index];\n\n return {\n value: this._current,\n done: false\n };\n } else {\n\n this._current = undefined; // Reset current on end\n\n return {\n value: undefined,\n done: true\n };\n }\n }\n };\n }\n\n /**\n * This method moves the Abstraction processing to the next Feature in the list\n * \n * @param stage \n */\n next(stage) {\n if (this._index >= this._features.length) {\n return;\n }\n\n const stageIndex = this._features.indexOf(stage);\n\n this._index = stageIndex + 1;\n }\n\n\n\n /**\n * Allows to process all stages of the Abstraction\n * \n * @returns \n */\n async process(\n /**\n * Allows to override the scope in which the Abstraction will be processed\n * \n */\n scope?: A_Scope\n ) {\n if (this.isDone)\n return;\n\n for (const feature of this._features) {\n\n await feature.process(scope);\n }\n }\n}","export enum A_TYPES__ConceptAbstractions {\n /**\n * Run the concept.\n */\n Run = 'run',\n /**\n * Build the concept.\n */\n Build = 'build',\n /**\n * Publish the concept.\n */\n Publish = 'publish',\n /**\n * Deploy the concept.\n */\n Deploy = 'deploy',\n /**\n * Load the concept.\n */\n Load = 'load',\n /**\n * Start the concept.\n */\n Start = 'start',\n /**\n * Stop the concept.\n */\n Stop = 'stop',\n}\n\n\n\nexport enum A_TYPES__ConceptMetaKey {\n LIFECYCLE = 'a-component-extensions',\n}","import { A_Container } from \"@adaas/a-concept/a-container\";\nimport {\n A_Abstraction,\n A_TYPES__AbstractionDecoratorConfig\n} from \"@adaas/a-concept/a-abstraction\";\nimport { A_Abstraction_Extend } from \"@adaas/a-concept/a-abstraction\";\nimport { A_Scope } from \"@adaas/a-concept/a-scope\";\nimport { A_Context } from \"@adaas/a-concept/a-context\";\nimport { A_TYPES__ConceptAbstractions } from \"./A-Concept.constants\";\nimport { A_TYPES__Concept_Init } from \"./A-Concept.types\";\nimport { A_Feature } from \"@adaas/a-concept/a-feature\";\n\n\n\nexport class A_Concept<\n _Imports extends A_Container[] = A_Container[]\n> {\n\n // ==============================================================================\n // ==================== STATIC LIFECYCLE DECORATORS ===========================\n // ==============================================================================\n /**\n * Load the concept. This step runs before any other steps to ensure that all components are loaded.\n */\n static Load(\n /**\n * provide additional configuration for the abstraction extension to make it dependent on other factors\n */\n config?: Partial<A_TYPES__AbstractionDecoratorConfig>\n ): ReturnType<typeof A_Abstraction_Extend> {\n return A_Abstraction.Extend(A_TYPES__ConceptAbstractions.Load, config);\n }\n\n /**\n * Publish the concept to ADAAS platform. (Or any other place defined in the concept)\n *\n * [!] To extend the logic just create a custom containers and override the default behavior.\n */\n static Publish(\n /**\n * provide additional configuration for the abstraction extension to make it dependent on other factors\n */\n config?: Partial<A_TYPES__AbstractionDecoratorConfig>\n ): ReturnType<typeof A_Abstraction_Extend> {\n return A_Abstraction.Extend(A_TYPES__ConceptAbstractions.Publish);\n }\n\n /**\n * Deploy the concept to the environment.\n */\n static Deploy(\n /**\n * provide additional configuration for the abstraction extension to make it dependent on other factors\n */\n config?: Partial<A_TYPES__AbstractionDecoratorConfig>\n ) {\n return A_Abstraction.Extend(A_TYPES__ConceptAbstractions.Deploy, config);\n }\n\n /**\n * Compiles the Concept in case there are some containers that require that. \n * \n * Can be used for static websites or any other concept that requires a build step.\n * \n */\n static Build(\n /**\n * provide additional configuration for the abstraction extension to make it dependent on other factors\n */\n config?: Partial<A_TYPES__AbstractionDecoratorConfig>\n ) {\n return A_Abstraction.Extend(A_TYPES__ConceptAbstractions.Build, config);\n }\n\n /**\n * Main execution of the concept.\n */\n static Run(\n /**\n * provide additional configuration for the abstraction extension to make it dependent on other factors\n */\n config?: Partial<A_TYPES__AbstractionDecoratorConfig>\n ) {\n return A_Abstraction.Extend(A_TYPES__ConceptAbstractions.Run, config);\n }\n\n /**\n * Start the concept. Uses for servers or any other background services.\n */\n static Start(\n /**\n * provide additional configuration for the abstraction extension to make it dependent on other factors\n */\n config?: Partial<A_TYPES__AbstractionDecoratorConfig>\n ) {\n return A_Abstraction.Extend(A_TYPES__ConceptAbstractions.Start, config);\n }\n\n /**\n * Stop the concept. Uses for servers or any other background services.\n */\n static Stop(\n /**\n * provide additional configuration for the abstraction extension to make it dependent on other factors\n */\n config?: Partial<A_TYPES__AbstractionDecoratorConfig>\n ) {\n return A_Abstraction.Extend(A_TYPES__ConceptAbstractions.Stop, config);\n }\n\n\n /**\n * Name of the concept\n * \n * By default, the name of the Concept is 'a-concept'\n */\n private _name!: string;\n /**\n * A list of internally defined containers that the concept uses.\n */\n protected _containers!: A_Container[];\n\n\n\n // ==============================================================================\n // ========================== MAIN Methods ======================================\n // ==============================================================================\n\n\n /**\n * A-Concept is a placeholder for the concept of the any program.\n * \n * Concept - could be any Program regardless environment and it's goal.\n * It could be mobile, web or simple html page.\n * All depends on Containers and Components installed and provided in the Concept.\n * \n * \n * [!] Concept operates ONLY with all Components and Containers provided to achieve the goal.\n * \n * \n * @param props - Initialization properties for the Concept\n */\n constructor(\n protected props: A_TYPES__Concept_Init<_Imports>\n ) {\n this._name = props.name || A_Context.root.name;\n\n if (props.components && props.components.length)\n props.components.forEach(component => this.scope.register(component))\n\n if (props.fragments && props.fragments.length)\n props.fragments.forEach(fragment => this.scope.register(fragment))\n\n if (props.entities && props.entities.length)\n props.entities.forEach(entity => this.scope.register(entity as any))\n\n\n this._containers = props.containers || [];\n }\n\n /**\n * Name of the concept\n */\n get name() {\n return A_Context.root.name;\n }\n /**\n * The primary Root scope of the concept.\n */\n get scope() {\n return A_Context.root;\n }\n\n /**\n * Register a class or value in the concept scope.\n */\n get register(): A_Scope['register'] {\n return this.scope.register.bind(this.scope);\n }\n\n /**\n * Resolve a class or value from the concept scope.\n */\n get resolve(): A_Scope['resolve'] {\n return this.scope.resolve.bind(this.scope);\n }\n\n\n // =======================================================================\n // ========================== LIFECYCLE ================================\n // =======================================================================\n /**\n * Load the concept.\n */\n async load(\n scope?: A_Scope,\n ) {\n const abstraction = new A_Abstraction({\n name: A_TYPES__ConceptAbstractions.Load,\n containers: this._containers,\n });\n\n await abstraction.process(scope);\n }\n /**\n * Run the concept.\n */\n async run(\n scope?: A_Scope,\n ) {\n const abstraction = new A_Abstraction({\n name: A_TYPES__ConceptAbstractions.Run,\n containers: this._containers,\n });\n\n await abstraction.process(scope);\n }\n /**\n * Start the concept.\n * \n * @param params \n */\n async start(\n scope?: A_Scope,\n ) {\n const abstraction = new A_Abstraction({\n name: A_TYPES__ConceptAbstractions.Start,\n containers: this._containers,\n });\n\n await abstraction.process(scope);\n }\n /**\n * Stop the concept.\n * \n * @param params \n */\n async stop(\n scope?: A_Scope,\n ) {\n const abstraction = new A_Abstraction({\n name: A_TYPES__ConceptAbstractions.Stop,\n containers: this._containers,\n });\n\n await abstraction.process(scope);\n }\n /**\n * Build the concept.\n */\n async build(\n scope?: A_Scope,\n ) {\n const abstraction = new A_Abstraction({\n name: A_TYPES__ConceptAbstractions.Build,\n containers: this._containers,\n });\n\n await abstraction.process(scope);\n }\n /**\n * Deploy the concept.\n */\n async deploy(\n scope?: A_Scope,\n ) {\n const abstraction = new A_Abstraction({\n name: A_TYPES__ConceptAbstractions.Deploy,\n containers: this._containers,\n });\n\n await abstraction.process(scope);\n\n }\n /**\n * Publish the concept.\n */\n async publish(\n scope?: A_Scope,\n ) {\n const abstraction = new A_Abstraction({\n name: A_TYPES__ConceptAbstractions.Publish,\n containers: this._containers,\n });\n\n await abstraction.process(scope);\n }\n\n\n // =======================================================================\n // ========================== CALL =====================================\n // =======================================================================\n\n\n /**\n * Call the specific method of the concept or included modules.\n */\n async call<\n K extends Record<_Imports[number]['name'], string>\n >(\n /**\n * Name of the method to call\n */\n method: K[keyof K],\n /**\n * Container in which the method is located\n */\n container: _Imports[number],\n ) {\n const feature = new A_Feature({ name: method, component: container });\n\n return await feature.process();\n }\n}\n\n\n\n\n","\nimport { A_Container } from \"@adaas/a-concept/a-container\";\nimport { A_Meta } from \"@adaas/a-concept/a-meta\";\n\n\n\nexport class A_ConceptMeta extends A_Meta<any> {\n\n\n constructor(\n private containers: Array<A_Container>,\n ) {\n super();\n }\n\n\n}","import { A_Error } from \"@adaas/a-concept/a-error\";\n\n\nexport class A_InjectError extends A_Error {\n static readonly InvalidInjectionTarget = 'Invalid target for A-Inject decorator';\n\n static readonly MissingInjectionTarget = 'Missing target for A-Inject decorator';\n}","import {\n A_TYPES__A_InjectDecorator_Meta,\n A_TYPES__A_InjectDecoratorReturn,\n A_TYPES__InjectableTargets\n} from \"./A-Inject.types\";\nimport {\n A_Component,\n A_TYPES__ComponentMetaKey,\n A_TYPES__Component_Constructor\n} from \"@adaas/a-concept/a-component\";\nimport {\n A_Fragment,\n A_TYPES__Fragment_Constructor\n} from \"@adaas/a-concept/a-fragment\";\nimport {\n A_TYPES__ContainerMetaKey\n\n} from \"@adaas/a-concept/a-container\";\nimport {\n A_TYPES__Entity_Constructor,\n A_TYPES__EntityMetaKey\n} from \"@adaas/a-concept/a-entity\";\nimport { A_Context } from \"@adaas/a-concept/a-context\";\nimport { A_Meta } from \"@adaas/a-concept/a-meta\";\nimport { A_Entity } from \"@adaas/a-concept/a-entity\";\nimport { A_TYPES__Feature_Constructor } from \"@adaas/a-concept/a-feature\";\nimport {\n A_Caller,\n A_TYPES__Caller_Constructor\n} from \"@adaas/a-concept/a-caller\";\nimport { A_TypeGuards} from \"@adaas/a-concept/helpers/A_TypeGuards.helper\";\nimport { A_CommonHelper} from \"@adaas/a-concept/helpers/A_Common.helper\";\nimport { A_InjectError } from \"./A-Inject.error\";\nimport {\n A_Scope,\n A_TYPES__Scope_Constructor\n} from \"@adaas/a-concept/a-scope\";\nimport { A_Feature } from \"@adaas/a-concept/a-feature\";\nimport {\n A_Error,\n A_TYPES__Error_Constructor\n} from \"@adaas/a-concept/a-error\";\nimport {\n A_Dependency,\n A_TYPES__A_DependencyInjectable,\n A_TYPES__A_DependencyResolutionStrategy\n} from \"@adaas/a-concept/a-dependency\";\nimport { A_TYPES__Ctor } from \"@adaas/a-concept/types\";\n\n\n/**\n * A-Inject decorator\n * \n * This Decorator allows to inject dependencies into the module like \n * - Namespaces \n * - Other Concepts \n * - or maybe Components\n * \n * @param params - see overloads\n * @returns - decorator function\n */\nexport function A_Inject<T extends A_Component>(\n /**\n * Provide the Component constructor that will be associated with the injection.\n * \n * [!] It returns an Instance of the Component from current Scope or from Parent Scopes.\n */\n component: A_TYPES__Component_Constructor<T>,\n /**\n * Provide additional instructions on how to perform the injection\n *\n * [!] Default Pagination is 1 if it's necessary to get multiple Fragments please customize it in the instructions\n */\n config?: Omit<Partial<A_TYPES__A_DependencyResolutionStrategy<T>>, 'query' | 'pagination'>\n): A_TYPES__A_InjectDecoratorReturn\n// Allows to inject just one Context Fragment\nexport function A_Inject<T extends A_Fragment>(\n /**\n * Provide the Fragment constructor to inject the Fragment instance\n *\n * [!] It returns the Fragment instance from current Scope or from Parent Scopes.\n */\n fragment: A_TYPES__Fragment_Constructor<T>,\n /**\n * Provide additional instructions on how to perform the injection\n *\n * [!] Default Pagination is 1 if it's necessary to get multiple Fragments please customize it in the instructions\n */\n config?: Omit<Partial<A_TYPES__A_DependencyResolutionStrategy<T>>, 'query' | 'pagination'>\n): A_TYPES__A_InjectDecoratorReturn\nexport function A_Inject<T extends A_Entity>(\n /**\n * Provide the Entity constructor to inject the Entity instance\n * \n * [!] Note: It returns the Entity instance from current Scope or from Parent Scopes.\n * [!] Note: If instance has more than one Entity of the same type It returns FIRST found Entity\n * [!] Note: Use 'config' to specify to inject specific one or even Array of Entities\n */\n entity: A_TYPES__Entity_Constructor<T>,\n /**\n * Provide additional instructions on how to perform the injection\n * \n * [!] Default Pagination is 1 if it's necessary to get multiple Entities please customize it in the instructions\n */\n config?: Partial<A_TYPES__A_DependencyResolutionStrategy<T>>\n): A_TYPES__A_InjectDecoratorReturn<T>\nexport function A_Inject<T extends A_Component>(\n /**\n * Provide the name of Component constructor to inject the Component instance\n * \n * [!] You can use both customized one or original depending on your overriding strategy\n */\n ctor: string\n): A_TYPES__A_InjectDecoratorReturn\n// Allows to inject just one A_FeatureCaller\nexport function A_Inject<T extends A_Caller>(\n /**\n * Provide the A_Caller constructor to inject the Caller instance\n *\n * [!] It returns initiator of the call, e.g. Container/Component/Command who called Feature \n */\n caller: A_TYPES__Caller_Constructor<T>\n): A_TYPES__A_InjectDecoratorReturn\n// Allows to inject just one A_Error instance\nexport function A_Inject<T extends A_Error>(\n /***\n * Provide the Error constructor that will be associated with the injection.\n *\n * [!] It returns an Instance of the Error what is executed.\n */\n error: A_TYPES__Error_Constructor<T>,\n /**\n * Provide additional instructions on how to perform the injection\n *\n * [!] Default Pagination is 1 if it's necessary to get multiple Fragments please customize it in the instructions\n */\n config?: Omit<Partial<A_TYPES__A_DependencyResolutionStrategy<T>>, 'query' | 'pagination'>\n): A_TYPES__A_InjectDecoratorReturn\nexport function A_Inject<T extends A_Feature>(\n /**\n * Provide the Feature constructor that will be associated with the injection.\n * \n * [!] It returns an Instance of the Feature what is executed. \n */\n feature: A_TYPES__Feature_Constructor<T>\n): A_TYPES__A_InjectDecoratorReturn\n// Allows to inject just one Scope instance\nexport function A_Inject<T extends A_Scope>(\n /***\n * Provide the Scope constructor that will be associated with the injection.\n *\n * [!] It returns an instance of the Scope where the Entity/Component/Container is defined.\n */\n scope: A_TYPES__Scope_Constructor<T>\n): A_TYPES__A_InjectDecoratorReturn\nexport function A_Inject<T extends A_TYPES__A_DependencyInjectable>(\n /***\n * Provide the Scope constructor that will be associated with the injection.\n *\n * [!] It returns an instance of the Scope where the Entity/Component/Container is defined.\n */\n dependency: A_Dependency<T>\n): A_TYPES__A_InjectDecoratorReturn\nexport function A_Inject<T extends A_TYPES__A_DependencyInjectable>(\n param1: string | A_TYPES__Ctor<T> | A_Dependency<T>,\n param2?: Partial<A_TYPES__A_DependencyResolutionStrategy<T>>\n): A_TYPES__A_InjectDecoratorReturn {\n\n // pre call checks\n if (!param1) {\n throw new A_InjectError(\n A_InjectError.MissingInjectionTarget,\n `A-Inject decorator is missing the target to inject`\n );\n }\n\n\n return function (\n target: A_TYPES__InjectableTargets,\n methodName: string | symbol | undefined,\n parameterIndex: number\n ) {\n // for Error handling purposes\n const componentName = A_CommonHelper.getComponentName(target)\n\n if (!A_TypeGuards.isTargetAvailableForInjection(target)) {\n throw new A_InjectError(\n A_InjectError.InvalidInjectionTarget,\n `A-Inject cannot be used on the target of type ${typeof target} (${componentName})`\n );\n }\n\n // determine the method name or 'constructor' for constructor injections\n const method = methodName ? String(methodName) : 'constructor';\n let metaKey;\n\n switch (true) {\n case A_TypeGuards.isComponentConstructor(target) || A_TypeGuards.isComponentInstance(target):\n metaKey = A_TYPES__ComponentMetaKey.INJECTIONS;\n break;\n\n case A_TypeGuards.isContainerInstance(target):\n metaKey = A_TYPES__ContainerMetaKey.INJECTIONS;\n break;\n\n case A_TypeGuards.isEntityInstance(target):\n metaKey = A_TYPES__EntityMetaKey.INJECTIONS;\n break;\n }\n\n // get existing meta or create a new one\n const existedMeta = A_Context.meta(target).get(metaKey) || new A_Meta();\n // get existing injections for the method or create a new array\n const paramsArray: A_TYPES__A_InjectDecorator_Meta = existedMeta.get(method) || [];\n\n // set the parameter injection info\n paramsArray[parameterIndex] = param1 instanceof A_Dependency ? param1 : new A_Dependency(param1, param2);\n\n // save back the updated injections array\n existedMeta.set(method, paramsArray);\n\n // save back the updated meta info\n A_Context\n .meta(target)\n .set(\n metaKey,\n existedMeta\n );\n }\n}"]}
|