@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,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":";;;;;;;;;;;;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;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
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"A-Scope.class.js","sourceRoot":"","sources":["../../../../src/global/A-Scope/A-Scope.class.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"A-Scope.class.js","sourceRoot":"","sources":["../../../../src/global/A-Scope/A-Scope.class.ts"],"names":[],"mappings":";;;AAAA,4CAAuD;AAEvD,qEAA4D;AAC5D,kEAAyD;AACzD,wEAE0C;AAC1C,wEAA+D;AAC/D,+DAAsD;AAGtD;;;;;;;;;;;;GAYG;AACH,MAAa,OAAO;IAahB,YACI,MAA0C,EAC1C,SAAwC,EAAE;QAb9C,SAAI,GAAW,EAAE,CAAC;QAEV,gBAAW,GAAiD,IAAI,OAAO,EAAE,CAAC;QAC1E,eAAU,GAAgD,IAAI,OAAO,EAAE,CAAC;QACxE,cAAS,GAA0B,IAAI,GAAG,EAAE,CAAC;QAWjD,IAAI,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ACtD,CAAC;IAIL,CAAC;IAKD,MAAM;QACF,OAAO,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,QAAQ,EAAE,EAAE;YAE3C,MAAM,UAAU,GAAG,QAAQ,CAAC,MAAM,EAAE,CAAA;YAEpC,uCACO,GAAG,KACN,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,UAAU,IAChC;QACL,CAAC,EAAE,EAAE,CAAC,CAAC;IACX,CAAC;CACJ;AAzZD,0BAyZC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { A_Component } from "../A-Component/A-Component.class";
|
|
1
2
|
import { A_Fragment } from "../A-Fragment/A-Fragment.class";
|
|
2
3
|
import { A_Scope } from "./A-Scope.class";
|
|
3
4
|
export type A_TYPES__ScopeConstructor = {
|
|
@@ -13,7 +14,7 @@ export type A_TYPES__ScopeConstructor = {
|
|
|
13
14
|
* A set of Components available in the Scope
|
|
14
15
|
*/
|
|
15
16
|
components: Array<{
|
|
16
|
-
new (...args: any[]):
|
|
17
|
+
new (...args: any[]): A_Component;
|
|
17
18
|
}>;
|
|
18
19
|
/**
|
|
19
20
|
* A list of Features/Lifecycle Hooks available in the Scope
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { A_Error } from "@adaas/a-utils";
|
|
2
|
+
import { A_Feature } from "../A-Feature/A-Feature.class";
|
|
3
|
+
import { A_TYPES__A_Stage_JSON, A_TYPES__A_Stage_Status, A_TYPES__A_StageStep } from "./A-Stage.types";
|
|
4
|
+
import { A_Container } from "../A-Container/A-Container.class";
|
|
5
|
+
/**
|
|
6
|
+
* A_Stage is a set of A_Functions within A_Feature that should be run in a specific order.
|
|
7
|
+
* Each stage may contain one or more functions.
|
|
8
|
+
* [!] That always run in parallel (in NodeJS asynchronously), independently of each other.
|
|
9
|
+
*
|
|
10
|
+
* A-Stage is a common object that uses to simplify logic and re-use of A-Feature internals for better composition.
|
|
11
|
+
*/
|
|
12
|
+
export declare class A_Stage {
|
|
13
|
+
private feature;
|
|
14
|
+
private steps;
|
|
15
|
+
constructor(feature: A_Feature, steps?: A_TYPES__A_StageStep[]);
|
|
16
|
+
status: A_TYPES__A_Stage_Status;
|
|
17
|
+
/**
|
|
18
|
+
* Promise that will be resolved when the stage is Processed
|
|
19
|
+
*/
|
|
20
|
+
processed: Promise<void> | undefined;
|
|
21
|
+
get before(): string[];
|
|
22
|
+
get after(): string[];
|
|
23
|
+
/**
|
|
24
|
+
* Resolves the arguments of the step
|
|
25
|
+
*
|
|
26
|
+
* @param step
|
|
27
|
+
* @returns
|
|
28
|
+
*/
|
|
29
|
+
protected getStepArgs(step: A_TYPES__A_StageStep): Promise<Promise<import("../A-Fragment/A-Fragment.class").A_Fragment | import("../A-Component/A-Component.class").A_Component<any> | import("../A-Scope/A-Scope.class").A_Scope | A_Container<any> | import("../A-Entity/A-Entity.class").A_Entity<any, any, any> | A_Feature | this>[]>;
|
|
30
|
+
/**
|
|
31
|
+
* Adds a step to the stage
|
|
32
|
+
*
|
|
33
|
+
* @param step
|
|
34
|
+
* @returns
|
|
35
|
+
*/
|
|
36
|
+
add(step: A_TYPES__A_StageStep): this;
|
|
37
|
+
/**
|
|
38
|
+
* Resolves the component of the step
|
|
39
|
+
*
|
|
40
|
+
* @param step
|
|
41
|
+
* @returns
|
|
42
|
+
*/
|
|
43
|
+
protected getStepInstance(step: A_TYPES__A_StageStep): A_Container<any> | import("../A-Component/A-Component.class").A_Component<string[]>;
|
|
44
|
+
/**
|
|
45
|
+
* Calls the handler of the step
|
|
46
|
+
*
|
|
47
|
+
* @param step
|
|
48
|
+
* @returns
|
|
49
|
+
*/
|
|
50
|
+
protected getStepHandler(step: A_TYPES__A_StageStep): Promise<any>;
|
|
51
|
+
/**
|
|
52
|
+
* Runs async all the steps of the stage
|
|
53
|
+
*
|
|
54
|
+
* @returns
|
|
55
|
+
*/
|
|
56
|
+
process(): Promise<void>;
|
|
57
|
+
/**
|
|
58
|
+
* Skips the stage
|
|
59
|
+
*
|
|
60
|
+
*/
|
|
61
|
+
skip(): void;
|
|
62
|
+
protected completed(): void;
|
|
63
|
+
protected failed(error: Error | A_Error | unknown): void;
|
|
64
|
+
/**
|
|
65
|
+
* Serializes the stage to JSON
|
|
66
|
+
*
|
|
67
|
+
*/
|
|
68
|
+
toJSON(): A_TYPES__A_Stage_JSON;
|
|
69
|
+
}
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.A_Stage = void 0;
|
|
13
|
+
const a_utils_1 = require("@adaas/a-utils");
|
|
14
|
+
const A_Context_class_1 = require("../A-Context/A-Context.class");
|
|
15
|
+
const A_Feature_class_1 = require("../A-Feature/A-Feature.class");
|
|
16
|
+
const A_Stage_types_1 = require("./A-Stage.types");
|
|
17
|
+
const A_Container_class_1 = require("../A-Container/A-Container.class");
|
|
18
|
+
/**
|
|
19
|
+
* A_Stage is a set of A_Functions within A_Feature that should be run in a specific order.
|
|
20
|
+
* Each stage may contain one or more functions.
|
|
21
|
+
* [!] That always run in parallel (in NodeJS asynchronously), independently of each other.
|
|
22
|
+
*
|
|
23
|
+
* A-Stage is a common object that uses to simplify logic and re-use of A-Feature internals for better composition.
|
|
24
|
+
*/
|
|
25
|
+
class A_Stage {
|
|
26
|
+
constructor(feature, steps = []) {
|
|
27
|
+
this.feature = feature;
|
|
28
|
+
this.steps = steps;
|
|
29
|
+
this.status = A_Stage_types_1.A_TYPES__A_Stage_Status.INITIALIZED;
|
|
30
|
+
}
|
|
31
|
+
get before() {
|
|
32
|
+
return this.steps.reduce((acc, step) => ([
|
|
33
|
+
...acc,
|
|
34
|
+
...step.before
|
|
35
|
+
]), []);
|
|
36
|
+
}
|
|
37
|
+
get after() {
|
|
38
|
+
return this.steps.reduce((acc, step) => ([
|
|
39
|
+
...acc,
|
|
40
|
+
...step.after
|
|
41
|
+
]), []);
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Resolves the arguments of the step
|
|
45
|
+
*
|
|
46
|
+
* @param step
|
|
47
|
+
* @returns
|
|
48
|
+
*/
|
|
49
|
+
getStepArgs(step) {
|
|
50
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
51
|
+
const target = step.component instanceof A_Container_class_1.A_Container ?
|
|
52
|
+
step.component.constructor : step.component;
|
|
53
|
+
return A_Context_class_1.A_Context
|
|
54
|
+
.meta(target)
|
|
55
|
+
.injections(step.handler)
|
|
56
|
+
.map((arg) => __awaiter(this, void 0, void 0, function* () {
|
|
57
|
+
// In case if the target is a feature step then pass the current feature
|
|
58
|
+
return a_utils_1.A_CommonHelper.isInheritedFrom(arg.target, A_Feature_class_1.A_Feature)
|
|
59
|
+
? this
|
|
60
|
+
: A_Context_class_1.A_Context.scope(this.feature).resolve(arg.target);
|
|
61
|
+
}));
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Adds a step to the stage
|
|
66
|
+
*
|
|
67
|
+
* @param step
|
|
68
|
+
* @returns
|
|
69
|
+
*/
|
|
70
|
+
add(step) {
|
|
71
|
+
this.steps.push(step);
|
|
72
|
+
return this;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Resolves the component of the step
|
|
76
|
+
*
|
|
77
|
+
* @param step
|
|
78
|
+
* @returns
|
|
79
|
+
*/
|
|
80
|
+
getStepInstance(step) {
|
|
81
|
+
const { component, handler } = step;
|
|
82
|
+
// TODO: probably would be better to do it another way. let's think about it
|
|
83
|
+
const instance = component instanceof A_Container_class_1.A_Container
|
|
84
|
+
? component
|
|
85
|
+
: A_Context_class_1.A_Context.scope(this.feature).resolve(component);
|
|
86
|
+
if (!instance)
|
|
87
|
+
throw new Error(`Unable to resolve component ${component.name}`);
|
|
88
|
+
if (!instance[handler])
|
|
89
|
+
throw new Error(`Handler ${handler} not found in ${instance.constructor.name}`);
|
|
90
|
+
return instance;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Calls the handler of the step
|
|
94
|
+
*
|
|
95
|
+
* @param step
|
|
96
|
+
* @returns
|
|
97
|
+
*/
|
|
98
|
+
getStepHandler(step) {
|
|
99
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
100
|
+
const instance = this.getStepInstance(step);
|
|
101
|
+
const callArgs = yield this.getStepArgs(step);
|
|
102
|
+
return instance[step.handler](...callArgs);
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Runs async all the steps of the stage
|
|
107
|
+
*
|
|
108
|
+
* @returns
|
|
109
|
+
*/
|
|
110
|
+
process() {
|
|
111
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
112
|
+
if (!this.processed)
|
|
113
|
+
this.processed = new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
|
114
|
+
try {
|
|
115
|
+
this.status = A_Stage_types_1.A_TYPES__A_Stage_Status.PROCESSING;
|
|
116
|
+
const syncSteps = this.steps.filter(step => step.behavior === 'sync');
|
|
117
|
+
const asyncSteps = this.steps.filter(step => step.behavior === 'async');
|
|
118
|
+
// Run sync steps
|
|
119
|
+
yield Promise
|
|
120
|
+
.all([
|
|
121
|
+
// Run async steps that are independent of each other
|
|
122
|
+
...asyncSteps.map(step => this.getStepHandler(step)),
|
|
123
|
+
// Run sync steps that are dependent on each other
|
|
124
|
+
new Promise((r, j) => __awaiter(this, void 0, void 0, function* () {
|
|
125
|
+
try {
|
|
126
|
+
for (const step of syncSteps) {
|
|
127
|
+
yield this.getStepHandler(step);
|
|
128
|
+
}
|
|
129
|
+
return r();
|
|
130
|
+
}
|
|
131
|
+
catch (error) {
|
|
132
|
+
return j(error);
|
|
133
|
+
}
|
|
134
|
+
}))
|
|
135
|
+
]);
|
|
136
|
+
this.completed();
|
|
137
|
+
return resolve();
|
|
138
|
+
}
|
|
139
|
+
catch (error) {
|
|
140
|
+
this.failed(error);
|
|
141
|
+
return reject(error);
|
|
142
|
+
}
|
|
143
|
+
}));
|
|
144
|
+
return this.processed;
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* Skips the stage
|
|
149
|
+
*
|
|
150
|
+
*/
|
|
151
|
+
skip() {
|
|
152
|
+
this.status = A_Stage_types_1.A_TYPES__A_Stage_Status.SKIPPED;
|
|
153
|
+
this.feature.next(this);
|
|
154
|
+
}
|
|
155
|
+
// ==========================================
|
|
156
|
+
// ============ Status methods =============
|
|
157
|
+
// ==========================================
|
|
158
|
+
completed() {
|
|
159
|
+
this.status = A_Stage_types_1.A_TYPES__A_Stage_Status.COMPLETED;
|
|
160
|
+
this.feature.next(this);
|
|
161
|
+
}
|
|
162
|
+
failed(error) {
|
|
163
|
+
this.status = A_Stage_types_1.A_TYPES__A_Stage_Status.FAILED;
|
|
164
|
+
this.feature.failed(error);
|
|
165
|
+
}
|
|
166
|
+
// ==========================================
|
|
167
|
+
// ============ Serialization ===============
|
|
168
|
+
// ==========================================
|
|
169
|
+
/**
|
|
170
|
+
* Serializes the stage to JSON
|
|
171
|
+
*
|
|
172
|
+
*/
|
|
173
|
+
toJSON() {
|
|
174
|
+
return {
|
|
175
|
+
name: 'A_Stage',
|
|
176
|
+
status: this.status,
|
|
177
|
+
};
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
exports.A_Stage = A_Stage;
|
|
181
|
+
//# sourceMappingURL=A-Stage.class.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"A-Stage.class.js","sourceRoot":"","sources":["../../../../src/global/A-Stage/A-Stage.class.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,4CAAyD;AACzD,kEAAyD;AACzD,kEAAyD;AACzD,mDAAuG;AACvG,wEAA+D;AAI/D;;;;;;GAMG;AACH,MAAa,OAAO;IAIhB,YACY,OAAkB,EAClB,QAAgC,EAAE;QADlC,YAAO,GAAP,OAAO,CAAW;QAClB,UAAK,GAAL,KAAK,CAA6B;QAK9C,WAAM,GAA4B,uCAAuB,CAAC,WAAW,CAAC;IAFtE,CAAC;IASD,IAAI,MAAM;QACN,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC;YACrC,GAAG,GAAG;YACN,GAAG,IAAI,CAAC,MAAM;SACjB,CAAC,EAAE,EAAc,CAAC,CAAC;IACxB,CAAC;IAED,IAAI,KAAK;QACL,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC;YACrC,GAAG,GAAG;YACN,GAAG,IAAI,CAAC,KAAK;SAChB,CAAC,EAAE,EAAc,CAAC,CAAC;IACxB,CAAC;IAGD;;;;;OAKG;IACa,WAAW,CAAC,IAA0B;;YAElD,MAAM,MAAM,GAAG,IAAI,CAAC,SAAS,YAAY,+BAAW,CAAC,CAAC;gBAClD,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC;YAEhD,OAAO,2BAAS;iBACX,IAAI,CAAC,MAAM,CAAC;iBACZ,UAAU,CACP,IAAI,CAAC,OAAO,CACf;iBACA,GAAG,CAAC,CAAM,GAAG,EAAC,EAAE;gBACb,wEAAwE;gBACxE,OAAA,wBAAc,CAAC,eAAe,CAAC,GAAG,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L,CAAC,CAAA,CAAC,CAAC;YAGX,OAAO,IAAI,CAAC,SAAS,CAAC;QAC1B,CAAC;KAAA;IAGD;;;OAGG;IACH,IAAI;QACA,IAAI,CAAC,MAAM,GAAG,uCAAuB,CAAC,OAAO,CAAC;QAE9C,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC5B,CAAC;IAKD,6CAA6C;IAC7C,4CAA4C;IAC5C,6CAA6C;IAEnC,SAAS;QACf,IAAI,CAAC,MAAM,GAAG,uCAAuB,CAAC,SAAS,CAAC;QAEhD,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC5B,CAAC;IAES,MAAM,CACZ,KAAgC;QAEhC,IAAI,CAAC,MAAM,GAAG,uCAAuB,CAAC,MAAM,CAAC;QAE7C,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IAC/B,CAAC;IAID,6CAA6C;IAC7C,6CAA6C;IAC7C,6CAA6C;IAG7C;;;OAGG;IACH,MAAM;QAEF,OAAO;YACH,IAAI,EAAE,SAAS;YACf,MAAM,EAAE,IAAI,CAAC,MAAM;SACtB,CAAA;IACL,CAAC;CACJ;AA1ND,0BA0NC"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { A_Component } from "../A-Component/A-Component.class";
|
|
2
|
+
import { A_Container } from "../A-Container/A-Container.class";
|
|
3
|
+
import { A_TYPES__A_ExtendDecorator_BehaviorConfig } from "../../decorators/A-Feature/A-Feature.decorator.types";
|
|
4
|
+
export declare enum A_TYPES__A_Stage_Status {
|
|
5
|
+
/**
|
|
6
|
+
* The stage is currently being processed
|
|
7
|
+
*/
|
|
8
|
+
PROCESSING = "PROCESSING",
|
|
9
|
+
/**
|
|
10
|
+
* The stage has been completed
|
|
11
|
+
*/
|
|
12
|
+
COMPLETED = "COMPLETED",
|
|
13
|
+
/**
|
|
14
|
+
* The stage has failed
|
|
15
|
+
*/
|
|
16
|
+
FAILED = "FAILED",
|
|
17
|
+
/**
|
|
18
|
+
* The stage has been skipped
|
|
19
|
+
*/
|
|
20
|
+
SKIPPED = "SKIPPED",
|
|
21
|
+
/**
|
|
22
|
+
* The stage has been paused
|
|
23
|
+
*/
|
|
24
|
+
/**
|
|
25
|
+
* The stage has been stopped
|
|
26
|
+
*/
|
|
27
|
+
/**
|
|
28
|
+
* The stage has been started
|
|
29
|
+
*/
|
|
30
|
+
/**
|
|
31
|
+
* The stage has been initialized
|
|
32
|
+
*/
|
|
33
|
+
INITIALIZED = "INITIALIZED",
|
|
34
|
+
/**
|
|
35
|
+
* The stage has been reset
|
|
36
|
+
*/
|
|
37
|
+
/**
|
|
38
|
+
* The stage has been resumed
|
|
39
|
+
*/
|
|
40
|
+
/**
|
|
41
|
+
* The stage has been suspended
|
|
42
|
+
*/
|
|
43
|
+
/**
|
|
44
|
+
* The stage has been terminated
|
|
45
|
+
*/
|
|
46
|
+
/**
|
|
47
|
+
* The stage has been aborted
|
|
48
|
+
*/
|
|
49
|
+
ABORTED = "ABORTED"
|
|
50
|
+
}
|
|
51
|
+
export type A_TYPES__A_StageStep = {
|
|
52
|
+
/**
|
|
53
|
+
* The component to be called
|
|
54
|
+
*/
|
|
55
|
+
component: typeof A_Component | typeof A_Container | A_Container<any>;
|
|
56
|
+
/**
|
|
57
|
+
* The method to be called on the component
|
|
58
|
+
*/
|
|
59
|
+
handler: string;
|
|
60
|
+
/**
|
|
61
|
+
* Original Feature Extension name
|
|
62
|
+
*
|
|
63
|
+
* [!] could be string or regex
|
|
64
|
+
*
|
|
65
|
+
*/
|
|
66
|
+
name: string;
|
|
67
|
+
} & A_TYPES__A_ExtendDecorator_BehaviorConfig;
|
|
68
|
+
export type A_TYPES__A_Stage_JSON = {
|
|
69
|
+
/**
|
|
70
|
+
* The name of the stage
|
|
71
|
+
*/
|
|
72
|
+
name: string;
|
|
73
|
+
/**
|
|
74
|
+
* The status of the stage
|
|
75
|
+
*
|
|
76
|
+
*/
|
|
77
|
+
status: A_TYPES__A_Stage_Status;
|
|
78
|
+
};
|