@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
|
@@ -3,29 +3,47 @@
|
|
|
3
3
|
* Schema-based input validation with fluent API matching QueryBuilder style
|
|
4
4
|
* Sealed namespace pattern - all exports through Validator namespace
|
|
5
5
|
*/
|
|
6
|
-
export type Rule = 'required' | 'email' | 'string' | 'number' | 'boolean' | 'array' | 'integer' | 'min' | 'max' | 'minLength' | 'maxLength' | 'regex' | 'in' | 'custom';
|
|
6
|
+
export type Rule = 'required' | 'email' | 'string' | 'number' | 'boolean' | 'array' | 'integer' | 'min' | 'max' | 'minLength' | 'maxLength' | 'regex' | 'in' | 'custom' | 'alphanumeric' | 'uuid' | 'token' | 'ipAddress' | 'positiveNumber' | 'digits' | 'decimal' | 'url' | 'phone' | 'date';
|
|
7
7
|
export interface ValidationRule {
|
|
8
8
|
rule: Rule;
|
|
9
9
|
value?: unknown;
|
|
10
10
|
message?: string;
|
|
11
11
|
}
|
|
12
|
-
export
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
12
|
+
export type CustomValidatorFn = ((value: unknown) => boolean) | ((value: unknown, data: Record<string, unknown>) => boolean);
|
|
13
|
+
export interface ISchemaBase<TReturn> {
|
|
14
|
+
required(field: string, message?: string): TReturn;
|
|
15
|
+
string(field: string, message?: string): TReturn;
|
|
16
|
+
number(field: string, message?: string): TReturn;
|
|
17
|
+
integer(field: string, message?: string): TReturn;
|
|
18
|
+
boolean(field: string, message?: string): TReturn;
|
|
19
|
+
array(field: string, message?: string): TReturn;
|
|
20
|
+
email(field: string, message?: string): TReturn;
|
|
21
|
+
min(field: string, value: number, message?: string): TReturn;
|
|
22
|
+
max(field: string, value: number, message?: string): TReturn;
|
|
23
|
+
minLength(field: string, value: number, message?: string): TReturn;
|
|
24
|
+
maxLength(field: string, value: number, message?: string): TReturn;
|
|
25
|
+
regex(field: string, pattern: RegExp, message?: string): TReturn;
|
|
26
|
+
in(field: string, values: unknown[], message?: string): TReturn;
|
|
27
|
+
custom(field: string, validator: CustomValidatorFn, message?: string): TReturn;
|
|
28
|
+
alphanumeric(field: string, message?: string): TReturn;
|
|
29
|
+
uuid(field: string, message?: string): TReturn;
|
|
30
|
+
token(field: string, message?: string): TReturn;
|
|
31
|
+
ipAddress(field: string, message?: string): TReturn;
|
|
32
|
+
positiveNumber(field: string, message?: string): TReturn;
|
|
33
|
+
digits(field: string, message?: string): TReturn;
|
|
34
|
+
decimal(field: string, message?: string): TReturn;
|
|
35
|
+
url(field: string, message?: string): TReturn;
|
|
36
|
+
phone(field: string, message?: string): TReturn;
|
|
37
|
+
date(field: string, message?: string): TReturn;
|
|
27
38
|
getRules(): Map<string, ValidationRule[]>;
|
|
28
39
|
}
|
|
40
|
+
export type ISchema = ISchemaBase<ISchema>;
|
|
41
|
+
export type TypedSchema<T> = ISchemaBase<TypedSchema<T>> & {
|
|
42
|
+
readonly __type?: T;
|
|
43
|
+
};
|
|
44
|
+
export type InferSchema<TSchema> = TSchema extends {
|
|
45
|
+
readonly __type?: infer T;
|
|
46
|
+
} ? unknown extends T ? never : T : never;
|
|
29
47
|
export interface SchemaType {
|
|
30
48
|
create(): ISchema;
|
|
31
49
|
}
|
|
@@ -38,7 +56,14 @@ export declare const Schema: Readonly<{
|
|
|
38
56
|
* Create a new schema instance
|
|
39
57
|
*/
|
|
40
58
|
create(): ISchema;
|
|
59
|
+
/**
|
|
60
|
+
* Create a schema instance carrying a declared TypeScript shape.
|
|
61
|
+
* This enables schema-inferred request typing when paired with validation middleware.
|
|
62
|
+
*/
|
|
63
|
+
typed<T>(): TypedSchema<T>;
|
|
41
64
|
}>;
|
|
65
|
+
type RuleStringInput = string | string[];
|
|
66
|
+
export type RuleStringMap = Record<string, RuleStringInput>;
|
|
42
67
|
/**
|
|
43
68
|
* Validator validates data against a schema
|
|
44
69
|
*/
|
|
@@ -48,9 +73,17 @@ export declare const Validator: Readonly<{
|
|
|
48
73
|
* Create a new schema instance
|
|
49
74
|
*/
|
|
50
75
|
create(): ISchema;
|
|
76
|
+
/**
|
|
77
|
+
* Create a schema instance carrying a declared TypeScript shape.
|
|
78
|
+
* This enables schema-inferred request typing when paired with validation middleware.
|
|
79
|
+
*/
|
|
80
|
+
typed<T>(): TypedSchema<T>;
|
|
51
81
|
}>;
|
|
52
82
|
validate: (data: Record<string, unknown>, schema: ISchema) => Record<string, unknown>;
|
|
53
83
|
isValid: (data: Record<string, unknown>, schema: ISchema) => boolean;
|
|
84
|
+
rulesToSchema: (rules: RuleStringMap) => ISchema;
|
|
85
|
+
validateRules: (data: Record<string, unknown>, rules: RuleStringMap) => Record<string, unknown>;
|
|
86
|
+
isValidRules: (data: Record<string, unknown>, rules: RuleStringMap) => boolean;
|
|
54
87
|
}>;
|
|
55
88
|
/**
|
|
56
89
|
* Export ValidationError for use in tests and applications
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Validator.d.ts","sourceRoot":"","sources":["../../../src/validation/Validator.ts"],"names":[],"mappings":"AAAA;;;;GAIG;
|
|
1
|
+
{"version":3,"file":"Validator.d.ts","sourceRoot":"","sources":["../../../src/validation/Validator.ts"],"names":[],"mappings":"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"}
|
|
@@ -42,10 +42,27 @@ export const Schema = Object.freeze({
|
|
|
42
42
|
regex: (f, p, m) => addComplexRule(schema, rules, f, 'regex', p, m),
|
|
43
43
|
in: (f, v, m) => addComplexRule(schema, rules, f, 'in', v, m),
|
|
44
44
|
custom: (f, v, m) => addComplexRule(schema, rules, f, 'custom', v, m),
|
|
45
|
+
alphanumeric: (f, m) => addSimpleRule(schema, rules, f, 'alphanumeric', m),
|
|
46
|
+
uuid: (f, m) => addSimpleRule(schema, rules, f, 'uuid', m),
|
|
47
|
+
token: (f, m) => addSimpleRule(schema, rules, f, 'token', m),
|
|
48
|
+
ipAddress: (f, m) => addSimpleRule(schema, rules, f, 'ipAddress', m),
|
|
49
|
+
positiveNumber: (f, m) => addSimpleRule(schema, rules, f, 'positiveNumber', m),
|
|
50
|
+
digits: (f, m) => addSimpleRule(schema, rules, f, 'digits', m),
|
|
51
|
+
decimal: (f, m) => addSimpleRule(schema, rules, f, 'decimal', m),
|
|
52
|
+
url: (f, m) => addSimpleRule(schema, rules, f, 'url', m),
|
|
53
|
+
phone: (f, m) => addSimpleRule(schema, rules, f, 'phone', m),
|
|
54
|
+
date: (f, m) => addSimpleRule(schema, rules, f, 'date', m),
|
|
45
55
|
getRules: () => rules,
|
|
46
56
|
};
|
|
47
57
|
return schema;
|
|
48
58
|
},
|
|
59
|
+
/**
|
|
60
|
+
* Create a schema instance carrying a declared TypeScript shape.
|
|
61
|
+
* This enables schema-inferred request typing when paired with validation middleware.
|
|
62
|
+
*/
|
|
63
|
+
typed() {
|
|
64
|
+
return Schema.create();
|
|
65
|
+
},
|
|
49
66
|
});
|
|
50
67
|
/**
|
|
51
68
|
* Validate data against schema
|
|
@@ -56,7 +73,7 @@ const validate = (data, schema) => {
|
|
|
56
73
|
for (const [field, fieldRules] of rules.entries()) {
|
|
57
74
|
const value = data[field];
|
|
58
75
|
for (const rule of fieldRules) {
|
|
59
|
-
const error = validateRule(field, value, rule);
|
|
76
|
+
const error = validateRule(field, value, rule, data);
|
|
60
77
|
if (error !== null) {
|
|
61
78
|
errors.push(error);
|
|
62
79
|
}
|
|
@@ -80,7 +97,7 @@ const isValid = (data, schema) => {
|
|
|
80
97
|
return false;
|
|
81
98
|
}
|
|
82
99
|
};
|
|
83
|
-
function validateRule(field, value, rule) {
|
|
100
|
+
function validateRule(field, value, rule, data) {
|
|
84
101
|
const message = (rule?.message ?? '') || getDefaultMessage(field, rule.rule);
|
|
85
102
|
const validators = {
|
|
86
103
|
required: () => validateRequired(field, value, message),
|
|
@@ -96,10 +113,204 @@ function validateRule(field, value, rule) {
|
|
|
96
113
|
maxLength: () => validateMaxLength(field, value, rule.value, message),
|
|
97
114
|
regex: () => validateRegex(field, value, rule.value, message),
|
|
98
115
|
in: () => validateIn(field, value, rule.value, message),
|
|
99
|
-
custom: () => validateCustom(field, value, rule.value, message),
|
|
116
|
+
custom: () => validateCustom(field, value, rule.value, message, data),
|
|
117
|
+
alphanumeric: () => validateAlphanumeric(field, value, message),
|
|
118
|
+
uuid: () => validateUuid(field, value, message),
|
|
119
|
+
token: () => validateToken(field, value, message),
|
|
120
|
+
ipAddress: () => validateIpAddress(field, value, message),
|
|
121
|
+
positiveNumber: () => validatePositiveNumber(field, value, message),
|
|
122
|
+
digits: () => validateDigits(field, value, message),
|
|
123
|
+
decimal: () => validateDecimal(field, value, message),
|
|
124
|
+
url: () => validateUrl(field, value, message),
|
|
125
|
+
phone: () => validatePhone(field, value, message),
|
|
126
|
+
date: () => validateDate(field, value, message),
|
|
100
127
|
};
|
|
101
128
|
return validators[rule.rule]?.() ?? null;
|
|
102
129
|
}
|
|
130
|
+
const splitRuleTokens = (input) => {
|
|
131
|
+
if (Array.isArray(input))
|
|
132
|
+
return input.flatMap((v) => splitRuleTokens(v));
|
|
133
|
+
const trimmed = input.trim();
|
|
134
|
+
if (trimmed === '')
|
|
135
|
+
return [];
|
|
136
|
+
return trimmed
|
|
137
|
+
.split('|')
|
|
138
|
+
.map((t) => t.trim())
|
|
139
|
+
.filter((t) => t !== '');
|
|
140
|
+
};
|
|
141
|
+
const parseRegexLiteral = (raw) => {
|
|
142
|
+
const trimmed = raw.trim();
|
|
143
|
+
if (!trimmed.startsWith('/') || trimmed.length < 2)
|
|
144
|
+
return null;
|
|
145
|
+
const lastSlash = trimmed.lastIndexOf('/');
|
|
146
|
+
if (lastSlash <= 0)
|
|
147
|
+
return null;
|
|
148
|
+
const pattern = trimmed.slice(1, lastSlash);
|
|
149
|
+
const flags = trimmed.slice(lastSlash + 1);
|
|
150
|
+
if (pattern.length === 0)
|
|
151
|
+
return null;
|
|
152
|
+
if (pattern.length > 500)
|
|
153
|
+
return null;
|
|
154
|
+
if (flags.length > 10)
|
|
155
|
+
return null;
|
|
156
|
+
try {
|
|
157
|
+
return new RegExp(pattern, flags);
|
|
158
|
+
}
|
|
159
|
+
catch {
|
|
160
|
+
return null;
|
|
161
|
+
}
|
|
162
|
+
};
|
|
163
|
+
const parseNumberArg = (arg) => {
|
|
164
|
+
if (arg === undefined)
|
|
165
|
+
return null;
|
|
166
|
+
const n = Number.parseFloat(arg);
|
|
167
|
+
if (Number.isNaN(n))
|
|
168
|
+
return null;
|
|
169
|
+
return n;
|
|
170
|
+
};
|
|
171
|
+
const parseInArgs = (arg) => {
|
|
172
|
+
return (arg ?? '')
|
|
173
|
+
.split(',')
|
|
174
|
+
.map((p) => p.trim())
|
|
175
|
+
.filter((p) => p !== '');
|
|
176
|
+
};
|
|
177
|
+
const ruleStringTokenHandlers = {
|
|
178
|
+
required: ({ schema, field }) => {
|
|
179
|
+
schema.required(field);
|
|
180
|
+
},
|
|
181
|
+
string: ({ schema, field }) => {
|
|
182
|
+
schema.string(field);
|
|
183
|
+
},
|
|
184
|
+
number: ({ schema, field }) => {
|
|
185
|
+
schema.number(field);
|
|
186
|
+
},
|
|
187
|
+
integer: ({ schema, field }) => {
|
|
188
|
+
schema.integer(field);
|
|
189
|
+
},
|
|
190
|
+
boolean: ({ schema, field }) => {
|
|
191
|
+
schema.boolean(field);
|
|
192
|
+
},
|
|
193
|
+
array: ({ schema, field }) => {
|
|
194
|
+
schema.array(field);
|
|
195
|
+
},
|
|
196
|
+
email: ({ schema, field }) => {
|
|
197
|
+
schema.email(field);
|
|
198
|
+
},
|
|
199
|
+
alphanumeric: ({ schema, field }) => {
|
|
200
|
+
schema.alphanumeric(field);
|
|
201
|
+
},
|
|
202
|
+
uuid: ({ schema, field }) => {
|
|
203
|
+
schema.uuid(field);
|
|
204
|
+
},
|
|
205
|
+
token: ({ schema, field }) => {
|
|
206
|
+
schema.token(field);
|
|
207
|
+
},
|
|
208
|
+
ipAddress: ({ schema, field }) => {
|
|
209
|
+
schema.ipAddress(field);
|
|
210
|
+
},
|
|
211
|
+
ip: ({ schema, field }) => {
|
|
212
|
+
schema.ipAddress(field);
|
|
213
|
+
},
|
|
214
|
+
positiveNumber: ({ schema, field }) => {
|
|
215
|
+
schema.positiveNumber(field);
|
|
216
|
+
},
|
|
217
|
+
positive: ({ schema, field }) => {
|
|
218
|
+
schema.positiveNumber(field);
|
|
219
|
+
},
|
|
220
|
+
digits: ({ schema, field }) => {
|
|
221
|
+
schema.digits(field);
|
|
222
|
+
},
|
|
223
|
+
decimal: ({ schema, field }) => {
|
|
224
|
+
schema.decimal(field);
|
|
225
|
+
},
|
|
226
|
+
url: ({ schema, field }) => {
|
|
227
|
+
schema.url(field);
|
|
228
|
+
},
|
|
229
|
+
phone: ({ schema, field }) => {
|
|
230
|
+
schema.phone(field);
|
|
231
|
+
},
|
|
232
|
+
date: ({ schema, field }) => {
|
|
233
|
+
schema.date(field);
|
|
234
|
+
},
|
|
235
|
+
min: ({ schema, field, tokenSet, arg }) => {
|
|
236
|
+
const n = parseNumberArg(arg);
|
|
237
|
+
if (n === null)
|
|
238
|
+
return;
|
|
239
|
+
if (tokenSet.has('string') || tokenSet.has('array'))
|
|
240
|
+
schema.minLength(field, n);
|
|
241
|
+
else
|
|
242
|
+
schema.min(field, n);
|
|
243
|
+
},
|
|
244
|
+
max: ({ schema, field, tokenSet, arg }) => {
|
|
245
|
+
const n = parseNumberArg(arg);
|
|
246
|
+
if (n === null)
|
|
247
|
+
return;
|
|
248
|
+
if (tokenSet.has('string') || tokenSet.has('array'))
|
|
249
|
+
schema.maxLength(field, n);
|
|
250
|
+
else
|
|
251
|
+
schema.max(field, n);
|
|
252
|
+
},
|
|
253
|
+
minLength: ({ schema, field, arg }) => {
|
|
254
|
+
const n = parseNumberArg(arg);
|
|
255
|
+
if (n === null)
|
|
256
|
+
return;
|
|
257
|
+
schema.minLength(field, n);
|
|
258
|
+
},
|
|
259
|
+
maxLength: ({ schema, field, arg }) => {
|
|
260
|
+
const n = parseNumberArg(arg);
|
|
261
|
+
if (n === null)
|
|
262
|
+
return;
|
|
263
|
+
schema.maxLength(field, n);
|
|
264
|
+
},
|
|
265
|
+
regex: ({ schema, field, arg }) => {
|
|
266
|
+
if (arg === undefined)
|
|
267
|
+
return;
|
|
268
|
+
const re = parseRegexLiteral(arg);
|
|
269
|
+
if (re === null)
|
|
270
|
+
return;
|
|
271
|
+
schema.regex(field, re);
|
|
272
|
+
},
|
|
273
|
+
in: ({ schema, field, arg }) => {
|
|
274
|
+
schema.in(field, parseInArgs(arg));
|
|
275
|
+
},
|
|
276
|
+
confirmed: ({ schema, field }) => {
|
|
277
|
+
schema.custom(field, (value, data) => value === data[`${field}_confirmation`], `${field} confirmation does not match`);
|
|
278
|
+
},
|
|
279
|
+
nullable: () => {
|
|
280
|
+
// Not needed here; missing/undefined is already allowed unless required.
|
|
281
|
+
},
|
|
282
|
+
unique: ({ schema, field }) => {
|
|
283
|
+
schema.custom(field, () => false, `${field} unique validation is not supported in the core rule-string API yet`);
|
|
284
|
+
},
|
|
285
|
+
};
|
|
286
|
+
const rulesToSchema = (rules) => {
|
|
287
|
+
const schema = Schema.create();
|
|
288
|
+
for (const [field, input] of Object.entries(rules)) {
|
|
289
|
+
const tokens = splitRuleTokens(input);
|
|
290
|
+
const tokenNames = tokens
|
|
291
|
+
.map((t) => t.split(':', 1)[0]?.trim())
|
|
292
|
+
.filter((t) => typeof t === 'string' && t !== '');
|
|
293
|
+
const tokenSet = new Set(tokenNames);
|
|
294
|
+
for (const token of tokens) {
|
|
295
|
+
const [nameRaw, argRaw] = token.split(':', 2);
|
|
296
|
+
const name = nameRaw.trim();
|
|
297
|
+
const arg = typeof argRaw === 'string' ? argRaw.trim() : undefined;
|
|
298
|
+
const handler = ruleStringTokenHandlers[name];
|
|
299
|
+
if (handler !== undefined) {
|
|
300
|
+
handler({ schema, field, tokenSet, name, arg });
|
|
301
|
+
continue;
|
|
302
|
+
}
|
|
303
|
+
schema.custom(field, () => false, `${field} has unknown rule: ${name}`);
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
return schema;
|
|
307
|
+
};
|
|
308
|
+
const validateRules = (data, rules) => {
|
|
309
|
+
return validate(data, rulesToSchema(rules));
|
|
310
|
+
};
|
|
311
|
+
const isValidRules = (data, rules) => {
|
|
312
|
+
return isValid(data, rulesToSchema(rules));
|
|
313
|
+
};
|
|
103
314
|
function validateRequired(field, value, message) {
|
|
104
315
|
return value === null || value === undefined || value === ''
|
|
105
316
|
? { field, message, rule: 'required' }
|
|
@@ -129,6 +340,81 @@ function validateEmail(field, value, message) {
|
|
|
129
340
|
? { field, message, rule: 'email' }
|
|
130
341
|
: null;
|
|
131
342
|
}
|
|
343
|
+
function validateAlphanumeric(field, value, message) {
|
|
344
|
+
return typeof value === 'string' && /^[A-Za-z0-9]+$/.test(value)
|
|
345
|
+
? null
|
|
346
|
+
: { field, message, rule: 'alphanumeric' };
|
|
347
|
+
}
|
|
348
|
+
function validateUuid(field, value, message) {
|
|
349
|
+
const uuidRegex = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;
|
|
350
|
+
return typeof value === 'string' && uuidRegex.test(value)
|
|
351
|
+
? null
|
|
352
|
+
: { field, message, rule: 'uuid' };
|
|
353
|
+
}
|
|
354
|
+
function validateToken(field, value, message) {
|
|
355
|
+
return typeof value === 'string' && /^[A-Za-z0-9\-=_]+$/.test(value)
|
|
356
|
+
? null
|
|
357
|
+
: { field, message, rule: 'token' };
|
|
358
|
+
}
|
|
359
|
+
function validateIpAddress(field, value, message) {
|
|
360
|
+
if (typeof value !== 'string')
|
|
361
|
+
return { field, message, rule: 'ipAddress' };
|
|
362
|
+
// IPv4: simplified pattern - match four dot-separated numbers (0-255)
|
|
363
|
+
const parts = value.split('.');
|
|
364
|
+
if (parts.length === 4) {
|
|
365
|
+
const isValidIpv4 = parts.every((part) => {
|
|
366
|
+
const num = Number.parseInt(part, 10);
|
|
367
|
+
return /^\d+$/.test(part) && num >= 0 && num <= 255;
|
|
368
|
+
});
|
|
369
|
+
if (isValidIpv4)
|
|
370
|
+
return null;
|
|
371
|
+
}
|
|
372
|
+
// IPv6 (simplified)
|
|
373
|
+
const ipv6Regex = /^([\da-f]{1,4}:){7}[\da-f]{1,4}$/i;
|
|
374
|
+
return ipv6Regex.test(value) ? null : { field, message, rule: 'ipAddress' };
|
|
375
|
+
}
|
|
376
|
+
function validatePositiveNumber(field, value, message) {
|
|
377
|
+
return typeof value === 'number' && value > 0 ? null : { field, message, rule: 'positiveNumber' };
|
|
378
|
+
}
|
|
379
|
+
function validateDigits(field, value, message) {
|
|
380
|
+
return typeof value === 'string' && /^\d+$/.test(value)
|
|
381
|
+
? null
|
|
382
|
+
: { field, message, rule: 'digits' };
|
|
383
|
+
}
|
|
384
|
+
function validateDecimal(field, value, message) {
|
|
385
|
+
return typeof value === 'string' && /^\d+(\.\d+)?$/.test(value)
|
|
386
|
+
? null
|
|
387
|
+
: { field, message, rule: 'decimal' };
|
|
388
|
+
}
|
|
389
|
+
function validateUrl(field, value, message) {
|
|
390
|
+
if (typeof value !== 'string')
|
|
391
|
+
return { field, message, rule: 'url' };
|
|
392
|
+
try {
|
|
393
|
+
const url = new URL(value);
|
|
394
|
+
return url.protocol === 'http:' || url.protocol === 'https:'
|
|
395
|
+
? null
|
|
396
|
+
: { field, message, rule: 'url' };
|
|
397
|
+
}
|
|
398
|
+
catch {
|
|
399
|
+
return { field, message, rule: 'url' };
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
function validatePhone(field, value, message) {
|
|
403
|
+
// International phone format with optional + and spaces/dashes
|
|
404
|
+
const phoneRegex = /^\+?[1-9]\d{1,14}$/;
|
|
405
|
+
const cleanedValue = typeof value === 'string' ? value.replaceAll(/[\s\-()]/g, '') : String(value);
|
|
406
|
+
return phoneRegex.test(cleanedValue) ? null : { field, message, rule: 'phone' };
|
|
407
|
+
}
|
|
408
|
+
function validateDate(field, value, message) {
|
|
409
|
+
if (value instanceof Date) {
|
|
410
|
+
return Number.isNaN(value.getTime()) ? { field, message, rule: 'date' } : null;
|
|
411
|
+
}
|
|
412
|
+
if (typeof value === 'string') {
|
|
413
|
+
const date = new Date(value);
|
|
414
|
+
return Number.isNaN(date.getTime()) ? { field, message, rule: 'date' } : null;
|
|
415
|
+
}
|
|
416
|
+
return { field, message, rule: 'date' };
|
|
417
|
+
}
|
|
132
418
|
function validateMin(field, value, minValue, message) {
|
|
133
419
|
return typeof value === 'number' && value < minValue ? { field, message, rule: 'min' } : null;
|
|
134
420
|
}
|
|
@@ -153,8 +439,11 @@ function validateRegex(field, value, pattern, message) {
|
|
|
153
439
|
function validateIn(field, value, values, message) {
|
|
154
440
|
return values.includes(value) ? null : { field, message, rule: 'in' };
|
|
155
441
|
}
|
|
156
|
-
function validateCustom(field, value, validator, message) {
|
|
157
|
-
|
|
442
|
+
function validateCustom(field, value, validator, message, data) {
|
|
443
|
+
const ok = typeof validator === 'function' && validator.length >= 2 && data !== undefined
|
|
444
|
+
? validator(value, data)
|
|
445
|
+
: validator(value);
|
|
446
|
+
return ok ? null : { field, message, rule: 'custom' };
|
|
158
447
|
}
|
|
159
448
|
function getDefaultMessage(field, rule) {
|
|
160
449
|
const messages = {
|
|
@@ -172,6 +461,16 @@ function getDefaultMessage(field, rule) {
|
|
|
172
461
|
regex: `${field} format is invalid`,
|
|
173
462
|
in: `${field} value is not allowed`,
|
|
174
463
|
custom: `${field} validation failed`,
|
|
464
|
+
alphanumeric: `${field} must contain only letters and numbers`,
|
|
465
|
+
uuid: `${field} must be a valid UUID`,
|
|
466
|
+
token: `${field} must be a valid token`,
|
|
467
|
+
ipAddress: `${field} must be a valid IP address`,
|
|
468
|
+
positiveNumber: `${field} must be a positive number`,
|
|
469
|
+
digits: `${field} must contain only digits`,
|
|
470
|
+
decimal: `${field} must be a valid decimal number`,
|
|
471
|
+
url: `${field} must be a valid URL`,
|
|
472
|
+
phone: `${field} must be a valid phone number`,
|
|
473
|
+
date: `${field} must be a valid date`,
|
|
175
474
|
};
|
|
176
475
|
return messages[rule];
|
|
177
476
|
}
|
|
@@ -183,6 +482,9 @@ export const Validator = Object.freeze({
|
|
|
183
482
|
Schema,
|
|
184
483
|
validate,
|
|
185
484
|
isValid,
|
|
485
|
+
rulesToSchema,
|
|
486
|
+
validateRules,
|
|
487
|
+
isValidRules,
|
|
186
488
|
});
|
|
187
489
|
/**
|
|
188
490
|
* Export ValidationError for use in tests and applications
|
package/src/common/uuid.d.ts
DELETED
package/src/common/uuid.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"uuid.d.ts","sourceRoot":"","sources":["../../../src/common/uuid.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,YAAY,QAAO,MAG/B,CAAC;AAEF,wBAAgB,mBAAmB,CACjC,MAAM,GAAE,MAAgE,GACvE,MAAM,CAoBR"}
|
package/src/common/uuid.js
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { ErrorFactory } from '../exceptions/ZintrustError.js';
|
|
2
|
-
import { randomBytes } from '../node-singletons/crypto.js';
|
|
3
|
-
export const generateUuid = () => {
|
|
4
|
-
if (typeof globalThis?.crypto?.randomUUID === 'function')
|
|
5
|
-
return globalThis.crypto.randomUUID();
|
|
6
|
-
return `${Date.now()}-${Math.random().toString(36).slice(2, 9)}`; // NOSONAR
|
|
7
|
-
};
|
|
8
|
-
export function generateSecureJobId(errMsg = 'Secure crypto API not available to generate a job id.') {
|
|
9
|
-
if (typeof globalThis.crypto?.randomUUID === 'function') {
|
|
10
|
-
return globalThis.crypto.randomUUID();
|
|
11
|
-
}
|
|
12
|
-
if (typeof globalThis.crypto?.getRandomValues === 'function') {
|
|
13
|
-
const bytes = new Uint8Array(16);
|
|
14
|
-
globalThis.crypto.getRandomValues(bytes);
|
|
15
|
-
return bytesToHex(bytes);
|
|
16
|
-
}
|
|
17
|
-
// Node fallback for environments without Web Crypto
|
|
18
|
-
try {
|
|
19
|
-
return randomBytes(16).toString('hex');
|
|
20
|
-
}
|
|
21
|
-
catch (error) {
|
|
22
|
-
throw ErrorFactory.createTryCatchError(errMsg || 'Secure crypto API not available to generate a job id.', error);
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
function bytesToHex(bytes) {
|
|
26
|
-
let out = '';
|
|
27
|
-
for (const b of bytes)
|
|
28
|
-
out += b.toString(16).padStart(2, '0');
|
|
29
|
-
return out;
|
|
30
|
-
}
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
NODE_ENV=development
|
|
2
|
-
APP_NAME={{projectName}}
|
|
3
|
-
PORT={{port}}
|
|
4
|
-
APP_DEBUG=true
|
|
5
|
-
APP_KEY=
|
|
6
|
-
|
|
7
|
-
DB_CONNECTION=sqlite
|
|
8
|
-
DB_DATABASE=./database.sqlite
|
|
9
|
-
|
|
10
|
-
LOG_LEVEL=debug
|
|
11
|
-
LOG_CHANNEL=file
|
|
12
|
-
LOG_FORMAT=text
|
|
13
|
-
|
|
14
|
-
# Cloud logging backends (optional)
|
|
15
|
-
# KV logger (Cloudflare Workers KV)
|
|
16
|
-
KV_LOG_ENABLED=false
|
|
17
|
-
KV_NAMESPACE=CACHE
|
|
18
|
-
KV_LOG_RETENTION_DAYS=30
|
|
19
|
-
|
|
20
|
-
# Slack logger (Slack incoming webhook)
|
|
21
|
-
SLACK_LOG_ENABLED=false
|
|
22
|
-
SLACK_LOG_WEBHOOK_URL=
|
|
23
|
-
SLACK_LOG_LEVELS=warn,error,fatal
|
|
24
|
-
SLACK_LOG_BATCH_WINDOW_MS=5000
|
|
25
|
-
|
|
26
|
-
# HTTP endpoint logger
|
|
27
|
-
HTTP_LOG_ENABLED=false
|
|
28
|
-
HTTP_LOG_ENDPOINT_URL=
|
|
29
|
-
HTTP_LOG_BATCH_SIZE=50
|
|
30
|
-
HTTP_LOG_AUTH_TOKEN=
|
|
31
|
-
|
|
32
|
-
JWT_SECRET=
|
|
33
|
-
JWT_EXPIRES_IN=1h
|
|
34
|
-
|
|
35
|
-
CACHE_DRIVER=memory
|
|
36
|
-
CACHE_TTL=300
|
|
37
|
-
QUEUE_DRIVER=sync
|
|
38
|
-
|
|
39
|
-
MAIL_DRIVER=smtp
|
|
40
|
-
MAIL_HOST=
|
|
41
|
-
MAIL_PORT=587
|
|
42
|
-
MAIL_USERNAME=
|
|
43
|
-
MAIL_PASSWORD=
|
|
44
|
-
MAIL_FROM_ADDRESS=
|
|
45
|
-
MAIL_FROM_NAME=
|
|
46
|
-
|
|
47
|
-
# Storage
|
|
48
|
-
STORAGE_DRIVER=local
|
|
49
|
-
STORAGE_PATH=storage
|
|
50
|
-
STORAGE_URL=/storage
|
|
51
|
-
STORAGE_VISIBILITY=private
|
|
52
|
-
|
|
53
|
-
# AWS S3
|
|
54
|
-
AWS_ACCESS_KEY_ID=
|
|
55
|
-
AWS_SECRET_ACCESS_KEY=
|
|
56
|
-
AWS_REGION=us-east-1
|
|
57
|
-
AWS_S3_BUCKET=
|
|
58
|
-
AWS_S3_URL=
|
|
59
|
-
AWS_S3_ENDPOINT=
|
|
60
|
-
AWS_S3_USE_PATH_STYLE_URL=false
|
|
61
|
-
|
|
62
|
-
# Cloudflare R2
|
|
63
|
-
R2_ACCESS_KEY_ID=
|
|
64
|
-
R2_SECRET_ACCESS_KEY=
|
|
65
|
-
R2_REGION=
|
|
66
|
-
R2_BUCKET=
|
|
67
|
-
R2_ENDPOINT=
|
|
68
|
-
R2_URL=
|
|
69
|
-
|
|
70
|
-
# Google Cloud Storage (requires optional dependency @google-cloud/storage)
|
|
71
|
-
GCS_PROJECT_ID=
|
|
72
|
-
GCS_KEY_FILE=
|
|
73
|
-
GCS_BUCKET=
|
|
74
|
-
GCS_URL=
|