@adaas/a-concept 0.0.4 → 0.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/examples/simple/components/A.component.d.ts +4 -2
- package/dist/examples/simple/components/A.component.js +7 -4
- package/dist/examples/simple/components/A.component.js.map +1 -1
- package/dist/examples/simple/components/B.component.d.ts +6 -2
- package/dist/examples/simple/components/B.component.js +18 -7
- package/dist/examples/simple/components/B.component.js.map +1 -1
- package/dist/examples/simple/concept.js +59 -32
- package/dist/examples/simple/concept.js.map +1 -1
- package/dist/examples/simple/containers/Main.container.d.ts +2 -3
- package/dist/examples/simple/containers/Main.container.js +28 -8
- package/dist/examples/simple/containers/Main.container.js.map +1 -1
- package/dist/examples/simple-http-server/components/http-error-handler.component.d.ts +2 -1
- package/dist/examples/simple-http-server/components/http-error-handler.component.js +3 -1
- package/dist/examples/simple-http-server/components/http-error-handler.component.js.map +1 -1
- package/dist/examples/simple-http-server/components/http-request-handler.component.d.ts +2 -1
- package/dist/examples/simple-http-server/components/http-request-handler.component.js +2 -1
- package/dist/examples/simple-http-server/components/http-request-handler.component.js.map +1 -1
- package/dist/examples/simple-http-server/containers/http-server.container.d.ts +1 -2
- package/dist/index.d.ts +7 -1
- package/dist/index.js +13 -2
- package/dist/index.js.map +1 -1
- package/dist/src/base/A-Config/A-Config.container.d.ts +1 -3
- package/dist/src/base/A-Config/A-Config.container.js +6 -22
- package/dist/src/base/A-Config/A-Config.container.js.map +1 -1
- package/dist/src/base/A-Config/A-Config.context.d.ts +1 -0
- package/dist/src/base/A-Config/A-Config.context.js +20 -2
- package/dist/src/base/A-Config/A-Config.context.js.map +1 -1
- package/dist/src/base/A-Config/A-Config.types.d.ts +4 -2
- package/dist/src/base/A-Config/A-Config.types.js +4 -0
- package/dist/src/base/A-Config/A-Config.types.js.map +1 -1
- package/dist/src/base/A-Config/components/ConfigReader.component.d.ts +2 -1
- package/dist/src/base/A-Config/components/ConfigReader.component.js +3 -1
- package/dist/src/base/A-Config/components/ConfigReader.component.js.map +1 -1
- package/dist/src/base/A-Errors/A-Errors.component.d.ts +2 -1
- package/dist/src/base/A-Errors/A-Errors.component.js +3 -1
- package/dist/src/base/A-Errors/A-Errors.component.js.map +1 -1
- package/dist/src/base/A-Logger/A-Logger.component.d.ts +4 -2
- package/dist/src/base/A-Logger/A-Logger.component.js +11 -3
- package/dist/src/base/A-Logger/A-Logger.component.js.map +1 -1
- package/dist/src/decorators/A-Feature/A-Feature-Define.decorator.js.map +1 -1
- package/dist/src/decorators/A-Feature/A-Feature-Extend.decorator.js +9 -9
- package/dist/src/decorators/A-Feature/A-Feature-Extend.decorator.js.map +1 -1
- package/dist/src/decorators/A-Inject/A-Inject.decorator.d.ts +0 -2
- package/dist/src/decorators/A-Inject/A-Inject.decorator.js +4 -2
- package/dist/src/decorators/A-Inject/A-Inject.decorator.js.map +1 -1
- package/dist/src/global/A-Component/A-Component.class.d.ts +28 -1
- package/dist/src/global/A-Component/A-Component.class.js +22 -0
- package/dist/src/global/A-Component/A-Component.class.js.map +1 -1
- package/dist/src/global/A-Component/A-Component.meta.d.ts +8 -1
- package/dist/src/global/A-Component/A-Component.meta.js +26 -0
- package/dist/src/global/A-Component/A-Component.meta.js.map +1 -1
- package/dist/src/global/A-Component/A-Component.types.d.ts +43 -6
- package/dist/src/global/A-Component/A-Component.types.js +5 -0
- package/dist/src/global/A-Component/A-Component.types.js.map +1 -1
- package/dist/src/global/A-Concept/A_Concept.class.d.ts +7 -7
- package/dist/src/global/A-Concept/A_Concept.class.js +1 -2
- package/dist/src/global/A-Concept/A_Concept.class.js.map +1 -1
- package/dist/src/global/A-Container/A-Container.class.d.ts +5 -4
- package/dist/src/global/A-Container/A-Container.class.js +13 -24
- package/dist/src/global/A-Container/A-Container.class.js.map +1 -1
- package/dist/src/global/A-Container/A-Container.meta.d.ts +0 -3
- package/dist/src/global/A-Container/A-Container.meta.js +0 -46
- package/dist/src/global/A-Container/A-Container.meta.js.map +1 -1
- package/dist/src/global/A-Context/A-Context.class.d.ts +35 -5
- package/dist/src/global/A-Context/A-Context.class.js +138 -54
- package/dist/src/global/A-Context/A-Context.class.js.map +1 -1
- package/dist/src/global/A-Context/A-Context.types.d.ts +0 -12
- package/dist/src/global/A-Context/A-Context.types.js +0 -1
- package/dist/src/global/A-Dependency/A-DependencyReference.class.d.ts +0 -17
- package/dist/src/global/A-Dependency/A-DependencyReference.class.js +47 -65
- package/dist/src/global/A-Dependency/A-DependencyReference.class.js.map +1 -1
- package/dist/src/global/A-Entity/A-Entity.class.d.ts +73 -2
- package/dist/src/global/A-Entity/A-Entity.class.js +107 -1
- package/dist/src/global/A-Entity/A-Entity.class.js.map +1 -1
- package/dist/src/global/A-Entity/A-Entity.meta.d.ts +4 -0
- package/dist/src/global/A-Entity/A-Entity.meta.js +8 -0
- package/dist/src/global/A-Entity/A-Entity.meta.js.map +1 -0
- package/dist/src/global/A-Entity/A-Entity.types.d.ts +56 -0
- package/dist/src/global/A-Entity/A-Entity.types.js +15 -0
- package/dist/src/global/A-Entity/A-Entity.types.js.map +1 -1
- package/dist/src/global/A-Feature/A-Feature.class.d.ts +11 -1
- package/dist/src/global/A-Feature/A-Feature.class.js +48 -12
- package/dist/src/global/A-Feature/A-Feature.class.js.map +1 -1
- package/dist/src/global/A-Feature/A-Feature.types.d.ts +5 -4
- package/dist/src/global/A-Feature/A-Feature.types.js.map +1 -1
- package/dist/src/global/A-Fragment/A-Fragment.class.js +1 -2
- package/dist/src/global/A-Fragment/A-Fragment.class.js.map +1 -1
- package/dist/src/global/A-Meta/A-Meta.class.d.ts +80 -1
- package/dist/src/global/A-Meta/A-Meta.class.js +121 -5
- package/dist/src/global/A-Meta/A-Meta.class.js.map +1 -1
- package/dist/src/global/A-Scope/A-Scope.class.d.ts +15 -6
- package/dist/src/global/A-Scope/A-Scope.class.js +61 -17
- package/dist/src/global/A-Scope/A-Scope.class.js.map +1 -1
- package/examples/simple/components/A.component.ts +6 -3
- package/examples/simple/components/B.component.ts +19 -6
- package/examples/simple/concept.ts +65 -33
- package/examples/simple/containers/Main.container.ts +36 -9
- package/examples/simple-http-server/components/http-error-handler.component.ts +5 -2
- package/examples/simple-http-server/components/http-request-handler.component.ts +3 -1
- package/index.ts +9 -1
- package/jest.config.ts +0 -4
- package/package.json +1 -1
- package/src/base/A-Config/A-Config.container.ts +5 -8
- package/src/base/A-Config/A-Config.context.ts +10 -2
- package/src/base/A-Config/A-Config.types.ts +8 -3
- package/src/base/A-Config/components/ConfigReader.component.ts +5 -2
- package/src/base/A-Errors/A-Errors.component.ts +3 -2
- package/src/base/A-Logger/A-Logger.component.ts +21 -3
- package/src/decorators/A-Feature/A-Feature-Define.decorator.ts +0 -1
- package/src/decorators/A-Feature/A-Feature-Extend.decorator.ts +15 -10
- package/src/decorators/A-Inject/A-Inject.decorator.ts +13 -12
- package/src/global/A-Component/A-Component.class.ts +56 -1
- package/src/global/A-Component/A-Component.meta.ts +40 -1
- package/src/global/A-Component/A-Component.types.ts +51 -19
- package/src/global/A-Concept/A_Concept.class.ts +2 -2
- package/src/global/A-Container/A-Container.class.ts +22 -39
- package/src/global/A-Container/A-Container.meta.ts +0 -64
- package/src/global/A-Context/A-Context.class.ts +240 -80
- package/src/global/A-Context/A-Context.types.ts +0 -15
- package/src/global/A-Dependency/A-DependencyReference.class.ts +61 -61
- package/src/global/A-Entity/A-Entity.class.ts +184 -2
- package/src/global/A-Entity/A-Entity.meta.ts +9 -0
- package/src/global/A-Entity/A-Entity.types.ts +75 -0
- package/src/global/A-Feature/A-Feature.class.ts +62 -20
- package/src/global/A-Feature/A-Feature.types.ts +8 -2
- package/src/global/A-Fragment/A-Fragment.class.ts +1 -5
- package/src/global/A-Meta/A-Meta.class.ts +140 -12
- package/src/global/A-Scope/A-Scope.class.ts +101 -31
- package/tsconfig.json +0 -4
- package/src/storage/A_Component.storage.ts +0 -28
- package/src/storage/A_Concept.storage.ts +0 -49
- package/src/storage/A_Container.storage.ts +0 -21
- package/src/storage/A_Inject.storage.ts +0 -30
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"A_Concept.class.js","sourceRoot":"","sources":["../../../../src/global/A-Concept/A_Concept.class.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,uDAAqH;AACrH,kEAAyD;
|
|
1
|
+
{"version":3,"file":"A_Concept.class.js","sourceRoot":"","sources":["../../../../src/global/A-Concept/A_Concept.class.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,uDAAqH;AACrH,kEAAyD;AAIzD,wEAA6E;AAC7E,6FAAgF;AAKhF,wFAAwF;AAIxF;;;;;;;;;;;GAWG;AACH,MAAa,SAAS;IAIlB,iFAAiF;IACjF,iFAAiF;IACjF,iFAAiF;IACjF;;OAEG;IACH,MAAM,KAAK,IAAI;QACX,OAAO,IAAA,2BAAO,EAAC,uCAAqB,CAAC,IAAI,CAAC,CAAC;IAC/C,CAAC;IAED;;;;OAIG;IACH,MAAM,KAAK,OAAO;QACd,OAAO,IAAA,2BAAO,EAAC,uCAAqB,CAAC,OAAO,CAAC,CAAC;IAClD,CAAC;IAED;;OAEG;IACH,MAAM,KAAK,MAAM;QACb,OAAO,IAAA,2BAAO,EAAC,uCAAqB,CAAC,MAAM,CAAC,CAAC;IACjD,CAAC;IAED;;;;;OAKG;IACH,MAAM,KAAK,KAAK;QACZ,OAAO,IAAA,2BAAO,EAAC,uCAAqB,CAAC,KAAK,CAAC,CAAC;IAChD,CAAC;IAED;;OAEG;IACH,MAAM,KAAK,GAAG;QACV,OAAO,IAAA,2BAAO,EAAC,uCAAqB,CAAC,GAAG,CAAC,CAAC;IAC9C,CAAC;IAED;;OAEG;IACH,MAAM,KAAK,KAAK;QACZ,OAAO,IAAA,2BAAO,EAAC,uCAAqB,CAAC,KAAK,CAAC,CAAC;IAChD,CAAC;IAED;;OAEG;IACH,MAAM,KAAK,IAAI;QACX,OAAO,IAAA,2BAAO,EAAC,uCAAqB,CAAC,IAAI,CAAC,CAAC;IAC/C,CA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} from "@adaas/a-utils";
|
|
3
|
-
import {
|
|
3
|
+
import { A_Scope } from "../A-Scope/A-Scope.class";
|
|
4
4
|
/**
|
|
5
5
|
* This class should combine Components to achieve the goal withing Concept
|
|
6
6
|
*
|
|
@@ -20,6 +20,7 @@ export declare class A_Container<_FeatureNames extends Array<string>> {
|
|
|
20
20
|
ready: Promise<void>;
|
|
21
21
|
get exports(): _FeatureNames;
|
|
22
22
|
get name(): string;
|
|
23
|
+
get Scope(): A_Scope;
|
|
23
24
|
constructor(
|
|
24
25
|
/**
|
|
25
26
|
* Configuration of the container that will be used to run it.
|
|
@@ -42,12 +43,12 @@ export declare class A_Container<_FeatureNames extends Array<string>> {
|
|
|
42
43
|
/**
|
|
43
44
|
* A-Feature method name to be called
|
|
44
45
|
*/
|
|
45
|
-
feature: _FeatureNames[number]):
|
|
46
|
+
feature: _FeatureNames[number]): Promise<any>;
|
|
46
47
|
call(
|
|
47
48
|
/**
|
|
48
49
|
* A-Feature name to be called
|
|
49
50
|
*/
|
|
50
|
-
params: A_TYPES__Required<Partial<A_TYPES__ContainerCallParams<_FeatureNames[number]>>, ['name']>):
|
|
51
|
+
params: A_TYPES__Required<Partial<A_TYPES__ContainerCallParams<_FeatureNames[number]>>, ['name']>): Promise<any>;
|
|
51
52
|
call(
|
|
52
53
|
/**
|
|
53
54
|
* A-Feature method name to be called
|
|
@@ -56,7 +57,7 @@ export declare class A_Container<_FeatureNames extends Array<string>> {
|
|
|
56
57
|
/**
|
|
57
58
|
* Parameters to provide additional data to the feature
|
|
58
59
|
*/
|
|
59
|
-
params: Partial<A_TYPES__ContainerCallParams<_FeatureNames[number]>>):
|
|
60
|
+
params: Partial<A_TYPES__ContainerCallParams<_FeatureNames[number]>>): Promise<any>;
|
|
60
61
|
/**
|
|
61
62
|
* Before init hook to be used in inherited classes
|
|
62
63
|
*
|
|
@@ -10,7 +10,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.A_Container = void 0;
|
|
13
|
-
const A_Feature_class_1 = require("../A-Feature/A-Feature.class");
|
|
14
13
|
const A_Context_class_1 = require("../A-Context/A-Context.class");
|
|
15
14
|
/**
|
|
16
15
|
* This class should combine Components to achieve the goal withing Concept
|
|
@@ -30,6 +29,9 @@ class A_Container {
|
|
|
30
29
|
get name() {
|
|
31
30
|
return this.config.name || this.constructor.name;
|
|
32
31
|
}
|
|
32
|
+
get Scope() {
|
|
33
|
+
return A_Context_class_1.A_Context.scope(this);
|
|
34
|
+
}
|
|
33
35
|
constructor(
|
|
34
36
|
/**
|
|
35
37
|
* Configuration of the container that will be used to run it.
|
|
@@ -38,10 +40,7 @@ class A_Container {
|
|
|
38
40
|
this.config = config;
|
|
39
41
|
const components = config.components || [];
|
|
40
42
|
const fragments = config.fragments || [];
|
|
41
|
-
A_Context_class_1.A_Context.allocate(this,
|
|
42
|
-
components,
|
|
43
|
-
fragments
|
|
44
|
-
});
|
|
43
|
+
A_Context_class_1.A_Context.allocate(this, config);
|
|
45
44
|
/**
|
|
46
45
|
* Run Async Initialization
|
|
47
46
|
*/
|
|
@@ -74,26 +73,16 @@ class A_Container {
|
|
|
74
73
|
});
|
|
75
74
|
}
|
|
76
75
|
call(param1, param2) {
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
params =
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
}
|
|
87
|
-
const meta = A_Context_class_1.A_Context.meta(this);
|
|
88
|
-
const steps = meta.feature(this, feature);
|
|
89
|
-
const newFeature = new A_Feature_class_1.A_Feature({
|
|
90
|
-
name: `${this.constructor.name}.${feature}`,
|
|
91
|
-
fragments: (param2 === null || param2 === void 0 ? void 0 : param2.fragments) || [],
|
|
92
|
-
components: (param2 === null || param2 === void 0 ? void 0 : param2.components) || [],
|
|
93
|
-
steps,
|
|
94
|
-
parent: A_Context_class_1.A_Context.scope(this)
|
|
76
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
77
|
+
const feature = typeof param1 === 'string'
|
|
78
|
+
? param1
|
|
79
|
+
: param1.name;
|
|
80
|
+
const params = typeof param1 === 'string'
|
|
81
|
+
? param2 || {}
|
|
82
|
+
: param1;
|
|
83
|
+
const newFeature = A_Context_class_1.A_Context.feature(this, feature, params);
|
|
84
|
+
return yield newFeature.process();
|
|
95
85
|
});
|
|
96
|
-
return newFeature;
|
|
97
86
|
}
|
|
98
87
|
// ==============================================================
|
|
99
88
|
// ======================= HOOKS ================================
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"A-Container.class.js","sourceRoot":"","sources":["../../../../src/global/A-Container/A-Container.class.ts"],"names":[],"mappings":";;;;;;;;;;;;AAGA,kEAAyD;
|
|
1
|
+
{"version":3,"file":"A-Container.class.js","sourceRoot":"","sources":["../../../../src/global/A-Container/A-Container.class.ts"],"names":[],"mappings":";;;;;;;;;;;;AAGA,kEAAyD;AAKzD;;;;;;;;;;GAUG;AACH,MAAa,WAAW;IAYpB,IAAI,OAAO;QACP,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,IAAI,EAAS,CAAC;IAC5C,CAAC;IAED,IAAI,IAAI;QACJ,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,IAAI,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC;IACrD,CAAC;IAED,IAAI,KAAK;QACL,OAAO,2BAAS,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IACjC,CAAC;IAGD;IACI;;OAEG;IACH,MAA6D;QAE7D,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QAErB,MAAM,UAAU,GAAG,MAAM,CAAC,UAAU,IAAI,EAAE,CAAC;QAC3C,MAAM,SAAS,GAAG,MAAM,CAAC,SAAS,IAAI,EAAE,CAAC;QAEzC,2BAAS,CAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;Q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CAAC;KAAA;IAED;;OAEG;IACa,MAAM;;YAClB,OAAO;QACX,CAAC;KAAA;IAED;;;;OAIG;IACa,WAAW;;YACvB,OAAO;QACX,CAAC;KAAA;CAEJ;AA7JD,kCA6JC"}
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
import { A_TYPES__FeatureStep } from "../A-Feature/A-Feature.types";
|
|
2
1
|
import { A_Meta } from "../A-Meta/A-Meta.class";
|
|
3
|
-
import { A_Container } from "./A-Container.class";
|
|
4
2
|
import { A_TYPES__ContainerMeta } from "./A-Container.types";
|
|
5
3
|
export declare class A_ContainerMeta extends A_Meta<A_TYPES__ContainerMeta> {
|
|
6
|
-
feature<T extends string>(container: A_Container<any>, name: T): A_TYPES__FeatureStep[];
|
|
7
4
|
}
|
|
@@ -1,54 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.A_ContainerMeta = void 0;
|
|
4
|
-
const A_Component_types_1 = require("../A-Component/A-Component.types");
|
|
5
|
-
const A_Context_class_1 = require("../A-Context/A-Context.class");
|
|
6
4
|
const A_Meta_class_1 = require("../A-Meta/A-Meta.class");
|
|
7
|
-
const A_Container_types_1 = require("./A-Container.types");
|
|
8
5
|
class A_ContainerMeta extends A_Meta_class_1.A_Meta {
|
|
9
|
-
feature(container, name) {
|
|
10
|
-
const scope = A_Context_class_1.A_Context.scope(container);
|
|
11
|
-
// First lets validate that there'are registered method with the same name
|
|
12
|
-
const featureMeta = this.get(A_Container_types_1.A_TYPES__ContainerMetaKey.FEATURES);
|
|
13
|
-
if (!featureMeta) {
|
|
14
|
-
throw new Error(`Container ${container.constructor.name} has no metadata defined`);
|
|
15
|
-
}
|
|
16
|
-
const instruction = featureMeta.get(name);
|
|
17
|
-
if (!instruction)
|
|
18
|
-
throw new Error(`Method ${name} is not defined in ${this.constructor.name}`);
|
|
19
|
-
// const scope = new A_Scope({
|
|
20
|
-
// name: `${this.constructor.name}.${feature}`,
|
|
21
|
-
// fragments: param2?.fragments || [],
|
|
22
|
-
// components: param2?.components || []
|
|
23
|
-
// }, {
|
|
24
|
-
// parent: this.scope
|
|
25
|
-
// });
|
|
26
|
-
// Now we need to resolve the method from all registered components
|
|
27
|
-
return scope
|
|
28
|
-
.components
|
|
29
|
-
.reduce((acc, component) => {
|
|
30
|
-
const componentMeta = A_Context_class_1.A_Context.meta(component);
|
|
31
|
-
const extensions = componentMeta.get(A_Component_types_1.A_TYPES__ComponentMetaKey.EXTENSIONS) || [];
|
|
32
|
-
const injections = componentMeta.get(A_Component_types_1.A_TYPES__ComponentMetaKey.INJECTIONS);
|
|
33
|
-
const out = [];
|
|
34
|
-
extensions.forEach((extension, handler) => {
|
|
35
|
-
if (extension.name === name
|
|
36
|
-
&&
|
|
37
|
-
(extension.container === container.constructor.name || extension.container === '*')) {
|
|
38
|
-
const args = (injections === null || injections === void 0 ? void 0 : injections.get(handler)) || [];
|
|
39
|
-
out.push({
|
|
40
|
-
component,
|
|
41
|
-
handler,
|
|
42
|
-
args
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
|
-
});
|
|
46
|
-
return [
|
|
47
|
-
...acc,
|
|
48
|
-
...out
|
|
49
|
-
];
|
|
50
|
-
}, []);
|
|
51
|
-
}
|
|
52
6
|
}
|
|
53
7
|
exports.A_ContainerMeta = A_ContainerMeta;
|
|
54
8
|
//# sourceMappingURL=A-Container.meta.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"A-Container.meta.js","sourceRoot":"","sources":["../../../../src/global/A-Container/A-Container.meta.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"A-Container.meta.js","sourceRoot":"","sources":["../../../../src/global/A-Container/A-Container.meta.ts"],"names":[],"mappings":";;;AAGA,yDAAgD;AAShD,MAAa,eAAgB,SAAQ,qBAA8B;CAGlE;AAHD,0CAGC"}
|
|
@@ -8,6 +8,9 @@ import { A_Meta } from "../A-Meta/A-Meta.class";
|
|
|
8
8
|
import { A_ComponentMeta } from "../A-Component/A-Component.meta";
|
|
9
9
|
import { A_ContainerMeta } from "../A-Container/A-Container.meta";
|
|
10
10
|
import { A_Concept } from "../A-Concept/A_Concept.class";
|
|
11
|
+
import { A_TYPES__EntityBaseMethod } from "../A-Entity/A-Entity.types";
|
|
12
|
+
import { A_Entity } from "../A-Entity/A-Entity.class";
|
|
13
|
+
import { A_EntityMeta } from "../A-Entity/A-Entity.meta";
|
|
11
14
|
/**
|
|
12
15
|
* Namespace Provider is responsible for providing the Namespace to the Containers and other Namespaces.
|
|
13
16
|
* This class stores all Namespaces across the Program.
|
|
@@ -29,12 +32,18 @@ export declare class A_Context {
|
|
|
29
32
|
* A set of globally registered concepts.
|
|
30
33
|
*/
|
|
31
34
|
protected concepts: WeakMap<A_Concept<any>, A_Scope>;
|
|
35
|
+
/**
|
|
36
|
+
* Uses to store the scope of every element in the program.
|
|
37
|
+
*/
|
|
38
|
+
protected registry: WeakMap<A_Concept<any> | A_Container<any> | A_Feature | A_Component | A_Fragment | A_Entity, A_Scope>;
|
|
32
39
|
/**
|
|
33
40
|
* A set of allocated scopes per every element in the program.
|
|
34
41
|
*/
|
|
35
42
|
protected conceptsMeta: Map<typeof A_Concept.constructor, A_Meta<any>>;
|
|
36
43
|
protected containersMeta: Map<typeof A_Container.constructor, A_ContainerMeta>;
|
|
37
|
-
protected componentsMeta: Map<typeof
|
|
44
|
+
protected componentsMeta: Map<typeof A_Component, A_ComponentMeta>;
|
|
45
|
+
protected entitiesMeta: Map<typeof A_Entity.constructor, A_EntityMeta>;
|
|
46
|
+
protected customMeta: Map<typeof A_Container.constructor, A_Meta<any>>;
|
|
38
47
|
/**
|
|
39
48
|
* Root Namespace is a Namespace that is used to run the program.
|
|
40
49
|
*/
|
|
@@ -53,18 +62,39 @@ export declare class A_Context {
|
|
|
53
62
|
static allocate(container: A_Container<any>, importing: Partial<A_TYPES__ScopeConstructor & A_TYPES__ScopeConfig>): A_Scope;
|
|
54
63
|
static meta(container: typeof A_Container): A_ContainerMeta;
|
|
55
64
|
static meta(container: A_Container<any>): A_ContainerMeta;
|
|
65
|
+
static meta(entity: A_Entity): A_ContainerMeta;
|
|
56
66
|
static meta(component: typeof A_Component): A_ComponentMeta;
|
|
57
67
|
static meta(component: A_Component): A_ComponentMeta;
|
|
58
68
|
static meta<T extends Record<string, any>>(component: {
|
|
59
69
|
new (...args: any[]): any;
|
|
60
70
|
}): A_Meta<T>;
|
|
71
|
+
static scope(entity: A_Entity): A_Scope;
|
|
72
|
+
static scope(component: A_Component): A_Scope;
|
|
61
73
|
static scope(concept: A_Concept): A_Scope;
|
|
62
|
-
static scope(
|
|
63
|
-
static scope(
|
|
74
|
+
static scope(container: A_Container<any>): A_Scope;
|
|
75
|
+
static scope(feature: A_Feature): A_Scope;
|
|
76
|
+
/**
|
|
77
|
+
* This method returns a component by its meta.
|
|
78
|
+
*
|
|
79
|
+
* @param meta
|
|
80
|
+
* @returns
|
|
81
|
+
*/
|
|
82
|
+
static component(meta: A_ComponentMeta): typeof A_Component;
|
|
83
|
+
/**
|
|
84
|
+
* This method returns a step-by-step instructions of feature implementation depending on the feature name and the class.
|
|
85
|
+
*
|
|
86
|
+
* @param scope
|
|
87
|
+
* @returns
|
|
88
|
+
*/
|
|
89
|
+
static feature<T extends Array<string>>(entity: A_Entity<any, any, T>, feature: A_TYPES__EntityBaseMethod | string | T[number] | RegExp, params?: Partial<A_TYPES__ScopeConstructor>): A_Feature;
|
|
90
|
+
static feature<T extends Array<string>>(container: A_Container<T>, feature: T[number], params?: Partial<A_TYPES__ScopeConstructor>): A_Feature;
|
|
91
|
+
static feature(component: A_Component, feature: string, params?: Partial<A_TYPES__ScopeConstructor>): A_Feature;
|
|
64
92
|
/**
|
|
65
93
|
* Register a Namespace in the provider.
|
|
66
94
|
* @param Namespace
|
|
67
95
|
*/
|
|
68
|
-
static register(
|
|
69
|
-
static register(
|
|
96
|
+
static register(scope: A_Scope, container: A_Container<any>): any;
|
|
97
|
+
static register(scope: A_Scope, entity: A_Entity): any;
|
|
98
|
+
static register(scope: A_Scope, component: A_Component): any;
|
|
99
|
+
static register(scope: A_Scope, fragment: A_Fragment): any;
|
|
70
100
|
}
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.A_Context = void 0;
|
|
4
4
|
const a_utils_1 = require("@adaas/a-utils");
|
|
5
5
|
const A_Component_class_1 = require("../A-Component/A-Component.class");
|
|
6
|
+
const A_Fragment_class_1 = require("../A-Fragment/A-Fragment.class");
|
|
6
7
|
const A_Feature_class_1 = require("../A-Feature/A-Feature.class");
|
|
7
8
|
const A_Container_class_1 = require("../A-Container/A-Container.class");
|
|
8
9
|
const A_Scope_class_1 = require("../A-Scope/A-Scope.class");
|
|
@@ -10,6 +11,8 @@ const A_Meta_class_1 = require("../A-Meta/A-Meta.class");
|
|
|
10
11
|
const A_Component_meta_1 = require("../A-Component/A-Component.meta");
|
|
11
12
|
const A_Container_meta_1 = require("../A-Container/A-Container.meta");
|
|
12
13
|
const A_Concept_class_1 = require("../A-Concept/A_Concept.class");
|
|
14
|
+
const A_Entity_class_1 = require("../A-Entity/A-Entity.class");
|
|
15
|
+
const A_Entity_meta_1 = require("../A-Entity/A-Entity.meta");
|
|
13
16
|
/**
|
|
14
17
|
* Namespace Provider is responsible for providing the Namespace to the Containers and other Namespaces.
|
|
15
18
|
* This class stores all Namespaces across the Program.
|
|
@@ -31,6 +34,10 @@ class A_Context {
|
|
|
31
34
|
* A set of globally registered concepts.
|
|
32
35
|
*/
|
|
33
36
|
this.concepts = new WeakMap();
|
|
37
|
+
/**
|
|
38
|
+
* Uses to store the scope of every element in the program.
|
|
39
|
+
*/
|
|
40
|
+
this.registry = new WeakMap();
|
|
34
41
|
/**
|
|
35
42
|
* A set of allocated scopes per every element in the program.
|
|
36
43
|
*/
|
|
@@ -38,6 +45,9 @@ class A_Context {
|
|
|
38
45
|
this.conceptsMeta = new Map();
|
|
39
46
|
this.containersMeta = new Map();
|
|
40
47
|
this.componentsMeta = new Map();
|
|
48
|
+
this.entitiesMeta = new Map();
|
|
49
|
+
// uses to allow to store custom meta data
|
|
50
|
+
this.customMeta = new Map();
|
|
41
51
|
}
|
|
42
52
|
// ===================================================================================================
|
|
43
53
|
// ================================ META OPERATIONS ==================================================
|
|
@@ -81,63 +91,56 @@ class A_Context {
|
|
|
81
91
|
const instance = this.getInstance();
|
|
82
92
|
let metaStorage;
|
|
83
93
|
let property;
|
|
84
|
-
let
|
|
94
|
+
let metaType;
|
|
85
95
|
switch (true) {
|
|
86
96
|
case param1 instanceof A_Container_class_1.A_Container: {
|
|
87
97
|
metaStorage = instance.containersMeta;
|
|
88
98
|
property = param1.constructor;
|
|
89
|
-
|
|
90
|
-
const inheritMeta = metaStorage.get(Object.getPrototypeOf(property)) || new A_Container_meta_1.A_ContainerMeta();
|
|
91
|
-
metaStorage.set(property, new A_Container_meta_1.A_ContainerMeta().from(inheritMeta));
|
|
92
|
-
}
|
|
93
|
-
meta = metaStorage.get(property);
|
|
99
|
+
metaType = A_Container_meta_1.A_ContainerMeta;
|
|
94
100
|
break;
|
|
95
101
|
}
|
|
96
102
|
case a_utils_1.A_CommonHelper.isInheritedFrom(param1, A_Container_class_1.A_Container): {
|
|
97
103
|
metaStorage = instance.containersMeta;
|
|
98
104
|
property = param1;
|
|
99
|
-
|
|
100
|
-
const inheritMeta = metaStorage.get(Object.getPrototypeOf(property)) || new A_Container_meta_1.A_ContainerMeta();
|
|
101
|
-
metaStorage.set(property, new A_Container_meta_1.A_ContainerMeta().from(inheritMeta));
|
|
102
|
-
}
|
|
103
|
-
meta = metaStorage.get(property);
|
|
105
|
+
metaType = A_Container_meta_1.A_ContainerMeta;
|
|
104
106
|
break;
|
|
105
107
|
}
|
|
106
108
|
case param1 instanceof A_Component_class_1.A_Component: {
|
|
107
109
|
metaStorage = instance.componentsMeta;
|
|
108
110
|
property = param1.constructor;
|
|
109
|
-
|
|
110
|
-
const inheritMeta = metaStorage.get(Object.getPrototypeOf(property)) || new A_Component_meta_1.A_ComponentMeta();
|
|
111
|
-
metaStorage.set(property, new A_Component_meta_1.A_ComponentMeta().from(inheritMeta));
|
|
112
|
-
}
|
|
113
|
-
meta = metaStorage.get(property);
|
|
111
|
+
metaType = A_Component_meta_1.A_ComponentMeta;
|
|
114
112
|
break;
|
|
115
113
|
}
|
|
116
114
|
case a_utils_1.A_CommonHelper.isInheritedFrom(param1, A_Component_class_1.A_Component): {
|
|
117
115
|
metaStorage = instance.componentsMeta;
|
|
118
116
|
property = param1;
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
117
|
+
metaType = A_Component_meta_1.A_ComponentMeta;
|
|
118
|
+
break;
|
|
119
|
+
}
|
|
120
|
+
case param1 instanceof A_Entity_class_1.A_Entity: {
|
|
121
|
+
metaStorage = instance.entitiesMeta;
|
|
122
|
+
property = param1.constructor;
|
|
123
|
+
metaType = A_Component_meta_1.A_ComponentMeta;
|
|
124
|
+
break;
|
|
125
|
+
}
|
|
126
|
+
case a_utils_1.A_CommonHelper.isInheritedFrom(param1, A_Entity_class_1.A_Entity): {
|
|
127
|
+
metaStorage = instance.entitiesMeta;
|
|
128
|
+
property = param1;
|
|
129
|
+
metaType = A_Entity_meta_1.A_EntityMeta;
|
|
124
130
|
break;
|
|
125
131
|
}
|
|
126
132
|
default: {
|
|
127
|
-
metaStorage = instance.
|
|
133
|
+
metaStorage = instance.customMeta;
|
|
128
134
|
property = typeof param1 === 'function' ? param1 : param1.constructor;
|
|
129
|
-
|
|
130
|
-
const inheritMeta = metaStorage.get(Object.getPrototypeOf(property)) || new A_Meta_class_1.A_Meta();
|
|
131
|
-
metaStorage.set(property, new A_Meta_class_1.A_Meta().from(inheritMeta));
|
|
132
|
-
}
|
|
133
|
-
meta = metaStorage.get(property);
|
|
135
|
+
metaType = A_Meta_class_1.A_Meta;
|
|
134
136
|
break;
|
|
135
137
|
}
|
|
136
138
|
}
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
139
|
+
if (!metaStorage.has(property)) {
|
|
140
|
+
const inheritMeta = metaStorage.get(Object.getPrototypeOf(property)) || new metaType();
|
|
141
|
+
metaStorage.set(property, new metaType().from(inheritMeta));
|
|
142
|
+
}
|
|
143
|
+
return metaStorage.get(property);
|
|
141
144
|
}
|
|
142
145
|
static scope(param1) {
|
|
143
146
|
const instance = this.getInstance();
|
|
@@ -148,36 +151,117 @@ class A_Context {
|
|
|
148
151
|
return instance.features.get(param1);
|
|
149
152
|
case param1 instanceof A_Concept_class_1.A_Concept:
|
|
150
153
|
return instance.concepts.get(param1);
|
|
154
|
+
case param1 instanceof A_Entity_class_1.A_Entity:
|
|
155
|
+
return instance.registry.get(param1);
|
|
156
|
+
case param1 instanceof A_Component_class_1.A_Component:
|
|
157
|
+
return instance.registry.get(param1);
|
|
158
|
+
case param1 instanceof A_Fragment_class_1.A_Fragment:
|
|
159
|
+
return instance.registry.get(param1);
|
|
151
160
|
default:
|
|
152
161
|
throw new Error(`[!] A-Concept Context: Unknown type of the parameter.`);
|
|
153
162
|
}
|
|
154
163
|
}
|
|
155
|
-
|
|
164
|
+
/**
|
|
165
|
+
* This method returns a component by its meta.
|
|
166
|
+
*
|
|
167
|
+
* @param meta
|
|
168
|
+
* @returns
|
|
169
|
+
*/
|
|
170
|
+
static component(meta) {
|
|
156
171
|
const instance = this.getInstance();
|
|
157
|
-
let
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
172
|
+
let component;
|
|
173
|
+
instance.componentsMeta.forEach((meta, constructor) => {
|
|
174
|
+
if (meta === meta) {
|
|
175
|
+
component = constructor;
|
|
176
|
+
}
|
|
177
|
+
});
|
|
178
|
+
if (!component) {
|
|
179
|
+
throw new Error(`[!] A-Concept Context: Component not found.`);
|
|
162
180
|
}
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
181
|
+
return component;
|
|
182
|
+
}
|
|
183
|
+
static feature(param1, param2, param3) {
|
|
184
|
+
const instance = this.getInstance();
|
|
185
|
+
const component = param1;
|
|
186
|
+
const feature = param2;
|
|
187
|
+
const config = param3 || {};
|
|
188
|
+
// TODO: have no idea why it's not working because of that "any"
|
|
189
|
+
const scope = this.scope(component);
|
|
190
|
+
const steps = [];
|
|
191
|
+
// Now we need to resolve the method from all registered components
|
|
192
|
+
// We need to get all components that has extensions for the feature in component
|
|
193
|
+
instance.componentsMeta
|
|
194
|
+
.forEach((meta, constructor) => {
|
|
195
|
+
try {
|
|
196
|
+
// Just try to make sure that component not only Indexed but also presented in scope
|
|
197
|
+
scope.resolve(constructor);
|
|
198
|
+
// Get all extensions for the feature
|
|
199
|
+
meta
|
|
200
|
+
.extensions(feature)
|
|
201
|
+
.forEach(({ handler, args }) => {
|
|
202
|
+
steps.push({
|
|
203
|
+
component: constructor,
|
|
204
|
+
handler,
|
|
205
|
+
args
|
|
206
|
+
});
|
|
207
|
+
});
|
|
208
|
+
}
|
|
209
|
+
catch (error) {
|
|
210
|
+
// do nothing
|
|
211
|
+
}
|
|
212
|
+
});
|
|
213
|
+
const newFeature = new A_Feature_class_1.A_Feature({
|
|
214
|
+
name: `${component.constructor.name}.${feature}`,
|
|
215
|
+
fragments: config.fragments,
|
|
216
|
+
components: config.components,
|
|
217
|
+
steps,
|
|
218
|
+
parent: component instanceof A_Container_class_1.A_Container ? this.scope(component) : undefined
|
|
219
|
+
});
|
|
220
|
+
return newFeature;
|
|
221
|
+
}
|
|
222
|
+
static register(scope, param1) {
|
|
223
|
+
const instance = this.getInstance();
|
|
224
|
+
switch (true) {
|
|
225
|
+
case param1 instanceof A_Component_class_1.A_Component:
|
|
226
|
+
instance.registry.set(param1, scope);
|
|
227
|
+
break;
|
|
228
|
+
case param1 instanceof A_Container_class_1.A_Container:
|
|
229
|
+
instance.registry.set(param1, scope);
|
|
230
|
+
break;
|
|
231
|
+
case param1 instanceof A_Entity_class_1.A_Entity:
|
|
232
|
+
instance.registry.set(param1, scope);
|
|
233
|
+
break;
|
|
234
|
+
case param1 instanceof A_Fragment_class_1.A_Fragment:
|
|
235
|
+
instance.registry.set(param1, scope);
|
|
236
|
+
break;
|
|
237
|
+
default:
|
|
238
|
+
instance.registry.set(param1, scope);
|
|
166
239
|
}
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
if (
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
//
|
|
180
|
-
|
|
240
|
+
// if (param1 instanceof A_Fragment) {
|
|
241
|
+
// const instance = this.getInstance();
|
|
242
|
+
// let fragment: A_Fragment;
|
|
243
|
+
// let name: string;
|
|
244
|
+
// if (typeof param2 === 'string') {
|
|
245
|
+
// name = param2;
|
|
246
|
+
// fragment = param1;
|
|
247
|
+
// } else {
|
|
248
|
+
// fragment = param1 as A_Fragment;
|
|
249
|
+
// name = fragment.name;
|
|
250
|
+
// }
|
|
251
|
+
// /**
|
|
252
|
+
// * If the namespace is not provided, then use the root namespace.
|
|
253
|
+
// * If the root namespace is not provided, then use the default namespace.
|
|
254
|
+
// */
|
|
255
|
+
// if (!name)
|
|
256
|
+
// name = this.root
|
|
257
|
+
// || process.env.ADAAS_NAMESPACE
|
|
258
|
+
// || process.env.A_NAMESPACE
|
|
259
|
+
// || process.env.ADAAS_APP_NAMESPACE
|
|
260
|
+
// || 'a-concept'
|
|
261
|
+
// if (!this.root)
|
|
262
|
+
// instance._root = name;
|
|
263
|
+
// // instance.namedFragments.set(namespace, Namespace);
|
|
264
|
+
// return name;
|
|
181
265
|
}
|
|
182
266
|
}
|
|
183
267
|
exports.A_Context = A_Context;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"A-Context.class.js","sourceRoot":"","sources":["../../../../src/global/A-Context/A-Context.class.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"A-Context.class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;QAChC,QAAQ;QAER,UAAU;QACV,wEAAwE;QACxE,gFAAgF;QAChF,UAAU;QACV,iBAAiB;QACjB,2BAA2B;QAC3B,6CAA6C;QAC7C,yCAAyC;QACzC,iDAAiD;QACjD,6BAA6B;QAG7B,sBAAsB;QACtB,iCAAiC;QAEjC,4DAA4D;QAE5D,mBAAmB;IAEvB,CAAC;CACJ;AAldD,8BAkdC"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { A_Scope } from "../A-Scope/A-Scope.class";
|
|
2
|
-
export type A_TYPES__ContextExecutionPipeline = {
|
|
3
|
-
scope: A_Scope;
|
|
4
|
-
steps: A_TYPES__ContextExecutionPipelineStep[];
|
|
5
|
-
};
|
|
6
|
-
export type A_TYPES__ContextExecutionPipelineStep = {
|
|
7
|
-
component: {
|
|
8
|
-
new (...args: any[]): any;
|
|
9
|
-
};
|
|
10
|
-
handler: string;
|
|
11
|
-
args: any[];
|
|
12
|
-
};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
declare class RealDependency {
|
|
2
|
-
private name;
|
|
3
|
-
constructor(name: string);
|
|
4
|
-
getName(): string;
|
|
5
|
-
performAction(): void;
|
|
6
|
-
}
|
|
7
|
-
declare class DependencyReference<T> {
|
|
8
|
-
private realClass;
|
|
9
|
-
private args;
|
|
10
|
-
private proxyInstance;
|
|
11
|
-
private realInstance;
|
|
12
|
-
constructor(realClass: {
|
|
13
|
-
new (...args: any[]): T;
|
|
14
|
-
}, args: any[]);
|
|
15
|
-
private loadInstance;
|
|
16
|
-
resolve(): Promise<T>;
|
|
17
|
-
}
|