@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,113 @@
1
+ import { Configuration } from "../core/configuration.js";
2
+ /**
3
+ * Default implementation of ConfigurationProvider.
4
+ *
5
+ * Responsible for coordinating configuration sources while
6
+ * keeping the rest of the application independent from them.
7
+ */
8
+ export class DefaultConfigurationProvider {
9
+ configuration;
10
+ sources;
11
+ constructor(options = {}) {
12
+ this.configuration = options.configuration ?? new Configuration();
13
+ this.sources = [...(options.sources ?? [])];
14
+ }
15
+ /**
16
+ * Returns the current configuration.
17
+ */
18
+ getConfiguration() {
19
+ return this.configuration;
20
+ }
21
+ /**
22
+ * Retrieves a configuration value.
23
+ */
24
+ get(path) {
25
+ return this.configuration.get(path);
26
+ }
27
+ /**
28
+ * Retrieves a required configuration value.
29
+ */
30
+ require(path) {
31
+ return this.configuration.require(path);
32
+ }
33
+ /**
34
+ * Retrieves a typed configuration value.
35
+ */
36
+ getByKey(key) {
37
+ return this.configuration.getByKey(key);
38
+ }
39
+ /**
40
+ * Retrieves a required typed configuration value.
41
+ */
42
+ requireByKey(key) {
43
+ return this.configuration.requireByKey(key);
44
+ }
45
+ /**
46
+ * Checks whether a configuration value exists.
47
+ */
48
+ has(path) {
49
+ return this.configuration.has(path);
50
+ }
51
+ /**
52
+ * Reloads configuration from all registered sources.
53
+ *
54
+ * Sources are loaded according to priority. Higher priority
55
+ * sources override values from lower priority sources.
56
+ */
57
+ async reload() {
58
+ const sources = [...this.sources].sort((a, b) => a.priority - b.priority);
59
+ let configuration = new Configuration();
60
+ for (const source of sources) {
61
+ const entries = await source.load();
62
+ for (const entry of entries) {
63
+ configuration = configuration.with(entry.path, entry.value, source.type);
64
+ }
65
+ }
66
+ this.configuration = configuration;
67
+ return configuration;
68
+ }
69
+ /**
70
+ * Returns the registered configuration sources.
71
+ */
72
+ getSources() {
73
+ return [...this.sources];
74
+ }
75
+ /**
76
+ * Updates the provider with a new configuration.
77
+ *
78
+ * This is used by ConfigurationManager to push loaded
79
+ * configuration into the provider.
80
+ */
81
+ setConfiguration(configuration) {
82
+ this.configuration = configuration;
83
+ }
84
+ /**
85
+ * Registers an additional configuration source.
86
+ *
87
+ * The source is not loaded automatically.
88
+ * Call reload() when the provider should rebuild its configuration.
89
+ */
90
+ addSource(source) {
91
+ this.sources.push(source);
92
+ }
93
+ /**
94
+ * Removes a configuration source by name.
95
+ *
96
+ * Returns true when a source was removed.
97
+ */
98
+ removeSource(name) {
99
+ const index = this.sources.findIndex((source) => source.name === name);
100
+ if (index === -1) {
101
+ return false;
102
+ }
103
+ this.sources.splice(index, 1);
104
+ return true;
105
+ }
106
+ }
107
+ /**
108
+ * Creates the default configuration provider.
109
+ */
110
+ export function createConfigurationProvider(options = {}) {
111
+ return new DefaultConfigurationProvider(options);
112
+ }
113
+ //# sourceMappingURL=configurationProvider.provider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"configurationProvider.provider.js","sourceRoot":"","sources":["../../../src/configuration/registry/configurationProvider.provider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAwEzD;;;;;GAKG;AACH,MAAM,OAAO,4BAA4B;IAC/B,aAAa,CAAgB;IAEpB,OAAO,CAAwB;IAEhD,YAAmB,OAAO,GAAiC,EAAE;QAC3D,IAAI,CAAC,aAAa,GAAG,OAAO,CAAC,aAAa,IAAI,IAAI,aAAa,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,CAChC,KAAK,CAAC,IAAI,EACV,KAAK,CAAC,KAAK,EACX,MAAM,CAAC,IAAI,CACZ,CAAC;YACJ,CAAC;QACH,CAAC;QAED,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;QAEnC,OAAO,aAAa,CAAC;IACvB,CAAC;IAED;;OAEG;IACI,UAAU;QACf,OAAO,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC;IAC3B,CAAC;IAED;;;;;OAKG;IACI,gBAAgB,CAAC,aAA4B;QAClD,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;IACrC,CAAC;IAED;;;;;OAKG;IACI,SAAS,CAAC,MAA2B;QAC1C,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAC5B,CAAC;IAED;;;;OAIG;IACI,YAAY,CAAC,IAAY;QAC9B,MAAM,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC;QAEvE,IAAI,KAAK,KAAK,CAAC,CAAC,EAAE,CAAC;YACjB,OAAO,KAAK,CAAC;QACf,CAAC;QAED,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;QAE9B,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AAED;;GAEG;AACH,MAAM,UAAU,2BAA2B,CACzC,OAAO,GAAiC,EAAE;IAE1C,OAAO,IAAI,4BAA4B,CAAC,OAAO,CAAC,CAAC;AACnD,CAAC"}
@@ -0,0 +1,143 @@
1
+ import { Configuration } from "../core/configuration.js";
2
+ import type { ConfigurationSource } from "../core/configurationSource.source.js";
3
+ /**
4
+ * A named configuration section.
5
+ *
6
+ * Sections allow modules to expose configuration under a
7
+ * predictable namespace.
8
+ *
9
+ * Example:
10
+ *
11
+ * auth
12
+ * database
13
+ * cache
14
+ * messaging
15
+ */
16
+ export interface ConfigurationSection {
17
+ /**
18
+ * Unique section name.
19
+ */
20
+ readonly name: string;
21
+ /**
22
+ * Configuration namespace/path represented by this section.
23
+ */
24
+ readonly path: string;
25
+ /**
26
+ * Optional description for documentation and diagnostics.
27
+ */
28
+ readonly description?: string;
29
+ }
30
+ /**
31
+ * Options used when registering a configuration section.
32
+ */
33
+ export interface ConfigurationSectionOptions {
34
+ /**
35
+ * Section name.
36
+ */
37
+ readonly name: string;
38
+ /**
39
+ * Configuration path represented by the section.
40
+ *
41
+ * Example:
42
+ *
43
+ * auth.jwt
44
+ */
45
+ readonly path?: string;
46
+ /**
47
+ * Optional description.
48
+ */
49
+ readonly description?: string;
50
+ }
51
+ /**
52
+ * Registry containing configuration sources and sections
53
+ * registered by the framework and application modules.
54
+ *
55
+ * The registry does not load configuration.
56
+ */
57
+ export declare class ConfigurationRegistry {
58
+ private readonly sources;
59
+ private readonly sections;
60
+ /**
61
+ * Registers a configuration source.
62
+ *
63
+ * Source names must be unique.
64
+ */
65
+ registerSource(source: ConfigurationSource): void;
66
+ /**
67
+ * Registers multiple configuration sources.
68
+ */
69
+ registerSources(sources: readonly ConfigurationSource[]): void;
70
+ /**
71
+ * Gets a registered configuration source.
72
+ */
73
+ getSource(name: string): ConfigurationSource | undefined;
74
+ /**
75
+ * Returns all registered configuration sources.
76
+ */
77
+ getSources(): readonly ConfigurationSource[];
78
+ /**
79
+ * Checks whether a source is registered.
80
+ */
81
+ hasSource(name: string): boolean;
82
+ /**
83
+ * Removes a registered source.
84
+ */
85
+ removeSource(name: string): boolean;
86
+ /**
87
+ * Registers a named configuration section.
88
+ */
89
+ registerSection(options: ConfigurationSectionOptions): ConfigurationSection;
90
+ /**
91
+ * Gets a registered configuration section.
92
+ */
93
+ getSection(name: string): ConfigurationSection | undefined;
94
+ /**
95
+ * Returns all registered configuration sections.
96
+ */
97
+ getSections(): readonly ConfigurationSection[];
98
+ /**
99
+ * Checks whether a configuration section exists.
100
+ */
101
+ hasSection(name: string): boolean;
102
+ /**
103
+ * Removes a configuration section.
104
+ */
105
+ removeSection(name: string): boolean;
106
+ /**
107
+ * Creates a scoped Configuration instance for
108
+ * a registered section.
109
+ *
110
+ * Example:
111
+ *
112
+ * registry.getConfigurationSection(
113
+ * configuration,
114
+ * "database",
115
+ * );
116
+ */
117
+ getConfigurationSection(configuration: Configuration, name: string): Configuration;
118
+ /**
119
+ * Clears all registered sources.
120
+ */
121
+ clearSources(): void;
122
+ /**
123
+ * Clears all registered sections.
124
+ */
125
+ clearSections(): void;
126
+ /**
127
+ * Clears the complete registry.
128
+ */
129
+ clear(): void;
130
+ /**
131
+ * Returns the number of registered sources.
132
+ */
133
+ sourceCount(): number;
134
+ /**
135
+ * Returns the number of registered sections.
136
+ */
137
+ sectionCount(): number;
138
+ }
139
+ /**
140
+ * Creates a new ConfigurationRegistry.
141
+ */
142
+ export declare function createConfigurationRegistry(): ConfigurationRegistry;
143
+ //# sourceMappingURL=configurationRegistry.registry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"configurationRegistry.registry.d.ts","sourceRoot":"","sources":["../../../src/configuration/registry/configurationRegistry.registry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAEzD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uCAAuC,CAAC;AAEjF;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,oBAAoB;IACnC;;OAEG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAEtB;;OAEG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAEtB;;OAEG;IACH,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;CAC/B;AAED;;GAEG;AACH,MAAM,WAAW,2BAA2B;IAC1C;;OAEG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAEtB;;;;;;OAMG;IACH,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAEvB;;OAEG;IACH,QAAQ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AI,MAAM,CAE5B;CACF;AAED;;GAEG;AACH,wBAAgB,2BAA2B,IAAI,qBAAqB,CAEnE"}
@@ -0,0 +1,157 @@
1
+ import { Configuration } from "../core/configuration.js";
2
+ /**
3
+ * Registry containing configuration sources and sections
4
+ * registered by the framework and application modules.
5
+ *
6
+ * The registry does not load configuration.
7
+ */
8
+ export class ConfigurationRegistry {
9
+ sources = new Map();
10
+ sections = new Map();
11
+ /**
12
+ * Registers a configuration source.
13
+ *
14
+ * Source names must be unique.
15
+ */
16
+ registerSource(source) {
17
+ if (this.sources.has(source.name)) {
18
+ throw new Error(`Configuration source "${source.name}" is already registered.`);
19
+ }
20
+ this.sources.set(source.name, source);
21
+ }
22
+ /**
23
+ * Registers multiple configuration sources.
24
+ */
25
+ registerSources(sources) {
26
+ for (const source of sources) {
27
+ this.registerSource(source);
28
+ }
29
+ }
30
+ /**
31
+ * Gets a registered configuration source.
32
+ */
33
+ getSource(name) {
34
+ return this.sources.get(name);
35
+ }
36
+ /**
37
+ * Returns all registered configuration sources.
38
+ */
39
+ getSources() {
40
+ return [...this.sources.values()];
41
+ }
42
+ /**
43
+ * Checks whether a source is registered.
44
+ */
45
+ hasSource(name) {
46
+ return this.sources.has(name);
47
+ }
48
+ /**
49
+ * Removes a registered source.
50
+ */
51
+ removeSource(name) {
52
+ return this.sources.delete(name);
53
+ }
54
+ /**
55
+ * Registers a named configuration section.
56
+ */
57
+ registerSection(options) {
58
+ const name = options.name.trim();
59
+ if (!name) {
60
+ throw new Error("Configuration section name cannot be empty.");
61
+ }
62
+ if (this.sections.has(name)) {
63
+ throw new Error(`Configuration section "${name}" is already registered.`);
64
+ }
65
+ const path = (options.path ?? name).trim().replace(/\s+/g, "");
66
+ if (!path) {
67
+ throw new Error(`Configuration path for section "${name}" cannot be empty.`);
68
+ }
69
+ const section = Object.freeze({
70
+ name,
71
+ path,
72
+ description: options.description,
73
+ });
74
+ this.sections.set(name, section);
75
+ return section;
76
+ }
77
+ /**
78
+ * Gets a registered configuration section.
79
+ */
80
+ getSection(name) {
81
+ return this.sections.get(name);
82
+ }
83
+ /**
84
+ * Returns all registered configuration sections.
85
+ */
86
+ getSections() {
87
+ return [...this.sections.values()];
88
+ }
89
+ /**
90
+ * Checks whether a configuration section exists.
91
+ */
92
+ hasSection(name) {
93
+ return this.sections.has(name);
94
+ }
95
+ /**
96
+ * Removes a configuration section.
97
+ */
98
+ removeSection(name) {
99
+ return this.sections.delete(name);
100
+ }
101
+ /**
102
+ * Creates a scoped Configuration instance for
103
+ * a registered section.
104
+ *
105
+ * Example:
106
+ *
107
+ * registry.getConfigurationSection(
108
+ * configuration,
109
+ * "database",
110
+ * );
111
+ */
112
+ getConfigurationSection(configuration, name) {
113
+ const section = this.sections.get(name);
114
+ if (!section) {
115
+ throw new Error(`Configuration section "${name}" is not registered.`);
116
+ }
117
+ return configuration.scope(section.path);
118
+ }
119
+ /**
120
+ * Clears all registered sources.
121
+ */
122
+ clearSources() {
123
+ this.sources.clear();
124
+ }
125
+ /**
126
+ * Clears all registered sections.
127
+ */
128
+ clearSections() {
129
+ this.sections.clear();
130
+ }
131
+ /**
132
+ * Clears the complete registry.
133
+ */
134
+ clear() {
135
+ this.clearSources();
136
+ this.clearSections();
137
+ }
138
+ /**
139
+ * Returns the number of registered sources.
140
+ */
141
+ sourceCount() {
142
+ return this.sources.size;
143
+ }
144
+ /**
145
+ * Returns the number of registered sections.
146
+ */
147
+ sectionCount() {
148
+ return this.sections.size;
149
+ }
150
+ }
151
+ /**
152
+ * Creates a new ConfigurationRegistry.
153
+ */
154
+ export function createConfigurationRegistry() {
155
+ return new ConfigurationRegistry();
156
+ }
157
+ //# sourceMappingURL=configurationRegistry.registry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"configurationRegistry.registry.js","sourceRoot":"","sources":["../../../src/configuration/registry/configurationRegistry.registry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AA0DzD;;;;;GAKG;A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AExC,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,MAAM,IAAI,KAAK,CAAC,0BAA0B,IAAI,sBAAsB,CAAC,CAAC;QACxE,CAAC;QAED,OAAO,aAAa,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3C,CAAC;IAED;;OAEG;IACI,YAAY;QACjB,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC;IACvB,CAAC;IAED;;OAEG;IACI,aAAa;QAClB,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAC;IACxB,CAAC;IAED;;OAEG;IACI,KAAK;QACV,IAAI,CAAC,YAAY,EAAE,CAAC;QACpB,IAAI,CAAC,aAAa,EAAE,CAAC;IACvB,CAAC;IAED;;OAEG;IACI,WAAW;QAChB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC;IAC3B,CAAC;IAED;;OAEG;IACI,YAAY;QACjB,OAAO,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC;IAC5B,CAAC;CACF;AAED;;GAEG;AACH,MAAM,UAAU,2BAA2B;IACzC,OAAO,IAAI,qBAAqB,EAAE,CAAC;AACrC,CAAC"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * @zudojs/core/configuration/registry
3
+ *
4
+ * Configuration registry and provider.
5
+ */
6
+ export { ConfigurationRegistry, createConfigurationRegistry, } from "./configurationRegistry.registry.js";
7
+ export type { ConfigurationSection, ConfigurationSectionOptions, } from "./configurationRegistry.registry.js";
8
+ export { DefaultConfigurationProvider, createConfigurationProvider, } from "./configurationProvider.provider.js";
9
+ export type { ConfigurationProvider, ConfigurationProviderOptions, } from "./configurationProvider.provider.js";
10
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/configuration/registry/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,qBAAqB,EACrB,2BAA2B,GAC5B,MAAM,qCAAqC,CAAC;AAE7C,YAAY,EACV,oBAAoB,EACpB,2BAA2B,GAC5B,MAAM,qCAAqC,CAAC;AAE7C,OAAO,EACL,4BAA4B,EAC5B,2BAA2B,GAC5B,MAAM,qCAAqC,CAAC;AAE7C,YAAY,EACV,qBAAqB,EACrB,4BAA4B,GAC7B,MAAM,qCAAqC,CAAC"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @zudojs/core/configuration/registry
3
+ *
4
+ * Configuration registry and provider.
5
+ */
6
+ export { ConfigurationRegistry, createConfigurationRegistry, } from "./configurationRegistry.registry.js";
7
+ export { DefaultConfigurationProvider, createConfigurationProvider, } from "./configurationProvider.provider.js";
8
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/configuration/registry/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,qBAAqB,EACrB,2BAA2B,GAC5B,MAAM,qCAAqC,CAAC;AAO7C,OAAO,EACL,4BAA4B,EAC5B,2BAA2B,GAC5B,MAAM,qCAAqC,CAAC"}
@@ -0,0 +1,159 @@
1
+ import type { Configuration, ConfigurationValue } from "../core/configuration.js";
2
+ /**
3
+ * Result returned by a configuration schema validator.
4
+ */
5
+ export interface ConfigurationValidationResult<T> {
6
+ /**
7
+ * Whether validation succeeded.
8
+ */
9
+ readonly success: boolean;
10
+ /**
11
+ * Validated and potentially transformed value.
12
+ */
13
+ readonly value?: T;
14
+ /**
15
+ * Validation errors.
16
+ */
17
+ readonly errors: readonly ConfigurationValidationIssue[];
18
+ }
19
+ /**
20
+ * Represents one configuration validation issue.
21
+ */
22
+ export interface ConfigurationValidationIssue {
23
+ /**
24
+ * Configuration path where the error occurred.
25
+ */
26
+ readonly path: string;
27
+ /**
28
+ * Human-readable error message.
29
+ */
30
+ readonly message: string;
31
+ /**
32
+ * Optional validation error code.
33
+ */
34
+ readonly code?: string;
35
+ /**
36
+ * Value that failed validation.
37
+ */
38
+ readonly value?: unknown;
39
+ }
40
+ /**
41
+ * Context supplied to configuration validators.
42
+ */
43
+ export interface ConfigurationValidationContext {
44
+ /**
45
+ * Configuration being validated.
46
+ */
47
+ readonly configuration: Configuration;
48
+ /**
49
+ * Current configuration path.
50
+ */
51
+ readonly path: string;
52
+ }
53
+ /**
54
+ * Function capable of validating a configuration value.
55
+ */
56
+ export type ConfigurationValidator<T> = (value: T, context: ConfigurationValidationContext) => ConfigurationValidationResult<T> | Promise<ConfigurationValidationResult<T>>;
57
+ /**
58
+ * Options used to create a configuration schema.
59
+ */
60
+ export interface ConfigurationSchemaOptions<T> {
61
+ /**
62
+ * Configuration path represented by the schema.
63
+ */
64
+ readonly path: string;
65
+ /**
66
+ * Whether the configuration value is required.
67
+ *
68
+ * Defaults to true.
69
+ */
70
+ readonly required?: boolean;
71
+ /**
72
+ * Optional default value.
73
+ */
74
+ readonly defaultValue?: T;
75
+ /**
76
+ * Optional custom validator.
77
+ */
78
+ readonly validator?: ConfigurationValidator<T>;
79
+ /**
80
+ * Optional description.
81
+ */
82
+ readonly description?: string;
83
+ }
84
+ /**
85
+ * Schema describing and validating one configuration value.
86
+ */
87
+ export interface ConfigurationSchema<T = ConfigurationValue> {
88
+ /**
89
+ * Configuration path.
90
+ */
91
+ readonly path: string;
92
+ /**
93
+ * Whether the value must exist.
94
+ */
95
+ readonly required: boolean;
96
+ /**
97
+ * Default value.
98
+ */
99
+ readonly defaultValue?: T;
100
+ /**
101
+ * Human-readable description.
102
+ */
103
+ readonly description?: string;
104
+ /**
105
+ * Validates the configuration value.
106
+ */
107
+ validate(configuration: Configuration): Promise<ConfigurationValidationResult<T>>;
108
+ }
109
+ /**
110
+ * Creates a configuration schema.
111
+ */
112
+ export declare function createConfigurationSchema<T = ConfigurationValue>(options: ConfigurationSchemaOptions<T>): ConfigurationSchema<T>;
113
+ /**
114
+ * Collection of configuration schemas.
115
+ */
116
+ export declare class ConfigurationSchemaRegistry {
117
+ private readonly schemas;
118
+ /**
119
+ * Registers a schema.
120
+ */
121
+ register<T>(schema: ConfigurationSchema<T>): void;
122
+ /**
123
+ * Registers multiple schemas.
124
+ */
125
+ registerMany(schemas: readonly ConfigurationSchema[]): void;
126
+ /**
127
+ * Retrieves a schema.
128
+ */
129
+ get<T>(path: string): ConfigurationSchema<T> | undefined;
130
+ /**
131
+ * Checks whether a schema exists.
132
+ */
133
+ has(path: string): boolean;
134
+ /**
135
+ * Removes a schema.
136
+ */
137
+ remove(path: string): boolean;
138
+ /**
139
+ * Returns all registered schemas.
140
+ */
141
+ getAll(): readonly ConfigurationSchema[];
142
+ /**
143
+ * Returns the number of registered schemas.
144
+ */
145
+ size(): number;
146
+ /**
147
+ * Removes all schemas.
148
+ */
149
+ clear(): void;
150
+ }
151
+ /**
152
+ * Creates a schema registry.
153
+ */
154
+ export declare function createConfigurationSchemaRegistry(): ConfigurationSchemaRegistry;
155
+ /**
156
+ * Validates every registered schema against a configuration.
157
+ */
158
+ export declare function validateConfiguration(configuration: Configuration, registry: ConfigurationSchemaRegistry): Promise<ConfigurationValidationResult<Configuration>>;
159
+ //# sourceMappingURL=configurationSchema.schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"configurationSchema.schema.d.ts","sourceRoot":"","sources":["../../../src/configuration/schema/configurationSchema.schema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,aAAa,EACb,kBAAkB,EACnB,MAAM,0BAA0B,CAAC;AAElC;;GAEG;AACH,MAAM,WAAW,6BAA6B,CAAC,CAAC;IAC9C;;OAEG;IACH,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAE1B;;OAEG;IACH,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IAEnB;;OAEG;IACH,QAAQ,CAAC,MAAM,EAAE,SAAS,4BAA4B,EAAE,CAAC;CAC1D;AAED;;GAEG;AACH,MAAM,WAAW,4BAA4B;IAC3C;;OAEG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IA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