@zudojs/core 0.0.1 → 1.0.0

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 (485) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +141 -7
  3. package/dist/application/application.d.ts +43 -2
  4. package/dist/application/application.js +111 -13
  5. package/dist/application/applicationContext.context.d.ts +15 -0
  6. package/dist/application/applicationContext.context.js +12 -0
  7. package/dist/application/createApplication.d.ts +78 -0
  8. package/dist/application/createApplication.js +104 -0
  9. package/dist/application/index.d.ts +2 -1
  10. package/dist/application/index.js +2 -1
  11. package/dist/configuration/configurationManager.manager.d.ts +32 -0
  12. package/dist/configuration/configurationManager.manager.js +86 -7
  13. package/dist/configuration/core/configuration.d.ts +60 -15
  14. package/dist/configuration/core/configuration.js +248 -51
  15. package/dist/configuration/core/configurationKey.key.d.ts +4 -2
  16. package/dist/configuration/core/configurationKey.key.js +2 -13
  17. package/dist/configuration/core/configurationPath.path.d.ts +17 -0
  18. package/dist/configuration/core/configurationPath.path.js +33 -0
  19. package/dist/configuration/core/index.d.ts +7 -1
  20. package/dist/configuration/core/index.js +1 -0
  21. package/dist/configuration/error/configurationError.error.d.ts +11 -0
  22. package/dist/configuration/error/configurationError.error.js +29 -1
  23. package/dist/configuration/error/configurationRedactor.redactor.d.ts +16 -0
  24. package/dist/configuration/error/configurationRedactor.redactor.js +83 -5
  25. package/dist/configuration/error/index.d.ts +2 -1
  26. package/dist/configuration/error/index.js +2 -1
  27. package/dist/configuration/index.d.ts +1 -1
  28. package/dist/configuration/loader/configurationLoader.loader.d.ts +47 -9
  29. package/dist/configuration/loader/configurationLoader.loader.js +107 -26
  30. package/dist/configuration/loader/index.d.ts +1 -1
  31. package/dist/configuration/loader/index.js +1 -1
  32. package/dist/configuration/registry/configurationProvider.provider.d.ts +26 -1
  33. package/dist/configuration/registry/configurationProvider.provider.js +33 -7
  34. package/dist/configuration/registry/configurationRegistry.registry.js +2 -1
  35. package/dist/configuration/schema/configurationSchema.schema.d.ts +0 -4
  36. package/dist/configuration/schema/configurationSchema.schema.js +11 -32
  37. package/dist/configuration/schema/configurationValidation.validator.d.ts +14 -2
  38. package/dist/configuration/schema/configurationValidation.validator.js +55 -7
  39. package/dist/configuration/schema/index.d.ts +1 -1
  40. package/dist/configuration/schema/index.js +1 -1
  41. package/dist/container/container.d.ts +52 -5
  42. package/dist/container/container.js +110 -33
  43. package/dist/container/index.d.ts +1 -1
  44. package/dist/container/index.js +1 -1
  45. package/dist/container/scope.d.ts +7 -6
  46. package/dist/context/core/contextAliases.deprecated.d.ts +32 -0
  47. package/dist/context/core/contextAliases.deprecated.js +6 -0
  48. package/dist/context/core/executionContext.context.d.ts +8 -0
  49. package/dist/context/core/executionContext.context.js +38 -15
  50. package/dist/context/core/index.d.ts +2 -2
  51. package/dist/context/core/index.js +2 -2
  52. package/dist/context/index.d.ts +20 -0
  53. package/dist/context/index.js +20 -0
  54. package/dist/context/provider/contextProvider.provider.d.ts +7 -4
  55. package/dist/context/provider/contextProvider.provider.js +9 -6
  56. package/dist/context/provider/contextStorage.storage.d.ts +47 -7
  57. package/dist/context/provider/contextStorage.storage.js +54 -12
  58. package/dist/context/provider/defaultContextStorage.storage.d.ts +18 -0
  59. package/dist/context/provider/defaultContextStorage.storage.js +20 -0
  60. package/dist/context/provider/index.d.ts +2 -1
  61. package/dist/context/provider/index.js +1 -0
  62. package/dist/errors/exceptions.d.ts +22 -0
  63. package/dist/errors/exceptions.js +38 -1
  64. package/dist/errors/frameworkError.error.d.ts +6 -9
  65. package/dist/errors/index.d.ts +1 -1
  66. package/dist/errors/index.js +1 -1
  67. package/dist/index.d.ts +4 -0
  68. package/dist/index.js +14 -0
  69. package/dist/lifecycle/core/index.d.ts +1 -1
  70. package/dist/lifecycle/core/index.js +1 -1
  71. package/dist/lifecycle/core/lifecycle.d.ts +47 -2
  72. package/dist/lifecycle/core/lifecycle.js +251 -85
  73. package/dist/lifecycle/core/lifecycleRegistry.registry.d.ts +8 -0
  74. package/dist/lifecycle/core/lifecycleRegistry.registry.js +20 -1
  75. package/dist/lifecycle/manager/lifecycleManager.manager.d.ts +21 -2
  76. package/dist/lifecycle/manager/lifecycleManager.manager.js +62 -99
  77. package/dist/lifecycle/scope/lifecycleScope.scope.d.ts +22 -1
  78. package/dist/lifecycle/scope/lifecycleScope.scope.js +85 -17
  79. package/dist/logging/console/consoleLogger.logger.d.ts +20 -1
  80. package/dist/logging/console/consoleLogger.logger.js +77 -11
  81. package/dist/logging/console/loggerFactory.factory.d.ts +6 -5
  82. package/dist/logging/console/loggerFactory.factory.js +1 -7
  83. package/dist/logging/core/index.d.ts +4 -3
  84. package/dist/logging/core/index.js +4 -3
  85. package/dist/logging/core/logEntry.entry.d.ts +41 -3
  86. package/dist/logging/core/logEntry.entry.js +114 -4
  87. package/dist/logging/core/logLevel.level.d.ts +18 -0
  88. package/dist/logging/core/logLevel.level.js +25 -1
  89. package/dist/logging/core/logRedaction.redaction.d.ts +38 -0
  90. package/dist/logging/core/logRedaction.redaction.js +19 -0
  91. package/dist/logging/core/logger.d.ts +14 -11
  92. package/dist/logging/core/logger.js +31 -6
  93. package/dist/logging/core/loggerContext.context.d.ts +12 -0
  94. package/dist/logging/core/loggerContext.context.js +19 -0
  95. package/dist/logging/core/loggerOptions.options.d.ts +17 -0
  96. package/dist/modules/index.d.ts +0 -1
  97. package/dist/modules/index.js +0 -6
  98. package/dist/modules/module.d.ts +7 -1
  99. package/dist/modules/moduleContext.context.d.ts +41 -7
  100. package/dist/modules/moduleContext.context.js +31 -8
  101. package/dist/modules/moduleDefinition.definition.d.ts +11 -7
  102. package/dist/modules/moduleDefinition.definition.js +41 -8
  103. package/dist/modules/moduleDependency/index.d.ts +2 -2
  104. package/dist/modules/moduleDependency/index.js +1 -1
  105. package/dist/modules/moduleDependency/moduleDependency.graph.d.ts +19 -2
  106. package/dist/modules/moduleDependency/moduleDependency.graph.js +122 -8
  107. package/dist/modules/moduleDependency/moduleDependency.ordering.d.ts +8 -0
  108. package/dist/modules/moduleDependency/moduleDependency.ordering.js +85 -57
  109. package/dist/modules/moduleDependency/moduleDependency.type.d.ts +28 -1
  110. package/dist/modules/moduleError/index.d.ts +1 -1
  111. package/dist/modules/moduleError/index.js +1 -1
  112. package/dist/modules/moduleError/moduleError.dependency.d.ts +11 -0
  113. package/dist/modules/moduleError/moduleError.dependency.js +15 -0
  114. package/dist/modules/moduleLifecycle/index.d.ts +5 -2
  115. package/dist/modules/moduleLifecycle/index.js +4 -1
  116. package/dist/modules/moduleLifecycle/moduleLifecycle.lifecycle.d.ts +44 -6
  117. package/dist/modules/moduleLifecycle/moduleLifecycle.lifecycle.js +153 -9
  118. package/dist/modules/moduleLifecycle/moduleLifecycle.stateMachine.d.ts +30 -5
  119. package/dist/modules/moduleLifecycle/moduleLifecycle.stateMachine.js +130 -10
  120. package/dist/modules/moduleLifecycle/moduleLifecycle.type.d.ts +65 -28
  121. package/dist/modules/moduleLifecycle/moduleLifecycle.type.js +15 -4
  122. package/dist/modules/moduleLoader/moduleLoader.loader.d.ts +39 -5
  123. package/dist/modules/moduleLoader/moduleLoader.loader.js +123 -50
  124. package/dist/modules/moduleLoader/moduleLoader.type.d.ts +4 -2
  125. package/dist/modules/moduleLoader/moduleLoader.type.js +10 -3
  126. package/dist/modules/moduleMetadata.metadata.js +15 -5
  127. package/dist/modules/moduleRegistry/index.d.ts +1 -1
  128. package/dist/modules/moduleRegistry/moduleRegistry.registry.d.ts +2 -2
  129. package/dist/modules/moduleRegistry/moduleRegistry.registry.js +38 -6
  130. package/dist/modules/moduleRegistry/moduleRegistry.type.d.ts +18 -1
  131. package/dist/runtime/index.d.ts +17 -15
  132. package/dist/runtime/index.js +14 -10
  133. package/dist/runtime/runtime.d.ts +135 -33
  134. package/dist/runtime/runtime.js +344 -114
  135. package/dist/runtime/runtimeBootstrap/index.d.ts +2 -1
  136. package/dist/runtime/runtimeBootstrap/index.js +1 -1
  137. package/dist/runtime/runtimeBootstrap/pipeline/index.d.ts +2 -2
  138. package/dist/runtime/runtimeBootstrap/pipeline/index.js +1 -2
  139. package/dist/runtime/runtimeBootstrap/pipeline/runtimeBootstrap.pipeline.d.ts +41 -15
  140. package/dist/runtime/runtimeBootstrap/pipeline/runtimeBootstrap.pipeline.js +98 -76
  141. package/dist/runtime/runtimeBootstrap/runtimeBootstrap.core.d.ts +7 -4
  142. package/dist/runtime/runtimeBootstrap/runtimeBootstrap.core.js +87 -59
  143. package/dist/runtime/runtimeBootstrap/runtimeBootstrap.type.d.ts +10 -4
  144. package/dist/runtime/runtimeContext/index.d.ts +3 -5
  145. package/dist/runtime/runtimeContext/index.js +2 -4
  146. package/dist/runtime/runtimeContext/runtimeContext.factory.d.ts +10 -4
  147. package/dist/runtime/runtimeContext/runtimeContext.factory.js +30 -7
  148. package/dist/runtime/runtimeContext/runtimeContext.type.d.ts +36 -47
  149. package/dist/runtime/runtimeEnvironment/detection/runtimeEnvironment.env.d.ts +5 -0
  150. package/dist/runtime/runtimeEnvironment/detection/runtimeEnvironment.env.js +6 -4
  151. package/dist/runtime/runtimeEnvironment/detection/runtimeEnvironment.os.d.ts +4 -0
  152. package/dist/runtime/runtimeEnvironment/detection/runtimeEnvironment.os.js +7 -9
  153. package/dist/runtime/runtimeEnvironment/index.d.ts +2 -2
  154. package/dist/runtime/runtimeEnvironment/index.js +1 -1
  155. package/dist/runtime/runtimeEnvironment/runtimeEnvironment.core.d.ts +20 -17
  156. package/dist/runtime/runtimeEnvironment/runtimeEnvironment.core.js +20 -13
  157. package/dist/runtime/runtimeEnvironment/runtimeEnvironment.type.d.ts +12 -1
  158. package/dist/runtime/runtimeError/index.d.ts +3 -3
  159. package/dist/runtime/runtimeError/index.js +1 -1
  160. package/dist/runtime/runtimeError/runtimeError.base.d.ts +15 -18
  161. package/dist/runtime/runtimeError/runtimeError.base.js +38 -36
  162. package/dist/runtime/runtimeError/runtimeError.lifecycle.d.ts +23 -8
  163. package/dist/runtime/runtimeError/runtimeError.lifecycle.js +31 -7
  164. package/dist/runtime/runtimeError/runtimeError.specialized.d.ts +1 -1
  165. package/dist/runtime/runtimeError/runtimeError.specialized.js +1 -1
  166. package/dist/runtime/runtimeError/runtimeError.type.d.ts +5 -9
  167. package/dist/runtime/runtimeLogger.d.ts +2 -2
  168. package/dist/runtime/runtimeLogger.js +3 -3
  169. package/dist/runtime/runtimeOptions/index.d.ts +1 -1
  170. package/dist/runtime/runtimeOptions/runtimeOptions.defaults.d.ts +1 -1
  171. package/dist/runtime/runtimeOptions/runtimeOptions.defaults.js +2 -0
  172. package/dist/runtime/runtimeOptions/runtimeOptions.resolver.js +5 -2
  173. package/dist/runtime/runtimeOptions/runtimeOptions.type.d.ts +45 -16
  174. package/dist/runtime/runtimeOptions/runtimeOptions.validation.js +0 -1
  175. package/dist/runtime/runtimeShutdown/index.d.ts +3 -2
  176. package/dist/runtime/runtimeShutdown/index.js +2 -2
  177. package/dist/runtime/runtimeShutdown/pipeline/index.d.ts +2 -1
  178. package/dist/runtime/runtimeShutdown/pipeline/index.js +1 -1
  179. package/dist/runtime/runtimeShutdown/pipeline/runtimeShutdown.pipeline.d.ts +37 -7
  180. package/dist/runtime/runtimeShutdown/pipeline/runtimeShutdown.pipeline.js +77 -51
  181. package/dist/runtime/runtimeShutdown/runtimeShutdown.core.d.ts +8 -16
  182. package/dist/runtime/runtimeShutdown/runtimeShutdown.core.js +85 -87
  183. package/dist/runtime/runtimeShutdown/runtimeShutdown.type.d.ts +9 -5
  184. package/dist/runtime/runtimeSignals/index.d.ts +8 -0
  185. package/dist/runtime/runtimeSignals/index.js +7 -0
  186. package/dist/runtime/runtimeSignals/runtimeSignals.d.ts +93 -0
  187. package/dist/runtime/runtimeSignals/runtimeSignals.js +149 -0
  188. package/dist/runtime/runtimeState.state.d.ts +32 -14
  189. package/dist/runtime/runtimeState.state.js +34 -27
  190. package/dist/runtime/runtimeTimeout.d.ts +40 -0
  191. package/dist/runtime/runtimeTimeout.js +42 -0
  192. package/package.json +21 -15
  193. package/dist/.tsbuildinfo +0 -1
  194. package/dist/application/application.d.ts.map +0 -1
  195. package/dist/application/application.js.map +0 -1
  196. package/dist/application/applicationContext.context.d.ts.map +0 -1
  197. package/dist/application/applicationContext.context.js.map +0 -1
  198. package/dist/application/applicationState.state.d.ts.map +0 -1
  199. package/dist/application/applicationState.state.js.map +0 -1
  200. package/dist/application/index.d.ts.map +0 -1
  201. package/dist/application/index.js.map +0 -1
  202. package/dist/configuration/configurationManager.manager.d.ts.map +0 -1
  203. package/dist/configuration/configurationManager.manager.js.map +0 -1
  204. package/dist/configuration/core/configuration.d.ts.map +0 -1
  205. package/dist/configuration/core/configuration.js.map +0 -1
  206. package/dist/configuration/core/configurationKey.key.d.ts.map +0 -1
  207. package/dist/configuration/core/configurationKey.key.js.map +0 -1
  208. package/dist/configuration/core/configurationSource.source.d.ts.map +0 -1
  209. package/dist/configuration/core/configurationSource.source.js.map +0 -1
  210. package/dist/configuration/core/index.d.ts.map +0 -1
  211. package/dist/configuration/core/index.js.map +0 -1
  212. package/dist/configuration/error/configurationError.error.d.ts.map +0 -1
  213. package/dist/configuration/error/configurationError.error.js.map +0 -1
  214. package/dist/configuration/error/configurationRedactor.redactor.d.ts.map +0 -1
  215. package/dist/configuration/error/configurationRedactor.redactor.js.map +0 -1
  216. package/dist/configuration/error/index.d.ts.map +0 -1
  217. package/dist/configuration/error/index.js.map +0 -1
  218. package/dist/configuration/events/configurationEvents.events.d.ts.map +0 -1
  219. package/dist/configuration/events/configurationEvents.events.js.map +0 -1
  220. package/dist/configuration/events/index.d.ts.map +0 -1
  221. package/dist/configuration/events/index.js.map +0 -1
  222. package/dist/configuration/index.d.ts.map +0 -1
  223. package/dist/configuration/index.js.map +0 -1
  224. package/dist/configuration/loader/configurationLoader.loader.d.ts.map +0 -1
  225. package/dist/configuration/loader/configurationLoader.loader.js.map +0 -1
  226. package/dist/configuration/loader/index.d.ts.map +0 -1
  227. package/dist/configuration/loader/index.js.map +0 -1
  228. package/dist/configuration/registry/configurationProvider.provider.d.ts.map +0 -1
  229. package/dist/configuration/registry/configurationProvider.provider.js.map +0 -1
  230. package/dist/configuration/registry/configurationRegistry.registry.d.ts.map +0 -1
  231. package/dist/configuration/registry/configurationRegistry.registry.js.map +0 -1
  232. package/dist/configuration/registry/index.d.ts.map +0 -1
  233. package/dist/configuration/registry/index.js.map +0 -1
  234. package/dist/configuration/schema/configurationSchema.schema.d.ts.map +0 -1
  235. package/dist/configuration/schema/configurationSchema.schema.js.map +0 -1
  236. package/dist/configuration/schema/configurationValidation.validator.d.ts.map +0 -1
  237. package/dist/configuration/schema/configurationValidation.validator.js.map +0 -1
  238. package/dist/configuration/schema/index.d.ts.map +0 -1
  239. package/dist/configuration/schema/index.js.map +0 -1
  240. package/dist/container/container.d.ts.map +0 -1
  241. package/dist/container/container.js.map +0 -1
  242. package/dist/container/index.d.ts.map +0 -1
  243. package/dist/container/index.js.map +0 -1
  244. package/dist/container/provider.d.ts.map +0 -1
  245. package/dist/container/provider.js.map +0 -1
  246. package/dist/container/scope.d.ts.map +0 -1
  247. package/dist/container/scope.js.map +0 -1
  248. package/dist/container/token.d.ts.map +0 -1
  249. package/dist/container/token.js.map +0 -1
  250. package/dist/context/core/context.d.ts +0 -95
  251. package/dist/context/core/context.d.ts.map +0 -1
  252. package/dist/context/core/context.js +0 -103
  253. package/dist/context/core/context.js.map +0 -1
  254. package/dist/context/core/contextKey.key.d.ts.map +0 -1
  255. package/dist/context/core/contextKey.key.js.map +0 -1
  256. package/dist/context/core/executionContext.context.d.ts.map +0 -1
  257. package/dist/context/core/executionContext.context.js.map +0 -1
  258. package/dist/context/core/index.d.ts.map +0 -1
  259. package/dist/context/core/index.js.map +0 -1
  260. package/dist/context/index.d.ts.map +0 -1
  261. package/dist/context/index.js.map +0 -1
  262. package/dist/context/provider/contextProvider.provider.d.ts.map +0 -1
  263. package/dist/context/provider/contextProvider.provider.js.map +0 -1
  264. package/dist/context/provider/contextStorage.storage.d.ts.map +0 -1
  265. package/dist/context/provider/contextStorage.storage.js.map +0 -1
  266. package/dist/context/provider/index.d.ts.map +0 -1
  267. package/dist/context/provider/index.js.map +0 -1
  268. package/dist/context/snapshot/contextSnapshot.snapshot.d.ts.map +0 -1
  269. package/dist/context/snapshot/contextSnapshot.snapshot.js.map +0 -1
  270. package/dist/context/snapshot/index.d.ts.map +0 -1
  271. package/dist/context/snapshot/index.js.map +0 -1
  272. package/dist/context/values/contextValues.values.d.ts.map +0 -1
  273. package/dist/context/values/contextValues.values.js.map +0 -1
  274. package/dist/context/values/index.d.ts.map +0 -1
  275. package/dist/context/values/index.js.map +0 -1
  276. package/dist/contracts/adapter.d.ts.map +0 -1
  277. package/dist/contracts/adapter.js.map +0 -1
  278. package/dist/contracts/disposable.d.ts.map +0 -1
  279. package/dist/contracts/disposable.js.map +0 -1
  280. package/dist/contracts/handler.d.ts.map +0 -1
  281. package/dist/contracts/handler.js.map +0 -1
  282. package/dist/contracts/index.d.ts.map +0 -1
  283. package/dist/contracts/index.js.map +0 -1
  284. package/dist/errors/errorCode.code.d.ts.map +0 -1
  285. package/dist/errors/errorCode.code.js.map +0 -1
  286. package/dist/errors/exceptions.d.ts.map +0 -1
  287. package/dist/errors/exceptions.js.map +0 -1
  288. package/dist/errors/frameworkError.error.d.ts.map +0 -1
  289. package/dist/errors/frameworkError.error.js.map +0 -1
  290. package/dist/errors/index.d.ts.map +0 -1
  291. package/dist/errors/index.js.map +0 -1
  292. package/dist/index.d.ts.map +0 -1
  293. package/dist/index.js.map +0 -1
  294. package/dist/lifecycle/core/index.d.ts.map +0 -1
  295. package/dist/lifecycle/core/index.js.map +0 -1
  296. package/dist/lifecycle/core/lifecycle.d.ts.map +0 -1
  297. package/dist/lifecycle/core/lifecycle.js.map +0 -1
  298. package/dist/lifecycle/core/lifecycleHook.hook.d.ts.map +0 -1
  299. package/dist/lifecycle/core/lifecycleHook.hook.js.map +0 -1
  300. package/dist/lifecycle/core/lifecycleRegistry.registry.d.ts.map +0 -1
  301. package/dist/lifecycle/core/lifecycleRegistry.registry.js.map +0 -1
  302. package/dist/lifecycle/core/lifecycleState.state.d.ts +0 -2
  303. package/dist/lifecycle/core/lifecycleState.state.d.ts.map +0 -1
  304. package/dist/lifecycle/core/lifecycleState.state.js +0 -2
  305. package/dist/lifecycle/core/lifecycleState.state.js.map +0 -1
  306. package/dist/lifecycle/index.d.ts.map +0 -1
  307. package/dist/lifecycle/index.js.map +0 -1
  308. package/dist/lifecycle/manager/index.d.ts.map +0 -1
  309. package/dist/lifecycle/manager/index.js.map +0 -1
  310. package/dist/lifecycle/manager/lifecycleManager.manager.d.ts.map +0 -1
  311. package/dist/lifecycle/manager/lifecycleManager.manager.js.map +0 -1
  312. package/dist/lifecycle/scope/index.d.ts.map +0 -1
  313. package/dist/lifecycle/scope/index.js.map +0 -1
  314. package/dist/lifecycle/scope/lifecycleScope.scope.d.ts.map +0 -1
  315. package/dist/lifecycle/scope/lifecycleScope.scope.js.map +0 -1
  316. package/dist/logging/console/consoleLogger.logger.d.ts.map +0 -1
  317. package/dist/logging/console/consoleLogger.logger.js.map +0 -1
  318. package/dist/logging/console/index.d.ts.map +0 -1
  319. package/dist/logging/console/index.js.map +0 -1
  320. package/dist/logging/console/loggerFactory.factory.d.ts.map +0 -1
  321. package/dist/logging/console/loggerFactory.factory.js.map +0 -1
  322. package/dist/logging/core/index.d.ts.map +0 -1
  323. package/dist/logging/core/index.js.map +0 -1
  324. package/dist/logging/core/logEntry.entry.d.ts.map +0 -1
  325. package/dist/logging/core/logEntry.entry.js.map +0 -1
  326. package/dist/logging/core/logLevel.level.d.ts.map +0 -1
  327. package/dist/logging/core/logLevel.level.js.map +0 -1
  328. package/dist/logging/core/logger.d.ts.map +0 -1
  329. package/dist/logging/core/logger.js.map +0 -1
  330. package/dist/logging/core/loggerContext.context.d.ts.map +0 -1
  331. package/dist/logging/core/loggerContext.context.js.map +0 -1
  332. package/dist/logging/core/loggerOptions.options.d.ts.map +0 -1
  333. package/dist/logging/core/loggerOptions.options.js.map +0 -1
  334. package/dist/logging/index.d.ts.map +0 -1
  335. package/dist/logging/index.js.map +0 -1
  336. package/dist/modules/index.d.ts.map +0 -1
  337. package/dist/modules/index.js.map +0 -1
  338. package/dist/modules/module.d.ts.map +0 -1
  339. package/dist/modules/module.js.map +0 -1
  340. package/dist/modules/moduleContext.context.d.ts.map +0 -1
  341. package/dist/modules/moduleContext.context.js.map +0 -1
  342. package/dist/modules/moduleDefinition.definition.d.ts.map +0 -1
  343. package/dist/modules/moduleDefinition.definition.js.map +0 -1
  344. package/dist/modules/moduleDependency/index.d.ts.map +0 -1
  345. package/dist/modules/moduleDependency/index.js.map +0 -1
  346. package/dist/modules/moduleDependency/moduleDependency.graph.d.ts.map +0 -1
  347. package/dist/modules/moduleDependency/moduleDependency.graph.js.map +0 -1
  348. package/dist/modules/moduleDependency/moduleDependency.ordering.d.ts.map +0 -1
  349. package/dist/modules/moduleDependency/moduleDependency.ordering.js.map +0 -1
  350. package/dist/modules/moduleDependency/moduleDependency.type.d.ts.map +0 -1
  351. package/dist/modules/moduleDependency/moduleDependency.type.js.map +0 -1
  352. package/dist/modules/moduleError/index.d.ts.map +0 -1
  353. package/dist/modules/moduleError/index.js.map +0 -1
  354. package/dist/modules/moduleError/moduleError.base.d.ts.map +0 -1
  355. package/dist/modules/moduleError/moduleError.base.js.map +0 -1
  356. package/dist/modules/moduleError/moduleError.dependency.d.ts.map +0 -1
  357. package/dist/modules/moduleError/moduleError.dependency.js.map +0 -1
  358. package/dist/modules/moduleError/moduleError.helpers.d.ts.map +0 -1
  359. package/dist/modules/moduleError/moduleError.helpers.js.map +0 -1
  360. package/dist/modules/moduleError/moduleError.lifecycle.d.ts.map +0 -1
  361. package/dist/modules/moduleError/moduleError.lifecycle.js.map +0 -1
  362. package/dist/modules/moduleError/moduleError.registration.d.ts.map +0 -1
  363. package/dist/modules/moduleError/moduleError.registration.js.map +0 -1
  364. package/dist/modules/moduleLifecycle/index.d.ts.map +0 -1
  365. package/dist/modules/moduleLifecycle/index.js.map +0 -1
  366. package/dist/modules/moduleLifecycle/moduleLifecycle.lifecycle.d.ts.map +0 -1
  367. package/dist/modules/moduleLifecycle/moduleLifecycle.lifecycle.js.map +0 -1
  368. package/dist/modules/moduleLifecycle/moduleLifecycle.stateMachine.d.ts.map +0 -1
  369. package/dist/modules/moduleLifecycle/moduleLifecycle.stateMachine.js.map +0 -1
  370. package/dist/modules/moduleLifecycle/moduleLifecycle.type.d.ts.map +0 -1
  371. package/dist/modules/moduleLifecycle/moduleLifecycle.type.js.map +0 -1
  372. package/dist/modules/moduleLoader/index.d.ts.map +0 -1
  373. package/dist/modules/moduleLoader/index.js.map +0 -1
  374. package/dist/modules/moduleLoader/moduleLoader.loader.d.ts.map +0 -1
  375. package/dist/modules/moduleLoader/moduleLoader.loader.js.map +0 -1
  376. package/dist/modules/moduleLoader/moduleLoader.type.d.ts.map +0 -1
  377. package/dist/modules/moduleLoader/moduleLoader.type.js.map +0 -1
  378. package/dist/modules/moduleMetadata.metadata.d.ts.map +0 -1
  379. package/dist/modules/moduleMetadata.metadata.js.map +0 -1
  380. package/dist/modules/moduleRegistry/index.d.ts.map +0 -1
  381. package/dist/modules/moduleRegistry/index.js.map +0 -1
  382. package/dist/modules/moduleRegistry/moduleRegistry.registry.d.ts.map +0 -1
  383. package/dist/modules/moduleRegistry/moduleRegistry.registry.js.map +0 -1
  384. package/dist/modules/moduleRegistry/moduleRegistry.type.d.ts.map +0 -1
  385. package/dist/modules/moduleRegistry/moduleRegistry.type.js.map +0 -1
  386. package/dist/runtime/index.d.ts.map +0 -1
  387. package/dist/runtime/index.js.map +0 -1
  388. package/dist/runtime/runtime.d.ts.map +0 -1
  389. package/dist/runtime/runtime.js.map +0 -1
  390. package/dist/runtime/runtimeBootstrap/index.d.ts.map +0 -1
  391. package/dist/runtime/runtimeBootstrap/index.js.map +0 -1
  392. package/dist/runtime/runtimeBootstrap/pipeline/index.d.ts.map +0 -1
  393. package/dist/runtime/runtimeBootstrap/pipeline/index.js.map +0 -1
  394. package/dist/runtime/runtimeBootstrap/pipeline/runtimeBootstrap.invoke.d.ts +0 -6
  395. package/dist/runtime/runtimeBootstrap/pipeline/runtimeBootstrap.invoke.d.ts.map +0 -1
  396. package/dist/runtime/runtimeBootstrap/pipeline/runtimeBootstrap.invoke.js +0 -27
  397. package/dist/runtime/runtimeBootstrap/pipeline/runtimeBootstrap.invoke.js.map +0 -1
  398. package/dist/runtime/runtimeBootstrap/pipeline/runtimeBootstrap.pipeline.d.ts.map +0 -1
  399. package/dist/runtime/runtimeBootstrap/pipeline/runtimeBootstrap.pipeline.js.map +0 -1
  400. package/dist/runtime/runtimeBootstrap/runtimeBootstrap.core.d.ts.map +0 -1
  401. package/dist/runtime/runtimeBootstrap/runtimeBootstrap.core.js.map +0 -1
  402. package/dist/runtime/runtimeBootstrap/runtimeBootstrap.type.d.ts.map +0 -1
  403. package/dist/runtime/runtimeBootstrap/runtimeBootstrap.type.js.map +0 -1
  404. package/dist/runtime/runtimeContext/index.d.ts.map +0 -1
  405. package/dist/runtime/runtimeContext/index.js.map +0 -1
  406. package/dist/runtime/runtimeContext/runtimeContext.core.d.ts +0 -38
  407. package/dist/runtime/runtimeContext/runtimeContext.core.d.ts.map +0 -1
  408. package/dist/runtime/runtimeContext/runtimeContext.core.js +0 -99
  409. package/dist/runtime/runtimeContext/runtimeContext.core.js.map +0 -1
  410. package/dist/runtime/runtimeContext/runtimeContext.factory.d.ts.map +0 -1
  411. package/dist/runtime/runtimeContext/runtimeContext.factory.js.map +0 -1
  412. package/dist/runtime/runtimeContext/runtimeContext.type.d.ts.map +0 -1
  413. package/dist/runtime/runtimeContext/runtimeContext.type.js.map +0 -1
  414. package/dist/runtime/runtimeEnvironment/detection/index.d.ts.map +0 -1
  415. package/dist/runtime/runtimeEnvironment/detection/index.js.map +0 -1
  416. package/dist/runtime/runtimeEnvironment/detection/runtimeEnvironment.detection.d.ts.map +0 -1
  417. package/dist/runtime/runtimeEnvironment/detection/runtimeEnvironment.detection.js.map +0 -1
  418. package/dist/runtime/runtimeEnvironment/detection/runtimeEnvironment.env.d.ts.map +0 -1
  419. package/dist/runtime/runtimeEnvironment/detection/runtimeEnvironment.env.js.map +0 -1
  420. package/dist/runtime/runtimeEnvironment/detection/runtimeEnvironment.os.d.ts.map +0 -1
  421. package/dist/runtime/runtimeEnvironment/detection/runtimeEnvironment.os.js.map +0 -1
  422. package/dist/runtime/runtimeEnvironment/index.d.ts.map +0 -1
  423. package/dist/runtime/runtimeEnvironment/index.js.map +0 -1
  424. package/dist/runtime/runtimeEnvironment/runtimeEnvironment.core.d.ts.map +0 -1
  425. package/dist/runtime/runtimeEnvironment/runtimeEnvironment.core.js.map +0 -1
  426. package/dist/runtime/runtimeEnvironment/runtimeEnvironment.type.d.ts.map +0 -1
  427. package/dist/runtime/runtimeEnvironment/runtimeEnvironment.type.js.map +0 -1
  428. package/dist/runtime/runtimeError/index.d.ts.map +0 -1
  429. package/dist/runtime/runtimeError/index.js.map +0 -1
  430. package/dist/runtime/runtimeError/runtimeError.base.d.ts.map +0 -1
  431. package/dist/runtime/runtimeError/runtimeError.base.js.map +0 -1
  432. package/dist/runtime/runtimeError/runtimeError.lifecycle.d.ts.map +0 -1
  433. package/dist/runtime/runtimeError/runtimeError.lifecycle.js.map +0 -1
  434. package/dist/runtime/runtimeError/runtimeError.specialized.d.ts.map +0 -1
  435. package/dist/runtime/runtimeError/runtimeError.specialized.js.map +0 -1
  436. package/dist/runtime/runtimeError/runtimeError.type.d.ts.map +0 -1
  437. package/dist/runtime/runtimeError/runtimeError.type.js.map +0 -1
  438. package/dist/runtime/runtimeLogger.d.ts.map +0 -1
  439. package/dist/runtime/runtimeLogger.js.map +0 -1
  440. package/dist/runtime/runtimeManager/index.d.ts +0 -12
  441. package/dist/runtime/runtimeManager/index.d.ts.map +0 -1
  442. package/dist/runtime/runtimeManager/index.js +0 -11
  443. package/dist/runtime/runtimeManager/index.js.map +0 -1
  444. package/dist/runtime/runtimeManager/runtimeManager.core.d.ts +0 -31
  445. package/dist/runtime/runtimeManager/runtimeManager.core.d.ts.map +0 -1
  446. package/dist/runtime/runtimeManager/runtimeManager.core.js +0 -136
  447. package/dist/runtime/runtimeManager/runtimeManager.core.js.map +0 -1
  448. package/dist/runtime/runtimeManager/runtimeManager.error.d.ts +0 -14
  449. package/dist/runtime/runtimeManager/runtimeManager.error.d.ts.map +0 -1
  450. package/dist/runtime/runtimeManager/runtimeManager.error.js +0 -21
  451. package/dist/runtime/runtimeManager/runtimeManager.error.js.map +0 -1
  452. package/dist/runtime/runtimeManager/runtimeManager.factory.d.ts +0 -7
  453. package/dist/runtime/runtimeManager/runtimeManager.factory.d.ts.map +0 -1
  454. package/dist/runtime/runtimeManager/runtimeManager.factory.js +0 -8
  455. package/dist/runtime/runtimeManager/runtimeManager.factory.js.map +0 -1
  456. package/dist/runtime/runtimeManager/runtimeManager.lifecycle.d.ts +0 -16
  457. package/dist/runtime/runtimeManager/runtimeManager.lifecycle.d.ts.map +0 -1
  458. package/dist/runtime/runtimeManager/runtimeManager.lifecycle.js +0 -49
  459. package/dist/runtime/runtimeManager/runtimeManager.lifecycle.js.map +0 -1
  460. package/dist/runtime/runtimeManager/runtimeManager.type.d.ts +0 -54
  461. package/dist/runtime/runtimeManager/runtimeManager.type.d.ts.map +0 -1
  462. package/dist/runtime/runtimeManager/runtimeManager.type.js +0 -2
  463. package/dist/runtime/runtimeManager/runtimeManager.type.js.map +0 -1
  464. package/dist/runtime/runtimeOptions/index.d.ts.map +0 -1
  465. package/dist/runtime/runtimeOptions/index.js.map +0 -1
  466. package/dist/runtime/runtimeOptions/runtimeOptions.defaults.d.ts.map +0 -1
  467. package/dist/runtime/runtimeOptions/runtimeOptions.defaults.js.map +0 -1
  468. package/dist/runtime/runtimeOptions/runtimeOptions.resolver.d.ts.map +0 -1
  469. package/dist/runtime/runtimeOptions/runtimeOptions.resolver.js.map +0 -1
  470. package/dist/runtime/runtimeOptions/runtimeOptions.type.d.ts.map +0 -1
  471. package/dist/runtime/runtimeOptions/runtimeOptions.type.js.map +0 -1
  472. package/dist/runtime/runtimeOptions/runtimeOptions.validation.d.ts.map +0 -1
  473. package/dist/runtime/runtimeOptions/runtimeOptions.validation.js.map +0 -1
  474. package/dist/runtime/runtimeShutdown/index.d.ts.map +0 -1
  475. package/dist/runtime/runtimeShutdown/index.js.map +0 -1
  476. package/dist/runtime/runtimeShutdown/pipeline/index.d.ts.map +0 -1
  477. package/dist/runtime/runtimeShutdown/pipeline/index.js.map +0 -1
  478. package/dist/runtime/runtimeShutdown/pipeline/runtimeShutdown.pipeline.d.ts.map +0 -1
  479. package/dist/runtime/runtimeShutdown/pipeline/runtimeShutdown.pipeline.js.map +0 -1
  480. package/dist/runtime/runtimeShutdown/runtimeShutdown.core.d.ts.map +0 -1
  481. package/dist/runtime/runtimeShutdown/runtimeShutdown.core.js.map +0 -1
  482. package/dist/runtime/runtimeShutdown/runtimeShutdown.type.d.ts.map +0 -1
  483. package/dist/runtime/runtimeShutdown/runtimeShutdown.type.js.map +0 -1
  484. package/dist/runtime/runtimeState.state.d.ts.map +0 -1
  485. package/dist/runtime/runtimeState.state.js.map +0 -1
@@ -7,6 +7,8 @@
7
7
  export const DEFAULT_SENSITIVE_PATTERNS = [
8
8
  "password",
9
9
  "passwd",
10
+ "pwd",
11
+ "passphrase",
10
12
  "secret",
11
13
  "token",
12
14
  "access_token",
@@ -17,8 +19,12 @@ export const DEFAULT_SENSITIVE_PATTERNS = [
17
19
  "privatekey",
18
20
  "client_secret",
19
21
  "authorization",
22
+ "auth",
20
23
  "credential",
21
24
  "credentials",
25
+ "dsn",
26
+ "connectionstring",
27
+ "connection_string",
22
28
  ];
23
29
  /**
24
30
  * Default value used when a sensitive configuration value
@@ -62,7 +68,11 @@ export class ConfigurationRedactor {
62
68
  reason: "exact-path",
63
69
  };
64
70
  }
65
- const pathSegments = normalizedPath.split(".");
71
+ /*
72
+ * Pattern matching runs on the original casing so camelCase
73
+ * word boundaries (apiToken → api token) survive.
74
+ */
75
+ const pathSegments = path.trim().split(".");
66
76
  for (const segment of pathSegments) {
67
77
  if (this.matchesSensitivePattern(segment)) {
68
78
  return {
@@ -71,7 +81,7 @@ export class ConfigurationRedactor {
71
81
  };
72
82
  }
73
83
  }
74
- if (this.matchesSensitivePattern(normalizedPath)) {
84
+ if (this.matchesSensitivePattern(path.trim())) {
75
85
  return {
76
86
  sensitive: true,
77
87
  reason: "pattern",
@@ -129,7 +139,12 @@ export class ConfigurationRedactor {
129
139
  }
130
140
  return value.map((item, index) => this.redactValue(item, parentPath ? `${parentPath}.${index}` : String(index)));
131
141
  }
132
- const result = {};
142
+ /*
143
+ * The result is built with a null prototype so keys such as
144
+ * "__proto__" are stored as ordinary own properties instead
145
+ * of hitting Object.prototype setters and vanishing.
146
+ */
147
+ const result = Object.create(null);
133
148
  for (const [key, childValue] of Object.entries(value)) {
134
149
  const path = parentPath ? `${parentPath}.${key}` : key;
135
150
  if (this.isSensitive(path)) {
@@ -143,11 +158,74 @@ export class ConfigurationRedactor {
143
158
  /**
144
159
  * Checks whether a path segment matches one of the
145
160
  * configured sensitive patterns.
161
+ *
162
+ * Matching is word-boundary aware: the segment is split into
163
+ * words on separators and camelCase transitions, and a pattern
164
+ * matches only when a consecutive run of words spells it out.
165
+ * This means "apiToken" and "access_token" match "token", but
166
+ * "tokenizer" and "secretary" do not match "token"/"secret".
146
167
  */
147
168
  matchesSensitivePattern(value) {
148
- const normalized = normalizePattern(value);
149
- return this.sensitivePatterns.some((pattern) => normalized.includes(pattern));
169
+ const words = splitWords(value);
170
+ if (words.length === 0) {
171
+ return false;
172
+ }
173
+ return this.sensitivePatterns.some((pattern) => matchesWordRun(words, pattern));
174
+ }
175
+ /**
176
+ * Redacts sensitive-looking fragments from free-form text such
177
+ * as error messages.
178
+ *
179
+ * Occurrences of "<sensitive>=value", "<sensitive>: value", and
180
+ * "<sensitive> value" have their value replaced. This is a
181
+ * best-effort scrub for diagnostics; it does not guarantee that
182
+ * arbitrary text contains no secrets.
183
+ */
184
+ redactText(text) {
185
+ let result = text;
186
+ for (const pattern of this.sensitivePatterns) {
187
+ const escaped = pattern.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
188
+ const expression = new RegExp(`(${escaped}[a-z0-9_-]*\\s*[=:]\\s*)("[^"]*"|'[^']*'|\\S+)`, "gi");
189
+ result = result.replace(expression, `$1${this.redactionValue}`);
190
+ }
191
+ return result;
192
+ }
193
+ }
194
+ /**
195
+ * Splits an identifier into normalized lowercase words.
196
+ *
197
+ * Splitting occurs on non-alphanumeric separators and on
198
+ * camelCase transitions.
199
+ */
200
+ function splitWords(value) {
201
+ return value
202
+ .replace(/([a-z0-9])([A-Z])/g, "$1 $2")
203
+ .split(/[^a-zA-Z0-9]+/)
204
+ .map((word) => word.toLowerCase())
205
+ .filter((word) => word.length > 0);
206
+ }
207
+ /**
208
+ * Checks whether a consecutive run of words spells out
209
+ * the supplied pattern.
210
+ */
211
+ function matchesWordRun(words, pattern) {
212
+ const target = splitWords(pattern).join("");
213
+ if (!target) {
214
+ return false;
215
+ }
216
+ for (let start = 0; start < words.length; start++) {
217
+ let accumulated = "";
218
+ for (let index = start; index < words.length; index++) {
219
+ accumulated += words[index];
220
+ if (accumulated === target) {
221
+ return true;
222
+ }
223
+ if (accumulated.length >= target.length) {
224
+ break;
225
+ }
226
+ }
150
227
  }
228
+ return false;
151
229
  }
152
230
  /**
153
231
  * Creates a ConfigurationRedactor.
@@ -3,7 +3,8 @@
3
3
  *
4
4
  * Configuration errors and redaction.
5
5
  */
6
- export { ConfigurationError, ConfigurationSourceError, ConfigurationMissingError, ConfigurationTypeError, ConfigurationSchemaError, ConfigurationConflictError, } from "./configurationError.error.js";
6
+ export { ConfigurationError, ConfigurationSourceError, ConfigurationMissingError, ConfigurationPathError, ConfigurationTypeError, ConfigurationSchemaError, ConfigurationConflictError, } from "./configurationError.error.js";
7
+ export { describeConfigurationCause } from "./configurationError.error.js";
7
8
  export type { ConfigurationErrorIssue } from "./configurationError.error.js";
8
9
  export { ConfigurationRedactor, createConfigurationRedactor, redactConfiguration, DEFAULT_SENSITIVE_PATTERNS, DEFAULT_REDACTION_VALUE, } from "./configurationRedactor.redactor.js";
9
10
  export type { ConfigurationRedactorOptions, ConfigurationSensitivity, RedactedConfiguration, } from "./configurationRedactor.redactor.js";
@@ -3,6 +3,7 @@
3
3
  *
4
4
  * Configuration errors and redaction.
5
5
  */
6
- export { ConfigurationError, ConfigurationSourceError, ConfigurationMissingError, ConfigurationTypeError, ConfigurationSchemaError, ConfigurationConflictError, } from "./configurationError.error.js";
6
+ export { ConfigurationError, ConfigurationSourceError, ConfigurationMissingError, ConfigurationPathError, ConfigurationTypeError, ConfigurationSchemaError, ConfigurationConflictError, } from "./configurationError.error.js";
7
+ export { describeConfigurationCause } from "./configurationError.error.js";
7
8
  export { ConfigurationRedactor, createConfigurationRedactor, redactConfiguration, DEFAULT_SENSITIVE_PATTERNS, DEFAULT_REDACTION_VALUE, } from "./configurationRedactor.redactor.js";
8
9
  //# sourceMappingURL=index.js.map
@@ -22,7 +22,7 @@ export * from "./error/index.js";
22
22
  * Configuration manager.
23
23
  */
24
24
  export { ConfigurationManager, ConfigurationManagerState, createConfigurationManager, } from "./configurationManager.manager.js";
25
- export type { ConfigurationManagerOptions, ConfigurationManagerResult, } from "./configurationManager.manager.js";
25
+ export type { ConfigurationManagerOptions, ConfigurationManagerResult, ConfigurationEventSubscription, } from "./configurationManager.manager.js";
26
26
  /**
27
27
  * Configuration lifecycle events.
28
28
  */
@@ -1,5 +1,6 @@
1
1
  import { Configuration } from "../core/configuration.js";
2
- import type { ConfigurationSource } from "../core/configurationSource.source.js";
2
+ import type { ConfigurationSource, ConfigurationSourceEntry } from "../core/configurationSource.source.js";
3
+ import { ConfigurationSourceError } from "../error/configurationError.error.js";
3
4
  /**
4
5
  * Options for loading configuration.
5
6
  */
@@ -35,6 +36,13 @@ export interface ConfigurationLoadResult {
35
36
  */
36
37
  readonly entryCount: number;
37
38
  }
39
+ /**
40
+ * Applies entries from one source onto a configuration.
41
+ *
42
+ * Higher level components (loader, provider) share this logic so
43
+ * source precedence behaves identically everywhere.
44
+ */
45
+ export declare function applyConfigurationSourceEntries(configuration: Configuration, source: ConfigurationSource, entries: readonly ConfigurationSourceEntry[]): Configuration;
38
46
  /**
39
47
  * Loads and combines configuration from multiple sources.
40
48
  *
@@ -51,8 +59,14 @@ export declare class ConfigurationLoader {
51
59
  * Sources are ordered by ascending priority.
52
60
  * Higher priority sources are therefore applied later
53
61
  * and override lower priority values.
62
+ *
63
+ * Additional sources (for example, sources registered with a
64
+ * ConfigurationRegistry) can be supplied; they are merged with
65
+ * the loader's own sources and ordered by priority. When an
66
+ * extra source shares a name with a registered source, the
67
+ * loader's own source wins.
54
68
  */
55
- load(): Promise<ConfigurationLoadResult>;
69
+ load(extraSources?: readonly ConfigurationSource[]): Promise<ConfigurationLoadResult>;
56
70
  /**
57
71
  * Loads sources sequentially.
58
72
  *
@@ -65,16 +79,15 @@ export declare class ConfigurationLoader {
65
79
  * Even though loading happens concurrently, entries are
66
80
  * applied according to source priority to preserve
67
81
  * deterministic precedence.
82
+ *
83
+ * All sources are attempted; when any fail, a single
84
+ * aggregated error listing every failed source is thrown.
68
85
  */
69
86
  private loadConcurrently;
70
87
  /**
71
88
  * Loads a single configuration source.
72
89
  */
73
90
  private loadSource;
74
- /**
75
- * Applies source entries to the configuration.
76
- */
77
- private applyEntries;
78
91
  /**
79
92
  * Returns sources ordered by priority.
80
93
  *
@@ -100,11 +113,36 @@ export declare class ConfigurationLoader {
100
113
  clearSources(): void;
101
114
  }
102
115
  /**
103
- * Error thrown when a configuration source cannot be loaded.
116
+ * Error thrown when one or more configuration sources cannot
117
+ * be loaded.
118
+ *
119
+ * A ConfigurationSourceError (code CONFIGURATION_LOAD_FAILED)
120
+ * that additionally carries the failed source object(s), so
121
+ * callers can catch load failures by either type or by code. Raw
122
+ * cause text is redacted before being embedded in the message.
104
123
  */
105
- export declare class ConfigurationLoadError extends Error {
106
- readonly source: ConfigurationSource;
124
+ export declare class ConfigurationLoadError extends ConfigurationSourceError {
125
+ /**
126
+ * The source that failed, for single-source failures.
127
+ */
128
+ readonly source?: ConfigurationSource;
129
+ /**
130
+ * Every failed source, for aggregate failures. Contains a
131
+ * single element for single-source failures.
132
+ */
133
+ readonly failures: readonly {
134
+ readonly source: ConfigurationSource;
135
+ readonly error: unknown;
136
+ }[];
107
137
  constructor(source: ConfigurationSource, cause: unknown);
138
+ /**
139
+ * Creates a single aggregated load error listing every
140
+ * failed source.
141
+ */
142
+ static aggregate(failures: readonly {
143
+ readonly source: ConfigurationSource;
144
+ readonly error: unknown;
145
+ }[]): ConfigurationLoadError;
108
146
  }
109
147
  /**
110
148
  * Creates a ConfigurationLoader.
@@ -1,4 +1,23 @@
1
1
  import { Configuration } from "../core/configuration.js";
2
+ import { sortConfigurationSources } from "../core/configurationSource.source.js";
3
+ import { ConfigurationSourceError, describeConfigurationCause, } from "../error/configurationError.error.js";
4
+ /**
5
+ * Applies entries from one source onto a configuration.
6
+ *
7
+ * Higher level components (loader, provider) share this logic so
8
+ * source precedence behaves identically everywhere.
9
+ */
10
+ export function applyConfigurationSourceEntries(configuration, source, entries) {
11
+ let result = configuration;
12
+ for (const entry of entries) {
13
+ const path = entry.path.trim();
14
+ if (!path) {
15
+ throw new ConfigurationLoadError(source, new Error("Configuration entry path cannot be empty."));
16
+ }
17
+ result = result.with(path, entry.value, source.type);
18
+ }
19
+ return result;
20
+ }
2
21
  /**
3
22
  * Loads and combines configuration from multiple sources.
4
23
  *
@@ -18,9 +37,15 @@ export class ConfigurationLoader {
18
37
  * Sources are ordered by ascending priority.
19
38
  * Higher priority sources are therefore applied later
20
39
  * and override lower priority values.
40
+ *
41
+ * Additional sources (for example, sources registered with a
42
+ * ConfigurationRegistry) can be supplied; they are merged with
43
+ * the loader's own sources and ordered by priority. When an
44
+ * extra source shares a name with a registered source, the
45
+ * loader's own source wins.
21
46
  */
22
- async load() {
23
- const sources = this.getSortedSources();
47
+ async load(extraSources = []) {
48
+ const sources = this.getSortedSources(extraSources);
24
49
  if (this.sequential) {
25
50
  return this.loadSequentially(sources);
26
51
  }
@@ -36,7 +61,7 @@ export class ConfigurationLoader {
36
61
  let entryCount = 0;
37
62
  for (const source of sources) {
38
63
  const entries = await this.loadSource(source);
39
- configuration = this.applyEntries(configuration, entries, source);
64
+ configuration = applyConfigurationSourceEntries(configuration, source, entries);
40
65
  entryCount += entries.length;
41
66
  }
42
67
  return {
@@ -51,16 +76,32 @@ export class ConfigurationLoader {
51
76
  * Even though loading happens concurrently, entries are
52
77
  * applied according to source priority to preserve
53
78
  * deterministic precedence.
79
+ *
80
+ * All sources are attempted; when any fail, a single
81
+ * aggregated error listing every failed source is thrown.
54
82
  */
55
83
  async loadConcurrently(sources) {
56
- const loaded = await Promise.all(sources.map(async (source) => ({
84
+ const settled = await Promise.allSettled(sources.map(async (source) => ({
57
85
  source,
58
86
  entries: await this.loadSource(source),
59
87
  })));
88
+ const failures = [];
89
+ const loaded = [];
90
+ for (let index = 0; index < settled.length; index++) {
91
+ const result = settled[index];
92
+ if (result.status === "fulfilled") {
93
+ loaded.push(result.value);
94
+ continue;
95
+ }
96
+ failures.push({ source: sources[index], error: result.reason });
97
+ }
98
+ if (failures.length > 0) {
99
+ throw ConfigurationLoadError.aggregate(failures);
100
+ }
60
101
  let configuration = new Configuration();
61
102
  let entryCount = 0;
62
103
  for (const result of loaded) {
63
- configuration = this.applyEntries(configuration, result.entries, result.source);
104
+ configuration = applyConfigurationSourceEntries(configuration, result.source, result.entries);
64
105
  entryCount += result.entries.length;
65
106
  }
66
107
  return {
@@ -81,28 +122,21 @@ export class ConfigurationLoader {
81
122
  throw new ConfigurationLoadError(source, error);
82
123
  }
83
124
  }
84
- /**
85
- * Applies source entries to the configuration.
86
- */
87
- applyEntries(configuration, entries, source) {
88
- let result = configuration;
89
- for (const entry of entries) {
90
- const path = entry.path.trim();
91
- if (!path) {
92
- throw new ConfigurationLoadError(source, new Error("Configuration entry path cannot be empty."));
93
- }
94
- result = result.with(path, entry.value, source.type);
95
- }
96
- return result;
97
- }
98
125
  /**
99
126
  * Returns sources ordered by priority.
100
127
  *
101
128
  * Lower priority sources are loaded first.
102
129
  * Higher priority sources override them.
103
130
  */
104
- getSortedSources() {
105
- return [...this.sources].sort((a, b) => a.priority - b.priority);
131
+ getSortedSources(extraSources = []) {
132
+ const merged = new Map();
133
+ for (const source of extraSources) {
134
+ merged.set(source.name, source);
135
+ }
136
+ for (const source of this.sources) {
137
+ merged.set(source.name, source);
138
+ }
139
+ return sortConfigurationSources([...merged.values()]);
106
140
  }
107
141
  /**
108
142
  * Adds a configuration source.
@@ -135,15 +169,62 @@ export class ConfigurationLoader {
135
169
  }
136
170
  }
137
171
  /**
138
- * Error thrown when a configuration source cannot be loaded.
172
+ * Error thrown when one or more configuration sources cannot
173
+ * be loaded.
174
+ *
175
+ * A ConfigurationSourceError (code CONFIGURATION_LOAD_FAILED)
176
+ * that additionally carries the failed source object(s), so
177
+ * callers can catch load failures by either type or by code. Raw
178
+ * cause text is redacted before being embedded in the message.
139
179
  */
140
- export class ConfigurationLoadError extends Error {
180
+ export class ConfigurationLoadError extends ConfigurationSourceError {
181
+ /**
182
+ * The source that failed, for single-source failures.
183
+ */
141
184
  source;
185
+ /**
186
+ * Every failed source, for aggregate failures. Contains a
187
+ * single element for single-source failures.
188
+ */
189
+ failures;
142
190
  constructor(source, cause) {
143
- const message = cause instanceof Error ? cause.message : String(cause);
144
- super(`Failed to load configuration source "${source.name}": ${message}`);
191
+ super(source.name, source.type, cause);
192
+ this.name = "ConfigurationLoadError";
145
193
  this.source = source;
146
- this.cause = cause;
194
+ this.failures = Object.freeze([{ source, error: cause }]);
195
+ }
196
+ /**
197
+ * Creates a single aggregated load error listing every
198
+ * failed source.
199
+ */
200
+ static aggregate(failures) {
201
+ if (failures.length === 1) {
202
+ const failure = failures[0];
203
+ const single = failure.error;
204
+ if (single instanceof ConfigurationLoadError)
205
+ return single;
206
+ return new ConfigurationLoadError(failure.source, single);
207
+ }
208
+ const first = failures[0];
209
+ const error = new ConfigurationLoadError(first.source, first.error);
210
+ const summary = failures
211
+ .map((failure) => `"${failure.source.name}": ${describeConfigurationCause(failure.error instanceof ConfigurationLoadError
212
+ ? (failure.error.cause ?? failure.error)
213
+ : failure.error)}`)
214
+ .join("; ");
215
+ Object.defineProperty(error, "message", {
216
+ value: `Failed to load ${failures.length} configuration sources: ${summary}`,
217
+ configurable: true,
218
+ writable: true,
219
+ });
220
+ Object.defineProperty(error, "failures", {
221
+ value: Object.freeze(failures.map((failure) => ({
222
+ source: failure.source,
223
+ error: failure.error,
224
+ }))),
225
+ configurable: true,
226
+ });
227
+ return error;
147
228
  }
148
229
  }
149
230
  /**
@@ -3,6 +3,6 @@
3
3
  *
4
4
  * Configuration loading pipeline.
5
5
  */
6
- export { ConfigurationLoader, ConfigurationLoadError, createConfigurationLoader, } from "./configurationLoader.loader.js";
6
+ export { ConfigurationLoader, ConfigurationLoadError, createConfigurationLoader, applyConfigurationSourceEntries, } from "./configurationLoader.loader.js";
7
7
  export type { ConfigurationLoaderOptions, ConfigurationLoadResult, } from "./configurationLoader.loader.js";
8
8
  //# sourceMappingURL=index.d.ts.map
@@ -3,5 +3,5 @@
3
3
  *
4
4
  * Configuration loading pipeline.
5
5
  */
6
- export { ConfigurationLoader, ConfigurationLoadError, createConfigurationLoader, } from "./configurationLoader.loader.js";
6
+ export { ConfigurationLoader, ConfigurationLoadError, createConfigurationLoader, applyConfigurationSourceEntries, } from "./configurationLoader.loader.js";
7
7
  //# sourceMappingURL=index.js.map
@@ -43,6 +43,15 @@ export interface ConfigurationProvider {
43
43
  * registered with the provider.
44
44
  */
45
45
  getSources(): readonly ConfigurationSource[];
46
+ /**
47
+ * Replaces the provider's active configuration.
48
+ *
49
+ * Optional: providers that build configuration exclusively
50
+ * from their own sources may omit it. When present, it is used
51
+ * by ConfigurationManager to push loaded configuration into
52
+ * the provider.
53
+ */
54
+ setConfiguration?(configuration: Configuration): void;
46
55
  }
47
56
  /**
48
57
  * Options used to create a ConfigurationProvider.
@@ -65,7 +74,15 @@ export interface ConfigurationProviderOptions {
65
74
  */
66
75
  export declare class DefaultConfigurationProvider implements ConfigurationProvider {
67
76
  private configuration;
77
+ /**
78
+ * Configuration supplied at construction time.
79
+ *
80
+ * Reloads layer source values on top of this configuration so
81
+ * programmatic defaults survive a reload.
82
+ */
83
+ private readonly initialConfiguration;
68
84
  private readonly sources;
85
+ private reloadPromise;
69
86
  constructor(options?: ConfigurationProviderOptions);
70
87
  /**
71
88
  * Returns the current configuration.
@@ -95,9 +112,17 @@ export declare class DefaultConfigurationProvider implements ConfigurationProvid
95
112
  * Reloads configuration from all registered sources.
96
113
  *
97
114
  * Sources are loaded according to priority. Higher priority
98
- * sources override values from lower priority sources.
115
+ * sources override values from lower priority sources. Values
116
+ * are layered on top of the initial configuration so
117
+ * programmatic defaults are preserved.
118
+ *
119
+ * Concurrent reload calls share a single in-flight reload.
99
120
  */
100
121
  reload(): Promise<Configuration>;
122
+ /**
123
+ * Executes one reload pass.
124
+ */
125
+ private performReload;
101
126
  /**
102
127
  * Returns the registered configuration sources.
103
128
  */
@@ -1,4 +1,6 @@
1
1
  import { Configuration } from "../core/configuration.js";
2
+ import { sortConfigurationSources } from "../core/configurationSource.source.js";
3
+ import { applyConfigurationSourceEntries } from "../loader/configurationLoader.loader.js";
2
4
  /**
3
5
  * Default implementation of ConfigurationProvider.
4
6
  *
@@ -7,9 +9,18 @@ import { Configuration } from "../core/configuration.js";
7
9
  */
8
10
  export class DefaultConfigurationProvider {
9
11
  configuration;
12
+ /**
13
+ * Configuration supplied at construction time.
14
+ *
15
+ * Reloads layer source values on top of this configuration so
16
+ * programmatic defaults survive a reload.
17
+ */
18
+ initialConfiguration;
10
19
  sources;
20
+ reloadPromise;
11
21
  constructor(options = {}) {
12
- this.configuration = options.configuration ?? new Configuration();
22
+ this.initialConfiguration = options.configuration ?? new Configuration();
23
+ this.configuration = this.initialConfiguration;
13
24
  this.sources = [...(options.sources ?? [])];
14
25
  }
15
26
  /**
@@ -52,16 +63,31 @@ export class DefaultConfigurationProvider {
52
63
  * Reloads configuration from all registered sources.
53
64
  *
54
65
  * Sources are loaded according to priority. Higher priority
55
- * sources override values from lower priority sources.
66
+ * sources override values from lower priority sources. Values
67
+ * are layered on top of the initial configuration so
68
+ * programmatic defaults are preserved.
69
+ *
70
+ * Concurrent reload calls share a single in-flight reload.
56
71
  */
57
72
  async reload() {
58
- const sources = [...this.sources].sort((a, b) => a.priority - b.priority);
59
- let configuration = new Configuration();
73
+ if (this.reloadPromise) {
74
+ return this.reloadPromise;
75
+ }
76
+ const reload = this.performReload().finally(() => {
77
+ this.reloadPromise = undefined;
78
+ });
79
+ this.reloadPromise = reload;
80
+ return reload;
81
+ }
82
+ /**
83
+ * Executes one reload pass.
84
+ */
85
+ async performReload() {
86
+ const sources = sortConfigurationSources(this.sources);
87
+ let configuration = this.initialConfiguration;
60
88
  for (const source of sources) {
61
89
  const entries = await source.load();
62
- for (const entry of entries) {
63
- configuration = configuration.with(entry.path, entry.value, source.type);
64
- }
90
+ configuration = applyConfigurationSourceEntries(configuration, source, entries);
65
91
  }
66
92
  this.configuration = configuration;
67
93
  return configuration;
@@ -1,4 +1,5 @@
1
1
  import { Configuration } from "../core/configuration.js";
2
+ import { normalizeConfigurationPath } from "../core/configurationPath.path.js";
2
3
  /**
3
4
  * Registry containing configuration sources and sections
4
5
  * registered by the framework and application modules.
@@ -62,7 +63,7 @@ export class ConfigurationRegistry {
62
63
  if (this.sections.has(name)) {
63
64
  throw new Error(`Configuration section "${name}" is already registered.`);
64
65
  }
65
- const path = (options.path ?? name).trim().replace(/\s+/g, "");
66
+ const path = normalizeConfigurationPath(options.path ?? name);
66
67
  if (!path) {
67
68
  throw new Error(`Configuration path for section "${name}" cannot be empty.`);
68
69
  }
@@ -152,8 +152,4 @@ export declare class ConfigurationSchemaRegistry {
152
152
  * Creates a schema registry.
153
153
  */
154
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
155
  //# sourceMappingURL=configurationSchema.schema.d.ts.map
@@ -1,3 +1,4 @@
1
+ import { normalizeConfigurationPath } from "../core/configurationPath.path.js";
1
2
  /**
2
3
  * Creates a configuration schema.
3
4
  */
@@ -16,6 +17,16 @@ export function createConfigurationSchema(options) {
16
17
  const exists = configuration.has(path);
17
18
  if (!exists) {
18
19
  if (options.defaultValue !== undefined) {
20
+ /*
21
+ * Defaults are validated too, so an invalid default
22
+ * cannot silently pass validation.
23
+ */
24
+ if (options.validator) {
25
+ return options.validator(options.defaultValue, {
26
+ configuration,
27
+ path,
28
+ });
29
+ }
19
30
  return {
20
31
  success: true,
21
32
  value: options.defaultValue,
@@ -120,36 +131,4 @@ export class ConfigurationSchemaRegistry {
120
131
  export function createConfigurationSchemaRegistry() {
121
132
  return new ConfigurationSchemaRegistry();
122
133
  }
123
- /**
124
- * Validates every registered schema against a configuration.
125
- */
126
- export async function validateConfiguration(configuration, registry) {
127
- const errors = [];
128
- for (const schema of registry.getAll()) {
129
- const result = await schema.validate(configuration);
130
- if (!result.success) {
131
- errors.push(...result.errors);
132
- }
133
- }
134
- if (errors.length > 0) {
135
- return {
136
- success: false,
137
- errors,
138
- };
139
- }
140
- return {
141
- success: true,
142
- value: configuration,
143
- errors: [],
144
- };
145
- }
146
- /**
147
- * Normalizes a configuration path.
148
- */
149
- function normalizeConfigurationPath(path) {
150
- if (typeof path !== "string") {
151
- throw new TypeError("Configuration schema path must be a string.");
152
- }
153
- return path.trim().replace(/\s+/g, "");
154
- }
155
134
  //# sourceMappingURL=configurationSchema.schema.js.map