@adaas/a-concept 0.1.23 → 0.1.25

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 (234) hide show
  1. package/dist/index.cjs +3 -0
  2. package/dist/index.cjs.map +1 -0
  3. package/dist/index.d.mts +3952 -0
  4. package/dist/index.d.ts +3952 -50
  5. package/dist/index.mjs +3 -0
  6. package/dist/index.mjs.map +1 -0
  7. package/package.json +5 -6
  8. package/src/global/A-Abstraction/A-Abstraction-Extend.decorator.ts +18 -13
  9. package/src/global/A-Component/A-Component.meta.ts +3 -2
  10. package/src/global/A-Container/A-Container.meta.ts +5 -8
  11. package/src/global/A-Context/A-Context.class.ts +81 -7
  12. package/src/global/A-Context/A-Context.error.ts +4 -0
  13. package/src/global/A-Dependency/A-Dependency-Default.decorator.ts +75 -0
  14. package/src/global/A-Dependency/A-Dependency-Load.decorator.ts +80 -0
  15. package/src/global/A-Dependency/A-Dependency-Require.decorator.ts +68 -0
  16. package/src/global/A-Dependency/A-Dependency.class.ts +33 -0
  17. package/src/global/A-Dependency/A-Dependency.error.ts +13 -0
  18. package/src/global/A-Dependency/A-Dependency.types.ts +28 -0
  19. package/src/global/A-Entity/A-Entity.class.ts +2 -1
  20. package/src/global/A-Feature/A-Feature-Define.decorator.ts +7 -4
  21. package/src/global/A-Feature/A-Feature-Extend.decorator.ts +23 -17
  22. package/src/global/A-Feature/A-Feature.class.ts +12 -1
  23. package/src/global/A-Feature/A-Feature.types.ts +33 -8
  24. package/src/global/A-Inject/A-Inject.decorator.ts +4 -2
  25. package/src/global/A-Inject/A-Inject.types.ts +5 -3
  26. package/src/global/A-Scope/A-Scope.class.ts +85 -57
  27. package/src/global/A-Stage/A-Stage.class.ts +22 -2
  28. package/src/global/A-Stage/A-Stage.error.ts +2 -0
  29. package/src/global/A-Stage/A-Stage.types.ts +7 -2
  30. package/src/global/A-StepManager/A-StepManager.class.ts +19 -13
  31. package/src/helpers/A_Common.helper.ts +101 -0
  32. package/src/helpers/A_TypeGuards.helper.ts +8 -0
  33. package/src/index.ts +88 -0
  34. package/tests/A-Component.test.ts +1 -1
  35. package/tests/A-Concept.test.ts +58 -10
  36. package/tests/A-Dependency.test.ts +93 -0
  37. package/tests/A-Feature.test.ts +11 -11
  38. package/tests/A-Scope.test.ts +10 -10
  39. package/tests/A-StepManager.test.ts +60 -11
  40. package/tsconfig.json +2 -2
  41. package/tsup.config.ts +32 -0
  42. package/dist/index.js +0 -112
  43. package/dist/index.js.map +0 -1
  44. package/dist/src/constants/env.constants.d.ts +0 -33
  45. package/dist/src/constants/env.constants.js +0 -47
  46. package/dist/src/constants/env.constants.js.map +0 -1
  47. package/dist/src/global/A-Abstraction/A-Abstraction-Extend.decorator.d.ts +0 -23
  48. package/dist/src/global/A-Abstraction/A-Abstraction-Extend.decorator.js +0 -89
  49. package/dist/src/global/A-Abstraction/A-Abstraction-Extend.decorator.js.map +0 -1
  50. package/dist/src/global/A-Abstraction/A-Abstraction.class.d.ts +0 -74
  51. package/dist/src/global/A-Abstraction/A-Abstraction.class.js +0 -130
  52. package/dist/src/global/A-Abstraction/A-Abstraction.class.js.map +0 -1
  53. package/dist/src/global/A-Abstraction/A-Abstraction.error.d.ts +0 -7
  54. package/dist/src/global/A-Abstraction/A-Abstraction.error.js +0 -12
  55. package/dist/src/global/A-Abstraction/A-Abstraction.error.js.map +0 -1
  56. package/dist/src/global/A-Abstraction/A-Abstraction.types.d.ts +0 -38
  57. package/dist/src/global/A-Abstraction/A-Abstraction.types.js +0 -3
  58. package/dist/src/global/A-Abstraction/A-Abstraction.types.js.map +0 -1
  59. package/dist/src/global/A-Caller/A_Caller.class.d.ts +0 -33
  60. package/dist/src/global/A-Caller/A_Caller.class.js +0 -44
  61. package/dist/src/global/A-Caller/A_Caller.class.js.map +0 -1
  62. package/dist/src/global/A-Caller/A_Caller.error.d.ts +0 -7
  63. package/dist/src/global/A-Caller/A_Caller.error.js +0 -12
  64. package/dist/src/global/A-Caller/A_Caller.error.js.map +0 -1
  65. package/dist/src/global/A-Caller/A_Caller.types.d.ts +0 -18
  66. package/dist/src/global/A-Caller/A_Caller.types.js +0 -3
  67. package/dist/src/global/A-Caller/A_Caller.types.js.map +0 -1
  68. package/dist/src/global/A-Component/A-Component.class.d.ts +0 -34
  69. package/dist/src/global/A-Component/A-Component.class.js +0 -56
  70. package/dist/src/global/A-Component/A-Component.class.js.map +0 -1
  71. package/dist/src/global/A-Component/A-Component.constants.d.ts +0 -6
  72. package/dist/src/global/A-Component/A-Component.constants.js +0 -11
  73. package/dist/src/global/A-Component/A-Component.constants.js.map +0 -1
  74. package/dist/src/global/A-Component/A-Component.meta.d.ts +0 -34
  75. package/dist/src/global/A-Component/A-Component.meta.js +0 -77
  76. package/dist/src/global/A-Component/A-Component.meta.js.map +0 -1
  77. package/dist/src/global/A-Component/A-Component.types.d.ts +0 -76
  78. package/dist/src/global/A-Component/A-Component.types.js +0 -4
  79. package/dist/src/global/A-Component/A-Component.types.js.map +0 -1
  80. package/dist/src/global/A-Concept/A-Concept.class.d.ts +0 -153
  81. package/dist/src/global/A-Concept/A-Concept.class.js +0 -260
  82. package/dist/src/global/A-Concept/A-Concept.class.js.map +0 -1
  83. package/dist/src/global/A-Concept/A-Concept.constants.d.ts +0 -33
  84. package/dist/src/global/A-Concept/A-Concept.constants.js +0 -39
  85. package/dist/src/global/A-Concept/A-Concept.constants.js.map +0 -1
  86. package/dist/src/global/A-Concept/A-Concept.meta.d.ts +0 -6
  87. package/dist/src/global/A-Concept/A-Concept.meta.js +0 -12
  88. package/dist/src/global/A-Concept/A-Concept.meta.js.map +0 -1
  89. package/dist/src/global/A-Concept/A-Concept.types.d.ts +0 -66
  90. package/dist/src/global/A-Concept/A-Concept.types.js +0 -3
  91. package/dist/src/global/A-Concept/A-Concept.types.js.map +0 -1
  92. package/dist/src/global/A-Container/A-Container.class.d.ts +0 -52
  93. package/dist/src/global/A-Container/A-Container.class.js +0 -78
  94. package/dist/src/global/A-Container/A-Container.class.js.map +0 -1
  95. package/dist/src/global/A-Container/A-Container.constants.d.ts +0 -6
  96. package/dist/src/global/A-Container/A-Container.constants.js +0 -11
  97. package/dist/src/global/A-Container/A-Container.constants.js.map +0 -1
  98. package/dist/src/global/A-Container/A-Container.meta.d.ts +0 -35
  99. package/dist/src/global/A-Container/A-Container.meta.js +0 -83
  100. package/dist/src/global/A-Container/A-Container.meta.js.map +0 -1
  101. package/dist/src/global/A-Container/A-Container.types.d.ts +0 -75
  102. package/dist/src/global/A-Container/A-Container.types.js +0 -4
  103. package/dist/src/global/A-Container/A-Container.types.js.map +0 -1
  104. package/dist/src/global/A-Context/A-Context.class.d.ts +0 -361
  105. package/dist/src/global/A-Context/A-Context.class.js +0 -603
  106. package/dist/src/global/A-Context/A-Context.class.js.map +0 -1
  107. package/dist/src/global/A-Context/A-Context.error.d.ts +0 -20
  108. package/dist/src/global/A-Context/A-Context.error.js +0 -25
  109. package/dist/src/global/A-Context/A-Context.error.js.map +0 -1
  110. package/dist/src/global/A-Context/A-Context.types.d.ts +0 -5
  111. package/dist/src/global/A-Context/A-Context.types.js +0 -3
  112. package/dist/src/global/A-Context/A-Context.types.js.map +0 -1
  113. package/dist/src/global/A-Dependency/A-DependencyReference.class.d.ts +0 -0
  114. package/dist/src/global/A-Dependency/A-DependencyReference.class.js +0 -49
  115. package/dist/src/global/A-Dependency/A-DependencyReference.class.js.map +0 -1
  116. package/dist/src/global/A-Dependency/A-DependencyReference.types.d.ts +0 -0
  117. package/dist/src/global/A-Dependency/A-DependencyReference.types.js +0 -58
  118. package/dist/src/global/A-Dependency/A-DependencyReference.types.js.map +0 -1
  119. package/dist/src/global/A-Entity/A-Entity.class.d.ts +0 -214
  120. package/dist/src/global/A-Entity/A-Entity.class.js +0 -281
  121. package/dist/src/global/A-Entity/A-Entity.class.js.map +0 -1
  122. package/dist/src/global/A-Entity/A-Entity.constants.d.ts +0 -11
  123. package/dist/src/global/A-Entity/A-Entity.constants.js +0 -17
  124. package/dist/src/global/A-Entity/A-Entity.constants.js.map +0 -1
  125. package/dist/src/global/A-Entity/A-Entity.error.d.ts +0 -7
  126. package/dist/src/global/A-Entity/A-Entity.error.js +0 -12
  127. package/dist/src/global/A-Entity/A-Entity.error.js.map +0 -1
  128. package/dist/src/global/A-Entity/A-Entity.meta.d.ts +0 -11
  129. package/dist/src/global/A-Entity/A-Entity.meta.js +0 -18
  130. package/dist/src/global/A-Entity/A-Entity.meta.js.map +0 -1
  131. package/dist/src/global/A-Entity/A-Entity.types.d.ts +0 -56
  132. package/dist/src/global/A-Entity/A-Entity.types.js +0 -5
  133. package/dist/src/global/A-Entity/A-Entity.types.js.map +0 -1
  134. package/dist/src/global/A-Error/A_Error.class.d.ts +0 -229
  135. package/dist/src/global/A-Error/A_Error.class.js +0 -296
  136. package/dist/src/global/A-Error/A_Error.class.js.map +0 -1
  137. package/dist/src/global/A-Error/A_Error.constants.d.ts +0 -5
  138. package/dist/src/global/A-Error/A_Error.constants.js +0 -9
  139. package/dist/src/global/A-Error/A_Error.constants.js.map +0 -1
  140. package/dist/src/global/A-Error/A_Error.types.d.ts +0 -93
  141. package/dist/src/global/A-Error/A_Error.types.js +0 -3
  142. package/dist/src/global/A-Error/A_Error.types.js.map +0 -1
  143. package/dist/src/global/A-Feature/A-Feature-Define.decorator.d.ts +0 -15
  144. package/dist/src/global/A-Feature/A-Feature-Define.decorator.js +0 -76
  145. package/dist/src/global/A-Feature/A-Feature-Define.decorator.js.map +0 -1
  146. package/dist/src/global/A-Feature/A-Feature-Extend.decorator.d.ts +0 -56
  147. package/dist/src/global/A-Feature/A-Feature-Extend.decorator.js +0 -119
  148. package/dist/src/global/A-Feature/A-Feature-Extend.decorator.js.map +0 -1
  149. package/dist/src/global/A-Feature/A-Feature.class.d.ts +0 -175
  150. package/dist/src/global/A-Feature/A-Feature.class.js +0 -318
  151. package/dist/src/global/A-Feature/A-Feature.class.js.map +0 -1
  152. package/dist/src/global/A-Feature/A-Feature.error.d.ts +0 -25
  153. package/dist/src/global/A-Feature/A-Feature.error.js +0 -33
  154. package/dist/src/global/A-Feature/A-Feature.error.js.map +0 -1
  155. package/dist/src/global/A-Feature/A-Feature.types.d.ts +0 -310
  156. package/dist/src/global/A-Feature/A-Feature.types.js +0 -26
  157. package/dist/src/global/A-Feature/A-Feature.types.js.map +0 -1
  158. package/dist/src/global/A-Fragment/A-Fragment.class.d.ts +0 -36
  159. package/dist/src/global/A-Fragment/A-Fragment.class.js +0 -46
  160. package/dist/src/global/A-Fragment/A-Fragment.class.js.map +0 -1
  161. package/dist/src/global/A-Fragment/A-Fragment.types.d.ts +0 -21
  162. package/dist/src/global/A-Fragment/A-Fragment.types.js +0 -6
  163. package/dist/src/global/A-Fragment/A-Fragment.types.js.map +0 -1
  164. package/dist/src/global/A-Inject/A-Inject.decorator.d.ts +0 -80
  165. package/dist/src/global/A-Inject/A-Inject.decorator.js +0 -49
  166. package/dist/src/global/A-Inject/A-Inject.decorator.js.map +0 -1
  167. package/dist/src/global/A-Inject/A-Inject.error.d.ts +0 -5
  168. package/dist/src/global/A-Inject/A-Inject.error.js +0 -10
  169. package/dist/src/global/A-Inject/A-Inject.error.js.map +0 -1
  170. package/dist/src/global/A-Inject/A-Inject.types.d.ts +0 -42
  171. package/dist/src/global/A-Inject/A-Inject.types.js +0 -3
  172. package/dist/src/global/A-Inject/A-Inject.types.js.map +0 -1
  173. package/dist/src/global/A-Meta/A-Meta.class.d.ts +0 -97
  174. package/dist/src/global/A-Meta/A-Meta.class.js +0 -164
  175. package/dist/src/global/A-Meta/A-Meta.class.js.map +0 -1
  176. package/dist/src/global/A-Meta/A-Meta.types.d.ts +0 -14
  177. package/dist/src/global/A-Meta/A-Meta.types.js +0 -3
  178. package/dist/src/global/A-Meta/A-Meta.types.js.map +0 -1
  179. package/dist/src/global/A-Scope/A-Scope.class.d.ts +0 -466
  180. package/dist/src/global/A-Scope/A-Scope.class.js +0 -791
  181. package/dist/src/global/A-Scope/A-Scope.class.js.map +0 -1
  182. package/dist/src/global/A-Scope/A-Scope.error.d.ts +0 -8
  183. package/dist/src/global/A-Scope/A-Scope.error.js +0 -13
  184. package/dist/src/global/A-Scope/A-Scope.error.js.map +0 -1
  185. package/dist/src/global/A-Scope/A-Scope.types.d.ts +0 -81
  186. package/dist/src/global/A-Scope/A-Scope.types.js +0 -3
  187. package/dist/src/global/A-Scope/A-Scope.types.js.map +0 -1
  188. package/dist/src/global/A-Stage/A-Stage.class.d.ts +0 -112
  189. package/dist/src/global/A-Stage/A-Stage.class.js +0 -240
  190. package/dist/src/global/A-Stage/A-Stage.class.js.map +0 -1
  191. package/dist/src/global/A-Stage/A-Stage.error.d.ts +0 -4
  192. package/dist/src/global/A-Stage/A-Stage.error.js +0 -11
  193. package/dist/src/global/A-Stage/A-Stage.error.js.map +0 -1
  194. package/dist/src/global/A-Stage/A-Stage.types.d.ts +0 -97
  195. package/dist/src/global/A-Stage/A-Stage.types.js +0 -43
  196. package/dist/src/global/A-Stage/A-Stage.types.js.map +0 -1
  197. package/dist/src/global/A-StepManager/A-StepManager.class.d.ts +0 -20
  198. package/dist/src/global/A-StepManager/A-StepManager.class.js +0 -111
  199. package/dist/src/global/A-StepManager/A-StepManager.class.js.map +0 -1
  200. package/dist/src/global/A-StepManager/A-StepManager.error.d.ts +0 -4
  201. package/dist/src/global/A-StepManager/A-StepManager.error.js +0 -9
  202. package/dist/src/global/A-StepManager/A-StepManager.error.js.map +0 -1
  203. package/dist/src/global/ASEID/ASEID.class.d.ts +0 -130
  204. package/dist/src/global/ASEID/ASEID.class.js +0 -167
  205. package/dist/src/global/ASEID/ASEID.class.js.map +0 -1
  206. package/dist/src/global/ASEID/ASEID.constants.d.ts +0 -0
  207. package/dist/src/global/ASEID/ASEID.constants.js +0 -2
  208. package/dist/src/global/ASEID/ASEID.constants.js.map +0 -1
  209. package/dist/src/global/ASEID/ASEID.error.d.ts +0 -5
  210. package/dist/src/global/ASEID/ASEID.error.js +0 -10
  211. package/dist/src/global/ASEID/ASEID.error.js.map +0 -1
  212. package/dist/src/global/ASEID/ASEID.types.d.ts +0 -65
  213. package/dist/src/global/ASEID/ASEID.types.js +0 -5
  214. package/dist/src/global/ASEID/ASEID.types.js.map +0 -1
  215. package/dist/src/helpers/A_Common.helper.d.ts +0 -28
  216. package/dist/src/helpers/A_Common.helper.js +0 -170
  217. package/dist/src/helpers/A_Common.helper.js.map +0 -1
  218. package/dist/src/helpers/A_Formatter.helper.d.ts +0 -35
  219. package/dist/src/helpers/A_Formatter.helper.js +0 -62
  220. package/dist/src/helpers/A_Formatter.helper.js.map +0 -1
  221. package/dist/src/helpers/A_Identity.helper.d.ts +0 -29
  222. package/dist/src/helpers/A_Identity.helper.js +0 -43
  223. package/dist/src/helpers/A_Identity.helper.js.map +0 -1
  224. package/dist/src/helpers/A_TypeGuards.helper.d.ts +0 -207
  225. package/dist/src/helpers/A_TypeGuards.helper.js +0 -296
  226. package/dist/src/helpers/A_TypeGuards.helper.js.map +0 -1
  227. package/dist/src/types/A_Common.types.d.ts +0 -36
  228. package/dist/src/types/A_Common.types.js +0 -3
  229. package/dist/src/types/A_Common.types.js.map +0 -1
  230. package/index.ts +0 -81
  231. package/src/global/A-Dependency/A-DependencyReference.class.ts +0 -61
  232. package/src/global/A-Dependency/A-DependencyReference.types.ts +0 -61
  233. package/trace-require.js +0 -46
  234. package/tsconfig.build.json +0 -58
@@ -1,296 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.A_TypeGuards = void 0;
4
- const A_Component_class_1 = require("../global/A-Component/A-Component.class");
5
- const A_Component_meta_1 = require("../global/A-Component/A-Component.meta");
6
- const A_Container_class_1 = require("../global/A-Container/A-Container.class");
7
- const A_Container_meta_1 = require("../global/A-Container/A-Container.meta");
8
- const A_Entity_class_1 = require("../global/A-Entity/A-Entity.class");
9
- const A_Entity_meta_1 = require("../global/A-Entity/A-Entity.meta");
10
- const A_Feature_class_1 = require("../global/A-Feature/A-Feature.class");
11
- const A_Fragment_class_1 = require("../global/A-Fragment/A-Fragment.class");
12
- const A_Scope_class_1 = require("../global/A-Scope/A-Scope.class");
13
- const A_Caller_class_1 = require("../global/A-Caller/A_Caller.class");
14
- const A_Error_class_1 = require("../global/A-Error/A_Error.class");
15
- const A_Common_helper_1 = require("./A_Common.helper");
16
- class A_TypeGuards {
17
- // ===========================================================================
18
- // ============================= BASE Type Guards ============================
19
- // ===========================================================================
20
- /**
21
- * Check if value is a string
22
- *
23
- * @param value
24
- * @returns
25
- */
26
- static isString(value) {
27
- return typeof value === 'string' || value instanceof String;
28
- }
29
- /**
30
- * Check if value is a number
31
- *
32
- * @param value
33
- * @returns
34
- */
35
- static isNumber(value) {
36
- return typeof value === 'number' && isFinite(value);
37
- }
38
- /**
39
- * Check if value is a boolean
40
- *
41
- * @param value
42
- * @returns
43
- */
44
- static isBoolean(value) {
45
- return typeof value === 'boolean';
46
- }
47
- /**
48
- * Check if value is an array
49
- *
50
- * @param value
51
- * @returns
52
- */
53
- static isArray(value) {
54
- return Array.isArray(value);
55
- }
56
- /**
57
- * Check if value is an object
58
- *
59
- * @param value
60
- * @returns
61
- */
62
- static isObject(value) {
63
- return value && typeof value === 'object' && !Array.isArray(value);
64
- }
65
- /**
66
- * Check if value is a function
67
- *
68
- * @param value
69
- * @returns
70
- */
71
- static isFunction(value) {
72
- return typeof value === 'function';
73
- }
74
- static isUndefined(value) {
75
- return typeof value === 'undefined';
76
- }
77
- static isRegExp(value) {
78
- return value instanceof RegExp;
79
- }
80
- // ===========================================================================
81
- // ==========================A-Concept Type Guards ===========================
82
- // ===========================================================================
83
- /**
84
- * Type guard to check if the constructor is of type A_Container
85
- *
86
- * @param ctor
87
- * @returns
88
- */
89
- static isContainerConstructor(ctor) {
90
- return typeof ctor === 'function' && A_Common_helper_1.A_CommonHelper.isInheritedFrom(ctor, A_Container_class_1.A_Container);
91
- }
92
- /**
93
- * Type guard to check if the constructor is of type A_Component
94
- *
95
- * @param ctor
96
- * @returns
97
- */
98
- static isComponentConstructor(ctor) {
99
- return typeof ctor === 'function' && A_Common_helper_1.A_CommonHelper.isInheritedFrom(ctor, A_Component_class_1.A_Component);
100
- }
101
- /**
102
- * Type guard to check if the constructor is of type A_Fragment
103
- *
104
- * @param ctor
105
- * @returns
106
- */
107
- static isFragmentConstructor(ctor) {
108
- return typeof ctor === 'function' && A_Common_helper_1.A_CommonHelper.isInheritedFrom(ctor, A_Fragment_class_1.A_Fragment);
109
- }
110
- /**
111
- * Type guard to check if the constructor is of type A_Entity
112
- *
113
- * @param ctor
114
- * @returns
115
- */
116
- static isEntityConstructor(ctor) {
117
- return typeof ctor === 'function' && A_Common_helper_1.A_CommonHelper.isInheritedFrom(ctor, A_Entity_class_1.A_Entity);
118
- }
119
- /**
120
- * Type guard to check if the constructor is of type A_Scope
121
- *
122
- * @param ctor
123
- * @returns
124
- */
125
- static isScopeConstructor(ctor) {
126
- return typeof ctor === 'function' && A_Common_helper_1.A_CommonHelper.isInheritedFrom(ctor, A_Scope_class_1.A_Scope);
127
- }
128
- /**
129
- * Type guard to check if the constructor is of type A_Scope
130
- *
131
- * @param ctor
132
- * @returns
133
- */
134
- static isErrorConstructor(ctor) {
135
- return typeof ctor === 'function' && A_Common_helper_1.A_CommonHelper.isInheritedFrom(ctor, A_Error_class_1.A_Error);
136
- }
137
- /**
138
- * Type guard to check if the constructor is of type A_Feature
139
- *
140
- * @param ctor
141
- * @returns
142
- */
143
- static isFeatureConstructor(ctor) {
144
- return typeof ctor === 'function' && A_Common_helper_1.A_CommonHelper.isInheritedFrom(ctor, A_Feature_class_1.A_Feature);
145
- }
146
- /**
147
- * Type guard to check if the constructor is of type A_Caller
148
- *
149
- * @param ctor
150
- * @returns
151
- */
152
- static isCallerConstructor(ctor) {
153
- return typeof ctor === 'function' && A_Common_helper_1.A_CommonHelper.isInheritedFrom(ctor, A_Caller_class_1.A_Caller);
154
- }
155
- // ----------------------------------------------------------------------------
156
- // Instance type guards
157
- // ----------------------------------------------------------------------------
158
- /**
159
- * Type guard to check if the instance is of type A_Container
160
- *
161
- * @param instance
162
- * @returns
163
- */
164
- static isContainerInstance(instance) {
165
- return instance instanceof A_Container_class_1.A_Container;
166
- }
167
- /**
168
- * Type guard to check if the instance is of type A_Component
169
- *
170
- * @param instance
171
- * @returns
172
- */
173
- static isComponentInstance(instance) {
174
- return instance instanceof A_Component_class_1.A_Component;
175
- }
176
- /**
177
- * Type guard to check if the instance is of type A_Feature
178
- *
179
- * @param instance
180
- * @returns
181
- */
182
- static isFeatureInstance(instance) {
183
- return instance instanceof A_Feature_class_1.A_Feature;
184
- }
185
- /**
186
- * Type guard to check if the instance is of type A_Fragment
187
- *
188
- * @param instance
189
- * @returns
190
- */
191
- static isFragmentInstance(instance) {
192
- return instance instanceof A_Fragment_class_1.A_Fragment;
193
- }
194
- /**
195
- * Type guard to check if the instance is of type A_Entity
196
- *
197
- * @param instance
198
- * @returns
199
- */
200
- static isEntityInstance(instance) {
201
- return instance instanceof A_Entity_class_1.A_Entity;
202
- }
203
- /**
204
- * Type guard to check if the instance is of type A_Scope
205
- *
206
- * @param instance
207
- * @returns
208
- */
209
- static isScopeInstance(instance) {
210
- return instance instanceof A_Scope_class_1.A_Scope;
211
- }
212
- /**
213
- * Type guard to check if the instance is of type A_Error
214
- *
215
- * @param instance
216
- * @returns
217
- */
218
- static isErrorInstance(instance) {
219
- return instance instanceof A_Error_class_1.A_Error;
220
- }
221
- /**
222
- * Type guard to check if the instance is of type A_ComponentMeta
223
- *
224
- * @param instance
225
- * @returns
226
- */
227
- static isComponentMetaInstance(instance) {
228
- return instance instanceof A_Component_meta_1.A_ComponentMeta;
229
- }
230
- /**
231
- * Type guard to check if the instance is of type A_ContainerMeta
232
- *
233
- * @param instance
234
- * @returns
235
- */
236
- static isContainerMetaInstance(instance) {
237
- return instance instanceof A_Container_meta_1.A_ContainerMeta;
238
- }
239
- /**
240
- * Type guard to check if the instance is of type A_EntityMeta
241
- *
242
- * @param instance
243
- * @returns
244
- */
245
- static isEntityMetaInstance(instance) {
246
- return instance instanceof A_Entity_meta_1.A_EntityMeta;
247
- }
248
- // ==========================================================================
249
- // ========================= SPECIAL Type Guards =============================
250
- // ===========================================================================
251
- static isConstructorAllowedForScopeAllocation(target) {
252
- return A_TypeGuards.isContainerConstructor(target)
253
- || A_TypeGuards.isFeatureConstructor(target);
254
- }
255
- static isInstanceAllowedForScopeAllocation(target) {
256
- return A_TypeGuards.isContainerInstance(target)
257
- || A_TypeGuards.isFeatureInstance(target);
258
- }
259
- static isConstructorAvailableForAbstraction(target) {
260
- return A_TypeGuards.isContainerInstance(target)
261
- || A_TypeGuards.isComponentInstance(target);
262
- }
263
- static isTargetAvailableForInjection(target) {
264
- return A_TypeGuards.isComponentConstructor(target)
265
- || A_TypeGuards.isComponentInstance(target)
266
- || A_TypeGuards.isContainerInstance(target);
267
- }
268
- static isAllowedForFeatureCall(param) {
269
- return A_TypeGuards.isContainerInstance(param)
270
- || A_TypeGuards.isComponentInstance(param)
271
- || A_TypeGuards.isEntityInstance(param);
272
- }
273
- static isAllowedForFeatureDefinition(param) {
274
- return A_TypeGuards.isContainerInstance(param)
275
- || A_TypeGuards.isComponentInstance(param)
276
- || A_TypeGuards.isEntityInstance(param);
277
- }
278
- static isAllowedForFeatureExtension(param) {
279
- return A_TypeGuards.isComponentInstance(param);
280
- }
281
- static isAllowedForAbstractionDefinition(param) {
282
- return A_TypeGuards.isContainerInstance(param)
283
- || A_TypeGuards.isComponentInstance(param);
284
- }
285
- /**
286
- * Allows to check if the provided param is of constructor type.
287
- *
288
- * @param param
289
- * @returns
290
- */
291
- static isConstructorType(param) {
292
- return !!param && A_TypeGuards.isObject(param) && !(param instanceof Error) && "title" in param;
293
- }
294
- }
295
- exports.A_TypeGuards = A_TypeGuards;
296
- //# sourceMappingURL=A_TypeGuards.helper.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"A_TypeGuards.helper.js","sourceRoot":"","sources":["../../../src/helpers/A_TypeGuards.helper.ts"],"names":[],"mappings":";;;AASA,+E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AC,mBAAmB,CAAC,KAAK,CAAC,CAAC;IACnD,CAAC;IAED;;;;;OAKG;IACH,MAAM,CAAC,iBAAiB,CAAgC,KAAU;QAC9D,OAAO,CAAC,CAAC,KAAK,IAAI,YAAY,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,KAAK,YAAY,KAAK,CAAC,IAAI,OAAO,IAAI,KAAK,CAAC;IACpG,CAAC;CACJ;AAtSD,oCAsSC"}
@@ -1,36 +0,0 @@
1
- type Decrement = [never, 0, 1, 2, 3, 4, 5];
2
- export type A_TYPES__DeepPartial<T, D extends number = 5> = {
3
- [P in keyof Required<T>]?: [
4
- D
5
- ] extends [never] ? any : Required<T>[P] extends Array<infer U> ? Array<A_TYPES__DeepPartial<U, Decrement[D]>> : Required<T>[P] extends Function ? Required<T>[P] : Required<T>[P] extends object ? A_TYPES__DeepPartial<T[P], Decrement[D]> : T[P];
6
- };
7
- export type A_TYPES__ObjectKeyEnum<T, E> = {
8
- [P in keyof Required<T>]?: T[P] extends object ? A_TYPES__ObjectKeyEnum<T[P], E> : E;
9
- };
10
- export type A_TYPES__Dictionary<T> = {
11
- [Key: string]: T;
12
- };
13
- export type A_TYPES__NonObjectPaths<T> = T extends object ? {
14
- [K in keyof T]: `${Exclude<K, symbol>}${""}`;
15
- }[keyof T] : never;
16
- export type A_TYPES__Paths<T, D extends number = 5> = [D] extends [never] ? never : (T extends object ? {
17
- [K in keyof T]: `${Exclude<K, symbol>}${"" | `.${A_TYPES__Paths<T[K], Decrement[D]>}`}`;
18
- }[keyof T] : never);
19
- export type A_TYPES__UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends (k: infer I) => void ? I : never;
20
- export type A_TYPES__PathsToObject<_Obj, T extends readonly string[]> = A_TYPES__UnionToIntersection<{
21
- [K in keyof T]: T[K] extends `${infer Key}.${infer Rest}` ? {
22
- [P in Key]: P extends keyof _Obj ? A_TYPES__PathsToObject<Required<_Obj>[P], [Rest]> : any;
23
- } : {
24
- [P in T[K]]: `${T[K]}` extends keyof Required<_Obj> ? Required<_Obj>[`${T[K]}`] : never;
25
- };
26
- }[number]>;
27
- export type A_TYPES__Required<T, arr extends (A_TYPES__Paths<T>)[] = (A_TYPES__Paths<T>)[]> = A_TYPES__PathsToObject<T, arr> & T;
28
- export type A_TYPES__ExtractNested<T, P extends string> = P extends `${infer K}.${infer Rest}` ? K extends keyof T ? {
29
- [Key in K]: A_TYPES__ExtractNested<T[K], Rest>;
30
- } : never : P extends keyof T ? {
31
- [Key in P]: T[P];
32
- } : never;
33
- export type A_TYPES__ExtractProperties<T, P extends A_TYPES__Paths<T>[]> = A_TYPES__UnionToIntersection<{
34
- [K in keyof P]: P[K] extends string ? A_TYPES__ExtractNested<T, P[K]> : never;
35
- }[number]>;
36
- export {};
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=A_Common.types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"A_Common.types.js","sourceRoot":"","sources":["../../../src/types/A_Common.types.ts"],"names":[],"mappings":""}
package/index.ts DELETED
@@ -1,81 +0,0 @@
1
- // =================================================================================================
2
- // ============================= Export Framework Components =======================================
3
- // =================================================================================================
4
- export * from './src/constants/env.constants';
5
- export * from './src/types/A_Common.types';
6
-
7
- // ---------------------- Major Components ----------------------
8
- export { A_Context } from './src/global/A-Context/A-Context.class';
9
- export * from './src/global/A-Context/A-Context.types';
10
-
11
- export { A_Concept } from './src/global/A-Concept/A-Concept.class';
12
- export { A_ConceptMeta } from './src/global/A-Concept/A-Concept.meta';
13
- export * from './src/global/A-Concept/A-Concept.types';
14
-
15
- export { A_Container } from './src/global/A-Container/A-Container.class';
16
- export { A_ContainerMeta } from './src/global/A-Container/A-Container.meta';
17
- export * from './src/global/A-Container/A-Container.class';
18
-
19
- export { A_Component } from './src/global/A-Component/A-Component.class';
20
- export { A_ComponentMeta } from './src/global/A-Component/A-Component.meta';
21
- export * from './src/global/A-Component/A-Component.types';
22
-
23
- export { A_Entity } from './src/global/A-Entity/A-Entity.class';
24
- export * from './src/global/A-Entity/A-Entity.types';
25
-
26
-
27
- // ---------------------- Common Components ----------------------
28
- export { A_Abstraction } from './src/global/A-Abstraction/A-Abstraction.class';
29
- export { A_AbstractionError } from './src/global/A-Abstraction/A-Abstraction.error';
30
- export * from './src/global/A-Abstraction/A-Abstraction.types';
31
-
32
- export { A_Caller } from './src/global/A-Caller/A_Caller.class';
33
- export { A_CallerError } from './src/global/A-Caller/A_Caller.error';
34
- export * from './src/global/A-Caller/A_Caller.types';
35
-
36
- export { A_Error } from './src/global/A-Error/A_Error.class';
37
- export * from './src/global/A-Error/A_Error.types';
38
-
39
- export { ASEID } from './src/global/ASEID/ASEID.class';
40
- export { ASEID_Error } from './src/global/ASEID/ASEID.error';
41
- export * from './src/global/ASEID/ASEID.types';
42
-
43
- export { A_Feature } from './src/global/A-Feature/A-Feature.class';
44
- export { A_FeatureError } from './src/global/A-Feature/A-Feature.error';
45
- export * from './src/global/A-Feature/A-Feature.types';
46
-
47
- export { A_Stage } from './src/global/A-Stage/A-Stage.class';
48
- export { A_StageError } from './src/global/A-Stage/A-Stage.error';
49
- export * from './src/global/A-Stage/A-Stage.types';
50
-
51
- export { A_Scope } from './src/global/A-Scope/A-Scope.class';
52
- export { A_ScopeError } from './src/global/A-Scope/A-Scope.error';
53
- export * from './src/global/A-Scope/A-Scope.types';
54
-
55
- export { A_Meta } from './src/global/A-Meta/A-Meta.class';
56
- export * from './src/global/A-Meta/A-Meta.types';
57
-
58
- export { A_Fragment } from './src/global/A-Fragment/A-Fragment.class';
59
- export * from './src/global/A-Fragment/A-Fragment.types';
60
-
61
-
62
- // =================================================================================================
63
- // =============================== Export Decorators ===============================================
64
- // =================================================================================================
65
- export { A_Inject } from './src/global/A-Inject/A-Inject.decorator';
66
- export * from './src/global/A-Inject/A-Inject.types';
67
- export { A_Feature_Define } from './src/global/A-Feature/A-Feature-Define.decorator';
68
- export { A_Feature_Extend } from './src/global/A-Feature/A-Feature-Extend.decorator';
69
- export { A_Abstraction_Extend } from './src/global/A-Abstraction/A-Abstraction-Extend.decorator';
70
-
71
-
72
- // =================================================================================================
73
- // =============================== Export Helpers ================================================
74
- // =================================================================================================
75
- export { A_CommonHelper } from './src/helpers/A_Common.helper';
76
- export { A_FormatterHelper } from './src/helpers/A_Formatter.helper';
77
- export { A_IdentityHelper, A_ID_TYPES__TimeId_Parts } from './src/helpers/A_Identity.helper';
78
- export { A_StepsManager } from './src/global/A-StepManager/A-StepManager.class';
79
- export { A_StepManagerError } from './src/global/A-StepManager/A-StepManager.error';
80
- export { A_TypeGuards } from './src/helpers/A_TypeGuards.helper';
81
-
@@ -1,61 +0,0 @@
1
- // class RealDependency {
2
- // constructor(private name: string) { }
3
-
4
- // getName() {
5
- // return this.name;
6
- // }
7
-
8
- // performAction() {
9
- // console.log(`${this.name} is performing an action.`);
10
- // }
11
- // }
12
-
13
- // class DependencyReference<T> {
14
- // private proxyInstance: T | null = null;
15
- // private realInstance: T | null = null;
16
-
17
- // constructor(private realClass: { new(...args: any[]): T }, private args: any[]) { }
18
-
19
- // // Simulate async loading (e.g., dynamic imports, API calls, etc.)
20
- // private async loadInstance(): Promise<T> {
21
- // if (!this.realInstance) {
22
- // console.log('Loading real dependency...');
23
- // // Simulate async loading with a delay
24
- // await new Promise((resolve) => setTimeout(resolve, 1000));
25
- // this.realInstance = new this.realClass(...this.args);
26
- // }
27
- // return this.realInstance;
28
- // }
29
-
30
- // public async resolve(): Promise<T> {
31
- // if (!this.proxyInstance) {
32
- // const realInstance = await this.loadInstance();
33
-
34
- // this.proxyInstance = new Proxy({}, {
35
- // get: (target, prop) => {
36
- // const value = (realInstance as any)[prop];
37
-
38
- // // If the property is a method, return a bound function
39
- // if (typeof value === 'function') {
40
- // return value.bind(realInstance);
41
- // }
42
- // return value;
43
- // }
44
- // }) as T;
45
- // }
46
-
47
- // return this.proxyInstance;
48
- // }
49
- // }
50
-
51
-
52
- // // Example usage:
53
- // (async () => {
54
- // const lazyDependency = new DependencyReference(RealDependency, ['ComponentA']);
55
-
56
- // const proxy = await lazyDependency.resolve(); // Loads the instance asynchronously
57
-
58
- // proxy.performAction(); // Will call the method on the real instance
59
-
60
- // console.log(proxy.getName()); // Calls method on the real instance
61
- // })();
@@ -1,61 +0,0 @@
1
- // import { A_Namespace } from "@adaas/a-concept/global/A-Namespace/A_Namespace.class"
2
-
3
-
4
- // export type A_TYPES__A_DependencyReferenceConstructor = {
5
- // /**
6
- // * The name of the dependency
7
- // */
8
- // name: string
9
- // /**
10
- // * The version of the module
11
- // * By default it is 1.0.0
12
- // */
13
- // version: string
14
- // /**
15
- // * The dependencies of the module
16
- // * Could be:
17
- // * - other Modules
18
- // * - other Contexts
19
- // *
20
- // */
21
- // dependencies: Array<typeof A_Namespace>
22
- // /**
23
- // * The source of the dependency
24
- // * Could be:
25
- // * - a string representing the path to the module
26
- // * - a module class (in case when config should be provided via the module constructor)
27
- // * - a module class constructor
28
- // * - a context class (in case when config should be provided via the context constructor)
29
- // * - a context class constructor
30
- // *
31
- // */
32
- // // source: A_Module | A_Context | typeof A_Module | typeof A_Context | string
33
- // source: A_Namespace
34
- // }
35
-
36
-
37
- // export type A_TYPES__A_DependencyReferenceConstructorConfig = {
38
- // /**
39
- // * Sync - blocks A-Express Application initialization until module is ready
40
- // * Async - allows to initialize module after A-Express Application initialization
41
- // */
42
- // behavior: 'async' | 'sync',
43
-
44
- // /**
45
- // * Allows to define a scheme of retries
46
- // */
47
- // retries: {
48
- // /**
49
- // * The number of retries
50
- // * Default is 3
51
- // */
52
- // n: number,
53
- // /**
54
- // * The timeout between retries
55
- // * Multiplied by the number of retries
56
- // * So after each retry the timeout is increased e.g. 1000ms * 1, 1000ms * 2, 1000ms * 3
57
- // * Default is 1000
58
- // */
59
- // timeout: number
60
- // }
61
- // }
package/trace-require.js DELETED
@@ -1,46 +0,0 @@
1
- const Module = require("module");
2
- const path = require("path");
3
-
4
- // Colors (ANSI escape codes)
5
- const colors = {
6
- reset: "\x1b[0m",
7
- gray: "\x1b[90m",
8
- green: "\x1b[32m",
9
- cyan: "\x1b[36m",
10
- yellow: "\x1b[33m",
11
- };
12
-
13
- // Indent helper
14
- function indent(level) {
15
- return " ".repeat(level);
16
- }
17
-
18
- const originalLoad = Module._load;
19
- let stack = [];
20
-
21
- Module._load = function (request, parent, isMain) {
22
- const resolved = Module._resolveFilename(request, parent);
23
- const parentFile = parent && parent.filename ? parent.filename : "<root>";
24
- const depth = stack.length;
25
-
26
- let color = colors.gray;
27
- let label = resolved;
28
-
29
- if (resolved.includes("/src/")) {
30
- color = colors.green; // project source
31
- label = path.relative(process.cwd(), resolved);
32
- } else if (resolved.includes("node_modules")) {
33
- color = colors.cyan; // external deps
34
- label = path.relative(process.cwd(), resolved);
35
- } else {
36
- color = colors.yellow; // stdlib / others
37
- }
38
-
39
- console.log(indent(depth) + color + label + colors.reset);
40
-
41
- stack.push(resolved);
42
- const result = originalLoad.apply(this, arguments);
43
- stack.pop();
44
-
45
- return result;
46
- };
@@ -1,58 +0,0 @@
1
- {
2
- "compileOnSave": false,
3
- "compilerOptions": {
4
- "outDir": "dist",
5
- "strict": true,
6
- "noImplicitAny": false,
7
- "noFallthroughCasesInSwitch": true,
8
- "downlevelIteration": true,
9
- "strictFunctionTypes": true,
10
- "strictNullChecks": true,
11
- "strictPropertyInitialization": true,
12
- "forceConsistentCasingInFileNames": true,
13
- "resolveJsonModule": true,
14
- "noErrorTruncation": true,
15
- "jsx": "react",
16
- "target": "es2015",
17
- "module": "commonjs",
18
- "moduleResolution": "node",
19
- "allowSyntheticDefaultImports": true,
20
- "esModuleInterop": true,
21
- "noUnusedLocals": false,
22
- "noUnusedParameters": false,
23
- "removeComments": false,
24
- "preserveConstEnums": true,
25
- "sourceMap": true,
26
- "baseUrl": ".",
27
- "experimentalDecorators": true,
28
- "skipLibCheck": true,
29
- "typeRoots": [
30
- "node_modules/@types"
31
- ],
32
- "paths": {
33
- "@adaas/a-concept/constants/*": ["src/constants/*"],
34
- "@adaas/a-concept/global/*": ["src/global/*"],
35
- "@adaas/a-concept/types/*": ["src/types/*"],
36
- "@adaas/a-concept/helpers/*": ["src/helpers/*"],
37
- "@adaas/a-concept/decorators/*": ["src/decorators/*"],
38
- "@adaas/a-concept/base/*": ["src/base/*"],
39
- "@adaas/a-concept/utils/*": ["src/utils/*"]
40
- },
41
- "lib": [
42
- "dom",
43
- "esnext.asynciterable",
44
- "es2015",
45
- "es2016",
46
- "es2017.object"
47
- ]
48
- },
49
- "include": [
50
- "src/**/*",
51
- "index.ts"
52
- ],
53
- "exclude": [
54
- "node_modules/**/*",
55
- "dist/**/*",
56
- "node_modules/@types/mocha/index.d.ts"
57
- ]
58
- }