@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,4 +1,8 @@
1
- import { A_CommonHelper, A_Polyfills, A_TYPES__Required, ASEID } from "@adaas/a-utils";
1
+ import {
2
+ A_CommonHelper,
3
+ A_Polyfills,
4
+ A_TYPES__Required,
5
+ } from "@adaas/a-utils";
2
6
  import { A_Component } from "../A-Component/A-Component.class";
3
7
  import { A_Fragment } from "../A-Fragment/A-Fragment.class";
4
8
  import { A_Feature } from "../A-Feature/A-Feature.class";
@@ -8,15 +12,15 @@ import { A_TYPES__ScopeConfig, A_TYPES__ScopeConstructor } from "../A-Scope/A-Sc
8
12
  import { A_Meta } from "../A-Meta/A-Meta.class";
9
13
  import { A_ComponentMeta } from "../A-Component/A-Component.meta";
10
14
  import { A_ContainerMeta } from "../A-Container/A-Container.meta";
11
- import { A_Concept } from "../A-Concept/A_Concept.class";
12
15
  import { A_TYPES__EntityBaseMethod, A_TYPES__EntityMetaKey } from "../A-Entity/A-Entity.types";
13
16
  import { A_Entity } from "../A-Entity/A-Entity.class";
14
17
  import { A_EntityMeta } from "../A-Entity/A-Entity.meta";
15
18
  import { A_TYPES__FeatureConstructor } from "../A-Feature/A-Feature.types";
16
19
  import { A_TYPES__A_StageStep } from "../A-Stage/A-Stage.types";
17
- import { A_TYPES__A_DefineDecorator_Meta, A_TYPES__A_FeatureDecoratorConfig } from "@adaas/a-concept/decorators/A-Feature/A-Feature.decorator.types";
18
20
  import { A_TYPES__ContainerMetaKey } from "../A-Container/A-Container.types";
19
21
  import { A_TYPES__ComponentMetaKey } from "../A-Component/A-Component.types";
22
+ import { A_TYPES__ConceptStage } from "../A-Concept/A_Concept.types";
23
+
20
24
 
21
25
 
22
26
  /**
@@ -33,25 +37,19 @@ export class A_Context {
33
37
  /**
34
38
  * A set of globally registered containers.
35
39
  */
36
- protected containers: WeakMap<A_Container<any>, A_Scope> = new WeakMap();
40
+ protected containers: WeakMap<A_Container, A_Scope> = new WeakMap();
37
41
 
38
42
  /**
39
43
  * A set of globally registered features.
40
44
  */
41
45
  protected features: WeakMap<A_Feature, A_Scope> = new WeakMap();
42
46
 
43
- /**
44
- * A set of globally registered concepts.
45
- */
46
- protected concepts: WeakMap<A_Concept<any>, A_Scope> = new WeakMap();
47
-
48
47
 
49
48
  /**
50
49
  * Uses to store the scope of every element in the program.
51
50
  */
52
51
  protected registry: WeakMap<
53
- A_Concept<any> |
54
- A_Container<any> |
52
+ A_Container |
55
53
  A_Feature |
56
54
  A_Component |
57
55
  A_Fragment |
@@ -65,7 +63,6 @@ export class A_Context {
65
63
  /**
66
64
  * A set of allocated scopes per every element in the program.
67
65
  */
68
- protected conceptsMeta: Map<typeof A_Concept.constructor, A_Meta<any>> = new Map();
69
66
  protected containersMeta: Map<typeof A_Container.constructor, A_ContainerMeta> = new Map();
70
67
  protected componentsMeta: Map<typeof A_Component, A_ComponentMeta> = new Map();
71
68
  protected entitiesMeta: Map<typeof A_Entity.constructor, A_EntityMeta> = new Map();
@@ -77,10 +74,14 @@ export class A_Context {
77
74
  /**
78
75
  * Root Namespace is a Namespace that is used to run the program.
79
76
  */
80
- private _root!: string
77
+ private _root!: A_Scope
81
78
 
82
79
 
83
- private constructor() { }
80
+ private constructor() {
81
+ this._root = new A_Scope({
82
+ name: 'root'
83
+ });
84
+ }
84
85
 
85
86
 
86
87
 
@@ -103,7 +104,7 @@ export class A_Context {
103
104
  return A_Context.instance;
104
105
  }
105
106
 
106
- static get root(): string {
107
+ static get root(): A_Scope {
107
108
  return this.getInstance()._root;
108
109
  }
109
110
 
@@ -113,7 +114,6 @@ export class A_Context {
113
114
 
114
115
 
115
116
 
116
-
117
117
  static allocate(
118
118
  component: any,
119
119
  importing: Partial<A_TYPES__ScopeConstructor & A_TYPES__ScopeConfig>
@@ -123,11 +123,11 @@ export class A_Context {
123
123
  importing: Partial<A_TYPES__ScopeConstructor & A_TYPES__ScopeConfig>
124
124
  ): A_Scope
125
125
  static allocate(
126
- container: A_Container<any>,
126
+ container: A_Container,
127
127
  importing: Partial<A_TYPES__ScopeConstructor & A_TYPES__ScopeConfig>
128
128
  ): A_Scope
129
129
  static allocate(
130
- param1: A_Container<any> | A_Feature | A_Component | any,
130
+ param1: A_Container | A_Feature | A_Component | any,
131
131
  param2: Partial<A_TYPES__ScopeConstructor & A_TYPES__ScopeConfig>
132
132
  ): A_Scope {
133
133
 
@@ -138,17 +138,14 @@ export class A_Context {
138
138
  switch (true) {
139
139
  case param1 instanceof A_Container:
140
140
  instance.containers.set(param1, newScope);
141
+
141
142
  break;
142
143
 
143
144
  case param1 instanceof A_Feature:
144
145
  instance.features.set(param1, newScope);
145
- break;
146
146
 
147
- case param1 instanceof A_Concept:
148
- instance.concepts.set(param1, newScope);
149
147
  break;
150
148
 
151
-
152
149
  default:
153
150
  throw new Error(`[!] A-Concept Context: Unknown type of the parameter.`);
154
151
  }
@@ -164,7 +161,7 @@ export class A_Context {
164
161
  container: typeof A_Container,
165
162
  ): A_ContainerMeta
166
163
  static meta(
167
- container: A_Container<any>,
164
+ container: A_Container,
168
165
  ): A_ContainerMeta
169
166
  static meta(
170
167
  entity: A_Entity,
@@ -179,17 +176,14 @@ export class A_Context {
179
176
  component: A_Component,
180
177
  ): A_ComponentMeta
181
178
  static meta<T extends Record<string, any>>(
182
- component: { new(...args: any[]): any },
183
- ): A_Meta<T>
184
- static meta<T extends Record<string, any>>(
185
- param1: A_Container<any>
186
- | typeof A_Container
179
+ param1: typeof A_Component | typeof A_Container | A_Container
187
180
  | A_Component
188
- | typeof A_Component
189
181
  | A_Entity
190
182
  | typeof A_Entity
191
183
  | { new(...args: any[]): any }
192
184
  ): A_ContainerMeta | A_ComponentMeta | A_Meta<T> {
185
+
186
+
193
187
  const instance = this.getInstance();
194
188
 
195
189
  let metaStorage: WeakMap<typeof A_Container.constructor, A_Meta<any>>;
@@ -209,7 +203,7 @@ export class A_Context {
209
203
 
210
204
  case A_CommonHelper.isInheritedFrom(param1, A_Container): {
211
205
  metaStorage = instance.containersMeta;
212
- property = param1 as typeof A_Container<any>;
206
+ property = param1 as typeof A_Container;
213
207
  metaType = A_ContainerMeta;
214
208
 
215
209
  break;
@@ -256,11 +250,13 @@ export class A_Context {
256
250
  }
257
251
  }
258
252
 
253
+
259
254
  if (!metaStorage.has(property)) {
260
255
  const inheritMeta = metaStorage.get(Object.getPrototypeOf(property)) || new metaType();
261
256
  metaStorage.set(property, new metaType().from(inheritMeta as any));
262
257
  }
263
258
 
259
+
264
260
  return metaStorage.get(property)!;
265
261
  }
266
262
 
@@ -273,10 +269,7 @@ export class A_Context {
273
269
  component: A_Component
274
270
  ): A_Scope
275
271
  static scope(
276
- concept: A_Concept
277
- ): A_Scope
278
- static scope(
279
- container: A_Container<any>
272
+ container: A_Container
280
273
  ): A_Scope
281
274
  static scope(
282
275
  feature: A_Fragment
@@ -285,7 +278,7 @@ export class A_Context {
285
278
  feature: A_Feature
286
279
  ): A_Scope
287
280
  static scope(
288
- param1: A_Feature | A_Container<any> | A_Concept | A_Component<any> | A_Entity | A_Fragment
281
+ param1: A_Feature | A_Container | A_Component | A_Entity | A_Fragment
289
282
  ): A_Scope | undefined {
290
283
 
291
284
  const instance = this.getInstance();
@@ -297,9 +290,6 @@ export class A_Context {
297
290
  case param1 instanceof A_Feature:
298
291
  return instance.features.get(param1);
299
292
 
300
- case param1 instanceof A_Concept:
301
- return instance.concepts.get(param1);
302
-
303
293
  case param1 instanceof A_Entity:
304
294
  return instance.registry.get(param1);
305
295
 
@@ -347,16 +337,16 @@ export class A_Context {
347
337
  * @param scope
348
338
  * @returns
349
339
  */
350
- static featureDefinition<T extends Array<string>>(
340
+ static featureDefinition(
351
341
  scope: A_Scope,
352
- entity: A_Entity<any, any, T>,
353
- feature: A_TYPES__EntityBaseMethod | string | T[number] | RegExp,
342
+ entity: A_Entity,
343
+ feature: A_TYPES__EntityBaseMethod | string | RegExp,
354
344
  params?: Partial<A_TYPES__ScopeConstructor>
355
345
  ): A_TYPES__Required<Partial<A_TYPES__FeatureConstructor>, ['steps', 'fragments', 'name', 'components']>
356
- static featureDefinition<T extends Array<string>>(
346
+ static featureDefinition(
357
347
  scope: A_Scope,
358
- container: A_Container<T>,
359
- feature: T[number],
348
+ container: A_Container,
349
+ feature: string,
360
350
  params?: Partial<A_TYPES__ScopeConstructor>
361
351
  ): A_TYPES__Required<Partial<A_TYPES__FeatureConstructor>, ['steps', 'fragments', 'name', 'components']>
362
352
  static featureDefinition(
@@ -365,10 +355,10 @@ export class A_Context {
365
355
  feature: string,
366
356
  params?: Partial<A_TYPES__ScopeConstructor>
367
357
  ): A_TYPES__Required<Partial<A_TYPES__FeatureConstructor>, ['steps', 'fragments', 'name', 'components']>
368
- static featureDefinition<T extends Array<string>>(
358
+ static featureDefinition(
369
359
  scope: A_Scope,
370
- param1: A_Component<T> | A_Container<T> | A_Entity<any, any, T>,
371
- param2: string | T[number],
360
+ param1: A_Component | A_Container | A_Entity,
361
+ param2: string,
372
362
  param3?: Partial<A_TYPES__ScopeConstructor>
373
363
  ): A_TYPES__Required<Partial<A_TYPES__FeatureConstructor>, ['steps', 'fragments', 'name', 'components']> {
374
364
  const instance = this.getInstance();
@@ -416,14 +406,18 @@ export class A_Context {
416
406
  case component instanceof A_Container:
417
407
  metaKey = A_TYPES__ContainerMetaKey.FEATURES
418
408
  break;
419
- case component instanceof A_Component:
409
+ case component instanceof A_Component: {
420
410
  metaKey = A_TYPES__ComponentMetaKey.FEATURES
411
+ }
421
412
  break;
422
413
  default:
423
414
  throw new Error(`A-Feature cannot be defined on the ${component} level`);
424
415
  }
425
416
 
426
- const featureDefinition: A_TYPES__A_DefineDecorator_Meta = this.meta(component).get(metaKey);
417
+
418
+ const featureDefinition = this.meta(component)
419
+ .get(metaKey)
420
+ .get(param2);
427
421
 
428
422
  if (!featureDefinition)
429
423
  throw new Error(`[!] A-Concept Context: Feature not found.`);
@@ -464,12 +458,101 @@ export class A_Context {
464
458
  name: feature,
465
459
  fragments: config.fragments || [],
466
460
  components: config.components || [],
461
+ entities: config.entities || [],
467
462
  steps,
468
463
  parent: scope
469
464
  };
470
465
  }
471
466
 
467
+ /**
468
+ * This method returns a constructor params to create a new feature
469
+ *
470
+ * @param scope
471
+ * @returns
472
+ */
473
+ static abstractionDefinition(
474
+ scope: A_Scope,
475
+ entity: A_Entity,
476
+ feature: A_TYPES__ConceptStage,
477
+ params?: Partial<A_TYPES__ScopeConstructor>
478
+ ): A_TYPES__Required<Partial<A_TYPES__FeatureConstructor>, ['steps', 'fragments', 'name', 'components']>
479
+ static abstractionDefinition(
480
+ scope: A_Scope,
481
+ container: A_Container,
482
+ feature: A_TYPES__ConceptStage,
483
+ params?: Partial<A_TYPES__ScopeConstructor>
484
+ ): A_TYPES__Required<Partial<A_TYPES__FeatureConstructor>, ['steps', 'fragments', 'name', 'components']>
485
+ static abstractionDefinition(
486
+ scope: A_Scope,
487
+ component: A_Component,
488
+ feature: A_TYPES__ConceptStage,
489
+ params?: Partial<A_TYPES__ScopeConstructor>
490
+ ): A_TYPES__Required<Partial<A_TYPES__FeatureConstructor>, ['steps', 'fragments', 'name', 'components']>
491
+ static abstractionDefinition(
492
+ scope: A_Scope,
493
+ param1: A_Component | A_Container | A_Entity,
494
+ param2: A_TYPES__ConceptStage,
495
+ param3?: Partial<A_TYPES__ScopeConstructor>
496
+ ): A_TYPES__Required<Partial<A_TYPES__FeatureConstructor>, ['steps', 'fragments', 'name', 'components']> {
497
+ const instance = this.getInstance();
498
+
499
+ const component = param1;
500
+ const config = param3 || {};
501
+
502
+ let metaKey;
503
+
504
+ switch (true) {
505
+ case component instanceof A_Entity:
506
+ metaKey = A_TYPES__EntityMetaKey.FEATURES;
507
+ break;
508
+ case component instanceof A_Container:
509
+ metaKey = A_TYPES__ContainerMetaKey.ABSTRACTIONS
510
+ break;
511
+ case component instanceof A_Component: {
512
+ metaKey = A_TYPES__ComponentMetaKey.ABSTRACTIONS
513
+ }
514
+ break;
515
+ default:
516
+ throw new Error(`A-Feature cannot be defined on the ${component} level`);
517
+ }
518
+
519
+ const featureDefinition = this.meta(component)
520
+ .get(metaKey)
521
+ .get(param2) || []
522
+
523
+
524
+ const steps: A_TYPES__A_StageStep[] = [
525
+ ...featureDefinition
526
+ ];
527
+
528
+ const feature = `${component.constructor.name}.${param2}`;
529
+
530
+ // We need to get all components that has extensions for the feature in component
531
+ instance.componentsMeta
532
+ .forEach((meta, constructor) => {
533
+ // Just try to make sure that component not only Indexed but also presented in scope
534
+ if (scope.has(constructor))
535
+ // Get all extensions for the feature
536
+ meta
537
+ .abstractions(feature)
538
+ .forEach((declaration) => {
539
+ steps.push({
540
+ component: constructor,
541
+ ...declaration
542
+ });
543
+ });
544
+ });
545
+
472
546
 
547
+ return {
548
+ name: feature,
549
+ fragments: config.fragments || [],
550
+ components: config.components || [],
551
+ entities: config.entities || [],
552
+ steps,
553
+ parent: scope
554
+ };
555
+ }
473
556
 
474
557
  /**
475
558
  * This method returns a step-by-step instructions of feature implementation depending on the feature name and the class.
@@ -479,13 +562,13 @@ export class A_Context {
479
562
  */
480
563
  static feature<T extends Array<string>>(
481
564
  scope: A_Scope,
482
- entity: A_Entity<any, any, T>,
565
+ entity: A_Entity<any, any>,
483
566
  feature: A_TYPES__EntityBaseMethod | string | T[number] | RegExp,
484
567
  params?: Partial<A_TYPES__ScopeConstructor>
485
568
  ): A_Feature
486
569
  static feature<T extends Array<string>>(
487
570
  scope: A_Scope,
488
- container: A_Container<T>,
571
+ container: A_Container,
489
572
  feature: T[number],
490
573
  params?: Partial<A_TYPES__ScopeConstructor>
491
574
  ): A_Feature
@@ -497,7 +580,7 @@ export class A_Context {
497
580
  ): A_Feature
498
581
  static feature<T extends Array<string>>(
499
582
  scope: A_Scope,
500
- param1: A_Component<T> | A_Container<T> | A_Entity<any, any, T>,
583
+ param1: A_Component | A_Container | A_Entity<any, any>,
501
584
  param2: string | T[number],
502
585
  param3?: Partial<A_TYPES__ScopeConstructor>
503
586
  ): A_Feature {
@@ -517,7 +600,7 @@ export class A_Context {
517
600
  */
518
601
  static register(
519
602
  scope: A_Scope,
520
- container: A_Container<any>
603
+ container: A_Container
521
604
  )
522
605
  static register(
523
606
  scope: A_Scope,
@@ -533,12 +616,12 @@ export class A_Context {
533
616
  )
534
617
  static register(
535
618
  scope: A_Scope,
536
- param1: A_Fragment | A_Container<any> | A_Entity | A_Component
619
+ param1: A_Fragment | A_Container | A_Entity | A_Component
537
620
  ) {
538
621
  const instance = this.getInstance();
539
622
 
540
- if (!instance._root)
541
- instance._root = scope.name;
623
+ // if (!instance._root)
624
+ // instance._root = scope.name;
542
625
 
543
626
  switch (true) {
544
627
  case param1 instanceof A_Component:
@@ -1,18 +1,15 @@
1
1
  import {
2
2
  A_CommonHelper,
3
- A_Error, A_TYPES__Required,
3
+ A_Error,
4
4
  ASEID
5
5
  } from "@adaas/a-utils";
6
6
  import {
7
7
  A_TYPES__Entity_JSON,
8
- A_TYPES__EntityBaseMethod,
9
- A_TYPES__EntityBaseMethods,
10
- A_TYPES__EntityCallParams,
11
8
  A_TYPES__IEntity
12
9
  } from "./A-Entity.types";
13
10
  import { A_CONSTANTS__DEFAULT_ERRORS } from "@adaas/a-utils/dist/src/constants/errors.constants";
14
11
  import { A_Context } from "../A-Context/A-Context.class";
15
- import { A_Fragment } from "../A-Fragment/A-Fragment.class";
12
+ import { A_TYPES__FeatureCallParams } from "../A-Feature/A-Feature.types";
16
13
 
17
14
 
18
15
 
@@ -25,8 +22,7 @@ import { A_Fragment } from "../A-Fragment/A-Fragment.class";
25
22
  */
26
23
  export class A_Entity<
27
24
  _ConstructorType = any,
28
- _SerializedType extends A_TYPES__Entity_JSON = A_TYPES__Entity_JSON,
29
- _FeatureNames extends Array<string | A_TYPES__EntityBaseMethod> = A_TYPES__EntityBaseMethods
25
+ _SerializedType extends A_TYPES__Entity_JSON = A_TYPES__Entity_JSON
30
26
  >
31
27
  implements A_TYPES__IEntity {
32
28
 
@@ -57,7 +53,7 @@ export class A_Entity<
57
53
  )
58
54
  constructor(props: string | ASEID | _SerializedType | _ConstructorType) {
59
55
 
60
-
56
+
61
57
  switch (true) {
62
58
  case (typeof props === 'string' && ASEID.isASEID(props)):
63
59
  this.aseid = new ASEID(props);
@@ -139,43 +135,12 @@ export class A_Entity<
139
135
  * @param lifecycleMethod
140
136
  * @param args
141
137
  */
142
- async call(
143
- /**
144
- * A-Feature method name to be called
145
- */
146
- feature: _FeatureNames[number],
147
- ): Promise<any>
148
- async call(
149
- /**
150
- * A-Feature name to be called
151
- */
152
- params: A_TYPES__Required<Partial<A_TYPES__EntityCallParams<_FeatureNames[number]>>, ['name']>,
153
- ): Promise<any>
154
- async call(
155
- /**
156
- * A-Feature method name to be called
157
- */
158
- feature: _FeatureNames[number],
159
- /**
160
- * Parameters to provide additional data to the feature
161
- */
162
- params: Partial<A_TYPES__EntityCallParams<_FeatureNames[number]>>,
163
- ): Promise<any>
164
-
165
- async call(
166
- param1: _FeatureNames[number] | A_TYPES__Required<Partial<A_TYPES__EntityCallParams<_FeatureNames[number]>>, ['name']>,
167
- param2?: Partial<A_TYPES__EntityCallParams<_FeatureNames[number]>>
168
- ): Promise<any> {
169
-
170
- const feature: string = typeof param1 === 'string'
171
- ? param1
172
- : param1.name;
173
- const params: Partial<A_TYPES__EntityCallParams<_FeatureNames[number]>> = typeof param1 === 'string'
174
- ? param2 || {}
175
- : param1;
176
-
177
-
178
- console.log('WTF???? ', A_Context.scope(this))
138
+ async call(
139
+ feature: string,
140
+ params: Partial<A_TYPES__FeatureCallParams> = {}
141
+ ) {
142
+ params.entities = params.entities || [this];
143
+
179
144
 
180
145
  const newFeature = A_Context.feature(A_Context.scope(this), this, feature, params);
181
146
 
@@ -188,33 +153,21 @@ export class A_Entity<
188
153
  // ====================================================================
189
154
 
190
155
 
191
- async load() {
192
- await this.call(A_TYPES__EntityBaseMethod.DESTROY, {
193
- entities: [
194
- this
195
- ]
196
- });
197
- }
198
-
199
-
200
-
201
- async destroy() {
202
- await this.call(A_TYPES__EntityBaseMethod.DESTROY, {
203
- entities: [
204
- this
205
- ],
206
- });
207
- }
208
156
 
157
+ /**
158
+ * The default method that can be called and extended to load entity data.
159
+ */
160
+ async load() { }
209
161
 
162
+ /**
163
+ * The default method that can be called and extended to destroy entity data.
164
+ */
165
+ async destroy() { }
210
166
 
211
- async save() {
212
- await this.call(A_TYPES__EntityBaseMethod.SAVE, {
213
- entities: [
214
- this
215
- ]
216
- });
217
- }
167
+ /**
168
+ * The default method that can be called and extended to save entity data.
169
+ */
170
+ async save() { }
218
171
 
219
172
 
220
173
 
@@ -1,9 +1,10 @@
1
+ import { A_TYPES__A_InjectDecorator_Meta } from "@adaas/a-concept/decorators/A-Inject/A-Inject.decorator.types";
1
2
  import { A_Meta } from "../A-Meta/A-Meta.class";
2
- import { A_TYPES__EntityMeta } from "./A-Entity.types";
3
+ import { A_TYPES__EntityMeta, A_TYPES__EntityMetaKey } from "./A-Entity.types";
3
4
 
4
5
 
5
6
  export class A_EntityMeta extends A_Meta<A_TYPES__EntityMeta> {
6
7
 
7
-
8
+
8
9
 
9
10
  }
@@ -9,7 +9,7 @@ import { A_TYPES__ContainerMeta_FeatureItem } from "../A-Container/A-Container.t
9
9
  export type A_TYPES__EntityCallParams<T extends string> = {
10
10
  name: T,
11
11
  fragments: Array<A_Fragment>,
12
- entities: Array<A_Entity<any, any, any>>,
12
+ entities: Array<A_Entity<any, any>>,
13
13
  components: Array<{ new(...args: any[]): any }>
14
14
  }
15
15
 
@@ -73,6 +73,7 @@ export type A_TYPES__EntityMeta = {
73
73
  export enum A_TYPES__EntityMetaKey {
74
74
  EXTENSIONS = 'a-component-extensions',
75
75
  FEATURES = 'a-component-features',
76
+ ABSTRACTIONS = 'a-component-abstractions',
76
77
  }
77
78
 
78
79
 
@@ -1,15 +1,12 @@
1
+ import { A_Context } from "../A-Context/A-Context.class";
1
2
  import { A_Feature_Define } from "@adaas/a-concept/decorators/A-Feature/A-Feature-Define.decorator";
2
3
  import { A_Feature_Extend } from "@adaas/a-concept/decorators/A-Feature/A-Feature-Extend.decorator";
3
4
  import { A_TYPES__FeatureConstructor, A_TYPES__FeatureState, } from "./A-Feature.types";
4
5
  import { A_Error, A_TYPES__Required } from "@adaas/a-utils";
5
- import { A_Context } from "../A-Context/A-Context.class";
6
6
  import { A_TYPES__A_Feature_Extend } from "@adaas/a-concept/decorators/A-Feature/A-Feature.decorator.types";
7
7
  import { A_Stage } from "../A-Stage/A-Stage.class";
8
- import { A_TYPES__A_StageStep } from "../A-Stage/A-Stage.types";
9
8
  import { StepsManager } from "@adaas/a-concept/helpers/StepsManager.class";
10
9
 
11
-
12
-
13
10
  /**
14
11
  * A_Feature is representing a feature that can be executed across multiple components
15
12
  * This class stores the steps of the feature and executes them in order of appearance
@@ -48,10 +45,12 @@ export class A_Feature {
48
45
  result?: any
49
46
  error?: A_Error
50
47
 
48
+ readonly name: string;
51
49
 
52
50
  constructor(
53
51
  params: A_TYPES__Required<Partial<A_TYPES__FeatureConstructor>, ['steps']>
54
52
  ) {
53
+ this.name = params.name || this.constructor.name;
55
54
 
56
55
  this.SM = new StepsManager(params.steps);
57
56
 
@@ -175,11 +174,23 @@ export class A_Feature {
175
174
  *
176
175
  */
177
176
  async process() {
178
- this.state = A_TYPES__FeatureState.PROCESSING;
177
+ if (this.isDone()) {
178
+ return this.result;
179
+ }
180
+
181
+ try {
182
+ this.state = A_TYPES__FeatureState.PROCESSING;
183
+
184
+ for (const stage of this.stages) {
185
+ await stage.process();
186
+ }
187
+
188
+ await this.completed();
179
189
 
180
- for (const stage of this) {
181
- await stage.process();
190
+ } catch (error) {
191
+ await this.failed(error);
182
192
  }
193
+
183
194
  }
184
195
 
185
196
 
@@ -1,12 +1,20 @@
1
- import { A_TYPES__A_InjectDecorator_Injectable, A_TYPES__A_InjectDecorator_Meta } from "@adaas/a-concept/decorators/A-Inject/A-Inject.decorator.types"
2
- import { A_Component } from "../A-Component/A-Component.class"
3
1
  import { A_TYPES__ScopeConfig, A_TYPES__ScopeConstructor } from "../A-Scope/A-Scope.types"
4
2
  import { A_TYPES__A_StageStep } from "../A-Stage/A-Stage.types"
3
+ import { A_Fragment } from "../A-Fragment/A-Fragment.class"
4
+ import { A_Entity } from "@adaas/a-concept/global/A-Entity/A-Entity.class"
5
5
 
6
6
 
7
7
  export type A_TYPES__FeatureIteratorReturn<T extends any = any> = () => Promise<T>
8
8
 
9
9
 
10
+ export type A_TYPES__FeatureCallParams = {
11
+ fragments: Array<A_Fragment>,
12
+ entities: Array<A_Entity<any, any>>,
13
+ components: Array<{ new(...args: any[]): any }>
14
+ }
15
+
16
+
17
+
10
18
  export type A_TYPES__FeatureConstructor = {
11
19
  steps: A_TYPES__A_StageStep[]
12
20
  } & A_TYPES__ScopeConstructor & A_TYPES__ScopeConfig
@@ -1,11 +1,3 @@
1
- //
2
- //
3
- //
4
- //
5
- //
6
- //
7
-
8
-
9
1
  /**
10
2
  * A Meta is an entity that stores all the metadata for the specific entity like container, component, feature, etc.
11
3
  *
@@ -185,4 +177,9 @@ export class A_Meta<
185
177
  clear(): void {
186
178
  this.meta.clear();
187
179
  }
180
+
181
+
182
+ toArray(): Array<[keyof _StorageItems, _StorageItems[keyof _StorageItems]]> {
183
+ return Array.from(this.meta.entries());
184
+ }
188
185
  }