@adaas/a-concept 0.1.37 → 0.1.38
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/index.cjs +2 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +18 -0
- package/dist/index.d.ts +18 -0
- package/dist/index.mjs +2 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/global/A-Entity/A-Entity.meta.ts +18 -0
- package/src/global/A-Entity/A-Entity.types.ts +13 -0
- package/src/global/A-Inject/A-Inject.decorator.ts +5 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adaas/a-concept",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.38",
|
|
4
4
|
"description": "A-Concept is a framework to build new Applications within or outside the ADAAS ecosystem. This framework is designed to be modular structure regardless environment and program goal.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -2,6 +2,7 @@ import { A_Meta } from "../A-Meta/A-Meta.class";
|
|
|
2
2
|
import { A_TYPES__EntityMeta } from "./A-Entity.types";
|
|
3
3
|
import { A_TYPES__EntityMetaKey } from "./A-Entity.constants";
|
|
4
4
|
import { A_TYPES__FeatureDefineDecoratorMeta } from "../A-Feature/A-Feature.types";
|
|
5
|
+
import { A_TYPES__A_InjectDecorator_Meta } from "../A-Inject/A-Inject.types";
|
|
5
6
|
|
|
6
7
|
|
|
7
8
|
export class A_EntityMeta extends A_Meta<A_TYPES__EntityMeta> {
|
|
@@ -20,4 +21,21 @@ export class A_EntityMeta extends A_Meta<A_TYPES__EntityMeta> {
|
|
|
20
21
|
.map(([, feature]) => feature) || [];
|
|
21
22
|
}
|
|
22
23
|
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Allows to get all the injections for a given handler
|
|
27
|
+
*
|
|
28
|
+
* @param handler
|
|
29
|
+
* @returns
|
|
30
|
+
*/
|
|
31
|
+
injections(
|
|
32
|
+
handler: string
|
|
33
|
+
): A_TYPES__A_InjectDecorator_Meta {
|
|
34
|
+
const injections = this.get(A_TYPES__EntityMetaKey.INJECTIONS);
|
|
35
|
+
|
|
36
|
+
const args = injections?.get(handler) || [];
|
|
37
|
+
|
|
38
|
+
return args;
|
|
39
|
+
}
|
|
40
|
+
|
|
23
41
|
}
|
|
@@ -3,6 +3,7 @@ import { A_Entity } from "./A-Entity.class";
|
|
|
3
3
|
import { ASEID } from "../ASEID/ASEID.class";
|
|
4
4
|
import { A_TYPES__EntityMetaKey } from "./A-Entity.constants";
|
|
5
5
|
import { A_TYPES__FeatureDefineDecoratorMeta, A_TYPES__FeatureExtendDecoratorMeta } from "../A-Feature/A-Feature.types";
|
|
6
|
+
import { A_TYPES__A_InjectDecorator_Meta } from "../A-Inject/A-Inject.types";
|
|
6
7
|
|
|
7
8
|
|
|
8
9
|
/**
|
|
@@ -67,6 +68,18 @@ export type A_TYPES__EntityMeta = {
|
|
|
67
68
|
*/
|
|
68
69
|
[Key: string]: A_TYPES__FeatureDefineDecoratorMeta
|
|
69
70
|
}>
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Injections defined on the component per handler
|
|
74
|
+
*/
|
|
75
|
+
[A_TYPES__EntityMetaKey.INJECTIONS]: A_Meta<{
|
|
76
|
+
/**
|
|
77
|
+
* Where Key is the name of the injection
|
|
78
|
+
*
|
|
79
|
+
* Where value is the list of injections
|
|
80
|
+
*/
|
|
81
|
+
[Key: string]: A_TYPES__A_InjectDecorator_Meta
|
|
82
|
+
}>
|
|
70
83
|
}
|
|
71
84
|
|
|
72
85
|
|
|
@@ -25,6 +25,7 @@ import { A_Feature } from "@adaas/a-concept/global/A-Feature/A-Feature.class";
|
|
|
25
25
|
import { A_CommonHelper } from "@adaas/a-concept/helpers/A_Common.helper";
|
|
26
26
|
import { A_TYPES__Error_Constructor } from "../A-Error/A_Error.types";
|
|
27
27
|
import { A_Error } from "../A-Error/A_Error.class";
|
|
28
|
+
import { A_TYPES__EntityMetaKey } from "../A-Entity/A-Entity.constants";
|
|
28
29
|
|
|
29
30
|
|
|
30
31
|
/**
|
|
@@ -153,6 +154,10 @@ export function A_Inject(
|
|
|
153
154
|
case A_TypeGuards.isContainerInstance(target):
|
|
154
155
|
metaKey = A_TYPES__ContainerMetaKey.INJECTIONS;
|
|
155
156
|
break;
|
|
157
|
+
|
|
158
|
+
case A_TypeGuards.isEntityInstance(target):
|
|
159
|
+
metaKey = A_TYPES__EntityMetaKey.INJECTIONS;
|
|
160
|
+
break;
|
|
156
161
|
}
|
|
157
162
|
|
|
158
163
|
// get existing meta or create a new one
|