@adaas/a-concept 0.0.3 → 0.0.5

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 (304) hide show
  1. package/dist/examples/simple/components/A.component.d.ts +7 -0
  2. package/dist/examples/simple/components/A.component.js +57 -0
  3. package/dist/examples/simple/components/A.component.js.map +1 -0
  4. package/dist/examples/simple/components/B.component.d.ts +9 -0
  5. package/dist/examples/simple/components/B.component.js +77 -0
  6. package/dist/examples/simple/components/B.component.js.map +1 -0
  7. package/dist/examples/simple/concept.d.ts +1 -0
  8. package/dist/examples/simple/concept.js +53 -11
  9. package/dist/examples/simple/concept.js.map +1 -1
  10. package/dist/examples/simple/containers/Main.container.d.ts +11 -0
  11. package/dist/examples/simple/containers/Main.container.js +71 -0
  12. package/dist/examples/simple/containers/Main.container.js.map +1 -0
  13. package/dist/examples/simple/context/Fragment_A.context.d.ts +6 -0
  14. package/dist/examples/simple/context/Fragment_A.context.js +16 -0
  15. package/dist/examples/simple/context/Fragment_A.context.js.map +1 -0
  16. package/dist/examples/simple/context/Fragment_B.context.d.ts +6 -0
  17. package/dist/examples/simple/context/Fragment_B.context.js +16 -0
  18. package/dist/examples/simple/context/Fragment_B.context.js.map +1 -0
  19. package/dist/examples/simple-http-server/components/http-error-handler.component.d.ts +9 -0
  20. package/dist/examples/simple-http-server/components/http-error-handler.component.js +63 -0
  21. package/dist/examples/simple-http-server/components/http-error-handler.component.js.map +1 -0
  22. package/dist/examples/simple-http-server/components/http-request-handler.component.d.ts +2 -0
  23. package/dist/examples/simple-http-server/components/http-request-handler.component.js +7 -0
  24. package/dist/examples/simple-http-server/components/http-request-handler.component.js.map +1 -0
  25. package/dist/examples/simple-http-server/concept.js +21 -22
  26. package/dist/examples/simple-http-server/concept.js.map +1 -1
  27. package/dist/examples/simple-http-server/containers/http-server.container.d.ts +8 -8
  28. package/dist/examples/simple-http-server/containers/http-server.container.js +34 -30
  29. package/dist/examples/simple-http-server/containers/http-server.container.js.map +1 -1
  30. package/dist/examples/simple-http-server/containers/http-server.controller.js +1 -1
  31. package/dist/examples/simple-http-server/containers/http-server.router.js +2 -2
  32. package/dist/examples/simple-http-server/containers/http-server.router.js.map +1 -1
  33. package/dist/examples/simple-http-server/contexts/http-request.context.d.ts +13 -0
  34. package/dist/examples/simple-http-server/contexts/http-request.context.js +51 -0
  35. package/dist/examples/simple-http-server/contexts/http-request.context.js.map +1 -0
  36. package/dist/examples/simple-http-server/contexts/http-server.context.types.d.ts +0 -4
  37. package/dist/examples/simple-http-server/contexts/http-server.context.types.js +0 -98
  38. package/dist/examples/simple-http-server/contexts/http-server.context.types.js.map +1 -1
  39. package/dist/examples/simple-http-server/contexts/http-server.namespace.d.ts +1 -1
  40. package/dist/examples/simple-http-server/contexts/http-server.namespace.js +1 -1
  41. package/dist/examples/simple-http-server/controllers/users.controller.js +2 -2
  42. package/dist/examples/simple-http-server/test.d.ts +68 -0
  43. package/dist/examples/simple-http-server/test.js +162 -0
  44. package/dist/examples/simple-http-server/test.js.map +1 -0
  45. package/dist/index.d.ts +27 -19
  46. package/dist/index.js +58 -26
  47. package/dist/index.js.map +1 -1
  48. package/dist/src/base/A-Config/A-Config.container.d.ts +8 -0
  49. package/dist/src/base/A-Config/A-Config.container.js +64 -0
  50. package/dist/src/base/A-Config/A-Config.container.js.map +1 -0
  51. package/dist/src/base/A-Config/A-Config.context.d.ts +30 -0
  52. package/dist/src/base/A-Config/A-Config.context.js +58 -0
  53. package/dist/src/base/A-Config/A-Config.context.js.map +1 -0
  54. package/dist/src/base/A-Config/A-Config.types.d.ts +16 -0
  55. package/dist/src/base/A-Config/A-Config.types.js +7 -0
  56. package/dist/src/base/A-Config/A-Config.types.js.map +1 -0
  57. package/dist/src/base/A-Config/components/ConfigReader.component.d.ts +19 -0
  58. package/dist/src/base/A-Config/components/ConfigReader.component.js +53 -0
  59. package/dist/src/base/A-Config/components/ConfigReader.component.js.map +1 -0
  60. package/dist/src/base/A-Config/components/ENVConfigReader.component.d.ts +10 -0
  61. package/dist/src/base/A-Config/components/ENVConfigReader.component.js +37 -0
  62. package/dist/src/base/A-Config/components/ENVConfigReader.component.js.map +1 -0
  63. package/dist/src/base/A-Config/components/FileConfigReader.component.d.ts +11 -0
  64. package/dist/src/base/A-Config/components/FileConfigReader.component.js +47 -0
  65. package/dist/src/base/A-Config/components/FileConfigReader.component.js.map +1 -0
  66. package/dist/src/base/A-Errors/A-Errors.component.d.ts +18 -0
  67. package/dist/src/base/A-Errors/A-Errors.component.js +85 -0
  68. package/dist/src/base/A-Errors/A-Errors.component.js.map +1 -0
  69. package/dist/src/base/A-Errors/A-Errors.context.d.ts +27 -0
  70. package/dist/src/base/A-Errors/A-Errors.context.js +50 -0
  71. package/dist/src/base/A-Errors/A-Errors.context.js.map +1 -0
  72. package/dist/src/base/A-Errors/A-Errors.types.d.ts +5 -0
  73. package/dist/src/base/A-Errors/A-Errors.types.js +3 -0
  74. package/dist/src/base/A-Errors/A-Errors.types.js.map +1 -0
  75. package/dist/src/base/A-Logger/A-Logger.component.d.ts +28 -0
  76. package/dist/src/base/A-Logger/A-Logger.component.js +142 -0
  77. package/dist/src/base/A-Logger/A-Logger.component.js.map +1 -0
  78. package/dist/src/base/A-Logger/A-Logger.types.js +2 -0
  79. package/dist/src/base/A-Logger/A-Logger.types.js.map +1 -0
  80. package/dist/src/constants/A_ConceptLifecycle.constants.d.ts +0 -2
  81. package/dist/src/constants/A_ConceptLifecycle.constants.js +9 -10
  82. package/dist/src/constants/A_ConceptLifecycle.constants.js.map +1 -1
  83. package/dist/src/containers/A-Config/A-Config.container.js +1 -1
  84. package/dist/src/containers/A-Config/A-Config.namespace.d.ts +1 -1
  85. package/dist/src/containers/A-Config/A-Config.namespace.js +1 -1
  86. package/dist/src/containers/A-Config/A-Config.types.d.ts +1 -1
  87. package/dist/src/containers/A-Errors/A-Errors.container.js +1 -1
  88. package/dist/src/containers/A-Errors/A-Errors.namespace.d.ts +1 -1
  89. package/dist/src/containers/A-Errors/A-Errors.namespace.js +1 -1
  90. package/dist/src/containers/A-Errors/A-Errors.types.d.ts +1 -1
  91. package/dist/src/containers/A-Logger/A-Logger.container.js +1 -1
  92. package/dist/src/containers/A-Logger/A-Logger.namespace.d.ts +1 -1
  93. package/dist/src/containers/A-Logger/A-Logger.namespace.js +1 -1
  94. package/dist/src/containers/A-Logger/components/Logger.component.d.ts +1 -1
  95. package/dist/src/decorators/A-ConceptLifecycle/A-Run/A-Run.decorator.js.map +1 -1
  96. package/dist/src/decorators/A-Define/Feature/Feature.decorator.d.ts +16 -0
  97. package/dist/src/decorators/A-Define/Feature/Feature.decorator.js +36 -0
  98. package/dist/src/decorators/A-Define/Feature/Feature.decorator.js.map +1 -0
  99. package/dist/src/decorators/A-Define/Feature/Feature.decorator.types.d.ts +8 -0
  100. package/dist/src/decorators/A-Define/Feature/Feature.decorator.types.js +3 -0
  101. package/dist/src/decorators/A-Define/Feature/Feature.decorator.types.js.map +1 -0
  102. package/dist/src/decorators/A-Define/Lifecycle/Lifecycle.decorator.d.ts +14 -0
  103. package/dist/src/decorators/A-Define/Lifecycle/Lifecycle.decorator.js +24 -0
  104. package/dist/src/decorators/A-Define/Lifecycle/Lifecycle.decorator.js.map +1 -0
  105. package/dist/src/decorators/A-Define/Lifecycle/Lifecycle.decorator.types.d.ts +8 -0
  106. package/dist/src/decorators/A-Define/Lifecycle/Lifecycle.decorator.types.js +3 -0
  107. package/dist/src/decorators/A-Define/Lifecycle/Lifecycle.decorator.types.js.map +1 -0
  108. package/dist/src/decorators/A-Define/index.d.ts +7 -0
  109. package/dist/src/decorators/A-Define/index.js +10 -0
  110. package/dist/src/decorators/A-Define/index.js.map +1 -0
  111. package/dist/src/decorators/A-Extend/A-Extend.decorator.d.ts +18 -0
  112. package/dist/src/decorators/A-Extend/A-Extend.decorator.js +37 -0
  113. package/dist/src/decorators/A-Extend/A-Extend.decorator.js.map +1 -0
  114. package/dist/src/decorators/A-Extend/A-Extend.decorator.types.d.ts +21 -0
  115. package/dist/src/decorators/A-Extend/A-Extend.decorator.types.js +3 -0
  116. package/dist/src/decorators/A-Extend/A-Extend.decorator.types.js.map +1 -0
  117. package/dist/src/decorators/A-Feature/A-Feature-Define.decorator.d.ts +16 -0
  118. package/dist/src/decorators/A-Feature/A-Feature-Define.decorator.js +37 -0
  119. package/dist/src/decorators/A-Feature/A-Feature-Define.decorator.js.map +1 -0
  120. package/dist/src/decorators/A-Feature/A-Feature-Extend.decorator.d.ts +16 -0
  121. package/dist/src/decorators/A-Feature/A-Feature-Extend.decorator.js +42 -0
  122. package/dist/src/decorators/A-Feature/A-Feature-Extend.decorator.js.map +1 -0
  123. package/dist/src/decorators/A-Feature/A-Feature.decorator.types.d.ts +20 -0
  124. package/dist/src/decorators/A-Feature/A-Feature.decorator.types.js +1 -0
  125. package/dist/src/decorators/A-Inject/A-Inject.decorator.d.ts +12 -10
  126. package/dist/src/decorators/A-Inject/A-Inject.decorator.js +16 -26
  127. package/dist/src/decorators/A-Inject/A-Inject.decorator.js.map +1 -1
  128. package/dist/src/decorators/A-Inject/A-Inject.decorator.types.d.ts +4 -3
  129. package/dist/src/decorators/A-Stage/A-Stage.decorator.d.ts +12 -0
  130. package/dist/src/decorators/A-Stage/A-Stage.decorator.js +35 -0
  131. package/dist/src/decorators/A-Stage/A-Stage.decorator.js.map +1 -0
  132. package/dist/src/decorators/A-Stage/A-Stage.decorator.types.d.ts +2 -0
  133. package/dist/src/decorators/A-Stage/A-Stage.decorator.types.js +3 -0
  134. package/dist/src/decorators/A-Stage/A-Stage.decorator.types.js.map +1 -0
  135. package/dist/src/global/A-Channel/A-Channel.class.d.ts +18 -0
  136. package/dist/src/global/A-Channel/A-Channel.class.js +54 -0
  137. package/dist/src/global/A-Channel/A-Channel.class.js.map +1 -0
  138. package/dist/src/global/A-Channel/A-Channel.types.d.ts +35 -0
  139. package/dist/src/global/A-Channel/A-Channel.types.js +3 -0
  140. package/dist/src/global/A-Channel/A-Channel.types.js.map +1 -0
  141. package/dist/src/global/A-Component/A-Component.class.d.ts +1 -11
  142. package/dist/src/global/A-Component/A-Component.class.js +0 -7
  143. package/dist/src/global/A-Component/A-Component.class.js.map +1 -1
  144. package/dist/src/global/A-Component/A-Component.meta.d.ts +4 -0
  145. package/dist/src/global/A-Component/A-Component.meta.js +8 -0
  146. package/dist/src/global/A-Component/A-Component.meta.js.map +1 -0
  147. package/dist/src/global/A-Component/A-Component.types.d.ts +18 -0
  148. package/dist/src/global/A-Component/A-Component.types.js +10 -0
  149. package/dist/src/global/A-Component/A-Component.types.js.map +1 -0
  150. package/dist/src/global/A-Concept/A_Concept.class.d.ts +41 -17
  151. package/dist/src/global/A-Concept/A_Concept.class.js +120 -43
  152. package/dist/src/global/A-Concept/A_Concept.class.js.map +1 -1
  153. package/dist/src/global/A-Concept/A_Concept.meta.d.ts +3 -0
  154. package/dist/src/global/A-Concept/A_Concept.meta.js +9 -0
  155. package/dist/src/global/A-Concept/A_Concept.meta.js.map +1 -0
  156. package/dist/src/global/A-Concept/A_Concept.types.d.ts +31 -16
  157. package/dist/src/global/A-Concept/A_Concept.types.js +25 -0
  158. package/dist/src/global/A-Concept/A_Concept.types.js.map +1 -1
  159. package/dist/src/global/A-Container/A-Container.class.d.ts +72 -10
  160. package/dist/src/global/A-Container/A-Container.class.js +119 -9
  161. package/dist/src/global/A-Container/A-Container.class.js.map +1 -1
  162. package/dist/src/global/A-Container/A-Container.meta.d.ts +7 -0
  163. package/dist/src/global/A-Container/A-Container.meta.js +54 -0
  164. package/dist/src/global/A-Container/A-Container.meta.js.map +1 -0
  165. package/dist/src/global/A-Container/A-Container.types.d.ts +31 -0
  166. package/dist/src/global/A-Container/A-Container.types.js +9 -0
  167. package/dist/src/global/A-Container/A-Container.types.js.map +1 -0
  168. package/dist/src/global/A-Context/A-Context.class.d.ts +37 -54
  169. package/dist/src/global/A-Context/A-Context.class.js +129 -61
  170. package/dist/src/global/A-Context/A-Context.class.js.map +1 -1
  171. package/dist/src/global/A-Context/A-Context.types.d.ts +12 -0
  172. package/dist/src/global/A-Context/A-Context.types.js +1 -0
  173. package/dist/src/global/A-Context/A-ContextFragment.class.d.ts +12 -0
  174. package/dist/src/global/A-Context/A-ContextFragment.class.js +19 -0
  175. package/dist/src/global/A-Context/A-ContextFragment.class.js.map +1 -0
  176. package/dist/src/global/A-Dependency/A-DependencyReference.class.d.ts +0 -17
  177. package/dist/src/global/A-Dependency/A-DependencyReference.class.js +47 -65
  178. package/dist/src/global/A-Dependency/A-DependencyReference.class.js.map +1 -1
  179. package/dist/src/global/A-Dependency/A-DependencyReference.types.d.ts +0 -55
  180. package/dist/src/global/A-Dependency/A-DependencyReference.types.js +56 -1
  181. package/dist/src/global/A-Dependency/A-DependencyReference.types.js.map +1 -1
  182. package/dist/src/global/A-Entity/A-Entity.class.d.ts +57 -0
  183. package/dist/src/global/A-Entity/A-Entity.class.js +102 -0
  184. package/dist/src/global/A-Entity/A-Entity.class.js.map +1 -0
  185. package/dist/src/global/A-Entity/A-Entity.types.d.ts +13 -0
  186. package/dist/src/global/A-Entity/A-Entity.types.js +4 -0
  187. package/dist/src/global/A-Entity/A-Entity.types.js.map +1 -0
  188. package/dist/src/global/A-Feature/A-Feature.class.d.ts +44 -0
  189. package/dist/src/global/A-Feature/A-Feature.class.js +125 -0
  190. package/dist/src/global/A-Feature/A-Feature.class.js.map +1 -0
  191. package/dist/src/global/A-Feature/A-Feature.types.d.ts +17 -0
  192. package/dist/src/global/A-Feature/A-Feature.types.js +11 -0
  193. package/dist/src/global/A-Feature/A-Feature.types.js.map +1 -0
  194. package/dist/src/global/A-Fragment/A-Fragment.class.d.ts +38 -0
  195. package/dist/src/global/A-Fragment/A-Fragment.class.js +107 -0
  196. package/dist/src/global/A-Fragment/A-Fragment.class.js.map +1 -0
  197. package/dist/src/global/A-Fragment/A-Fragment.types.d.ts +3 -0
  198. package/dist/src/global/A-Fragment/A-Fragment.types.js +3 -0
  199. package/dist/src/global/A-Fragment/A-Fragment.types.js.map +1 -0
  200. package/dist/src/global/A-Meta/A-Meta.class.d.ts +16 -0
  201. package/dist/src/global/A-Meta/A-Meta.class.js +69 -0
  202. package/dist/src/global/A-Meta/A-Meta.class.js.map +1 -0
  203. package/dist/src/global/A-Meta/A-Meta.types.js +2 -0
  204. package/dist/src/global/A-Meta/A-Meta.types.js.map +1 -0
  205. package/dist/src/global/A-Scope/A-Scope.class.d.ts +51 -0
  206. package/dist/src/global/A-Scope/A-Scope.class.js +135 -0
  207. package/dist/src/global/A-Scope/A-Scope.class.js.map +1 -0
  208. package/dist/src/global/A-Scope/A-Scope.types.d.ts +32 -0
  209. package/dist/src/global/A-Scope/A-Scope.types.js +3 -0
  210. package/dist/src/global/A-Scope/A-Scope.types.js.map +1 -0
  211. package/dist/src/storage/A_Component.storage.d.ts +10 -0
  212. package/dist/src/storage/A_Component.storage.js +17 -0
  213. package/dist/src/storage/A_Component.storage.js.map +1 -0
  214. package/dist/src/storage/A_Concept.storage.js +2 -2
  215. package/dist/src/storage/A_Concept.storage.js.map +1 -1
  216. package/dist/src/storage/A_Container.storage.d.ts +8 -0
  217. package/dist/src/storage/A_Container.storage.js +17 -0
  218. package/dist/src/storage/A_Container.storage.js.map +1 -0
  219. package/dist/src/storage/A_Inject.storage.d.ts +9 -0
  220. package/dist/src/storage/A_Inject.storage.js +13 -0
  221. package/dist/src/storage/A_Inject.storage.js.map +1 -0
  222. package/examples/simple/components/A.component.ts +35 -0
  223. package/examples/simple/components/B.component.ts +46 -0
  224. package/examples/simple/concept.ts +49 -12
  225. package/examples/simple/containers/Main.container.ts +47 -0
  226. package/examples/simple/context/Fragment_A.context.ts +25 -0
  227. package/examples/simple/context/Fragment_B.context.ts +19 -0
  228. package/examples/simple-http-server/components/http-error-handler.component.ts +44 -0
  229. package/examples/simple-http-server/components/http-request-handler.component.ts +9 -0
  230. package/examples/simple-http-server/concept.ts +22 -21
  231. package/examples/simple-http-server/containers/http-server.container.ts +23 -38
  232. package/examples/simple-http-server/contexts/http-request.context.ts +59 -0
  233. package/examples/simple-http-server/contexts/http-server.context.types.ts +0 -108
  234. package/examples/simple-http-server/test.ts +290 -0
  235. package/index.ts +53 -22
  236. package/jest.config.ts +1 -3
  237. package/package.json +4 -7
  238. package/src/{containers → base}/A-Config/A-Config.container.ts +21 -20
  239. package/src/{containers/A-Config/A-Config.namespace.ts → base/A-Config/A-Config.context.ts} +12 -5
  240. package/src/{containers → base}/A-Config/A-Config.types.ts +15 -4
  241. package/src/{containers → base}/A-Config/components/ConfigReader.component.ts +7 -3
  242. package/src/{containers → base}/A-Config/components/ENVConfigReader.component.ts +1 -1
  243. package/src/{containers → base}/A-Config/components/FileConfigReader.component.ts +1 -1
  244. package/src/base/A-Errors/A-Errors.component.ts +102 -0
  245. package/src/{containers/A-Errors/A-Errors.namespace.ts → base/A-Errors/A-Errors.context.ts} +24 -39
  246. package/src/{containers → base}/A-Errors/A-Errors.types.ts +2 -2
  247. package/src/base/A-Logger/A-Logger.component.ts +169 -0
  248. package/src/base/A-Logger/A-Logger.types.ts +0 -0
  249. package/src/constants/A_ConceptLifecycle.constants.ts +9 -9
  250. package/src/decorators/A-Feature/A-Feature-Define.decorator.ts +57 -0
  251. package/src/decorators/A-Feature/A-Feature-Extend.decorator.ts +57 -0
  252. package/src/decorators/A-Feature/A-Feature.decorator.types.ts +56 -0
  253. package/src/decorators/A-Inject/A-Inject.decorator.ts +64 -53
  254. package/src/decorators/A-Inject/A-Inject.decorator.types.ts +31 -4
  255. package/src/decorators/A-Stage/A-Stage.decorator.ts +57 -0
  256. package/src/decorators/A-Stage/A-Stage.decorator.types.ts +23 -0
  257. package/src/global/A-Channel/A-Channel.class.ts +48 -0
  258. package/src/global/A-Channel/A-Channel.types.ts +60 -0
  259. package/src/global/A-Component/A-Component.class.ts +1 -29
  260. package/src/global/A-Component/A-Component.meta.ts +9 -0
  261. package/src/global/A-Component/A-Component.types.ts +40 -0
  262. package/src/global/A-Concept/A_Concept.class.ts +160 -66
  263. package/src/global/A-Concept/A_Concept.meta.ts +9 -0
  264. package/src/global/A-Concept/A_Concept.types.ts +45 -10
  265. package/src/global/A-Container/A-Container.class.ts +172 -22
  266. package/src/global/A-Container/A-Container.meta.ts +80 -0
  267. package/src/global/A-Container/A-Container.types.ts +40 -0
  268. package/src/global/A-Context/A-Context.class.ts +233 -130
  269. package/src/global/A-Context/A-Context.types.ts +15 -0
  270. package/src/global/A-Dependency/A-DependencyReference.class.ts +61 -61
  271. package/src/global/A-Dependency/A-DependencyReference.types.ts +56 -56
  272. package/src/global/A-Entity/A-Entity.class.ts +141 -0
  273. package/src/global/A-Entity/A-Entity.types.ts +17 -0
  274. package/src/global/A-Feature/A-Feature.class.ts +156 -0
  275. package/src/global/A-Feature/A-Feature.types.ts +20 -0
  276. package/src/global/{A-Namespace/A_Namespace.class.ts → A-Fragment/A-Fragment.class.ts} +24 -30
  277. package/src/global/A-Fragment/A-Fragment.types.ts +6 -0
  278. package/src/global/A-Meta/A-Meta.class.ts +96 -0
  279. package/src/global/A-Meta/A-Meta.types.ts +0 -0
  280. package/src/global/A-Scope/A-Scope.class.ts +211 -0
  281. package/src/global/A-Scope/A-Scope.types.ts +37 -0
  282. package/tsconfig.json +1 -3
  283. package/examples/sdk/concept.ts +0 -24
  284. package/examples/sdk/orders.api.ts +0 -21
  285. package/examples/sdk/users.api.ts +0 -21
  286. package/examples/simple-http-server/containers/http-server.controller.ts +0 -24
  287. package/examples/simple-http-server/containers/http-server.router.ts +0 -23
  288. package/examples/simple-http-server/contexts/http-server.namespace.ts +0 -36
  289. package/src/containers/A-Errors/A-Errors.container.ts +0 -14
  290. package/src/containers/A-Logger/A-Logger.container.ts +0 -22
  291. package/src/containers/A-Logger/A-Logger.namespace.ts +0 -26
  292. package/src/containers/A-Logger/components/Logger.component.ts +0 -169
  293. package/src/decorators/A-ConceptLifecycle/A-ConceptLifecycle.decorator.types.ts +0 -46
  294. package/src/decorators/A-ConceptLifecycle/A-Load/A-Load.decorator.ts +0 -55
  295. package/src/decorators/A-ConceptLifecycle/A-Load/A-Load.decorator.types.ts +0 -20
  296. package/src/decorators/A-ConceptLifecycle/A-Run/A-Run.decorator.ts +0 -62
  297. package/src/decorators/A-ConceptLifecycle/A-Run/A-Run.decorator.types.ts +0 -28
  298. package/src/decorators/A-ConceptLifecycle/index.ts +0 -9
  299. package/src/decorators/A-Feature/A-Feature.decorator.ts +0 -13
  300. package/src/decorators/A_Lazy.decorator.ts +0 -31
  301. package/src/global/A-Namespace/A_Namespace.types.ts +0 -24
  302. package/src/storage/A_Concept.storage.ts +0 -45
  303. /package/{src/containers/A-Logger/A-Logger.types.ts → dist/src/base/A-Logger/A-Logger.types.d.ts} +0 -0
  304. /package/{src/decorators/A_ConceptMethods.decorator.ts → dist/src/global/A-Meta/A-Meta.types.d.ts} +0 -0
@@ -0,0 +1,40 @@
1
+ import { A_TYPES__ConceptStage } from "../A-Concept/A_Concept.types";
2
+ import { A_Fragment } from "../A-Fragment/A-Fragment.class";
3
+ import { A_TYPES__ScopeConstructor } from "../A-Scope/A-Scope.types";
4
+
5
+
6
+
7
+ export type A_TYPES__ContainerConstructor<_Exports extends Array<String>> = {
8
+ name?: string,
9
+ exports: _Exports,
10
+ } & A_TYPES__ScopeConstructor
11
+
12
+
13
+ export type A_TYPES__ContainerCallParams<T extends string> = {
14
+ name: T,
15
+ fragments: Array<A_Fragment>,
16
+ components: Array<{ new(...args: any[]): any }>
17
+ }
18
+
19
+ export type A_TYPES__ContainerMeta = {
20
+ [A_TYPES__ContainerMetaKey.FEATURES]: Map<string, A_TYPES__ContainerMeta_FeatureItem>
21
+ [A_TYPES__ContainerMetaKey.STAGES]: Map<string, A_TYPES__ContainerMeta_StageExtension>
22
+ }
23
+
24
+
25
+ export enum A_TYPES__ContainerMetaKey {
26
+ FEATURES = 'a-container-features',
27
+ STAGES = 'a-container-stages',
28
+ }
29
+
30
+ export type A_TYPES__ContainerMeta_StageExtension = {
31
+ name: A_TYPES__ConceptStage,
32
+ handler: string,
33
+ }
34
+
35
+
36
+ export type A_TYPES__ContainerMeta_FeatureItem = {
37
+ name: string,
38
+ container: string,
39
+ handler: string,
40
+ }
@@ -1,6 +1,14 @@
1
- import { A_CommonHelper, A_Polyfills } from "@adaas/a-utils";
2
- import { A_Namespace } from "../A-Namespace/A_Namespace.class";
1
+ import { A_CommonHelper, A_Polyfills, A_TYPES__Dictionary } from "@adaas/a-utils";
3
2
  import { A_Component } from "../A-Component/A-Component.class";
3
+ import { A_Fragment } from "../A-Fragment/A-Fragment.class";
4
+ import { A_Feature } from "../A-Feature/A-Feature.class";
5
+ import { A_Container } from "../A-Container/A-Container.class";
6
+ import { A_Scope } from "../A-Scope/A-Scope.class";
7
+ import { A_TYPES__ScopeConfig, A_TYPES__ScopeConstructor } from "../A-Scope/A-Scope.types";
8
+ import { A_Meta } from "../A-Meta/A-Meta.class";
9
+ import { A_ComponentMeta } from "../A-Component/A-Component.meta";
10
+ import { A_ContainerMeta } from "../A-Container/A-Container.meta";
11
+ import { A_Concept } from "../A-Concept/A_Concept.class";
4
12
 
5
13
 
6
14
  /**
@@ -12,36 +20,36 @@ import { A_Component } from "../A-Component/A-Component.class";
12
20
  */
13
21
  export class A_Context {
14
22
 
15
-
16
23
  static instance: A_Context;
17
24
 
18
25
  /**
19
- * Stores all the Namespaces by namespace.
20
- * There might be a Namespaces of the same type but with different namespaces.
21
- * That might be useful for the cases when you need to have multiple instances of the same Namespace e.g.
22
- * - multiple http servers
23
- * - multitenant applications
24
- * - etc.
26
+ * A set of globally registered containers.
27
+ */
28
+ protected containers: WeakMap<A_Container<any>, A_Scope> = new WeakMap();
29
+
30
+ /**
31
+ * A set of globally registered features.
25
32
  */
26
- namespaced: Map<string, A_Namespace> = new Map();
33
+ protected features: WeakMap<A_Feature, A_Scope> = new WeakMap();
27
34
 
28
35
  /**
29
- * Stores the singleton Namespaces.
30
- * Singleton Namespaces are the Namespaces that are used only once in the program.
31
- * In most cases, the singleton Namespace is the main Namespace of the program.
32
- * It could be :
33
- * - the main Namespace of the Program
34
- * - the authentication Namespace
35
- * - the main database Namespace
36
- * - etc.
36
+ * A set of globally registered concepts.
37
37
  */
38
- singleton: WeakMap<{ new(...args: any[]): A_Namespace }, A_Namespace> = new WeakMap();
38
+ protected concepts: WeakMap<A_Concept<any>, A_Scope> = new WeakMap();
39
+
39
40
 
40
41
 
41
42
  /**
42
- * Stores the components that are used in the program.
43
+ * A set of allocated scopes per every element in the program.
43
44
  */
44
- components: Map<string, any> = new Map();
45
+ // protected scopes: WeakMap<A_Container<any> | A_Feature | A_Component | any, A_Scope> = new WeakMap();
46
+
47
+ protected conceptsMeta: Map<typeof A_Concept.constructor, A_Meta<any>> = new Map();
48
+ protected containersMeta: Map<typeof A_Container.constructor, A_ContainerMeta> = new Map();
49
+ protected componentsMeta: Map<typeof A_Container.constructor, A_ComponentMeta> = new Map();
50
+ // uses to allow to store custom meta data
51
+ protected customMeta: Map<typeof A_Container.constructor, A_Meta<any>> = new Map();
52
+
45
53
 
46
54
  /**
47
55
  * Root Namespace is a Namespace that is used to run the program.
@@ -49,9 +57,15 @@ export class A_Context {
49
57
  private _root!: string
50
58
 
51
59
 
52
- private constructor() {
60
+ private constructor() { }
61
+
62
+
63
+
64
+ // ===================================================================================================
65
+ // ================================ META OPERATIONS ==================================================
66
+ // ===================================================================================================
67
+
53
68
 
54
- }
55
69
 
56
70
  /**
57
71
  * Get the instance of the Namespace Provider.
@@ -74,157 +88,246 @@ export class A_Context {
74
88
  return A_Polyfills.env;
75
89
  }
76
90
 
77
- /**
78
- * Register a Namespace in the provider.
79
- * @param Namespace
80
- */
81
- static register(Namespace: A_Namespace): string
82
- static register(
83
- Namespace: A_Namespace,
84
- namespace?: string
85
- ): string
86
- static register(
87
- param1: A_Namespace,
88
- param2?: A_Namespace | string,
89
- ): string {
91
+
92
+
93
+
94
+ static allocate(
95
+ component: any,
96
+ importing: Partial<A_TYPES__ScopeConstructor & A_TYPES__ScopeConfig>
97
+ ): A_Scope
98
+ static allocate(
99
+ feature: A_Feature,
100
+ importing: Partial<A_TYPES__ScopeConstructor & A_TYPES__ScopeConfig>
101
+ ): A_Scope
102
+ static allocate(
103
+ container: A_Container<any>,
104
+ importing: Partial<A_TYPES__ScopeConstructor & A_TYPES__ScopeConfig>
105
+ ): A_Scope
106
+ static allocate(
107
+ param1: A_Container<any> | A_Feature | A_Component | any,
108
+ param2: Partial<A_TYPES__ScopeConstructor & A_TYPES__ScopeConfig>
109
+ ): A_Scope {
90
110
 
91
111
  const instance = this.getInstance();
92
112
 
93
- let Namespace: A_Namespace;
94
- let namespace: string;
113
+ const newScope = new A_Scope(param2, param2);
95
114
 
96
- if (typeof param2 === 'string') {
97
- namespace = param2;
98
- Namespace = param1;
99
- } else {
100
- Namespace = param1 as A_Namespace;
101
- namespace = Namespace.name;
102
- }
115
+ switch (true) {
116
+ case param1 instanceof A_Container:
117
+ instance.containers.set(param1, newScope);
118
+ break;
103
119
 
104
- /**
105
- * If the namespace is not provided, then use the root namespace.
106
- * If the root namespace is not provided, then use the default namespace.
107
- */
108
- if (!namespace)
109
- namespace = this.root
110
- || process.env.ADAAS_NAMESPACE
111
- || process.env.A_NAMESPACE
112
- || process.env.ADAAS_APP_NAMESPACE
113
- || 'a-concept'
120
+ case param1 instanceof A_Feature:
121
+ instance.features.set(param1, newScope);
122
+ break;
114
123
 
124
+ case param1 instanceof A_Concept:
125
+ instance.concepts.set(param1, newScope);
126
+ break;
115
127
 
116
128
 
117
- if (!this.root)
118
- instance._root = namespace;
129
+ default:
130
+ throw new Error(`[!] A-Concept Context: Unknown type of the parameter.`);
131
+ }
119
132
 
120
- instance.namespaced.set(namespace, Namespace);
121
133
 
122
- return namespace;
134
+ return newScope;
123
135
  }
124
136
 
125
137
 
126
138
 
127
139
 
140
+ static meta(
141
+ container: typeof A_Container,
142
+ ): A_ContainerMeta
143
+ static meta(
144
+ container: A_Container<any>,
145
+ ): A_ContainerMeta
146
+ static meta(
147
+ component: typeof A_Component,
148
+ ): A_ComponentMeta
149
+ static meta(
150
+ component: A_Component,
151
+ ): A_ComponentMeta
152
+ static meta<T extends Record<string, any>>(
153
+ component: { new(...args: any[]): any },
154
+ ): A_Meta<T>
155
+ static meta<T extends Record<string, any>>(
156
+ param1: typeof A_Container | A_Container<any> | { new(...args: any[]): any } | A_Component | typeof A_Component,
157
+ ): A_ContainerMeta | A_ComponentMeta | A_Meta<T> {
158
+ const instance = this.getInstance();
128
159
 
160
+ let metaStorage: WeakMap<typeof A_Container.constructor, A_Meta<any>>;
161
+ let property: Function;
129
162
 
130
- /**
131
- * Get the Namespace by namespace.
132
- * @param namespace
133
- */
134
- static get(namespace: string) {
135
- const instance = this.getInstance();
163
+ let meta: A_Meta<any>;
136
164
 
137
- return instance.namespaced.get(namespace)
138
- }
139
165
 
166
+ switch (true) {
167
+ case param1 instanceof A_Container: {
140
168
 
169
+ metaStorage = instance.containersMeta;
170
+ property = param1.constructor;
141
171
 
142
172
 
173
+ if (!metaStorage.has(property)) {
174
+ const inheritMeta = metaStorage.get(Object.getPrototypeOf(property)) || new A_ContainerMeta();
175
+ metaStorage.set(property, new A_ContainerMeta().from(inheritMeta));
176
+ }
143
177
 
144
- /**
145
- * Resolve the Component by Class.
146
- *
147
- * @param component
148
- */
149
- static resolve<T extends A_Component>(
150
- component: { new(...args: any[]): T }
151
- ): T
152
- static resolve<T extends A_Namespace>(
153
- namespace: { new(...args: any[]): T }
154
- ): T
155
- static resolve<
156
- T extends A_Namespace,
157
- >(
158
- namespaces: Array<{ new(...args: any[]): T }>
159
- ): Array<T>
160
- static resolve<T extends A_Namespace>(
161
- namespace: { new(...args: any[]): T },
162
- name: string
163
- ): T
164
- static resolve<
165
- T extends A_Namespace,
166
- K extends A_Component,
167
- >(
168
- param1: { new(...args: any[]): T } | { new(...args: any[]): K } | Array<{ new(...args: any[]): T }>,
169
- param2?: string
170
- ): T | K | Array<T> {
178
+ meta = metaStorage.get(property)!;
171
179
 
172
- switch (true) {
180
+ break;
181
+ }
173
182
 
174
- // If the first parameter is a Namespace
175
- case Array.isArray(param1) && param1.every(namespace => A_CommonHelper.isInheritedFrom(namespace, A_Namespace)):
176
- return param1.map(namespace => this.resolveNamespace(namespace));
183
+ case A_CommonHelper.isInheritedFrom(param1, A_Container): {
184
+ metaStorage = instance.containersMeta;
185
+ property = param1 as typeof A_Container<any>;
177
186
 
178
- // If the first parameter is a Namespace and the second parameter is a string
179
- case !!param2 && typeof param1 === 'function' && A_CommonHelper.isInheritedFrom(param1, A_Namespace):
180
- return this.resolveNamespace(param1 as typeof A_Namespace, param2) as T;
187
+ if (!metaStorage.has(property)) {
188
+ const inheritMeta = metaStorage.get(Object.getPrototypeOf(property)) || new A_ContainerMeta();
189
+ metaStorage.set(property, new A_ContainerMeta().from(inheritMeta));
190
+ }
181
191
 
182
- // If the first parameter is a Component
183
- case !!param2 && typeof param1 === 'function' && A_CommonHelper.isInheritedFrom(param1, A_Component):
184
- return this.resolveComponent(param1 as { new(...args: any[]): A_Component }) as K;
192
+ meta = metaStorage.get(property)!;
185
193
 
186
- default:
187
- throw new Error(`[!] A-Concept Context: Unknown type of the parameter.`);
194
+ break;
195
+ }
196
+
197
+ case param1 instanceof A_Component: {
198
+ metaStorage = instance.componentsMeta;
199
+ property = param1.constructor;
200
+
201
+
202
+ if (!metaStorage.has(property)) {
203
+ const inheritMeta = metaStorage.get(Object.getPrototypeOf(property)) || new A_ComponentMeta();
204
+ metaStorage.set(property, new A_ComponentMeta().from(inheritMeta));
205
+ }
206
+
207
+ meta = metaStorage.get(property)!;
208
+
209
+ break;
210
+ }
211
+
212
+ case A_CommonHelper.isInheritedFrom(param1, A_Component): {
213
+ metaStorage = instance.componentsMeta;
214
+ property = param1 as typeof A_Component;
215
+
216
+
217
+ if (!metaStorage.has(property)) {
218
+ const inheritMeta = metaStorage.get(Object.getPrototypeOf(property)) || new A_ComponentMeta();
219
+ metaStorage.set(property, new A_ComponentMeta().from(inheritMeta));
220
+ }
221
+
222
+ meta = metaStorage.get(property)!;
223
+
224
+ break;
225
+ }
226
+
227
+ default: {
228
+ metaStorage = instance.customMeta;
229
+ property = typeof (param1 as any) === 'function' ? param1 : param1.constructor;
230
+
231
+ if (!metaStorage.has(property)) {
232
+ const inheritMeta = metaStorage.get(Object.getPrototypeOf(property)) || new A_Meta();
233
+ metaStorage.set(property, new A_Meta().from(inheritMeta));
234
+ }
235
+
236
+ meta = metaStorage.get(property)!;
237
+
238
+ break;
239
+ }
188
240
  }
241
+
242
+ // const inheritMeta: T = metaStorage.get(Object.getPrototypeOf(property)) || new A_Meta() as T;
243
+ // // we just know that the type of parent meta is the same as the type of the current meta
244
+ // const meta = metaStorage.get(property);
245
+
246
+ return meta!;
189
247
  }
190
248
 
191
249
 
192
250
 
193
- private static resolveComponent<T extends A_Component>(
194
- component: { new(...args: any[]): T }
195
- ): T {
251
+
252
+
253
+ static scope(
254
+ concept: A_Concept
255
+ ): A_Scope
256
+ static scope(
257
+ component: A_Container<any>
258
+ ): A_Scope
259
+ static scope(
260
+ component: A_Feature
261
+ ): A_Scope
262
+ static scope(
263
+ param1: A_Feature | A_Container<any> | A_Concept
264
+ ): A_Scope | undefined {
265
+
196
266
  const instance = this.getInstance();
197
267
 
198
- return instance.components.get(component.name) as T;
268
+ switch (true) {
269
+ case param1 instanceof A_Container:
270
+ return instance.containers.get(param1);
271
+
272
+ case param1 instanceof A_Feature:
273
+ return instance.features.get(param1);
274
+
275
+
276
+ case param1 instanceof A_Concept:
277
+ return instance.concepts.get(param1);
278
+
279
+ default:
280
+ throw new Error(`[!] A-Concept Context: Unknown type of the parameter.`);
281
+ }
199
282
  }
200
283
 
201
284
 
202
285
 
203
286
  /**
204
- *
205
- * Allowing to resolve the Namespace by Class and Name.
206
- *
207
- * @param namespace
208
- * @param name
287
+ * Register a Namespace in the provider.
288
+ * @param Namespace
209
289
  */
210
- private static resolveNamespace<T extends A_Namespace>(
211
- namespace: { new(...args: any[]): T },
212
- name: string
213
- ): T
214
- private static resolveNamespace<T extends A_Namespace>(
215
- namespace: { new(...args: any[]): T }
216
- ): T
217
- private static resolveNamespace<T extends A_Namespace>(
218
- param1: { new(...args: any[]): T },
219
- param2?: string
220
- ): T {
290
+ static register(Namespace: A_Fragment): string
291
+ static register(
292
+ Namespace: A_Fragment,
293
+ namespace?: string
294
+ ): string
295
+ static register(
296
+ param1: A_Fragment,
297
+ param2?: A_Fragment | string,
298
+ ): string {
299
+
221
300
  const instance = this.getInstance();
222
301
 
223
- return instance.namespaced.get(
224
- param2 || param1.name
225
- ) as T;
226
- }
302
+ let fragment: A_Fragment;
303
+ let name: string;
304
+
305
+ if (typeof param2 === 'string') {
306
+ name = param2;
307
+ fragment = param1;
308
+ } else {
309
+ fragment = param1 as A_Fragment;
310
+ name = fragment.name;
311
+ }
312
+
313
+ /**
314
+ * If the namespace is not provided, then use the root namespace.
315
+ * If the root namespace is not provided, then use the default namespace.
316
+ */
317
+ if (!name)
318
+ name = this.root
319
+ || process.env.ADAAS_NAMESPACE
320
+ || process.env.A_NAMESPACE
321
+ || process.env.ADAAS_APP_NAMESPACE
322
+ || 'a-concept'
323
+
227
324
 
228
325
 
326
+ if (!this.root)
327
+ instance._root = name;
328
+
329
+ // instance.namedFragments.set(namespace, Namespace);
229
330
 
331
+ return name;
332
+ }
230
333
  }
@@ -0,0 +1,15 @@
1
+ import { A_Scope } from "../A-Scope/A-Scope.class"
2
+
3
+
4
+
5
+ export type A_TYPES__ContextExecutionPipeline = {
6
+ scope: A_Scope
7
+ steps: A_TYPES__ContextExecutionPipelineStep[]
8
+ }
9
+
10
+
11
+ export type A_TYPES__ContextExecutionPipelineStep = {
12
+ component: { new(...args: any[]): any },
13
+ handler: string,
14
+ args: any[]
15
+ }
@@ -1,61 +1,61 @@
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
+ // 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
+ // })();