canxjs 1.3.5 → 1.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/canx.ts +4 -0
- package/dist/Application.d.ts +23 -0
- package/dist/Application.d.ts.map +1 -1
- package/dist/Application.js +35 -0
- package/dist/bin/canx.d.ts +3 -0
- package/dist/bin/canx.d.ts.map +1 -0
- package/dist/bin/canx.js +3 -0
- package/dist/core/Middleware.d.ts +10 -0
- package/dist/core/Middleware.d.ts.map +1 -1
- package/dist/core/Middleware.js +71 -0
- package/dist/core/Router.d.ts +5 -0
- package/dist/core/Router.d.ts.map +1 -1
- package/dist/core/Router.js +61 -7
- package/dist/core/Server.d.ts.map +1 -1
- package/dist/core/Server.js +2 -1
- package/dist/index.d.ts +6 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +35497 -107
- package/dist/middlewares/CsrfMiddleware.d.ts +33 -0
- package/dist/middlewares/CsrfMiddleware.d.ts.map +1 -0
- package/dist/middlewares/CsrfMiddleware.js +82 -0
- package/dist/mvc/Controller.d.ts +20 -0
- package/dist/mvc/Controller.d.ts.map +1 -1
- package/dist/mvc/Controller.js +68 -0
- package/dist/mvc/Model.d.ts +14 -0
- package/dist/mvc/Model.d.ts.map +1 -1
- package/dist/mvc/Model.js +29 -0
- package/dist/src/Application.d.ts +75 -0
- package/dist/src/Application.d.ts.map +1 -0
- package/dist/src/Application.js +183 -0
- package/dist/src/auth/Auth.d.ts +81 -0
- package/dist/src/auth/Auth.d.ts.map +1 -0
- package/dist/src/auth/Auth.js +241 -0
- package/dist/src/auth/Gate.d.ts +155 -0
- package/dist/src/auth/Gate.d.ts.map +1 -0
- package/dist/src/auth/Gate.js +315 -0
- package/dist/src/auth/Guard.d.ts +142 -0
- package/dist/src/auth/Guard.d.ts.map +1 -0
- package/dist/src/auth/Guard.js +305 -0
- package/dist/src/auth/drivers/DatabaseSessionDriver.d.ts +13 -0
- package/dist/src/auth/drivers/DatabaseSessionDriver.d.ts.map +1 -0
- package/dist/src/auth/drivers/DatabaseSessionDriver.js +67 -0
- package/dist/src/cli/Command.d.ts +6 -0
- package/dist/src/cli/Command.d.ts.map +1 -0
- package/dist/src/cli/Command.js +1 -0
- package/dist/src/cli/commands/MakeCommand.d.ts +27 -0
- package/dist/src/cli/commands/MakeCommand.d.ts.map +1 -0
- package/dist/src/cli/commands/MakeCommand.js +469 -0
- package/dist/src/cli/commands/MigrateCommand.d.ts +7 -0
- package/dist/src/cli/commands/MigrateCommand.d.ts.map +1 -0
- package/dist/src/cli/commands/MigrateCommand.js +89 -0
- package/dist/src/cli/commands/OptimizeCommand.d.ts +7 -0
- package/dist/src/cli/commands/OptimizeCommand.d.ts.map +1 -0
- package/dist/src/cli/commands/OptimizeCommand.js +14 -0
- package/dist/src/cli/commands/QueueWorkCommand.d.ts +7 -0
- package/dist/src/cli/commands/QueueWorkCommand.d.ts.map +1 -0
- package/dist/src/cli/commands/QueueWorkCommand.js +52 -0
- package/dist/src/cli/commands/RouteListCommand.d.ts +8 -0
- package/dist/src/cli/commands/RouteListCommand.d.ts.map +1 -0
- package/dist/src/cli/commands/RouteListCommand.js +75 -0
- package/dist/src/cli/commands/ScheduleRunCommand.d.ts +7 -0
- package/dist/src/cli/commands/ScheduleRunCommand.d.ts.map +1 -0
- package/dist/src/cli/commands/ScheduleRunCommand.js +23 -0
- package/dist/src/cli/commands/TestCommand.d.ts +7 -0
- package/dist/src/cli/commands/TestCommand.d.ts.map +1 -0
- package/dist/src/cli/commands/TestCommand.js +19 -0
- package/dist/src/cli/index.d.ts +10 -0
- package/dist/src/cli/index.d.ts.map +1 -0
- package/dist/src/cli/index.js +86 -0
- package/dist/src/container/Container.d.ts +117 -0
- package/dist/src/container/Container.d.ts.map +1 -0
- package/dist/src/container/Container.js +290 -0
- package/dist/src/core/ErrorHandler.d.ts +28 -0
- package/dist/src/core/ErrorHandler.d.ts.map +1 -0
- package/dist/src/core/ErrorHandler.js +478 -0
- package/dist/src/core/Middleware.d.ts +34 -0
- package/dist/src/core/Middleware.d.ts.map +1 -0
- package/dist/src/core/Middleware.js +156 -0
- package/dist/src/core/Router.d.ts +44 -0
- package/dist/src/core/Router.d.ts.map +1 -0
- package/dist/src/core/Router.js +231 -0
- package/dist/src/core/Server.d.ts +35 -0
- package/dist/src/core/Server.d.ts.map +1 -0
- package/dist/src/core/Server.js +475 -0
- package/dist/src/core/exceptions/BadRequestException.d.ts +5 -0
- package/dist/src/core/exceptions/BadRequestException.d.ts.map +1 -0
- package/dist/src/core/exceptions/BadRequestException.js +7 -0
- package/dist/src/core/exceptions/CanxException.d.ts +7 -0
- package/dist/src/core/exceptions/CanxException.d.ts.map +1 -0
- package/dist/src/core/exceptions/CanxException.js +13 -0
- package/dist/src/core/exceptions/ConflictException.d.ts +5 -0
- package/dist/src/core/exceptions/ConflictException.d.ts.map +1 -0
- package/dist/src/core/exceptions/ConflictException.js +7 -0
- package/dist/src/core/exceptions/ForbiddenException.d.ts +5 -0
- package/dist/src/core/exceptions/ForbiddenException.d.ts.map +1 -0
- package/dist/src/core/exceptions/ForbiddenException.js +7 -0
- package/dist/src/core/exceptions/HttpException.d.ts +5 -0
- package/dist/src/core/exceptions/HttpException.d.ts.map +1 -0
- package/dist/src/core/exceptions/HttpException.js +6 -0
- package/dist/src/core/exceptions/InternalServerException.d.ts +5 -0
- package/dist/src/core/exceptions/InternalServerException.d.ts.map +1 -0
- package/dist/src/core/exceptions/InternalServerException.js +7 -0
- package/dist/src/core/exceptions/MethodNotAllowedException.d.ts +6 -0
- package/dist/src/core/exceptions/MethodNotAllowedException.d.ts.map +1 -0
- package/dist/src/core/exceptions/MethodNotAllowedException.js +9 -0
- package/dist/src/core/exceptions/NotFoundException.d.ts +5 -0
- package/dist/src/core/exceptions/NotFoundException.d.ts.map +1 -0
- package/dist/src/core/exceptions/NotFoundException.js +6 -0
- package/dist/src/core/exceptions/ServiceUnavailableException.d.ts +6 -0
- package/dist/src/core/exceptions/ServiceUnavailableException.d.ts.map +1 -0
- package/dist/src/core/exceptions/ServiceUnavailableException.js +9 -0
- package/dist/src/core/exceptions/TooManyRequestsException.d.ts +6 -0
- package/dist/src/core/exceptions/TooManyRequestsException.d.ts.map +1 -0
- package/dist/src/core/exceptions/TooManyRequestsException.js +9 -0
- package/dist/src/core/exceptions/UnauthorizedException.d.ts +5 -0
- package/dist/src/core/exceptions/UnauthorizedException.d.ts.map +1 -0
- package/dist/src/core/exceptions/UnauthorizedException.js +7 -0
- package/dist/src/core/exceptions/ValidationException.d.ts +5 -0
- package/dist/src/core/exceptions/ValidationException.d.ts.map +1 -0
- package/dist/src/core/exceptions/ValidationException.js +6 -0
- package/dist/src/core/exceptions/ViewNotFoundException.d.ts +7 -0
- package/dist/src/core/exceptions/ViewNotFoundException.d.ts.map +1 -0
- package/dist/src/core/exceptions/ViewNotFoundException.js +11 -0
- package/dist/src/database/Migration.d.ts +78 -0
- package/dist/src/database/Migration.d.ts.map +1 -0
- package/dist/src/database/Migration.js +331 -0
- package/dist/src/database/Seeder.d.ts +47 -0
- package/dist/src/database/Seeder.d.ts.map +1 -0
- package/dist/src/database/Seeder.js +69 -0
- package/dist/src/database/migrations/20240114000000_create_sessions_table.d.ts +3 -0
- package/dist/src/database/migrations/20240114000000_create_sessions_table.d.ts.map +1 -0
- package/dist/src/database/migrations/20240114000000_create_sessions_table.js +14 -0
- package/dist/src/docs/ApiDoc.d.ts +102 -0
- package/dist/src/docs/ApiDoc.d.ts.map +1 -0
- package/dist/src/docs/ApiDoc.js +145 -0
- package/dist/src/events/EventEmitter.d.ts +88 -0
- package/dist/src/events/EventEmitter.d.ts.map +1 -0
- package/dist/src/events/EventEmitter.js +266 -0
- package/dist/src/features/AutoCache.d.ts +41 -0
- package/dist/src/features/AutoCache.d.ts.map +1 -0
- package/dist/src/features/AutoCache.js +200 -0
- package/dist/src/features/HotWire.d.ts +51 -0
- package/dist/src/features/HotWire.d.ts.map +1 -0
- package/dist/src/features/HotWire.js +179 -0
- package/dist/src/features/JITCompiler.d.ts +67 -0
- package/dist/src/features/JITCompiler.d.ts.map +1 -0
- package/dist/src/features/JITCompiler.js +126 -0
- package/dist/src/features/RequestBatcher.d.ts +47 -0
- package/dist/src/features/RequestBatcher.d.ts.map +1 -0
- package/dist/src/features/RequestBatcher.js +119 -0
- package/dist/src/features/Scheduler.d.ts +67 -0
- package/dist/src/features/Scheduler.d.ts.map +1 -0
- package/dist/src/features/Scheduler.js +205 -0
- package/dist/src/generator/ClientGenerator.d.ts +7 -0
- package/dist/src/generator/ClientGenerator.d.ts.map +1 -0
- package/dist/src/generator/ClientGenerator.js +109 -0
- package/dist/src/index.d.ts +91 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +148 -0
- package/dist/src/jsx-runtime.d.ts +5 -0
- package/dist/src/jsx-runtime.d.ts.map +1 -0
- package/dist/src/jsx-runtime.js +4 -0
- package/dist/src/middlewares/CsrfMiddleware.d.ts +33 -0
- package/dist/src/middlewares/CsrfMiddleware.d.ts.map +1 -0
- package/dist/src/middlewares/CsrfMiddleware.js +82 -0
- package/dist/src/middlewares/RateLimitMiddleware.d.ts +10 -0
- package/dist/src/middlewares/RateLimitMiddleware.d.ts.map +1 -0
- package/dist/src/middlewares/RateLimitMiddleware.js +38 -0
- package/dist/src/middlewares/SecurityMiddleware.d.ts +14 -0
- package/dist/src/middlewares/SecurityMiddleware.d.ts.map +1 -0
- package/dist/src/middlewares/SecurityMiddleware.js +38 -0
- package/dist/src/middlewares/ValidationMiddleware.d.ts +4 -0
- package/dist/src/middlewares/ValidationMiddleware.d.ts.map +1 -0
- package/dist/src/middlewares/ValidationMiddleware.js +33 -0
- package/dist/src/mvc/Controller.d.ts +48 -0
- package/dist/src/mvc/Controller.d.ts.map +1 -0
- package/dist/src/mvc/Controller.js +153 -0
- package/dist/src/mvc/Model.d.ts +135 -0
- package/dist/src/mvc/Model.d.ts.map +1 -0
- package/dist/src/mvc/Model.js +514 -0
- package/dist/src/mvc/View.d.ts +63 -0
- package/dist/src/mvc/View.d.ts.map +1 -0
- package/dist/src/mvc/View.js +189 -0
- package/dist/src/mvc/jsx-runtime.d.ts +3 -0
- package/dist/src/mvc/jsx-runtime.d.ts.map +1 -0
- package/dist/src/mvc/jsx-runtime.js +4 -0
- package/dist/src/notifications/Mail.d.ts +101 -0
- package/dist/src/notifications/Mail.d.ts.map +1 -0
- package/dist/src/notifications/Mail.js +320 -0
- package/dist/src/notifications/Notification.d.ts +147 -0
- package/dist/src/notifications/Notification.d.ts.map +1 -0
- package/dist/src/notifications/Notification.js +212 -0
- package/dist/src/queue/Queue.d.ts +56 -0
- package/dist/src/queue/Queue.d.ts.map +1 -0
- package/dist/src/queue/Queue.js +159 -0
- package/dist/src/queue/drivers/MemoryDriver.d.ts +24 -0
- package/dist/src/queue/drivers/MemoryDriver.d.ts.map +1 -0
- package/dist/src/queue/drivers/MemoryDriver.js +120 -0
- package/dist/src/queue/drivers/RedisDriver.d.ts +27 -0
- package/dist/src/queue/drivers/RedisDriver.d.ts.map +1 -0
- package/dist/src/queue/drivers/RedisDriver.js +144 -0
- package/dist/src/queue/drivers/types.d.ts +51 -0
- package/dist/src/queue/drivers/types.d.ts.map +1 -0
- package/dist/src/queue/drivers/types.js +1 -0
- package/dist/src/queue/ui/Dashboard.d.ts +2 -0
- package/dist/src/queue/ui/Dashboard.d.ts.map +1 -0
- package/dist/src/queue/ui/Dashboard.js +51 -0
- package/dist/src/queue/ui/QueueController.d.ts +10 -0
- package/dist/src/queue/ui/QueueController.d.ts.map +1 -0
- package/dist/src/queue/ui/QueueController.js +81 -0
- package/dist/src/realtime/Channel.d.ts +69 -0
- package/dist/src/realtime/Channel.d.ts.map +1 -0
- package/dist/src/realtime/Channel.js +169 -0
- package/dist/src/realtime/WebSocket.d.ts +138 -0
- package/dist/src/realtime/WebSocket.d.ts.map +1 -0
- package/dist/src/realtime/WebSocket.js +326 -0
- package/dist/src/schema/Schema.d.ts +64 -0
- package/dist/src/schema/Schema.d.ts.map +1 -0
- package/dist/src/schema/Schema.js +248 -0
- package/dist/src/storage/Storage.d.ts +116 -0
- package/dist/src/storage/Storage.d.ts.map +1 -0
- package/dist/src/storage/Storage.js +246 -0
- package/dist/src/storage/drivers/LocalDriver.d.ts +27 -0
- package/dist/src/storage/drivers/LocalDriver.d.ts.map +1 -0
- package/dist/src/storage/drivers/LocalDriver.js +191 -0
- package/dist/src/storage/drivers/S3Driver.d.ts +33 -0
- package/dist/src/storage/drivers/S3Driver.d.ts.map +1 -0
- package/dist/src/storage/drivers/S3Driver.js +291 -0
- package/dist/src/storage/drivers/types.d.ts +94 -0
- package/dist/src/storage/drivers/types.d.ts.map +1 -0
- package/dist/src/storage/drivers/types.js +4 -0
- package/dist/src/testing/TestCase.d.ts +190 -0
- package/dist/src/testing/TestCase.d.ts.map +1 -0
- package/dist/src/testing/TestCase.js +350 -0
- package/dist/src/testing/TestClient.d.ts +32 -0
- package/dist/src/testing/TestClient.d.ts.map +1 -0
- package/dist/src/testing/TestClient.js +85 -0
- package/dist/src/types/index.d.ts +498 -0
- package/dist/src/types/index.d.ts.map +1 -0
- package/dist/src/types/index.js +5 -0
- package/dist/src/utils/Collection.d.ts +256 -0
- package/dist/src/utils/Collection.d.ts.map +1 -0
- package/dist/src/utils/Collection.js +503 -0
- package/dist/src/utils/Encrypt.d.ts +74 -0
- package/dist/src/utils/Encrypt.d.ts.map +1 -0
- package/dist/src/utils/Encrypt.js +204 -0
- package/dist/src/utils/Env.d.ts +28 -0
- package/dist/src/utils/Env.d.ts.map +1 -0
- package/dist/src/utils/Env.js +57 -0
- package/dist/src/utils/ErrorHandler.d.ts +92 -0
- package/dist/src/utils/ErrorHandler.d.ts.map +1 -0
- package/dist/src/utils/ErrorHandler.js +220 -0
- package/dist/src/utils/FormRequest.d.ts +115 -0
- package/dist/src/utils/FormRequest.d.ts.map +1 -0
- package/dist/src/utils/FormRequest.js +273 -0
- package/dist/src/utils/Hash.d.ts +84 -0
- package/dist/src/utils/Hash.d.ts.map +1 -0
- package/dist/src/utils/Hash.js +227 -0
- package/dist/src/utils/Health.d.ts +111 -0
- package/dist/src/utils/Health.d.ts.map +1 -0
- package/dist/src/utils/Health.js +371 -0
- package/dist/src/utils/Logger.d.ts +71 -0
- package/dist/src/utils/Logger.d.ts.map +1 -0
- package/dist/src/utils/Logger.js +237 -0
- package/dist/src/utils/Paginator.d.ts +184 -0
- package/dist/src/utils/Paginator.d.ts.map +1 -0
- package/dist/src/utils/Paginator.js +321 -0
- package/dist/src/utils/Request.d.ts +33 -0
- package/dist/src/utils/Request.d.ts.map +1 -0
- package/dist/src/utils/Request.js +122 -0
- package/dist/src/utils/Resource.d.ts +154 -0
- package/dist/src/utils/Resource.d.ts.map +1 -0
- package/dist/src/utils/Resource.js +279 -0
- package/dist/src/utils/Response.d.ts +25 -0
- package/dist/src/utils/Response.d.ts.map +1 -0
- package/dist/src/utils/Response.js +103 -0
- package/dist/src/utils/Validator.d.ts +72 -0
- package/dist/src/utils/Validator.d.ts.map +1 -0
- package/dist/src/utils/Validator.js +272 -0
- package/dist/src/utils/i18n.d.ts +95 -0
- package/dist/src/utils/i18n.d.ts.map +1 -0
- package/dist/src/utils/i18n.js +264 -0
- package/dist/utils/Env.d.ts +28 -0
- package/dist/utils/Env.d.ts.map +1 -0
- package/dist/utils/Env.js +57 -0
- package/package.json +4 -4
- package/src/Application.ts +75 -26
- package/src/auth/Gate.ts +409 -0
- package/src/auth/Guard.ts +417 -0
- package/src/cli/Command.ts +5 -0
- package/src/cli/commands/MakeCommand.ts +496 -0
- package/src/cli/commands/MigrateCommand.ts +93 -0
- package/src/cli/commands/OptimizeCommand.ts +21 -0
- package/src/cli/commands/QueueWorkCommand.ts +58 -0
- package/src/cli/commands/RouteListCommand.ts +92 -0
- package/src/cli/commands/ScheduleRunCommand.ts +27 -0
- package/src/cli/commands/TestCommand.ts +25 -0
- package/src/cli/index.ts +98 -0
- package/src/core/ErrorHandler.ts +414 -139
- package/src/core/Middleware.ts +79 -0
- package/src/core/Router.ts +84 -7
- package/src/core/Server.ts +2 -1
- package/src/core/exceptions/BadRequestException.ts +8 -0
- package/src/core/exceptions/ConflictException.ts +8 -0
- package/src/core/exceptions/ForbiddenException.ts +8 -0
- package/src/core/exceptions/InternalServerException.ts +8 -0
- package/src/core/exceptions/MethodNotAllowedException.ts +11 -0
- package/src/core/exceptions/ServiceUnavailableException.ts +11 -0
- package/src/core/exceptions/TooManyRequestsException.ts +11 -0
- package/src/core/exceptions/UnauthorizedException.ts +8 -0
- package/src/core/exceptions/ViewNotFoundException.ts +13 -0
- package/src/features/Scheduler.ts +4 -0
- package/src/index.ts +144 -6
- package/src/middlewares/CsrfMiddleware.ts +113 -0
- package/src/middlewares/SecurityMiddleware.ts +16 -15
- package/src/mvc/Controller.ts +79 -0
- package/src/mvc/Model.ts +143 -82
- package/src/mvc/View.ts +96 -1
- package/src/testing/TestClient.ts +8 -0
- package/src/types/index.ts +15 -1
- package/src/utils/Collection.ts +583 -0
- package/src/utils/Encrypt.ts +281 -0
- package/src/utils/Env.ts +67 -0
- package/src/utils/FormRequest.ts +356 -0
- package/src/utils/Hash.ts +300 -0
- package/src/utils/Logger.ts +39 -0
- package/src/utils/Paginator.ts +451 -0
- package/src/utils/Resource.ts +370 -0
- package/src/utils/Validator.ts +83 -3
package/bin/canx.ts
ADDED
package/dist/Application.d.ts
CHANGED
|
@@ -46,7 +46,30 @@ export declare class Canx implements CanxApplication {
|
|
|
46
46
|
put(path: string, ...handlers: any[]): this;
|
|
47
47
|
patch(path: string, ...handlers: any[]): this;
|
|
48
48
|
delete(path: string, ...handlers: any[]): this;
|
|
49
|
+
all(path: string, ...handlers: any[]): this;
|
|
50
|
+
/**
|
|
51
|
+
* Register a resource controller with RESTful routes
|
|
52
|
+
*/
|
|
53
|
+
resource(path: string, controller: any, ...middlewares: MiddlewareHandler[]): this;
|
|
54
|
+
/**
|
|
55
|
+
* Group routes with a common prefix
|
|
56
|
+
*/
|
|
57
|
+
group(prefix: string, callback: (router: RouterInstance) => void): this;
|
|
58
|
+
/**
|
|
59
|
+
* Register routes under a versioned API path
|
|
60
|
+
* @param version - Version identifier (e.g., 'v1', 'v2')
|
|
61
|
+
* @param callback - Route registration callback
|
|
62
|
+
*/
|
|
63
|
+
version(version: string, callback: (router: RouterInstance) => void): this;
|
|
49
64
|
}
|
|
65
|
+
/**
|
|
66
|
+
* Create a new CanxJS application instance
|
|
67
|
+
*/
|
|
50
68
|
export declare function createApp(config?: ServerConfig): Canx;
|
|
69
|
+
/**
|
|
70
|
+
* Define configuration with type checking
|
|
71
|
+
* Helper for creating typed configuration objects
|
|
72
|
+
*/
|
|
73
|
+
export declare function defineConfig<T extends Record<string, any>>(config: T): T;
|
|
51
74
|
export default Canx;
|
|
52
75
|
//# sourceMappingURL=Application.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Application.d.ts","sourceRoot":"","sources":["../src/Application.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,iBAAiB,EAAc,eAAe,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAEpH,OAAO,EAAE,MAAM,EAAgB,MAAM,eAAe,CAAC;AAIrD,qBAAa,IAAK,YAAW,eAAe;IAC1C,MAAM,EAAE,YAAY,CAAC;IACrB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,MAAM,CAAuB;IACrC,OAAO,CAAC,QAAQ,CAAqB;IACrC,OAAO,CAAC,OAAO,CAAgB;gBAEnB,MAAM,GAAE,YAAiB;IAWrC;;OAEG;IACH,GAAG,CAAC,UAAU,EAAE,iBAAiB,GAAG,IAAI;IAKxC;;OAEG;IACH,MAAM,CAAC,QAAQ,EAAE,CAAC,MAAM,EAAE,cAAc,KAAK,IAAI,GAAG,IAAI;IAKxD;;OAEG;IACH,UAAU,CAAC,eAAe,EAAE,UAAU,GAAG,GAAG,IAAI;IAoBhD;;OAEG;IACH,MAAM,CAAC,MAAM,EA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IACH,KAAK,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,MAAM,EAAE,cAAc,KAAK,IAAI,GAAG,IAAI;IAKvE;;;;OAIG;IACH,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,MAAM,EAAE,cAAc,KAAK,IAAI,GAAG,IAAI;CAK3E;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,MAAM,CAAC,EAAE,YAAY,GAAG,IAAI,CAErD;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,EAAE,CAAC,GAAG,CAAC,CAExE;AAED,eAAe,IAAI,CAAC"}
|
package/dist/Application.js
CHANGED
|
@@ -132,8 +132,43 @@ export class Canx {
|
|
|
132
132
|
put(path, ...handlers) { this.router.put(path, ...handlers); return this; }
|
|
133
133
|
patch(path, ...handlers) { this.router.patch(path, ...handlers); return this; }
|
|
134
134
|
delete(path, ...handlers) { this.router.delete(path, ...handlers); return this; }
|
|
135
|
+
all(path, ...handlers) { this.router.all(path, ...handlers); return this; }
|
|
136
|
+
/**
|
|
137
|
+
* Register a resource controller with RESTful routes
|
|
138
|
+
*/
|
|
139
|
+
resource(path, controller, ...middlewares) {
|
|
140
|
+
this.router.resource(path, controller, ...middlewares);
|
|
141
|
+
return this;
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* Group routes with a common prefix
|
|
145
|
+
*/
|
|
146
|
+
group(prefix, callback) {
|
|
147
|
+
this.router.group(prefix, callback);
|
|
148
|
+
return this;
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* Register routes under a versioned API path
|
|
152
|
+
* @param version - Version identifier (e.g., 'v1', 'v2')
|
|
153
|
+
* @param callback - Route registration callback
|
|
154
|
+
*/
|
|
155
|
+
version(version, callback) {
|
|
156
|
+
const prefix = version.startsWith('/') ? version : '/api/' + version;
|
|
157
|
+
this.router.group(prefix, callback);
|
|
158
|
+
return this;
|
|
159
|
+
}
|
|
135
160
|
}
|
|
161
|
+
/**
|
|
162
|
+
* Create a new CanxJS application instance
|
|
163
|
+
*/
|
|
136
164
|
export function createApp(config) {
|
|
137
165
|
return new Canx(config);
|
|
138
166
|
}
|
|
167
|
+
/**
|
|
168
|
+
* Define configuration with type checking
|
|
169
|
+
* Helper for creating typed configuration objects
|
|
170
|
+
*/
|
|
171
|
+
export function defineConfig(config) {
|
|
172
|
+
return config;
|
|
173
|
+
}
|
|
139
174
|
export default Canx;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"canx.d.ts","sourceRoot":"","sources":["../../bin/canx.ts"],"names":[],"mappings":""}
|
package/dist/bin/canx.js
ADDED
|
@@ -19,6 +19,16 @@ export declare const rateLimit: (options?: {
|
|
|
19
19
|
max?: number;
|
|
20
20
|
}) => MiddlewareHandler;
|
|
21
21
|
export declare const compress: () => MiddlewareHandler;
|
|
22
|
+
/**
|
|
23
|
+
* Serve static files from a directory
|
|
24
|
+
* @param root - The root directory to serve files from (relative to cwd or absolute)
|
|
25
|
+
* @param options - Configuration options
|
|
26
|
+
*/
|
|
27
|
+
export declare const serveStatic: (root?: string, options?: {
|
|
28
|
+
index?: string;
|
|
29
|
+
maxAge?: number;
|
|
30
|
+
extensions?: string[];
|
|
31
|
+
}) => MiddlewareHandler;
|
|
22
32
|
export declare function createMiddlewarePipeline(): MiddlewarePipeline;
|
|
23
33
|
export default MiddlewarePipeline;
|
|
24
34
|
//# sourceMappingURL=Middleware.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Middleware.d.ts","sourceRoot":"","sources":["../../src/core/Middleware.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,iBAAiB,EAAgB,MAAM,UAAU,CAAC;AAG3F,qBAAa,kBAAkB;IAC7B,OAAO,CAAC,WAAW,CAA2B;IAE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AAQ,CAAC,GAAG,QAAQ,GAC/C,OAAO,CAAC,QAAQ,CAAC;CAuBrB;AAGD,eAAO,MAAM,IAAI,GAAI,UAAS;IAAE,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IAAC,WAAW,CAAC,EAAE,OAAO,CAAA;CAAO,KAAG,iBAQ9G,CAAC;AAEF,eAAO,MAAM,MAAM,QAAO,iBAQzB,CAAC;AAEF,eAAO,MAAM,UAAU,QAAO,iBAO7B,CAAC;AAEF,eAAO,MAAM,SAAS,GAAI,UAAS;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAA;CAAO,KAAG,iBAkB7E,CAAC;AAEF,eAAO,MAAM,QAAQ,QAAO,iBAQ3B,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,WAAW,GAAI,OAAM,MAAiB,EAAE,UAAS;IAC5D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;CAClB,KAAG,iBA0ER,CAAC;AAEF,wBAAgB,wBAAwB,IAAI,kBAAkB,CAE7D;AAED,eAAe,kBAAkB,CAAC"}
|
package/dist/core/Middleware.js
CHANGED
|
@@ -86,6 +86,77 @@ export const compress = () => {
|
|
|
86
86
|
return next();
|
|
87
87
|
};
|
|
88
88
|
};
|
|
89
|
+
/**
|
|
90
|
+
* Serve static files from a directory
|
|
91
|
+
* @param root - The root directory to serve files from (relative to cwd or absolute)
|
|
92
|
+
* @param options - Configuration options
|
|
93
|
+
*/
|
|
94
|
+
export const serveStatic = (root = 'public', options = {}) => {
|
|
95
|
+
const { index = 'index.html', maxAge = 86400 } = options;
|
|
96
|
+
// Use path utilities inline to avoid import issues
|
|
97
|
+
const isAbsolute = (p) => p.startsWith('/') || /^[A-Za-z]:[\\/]/.test(p);
|
|
98
|
+
const join = (...parts) => parts.join('/').replace(/\/+/g, '/');
|
|
99
|
+
const extname = (p) => {
|
|
100
|
+
const lastDot = p.lastIndexOf('.');
|
|
101
|
+
const lastSlash = Math.max(p.lastIndexOf('/'), p.lastIndexOf('\\'));
|
|
102
|
+
return lastDot > lastSlash ? p.slice(lastDot) : '';
|
|
103
|
+
};
|
|
104
|
+
const rootPath = isAbsolute(root) ? root : join(process.cwd(), root);
|
|
105
|
+
const mimeTypes = {
|
|
106
|
+
'.html': 'text/html',
|
|
107
|
+
'.css': 'text/css',
|
|
108
|
+
'.js': 'application/javascript',
|
|
109
|
+
'.json': 'application/json',
|
|
110
|
+
'.png': 'image/png',
|
|
111
|
+
'.jpg': 'image/jpeg',
|
|
112
|
+
'.jpeg': 'image/jpeg',
|
|
113
|
+
'.gif': 'image/gif',
|
|
114
|
+
'.svg': 'image/svg+xml',
|
|
115
|
+
'.ico': 'image/x-icon',
|
|
116
|
+
'.woff': 'font/woff',
|
|
117
|
+
'.woff2': 'font/woff2',
|
|
118
|
+
'.ttf': 'font/ttf',
|
|
119
|
+
'.eot': 'application/vnd.ms-fontobject',
|
|
120
|
+
'.pdf': 'application/pdf',
|
|
121
|
+
'.webp': 'image/webp',
|
|
122
|
+
'.mp4': 'video/mp4',
|
|
123
|
+
'.webm': 'video/webm',
|
|
124
|
+
'.txt': 'text/plain',
|
|
125
|
+
'.xml': 'application/xml',
|
|
126
|
+
};
|
|
127
|
+
return async (req, res, next) => {
|
|
128
|
+
if (req.method !== 'GET' && req.method !== 'HEAD') {
|
|
129
|
+
return next();
|
|
130
|
+
}
|
|
131
|
+
// Clean the path to prevent directory traversal
|
|
132
|
+
const cleanPath = req.path.replace(/\.\./g, '').replace(/\/+/g, '/');
|
|
133
|
+
let filePath = join(rootPath, cleanPath);
|
|
134
|
+
try {
|
|
135
|
+
let file = Bun.file(filePath);
|
|
136
|
+
// Check if it's a directory by trying index file
|
|
137
|
+
if (!(await file.exists())) {
|
|
138
|
+
file = Bun.file(join(filePath, index));
|
|
139
|
+
if (!(await file.exists())) {
|
|
140
|
+
return next();
|
|
141
|
+
}
|
|
142
|
+
filePath = join(filePath, index);
|
|
143
|
+
}
|
|
144
|
+
const ext = extname(filePath).toLowerCase();
|
|
145
|
+
const contentType = mimeTypes[ext] || 'application/octet-stream';
|
|
146
|
+
return new Response(file, {
|
|
147
|
+
headers: {
|
|
148
|
+
'Content-Type': contentType,
|
|
149
|
+
'Cache-Control': `public, max-age=${maxAge}`,
|
|
150
|
+
'Content-Length': String(file.size),
|
|
151
|
+
},
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
catch (e) {
|
|
155
|
+
// File not found, continue to next middleware
|
|
156
|
+
}
|
|
157
|
+
return next();
|
|
158
|
+
};
|
|
159
|
+
};
|
|
89
160
|
export function createMiddlewarePipeline() {
|
|
90
161
|
return new MiddlewarePipeline();
|
|
91
162
|
}
|
package/dist/core/Router.d.ts
CHANGED
|
@@ -31,6 +31,11 @@ export declare class Router implements RouterInstance {
|
|
|
31
31
|
group(prefix: string, cb: (r: RouterInstance) => void): RouterInstance;
|
|
32
32
|
middleware(...h: MiddlewareHandler[]): RouterInstance;
|
|
33
33
|
use(...h: MiddlewareHandler[]): Router;
|
|
34
|
+
/**
|
|
35
|
+
* Register a resource controller with standard RESTful routes
|
|
36
|
+
* Creates: GET /, GET /:id, POST /, PUT /:id, DELETE /:id
|
|
37
|
+
*/
|
|
38
|
+
resource(path: string, controller: any, ...middlewares: MiddlewareHandler[]): RouterInstance;
|
|
34
39
|
getRoutes(): Route[];
|
|
35
40
|
private collect;
|
|
36
41
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Router.d.ts","sourceRoot":"","sources":["../../src/core/Router.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EACV,UAAU,EACV,KAAK,EACL,YAAY,EACZ,aAAa,EACb,iBAAiB,EACjB,WAAW,EACX,cAAc,EACf,MAAM,UAAU,C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AAM,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,cAAc,KAAK,IAAI,GAAG,cAAc;IAQtE,UAAU,CAAC,GAAG,CAAC,EAAE,iBAAiB,EAAE,GAAG,cAAc;IACrD,GAAG,CAAC,GAAG,CAAC,EAAE,iBAAiB,EAAE,GAAG,MAAM;IAEtC;;;OAGG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,GAAG,EAAE,GAAG,WAAW,EAAE,iBAAiB,EAAE,GAAG,cAAc;IA0C5F,SAAS,IAAI,KAAK,EAAE;IAMpB,OAAO,CAAC,OAAO;CAKhB;AAED,wBAAgB,YAAY,CAAC,OAAO,CAAC,EAAE,aAAa,GAAG,MAAM,CAAgC;AAC7F,eAAe,MAAM,CAAC"}
|
package/dist/core/Router.js
CHANGED
|
@@ -55,20 +55,25 @@ export class Router {
|
|
|
55
55
|
return p.startsWith('/') ? p : '/' + p;
|
|
56
56
|
}
|
|
57
57
|
addRoute(method, path, handler, mws = []) {
|
|
58
|
+
// Normalize path but preserve original for param name extraction
|
|
59
|
+
const originalPath = (this.prefix + path).startsWith('/') ? this.prefix + path : '/' + this.prefix + path;
|
|
58
60
|
const normalized = this.normalizePath(this.prefix + path);
|
|
59
|
-
const tree = this.trees.get(method);
|
|
60
61
|
const segments = normalized.split('/').filter(Boolean);
|
|
61
|
-
|
|
62
|
-
|
|
62
|
+
const originalSegments = originalPath.split('/').filter(Boolean);
|
|
63
|
+
let node = this.trees.get(method);
|
|
64
|
+
for (let i = 0; i < segments.length; i++) {
|
|
65
|
+
const seg = segments[i];
|
|
66
|
+
const originalSeg = originalSegments[i] || seg;
|
|
63
67
|
let key = seg, isParam = false, isWild = false, param = null;
|
|
64
|
-
|
|
68
|
+
// Extract param name from ORIGINAL segment to preserve casing
|
|
69
|
+
if (originalSeg.startsWith(':')) {
|
|
65
70
|
isParam = true;
|
|
66
|
-
param =
|
|
71
|
+
param = originalSeg.slice(1); // Use original casing
|
|
67
72
|
key = ':';
|
|
68
73
|
}
|
|
69
|
-
else if (
|
|
74
|
+
else if (originalSeg === '*' || originalSeg.startsWith('*')) {
|
|
70
75
|
isWild = true;
|
|
71
|
-
param =
|
|
76
|
+
param = originalSeg.length > 1 ? originalSeg.slice(1) : 'wildcard';
|
|
72
77
|
key = '*';
|
|
73
78
|
}
|
|
74
79
|
if (!node.children.has(key)) {
|
|
@@ -99,12 +104,15 @@ export class Router {
|
|
|
99
104
|
let node = tree;
|
|
100
105
|
for (let i = 0; i < segments.length; i++) {
|
|
101
106
|
const seg = segments[i];
|
|
107
|
+
// Try exact match first
|
|
102
108
|
let child = node.children.get(this.routerOptions.caseSensitive ? seg : seg.toLowerCase());
|
|
109
|
+
// If no exact match, try parameter match
|
|
103
110
|
if (!child) {
|
|
104
111
|
child = node.children.get(':');
|
|
105
112
|
if (child?.paramName)
|
|
106
113
|
params[child.paramName] = seg;
|
|
107
114
|
}
|
|
115
|
+
// If still no match, try wildcard
|
|
108
116
|
if (!child) {
|
|
109
117
|
child = node.children.get('*');
|
|
110
118
|
if (child?.paramName) {
|
|
@@ -115,6 +123,10 @@ export class Router {
|
|
|
115
123
|
}
|
|
116
124
|
if (!child)
|
|
117
125
|
return null;
|
|
126
|
+
// If this is a param node, capture the parameter value
|
|
127
|
+
if (child.isParam && child.paramName && !params[child.paramName]) {
|
|
128
|
+
params[child.paramName] = seg;
|
|
129
|
+
}
|
|
118
130
|
node = child;
|
|
119
131
|
}
|
|
120
132
|
return node.handler ? { handler: node.handler, middlewares: node.middlewares, params } : null;
|
|
@@ -161,6 +173,48 @@ export class Router {
|
|
|
161
173
|
}
|
|
162
174
|
middleware(...h) { this.currentMiddlewares.push(...h); return this; }
|
|
163
175
|
use(...h) { this.globalMiddlewares.push(...h); return this; }
|
|
176
|
+
/**
|
|
177
|
+
* Register a resource controller with standard RESTful routes
|
|
178
|
+
* Creates: GET /, GET /:id, POST /, PUT /:id, DELETE /:id
|
|
179
|
+
*/
|
|
180
|
+
resource(path, controller, ...middlewares) {
|
|
181
|
+
const instance = typeof controller === 'function' ? new controller() : controller;
|
|
182
|
+
const basePath = path.startsWith('/') ? path : '/' + path;
|
|
183
|
+
// Helper to create handler
|
|
184
|
+
const createHandler = (method) => async (req, res) => {
|
|
185
|
+
if (typeof instance.setContext === 'function') {
|
|
186
|
+
instance.setContext(req, res);
|
|
187
|
+
}
|
|
188
|
+
if (typeof instance[method] === 'function') {
|
|
189
|
+
return instance[method](req, res);
|
|
190
|
+
}
|
|
191
|
+
return res.status(404).json({ error: `Method ${method} not found` });
|
|
192
|
+
};
|
|
193
|
+
// Standard RESTful routes
|
|
194
|
+
if (typeof instance.index === 'function') {
|
|
195
|
+
this.addRoute('GET', basePath, createHandler('index'), middlewares);
|
|
196
|
+
}
|
|
197
|
+
if (typeof instance.show === 'function') {
|
|
198
|
+
this.addRoute('GET', basePath + '/:id', createHandler('show'), middlewares);
|
|
199
|
+
}
|
|
200
|
+
if (typeof instance.store === 'function') {
|
|
201
|
+
this.addRoute('POST', basePath, createHandler('store'), middlewares);
|
|
202
|
+
}
|
|
203
|
+
if (typeof instance.update === 'function') {
|
|
204
|
+
this.addRoute('PUT', basePath + '/:id', createHandler('update'), middlewares);
|
|
205
|
+
}
|
|
206
|
+
if (typeof instance.destroy === 'function') {
|
|
207
|
+
this.addRoute('DELETE', basePath + '/:id', createHandler('destroy'), middlewares);
|
|
208
|
+
}
|
|
209
|
+
// Optional: create, edit for form-based apps
|
|
210
|
+
if (typeof instance.create === 'function') {
|
|
211
|
+
this.addRoute('GET', basePath + '/create', createHandler('create'), middlewares);
|
|
212
|
+
}
|
|
213
|
+
if (typeof instance.edit === 'function') {
|
|
214
|
+
this.addRoute('GET', basePath + '/:id/edit', createHandler('edit'), middlewares);
|
|
215
|
+
}
|
|
216
|
+
return this;
|
|
217
|
+
}
|
|
164
218
|
getRoutes() {
|
|
165
219
|
const routes = [];
|
|
166
220
|
this.trees.forEach((tree, method) => this.collect(tree, '', method, routes));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Server.d.ts","sourceRoot":"","sources":["../../src/core/Server.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EACV,YAAY,EACZ,WAAW,EACX,YAAY,EAEZ,WAAW,EAIZ,MAAM,UAAU,CAAC;AA+ClB;;GAEG;AACH,wBAAgB,iBAAiB,CAC/B,GAAG,EAAE,OAAO,EACZ,MAAM,GAAE,WAAgB,GACvB,WAAW,CAgFb;AAED;;GAEG;AACH,wBAAgB,kBAAkB,IAAI,YAAY,CAqMjD;AAkDD;;GAEG;AACH,qBAAa,MAAM;IACjB,OAAO,CAAC,MAAM,CAA6C;IAC3D,OAAO,CAAC,MAAM,CAAe;IAC7B,OAAO,CAAC,cAAc,CAAiD;gBAGrE,MAAM,EAAE,YAAY,EACpB,OAAO,EAAE,CAAC,GAAG,EAAE,OAAO,KAAK,OAAO,CAAC,QAAQ,CAAC,GAAG,QAAQ;IAczD;;OAEG;IACG,MAAM,CAAC,QAAQ,CAAC,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"Server.d.ts","sourceRoot":"","sources":["../../src/core/Server.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EACV,YAAY,EACZ,WAAW,EACX,YAAY,EAEZ,WAAW,EAIZ,MAAM,UAAU,CAAC;AA+ClB;;GAEG;AACH,wBAAgB,iBAAiB,CAC/B,GAAG,EAAE,OAAO,EACZ,MAAM,GAAE,WAAgB,GACvB,WAAW,CAgFb;AAED;;GAEG;AACH,wBAAgB,kBAAkB,IAAI,YAAY,CAqMjD;AAkDD;;GAEG;AACH,qBAAa,MAAM;IACjB,OAAO,CAAC,MAAM,CAA6C;IAC3D,OAAO,CAAC,MAAM,CAAe;IAC7B,OAAO,CAAC,cAAc,CAAiD;gBAGrE,MAAM,EAAE,YAAY,EACpB,OAAO,EAAE,CAAC,GAAG,EAAE,OAAO,KAAK,OAAO,CAAC,QAAQ,CAAC,GAAG,QAAQ;IAczD;;OAEG;IACG,MAAM,CAAC,QAAQ,CAAC,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;IAgHlD;;OAEG;IACG,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAQ5B;;OAEG;IACH,IAAI,QAAQ,+BAEX;CACF;AAED,eAAe,MAAM,CAAC"}
|
package/dist/core/Server.js
CHANGED
|
@@ -420,12 +420,13 @@ export class Server {
|
|
|
420
420
|
if (callback) {
|
|
421
421
|
callback();
|
|
422
422
|
}
|
|
423
|
+
const displayHost = this.config.hostname === '0.0.0.0' ? 'localhost' : this.config.hostname;
|
|
423
424
|
console.log(`
|
|
424
425
|
╔══════════════════════════════════════════════════════════╗
|
|
425
426
|
║ ║
|
|
426
427
|
║ 🚀 CanxJS Server running ║
|
|
427
428
|
║ ║
|
|
428
|
-
║ → Local: http://${
|
|
429
|
+
║ → Local: http://${displayHost}:${this.config.port} ║
|
|
429
430
|
║ → Mode: ${this.config.development ? 'Development' : 'Production'} ║
|
|
430
431
|
║ ║
|
|
431
432
|
╚══════════════════════════════════════════════════════════╝
|
package/dist/index.d.ts
CHANGED
|
@@ -5,16 +5,17 @@
|
|
|
5
5
|
*/
|
|
6
6
|
export { Server, createCanxRequest, createCanxResponse } from './core/Server';
|
|
7
7
|
export { Router, createRouter } from './core/Router';
|
|
8
|
-
export { MiddlewarePipeline, cors, logger, bodyParser, rateLimit, compress, createMiddlewarePipeline } from './core/Middleware';
|
|
8
|
+
export { MiddlewarePipeline, cors, logger, bodyParser, rateLimit, compress, serveStatic, createMiddlewarePipeline } from './core/Middleware';
|
|
9
9
|
export { security } from './middlewares/SecurityMiddleware';
|
|
10
10
|
export { rateLimit as rateLimitMiddleware } from './middlewares/RateLimitMiddleware';
|
|
11
11
|
export { validateSchema } from './middlewares/ValidationMiddleware';
|
|
12
|
+
export { csrf, csrfField, csrfMeta } from './middlewares/CsrfMiddleware';
|
|
12
13
|
export { z, Schema as ZSchema } from './schema/Schema';
|
|
13
14
|
export type { Infer } from './schema/Schema';
|
|
14
15
|
export { ClientGenerator } from './generator/ClientGenerator';
|
|
15
16
|
export { TestClient } from './testing/TestClient';
|
|
16
|
-
export { BaseController, Controller, Get, Post, Put, Patch, Delete, Middleware, getControllerMeta } from './mvc/Controller';
|
|
17
|
-
export { Model, initDatabase, closeDatabase, query, execute } from './mvc/Model';
|
|
17
|
+
export { BaseController, Controller, Get, Post, Put, Patch, Delete, Middleware, Validate, getControllerMeta } from './mvc/Controller';
|
|
18
|
+
export { Model, QueryBuilderImpl, initDatabase, closeDatabase, query, execute } from './mvc/Model';
|
|
18
19
|
export { jsx, jsxs, Fragment, html, render, renderPage, createLayout, View } from './mvc/View';
|
|
19
20
|
export { hotWire, createHotWire } from './features/HotWire';
|
|
20
21
|
export { autoCache, autoCacheMiddleware, createAutoCache } from './features/AutoCache';
|
|
@@ -44,6 +45,7 @@ export type { ServiceProvider } from './container/Container';
|
|
|
44
45
|
export { validate, validateAsync, is } from './utils/Validator';
|
|
45
46
|
export { ResponseBuilder, response } from './utils/Response';
|
|
46
47
|
export { RequestParser, parseRequest } from './utils/Request';
|
|
48
|
+
export { env, isProduction, isDevelopment, isTest, requireEnv } from './utils/Env';
|
|
47
49
|
export { ErrorHandler } from './core/ErrorHandler';
|
|
48
50
|
export { CanxException } from './core/exceptions/CanxException';
|
|
49
51
|
export { HttpException } from './core/exceptions/HttpException';
|
|
@@ -58,7 +60,7 @@ export { initI18n, useI18n, t, plural, I18n, i18nMiddleware } from './utils/i18n
|
|
|
58
60
|
export type { I18nConfig, TranslationObject } from './utils/i18n';
|
|
59
61
|
export { ResponseAssertions, MockFactory, createTestClient, assertResponse, factory, randomString, randomEmail, randomNumber, randomUuid, sleep, } from './testing/TestCase';
|
|
60
62
|
export type { TestResponse, TestRequest } from './testing/TestCase';
|
|
61
|
-
export { Canx, createApp } from './Application';
|
|
63
|
+
export { Canx, createApp, defineConfig } from './Application';
|
|
62
64
|
export type * from './types';
|
|
63
65
|
export type { CanxRequest as Request, CanxResponse as Response } from './types';
|
|
64
66
|
export { Canx as default } from './Application';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,OAAO,EAAE,MAAM,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAC9E,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAIrD,OAAO,EAAE,kBAAkB,EAAE,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,OAAO,EAAE,MAAM,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAC9E,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAIrD,OAAO,EAAE,kBAAkB,EAAE,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,WAAW,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AAC7I,OAAO,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAC;AAC5D,OAAO,EAAE,SAAS,IAAI,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AACrF,OAAO,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AACpE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AAKzE,OAAO,EAAE,CAAC,EAAE,MAAM,IAAI,OAAO,EAAE,MAAM,iBAAiB,CAAC;AACvD,YAAY,EAAE,KAAK,EAAE,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