@adaas/a-concept 0.2.14 → 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.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 +4188 -212
- package/dist/browser/index.mjs +2 -67
- package/dist/browser/index.mjs.map +1 -1
- package/dist/node/index.cjs +5810 -383
- package/dist/node/index.cjs.map +1 -1
- package/dist/node/index.d.mts +4215 -212
- package/dist/node/index.d.ts +4215 -212
- package/dist/node/index.mjs +5751 -66
- package/dist/node/index.mjs.map +1 -1
- package/jest.config.ts +30 -15
- package/package.json +19 -16
- package/src/env/env-browser.ts +38 -1
- package/src/env/env-node.ts +26 -2
- package/src/env/env.base.ts +21 -2
- 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 +53 -42
- 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/lib/A-Dependency/A-Dependency-Query.decorator.ts +90 -0
- package/src/{global → lib}/A-Dependency/A-Dependency-Require.decorator.ts +11 -9
- package/src/{global → lib}/A-Dependency/A-Dependency.class.ts +20 -3
- package/src/{global → lib}/A-Dependency/A-Dependency.error.ts +1 -1
- package/src/{global → lib}/A-Dependency/A-Dependency.types.ts +20 -9
- package/src/lib/A-Dependency/index.ts +18 -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 +37 -25
- package/src/{global → lib}/A-Scope/A-Scope.error.ts +1 -1
- package/src/{global → lib}/A-Scope/A-Scope.types.ts +23 -15
- 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 +73 -1
- package/tests/A-Entity.test.ts +108 -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 +18 -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.cjs +0 -12
- package/dist/node/env.cjs.map +0 -1
- 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
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { A_TYPES__Ctor } from "@adaas/a-concept/types
|
|
2
|
-
import { A_Component } from "
|
|
3
|
-
import { A_TYPES__ConceptAbstractions } from "
|
|
4
|
-
import { A_Container } from "
|
|
5
|
-
import { A_TYPES__FeatureExtendDecoratorConfig } from "
|
|
1
|
+
import { A_TYPES__Ctor } from "@adaas/a-concept/types";
|
|
2
|
+
import { A_Component } from "@adaas/a-concept/a-component";
|
|
3
|
+
import { A_TYPES__ConceptAbstractions } from "@adaas/a-concept/a-concept";
|
|
4
|
+
import { A_Container } from "@adaas/a-concept/a-container";
|
|
5
|
+
import { A_TYPES__FeatureExtendDecoratorConfig } from "@adaas/a-concept/a-feature";
|
|
6
6
|
import { A_Abstraction } from "./A-Abstraction.class";
|
|
7
7
|
|
|
8
8
|
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { A_Abstraction } from './A-Abstraction.class';
|
|
2
|
+
export { A_AbstractionError } from './A-Abstraction.error';
|
|
3
|
+
export * from './A-Abstraction.types';
|
|
4
|
+
|
|
5
|
+
// --------------------------------------------------------
|
|
6
|
+
// -----------------------Decorators-----------------------
|
|
7
|
+
// --------------------------------------------------------
|
|
8
|
+
export { A_Abstraction_Extend } from './A-Abstraction-Extend.decorator';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A_TypeGuards
|
|
2
|
-
import { A_TYPES__FeatureAvailableComponents } from "
|
|
1
|
+
import { A_TypeGuards} from "@adaas/a-concept/helpers/A_TypeGuards.helper";
|
|
2
|
+
import { A_TYPES__FeatureAvailableComponents } from "@adaas/a-concept/a-feature";
|
|
3
3
|
import { A_CallerError } from "./A_Caller.error";
|
|
4
4
|
|
|
5
5
|
|
|
@@ -53,8 +53,7 @@ export class A_Caller<T extends A_TYPES__FeatureAvailableComponents = A_TYPES__F
|
|
|
53
53
|
) {
|
|
54
54
|
if (!A_TypeGuards.isAllowedForFeatureCall(component)) {
|
|
55
55
|
throw new A_CallerError(
|
|
56
|
-
A_CallerError.CallerInitializationError,
|
|
57
|
-
`Invalid A-Caller component provided of type: ${typeof component} with value: ${JSON.stringify(component).slice(0, 100)}...`
|
|
56
|
+
`[${A_CallerError.CallerInitializationError}]: Invalid A-Caller component provided of type: ${typeof component} with value: ${JSON.stringify(component).slice(0, 100)}...`
|
|
58
57
|
);
|
|
59
58
|
}
|
|
60
59
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { A_TYPES__Ctor } from "@adaas/a-concept/types
|
|
2
|
-
import { A_Component } from "
|
|
3
|
-
import { A_Container } from "
|
|
4
|
-
import { A_Entity } from "
|
|
1
|
+
import { A_TYPES__Ctor } from "@adaas/a-concept/types";
|
|
2
|
+
import { A_Component } from "@adaas/a-concept/a-component";
|
|
3
|
+
import { A_Container } from "@adaas/a-concept/a-container";
|
|
4
|
+
import { A_Entity } from "@adaas/a-concept/a-entity";
|
|
5
5
|
import { A_Caller } from "./A_Caller.class";
|
|
6
6
|
|
|
7
7
|
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { A_Scope } from "../A-Scope/A-Scope.class";
|
|
1
|
+
import { A_Feature } from "@adaas/a-concept/a-feature";
|
|
2
|
+
import { A_Scope } from "@adaas/a-concept/a-scope";
|
|
4
3
|
|
|
5
4
|
|
|
6
5
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { A_TYPES__A_InjectDecorator_Meta } from "@adaas/a-concept/
|
|
2
|
-
import { A_TYPES__ConceptAbstractionMeta } from "
|
|
3
|
-
import { A_Meta } from "
|
|
1
|
+
import { A_TYPES__A_InjectDecorator_Meta } from "@adaas/a-concept/a-inject";
|
|
2
|
+
import { A_TYPES__ConceptAbstractionMeta } from "@adaas/a-concept/a-concept";
|
|
3
|
+
import { A_Meta } from "@adaas/a-concept/a-meta";
|
|
4
4
|
import { A_TYPES__ComponentMeta, A_TYPES__ComponentMetaExtension } from "./A-Component.types";
|
|
5
5
|
import { A_TYPES__ComponentMetaKey } from "./A-Component.constants";
|
|
6
|
-
import { A_TYPES__FeatureDefineDecoratorMeta } from "
|
|
6
|
+
import { A_TYPES__FeatureDefineDecoratorMeta } from "@adaas/a-concept/a-feature";
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
export class A_ComponentMeta<T extends A_TYPES__ComponentMeta = A_TYPES__ComponentMeta> extends A_Meta<T> {
|
|
@@ -50,7 +50,7 @@ export class A_ComponentMeta<T extends A_TYPES__ComponentMeta = A_TYPES__Compone
|
|
|
50
50
|
before: extension.before || '',
|
|
51
51
|
after: extension.after || '',
|
|
52
52
|
throwOnError: extension.throwOnError || true,
|
|
53
|
-
override:''
|
|
53
|
+
override: ''
|
|
54
54
|
});
|
|
55
55
|
|
|
56
56
|
});
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { A_TYPES__A_InjectDecorator_Meta } from "@adaas/a-concept/
|
|
2
|
-
import { A_Meta } from "
|
|
3
|
-
import { A_TYPES__ConceptAbstraction } from "
|
|
1
|
+
import { A_TYPES__A_InjectDecorator_Meta } from "@adaas/a-concept/a-inject"
|
|
2
|
+
import { A_Meta } from "@adaas/a-concept/a-meta"
|
|
3
|
+
import { A_TYPES__ConceptAbstraction } from "@adaas/a-concept/a-concept"
|
|
4
4
|
import { A_Component } from "./A-Component.class"
|
|
5
5
|
import { A_TYPES__ComponentMetaKey } from "./A-Component.constants"
|
|
6
|
-
import { A_TYPES__FeatureDefineDecoratorMeta, A_TYPES__FeatureExtendDecoratorMeta } from "
|
|
7
|
-
import { A_TYPES__Ctor } from "@adaas/a-concept/types
|
|
6
|
+
import { A_TYPES__FeatureDefineDecoratorMeta, A_TYPES__FeatureExtendDecoratorMeta } from "@adaas/a-concept/a-feature"
|
|
7
|
+
import { A_TYPES__Ctor } from "@adaas/a-concept/types"
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
import { A_Container } from "
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { A_Container } from "@adaas/a-concept/a-container";
|
|
2
|
+
import {
|
|
3
|
+
A_Abstraction,
|
|
4
|
+
A_TYPES__AbstractionDecoratorConfig
|
|
5
|
+
} from "@adaas/a-concept/a-abstraction";
|
|
6
|
+
import { A_Abstraction_Extend } from "@adaas/a-concept/a-abstraction";
|
|
7
|
+
import { A_Scope } from "@adaas/a-concept/a-scope";
|
|
8
|
+
import { A_Context } from "@adaas/a-concept/a-context";
|
|
6
9
|
import { A_TYPES__ConceptAbstractions } from "./A-Concept.constants";
|
|
7
10
|
import { A_TYPES__Concept_Init } from "./A-Concept.types";
|
|
8
|
-
import {
|
|
9
|
-
import { A_Feature } from "../A-Feature/A-Feature.class";
|
|
11
|
+
import { A_Feature } from "@adaas/a-concept/a-feature";
|
|
10
12
|
|
|
11
13
|
|
|
12
14
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { A_Container } from "
|
|
1
|
+
import { A_Container } from "@adaas/a-concept/a-container";
|
|
2
2
|
import { A_Concept } from "./A-Concept.class";
|
|
3
|
-
import { A_TYPES__FeatureExtendDecoratorMeta } from "
|
|
4
|
-
import { A_TYPES__Component_Constructor } from "
|
|
5
|
-
import { A_TYPES__Fragment_Constructor } from "
|
|
6
|
-
import { A_TYPES__Entity_Constructor } from "
|
|
7
|
-
import { A_TYPES__A_InjectDecorator_Meta } from "
|
|
8
|
-
import { A_TYPES__Ctor } from "@adaas/a-concept/types
|
|
3
|
+
import { A_TYPES__FeatureExtendDecoratorMeta } from "@adaas/a-concept/a-feature";
|
|
4
|
+
import { A_TYPES__Component_Constructor } from "@adaas/a-concept/a-component";
|
|
5
|
+
import { A_TYPES__Fragment_Constructor } from "@adaas/a-concept/a-fragment";
|
|
6
|
+
import { A_TYPES__Entity_Constructor } from "@adaas/a-concept/a-entity";
|
|
7
|
+
import { A_TYPES__A_InjectDecorator_Meta } from "@adaas/a-concept/a-inject";
|
|
8
|
+
import { A_TYPES__Ctor } from "@adaas/a-concept/types";
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
// ============================================================================
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { A_Context } from "
|
|
2
|
-
import { A_Feature } from "
|
|
3
|
-
import { A_Scope } from "
|
|
1
|
+
import { A_Context } from "@adaas/a-concept/a-context";
|
|
2
|
+
import { A_Feature } from "@adaas/a-concept/a-feature";
|
|
3
|
+
import { A_Scope } from "@adaas/a-concept/a-scope";
|
|
4
4
|
import { A_TYPES__Container_Init } from "./A-Container.types";
|
|
5
5
|
|
|
6
6
|
|
|
@@ -1,10 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import {
|
|
2
|
+
A_TYPES__ContainerMeta,
|
|
3
|
+
A_TYPES__ContainerMetaExtension,
|
|
4
|
+
} from "./A-Container.types";
|
|
5
|
+
import { A_TYPES__A_InjectDecorator_Meta } from "@adaas/a-concept/a-inject";
|
|
6
|
+
import {
|
|
7
|
+
A_TYPES__ConceptAbstractionMeta,
|
|
8
|
+
A_TYPES__ConceptAbstractions
|
|
9
|
+
} from "@adaas/a-concept/a-concept";
|
|
10
|
+
import { A_Meta } from "@adaas/a-concept/a-meta";
|
|
5
11
|
import { A_TYPES__ContainerMetaKey } from "./A-Container.constants";
|
|
6
|
-
import { A_TYPES__FeatureDefineDecoratorMeta } from "
|
|
7
|
-
import { A_TYPES__ConceptAbstractions } from "../A-Concept/A-Concept.constants";
|
|
12
|
+
import { A_TYPES__FeatureDefineDecoratorMeta } from "@adaas/a-concept/a-feature";
|
|
8
13
|
|
|
9
14
|
|
|
10
15
|
|
|
@@ -1,11 +1,14 @@
|
|
|
1
|
-
import { A_TYPES__A_InjectDecorator_Meta } from "@adaas/a-concept/
|
|
2
|
-
import { A_TYPES__ConceptAbstraction, } from "
|
|
3
|
-
import { A_Meta } from "
|
|
4
|
-
import { A_TYPES__Scope_Init } from "
|
|
1
|
+
import { A_TYPES__A_InjectDecorator_Meta } from "@adaas/a-concept/a-inject";
|
|
2
|
+
import { A_TYPES__ConceptAbstraction, } from "@adaas/a-concept/a-concept";
|
|
3
|
+
import { A_Meta } from "@adaas/a-concept/a-meta";
|
|
4
|
+
import { A_TYPES__Scope_Init } from "@adaas/a-concept/a-scope";
|
|
5
5
|
import { A_TYPES__ContainerMetaKey } from "./A-Container.constants";
|
|
6
6
|
import { A_Container } from "./A-Container.class";
|
|
7
|
-
import {
|
|
8
|
-
|
|
7
|
+
import {
|
|
8
|
+
A_TYPES__FeatureDefineDecoratorMeta,
|
|
9
|
+
A_TYPES__FeatureExtendDecoratorMeta
|
|
10
|
+
} from "@adaas/a-concept/a-feature";
|
|
11
|
+
import { A_TYPES__Ctor } from "@adaas/a-concept/types";
|
|
9
12
|
|
|
10
13
|
|
|
11
14
|
// ============================================================================
|
|
@@ -1,44 +1,52 @@
|
|
|
1
|
+
|
|
1
2
|
import {
|
|
3
|
+
A_Scope,
|
|
2
4
|
A_TYPES__Scope_Init,
|
|
3
5
|
A_TYPES__ScopeConfig,
|
|
4
6
|
A_TYPES__ScopeLinkedComponents,
|
|
5
7
|
A_TYPES_ScopeDependentComponents
|
|
6
|
-
} from "
|
|
8
|
+
} from "@adaas/a-concept/a-scope";
|
|
7
9
|
import {
|
|
10
|
+
A_Meta,
|
|
8
11
|
A_TYPES__MetaLinkedComponentConstructors,
|
|
9
12
|
A_TYPES__MetaLinkedComponents
|
|
10
|
-
} from "
|
|
11
|
-
import {
|
|
13
|
+
} from "@adaas/a-concept/a-meta";
|
|
14
|
+
import type {
|
|
15
|
+
A_Feature,
|
|
12
16
|
A_TYPES__FeatureAvailableComponents,
|
|
13
17
|
A_TYPES__FeatureDefineDecoratorMeta
|
|
14
|
-
} from "
|
|
15
|
-
import {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
import {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
import {
|
|
18
|
+
} from "@adaas/a-concept/a-feature";
|
|
19
|
+
import {
|
|
20
|
+
A_Component,
|
|
21
|
+
A_TYPES__ComponentMetaKey,
|
|
22
|
+
A_TYPES__Component_Constructor,
|
|
23
|
+
A_ComponentMeta
|
|
24
|
+
} from "@adaas/a-concept/a-component";
|
|
25
|
+
import {
|
|
26
|
+
A_Container,
|
|
27
|
+
A_TYPES__ContainerMetaKey,
|
|
28
|
+
A_TYPES__Container_Constructor,
|
|
29
|
+
A_ContainerMeta
|
|
30
|
+
} from "@adaas/a-concept/a-container";
|
|
31
|
+
import {
|
|
32
|
+
A_Entity,
|
|
33
|
+
A_TYPES__EntityMetaKey,
|
|
34
|
+
A_TYPES__Entity_Constructor,
|
|
35
|
+
A_EntityMeta
|
|
36
|
+
} from "@adaas/a-concept/a-entity";
|
|
37
|
+
import { A_TYPES__A_StageStep } from "@adaas/a-concept/a-stage";
|
|
28
38
|
import { A_TYPES__ContextEnvironment } from "./A-Context.types";
|
|
29
39
|
import { A_TypeGuards } from "@adaas/a-concept/helpers/A_TypeGuards.helper";
|
|
30
|
-
import { A_ContextError } from "./A-Context.error";
|
|
31
|
-
import { A_TYPES__Container_Constructor } from "../A-Container/A-Container.types";
|
|
32
|
-
import { A_TYPES__Entity_Constructor } from "../A-Entity/A-Entity.types";
|
|
33
|
-
import { A_TYPES__Component_Constructor } from "../A-Component/A-Component.types";
|
|
34
40
|
import { A_FormatterHelper } from "@adaas/a-concept/helpers/A_Formatter.helper";
|
|
35
|
-
import { A_Fragment } from "../A-Fragment/A-Fragment.class";
|
|
36
|
-
import { A_TYPES__InjectableTargets } from "../A-Inject/A-Inject.types";
|
|
37
|
-
import { A_TYPES__ConceptAbstractions } from "../A-Concept/A-Concept.constants";
|
|
38
41
|
import { A_CommonHelper } from "@adaas/a-concept/helpers/A_Common.helper";
|
|
39
|
-
import {
|
|
40
|
-
import {
|
|
41
|
-
|
|
42
|
+
import { A_ContextError } from "./A-Context.error";
|
|
43
|
+
import {
|
|
44
|
+
A_Fragment,
|
|
45
|
+
A_TYPES__Fragment_Constructor
|
|
46
|
+
} from "@adaas/a-concept/a-fragment";
|
|
47
|
+
import { A_TYPES__ConceptAbstractions } from "@adaas/a-concept/a-concept";
|
|
48
|
+
import { A_Dependency } from "@adaas/a-concept/a-dependency";
|
|
49
|
+
import { A_TYPES__Ctor } from "@adaas/a-concept/types";
|
|
42
50
|
import { A_CONCEPT_ENV } from "@adaas/a-concept/env";
|
|
43
51
|
|
|
44
52
|
|
|
@@ -344,11 +352,11 @@ export class A_Context {
|
|
|
344
352
|
*/
|
|
345
353
|
container: A_TYPES__Container_Constructor,
|
|
346
354
|
): T
|
|
347
|
-
static meta<T extends A_ContainerMeta>(
|
|
355
|
+
static meta<T extends A_ContainerMeta, S extends A_Container>(
|
|
348
356
|
/**
|
|
349
357
|
* Get meta for the specific container instance.
|
|
350
358
|
*/
|
|
351
|
-
container:
|
|
359
|
+
container: S,
|
|
352
360
|
): T
|
|
353
361
|
static meta<T extends A_EntityMeta>(
|
|
354
362
|
/**
|
|
@@ -368,11 +376,11 @@ export class A_Context {
|
|
|
368
376
|
*/
|
|
369
377
|
component: A_TYPES__Component_Constructor,
|
|
370
378
|
): T
|
|
371
|
-
static meta<T extends A_ComponentMeta>(
|
|
379
|
+
static meta<T extends A_ComponentMeta, S extends A_Component>(
|
|
372
380
|
/**
|
|
373
381
|
* Get meta for the specific component instance.
|
|
374
382
|
*/
|
|
375
|
-
component:
|
|
383
|
+
component: S,
|
|
376
384
|
): T
|
|
377
385
|
static meta<T extends A_Meta>(
|
|
378
386
|
/**
|
|
@@ -676,17 +684,7 @@ export class A_Context {
|
|
|
676
684
|
throw new A_ContextError(A_ContextError.InvalidScopeParameterError, `Invalid parameter provided to get scope. Component of type ${name} is not allowed for scope allocation.`);
|
|
677
685
|
|
|
678
686
|
switch (true) {
|
|
679
|
-
case this.isAllowedForScopeAllocation(param1):
|
|
680
687
|
|
|
681
|
-
// Check if the parameter has a scope allocated
|
|
682
|
-
if (!instance._registry.has(param1))
|
|
683
|
-
throw new A_ContextError(
|
|
684
|
-
A_ContextError.ScopeNotFoundError,
|
|
685
|
-
`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.`
|
|
686
|
-
);
|
|
687
|
-
|
|
688
|
-
// If the parameter is allowed for scope allocation, return the scope
|
|
689
|
-
return instance._registry.get(param1)!;
|
|
690
688
|
|
|
691
689
|
case this.isAllowedToBeRegistered(param1):
|
|
692
690
|
|
|
@@ -699,6 +697,18 @@ export class A_Context {
|
|
|
699
697
|
|
|
700
698
|
// If the parameter is allowed to be registered, return the scope from the storage
|
|
701
699
|
return instance._scopeStorage.get(param1)!;
|
|
700
|
+
|
|
701
|
+
case this.isAllowedForScopeAllocation(param1):
|
|
702
|
+
|
|
703
|
+
// Check if the parameter has a scope allocated
|
|
704
|
+
if (!instance._registry.has(param1))
|
|
705
|
+
throw new A_ContextError(
|
|
706
|
+
A_ContextError.ScopeNotFoundError,
|
|
707
|
+
`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.`
|
|
708
|
+
);
|
|
709
|
+
|
|
710
|
+
// If the parameter is allowed for scope allocation, return the scope
|
|
711
|
+
return instance._registry.get(param1)!;
|
|
702
712
|
default:
|
|
703
713
|
throw new A_ContextError(A_ContextError.InvalidScopeParameterError, `Invalid parameter provided to get scope. Component of type ${name} is not allowed to be registered.`);
|
|
704
714
|
}
|
|
@@ -1068,7 +1078,8 @@ export class A_Context {
|
|
|
1068
1078
|
*/
|
|
1069
1079
|
static isAllowedForScopeAllocation(param: any): param is A_TYPES__ScopeLinkedComponents {
|
|
1070
1080
|
return A_TypeGuards.isContainerInstance(param)
|
|
1071
|
-
|| A_TypeGuards.isFeatureInstance(param)
|
|
1081
|
+
|| A_TypeGuards.isFeatureInstance(param)
|
|
1082
|
+
|| A_TypeGuards.isEntityInstance(param);
|
|
1072
1083
|
}
|
|
1073
1084
|
/**
|
|
1074
1085
|
* Type guard to check if the param is allowed to be registered in the context.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { A_ComponentMeta } from "@adaas/a-concept/a-component";
|
|
2
|
+
import { A_ContainerMeta } from "@adaas/a-concept/a-container";
|
|
3
|
+
import { A_EntityMeta } from "@adaas/a-concept/a-entity";
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
export type A_TYPES__ContextEnvironment = 'server' | 'browser' | 'mobile' | 'desktop' | 'embedded' | 'unknown';
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
export type A_TYPES__FeatureExtendableMeta = A_ContainerMeta
|
|
13
|
+
| A_ComponentMeta
|
|
14
|
+
| A_EntityMeta
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
|
|
2
|
-
import { A_Context } from "@adaas/a-concept/
|
|
3
|
-
import { A_Meta } from "@adaas/a-concept/
|
|
4
|
-
import { A_TYPES__ComponentMetaKey } from "@adaas/a-concept/
|
|
5
|
-
import { A_TYPES__ContainerMetaKey } from "@adaas/a-concept/
|
|
6
|
-
import { A_TypeGuards } from "@adaas/a-concept/helpers/A_TypeGuards.helper";
|
|
7
|
-
import { A_TYPES__A_InjectDecorator_Meta, A_TYPES__InjectableTargets } from "../A-Inject/A-Inject.types";
|
|
2
|
+
import { A_Context } from "@adaas/a-concept/a-context";
|
|
3
|
+
import { A_Meta } from "@adaas/a-concept/a-meta";
|
|
4
|
+
import { A_TYPES__ComponentMetaKey } from "@adaas/a-concept/a-component";
|
|
5
|
+
import { A_TYPES__ContainerMetaKey } from "@adaas/a-concept/a-container";
|
|
8
6
|
import { A_TYPES__A_Dependency_AllDecoratorReturn } from "./A-Dependency.types";
|
|
9
7
|
import { A_DependencyError } from "./A-Dependency.error";
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
8
|
+
import { A_TYPES__EntityMetaKey } from "@adaas/a-concept/a-entity";
|
|
9
|
+
import {
|
|
10
|
+
A_TYPES__A_InjectDecorator_Meta,
|
|
11
|
+
A_TYPES__InjectableTargets
|
|
12
|
+
} from "@adaas/a-concept/a-inject";
|
|
13
|
+
import { A_TypeGuards} from "@adaas/a-concept/helpers/A_TypeGuards.helper";
|
|
14
|
+
import { A_CommonHelper} from "@adaas/a-concept/helpers/A_Common.helper";
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
17
|
* Should indicate which All is required
|
|
@@ -1,14 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { A_TYPES__ContainerMetaKey } from "@adaas/a-concept/global/A-Container/A-Container.constants";
|
|
6
|
-
import { A_TypeGuards } from "@adaas/a-concept/helpers/A_TypeGuards.helper";
|
|
7
|
-
import { A_TYPES__A_InjectDecorator_Meta, A_TYPES__InjectableTargets } from "../A-Inject/A-Inject.types";
|
|
1
|
+
import { A_Context } from "@adaas/a-concept/a-context";
|
|
2
|
+
import { A_Meta } from "@adaas/a-concept/a-meta";
|
|
3
|
+
import { A_TYPES__ComponentMetaKey } from "@adaas/a-concept/a-component";
|
|
4
|
+
import { A_TYPES__ContainerMetaKey } from "@adaas/a-concept/a-container";
|
|
8
5
|
import { A_TYPES__A_Dependency_DefaultDecoratorReturn } from "./A-Dependency.types";
|
|
9
6
|
import { A_DependencyError } from "./A-Dependency.error";
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
7
|
+
import { A_TYPES__EntityMetaKey } from "@adaas/a-concept/a-entity";
|
|
8
|
+
import {
|
|
9
|
+
A_TYPES__A_InjectDecorator_Meta,
|
|
10
|
+
A_TYPES__InjectableTargets
|
|
11
|
+
} from "@adaas/a-concept/a-inject";
|
|
12
|
+
import { A_TypeGuards} from "@adaas/a-concept/helpers/A_TypeGuards.helper";
|
|
13
|
+
import { A_CommonHelper} from "@adaas/a-concept/helpers/A_Common.helper";
|
|
12
14
|
|
|
13
15
|
|
|
14
16
|
/**
|
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
|
|
2
|
-
import { A_Context } from "@adaas/a-concept/
|
|
3
|
-
import { A_Meta } from "@adaas/a-concept/
|
|
4
|
-
import { A_TYPES__ComponentMetaKey } from "@adaas/a-concept/
|
|
5
|
-
import { A_TYPES__ContainerMetaKey } from "@adaas/a-concept/
|
|
6
|
-
import { A_TypeGuards } from "@adaas/a-concept/helpers/A_TypeGuards.helper";
|
|
7
|
-
import { A_TYPES__A_InjectDecorator_Meta, A_TYPES__InjectableTargets } from "../A-Inject/A-Inject.types";
|
|
2
|
+
import { A_Context } from "@adaas/a-concept/a-context";
|
|
3
|
+
import { A_Meta } from "@adaas/a-concept/a-meta";
|
|
4
|
+
import { A_TYPES__ComponentMetaKey } from "@adaas/a-concept/a-component";
|
|
5
|
+
import { A_TYPES__ContainerMetaKey } from "@adaas/a-concept/a-container";
|
|
8
6
|
import { A_TYPES__A_Dependency_FlatDecoratorReturn } from "./A-Dependency.types";
|
|
9
7
|
import { A_DependencyError } from "./A-Dependency.error";
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
8
|
+
import { A_TYPES__EntityMetaKey } from "@adaas/a-concept/a-entity";
|
|
9
|
+
import {
|
|
10
|
+
A_TYPES__A_InjectDecorator_Meta,
|
|
11
|
+
A_TYPES__InjectableTargets
|
|
12
|
+
} from "@adaas/a-concept/a-inject";
|
|
13
|
+
import { A_TypeGuards} from "@adaas/a-concept/helpers/A_TypeGuards.helper";
|
|
14
|
+
import { A_CommonHelper} from "@adaas/a-concept/helpers/A_Common.helper";
|
|
12
15
|
|
|
13
16
|
|
|
14
17
|
/**
|
|
@@ -1,14 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { A_TYPES__ContainerMetaKey } from "@adaas/a-concept/global/A-Container/A-Container.constants";
|
|
6
|
-
import { A_TypeGuards } from "@adaas/a-concept/helpers/A_TypeGuards.helper";
|
|
7
|
-
import { A_TYPES__A_InjectDecorator_Meta, A_TYPES__InjectableTargets } from "../A-Inject/A-Inject.types";
|
|
1
|
+
import { A_Context } from "@adaas/a-concept/a-context";
|
|
2
|
+
import { A_Meta } from "@adaas/a-concept/a-meta";
|
|
3
|
+
import { A_TYPES__ComponentMetaKey } from "@adaas/a-concept/a-component";
|
|
4
|
+
import { A_TYPES__ContainerMetaKey } from "@adaas/a-concept/a-container";
|
|
8
5
|
import { A_TYPES__A_Dependency_LoadDecoratorReturn } from "./A-Dependency.types";
|
|
9
6
|
import { A_DependencyError } from "./A-Dependency.error";
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
7
|
+
import { A_TYPES__EntityMetaKey } from "@adaas/a-concept/a-entity";
|
|
8
|
+
import {
|
|
9
|
+
A_TYPES__A_InjectDecorator_Meta,
|
|
10
|
+
A_TYPES__InjectableTargets
|
|
11
|
+
} from "@adaas/a-concept/a-inject";
|
|
12
|
+
import { A_TypeGuards} from "@adaas/a-concept/helpers/A_TypeGuards.helper";
|
|
13
|
+
import { A_CommonHelper} from "@adaas/a-concept/helpers/A_Common.helper";
|
|
12
14
|
|
|
13
15
|
|
|
14
16
|
/**
|
|
@@ -1,14 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { A_TYPES__ContainerMetaKey } from "@adaas/a-concept/global/A-Container/A-Container.constants";
|
|
6
|
-
import { A_TypeGuards } from "@adaas/a-concept/helpers/A_TypeGuards.helper";
|
|
7
|
-
import { A_TYPES__A_InjectDecorator_Meta, A_TYPES__InjectableTargets } from "../A-Inject/A-Inject.types";
|
|
1
|
+
import { A_Context } from "@adaas/a-concept/a-context";
|
|
2
|
+
import { A_Meta } from "@adaas/a-concept/a-meta";
|
|
3
|
+
import { A_TYPES__ComponentMetaKey } from "@adaas/a-concept/a-component";
|
|
4
|
+
import { A_TYPES__ContainerMetaKey } from "@adaas/a-concept/a-container";
|
|
8
5
|
import { A_TYPES__A_Dependency_ParentDecoratorReturn } from "./A-Dependency.types";
|
|
9
6
|
import { A_DependencyError } from "./A-Dependency.error";
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
7
|
+
import { A_TYPES__EntityMetaKey } from "@adaas/a-concept/a-entity";
|
|
8
|
+
import {
|
|
9
|
+
A_TYPES__A_InjectDecorator_Meta,
|
|
10
|
+
A_TYPES__InjectableTargets
|
|
11
|
+
} from "@adaas/a-concept/a-inject";
|
|
12
|
+
import { A_TypeGuards} from "@adaas/a-concept/helpers/A_TypeGuards.helper";
|
|
13
|
+
import { A_CommonHelper} from "@adaas/a-concept/helpers/A_Common.helper";
|
|
12
14
|
|
|
13
15
|
|
|
14
16
|
/**
|