@zintrust/core 0.1.19 → 0.1.21
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/README.md +10 -10
- package/bin/zintrust-main.d.ts.map +1 -1
- package/bin/zintrust-main.js +9 -0
- package/package.json +3 -2
- package/public/error-pages/404.html +145 -0
- package/public/error-pages/500.html +266 -0
- package/public/error-pages/error.css +628 -0
- package/public/error-pages/error.js +428 -0
- package/public/zintrust.svg +30 -0
- package/routes/api.d.ts.map +1 -1
- package/routes/api.js +41 -17
- package/routes/metrics.d.ts +9 -0
- package/routes/metrics.d.ts.map +1 -0
- package/routes/metrics.js +20 -0
- package/routes/openapi.d.ts +9 -0
- package/routes/openapi.d.ts.map +1 -0
- package/routes/openapi.js +76 -0
- package/src/boot/Application.d.ts +2 -2
- package/src/boot/Application.d.ts.map +1 -1
- package/src/boot/Application.js +66 -13
- package/src/boot/Server.d.ts +3 -2
- package/src/boot/Server.d.ts.map +1 -1
- package/src/boot/Server.js +39 -165
- package/src/boot/bootstrap.js +2 -0
- package/src/cache/Cache.d.ts +1 -1
- package/src/cache/Cache.d.ts.map +1 -1
- package/src/cache/CacheDriver.d.ts +4 -0
- package/src/cache/CacheDriver.d.ts.map +1 -1
- package/src/cache/drivers/KVDriver.d.ts +1 -1
- package/src/cache/drivers/KVDriver.d.ts.map +1 -1
- package/src/cache/drivers/MemoryDriver.d.ts +1 -1
- package/src/cache/drivers/MemoryDriver.d.ts.map +1 -1
- package/src/cache/drivers/MemoryDriver.js +16 -0
- package/src/cache/drivers/MongoDriver.d.ts +1 -1
- package/src/cache/drivers/MongoDriver.d.ts.map +1 -1
- package/src/cache/drivers/RedisDriver.d.ts +1 -1
- package/src/cache/drivers/RedisDriver.d.ts.map +1 -1
- package/src/cli/CLI.d.ts.map +1 -1
- package/src/cli/CLI.js +10 -4
- package/src/cli/commands/AddCommand.d.ts +2 -2
- package/src/cli/commands/AddCommand.d.ts.map +1 -1
- package/src/cli/commands/AddCommand.js +135 -58
- package/src/cli/commands/ConfigCommand.d.ts +1 -1
- package/src/cli/commands/ConfigCommand.d.ts.map +1 -1
- package/src/cli/commands/CreateCommand.d.ts +15 -0
- package/src/cli/commands/CreateCommand.d.ts.map +1 -0
- package/src/cli/commands/CreateCommand.js +143 -0
- package/src/cli/commands/D1MigrateCommand.d.ts +1 -1
- package/src/cli/commands/D1MigrateCommand.d.ts.map +1 -1
- package/src/cli/commands/D1MigrateCommand.js +16 -20
- package/src/cli/commands/DbSeedCommand.d.ts +9 -0
- package/src/cli/commands/DbSeedCommand.d.ts.map +1 -0
- package/src/cli/commands/DbSeedCommand.js +171 -0
- package/src/cli/commands/DebugCommand.d.ts +1 -1
- package/src/cli/commands/DebugCommand.d.ts.map +1 -1
- package/src/cli/commands/FixCommand.d.ts +1 -1
- package/src/cli/commands/FixCommand.d.ts.map +1 -1
- package/src/cli/commands/JwtDevCommand.d.ts +8 -0
- package/src/cli/commands/JwtDevCommand.d.ts.map +1 -0
- package/src/cli/commands/JwtDevCommand.js +114 -0
- package/src/cli/commands/KeyGenerateCommand.d.ts +1 -1
- package/src/cli/commands/KeyGenerateCommand.d.ts.map +1 -1
- package/src/cli/commands/LogsCommand.d.ts +2 -2
- package/src/cli/commands/LogsCommand.d.ts.map +1 -1
- package/src/cli/commands/LogsCommand.js +36 -2
- package/src/cli/commands/MakeMailTemplateCommand.d.ts +1 -1
- package/src/cli/commands/MakeMailTemplateCommand.d.ts.map +1 -1
- package/src/cli/commands/MakeNotificationTemplateCommand.d.ts +1 -1
- package/src/cli/commands/MakeNotificationTemplateCommand.d.ts.map +1 -1
- package/src/cli/commands/MigrateCommand.d.ts +1 -1
- package/src/cli/commands/MigrateCommand.d.ts.map +1 -1
- package/src/cli/commands/MigrateCommand.js +324 -35
- package/src/cli/commands/NewCommand.d.ts +1 -1
- package/src/cli/commands/NewCommand.d.ts.map +1 -1
- package/src/cli/commands/NewCommand.js +12 -4
- package/src/cli/commands/PluginCommand.d.ts +1 -1
- package/src/cli/commands/PluginCommand.d.ts.map +1 -1
- package/src/cli/commands/PrepareCommand.d.ts +1 -1
- package/src/cli/commands/PrepareCommand.d.ts.map +1 -1
- package/src/cli/commands/QACommand.d.ts +2 -2
- package/src/cli/commands/QACommand.d.ts.map +1 -1
- package/src/cli/commands/RoutesCommand.d.ts +10 -0
- package/src/cli/commands/RoutesCommand.d.ts.map +1 -0
- package/src/cli/commands/RoutesCommand.js +242 -0
- package/src/cli/commands/SimulateCommand.d.ts +1 -1
- package/src/cli/commands/SimulateCommand.d.ts.map +1 -1
- package/src/cli/commands/index.d.ts +3 -0
- package/src/cli/commands/index.d.ts.map +1 -1
- package/src/cli/commands/index.js +3 -0
- package/src/cli/config/ConfigManager.d.ts +1 -1
- package/src/cli/config/ConfigManager.d.ts.map +1 -1
- package/src/cli/config/ConfigValidator.d.ts +1 -1
- package/src/cli/config/ConfigValidator.d.ts.map +1 -1
- package/src/cli/config/ConfigValidator.js +1 -1
- package/src/cli/d1/D1SqlMigrations.d.ts +20 -0
- package/src/cli/d1/D1SqlMigrations.d.ts.map +1 -0
- package/src/cli/d1/D1SqlMigrations.js +229 -0
- package/src/cli/d1/WranglerConfig.d.ts +4 -0
- package/src/cli/d1/WranglerConfig.d.ts.map +1 -0
- package/src/cli/d1/WranglerConfig.js +122 -0
- package/src/cli/d1/WranglerD1.d.ts +11 -0
- package/src/cli/d1/WranglerD1.d.ts.map +1 -0
- package/src/cli/d1/WranglerD1.js +16 -0
- package/src/cli/scaffolding/ControllerGenerator.d.ts.map +1 -1
- package/src/cli/scaffolding/ControllerGenerator.js +76 -26
- package/src/cli/scaffolding/FactoryGenerator.d.ts.map +1 -1
- package/src/cli/scaffolding/FactoryGenerator.js +3 -1
- package/src/cli/scaffolding/GovernanceScaffolder.d.ts +23 -0
- package/src/cli/scaffolding/GovernanceScaffolder.d.ts.map +1 -0
- package/src/cli/scaffolding/GovernanceScaffolder.js +327 -0
- package/src/cli/scaffolding/MigrationGenerator.d.ts +10 -0
- package/src/cli/scaffolding/MigrationGenerator.d.ts.map +1 -1
- package/src/cli/scaffolding/MigrationGenerator.js +137 -51
- package/src/cli/scaffolding/ModelGenerator.js +1 -1
- package/src/cli/scaffolding/ProjectScaffolder.d.ts.map +1 -1
- package/src/cli/scaffolding/ProjectScaffolder.js +36 -4
- package/src/cli/scaffolding/RouteGenerator.d.ts.map +1 -1
- package/src/cli/scaffolding/RouteGenerator.js +79 -43
- package/src/cli/scaffolding/SeederGenerator.d.ts +5 -0
- package/src/cli/scaffolding/SeederGenerator.d.ts.map +1 -1
- package/src/cli/scaffolding/SeederGenerator.js +63 -15
- package/src/cli/scaffolding/ServiceScaffolder.d.ts.map +1 -1
- package/src/cli/scaffolding/ServiceScaffolder.js +28 -7
- package/src/cli/scaffolding/index.d.ts +2 -0
- package/src/cli/scaffolding/index.d.ts.map +1 -1
- package/src/cli/scaffolding/index.js +1 -0
- package/src/common/index.d.ts +8 -0
- package/src/common/index.d.ts.map +1 -1
- package/src/common/index.js +28 -0
- package/src/common/utility.d.ts +38 -0
- package/src/common/utility.d.ts.map +1 -0
- package/src/common/utility.js +101 -0
- package/src/config/FileLogWriter.d.ts +2 -1
- package/src/config/FileLogWriter.d.ts.map +1 -1
- package/src/config/FileLogWriter.js +83 -2
- package/src/config/app.d.ts.map +1 -1
- package/src/config/app.js +3 -1
- package/src/config/broadcast.d.ts +14 -28
- package/src/config/broadcast.d.ts.map +1 -1
- package/src/config/broadcast.js +69 -35
- package/src/config/cache.d.ts +13 -45
- package/src/config/cache.d.ts.map +1 -1
- package/src/config/cache.js +69 -25
- package/src/config/cloudflare.d.ts +1 -1
- package/src/config/cloudflare.d.ts.map +1 -1
- package/src/config/database.d.ts +22 -64
- package/src/config/database.d.ts.map +1 -1
- package/src/config/database.js +191 -37
- package/src/config/env.d.ts +12 -0
- package/src/config/env.d.ts.map +1 -1
- package/src/config/env.js +14 -0
- package/src/config/index.d.ts +33 -137
- package/src/config/index.d.ts.map +1 -1
- package/src/config/logging/KvLogger.js +1 -1
- package/src/config/logging/SlackLogger.js +2 -2
- package/src/config/mail.d.ts +19 -55
- package/src/config/mail.d.ts.map +1 -1
- package/src/config/mail.js +63 -21
- package/src/config/middleware.d.ts +44 -1
- package/src/config/middleware.d.ts.map +1 -1
- package/src/config/middleware.js +157 -5
- package/src/config/notification.d.ts +14 -27
- package/src/config/notification.d.ts.map +1 -1
- package/src/config/notification.js +82 -36
- package/src/config/queue.d.ts +21 -51
- package/src/config/queue.d.ts.map +1 -1
- package/src/config/queue.js +72 -27
- package/src/config/security.d.ts +1 -1
- package/src/config/security.js +1 -1
- package/src/config/storage.d.ts +27 -34
- package/src/config/storage.d.ts.map +1 -1
- package/src/config/storage.js +97 -56
- package/src/config/type.d.ts +13 -2
- package/src/config/type.d.ts.map +1 -1
- package/src/events/EventDispatcher.d.ts.map +1 -1
- package/src/events/EventDispatcher.js +6 -4
- package/src/exceptions/ZintrustError.d.ts +7 -0
- package/src/exceptions/ZintrustError.d.ts.map +1 -1
- package/src/exceptions/ZintrustError.js +56 -0
- package/src/features/Auth.d.ts +1 -1
- package/src/features/Auth.d.ts.map +1 -1
- package/src/features/Auth.js +3 -3
- package/src/features/Queue.js +1 -1
- package/src/functions/cloudflare.d.ts.map +1 -1
- package/src/functions/cloudflare.js +3 -14
- package/src/functions/deno.d.ts.map +1 -1
- package/src/functions/deno.js +3 -14
- package/src/functions/lambda.d.ts.map +1 -1
- package/src/functions/lambda.js +3 -14
- package/src/health/StartupHealthChecks.js +1 -1
- package/src/http/Controller.d.ts +2 -2
- package/src/http/Controller.d.ts.map +1 -1
- package/src/http/FileUpload.d.ts +68 -0
- package/src/http/FileUpload.d.ts.map +1 -0
- package/src/http/FileUpload.js +120 -0
- package/src/http/Kernel.d.ts +5 -5
- package/src/http/Kernel.d.ts.map +1 -1
- package/src/http/Kernel.js +139 -23
- package/src/http/Request.d.ts +20 -1
- package/src/http/Request.d.ts.map +1 -1
- package/src/http/Request.js +23 -0
- package/src/http/RequestContext.d.ts +6 -0
- package/src/http/RequestContext.d.ts.map +1 -1
- package/src/http/RequestContext.js +77 -1
- package/src/http/Response.d.ts +1 -1
- package/src/http/Response.d.ts.map +1 -1
- package/src/http/ValidationHelper.d.ts +78 -0
- package/src/http/ValidationHelper.d.ts.map +1 -0
- package/src/http/ValidationHelper.js +121 -0
- package/src/http/error-pages/ErrorPageRenderer.d.ts +17 -0
- package/src/http/error-pages/ErrorPageRenderer.d.ts.map +1 -0
- package/src/http/error-pages/ErrorPageRenderer.js +88 -0
- package/src/http/middleware/BodyParsingMiddleware.d.ts +12 -0
- package/src/http/middleware/BodyParsingMiddleware.d.ts.map +1 -0
- package/src/http/middleware/BodyParsingMiddleware.js +251 -0
- package/src/http/middleware/FileUploadMiddleware.d.ts +12 -0
- package/src/http/middleware/FileUploadMiddleware.d.ts.map +1 -0
- package/src/http/middleware/FileUploadMiddleware.js +74 -0
- package/src/http/parsers/BodyParsers.d.ts +32 -0
- package/src/http/parsers/BodyParsers.d.ts.map +1 -0
- package/src/http/parsers/BodyParsers.js +159 -0
- package/src/http/parsers/MultipartParser.d.ts +33 -0
- package/src/http/parsers/MultipartParser.d.ts.map +1 -0
- package/src/http/parsers/MultipartParser.js +156 -0
- package/src/http/parsers/MultipartParserRegistry.d.ts +34 -0
- package/src/http/parsers/MultipartParserRegistry.d.ts.map +1 -0
- package/src/http/parsers/MultipartParserRegistry.js +20 -0
- package/src/http/validated.d.ts +12 -0
- package/src/http/validated.d.ts.map +1 -0
- package/src/http/validated.js +41 -0
- package/src/index.d.ts +73 -12
- package/src/index.d.ts.map +1 -1
- package/src/index.js +60 -5
- package/src/microservices/PostgresAdapter.d.ts.map +1 -1
- package/src/microservices/PostgresAdapter.js +0 -1
- package/src/microservices/RequestTracingMiddleware.d.ts +2 -2
- package/src/microservices/RequestTracingMiddleware.d.ts.map +1 -1
- package/src/microservices/RequestTracingMiddleware.js +3 -0
- package/src/microservices/ServiceAuthMiddleware.d.ts +2 -2
- package/src/microservices/ServiceAuthMiddleware.d.ts.map +1 -1
- package/src/middleware/AuthMiddleware.d.ts +10 -0
- package/src/middleware/AuthMiddleware.d.ts.map +1 -0
- package/src/middleware/AuthMiddleware.js +16 -0
- package/src/middleware/CsrfMiddleware.d.ts +11 -1
- package/src/middleware/CsrfMiddleware.d.ts.map +1 -1
- package/src/middleware/CsrfMiddleware.js +33 -0
- package/src/middleware/JwtAuthMiddleware.d.ts +11 -0
- package/src/middleware/JwtAuthMiddleware.d.ts.map +1 -0
- package/src/middleware/JwtAuthMiddleware.js +73 -0
- package/src/middleware/LoggingMiddleware.d.ts.map +1 -1
- package/src/middleware/LoggingMiddleware.js +8 -3
- package/src/middleware/MiddlewareStack.d.ts +2 -2
- package/src/middleware/MiddlewareStack.d.ts.map +1 -1
- package/src/middleware/RateLimiter.d.ts +2 -2
- package/src/middleware/RateLimiter.d.ts.map +1 -1
- package/src/middleware/SanitizeBodyMiddleware.d.ts +12 -0
- package/src/middleware/SanitizeBodyMiddleware.d.ts.map +1 -0
- package/src/middleware/SanitizeBodyMiddleware.js +31 -0
- package/src/middleware/SecurityMiddleware.d.ts +1 -1
- package/src/middleware/SecurityMiddleware.d.ts.map +1 -1
- package/src/middleware/SessionMiddleware.d.ts +1 -1
- package/src/middleware/SessionMiddleware.d.ts.map +1 -1
- package/src/middleware/ValidationMiddleware.d.ts +25 -0
- package/src/middleware/ValidationMiddleware.d.ts.map +1 -0
- package/src/middleware/ValidationMiddleware.js +251 -0
- package/src/migrations/MigrationDiscovery.d.ts +5 -0
- package/src/migrations/MigrationDiscovery.d.ts.map +1 -0
- package/src/migrations/MigrationDiscovery.js +16 -0
- package/src/migrations/MigrationLoader.d.ts +5 -0
- package/src/migrations/MigrationLoader.d.ts.map +1 -0
- package/src/migrations/MigrationLoader.js +43 -0
- package/src/migrations/MigrationLock.d.ts +4 -0
- package/src/migrations/MigrationLock.d.ts.map +1 -0
- package/src/migrations/MigrationLock.js +33 -0
- package/src/migrations/Migrator.d.ts +23 -0
- package/src/migrations/Migrator.d.ts.map +1 -0
- package/src/migrations/Migrator.js +4 -0
- package/src/migrations/MigratorFactory.d.ts +25 -0
- package/src/migrations/MigratorFactory.d.ts.map +1 -0
- package/src/migrations/MigratorFactory.js +339 -0
- package/src/migrations/schema/Blueprint.d.ts +5 -0
- package/src/migrations/schema/Blueprint.d.ts.map +1 -0
- package/src/migrations/schema/Blueprint.js +189 -0
- package/src/migrations/schema/Schema.d.ts +8 -0
- package/src/migrations/schema/Schema.d.ts.map +1 -0
- package/src/migrations/schema/Schema.js +141 -0
- package/src/migrations/schema/SchemaCompiler.d.ts +20 -0
- package/src/migrations/schema/SchemaCompiler.d.ts.map +1 -0
- package/src/migrations/schema/SchemaCompiler.js +262 -0
- package/src/migrations/schema/index.d.ts +5 -0
- package/src/migrations/schema/index.d.ts.map +1 -0
- package/src/migrations/schema/index.js +3 -0
- package/src/migrations/schema/types.d.ts +86 -0
- package/src/migrations/schema/types.d.ts.map +1 -0
- package/src/migrations/schema/types.js +1 -0
- package/src/migrations/types.d.ts +45 -0
- package/src/migrations/types.d.ts.map +1 -0
- package/src/migrations/types.js +1 -0
- package/src/node-singletons/crypto.d.ts +1 -1
- package/src/node-singletons/crypto.d.ts.map +1 -1
- package/src/node-singletons/crypto.js +1 -1
- package/src/node-singletons/fs.d.ts +2 -2
- package/src/node-singletons/fs.d.ts.map +1 -1
- package/src/node-singletons/fs.js +1 -1
- package/src/node-singletons/util.d.ts +6 -0
- package/src/node-singletons/util.d.ts.map +1 -0
- package/src/node-singletons/util.js +5 -0
- package/src/node.d.ts +3 -1
- package/src/node.d.ts.map +1 -1
- package/src/node.js +6 -2
- package/src/observability/OpenTelemetry.d.ts +62 -0
- package/src/observability/OpenTelemetry.d.ts.map +1 -0
- package/src/observability/OpenTelemetry.js +167 -0
- package/src/observability/PrometheusMetrics.d.ts +25 -0
- package/src/observability/PrometheusMetrics.d.ts.map +1 -0
- package/src/observability/PrometheusMetrics.js +114 -0
- package/src/openapi/OpenApiGenerator.d.ts +68 -0
- package/src/openapi/OpenApiGenerator.d.ts.map +1 -0
- package/src/openapi/OpenApiGenerator.js +287 -0
- package/src/orm/Database.d.ts +5 -2
- package/src/orm/Database.d.ts.map +1 -1
- package/src/orm/Database.js +219 -63
- package/src/orm/DatabaseAdapter.d.ts +14 -0
- package/src/orm/DatabaseAdapter.d.ts.map +1 -1
- package/src/orm/DatabaseAdapterRegistry.d.ts.map +1 -1
- package/src/orm/DatabaseAdapterRegistry.js +3 -1
- package/src/orm/DatabaseRuntimeRegistration.d.ts.map +1 -1
- package/src/orm/DatabaseRuntimeRegistration.js +12 -0
- package/src/orm/Model.d.ts +30 -2
- package/src/orm/Model.d.ts.map +1 -1
- package/src/orm/Model.js +255 -62
- package/src/orm/QueryBuilder.d.ts +22 -1
- package/src/orm/QueryBuilder.d.ts.map +1 -1
- package/src/orm/QueryBuilder.js +406 -99
- package/src/orm/Relationships.d.ts +7 -1
- package/src/orm/Relationships.d.ts.map +1 -1
- package/src/orm/Relationships.js +18 -0
- package/src/orm/SchemaCompiler.d.ts +9 -0
- package/src/orm/SchemaCompiler.d.ts.map +1 -0
- package/src/orm/SchemaCompiler.js +145 -0
- package/src/orm/adapters/D1Adapter.d.ts +1 -1
- package/src/orm/adapters/D1Adapter.d.ts.map +1 -1
- package/src/orm/adapters/MySQLAdapter.d.ts +1 -1
- package/src/orm/adapters/MySQLAdapter.d.ts.map +1 -1
- package/src/orm/adapters/MySQLAdapter.js +88 -69
- package/src/orm/adapters/PostgreSQLAdapter.d.ts +1 -1
- package/src/orm/adapters/PostgreSQLAdapter.d.ts.map +1 -1
- package/src/orm/adapters/PostgreSQLAdapter.js +88 -69
- package/src/orm/adapters/SQLServerAdapter.d.ts +1 -1
- package/src/orm/adapters/SQLServerAdapter.d.ts.map +1 -1
- package/src/orm/adapters/SQLiteAdapter.d.ts +1 -1
- package/src/orm/adapters/SQLiteAdapter.d.ts.map +1 -1
- package/src/orm/adapters/SQLiteAdapter.js +59 -3
- package/src/orm/maintenance/SqliteMaintenance.d.ts +5 -0
- package/src/orm/maintenance/SqliteMaintenance.d.ts.map +1 -0
- package/src/orm/maintenance/SqliteMaintenance.js +14 -0
- package/src/orm/migrations/MigrationStore.d.ts +38 -0
- package/src/orm/migrations/MigrationStore.d.ts.map +1 -0
- package/src/orm/migrations/MigrationStore.js +157 -0
- package/src/performance/CodeGenerationBenchmark.d.ts.map +1 -1
- package/src/performance/Optimizer.d.ts +7 -6
- package/src/performance/Optimizer.d.ts.map +1 -1
- package/src/performance/Optimizer.js +170 -55
- package/src/profiling/MemoryProfiler.d.ts +1 -1
- package/src/profiling/MemoryProfiler.d.ts.map +1 -1
- package/src/profiling/N1Detector.d.ts +1 -1
- package/src/profiling/N1Detector.d.ts.map +1 -1
- package/src/profiling/QueryLogger.d.ts +1 -1
- package/src/profiling/QueryLogger.d.ts.map +1 -1
- package/src/profiling/RequestProfiler.d.ts +3 -3
- package/src/profiling/RequestProfiler.d.ts.map +1 -1
- package/src/routes/metrics.d.ts +2 -0
- package/src/routes/metrics.d.ts.map +1 -0
- package/src/routes/metrics.js +1 -0
- package/src/routing/CoreRoutes.d.ts +12 -0
- package/src/routing/CoreRoutes.d.ts.map +1 -0
- package/src/routing/CoreRoutes.js +151 -0
- package/src/routing/RouteRegistry.d.ts +39 -0
- package/src/routing/RouteRegistry.d.ts.map +1 -0
- package/src/routing/RouteRegistry.js +44 -0
- package/src/routing/Router.d.ts +26 -9
- package/src/routing/Router.d.ts.map +1 -1
- package/src/routing/Router.js +79 -35
- package/src/routing/common.d.ts +15 -0
- package/src/routing/common.d.ts.map +1 -0
- package/src/routing/common.js +47 -0
- package/src/routing/doc.d.ts +27 -0
- package/src/routing/doc.d.ts.map +1 -0
- package/src/routing/doc.js +110 -0
- package/src/routing/error.d.ts +21 -0
- package/src/routing/error.d.ts.map +1 -0
- package/src/routing/error.js +126 -0
- package/src/routing/errorPages.d.ts +14 -0
- package/src/routing/errorPages.d.ts.map +1 -0
- package/src/routing/errorPages.js +103 -0
- package/src/routing/publicRoot.d.ts +27 -0
- package/src/routing/publicRoot.d.ts.map +1 -0
- package/src/routing/publicRoot.js +110 -0
- package/src/runtime/PluginAutoImports.d.ts +21 -0
- package/src/runtime/PluginAutoImports.d.ts.map +1 -0
- package/src/runtime/PluginAutoImports.js +59 -0
- package/src/runtime/PluginManager.d.ts +1 -5
- package/src/runtime/PluginManager.d.ts.map +1 -1
- package/src/runtime/PluginManager.js +25 -18
- package/src/runtime/RuntimeDetector.d.ts +1 -1
- package/src/runtime/RuntimeDetector.d.ts.map +1 -1
- package/src/runtime/StartupConfigFileRegistry.d.ts +20 -0
- package/src/runtime/StartupConfigFileRegistry.d.ts.map +1 -0
- package/src/runtime/StartupConfigFileRegistry.js +44 -0
- package/src/runtime/adapters/CloudflareAdapter.d.ts +1 -1
- package/src/runtime/adapters/CloudflareAdapter.d.ts.map +1 -1
- package/src/runtime/adapters/CloudflareAdapter.js +1 -1
- package/src/runtime/adapters/DenoAdapter.d.ts +1 -1
- package/src/runtime/adapters/DenoAdapter.d.ts.map +1 -1
- package/src/runtime/adapters/DenoAdapter.js +1 -1
- package/src/runtime/adapters/LambdaAdapter.d.ts +1 -1
- package/src/runtime/adapters/LambdaAdapter.d.ts.map +1 -1
- package/src/runtime/adapters/LambdaAdapter.js +1 -1
- package/src/runtime/adapters/NodeServerAdapter.d.ts +1 -1
- package/src/runtime/adapters/NodeServerAdapter.d.ts.map +1 -1
- package/src/runtime/getKernel.d.ts +9 -0
- package/src/runtime/getKernel.d.ts.map +1 -0
- package/src/runtime/getKernel.js +27 -0
- package/src/runtime/useFileLoader.d.ts +26 -0
- package/src/runtime/useFileLoader.d.ts.map +1 -0
- package/src/runtime/useFileLoader.js +188 -0
- package/src/scripts/TemplateImportsCheck.js +40 -0
- package/src/scripts/TemplateSync.js +90 -24
- package/src/security/Encryptor.d.ts.map +1 -1
- package/src/security/Encryptor.js +64 -7
- package/src/security/JwtManager.d.ts +1 -0
- package/src/security/JwtManager.d.ts.map +1 -1
- package/src/security/JwtManager.js +33 -0
- package/src/security/Sanitizer.d.ts +76 -0
- package/src/security/Sanitizer.d.ts.map +1 -0
- package/src/security/Sanitizer.js +412 -0
- package/src/security/TokenRevocation.d.ts +7 -0
- package/src/security/TokenRevocation.d.ts.map +1 -0
- package/src/security/TokenRevocation.js +57 -0
- package/src/security/XssProtection.d.ts.map +1 -1
- package/src/security/XssProtection.js +62 -14
- package/src/seeders/SeederDiscovery.d.ts +5 -0
- package/src/seeders/SeederDiscovery.d.ts.map +1 -0
- package/src/seeders/SeederDiscovery.js +21 -0
- package/src/seeders/SeederLoader.d.ts +5 -0
- package/src/seeders/SeederLoader.d.ts.map +1 -0
- package/src/seeders/SeederLoader.js +60 -0
- package/src/seeders/types.d.ts +18 -0
- package/src/seeders/types.d.ts.map +1 -0
- package/src/seeders/types.js +1 -0
- package/src/session/SessionManager.js +1 -1
- package/src/templates/adapters/MySQLAdapter.ts.tpl +109 -85
- package/src/templates/adapters/PostgreSQLAdapter.ts.tpl +129 -88
- package/src/templates/adapters/SQLServerAdapter.ts.tpl +5 -9
- package/src/templates/adapters/SQLiteAdapter.ts.tpl +78 -11
- package/src/templates/features/Queue.ts.tpl +3 -2
- package/src/templates/project/basic/app/Controllers/AuthController.ts.tpl +217 -0
- package/src/templates/project/basic/app/Controllers/UserController.ts.tpl +1 -12
- package/src/templates/project/basic/app/Types/controller.ts.tpl +46 -0
- package/src/templates/project/basic/config/FileLogWriter.ts.tpl +5 -236
- package/src/templates/project/basic/config/SecretsManager.ts.tpl +10 -447
- package/src/templates/project/basic/config/StartupConfigValidator.ts.tpl +9 -268
- package/src/templates/project/basic/config/app.ts.tpl +13 -153
- package/src/templates/project/basic/config/broadcast.ts.tpl +29 -126
- package/src/templates/project/basic/config/cache.ts.tpl +12 -70
- package/src/templates/project/basic/config/cloudflare.ts.tpl +4 -39
- package/src/templates/project/basic/config/constants.ts.tpl +9 -65
- package/src/templates/project/basic/config/database.ts.tpl +66 -123
- package/src/templates/project/basic/config/env.ts.tpl +5 -169
- package/src/templates/project/basic/config/features.ts.tpl +6 -54
- package/src/templates/project/basic/config/index.ts.tpl +8 -23
- package/src/templates/project/basic/config/logging/HttpLogger.ts.tpl +7 -114
- package/src/templates/project/basic/config/mail.ts.tpl +9 -62
- package/src/templates/project/basic/config/microservices.ts.tpl +11 -97
- package/src/templates/project/basic/config/middleware.ts.tpl +25 -43
- package/src/templates/project/basic/config/notification.ts.tpl +13 -114
- package/src/templates/project/basic/config/queue.ts.tpl +9 -40
- package/src/templates/project/basic/config/security.ts.tpl +11 -163
- package/src/templates/project/basic/config/startup.ts.tpl +10 -21
- package/src/templates/project/basic/config/storage.ts.tpl +57 -137
- package/src/templates/project/basic/config/type.ts.tpl +32 -451
- package/src/templates/project/basic/database/factories/UserFactory.ts.tpl +80 -0
- package/src/templates/project/basic/database/migrations/create_tasks_table.ts.tpl +28 -0
- package/src/templates/project/basic/database/migrations/create_users_table.ts.tpl +29 -0
- package/src/templates/project/basic/database/seeders/DatabaseSeeder.ts.tpl +19 -0
- package/src/templates/project/basic/database/seeders/UserSeeder.ts.tpl +18 -0
- package/src/templates/project/basic/database/seeders/index.ts.tpl +2 -0
- package/src/templates/project/basic/routes/api.ts.tpl +71 -33
- package/src/templates/project/basic/routes/metrics.ts.tpl +22 -0
- package/src/templates/project/basic/src/index.ts.tpl +3 -0
- package/src/templates/project/basic/tsconfig.json.tpl +12 -11
- package/src/testing/TestEnvironment.d.ts +40 -0
- package/src/testing/TestEnvironment.d.ts.map +1 -0
- package/src/testing/TestEnvironment.js +141 -0
- package/src/testing/TestHttp.d.ts +29 -0
- package/src/testing/TestHttp.d.ts.map +1 -0
- package/src/testing/TestHttp.js +96 -0
- package/src/testing/index.d.ts +5 -0
- package/src/testing/index.d.ts.map +1 -0
- package/src/testing/index.js +2 -0
- package/src/time/DateTime.d.ts +181 -0
- package/src/time/DateTime.d.ts.map +1 -0
- package/src/time/DateTime.js +300 -0
- package/src/time/index.d.ts +7 -0
- package/src/time/index.d.ts.map +1 -0
- package/src/time/index.js +5 -0
- package/src/tools/http/Http.d.ts.map +1 -1
- package/src/tools/http/Http.js +4 -0
- package/src/tools/mail/drivers/Smtp.js +1 -1
- package/src/tools/queue/drivers/InMemory.d.ts +1 -1
- package/src/tools/queue/drivers/InMemory.d.ts.map +1 -1
- package/src/tools/queue/drivers/InMemory.js +1 -1
- package/src/tools/queue/drivers/Redis.d.ts +1 -1
- package/src/tools/queue/drivers/Redis.d.ts.map +1 -1
- package/src/tools/queue/drivers/Redis.js +1 -1
- package/src/validation/ValidationError.d.ts.map +1 -1
- package/src/validation/ValidationError.js +4 -2
- package/src/validation/Validator.d.ts +49 -16
- package/src/validation/Validator.d.ts.map +1 -1
- package/src/validation/Validator.js +307 -5
- package/src/common/uuid.d.ts +0 -3
- package/src/common/uuid.d.ts.map +0 -1
- package/src/common/uuid.js +0 -30
- package/src/templates/project/basic/.env.example.tpl +0 -74
- package/src/templates/project/basic/.env.tpl +0 -166
- package/src/templates/project/basic/config/logging/KvLogger.ts.tpl +0 -181
- package/src/templates/project/basic/config/logging/SlackLogger.ts.tpl +0 -156
- package/src/templates/project/basic/database/migrations/index.ts.tpl +0 -2
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Body Parsers - Content-Type specific parsing
|
|
3
|
+
* Handles form-data, plain text, CSV, and other non-JSON formats
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* URL-encoded form data parser
|
|
7
|
+
* Content-Type: application/x-www-form-urlencoded
|
|
8
|
+
*/
|
|
9
|
+
const FormDataParser = {
|
|
10
|
+
canParse: (contentType) => contentType.includes('application/x-www-form-urlencoded'),
|
|
11
|
+
parse: (body) => {
|
|
12
|
+
try {
|
|
13
|
+
const text = typeof body === 'string' ? body : body.toString('utf-8');
|
|
14
|
+
if (!text.trim())
|
|
15
|
+
return { ok: true, data: {} };
|
|
16
|
+
const params = new URLSearchParams(text);
|
|
17
|
+
const result = {};
|
|
18
|
+
for (const [key, value] of params.entries()) {
|
|
19
|
+
if (Object.prototype.hasOwnProperty.call(result, key)) {
|
|
20
|
+
// Handle multiple values with same key
|
|
21
|
+
const existing = result[key];
|
|
22
|
+
if (Array.isArray(existing)) {
|
|
23
|
+
existing.push(value);
|
|
24
|
+
}
|
|
25
|
+
else {
|
|
26
|
+
result[key] = [existing, value];
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
30
|
+
result[key] = value;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
return { ok: true, data: result };
|
|
34
|
+
}
|
|
35
|
+
catch (error) {
|
|
36
|
+
const errorMsg = error instanceof Error ? error.message : 'Unknown error';
|
|
37
|
+
return { ok: false, error: `Failed to parse form data: ${errorMsg}` };
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* Plain text parser
|
|
43
|
+
* Content-Type: text/plain
|
|
44
|
+
*/
|
|
45
|
+
const TextParser = {
|
|
46
|
+
canParse: (contentType) => contentType.includes('text/plain'),
|
|
47
|
+
parse: (body) => {
|
|
48
|
+
try {
|
|
49
|
+
const text = typeof body === 'string' ? body : body.toString('utf-8');
|
|
50
|
+
return { ok: true, data: text };
|
|
51
|
+
}
|
|
52
|
+
catch (error) {
|
|
53
|
+
const errorMsg = error instanceof Error ? error.message : 'Unknown error';
|
|
54
|
+
return { ok: false, error: `Failed to parse text: ${errorMsg}` };
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
};
|
|
58
|
+
/**
|
|
59
|
+
* CSV parser implementation helper
|
|
60
|
+
*/
|
|
61
|
+
const parseCSVLine = (line) => {
|
|
62
|
+
const result = [];
|
|
63
|
+
let current = '';
|
|
64
|
+
let inQuotes = false;
|
|
65
|
+
let i = 0;
|
|
66
|
+
while (i < line.length) {
|
|
67
|
+
const char = line[i];
|
|
68
|
+
if (char === '"') {
|
|
69
|
+
if (inQuotes && line[i + 1] === '"') {
|
|
70
|
+
current += '"';
|
|
71
|
+
i += 2;
|
|
72
|
+
continue;
|
|
73
|
+
}
|
|
74
|
+
else {
|
|
75
|
+
inQuotes = !inQuotes;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
else if (char === ',' && !inQuotes) {
|
|
79
|
+
result.push(current.trim());
|
|
80
|
+
current = '';
|
|
81
|
+
}
|
|
82
|
+
else {
|
|
83
|
+
current += char;
|
|
84
|
+
}
|
|
85
|
+
i++;
|
|
86
|
+
}
|
|
87
|
+
result.push(current.trim());
|
|
88
|
+
return result;
|
|
89
|
+
};
|
|
90
|
+
/**
|
|
91
|
+
* CSV parser
|
|
92
|
+
* Content-Type: text/csv
|
|
93
|
+
*/
|
|
94
|
+
const CSVParser = {
|
|
95
|
+
canParse: (contentType) => contentType.includes('text/csv'),
|
|
96
|
+
parse: (body) => {
|
|
97
|
+
try {
|
|
98
|
+
const text = typeof body === 'string' ? body : body.toString('utf-8');
|
|
99
|
+
if (text.length === 0)
|
|
100
|
+
return { ok: true, data: [] };
|
|
101
|
+
// Stream-like processing: iterate lines without creating an array of all lines
|
|
102
|
+
const rows = [];
|
|
103
|
+
let headers;
|
|
104
|
+
let cursor = 0;
|
|
105
|
+
while (cursor < text.length) {
|
|
106
|
+
let lineEnd = text.indexOf('\n', cursor);
|
|
107
|
+
if (lineEnd === -1)
|
|
108
|
+
lineEnd = text.length;
|
|
109
|
+
const line = text.slice(cursor, lineEnd).trim();
|
|
110
|
+
cursor = lineEnd + 1;
|
|
111
|
+
if (line.length === 0)
|
|
112
|
+
continue;
|
|
113
|
+
const values = parseCSVLine(line);
|
|
114
|
+
if (!headers) {
|
|
115
|
+
headers = values;
|
|
116
|
+
continue;
|
|
117
|
+
}
|
|
118
|
+
const row = {};
|
|
119
|
+
for (let j = 0; j < headers.length; j++) {
|
|
120
|
+
row[headers[j]] = values[j] ?? '';
|
|
121
|
+
}
|
|
122
|
+
rows.push(row);
|
|
123
|
+
}
|
|
124
|
+
return { ok: true, data: rows };
|
|
125
|
+
}
|
|
126
|
+
catch (error) {
|
|
127
|
+
const errorMsg = error instanceof Error ? error.message : 'Unknown error';
|
|
128
|
+
return { ok: false, error: `Failed to parse CSV: ${errorMsg}` };
|
|
129
|
+
}
|
|
130
|
+
},
|
|
131
|
+
};
|
|
132
|
+
export const BodyParsers = Object.freeze({
|
|
133
|
+
FormDataParser,
|
|
134
|
+
TextParser,
|
|
135
|
+
CSVParser,
|
|
136
|
+
/**
|
|
137
|
+
* Get all registered parsers
|
|
138
|
+
*/
|
|
139
|
+
getAll() {
|
|
140
|
+
return [this.FormDataParser, this.TextParser, this.CSVParser];
|
|
141
|
+
},
|
|
142
|
+
/**
|
|
143
|
+
* Find parser for content-type
|
|
144
|
+
*/
|
|
145
|
+
findParser(contentType) {
|
|
146
|
+
return this.getAll().find((parser) => parser.canParse(contentType));
|
|
147
|
+
},
|
|
148
|
+
/**
|
|
149
|
+
* Parse body based on content-type
|
|
150
|
+
*/
|
|
151
|
+
parse(contentType, body) {
|
|
152
|
+
const parser = this.findParser(contentType);
|
|
153
|
+
if (parser === undefined) {
|
|
154
|
+
return { ok: false, error: `No parser found for content-type: ${contentType}` };
|
|
155
|
+
}
|
|
156
|
+
return parser.parse(body);
|
|
157
|
+
},
|
|
158
|
+
});
|
|
159
|
+
export default BodyParsers;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Multipart Form-Data Parser
|
|
3
|
+
* Parses multipart/form-data requests for file uploads and form fields
|
|
4
|
+
*/
|
|
5
|
+
import type { UploadedFile } from '../FileUpload';
|
|
6
|
+
interface ParsedMultipartData {
|
|
7
|
+
fields: Record<string, string | string[]>;
|
|
8
|
+
files: Record<string, UploadedFile[]>;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Parse multipart/form-data body
|
|
12
|
+
* Note: This is a simplified parser. For production use a proper multipart library
|
|
13
|
+
*/
|
|
14
|
+
export declare const parseMultipartFormData: (body: Buffer | string, boundary: string) => ParsedMultipartData;
|
|
15
|
+
/**
|
|
16
|
+
* Parse multipart/form-data from request
|
|
17
|
+
*/
|
|
18
|
+
export declare const MultipartParser: Readonly<{
|
|
19
|
+
/**
|
|
20
|
+
* Check if content-type is multipart/form-data
|
|
21
|
+
*/
|
|
22
|
+
isMultipart(contentType: string): boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Get boundary from content-type header
|
|
25
|
+
*/
|
|
26
|
+
getBoundary(contentType: string): string | undefined;
|
|
27
|
+
/**
|
|
28
|
+
* Parse multipart body
|
|
29
|
+
*/
|
|
30
|
+
parse(body: Buffer | string, boundary: string): ParsedMultipartData;
|
|
31
|
+
}>;
|
|
32
|
+
export default MultipartParser;
|
|
33
|
+
//# sourceMappingURL=MultipartParser.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MultipartParser.d.ts","sourceRoot":"","sources":["../../../../src/http/parsers/MultipartParser.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAErD,UAAU,mBAAmB;IAC3B,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC,CAAC;IAC1C,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,EAAE,CAAC,CAAC;CACvC;AAwJD;;;GAGG;AACH,eAAO,MAAM,sBAAsB,GACjC,MAAM,MAAM,GAAG,MAAM,EACrB,UAAU,MAAM,KACf,mBAaF,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,eAAe;IAC1B;;OAEG;6BACsB,MAAM,GAAG,OAAO;IAIzC;;OAEG;6BACsB,MAAM,GAAG,MAAM,GAAG,SAAS;IAIpD;;OAEG;gBACS,MAAM,GAAG,MAAM,YAAY,MAAM,GAAG,mBAAmB;EAGnE,CAAC;AAEH,eAAe,eAAe,CAAC"}
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Multipart Form-Data Parser
|
|
3
|
+
* Parses multipart/form-data requests for file uploads and form fields
|
|
4
|
+
*/
|
|
5
|
+
const MAX_PARTS = 1000;
|
|
6
|
+
const MAX_HEADER_SIZE = 16 * 1024; // 16KB
|
|
7
|
+
/**
|
|
8
|
+
* Simple multipart boundary extractor
|
|
9
|
+
*/
|
|
10
|
+
const getBoundary = (contentType) => {
|
|
11
|
+
const match = /boundary=([^;\s]+)/.exec(contentType);
|
|
12
|
+
if (match?.[1] === undefined)
|
|
13
|
+
return undefined;
|
|
14
|
+
return match[1].replaceAll('"', '');
|
|
15
|
+
};
|
|
16
|
+
const stripTrailingNewline = (buffer, start, end) => {
|
|
17
|
+
if (end <= start)
|
|
18
|
+
return end;
|
|
19
|
+
if (end - start >= 2 && buffer[end - 2] === 13 && buffer[end - 1] === 10) {
|
|
20
|
+
return end - 2;
|
|
21
|
+
}
|
|
22
|
+
if (end - start >= 1 && buffer[end - 1] === 10) {
|
|
23
|
+
return end - 1;
|
|
24
|
+
}
|
|
25
|
+
return end;
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* Extract parts from multipart body by boundary
|
|
29
|
+
*/
|
|
30
|
+
const extractParts = (bodyBuffer, boundary) => {
|
|
31
|
+
const parts = [];
|
|
32
|
+
if (!boundary)
|
|
33
|
+
return parts;
|
|
34
|
+
const boundaryBuffer = Buffer.from(`--${boundary}`);
|
|
35
|
+
let currentPos = 0;
|
|
36
|
+
while (currentPos < bodyBuffer.length) {
|
|
37
|
+
if (parts.length >= MAX_PARTS)
|
|
38
|
+
break;
|
|
39
|
+
const boundaryPos = bodyBuffer.indexOf(boundaryBuffer, currentPos);
|
|
40
|
+
if (boundaryPos === -1)
|
|
41
|
+
break;
|
|
42
|
+
const start = currentPos + (currentPos === 0 ? 0 : 2); // Skip CRLF before boundary
|
|
43
|
+
const end = stripTrailingNewline(bodyBuffer, start, boundaryPos);
|
|
44
|
+
if (start < end) {
|
|
45
|
+
parts.push(bodyBuffer.subarray(start, end));
|
|
46
|
+
}
|
|
47
|
+
currentPos = boundaryPos + boundaryBuffer.length;
|
|
48
|
+
}
|
|
49
|
+
return parts;
|
|
50
|
+
};
|
|
51
|
+
/**
|
|
52
|
+
* Parse a single multipart part
|
|
53
|
+
*/
|
|
54
|
+
const getHeaderInfo = (part) => {
|
|
55
|
+
// Find headers/body separator (double CRLF or double LF)
|
|
56
|
+
const headerEndIdx = part.indexOf(Buffer.from('\r\n\r\n'));
|
|
57
|
+
const headerEndIdx2 = part.indexOf(Buffer.from('\n\n'));
|
|
58
|
+
const headerEnd = headerEndIdx >= 0 ? headerEndIdx : headerEndIdx2;
|
|
59
|
+
if (headerEnd === -1)
|
|
60
|
+
return undefined;
|
|
61
|
+
if (headerEnd > MAX_HEADER_SIZE)
|
|
62
|
+
return undefined; // Header too large, ignore part
|
|
63
|
+
const headerSection = part.subarray(0, headerEnd).toString('utf-8');
|
|
64
|
+
const bodyStart = headerEnd + (headerEndIdx >= 0 ? 4 : 2);
|
|
65
|
+
return { headerSection, bodyStart };
|
|
66
|
+
};
|
|
67
|
+
const getContentDisposition = (headerSection) => {
|
|
68
|
+
const match = /Content-Disposition: form-data; name="([^"]+)"(?:; filename="([^"]*)")?/i.exec(headerSection);
|
|
69
|
+
if (!match)
|
|
70
|
+
return undefined;
|
|
71
|
+
return { fieldName: match[1] ?? '', fileName: match[2] };
|
|
72
|
+
};
|
|
73
|
+
const addFile = (part, headerSection, bodyStart, fieldName, fileName, result) => {
|
|
74
|
+
const contentTypeMatch = /Content-Type: ([^\r\n]+)/i.exec(headerSection);
|
|
75
|
+
const mimeType = contentTypeMatch?.[1] ?? 'application/octet-stream';
|
|
76
|
+
// CRITICAL: Use buffer subarray directly for zero-copy and to prevent binary corruption via trim()
|
|
77
|
+
const buffer = part.subarray(bodyStart);
|
|
78
|
+
const file = {
|
|
79
|
+
fieldName,
|
|
80
|
+
originalName: fileName,
|
|
81
|
+
mimeType,
|
|
82
|
+
buffer,
|
|
83
|
+
size: buffer.length,
|
|
84
|
+
};
|
|
85
|
+
result.files[fieldName] ??= [];
|
|
86
|
+
result.files[fieldName].push(file);
|
|
87
|
+
};
|
|
88
|
+
const addField = (partBody, fieldName, result) => {
|
|
89
|
+
const fieldValue = result.fields[fieldName];
|
|
90
|
+
if (fieldValue === undefined) {
|
|
91
|
+
result.fields[fieldName] = partBody;
|
|
92
|
+
}
|
|
93
|
+
else if (Array.isArray(fieldValue)) {
|
|
94
|
+
fieldValue.push(partBody);
|
|
95
|
+
}
|
|
96
|
+
else {
|
|
97
|
+
result.fields[fieldName] = [fieldValue, partBody];
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
const parsePart = (part, result) => {
|
|
101
|
+
if (part.length === 0)
|
|
102
|
+
return;
|
|
103
|
+
const headerInfo = getHeaderInfo(part);
|
|
104
|
+
if (!headerInfo)
|
|
105
|
+
return;
|
|
106
|
+
// OPTIMIZATION: Do not convert body to string yet, as it might be a binary file
|
|
107
|
+
const disposition = getContentDisposition(headerInfo.headerSection);
|
|
108
|
+
if (!disposition)
|
|
109
|
+
return;
|
|
110
|
+
if (disposition.fileName !== undefined && disposition.fileName !== null) {
|
|
111
|
+
addFile(part, headerInfo.headerSection, headerInfo.bodyStart, disposition.fieldName, disposition.fileName, result);
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
// Regular form field - safe to convert to string and trim
|
|
115
|
+
const partBody = part.subarray(headerInfo.bodyStart).toString('utf-8').trim();
|
|
116
|
+
addField(partBody, disposition.fieldName, result);
|
|
117
|
+
};
|
|
118
|
+
/**
|
|
119
|
+
* Parse multipart/form-data body
|
|
120
|
+
* Note: This is a simplified parser. For production use a proper multipart library
|
|
121
|
+
*/
|
|
122
|
+
export const parseMultipartFormData = (body, boundary) => {
|
|
123
|
+
const result = { fields: {}, files: {} };
|
|
124
|
+
if (!boundary)
|
|
125
|
+
return result;
|
|
126
|
+
const bodyBuffer = typeof body === 'string' ? Buffer.from(body) : body;
|
|
127
|
+
const parts = extractParts(bodyBuffer, boundary);
|
|
128
|
+
for (const part of parts) {
|
|
129
|
+
parsePart(part, result);
|
|
130
|
+
}
|
|
131
|
+
return result;
|
|
132
|
+
};
|
|
133
|
+
/**
|
|
134
|
+
* Parse multipart/form-data from request
|
|
135
|
+
*/
|
|
136
|
+
export const MultipartParser = Object.freeze({
|
|
137
|
+
/**
|
|
138
|
+
* Check if content-type is multipart/form-data
|
|
139
|
+
*/
|
|
140
|
+
isMultipart(contentType) {
|
|
141
|
+
return contentType.includes('multipart/form-data');
|
|
142
|
+
},
|
|
143
|
+
/**
|
|
144
|
+
* Get boundary from content-type header
|
|
145
|
+
*/
|
|
146
|
+
getBoundary(contentType) {
|
|
147
|
+
return getBoundary(contentType);
|
|
148
|
+
},
|
|
149
|
+
/**
|
|
150
|
+
* Parse multipart body
|
|
151
|
+
*/
|
|
152
|
+
parse(body, boundary) {
|
|
153
|
+
return parseMultipartFormData(body, boundary);
|
|
154
|
+
},
|
|
155
|
+
});
|
|
156
|
+
export default MultipartParser;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { UploadedFile } from '../FileUpload';
|
|
2
|
+
import type { IncomingMessage } from '../../node-singletons/http';
|
|
3
|
+
export type MultipartFieldValue = string | string[];
|
|
4
|
+
export type ParsedMultipartData = {
|
|
5
|
+
fields: Record<string, MultipartFieldValue>;
|
|
6
|
+
files: Record<string, UploadedFile[]>;
|
|
7
|
+
};
|
|
8
|
+
export type MultipartParseInput = {
|
|
9
|
+
req: IncomingMessage;
|
|
10
|
+
contentType: string;
|
|
11
|
+
/**
|
|
12
|
+
* Limits are enforced by the parser implementation.
|
|
13
|
+
* Core provides defaults via env vars, but the parser may choose stricter behavior.
|
|
14
|
+
*/
|
|
15
|
+
limits: {
|
|
16
|
+
maxFileSizeBytes: number;
|
|
17
|
+
maxFiles: number;
|
|
18
|
+
maxFields: number;
|
|
19
|
+
maxFieldSizeBytes: number;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
export type MultipartParserProvider = (input: MultipartParseInput) => Promise<ParsedMultipartData>;
|
|
23
|
+
declare function register(next: MultipartParserProvider): void;
|
|
24
|
+
declare function get(): MultipartParserProvider | null;
|
|
25
|
+
declare function has(): boolean;
|
|
26
|
+
declare function clear(): void;
|
|
27
|
+
export declare const MultipartParserRegistry: Readonly<{
|
|
28
|
+
register: typeof register;
|
|
29
|
+
get: typeof get;
|
|
30
|
+
has: typeof has;
|
|
31
|
+
clear: typeof clear;
|
|
32
|
+
}>;
|
|
33
|
+
export default MultipartParserRegistry;
|
|
34
|
+
//# sourceMappingURL=MultipartParserRegistry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MultipartParserRegistry.d.ts","sourceRoot":"","sources":["../../../../src/http/parsers/MultipartParserRegistry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAE7D,MAAM,MAAM,mBAAmB,GAAG,MAAM,GAAG,MAAM,EAAE,CAAC;AAEpD,MAAM,MAAM,mBAAmB,GAAG;IAChC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAAC;IAC5C,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,EAAE,CAAC,CAAC;CACvC,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IAChC,GAAG,EAAE,eAAe,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IAEpB;;;OAGG;IACH,MAAM,EAAE;QACN,gBAAgB,EAAE,MAAM,CAAC;QACzB,QAAQ,EAAE,MAAM,CAAC;QACjB,SAAS,EAAE,MAAM,CAAC;QAClB,iBAAiB,EAAE,MAAM,CAAC;KAC3B,CAAC;CACH,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG,CAAC,KAAK,EAAE,mBAAmB,KAAK,OAAO,CAAC,mBAAmB,CAAC,CAAC;AAInG,iBAAS,QAAQ,CAAC,IAAI,EAAE,uBAAuB,GAAG,IAAI,CAErD;AAED,iBAAS,GAAG,IAAI,uBAAuB,GAAG,IAAI,CAE7C;AAED,iBAAS,GAAG,IAAI,OAAO,CAEtB;AAED,iBAAS,KAAK,IAAI,IAAI,CAErB;AAED,eAAO,MAAM,uBAAuB;;;;;EAKlC,CAAC;AAEH,eAAe,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
let provider = null;
|
|
2
|
+
function register(next) {
|
|
3
|
+
provider = next;
|
|
4
|
+
}
|
|
5
|
+
function get() {
|
|
6
|
+
return provider;
|
|
7
|
+
}
|
|
8
|
+
function has() {
|
|
9
|
+
return provider !== null;
|
|
10
|
+
}
|
|
11
|
+
function clear() {
|
|
12
|
+
provider = null;
|
|
13
|
+
}
|
|
14
|
+
export const MultipartParserRegistry = Object.freeze({
|
|
15
|
+
register,
|
|
16
|
+
get,
|
|
17
|
+
has,
|
|
18
|
+
clear,
|
|
19
|
+
});
|
|
20
|
+
export default MultipartParserRegistry;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { IRequest } from './Request';
|
|
2
|
+
export declare const validatedBody: <TBody = Record<string, unknown>>(req: IRequest) => TBody | undefined;
|
|
3
|
+
export declare const validatedQuery: <TQuery = Record<string, unknown>>(req: IRequest) => TQuery | undefined;
|
|
4
|
+
export declare const validatedParams: <TParams = Record<string, unknown>>(req: IRequest) => TParams | undefined;
|
|
5
|
+
export declare const validatedHeaders: <THeaders = Record<string, unknown>>(req: IRequest) => THeaders | undefined;
|
|
6
|
+
export declare const Validated: Readonly<{
|
|
7
|
+
body: <TBody = Record<string, unknown>>(req: IRequest) => TBody | undefined;
|
|
8
|
+
query: <TQuery = Record<string, unknown>>(req: IRequest) => TQuery | undefined;
|
|
9
|
+
params: <TParams = Record<string, unknown>>(req: IRequest) => TParams | undefined;
|
|
10
|
+
headers: <THeaders = Record<string, unknown>>(req: IRequest) => THeaders | undefined;
|
|
11
|
+
}>;
|
|
12
|
+
//# sourceMappingURL=validated.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validated.d.ts","sourceRoot":"","sources":["../../../src/http/validated.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAa9C,eAAO,MAAM,aAAa,GAAI,KAAK,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC3D,KAAK,QAAQ,KACZ,KAAK,GAAG,SAKV,CAAC;AAEF,eAAO,MAAM,cAAc,GAAI,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7D,KAAK,QAAQ,KACZ,MAAM,GAAG,SAKX,CAAC;AAEF,eAAO,MAAM,eAAe,GAAI,OAAO,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC/D,KAAK,QAAQ,KACZ,OAAO,GAAG,SAKZ,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAAI,QAAQ,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACjE,KAAK,QAAQ,KACZ,QAAQ,GAAG,SAKb,CAAC;AAEF,eAAO,MAAM,SAAS;WApCQ,KAAK,iCAC5B,QAAQ,KACZ,KAAK,GAAG,SAAS;YAOW,MAAM,iCAC9B,QAAQ,KACZ,MAAM,GAAG,SAAS;aAOW,OAAO,iCAChC,QAAQ,KACZ,OAAO,GAAG,SAAS;cAOW,QAAQ,iCAClC,QAAQ,KACZ,QAAQ,GAAG,SAAS;EAYrB,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
const getValidated = (req) => {
|
|
2
|
+
return req.validated;
|
|
3
|
+
};
|
|
4
|
+
export const validatedBody = (req) => {
|
|
5
|
+
const validated = getValidated(req);
|
|
6
|
+
if (validated === undefined)
|
|
7
|
+
return undefined;
|
|
8
|
+
if (validated.body === undefined)
|
|
9
|
+
return undefined;
|
|
10
|
+
return validated.body;
|
|
11
|
+
};
|
|
12
|
+
export const validatedQuery = (req) => {
|
|
13
|
+
const validated = getValidated(req);
|
|
14
|
+
if (validated === undefined)
|
|
15
|
+
return undefined;
|
|
16
|
+
if (validated.query === undefined)
|
|
17
|
+
return undefined;
|
|
18
|
+
return validated.query;
|
|
19
|
+
};
|
|
20
|
+
export const validatedParams = (req) => {
|
|
21
|
+
const validated = getValidated(req);
|
|
22
|
+
if (validated === undefined)
|
|
23
|
+
return undefined;
|
|
24
|
+
if (validated.params === undefined)
|
|
25
|
+
return undefined;
|
|
26
|
+
return validated.params;
|
|
27
|
+
};
|
|
28
|
+
export const validatedHeaders = (req) => {
|
|
29
|
+
const validated = getValidated(req);
|
|
30
|
+
if (validated === undefined)
|
|
31
|
+
return undefined;
|
|
32
|
+
if (validated.headers === undefined)
|
|
33
|
+
return undefined;
|
|
34
|
+
return validated.headers;
|
|
35
|
+
};
|
|
36
|
+
export const Validated = Object.freeze({
|
|
37
|
+
body: validatedBody,
|
|
38
|
+
query: validatedQuery,
|
|
39
|
+
params: validatedParams,
|
|
40
|
+
headers: validatedHeaders,
|
|
41
|
+
});
|
package/src/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* ZinTrust Framework - Production-Grade TypeScript Backend
|
|
3
3
|
* Built for performance, type safety, and exceptional developer experience
|
|
4
4
|
*/
|
|
5
5
|
declare const ZintrustApplication: Readonly<{
|
|
@@ -53,11 +53,21 @@ declare const ZintrustSignedRequest: Readonly<{
|
|
|
53
53
|
export { Server } from './boot/Server';
|
|
54
54
|
export { ServiceContainer } from './container/ServiceContainer';
|
|
55
55
|
export { Controller } from './http/Controller';
|
|
56
|
+
export { FileUpload } from './http/FileUpload';
|
|
57
|
+
export type { FileUploadOptions, IFileUploadHandler, UploadedFile } from './http/FileUpload';
|
|
56
58
|
export { Kernel } from './http/Kernel';
|
|
59
|
+
export { bodyParsingMiddleware } from './http/middleware/BodyParsingMiddleware';
|
|
60
|
+
export { fileUploadMiddleware } from './http/middleware/FileUploadMiddleware';
|
|
61
|
+
export { BodyParsers } from './http/parsers/BodyParsers';
|
|
62
|
+
export { MultipartParser } from './http/parsers/MultipartParser';
|
|
63
|
+
export { MultipartParserRegistry } from './http/parsers/MultipartParserRegistry';
|
|
64
|
+
export type { MultipartFieldValue, MultipartParseInput, MultipartParserProvider, ParsedMultipartData, } from './http/parsers/MultipartParserRegistry';
|
|
57
65
|
export { Request } from './http/Request';
|
|
58
|
-
export type { IRequest } from './http/Request';
|
|
66
|
+
export type { IRequest, ValidatedRequest } from './http/Request';
|
|
67
|
+
export { RequestContext } from './http/RequestContext';
|
|
59
68
|
export { Response } from './http/Response';
|
|
60
69
|
export type { IResponse } from './http/Response';
|
|
70
|
+
export { getValidatedBody, getValidatedHeaders, getValidatedParams, getValidatedQuery, hasValidatedBody, requireValidatedBody, ValidationHelper, } from './http/ValidationHelper';
|
|
61
71
|
export { CsrfMiddleware } from './middleware/CsrfMiddleware';
|
|
62
72
|
export { ErrorHandlerMiddleware } from './middleware/ErrorHandlerMiddleware';
|
|
63
73
|
export { LoggingMiddleware } from './middleware/LoggingMiddleware';
|
|
@@ -66,32 +76,47 @@ export type { Middleware } from './middleware/MiddlewareStack';
|
|
|
66
76
|
export { RateLimiter } from './middleware/RateLimiter';
|
|
67
77
|
export { SecurityMiddleware } from './middleware/SecurityMiddleware';
|
|
68
78
|
export { SessionMiddleware } from './middleware/SessionMiddleware';
|
|
79
|
+
export { ValidationMiddleware } from './middleware/ValidationMiddleware';
|
|
69
80
|
export { MySQLAdapter } from './orm/adapters/MySQLAdapter';
|
|
70
81
|
export { PostgreSQLAdapter } from './orm/adapters/PostgreSQLAdapter';
|
|
71
82
|
export { SQLiteAdapter } from './orm/adapters/SQLiteAdapter';
|
|
72
83
|
export { SQLServerAdapter } from './orm/adapters/SQLServerAdapter';
|
|
73
|
-
export { Database, resetDatabase, useDatabase } from './orm/Database';
|
|
84
|
+
export { Database, resetDatabase, useDatabase, useEnsureDbConnected } from './orm/Database';
|
|
85
|
+
export type { IDatabase } from './orm/Database';
|
|
74
86
|
export { Model } from './orm/Model';
|
|
75
87
|
export type { IModel, ModelConfig, ModelStatic } from './orm/Model';
|
|
76
88
|
export { QueryBuilder } from './orm/QueryBuilder';
|
|
89
|
+
export type { InsertResult, IQueryBuilder } from './orm/QueryBuilder';
|
|
77
90
|
export type { IRelationship } from './orm/Relationships';
|
|
78
91
|
export { ZintrustApplication as Application };
|
|
92
|
+
export { DateTime } from './time/DateTime';
|
|
93
|
+
export type { IDateTime } from './time/DateTime';
|
|
94
|
+
export { Schema as MigrationSchema, type Blueprint } from './migrations/schema';
|
|
95
|
+
export { OpenApiGenerator } from './openapi/OpenApiGenerator';
|
|
96
|
+
export type { OpenApiGeneratorOptions } from './openapi/OpenApiGenerator';
|
|
79
97
|
export { DatabaseAdapterRegistry } from './orm/DatabaseAdapterRegistry';
|
|
80
98
|
export { Router } from './routing/Router';
|
|
81
99
|
export type { IRouter } from './routing/Router';
|
|
100
|
+
export { normalizeRouteMeta, RouteRegistry } from './routing/RouteRegistry';
|
|
101
|
+
export type { RouteMeta, RouteMetaInput, RouteRegistration } from './routing/RouteRegistry';
|
|
102
|
+
export { generateSecureJobId, generateUuid, getString, Utilities, type UtilitiesType, } from './common/utility';
|
|
82
103
|
export { delay, ensureDirSafe } from './common/index';
|
|
83
|
-
export { generateSecureJobId, generateUuid } from './common/uuid';
|
|
84
104
|
export { ZintrustAwsSigV4 as AwsSigV4 };
|
|
85
105
|
export { collect, Collection } from './collections/index';
|
|
86
106
|
export type { ICollection, PrimitiveKey } from './collections/index';
|
|
87
107
|
export { HttpClient } from './tools/http/Http';
|
|
88
108
|
export type { IHttpRequest, IHttpResponse } from './tools/http/Http';
|
|
89
|
-
export type { DatabaseConfig, ID1Database } from './orm/DatabaseAdapter';
|
|
109
|
+
export type { DatabaseConfig, ID1Database, IDatabaseAdapter, QueryResult, } from './orm/DatabaseAdapter';
|
|
90
110
|
export { MemoryProfiler } from './profiling/MemoryProfiler';
|
|
91
111
|
export { N1Detector } from './profiling/N1Detector';
|
|
92
112
|
export { QueryLogger } from './profiling/QueryLogger';
|
|
93
113
|
export { RequestProfiler } from './profiling/RequestProfiler';
|
|
94
114
|
export type { MemoryDelta, MemorySnapshot, N1Pattern, ProfileReport, QueryLogEntry, } from './profiling/types';
|
|
115
|
+
export { GenerationCache, LazyLoader, Memoize, ParallelGenerator, PerformanceOptimizer, runAll, runBatch, } from './performance/Optimizer';
|
|
116
|
+
export type { IGenerationCache, ILazyLoader, IPerformanceOptimizer } from './performance/Optimizer';
|
|
117
|
+
export { OpenTelemetry } from './observability/OpenTelemetry';
|
|
118
|
+
export { PrometheusMetrics } from './observability/PrometheusMetrics';
|
|
119
|
+
export type { ObserveDbQueryInput, ObserveHttpRequestInput, } from './observability/PrometheusMetrics';
|
|
95
120
|
export { ValidationError } from './validation/ValidationError';
|
|
96
121
|
export type { FieldError } from './validation/ValidationError';
|
|
97
122
|
export { Schema, Validator } from './validation/Validator';
|
|
@@ -105,6 +130,8 @@ export { JwtManager } from './security/JwtManager';
|
|
|
105
130
|
export type { IJwtManager, JwtAlgorithm, JwtManagerType, JwtOptions, JwtPayload, } from './security/JwtManager';
|
|
106
131
|
export { PasswordResetTokenBroker } from './security/PasswordResetTokenBroker';
|
|
107
132
|
export type { IPasswordResetTokenBroker, IPasswordResetTokenStore, PasswordResetTokenBrokerOptions, PasswordResetTokenBrokerType, PasswordResetTokenRecord, } from './security/PasswordResetTokenBroker';
|
|
133
|
+
export { createSanitizer, Sanitizer, type SanitizerType } from './security/Sanitizer';
|
|
134
|
+
export { TokenRevocation } from './security/TokenRevocation';
|
|
108
135
|
export { Xss } from './security/Xss';
|
|
109
136
|
export { XssProtection } from './security/XssProtection';
|
|
110
137
|
export { ZintrustSignedRequest as SignedRequest };
|
|
@@ -119,31 +146,45 @@ export type * from './config/type';
|
|
|
119
146
|
export { appConfig } from './config/app';
|
|
120
147
|
export type { AppConfig } from './config/app';
|
|
121
148
|
export { cacheConfig } from './config/cache';
|
|
122
|
-
export type { CacheConfig } from './config/cache';
|
|
149
|
+
export type { CacheConfig, CacheConfigOverrides } from './config/cache';
|
|
150
|
+
export { Cache, cache } from './cache/Cache';
|
|
151
|
+
export type { CacheDriver } from './cache/CacheDriver';
|
|
123
152
|
export { registerCachesFromRuntimeConfig } from './cache/CacheRuntimeRegistration';
|
|
124
153
|
export { CacheDriverRegistry } from './cache/CacheDriverRegistry';
|
|
125
154
|
export { databaseConfig } from './config/database';
|
|
126
|
-
export type { DatabaseConfig as DatabaseRuntimeConfig } from './config/database';
|
|
155
|
+
export type { DatabaseConfigOverrides, DatabaseConfig as DatabaseRuntimeConfig, } from './config/database';
|
|
127
156
|
export { registerDatabasesFromRuntimeConfig } from './orm/DatabaseRuntimeRegistration';
|
|
128
157
|
export { microservicesConfig } from './config/microservices';
|
|
129
158
|
export type { MicroservicesConfig } from './config/microservices';
|
|
130
|
-
export {
|
|
159
|
+
export { MicroserviceBootstrap } from './microservices/MicroserviceBootstrap';
|
|
160
|
+
export type { IMicroserviceBootstrap, ServiceConfig } from './microservices/MicroserviceBootstrap';
|
|
161
|
+
export { MicroserviceManager } from './microservices/MicroserviceManager';
|
|
162
|
+
export type { IMicroserviceManager, MicroserviceConfig } from './microservices/MicroserviceManager';
|
|
163
|
+
export { RequestTracingMiddleware } from './microservices/RequestTracingMiddleware';
|
|
164
|
+
export { ServiceAuthMiddleware } from './microservices/ServiceAuthMiddleware';
|
|
165
|
+
export { HealthCheckHandler, ServiceHealthMonitor } from './microservices/ServiceHealthMonitor';
|
|
166
|
+
export type { AggregatedHealthStatus, HealthCheckResult, IServiceHealthMonitor, } from './microservices/ServiceHealthMonitor';
|
|
167
|
+
export { middlewareConfig, MiddlewareKeys } from './config/middleware';
|
|
168
|
+
export type { MiddlewareKey } from './config/middleware';
|
|
131
169
|
export type { MiddlewareConfigType } from './config/type';
|
|
132
170
|
export { queueConfig } from './config/queue';
|
|
133
|
-
export type { QueueConfig } from './config/queue';
|
|
171
|
+
export type { QueueConfig, QueueConfigOverrides } from './config/queue';
|
|
134
172
|
export { default as broadcastConfig } from './config/broadcast';
|
|
173
|
+
export type { BroadcastConfigOverrides } from './config/broadcast';
|
|
135
174
|
export { default as notificationConfig } from './config/notification';
|
|
175
|
+
export type { NotificationConfig, NotificationConfigOverrides } from './config/notification';
|
|
136
176
|
export { securityConfig } from './config/security';
|
|
137
177
|
export { mailConfig } from './config/mail';
|
|
138
|
-
export type { MailConfig } from './config/mail';
|
|
178
|
+
export type { MailConfig, MailConfigOverrides } from './config/mail';
|
|
139
179
|
export { storageConfig } from './config/storage';
|
|
140
|
-
export type { StorageConfig } from './config/storage';
|
|
180
|
+
export type { StorageConfig, StorageConfigOverrides } from './config/storage';
|
|
141
181
|
export { startupConfig } from './config/startup';
|
|
142
182
|
export type { StartupConfig } from './config/startup';
|
|
143
183
|
export { Constants, DEFAULTS, ENV_KEYS, HTTP_HEADERS, MIME_TYPES } from './config/constants';
|
|
144
184
|
export { FeatureFlags } from './config/features';
|
|
145
185
|
export { Cloudflare } from './config/cloudflare';
|
|
146
|
-
export { SecretsManager } from './config/SecretsManager';
|
|
186
|
+
export { getDatabaseCredentials, getJwtSecrets, SECRETS, SecretsManager, } from './config/SecretsManager';
|
|
187
|
+
export type { DatabaseCredentials, JwtSecrets } from './config/SecretsManager';
|
|
147
188
|
export type { MailDriverConfig, MailDriverName, WorkersEnv } from './config/type';
|
|
148
189
|
export { StartupConfigValidator } from './config/StartupConfigValidator';
|
|
149
190
|
export { Mail } from './tools/mail/Mail';
|
|
@@ -181,4 +222,24 @@ export { GcsDriver } from './tools/storage/drivers/Gcs';
|
|
|
181
222
|
export type { GcsConfig } from './tools/storage/drivers/Gcs';
|
|
182
223
|
export { RedisQueue } from './tools/queue/drivers/Redis';
|
|
183
224
|
export { Queue } from './tools/queue/Queue';
|
|
225
|
+
export { SeederLoader } from './seeders/SeederLoader';
|
|
226
|
+
export type { LoadedSeeder, SeederHandler } from './seeders/types';
|
|
227
|
+
export { default as logCleanup } from './schedules/log-cleanup';
|
|
228
|
+
export * as NodeSingletons from './node-singletons/index';
|
|
229
|
+
export { Auth } from './features/Auth';
|
|
230
|
+
export { MicroserviceGenerator } from './microservices/MicroserviceGenerator';
|
|
231
|
+
export type { GenerateServiceOptions, IMicroserviceGenerator, } from './microservices/MicroserviceGenerator';
|
|
232
|
+
export { BaseCommand } from './cli/BaseCommand';
|
|
233
|
+
export type { CommandOptions } from './cli/BaseCommand';
|
|
234
|
+
export { CLI } from './cli/CLI';
|
|
235
|
+
export { ErrorHandler, EXIT_CODES } from './cli/ErrorHandler';
|
|
236
|
+
export { getKernel } from './runtime/getKernel';
|
|
237
|
+
export { RuntimeDetector } from './runtime/RuntimeDetector';
|
|
238
|
+
export { useFileLoader } from './runtime/useFileLoader';
|
|
239
|
+
export { PluginManager } from './runtime/PluginManager';
|
|
240
|
+
export { PluginRegistry } from './runtime/PluginRegistry';
|
|
241
|
+
export { nowIso } from './common/utility';
|
|
242
|
+
export type { SanitizerError } from './exceptions/ZintrustError';
|
|
243
|
+
export { randomBytes } from './node-singletons/crypto';
|
|
244
|
+
export type { MiddlewaresType } from './config/middleware';
|
|
184
245
|
//# sourceMappingURL=index.d.ts.map
|