@zudojs/core 0.0.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 (547) hide show
  1. package/README.md +33 -0
  2. package/dist/.tsbuildinfo +1 -0
  3. package/dist/application/application.d.ts +25 -0
  4. package/dist/application/application.d.ts.map +1 -0
  5. package/dist/application/application.js +86 -0
  6. package/dist/application/application.js.map +1 -0
  7. package/dist/application/applicationContext.context.d.ts +40 -0
  8. package/dist/application/applicationContext.context.d.ts.map +1 -0
  9. package/dist/application/applicationContext.context.js +43 -0
  10. package/dist/application/applicationContext.context.js.map +1 -0
  11. package/dist/application/applicationState.state.d.ts +5 -0
  12. package/dist/application/applicationState.state.d.ts.map +1 -0
  13. package/dist/application/applicationState.state.js +2 -0
  14. package/dist/application/applicationState.state.js.map +1 -0
  15. package/dist/application/index.d.ts +10 -0
  16. package/dist/application/index.d.ts.map +1 -0
  17. package/dist/application/index.js +10 -0
  18. package/dist/application/index.js.map +1 -0
  19. package/dist/configuration/configurationManager.manager.d.ts +68 -0
  20. package/dist/configuration/configurationManager.manager.d.ts.map +1 -0
  21. package/dist/configuration/configurationManager.manager.js +157 -0
  22. package/dist/configuration/configurationManager.manager.js.map +1 -0
  23. package/dist/configuration/core/configuration.d.ts +53 -0
  24. package/dist/configuration/core/configuration.d.ts.map +1 -0
  25. package/dist/configuration/core/configuration.js +206 -0
  26. package/dist/configuration/core/configuration.js.map +1 -0
  27. package/dist/configuration/core/configurationKey.key.d.ts +43 -0
  28. package/dist/configuration/core/configurationKey.key.d.ts.map +1 -0
  29. package/dist/configuration/core/configurationKey.key.js +27 -0
  30. package/dist/configuration/core/configurationKey.key.js.map +1 -0
  31. package/dist/configuration/core/configurationSource.source.d.ts +114 -0
  32. package/dist/configuration/core/configurationSource.source.d.ts.map +1 -0
  33. package/dist/configuration/core/configurationSource.source.js +55 -0
  34. package/dist/configuration/core/configurationSource.source.js.map +1 -0
  35. package/dist/configuration/core/index.d.ts +12 -0
  36. package/dist/configuration/core/index.d.ts.map +1 -0
  37. package/dist/configuration/core/index.js +9 -0
  38. package/dist/configuration/core/index.js.map +1 -0
  39. package/dist/configuration/error/configurationError.error.d.ts +108 -0
  40. package/dist/configuration/error/configurationError.error.d.ts.map +1 -0
  41. package/dist/configuration/error/configurationError.error.js +168 -0
  42. package/dist/configuration/error/configurationError.error.js.map +1 -0
  43. package/dist/configuration/error/configurationRedactor.redactor.d.ts +111 -0
  44. package/dist/configuration/error/configurationRedactor.redactor.d.ts.map +1 -0
  45. package/dist/configuration/error/configurationRedactor.redactor.js +176 -0
  46. package/dist/configuration/error/configurationRedactor.redactor.js.map +1 -0
  47. package/dist/configuration/error/index.d.ts +10 -0
  48. package/dist/configuration/error/index.d.ts.map +1 -0
  49. package/dist/configuration/error/index.js +8 -0
  50. package/dist/configuration/error/index.js.map +1 -0
  51. package/dist/configuration/events/configurationEvents.events.d.ts +174 -0
  52. package/dist/configuration/events/configurationEvents.events.d.ts.map +1 -0
  53. package/dist/configuration/events/configurationEvents.events.js +99 -0
  54. package/dist/configuration/events/configurationEvents.events.js.map +1 -0
  55. package/dist/configuration/events/index.d.ts +8 -0
  56. package/dist/configuration/events/index.d.ts.map +1 -0
  57. package/dist/configuration/events/index.js +7 -0
  58. package/dist/configuration/events/index.js.map +1 -0
  59. package/dist/configuration/index.d.ts +30 -0
  60. package/dist/configuration/index.d.ts.map +1 -0
  61. package/dist/configuration/index.js +29 -0
  62. package/dist/configuration/index.js.map +1 -0
  63. package/dist/configuration/loader/configurationLoader.loader.d.ts +113 -0
  64. package/dist/configuration/loader/configurationLoader.loader.d.ts.map +1 -0
  65. package/dist/configuration/loader/configurationLoader.loader.js +155 -0
  66. package/dist/configuration/loader/configurationLoader.loader.js.map +1 -0
  67. package/dist/configuration/loader/index.d.ts +8 -0
  68. package/dist/configuration/loader/index.d.ts.map +1 -0
  69. package/dist/configuration/loader/index.js +7 -0
  70. package/dist/configuration/loader/index.js.map +1 -0
  71. package/dist/configuration/registry/configurationProvider.provider.d.ts +130 -0
  72. package/dist/configuration/registry/configurationProvider.provider.d.ts.map +1 -0
  73. package/dist/configuration/registry/configurationProvider.provider.js +113 -0
  74. package/dist/configuration/registry/configurationProvider.provider.js.map +1 -0
  75. package/dist/configuration/registry/configurationRegistry.registry.d.ts +143 -0
  76. package/dist/configuration/registry/configurationRegistry.registry.d.ts.map +1 -0
  77. package/dist/configuration/registry/configurationRegistry.registry.js +157 -0
  78. package/dist/configuration/registry/configurationRegistry.registry.js.map +1 -0
  79. package/dist/configuration/registry/index.d.ts +10 -0
  80. package/dist/configuration/registry/index.d.ts.map +1 -0
  81. package/dist/configuration/registry/index.js +8 -0
  82. package/dist/configuration/registry/index.js.map +1 -0
  83. package/dist/configuration/schema/configurationSchema.schema.d.ts +159 -0
  84. package/dist/configuration/schema/configurationSchema.schema.d.ts.map +1 -0
  85. package/dist/configuration/schema/configurationSchema.schema.js +155 -0
  86. package/dist/configuration/schema/configurationSchema.schema.js.map +1 -0
  87. package/dist/configuration/schema/configurationValidation.validator.d.ts +82 -0
  88. package/dist/configuration/schema/configurationValidation.validator.d.ts.map +1 -0
  89. package/dist/configuration/schema/configurationValidation.validator.js +110 -0
  90. package/dist/configuration/schema/configurationValidation.validator.js.map +1 -0
  91. package/dist/configuration/schema/index.d.ts +10 -0
  92. package/dist/configuration/schema/index.d.ts.map +1 -0
  93. package/dist/configuration/schema/index.js +8 -0
  94. package/dist/configuration/schema/index.js.map +1 -0
  95. package/dist/container/container.d.ts +43 -0
  96. package/dist/container/container.d.ts.map +1 -0
  97. package/dist/container/container.js +91 -0
  98. package/dist/container/container.js.map +1 -0
  99. package/dist/container/index.d.ts +8 -0
  100. package/dist/container/index.d.ts.map +1 -0
  101. package/dist/container/index.js +8 -0
  102. package/dist/container/index.js.map +1 -0
  103. package/dist/container/provider.d.ts +28 -0
  104. package/dist/container/provider.d.ts.map +1 -0
  105. package/dist/container/provider.js +2 -0
  106. package/dist/container/provider.js.map +1 -0
  107. package/dist/container/scope.d.ts +24 -0
  108. package/dist/container/scope.d.ts.map +1 -0
  109. package/dist/container/scope.js +2 -0
  110. package/dist/container/scope.js.map +1 -0
  111. package/dist/container/token.d.ts +18 -0
  112. package/dist/container/token.d.ts.map +1 -0
  113. package/dist/container/token.js +10 -0
  114. package/dist/container/token.js.map +1 -0
  115. package/dist/context/core/context.d.ts +95 -0
  116. package/dist/context/core/context.d.ts.map +1 -0
  117. package/dist/context/core/context.js +103 -0
  118. package/dist/context/core/context.js.map +1 -0
  119. package/dist/context/core/contextKey.key.d.ts +60 -0
  120. package/dist/context/core/contextKey.key.d.ts.map +1 -0
  121. package/dist/context/core/contextKey.key.js +58 -0
  122. package/dist/context/core/contextKey.key.js.map +1 -0
  123. package/dist/context/core/executionContext.context.d.ts +131 -0
  124. package/dist/context/core/executionContext.context.d.ts.map +1 -0
  125. package/dist/context/core/executionContext.context.js +81 -0
  126. package/dist/context/core/executionContext.context.js.map +1 -0
  127. package/dist/context/core/index.d.ts +9 -0
  128. package/dist/context/core/index.d.ts.map +1 -0
  129. package/dist/context/core/index.js +9 -0
  130. package/dist/context/core/index.js.map +1 -0
  131. package/dist/context/index.d.ts +8 -0
  132. package/dist/context/index.d.ts.map +1 -0
  133. package/dist/context/index.js +8 -0
  134. package/dist/context/index.js.map +1 -0
  135. package/dist/context/provider/contextProvider.provider.d.ts +61 -0
  136. package/dist/context/provider/contextProvider.provider.d.ts.map +1 -0
  137. package/dist/context/provider/contextProvider.provider.js +44 -0
  138. package/dist/context/provider/contextProvider.provider.js.map +1 -0
  139. package/dist/context/provider/contextStorage.storage.d.ts +54 -0
  140. package/dist/context/provider/contextStorage.storage.d.ts.map +1 -0
  141. package/dist/context/provider/contextStorage.storage.js +74 -0
  142. package/dist/context/provider/contextStorage.storage.js.map +1 -0
  143. package/dist/context/provider/index.d.ts +8 -0
  144. package/dist/context/provider/index.d.ts.map +1 -0
  145. package/dist/context/provider/index.js +8 -0
  146. package/dist/context/provider/index.js.map +1 -0
  147. package/dist/context/snapshot/contextSnapshot.snapshot.d.ts +48 -0
  148. package/dist/context/snapshot/contextSnapshot.snapshot.d.ts.map +1 -0
  149. package/dist/context/snapshot/contextSnapshot.snapshot.js +33 -0
  150. package/dist/context/snapshot/contextSnapshot.snapshot.js.map +1 -0
  151. package/dist/context/snapshot/index.d.ts +8 -0
  152. package/dist/context/snapshot/index.d.ts.map +1 -0
  153. package/dist/context/snapshot/index.js +8 -0
  154. package/dist/context/snapshot/index.js.map +1 -0
  155. package/dist/context/values/contextValues.values.d.ts +84 -0
  156. package/dist/context/values/contextValues.values.d.ts.map +1 -0
  157. package/dist/context/values/contextValues.values.js +120 -0
  158. package/dist/context/values/contextValues.values.js.map +1 -0
  159. package/dist/context/values/index.d.ts +7 -0
  160. package/dist/context/values/index.d.ts.map +1 -0
  161. package/dist/context/values/index.js +7 -0
  162. package/dist/context/values/index.js.map +1 -0
  163. package/dist/contracts/adapter.d.ts +44 -0
  164. package/dist/contracts/adapter.d.ts.map +1 -0
  165. package/dist/contracts/adapter.js +2 -0
  166. package/dist/contracts/adapter.js.map +1 -0
  167. package/dist/contracts/disposable.d.ts +23 -0
  168. package/dist/contracts/disposable.d.ts.map +1 -0
  169. package/dist/contracts/disposable.js +2 -0
  170. package/dist/contracts/disposable.js.map +1 -0
  171. package/dist/contracts/handler.d.ts +32 -0
  172. package/dist/contracts/handler.d.ts.map +1 -0
  173. package/dist/contracts/handler.js +9 -0
  174. package/dist/contracts/handler.js.map +1 -0
  175. package/dist/contracts/index.d.ts +7 -0
  176. package/dist/contracts/index.d.ts.map +1 -0
  177. package/dist/contracts/index.js +7 -0
  178. package/dist/contracts/index.js.map +1 -0
  179. package/dist/errors/errorCode.code.d.ts +78 -0
  180. package/dist/errors/errorCode.code.d.ts.map +1 -0
  181. package/dist/errors/errorCode.code.js +84 -0
  182. package/dist/errors/errorCode.code.js.map +1 -0
  183. package/dist/errors/exceptions.d.ts +52 -0
  184. package/dist/errors/exceptions.d.ts.map +1 -0
  185. package/dist/errors/exceptions.js +125 -0
  186. package/dist/errors/exceptions.js.map +1 -0
  187. package/dist/errors/frameworkError.error.d.ts +51 -0
  188. package/dist/errors/frameworkError.error.d.ts.map +1 -0
  189. package/dist/errors/frameworkError.error.js +54 -0
  190. package/dist/errors/frameworkError.error.js.map +1 -0
  191. package/dist/errors/index.d.ts +10 -0
  192. package/dist/errors/index.d.ts.map +1 -0
  193. package/dist/errors/index.js +9 -0
  194. package/dist/errors/index.js.map +1 -0
  195. package/dist/index.d.ts +30 -0
  196. package/dist/index.d.ts.map +1 -0
  197. package/dist/index.js +75 -0
  198. package/dist/index.js.map +1 -0
  199. package/dist/lifecycle/core/index.d.ts +9 -0
  200. package/dist/lifecycle/core/index.d.ts.map +1 -0
  201. package/dist/lifecycle/core/index.js +9 -0
  202. package/dist/lifecycle/core/index.js.map +1 -0
  203. package/dist/lifecycle/core/lifecycle.d.ts +44 -0
  204. package/dist/lifecycle/core/lifecycle.d.ts.map +1 -0
  205. package/dist/lifecycle/core/lifecycle.js +179 -0
  206. package/dist/lifecycle/core/lifecycle.js.map +1 -0
  207. package/dist/lifecycle/core/lifecycleHook.hook.d.ts +59 -0
  208. package/dist/lifecycle/core/lifecycleHook.hook.d.ts.map +1 -0
  209. package/dist/lifecycle/core/lifecycleHook.hook.js +37 -0
  210. package/dist/lifecycle/core/lifecycleHook.hook.js.map +1 -0
  211. package/dist/lifecycle/core/lifecycleRegistry.registry.d.ts +101 -0
  212. package/dist/lifecycle/core/lifecycleRegistry.registry.d.ts.map +1 -0
  213. package/dist/lifecycle/core/lifecycleRegistry.registry.js +115 -0
  214. package/dist/lifecycle/core/lifecycleRegistry.registry.js.map +1 -0
  215. package/dist/lifecycle/core/lifecycleState.state.d.ts +2 -0
  216. package/dist/lifecycle/core/lifecycleState.state.d.ts.map +1 -0
  217. package/dist/lifecycle/core/lifecycleState.state.js +2 -0
  218. package/dist/lifecycle/core/lifecycleState.state.js.map +1 -0
  219. package/dist/lifecycle/index.d.ts +10 -0
  220. package/dist/lifecycle/index.d.ts.map +1 -0
  221. package/dist/lifecycle/index.js +10 -0
  222. package/dist/lifecycle/index.js.map +1 -0
  223. package/dist/lifecycle/manager/index.d.ts +7 -0
  224. package/dist/lifecycle/manager/index.d.ts.map +1 -0
  225. package/dist/lifecycle/manager/index.js +7 -0
  226. package/dist/lifecycle/manager/index.js.map +1 -0
  227. package/dist/lifecycle/manager/lifecycleManager.manager.d.ts +33 -0
  228. package/dist/lifecycle/manager/lifecycleManager.manager.d.ts.map +1 -0
  229. package/dist/lifecycle/manager/lifecycleManager.manager.js +157 -0
  230. package/dist/lifecycle/manager/lifecycleManager.manager.js.map +1 -0
  231. package/dist/lifecycle/scope/index.d.ts +8 -0
  232. package/dist/lifecycle/scope/index.d.ts.map +1 -0
  233. package/dist/lifecycle/scope/index.js +8 -0
  234. package/dist/lifecycle/scope/index.js.map +1 -0
  235. package/dist/lifecycle/scope/lifecycleScope.scope.d.ts +49 -0
  236. package/dist/lifecycle/scope/lifecycleScope.scope.d.ts.map +1 -0
  237. package/dist/lifecycle/scope/lifecycleScope.scope.js +234 -0
  238. package/dist/lifecycle/scope/lifecycleScope.scope.js.map +1 -0
  239. package/dist/logging/console/consoleLogger.logger.d.ts +59 -0
  240. package/dist/logging/console/consoleLogger.logger.d.ts.map +1 -0
  241. package/dist/logging/console/consoleLogger.logger.js +180 -0
  242. package/dist/logging/console/consoleLogger.logger.js.map +1 -0
  243. package/dist/logging/console/index.d.ts +8 -0
  244. package/dist/logging/console/index.d.ts.map +1 -0
  245. package/dist/logging/console/index.js +8 -0
  246. package/dist/logging/console/index.js.map +1 -0
  247. package/dist/logging/console/loggerFactory.factory.d.ts +45 -0
  248. package/dist/logging/console/loggerFactory.factory.d.ts.map +1 -0
  249. package/dist/logging/console/loggerFactory.factory.js +37 -0
  250. package/dist/logging/console/loggerFactory.factory.js.map +1 -0
  251. package/dist/logging/core/index.d.ts +11 -0
  252. package/dist/logging/core/index.d.ts.map +1 -0
  253. package/dist/logging/core/index.js +11 -0
  254. package/dist/logging/core/index.js.map +1 -0
  255. package/dist/logging/core/logEntry.entry.d.ts +73 -0
  256. package/dist/logging/core/logEntry.entry.d.ts.map +1 -0
  257. package/dist/logging/core/logEntry.entry.js +38 -0
  258. package/dist/logging/core/logEntry.entry.js.map +1 -0
  259. package/dist/logging/core/logLevel.level.d.ts +29 -0
  260. package/dist/logging/core/logLevel.level.d.ts.map +1 -0
  261. package/dist/logging/core/logLevel.level.js +34 -0
  262. package/dist/logging/core/logLevel.level.js.map +1 -0
  263. package/dist/logging/core/logger.d.ts +80 -0
  264. package/dist/logging/core/logger.d.ts.map +1 -0
  265. package/dist/logging/core/logger.js +39 -0
  266. package/dist/logging/core/logger.js.map +1 -0
  267. package/dist/logging/core/loggerContext.context.d.ts +62 -0
  268. package/dist/logging/core/loggerContext.context.d.ts.map +1 -0
  269. package/dist/logging/core/loggerContext.context.js +19 -0
  270. package/dist/logging/core/loggerContext.context.js.map +1 -0
  271. package/dist/logging/core/loggerOptions.options.d.ts +69 -0
  272. package/dist/logging/core/loggerOptions.options.d.ts.map +1 -0
  273. package/dist/logging/core/loggerOptions.options.js +10 -0
  274. package/dist/logging/core/loggerOptions.options.js.map +1 -0
  275. package/dist/logging/index.d.ts +8 -0
  276. package/dist/logging/index.d.ts.map +1 -0
  277. package/dist/logging/index.js +8 -0
  278. package/dist/logging/index.js.map +1 -0
  279. package/dist/modules/index.d.ts +20 -0
  280. package/dist/modules/index.d.ts.map +1 -0
  281. package/dist/modules/index.js +52 -0
  282. package/dist/modules/index.js.map +1 -0
  283. package/dist/modules/module.d.ts +171 -0
  284. package/dist/modules/module.d.ts.map +1 -0
  285. package/dist/modules/module.js +99 -0
  286. package/dist/modules/module.js.map +1 -0
  287. package/dist/modules/moduleContext.context.d.ts +170 -0
  288. package/dist/modules/moduleContext.context.d.ts.map +1 -0
  289. package/dist/modules/moduleContext.context.js +82 -0
  290. package/dist/modules/moduleContext.context.js.map +1 -0
  291. package/dist/modules/moduleDefinition.definition.d.ts +112 -0
  292. package/dist/modules/moduleDefinition.definition.d.ts.map +1 -0
  293. package/dist/modules/moduleDefinition.definition.js +101 -0
  294. package/dist/modules/moduleDefinition.definition.js.map +1 -0
  295. package/dist/modules/moduleDependency/index.d.ts +10 -0
  296. package/dist/modules/moduleDependency/index.d.ts.map +1 -0
  297. package/dist/modules/moduleDependency/index.js +10 -0
  298. package/dist/modules/moduleDependency/index.js.map +1 -0
  299. package/dist/modules/moduleDependency/moduleDependency.graph.d.ts +43 -0
  300. package/dist/modules/moduleDependency/moduleDependency.graph.d.ts.map +1 -0
  301. package/dist/modules/moduleDependency/moduleDependency.graph.js +175 -0
  302. package/dist/modules/moduleDependency/moduleDependency.graph.js.map +1 -0
  303. package/dist/modules/moduleDependency/moduleDependency.ordering.d.ts +38 -0
  304. package/dist/modules/moduleDependency/moduleDependency.ordering.d.ts.map +1 -0
  305. package/dist/modules/moduleDependency/moduleDependency.ordering.js +112 -0
  306. package/dist/modules/moduleDependency/moduleDependency.ordering.js.map +1 -0
  307. package/dist/modules/moduleDependency/moduleDependency.type.d.ts +66 -0
  308. package/dist/modules/moduleDependency/moduleDependency.type.d.ts.map +1 -0
  309. package/dist/modules/moduleDependency/moduleDependency.type.js +2 -0
  310. package/dist/modules/moduleDependency/moduleDependency.type.js.map +1 -0
  311. package/dist/modules/moduleError/index.d.ts +11 -0
  312. package/dist/modules/moduleError/index.d.ts.map +1 -0
  313. package/dist/modules/moduleError/index.js +11 -0
  314. package/dist/modules/moduleError/index.js.map +1 -0
  315. package/dist/modules/moduleError/moduleError.base.d.ts +119 -0
  316. package/dist/modules/moduleError/moduleError.base.d.ts.map +1 -0
  317. package/dist/modules/moduleError/moduleError.base.js +105 -0
  318. package/dist/modules/moduleError/moduleError.base.js.map +1 -0
  319. package/dist/modules/moduleError/moduleError.dependency.d.ts +45 -0
  320. package/dist/modules/moduleError/moduleError.dependency.d.ts.map +1 -0
  321. package/dist/modules/moduleError/moduleError.dependency.js +55 -0
  322. package/dist/modules/moduleError/moduleError.dependency.js.map +1 -0
  323. package/dist/modules/moduleError/moduleError.helpers.d.ts +22 -0
  324. package/dist/modules/moduleError/moduleError.helpers.d.ts.map +1 -0
  325. package/dist/modules/moduleError/moduleError.helpers.js +32 -0
  326. package/dist/modules/moduleError/moduleError.helpers.js.map +1 -0
  327. package/dist/modules/moduleError/moduleError.lifecycle.d.ts +61 -0
  328. package/dist/modules/moduleError/moduleError.lifecycle.d.ts.map +1 -0
  329. package/dist/modules/moduleError/moduleError.lifecycle.js +107 -0
  330. package/dist/modules/moduleError/moduleError.lifecycle.js.map +1 -0
  331. package/dist/modules/moduleError/moduleError.registration.d.ts +21 -0
  332. package/dist/modules/moduleError/moduleError.registration.d.ts.map +1 -0
  333. package/dist/modules/moduleError/moduleError.registration.js +39 -0
  334. package/dist/modules/moduleError/moduleError.registration.js.map +1 -0
  335. package/dist/modules/moduleLifecycle/index.d.ts +10 -0
  336. package/dist/modules/moduleLifecycle/index.d.ts.map +1 -0
  337. package/dist/modules/moduleLifecycle/index.js +10 -0
  338. package/dist/modules/moduleLifecycle/index.js.map +1 -0
  339. package/dist/modules/moduleLifecycle/moduleLifecycle.lifecycle.d.ts +41 -0
  340. package/dist/modules/moduleLifecycle/moduleLifecycle.lifecycle.d.ts.map +1 -0
  341. package/dist/modules/moduleLifecycle/moduleLifecycle.lifecycle.js +116 -0
  342. package/dist/modules/moduleLifecycle/moduleLifecycle.lifecycle.js.map +1 -0
  343. package/dist/modules/moduleLifecycle/moduleLifecycle.stateMachine.d.ts +21 -0
  344. package/dist/modules/moduleLifecycle/moduleLifecycle.stateMachine.d.ts.map +1 -0
  345. package/dist/modules/moduleLifecycle/moduleLifecycle.stateMachine.js +107 -0
  346. package/dist/modules/moduleLifecycle/moduleLifecycle.stateMachine.js.map +1 -0
  347. package/dist/modules/moduleLifecycle/moduleLifecycle.type.d.ts +94 -0
  348. package/dist/modules/moduleLifecycle/moduleLifecycle.type.d.ts.map +1 -0
  349. package/dist/modules/moduleLifecycle/moduleLifecycle.type.js +11 -0
  350. package/dist/modules/moduleLifecycle/moduleLifecycle.type.js.map +1 -0
  351. package/dist/modules/moduleLoader/index.d.ts +9 -0
  352. package/dist/modules/moduleLoader/index.d.ts.map +1 -0
  353. package/dist/modules/moduleLoader/index.js +9 -0
  354. package/dist/modules/moduleLoader/index.js.map +1 -0
  355. package/dist/modules/moduleLoader/moduleLoader.loader.d.ts +36 -0
  356. package/dist/modules/moduleLoader/moduleLoader.loader.d.ts.map +1 -0
  357. package/dist/modules/moduleLoader/moduleLoader.loader.js +164 -0
  358. package/dist/modules/moduleLoader/moduleLoader.loader.js.map +1 -0
  359. package/dist/modules/moduleLoader/moduleLoader.type.d.ts +57 -0
  360. package/dist/modules/moduleLoader/moduleLoader.type.d.ts.map +1 -0
  361. package/dist/modules/moduleLoader/moduleLoader.type.js +11 -0
  362. package/dist/modules/moduleLoader/moduleLoader.type.js.map +1 -0
  363. package/dist/modules/moduleMetadata.metadata.d.ts +36 -0
  364. package/dist/modules/moduleMetadata.metadata.d.ts.map +1 -0
  365. package/dist/modules/moduleMetadata.metadata.js +105 -0
  366. package/dist/modules/moduleMetadata.metadata.js.map +1 -0
  367. package/dist/modules/moduleRegistry/index.d.ts +8 -0
  368. package/dist/modules/moduleRegistry/index.d.ts.map +1 -0
  369. package/dist/modules/moduleRegistry/index.js +8 -0
  370. package/dist/modules/moduleRegistry/index.js.map +1 -0
  371. package/dist/modules/moduleRegistry/moduleRegistry.registry.d.ts +35 -0
  372. package/dist/modules/moduleRegistry/moduleRegistry.registry.d.ts.map +1 -0
  373. package/dist/modules/moduleRegistry/moduleRegistry.registry.js +155 -0
  374. package/dist/modules/moduleRegistry/moduleRegistry.registry.js.map +1 -0
  375. package/dist/modules/moduleRegistry/moduleRegistry.type.d.ts +134 -0
  376. package/dist/modules/moduleRegistry/moduleRegistry.type.d.ts.map +1 -0
  377. package/dist/modules/moduleRegistry/moduleRegistry.type.js +2 -0
  378. package/dist/modules/moduleRegistry/moduleRegistry.type.js.map +1 -0
  379. package/dist/runtime/index.d.ts +24 -0
  380. package/dist/runtime/index.d.ts.map +1 -0
  381. package/dist/runtime/index.js +42 -0
  382. package/dist/runtime/index.js.map +1 -0
  383. package/dist/runtime/runtime.d.ts +89 -0
  384. package/dist/runtime/runtime.d.ts.map +1 -0
  385. package/dist/runtime/runtime.js +179 -0
  386. package/dist/runtime/runtime.js.map +1 -0
  387. package/dist/runtime/runtimeBootstrap/index.d.ts +10 -0
  388. package/dist/runtime/runtimeBootstrap/index.d.ts.map +1 -0
  389. package/dist/runtime/runtimeBootstrap/index.js +9 -0
  390. package/dist/runtime/runtimeBootstrap/index.js.map +1 -0
  391. package/dist/runtime/runtimeBootstrap/pipeline/index.d.ts +8 -0
  392. package/dist/runtime/runtimeBootstrap/pipeline/index.d.ts.map +1 -0
  393. package/dist/runtime/runtimeBootstrap/pipeline/index.js +8 -0
  394. package/dist/runtime/runtimeBootstrap/pipeline/index.js.map +1 -0
  395. package/dist/runtime/runtimeBootstrap/pipeline/runtimeBootstrap.invoke.d.ts +6 -0
  396. package/dist/runtime/runtimeBootstrap/pipeline/runtimeBootstrap.invoke.d.ts.map +1 -0
  397. package/dist/runtime/runtimeBootstrap/pipeline/runtimeBootstrap.invoke.js +27 -0
  398. package/dist/runtime/runtimeBootstrap/pipeline/runtimeBootstrap.invoke.js.map +1 -0
  399. package/dist/runtime/runtimeBootstrap/pipeline/runtimeBootstrap.pipeline.d.ts +19 -0
  400. package/dist/runtime/runtimeBootstrap/pipeline/runtimeBootstrap.pipeline.d.ts.map +1 -0
  401. package/dist/runtime/runtimeBootstrap/pipeline/runtimeBootstrap.pipeline.js +107 -0
  402. package/dist/runtime/runtimeBootstrap/pipeline/runtimeBootstrap.pipeline.js.map +1 -0
  403. package/dist/runtime/runtimeBootstrap/runtimeBootstrap.core.d.ts +25 -0
  404. package/dist/runtime/runtimeBootstrap/runtimeBootstrap.core.d.ts.map +1 -0
  405. package/dist/runtime/runtimeBootstrap/runtimeBootstrap.core.js +122 -0
  406. package/dist/runtime/runtimeBootstrap/runtimeBootstrap.core.js.map +1 -0
  407. package/dist/runtime/runtimeBootstrap/runtimeBootstrap.type.d.ts +78 -0
  408. package/dist/runtime/runtimeBootstrap/runtimeBootstrap.type.d.ts.map +1 -0
  409. package/dist/runtime/runtimeBootstrap/runtimeBootstrap.type.js +2 -0
  410. package/dist/runtime/runtimeBootstrap/runtimeBootstrap.type.js.map +1 -0
  411. package/dist/runtime/runtimeContext/index.d.ts +10 -0
  412. package/dist/runtime/runtimeContext/index.d.ts.map +1 -0
  413. package/dist/runtime/runtimeContext/index.js +9 -0
  414. package/dist/runtime/runtimeContext/index.js.map +1 -0
  415. package/dist/runtime/runtimeContext/runtimeContext.core.d.ts +38 -0
  416. package/dist/runtime/runtimeContext/runtimeContext.core.d.ts.map +1 -0
  417. package/dist/runtime/runtimeContext/runtimeContext.core.js +99 -0
  418. package/dist/runtime/runtimeContext/runtimeContext.core.js.map +1 -0
  419. package/dist/runtime/runtimeContext/runtimeContext.factory.d.ts +22 -0
  420. package/dist/runtime/runtimeContext/runtimeContext.factory.d.ts.map +1 -0
  421. package/dist/runtime/runtimeContext/runtimeContext.factory.js +43 -0
  422. package/dist/runtime/runtimeContext/runtimeContext.factory.js.map +1 -0
  423. package/dist/runtime/runtimeContext/runtimeContext.type.d.ts +68 -0
  424. package/dist/runtime/runtimeContext/runtimeContext.type.d.ts.map +1 -0
  425. package/dist/runtime/runtimeContext/runtimeContext.type.js +2 -0
  426. package/dist/runtime/runtimeContext/runtimeContext.type.js.map +1 -0
  427. package/dist/runtime/runtimeEnvironment/detection/index.d.ts +9 -0
  428. package/dist/runtime/runtimeEnvironment/detection/index.d.ts.map +1 -0
  429. package/dist/runtime/runtimeEnvironment/detection/index.js +9 -0
  430. package/dist/runtime/runtimeEnvironment/detection/index.js.map +1 -0
  431. package/dist/runtime/runtimeEnvironment/detection/runtimeEnvironment.detection.d.ts +8 -0
  432. package/dist/runtime/runtimeEnvironment/detection/runtimeEnvironment.detection.d.ts.map +1 -0
  433. package/dist/runtime/runtimeEnvironment/detection/runtimeEnvironment.detection.js +92 -0
  434. package/dist/runtime/runtimeEnvironment/detection/runtimeEnvironment.detection.js.map +1 -0
  435. package/dist/runtime/runtimeEnvironment/detection/runtimeEnvironment.env.d.ts +4 -0
  436. package/dist/runtime/runtimeEnvironment/detection/runtimeEnvironment.env.d.ts.map +1 -0
  437. package/dist/runtime/runtimeEnvironment/detection/runtimeEnvironment.env.js +51 -0
  438. package/dist/runtime/runtimeEnvironment/detection/runtimeEnvironment.env.js.map +1 -0
  439. package/dist/runtime/runtimeEnvironment/detection/runtimeEnvironment.os.d.ts +4 -0
  440. package/dist/runtime/runtimeEnvironment/detection/runtimeEnvironment.os.d.ts.map +1 -0
  441. package/dist/runtime/runtimeEnvironment/detection/runtimeEnvironment.os.js +26 -0
  442. package/dist/runtime/runtimeEnvironment/detection/runtimeEnvironment.os.js.map +1 -0
  443. package/dist/runtime/runtimeEnvironment/index.d.ts +10 -0
  444. package/dist/runtime/runtimeEnvironment/index.d.ts.map +1 -0
  445. package/dist/runtime/runtimeEnvironment/index.js +9 -0
  446. package/dist/runtime/runtimeEnvironment/index.js.map +1 -0
  447. package/dist/runtime/runtimeEnvironment/runtimeEnvironment.core.d.ts +41 -0
  448. package/dist/runtime/runtimeEnvironment/runtimeEnvironment.core.d.ts.map +1 -0
  449. package/dist/runtime/runtimeEnvironment/runtimeEnvironment.core.js +105 -0
  450. package/dist/runtime/runtimeEnvironment/runtimeEnvironment.core.js.map +1 -0
  451. package/dist/runtime/runtimeEnvironment/runtimeEnvironment.type.d.ts +108 -0
  452. package/dist/runtime/runtimeEnvironment/runtimeEnvironment.type.d.ts.map +1 -0
  453. package/dist/runtime/runtimeEnvironment/runtimeEnvironment.type.js +2 -0
  454. package/dist/runtime/runtimeEnvironment/runtimeEnvironment.type.js.map +1 -0
  455. package/dist/runtime/runtimeError/index.d.ts +29 -0
  456. package/dist/runtime/runtimeError/index.d.ts.map +1 -0
  457. package/dist/runtime/runtimeError/index.js +47 -0
  458. package/dist/runtime/runtimeError/index.js.map +1 -0
  459. package/dist/runtime/runtimeError/runtimeError.base.d.ts +30 -0
  460. package/dist/runtime/runtimeError/runtimeError.base.d.ts.map +1 -0
  461. package/dist/runtime/runtimeError/runtimeError.base.js +81 -0
  462. package/dist/runtime/runtimeError/runtimeError.base.js.map +1 -0
  463. package/dist/runtime/runtimeError/runtimeError.lifecycle.d.ts +35 -0
  464. package/dist/runtime/runtimeError/runtimeError.lifecycle.d.ts.map +1 -0
  465. package/dist/runtime/runtimeError/runtimeError.lifecycle.js +77 -0
  466. package/dist/runtime/runtimeError/runtimeError.lifecycle.js.map +1 -0
  467. package/dist/runtime/runtimeError/runtimeError.specialized.d.ts +35 -0
  468. package/dist/runtime/runtimeError/runtimeError.specialized.d.ts.map +1 -0
  469. package/dist/runtime/runtimeError/runtimeError.specialized.js +79 -0
  470. package/dist/runtime/runtimeError/runtimeError.specialized.js.map +1 -0
  471. package/dist/runtime/runtimeError/runtimeError.type.d.ts +74 -0
  472. package/dist/runtime/runtimeError/runtimeError.type.d.ts.map +1 -0
  473. package/dist/runtime/runtimeError/runtimeError.type.js +28 -0
  474. package/dist/runtime/runtimeError/runtimeError.type.js.map +1 -0
  475. package/dist/runtime/runtimeLogger.d.ts +5 -0
  476. package/dist/runtime/runtimeLogger.d.ts.map +1 -0
  477. package/dist/runtime/runtimeLogger.js +18 -0
  478. package/dist/runtime/runtimeLogger.js.map +1 -0
  479. package/dist/runtime/runtimeManager/index.d.ts +12 -0
  480. package/dist/runtime/runtimeManager/index.d.ts.map +1 -0
  481. package/dist/runtime/runtimeManager/index.js +11 -0
  482. package/dist/runtime/runtimeManager/index.js.map +1 -0
  483. package/dist/runtime/runtimeManager/runtimeManager.core.d.ts +31 -0
  484. package/dist/runtime/runtimeManager/runtimeManager.core.d.ts.map +1 -0
  485. package/dist/runtime/runtimeManager/runtimeManager.core.js +136 -0
  486. package/dist/runtime/runtimeManager/runtimeManager.core.js.map +1 -0
  487. package/dist/runtime/runtimeManager/runtimeManager.error.d.ts +14 -0
  488. package/dist/runtime/runtimeManager/runtimeManager.error.d.ts.map +1 -0
  489. package/dist/runtime/runtimeManager/runtimeManager.error.js +21 -0
  490. package/dist/runtime/runtimeManager/runtimeManager.error.js.map +1 -0
  491. package/dist/runtime/runtimeManager/runtimeManager.factory.d.ts +7 -0
  492. package/dist/runtime/runtimeManager/runtimeManager.factory.d.ts.map +1 -0
  493. package/dist/runtime/runtimeManager/runtimeManager.factory.js +8 -0
  494. package/dist/runtime/runtimeManager/runtimeManager.factory.js.map +1 -0
  495. package/dist/runtime/runtimeManager/runtimeManager.lifecycle.d.ts +16 -0
  496. package/dist/runtime/runtimeManager/runtimeManager.lifecycle.d.ts.map +1 -0
  497. package/dist/runtime/runtimeManager/runtimeManager.lifecycle.js +49 -0
  498. package/dist/runtime/runtimeManager/runtimeManager.lifecycle.js.map +1 -0
  499. package/dist/runtime/runtimeManager/runtimeManager.type.d.ts +54 -0
  500. package/dist/runtime/runtimeManager/runtimeManager.type.d.ts.map +1 -0
  501. package/dist/runtime/runtimeManager/runtimeManager.type.js +2 -0
  502. package/dist/runtime/runtimeManager/runtimeManager.type.js.map +1 -0
  503. package/dist/runtime/runtimeOptions/index.d.ts +10 -0
  504. package/dist/runtime/runtimeOptions/index.d.ts.map +1 -0
  505. package/dist/runtime/runtimeOptions/index.js +9 -0
  506. package/dist/runtime/runtimeOptions/index.js.map +1 -0
  507. package/dist/runtime/runtimeOptions/runtimeOptions.defaults.d.ts +6 -0
  508. package/dist/runtime/runtimeOptions/runtimeOptions.defaults.d.ts.map +1 -0
  509. package/dist/runtime/runtimeOptions/runtimeOptions.defaults.js +37 -0
  510. package/dist/runtime/runtimeOptions/runtimeOptions.defaults.js.map +1 -0
  511. package/dist/runtime/runtimeOptions/runtimeOptions.resolver.d.ts +10 -0
  512. package/dist/runtime/runtimeOptions/runtimeOptions.resolver.d.ts.map +1 -0
  513. package/dist/runtime/runtimeOptions/runtimeOptions.resolver.js +80 -0
  514. package/dist/runtime/runtimeOptions/runtimeOptions.resolver.js.map +1 -0
  515. package/dist/runtime/runtimeOptions/runtimeOptions.type.d.ts +94 -0
  516. package/dist/runtime/runtimeOptions/runtimeOptions.type.d.ts.map +1 -0
  517. package/dist/runtime/runtimeOptions/runtimeOptions.type.js +2 -0
  518. package/dist/runtime/runtimeOptions/runtimeOptions.type.js.map +1 -0
  519. package/dist/runtime/runtimeOptions/runtimeOptions.validation.d.ts +26 -0
  520. package/dist/runtime/runtimeOptions/runtimeOptions.validation.d.ts.map +1 -0
  521. package/dist/runtime/runtimeOptions/runtimeOptions.validation.js +59 -0
  522. package/dist/runtime/runtimeOptions/runtimeOptions.validation.js.map +1 -0
  523. package/dist/runtime/runtimeShutdown/index.d.ts +10 -0
  524. package/dist/runtime/runtimeShutdown/index.d.ts.map +1 -0
  525. package/dist/runtime/runtimeShutdown/index.js +9 -0
  526. package/dist/runtime/runtimeShutdown/index.js.map +1 -0
  527. package/dist/runtime/runtimeShutdown/pipeline/index.d.ts +7 -0
  528. package/dist/runtime/runtimeShutdown/pipeline/index.d.ts.map +1 -0
  529. package/dist/runtime/runtimeShutdown/pipeline/index.js +7 -0
  530. package/dist/runtime/runtimeShutdown/pipeline/index.js.map +1 -0
  531. package/dist/runtime/runtimeShutdown/pipeline/runtimeShutdown.pipeline.d.ts +9 -0
  532. package/dist/runtime/runtimeShutdown/pipeline/runtimeShutdown.pipeline.d.ts.map +1 -0
  533. package/dist/runtime/runtimeShutdown/pipeline/runtimeShutdown.pipeline.js +67 -0
  534. package/dist/runtime/runtimeShutdown/pipeline/runtimeShutdown.pipeline.js.map +1 -0
  535. package/dist/runtime/runtimeShutdown/runtimeShutdown.core.d.ts +35 -0
  536. package/dist/runtime/runtimeShutdown/runtimeShutdown.core.d.ts.map +1 -0
  537. package/dist/runtime/runtimeShutdown/runtimeShutdown.core.js +147 -0
  538. package/dist/runtime/runtimeShutdown/runtimeShutdown.core.js.map +1 -0
  539. package/dist/runtime/runtimeShutdown/runtimeShutdown.type.d.ts +74 -0
  540. package/dist/runtime/runtimeShutdown/runtimeShutdown.type.d.ts.map +1 -0
  541. package/dist/runtime/runtimeShutdown/runtimeShutdown.type.js +2 -0
  542. package/dist/runtime/runtimeShutdown/runtimeShutdown.type.js.map +1 -0
  543. package/dist/runtime/runtimeState.state.d.ts +60 -0
  544. package/dist/runtime/runtimeState.state.d.ts.map +1 -0
  545. package/dist/runtime/runtimeState.state.js +157 -0
  546. package/dist/runtime/runtimeState.state.js.map +1 -0
  547. package/package.json +85 -0
@@ -0,0 +1,171 @@
1
+ import type { ApplicationContext } from "../application/applicationContext.context.js";
2
+ import type { LifecycleScope } from "../lifecycle/scope/lifecycleScope.scope.js";
3
+ import type { ModuleContext } from "./moduleContext.context.js";
4
+ /**
5
+ * Unique identifier for a module.
6
+ */
7
+ export type ModuleId = string;
8
+ /**
9
+ * Configuration supplied to a module during creation.
10
+ */
11
+ export type ModuleOptions = Readonly<Record<string, unknown>>;
12
+ /**
13
+ * Lifecycle hooks supported by a module.
14
+ *
15
+ * Modules can implement only the hooks they need.
16
+ */
17
+ export interface ModuleLifecycle {
18
+ /**
19
+ * Called when the module is initialized.
20
+ */
21
+ onInitialize?(context: ModuleContext): void | Promise<void>;
22
+ /**
23
+ * Called after all modules have been initialized.
24
+ *
25
+ * This is useful when a module depends on other modules
26
+ * being fully ready before performing startup work.
27
+ */
28
+ onReady?(context: ModuleContext): void | Promise<void>;
29
+ /**
30
+ * Called when the application begins shutting down.
31
+ */
32
+ onShutdown?(context: ModuleContext): void | Promise<void>;
33
+ /**
34
+ * Called when the module is destroyed.
35
+ */
36
+ onDestroy?(context: ModuleContext): void | Promise<void>;
37
+ }
38
+ /**
39
+ * Base contract implemented by Zudojs modules.
40
+ *
41
+ * A module represents an independently manageable unit of
42
+ * application functionality.
43
+ *
44
+ * Examples:
45
+ *
46
+ * AuthModule
47
+ * UserModule
48
+ * PaymentModule
49
+ * OrderModule
50
+ * NotificationModule
51
+ *
52
+ * The same module contract works inside a monolith,
53
+ * modular monolith, or independent microservice.
54
+ */
55
+ export interface Module extends ModuleLifecycle {
56
+ /**
57
+ * Unique module identifier.
58
+ */
59
+ readonly id: ModuleId;
60
+ /**
61
+ * Human-readable module name.
62
+ */
63
+ readonly name: string;
64
+ /**
65
+ * Optional semantic version of the module.
66
+ */
67
+ readonly version?: string;
68
+ /**
69
+ * Other modules required by this module.
70
+ */
71
+ readonly dependencies?: readonly ModuleId[];
72
+ /**
73
+ * Optional module configuration.
74
+ */
75
+ readonly options?: ModuleOptions;
76
+ /**
77
+ * Optional lifecycle scope.
78
+ *
79
+ * This describes how long resources owned by the module
80
+ * should live.
81
+ */
82
+ readonly scope?: LifecycleScope;
83
+ /**
84
+ * Called when the module is attached to an application.
85
+ *
86
+ * Optional. Modules that need access to the application context
87
+ * can implement this method.
88
+ */
89
+ attach?(application: unknown): void;
90
+ }
91
+ /**
92
+ * Abstract base class for modules.
93
+ *
94
+ * Framework users can extend this instead of implementing
95
+ * the Module interface manually.
96
+ */
97
+ export declare abstract class BaseModule implements Module {
98
+ /**
99
+ * Unique module identifier.
100
+ */
101
+ abstract readonly id: ModuleId;
102
+ /**
103
+ * Human-readable module name.
104
+ */
105
+ abstract readonly name: string;
106
+ /**
107
+ * Optional semantic version.
108
+ */
109
+ readonly version?: string;
110
+ /**
111
+ * Module dependencies.
112
+ */
113
+ readonly dependencies: readonly ModuleId[];
114
+ /**
115
+ * Module-specific options.
116
+ */
117
+ readonly options: ModuleOptions;
118
+ /**
119
+ * Lifecycle scope.
120
+ */
121
+ readonly scope?: LifecycleScope;
122
+ /**
123
+ * Application context becomes available after the module
124
+ * has been attached to an application.
125
+ */
126
+ protected applicationContext?: ApplicationContext;
127
+ protected constructor(options?: {
128
+ readonly version?: string;
129
+ readonly dependencies?: readonly ModuleId[];
130
+ readonly options?: ModuleOptions;
131
+ readonly scope?: LifecycleScope;
132
+ });
133
+ /**
134
+ * Called internally by the module runtime when the module
135
+ * becomes associated with an application.
136
+ */
137
+ attach(context: ApplicationContext): void;
138
+ /**
139
+ * Returns the application context.
140
+ *
141
+ * Throws if the module has not yet been attached.
142
+ */
143
+ protected getApplicationContext(): ApplicationContext;
144
+ /**
145
+ * Module initialization hook.
146
+ */
147
+ onInitialize(_context: ModuleContext): Promise<void>;
148
+ /**
149
+ * Module ready hook.
150
+ */
151
+ onReady(_context: ModuleContext): Promise<void>;
152
+ /**
153
+ * Module shutdown hook.
154
+ */
155
+ onShutdown(_context: ModuleContext): Promise<void>;
156
+ /**
157
+ * Module destruction hook.
158
+ */
159
+ onDestroy(_context: ModuleContext): Promise<void>;
160
+ }
161
+ /**
162
+ * Type guard for determining whether an object is a Module.
163
+ */
164
+ export declare function isModule(value: unknown): value is Module;
165
+ /**
166
+ * Creates a lightweight module definition.
167
+ *
168
+ * Useful for modules that do not require a class.
169
+ */
170
+ export declare function createModule(definition: Module): Module;
171
+ //# sourceMappingURL=module.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../src/modules/module.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,8CAA8C,CAAC;AAEvF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4CAA4C,CAAC;AAEjF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAEhE;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG,MAAM,CAAC;AAE9B;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;AAE9D;;;;GAIG;AACH,MAAM,WAAW,eAAe;IAC9B;;OAEG;IACH,YAAY,CAAC,CAAC,OAAO,EAAE,aAAa,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAE5D;;;;;OA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H,SAAS,CAAC,kBAAkB,CAAC,EAAE,kBAAkB,CAAC;IAElD,SAAS,aACP,OAAO,GAAE;QACP,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;QAC1B,QAAQ,CAAC,YAAY,CAAC,EAAE,SAAS,QAAQ,EAAE,CAAC;QAC5C,QAAQ,CAAC,OAAO,CAAC,EAAE,aAAa,CAAC;QACjC,QAAQ,CAAC,KAAK,CAAC,EAAE,cAAc,CAAC;KAC5B,EASP;IAED;;;OAGG;IACI,MAAM,CAAC,OAAO,EAAE,kBAAkB,GAAG,IAAI,CAE/C;IAED;;;;OAIG;IACH,SAAS,CAAC,qBAAqB,IAAI,kBAAkB,CAQpD;IAED;;OAEG;IACU,YAAY,CAAC,QAAQ,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CAEhE;IAED;;OAEG;IACU,OAAO,CAAC,QAAQ,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CAE3D;IAED;;OAEG;IACU,UAAU,CAAC,QAAQ,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CAE9D;IAED;;OAEG;IACU,SAAS,CAAC,QAAQ,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CAE7D;CACF;AAED;;GAEG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,MAAM,CAaxD;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAEvD"}
@@ -0,0 +1,99 @@
1
+ /**
2
+ * Abstract base class for modules.
3
+ *
4
+ * Framework users can extend this instead of implementing
5
+ * the Module interface manually.
6
+ */
7
+ export class BaseModule {
8
+ /**
9
+ * Optional semantic version.
10
+ */
11
+ version;
12
+ /**
13
+ * Module dependencies.
14
+ */
15
+ dependencies;
16
+ /**
17
+ * Module-specific options.
18
+ */
19
+ options;
20
+ /**
21
+ * Lifecycle scope.
22
+ */
23
+ scope;
24
+ /**
25
+ * Application context becomes available after the module
26
+ * has been attached to an application.
27
+ */
28
+ applicationContext;
29
+ constructor(options = {}) {
30
+ this.version = options.version;
31
+ this.dependencies = [...(options.dependencies ?? [])];
32
+ this.options = options.options ?? {};
33
+ this.scope = options.scope;
34
+ }
35
+ /**
36
+ * Called internally by the module runtime when the module
37
+ * becomes associated with an application.
38
+ */
39
+ attach(context) {
40
+ this.applicationContext = context;
41
+ }
42
+ /**
43
+ * Returns the application context.
44
+ *
45
+ * Throws if the module has not yet been attached.
46
+ */
47
+ getApplicationContext() {
48
+ if (!this.applicationContext) {
49
+ throw new Error(`Module "${this.name}" has not been attached to an application.`);
50
+ }
51
+ return this.applicationContext;
52
+ }
53
+ /**
54
+ * Module initialization hook.
55
+ */
56
+ async onInitialize(_context) {
57
+ // Optional hook.
58
+ }
59
+ /**
60
+ * Module ready hook.
61
+ */
62
+ async onReady(_context) {
63
+ // Optional hook.
64
+ }
65
+ /**
66
+ * Module shutdown hook.
67
+ */
68
+ async onShutdown(_context) {
69
+ // Optional hook.
70
+ }
71
+ /**
72
+ * Module destruction hook.
73
+ */
74
+ async onDestroy(_context) {
75
+ // Optional hook.
76
+ }
77
+ }
78
+ /**
79
+ * Type guard for determining whether an object is a Module.
80
+ */
81
+ export function isModule(value) {
82
+ if (value === null || typeof value !== "object") {
83
+ return false;
84
+ }
85
+ const candidate = value;
86
+ return (typeof candidate.id === "string" &&
87
+ candidate.id.length > 0 &&
88
+ typeof candidate.name === "string" &&
89
+ candidate.name.length > 0);
90
+ }
91
+ /**
92
+ * Creates a lightweight module definition.
93
+ *
94
+ * Useful for modules that do not require a class.
95
+ */
96
+ export function createModule(definition) {
97
+ return definition;
98
+ }
99
+ //# sourceMappingURL=module.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"module.js","sourceRoot":"","sources":["../../src/modules/module.ts"],"names":[],"mappings":"AA0GA;;;;;GAKG;AACH,MAAM,OAAgB,UAAU;IAW9B;;OAEG;IACa,OAAO,C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AAM,SAAS,GAAG,KAAwB,CAAC;IAE3C,OAAO,CACL,OAAO,SAAS,CAAC,EAAE,KAAK,QAAQ;QAChC,SAAS,CAAC,EAAE,CAAC,MAAM,GAAG,CAAC;QACvB,OAAO,SAAS,CAAC,IAAI,KAAK,QAAQ;QAClC,SAAS,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAC1B,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,YAAY,CAAC,UAAkB;IAC7C,OAAO,UAAU,CAAC;AACpB,CAAC"}
@@ -0,0 +1,170 @@
1
+ import type { ApplicationContext } from "../application/applicationContext.context.js";
2
+ import type { ConfigurationManager } from "../configuration/configurationManager.manager.js";
3
+ import type { Configuration } from "../configuration/core/configuration.js";
4
+ import type { Logger } from "../logging/core/logger.js";
5
+ import type { LifecycleScope } from "../lifecycle/scope/lifecycleScope.scope.js";
6
+ import type { Module, ModuleId, ModuleOptions } from "./module.js";
7
+ import type { ModuleMetadata } from "./moduleMetadata.metadata.js";
8
+ /**
9
+ * Dependencies exposed to a module through its context.
10
+ *
11
+ * This is intentionally a narrow interface. The module should
12
+ * receive capabilities, not unrestricted access to the runtime.
13
+ */
14
+ export interface ModuleContextDependencies {
15
+ /**
16
+ * Application context.
17
+ */
18
+ readonly application: ApplicationContext;
19
+ /**
20
+ * Configuration manager.
21
+ */
22
+ readonly configuration: ConfigurationManager;
23
+ /**
24
+ * Module-scoped logger.
25
+ */
26
+ readonly logger: Logger;
27
+ }
28
+ /**
29
+ * Immutable information describing the current module.
30
+ */
31
+ export interface ModuleContextInfo {
32
+ /**
33
+ * Module identifier.
34
+ */
35
+ readonly id: ModuleId;
36
+ /**
37
+ * Module name.
38
+ */
39
+ readonly name: string;
40
+ /**
41
+ * Module version.
42
+ */
43
+ readonly version?: string;
44
+ /**
45
+ * Module metadata.
46
+ */
47
+ readonly metadata?: ModuleMetadata;
48
+ /**
49
+ * Module options.
50
+ */
51
+ readonly options: ModuleOptions;
52
+ /**
53
+ * Lifecycle scope.
54
+ */
55
+ readonly scope?: LifecycleScope;
56
+ }
57
+ /**
58
+ * Context supplied to a module during its lifecycle.
59
+ *
60
+ * ModuleContext is deliberately narrower than ApplicationContext.
61
+ * It gives modules controlled access to framework capabilities.
62
+ */
63
+ export interface ModuleContext extends ModuleContextInfo {
64
+ /**
65
+ * Application-level context.
66
+ *
67
+ * This is exposed as a typed capability rather than requiring
68
+ * modules to import and manipulate the application directly.
69
+ */
70
+ readonly application: ApplicationContext;
71
+ /**
72
+ * Configuration manager.
73
+ */
74
+ readonly configuration: ConfigurationManager;
75
+ /**
76
+ * Logger scoped to this module.
77
+ */
78
+ readonly logger: Logger;
79
+ /**
80
+ * Gets the current configuration snapshot.
81
+ */
82
+ getConfiguration(): Configuration;
83
+ /**
84
+ * Gets a configuration value.
85
+ */
86
+ getConfig<T = unknown>(path: string): T | undefined;
87
+ /**
88
+ * Gets a required configuration value.
89
+ */
90
+ requireConfig<T = unknown>(path: string): T;
91
+ /**
92
+ * Returns another module's context.
93
+ *
94
+ * This should only be used for declared module dependencies.
95
+ */
96
+ getModuleContext(moduleId: ModuleId): ModuleContext | undefined;
97
+ /**
98
+ * Returns whether another module is available.
99
+ */
100
+ hasModule(moduleId: ModuleId): boolean;
101
+ }
102
+ /**
103
+ * Internal implementation of ModuleContext.
104
+ *
105
+ * The public ModuleContext interface is intentionally small,
106
+ * while this implementation owns the actual state.
107
+ */
108
+ export declare class DefaultModuleContext implements ModuleContext {
109
+ readonly id: ModuleId;
110
+ readonly name: string;
111
+ readonly version?: string;
112
+ readonly metadata?: ModuleMetadata;
113
+ readonly options: ModuleOptions;
114
+ readonly scope?: LifecycleScope;
115
+ readonly application: ApplicationContext;
116
+ readonly configuration: ConfigurationManager;
117
+ readonly logger: Logger;
118
+ private readonly moduleContexts;
119
+ constructor(module: Module, dependencies: ModuleContextDependencies, metadata?: ModuleMetadata, moduleContexts?: ReadonlyMap<ModuleId, ModuleContext>);
120
+ /**
121
+ * Returns the current configuration.
122
+ */
123
+ getConfiguration(): Configuration;
124
+ /**
125
+ * Gets an optional configuration value.
126
+ */
127
+ getConfig<T = unknown>(path: string): T | undefined;
128
+ /**
129
+ * Gets a required configuration value.
130
+ */
131
+ requireConfig<T = unknown>(path: string): T;
132
+ /**
133
+ * Gets the context of another module.
134
+ */
135
+ getModuleContext(moduleId: ModuleId): ModuleContext | undefined;
136
+ /**
137
+ * Checks whether another module exists.
138
+ */
139
+ hasModule(moduleId: ModuleId): boolean;
140
+ }
141
+ /**
142
+ * Options used to create a module context.
143
+ */
144
+ export interface CreateModuleContextOptions {
145
+ /**
146
+ * Module instance.
147
+ */
148
+ readonly module: Module;
149
+ /**
150
+ * Application-level dependencies.
151
+ */
152
+ readonly dependencies: ModuleContextDependencies;
153
+ /**
154
+ * Optional metadata associated with the module.
155
+ */
156
+ readonly metadata?: ModuleMetadata;
157
+ /**
158
+ * Contexts of modules that have already been resolved.
159
+ */
160
+ readonly moduleContexts?: ReadonlyMap<ModuleId, ModuleContext>;
161
+ }
162
+ /**
163
+ * Creates a module context.
164
+ */
165
+ export declare function createModuleContext(options: CreateModuleContextOptions): ModuleContext;
166
+ /**
167
+ * Type guard for ModuleContext.
168
+ */
169
+ export declare function isModuleContext(value: unknown): value is ModuleContext;
170
+ //# sourceMappingURL=moduleContext.context.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"moduleContext.context.d.ts","sourceRoot":"","sources":["../../src/modules/moduleContext.context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,8CAA8C,CAAC;AAEvF,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,kDAAkD,CAAC;AAE7F,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wCAAwC,CAAC;AAE5E,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AAExD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4CAA4C,CAAC;AAEjF,OAAO,KA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,MAAM,CAAC;IAExB;;OAEG;IACH,QAAQ,CAAC,YAAY,EAAE,yBAAyB,CAAC;IAEjD;;OAEG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,cAAc,CAAC;IAEnC;;OAEG;IACH,QAAQ,CAAC,cAAc,CAAC,EAAE,WAAW,CAAC,QAAQ,EAAE,aAAa,CAAC,CAAC;CAChE;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,0BAA0B,GAClC,aAAa,CAOf;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,aAAa,CAatE"}
@@ -0,0 +1,82 @@
1
+ /**
2
+ * Internal implementation of ModuleContext.
3
+ *
4
+ * The public ModuleContext interface is intentionally small,
5
+ * while this implementation owns the actual state.
6
+ */
7
+ export class DefaultModuleContext {
8
+ id;
9
+ name;
10
+ version;
11
+ metadata;
12
+ options;
13
+ scope;
14
+ application;
15
+ configuration;
16
+ logger;
17
+ moduleContexts;
18
+ constructor(module, dependencies, metadata, moduleContexts = new Map()) {
19
+ this.id = module.id;
20
+ this.name = module.name;
21
+ this.version = module.version;
22
+ this.metadata = metadata;
23
+ this.options = Object.freeze({
24
+ ...(module.options ?? {}),
25
+ });
26
+ this.scope = module.scope;
27
+ this.application = dependencies.application;
28
+ this.configuration = dependencies.configuration;
29
+ this.logger = dependencies.logger;
30
+ this.moduleContexts = moduleContexts;
31
+ }
32
+ /**
33
+ * Returns the current configuration.
34
+ */
35
+ getConfiguration() {
36
+ return this.configuration.getConfiguration();
37
+ }
38
+ /**
39
+ * Gets an optional configuration value.
40
+ */
41
+ getConfig(path) {
42
+ return this.configuration.get(path);
43
+ }
44
+ /**
45
+ * Gets a required configuration value.
46
+ */
47
+ requireConfig(path) {
48
+ return this.configuration.require(path);
49
+ }
50
+ /**
51
+ * Gets the context of another module.
52
+ */
53
+ getModuleContext(moduleId) {
54
+ return this.moduleContexts.get(moduleId);
55
+ }
56
+ /**
57
+ * Checks whether another module exists.
58
+ */
59
+ hasModule(moduleId) {
60
+ return this.moduleContexts.has(moduleId);
61
+ }
62
+ }
63
+ /**
64
+ * Creates a module context.
65
+ */
66
+ export function createModuleContext(options) {
67
+ return new DefaultModuleContext(options.module, options.dependencies, options.metadata, options.moduleContexts);
68
+ }
69
+ /**
70
+ * Type guard for ModuleContext.
71
+ */
72
+ export function isModuleContext(value) {
73
+ if (value === null || typeof value !== "object") {
74
+ return false;
75
+ }
76
+ const context = value;
77
+ return (typeof context.id === "string" &&
78
+ typeof context.name === "string" &&
79
+ typeof context.getConfig === "function" &&
80
+ typeof context.requireConfig === "function");
81
+ }
82
+ //# sourceMappingURL=moduleContext.context.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"moduleContext.context.js","sourceRoot":"","sources":["../../src/modules/moduleContext.context.ts"],"names":[],"mappings":"AA+HA;;;;;GAKG;AACH,MAAM,OAAO,oBAAoB;IACf,EAAE,CAAW;IAEb,IAAI,CAAS;IAEb,OAAO,CAAU;IAEjB,QAAQ,CAAkB;IAE1B,OAAO,CAAgB;IAEvB,KAAK,CAAkB;IAEvB,WAAW,CAAqB;IAEhC,aAAa,CAAuB;IAEpC,MAAM,CAAS;IAEd,cAAc,CAAuC;IAEtE,YACE,MAAc,EACd,YAAuC,EACvC,QAAyB,EACzB,cAAc,GAAyC,IAAI,GAAG,EAAE;QAEhE,IAAI,CAAC,EAAE,GAAG,MAAM,CAAC,EAAE,CAAC;QAEpB,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC;QAExB,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC;QAE9B,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QAEzB,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC;YAC3B,GAAG,CAAC,MAAM,CAAC,OAAO,IAAI,EAAE,CAAC;SAC1B,CAAC,CAAC;QAEH,IAAI,CAAC,KAAK,GAAG,MAA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AC,EAAE,KAAK,QAAQ;QAC9B,OAAO,OAAO,CAAC,IAAI,KAAK,QAAQ;QAChC,OAAO,OAAO,CAAC,SAAS,KAAK,UAAU;QACvC,OAAO,OAAO,CAAC,aAAa,KAAK,UAAU,CAC5C,CAAC;AACJ,CAAC"}
@@ -0,0 +1,112 @@
1
+ import type { Module, ModuleId, ModuleOptions } from "./module.js";
2
+ import type { ModuleMetadata } from "./moduleMetadata.metadata.js";
3
+ /**
4
+ * Factory used to create a module instance.
5
+ *
6
+ * The factory receives the module's resolved options.
7
+ */
8
+ export type ModuleFactory<TModule extends Module = Module> = (options?: ModuleOptions) => TModule;
9
+ /**
10
+ * Defines a module dependency.
11
+ *
12
+ * This is intentionally more expressive than simply using
13
+ * a ModuleId because future versions of the framework may
14
+ * need optional or versioned dependencies.
15
+ */
16
+ export interface ModuleDependencyDefinition {
17
+ /**
18
+ * Identifier of the required module.
19
+ */
20
+ readonly id: ModuleId;
21
+ /**
22
+ * Whether the dependency is optional.
23
+ *
24
+ * Defaults to false.
25
+ */
26
+ readonly optional?: boolean;
27
+ /**
28
+ * Optional version constraint.
29
+ */
30
+ readonly version?: string;
31
+ }
32
+ /**
33
+ * Complete static definition of a Zudojs module.
34
+ */
35
+ export interface ModuleDefinition<TModule extends Module = Module> {
36
+ /**
37
+ * Unique module identifier.
38
+ */
39
+ readonly id: ModuleId;
40
+ /**
41
+ * Human-readable module name.
42
+ */
43
+ readonly name: string;
44
+ /**
45
+ * Optional semantic version.
46
+ */
47
+ readonly version?: string;
48
+ /**
49
+ * Factory used to create the module instance.
50
+ */
51
+ readonly factory: ModuleFactory<TModule>;
52
+ /**
53
+ * Dependencies required by the module.
54
+ */
55
+ readonly dependencies?: readonly (ModuleId | ModuleDependencyDefinition)[];
56
+ /**
57
+ * Static module metadata.
58
+ */
59
+ readonly metadata?: ModuleMetadata;
60
+ /**
61
+ * Default module options.
62
+ */
63
+ readonly options?: ModuleOptions;
64
+ /**
65
+ * Whether the module should be automatically loaded.
66
+ *
67
+ * Defaults to true.
68
+ */
69
+ readonly autoLoad?: boolean;
70
+ /**
71
+ * Whether multiple instances of this module are allowed.
72
+ *
73
+ * Defaults to false.
74
+ */
75
+ readonly multiInstance?: boolean;
76
+ }
77
+ /**
78
+ * Options used when creating a module definition.
79
+ */
80
+ export interface DefineModuleOptions<TModule extends Module = Module> {
81
+ readonly id: ModuleId;
82
+ readonly name: string;
83
+ readonly version?: string;
84
+ readonly factory: ModuleFactory<TModule>;
85
+ readonly dependencies?: readonly (ModuleId | ModuleDependencyDefinition)[];
86
+ readonly metadata?: ModuleMetadata;
87
+ readonly options?: ModuleOptions;
88
+ readonly autoLoad?: boolean;
89
+ readonly multiInstance?: boolean;
90
+ }
91
+ /**
92
+ * Creates an immutable module definition.
93
+ *
94
+ * A definition describes a module but does not instantiate it.
95
+ */
96
+ export declare function defineModule<TModule extends Module = Module>(options: DefineModuleOptions<TModule>): ModuleDefinition<TModule>;
97
+ /**
98
+ * Converts a Module instance into a module definition.
99
+ *
100
+ * Useful when a module has already been implemented as a class.
101
+ */
102
+ export declare function moduleToDefinition<TModule extends Module>(module: TModule, factory?: ModuleFactory<TModule>): ModuleDefinition<TModule>;
103
+ /**
104
+ * Normalizes dependency declarations into a consistent
105
+ * representation.
106
+ */
107
+ export declare function normalizeDependencies(dependencies?: readonly (ModuleId | ModuleDependencyDefinition)[]): readonly ModuleDependencyDefinition[];
108
+ /**
109
+ * Checks whether a value is a valid module definition.
110
+ */
111
+ export declare function isModuleDefinition(value: unknown): value is ModuleDefinition;
112
+ //# sourceMappingURL=moduleDefinition.definition.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"moduleDefinition.definition.d.ts","sourceRoot":"","sources":["../../src/modules/moduleDefinition.definition.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAEnE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,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