@zintrust/core 0.1.40 → 0.1.41
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/bin/zintrust-main.d.ts.map +1 -1
- package/bin/zintrust-main.js +22 -1
- package/package.json +8 -4
- package/public/error-pages/404.html +2 -2
- package/src/auth/Auth.js +1 -1
- package/src/boot/Application.d.ts +1 -16
- package/src/boot/Application.d.ts.map +1 -1
- package/src/boot/Application.js +2 -290
- package/src/boot/Server.d.ts +1 -1
- package/src/boot/Server.d.ts.map +1 -1
- package/src/boot/bootstrap.js +23 -5
- package/src/boot/registry/registerRoute.d.ts +6 -0
- package/src/boot/registry/registerRoute.d.ts.map +1 -0
- package/src/boot/registry/registerRoute.js +96 -0
- package/src/boot/registry/runtime.d.ts +15 -0
- package/src/boot/registry/runtime.d.ts.map +1 -0
- package/src/boot/registry/runtime.js +353 -0
- package/src/boot/registry/type.d.ts +25 -0
- package/src/boot/registry/type.d.ts.map +1 -0
- package/src/boot/registry/type.js +1 -0
- package/src/boot/registry/worker.d.ts +6 -0
- package/src/boot/registry/worker.d.ts.map +1 -0
- package/src/boot/registry/worker.js +35 -0
- package/src/cache/drivers/KVRemoteDriver.d.ts.map +1 -1
- package/src/cache/drivers/KVRemoteDriver.js +14 -1
- package/src/cli/CLI.d.ts.map +1 -1
- package/src/cli/CLI.js +82 -34
- package/src/cli/ErrorHandler.js +1 -1
- package/src/cli/commands/ContainerProxiesCommand.d.ts +5 -0
- package/src/cli/commands/ContainerProxiesCommand.d.ts.map +1 -0
- package/src/cli/commands/ContainerProxiesCommand.js +77 -0
- package/src/cli/commands/ContainerWorkersCommand.d.ts +5 -0
- package/src/cli/commands/ContainerWorkersCommand.d.ts.map +1 -0
- package/src/cli/commands/ContainerWorkersCommand.js +57 -0
- package/src/cli/commands/DeployCommand.d.ts +16 -0
- package/src/cli/commands/DeployCommand.d.ts.map +1 -0
- package/src/cli/commands/DeployCommand.js +110 -0
- package/src/cli/commands/DeployContainerProxiesCommand.d.ts +5 -0
- package/src/cli/commands/DeployContainerProxiesCommand.d.ts.map +1 -0
- package/src/cli/commands/DeployContainerProxiesCommand.js +27 -0
- package/src/cli/commands/DeployContainerWorkersCommand.d.ts +5 -0
- package/src/cli/commands/DeployContainerWorkersCommand.d.ts.map +1 -0
- package/src/cli/commands/DeployContainerWorkersCommand.js +27 -0
- package/src/cli/commands/DockerComposeCommandUtils.d.ts +3 -0
- package/src/cli/commands/DockerComposeCommandUtils.d.ts.map +1 -0
- package/src/cli/commands/DockerComposeCommandUtils.js +34 -0
- package/src/cli/commands/DoctorArchitectureCommand.d.ts +5 -0
- package/src/cli/commands/DoctorArchitectureCommand.d.ts.map +1 -0
- package/src/cli/commands/DoctorArchitectureCommand.js +54 -0
- package/src/cli/commands/InitContainerCommand.d.ts +5 -0
- package/src/cli/commands/InitContainerCommand.d.ts.map +1 -0
- package/src/cli/commands/InitContainerCommand.js +216 -0
- package/src/cli/commands/InitProducerCommand.d.ts +5 -0
- package/src/cli/commands/InitProducerCommand.d.ts.map +1 -0
- package/src/cli/commands/InitProducerCommand.js +47 -0
- package/src/cli/commands/InitProxyCommand.d.ts +5 -0
- package/src/cli/commands/InitProxyCommand.d.ts.map +1 -0
- package/src/cli/commands/InitProxyCommand.js +442 -0
- package/src/cli/commands/MongoDBProxyCommand.d.ts +5 -0
- package/src/cli/commands/MongoDBProxyCommand.d.ts.map +1 -0
- package/src/cli/commands/MongoDBProxyCommand.js +98 -0
- package/src/cli/commands/MySqlProxyCommand.d.ts +6 -0
- package/src/cli/commands/MySqlProxyCommand.d.ts.map +1 -0
- package/src/cli/commands/MySqlProxyCommand.js +32 -0
- package/src/cli/commands/PostgresProxyCommand.d.ts +6 -0
- package/src/cli/commands/PostgresProxyCommand.d.ts.map +1 -0
- package/src/cli/commands/PostgresProxyCommand.js +32 -0
- package/src/cli/commands/ProxyCommand.d.ts +12 -0
- package/src/cli/commands/ProxyCommand.d.ts.map +1 -0
- package/src/cli/commands/ProxyCommand.js +80 -0
- package/src/cli/commands/ProxyCommandUtils.d.ts +6 -0
- package/src/cli/commands/ProxyCommandUtils.d.ts.map +1 -0
- package/src/cli/commands/ProxyCommandUtils.js +38 -0
- package/src/cli/commands/QueueRecoveryCommand.d.ts +6 -0
- package/src/cli/commands/QueueRecoveryCommand.d.ts.map +1 -0
- package/src/cli/commands/QueueRecoveryCommand.js +513 -0
- package/src/cli/commands/RedisProxyCommand.d.ts +6 -0
- package/src/cli/commands/RedisProxyCommand.d.ts.map +1 -0
- package/src/cli/commands/RedisProxyCommand.js +53 -0
- package/src/cli/commands/SmtpProxyCommand.d.ts +6 -0
- package/src/cli/commands/SmtpProxyCommand.d.ts.map +1 -0
- package/src/cli/commands/SmtpProxyCommand.js +56 -0
- package/src/cli/commands/SqlProxyCommandUtils.d.ts +46 -0
- package/src/cli/commands/SqlProxyCommandUtils.d.ts.map +1 -0
- package/src/cli/commands/SqlProxyCommandUtils.js +48 -0
- package/src/cli/commands/SqlServerProxyCommand.d.ts +5 -0
- package/src/cli/commands/SqlServerProxyCommand.d.ts.map +1 -0
- package/src/cli/commands/SqlServerProxyCommand.js +85 -0
- package/src/cli/commands/StartCommand.d.ts.map +1 -1
- package/src/cli/commands/StartCommand.js +132 -17
- package/src/cli/commands/WorkerCommands.d.ts +1 -0
- package/src/cli/commands/WorkerCommands.d.ts.map +1 -1
- package/src/cli/commands/WorkerCommands.js +140 -6
- package/src/cli/commands/index.d.ts +2 -0
- package/src/cli/commands/index.d.ts.map +1 -1
- package/src/cli/commands/index.js +2 -0
- package/src/cli/commands/runner/index.d.ts +2 -2
- package/src/cli/commands/runner/index.d.ts.map +1 -1
- package/src/cli/commands/runner/index.js +15 -4
- package/src/cli/d1/D1SqlMigrations.d.ts.map +1 -1
- package/src/cli/d1/D1SqlMigrations.js +3 -0
- package/src/cli/index.d.ts +4 -0
- package/src/cli/index.d.ts.map +1 -1
- package/src/cli/index.js +4 -0
- package/src/cli/scaffolding/ProjectScaffolder.d.ts.map +1 -1
- package/src/cli/scaffolding/ProjectScaffolder.js +2 -0
- package/src/cli/scaffolding/ServiceScaffolder.d.ts.map +1 -1
- package/src/cli/scaffolding/ServiceScaffolder.js +1 -0
- package/src/cli/utils/EnvFileLoader.js +16 -15
- package/src/cli/workers/QueueWorkRunner.js +1 -1
- package/src/common/HealthRoutes.d.ts.map +1 -1
- package/src/common/HealthRoutes.js +50 -2
- package/src/common/RemoteSignedJson.d.ts +1 -0
- package/src/common/RemoteSignedJson.d.ts.map +1 -1
- package/src/common/RemoteSignedJson.js +39 -13
- package/src/common/index.d.ts +1 -0
- package/src/common/index.d.ts.map +1 -1
- package/src/common/index.js +12 -1
- package/src/config/FileLogWriter.d.ts.map +1 -1
- package/src/config/FileLogWriter.js +21 -6
- package/src/config/app.d.ts +4 -0
- package/src/config/app.d.ts.map +1 -1
- package/src/config/app.js +4 -0
- package/src/config/cache.d.ts.map +1 -1
- package/src/config/cache.js +22 -2
- package/src/config/cloudflare.d.ts +5 -1
- package/src/config/cloudflare.d.ts.map +1 -1
- package/src/config/cloudflare.js +48 -0
- package/src/config/database.d.ts.map +1 -1
- package/src/config/database.js +48 -13
- package/src/config/env.d.ts +87 -2
- package/src/config/env.d.ts.map +1 -1
- package/src/config/env.js +156 -17
- package/src/config/index.d.ts +1 -0
- package/src/config/index.d.ts.map +1 -1
- package/src/config/mail.d.ts.map +1 -1
- package/src/config/mail.js +16 -10
- package/src/config/middleware.d.ts +5 -0
- package/src/config/middleware.d.ts.map +1 -1
- package/src/config/middleware.js +19 -1
- package/src/config/queue.d.ts.map +1 -1
- package/src/config/queue.js +70 -9
- package/src/config/redis.d.ts.map +1 -1
- package/src/config/redis.js +48 -13
- package/src/config/storage.d.ts.map +1 -1
- package/src/config/storage.js +1 -0
- package/src/config/type.d.ts +18 -0
- package/src/config/type.d.ts.map +1 -1
- package/src/config/workers.d.ts.map +1 -1
- package/src/config/workers.js +122 -16
- package/src/functions/cloudflare.d.ts.map +1 -1
- package/src/functions/cloudflare.js +55 -1
- package/src/health/StartupHealthChecks.js +1 -1
- package/src/http/FileUpload.d.ts +3 -2
- package/src/http/FileUpload.d.ts.map +1 -1
- package/src/http/Kernel.d.ts.map +1 -1
- package/src/http/Kernel.js +2 -1
- package/src/http/error-pages/ErrorPageRenderer.d.ts +4 -0
- package/src/http/error-pages/ErrorPageRenderer.d.ts.map +1 -1
- package/src/http/error-pages/ErrorPageRenderer.js +141 -1
- package/src/http/middleware/BodyParsingMiddleware.d.ts.map +1 -1
- package/src/http/middleware/BodyParsingMiddleware.js +33 -6
- package/src/index.d.ts +25 -53
- package/src/index.d.ts.map +1 -1
- package/src/index.js +30 -14
- package/src/microservices/ServiceAuthMiddleware.d.ts.map +1 -1
- package/src/microservices/ServiceAuthMiddleware.js +12 -4
- package/src/middleware/CsrfMiddleware.d.ts.map +1 -1
- package/src/middleware/CsrfMiddleware.js +30 -16
- package/src/middleware/ErrorHandlerMiddleware.d.ts.map +1 -1
- package/src/middleware/ErrorHandlerMiddleware.js +2 -1
- package/src/migrations/MigrationLoader.js +1 -1
- package/src/migrations/schema/SchemaCompiler.d.ts.map +1 -1
- package/src/migrations/schema/SchemaCompiler.js +6 -3
- package/src/node-singletons/crypto.d.ts +1 -1
- package/src/node-singletons/crypto.d.ts.map +1 -1
- package/src/node-singletons/crypto.js +1 -1
- package/src/node-singletons/fs.d.ts +1 -1
- package/src/node-singletons/fs.d.ts.map +1 -1
- package/src/node-singletons/path.d.ts +1 -1
- package/src/node-singletons/path.d.ts.map +1 -1
- package/src/node-singletons/path.js +1 -1
- package/src/node-singletons/stream.d.ts +11 -0
- package/src/node-singletons/stream.d.ts.map +1 -0
- package/src/node-singletons/stream.js +8 -0
- package/src/observability/OpenTelemetry.d.ts +7 -0
- package/src/observability/OpenTelemetry.d.ts.map +1 -1
- package/src/observability/OpenTelemetry.js +49 -2
- package/src/orm/Database.d.ts +4 -0
- package/src/orm/Database.d.ts.map +1 -1
- package/src/orm/Database.js +80 -9
- package/src/orm/DatabaseRuntimeRegistration.d.ts.map +1 -1
- package/src/orm/DatabaseRuntimeRegistration.js +2 -0
- package/src/orm/QueryBuilder.d.ts +1 -0
- package/src/orm/QueryBuilder.d.ts.map +1 -1
- package/src/orm/QueryBuilder.js +33 -3
- package/src/orm/SchemaCompiler.d.ts.map +1 -1
- package/src/orm/SchemaCompiler.js +6 -3
- package/src/orm/adapters/D1RemoteAdapter.d.ts.map +1 -1
- package/src/orm/adapters/D1RemoteAdapter.js +14 -1
- package/src/orm/adapters/MongoDBProxyAdapter.d.ts +3 -0
- package/src/orm/adapters/MongoDBProxyAdapter.d.ts.map +1 -0
- package/src/orm/adapters/MongoDBProxyAdapter.js +128 -0
- package/src/orm/adapters/MySQLProxyAdapter.d.ts +11 -0
- package/src/orm/adapters/MySQLProxyAdapter.d.ts.map +1 -0
- package/src/orm/adapters/MySQLProxyAdapter.js +143 -0
- package/src/orm/adapters/PostgreSQLProxyAdapter.d.ts +11 -0
- package/src/orm/adapters/PostgreSQLProxyAdapter.d.ts.map +1 -0
- package/src/orm/adapters/PostgreSQLProxyAdapter.js +147 -0
- package/src/orm/adapters/ProxyCache.d.ts +9 -0
- package/src/orm/adapters/ProxyCache.d.ts.map +1 -0
- package/src/orm/adapters/ProxyCache.js +24 -0
- package/src/orm/adapters/ProxySignedRequest.d.ts +11 -0
- package/src/orm/adapters/ProxySignedRequest.d.ts.map +1 -0
- package/src/orm/adapters/ProxySignedRequest.js +30 -0
- package/src/orm/adapters/ProxySigningPath.d.ts +3 -0
- package/src/orm/adapters/ProxySigningPath.d.ts.map +1 -0
- package/src/orm/adapters/ProxySigningPath.js +25 -0
- package/src/orm/adapters/SqlProxyAdapterUtils.d.ts +19 -0
- package/src/orm/adapters/SqlProxyAdapterUtils.d.ts.map +1 -0
- package/src/orm/adapters/SqlProxyAdapterUtils.js +35 -0
- package/src/orm/adapters/SqlServerProxyAdapter.d.ts +3 -0
- package/src/orm/adapters/SqlServerProxyAdapter.d.ts.map +1 -0
- package/src/orm/adapters/SqlServerProxyAdapter.js +146 -0
- package/src/performance/Optimizer.d.ts +1 -0
- package/src/performance/Optimizer.d.ts.map +1 -1
- package/src/performance/Optimizer.js +21 -8
- package/src/proxy/ErrorHandler.d.ts +11 -0
- package/src/proxy/ErrorHandler.d.ts.map +1 -0
- package/src/proxy/ErrorHandler.js +7 -0
- package/src/proxy/PoolManager.d.ts +8 -0
- package/src/proxy/PoolManager.d.ts.map +1 -0
- package/src/proxy/PoolManager.js +18 -0
- package/src/proxy/ProxyBackend.d.ts +18 -0
- package/src/proxy/ProxyBackend.d.ts.map +1 -0
- package/src/proxy/ProxyBackend.js +1 -0
- package/src/proxy/ProxyConfig.d.ts +12 -0
- package/src/proxy/ProxyConfig.d.ts.map +1 -0
- package/src/proxy/ProxyConfig.js +1 -0
- package/src/proxy/ProxyRegistry.d.ts +10 -0
- package/src/proxy/ProxyRegistry.d.ts.map +1 -0
- package/src/proxy/ProxyRegistry.js +11 -0
- package/src/proxy/ProxyServer.d.ts +21 -0
- package/src/proxy/ProxyServer.d.ts.map +1 -0
- package/src/proxy/ProxyServer.js +84 -0
- package/src/proxy/ProxyServerUtils.d.ts +37 -0
- package/src/proxy/ProxyServerUtils.d.ts.map +1 -0
- package/src/proxy/ProxyServerUtils.js +42 -0
- package/src/proxy/ProxySigningConfigResolver.d.ts +22 -0
- package/src/proxy/ProxySigningConfigResolver.d.ts.map +1 -0
- package/src/proxy/ProxySigningConfigResolver.js +24 -0
- package/src/proxy/ProxySigningRequest.d.ts +12 -0
- package/src/proxy/ProxySigningRequest.d.ts.map +1 -0
- package/src/proxy/ProxySigningRequest.js +31 -0
- package/src/proxy/RequestValidator.d.ts +15 -0
- package/src/proxy/RequestValidator.d.ts.map +1 -0
- package/src/proxy/RequestValidator.js +25 -0
- package/src/proxy/SigningService.d.ts +39 -0
- package/src/proxy/SigningService.d.ts.map +1 -0
- package/src/proxy/SigningService.js +107 -0
- package/src/proxy/SqlPayloadValidator.d.ts +13 -0
- package/src/proxy/SqlPayloadValidator.d.ts.map +1 -0
- package/src/proxy/SqlPayloadValidator.js +14 -0
- package/src/proxy/d1/ZintrustD1Proxy.d.ts +2 -0
- package/src/proxy/d1/ZintrustD1Proxy.d.ts.map +1 -0
- package/src/proxy/d1/ZintrustD1Proxy.js +1 -0
- package/src/proxy/d1/register.d.ts +2 -0
- package/src/proxy/d1/register.d.ts.map +1 -0
- package/src/proxy/d1/register.js +5 -0
- package/src/proxy/kv/ZintrustKvProxy.d.ts +2 -0
- package/src/proxy/kv/ZintrustKvProxy.d.ts.map +1 -0
- package/src/proxy/kv/ZintrustKvProxy.js +1 -0
- package/src/proxy/kv/register.d.ts +2 -0
- package/src/proxy/kv/register.d.ts.map +1 -0
- package/src/proxy/kv/register.js +5 -0
- package/src/proxy/mongodb/MongoDBProxyServer.d.ts +33 -0
- package/src/proxy/mongodb/MongoDBProxyServer.d.ts.map +1 -0
- package/src/proxy/mongodb/MongoDBProxyServer.js +202 -0
- package/src/proxy/mongodb/register.d.ts +2 -0
- package/src/proxy/mongodb/register.d.ts.map +1 -0
- package/src/proxy/mongodb/register.js +5 -0
- package/src/proxy/mysql/MySqlProxyServer.d.ts +14 -0
- package/src/proxy/mysql/MySqlProxyServer.d.ts.map +1 -0
- package/src/proxy/mysql/MySqlProxyServer.js +169 -0
- package/src/proxy/mysql/register.d.ts +2 -0
- package/src/proxy/mysql/register.d.ts.map +1 -0
- package/src/proxy/mysql/register.js +5 -0
- package/src/proxy/postgres/PostgresProxyServer.d.ts +14 -0
- package/src/proxy/postgres/PostgresProxyServer.d.ts.map +1 -0
- package/src/proxy/postgres/PostgresProxyServer.js +140 -0
- package/src/proxy/postgres/register.d.ts +2 -0
- package/src/proxy/postgres/register.d.ts.map +1 -0
- package/src/proxy/postgres/register.js +5 -0
- package/src/proxy/redis/RedisProxyServer.d.ts +12 -0
- package/src/proxy/redis/RedisProxyServer.d.ts.map +1 -0
- package/src/proxy/redis/RedisProxyServer.js +192 -0
- package/src/proxy/redis/register.d.ts +2 -0
- package/src/proxy/redis/register.d.ts.map +1 -0
- package/src/proxy/redis/register.js +5 -0
- package/src/proxy/smtp/SmtpProxyServer.d.ts +19 -0
- package/src/proxy/smtp/SmtpProxyServer.d.ts.map +1 -0
- package/src/proxy/smtp/SmtpProxyServer.js +289 -0
- package/src/proxy/smtp/register.d.ts +2 -0
- package/src/proxy/smtp/register.d.ts.map +1 -0
- package/src/proxy/smtp/register.js +5 -0
- package/src/proxy/sqlserver/SqlServerProxyServer.d.ts +14 -0
- package/src/proxy/sqlserver/SqlServerProxyServer.d.ts.map +1 -0
- package/src/proxy/sqlserver/SqlServerProxyServer.js +168 -0
- package/src/proxy/sqlserver/register.d.ts +2 -0
- package/src/proxy/sqlserver/register.d.ts.map +1 -0
- package/src/proxy/sqlserver/register.js +5 -0
- package/src/routes/doc.d.ts.map +1 -1
- package/src/routes/doc.js +16 -2
- package/src/routes/error.d.ts +5 -4
- package/src/routes/error.d.ts.map +1 -1
- package/src/routes/error.js +15 -13
- package/src/routes/errorPages.d.ts +2 -0
- package/src/routes/errorPages.d.ts.map +1 -1
- package/src/routes/errorPages.js +144 -4
- package/src/runtime/PluginAutoImports.d.ts +1 -0
- package/src/runtime/PluginAutoImports.d.ts.map +1 -1
- package/src/runtime/PluginAutoImports.js +94 -9
- package/src/runtime/RuntimeAdapter.d.ts +8 -9
- package/src/runtime/RuntimeAdapter.d.ts.map +1 -1
- package/src/runtime/RuntimeAdapter.js +120 -34
- package/src/runtime/RuntimeServices.d.ts +47 -0
- package/src/runtime/RuntimeServices.d.ts.map +1 -0
- package/src/runtime/RuntimeServices.js +164 -0
- package/src/runtime/StartupConfigFileRegistry.d.ts +4 -4
- package/src/runtime/StartupConfigFileRegistry.d.ts.map +1 -1
- package/src/runtime/StartupConfigFileRegistry.js +12 -0
- package/src/runtime/WorkerAdapterImports.d.ts +5 -0
- package/src/runtime/WorkerAdapterImports.d.ts.map +1 -0
- package/src/runtime/WorkerAdapterImports.js +17 -0
- package/src/runtime/WorkersModule.d.ts +6 -0
- package/src/runtime/WorkersModule.d.ts.map +1 -0
- package/src/runtime/WorkersModule.js +278 -0
- package/src/runtime/adapters/CloudflareAdapter.d.ts.map +1 -1
- package/src/runtime/adapters/CloudflareAdapter.js +19 -2
- package/src/runtime/adapters/DenoAdapter.js +1 -0
- package/src/runtime/adapters/FargateAdapter.js +1 -1
- package/src/runtime/adapters/LambdaAdapter.js +1 -1
- package/src/runtime/adapters/NodeServerAdapter.js +1 -1
- package/src/runtime/detectRuntime.d.ts +10 -0
- package/src/runtime/detectRuntime.d.ts.map +1 -0
- package/src/runtime/detectRuntime.js +57 -0
- package/src/runtime/useFileLoader.d.ts.map +1 -1
- package/src/runtime/useFileLoader.js +16 -0
- package/src/scripts/TemplateImportsCheck.js +2 -2
- package/src/scripts/TemplateSync.js +3 -4
- package/src/security/CsrfTokenManager.d.ts.map +1 -1
- package/src/security/CsrfTokenManager.js +12 -0
- package/src/security/Hash.d.ts +1 -1
- package/src/security/Hash.d.ts.map +1 -1
- package/src/security/Hash.js +31 -36
- package/src/seeders/SeederLoader.js +1 -1
- package/src/session/SessionManager.d.ts +3 -0
- package/src/session/SessionManager.d.ts.map +1 -1
- package/src/session/SessionManager.js +49 -10
- package/src/sockets/CloudflareSocket.d.ts +24 -0
- package/src/sockets/CloudflareSocket.d.ts.map +1 -0
- package/src/sockets/CloudflareSocket.js +259 -0
- package/src/start.d.ts.map +1 -1
- package/src/start.js +1 -8
- package/src/templates/project/basic/src/zintrust.plugins.wg.ts.tpl +8 -0
- package/src/tools/mail/drivers/Smtp.d.ts.map +1 -1
- package/src/tools/mail/drivers/Smtp.js +223 -18
- package/src/tools/mail/index.d.ts.map +1 -1
- package/src/tools/mail/index.js +5 -4
- package/src/tools/mail/template-loader.d.ts.map +1 -1
- package/src/tools/mail/template-loader.js +197 -29
- package/src/tools/mail/templates/auth-password-reset.d.ts +3 -0
- package/src/tools/mail/templates/auth-password-reset.d.ts.map +1 -0
- package/src/tools/mail/templates/auth-password-reset.js +231 -0
- package/src/tools/mail/templates/auth-welcome.d.ts +3 -0
- package/src/tools/mail/templates/auth-welcome.d.ts.map +1 -0
- package/src/tools/mail/templates/auth-welcome.js +236 -0
- package/src/tools/mail/templates/general.d.ts +3 -0
- package/src/tools/mail/templates/general.d.ts.map +1 -0
- package/src/tools/mail/templates/general.js +109 -0
- package/src/tools/mail/templates/index.js +2 -2
- package/src/tools/mail/templates/job-completed.d.ts +3 -0
- package/src/tools/mail/templates/job-completed.d.ts.map +1 -0
- package/src/tools/mail/templates/job-completed.js +188 -0
- package/src/tools/mail/templates/notifications-new-comment.d.ts +3 -0
- package/src/tools/mail/templates/notifications-new-comment.d.ts.map +1 -0
- package/src/tools/mail/templates/notifications-new-comment.js +228 -0
- package/src/tools/mail/templates/password-reset.d.ts +3 -0
- package/src/tools/mail/templates/password-reset.d.ts.map +1 -0
- package/src/tools/mail/templates/password-reset.js +221 -0
- package/src/tools/mail/templates/performance-report.d.ts +3 -0
- package/src/tools/mail/templates/performance-report.d.ts.map +1 -0
- package/src/tools/mail/templates/performance-report.js +258 -0
- package/src/tools/mail/templates/welcome.d.ts +3 -0
- package/src/tools/mail/templates/welcome.d.ts.map +1 -0
- package/src/tools/mail/templates/welcome.js +187 -0
- package/src/tools/mail/templates/worker-alert.d.ts +3 -0
- package/src/tools/mail/templates/worker-alert.d.ts.map +1 -0
- package/src/tools/mail/templates/worker-alert.js +229 -0
- package/src/tools/notification/Notification.js +1 -1
- package/src/tools/notification/testingHelpers.js +6 -5
- package/src/tools/queue/AdvancedQueue.js +2 -6
- package/src/tools/queue/IdempotencyManager.d.ts +6 -0
- package/src/tools/queue/IdempotencyManager.d.ts.map +1 -0
- package/src/tools/queue/IdempotencyManager.js +36 -0
- package/src/tools/queue/JobHeartbeatStore.d.ts +16 -0
- package/src/tools/queue/JobHeartbeatStore.d.ts.map +1 -0
- package/src/tools/queue/JobHeartbeatStore.js +67 -0
- package/src/tools/queue/JobReconciliationRunner.d.ts +16 -0
- package/src/tools/queue/JobReconciliationRunner.d.ts.map +1 -0
- package/src/tools/queue/JobReconciliationRunner.js +88 -0
- package/src/tools/queue/JobRecoveryDaemon.d.ts +27 -0
- package/src/tools/queue/JobRecoveryDaemon.d.ts.map +1 -0
- package/src/tools/queue/JobRecoveryDaemon.js +205 -0
- package/src/tools/queue/JobStateTracker.d.ts +131 -0
- package/src/tools/queue/JobStateTracker.d.ts.map +1 -0
- package/src/tools/queue/JobStateTracker.js +387 -0
- package/src/tools/queue/JobStateTrackerDbPersistence.d.ts +12 -0
- package/src/tools/queue/JobStateTrackerDbPersistence.d.ts.map +1 -0
- package/src/tools/queue/JobStateTrackerDbPersistence.js +148 -0
- package/src/tools/queue/Queue.d.ts.map +1 -1
- package/src/tools/queue/Queue.js +160 -16
- package/src/tools/queue/QueueDataRedactor.d.ts +6 -0
- package/src/tools/queue/QueueDataRedactor.d.ts.map +1 -0
- package/src/tools/queue/QueueDataRedactor.js +45 -0
- package/src/tools/queue/QueueExtensions.d.ts.map +1 -1
- package/src/tools/queue/QueueExtensions.js +2 -1
- package/src/tools/queue/QueueReliabilityMetrics.d.ts +38 -0
- package/src/tools/queue/QueueReliabilityMetrics.d.ts.map +1 -0
- package/src/tools/queue/QueueReliabilityMetrics.js +131 -0
- package/src/tools/queue/QueueReliabilityOrchestrator.d.ts +7 -0
- package/src/tools/queue/QueueReliabilityOrchestrator.d.ts.map +1 -0
- package/src/tools/queue/QueueReliabilityOrchestrator.js +59 -0
- package/src/tools/queue/QueueRuntimeRegistration.d.ts +1 -9
- package/src/tools/queue/QueueRuntimeRegistration.d.ts.map +1 -1
- package/src/tools/queue/QueueRuntimeRegistration.js +75 -4
- package/src/tools/queue/QueueTracing.d.ts +32 -0
- package/src/tools/queue/QueueTracing.d.ts.map +1 -0
- package/src/tools/queue/QueueTracing.js +151 -0
- package/src/tools/queue/StalledJobMonitor.d.ts +5 -0
- package/src/tools/queue/StalledJobMonitor.d.ts.map +1 -0
- package/src/tools/queue/StalledJobMonitor.js +21 -0
- package/src/tools/queue/TimeoutManager.d.ts +14 -0
- package/src/tools/queue/TimeoutManager.d.ts.map +1 -0
- package/src/tools/queue/TimeoutManager.js +77 -0
- package/src/tools/queue/drivers/Redis.d.ts +1 -0
- package/src/tools/queue/drivers/Redis.d.ts.map +1 -1
- package/src/tools/queue/drivers/Redis.js +1 -0
- package/src/tools/queue/index.d.ts +10 -0
- package/src/tools/queue/index.d.ts.map +1 -1
- package/src/tools/queue/index.js +10 -0
- package/src/tools/storage/drivers/R2.d.ts +13 -0
- package/src/tools/storage/drivers/R2.d.ts.map +1 -1
- package/src/tools/storage/drivers/R2.js +29 -0
- package/src/zintrust.plugins.d.ts +9 -0
- package/src/zintrust.plugins.d.ts.map +1 -0
- package/src/zintrust.plugins.js +7 -0
- package/src/zintrust.plugins.wg.d.ts +9 -0
- package/src/zintrust.plugins.wg.d.ts.map +1 -0
- package/src/zintrust.plugins.wg.js +7 -0
|
@@ -0,0 +1,353 @@
|
|
|
1
|
+
import * as RuntimeConfig from '../../config/index.js';
|
|
2
|
+
import { StartupHealthChecks } from '../../health/StartupHealthChecks.js';
|
|
3
|
+
import { loadQueueMonitorModule, loadWorkersModule } from '../../runtime/WorkersModule.js';
|
|
4
|
+
import { registerCachesFromRuntimeConfig } from '../../cache/CacheRuntimeRegistration.js';
|
|
5
|
+
import broadcastConfig from '../../config/broadcast.js';
|
|
6
|
+
import { Cloudflare } from '../../config/cloudflare.js';
|
|
7
|
+
import { FeatureFlags } from '../../config/features.js';
|
|
8
|
+
import { Logger } from '../../config/logger.js';
|
|
9
|
+
import notificationConfig from '../../config/notification.js';
|
|
10
|
+
import { StartupConfigValidator } from '../../config/StartupConfigValidator.js';
|
|
11
|
+
import { existsSync } from '../../node-singletons/fs.js';
|
|
12
|
+
import * as path from '../../node-singletons/path.js';
|
|
13
|
+
import { pathToFileURL } from '../../node-singletons/url.js';
|
|
14
|
+
import { registerDatabasesFromRuntimeConfig } from '../../orm/DatabaseRuntimeRegistration.js';
|
|
15
|
+
import { registerMasterRoutes, tryImportOptional } from './registerRoute.js';
|
|
16
|
+
import { registerWorkerShutdownHook } from './worker.js';
|
|
17
|
+
import { StartupConfigFile, StartupConfigFileRegistry } from '../../runtime/StartupConfigFileRegistry.js';
|
|
18
|
+
import { registerBroadcastersFromRuntimeConfig } from '../../tools/broadcast/BroadcastRuntimeRegistration.js';
|
|
19
|
+
import { registerNotificationChannelsFromRuntimeConfig } from '../../tools/notification/NotificationRuntimeRegistration.js';
|
|
20
|
+
import { registerQueuesFromRuntimeConfig } from '../../tools/queue/QueueRuntimeRegistration.js';
|
|
21
|
+
import { registerDisksFromRuntimeConfig } from '../../tools/storage/StorageRuntimeRegistration.js';
|
|
22
|
+
const loadRuntimeQueueConfig = async () => {
|
|
23
|
+
try {
|
|
24
|
+
const modulePath = '@runtime-config/queue';
|
|
25
|
+
const loaded = (await import(modulePath));
|
|
26
|
+
return loaded.default ?? queueConfig ?? undefined;
|
|
27
|
+
}
|
|
28
|
+
catch {
|
|
29
|
+
return queueConfig ?? undefined;
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
const readRuntimeConfig = (key, fallback) => {
|
|
33
|
+
try {
|
|
34
|
+
const value = RuntimeConfig[key];
|
|
35
|
+
return (value ?? fallback);
|
|
36
|
+
}
|
|
37
|
+
catch {
|
|
38
|
+
return fallback;
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
const appConfig = readRuntimeConfig('appConfig', { port: 7777, dockerWorker: false });
|
|
42
|
+
const cacheConfig = readRuntimeConfig('cacheConfig', RuntimeConfig.cacheConfig);
|
|
43
|
+
const databaseConfig = readRuntimeConfig('databaseConfig', {
|
|
44
|
+
default: 'sqlite',
|
|
45
|
+
connections: {},
|
|
46
|
+
});
|
|
47
|
+
const queueConfig = readRuntimeConfig('queueConfig', RuntimeConfig.queueConfig);
|
|
48
|
+
const storageConfig = readRuntimeConfig('storageConfig', RuntimeConfig.storageConfig);
|
|
49
|
+
// eslint-disable-next-line @typescript-eslint/require-await
|
|
50
|
+
const dbLoader = async () => {
|
|
51
|
+
registerDatabasesFromRuntimeConfig(databaseConfig);
|
|
52
|
+
};
|
|
53
|
+
const queuesLoader = async () => {
|
|
54
|
+
await registerQueuesFromRuntimeConfig(queueConfig);
|
|
55
|
+
};
|
|
56
|
+
// eslint-disable-next-line @typescript-eslint/require-await
|
|
57
|
+
const cachesLoader = async () => {
|
|
58
|
+
registerCachesFromRuntimeConfig(cacheConfig);
|
|
59
|
+
};
|
|
60
|
+
const registerFromRuntimeConfig = async () => {
|
|
61
|
+
await dbLoader();
|
|
62
|
+
await queuesLoader();
|
|
63
|
+
await cachesLoader();
|
|
64
|
+
registerBroadcastersFromRuntimeConfig({
|
|
65
|
+
default: broadcastConfig.default,
|
|
66
|
+
drivers: broadcastConfig.drivers,
|
|
67
|
+
});
|
|
68
|
+
registerDisksFromRuntimeConfig(storageConfig);
|
|
69
|
+
registerNotificationChannelsFromRuntimeConfig({
|
|
70
|
+
default: notificationConfig.default,
|
|
71
|
+
drivers: notificationConfig.drivers,
|
|
72
|
+
});
|
|
73
|
+
};
|
|
74
|
+
/**
|
|
75
|
+
* Helper: Register ConnectionManager shutdown hook
|
|
76
|
+
*/
|
|
77
|
+
const registerConnectionManagerHook = (shutdownManager) => {
|
|
78
|
+
shutdownManager.add(async () => {
|
|
79
|
+
try {
|
|
80
|
+
const mod = await import('../../orm/ConnectionManager.js');
|
|
81
|
+
await mod.ConnectionManager.shutdownIfInitialized();
|
|
82
|
+
}
|
|
83
|
+
catch {
|
|
84
|
+
/* ignore import failures in restrictive runtimes */
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
};
|
|
88
|
+
/**
|
|
89
|
+
* Helper: Register Database reset hook
|
|
90
|
+
*/
|
|
91
|
+
const registerDatabaseResetHook = (shutdownManager) => {
|
|
92
|
+
shutdownManager.add(async () => {
|
|
93
|
+
try {
|
|
94
|
+
const mod = await import('../../orm/Database.js');
|
|
95
|
+
mod.resetDatabase();
|
|
96
|
+
}
|
|
97
|
+
catch {
|
|
98
|
+
/* ignore import failures in restrictive runtimes */
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
|
+
};
|
|
102
|
+
/**
|
|
103
|
+
* Helper: Register generic reset hook for modules with reset() method
|
|
104
|
+
*/
|
|
105
|
+
const registerResetHook = (shutdownManager, modulePath, exportName) => {
|
|
106
|
+
shutdownManager.add(async () => {
|
|
107
|
+
try {
|
|
108
|
+
const mod = (await import(modulePath));
|
|
109
|
+
const resetModule = mod[exportName];
|
|
110
|
+
if (resetModule?.reset) {
|
|
111
|
+
resetModule.reset();
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
catch {
|
|
115
|
+
/* ignore import failures in restrictive runtimes */
|
|
116
|
+
}
|
|
117
|
+
});
|
|
118
|
+
};
|
|
119
|
+
/**
|
|
120
|
+
* Helper: Register FileLogWriter flush hook
|
|
121
|
+
*/
|
|
122
|
+
const registerFileLogFlushHook = (shutdownManager) => {
|
|
123
|
+
shutdownManager.add(async () => {
|
|
124
|
+
try {
|
|
125
|
+
const mod = await import('../../config/FileLogWriter.js');
|
|
126
|
+
mod.FileLogWriter.flush();
|
|
127
|
+
}
|
|
128
|
+
catch {
|
|
129
|
+
/* ignore import failures in restrictive runtimes */
|
|
130
|
+
}
|
|
131
|
+
});
|
|
132
|
+
};
|
|
133
|
+
export const registerFrameworkShutdownHooks = (shutdownManager) => {
|
|
134
|
+
// Register framework-level shutdown hooks for long-lived resources
|
|
135
|
+
registerConnectionManagerHook(shutdownManager);
|
|
136
|
+
// Ensure worker management system is asked to shutdown BEFORE databases are reset
|
|
137
|
+
registerWorkerShutdownHook(shutdownManager);
|
|
138
|
+
// Database and cache reset
|
|
139
|
+
registerDatabaseResetHook(shutdownManager);
|
|
140
|
+
registerResetHook(shutdownManager, '@cache/Cache', 'Cache');
|
|
141
|
+
// File logging
|
|
142
|
+
registerFileLogFlushHook(shutdownManager);
|
|
143
|
+
// Registry resets
|
|
144
|
+
registerResetHook(shutdownManager, '@broadcast/BroadcastRegistry', 'BroadcastRegistry');
|
|
145
|
+
registerResetHook(shutdownManager, '@storage/StorageDiskRegistry', 'StorageDiskRegistry');
|
|
146
|
+
registerResetHook(shutdownManager, '@notification/NotificationChannelRegistry', 'NotificationChannelRegistry');
|
|
147
|
+
registerResetHook(shutdownManager, '@mail/MailDriverRegistry', 'MailDriverRegistry');
|
|
148
|
+
registerResetHook(shutdownManager, '@tools/queue/Queue', 'Queue');
|
|
149
|
+
};
|
|
150
|
+
const initializeArtifactDirectories = async (resolvedBasePath) => {
|
|
151
|
+
if (resolvedBasePath === '')
|
|
152
|
+
return;
|
|
153
|
+
if (typeof process === 'undefined')
|
|
154
|
+
return;
|
|
155
|
+
const globalAny = globalThis;
|
|
156
|
+
if (globalAny.CF !== undefined)
|
|
157
|
+
return;
|
|
158
|
+
if (typeof globalAny.WebSocketPair === 'function')
|
|
159
|
+
return;
|
|
160
|
+
if (globalAny.caches !== undefined)
|
|
161
|
+
return;
|
|
162
|
+
let nodeFs;
|
|
163
|
+
try {
|
|
164
|
+
nodeFs = await import('../../node-singletons/fs.js');
|
|
165
|
+
}
|
|
166
|
+
catch {
|
|
167
|
+
return;
|
|
168
|
+
}
|
|
169
|
+
const dirs = ['logs', 'storage', 'tmp'];
|
|
170
|
+
for (const dir of dirs) {
|
|
171
|
+
const fullPath = path.join(resolvedBasePath, dir);
|
|
172
|
+
try {
|
|
173
|
+
if (!nodeFs.existsSync(fullPath)) {
|
|
174
|
+
nodeFs.mkdirSync(fullPath, { recursive: true });
|
|
175
|
+
Logger.info(`✓ Created directory: ${dir}`);
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
catch (error) {
|
|
179
|
+
Logger.warn(`Failed to create ${dir} directory`, error);
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
};
|
|
183
|
+
const extractRedisConfigFromQueueConfig = () => {
|
|
184
|
+
const redisConfig = queueConfig.drivers?.redis ?? {};
|
|
185
|
+
const redisHost = typeof redisConfig['host'] === 'string' ? redisConfig['host'] : '127.0.0.1';
|
|
186
|
+
const redisPort = typeof redisConfig['port'] === 'number' && Number.isFinite(redisConfig['port'])
|
|
187
|
+
? redisConfig['port']
|
|
188
|
+
: 6379;
|
|
189
|
+
const redisPassword = typeof redisConfig['password'] === 'string' ? redisConfig['password'] : '';
|
|
190
|
+
const redisDb = typeof redisConfig['database'] === 'number' && Number.isFinite(redisConfig['database'])
|
|
191
|
+
? redisConfig['database']
|
|
192
|
+
: 0;
|
|
193
|
+
return {
|
|
194
|
+
host: redisHost,
|
|
195
|
+
port: redisPort,
|
|
196
|
+
password: redisPassword,
|
|
197
|
+
db: redisDb,
|
|
198
|
+
};
|
|
199
|
+
};
|
|
200
|
+
const loadAndValidateQueueMonitorModule = async () => {
|
|
201
|
+
let workersModule;
|
|
202
|
+
try {
|
|
203
|
+
workersModule = (await loadQueueMonitorModule());
|
|
204
|
+
}
|
|
205
|
+
catch (error) {
|
|
206
|
+
Logger.warn('Failed to load Queue Monitor module', error);
|
|
207
|
+
return null;
|
|
208
|
+
}
|
|
209
|
+
if (!workersModule || !('QueueMonitor' in workersModule)) {
|
|
210
|
+
Logger.warn('Queue Monitor module not available');
|
|
211
|
+
return null;
|
|
212
|
+
}
|
|
213
|
+
const queueMonitorModule = workersModule;
|
|
214
|
+
const { QueueMonitor } = queueMonitorModule;
|
|
215
|
+
if (QueueMonitor === undefined || typeof QueueMonitor.create !== 'function') {
|
|
216
|
+
Logger.warn('Queue Monitor module does not expose QueueMonitor.create');
|
|
217
|
+
return null;
|
|
218
|
+
}
|
|
219
|
+
return queueMonitorModule;
|
|
220
|
+
};
|
|
221
|
+
const initializeQueueMonitor = async (router) => {
|
|
222
|
+
const runQueueConfig = await loadRuntimeQueueConfig();
|
|
223
|
+
const monitorConfig = runQueueConfig?.monitor;
|
|
224
|
+
if (monitorConfig === undefined) {
|
|
225
|
+
return;
|
|
226
|
+
}
|
|
227
|
+
if (monitorConfig.enabled === false) {
|
|
228
|
+
return;
|
|
229
|
+
}
|
|
230
|
+
const queueMonitorModule = await loadAndValidateQueueMonitorModule();
|
|
231
|
+
if (queueMonitorModule === null) {
|
|
232
|
+
Logger.debug('Queue Monitor is enabled in configuration but module failed to load or is invalid. Skipping Queue Monitor initialization.');
|
|
233
|
+
return;
|
|
234
|
+
}
|
|
235
|
+
const redisConfig = extractRedisConfigFromQueueConfig();
|
|
236
|
+
const { QueueMonitor } = queueMonitorModule;
|
|
237
|
+
const monitor = QueueMonitor.create({
|
|
238
|
+
...monitorConfig,
|
|
239
|
+
redis: redisConfig,
|
|
240
|
+
});
|
|
241
|
+
try {
|
|
242
|
+
monitor.registerRoutes(router);
|
|
243
|
+
}
|
|
244
|
+
catch (error) {
|
|
245
|
+
Logger.error('Failed to register Queue Monitor routes', error);
|
|
246
|
+
}
|
|
247
|
+
Logger.info(`Queue Monitor routes registered at http://127.0.0.1:${appConfig.port}${monitorConfig.basePath ?? ''}`);
|
|
248
|
+
Logger.info(`Queue Monitor enqueue endpoint at http://127.0.0.1:${appConfig.port}/test/enqueue`);
|
|
249
|
+
};
|
|
250
|
+
const initializeWorkers = async (router) => {
|
|
251
|
+
const workers = await loadWorkersModule();
|
|
252
|
+
if (workers?.WorkerInit !== undefined && typeof workers.registerWorkerRoutes === 'function') {
|
|
253
|
+
workers.registerWorkerRoutes(router, undefined, { middleware: undefined });
|
|
254
|
+
}
|
|
255
|
+
};
|
|
256
|
+
const resolveLocalQueueRedisEntry = () => {
|
|
257
|
+
if (typeof process === 'undefined' || typeof process.cwd !== 'function')
|
|
258
|
+
return null;
|
|
259
|
+
const cwd = process.cwd();
|
|
260
|
+
if (cwd.trim() === '')
|
|
261
|
+
return null;
|
|
262
|
+
const localEntry = path.join(cwd, 'dist', 'packages', 'queue-redis', 'src', 'index.js');
|
|
263
|
+
return existsSync(localEntry) ? localEntry : null;
|
|
264
|
+
};
|
|
265
|
+
const loadQueueHttpGatewayModule = async () => {
|
|
266
|
+
try {
|
|
267
|
+
return (await import('@zintrust/queue-redis'));
|
|
268
|
+
}
|
|
269
|
+
catch {
|
|
270
|
+
const localEntry = resolveLocalQueueRedisEntry();
|
|
271
|
+
if (localEntry === null)
|
|
272
|
+
return undefined;
|
|
273
|
+
const url = pathToFileURL(localEntry).href;
|
|
274
|
+
return (await import(url));
|
|
275
|
+
}
|
|
276
|
+
};
|
|
277
|
+
const initializeQueueHttpGateway = async (router) => {
|
|
278
|
+
try {
|
|
279
|
+
const module = await loadQueueHttpGatewayModule();
|
|
280
|
+
if (module === undefined) {
|
|
281
|
+
Logger.warn('Queue HTTP gateway module is unavailable (@zintrust/queue-redis not found)');
|
|
282
|
+
return;
|
|
283
|
+
}
|
|
284
|
+
if (module.QueueHttpGateway === undefined ||
|
|
285
|
+
typeof module.QueueHttpGateway.create !== 'function') {
|
|
286
|
+
Logger.warn('Queue HTTP gateway module does not expose QueueHttpGateway.create');
|
|
287
|
+
return;
|
|
288
|
+
}
|
|
289
|
+
module.QueueHttpGateway.create().registerRoutes(router);
|
|
290
|
+
Logger.info('Queue HTTP gateway route registered at /api/_sys/queue/rpc');
|
|
291
|
+
}
|
|
292
|
+
catch (error) {
|
|
293
|
+
Logger.warn('Failed to register Queue HTTP gateway routes', error);
|
|
294
|
+
}
|
|
295
|
+
};
|
|
296
|
+
export const createLifecycle = (params) => {
|
|
297
|
+
const boot = async () => {
|
|
298
|
+
if (params.getBooted())
|
|
299
|
+
return;
|
|
300
|
+
Logger.info(`🚀 Booting ZinTrust Application in ${params.environment} mode...`);
|
|
301
|
+
if (params.environment === 'development') {
|
|
302
|
+
// Clear config registry cache to ensure fresh config loading in watch mode
|
|
303
|
+
// This fixes the issue where config/middleware.ts changes are ignored in watch mode
|
|
304
|
+
StartupConfigFileRegistry.clear();
|
|
305
|
+
}
|
|
306
|
+
StartupConfigValidator.assertValid();
|
|
307
|
+
// Preload project-owned config overrides that must be available synchronously.
|
|
308
|
+
await StartupConfigFileRegistry.preload([
|
|
309
|
+
StartupConfigFile.Middleware,
|
|
310
|
+
StartupConfigFile.Cache,
|
|
311
|
+
StartupConfigFile.Database,
|
|
312
|
+
StartupConfigFile.Queue,
|
|
313
|
+
StartupConfigFile.Storage,
|
|
314
|
+
StartupConfigFile.Mail,
|
|
315
|
+
StartupConfigFile.Broadcast,
|
|
316
|
+
StartupConfigFile.Notification,
|
|
317
|
+
]);
|
|
318
|
+
FeatureFlags.initialize();
|
|
319
|
+
await StartupHealthChecks.assertHealthy();
|
|
320
|
+
await registerFromRuntimeConfig();
|
|
321
|
+
await initializeArtifactDirectories(params.resolvedBasePath);
|
|
322
|
+
await registerMasterRoutes(params.resolvedBasePath, params.router);
|
|
323
|
+
if (Cloudflare.getWorkersEnv() === null && appConfig.dockerWorker === false) {
|
|
324
|
+
await initializeWorkers(params.router);
|
|
325
|
+
await initializeQueueMonitor(params.router);
|
|
326
|
+
await initializeQueueHttpGateway(params.router);
|
|
327
|
+
}
|
|
328
|
+
// Register service providers
|
|
329
|
+
// Bootstrap services
|
|
330
|
+
Logger.info('✅ Application booted successfully');
|
|
331
|
+
params.setBooted(true);
|
|
332
|
+
};
|
|
333
|
+
const shutdown = async () => {
|
|
334
|
+
Logger.info('🛑 Shutting down application...');
|
|
335
|
+
try {
|
|
336
|
+
await params.shutdownManager.run();
|
|
337
|
+
}
|
|
338
|
+
catch (error) {
|
|
339
|
+
Logger.error('Shutdown hook failed:', error);
|
|
340
|
+
}
|
|
341
|
+
// Ensure FileLogWriter.flush is attempted even if dynamic registration failed.
|
|
342
|
+
try {
|
|
343
|
+
const fileLogWriter = await tryImportOptional('@config/FileLogWriter');
|
|
344
|
+
fileLogWriter?.FileLogWriter?.flush?.();
|
|
345
|
+
}
|
|
346
|
+
catch {
|
|
347
|
+
/* best-effort */
|
|
348
|
+
}
|
|
349
|
+
params.setBooted(false);
|
|
350
|
+
Logger.info('✅ Application shut down successfully');
|
|
351
|
+
};
|
|
352
|
+
return { boot, shutdown };
|
|
353
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { IMiddlewareStack } from '../../middleware';
|
|
2
|
+
import type { IServiceContainer } from '../../container/ServiceContainer';
|
|
3
|
+
import type { IRouter } from '../../routes/Router';
|
|
4
|
+
export interface IApplication {
|
|
5
|
+
boot(): Promise<void>;
|
|
6
|
+
shutdown(): Promise<void>;
|
|
7
|
+
isBooted(): boolean;
|
|
8
|
+
isDevelopment(): boolean;
|
|
9
|
+
isProduction(): boolean;
|
|
10
|
+
isTesting(): boolean;
|
|
11
|
+
getEnvironment(): string;
|
|
12
|
+
getRouter(): IRouter;
|
|
13
|
+
getContainer(): IServiceContainer;
|
|
14
|
+
getMiddlewareStack(): IMiddlewareStack;
|
|
15
|
+
getBasePath(): string;
|
|
16
|
+
}
|
|
17
|
+
export type RoutesModule = {
|
|
18
|
+
registerRoutes?: (r: IRouter) => void;
|
|
19
|
+
};
|
|
20
|
+
export type ShutdownHook = () => void | Promise<void>;
|
|
21
|
+
export interface IShutdownManager {
|
|
22
|
+
add(hook: ShutdownHook): void;
|
|
23
|
+
run(): Promise<void>;
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=type.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"type.d.ts","sourceRoot":"","sources":["../../../../src/boot/registry/type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAEnD,MAAM,WAAW,YAAY;IAC3B,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACtB,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1B,QAAQ,IAAI,OAAO,CAAC;IACpB,aAAa,IAAI,OAAO,CAAC;IACzB,YAAY,IAAI,OAAO,CAAC;IACxB,SAAS,IAAI,OAAO,CAAC;IACrB,cAAc,IAAI,MAAM,CAAC;IACzB,SAAS,IAAI,OAAO,CAAC;IACrB,YAAY,IAAI,iBAAiB,CAAC;IAClC,kBAAkB,IAAI,gBAAgB,CAAC;IACvC,WAAW,IAAI,MAAM,CAAC;CACvB;AAED,MAAM,MAAM,YAAY,GAAG;IAAE,cAAc,CAAC,EAAE,CAAC,CAAC,EAAE,OAAO,KAAK,IAAI,CAAA;CAAE,CAAC;AAErE,MAAM,MAAM,YAAY,GAAG,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;AAEtD,MAAM,WAAW,gBAAgB;IAC/B,GAAG,CAAC,IAAI,EAAE,YAAY,GAAG,IAAI,CAAC;IAC9B,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACtB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"worker.d.ts","sourceRoot":"","sources":["../../../../src/boot/registry/worker.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAGvD;;GAEG;AACH,eAAO,MAAM,0BAA0B,GACrC,iBAAiB,gBAAgB,KAChC,OAAO,CAAC,IAAI,CA0Cd,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { appConfig } from '../../config/app.js';
|
|
2
|
+
import { Env } from '../../config/env.js';
|
|
3
|
+
import { loadWorkersModule } from '../../runtime/WorkersModule.js';
|
|
4
|
+
/**
|
|
5
|
+
* Helper: Register Worker management system shutdown hook
|
|
6
|
+
*/
|
|
7
|
+
export const registerWorkerShutdownHook = async (shutdownManager) => {
|
|
8
|
+
if (Env.getBool('WORKER_SHUTDOWN_ON_APP_EXIT', true) === false ||
|
|
9
|
+
appConfig.dockerWorker === true) {
|
|
10
|
+
return Promise.resolve(); // NOSONAR - Skip worker shutdown hook registration
|
|
11
|
+
}
|
|
12
|
+
// Ensure worker management system is asked to shutdown BEFORE databases are reset.
|
|
13
|
+
// This prevents workers from trying to access DB connections that have already
|
|
14
|
+
// been closed by subsequent shutdown hooks.
|
|
15
|
+
shutdownManager.add(async () => {
|
|
16
|
+
try {
|
|
17
|
+
const mod = (await loadWorkersModule());
|
|
18
|
+
const isShuttingDown = typeof mod.WorkerShutdown.isShuttingDown === 'function'
|
|
19
|
+
? mod.WorkerShutdown.isShuttingDown()
|
|
20
|
+
: (mod.WorkerShutdown.getShutdownState?.().isShuttingDown ?? false);
|
|
21
|
+
const completedAt = mod.WorkerShutdown.getShutdownState?.().completedAt ?? null;
|
|
22
|
+
if (isShuttingDown || completedAt !== null)
|
|
23
|
+
return;
|
|
24
|
+
await mod.WorkerShutdown.shutdown({
|
|
25
|
+
signal: 'APP_SHUTDOWN',
|
|
26
|
+
timeout: 5000,
|
|
27
|
+
forceExit: false,
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
catch {
|
|
31
|
+
/* ignore import failures in restrictive runtimes */
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
return Promise.resolve(); // NOSONAR
|
|
35
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"KVRemoteDriver.d.ts","sourceRoot":"","sources":["../../../../src/cache/drivers/KVRemoteDriver.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"KVRemoteDriver.d.ts","sourceRoot":"","sources":["../../../../src/cache/drivers/KVRemoteDriver.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAiCtD,eAAO,MAAM,cAAc;cACf,WAAW;EAkErB,CAAC;AAEH,eAAe,cAAc,CAAC"}
|
|
@@ -6,13 +6,25 @@
|
|
|
6
6
|
import { RemoteSignedJson } from '../../common/RemoteSignedJson.js';
|
|
7
7
|
import { Env } from '../../config/env.js';
|
|
8
8
|
import { Logger } from '../../config/logger.js';
|
|
9
|
+
const resolveSigningPrefix = (baseUrl) => {
|
|
10
|
+
try {
|
|
11
|
+
const parsed = new URL(baseUrl);
|
|
12
|
+
const path = parsed.pathname.endsWith('/') ? parsed.pathname.slice(0, -1) : parsed.pathname;
|
|
13
|
+
if (path === '' || path === '/')
|
|
14
|
+
return undefined;
|
|
15
|
+
return path;
|
|
16
|
+
}
|
|
17
|
+
catch {
|
|
18
|
+
return undefined;
|
|
19
|
+
}
|
|
20
|
+
};
|
|
9
21
|
const normalizeNamespace = (defaultNamespace) => defaultNamespace.trim() === '' ? undefined : defaultNamespace;
|
|
10
22
|
export const KVRemoteDriver = Object.freeze({
|
|
11
23
|
create() {
|
|
12
24
|
const settings = {
|
|
13
25
|
baseUrl: Env.get('KV_REMOTE_URL'),
|
|
14
26
|
keyId: Env.get('KV_REMOTE_KEY_ID'),
|
|
15
|
-
secret: Env.get('KV_REMOTE_SECRET'),
|
|
27
|
+
secret: Env.get('KV_REMOTE_SECRET', Env.APP_KEY),
|
|
16
28
|
defaultNamespace: Env.get('KV_REMOTE_NAMESPACE'),
|
|
17
29
|
timeoutMs: Env.getInt('ZT_PROXY_TIMEOUT_MS', Env.REQUEST_TIMEOUT),
|
|
18
30
|
};
|
|
@@ -21,6 +33,7 @@ export const KVRemoteDriver = Object.freeze({
|
|
|
21
33
|
keyId: settings.keyId,
|
|
22
34
|
secret: settings.secret,
|
|
23
35
|
timeoutMs: settings.timeoutMs,
|
|
36
|
+
signaturePathPrefixToStrip: resolveSigningPrefix(settings.baseUrl),
|
|
24
37
|
missingUrlMessage: 'KV remote proxy URL is missing (KV_REMOTE_URL)',
|
|
25
38
|
missingCredentialsMessage: 'KV remote signing credentials are missing (KV_REMOTE_KEY_ID / KV_REMOTE_SECRET)',
|
|
26
39
|
messages: {
|
package/src/cli/CLI.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CLI.d.ts","sourceRoot":"","sources":["../../../src/cli/CLI.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"CLI.d.ts","sourceRoot":"","sources":["../../../src/cli/CLI.ts"],"names":[],"mappings":"AAAA;;;GAGG;AA2DH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,MAAM,WAAW,IAAI;IACnB,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACnC,UAAU,IAAI,OAAO,CAAC;CACvB;AAiPD;;;;;;;GAOG;AACH,eAAO,MAAM,GAAG;cACJ,IAAI;EAed,CAAC"}
|
package/src/cli/CLI.js
CHANGED
|
@@ -5,28 +5,45 @@
|
|
|
5
5
|
import { AddCommand } from './commands/AddCommand.js';
|
|
6
6
|
import { BroadcastWorkCommand } from './commands/BroadcastWorkCommand.js';
|
|
7
7
|
import { ConfigCommand } from './commands/ConfigCommand.js';
|
|
8
|
+
import { ContainerProxiesCommand } from './commands/ContainerProxiesCommand.js';
|
|
9
|
+
import { ContainerWorkersCommand } from './commands/ContainerWorkersCommand.js';
|
|
8
10
|
import { AddMigrationCommand, CreateCommand, CreateMigrationCommand, } from './commands/CreateCommand.js';
|
|
9
11
|
import { D1MigrateCommand } from './commands/D1MigrateCommand.js';
|
|
10
12
|
import { DbSeedCommand } from './commands/DbSeedCommand.js';
|
|
11
13
|
import { DebugCommand } from './commands/DebugCommand.js';
|
|
14
|
+
import { DeployCommand } from './commands/DeployCommand.js';
|
|
15
|
+
import { DeployContainerProxiesCommand } from './commands/DeployContainerProxiesCommand.js';
|
|
16
|
+
import { DeployContainerWorkersCommand } from './commands/DeployContainerWorkersCommand.js';
|
|
17
|
+
import { DoctorArchitectureCommand } from './commands/DoctorArchitectureCommand.js';
|
|
12
18
|
import { FixCommand } from './commands/FixCommand.js';
|
|
19
|
+
import { InitContainerCommand } from './commands/InitContainerCommand.js';
|
|
20
|
+
import { InitProducerCommand } from './commands/InitProducerCommand.js';
|
|
21
|
+
import { InitProxyCommand } from './commands/InitProxyCommand.js';
|
|
13
22
|
import { JwtDevCommand } from './commands/JwtDevCommand.js';
|
|
14
23
|
import { KeyGenerateCommand } from './commands/KeyGenerateCommand.js';
|
|
15
24
|
import { MakeMailTemplateCommand } from './commands/MakeMailTemplateCommand.js';
|
|
16
25
|
import { MakeNotificationTemplateCommand } from './commands/MakeNotificationTemplateCommand.js';
|
|
17
26
|
import { MigrateCommand } from './commands/MigrateCommand.js';
|
|
18
27
|
import { MigrateWorkerCommand } from './commands/MigrateWorkerCommand.js';
|
|
28
|
+
import { MongoDBProxyCommand } from './commands/MongoDBProxyCommand.js';
|
|
29
|
+
import { MySqlProxyCommand } from './commands/MySqlProxyCommand.js';
|
|
19
30
|
import { NewCommand } from './commands/NewCommand.js';
|
|
20
31
|
import { NotificationWorkCommand } from './commands/NotificationWorkCommand.js';
|
|
21
32
|
import { PluginCommand } from './commands/PluginCommand.js';
|
|
33
|
+
import { PostgresProxyCommand } from './commands/PostgresProxyCommand.js';
|
|
22
34
|
import { PrepareCommand } from './commands/PrepareCommand.js';
|
|
35
|
+
import { ProxyCommand } from './commands/ProxyCommand.js';
|
|
23
36
|
import { PublishCommand } from './commands/PublishCommand.js';
|
|
24
37
|
import { QACommand } from './commands/QACommand.js';
|
|
25
38
|
import { QueueCommand } from './commands/QueueCommand.js';
|
|
39
|
+
import { QueueRecoveryCommand } from './commands/QueueRecoveryCommand.js';
|
|
40
|
+
import { RedisProxyCommand } from './commands/RedisProxyCommand.js';
|
|
26
41
|
import { ResourceControlCommand } from './commands/ResourceControlCommand.js';
|
|
27
42
|
import { RoutesCommand } from './commands/RoutesCommand.js';
|
|
28
43
|
import { SecretsCommand } from './commands/SecretsCommand.js';
|
|
29
44
|
import { SimulateCommand } from './commands/SimulateCommand.js';
|
|
45
|
+
import { SmtpProxyCommand } from './commands/SmtpProxyCommand.js';
|
|
46
|
+
import { SqlServerProxyCommand } from './commands/SqlServerProxyCommand.js';
|
|
30
47
|
import { StartCommand } from './commands/StartCommand.js';
|
|
31
48
|
import { TemplatesCommand } from './commands/TemplatesCommand.js';
|
|
32
49
|
import { UpgradeCommand } from './commands/UpgradeCommand.js';
|
|
@@ -40,48 +57,28 @@ import { readFileSync } from '../node-singletons/fs.js';
|
|
|
40
57
|
import { join } from '../node-singletons/path.js';
|
|
41
58
|
import { Command } from 'commander';
|
|
42
59
|
const __dirname = esmDirname(import.meta.url);
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
const packagePath = join(__dirname, '../../package.json');
|
|
49
|
-
const packageJson = JSON.parse(readFileSync(packagePath, 'utf-8'));
|
|
50
|
-
return typeof packageJson.version === 'string' ? packageJson.version : '1.0.0';
|
|
51
|
-
}
|
|
52
|
-
catch (error) {
|
|
53
|
-
ErrorFactory.createCliError('Failed to load version from package.json', error);
|
|
54
|
-
// Use default version if package.json not found
|
|
55
|
-
return '1.0.0';
|
|
56
|
-
}
|
|
57
|
-
};
|
|
58
|
-
/**
|
|
59
|
-
* Setup program metadata
|
|
60
|
-
*/
|
|
61
|
-
const setupProgram = (program, version) => {
|
|
62
|
-
program
|
|
63
|
-
.name('zintrust')
|
|
64
|
-
.description('ZinTrust Framework CLI - Build production-grade TypeScript APIs')
|
|
65
|
-
.version(version, '-v, --version', 'Output version number')
|
|
66
|
-
.helpOption('-h, --help', 'Display help for command')
|
|
67
|
-
.usage('[command] [options]');
|
|
68
|
-
// Global error handling
|
|
69
|
-
program.exitOverride();
|
|
60
|
+
const isCommandProvider = (command) => {
|
|
61
|
+
return (typeof command === 'object' &&
|
|
62
|
+
command !== null &&
|
|
63
|
+
'getCommand' in command &&
|
|
64
|
+
typeof command.getCommand === 'function');
|
|
70
65
|
};
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
*/
|
|
74
|
-
const registerCommands = (program) => {
|
|
75
|
-
const commands = [
|
|
66
|
+
const buildCommandRegistry = () => {
|
|
67
|
+
return [
|
|
76
68
|
NewCommand.create(),
|
|
77
69
|
UpgradeCommand.create(),
|
|
78
70
|
PrepareCommand,
|
|
71
|
+
InitContainerCommand.create(),
|
|
72
|
+
InitProxyCommand.create(),
|
|
73
|
+
InitProducerCommand.create(),
|
|
74
|
+
DoctorArchitectureCommand.create(),
|
|
79
75
|
AddCommand.create(),
|
|
80
76
|
CreateCommand.create(),
|
|
81
77
|
CreateMigrationCommand.create(),
|
|
82
78
|
AddMigrationCommand.create(),
|
|
83
79
|
StartCommand.create(),
|
|
84
80
|
QueueCommand.create(),
|
|
81
|
+
QueueRecoveryCommand.create(),
|
|
85
82
|
BroadcastWorkCommand.create(),
|
|
86
83
|
NotificationWorkCommand.create(),
|
|
87
84
|
ResourceControlCommand,
|
|
@@ -92,8 +89,13 @@ const registerCommands = (program) => {
|
|
|
92
89
|
DebugCommand.create(),
|
|
93
90
|
SecretsCommand.create(),
|
|
94
91
|
ConfigCommand.create(),
|
|
92
|
+
ContainerWorkersCommand.create(),
|
|
93
|
+
ContainerProxiesCommand.create(),
|
|
95
94
|
PluginCommand.create(),
|
|
96
95
|
PublishCommand.create(),
|
|
96
|
+
DeployCommand.create(),
|
|
97
|
+
DeployContainerWorkersCommand.create(),
|
|
98
|
+
DeployContainerProxiesCommand.create(),
|
|
97
99
|
QACommand(),
|
|
98
100
|
FixCommand.create(),
|
|
99
101
|
KeyGenerateCommand.create(),
|
|
@@ -103,16 +105,62 @@ const registerCommands = (program) => {
|
|
|
103
105
|
MakeNotificationTemplateCommand.create(),
|
|
104
106
|
RoutesCommand.create(),
|
|
105
107
|
JwtDevCommand,
|
|
106
|
-
|
|
108
|
+
ProxyCommand.create(),
|
|
109
|
+
MySqlProxyCommand.create(),
|
|
110
|
+
PostgresProxyCommand.create(),
|
|
111
|
+
MongoDBProxyCommand.create(),
|
|
112
|
+
SqlServerProxyCommand.create(),
|
|
113
|
+
RedisProxyCommand.create(),
|
|
114
|
+
SmtpProxyCommand.create(),
|
|
107
115
|
WorkerCommands.createWorkerListCommand(),
|
|
108
116
|
WorkerCommands.createWorkerStatusCommand(),
|
|
109
117
|
WorkerCommands.createWorkerStartCommand(),
|
|
118
|
+
WorkerCommands.createWorkerStartAllCommand(),
|
|
110
119
|
WorkerCommands.createWorkerStopCommand(),
|
|
111
120
|
WorkerCommands.createWorkerRestartCommand(),
|
|
112
121
|
WorkerCommands.createWorkerSummaryCommand(),
|
|
113
122
|
];
|
|
123
|
+
};
|
|
124
|
+
/**
|
|
125
|
+
* Load version from package.json
|
|
126
|
+
*/
|
|
127
|
+
const loadVersion = () => {
|
|
128
|
+
try {
|
|
129
|
+
const packagePath = join(__dirname, '../../package.json');
|
|
130
|
+
const packageJson = JSON.parse(readFileSync(packagePath, 'utf-8'));
|
|
131
|
+
return typeof packageJson.version === 'string' ? packageJson.version : '1.0.0';
|
|
132
|
+
}
|
|
133
|
+
catch (error) {
|
|
134
|
+
ErrorFactory.createCliError('Failed to load version from package.json', error);
|
|
135
|
+
// Use default version if package.json not found
|
|
136
|
+
return '1.0.0';
|
|
137
|
+
}
|
|
138
|
+
};
|
|
139
|
+
/**
|
|
140
|
+
* Setup program metadata
|
|
141
|
+
*/
|
|
142
|
+
const setupProgram = (program, version) => {
|
|
143
|
+
program
|
|
144
|
+
.name('zintrust')
|
|
145
|
+
.description('ZinTrust Framework CLI - Build production-grade TypeScript APIs')
|
|
146
|
+
.version(version, '-v, --version', 'Output version number')
|
|
147
|
+
.helpOption('-h, --help', 'Display help for command')
|
|
148
|
+
.usage('[command] [options]');
|
|
149
|
+
// Global error handling
|
|
150
|
+
program.exitOverride();
|
|
151
|
+
};
|
|
152
|
+
/**
|
|
153
|
+
* Register all available commands
|
|
154
|
+
*/
|
|
155
|
+
const registerCommands = (program) => {
|
|
156
|
+
const commands = buildCommandRegistry();
|
|
114
157
|
for (const command of commands) {
|
|
115
|
-
|
|
158
|
+
if (isCommandProvider(command)) {
|
|
159
|
+
program.addCommand(command.getCommand());
|
|
160
|
+
}
|
|
161
|
+
else {
|
|
162
|
+
program.addCommand(command);
|
|
163
|
+
}
|
|
116
164
|
}
|
|
117
165
|
// Help command
|
|
118
166
|
program
|
package/src/cli/ErrorHandler.js
CHANGED
|
@@ -46,7 +46,7 @@ const displayBanner = (version) => {
|
|
|
46
46
|
const framework = 'ZinTrust Framework';
|
|
47
47
|
const bannerWidth = 46;
|
|
48
48
|
const env = Env.NODE_ENV ?? 'development';
|
|
49
|
-
const db = Env.DB_CONNECTION
|
|
49
|
+
const db = Env.DB_CONNECTION || 'sqlite';
|
|
50
50
|
const border = chalk.cyanBright;
|
|
51
51
|
const label = chalk.bold.white;
|
|
52
52
|
const frameworkValue = chalk.bold.cyanBright;
|