@adaas/a-concept 0.2.14 → 0.3.2

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.
Files changed (144) hide show
  1. package/.conf/tsconfig.base.json +91 -0
  2. package/.conf/tsconfig.browser.json +36 -0
  3. package/.conf/tsconfig.node.json +40 -0
  4. package/dist/browser/index.d.mts +4188 -212
  5. package/dist/browser/index.mjs +2 -67
  6. package/dist/browser/index.mjs.map +1 -1
  7. package/dist/node/index.cjs +5810 -383
  8. package/dist/node/index.cjs.map +1 -1
  9. package/dist/node/index.d.mts +4215 -212
  10. package/dist/node/index.d.ts +4215 -212
  11. package/dist/node/index.mjs +5751 -66
  12. package/dist/node/index.mjs.map +1 -1
  13. package/jest.config.ts +30 -15
  14. package/package.json +19 -16
  15. package/src/env/env-browser.ts +38 -1
  16. package/src/env/env-node.ts +26 -2
  17. package/src/env/env.base.ts +21 -2
  18. package/src/env/global.browser.d.ts +1 -1
  19. package/src/helpers/A_BasicTypeGuards.helper.ts +81 -0
  20. package/src/helpers/A_Common.helper.ts +2 -2
  21. package/src/helpers/A_Identity.helper.ts +2 -4
  22. package/src/helpers/A_TypeGuards.helper.ts +45 -30
  23. package/src/helpers/index.ts +5 -0
  24. package/src/index.ts +21 -94
  25. package/src/{global → lib}/A-Abstraction/A-Abstraction-Extend.decorator.ts +18 -13
  26. package/src/{global → lib}/A-Abstraction/A-Abstraction.class.ts +5 -5
  27. package/src/{global → lib}/A-Abstraction/A-Abstraction.error.ts +1 -1
  28. package/src/{global → lib}/A-Abstraction/A-Abstraction.types.ts +5 -5
  29. package/src/lib/A-Abstraction/index.ts +8 -0
  30. package/src/{global → lib}/A-Caller/A_Caller.class.ts +3 -4
  31. package/src/{global → lib}/A-Caller/A_Caller.error.ts +1 -4
  32. package/src/{global → lib}/A-Caller/A_Caller.types.ts +4 -4
  33. package/src/lib/A-Caller/index.ts +3 -0
  34. package/src/{global → lib}/A-Component/A-Component.class.ts +2 -3
  35. package/src/{global → lib}/A-Component/A-Component.meta.ts +5 -5
  36. package/src/{global → lib}/A-Component/A-Component.types.ts +5 -5
  37. package/src/lib/A-Component/index.ts +5 -0
  38. package/src/{global → lib}/A-Concept/A-Concept.class.ts +9 -7
  39. package/src/{global → lib}/A-Concept/A-Concept.meta.ts +2 -2
  40. package/src/{global → lib}/A-Concept/A-Concept.types.ts +7 -7
  41. package/src/lib/A-Concept/index.ts +4 -0
  42. package/src/{global → lib}/A-Container/A-Container.class.ts +3 -3
  43. package/src/{global → lib}/A-Container/A-Container.meta.ts +11 -6
  44. package/src/{global → lib}/A-Container/A-Container.types.ts +9 -6
  45. package/src/lib/A-Container/index.ts +5 -0
  46. package/src/{global → lib}/A-Context/A-Context.class.ts +53 -42
  47. package/src/{global → lib}/A-Context/A-Context.error.ts +1 -1
  48. package/src/lib/A-Context/A-Context.types.ts +14 -0
  49. package/src/lib/A-Context/index.ts +5 -0
  50. package/src/{global → lib}/A-Dependency/A-Dependency-All.decorator.ts +11 -11
  51. package/src/{global → lib}/A-Dependency/A-Dependency-Default.decorator.ts +11 -9
  52. package/src/{global → lib}/A-Dependency/A-Dependency-Flat.decorator.ts +11 -8
  53. package/src/{global → lib}/A-Dependency/A-Dependency-Load.decorator.ts +11 -9
  54. package/src/{global → lib}/A-Dependency/A-Dependency-Parent.decorator.ts +11 -9
  55. package/src/lib/A-Dependency/A-Dependency-Query.decorator.ts +90 -0
  56. package/src/{global → lib}/A-Dependency/A-Dependency-Require.decorator.ts +11 -9
  57. package/src/{global → lib}/A-Dependency/A-Dependency.class.ts +20 -3
  58. package/src/{global → lib}/A-Dependency/A-Dependency.error.ts +1 -1
  59. package/src/{global → lib}/A-Dependency/A-Dependency.types.ts +20 -9
  60. package/src/lib/A-Dependency/index.ts +18 -0
  61. package/src/{global → lib}/A-Entity/A-Entity.class.ts +11 -9
  62. package/src/{global → lib}/A-Entity/A-Entity.error.ts +1 -1
  63. package/src/{global → lib}/A-Entity/A-Entity.meta.ts +3 -3
  64. package/src/{global → lib}/A-Entity/A-Entity.types.ts +5 -5
  65. package/src/lib/A-Entity/index.ts +5 -0
  66. package/src/{global → lib}/A-Error/A_Error.class.ts +13 -13
  67. package/src/{global → lib}/A-Error/A_Error.types.ts +2 -2
  68. package/src/lib/A-Error/index.ts +3 -0
  69. package/src/{global → lib}/A-Feature/A-Feature-Define.decorator.ts +16 -10
  70. package/src/{global → lib}/A-Feature/A-Feature-Extend.decorator.ts +13 -9
  71. package/src/{global → lib}/A-Feature/A-Feature.class.ts +15 -13
  72. package/src/{global → lib}/A-Feature/A-Feature.error.ts +2 -2
  73. package/src/{global → lib}/A-Feature/A-Feature.types.ts +21 -12
  74. package/src/lib/A-Feature/index.ts +13 -0
  75. package/src/{global → lib}/A-Fragment/A-Fragment.class.ts +0 -2
  76. package/src/{global → lib}/A-Fragment/A-Fragment.types.ts +1 -1
  77. package/src/lib/A-Fragment/index.ts +5 -0
  78. package/src/{global → lib}/A-Inject/A-Inject.decorator.ts +42 -24
  79. package/src/{global → lib}/A-Inject/A-Inject.error.ts +1 -1
  80. package/src/{global → lib}/A-Inject/A-Inject.types.ts +3 -9
  81. package/src/lib/A-Inject/index.ts +3 -0
  82. package/src/{global → lib}/A-Meta/A-Meta.decorator.ts +2 -2
  83. package/src/{global → lib}/A-Meta/A-Meta.types.ts +18 -10
  84. package/src/lib/A-Meta/index.ts +11 -0
  85. package/src/{global → lib}/A-Scope/A-Scope.class.ts +37 -25
  86. package/src/{global → lib}/A-Scope/A-Scope.error.ts +1 -1
  87. package/src/{global → lib}/A-Scope/A-Scope.types.ts +23 -15
  88. package/src/lib/A-Scope/index.ts +5 -0
  89. package/src/{global → lib}/A-Stage/A-Stage.class.ts +9 -10
  90. package/src/{global → lib}/A-Stage/A-Stage.error.ts +1 -1
  91. package/src/{global → lib}/A-Stage/A-Stage.types.ts +1 -4
  92. package/src/lib/A-Stage/index.ts +5 -0
  93. package/src/{global → lib}/A-StepManager/A-StepManager.class.ts +8 -4
  94. package/src/{global → lib}/A-StepManager/A-StepManager.error.ts +1 -1
  95. package/src/lib/A-StepManager/index.ts +4 -0
  96. package/src/{global → lib}/ASEID/ASEID.class.ts +20 -23
  97. package/src/lib/ASEID/ASEID.error.ts +12 -0
  98. package/src/lib/ASEID/index.ts +4 -0
  99. package/src/types/A_identity.types.ts +4 -0
  100. package/src/types/index.ts +2 -0
  101. package/tests/A-Abstraction.test.ts +6 -6
  102. package/tests/A-Common.test.ts +6 -4
  103. package/tests/A-Component.test.ts +7 -5
  104. package/tests/A-Concept.test.ts +13 -11
  105. package/tests/A-Container.test.ts +4 -3
  106. package/tests/A-Dependency.test.ts +73 -1
  107. package/tests/A-Entity.test.ts +108 -5
  108. package/tests/A-Error.test.ts +7 -4
  109. package/tests/A-Feature.test.ts +12 -8
  110. package/tests/A-Fragment.test.ts +1 -2
  111. package/tests/A-Inject.test.ts +4 -1
  112. package/tests/A-Meta.test.ts +12 -10
  113. package/tests/A-Scope.test.ts +11 -10
  114. package/tests/A-StepManager.test.ts +3 -3
  115. package/tests/ASEID.test.ts +2 -2
  116. package/tests/jest.setup.ts +23 -23
  117. package/tsconfig.json +59 -97
  118. package/tsup.config.ts +18 -13
  119. package/dist/browser/A-Context.types-BtR_HJ0j.d.mts +0 -3828
  120. package/dist/browser/env.d.mts +0 -64
  121. package/dist/browser/env.mjs +0 -3
  122. package/dist/browser/env.mjs.map +0 -1
  123. package/dist/node/A-Context.types-BtR_HJ0j.d.mts +0 -3828
  124. package/dist/node/A-Context.types-BtR_HJ0j.d.ts +0 -3828
  125. package/dist/node/env.cjs +0 -12
  126. package/dist/node/env.cjs.map +0 -1
  127. package/dist/node/env.d.mts +0 -91
  128. package/dist/node/env.d.ts +0 -91
  129. package/dist/node/env.js +0 -12
  130. package/dist/node/env.js.map +0 -1
  131. package/dist/node/env.mjs +0 -3
  132. package/dist/node/env.mjs.map +0 -1
  133. package/dist/node/index.js +0 -387
  134. package/dist/node/index.js.map +0 -1
  135. package/src/global/A-Context/A-Context.types.ts +0 -14
  136. package/src/global/ASEID/ASEID.error.ts +0 -12
  137. /package/src/{global → lib}/A-Component/A-Component.constants.ts +0 -0
  138. /package/src/{global → lib}/A-Concept/A-Concept.constants.ts +0 -0
  139. /package/src/{global → lib}/A-Container/A-Container.constants.ts +0 -0
  140. /package/src/{global → lib}/A-Entity/A-Entity.constants.ts +0 -0
  141. /package/src/{global → lib}/A-Error/A_Error.constants.ts +0 -0
  142. /package/src/{global → lib}/A-Meta/A-Meta.class.ts +0 -0
  143. /package/src/{global → lib}/ASEID/ASEID.constants.ts +0 -0
  144. /package/src/{global → lib}/ASEID/ASEID.types.ts +0 -0
@@ -0,0 +1,90 @@
1
+
2
+ import { A_Context } from "@adaas/a-concept/a-context";
3
+ import { A_Meta } from "@adaas/a-concept/a-meta";
4
+ import { A_TYPES__ComponentMetaKey } from "@adaas/a-concept/a-component";
5
+ import { A_TYPES__ContainerMetaKey } from "@adaas/a-concept/a-container";
6
+ import { A_TYPES__A_Dependency_EntityInjectionPagination, A_TYPES__A_Dependency_EntityInjectionQuery, A_TYPES__A_Dependency_EntityResolutionConfig, A_TYPES__A_Dependency_QueryDecoratorReturn } from "./A-Dependency.types";
7
+ import { A_DependencyError } from "./A-Dependency.error";
8
+ import type { A_Entity } from "@adaas/a-concept/a-entity";
9
+ import { A_TYPES__EntityMetaKey } from "@adaas/a-concept/a-entity";
10
+ import {
11
+ A_TYPES__A_InjectDecorator_Meta,
12
+ A_TYPES__InjectableTargets
13
+ } from "@adaas/a-concept/a-inject";
14
+ import { A_TypeGuards } from "@adaas/a-concept/helpers/A_TypeGuards.helper";
15
+ import { A_CommonHelper } from "@adaas/a-concept/helpers/A_Common.helper";
16
+
17
+ /**
18
+ * Query Decorator is only applicable for Entities since Scope instance may have multiple entities but only one component or container, so there is no need for such complex resolution strategies for them, but for entities it is a common case to have multiple instances and need to specify which one(s) to inject.
19
+ *
20
+ *
21
+ * @param query
22
+ * @returns
23
+ */
24
+ export function A_Dependency_Query<T extends A_Entity = A_Entity>(
25
+ query: Partial<A_TYPES__A_Dependency_EntityInjectionQuery<T>>,
26
+ pagination?: Partial<A_TYPES__A_Dependency_EntityInjectionPagination>
27
+ ): A_TYPES__A_Dependency_QueryDecoratorReturn {
28
+
29
+ return function (
30
+ target: A_TYPES__InjectableTargets,
31
+ methodName: string | symbol | undefined,
32
+ parameterIndex: number
33
+ ) {
34
+ // for Error handling purposes
35
+ const componentName = A_CommonHelper.getComponentName(target)
36
+
37
+ if (!A_TypeGuards.isTargetAvailableForInjection(target)) {
38
+ throw new A_DependencyError(
39
+ A_DependencyError.InvalidDependencyTarget,
40
+ `A-All cannot be used on the target of type ${typeof target} (${componentName})`
41
+ );
42
+ }
43
+
44
+ // determine the method name or 'constructor' for constructor injections
45
+ const method = methodName ? String(methodName) : 'constructor';
46
+ let metaKey;
47
+
48
+ switch (true) {
49
+ case A_TypeGuards.isComponentConstructor(target) || A_TypeGuards.isComponentInstance(target):
50
+ metaKey = A_TYPES__ComponentMetaKey.INJECTIONS;
51
+ break;
52
+
53
+ case A_TypeGuards.isContainerInstance(target):
54
+ metaKey = A_TYPES__ContainerMetaKey.INJECTIONS;
55
+ break;
56
+
57
+ case A_TypeGuards.isEntityInstance(target):
58
+ metaKey = A_TYPES__EntityMetaKey.INJECTIONS;
59
+ break;
60
+ }
61
+
62
+ // get existing meta or create a new one
63
+ const existedMeta = A_Context.meta(target).get(metaKey) || new A_Meta();
64
+ // get existing injections for the method or create a new array
65
+ const paramsArray: A_TYPES__A_InjectDecorator_Meta = existedMeta.get(method) || [];
66
+
67
+ // set the parameter injection info
68
+ paramsArray[parameterIndex].resolutionStrategy = {
69
+ query: {
70
+ ...paramsArray[parameterIndex].resolutionStrategy.query,
71
+ ...query
72
+ },
73
+ pagination: {
74
+ ...paramsArray[parameterIndex].resolutionStrategy.pagination,
75
+ ...pagination
76
+ }
77
+ }
78
+
79
+ // save back the updated injections array
80
+ existedMeta.set(method, paramsArray);
81
+
82
+ // save back the updated meta info
83
+ A_Context
84
+ .meta(target)
85
+ .set(
86
+ metaKey,
87
+ existedMeta
88
+ );
89
+ }
90
+ }
@@ -1,14 +1,16 @@
1
-
2
- import { A_Context } from "@adaas/a-concept/global/A-Context/A-Context.class";
3
- import { A_Meta } from "@adaas/a-concept/global/A-Meta/A-Meta.class";
4
- import { A_TYPES__ComponentMetaKey } from "@adaas/a-concept/global/A-Component/A-Component.constants";
5
- import { A_TYPES__ContainerMetaKey } from "@adaas/a-concept/global/A-Container/A-Container.constants";
6
- import { A_TypeGuards } from "@adaas/a-concept/helpers/A_TypeGuards.helper";
7
- import { A_TYPES__A_InjectDecorator_Meta, A_TYPES__InjectableTargets } from "../A-Inject/A-Inject.types";
1
+ import { A_Context } from "@adaas/a-concept/a-context";
2
+ import { A_Meta } from "@adaas/a-concept/a-meta";
3
+ import { A_TYPES__ComponentMetaKey } from "@adaas/a-concept/a-component";
4
+ import { A_TYPES__ContainerMetaKey } from "@adaas/a-concept/a-container";
8
5
  import { A_TYPES__A_Dependency_RequireDecoratorReturn } from "./A-Dependency.types";
9
6
  import { A_DependencyError } from "./A-Dependency.error";
10
- import { A_CommonHelper } from "@adaas/a-concept/helpers/A_Common.helper";
11
- import { A_TYPES__EntityMetaKey } from "../A-Entity/A-Entity.constants";
7
+ import { A_TYPES__EntityMetaKey } from "@adaas/a-concept/a-entity";
8
+ import {
9
+ A_TYPES__A_InjectDecorator_Meta,
10
+ A_TYPES__InjectableTargets
11
+ } from "@adaas/a-concept/a-inject";
12
+ import { A_TypeGuards} from "@adaas/a-concept/helpers/A_TypeGuards.helper";
13
+ import { A_CommonHelper} from "@adaas/a-concept/helpers/A_Common.helper";
12
14
 
13
15
 
14
16
  /**
@@ -1,13 +1,20 @@
1
- import { A_CommonHelper } from "@adaas/a-concept/helpers/A_Common.helper";
1
+ import { A_CommonHelper} from "@adaas/a-concept/helpers/A_Common.helper";
2
2
  import { A_Dependency_Default } from "./A-Dependency-Default.decorator";
3
3
  import { A_Dependency_Flat } from "./A-Dependency-Flat.decorator";
4
4
  import { A_Dependency_Load } from "./A-Dependency-Load.decorator";
5
5
  import { A_Dependency_Parent } from "./A-Dependency-Parent.decorator";
6
6
  import { A_Dependency_Require } from "./A-Dependency-Require.decorator";
7
7
  import { A_DependencyError } from "./A-Dependency.error";
8
- import { A_TYPES__A_Dependency_EntityInjectionPagination, A_TYPES__A_Dependency_EntityInjectionQuery, A_TYPES__A_Dependency_Serialized, A_TYPES__A_DependencyInjectable, A_TYPES__A_DependencyResolutionStrategy } from "./A-Dependency.types";
9
- import { A_TYPES__Ctor } from "@adaas/a-concept/types/A_Common.types";
8
+ import {
9
+ A_TYPES__A_Dependency_EntityInjectionPagination,
10
+ A_TYPES__A_Dependency_EntityInjectionQuery,
11
+ A_TYPES__A_Dependency_Serialized,
12
+ A_TYPES__A_DependencyInjectable,
13
+ A_TYPES__A_DependencyResolutionStrategy
14
+ } from "./A-Dependency.types";
15
+ import { A_TYPES__Ctor } from "@adaas/a-concept/types";
10
16
  import { A_Dependency_All } from "./A-Dependency-All.decorator";
17
+ import { A_Dependency_Query } from "./A-Dependency-Query.decorator";
11
18
 
12
19
 
13
20
  export class A_Dependency<
@@ -68,6 +75,16 @@ export class A_Dependency<
68
75
  return A_Dependency_All;
69
76
  }
70
77
 
78
+ /**
79
+ * Allows to indicate that the dependency should be resolved by specific query parameters
80
+ * e.g. by ASEID, name, type, custom properties, etc.
81
+ *
82
+ * @returns
83
+ */
84
+ static get Query(): typeof A_Dependency_Query {
85
+ return A_Dependency_Query;
86
+ }
87
+
71
88
  protected _name: string;
72
89
  protected _target?: A_TYPES__Ctor<T>;
73
90
  protected _resolutionStrategy!: A_TYPES__A_DependencyResolutionStrategy;
@@ -1,4 +1,4 @@
1
- import { A_Error } from "../A-Error/A_Error.class";
1
+ import { A_Error } from "@adaas/a-concept/a-error";
2
2
 
3
3
  export class A_DependencyError extends A_Error {
4
4
 
@@ -1,15 +1,15 @@
1
1
  // ==================================== A-Dependency types ==================================== //
2
2
 
3
- import { A_TYPES__Ctor } from "@adaas/a-concept/types/A_Common.types";
4
- import { A_Caller } from "../A-Caller/A_Caller.class";
5
- import { A_Component } from "../A-Component/A-Component.class";
6
- import { A_Container } from "../A-Container/A-Container.class";
7
- import { A_Entity } from "../A-Entity/A-Entity.class"
8
- import { A_Error } from "../A-Error/A_Error.class";
9
- import { A_Feature } from "../A-Feature/A-Feature.class";
10
- import { A_Fragment } from "../A-Fragment/A-Fragment.class";
3
+ import { A_TYPES__Ctor } from "@adaas/a-concept/types";
4
+ import { A_Caller } from "@adaas/a-concept/a-caller";
5
+ import { A_Component } from "@adaas/a-concept/a-component";
6
+ import { A_Container } from "@adaas/a-concept/a-container";
7
+ import { A_Entity, A_TYPES__Entity_Constructor } from "@adaas/a-concept/a-entity"
8
+ import { A_Error } from "@adaas/a-concept/a-error";
9
+ import { A_Feature } from "@adaas/a-concept/a-feature";
10
+ import { A_Fragment } from "@adaas/a-concept/a-fragment";
11
+ import { A_Scope } from "@adaas/a-concept/a-scope";
11
12
  import { A_Dependency } from "./A-Dependency.class";
12
- import { A_Scope } from "../A-Scope/A-Scope.class";
13
13
 
14
14
 
15
15
  // ===========================================================================================
@@ -163,3 +163,14 @@ export type A_TYPES__A_Dependency_AllDecoratorReturn<T = any> = (
163
163
  propertyKey: string | symbol | undefined,
164
164
  parameterIndex: number
165
165
  ) => void
166
+
167
+ export type A_TYPES__A_Dependency_QueryTarget<T extends A_Entity = A_Entity> = T
168
+ | A_TYPES__Entity_Constructor<T>
169
+ /**
170
+ * A-Dependency Query decorator return type
171
+ */
172
+ export type A_TYPES__A_Dependency_QueryDecoratorReturn<T = any> = (
173
+ target: T,
174
+ propertyKey: string | symbol | undefined,
175
+ parameterIndex: number
176
+ ) => void
@@ -0,0 +1,18 @@
1
+ export { A_Dependency } from './A-Dependency.class'
2
+ // export {A_DependencyMeta} from './A-Dependency.meta'
3
+ export { A_DependencyError } from './A-Dependency.error'
4
+ export * from './A-Dependency.types'
5
+ // export * from './A-Dependency.constants'
6
+
7
+ // --------------------------------------------------------
8
+ // -----------------------Decorators-----------------------
9
+ // --------------------------------------------------------
10
+ export { A_Dependency_All } from './A-Dependency-All.decorator';
11
+ export { A_Dependency_Default } from './A-Dependency-Default.decorator';
12
+ export { A_Dependency_Flat } from './A-Dependency-Flat.decorator';
13
+ export { A_Dependency_Load } from './A-Dependency-Load.decorator';
14
+ export { A_Dependency_Parent } from './A-Dependency-Parent.decorator';
15
+ export { A_Dependency_Require } from './A-Dependency-Require.decorator';
16
+ export { A_Dependency_Query } from './A-Dependency-Query.decorator';
17
+
18
+
@@ -1,16 +1,18 @@
1
+ import { A_Context } from "@adaas/a-concept/a-context";
1
2
  import {
2
3
  A_TYPES__Entity_Serialized,
3
4
  A_TYPES__Entity_Init,
4
5
  A_TYPES__IEntity,
5
6
  } from "./A-Entity.types";
6
- import { A_Context } from "../A-Context/A-Context.class";
7
- import { A_Scope } from "../A-Scope/A-Scope.class";
8
- import { A_FormatterHelper } from "@adaas/a-concept/helpers/A_Formatter.helper";
9
- import { ASEID } from "../ASEID/ASEID.class";
10
- import { A_IdentityHelper } from "@adaas/a-concept/helpers/A_Identity.helper";
7
+ import { A_Scope } from "@adaas/a-concept/a-scope";
8
+ import { A_FormatterHelper} from "@adaas/a-concept/helpers/A_Formatter.helper";
9
+ import { A_IdentityHelper} from "@adaas/a-concept/helpers/A_Identity.helper";
10
+ import {
11
+ ASEID,
12
+ A_TYPES__ASEID_Constructor
13
+ } from "@adaas/a-concept/aseid";
11
14
  import { A_EntityError } from "./A-Entity.error";
12
- import { A_Feature } from "../A-Feature/A-Feature.class";
13
- import { A_TYPES__ASEID_Constructor } from "../ASEID/ASEID.types";
15
+ import { A_Feature } from "@adaas/a-concept/a-feature";
14
16
 
15
17
 
16
18
  /**
@@ -337,7 +339,7 @@ export class A_Entity<
337
339
  */
338
340
  fromUndefined(): void {
339
341
  this.aseid = this.generateASEID();
340
-
342
+
341
343
  return;
342
344
  }
343
345
 
@@ -350,7 +352,7 @@ export class A_Entity<
350
352
  * @returns
351
353
  */
352
354
  fromNew(newEntity: _ConstructorType): void {
353
- this.aseid = this.generateASEID();
355
+ this.aseid = this.generateASEID();
354
356
 
355
357
  return;
356
358
  }
@@ -1,4 +1,4 @@
1
- import { A_Error } from "../A-Error/A_Error.class";
1
+ import { A_Error } from "@adaas/a-concept/a-error";
2
2
 
3
3
 
4
4
 
@@ -1,8 +1,8 @@
1
- import { A_Meta } from "../A-Meta/A-Meta.class";
1
+ import { A_Meta } from "@adaas/a-concept/a-meta";
2
2
  import { A_TYPES__EntityMeta } from "./A-Entity.types";
3
3
  import { A_TYPES__EntityMetaKey } from "./A-Entity.constants";
4
- import { A_TYPES__FeatureDefineDecoratorMeta } from "../A-Feature/A-Feature.types";
5
- import { A_TYPES__A_InjectDecorator_Meta } from "../A-Inject/A-Inject.types";
4
+ import { A_TYPES__FeatureDefineDecoratorMeta } from "@adaas/a-concept/a-feature";
5
+ import { A_TYPES__A_InjectDecorator_Meta } from "@adaas/a-concept/a-inject";
6
6
 
7
7
 
8
8
  export class A_EntityMeta extends A_Meta<A_TYPES__EntityMeta> {
@@ -1,10 +1,10 @@
1
- import { A_Meta } from "../A-Meta/A-Meta.class";
1
+ import { A_Meta } from "@adaas/a-concept/a-meta";
2
2
  import { A_Entity } from "./A-Entity.class";
3
- import { ASEID } from "../ASEID/ASEID.class";
3
+ import { ASEID } from "@adaas/a-concept/aseid";
4
4
  import { A_TYPES__EntityMetaKey } from "./A-Entity.constants";
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";
7
- import { A_TYPES__Ctor } from "@adaas/a-concept/types/A_Common.types";
5
+ import { A_TYPES__FeatureDefineDecoratorMeta, A_TYPES__FeatureExtendDecoratorMeta } from "@adaas/a-concept/a-feature";
6
+ import { A_TYPES__A_InjectDecorator_Meta } from "@adaas/a-concept/a-inject";
7
+ import { A_TYPES__Ctor } from "@adaas/a-concept/types";
8
8
 
9
9
 
10
10
  /**
@@ -0,0 +1,5 @@
1
+ export { A_Entity } from './A-Entity.class';
2
+ export { A_EntityMeta } from './A-Entity.meta';
3
+ export { A_EntityError } from './A-Entity.error';
4
+ export * from './A-Entity.types';
5
+ export * from './A-Entity.constants';
@@ -1,3 +1,4 @@
1
+ import { A_Context } from '@adaas/a-concept/a-context';
1
2
  import {
2
3
  A_TYPES__Error_Init,
3
4
  A_TYPES__Error_Serialized
@@ -7,9 +8,8 @@ import {
7
8
  A_CONSTANTS__ERROR_DESCRIPTION
8
9
  } from './A_Error.constants';
9
10
  import { A_FormatterHelper } from '@adaas/a-concept/helpers/A_Formatter.helper';
10
- import { A_Context } from '../A-Context/A-Context.class';
11
- import { A_TypeGuards } from '@adaas/a-concept/helpers/A_TypeGuards.helper';
12
- import { ASEID } from '../ASEID/ASEID.class';
11
+ import { A_BasicTypeGuards } from '@adaas/a-concept/helpers/A_BasicTypeGuards.helper';
12
+ import { ASEID } from '@adaas/a-concept/aseid';
13
13
  import { A_CONCEPT_ENV } from '@adaas/a-concept/env';
14
14
 
15
15
 
@@ -163,23 +163,23 @@ export class A_Error<
163
163
  super(param1.message);
164
164
  break;
165
165
 
166
- case A_TypeGuards.isErrorSerializedType<_SerializedType>(param1):
166
+ case A_BasicTypeGuards.isErrorSerializedType<_SerializedType>(param1):
167
167
  super(param1.message);
168
168
  break;
169
169
 
170
- case A_TypeGuards.isErrorConstructorType<_ConstructorType>(param1) && 'description' in param1:
170
+ case A_BasicTypeGuards.isErrorConstructorType<_ConstructorType>(param1) && 'description' in param1:
171
171
  super(`[${param1.title}]: ${param1.description}`);
172
172
  break;
173
173
 
174
- case A_TypeGuards.isErrorConstructorType<_ConstructorType>(param1) && !('description' in param1):
174
+ case A_BasicTypeGuards.isErrorConstructorType<_ConstructorType>(param1) && !('description' in param1):
175
175
  super(param1.title);
176
176
  break;
177
177
 
178
- case A_TypeGuards.isString(param1) && !param2:
178
+ case A_BasicTypeGuards.isString(param1) && !param2:
179
179
  super(param1);
180
180
  break;
181
181
 
182
- case A_TypeGuards.isString(param1) && !!param2:
182
+ case A_BasicTypeGuards.isString(param1) && !!param2:
183
183
  super(`[${param1}]: ${param2}`);
184
184
  break;
185
185
 
@@ -313,19 +313,19 @@ export class A_Error<
313
313
  ): (param1: any, param2: any) => void | (() => void) {
314
314
  switch (true) {
315
315
 
316
- case A_TypeGuards.isString(param1) && !param2:
316
+ case A_BasicTypeGuards.isString(param1) && !param2:
317
317
  return this.fromMessage;
318
318
 
319
- case A_TypeGuards.isString(param1) && !!param2:
319
+ case A_BasicTypeGuards.isString(param1) && !!param2:
320
320
  return this.fromTitle;
321
321
 
322
322
  case param1 instanceof Error:
323
323
  return this.fromError;
324
324
 
325
- case A_TypeGuards.isErrorSerializedType<_SerializedType>(param1):
325
+ case A_BasicTypeGuards.isErrorSerializedType<_SerializedType>(param1):
326
326
  return this.fromJSON;
327
327
 
328
- case A_TypeGuards.isErrorConstructorType<_ConstructorType>(param1):
328
+ case A_BasicTypeGuards.isErrorConstructorType<_ConstructorType>(param1):
329
329
  return this.fromConstructor;
330
330
 
331
331
  default: {
@@ -418,7 +418,7 @@ export class A_Error<
418
418
 
419
419
  this._title = params.title;
420
420
  this._code = params.code;
421
- this._scope = params.scope ? (A_TypeGuards.isScopeInstance(params.scope) ? params.scope.name : params.scope) : undefined;
421
+ this._scope = params.scope ? (A_BasicTypeGuards.isScopeInstance(params.scope) ? (params.scope as any).name : params.scope) : undefined;
422
422
 
423
423
  this._aseid = new ASEID({
424
424
  concept: (this.constructor as typeof A_Error).concept,
@@ -1,5 +1,5 @@
1
- import { A_TYPES__Ctor } from "@adaas/a-concept/types/A_Common.types";
2
- import { A_Scope } from "../A-Scope/A-Scope.class";
1
+ import { A_TYPES__Ctor } from "@adaas/a-concept/types";
2
+ import { A_Scope } from "@adaas/a-concept/a-scope";
3
3
  import { A_Error } from "./A_Error.class";
4
4
 
5
5
 
@@ -0,0 +1,3 @@
1
+ export { A_Error } from './A_Error.class';
2
+ export * from './A_Error.types';
3
+ export * from './A_Error.constants';
@@ -4,17 +4,23 @@ import {
4
4
  A_TYPES__FeatureDefineDecoratorMeta,
5
5
  A_TYPES__FeatureDefineDecoratorTarget
6
6
  } from "./A-Feature.types";
7
- import { A_Context } from "@adaas/a-concept/global/A-Context/A-Context.class";
8
- import { A_EntityMeta } from "@adaas/a-concept/global/A-Entity/A-Entity.meta";
9
- import { A_ContainerMeta } from "@adaas/a-concept/global/A-Container/A-Container.meta";
10
- import { A_ComponentMeta } from "@adaas/a-concept/global/A-Component/A-Component.meta";
11
- import { A_Meta } from "@adaas/a-concept/global/A-Meta/A-Meta.class";
12
- import { A_TYPES__EntityMetaKey } from "@adaas/a-concept/global/A-Entity/A-Entity.constants";
13
- import { A_TYPES__ContainerMetaKey } from "@adaas/a-concept/global/A-Container/A-Container.constants";
14
- import { A_TYPES__ComponentMetaKey } from "@adaas/a-concept/global/A-Component/A-Component.constants";
15
- import { A_TypeGuards } from "@adaas/a-concept/helpers/A_TypeGuards.helper";
7
+ import { A_Context } from "@adaas/a-concept/a-context";
8
+ import {
9
+ A_EntityMeta,
10
+ A_TYPES__EntityMetaKey
11
+ } from "@adaas/a-concept/a-entity";
12
+ import {
13
+ A_ContainerMeta,
14
+ A_TYPES__ContainerMetaKey
15
+ } from "@adaas/a-concept/a-container";
16
+ import {
17
+ A_ComponentMeta,
18
+ A_TYPES__ComponentMetaKey
19
+ } from "@adaas/a-concept/a-component";
20
+ import { A_Meta } from "@adaas/a-concept/a-meta";
16
21
  import { A_FeatureError } from "./A-Feature.error";
17
- import { A_CommonHelper } from "@adaas/a-concept/helpers/A_Common.helper";
22
+ import { A_TypeGuards} from "@adaas/a-concept/helpers/A_TypeGuards.helper";
23
+ import { A_CommonHelper} from "@adaas/a-concept/helpers/A_Common.helper";
18
24
 
19
25
  /**
20
26
  * A-Feature decorator
@@ -1,13 +1,17 @@
1
- import { A_Context } from "@adaas/a-concept/global/A-Context/A-Context.class";
2
- import { A_Meta } from "@adaas/a-concept/global/A-Meta/A-Meta.class";
3
- import { A_TYPES__FeatureExtendDecoratorConfig, A_TYPES__FeatureExtendDecoratorDescriptor, A_TYPES__FeatureExtendDecoratorScopeItem, A_TYPES__FeatureExtendDecoratorTarget } from "./A-Feature.types";
4
- import { A_TypeGuards } from "@adaas/a-concept/helpers/A_TypeGuards.helper";
5
- import { A_TYPES__ComponentMetaKey } from "../A-Component/A-Component.constants";
1
+ import { A_Context } from "@adaas/a-concept/a-context";
2
+ import { A_Meta } from "@adaas/a-concept/a-meta";
3
+ import {
4
+ A_TYPES__FeatureExtendDecoratorConfig,
5
+ A_TYPES__FeatureExtendDecoratorDescriptor,
6
+ A_TYPES__FeatureExtendDecoratorScopeItem,
7
+ A_TYPES__FeatureExtendDecoratorTarget
8
+ } from "./A-Feature.types";
9
+ import { A_TYPES__ComponentMetaKey } from "@adaas/a-concept/a-component";
6
10
  import { A_FeatureError } from "./A-Feature.error";
7
- import { A_CommonHelper } from "@adaas/a-concept/helpers/A_Common.helper";
8
- import { A_TYPES__EntityMetaKey } from "../A-Entity/A-Entity.constants";
9
- import { A_TYPES__ContainerMetaKey } from "../A-Container/A-Container.constants";
10
- import { A_Container } from "../A-Container/A-Container.class";
11
+ import { A_TypeGuards} from "@adaas/a-concept/helpers/A_TypeGuards.helper";
12
+ import { A_CommonHelper} from "@adaas/a-concept/helpers/A_Common.helper";
13
+ import { A_TYPES__EntityMetaKey } from "@adaas/a-concept/a-entity";
14
+ import { A_TYPES__ContainerMetaKey } from "@adaas/a-concept/a-container";
11
15
 
12
16
 
13
17
 
@@ -5,17 +5,19 @@ import {
5
5
  A_TYPES__FeatureAvailableComponents,
6
6
  A_TYPES__FeatureState,
7
7
  } from "./A-Feature.types";
8
- import { A_Feature_Define } from "@adaas/a-concept/global/A-Feature/A-Feature-Define.decorator";
9
- import { A_Feature_Extend } from "@adaas/a-concept/global/A-Feature/A-Feature-Extend.decorator";
10
- import { A_Stage } from "../A-Stage/A-Stage.class";
11
- import { A_StepsManager } from "@adaas/a-concept/global/A-StepManager/A-StepManager.class";
12
- import { A_StageError } from "../A-Stage/A-Stage.error";
13
- import { A_TypeGuards } from "@adaas/a-concept/helpers/A_TypeGuards.helper";
8
+ import { A_Feature_Define } from "./A-Feature-Define.decorator";
9
+ import { A_Feature_Extend } from "./A-Feature-Extend.decorator";
10
+ import {
11
+ A_Stage,
12
+ A_StageError
13
+ } from "@adaas/a-concept/a-stage";
14
+ import { A_StepsManager } from "@adaas/a-concept/a-step-manager";
15
+ import { A_TypeGuards} from "@adaas/a-concept/helpers/A_TypeGuards.helper";
14
16
  import { A_FeatureError } from "./A-Feature.error";
15
- import { A_Context } from "../A-Context/A-Context.class";
16
- import { A_Caller } from "../A-Caller/A_Caller.class";
17
- import { A_Scope } from "../A-Scope/A-Scope.class";
18
- import { A_Component } from "../A-Component/A-Component.class";
17
+ import { A_Context } from "@adaas/a-concept/a-context";
18
+ import { A_Caller } from "@adaas/a-concept/a-caller";
19
+ import { A_Scope } from "@adaas/a-concept/a-scope";
20
+ import { A_Component } from "@adaas/a-concept/a-component";
19
21
 
20
22
 
21
23
  /**
@@ -530,7 +532,7 @@ export class A_Feature<T extends A_TYPES__FeatureAvailableComponents = A_TYPES__
530
532
  }
531
533
 
532
534
  this.scope.destroy();
533
-
535
+
534
536
  return this._error;
535
537
  }
536
538
 
@@ -592,7 +594,7 @@ export class A_Feature<T extends A_TYPES__FeatureAvailableComponents = A_TYPES__
592
594
  feature._caller = this._caller;
593
595
 
594
596
  const result = feature.process(featureScope);
595
-
597
+
596
598
  // If the chained feature processing returns a promise, ensure errors are propagated
597
599
  if (A_TypeGuards.isPromiseInstance(result)) {
598
600
  return result.catch(error => {
@@ -600,7 +602,7 @@ export class A_Feature<T extends A_TYPES__FeatureAvailableComponents = A_TYPES__
600
602
  throw error;
601
603
  });
602
604
  }
603
-
605
+
604
606
  return result;
605
607
  }
606
608
 
@@ -1,5 +1,5 @@
1
- import { A_Error } from "../A-Error/A_Error.class";
2
- import { A_Stage } from "../A-Stage/A-Stage.class";
1
+ import { A_Error } from "@adaas/a-concept/a-error";
2
+ import { A_Stage } from "@adaas/a-concept/a-stage";
3
3
  import { A_TYPES__FeatureError_Init } from "./A-Feature.types";
4
4
 
5
5
 
@@ -1,16 +1,25 @@
1
- import { A_TYPES__A_StageStep, A_TYPES_StageExecutionBehavior } from "../A-Stage/A-Stage.types"
2
- import { A_Fragment } from "../A-Fragment/A-Fragment.class"
3
- import { A_Entity } from "@adaas/a-concept/global/A-Entity/A-Entity.class"
4
- import { A_Container } from "../A-Container/A-Container.class"
5
- import { A_Component } from "../A-Component/A-Component.class"
6
- import { A_TYPES__Component_Constructor } from "../A-Component/A-Component.types"
7
- import { A_TYPES__Container_Constructor } from "../A-Container/A-Container.types"
8
- import { A_TYPES__Entity_Constructor } from "../A-Entity/A-Entity.types"
1
+ import {
2
+ A_Stage,
3
+ A_TYPES__A_StageStep,
4
+ A_TYPES_StageExecutionBehavior
5
+ } from "@adaas/a-concept/a-stage"
6
+ import { A_Entity } from "@adaas/a-concept/a-entity"
7
+ import {
8
+ A_Container,
9
+ A_TYPES__Container_Constructor
10
+ } from "@adaas/a-concept/a-container"
11
+ import {
12
+ A_Component,
13
+ A_TYPES__Component_Constructor
14
+ } from "@adaas/a-concept/a-component"
15
+ import { A_TYPES__Entity_Constructor } from "@adaas/a-concept/a-entity"
9
16
  import { A_Feature } from "./A-Feature.class"
10
- import { A_TYPES__Ctor, A_TYPES__Required } from "@adaas/a-concept/types/A_Common.types"
11
- import { A_Scope } from "../A-Scope/A-Scope.class"
12
- import { A_Stage } from "../A-Stage/A-Stage.class"
13
- import { A_TYPES__Error_Init } from "../A-Error/A_Error.types"
17
+ import {
18
+ A_TYPES__Ctor,
19
+ A_TYPES__Required
20
+ } from "@adaas/a-concept/types";
21
+ import { A_Scope } from "@adaas/a-concept/a-scope"
22
+ import { A_TYPES__Error_Init } from "@adaas/a-concept/a-error"
14
23
 
15
24
 
16
25
  // ============================================================================
@@ -0,0 +1,13 @@
1
+ export { A_Feature } from './A-Feature.class';
2
+ // export { A_FeatureMeta } from './A-Feature.meta';
3
+ export { A_FeatureError } from './A-Feature.error';
4
+ export * from './A-Feature.types';
5
+ // export * from './A-Feature.constants';
6
+
7
+
8
+
9
+ // --------------------------------------------------------
10
+ // -----------------------Decorators-----------------------
11
+ // --------------------------------------------------------
12
+ export { A_Feature_Extend } from './A-Feature-Extend.decorator';
13
+ export { A_Feature_Define } from './A-Feature-Define.decorator';
@@ -1,5 +1,3 @@
1
- import { A_TYPES__DeepPartial } from "@adaas/a-concept/types/A_Common.types";
2
- import { A_Meta } from "../A-Meta/A-Meta.class";
3
1
  import { A_TYPES__Fragment_Init, A_TYPES__Fragment_Serialized } from "./A-Fragment.types";
4
2
 
5
3
 
@@ -2,7 +2,7 @@
2
2
  // --------------------------- Primary Types ----------------------------------
3
3
  // ============================================================================
4
4
 
5
- import { A_TYPES__Ctor } from "@adaas/a-concept/types/A_Common.types";
5
+ import { A_TYPES__Ctor } from "@adaas/a-concept/types";
6
6
  import { A_Fragment } from "./A-Fragment.class";
7
7
 
8
8
  /**
@@ -0,0 +1,5 @@
1
+ export { A_Fragment } from './A-Fragment.class';
2
+ // export {A_FragmentMeta} from './A-Fragment.meta';
3
+ // export {A_FragmentError} from './A-Fragment.error';
4
+ export * from './A-Fragment.types';
5
+ // export * from './A-Fragment.constants';