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.
- package/.ai/symbols.json +36135 -0
- package/LICENSE +544 -0
- package/README.md +316 -694
- package/bin/nodefony +2183 -85
- package/dist/client/Container.js +367 -0
- package/dist/client/Event.js +198 -0
- package/dist/client/Service.js +344 -0
- package/dist/client/Tools.js +162 -0
- package/dist/client/client/ClientKernel.js +276 -0
- package/dist/client/client/angular/index.js +352 -0
- package/dist/client/client/announce.js +212 -0
- package/dist/client/client/debugbar/DebugBar.js +1624 -0
- package/dist/client/client/debugbar/format.js +103 -0
- package/dist/client/client/debugbar/hmr.js +37 -0
- package/dist/client/client/debugbar/index.js +29 -0
- package/dist/client/client/debugbar/model.js +133 -0
- package/dist/client/client/debugbar/network.js +173 -0
- package/dist/client/client/debugbar/profile.js +114 -0
- package/dist/client/client/index.js +34 -0
- package/dist/client/client/react/index.js +268 -0
- package/dist/client/client/realtime/AdaptiveRate.js +240 -0
- package/dist/client/client/realtime/BrowserWsTransport.js +57 -0
- package/dist/client/client/realtime/RealtimeClient.js +898 -0
- package/dist/client/client/realtime/localEvents.js +56 -0
- package/dist/client/client/realtime/notice.js +125 -0
- package/dist/client/client/realtime/observe.js +280 -0
- package/dist/client/client/roles/index.js +3 -0
- package/dist/client/client/roles/registry.js +97 -0
- package/dist/client/client/roles/roles.js +91 -0
- package/dist/client/client/shim/events.js +88 -0
- package/dist/client/client/shim/util.js +20 -0
- package/dist/client/client/svelte/index.js +319 -0
- package/dist/client/client/syslog/context.js +122 -0
- package/dist/client/client/syslog/errors.js +49 -0
- package/dist/client/client/syslog/uplink.js +106 -0
- package/dist/client/client/vue/index.js +321 -0
- package/dist/client/colors.js +63 -0
- package/dist/client/debugbar.standalone.js +4274 -0
- package/dist/client/realtime/IRealtimeTransport.js +32 -0
- package/dist/client/realtime/JsonRpcPeer.js +251 -0
- package/dist/client/realtime/channelRate.js +39 -0
- package/dist/client/realtime/platformChannels.js +155 -0
- package/dist/client/syslog/Pdu.js +224 -0
- package/dist/client/syslog/Syslog.js +1159 -0
- package/dist/client/syslog/drivers/pduFlow.js +106 -0
- package/dist/client/syslog/drivers/pduProtocol.js +28 -0
- package/dist/client/syslog/logColor.js +80 -0
- package/dist/client/types/src/Container.d.ts +221 -0
- package/dist/client/types/src/Event.d.ts +171 -0
- package/dist/client/types/src/FileClass.d.ts +184 -0
- package/dist/client/types/src/Service.d.ts +165 -0
- package/dist/client/types/src/Tools.d.ts +116 -0
- package/dist/client/types/src/client/ClientKernel.d.ts +90 -0
- package/dist/client/types/src/client/IClientKernel.d.ts +195 -0
- package/dist/client/types/src/client/angular/index.d.ts +273 -0
- package/dist/client/types/src/client/announce.d.ts +74 -0
- package/dist/client/types/src/client/debugbar/DebugBar.d.ts +279 -0
- package/dist/client/types/src/client/debugbar/format.d.ts +48 -0
- package/dist/client/types/src/client/debugbar/hmr.d.ts +16 -0
- package/dist/client/types/src/client/debugbar/index.d.ts +30 -0
- package/dist/client/types/src/client/debugbar/model.d.ts +158 -0
- package/dist/client/types/src/client/debugbar/network.d.ts +55 -0
- package/dist/client/types/src/client/debugbar/profile.d.ts +99 -0
- package/dist/client/types/src/client/index.d.ts +47 -0
- package/dist/client/types/src/client/react/index.d.ts +207 -0
- package/dist/client/types/src/client/realtime/AdaptiveRate.d.ts +138 -0
- package/dist/client/types/src/client/realtime/BrowserWsTransport.d.ts +27 -0
- package/dist/client/types/src/client/realtime/RealtimeClient.d.ts +573 -0
- package/dist/client/types/src/client/realtime/localEvents.d.ts +53 -0
- package/dist/client/types/src/client/realtime/notice.d.ts +70 -0
- package/dist/client/types/src/client/realtime/observe.d.ts +284 -0
- package/dist/client/types/src/client/roles/index.d.ts +15 -0
- package/dist/client/types/src/client/roles/registry.d.ts +72 -0
- package/dist/client/types/src/client/roles/roles.d.ts +68 -0
- package/dist/client/types/src/client/shim/cli-color.d.ts +2 -0
- package/dist/client/types/src/client/shim/events.d.ts +39 -0
- package/dist/client/types/src/client/shim/util.d.ts +14 -0
- package/dist/client/types/src/client/svelte/index.d.ts +216 -0
- package/dist/client/types/src/client/syslog/context.d.ts +76 -0
- package/dist/client/types/src/client/syslog/errors.d.ts +46 -0
- package/dist/client/types/src/client/syslog/uplink.d.ts +89 -0
- package/dist/client/types/src/client/transport/websocket.d.ts +5 -0
- package/dist/client/types/src/client/vue/index.d.ts +234 -0
- package/dist/client/types/src/colors.d.ts +32 -0
- package/dist/client/types/src/config/infra.d.ts +171 -0
- package/dist/client/types/src/kernel/bootReport.d.ts +112 -0
- package/dist/client/types/src/kernel/readinessRegistry.d.ts +104 -0
- package/dist/client/types/src/realtime/IRealtimeSocket.d.ts +142 -0
- package/dist/client/types/src/realtime/IRealtimeTransport.d.ts +50 -0
- package/dist/client/types/src/realtime/JsonRpcPeer.d.ts +251 -0
- package/dist/client/types/src/realtime/RealtimeEventMap.d.ts +269 -0
- package/dist/client/types/src/realtime/channelRate.d.ts +55 -0
- package/dist/client/types/src/realtime/platformChannels.d.ts +147 -0
- package/dist/client/types/src/syslog/Pdu.d.ts +134 -0
- package/dist/client/types/src/syslog/Syslog.d.ts +482 -0
- package/dist/client/types/src/syslog/drivers/ILogDriver.d.ts +177 -0
- package/dist/client/types/src/syslog/drivers/pduFlow.d.ts +53 -0
- package/dist/client/types/src/syslog/drivers/pduProtocol.d.ts +20 -0
- package/dist/client/types/src/syslog/logColor.d.ts +59 -0
- package/dist/client/types/src/types/ICliKernel.d.ts +28 -0
- package/dist/client/types/src/types/ICommand.d.ts +14 -0
- package/dist/client/types/src/types/IContainer.d.ts +35 -0
- package/dist/client/types/src/types/IKernel.d.ts +138 -0
- package/dist/client/types/src/types/IMcpTool.d.ts +157 -0
- package/dist/client/types/src/types/IModule.d.ts +73 -0
- package/dist/client/types/src/types/IPage.d.ts +119 -0
- package/dist/client/types/src/types/IService.d.ts +62 -0
- package/dist/client/types/src/types/ISyslog.d.ts +58 -0
- package/dist/client/types/src/types/ITransport.d.ts +5 -0
- package/dist/client/types/src/types/globals.d.ts +47 -0
- package/dist/node/Cli.js +750 -0
- package/dist/node/Container.js +367 -0
- package/dist/node/Error.js +309 -0
- package/dist/node/Event.js +198 -0
- package/dist/node/FileClass.js +308 -0
- package/dist/node/Nodefony.js +78 -0
- package/dist/node/Service.js +344 -0
- package/dist/node/Tools.js +205 -0
- package/dist/node/bin/resolveLocalCli.js +10 -0
- package/dist/node/bundler/index.js +103 -0
- package/dist/node/cli/agentTargets.js +461 -0
- package/dist/node/cli/aiMcp.js +553 -0
- package/dist/node/cli/aiMcpReport.js +129 -0
- package/dist/node/cli/aiSync.js +323 -0
- package/dist/node/cli/aiSyncReport.js +142 -0
- package/dist/node/cli/card.js +186 -0
- package/dist/node/cli/cardReport.js +110 -0
- package/dist/node/cli/completion.js +415 -0
- package/dist/node/cli/create.js +805 -0
- package/dist/node/cli/env.js +332 -0
- package/dist/node/cli/envReport.js +159 -0
- package/dist/node/cli/execPortable.js +60 -0
- package/dist/node/cli/gitHooks.js +191 -0
- package/dist/node/cli/gitHooksReport.js +119 -0
- package/dist/node/cli/globalFlags.js +67 -0
- package/dist/node/cli/helpReport.js +288 -0
- package/dist/node/cli/manPage.js +165 -0
- package/dist/node/cli/nodefonyBin.js +61 -0
- package/dist/node/cli/outdated.js +144 -0
- package/dist/node/cli/progress.js +555 -0
- package/dist/node/cli/projectRoot.js +32 -0
- package/dist/node/cli/promptPassword.js +44 -0
- package/dist/node/cli/prompts.js +86 -0
- package/dist/node/cli/scaffold/destination.js +92 -0
- package/dist/node/cli/scaffold/engine.js +2156 -0
- package/dist/node/cli/scaffold/entityFields.js +589 -0
- package/dist/node/cli/scaffold/format.js +243 -0
- package/dist/node/cli/scaffold/interactive.js +124 -0
- package/dist/node/cli/scaffold/moduleLayout.js +38 -0
- package/dist/node/cli/scaffold/reservedEntities.js +74 -0
- package/dist/node/cli/scaffold/spec.js +704 -0
- package/dist/node/cli/scaffold/steps.js +40 -0
- package/dist/node/cli/scaffold/userContractSource.js +133 -0
- package/dist/node/cli/scaffold/versions.js +57 -0
- package/dist/node/cli/scaffold/writer.js +172 -0
- package/dist/node/cli/startMenu.js +496 -0
- package/dist/node/cli/symbols.js +205 -0
- package/dist/node/cli/sysexits.js +34 -0
- package/dist/node/cli/tableReport.js +184 -0
- package/dist/node/cli/usageReport.js +144 -0
- package/dist/node/colors.js +63 -0
- package/dist/node/command/Builder.js +153 -0
- package/dist/node/command/Command.js +348 -0
- package/dist/node/config/configProvenance.js +101 -0
- package/dist/node/config/defaults.js +39 -0
- package/dist/node/config/defineConfig.js +129 -0
- package/dist/node/config/defineEnv.js +264 -0
- package/dist/node/config/envExample.js +41 -0
- package/dist/node/config/envOverride.js +423 -0
- package/dist/node/config/infra.js +163 -0
- package/dist/node/config/reactivity.js +23 -0
- package/dist/node/config/reservedEnv.js +118 -0
- package/dist/node/config/schema.js +134 -0
- package/dist/node/config/use.js +24 -0
- package/dist/node/finder/File.js +49 -0
- package/dist/node/finder/FileResult.js +86 -0
- package/dist/node/finder/Finder.js +201 -0
- package/dist/node/finder/Result.js +45 -0
- package/dist/node/index.js +121 -0
- package/dist/node/kernel/BootConfigurationError.js +54 -0
- package/dist/node/kernel/CliKernel.js +630 -0
- package/dist/node/kernel/Kernel.js +2198 -0
- package/dist/node/kernel/Module.js +453 -0
- package/dist/node/kernel/adminPlane/adminCaller.js +98 -0
- package/dist/node/kernel/adminPlane/adminRbac.js +51 -0
- package/dist/node/kernel/adminPlane/catalog.js +158 -0
- package/dist/node/kernel/adminPlane/executeAdmin.js +78 -0
- package/dist/node/kernel/checks/deep.js +335 -0
- package/dist/node/kernel/checks/freshness.js +139 -0
- package/dist/node/kernel/checks/gating.js +231 -0
- package/dist/node/kernel/checks/guards.js +232 -0
- package/dist/node/kernel/checks/lastBoot.js +136 -0
- package/dist/node/kernel/checks/live.js +330 -0
- package/dist/node/kernel/checks/packageDeps.js +292 -0
- package/dist/node/kernel/checks/readiness.js +153 -0
- package/dist/node/kernel/checks/renderReport.js +780 -0
- package/dist/node/kernel/checks/report.js +421 -0
- package/dist/node/kernel/checks/runDoctor.js +731 -0
- package/dist/node/kernel/checks/surface.js +364 -0
- package/dist/node/kernel/checks/walk.js +100 -0
- package/dist/node/kernel/checks/wiring.js +450 -0
- package/dist/node/kernel/commands/AiMcpCommand.js +65 -0
- package/dist/node/kernel/commands/AiSyncCommand.js +48 -0
- package/dist/node/kernel/commands/BuildCommand.js +49 -0
- package/dist/node/kernel/commands/CardCommand.js +50 -0
- package/dist/node/kernel/commands/ClusterCommand.js +58 -0
- package/dist/node/kernel/commands/CompletionCommand.js +31 -0
- package/dist/node/kernel/commands/CreateCommand.js +45 -0
- package/dist/node/kernel/commands/DevCommand.js +99 -0
- package/dist/node/kernel/commands/DoctorCommand.js +115 -0
- package/dist/node/kernel/commands/EnvCommand.js +52 -0
- package/dist/node/kernel/commands/GitHooksCommand.js +47 -0
- package/dist/node/kernel/commands/InspectCommand.js +153 -0
- package/dist/node/kernel/commands/InstallCommand.js +20 -0
- package/dist/node/kernel/commands/MenuCommand.js +261 -0
- package/dist/node/kernel/commands/OutdatedCommand.js +164 -0
- package/dist/node/kernel/commands/ProdCommand.js +60 -0
- package/dist/node/kernel/commands/StatusCommand.js +30 -0
- package/dist/node/kernel/commands/StopCommand.js +35 -0
- package/dist/node/kernel/commands/SymbolsCommand.js +45 -0
- package/dist/node/kernel/commands/runtimeLauncher.js +95 -0
- package/dist/node/kernel/decorators/kernelDecorator.js +110 -0
- package/dist/node/kernel/injector/injector.js +137 -0
- package/dist/node/kernel/injector/serviceOrder.js +106 -0
- package/dist/node/kernel/inspect/adminSubjects.js +194 -0
- package/dist/node/kernel/inspect/docOutline.js +86 -0
- package/dist/node/kernel/lifecycleTags.js +76 -0
- package/dist/node/kernel/moduleConfig.js +75 -0
- package/dist/node/kernel/moduleGating.js +68 -0
- package/dist/node/kernel/readinessRegistry.js +98 -0
- package/dist/node/kernel/resolveModuleEntry.js +61 -0
- package/dist/node/mcp/caller.js +40 -0
- package/dist/node/mcp/guard.js +51 -0
- package/dist/node/mcp/protocol.js +157 -0
- package/dist/node/mcp/server.js +216 -0
- package/dist/node/mcp/tools.js +861 -0
- package/dist/node/oauth/authorizationServer.js +221 -0
- package/dist/node/oauth/protectedResource.js +293 -0
- package/dist/node/package.js +4 -0
- package/dist/node/realtime/IRealtimeTransport.js +32 -0
- package/dist/node/realtime/JsonRpcPeer.js +251 -0
- package/dist/node/realtime/RealtimeEventMap.js +15 -0
- package/dist/node/realtime/channelRate.js +39 -0
- package/dist/node/realtime/platformChannels.js +155 -0
- package/dist/node/runtime/GcScheduler.js +92 -0
- package/dist/node/runtime/RequestContext.js +76 -0
- package/dist/node/runtime/bearer.js +84 -0
- package/dist/node/runtime/engineEnvironment.js +79 -0
- package/dist/node/runtime/loadEnv.js +105 -0
- package/dist/node/runtime/pageFacets.js +85 -0
- package/dist/node/runtime/pageFilters.js +103 -0
- package/dist/node/runtime/pageGuard.js +84 -0
- package/dist/node/runtime/pageQuery.js +160 -0
- package/dist/node/runtime/pageSort.js +114 -0
- package/dist/node/runtime/redact.js +43 -0
- package/dist/node/runtime/withTimeout.js +71 -0
- package/dist/node/service/cluster/ClusterManager.js +202 -0
- package/dist/node/service/cluster/ClusterProbeAggregator.js +120 -0
- package/dist/node/service/cluster/ClusterRelay.js +74 -0
- package/dist/node/service/cluster/clusterMaster.js +65 -0
- package/dist/node/service/cluster/clusterMessage.js +70 -0
- package/dist/node/service/cluster/cpuQuota.js +59 -0
- package/dist/node/service/cluster/instanceProbe.js +52 -0
- package/dist/node/service/cluster/podEnvironment.js +48 -0
- package/dist/node/service/cluster/processProbe.js +70 -0
- package/dist/node/service/cluster/richProcessProbe.js +115 -0
- package/dist/node/service/cluster/topology.js +71 -0
- package/dist/node/service/dev/BootReporter.js +490 -0
- package/dist/node/service/dev/DevSupervisor.js +1004 -0
- package/dist/node/service/dev/bootVerdict.js +158 -0
- package/dist/node/service/dev/detachedStart.js +372 -0
- package/dist/node/service/dev/devProcess.js +1137 -0
- package/dist/node/service/dev/devProjects.js +138 -0
- package/dist/node/service/dev/devStatusReport.js +395 -0
- package/dist/node/service/dev/devStop.js +263 -0
- package/dist/node/service/fetchService.js +35 -0
- package/dist/node/service/gitService.js +62 -0
- package/dist/node/syslog/Pdu.js +224 -0
- package/dist/node/syslog/Syslog.js +1159 -0
- package/dist/node/syslog/drivers/ClusterFileLogDriver.js +114 -0
- package/dist/node/syslog/drivers/FileLogDriver.js +127 -0
- package/dist/node/syslog/drivers/ILogDriver.js +26 -0
- package/dist/node/syslog/drivers/LokiLogDriver.js +144 -0
- package/dist/node/syslog/drivers/MemoryLogDriver.js +33 -0
- package/dist/node/syslog/drivers/OpenSearchLogDriver.js +159 -0
- package/dist/node/syslog/drivers/builtinLogDrivers.js +114 -0
- package/dist/node/syslog/drivers/filterPdus.js +71 -0
- package/dist/node/syslog/drivers/logDriverRegistry.js +83 -0
- package/dist/node/syslog/drivers/opensearchShared.js +17 -0
- package/dist/node/syslog/drivers/pduFlow.js +106 -0
- package/dist/node/syslog/drivers/pduProtocol.js +28 -0
- package/dist/node/syslog/httpFetch.js +43 -0
- package/dist/node/syslog/logColor.js +80 -0
- package/dist/node/syslog/sinks/FileSink.js +142 -0
- package/dist/node/syslog/transports/BatchingHttpTransport.js +98 -0
- package/dist/node/syslog/transports/ConsoleTransport.js +14 -0
- package/dist/node/syslog/transports/FileTransport.js +17 -0
- package/dist/node/syslog/transports/HttpTransport.js +44 -0
- package/dist/node/syslog/transports/LokiTransport.js +80 -0
- package/dist/node/syslog/transports/OpenSearchTransport.js +53 -0
- package/dist/node/syslog/transports/SyslogTransport.js +13 -0
- package/dist/node/syslog/transports/index.js +8 -0
- package/dist/node/testing/index.js +190 -0
- package/dist/types/Cli.d.ts +177 -0
- package/dist/types/Container.d.ts +221 -0
- package/dist/types/Error.d.ts +162 -0
- package/dist/types/Event.d.ts +171 -0
- package/dist/types/FileClass.d.ts +184 -0
- package/dist/types/Nodefony.d.ts +66 -0
- package/dist/types/Service.d.ts +165 -0
- package/dist/types/Tools.d.ts +116 -0
- package/dist/types/bin/resolveLocalCli.d.ts +49 -0
- package/dist/types/bundler/index.d.ts +66 -0
- package/dist/types/cli/agentTargets.d.ts +378 -0
- package/dist/types/cli/aiMcp.d.ts +239 -0
- package/dist/types/cli/aiMcpReport.d.ts +113 -0
- package/dist/types/cli/aiSync.d.ts +68 -0
- package/dist/types/cli/aiSyncReport.d.ts +149 -0
- package/dist/types/cli/card.d.ts +49 -0
- package/dist/types/cli/cardReport.d.ts +127 -0
- package/dist/types/cli/completion.d.ts +154 -0
- package/dist/types/cli/create.d.ts +177 -0
- package/dist/types/cli/env.d.ts +103 -0
- package/dist/types/cli/envReport.d.ts +153 -0
- package/dist/types/cli/execPortable.d.ts +54 -0
- package/dist/types/cli/gitHooks.d.ts +48 -0
- package/dist/types/cli/gitHooksReport.d.ts +101 -0
- package/dist/types/cli/globalFlags.d.ts +48 -0
- package/dist/types/cli/helpReport.d.ts +110 -0
- package/dist/types/cli/manPage.d.ts +21 -0
- package/dist/types/cli/nodefonyBin.d.ts +45 -0
- package/dist/types/cli/outdated.d.ts +119 -0
- package/dist/types/cli/progress.d.ts +349 -0
- package/dist/types/cli/projectRoot.d.ts +19 -0
- package/dist/types/cli/promptPassword.d.ts +22 -0
- package/dist/types/cli/prompts.d.ts +102 -0
- package/dist/types/cli/scaffold/destination.d.ts +70 -0
- package/dist/types/cli/scaffold/engine.d.ts +545 -0
- package/dist/types/cli/scaffold/entityFields.d.ts +238 -0
- package/dist/types/cli/scaffold/format.d.ts +78 -0
- package/dist/types/cli/scaffold/interactive.d.ts +11 -0
- package/dist/types/cli/scaffold/moduleLayout.d.ts +69 -0
- package/dist/types/cli/scaffold/reservedEntities.d.ts +49 -0
- package/dist/types/cli/scaffold/spec.d.ts +159 -0
- package/dist/types/cli/scaffold/steps.d.ts +24 -0
- package/dist/types/cli/scaffold/userContractSource.d.ts +86 -0
- package/dist/types/cli/scaffold/versions.d.ts +14 -0
- package/dist/types/cli/scaffold/writer.d.ts +100 -0
- package/dist/types/cli/startMenu.d.ts +195 -0
- package/dist/types/cli/symbols.d.ts +84 -0
- package/dist/types/cli/sysexits.d.ts +31 -0
- package/dist/types/cli/tableReport.d.ts +44 -0
- package/dist/types/cli/usageReport.d.ts +108 -0
- package/dist/types/client/ClientKernel.d.ts +90 -0
- package/dist/types/client/IClientKernel.d.ts +195 -0
- package/dist/types/client/angular/index.d.ts +273 -0
- package/dist/types/client/announce.d.ts +74 -0
- package/dist/types/client/debugbar/DebugBar.d.ts +279 -0
- package/dist/types/client/debugbar/format.d.ts +48 -0
- package/dist/types/client/debugbar/hmr.d.ts +16 -0
- package/dist/types/client/debugbar/index.d.ts +30 -0
- package/dist/types/client/debugbar/model.d.ts +158 -0
- package/dist/types/client/debugbar/network.d.ts +55 -0
- package/dist/types/client/debugbar/profile.d.ts +99 -0
- package/dist/types/client/index.d.ts +47 -0
- package/dist/types/client/react/index.d.ts +207 -0
- package/dist/types/client/realtime/AdaptiveRate.d.ts +138 -0
- package/dist/types/client/realtime/BrowserWsTransport.d.ts +27 -0
- package/dist/types/client/realtime/RealtimeClient.d.ts +573 -0
- package/dist/types/client/realtime/localEvents.d.ts +53 -0
- package/dist/types/client/realtime/notice.d.ts +70 -0
- package/dist/types/client/realtime/observe.d.ts +284 -0
- package/dist/types/client/roles/index.d.ts +15 -0
- package/dist/types/client/roles/registry.d.ts +72 -0
- package/dist/types/client/roles/roles.d.ts +68 -0
- package/dist/types/client/shim/cli-color.d.ts +2 -0
- package/dist/types/client/shim/events.d.ts +39 -0
- package/dist/types/client/shim/util.d.ts +14 -0
- package/dist/types/client/svelte/index.d.ts +216 -0
- package/dist/types/client/syslog/context.d.ts +76 -0
- package/dist/types/client/syslog/errors.d.ts +46 -0
- package/dist/types/client/syslog/uplink.d.ts +89 -0
- package/dist/types/client/transport/websocket.d.ts +5 -0
- package/dist/types/client/vue/index.d.ts +234 -0
- package/dist/types/colors.d.ts +32 -0
- package/dist/types/command/Builder.d.ts +47 -0
- package/dist/types/command/Command.d.ts +268 -0
- package/dist/types/config/configMeta.d.ts +53 -0
- package/dist/types/config/configProvenance.d.ts +58 -0
- package/dist/types/config/defaults.d.ts +33 -0
- package/dist/types/config/defineConfig.d.ts +70 -0
- package/dist/types/config/defineEnv.d.ts +170 -0
- package/dist/types/config/envExample.d.ts +23 -0
- package/dist/types/config/envOverride.d.ts +236 -0
- package/dist/types/config/index.d.ts +23 -0
- package/dist/types/config/infra.d.ts +171 -0
- package/dist/types/config/reactivity.d.ts +36 -0
- package/dist/types/config/reservedEnv.d.ts +145 -0
- package/dist/types/config/schema.d.ts +113 -0
- package/dist/types/config/types.d.ts +374 -0
- package/dist/types/config/use.d.ts +80 -0
- package/dist/types/finder/File.d.ts +26 -0
- package/dist/types/finder/FileResult.d.ts +14 -0
- package/dist/types/finder/Finder.d.ts +51 -0
- package/dist/types/finder/Result.d.ts +10 -0
- package/dist/types/index.d.ts +205 -0
- package/dist/types/kernel/BootConfigurationError.d.ts +50 -0
- package/dist/types/kernel/CliKernel.d.ts +289 -0
- package/dist/types/kernel/Kernel.d.ts +1255 -0
- package/dist/types/kernel/Module.d.ts +326 -0
- package/dist/types/kernel/adminPlane/adminCaller.d.ts +105 -0
- package/dist/types/kernel/adminPlane/adminRbac.d.ts +44 -0
- package/dist/types/kernel/adminPlane/catalog.d.ts +122 -0
- package/dist/types/kernel/adminPlane/executeAdmin.d.ts +99 -0
- package/dist/types/kernel/bootReport.d.ts +112 -0
- package/dist/types/kernel/checks/deep.d.ts +122 -0
- package/dist/types/kernel/checks/freshness.d.ts +49 -0
- package/dist/types/kernel/checks/gating.d.ts +134 -0
- package/dist/types/kernel/checks/guards.d.ts +57 -0
- package/dist/types/kernel/checks/lastBoot.d.ts +189 -0
- package/dist/types/kernel/checks/live.d.ts +110 -0
- package/dist/types/kernel/checks/packageDeps.d.ts +44 -0
- package/dist/types/kernel/checks/readiness.d.ts +97 -0
- package/dist/types/kernel/checks/renderReport.d.ts +107 -0
- package/dist/types/kernel/checks/report.d.ts +414 -0
- package/dist/types/kernel/checks/runDoctor.d.ts +361 -0
- package/dist/types/kernel/checks/surface.d.ts +148 -0
- package/dist/types/kernel/checks/walk.d.ts +45 -0
- package/dist/types/kernel/checks/wiring.d.ts +54 -0
- package/dist/types/kernel/commands/AiMcpCommand.d.ts +39 -0
- package/dist/types/kernel/commands/AiSyncCommand.d.ts +28 -0
- package/dist/types/kernel/commands/BuildCommand.d.ts +13 -0
- package/dist/types/kernel/commands/CardCommand.d.ts +34 -0
- package/dist/types/kernel/commands/ClusterCommand.d.ts +29 -0
- package/dist/types/kernel/commands/CompletionCommand.d.ts +17 -0
- package/dist/types/kernel/commands/CreateCommand.d.ts +16 -0
- package/dist/types/kernel/commands/DevCommand.d.ts +40 -0
- package/dist/types/kernel/commands/DoctorCommand.d.ts +55 -0
- package/dist/types/kernel/commands/EnvCommand.d.ts +35 -0
- package/dist/types/kernel/commands/GitHooksCommand.d.ts +27 -0
- package/dist/types/kernel/commands/InspectCommand.d.ts +59 -0
- package/dist/types/kernel/commands/InstallCommand.d.ts +7 -0
- package/dist/types/kernel/commands/MenuCommand.d.ts +58 -0
- package/dist/types/kernel/commands/OutdatedCommand.d.ts +47 -0
- package/dist/types/kernel/commands/ProdCommand.d.ts +29 -0
- package/dist/types/kernel/commands/StatusCommand.d.ts +17 -0
- package/dist/types/kernel/commands/StopCommand.d.ts +17 -0
- package/dist/types/kernel/commands/SymbolsCommand.d.ts +29 -0
- package/dist/types/kernel/commands/runtimeLauncher.d.ts +76 -0
- package/dist/types/kernel/decorators/kernelDecorator.d.ts +76 -0
- package/dist/types/kernel/injector/injector.d.ts +47 -0
- package/dist/types/kernel/injector/serviceOrder.d.ts +29 -0
- package/dist/types/kernel/inspect/adminSubjects.d.ts +169 -0
- package/dist/types/kernel/inspect/docOutline.d.ts +53 -0
- package/dist/types/kernel/lifecycleTags.d.ts +79 -0
- package/dist/types/kernel/moduleConfig.d.ts +35 -0
- package/dist/types/kernel/moduleGating.d.ts +78 -0
- package/dist/types/kernel/readinessRegistry.d.ts +104 -0
- package/dist/types/kernel/resolveModuleEntry.d.ts +46 -0
- package/dist/types/mcp/caller.d.ts +55 -0
- package/dist/types/mcp/guard.d.ts +66 -0
- package/dist/types/mcp/protocol.d.ts +163 -0
- package/dist/types/mcp/server.d.ts +70 -0
- package/dist/types/mcp/tools.d.ts +209 -0
- package/dist/types/oauth/authorizationServer.d.ts +204 -0
- package/dist/types/oauth/protectedResource.d.ts +339 -0
- package/dist/types/realtime/IRealtimeSocket.d.ts +142 -0
- package/dist/types/realtime/IRealtimeTransport.d.ts +50 -0
- package/dist/types/realtime/JsonRpcPeer.d.ts +251 -0
- package/dist/types/realtime/RealtimeEventMap.d.ts +269 -0
- package/dist/types/realtime/channelRate.d.ts +55 -0
- package/dist/types/realtime/platformChannels.d.ts +147 -0
- package/dist/types/runtime/GcScheduler.d.ts +96 -0
- package/dist/types/runtime/RequestContext.d.ts +152 -0
- package/dist/types/runtime/bearer.d.ts +88 -0
- package/dist/types/runtime/engineEnvironment.d.ts +115 -0
- package/dist/types/runtime/loadEnv.d.ts +86 -0
- package/dist/types/runtime/pageFacets.d.ts +104 -0
- package/dist/types/runtime/pageFilters.d.ts +139 -0
- package/dist/types/runtime/pageGuard.d.ts +78 -0
- package/dist/types/runtime/pageQuery.d.ts +138 -0
- package/dist/types/runtime/pageSort.d.ts +86 -0
- package/dist/types/runtime/redact.d.ts +27 -0
- package/dist/types/runtime/withTimeout.d.ts +51 -0
- package/dist/types/service/cluster/ClusterManager.d.ts +112 -0
- package/dist/types/service/cluster/ClusterProbeAggregator.d.ts +68 -0
- package/dist/types/service/cluster/ClusterRelay.d.ts +57 -0
- package/dist/types/service/cluster/clusterMaster.d.ts +40 -0
- package/dist/types/service/cluster/clusterMessage.d.ts +94 -0
- package/dist/types/service/cluster/cpuQuota.d.ts +37 -0
- package/dist/types/service/cluster/instanceProbe.d.ts +82 -0
- package/dist/types/service/cluster/podEnvironment.d.ts +35 -0
- package/dist/types/service/cluster/processProbe.d.ts +53 -0
- package/dist/types/service/cluster/richProcessProbe.d.ts +77 -0
- package/dist/types/service/cluster/topology.d.ts +64 -0
- package/dist/types/service/dev/BootReporter.d.ts +67 -0
- package/dist/types/service/dev/DevSupervisor.d.ts +117 -0
- package/dist/types/service/dev/bootVerdict.d.ts +99 -0
- package/dist/types/service/dev/detachedStart.d.ts +164 -0
- package/dist/types/service/dev/devProcess.d.ts +638 -0
- package/dist/types/service/dev/devProjects.d.ts +121 -0
- package/dist/types/service/dev/devStatusReport.d.ts +141 -0
- package/dist/types/service/dev/devStop.d.ts +57 -0
- package/dist/types/service/fetchService.d.ts +29 -0
- package/dist/types/service/gitService.d.ts +24 -0
- package/dist/types/syslog/Pdu.d.ts +134 -0
- package/dist/types/syslog/Syslog.d.ts +482 -0
- package/dist/types/syslog/drivers/ClusterFileLogDriver.d.ts +40 -0
- package/dist/types/syslog/drivers/FileLogDriver.d.ts +55 -0
- package/dist/types/syslog/drivers/ILogDriver.d.ts +177 -0
- package/dist/types/syslog/drivers/LokiLogDriver.d.ts +44 -0
- package/dist/types/syslog/drivers/MemoryLogDriver.d.ts +20 -0
- package/dist/types/syslog/drivers/OpenSearchLogDriver.d.ts +40 -0
- package/dist/types/syslog/drivers/builtinLogDrivers.d.ts +43 -0
- package/dist/types/syslog/drivers/filterPdus.d.ts +21 -0
- package/dist/types/syslog/drivers/logDriverRegistry.d.ts +100 -0
- package/dist/types/syslog/drivers/opensearchShared.d.ts +11 -0
- package/dist/types/syslog/drivers/pduFlow.d.ts +53 -0
- package/dist/types/syslog/drivers/pduProtocol.d.ts +20 -0
- package/dist/types/syslog/httpFetch.d.ts +48 -0
- package/dist/types/syslog/logColor.d.ts +59 -0
- package/dist/types/syslog/sinks/FileSink.d.ts +78 -0
- package/dist/types/syslog/transports/BatchingHttpTransport.d.ts +59 -0
- package/dist/types/syslog/transports/ConsoleTransport.d.ts +8 -0
- package/dist/types/syslog/transports/FileTransport.d.ts +13 -0
- package/dist/types/syslog/transports/HttpTransport.d.ts +15 -0
- package/dist/types/syslog/transports/LokiTransport.d.ts +45 -0
- package/dist/types/syslog/transports/OpenSearchTransport.d.ts +40 -0
- package/dist/types/syslog/transports/SyslogTransport.d.ts +9 -0
- package/dist/types/syslog/transports/index.d.ts +12 -0
- package/dist/types/testing/index.d.ts +197 -0
- package/dist/types/types/IAdminApi.d.ts +246 -0
- package/dist/types/types/ICliKernel.d.ts +28 -0
- package/dist/types/types/ICommand.d.ts +14 -0
- package/dist/types/types/IContainer.d.ts +35 -0
- package/dist/types/types/IIdempotencyStore.d.ts +159 -0
- package/dist/types/types/IKernel.d.ts +138 -0
- package/dist/types/types/IMcpTool.d.ts +157 -0
- package/dist/types/types/IModule.d.ts +73 -0
- package/dist/types/types/IModuleManifest.d.ts +49 -0
- package/dist/types/types/IPage.d.ts +119 -0
- package/dist/types/types/IService.d.ts +62 -0
- package/dist/types/types/ISyslog.d.ts +58 -0
- package/dist/types/types/ITransport.d.ts +5 -0
- package/dist/types/types/globals.d.ts +47 -0
- package/docs/angular-services.md +318 -0
- package/docs/catalogue.md +184 -0
- package/docs/cli.md +369 -0
- package/docs/client.md +616 -0
- package/docs/debugbar.md +218 -0
- package/docs/environnement.md +308 -0
- package/docs/index.md +388 -0
- package/docs/kernel.md +670 -0
- package/docs/progression.md +228 -0
- package/docs/react-hooks.md +686 -0
- package/docs/request-context.md +507 -0
- package/docs/service.md +590 -0
- package/docs/svelte-reactivite.md +293 -0
- package/docs/syslog.md +848 -0
- package/docs/testing.md +203 -0
- package/docs/vue-composables.md +255 -0
- package/man/nodefony.1 +152 -0
- package/package.json +163 -83
- package/templates/app/agents/AGENTS.md.tpl +967 -0
- package/templates/app/agents/POINTEUR.md.tpl +12 -0
- package/templates/app/base/Dockerfile.tpl +104 -0
- package/templates/app/base/README.md.tpl +314 -0
- package/templates/app/base/dockerignore.tpl +28 -0
- package/templates/app/base/env.ts.tpl +130 -0
- package/templates/app/base/gitattributes.tpl +28 -0
- package/templates/app/base/github/workflows/ci.yml.tpl +91 -0
- package/templates/app/base/gitignore.tpl +46 -0
- package/templates/app/base/gitlab-ci.yml.tpl +42 -0
- package/templates/app/base/index.ts.tpl +69 -0
- package/templates/app/base/nodefony.config.ts.tpl +342 -0
- package/templates/app/base/oxlintrc.json.tpl +127 -0
- package/templates/app/base/package.json.tpl +75 -0
- package/templates/app/base/prettierignore.tpl +24 -0
- package/templates/app/base/prettierrc.json.tpl +12 -0
- package/templates/app/base/rolldown.config.ts.tpl +8 -0
- package/templates/app/base/tests/config.test.ts.tpl +29 -0
- package/templates/app/base/tests/e2e.setup.ts.tpl +181 -0
- package/templates/app/base/tests/e2e.test.ts.tpl +105 -0
- package/templates/app/base/tests/migrations.e2e.test.ts.tpl +579 -0
- package/templates/app/base/tsconfig.json.tpl +47 -0
- package/templates/app/base/vitest.config.ts.tpl +88 -0
- package/templates/app/base/vitest.e2e.config.ts.tpl +39 -0
- package/templates/app/complete/compose.yaml.tpl +328 -0
- package/templates/app/complete/deploy/migrate-job.yaml.tpl +100 -0
- package/templates/app/complete/docker/db/init-nodefony-e2e.sql.tpl +30 -0
- package/templates/app/complete/docker/grafana/provisioning/datasources/loki.yaml.tpl +15 -0
- package/templates/app/complete/env.local.tpl +11 -0
- package/templates/app/complete/env.tpl +53 -0
- package/templates/app/complete/nodefony/entity/User.ts.tpl +69 -0
- package/templates/app/complete/nodefony/security/provisionUsers.ts.tpl +124 -0
- package/templates/app/complete/nodefony/service/AppBannerService.ts.tpl +98 -0
- package/templates/app/complete/nodefony/service/AppInfoService.ts.tpl +85 -0
- package/templates/app/frontend/angular/frontend/src/accent.css.tpl +34 -0
- package/templates/app/frontend/angular/frontend/src/app/app.component.ts.tpl +400 -0
- package/templates/app/frontend/react/frontend/src/App.tsx.tpl +421 -0
- package/templates/app/frontend/react/frontend/src/accent.css.tpl +30 -0
- package/templates/app/frontend/shared/frontend/src/brand.ts.tpl +3 -0
- package/templates/app/frontend/shared/frontend/src/showcase.css.tpl +224 -0
- package/templates/app/frontend/shared/nodefony/controllers/AppController.ts.tpl +45 -0
- package/templates/app/frontend/svelte/frontend/src/App.svelte.tpl +371 -0
- package/templates/app/frontend/svelte/frontend/src/accent.css.tpl +34 -0
- package/templates/app/frontend/vue/frontend/src/App.vue.tpl +367 -0
- package/templates/app/frontend/vue/frontend/src/accent.css.tpl +34 -0
- package/templates/app/home/nodefony/controllers/HomeController.ts.tpl +38 -0
- package/templates/command/nodefony/command/__NAME__.ts.tpl +132 -0
- package/templates/controller/duplex/nodefony/controllers/__NAME__.ts.tpl +188 -0
- package/templates/controller/example/nodefony/controllers/__NAME__.ts.tpl +348 -0
- package/templates/controller/hello/nodefony/controllers/__NAME__.ts.tpl +143 -0
- package/templates/controller/realtime/nodefony/controllers/__NAME__.ts.tpl +153 -0
- package/templates/controller/realtime/tests/__KEBAB__-realtime.test.ts.tpl +79 -0
- package/templates/controller/rest/nodefony/controllers/__NAME__.ts.tpl +159 -0
- package/templates/entity/base/nodefony/entity/__PASCAL__.schema.ts.tpl +31 -0
- package/templates/entity/base/nodefony/entity/__PASCAL__.ts.tpl +68 -0
- package/templates/entity/controller/nodefony/controllers/__PASCAL__Controller.ts.tpl +335 -0
- package/templates/entity/service/nodefony/service/__PASCAL__Service.ts.tpl +126 -0
- package/templates/entity/tests/tests/__KEBAB__.e2e.test.ts.tpl +358 -0
- package/templates/entity/tests/tests/__KEBAB__.test.ts.tpl +87 -0
- package/templates/front/angular/frontend/src/app/app.component.ts.tpl +30 -0
- package/templates/front/base/nodefony/controllers/__NAME__.ts.tpl +60 -0
- package/templates/front/react/frontend/src/App.tsx.tpl +26 -0
- package/templates/front/svelte/frontend/src/App.svelte.tpl +19 -0
- package/templates/front/vue/frontend/src/App.vue.tpl +23 -0
- package/templates/module/ai/AGENTS.md.tpl +71 -0
- package/templates/module/base/README.md.tpl +62 -0
- package/templates/module/base/docs/index.md.tpl +55 -0
- package/templates/module/base/index.ts.tpl +50 -0
- package/templates/module/base/nodefony/config/config.ts.tpl +60 -0
- package/templates/module/base/nodefony/config/defineModuleConfig.ts.tpl +55 -0
- package/templates/module/base/nodefony/src/errors/__PASCAL__Error.ts.tpl +20 -0
- package/templates/module/base/package.json.tpl +53 -0
- package/templates/module/base/rolldown.config.ts.tpl +14 -0
- package/templates/module/base/tests/__KEBAB__.test.ts.tpl +39 -0
- package/templates/module/base/tsconfig.json.tpl +42 -0
- package/templates/module/base/vitest.config.ts.tpl +27 -0
- package/templates/module/packages/CLAUDE.md.tpl +51 -0
- package/templates/module/packages/MEMORY.md.tpl +39 -0
- package/templates/module/packages/tsconfig.declarations.json.tpl +19 -0
- package/templates/module/packages/tsconfig.tests.json.tpl +11 -0
- package/templates/module/service/nodefony/interfaces/I__PASCAL__Service.ts.tpl +14 -0
- package/templates/module/service/nodefony/interfaces/index.ts.tpl +1 -0
- package/templates/module/service/nodefony/service/__PASCAL__Service.ts.tpl +116 -0
- package/templates/service/nodefony/interfaces/I__PASCAL__Service.ts.tpl +19 -0
- package/templates/service/nodefony/service/__PASCAL__Service.ts.tpl +136 -0
- package/templates/service/tests/__PASCAL__Service.test.ts.tpl +53 -0
- package/templates/shared/front-entry/angular/frontend/src/main.ts.tpl +17 -0
- package/templates/shared/front-entry/react/frontend/src/main.tsx.tpl +11 -0
- package/templates/shared/front-entry/svelte/frontend/src/main.ts.tpl +13 -0
- package/templates/shared/front-entry/vue/frontend/src/main.ts.tpl +12 -0
- package/templates/shared/front-registrar/nodefony/frontend/register__PASCAL__Entry.ts.tpl +40 -0
- package/templates/shared/front-shell/frontend/index.html.tpl +39 -0
- package/templates/shared/ng-app-tsconfig/frontend/tsconfig.app.json.tpl +18 -0
- package/templates/shared/svelte-shim/frontend/src/env.d.ts.tpl +12 -0
- package/templates/shared/vue-shim/frontend/src/env.d.ts.tpl +15 -0
- package/.yarnclean +0 -45
- package/CHANGELOG.md +0 -406
- package/autoloader.es6 +0 -253
- package/builder.es6 +0 -366
- package/cli/builder/bundles/bundle.js +0 -328
- package/cli/builder/bundles/controller.js +0 -73
- package/cli/builder/bundles/users-bundle/.yarnclean +0 -45
- package/cli/builder/bundles/users-bundle/Command/fixtureTask.js +0 -47
- package/cli/builder/bundles/users-bundle/Command/usersCommand.js +0 -105
- package/cli/builder/bundles/users-bundle/Entity/mongoose/userEntity.js +0 -168
- package/cli/builder/bundles/users-bundle/Entity/sequelize/userEntity.js +0 -231
- package/cli/builder/bundles/users-bundle/Fixtures/users.js +0 -117
- package/cli/builder/bundles/users-bundle/Fixtures/usersFixtures.js +0 -114
- package/cli/builder/bundles/users-bundle/Resources/config/config.js +0 -90
- package/cli/builder/bundles/users-bundle/Resources/config/routing.js +0 -17
- package/cli/builder/bundles/users-bundle/Resources/config/security.js +0 -96
- package/cli/builder/bundles/users-bundle/Resources/config/services.js +0 -7
- package/cli/builder/bundles/users-bundle/Resources/config/webpack/webpack.dev.config.js +0 -13
- package/cli/builder/bundles/users-bundle/Resources/config/webpack/webpack.prod.config.js +0 -31
- package/cli/builder/bundles/users-bundle/Resources/config/webpack.config.js +0 -146
- package/cli/builder/bundles/users-bundle/Resources/js/users.js +0 -153
- package/cli/builder/bundles/users-bundle/Resources/public/favicon.ico +0 -0
- package/cli/builder/bundles/users-bundle/Resources/public/images/users-logo.png +0 -0
- package/cli/builder/bundles/users-bundle/Resources/scss/awesome/font-awesome.config.js +0 -11
- package/cli/builder/bundles/users-bundle/Resources/scss/custom.scss +0 -23
- package/cli/builder/bundles/users-bundle/Resources/scss/users.scss +0 -59
- package/cli/builder/bundles/users-bundle/Resources/swagger/openapi/login.js +0 -235
- package/cli/builder/bundles/users-bundle/Resources/swagger/openapi/users.js +0 -232
- package/cli/builder/bundles/users-bundle/Resources/translations/login.en_en.yml +0 -14
- package/cli/builder/bundles/users-bundle/Resources/translations/login.fr_fr.yml +0 -14
- package/cli/builder/bundles/users-bundle/Resources/translations/users.en_en.yml +0 -35
- package/cli/builder/bundles/users-bundle/Resources/translations/users.fr_fr.yml +0 -36
- package/cli/builder/bundles/users-bundle/Resources/views/base.html.twig +0 -32
- package/cli/builder/bundles/users-bundle/Resources/views/footer.html.twig +0 -7
- package/cli/builder/bundles/users-bundle/Resources/views/header.html.twig +0 -90
- package/cli/builder/bundles/users-bundle/Resources/views/login/login.html.twig +0 -43
- package/cli/builder/bundles/users-bundle/Resources/views/users/createUser.html.twig +0 -296
- package/cli/builder/bundles/users-bundle/Resources/views/users/readUsers.html.twig +0 -94
- package/cli/builder/bundles/users-bundle/controller/api/graphql/graphqlController.js +0 -56
- package/cli/builder/bundles/users-bundle/controller/api/graphql/userResolver.js +0 -121
- package/cli/builder/bundles/users-bundle/controller/api/graphql/usertype.js +0 -58
- package/cli/builder/bundles/users-bundle/controller/api/openapi/loginApiController.js +0 -210
- package/cli/builder/bundles/users-bundle/controller/api/openapi/restUserController.js +0 -244
- package/cli/builder/bundles/users-bundle/controller/loginController.js +0 -91
- package/cli/builder/bundles/users-bundle/controller/usersController.js +0 -332
- package/cli/builder/bundles/users-bundle/package.json +0 -58
- package/cli/builder/bundles/users-bundle/readme.md +0 -360
- package/cli/builder/bundles/users-bundle/services/usersService.js +0 -411
- package/cli/builder/bundles/users-bundle/src/providers/mongoose/userProvider.js +0 -47
- package/cli/builder/bundles/users-bundle/src/providers/sequelize/userProvider.js +0 -48
- package/cli/builder/bundles/users-bundle/tests/loginTest.js +0 -182
- package/cli/builder/bundles/users-bundle/usersBundle.js +0 -26
- package/cli/builder/microService/microService.js +0 -261
- package/cli/builder/microService/skeletons/.editorconfig +0 -18
- package/cli/builder/microService/skeletons/.env-cmdrc.js +0 -32
- package/cli/builder/microService/skeletons/.jshintrc +0 -37
- package/cli/builder/microService/skeletons/README.md +0 -117
- package/cli/builder/microService/skeletons/bin/bash/hello.sh +0 -5
- package/cli/builder/microService/skeletons/bin/cli +0 -13
- package/cli/builder/microService/skeletons/bin/python/hello.py +0 -20
- package/cli/builder/microService/skeletons/config/config.js +0 -29
- package/cli/builder/microService/skeletons/config/pm2.config.js +0 -72
- package/cli/builder/microService/skeletons/config/webpack/webpack.config.dev.js +0 -8
- package/cli/builder/microService/skeletons/config/webpack/webpack.config.prod.js +0 -25
- package/cli/builder/microService/skeletons/config/webpack.config.js +0 -114
- package/cli/builder/microService/skeletons/package.json +0 -76
- package/cli/builder/microService/skeletons/src/browser/index.css +0 -3
- package/cli/builder/microService/skeletons/src/browser/index.js +0 -16
- package/cli/builder/microService/skeletons/src/browser/socketio.js +0 -46
- package/cli/builder/microService/skeletons/src/cli/cli.js +0 -224
- package/cli/builder/microService/skeletons/src/cli/menu.js +0 -28
- package/cli/builder/microService/skeletons/src/n-api/README.md +0 -1
- package/cli/builder/microService/skeletons/src/n-api/binding.gyp +0 -14
- package/cli/builder/microService/skeletons/src/n-api/hello.cc +0 -14
- package/cli/builder/microService/skeletons/src/n-api/hello.js +0 -23
- package/cli/builder/microService/skeletons/src/n-api/package.json +0 -15
- package/cli/builder/microService/skeletons/src/node/examples/index.js +0 -120
- package/cli/builder/microService/skeletons/src/node/index.js +0 -102
- package/cli/builder/microService/skeletons/src/node/services/markdown/markdown.js +0 -27
- package/cli/builder/microService/skeletons/src/node/services/servers/http.js +0 -45
- package/cli/builder/microService/skeletons/src/node/services/servers/https.js +0 -44
- package/cli/builder/microService/skeletons/src/node/services/socketio/socketio.js +0 -46
- package/cli/builder/microService/skeletons/src/node/services/syscall/syscall.js +0 -111
- package/cli/builder/microService/skeletons/src/node/services/worker/thread.js +0 -59
- package/cli/builder/microService/skeletons/src/node/services/worker/worker.js +0 -60
- package/cli/builder/microService/skeletons/src/templates/base.html +0 -12
- package/cli/builder/microService/skeletons/src/templates/socket.html +0 -23
- package/cli/builder/microService/skeletons/tests/unit/serviceTest.js +0 -30
- package/cli/builder/project/project.js +0 -474
- package/cli/builder/project/skeletons/README.md +0 -778
- package/cli/builder/project/skeletons/bin/dev-deploy.sh +0 -5
- package/cli/builder/project/skeletons/bin/generateCertificates.sh.skeleton +0 -180
- package/cli/builder/project/skeletons/bin/prod-deploy.sh +0 -3
- package/cli/builder/project/skeletons/config/config.js.skeleton +0 -178
- package/cli/builder/project/skeletons/config/openssl/ca/openssl.cnf.skeleton +0 -150
- package/cli/builder/project/skeletons/config/openssl/ca_intermediate/openssl.cnf.skeleton +0 -152
- package/cli/builder/project/skeletons/config/pm2.config.js.skeleton +0 -62
- package/cli/builder/project/skeletons/documentation.html.twig +0 -24
- package/cli/builder/project/skeletons/editorconfig.skeleton +0 -18
- package/cli/builder/project/skeletons/eslintignore.skeleton +0 -15
- package/cli/builder/project/skeletons/eslintrc.js.skeleton +0 -97
- package/cli/builder/project/skeletons/gitignore.skeleton +0 -32
- package/cli/builder/project/skeletons/migrations/2022.12.25T17.37.37.entity-user.js +0 -137
- package/cli/builder/project/skeletons/migrations/2022.12.25T17.37.38.entity-session.js +0 -97
- package/cli/builder/project/skeletons/migrations/2022.12.25T17.37.39.entity-requests.js +0 -115
- package/cli/builder/project/skeletons/migrations/2022.12.25T17.37.40.entity-jwts.js +0 -97
- package/cli/builder/project/skeletons/migrations/migrations.skeleton.js +0 -101
- package/cli/builder/project/skeletons/package.json.twig +0 -71
- package/cli/builder/react/reactBuilder.js +0 -224
- package/cli/builder/react/skeletons/app/Resources/databases/nodefony.db +0 -0
- package/cli/builder/react/skeletons/app/Resources/translations/messages.en_en.yml +0 -5
- package/cli/builder/react/skeletons/app/Resources/translations/messages.fr_fr.yml +0 -5
- package/cli/builder/react/skeletons/app/Resources/views/base.html.twig +0 -33
- package/cli/builder/react/skeletons/app/config/config.js +0 -392
- package/cli/builder/react/skeletons/app/config/routing.js +0 -10
- package/cli/builder/react/skeletons/app/config/security.js +0 -74
- package/cli/builder/react/skeletons/app/controller/appController.js +0 -22
- package/cli/builder/sandbox/sandBoxBuilder.js +0 -610
- package/cli/builder/sandbox/skeletons/Resources/css/entry.css +0 -48
- package/cli/builder/sandbox/skeletons/Resources/js/entry.js +0 -60
- package/cli/builder/sandbox/skeletons/Resources/public/manifest.json +0 -32
- package/cli/builder/sandbox/skeletons/Resources/translations/messages.en_en.yml +0 -5
- package/cli/builder/sandbox/skeletons/Resources/translations/messages.fr_fr.yml +0 -5
- package/cli/builder/sandbox/skeletons/Resources/views/base.html.twig +0 -46
- package/cli/builder/sandbox/skeletons/Resources/views/index.html.twig +0 -34
- package/cli/builder/sandbox/skeletons/bootstrap/custom.scss +0 -27
- package/cli/builder/sandbox/skeletons/bootstrap/entry.scss +0 -60
- package/cli/builder/sandbox/skeletons/workbox/templates/index.html.twig +0 -32
- package/cli/builder/sandbox/skeletons/workbox/workers/service-worker.js +0 -196
- package/cli/builder/skeletons/Resources/public/favicon.ico +0 -0
- package/cli/builder/skeletons/Resources/public/images/app-logo.png +0 -0
- package/cli/builder/skeletons/Resources/views/framework-bundle/views/401.html.twig +0 -1
- package/cli/builder/skeletons/Resources/views/framework-bundle/views/401.json.twig +0 -24
- package/cli/builder/skeletons/Resources/views/framework-bundle/views/403.html.twig +0 -1
- package/cli/builder/skeletons/Resources/views/framework-bundle/views/403.json.twig +0 -20
- package/cli/builder/skeletons/Resources/views/framework-bundle/views/404.html.twig +0 -1
- package/cli/builder/skeletons/Resources/views/framework-bundle/views/404.json.twig +0 -20
- package/cli/builder/skeletons/Resources/views/framework-bundle/views/500.html.twig +0 -1
- package/cli/builder/skeletons/Resources/views/framework-bundle/views/base.html.twig +0 -30
- package/cli/builder/skeletons/Resources/views/framework-bundle/views/exception.html.twig +0 -1
- package/cli/builder/skeletons/Resources/views/framework-bundle/views/exception.json.twig +0 -24
- package/cli/builder/skeletons/Resources/views/framework-bundle/views/footer.html.twig +0 -33
- package/cli/builder/skeletons/Resources/views/framework-bundle/views/header.html.twig +0 -6
- package/cli/builder/skeletons/Resources/views/framework-bundle/views/index.html.twig +0 -6
- package/cli/builder/skeletons/Resources/views/framework-bundle/views/index.json.twig +0 -1
- package/cli/builder/skeletons/Resources/views/framework-bundle/views/layout.html.twig +0 -125
- package/cli/builder/skeletons/Resources/views/framework-bundle/views/layout.json.twig +0 -5
- package/cli/builder/skeletons/Resources/views/framework-bundle/views/timeout.html.twig +0 -1
- package/cli/builder/skeletons/Resources/views/framework-bundle/views/timeout.json.twig +0 -24
- package/cli/builder/skeletons/app/appKernel.js +0 -133
- package/cli/builder/skeletons/binding/binding.cc +0 -26
- package/cli/builder/skeletons/binding/binding.skeleton +0 -8
- package/cli/builder/skeletons/bundle/bundleClass.js +0 -37
- package/cli/builder/skeletons/command/commandClass.js +0 -11
- package/cli/builder/skeletons/command/taskClass.js +0 -20
- package/cli/builder/skeletons/config/config.js +0 -138
- package/cli/builder/skeletons/config/nodefony/elastic-bundle.js +0 -37
- package/cli/builder/skeletons/config/nodefony/framework-bundle.js +0 -22
- package/cli/builder/skeletons/config/nodefony/http-bundle.js +0 -104
- package/cli/builder/skeletons/config/nodefony/mail-bundle.js +0 -44
- package/cli/builder/skeletons/config/nodefony/mongoose-bundle.js +0 -51
- package/cli/builder/skeletons/config/nodefony/monitoring-bundle.js +0 -34
- package/cli/builder/skeletons/config/nodefony/realtime-bundle.js +0 -15
- package/cli/builder/skeletons/config/nodefony/redis-bundle.js +0 -44
- package/cli/builder/skeletons/config/nodefony/security-bundle.js +0 -25
- package/cli/builder/skeletons/config/nodefony/sequelize-bundle.js +0 -156
- package/cli/builder/skeletons/config/routing.js +0 -55
- package/cli/builder/skeletons/config/security.js +0 -102
- package/cli/builder/skeletons/config/services.js +0 -1
- package/cli/builder/skeletons/config/webpack/webpack.dev.config.js +0 -13
- package/cli/builder/skeletons/config/webpack/webpack.prod.config.js +0 -20
- package/cli/builder/skeletons/config/webpack.config.js +0 -148
- package/cli/builder/skeletons/controller/controllerClass.js +0 -75
- package/cli/builder/skeletons/package.json.twig +0 -57
- package/cli/builder/skeletons/unittest/testFile.js +0 -46
- package/cli/builder/vue/skeletons/Resources/public/images/app-logo.png +0 -0
- package/cli/builder/vue/skeletons/Resources/translations/messages.en_en.yml +0 -5
- package/cli/builder/vue/skeletons/Resources/translations/messages.fr_fr.yml +0 -5
- package/cli/builder/vue/skeletons/vue.config.js +0 -129
- package/cli/builder/vue/vueBuilder.js +0 -410
- package/cli/generate/generate.es6 +0 -103
- package/cli/install/install.js +0 -190
- package/cli/sequelize/sequelize.js +0 -94
- package/cli/start.js +0 -702
- package/cli/tools/pm2.es6 +0 -112
- package/cli/tools/tools.es6 +0 -97
- package/cli.es6 +0 -925
- package/container.es6 +0 -272
- package/error.es6 +0 -293
- package/fileClass.es6 +0 -242
- package/finder/file.es6 +0 -33
- package/finder/fileResult.es6 +0 -138
- package/finder/finder2.es6 +0 -275
- package/finder.es6 +0 -427
- package/kernel/annotations/annotations.es6 +0 -286
- package/kernel/api/api.es6 +0 -61
- package/kernel/api/graphqlApi.es6 +0 -107
- package/kernel/api/jsonApi.es6 +0 -177
- package/kernel/api/openApi.es6 +0 -139
- package/kernel/api/schemas/openApiSchema.js +0 -394
- package/kernel/babylon.es6 +0 -162
- package/kernel/bundle.es6 +0 -1200
- package/kernel/cliKernel.es6 +0 -869
- package/kernel/command.es6 +0 -78
- package/kernel/commands/nodefonyCommand.es6 +0 -247
- package/kernel/commands/tasks/bundlesTask.es6 +0 -59
- package/kernel/controllers/controller.es6 +0 -791
- package/kernel/fixture.es6 +0 -19
- package/kernel/injections/injections.es6 +0 -424
- package/kernel/kernel.es6 +0 -1960
- package/kernel/kernelWatcher.es6 +0 -387
- package/kernel/orm/entity.es6 +0 -59
- package/kernel/orm/orm.es6 +0 -139
- package/kernel/reader.es6 +0 -290
- package/kernel/security/encoder.es6 +0 -17
- package/kernel/security/factories/factory.es6 +0 -111
- package/kernel/security/factories/passeportFactory.es6 +0 -61
- package/kernel/security/provider.es6 +0 -58
- package/kernel/security/providers/chainProvider.es6 +0 -99
- package/kernel/security/providers/memoryProvider.es6 +0 -55
- package/kernel/security/providers/providerManager.es6 +0 -67
- package/kernel/security/providers/userEntityProvider.es6 +0 -50
- package/kernel/security/role.es6 +0 -12
- package/kernel/security/secureArea.es6 +0 -431
- package/kernel/security/tokens/token.es6 +0 -171
- package/kernel/security/user.es6 +0 -106
- package/kernel/serviceRealTime.es6 +0 -21
- package/kernel/services/connectionsService.es6 +0 -93
- package/kernel/services/cron/cronService.es6 +0 -123
- package/kernel/task.es6 +0 -80
- package/kernel/templates.es6 +0 -22
- package/kernel/templating/twig.es6 +0 -218
- package/kernel/tests/cliTest.js +0 -59
- package/kernel/tests/containerTest.js +0 -232
- package/kernel/tests/kernelTest.js +0 -39
- package/nodefony.es6 +0 -1084
- package/notificationsCenter.es6 +0 -118
- package/protocol.es6 +0 -86
- package/protocols/bayeux.es6 +0 -174
- package/protocols/jsonRpc/jsonrpc.es6 +0 -56
- package/result.es6 +0 -99
- package/service.es6 +0 -288
- package/syslog/pdu.es6 +0 -141
- package/syslog/syslog.es6 +0 -754
- package/watcher.es6 +0 -113
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { filterPdus } from "./filterPdus.js";
|
|
2
|
+
import { scanJsonlTail } from "./FileLogDriver.js";
|
|
3
|
+
import { join } from "node:path";
|
|
4
|
+
import { readdir, stat } from "node:fs/promises";
|
|
5
|
+
//#region src/syslog/drivers/ClusterFileLogDriver.ts
|
|
6
|
+
/** Préfixe des fichiers JSONL par worker (cf `Kernel.initializeLog`). */
|
|
7
|
+
const DEFAULT_PREFIX = "nodefony-";
|
|
8
|
+
/** Suffixe des fichiers JSONL queryables. */
|
|
9
|
+
const DEFAULT_SUFFIX = ".jsonl";
|
|
10
|
+
/**
|
|
11
|
+
* Plafond du NOMBRE de fichiers scannés par query (garde-fou anti-OOM). Le coût
|
|
12
|
+
* mémoire d'une query = `maxFiles × maxScanBytes` au pire → borné explicitement.
|
|
13
|
+
* Au-delà, on garde les `maxFiles` fichiers les plus RÉCENTS (mtime) — un cluster
|
|
14
|
+
* sain a ≤ N workers (≈ cœurs), ce plafond ne mord qu'en cas de logs orphelins
|
|
15
|
+
* (workers morts non nettoyés) ou d'un dossier pollué.
|
|
16
|
+
*/
|
|
17
|
+
const DEFAULT_MAX_FILES = 64;
|
|
18
|
+
/**
|
|
19
|
+
* Driver `cluster-file` du Log Backplane (LB.5) — **vue cluster unifiée** des
|
|
20
|
+
* logs. En cluster, chaque worker écrit SON propre `nodefony-<pid>.jsonl` (fd par
|
|
21
|
+
* worker = pas de lock d'inode partagé, cf LB.W) → une `query` sur le driver
|
|
22
|
+
* `file` (LB.2) ne voit que le fichier du worker courant. Ce driver **globbe le
|
|
23
|
+
* dossier** : il scanne tous les `nodefony-*.jsonl`, fusionne leurs Pdu et les
|
|
24
|
+
* trie chronologiquement pour reconstituer le flux de logs de TOUT le cluster.
|
|
25
|
+
*
|
|
26
|
+
* La `query` est un chemin **FROID** (admin/debug), `async`, **JAMAIS** dans le
|
|
27
|
+
* pipeline requête. Anti-OOM à deux niveaux : `maxScanBytes` borne la lecture par
|
|
28
|
+
* fichier (à la queue, les logs récents) et `maxFiles` borne le nombre de fichiers
|
|
29
|
+
* (les plus récents par mtime si dépassement). Chaque fichier est réhydraté par
|
|
30
|
+
* la brique partagée {@link scanJsonlTail} (même format/robustesse que le driver
|
|
31
|
+
* `file`), puis le filtrage final délègue à {@link filterPdus} — une logique, N
|
|
32
|
+
* façades.
|
|
33
|
+
*
|
|
34
|
+
* **Tri inter-worker** : l'`uid` d'un Pdu est un compteur monotone PAR PROCESS →
|
|
35
|
+
* il N'EST PAS comparable entre workers (chaque process repart de zéro). La fusion
|
|
36
|
+
* trie donc par `timeStamp` (epoch ms, horloge partagée), puis départage par `pid`
|
|
37
|
+
* (groupe stable par worker) et enfin par `uid` (chronologie exacte INTRA-worker,
|
|
38
|
+
* y compris à `timeStamp` égal). À `timeStamp` égal entre deux workers, l'ordre
|
|
39
|
+
* relatif est indéterminable (pas de séquence globale) mais reste **stable**.
|
|
40
|
+
*
|
|
41
|
+
* @param options - dossier + motif des fichiers + plafonds anti-OOM.
|
|
42
|
+
* @returns un `ILogDriver` `cluster-file` queryable (Node-only).
|
|
43
|
+
*/
|
|
44
|
+
function createClusterFileLogDriver(options) {
|
|
45
|
+
const dir = options.dir;
|
|
46
|
+
const prefix = options.prefix ?? DEFAULT_PREFIX;
|
|
47
|
+
const suffix = options.suffix ?? DEFAULT_SUFFIX;
|
|
48
|
+
const maxScanBytes = options.maxScanBytes ?? 8388608;
|
|
49
|
+
const maxFiles = options.maxFiles ?? DEFAULT_MAX_FILES;
|
|
50
|
+
return {
|
|
51
|
+
name: "cluster-file",
|
|
52
|
+
capabilities: {
|
|
53
|
+
write: true,
|
|
54
|
+
query: true,
|
|
55
|
+
stream: false
|
|
56
|
+
},
|
|
57
|
+
query: async (criteria) => {
|
|
58
|
+
const files = await listLogFiles(dir, prefix, suffix, maxFiles);
|
|
59
|
+
if (files.length === 0) return {
|
|
60
|
+
rows: [],
|
|
61
|
+
total: 0,
|
|
62
|
+
truncated: false
|
|
63
|
+
};
|
|
64
|
+
const perFile = await Promise.all(files.map((f) => scanJsonlTail(f, maxScanBytes)));
|
|
65
|
+
const merged = [];
|
|
66
|
+
for (const records of perFile) for (const rec of records) merged.push(rec);
|
|
67
|
+
merged.sort(byChrono);
|
|
68
|
+
return filterPdus(merged, criteria);
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Liste les fichiers de logs du dossier qui matchent `prefix`/`suffix`, bornée à
|
|
74
|
+
* `maxFiles` (les plus récents par mtime si dépassement). Dossier absent/illisible
|
|
75
|
+
* → tableau vide (un viewer ne crashe jamais).
|
|
76
|
+
*/
|
|
77
|
+
async function listLogFiles(dir, prefix, suffix, maxFiles) {
|
|
78
|
+
let names;
|
|
79
|
+
try {
|
|
80
|
+
names = await readdir(dir);
|
|
81
|
+
} catch {
|
|
82
|
+
return [];
|
|
83
|
+
}
|
|
84
|
+
const matches = names.filter((n) => n.startsWith(prefix) && n.endsWith(suffix));
|
|
85
|
+
if (matches.length <= maxFiles) return matches.map((n) => join(dir, n));
|
|
86
|
+
const withMtime = await Promise.all(matches.map(async (n) => {
|
|
87
|
+
const full = join(dir, n);
|
|
88
|
+
try {
|
|
89
|
+
return {
|
|
90
|
+
full,
|
|
91
|
+
mtime: (await stat(full)).mtimeMs
|
|
92
|
+
};
|
|
93
|
+
} catch {
|
|
94
|
+
return {
|
|
95
|
+
full,
|
|
96
|
+
mtime: 0
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
}));
|
|
100
|
+
withMtime.sort((a, b) => b.mtime - a.mtime);
|
|
101
|
+
return withMtime.slice(0, maxFiles).map((e) => e.full);
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Comparateur chronologique inter-worker (ordre ANCIEN → RÉCENT). `timeStamp`
|
|
105
|
+
* (epoch ms partagé) prime ; à égalité, `pid` groupe par worker puis `uid` rétablit
|
|
106
|
+
* la chronologie exacte intra-worker (compteur monotone par process).
|
|
107
|
+
*/
|
|
108
|
+
function byChrono(a, b) {
|
|
109
|
+
if (a.timeStamp !== b.timeStamp) return a.timeStamp - b.timeStamp;
|
|
110
|
+
if (a.pid !== b.pid) return a.pid - b.pid;
|
|
111
|
+
return a.uid - b.uid;
|
|
112
|
+
}
|
|
113
|
+
//#endregion
|
|
114
|
+
export { createClusterFileLogDriver };
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import { filterPdus } from "./filterPdus.js";
|
|
2
|
+
import { open } from "node:fs/promises";
|
|
3
|
+
//#region src/syslog/drivers/FileLogDriver.ts
|
|
4
|
+
/** Octets max relus depuis la FIN du fichier à chaque query (anti-OOM). Défaut 8 MiB. */
|
|
5
|
+
const DEFAULT_MAX_SCAN_BYTES = 8388608;
|
|
6
|
+
/**
|
|
7
|
+
* Driver `file` du Log Backplane (LB.2) — destination de logs **JSONL queryable**
|
|
8
|
+
* (persistante, dev/VPS). Chaque ligne est un Pdu sérialisé en forme wire plate
|
|
9
|
+
* (`JSON.stringify`), produit côté WRITE par un transport file `format:"json"` ;
|
|
10
|
+
* ce format plat est aussi celui qu'ingèrent Promtail (Loki) / Filebeat (OpenSearch)
|
|
11
|
+
* sans transformation → le driver file est le tremplin testable vers les drivers
|
|
12
|
+
* prod (LB.4).
|
|
13
|
+
*
|
|
14
|
+
* La `query` RELIT le fichier — chemin **FROID** (admin/debug), `async`, **JAMAIS**
|
|
15
|
+
* dans le pipeline requête. Elle borne la lecture aux derniers `maxScanBytes` octets
|
|
16
|
+
* (anti-OOM), réhydrate chaque ligne en {@link IPduLike} (SANS instancier un `Pdu`,
|
|
17
|
+
* donc 0 effet de bord uid/provider), puis délègue le filtrage à {@link filterPdus}
|
|
18
|
+
* (même logique que le driver `memory` — une logique, N façades).
|
|
19
|
+
*
|
|
20
|
+
* Robustesse : fichier absent / illisible → résultat vide (un viewer ne doit pas
|
|
21
|
+
* crasher) ; lignes vides ou JSON corrompu (write tronqué par un crash) → ignorées.
|
|
22
|
+
*
|
|
23
|
+
* @param options - chemin du JSONL + plafond de scan optionnel.
|
|
24
|
+
* @returns un `ILogDriver` `file` queryable (Node-only).
|
|
25
|
+
*/
|
|
26
|
+
function createFileLogDriver(options) {
|
|
27
|
+
const path = options.path;
|
|
28
|
+
const maxScanBytes = options.maxScanBytes ?? 8388608;
|
|
29
|
+
return {
|
|
30
|
+
name: "file",
|
|
31
|
+
capabilities: {
|
|
32
|
+
write: true,
|
|
33
|
+
query: true,
|
|
34
|
+
stream: false
|
|
35
|
+
},
|
|
36
|
+
query: async (criteria) => {
|
|
37
|
+
const records = await scanJsonlTail(path, maxScanBytes);
|
|
38
|
+
return filterPdus(records, criteria);
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Relit la QUEUE d'un fichier JSONL (bornée à `maxScanBytes` octets depuis la
|
|
44
|
+
* FIN, anti-OOM) et la réhydrate en {@link IPduLike}[] — SANS instancier de
|
|
45
|
+
* `Pdu` (0 effet de bord uid/provider). Brique de scan **PARTAGÉE** par le
|
|
46
|
+
* driver `file` (LB.2, un seul fichier) et le driver `cluster-file` (LB.5, qui
|
|
47
|
+
* scanne les `nodefony-<pid>.jsonl` de tous les workers). Fichier absent /
|
|
48
|
+
* illisible → tableau vide (jamais throw). Lignes vides ou JSON corrompu (write
|
|
49
|
+
* tronqué par un crash) → ignorées.
|
|
50
|
+
*
|
|
51
|
+
* @param path - chemin du fichier JSONL.
|
|
52
|
+
* @param maxScanBytes - plafond d'octets relus depuis la fin du fichier.
|
|
53
|
+
* @returns enregistrements dans l'ordre du fichier (FIFO, ancien → récent).
|
|
54
|
+
*/
|
|
55
|
+
async function scanJsonlTail(path, maxScanBytes) {
|
|
56
|
+
const text = await readTail(path, maxScanBytes);
|
|
57
|
+
if (text.length === 0) return [];
|
|
58
|
+
const records = [];
|
|
59
|
+
for (const line of text.split("\n")) {
|
|
60
|
+
if (line.length === 0) continue;
|
|
61
|
+
const rec = parseLine(line);
|
|
62
|
+
if (rec) records.push(rec);
|
|
63
|
+
}
|
|
64
|
+
return records;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Lit les derniers `maxBytes` octets du fichier (borne anti-OOM). Si le fichier
|
|
68
|
+
* dépasse, on jette le 1ᵉʳ fragment de ligne partielle (lecture démarrée au milieu
|
|
69
|
+
* d'une ligne). Fichier absent / illisible → string vide (jamais throw côté query).
|
|
70
|
+
*/
|
|
71
|
+
async function readTail(path, maxBytes) {
|
|
72
|
+
let opened;
|
|
73
|
+
try {
|
|
74
|
+
opened = await open(path, "r");
|
|
75
|
+
} catch {
|
|
76
|
+
return "";
|
|
77
|
+
}
|
|
78
|
+
await using fh = opened;
|
|
79
|
+
const { size } = await fh.stat();
|
|
80
|
+
if (size === 0) return "";
|
|
81
|
+
const start = size > maxBytes ? size - maxBytes : 0;
|
|
82
|
+
const length = size - start;
|
|
83
|
+
const buf = Buffer.allocUnsafe(length);
|
|
84
|
+
await fh.read(buf, 0, length, start);
|
|
85
|
+
let text = buf.toString("utf8");
|
|
86
|
+
if (start > 0) {
|
|
87
|
+
const nl = text.indexOf("\n");
|
|
88
|
+
text = nl === -1 ? "" : text.slice(nl + 1);
|
|
89
|
+
}
|
|
90
|
+
return text;
|
|
91
|
+
}
|
|
92
|
+
/** Parse une ligne JSONL en {@link IPduLike}, ou `null` si corrompue / non-Pdu. */
|
|
93
|
+
function parseLine(line) {
|
|
94
|
+
let raw;
|
|
95
|
+
try {
|
|
96
|
+
raw = JSON.parse(line);
|
|
97
|
+
} catch {
|
|
98
|
+
return null;
|
|
99
|
+
}
|
|
100
|
+
return coerceRecord(raw);
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Narrowing SÛR d'un objet JSON relu (entrée externe = disque) vers {@link IPduLike}.
|
|
104
|
+
* Rejette ce qui n'est pas un enregistrement de log (les 3 champs discriminants
|
|
105
|
+
* `severityName`/`moduleName`/`timeStamp` manquent ou de mauvais type) ; complète
|
|
106
|
+
* les champs accessoires avec des défauts sûrs. 0 `any`, 0 instanciation de Pdu.
|
|
107
|
+
*/
|
|
108
|
+
function coerceRecord(raw) {
|
|
109
|
+
if (typeof raw !== "object" || raw === null) return null;
|
|
110
|
+
const o = raw;
|
|
111
|
+
if (typeof o.severityName !== "string" || typeof o.moduleName !== "string" || typeof o.timeStamp !== "number") return null;
|
|
112
|
+
const rec = {
|
|
113
|
+
uid: typeof o.uid === "number" ? o.uid : 0,
|
|
114
|
+
severity: typeof o.severity === "number" ? o.severity : 7,
|
|
115
|
+
severityName: o.severityName,
|
|
116
|
+
moduleName: o.moduleName,
|
|
117
|
+
msgid: typeof o.msgid === "string" ? o.msgid : "",
|
|
118
|
+
msg: typeof o.msg === "string" ? o.msg : "",
|
|
119
|
+
timeStamp: o.timeStamp,
|
|
120
|
+
pid: typeof o.pid === "number" ? o.pid : 0,
|
|
121
|
+
payload: o.payload
|
|
122
|
+
};
|
|
123
|
+
if (typeof o.requestId === "string") rec.requestId = o.requestId;
|
|
124
|
+
return rec;
|
|
125
|
+
}
|
|
126
|
+
//#endregion
|
|
127
|
+
export { DEFAULT_MAX_SCAN_BYTES, coerceRecord, createFileLogDriver, scanJsonlTail };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
//#region src/syslog/drivers/ILogDriver.ts
|
|
2
|
+
/**
|
|
3
|
+
* Sérialise un Pdu en {@link ILogRecord} (forme wire). Source unique de la
|
|
4
|
+
* projection Pdu→wire : réutilisée par {@link filterPdus} (driver memory) ET par
|
|
5
|
+
* le producteur data-plane `syslog` (framework) — pas de shape dupliqué qui dérive.
|
|
6
|
+
*
|
|
7
|
+
* @param pdu - Pdu (instance ou objet structurellement compatible — {@link IPduLike}).
|
|
8
|
+
* @returns enregistrement plat sérialisable. `requestId` omis si absent.
|
|
9
|
+
*/
|
|
10
|
+
function pduToRecord(pdu) {
|
|
11
|
+
const rec = {
|
|
12
|
+
uid: pdu.uid,
|
|
13
|
+
severity: pdu.severity,
|
|
14
|
+
severityName: pdu.severityName,
|
|
15
|
+
moduleName: pdu.moduleName,
|
|
16
|
+
msgid: pdu.msgid,
|
|
17
|
+
msg: pdu.msg,
|
|
18
|
+
timeStamp: pdu.timeStamp,
|
|
19
|
+
pid: pdu.pid,
|
|
20
|
+
payload: pdu.payload
|
|
21
|
+
};
|
|
22
|
+
if (pdu.requestId !== void 0) rec.requestId = pdu.requestId;
|
|
23
|
+
return rec;
|
|
24
|
+
}
|
|
25
|
+
//#endregion
|
|
26
|
+
export { pduToRecord };
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import { escapeRegExp, stripTrailingSlashes } from "../../Tools.js";
|
|
2
|
+
import { fetchWithTimeout, resolveFetch } from "../httpFetch.js";
|
|
3
|
+
import { filterPdus } from "./filterPdus.js";
|
|
4
|
+
import { coerceRecord } from "./FileLogDriver.js";
|
|
5
|
+
//#region src/syslog/drivers/LokiLogDriver.ts
|
|
6
|
+
/** Échappe une chaîne pour une string literal LogQL `"..."` (Go-style). */
|
|
7
|
+
function escapeLogQLString(s) {
|
|
8
|
+
return s.replace(/\\/g, "\\\\").replace(/"/g, "\\\"");
|
|
9
|
+
}
|
|
10
|
+
/** Échappe les métacaractères regex (pour un line filter `|~`). */
|
|
11
|
+
const escapeRegex = escapeRegExp;
|
|
12
|
+
/**
|
|
13
|
+
* Extrait les lignes de log d'une réponse `query_range` Loki (`data.result[].values[][1]`),
|
|
14
|
+
* en narrowing SÛR (réponse réseau = entrée externe, 0 `any`).
|
|
15
|
+
*/
|
|
16
|
+
function extractLokiLines(json) {
|
|
17
|
+
if (typeof json !== "object" || json === null) return [];
|
|
18
|
+
const data = json.data;
|
|
19
|
+
if (typeof data !== "object" || data === null) return [];
|
|
20
|
+
const result = data.result;
|
|
21
|
+
if (!Array.isArray(result)) return [];
|
|
22
|
+
const lines = [];
|
|
23
|
+
for (const stream of result) {
|
|
24
|
+
if (typeof stream !== "object" || stream === null) continue;
|
|
25
|
+
const values = stream.values;
|
|
26
|
+
if (!Array.isArray(values)) continue;
|
|
27
|
+
for (const v of values) if (Array.isArray(v) && typeof v[1] === "string") lines.push(v[1]);
|
|
28
|
+
}
|
|
29
|
+
return lines;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Driver `loki` du Log Backplane (LB.4) — relit les logs dans **Grafana Loki** via
|
|
33
|
+
* LogQL (`GET /loki/api/v1/query_range`). **Adaptateur, pas moteur** : Loki BORNE le
|
|
34
|
+
* rapatriement (sélecteur de labels + fenêtre temporelle + grep + budget de lignes),
|
|
35
|
+
* puis {@link filterPdus} est l'**autorité finale** sur le sous-ensemble rapatrié →
|
|
36
|
+
* sémantique EXACTEMENT identique aux drivers `memory`/`file` (inclusion insensible à
|
|
37
|
+
* la casse, ordering `uid`, pagination). Une logique, N façades.
|
|
38
|
+
*
|
|
39
|
+
* Chaque ligne Loki est le record wire JSON écrit par {@link LokiTransport} → `JSON.parse`
|
|
40
|
+
* + {@link coerceRecord} (lignes corrompues ignorées). Chemin **FROID** (admin/debug),
|
|
41
|
+
* jamais dans le pipeline requête. Loki injoignable / requête invalide → `throw` explicite
|
|
42
|
+
* (≠ `file` absent : une infra de logs prod en panne DOIT être visible, pas masquée).
|
|
43
|
+
*
|
|
44
|
+
* @param options - URL Loki + labels + budgets.
|
|
45
|
+
* @returns un `ILogDriver` `loki` queryable (Node-only).
|
|
46
|
+
*/
|
|
47
|
+
function createLokiLogDriver(options) {
|
|
48
|
+
const base = stripTrailingSlashes(options.url);
|
|
49
|
+
const baseLabels = options.labels ?? { app: "nodefony" };
|
|
50
|
+
const maxScanLines = options.maxScanLines ?? 1e3;
|
|
51
|
+
const defaultLookbackMs = options.defaultLookbackMs ?? 864e5;
|
|
52
|
+
const timeoutMs = options.timeoutMs ?? 8e3;
|
|
53
|
+
const headers = {
|
|
54
|
+
...options.tenantId ? { "X-Scope-OrgID": options.tenantId } : {},
|
|
55
|
+
...options.headers
|
|
56
|
+
};
|
|
57
|
+
const fetchImpl = resolveFetch(options.fetchImpl);
|
|
58
|
+
const buildQuery = (criteria) => {
|
|
59
|
+
const sel = Object.entries(baseLabels).map(([k, v]) => `${k}="${escapeLogQLString(v)}"`);
|
|
60
|
+
if (criteria.severity !== void 0) {
|
|
61
|
+
const sevs = (Array.isArray(criteria.severity) ? criteria.severity : [criteria.severity]).map((s) => escapeLogQLString(s.toUpperCase()));
|
|
62
|
+
sel.push(`severity=~"${sevs.join("|")}"`);
|
|
63
|
+
}
|
|
64
|
+
let q = `{${sel.join(",")}}`;
|
|
65
|
+
if (criteria.requestId !== void 0) q += ` |= "${escapeLogQLString(criteria.requestId)}"`;
|
|
66
|
+
if (criteria.text !== void 0) q += ` |~ "${escapeLogQLString("(?i)" + escapeRegex(criteria.text))}"`;
|
|
67
|
+
return q;
|
|
68
|
+
};
|
|
69
|
+
return {
|
|
70
|
+
name: "loki",
|
|
71
|
+
capabilities: {
|
|
72
|
+
write: true,
|
|
73
|
+
query: true,
|
|
74
|
+
stream: false
|
|
75
|
+
},
|
|
76
|
+
query: async (criteria) => {
|
|
77
|
+
const now = Date.now();
|
|
78
|
+
const fromMs = criteria.from ?? now - defaultLookbackMs;
|
|
79
|
+
const toMs = criteria.to ?? now;
|
|
80
|
+
const params = new URLSearchParams({
|
|
81
|
+
query: buildQuery(criteria),
|
|
82
|
+
start: `${fromMs}000000`,
|
|
83
|
+
end: `${toMs}000000`,
|
|
84
|
+
limit: String(maxScanLines),
|
|
85
|
+
direction: "backward"
|
|
86
|
+
});
|
|
87
|
+
const url = `${base}/loki/api/v1/query_range?${params.toString()}`;
|
|
88
|
+
const res = await fetchWithTimeout(fetchImpl, url, {
|
|
89
|
+
method: "GET",
|
|
90
|
+
headers
|
|
91
|
+
}, timeoutMs);
|
|
92
|
+
if (!res.ok) throw new Error(`LokiLogDriver: query HTTP ${res.status}`);
|
|
93
|
+
const lines = extractLokiLines(await res.json());
|
|
94
|
+
const records = [];
|
|
95
|
+
for (const line of lines) {
|
|
96
|
+
let raw;
|
|
97
|
+
try {
|
|
98
|
+
raw = JSON.parse(line);
|
|
99
|
+
} catch {
|
|
100
|
+
continue;
|
|
101
|
+
}
|
|
102
|
+
const rec = coerceRecord(raw);
|
|
103
|
+
if (rec) records.push(rec);
|
|
104
|
+
}
|
|
105
|
+
records.sort((a, b) => a.timeStamp - b.timeStamp || a.uid - b.uid);
|
|
106
|
+
return filterPdus(records, criteria);
|
|
107
|
+
},
|
|
108
|
+
probe: async () => {
|
|
109
|
+
const t0 = Date.now();
|
|
110
|
+
try {
|
|
111
|
+
const res = await fetchWithTimeout(fetchImpl, `${base}/ready`, {
|
|
112
|
+
method: "GET",
|
|
113
|
+
headers
|
|
114
|
+
}, timeoutMs);
|
|
115
|
+
const latencyMs = Date.now() - t0;
|
|
116
|
+
const text = (await res.text()).trim();
|
|
117
|
+
const ready = res.ok && text.toLowerCase().startsWith("ready");
|
|
118
|
+
const info = {
|
|
119
|
+
endpoint: base,
|
|
120
|
+
httpStatus: res.status
|
|
121
|
+
};
|
|
122
|
+
return ready ? {
|
|
123
|
+
ok: true,
|
|
124
|
+
latencyMs,
|
|
125
|
+
info
|
|
126
|
+
} : {
|
|
127
|
+
ok: false,
|
|
128
|
+
latencyMs,
|
|
129
|
+
detail: `Loki /ready → HTTP ${res.status}${text ? ` (${text.slice(0, 60)})` : ""}`,
|
|
130
|
+
info
|
|
131
|
+
};
|
|
132
|
+
} catch (e) {
|
|
133
|
+
return {
|
|
134
|
+
ok: false,
|
|
135
|
+
latencyMs: Date.now() - t0,
|
|
136
|
+
detail: e instanceof Error ? e.message : "unreachable",
|
|
137
|
+
info: { endpoint: base }
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
//#endregion
|
|
144
|
+
export { createLokiLogDriver };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { filterPdus } from "./filterPdus.js";
|
|
2
|
+
//#region src/syslog/drivers/MemoryLogDriver.ts
|
|
3
|
+
/**
|
|
4
|
+
* Driver `memory` (LB.1) — le **ring buffer du Syslog EST le stockage**. Aucun
|
|
5
|
+
* write dédié : le ring est alimenté par `Syslog.pushStack` sur le hot path. Le
|
|
6
|
+
* driver n'ajoute que la **relecture** (`query`) = {@link filterPdus} sur un
|
|
7
|
+
* snapshot du ring.
|
|
8
|
+
*
|
|
9
|
+
* Défaut en développement : volatile (perdu au restart), borné (`maxStack`), mais
|
|
10
|
+
* **0 dépendance, isomorphe** (pas de `node:*` → utilisable côté navigateur plus
|
|
11
|
+
* tard pour un Log Backplane front). Pour persister/agréger en prod → drivers
|
|
12
|
+
* `file` (LB.2) / `elastic`-`loki` (LB.4).
|
|
13
|
+
*
|
|
14
|
+
* La **source** est injectée (provider `() => IPduLike[]`, comme `Pdu.requestIdProvider`)
|
|
15
|
+
* → le driver ne dépend pas de `Syslog` ni du `Kernel` (le wiring fournit
|
|
16
|
+
* `() => kernel.syslog.ringStack`). Découplé + testable avec un tableau en dur.
|
|
17
|
+
*
|
|
18
|
+
* @param source - fournit le snapshot courant des Pdu (ex. `() => syslog.ringStack`).
|
|
19
|
+
* @returns un `ILogDriver` `memory` queryable.
|
|
20
|
+
*/
|
|
21
|
+
function createMemoryLogDriver(source) {
|
|
22
|
+
return {
|
|
23
|
+
name: "memory",
|
|
24
|
+
capabilities: {
|
|
25
|
+
write: false,
|
|
26
|
+
query: true,
|
|
27
|
+
stream: true
|
|
28
|
+
},
|
|
29
|
+
query: (criteria) => Promise.resolve(filterPdus(source(), criteria))
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
//#endregion
|
|
33
|
+
export { createMemoryLogDriver };
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
import { stripTrailingSlashes } from "../../Tools.js";
|
|
2
|
+
import { fetchWithTimeout, resolveFetch } from "../httpFetch.js";
|
|
3
|
+
import { basicAuthHeader } from "./opensearchShared.js";
|
|
4
|
+
import { filterPdus } from "./filterPdus.js";
|
|
5
|
+
import { coerceRecord } from "./FileLogDriver.js";
|
|
6
|
+
//#region src/syslog/drivers/OpenSearchLogDriver.ts
|
|
7
|
+
/**
|
|
8
|
+
* Extrait les `_source` d'une réponse `_search` OpenSearch (`hits.hits[]._source`),
|
|
9
|
+
* narrowing SÛR (0 `any`).
|
|
10
|
+
*/
|
|
11
|
+
function extractSources(json) {
|
|
12
|
+
if (typeof json !== "object" || json === null) return [];
|
|
13
|
+
const hits = json.hits;
|
|
14
|
+
if (typeof hits !== "object" || hits === null) return [];
|
|
15
|
+
const arr = hits.hits;
|
|
16
|
+
if (!Array.isArray(arr)) return [];
|
|
17
|
+
const out = [];
|
|
18
|
+
for (const h of arr) if (typeof h === "object" && h !== null) out.push(h._source);
|
|
19
|
+
return out;
|
|
20
|
+
}
|
|
21
|
+
/** Lit une string à `key` dans un objet inconnu (narrowing sûr). */
|
|
22
|
+
function pickStr(o, key) {
|
|
23
|
+
if (typeof o !== "object" || o === null) return void 0;
|
|
24
|
+
const v = o[key];
|
|
25
|
+
return typeof v === "string" ? v : void 0;
|
|
26
|
+
}
|
|
27
|
+
/** Lit un nombre à `key` dans un objet inconnu (narrowing sûr). */
|
|
28
|
+
function pickNum(o, key) {
|
|
29
|
+
if (typeof o !== "object" || o === null) return void 0;
|
|
30
|
+
const v = o[key];
|
|
31
|
+
return typeof v === "number" ? v : void 0;
|
|
32
|
+
}
|
|
33
|
+
/** Lit la sous-valeur objet à `key` (pour `root.version.number`). */
|
|
34
|
+
function pickObj(o, key) {
|
|
35
|
+
if (typeof o !== "object" || o === null) return void 0;
|
|
36
|
+
return o[key];
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Driver `opensearch` du Log Backplane (LB.4) — relit les logs dans **OpenSearch**
|
|
40
|
+
* via `POST /{index}/_search` (Query DSL). **Adaptateur, pas moteur** : OpenSearch
|
|
41
|
+
* borne le rapatriement (range sur `timeStamp` + `sort` desc + budget `size`), puis
|
|
42
|
+
* {@link filterPdus} est l'**autorité finale** sur le sous-ensemble → sémantique
|
|
43
|
+
* identique aux drivers `memory`/`file`. Une logique, N façades.
|
|
44
|
+
*
|
|
45
|
+
* Chaque `_source` est le record wire indexé par {@link OpenSearchTransport} →
|
|
46
|
+
* {@link coerceRecord} (documents non conformes ignorés). Chemin **FROID** (admin/debug).
|
|
47
|
+
* Index encore absent (404 `index_not_found`) → résultat VIDE (normal : aucun log
|
|
48
|
+
* indexé). Vraie panne (réseau, 5xx) → `throw` explicite (infra de logs prod visible).
|
|
49
|
+
*
|
|
50
|
+
* @param options - URL OpenSearch + index + budget.
|
|
51
|
+
* @returns un `ILogDriver` `opensearch` queryable (Node-only).
|
|
52
|
+
*/
|
|
53
|
+
function createOpenSearchLogDriver(options) {
|
|
54
|
+
const base = stripTrailingSlashes(options.url);
|
|
55
|
+
const index = options.index ?? "nodefony-logs";
|
|
56
|
+
const maxHits = options.maxHits ?? 1e3;
|
|
57
|
+
const timeoutMs = options.timeoutMs ?? 8e3;
|
|
58
|
+
const headers = {
|
|
59
|
+
"content-type": "application/json",
|
|
60
|
+
...basicAuthHeader(options.username, options.password),
|
|
61
|
+
...options.headers
|
|
62
|
+
};
|
|
63
|
+
const fetchImpl = resolveFetch(options.fetchImpl);
|
|
64
|
+
return {
|
|
65
|
+
name: "opensearch",
|
|
66
|
+
capabilities: {
|
|
67
|
+
write: true,
|
|
68
|
+
query: true,
|
|
69
|
+
stream: false
|
|
70
|
+
},
|
|
71
|
+
query: async (criteria) => {
|
|
72
|
+
const filter = [];
|
|
73
|
+
if (criteria.from !== void 0 || criteria.to !== void 0) {
|
|
74
|
+
const range = {};
|
|
75
|
+
if (criteria.from !== void 0) range.gte = criteria.from;
|
|
76
|
+
if (criteria.to !== void 0) range.lte = criteria.to;
|
|
77
|
+
filter.push({ range: { timeStamp: range } });
|
|
78
|
+
}
|
|
79
|
+
const body = JSON.stringify({
|
|
80
|
+
size: maxHits,
|
|
81
|
+
track_total_hits: true,
|
|
82
|
+
sort: [{ timeStamp: { order: "desc" } }],
|
|
83
|
+
query: filter.length > 0 ? { bool: { filter } } : { match_all: {} }
|
|
84
|
+
});
|
|
85
|
+
const url = `${base}/${encodeURIComponent(index)}/_search`;
|
|
86
|
+
const res = await fetchWithTimeout(fetchImpl, url, {
|
|
87
|
+
method: "POST",
|
|
88
|
+
headers,
|
|
89
|
+
body
|
|
90
|
+
}, timeoutMs);
|
|
91
|
+
if (res.status === 404) return {
|
|
92
|
+
rows: [],
|
|
93
|
+
total: 0,
|
|
94
|
+
truncated: false
|
|
95
|
+
};
|
|
96
|
+
if (!res.ok) throw new Error(`OpenSearchLogDriver: search HTTP ${res.status}`);
|
|
97
|
+
const sources = extractSources(await res.json());
|
|
98
|
+
const records = [];
|
|
99
|
+
for (const src of sources) {
|
|
100
|
+
const rec = coerceRecord(src);
|
|
101
|
+
if (rec) records.push(rec);
|
|
102
|
+
}
|
|
103
|
+
records.reverse();
|
|
104
|
+
return filterPdus(records, criteria);
|
|
105
|
+
},
|
|
106
|
+
probe: async () => {
|
|
107
|
+
const t0 = Date.now();
|
|
108
|
+
try {
|
|
109
|
+
const res = await fetchWithTimeout(fetchImpl, `${base}/`, {
|
|
110
|
+
method: "GET",
|
|
111
|
+
headers
|
|
112
|
+
}, timeoutMs);
|
|
113
|
+
const latencyMs = Date.now() - t0;
|
|
114
|
+
if (!res.ok) return {
|
|
115
|
+
ok: false,
|
|
116
|
+
latencyMs,
|
|
117
|
+
detail: `OpenSearch / → HTTP ${res.status}`,
|
|
118
|
+
info: {
|
|
119
|
+
endpoint: base,
|
|
120
|
+
httpStatus: res.status
|
|
121
|
+
}
|
|
122
|
+
};
|
|
123
|
+
const root = await res.json();
|
|
124
|
+
const info = {
|
|
125
|
+
endpoint: base,
|
|
126
|
+
index
|
|
127
|
+
};
|
|
128
|
+
const version = pickStr(pickObj(root, "version"), "number");
|
|
129
|
+
if (version) info.version = version;
|
|
130
|
+
const cluster = pickStr(root, "cluster_name");
|
|
131
|
+
if (cluster) info.cluster = cluster;
|
|
132
|
+
try {
|
|
133
|
+
const cres = await fetchWithTimeout(fetchImpl, `${base}/${encodeURIComponent(index)}/_count`, {
|
|
134
|
+
method: "GET",
|
|
135
|
+
headers
|
|
136
|
+
}, timeoutMs);
|
|
137
|
+
if (cres.ok) {
|
|
138
|
+
const count = pickNum(await cres.json(), "count");
|
|
139
|
+
if (count !== void 0) info.docs = count;
|
|
140
|
+
} else if (cres.status === 404) info.docs = 0;
|
|
141
|
+
} catch {}
|
|
142
|
+
return {
|
|
143
|
+
ok: true,
|
|
144
|
+
latencyMs,
|
|
145
|
+
info
|
|
146
|
+
};
|
|
147
|
+
} catch (e) {
|
|
148
|
+
return {
|
|
149
|
+
ok: false,
|
|
150
|
+
latencyMs: Date.now() - t0,
|
|
151
|
+
detail: e instanceof Error ? e.message : "unreachable",
|
|
152
|
+
info: { endpoint: base }
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
};
|
|
157
|
+
}
|
|
158
|
+
//#endregion
|
|
159
|
+
export { createOpenSearchLogDriver };
|