@adaas/a-concept 0.0.33 → 0.0.34

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 (365) hide show
  1. package/README.md +156 -8
  2. package/dist/index.d.ts +3 -1
  3. package/dist/index.js +6 -3
  4. package/dist/index.js.map +1 -1
  5. package/dist/src/base/A-Config/A-Config.container.d.ts +5 -2
  6. package/dist/src/base/A-Config/A-Config.container.js +7 -2
  7. package/dist/src/base/A-Config/A-Config.container.js.map +1 -1
  8. package/dist/src/base/A-Config/components/ConfigReader.component.js +1 -1
  9. package/dist/src/base/A-Config/components/ConfigReader.component.js.map +1 -1
  10. package/dist/src/base/A-Config/components/FileConfigReader.component.js.map +1 -1
  11. package/dist/src/base/A-Errors/A-Errors.context.js.map +1 -1
  12. package/dist/src/base/A-Logger/A-Logger.component.js.map +1 -1
  13. package/dist/src/decorators/A-Abstraction/{A-Abstraction.decorator.d.ts → A-Abstraction-Extend.decorator.d.ts} +1 -1
  14. package/dist/src/decorators/A-Abstraction/{A-Abstraction.decorator.js → A-Abstraction-Extend.decorator.js} +6 -6
  15. package/dist/src/decorators/A-Abstraction/A-Abstraction-Extend.decorator.js.map +1 -0
  16. package/dist/src/decorators/A-Abstraction/A-Abstraction.decorator.types.d.ts +1 -1
  17. package/dist/src/decorators/A-Connect/A-Connect.decorator.js.map +1 -1
  18. package/dist/src/decorators/A-Entity/A-Entity.decorator.types.d.ts +1 -1
  19. package/dist/src/decorators/A-Feature/A-Feature-Define.decorator.d.ts +3 -3
  20. package/dist/src/decorators/A-Feature/A-Feature-Define.decorator.js +20 -4
  21. package/dist/src/decorators/A-Feature/A-Feature-Define.decorator.js.map +1 -1
  22. package/dist/src/decorators/A-Feature/A-Feature.decorator.types.d.ts +3 -2
  23. package/dist/src/decorators/A-Inject/A-Inject.decorator.d.ts +1 -1
  24. package/dist/src/decorators/A-Inject/A-Inject.decorator.js +23 -2
  25. package/dist/src/decorators/A-Inject/A-Inject.decorator.js.map +1 -1
  26. package/dist/src/decorators/A-Inject/A-Inject.decorator.types.d.ts +3 -3
  27. package/dist/src/global/A-Abstraction/A-Abstraction.class.d.ts +40 -0
  28. package/dist/src/global/A-Abstraction/A-Abstraction.class.js +113 -0
  29. package/dist/src/global/A-Abstraction/A-Abstraction.class.js.map +1 -0
  30. package/dist/src/global/A-Abstraction/A-Abstraction.types.d.ts +13 -0
  31. package/dist/src/global/A-Abstraction/A-Abstraction.types.js +11 -0
  32. package/dist/src/global/A-Abstraction/A-Abstraction.types.js.map +1 -0
  33. package/dist/src/global/A-Channel/A-Channel.class.js +0 -1
  34. package/dist/src/global/A-Channel/A-Channel.class.js.map +1 -1
  35. package/dist/src/global/A-Channel/A-Channel.types.d.ts +2 -1
  36. package/dist/src/global/A-Component/A-Component.class.d.ts +5 -30
  37. package/dist/src/global/A-Component/A-Component.class.js +6 -10
  38. package/dist/src/global/A-Component/A-Component.class.js.map +1 -1
  39. package/dist/src/global/A-Component/A-Component.meta.d.ts +9 -2
  40. package/dist/src/global/A-Component/A-Component.meta.js +10 -1
  41. package/dist/src/global/A-Component/A-Component.meta.js.map +1 -1
  42. package/dist/src/global/A-Concept/A_Concept.class.d.ts +16 -17
  43. package/dist/src/global/A-Concept/A_Concept.class.js +31 -65
  44. package/dist/src/global/A-Concept/A_Concept.class.js.map +1 -1
  45. package/dist/src/global/A-Concept/A_Concept.meta.d.ts +10 -0
  46. package/dist/src/global/A-Concept/A_Concept.meta.js +20 -0
  47. package/dist/src/global/A-Concept/A_Concept.meta.js.map +1 -1
  48. package/dist/src/global/A-Concept/A_Concept.types.d.ts +2 -2
  49. package/dist/src/global/A-Container/A-Container.class.d.ts +7 -50
  50. package/dist/src/global/A-Container/A-Container.class.js +9 -19
  51. package/dist/src/global/A-Container/A-Container.class.js.map +1 -1
  52. package/dist/src/global/A-Container/A-Container.meta.d.ts +15 -0
  53. package/dist/src/global/A-Container/A-Container.meta.js +20 -0
  54. package/dist/src/global/A-Container/A-Container.meta.js.map +1 -1
  55. package/dist/src/global/A-Context/A-Context.class.d.ts +20 -20
  56. package/dist/src/global/A-Context/A-Context.class.js +57 -15
  57. package/dist/src/global/A-Context/A-Context.class.js.map +1 -1
  58. package/dist/src/global/A-Entity/A-Entity.class.d.ts +10 -18
  59. package/dist/src/global/A-Entity/A-Entity.class.js +21 -31
  60. package/dist/src/global/A-Entity/A-Entity.class.js.map +1 -1
  61. package/dist/src/global/A-Entity/A-Entity.meta.js.map +1 -1
  62. package/dist/src/global/A-Entity/A-Entity.types.d.ts +3 -2
  63. package/dist/src/global/A-Entity/A-Entity.types.js +1 -0
  64. package/dist/src/global/A-Entity/A-Entity.types.js.map +1 -1
  65. package/dist/src/global/A-Feature/A-Feature.class.d.ts +2 -1
  66. package/dist/src/global/A-Feature/A-Feature.class.js +14 -4
  67. package/dist/src/global/A-Feature/A-Feature.class.js.map +1 -1
  68. package/dist/src/global/A-Feature/A-Feature.types.d.ts +9 -0
  69. package/dist/src/global/A-Feature/A-Feature.types.js.map +1 -1
  70. package/dist/src/global/A-Meta/A-Meta.class.d.ts +1 -0
  71. package/dist/src/global/A-Meta/A-Meta.class.js +3 -6
  72. package/dist/src/global/A-Meta/A-Meta.class.js.map +1 -1
  73. package/dist/src/global/A-Scope/A-Scope.class.d.ts +4 -2
  74. package/dist/src/global/A-Scope/A-Scope.class.js +23 -16
  75. package/dist/src/global/A-Scope/A-Scope.class.js.map +1 -1
  76. package/dist/src/global/A-Scope/A-Scope.types.d.ts +0 -8
  77. package/dist/src/global/A-Stage/A-Stage.class.d.ts +3 -3
  78. package/dist/src/global/A-Stage/A-Stage.class.js +11 -10
  79. package/dist/src/global/A-Stage/A-Stage.class.js.map +1 -1
  80. package/dist/src/global/A-Stage/A-Stage.types.d.ts +1 -1
  81. package/dist/src/global/A-Stage/A-Stage.types.js.map +1 -1
  82. package/dist/src/helpers/StepsManager.class.d.ts +1 -0
  83. package/dist/src/helpers/StepsManager.class.js +10 -7
  84. package/dist/src/helpers/StepsManager.class.js.map +1 -1
  85. package/docs/a-concept-logo.png +0 -0
  86. package/docs/a-logo-docs.png +0 -0
  87. package/examples/fe-be/channels/Test.channel.ts +6 -3
  88. package/examples/simple/components/A.component.ts +7 -0
  89. package/examples/simple/components/B.component.ts +9 -0
  90. package/examples/simple/concept.ts +38 -60
  91. package/examples/simple/containers/Main.container.ts +24 -11
  92. package/examples/simple/entities/EntityA.entity.ts +3 -5
  93. package/examples/simple-http-server/components/http-request-handler.component.ts +6 -4
  94. package/examples/simple-http-server/concept.ts +24 -21
  95. package/examples/simple-http-server/containers/http-server.container.ts +4 -3
  96. package/index.ts +4 -1
  97. package/package.json +6 -2
  98. package/src/base/A-Config/A-Config.container.ts +12 -4
  99. package/src/base/A-Config/components/ConfigReader.component.ts +4 -5
  100. package/src/base/A-Config/components/FileConfigReader.component.ts +0 -2
  101. package/src/base/A-Errors/A-Error.entity.ts +1 -1
  102. package/src/base/A-Errors/A-Errors.context.ts +2 -1
  103. package/src/base/A-Logger/A-Logger.component.ts +0 -1
  104. package/src/decorators/A-Abstraction/{A-Abstraction.decorator.ts → A-Abstraction-Extend.decorator.ts} +5 -6
  105. package/src/decorators/A-Abstraction/A-Abstraction.decorator.types.ts +1 -1
  106. package/src/decorators/A-Connect/A-Connect.decorator.ts +1 -1
  107. package/src/decorators/A-Entity/A-Entity.decorator.types.ts +1 -1
  108. package/src/decorators/A-Feature/A-Feature-Define.decorator.ts +37 -10
  109. package/src/decorators/A-Feature/A-Feature.decorator.types.ts +12 -12
  110. package/src/decorators/A-Inject/A-Inject.decorator.ts +31 -4
  111. package/src/decorators/A-Inject/A-Inject.decorator.types.ts +4 -3
  112. package/src/global/A-Abstraction/A-Abstraction.class.ts +130 -0
  113. package/src/global/A-Abstraction/A-Abstraction.types.ts +22 -0
  114. package/src/global/A-Channel/A-Channel.class.ts +0 -2
  115. package/src/global/A-Channel/A-Channel.types.ts +2 -1
  116. package/src/global/A-Component/A-Component.class.ts +12 -52
  117. package/src/global/A-Component/A-Component.meta.ts +19 -2
  118. package/src/global/A-Concept/A_Concept.class.ts +45 -126
  119. package/src/global/A-Concept/A_Concept.meta.ts +68 -0
  120. package/src/global/A-Concept/A_Concept.types.ts +2 -2
  121. package/src/global/A-Container/A-Container.class.ts +11 -90
  122. package/src/global/A-Container/A-Container.meta.ts +33 -0
  123. package/src/global/A-Context/A-Context.class.ts +134 -56
  124. package/src/global/A-Entity/A-Entity.class.ts +22 -69
  125. package/src/global/A-Entity/A-Entity.meta.ts +3 -2
  126. package/src/global/A-Entity/A-Entity.types.ts +2 -1
  127. package/src/global/A-Feature/A-Feature.class.ts +18 -7
  128. package/src/global/A-Feature/A-Feature.types.ts +10 -2
  129. package/src/global/A-Meta/A-Meta.class.ts +5 -8
  130. package/src/global/A-Scope/A-Scope.class.ts +38 -21
  131. package/src/global/A-Scope/A-Scope.types.ts +2 -2
  132. package/src/global/A-Stage/A-Stage.class.ts +20 -20
  133. package/src/global/A-Stage/A-Stage.types.ts +2 -3
  134. package/src/helpers/StepsManager.class.ts +11 -7
  135. package/trace-require.js +46 -0
  136. package/tsconfig.build.json +57 -0
  137. package/dist/examples/fe-be/channels/Test.channel.d.ts +0 -6
  138. package/dist/examples/fe-be/channels/Test.channel.js +0 -14
  139. package/dist/examples/fe-be/channels/Test.channel.js.map +0 -1
  140. package/dist/examples/fe-be/components/BE-Controller.component.d.ts +0 -4
  141. package/dist/examples/fe-be/components/BE-Controller.component.js +0 -24
  142. package/dist/examples/fe-be/components/BE-Controller.component.js.map +0 -1
  143. package/dist/examples/fe-be/components/FE.component.d.ts +0 -4
  144. package/dist/examples/fe-be/components/FE.component.js +0 -31
  145. package/dist/examples/fe-be/components/FE.component.js.map +0 -1
  146. package/dist/examples/fe-be/components/UserActions.component.d.ts +0 -5
  147. package/dist/examples/fe-be/components/UserActions.component.js +0 -25
  148. package/dist/examples/fe-be/components/UserActions.component.js.map +0 -1
  149. package/dist/examples/fe-be/concept.d.ts +0 -0
  150. package/dist/examples/fe-be/concept.js +0 -2
  151. package/dist/examples/fe-be/concept.js.map +0 -1
  152. package/dist/examples/fe-be/containers/ServerApp.container.d.ts +0 -3
  153. package/dist/examples/fe-be/containers/ServerApp.container.js +0 -8
  154. package/dist/examples/fe-be/containers/ServerApp.container.js.map +0 -1
  155. package/dist/examples/fe-be/containers/WebApp.container.d.ts +0 -3
  156. package/dist/examples/fe-be/containers/WebApp.container.js +0 -8
  157. package/dist/examples/fe-be/containers/WebApp.container.js.map +0 -1
  158. package/dist/examples/multi-container/channels/Direct.channel.d.ts +0 -9
  159. package/dist/examples/multi-container/channels/Direct.channel.js +0 -32
  160. package/dist/examples/multi-container/channels/Direct.channel.js.map +0 -1
  161. package/dist/examples/multi-container/concept.d.ts +0 -0
  162. package/dist/examples/multi-container/concept.js +0 -2
  163. package/dist/examples/multi-container/concept.js.map +0 -1
  164. package/dist/examples/multi-container/containers/Command.container.d.ts +0 -11
  165. package/dist/examples/multi-container/containers/Command.container.js +0 -51
  166. package/dist/examples/multi-container/containers/Command.container.js.map +0 -1
  167. package/dist/examples/multi-container/containers/Schedule.container.d.ts +0 -15
  168. package/dist/examples/multi-container/containers/Schedule.container.js +0 -67
  169. package/dist/examples/multi-container/containers/Schedule.container.js.map +0 -1
  170. package/dist/examples/sdk/concept.d.ts +0 -0
  171. package/dist/examples/sdk/concept.js +0 -21
  172. package/dist/examples/sdk/concept.js.map +0 -1
  173. package/dist/examples/sdk/orders.api.d.ts +0 -0
  174. package/dist/examples/sdk/orders.api.js +0 -16
  175. package/dist/examples/sdk/orders.api.js.map +0 -1
  176. package/dist/examples/sdk/users.api.d.ts +0 -0
  177. package/dist/examples/sdk/users.api.js +0 -16
  178. package/dist/examples/sdk/users.api.js.map +0 -1
  179. package/dist/examples/simple/components/A.component.d.ts +0 -9
  180. package/dist/examples/simple/components/A.component.js +0 -60
  181. package/dist/examples/simple/components/A.component.js.map +0 -1
  182. package/dist/examples/simple/components/B.component.d.ts +0 -13
  183. package/dist/examples/simple/components/B.component.js +0 -88
  184. package/dist/examples/simple/components/B.component.js.map +0 -1
  185. package/dist/examples/simple/concept.d.ts +0 -1
  186. package/dist/examples/simple/concept.js +0 -82
  187. package/dist/examples/simple/concept.js.map +0 -1
  188. package/dist/examples/simple/containers/Main.container.d.ts +0 -11
  189. package/dist/examples/simple/containers/Main.container.js +0 -86
  190. package/dist/examples/simple/containers/Main.container.js.map +0 -1
  191. package/dist/examples/simple/context/Fragment_A.context.d.ts +0 -6
  192. package/dist/examples/simple/context/Fragment_A.context.js +0 -16
  193. package/dist/examples/simple/context/Fragment_A.context.js.map +0 -1
  194. package/dist/examples/simple/context/Fragment_B.context.d.ts +0 -6
  195. package/dist/examples/simple/context/Fragment_B.context.js +0 -16
  196. package/dist/examples/simple/context/Fragment_B.context.js.map +0 -1
  197. package/dist/examples/simple/entities/EntityA.entity.d.ts +0 -8
  198. package/dist/examples/simple/entities/EntityA.entity.js +0 -22
  199. package/dist/examples/simple/entities/EntityA.entity.js.map +0 -1
  200. package/dist/examples/simple-http-server/components/http-error-handler.component.d.ts +0 -10
  201. package/dist/examples/simple-http-server/components/http-error-handler.component.js +0 -65
  202. package/dist/examples/simple-http-server/components/http-error-handler.component.js.map +0 -1
  203. package/dist/examples/simple-http-server/components/http-request-handler.component.d.ts +0 -3
  204. package/dist/examples/simple-http-server/components/http-request-handler.component.js +0 -8
  205. package/dist/examples/simple-http-server/components/http-request-handler.component.js.map +0 -1
  206. package/dist/examples/simple-http-server/concept.d.ts +0 -1
  207. package/dist/examples/simple-http-server/concept.js +0 -35
  208. package/dist/examples/simple-http-server/concept.js.map +0 -1
  209. package/dist/examples/simple-http-server/containers/http-server.container.d.ts +0 -11
  210. package/dist/examples/simple-http-server/containers/http-server.container.js +0 -73
  211. package/dist/examples/simple-http-server/containers/http-server.container.js.map +0 -1
  212. package/dist/examples/simple-http-server/containers/http-server.controller.d.ts +0 -7
  213. package/dist/examples/simple-http-server/containers/http-server.controller.js +0 -37
  214. package/dist/examples/simple-http-server/containers/http-server.controller.js.map +0 -1
  215. package/dist/examples/simple-http-server/containers/http-server.router.d.ts +0 -6
  216. package/dist/examples/simple-http-server/containers/http-server.router.js +0 -39
  217. package/dist/examples/simple-http-server/containers/http-server.router.js.map +0 -1
  218. package/dist/examples/simple-http-server/contexts/http-request.context.d.ts +0 -12
  219. package/dist/examples/simple-http-server/contexts/http-request.context.js +0 -49
  220. package/dist/examples/simple-http-server/contexts/http-request.context.js.map +0 -1
  221. package/dist/examples/simple-http-server/contexts/http-server.context.types.d.ts +0 -0
  222. package/dist/examples/simple-http-server/contexts/http-server.context.types.js +0 -2
  223. package/dist/examples/simple-http-server/contexts/http-server.context.types.js.map +0 -1
  224. package/dist/examples/simple-http-server/contexts/http-server.namespace.d.ts +0 -10
  225. package/dist/examples/simple-http-server/contexts/http-server.namespace.js +0 -26
  226. package/dist/examples/simple-http-server/contexts/http-server.namespace.js.map +0 -1
  227. package/dist/examples/simple-http-server/controllers/orders.controller.d.ts +0 -5
  228. package/dist/examples/simple-http-server/controllers/orders.controller.js +0 -32
  229. package/dist/examples/simple-http-server/controllers/orders.controller.js.map +0 -1
  230. package/dist/examples/simple-http-server/controllers/users.controller.d.ts +0 -0
  231. package/dist/examples/simple-http-server/controllers/users.controller.js +0 -87
  232. package/dist/examples/simple-http-server/controllers/users.controller.js.map +0 -1
  233. package/dist/examples/simple-http-server/modules/simple-http-server.context.d.ts +0 -5
  234. package/dist/examples/simple-http-server/modules/simple-http-server.context.js +0 -25
  235. package/dist/examples/simple-http-server/modules/simple-http-server.context.js.map +0 -1
  236. package/dist/examples/simple-http-server/modules/simple-http-server.module.d.ts +0 -16
  237. package/dist/examples/simple-http-server/modules/simple-http-server.module.js +0 -8
  238. package/dist/examples/simple-http-server/modules/simple-http-server.module.js.map +0 -1
  239. package/dist/examples/simple-http-server/modules/simple-http-server.types.d.ts +0 -2
  240. package/dist/examples/simple-http-server/modules/simple-http-server.types.js +0 -3
  241. package/dist/examples/simple-http-server/modules/simple-http-server.types.js.map +0 -1
  242. package/dist/examples/simple-http-server/test.d.ts +0 -68
  243. package/dist/examples/simple-http-server/test.js +0 -162
  244. package/dist/examples/simple-http-server/test.js.map +0 -1
  245. package/dist/src/containers/A-Config/A-Config.container.d.ts +0 -7
  246. package/dist/src/containers/A-Config/A-Config.container.js +0 -65
  247. package/dist/src/containers/A-Config/A-Config.container.js.map +0 -1
  248. package/dist/src/containers/A-Config/A-Config.namespace.d.ts +0 -28
  249. package/dist/src/containers/A-Config/A-Config.namespace.js +0 -54
  250. package/dist/src/containers/A-Config/A-Config.namespace.js.map +0 -1
  251. package/dist/src/containers/A-Config/A-Config.types.d.ts +0 -12
  252. package/dist/src/containers/A-Config/A-Config.types.js +0 -3
  253. package/dist/src/containers/A-Config/A-Config.types.js.map +0 -1
  254. package/dist/src/containers/A-Config/components/ConfigReader.component.d.ts +0 -18
  255. package/dist/src/containers/A-Config/components/ConfigReader.component.js +0 -37
  256. package/dist/src/containers/A-Config/components/ConfigReader.component.js.map +0 -1
  257. package/dist/src/containers/A-Config/components/ENVConfigReader.component.d.ts +0 -10
  258. package/dist/src/containers/A-Config/components/ENVConfigReader.component.js +0 -37
  259. package/dist/src/containers/A-Config/components/ENVConfigReader.component.js.map +0 -1
  260. package/dist/src/containers/A-Config/components/FileConfigReader.component.d.ts +0 -11
  261. package/dist/src/containers/A-Config/components/FileConfigReader.component.js +0 -47
  262. package/dist/src/containers/A-Config/components/FileConfigReader.component.js.map +0 -1
  263. package/dist/src/containers/A-Errors/A-Errors.container.d.ts +0 -5
  264. package/dist/src/containers/A-Errors/A-Errors.container.js +0 -32
  265. package/dist/src/containers/A-Errors/A-Errors.container.js.map +0 -1
  266. package/dist/src/containers/A-Errors/A-Errors.namespace.d.ts +0 -40
  267. package/dist/src/containers/A-Errors/A-Errors.namespace.js +0 -76
  268. package/dist/src/containers/A-Errors/A-Errors.namespace.js.map +0 -1
  269. package/dist/src/containers/A-Errors/A-Errors.types.d.ts +0 -5
  270. package/dist/src/containers/A-Errors/A-Errors.types.js +0 -3
  271. package/dist/src/containers/A-Errors/A-Errors.types.js.map +0 -1
  272. package/dist/src/containers/A-Logger/A-Logger.container.d.ts +0 -6
  273. package/dist/src/containers/A-Logger/A-Logger.container.js +0 -41
  274. package/dist/src/containers/A-Logger/A-Logger.container.js.map +0 -1
  275. package/dist/src/containers/A-Logger/A-Logger.namespace.d.ts +0 -17
  276. package/dist/src/containers/A-Logger/A-Logger.namespace.js +0 -22
  277. package/dist/src/containers/A-Logger/A-Logger.namespace.js.map +0 -1
  278. package/dist/src/containers/A-Logger/A-Logger.types.d.ts +0 -0
  279. package/dist/src/containers/A-Logger/A-Logger.types.js +0 -2
  280. package/dist/src/containers/A-Logger/A-Logger.types.js.map +0 -1
  281. package/dist/src/containers/A-Logger/components/Logger.component.d.ts +0 -29
  282. package/dist/src/containers/A-Logger/components/Logger.component.js +0 -128
  283. package/dist/src/containers/A-Logger/components/Logger.component.js.map +0 -1
  284. package/dist/src/decorators/A-Abstraction/A-Abstraction.decorator.js.map +0 -1
  285. package/dist/src/decorators/A-ConceptLifecycle/A-ConceptLifecycle.decorator.types.d.ts +0 -34
  286. package/dist/src/decorators/A-ConceptLifecycle/A-ConceptLifecycle.decorator.types.js +0 -3
  287. package/dist/src/decorators/A-ConceptLifecycle/A-ConceptLifecycle.decorator.types.js.map +0 -1
  288. package/dist/src/decorators/A-ConceptLifecycle/A-Load/A-Load.decorator.d.ts +0 -11
  289. package/dist/src/decorators/A-ConceptLifecycle/A-Load/A-Load.decorator.js +0 -36
  290. package/dist/src/decorators/A-ConceptLifecycle/A-Load/A-Load.decorator.js.map +0 -1
  291. package/dist/src/decorators/A-ConceptLifecycle/A-Load/A-Load.decorator.types.d.ts +0 -7
  292. package/dist/src/decorators/A-ConceptLifecycle/A-Load/A-Load.decorator.types.js +0 -3
  293. package/dist/src/decorators/A-ConceptLifecycle/A-Load/A-Load.decorator.types.js.map +0 -1
  294. package/dist/src/decorators/A-ConceptLifecycle/A-Run/A-Run.decorator.d.ts +0 -17
  295. package/dist/src/decorators/A-ConceptLifecycle/A-Run/A-Run.decorator.js +0 -42
  296. package/dist/src/decorators/A-ConceptLifecycle/A-Run/A-Run.decorator.js.map +0 -1
  297. package/dist/src/decorators/A-ConceptLifecycle/A-Run/A-Run.decorator.types.d.ts +0 -8
  298. package/dist/src/decorators/A-ConceptLifecycle/A-Run/A-Run.decorator.types.js +0 -3
  299. package/dist/src/decorators/A-ConceptLifecycle/A-Run/A-Run.decorator.types.js.map +0 -1
  300. package/dist/src/decorators/A-ConceptLifecycle/index.d.ts +0 -7
  301. package/dist/src/decorators/A-ConceptLifecycle/index.js +0 -11
  302. package/dist/src/decorators/A-ConceptLifecycle/index.js.map +0 -1
  303. package/dist/src/decorators/A-Define/Feature/Feature.decorator.d.ts +0 -16
  304. package/dist/src/decorators/A-Define/Feature/Feature.decorator.js +0 -36
  305. package/dist/src/decorators/A-Define/Feature/Feature.decorator.js.map +0 -1
  306. package/dist/src/decorators/A-Define/Feature/Feature.decorator.types.d.ts +0 -8
  307. package/dist/src/decorators/A-Define/Feature/Feature.decorator.types.js +0 -3
  308. package/dist/src/decorators/A-Define/Feature/Feature.decorator.types.js.map +0 -1
  309. package/dist/src/decorators/A-Define/Lifecycle/Lifecycle.decorator.d.ts +0 -14
  310. package/dist/src/decorators/A-Define/Lifecycle/Lifecycle.decorator.js +0 -24
  311. package/dist/src/decorators/A-Define/Lifecycle/Lifecycle.decorator.js.map +0 -1
  312. package/dist/src/decorators/A-Define/Lifecycle/Lifecycle.decorator.types.d.ts +0 -8
  313. package/dist/src/decorators/A-Define/Lifecycle/Lifecycle.decorator.types.js +0 -3
  314. package/dist/src/decorators/A-Define/Lifecycle/Lifecycle.decorator.types.js.map +0 -1
  315. package/dist/src/decorators/A-Define/index.d.ts +0 -7
  316. package/dist/src/decorators/A-Define/index.js +0 -10
  317. package/dist/src/decorators/A-Define/index.js.map +0 -1
  318. package/dist/src/decorators/A-Extend/A-Extend.decorator.d.ts +0 -18
  319. package/dist/src/decorators/A-Extend/A-Extend.decorator.js +0 -37
  320. package/dist/src/decorators/A-Extend/A-Extend.decorator.js.map +0 -1
  321. package/dist/src/decorators/A-Extend/A-Extend.decorator.types.d.ts +0 -21
  322. package/dist/src/decorators/A-Extend/A-Extend.decorator.types.js +0 -3
  323. package/dist/src/decorators/A-Extend/A-Extend.decorator.types.js.map +0 -1
  324. package/dist/src/decorators/A-Feature/A-Feature.decorator.d.ts +0 -0
  325. package/dist/src/decorators/A-Feature/A-Feature.decorator.js +0 -11
  326. package/dist/src/decorators/A-Feature/A-Feature.decorator.js.map +0 -1
  327. package/dist/src/decorators/A-Stage/A-Stage.decorator.d.ts +0 -13
  328. package/dist/src/decorators/A-Stage/A-Stage.decorator.js +0 -52
  329. package/dist/src/decorators/A-Stage/A-Stage.decorator.js.map +0 -1
  330. package/dist/src/decorators/A-Stage/A-Stage.decorator.types.d.ts +0 -2
  331. package/dist/src/decorators/A-Stage/A-Stage.decorator.types.js +0 -3
  332. package/dist/src/decorators/A-Stage/A-Stage.decorator.types.js.map +0 -1
  333. package/dist/src/decorators/A_ConceptMethods.decorator.d.ts +0 -0
  334. package/dist/src/decorators/A_ConceptMethods.decorator.js +0 -2
  335. package/dist/src/decorators/A_ConceptMethods.decorator.js.map +0 -1
  336. package/dist/src/decorators/A_Lazy.decorator.d.ts +0 -5
  337. package/dist/src/decorators/A_Lazy.decorator.js +0 -20
  338. package/dist/src/decorators/A_Lazy.decorator.js.map +0 -1
  339. package/dist/src/global/A-Context/A-ContextFragment.class.d.ts +0 -12
  340. package/dist/src/global/A-Context/A-ContextFragment.class.js +0 -19
  341. package/dist/src/global/A-Context/A-ContextFragment.class.js.map +0 -1
  342. package/dist/src/global/A-Namespace/A_Namespace.class.d.ts +0 -47
  343. package/dist/src/global/A-Namespace/A_Namespace.class.js +0 -112
  344. package/dist/src/global/A-Namespace/A_Namespace.class.js.map +0 -1
  345. package/dist/src/global/A-Namespace/A_Namespace.types.d.ts +0 -19
  346. package/dist/src/global/A-Namespace/A_Namespace.types.js +0 -3
  347. package/dist/src/global/A-Namespace/A_Namespace.types.js.map +0 -1
  348. package/dist/src/managers/A_DependencyManager.class.d.ts +0 -24
  349. package/dist/src/managers/A_DependencyManager.class.js +0 -129
  350. package/dist/src/managers/A_DependencyManager.class.js.map +0 -1
  351. package/dist/src/storage/A_Component.storage.d.ts +0 -10
  352. package/dist/src/storage/A_Component.storage.js +0 -17
  353. package/dist/src/storage/A_Component.storage.js.map +0 -1
  354. package/dist/src/storage/A_Concept.storage.d.ts +0 -19
  355. package/dist/src/storage/A_Concept.storage.js +0 -29
  356. package/dist/src/storage/A_Concept.storage.js.map +0 -1
  357. package/dist/src/storage/A_Container.storage.d.ts +0 -8
  358. package/dist/src/storage/A_Container.storage.js +0 -17
  359. package/dist/src/storage/A_Container.storage.js.map +0 -1
  360. package/dist/src/storage/A_Inject.storage.d.ts +0 -9
  361. package/dist/src/storage/A_Inject.storage.js +0 -13
  362. package/dist/src/storage/A_Inject.storage.js.map +0 -1
  363. package/dist/src/types/A_DependencyManager.types.d.ts +0 -15
  364. package/dist/src/types/A_DependencyManager.types.js +0 -3
  365. package/dist/src/types/A_DependencyManager.types.js.map +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adaas/a-concept",
3
- "version": "0.0.33",
3
+ "version": "0.0.34",
4
4
  "description": "A-Concept is a framework to build new Applications within or outside the ADAAS ecosystem. This framework is designed to be modular structure regardless environment and program goal.",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
@@ -22,12 +22,16 @@
22
22
  "scripts": {
23
23
  "test": "jest",
24
24
  "start": "nodemon ./tests/log.ts",
25
+ "example:simple": "nodemon ./examples/simple/concept.ts",
26
+ "example:simple:trace": "node -r tsconfig-paths/register -r ts-node/register -r ./trace-require.js ./examples/simple/concept.ts",
27
+ "example:http": "nodemon ./examples/simple-http-server/concept.ts",
28
+ "example:http:trace": "node -r tsconfig-paths/register -r ts-node/register -r ./trace-require.js ./examples/simple-http-server/concept.ts",
25
29
  "publish": "npm run build && git add . && git commit -m \"new version created :: $(cat package.json | grep version | head -1 | awk -F: '{ print $2 }' | sed 's/[\",]//g')\" && npm version patch && npm publish --access public",
26
30
  "preversion": "echo test",
27
31
  "version": "echo git add .",
28
32
  "postversion": "git push --no-verify && git push --tags --no-verify && echo \"\n======Version Pushed Successfully=====\n\" ",
29
33
  "echo-version": "echo $npm_package_version",
30
- "build": "tsc --declaration --project tsconfig.json && tscpaths -p tsconfig.json -s ./ -o ./dist && rm -r ./dist/tests",
34
+ "build": "rm -rf ./dist && tsc --declaration --project tsconfig.build.json && tscpaths -p tsconfig.build.json -s ./ -o ./dist",
31
35
  "test:simple": "nodemon ./examples/simple/concept.ts"
32
36
  },
33
37
  "repository": {
@@ -1,6 +1,5 @@
1
1
  import { A_Container } from "@adaas/a-concept/global/A-Container/A-Container.class";
2
2
  import { ConfigReader } from "./components/ConfigReader.component";
3
- import { A_Logger } from "../A-Logger/A-Logger.component";
4
3
  import { A_Inject } from "@adaas/a-concept/decorators/A-Inject/A-Inject.decorator";
5
4
  import { A_Polyfills } from "@adaas/a-utils";
6
5
  import { A_Context } from "@adaas/a-concept/global/A-Context/A-Context.class";
@@ -9,14 +8,20 @@ import { ENVConfigReader } from "./components/ENVConfigReader.component";
9
8
  import { A_Scope } from "@adaas/a-concept/global/A-Scope/A-Scope.class";
10
9
  import { A_Concept } from "@adaas/a-concept/global/A-Concept/A_Concept.class";
11
10
  import { A_Config } from "./A-Config.context";
11
+ import { A_TYPES__ContainerConstructor } from "@adaas/a-concept/global/A-Container/A-Container.types";
12
12
 
13
13
 
14
+ export class A_ConfigLoader extends A_Container {
14
15
 
16
+ private reader!: ConfigReader
15
17
 
16
18
 
17
- export class A_ConfigLoader extends A_Container<['load', 'read']> {
18
-
19
- private reader!: ConfigReader
19
+ constructor(params:Partial<A_TYPES__ContainerConstructor<['load', 'read']>>) {
20
+ super({
21
+ ...params,
22
+ name:params.name || 'a-config-loader'
23
+ });
24
+ }
20
25
 
21
26
 
22
27
  @A_Concept.Load()
@@ -50,6 +55,7 @@ export class A_ConfigLoader extends A_Container<['load', 'read']> {
50
55
  @A_Concept.Load()
51
56
  async readVariables(
52
57
  @A_Inject(A_Config) config: A_Config,
58
+ @A_Inject(A_Scope) scope: A_Scope,
53
59
  ) {
54
60
  await this.reader.inject(config);
55
61
  }
@@ -58,4 +64,6 @@ export class A_ConfigLoader extends A_Container<['load', 'read']> {
58
64
 
59
65
 
60
66
 
67
+
68
+
61
69
  const foo = new A_ConfigLoader({});
@@ -1,11 +1,9 @@
1
+ import { A_Context } from "@adaas/a-concept/global/A-Context/A-Context.class";
1
2
  import { A_Scope } from "@adaas/a-concept/global/A-Scope/A-Scope.class";
2
3
  import { A_Inject } from "@adaas/a-concept/decorators/A-Inject/A-Inject.decorator";
3
4
  import { A_Component } from "@adaas/a-concept/global/A-Component/A-Component.class";
4
- import { A_Polyfills } from "@adaas/a-utils";
5
- import { A_Concept } from "@adaas/a-concept/global/A-Concept/A_Concept.class";
6
5
  import { A_Config } from "../A-Config.context";
7
-
8
-
6
+ import { A_Concept } from "@adaas/a-concept/global/A-Concept/A_Concept.class";
9
7
 
10
8
  /**
11
9
  * Config Reader
@@ -21,8 +19,9 @@ export class ConfigReader extends A_Component {
21
19
 
22
20
  @A_Concept.Load()
23
21
  async inject(
24
- @A_Inject(A_Config) config: A_Config
22
+ @A_Inject(A_Config) config: A_Config,
25
23
  ) {
24
+
26
25
  const data = this.read(config.CONFIG_PROPERTIES);
27
26
 
28
27
  config.set(data);
@@ -1,8 +1,6 @@
1
1
  import { A_CommonHelper, A_Polyfills } from "@adaas/a-utils";
2
2
  import { ConfigReader } from "./ConfigReader.component";
3
3
 
4
-
5
-
6
4
  export class FileConfigReader extends ConfigReader {
7
5
 
8
6
  private FileData: Map<string, any> = new Map<string, any>();
@@ -5,6 +5,6 @@ import { A_Entity } from "@adaas/a-concept/global/A-Entity/A-Entity.class";
5
5
  export class A_Error extends A_Entity {
6
6
 
7
7
 
8
-
8
+
9
9
 
10
10
  }
@@ -8,6 +8,8 @@ export class A_Errors extends A_Fragment {
8
8
 
9
9
  protected registeredErrors: Map<string, A_TYPES__Error | A_TYPES__ServerError> = new Map();
10
10
 
11
+
12
+
11
13
  constructor(
12
14
  params: Partial<A_TYPES__A_ErrorsConstructor>
13
15
  ) {
@@ -76,7 +78,6 @@ export class A_Errors extends A_Fragment {
76
78
  *
77
79
  * This method throws an error by its code.
78
80
  *
79
- * @param code
80
81
  */
81
82
  // throw(code: A_CONSTANTS__ERROR_CODES | string): never {
82
83
  // const template = this.get(code);
@@ -5,7 +5,6 @@ import { A_Scope } from "@adaas/a-concept/global/A-Scope/A-Scope.class";
5
5
  import { A_Component } from "@adaas/a-concept/global/A-Component/A-Component.class";
6
6
 
7
7
 
8
-
9
8
  export class A_Logger extends A_Component {
10
9
 
11
10
  constructor(
@@ -12,7 +12,6 @@ import { A_ComponentMeta } from "@adaas/a-concept/global/A-Component/A-Component
12
12
  import { A_Meta } from "@adaas/a-concept/global/A-Meta/A-Meta.class";
13
13
  import { A_TYPES__A_ExtendDecoratorConfig } from "../A-Feature/A-Feature.decorator.types";
14
14
 
15
-
16
15
  /**
17
16
  * A_Stage Decorator uses to extend basic A-Concept Stage methods inside Containers.
18
17
  *
@@ -21,12 +20,12 @@ import { A_TYPES__A_ExtendDecoratorConfig } from "../A-Feature/A-Feature.decorat
21
20
  * @param params
22
21
  * @returns
23
22
  */
24
- export function A_Abstraction(
23
+ export function A_Abstraction_Extend(
25
24
  method: A_TYPES__ConceptStage,
26
25
  config: Partial<A_TYPES__A_ExtendDecoratorConfig> = {}
27
26
  ) {
28
27
  return function (
29
- target: A_Container<any> | A_Component,
28
+ target: A_Container | A_Component,
30
29
  propertyKey: string,
31
30
  descriptor: A_TYPES__A_AbstractionDecoratorDescriptor
32
31
  ) {
@@ -35,7 +34,7 @@ export function A_Abstraction(
35
34
 
36
35
  let metaKey;
37
36
 
38
- const StageKey = `CONCEPT_ABSTRACTION::${method}`;
37
+ const abstractionKey = `${method}`;
39
38
 
40
39
  switch (true) {
41
40
  case target instanceof A_Container:
@@ -54,7 +53,7 @@ export function A_Abstraction(
54
53
  }> = meta.get(metaKey) || new A_Meta();
55
54
 
56
55
  // Set the metadata of the method to define a custom Stage with name
57
- const existedMetaValue = existedMeta.get(StageKey) || [];
56
+ const existedMetaValue = existedMeta.get(abstractionKey) || [];
58
57
 
59
58
 
60
59
  // Add the new method to the metadata
@@ -67,7 +66,7 @@ export function A_Abstraction(
67
66
  });
68
67
 
69
68
  // Set the metadata of the method to define a custom Feature with name
70
- existedMeta.set(StageKey, existedMetaValue);
69
+ existedMeta.set(abstractionKey, existedMetaValue);
71
70
 
72
71
 
73
72
  // Update the metadata of the container with the new Stage definition
@@ -14,7 +14,7 @@ export type A_TYPES__A_AbstractionDecoratorDescriptor =
14
14
  TypedPropertyDescriptor<() => Promise<any>>
15
15
 
16
16
 
17
- export type A_TYPES__A_StageDecoratorConfig = {
17
+ export type A_TYPES__A_AbstractionDecoratorConfig = {
18
18
  }
19
19
 
20
20
 
@@ -31,7 +31,7 @@ export function A_Connect(
31
31
  config?: any | string
32
32
  ) {
33
33
  return function (
34
- target: A_Container<any> | A_Component,
34
+ target: A_Container | A_Component,
35
35
  methodName: string | symbol | undefined,
36
36
  parameterIndex: number
37
37
  ) {
@@ -6,7 +6,7 @@ import { ASEID } from "@adaas/a-utils"
6
6
  export type A_TYPES__EntityListDecoratorQuery = {
7
7
  aseid: string | ASEID,
8
8
  id: string,
9
- type: { new(...args: any[]): A_Entity<any, any, any> },
9
+ type: { new(...args: any[]): A_Entity },
10
10
  entity: string
11
11
  }
12
12
 
@@ -1,21 +1,20 @@
1
- import { A_Component } from "@adaas/a-concept/global/A-Component/A-Component.class";
2
1
  import {
3
2
  A_TYPES__A_DefineDecorator_Meta,
4
3
  A_TYPES__A_FeatureDecoratorConfig,
5
4
  A_TYPES__A_FeatureDecoratorDescriptor,
6
5
  } from "./A-Feature.decorator.types";
7
- import { A_Container } from "@adaas/a-concept/global/A-Container/A-Container.class";
8
- import { A_TYPES__ContainerMeta_FeatureItem, A_TYPES__ContainerMetaKey } from "@adaas/a-concept/global/A-Container/A-Container.types";
6
+ import { A_Entity } from "@adaas/a-concept/global/A-Entity/A-Entity.class";
9
7
  import { A_Context } from "@adaas/a-concept/global/A-Context/A-Context.class";
8
+ import { A_Component } from "@adaas/a-concept/global/A-Component/A-Component.class";
9
+ import { A_Container } from "@adaas/a-concept/global/A-Container/A-Container.class";
10
+ import { A_TYPES__ContainerMetaKey } from "@adaas/a-concept/global/A-Container/A-Container.types";
10
11
  import { A_EntityMeta } from "@adaas/a-concept/global/A-Entity/A-Entity.meta";
11
12
  import { A_ContainerMeta } from "@adaas/a-concept/global/A-Container/A-Container.meta";
12
13
  import { A_ComponentMeta } from "@adaas/a-concept/global/A-Component/A-Component.meta";
13
14
  import { A_TYPES__EntityMetaKey } from "@adaas/a-concept/global/A-Entity/A-Entity.types";
14
15
  import { A_TYPES__ComponentMetaKey } from "@adaas/a-concept/global/A-Component/A-Component.types";
15
- import { A_Entity } from "@adaas/a-concept/global/A-Entity/A-Entity.class";
16
16
  import { A_Meta } from "@adaas/a-concept/global/A-Meta/A-Meta.class";
17
17
 
18
-
19
18
  /**
20
19
  * A-Feature decorator
21
20
  *
@@ -33,12 +32,12 @@ export function A_Feature_Define(
33
32
  config: Partial<A_TYPES__A_FeatureDecoratorConfig> = {}
34
33
  ) {
35
34
  return function (
36
- target: A_Container<any> | A_Entity | A_Component,
35
+ target: A_Container | A_Entity | A_Component,
37
36
  propertyKey: string,
38
37
  descriptor: A_TYPES__A_FeatureDecoratorDescriptor
39
38
  ) {
40
39
 
41
- const meta: A_EntityMeta | A_ContainerMeta | A_ComponentMeta = A_Context.meta(target.constructor);
40
+ const meta: A_EntityMeta | A_ContainerMeta | A_ComponentMeta = A_Context.meta(target.constructor as any);
42
41
 
43
42
  let metaKey;
44
43
 
@@ -69,10 +68,15 @@ export function A_Feature_Define(
69
68
  }> = meta.get(metaKey) || new A_Meta();
70
69
 
71
70
 
71
+
72
+ const handlerName = config.name || propertyKey;
73
+ const invoke = config.invoke !== false;
74
+
75
+
72
76
  // Set the metadata of the method to define a custom Feature with name
73
77
  existedMeta.set(propertyKey, {
74
- name: `${target.constructor.name}.${propertyKey || config.name}`,
75
- handler: propertyKey,
78
+ name: `${target.constructor.name}.${handlerName}`,
79
+ handler: handlerName,
76
80
  template: config.template && config.template.length ? config.template.map(
77
81
  item => ({
78
82
  ...item,
@@ -86,10 +90,33 @@ export function A_Feature_Define(
86
90
 
87
91
  // Update the metadata of the container with the new Feature definition
88
92
  A_Context
89
- .meta(target.constructor)
93
+ .meta(target.constructor as any)
90
94
  .set(
91
95
  metaKey,
92
96
  existedMeta
93
97
  );
98
+
99
+
100
+ const originalMethod = descriptor.value!;
101
+
102
+
103
+
104
+ // Wrap the original method to add the call to `call`
105
+ // this helps to automatically call the container/entity/component method when it's called
106
+ descriptor.value = function (...args: any[]) {
107
+
108
+ // Call the original method
109
+ if (!invoke)
110
+ return originalMethod.apply(this, args);
111
+ else
112
+ originalMethod.apply(this, args);
113
+
114
+ // Call your `call` with the function name
115
+ if (typeof (this as any).call === "function" && invoke)
116
+ return (this as any).call(propertyKey);
117
+
118
+ };
119
+
120
+ return descriptor;
94
121
  };
95
122
  }
@@ -13,22 +13,22 @@ export type A_TYPES__A_Feature_Extend = {
13
13
  };
14
14
 
15
15
  export type A_TYPES__A_FeatureDecoratorDescriptor =
16
+ TypedPropertyDescriptor<
17
+ ((...args: any[]) => any)
18
+ |
19
+ ((...args: any[]) => Promise<any>)
20
+ |
21
+ (() => any)
22
+ |
23
+ (() => Promise<any>)
24
+ >
25
+
16
26
 
17
- TypedPropertyDescriptor<() => any>
18
- |
19
- TypedPropertyDescriptor<(
20
- ...args: any[]
21
- ) => any>
22
- |
23
- TypedPropertyDescriptor<(
24
- ...args: any[]
25
- ) => Promise<any>>
26
- |
27
- TypedPropertyDescriptor<() => Promise<any>>
28
27
 
29
28
 
30
29
  export type A_TYPES__A_FeatureDecoratorConfig = {
31
30
  name: string,
31
+ invoke: boolean,
32
32
  channel: Array<typeof A_Channel>
33
33
  template: Array<A_TYPES__A_FeatureTemplateItem>
34
34
  }
@@ -74,7 +74,7 @@ export type A_TYPES__A_ExtendDecoratorConfig = {
74
74
  * [!!] By default uses OR to join all provided items. If you need more complex Logic, please use Regexp instead
75
75
  */
76
76
  scope: Array<
77
- { new(...args: any[]): A_Container<any> }
77
+ { new(...args: any[]): A_Container }
78
78
  | { new(...args: any[]): A_Entity }
79
79
  | { new(...args: any[]): A_Component }
80
80
  >
@@ -1,8 +1,8 @@
1
- import { A_Component } from "@adaas/a-concept/global/A-Component/A-Component.class";
2
1
  import {
3
2
  A_TYPES__A_InjectDecorator_EntityInjectionInstructions,
4
3
  A_TYPES__A_InjectDecoratorReturn
5
4
  } from "./A-Inject.decorator.types";
5
+ import { A_Component } from "@adaas/a-concept/global/A-Component/A-Component.class";
6
6
  import { A_Fragment } from "@adaas/a-concept/global/A-Fragment/A-Fragment.class";
7
7
  import { A_Scope } from "@adaas/a-concept/global/A-Scope/A-Scope.class";
8
8
  import { A_Context } from "@adaas/a-concept/global/A-Context/A-Context.class";
@@ -10,7 +10,9 @@ import { A_TYPES__ComponentMetaKey } from "@adaas/a-concept/global/A-Component/A
10
10
  import { A_Meta } from "@adaas/a-concept/global/A-Meta/A-Meta.class";
11
11
  import { A_Feature } from "@adaas/a-concept/global/A-Feature/A-Feature.class";
12
12
  import { A_Entity } from "@adaas/a-concept/global/A-Entity/A-Entity.class";
13
-
13
+ import { A_Container } from "@adaas/a-concept/global/A-Container/A-Container.class";
14
+ import { A_TYPES__ContainerMetaKey } from "@adaas/a-concept/global/A-Container/A-Container.types";
15
+ import { A_CommonHelper } from "@adaas/a-utils";
14
16
 
15
17
 
16
18
 
@@ -65,9 +67,34 @@ export function A_Inject(
65
67
 
66
68
  const method = methodName ? String(methodName) : 'constructor';
67
69
 
70
+ let metaKey;
71
+
72
+ switch (true) {
73
+
74
+ case target instanceof A_Component:
75
+ metaKey = A_TYPES__ComponentMetaKey.INJECTIONS;
76
+ break;
77
+
78
+ case A_CommonHelper.isInheritedFrom(target, A_Component):
79
+ metaKey = A_TYPES__ComponentMetaKey.INJECTIONS;
80
+ break;
81
+
82
+ case A_CommonHelper.isInheritedFrom(target, A_Container):
83
+ metaKey = A_TYPES__ContainerMetaKey.INJECTIONS;
84
+ break;
85
+
86
+ case target instanceof A_Container:
87
+ metaKey = A_TYPES__ContainerMetaKey.INJECTIONS;
88
+ break;
89
+
90
+
91
+ default:
92
+ throw new Error(`A-Inject cannot be defined on the ${target} level`);
93
+ }
94
+
68
95
  const existedMeta = A_Context
69
96
  .meta(target)
70
- .get(A_TYPES__ComponentMetaKey.INJECTIONS)
97
+ .get(metaKey)
71
98
  || new A_Meta();
72
99
 
73
100
 
@@ -83,7 +110,7 @@ export function A_Inject(
83
110
  A_Context
84
111
  .meta(target)
85
112
  .set(
86
- A_TYPES__ComponentMetaKey.INJECTIONS,
113
+ metaKey,
87
114
  existedMeta
88
115
  );
89
116
  }
@@ -6,6 +6,7 @@ import { A_Fragment } from "@adaas/a-concept/global/A-Fragment/A-Fragment.class"
6
6
  import { A_Scope } from "@adaas/a-concept/global/A-Scope/A-Scope.class";
7
7
  import { ASEID } from "@adaas/a-utils";
8
8
 
9
+
9
10
  export type A_TYPES__A_InjectDecoratorDescriptor = TypedPropertyDescriptor<(
10
11
  ...args: any[]
11
12
  ) => Promise<void>>
@@ -56,10 +57,10 @@ export type A_TYPES__A_InjectDecorator_Meta = Array<{
56
57
  export type A_TYPES__A_InjectDecorator_Injectable =
57
58
  { new(...args: any[]): A_Fragment }
58
59
  | { new(...args: any[]): A_Component }
59
- | { new(...args: any[]): A_Container<any> }
60
+ | { new(...args: any[]): A_Container }
60
61
  | { new(...args: any[]): A_Scope }
61
62
  | { new(...args: any[]): A_Feature }
62
- | { new(...args: any[]): A_Entity<any, any, any> };
63
+ | { new(...args: any[]): A_Entity };
63
64
 
64
65
 
65
66
  export type A_TYPES__A_InjectDecorator_EntityInjectionInstructions = {
@@ -71,7 +72,7 @@ export type A_TYPES__A_InjectDecorator_EntityInjectionInstructions = {
71
72
  export type A_TYPES__A_InjectDecorator_EntityInjectionQuery = {
72
73
  aseid: string | ASEID,
73
74
  id: string,
74
- type: { new(...args: any[]): A_Entity<any, any, any> },
75
+ type: { new(...args: any[]): A_Entity },
75
76
  entity: string
76
77
  }
77
78
 
@@ -0,0 +1,130 @@
1
+ import { A_Abstraction_Extend } from "@adaas/a-concept/decorators/A-Abstraction/A-Abstraction-Extend.decorator";
2
+ import { A_Feature } from "../A-Feature/A-Feature.class";
3
+ import { A_TYPES__A_AbstractionConstructor, A_TYPES__AbstractionState } from "./A-Abstraction.types";
4
+ import { A_Error, A_TYPES__Required } from "@adaas/a-utils";
5
+
6
+
7
+ export class A_Abstraction {
8
+
9
+ public name: string;
10
+ protected features: A_Feature[] = [];
11
+ protected _current?: A_Feature;
12
+ protected _index: number = 0;
13
+
14
+ state: A_TYPES__AbstractionState = A_TYPES__AbstractionState.INITIALIZED;
15
+ error?: A_Error
16
+
17
+
18
+
19
+ /**
20
+ * Define a new A-Abstraction
21
+ */
22
+ static get Extend(): typeof A_Abstraction_Extend {
23
+ return A_Abstraction_Extend;
24
+ }
25
+
26
+
27
+
28
+ constructor(params: A_TYPES__Required<Partial<A_TYPES__A_AbstractionConstructor>, ['name', 'features']>) {
29
+ this.name = params.name;
30
+ this.features = params.features.map(def => new A_Feature(def));
31
+
32
+ this._current = this.features[0];
33
+ }
34
+
35
+
36
+ get feature(): A_Feature | undefined {
37
+ return this._current;
38
+ }
39
+
40
+ [Symbol.iterator](): Iterator<A_Feature, any> {
41
+ return {
42
+ // Custom next method
43
+ next: (): IteratorResult<A_Feature, any> => {
44
+ if (!this.isDone()) {
45
+
46
+ this._current = this.features[this._index];
47
+
48
+ return {
49
+ value: this._current,
50
+ done: false
51
+ };
52
+ } else {
53
+
54
+ this._current = undefined; // Reset current on end
55
+
56
+ return {
57
+ value: undefined,
58
+ done: true
59
+ };
60
+ }
61
+ }
62
+ };
63
+ }
64
+
65
+ /**
66
+ * This method moves the feature to the next stage
67
+ *
68
+ * @param stage
69
+ */
70
+ next(stage) {
71
+ const stageIndex = this.features.indexOf(stage);
72
+
73
+ this._index = stageIndex + 1;
74
+
75
+ if (this._index >= this.features.length) {
76
+ this.completed();
77
+ }
78
+ }
79
+
80
+ async completed(): Promise<void> {
81
+ this.state = A_TYPES__AbstractionState.COMPLETED;
82
+ }
83
+
84
+
85
+ /**
86
+ * This method marks the feature as failed and throws an error
87
+ * Uses to interrupt or end the feature processing
88
+ *
89
+ * @param error
90
+ */
91
+ async failed(
92
+ error: Error | A_Error | unknown
93
+ ): Promise<void> {
94
+ this.error = error as A_Error;
95
+ this.state = A_TYPES__AbstractionState.FAILED;
96
+ }
97
+
98
+
99
+ /**
100
+ * This method checks if the A-Feature is done
101
+ *
102
+ * @returns
103
+ */
104
+ isDone(): boolean {
105
+ return !this.feature
106
+ || this._index >= this.features.length
107
+ || this.state === A_TYPES__AbstractionState.COMPLETED
108
+ || this.state === A_TYPES__AbstractionState.FAILED;
109
+ }
110
+
111
+
112
+ async process() {
113
+ if (this.isDone())
114
+ return;
115
+ try {
116
+ this.state = A_TYPES__AbstractionState.PROCESSING;
117
+
118
+ for (const feature of this.features) {
119
+
120
+ await feature.process();
121
+ }
122
+
123
+ await this.completed();
124
+
125
+ } catch (error) {
126
+ await this.failed(error);
127
+ }
128
+
129
+ }
130
+ }
@@ -0,0 +1,22 @@
1
+ import { A_TYPES__Required } from "@adaas/a-utils";
2
+ import { A_Container } from "../A-Container/A-Container.class";
3
+ import { A_TYPES__FeatureConstructor } from "../A-Feature/A-Feature.types";
4
+ import { A_TYPES__ScopeConstructor } from "../A-Scope/A-Scope.types";
5
+ import { A_TYPES__A_StageStep } from "../A-Stage/A-Stage.types";
6
+
7
+
8
+
9
+ export type A_TYPES__A_AbstractionConstructor = {
10
+ name: string,
11
+ features: Array<A_TYPES__Required<Partial<A_TYPES__FeatureConstructor>, ['steps']>>
12
+ } & A_TYPES__ScopeConstructor
13
+
14
+
15
+
16
+ export enum A_TYPES__AbstractionState {
17
+ INITIALIZED = "INITIALIZED",
18
+ PROCESSING = "PROCESSING",
19
+
20
+ COMPLETED = "COMPLETED",
21
+ FAILED = "FAILED",
22
+ }
@@ -38,8 +38,6 @@ export class A_Channel<
38
38
  async call<_Resp extends any>(prop: A_TYPES__A_ChannelAggregateMethods<T>, params?: Partial<A_TYPES__A_ChannelCallParams>): Promise<_Resp> {
39
39
  // do HTTP Call or just inject class or whatever you want
40
40
 
41
- console.log('Calling method', prop);
42
-
43
41
  return {} as _Resp;
44
42
  }
45
43
  }
@@ -1,3 +1,4 @@
1
+ import { A_Container } from "@adaas/a-concept/global/A-Container/A-Container.class";
1
2
  import { A_Component } from "../A-Component/A-Component.class"
2
3
  import { A_TYPES__ContainerCallParams } from "../A-Container/A-Container.types"
3
4
  import { A_Fragment } from "../A-Fragment/A-Fragment.class"
@@ -80,7 +81,7 @@ export type A_TYPES__A_ExecutableMethods<T> = {
80
81
  /**
81
82
  * Returns a string set of possible methods that could be called on a set of provided set of A-Components
82
83
  */
83
- export type A_TYPES__A_ChannelAggregateMethods<TClasses extends A_Component[]> = {
84
+ export type A_TYPES__A_ChannelAggregateMethods<TClasses extends (A_Component | A_Container)[]> = {
84
85
  [K in keyof TClasses]: TClasses[K] extends infer Instance
85
86
  ? A_TYPES__A_ExecutableMethods<Instance>
86
87
  : never;