@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,195 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Configuration Schema
|
|
3
|
+
* Defines the structure and types for Zintrust configuration
|
|
4
|
+
*/
|
|
5
|
+
export interface DatabaseConfig {
|
|
6
|
+
connection: 'sqlite' | 'postgres' | 'mysql' | 'mariadb';
|
|
7
|
+
host?: string;
|
|
8
|
+
port?: number;
|
|
9
|
+
database?: string;
|
|
10
|
+
username?: string;
|
|
11
|
+
password?: string;
|
|
12
|
+
charset?: string;
|
|
13
|
+
collation?: string;
|
|
14
|
+
synchronize?: boolean;
|
|
15
|
+
logging?: boolean;
|
|
16
|
+
}
|
|
17
|
+
export interface ServerConfig {
|
|
18
|
+
port: number;
|
|
19
|
+
host: string;
|
|
20
|
+
environment: 'development' | 'production' | 'testing';
|
|
21
|
+
debug: boolean;
|
|
22
|
+
profiling: boolean;
|
|
23
|
+
tracing: boolean;
|
|
24
|
+
}
|
|
25
|
+
export interface AuthConfig {
|
|
26
|
+
enabled: boolean;
|
|
27
|
+
strategy: 'jwt' | 'session' | 'apikey';
|
|
28
|
+
jwtSecret?: string;
|
|
29
|
+
sessionSecret?: string;
|
|
30
|
+
expiresIn: string;
|
|
31
|
+
}
|
|
32
|
+
export interface MicroservicesConfig {
|
|
33
|
+
enabled: boolean;
|
|
34
|
+
port: number;
|
|
35
|
+
apiGatewayPort?: number;
|
|
36
|
+
discoveryType: 'filesystem' | 'consul' | 'kubernetes';
|
|
37
|
+
healthCheckInterval: number;
|
|
38
|
+
}
|
|
39
|
+
export interface FeatureConfig {
|
|
40
|
+
auth: boolean;
|
|
41
|
+
database: boolean;
|
|
42
|
+
cache: boolean;
|
|
43
|
+
queue: boolean;
|
|
44
|
+
storage: boolean;
|
|
45
|
+
email: boolean;
|
|
46
|
+
webhooks: boolean;
|
|
47
|
+
monitoring: boolean;
|
|
48
|
+
}
|
|
49
|
+
export interface ProjectConfig {
|
|
50
|
+
name: string;
|
|
51
|
+
version: string;
|
|
52
|
+
description?: string;
|
|
53
|
+
author?: string;
|
|
54
|
+
database: DatabaseConfig;
|
|
55
|
+
server: ServerConfig;
|
|
56
|
+
auth: AuthConfig;
|
|
57
|
+
microservices: MicroservicesConfig;
|
|
58
|
+
features: FeatureConfig;
|
|
59
|
+
[key: string]: unknown;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Default configuration values
|
|
63
|
+
*/
|
|
64
|
+
export declare const DEFAULT_CONFIG: Readonly<{
|
|
65
|
+
name: string;
|
|
66
|
+
version: string;
|
|
67
|
+
description: string;
|
|
68
|
+
author: string;
|
|
69
|
+
database: {
|
|
70
|
+
connection: "sqlite";
|
|
71
|
+
charset: string;
|
|
72
|
+
collation: string;
|
|
73
|
+
synchronize: true;
|
|
74
|
+
logging: false;
|
|
75
|
+
};
|
|
76
|
+
server: {
|
|
77
|
+
port: number;
|
|
78
|
+
host: string;
|
|
79
|
+
environment: "development";
|
|
80
|
+
debug: false;
|
|
81
|
+
profiling: false;
|
|
82
|
+
tracing: false;
|
|
83
|
+
};
|
|
84
|
+
auth: {
|
|
85
|
+
enabled: false;
|
|
86
|
+
strategy: "jwt";
|
|
87
|
+
expiresIn: string;
|
|
88
|
+
};
|
|
89
|
+
microservices: {
|
|
90
|
+
enabled: false;
|
|
91
|
+
port: number;
|
|
92
|
+
discoveryType: "filesystem";
|
|
93
|
+
healthCheckInterval: number;
|
|
94
|
+
};
|
|
95
|
+
features: {
|
|
96
|
+
auth: false;
|
|
97
|
+
database: true;
|
|
98
|
+
cache: false;
|
|
99
|
+
queue: false;
|
|
100
|
+
storage: false;
|
|
101
|
+
email: false;
|
|
102
|
+
webhooks: false;
|
|
103
|
+
monitoring: false;
|
|
104
|
+
};
|
|
105
|
+
}>;
|
|
106
|
+
/**
|
|
107
|
+
* Configuration paths
|
|
108
|
+
* Sealed namespace for immutability
|
|
109
|
+
*/
|
|
110
|
+
export declare const ConfigPaths: Readonly<{
|
|
111
|
+
GLOBAL_DIR: string;
|
|
112
|
+
GLOBAL_CONFIG: `${string}/config.json`;
|
|
113
|
+
PROJECT_CONFIG: ".zintrust.json";
|
|
114
|
+
PROJECT_CONFIG_TS: "zintrust.config.ts";
|
|
115
|
+
ENV_FILE: ".env";
|
|
116
|
+
ENV_EXAMPLE: ".env.example";
|
|
117
|
+
}>;
|
|
118
|
+
/**
|
|
119
|
+
* Validation rule interface
|
|
120
|
+
*/
|
|
121
|
+
export interface ValidationRule {
|
|
122
|
+
type?: string;
|
|
123
|
+
required?: boolean;
|
|
124
|
+
minLength?: number;
|
|
125
|
+
maxLength?: number;
|
|
126
|
+
pattern?: RegExp;
|
|
127
|
+
min?: number;
|
|
128
|
+
max?: number;
|
|
129
|
+
enum?: string[];
|
|
130
|
+
description?: string;
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Validation rules for each config section
|
|
134
|
+
* Sealed namespace for immutability
|
|
135
|
+
*/
|
|
136
|
+
export declare const CONFIG_RULES: Readonly<{
|
|
137
|
+
name: {
|
|
138
|
+
type: string;
|
|
139
|
+
required: boolean;
|
|
140
|
+
minLength: number;
|
|
141
|
+
maxLength: number;
|
|
142
|
+
pattern: RegExp;
|
|
143
|
+
description: string;
|
|
144
|
+
};
|
|
145
|
+
version: {
|
|
146
|
+
type: string;
|
|
147
|
+
required: boolean;
|
|
148
|
+
pattern: RegExp;
|
|
149
|
+
description: string;
|
|
150
|
+
};
|
|
151
|
+
'server.port': {
|
|
152
|
+
type: string;
|
|
153
|
+
required: boolean;
|
|
154
|
+
min: number;
|
|
155
|
+
max: number;
|
|
156
|
+
description: string;
|
|
157
|
+
};
|
|
158
|
+
'server.environment': {
|
|
159
|
+
type: string;
|
|
160
|
+
required: boolean;
|
|
161
|
+
enum: string[];
|
|
162
|
+
description: string;
|
|
163
|
+
};
|
|
164
|
+
'database.connection': {
|
|
165
|
+
type: string;
|
|
166
|
+
required: boolean;
|
|
167
|
+
enum: string[];
|
|
168
|
+
description: string;
|
|
169
|
+
};
|
|
170
|
+
'auth.strategy': {
|
|
171
|
+
type: string;
|
|
172
|
+
required: boolean;
|
|
173
|
+
enum: string[];
|
|
174
|
+
description: string;
|
|
175
|
+
};
|
|
176
|
+
'microservices.discoveryType': {
|
|
177
|
+
type: string;
|
|
178
|
+
required: boolean;
|
|
179
|
+
enum: string[];
|
|
180
|
+
description: string;
|
|
181
|
+
};
|
|
182
|
+
}>;
|
|
183
|
+
/**
|
|
184
|
+
* Get default config for a specific key
|
|
185
|
+
*/
|
|
186
|
+
export declare function getDefaultValue(key: string): unknown;
|
|
187
|
+
/**
|
|
188
|
+
* Set config value in object (deep set)
|
|
189
|
+
*/
|
|
190
|
+
export declare function setConfigValue(obj: Record<string, unknown>, path: string, value: unknown): void;
|
|
191
|
+
/**
|
|
192
|
+
* Get config value from object (deep get)
|
|
193
|
+
*/
|
|
194
|
+
export declare function getConfigValue(obj: Record<string, unknown>, path: string): unknown;
|
|
195
|
+
//# sourceMappingURL=ConfigSchema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConfigSchema.d.ts","sourceRoot":"","sources":["../../../../src/cli/config/ConfigSchema.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Configuration Schema
|
|
3
|
+
* Defines the structure and types for Zintrust configuration
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Default configuration values
|
|
7
|
+
*/
|
|
8
|
+
export const DEFAULT_CONFIG = Object.freeze({
|
|
9
|
+
name: 'zintrust-app',
|
|
10
|
+
version: '1.0.0',
|
|
11
|
+
description: 'A Zintrust application',
|
|
12
|
+
author: 'Developer',
|
|
13
|
+
database: {
|
|
14
|
+
connection: 'sqlite',
|
|
15
|
+
charset: 'utf8',
|
|
16
|
+
collation: 'utf8_unicode_ci',
|
|
17
|
+
synchronize: true,
|
|
18
|
+
logging: false,
|
|
19
|
+
},
|
|
20
|
+
server: {
|
|
21
|
+
port: 3000,
|
|
22
|
+
host: '0.0.0.0',
|
|
23
|
+
environment: 'development',
|
|
24
|
+
debug: false,
|
|
25
|
+
profiling: false,
|
|
26
|
+
tracing: false,
|
|
27
|
+
},
|
|
28
|
+
auth: {
|
|
29
|
+
enabled: false,
|
|
30
|
+
strategy: 'jwt',
|
|
31
|
+
expiresIn: '7d',
|
|
32
|
+
},
|
|
33
|
+
microservices: {
|
|
34
|
+
enabled: false,
|
|
35
|
+
port: 3001,
|
|
36
|
+
discoveryType: 'filesystem',
|
|
37
|
+
healthCheckInterval: 30000,
|
|
38
|
+
},
|
|
39
|
+
features: {
|
|
40
|
+
auth: false,
|
|
41
|
+
database: true,
|
|
42
|
+
cache: false,
|
|
43
|
+
queue: false,
|
|
44
|
+
storage: false,
|
|
45
|
+
email: false,
|
|
46
|
+
webhooks: false,
|
|
47
|
+
monitoring: false,
|
|
48
|
+
},
|
|
49
|
+
});
|
|
50
|
+
/**
|
|
51
|
+
* Configuration paths
|
|
52
|
+
*/
|
|
53
|
+
const HOME_DIR = process.env['HOME'] ?? process.env['USERPROFILE'] ?? '';
|
|
54
|
+
const GLOBAL_DIR = `${HOME_DIR}/.zintrust`;
|
|
55
|
+
/**
|
|
56
|
+
* Configuration paths
|
|
57
|
+
* Sealed namespace for immutability
|
|
58
|
+
*/
|
|
59
|
+
export const ConfigPaths = Object.freeze({
|
|
60
|
+
GLOBAL_DIR,
|
|
61
|
+
GLOBAL_CONFIG: `${GLOBAL_DIR}/config.json`,
|
|
62
|
+
PROJECT_CONFIG: '.zintrust.json',
|
|
63
|
+
PROJECT_CONFIG_TS: 'zintrust.config.ts',
|
|
64
|
+
ENV_FILE: '.env',
|
|
65
|
+
ENV_EXAMPLE: '.env.example',
|
|
66
|
+
});
|
|
67
|
+
/**
|
|
68
|
+
* Validation rules for each config section
|
|
69
|
+
* Sealed namespace for immutability
|
|
70
|
+
*/
|
|
71
|
+
export const CONFIG_RULES = Object.freeze({
|
|
72
|
+
name: {
|
|
73
|
+
type: 'string',
|
|
74
|
+
required: true,
|
|
75
|
+
minLength: 3,
|
|
76
|
+
maxLength: 100,
|
|
77
|
+
pattern: /^[a-z\d\-_]+$/i,
|
|
78
|
+
description: 'Project name (alphanumeric, hyphens, underscores)',
|
|
79
|
+
},
|
|
80
|
+
version: {
|
|
81
|
+
type: 'string',
|
|
82
|
+
required: true,
|
|
83
|
+
// SemVer: MAJOR.MINOR.PATCH with optional -prerelease and +build metadata
|
|
84
|
+
// Avoids `.*` patterns (Sonar S5852: potential super-linear backtracking).
|
|
85
|
+
pattern: /^\d+\.\d+\.\d+(?:-[\dA-Za-z.-]+)?(?:\+[\dA-Za-z.-]+)?$/,
|
|
86
|
+
description: 'Semantic version (e.g. 1.0.0)',
|
|
87
|
+
},
|
|
88
|
+
'server.port': {
|
|
89
|
+
type: 'number',
|
|
90
|
+
required: true,
|
|
91
|
+
min: 1024,
|
|
92
|
+
max: 65535,
|
|
93
|
+
description: 'Server port (1024-65535)',
|
|
94
|
+
},
|
|
95
|
+
'server.environment': {
|
|
96
|
+
type: 'string',
|
|
97
|
+
required: true,
|
|
98
|
+
enum: ['development', 'production', 'testing'],
|
|
99
|
+
description: 'Deployment environment',
|
|
100
|
+
},
|
|
101
|
+
'database.connection': {
|
|
102
|
+
type: 'string',
|
|
103
|
+
required: true,
|
|
104
|
+
enum: ['sqlite', 'postgres', 'mysql', 'mariadb'],
|
|
105
|
+
description: 'Database type',
|
|
106
|
+
},
|
|
107
|
+
'auth.strategy': {
|
|
108
|
+
type: 'string',
|
|
109
|
+
required: true,
|
|
110
|
+
enum: ['jwt', 'session', 'apikey'],
|
|
111
|
+
description: 'Authentication strategy',
|
|
112
|
+
},
|
|
113
|
+
'microservices.discoveryType': {
|
|
114
|
+
type: 'string',
|
|
115
|
+
required: true,
|
|
116
|
+
enum: ['filesystem', 'consul', 'kubernetes'],
|
|
117
|
+
description: 'Service discovery method',
|
|
118
|
+
},
|
|
119
|
+
});
|
|
120
|
+
/**
|
|
121
|
+
* Get default config for a specific key
|
|
122
|
+
*/
|
|
123
|
+
export function getDefaultValue(key) {
|
|
124
|
+
const keys = key.split('.');
|
|
125
|
+
let value = DEFAULT_CONFIG;
|
|
126
|
+
for (const k of keys) {
|
|
127
|
+
if (typeof value === 'object' && value !== null && k in value) {
|
|
128
|
+
value = value[k];
|
|
129
|
+
}
|
|
130
|
+
else {
|
|
131
|
+
return undefined;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
return value;
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* Set config value in object (deep set)
|
|
138
|
+
*/
|
|
139
|
+
export function setConfigValue(obj, path, value) {
|
|
140
|
+
const keys = path.split('.');
|
|
141
|
+
let current = obj;
|
|
142
|
+
for (let i = 0; i < keys.length - 1; i++) {
|
|
143
|
+
const key = keys[i];
|
|
144
|
+
if (!(key in current)) {
|
|
145
|
+
current[key] = {};
|
|
146
|
+
}
|
|
147
|
+
current = current[key];
|
|
148
|
+
}
|
|
149
|
+
const lastKey = keys.at(-1);
|
|
150
|
+
if (lastKey !== undefined) {
|
|
151
|
+
current[lastKey] = value;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* Get config value from object (deep get)
|
|
156
|
+
*/
|
|
157
|
+
export function getConfigValue(obj, path) {
|
|
158
|
+
const keys = path.split('.');
|
|
159
|
+
let current = obj;
|
|
160
|
+
for (const key of keys) {
|
|
161
|
+
if (typeof current === 'object' &&
|
|
162
|
+
current !== null &&
|
|
163
|
+
key in current) {
|
|
164
|
+
current = current[key];
|
|
165
|
+
}
|
|
166
|
+
else {
|
|
167
|
+
return undefined;
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
return current;
|
|
171
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Configuration Validator
|
|
3
|
+
* Validates configuration against schema and rules
|
|
4
|
+
*/
|
|
5
|
+
import { ProjectConfig } from '../config/ConfigSchema';
|
|
6
|
+
export interface ValidationError {
|
|
7
|
+
key: string;
|
|
8
|
+
value: unknown;
|
|
9
|
+
message: string;
|
|
10
|
+
rule: string;
|
|
11
|
+
}
|
|
12
|
+
export interface ValidationResult {
|
|
13
|
+
valid: boolean;
|
|
14
|
+
errors: ValidationError[];
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Validate entire config against schema
|
|
18
|
+
*/
|
|
19
|
+
export declare function validateConfig(config: ProjectConfig): ValidationResult;
|
|
20
|
+
/**
|
|
21
|
+
* Validate a single config value
|
|
22
|
+
*/
|
|
23
|
+
export declare function validateConfigValue(key: string, value: unknown): ValidationError | null;
|
|
24
|
+
/**
|
|
25
|
+
* Format validation errors for display
|
|
26
|
+
*/
|
|
27
|
+
export declare function formatValidationErrors(result: ValidationResult): string;
|
|
28
|
+
/**
|
|
29
|
+
* Get validation rule description
|
|
30
|
+
*/
|
|
31
|
+
export declare function getConfigDescription(key: string): string | undefined;
|
|
32
|
+
/**
|
|
33
|
+
* ConfigValidator namespace - sealed for immutability
|
|
34
|
+
*/
|
|
35
|
+
export declare const ConfigValidator: Readonly<{
|
|
36
|
+
validate: typeof validateConfig;
|
|
37
|
+
validateValue: typeof validateConfigValue;
|
|
38
|
+
formatErrors: typeof formatValidationErrors;
|
|
39
|
+
getDescription: typeof getConfigDescription;
|
|
40
|
+
}>;
|
|
41
|
+
//# sourceMappingURL=ConfigValidator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConfigValidator.d.ts","sourceRoot":"","sources":["../../../../src/cli/config/ConfigValidator.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAGL,aAAa,EAEd,MAAM,0BAA0B,CAAC;AAElC,MAAM,WAAW,eAAe;IAC9B,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,OAAO,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,OAAO,CAAC;IACf,MAAM,EAAE,eAAe,EAAE,CAAC;CAC3B;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,aAAa,GAAG,gBAAgB,CAgBtE;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,eAAe,GAAG,IAAI,CAqCvF;AAoID;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,gBAAgB,GAAG,MAAM,CAUvE;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAGpE;AAED;;GAEG;AACH,eAAO,MAAM,eAAe;;;;;EAK1B,CAAC"}
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Configuration Validator
|
|
3
|
+
* Validates configuration against schema and rules
|
|
4
|
+
*/
|
|
5
|
+
import { CONFIG_RULES, getConfigValue, } from '../config/ConfigSchema';
|
|
6
|
+
/**
|
|
7
|
+
* Validate entire config against schema
|
|
8
|
+
*/
|
|
9
|
+
export function validateConfig(config) {
|
|
10
|
+
const errors = [];
|
|
11
|
+
// Validate each rule
|
|
12
|
+
for (const key of Object.keys(CONFIG_RULES)) {
|
|
13
|
+
const value = getConfigValue(config, key);
|
|
14
|
+
const error = validateConfigValue(key, value);
|
|
15
|
+
if (error !== null) {
|
|
16
|
+
errors.push(error);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
return {
|
|
20
|
+
valid: errors.length === 0,
|
|
21
|
+
errors,
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Validate a single config value
|
|
26
|
+
*/
|
|
27
|
+
export function validateConfigValue(key, value) {
|
|
28
|
+
const rule = CONFIG_RULES[key];
|
|
29
|
+
if (rule === undefined) {
|
|
30
|
+
return null; // No rule, allow any value
|
|
31
|
+
}
|
|
32
|
+
// Check required
|
|
33
|
+
const requiredError = checkRequired(key, value, rule);
|
|
34
|
+
if (requiredError !== null)
|
|
35
|
+
return requiredError;
|
|
36
|
+
// Skip validation if not required and value is undefined
|
|
37
|
+
if (rule.required !== true && value === undefined) {
|
|
38
|
+
return null;
|
|
39
|
+
}
|
|
40
|
+
// Check type
|
|
41
|
+
const typeError = checkType(key, value, rule);
|
|
42
|
+
if (typeError !== null)
|
|
43
|
+
return typeError;
|
|
44
|
+
// Check enum
|
|
45
|
+
const enumError = checkEnum(key, value, rule);
|
|
46
|
+
if (enumError !== null)
|
|
47
|
+
return enumError;
|
|
48
|
+
// Check pattern
|
|
49
|
+
const patternError = checkPattern(key, value, rule);
|
|
50
|
+
if (patternError !== null)
|
|
51
|
+
return patternError;
|
|
52
|
+
// Check string length
|
|
53
|
+
const stringLengthError = checkStringLength(key, value, rule);
|
|
54
|
+
if (stringLengthError !== null)
|
|
55
|
+
return stringLengthError;
|
|
56
|
+
// Check number range
|
|
57
|
+
const numberRangeError = checkNumberRange(key, value, rule);
|
|
58
|
+
if (numberRangeError !== null)
|
|
59
|
+
return numberRangeError;
|
|
60
|
+
return null;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Check if value is required
|
|
64
|
+
*/
|
|
65
|
+
function checkRequired(key, value, rule) {
|
|
66
|
+
if (rule.required === true && (value === undefined || value === null)) {
|
|
67
|
+
return {
|
|
68
|
+
key,
|
|
69
|
+
value,
|
|
70
|
+
message: `${key} is required`,
|
|
71
|
+
rule: 'required',
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
return null;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Check type compatibility
|
|
78
|
+
*/
|
|
79
|
+
function checkType(key, value, rule) {
|
|
80
|
+
if (rule.type !== undefined && typeof value !== rule.type) {
|
|
81
|
+
return {
|
|
82
|
+
key,
|
|
83
|
+
value,
|
|
84
|
+
message: `${key} must be of type ${rule.type}, got ${typeof value}`,
|
|
85
|
+
rule: 'type',
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
return null;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Check enum values
|
|
92
|
+
*/
|
|
93
|
+
function checkEnum(key, value, rule) {
|
|
94
|
+
if (rule.enum !== undefined) {
|
|
95
|
+
if (!rule.enum.includes(value)) {
|
|
96
|
+
return {
|
|
97
|
+
key,
|
|
98
|
+
value,
|
|
99
|
+
message: `${key} must be one of: ${rule.enum.join(', ')}`,
|
|
100
|
+
rule: 'enum',
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
return null;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Check string pattern
|
|
108
|
+
*/
|
|
109
|
+
function checkPattern(key, value, rule) {
|
|
110
|
+
if (rule.pattern !== undefined && typeof value === 'string') {
|
|
111
|
+
if (!rule.pattern.test(value)) {
|
|
112
|
+
return {
|
|
113
|
+
key,
|
|
114
|
+
value,
|
|
115
|
+
message: `${key} must match pattern: ${rule.pattern}`,
|
|
116
|
+
rule: 'pattern',
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
return null;
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Check string length constraints
|
|
124
|
+
*/
|
|
125
|
+
function checkStringLength(key, value, rule) {
|
|
126
|
+
if (typeof value !== 'string') {
|
|
127
|
+
return null;
|
|
128
|
+
}
|
|
129
|
+
if (rule.minLength !== undefined && value.length < rule.minLength) {
|
|
130
|
+
return {
|
|
131
|
+
key,
|
|
132
|
+
value,
|
|
133
|
+
message: `${key} must be at least ${rule.minLength} characters`,
|
|
134
|
+
rule: 'minLength',
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
if (rule.maxLength !== undefined && value.length > rule.maxLength) {
|
|
138
|
+
return {
|
|
139
|
+
key,
|
|
140
|
+
value,
|
|
141
|
+
message: `${key} must be at most ${rule.maxLength} characters`,
|
|
142
|
+
rule: 'maxLength',
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
return null;
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* Check number range constraints
|
|
149
|
+
*/
|
|
150
|
+
function checkNumberRange(key, value, rule) {
|
|
151
|
+
if (typeof value !== 'number') {
|
|
152
|
+
return null;
|
|
153
|
+
}
|
|
154
|
+
if (rule.min !== undefined && value < rule.min) {
|
|
155
|
+
return {
|
|
156
|
+
key,
|
|
157
|
+
value,
|
|
158
|
+
message: `${key} must be at least ${rule.min}`,
|
|
159
|
+
rule: 'min',
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
if (rule.max !== undefined && value > rule.max) {
|
|
163
|
+
return {
|
|
164
|
+
key,
|
|
165
|
+
value,
|
|
166
|
+
message: `${key} must be at most ${rule.max}`,
|
|
167
|
+
rule: 'max',
|
|
168
|
+
};
|
|
169
|
+
}
|
|
170
|
+
return null;
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* Format validation errors for display
|
|
174
|
+
*/
|
|
175
|
+
export function formatValidationErrors(result) {
|
|
176
|
+
if (result.valid) {
|
|
177
|
+
return 'Configuration is valid';
|
|
178
|
+
}
|
|
179
|
+
const lines = ['Configuration validation failed:'];
|
|
180
|
+
for (const error of result.errors) {
|
|
181
|
+
lines.push(` ❌ ${error.key}: ${error.message}`);
|
|
182
|
+
}
|
|
183
|
+
return lines.join('\n');
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* Get validation rule description
|
|
187
|
+
*/
|
|
188
|
+
export function getConfigDescription(key) {
|
|
189
|
+
const rule = CONFIG_RULES[key];
|
|
190
|
+
return rule?.description;
|
|
191
|
+
}
|
|
192
|
+
/**
|
|
193
|
+
* ConfigValidator namespace - sealed for immutability
|
|
194
|
+
*/
|
|
195
|
+
export const ConfigValidator = Object.freeze({
|
|
196
|
+
validate: validateConfig,
|
|
197
|
+
validateValue: validateConfigValue,
|
|
198
|
+
formatErrors: formatValidationErrors,
|
|
199
|
+
getDescription: getConfigDescription,
|
|
200
|
+
});
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Configuration Module
|
|
3
|
+
* Exports config management classes
|
|
4
|
+
*/
|
|
5
|
+
export { ConfigManager } from '../config/ConfigManager';
|
|
6
|
+
export { AuthConfig, CONFIG_RULES, ConfigPaths, DEFAULT_CONFIG, DatabaseConfig, FeatureConfig, MicroservicesConfig, ProjectConfig, ServerConfig, getConfigValue, getDefaultValue, setConfigValue, } from '../config/ConfigSchema';
|
|
7
|
+
export { ConfigValidator, ValidationError, ValidationResult } from '../config/ConfigValidator';
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/cli/config/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EACL,UAAU,EACV,YAAY,EACZ,WAAW,EACX,cAAc,EACd,cAAc,EACd,aAAa,EACb,mBAAmB,EACnB,aAAa,EACb,YAAY,EACZ,cAAc,EACd,eAAe,EACf,cAAc,GACf,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Configuration Module
|
|
3
|
+
* Exports config management classes
|
|
4
|
+
*/
|
|
5
|
+
export { ConfigManager } from '../config/ConfigManager';
|
|
6
|
+
export { CONFIG_RULES, ConfigPaths, DEFAULT_CONFIG, getConfigValue, getDefaultValue, setConfigValue, } from '../config/ConfigSchema';
|
|
7
|
+
export { ConfigValidator } from '../config/ConfigValidator';
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Debug Dashboard
|
|
3
|
+
* Terminal-based real-time monitoring UI
|
|
4
|
+
*/
|
|
5
|
+
export interface DashboardStats {
|
|
6
|
+
uptime: number;
|
|
7
|
+
memory: {
|
|
8
|
+
total: number;
|
|
9
|
+
free: number;
|
|
10
|
+
used: number;
|
|
11
|
+
};
|
|
12
|
+
requests: {
|
|
13
|
+
total: number;
|
|
14
|
+
active: number;
|
|
15
|
+
avgDuration: number;
|
|
16
|
+
};
|
|
17
|
+
queries: {
|
|
18
|
+
total: number;
|
|
19
|
+
n1Warnings: number;
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
export interface IDashboard {
|
|
23
|
+
start(): void;
|
|
24
|
+
stop(): void;
|
|
25
|
+
update(newStats: Partial<DashboardStats>): void;
|
|
26
|
+
}
|
|
27
|
+
type DashboardCtor = {
|
|
28
|
+
new (): IDashboard;
|
|
29
|
+
(): IDashboard;
|
|
30
|
+
create(): IDashboard;
|
|
31
|
+
};
|
|
32
|
+
export declare const Dashboard: DashboardCtor;
|
|
33
|
+
export {};
|
|
34
|
+
//# sourceMappingURL=Dashboard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Dashboard.d.ts","sourceRoot":"","sources":["../../../../src/cli/debug/Dashboard.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAOH,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE;QACN,KAAK,EAAE,MAAM,CAAC;QACd,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,EAAE,MAAM,CAAC;KACd,CAAC;IACF,QAAQ,EAAE;QACR,KAAK,EAAE,MAAM,CAAC;QACd,MAAM,EAAE,MAAM,CAAC;QACf,WAAW,EAAE,MAAM,CAAC;KACrB,CAAC;IACF,OAAO,EAAE;QACP,KAAK,EAAE,MAAM,CAAC;QACd,UAAU,EAAE,MAAM,CAAC;KACpB,CAAC;CACH;AAqGD,MAAM,WAAW,UAAU;IACzB,KAAK,IAAI,IAAI,CAAC;IACd,IAAI,IAAI,IAAI,CAAC;IACb,MAAM,CAAC,QAAQ,EAAE,OAAO,CAAC,cAAc,CAAC,GAAG,IAAI,CAAC;CACjD;AAkFD,KAAK,aAAa,GAAG;IACnB,QAAQ,UAAU,CAAC;IACnB,IAAI,UAAU,CAAC;IACf,MAAM,IAAI,UAAU,CAAC;CACtB,CAAC;AAMF,eAAO,MAAM,SAAS,EAGN,aAAa,CAAC"}
|