@adaas/a-concept 0.0.2 → 0.0.4

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 (303) 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 +64 -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 +25 -7
  46. package/dist/index.js +55 -13
  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 +14 -0
  55. package/dist/src/base/A-Config/A-Config.types.js +3 -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 +36 -54
  169. package/dist/src/global/A-Context/A-Context.class.js +127 -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.types.d.ts +0 -55
  177. package/dist/src/global/A-Dependency/A-DependencyReference.types.js +56 -1
  178. package/dist/src/global/A-Dependency/A-DependencyReference.types.js.map +1 -1
  179. package/dist/src/global/A-Entity/A-Entity.class.d.ts +10 -0
  180. package/dist/src/global/A-Entity/A-Entity.class.js +16 -0
  181. package/dist/src/global/A-Entity/A-Entity.class.js.map +1 -0
  182. package/dist/src/global/A-Entity/A-Entity.types.js +2 -0
  183. package/dist/src/global/A-Entity/A-Entity.types.js.map +1 -0
  184. package/dist/src/global/A-Feature/A-Feature.class.d.ts +44 -0
  185. package/dist/src/global/A-Feature/A-Feature.class.js +125 -0
  186. package/dist/src/global/A-Feature/A-Feature.class.js.map +1 -0
  187. package/dist/src/global/A-Feature/A-Feature.types.d.ts +17 -0
  188. package/dist/src/global/A-Feature/A-Feature.types.js +11 -0
  189. package/dist/src/global/A-Feature/A-Feature.types.js.map +1 -0
  190. package/dist/src/global/A-Fragment/A-Fragment.class.d.ts +38 -0
  191. package/dist/src/global/A-Fragment/A-Fragment.class.js +107 -0
  192. package/dist/src/global/A-Fragment/A-Fragment.class.js.map +1 -0
  193. package/dist/src/global/A-Fragment/A-Fragment.types.d.ts +3 -0
  194. package/dist/src/global/A-Fragment/A-Fragment.types.js +3 -0
  195. package/dist/src/global/A-Fragment/A-Fragment.types.js.map +1 -0
  196. package/dist/src/global/A-Meta/A-Meta.class.d.ts +11 -0
  197. package/dist/src/global/A-Meta/A-Meta.class.js +43 -0
  198. package/dist/src/global/A-Meta/A-Meta.class.js.map +1 -0
  199. package/dist/src/global/A-Meta/A-Meta.types.d.ts +0 -0
  200. package/dist/src/global/A-Meta/A-Meta.types.js +2 -0
  201. package/dist/src/global/A-Meta/A-Meta.types.js.map +1 -0
  202. package/dist/src/global/A-Scope/A-Scope.class.d.ts +51 -0
  203. package/dist/src/global/A-Scope/A-Scope.class.js +133 -0
  204. package/dist/src/global/A-Scope/A-Scope.class.js.map +1 -0
  205. package/dist/src/global/A-Scope/A-Scope.types.d.ts +32 -0
  206. package/dist/src/global/A-Scope/A-Scope.types.js +3 -0
  207. package/dist/src/global/A-Scope/A-Scope.types.js.map +1 -0
  208. package/dist/src/storage/A_Component.storage.d.ts +10 -0
  209. package/dist/src/storage/A_Component.storage.js +17 -0
  210. package/dist/src/storage/A_Component.storage.js.map +1 -0
  211. package/dist/src/storage/A_Concept.storage.js +2 -2
  212. package/dist/src/storage/A_Concept.storage.js.map +1 -1
  213. package/dist/src/storage/A_Container.storage.d.ts +8 -0
  214. package/dist/src/storage/A_Container.storage.js +17 -0
  215. package/dist/src/storage/A_Container.storage.js.map +1 -0
  216. package/dist/src/storage/A_Inject.storage.d.ts +9 -0
  217. package/dist/src/storage/A_Inject.storage.js +13 -0
  218. package/dist/src/storage/A_Inject.storage.js.map +1 -0
  219. package/examples/simple/components/A.component.ts +35 -0
  220. package/examples/simple/components/B.component.ts +46 -0
  221. package/examples/simple/concept.ts +49 -12
  222. package/examples/simple/containers/Main.container.ts +41 -0
  223. package/examples/simple/context/Fragment_A.context.ts +25 -0
  224. package/examples/simple/context/Fragment_B.context.ts +19 -0
  225. package/examples/simple-http-server/components/http-error-handler.component.ts +44 -0
  226. package/examples/simple-http-server/components/http-request-handler.component.ts +9 -0
  227. package/examples/simple-http-server/concept.ts +22 -21
  228. package/examples/simple-http-server/containers/http-server.container.ts +23 -38
  229. package/examples/simple-http-server/contexts/http-request.context.ts +59 -0
  230. package/examples/simple-http-server/contexts/http-server.context.types.ts +0 -108
  231. package/examples/simple-http-server/test.ts +290 -0
  232. package/index.ts +55 -8
  233. package/jest.config.ts +2 -0
  234. package/package.json +4 -7
  235. package/src/{containers → base}/A-Config/A-Config.container.ts +21 -20
  236. package/src/{containers/A-Config/A-Config.namespace.ts → base/A-Config/A-Config.context.ts} +12 -5
  237. package/src/{containers → base}/A-Config/A-Config.types.ts +10 -4
  238. package/src/{containers → base}/A-Config/components/ConfigReader.component.ts +7 -3
  239. package/src/{containers → base}/A-Config/components/ENVConfigReader.component.ts +1 -1
  240. package/src/{containers → base}/A-Config/components/FileConfigReader.component.ts +1 -1
  241. package/src/base/A-Errors/A-Errors.component.ts +102 -0
  242. package/src/{containers/A-Errors/A-Errors.namespace.ts → base/A-Errors/A-Errors.context.ts} +24 -39
  243. package/src/{containers → base}/A-Errors/A-Errors.types.ts +2 -2
  244. package/src/base/A-Logger/A-Logger.component.ts +169 -0
  245. package/src/base/A-Logger/A-Logger.types.ts +0 -0
  246. package/src/constants/A_ConceptLifecycle.constants.ts +9 -9
  247. package/src/decorators/A-Feature/A-Feature-Define.decorator.ts +57 -0
  248. package/src/decorators/A-Feature/A-Feature-Extend.decorator.ts +57 -0
  249. package/src/decorators/A-Feature/A-Feature.decorator.types.ts +56 -0
  250. package/src/decorators/A-Inject/A-Inject.decorator.ts +65 -53
  251. package/src/decorators/A-Inject/A-Inject.decorator.types.ts +31 -4
  252. package/src/decorators/A-Stage/A-Stage.decorator.ts +57 -0
  253. package/src/decorators/A-Stage/A-Stage.decorator.types.ts +23 -0
  254. package/src/global/A-Channel/A-Channel.class.ts +48 -0
  255. package/src/global/A-Channel/A-Channel.types.ts +60 -0
  256. package/src/global/A-Component/A-Component.class.ts +1 -29
  257. package/src/global/A-Component/A-Component.meta.ts +9 -0
  258. package/src/global/A-Component/A-Component.types.ts +40 -0
  259. package/src/global/A-Concept/A_Concept.class.ts +160 -66
  260. package/src/global/A-Concept/A_Concept.meta.ts +9 -0
  261. package/src/global/A-Concept/A_Concept.types.ts +45 -10
  262. package/src/global/A-Container/A-Container.class.ts +177 -22
  263. package/src/global/A-Container/A-Container.meta.ts +80 -0
  264. package/src/global/A-Container/A-Container.types.ts +40 -0
  265. package/src/global/A-Context/A-Context.class.ts +231 -130
  266. package/src/global/A-Context/A-Context.types.ts +15 -0
  267. package/src/global/A-Dependency/A-DependencyReference.types.ts +56 -56
  268. package/src/global/A-Entity/A-Entity.class.ts +16 -0
  269. package/src/global/A-Entity/A-Entity.types.ts +0 -0
  270. package/src/global/A-Feature/A-Feature.class.ts +156 -0
  271. package/src/global/A-Feature/A-Feature.types.ts +20 -0
  272. package/src/global/{A-Namespace/A_Namespace.class.ts → A-Fragment/A-Fragment.class.ts} +24 -30
  273. package/src/global/A-Fragment/A-Fragment.types.ts +6 -0
  274. package/src/global/A-Meta/A-Meta.class.ts +60 -0
  275. package/src/global/A-Meta/A-Meta.types.ts +0 -0
  276. package/src/global/A-Scope/A-Scope.class.ts +208 -0
  277. package/src/global/A-Scope/A-Scope.types.ts +37 -0
  278. package/src/storage/A_Component.storage.ts +28 -0
  279. package/src/storage/A_Concept.storage.ts +5 -1
  280. package/src/storage/A_Container.storage.ts +21 -0
  281. package/src/storage/A_Inject.storage.ts +30 -0
  282. package/tsconfig.json +3 -1
  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/containers/A-Logger/A-Logger.types.ts → dist/src/base/A-Logger/A-Logger.types.d.ts} +0 -0
  303. /package/{src/decorators/A_ConceptMethods.decorator.ts → dist/src/global/A-Entity/A-Entity.types.d.ts} +0 -0
@@ -1,5 +1,6 @@
1
- import { A_TYPES__A_CONCEPT_RootRunParams, A_TYPES__IConceptConstructor } from "./A_Concept.types";
2
- import { A_Context } from "../A-Context/A-Context.class";
1
+ import { A_TYPES__ConceptStageParams, A_TYPES__IConceptConstructor } from "./A_Concept.types";
2
+ import { A_Container } from "../A-Container/A-Container.class";
3
+ import { A_Fragment } from "../A-Fragment/A-Fragment.class";
3
4
  /**
4
5
  * A_Concept is a placeholder for the concept of the ani program.
5
6
  *
@@ -12,35 +13,58 @@ import { A_Context } from "../A-Context/A-Context.class";
12
13
  *
13
14
  *
14
15
  */
15
- export declare class A_Concept {
16
+ export declare class A_Concept<_Features extends A_Container<any>[] = any> {
17
+ protected props: A_TYPES__IConceptConstructor<_Features>;
16
18
  /**
17
- * Context is a root namespace for the concept.
19
+ * Load the concept. This step runs before any other steps to ensure that all components are loaded.
18
20
  */
19
- Context: typeof A_Context;
21
+ static get Load(): (config?: Partial<import("../../decorators/A-Stage/A-Stage.decorator.types").A_TYPES__A_StageDecoratorConfig>) => (target: A_Container<any>, propertyKey: string, descriptor: import("../../decorators/A-Stage/A-Stage.decorator.types").A_TYPES__A_StageDecoratorDescriptor) => void;
20
22
  /**
21
- * Context provider is a singleton that provides the context for ALL concepts.
23
+ * Publish the concept to ADAAS platform. (Or any other place defined in the concept)
24
+ *
25
+ * [!] To extend the logic just create a custom containers and override the default behavior.
22
26
  */
23
- protected props: A_TYPES__IConceptConstructor;
24
- constructor(props: A_TYPES__IConceptConstructor);
25
- get namespace(): string;
27
+ static get Publish(): (config?: Partial<import("../../decorators/A-Stage/A-Stage.decorator.types").A_TYPES__A_StageDecoratorConfig>) => (target: A_Container<any>, propertyKey: string, descriptor: import("../../decorators/A-Stage/A-Stage.decorator.types").A_TYPES__A_StageDecoratorDescriptor) => void;
28
+ /**
29
+ * Deploy the concept to the environment.
30
+ */
31
+ static get Deploy(): (config?: Partial<import("../../decorators/A-Stage/A-Stage.decorator.types").A_TYPES__A_StageDecoratorConfig>) => (target: A_Container<any>, propertyKey: string, descriptor: import("../../decorators/A-Stage/A-Stage.decorator.types").A_TYPES__A_StageDecoratorDescriptor) => void;
26
32
  /**
27
- * Returns true if the class has inherited from the given class.
33
+ * Compiles the Concept in case there are some containers that require that.
34
+ *
35
+ * Can be used for static websites or any other concept that requires a build step.
28
36
  *
29
- * @param cl
30
- * @returns
31
37
  */
32
- private hasInherited;
33
- protected init(): Promise<void>;
38
+ static get Build(): (config?: Partial<import("../../decorators/A-Stage/A-Stage.decorator.types").A_TYPES__A_StageDecoratorConfig>) => (target: A_Container<any>, propertyKey: string, descriptor: import("../../decorators/A-Stage/A-Stage.decorator.types").A_TYPES__A_StageDecoratorDescriptor) => void;
39
+ /**
40
+ * Main execution of the concept.
41
+ */
42
+ static get Run(): (config?: Partial<import("../../decorators/A-Stage/A-Stage.decorator.types").A_TYPES__A_StageDecoratorConfig>) => (target: A_Container<any>, propertyKey: string, descriptor: import("../../decorators/A-Stage/A-Stage.decorator.types").A_TYPES__A_StageDecoratorDescriptor) => void;
43
+ /**
44
+ * Start the concept. Uses for servers or any other background services.
45
+ */
46
+ static get Start(): (config?: Partial<import("../../decorators/A-Stage/A-Stage.decorator.types").A_TYPES__A_StageDecoratorConfig>) => (target: A_Container<any>, propertyKey: string, descriptor: import("../../decorators/A-Stage/A-Stage.decorator.types").A_TYPES__A_StageDecoratorDescriptor) => void;
47
+ /**
48
+ * Stop the concept. Uses for servers or any other background services.
49
+ */
50
+ static get Stop(): (config?: Partial<import("../../decorators/A-Stage/A-Stage.decorator.types").A_TYPES__A_StageDecoratorConfig>) => (target: A_Container<any>, propertyKey: string, descriptor: import("../../decorators/A-Stage/A-Stage.decorator.types").A_TYPES__A_StageDecoratorDescriptor) => void;
51
+ protected containers: A_Container<any>[];
52
+ constructor(props: A_TYPES__IConceptConstructor<_Features>);
53
+ get namespace(): string;
34
54
  /**
35
55
  * Run the concept.
36
56
  */
37
- run(params?: A_TYPES__A_CONCEPT_RootRunParams): Promise<void>;
57
+ run(params?: Partial<A_TYPES__ConceptStageParams>): Promise<void>;
38
58
  /**
39
59
  * Build the concept.
40
60
  */
41
- build(): Promise<void>;
61
+ build(params?: Partial<A_TYPES__ConceptStageParams>): Promise<void>;
62
+ deploy(params?: Partial<A_TYPES__ConceptStageParams>): Promise<void>;
63
+ publish(params?: Partial<A_TYPES__ConceptStageParams>): Promise<void>;
42
64
  /**
43
65
  * Call the specific method of the concept or included modules.
44
66
  */
45
- call(): Promise<void>;
67
+ call<K extends Record<_Features[number]['name'], _Features[number]['exports'][number]>>(container: K[keyof K], params?: A_Fragment[]): Promise<void>;
68
+ private runStage;
69
+ private execute;
46
70
  }
@@ -10,8 +10,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.A_Concept = void 0;
13
+ const A_Concept_types_1 = require("./A_Concept.types");
13
14
  const A_Context_class_1 = require("../A-Context/A-Context.class");
14
- const A_Errors_namespace_1 = require("src/containers/A-Errors/A-Errors.namespace");
15
+ const A_Logger_component_1 = require("../../base/A-Logger/A-Logger.component");
16
+ const A_Container_types_1 = require("../A-Container/A-Container.types");
17
+ const A_Stage_decorator_1 = require("../../decorators/A-Stage/A-Stage.decorator");
18
+ // export type RunParams<T> = T extends A_Container<any, infer Params> ? Params : never;
15
19
  /**
16
20
  * A_Concept is a placeholder for the concept of the ani program.
17
21
  *
@@ -25,29 +29,74 @@ const A_Errors_namespace_1 = require("src/containers/A-Errors/A-Errors.namespace
25
29
  *
26
30
  */
27
31
  class A_Concept {
28
- constructor(props) {
29
- this.props = props;
30
- this.Context = A_Context_class_1.A_Context;
32
+ // ==============================================================================
33
+ // ==================== STATIC LIFECYCLE DECORATORS ===========================
34
+ // ==============================================================================
35
+ /**
36
+ * Load the concept. This step runs before any other steps to ensure that all components are loaded.
37
+ */
38
+ static get Load() {
39
+ return (0, A_Stage_decorator_1.A_Stage)(A_Concept_types_1.A_TYPES__ConceptStage.Load);
31
40
  }
32
- get namespace() {
33
- return this.Context.root;
41
+ /**
42
+ * Publish the concept to ADAAS platform. (Or any other place defined in the concept)
43
+ *
44
+ * [!] To extend the logic just create a custom containers and override the default behavior.
45
+ */
46
+ static get Publish() {
47
+ return (0, A_Stage_decorator_1.A_Stage)(A_Concept_types_1.A_TYPES__ConceptStage.Publish);
48
+ }
49
+ /**
50
+ * Deploy the concept to the environment.
51
+ */
52
+ static get Deploy() {
53
+ return (0, A_Stage_decorator_1.A_Stage)(A_Concept_types_1.A_TYPES__ConceptStage.Deploy);
34
54
  }
35
55
  /**
36
- * Returns true if the class has inherited from the given class.
56
+ * Compiles the Concept in case there are some containers that require that.
57
+ *
58
+ * Can be used for static websites or any other concept that requires a build step.
37
59
  *
38
- * @param cl
39
- * @returns
40
60
  */
41
- hasInherited(cl) {
42
- return this.constructor === cl
43
- ? false
44
- : true;
61
+ static get Build() {
62
+ return (0, A_Stage_decorator_1.A_Stage)(A_Concept_types_1.A_TYPES__ConceptStage.Build);
45
63
  }
46
- init() {
47
- return __awaiter(this, void 0, void 0, function* () {
48
- // await this.Context.init();
49
- // await this.DM.init();
64
+ /**
65
+ * Main execution of the concept.
66
+ */
67
+ static get Run() {
68
+ return (0, A_Stage_decorator_1.A_Stage)(A_Concept_types_1.A_TYPES__ConceptStage.Run);
69
+ }
70
+ /**
71
+ * Start the concept. Uses for servers or any other background services.
72
+ */
73
+ static get Start() {
74
+ return (0, A_Stage_decorator_1.A_Stage)(A_Concept_types_1.A_TYPES__ConceptStage.Start);
75
+ }
76
+ /**
77
+ * Stop the concept. Uses for servers or any other background services.
78
+ */
79
+ static get Stop() {
80
+ return (0, A_Stage_decorator_1.A_Stage)(A_Concept_types_1.A_TYPES__ConceptStage.Stop);
81
+ }
82
+ constructor(props) {
83
+ this.props = props;
84
+ // ==============================================================================
85
+ // ========================== MAIN Class ======================================
86
+ // ==============================================================================
87
+ this.containers = [];
88
+ A_Context_class_1.A_Context.allocate(this, {
89
+ name: props.name,
90
+ fragments: props.fragments || [],
91
+ // containers: props.containers
92
+ components: [
93
+ A_Logger_component_1.A_Logger,
94
+ ]
50
95
  });
96
+ this.containers = props.containers || [];
97
+ }
98
+ get namespace() {
99
+ return A_Context_class_1.A_Context.scope(this).name;
51
100
  }
52
101
  // =======================================================================
53
102
  // ========================== LIFECYCLE ================================
@@ -55,50 +104,78 @@ class A_Concept {
55
104
  /**
56
105
  * Run the concept.
57
106
  */
58
- run() {
59
- return __awaiter(this, arguments, void 0, function* (params = {}) {
60
- // to prevent modification of the method parameters use the A_Context directly without decorators
61
- const [Errors] = this.Context.resolve([A_Errors_namespace_1.A_Errors]);
62
- if (this.hasInherited(A_Concept))
63
- Errors.throw('[root.run] method can not be overridden in the inherited classes');
64
- // const allRunDeclarations = A_CONCEPT_LifecycleDeclarationsStorage
65
- // .get(A_CONCEPT_STORAGE__DECORATORS_RUN_DECLARATIONS);
107
+ run(params) {
108
+ return __awaiter(this, void 0, void 0, function* () {
66
109
  });
67
110
  }
68
111
  /**
69
112
  * Build the concept.
70
113
  */
71
- build() {
114
+ build(params) {
72
115
  return __awaiter(this, void 0, void 0, function* () {
73
- // to prevent modification of the method parameters use the A_Context directly without decorators
74
- const [Errors] = this.Context.resolve([A_Errors_namespace_1.A_Errors]);
75
- if (this.hasInherited(A_Concept))
76
- Errors.throw('[root.build] method can not be overridden in the inherited classes');
77
116
  });
78
117
  }
79
118
  // /**
80
119
  // * Deploy the concept.
81
120
  // */
82
- // async deploy() {
83
- // if (this.hasInherited(A_Concept))
84
- // this.Context.Errors.throw('[root.deploy] method can not be overridden in the inherited classes');
85
- // }
121
+ deploy(params) {
122
+ return __awaiter(this, void 0, void 0, function* () {
123
+ });
124
+ }
86
125
  // /**
87
126
  // * Publish the concept.
88
127
  // */
89
- // async publish() {
90
- // if (this.hasInherited(A_Concept))
91
- // this.Context.Errors.throw('[root.publish] method can not be overridden in the inherited classes');
92
- // }
128
+ publish(params) {
129
+ return __awaiter(this, void 0, void 0, function* () {
130
+ });
131
+ }
93
132
  /**
94
133
  * Call the specific method of the concept or included modules.
95
134
  */
96
- call() {
135
+ call(container, params) {
136
+ return __awaiter(this, void 0, void 0, function* () {
137
+ // for (const feature of this.features) {
138
+ // if (methodName in feature) {
139
+ // (feature as any)[methodName](...args);
140
+ // }
141
+ // }
142
+ });
143
+ }
144
+ runStage(method, params) {
145
+ return __awaiter(this, void 0, void 0, function* () {
146
+ const stages = [];
147
+ this.containers.map(container => {
148
+ const meta = A_Context_class_1.A_Context.meta(container);
149
+ const containerStages = meta.get(A_Container_types_1.A_TYPES__ContainerMetaKey.STAGES);
150
+ if (containerStages) {
151
+ for (const [name, stage] of containerStages) {
152
+ if (stage.name === method) {
153
+ stages.push({
154
+ name,
155
+ container,
156
+ });
157
+ }
158
+ }
159
+ }
160
+ });
161
+ const scope = A_Context_class_1.A_Context.allocate(this, {
162
+ components: params.components,
163
+ fragments: params.fragments,
164
+ parent: A_Context_class_1.A_Context.scope(this)
165
+ });
166
+ for (const stage of stages) {
167
+ yield stage.container[stage.name](params);
168
+ }
169
+ });
170
+ }
171
+ execute(params) {
97
172
  return __awaiter(this, void 0, void 0, function* () {
98
- // to prevent modification of the method parameters use the A_Context directly without decorators
99
- const [Errors] = this.Context.resolve([A_Errors_namespace_1.A_Errors]);
100
- // if (this.hasInherited(A_Concept))
101
- // this.Context.Errors.throw('[root.call] method can not be overridden in the inherited classes');
173
+ const fragments = params.fragments || [];
174
+ const component = params.components || [];
175
+ this.containers.map(container => {
176
+ const meta = A_Context_class_1.A_Context.meta(container);
177
+ meta.get(A_Container_types_1.A_TYPES__ContainerMetaKey.FEATURES);
178
+ });
102
179
  });
103
180
  }
104
181
  }
@@ -1 +1 @@
1
- {"version":3,"file":"A_Concept.class.js","sourceRoot":"","sources":["../../../../src/global/A-Concept/A_Concept.class.ts"],"names":[],"mappings":";;;;;;;;;;;;AAEA,kEAAyD;AACzD,mFAAsE;AAItE;;;;;;;;;;;GAWG;AACH,MAAa,SAAS;IAclB,YACI,KAAmC;QAEnC,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QAEnB,IAAI,CAAC,OAAO,GAAG,2BAAS,CAAC;IAC7B,CAAC;IAGD,IAAI,SAAS;QACT,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAA;IAC5B,CAAC;IAGD;;;;;OAKG;IACK,YAAY,CAAC,EAA2B;QAC5C,OAAO,IAAI,CAAC,WAAW,KAAK,EAAE;YAC1B,CAAC,CAAC,KAAK;YACP,CAAC,CAAC,IAAI,CAAA;IACd,CAAC;IAKe,IAAI;;YAChB,6BAA6B;YAE7B,wBAAwB;QAC5B,CAAC;KAAA;IAID,0EAA0E;IAC1E,0EAA0E;IAC1E,0EAA0E;IAE1E;;OAEG;IACG,GAAG;6DACL,SAA2C,EAAE;YAG7C,mGAAmG;YACnG,MAAM,CACF,MAAM,CACT,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,6BAAQ,CAAC,CAAC,CAAC;YAErC,IAAI,IAAI,CAAC,YAAY,CAAC,SAAS,CAAC;gBAC5B,MAAM,CAAC,KAAK,CAAC,kEAAkE,CAAC,CAAC;YAGrF,oEAAoE;YACpE,4DAA4D;QAChE,CAAC;KAAA;IAGD;;OAEG;IACG,KAAK;;YACP,mGAAmG;YACnG,MAAM,CACF,MAAM,CACT,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,6BAAQ,CAAC,CAAC,CAAC;YAGrC,IAAI,IAAI,CAAC,YAAY,CAAC,SAAS,CAAC;gBAC5B,MAAM,CAAC,KAAK,CAAC,oEAAoE,CAAC,CAAC;QAE3F,CAAC;KAAA;IAGD,MAAM;IACN,yBAAyB;IACzB,MAAM;IACN,mBAAmB;IACnB,wCAAwC;IACxC,4GAA4G;IAC5G,IAAI;IAGJ,MAAM;IACN,0BAA0B;IAC1B,MAAM;IACN,oBAAoB;IACpB,wCAAwC;IACxC,6GAA6G;IAC7G,IAAI;IAGJ;;OAEG;IACG,IAAI;;YACN,mGAAmG;YACnG,MAAM,CACF,MAAM,CACT,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,6BAAQ,CAAC,CAAC,CAAC;YAErC,oCAAoC;YACpC,sGAAsG;QAC1G,CAAC;KAAA;CAEJ;AA3HD,8BA2HC"}
1
+ {"version":3,"file":"A_Concept.class.js","sourceRoot":"","sources":["../../../../src/global/A-Concept/A_Concept.class.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,3 @@
1
+ import { A_Meta } from "../A-Meta/A-Meta.class";
2
+ export declare class A_ConceptMeta extends A_Meta<any> {
3
+ }
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.A_ConceptMeta = void 0;
4
+ const A_Meta_class_1 = require("../A-Meta/A-Meta.class");
5
+ // import { A_TYPES__ComponentMeta } from "./A-Component.types";
6
+ class A_ConceptMeta extends A_Meta_class_1.A_Meta {
7
+ }
8
+ exports.A_ConceptMeta = A_ConceptMeta;
9
+ //# sourceMappingURL=A_Concept.meta.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"A_Concept.meta.js","sourceRoot":"","sources":["../../../../src/global/A-Concept/A_Concept.meta.ts"],"names":[],"mappings":";;;AAAA,yDAAgD;AAChD,gEAAgE;AAGhE,MAAa,aAAc,SAAQ,qBAAW;CAI7C;AAJD,sCAIC"}
@@ -1,26 +1,41 @@
1
- import { A_Concept } from "./A_Concept.class";
2
- import { A_Namespace } from "../A-Namespace/A_Namespace.class";
3
1
  import { A_Container } from "../A-Container/A-Container.class";
4
- export interface A_TYPES__IConceptConstructor {
2
+ import { A_Fragment } from "../A-Fragment/A-Fragment.class";
3
+ export declare enum A_TYPES__ConceptStage {
4
+ Run = "run",
5
+ Build = "build",
6
+ Publish = "publish",
7
+ Deploy = "deploy",
8
+ Load = "load",
9
+ Start = "start",
10
+ Stop = "stop"
11
+ }
12
+ export declare enum A_TYPES__ConceptMetaKey {
13
+ LIFECYCLE = "a-component-extensions"
14
+ }
15
+ export interface A_TYPES__IConceptConstructor<T extends Array<A_Container<any>>> {
5
16
  name: string;
6
- description?: string;
7
17
  /**
8
- * A set of Namespaces that the concept depends on.
9
- * These namespaces will create a new Context for the concept.
18
+ * A set of Context Fragments to register globally for the concept.
19
+ * These fragments will be available in the global context.
10
20
  *
11
21
  */
12
- context?: Array<A_Namespace>;
22
+ fragments?: Array<A_Fragment>;
13
23
  /**
14
24
  * A set of Containers that the concept depends on.
15
25
  * These containers will create a new Container for the concept.
16
26
  */
17
- containers?: Array<{
18
- new (...args: any[]): A_Container;
19
- }>;
20
- /**
21
- * A set of external Concepts that can be used in the current Concept.
22
- * To provide additional functionality or extend the current Concept.
23
- */
24
- import?: Array<A_Concept>;
27
+ containers?: T;
25
28
  }
26
- export type A_TYPES__A_CONCEPT_RootRunParams = {};
29
+ export type A_TYPES__ConceptStageParams = {
30
+ fragments: Array<A_Fragment>;
31
+ components: Array<{
32
+ new (...args: any[]): any;
33
+ }>;
34
+ };
35
+ export type A_TYPES__ConceptCallParams<T extends string> = {
36
+ name: T;
37
+ fragments: Array<A_Fragment>;
38
+ components: Array<{
39
+ new (...args: any[]): any;
40
+ }>;
41
+ };
@@ -1,3 +1,28 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.A_TYPES__ConceptMetaKey = exports.A_TYPES__ConceptStage = void 0;
4
+ var A_TYPES__ConceptStage;
5
+ (function (A_TYPES__ConceptStage) {
6
+ A_TYPES__ConceptStage["Run"] = "run";
7
+ A_TYPES__ConceptStage["Build"] = "build";
8
+ A_TYPES__ConceptStage["Publish"] = "publish";
9
+ A_TYPES__ConceptStage["Deploy"] = "deploy";
10
+ A_TYPES__ConceptStage["Load"] = "load";
11
+ A_TYPES__ConceptStage["Start"] = "start";
12
+ A_TYPES__ConceptStage["Stop"] = "stop";
13
+ })(A_TYPES__ConceptStage || (exports.A_TYPES__ConceptStage = A_TYPES__ConceptStage = {}));
14
+ // export type A_TYPES__ConceptMeta = {
15
+ // [A_TYPES__ConceptMetaKey.EXTENSIONS]: Map<string, A_TYPES__ConceptMeta_ExtensionItem>,
16
+ // [A_TYPES__ConceptMetaKey.FEATURES]: any[],
17
+ // // [A_TYPES__ConceptMetaKey.INJECTIONS]: Map<
18
+ // // // Where key is method name
19
+ // // Symbol | string,
20
+ // // // And value is Injection instructions
21
+ // // A_TYPES__ConceptMeta_InjectionParams
22
+ // // >
23
+ // }
24
+ var A_TYPES__ConceptMetaKey;
25
+ (function (A_TYPES__ConceptMetaKey) {
26
+ A_TYPES__ConceptMetaKey["LIFECYCLE"] = "a-component-extensions";
27
+ })(A_TYPES__ConceptMetaKey || (exports.A_TYPES__ConceptMetaKey = A_TYPES__ConceptMetaKey = {}));
3
28
  //# sourceMappingURL=A_Concept.types.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"A_Concept.types.js","sourceRoot":"","sources":["../../../../src/global/A-Concept/A_Concept.types.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"A_Concept.types.js","sourceRoot":"","sources":["../../../../src/global/A-Concept/A_Concept.types.ts"],"names":[],"mappings":";;;AAIA,IAAY,qBAQX;AARD,WAAY,qBAAqB;IAC7B,oCAAW,CAAA;IACX,wCAAe,CAAA;IACf,4CAAmB,CAAA;IACnB,0CAAiB,CAAA;IACjB,sCAAa,CAAA;IACb,wCAAe,CAAA;IACf,sCAAa,CAAA;AACjB,CAAC,EARW,qBAAqB,qCAArB,qBAAqB,QAQhC;AAGD,uCAAuC;AACvC,6FAA6F;AAC7F,iDAAiD;AACjD,oDAAoD;AACpD,yCAAyC;AACzC,8BAA8B;AAC9B,oDAAoD;AACpD,kDAAkD;AAClD,WAAW;AAEX,IAAI;AAEJ,IAAY,uBAEX;AAFD,WAAY,uBAAuB;IAC/B,+DAAoC,CAAA;AACxC,CAAC,EAFW,uBAAuB,uCAAvB,uBAAuB,QAElC"}
@@ -1,14 +1,76 @@
1
- import { A_Namespace } from "../A-Namespace/A_Namespace.class";
1
+ import { A_TYPES__ContainerCallParams, A_TYPES__ContainerConstructor } from "./A-Container.types";
2
+ import { A_TYPES__Required } from "@adaas/a-utils";
3
+ import { A_Feature } from "../A-Feature/A-Feature.class";
2
4
  /**
3
- * This class should combine Components to achieve the goal withing Context
4
- * Container could be interpreted as any Structure Entity, or Abstract Entity
5
- * For example:
6
- * - Controller (all Controllers with base logic)
7
- * - Service (all Services with base logic)
8
- * - Module (all Modules with base logic)
5
+ * This class should combine Components to achieve the goal withing Concept
6
+ *
7
+ * Container is a direct container that should be "run" to make Concept work.
8
+ * So because of that Container can be:
9
+ * - HTTP Server
10
+ * - BASH Script
11
+ * - Database Connection
12
+ * - Microservice
9
13
  * - etc.
10
14
  */
11
- export declare class A_Container<T extends A_Namespace = A_Namespace> {
12
- protected readonly namespace: T;
13
- constructor(namespace?: T);
15
+ export declare class A_Container<_FeatureNames extends Array<string>> {
16
+ protected readonly config: Partial<A_TYPES__ContainerConstructor<_FeatureNames>>;
17
+ /**
18
+ * Promise that will be resolved when the container is ready to be used.
19
+ */
20
+ ready: Promise<void>;
21
+ get exports(): _FeatureNames;
22
+ get name(): string;
23
+ constructor(
24
+ /**
25
+ * Configuration of the container that will be used to run it.
26
+ */
27
+ config: Partial<A_TYPES__ContainerConstructor<_FeatureNames>>);
28
+ protected hasInherited(cl: {
29
+ new (...args: any[]): any;
30
+ }): boolean;
31
+ /**
32
+ * Initializes the Namespace or can be used to reinitialize the Namespace
33
+ */
34
+ private init;
35
+ /**
36
+ * This method allows to call the lifecycle method of the container as well as any other Feature defined for it
37
+ *
38
+ * @param lifecycleMethod
39
+ * @param args
40
+ */
41
+ call(
42
+ /**
43
+ * A-Feature method name to be called
44
+ */
45
+ feature: _FeatureNames[number]): A_Feature;
46
+ call(
47
+ /**
48
+ * A-Feature name to be called
49
+ */
50
+ params: A_TYPES__Required<Partial<A_TYPES__ContainerCallParams<_FeatureNames[number]>>, ['name']>): A_Feature;
51
+ call(
52
+ /**
53
+ * A-Feature method name to be called
54
+ */
55
+ feature: _FeatureNames[number],
56
+ /**
57
+ * Parameters to provide additional data to the feature
58
+ */
59
+ params: Partial<A_TYPES__ContainerCallParams<_FeatureNames[number]>>): A_Feature;
60
+ /**
61
+ * Before init hook to be used in inherited classes
62
+ *
63
+ * @returns
64
+ */
65
+ protected onBeforeInit(): Promise<void>;
66
+ /**
67
+ * Main initialization method for the Container
68
+ */
69
+ protected onInit(): Promise<void>;
70
+ /**
71
+ * After init hook to be used in inherited classes
72
+ *
73
+ * @returns
74
+ */
75
+ protected onAfterInit(): Promise<void>;
14
76
  }
@@ -1,20 +1,130 @@
1
1
  "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
2
11
  Object.defineProperty(exports, "__esModule", { value: true });
3
12
  exports.A_Container = void 0;
13
+ const A_Feature_class_1 = require("../A-Feature/A-Feature.class");
14
+ const A_Context_class_1 = require("../A-Context/A-Context.class");
4
15
  /**
5
- * This class should combine Components to achieve the goal withing Context
6
- * Container could be interpreted as any Structure Entity, or Abstract Entity
7
- * For example:
8
- * - Controller (all Controllers with base logic)
9
- * - Service (all Services with base logic)
10
- * - Module (all Modules with base logic)
16
+ * This class should combine Components to achieve the goal withing Concept
17
+ *
18
+ * Container is a direct container that should be "run" to make Concept work.
19
+ * So because of that Container can be:
20
+ * - HTTP Server
21
+ * - BASH Script
22
+ * - Database Connection
23
+ * - Microservice
11
24
  * - etc.
12
25
  */
13
26
  class A_Container {
14
- constructor(namespace) {
15
- if (namespace) {
16
- this.namespace = namespace;
27
+ get exports() {
28
+ return this.config.exports || [];
29
+ }
30
+ get name() {
31
+ return this.config.name || this.constructor.name;
32
+ }
33
+ constructor(
34
+ /**
35
+ * Configuration of the container that will be used to run it.
36
+ */
37
+ config) {
38
+ this.config = config;
39
+ const components = config.components || [];
40
+ const fragments = config.fragments || [];
41
+ A_Context_class_1.A_Context.allocate(this, {
42
+ components,
43
+ fragments
44
+ });
45
+ /**
46
+ * Run Async Initialization
47
+ */
48
+ this.init();
49
+ }
50
+ hasInherited(cl) {
51
+ return this.constructor === cl
52
+ ? false
53
+ : true;
54
+ }
55
+ /**
56
+ * Initializes the Namespace or can be used to reinitialize the Namespace
57
+ */
58
+ init() {
59
+ return __awaiter(this, void 0, void 0, function* () {
60
+ if (!this.ready)
61
+ this.ready = new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
62
+ try {
63
+ yield this.onBeforeInit();
64
+ yield this.onInit();
65
+ yield this.onAfterInit();
66
+ return resolve();
67
+ }
68
+ catch (error) {
69
+ return reject(error);
70
+ }
71
+ }));
72
+ else
73
+ yield this.ready;
74
+ });
75
+ }
76
+ call(param1, param2) {
77
+ let feature;
78
+ let params;
79
+ if (typeof param1 === 'string') {
80
+ feature = param1;
81
+ params = param2 || {};
17
82
  }
83
+ else {
84
+ feature = param1.name;
85
+ params = param1;
86
+ }
87
+ const meta = A_Context_class_1.A_Context.meta(this);
88
+ const steps = meta.feature(this, feature);
89
+ const newFeature = new A_Feature_class_1.A_Feature({
90
+ name: `${this.constructor.name}.${feature}`,
91
+ fragments: (param2 === null || param2 === void 0 ? void 0 : param2.fragments) || [],
92
+ components: (param2 === null || param2 === void 0 ? void 0 : param2.components) || [],
93
+ steps,
94
+ parent: A_Context_class_1.A_Context.scope(this)
95
+ });
96
+ return newFeature;
97
+ }
98
+ // ==============================================================
99
+ // ======================= HOOKS ================================
100
+ // ==============================================================
101
+ /**
102
+ * Before init hook to be used in inherited classes
103
+ *
104
+ * @returns
105
+ */
106
+ onBeforeInit() {
107
+ return __awaiter(this, void 0, void 0, function* () {
108
+ return;
109
+ });
110
+ }
111
+ /**
112
+ * Main initialization method for the Container
113
+ */
114
+ onInit() {
115
+ return __awaiter(this, void 0, void 0, function* () {
116
+ return;
117
+ });
118
+ }
119
+ /**
120
+ * After init hook to be used in inherited classes
121
+ *
122
+ * @returns
123
+ */
124
+ onAfterInit() {
125
+ return __awaiter(this, void 0, void 0, function* () {
126
+ return;
127
+ });
18
128
  }
19
129
  }
20
130
  exports.A_Container = A_Container;