@adaas/a-concept 0.0.29 → 0.0.31
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/fe-be/channels/Test.channel.d.ts +6 -0
- package/dist/examples/fe-be/channels/Test.channel.js +14 -0
- package/dist/examples/fe-be/channels/Test.channel.js.map +1 -0
- package/dist/examples/fe-be/components/BE-Controller.component.d.ts +4 -0
- package/dist/examples/fe-be/components/BE-Controller.component.js +24 -0
- package/dist/examples/fe-be/components/BE-Controller.component.js.map +1 -0
- package/dist/examples/fe-be/components/FE.component.d.ts +4 -0
- package/dist/examples/fe-be/components/FE.component.js +31 -0
- package/dist/examples/fe-be/components/FE.component.js.map +1 -0
- package/dist/examples/fe-be/components/UserActions.component.d.ts +5 -0
- package/dist/examples/fe-be/components/UserActions.component.js +25 -0
- package/dist/examples/fe-be/components/UserActions.component.js.map +1 -0
- package/dist/examples/fe-be/concept.d.ts +0 -0
- package/dist/examples/fe-be/concept.js +2 -0
- package/dist/examples/fe-be/concept.js.map +1 -0
- package/dist/examples/fe-be/containers/ServerApp.container.d.ts +3 -0
- package/dist/examples/fe-be/containers/ServerApp.container.js +8 -0
- package/dist/examples/fe-be/containers/ServerApp.container.js.map +1 -0
- package/dist/examples/fe-be/containers/WebApp.container.d.ts +3 -0
- package/dist/examples/fe-be/containers/WebApp.container.js +8 -0
- package/dist/examples/fe-be/containers/WebApp.container.js.map +1 -0
- package/dist/examples/multi-container/channels/Direct.channel.d.ts +9 -0
- package/dist/examples/multi-container/channels/Direct.channel.js +32 -0
- package/dist/examples/multi-container/channels/Direct.channel.js.map +1 -0
- package/dist/examples/multi-container/concept.d.ts +0 -0
- package/dist/examples/multi-container/concept.js +2 -0
- package/dist/examples/multi-container/concept.js.map +1 -0
- package/dist/examples/multi-container/containers/Command.container.d.ts +11 -0
- package/dist/examples/multi-container/containers/Command.container.js +51 -0
- package/dist/examples/multi-container/containers/Command.container.js.map +1 -0
- package/dist/examples/multi-container/containers/Schedule.container.d.ts +15 -0
- package/dist/examples/multi-container/containers/Schedule.container.js +67 -0
- package/dist/examples/multi-container/containers/Schedule.container.js.map +1 -0
- package/dist/examples/simple/components/A.component.js.map +1 -1
- package/dist/examples/simple/containers/Main.container.js +7 -3
- package/dist/examples/simple/containers/Main.container.js.map +1 -1
- package/dist/examples/simple/entities/EntityA.entity.d.ts +8 -0
- package/dist/examples/simple/entities/EntityA.entity.js +22 -0
- package/dist/examples/simple/entities/EntityA.entity.js.map +1 -0
- package/dist/examples/simple-http-server/contexts/http-request.context.d.ts +0 -1
- package/dist/examples/simple-http-server/contexts/http-request.context.js +6 -8
- package/dist/examples/simple-http-server/contexts/http-request.context.js.map +1 -1
- package/dist/index.d.ts +8 -2
- package/dist/index.js +16 -7
- package/dist/index.js.map +1 -1
- package/dist/src/base/A-Errors/A-Error.entity.d.ts +3 -0
- package/dist/src/base/A-Errors/A-Error.entity.js +8 -0
- package/dist/src/base/A-Errors/A-Error.entity.js.map +1 -0
- package/dist/src/base/A-Errors/A-Errors.context.js +1 -1
- package/dist/src/base/A-Errors/A-Errors.context.js.map +1 -1
- package/dist/src/decorators/A-Abstraction/A-Abstraction.decorator.d.ts +14 -0
- package/dist/src/decorators/A-Abstraction/A-Abstraction.decorator.js +53 -0
- package/dist/src/decorators/A-Abstraction/A-Abstraction.decorator.js.map +1 -0
- package/dist/src/decorators/A-Abstraction/A-Abstraction.decorator.types.d.ts +2 -0
- package/dist/src/decorators/A-Abstraction/A-Abstraction.decorator.types.js +3 -0
- package/dist/src/decorators/A-Abstraction/A-Abstraction.decorator.types.js.map +1 -0
- package/dist/src/decorators/A-Connect/A-Connect.decorator.d.ts +19 -0
- package/dist/src/decorators/A-Connect/A-Connect.decorator.js +31 -0
- package/dist/src/decorators/A-Connect/A-Connect.decorator.js.map +1 -0
- package/dist/src/decorators/A-Connect/A-Connect.decorator.types.d.ts +1 -0
- package/dist/src/decorators/A-Connect/A-Connect.decorator.types.js +3 -0
- package/dist/src/decorators/A-Connect/A-Connect.decorator.types.js.map +1 -0
- package/dist/src/decorators/A-Entity/A-Entity-List.decorator.d.ts +1 -0
- package/dist/src/decorators/A-Entity/A-Entity-List.decorator.js +8 -0
- package/dist/src/decorators/A-Entity/A-Entity-List.decorator.js.map +1 -0
- package/dist/src/decorators/A-Entity/A-Entity.decorator.types.d.ts +14 -0
- package/dist/src/decorators/A-Entity/A-Entity.decorator.types.js +3 -0
- package/dist/src/decorators/A-Entity/A-Entity.decorator.types.js.map +1 -0
- package/dist/src/decorators/A-Feature/A-Feature-Define.decorator.js +7 -5
- 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 -0
- package/dist/src/decorators/A-Feature/A-Feature-Extend.decorator.js.map +1 -1
- package/dist/src/decorators/A-Feature/A-Feature.decorator.types.d.ts +36 -0
- package/dist/src/decorators/A-Inject/A-Inject.decorator.d.ts +2 -3
- package/dist/src/decorators/A-Inject/A-Inject.decorator.js.map +1 -1
- package/dist/src/decorators/A-Inject/A-Inject.decorator.types.d.ts +44 -0
- package/dist/src/global/A-Channel/A-Channel.class.d.ts +8 -10
- package/dist/src/global/A-Channel/A-Channel.class.js +12 -26
- package/dist/src/global/A-Channel/A-Channel.class.js.map +1 -1
- package/dist/src/global/A-Channel/A-Channel.types.d.ts +32 -0
- package/dist/src/global/A-Component/A-Component.class.d.ts +2 -1
- package/dist/src/global/A-Component/A-Component.class.js +1 -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 +16 -0
- package/dist/src/global/A-Component/A-Component.meta.js +37 -3
- package/dist/src/global/A-Component/A-Component.meta.js.map +1 -1
- package/dist/src/global/A-Component/A-Component.types.d.ts +26 -38
- package/dist/src/global/A-Component/A-Component.types.js +1 -7
- 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 +30 -30
- package/dist/src/global/A-Concept/A_Concept.class.js.map +1 -1
- package/dist/src/global/A-Concept/A_Concept.types.d.ts +42 -2
- package/dist/src/global/A-Concept/A_Concept.types.js.map +1 -1
- package/dist/src/global/A-Container/A-Container.class.d.ts +1 -8
- package/dist/src/global/A-Container/A-Container.class.js +1 -31
- package/dist/src/global/A-Container/A-Container.class.js.map +1 -1
- package/dist/src/global/A-Container/A-Container.meta.d.ts +8 -0
- package/dist/src/global/A-Container/A-Container.meta.js +29 -0
- package/dist/src/global/A-Container/A-Container.meta.js.map +1 -1
- package/dist/src/global/A-Container/A-Container.types.d.ts +32 -8
- package/dist/src/global/A-Container/A-Container.types.js +2 -1
- package/dist/src/global/A-Container/A-Container.types.js.map +1 -1
- package/dist/src/global/A-Context/A-Context.class.js +29 -36
- package/dist/src/global/A-Context/A-Context.class.js.map +1 -1
- package/dist/src/global/A-Entity/A-Entity.class.d.ts +1 -2
- package/dist/src/global/A-Entity/A-Entity.class.js +6 -7
- package/dist/src/global/A-Entity/A-Entity.class.js.map +1 -1
- package/dist/src/global/A-Entity/A-Entity.types.d.ts +12 -6
- package/dist/src/global/A-Entity/A-Entity.types.js.map +1 -1
- package/dist/src/global/A-Feature/A-Feature.class.d.ts +30 -6
- package/dist/src/global/A-Feature/A-Feature.class.js +49 -40
- package/dist/src/global/A-Feature/A-Feature.class.js.map +1 -1
- package/dist/src/global/A-Feature/A-Feature.types.d.ts +2 -24
- package/dist/src/global/A-Feature/A-Feature.types.js +21 -0
- package/dist/src/global/A-Feature/A-Feature.types.js.map +1 -1
- package/dist/src/global/A-Fragment/A-Fragment.class.d.ts +8 -0
- package/dist/src/global/A-Fragment/A-Fragment.class.js +10 -0
- package/dist/src/global/A-Fragment/A-Fragment.class.js.map +1 -1
- package/dist/src/global/A-Scope/A-Scope.class.d.ts +7 -5
- package/dist/src/global/A-Scope/A-Scope.class.js +33 -10
- package/dist/src/global/A-Scope/A-Scope.class.js.map +1 -1
- package/dist/src/global/A-Scope/A-Scope.types.d.ts +2 -1
- package/dist/src/global/A-Stage/A-Stage.class.d.ts +69 -0
- package/dist/src/global/A-Stage/A-Stage.class.js +181 -0
- package/dist/src/global/A-Stage/A-Stage.class.js.map +1 -0
- package/dist/src/global/A-Stage/A-Stage.types.d.ts +78 -0
- package/dist/src/global/A-Stage/A-Stage.types.js +59 -0
- package/dist/src/global/A-Stage/A-Stage.types.js.map +1 -0
- package/dist/src/helpers/StepsManager.class.d.ts +15 -0
- package/dist/src/helpers/StepsManager.class.js +85 -0
- package/dist/src/helpers/StepsManager.class.js.map +1 -0
- package/examples/fe-be/channels/Test.channel.ts +24 -0
- package/examples/fe-be/components/BE-Controller.component.ts +20 -0
- package/examples/fe-be/components/FE.component.ts +13 -0
- package/examples/fe-be/concept.ts +0 -0
- package/examples/fe-be/containers/ServerApp.container.ts +8 -0
- package/examples/fe-be/containers/WebApp.container.ts +13 -0
- package/examples/multi-container/channels/Direct.channel.ts +39 -0
- package/examples/multi-container/concept.ts +0 -0
- package/examples/multi-container/containers/Command.container.ts +41 -0
- package/examples/multi-container/containers/Schedule.container.ts +57 -0
- package/examples/simple/components/A.component.ts +2 -1
- package/examples/simple/containers/Main.container.ts +11 -3
- package/examples/simple/entities/EntityA.entity.ts +16 -0
- package/examples/simple-http-server/contexts/http-request.context.ts +6 -6
- package/index.ts +12 -3
- package/package.json +1 -1
- package/src/base/A-Errors/A-Error.entity.ts +10 -0
- package/src/base/A-Errors/A-Errors.context.ts +2 -2
- package/src/decorators/A-Abstraction/A-Abstraction.decorator.ts +82 -0
- package/src/decorators/{A-Stage/A-Stage.decorator.types.ts → A-Abstraction/A-Abstraction.decorator.types.ts} +1 -3
- package/src/decorators/A-Connect/A-Connect.decorator.ts +71 -0
- package/src/decorators/A-Connect/A-Connect.decorator.types.ts +6 -0
- package/src/decorators/A-Entity/A-Entity-List.decorator.ts +12 -0
- package/src/decorators/A-Entity/A-Entity.decorator.types.ts +18 -0
- package/src/decorators/A-Feature/A-Feature-Define.decorator.ts +16 -9
- package/src/decorators/A-Feature/A-Feature-Extend.decorator.ts +10 -2
- package/src/decorators/A-Feature/A-Feature.decorator.types.ts +46 -0
- package/src/decorators/A-Inject/A-Inject.decorator.ts +7 -7
- package/src/decorators/A-Inject/A-Inject.decorator.types.ts +47 -1
- package/src/global/A-Channel/A-Channel.class.ts +25 -28
- package/src/global/A-Channel/A-Channel.types.ts +53 -0
- package/src/global/A-Component/A-Component.class.ts +10 -2
- package/src/global/A-Component/A-Component.meta.ts +59 -6
- package/src/global/A-Component/A-Component.types.ts +28 -45
- package/src/global/A-Concept/A_Concept.class.ts +52 -31
- package/src/global/A-Concept/A_Concept.types.ts +48 -3
- package/src/global/A-Container/A-Container.class.ts +3 -39
- package/src/global/A-Container/A-Container.meta.ts +41 -4
- package/src/global/A-Container/A-Container.types.ts +36 -8
- package/src/global/A-Context/A-Context.class.ts +37 -50
- package/src/global/A-Entity/A-Entity.class.ts +8 -6
- package/src/global/A-Entity/A-Entity.types.ts +13 -6
- package/src/global/A-Feature/A-Feature.class.ts +73 -61
- package/src/global/A-Feature/A-Feature.types.ts +24 -23
- package/src/global/A-Fragment/A-Fragment.class.ts +15 -0
- package/src/global/A-Scope/A-Scope.class.ts +58 -25
- package/src/global/A-Scope/A-Scope.types.ts +2 -1
- package/src/global/A-Stage/A-Stage.class.ts +234 -0
- package/src/global/A-Stage/A-Stage.types.ts +101 -0
- package/src/helpers/StepsManager.class.ts +104 -0
- package/tests/channel.ts +213 -0
- package/tests/log.ts +88 -40
- package/src/decorators/A-Stage/A-Stage.decorator.ts +0 -84
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { A_Component } from "../A-Component/A-Component.class";
|
|
2
|
+
import { A_Fragment } from "../A-Fragment/A-Fragment.class";
|
|
1
3
|
export type A_TYPES__A_DependencyReferenceConstructor = {
|
|
2
4
|
/**
|
|
3
5
|
* The name of the dependency
|
|
@@ -33,3 +35,33 @@ export type A_TYPES__A_DependencyReferenceConstructorConfig = {
|
|
|
33
35
|
timeout: number;
|
|
34
36
|
};
|
|
35
37
|
};
|
|
38
|
+
export type A_TYPES__A_ChannelCallParams = {
|
|
39
|
+
fragments: Array<A_Fragment>;
|
|
40
|
+
components: Array<typeof A_Component>;
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* Returns a string set of possible methods that could be called on a provided A-Component
|
|
44
|
+
*/
|
|
45
|
+
export type A_TYPES__A_ExecutableMethods<T> = {
|
|
46
|
+
[K in keyof T]: T[K] extends (...arg: Partial<A_TYPES__A_ChannelCallParams>[]) => Promise<any> ? K : never;
|
|
47
|
+
}[keyof T];
|
|
48
|
+
/**
|
|
49
|
+
* Returns a string set of possible methods that could be called on a set of provided set of A-Components
|
|
50
|
+
*/
|
|
51
|
+
export type A_TYPES__A_ChannelAggregateMethods<TClasses extends A_Component[]> = {
|
|
52
|
+
[K in keyof TClasses]: TClasses[K] extends infer Instance ? A_TYPES__A_ExecutableMethods<Instance> : never;
|
|
53
|
+
}[number];
|
|
54
|
+
/**
|
|
55
|
+
* Describes a type of proxy object and consists of all callable methods from a set opf provided components
|
|
56
|
+
*/
|
|
57
|
+
export type A_TYPES__A_ChannelAggregated<TClasses extends any[]> = {
|
|
58
|
+
[Method in A_TYPES__A_ChannelAggregateMethods<TClasses>]: {
|
|
59
|
+
[Class in keyof TClasses]: TClasses[Class] extends infer Instance ? Method extends keyof Instance ? (params: Partial<A_TYPES__A_ChannelCallParams>) => Promise<any> : never : never;
|
|
60
|
+
}[number];
|
|
61
|
+
};
|
|
62
|
+
/**
|
|
63
|
+
* A set of parameters are required to construct a new A-Channel
|
|
64
|
+
*/
|
|
65
|
+
export type A_TYPES__A_ChannelConstructor = {
|
|
66
|
+
id: string;
|
|
67
|
+
};
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { A_TYPES__Required } from "@adaas/a-utils";
|
|
2
|
-
import { A_TYPES__ComponentCallParams } from "./A-Component.types";
|
|
2
|
+
import { A_TYPES__ComponentCallParams, A_TYPES__ComponentConstructor } from "./A-Component.types";
|
|
3
3
|
import { A_Scope } from "../A-Scope/A-Scope.class";
|
|
4
4
|
/**
|
|
5
5
|
* This element only contains the specific code
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
export declare class A_Component<_FeatureNames extends Array<string> = any> {
|
|
9
|
+
constructor(params?: Partial<A_TYPES__ComponentConstructor<_FeatureNames>>);
|
|
9
10
|
/**
|
|
10
11
|
* Call a feature of the component
|
|
11
12
|
*
|
|
@@ -16,6 +16,7 @@ const A_Context_class_1 = require("../A-Context/A-Context.class");
|
|
|
16
16
|
*
|
|
17
17
|
*/
|
|
18
18
|
class A_Component {
|
|
19
|
+
constructor(params) { }
|
|
19
20
|
call(scope, param1, param2) {
|
|
20
21
|
return __awaiter(this, void 0, void 0, function* () {
|
|
21
22
|
const feature = typeof param1 === 'string'
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"A-Component.class.js","sourceRoot":"","sources":["../../../../src/global/A-Component/A-Component.class.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,kEAAyD;
|
|
1
|
+
{"version":3,"file":"A-Component.class.js","sourceRoot":"","sources":["../../../../src/global/A-Component/A-Component.class.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,kEAAyD;AAMzD;;;GAGG;AACH,MAAa,WAAW;IAGpB,YACI,MAA8D,IAC9D,CAAC;IAoCC,IAAI,CACN,KAAc,EACd,MAAyH,EACzH,MAAqE;;YAGrE,MAAM,OAAO,GAAW,OAAO,MAAM,KAAK,QAAQ;gBAC9C,CAAC,CAAC,MAAM;gBACR,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC;YAClB,MAAM,MAAM,GAAiE,OAAO,MAAM,KAAK,QAAQ;gBACnG,CAAC,CAAC,MAAM,IAAI,EAAE;gBACd,CAAC,CAAC,MAAM,CAAC;YAEb,MAAM,UAAU,GAAG,2BAAS,CAAC,OAAO,CAAC,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;YAEnE,OAAO,MAAM,UAAU,CAAC,OAAO,EAAE,CAAC;QACtC,CAAC;KAAA;CACJ;AA1DD,kCA0DC"}
|
|
@@ -1,6 +1,15 @@
|
|
|
1
|
+
import { A_TYPES__A_InjectDecorator_Meta } from "../../decorators/A-Inject/A-Inject.decorator.types";
|
|
2
|
+
import { A_TYPES__ConceptAbstractionMeta, A_TYPES__ConceptStage } from "../A-Concept/A_Concept.types";
|
|
1
3
|
import { A_Meta } from "../A-Meta/A-Meta.class";
|
|
2
4
|
import { A_TYPES__ComponentMeta, A_TYPES__ComponentMetaExtension } from "./A-Component.types";
|
|
3
5
|
export declare class A_ComponentMeta extends A_Meta<A_TYPES__ComponentMeta> {
|
|
6
|
+
/**
|
|
7
|
+
* Allows to get all the injections for a given handler
|
|
8
|
+
*
|
|
9
|
+
* @param handler
|
|
10
|
+
* @returns
|
|
11
|
+
*/
|
|
12
|
+
injections(handler: string): A_TYPES__A_InjectDecorator_Meta;
|
|
4
13
|
/**
|
|
5
14
|
* Allows to get all the extensions for a given feature
|
|
6
15
|
*
|
|
@@ -8,4 +17,11 @@ export declare class A_ComponentMeta extends A_Meta<A_TYPES__ComponentMeta> {
|
|
|
8
17
|
* @returns
|
|
9
18
|
*/
|
|
10
19
|
extensions(feature: string): A_TYPES__ComponentMetaExtension[];
|
|
20
|
+
/**
|
|
21
|
+
* Returns a set of instructions to run proper methods in Component during A-Concept Stage
|
|
22
|
+
*
|
|
23
|
+
* @param stage
|
|
24
|
+
* @returns
|
|
25
|
+
*/
|
|
26
|
+
abstractions(abstraction: A_TYPES__ConceptStage): A_TYPES__ConceptAbstractionMeta[];
|
|
11
27
|
}
|
|
@@ -4,6 +4,17 @@ exports.A_ComponentMeta = void 0;
|
|
|
4
4
|
const A_Meta_class_1 = require("../A-Meta/A-Meta.class");
|
|
5
5
|
const A_Component_types_1 = require("./A-Component.types");
|
|
6
6
|
class A_ComponentMeta extends A_Meta_class_1.A_Meta {
|
|
7
|
+
/**
|
|
8
|
+
* Allows to get all the injections for a given handler
|
|
9
|
+
*
|
|
10
|
+
* @param handler
|
|
11
|
+
* @returns
|
|
12
|
+
*/
|
|
13
|
+
injections(handler) {
|
|
14
|
+
const injections = this.get(A_Component_types_1.A_TYPES__ComponentMetaKey.INJECTIONS);
|
|
15
|
+
const args = (injections === null || injections === void 0 ? void 0 : injections.get(handler)) || [];
|
|
16
|
+
return args;
|
|
17
|
+
}
|
|
7
18
|
/**
|
|
8
19
|
* Allows to get all the extensions for a given feature
|
|
9
20
|
*
|
|
@@ -14,22 +25,45 @@ class A_ComponentMeta extends A_Meta_class_1.A_Meta {
|
|
|
14
25
|
const steps = [];
|
|
15
26
|
const extensions = this.get(A_Component_types_1.A_TYPES__ComponentMetaKey.EXTENSIONS);
|
|
16
27
|
const injections = this.get(A_Component_types_1.A_TYPES__ComponentMetaKey.INJECTIONS);
|
|
17
|
-
// const constructor = A_Context.component(this);
|
|
18
28
|
extensions === null || extensions === void 0 ? void 0 : extensions
|
|
19
29
|
// returns all extensions that match the feature
|
|
20
30
|
.find(feature).forEach(([handler, extensions]) => {
|
|
21
31
|
extensions.forEach(extension => {
|
|
22
|
-
const args = (injections === null || injections === void 0 ? void 0 : injections.get(extension.handler)) || [];
|
|
23
32
|
steps.push({
|
|
24
33
|
// component: constructor,
|
|
25
34
|
name: extension.name,
|
|
26
35
|
handler: extension.handler,
|
|
27
|
-
|
|
36
|
+
behavior: extension.behavior,
|
|
37
|
+
before: extension.before || [],
|
|
38
|
+
after: extension.after || []
|
|
28
39
|
});
|
|
29
40
|
});
|
|
30
41
|
});
|
|
31
42
|
return steps;
|
|
32
43
|
}
|
|
44
|
+
/**
|
|
45
|
+
* Returns a set of instructions to run proper methods in Component during A-Concept Stage
|
|
46
|
+
*
|
|
47
|
+
* @param stage
|
|
48
|
+
* @returns
|
|
49
|
+
*/
|
|
50
|
+
abstractions(abstraction) {
|
|
51
|
+
const steps = [];
|
|
52
|
+
const abstractions = this.get(A_Component_types_1.A_TYPES__ComponentMetaKey.ABSTRACTIONS);
|
|
53
|
+
const injections = this.get(A_Component_types_1.A_TYPES__ComponentMetaKey.INJECTIONS);
|
|
54
|
+
// const constructor = A_Context.component(this);
|
|
55
|
+
abstractions === null || abstractions === void 0 ? void 0 : abstractions
|
|
56
|
+
// returns all extensions that match the feature
|
|
57
|
+
.find(`CONCEPT_ABSTRACTION::${abstraction}`).forEach(([handler, extensions]) => {
|
|
58
|
+
extensions.forEach(extension => {
|
|
59
|
+
const args = (injections === null || injections === void 0 ? void 0 : injections.get(extension.handler)) || [];
|
|
60
|
+
steps.push(Object.assign(Object.assign({}, extension), {
|
|
61
|
+
// component: constructor,
|
|
62
|
+
args }));
|
|
63
|
+
});
|
|
64
|
+
});
|
|
65
|
+
return steps;
|
|
66
|
+
}
|
|
33
67
|
}
|
|
34
68
|
exports.A_ComponentMeta = A_ComponentMeta;
|
|
35
69
|
//# sourceMappingURL=A-Component.meta.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"A-Component.meta.js","sourceRoot":"","sources":["../../../../src/global/A-Component/A-Component.meta.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"A-Component.meta.js","sourceRoot":"","sources":["../../../../src/global/A-Component/A-Component.meta.ts"],"names":[],"mappings":";;;AAEA,yDAAgD;AAChD,2DAAyH;AAGzH,MAAa,eAAgB,SAAQ,qBAA8B;IAI/D;;;;;OAKG;IACH,UAAU,CACN,OAAe;QAEf,MAAM,UAAU,GAAG,IAAI,CAAC,GAAG,CAAC,6CAAyB,CAAC,UAAU,CAAC,CAAC;QAElE,MAAM,IAAI,GAAG,CAAA,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,GAAG,CAAC,OAAO,CAAC,KAAI,EAAE,CAAC;QAE5C,OAAO,IAAI,CAAC;IAChB,CAAC;IAID;;;;;OAKG;IACH,UAAU,CACN,OAAe;QAEf,MAAM,KAAK,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AAA,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,GAAG,CAAC,SAAS,CAAC,OAAO,CAAC,KAAI,EAAE,CAAC;gBAEtD,KAAK,CAAC,IAAI,iCACH,SAAS;oBACZ,0BAA0B;oBAC1B,IAAI,IACN,CAAC;YAEP,CAAC,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;QAGP,OAAO,KAAK,CAAC;IACjB,CAAC;CACJ;AA9FD,0CA8FC"}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { A_Feature } from "../A-Feature/A-Feature.class";
|
|
1
|
+
import { A_TYPES__A_InjectDecorator_Meta } from "../../decorators/A-Inject/A-Inject.decorator.types";
|
|
3
2
|
import { A_Fragment } from "../A-Fragment/A-Fragment.class";
|
|
4
3
|
import { A_Meta } from "../A-Meta/A-Meta.class";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
4
|
+
import { A_TYPES__A_DefineDecorator_Meta, A_TYPES__A_ExtendDecorator_BehaviorConfig, A_TYPES__A_ExtendDecorator_Meta } from "../../decorators/A-Feature/A-Feature.decorator.types";
|
|
5
|
+
import { A_TYPES__ConceptAbstraction } from "../A-Concept/A_Concept.types";
|
|
6
|
+
export type A_TYPES__ComponentConstructor<_Exports extends Array<String> = any> = {
|
|
7
|
+
exports: _Exports;
|
|
8
|
+
};
|
|
7
9
|
export type A_TYPES__ComponentCallParams<T extends string> = {
|
|
8
10
|
name: T;
|
|
9
11
|
fragments: Array<A_Fragment>;
|
|
@@ -20,23 +22,38 @@ export type A_TYPES__ComponentMeta = {
|
|
|
20
22
|
*
|
|
21
23
|
* Where value is the extension instructions
|
|
22
24
|
*/
|
|
23
|
-
[Key: string]:
|
|
25
|
+
[Key: string]: A_TYPES__A_ExtendDecorator_Meta[];
|
|
26
|
+
}>;
|
|
27
|
+
[A_TYPES__ComponentMetaKey.FEATURES]: A_Meta<{
|
|
28
|
+
/**
|
|
29
|
+
* Where Key is the name of the feature
|
|
30
|
+
*
|
|
31
|
+
* Where value is the list of features
|
|
32
|
+
*/
|
|
33
|
+
[Key: string]: A_TYPES__A_DefineDecorator_Meta;
|
|
24
34
|
}>;
|
|
25
|
-
[A_TYPES__ComponentMetaKey.FEATURES]: any[];
|
|
26
35
|
[A_TYPES__ComponentMetaKey.INJECTIONS]: A_Meta<{
|
|
27
36
|
/**
|
|
28
37
|
* Where Key is the name of the injection
|
|
29
38
|
*
|
|
30
39
|
* Where value is the list of injections
|
|
31
40
|
*/
|
|
32
|
-
[Key: string]:
|
|
41
|
+
[Key: string]: A_TYPES__A_InjectDecorator_Meta;
|
|
42
|
+
}>;
|
|
43
|
+
[A_TYPES__ComponentMetaKey.ABSTRACTIONS]: A_Meta<{
|
|
44
|
+
/**
|
|
45
|
+
* Where Key is the name of the stage
|
|
46
|
+
*
|
|
47
|
+
* Where value is the list of injections
|
|
48
|
+
*/
|
|
49
|
+
[Key: string]: A_TYPES__ConceptAbstraction[];
|
|
33
50
|
}>;
|
|
34
51
|
};
|
|
35
52
|
export declare enum A_TYPES__ComponentMetaKey {
|
|
36
53
|
EXTENSIONS = "a-component-extensions",
|
|
37
54
|
FEATURES = "a-component-features",
|
|
38
55
|
INJECTIONS = "a-component-injections",
|
|
39
|
-
|
|
56
|
+
ABSTRACTIONS = "a-component-abstractions"
|
|
40
57
|
}
|
|
41
58
|
export type A_TYPES__ComponentMetaExtension = {
|
|
42
59
|
/**
|
|
@@ -47,33 +64,4 @@ export type A_TYPES__ComponentMetaExtension = {
|
|
|
47
64
|
* The name of the handler that will be used to apply the extension
|
|
48
65
|
*/
|
|
49
66
|
handler: string;
|
|
50
|
-
|
|
51
|
-
* The arguments that will be passed to the handler
|
|
52
|
-
*/
|
|
53
|
-
args: A_TYPES__ComponentMeta_InjectionParams;
|
|
54
|
-
};
|
|
55
|
-
export type A_TYPES__ComponentMeta_ExtensionItem = {
|
|
56
|
-
name: string;
|
|
57
|
-
handler: string;
|
|
58
|
-
};
|
|
59
|
-
export type A_TYPES__ComponentMeta_InjectionParams = Array<{
|
|
60
|
-
target: A_TYPES__ComponentMeta_InjectionParam;
|
|
61
|
-
} | {
|
|
62
|
-
target: {
|
|
63
|
-
new (...args: any[]): A_Entity;
|
|
64
|
-
};
|
|
65
|
-
instructions: Partial<A_TYPES__ComponentMeta_EntityInjectionInstructions>;
|
|
66
|
-
}>;
|
|
67
|
-
export type A_TYPES__ComponentMeta_EntityInjectionInstructions = {
|
|
68
|
-
aseid: string;
|
|
69
|
-
id: string;
|
|
70
|
-
};
|
|
71
|
-
export type A_TYPES__ComponentMeta_InjectionParam = {
|
|
72
|
-
new (...args: any[]): A_Fragment;
|
|
73
|
-
} | {
|
|
74
|
-
new (...args: any[]): A_Component;
|
|
75
|
-
} | {
|
|
76
|
-
new (...args: any[]): A_Scope;
|
|
77
|
-
} | {
|
|
78
|
-
new (...args: any[]): A_Feature;
|
|
79
|
-
};
|
|
67
|
+
} & A_TYPES__A_ExtendDecorator_BehaviorConfig;
|
|
@@ -6,12 +6,6 @@ var A_TYPES__ComponentMetaKey;
|
|
|
6
6
|
A_TYPES__ComponentMetaKey["EXTENSIONS"] = "a-component-extensions";
|
|
7
7
|
A_TYPES__ComponentMetaKey["FEATURES"] = "a-component-features";
|
|
8
8
|
A_TYPES__ComponentMetaKey["INJECTIONS"] = "a-component-injections";
|
|
9
|
-
A_TYPES__ComponentMetaKey["
|
|
9
|
+
A_TYPES__ComponentMetaKey["ABSTRACTIONS"] = "a-component-abstractions";
|
|
10
10
|
})(A_TYPES__ComponentMetaKey || (exports.A_TYPES__ComponentMetaKey = A_TYPES__ComponentMetaKey = {}));
|
|
11
|
-
// |
|
|
12
|
-
// typeof A_Fragment
|
|
13
|
-
// | typeof A_Component
|
|
14
|
-
// // | { new(...args: any[]): any }
|
|
15
|
-
// | typeof A_Scope
|
|
16
|
-
// | typeof A_Feature;
|
|
17
11
|
//# sourceMappingURL=A-Component.types.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"A-Component.types.js","sourceRoot":"","sources":["../../../../src/global/A-Component/A-Component.types.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"A-Component.types.js","sourceRoot":"","sources":["../../../../src/global/A-Component/A-Component.types.ts"],"names":[],"mappings":";;;AA6DA,IAAY,yBAKX;AALD,WAAY,yBAAyB;IACjC,kEAAqC,CAAA;IACrC,8DAAiC,CAAA;IACjC,kEAAqC,CAAA;IACrC,sEAAyC,CAAA;AAC7C,CAAC,EALW,yBAAyB,yCAAzB,yBAAyB,QAKpC"}
|
|
@@ -18,36 +18,36 @@ export declare class A_Concept<_Features extends A_Container<any>[] = any> {
|
|
|
18
18
|
/**
|
|
19
19
|
* Load the concept. This step runs before any other steps to ensure that all components are loaded.
|
|
20
20
|
*/
|
|
21
|
-
static
|
|
21
|
+
static Load(): (target: A_Container<any> | import("../A-Component/A-Component.class").A_Component, propertyKey: string, descriptor: import("../../..").A_TYPES__A_AbstractionDecoratorDescriptor) => void;
|
|
22
22
|
/**
|
|
23
23
|
* Publish the concept to ADAAS platform. (Or any other place defined in the concept)
|
|
24
24
|
*
|
|
25
25
|
* [!] To extend the logic just create a custom containers and override the default behavior.
|
|
26
26
|
*/
|
|
27
|
-
static
|
|
27
|
+
static Publish(): (target: A_Container<any> | import("../A-Component/A-Component.class").A_Component, propertyKey: string, descriptor: import("../../..").A_TYPES__A_AbstractionDecoratorDescriptor) => void;
|
|
28
28
|
/**
|
|
29
29
|
* Deploy the concept to the environment.
|
|
30
30
|
*/
|
|
31
|
-
static
|
|
31
|
+
static Deploy(): (target: A_Container<any> | import("../A-Component/A-Component.class").A_Component, propertyKey: string, descriptor: import("../../..").A_TYPES__A_AbstractionDecoratorDescriptor) => void;
|
|
32
32
|
/**
|
|
33
33
|
* Compiles the Concept in case there are some containers that require that.
|
|
34
34
|
*
|
|
35
35
|
* Can be used for static websites or any other concept that requires a build step.
|
|
36
36
|
*
|
|
37
37
|
*/
|
|
38
|
-
static
|
|
38
|
+
static Build(): (target: A_Container<any> | import("../A-Component/A-Component.class").A_Component, propertyKey: string, descriptor: import("../../..").A_TYPES__A_AbstractionDecoratorDescriptor) => void;
|
|
39
39
|
/**
|
|
40
40
|
* Main execution of the concept.
|
|
41
41
|
*/
|
|
42
|
-
static
|
|
42
|
+
static Run(): (target: A_Container<any> | import("../A-Component/A-Component.class").A_Component, propertyKey: string, descriptor: import("../../..").A_TYPES__A_AbstractionDecoratorDescriptor) => void;
|
|
43
43
|
/**
|
|
44
44
|
* Start the concept. Uses for servers or any other background services.
|
|
45
45
|
*/
|
|
46
|
-
static
|
|
46
|
+
static Start(): (target: A_Container<any> | import("../A-Component/A-Component.class").A_Component, propertyKey: string, descriptor: import("../../..").A_TYPES__A_AbstractionDecoratorDescriptor) => void;
|
|
47
47
|
/**
|
|
48
48
|
* Stop the concept. Uses for servers or any other background services.
|
|
49
49
|
*/
|
|
50
|
-
static
|
|
50
|
+
static Stop(): (target: A_Container<any> | import("../A-Component/A-Component.class").A_Component, propertyKey: string, descriptor: import("../../..").A_TYPES__A_AbstractionDecoratorDescriptor) => void;
|
|
51
51
|
protected containers: A_Container<any>[];
|
|
52
52
|
constructor(props: A_TYPES__IConceptConstructor<_Features>);
|
|
53
53
|
get namespace(): string;
|
|
@@ -13,7 +13,7 @@ exports.A_Concept = void 0;
|
|
|
13
13
|
const A_Concept_types_1 = require("./A_Concept.types");
|
|
14
14
|
const A_Context_class_1 = require("../A-Context/A-Context.class");
|
|
15
15
|
const A_Container_types_1 = require("../A-Container/A-Container.types");
|
|
16
|
-
const
|
|
16
|
+
const A_Abstraction_decorator_1 = require("../../decorators/A-Abstraction/A-Abstraction.decorator");
|
|
17
17
|
// export type RunParams<T> = T extends A_Container<any, infer Params> ? Params : never;
|
|
18
18
|
/**
|
|
19
19
|
* A_Concept is a placeholder for the concept of the ani program.
|
|
@@ -34,22 +34,22 @@ class A_Concept {
|
|
|
34
34
|
/**
|
|
35
35
|
* Load the concept. This step runs before any other steps to ensure that all components are loaded.
|
|
36
36
|
*/
|
|
37
|
-
static
|
|
38
|
-
return (0,
|
|
37
|
+
static Load() {
|
|
38
|
+
return (0, A_Abstraction_decorator_1.A_Abstraction)(A_Concept_types_1.A_TYPES__ConceptStage.Load);
|
|
39
39
|
}
|
|
40
40
|
/**
|
|
41
41
|
* Publish the concept to ADAAS platform. (Or any other place defined in the concept)
|
|
42
42
|
*
|
|
43
43
|
* [!] To extend the logic just create a custom containers and override the default behavior.
|
|
44
44
|
*/
|
|
45
|
-
static
|
|
46
|
-
return (0,
|
|
45
|
+
static Publish() {
|
|
46
|
+
return (0, A_Abstraction_decorator_1.A_Abstraction)(A_Concept_types_1.A_TYPES__ConceptStage.Publish);
|
|
47
47
|
}
|
|
48
48
|
/**
|
|
49
49
|
* Deploy the concept to the environment.
|
|
50
50
|
*/
|
|
51
|
-
static
|
|
52
|
-
return (0,
|
|
51
|
+
static Deploy() {
|
|
52
|
+
return (0, A_Abstraction_decorator_1.A_Abstraction)(A_Concept_types_1.A_TYPES__ConceptStage.Deploy);
|
|
53
53
|
}
|
|
54
54
|
/**
|
|
55
55
|
* Compiles the Concept in case there are some containers that require that.
|
|
@@ -57,26 +57,26 @@ class A_Concept {
|
|
|
57
57
|
* Can be used for static websites or any other concept that requires a build step.
|
|
58
58
|
*
|
|
59
59
|
*/
|
|
60
|
-
static
|
|
61
|
-
return (0,
|
|
60
|
+
static Build() {
|
|
61
|
+
return (0, A_Abstraction_decorator_1.A_Abstraction)(A_Concept_types_1.A_TYPES__ConceptStage.Build);
|
|
62
62
|
}
|
|
63
63
|
/**
|
|
64
64
|
* Main execution of the concept.
|
|
65
65
|
*/
|
|
66
|
-
static
|
|
67
|
-
return (0,
|
|
66
|
+
static Run() {
|
|
67
|
+
return (0, A_Abstraction_decorator_1.A_Abstraction)(A_Concept_types_1.A_TYPES__ConceptStage.Run);
|
|
68
68
|
}
|
|
69
69
|
/**
|
|
70
70
|
* Start the concept. Uses for servers or any other background services.
|
|
71
71
|
*/
|
|
72
|
-
static
|
|
73
|
-
return (0,
|
|
72
|
+
static Start() {
|
|
73
|
+
return (0, A_Abstraction_decorator_1.A_Abstraction)(A_Concept_types_1.A_TYPES__ConceptStage.Start);
|
|
74
74
|
}
|
|
75
75
|
/**
|
|
76
76
|
* Stop the concept. Uses for servers or any other background services.
|
|
77
77
|
*/
|
|
78
|
-
static
|
|
79
|
-
return (0,
|
|
78
|
+
static Stop() {
|
|
79
|
+
return (0, A_Abstraction_decorator_1.A_Abstraction)(A_Concept_types_1.A_TYPES__ConceptStage.Stop);
|
|
80
80
|
}
|
|
81
81
|
constructor(props) {
|
|
82
82
|
this.props = props;
|
|
@@ -142,29 +142,29 @@ class A_Concept {
|
|
|
142
142
|
}
|
|
143
143
|
runStage(method, params) {
|
|
144
144
|
return __awaiter(this, void 0, void 0, function* () {
|
|
145
|
-
const
|
|
145
|
+
const abstractions = [];
|
|
146
146
|
this.containers.map(container => {
|
|
147
147
|
const meta = A_Context_class_1.A_Context.meta(container);
|
|
148
|
-
const
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
148
|
+
const containerAbstractions = meta
|
|
149
|
+
.abstractions(method)
|
|
150
|
+
.map(step => (Object.assign({ component: container }, step)));
|
|
151
|
+
const containerScope = A_Context_class_1.A_Context.scope(container);
|
|
152
|
+
const componentsAbstractions = containerScope.components
|
|
153
|
+
.map(component => A_Context_class_1.A_Context.meta(component).abstractions(method).map(step => (Object.assign({ component }, step))))
|
|
154
|
+
.flat();
|
|
155
|
+
abstractions.push({
|
|
156
|
+
container,
|
|
157
|
+
runners: [
|
|
158
|
+
...containerAbstractions.map(step => (Object.assign(Object.assign({}, step), { component: container }))),
|
|
159
|
+
...componentsAbstractions
|
|
160
|
+
]
|
|
161
|
+
});
|
|
159
162
|
});
|
|
160
163
|
const scope = A_Context_class_1.A_Context.allocate(this, {
|
|
161
164
|
components: params.components,
|
|
162
165
|
fragments: params.fragments,
|
|
163
166
|
parent: A_Context_class_1.A_Context.scope(this)
|
|
164
167
|
});
|
|
165
|
-
for (const stage of stages) {
|
|
166
|
-
yield stage.container[stage.name](params);
|
|
167
|
-
}
|
|
168
168
|
});
|
|
169
169
|
}
|
|
170
170
|
execute(params) {
|
|
@@ -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;AAIzD,wEAA6E;AAC7E
|
|
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,+GAAkG;AAOlG,wFAAwF;AAIxF;;;;;;;;;;;GAWG;AACH,MAAa,SAAS;IAIlB,iFAAiF;IACjF,iFAAiF;IACjF,iFAAiF;IACjF;;OAEG;IACH,MAAM,CAAC,IAAI;QACP,OAAO,IAAA,uCAAa,EAAC,uCAAqB,CAAC,IAAI,CAAC,CAAC;IACrD,CAAC;IAED;;;;OAIG;IACH,MAAM,CAAC,OAAO;QACV,OAAO,IAAA,uCAAa,EAAC,uCAAqB,CAAC,OAAO,CAAC,CAAC;IACxD,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,MAAM;QACT,OAAO,IAAA,uCAAa,EAAC,uCAAqB,CAAC,MAAM,CAAC,CAAC;IACvD,CAAC;IAED;;;;;OAKG;IACH,MAAM,CAAC,KAAK;QACR,OAAO,IAAA,uCAAa,EAAC,uCAAqB,CAAC,KAAK,CAAC,CAAC;IACtD,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,GAAG;QACN,OAAO,IAAA,uCAAa,EAAC,uCAAqB,CAAC,GAAG,CAAC,CAAC;IACpD,CAAC;IAED;;OAEG;I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AM,CAAC,UAAU,IAAI,EAAE,CAAC;YAG1C,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE;gBAC5B,MAAM,IAAI,GAAG,2BAAS,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;gBAEvC,IAAI,CAAC,GAAG,CAAC,6CAAyB,CAAC,QAAQ,CAAC,CAAA;YAEhD,CAAC,CAAC,CAAC;QAGP,CAAC;KAAA;CAEJ;AAjOD,8BAiOC"}
|
|
@@ -1,5 +1,9 @@
|
|
|
1
|
+
import { A_TYPES__A_InjectDecorator_Meta } from "../../decorators/A-Inject/A-Inject.decorator.types";
|
|
1
2
|
import { A_Container } from "../A-Container/A-Container.class";
|
|
2
3
|
import { A_Fragment } from "../A-Fragment/A-Fragment.class";
|
|
4
|
+
import { A_Entity } from "../A-Entity/A-Entity.class";
|
|
5
|
+
import { A_Component } from "../A-Component/A-Component.class";
|
|
6
|
+
import { A_TYPES__A_ExtendDecorator_BehaviorConfig } from "../../decorators/A-Feature/A-Feature.decorator.types";
|
|
3
7
|
export declare enum A_TYPES__ConceptStage {
|
|
4
8
|
Run = "run",
|
|
5
9
|
Build = "build",
|
|
@@ -26,16 +30,52 @@ export interface A_TYPES__IConceptConstructor<T extends Array<A_Container<any>>>
|
|
|
26
30
|
*/
|
|
27
31
|
containers?: T;
|
|
28
32
|
}
|
|
33
|
+
/**
|
|
34
|
+
* Uses as a transfer object to pass configurations to Feature constructor
|
|
35
|
+
*/
|
|
36
|
+
export type A_TYPES__ConceptAbstractionMeta = {
|
|
37
|
+
/**
|
|
38
|
+
* The name of original Extension Definition
|
|
39
|
+
*/
|
|
40
|
+
name: string;
|
|
41
|
+
/**
|
|
42
|
+
* The name of the handler that will be used to apply the extension
|
|
43
|
+
*/
|
|
44
|
+
handler: string;
|
|
45
|
+
/**
|
|
46
|
+
* The arguments that will be passed to the handler
|
|
47
|
+
*/
|
|
48
|
+
args: A_TYPES__A_InjectDecorator_Meta;
|
|
49
|
+
} & A_TYPES__A_ExtendDecorator_BehaviorConfig;
|
|
50
|
+
/**
|
|
51
|
+
* Uses to define the extension that will be applied to the Concept
|
|
52
|
+
*/
|
|
53
|
+
export type A_TYPES__ConceptAbstraction = {
|
|
54
|
+
/**
|
|
55
|
+
* The name of original Extension Definition
|
|
56
|
+
*/
|
|
57
|
+
name: string;
|
|
58
|
+
/**
|
|
59
|
+
* The name of the handler that will be used to apply the extension
|
|
60
|
+
*/
|
|
61
|
+
handler: string;
|
|
62
|
+
} & A_TYPES__A_ExtendDecorator_BehaviorConfig;
|
|
29
63
|
export type A_TYPES__ConceptStageParams = {
|
|
30
64
|
fragments: Array<A_Fragment>;
|
|
31
65
|
components: Array<{
|
|
32
|
-
new (...args: any[]):
|
|
66
|
+
new (...args: any[]): A_Component;
|
|
67
|
+
}>;
|
|
68
|
+
entities: Array<{
|
|
69
|
+
new (...args: any[]): A_Entity;
|
|
33
70
|
}>;
|
|
34
71
|
};
|
|
35
72
|
export type A_TYPES__ConceptCallParams<T extends string> = {
|
|
36
73
|
name: T;
|
|
37
74
|
fragments: Array<A_Fragment>;
|
|
38
75
|
components: Array<{
|
|
39
|
-
new (...args: any[]):
|
|
76
|
+
new (...args: any[]): A_Component;
|
|
77
|
+
}>;
|
|
78
|
+
entities: Array<{
|
|
79
|
+
new (...args: any[]): A_Entity<any, any, any>;
|
|
40
80
|
}>;
|
|
41
81
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"A_Concept.types.js","sourceRoot":"","sources":["../../../../src/global/A-Concept/A_Concept.types.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"A_Concept.types.js","sourceRoot":"","sources":["../../../../src/global/A-Concept/A_Concept.types.ts"],"names":[],"mappings":";;;AAQA,IAAY,qBAQX;AARD,WAAY,qBAAqB;IAC7B,oCAAW,CAAA;IACX,wCAAe,CAAA;IACf,4CAAmB,CAAA;IACnB,0CAAiB,CAAA;IACjB,sCAAa,CAAA;IACb,wCAAe,CAAA;IACf,sCAAa,CAAA;AACjB,CAAC,EARW,qBAAqB,qCAArB,qBAAqB,QAQhC;AAGD,uCAAuC;AACvC,6FAA6F;AAC7F,iDAAiD;AACjD,oDAAoD;AACpD,yCAAyC;AACzC,8BAA8B;AAC9B,oDAAoD;AACpD,kDAAkD;AAClD,WAAW;AAEX,IAAI;AAEJ,IAAY,uBAEX;AAFD,WAAY,uBAAuB;IAC/B,+DAAoC,CAAA;AACxC,CAAC,EAFW,uBAAuB,uCAAvB,uBAAuB,QAElC"}
|
|
@@ -13,7 +13,7 @@ import { A_TYPES__FeatureConstructor } from "../A-Feature/A-Feature.types";
|
|
|
13
13
|
* - Microservice
|
|
14
14
|
* - etc.
|
|
15
15
|
*/
|
|
16
|
-
export declare class A_Container<_FeatureNames extends Array<string
|
|
16
|
+
export declare class A_Container<_FeatureNames extends Array<string> = any> {
|
|
17
17
|
protected readonly config: Partial<A_TYPES__ContainerConstructor<_FeatureNames>>;
|
|
18
18
|
/**
|
|
19
19
|
* Promise that will be resolved when the container is ready to be used.
|
|
@@ -27,13 +27,6 @@ export declare class A_Container<_FeatureNames extends Array<string>> {
|
|
|
27
27
|
* Configuration of the container that will be used to run it.
|
|
28
28
|
*/
|
|
29
29
|
config: Partial<A_TYPES__ContainerConstructor<_FeatureNames>>);
|
|
30
|
-
protected hasInherited(cl: {
|
|
31
|
-
new (...args: any[]): any;
|
|
32
|
-
}): boolean;
|
|
33
|
-
/**
|
|
34
|
-
* Initializes the Namespace or can be used to reinitialize the Namespace
|
|
35
|
-
*/
|
|
36
|
-
private init;
|
|
37
30
|
/**
|
|
38
31
|
* This method allows to call the lifecycle method of the container as well as any other Feature defined for it
|
|
39
32
|
*
|
|
@@ -41,36 +41,6 @@ class A_Container {
|
|
|
41
41
|
const components = config.components || [];
|
|
42
42
|
const fragments = config.fragments || [];
|
|
43
43
|
A_Context_class_1.A_Context.allocate(this, config);
|
|
44
|
-
/**
|
|
45
|
-
* Run Async Initialization
|
|
46
|
-
*/
|
|
47
|
-
this.init();
|
|
48
|
-
}
|
|
49
|
-
hasInherited(cl) {
|
|
50
|
-
return this.constructor === cl
|
|
51
|
-
? false
|
|
52
|
-
: true;
|
|
53
|
-
}
|
|
54
|
-
/**
|
|
55
|
-
* Initializes the Namespace or can be used to reinitialize the Namespace
|
|
56
|
-
*/
|
|
57
|
-
init() {
|
|
58
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
59
|
-
if (!this.ready)
|
|
60
|
-
this.ready = new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
|
61
|
-
try {
|
|
62
|
-
yield this.onBeforeInit();
|
|
63
|
-
yield this.onInit();
|
|
64
|
-
yield this.onAfterInit();
|
|
65
|
-
return resolve();
|
|
66
|
-
}
|
|
67
|
-
catch (error) {
|
|
68
|
-
return reject(error);
|
|
69
|
-
}
|
|
70
|
-
}));
|
|
71
|
-
else
|
|
72
|
-
yield this.ready;
|
|
73
|
-
});
|
|
74
44
|
}
|
|
75
45
|
call(param1, param2) {
|
|
76
46
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -80,7 +50,7 @@ class A_Container {
|
|
|
80
50
|
const params = typeof param1 === 'string'
|
|
81
51
|
? param2 || {}
|
|
82
52
|
: param1;
|
|
83
|
-
const newFeature = A_Context_class_1.A_Context.feature(this
|
|
53
|
+
const newFeature = A_Context_class_1.A_Context.feature(A_Context_class_1.A_Context.scope(this), this, feature, params);
|
|
84
54
|
return yield newFeature.process();
|
|
85
55
|
});
|
|
86
56
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"A-Container.class.js","sourceRoot":"","sources":["../../../../src/global/A-Container/A-Container.class.ts"],"names":[],"mappings":";;;;;;;;;;;;AAEA,kEAAyD;AAMzD;;;;;;;;;;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;
|
|
1
|
+
{"version":3,"file":"A-Container.class.js","sourceRoot":"","sources":["../../../../src/global/A-Container/A-Container.class.ts"],"names":[],"mappings":";;;;;;;;;;;;AAEA,kEAAyD;AAMzD;;;;;;;;;;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;IAGrC,CAAC;IAkCK,IAAI,CACN,MAAyH,EACzH,MAAqE;;YAGrE,MAAM,OAAO,GAAW,OAAO,MAAM,KAAK,QAAQ;gBAC9C,CAAC,CAAC,MAAM;gBACR,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC;YAClB,MAAM,MAAM,GAAiE,OAAO,MAAM,KAAK,QAAQ;gBACnG,CAAC,CAAC,MAAM,IAAI,EAAE;gBACd,CAAC,CAAC,MAAM,CAAC;YAEb,MAAM,UAAU,GAAG,2BAAS,CAAC,OAAO,CAAC,2BAAS,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;YAEnF,OAAO,MAAM,UAAU,CAAC,OAAO,EAAE,CAAC;QACtC,CAAC;KAAA;IAkCD,OAAO,CACH,MAAyH,EACzH,MAAqE;QAGrE,MAAM,OAAO,GAAW,OAAO,MAAM,KAAK,QAAQ;YAC9C,CAAC,CAAC,MAAM;YACR,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC;QAClB,MAAM,MAAM,GAAiE,OAAO,MAAM,KAAK,QAAQ;YACnG,CAAC,CAAC,MAAM,IAAI,EAAE;YACd,CAAC,CAAC,MAAM,CAAC;QAEb,OAAO,2BAAS,CAAC,iBAAiB,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;IAC1E,CAAC;IAID,iEAAiE;IACjE,iEAAiE;IACjE,iEAAiE;IAEjE;;;;OAIG;IACa,YAAY;;YACxB,OAAO;QACX,CAAC;KAAA;IAED;;OAEG;IACa,MAAM;;YAClB,OAAO;QACX,CAAC;KAAA;IAED;;;;OAIG;IACa,WAAW;;YACvB,OAAO;QACX,CAAC;KAAA;CAEJ;AAxKD,kCAwKC"}
|
|
@@ -1,4 +1,12 @@
|
|
|
1
|
+
import { A_TYPES__ConceptAbstractionMeta, A_TYPES__ConceptStage } from "../A-Concept/A_Concept.types";
|
|
1
2
|
import { A_Meta } from "../A-Meta/A-Meta.class";
|
|
2
3
|
import { A_TYPES__ContainerMeta } from "./A-Container.types";
|
|
3
4
|
export declare class A_ContainerMeta extends A_Meta<A_TYPES__ContainerMeta> {
|
|
5
|
+
/**
|
|
6
|
+
* Returns a set of instructions to run proper methods in Container during A-Concept Stage
|
|
7
|
+
*
|
|
8
|
+
* @param stage
|
|
9
|
+
* @returns
|
|
10
|
+
*/
|
|
11
|
+
abstractions(abstraction: A_TYPES__ConceptStage): A_TYPES__ConceptAbstractionMeta[];
|
|
4
12
|
}
|