@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
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ErrorFactory } from '../exceptions/ZintrustError.js';
|
|
2
|
+
import { normalizeSigningCredentials } from '../proxy/SigningService.js';
|
|
2
3
|
import { SignedRequest } from '../security/SignedRequest.js';
|
|
3
4
|
const joinUrl = (baseUrl, path) => {
|
|
4
5
|
const u = new URL(baseUrl);
|
|
@@ -19,6 +20,13 @@ const asJson = async (resp) => {
|
|
|
19
20
|
return { message: text };
|
|
20
21
|
}
|
|
21
22
|
};
|
|
23
|
+
const normalizeSettings = (settings) => {
|
|
24
|
+
const creds = normalizeSigningCredentials({
|
|
25
|
+
keyId: settings.keyId,
|
|
26
|
+
secret: settings.secret,
|
|
27
|
+
});
|
|
28
|
+
return { ...settings, keyId: creds.keyId, secret: creds.secret };
|
|
29
|
+
};
|
|
22
30
|
const requireConfigured = (settings) => {
|
|
23
31
|
if (settings.baseUrl.trim() === '') {
|
|
24
32
|
throw ErrorFactory.createConfigError(settings.missingUrlMessage);
|
|
@@ -33,40 +41,58 @@ const createTimeoutSignal = (timeoutMs) => {
|
|
|
33
41
|
const timeout = AbortSignal.timeout;
|
|
34
42
|
return typeof timeout === 'function' ? timeout(timeoutMs) : undefined;
|
|
35
43
|
};
|
|
44
|
+
const buildSigningUrl = (url, settings) => {
|
|
45
|
+
const rawPrefix = settings.signaturePathPrefixToStrip?.trim() ?? '';
|
|
46
|
+
if (rawPrefix === '' || rawPrefix === '/') {
|
|
47
|
+
return new URL(url.toString());
|
|
48
|
+
}
|
|
49
|
+
const normalizedPrefix = rawPrefix.startsWith('/') ? rawPrefix : `/${rawPrefix}`;
|
|
50
|
+
const signingUrl = new URL(url.toString());
|
|
51
|
+
if (signingUrl.pathname === normalizedPrefix) {
|
|
52
|
+
signingUrl.pathname = '/';
|
|
53
|
+
return signingUrl;
|
|
54
|
+
}
|
|
55
|
+
if (signingUrl.pathname.startsWith(`${normalizedPrefix}/`)) {
|
|
56
|
+
signingUrl.pathname = signingUrl.pathname.slice(normalizedPrefix.length);
|
|
57
|
+
}
|
|
58
|
+
return signingUrl;
|
|
59
|
+
};
|
|
36
60
|
export const RemoteSignedJson = Object.freeze({
|
|
37
61
|
async request(settings, path, payload) {
|
|
38
|
-
|
|
39
|
-
|
|
62
|
+
const normalized = normalizeSettings(settings);
|
|
63
|
+
requireConfigured(normalized);
|
|
64
|
+
const url = joinUrl(normalized.baseUrl, path);
|
|
65
|
+
const signingUrl = buildSigningUrl(url, normalized);
|
|
40
66
|
const body = JSON.stringify(payload);
|
|
41
67
|
const signed = await SignedRequest.createHeaders({
|
|
42
68
|
method: 'POST',
|
|
43
|
-
url,
|
|
69
|
+
url: signingUrl,
|
|
44
70
|
body,
|
|
45
|
-
keyId:
|
|
46
|
-
secret:
|
|
71
|
+
keyId: normalized.keyId,
|
|
72
|
+
secret: normalized.secret,
|
|
47
73
|
});
|
|
48
74
|
try {
|
|
49
75
|
const resp = await fetch(url, {
|
|
50
76
|
method: 'POST',
|
|
51
77
|
headers: { 'Content-Type': 'application/json', ...signed },
|
|
52
78
|
body,
|
|
53
|
-
signal: createTimeoutSignal(
|
|
79
|
+
signal: createTimeoutSignal(normalized.timeoutMs),
|
|
54
80
|
});
|
|
55
81
|
if (!resp.ok) {
|
|
56
82
|
const details = await asJson(resp);
|
|
57
83
|
if (resp.status === 401) {
|
|
58
|
-
throw ErrorFactory.createUnauthorizedError(
|
|
84
|
+
throw ErrorFactory.createUnauthorizedError(normalized.messages.unauthorized, details);
|
|
59
85
|
}
|
|
60
86
|
if (resp.status === 403) {
|
|
61
|
-
throw ErrorFactory.createForbiddenError(
|
|
87
|
+
throw ErrorFactory.createForbiddenError(normalized.messages.forbidden, details);
|
|
62
88
|
}
|
|
63
89
|
if (resp.status === 429) {
|
|
64
|
-
throw ErrorFactory.createSecurityError(
|
|
90
|
+
throw ErrorFactory.createSecurityError(normalized.messages.rateLimited, details);
|
|
65
91
|
}
|
|
66
92
|
if (resp.status >= 400 && resp.status < 500) {
|
|
67
|
-
throw ErrorFactory.createValidationError(
|
|
93
|
+
throw ErrorFactory.createValidationError(normalized.messages.rejected, details);
|
|
68
94
|
}
|
|
69
|
-
throw ErrorFactory.createConnectionError(
|
|
95
|
+
throw ErrorFactory.createConnectionError(normalized.messages.error, {
|
|
70
96
|
status: resp.status,
|
|
71
97
|
details,
|
|
72
98
|
});
|
|
@@ -75,8 +101,8 @@ export const RemoteSignedJson = Object.freeze({
|
|
|
75
101
|
}
|
|
76
102
|
catch (error) {
|
|
77
103
|
if (error instanceof Error && error.name === 'AbortError') {
|
|
78
|
-
throw ErrorFactory.createConnectionError(
|
|
79
|
-
timeoutMs:
|
|
104
|
+
throw ErrorFactory.createConnectionError(normalized.messages.timedOut, {
|
|
105
|
+
timeoutMs: normalized.timeoutMs,
|
|
80
106
|
});
|
|
81
107
|
}
|
|
82
108
|
throw error;
|
package/src/common/index.d.ts
CHANGED
|
@@ -131,4 +131,5 @@ export declare const ensureDir: (dirPath: string) => void;
|
|
|
131
131
|
export declare const ensureDirSafe: (dirPath: string) => void;
|
|
132
132
|
export declare const readFile: (filePath: string) => string;
|
|
133
133
|
export declare const writeFile: (filePath: string, content: string, createDir?: boolean) => void;
|
|
134
|
+
export declare const runFromSource: () => boolean;
|
|
134
135
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/common/index.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAG5C,eAAO,MAAM,WAAW;qBACL,MAAM,GAAG,OAAO;CAOlC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,WAAW;IACtB;;OAEG;sBACe,MAAM;IAgBxB;;OAEG;IAEH;;OAEG;cACa,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAWtC;;OAEG;yBACkB,MAAM,GAAG,GAAG,GAAG,MAAM;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/common/index.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAG5C,eAAO,MAAM,WAAW;qBACL,MAAM,GAAG,OAAO;CAOlC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,WAAW;IACtB;;OAEG;sBACe,MAAM;IAgBxB;;OAEG;IAEH;;OAEG;cACa,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAWtC;;OAEG;yBACkB,MAAM,GAAG,GAAG,GAAG,MAAM;IAO1C;;OAEG;wBACiB,MAAM,GAAG,GAAG,GAAG,MAAM;IAKzC;;OAEG;IAEH;;OAEG;mBACY,MAAM,GAAG,MAAM;IAgB9B;;OAEG;qBACc,MAAM,GAAG,MAAM;IAUhC;;OAEG;sBACe,MAAM,GAAG,MAAM;IAQjC;;OAEG;IAEH;;OAEG;yBACkB,MAAM,GAAG,OAAO;IAIrC;;OAEG;uBACgB,MAAM,GAAG,IAAI;IAMhC;;OAEG;2BACoB,MAAM,GAAG,IAAI;IAQpC;;OAEG;uBACgB,MAAM,GAAG,MAAM;IAUlC;;OAEG;4BAC2B,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAWtD;;OAEG;wBACiB,MAAM,WAAW,MAAM,wBAAqB,IAAI;IAcpE;;OAEG;6BAC4B,MAAM,WAAW,MAAM,wBAAqB,OAAO,CAAC,IAAI,CAAC;IAexF;;OAEG;yBACkB,MAAM,GAAG,IAAI;IAYlC;;OAEG;IAEH;;OAEG;2BACoB,MAAM;IAI7B;;OAEG;2BACmB,IAAI,GAAgB,MAAM;IAIhD;;OAEG;8BACuB,MAAM,GAAG,IAAI;IAYvC;;OAEG;IAEH;;OAEG;+BACwB,OAAO,GAAG,MAAM;IAa3C;;OAEG;6BAEQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,kBAChB,MAAM,EAAE,WACf,MAAM,GACd,IAAI;IAWP;;OAEG;mBACY,OAAO,GAAG,OAAO;IAIhC;;OAEG;wBACiB,OAAO,aAAa,MAAM,GAAG,MAAM;IAOvD;;OAEG;wBACiB,OAAO,aAAa,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAOxE;;;OAGG;sCAC+B,MAAM,EAAE,GAAG,MAAM;EAgBnD,CAAC;AAGH,eAAO,MAAM,cAAc,QAAO,MAAsC,CAAC;AAEzE,eAAO,MAAM,KAAK,GAAU,IAAI,MAAM,KAAG,OAAO,CAAC,IAAI,CAA0B,CAAC;AAEhF,eAAO,MAAM,WAAW,GAAI,SAAS,MAAM,GAAG,GAAG,KAAG,MAA0C,CAAC;AAC/F,eAAO,MAAM,UAAU,GAAI,SAAS,MAAM,GAAG,GAAG,KAAG,MAAyC,CAAC;AAE7F,eAAO,MAAM,qBAAqB,GAAI,YAAY,MAAM,EAAE,KAAG,MAE5D,CAAC;AAEF,eAAO,MAAM,mBAAmB,GAAI,OAAO,OAAO,KAAG,MACb,CAAC;AAIzC,eAAO,MAAM,yBAAyB,GAAI,OAAO,OAAO,KAAG,MAM1D,CAAC;AAGF,eAAO,MAAM,UAAU,GAAI,UAAU,MAAM,KAAG,OAA2C,CAAC;AAC1F,eAAO,MAAM,SAAS,GAAI,SAAS,MAAM,KAAG,IAAsC,CAAC;AACnF,eAAO,MAAM,aAAa,GAAI,SAAS,MAAM,KAAG,IAA0C,CAAC;AAC3F,eAAO,MAAM,QAAQ,GAAI,UAAU,MAAM,KAAG,MAAwC,CAAC;AACrF,eAAO,MAAM,SAAS,GAAI,UAAU,MAAM,EAAE,SAAS,MAAM,EAAE,mBAAgB,KAAG,IAC3B,CAAC;AAEtD,eAAO,MAAM,aAAa,QAAO,OAIhC,CAAC"}
|
package/src/common/index.js
CHANGED
|
@@ -53,13 +53,20 @@ export const CommonUtils = Object.freeze({
|
|
|
53
53
|
* Resolve an ESM `import.meta.url` to a filesystem path.
|
|
54
54
|
*/
|
|
55
55
|
esmFilePath(metaUrl) {
|
|
56
|
+
if (metaUrl === undefined || metaUrl === null)
|
|
57
|
+
return '';
|
|
58
|
+
if (typeof metaUrl !== 'string' && !(metaUrl instanceof URL))
|
|
59
|
+
return '';
|
|
60
|
+
if (typeof metaUrl === 'string' && metaUrl.trim() === '')
|
|
61
|
+
return '';
|
|
56
62
|
return fileURLToPath(metaUrl);
|
|
57
63
|
},
|
|
58
64
|
/**
|
|
59
65
|
* Resolve an ESM `import.meta.url` to a filesystem directory.
|
|
60
66
|
*/
|
|
61
67
|
esmDirname(metaUrl) {
|
|
62
|
-
|
|
68
|
+
const resolved = this.esmFilePath(metaUrl);
|
|
69
|
+
return resolved === '' ? '' : path.dirname(resolved);
|
|
63
70
|
},
|
|
64
71
|
/**
|
|
65
72
|
* STRING UTILITIES
|
|
@@ -326,3 +333,7 @@ export const ensureDir = (dirPath) => CommonUtils.ensureDir(dirPath);
|
|
|
326
333
|
export const ensureDirSafe = (dirPath) => CommonUtils.ensureDirSafe(dirPath);
|
|
327
334
|
export const readFile = (filePath) => CommonUtils.readFile(filePath);
|
|
328
335
|
export const writeFile = (filePath, content, createDir = true) => CommonUtils.writeFile(filePath, content, createDir);
|
|
336
|
+
export const runFromSource = () => {
|
|
337
|
+
const runFromSourceEnv = process.env['ZINTRUST_RUN_FROM_SOURCE'] ?? '';
|
|
338
|
+
return runFromSourceEnv === '1' || runFromSourceEnv.toLowerCase() === 'true';
|
|
339
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileLogWriter.d.ts","sourceRoot":"","sources":["../../../src/config/FileLogWriter.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;
|
|
1
|
+
{"version":3,"file":"FileLogWriter.d.ts","sourceRoot":"","sources":["../../../src/config/FileLogWriter.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AA8GH,KAAK,gBAAgB,GAAG;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAiFF;;;GAGG;AACH,eAAO,MAAM,SAAS,GAAI,UAAU,gBAAgB,KAAG,MAAM,EAsB5D,CAAC;AA2EF,eAAO,MAAM,aAAa;gBACZ,MAAM,GAAG,IAAI;aAsChB,IAAI;EAQb,CAAC;AAEH,eAAe,aAAa,CAAC"}
|
|
@@ -11,7 +11,13 @@ import * as path from '../node-singletons/path.js';
|
|
|
11
11
|
// Write stream cache to avoid recreating streams
|
|
12
12
|
const streamCache = new Map();
|
|
13
13
|
const pendingWrites = new Map();
|
|
14
|
+
const isWorkersRuntime = () => {
|
|
15
|
+
const g = globalThis;
|
|
16
|
+
return g.CF !== undefined || g.caches !== undefined || g.WebSocketPair !== undefined;
|
|
17
|
+
};
|
|
14
18
|
const canUseWriteStreams = () => {
|
|
19
|
+
if (isWorkersRuntime())
|
|
20
|
+
return false;
|
|
15
21
|
try {
|
|
16
22
|
// Vitest's ESM module mocks can throw when accessing missing exports.
|
|
17
23
|
// Treat missing createWriteStream as "no stream support".
|
|
@@ -22,6 +28,8 @@ const canUseWriteStreams = () => {
|
|
|
22
28
|
}
|
|
23
29
|
};
|
|
24
30
|
const appendFileSafe = (logFile, content) => {
|
|
31
|
+
if (isWorkersRuntime())
|
|
32
|
+
return;
|
|
25
33
|
try {
|
|
26
34
|
// Some tests/mock environments provide only appendFileSync (no streams).
|
|
27
35
|
fs.appendFileSync(logFile, content);
|
|
@@ -221,16 +229,23 @@ const flushPendingWrites = (logFile) => {
|
|
|
221
229
|
pendingWrites.delete(logFile);
|
|
222
230
|
return;
|
|
223
231
|
}
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
232
|
+
try {
|
|
233
|
+
const stream = getOrCreateStream(logFile);
|
|
234
|
+
stream.write(lines, (error) => {
|
|
235
|
+
if (error !== null && error !== undefined) {
|
|
236
|
+
// Silent failure for best-effort logging
|
|
237
|
+
}
|
|
238
|
+
});
|
|
239
|
+
}
|
|
240
|
+
catch {
|
|
241
|
+
appendFileSafe(logFile, lines);
|
|
242
|
+
}
|
|
230
243
|
pendingWrites.delete(logFile);
|
|
231
244
|
};
|
|
232
245
|
export const FileLogWriter = Object.freeze({
|
|
233
246
|
write(line) {
|
|
247
|
+
if (isWorkersRuntime())
|
|
248
|
+
return;
|
|
234
249
|
const cwd = getCwdSafe();
|
|
235
250
|
if (cwd === '')
|
|
236
251
|
return;
|
package/src/config/app.d.ts
CHANGED
|
@@ -42,6 +42,10 @@ export declare const appConfig: Readonly<{
|
|
|
42
42
|
* Application debug mode
|
|
43
43
|
*/
|
|
44
44
|
readonly debug: boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Indicates if the application is running inside a Docker worker container
|
|
47
|
+
*/
|
|
48
|
+
readonly dockerWorker: boolean;
|
|
45
49
|
/**
|
|
46
50
|
* Application timezone
|
|
47
51
|
*/
|
package/src/config/app.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../../../src/config/app.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAe,SAAS,EAAE,MAAM,cAAc,CAAC;AAoI3D,QAAA,MAAM,UAAU,QAAO,MAAM,CAAC,UAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../../../src/config/app.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAe,SAAS,EAAE,MAAM,cAAc,CAAC;AAoI3D,QAAA,MAAM,UAAU,QAAO,MAAM,CAAC,UAA2B,CAAC;AA2F1D,eAAO,MAAM,SAAS;IA3EpB;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;kCACc,OAAO;IAIxB;;OAEG;iCACa,OAAO;IAIvB;;OAEG;8BACU,OAAO;IAIpB;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;+BApFkB,MAAM,CAAC,UAAU;kCAhDd,MAAM;EA2IoB,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,CAAC;AAEtB,MAAM,MAAM,SAAS,GAAG,OAAO,SAAS,CAAC"}
|
package/src/config/app.js
CHANGED
|
@@ -165,6 +165,10 @@ const appConfigObj = {
|
|
|
165
165
|
* Application debug mode
|
|
166
166
|
*/
|
|
167
167
|
debug: readEnvBool('DEBUG', Env.DEBUG),
|
|
168
|
+
/**
|
|
169
|
+
* Indicates if the application is running inside a Docker worker container
|
|
170
|
+
*/
|
|
171
|
+
dockerWorker: readEnvBool('DOCKER_WORKER', Env.DOCKER_WORKER),
|
|
168
172
|
/**
|
|
169
173
|
* Application timezone
|
|
170
174
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cache.d.ts","sourceRoot":"","sources":["../../../src/config/cache.ts"],"names":[],"mappings":"AAAA;;;;GAIG;
|
|
1
|
+
{"version":3,"file":"cache.d.ts","sourceRoot":"","sources":["../../../src/config/cache.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,KAAK,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAIxE,MAAM,MAAM,oBAAoB,GAAG,OAAO,CAAC;IACzC,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,gBAAgB,CAAC,SAAS,CAAC,CAAC;IACrC,SAAS,EAAE,MAAM,CAAC;IAClB,GAAG,EAAE,MAAM,CAAC;CACb,CAAC,CAAC;AAqDH,QAAA,MAAM,iBAAiB,QAAO;IAC5B,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,gBAAgB,CAAC,SAAS,CAAC,CAAC;IACrC,SAAS,EAAE,CAAC,IAAI,CAAC,EAAE,MAAM,KAAK,iBAAiB,CAAC;IAChD,SAAS,EAAE,MAAM,CAAC;IAClB,GAAG,EAAE,MAAM,CAAC;CA4Fb,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG,UAAU,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAqB/D,eAAO,MAAM,WAAW,EAAE,WAYxB,CAAC"}
|
package/src/config/cache.js
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
* Sealed namespace for immutability
|
|
5
5
|
*/
|
|
6
6
|
import { Env } from './env.js';
|
|
7
|
+
import { Cloudflare } from './cloudflare.js';
|
|
7
8
|
import { ErrorFactory } from '../exceptions/ZintrustError.js';
|
|
8
9
|
import { StartupConfigFile, StartupConfigFileRegistry } from '../runtime/StartupConfigFileRegistry.js';
|
|
9
10
|
const getCacheDriver = (config, name) => {
|
|
@@ -23,6 +24,25 @@ const getCacheDriver = (config, name) => {
|
|
|
23
24
|
}
|
|
24
25
|
throw ErrorFactory.createConfigError(`Cache default store not configured: ${storeName || '<empty>'}`);
|
|
25
26
|
};
|
|
27
|
+
const readWorkersEnvString = (key) => {
|
|
28
|
+
const workerValue = Cloudflare.getWorkersVar(key);
|
|
29
|
+
if (workerValue !== null && workerValue.trim() !== '')
|
|
30
|
+
return workerValue;
|
|
31
|
+
return '';
|
|
32
|
+
};
|
|
33
|
+
const readWorkersFallbackString = (workersKey, fallbackKey, fallback = '') => {
|
|
34
|
+
const workerValue = readWorkersEnvString(workersKey);
|
|
35
|
+
if (workerValue.trim() !== '')
|
|
36
|
+
return workerValue;
|
|
37
|
+
return Env.get(fallbackKey, fallback);
|
|
38
|
+
};
|
|
39
|
+
const readWorkersFallbackInt = (workersKey, fallbackKey, fallback) => {
|
|
40
|
+
const raw = readWorkersFallbackString(workersKey, fallbackKey, String(fallback));
|
|
41
|
+
if (raw.trim() === '')
|
|
42
|
+
return fallback;
|
|
43
|
+
const parsed = Number.parseInt(raw, 10);
|
|
44
|
+
return Number.isFinite(parsed) ? parsed : fallback;
|
|
45
|
+
};
|
|
26
46
|
const createCacheConfig = () => {
|
|
27
47
|
const baseDefault = (() => {
|
|
28
48
|
const envConnection = Env.get('CACHE_CONNECTION', '').trim();
|
|
@@ -39,8 +59,8 @@ const createCacheConfig = () => {
|
|
|
39
59
|
},
|
|
40
60
|
redis: {
|
|
41
61
|
driver: 'redis',
|
|
42
|
-
host:
|
|
43
|
-
port:
|
|
62
|
+
host: readWorkersFallbackString('WORKERS_REDIS_HOST', 'REDIS_HOST', 'localhost'),
|
|
63
|
+
port: readWorkersFallbackInt('WORKERS_REDIS_PORT', 'REDIS_PORT', 6379),
|
|
44
64
|
ttl: Env.getInt('CACHE_REDIS_TTL', 3600),
|
|
45
65
|
},
|
|
46
66
|
mongodb: {
|
|
@@ -4,11 +4,15 @@
|
|
|
4
4
|
* Centralizes access to Workers bindings via globalThis.env.
|
|
5
5
|
* This keeps runtime-specific globals out of adapters/drivers.
|
|
6
6
|
*/
|
|
7
|
-
import type { KVNamespace, WorkersEnv } from './type';
|
|
7
|
+
import type { AssetsBinding, KVNamespace, WorkersEnv } from './type';
|
|
8
8
|
import type { DatabaseConfig, ID1Database } from '../orm/DatabaseAdapter';
|
|
9
9
|
export declare const Cloudflare: Readonly<{
|
|
10
10
|
getWorkersEnv: () => WorkersEnv | null;
|
|
11
11
|
getD1Binding: (config: DatabaseConfig) => ID1Database | null;
|
|
12
12
|
getKVBinding: (bindingName?: string) => KVNamespace | null;
|
|
13
|
+
getR2Binding: (bindingName?: string) => unknown;
|
|
14
|
+
getAssetsBinding: () => AssetsBinding | null;
|
|
15
|
+
getWorkersVar: (key: string) => string | null;
|
|
16
|
+
isCloudflareSocketsEnabled: () => boolean;
|
|
13
17
|
}>;
|
|
14
18
|
//# sourceMappingURL=cloudflare.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cloudflare.d.ts","sourceRoot":"","sources":["../../../src/config/cloudflare.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"cloudflare.d.ts","sourceRoot":"","sources":["../../../src/config/cloudflare.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC3E,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAwExE,eAAO,MAAM,UAAU;yBAtEG,UAAU,GAAG,IAAI;2BAOb,cAAc,KAAG,WAAW,GAAG,IAAI;4CAanB,WAAW,GAAG,IAAI;iCAQ5B,MAAM,KAAG,OAAO;4BA0BvB,aAAa,GAAG,IAAI;yBATrB,MAAM,KAAG,MAAM,GAAG,IAAI;sCAiBX,OAAO;EAgB5C,CAAC"}
|
package/src/config/cloudflare.js
CHANGED
|
@@ -31,8 +31,56 @@ const getKVBinding = (bindingName = 'CACHE') => {
|
|
|
31
31
|
const kv = env[bindingName];
|
|
32
32
|
return kv ?? null;
|
|
33
33
|
};
|
|
34
|
+
const getR2Binding = (bindingName) => {
|
|
35
|
+
const env = getWorkersEnv();
|
|
36
|
+
if (env === null)
|
|
37
|
+
return null;
|
|
38
|
+
if (typeof bindingName === 'string' && bindingName.trim() !== '') {
|
|
39
|
+
return env[bindingName] ?? null;
|
|
40
|
+
}
|
|
41
|
+
const defaultNames = ['R2_BUCKET', 'R2', 'BUCKET'];
|
|
42
|
+
for (const name of defaultNames) {
|
|
43
|
+
const binding = env[name];
|
|
44
|
+
if (binding !== undefined && binding !== null)
|
|
45
|
+
return binding;
|
|
46
|
+
}
|
|
47
|
+
return null;
|
|
48
|
+
};
|
|
49
|
+
const getWorkersVar = (key) => {
|
|
50
|
+
const env = getWorkersEnv();
|
|
51
|
+
if (env === null)
|
|
52
|
+
return null;
|
|
53
|
+
const value = env[key];
|
|
54
|
+
if (value === undefined || value === null)
|
|
55
|
+
return null;
|
|
56
|
+
if (typeof value === 'string')
|
|
57
|
+
return value;
|
|
58
|
+
return String(value);
|
|
59
|
+
};
|
|
60
|
+
const getAssetsBinding = () => {
|
|
61
|
+
const env = getWorkersEnv();
|
|
62
|
+
if (env === null)
|
|
63
|
+
return null;
|
|
64
|
+
const binding = env['ASSETS'];
|
|
65
|
+
if (binding && typeof binding.fetch === 'function')
|
|
66
|
+
return binding;
|
|
67
|
+
return null;
|
|
68
|
+
};
|
|
69
|
+
const isCloudflareSocketsEnabled = () => {
|
|
70
|
+
const raw = getWorkersVar('ENABLE_CLOUDFLARE_SOCKETS');
|
|
71
|
+
if (raw === null)
|
|
72
|
+
return false;
|
|
73
|
+
const normalized = raw.trim().toLowerCase();
|
|
74
|
+
if (normalized === '')
|
|
75
|
+
return false;
|
|
76
|
+
return normalized === 'true' || normalized === '1';
|
|
77
|
+
};
|
|
34
78
|
export const Cloudflare = Object.freeze({
|
|
35
79
|
getWorkersEnv,
|
|
36
80
|
getD1Binding,
|
|
37
81
|
getKVBinding,
|
|
82
|
+
getR2Binding,
|
|
83
|
+
getAssetsBinding,
|
|
84
|
+
getWorkersVar,
|
|
85
|
+
isCloudflareSocketsEnabled,
|
|
38
86
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"database.d.ts","sourceRoot":"","sources":["../../../src/config/database.ts"],"names":[],"mappings":"AAAA;;;;GAIG;
|
|
1
|
+
{"version":3,"file":"database.d.ts","sourceRoot":"","sources":["../../../src/config/database.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,KAAK,EACV,mBAAmB,EACnB,wBAAwB,EACxB,mBAAmB,EACpB,MAAM,cAAc,CAAC;AAItB,MAAM,MAAM,uBAAuB,GAAG,OAAO,CAAC;IAC5C,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,mBAAmB,CAAC;IACjC,OAAO,EAAE;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;IAC7C,UAAU,EAAE;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE,CAAC;IACrD,OAAO,EAAE;QAAE,SAAS,EAAE,MAAM,CAAA;KAAE,CAAC;CAChC,CAAC,CAAC;AAuQH,QAAA,MAAM,oBAAoB,QAAO;IAC/B,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,mBAAmB,CAAC;IACjC,aAAa,EAAE,CAAC,IAAI,EAAE,mBAAmB,KAAK,wBAAwB,CAAC;IACvE,OAAO,EAAE;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;IAC7C,UAAU,EAAE;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE,CAAC;IACrD,OAAO,EAAE;QAAE,SAAS,EAAE,MAAM,CAAA;KAAE,CAAC;CAyEhC,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG,UAAU,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAqBrE,eAAO,MAAM,cAAc,EAAE,cAY3B,CAAC"}
|
package/src/config/database.js
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
* Database connections and pooling settings
|
|
4
4
|
* Sealed namespace for immutability
|
|
5
5
|
*/
|
|
6
|
+
import { Cloudflare } from './cloudflare.js';
|
|
6
7
|
import { Env } from './env.js';
|
|
7
8
|
import { ErrorFactory } from '../exceptions/ZintrustError.js';
|
|
8
9
|
import { StartupConfigFile, StartupConfigFileRegistry } from '../runtime/StartupConfigFileRegistry.js';
|
|
@@ -21,6 +22,29 @@ const readEnvString = (key, fallback = '') => {
|
|
|
21
22
|
}
|
|
22
23
|
return fromEnv ?? '';
|
|
23
24
|
};
|
|
25
|
+
const readWorkersEnvString = (key) => {
|
|
26
|
+
const workerValue = Cloudflare.getWorkersVar(key);
|
|
27
|
+
if (workerValue !== null && workerValue.trim() !== '')
|
|
28
|
+
return workerValue;
|
|
29
|
+
return '';
|
|
30
|
+
};
|
|
31
|
+
const readWorkersFallbackString = (workersKey, fallbackKey) => {
|
|
32
|
+
const workerValue = readWorkersEnvString(workersKey);
|
|
33
|
+
if (workerValue.trim() !== '')
|
|
34
|
+
return workerValue;
|
|
35
|
+
// Also check if the fallback key is present in the Workers bindings (e.g. DB_PASSWORD)
|
|
36
|
+
const fallbackWorkerValue = readWorkersEnvString(fallbackKey);
|
|
37
|
+
if (fallbackWorkerValue.trim() !== '')
|
|
38
|
+
return fallbackWorkerValue;
|
|
39
|
+
return readEnvString(fallbackKey, '');
|
|
40
|
+
};
|
|
41
|
+
const readWorkersFallbackInt = (workersKey, fallbackKey, fallback) => {
|
|
42
|
+
const raw = readWorkersFallbackString(workersKey, fallbackKey);
|
|
43
|
+
if (raw.trim() === '')
|
|
44
|
+
return fallback;
|
|
45
|
+
const parsed = Number.parseInt(raw, 10);
|
|
46
|
+
return Number.isFinite(parsed) ? parsed : fallback;
|
|
47
|
+
};
|
|
24
48
|
const isExplicitEnvValue = (key) => {
|
|
25
49
|
if (!isNodeProcess())
|
|
26
50
|
return false;
|
|
@@ -121,6 +145,13 @@ const parseReadHosts = (raw) => {
|
|
|
121
145
|
.filter((v) => v.length > 0);
|
|
122
146
|
return list.length > 0 ? list : undefined;
|
|
123
147
|
};
|
|
148
|
+
const normalizeReadHosts = (primaryHost, hosts) => {
|
|
149
|
+
if (hosts === undefined || hosts.length === 0)
|
|
150
|
+
return undefined;
|
|
151
|
+
const primary = String(primaryHost ?? '').trim();
|
|
152
|
+
const filtered = hosts.filter((host) => host !== '' && host !== primary);
|
|
153
|
+
return filtered.length > 0 ? filtered : undefined;
|
|
154
|
+
};
|
|
124
155
|
const getDefaultConnection = (connections) => {
|
|
125
156
|
const envSelectedRaw = Env.get('DB_CONNECTION', '');
|
|
126
157
|
const value = String(envSelectedRaw ?? '').trim();
|
|
@@ -159,13 +190,17 @@ const connections = {
|
|
|
159
190
|
},
|
|
160
191
|
postgresql: {
|
|
161
192
|
driver: 'postgresql',
|
|
162
|
-
host: Env.DB_HOST,
|
|
163
|
-
port: Env.DB_PORT_POSTGRESQL,
|
|
164
|
-
database:
|
|
165
|
-
|
|
166
|
-
|
|
193
|
+
host: readWorkersFallbackString('WORKERS_PG_HOST', 'DB_HOST') || Env.DB_HOST,
|
|
194
|
+
port: readWorkersFallbackInt('WORKERS_PG_PORT', 'DB_PORT_POSTGRESQL', Env.DB_PORT_POSTGRESQL),
|
|
195
|
+
database: readWorkersFallbackString('WORKERS_PG_DATABASE', 'DB_DATABASE_POSTGRESQL') ||
|
|
196
|
+
Env.DB_DATABASE_POSTGRESQL,
|
|
197
|
+
username: readWorkersFallbackString('WORKERS_PG_USER', 'DB_USERNAME_POSTGRESQL') ||
|
|
198
|
+
Env.DB_USERNAME_POSTGRESQL,
|
|
199
|
+
password: readWorkersFallbackString('WORKERS_PG_PASSWORD', 'DB_PASSWORD_POSTGRESQL') ||
|
|
200
|
+
Env.DB_PASSWORD_POSTGRESQL,
|
|
167
201
|
ssl: Env.getBool('DB_SSL', false),
|
|
168
|
-
readHosts:
|
|
202
|
+
readHosts: normalizeReadHosts(readWorkersFallbackString('WORKERS_PG_HOST', 'DB_HOST') || Env.DB_HOST, parseReadHosts(readWorkersFallbackString('WORKERS_PG_READ_HOSTS', 'DB_READ_HOSTS_POSTGRESQL') ||
|
|
203
|
+
Env.DB_READ_HOSTS_POSTGRESQL)),
|
|
169
204
|
pooling: {
|
|
170
205
|
enabled: Env.getBool('DB_POOLING', true),
|
|
171
206
|
min: Env.getInt('DB_POOL_MIN', 5),
|
|
@@ -176,12 +211,12 @@ const connections = {
|
|
|
176
211
|
},
|
|
177
212
|
mysql: {
|
|
178
213
|
driver: 'mysql',
|
|
179
|
-
host: Env.DB_HOST,
|
|
180
|
-
port: Env.DB_PORT,
|
|
181
|
-
database: Env.DB_DATABASE,
|
|
182
|
-
username: Env.DB_USERNAME,
|
|
183
|
-
password: Env.DB_PASSWORD,
|
|
184
|
-
readHosts: parseReadHosts(Env.DB_READ_HOSTS),
|
|
214
|
+
host: readWorkersFallbackString('WORKERS_MYSQL_HOST', 'DB_HOST') || Env.DB_HOST,
|
|
215
|
+
port: readWorkersFallbackInt('WORKERS_MYSQL_PORT', 'DB_PORT', Env.DB_PORT),
|
|
216
|
+
database: readWorkersFallbackString('WORKERS_MYSQL_DATABASE', 'DB_DATABASE') || Env.DB_DATABASE,
|
|
217
|
+
username: readWorkersFallbackString('WORKERS_MYSQL_USER', 'DB_USERNAME') || Env.DB_USERNAME,
|
|
218
|
+
password: readWorkersFallbackString('WORKERS_MYSQL_PASSWORD', 'DB_PASSWORD') || Env.DB_PASSWORD,
|
|
219
|
+
readHosts: normalizeReadHosts(readWorkersFallbackString('WORKERS_MYSQL_HOST', 'DB_HOST') || Env.DB_HOST, parseReadHosts(readWorkersFallbackString('WORKERS_MYSQL_READ_HOSTS', 'DB_READ_HOSTS') || Env.DB_READ_HOSTS)),
|
|
185
220
|
pooling: {
|
|
186
221
|
enabled: Env.getBool('DB_POOLING', true),
|
|
187
222
|
min: Env.getInt('DB_POOL_MIN', 5),
|
|
@@ -195,7 +230,7 @@ const connections = {
|
|
|
195
230
|
database: Env.DB_DATABASE_MSSQL,
|
|
196
231
|
username: Env.DB_USERNAME_MSSQL,
|
|
197
232
|
password: Env.DB_PASSWORD_MSSQL,
|
|
198
|
-
readHosts: parseReadHosts(Env.DB_READ_HOSTS_MSSQL),
|
|
233
|
+
readHosts: normalizeReadHosts(Env.DB_HOST_MSSQL, parseReadHosts(Env.DB_READ_HOSTS_MSSQL)),
|
|
199
234
|
},
|
|
200
235
|
};
|
|
201
236
|
const createDatabaseConfig = () => {
|
package/src/config/env.d.ts
CHANGED
|
@@ -6,18 +6,28 @@
|
|
|
6
6
|
* Safe for both Node.js and serverless runtimes (Cloudflare Workers, Deno, Lambda)
|
|
7
7
|
*/
|
|
8
8
|
import type { ProcessLike } from './type';
|
|
9
|
+
export type EnvSource = Record<string, unknown> | (() => Record<string, unknown>);
|
|
9
10
|
export declare const getProcessLike: () => ProcessLike | undefined;
|
|
10
11
|
export declare const dirnameFromExecPath: (execPath: string, platform?: string) => string;
|
|
11
12
|
export declare const get: (key: string, defaultValue?: string) => string;
|
|
12
|
-
export declare const getInt: (key: string, defaultValue
|
|
13
|
+
export declare const getInt: (key: string, defaultValue: number) => number;
|
|
13
14
|
export declare const getFloat: (key: string, defaultValue?: number) => number;
|
|
14
15
|
export declare const getBool: (key: string, defaultValue?: boolean) => boolean;
|
|
16
|
+
export declare const set: (key: string, value: string) => void;
|
|
17
|
+
export declare const unset: (key: string) => void;
|
|
18
|
+
export declare const setSource: (source: EnvSource | null) => void;
|
|
19
|
+
export declare const snapshot: () => Record<string, string>;
|
|
15
20
|
export declare const getDefaultLogLevel: () => "debug" | "info" | "warn" | "error";
|
|
21
|
+
export declare const ZT_PROXY_TIMEOUT_MS: number;
|
|
16
22
|
export declare const Env: Readonly<{
|
|
17
23
|
get: (key: string, defaultValue?: string) => string;
|
|
18
|
-
getInt: (key: string, defaultValue
|
|
24
|
+
getInt: (key: string, defaultValue: number) => number;
|
|
19
25
|
getBool: (key: string, defaultValue?: boolean) => boolean;
|
|
20
26
|
getFloat: (key: string, defaultValue?: number) => number;
|
|
27
|
+
set: (key: string, value: string) => void;
|
|
28
|
+
unset: (key: string) => void;
|
|
29
|
+
setSource: (source: EnvSource | null) => void;
|
|
30
|
+
snapshot: () => Record<string, string>;
|
|
21
31
|
NODE_ENV: NodeJS.ProcessEnv["NODE_ENV"];
|
|
22
32
|
PORT: number;
|
|
23
33
|
HOST: string;
|
|
@@ -49,6 +59,67 @@ export declare const Env: Readonly<{
|
|
|
49
59
|
D1_REMOTE_KEY_ID: string;
|
|
50
60
|
D1_REMOTE_SECRET: string;
|
|
51
61
|
D1_REMOTE_MODE: string;
|
|
62
|
+
MYSQL_PROXY_URL: string;
|
|
63
|
+
MYSQL_PROXY_HOST: string;
|
|
64
|
+
MYSQL_PROXY_PORT: number;
|
|
65
|
+
MYSQL_PROXY_MAX_BODY_BYTES: number;
|
|
66
|
+
MYSQL_PROXY_POOL_LIMIT: number;
|
|
67
|
+
MYSQL_PROXY_KEY_ID: string;
|
|
68
|
+
MYSQL_PROXY_SECRET: string;
|
|
69
|
+
MYSQL_PROXY_TIMEOUT_MS: number;
|
|
70
|
+
MYSQL_PROXY_REQUIRE_SIGNING: boolean;
|
|
71
|
+
MYSQL_PROXY_SIGNING_WINDOW_MS: number;
|
|
72
|
+
POSTGRES_PROXY_URL: string;
|
|
73
|
+
POSTGRES_PROXY_HOST: string;
|
|
74
|
+
POSTGRES_PROXY_PORT: number;
|
|
75
|
+
POSTGRES_PROXY_MAX_BODY_BYTES: number;
|
|
76
|
+
POSTGRES_PROXY_POOL_LIMIT: number;
|
|
77
|
+
POSTGRES_PROXY_KEY_ID: string;
|
|
78
|
+
POSTGRES_PROXY_SECRET: string;
|
|
79
|
+
POSTGRES_PROXY_TIMEOUT_MS: number;
|
|
80
|
+
POSTGRES_PROXY_REQUIRE_SIGNING: boolean;
|
|
81
|
+
POSTGRES_PROXY_SIGNING_WINDOW_MS: number;
|
|
82
|
+
REDIS_PROXY_URL: string;
|
|
83
|
+
REDIS_PROXY_HOST: string;
|
|
84
|
+
REDIS_PROXY_PORT: number;
|
|
85
|
+
REDIS_PROXY_MAX_BODY_BYTES: number;
|
|
86
|
+
REDIS_PROXY_KEY_ID: string;
|
|
87
|
+
REDIS_PROXY_SECRET: string;
|
|
88
|
+
REDIS_PROXY_TIMEOUT_MS: number;
|
|
89
|
+
REDIS_PROXY_REQUIRE_SIGNING: boolean;
|
|
90
|
+
REDIS_PROXY_SIGNING_WINDOW_MS: number;
|
|
91
|
+
USE_REDIS_PROXY: boolean;
|
|
92
|
+
SMTP_PROXY_URL: string;
|
|
93
|
+
SMTP_PROXY_HOST: string;
|
|
94
|
+
SMTP_PROXY_PORT: number;
|
|
95
|
+
SMTP_PROXY_MAX_BODY_BYTES: number;
|
|
96
|
+
SMTP_PROXY_KEY_ID: string;
|
|
97
|
+
SMTP_PROXY_SECRET: string;
|
|
98
|
+
SMTP_PROXY_TIMEOUT_MS: number;
|
|
99
|
+
SMTP_PROXY_REQUIRE_SIGNING: boolean;
|
|
100
|
+
SMTP_PROXY_SIGNING_WINDOW_MS: number;
|
|
101
|
+
USE_SMTP_PROXY: boolean;
|
|
102
|
+
MONGODB_PROXY_URL: string;
|
|
103
|
+
MONGODB_PROXY_HOST: string;
|
|
104
|
+
MONGODB_PROXY_PORT: number;
|
|
105
|
+
MONGODB_PROXY_MAX_BODY_BYTES: number;
|
|
106
|
+
MONGODB_PROXY_KEY_ID: string;
|
|
107
|
+
MONGODB_PROXY_SECRET: string;
|
|
108
|
+
MONGODB_PROXY_TIMEOUT_MS: number;
|
|
109
|
+
MONGODB_PROXY_REQUIRE_SIGNING: boolean;
|
|
110
|
+
MONGODB_PROXY_SIGNING_WINDOW_MS: number;
|
|
111
|
+
USE_MONGODB_PROXY: boolean;
|
|
112
|
+
SQLSERVER_PROXY_URL: string;
|
|
113
|
+
SQLSERVER_PROXY_HOST: string;
|
|
114
|
+
SQLSERVER_PROXY_PORT: number;
|
|
115
|
+
SQLSERVER_PROXY_MAX_BODY_BYTES: number;
|
|
116
|
+
SQLSERVER_PROXY_POOL_LIMIT: number;
|
|
117
|
+
SQLSERVER_PROXY_KEY_ID: string;
|
|
118
|
+
SQLSERVER_PROXY_SECRET: string;
|
|
119
|
+
SQLSERVER_PROXY_TIMEOUT_MS: number;
|
|
120
|
+
SQLSERVER_PROXY_REQUIRE_SIGNING: boolean;
|
|
121
|
+
SQLSERVER_PROXY_SIGNING_WINDOW_MS: number;
|
|
122
|
+
USE_SQLSERVER_PROXY: boolean;
|
|
52
123
|
KV_REMOTE_URL: string;
|
|
53
124
|
KV_REMOTE_KEY_ID: string;
|
|
54
125
|
KV_REMOTE_SECRET: string;
|
|
@@ -59,11 +130,22 @@ export declare const Env: Readonly<{
|
|
|
59
130
|
REDIS_HOST: string;
|
|
60
131
|
REDIS_PORT: number;
|
|
61
132
|
REDIS_PASSWORD: string;
|
|
133
|
+
REDIS_DB: number;
|
|
62
134
|
REDIS_URL: string;
|
|
63
135
|
MONGO_URI: string;
|
|
64
136
|
MONGO_DB: string;
|
|
65
137
|
QUEUE_CONNECTION: string;
|
|
66
138
|
QUEUE_DRIVER: string;
|
|
139
|
+
QUEUE_HTTP_PROXY_ENABLED: boolean;
|
|
140
|
+
QUEUE_HTTP_PROXY_GATEWAY_ENABLED: boolean;
|
|
141
|
+
QUEUE_HTTP_PROXY_URL: string;
|
|
142
|
+
QUEUE_HTTP_PROXY_PATH: string;
|
|
143
|
+
QUEUE_HTTP_PROXY_KEY_ID: string;
|
|
144
|
+
QUEUE_HTTP_PROXY_KEY: string;
|
|
145
|
+
QUEUE_HTTP_PROXY_TIMEOUT_MS: number;
|
|
146
|
+
QUEUE_HTTP_PROXY_MAX_SKEW_MS: number;
|
|
147
|
+
QUEUE_HTTP_PROXY_NONCE_TTL_MS: number;
|
|
148
|
+
QUEUE_HTTP_PROXY_MIDDLEWARE: string;
|
|
67
149
|
RATE_LIMIT_STORE: string;
|
|
68
150
|
RATE_LIMIT_DRIVER: string;
|
|
69
151
|
RATE_LIMIT_KEY_PREFIX: string;
|
|
@@ -100,6 +182,7 @@ export declare const Env: Readonly<{
|
|
|
100
182
|
LOG_LEVEL: "debug" | "info" | "warn" | "error";
|
|
101
183
|
LOG_FORMAT: string;
|
|
102
184
|
LOG_CHANNEL: string;
|
|
185
|
+
DOCKER_WORKER: boolean;
|
|
103
186
|
DISABLE_LOGGING: boolean;
|
|
104
187
|
LOG_HTTP_REQUEST: boolean;
|
|
105
188
|
LOG_TO_FILE: boolean;
|
|
@@ -112,6 +195,7 @@ export declare const Env: Readonly<{
|
|
|
112
195
|
ZINTRUST_ENV_IN_FILE: string;
|
|
113
196
|
ZINTRUST_SECRETS_PROVIDER: string;
|
|
114
197
|
ZINTRUST_ALLOW_AUTO_INSTALL: string;
|
|
198
|
+
WORKER_SHUTDOWN_ON_APP_EXIT: boolean;
|
|
115
199
|
CLOUDFLARE_ACCOUNT_ID: string;
|
|
116
200
|
CLOUDFLARE_API_TOKEN: string;
|
|
117
201
|
CLOUDFLARE_KV_NAMESPACE_ID: string;
|
|
@@ -130,4 +214,5 @@ export declare const Env: Readonly<{
|
|
|
130
214
|
NODE_BIN_DIR: string;
|
|
131
215
|
SAFE_PATH: string;
|
|
132
216
|
}>;
|
|
217
|
+
export declare const buildRedisUrl: () => string;
|
|
133
218
|
//# sourceMappingURL=env.d.ts.map
|
package/src/config/env.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"env.d.ts","sourceRoot":"","sources":["../../../src/config/env.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"env.d.ts","sourceRoot":"","sources":["../../../src/config/env.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAEhD,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,CAAC,MAAM,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;AAuBlF,eAAO,MAAM,cAAc,QAAO,WAAW,GAAG,SAAwB,CAAC;AAEzE,eAAO,MAAM,mBAAmB,GAAI,UAAU,MAAM,EAAE,WAAW,MAAM,KAAG,MAKzE,CAAC;AAGF,eAAO,MAAM,GAAG,GAAI,KAAK,MAAM,EAAE,eAAe,MAAM,KAAG,MAIxD,CAAC;AAEF,eAAO,MAAM,MAAM,GAAI,KAAK,MAAM,EAAE,cAAc,MAAM,KAAG,MAI1D,CAAC;AAEF,eAAO,MAAM,QAAQ,GAAI,KAAK,MAAM,EAAE,eAAe,MAAM,KAAG,MAI7D,CAAC;AAEF,eAAO,MAAM,OAAO,GAAI,KAAK,MAAM,EAAE,eAAe,OAAO,KAAG,OAI7D,CAAC;AAEF,eAAO,MAAM,GAAG,GAAI,KAAK,MAAM,EAAE,OAAO,MAAM,KAAG,IAGhD,CAAC;AAEF,eAAO,MAAM,KAAK,GAAI,KAAK,MAAM,KAAG,IAInC,CAAC;AAEF,eAAO,MAAM,SAAS,GAAI,QAAQ,SAAS,GAAG,IAAI,KAAG,IAEpD,CAAC;AAEF,eAAO,MAAM,QAAQ,QAAO,MAAM,CAAC,MAAM,EAAE,MAAM,CAOhD,CAAC;AAEF,eAAO,MAAM,kBAAkB,QAAO,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,OAKjE,CAAC;AACF,eAAO,MAAM,mBAAmB,QAAuC,CAAC;AAKxE,eAAO,MAAM,GAAG;eA3DS,MAAM,iBAAiB,MAAM,KAAG,MAAM;kBAMnC,MAAM,gBAAgB,MAAM,KAAG,MAAM;mBAYpC,MAAM,iBAAiB,OAAO,KAAG,OAAO;oBANvC,MAAM,iBAAiB,MAAM,KAAG,MAAM;eAY3C,MAAM,SAAS,MAAM,KAAG,IAAI;iBAK1B,MAAM,KAAG,IAAI;wBAMN,SAAS,GAAG,IAAI,KAAG,IAAI;oBAI7B,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;cAgCJ,MAAM,CAAC,UAAU,CAAC,UAAU,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;eAuNpB,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgFxF,CAAC;AAEH,eAAO,MAAM,aAAa,QAAO,MAchC,CAAC"}
|