@adaas/a-concept 0.0.29 → 0.0.30
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/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-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 +28 -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 +8 -0
- package/dist/src/global/A-Component/A-Component.meta.js +27 -1
- package/dist/src/global/A-Component/A-Component.meta.js.map +1 -1
- package/dist/src/global/A-Component/A-Component.types.d.ts +19 -34
- 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 +23 -7
- 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 +6 -35
- 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 +4 -5
- 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 +176 -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 +83 -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/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-Extend.decorator.ts +10 -0
- package/src/decorators/A-Feature/A-Feature.decorator.types.ts +36 -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 +42 -1
- package/src/global/A-Component/A-Component.types.ts +20 -40
- 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 +28 -7
- package/src/global/A-Context/A-Context.class.ts +9 -49
- package/src/global/A-Entity/A-Entity.class.ts +8 -6
- package/src/global/A-Entity/A-Entity.types.ts +4 -5
- 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 +225 -0
- package/src/global/A-Stage/A-Stage.types.ts +106 -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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"A-Context.class.js","sourceRoot":"","sources":["../../../../src/global/A-Context/A-Context.class.ts"],"names":[],"mappings":";;;AAAA,4CAAuF;AACvF,wEAA+D;AAC/D,qEAA4D;AAC5D,kEAAyD;AACzD,wEAA+D;AAC/D,4DAAmD;AAEnD,yDAAgD;AAChD,sEAAkE;AAClE,sEAAkE;AAClE,kEAAyD;AAEzD,+DAAsD;AACtD,6DAAyD;
|
|
1
|
+
{"version":3,"file":"A-Context.class.js","sourceRoot":"","sources":["../../../../src/global/A-Context/A-Context.class.ts"],"names":[],"mappings":";;;AAAA,4CAAuF;AACvF,wEAA+D;AAC/D,qEAA4D;AAC5D,kEAAyD;AACzD,wEAA+D;AAC/D,4DAAmD;AAEnD,yDAAgD;AAChD,sEAAkE;AAClE,sEAAkE;AAClE,kEAAyD;AAEzD,+DAAsD;AACtD,6DAAyD;AAKzD;;;;;;GAMG;AACH,MAAa,SAAS;IAsDlB;QAlDA;;WA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ON, A_TYPES__EntityBaseMethod, A_TYPES__EntityBaseMethods, A_TYPES__EntityCallParams, A_TYPES__IEntity } from "./A-Entity.types";
|
|
3
|
-
import { A_Fragment } from "../A-Fragment/A-Fragment.class";
|
|
4
3
|
/**
|
|
5
4
|
* A_Entity is another abstraction that describes all major participants in the system business logic.
|
|
6
5
|
* Each Entity should have a clear definition and a clear set of responsibilities.
|
|
@@ -8,7 +7,7 @@ import { A_Fragment } from "../A-Fragment/A-Fragment.class";
|
|
|
8
7
|
*
|
|
9
8
|
* Each entity should be connected to the ContextFragment (Scope) and should be able to communicate with other entities.
|
|
10
9
|
*/
|
|
11
|
-
export declare class A_Entity<_ConstructorType = any, _SerializedType extends A_TYPES__Entity_JSON = A_TYPES__Entity_JSON, _FeatureNames extends Array<string | A_TYPES__EntityBaseMethod> = A_TYPES__EntityBaseMethods>
|
|
10
|
+
export declare class A_Entity<_ConstructorType = any, _SerializedType extends A_TYPES__Entity_JSON = A_TYPES__Entity_JSON, _FeatureNames extends Array<string | A_TYPES__EntityBaseMethod> = A_TYPES__EntityBaseMethods> implements A_TYPES__IEntity {
|
|
12
11
|
aseid: ASEID;
|
|
13
12
|
/**
|
|
14
13
|
* Entity Identifier that corresponds to the class name
|
|
@@ -14,7 +14,6 @@ const a_utils_1 = require("@adaas/a-utils");
|
|
|
14
14
|
const A_Entity_types_1 = require("./A-Entity.types");
|
|
15
15
|
const errors_constants_1 = require("@adaas/a-utils/dist/src/constants/errors.constants");
|
|
16
16
|
const A_Context_class_1 = require("../A-Context/A-Context.class");
|
|
17
|
-
const A_Fragment_class_1 = require("../A-Fragment/A-Fragment.class");
|
|
18
17
|
/**
|
|
19
18
|
* A_Entity is another abstraction that describes all major participants in the system business logic.
|
|
20
19
|
* Each Entity should have a clear definition and a clear set of responsibilities.
|
|
@@ -22,7 +21,7 @@ const A_Fragment_class_1 = require("../A-Fragment/A-Fragment.class");
|
|
|
22
21
|
*
|
|
23
22
|
* Each entity should be connected to the ContextFragment (Scope) and should be able to communicate with other entities.
|
|
24
23
|
*/
|
|
25
|
-
class A_Entity
|
|
24
|
+
class A_Entity {
|
|
26
25
|
/**
|
|
27
26
|
* Entity Identifier that corresponds to the class name
|
|
28
27
|
*/
|
|
@@ -33,7 +32,6 @@ class A_Entity extends A_Fragment_class_1.A_Fragment {
|
|
|
33
32
|
.replace(/_/g, '-');
|
|
34
33
|
}
|
|
35
34
|
constructor(props) {
|
|
36
|
-
super();
|
|
37
35
|
switch (true) {
|
|
38
36
|
case (typeof props === 'string' && a_utils_1.ASEID.isASEID(props)):
|
|
39
37
|
this.aseid = new a_utils_1.ASEID(props);
|
|
@@ -105,6 +103,7 @@ class A_Entity extends A_Fragment_class_1.A_Fragment {
|
|
|
105
103
|
const params = typeof param1 === 'string'
|
|
106
104
|
? param2 || {}
|
|
107
105
|
: param1;
|
|
106
|
+
console.log('WTF???? ', A_Context_class_1.A_Context.scope(this));
|
|
108
107
|
const newFeature = A_Context_class_1.A_Context.feature(A_Context_class_1.A_Context.scope(this), this, feature, params);
|
|
109
108
|
return yield newFeature.process();
|
|
110
109
|
});
|
|
@@ -115,7 +114,7 @@ class A_Entity extends A_Fragment_class_1.A_Fragment {
|
|
|
115
114
|
load() {
|
|
116
115
|
return __awaiter(this, void 0, void 0, function* () {
|
|
117
116
|
yield this.call(A_Entity_types_1.A_TYPES__EntityBaseMethod.DESTROY, {
|
|
118
|
-
|
|
117
|
+
entities: [
|
|
119
118
|
this
|
|
120
119
|
]
|
|
121
120
|
});
|
|
@@ -124,16 +123,16 @@ class A_Entity extends A_Fragment_class_1.A_Fragment {
|
|
|
124
123
|
destroy() {
|
|
125
124
|
return __awaiter(this, void 0, void 0, function* () {
|
|
126
125
|
yield this.call(A_Entity_types_1.A_TYPES__EntityBaseMethod.DESTROY, {
|
|
127
|
-
|
|
126
|
+
entities: [
|
|
128
127
|
this
|
|
129
|
-
]
|
|
128
|
+
],
|
|
130
129
|
});
|
|
131
130
|
});
|
|
132
131
|
}
|
|
133
132
|
save() {
|
|
134
133
|
return __awaiter(this, void 0, void 0, function* () {
|
|
135
134
|
yield this.call(A_Entity_types_1.A_TYPES__EntityBaseMethod.SAVE, {
|
|
136
|
-
|
|
135
|
+
entities: [
|
|
137
136
|
this
|
|
138
137
|
]
|
|
139
138
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"A-Entity.class.js","sourceRoot":"","sources":["../../../../src/global/A-Entity/A-Entity.class.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,4CAIwB;AACxB,qDAM0B;AAC1B,yFAAiG;AACjG,kEAAyD;
|
|
1
|
+
{"version":3,"file":"A-Entity.class.js","sourceRoot":"","sources":["../../../../src/global/A-Entity/A-Entity.class.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,4CAIwB;AACxB,qDAM0B;AAC1B,yFAAiG;AACjG,kEAAyD;AAKzD;;;;;;GAMG;AACH,MAAa,QAAQ;IAUjB;;OAEG;IACH,MAAM,KAAK,MAAM;QACb,OAAO,wBAAc;aAChB,gBAAgB,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC;aACvC,iBAAiB,EAAE;aACnB,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;IAC5B,CAAC;IAcD,YAAY,KAA0D;QAGlE,QAAQ,IAAI,EAAE,CAAC;YACX,KAAK,CAAC,OAAO,KAAK,KAAK,QAAQ,IAAI,eAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;gBACpD,IAAI,CAAC,KAAK,GAAG,IAAI,eAAK,CAAC,KAAK,CAAC,CAAC;gBAC9B,MAAM;YACV,KAAK,CAAC,KAAK,YAAY,eAAK,CAAC;gBACzB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;gBACnB,MAAM;YACV,KAAK,CAAC,CAAC,CAAC,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,OAAO,IAAI,KAAK,CAAC;gBAC3D,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,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@adaas/a-utils";
|
|
2
2
|
import { A_Meta } from "../A-Meta/A-Meta.class";
|
|
3
3
|
import { A_Fragment } from "../A-Fragment/A-Fragment.class";
|
|
4
|
+
import { A_TYPES__A_ExtendDecorator_Meta } from "../../decorators/A-Feature/A-Feature.decorator.types";
|
|
5
|
+
import { A_Entity } from "./A-Entity.class";
|
|
4
6
|
export type A_TYPES__EntityCallParams<T extends string> = {
|
|
5
7
|
name: T;
|
|
6
8
|
fragments: Array<A_Fragment>;
|
|
9
|
+
entities: Array<A_Entity<any, any, any>>;
|
|
7
10
|
components: Array<{
|
|
8
11
|
new (...args: any[]): any;
|
|
9
12
|
}>;
|
|
@@ -39,7 +42,7 @@ export type A_TYPES__EntityMeta = {
|
|
|
39
42
|
*
|
|
40
43
|
* Where value is the extension instructions
|
|
41
44
|
*/
|
|
42
|
-
[Key: string]:
|
|
45
|
+
[Key: string]: A_TYPES__A_ExtendDecorator_Meta[];
|
|
43
46
|
}>;
|
|
44
47
|
case: any;
|
|
45
48
|
[A_TYPES__EntityMetaKey.FEATURES]: any[];
|
|
@@ -48,7 +51,3 @@ export declare enum A_TYPES__EntityMetaKey {
|
|
|
48
51
|
EXTENSIONS = "a-component-extensions",
|
|
49
52
|
FEATURES = "a-component-features"
|
|
50
53
|
}
|
|
51
|
-
export type A_TYPES__EntityMeta_ExtensionItem = {
|
|
52
|
-
name: string;
|
|
53
|
-
handler: string;
|
|
54
|
-
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"A-Entity.types.js","sourceRoot":"","sources":["../../../../src/global/A-Entity/A-Entity.types.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"A-Entity.types.js","sourceRoot":"","sources":["../../../../src/global/A-Entity/A-Entity.types.ts"],"names":[],"mappings":";;;AAqBA,IAAY,yBAIX;AAJD,WAAY,yBAAyB;IACjC,0CAAa,CAAA;IACb,gDAAmB,CAAA;IACnB,0CAAa,CAAA;AACjB,CAAC,EAJW,yBAAyB,yCAAzB,yBAAyB,QAIpC;AAOA,CAAC;AAgCF,IAAY,sBAGX;AAHD,WAAY,sBAAsB;IAC9B,+DAAqC,CAAA;IACrC,2DAAiC,CAAA;AACrC,CAAC,EAHW,sBAAsB,sCAAtB,sBAAsB,QAGjC"}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { A_Feature_Define } from "../../decorators/A-Feature/A-Feature-Define.decorator";
|
|
2
|
-
import { A_TYPES__FeatureConstructor,
|
|
2
|
+
import { A_TYPES__FeatureConstructor, A_TYPES__FeatureState } from "./A-Feature.types";
|
|
3
3
|
import { A_Error, A_TYPES__Required } from "@adaas/a-utils";
|
|
4
4
|
import { A_TYPES__A_Feature_Extend } from "../../decorators/A-Feature/A-Feature.decorator.types";
|
|
5
|
+
import { A_Stage } from "../A-Stage/A-Stage.class";
|
|
6
|
+
import { StepsManager } from "../../helpers/StepsManager.class";
|
|
5
7
|
/**
|
|
6
8
|
* A_Feature is representing a feature that can be executed across multiple components
|
|
7
9
|
* This class stores the steps of the feature and executes them in order of appearance
|
|
@@ -19,9 +21,10 @@ export declare class A_Feature {
|
|
|
19
21
|
* Extend an existing A-Feature
|
|
20
22
|
*/
|
|
21
23
|
static get Extend(): A_TYPES__A_Feature_Extend;
|
|
22
|
-
protected
|
|
23
|
-
protected _current?:
|
|
24
|
+
protected stages: Array<A_Stage>;
|
|
25
|
+
protected _current?: A_Stage;
|
|
24
26
|
protected _index: number;
|
|
27
|
+
protected SM: StepsManager;
|
|
25
28
|
state: A_TYPES__FeatureState;
|
|
26
29
|
result?: any;
|
|
27
30
|
error?: A_Error;
|
|
@@ -31,17 +34,34 @@ export declare class A_Feature {
|
|
|
31
34
|
*
|
|
32
35
|
* @returns
|
|
33
36
|
*/
|
|
34
|
-
[Symbol.iterator](): Iterator<
|
|
35
|
-
|
|
37
|
+
[Symbol.iterator](): Iterator<A_Stage, any>;
|
|
38
|
+
/**
|
|
39
|
+
* Returns the current A-Feature Stage
|
|
40
|
+
*
|
|
41
|
+
*/
|
|
42
|
+
get stage(): A_Stage | undefined;
|
|
43
|
+
/**
|
|
44
|
+
* This method checks if the A-Feature is done
|
|
45
|
+
*
|
|
46
|
+
* @returns
|
|
47
|
+
*/
|
|
36
48
|
isDone(): boolean;
|
|
49
|
+
/**
|
|
50
|
+
* This method moves the feature to the next stage
|
|
51
|
+
*
|
|
52
|
+
* @param stage
|
|
53
|
+
*/
|
|
54
|
+
next(stage: any): void;
|
|
37
55
|
/**
|
|
38
56
|
* This method marks the feature as completed and returns the result
|
|
39
57
|
* Uses to interrupt or end the feature processing
|
|
40
58
|
*
|
|
59
|
+
* The result of the feature is a Scope Fragments
|
|
60
|
+
*
|
|
41
61
|
* @param result
|
|
42
62
|
* @returns
|
|
43
63
|
*/
|
|
44
|
-
completed<T extends any>(
|
|
64
|
+
completed<T extends any>(): Promise<T>;
|
|
45
65
|
/**
|
|
46
66
|
* This method marks the feature as failed and throws an error
|
|
47
67
|
* Uses to interrupt or end the feature processing
|
|
@@ -49,6 +69,10 @@ export declare class A_Feature {
|
|
|
49
69
|
* @param error
|
|
50
70
|
*/
|
|
51
71
|
failed(error: Error | A_Error | unknown): Promise<void>;
|
|
72
|
+
/**
|
|
73
|
+
* This method processes the feature by executing all the stages
|
|
74
|
+
*
|
|
75
|
+
*/
|
|
52
76
|
process(): Promise<void>;
|
|
53
77
|
protected errorHandler(error: Error | A_Error | unknown): Promise<void>;
|
|
54
78
|
}
|
|
@@ -15,6 +15,7 @@ const A_Feature_Extend_decorator_1 = require("../../decorators/A-Feature/A-Featu
|
|
|
15
15
|
const A_Feature_types_1 = require("./A-Feature.types");
|
|
16
16
|
const a_utils_1 = require("@adaas/a-utils");
|
|
17
17
|
const A_Context_class_1 = require("../A-Context/A-Context.class");
|
|
18
|
+
const StepsManager_class_1 = require("../../helpers/StepsManager.class");
|
|
18
19
|
/**
|
|
19
20
|
* A_Feature is representing a feature that can be executed across multiple components
|
|
20
21
|
* This class stores the steps of the feature and executes them in order of appearance
|
|
@@ -38,11 +39,12 @@ class A_Feature {
|
|
|
38
39
|
}
|
|
39
40
|
constructor(params) {
|
|
40
41
|
// protected scope: A_Scope
|
|
41
|
-
this.
|
|
42
|
+
this.stages = [];
|
|
42
43
|
this._index = 0;
|
|
43
44
|
this.state = A_Feature_types_1.A_TYPES__FeatureState.INITIALIZED;
|
|
44
|
-
|
|
45
|
-
this.
|
|
45
|
+
this.SM = new StepsManager_class_1.StepsManager(params.steps);
|
|
46
|
+
this.stages = this.SM.toStages(this);
|
|
47
|
+
this._current = this.stages[0];
|
|
46
48
|
A_Context_class_1.A_Context.allocate(this, params);
|
|
47
49
|
}
|
|
48
50
|
/**
|
|
@@ -54,55 +56,65 @@ class A_Feature {
|
|
|
54
56
|
return {
|
|
55
57
|
// Custom next method
|
|
56
58
|
next: () => {
|
|
57
|
-
if (this.
|
|
58
|
-
|
|
59
|
-
||
|
|
60
|
-
this.state === A_Feature_types_1.A_TYPES__FeatureState.COMPLETED) {
|
|
61
|
-
throw new Error('FEATURE_PROCESSING_INTERRUPTED');
|
|
62
|
-
}
|
|
63
|
-
this._current = this.steps[this._index];
|
|
64
|
-
const { component, handler, args } = this._current;
|
|
65
|
-
const instance = A_Context_class_1.A_Context.scope(this).resolve(component);
|
|
59
|
+
if (!this.isDone()) {
|
|
60
|
+
this._current = this.stages[this._index];
|
|
66
61
|
return {
|
|
67
|
-
value:
|
|
68
|
-
if (instance[handler]) {
|
|
69
|
-
const callArgs = args.map(arg =>
|
|
70
|
-
// In case if the target is a feature step then pass the current feature
|
|
71
|
-
a_utils_1.A_CommonHelper.isInheritedFrom(arg.target, A_Feature)
|
|
72
|
-
? this
|
|
73
|
-
: A_Context_class_1.A_Context.scope(this).resolve(arg.target));
|
|
74
|
-
yield instance[handler](...callArgs);
|
|
75
|
-
}
|
|
76
|
-
this._index++;
|
|
77
|
-
}),
|
|
62
|
+
value: this._current,
|
|
78
63
|
done: false
|
|
79
64
|
};
|
|
80
65
|
}
|
|
81
66
|
else {
|
|
82
67
|
this._current = undefined; // Reset current on end
|
|
83
|
-
return {
|
|
68
|
+
return {
|
|
69
|
+
value: undefined,
|
|
70
|
+
done: true
|
|
71
|
+
};
|
|
84
72
|
}
|
|
85
73
|
}
|
|
86
74
|
};
|
|
87
75
|
}
|
|
88
|
-
|
|
89
|
-
|
|
76
|
+
/**
|
|
77
|
+
* Returns the current A-Feature Stage
|
|
78
|
+
*
|
|
79
|
+
*/
|
|
80
|
+
get stage() {
|
|
90
81
|
return this._current;
|
|
91
82
|
}
|
|
92
|
-
|
|
83
|
+
/**
|
|
84
|
+
* This method checks if the A-Feature is done
|
|
85
|
+
*
|
|
86
|
+
* @returns
|
|
87
|
+
*/
|
|
93
88
|
isDone() {
|
|
94
|
-
return this.
|
|
89
|
+
return !this.stage
|
|
90
|
+
|| this._index >= this.stages.length
|
|
91
|
+
|| this.state === A_Feature_types_1.A_TYPES__FeatureState.COMPLETED
|
|
92
|
+
|| this.state === A_Feature_types_1.A_TYPES__FeatureState.FAILED;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* This method moves the feature to the next stage
|
|
96
|
+
*
|
|
97
|
+
* @param stage
|
|
98
|
+
*/
|
|
99
|
+
next(stage) {
|
|
100
|
+
const stageIndex = this.stages.indexOf(stage);
|
|
101
|
+
this._index = stageIndex + 1;
|
|
102
|
+
if (this._index >= this.stages.length) {
|
|
103
|
+
this.completed();
|
|
104
|
+
}
|
|
95
105
|
}
|
|
96
106
|
/**
|
|
97
107
|
* This method marks the feature as completed and returns the result
|
|
98
108
|
* Uses to interrupt or end the feature processing
|
|
99
109
|
*
|
|
110
|
+
* The result of the feature is a Scope Fragments
|
|
111
|
+
*
|
|
100
112
|
* @param result
|
|
101
113
|
* @returns
|
|
102
114
|
*/
|
|
103
|
-
completed(
|
|
115
|
+
completed() {
|
|
104
116
|
return __awaiter(this, void 0, void 0, function* () {
|
|
105
|
-
this.result =
|
|
117
|
+
this.result = A_Context_class_1.A_Context.scope(this).toJSON();
|
|
106
118
|
this.state = A_Feature_types_1.A_TYPES__FeatureState.COMPLETED;
|
|
107
119
|
return this.result;
|
|
108
120
|
});
|
|
@@ -120,18 +132,15 @@ class A_Feature {
|
|
|
120
132
|
yield this.errorHandler(error);
|
|
121
133
|
});
|
|
122
134
|
}
|
|
135
|
+
/**
|
|
136
|
+
* This method processes the feature by executing all the stages
|
|
137
|
+
*
|
|
138
|
+
*/
|
|
123
139
|
process() {
|
|
124
140
|
return __awaiter(this, void 0, void 0, function* () {
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
yield step();
|
|
129
|
-
}
|
|
130
|
-
yield this.completed();
|
|
131
|
-
}
|
|
132
|
-
catch (error) {
|
|
133
|
-
console.log('[!] Feature processing error:', error);
|
|
134
|
-
yield this.failed(error);
|
|
141
|
+
this.state = A_Feature_types_1.A_TYPES__FeatureState.PROCESSING;
|
|
142
|
+
for (const stage of this) {
|
|
143
|
+
yield stage.process();
|
|
135
144
|
}
|
|
136
145
|
});
|
|
137
146
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"A-Feature.class.js","sourceRoot":"","sources":["../../../../src/global/A-Feature/A-Feature.class.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,iHAAoG;AACpG,iHAAoG;AACpG,
|
|
1
|
+
{"version":3,"file":"A-Feature.class.js","sourceRoot":"","sources":["../../../../src/global/A-Feature/A-Feature.class.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,iHAAoG;AACpG,iHAAoG;AACpG,uDAAwF;AACxF,4CAA4D;AAC5D,kEAAyD;AAIzD,oFAA2E;AAI3E;;;;;;;GAOG;AACH,MAAa,SAAS;IAGlB;;OAEG;IACH,MAAM,KAAK,MAAM;QACb,OAAO,6CAAgB,CAAC;IAC5B,CAAC;IAGD;;OAEG;IACH,MAAM,KAAK,MAAM;QACb,OAAO,6CAAgB,CAAC;IAC5B,CAAC;IAeD,YACI,MAA0E;QAb9E,2BAA2B;QACjB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AAK,uCAAqB,CAAC,MAAM;oBAC9C,MAAM,IAAI,iBAAO,CAAC;wBACd,OAAO,EAAE,gCAAgC;wBACzC,IAAI,EAAE,gCAAgC;wBACtC,IAAI,EAAE;4BACF,OAAO,EAAE,IAAI;yBAChB;qBACJ,CAAC,CAAC;gBAGP,KAAK,KAAK,YAAY,KAAK;uBACpB,KAAK,CAAC,OAAO,KAAK,gCAAgC;uBAClD,IAAI,CAAC,KAAK,KAAK,uCAAqB,CAAC,SAAS;oBAEjD,aAAa;oBACb,MAAM;gBAEV;oBACI,MAAM,KAAK,CAAC;YACpB,CAAC;QACL,CAAC;KAAA;CACJ;AAlMD,8BAkMC"}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { A_Component } from "../A-Component/A-Component.class";
|
|
2
|
-
import { A_TYPES__ComponentMeta_InjectionParams } from "../A-Component/A-Component.types";
|
|
3
1
|
import { A_TYPES__ScopeConfig, A_TYPES__ScopeConstructor } from "../A-Scope/A-Scope.types";
|
|
2
|
+
import { A_TYPES__A_StageStep } from "../A-Stage/A-Stage.types";
|
|
4
3
|
export type A_TYPES__FeatureIteratorReturn<T extends any = any> = () => Promise<T>;
|
|
5
4
|
export type A_TYPES__FeatureConstructor = {
|
|
6
|
-
steps:
|
|
5
|
+
steps: A_TYPES__A_StageStep[];
|
|
7
6
|
} & A_TYPES__ScopeConstructor & A_TYPES__ScopeConfig;
|
|
8
7
|
export declare enum A_TYPES__FeatureState {
|
|
9
8
|
INITIALIZED = "INITIALIZED",
|
|
@@ -11,24 +10,3 @@ export declare enum A_TYPES__FeatureState {
|
|
|
11
10
|
COMPLETED = "COMPLETED",
|
|
12
11
|
FAILED = "FAILED"
|
|
13
12
|
}
|
|
14
|
-
export type A_TYPES__FeatureStep = {
|
|
15
|
-
/**
|
|
16
|
-
* The component to be called
|
|
17
|
-
*/
|
|
18
|
-
component: typeof A_Component;
|
|
19
|
-
/**
|
|
20
|
-
* The method to be called on the component
|
|
21
|
-
*/
|
|
22
|
-
handler: string;
|
|
23
|
-
/**
|
|
24
|
-
* Original Feature Extension name
|
|
25
|
-
*
|
|
26
|
-
* [!] could be string or regex
|
|
27
|
-
*
|
|
28
|
-
*/
|
|
29
|
-
name: string;
|
|
30
|
-
/**
|
|
31
|
-
* Arguments to be passed to the method
|
|
32
|
-
*/
|
|
33
|
-
args: A_TYPES__ComponentMeta_InjectionParams;
|
|
34
|
-
};
|
|
@@ -8,4 +8,25 @@ var A_TYPES__FeatureState;
|
|
|
8
8
|
A_TYPES__FeatureState["COMPLETED"] = "COMPLETED";
|
|
9
9
|
A_TYPES__FeatureState["FAILED"] = "FAILED";
|
|
10
10
|
})(A_TYPES__FeatureState || (exports.A_TYPES__FeatureState = A_TYPES__FeatureState = {}));
|
|
11
|
+
// export type A_TYPES__FeatureStep = {
|
|
12
|
+
// /**
|
|
13
|
+
// * The component to be called
|
|
14
|
+
// */
|
|
15
|
+
// component: typeof A_Component,
|
|
16
|
+
// /**
|
|
17
|
+
// * The method to be called on the component
|
|
18
|
+
// */
|
|
19
|
+
// handler: string,
|
|
20
|
+
// /**
|
|
21
|
+
// * Original Feature Extension name
|
|
22
|
+
// *
|
|
23
|
+
// * [!] could be string or regex
|
|
24
|
+
// *
|
|
25
|
+
// */
|
|
26
|
+
// name: string,
|
|
27
|
+
// /**
|
|
28
|
+
// * Arguments to be passed to the method
|
|
29
|
+
// */
|
|
30
|
+
// args: A_TYPES__A_InjectDecorator_Meta
|
|
31
|
+
// }
|
|
11
32
|
//# sourceMappingURL=A-Feature.types.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"A-Feature.types.js","sourceRoot":"","sources":["../../../../src/global/A-Feature/A-Feature.types.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"A-Feature.types.js","sourceRoot":"","sources":["../../../../src/global/A-Feature/A-Feature.types.ts"],"names":[],"mappings":";;;AAaA,IAAY,qBAMX;AAND,WAAY,qBAAqB;IAC7B,oDAA2B,CAAA;IAC3B,kDAAyB,CAAA;IAEzB,gDAAuB,CAAA;IACvB,0CAAiB,CAAA;AACrB,CAAC,EANW,qBAAqB,qCAArB,qBAAqB,QAMhC;AAGD,uCAAuC;AACvC,UAAU;AACV,oCAAoC;AACpC,UAAU;AACV,qCAAqC;AACrC,UAAU;AACV,kDAAkD;AAClD,UAAU;AACV,uBAAuB;AACvB,UAAU;AACV,yCAAyC;AACzC,UAAU;AACV,sCAAsC;AACtC,UAAU;AACV,UAAU;AACV,oBAAoB;AACpB,UAAU;AACV,8CAA8C;AAC9C,UAAU;AACV,4CAA4C;AAC5C,IAAI"}
|
|
@@ -101,6 +101,16 @@ class A_Fragment {
|
|
|
101
101
|
return;
|
|
102
102
|
});
|
|
103
103
|
}
|
|
104
|
+
/**
|
|
105
|
+
* Returns the JSON representation of the Fragment
|
|
106
|
+
*
|
|
107
|
+
* @returns
|
|
108
|
+
*/
|
|
109
|
+
toJSON() {
|
|
110
|
+
return {
|
|
111
|
+
name: this.name,
|
|
112
|
+
};
|
|
113
|
+
}
|
|
104
114
|
}
|
|
105
115
|
exports.A_Fragment = A_Fragment;
|
|
106
116
|
//# sourceMappingURL=A-Fragment.class.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"A-Fragment.class.js","sourceRoot":"","sources":["../../../../src/global/A-Fragment/A-Fragment.class.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,kEAAyD;AAIzD;;;;;;;GAOG;AACH,MAAa,UAAU;IAWnB,YAAY,SAAgD,EAAE;QAE1D,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC,IAAI,IAAI,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC;QAEjD;;WAEG;QACH,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC,IAAI,IAAI,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC;QAEjD;;WAEG;QACH,IAAI,CAAC,IAAI,EAAE,CAAC;IAChB,CAAC;IAKO,YAAY,CAAC,EAA2B;QAC5C,OAAO,IAAI,CAAC,WAAW,KAAK,EAAE;YAC1B,CAAC,CAAC,KAAK;YACP,CAAC,CAAC,IAAI,CAAA;IACd,CAAC;IAED;;OAEG;IACW,IAAI;;YACd,IAAI,CAAC,IAAI,CAAC,KAAK;gBACX,IAAI,CAAC,KAAK,GAAG,IAAI,OAAO,CAAC,CAAO,OAAO,EAAE,MAAM,EAAE,EAAE;oBAC/C,IAAI,CAAC;wBACD,MAAM,IAAI,CAAC,YAAY,EAAE,CAAC;wBAE1B,MAAM,IAAI,CAAC,MAAM,EAAE,CAAC;wBAEpB,MAAM,IAAI,CAAC,WAAW,EAAE,CAAC;wBAEzB,OAAO,OAAO,EAAE,CAAC;oBACrB,CAAC;oBAAC,OAAO,KAAK,EAAE,CAAC;wBACb,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC;oBACzB,CAAC;gBACL,CAAC,CAAA,CAAC,CAAC;;gBAEH,MAAM,IAAI,CAAC,KAAK,CAAC;QACzB,CAAC;KAAA;IAQD,iEAAiE;IACjE,iEAAiE;IACjE,iEAAiE;IAEjE;;;;OAIG;IACa,YAAY;;YACxB,OAAO;QACX,CAAC;KAAA;IAED;;OAEG;IACa,MAAM;;YAClB,8BAA8B;YAC9B,IAAI,2BAAS,CAAC,WAAW,KAAK,QAAQ,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,EAAE,CAAC;gBACvE,gDAAgD;gBAChD,+CAA+C;gBAC/C,0CAA0C;gBAC1C,oCAAoC;gBACpC,oCAAoC;gBACpC,MAAM;gBACN,mDAAmD;gBACnD,gDAAgD;gBAChD,oCAAoC;gBACpC,oCAAoC;gBACpC,MAAM;YACV,CAAC;QACL,CAAC;KAAA;IAED;;;;OAIG;IACa,WAAW;;YACvB,OAAO;QACX,CAAC;KAAA;CAEJ;
|
|
1
|
+
{"version":3,"file":"A-Fragment.class.js","sourceRoot":"","sources":["../../../../src/global/A-Fragment/A-Fragment.class.ts"],"names":[],"mappings":";;;;;;;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;gBACvE,gDAAgD;gBAChD,+CAA+C;gBAC/C,0CAA0C;gBAC1C,oCAAoC;gBACpC,oCAAoC;gBACpC,MAAM;gBACN,mDAAmD;gBACnD,gDAAgD;gBAChD,oCAAoC;gBACpC,oCAAoC;gBACpC,MAAM;YACV,CAAC;QACL,CAAC;KAAA;IAED;;;;OAIG;IACa,WAAW;;YACvB,OAAO;QACX,CAAC;KAAA;IAMD;;;;OAIG;IACH,MAAM;QACF,OAAO;YACH,IAAI,EAAE,IAAI,CAAC,IAAI;SAClB,CAAC;IACN,CAAC;CAEJ;AAxHD,gCAwHC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { A_TYPES__ScopeConfig, A_TYPES__ScopeConstructor } from "./A-Scope.types";
|
|
2
2
|
import { A_Fragment } from "../A-Fragment/A-Fragment.class";
|
|
3
|
-
import { A_TYPES__ComponentMeta_EntityInjectionInstructions, A_TYPES__ComponentMeta_InjectionParam } from "../A-Component/A-Component.types";
|
|
4
3
|
import { A_Component } from "../A-Component/A-Component.class";
|
|
5
4
|
import { A_Entity } from "../A-Entity/A-Entity.class";
|
|
5
|
+
import { A_TYPES__A_InjectDecorator_EntityInjectionInstructions, A_TYPES__A_InjectDecorator_Injectable } from "../../decorators/A-Inject/A-Inject.decorator.types";
|
|
6
6
|
/**
|
|
7
7
|
*
|
|
8
8
|
*
|
|
@@ -25,8 +25,9 @@ export declare class A_Scope {
|
|
|
25
25
|
protected params: A_TYPES__ScopeConstructor;
|
|
26
26
|
constructor(params: Partial<A_TYPES__ScopeConstructor>, config?: Partial<A_TYPES__ScopeConfig>);
|
|
27
27
|
private initComponents;
|
|
28
|
+
private initEntities;
|
|
28
29
|
private initFragments;
|
|
29
|
-
get components(): (new (...args: any[]) =>
|
|
30
|
+
get components(): (new (...args: any[]) => A_Component)[];
|
|
30
31
|
get fragments(): A_Fragment[];
|
|
31
32
|
/**
|
|
32
33
|
* This method is used to check if the component is available in the scope
|
|
@@ -43,11 +44,11 @@ export declare class A_Scope {
|
|
|
43
44
|
* @param component
|
|
44
45
|
* @returns
|
|
45
46
|
*/
|
|
46
|
-
resolve<T extends
|
|
47
|
+
resolve<T extends A_TYPES__A_InjectDecorator_Injectable>(component: T): InstanceType<T>;
|
|
47
48
|
resolve<T extends {
|
|
48
49
|
new (...args: any[]): A_Entity;
|
|
49
|
-
}>(entity: T, instructions: Partial<
|
|
50
|
-
resolve<T extends
|
|
50
|
+
}>(entity: T, instructions: Partial<A_TYPES__A_InjectDecorator_EntityInjectionInstructions>): InstanceType<T>;
|
|
51
|
+
resolve<T extends A_TYPES__A_InjectDecorator_Injectable>(component: Array<T>): Array<InstanceType<T>>;
|
|
51
52
|
private resolveOnce;
|
|
52
53
|
private resolveEntity;
|
|
53
54
|
private resolveFragment;
|
|
@@ -61,4 +62,5 @@ export declare class A_Scope {
|
|
|
61
62
|
register(entity: A_Entity): void;
|
|
62
63
|
register(component: A_Component): void;
|
|
63
64
|
register(fragment: A_Fragment): void;
|
|
65
|
+
toJSON(): Record<string, any>;
|
|
64
66
|
}
|
|
@@ -47,6 +47,9 @@ class A_Scope {
|
|
|
47
47
|
// this._components.set(component, new component());
|
|
48
48
|
// })
|
|
49
49
|
}
|
|
50
|
+
initEntities(_entities) {
|
|
51
|
+
_entities.forEach(this.register.bind(this));
|
|
52
|
+
}
|
|
50
53
|
initFragments(_fragments) {
|
|
51
54
|
_fragments.forEach(this.register.bind(this));
|
|
52
55
|
}
|
|
@@ -113,6 +116,9 @@ class A_Scope {
|
|
|
113
116
|
}
|
|
114
117
|
}
|
|
115
118
|
resolveEntity(entity, instructions) {
|
|
119
|
+
var _a;
|
|
120
|
+
const query = (instructions === null || instructions === void 0 ? void 0 : instructions.query) || {};
|
|
121
|
+
const count = ((_a = instructions === null || instructions === void 0 ? void 0 : instructions.pagination) === null || _a === void 0 ? void 0 : _a.count) || 1;
|
|
116
122
|
switch (true) {
|
|
117
123
|
case !instructions: {
|
|
118
124
|
const entities = Array.from(this._entities.values());
|
|
@@ -121,20 +127,31 @@ class A_Scope {
|
|
|
121
127
|
case !!found:
|
|
122
128
|
return found;
|
|
123
129
|
case !found && !!this.parent:
|
|
124
|
-
return this.parent.
|
|
130
|
+
return this.parent.resolveEntity(entity, instructions);
|
|
125
131
|
default:
|
|
126
132
|
throw new Error(`Fragment ${entity.name} not found in the scope ${this.name}`);
|
|
127
133
|
}
|
|
128
134
|
}
|
|
129
|
-
case !!
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
135
|
+
case !!query.aseid
|
|
136
|
+
&& typeof query.aseid === 'string'
|
|
137
|
+
&& this._entities.has(query.aseid):
|
|
138
|
+
{
|
|
139
|
+
return this._entities.get(query.aseid);
|
|
140
|
+
}
|
|
141
|
+
case !!query.aseid
|
|
142
|
+
&& query.aseid instanceof a_utils_1.ASEID
|
|
143
|
+
&& this._entities.has(query.aseid.toString()):
|
|
144
|
+
{
|
|
145
|
+
return this._entities.get(query.aseid.toString());
|
|
146
|
+
}
|
|
147
|
+
case !!query.id
|
|
148
|
+
&& this._entities.has(query.id):
|
|
149
|
+
{
|
|
150
|
+
// in this case we have to find the entity by the id
|
|
151
|
+
const entities = Array.from(this._entities.values());
|
|
152
|
+
const found = entities.find(e => e.id === query.id);
|
|
153
|
+
return found;
|
|
154
|
+
}
|
|
138
155
|
default:
|
|
139
156
|
throw new Error(`Entity ${entity.constructor.name} not found in the scope ${this.name}`);
|
|
140
157
|
}
|
|
@@ -222,6 +239,12 @@ class A_Scope {
|
|
|
222
239
|
throw new Error('Invalid arguments provided');
|
|
223
240
|
}
|
|
224
241
|
}
|
|
242
|
+
toJSON() {
|
|
243
|
+
return this.fragments.reduce((acc, fragment) => {
|
|
244
|
+
const serialized = fragment.toJSON();
|
|
245
|
+
return Object.assign(Object.assign({}, acc), { [serialized.name]: serialized });
|
|
246
|
+
}, {});
|
|
247
|
+
}
|
|
225
248
|
}
|
|
226
249
|
exports.A_Scope = A_Scope;
|
|
227
250
|
//# sourceMappingURL=A-Scope.class.js.map
|