@adaas/a-concept 0.0.32 → 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 (368) 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.component.js +3 -3
  12. package/dist/src/base/A-Errors/A-Errors.component.js.map +1 -1
  13. package/dist/src/base/A-Errors/A-Errors.context.js.map +1 -1
  14. package/dist/src/base/A-Logger/A-Logger.component.js.map +1 -1
  15. package/dist/src/decorators/A-Abstraction/{A-Abstraction.decorator.d.ts → A-Abstraction-Extend.decorator.d.ts} +1 -1
  16. package/dist/src/decorators/A-Abstraction/{A-Abstraction.decorator.js → A-Abstraction-Extend.decorator.js} +6 -6
  17. package/dist/src/decorators/A-Abstraction/A-Abstraction-Extend.decorator.js.map +1 -0
  18. package/dist/src/decorators/A-Abstraction/A-Abstraction.decorator.types.d.ts +1 -1
  19. package/dist/src/decorators/A-Connect/A-Connect.decorator.js.map +1 -1
  20. package/dist/src/decorators/A-Entity/A-Entity.decorator.types.d.ts +1 -1
  21. package/dist/src/decorators/A-Feature/A-Feature-Define.decorator.d.ts +3 -3
  22. package/dist/src/decorators/A-Feature/A-Feature-Define.decorator.js +20 -4
  23. package/dist/src/decorators/A-Feature/A-Feature-Define.decorator.js.map +1 -1
  24. package/dist/src/decorators/A-Feature/A-Feature.decorator.types.d.ts +3 -2
  25. package/dist/src/decorators/A-Inject/A-Inject.decorator.d.ts +1 -1
  26. package/dist/src/decorators/A-Inject/A-Inject.decorator.js +23 -2
  27. package/dist/src/decorators/A-Inject/A-Inject.decorator.js.map +1 -1
  28. package/dist/src/decorators/A-Inject/A-Inject.decorator.types.d.ts +3 -3
  29. package/dist/src/global/A-Abstraction/A-Abstraction.class.d.ts +40 -0
  30. package/dist/src/global/A-Abstraction/A-Abstraction.class.js +113 -0
  31. package/dist/src/global/A-Abstraction/A-Abstraction.class.js.map +1 -0
  32. package/dist/src/global/A-Abstraction/A-Abstraction.types.d.ts +13 -0
  33. package/dist/src/global/A-Abstraction/A-Abstraction.types.js +11 -0
  34. package/dist/src/global/A-Abstraction/A-Abstraction.types.js.map +1 -0
  35. package/dist/src/global/A-Channel/A-Channel.class.js +0 -1
  36. package/dist/src/global/A-Channel/A-Channel.class.js.map +1 -1
  37. package/dist/src/global/A-Channel/A-Channel.types.d.ts +2 -1
  38. package/dist/src/global/A-Component/A-Component.class.d.ts +5 -30
  39. package/dist/src/global/A-Component/A-Component.class.js +6 -10
  40. package/dist/src/global/A-Component/A-Component.class.js.map +1 -1
  41. package/dist/src/global/A-Component/A-Component.meta.d.ts +9 -2
  42. package/dist/src/global/A-Component/A-Component.meta.js +10 -1
  43. package/dist/src/global/A-Component/A-Component.meta.js.map +1 -1
  44. package/dist/src/global/A-Concept/A_Concept.class.d.ts +43 -20
  45. package/dist/src/global/A-Concept/A_Concept.class.js +77 -65
  46. package/dist/src/global/A-Concept/A_Concept.class.js.map +1 -1
  47. package/dist/src/global/A-Concept/A_Concept.meta.d.ts +10 -0
  48. package/dist/src/global/A-Concept/A_Concept.meta.js +20 -0
  49. package/dist/src/global/A-Concept/A_Concept.meta.js.map +1 -1
  50. package/dist/src/global/A-Concept/A_Concept.types.d.ts +9 -6
  51. package/dist/src/global/A-Container/A-Container.class.d.ts +7 -50
  52. package/dist/src/global/A-Container/A-Container.class.js +9 -19
  53. package/dist/src/global/A-Container/A-Container.class.js.map +1 -1
  54. package/dist/src/global/A-Container/A-Container.meta.d.ts +15 -0
  55. package/dist/src/global/A-Container/A-Container.meta.js +20 -0
  56. package/dist/src/global/A-Container/A-Container.meta.js.map +1 -1
  57. package/dist/src/global/A-Context/A-Context.class.d.ts +21 -21
  58. package/dist/src/global/A-Context/A-Context.class.js +60 -15
  59. package/dist/src/global/A-Context/A-Context.class.js.map +1 -1
  60. package/dist/src/global/A-Entity/A-Entity.class.d.ts +10 -18
  61. package/dist/src/global/A-Entity/A-Entity.class.js +21 -31
  62. package/dist/src/global/A-Entity/A-Entity.class.js.map +1 -1
  63. package/dist/src/global/A-Entity/A-Entity.meta.js.map +1 -1
  64. package/dist/src/global/A-Entity/A-Entity.types.d.ts +3 -2
  65. package/dist/src/global/A-Entity/A-Entity.types.js +1 -0
  66. package/dist/src/global/A-Entity/A-Entity.types.js.map +1 -1
  67. package/dist/src/global/A-Feature/A-Feature.class.d.ts +2 -1
  68. package/dist/src/global/A-Feature/A-Feature.class.js +14 -4
  69. package/dist/src/global/A-Feature/A-Feature.class.js.map +1 -1
  70. package/dist/src/global/A-Feature/A-Feature.types.d.ts +9 -0
  71. package/dist/src/global/A-Feature/A-Feature.types.js.map +1 -1
  72. package/dist/src/global/A-Meta/A-Meta.class.d.ts +1 -0
  73. package/dist/src/global/A-Meta/A-Meta.class.js +3 -6
  74. package/dist/src/global/A-Meta/A-Meta.class.js.map +1 -1
  75. package/dist/src/global/A-Scope/A-Scope.class.d.ts +4 -2
  76. package/dist/src/global/A-Scope/A-Scope.class.js +25 -16
  77. package/dist/src/global/A-Scope/A-Scope.class.js.map +1 -1
  78. package/dist/src/global/A-Scope/A-Scope.types.d.ts +4 -6
  79. package/dist/src/global/A-Stage/A-Stage.class.d.ts +3 -3
  80. package/dist/src/global/A-Stage/A-Stage.class.js +11 -10
  81. package/dist/src/global/A-Stage/A-Stage.class.js.map +1 -1
  82. package/dist/src/global/A-Stage/A-Stage.types.d.ts +1 -1
  83. package/dist/src/global/A-Stage/A-Stage.types.js.map +1 -1
  84. package/dist/src/helpers/StepsManager.class.d.ts +1 -0
  85. package/dist/src/helpers/StepsManager.class.js +10 -7
  86. package/dist/src/helpers/StepsManager.class.js.map +1 -1
  87. package/docs/a-concept-logo.png +0 -0
  88. package/docs/a-logo-docs.png +0 -0
  89. package/examples/fe-be/channels/Test.channel.ts +6 -3
  90. package/examples/simple/components/A.component.ts +7 -0
  91. package/examples/simple/components/B.component.ts +9 -0
  92. package/examples/simple/concept.ts +38 -60
  93. package/examples/simple/containers/Main.container.ts +25 -12
  94. package/examples/simple/entities/EntityA.entity.ts +3 -5
  95. package/examples/simple-http-server/components/http-request-handler.component.ts +6 -4
  96. package/examples/simple-http-server/concept.ts +24 -21
  97. package/examples/simple-http-server/containers/http-server.container.ts +4 -3
  98. package/index.ts +4 -1
  99. package/package.json +6 -2
  100. package/src/base/A-Config/A-Config.container.ts +12 -4
  101. package/src/base/A-Config/components/ConfigReader.component.ts +4 -5
  102. package/src/base/A-Config/components/FileConfigReader.component.ts +0 -2
  103. package/src/base/A-Errors/A-Error.entity.ts +1 -1
  104. package/src/base/A-Errors/A-Errors.component.ts +3 -3
  105. package/src/base/A-Errors/A-Errors.context.ts +2 -1
  106. package/src/base/A-Logger/A-Logger.component.ts +0 -1
  107. package/src/decorators/A-Abstraction/{A-Abstraction.decorator.ts → A-Abstraction-Extend.decorator.ts} +5 -6
  108. package/src/decorators/A-Abstraction/A-Abstraction.decorator.types.ts +1 -1
  109. package/src/decorators/A-Connect/A-Connect.decorator.ts +1 -1
  110. package/src/decorators/A-Entity/A-Entity.decorator.types.ts +1 -1
  111. package/src/decorators/A-Feature/A-Feature-Define.decorator.ts +37 -10
  112. package/src/decorators/A-Feature/A-Feature.decorator.types.ts +12 -12
  113. package/src/decorators/A-Inject/A-Inject.decorator.ts +31 -4
  114. package/src/decorators/A-Inject/A-Inject.decorator.types.ts +4 -3
  115. package/src/global/A-Abstraction/A-Abstraction.class.ts +130 -0
  116. package/src/global/A-Abstraction/A-Abstraction.types.ts +22 -0
  117. package/src/global/A-Channel/A-Channel.class.ts +0 -2
  118. package/src/global/A-Channel/A-Channel.types.ts +2 -1
  119. package/src/global/A-Component/A-Component.class.ts +12 -52
  120. package/src/global/A-Component/A-Component.meta.ts +19 -2
  121. package/src/global/A-Concept/A_Concept.class.ts +109 -111
  122. package/src/global/A-Concept/A_Concept.meta.ts +68 -0
  123. package/src/global/A-Concept/A_Concept.types.ts +11 -4
  124. package/src/global/A-Container/A-Container.class.ts +11 -90
  125. package/src/global/A-Container/A-Container.meta.ts +33 -0
  126. package/src/global/A-Context/A-Context.class.ts +139 -56
  127. package/src/global/A-Entity/A-Entity.class.ts +22 -69
  128. package/src/global/A-Entity/A-Entity.meta.ts +3 -2
  129. package/src/global/A-Entity/A-Entity.types.ts +2 -1
  130. package/src/global/A-Feature/A-Feature.class.ts +18 -7
  131. package/src/global/A-Feature/A-Feature.types.ts +10 -2
  132. package/src/global/A-Meta/A-Meta.class.ts +5 -8
  133. package/src/global/A-Scope/A-Scope.class.ts +40 -21
  134. package/src/global/A-Scope/A-Scope.types.ts +8 -2
  135. package/src/global/A-Stage/A-Stage.class.ts +20 -20
  136. package/src/global/A-Stage/A-Stage.types.ts +2 -3
  137. package/src/helpers/StepsManager.class.ts +11 -7
  138. package/trace-require.js +46 -0
  139. package/tsconfig.build.json +57 -0
  140. package/dist/examples/fe-be/channels/Test.channel.d.ts +0 -6
  141. package/dist/examples/fe-be/channels/Test.channel.js +0 -14
  142. package/dist/examples/fe-be/channels/Test.channel.js.map +0 -1
  143. package/dist/examples/fe-be/components/BE-Controller.component.d.ts +0 -4
  144. package/dist/examples/fe-be/components/BE-Controller.component.js +0 -24
  145. package/dist/examples/fe-be/components/BE-Controller.component.js.map +0 -1
  146. package/dist/examples/fe-be/components/FE.component.d.ts +0 -4
  147. package/dist/examples/fe-be/components/FE.component.js +0 -31
  148. package/dist/examples/fe-be/components/FE.component.js.map +0 -1
  149. package/dist/examples/fe-be/components/UserActions.component.d.ts +0 -5
  150. package/dist/examples/fe-be/components/UserActions.component.js +0 -25
  151. package/dist/examples/fe-be/components/UserActions.component.js.map +0 -1
  152. package/dist/examples/fe-be/concept.d.ts +0 -0
  153. package/dist/examples/fe-be/concept.js +0 -2
  154. package/dist/examples/fe-be/concept.js.map +0 -1
  155. package/dist/examples/fe-be/containers/ServerApp.container.d.ts +0 -3
  156. package/dist/examples/fe-be/containers/ServerApp.container.js +0 -8
  157. package/dist/examples/fe-be/containers/ServerApp.container.js.map +0 -1
  158. package/dist/examples/fe-be/containers/WebApp.container.d.ts +0 -3
  159. package/dist/examples/fe-be/containers/WebApp.container.js +0 -8
  160. package/dist/examples/fe-be/containers/WebApp.container.js.map +0 -1
  161. package/dist/examples/multi-container/channels/Direct.channel.d.ts +0 -9
  162. package/dist/examples/multi-container/channels/Direct.channel.js +0 -32
  163. package/dist/examples/multi-container/channels/Direct.channel.js.map +0 -1
  164. package/dist/examples/multi-container/concept.d.ts +0 -0
  165. package/dist/examples/multi-container/concept.js +0 -2
  166. package/dist/examples/multi-container/concept.js.map +0 -1
  167. package/dist/examples/multi-container/containers/Command.container.d.ts +0 -11
  168. package/dist/examples/multi-container/containers/Command.container.js +0 -51
  169. package/dist/examples/multi-container/containers/Command.container.js.map +0 -1
  170. package/dist/examples/multi-container/containers/Schedule.container.d.ts +0 -15
  171. package/dist/examples/multi-container/containers/Schedule.container.js +0 -67
  172. package/dist/examples/multi-container/containers/Schedule.container.js.map +0 -1
  173. package/dist/examples/sdk/concept.d.ts +0 -0
  174. package/dist/examples/sdk/concept.js +0 -21
  175. package/dist/examples/sdk/concept.js.map +0 -1
  176. package/dist/examples/sdk/orders.api.d.ts +0 -0
  177. package/dist/examples/sdk/orders.api.js +0 -16
  178. package/dist/examples/sdk/orders.api.js.map +0 -1
  179. package/dist/examples/sdk/users.api.d.ts +0 -0
  180. package/dist/examples/sdk/users.api.js +0 -16
  181. package/dist/examples/sdk/users.api.js.map +0 -1
  182. package/dist/examples/simple/components/A.component.d.ts +0 -9
  183. package/dist/examples/simple/components/A.component.js +0 -60
  184. package/dist/examples/simple/components/A.component.js.map +0 -1
  185. package/dist/examples/simple/components/B.component.d.ts +0 -13
  186. package/dist/examples/simple/components/B.component.js +0 -88
  187. package/dist/examples/simple/components/B.component.js.map +0 -1
  188. package/dist/examples/simple/concept.d.ts +0 -1
  189. package/dist/examples/simple/concept.js +0 -82
  190. package/dist/examples/simple/concept.js.map +0 -1
  191. package/dist/examples/simple/containers/Main.container.d.ts +0 -11
  192. package/dist/examples/simple/containers/Main.container.js +0 -86
  193. package/dist/examples/simple/containers/Main.container.js.map +0 -1
  194. package/dist/examples/simple/context/Fragment_A.context.d.ts +0 -6
  195. package/dist/examples/simple/context/Fragment_A.context.js +0 -16
  196. package/dist/examples/simple/context/Fragment_A.context.js.map +0 -1
  197. package/dist/examples/simple/context/Fragment_B.context.d.ts +0 -6
  198. package/dist/examples/simple/context/Fragment_B.context.js +0 -16
  199. package/dist/examples/simple/context/Fragment_B.context.js.map +0 -1
  200. package/dist/examples/simple/entities/EntityA.entity.d.ts +0 -8
  201. package/dist/examples/simple/entities/EntityA.entity.js +0 -22
  202. package/dist/examples/simple/entities/EntityA.entity.js.map +0 -1
  203. package/dist/examples/simple-http-server/components/http-error-handler.component.d.ts +0 -10
  204. package/dist/examples/simple-http-server/components/http-error-handler.component.js +0 -65
  205. package/dist/examples/simple-http-server/components/http-error-handler.component.js.map +0 -1
  206. package/dist/examples/simple-http-server/components/http-request-handler.component.d.ts +0 -3
  207. package/dist/examples/simple-http-server/components/http-request-handler.component.js +0 -8
  208. package/dist/examples/simple-http-server/components/http-request-handler.component.js.map +0 -1
  209. package/dist/examples/simple-http-server/concept.d.ts +0 -1
  210. package/dist/examples/simple-http-server/concept.js +0 -35
  211. package/dist/examples/simple-http-server/concept.js.map +0 -1
  212. package/dist/examples/simple-http-server/containers/http-server.container.d.ts +0 -11
  213. package/dist/examples/simple-http-server/containers/http-server.container.js +0 -73
  214. package/dist/examples/simple-http-server/containers/http-server.container.js.map +0 -1
  215. package/dist/examples/simple-http-server/containers/http-server.controller.d.ts +0 -7
  216. package/dist/examples/simple-http-server/containers/http-server.controller.js +0 -37
  217. package/dist/examples/simple-http-server/containers/http-server.controller.js.map +0 -1
  218. package/dist/examples/simple-http-server/containers/http-server.router.d.ts +0 -6
  219. package/dist/examples/simple-http-server/containers/http-server.router.js +0 -39
  220. package/dist/examples/simple-http-server/containers/http-server.router.js.map +0 -1
  221. package/dist/examples/simple-http-server/contexts/http-request.context.d.ts +0 -12
  222. package/dist/examples/simple-http-server/contexts/http-request.context.js +0 -49
  223. package/dist/examples/simple-http-server/contexts/http-request.context.js.map +0 -1
  224. package/dist/examples/simple-http-server/contexts/http-server.context.types.d.ts +0 -0
  225. package/dist/examples/simple-http-server/contexts/http-server.context.types.js +0 -2
  226. package/dist/examples/simple-http-server/contexts/http-server.context.types.js.map +0 -1
  227. package/dist/examples/simple-http-server/contexts/http-server.namespace.d.ts +0 -10
  228. package/dist/examples/simple-http-server/contexts/http-server.namespace.js +0 -26
  229. package/dist/examples/simple-http-server/contexts/http-server.namespace.js.map +0 -1
  230. package/dist/examples/simple-http-server/controllers/orders.controller.d.ts +0 -5
  231. package/dist/examples/simple-http-server/controllers/orders.controller.js +0 -32
  232. package/dist/examples/simple-http-server/controllers/orders.controller.js.map +0 -1
  233. package/dist/examples/simple-http-server/controllers/users.controller.d.ts +0 -0
  234. package/dist/examples/simple-http-server/controllers/users.controller.js +0 -87
  235. package/dist/examples/simple-http-server/controllers/users.controller.js.map +0 -1
  236. package/dist/examples/simple-http-server/modules/simple-http-server.context.d.ts +0 -5
  237. package/dist/examples/simple-http-server/modules/simple-http-server.context.js +0 -25
  238. package/dist/examples/simple-http-server/modules/simple-http-server.context.js.map +0 -1
  239. package/dist/examples/simple-http-server/modules/simple-http-server.module.d.ts +0 -16
  240. package/dist/examples/simple-http-server/modules/simple-http-server.module.js +0 -8
  241. package/dist/examples/simple-http-server/modules/simple-http-server.module.js.map +0 -1
  242. package/dist/examples/simple-http-server/modules/simple-http-server.types.d.ts +0 -2
  243. package/dist/examples/simple-http-server/modules/simple-http-server.types.js +0 -3
  244. package/dist/examples/simple-http-server/modules/simple-http-server.types.js.map +0 -1
  245. package/dist/examples/simple-http-server/test.d.ts +0 -68
  246. package/dist/examples/simple-http-server/test.js +0 -162
  247. package/dist/examples/simple-http-server/test.js.map +0 -1
  248. package/dist/src/containers/A-Config/A-Config.container.d.ts +0 -7
  249. package/dist/src/containers/A-Config/A-Config.container.js +0 -65
  250. package/dist/src/containers/A-Config/A-Config.container.js.map +0 -1
  251. package/dist/src/containers/A-Config/A-Config.namespace.d.ts +0 -28
  252. package/dist/src/containers/A-Config/A-Config.namespace.js +0 -54
  253. package/dist/src/containers/A-Config/A-Config.namespace.js.map +0 -1
  254. package/dist/src/containers/A-Config/A-Config.types.d.ts +0 -12
  255. package/dist/src/containers/A-Config/A-Config.types.js +0 -3
  256. package/dist/src/containers/A-Config/A-Config.types.js.map +0 -1
  257. package/dist/src/containers/A-Config/components/ConfigReader.component.d.ts +0 -18
  258. package/dist/src/containers/A-Config/components/ConfigReader.component.js +0 -37
  259. package/dist/src/containers/A-Config/components/ConfigReader.component.js.map +0 -1
  260. package/dist/src/containers/A-Config/components/ENVConfigReader.component.d.ts +0 -10
  261. package/dist/src/containers/A-Config/components/ENVConfigReader.component.js +0 -37
  262. package/dist/src/containers/A-Config/components/ENVConfigReader.component.js.map +0 -1
  263. package/dist/src/containers/A-Config/components/FileConfigReader.component.d.ts +0 -11
  264. package/dist/src/containers/A-Config/components/FileConfigReader.component.js +0 -47
  265. package/dist/src/containers/A-Config/components/FileConfigReader.component.js.map +0 -1
  266. package/dist/src/containers/A-Errors/A-Errors.container.d.ts +0 -5
  267. package/dist/src/containers/A-Errors/A-Errors.container.js +0 -32
  268. package/dist/src/containers/A-Errors/A-Errors.container.js.map +0 -1
  269. package/dist/src/containers/A-Errors/A-Errors.namespace.d.ts +0 -40
  270. package/dist/src/containers/A-Errors/A-Errors.namespace.js +0 -76
  271. package/dist/src/containers/A-Errors/A-Errors.namespace.js.map +0 -1
  272. package/dist/src/containers/A-Errors/A-Errors.types.d.ts +0 -5
  273. package/dist/src/containers/A-Errors/A-Errors.types.js +0 -3
  274. package/dist/src/containers/A-Errors/A-Errors.types.js.map +0 -1
  275. package/dist/src/containers/A-Logger/A-Logger.container.d.ts +0 -6
  276. package/dist/src/containers/A-Logger/A-Logger.container.js +0 -41
  277. package/dist/src/containers/A-Logger/A-Logger.container.js.map +0 -1
  278. package/dist/src/containers/A-Logger/A-Logger.namespace.d.ts +0 -17
  279. package/dist/src/containers/A-Logger/A-Logger.namespace.js +0 -22
  280. package/dist/src/containers/A-Logger/A-Logger.namespace.js.map +0 -1
  281. package/dist/src/containers/A-Logger/A-Logger.types.d.ts +0 -0
  282. package/dist/src/containers/A-Logger/A-Logger.types.js +0 -2
  283. package/dist/src/containers/A-Logger/A-Logger.types.js.map +0 -1
  284. package/dist/src/containers/A-Logger/components/Logger.component.d.ts +0 -29
  285. package/dist/src/containers/A-Logger/components/Logger.component.js +0 -128
  286. package/dist/src/containers/A-Logger/components/Logger.component.js.map +0 -1
  287. package/dist/src/decorators/A-Abstraction/A-Abstraction.decorator.js.map +0 -1
  288. package/dist/src/decorators/A-ConceptLifecycle/A-ConceptLifecycle.decorator.types.d.ts +0 -34
  289. package/dist/src/decorators/A-ConceptLifecycle/A-ConceptLifecycle.decorator.types.js +0 -3
  290. package/dist/src/decorators/A-ConceptLifecycle/A-ConceptLifecycle.decorator.types.js.map +0 -1
  291. package/dist/src/decorators/A-ConceptLifecycle/A-Load/A-Load.decorator.d.ts +0 -11
  292. package/dist/src/decorators/A-ConceptLifecycle/A-Load/A-Load.decorator.js +0 -36
  293. package/dist/src/decorators/A-ConceptLifecycle/A-Load/A-Load.decorator.js.map +0 -1
  294. package/dist/src/decorators/A-ConceptLifecycle/A-Load/A-Load.decorator.types.d.ts +0 -7
  295. package/dist/src/decorators/A-ConceptLifecycle/A-Load/A-Load.decorator.types.js +0 -3
  296. package/dist/src/decorators/A-ConceptLifecycle/A-Load/A-Load.decorator.types.js.map +0 -1
  297. package/dist/src/decorators/A-ConceptLifecycle/A-Run/A-Run.decorator.d.ts +0 -17
  298. package/dist/src/decorators/A-ConceptLifecycle/A-Run/A-Run.decorator.js +0 -42
  299. package/dist/src/decorators/A-ConceptLifecycle/A-Run/A-Run.decorator.js.map +0 -1
  300. package/dist/src/decorators/A-ConceptLifecycle/A-Run/A-Run.decorator.types.d.ts +0 -8
  301. package/dist/src/decorators/A-ConceptLifecycle/A-Run/A-Run.decorator.types.js +0 -3
  302. package/dist/src/decorators/A-ConceptLifecycle/A-Run/A-Run.decorator.types.js.map +0 -1
  303. package/dist/src/decorators/A-ConceptLifecycle/index.d.ts +0 -7
  304. package/dist/src/decorators/A-ConceptLifecycle/index.js +0 -11
  305. package/dist/src/decorators/A-ConceptLifecycle/index.js.map +0 -1
  306. package/dist/src/decorators/A-Define/Feature/Feature.decorator.d.ts +0 -16
  307. package/dist/src/decorators/A-Define/Feature/Feature.decorator.js +0 -36
  308. package/dist/src/decorators/A-Define/Feature/Feature.decorator.js.map +0 -1
  309. package/dist/src/decorators/A-Define/Feature/Feature.decorator.types.d.ts +0 -8
  310. package/dist/src/decorators/A-Define/Feature/Feature.decorator.types.js +0 -3
  311. package/dist/src/decorators/A-Define/Feature/Feature.decorator.types.js.map +0 -1
  312. package/dist/src/decorators/A-Define/Lifecycle/Lifecycle.decorator.d.ts +0 -14
  313. package/dist/src/decorators/A-Define/Lifecycle/Lifecycle.decorator.js +0 -24
  314. package/dist/src/decorators/A-Define/Lifecycle/Lifecycle.decorator.js.map +0 -1
  315. package/dist/src/decorators/A-Define/Lifecycle/Lifecycle.decorator.types.d.ts +0 -8
  316. package/dist/src/decorators/A-Define/Lifecycle/Lifecycle.decorator.types.js +0 -3
  317. package/dist/src/decorators/A-Define/Lifecycle/Lifecycle.decorator.types.js.map +0 -1
  318. package/dist/src/decorators/A-Define/index.d.ts +0 -7
  319. package/dist/src/decorators/A-Define/index.js +0 -10
  320. package/dist/src/decorators/A-Define/index.js.map +0 -1
  321. package/dist/src/decorators/A-Extend/A-Extend.decorator.d.ts +0 -18
  322. package/dist/src/decorators/A-Extend/A-Extend.decorator.js +0 -37
  323. package/dist/src/decorators/A-Extend/A-Extend.decorator.js.map +0 -1
  324. package/dist/src/decorators/A-Extend/A-Extend.decorator.types.d.ts +0 -21
  325. package/dist/src/decorators/A-Extend/A-Extend.decorator.types.js +0 -3
  326. package/dist/src/decorators/A-Extend/A-Extend.decorator.types.js.map +0 -1
  327. package/dist/src/decorators/A-Feature/A-Feature.decorator.d.ts +0 -0
  328. package/dist/src/decorators/A-Feature/A-Feature.decorator.js +0 -11
  329. package/dist/src/decorators/A-Feature/A-Feature.decorator.js.map +0 -1
  330. package/dist/src/decorators/A-Stage/A-Stage.decorator.d.ts +0 -13
  331. package/dist/src/decorators/A-Stage/A-Stage.decorator.js +0 -52
  332. package/dist/src/decorators/A-Stage/A-Stage.decorator.js.map +0 -1
  333. package/dist/src/decorators/A-Stage/A-Stage.decorator.types.d.ts +0 -2
  334. package/dist/src/decorators/A-Stage/A-Stage.decorator.types.js +0 -3
  335. package/dist/src/decorators/A-Stage/A-Stage.decorator.types.js.map +0 -1
  336. package/dist/src/decorators/A_ConceptMethods.decorator.d.ts +0 -0
  337. package/dist/src/decorators/A_ConceptMethods.decorator.js +0 -2
  338. package/dist/src/decorators/A_ConceptMethods.decorator.js.map +0 -1
  339. package/dist/src/decorators/A_Lazy.decorator.d.ts +0 -5
  340. package/dist/src/decorators/A_Lazy.decorator.js +0 -20
  341. package/dist/src/decorators/A_Lazy.decorator.js.map +0 -1
  342. package/dist/src/global/A-Context/A-ContextFragment.class.d.ts +0 -12
  343. package/dist/src/global/A-Context/A-ContextFragment.class.js +0 -19
  344. package/dist/src/global/A-Context/A-ContextFragment.class.js.map +0 -1
  345. package/dist/src/global/A-Namespace/A_Namespace.class.d.ts +0 -47
  346. package/dist/src/global/A-Namespace/A_Namespace.class.js +0 -112
  347. package/dist/src/global/A-Namespace/A_Namespace.class.js.map +0 -1
  348. package/dist/src/global/A-Namespace/A_Namespace.types.d.ts +0 -19
  349. package/dist/src/global/A-Namespace/A_Namespace.types.js +0 -3
  350. package/dist/src/global/A-Namespace/A_Namespace.types.js.map +0 -1
  351. package/dist/src/managers/A_DependencyManager.class.d.ts +0 -24
  352. package/dist/src/managers/A_DependencyManager.class.js +0 -129
  353. package/dist/src/managers/A_DependencyManager.class.js.map +0 -1
  354. package/dist/src/storage/A_Component.storage.d.ts +0 -10
  355. package/dist/src/storage/A_Component.storage.js +0 -17
  356. package/dist/src/storage/A_Component.storage.js.map +0 -1
  357. package/dist/src/storage/A_Concept.storage.d.ts +0 -19
  358. package/dist/src/storage/A_Concept.storage.js +0 -29
  359. package/dist/src/storage/A_Concept.storage.js.map +0 -1
  360. package/dist/src/storage/A_Container.storage.d.ts +0 -8
  361. package/dist/src/storage/A_Container.storage.js +0 -17
  362. package/dist/src/storage/A_Container.storage.js.map +0 -1
  363. package/dist/src/storage/A_Inject.storage.d.ts +0 -9
  364. package/dist/src/storage/A_Inject.storage.js +0 -13
  365. package/dist/src/storage/A_Inject.storage.js.map +0 -1
  366. package/dist/src/types/A_DependencyManager.types.d.ts +0 -15
  367. package/dist/src/types/A_DependencyManager.types.js +0 -3
  368. package/dist/src/types/A_DependencyManager.types.js.map +0 -1
@@ -1,15 +1,13 @@
1
1
  import { A_Entity } from "@adaas/a-concept/global/A-Entity/A-Entity.class";
2
2
  import { A_TYPES__EntityBaseMethods } from "@adaas/a-concept/global/A-Entity/A-Entity.types";
3
+ import { A_Feature } from "index";
3
4
 
4
5
 
5
6
 
6
- export class EntityA extends A_Entity<any, any, [
7
- ...A_TYPES__EntityBaseMethods,
8
- 'doSomething'
9
- ]> {
10
-
7
+ export class EntityA extends A_Entity {
11
8
 
12
9
 
10
+ @A_Feature.Define()
13
11
  async doSomething() {
14
12
  await this.call('doSomething');
15
13
  }
@@ -1,11 +1,13 @@
1
1
  import { A_Component } from "@adaas/a-concept/global/A-Component/A-Component.class";
2
+ import { A_Feature } from "index";
2
3
 
3
- export class HTTPRequestHandler extends A_Component {
4
+ export class HTTPRequestHandler extends A_Component {
4
5
 
5
6
 
6
7
 
7
-
8
-
9
-
8
+ @A_Feature.Extend()
9
+ onRequest() {
10
+ console.log('HTTPRequestHandler -> onRequest()');
11
+ }
10
12
 
11
13
  }
@@ -1,31 +1,34 @@
1
1
  import { A_Concept } from "@adaas/a-concept/global/A-Concept/A_Concept.class";
2
2
  import { HttpServer } from "./containers/http-server.container";
3
+ import { A_Config } from "@adaas/a-concept/base/A-Config/A-Config.context";
4
+ import { HTTPErrorHandler } from "./components/http-error-handler.component";
5
+ import { HTTPRequestHandler } from "./components/http-request-handler.component";
3
6
 
4
7
 
5
8
  (async () => {
6
- // const simpleConcept = new A_Concept({
7
- // // name: 'test-server',
8
- // // // import: [
9
- // // // server1,
10
- // // // server2
11
- // // // ],
12
- // // containers: [
13
- // // new DefaultHttpServer({
14
- // // components: []
15
- // // })
16
- // // ],
17
- // // context: [
18
- // // new HttpServer({
19
- // // port: 3000
20
- // // }),
21
- // // new HttpServer({
22
- // // port: 3001
23
- // // })
24
- // // ],
25
- // })
9
+ const simpleConcept = new A_Concept({
10
+ name: 'test-server',
26
11
 
12
+ containers: [
13
+ new HttpServer({
14
+ components: [
15
+ HTTPErrorHandler,
16
+ HTTPRequestHandler
17
+ ]
18
+ })
19
+ ],
20
+ fragments: [
21
+ new A_Config({
22
+ variables: ['PORT'],
23
+ defaults: {
24
+ PORT: 3030,
25
+ }
26
+ })
27
+ ],
28
+ })
27
29
 
28
30
 
29
- // await simpleConcept.run();
31
+
32
+ await simpleConcept.start();
30
33
 
31
34
  })();
@@ -1,7 +1,6 @@
1
1
  import { A_Container } from "@adaas/a-concept/global/A-Container/A-Container.class";
2
2
  import { createServer, IncomingMessage, Server, ServerResponse } from "http";
3
3
  import { A_Inject } from "@adaas/a-concept/decorators/A-Inject/A-Inject.decorator";
4
- // import { A_Feature } from "@adaas/a-concept/decorators/A-Feature/A-Feature.decorator";
5
4
  import { A_Concept } from "@adaas/a-concept/global/A-Concept/A_Concept.class";
6
5
  import { A_Config } from "@adaas/a-concept/base/A-Config/A-Config.context";
7
6
  import { A_Feature } from "@adaas/a-concept/global/A-Feature/A-Feature.class";
@@ -11,7 +10,7 @@ import { HTTPRequest } from "../contexts/http-request.context";
11
10
 
12
11
 
13
12
 
14
- export class HttpServer extends A_Container<['start', 'stop', 'onRequest']> {
13
+ export class HttpServer extends A_Container {
15
14
 
16
15
  server!: Server
17
16
  port!: number
@@ -36,7 +35,9 @@ export class HttpServer extends A_Container<['start', 'stop', 'onRequest']> {
36
35
  }
37
36
 
38
37
 
39
- @A_Feature.Define()
38
+ @A_Feature.Define({
39
+ invoke: false
40
+ })
40
41
  async onRequest(
41
42
  req: IncomingMessage,
42
43
  res: ServerResponse
package/index.ts CHANGED
@@ -6,6 +6,9 @@
6
6
  export { A_Context } from './src/global/A-Context/A-Context.class';
7
7
  // export * from './src/global/A-Context/A-Context.types';
8
8
 
9
+ export { A_Abstraction } from './src/global/A-Abstraction/A-Abstraction.class';
10
+ export * from './src/global/A-Abstraction/A-Abstraction.types';
11
+
9
12
  export { A_Concept } from './src/global/A-Concept/A_Concept.class';
10
13
  export { A_ConceptMeta } from './src/global/A-Concept/A_Concept.meta';
11
14
  export * from './src/global/A-Concept/A_Concept.types';
@@ -53,7 +56,7 @@ export { A_Feature_Define } from './src/decorators/A-Feature/A-Feature-Define.de
53
56
  export { A_Feature_Extend } from './src/decorators/A-Feature/A-Feature-Extend.decorator';
54
57
  export * from './src/decorators/A-Feature/A-Feature.decorator.types';
55
58
 
56
- export { A_Abstraction } from './src/decorators/A-Abstraction/A-Abstraction.decorator';
59
+ export { A_Abstraction_Extend } from './src/decorators/A-Abstraction/A-Abstraction-Extend.decorator';
57
60
  export * from './src/decorators/A-Abstraction/A-Abstraction.decorator.types';
58
61
 
59
62
  export { A_Connect } from './src/decorators/A-Connect/A-Connect.decorator';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adaas/a-concept",
3
- "version": "0.0.32",
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
  }
@@ -33,7 +33,7 @@ export class A_ErrorsManager extends A_Component {
33
33
  // In case of error code
34
34
  case typeof param === 'string':
35
35
  const template = this.errors.get(param);
36
- const namedCode = `${A_Context.root}@${this.scope.name}:error:${template.code}`
36
+ const namedCode = `${A_Context.root.name}@${this.scope.name}:error:${template.code}`
37
37
 
38
38
  if ('serverCode' in template)
39
39
  throw new A_ServerError({
@@ -67,13 +67,13 @@ export class A_ErrorsManager extends A_Component {
67
67
 
68
68
  switch (true) {
69
69
  case error instanceof A_Error:
70
- let newCode = `${A_Context.root}@${this.scope.name}:error:${error.code}`;
70
+ let newCode = `${A_Context.root.name}@${this.scope.name}:error:${error.code}`;
71
71
 
72
72
  if (ASEID.isASEID(error.code)) {
73
73
  const aseid = new ASEID(error.code);
74
74
 
75
75
  if (aseid.scope !== this.scope.name)
76
- newCode = `${A_Context.root}@${this.scope.name}:error:${aseid.id}`;
76
+ newCode = `${A_Context.root.name}@${this.scope.name}:error:${aseid.id}`;
77
77
  }
78
78
 
79
79
  if ('serverCode' in error)
@@ -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