@adaas/a-server 0.0.22 → 0.0.23
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/.conf/tsconfig.base.json +79 -0
- package/.conf/tsconfig.browser.json +32 -0
- package/.conf/tsconfig.node.json +33 -0
- package/LICENSE +10 -19
- package/dist/browser/index.d.mts +1669 -0
- package/dist/browser/index.mjs +2869 -0
- package/dist/browser/index.mjs.map +1 -0
- package/dist/node/A-Request.entity-8_9MCXT2.d.ts +533 -0
- package/dist/node/A-Request.entity-r905O60G.d.mts +533 -0
- package/dist/node/A-Response.entity-BVYAc6-8.d.mts +318 -0
- package/dist/node/A-Response.entity-CRc-t-vr.d.ts +318 -0
- package/dist/node/channels/A-Http/A-Http.channel.constants.d.mts +9 -0
- package/dist/node/channels/A-Http/A-Http.channel.constants.d.ts +9 -0
- package/dist/node/channels/A-Http/A-Http.channel.constants.js +13 -0
- package/dist/node/channels/A-Http/A-Http.channel.constants.js.map +1 -0
- package/dist/node/channels/A-Http/A-Http.channel.constants.mjs +12 -0
- package/dist/node/channels/A-Http/A-Http.channel.constants.mjs.map +1 -0
- package/dist/node/channels/A-Http/A-Http.channel.d.mts +23 -0
- package/dist/node/channels/A-Http/A-Http.channel.d.ts +23 -0
- package/dist/node/channels/A-Http/A-Http.channel.error.d.mts +7 -0
- package/dist/node/channels/A-Http/A-Http.channel.error.d.ts +7 -0
- package/dist/node/channels/A-Http/A-Http.channel.error.js +11 -0
- package/dist/node/channels/A-Http/A-Http.channel.error.js.map +1 -0
- package/dist/node/channels/A-Http/A-Http.channel.error.mjs +10 -0
- package/dist/node/channels/A-Http/A-Http.channel.error.mjs.map +1 -0
- package/dist/node/channels/A-Http/A-Http.channel.js +122 -0
- package/dist/node/channels/A-Http/A-Http.channel.js.map +1 -0
- package/dist/node/channels/A-Http/A-Http.channel.mjs +110 -0
- package/dist/node/channels/A-Http/A-Http.channel.mjs.map +1 -0
- package/dist/node/channels/A-Http/A-Http.channel.types.d.mts +67 -0
- package/dist/node/channels/A-Http/A-Http.channel.types.d.ts +67 -0
- package/dist/node/channels/A-Http/A-Http.channel.types.js +4 -0
- package/dist/node/channels/A-Http/A-Http.channel.types.js.map +1 -0
- package/dist/node/channels/A-Http/A-Http.channel.types.mjs +3 -0
- package/dist/node/channels/A-Http/A-Http.channel.types.mjs.map +1 -0
- package/dist/node/channels/A-Websockets/A-Websockets.channel.d.mts +7 -0
- package/dist/node/channels/A-Websockets/A-Websockets.channel.d.ts +7 -0
- package/dist/node/channels/A-Websockets/A-Websockets.channel.js +13 -0
- package/dist/node/channels/A-Websockets/A-Websockets.channel.js.map +1 -0
- package/dist/node/channels/A-Websockets/A-Websockets.channel.mjs +12 -0
- package/dist/node/channels/A-Websockets/A-Websockets.channel.mjs.map +1 -0
- package/dist/node/chunk-EQQGB2QZ.mjs +15 -0
- package/dist/node/chunk-EQQGB2QZ.mjs.map +1 -0
- package/dist/node/constants/env.constants.d.mts +12 -0
- package/dist/node/constants/env.constants.d.ts +12 -0
- package/dist/node/constants/env.constants.js +23 -0
- package/dist/node/constants/env.constants.js.map +1 -0
- package/dist/node/constants/env.constants.mjs +22 -0
- package/dist/node/constants/env.constants.mjs.map +1 -0
- package/dist/node/controllers/A-CommandController/A-CommandController.component.d.mts +29 -0
- package/dist/node/controllers/A-CommandController/A-CommandController.component.d.ts +29 -0
- package/dist/node/controllers/A-CommandController/A-CommandController.component.js +55 -0
- package/dist/node/controllers/A-CommandController/A-CommandController.component.js.map +1 -0
- package/dist/node/controllers/A-CommandController/A-CommandController.component.mjs +43 -0
- package/dist/node/controllers/A-CommandController/A-CommandController.component.mjs.map +1 -0
- package/dist/node/controllers/A-EntityController/A-EntityController.component.d.mts +44 -0
- package/dist/node/controllers/A-EntityController/A-EntityController.component.d.ts +44 -0
- package/dist/node/controllers/A-EntityController/A-EntityController.component.js +189 -0
- package/dist/node/controllers/A-EntityController/A-EntityController.component.js.map +1 -0
- package/dist/node/controllers/A-EntityController/A-EntityController.component.mjs +177 -0
- package/dist/node/controllers/A-EntityController/A-EntityController.component.mjs.map +1 -0
- package/dist/node/controllers/A-EntityController/A-EntityController.component.types.d.mts +2 -0
- package/dist/node/controllers/A-EntityController/A-EntityController.component.types.d.ts +2 -0
- package/dist/node/controllers/A-EntityController/A-EntityController.component.types.js +4 -0
- package/dist/node/controllers/A-EntityController/A-EntityController.component.types.js.map +1 -0
- package/dist/node/controllers/A-EntityController/A-EntityController.component.types.mjs +3 -0
- package/dist/node/controllers/A-EntityController/A-EntityController.component.types.mjs.map +1 -0
- package/dist/node/controllers/A-ListingController/A-ListingController.component.d.mts +28 -0
- package/dist/node/controllers/A-ListingController/A-ListingController.component.d.ts +28 -0
- package/dist/node/controllers/A-ListingController/A-ListingController.component.js +59 -0
- package/dist/node/controllers/A-ListingController/A-ListingController.component.js.map +1 -0
- package/dist/node/controllers/A-ListingController/A-ListingController.component.mjs +47 -0
- package/dist/node/controllers/A-ListingController/A-ListingController.component.mjs.map +1 -0
- package/dist/node/controllers/A-ListingController/A-ListingController.types.d.mts +2 -0
- package/dist/node/controllers/A-ListingController/A-ListingController.types.d.ts +2 -0
- package/dist/node/controllers/A-ListingController/A-ListingController.types.js +4 -0
- package/dist/node/controllers/A-ListingController/A-ListingController.types.js.map +1 -0
- package/dist/node/controllers/A-ListingController/A-ListingController.types.mjs +3 -0
- package/dist/node/controllers/A-ListingController/A-ListingController.types.mjs.map +1 -0
- package/dist/node/controllers/A-ServerHealthMonitor/A-ServerHealthMonitor.component.d.mts +30 -0
- package/dist/node/controllers/A-ServerHealthMonitor/A-ServerHealthMonitor.component.d.ts +30 -0
- package/dist/node/controllers/A-ServerHealthMonitor/A-ServerHealthMonitor.component.js +46 -0
- package/dist/node/controllers/A-ServerHealthMonitor/A-ServerHealthMonitor.component.js.map +1 -0
- package/dist/node/controllers/A-ServerHealthMonitor/A-ServerHealthMonitor.component.mjs +34 -0
- package/dist/node/controllers/A-ServerHealthMonitor/A-ServerHealthMonitor.component.mjs.map +1 -0
- package/dist/node/controllers/A-ServerHealthMonitor/A-ServerHealthMonitor.types.d.mts +2 -0
- package/dist/node/controllers/A-ServerHealthMonitor/A-ServerHealthMonitor.types.d.ts +2 -0
- package/dist/node/controllers/A-ServerHealthMonitor/A-ServerHealthMonitor.types.js +4 -0
- package/dist/node/controllers/A-ServerHealthMonitor/A-ServerHealthMonitor.types.js.map +1 -0
- package/dist/node/controllers/A-ServerHealthMonitor/A-ServerHealthMonitor.types.mjs +3 -0
- package/dist/node/controllers/A-ServerHealthMonitor/A-ServerHealthMonitor.types.mjs.map +1 -0
- package/dist/node/index.d.mts +51 -0
- package/dist/node/index.d.ts +51 -0
- package/dist/node/index.js +320 -0
- package/dist/node/index.js.map +1 -0
- package/dist/node/index.mjs +48 -0
- package/dist/node/index.mjs.map +1 -0
- package/dist/node/lib/A-Request/A-HttpRequestData.context.d.mts +12 -0
- package/dist/node/lib/A-Request/A-HttpRequestData.context.d.ts +12 -0
- package/dist/node/lib/A-Request/A-HttpRequestData.context.js +25 -0
- package/dist/node/lib/A-Request/A-HttpRequestData.context.js.map +1 -0
- package/dist/node/lib/A-Request/A-HttpRequestData.context.mjs +24 -0
- package/dist/node/lib/A-Request/A-HttpRequestData.context.mjs.map +1 -0
- package/dist/node/lib/A-Request/A-HttpServerRequest.context.d.mts +39 -0
- package/dist/node/lib/A-Request/A-HttpServerRequest.context.d.ts +39 -0
- package/dist/node/lib/A-Request/A-HttpServerRequest.context.js +56 -0
- package/dist/node/lib/A-Request/A-HttpServerRequest.context.js.map +1 -0
- package/dist/node/lib/A-Request/A-HttpServerRequest.context.mjs +55 -0
- package/dist/node/lib/A-Request/A-HttpServerRequest.context.mjs.map +1 -0
- package/dist/node/lib/A-Request/A-Request.constants.d.mts +18 -0
- package/dist/node/lib/A-Request/A-Request.constants.d.ts +18 -0
- package/dist/node/lib/A-Request/A-Request.constants.js +22 -0
- package/dist/node/lib/A-Request/A-Request.constants.js.map +1 -0
- package/dist/node/lib/A-Request/A-Request.constants.mjs +22 -0
- package/dist/node/lib/A-Request/A-Request.constants.mjs.map +1 -0
- package/dist/node/lib/A-Request/A-Request.entity.d.mts +17 -0
- package/dist/node/lib/A-Request/A-Request.entity.d.ts +17 -0
- package/dist/node/lib/A-Request/A-Request.entity.js +651 -0
- package/dist/node/lib/A-Request/A-Request.entity.js.map +1 -0
- package/dist/node/lib/A-Request/A-Request.entity.mjs +639 -0
- package/dist/node/lib/A-Request/A-Request.entity.mjs.map +1 -0
- package/dist/node/lib/A-Request/A-Request.env.d.mts +37 -0
- package/dist/node/lib/A-Request/A-Request.env.d.ts +37 -0
- package/dist/node/lib/A-Request/A-Request.env.js +39 -0
- package/dist/node/lib/A-Request/A-Request.env.js.map +1 -0
- package/dist/node/lib/A-Request/A-Request.env.mjs +38 -0
- package/dist/node/lib/A-Request/A-Request.env.mjs.map +1 -0
- package/dist/node/lib/A-Request/A-Request.error.d.mts +11 -0
- package/dist/node/lib/A-Request/A-Request.error.d.ts +11 -0
- package/dist/node/lib/A-Request/A-Request.error.js +15 -0
- package/dist/node/lib/A-Request/A-Request.error.js.map +1 -0
- package/dist/node/lib/A-Request/A-Request.error.mjs +14 -0
- package/dist/node/lib/A-Request/A-Request.error.mjs.map +1 -0
- package/dist/node/lib/A-Request/A-Request.helper.d.mts +105 -0
- package/dist/node/lib/A-Request/A-Request.helper.d.ts +105 -0
- package/dist/node/lib/A-Request/A-Request.helper.js +181 -0
- package/dist/node/lib/A-Request/A-Request.helper.js.map +1 -0
- package/dist/node/lib/A-Request/A-Request.helper.mjs +180 -0
- package/dist/node/lib/A-Request/A-Request.helper.mjs.map +1 -0
- package/dist/node/lib/A-Request/A-Request.types.d.mts +17 -0
- package/dist/node/lib/A-Request/A-Request.types.d.ts +17 -0
- package/dist/node/lib/A-Request/A-Request.types.js +14 -0
- package/dist/node/lib/A-Request/A-Request.types.js.map +1 -0
- package/dist/node/lib/A-Request/A-Request.types.mjs +14 -0
- package/dist/node/lib/A-Request/A-Request.types.mjs.map +1 -0
- package/dist/node/lib/A-Response/A-Response.constants.d.mts +24 -0
- package/dist/node/lib/A-Response/A-Response.constants.d.ts +24 -0
- package/dist/node/lib/A-Response/A-Response.constants.js +28 -0
- package/dist/node/lib/A-Response/A-Response.constants.js.map +1 -0
- package/dist/node/lib/A-Response/A-Response.constants.mjs +28 -0
- package/dist/node/lib/A-Response/A-Response.constants.mjs.map +1 -0
- package/dist/node/lib/A-Response/A-Response.entity.d.mts +20 -0
- package/dist/node/lib/A-Response/A-Response.entity.d.ts +20 -0
- package/dist/node/lib/A-Response/A-Response.entity.js +544 -0
- package/dist/node/lib/A-Response/A-Response.entity.js.map +1 -0
- package/dist/node/lib/A-Response/A-Response.entity.mjs +532 -0
- package/dist/node/lib/A-Response/A-Response.entity.mjs.map +1 -0
- package/dist/node/lib/A-Response/A-Response.env.d.mts +2 -0
- package/dist/node/lib/A-Response/A-Response.env.d.ts +2 -0
- package/dist/node/lib/A-Response/A-Response.env.js +4 -0
- package/dist/node/lib/A-Response/A-Response.env.js.map +1 -0
- package/dist/node/lib/A-Response/A-Response.env.mjs +3 -0
- package/dist/node/lib/A-Response/A-Response.env.mjs.map +1 -0
- package/dist/node/lib/A-Response/A-Response.error.d.mts +6 -0
- package/dist/node/lib/A-Response/A-Response.error.d.ts +6 -0
- package/dist/node/lib/A-Response/A-Response.error.js +10 -0
- package/dist/node/lib/A-Response/A-Response.error.js.map +1 -0
- package/dist/node/lib/A-Response/A-Response.error.mjs +9 -0
- package/dist/node/lib/A-Response/A-Response.error.mjs.map +1 -0
- package/dist/node/lib/A-Response/A-Response.types.d.mts +20 -0
- package/dist/node/lib/A-Response/A-Response.types.d.ts +20 -0
- package/dist/node/lib/A-Response/A-Response.types.js +4 -0
- package/dist/node/lib/A-Response/A-Response.types.js.map +1 -0
- package/dist/node/lib/A-Response/A-Response.types.mjs +3 -0
- package/dist/node/lib/A-Response/A-Response.types.mjs.map +1 -0
- package/dist/node/lib/A-Server/A-HttpServer.constants.d.mts +7 -0
- package/dist/node/lib/A-Server/A-HttpServer.constants.d.ts +7 -0
- package/dist/node/lib/A-Server/A-HttpServer.constants.js +11 -0
- package/dist/node/lib/A-Server/A-HttpServer.constants.js.map +1 -0
- package/dist/node/lib/A-Server/A-HttpServer.constants.mjs +11 -0
- package/dist/node/lib/A-Server/A-HttpServer.constants.mjs.map +1 -0
- package/dist/node/lib/A-Server/A-HttpServer.container.d.mts +50 -0
- package/dist/node/lib/A-Server/A-HttpServer.container.d.ts +50 -0
- package/dist/node/lib/A-Server/A-HttpServer.container.js +194 -0
- package/dist/node/lib/A-Server/A-HttpServer.container.js.map +1 -0
- package/dist/node/lib/A-Server/A-HttpServer.container.mjs +182 -0
- package/dist/node/lib/A-Server/A-HttpServer.container.mjs.map +1 -0
- package/dist/node/lib/A-Server/A-HttpServer.error.d.mts +54 -0
- package/dist/node/lib/A-Server/A-HttpServer.error.d.ts +54 -0
- package/dist/node/lib/A-Server/A-HttpServer.error.js +118 -0
- package/dist/node/lib/A-Server/A-HttpServer.error.js.map +1 -0
- package/dist/node/lib/A-Server/A-HttpServer.error.mjs +117 -0
- package/dist/node/lib/A-Server/A-HttpServer.error.mjs.map +1 -0
- package/dist/node/lib/A-Server/A-HttpServer.types.d.mts +19 -0
- package/dist/node/lib/A-Server/A-HttpServer.types.d.ts +19 -0
- package/dist/node/lib/A-Server/A-HttpServer.types.js +4 -0
- package/dist/node/lib/A-Server/A-HttpServer.types.js.map +1 -0
- package/dist/node/lib/A-Server/A-HttpServer.types.mjs +3 -0
- package/dist/node/lib/A-Server/A-HttpServer.types.mjs.map +1 -0
- package/dist/node/lib/A-Server/A-Server.context.d.mts +22 -0
- package/dist/node/lib/A-Server/A-Server.context.d.ts +22 -0
- package/dist/node/lib/A-Server/A-Server.context.js +24 -0
- package/dist/node/lib/A-Server/A-Server.context.js.map +1 -0
- package/dist/node/lib/A-Server/A-Server.context.mjs +23 -0
- package/dist/node/lib/A-Server/A-Server.context.mjs.map +1 -0
- package/dist/node/lib/A-Server/A-Server.error.d.mts +14 -0
- package/dist/node/lib/A-Server/A-Server.error.d.ts +14 -0
- package/dist/node/lib/A-Server/A-Server.error.js +26 -0
- package/dist/node/lib/A-Server/A-Server.error.js.map +1 -0
- package/dist/node/lib/A-Server/A-Server.error.mjs +25 -0
- package/dist/node/lib/A-Server/A-Server.error.mjs.map +1 -0
- package/dist/node/lib/A-Server/A-Server.types.d.mts +26 -0
- package/dist/node/lib/A-Server/A-Server.types.d.ts +26 -0
- package/dist/node/lib/A-Server/A-Server.types.js +4 -0
- package/dist/node/lib/A-Server/A-Server.types.js.map +1 -0
- package/dist/node/lib/A-Server/A-Server.types.mjs +3 -0
- package/dist/node/lib/A-Server/A-Server.types.mjs.map +1 -0
- package/dist/node/lib/A-ServerController/A-ServerController.component.d.mts +29 -0
- package/dist/node/lib/A-ServerController/A-ServerController.component.d.ts +29 -0
- package/dist/node/lib/A-ServerController/A-ServerController.component.js +49 -0
- package/dist/node/lib/A-ServerController/A-ServerController.component.js.map +1 -0
- package/dist/node/lib/A-ServerController/A-ServerController.component.mjs +37 -0
- package/dist/node/lib/A-ServerController/A-ServerController.component.mjs.map +1 -0
- package/dist/node/lib/A-ServerController/A-ServerController.types.d.mts +2 -0
- package/dist/node/lib/A-ServerController/A-ServerController.types.d.ts +2 -0
- package/dist/node/lib/A-ServerController/A-ServerController.types.js +4 -0
- package/dist/node/lib/A-ServerController/A-ServerController.types.js.map +1 -0
- package/dist/node/lib/A-ServerController/A-ServerController.types.mjs +3 -0
- package/dist/node/lib/A-ServerController/A-ServerController.types.mjs.map +1 -0
- package/dist/node/lib/A-ServerEntityList/A-EntityList.entity.d.mts +49 -0
- package/dist/node/lib/A-ServerEntityList/A-EntityList.entity.d.ts +49 -0
- package/dist/node/lib/A-ServerEntityList/A-EntityList.entity.js +91 -0
- package/dist/node/lib/A-ServerEntityList/A-EntityList.entity.js.map +1 -0
- package/dist/node/lib/A-ServerEntityList/A-EntityList.entity.mjs +90 -0
- package/dist/node/lib/A-ServerEntityList/A-EntityList.entity.mjs.map +1 -0
- package/dist/node/lib/A-ServerEntityList/A-EntityList.types.d.mts +22 -0
- package/dist/node/lib/A-ServerEntityList/A-EntityList.types.d.ts +22 -0
- package/dist/node/lib/A-ServerEntityList/A-EntityList.types.js +10 -0
- package/dist/node/lib/A-ServerEntityList/A-EntityList.types.js.map +1 -0
- package/dist/node/lib/A-ServerEntityList/A-EntityList.types.mjs +10 -0
- package/dist/node/lib/A-ServerEntityList/A-EntityList.types.mjs.map +1 -0
- package/dist/node/lib/A-ServerListQuery/A-ServerListQueryFilter.context.d.mts +13 -0
- package/dist/node/lib/A-ServerListQuery/A-ServerListQueryFilter.context.d.ts +13 -0
- package/dist/node/lib/A-ServerListQuery/A-ServerListQueryFilter.context.js +32 -0
- package/dist/node/lib/A-ServerListQuery/A-ServerListQueryFilter.context.js.map +1 -0
- package/dist/node/lib/A-ServerListQuery/A-ServerListQueryFilter.context.mjs +31 -0
- package/dist/node/lib/A-ServerListQuery/A-ServerListQueryFilter.context.mjs.map +1 -0
- package/dist/node/lib/A-ServerLogger/A-ServerLogger.component.d.mts +48 -0
- package/dist/node/lib/A-ServerLogger/A-ServerLogger.component.d.ts +48 -0
- package/dist/node/lib/A-ServerLogger/A-ServerLogger.component.js +88 -0
- package/dist/node/lib/A-ServerLogger/A-ServerLogger.component.js.map +1 -0
- package/dist/node/lib/A-ServerLogger/A-ServerLogger.component.mjs +76 -0
- package/dist/node/lib/A-ServerLogger/A-ServerLogger.component.mjs.map +1 -0
- package/dist/node/lib/A-ServerLogger/A-ServerLogger.constants.d.mts +24 -0
- package/dist/node/lib/A-ServerLogger/A-ServerLogger.constants.d.ts +24 -0
- package/dist/node/lib/A-ServerLogger/A-ServerLogger.constants.js +33 -0
- package/dist/node/lib/A-ServerLogger/A-ServerLogger.constants.js.map +1 -0
- package/dist/node/lib/A-ServerLogger/A-ServerLogger.constants.mjs +33 -0
- package/dist/node/lib/A-ServerLogger/A-ServerLogger.constants.mjs.map +1 -0
- package/dist/node/lib/A-ServerLogger/A-ServerLogger.types.d.mts +12 -0
- package/dist/node/lib/A-ServerLogger/A-ServerLogger.types.d.ts +12 -0
- package/dist/node/lib/A-ServerLogger/A-ServerLogger.types.js +4 -0
- package/dist/node/lib/A-ServerLogger/A-ServerLogger.types.js.map +1 -0
- package/dist/node/lib/A-ServerLogger/A-ServerLogger.types.mjs +3 -0
- package/dist/node/lib/A-ServerLogger/A-ServerLogger.types.mjs.map +1 -0
- package/dist/node/lib/A-ServerMiddleware/A-ServerMiddleware.component.d.mts +6 -0
- package/dist/node/lib/A-ServerMiddleware/A-ServerMiddleware.component.d.ts +6 -0
- package/dist/node/lib/A-ServerMiddleware/A-ServerMiddleware.component.js +18 -0
- package/dist/node/lib/A-ServerMiddleware/A-ServerMiddleware.component.js.map +1 -0
- package/dist/node/lib/A-ServerMiddleware/A-ServerMiddleware.component.mjs +17 -0
- package/dist/node/lib/A-ServerMiddleware/A-ServerMiddleware.component.mjs.map +1 -0
- package/dist/node/lib/A-ServerMiddleware/A-ServerMiddleware.constants.d.mts +2 -0
- package/dist/node/lib/A-ServerMiddleware/A-ServerMiddleware.constants.d.ts +2 -0
- package/dist/node/lib/A-ServerMiddleware/A-ServerMiddleware.constants.js +4 -0
- package/dist/node/lib/A-ServerMiddleware/A-ServerMiddleware.constants.js.map +1 -0
- package/dist/node/lib/A-ServerMiddleware/A-ServerMiddleware.constants.mjs +3 -0
- package/dist/node/lib/A-ServerMiddleware/A-ServerMiddleware.constants.mjs.map +1 -0
- package/dist/node/lib/A-ServerMiddleware/A-ServerMiddleware.types.d.mts +2 -0
- package/dist/node/lib/A-ServerMiddleware/A-ServerMiddleware.types.d.ts +2 -0
- package/dist/node/lib/A-ServerMiddleware/A-ServerMiddleware.types.js +4 -0
- package/dist/node/lib/A-ServerMiddleware/A-ServerMiddleware.types.js.map +1 -0
- package/dist/node/lib/A-ServerMiddleware/A-ServerMiddleware.types.mjs +3 -0
- package/dist/node/lib/A-ServerMiddleware/A-ServerMiddleware.types.mjs.map +1 -0
- package/dist/node/lib/A-ServerProxy/A-ServerProxy.component.d.mts +31 -0
- package/dist/node/lib/A-ServerProxy/A-ServerProxy.component.d.ts +31 -0
- package/dist/node/lib/A-ServerProxy/A-ServerProxy.component.js +90 -0
- package/dist/node/lib/A-ServerProxy/A-ServerProxy.component.js.map +1 -0
- package/dist/node/lib/A-ServerProxy/A-ServerProxy.component.mjs +78 -0
- package/dist/node/lib/A-ServerProxy/A-ServerProxy.component.mjs.map +1 -0
- package/dist/node/lib/A-ServerProxy/A-ServerProxy.constants.d.mts +9 -0
- package/dist/node/lib/A-ServerProxy/A-ServerProxy.constants.d.ts +9 -0
- package/dist/node/lib/A-ServerProxy/A-ServerProxy.constants.js +14 -0
- package/dist/node/lib/A-ServerProxy/A-ServerProxy.constants.js.map +1 -0
- package/dist/node/lib/A-ServerProxy/A-ServerProxy.constants.mjs +14 -0
- package/dist/node/lib/A-ServerProxy/A-ServerProxy.constants.mjs.map +1 -0
- package/dist/node/lib/A-ServerProxy/A-ServerProxy.context.d.mts +36 -0
- package/dist/node/lib/A-ServerProxy/A-ServerProxy.context.d.ts +36 -0
- package/dist/node/lib/A-ServerProxy/A-ServerProxy.context.js +60 -0
- package/dist/node/lib/A-ServerProxy/A-ServerProxy.context.js.map +1 -0
- package/dist/node/lib/A-ServerProxy/A-ServerProxy.context.mjs +59 -0
- package/dist/node/lib/A-ServerProxy/A-ServerProxy.context.mjs.map +1 -0
- package/dist/node/lib/A-ServerProxy/A-ServerProxy.types.d.mts +23 -0
- package/dist/node/lib/A-ServerProxy/A-ServerProxy.types.d.ts +23 -0
- package/dist/node/lib/A-ServerProxy/A-ServerProxy.types.js +4 -0
- package/dist/node/lib/A-ServerProxy/A-ServerProxy.types.js.map +1 -0
- package/dist/node/lib/A-ServerProxy/A-ServerProxy.types.mjs +3 -0
- package/dist/node/lib/A-ServerProxy/A-ServerProxy.types.mjs.map +1 -0
- package/dist/node/lib/A-ServerRoute/A-ServerRoute.constants.d.mts +20 -0
- package/dist/node/lib/A-ServerRoute/A-ServerRoute.constants.d.ts +20 -0
- package/dist/node/lib/A-ServerRoute/A-ServerRoute.constants.js +25 -0
- package/dist/node/lib/A-ServerRoute/A-ServerRoute.constants.js.map +1 -0
- package/dist/node/lib/A-ServerRoute/A-ServerRoute.constants.mjs +24 -0
- package/dist/node/lib/A-ServerRoute/A-ServerRoute.constants.mjs.map +1 -0
- package/dist/node/lib/A-ServerRoute/A-ServerRoute.entity.d.mts +15 -0
- package/dist/node/lib/A-ServerRoute/A-ServerRoute.entity.d.ts +15 -0
- package/dist/node/lib/A-ServerRoute/A-ServerRoute.entity.js +24 -0
- package/dist/node/lib/A-ServerRoute/A-ServerRoute.entity.js.map +1 -0
- package/dist/node/lib/A-ServerRoute/A-ServerRoute.entity.mjs +23 -0
- package/dist/node/lib/A-ServerRoute/A-ServerRoute.entity.mjs.map +1 -0
- package/dist/node/lib/A-ServerRoute/A-ServerRoute.types.d.mts +6 -0
- package/dist/node/lib/A-ServerRoute/A-ServerRoute.types.d.ts +6 -0
- package/dist/node/lib/A-ServerRoute/A-ServerRoute.types.js +4 -0
- package/dist/node/lib/A-ServerRoute/A-ServerRoute.types.js.map +1 -0
- package/dist/node/lib/A-ServerRoute/A-ServerRoute.types.mjs +3 -0
- package/dist/node/lib/A-ServerRoute/A-ServerRoute.types.mjs.map +1 -0
- package/dist/node/lib/A-ServerRouter/A-ServerRouter.component.d.mts +84 -0
- package/dist/node/lib/A-ServerRouter/A-ServerRouter.component.d.ts +84 -0
- package/dist/node/lib/A-ServerRouter/A-ServerRouter.component.js +194 -0
- package/dist/node/lib/A-ServerRouter/A-ServerRouter.component.js.map +1 -0
- package/dist/node/lib/A-ServerRouter/A-ServerRouter.component.mjs +184 -0
- package/dist/node/lib/A-ServerRouter/A-ServerRouter.component.mjs.map +1 -0
- package/dist/node/lib/A-ServerRouter/A-ServerRouter.constants.d.mts +6 -0
- package/dist/node/lib/A-ServerRouter/A-ServerRouter.constants.d.ts +6 -0
- package/dist/node/lib/A-ServerRouter/A-ServerRouter.constants.js +10 -0
- package/dist/node/lib/A-ServerRouter/A-ServerRouter.constants.js.map +1 -0
- package/dist/node/lib/A-ServerRouter/A-ServerRouter.constants.mjs +10 -0
- package/dist/node/lib/A-ServerRouter/A-ServerRouter.constants.mjs.map +1 -0
- package/dist/node/lib/A-ServerRouter/A-ServerRouter.meta.d.mts +16 -0
- package/dist/node/lib/A-ServerRouter/A-ServerRouter.meta.d.ts +16 -0
- package/dist/node/lib/A-ServerRouter/A-ServerRouter.meta.js +40 -0
- package/dist/node/lib/A-ServerRouter/A-ServerRouter.meta.js.map +1 -0
- package/dist/node/lib/A-ServerRouter/A-ServerRouter.meta.mjs +39 -0
- package/dist/node/lib/A-ServerRouter/A-ServerRouter.meta.mjs.map +1 -0
- package/dist/node/lib/A-ServerRouter/A-ServerRouter.types.d.mts +24 -0
- package/dist/node/lib/A-ServerRouter/A-ServerRouter.types.d.ts +24 -0
- package/dist/node/lib/A-ServerRouter/A-ServerRouter.types.js +4 -0
- package/dist/node/lib/A-ServerRouter/A-ServerRouter.types.js.map +1 -0
- package/dist/node/lib/A-ServerRouter/A-ServerRouter.types.mjs +3 -0
- package/dist/node/lib/A-ServerRouter/A-ServerRouter.types.mjs.map +1 -0
- package/dist/node/lib/A-ServerRouter/A-ServerRouterDefine.decorator.d.mts +16 -0
- package/dist/node/lib/A-ServerRouter/A-ServerRouterDefine.decorator.d.ts +16 -0
- package/dist/node/lib/A-ServerRouter/A-ServerRouterDefine.decorator.js +25 -0
- package/dist/node/lib/A-ServerRouter/A-ServerRouterDefine.decorator.js.map +1 -0
- package/dist/node/lib/A-ServerRouter/A-ServerRouterDefine.decorator.mjs +24 -0
- package/dist/node/lib/A-ServerRouter/A-ServerRouterDefine.decorator.mjs.map +1 -0
- package/dist/node/lib/A-ServerStatic/A-ServerStatic.component.d.mts +65 -0
- package/dist/node/lib/A-ServerStatic/A-ServerStatic.component.d.ts +65 -0
- package/dist/node/lib/A-ServerStatic/A-ServerStatic.component.js +260 -0
- package/dist/node/lib/A-ServerStatic/A-ServerStatic.component.js.map +1 -0
- package/dist/node/lib/A-ServerStatic/A-ServerStatic.component.mjs +248 -0
- package/dist/node/lib/A-ServerStatic/A-ServerStatic.component.mjs.map +1 -0
- package/dist/node/lib/A-ServerStatic/A-ServerStatic.context.d.mts +110 -0
- package/dist/node/lib/A-ServerStatic/A-ServerStatic.context.d.ts +110 -0
- package/dist/node/lib/A-ServerStatic/A-ServerStatic.context.js +180 -0
- package/dist/node/lib/A-ServerStatic/A-ServerStatic.context.js.map +1 -0
- package/dist/node/lib/A-ServerStatic/A-ServerStatic.context.mjs +179 -0
- package/dist/node/lib/A-ServerStatic/A-ServerStatic.context.mjs.map +1 -0
- package/dist/node/lib/A-ServerStatic/A-ServerStatic.types.d.mts +8 -0
- package/dist/node/lib/A-ServerStatic/A-ServerStatic.types.d.ts +8 -0
- package/dist/node/lib/A-ServerStatic/A-ServerStatic.types.js +4 -0
- package/dist/node/lib/A-ServerStatic/A-ServerStatic.types.js.map +1 -0
- package/dist/node/lib/A-ServerStatic/A-ServerStatic.types.mjs +3 -0
- package/dist/node/lib/A-ServerStatic/A-ServerStatic.types.mjs.map +1 -0
- package/dist/node/middlewares/A-ServerCORS/A_ServerCORS.component.d.mts +29 -0
- package/dist/node/middlewares/A-ServerCORS/A_ServerCORS.component.d.ts +29 -0
- package/dist/node/middlewares/A-ServerCORS/A_ServerCORS.component.js +62 -0
- package/dist/node/middlewares/A-ServerCORS/A_ServerCORS.component.js.map +1 -0
- package/dist/node/middlewares/A-ServerCORS/A_ServerCORS.component.mjs +50 -0
- package/dist/node/middlewares/A-ServerCORS/A_ServerCORS.component.mjs.map +1 -0
- package/dist/node/middlewares/A-ServerCORS/A_ServerCORS.constants.d.mts +5 -0
- package/dist/node/middlewares/A-ServerCORS/A_ServerCORS.constants.d.ts +5 -0
- package/dist/node/middlewares/A-ServerCORS/A_ServerCORS.constants.js +14 -0
- package/dist/node/middlewares/A-ServerCORS/A_ServerCORS.constants.js.map +1 -0
- package/dist/node/middlewares/A-ServerCORS/A_ServerCORS.constants.mjs +14 -0
- package/dist/node/middlewares/A-ServerCORS/A_ServerCORS.constants.mjs.map +1 -0
- package/dist/node/middlewares/A-ServerCORS/A_ServerCORS.types.d.mts +9 -0
- package/dist/node/middlewares/A-ServerCORS/A_ServerCORS.types.d.ts +9 -0
- package/dist/node/middlewares/A-ServerCORS/A_ServerCORS.types.js +4 -0
- package/dist/node/middlewares/A-ServerCORS/A_ServerCORS.types.js.map +1 -0
- package/dist/node/middlewares/A-ServerCORS/A_ServerCORS.types.mjs +3 -0
- package/dist/node/middlewares/A-ServerCORS/A_ServerCORS.types.mjs.map +1 -0
- package/dist/node/repositories/A-EntityRepository/A-EntityRepository.component.d.mts +24 -0
- package/dist/node/repositories/A-EntityRepository/A-EntityRepository.component.d.ts +24 -0
- package/dist/node/repositories/A-EntityRepository/A-EntityRepository.component.js +94 -0
- package/dist/node/repositories/A-EntityRepository/A-EntityRepository.component.js.map +1 -0
- package/dist/node/repositories/A-EntityRepository/A-EntityRepository.component.mjs +82 -0
- package/dist/node/repositories/A-EntityRepository/A-EntityRepository.component.mjs.map +1 -0
- package/dist/node/repositories/A-EntityRepository/A-EntityRepository.error.d.mts +2 -0
- package/dist/node/repositories/A-EntityRepository/A-EntityRepository.error.d.ts +2 -0
- package/dist/node/repositories/A-EntityRepository/A-EntityRepository.error.js +4 -0
- package/dist/node/repositories/A-EntityRepository/A-EntityRepository.error.js.map +1 -0
- package/dist/node/repositories/A-EntityRepository/A-EntityRepository.error.mjs +3 -0
- package/dist/node/repositories/A-EntityRepository/A-EntityRepository.error.mjs.map +1 -0
- package/dist/node/repositories/A-EntityRepository/A-EntityRepository.types.d.mts +2 -0
- package/dist/node/repositories/A-EntityRepository/A-EntityRepository.types.d.ts +2 -0
- package/dist/node/repositories/A-EntityRepository/A-EntityRepository.types.js +4 -0
- package/dist/node/repositories/A-EntityRepository/A-EntityRepository.types.js.map +1 -0
- package/dist/node/repositories/A-EntityRepository/A-EntityRepository.types.mjs +3 -0
- package/dist/node/repositories/A-EntityRepository/A-EntityRepository.types.mjs.map +1 -0
- package/examples/simple-server/commands/SignIn.command.ts +17 -1
- package/examples/simple-server/components/Test.controller.ts +8 -7
- package/examples/simple-server/components/Users.repository.ts +28 -26
- package/examples/simple-server/concept.ts +56 -66
- package/examples/simple-server/entities/User/User.entity.ts +17 -7
- package/jest.config.ts +24 -10
- package/package.json +267 -25
- package/src/channels/A-Http/A-Http.channel.constants.ts +6 -7
- package/src/channels/A-Http/A-Http.channel.error.ts +2 -2
- package/src/channels/A-Http/A-Http.channel.ts +76 -125
- package/src/channels/A-Http/A-Http.channel.types.ts +6 -3
- package/src/channels/A-Websockets/A-Websockets.channel.ts +1 -1
- package/src/{components → controllers}/A-CommandController/A-CommandController.component.ts +16 -10
- package/src/{components → controllers}/A-EntityController/A-EntityController.component.ts +24 -28
- package/src/{components → controllers}/A-ListingController/A-ListingController.component.ts +10 -12
- package/src/{components → controllers}/A-ServerHealthMonitor/A-ServerHealthMonitor.component.ts +11 -11
- package/src/index.ts +58 -63
- package/src/lib/A-Request/A-HttpRequestData.context.ts +30 -0
- package/src/lib/A-Request/A-HttpServerRequest.context.ts +103 -0
- package/src/lib/A-Request/A-Request.constants.ts +30 -0
- package/src/lib/A-Request/A-Request.entity.ts +844 -0
- package/src/lib/A-Request/A-Request.env.ts +50 -0
- package/src/lib/A-Request/A-Request.error.ts +11 -0
- package/src/lib/A-Request/A-Request.helper.ts +276 -0
- package/src/lib/A-Request/A-Request.types.ts +284 -0
- package/src/lib/A-Request/README.md +567 -0
- package/src/lib/A-Response/A-Response.constants.ts +24 -0
- package/src/lib/A-Response/A-Response.entity.ts +689 -0
- package/src/lib/A-Response/A-Response.error.ts +6 -0
- package/src/lib/A-Response/A-Response.types.ts +127 -0
- package/src/lib/A-Response/README.md +793 -0
- package/src/lib/A-Server/A-HttpServer.constants.ts +9 -0
- package/src/lib/A-Server/A-HttpServer.container.ts +251 -0
- package/src/lib/A-Server/A-HttpServer.error.ts +165 -0
- package/src/lib/A-Server/A-HttpServer.types.ts +37 -0
- package/src/{context/A-Server/A_Server.context.ts → lib/A-Server/A-Server.context.ts} +6 -7
- package/src/lib/A-Server/A-Server.error.ts +26 -0
- package/src/{components/A-ServerError/A-ServerError.types.ts → lib/A-Server/A-Server.types.ts} +8 -0
- package/src/{components/A-Controller/A-Controller.component.ts → lib/A-ServerController/A-ServerController.component.ts} +5 -5
- package/src/{entities/A_EntityList/A_EntityList.entity.ts → lib/A-ServerEntityList/A-EntityList.entity.ts} +2 -2
- package/src/{entities/A_EntityList/A_EntityList.entity.types.ts → lib/A-ServerEntityList/A-EntityList.types.ts} +2 -2
- package/src/{context/A-ListQueryFilter/A_ListQueryFilter.context.ts → lib/A-ServerListQuery/A-ServerListQueryFilter.context.ts} +1 -1
- package/src/lib/A-ServerLogger/A-ServerLogger.component.ts +121 -0
- package/src/lib/A-ServerLogger/A-ServerLogger.types.ts +13 -0
- package/src/lib/A-ServerMiddleware/A-ServerMiddleware.component.ts +17 -0
- package/src/{components → lib}/A-ServerProxy/A-ServerProxy.component.ts +17 -12
- package/src/{context/A-ProxyConfig/A_ProxyConfig.constants.ts → lib/A-ServerProxy/A-ServerProxy.constants.ts} +1 -1
- package/src/{context/A-ProxyConfig/A_ProxyConfig.context.ts → lib/A-ServerProxy/A-ServerProxy.context.ts} +4 -4
- package/src/{context/A-ProxyConfig/A_ProxyConfig.types.ts → lib/A-ServerProxy/A-ServerProxy.types.ts} +4 -4
- package/src/lib/A-ServerRoute/A-ServerRoute.constants.ts +20 -0
- package/src/lib/A-ServerRoute/A-ServerRoute.entity.ts +48 -0
- package/src/lib/A-ServerRoute/A-ServerRoute.types.ts +6 -0
- package/src/{components/A-Router/A-Router.component.ts → lib/A-ServerRouter/A-ServerRouter.component.ts} +77 -97
- package/src/lib/A-ServerRouter/A-ServerRouter.constants.ts +8 -0
- package/src/lib/A-ServerRouter/A-ServerRouter.meta.ts +48 -0
- package/src/lib/A-ServerRouter/A-ServerRouter.types.ts +27 -0
- package/src/lib/A-ServerRouter/A-ServerRouterDefine.decorator.ts +37 -0
- package/src/{components/A-StaticLoader/A-StaticLoader.component.ts → lib/A-ServerStatic/A-ServerStatic.component.ts} +73 -54
- package/src/{context/A-StaticConfig/A-StaticConfig.context.ts → lib/A-ServerStatic/A-ServerStatic.context.ts} +16 -6
- package/src/{components → middlewares}/A-ServerCORS/A_ServerCORS.component.ts +16 -13
- package/src/{components/A-ServerCORS/A_ServerCORS.component.defaults.ts → middlewares/A-ServerCORS/A_ServerCORS.constants.ts} +2 -2
- package/src/{components → repositories}/A-EntityRepository/A-EntityRepository.component.ts +39 -30
- package/tests/A-HttpChannel.test.ts +41 -48
- package/tests/A-HttpServerError.test.ts +204 -0
- package/tests/A-Request.test.ts +351 -0
- package/tsconfig.json +40 -50
- package/tsup.config.ts +111 -13
- package/dist/index.d.mts +0 -855
- package/dist/index.d.ts +0 -855
- package/dist/index.js +0 -2179
- package/dist/index.js.map +0 -1
- package/dist/index.mjs +0 -2144
- package/dist/index.mjs.map +0 -1
- package/examples/microservices-server/components/controllers/Statistics.controller.ts +0 -18
- package/examples/microservices-server/components/repositories/Memory.repository.ts +0 -66
- package/examples/microservices-server/concept.ts +0 -43
- package/examples/microservices-server/context/MemoryStore.context.ts +0 -31
- package/examples/microservices-server/entities/Order.entity.ts +0 -7
- package/examples/microservices-server/entities/User.entity.ts +0 -8
- package/src/components/A-Router/A-Router.component.types.ts +0 -38
- package/src/components/A-ServerError/A-ServerError.class.ts +0 -98
- package/src/components/A-ServerLogger/A_ServerLogger.component.ts +0 -194
- package/src/components/A-ServerLogger/A_ServerLogger.component.types.ts +0 -14
- package/src/containers/A-Service/A-Service.container.ts +0 -218
- package/src/containers/A-Service/A-Service.container.types.ts +0 -46
- package/src/context/A-EntityFactory/A-EntityFactory.context.ts +0 -163
- package/src/context/A-EntityFactory/A-EntityFactory.context.types.ts +0 -11
- package/src/context/A-HttpChannel/A-HttpChannel.context.ts +0 -36
- package/src/context/A-Server/A_Server.context.types.ts +0 -9
- package/src/entities/A-Request/A-Request.entity.ts +0 -163
- package/src/entities/A-Request/A-Request.entity.types.ts +0 -41
- package/src/entities/A-Response/A-Response.entity.ts +0 -194
- package/src/entities/A-Response/A-Response.entity.types.ts +0 -26
- package/src/entities/A-Route/A-Route.entity.ts +0 -117
- package/tests/A-Service.test.ts +0 -18
- /package/src/{components → controllers}/A-EntityController/A-EntityController.component.types.ts +0 -0
- /package/src/{components/A-Controller/A-Controller.component.types.ts → controllers/A-ListingController/A-ListingController.types.ts} +0 -0
- /package/src/{components/A-ServerHealthMonitor/A-ServerHealthMonitor.component.types.ts → controllers/A-ServerHealthMonitor/A-ServerHealthMonitor.types.ts} +0 -0
- /package/src/{components/A-EntityRepository/A-EntityRepository.error.ts → lib/A-Response/A-Response.env.ts} +0 -0
- /package/src/{components/A-EntityRepository/A-EntityRepository.types.ts → lib/A-ServerController/A-ServerController.types.ts} +0 -0
- /package/src/{components → lib}/A-ServerLogger/A-ServerLogger.constants.ts +0 -0
- /package/src/{components/A-ListingController/A-ListingController.component.types.ts → lib/A-ServerMiddleware/A-ServerMiddleware.constants.ts} +0 -0
- /package/src/{components/A-ServerError/A-ServerError.constants.ts → lib/A-ServerMiddleware/A-ServerMiddleware.types.ts} +0 -0
- /package/src/{components/A-StaticLoader/A-StaticLoader.component.types.ts → lib/A-ServerStatic/A-ServerStatic.types.ts} +0 -0
- /package/src/{components/A-ServerCORS/A_ServerCORS.component.types.ts → middlewares/A-ServerCORS/A_ServerCORS.types.ts} +0 -0
- /package/src/{context/A-StaticConfig/A-StaticConfig.context.types.ts → repositories/A-EntityRepository/A-EntityRepository.error.ts} +0 -0
- /package/src/{entities/A-Route/A-Route.entity.types.ts → repositories/A-EntityRepository/A-EntityRepository.types.ts} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3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b,YAAA,CAmCQ,SAAA,EAAA,EAAA,EAAA,CAAA,CAAA;AAmBA,eAAA,CAAA;AAAA,EADhB,UAAU,MAAA,EAAO;AAAA,EAEb,4BAAS,QAAQ,CAAA,CAAA;AAAA,EACjB,4BAAS,cAAc,CAAA;AAAA,CAAA,EAxDnB,YAAA,CAsDQ,SAAA,EAAA,EAAA,EAAA,CAAA,CAAA;AAsCA,eAAA,CAAA;AAAA,EADhB,UAAU,MAAA;AAAO,CAAA,EA3FT,YAAA,CA4FQ,SAAA,EAAA,EAAA,EAAA,CAAA,CAAA;AAGA,eAAA,CAAA;AAAA,EADhB,UAAU,MAAA;AAAO,CAAA,EA9FT,YAAA,CA+FQ,SAAA,EAAA,EAAA,EAAA,CAAA,CAAA;AAGA,eAAA,CAAA;AAAA,EADhB,UAAU,MAAA;AAAO,CAAA,EAjGT,YAAA,CAkGQ,SAAA,EAAA,EAAA,EAAA,CAAA,CAAA","file":"A-HttpServer.container.mjs","sourcesContent":["import type { IncomingMessage, Server, ServerResponse } from \"http\";\nimport { A_HttpServerFeatures } from \"./A-HttpServer.constants\";\nimport { A_Request } from \"@adaas/a-server/request/A-Request.entity\";\nimport { A_Response } from \"@adaas/a-server/response/A-Response.entity\";\nimport { A_TYPES__ServerENVVariables } from \"@adaas/a-server/constants/env.constants\";\nimport { A_Dependency, A_Error, A_Feature, A_IdentityHelper, A_Inject, A_Scope } from \"@adaas/a-concept\";\nimport { A_ServerRoute } from \"@adaas/a-server/route/A-ServerRoute.entity\";\nimport { A_HttpServerRequestMethod } from \"./A-HttpServer.types\";\nimport { A_HttpServerError } from \"./A-HttpServer.error\";\nimport { A_RequestFeatures } from \"@adaas/a-server/request/A-Request.constants\";\nimport { A_HttpServerRequestContext } from \"@adaas/a-server/request/A-HttpServerRequest.context\";\nimport { A_ServerLogger } from \"@adaas/a-server/logger/A-ServerLogger.component\";\nimport { A_Service, A_ServiceFeatures } from \"@adaas/a-utils/a-service\";\nimport { A_Polyfill } from \"@adaas/a-utils/a-polyfill\";\nimport { A_Config } from \"@adaas/a-utils/a-config\";\n\n\n\n\n/**\n * A-Service is a container that can run different types of services, such as HTTP servers, workers, etc.\n * Depending on the provided config and configuration, it will load the necessary components and start the service.\n * \n */\nexport class A_HttpServer extends A_Service {\n\n protected server!: Server;\n\n\n static get onBeforeRequest() {\n return (target: any, propertyKey: string, descriptor: PropertyDescriptor) => {\n return A_Feature.Extend({\n name: A_HttpServerFeatures.onBeforeRequest,\n scope: [target.constructor],\n })(target, propertyKey, descriptor);\n }\n }\n\n static get onRequest() {\n return (target: any, propertyKey: string, descriptor: PropertyDescriptor) => {\n return A_Feature.Extend({\n name: A_HttpServerFeatures.onRequest,\n scope: [target.constructor],\n })(target, propertyKey, descriptor);\n }\n }\n\n static get onAfterRequest() {\n return (target: any, propertyKey: string, descriptor: PropertyDescriptor) => {\n return A_Feature.Extend({\n name: A_HttpServerFeatures.onAfterRequest,\n scope: [target.constructor],\n })(target, propertyKey, descriptor);\n }\n }\n\n\n\n @A_Feature.Extend()\n protected async [A_ServiceFeatures.onStart](\n\n @A_Dependency.Required()\n @A_Inject(A_Polyfill) polyfill: A_Polyfill,\n\n @A_Dependency.Required()\n @A_Inject(A_Config) config: A_Config<A_TYPES__ServerENVVariables>,\n\n ): Promise<void> {\n const http = await polyfill.http();\n\n // Create the HTTP server\n this.server = http.createServer(this.handleRequest.bind(this));\n\n // Start listening on the specified port\n await this.listen(config.get('A_SERVER_PORT'));\n }\n\n @A_Feature.Extend()\n protected async [A_ServiceFeatures.onAfterStart](\n @A_Inject(A_Config) config: A_Config<A_TYPES__ServerENVVariables>,\n @A_Inject(A_ServerLogger) logger: A_ServerLogger,\n ): Promise<void> {\n logger.serverReady({\n port: config.get('A_SERVER_PORT'),\n app: {\n name: this.scope.name,\n }\n });\n }\n\n protected async [A_ServiceFeatures.onStop](...args: any[]): Promise<void> {\n await this.close();\n }\n\n close() {\n return new Promise<void>((resolve, reject) => {\n this.server.close(() => {\n resolve();\n });\n });\n }\n\n listen(port: number) {\n return new Promise<void>((resolve, reject) => {\n this.server.listen(port, () => {\n resolve();\n });\n });\n }\n\n\n // ======================================================================================\n // ============================= A_HttpServer Lifecycle =================================\n // ======================================================================================\n\n @A_Feature.Extend()\n protected async [A_HttpServerFeatures.onBeforeRequest](...args: any[]) { }\n\n @A_Feature.Extend()\n protected async [A_HttpServerFeatures.onRequest](...args: any[]) { }\n\n @A_Feature.Extend()\n protected async [A_HttpServerFeatures.onAfterRequest](...args: any[]) { }\n\n\n // ======================================================================================\n // ============================= A_HttpServer Methods =================================\n // ======================================================================================\n\n async handleRequest(\n request: IncomingMessage,\n response: ServerResponse\n ) {\n const route = new A_ServerRoute(\n request.url || '',\n request.method as A_HttpServerRequestMethod\n );\n\n const id = A_IdentityHelper.generateTimeId();\n const shard = `${request.method}-${route.path.replace('/', '-')}`;\n\n const req = new A_Request({ id, shard, request, scope: this.scope.name });\n const res = new A_Response({ id, shard, response, scope: this.scope.name });\n const context = new A_HttpServerRequestContext(request, response);\n\n const scope = new A_Scope({\n name: id,\n entities: [req, res],\n fragments: [route, context]\n }).inherit(this.scope);\n\n try {\n const onBeforeRequestFeature = new A_Feature({\n name: A_HttpServerFeatures.onBeforeRequest,\n component: this\n });\n\n const onRequestFeature = new A_Feature({\n name: A_HttpServerFeatures.onRequest,\n component: this\n });\n\n const onAfterRequestFeature = new A_Feature({\n name: A_HttpServerFeatures.onAfterRequest,\n component: this\n });\n\n await new Promise<void>(async (resolve, reject) => {\n\n const cleanup = () => {\n onBeforeRequestFeature.interrupt();\n onRequestFeature.interrupt();\n onAfterRequestFeature.interrupt();\n\n req.off(A_RequestFeatures.onError, cleanup);\n req.off(A_RequestFeatures.onClose, cleanup);\n req.off(A_RequestFeatures.onTimeout, cleanup);\n\n\n reject(scope.resolve(A_Error)!);\n }\n\n\n req.on(A_RequestFeatures.onError, cleanup.bind(this));\n req.on(A_RequestFeatures.onClose, cleanup.bind(this));\n\n try {\n await req.load();\n await res.load();\n\n\n await onBeforeRequestFeature.process(scope);\n\n await onRequestFeature.process(scope);\n\n await onAfterRequestFeature.process(scope);\n\n\n req.clearTimeout();\n await res.status(200).send();\n\n resolve();\n } catch (error) {\n\n req.clearTimeout();\n reject(error);\n }\n });\n\n } catch (error) {\n\n let wrappedError;\n\n switch (true) {\n case error instanceof A_HttpServerError:\n wrappedError = error;\n break;\n\n case error instanceof A_Error && error.originalError instanceof A_HttpServerError:\n wrappedError = error.originalError;\n break;\n\n default:\n wrappedError = new A_HttpServerError({\n status: 500,\n description: 'An error occurred while processing the request.',\n originalError: error\n })\n break;\n }\n\n\n scope.register(wrappedError);\n\n await res.fail(wrappedError);\n\n await this.call(A_ServiceFeatures.onError, scope);\n }\n\n scope.destroy();\n }\n\n}\n\n\n\n\n\n\n\n\n"]}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { A_Error } from '@adaas/a-concept';
|
|
2
|
+
import { A_HttpServerError_Init, A_HttpServerError_Serialized } from './A-HttpServer.types.mjs';
|
|
3
|
+
import './A-HttpServer.constants.mjs';
|
|
4
|
+
|
|
5
|
+
declare class A_HttpServerError extends A_Error<A_HttpServerError_Init, A_HttpServerError_Serialized> {
|
|
6
|
+
static readonly NotFoundErrorStatus: number;
|
|
7
|
+
static readonly NotFoundError = "Resource Not Found";
|
|
8
|
+
static readonly InternalServerErrorStatus: number;
|
|
9
|
+
static readonly InternalServerError = "Internal Server Error";
|
|
10
|
+
/**
|
|
11
|
+
* HTTP status code to title mapping
|
|
12
|
+
*/
|
|
13
|
+
private static readonly HTTP_STATUS_TITLES;
|
|
14
|
+
status: number;
|
|
15
|
+
/**
|
|
16
|
+
* Gets the appropriate title for a given HTTP status code
|
|
17
|
+
*/
|
|
18
|
+
private static getHttpStatusTitle;
|
|
19
|
+
constructor(
|
|
20
|
+
/**
|
|
21
|
+
* A_Error Constructor params with required title
|
|
22
|
+
*/
|
|
23
|
+
params: A_HttpServerError_Init);
|
|
24
|
+
constructor(
|
|
25
|
+
/**
|
|
26
|
+
* Simplified params with optional title - will auto-generate from status
|
|
27
|
+
*/
|
|
28
|
+
params: {
|
|
29
|
+
status?: number;
|
|
30
|
+
description?: string;
|
|
31
|
+
code?: string;
|
|
32
|
+
scope?: string;
|
|
33
|
+
link?: string;
|
|
34
|
+
originalError?: Error | unknown;
|
|
35
|
+
});
|
|
36
|
+
constructor(
|
|
37
|
+
/**
|
|
38
|
+
* HTTP Status Code of the error
|
|
39
|
+
*/
|
|
40
|
+
status: number,
|
|
41
|
+
/**
|
|
42
|
+
* Error description
|
|
43
|
+
*/
|
|
44
|
+
description: string);
|
|
45
|
+
constructor(
|
|
46
|
+
/**
|
|
47
|
+
* Original JS Error
|
|
48
|
+
*/
|
|
49
|
+
error: Error);
|
|
50
|
+
protected fromConstructor(params: A_HttpServerError_Init): void;
|
|
51
|
+
toJSON(): A_HttpServerError_Serialized;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export { A_HttpServerError };
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { A_Error } from '@adaas/a-concept';
|
|
2
|
+
import { A_HttpServerError_Init, A_HttpServerError_Serialized } from './A-HttpServer.types.js';
|
|
3
|
+
import './A-HttpServer.constants.js';
|
|
4
|
+
|
|
5
|
+
declare class A_HttpServerError extends A_Error<A_HttpServerError_Init, A_HttpServerError_Serialized> {
|
|
6
|
+
static readonly NotFoundErrorStatus: number;
|
|
7
|
+
static readonly NotFoundError = "Resource Not Found";
|
|
8
|
+
static readonly InternalServerErrorStatus: number;
|
|
9
|
+
static readonly InternalServerError = "Internal Server Error";
|
|
10
|
+
/**
|
|
11
|
+
* HTTP status code to title mapping
|
|
12
|
+
*/
|
|
13
|
+
private static readonly HTTP_STATUS_TITLES;
|
|
14
|
+
status: number;
|
|
15
|
+
/**
|
|
16
|
+
* Gets the appropriate title for a given HTTP status code
|
|
17
|
+
*/
|
|
18
|
+
private static getHttpStatusTitle;
|
|
19
|
+
constructor(
|
|
20
|
+
/**
|
|
21
|
+
* A_Error Constructor params with required title
|
|
22
|
+
*/
|
|
23
|
+
params: A_HttpServerError_Init);
|
|
24
|
+
constructor(
|
|
25
|
+
/**
|
|
26
|
+
* Simplified params with optional title - will auto-generate from status
|
|
27
|
+
*/
|
|
28
|
+
params: {
|
|
29
|
+
status?: number;
|
|
30
|
+
description?: string;
|
|
31
|
+
code?: string;
|
|
32
|
+
scope?: string;
|
|
33
|
+
link?: string;
|
|
34
|
+
originalError?: Error | unknown;
|
|
35
|
+
});
|
|
36
|
+
constructor(
|
|
37
|
+
/**
|
|
38
|
+
* HTTP Status Code of the error
|
|
39
|
+
*/
|
|
40
|
+
status: number,
|
|
41
|
+
/**
|
|
42
|
+
* Error description
|
|
43
|
+
*/
|
|
44
|
+
description: string);
|
|
45
|
+
constructor(
|
|
46
|
+
/**
|
|
47
|
+
* Original JS Error
|
|
48
|
+
*/
|
|
49
|
+
error: Error);
|
|
50
|
+
protected fromConstructor(params: A_HttpServerError_Init): void;
|
|
51
|
+
toJSON(): A_HttpServerError_Serialized;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export { A_HttpServerError };
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var aConcept = require('@adaas/a-concept');
|
|
4
|
+
|
|
5
|
+
const _A_HttpServerError = class _A_HttpServerError extends aConcept.A_Error {
|
|
6
|
+
/**
|
|
7
|
+
* Gets the appropriate title for a given HTTP status code
|
|
8
|
+
*/
|
|
9
|
+
static getHttpStatusTitle(status) {
|
|
10
|
+
return this.HTTP_STATUS_TITLES[status] || "Unknown Error";
|
|
11
|
+
}
|
|
12
|
+
constructor(param1, param2) {
|
|
13
|
+
switch (true) {
|
|
14
|
+
// Pattern: new A_HttpServerError(404, 'The requested resource was not found')
|
|
15
|
+
case (typeof param1 === "number" && typeof param2 === "string"):
|
|
16
|
+
super({
|
|
17
|
+
title: _A_HttpServerError.getHttpStatusTitle(param1),
|
|
18
|
+
description: param2
|
|
19
|
+
});
|
|
20
|
+
this.status = param1;
|
|
21
|
+
break;
|
|
22
|
+
// Pattern: new A_HttpServerError(someErrorObject)
|
|
23
|
+
case param1 instanceof Error:
|
|
24
|
+
super(param1);
|
|
25
|
+
this.status = 500;
|
|
26
|
+
break;
|
|
27
|
+
// Pattern: new A_HttpServerError({ status: 500, description: '...', originalError: ... })
|
|
28
|
+
case (typeof param1 === "object" && param1 !== null && !(param1 instanceof Error)):
|
|
29
|
+
const params = param1;
|
|
30
|
+
if ("title" in params && params.title) {
|
|
31
|
+
super(params);
|
|
32
|
+
this.status = params.status || 500;
|
|
33
|
+
} else {
|
|
34
|
+
const title = params.status ? _A_HttpServerError.getHttpStatusTitle(params.status) : "Internal Server Error";
|
|
35
|
+
super({
|
|
36
|
+
title,
|
|
37
|
+
description: params.description,
|
|
38
|
+
code: params.code,
|
|
39
|
+
scope: params.scope,
|
|
40
|
+
link: params.link,
|
|
41
|
+
originalError: params.originalError
|
|
42
|
+
});
|
|
43
|
+
this.status = params.status || 500;
|
|
44
|
+
}
|
|
45
|
+
break;
|
|
46
|
+
default:
|
|
47
|
+
throw new Error("Invalid parameters provided to A_HttpServerError constructor");
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
fromConstructor(params) {
|
|
51
|
+
super.fromConstructor(params);
|
|
52
|
+
if (params.status) {
|
|
53
|
+
this.status = params.status;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
toJSON() {
|
|
57
|
+
return {
|
|
58
|
+
...super.toJSON(),
|
|
59
|
+
status: this.status
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
_A_HttpServerError.NotFoundErrorStatus = 404;
|
|
64
|
+
_A_HttpServerError.NotFoundError = "Resource Not Found";
|
|
65
|
+
_A_HttpServerError.InternalServerErrorStatus = 500;
|
|
66
|
+
_A_HttpServerError.InternalServerError = "Internal Server Error";
|
|
67
|
+
/**
|
|
68
|
+
* HTTP status code to title mapping
|
|
69
|
+
*/
|
|
70
|
+
_A_HttpServerError.HTTP_STATUS_TITLES = {
|
|
71
|
+
// 4xx Client Errors
|
|
72
|
+
400: "Bad Request",
|
|
73
|
+
401: "Unauthorized",
|
|
74
|
+
402: "Payment Required",
|
|
75
|
+
403: "Forbidden",
|
|
76
|
+
404: "Not Found",
|
|
77
|
+
405: "Method Not Allowed",
|
|
78
|
+
406: "Not Acceptable",
|
|
79
|
+
407: "Proxy Authentication Required",
|
|
80
|
+
408: "Request Timeout",
|
|
81
|
+
409: "Conflict",
|
|
82
|
+
410: "Gone",
|
|
83
|
+
411: "Length Required",
|
|
84
|
+
412: "Precondition Failed",
|
|
85
|
+
413: "Payload Too Large",
|
|
86
|
+
414: "URI Too Long",
|
|
87
|
+
415: "Unsupported Media Type",
|
|
88
|
+
416: "Range Not Satisfiable",
|
|
89
|
+
417: "Expectation Failed",
|
|
90
|
+
418: "I'm a teapot",
|
|
91
|
+
421: "Misdirected Request",
|
|
92
|
+
422: "Unprocessable Entity",
|
|
93
|
+
423: "Locked",
|
|
94
|
+
424: "Failed Dependency",
|
|
95
|
+
425: "Too Early",
|
|
96
|
+
426: "Upgrade Required",
|
|
97
|
+
428: "Precondition Required",
|
|
98
|
+
429: "Too Many Requests",
|
|
99
|
+
431: "Request Header Fields Too Large",
|
|
100
|
+
451: "Unavailable For Legal Reasons",
|
|
101
|
+
// 5xx Server Errors
|
|
102
|
+
500: "Internal Server Error",
|
|
103
|
+
501: "Not Implemented",
|
|
104
|
+
502: "Bad Gateway",
|
|
105
|
+
503: "Service Unavailable",
|
|
106
|
+
504: "Gateway Timeout",
|
|
107
|
+
505: "HTTP Version Not Supported",
|
|
108
|
+
506: "Variant Also Negotiates",
|
|
109
|
+
507: "Insufficient Storage",
|
|
110
|
+
508: "Loop Detected",
|
|
111
|
+
510: "Not Extended",
|
|
112
|
+
511: "Network Authentication Required"
|
|
113
|
+
};
|
|
114
|
+
let A_HttpServerError = _A_HttpServerError;
|
|
115
|
+
|
|
116
|
+
exports.A_HttpServerError = A_HttpServerError;
|
|
117
|
+
//# sourceMappingURL=A-HttpServer.error.js.map
|
|
118
|
+
//# sourceMappingURL=A-HttpServer.error.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/lib/A-Server/A-HttpServer.error.ts"],"names":["A_Error"],"mappings":";;;;AAIO,MAAM,kBAAA,GAAN,MAAM,kBAAA,SAA0BA,gBAAA,CAA8D;AAAA;AAAA;AAAA;AAAA,EA8DjG,OAAe,mBAAmB,MAAA,EAAwB;AACtD,IAAA,OAAO,IAAA,CAAK,kBAAA,CAAmB,MAAM,CAAA,IAAK,eAAA;AAAA,EAC9C;AAAA,EA8BA,WAAA,CACI,QACA,MAAA,EACF;AAEE,IAAA,QAAQ,IAAA;AAAM;AAAA,MAEV,MAAK,OAAO,MAAA,KAAW,QAAA,IAAY,OAAO,MAAA,KAAW,QAAA;AACjD,QAAA,KAAA,CAAM;AAAA,UACF,KAAA,EAAO,kBAAA,CAAkB,kBAAA,CAAmB,MAAM,CAAA;AAAA,UAClD,WAAA,EAAa;AAAA,SAChB,CAAA;AACD,QAAA,IAAA,CAAK,MAAA,GAAS,MAAA;AACd,QAAA;AAAA;AAAA,MAGJ,KAAK,MAAA,YAAkB,KAAA;AACnB,QAAA,KAAA,CAAM,MAAM,CAAA;AACZ,QAAA,IAAA,CAAK,MAAA,GAAS,GAAA;AACd,QAAA;AAAA;AAAA,MAGJ,MAAK,OAAO,MAAA,KAAW,YAAY,MAAA,KAAW,IAAA,IAAQ,EAAE,MAAA,YAAkB,KAAA,CAAA;AACtE,QAAA,MAAM,MAAA,GAAS,MAAA;AAGf,QAAA,IAAI,OAAA,IAAW,MAAA,IAAU,MAAA,CAAO,KAAA,EAAO;AACnC,UAAA,KAAA,CAAM,MAAgC,CAAA;AACtC,UAAA,IAAA,CAAK,MAAA,GAAS,OAAO,MAAA,IAAU,GAAA;AAAA,QACnC,CAAA,MAAO;AAEH,UAAA,MAAM,QAAQ,MAAA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;AAAA,EACL,GAAA,EAAK,+BAAA;AAAA,EACL,GAAA,EAAK,iBAAA;AAAA,EACL,GAAA,EAAK,UAAA;AAAA,EACL,GAAA,EAAK,MAAA;AAAA,EACL,GAAA,EAAK,iBAAA;AAAA,EACL,GAAA,EAAK,qBAAA;AAAA,EACL,GAAA,EAAK,mBAAA;AAAA,EACL,GAAA,EAAK,cAAA;AAAA,EACL,GAAA,EAAK,wBAAA;AAAA,EACL,GAAA,EAAK,uBAAA;AAAA,EACL,GAAA,EAAK,oBAAA;AAAA,EACL,GAAA,EAAK,cAAA;AAAA,EACL,GAAA,EAAK,qBAAA;AAAA,EACL,GAAA,EAAK,sBAAA;AAAA,EACL,GAAA,EAAK,QAAA;AAAA,EACL,GAAA,EAAK,mBAAA;AAAA,EACL,GAAA,EAAK,WAAA;AAAA,EACL,GAAA,EAAK,kBAAA;AAAA,EACL,GAAA,EAAK,uBAAA;AAAA,EACL,GAAA,EAAK,mBAAA;AAAA,EACL,GAAA,EAAK,iCAAA;AAAA,EACL,GAAA,EAAK,+BAAA;AAAA;AAAA,EAGL,GAAA,EAAK,uBAAA;AAAA,EACL,GAAA,EAAK,iBAAA;AAAA,EACL,GAAA,EAAK,aAAA;AAAA,EACL,GAAA,EAAK,qBAAA;AAAA,EACL,GAAA,EAAK,iBAAA;AAAA,EACL,GAAA,EAAK,4BAAA;AAAA,EACL,GAAA,EAAK,yBAAA;AAAA,EACL,GAAA,EAAK,sBAAA;AAAA,EACL,GAAA,EAAK,eAAA;AAAA,EACL,GAAA,EAAK,cAAA;AAAA,EACL,GAAA,EAAK;AACT,CAAA;AAvDG,IAAM,iBAAA,GAAN","file":"A-HttpServer.error.js","sourcesContent":["import { A_Error } from '@adaas/a-concept';\nimport { A_HttpServerError_Init, A_HttpServerError_Serialized } from './A-HttpServer.types';\n\n\nexport class A_HttpServerError extends A_Error<A_HttpServerError_Init, A_HttpServerError_Serialized> {\n\n static readonly NotFoundErrorStatus: number = 404;\n static readonly NotFoundError = 'Resource Not Found';\n\n static readonly InternalServerErrorStatus: number = 500;\n static readonly InternalServerError = 'Internal Server Error';\n\n /**\n * HTTP status code to title mapping\n */\n private static readonly HTTP_STATUS_TITLES: Record<number, string> = {\n // 4xx Client Errors\n 400: 'Bad Request',\n 401: 'Unauthorized',\n 402: 'Payment Required',\n 403: 'Forbidden',\n 404: 'Not Found',\n 405: 'Method Not Allowed',\n 406: 'Not Acceptable',\n 407: 'Proxy Authentication Required',\n 408: 'Request Timeout',\n 409: 'Conflict',\n 410: 'Gone',\n 411: 'Length Required',\n 412: 'Precondition Failed',\n 413: 'Payload Too Large',\n 414: 'URI Too Long',\n 415: 'Unsupported Media Type',\n 416: 'Range Not Satisfiable',\n 417: 'Expectation Failed',\n 418: 'I\\'m a teapot',\n 421: 'Misdirected Request',\n 422: 'Unprocessable Entity',\n 423: 'Locked',\n 424: 'Failed Dependency',\n 425: 'Too Early',\n 426: 'Upgrade Required',\n 428: 'Precondition Required',\n 429: 'Too Many Requests',\n 431: 'Request Header Fields Too Large',\n 451: 'Unavailable For Legal Reasons',\n\n // 5xx Server Errors\n 500: 'Internal Server Error',\n 501: 'Not Implemented',\n 502: 'Bad Gateway',\n 503: 'Service Unavailable',\n 504: 'Gateway Timeout',\n 505: 'HTTP Version Not Supported',\n 506: 'Variant Also Negotiates',\n 507: 'Insufficient Storage',\n 508: 'Loop Detected',\n 510: 'Not Extended',\n 511: 'Network Authentication Required'\n };\n\n status!: number;\n\n /**\n * Gets the appropriate title for a given HTTP status code\n */\n private static getHttpStatusTitle(status: number): string {\n return this.HTTP_STATUS_TITLES[status] || 'Unknown Error';\n }\n\n constructor(\n /**\n * A_Error Constructor params with required title\n */\n params: A_HttpServerError_Init\n )\n constructor(\n /**\n * Simplified params with optional title - will auto-generate from status\n */\n params: { status?: number; description?: string; code?: string; scope?: string; link?: string; originalError?: Error | unknown }\n )\n constructor(\n /**\n * HTTP Status Code of the error\n */\n status: number,\n /**\n * Error description\n */\n description: string\n )\n constructor(\n /**\n * Original JS Error\n */\n error: Error\n )\n constructor(\n param1: A_HttpServerError_Init | { status?: number; description?: string; code?: string; scope?: string; link?: string; originalError?: Error | unknown } | Error | number,\n param2?: string\n ) {\n // Handle the different constructor overloads\n switch (true) {\n // Pattern: new A_HttpServerError(404, 'The requested resource was not found')\n case typeof param1 === 'number' && typeof param2 === 'string':\n super({\n title: A_HttpServerError.getHttpStatusTitle(param1),\n description: param2\n });\n this.status = param1;\n break;\n\n // Pattern: new A_HttpServerError(someErrorObject)\n case param1 instanceof Error:\n super(param1);\n this.status = 500; // Default status for Error objects\n break;\n\n // Pattern: new A_HttpServerError({ status: 500, description: '...', originalError: ... })\n case typeof param1 === 'object' && param1 !== null && !(param1 instanceof Error):\n const params = param1 as any;\n \n // If title is provided, use the full A_Error init\n if ('title' in params && params.title) {\n super(params as A_HttpServerError_Init);\n this.status = params.status || 500;\n } else {\n // Auto-generate title from status\n const title = params.status ? A_HttpServerError.getHttpStatusTitle(params.status) : 'Internal Server Error';\n super({\n title: title,\n description: params.description,\n code: params.code,\n scope: params.scope,\n link: params.link,\n originalError: params.originalError\n });\n this.status = params.status || 500;\n }\n break;\n\n default:\n // Fallback for any other case\n throw new Error('Invalid parameters provided to A_HttpServerError constructor');\n }\n }\n\n\n protected fromConstructor(params: A_HttpServerError_Init): void {\n super.fromConstructor(params);\n if (params.status) {\n this.status = params.status;\n }\n }\n\n\n toJSON(): A_HttpServerError_Serialized {\n return {\n ...super.toJSON(),\n status: this.status\n }\n }\n}\n\n"]}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import '../../chunk-EQQGB2QZ.mjs';
|
|
2
|
+
import { A_Error } from '@adaas/a-concept';
|
|
3
|
+
|
|
4
|
+
const _A_HttpServerError = class _A_HttpServerError extends A_Error {
|
|
5
|
+
/**
|
|
6
|
+
* Gets the appropriate title for a given HTTP status code
|
|
7
|
+
*/
|
|
8
|
+
static getHttpStatusTitle(status) {
|
|
9
|
+
return this.HTTP_STATUS_TITLES[status] || "Unknown Error";
|
|
10
|
+
}
|
|
11
|
+
constructor(param1, param2) {
|
|
12
|
+
switch (true) {
|
|
13
|
+
// Pattern: new A_HttpServerError(404, 'The requested resource was not found')
|
|
14
|
+
case (typeof param1 === "number" && typeof param2 === "string"):
|
|
15
|
+
super({
|
|
16
|
+
title: _A_HttpServerError.getHttpStatusTitle(param1),
|
|
17
|
+
description: param2
|
|
18
|
+
});
|
|
19
|
+
this.status = param1;
|
|
20
|
+
break;
|
|
21
|
+
// Pattern: new A_HttpServerError(someErrorObject)
|
|
22
|
+
case param1 instanceof Error:
|
|
23
|
+
super(param1);
|
|
24
|
+
this.status = 500;
|
|
25
|
+
break;
|
|
26
|
+
// Pattern: new A_HttpServerError({ status: 500, description: '...', originalError: ... })
|
|
27
|
+
case (typeof param1 === "object" && param1 !== null && !(param1 instanceof Error)):
|
|
28
|
+
const params = param1;
|
|
29
|
+
if ("title" in params && params.title) {
|
|
30
|
+
super(params);
|
|
31
|
+
this.status = params.status || 500;
|
|
32
|
+
} else {
|
|
33
|
+
const title = params.status ? _A_HttpServerError.getHttpStatusTitle(params.status) : "Internal Server Error";
|
|
34
|
+
super({
|
|
35
|
+
title,
|
|
36
|
+
description: params.description,
|
|
37
|
+
code: params.code,
|
|
38
|
+
scope: params.scope,
|
|
39
|
+
link: params.link,
|
|
40
|
+
originalError: params.originalError
|
|
41
|
+
});
|
|
42
|
+
this.status = params.status || 500;
|
|
43
|
+
}
|
|
44
|
+
break;
|
|
45
|
+
default:
|
|
46
|
+
throw new Error("Invalid parameters provided to A_HttpServerError constructor");
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
fromConstructor(params) {
|
|
50
|
+
super.fromConstructor(params);
|
|
51
|
+
if (params.status) {
|
|
52
|
+
this.status = params.status;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
toJSON() {
|
|
56
|
+
return {
|
|
57
|
+
...super.toJSON(),
|
|
58
|
+
status: this.status
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
_A_HttpServerError.NotFoundErrorStatus = 404;
|
|
63
|
+
_A_HttpServerError.NotFoundError = "Resource Not Found";
|
|
64
|
+
_A_HttpServerError.InternalServerErrorStatus = 500;
|
|
65
|
+
_A_HttpServerError.InternalServerError = "Internal Server Error";
|
|
66
|
+
/**
|
|
67
|
+
* HTTP status code to title mapping
|
|
68
|
+
*/
|
|
69
|
+
_A_HttpServerError.HTTP_STATUS_TITLES = {
|
|
70
|
+
// 4xx Client Errors
|
|
71
|
+
400: "Bad Request",
|
|
72
|
+
401: "Unauthorized",
|
|
73
|
+
402: "Payment Required",
|
|
74
|
+
403: "Forbidden",
|
|
75
|
+
404: "Not Found",
|
|
76
|
+
405: "Method Not Allowed",
|
|
77
|
+
406: "Not Acceptable",
|
|
78
|
+
407: "Proxy Authentication Required",
|
|
79
|
+
408: "Request Timeout",
|
|
80
|
+
409: "Conflict",
|
|
81
|
+
410: "Gone",
|
|
82
|
+
411: "Length Required",
|
|
83
|
+
412: "Precondition Failed",
|
|
84
|
+
413: "Payload Too Large",
|
|
85
|
+
414: "URI Too Long",
|
|
86
|
+
415: "Unsupported Media Type",
|
|
87
|
+
416: "Range Not Satisfiable",
|
|
88
|
+
417: "Expectation Failed",
|
|
89
|
+
418: "I'm a teapot",
|
|
90
|
+
421: "Misdirected Request",
|
|
91
|
+
422: "Unprocessable Entity",
|
|
92
|
+
423: "Locked",
|
|
93
|
+
424: "Failed Dependency",
|
|
94
|
+
425: "Too Early",
|
|
95
|
+
426: "Upgrade Required",
|
|
96
|
+
428: "Precondition Required",
|
|
97
|
+
429: "Too Many Requests",
|
|
98
|
+
431: "Request Header Fields Too Large",
|
|
99
|
+
451: "Unavailable For Legal Reasons",
|
|
100
|
+
// 5xx Server Errors
|
|
101
|
+
500: "Internal Server Error",
|
|
102
|
+
501: "Not Implemented",
|
|
103
|
+
502: "Bad Gateway",
|
|
104
|
+
503: "Service Unavailable",
|
|
105
|
+
504: "Gateway Timeout",
|
|
106
|
+
505: "HTTP Version Not Supported",
|
|
107
|
+
506: "Variant Also Negotiates",
|
|
108
|
+
507: "Insufficient Storage",
|
|
109
|
+
508: "Loop Detected",
|
|
110
|
+
510: "Not Extended",
|
|
111
|
+
511: "Network Authentication Required"
|
|
112
|
+
};
|
|
113
|
+
let A_HttpServerError = _A_HttpServerError;
|
|
114
|
+
|
|
115
|
+
export { A_HttpServerError };
|
|
116
|
+
//# sourceMappingURL=A-HttpServer.error.mjs.map
|
|
117
|
+
//# sourceMappingURL=A-HttpServer.error.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/lib/A-Server/A-HttpServer.error.ts"],"names":[],"mappings":";;;AAIO,MAAM,kBAAA,GAAN,MAAM,kBAAA,SAA0B,OAAA,CAA8D;AAAA;AAAA;AAAA;AAAA,EA8DjG,OAAe,mBAAmB,MAAA,EAAwB;AACtD,IAAA,OAAO,IAAA,CAAK,kBAAA,CAAmB,MAAM,CAAA,IAAK,eAAA;AAAA,EAC9C;AAAA,EA8BA,WAAA,CACI,QACA,MAAA,EACF;AAEE,IAAA,QAAQ,IAAA;AAAM;AAAA,MAEV,MAAK,OAAO,MAAA,KAAW,QAAA,IAAY,OAAO,MAAA,KAAW,QAAA;AACjD,QAAA,KAAA,CAAM;AAAA,UACF,KAAA,EAAO,kBAAA,CAAkB,kBAAA,CAAmB,MAAM,CAAA;AAAA,UAClD,WAAA,EAAa;AAAA,SAChB,CAAA;AACD,QAAA,IAAA,CAAK,MAAA,GAAS,MAAA;AACd,QAAA;AAAA;AAAA,MAGJ,KAAK,MAAA,YAAkB,KAAA;AACnB,QAAA,KAAA,CAAM,MAAM,CAAA;AACZ,QAAA,IAAA,CAAK,MAAA,GAAS,GAAA;AACd,QAAA;AAAA;AAAA,MAGJ,MAAK,OAAO,MAAA,KAAW,YAAY,MAAA,KAAW,IAAA,IAAQ,EAAE,MAAA,YAAkB,KAAA,CAAA;AACtE,QAAA,MAAM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AvDG,IAAM,iBAAA,GAAN","file":"A-HttpServer.error.mjs","sourcesContent":["import { A_Error } from '@adaas/a-concept';\nimport { A_HttpServerError_Init, A_HttpServerError_Serialized } from './A-HttpServer.types';\n\n\nexport class A_HttpServerError extends A_Error<A_HttpServerError_Init, A_HttpServerError_Serialized> {\n\n static readonly NotFoundErrorStatus: number = 404;\n static readonly NotFoundError = 'Resource Not Found';\n\n static readonly InternalServerErrorStatus: number = 500;\n static readonly InternalServerError = 'Internal Server Error';\n\n /**\n * HTTP status code to title mapping\n */\n private static readonly HTTP_STATUS_TITLES: Record<number, string> = {\n // 4xx Client Errors\n 400: 'Bad Request',\n 401: 'Unauthorized',\n 402: 'Payment Required',\n 403: 'Forbidden',\n 404: 'Not Found',\n 405: 'Method Not Allowed',\n 406: 'Not Acceptable',\n 407: 'Proxy Authentication Required',\n 408: 'Request Timeout',\n 409: 'Conflict',\n 410: 'Gone',\n 411: 'Length Required',\n 412: 'Precondition Failed',\n 413: 'Payload Too Large',\n 414: 'URI Too Long',\n 415: 'Unsupported Media Type',\n 416: 'Range Not Satisfiable',\n 417: 'Expectation Failed',\n 418: 'I\\'m a teapot',\n 421: 'Misdirected Request',\n 422: 'Unprocessable Entity',\n 423: 'Locked',\n 424: 'Failed Dependency',\n 425: 'Too Early',\n 426: 'Upgrade Required',\n 428: 'Precondition Required',\n 429: 'Too Many Requests',\n 431: 'Request Header Fields Too Large',\n 451: 'Unavailable For Legal Reasons',\n\n // 5xx Server Errors\n 500: 'Internal Server Error',\n 501: 'Not Implemented',\n 502: 'Bad Gateway',\n 503: 'Service Unavailable',\n 504: 'Gateway Timeout',\n 505: 'HTTP Version Not Supported',\n 506: 'Variant Also Negotiates',\n 507: 'Insufficient Storage',\n 508: 'Loop Detected',\n 510: 'Not Extended',\n 511: 'Network Authentication Required'\n };\n\n status!: number;\n\n /**\n * Gets the appropriate title for a given HTTP status code\n */\n private static getHttpStatusTitle(status: number): string {\n return this.HTTP_STATUS_TITLES[status] || 'Unknown Error';\n }\n\n constructor(\n /**\n * A_Error Constructor params with required title\n */\n params: A_HttpServerError_Init\n )\n constructor(\n /**\n * Simplified params with optional title - will auto-generate from status\n */\n params: { status?: number; description?: string; code?: string; scope?: string; link?: string; originalError?: Error | unknown }\n )\n constructor(\n /**\n * HTTP Status Code of the error\n */\n status: number,\n /**\n * Error description\n */\n description: string\n )\n constructor(\n /**\n * Original JS Error\n */\n error: Error\n )\n constructor(\n param1: A_HttpServerError_Init | { status?: number; description?: string; code?: string; scope?: string; link?: string; originalError?: Error | unknown } | Error | number,\n param2?: string\n ) {\n // Handle the different constructor overloads\n switch (true) {\n // Pattern: new A_HttpServerError(404, 'The requested resource was not found')\n case typeof param1 === 'number' && typeof param2 === 'string':\n super({\n title: A_HttpServerError.getHttpStatusTitle(param1),\n description: param2\n });\n this.status = param1;\n break;\n\n // Pattern: new A_HttpServerError(someErrorObject)\n case param1 instanceof Error:\n super(param1);\n this.status = 500; // Default status for Error objects\n break;\n\n // Pattern: new A_HttpServerError({ status: 500, description: '...', originalError: ... })\n case typeof param1 === 'object' && param1 !== null && !(param1 instanceof Error):\n const params = param1 as any;\n \n // If title is provided, use the full A_Error init\n if ('title' in params && params.title) {\n super(params as A_HttpServerError_Init);\n this.status = params.status || 500;\n } else {\n // Auto-generate title from status\n const title = params.status ? A_HttpServerError.getHttpStatusTitle(params.status) : 'Internal Server Error';\n super({\n title: title,\n description: params.description,\n code: params.code,\n scope: params.scope,\n link: params.link,\n originalError: params.originalError\n });\n this.status = params.status || 500;\n }\n break;\n\n default:\n // Fallback for any other case\n throw new Error('Invalid parameters provided to A_HttpServerError constructor');\n }\n }\n\n\n protected fromConstructor(params: A_HttpServerError_Init): void {\n super.fromConstructor(params);\n if (params.status) {\n this.status = params.status;\n }\n }\n\n\n toJSON(): A_HttpServerError_Serialized {\n return {\n ...super.toJSON(),\n status: this.status\n }\n }\n}\n\n"]}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { A_TYPES__Error_Init, A_TYPES__Error_Serialized } from '@adaas/a-concept';
|
|
2
|
+
import { A_HttpServerFeatures } from './A-HttpServer.constants.mjs';
|
|
3
|
+
|
|
4
|
+
type A_HttpServerRequestMethod = 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH' | 'OPTIONS' | 'HEAD' | 'CONNECT' | 'TRACE' | 'DEFAULT';
|
|
5
|
+
type A_HttpServerFeatureNames = typeof A_HttpServerFeatures[keyof typeof A_HttpServerFeatures];
|
|
6
|
+
type A_HttpServerError_Init = {
|
|
7
|
+
/**
|
|
8
|
+
* HTTP Status Code of the error
|
|
9
|
+
*/
|
|
10
|
+
status?: number;
|
|
11
|
+
} & A_TYPES__Error_Init;
|
|
12
|
+
type A_HttpServerError_Serialized = {
|
|
13
|
+
/**
|
|
14
|
+
* HTTP Status Code of the error
|
|
15
|
+
*/
|
|
16
|
+
status: number;
|
|
17
|
+
} & A_TYPES__Error_Serialized;
|
|
18
|
+
|
|
19
|
+
export type { A_HttpServerError_Init, A_HttpServerError_Serialized, A_HttpServerFeatureNames, A_HttpServerRequestMethod };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { A_TYPES__Error_Init, A_TYPES__Error_Serialized } from '@adaas/a-concept';
|
|
2
|
+
import { A_HttpServerFeatures } from './A-HttpServer.constants.js';
|
|
3
|
+
|
|
4
|
+
type A_HttpServerRequestMethod = 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH' | 'OPTIONS' | 'HEAD' | 'CONNECT' | 'TRACE' | 'DEFAULT';
|
|
5
|
+
type A_HttpServerFeatureNames = typeof A_HttpServerFeatures[keyof typeof A_HttpServerFeatures];
|
|
6
|
+
type A_HttpServerError_Init = {
|
|
7
|
+
/**
|
|
8
|
+
* HTTP Status Code of the error
|
|
9
|
+
*/
|
|
10
|
+
status?: number;
|
|
11
|
+
} & A_TYPES__Error_Init;
|
|
12
|
+
type A_HttpServerError_Serialized = {
|
|
13
|
+
/**
|
|
14
|
+
* HTTP Status Code of the error
|
|
15
|
+
*/
|
|
16
|
+
status: number;
|
|
17
|
+
} & A_TYPES__Error_Serialized;
|
|
18
|
+
|
|
19
|
+
export type { A_HttpServerError_Init, A_HttpServerError_Serialized, A_HttpServerFeatureNames, A_HttpServerRequestMethod };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"A-HttpServer.types.js"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"A-HttpServer.types.mjs"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { A_Fragment, A_TYPES__Required } from '@adaas/a-concept';
|
|
2
|
+
import { A_SERVER_TYPES__ServerConstructor } from './A-Server.types.mjs';
|
|
3
|
+
import { A_ServerRoute } from '../A-ServerRoute/A-ServerRoute.entity.mjs';
|
|
4
|
+
import '@adaas/a-utils/a-route';
|
|
5
|
+
import '../A-ServerRoute/A-ServerRoute.types.mjs';
|
|
6
|
+
import '../A-ServerRoute/A-ServerRoute.constants.mjs';
|
|
7
|
+
|
|
8
|
+
declare class A_Server extends A_Fragment {
|
|
9
|
+
port: number;
|
|
10
|
+
version: string;
|
|
11
|
+
protected _routes: A_ServerRoute[];
|
|
12
|
+
constructor(params: A_TYPES__Required<Partial<A_SERVER_TYPES__ServerConstructor>, [
|
|
13
|
+
'port',
|
|
14
|
+
'name'
|
|
15
|
+
]>);
|
|
16
|
+
/**
|
|
17
|
+
* A list of routes that the server will listen to
|
|
18
|
+
*/
|
|
19
|
+
get routes(): A_ServerRoute[];
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export { A_Server };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { A_Fragment, A_TYPES__Required } from '@adaas/a-concept';
|
|
2
|
+
import { A_SERVER_TYPES__ServerConstructor } from './A-Server.types.js';
|
|
3
|
+
import { A_ServerRoute } from '../A-ServerRoute/A-ServerRoute.entity.js';
|
|
4
|
+
import '@adaas/a-utils/a-route';
|
|
5
|
+
import '../A-ServerRoute/A-ServerRoute.types.js';
|
|
6
|
+
import '../A-ServerRoute/A-ServerRoute.constants.js';
|
|
7
|
+
|
|
8
|
+
declare class A_Server extends A_Fragment {
|
|
9
|
+
port: number;
|
|
10
|
+
version: string;
|
|
11
|
+
protected _routes: A_ServerRoute[];
|
|
12
|
+
constructor(params: A_TYPES__Required<Partial<A_SERVER_TYPES__ServerConstructor>, [
|
|
13
|
+
'port',
|
|
14
|
+
'name'
|
|
15
|
+
]>);
|
|
16
|
+
/**
|
|
17
|
+
* A list of routes that the server will listen to
|
|
18
|
+
*/
|
|
19
|
+
get routes(): A_ServerRoute[];
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export { A_Server };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var aConcept = require('@adaas/a-concept');
|
|
4
|
+
|
|
5
|
+
class A_Server extends aConcept.A_Fragment {
|
|
6
|
+
constructor(params) {
|
|
7
|
+
super(params);
|
|
8
|
+
this._routes = [];
|
|
9
|
+
this.port = params.port;
|
|
10
|
+
this._name = params.name;
|
|
11
|
+
this.version = params.version || "v1";
|
|
12
|
+
this._routes = params.routes || this._routes;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* A list of routes that the server will listen to
|
|
16
|
+
*/
|
|
17
|
+
get routes() {
|
|
18
|
+
return this._routes;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
exports.A_Server = A_Server;
|
|
23
|
+
//# sourceMappingURL=A-Server.context.js.map
|
|
24
|
+
//# sourceMappingURL=A-Server.context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/lib/A-Server/A-Server.context.ts"],"names":["A_Fragment"],"mappings":";;;;AAKO,MAAM,iBAAiBA,mBAAA,CAAW;AAAA,EAMrC,YACI,MAAA,EAIF;AACE,IAAA,KAAA,CAAM,MAAM,CAAA;AARhB,IAAA,IAAA,CAAU,UAA2B,EAAC;AAUlC,IAAA,IAAA,CAAK,OAAO,MAAA,CAAO,IAAA;AACnB,IAAA,IAAA,CAAK,QAAQ,MAAA,CAAO,IAAA;AACpB,IAAA,IAAA,CAAK,OAAA,GAAU,OAAO,OAAA,IAAW,IAAA;AAEjC,IAAA,IAAA,CAAK,OAAA,GAAU,MAAA,CAAO,MAAA,IAAU,IAAA,CAAK,OAAA;AAAA,EACzC;AAAA;AAAA;AAAA;AAAA,EAMA,IAAI,MAAA,GAA0B;AAC1B,IAAA,OAAO,IAAA,CAAK,OAAA;AAAA,EAChB;AAEJ","file":"A-Server.context.js","sourcesContent":["import { A_Fragment, A_TYPES__Required } from \"@adaas/a-concept\";\nimport { A_SERVER_TYPES__ServerConstructor } from \"./A-Server.types\";\nimport { A_ServerRoute } from \"@adaas/a-server/route/A-ServerRoute.entity\";\n\n\nexport class A_Server extends A_Fragment {\n\n public port: number;\n public version: string;\n protected _routes: A_ServerRoute[] = [];\n\n constructor(\n params: A_TYPES__Required<Partial<A_SERVER_TYPES__ServerConstructor>, [\n 'port',\n 'name'\n ]>\n ) {\n super(params);\n\n this.port = params.port;\n this._name = params.name;\n this.version = params.version || 'v1';\n\n this._routes = params.routes || this._routes;\n }\n\n\n /**\n * A list of routes that the server will listen to\n */\n get routes(): A_ServerRoute[] {\n return this._routes\n }\n\n}\n\n\n"]}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import '../../chunk-EQQGB2QZ.mjs';
|
|
2
|
+
import { A_Fragment } from '@adaas/a-concept';
|
|
3
|
+
|
|
4
|
+
class A_Server extends A_Fragment {
|
|
5
|
+
constructor(params) {
|
|
6
|
+
super(params);
|
|
7
|
+
this._routes = [];
|
|
8
|
+
this.port = params.port;
|
|
9
|
+
this._name = params.name;
|
|
10
|
+
this.version = params.version || "v1";
|
|
11
|
+
this._routes = params.routes || this._routes;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* A list of routes that the server will listen to
|
|
15
|
+
*/
|
|
16
|
+
get routes() {
|
|
17
|
+
return this._routes;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export { A_Server };
|
|
22
|
+
//# sourceMappingURL=A-Server.context.mjs.map
|
|
23
|
+
//# sourceMappingURL=A-Server.context.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/lib/A-Server/A-Server.context.ts"],"names":[],"mappings":";;;AAKO,MAAM,iBAAiB,UAAA,CAAW;AAAA,EAMrC,YACI,MAAA,EAIF;AACE,IAAA,KAAA,CAAM,MAAM,CAAA;AARhB,IAAA,IAAA,CAAU,UAA2B,EAAC;AAUlC,IAAA,IAAA,CAAK,OAAO,MAAA,CAAO,IAAA;AACnB,IAAA,IAAA,CAAK,QAAQ,MAAA,CAAO,IAAA;AACpB,IAAA,IAAA,CAAK,OAAA,GAAU,OAAO,OAAA,IAAW,IAAA;AAEjC,IAAA,IAAA,CAAK,OAAA,GAAU,MAAA,CAAO,MAAA,IAAU,IAAA,CAAK,OAAA;AAAA,EACzC;AAAA;AAAA;AAAA;AAAA,EAMA,IAAI,MAAA,GAA0B;AAC1B,IAAA,OAAO,IAAA,CAAK,OAAA;AAAA,EAChB;AAEJ","file":"A-Server.context.mjs","sourcesContent":["import { A_Fragment, A_TYPES__Required } from \"@adaas/a-concept\";\nimport { A_SERVER_TYPES__ServerConstructor } from \"./A-Server.types\";\nimport { A_ServerRoute } from \"@adaas/a-server/route/A-ServerRoute.entity\";\n\n\nexport class A_Server extends A_Fragment {\n\n public port: number;\n public version: string;\n protected _routes: A_ServerRoute[] = [];\n\n constructor(\n params: A_TYPES__Required<Partial<A_SERVER_TYPES__ServerConstructor>, [\n 'port',\n 'name'\n ]>\n ) {\n super(params);\n\n this.port = params.port;\n this._name = params.name;\n this.version = params.version || 'v1';\n\n this._routes = params.routes || this._routes;\n }\n\n\n /**\n * A list of routes that the server will listen to\n */\n get routes(): A_ServerRoute[] {\n return this._routes\n }\n\n}\n\n\n"]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { A_Error } from '@adaas/a-concept';
|
|
2
|
+
import { A_SERVER_TYPES__ServerError_Init, A_SERVER_TYPES__ServerError_Serialized } from './A-Server.types.mjs';
|
|
3
|
+
import '../A-ServerRoute/A-ServerRoute.entity.mjs';
|
|
4
|
+
import '@adaas/a-utils/a-route';
|
|
5
|
+
import '../A-ServerRoute/A-ServerRoute.types.mjs';
|
|
6
|
+
import '../A-ServerRoute/A-ServerRoute.constants.mjs';
|
|
7
|
+
|
|
8
|
+
declare class A_ServerError extends A_Error<A_SERVER_TYPES__ServerError_Init, A_SERVER_TYPES__ServerError_Serialized> {
|
|
9
|
+
status: number;
|
|
10
|
+
protected fromConstructor(params: A_SERVER_TYPES__ServerError_Init): void;
|
|
11
|
+
toJSON(): A_SERVER_TYPES__ServerError_Serialized;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export { A_ServerError };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { A_Error } from '@adaas/a-concept';
|
|
2
|
+
import { A_SERVER_TYPES__ServerError_Init, A_SERVER_TYPES__ServerError_Serialized } from './A-Server.types.js';
|
|
3
|
+
import '../A-ServerRoute/A-ServerRoute.entity.js';
|
|
4
|
+
import '@adaas/a-utils/a-route';
|
|
5
|
+
import '../A-ServerRoute/A-ServerRoute.types.js';
|
|
6
|
+
import '../A-ServerRoute/A-ServerRoute.constants.js';
|
|
7
|
+
|
|
8
|
+
declare class A_ServerError extends A_Error<A_SERVER_TYPES__ServerError_Init, A_SERVER_TYPES__ServerError_Serialized> {
|
|
9
|
+
status: number;
|
|
10
|
+
protected fromConstructor(params: A_SERVER_TYPES__ServerError_Init): void;
|
|
11
|
+
toJSON(): A_SERVER_TYPES__ServerError_Serialized;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export { A_ServerError };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var aConcept = require('@adaas/a-concept');
|
|
4
|
+
|
|
5
|
+
class A_ServerError extends aConcept.A_Error {
|
|
6
|
+
constructor() {
|
|
7
|
+
super(...arguments);
|
|
8
|
+
this.status = 500;
|
|
9
|
+
}
|
|
10
|
+
fromConstructor(params) {
|
|
11
|
+
super.fromConstructor(params);
|
|
12
|
+
if (params.status) {
|
|
13
|
+
this.status = params.status;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
toJSON() {
|
|
17
|
+
return {
|
|
18
|
+
...super.toJSON(),
|
|
19
|
+
status: this.status
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
exports.A_ServerError = A_ServerError;
|
|
25
|
+
//# sourceMappingURL=A-Server.error.js.map
|
|
26
|
+
//# sourceMappingURL=A-Server.error.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/lib/A-Server/A-Server.error.ts"],"names":["A_Error"],"mappings":";;;;AAIO,MAAM,sBAAsBA,gBAAA,CAAkF;AAAA,EAA9G,WAAA,GAAA;AAAA,IAAA,KAAA,CAAA,GAAA,SAAA,CAAA;AAEH,IAAA,IAAA,CAAA,MAAA,GAAiB,GAAA;AAAA,EAAA;AAAA,EAGP,gBAAgB,MAAA,EAAgD;AACtE,IAAA,KAAA,CAAM,gBAAgB,MAAM,CAAA;AAC5B,IAAA,IAAI,OAAO,MAAA,EAAQ;AACf,MAAA,IAAA,CAAK,SAAS,MAAA,CAAO,MAAA;AAAA,IACzB;AAAA,EACJ;AAAA,EAGA,MAAA,GAAiD;AAC7C,IAAA,OAAO;AAAA,MACH,GAAG,MAAM,MAAA,EAAO;AAAA,MAChB,QAAQ,IAAA,CAAK;AAAA,KACjB;AAAA,EACJ;AACJ","file":"A-Server.error.js","sourcesContent":["import { A_Error } from '@adaas/a-concept';\nimport { A_SERVER_TYPES__ServerError_Init, A_SERVER_TYPES__ServerError_Serialized } from './A-Server.types';\n\n\nexport class A_ServerError extends A_Error<A_SERVER_TYPES__ServerError_Init, A_SERVER_TYPES__ServerError_Serialized> {\n\n status: number = 500;\n\n\n protected fromConstructor(params: A_SERVER_TYPES__ServerError_Init): void {\n super.fromConstructor(params);\n if (params.status) {\n this.status = params.status;\n }\n }\n\n\n toJSON(): A_SERVER_TYPES__ServerError_Serialized {\n return {\n ...super.toJSON(),\n status: this.status\n }\n }\n}\n\n\n"]}
|