@zintrust/core 0.1.39 → 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 -262
- package/src/boot/Server.d.ts +1 -1
- package/src/boot/Server.d.ts.map +1 -1
- package/src/boot/bootstrap.js +23 -9
- 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 +145 -18
- 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.d.ts +2 -1
- package/src/cli/utils/EnvFileLoader.d.ts.map +1 -1
- package/src/cli/utils/EnvFileLoader.js +22 -21
- package/src/cli/utils/spawn.d.ts.map +1 -1
- package/src/cli/utils/spawn.js +17 -10
- package/src/cli/workers/QueueWorkRunner.js +1 -1
- package/src/common/ExternalServiceUtils.d.ts.map +1 -1
- package/src/common/ExternalServiceUtils.js +7 -2
- 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 +90 -2
- package/src/config/env.d.ts.map +1 -1
- package/src/config/env.js +160 -18
- package/src/config/index.d.ts +1 -0
- package/src/config/index.d.ts.map +1 -1
- package/src/config/logger.d.ts.map +1 -1
- package/src/config/logger.js +60 -16
- 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 +19 -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 +39 -10
- 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 +18 -9
- package/src/security/CsrfTokenManager.d.ts.map +1 -1
- package/src/security/CsrfTokenManager.js +204 -11
- 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/app/Middleware/index.ts.tpl +1 -1
- package/src/templates/project/basic/src/zintrust.plugins.wg.ts.tpl +8 -0
- package/src/toolkit/Secrets/providers/AwsSecretsManager.d.ts.map +1 -1
- package/src/toolkit/Secrets/providers/AwsSecretsManager.js +4 -2
- 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/redis/RedisKeyManager.d.ts +3 -0
- package/src/tools/redis/RedisKeyManager.d.ts.map +1 -1
- package/src/tools/redis/RedisKeyManager.js +15 -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,33 @@
|
|
|
1
|
+
type MongoCollectionLike = Record<string, unknown>;
|
|
2
|
+
type MongoDatabaseLike = {
|
|
3
|
+
collection: (name: string) => MongoCollectionLike;
|
|
4
|
+
};
|
|
5
|
+
type MongoClientLike = {
|
|
6
|
+
connect: () => Promise<void>;
|
|
7
|
+
db: (name: string) => MongoDatabaseLike;
|
|
8
|
+
close: () => Promise<void>;
|
|
9
|
+
};
|
|
10
|
+
type ProxyOverrides = Partial<{
|
|
11
|
+
host: string;
|
|
12
|
+
port: number;
|
|
13
|
+
maxBodyBytes: number;
|
|
14
|
+
mongoUri: string;
|
|
15
|
+
mongoDb: string;
|
|
16
|
+
requireSigning: boolean;
|
|
17
|
+
keyId: string;
|
|
18
|
+
secret: string;
|
|
19
|
+
signingWindowMs: number;
|
|
20
|
+
}>;
|
|
21
|
+
export declare const MongoDBProxyServer: Readonly<{
|
|
22
|
+
start(overrides?: ProxyOverrides): Promise<{
|
|
23
|
+
server: Readonly<{
|
|
24
|
+
start: () => Promise<void>;
|
|
25
|
+
stop: () => Promise<void>;
|
|
26
|
+
server: import("node:http").Server;
|
|
27
|
+
}>;
|
|
28
|
+
client: MongoClientLike;
|
|
29
|
+
close(): Promise<void>;
|
|
30
|
+
}>;
|
|
31
|
+
}>;
|
|
32
|
+
export {};
|
|
33
|
+
//# sourceMappingURL=MongoDBProxyServer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MongoDBProxyServer.d.ts","sourceRoot":"","sources":["../../../../src/proxy/mongodb/MongoDBProxyServer.ts"],"names":[],"mappings":"AAYA,KAAK,mBAAmB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AACnD,KAAK,iBAAiB,GAAG;IACvB,UAAU,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,mBAAmB,CAAC;CACnD,CAAC;AACF,KAAK,eAAe,GAAG;IACrB,OAAO,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC7B,EAAE,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,iBAAiB,CAAC;IACxC,KAAK,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAC5B,CAAC;AAaF,KAAK,cAAc,GAAG,OAAO,CAAC;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,cAAc,EAAE,OAAO,CAAC;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,eAAe,EAAE,MAAM,CAAC;CACzB,CAAC,CAAC;AA4PH,eAAO,MAAM,kBAAkB;sBACN,cAAc;;;;;;;;;EA+BrC,CAAC"}
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
import { Env } from '../../config/env.js';
|
|
2
|
+
import { Logger } from '../../config/logger.js';
|
|
3
|
+
import { ErrorFactory } from '../../exceptions/ZintrustError.js';
|
|
4
|
+
import { ErrorHandler } from '../ErrorHandler.js';
|
|
5
|
+
import { createProxyServer } from '../ProxyServer.js';
|
|
6
|
+
import { resolveProxySigningConfig } from '../ProxySigningConfigResolver.js';
|
|
7
|
+
import { verifyProxySignatureIfNeeded } from '../ProxySigningRequest.js';
|
|
8
|
+
import { RequestValidator } from '../RequestValidator.js';
|
|
9
|
+
const resolveProxyConfig = (overrides = {}) => {
|
|
10
|
+
const host = overrides?.host ?? Env.get('MONGODB_PROXY_HOST', Env.HOST ?? '127.0.0.1');
|
|
11
|
+
const port = overrides.port ?? Env.getInt('MONGODB_PROXY_PORT', Env.PORT ?? 3000);
|
|
12
|
+
const maxBodyBytes = overrides.maxBodyBytes ?? Env.getInt('MONGODB_PROXY_MAX_BODY_BYTES', Env.MAX_BODY_SIZE ?? 0);
|
|
13
|
+
return { host, port, maxBodyBytes };
|
|
14
|
+
};
|
|
15
|
+
const resolveMongoConfig = (overrides = {}) => {
|
|
16
|
+
const uri = overrides.mongoUri ?? Env.get('MONGO_URI', 'mongodb://localhost:27017');
|
|
17
|
+
const database = overrides.mongoDb ?? Env.get('MONGO_DB', 'zintrust');
|
|
18
|
+
return { uri, database };
|
|
19
|
+
};
|
|
20
|
+
const resolveSigningConfig = (overrides = {}) => resolveProxySigningConfig(overrides, {
|
|
21
|
+
keyIdEnvVar: 'MONGODB_PROXY_KEY_ID',
|
|
22
|
+
secretEnvVar: 'MONGODB_PROXY_SECRET',
|
|
23
|
+
requireEnvVar: 'MONGODB_PROXY_REQUIRE_SIGNING',
|
|
24
|
+
windowEnvVar: 'MONGODB_PROXY_SIGNING_WINDOW_MS',
|
|
25
|
+
});
|
|
26
|
+
const resolveConfig = (overrides = {}) => {
|
|
27
|
+
const proxyConfig = resolveProxyConfig(overrides);
|
|
28
|
+
const mongoConfig = resolveMongoConfig(overrides);
|
|
29
|
+
const signingConfig = resolveSigningConfig(overrides);
|
|
30
|
+
return {
|
|
31
|
+
host: proxyConfig.host,
|
|
32
|
+
port: proxyConfig.port,
|
|
33
|
+
maxBodyBytes: proxyConfig.maxBodyBytes,
|
|
34
|
+
mongoOptions: mongoConfig,
|
|
35
|
+
signing: {
|
|
36
|
+
keyId: signingConfig.keyId,
|
|
37
|
+
secret: signingConfig.secret,
|
|
38
|
+
require: signingConfig.requireSigning,
|
|
39
|
+
windowMs: signingConfig.signingWindowMs,
|
|
40
|
+
},
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
const validateOperationPayload = (payload) => {
|
|
44
|
+
const operation = payload['operation'];
|
|
45
|
+
const collection = payload['collection'];
|
|
46
|
+
const args = payload['args'];
|
|
47
|
+
if (typeof operation !== 'string' || operation.trim() === '') {
|
|
48
|
+
return {
|
|
49
|
+
valid: false,
|
|
50
|
+
error: { code: 'VALIDATION_ERROR', message: 'operation is required' },
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
if (typeof collection !== 'string' || collection.trim() === '') {
|
|
54
|
+
return {
|
|
55
|
+
valid: false,
|
|
56
|
+
error: { code: 'VALIDATION_ERROR', message: 'collection is required' },
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
return {
|
|
60
|
+
valid: true,
|
|
61
|
+
operation,
|
|
62
|
+
collection,
|
|
63
|
+
args: args ?? {},
|
|
64
|
+
};
|
|
65
|
+
};
|
|
66
|
+
const getMongoModule = async () => {
|
|
67
|
+
const mongoModule = (await import('mongodb'));
|
|
68
|
+
const MongoDBClient = mongoModule.MongoClient;
|
|
69
|
+
if (typeof MongoDBClient !== 'function') {
|
|
70
|
+
throw ErrorFactory.createDatabaseError('MongoDB driver is unavailable');
|
|
71
|
+
}
|
|
72
|
+
return { MongoClient: MongoDBClient };
|
|
73
|
+
};
|
|
74
|
+
const createMongoClient = async (uri) => {
|
|
75
|
+
const { MongoClient: MongoDBClient } = await getMongoModule();
|
|
76
|
+
const client = new MongoDBClient(uri);
|
|
77
|
+
await client.connect();
|
|
78
|
+
return client;
|
|
79
|
+
};
|
|
80
|
+
const callMethod = async (coll, methodName, ...params) => {
|
|
81
|
+
const method = coll[methodName];
|
|
82
|
+
if (typeof method === 'function') {
|
|
83
|
+
const result = method(...params);
|
|
84
|
+
if (result !== null && typeof result === 'object' && 'toArray' in result) {
|
|
85
|
+
const toArray = result.toArray;
|
|
86
|
+
if (typeof toArray === 'function') {
|
|
87
|
+
return toArray();
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
return result;
|
|
91
|
+
}
|
|
92
|
+
throw ErrorFactory.createDatabaseError(`Method ${methodName} not found on collection`);
|
|
93
|
+
};
|
|
94
|
+
const OPERATION_HANDLERS = Object.freeze({
|
|
95
|
+
find: async (coll, args) => callMethod(coll, 'find', args['filter'] ?? {}),
|
|
96
|
+
findOne: async (coll, args) => callMethod(coll, 'findOne', args['filter'] ?? {}),
|
|
97
|
+
insertOne: async (coll, args) => callMethod(coll, 'insertOne', args['document'] ?? {}),
|
|
98
|
+
insertMany: async (coll, args) => callMethod(coll, 'insertMany', args['documents'] ?? []),
|
|
99
|
+
updateOne: async (coll, args) => callMethod(coll, 'updateOne', args['filter'] ?? {}, args['update'] ?? {}),
|
|
100
|
+
updateMany: async (coll, args) => callMethod(coll, 'updateMany', args['filter'] ?? {}, args['update'] ?? {}),
|
|
101
|
+
deleteOne: async (coll, args) => callMethod(coll, 'deleteOne', args['filter'] ?? {}),
|
|
102
|
+
deleteMany: async (coll, args) => callMethod(coll, 'deleteMany', args['filter'] ?? {}),
|
|
103
|
+
countDocuments: async (coll, args) => callMethod(coll, 'countDocuments', args['filter'] ?? {}),
|
|
104
|
+
aggregate: async (coll, args) => callMethod(coll, 'aggregate', args['pipeline'] ?? []),
|
|
105
|
+
});
|
|
106
|
+
const executeOperation = async (client, dbName, collectionName, operation, args) => {
|
|
107
|
+
const db = client.db(dbName);
|
|
108
|
+
const coll = db.collection(collectionName);
|
|
109
|
+
if (Object.prototype.hasOwnProperty.call(OPERATION_HANDLERS, operation)) {
|
|
110
|
+
const handler = OPERATION_HANDLERS[operation];
|
|
111
|
+
return handler(coll, args);
|
|
112
|
+
}
|
|
113
|
+
throw ErrorFactory.createDatabaseError(`Unsupported MongoDB operation: ${String(operation)}`);
|
|
114
|
+
};
|
|
115
|
+
const createBackend = (client, config) => ({
|
|
116
|
+
name: 'mongodb',
|
|
117
|
+
handle: async (request) => {
|
|
118
|
+
const methodError = RequestValidator.requirePost(request.method);
|
|
119
|
+
if (methodError) {
|
|
120
|
+
return {
|
|
121
|
+
status: 405,
|
|
122
|
+
body: { code: methodError.code, message: methodError.message },
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
if (request.path !== '/zin/mongodb/operation') {
|
|
126
|
+
return { status: 404, body: { code: 'NOT_FOUND', message: 'Unknown endpoint' } };
|
|
127
|
+
}
|
|
128
|
+
const parsed = RequestValidator.parseJson(request.body);
|
|
129
|
+
if (!parsed.ok) {
|
|
130
|
+
return { status: 400, body: { code: parsed.error.code, message: parsed.error.message } };
|
|
131
|
+
}
|
|
132
|
+
const validated = validateOperationPayload(parsed.value);
|
|
133
|
+
if (!validated.valid) {
|
|
134
|
+
return {
|
|
135
|
+
status: 400,
|
|
136
|
+
body: {
|
|
137
|
+
code: validated.error?.code ?? 'VALIDATION_ERROR',
|
|
138
|
+
message: validated.error?.message ?? 'Invalid request',
|
|
139
|
+
},
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
try {
|
|
143
|
+
const result = await executeOperation(client, config.mongoOptions.database, validated.collection ?? '', validated.operation ?? '', validated.args ?? {});
|
|
144
|
+
return { status: 200, body: { success: true, result } };
|
|
145
|
+
}
|
|
146
|
+
catch (error) {
|
|
147
|
+
Logger.error('MongoDB proxy operation failed', { error });
|
|
148
|
+
return ErrorHandler.toProxyError(500, 'MONGODB_PROXY_ERROR', String(error));
|
|
149
|
+
}
|
|
150
|
+
},
|
|
151
|
+
health: async () => {
|
|
152
|
+
try {
|
|
153
|
+
client.db(config.mongoOptions.database);
|
|
154
|
+
await Promise.resolve();
|
|
155
|
+
return { status: 200, body: { status: 'ok' } };
|
|
156
|
+
}
|
|
157
|
+
catch (error) {
|
|
158
|
+
await Promise.resolve();
|
|
159
|
+
return { status: 503, body: { status: 'unhealthy', error: String(error) } };
|
|
160
|
+
}
|
|
161
|
+
},
|
|
162
|
+
shutdown: async () => {
|
|
163
|
+
await client.close();
|
|
164
|
+
},
|
|
165
|
+
});
|
|
166
|
+
const createVerifier = (config) => {
|
|
167
|
+
return async (req, body) => {
|
|
168
|
+
const verified = await verifyProxySignatureIfNeeded(req, body, config.signing);
|
|
169
|
+
if (!verified.ok) {
|
|
170
|
+
const error = verified.error ?? { status: 401, message: 'Unauthorized' };
|
|
171
|
+
return { ok: false, status: error.status, message: error.message };
|
|
172
|
+
}
|
|
173
|
+
return { ok: true };
|
|
174
|
+
};
|
|
175
|
+
};
|
|
176
|
+
export const MongoDBProxyServer = Object.freeze({
|
|
177
|
+
async start(overrides = {}) {
|
|
178
|
+
const config = resolveConfig(overrides);
|
|
179
|
+
Logger.info(`Starting MongoDB proxy on ${config.host}:${config.port} → ${config.mongoOptions.uri}`);
|
|
180
|
+
const client = await createMongoClient(config.mongoOptions.uri);
|
|
181
|
+
const backend = createBackend(client, config);
|
|
182
|
+
const verifier = createVerifier(config);
|
|
183
|
+
const server = createProxyServer({
|
|
184
|
+
host: config.host,
|
|
185
|
+
port: config.port,
|
|
186
|
+
maxBodyBytes: config.maxBodyBytes,
|
|
187
|
+
backend,
|
|
188
|
+
verify: verifier,
|
|
189
|
+
});
|
|
190
|
+
await server.start();
|
|
191
|
+
Logger.info(`✓ MongoDB proxy listening on ${config.host}:${config.port}`);
|
|
192
|
+
return {
|
|
193
|
+
server,
|
|
194
|
+
client,
|
|
195
|
+
async close() {
|
|
196
|
+
await server.stop();
|
|
197
|
+
await client.close();
|
|
198
|
+
Logger.info('MongoDB proxy server closed');
|
|
199
|
+
},
|
|
200
|
+
};
|
|
201
|
+
},
|
|
202
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"register.d.ts","sourceRoot":"","sources":["../../../../src/proxy/mongodb/register.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type BaseProxyOverrides } from '../ProxyServerUtils';
|
|
2
|
+
type ProxyOverrides = BaseProxyOverrides & Partial<{
|
|
3
|
+
dbHost: string;
|
|
4
|
+
dbPort: number;
|
|
5
|
+
dbName: string;
|
|
6
|
+
dbUser: string;
|
|
7
|
+
dbPass: string;
|
|
8
|
+
connectionLimit: number;
|
|
9
|
+
}>;
|
|
10
|
+
export declare const MySqlProxyServer: Readonly<{
|
|
11
|
+
start(overrides?: ProxyOverrides): Promise<void>;
|
|
12
|
+
}>;
|
|
13
|
+
export default MySqlProxyServer;
|
|
14
|
+
//# sourceMappingURL=MySqlProxyServer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MySqlProxyServer.d.ts","sourceRoot":"","sources":["../../../../src/proxy/mysql/MySqlProxyServer.ts"],"names":[],"mappings":"AAOA,OAAO,EAIL,KAAK,kBAAkB,EACxB,MAAM,yBAAyB,CAAC;AAajC,KAAK,cAAc,GAAG,kBAAkB,GACtC,OAAO,CAAC;IACN,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,eAAe,EAAE,MAAM,CAAC;CACzB,CAAC,CAAC;AAyJL,eAAO,MAAM,gBAAgB;sBACJ,cAAc,GAAQ,OAAO,CAAC,IAAI,CAAC;EA4C1D,CAAC;AAEH,eAAe,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
import { Env } from '../../config/env.js';
|
|
2
|
+
import { Logger } from '../../config/logger.js';
|
|
3
|
+
import { ErrorFactory } from '../../exceptions/ZintrustError.js';
|
|
4
|
+
import { ErrorHandler } from '../ErrorHandler.js';
|
|
5
|
+
import { createProxyServer } from '../ProxyServer.js';
|
|
6
|
+
import { resolveBaseConfig, resolveBaseSigningConfig, verifyRequestSignature, } from '../ProxyServerUtils.js';
|
|
7
|
+
import { RequestValidator } from '../RequestValidator.js';
|
|
8
|
+
import { validateSqlPayload } from '../SqlPayloadValidator.js';
|
|
9
|
+
import { createPool } from 'mysql2/promise';
|
|
10
|
+
const resolveDatabaseConfig = (overrides = {}) => {
|
|
11
|
+
const dbHost = overrides.dbHost ?? Env.get('MYSQL_DB_HOST', Env.get('DB_HOST', '127.0.0.1'));
|
|
12
|
+
const dbPort = overrides.dbPort ?? Env.getInt('MYSQL_DB_PORT', Env.getInt('DB_PORT', 3306));
|
|
13
|
+
const dbName = overrides.dbName ?? Env.get('MYSQL_DB_DATABASE', Env.get('DB_DATABASE', 'zintrust'));
|
|
14
|
+
const dbUser = overrides.dbUser ?? Env.get('MYSQL_DB_USERNAME', Env.get('DB_USERNAME', 'root'));
|
|
15
|
+
const dbPass = overrides.dbPass ?? Env.get('MYSQL_DB_PASSWORD', Env.get('DB_PASSWORD', 'pass'));
|
|
16
|
+
const connectionLimit = overrides.connectionLimit ?? Env.MYSQL_PROXY_POOL_LIMIT;
|
|
17
|
+
return { dbHost, dbPort, dbName, dbUser, dbPass, connectionLimit };
|
|
18
|
+
};
|
|
19
|
+
const resolveConfig = (overrides = {}) => {
|
|
20
|
+
const proxyConfig = resolveBaseConfig(overrides, 'MYSQL');
|
|
21
|
+
const dbConfig = resolveDatabaseConfig(overrides);
|
|
22
|
+
const signingConfig = resolveBaseSigningConfig(overrides, 'MYSQL');
|
|
23
|
+
const poolOptions = {
|
|
24
|
+
host: dbConfig.dbHost,
|
|
25
|
+
port: dbConfig.dbPort,
|
|
26
|
+
database: dbConfig.dbName,
|
|
27
|
+
user: dbConfig.dbUser,
|
|
28
|
+
password: dbConfig.dbPass,
|
|
29
|
+
waitForConnections: true,
|
|
30
|
+
connectionLimit: dbConfig.connectionLimit <= 0 ? 50 : dbConfig.connectionLimit,
|
|
31
|
+
queueLimit: 0,
|
|
32
|
+
enableKeepAlive: true,
|
|
33
|
+
keepAliveInitialDelay: 0,
|
|
34
|
+
namedPlaceholders: true,
|
|
35
|
+
};
|
|
36
|
+
return {
|
|
37
|
+
host: proxyConfig.host,
|
|
38
|
+
port: proxyConfig.port,
|
|
39
|
+
maxBodyBytes: proxyConfig.maxBodyBytes,
|
|
40
|
+
poolOptions,
|
|
41
|
+
signing: {
|
|
42
|
+
keyId: signingConfig.keyId,
|
|
43
|
+
secret: signingConfig.secret,
|
|
44
|
+
require: signingConfig.requireSigning,
|
|
45
|
+
windowMs: signingConfig.signingWindowMs,
|
|
46
|
+
},
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
const normalizeResult = (rows) => {
|
|
50
|
+
if (Array.isArray(rows)) {
|
|
51
|
+
return { rows: rows, rowCount: rows.length };
|
|
52
|
+
}
|
|
53
|
+
if (rows !== null && rows !== undefined && typeof rows === 'object') {
|
|
54
|
+
const input = rows;
|
|
55
|
+
const affectedRows = Number.isFinite(input.affectedRows) ? Number(input.affectedRows) : 0;
|
|
56
|
+
const insertId = input.insertId;
|
|
57
|
+
const lastInsertId = typeof insertId === 'number' || typeof insertId === 'string' || typeof insertId === 'bigint'
|
|
58
|
+
? insertId
|
|
59
|
+
: undefined;
|
|
60
|
+
return { rows: [], rowCount: affectedRows, lastInsertId };
|
|
61
|
+
}
|
|
62
|
+
return { rows: [], rowCount: 0 };
|
|
63
|
+
};
|
|
64
|
+
const handleEndpoint = (path, rows) => {
|
|
65
|
+
if (path === '/zin/mysql/query') {
|
|
66
|
+
return { status: 200, body: normalizeResult(rows) };
|
|
67
|
+
}
|
|
68
|
+
if (path === '/zin/mysql/queryOne') {
|
|
69
|
+
if (Array.isArray(rows)) {
|
|
70
|
+
return { status: 200, body: { row: rows[0] ?? null } };
|
|
71
|
+
}
|
|
72
|
+
return { status: 200, body: { row: null } };
|
|
73
|
+
}
|
|
74
|
+
if (path === '/zin/mysql/exec') {
|
|
75
|
+
const normalized = normalizeResult(rows);
|
|
76
|
+
return {
|
|
77
|
+
status: 200,
|
|
78
|
+
body: {
|
|
79
|
+
ok: true,
|
|
80
|
+
meta: { changes: normalized.rowCount, lastRowId: normalized.lastInsertId },
|
|
81
|
+
},
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
return ErrorHandler.toProxyError(404, 'NOT_FOUND', 'Unknown endpoint');
|
|
85
|
+
};
|
|
86
|
+
const createBackend = (pool) => ({
|
|
87
|
+
name: 'mysql',
|
|
88
|
+
async handle(request) {
|
|
89
|
+
const methodError = RequestValidator.requirePost(request.method);
|
|
90
|
+
if (methodError) {
|
|
91
|
+
return ErrorHandler.toProxyError(405, methodError.code, methodError.message);
|
|
92
|
+
}
|
|
93
|
+
const parsed = RequestValidator.parseJson(request.body);
|
|
94
|
+
if (!parsed.ok) {
|
|
95
|
+
return ErrorHandler.toProxyError(400, parsed.error.code, parsed.error.message);
|
|
96
|
+
}
|
|
97
|
+
const sqlValidation = validateSqlPayload(parsed.value);
|
|
98
|
+
if (!sqlValidation.valid) {
|
|
99
|
+
const error = sqlValidation.error ?? {
|
|
100
|
+
code: 'VALIDATION_ERROR',
|
|
101
|
+
message: 'Invalid SQL payload',
|
|
102
|
+
};
|
|
103
|
+
return ErrorHandler.toProxyError(400, error.code, error.message);
|
|
104
|
+
}
|
|
105
|
+
try {
|
|
106
|
+
const [rows] = await pool.query(sqlValidation.sql ?? '', sqlValidation.params ?? []);
|
|
107
|
+
return handleEndpoint(request.path, rows);
|
|
108
|
+
}
|
|
109
|
+
catch (error) {
|
|
110
|
+
Logger.error('[MySQLProxyServer] Query execution failed', {
|
|
111
|
+
path: request.path,
|
|
112
|
+
sqlPreview: String(sqlValidation.sql ?? '').slice(0, 160),
|
|
113
|
+
paramsCount: Array.isArray(sqlValidation.params) ? sqlValidation.params.length : 0,
|
|
114
|
+
error: error instanceof Error ? error.message : String(error),
|
|
115
|
+
});
|
|
116
|
+
return ErrorHandler.toProxyError(500, 'MYSQL_ERROR', String(error));
|
|
117
|
+
}
|
|
118
|
+
},
|
|
119
|
+
async health() {
|
|
120
|
+
try {
|
|
121
|
+
await pool.query('SELECT 1');
|
|
122
|
+
return { status: 200, body: { status: 'healthy' } };
|
|
123
|
+
}
|
|
124
|
+
catch (error) {
|
|
125
|
+
Logger.error('[MySQLProxyServer] Health check failed', {
|
|
126
|
+
error: error instanceof Error ? error.message : String(error),
|
|
127
|
+
});
|
|
128
|
+
return ErrorHandler.toProxyError(503, 'UNHEALTHY', String(error));
|
|
129
|
+
}
|
|
130
|
+
},
|
|
131
|
+
});
|
|
132
|
+
export const MySqlProxyServer = Object.freeze({
|
|
133
|
+
async start(overrides = {}) {
|
|
134
|
+
const config = resolveConfig(overrides);
|
|
135
|
+
const signingHasKeyId = config.signing.keyId.trim() !== '';
|
|
136
|
+
const signingHasSecret = config.signing.secret.trim() !== '';
|
|
137
|
+
if (config.signing.require && (!signingHasKeyId || !signingHasSecret)) {
|
|
138
|
+
throw ErrorFactory.createConfigError(`MySQL proxy signing is required but credentials are missing. ` +
|
|
139
|
+
`Set MYSQL_PROXY_KEY_ID and MYSQL_PROXY_SECRET (fallbacks: APP_NAME and APP_KEY). ` +
|
|
140
|
+
`Resolved state: keyId=${config.signing.keyId || '<empty>'}, hasSecret=${String(signingHasSecret)}, ` +
|
|
141
|
+
`cwd=${typeof process !== 'undefined' && typeof process.cwd === 'function' ? process.cwd() : '<unknown>'}`);
|
|
142
|
+
}
|
|
143
|
+
// Debug: surface resolved config so we can compare watch vs non-watch runs
|
|
144
|
+
try {
|
|
145
|
+
Logger.info(`MySQL proxy config: proxyHost=${config.host} proxyPort=${config.port} dbHost=${String(config.poolOptions.host)} dbPort=${String(config.poolOptions.port)} dbName=${String(config.poolOptions.database)} dbUser=${String(config.poolOptions.user)} requireSigning=${String(config.signing.require)} keyId=${config.signing.keyId} hasSecret=${String(config.signing.secret.trim() !== '')} signingWindowMs=${String(config.signing.windowMs)}`);
|
|
146
|
+
}
|
|
147
|
+
catch {
|
|
148
|
+
// noop - logging must not block startup
|
|
149
|
+
}
|
|
150
|
+
const pool = createPool(config.poolOptions);
|
|
151
|
+
const backend = createBackend(pool);
|
|
152
|
+
const proxy = createProxyServer({
|
|
153
|
+
host: config.host,
|
|
154
|
+
port: config.port,
|
|
155
|
+
maxBodyBytes: config.maxBodyBytes,
|
|
156
|
+
backend,
|
|
157
|
+
verify: async (req, body) => {
|
|
158
|
+
const verified = await verifyRequestSignature(req, body, config, 'MySQLProxyServer');
|
|
159
|
+
if (!verified.ok && verified.error) {
|
|
160
|
+
return { ok: false, status: verified.error.status, message: verified.error.message };
|
|
161
|
+
}
|
|
162
|
+
return { ok: true };
|
|
163
|
+
},
|
|
164
|
+
});
|
|
165
|
+
await proxy.start();
|
|
166
|
+
Logger.info(`MySQL proxy listening on http://${config.host}:${config.port}`);
|
|
167
|
+
},
|
|
168
|
+
});
|
|
169
|
+
export default MySqlProxyServer;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"register.d.ts","sourceRoot":"","sources":["../../../../src/proxy/mysql/register.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type BaseProxyOverrides } from '../ProxyServerUtils';
|
|
2
|
+
type ProxyOverrides = BaseProxyOverrides & Partial<{
|
|
3
|
+
dbHost: string;
|
|
4
|
+
dbPort: number;
|
|
5
|
+
dbName: string;
|
|
6
|
+
dbUser: string;
|
|
7
|
+
dbPass: string;
|
|
8
|
+
connectionLimit: number;
|
|
9
|
+
}>;
|
|
10
|
+
export declare const PostgresProxyServer: Readonly<{
|
|
11
|
+
start(overrides?: ProxyOverrides): Promise<void>;
|
|
12
|
+
}>;
|
|
13
|
+
export default PostgresProxyServer;
|
|
14
|
+
//# sourceMappingURL=PostgresProxyServer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PostgresProxyServer.d.ts","sourceRoot":"","sources":["../../../../src/proxy/postgres/PostgresProxyServer.ts"],"names":[],"mappings":"AAMA,OAAO,EAIL,KAAK,kBAAkB,EACxB,MAAM,yBAAyB,CAAC;AAoBjC,KAAK,cAAc,GAAG,kBAAkB,GACtC,OAAO,CAAC;IACN,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,eAAe,EAAE,MAAM,CAAC;CACzB,CAAC,CAAC;AAgIL,eAAO,MAAM,mBAAmB;sBACP,cAAc,GAAQ,OAAO,CAAC,IAAI,CAAC;EAoC1D,CAAC;AAEH,eAAe,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import { Env } from '../../config/env.js';
|
|
2
|
+
import { Logger } from '../../config/logger.js';
|
|
3
|
+
import { ErrorHandler } from '../ErrorHandler.js';
|
|
4
|
+
import { createProxyServer } from '../ProxyServer.js';
|
|
5
|
+
import { resolveBaseConfig, resolveBaseSigningConfig, verifyRequestSignature, } from '../ProxyServerUtils.js';
|
|
6
|
+
import { RequestValidator } from '../RequestValidator.js';
|
|
7
|
+
import { validateSqlPayload } from '../SqlPayloadValidator.js';
|
|
8
|
+
import { Pool } from 'pg';
|
|
9
|
+
const resolveDatabaseConfig = (overrides = {}) => {
|
|
10
|
+
const dbHost = overrides.dbHost ?? Env.DB_HOST ?? '127.0.0.1';
|
|
11
|
+
const dbPort = overrides.dbPort ?? Env.DB_PORT_POSTGRESQL ?? 5432;
|
|
12
|
+
const dbName = overrides.dbName ?? Env.DB_DATABASE_POSTGRESQL ?? 'postgres';
|
|
13
|
+
const dbUser = overrides.dbUser ?? Env.DB_USERNAME_POSTGRESQL ?? 'postgres';
|
|
14
|
+
const dbPass = overrides.dbPass ?? Env.DB_PASSWORD_POSTGRESQL ?? '';
|
|
15
|
+
const connectionLimit = overrides.connectionLimit ?? Env.POSTGRES_PROXY_POOL_LIMIT;
|
|
16
|
+
return { dbHost, dbPort, dbName, dbUser, dbPass, connectionLimit };
|
|
17
|
+
};
|
|
18
|
+
const resolveConfig = (overrides = {}) => {
|
|
19
|
+
const proxyConfig = resolveBaseConfig(overrides, 'POSTGRES');
|
|
20
|
+
const dbConfig = resolveDatabaseConfig(overrides);
|
|
21
|
+
const signingConfig = resolveBaseSigningConfig(overrides, 'POSTGRES');
|
|
22
|
+
const poolOptions = {
|
|
23
|
+
host: dbConfig.dbHost,
|
|
24
|
+
port: dbConfig.dbPort,
|
|
25
|
+
database: dbConfig.dbName,
|
|
26
|
+
user: dbConfig.dbUser,
|
|
27
|
+
password: dbConfig.dbPass,
|
|
28
|
+
max: dbConfig.connectionLimit <= 0 ? 50 : dbConfig.connectionLimit,
|
|
29
|
+
};
|
|
30
|
+
return {
|
|
31
|
+
host: proxyConfig.host,
|
|
32
|
+
port: proxyConfig.port,
|
|
33
|
+
maxBodyBytes: proxyConfig.maxBodyBytes,
|
|
34
|
+
poolOptions,
|
|
35
|
+
signing: {
|
|
36
|
+
keyId: signingConfig.keyId,
|
|
37
|
+
secret: signingConfig.secret,
|
|
38
|
+
require: signingConfig.requireSigning,
|
|
39
|
+
windowMs: signingConfig.signingWindowMs,
|
|
40
|
+
},
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
const normalizeSql = (sql) => {
|
|
44
|
+
if (!sql.includes('?'))
|
|
45
|
+
return sql;
|
|
46
|
+
let index = 0;
|
|
47
|
+
return sql.replaceAll('?', () => {
|
|
48
|
+
index += 1;
|
|
49
|
+
return `$${index}`;
|
|
50
|
+
});
|
|
51
|
+
};
|
|
52
|
+
const handleEndpoint = (path, result) => {
|
|
53
|
+
if (path === '/zin/postgres/query') {
|
|
54
|
+
return { status: 200, body: { rows: result.rows, rowCount: result.rowCount } };
|
|
55
|
+
}
|
|
56
|
+
if (path === '/zin/postgres/queryOne') {
|
|
57
|
+
const row = result.rows[0] ?? null;
|
|
58
|
+
return { status: 200, body: { row } };
|
|
59
|
+
}
|
|
60
|
+
if (path === '/zin/postgres/exec') {
|
|
61
|
+
return {
|
|
62
|
+
status: 200,
|
|
63
|
+
body: {
|
|
64
|
+
ok: true,
|
|
65
|
+
meta: { changes: result.rowCount },
|
|
66
|
+
},
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
return ErrorHandler.toProxyError(404, 'NOT_FOUND', 'Unknown endpoint');
|
|
70
|
+
};
|
|
71
|
+
const createBackend = (pool) => ({
|
|
72
|
+
name: 'postgres',
|
|
73
|
+
async handle(request) {
|
|
74
|
+
const methodError = RequestValidator.requirePost(request.method);
|
|
75
|
+
if (methodError) {
|
|
76
|
+
return ErrorHandler.toProxyError(405, methodError.code, methodError.message);
|
|
77
|
+
}
|
|
78
|
+
const parsed = RequestValidator.parseJson(request.body);
|
|
79
|
+
if (!parsed.ok) {
|
|
80
|
+
return ErrorHandler.toProxyError(400, parsed.error.code, parsed.error.message);
|
|
81
|
+
}
|
|
82
|
+
const sqlValidation = validateSqlPayload(parsed.value);
|
|
83
|
+
if (!sqlValidation.valid) {
|
|
84
|
+
const error = sqlValidation.error ?? {
|
|
85
|
+
code: 'VALIDATION_ERROR',
|
|
86
|
+
message: 'Invalid SQL payload',
|
|
87
|
+
};
|
|
88
|
+
return ErrorHandler.toProxyError(400, error.code, error.message);
|
|
89
|
+
}
|
|
90
|
+
try {
|
|
91
|
+
const sql = normalizeSql(sqlValidation.sql ?? '');
|
|
92
|
+
const result = await pool.query(sql, sqlValidation.params ?? []);
|
|
93
|
+
return handleEndpoint(request.path, {
|
|
94
|
+
rows: (result.rows ?? []),
|
|
95
|
+
rowCount: result.rowCount ?? result.rows?.length ?? 0,
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
catch (error) {
|
|
99
|
+
return ErrorHandler.toProxyError(500, 'POSTGRES_ERROR', String(error));
|
|
100
|
+
}
|
|
101
|
+
},
|
|
102
|
+
async health() {
|
|
103
|
+
try {
|
|
104
|
+
await pool.query('SELECT 1');
|
|
105
|
+
return { status: 200, body: { status: 'healthy' } };
|
|
106
|
+
}
|
|
107
|
+
catch (error) {
|
|
108
|
+
return ErrorHandler.toProxyError(503, 'UNHEALTHY', String(error));
|
|
109
|
+
}
|
|
110
|
+
},
|
|
111
|
+
});
|
|
112
|
+
export const PostgresProxyServer = Object.freeze({
|
|
113
|
+
async start(overrides = {}) {
|
|
114
|
+
const config = resolveConfig(overrides);
|
|
115
|
+
try {
|
|
116
|
+
Logger.info(`Postgres proxy config: proxyHost=${config.host} proxyPort=${config.port} dbHost=${String(config.poolOptions.host)} dbPort=${String(config.poolOptions.port)} dbName=${String(config.poolOptions.database)} dbUser=${String(config.poolOptions.user)}`);
|
|
117
|
+
}
|
|
118
|
+
catch {
|
|
119
|
+
// noop - logging must not block startup
|
|
120
|
+
}
|
|
121
|
+
const pool = new Pool(config.poolOptions);
|
|
122
|
+
const backend = createBackend(pool);
|
|
123
|
+
const proxy = createProxyServer({
|
|
124
|
+
host: config.host,
|
|
125
|
+
port: config.port,
|
|
126
|
+
maxBodyBytes: config.maxBodyBytes,
|
|
127
|
+
backend,
|
|
128
|
+
verify: async (req, body) => {
|
|
129
|
+
const verified = await verifyRequestSignature(req, body, config, 'PostgresProxyServer');
|
|
130
|
+
if (!verified.ok && verified.error) {
|
|
131
|
+
return { ok: false, status: verified.error.status, message: verified.error.message };
|
|
132
|
+
}
|
|
133
|
+
return { ok: true };
|
|
134
|
+
},
|
|
135
|
+
});
|
|
136
|
+
await proxy.start();
|
|
137
|
+
Logger.info(`Postgres proxy listening on http://${config.host}:${config.port}`);
|
|
138
|
+
},
|
|
139
|
+
});
|
|
140
|
+
export default PostgresProxyServer;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"register.d.ts","sourceRoot":"","sources":["../../../../src/proxy/postgres/register.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type BaseProxyOverrides } from '../ProxyServerUtils';
|
|
2
|
+
type ProxyOverrides = BaseProxyOverrides & Partial<{
|
|
3
|
+
redisHost: string;
|
|
4
|
+
redisPort: number;
|
|
5
|
+
redisPassword: string;
|
|
6
|
+
redisDb: number;
|
|
7
|
+
}>;
|
|
8
|
+
export declare const RedisProxyServer: Readonly<{
|
|
9
|
+
start(overrides?: ProxyOverrides): Promise<void>;
|
|
10
|
+
}>;
|
|
11
|
+
export default RedisProxyServer;
|
|
12
|
+
//# sourceMappingURL=RedisProxyServer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RedisProxyServer.d.ts","sourceRoot":"","sources":["../../../../src/proxy/redis/RedisProxyServer.ts"],"names":[],"mappings":"AAOA,OAAO,EAIL,KAAK,kBAAkB,EACxB,MAAM,yBAAyB,CAAC;AAiBjC,KAAK,cAAc,GAAG,kBAAkB,GACtC,OAAO,CAAC;IACN,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC,CAAC;AAyNL,eAAO,MAAM,gBAAgB;sBACJ,cAAc,GAAQ,OAAO,CAAC,IAAI,CAAC;EAqB1D,CAAC;AAEH,eAAe,gBAAgB,CAAC"}
|