@zintrust/core 0.1.0
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/z.d.ts +7 -0
- package/bin/z.d.ts.map +1 -0
- package/bin/z.js +6 -0
- package/bin/zin.d.ts +7 -0
- package/bin/zin.d.ts.map +1 -0
- package/bin/zin.js +6 -0
- package/bin/zintrust-microservices.d.ts +7 -0
- package/bin/zintrust-microservices.d.ts.map +1 -0
- package/bin/zintrust-microservices.js +165 -0
- package/bin/zintrust.d.ts +9 -0
- package/bin/zintrust.d.ts.map +1 -0
- package/bin/zintrust.js +51 -0
- package/bin/zt.d.ts +7 -0
- package/bin/zt.d.ts.map +1 -0
- package/bin/zt.js +6 -0
- package/package.json +80 -0
- package/src/boot/Application.d.ts +31 -0
- package/src/boot/Application.d.ts.map +1 -0
- package/src/boot/Application.js +159 -0
- package/src/boot/Server.d.ts +23 -0
- package/src/boot/Server.d.ts.map +1 -0
- package/src/boot/Server.js +236 -0
- package/src/boot/bootstrap.d.ts +7 -0
- package/src/boot/bootstrap.d.ts.map +1 -0
- package/src/boot/bootstrap.js +64 -0
- package/src/builder/BundleOptimizer.d.ts +42 -0
- package/src/builder/BundleOptimizer.d.ts.map +1 -0
- package/src/builder/BundleOptimizer.js +356 -0
- package/src/cache/Cache.d.ts +26 -0
- package/src/cache/Cache.d.ts.map +1 -0
- package/src/cache/Cache.js +89 -0
- package/src/cache/CacheDriver.d.ts +28 -0
- package/src/cache/CacheDriver.d.ts.map +1 -0
- package/src/cache/CacheDriver.js +6 -0
- package/src/cache/drivers/KVDriver.d.ts +12 -0
- package/src/cache/drivers/KVDriver.d.ts.map +1 -0
- package/src/cache/drivers/KVDriver.js +54 -0
- package/src/cache/drivers/MemoryDriver.d.ts +12 -0
- package/src/cache/drivers/MemoryDriver.d.ts.map +1 -0
- package/src/cache/drivers/MemoryDriver.js +50 -0
- package/src/cache/drivers/MongoDriver.d.ts +17 -0
- package/src/cache/drivers/MongoDriver.d.ts.map +1 -0
- package/src/cache/drivers/MongoDriver.js +80 -0
- package/src/cache/drivers/RedisDriver.d.ts +12 -0
- package/src/cache/drivers/RedisDriver.d.ts.map +1 -0
- package/src/cache/drivers/RedisDriver.js +79 -0
- package/src/cli/BaseCommand.d.ts +39 -0
- package/src/cli/BaseCommand.d.ts.map +1 -0
- package/src/cli/BaseCommand.js +58 -0
- package/src/cli/CLI.d.ts +21 -0
- package/src/cli/CLI.d.ts.map +1 -0
- package/src/cli/CLI.js +203 -0
- package/src/cli/ErrorHandler.d.ts +23 -0
- package/src/cli/ErrorHandler.d.ts.map +1 -0
- package/src/cli/ErrorHandler.js +95 -0
- package/src/cli/PromptHelper.d.ts +47 -0
- package/src/cli/PromptHelper.d.ts.map +1 -0
- package/src/cli/PromptHelper.js +155 -0
- package/src/cli/commands/AddCommand.d.ts +15 -0
- package/src/cli/commands/AddCommand.d.ts.map +1 -0
- package/src/cli/commands/AddCommand.js +817 -0
- package/src/cli/commands/ConfigCommand.d.ts +15 -0
- package/src/cli/commands/ConfigCommand.d.ts.map +1 -0
- package/src/cli/commands/ConfigCommand.js +273 -0
- package/src/cli/commands/D1MigrateCommand.d.ts +15 -0
- package/src/cli/commands/D1MigrateCommand.d.ts.map +1 -0
- package/src/cli/commands/D1MigrateCommand.js +73 -0
- package/src/cli/commands/DebugCommand.d.ts +15 -0
- package/src/cli/commands/DebugCommand.d.ts.map +1 -0
- package/src/cli/commands/DebugCommand.js +52 -0
- package/src/cli/commands/FixCommand.d.ts +15 -0
- package/src/cli/commands/FixCommand.d.ts.map +1 -0
- package/src/cli/commands/FixCommand.js +80 -0
- package/src/cli/commands/KeyGenerateCommand.d.ts +9 -0
- package/src/cli/commands/KeyGenerateCommand.d.ts.map +1 -0
- package/src/cli/commands/KeyGenerateCommand.js +76 -0
- package/src/cli/commands/LogsCommand.d.ts +19 -0
- package/src/cli/commands/LogsCommand.d.ts.map +1 -0
- package/src/cli/commands/LogsCommand.js +185 -0
- package/src/cli/commands/MigrateCommand.d.ts +15 -0
- package/src/cli/commands/MigrateCommand.d.ts.map +1 -0
- package/src/cli/commands/MigrateCommand.js +56 -0
- package/src/cli/commands/NewCommand.d.ts +32 -0
- package/src/cli/commands/NewCommand.d.ts.map +1 -0
- package/src/cli/commands/NewCommand.js +280 -0
- package/src/cli/commands/PluginCommand.d.ts +9 -0
- package/src/cli/commands/PluginCommand.d.ts.map +1 -0
- package/src/cli/commands/PluginCommand.js +94 -0
- package/src/cli/commands/PrepareCommand.d.ts +8 -0
- package/src/cli/commands/PrepareCommand.d.ts.map +1 -0
- package/src/cli/commands/PrepareCommand.js +51 -0
- package/src/cli/commands/QACommand.d.ts +33 -0
- package/src/cli/commands/QACommand.d.ts.map +1 -0
- package/src/cli/commands/QACommand.js +490 -0
- package/src/cli/commands/SimulateCommand.d.ts +12 -0
- package/src/cli/commands/SimulateCommand.d.ts.map +1 -0
- package/src/cli/commands/SimulateCommand.js +79 -0
- package/src/cli/commands/StartCommand.d.ts +5 -0
- package/src/cli/commands/StartCommand.d.ts.map +1 -0
- package/src/cli/commands/StartCommand.js +227 -0
- package/src/cli/commands/index.d.ts +11 -0
- package/src/cli/commands/index.d.ts.map +1 -0
- package/src/cli/commands/index.js +10 -0
- package/src/cli/config/ConfigManager.d.ts +42 -0
- package/src/cli/config/ConfigManager.d.ts.map +1 -0
- package/src/cli/config/ConfigManager.js +175 -0
- package/src/cli/config/ConfigSchema.d.ts +195 -0
- package/src/cli/config/ConfigSchema.d.ts.map +1 -0
- package/src/cli/config/ConfigSchema.js +171 -0
- package/src/cli/config/ConfigValidator.d.ts +41 -0
- package/src/cli/config/ConfigValidator.d.ts.map +1 -0
- package/src/cli/config/ConfigValidator.js +200 -0
- package/src/cli/config/index.d.ts +8 -0
- package/src/cli/config/index.d.ts.map +1 -0
- package/src/cli/config/index.js +7 -0
- package/src/cli/debug/Dashboard.d.ts +34 -0
- package/src/cli/debug/Dashboard.d.ts.map +1 -0
- package/src/cli/debug/Dashboard.js +152 -0
- package/src/cli/index.d.ts +14 -0
- package/src/cli/index.d.ts.map +1 -0
- package/src/cli/index.js +14 -0
- package/src/cli/logger/Logger.d.ts +43 -0
- package/src/cli/logger/Logger.d.ts.map +1 -0
- package/src/cli/logger/Logger.js +137 -0
- package/src/cli/scaffolding/ControllerGenerator.d.ts +44 -0
- package/src/cli/scaffolding/ControllerGenerator.d.ts.map +1 -0
- package/src/cli/scaffolding/ControllerGenerator.js +540 -0
- package/src/cli/scaffolding/FactoryGenerator.d.ts +47 -0
- package/src/cli/scaffolding/FactoryGenerator.d.ts.map +1 -0
- package/src/cli/scaffolding/FactoryGenerator.js +356 -0
- package/src/cli/scaffolding/FeatureScaffolder.d.ts +40 -0
- package/src/cli/scaffolding/FeatureScaffolder.d.ts.map +1 -0
- package/src/cli/scaffolding/FeatureScaffolder.js +747 -0
- package/src/cli/scaffolding/FileGenerator.d.ts +31 -0
- package/src/cli/scaffolding/FileGenerator.d.ts.map +1 -0
- package/src/cli/scaffolding/FileGenerator.js +222 -0
- package/src/cli/scaffolding/MigrationGenerator.d.ts +35 -0
- package/src/cli/scaffolding/MigrationGenerator.d.ts.map +1 -0
- package/src/cli/scaffolding/MigrationGenerator.js +257 -0
- package/src/cli/scaffolding/ModelGenerator.d.ts +81 -0
- package/src/cli/scaffolding/ModelGenerator.d.ts.map +1 -0
- package/src/cli/scaffolding/ModelGenerator.js +249 -0
- package/src/cli/scaffolding/ProjectScaffolder.d.ts +66 -0
- package/src/cli/scaffolding/ProjectScaffolder.d.ts.map +1 -0
- package/src/cli/scaffolding/ProjectScaffolder.js +439 -0
- package/src/cli/scaffolding/RequestFactoryGenerator.d.ts +50 -0
- package/src/cli/scaffolding/RequestFactoryGenerator.d.ts.map +1 -0
- package/src/cli/scaffolding/RequestFactoryGenerator.js +465 -0
- package/src/cli/scaffolding/ResponseFactoryGenerator.d.ts +43 -0
- package/src/cli/scaffolding/ResponseFactoryGenerator.d.ts.map +1 -0
- package/src/cli/scaffolding/ResponseFactoryGenerator.js +321 -0
- package/src/cli/scaffolding/RouteGenerator.d.ts +66 -0
- package/src/cli/scaffolding/RouteGenerator.d.ts.map +1 -0
- package/src/cli/scaffolding/RouteGenerator.js +306 -0
- package/src/cli/scaffolding/SeederGenerator.d.ts +47 -0
- package/src/cli/scaffolding/SeederGenerator.d.ts.map +1 -0
- package/src/cli/scaffolding/SeederGenerator.js +286 -0
- package/src/cli/scaffolding/ServiceIntegrationTestGenerator.d.ts +40 -0
- package/src/cli/scaffolding/ServiceIntegrationTestGenerator.d.ts.map +1 -0
- package/src/cli/scaffolding/ServiceIntegrationTestGenerator.js +267 -0
- package/src/cli/scaffolding/ServiceRequestFactoryGenerator.d.ts +45 -0
- package/src/cli/scaffolding/ServiceRequestFactoryGenerator.d.ts.map +1 -0
- package/src/cli/scaffolding/ServiceRequestFactoryGenerator.js +397 -0
- package/src/cli/scaffolding/ServiceScaffolder.d.ts +45 -0
- package/src/cli/scaffolding/ServiceScaffolder.d.ts.map +1 -0
- package/src/cli/scaffolding/ServiceScaffolder.js +367 -0
- package/src/cli/scaffolding/TemplateEngine.d.ts +35 -0
- package/src/cli/scaffolding/TemplateEngine.d.ts.map +1 -0
- package/src/cli/scaffolding/TemplateEngine.js +379 -0
- package/src/cli/scaffolding/WorkflowGenerator.d.ts +31 -0
- package/src/cli/scaffolding/WorkflowGenerator.d.ts.map +1 -0
- package/src/cli/scaffolding/WorkflowGenerator.js +193 -0
- package/src/cli/scaffolding/index.d.ts +34 -0
- package/src/cli/scaffolding/index.d.ts.map +1 -0
- package/src/cli/scaffolding/index.js +18 -0
- package/src/cli/utils/DistPackager.d.ts +8 -0
- package/src/cli/utils/DistPackager.d.ts.map +1 -0
- package/src/cli/utils/DistPackager.js +94 -0
- package/src/cli/utils/EnvFileLoader.d.ts +21 -0
- package/src/cli/utils/EnvFileLoader.d.ts.map +1 -0
- package/src/cli/utils/EnvFileLoader.js +166 -0
- package/src/cli/utils/spawn.d.ts +11 -0
- package/src/cli/utils/spawn.d.ts.map +1 -0
- package/src/cli/utils/spawn.js +81 -0
- package/src/common/index.d.ts +87 -0
- package/src/common/index.d.ts.map +1 -0
- package/src/common/index.js +207 -0
- package/src/config/SecretsManager.d.ts +122 -0
- package/src/config/SecretsManager.d.ts.map +1 -0
- package/src/config/SecretsManager.js +328 -0
- package/src/config/app.d.ts +56 -0
- package/src/config/app.d.ts.map +1 -0
- package/src/config/app.js +77 -0
- package/src/config/cache.d.ts +76 -0
- package/src/config/cache.d.ts.map +1 -0
- package/src/config/cache.js +62 -0
- package/src/config/constants.d.ts +108 -0
- package/src/config/constants.d.ts.map +1 -0
- package/src/config/constants.js +64 -0
- package/src/config/database.d.ts +122 -0
- package/src/config/database.d.ts.map +1 -0
- package/src/config/database.js +89 -0
- package/src/config/env.d.ts +56 -0
- package/src/config/env.d.ts.map +1 -0
- package/src/config/env.js +133 -0
- package/src/config/features.d.ts +27 -0
- package/src/config/features.d.ts.map +1 -0
- package/src/config/features.js +49 -0
- package/src/config/index.d.ts +554 -0
- package/src/config/index.d.ts.map +1 -0
- package/src/config/index.js +31 -0
- package/src/config/logger.d.ts +17 -0
- package/src/config/logger.d.ts.map +1 -0
- package/src/config/logger.js +77 -0
- package/src/config/microservices.d.ts +88 -0
- package/src/config/microservices.d.ts.map +1 -0
- package/src/config/microservices.js +90 -0
- package/src/config/queue.d.ts +107 -0
- package/src/config/queue.d.ts.map +1 -0
- package/src/config/queue.js +74 -0
- package/src/config/security.d.ts +108 -0
- package/src/config/security.d.ts.map +1 -0
- package/src/config/security.js +134 -0
- package/src/config/storage.d.ts +105 -0
- package/src/config/storage.d.ts.map +1 -0
- package/src/config/storage.js +79 -0
- package/src/container/ServiceContainer.d.ts +25 -0
- package/src/container/ServiceContainer.d.ts.map +1 -0
- package/src/container/ServiceContainer.js +75 -0
- package/src/database/migrations/index.d.ts +2 -0
- package/src/database/migrations/index.d.ts.map +1 -0
- package/src/database/migrations/index.js +1 -0
- package/src/exceptions/ZintrustError.d.ts +88 -0
- package/src/exceptions/ZintrustError.d.ts.map +1 -0
- package/src/exceptions/ZintrustError.js +110 -0
- package/src/features/Auth.d.ts +20 -0
- package/src/features/Auth.d.ts.map +1 -0
- package/src/features/Auth.js +32 -0
- package/src/features/Queue.d.ts +21 -0
- package/src/features/Queue.d.ts.map +1 -0
- package/src/features/Queue.js +59 -0
- package/src/functions/cloudflare.d.ts +5 -0
- package/src/functions/cloudflare.d.ts.map +1 -0
- package/src/functions/cloudflare.js +34 -0
- package/src/functions/deno.d.ts +3 -0
- package/src/functions/deno.d.ts.map +1 -0
- package/src/functions/deno.js +31 -0
- package/src/functions/lambda.d.ts +2 -0
- package/src/functions/lambda.d.ts.map +1 -0
- package/src/functions/lambda.js +32 -0
- package/src/http/Controller.d.ts +20 -0
- package/src/http/Controller.d.ts.map +1 -0
- package/src/http/Controller.js +46 -0
- package/src/http/Kernel.d.ts +24 -0
- package/src/http/Kernel.d.ts.map +1 -0
- package/src/http/Kernel.js +72 -0
- package/src/http/Request.d.ts +36 -0
- package/src/http/Request.d.ts.map +1 -0
- package/src/http/Request.js +142 -0
- package/src/http/Response.d.ts +32 -0
- package/src/http/Response.d.ts.map +1 -0
- package/src/http/Response.js +70 -0
- package/src/index.d.ts +43 -0
- package/src/index.d.ts.map +1 -0
- package/src/index.js +37 -0
- package/src/microservices/MicroserviceBootstrap.d.ts +75 -0
- package/src/microservices/MicroserviceBootstrap.d.ts.map +1 -0
- package/src/microservices/MicroserviceBootstrap.js +285 -0
- package/src/microservices/MicroserviceGenerator.d.ts +27 -0
- package/src/microservices/MicroserviceGenerator.d.ts.map +1 -0
- package/src/microservices/MicroserviceGenerator.js +436 -0
- package/src/microservices/MicroserviceManager.d.ts +68 -0
- package/src/microservices/MicroserviceManager.d.ts.map +1 -0
- package/src/microservices/MicroserviceManager.js +266 -0
- package/src/microservices/PostgresAdapter.d.ts +90 -0
- package/src/microservices/PostgresAdapter.d.ts.map +1 -0
- package/src/microservices/PostgresAdapter.js +286 -0
- package/src/microservices/RequestTracingMiddleware.d.ts +41 -0
- package/src/microservices/RequestTracingMiddleware.d.ts.map +1 -0
- package/src/microservices/RequestTracingMiddleware.js +122 -0
- package/src/microservices/ServiceAuthMiddleware.d.ts +58 -0
- package/src/microservices/ServiceAuthMiddleware.d.ts.map +1 -0
- package/src/microservices/ServiceAuthMiddleware.js +240 -0
- package/src/microservices/ServiceBundler.d.ts +45 -0
- package/src/microservices/ServiceBundler.d.ts.map +1 -0
- package/src/microservices/ServiceBundler.js +297 -0
- package/src/microservices/ServiceHealthMonitor.d.ts +96 -0
- package/src/microservices/ServiceHealthMonitor.d.ts.map +1 -0
- package/src/microservices/ServiceHealthMonitor.js +379 -0
- package/src/middleware/CsrfMiddleware.d.ts +19 -0
- package/src/middleware/CsrfMiddleware.d.ts.map +1 -0
- package/src/middleware/CsrfMiddleware.js +121 -0
- package/src/middleware/MiddlewareStack.d.ts +27 -0
- package/src/middleware/MiddlewareStack.d.ts.map +1 -0
- package/src/middleware/MiddlewareStack.js +43 -0
- package/src/middleware/RateLimiter.d.ts +22 -0
- package/src/middleware/RateLimiter.d.ts.map +1 -0
- package/src/middleware/RateLimiter.js +72 -0
- package/src/middleware/SecurityMiddleware.d.ts +33 -0
- package/src/middleware/SecurityMiddleware.d.ts.map +1 -0
- package/src/middleware/SecurityMiddleware.js +106 -0
- package/src/middleware/index.d.ts +9 -0
- package/src/middleware/index.d.ts.map +1 -0
- package/src/middleware/index.js +8 -0
- package/src/node-singletons/child-process.d.ts +7 -0
- package/src/node-singletons/child-process.d.ts.map +1 -0
- package/src/node-singletons/child-process.js +6 -0
- package/src/node-singletons/crypto.d.ts +7 -0
- package/src/node-singletons/crypto.d.ts.map +1 -0
- package/src/node-singletons/crypto.js +6 -0
- package/src/node-singletons/events.d.ts +7 -0
- package/src/node-singletons/events.d.ts.map +1 -0
- package/src/node-singletons/events.js +6 -0
- package/src/node-singletons/fs.d.ts +12 -0
- package/src/node-singletons/fs.d.ts.map +1 -0
- package/src/node-singletons/fs.js +14 -0
- package/src/node-singletons/http.d.ts +8 -0
- package/src/node-singletons/http.d.ts.map +1 -0
- package/src/node-singletons/http.js +6 -0
- package/src/node-singletons/index.d.ts +30 -0
- package/src/node-singletons/index.d.ts.map +1 -0
- package/src/node-singletons/index.js +31 -0
- package/src/node-singletons/os.d.ts +9 -0
- package/src/node-singletons/os.d.ts.map +1 -0
- package/src/node-singletons/os.js +9 -0
- package/src/node-singletons/path.d.ts +7 -0
- package/src/node-singletons/path.d.ts.map +1 -0
- package/src/node-singletons/path.js +6 -0
- package/src/node-singletons/perf-hooks.d.ts +7 -0
- package/src/node-singletons/perf-hooks.d.ts.map +1 -0
- package/src/node-singletons/perf-hooks.js +6 -0
- package/src/node-singletons/readline.d.ts +10 -0
- package/src/node-singletons/readline.d.ts.map +1 -0
- package/src/node-singletons/readline.js +9 -0
- package/src/node-singletons/url.d.ts +7 -0
- package/src/node-singletons/url.d.ts.map +1 -0
- package/src/node-singletons/url.js +6 -0
- package/src/orm/ConnectionManager.d.ts +118 -0
- package/src/orm/ConnectionManager.d.ts.map +1 -0
- package/src/orm/ConnectionManager.js +401 -0
- package/src/orm/Database.d.ts +31 -0
- package/src/orm/Database.d.ts.map +1 -0
- package/src/orm/Database.js +163 -0
- package/src/orm/DatabaseAdapter.d.ts +96 -0
- package/src/orm/DatabaseAdapter.d.ts.map +1 -0
- package/src/orm/DatabaseAdapter.js +40 -0
- package/src/orm/Model.d.ts +91 -0
- package/src/orm/Model.d.ts.map +1 -0
- package/src/orm/Model.js +206 -0
- package/src/orm/QueryBuilder.d.ts +52 -0
- package/src/orm/QueryBuilder.d.ts.map +1 -0
- package/src/orm/QueryBuilder.js +134 -0
- package/src/orm/Relationships.d.ts +53 -0
- package/src/orm/Relationships.d.ts.map +1 -0
- package/src/orm/Relationships.js +98 -0
- package/src/orm/Schema.d.ts +123 -0
- package/src/orm/Schema.d.ts.map +1 -0
- package/src/orm/Schema.js +169 -0
- package/src/orm/adapters/D1Adapter.d.ts +15 -0
- package/src/orm/adapters/D1Adapter.d.ts.map +1 -0
- package/src/orm/adapters/D1Adapter.js +125 -0
- package/src/orm/adapters/MySQLAdapter.d.ts +16 -0
- package/src/orm/adapters/MySQLAdapter.d.ts.map +1 -0
- package/src/orm/adapters/MySQLAdapter.js +87 -0
- package/src/orm/adapters/PostgreSQLAdapter.d.ts +16 -0
- package/src/orm/adapters/PostgreSQLAdapter.d.ts.map +1 -0
- package/src/orm/adapters/PostgreSQLAdapter.js +87 -0
- package/src/orm/adapters/SQLServerAdapter.d.ts +16 -0
- package/src/orm/adapters/SQLServerAdapter.d.ts.map +1 -0
- package/src/orm/adapters/SQLServerAdapter.js +81 -0
- package/src/orm/adapters/SQLiteAdapter.d.ts +11 -0
- package/src/orm/adapters/SQLiteAdapter.d.ts.map +1 -0
- package/src/orm/adapters/SQLiteAdapter.js +131 -0
- package/src/performance/Benchmark.d.ts +87 -0
- package/src/performance/Benchmark.d.ts.map +1 -0
- package/src/performance/Benchmark.js +304 -0
- package/src/performance/CodeGenerationBenchmark.d.ts +23 -0
- package/src/performance/CodeGenerationBenchmark.d.ts.map +1 -0
- package/src/performance/CodeGenerationBenchmark.js +249 -0
- package/src/performance/Optimizer.d.ts +99 -0
- package/src/performance/Optimizer.d.ts.map +1 -0
- package/src/performance/Optimizer.js +396 -0
- package/src/performance/establish-baseline.d.ts +9 -0
- package/src/performance/establish-baseline.d.ts.map +1 -0
- package/src/performance/establish-baseline.js +55 -0
- package/src/profiling/MemoryProfiler.d.ts +32 -0
- package/src/profiling/MemoryProfiler.d.ts.map +1 -0
- package/src/profiling/MemoryProfiler.js +84 -0
- package/src/profiling/N1Detector.d.ts +16 -0
- package/src/profiling/N1Detector.d.ts.map +1 -0
- package/src/profiling/N1Detector.js +120 -0
- package/src/profiling/QueryLogger.d.ts +107 -0
- package/src/profiling/QueryLogger.d.ts.map +1 -0
- package/src/profiling/QueryLogger.js +148 -0
- package/src/profiling/RequestProfiler.d.ts +30 -0
- package/src/profiling/RequestProfiler.d.ts.map +1 -0
- package/src/profiling/RequestProfiler.js +94 -0
- package/src/profiling/types.d.ts +77 -0
- package/src/profiling/types.d.ts.map +1 -0
- package/src/profiling/types.js +5 -0
- package/src/routing/Router.d.ts +52 -0
- package/src/routing/Router.d.ts.map +1 -0
- package/src/routing/Router.js +191 -0
- package/src/runtime/PluginManager.d.ts +30 -0
- package/src/runtime/PluginManager.d.ts.map +1 -0
- package/src/runtime/PluginManager.js +197 -0
- package/src/runtime/PluginRegistry.d.ts +22 -0
- package/src/runtime/PluginRegistry.d.ts.map +1 -0
- package/src/runtime/PluginRegistry.js +93 -0
- package/src/runtime/RuntimeAdapter.d.ts +126 -0
- package/src/runtime/RuntimeAdapter.d.ts.map +1 -0
- package/src/runtime/RuntimeAdapter.js +127 -0
- package/src/runtime/RuntimeDetector.d.ts +15 -0
- package/src/runtime/RuntimeDetector.d.ts.map +1 -0
- package/src/runtime/RuntimeDetector.js +219 -0
- package/src/runtime/adapters/CloudflareAdapter.d.ts +43 -0
- package/src/runtime/adapters/CloudflareAdapter.d.ts.map +1 -0
- package/src/runtime/adapters/CloudflareAdapter.js +175 -0
- package/src/runtime/adapters/DenoAdapter.d.ts +30 -0
- package/src/runtime/adapters/DenoAdapter.d.ts.map +1 -0
- package/src/runtime/adapters/DenoAdapter.js +191 -0
- package/src/runtime/adapters/FargateAdapter.d.ts +40 -0
- package/src/runtime/adapters/FargateAdapter.d.ts.map +1 -0
- package/src/runtime/adapters/FargateAdapter.js +156 -0
- package/src/runtime/adapters/LambdaAdapter.d.ts +13 -0
- package/src/runtime/adapters/LambdaAdapter.d.ts.map +1 -0
- package/src/runtime/adapters/LambdaAdapter.js +302 -0
- package/src/runtime/adapters/NodeServerAdapter.d.ts +16 -0
- package/src/runtime/adapters/NodeServerAdapter.d.ts.map +1 -0
- package/src/runtime/adapters/NodeServerAdapter.js +199 -0
- package/src/scripts/TemplateSync.d.ts +7 -0
- package/src/scripts/TemplateSync.d.ts.map +1 -0
- package/src/scripts/TemplateSync.js +234 -0
- package/src/security/CsrfTokenManager.d.ts +28 -0
- package/src/security/CsrfTokenManager.d.ts.map +1 -0
- package/src/security/CsrfTokenManager.js +78 -0
- package/src/security/Encryptor.d.ts +15 -0
- package/src/security/Encryptor.d.ts.map +1 -0
- package/src/security/Encryptor.js +142 -0
- package/src/security/JwtManager.d.ts +41 -0
- package/src/security/JwtManager.d.ts.map +1 -0
- package/src/security/JwtManager.js +229 -0
- package/src/security/UrlValidator.d.ts +21 -0
- package/src/security/UrlValidator.d.ts.map +1 -0
- package/src/security/UrlValidator.js +42 -0
- package/src/security/XssProtection.d.ts +24 -0
- package/src/security/XssProtection.d.ts.map +1 -0
- package/src/security/XssProtection.js +133 -0
- package/src/templates/TemplateRegistry.d.ts +40 -0
- package/src/templates/TemplateRegistry.d.ts.map +1 -0
- package/src/templates/TemplateRegistry.js +78 -0
- package/src/templates/TemplateRegistry.ts +91 -0
- package/src/templates/adapters/MySQLAdapter.ts.tpl +97 -0
- package/src/templates/adapters/PostgreSQLAdapter.ts.tpl +101 -0
- package/src/templates/adapters/SQLServerAdapter.ts.tpl +95 -0
- package/src/templates/adapters/SQLiteAdapter.ts.tpl +189 -0
- package/src/templates/features/Auth.ts.tpl +40 -0
- package/src/templates/features/Queue.ts.tpl +75 -0
- package/src/templates/project/basic/.env.example.tpl +26 -0
- package/src/templates/project/basic/.env.tpl +164 -0
- package/src/templates/project/basic/README.md.tpl +13 -0
- package/src/templates/project/basic/app/Controllers/UserController.ts.tpl +155 -0
- package/src/templates/project/basic/app/Middleware/ProfilerMiddleware.ts.tpl +55 -0
- package/src/templates/project/basic/app/Middleware/index.ts.tpl +304 -0
- package/src/templates/project/basic/app/Models/Post.ts.tpl +30 -0
- package/src/templates/project/basic/app/Models/User.ts.tpl +53 -0
- package/src/templates/project/basic/config/SecretsManager.ts.tpl +453 -0
- package/src/templates/project/basic/config/app.ts.tpl +97 -0
- package/src/templates/project/basic/config/cache.ts.tpl +117 -0
- package/src/templates/project/basic/config/constants.ts.tpl +70 -0
- package/src/templates/project/basic/config/database.ts.tpl +152 -0
- package/src/templates/project/basic/config/env.ts.tpl +148 -0
- package/src/templates/project/basic/config/features.ts.tpl +57 -0
- package/src/templates/project/basic/config/index.ts.tpl +36 -0
- package/src/templates/project/basic/config/logger.ts.tpl +95 -0
- package/src/templates/project/basic/config/microservices.ts.tpl +104 -0
- package/src/templates/project/basic/config/queue.ts.tpl +134 -0
- package/src/templates/project/basic/config/security.ts.tpl +149 -0
- package/src/templates/project/basic/config/storage.ts.tpl +136 -0
- package/src/templates/project/basic/database/factories/.gitkeep.tpl +0 -0
- package/src/templates/project/basic/database/migrations/.gitkeep.tpl +0 -0
- package/src/templates/project/basic/database/migrations/index.ts.tpl +2 -0
- package/src/templates/project/basic/database/seeders/.gitkeep.tpl +0 -0
- package/src/templates/project/basic/package.json.tpl +22 -0
- package/src/templates/project/basic/routes/api.ts.tpl +135 -0
- package/src/templates/project/basic/src/index.ts.tpl +49 -0
- package/src/templates/project/basic/template.json +17 -0
- package/src/templates/project/basic/tsconfig.json.tpl +20 -0
- package/src/validation/ValidationError.d.ts +42 -0
- package/src/validation/ValidationError.d.ts.map +1 -0
- package/src/validation/ValidationError.js +53 -0
- package/src/validation/Validator.d.ts +60 -0
- package/src/validation/Validator.d.ts.map +1 -0
- package/src/validation/Validator.js +190 -0
|
@@ -0,0 +1,266 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Microservices Architecture for Zintrust Framework
|
|
3
|
+
* Sealed namespace pattern with immutable microservice management
|
|
4
|
+
*/
|
|
5
|
+
import { Env } from '../config/env';
|
|
6
|
+
import { Logger } from '../config/logger';
|
|
7
|
+
import { validateUrl } from '../security/UrlValidator';
|
|
8
|
+
import { ErrorFactory } from '../exceptions/ZintrustError';
|
|
9
|
+
const services = new Map();
|
|
10
|
+
let instance;
|
|
11
|
+
let basePort = 3000;
|
|
12
|
+
let nextPortOffset = 0;
|
|
13
|
+
function normalizeEnabledServices() {
|
|
14
|
+
return getEnabledServices();
|
|
15
|
+
}
|
|
16
|
+
function isServiceEnabledByEnv(serviceName) {
|
|
17
|
+
const enabled = normalizeEnabledServices();
|
|
18
|
+
if (enabled.length === 0) {
|
|
19
|
+
return true;
|
|
20
|
+
}
|
|
21
|
+
// If SERVICES is set, treat it as an allow-list.
|
|
22
|
+
return enabled.includes(serviceName);
|
|
23
|
+
}
|
|
24
|
+
function toCallOptions(pathOrOptions, options) {
|
|
25
|
+
if (typeof pathOrOptions === 'string') {
|
|
26
|
+
return {
|
|
27
|
+
method: 'GET',
|
|
28
|
+
path: pathOrOptions,
|
|
29
|
+
headers: options?.['headers'] ?? undefined,
|
|
30
|
+
body: options?.['body'],
|
|
31
|
+
timeout: options?.['timeout'] ?? undefined,
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
return {
|
|
35
|
+
method: pathOrOptions['method'] ?? 'GET',
|
|
36
|
+
path: pathOrOptions['path'],
|
|
37
|
+
headers: pathOrOptions['headers'] ?? undefined,
|
|
38
|
+
body: pathOrOptions['body'],
|
|
39
|
+
timeout: pathOrOptions['timeout'] ?? undefined,
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
// Plain functions (will be sealed below)
|
|
43
|
+
const create = () => {
|
|
44
|
+
return getMicroserviceManager().create();
|
|
45
|
+
};
|
|
46
|
+
const getInstance = () => {
|
|
47
|
+
instance ??= getMicroserviceManager();
|
|
48
|
+
return instance;
|
|
49
|
+
};
|
|
50
|
+
const reset = () => {
|
|
51
|
+
services.clear();
|
|
52
|
+
instance = undefined;
|
|
53
|
+
basePort = 3000;
|
|
54
|
+
nextPortOffset = 0;
|
|
55
|
+
};
|
|
56
|
+
const initialize = (configs = [], initBasePort = 3000) => {
|
|
57
|
+
instance ??= getMicroserviceManager();
|
|
58
|
+
basePort = initBasePort;
|
|
59
|
+
nextPortOffset = 0;
|
|
60
|
+
for (const config of configs) {
|
|
61
|
+
registerService(config);
|
|
62
|
+
}
|
|
63
|
+
return getMicroserviceManager();
|
|
64
|
+
};
|
|
65
|
+
const register = (config) => {
|
|
66
|
+
return registerService(config);
|
|
67
|
+
};
|
|
68
|
+
const registerService = (config) => {
|
|
69
|
+
if (isServiceEnabledByEnv(config.name) === false) {
|
|
70
|
+
Logger.info(`Service ${config.name} not in SERVICES env; skipping registration`);
|
|
71
|
+
return null;
|
|
72
|
+
}
|
|
73
|
+
const assignedPort = config.port ?? basePort + nextPortOffset;
|
|
74
|
+
nextPortOffset += 1;
|
|
75
|
+
const healthCheckUrl = typeof config.healthCheck === 'string'
|
|
76
|
+
? config.healthCheck
|
|
77
|
+
: (config.healthCheckUrl ?? '/health');
|
|
78
|
+
const serviceConfig = {
|
|
79
|
+
...config,
|
|
80
|
+
port: assignedPort,
|
|
81
|
+
baseUrl: config.baseUrl ?? `http://localhost:${assignedPort}`,
|
|
82
|
+
healthCheckUrl,
|
|
83
|
+
status: config.status ?? 'starting',
|
|
84
|
+
};
|
|
85
|
+
services.set(serviceConfig.name, serviceConfig);
|
|
86
|
+
Logger.info(`Registered microservice: ${serviceConfig.name}`);
|
|
87
|
+
return serviceConfig;
|
|
88
|
+
};
|
|
89
|
+
const startService = async (name, _handler) => {
|
|
90
|
+
const service = services.get(name);
|
|
91
|
+
if (service === undefined) {
|
|
92
|
+
throw ErrorFactory.createNotFoundError('Service not found', { name });
|
|
93
|
+
}
|
|
94
|
+
service.status = 'running';
|
|
95
|
+
Logger.info(`Service started: ${name}`);
|
|
96
|
+
return true;
|
|
97
|
+
};
|
|
98
|
+
const stopService = async (name) => {
|
|
99
|
+
const service = services.get(name);
|
|
100
|
+
if (service === undefined) {
|
|
101
|
+
return false;
|
|
102
|
+
}
|
|
103
|
+
service.status = 'stopped';
|
|
104
|
+
Logger.info(`Service stopped: ${name}`);
|
|
105
|
+
return true;
|
|
106
|
+
};
|
|
107
|
+
const stopAllServices = async () => {
|
|
108
|
+
Logger.info('Stopping all microservices...');
|
|
109
|
+
for (const service of services.values()) {
|
|
110
|
+
service.status = 'stopped';
|
|
111
|
+
}
|
|
112
|
+
};
|
|
113
|
+
const getService = (domain, name) => {
|
|
114
|
+
const service = services.get(name);
|
|
115
|
+
if (service === undefined) {
|
|
116
|
+
return undefined;
|
|
117
|
+
}
|
|
118
|
+
return service.domain === domain ? service : undefined;
|
|
119
|
+
};
|
|
120
|
+
const getAllServices = () => {
|
|
121
|
+
return Array.from(services.values());
|
|
122
|
+
};
|
|
123
|
+
const getServicesByDomain = (domain) => {
|
|
124
|
+
return Array.from(services.values()).filter((s) => s.domain === domain);
|
|
125
|
+
};
|
|
126
|
+
const callService = async (name, pathOrOptions, options) => {
|
|
127
|
+
const service = services.get(name);
|
|
128
|
+
if (service === undefined) {
|
|
129
|
+
throw ErrorFactory.createNotFoundError('Service not found', { name });
|
|
130
|
+
}
|
|
131
|
+
if (service.status !== 'running') {
|
|
132
|
+
throw ErrorFactory.createConnectionError('Service not running', {
|
|
133
|
+
name,
|
|
134
|
+
status: service.status,
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
const callOptions = toCallOptions(pathOrOptions, options);
|
|
138
|
+
const path = callOptions.path ?? '/';
|
|
139
|
+
const method = (callOptions.method ?? 'GET').toUpperCase();
|
|
140
|
+
const resolvedBaseUrl = service.baseUrl ?? `http://localhost:${service.port ?? basePort}`;
|
|
141
|
+
const url = `${resolvedBaseUrl}${path}`;
|
|
142
|
+
validateUrl(url);
|
|
143
|
+
const controller = new AbortController();
|
|
144
|
+
const timeoutMs = callOptions.timeout;
|
|
145
|
+
let timeoutId;
|
|
146
|
+
if (typeof timeoutMs === 'number') {
|
|
147
|
+
// eslint-disable-next-line no-restricted-syntax
|
|
148
|
+
timeoutId = setTimeout(() => controller.abort(), timeoutMs);
|
|
149
|
+
}
|
|
150
|
+
try {
|
|
151
|
+
const init = {
|
|
152
|
+
method,
|
|
153
|
+
headers: callOptions.headers,
|
|
154
|
+
signal: controller.signal,
|
|
155
|
+
};
|
|
156
|
+
if (method === 'POST' || method === 'PUT' || method === 'PATCH') {
|
|
157
|
+
init.body = JSON.stringify(callOptions.body ?? {});
|
|
158
|
+
}
|
|
159
|
+
const response = await globalThis.fetch(url, init);
|
|
160
|
+
const data = await response.json().catch(() => ({}));
|
|
161
|
+
return {
|
|
162
|
+
statusCode: response.status,
|
|
163
|
+
data,
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
catch (error) {
|
|
167
|
+
if (timeoutId !== undefined) {
|
|
168
|
+
clearTimeout(timeoutId);
|
|
169
|
+
}
|
|
170
|
+
throw ErrorFactory.createTryCatchError('Failed to call service', error);
|
|
171
|
+
}
|
|
172
|
+
finally {
|
|
173
|
+
if (timeoutId !== undefined) {
|
|
174
|
+
clearTimeout(timeoutId);
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
};
|
|
178
|
+
const checkServiceHealth = async (name) => {
|
|
179
|
+
const service = services.get(name);
|
|
180
|
+
if (service === undefined) {
|
|
181
|
+
return false;
|
|
182
|
+
}
|
|
183
|
+
const healthPath = service.healthCheckUrl ?? '/health';
|
|
184
|
+
const resolvedBaseUrl = service.baseUrl ?? `http://localhost:${service.port ?? basePort}`;
|
|
185
|
+
const url = `${resolvedBaseUrl}${healthPath}`;
|
|
186
|
+
validateUrl(url);
|
|
187
|
+
try {
|
|
188
|
+
const response = await globalThis.fetch(url, { method: 'GET' });
|
|
189
|
+
const healthy = response.ok === true;
|
|
190
|
+
service.lastHealthCheck = Date.now();
|
|
191
|
+
return healthy;
|
|
192
|
+
}
|
|
193
|
+
catch (error) {
|
|
194
|
+
service.lastHealthCheck = Date.now();
|
|
195
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
196
|
+
Logger.error('Health check failed', message);
|
|
197
|
+
return false;
|
|
198
|
+
}
|
|
199
|
+
};
|
|
200
|
+
const healthCheckAll = async () => {
|
|
201
|
+
const results = {};
|
|
202
|
+
for (const name of services.keys()) {
|
|
203
|
+
results[name] = await checkServiceHealth(name);
|
|
204
|
+
}
|
|
205
|
+
return results;
|
|
206
|
+
};
|
|
207
|
+
const getStatusSummary = () => {
|
|
208
|
+
const allServices = Array.from(services.values());
|
|
209
|
+
const runningServices = allServices.filter((s) => s.status === 'running').length;
|
|
210
|
+
return {
|
|
211
|
+
totalServices: allServices.length,
|
|
212
|
+
runningServices,
|
|
213
|
+
services: allServices.map((s) => ({
|
|
214
|
+
name: s.name,
|
|
215
|
+
domain: s.domain,
|
|
216
|
+
version: s.version,
|
|
217
|
+
status: s.status,
|
|
218
|
+
lastHealthCheck: s.lastHealthCheck,
|
|
219
|
+
})),
|
|
220
|
+
timestamp: Date.now(),
|
|
221
|
+
};
|
|
222
|
+
};
|
|
223
|
+
const discoverServices = async () => {
|
|
224
|
+
return Array.from(services.values());
|
|
225
|
+
};
|
|
226
|
+
const getMicroserviceManager = () => MicroserviceManager;
|
|
227
|
+
export const MicroserviceManager = Object.freeze({
|
|
228
|
+
create,
|
|
229
|
+
getInstance,
|
|
230
|
+
reset,
|
|
231
|
+
initialize,
|
|
232
|
+
register,
|
|
233
|
+
registerService,
|
|
234
|
+
startService,
|
|
235
|
+
stopService,
|
|
236
|
+
stopAllServices,
|
|
237
|
+
getService,
|
|
238
|
+
getAllServices,
|
|
239
|
+
getServicesByDomain,
|
|
240
|
+
callService,
|
|
241
|
+
checkServiceHealth,
|
|
242
|
+
healthCheckAll,
|
|
243
|
+
getStatusSummary,
|
|
244
|
+
discoverServices,
|
|
245
|
+
});
|
|
246
|
+
export function isMicroservicesEnabled() {
|
|
247
|
+
const direct = (Env.get('MICROSERVICES') ?? '').trim();
|
|
248
|
+
if (direct.toLowerCase() === 'true') {
|
|
249
|
+
return true;
|
|
250
|
+
}
|
|
251
|
+
// Fallback flag used in tests/legacy setups.
|
|
252
|
+
return Env.getBool('ENABLE_MICROSERVICES', false);
|
|
253
|
+
}
|
|
254
|
+
export function getEnabledServices() {
|
|
255
|
+
const raw = (Env.get('SERVICES') ?? '').trim();
|
|
256
|
+
if (raw.length === 0) {
|
|
257
|
+
return [];
|
|
258
|
+
}
|
|
259
|
+
return raw
|
|
260
|
+
.split(',')
|
|
261
|
+
.map((service) => service.trim())
|
|
262
|
+
.filter((service) => service.length > 0);
|
|
263
|
+
}
|
|
264
|
+
// Re-export functions for backward compatibility
|
|
265
|
+
export { callService, checkServiceHealth, create, discoverServices, getAllServices, getInstance, getService, getServicesByDomain, getStatusSummary, healthCheckAll, initialize, register, registerService, reset, startService, stopAllServices, stopService, };
|
|
266
|
+
export default MicroserviceManager;
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Minimal interfaces for PostgreSQL to avoid direct dependency on 'pg' types
|
|
3
|
+
*/
|
|
4
|
+
export interface PostgresPool {
|
|
5
|
+
connect(): Promise<PostgresClient>;
|
|
6
|
+
query(sql: string, params?: unknown[]): Promise<{
|
|
7
|
+
rows: unknown[];
|
|
8
|
+
rowCount?: number;
|
|
9
|
+
}>;
|
|
10
|
+
end(): Promise<void>;
|
|
11
|
+
on(event: string, listener: (...args: unknown[]) => void): this;
|
|
12
|
+
totalCount: number;
|
|
13
|
+
idleCount: number;
|
|
14
|
+
waitingCount: number;
|
|
15
|
+
}
|
|
16
|
+
export interface PostgresClient {
|
|
17
|
+
query(sql: string, params?: unknown[]): Promise<{
|
|
18
|
+
rows: unknown[];
|
|
19
|
+
rowCount?: number;
|
|
20
|
+
}>;
|
|
21
|
+
release(): void;
|
|
22
|
+
}
|
|
23
|
+
export type PoolClient = PostgresClient;
|
|
24
|
+
/**
|
|
25
|
+
* PostgreSQL Connection Pool Configuration
|
|
26
|
+
*/
|
|
27
|
+
export interface PostgresPoolConfig {
|
|
28
|
+
host: string;
|
|
29
|
+
port: number;
|
|
30
|
+
database: string;
|
|
31
|
+
user: string;
|
|
32
|
+
password: string;
|
|
33
|
+
max?: number;
|
|
34
|
+
idleTimeoutMillis?: number;
|
|
35
|
+
connectionTimeoutMillis?: number;
|
|
36
|
+
serviceName?: string;
|
|
37
|
+
isolation?: 'shared' | 'isolated';
|
|
38
|
+
}
|
|
39
|
+
export interface IPostgresAdapter {
|
|
40
|
+
getPoolKey(): string;
|
|
41
|
+
connect(): Promise<void>;
|
|
42
|
+
getPool(): PostgresPool;
|
|
43
|
+
query<T = unknown>(sql: string, params?: unknown[]): Promise<T[]>;
|
|
44
|
+
execute<T = unknown>(sql: string, params?: unknown[]): Promise<{
|
|
45
|
+
rows: T[];
|
|
46
|
+
rowCount: number;
|
|
47
|
+
}>;
|
|
48
|
+
transaction<T>(callback: (client: PoolClient) => Promise<T>): Promise<T>;
|
|
49
|
+
getPoolStats(): {
|
|
50
|
+
totalConnections: number;
|
|
51
|
+
idleConnections: number;
|
|
52
|
+
waitingRequests: number;
|
|
53
|
+
};
|
|
54
|
+
disconnect(): Promise<void>;
|
|
55
|
+
disconnectAll(): Promise<void>;
|
|
56
|
+
createServiceSchema(schemaName: string): Promise<void>;
|
|
57
|
+
runMigrations(migrations: Array<{
|
|
58
|
+
up: (client: PoolClient) => Promise<void>;
|
|
59
|
+
}>): Promise<void>;
|
|
60
|
+
healthCheck(): Promise<boolean>;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* PostgreSQL Adapter with Connection Pooling
|
|
64
|
+
* Supports both shared (multi-service) and isolated (per-service) database modes
|
|
65
|
+
*/
|
|
66
|
+
type PostgresAdapterConstructor = {
|
|
67
|
+
new (config: PostgresPoolConfig): IPostgresAdapter;
|
|
68
|
+
create(config: PostgresPoolConfig): IPostgresAdapter;
|
|
69
|
+
prototype: IPostgresAdapter;
|
|
70
|
+
};
|
|
71
|
+
export declare const PostgresAdapter: PostgresAdapterConstructor;
|
|
72
|
+
/**
|
|
73
|
+
* Get or create adapter instance
|
|
74
|
+
*/
|
|
75
|
+
export declare function getInstance(config: PostgresPoolConfig, key?: string): IPostgresAdapter;
|
|
76
|
+
/**
|
|
77
|
+
* Get all instances
|
|
78
|
+
*/
|
|
79
|
+
export declare function getAllInstances(): IPostgresAdapter[];
|
|
80
|
+
/**
|
|
81
|
+
* Disconnect all instances
|
|
82
|
+
*/
|
|
83
|
+
export declare function disconnectAll(): Promise<void>;
|
|
84
|
+
export declare const PostgresAdapterManager: Readonly<{
|
|
85
|
+
getInstance: typeof getInstance;
|
|
86
|
+
getAllInstances: typeof getAllInstances;
|
|
87
|
+
disconnectAll: typeof disconnectAll;
|
|
88
|
+
}>;
|
|
89
|
+
export default PostgresAdapter;
|
|
90
|
+
//# sourceMappingURL=PostgresAdapter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PostgresAdapter.d.ts","sourceRoot":"","sources":["../../../src/microservices/PostgresAdapter.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,286 @@
|
|
|
1
|
+
import { Logger } from '../config/logger';
|
|
2
|
+
import { ErrorFactory } from '../exceptions/ZintrustError';
|
|
3
|
+
const poolsByInstance = new WeakMap();
|
|
4
|
+
const configByInstance = new WeakMap();
|
|
5
|
+
function getAdapterConfig(adapter) {
|
|
6
|
+
const config = configByInstance.get(adapter);
|
|
7
|
+
if (config === undefined) {
|
|
8
|
+
throw ErrorFactory.createConfigError('PostgresAdapter not initialized');
|
|
9
|
+
}
|
|
10
|
+
return config;
|
|
11
|
+
}
|
|
12
|
+
function getPools(adapter) {
|
|
13
|
+
const pools = poolsByInstance.get(adapter);
|
|
14
|
+
if (pools === undefined) {
|
|
15
|
+
throw ErrorFactory.createConfigError('PostgresAdapter not initialized');
|
|
16
|
+
}
|
|
17
|
+
return pools;
|
|
18
|
+
}
|
|
19
|
+
// Function-constructor implementation (no `class` keyword) but still constructable via `new`.
|
|
20
|
+
function PostgresAdapterImpl(config) {
|
|
21
|
+
const adapterConfig = {
|
|
22
|
+
max: 20,
|
|
23
|
+
idleTimeoutMillis: 30000,
|
|
24
|
+
connectionTimeoutMillis: 2000,
|
|
25
|
+
isolation: 'shared',
|
|
26
|
+
...config,
|
|
27
|
+
};
|
|
28
|
+
poolsByInstance.set(this, new Map());
|
|
29
|
+
configByInstance.set(this, adapterConfig);
|
|
30
|
+
}
|
|
31
|
+
PostgresAdapterImpl.prototype.getPoolKey = function getPoolKey() {
|
|
32
|
+
const adapterConfig = getAdapterConfig(this);
|
|
33
|
+
if (adapterConfig.isolation === 'isolated' && adapterConfig.serviceName !== undefined) {
|
|
34
|
+
return `${adapterConfig.host}:${adapterConfig.port}/${adapterConfig.serviceName}`;
|
|
35
|
+
}
|
|
36
|
+
return `${adapterConfig.host}:${adapterConfig.port}/${adapterConfig.database}`;
|
|
37
|
+
};
|
|
38
|
+
PostgresAdapterImpl.prototype.connect = async function connect() {
|
|
39
|
+
const adapterConfig = getAdapterConfig(this);
|
|
40
|
+
const pools = getPools(this);
|
|
41
|
+
return runConnect(adapterConfig, pools, () => this.getPoolKey());
|
|
42
|
+
};
|
|
43
|
+
PostgresAdapterImpl.prototype.getPool = function getPool() {
|
|
44
|
+
const pools = getPools(this);
|
|
45
|
+
return runGetPool(pools, () => this.getPoolKey());
|
|
46
|
+
};
|
|
47
|
+
PostgresAdapterImpl.prototype.query = async function query(sql, params) {
|
|
48
|
+
return runQuery(this.getPool(), sql, params);
|
|
49
|
+
};
|
|
50
|
+
PostgresAdapterImpl.prototype.execute = async function execute(sql, params) {
|
|
51
|
+
return runExecute(this.getPool(), sql, params);
|
|
52
|
+
};
|
|
53
|
+
PostgresAdapterImpl.prototype.transaction = async function transaction(callback) {
|
|
54
|
+
return runTransaction(this.getPool(), callback);
|
|
55
|
+
};
|
|
56
|
+
PostgresAdapterImpl.prototype.getPoolStats = function getPoolStats() {
|
|
57
|
+
return runGetPoolStats(this.getPool());
|
|
58
|
+
};
|
|
59
|
+
PostgresAdapterImpl.prototype.disconnect = async function disconnect() {
|
|
60
|
+
const pools = getPools(this);
|
|
61
|
+
return runDisconnect(pools, () => this.getPoolKey());
|
|
62
|
+
};
|
|
63
|
+
PostgresAdapterImpl.prototype.disconnectAll = async function disconnectAll() {
|
|
64
|
+
const pools = getPools(this);
|
|
65
|
+
return runDisconnectAll(pools);
|
|
66
|
+
};
|
|
67
|
+
PostgresAdapterImpl.prototype.createServiceSchema = async function createServiceSchema(schemaName) {
|
|
68
|
+
const adapterConfig = getAdapterConfig(this);
|
|
69
|
+
return runCreateServiceSchema(this, adapterConfig.isolation, schemaName);
|
|
70
|
+
};
|
|
71
|
+
PostgresAdapterImpl.prototype.runMigrations = async function runMigrationsPublic(migrations) {
|
|
72
|
+
return runMigrations(this.getPool(), migrations);
|
|
73
|
+
};
|
|
74
|
+
PostgresAdapterImpl.prototype.healthCheck = async function healthCheck() {
|
|
75
|
+
return runHealthCheck(this.getPool());
|
|
76
|
+
};
|
|
77
|
+
export const PostgresAdapter = PostgresAdapterImpl;
|
|
78
|
+
PostgresAdapter.create = (config) => new PostgresAdapter(config);
|
|
79
|
+
/**
|
|
80
|
+
* Internal function to get connection pool
|
|
81
|
+
*/
|
|
82
|
+
function runGetPool(pools, getPoolKey) {
|
|
83
|
+
const poolKey = getPoolKey();
|
|
84
|
+
const pool = pools.get(poolKey);
|
|
85
|
+
if (pool === undefined) {
|
|
86
|
+
throw ErrorFactory.createConnectionError('Connection pool not initialized. Call connect() first.', { poolKey });
|
|
87
|
+
}
|
|
88
|
+
return pool;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Internal function to get pool statistics
|
|
92
|
+
*/
|
|
93
|
+
function runGetPoolStats(pool) {
|
|
94
|
+
return {
|
|
95
|
+
totalConnections: pool.totalCount,
|
|
96
|
+
idleConnections: pool.idleCount,
|
|
97
|
+
waitingRequests: pool.waitingCount,
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Internal function to disconnect a pool
|
|
102
|
+
*/
|
|
103
|
+
async function runDisconnect(pools, getPoolKey) {
|
|
104
|
+
const poolKey = getPoolKey();
|
|
105
|
+
const pool = pools.get(poolKey);
|
|
106
|
+
if (pool !== undefined) {
|
|
107
|
+
await pool.end();
|
|
108
|
+
pools.delete(poolKey);
|
|
109
|
+
Logger.info(`🔌 PostgreSQL disconnected: ${poolKey}`);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Internal function to disconnect all pools
|
|
114
|
+
*/
|
|
115
|
+
async function runDisconnectAll(pools) {
|
|
116
|
+
const promises = Array.from(pools.values()).map(async (pool) => pool.end());
|
|
117
|
+
await Promise.all(promises);
|
|
118
|
+
pools.clear();
|
|
119
|
+
Logger.info('🔌 All PostgreSQL pools disconnected');
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Internal function to connect to PostgreSQL
|
|
123
|
+
*/
|
|
124
|
+
async function runConnect(adapterConfig, pools, getPoolKey) {
|
|
125
|
+
const poolKey = getPoolKey();
|
|
126
|
+
if (pools.has(poolKey) === true) {
|
|
127
|
+
Logger.info(`♻️ Reusing existing connection pool: ${poolKey}`);
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
try {
|
|
131
|
+
// Dynamic import to keep core zero-dependency
|
|
132
|
+
// @ts-expect-error: pg might not be installed in core
|
|
133
|
+
const { Pool } = await import('pg');
|
|
134
|
+
const pool = new Pool({
|
|
135
|
+
host: adapterConfig.host,
|
|
136
|
+
port: adapterConfig.port,
|
|
137
|
+
database: adapterConfig.database,
|
|
138
|
+
user: adapterConfig.user,
|
|
139
|
+
password: adapterConfig.password,
|
|
140
|
+
max: adapterConfig.max,
|
|
141
|
+
idleTimeoutMillis: adapterConfig.idleTimeoutMillis,
|
|
142
|
+
connectionTimeoutMillis: adapterConfig.connectionTimeoutMillis,
|
|
143
|
+
});
|
|
144
|
+
pool.on('error', (err) => {
|
|
145
|
+
Logger.error(`Unexpected error on idle client for ${poolKey}`, err);
|
|
146
|
+
});
|
|
147
|
+
const client = await pool.connect();
|
|
148
|
+
Logger.info(`✅ PostgreSQL connected: ${adapterConfig.host}:${adapterConfig.port}/${adapterConfig.database}`);
|
|
149
|
+
client.release();
|
|
150
|
+
pools.set(poolKey, pool);
|
|
151
|
+
Logger.info(`🐘 PostgreSQL pool initialized: ${poolKey}`);
|
|
152
|
+
}
|
|
153
|
+
catch (error) {
|
|
154
|
+
throw ErrorFactory.createTryCatchError(`Failed to initialize PostgreSQL pool: ${error.message}`, error);
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* Internal function to execute a query
|
|
159
|
+
*/
|
|
160
|
+
async function runQuery(pool, sql, params) {
|
|
161
|
+
try {
|
|
162
|
+
const result = await pool.query(sql, params);
|
|
163
|
+
return result.rows;
|
|
164
|
+
}
|
|
165
|
+
catch (error) {
|
|
166
|
+
Logger.error(`PostgreSQL query failed: ${sql}`, error);
|
|
167
|
+
throw error;
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* Internal function to execute a query and return full result
|
|
172
|
+
*/
|
|
173
|
+
async function runExecute(pool, sql, params) {
|
|
174
|
+
try {
|
|
175
|
+
const result = await pool.query(sql, params);
|
|
176
|
+
return {
|
|
177
|
+
rows: result.rows,
|
|
178
|
+
rowCount: result.rowCount ?? 0,
|
|
179
|
+
};
|
|
180
|
+
}
|
|
181
|
+
catch (err) {
|
|
182
|
+
Logger.error(`PostgreSQL execute failed: ${sql}`, err);
|
|
183
|
+
throw err;
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* Internal function to run a transaction
|
|
188
|
+
*/
|
|
189
|
+
async function runTransaction(pool, callback) {
|
|
190
|
+
const client = await pool.connect();
|
|
191
|
+
try {
|
|
192
|
+
await client.query('BEGIN');
|
|
193
|
+
const result = await callback(client);
|
|
194
|
+
await client.query('COMMIT');
|
|
195
|
+
return result;
|
|
196
|
+
}
|
|
197
|
+
catch (err) {
|
|
198
|
+
Logger.error('Transaction failed, rolling back', err);
|
|
199
|
+
await client.query('ROLLBACK');
|
|
200
|
+
throw err;
|
|
201
|
+
}
|
|
202
|
+
finally {
|
|
203
|
+
client.release();
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
/**
|
|
207
|
+
* Internal function to create service schema
|
|
208
|
+
*/
|
|
209
|
+
async function runCreateServiceSchema(adapter, isolation, schemaName) {
|
|
210
|
+
if (isolation !== 'isolated') {
|
|
211
|
+
Logger.info('ℹ️ Shared database mode: skipping schema creation');
|
|
212
|
+
return;
|
|
213
|
+
}
|
|
214
|
+
try {
|
|
215
|
+
await adapter.query(`CREATE SCHEMA IF NOT EXISTS "${schemaName}"`);
|
|
216
|
+
Logger.info(`✅ Schema created: ${schemaName}`);
|
|
217
|
+
}
|
|
218
|
+
catch (err) {
|
|
219
|
+
Logger.error(`Schema creation failed: ${schemaName}`, err);
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
/**
|
|
223
|
+
* Internal function to run migrations
|
|
224
|
+
*/
|
|
225
|
+
async function runMigrations(pool, migrations) {
|
|
226
|
+
const client = await pool.connect();
|
|
227
|
+
try {
|
|
228
|
+
for (const migration of migrations) {
|
|
229
|
+
await migration.up(client);
|
|
230
|
+
}
|
|
231
|
+
Logger.info(`✅ Migrations completed`);
|
|
232
|
+
}
|
|
233
|
+
finally {
|
|
234
|
+
client.release();
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
/**
|
|
238
|
+
* Internal function for health check
|
|
239
|
+
*/
|
|
240
|
+
async function runHealthCheck(pool) {
|
|
241
|
+
try {
|
|
242
|
+
const result = await pool.query('SELECT 1');
|
|
243
|
+
return result.rows.length > 0;
|
|
244
|
+
}
|
|
245
|
+
catch (error) {
|
|
246
|
+
Logger.error('PostgreSQL health check failed', error);
|
|
247
|
+
return false;
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
/**
|
|
251
|
+
* Global PostgreSQL adapter instance management
|
|
252
|
+
*/
|
|
253
|
+
const instances = new Map();
|
|
254
|
+
/**
|
|
255
|
+
* Get or create adapter instance
|
|
256
|
+
*/
|
|
257
|
+
export function getInstance(config, key = 'default') {
|
|
258
|
+
const existing = instances.get(key);
|
|
259
|
+
if (existing !== undefined) {
|
|
260
|
+
return existing;
|
|
261
|
+
}
|
|
262
|
+
const created = PostgresAdapter.create(config);
|
|
263
|
+
instances.set(key, created);
|
|
264
|
+
return created;
|
|
265
|
+
}
|
|
266
|
+
/**
|
|
267
|
+
* Get all instances
|
|
268
|
+
*/
|
|
269
|
+
export function getAllInstances() {
|
|
270
|
+
return Array.from(instances.values());
|
|
271
|
+
}
|
|
272
|
+
/**
|
|
273
|
+
* Disconnect all instances
|
|
274
|
+
*/
|
|
275
|
+
export async function disconnectAll() {
|
|
276
|
+
for (const adapter of instances.values()) {
|
|
277
|
+
await adapter.disconnectAll();
|
|
278
|
+
}
|
|
279
|
+
instances.clear();
|
|
280
|
+
}
|
|
281
|
+
export const PostgresAdapterManager = Object.freeze({
|
|
282
|
+
getInstance,
|
|
283
|
+
getAllInstances,
|
|
284
|
+
disconnectAll,
|
|
285
|
+
});
|
|
286
|
+
export default PostgresAdapter;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { IRequest } from '../http/Request';
|
|
2
|
+
import { IResponse } from '../http/Response';
|
|
3
|
+
export type NextFunction = (error?: Error) => void | Promise<void>;
|
|
4
|
+
export interface MNextFunction {
|
|
5
|
+
middleware(serviceName: string, enabled?: boolean, samplingRate?: number): (req: IRequest, res: IResponse, next: NextFunction) => void | Promise<void>;
|
|
6
|
+
injectHeaders(serviceName: string, _targetServiceName: string): (headers: Record<string, string>, traceId?: string) => Record<string, string>;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Request trace metadata
|
|
10
|
+
*/
|
|
11
|
+
export interface TraceContext {
|
|
12
|
+
traceId: string;
|
|
13
|
+
parentServiceId?: string;
|
|
14
|
+
depth: number;
|
|
15
|
+
startTime: number;
|
|
16
|
+
serviceName: string;
|
|
17
|
+
}
|
|
18
|
+
export interface ITraceLogger {
|
|
19
|
+
info(message: string, data?: Record<string, unknown>): void;
|
|
20
|
+
warn(message: string, data?: Record<string, unknown>): void;
|
|
21
|
+
error(message: string, data?: Record<string, unknown>): void;
|
|
22
|
+
debug(message: string, data?: Record<string, unknown>): void;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Trace logger for structured logging
|
|
26
|
+
*/
|
|
27
|
+
export declare const TraceLogger: Readonly<{
|
|
28
|
+
/**
|
|
29
|
+
* Create a new trace logger instance
|
|
30
|
+
*/
|
|
31
|
+
create(traceId: string, serviceName: string): ITraceLogger;
|
|
32
|
+
}>;
|
|
33
|
+
/**
|
|
34
|
+
* Request Tracing Middleware
|
|
35
|
+
* Enables request tracking across microservices for debugging and observability
|
|
36
|
+
*/
|
|
37
|
+
export declare function RequestTracingMiddlewareFactory(): MNextFunction;
|
|
38
|
+
export declare const RequestTracingMiddleware: MNextFunction;
|
|
39
|
+
export declare const middleware: (serviceName: string, enabled?: boolean, samplingRate?: number) => ((req: IRequest, res: IResponse, next: NextFunction) => void | Promise<void>);
|
|
40
|
+
export default RequestTracingMiddleware;
|
|
41
|
+
//# sourceMappingURL=RequestTracingMiddleware.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RequestTracingMiddleware.d.ts","sourceRoot":"","sources":["../../../src/microservices/RequestTracingMiddleware.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAI3C,MAAM,MAAM,YAAY,GAAG,CAAC,KAAK,CAAC,EAAE,KAAK,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;AAEnE,MAAM,WAAW,aAAa;IAC5B,UAAU,CACR,WAAW,EAAE,MAAM,EACnB,OAAO,CAAC,EAAE,OAAO,EACjB,YAAY,CAAC,EAAE,MAAM,GACpB,CAAC,GAAG,EAAE,QAAQ,EAAE,GAAG,EAAE,SAAS,EAAE,IAAI,EAAE,YAAY,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC/E,aAAa,CACX,WAAW,EAAE,MAAM,EACnB,kBAAkB,EAAE,MAAM,GACzB,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,OAAO,CAAC,EAAE,MAAM,KAAK,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAClF;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,MAAM,CAAC;IAChB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,YAAY;IAC3B,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IAC5D,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IAC5D,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IAC7D,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;CAC9D;AAED;;GAEG;AACH,eAAO,MAAM,WAAW;IACtB;;OAEG;oBACa,MAAM,eAAe,MAAM,GAAG,YAAY;EAqB1D,CAAC;AAiGH;;;GAGG;AACH,wBAAgB,+BAA+B,IAAI,aAAa,CAuB/D;AAED,eAAO,MAAM,wBAAwB,EAAE,aAAiD,CAAC;AAEzF,eAAO,MAAM,UAAU,GACrB,aAAa,MAAM,EACnB,UAAS,OAAc,EACvB,eAAc,MAAU,KACvB,CAAC,CAAC,GAAG,EAAE,QAAQ,EAAE,GAAG,EAAE,SAAS,EAAE,IAAI,EAAE,YAAY,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CACN,CAAC;AAE1E,eAAe,wBAAwB,CAAC"}
|