nodefony 7.0.2 → 10.0.0-alpha.2

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 (903) hide show
  1. package/.ai/symbols.json +36135 -0
  2. package/LICENSE +544 -0
  3. package/README.md +316 -694
  4. package/bin/nodefony +2183 -85
  5. package/dist/client/Container.js +367 -0
  6. package/dist/client/Event.js +198 -0
  7. package/dist/client/Service.js +344 -0
  8. package/dist/client/Tools.js +162 -0
  9. package/dist/client/client/ClientKernel.js +276 -0
  10. package/dist/client/client/angular/index.js +352 -0
  11. package/dist/client/client/announce.js +212 -0
  12. package/dist/client/client/debugbar/DebugBar.js +1624 -0
  13. package/dist/client/client/debugbar/format.js +103 -0
  14. package/dist/client/client/debugbar/hmr.js +37 -0
  15. package/dist/client/client/debugbar/index.js +29 -0
  16. package/dist/client/client/debugbar/model.js +133 -0
  17. package/dist/client/client/debugbar/network.js +173 -0
  18. package/dist/client/client/debugbar/profile.js +114 -0
  19. package/dist/client/client/index.js +34 -0
  20. package/dist/client/client/react/index.js +268 -0
  21. package/dist/client/client/realtime/AdaptiveRate.js +240 -0
  22. package/dist/client/client/realtime/BrowserWsTransport.js +57 -0
  23. package/dist/client/client/realtime/RealtimeClient.js +898 -0
  24. package/dist/client/client/realtime/localEvents.js +56 -0
  25. package/dist/client/client/realtime/notice.js +125 -0
  26. package/dist/client/client/realtime/observe.js +280 -0
  27. package/dist/client/client/roles/index.js +3 -0
  28. package/dist/client/client/roles/registry.js +97 -0
  29. package/dist/client/client/roles/roles.js +91 -0
  30. package/dist/client/client/shim/events.js +88 -0
  31. package/dist/client/client/shim/util.js +20 -0
  32. package/dist/client/client/svelte/index.js +319 -0
  33. package/dist/client/client/syslog/context.js +122 -0
  34. package/dist/client/client/syslog/errors.js +49 -0
  35. package/dist/client/client/syslog/uplink.js +106 -0
  36. package/dist/client/client/vue/index.js +321 -0
  37. package/dist/client/colors.js +63 -0
  38. package/dist/client/debugbar.standalone.js +4274 -0
  39. package/dist/client/realtime/IRealtimeTransport.js +32 -0
  40. package/dist/client/realtime/JsonRpcPeer.js +251 -0
  41. package/dist/client/realtime/channelRate.js +39 -0
  42. package/dist/client/realtime/platformChannels.js +155 -0
  43. package/dist/client/syslog/Pdu.js +224 -0
  44. package/dist/client/syslog/Syslog.js +1159 -0
  45. package/dist/client/syslog/drivers/pduFlow.js +106 -0
  46. package/dist/client/syslog/drivers/pduProtocol.js +28 -0
  47. package/dist/client/syslog/logColor.js +80 -0
  48. package/dist/client/types/src/Container.d.ts +221 -0
  49. package/dist/client/types/src/Event.d.ts +171 -0
  50. package/dist/client/types/src/FileClass.d.ts +184 -0
  51. package/dist/client/types/src/Service.d.ts +165 -0
  52. package/dist/client/types/src/Tools.d.ts +116 -0
  53. package/dist/client/types/src/client/ClientKernel.d.ts +90 -0
  54. package/dist/client/types/src/client/IClientKernel.d.ts +195 -0
  55. package/dist/client/types/src/client/angular/index.d.ts +273 -0
  56. package/dist/client/types/src/client/announce.d.ts +74 -0
  57. package/dist/client/types/src/client/debugbar/DebugBar.d.ts +279 -0
  58. package/dist/client/types/src/client/debugbar/format.d.ts +48 -0
  59. package/dist/client/types/src/client/debugbar/hmr.d.ts +16 -0
  60. package/dist/client/types/src/client/debugbar/index.d.ts +30 -0
  61. package/dist/client/types/src/client/debugbar/model.d.ts +158 -0
  62. package/dist/client/types/src/client/debugbar/network.d.ts +55 -0
  63. package/dist/client/types/src/client/debugbar/profile.d.ts +99 -0
  64. package/dist/client/types/src/client/index.d.ts +47 -0
  65. package/dist/client/types/src/client/react/index.d.ts +207 -0
  66. package/dist/client/types/src/client/realtime/AdaptiveRate.d.ts +138 -0
  67. package/dist/client/types/src/client/realtime/BrowserWsTransport.d.ts +27 -0
  68. package/dist/client/types/src/client/realtime/RealtimeClient.d.ts +573 -0
  69. package/dist/client/types/src/client/realtime/localEvents.d.ts +53 -0
  70. package/dist/client/types/src/client/realtime/notice.d.ts +70 -0
  71. package/dist/client/types/src/client/realtime/observe.d.ts +284 -0
  72. package/dist/client/types/src/client/roles/index.d.ts +15 -0
  73. package/dist/client/types/src/client/roles/registry.d.ts +72 -0
  74. package/dist/client/types/src/client/roles/roles.d.ts +68 -0
  75. package/dist/client/types/src/client/shim/cli-color.d.ts +2 -0
  76. package/dist/client/types/src/client/shim/events.d.ts +39 -0
  77. package/dist/client/types/src/client/shim/util.d.ts +14 -0
  78. package/dist/client/types/src/client/svelte/index.d.ts +216 -0
  79. package/dist/client/types/src/client/syslog/context.d.ts +76 -0
  80. package/dist/client/types/src/client/syslog/errors.d.ts +46 -0
  81. package/dist/client/types/src/client/syslog/uplink.d.ts +89 -0
  82. package/dist/client/types/src/client/transport/websocket.d.ts +5 -0
  83. package/dist/client/types/src/client/vue/index.d.ts +234 -0
  84. package/dist/client/types/src/colors.d.ts +32 -0
  85. package/dist/client/types/src/config/infra.d.ts +171 -0
  86. package/dist/client/types/src/kernel/bootReport.d.ts +112 -0
  87. package/dist/client/types/src/kernel/readinessRegistry.d.ts +104 -0
  88. package/dist/client/types/src/realtime/IRealtimeSocket.d.ts +142 -0
  89. package/dist/client/types/src/realtime/IRealtimeTransport.d.ts +50 -0
  90. package/dist/client/types/src/realtime/JsonRpcPeer.d.ts +251 -0
  91. package/dist/client/types/src/realtime/RealtimeEventMap.d.ts +269 -0
  92. package/dist/client/types/src/realtime/channelRate.d.ts +55 -0
  93. package/dist/client/types/src/realtime/platformChannels.d.ts +147 -0
  94. package/dist/client/types/src/syslog/Pdu.d.ts +134 -0
  95. package/dist/client/types/src/syslog/Syslog.d.ts +482 -0
  96. package/dist/client/types/src/syslog/drivers/ILogDriver.d.ts +177 -0
  97. package/dist/client/types/src/syslog/drivers/pduFlow.d.ts +53 -0
  98. package/dist/client/types/src/syslog/drivers/pduProtocol.d.ts +20 -0
  99. package/dist/client/types/src/syslog/logColor.d.ts +59 -0
  100. package/dist/client/types/src/types/ICliKernel.d.ts +28 -0
  101. package/dist/client/types/src/types/ICommand.d.ts +14 -0
  102. package/dist/client/types/src/types/IContainer.d.ts +35 -0
  103. package/dist/client/types/src/types/IKernel.d.ts +138 -0
  104. package/dist/client/types/src/types/IMcpTool.d.ts +157 -0
  105. package/dist/client/types/src/types/IModule.d.ts +73 -0
  106. package/dist/client/types/src/types/IPage.d.ts +119 -0
  107. package/dist/client/types/src/types/IService.d.ts +62 -0
  108. package/dist/client/types/src/types/ISyslog.d.ts +58 -0
  109. package/dist/client/types/src/types/ITransport.d.ts +5 -0
  110. package/dist/client/types/src/types/globals.d.ts +47 -0
  111. package/dist/node/Cli.js +750 -0
  112. package/dist/node/Container.js +367 -0
  113. package/dist/node/Error.js +309 -0
  114. package/dist/node/Event.js +198 -0
  115. package/dist/node/FileClass.js +308 -0
  116. package/dist/node/Nodefony.js +78 -0
  117. package/dist/node/Service.js +344 -0
  118. package/dist/node/Tools.js +205 -0
  119. package/dist/node/bin/resolveLocalCli.js +10 -0
  120. package/dist/node/bundler/index.js +103 -0
  121. package/dist/node/cli/agentTargets.js +461 -0
  122. package/dist/node/cli/aiMcp.js +553 -0
  123. package/dist/node/cli/aiMcpReport.js +129 -0
  124. package/dist/node/cli/aiSync.js +323 -0
  125. package/dist/node/cli/aiSyncReport.js +142 -0
  126. package/dist/node/cli/card.js +186 -0
  127. package/dist/node/cli/cardReport.js +110 -0
  128. package/dist/node/cli/completion.js +415 -0
  129. package/dist/node/cli/create.js +805 -0
  130. package/dist/node/cli/env.js +332 -0
  131. package/dist/node/cli/envReport.js +159 -0
  132. package/dist/node/cli/execPortable.js +60 -0
  133. package/dist/node/cli/gitHooks.js +191 -0
  134. package/dist/node/cli/gitHooksReport.js +119 -0
  135. package/dist/node/cli/globalFlags.js +67 -0
  136. package/dist/node/cli/helpReport.js +288 -0
  137. package/dist/node/cli/manPage.js +165 -0
  138. package/dist/node/cli/nodefonyBin.js +61 -0
  139. package/dist/node/cli/outdated.js +144 -0
  140. package/dist/node/cli/progress.js +555 -0
  141. package/dist/node/cli/projectRoot.js +32 -0
  142. package/dist/node/cli/promptPassword.js +44 -0
  143. package/dist/node/cli/prompts.js +86 -0
  144. package/dist/node/cli/scaffold/destination.js +92 -0
  145. package/dist/node/cli/scaffold/engine.js +2156 -0
  146. package/dist/node/cli/scaffold/entityFields.js +589 -0
  147. package/dist/node/cli/scaffold/format.js +243 -0
  148. package/dist/node/cli/scaffold/interactive.js +124 -0
  149. package/dist/node/cli/scaffold/moduleLayout.js +38 -0
  150. package/dist/node/cli/scaffold/reservedEntities.js +74 -0
  151. package/dist/node/cli/scaffold/spec.js +704 -0
  152. package/dist/node/cli/scaffold/steps.js +40 -0
  153. package/dist/node/cli/scaffold/userContractSource.js +133 -0
  154. package/dist/node/cli/scaffold/versions.js +57 -0
  155. package/dist/node/cli/scaffold/writer.js +172 -0
  156. package/dist/node/cli/startMenu.js +496 -0
  157. package/dist/node/cli/symbols.js +205 -0
  158. package/dist/node/cli/sysexits.js +34 -0
  159. package/dist/node/cli/tableReport.js +184 -0
  160. package/dist/node/cli/usageReport.js +144 -0
  161. package/dist/node/colors.js +63 -0
  162. package/dist/node/command/Builder.js +153 -0
  163. package/dist/node/command/Command.js +348 -0
  164. package/dist/node/config/configProvenance.js +101 -0
  165. package/dist/node/config/defaults.js +39 -0
  166. package/dist/node/config/defineConfig.js +129 -0
  167. package/dist/node/config/defineEnv.js +264 -0
  168. package/dist/node/config/envExample.js +41 -0
  169. package/dist/node/config/envOverride.js +423 -0
  170. package/dist/node/config/infra.js +163 -0
  171. package/dist/node/config/reactivity.js +23 -0
  172. package/dist/node/config/reservedEnv.js +118 -0
  173. package/dist/node/config/schema.js +134 -0
  174. package/dist/node/config/use.js +24 -0
  175. package/dist/node/finder/File.js +49 -0
  176. package/dist/node/finder/FileResult.js +86 -0
  177. package/dist/node/finder/Finder.js +201 -0
  178. package/dist/node/finder/Result.js +45 -0
  179. package/dist/node/index.js +121 -0
  180. package/dist/node/kernel/BootConfigurationError.js +54 -0
  181. package/dist/node/kernel/CliKernel.js +630 -0
  182. package/dist/node/kernel/Kernel.js +2198 -0
  183. package/dist/node/kernel/Module.js +453 -0
  184. package/dist/node/kernel/adminPlane/adminCaller.js +98 -0
  185. package/dist/node/kernel/adminPlane/adminRbac.js +51 -0
  186. package/dist/node/kernel/adminPlane/catalog.js +158 -0
  187. package/dist/node/kernel/adminPlane/executeAdmin.js +78 -0
  188. package/dist/node/kernel/checks/deep.js +335 -0
  189. package/dist/node/kernel/checks/freshness.js +139 -0
  190. package/dist/node/kernel/checks/gating.js +231 -0
  191. package/dist/node/kernel/checks/guards.js +232 -0
  192. package/dist/node/kernel/checks/lastBoot.js +136 -0
  193. package/dist/node/kernel/checks/live.js +330 -0
  194. package/dist/node/kernel/checks/packageDeps.js +292 -0
  195. package/dist/node/kernel/checks/readiness.js +153 -0
  196. package/dist/node/kernel/checks/renderReport.js +780 -0
  197. package/dist/node/kernel/checks/report.js +421 -0
  198. package/dist/node/kernel/checks/runDoctor.js +731 -0
  199. package/dist/node/kernel/checks/surface.js +364 -0
  200. package/dist/node/kernel/checks/walk.js +100 -0
  201. package/dist/node/kernel/checks/wiring.js +450 -0
  202. package/dist/node/kernel/commands/AiMcpCommand.js +65 -0
  203. package/dist/node/kernel/commands/AiSyncCommand.js +48 -0
  204. package/dist/node/kernel/commands/BuildCommand.js +49 -0
  205. package/dist/node/kernel/commands/CardCommand.js +50 -0
  206. package/dist/node/kernel/commands/ClusterCommand.js +58 -0
  207. package/dist/node/kernel/commands/CompletionCommand.js +31 -0
  208. package/dist/node/kernel/commands/CreateCommand.js +45 -0
  209. package/dist/node/kernel/commands/DevCommand.js +99 -0
  210. package/dist/node/kernel/commands/DoctorCommand.js +115 -0
  211. package/dist/node/kernel/commands/EnvCommand.js +52 -0
  212. package/dist/node/kernel/commands/GitHooksCommand.js +47 -0
  213. package/dist/node/kernel/commands/InspectCommand.js +153 -0
  214. package/dist/node/kernel/commands/InstallCommand.js +20 -0
  215. package/dist/node/kernel/commands/MenuCommand.js +261 -0
  216. package/dist/node/kernel/commands/OutdatedCommand.js +164 -0
  217. package/dist/node/kernel/commands/ProdCommand.js +60 -0
  218. package/dist/node/kernel/commands/StatusCommand.js +30 -0
  219. package/dist/node/kernel/commands/StopCommand.js +35 -0
  220. package/dist/node/kernel/commands/SymbolsCommand.js +45 -0
  221. package/dist/node/kernel/commands/runtimeLauncher.js +95 -0
  222. package/dist/node/kernel/decorators/kernelDecorator.js +110 -0
  223. package/dist/node/kernel/injector/injector.js +137 -0
  224. package/dist/node/kernel/injector/serviceOrder.js +106 -0
  225. package/dist/node/kernel/inspect/adminSubjects.js +194 -0
  226. package/dist/node/kernel/inspect/docOutline.js +86 -0
  227. package/dist/node/kernel/lifecycleTags.js +76 -0
  228. package/dist/node/kernel/moduleConfig.js +75 -0
  229. package/dist/node/kernel/moduleGating.js +68 -0
  230. package/dist/node/kernel/readinessRegistry.js +98 -0
  231. package/dist/node/kernel/resolveModuleEntry.js +61 -0
  232. package/dist/node/mcp/caller.js +40 -0
  233. package/dist/node/mcp/guard.js +51 -0
  234. package/dist/node/mcp/protocol.js +157 -0
  235. package/dist/node/mcp/server.js +216 -0
  236. package/dist/node/mcp/tools.js +861 -0
  237. package/dist/node/oauth/authorizationServer.js +221 -0
  238. package/dist/node/oauth/protectedResource.js +293 -0
  239. package/dist/node/package.js +4 -0
  240. package/dist/node/realtime/IRealtimeTransport.js +32 -0
  241. package/dist/node/realtime/JsonRpcPeer.js +251 -0
  242. package/dist/node/realtime/RealtimeEventMap.js +15 -0
  243. package/dist/node/realtime/channelRate.js +39 -0
  244. package/dist/node/realtime/platformChannels.js +155 -0
  245. package/dist/node/runtime/GcScheduler.js +92 -0
  246. package/dist/node/runtime/RequestContext.js +76 -0
  247. package/dist/node/runtime/bearer.js +84 -0
  248. package/dist/node/runtime/engineEnvironment.js +79 -0
  249. package/dist/node/runtime/loadEnv.js +105 -0
  250. package/dist/node/runtime/pageFacets.js +85 -0
  251. package/dist/node/runtime/pageFilters.js +103 -0
  252. package/dist/node/runtime/pageGuard.js +84 -0
  253. package/dist/node/runtime/pageQuery.js +160 -0
  254. package/dist/node/runtime/pageSort.js +114 -0
  255. package/dist/node/runtime/redact.js +43 -0
  256. package/dist/node/runtime/withTimeout.js +71 -0
  257. package/dist/node/service/cluster/ClusterManager.js +202 -0
  258. package/dist/node/service/cluster/ClusterProbeAggregator.js +120 -0
  259. package/dist/node/service/cluster/ClusterRelay.js +74 -0
  260. package/dist/node/service/cluster/clusterMaster.js +65 -0
  261. package/dist/node/service/cluster/clusterMessage.js +70 -0
  262. package/dist/node/service/cluster/cpuQuota.js +59 -0
  263. package/dist/node/service/cluster/instanceProbe.js +52 -0
  264. package/dist/node/service/cluster/podEnvironment.js +48 -0
  265. package/dist/node/service/cluster/processProbe.js +70 -0
  266. package/dist/node/service/cluster/richProcessProbe.js +115 -0
  267. package/dist/node/service/cluster/topology.js +71 -0
  268. package/dist/node/service/dev/BootReporter.js +490 -0
  269. package/dist/node/service/dev/DevSupervisor.js +1004 -0
  270. package/dist/node/service/dev/bootVerdict.js +158 -0
  271. package/dist/node/service/dev/detachedStart.js +372 -0
  272. package/dist/node/service/dev/devProcess.js +1137 -0
  273. package/dist/node/service/dev/devProjects.js +138 -0
  274. package/dist/node/service/dev/devStatusReport.js +395 -0
  275. package/dist/node/service/dev/devStop.js +263 -0
  276. package/dist/node/service/fetchService.js +35 -0
  277. package/dist/node/service/gitService.js +62 -0
  278. package/dist/node/syslog/Pdu.js +224 -0
  279. package/dist/node/syslog/Syslog.js +1159 -0
  280. package/dist/node/syslog/drivers/ClusterFileLogDriver.js +114 -0
  281. package/dist/node/syslog/drivers/FileLogDriver.js +127 -0
  282. package/dist/node/syslog/drivers/ILogDriver.js +26 -0
  283. package/dist/node/syslog/drivers/LokiLogDriver.js +144 -0
  284. package/dist/node/syslog/drivers/MemoryLogDriver.js +33 -0
  285. package/dist/node/syslog/drivers/OpenSearchLogDriver.js +159 -0
  286. package/dist/node/syslog/drivers/builtinLogDrivers.js +114 -0
  287. package/dist/node/syslog/drivers/filterPdus.js +71 -0
  288. package/dist/node/syslog/drivers/logDriverRegistry.js +83 -0
  289. package/dist/node/syslog/drivers/opensearchShared.js +17 -0
  290. package/dist/node/syslog/drivers/pduFlow.js +106 -0
  291. package/dist/node/syslog/drivers/pduProtocol.js +28 -0
  292. package/dist/node/syslog/httpFetch.js +43 -0
  293. package/dist/node/syslog/logColor.js +80 -0
  294. package/dist/node/syslog/sinks/FileSink.js +142 -0
  295. package/dist/node/syslog/transports/BatchingHttpTransport.js +98 -0
  296. package/dist/node/syslog/transports/ConsoleTransport.js +14 -0
  297. package/dist/node/syslog/transports/FileTransport.js +17 -0
  298. package/dist/node/syslog/transports/HttpTransport.js +44 -0
  299. package/dist/node/syslog/transports/LokiTransport.js +80 -0
  300. package/dist/node/syslog/transports/OpenSearchTransport.js +53 -0
  301. package/dist/node/syslog/transports/SyslogTransport.js +13 -0
  302. package/dist/node/syslog/transports/index.js +8 -0
  303. package/dist/node/testing/index.js +190 -0
  304. package/dist/types/Cli.d.ts +177 -0
  305. package/dist/types/Container.d.ts +221 -0
  306. package/dist/types/Error.d.ts +162 -0
  307. package/dist/types/Event.d.ts +171 -0
  308. package/dist/types/FileClass.d.ts +184 -0
  309. package/dist/types/Nodefony.d.ts +66 -0
  310. package/dist/types/Service.d.ts +165 -0
  311. package/dist/types/Tools.d.ts +116 -0
  312. package/dist/types/bin/resolveLocalCli.d.ts +49 -0
  313. package/dist/types/bundler/index.d.ts +66 -0
  314. package/dist/types/cli/agentTargets.d.ts +378 -0
  315. package/dist/types/cli/aiMcp.d.ts +239 -0
  316. package/dist/types/cli/aiMcpReport.d.ts +113 -0
  317. package/dist/types/cli/aiSync.d.ts +68 -0
  318. package/dist/types/cli/aiSyncReport.d.ts +149 -0
  319. package/dist/types/cli/card.d.ts +49 -0
  320. package/dist/types/cli/cardReport.d.ts +127 -0
  321. package/dist/types/cli/completion.d.ts +154 -0
  322. package/dist/types/cli/create.d.ts +177 -0
  323. package/dist/types/cli/env.d.ts +103 -0
  324. package/dist/types/cli/envReport.d.ts +153 -0
  325. package/dist/types/cli/execPortable.d.ts +54 -0
  326. package/dist/types/cli/gitHooks.d.ts +48 -0
  327. package/dist/types/cli/gitHooksReport.d.ts +101 -0
  328. package/dist/types/cli/globalFlags.d.ts +48 -0
  329. package/dist/types/cli/helpReport.d.ts +110 -0
  330. package/dist/types/cli/manPage.d.ts +21 -0
  331. package/dist/types/cli/nodefonyBin.d.ts +45 -0
  332. package/dist/types/cli/outdated.d.ts +119 -0
  333. package/dist/types/cli/progress.d.ts +349 -0
  334. package/dist/types/cli/projectRoot.d.ts +19 -0
  335. package/dist/types/cli/promptPassword.d.ts +22 -0
  336. package/dist/types/cli/prompts.d.ts +102 -0
  337. package/dist/types/cli/scaffold/destination.d.ts +70 -0
  338. package/dist/types/cli/scaffold/engine.d.ts +545 -0
  339. package/dist/types/cli/scaffold/entityFields.d.ts +238 -0
  340. package/dist/types/cli/scaffold/format.d.ts +78 -0
  341. package/dist/types/cli/scaffold/interactive.d.ts +11 -0
  342. package/dist/types/cli/scaffold/moduleLayout.d.ts +69 -0
  343. package/dist/types/cli/scaffold/reservedEntities.d.ts +49 -0
  344. package/dist/types/cli/scaffold/spec.d.ts +159 -0
  345. package/dist/types/cli/scaffold/steps.d.ts +24 -0
  346. package/dist/types/cli/scaffold/userContractSource.d.ts +86 -0
  347. package/dist/types/cli/scaffold/versions.d.ts +14 -0
  348. package/dist/types/cli/scaffold/writer.d.ts +100 -0
  349. package/dist/types/cli/startMenu.d.ts +195 -0
  350. package/dist/types/cli/symbols.d.ts +84 -0
  351. package/dist/types/cli/sysexits.d.ts +31 -0
  352. package/dist/types/cli/tableReport.d.ts +44 -0
  353. package/dist/types/cli/usageReport.d.ts +108 -0
  354. package/dist/types/client/ClientKernel.d.ts +90 -0
  355. package/dist/types/client/IClientKernel.d.ts +195 -0
  356. package/dist/types/client/angular/index.d.ts +273 -0
  357. package/dist/types/client/announce.d.ts +74 -0
  358. package/dist/types/client/debugbar/DebugBar.d.ts +279 -0
  359. package/dist/types/client/debugbar/format.d.ts +48 -0
  360. package/dist/types/client/debugbar/hmr.d.ts +16 -0
  361. package/dist/types/client/debugbar/index.d.ts +30 -0
  362. package/dist/types/client/debugbar/model.d.ts +158 -0
  363. package/dist/types/client/debugbar/network.d.ts +55 -0
  364. package/dist/types/client/debugbar/profile.d.ts +99 -0
  365. package/dist/types/client/index.d.ts +47 -0
  366. package/dist/types/client/react/index.d.ts +207 -0
  367. package/dist/types/client/realtime/AdaptiveRate.d.ts +138 -0
  368. package/dist/types/client/realtime/BrowserWsTransport.d.ts +27 -0
  369. package/dist/types/client/realtime/RealtimeClient.d.ts +573 -0
  370. package/dist/types/client/realtime/localEvents.d.ts +53 -0
  371. package/dist/types/client/realtime/notice.d.ts +70 -0
  372. package/dist/types/client/realtime/observe.d.ts +284 -0
  373. package/dist/types/client/roles/index.d.ts +15 -0
  374. package/dist/types/client/roles/registry.d.ts +72 -0
  375. package/dist/types/client/roles/roles.d.ts +68 -0
  376. package/dist/types/client/shim/cli-color.d.ts +2 -0
  377. package/dist/types/client/shim/events.d.ts +39 -0
  378. package/dist/types/client/shim/util.d.ts +14 -0
  379. package/dist/types/client/svelte/index.d.ts +216 -0
  380. package/dist/types/client/syslog/context.d.ts +76 -0
  381. package/dist/types/client/syslog/errors.d.ts +46 -0
  382. package/dist/types/client/syslog/uplink.d.ts +89 -0
  383. package/dist/types/client/transport/websocket.d.ts +5 -0
  384. package/dist/types/client/vue/index.d.ts +234 -0
  385. package/dist/types/colors.d.ts +32 -0
  386. package/dist/types/command/Builder.d.ts +47 -0
  387. package/dist/types/command/Command.d.ts +268 -0
  388. package/dist/types/config/configMeta.d.ts +53 -0
  389. package/dist/types/config/configProvenance.d.ts +58 -0
  390. package/dist/types/config/defaults.d.ts +33 -0
  391. package/dist/types/config/defineConfig.d.ts +70 -0
  392. package/dist/types/config/defineEnv.d.ts +170 -0
  393. package/dist/types/config/envExample.d.ts +23 -0
  394. package/dist/types/config/envOverride.d.ts +236 -0
  395. package/dist/types/config/index.d.ts +23 -0
  396. package/dist/types/config/infra.d.ts +171 -0
  397. package/dist/types/config/reactivity.d.ts +36 -0
  398. package/dist/types/config/reservedEnv.d.ts +145 -0
  399. package/dist/types/config/schema.d.ts +113 -0
  400. package/dist/types/config/types.d.ts +374 -0
  401. package/dist/types/config/use.d.ts +80 -0
  402. package/dist/types/finder/File.d.ts +26 -0
  403. package/dist/types/finder/FileResult.d.ts +14 -0
  404. package/dist/types/finder/Finder.d.ts +51 -0
  405. package/dist/types/finder/Result.d.ts +10 -0
  406. package/dist/types/index.d.ts +205 -0
  407. package/dist/types/kernel/BootConfigurationError.d.ts +50 -0
  408. package/dist/types/kernel/CliKernel.d.ts +289 -0
  409. package/dist/types/kernel/Kernel.d.ts +1255 -0
  410. package/dist/types/kernel/Module.d.ts +326 -0
  411. package/dist/types/kernel/adminPlane/adminCaller.d.ts +105 -0
  412. package/dist/types/kernel/adminPlane/adminRbac.d.ts +44 -0
  413. package/dist/types/kernel/adminPlane/catalog.d.ts +122 -0
  414. package/dist/types/kernel/adminPlane/executeAdmin.d.ts +99 -0
  415. package/dist/types/kernel/bootReport.d.ts +112 -0
  416. package/dist/types/kernel/checks/deep.d.ts +122 -0
  417. package/dist/types/kernel/checks/freshness.d.ts +49 -0
  418. package/dist/types/kernel/checks/gating.d.ts +134 -0
  419. package/dist/types/kernel/checks/guards.d.ts +57 -0
  420. package/dist/types/kernel/checks/lastBoot.d.ts +189 -0
  421. package/dist/types/kernel/checks/live.d.ts +110 -0
  422. package/dist/types/kernel/checks/packageDeps.d.ts +44 -0
  423. package/dist/types/kernel/checks/readiness.d.ts +97 -0
  424. package/dist/types/kernel/checks/renderReport.d.ts +107 -0
  425. package/dist/types/kernel/checks/report.d.ts +414 -0
  426. package/dist/types/kernel/checks/runDoctor.d.ts +361 -0
  427. package/dist/types/kernel/checks/surface.d.ts +148 -0
  428. package/dist/types/kernel/checks/walk.d.ts +45 -0
  429. package/dist/types/kernel/checks/wiring.d.ts +54 -0
  430. package/dist/types/kernel/commands/AiMcpCommand.d.ts +39 -0
  431. package/dist/types/kernel/commands/AiSyncCommand.d.ts +28 -0
  432. package/dist/types/kernel/commands/BuildCommand.d.ts +13 -0
  433. package/dist/types/kernel/commands/CardCommand.d.ts +34 -0
  434. package/dist/types/kernel/commands/ClusterCommand.d.ts +29 -0
  435. package/dist/types/kernel/commands/CompletionCommand.d.ts +17 -0
  436. package/dist/types/kernel/commands/CreateCommand.d.ts +16 -0
  437. package/dist/types/kernel/commands/DevCommand.d.ts +40 -0
  438. package/dist/types/kernel/commands/DoctorCommand.d.ts +55 -0
  439. package/dist/types/kernel/commands/EnvCommand.d.ts +35 -0
  440. package/dist/types/kernel/commands/GitHooksCommand.d.ts +27 -0
  441. package/dist/types/kernel/commands/InspectCommand.d.ts +59 -0
  442. package/dist/types/kernel/commands/InstallCommand.d.ts +7 -0
  443. package/dist/types/kernel/commands/MenuCommand.d.ts +58 -0
  444. package/dist/types/kernel/commands/OutdatedCommand.d.ts +47 -0
  445. package/dist/types/kernel/commands/ProdCommand.d.ts +29 -0
  446. package/dist/types/kernel/commands/StatusCommand.d.ts +17 -0
  447. package/dist/types/kernel/commands/StopCommand.d.ts +17 -0
  448. package/dist/types/kernel/commands/SymbolsCommand.d.ts +29 -0
  449. package/dist/types/kernel/commands/runtimeLauncher.d.ts +76 -0
  450. package/dist/types/kernel/decorators/kernelDecorator.d.ts +76 -0
  451. package/dist/types/kernel/injector/injector.d.ts +47 -0
  452. package/dist/types/kernel/injector/serviceOrder.d.ts +29 -0
  453. package/dist/types/kernel/inspect/adminSubjects.d.ts +169 -0
  454. package/dist/types/kernel/inspect/docOutline.d.ts +53 -0
  455. package/dist/types/kernel/lifecycleTags.d.ts +79 -0
  456. package/dist/types/kernel/moduleConfig.d.ts +35 -0
  457. package/dist/types/kernel/moduleGating.d.ts +78 -0
  458. package/dist/types/kernel/readinessRegistry.d.ts +104 -0
  459. package/dist/types/kernel/resolveModuleEntry.d.ts +46 -0
  460. package/dist/types/mcp/caller.d.ts +55 -0
  461. package/dist/types/mcp/guard.d.ts +66 -0
  462. package/dist/types/mcp/protocol.d.ts +163 -0
  463. package/dist/types/mcp/server.d.ts +70 -0
  464. package/dist/types/mcp/tools.d.ts +209 -0
  465. package/dist/types/oauth/authorizationServer.d.ts +204 -0
  466. package/dist/types/oauth/protectedResource.d.ts +339 -0
  467. package/dist/types/realtime/IRealtimeSocket.d.ts +142 -0
  468. package/dist/types/realtime/IRealtimeTransport.d.ts +50 -0
  469. package/dist/types/realtime/JsonRpcPeer.d.ts +251 -0
  470. package/dist/types/realtime/RealtimeEventMap.d.ts +269 -0
  471. package/dist/types/realtime/channelRate.d.ts +55 -0
  472. package/dist/types/realtime/platformChannels.d.ts +147 -0
  473. package/dist/types/runtime/GcScheduler.d.ts +96 -0
  474. package/dist/types/runtime/RequestContext.d.ts +152 -0
  475. package/dist/types/runtime/bearer.d.ts +88 -0
  476. package/dist/types/runtime/engineEnvironment.d.ts +115 -0
  477. package/dist/types/runtime/loadEnv.d.ts +86 -0
  478. package/dist/types/runtime/pageFacets.d.ts +104 -0
  479. package/dist/types/runtime/pageFilters.d.ts +139 -0
  480. package/dist/types/runtime/pageGuard.d.ts +78 -0
  481. package/dist/types/runtime/pageQuery.d.ts +138 -0
  482. package/dist/types/runtime/pageSort.d.ts +86 -0
  483. package/dist/types/runtime/redact.d.ts +27 -0
  484. package/dist/types/runtime/withTimeout.d.ts +51 -0
  485. package/dist/types/service/cluster/ClusterManager.d.ts +112 -0
  486. package/dist/types/service/cluster/ClusterProbeAggregator.d.ts +68 -0
  487. package/dist/types/service/cluster/ClusterRelay.d.ts +57 -0
  488. package/dist/types/service/cluster/clusterMaster.d.ts +40 -0
  489. package/dist/types/service/cluster/clusterMessage.d.ts +94 -0
  490. package/dist/types/service/cluster/cpuQuota.d.ts +37 -0
  491. package/dist/types/service/cluster/instanceProbe.d.ts +82 -0
  492. package/dist/types/service/cluster/podEnvironment.d.ts +35 -0
  493. package/dist/types/service/cluster/processProbe.d.ts +53 -0
  494. package/dist/types/service/cluster/richProcessProbe.d.ts +77 -0
  495. package/dist/types/service/cluster/topology.d.ts +64 -0
  496. package/dist/types/service/dev/BootReporter.d.ts +67 -0
  497. package/dist/types/service/dev/DevSupervisor.d.ts +117 -0
  498. package/dist/types/service/dev/bootVerdict.d.ts +99 -0
  499. package/dist/types/service/dev/detachedStart.d.ts +164 -0
  500. package/dist/types/service/dev/devProcess.d.ts +638 -0
  501. package/dist/types/service/dev/devProjects.d.ts +121 -0
  502. package/dist/types/service/dev/devStatusReport.d.ts +141 -0
  503. package/dist/types/service/dev/devStop.d.ts +57 -0
  504. package/dist/types/service/fetchService.d.ts +29 -0
  505. package/dist/types/service/gitService.d.ts +24 -0
  506. package/dist/types/syslog/Pdu.d.ts +134 -0
  507. package/dist/types/syslog/Syslog.d.ts +482 -0
  508. package/dist/types/syslog/drivers/ClusterFileLogDriver.d.ts +40 -0
  509. package/dist/types/syslog/drivers/FileLogDriver.d.ts +55 -0
  510. package/dist/types/syslog/drivers/ILogDriver.d.ts +177 -0
  511. package/dist/types/syslog/drivers/LokiLogDriver.d.ts +44 -0
  512. package/dist/types/syslog/drivers/MemoryLogDriver.d.ts +20 -0
  513. package/dist/types/syslog/drivers/OpenSearchLogDriver.d.ts +40 -0
  514. package/dist/types/syslog/drivers/builtinLogDrivers.d.ts +43 -0
  515. package/dist/types/syslog/drivers/filterPdus.d.ts +21 -0
  516. package/dist/types/syslog/drivers/logDriverRegistry.d.ts +100 -0
  517. package/dist/types/syslog/drivers/opensearchShared.d.ts +11 -0
  518. package/dist/types/syslog/drivers/pduFlow.d.ts +53 -0
  519. package/dist/types/syslog/drivers/pduProtocol.d.ts +20 -0
  520. package/dist/types/syslog/httpFetch.d.ts +48 -0
  521. package/dist/types/syslog/logColor.d.ts +59 -0
  522. package/dist/types/syslog/sinks/FileSink.d.ts +78 -0
  523. package/dist/types/syslog/transports/BatchingHttpTransport.d.ts +59 -0
  524. package/dist/types/syslog/transports/ConsoleTransport.d.ts +8 -0
  525. package/dist/types/syslog/transports/FileTransport.d.ts +13 -0
  526. package/dist/types/syslog/transports/HttpTransport.d.ts +15 -0
  527. package/dist/types/syslog/transports/LokiTransport.d.ts +45 -0
  528. package/dist/types/syslog/transports/OpenSearchTransport.d.ts +40 -0
  529. package/dist/types/syslog/transports/SyslogTransport.d.ts +9 -0
  530. package/dist/types/syslog/transports/index.d.ts +12 -0
  531. package/dist/types/testing/index.d.ts +197 -0
  532. package/dist/types/types/IAdminApi.d.ts +246 -0
  533. package/dist/types/types/ICliKernel.d.ts +28 -0
  534. package/dist/types/types/ICommand.d.ts +14 -0
  535. package/dist/types/types/IContainer.d.ts +35 -0
  536. package/dist/types/types/IIdempotencyStore.d.ts +159 -0
  537. package/dist/types/types/IKernel.d.ts +138 -0
  538. package/dist/types/types/IMcpTool.d.ts +157 -0
  539. package/dist/types/types/IModule.d.ts +73 -0
  540. package/dist/types/types/IModuleManifest.d.ts +49 -0
  541. package/dist/types/types/IPage.d.ts +119 -0
  542. package/dist/types/types/IService.d.ts +62 -0
  543. package/dist/types/types/ISyslog.d.ts +58 -0
  544. package/dist/types/types/ITransport.d.ts +5 -0
  545. package/dist/types/types/globals.d.ts +47 -0
  546. package/docs/angular-services.md +318 -0
  547. package/docs/catalogue.md +184 -0
  548. package/docs/cli.md +369 -0
  549. package/docs/client.md +616 -0
  550. package/docs/debugbar.md +218 -0
  551. package/docs/environnement.md +308 -0
  552. package/docs/index.md +388 -0
  553. package/docs/kernel.md +670 -0
  554. package/docs/progression.md +228 -0
  555. package/docs/react-hooks.md +686 -0
  556. package/docs/request-context.md +507 -0
  557. package/docs/service.md +590 -0
  558. package/docs/svelte-reactivite.md +293 -0
  559. package/docs/syslog.md +848 -0
  560. package/docs/testing.md +203 -0
  561. package/docs/vue-composables.md +255 -0
  562. package/man/nodefony.1 +152 -0
  563. package/package.json +163 -83
  564. package/templates/app/agents/AGENTS.md.tpl +967 -0
  565. package/templates/app/agents/POINTEUR.md.tpl +12 -0
  566. package/templates/app/base/Dockerfile.tpl +104 -0
  567. package/templates/app/base/README.md.tpl +314 -0
  568. package/templates/app/base/dockerignore.tpl +28 -0
  569. package/templates/app/base/env.ts.tpl +130 -0
  570. package/templates/app/base/gitattributes.tpl +28 -0
  571. package/templates/app/base/github/workflows/ci.yml.tpl +91 -0
  572. package/templates/app/base/gitignore.tpl +46 -0
  573. package/templates/app/base/gitlab-ci.yml.tpl +42 -0
  574. package/templates/app/base/index.ts.tpl +69 -0
  575. package/templates/app/base/nodefony.config.ts.tpl +342 -0
  576. package/templates/app/base/oxlintrc.json.tpl +127 -0
  577. package/templates/app/base/package.json.tpl +75 -0
  578. package/templates/app/base/prettierignore.tpl +24 -0
  579. package/templates/app/base/prettierrc.json.tpl +12 -0
  580. package/templates/app/base/rolldown.config.ts.tpl +8 -0
  581. package/templates/app/base/tests/config.test.ts.tpl +29 -0
  582. package/templates/app/base/tests/e2e.setup.ts.tpl +181 -0
  583. package/templates/app/base/tests/e2e.test.ts.tpl +105 -0
  584. package/templates/app/base/tests/migrations.e2e.test.ts.tpl +579 -0
  585. package/templates/app/base/tsconfig.json.tpl +47 -0
  586. package/templates/app/base/vitest.config.ts.tpl +88 -0
  587. package/templates/app/base/vitest.e2e.config.ts.tpl +39 -0
  588. package/templates/app/complete/compose.yaml.tpl +328 -0
  589. package/templates/app/complete/deploy/migrate-job.yaml.tpl +100 -0
  590. package/templates/app/complete/docker/db/init-nodefony-e2e.sql.tpl +30 -0
  591. package/templates/app/complete/docker/grafana/provisioning/datasources/loki.yaml.tpl +15 -0
  592. package/templates/app/complete/env.local.tpl +11 -0
  593. package/templates/app/complete/env.tpl +53 -0
  594. package/templates/app/complete/nodefony/entity/User.ts.tpl +69 -0
  595. package/templates/app/complete/nodefony/security/provisionUsers.ts.tpl +124 -0
  596. package/templates/app/complete/nodefony/service/AppBannerService.ts.tpl +98 -0
  597. package/templates/app/complete/nodefony/service/AppInfoService.ts.tpl +85 -0
  598. package/templates/app/frontend/angular/frontend/src/accent.css.tpl +34 -0
  599. package/templates/app/frontend/angular/frontend/src/app/app.component.ts.tpl +400 -0
  600. package/templates/app/frontend/react/frontend/src/App.tsx.tpl +421 -0
  601. package/templates/app/frontend/react/frontend/src/accent.css.tpl +30 -0
  602. package/templates/app/frontend/shared/frontend/src/brand.ts.tpl +3 -0
  603. package/templates/app/frontend/shared/frontend/src/showcase.css.tpl +224 -0
  604. package/templates/app/frontend/shared/nodefony/controllers/AppController.ts.tpl +45 -0
  605. package/templates/app/frontend/svelte/frontend/src/App.svelte.tpl +371 -0
  606. package/templates/app/frontend/svelte/frontend/src/accent.css.tpl +34 -0
  607. package/templates/app/frontend/vue/frontend/src/App.vue.tpl +367 -0
  608. package/templates/app/frontend/vue/frontend/src/accent.css.tpl +34 -0
  609. package/templates/app/home/nodefony/controllers/HomeController.ts.tpl +38 -0
  610. package/templates/command/nodefony/command/__NAME__.ts.tpl +132 -0
  611. package/templates/controller/duplex/nodefony/controllers/__NAME__.ts.tpl +188 -0
  612. package/templates/controller/example/nodefony/controllers/__NAME__.ts.tpl +348 -0
  613. package/templates/controller/hello/nodefony/controllers/__NAME__.ts.tpl +143 -0
  614. package/templates/controller/realtime/nodefony/controllers/__NAME__.ts.tpl +153 -0
  615. package/templates/controller/realtime/tests/__KEBAB__-realtime.test.ts.tpl +79 -0
  616. package/templates/controller/rest/nodefony/controllers/__NAME__.ts.tpl +159 -0
  617. package/templates/entity/base/nodefony/entity/__PASCAL__.schema.ts.tpl +31 -0
  618. package/templates/entity/base/nodefony/entity/__PASCAL__.ts.tpl +68 -0
  619. package/templates/entity/controller/nodefony/controllers/__PASCAL__Controller.ts.tpl +335 -0
  620. package/templates/entity/service/nodefony/service/__PASCAL__Service.ts.tpl +126 -0
  621. package/templates/entity/tests/tests/__KEBAB__.e2e.test.ts.tpl +358 -0
  622. package/templates/entity/tests/tests/__KEBAB__.test.ts.tpl +87 -0
  623. package/templates/front/angular/frontend/src/app/app.component.ts.tpl +30 -0
  624. package/templates/front/base/nodefony/controllers/__NAME__.ts.tpl +60 -0
  625. package/templates/front/react/frontend/src/App.tsx.tpl +26 -0
  626. package/templates/front/svelte/frontend/src/App.svelte.tpl +19 -0
  627. package/templates/front/vue/frontend/src/App.vue.tpl +23 -0
  628. package/templates/module/ai/AGENTS.md.tpl +71 -0
  629. package/templates/module/base/README.md.tpl +62 -0
  630. package/templates/module/base/docs/index.md.tpl +55 -0
  631. package/templates/module/base/index.ts.tpl +50 -0
  632. package/templates/module/base/nodefony/config/config.ts.tpl +60 -0
  633. package/templates/module/base/nodefony/config/defineModuleConfig.ts.tpl +55 -0
  634. package/templates/module/base/nodefony/src/errors/__PASCAL__Error.ts.tpl +20 -0
  635. package/templates/module/base/package.json.tpl +53 -0
  636. package/templates/module/base/rolldown.config.ts.tpl +14 -0
  637. package/templates/module/base/tests/__KEBAB__.test.ts.tpl +39 -0
  638. package/templates/module/base/tsconfig.json.tpl +42 -0
  639. package/templates/module/base/vitest.config.ts.tpl +27 -0
  640. package/templates/module/packages/CLAUDE.md.tpl +51 -0
  641. package/templates/module/packages/MEMORY.md.tpl +39 -0
  642. package/templates/module/packages/tsconfig.declarations.json.tpl +19 -0
  643. package/templates/module/packages/tsconfig.tests.json.tpl +11 -0
  644. package/templates/module/service/nodefony/interfaces/I__PASCAL__Service.ts.tpl +14 -0
  645. package/templates/module/service/nodefony/interfaces/index.ts.tpl +1 -0
  646. package/templates/module/service/nodefony/service/__PASCAL__Service.ts.tpl +116 -0
  647. package/templates/service/nodefony/interfaces/I__PASCAL__Service.ts.tpl +19 -0
  648. package/templates/service/nodefony/service/__PASCAL__Service.ts.tpl +136 -0
  649. package/templates/service/tests/__PASCAL__Service.test.ts.tpl +53 -0
  650. package/templates/shared/front-entry/angular/frontend/src/main.ts.tpl +17 -0
  651. package/templates/shared/front-entry/react/frontend/src/main.tsx.tpl +11 -0
  652. package/templates/shared/front-entry/svelte/frontend/src/main.ts.tpl +13 -0
  653. package/templates/shared/front-entry/vue/frontend/src/main.ts.tpl +12 -0
  654. package/templates/shared/front-registrar/nodefony/frontend/register__PASCAL__Entry.ts.tpl +40 -0
  655. package/templates/shared/front-shell/frontend/index.html.tpl +39 -0
  656. package/templates/shared/ng-app-tsconfig/frontend/tsconfig.app.json.tpl +18 -0
  657. package/templates/shared/svelte-shim/frontend/src/env.d.ts.tpl +12 -0
  658. package/templates/shared/vue-shim/frontend/src/env.d.ts.tpl +15 -0
  659. package/.yarnclean +0 -45
  660. package/CHANGELOG.md +0 -406
  661. package/autoloader.es6 +0 -253
  662. package/builder.es6 +0 -366
  663. package/cli/builder/bundles/bundle.js +0 -328
  664. package/cli/builder/bundles/controller.js +0 -73
  665. package/cli/builder/bundles/users-bundle/.yarnclean +0 -45
  666. package/cli/builder/bundles/users-bundle/Command/fixtureTask.js +0 -47
  667. package/cli/builder/bundles/users-bundle/Command/usersCommand.js +0 -105
  668. package/cli/builder/bundles/users-bundle/Entity/mongoose/userEntity.js +0 -168
  669. package/cli/builder/bundles/users-bundle/Entity/sequelize/userEntity.js +0 -231
  670. package/cli/builder/bundles/users-bundle/Fixtures/users.js +0 -117
  671. package/cli/builder/bundles/users-bundle/Fixtures/usersFixtures.js +0 -114
  672. package/cli/builder/bundles/users-bundle/Resources/config/config.js +0 -90
  673. package/cli/builder/bundles/users-bundle/Resources/config/routing.js +0 -17
  674. package/cli/builder/bundles/users-bundle/Resources/config/security.js +0 -96
  675. package/cli/builder/bundles/users-bundle/Resources/config/services.js +0 -7
  676. package/cli/builder/bundles/users-bundle/Resources/config/webpack/webpack.dev.config.js +0 -13
  677. package/cli/builder/bundles/users-bundle/Resources/config/webpack/webpack.prod.config.js +0 -31
  678. package/cli/builder/bundles/users-bundle/Resources/config/webpack.config.js +0 -146
  679. package/cli/builder/bundles/users-bundle/Resources/js/users.js +0 -153
  680. package/cli/builder/bundles/users-bundle/Resources/public/favicon.ico +0 -0
  681. package/cli/builder/bundles/users-bundle/Resources/public/images/users-logo.png +0 -0
  682. package/cli/builder/bundles/users-bundle/Resources/scss/awesome/font-awesome.config.js +0 -11
  683. package/cli/builder/bundles/users-bundle/Resources/scss/custom.scss +0 -23
  684. package/cli/builder/bundles/users-bundle/Resources/scss/users.scss +0 -59
  685. package/cli/builder/bundles/users-bundle/Resources/swagger/openapi/login.js +0 -235
  686. package/cli/builder/bundles/users-bundle/Resources/swagger/openapi/users.js +0 -232
  687. package/cli/builder/bundles/users-bundle/Resources/translations/login.en_en.yml +0 -14
  688. package/cli/builder/bundles/users-bundle/Resources/translations/login.fr_fr.yml +0 -14
  689. package/cli/builder/bundles/users-bundle/Resources/translations/users.en_en.yml +0 -35
  690. package/cli/builder/bundles/users-bundle/Resources/translations/users.fr_fr.yml +0 -36
  691. package/cli/builder/bundles/users-bundle/Resources/views/base.html.twig +0 -32
  692. package/cli/builder/bundles/users-bundle/Resources/views/footer.html.twig +0 -7
  693. package/cli/builder/bundles/users-bundle/Resources/views/header.html.twig +0 -90
  694. package/cli/builder/bundles/users-bundle/Resources/views/login/login.html.twig +0 -43
  695. package/cli/builder/bundles/users-bundle/Resources/views/users/createUser.html.twig +0 -296
  696. package/cli/builder/bundles/users-bundle/Resources/views/users/readUsers.html.twig +0 -94
  697. package/cli/builder/bundles/users-bundle/controller/api/graphql/graphqlController.js +0 -56
  698. package/cli/builder/bundles/users-bundle/controller/api/graphql/userResolver.js +0 -121
  699. package/cli/builder/bundles/users-bundle/controller/api/graphql/usertype.js +0 -58
  700. package/cli/builder/bundles/users-bundle/controller/api/openapi/loginApiController.js +0 -210
  701. package/cli/builder/bundles/users-bundle/controller/api/openapi/restUserController.js +0 -244
  702. package/cli/builder/bundles/users-bundle/controller/loginController.js +0 -91
  703. package/cli/builder/bundles/users-bundle/controller/usersController.js +0 -332
  704. package/cli/builder/bundles/users-bundle/package.json +0 -58
  705. package/cli/builder/bundles/users-bundle/readme.md +0 -360
  706. package/cli/builder/bundles/users-bundle/services/usersService.js +0 -411
  707. package/cli/builder/bundles/users-bundle/src/providers/mongoose/userProvider.js +0 -47
  708. package/cli/builder/bundles/users-bundle/src/providers/sequelize/userProvider.js +0 -48
  709. package/cli/builder/bundles/users-bundle/tests/loginTest.js +0 -182
  710. package/cli/builder/bundles/users-bundle/usersBundle.js +0 -26
  711. package/cli/builder/microService/microService.js +0 -261
  712. package/cli/builder/microService/skeletons/.editorconfig +0 -18
  713. package/cli/builder/microService/skeletons/.env-cmdrc.js +0 -32
  714. package/cli/builder/microService/skeletons/.jshintrc +0 -37
  715. package/cli/builder/microService/skeletons/README.md +0 -117
  716. package/cli/builder/microService/skeletons/bin/bash/hello.sh +0 -5
  717. package/cli/builder/microService/skeletons/bin/cli +0 -13
  718. package/cli/builder/microService/skeletons/bin/python/hello.py +0 -20
  719. package/cli/builder/microService/skeletons/config/config.js +0 -29
  720. package/cli/builder/microService/skeletons/config/pm2.config.js +0 -72
  721. package/cli/builder/microService/skeletons/config/webpack/webpack.config.dev.js +0 -8
  722. package/cli/builder/microService/skeletons/config/webpack/webpack.config.prod.js +0 -25
  723. package/cli/builder/microService/skeletons/config/webpack.config.js +0 -114
  724. package/cli/builder/microService/skeletons/package.json +0 -76
  725. package/cli/builder/microService/skeletons/src/browser/index.css +0 -3
  726. package/cli/builder/microService/skeletons/src/browser/index.js +0 -16
  727. package/cli/builder/microService/skeletons/src/browser/socketio.js +0 -46
  728. package/cli/builder/microService/skeletons/src/cli/cli.js +0 -224
  729. package/cli/builder/microService/skeletons/src/cli/menu.js +0 -28
  730. package/cli/builder/microService/skeletons/src/n-api/README.md +0 -1
  731. package/cli/builder/microService/skeletons/src/n-api/binding.gyp +0 -14
  732. package/cli/builder/microService/skeletons/src/n-api/hello.cc +0 -14
  733. package/cli/builder/microService/skeletons/src/n-api/hello.js +0 -23
  734. package/cli/builder/microService/skeletons/src/n-api/package.json +0 -15
  735. package/cli/builder/microService/skeletons/src/node/examples/index.js +0 -120
  736. package/cli/builder/microService/skeletons/src/node/index.js +0 -102
  737. package/cli/builder/microService/skeletons/src/node/services/markdown/markdown.js +0 -27
  738. package/cli/builder/microService/skeletons/src/node/services/servers/http.js +0 -45
  739. package/cli/builder/microService/skeletons/src/node/services/servers/https.js +0 -44
  740. package/cli/builder/microService/skeletons/src/node/services/socketio/socketio.js +0 -46
  741. package/cli/builder/microService/skeletons/src/node/services/syscall/syscall.js +0 -111
  742. package/cli/builder/microService/skeletons/src/node/services/worker/thread.js +0 -59
  743. package/cli/builder/microService/skeletons/src/node/services/worker/worker.js +0 -60
  744. package/cli/builder/microService/skeletons/src/templates/base.html +0 -12
  745. package/cli/builder/microService/skeletons/src/templates/socket.html +0 -23
  746. package/cli/builder/microService/skeletons/tests/unit/serviceTest.js +0 -30
  747. package/cli/builder/project/project.js +0 -474
  748. package/cli/builder/project/skeletons/README.md +0 -778
  749. package/cli/builder/project/skeletons/bin/dev-deploy.sh +0 -5
  750. package/cli/builder/project/skeletons/bin/generateCertificates.sh.skeleton +0 -180
  751. package/cli/builder/project/skeletons/bin/prod-deploy.sh +0 -3
  752. package/cli/builder/project/skeletons/config/config.js.skeleton +0 -178
  753. package/cli/builder/project/skeletons/config/openssl/ca/openssl.cnf.skeleton +0 -150
  754. package/cli/builder/project/skeletons/config/openssl/ca_intermediate/openssl.cnf.skeleton +0 -152
  755. package/cli/builder/project/skeletons/config/pm2.config.js.skeleton +0 -62
  756. package/cli/builder/project/skeletons/documentation.html.twig +0 -24
  757. package/cli/builder/project/skeletons/editorconfig.skeleton +0 -18
  758. package/cli/builder/project/skeletons/eslintignore.skeleton +0 -15
  759. package/cli/builder/project/skeletons/eslintrc.js.skeleton +0 -97
  760. package/cli/builder/project/skeletons/gitignore.skeleton +0 -32
  761. package/cli/builder/project/skeletons/migrations/2022.12.25T17.37.37.entity-user.js +0 -137
  762. package/cli/builder/project/skeletons/migrations/2022.12.25T17.37.38.entity-session.js +0 -97
  763. package/cli/builder/project/skeletons/migrations/2022.12.25T17.37.39.entity-requests.js +0 -115
  764. package/cli/builder/project/skeletons/migrations/2022.12.25T17.37.40.entity-jwts.js +0 -97
  765. package/cli/builder/project/skeletons/migrations/migrations.skeleton.js +0 -101
  766. package/cli/builder/project/skeletons/package.json.twig +0 -71
  767. package/cli/builder/react/reactBuilder.js +0 -224
  768. package/cli/builder/react/skeletons/app/Resources/databases/nodefony.db +0 -0
  769. package/cli/builder/react/skeletons/app/Resources/translations/messages.en_en.yml +0 -5
  770. package/cli/builder/react/skeletons/app/Resources/translations/messages.fr_fr.yml +0 -5
  771. package/cli/builder/react/skeletons/app/Resources/views/base.html.twig +0 -33
  772. package/cli/builder/react/skeletons/app/config/config.js +0 -392
  773. package/cli/builder/react/skeletons/app/config/routing.js +0 -10
  774. package/cli/builder/react/skeletons/app/config/security.js +0 -74
  775. package/cli/builder/react/skeletons/app/controller/appController.js +0 -22
  776. package/cli/builder/sandbox/sandBoxBuilder.js +0 -610
  777. package/cli/builder/sandbox/skeletons/Resources/css/entry.css +0 -48
  778. package/cli/builder/sandbox/skeletons/Resources/js/entry.js +0 -60
  779. package/cli/builder/sandbox/skeletons/Resources/public/manifest.json +0 -32
  780. package/cli/builder/sandbox/skeletons/Resources/translations/messages.en_en.yml +0 -5
  781. package/cli/builder/sandbox/skeletons/Resources/translations/messages.fr_fr.yml +0 -5
  782. package/cli/builder/sandbox/skeletons/Resources/views/base.html.twig +0 -46
  783. package/cli/builder/sandbox/skeletons/Resources/views/index.html.twig +0 -34
  784. package/cli/builder/sandbox/skeletons/bootstrap/custom.scss +0 -27
  785. package/cli/builder/sandbox/skeletons/bootstrap/entry.scss +0 -60
  786. package/cli/builder/sandbox/skeletons/workbox/templates/index.html.twig +0 -32
  787. package/cli/builder/sandbox/skeletons/workbox/workers/service-worker.js +0 -196
  788. package/cli/builder/skeletons/Resources/public/favicon.ico +0 -0
  789. package/cli/builder/skeletons/Resources/public/images/app-logo.png +0 -0
  790. package/cli/builder/skeletons/Resources/views/framework-bundle/views/401.html.twig +0 -1
  791. package/cli/builder/skeletons/Resources/views/framework-bundle/views/401.json.twig +0 -24
  792. package/cli/builder/skeletons/Resources/views/framework-bundle/views/403.html.twig +0 -1
  793. package/cli/builder/skeletons/Resources/views/framework-bundle/views/403.json.twig +0 -20
  794. package/cli/builder/skeletons/Resources/views/framework-bundle/views/404.html.twig +0 -1
  795. package/cli/builder/skeletons/Resources/views/framework-bundle/views/404.json.twig +0 -20
  796. package/cli/builder/skeletons/Resources/views/framework-bundle/views/500.html.twig +0 -1
  797. package/cli/builder/skeletons/Resources/views/framework-bundle/views/base.html.twig +0 -30
  798. package/cli/builder/skeletons/Resources/views/framework-bundle/views/exception.html.twig +0 -1
  799. package/cli/builder/skeletons/Resources/views/framework-bundle/views/exception.json.twig +0 -24
  800. package/cli/builder/skeletons/Resources/views/framework-bundle/views/footer.html.twig +0 -33
  801. package/cli/builder/skeletons/Resources/views/framework-bundle/views/header.html.twig +0 -6
  802. package/cli/builder/skeletons/Resources/views/framework-bundle/views/index.html.twig +0 -6
  803. package/cli/builder/skeletons/Resources/views/framework-bundle/views/index.json.twig +0 -1
  804. package/cli/builder/skeletons/Resources/views/framework-bundle/views/layout.html.twig +0 -125
  805. package/cli/builder/skeletons/Resources/views/framework-bundle/views/layout.json.twig +0 -5
  806. package/cli/builder/skeletons/Resources/views/framework-bundle/views/timeout.html.twig +0 -1
  807. package/cli/builder/skeletons/Resources/views/framework-bundle/views/timeout.json.twig +0 -24
  808. package/cli/builder/skeletons/app/appKernel.js +0 -133
  809. package/cli/builder/skeletons/binding/binding.cc +0 -26
  810. package/cli/builder/skeletons/binding/binding.skeleton +0 -8
  811. package/cli/builder/skeletons/bundle/bundleClass.js +0 -37
  812. package/cli/builder/skeletons/command/commandClass.js +0 -11
  813. package/cli/builder/skeletons/command/taskClass.js +0 -20
  814. package/cli/builder/skeletons/config/config.js +0 -138
  815. package/cli/builder/skeletons/config/nodefony/elastic-bundle.js +0 -37
  816. package/cli/builder/skeletons/config/nodefony/framework-bundle.js +0 -22
  817. package/cli/builder/skeletons/config/nodefony/http-bundle.js +0 -104
  818. package/cli/builder/skeletons/config/nodefony/mail-bundle.js +0 -44
  819. package/cli/builder/skeletons/config/nodefony/mongoose-bundle.js +0 -51
  820. package/cli/builder/skeletons/config/nodefony/monitoring-bundle.js +0 -34
  821. package/cli/builder/skeletons/config/nodefony/realtime-bundle.js +0 -15
  822. package/cli/builder/skeletons/config/nodefony/redis-bundle.js +0 -44
  823. package/cli/builder/skeletons/config/nodefony/security-bundle.js +0 -25
  824. package/cli/builder/skeletons/config/nodefony/sequelize-bundle.js +0 -156
  825. package/cli/builder/skeletons/config/routing.js +0 -55
  826. package/cli/builder/skeletons/config/security.js +0 -102
  827. package/cli/builder/skeletons/config/services.js +0 -1
  828. package/cli/builder/skeletons/config/webpack/webpack.dev.config.js +0 -13
  829. package/cli/builder/skeletons/config/webpack/webpack.prod.config.js +0 -20
  830. package/cli/builder/skeletons/config/webpack.config.js +0 -148
  831. package/cli/builder/skeletons/controller/controllerClass.js +0 -75
  832. package/cli/builder/skeletons/package.json.twig +0 -57
  833. package/cli/builder/skeletons/unittest/testFile.js +0 -46
  834. package/cli/builder/vue/skeletons/Resources/public/images/app-logo.png +0 -0
  835. package/cli/builder/vue/skeletons/Resources/translations/messages.en_en.yml +0 -5
  836. package/cli/builder/vue/skeletons/Resources/translations/messages.fr_fr.yml +0 -5
  837. package/cli/builder/vue/skeletons/vue.config.js +0 -129
  838. package/cli/builder/vue/vueBuilder.js +0 -410
  839. package/cli/generate/generate.es6 +0 -103
  840. package/cli/install/install.js +0 -190
  841. package/cli/sequelize/sequelize.js +0 -94
  842. package/cli/start.js +0 -702
  843. package/cli/tools/pm2.es6 +0 -112
  844. package/cli/tools/tools.es6 +0 -97
  845. package/cli.es6 +0 -925
  846. package/container.es6 +0 -272
  847. package/error.es6 +0 -293
  848. package/fileClass.es6 +0 -242
  849. package/finder/file.es6 +0 -33
  850. package/finder/fileResult.es6 +0 -138
  851. package/finder/finder2.es6 +0 -275
  852. package/finder.es6 +0 -427
  853. package/kernel/annotations/annotations.es6 +0 -286
  854. package/kernel/api/api.es6 +0 -61
  855. package/kernel/api/graphqlApi.es6 +0 -107
  856. package/kernel/api/jsonApi.es6 +0 -177
  857. package/kernel/api/openApi.es6 +0 -139
  858. package/kernel/api/schemas/openApiSchema.js +0 -394
  859. package/kernel/babylon.es6 +0 -162
  860. package/kernel/bundle.es6 +0 -1200
  861. package/kernel/cliKernel.es6 +0 -869
  862. package/kernel/command.es6 +0 -78
  863. package/kernel/commands/nodefonyCommand.es6 +0 -247
  864. package/kernel/commands/tasks/bundlesTask.es6 +0 -59
  865. package/kernel/controllers/controller.es6 +0 -791
  866. package/kernel/fixture.es6 +0 -19
  867. package/kernel/injections/injections.es6 +0 -424
  868. package/kernel/kernel.es6 +0 -1960
  869. package/kernel/kernelWatcher.es6 +0 -387
  870. package/kernel/orm/entity.es6 +0 -59
  871. package/kernel/orm/orm.es6 +0 -139
  872. package/kernel/reader.es6 +0 -290
  873. package/kernel/security/encoder.es6 +0 -17
  874. package/kernel/security/factories/factory.es6 +0 -111
  875. package/kernel/security/factories/passeportFactory.es6 +0 -61
  876. package/kernel/security/provider.es6 +0 -58
  877. package/kernel/security/providers/chainProvider.es6 +0 -99
  878. package/kernel/security/providers/memoryProvider.es6 +0 -55
  879. package/kernel/security/providers/providerManager.es6 +0 -67
  880. package/kernel/security/providers/userEntityProvider.es6 +0 -50
  881. package/kernel/security/role.es6 +0 -12
  882. package/kernel/security/secureArea.es6 +0 -431
  883. package/kernel/security/tokens/token.es6 +0 -171
  884. package/kernel/security/user.es6 +0 -106
  885. package/kernel/serviceRealTime.es6 +0 -21
  886. package/kernel/services/connectionsService.es6 +0 -93
  887. package/kernel/services/cron/cronService.es6 +0 -123
  888. package/kernel/task.es6 +0 -80
  889. package/kernel/templates.es6 +0 -22
  890. package/kernel/templating/twig.es6 +0 -218
  891. package/kernel/tests/cliTest.js +0 -59
  892. package/kernel/tests/containerTest.js +0 -232
  893. package/kernel/tests/kernelTest.js +0 -39
  894. package/nodefony.es6 +0 -1084
  895. package/notificationsCenter.es6 +0 -118
  896. package/protocol.es6 +0 -86
  897. package/protocols/bayeux.es6 +0 -174
  898. package/protocols/jsonRpc/jsonrpc.es6 +0 -56
  899. package/result.es6 +0 -99
  900. package/service.es6 +0 -288
  901. package/syslog/pdu.es6 +0 -141
  902. package/syslog/syslog.es6 +0 -754
  903. package/watcher.es6 +0 -113
@@ -0,0 +1,1159 @@
1
+ import { isLogColorEnabled, logColor } from "./logColor.js";
2
+ import { extend } from "../Tools.js";
3
+ import Event from "../Event.js";
4
+ import Pdu from "./Pdu.js";
5
+ import { inspect } from "node:util";
6
+ //#region src/syslog/Syslog.ts
7
+ const yellow = (s) => logColor.yellowBold(s);
8
+ const red = (s) => logColor.redBold(s);
9
+ const cyan = (s) => logColor.cyanBold(s);
10
+ const blue = (s) => logColor.blueBrightBold(s);
11
+ const green = (s) => logColor.green(s);
12
+ const _proc = globalThis.process;
13
+ const _stripAnsi = (s) => s.replace(/\x1b\[[0-9;]*m/g, "");
14
+ let _bufferMode = "auto";
15
+ let _bufferOn = null;
16
+ let _outChunks = null;
17
+ let _outBytes = 0;
18
+ let _flushScheduled = false;
19
+ const FLUSH_BYTES = 65536;
20
+ const _setImmediate = globalThis.setImmediate;
21
+ const _resolveBufferOn = () => {
22
+ if (_bufferOn !== null) return _bufferOn;
23
+ _bufferOn = !_setImmediate ? false : _bufferMode === "on" ? true : _bufferMode === "off" ? false : !_proc?.stdout?.isTTY;
24
+ return _bufferOn;
25
+ };
26
+ const _stdoutSink = {
27
+ name: "stdout",
28
+ writeOut(s) {
29
+ if (_proc?.stdout) _proc.stdout.write(s);
30
+ else console.log(_stripAnsi(s).replace(/\n$/, ""));
31
+ },
32
+ writeErr(s) {
33
+ if (_proc?.stderr) _proc.stderr.write(s);
34
+ else console.error(_stripAnsi(s).replace(/\n$/, ""));
35
+ },
36
+ flushSync() {},
37
+ close() {}
38
+ };
39
+ /** Sink `/dev/null` : noop total (bench — mesure du plafond sans I/O de log). */
40
+ const NULL_LOG_SINK = {
41
+ name: "null",
42
+ writeOut() {},
43
+ writeErr() {},
44
+ flushSync() {},
45
+ close() {}
46
+ };
47
+ let _sink = _stdoutSink;
48
+ let _sinkMuted = false;
49
+ const _writeStdoutNow = (s) => {
50
+ if (!_sinkMuted) _sink.writeOut(s);
51
+ };
52
+ const _writeStderrNow = (s) => {
53
+ if (!_sinkMuted) _sink.writeErr(s);
54
+ };
55
+ const _flushOut = () => {
56
+ _flushScheduled = false;
57
+ if (_outChunks && _outChunks.length > 0) {
58
+ _writeStdoutNow(_outChunks.join(""));
59
+ _outChunks.length = 0;
60
+ _outBytes = 0;
61
+ }
62
+ };
63
+ const _setBufferMode = (mode) => {
64
+ _flushOut();
65
+ _bufferMode = mode === true ? "on" : mode === false ? "off" : "auto";
66
+ _bufferOn = null;
67
+ };
68
+ const _setLogSink = (sink) => {
69
+ _flushOut();
70
+ if (_sink !== sink && _sink !== _stdoutSink && _sink !== NULL_LOG_SINK) _sink.close();
71
+ _sink = sink ?? _stdoutSink;
72
+ };
73
+ const writeOut = (s) => {
74
+ if (!_resolveBufferOn()) {
75
+ _writeStdoutNow(s);
76
+ return;
77
+ }
78
+ if (_outChunks === null) _outChunks = [];
79
+ _outChunks.push(s);
80
+ _outBytes += s.length;
81
+ if (_outBytes >= FLUSH_BYTES) {
82
+ _flushOut();
83
+ return;
84
+ }
85
+ if (!_flushScheduled && _setImmediate) {
86
+ _flushScheduled = true;
87
+ _setImmediate(_flushOut);
88
+ }
89
+ };
90
+ const writeErr = (s) => {
91
+ if (_outChunks && _outChunks.length > 0) _flushOut();
92
+ _writeStderrNow(s);
93
+ };
94
+ if (_proc?.on) {
95
+ const _onExit = () => {
96
+ _flushOut();
97
+ _sink.flushSync();
98
+ };
99
+ _proc.on("exit", _onExit);
100
+ _proc.on("beforeExit", _onExit);
101
+ }
102
+ var CircularBuffer = class {
103
+ buf;
104
+ head = 0;
105
+ _size = 0;
106
+ capacity;
107
+ constructor(capacity) {
108
+ this.capacity = capacity;
109
+ this.buf = new Array(capacity);
110
+ }
111
+ push(item) {
112
+ if (this._size === this.capacity) {
113
+ this.buf[this.head] = item;
114
+ this.head = (this.head + 1) % this.capacity;
115
+ } else {
116
+ const tail = (this.head + this._size) % this.capacity;
117
+ this.buf[tail] = item;
118
+ this._size++;
119
+ }
120
+ }
121
+ get length() {
122
+ return this._size;
123
+ }
124
+ last() {
125
+ if (this._size === 0) return void 0;
126
+ return this.buf[(this.head + this._size - 1) % this.capacity];
127
+ }
128
+ clear() {
129
+ this.head = 0;
130
+ this._size = 0;
131
+ }
132
+ toArray() {
133
+ const result = new Array(this._size);
134
+ for (let i = 0; i < this._size; i++) result[i] = this.buf[(this.head + i) % this.capacity];
135
+ return result;
136
+ }
137
+ };
138
+ const formatDebug = function(debug) {
139
+ if (typeof debug === "boolean") return debug;
140
+ if (typeof debug === "string") {
141
+ if ([
142
+ "false",
143
+ "undefined",
144
+ "null"
145
+ ].includes(debug)) return false;
146
+ if (debug === "true" || debug === "*") return true;
147
+ const mytab = debug.split(/,| /);
148
+ return mytab[0] === "*" ? true : mytab;
149
+ }
150
+ if (Array.isArray(debug)) return debug[0] === "*" ? true : debug;
151
+ return false;
152
+ };
153
+ const conditionOptions = function(environment, debug = false) {
154
+ debug = formatDebug(debug);
155
+ let obj;
156
+ if (environment === "development") obj = { severity: {
157
+ operator: "<=",
158
+ data: debug === false ? 6 : 7
159
+ } };
160
+ else obj = { severity: {
161
+ operator: "<=",
162
+ data: debug ? 7 : 6
163
+ } };
164
+ if (typeof debug === "object") obj.msgid = {
165
+ operator: "==",
166
+ data: debug
167
+ };
168
+ return obj;
169
+ };
170
+ const defaultSettings = {
171
+ moduleName: "SYSLOG",
172
+ msgid: "",
173
+ maxStack: 100,
174
+ rateLimit: false,
175
+ burstLimit: 3,
176
+ defaultSeverity: "DEBUG",
177
+ checkConditions: "&&",
178
+ async: false
179
+ };
180
+ const sysLogSeverity = Pdu.sysLogSeverity();
181
+ const operators = {
182
+ "<": (ele1, ele2) => ele1 < ele2,
183
+ ">": (ele1, ele2) => ele1 > ele2,
184
+ "<=": (ele1, ele2) => ele1 <= ele2,
185
+ ">=": (ele1, ele2) => ele1 >= ele2,
186
+ "==": (ele1, ele2) => ele1 == ele2,
187
+ "===": (ele1, ele2) => ele1 === ele2,
188
+ "!=": (ele1, ele2) => ele1 !== ele2,
189
+ RegExp: (ele1, ele2) => ele2.test(ele1)
190
+ };
191
+ const conditionsObj = {
192
+ severity: (pdu, condition) => {
193
+ for (const sev in condition.data) if (condition.operator && operators[condition.operator](pdu.severity, condition.data[sev])) return true;
194
+ return false;
195
+ },
196
+ msgid: (pdu, condition) => {
197
+ if (condition.data instanceof RegExp) return condition.data.test(pdu.msgid);
198
+ for (const sev in condition.data) if (condition.operator && operators[condition.operator](pdu.msgid, sev)) return true;
199
+ return false;
200
+ },
201
+ date: (pdu, condition) => condition.operator ? operators[condition.operator](pdu.timeStamp, condition.data) : false
202
+ };
203
+ const logicCondition = {
204
+ "&&": (myConditions, pdu) => {
205
+ let res = false;
206
+ for (const ele in myConditions) {
207
+ res = conditionsObj[ele](pdu, myConditions[ele]);
208
+ if (!res) break;
209
+ }
210
+ return res;
211
+ },
212
+ "||": (myConditions, pdu) => {
213
+ let res = false;
214
+ for (const ele in myConditions) {
215
+ res = conditionsObj[ele](pdu, myConditions[ele]);
216
+ if (res) break;
217
+ }
218
+ return res;
219
+ }
220
+ };
221
+ const checkFormatSeverity = (ele) => {
222
+ let res;
223
+ switch (typeof ele) {
224
+ case "object":
225
+ if (Array.isArray(ele)) res = ele;
226
+ else throw new Error(`checkFormatSeverity bad format type: object`);
227
+ break;
228
+ case "string":
229
+ res = ele.split(/,| /);
230
+ break;
231
+ case "number":
232
+ res = [ele];
233
+ break;
234
+ default: throw new Error(`checkFormatSeverity bad format type : ${typeof ele}`);
235
+ }
236
+ return res;
237
+ };
238
+ const checkFormatDate = function(ele) {
239
+ if (ele instanceof Date) return ele.getTime();
240
+ if (typeof ele === "string") return new Date(ele).getTime();
241
+ throw new Error(`checkFormatDate bad format : ${String(ele)}`);
242
+ };
243
+ const checkFormatMsgId = function(ele) {
244
+ if (typeof ele === "string") return ele.split(/,| /);
245
+ if (typeof ele === "number") return [ele];
246
+ if (ele instanceof RegExp) return ele;
247
+ if (Array.isArray(ele)) return ele;
248
+ throw new Error(`checkFormatMsgId bad format ${typeof ele} : ${String(ele)}`);
249
+ };
250
+ const wrapperCondition = function(conditions, callback) {
251
+ let myFuncCondition = () => false;
252
+ if (conditions.checkConditions && conditions.checkConditions in logicCondition) {
253
+ myFuncCondition = logicCondition[conditions.checkConditions];
254
+ delete conditions.checkConditions;
255
+ } else if (this.settings.checkConditions) myFuncCondition = logicCondition[this.settings.checkConditions];
256
+ const Conditions = sanitizeConditions(conditions);
257
+ if (typeof callback === "function") return (pdu) => {
258
+ if (myFuncCondition(Conditions, pdu)) callback(pdu);
259
+ };
260
+ if (Array.isArray(callback)) {
261
+ const tab = [];
262
+ for (const pdu of callback) if (myFuncCondition(Conditions, pdu)) tab.push(pdu);
263
+ return tab;
264
+ }
265
+ throw new Error("Bad wrapper");
266
+ };
267
+ const sanitizeConditions = function(settingsCondition) {
268
+ if (typeof settingsCondition !== "object" || settingsCondition === null) return false;
269
+ for (const ele in settingsCondition) {
270
+ if (!(ele in conditionsObj)) return false;
271
+ const condi = settingsCondition[ele];
272
+ if (condi.operator && !(condi.operator in operators)) throw new Error(`Contitions bad operator : ${condi.operator}`);
273
+ if (condi.data) switch (ele) {
274
+ case "severity": {
275
+ if (!condi.operator) condi.operator = "==";
276
+ const res = checkFormatSeverity(condi.data);
277
+ condi.data = {};
278
+ for (let i = 0; i < res.length; i++) {
279
+ const mySeverity = Pdu.severityToString(res[i]);
280
+ if (mySeverity) condi.data[mySeverity] = sysLogSeverity[mySeverity];
281
+ else return false;
282
+ }
283
+ break;
284
+ }
285
+ case "msgid": {
286
+ if (!condi.operator) condi.operator = "==";
287
+ const res = checkFormatMsgId(condi.data);
288
+ if (Array.isArray(res)) {
289
+ condi.data = {};
290
+ for (let i = 0; i < res.length; i++) condi.data[String(res[i])] = "||";
291
+ } else condi.data = res;
292
+ break;
293
+ }
294
+ case "date": {
295
+ const res = checkFormatDate(condi.data);
296
+ if (res) condi.data = res;
297
+ else return false;
298
+ break;
299
+ }
300
+ default: return false;
301
+ }
302
+ else return false;
303
+ }
304
+ return settingsCondition;
305
+ };
306
+ const createPDU = function(payload, severity, moduleName, msgid, msg) {
307
+ return new Pdu(payload, severity || this.settings.defaultSeverity, moduleName, msgid, msg);
308
+ };
309
+ /**
310
+ * Hub central de logs structurés de Nodefony — conforme RFC 5424.
311
+ *
312
+ * Reçoit des {@link Pdu} via {@link log}, les pousse dans un ring buffer (`CircularBuffer`,
313
+ * O(1)), applique les filtres ({@link listenWithConditions}), et fire `"onLog"` pour les
314
+ * transports branchés (console, file, JSON, SSE Studio).
315
+ *
316
+ * Hérite d'{@link Event} (EventEmitter étendu) → toute brique du framework peut s'abonner.
317
+ *
318
+ * Modes :
319
+ * - **rateLimit** + **burstLimit** : protection anti-flood (ex: boucle qui log 10k/s)
320
+ * - **async** : fire `"onLog"` sur next tick (libère le hot path) ou inline
321
+ * - **overrideConsole** : intercepte `console.log/warn/error/debug/info` → pipe vers Syslog
322
+ *
323
+ * @example
324
+ * ```ts
325
+ * const syslog = new Syslog({ moduleName: "MyApp", defaultSeverity: "INFO" });
326
+ * syslog.on("onLog", (pdu: Pdu) => console.log(pdu.toString()));
327
+ * syslog.log("hello world", "INFO");
328
+ * ```
329
+ *
330
+ * @remarks Utilisé par défaut par chaque {@link Service} via `this.syslog`. Pour les apps
331
+ * complexes, partager un Syslog unique entre services évite de dupliquer les buffers.
332
+ */
333
+ var Syslog = class Syslog extends Event {
334
+ settings;
335
+ _ring;
336
+ burstPrinted;
337
+ missed;
338
+ invalid;
339
+ valid;
340
+ /**
341
+ * Cumul monotone des logs de classe ERREUR (sévérité 0–3 : ERROR/CRITIC/ALERT/EMERGENCY)
342
+ * acceptés depuis la construction. Compteur entier O(1) bumpé dans le seul point de passage
343
+ * {@link pushStack} (0 alloc) → sonde « erreurs par worker » de la santé
344
+ * pod (cf `IInstanceErrorHealth`). Débit dérivé côté lecteur (delta `errorTotal`/ts).
345
+ */
346
+ errorTotal;
347
+ /** Sous-ensemble CRITIQUE (sévérité 0–2 : CRITIC/ALERT/EMERGENCY). Cumul monotone. */
348
+ criticTotal;
349
+ start;
350
+ _async = false;
351
+ _transports = [];
352
+ /**
353
+ * Transports désactivés à chaud (par `setTransportEnabled`) — **lazy** (`null`
354
+ * tant qu'aucun toggle). Garde la réf hors de `_transports` pour pouvoir la
355
+ * remonter. Un transport désactivé est PHYSIQUEMENT retiré de la boucle de fire
356
+ * → **0 surcoût hot path** (pas de test `enabled` par log). Outil dev/diagnostic.
357
+ */
358
+ _disabledTransports = null;
359
+ /**
360
+ * Stockage des Pdu dans le ring buffer (relecture mémoire). `false` = on ne
361
+ * garde plus rien en mémoire (l'Explorer « mémoire » et `buffered` tombent à 0)
362
+ * — outil avancé perf/mémoire (très haut débit). Les compteurs (valid/error)
363
+ * restent comptés. Coût hot path : un test booléen par log.
364
+ */
365
+ _ringEnabled = true;
366
+ /**
367
+ * Diffusion temps réel active (bus `nodefony:syslog` Studio). `false` = le pont de
368
+ * diffusion (`createSyslogBridge`) n'accumule ni ne publie rien → l'onglet Live se
369
+ * grise. N'affecte NI l'écriture (transports/sink) NI la relecture. Coupé = on
370
+ * cesse juste de POUSSER en live ; les logs continuent d'être générés et écrits.
371
+ */
372
+ _streamEnabled = true;
373
+ /**
374
+ * T2 (profil delta vs Express) — gate d'ENTRÉE par sévérité. `null` (défaut) =
375
+ * pas de gate (comportement historique : tout Pdu est créé + poussé au ring,
376
+ * le filtrage de sévérité n'a lieu qu'au LISTENER d'impression — un DEBUG en
377
+ * prod coûtait createPDU + pushStack pour rien, ~1,7 % du profil CPU/req).
378
+ * Valeur numérique N = un log de sévérité STRICTEMENT supérieure à N (moins
379
+ * grave) est court-circuité AVANT toute allocation. Posé par {@link init}
380
+ * (production sans debug → 6 = DEBUG gaté), **re-résoluble à chaud** via
381
+ * {@link setSeverityThreshold} (vision « audit à chaud » : élever la
382
+ * verbosité prod sur une fenêtre bornée sans redémarrer). Une sévérité
383
+ * INCONNUE (`-1`) passe toujours — c'est `createPDU` qui la refuse, et le
384
+ * gate ne doit pas transformer une erreur d'usage en silence. Compteur
385
+ * {@link gated} pour l'introspection.
386
+ */
387
+ _severityThreshold = null;
388
+ /** Pdu singleton retourné par un log gaté (contrat `log(): Pdu`, 1 alloc lazy). */
389
+ _gatedPdu = null;
390
+ /** Nombre de logs court-circuités par le gate de sévérité (T2). */
391
+ gated = 0;
392
+ /**
393
+ * Overrides de seuil PAR MODULE (clé = `msgid` du Pdu, qui vaut le nom du
394
+ * Service émetteur par défaut — cf `Service.log`). `null` par défaut → 0 coût
395
+ * sur le hot path tant qu'aucun debug ciblé n'est actif (RÈGLE perf : lazy
396
+ * null). Posé à chaud par {@link setDebugOverride} (env `NF__DEBUG` au boot,
397
+ * endpoint admin, toggle Studio) : élève la verbosité d'UN module sous gate
398
+ * prod sans toucher les autres ni redémarrer. Consulté dans {@link log} APRÈS
399
+ * le gate global, AVANT toute allocation.
400
+ */
401
+ _debugOverrides = null;
402
+ /**
403
+ * Timers d'auto-extinction des overrides (clé = même `msgid`). `null` tant
404
+ * qu'aucun override temporisé n'est armé. Garde-fou anti-oubli : un debug
405
+ * ciblé ne reste JAMAIS allumé indéfiniment. Timers `unref` (ne tiennent pas
406
+ * la boucle d'événements en vie) + purgés par {@link clearDebugOverride} /
407
+ * {@link reset} (RÈGLE perf : pas de timer sans cleanup).
408
+ */
409
+ _debugOverrideTimers = null;
410
+ /**
411
+ * Échéance (epoch ms) de chaque override TEMPORISÉ — pour exposer le « s'éteint
412
+ * dans X » au panneau Studio. `null` tant qu'aucun override temporisé ; un
413
+ * override permanent (sans ttl) n'y figure pas. Nettoyé en miroir du timer.
414
+ */
415
+ _debugOverrideExpiry = null;
416
+ /**
417
+ * Construit le Syslog avec settings (merge default + override user).
418
+ *
419
+ * @param settings - config (`moduleName`, `maxStack`, `rateLimit`, `burstLimit`,
420
+ * `defaultSeverity`, `async`, `overrideConsole`).
421
+ */
422
+ constructor(settings) {
423
+ super(settings);
424
+ this.settings = extend({}, defaultSettings, settings || {});
425
+ this._ring = new CircularBuffer(this.settings.maxStack ?? 100);
426
+ this.burstPrinted = 0;
427
+ this.missed = 0;
428
+ this.invalid = 0;
429
+ this.valid = 0;
430
+ this.errorTotal = 0;
431
+ this.criticTotal = 0;
432
+ this.start = 0;
433
+ this._async = this.settings.async || false;
434
+ if (this.settings.overrideConsole) Syslog.overrideConsole(this);
435
+ }
436
+ get ringStack() {
437
+ return this._ring.toArray();
438
+ }
439
+ /**
440
+ * Capacité MAX du ring buffer (`settings.maxStack`) — nombre de Pdu que la
441
+ * mémoire peut relire. `ringStack.length` = remplissage courant ; ce getter =
442
+ * le plafond. Lecture seule, 0 allocation (introspection data plane Studio).
443
+ */
444
+ get bufferCapacity() {
445
+ return this._ring.capacity;
446
+ }
447
+ /** `true` si les Pdu sont stockés dans le ring (relecture mémoire active). */
448
+ get ringEnabled() {
449
+ return this._ringEnabled;
450
+ }
451
+ /**
452
+ * Active/désactive le stockage mémoire (ring) à chaud — outil avancé perf/mémoire.
453
+ * Désactiver = l'Explorer « mémoire » et `buffered` retombent à 0 (les logs ne
454
+ * sont plus gardés en RAM) ; les compteurs santé restent comptés. Vide le ring
455
+ * quand on coupe (libère la RAM tout de suite). Idempotent.
456
+ *
457
+ * @param enabled - `true` = stocker dans le ring ; `false` = ne plus stocker.
458
+ * @returns `true` si l'état a changé.
459
+ */
460
+ setRingEnabled(enabled) {
461
+ if (this._ringEnabled === enabled) return false;
462
+ this._ringEnabled = enabled;
463
+ if (!enabled) this._ring.clear();
464
+ return true;
465
+ }
466
+ /** `true` si la diffusion temps réel (`nodefony:syslog`) est active. */
467
+ get streamEnabled() {
468
+ return this._streamEnabled;
469
+ }
470
+ /**
471
+ * Active/désactive la diffusion temps réel (bus `nodefony:syslog`) à chaud. Coupé =
472
+ * le pont Studio cesse de pousser des frames (onglet Live grisé) ; l'écriture et la
473
+ * relecture froide ne sont PAS touchées. Idempotent.
474
+ *
475
+ * @param enabled - `true` = diffuser ; `false` = couper la diffusion live.
476
+ * @returns `true` si l'état a changé.
477
+ */
478
+ setStreamEnabled(enabled) {
479
+ if (this._streamEnabled === enabled) return false;
480
+ this._streamEnabled = enabled;
481
+ return true;
482
+ }
483
+ /**
484
+ * Redimensionne le ring buffer (capacité de relecture en mémoire) en
485
+ * **préservant** les Pdu déjà présents (tronqués aux `max` plus récents si on
486
+ * rétrécit). Destiné au **boot uniquement** (lu depuis `config.log.maxStack`) —
487
+ * recrée le buffer, donc à ne pas appeler dans le hot path. No-op si `max`
488
+ * invalide ou inchangé.
489
+ *
490
+ * @param max - nouvelle capacité (> 0).
491
+ */
492
+ setMaxStack(max) {
493
+ if (!Number.isFinite(max) || max <= 0 || max === this.settings.maxStack) return;
494
+ const kept = this._ring.toArray().slice(-max);
495
+ this.settings.maxStack = max;
496
+ this._ring = new CircularBuffer(max);
497
+ for (const pdu of kept) this._ring.push(pdu);
498
+ }
499
+ static formatDebug(debug) {
500
+ return formatDebug(debug);
501
+ }
502
+ /**
503
+ * Initialise le pipeline Syslog selon environnement + debug. Idempotent — purge les
504
+ * listeners `"onLog"` existants avant d'en ajouter un.
505
+ *
506
+ * @param environment - `"development"` / `"production"` / `"test"`.
507
+ * @param debug - active sévérité DEBUG (`+7`).
508
+ * @param options - conditions de filtrage Syslog custom (override des conditions par env).
509
+ */
510
+ init(environment, debug, options) {
511
+ this.removeAllListeners("onLog");
512
+ this.listenWithConditions(options || conditionOptions(environment, debug), (pdu) => Syslog.normalizeLog(pdu));
513
+ }
514
+ /**
515
+ * T2 — résout une sévérité (nom ou numérique) en valeur RFC 5424. Inconnue →
516
+ * `-1` (passe toujours le gate : fail-open, `createPDU` jettera comme avant).
517
+ * `sysLogSeverity` est un enum numérique TS → la reverse-map mêle string et
518
+ * number, d'où le narrowing explicite.
519
+ */
520
+ static toSeverityNumber(severity) {
521
+ if (typeof severity === "number") return severity;
522
+ const v = sysLogSeverity[severity];
523
+ return typeof v === "number" ? v : -1;
524
+ }
525
+ /**
526
+ * Valide STRICTEMENT une sévérité d'ENTRÉE (nom RFC 5424 ou numérique 0-7) →
527
+ * numéro, ou `null` si invalide. Pour les surfaces d'entrée (endpoint admin,
528
+ * env) : un niveau inconnu doit être REJETÉ, jamais silencieusement
529
+ * réinterprété (≠ {@link toSeverityNumber}, fail-open `-1` pour le hot path).
530
+ *
531
+ * @param level - nom (`"DEBUG"`) ou numéro (`7` / `"7"`).
532
+ * @returns le numéro 0-7, ou `null` si hors plage / nom inconnu.
533
+ */
534
+ static severityFromInput(level) {
535
+ if (typeof level === "number") return Number.isInteger(level) && level >= 0 && level <= 7 ? level : null;
536
+ if (typeof level === "string") {
537
+ if (/^\d+$/.test(level)) {
538
+ const n = Number(level);
539
+ return n >= 0 && n <= 7 ? n : null;
540
+ }
541
+ const v = sysLogSeverity[level];
542
+ return typeof v === "number" ? v : null;
543
+ }
544
+ return null;
545
+ }
546
+ /**
547
+ * Parse une spec `NF__DEBUG` (env runtime) en directives de debug ciblé.
548
+ * Tokens séparés par virgule/espace :
549
+ * - `*` → debug GLOBAL (lève le gate de sévérité, tout passe) ;
550
+ * - `MODULE` → override `MODULE` à DEBUG ;
551
+ * - `MODULE:LEVEL` → override `MODULE` au niveau `LEVEL` (nom/numérique ;
552
+ * inconnu → DEBUG, tolérant : un typo d'env ne doit pas crasher le boot).
553
+ *
554
+ * Pur (statique, sans état) → testable seul ; appliqué par le Kernel au boot
555
+ * via {@link setSeverityThreshold} / {@link setDebugOverride}.
556
+ *
557
+ * @param spec - valeur brute de `NF__DEBUG` (ex. `"FIREWALL,SESSION:NOTICE"`).
558
+ * @returns `{ global, overrides }`.
559
+ */
560
+ static parseDebugSpec(spec) {
561
+ const result = {
562
+ global: false,
563
+ overrides: []
564
+ };
565
+ if (typeof spec !== "string") return result;
566
+ for (const token of spec.split(/[,\s]+/)) {
567
+ if (!token) continue;
568
+ if (token === "*") {
569
+ result.global = true;
570
+ continue;
571
+ }
572
+ const sep = token.indexOf(":");
573
+ if (sep === -1) {
574
+ result.overrides.push({
575
+ module: token,
576
+ level: 7
577
+ });
578
+ continue;
579
+ }
580
+ const module = token.slice(0, sep);
581
+ if (!module) continue;
582
+ const lvl = Syslog.severityFromInput(token.slice(sep + 1)) ?? 7;
583
+ result.overrides.push({
584
+ module,
585
+ level: lvl
586
+ });
587
+ }
588
+ return result;
589
+ }
590
+ /**
591
+ * T2 — règle (ou lève) le gate d'entrée par sévérité À CHAUD, sans reboot.
592
+ * `null` = plus de gate (tout est créé/poussé, comportement historique) ;
593
+ * `"DEBUG"`/7 = tout passe en restant gateable ; `"INFO"`/6 = défaut prod.
594
+ * Levier de la fenêtre « audit à chaud » : élever temporairement la
595
+ * verbosité prod puis restaurer.
596
+ *
597
+ * @param threshold - sévérité max acceptée (nom ou numérique RFC 5424), ou `null`.
598
+ */
599
+ setSeverityThreshold(threshold) {
600
+ this._severityThreshold = threshold === null ? null : Syslog.toSeverityNumber(threshold);
601
+ }
602
+ /**
603
+ * T2 — un log de cette sévérité franchirait-il le gate d'entrée ? À utiliser
604
+ * aux call sites du hot path AVANT de construire un message coûteux
605
+ * (template string, JSON) — pattern L1 « ne jamais formater au-dessus du
606
+ * niveau actif ».
607
+ *
608
+ * @param severity - sévérité à tester (nom ou numérique).
609
+ * @returns `true` si un log de cette sévérité serait accepté.
610
+ */
611
+ severityEnabled(severity) {
612
+ if (this._severityThreshold === null) return true;
613
+ return Syslog.toSeverityNumber(severity) <= this._severityThreshold;
614
+ }
615
+ /**
616
+ * Élève à chaud le seuil de verbosité d'UN module (debug ciblé), sans reboot et
617
+ * sans toucher aux autres modules. `module` = `msgid` du Pdu (par défaut le nom
618
+ * du Service émetteur, cf `Service.log`). Effet : tant que l'override est actif,
619
+ * un log de ce module passe le gate d'entrée jusqu'à `level` (ex. `"DEBUG"`)
620
+ * alors que le reste reste au seuil global (ex. `"INFO"` en prod).
621
+ *
622
+ * Garde-fou : si `ttlMs > 0`, l'override s'auto-éteint après ce délai (timer
623
+ * `unref`). (Re)poser le même module ré-arme proprement le timer. Sans gate
624
+ * global actif (`_severityThreshold === null`, ex. dev) l'override est sans
625
+ * effet — tout passe déjà.
626
+ *
627
+ * @param module - identité du module (`msgid` / nom du Service).
628
+ * @param level - sévérité max laissée passer pour ce module (nom ou numérique).
629
+ * @param ttlMs - durée de vie en ms (auto-extinction). Omis/≤0 = permanent (déconseillé en prod).
630
+ */
631
+ setDebugOverride(module, level, ttlMs) {
632
+ if (this._debugOverrides === null) this._debugOverrides = /* @__PURE__ */ new Map();
633
+ this._debugOverrides.set(module, Syslog.toSeverityNumber(level));
634
+ this.clearOverrideTimer(module);
635
+ if (ttlMs !== void 0 && ttlMs > 0) {
636
+ if (this._debugOverrideTimers === null) this._debugOverrideTimers = /* @__PURE__ */ new Map();
637
+ const timer = setTimeout(() => {
638
+ this.clearDebugOverride(module);
639
+ }, ttlMs);
640
+ timer.unref();
641
+ this._debugOverrideTimers.set(module, timer);
642
+ if (this._debugOverrideExpiry === null) this._debugOverrideExpiry = /* @__PURE__ */ new Map();
643
+ this._debugOverrideExpiry.set(module, Date.now() + ttlMs);
644
+ } else if (this._debugOverrideExpiry !== null) {
645
+ this._debugOverrideExpiry.delete(module);
646
+ if (this._debugOverrideExpiry.size === 0) this._debugOverrideExpiry = null;
647
+ }
648
+ }
649
+ /**
650
+ * Retire l'override de debug ciblé d'un module (et son timer d'auto-extinction).
651
+ * Retombe à `null` quand le dernier override part (RÈGLE perf : 0 coût hot path).
652
+ *
653
+ * @param module - identité du module (`msgid`).
654
+ * @returns `true` si un override existait et a été retiré.
655
+ */
656
+ clearDebugOverride(module) {
657
+ this.clearOverrideTimer(module);
658
+ if (this._debugOverrideExpiry !== null) {
659
+ this._debugOverrideExpiry.delete(module);
660
+ if (this._debugOverrideExpiry.size === 0) this._debugOverrideExpiry = null;
661
+ }
662
+ if (this._debugOverrides === null) return false;
663
+ const had = this._debugOverrides.delete(module);
664
+ if (this._debugOverrides.size === 0) this._debugOverrides = null;
665
+ return had;
666
+ }
667
+ /** Retire TOUS les overrides de debug ciblé + leurs timers (retour à 0 coût). */
668
+ clearAllDebugOverrides() {
669
+ if (this._debugOverrideTimers !== null) {
670
+ for (const timer of this._debugOverrideTimers.values()) clearTimeout(timer);
671
+ this._debugOverrideTimers = null;
672
+ }
673
+ this._debugOverrides = null;
674
+ this._debugOverrideExpiry = null;
675
+ }
676
+ /**
677
+ * Snapshot des overrides de debug ciblé actifs (introspection — endpoint admin,
678
+ * toggle Studio). Cold path. `{}` si aucun.
679
+ *
680
+ * @returns map `module → seuil numérique` (copie, pas la structure interne).
681
+ */
682
+ getDebugOverrides() {
683
+ if (this._debugOverrides === null) return {};
684
+ const out = {};
685
+ for (const [module, threshold] of this._debugOverrides) out[module] = threshold;
686
+ return out;
687
+ }
688
+ /**
689
+ * Échéances (epoch ms) des overrides TEMPORISÉS (introspection — countdown
690
+ * Studio « s'éteint dans X »). `{}` si aucun ; un override permanent (sans ttl)
691
+ * n'y figure pas.
692
+ *
693
+ * @returns map `module → epoch ms d'extinction` (copie).
694
+ */
695
+ getDebugOverrideExpiry() {
696
+ if (this._debugOverrideExpiry === null) return {};
697
+ const out = {};
698
+ for (const [module, at] of this._debugOverrideExpiry) out[module] = at;
699
+ return out;
700
+ }
701
+ /** Annule + retire le timer d'auto-extinction d'un module (si présent). */
702
+ clearOverrideTimer(module) {
703
+ if (this._debugOverrideTimers === null) return;
704
+ const timer = this._debugOverrideTimers.get(module);
705
+ if (timer !== void 0) {
706
+ clearTimeout(timer);
707
+ this._debugOverrideTimers.delete(module);
708
+ if (this._debugOverrideTimers.size === 0) this._debugOverrideTimers = null;
709
+ }
710
+ }
711
+ get async() {
712
+ return this._async;
713
+ }
714
+ set async(value) {
715
+ this._async = value;
716
+ }
717
+ /**
718
+ * Alias de {@link reset} — purge ring buffer + listeners.
719
+ */
720
+ clean() {
721
+ return this.reset();
722
+ }
723
+ /**
724
+ * Reset complet — vide le ring buffer ET retire tous les listeners.
725
+ *
726
+ * @returns `this` pour chaînage.
727
+ */
728
+ reset() {
729
+ this._ring.clear();
730
+ this.removeAllListeners();
731
+ this.clearAllDebugOverrides();
732
+ return this;
733
+ }
734
+ /**
735
+ * Vide uniquement le ring buffer (conserve les listeners attachés).
736
+ */
737
+ clearLogStack() {
738
+ this._ring.clear();
739
+ }
740
+ /**
741
+ * Push manuel d'un Pdu dans le ring buffer + incrémente compteur `valid`.
742
+ *
743
+ * @param pdu - Pdu à enregistrer.
744
+ * @returns nouvelle taille du ring buffer après push.
745
+ */
746
+ pushStack(pdu) {
747
+ if (this._ringEnabled) this._ring.push(pdu);
748
+ this.valid++;
749
+ const sev = pdu.severity;
750
+ if (sev >= 0 && sev <= 3) {
751
+ this.errorTotal++;
752
+ if (sev <= 2) this.criticTotal++;
753
+ }
754
+ return this._ring.length;
755
+ }
756
+ /**
757
+ * Crée un Pdu et le diffuse dans le pipeline (rate-limit → push → fire `"onLog"`).
758
+ *
759
+ * **Protection rate limit** : si `settings.rateLimit > 0`, ne fire `"onLog"` que pour les
760
+ * `burstLimit` premiers Pdu de la fenêtre. Les suivants incrémentent `missed`.
761
+ *
762
+ * **Mode async** : si `this.async === true`, fire `"onLog"` sur `setImmediate()` (libère
763
+ * le hot path du caller).
764
+ *
765
+ * @param payload - contenu (string, Error, objet — narrower côté lecteur).
766
+ * @param severity - sévérité RFC 5424 (`"INFO"`, `"ERROR"`, ...) ou numérique (6, 3, ...).
767
+ * @param msgid - catégorie de message (`"AUTH"`, `"ROUTER"`). Défaut = `settings.msgid`.
768
+ * @param msg - détail libre optionnel.
769
+ * @returns le `Pdu` créé (utile pour audit/tests).
770
+ */
771
+ log(payload, severity, msgid, msg) {
772
+ if (this._severityThreshold !== null) {
773
+ const sev = payload instanceof Pdu ? payload.severity : Syslog.toSeverityNumber(severity ?? this.settings.defaultSeverity ?? "DEBUG");
774
+ let threshold = this._severityThreshold;
775
+ if (this._debugOverrides !== null) {
776
+ const key = payload instanceof Pdu ? payload.msgid : msgid || this.settings.msgid;
777
+ const eff = this._debugOverrides.get(key) ?? this._debugOverrides.get("*");
778
+ if (eff !== void 0) threshold = eff;
779
+ }
780
+ if (sev > threshold) {
781
+ this.gated++;
782
+ if (this._gatedPdu === null) {
783
+ this._gatedPdu = createPDU.call(this, "GATED", "DEBUG", this.settings.moduleName, msgid || this.settings.msgid);
784
+ this._gatedPdu.status = "DROPPED";
785
+ }
786
+ return this._gatedPdu;
787
+ }
788
+ }
789
+ let pdu;
790
+ if (this.settings.rateLimit !== false) {
791
+ const rate = this.settings.rateLimit;
792
+ const now = Date.now();
793
+ this.start = this.start || now;
794
+ if (now > this.start + rate) {
795
+ this.burstPrinted = 0;
796
+ this.missed = 0;
797
+ this.start = 0;
798
+ }
799
+ if (this.settings.burstLimit && this.settings.burstLimit > this.burstPrinted) {
800
+ try {
801
+ pdu = payload instanceof Pdu ? payload : createPDU.call(this, payload, severity, this.settings.moduleName, msgid || this.settings.msgid, msg);
802
+ } catch (e) {
803
+ console.error(e);
804
+ this.invalid++;
805
+ pdu = pdu ?? createPDU.call(this, e, "ERROR");
806
+ pdu.status = "INVALID";
807
+ return pdu;
808
+ }
809
+ this.pushStack(pdu);
810
+ pdu.status = "ACCEPTED";
811
+ if (this.listenerCount("onLog") > 0) this.fire("onLog", pdu);
812
+ if (this._transports.length > 0) this._fireTransports(pdu);
813
+ this.burstPrinted++;
814
+ return pdu;
815
+ }
816
+ this.missed++;
817
+ pdu = pdu ?? createPDU.call(this, "DROPPED", "WARNING");
818
+ pdu.status = "DROPPED";
819
+ return pdu;
820
+ }
821
+ try {
822
+ pdu = payload instanceof Pdu ? payload : createPDU.call(this, payload, severity, this.settings.moduleName, msgid || this.settings.msgid, msg);
823
+ } catch (e) {
824
+ console.error(e);
825
+ this.invalid++;
826
+ pdu = pdu ?? createPDU.call(this, e, "ERROR");
827
+ pdu.status = "INVALID";
828
+ return pdu;
829
+ }
830
+ this.pushStack(pdu);
831
+ pdu.status = "ACCEPTED";
832
+ if (this.listenerCount("onLog") > 0) this.fire("onLog", pdu);
833
+ if (this._transports.length > 0) this._fireTransports(pdu);
834
+ return pdu;
835
+ }
836
+ getLogStack(start, end, condition) {
837
+ if (arguments.length === 0) return this._ring.last();
838
+ let stack;
839
+ if (condition) stack = this.getLogs(condition);
840
+ else stack = this.ringStack;
841
+ if (!end) return stack.slice(start);
842
+ if (start === end) return stack[stack.length - start - 1];
843
+ return stack.slice(start, end);
844
+ }
845
+ getLogs(conditions, stack = null) {
846
+ if (conditions) return wrapperCondition.call(this, conditions, stack || this.ringStack);
847
+ return this.ringStack;
848
+ }
849
+ logToJson(conditions, stack = null) {
850
+ const res = conditions ? this.getLogs(conditions, stack) : this.ringStack;
851
+ return JSON.stringify(res);
852
+ }
853
+ loadStack(stack, doEvent = false, beforeConditions = null) {
854
+ if (!stack) throw new Error("syslog loadStack : not stack in arguments ");
855
+ if (typeof stack === "string") return this.loadStack(JSON.parse(stack), doEvent, beforeConditions);
856
+ if (Array.isArray(stack) || typeof stack === "object") {
857
+ for (const stackItem of stack) {
858
+ const pdu = new Pdu(stackItem.payload, stackItem.severity, stackItem.moduleName || this.settings.moduleName, stackItem.msgid, stackItem.msg, stackItem.timeStamp);
859
+ this.pushStack(pdu);
860
+ if (doEvent) {
861
+ if (beforeConditions) beforeConditions.call(this, pdu, stackItem);
862
+ this.fire("onLog", pdu);
863
+ }
864
+ }
865
+ return stack;
866
+ }
867
+ throw new Error("syslog loadStack : bad stack in arguments type");
868
+ }
869
+ filter(conditions, callback) {
870
+ if (!conditions) throw new Error("filter conditions not found ");
871
+ conditions = extend(true, {}, conditions);
872
+ const wrapper = wrapperCondition.call(this, conditions, callback);
873
+ if (wrapper) super.on("onLog", wrapper);
874
+ }
875
+ listenWithConditions(conditions, callback) {
876
+ return this.filter(conditions, callback);
877
+ }
878
+ error(data) {
879
+ return this.log(data, "ERROR");
880
+ }
881
+ warn(data) {
882
+ return this.log(data, "WARNING");
883
+ }
884
+ info(data) {
885
+ return this.log(data, "INFO");
886
+ }
887
+ debug(data) {
888
+ return this.log(data, "DEBUG");
889
+ }
890
+ trace(data, ...args) {
891
+ return this.log(data, "NOTICE", ...args);
892
+ }
893
+ print(...args) {
894
+ const payload = args.length === 1 ? args[0] : args;
895
+ return this.log(payload, this.settings.defaultSeverity);
896
+ }
897
+ logMultiple(severity, ...args) {
898
+ const payload = args.length === 1 ? args[0] : args;
899
+ return this.log(payload, severity);
900
+ }
901
+ addTransport(transport) {
902
+ const idx = this._transports.findIndex((t) => t.name === transport.name);
903
+ if (idx === -1) this._transports.push(transport);
904
+ else if (this._transports[idx] !== transport) this._transports[idx] = transport;
905
+ return this;
906
+ }
907
+ removeTransport(transport) {
908
+ const idx = this._transports.indexOf(transport);
909
+ if (idx !== -1) this._transports.splice(idx, 1);
910
+ return this;
911
+ }
912
+ /**
913
+ * Nombre de transports d'écriture branchés (introspection — data plane Studio,
914
+ * tests d'idempotence). Lecture seule, 0 allocation.
915
+ */
916
+ get transportCount() {
917
+ return this._transports.length;
918
+ }
919
+ /**
920
+ * Liste polymorphe des transports d'écriture — chaque entrée porte le `name` de
921
+ * l'`ITransport` (`console`, `file`, `loki`, `syslog`…) et son état `enabled`.
922
+ * C'est l'axe **WRITE** du Log Backplane : l'écriture est un **fan-out** (1 log →
923
+ * N transports actifs), orthogonal à l'axe READ (1 driver queryable). Sert au data
924
+ * plane Studio pour afficher les vraies destinations (et non les inférer des drivers
925
+ * de relecture, ce qui masquait les transports write-only console/syslog/http).
926
+ *
927
+ * Inclut les transports désactivés à chaud (`enabled:false`) pour que l'UI puisse
928
+ * les ré-activer. Chemin FROID (introspection admin) : alloue à l'appel, jamais
929
+ * dans le hot path du log.
930
+ *
931
+ * @returns un tableau `{ name, enabled }` (montés `true` d'abord, puis désactivés).
932
+ */
933
+ listTransports() {
934
+ const out = this._transports.map((t) => ({
935
+ name: t.name,
936
+ enabled: true
937
+ }));
938
+ if (this._disabledTransports) for (const name of this._disabledTransports.keys()) out.push({
939
+ name,
940
+ enabled: false
941
+ });
942
+ return out;
943
+ }
944
+ /**
945
+ * Active/désactive un transport d'écriture **à chaud, par nom** (outil dev /
946
+ * diagnostic — ex. couper la console pour un bench, ou remonter un transport).
947
+ * Désactiver = retirer le transport de la boucle de fire (réf gardée dans
948
+ * {@link _disabledTransports}) → **0 surcoût hot path**. Activer = le remonter.
949
+ *
950
+ * Réversible et idempotent : un toggle vers l'état déjà courant renvoie `false`.
951
+ * N'instancie RIEN : ne peut réactiver qu'un transport préalablement désactivé
952
+ * (un transport jamais monté — ex. `loki` sans URL — exige sa config, pas ce toggle).
953
+ *
954
+ * @param name - `ITransport.name` ciblé.
955
+ * @param enabled - `true` = remonter, `false` = retirer.
956
+ * @returns `true` si l'état a changé, `false` sinon (déjà dans l'état / introuvable).
957
+ */
958
+ setTransportEnabled(name, enabled) {
959
+ if (enabled) {
960
+ const t = this._disabledTransports?.get(name);
961
+ if (!t) return false;
962
+ this._disabledTransports.delete(name);
963
+ if (this._disabledTransports.size === 0) this._disabledTransports = null;
964
+ this.addTransport(t);
965
+ return true;
966
+ }
967
+ const idx = this._transports.findIndex((t) => t.name === name);
968
+ if (idx === -1) return false;
969
+ const [t] = this._transports.splice(idx, 1);
970
+ (this._disabledTransports ??= /* @__PURE__ */ new Map()).set(name, t);
971
+ return true;
972
+ }
973
+ _fireTransports(pdu) {
974
+ for (const t of this._transports) t.send(pdu).catch((err) => this.fire("onTransportError", err, pdu));
975
+ }
976
+ static _nativeConsole = {
977
+ log: console.log.bind(console),
978
+ info: console.info.bind(console),
979
+ warn: console.warn.bind(console),
980
+ error: console.error.bind(console),
981
+ debug: console.debug.bind(console),
982
+ trace: console.trace.bind(console),
983
+ table: console.table.bind(console),
984
+ dir: console.dir.bind(console)
985
+ };
986
+ static _savedConsole = null;
987
+ /** Largeur fixe du champ `severityName` — couvre `WARNING` (7). */
988
+ static SEVERITY_WIDTH = 7;
989
+ /** Largeur fixe du champ `msgid` — couvre 95% des cas, déborde proprement pour les longs. */
990
+ static MSGID_WIDTH = 18;
991
+ static wrapper(pdu) {
992
+ if (!pdu) throw new Error("Syslog pdu not defined");
993
+ const d = new Date(pdu.timeStamp);
994
+ const dateStr = `${String(d.getHours()).padStart(2, "0")}:${String(d.getMinutes()).padStart(2, "0")}:${String(d.getSeconds()).padStart(2, "0")}.${String(d.getMilliseconds()).padStart(3, "0")}`;
995
+ const sev = pdu.severityName.padEnd(Syslog.SEVERITY_WIDTH);
996
+ const id = pdu.msgid.padEnd(Syslog.MSGID_WIDTH);
997
+ const msgid = green(id);
998
+ switch (pdu.severity) {
999
+ case 0:
1000
+ case 1:
1001
+ case 2:
1002
+ case 3: return {
1003
+ logger: Syslog._nativeConsole.error,
1004
+ text: `${dateStr} ${red(sev)} ${msgid} : `
1005
+ };
1006
+ case 4: return {
1007
+ logger: Syslog._nativeConsole.warn,
1008
+ text: `${dateStr} ${yellow(sev)} ${msgid} : `
1009
+ };
1010
+ case 5: return {
1011
+ logger: Syslog._nativeConsole.log,
1012
+ text: `${dateStr} ${red(sev)} ${msgid} : `
1013
+ };
1014
+ case 6: return {
1015
+ logger: Syslog._nativeConsole.info,
1016
+ text: `${dateStr} ${blue(sev)} ${msgid} : `
1017
+ };
1018
+ case 7: return {
1019
+ logger: Syslog._nativeConsole.debug,
1020
+ text: `${dateStr} ${cyan(sev)} ${msgid} : `
1021
+ };
1022
+ default: return {
1023
+ logger: Syslog._nativeConsole.log,
1024
+ text: `${dateStr} ${cyan(sev)} ${msgid} : `
1025
+ };
1026
+ }
1027
+ }
1028
+ /**
1029
+ * Transport console par défaut — formate un Pdu et l'écrit vers `process.stdout` ou
1030
+ * `process.stderr` selon sévérité (ERROR+ vers stderr).
1031
+ *
1032
+ * Format : `HH:MM:SS.mmm SEVERITY MSGID : payload` avec coloration ANSI.
1033
+ *
1034
+ * @param pdu - Pdu à imprimer.
1035
+ * @param pid - PID préfixé (vide en dev mono-process pour réduire le bruit).
1036
+ * @returns le Pdu (chaînable).
1037
+ */
1038
+ static normalizeLog(pdu, pid = "") {
1039
+ if (pdu.payload === "" || pdu.payload === void 0) {
1040
+ Syslog._nativeConsole.warn(`${pdu.severityName} ${pdu.msgid} : logger message empty !!!!`);
1041
+ Syslog._nativeConsole.trace(pdu);
1042
+ return pdu;
1043
+ }
1044
+ const message = pdu.payload;
1045
+ const wrap = Syslog.wrapper(pdu);
1046
+ const prefix = pid ? `${pid} ` : "";
1047
+ wrap.logger(`${prefix}${wrap.text}`, message);
1048
+ return pdu;
1049
+ }
1050
+ static rawLog(pdu, pid = "") {
1051
+ if (pdu.payload === "" || pdu.payload === void 0) return pdu;
1052
+ const write = pdu.severity <= 3 ? writeErr : writeOut;
1053
+ const { text } = Syslog.wrapper(pdu);
1054
+ const msg = typeof pdu.payload === "string" || typeof pdu.payload === "number" ? String(pdu.payload) : inspect(pdu.payload, {
1055
+ depth: 3,
1056
+ colors: isLogColorEnabled(),
1057
+ breakLength: Infinity
1058
+ });
1059
+ write(`${pid ? `${pid} ` : ""}${text}${msg}\n`);
1060
+ return pdu;
1061
+ }
1062
+ /**
1063
+ * Mode de bufférisation de la sortie console — **process-global** (un seul
1064
+ * `process.stdout`). Câblé par {@link Kernel.initializeLog} depuis `config.log.buffered`.
1065
+ *
1066
+ * - `"auto"` (défaut) : bufférise si stdout n'est PAS un TTY (pipe/fichier =
1067
+ * prod/collecteur → débit) ; immédiat sur TTY (dev interactif → feedback + spinner).
1068
+ * - `true` : toujours bufférisé (ex. bench dans un terminal).
1069
+ * - `false` : jamais (ex. `tail -f` non bufférisé en debug prod).
1070
+ *
1071
+ * Bufférisé = coalesce les écritures d'un même tick en 1 `write()` (1 syscall).
1072
+ * stderr (ERROR+) reste TOUJOURS immédiat. Flush les lignes en attente avant de switcher.
1073
+ *
1074
+ * @param mode - `true` | `false` | `"auto"`.
1075
+ */
1076
+ static setOutputBuffering(mode) {
1077
+ _setBufferMode(mode);
1078
+ }
1079
+ /** Vide immédiatement (synchrone) le buffer stdout en attente. Idempotent. */
1080
+ static flushOutput() {
1081
+ _flushOut();
1082
+ }
1083
+ /**
1084
+ * Bascule le DRIVER de sink (LB.W — où partent les lignes après coalescing).
1085
+ * `null` → stdout (défaut isomorphe). Câblé par {@link Kernel.initializeLog}
1086
+ * depuis `config.log.driver`. Flush + close l'ancien driver avant de switcher.
1087
+ *
1088
+ * @param sink - driver `ILogSink` (ex. `FileSink`, `NULL_LOG_SINK`) ou `null`.
1089
+ */
1090
+ static setLogSink(sink) {
1091
+ _setLogSink(sink);
1092
+ }
1093
+ /** Nom du driver de sink actif (`"stdout"` | `"null"` | `"file"` | custom). */
1094
+ static get logSinkName() {
1095
+ return _sink.name;
1096
+ }
1097
+ /** `true` si le sink texte écrit (non muté). Coupé = plus de console/fichier .log. */
1098
+ static get sinkEnabled() {
1099
+ return !_sinkMuted;
1100
+ }
1101
+ /**
1102
+ * Mute/démute le sink texte **à chaud, sans changer la config ni le driver**
1103
+ * (outil dev/diagnostic — ex. couper la console en `npx nodefony dev`). Le nom
1104
+ * du sink est préservé ; seul {@link sinkEnabled} bascule. Process-global (un seul
1105
+ * sink texte par process). Idempotent.
1106
+ *
1107
+ * @param enabled - `true` = le sink écrit ; `false` = mute (rien n'est écrit).
1108
+ * @returns `true` si l'état a changé.
1109
+ */
1110
+ static setSinkEnabled(enabled) {
1111
+ const muted = !enabled;
1112
+ if (_sinkMuted === muted) return false;
1113
+ _sinkMuted = muted;
1114
+ return true;
1115
+ }
1116
+ /**
1117
+ * Intercepte `console.log/warn/error/debug/info` → pipe vers le Syslog passé.
1118
+ *
1119
+ * **Side effect global** : modifie l'objet `console` du process. À utiliser avec parcimonie
1120
+ * (un seul appel par process). {@link restoreConsole} restaure les méthodes originales.
1121
+ *
1122
+ * @param instance - Syslog cible (recevra tous les console.* du process).
1123
+ */
1124
+ static overrideConsole(instance) {
1125
+ if (Syslog._savedConsole !== null) {
1126
+ instance.log("Syslog.overrideConsole: already active", "WARNING");
1127
+ return;
1128
+ }
1129
+ Syslog._savedConsole = {
1130
+ log: console.log.bind(console),
1131
+ info: console.info.bind(console),
1132
+ warn: console.warn.bind(console),
1133
+ error: console.error.bind(console),
1134
+ debug: console.debug.bind(console),
1135
+ trace: console.trace.bind(console),
1136
+ table: console.table.bind(console),
1137
+ dir: console.dir.bind(console)
1138
+ };
1139
+ const con = console;
1140
+ con.log = (...data) => instance.print(...data);
1141
+ con.info = (...data) => instance.logMultiple("INFO", ...data);
1142
+ con.warn = (...data) => instance.logMultiple("WARNING", ...data);
1143
+ con.error = (...data) => instance.logMultiple("ERROR", ...data);
1144
+ con.debug = (...data) => instance.logMultiple("DEBUG", ...data);
1145
+ con.table = (data) => instance.logMultiple("INFO", data);
1146
+ con.dir = (obj) => instance.logMultiple("DEBUG", obj);
1147
+ }
1148
+ /**
1149
+ * Restaure `console.log/warn/error/debug/info` à leurs valeurs originales.
1150
+ * Annule un {@link overrideConsole} précédent.
1151
+ */
1152
+ static restoreConsole() {
1153
+ if (Syslog._savedConsole === null) return;
1154
+ Object.assign(console, Syslog._savedConsole);
1155
+ Syslog._savedConsole = null;
1156
+ }
1157
+ };
1158
+ //#endregion
1159
+ export { NULL_LOG_SINK, Syslog as default };