@nexus-ioc/core 0.4.1 → 0.6.1

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 (373) hide show
  1. package/README.md +20 -9
  2. package/dist/cjs/browser.js.map +1 -0
  3. package/dist/cjs/core/graph/analyze-module.js.map +1 -0
  4. package/dist/cjs/core/graph/analyze-provider.js.map +1 -0
  5. package/dist/cjs/core/graph/helpers/index.js.map +1 -0
  6. package/dist/{core → cjs/core}/graph/module-graph.js +28 -21
  7. package/dist/cjs/core/graph/module-graph.js.map +1 -0
  8. package/dist/cjs/core/graph/providers/analyze-class-provider.js.map +1 -0
  9. package/dist/cjs/core/graph/providers/analyze-factory-provider.js.map +1 -0
  10. package/dist/cjs/core/graph/providers/analyze-function-provider.js.map +1 -0
  11. package/dist/cjs/core/graph/providers/analyze-value-provider.js.map +1 -0
  12. package/dist/cjs/core/graph/providers/provider-factory.js.map +1 -0
  13. package/dist/cjs/core/modules/container.js +182 -0
  14. package/dist/cjs/core/modules/container.js.map +1 -0
  15. package/dist/cjs/core/modules/module-container-factory.js.map +1 -0
  16. package/dist/{core → cjs/core}/modules/module-container.js +0 -1
  17. package/dist/cjs/core/modules/module-container.js.map +1 -0
  18. package/dist/{core → cjs/core}/modules/module-token-factory.js +10 -11
  19. package/dist/cjs/core/modules/module-token-factory.js.map +1 -0
  20. package/dist/cjs/core/modules/modules-container.js.map +1 -0
  21. package/dist/{core → cjs/core}/nexus-applications.browser.js +19 -2
  22. package/dist/cjs/core/nexus-applications.browser.js.map +1 -0
  23. package/dist/cjs/core/nexus-applications.js +204 -0
  24. package/dist/cjs/core/nexus-applications.js.map +1 -0
  25. package/dist/{core → cjs/core}/nexus-applications.server.js +19 -2
  26. package/dist/cjs/core/nexus-applications.server.js.map +1 -0
  27. package/dist/{core → cjs/core}/resolver/providers-container.js +1 -1
  28. package/dist/cjs/core/resolver/providers-container.js.map +1 -0
  29. package/dist/{core → cjs/core}/resolver/resolver.js +53 -14
  30. package/dist/cjs/core/resolver/resolver.js.map +1 -0
  31. package/dist/{decorators → cjs/decorators}/global.js +1 -1
  32. package/dist/cjs/decorators/global.js.map +1 -0
  33. package/dist/{decorators → cjs/decorators}/inject.js +39 -0
  34. package/dist/cjs/decorators/inject.js.map +1 -0
  35. package/dist/cjs/decorators/injectable.js +46 -0
  36. package/dist/cjs/decorators/injectable.js.map +1 -0
  37. package/dist/cjs/decorators/nsModule.js +57 -0
  38. package/dist/cjs/decorators/nsModule.js.map +1 -0
  39. package/dist/cjs/decorators/optional.js +60 -0
  40. package/dist/cjs/decorators/optional.js.map +1 -0
  41. package/dist/{index.js → cjs/index.js} +13 -6
  42. package/dist/cjs/index.js.map +1 -0
  43. package/dist/cjs/interfaces/abstract.interface.js.map +1 -0
  44. package/dist/cjs/interfaces/constants.js.map +1 -0
  45. package/dist/cjs/interfaces/dynamic-module.interface.js.map +1 -0
  46. package/dist/{interfaces → cjs/interfaces}/index.js +6 -6
  47. package/dist/cjs/interfaces/index.js.map +1 -0
  48. package/dist/cjs/interfaces/injectable.interface.js.map +1 -0
  49. package/dist/cjs/interfaces/injection-token.interface.js.map +1 -0
  50. package/dist/cjs/interfaces/module-metadata.interface.js.map +1 -0
  51. package/dist/cjs/interfaces/module-types.interface.js.map +1 -0
  52. package/dist/cjs/interfaces/modules/container.interface.js.map +1 -0
  53. package/dist/{interfaces → cjs/interfaces}/modules/index.js +1 -1
  54. package/dist/cjs/interfaces/modules/index.js.map +1 -0
  55. package/dist/cjs/interfaces/modules/module-container-factory.interface.js.map +1 -0
  56. package/dist/cjs/interfaces/modules/module-container.interface.js.map +1 -0
  57. package/dist/cjs/interfaces/modules/module-graph.interface.js.map +1 -0
  58. package/dist/cjs/interfaces/modules/module-token-factory.interface.js.map +1 -0
  59. package/dist/cjs/interfaces/modules/modules-container.interface.js.map +1 -0
  60. package/dist/cjs/interfaces/modules/provider-token-factory.interface.js.map +1 -0
  61. package/dist/cjs/interfaces/nexus-application.interface.js.map +1 -0
  62. package/dist/cjs/interfaces/on-module-init.interface.js.map +1 -0
  63. package/dist/{interfaces → cjs/interfaces}/plugins/index.js +1 -1
  64. package/dist/cjs/interfaces/plugins/index.js.map +1 -0
  65. package/dist/cjs/interfaces/plugins/module-plugin.interface.js.map +1 -0
  66. package/dist/cjs/interfaces/plugins/scanner-plugin.interface.js.map +1 -0
  67. package/dist/cjs/interfaces/scope.interface.js +59 -0
  68. package/dist/cjs/interfaces/scope.interface.js.map +1 -0
  69. package/dist/cjs/interfaces/type.interface.js.map +1 -0
  70. package/dist/cjs/interfaces/utils/hash-utils.interface.js.map +1 -0
  71. package/dist/cjs/interfaces/utils/index.js.map +1 -0
  72. package/dist/{interfaces → cjs/interfaces}/validate-module-keys.js +1 -1
  73. package/dist/cjs/interfaces/validate-module-keys.js.map +1 -0
  74. package/dist/cjs/server.js.map +1 -0
  75. package/dist/{utils → cjs/utils}/hash-utils.browser.js +5 -3
  76. package/dist/cjs/utils/hash-utils.browser.js.map +1 -0
  77. package/dist/cjs/utils/hash-utils.js +25 -0
  78. package/dist/cjs/utils/hash-utils.js.map +1 -0
  79. package/dist/{utils → cjs/utils}/hash-utils.server.js +5 -3
  80. package/dist/cjs/utils/hash-utils.server.js.map +1 -0
  81. package/dist/{utils → cjs/utils}/helpers.js +2 -7
  82. package/dist/cjs/utils/helpers.js.map +1 -0
  83. package/dist/{utils → cjs/utils}/shared.utils.js +15 -16
  84. package/dist/cjs/utils/shared.utils.js.map +1 -0
  85. package/dist/esm/browser.js +2 -0
  86. package/dist/esm/browser.js.map +1 -0
  87. package/dist/esm/core/graph/analyze-module.js +78 -0
  88. package/dist/esm/core/graph/analyze-module.js.map +1 -0
  89. package/dist/esm/core/graph/analyze-provider.js +53 -0
  90. package/dist/esm/core/graph/analyze-provider.js.map +1 -0
  91. package/dist/esm/core/graph/helpers/index.js +17 -0
  92. package/dist/esm/core/graph/helpers/index.js.map +1 -0
  93. package/dist/esm/core/graph/module-graph.js +402 -0
  94. package/dist/esm/core/graph/module-graph.js.map +1 -0
  95. package/dist/esm/core/graph/providers/analyze-class-provider.js +13 -0
  96. package/dist/esm/core/graph/providers/analyze-class-provider.js.map +1 -0
  97. package/dist/esm/core/graph/providers/analyze-factory-provider.js +13 -0
  98. package/dist/esm/core/graph/providers/analyze-factory-provider.js.map +1 -0
  99. package/dist/esm/core/graph/providers/analyze-function-provider.js +7 -0
  100. package/dist/esm/core/graph/providers/analyze-function-provider.js.map +1 -0
  101. package/dist/esm/core/graph/providers/analyze-value-provider.js +13 -0
  102. package/dist/esm/core/graph/providers/analyze-value-provider.js.map +1 -0
  103. package/dist/esm/core/graph/providers/provider-factory.js +21 -0
  104. package/dist/esm/core/graph/providers/provider-factory.js.map +1 -0
  105. package/dist/esm/core/modules/container.js +178 -0
  106. package/dist/esm/core/modules/container.js.map +1 -0
  107. package/dist/esm/core/modules/module-container-factory.js +21 -0
  108. package/dist/esm/core/modules/module-container-factory.js.map +1 -0
  109. package/dist/esm/core/modules/module-container.js +58 -0
  110. package/dist/esm/core/modules/module-container.js.map +1 -0
  111. package/dist/esm/core/modules/module-token-factory.js +43 -0
  112. package/dist/esm/core/modules/module-token-factory.js.map +1 -0
  113. package/dist/esm/core/modules/modules-container.js +39 -0
  114. package/dist/esm/core/modules/modules-container.js.map +1 -0
  115. package/dist/esm/core/nexus-applications.browser.js +49 -0
  116. package/dist/esm/core/nexus-applications.browser.js.map +1 -0
  117. package/dist/esm/core/nexus-applications.js +200 -0
  118. package/dist/esm/core/nexus-applications.js.map +1 -0
  119. package/dist/esm/core/nexus-applications.server.js +49 -0
  120. package/dist/esm/core/nexus-applications.server.js.map +1 -0
  121. package/dist/esm/core/resolver/providers-container.js +4 -0
  122. package/dist/esm/core/resolver/providers-container.js.map +1 -0
  123. package/dist/esm/core/resolver/resolver.js +161 -0
  124. package/dist/esm/core/resolver/resolver.js.map +1 -0
  125. package/dist/esm/decorators/global.js +9 -0
  126. package/dist/esm/decorators/global.js.map +1 -0
  127. package/dist/esm/decorators/inject.js +63 -0
  128. package/dist/esm/decorators/inject.js.map +1 -0
  129. package/dist/esm/decorators/injectable.js +43 -0
  130. package/dist/esm/decorators/injectable.js.map +1 -0
  131. package/dist/esm/decorators/nsModule.js +54 -0
  132. package/dist/esm/decorators/nsModule.js.map +1 -0
  133. package/dist/esm/decorators/optional.js +57 -0
  134. package/dist/esm/decorators/optional.js.map +1 -0
  135. package/dist/esm/index.js +12 -0
  136. package/dist/esm/index.js.map +1 -0
  137. package/dist/esm/interfaces/abstract.interface.js +2 -0
  138. package/dist/esm/interfaces/abstract.interface.js.map +1 -0
  139. package/dist/esm/interfaces/constants.js +13 -0
  140. package/dist/esm/interfaces/constants.js.map +1 -0
  141. package/dist/esm/interfaces/dynamic-module.interface.js +2 -0
  142. package/dist/esm/interfaces/dynamic-module.interface.js.map +1 -0
  143. package/dist/esm/interfaces/index.js +16 -0
  144. package/dist/esm/interfaces/index.js.map +1 -0
  145. package/dist/esm/interfaces/injectable.interface.js +2 -0
  146. package/dist/esm/interfaces/injectable.interface.js.map +1 -0
  147. package/dist/esm/interfaces/injection-token.interface.js +2 -0
  148. package/dist/esm/interfaces/injection-token.interface.js.map +1 -0
  149. package/dist/esm/interfaces/module-metadata.interface.js +2 -0
  150. package/dist/esm/interfaces/module-metadata.interface.js.map +1 -0
  151. package/dist/esm/interfaces/module-types.interface.js +2 -0
  152. package/dist/esm/interfaces/module-types.interface.js.map +1 -0
  153. package/dist/esm/interfaces/modules/container.interface.js +2 -0
  154. package/dist/esm/interfaces/modules/container.interface.js.map +1 -0
  155. package/dist/esm/interfaces/modules/index.js +8 -0
  156. package/dist/esm/interfaces/modules/index.js.map +1 -0
  157. package/dist/esm/interfaces/modules/module-container-factory.interface.js +2 -0
  158. package/dist/esm/interfaces/modules/module-container-factory.interface.js.map +1 -0
  159. package/dist/esm/interfaces/modules/module-container.interface.js +2 -0
  160. package/dist/esm/interfaces/modules/module-container.interface.js.map +1 -0
  161. package/dist/esm/interfaces/modules/module-graph.interface.js +13 -0
  162. package/dist/esm/interfaces/modules/module-graph.interface.js.map +1 -0
  163. package/dist/esm/interfaces/modules/module-token-factory.interface.js +2 -0
  164. package/dist/esm/interfaces/modules/module-token-factory.interface.js.map +1 -0
  165. package/dist/esm/interfaces/modules/modules-container.interface.js +2 -0
  166. package/dist/esm/interfaces/modules/modules-container.interface.js.map +1 -0
  167. package/dist/esm/interfaces/modules/provider-token-factory.interface.js +2 -0
  168. package/dist/esm/interfaces/modules/provider-token-factory.interface.js.map +1 -0
  169. package/dist/esm/interfaces/nexus-application.interface.js +2 -0
  170. package/dist/esm/interfaces/nexus-application.interface.js.map +1 -0
  171. package/dist/esm/interfaces/on-module-init.interface.js +2 -0
  172. package/dist/esm/interfaces/on-module-init.interface.js.map +1 -0
  173. package/dist/esm/interfaces/plugins/index.js +3 -0
  174. package/dist/esm/interfaces/plugins/index.js.map +1 -0
  175. package/dist/esm/interfaces/plugins/module-plugin.interface.js +2 -0
  176. package/dist/esm/interfaces/plugins/module-plugin.interface.js.map +1 -0
  177. package/dist/esm/interfaces/plugins/scanner-plugin.interface.js +2 -0
  178. package/dist/esm/interfaces/plugins/scanner-plugin.interface.js.map +1 -0
  179. package/dist/esm/interfaces/scope.interface.js +56 -0
  180. package/dist/esm/interfaces/scope.interface.js.map +1 -0
  181. package/dist/esm/interfaces/type.interface.js +2 -0
  182. package/dist/esm/interfaces/type.interface.js.map +1 -0
  183. package/dist/esm/interfaces/utils/hash-utils.interface.js +2 -0
  184. package/dist/esm/interfaces/utils/hash-utils.interface.js.map +1 -0
  185. package/dist/esm/interfaces/utils/index.js +2 -0
  186. package/dist/esm/interfaces/utils/index.js.map +1 -0
  187. package/dist/esm/interfaces/validate-module-keys.js +21 -0
  188. package/dist/esm/interfaces/validate-module-keys.js.map +1 -0
  189. package/dist/esm/package.json +1 -0
  190. package/dist/esm/server.js +2 -0
  191. package/dist/esm/server.js.map +1 -0
  192. package/dist/esm/utils/hash-utils.browser.js +20 -0
  193. package/dist/esm/utils/hash-utils.browser.js.map +1 -0
  194. package/dist/esm/utils/hash-utils.js +21 -0
  195. package/dist/esm/utils/hash-utils.js.map +1 -0
  196. package/dist/esm/utils/hash-utils.server.js +17 -0
  197. package/dist/esm/utils/hash-utils.server.js.map +1 -0
  198. package/dist/esm/utils/helpers.js +63 -0
  199. package/dist/esm/utils/helpers.js.map +1 -0
  200. package/dist/esm/utils/shared.utils.js +49 -0
  201. package/dist/esm/utils/shared.utils.js.map +1 -0
  202. package/dist/tsconfig.cjs.tsbuildinfo +1 -0
  203. package/dist/tsconfig.esm.tsbuildinfo +1 -0
  204. package/dist/{core → types/core}/graph/analyze-module.d.ts +4 -4
  205. package/dist/{core → types/core}/graph/analyze-provider.d.ts +4 -4
  206. package/dist/{core → types/core}/graph/module-graph.d.ts +1 -1
  207. package/dist/{core → types/core}/graph/providers/analyze-class-provider.d.ts +2 -2
  208. package/dist/{core → types/core}/graph/providers/analyze-factory-provider.d.ts +2 -2
  209. package/dist/{core → types/core}/graph/providers/analyze-value-provider.d.ts +1 -1
  210. package/dist/types/core/modules/container.d.ts +154 -0
  211. package/dist/{core → types/core}/modules/module-container.d.ts +1 -1
  212. package/dist/{core → types/core}/modules/module-token-factory.d.ts +1 -1
  213. package/dist/{core → types/core}/nexus-applications.browser.d.ts +9 -1
  214. package/dist/types/core/nexus-applications.d.ts +160 -0
  215. package/dist/{core → types/core}/nexus-applications.server.d.ts +9 -1
  216. package/dist/types/decorators/inject.d.ts +42 -0
  217. package/dist/types/decorators/injectable.d.ts +37 -0
  218. package/dist/types/decorators/nsModule.d.ts +44 -0
  219. package/dist/types/decorators/optional.d.ts +42 -0
  220. package/dist/{index.d.ts → types/index.d.ts} +6 -3
  221. package/dist/types/interfaces/module-types.interface.d.ts +158 -0
  222. package/dist/types/interfaces/modules/container.interface.d.ts +8 -0
  223. package/dist/types/interfaces/modules/module-container.interface.d.ts +1 -0
  224. package/dist/{interfaces → types/interfaces}/modules/module-graph.interface.d.ts +3 -23
  225. package/dist/{interfaces → types/interfaces}/nexus-application.interface.d.ts +2 -0
  226. package/dist/types/interfaces/on-module-init.interface.d.ts +51 -0
  227. package/dist/types/interfaces/scope.interface.d.ts +54 -0
  228. package/dist/types/interfaces/utils/hash-utils.interface.d.ts +1 -0
  229. package/dist/{interfaces → types/interfaces}/validate-module-keys.d.ts +1 -1
  230. package/dist/{utils → types/utils}/hash-utils.browser.d.ts +2 -1
  231. package/dist/types/utils/hash-utils.d.ts +7 -0
  232. package/dist/{utils → types/utils}/hash-utils.server.d.ts +2 -1
  233. package/dist/{utils → types/utils}/helpers.d.ts +0 -1
  234. package/package.json +83 -61
  235. package/dist/browser.js.map +0 -1
  236. package/dist/core/graph/analyze-module.js.map +0 -1
  237. package/dist/core/graph/analyze-provider.js.map +0 -1
  238. package/dist/core/graph/helpers/index.js.map +0 -1
  239. package/dist/core/graph/module-graph.js.map +0 -1
  240. package/dist/core/graph/providers/analyze-class-provider.js.map +0 -1
  241. package/dist/core/graph/providers/analyze-factory-provider.js.map +0 -1
  242. package/dist/core/graph/providers/analyze-function-provider.js.map +0 -1
  243. package/dist/core/graph/providers/analyze-value-provider.js.map +0 -1
  244. package/dist/core/graph/providers/provider-factory.js.map +0 -1
  245. package/dist/core/modules/container.d.ts +0 -15
  246. package/dist/core/modules/container.js +0 -40
  247. package/dist/core/modules/container.js.map +0 -1
  248. package/dist/core/modules/module-container-factory.js.map +0 -1
  249. package/dist/core/modules/module-container.js.map +0 -1
  250. package/dist/core/modules/module-token-factory.js.map +0 -1
  251. package/dist/core/modules/modules-container.js.map +0 -1
  252. package/dist/core/nexus-applications.browser.js.map +0 -1
  253. package/dist/core/nexus-applications.server.js.map +0 -1
  254. package/dist/core/resolver/providers-container.js.map +0 -1
  255. package/dist/core/resolver/resolver.js.map +0 -1
  256. package/dist/decorators/global.js.map +0 -1
  257. package/dist/decorators/inject.d.ts +0 -3
  258. package/dist/decorators/inject.js.map +0 -1
  259. package/dist/decorators/injectable.d.ts +0 -3
  260. package/dist/decorators/injectable.js +0 -12
  261. package/dist/decorators/injectable.js.map +0 -1
  262. package/dist/decorators/nsModule.d.ts +0 -3
  263. package/dist/decorators/nsModule.js +0 -16
  264. package/dist/decorators/nsModule.js.map +0 -1
  265. package/dist/decorators/optional.d.ts +0 -2
  266. package/dist/decorators/optional.js +0 -20
  267. package/dist/decorators/optional.js.map +0 -1
  268. package/dist/errors/container-not-compiled.error.d.ts +0 -3
  269. package/dist/errors/container-not-compiled.error.js +0 -12
  270. package/dist/errors/container-not-compiled.error.js.map +0 -1
  271. package/dist/index.js.map +0 -1
  272. package/dist/interfaces/abstract.interface.js.map +0 -1
  273. package/dist/interfaces/constants.js.map +0 -1
  274. package/dist/interfaces/dynamic-module.interface.js.map +0 -1
  275. package/dist/interfaces/index.js.map +0 -1
  276. package/dist/interfaces/injectable.interface.js.map +0 -1
  277. package/dist/interfaces/injection-token.interface.js.map +0 -1
  278. package/dist/interfaces/module-metadata.interface.js.map +0 -1
  279. package/dist/interfaces/module-types.interface.d.ts +0 -20
  280. package/dist/interfaces/module-types.interface.js.map +0 -1
  281. package/dist/interfaces/modules/container.interface.d.ts +0 -16
  282. package/dist/interfaces/modules/container.interface.js.map +0 -1
  283. package/dist/interfaces/modules/index.js.map +0 -1
  284. package/dist/interfaces/modules/module-container-factory.interface.js.map +0 -1
  285. package/dist/interfaces/modules/module-container.interface.d.ts +0 -13
  286. package/dist/interfaces/modules/module-container.interface.js.map +0 -1
  287. package/dist/interfaces/modules/module-graph.interface.js.map +0 -1
  288. package/dist/interfaces/modules/module-token-factory.interface.js.map +0 -1
  289. package/dist/interfaces/modules/modules-container.interface.js.map +0 -1
  290. package/dist/interfaces/modules/provider-token-factory.interface.js.map +0 -1
  291. package/dist/interfaces/nexus-application.interface.js.map +0 -1
  292. package/dist/interfaces/on-module-init.interface.d.ts +0 -3
  293. package/dist/interfaces/on-module-init.interface.js.map +0 -1
  294. package/dist/interfaces/plugins/index.js.map +0 -1
  295. package/dist/interfaces/plugins/module-plugin.interface.js.map +0 -1
  296. package/dist/interfaces/plugins/scanner-plugin.interface.js.map +0 -1
  297. package/dist/interfaces/scope.interface.d.ts +0 -4
  298. package/dist/interfaces/scope.interface.js +0 -9
  299. package/dist/interfaces/scope.interface.js.map +0 -1
  300. package/dist/interfaces/type.interface.js.map +0 -1
  301. package/dist/interfaces/utils/hash-utils.interface.d.ts +0 -5
  302. package/dist/interfaces/utils/hash-utils.interface.js.map +0 -1
  303. package/dist/interfaces/utils/index.js.map +0 -1
  304. package/dist/interfaces/validate-module-keys.js.map +0 -1
  305. package/dist/server.js.map +0 -1
  306. package/dist/utils/hash-utils.browser.js.map +0 -1
  307. package/dist/utils/hash-utils.server.js.map +0 -1
  308. package/dist/utils/helpers.js.map +0 -1
  309. package/dist/utils/random-string-generator.util.d.ts +0 -1
  310. package/dist/utils/random-string-generator.util.js +0 -7
  311. package/dist/utils/random-string-generator.util.js.map +0 -1
  312. package/dist/utils/shared.utils.js.map +0 -1
  313. package/dist/{browser.js → cjs/browser.js} +0 -0
  314. package/dist/{core → cjs/core}/graph/analyze-module.js +0 -0
  315. package/dist/{core → cjs/core}/graph/analyze-provider.js +0 -0
  316. package/dist/{core → cjs/core}/graph/helpers/index.js +0 -0
  317. package/dist/{core → cjs/core}/graph/providers/analyze-class-provider.js +0 -0
  318. package/dist/{core → cjs/core}/graph/providers/analyze-factory-provider.js +0 -0
  319. package/dist/{core → cjs/core}/graph/providers/analyze-function-provider.js +0 -0
  320. package/dist/{core → cjs/core}/graph/providers/analyze-value-provider.js +0 -0
  321. package/dist/{core → cjs/core}/graph/providers/provider-factory.js +0 -0
  322. package/dist/{core → cjs/core}/modules/module-container-factory.js +0 -0
  323. package/dist/{core → cjs/core}/modules/modules-container.js +0 -0
  324. package/dist/{interfaces → cjs/interfaces}/abstract.interface.js +0 -0
  325. package/dist/{interfaces → cjs/interfaces}/constants.js +0 -0
  326. package/dist/{interfaces → cjs/interfaces}/dynamic-module.interface.js +0 -0
  327. package/dist/{interfaces → cjs/interfaces}/injectable.interface.js +0 -0
  328. package/dist/{interfaces → cjs/interfaces}/injection-token.interface.js +0 -0
  329. package/dist/{interfaces → cjs/interfaces}/module-metadata.interface.js +0 -0
  330. package/dist/{interfaces → cjs/interfaces}/module-types.interface.js +0 -0
  331. package/dist/{interfaces → cjs/interfaces}/modules/container.interface.js +0 -0
  332. package/dist/{interfaces → cjs/interfaces}/modules/module-container-factory.interface.js +0 -0
  333. package/dist/{interfaces → cjs/interfaces}/modules/module-container.interface.js +0 -0
  334. package/dist/{interfaces → cjs/interfaces}/modules/module-graph.interface.js +0 -0
  335. package/dist/{interfaces → cjs/interfaces}/modules/module-token-factory.interface.js +0 -0
  336. package/dist/{interfaces → cjs/interfaces}/modules/modules-container.interface.js +0 -0
  337. package/dist/{interfaces → cjs/interfaces}/modules/provider-token-factory.interface.js +0 -0
  338. package/dist/{interfaces → cjs/interfaces}/nexus-application.interface.js +0 -0
  339. package/dist/{interfaces → cjs/interfaces}/on-module-init.interface.js +0 -0
  340. package/dist/{interfaces → cjs/interfaces}/plugins/module-plugin.interface.js +0 -0
  341. package/dist/{interfaces → cjs/interfaces}/plugins/scanner-plugin.interface.js +0 -0
  342. package/dist/{interfaces → cjs/interfaces}/type.interface.js +0 -0
  343. package/dist/{interfaces → cjs/interfaces}/utils/hash-utils.interface.js +0 -0
  344. package/dist/{interfaces → cjs/interfaces}/utils/index.js +0 -0
  345. package/dist/{server.js → cjs/server.js} +0 -0
  346. package/dist/{browser.d.ts → types/browser.d.ts} +0 -0
  347. package/dist/{core → types/core}/graph/helpers/index.d.ts +0 -0
  348. package/dist/{core → types/core}/graph/providers/analyze-function-provider.d.ts +0 -0
  349. package/dist/{core → types/core}/graph/providers/provider-factory.d.ts +0 -0
  350. package/dist/{core → types/core}/modules/module-container-factory.d.ts +0 -0
  351. package/dist/{core → types/core}/modules/modules-container.d.ts +0 -0
  352. package/dist/{core → types/core}/resolver/providers-container.d.ts +0 -0
  353. package/dist/{core → types/core}/resolver/resolver.d.ts +0 -0
  354. package/dist/{decorators → types/decorators}/global.d.ts +0 -0
  355. package/dist/{interfaces → types/interfaces}/abstract.interface.d.ts +0 -0
  356. package/dist/{interfaces → types/interfaces}/constants.d.ts +0 -0
  357. package/dist/{interfaces → types/interfaces}/dynamic-module.interface.d.ts +0 -0
  358. package/dist/{interfaces → types/interfaces}/index.d.ts +6 -6
  359. package/dist/{interfaces → types/interfaces}/injectable.interface.d.ts +0 -0
  360. package/dist/{interfaces → types/interfaces}/injection-token.interface.d.ts +0 -0
  361. package/dist/{interfaces → types/interfaces}/module-metadata.interface.d.ts +0 -0
  362. package/dist/{interfaces → types/interfaces}/modules/index.d.ts +1 -1
  363. package/dist/{interfaces → types/interfaces}/modules/module-container-factory.interface.d.ts +0 -0
  364. package/dist/{interfaces → types/interfaces}/modules/module-token-factory.interface.d.ts +0 -0
  365. package/dist/{interfaces → types/interfaces}/modules/modules-container.interface.d.ts +0 -0
  366. package/dist/{interfaces → types/interfaces}/modules/provider-token-factory.interface.d.ts +0 -0
  367. package/dist/{interfaces → types/interfaces}/plugins/index.d.ts +1 -1
  368. /package/dist/{interfaces → types/interfaces}/plugins/module-plugin.interface.d.ts +0 -0
  369. /package/dist/{interfaces → types/interfaces}/plugins/scanner-plugin.interface.d.ts +0 -0
  370. /package/dist/{interfaces → types/interfaces}/type.interface.d.ts +0 -0
  371. /package/dist/{interfaces → types/interfaces}/utils/index.d.ts +0 -0
  372. /package/dist/{server.d.ts → types/server.d.ts} +0 -0
  373. /package/dist/{utils → types/utils}/shared.utils.d.ts +0 -0
@@ -0,0 +1,178 @@
1
+ import { ModuleGraph } from "../graph/module-graph.js";
2
+ import { Resolver } from "../resolver/resolver.js";
3
+ import { ModulesContainer } from "./modules-container.js";
4
+ /**
5
+ * Container is the core IoC (Inversion of Control) container that manages
6
+ * modules, providers, and dependency injection.
7
+ *
8
+ * The Container is responsible for:
9
+ * - Registering and managing modules
10
+ * - Building the dependency graph
11
+ * - Resolving dependencies and creating instances
12
+ * - Managing the lifecycle of providers
13
+ *
14
+ * @example
15
+ * ```typescript
16
+ * const container = new Container(hashUtils);
17
+ * await container.run(AppModule);
18
+ * const service = await container.get(MyService);
19
+ * ```
20
+ */
21
+ export class Container {
22
+ /**
23
+ * Creates a new Container instance.
24
+ *
25
+ * @param hashUtils - Utility for generating unique hashes for modules
26
+ */
27
+ constructor(hashUtils) {
28
+ this.hashUtils = hashUtils;
29
+ this.modulesContainer = new ModulesContainer(this.hashUtils, this);
30
+ this._graph = null;
31
+ this.moduleGraphResolver = null;
32
+ }
33
+ /**
34
+ * Adds a module to the container.
35
+ *
36
+ * This method registers a module and all its providers, imports, and exports
37
+ * in the container. The module can be either a static module class or a
38
+ * dynamic module with runtime configuration.
39
+ *
40
+ * @param module - The module to add (static or dynamic)
41
+ * @returns A promise that resolves to the module container
42
+ *
43
+ * @example
44
+ * ```typescript
45
+ * await container.addModule(AppModule);
46
+ * await container.addModule(DatabaseModule.forRoot({ host: 'localhost' }));
47
+ * ```
48
+ */
49
+ async addModule(module) {
50
+ return await this.modulesContainer.addModule(module);
51
+ }
52
+ /**
53
+ * Replaces an existing module with a new module.
54
+ *
55
+ * This is useful for hot module replacement or testing scenarios where
56
+ * you need to swap out a module implementation.
57
+ *
58
+ * @param moduleToReplace - The module to be replaced
59
+ * @param newModule - The new module to use instead
60
+ * @returns A promise that resolves to the new module container
61
+ *
62
+ * @example
63
+ * ```typescript
64
+ * await container.replaceModule(OldDatabaseModule, NewDatabaseModule);
65
+ * ```
66
+ */
67
+ async replaceModule(moduleToReplace, newModule) {
68
+ return await this.modulesContainer.replaceModule(moduleToReplace, newModule);
69
+ }
70
+ /**
71
+ * Retrieves a module container by its module class.
72
+ *
73
+ * @param module - The module class to look up
74
+ * @returns A promise that resolves to the module container, or undefined if not found
75
+ *
76
+ * @example
77
+ * ```typescript
78
+ * const moduleContainer = await container.getModule(DatabaseModule);
79
+ * ```
80
+ */
81
+ async getModule(module) {
82
+ return this.modulesContainer.getModule(module);
83
+ }
84
+ /**
85
+ * Resolves and returns an instance of a provider by its injection token.
86
+ *
87
+ * This is the main method for retrieving dependencies from the container.
88
+ * The instance is created according to its scope:
89
+ * - Singleton: Same instance returned every time
90
+ * - Request: New instance for each get() call
91
+ * - Transient: New instance every time, even within the same dependency tree
92
+ *
93
+ * @template T - The type of the provider to resolve
94
+ * @param token - The injection token (class, string, or symbol)
95
+ * @returns A promise that resolves to the provider instance, or undefined if not found
96
+ *
97
+ * @example
98
+ * ```typescript
99
+ * const userService = await container.get(UserService);
100
+ * const config = await container.get('CONFIG');
101
+ * ```
102
+ */
103
+ async get(token) {
104
+ return this.moduleGraphResolver?.resolveProvider(token);
105
+ }
106
+ /**
107
+ * Initializes and runs the container with the specified root module.
108
+ *
109
+ * This method:
110
+ * 1. Registers the root module and all its dependencies
111
+ * 2. Builds the dependency graph
112
+ * 3. Validates the graph for circular dependencies and missing providers
113
+ * 4. Initializes all providers with lifecycle hooks
114
+ *
115
+ * This method must be called before using get() to resolve dependencies.
116
+ *
117
+ * @param rootModule - The root module of the application
118
+ * @returns A promise that resolves when initialization is complete
119
+ * @throws {Error} If there are circular dependencies or missing providers
120
+ *
121
+ * @example
122
+ * ```typescript
123
+ * const container = new Container(hashUtils);
124
+ * await container.run(AppModule);
125
+ * // Now you can use container.get() to resolve dependencies
126
+ * ```
127
+ */
128
+ async run(rootModule) {
129
+ const root = await this.modulesContainer.addModule(rootModule);
130
+ this._graph = new ModuleGraph(root);
131
+ this.moduleGraphResolver = new Resolver(this._graph);
132
+ await this._graph.compile();
133
+ }
134
+ /**
135
+ * Gets the dependency graph.
136
+ *
137
+ * The graph contains all modules, providers, and their dependencies.
138
+ * It can be used for introspection and debugging.
139
+ *
140
+ * @returns The module graph
141
+ * @throws {Error} If the graph is not initialized (run() not called yet)
142
+ *
143
+ * @example
144
+ * ```typescript
145
+ * await container.run(AppModule);
146
+ * const graph = container.graph;
147
+ * console.log(graph.getAllNodes());
148
+ * ```
149
+ */
150
+ get graph() {
151
+ if (!this._graph) {
152
+ throw new Error("Graph is not initialized. Call run() method before accessing the graph.");
153
+ }
154
+ return this._graph;
155
+ }
156
+ /**
157
+ * Gets all errors that occurred during graph compilation.
158
+ *
159
+ * Errors can include:
160
+ * - Circular dependencies
161
+ * - Missing providers
162
+ * - Unreachable dependencies
163
+ *
164
+ * @returns An array of graph errors
165
+ *
166
+ * @example
167
+ * ```typescript
168
+ * await container.run(AppModule);
169
+ * if (container.errors.length > 0) {
170
+ * console.error('Graph errors:', container.errors);
171
+ * }
172
+ * ```
173
+ */
174
+ get errors() {
175
+ return this.graph.errors;
176
+ }
177
+ }
178
+ //# sourceMappingURL=container.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"container.js","sourceRoot":"","sources":["../../../../src/core/modules/container.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEvD;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,OAAO,SAAS;IASrB;;;;OAIG;IACH,YAA6B,SAA4B;QAA5B,cAAS,GAAT,SAAS,CAAmB;QAbxC,qBAAgB,GAAG,IAAI,gBAAgB,CACvD,IAAI,CAAC,SAAS,EACd,IAAI,CACJ,CAAC;QAEM,WAAM,GAAgC,IAAI,CAAC;QAC3C,wBAAmB,GAAoB,IAAI,CAAC;IAOQ,CAAC;IAE7D;;;;;;;;;;;;;;;OAeG;IACI,KAAK,CAAC,SAAS,CACrB,MAA8B;QAE9B,OAAO,MAAM,IAAI,CAAC,gBAAgB,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;IACtD,CAAC;IAED;;;;;;;;;;;;;;OAcG;IACI,KAAK,CAAC,aAAa,CACzB,eAAuB,EACvB,SAAiB;QAEjB,OAAO,MAAM,IAAI,CAAC,gBAAgB,CAAC,aAAa,CAC/C,eAAe,EACf,SAAS,CACT,CAAC;IACH,CAAC;IAED;;;;;;;;;;OAUG;IACI,KAAK,CAAC,SAAS,CACrB,MAAc;QAEd,OAAO,IAAI,CAAC,gBAAgB,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;IAChD,CAAC;IAED;;;;;;;;;;;;;;;;;;OAkBG;IACI,KAAK,CAAC,GAAG,CAAI,KAAqB;QACxC,OAAO,IAAI,CAAC,mBAAmB,EAAE,eAAe,CAAI,KAAK,CAAC,CAAC;IAC5D,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;OAqBG;IACI,KAAK,CAAC,GAAG,CAAC,UAAkB;QAClC,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,gBAAgB,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;QAE/D,IAAI,CAAC,MAAM,GAAG,IAAI,WAAW,CAAC,IAAI,CAAC,CAAC;QAEpC,IAAI,CAAC,mBAAmB,GAAG,IAAI,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAErD,MAAM,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;IAC7B,CAAC;IAED;;;;;;;;;;;;;;;OAeG;IACH,IAAW,KAAK;QACf,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;YAClB,MAAM,IAAI,KAAK,CACd,yEAAyE,CACzE,CAAC;QACH,CAAC;QACD,OAAO,IAAI,CAAC,MAAM,CAAC;IACpB,CAAC;IAED;;;;;;;;;;;;;;;;;OAiBG;IACH,IAAW,MAAM;QAChB,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC;IAC1B,CAAC;CACD"}
@@ -0,0 +1,21 @@
1
+ import "reflect-metadata";
2
+ import { MODULE_TOKEN_WATERMARK } from "../../interfaces/index.js";
3
+ import { ModuleContainer } from "./module-container.js";
4
+ export class ModuleContainerFactory {
5
+ constructor(moduleTokenFactory) {
6
+ this.moduleTokenFactory = moduleTokenFactory;
7
+ }
8
+ async create(module, container) {
9
+ const moduleContainer = new ModuleContainer(module, container);
10
+ moduleContainer.token = await this.getModuleToken(module);
11
+ Reflect.defineMetadata(MODULE_TOKEN_WATERMARK, moduleContainer.token, module);
12
+ return moduleContainer;
13
+ }
14
+ getModuleToken(module) {
15
+ return this.moduleTokenFactory.create(module);
16
+ }
17
+ async getModuleContainerImports(module) {
18
+ return await module.imports;
19
+ }
20
+ }
21
+ //# sourceMappingURL=module-container-factory.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"module-container-factory.js","sourceRoot":"","sources":["../../../../src/core/modules/module-container-factory.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,CAAC;AAS1B,OAAO,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAErD,MAAM,OAAO,sBAAsB;IAClC,YACkB,kBAA+C;QAA/C,uBAAkB,GAAlB,kBAAkB,CAA6B;IAC9D,CAAC;IAEG,KAAK,CAAC,MAAM,CAClB,MAA8B,EAC9B,SAAiC;QAEjC,MAAM,eAAe,GAAG,IAAI,eAAe,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;QAE/D,eAAe,CAAC,KAAK,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;QAE1D,OAAO,CAAC,cAAc,CACrB,sBAAsB,EACtB,eAAe,CAAC,KAAK,EACrB,MAAM,CACN,CAAC;QAEF,OAAO,eAAe,CAAC;IACxB,CAAC;IAEM,cAAc,CAAC,MAA8B;QACnD,OAAO,IAAI,CAAC,kBAAkB,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IAC/C,CAAC;IAEM,KAAK,CAAC,yBAAyB,CACrC,MAAgC;QAEhC,OAAO,MAAM,MAAM,CAAC,OAAO,CAAC;IAC7B,CAAC;CACD"}
@@ -0,0 +1,58 @@
1
+ import "reflect-metadata";
2
+ import { MODULE_METADATA } from "../../interfaces/index.js";
3
+ import { isDynamicModule } from "../../utils/helpers.js";
4
+ export class ModuleContainer {
5
+ constructor(_metatype, container) {
6
+ this._metatype = _metatype;
7
+ this.container = container;
8
+ this._token = "";
9
+ }
10
+ get token() {
11
+ return this._token;
12
+ }
13
+ set token(value) {
14
+ this._token = value;
15
+ }
16
+ get metatype() {
17
+ return this._metatype;
18
+ }
19
+ get imports() {
20
+ let modules;
21
+ if (isDynamicModule(this.metatype)) {
22
+ modules = this.metatype.imports || [];
23
+ }
24
+ else {
25
+ modules =
26
+ Reflect.getMetadata(MODULE_METADATA.IMPORTS, this.metatype) || [];
27
+ }
28
+ const self = this;
29
+ return new Promise((resolved) => {
30
+ async function run() {
31
+ const imports = await Promise.all(modules.map((item) => {
32
+ return self.container.addModule(item);
33
+ }));
34
+ resolved(imports);
35
+ }
36
+ run();
37
+ });
38
+ }
39
+ get providers() {
40
+ if (isDynamicModule(this.metatype)) {
41
+ return this.metatype.providers || [];
42
+ }
43
+ return Reflect.getMetadata(MODULE_METADATA.PROVIDERS, this.metatype) || [];
44
+ }
45
+ get exports() {
46
+ if (isDynamicModule(this.metatype)) {
47
+ return this.metatype.exports || [];
48
+ }
49
+ return Reflect.getMetadata(MODULE_METADATA.EXPORTS, this.metatype) || [];
50
+ }
51
+ get(token) {
52
+ return this.container.get(token);
53
+ }
54
+ get errors() {
55
+ return this.container.errors;
56
+ }
57
+ }
58
+ //# sourceMappingURL=module-container.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"module-container.js","sourceRoot":"","sources":["../../../../src/core/modules/module-container.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,CAAC;AAS1B,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAEtD,MAAM,OAAO,eAAe;IAG3B,YACkB,SAAiC,EACjC,SAAiC;QADjC,cAAS,GAAT,SAAS,CAAwB;QACjC,cAAS,GAAT,SAAS,CAAwB;QAJ3C,WAAM,GAAG,EAAE,CAAC;IAKjB,CAAC;IAEJ,IAAW,KAAK;QACf,OAAO,IAAI,CAAC,MAAM,CAAC;IACpB,CAAC;IAED,IAAW,KAAK,CAAC,KAAa;QAC7B,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;IACrB,CAAC;IAED,IAAW,QAAQ;QAClB,OAAO,IAAI,CAAC,SAAS,CAAC;IACvB,CAAC;IAED,IAAW,OAAO;QACjB,IAAI,OAAmC,CAAC;QACxC,IAAI,eAAe,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC;YACpC,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC,OAAO,IAAI,EAAE,CAAC;QACvC,CAAC;aAAM,CAAC;YACP,OAAO;gBACN,OAAO,CAAC,WAAW,CAAC,eAAe,CAAC,OAAO,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;QACpE,CAAC;QAED,MAAM,IAAI,GAAG,IAAI,CAAC;QAClB,OAAO,IAAI,OAAO,CAA6B,CAAC,QAAQ,EAAE,EAAE;YAC3D,KAAK,UAAU,GAAG;gBACjB,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,GAAG,CAChC,OAAO,CAAC,GAAG,CAAC,CAAC,IAA4B,EAAE,EAAE;oBAC5C,OAAO,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;gBACvC,CAAC,CAAC,CACF,CAAC;gBAEF,QAAQ,CAAC,OAAO,CAAC,CAAC;YACnB,CAAC;YAED,GAAG,EAAE,CAAC;QACP,CAAC,CAAC,CAAC;IACJ,CAAC;IAED,IAAW,SAAS;QACnB,IAAI,eAAe,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC;YACpC,OAAO,IAAI,CAAC,QAAQ,CAAC,SAAS,IAAI,EAAE,CAAC;QACtC,CAAC;QAED,OAAO,OAAO,CAAC,WAAW,CAAC,eAAe,CAAC,SAAS,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;IAC5E,CAAC;IAED,IAAW,OAAO;QACjB,IAAI,eAAe,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC;YACpC,OAAO,IAAI,CAAC,QAAQ,CAAC,OAAO,IAAI,EAAE,CAAC;QACpC,CAAC;QAED,OAAO,OAAO,CAAC,WAAW,CAAC,eAAe,CAAC,OAAO,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;IAC1E,CAAC;IAEM,GAAG,CAAI,KAAqB;QAClC,OAAO,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IAClC,CAAC;IAED,IAAW,MAAM;QAChB,OAAO,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC;IAC9B,CAAC;CACD"}
@@ -0,0 +1,43 @@
1
+ import { isDynamicModule } from "../../utils/helpers.js";
2
+ export class ModuleTokenFactory {
3
+ constructor(hashUtils) {
4
+ this.hashUtils = hashUtils;
5
+ this.moduleTokenCache = new Map();
6
+ this.moduleTokens = new WeakMap();
7
+ this.moduleIdsCache = new WeakMap();
8
+ }
9
+ async create(metatype) {
10
+ const moduleToken = this.moduleTokens.get(metatype);
11
+ if (moduleToken) {
12
+ return moduleToken;
13
+ }
14
+ const token = await this.getStaticModuleToken(this.getMetatypeId(metatype), this.getModuleName(metatype));
15
+ this.moduleTokens.set(metatype, token);
16
+ return token;
17
+ }
18
+ async getStaticModuleToken(moduleId, moduleName) {
19
+ const key = `${moduleId}_${moduleName}`;
20
+ if (this.moduleTokenCache.has(key)) {
21
+ return this.moduleTokenCache.get(key);
22
+ }
23
+ const hash = await this.hashUtils.hashString(key);
24
+ this.moduleTokenCache.set(key, hash);
25
+ return hash;
26
+ }
27
+ getMetatypeId(metatype) {
28
+ let metatypeId = this.moduleIdsCache.get(metatype);
29
+ if (metatypeId) {
30
+ return metatypeId;
31
+ }
32
+ metatypeId = `${this.hashUtils.incrementString()}_${metatype.toString()}`;
33
+ this.moduleIdsCache.set(metatype, metatypeId);
34
+ return metatypeId;
35
+ }
36
+ getModuleName(metatype) {
37
+ if (isDynamicModule(metatype)) {
38
+ return metatype.module.name;
39
+ }
40
+ return metatype.name;
41
+ }
42
+ }
43
+ //# sourceMappingURL=module-token-factory.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"module-token-factory.js","sourceRoot":"","sources":["../../../../src/core/modules/module-token-factory.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAEtD,MAAM,OAAO,kBAAkB;IAQ9B,YAA6B,SAA4B;QAA5B,cAAS,GAAT,SAAS,CAAmB;QAPxC,qBAAgB,GAAG,IAAI,GAAG,EAAkB,CAAC;QAC7C,iBAAY,GAAG,IAAI,OAAO,EAAkC,CAAC;QAC7D,mBAAc,GAAG,IAAI,OAAO,EAG1C,CAAC;IAEwD,CAAC;IAEtD,KAAK,CAAC,MAAM,CAAC,QAAgC;QACnD,MAAM,WAAW,GAAG,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QAEpD,IAAI,WAAW,EAAE,CAAC;YACjB,OAAO,WAAW,CAAC;QACpB,CAAC;QAED,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,oBAAoB,CAC5C,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,EAC5B,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,CAC5B,CAAC;QAEF,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;QAEvC,OAAO,KAAK,CAAC;IACd,CAAC;IAEO,KAAK,CAAC,oBAAoB,CACjC,QAAgB,EAChB,UAAkB;QAElB,MAAM,GAAG,GAAG,GAAG,QAAQ,IAAI,UAAU,EAAE,CAAC;QACxC,IAAI,IAAI,CAAC,gBAAgB,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC;YACpC,OAAO,IAAI,CAAC,gBAAgB,CAAC,GAAG,CAAC,GAAG,CAAW,CAAC;QACjD,CAAC;QAED,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;QAClD,IAAI,CAAC,gBAAgB,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;QACrC,OAAO,IAAI,CAAC;IACb,CAAC;IAEO,aAAa,CAAC,QAAgC;QACrD,IAAI,UAAU,GAAG,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QAEnD,IAAI,UAAU,EAAE,CAAC;YAChB,OAAO,UAAU,CAAC;QACnB,CAAC;QAED,UAAU,GAAG,GAAG,IAAI,CAAC,SAAS,CAAC,eAAe,EAAE,IAAI,QAAQ,CAAC,QAAQ,EAAE,EAAE,CAAC;QAE1E,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC;QAC9C,OAAO,UAAU,CAAC;IACnB,CAAC;IAEO,aAAa,CAAC,QAAgC;QACrD,IAAI,eAAe,CAAC,QAAQ,CAAC,EAAE,CAAC;YAC/B,OAAO,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC;QAC7B,CAAC;QAED,OAAO,QAAQ,CAAC,IAAI,CAAC;IACtB,CAAC;CACD"}
@@ -0,0 +1,39 @@
1
+ import "reflect-metadata";
2
+ import { MODULE_TOKEN_WATERMARK, } from "../../interfaces/index.js";
3
+ import { ModuleContainerFactory } from "./module-container-factory.js";
4
+ import { ModuleTokenFactory } from "./module-token-factory.js";
5
+ export class ModulesContainer {
6
+ constructor(hashUtils, container) {
7
+ this.hashUtils = hashUtils;
8
+ this.container = container;
9
+ this.containers = new Map();
10
+ this.moduleTokenFactory = new ModuleTokenFactory(this.hashUtils);
11
+ this.moduleContainerFactory = new ModuleContainerFactory(this.moduleTokenFactory);
12
+ }
13
+ async addModule(module) {
14
+ const cacheModule = await this.getModule(module);
15
+ if (cacheModule) {
16
+ return cacheModule;
17
+ }
18
+ return this.setModule(module);
19
+ }
20
+ getModule(module) {
21
+ return this.getModuleFromCache(module);
22
+ }
23
+ async replaceModule(moduleToReplace, newModule) {
24
+ const tokenToReplace = this.getModule(moduleToReplace);
25
+ const newModuleContainer = await this.setModule(newModule);
26
+ this.containers.set(tokenToReplace?.token || newModuleContainer.token, newModuleContainer);
27
+ return newModuleContainer;
28
+ }
29
+ async setModule(module) {
30
+ const moduleContainer = await this.moduleContainerFactory.create(module, this.container);
31
+ this.containers.set(moduleContainer.token, moduleContainer);
32
+ return moduleContainer;
33
+ }
34
+ getModuleFromCache(module) {
35
+ const token = Reflect.getMetadata(MODULE_TOKEN_WATERMARK, module);
36
+ return this.containers.get(token);
37
+ }
38
+ }
39
+ //# sourceMappingURL=modules-container.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"modules-container.js","sourceRoot":"","sources":["../../../../src/core/modules/modules-container.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,CAAC;AAC1B,OAAO,EAIN,sBAAsB,GAItB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AACpE,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAI5D,MAAM,OAAO,gBAAgB;IAO5B,YACkB,SAA4B,EAC5B,SAA6B;QAD7B,cAAS,GAAT,SAAS,CAAmB;QAC5B,cAAS,GAAT,SAAS,CAAoB;QAR9B,eAAU,GAAG,IAAI,GAAG,EAAmC,CAAC;QACxD,uBAAkB,GAAG,IAAI,kBAAkB,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QAC5D,2BAAsB,GAAG,IAAI,sBAAsB,CACnE,IAAI,CAAC,kBAAkB,CACvB,CAAC;IAKC,CAAC;IAEJ,KAAK,CAAC,SAAS,CACd,MAA8B;QAE9B,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;QAEjD,IAAI,WAAW,EAAE,CAAC;YACjB,OAAO,WAAW,CAAC;QACpB,CAAC;QAED,OAAO,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;IAC/B,CAAC;IAED,SAAS,CACR,MAA8B;QAE9B,OAAO,IAAI,CAAC,kBAAkB,CAAC,MAAM,CAAC,CAAC;IACxC,CAAC;IAED,KAAK,CAAC,aAAa,CAClB,eAAuB,EACvB,SAAiB;QAEjB,MAAM,cAAc,GAAG,IAAI,CAAC,SAAS,CAAC,eAAe,CAAC,CAAC;QACvD,MAAM,kBAAkB,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC;QAE3D,IAAI,CAAC,UAAU,CAAC,GAAG,CAClB,cAAc,EAAE,KAAK,IAAI,kBAAkB,CAAC,KAAK,EACjD,kBAAkB,CAClB,CAAC;QAEF,OAAO,kBAAkB,CAAC;IAC3B,CAAC;IAEO,KAAK,CAAC,SAAS,CACtB,MAA8B;QAE9B,MAAM,eAAe,GAAG,MAAM,IAAI,CAAC,sBAAsB,CAAC,MAAM,CAC/D,MAAM,EACN,IAAI,CAAC,SAAS,CACd,CAAC;QAEF,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,eAAe,CAAC,KAAK,EAAE,eAAe,CAAC,CAAC;QAE5D,OAAO,eAAe,CAAC;IACxB,CAAC;IAEO,kBAAkB,CACzB,MAA8B;QAE9B,MAAM,KAAK,GAAG,OAAO,CAAC,WAAW,CAAC,sBAAsB,EAAE,MAAM,CAAU,CAAC;QAE3E,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IACnC,CAAC;CACD"}
@@ -0,0 +1,49 @@
1
+ import { HashUtilBrowser } from "../utils/hash-utils.browser.js";
2
+ import { Container } from "./modules/container.js";
3
+ /**
4
+ * @deprecated
5
+ * It will be removed in version 1.0.0.
6
+ * these classes work the same way. For the new behavior, use @NexusApplications
7
+ */
8
+ export class NexusApplicationsBrowser {
9
+ constructor(rootModule) {
10
+ this.rootModule = rootModule;
11
+ this.hashUtil = new HashUtilBrowser();
12
+ this.scannerPlugins = [];
13
+ this.container = new Container(this.hashUtil);
14
+ this._parentContainer = null;
15
+ }
16
+ static create(rootModule) {
17
+ return new NexusApplicationsBrowser(rootModule);
18
+ }
19
+ async bootstrap() {
20
+ await this.container.run(this.rootModule);
21
+ for (const scannerPlugin of this.scannerPlugins) {
22
+ await scannerPlugin.scan(this.container.graph);
23
+ }
24
+ return this;
25
+ }
26
+ addScannerPlugin(scanner) {
27
+ const plugins = Array.isArray(scanner) ? scanner : [scanner];
28
+ this.scannerPlugins.push(...plugins);
29
+ return this;
30
+ }
31
+ async get(token) {
32
+ const dependency = await this.container.get(token);
33
+ if (!dependency) {
34
+ return this._parentContainer?.get(token);
35
+ }
36
+ return dependency;
37
+ }
38
+ get errors() {
39
+ return this.container.errors;
40
+ }
41
+ async() {
42
+ return this;
43
+ }
44
+ setParent(parentContainer) {
45
+ this._parentContainer = parentContainer;
46
+ return this;
47
+ }
48
+ }
49
+ //# sourceMappingURL=nexus-applications.browser.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nexus-applications.browser.js","sourceRoot":"","sources":["../../../src/core/nexus-applications.browser.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAEhD;;;;GAIG;AACH,MAAM,OAAO,wBAAwB;IAMpC,YAAqC,UAAkB;QAAlB,eAAU,GAAV,UAAU,CAAQ;QALtC,aAAQ,GAAG,IAAI,eAAe,EAAE,CAAC;QACjC,mBAAc,GAA6B,EAAE,CAAC;QAC9C,cAAS,GAAG,IAAI,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAClD,qBAAgB,GAAqC,IAAI,CAAC;IAER,CAAC;IAE3D,MAAM,CAAC,MAAM,CAAC,UAAkB;QAC/B,OAAO,IAAI,wBAAwB,CAAC,UAAU,CAAC,CAAC;IACjD,CAAC;IAEM,KAAK,CAAC,SAAS;QACrB,MAAM,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QAE1C,KAAK,MAAM,aAAa,IAAI,IAAI,CAAC,cAAc,EAAE,CAAC;YACjD,MAAM,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;QAChD,CAAC;QAED,OAAO,IAAI,CAAC;IACb,CAAC;IAEM,gBAAgB,CACtB,OAA0D;QAE1D,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;QAC7D,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,CAAC;QACrC,OAAO,IAAI,CAAC;IACb,CAAC;IAEM,KAAK,CAAC,GAAG,CAAI,KAAqB;QACxC,MAAM,UAAU,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,GAAG,CAAI,KAAK,CAAC,CAAC;QAEtD,IAAI,CAAC,UAAU,EAAE,CAAC;YACjB,OAAO,IAAI,CAAC,gBAAgB,EAAE,GAAG,CAAI,KAAK,CAAC,CAAC;QAC7C,CAAC;QAED,OAAO,UAAU,CAAC;IACnB,CAAC;IAED,IAAW,MAAM;QAChB,OAAO,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC;IAC9B,CAAC;IAED,KAAK;QACJ,OAAO,IAAI,CAAC;IACb,CAAC;IAEM,SAAS,CAAC,eAA0C;QAC1D,IAAI,CAAC,gBAAgB,GAAG,eAAe,CAAC;QACxC,OAAO,IAAI,CAAC;IACb,CAAC;CACD"}
@@ -0,0 +1,200 @@
1
+ import { NodeTypeEnum, Scope, } from "../interfaces/index.js";
2
+ import { HashUtil } from "../utils/hash-utils.js";
3
+ import { Container } from "./modules/container.js";
4
+ /**
5
+ * NexusApplications is the main application class that provides a high-level
6
+ * API for creating and managing IoC containers.
7
+ *
8
+ * This class wraps the Container and provides additional features:
9
+ * - Automatic singleton initialization
10
+ * - Scanner plugin support for custom metadata processing
11
+ * - Parent-child container hierarchies
12
+ * - Async/sync container modes
13
+ *
14
+ * @example
15
+ * ```typescript
16
+ * const app = NexusApplications.create(AppModule);
17
+ * await app.bootstrap();
18
+ * const service = await app.get(MyService);
19
+ * ```
20
+ */
21
+ export class NexusApplications {
22
+ /**
23
+ * Creates a new NexusApplications instance.
24
+ *
25
+ * @param rootModule - The root module of the application
26
+ * @param options - Optional configuration
27
+ * @param options.hashFn - Custom hash function for module identification
28
+ */
29
+ constructor(rootModule, options) {
30
+ this.rootModule = rootModule;
31
+ this.hashUtil = new HashUtil();
32
+ this.isAsyncContainer = false;
33
+ this.container = new Container(this.hashUtil);
34
+ this.scannerPlugins = [];
35
+ this._parentContainer = null;
36
+ if (options?.hashFn && typeof options?.hashFn === "function") {
37
+ this.hashUtil = new options.hashFn();
38
+ }
39
+ }
40
+ /**
41
+ * Creates a new NexusApplications instance.
42
+ *
43
+ * This is the main entry point for creating an application.
44
+ *
45
+ * @param rootModule - The root module of the application
46
+ * @param options - Optional configuration
47
+ * @param options.hashFn - Custom hash function for module identification
48
+ * @returns A new NexusApplications instance
49
+ *
50
+ * @example
51
+ * ```typescript
52
+ * const app = NexusApplications.create(AppModule);
53
+ * await app.bootstrap();
54
+ * ```
55
+ */
56
+ static create(rootModule, options) {
57
+ return new NexusApplications(rootModule, options);
58
+ }
59
+ /**
60
+ * Bootstraps the application by initializing the container and all providers.
61
+ *
62
+ * This method:
63
+ * 1. Runs the container with the root module
64
+ * 2. Executes all registered scanner plugins
65
+ * 3. Pre-instantiates all singleton providers (unless async mode is enabled)
66
+ *
67
+ * @returns A promise that resolves to this instance for method chaining
68
+ * @throws {Error} If there are circular dependencies or missing providers
69
+ *
70
+ * @example
71
+ * ```typescript
72
+ * const app = NexusApplications.create(AppModule);
73
+ * await app.bootstrap();
74
+ * // Application is now ready to use
75
+ * ```
76
+ */
77
+ async bootstrap() {
78
+ await this.container.run(this.rootModule);
79
+ for (const scannerPlugin of this.scannerPlugins) {
80
+ await scannerPlugin.scan(this.container.graph);
81
+ }
82
+ if (!this.isAsyncContainer) {
83
+ for (const [token, node] of this.container.graph.nodes) {
84
+ if (node.type === NodeTypeEnum.PROVIDER &&
85
+ node.scope === Scope.Singleton) {
86
+ await this.container.get(token);
87
+ }
88
+ }
89
+ }
90
+ return this;
91
+ }
92
+ /**
93
+ * Adds one or more scanner plugins to the application.
94
+ *
95
+ * Scanner plugins are executed after the dependency graph is built
96
+ * and can be used to process custom metadata, validate the graph,
97
+ * or perform other initialization tasks.
98
+ *
99
+ * @param scanner - A single scanner plugin or an array of scanner plugins
100
+ * @returns This instance for method chaining
101
+ *
102
+ * @example
103
+ * ```typescript
104
+ * const app = NexusApplications.create(AppModule)
105
+ * .addScannerPlugin(new CustomScanner())
106
+ * .addScannerPlugin([new Scanner1(), new Scanner2()]);
107
+ * await app.bootstrap();
108
+ * ```
109
+ */
110
+ addScannerPlugin(scanner) {
111
+ const plugins = Array.isArray(scanner) ? scanner : [scanner];
112
+ this.scannerPlugins.push(...plugins);
113
+ return this;
114
+ }
115
+ /**
116
+ * Resolves and returns an instance of a provider by its injection token.
117
+ *
118
+ * If the provider is not found in this container, it will attempt to
119
+ * resolve it from the parent container (if set).
120
+ *
121
+ * @template T - The type of the provider to resolve
122
+ * @param token - The injection token (class, string, or symbol)
123
+ * @returns A promise that resolves to the provider instance, or undefined if not found
124
+ *
125
+ * @example
126
+ * ```typescript
127
+ * const app = await NexusApplications.create(AppModule).bootstrap();
128
+ * const userService = await app.get(UserService);
129
+ * const config = await app.get('CONFIG');
130
+ * ```
131
+ */
132
+ async get(token) {
133
+ const dependency = await this.container.get(token);
134
+ // Check for undefined specifically, not falsy values (null, 0, false, etc. are valid)
135
+ if (dependency === undefined) {
136
+ return this._parentContainer?.get(token);
137
+ }
138
+ return dependency;
139
+ }
140
+ /**
141
+ * Gets all errors that occurred during graph compilation.
142
+ *
143
+ * @returns An array of graph errors
144
+ *
145
+ * @example
146
+ * ```typescript
147
+ * const app = await NexusApplications.create(AppModule).bootstrap();
148
+ * if (app.errors.length > 0) {
149
+ * console.error('Application errors:', app.errors);
150
+ * }
151
+ * ```
152
+ */
153
+ get errors() {
154
+ return this.container.errors;
155
+ }
156
+ /**
157
+ * Enables async mode for the container.
158
+ *
159
+ * In async mode, singleton providers are NOT pre-instantiated during
160
+ * bootstrap. They will be created lazily on first access via get().
161
+ * This can improve startup time for large applications.
162
+ *
163
+ * @returns This instance for method chaining
164
+ *
165
+ * @example
166
+ * ```typescript
167
+ * const app = NexusApplications.create(AppModule)
168
+ * .async();
169
+ * await app.bootstrap(); // Singletons are NOT created yet
170
+ * const service = await app.get(MyService); // Created on first access
171
+ * ```
172
+ */
173
+ async() {
174
+ this.isAsyncContainer = true;
175
+ return this;
176
+ }
177
+ /**
178
+ * Sets a parent container for this application.
179
+ *
180
+ * When a provider is not found in this container, it will be looked up
181
+ * in the parent container. This enables hierarchical container structures.
182
+ *
183
+ * @param parentContainer - The parent container
184
+ * @returns This instance for method chaining
185
+ *
186
+ * @example
187
+ * ```typescript
188
+ * const parentApp = await NexusApplications.create(ParentModule).bootstrap();
189
+ * const childApp = await NexusApplications.create(ChildModule)
190
+ * .setParent(parentApp)
191
+ * .bootstrap();
192
+ * // childApp can access providers from parentApp
193
+ * ```
194
+ */
195
+ setParent(parentContainer) {
196
+ this._parentContainer = parentContainer;
197
+ return this;
198
+ }
199
+ }
200
+ //# sourceMappingURL=nexus-applications.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nexus-applications.js","sourceRoot":"","sources":["../../../src/core/nexus-applications.ts"],"names":[],"mappings":"AAAA,OAAO,EAKN,YAAY,EAEZ,KAAK,GACL,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAEhD;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,OAAO,iBAAiB;IAO7B;;;;;;OAMG;IACH,YACkB,UAAkB,EACnC,OAAiD;QADhC,eAAU,GAAV,UAAU,CAAQ;QAd5B,aAAQ,GAAsB,IAAI,QAAQ,EAAE,CAAC;QAC7C,qBAAgB,GAAG,KAAK,CAAC;QAChB,cAAS,GAAG,IAAI,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QACzC,mBAAc,GAA6B,EAAE,CAAC;QACvD,qBAAgB,GAAqC,IAAI,CAAC;QAajE,IAAI,OAAO,EAAE,MAAM,IAAI,OAAO,OAAO,EAAE,MAAM,KAAK,UAAU,EAAE,CAAC;YAC9D,IAAI,CAAC,QAAQ,GAAG,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;QACtC,CAAC;IACF,CAAC;IAED;;;;;;;;;;;;;;;OAeG;IACH,MAAM,CAAC,MAAM,CACZ,UAAkB,EAClB,OAAiD;QAEjD,OAAO,IAAI,iBAAiB,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;IACnD,CAAC;IAED;;;;;;;;;;;;;;;;;OAiBG;IACI,KAAK,CAAC,SAAS;QACrB,MAAM,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QAE1C,KAAK,MAAM,aAAa,IAAI,IAAI,CAAC,cAAc,EAAE,CAAC;YACjD,MAAM,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;QAChD,CAAC;QAED,IAAI,CAAC,IAAI,CAAC,gBAAgB,EAAE,CAAC;YAC5B,KAAK,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,IAAI,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;gBACxD,IACC,IAAI,CAAC,IAAI,KAAK,YAAY,CAAC,QAAQ;oBACnC,IAAI,CAAC,KAAK,KAAK,KAAK,CAAC,SAAS,EAC7B,CAAC;oBACF,MAAM,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;gBACjC,CAAC;YACF,CAAC;QACF,CAAC;QAED,OAAO,IAAI,CAAC;IACb,CAAC;IAED;;;;;;;;;;;;;;;;;OAiBG;IACI,gBAAgB,CACtB,OAA0D;QAE1D,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;QAC7D,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,CAAC;QACrC,OAAO,IAAI,CAAC;IACb,CAAC;IAED;;;;;;;;;;;;;;;;OAgBG;IACI,KAAK,CAAC,GAAG,CAAI,KAAqB;QACxC,MAAM,UAAU,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,GAAG,CAAI,KAAK,CAAC,CAAC;QAEtD,sFAAsF;QACtF,IAAI,UAAU,KAAK,SAAS,EAAE,CAAC;YAC9B,OAAO,IAAI,CAAC,gBAAgB,EAAE,GAAG,CAAI,KAAK,CAAC,CAAC;QAC7C,CAAC;QAED,OAAO,UAAU,CAAC;IACnB,CAAC;IAED;;;;;;;;;;;;OAYG;IACH,IAAW,MAAM;QAChB,OAAO,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC;IAC9B,CAAC;IAED;;;;;;;;;;;;;;;;OAgBG;IACI,KAAK;QACX,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC;QAC7B,OAAO,IAAI,CAAC;IACb,CAAC;IAED;;;;;;;;;;;;;;;;;OAiBG;IACI,SAAS,CAAC,eAA0C;QAC1D,IAAI,CAAC,gBAAgB,GAAG,eAAe,CAAC;QACxC,OAAO,IAAI,CAAC;IACb,CAAC;CACD"}