@adaas/a-server 0.0.22 → 0.0.24
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 +1699 -0
- package/dist/browser/index.mjs +2935 -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-6qhiV7BE.d.mts +348 -0
- package/dist/node/A-Response.entity-bjh6bofZ.d.ts +348 -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 +608 -0
- package/dist/node/lib/A-Response/A-Response.entity.js.map +1 -0
- package/dist/node/lib/A-Response/A-Response.entity.mjs +596 -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 +196 -0
- package/dist/node/lib/A-Server/A-HttpServer.container.js.map +1 -0
- package/dist/node/lib/A-Server/A-HttpServer.container.mjs +184 -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 +751 -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 +256 -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,12 @@
|
|
|
1
|
+
declare const A_SERVER_CONSTANTS__DEFAULT_ENV_VARIABLES: {
|
|
2
|
+
/**
|
|
3
|
+
* Port for the server to listen on
|
|
4
|
+
* [!] Default is 3000
|
|
5
|
+
* @default 3000
|
|
6
|
+
*/
|
|
7
|
+
readonly A_SERVER_PORT: "A_SERVER_PORT";
|
|
8
|
+
};
|
|
9
|
+
type A_TYPES__ServerENVVariables = (typeof A_SERVER_CONSTANTS__DEFAULT_ENV_VARIABLES)[keyof typeof A_SERVER_CONSTANTS__DEFAULT_ENV_VARIABLES][];
|
|
10
|
+
declare const A_SERVER_CONSTANTS__DEFAULT_ENV_VARIABLES_ARRAY: readonly ["A_SERVER_PORT"];
|
|
11
|
+
|
|
12
|
+
export { A_SERVER_CONSTANTS__DEFAULT_ENV_VARIABLES, A_SERVER_CONSTANTS__DEFAULT_ENV_VARIABLES_ARRAY, type A_TYPES__ServerENVVariables };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
declare const A_SERVER_CONSTANTS__DEFAULT_ENV_VARIABLES: {
|
|
2
|
+
/**
|
|
3
|
+
* Port for the server to listen on
|
|
4
|
+
* [!] Default is 3000
|
|
5
|
+
* @default 3000
|
|
6
|
+
*/
|
|
7
|
+
readonly A_SERVER_PORT: "A_SERVER_PORT";
|
|
8
|
+
};
|
|
9
|
+
type A_TYPES__ServerENVVariables = (typeof A_SERVER_CONSTANTS__DEFAULT_ENV_VARIABLES)[keyof typeof A_SERVER_CONSTANTS__DEFAULT_ENV_VARIABLES][];
|
|
10
|
+
declare const A_SERVER_CONSTANTS__DEFAULT_ENV_VARIABLES_ARRAY: readonly ["A_SERVER_PORT"];
|
|
11
|
+
|
|
12
|
+
export { A_SERVER_CONSTANTS__DEFAULT_ENV_VARIABLES, A_SERVER_CONSTANTS__DEFAULT_ENV_VARIABLES_ARRAY, type A_TYPES__ServerENVVariables };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const A_SERVER_CONSTANTS__DEFAULT_ENV_VARIABLES = {
|
|
4
|
+
// ----------------------------------------------------------
|
|
5
|
+
// A-Server Environment Variables
|
|
6
|
+
// ----------------------------------------------------------
|
|
7
|
+
// These environment variables are used by A-Server to configure the application
|
|
8
|
+
// ----------------------------------------------------------
|
|
9
|
+
/**
|
|
10
|
+
* Port for the server to listen on
|
|
11
|
+
* [!] Default is 3000
|
|
12
|
+
* @default 3000
|
|
13
|
+
*/
|
|
14
|
+
A_SERVER_PORT: "A_SERVER_PORT"
|
|
15
|
+
};
|
|
16
|
+
const A_SERVER_CONSTANTS__DEFAULT_ENV_VARIABLES_ARRAY = [
|
|
17
|
+
A_SERVER_CONSTANTS__DEFAULT_ENV_VARIABLES.A_SERVER_PORT
|
|
18
|
+
];
|
|
19
|
+
|
|
20
|
+
exports.A_SERVER_CONSTANTS__DEFAULT_ENV_VARIABLES = A_SERVER_CONSTANTS__DEFAULT_ENV_VARIABLES;
|
|
21
|
+
exports.A_SERVER_CONSTANTS__DEFAULT_ENV_VARIABLES_ARRAY = A_SERVER_CONSTANTS__DEFAULT_ENV_VARIABLES_ARRAY;
|
|
22
|
+
//# sourceMappingURL=env.constants.js.map
|
|
23
|
+
//# sourceMappingURL=env.constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/constants/env.constants.ts"],"names":[],"mappings":";;AAAO,MAAM,yCAAA,GAA4C;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAWrD,aAAA,EAAe;AAEnB;AAMO,MAAM,+CAAA,GAAkD;AAAA,EAC3D,yCAAA,CAA0C;AAC9C","file":"env.constants.js","sourcesContent":["export const A_SERVER_CONSTANTS__DEFAULT_ENV_VARIABLES = {\n // ----------------------------------------------------------\n // A-Server Environment Variables\n // ----------------------------------------------------------\n // These environment variables are used by A-Server to configure the application\n // ----------------------------------------------------------\n /**\n * Port for the server to listen on\n * [!] Default is 3000\n * @default 3000\n */\n A_SERVER_PORT: 'A_SERVER_PORT',\n\n} as const;\n\nexport type A_TYPES__ServerENVVariables = (typeof A_SERVER_CONSTANTS__DEFAULT_ENV_VARIABLES)[keyof typeof A_SERVER_CONSTANTS__DEFAULT_ENV_VARIABLES][];\n\n\n\nexport const A_SERVER_CONSTANTS__DEFAULT_ENV_VARIABLES_ARRAY = [\n A_SERVER_CONSTANTS__DEFAULT_ENV_VARIABLES.A_SERVER_PORT,\n] as const;\n\n\n\n\n"]}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import '../chunk-EQQGB2QZ.mjs';
|
|
2
|
+
|
|
3
|
+
const A_SERVER_CONSTANTS__DEFAULT_ENV_VARIABLES = {
|
|
4
|
+
// ----------------------------------------------------------
|
|
5
|
+
// A-Server Environment Variables
|
|
6
|
+
// ----------------------------------------------------------
|
|
7
|
+
// These environment variables are used by A-Server to configure the application
|
|
8
|
+
// ----------------------------------------------------------
|
|
9
|
+
/**
|
|
10
|
+
* Port for the server to listen on
|
|
11
|
+
* [!] Default is 3000
|
|
12
|
+
* @default 3000
|
|
13
|
+
*/
|
|
14
|
+
A_SERVER_PORT: "A_SERVER_PORT"
|
|
15
|
+
};
|
|
16
|
+
const A_SERVER_CONSTANTS__DEFAULT_ENV_VARIABLES_ARRAY = [
|
|
17
|
+
A_SERVER_CONSTANTS__DEFAULT_ENV_VARIABLES.A_SERVER_PORT
|
|
18
|
+
];
|
|
19
|
+
|
|
20
|
+
export { A_SERVER_CONSTANTS__DEFAULT_ENV_VARIABLES, A_SERVER_CONSTANTS__DEFAULT_ENV_VARIABLES_ARRAY };
|
|
21
|
+
//# sourceMappingURL=env.constants.mjs.map
|
|
22
|
+
//# sourceMappingURL=env.constants.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/constants/env.constants.ts"],"names":[],"mappings":";;AAAO,MAAM,yCAAA,GAA4C;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAWrD,aAAA,EAAe;AAEnB;AAMO,MAAM,+CAAA,GAAkD;AAAA,EAC3D,yCAAA,CAA0C;AAC9C","file":"env.constants.mjs","sourcesContent":["export const A_SERVER_CONSTANTS__DEFAULT_ENV_VARIABLES = {\n // ----------------------------------------------------------\n // A-Server Environment Variables\n // ----------------------------------------------------------\n // These environment variables are used by A-Server to configure the application\n // ----------------------------------------------------------\n /**\n * Port for the server to listen on\n * [!] Default is 3000\n * @default 3000\n */\n A_SERVER_PORT: 'A_SERVER_PORT',\n\n} as const;\n\nexport type A_TYPES__ServerENVVariables = (typeof A_SERVER_CONSTANTS__DEFAULT_ENV_VARIABLES)[keyof typeof A_SERVER_CONSTANTS__DEFAULT_ENV_VARIABLES][];\n\n\n\nexport const A_SERVER_CONSTANTS__DEFAULT_ENV_VARIABLES_ARRAY = [\n A_SERVER_CONSTANTS__DEFAULT_ENV_VARIABLES.A_SERVER_PORT,\n] as const;\n\n\n\n\n"]}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { A_Component, A_Scope, A_Container } from '@adaas/a-concept';
|
|
2
|
+
import { A as A_Request } from '../../A-Request.entity-r905O60G.mjs';
|
|
3
|
+
import { A as A_Response } from '../../A-Response.entity-6qhiV7BE.mjs';
|
|
4
|
+
import { A_Logger } from '@adaas/a-utils/a-logger';
|
|
5
|
+
import 'http';
|
|
6
|
+
import '../../lib/A-Server/A-HttpServer.error.mjs';
|
|
7
|
+
import '../../lib/A-Server/A-HttpServer.types.mjs';
|
|
8
|
+
import '../../lib/A-Server/A-HttpServer.constants.mjs';
|
|
9
|
+
import '../../lib/A-Request/A-Request.constants.mjs';
|
|
10
|
+
import '../../lib/A-Request/A-Request.env.mjs';
|
|
11
|
+
import '../../lib/A-Request/A-HttpServerRequest.context.mjs';
|
|
12
|
+
import '@adaas/a-utils/a-operation';
|
|
13
|
+
import '../../lib/A-Request/A-HttpRequestData.context.mjs';
|
|
14
|
+
import '@adaas/a-utils/a-execution';
|
|
15
|
+
import '@adaas/a-utils/a-config';
|
|
16
|
+
import '../../lib/A-ServerRoute/A-ServerRoute.entity.mjs';
|
|
17
|
+
import '@adaas/a-utils/a-route';
|
|
18
|
+
import '../../lib/A-ServerRoute/A-ServerRoute.types.mjs';
|
|
19
|
+
import '../../lib/A-ServerRoute/A-ServerRoute.constants.mjs';
|
|
20
|
+
import 'stream';
|
|
21
|
+
import '../../lib/A-Response/A-Response.constants.mjs';
|
|
22
|
+
|
|
23
|
+
declare class A_CommandController extends A_Component {
|
|
24
|
+
handleCommand(req: A_Request<any, any, {
|
|
25
|
+
command: string;
|
|
26
|
+
}>, res: A_Response, scope: A_Scope, container: A_Container, logger: A_Logger): Promise<void>;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export { A_CommandController };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { A_Component, A_Scope, A_Container } from '@adaas/a-concept';
|
|
2
|
+
import { A as A_Request } from '../../A-Request.entity-8_9MCXT2.js';
|
|
3
|
+
import { A as A_Response } from '../../A-Response.entity-bjh6bofZ.js';
|
|
4
|
+
import { A_Logger } from '@adaas/a-utils/a-logger';
|
|
5
|
+
import 'http';
|
|
6
|
+
import '../../lib/A-Server/A-HttpServer.error.js';
|
|
7
|
+
import '../../lib/A-Server/A-HttpServer.types.js';
|
|
8
|
+
import '../../lib/A-Server/A-HttpServer.constants.js';
|
|
9
|
+
import '../../lib/A-Request/A-Request.constants.js';
|
|
10
|
+
import '../../lib/A-Request/A-Request.env.js';
|
|
11
|
+
import '../../lib/A-Request/A-HttpServerRequest.context.js';
|
|
12
|
+
import '@adaas/a-utils/a-operation';
|
|
13
|
+
import '../../lib/A-Request/A-HttpRequestData.context.js';
|
|
14
|
+
import '@adaas/a-utils/a-execution';
|
|
15
|
+
import '@adaas/a-utils/a-config';
|
|
16
|
+
import '../../lib/A-ServerRoute/A-ServerRoute.entity.js';
|
|
17
|
+
import '@adaas/a-utils/a-route';
|
|
18
|
+
import '../../lib/A-ServerRoute/A-ServerRoute.types.js';
|
|
19
|
+
import '../../lib/A-ServerRoute/A-ServerRoute.constants.js';
|
|
20
|
+
import 'stream';
|
|
21
|
+
import '../../lib/A-Response/A-Response.constants.js';
|
|
22
|
+
|
|
23
|
+
declare class A_CommandController extends A_Component {
|
|
24
|
+
handleCommand(req: A_Request<any, any, {
|
|
25
|
+
command: string;
|
|
26
|
+
}>, res: A_Response, scope: A_Scope, container: A_Container, logger: A_Logger): Promise<void>;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export { A_CommandController };
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var aConcept = require('@adaas/a-concept');
|
|
4
|
+
var AServerRouter_component = require('@adaas/a-server/router/A-ServerRouter.component');
|
|
5
|
+
var ARequest_entity = require('@adaas/a-server/request/A-Request.entity');
|
|
6
|
+
var AResponse_entity = require('@adaas/a-server/response/A-Response.entity');
|
|
7
|
+
var AServer_error = require('../../lib/A-Server/A-Server.error');
|
|
8
|
+
var aLogger = require('@adaas/a-utils/a-logger');
|
|
9
|
+
|
|
10
|
+
var __defProp = Object.defineProperty;
|
|
11
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
12
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
13
|
+
var result = __getOwnPropDesc(target, key) ;
|
|
14
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
15
|
+
if (decorator = decorators[i])
|
|
16
|
+
result = (decorator(target, key, result) ) || result;
|
|
17
|
+
if (result) __defProp(target, key, result);
|
|
18
|
+
return result;
|
|
19
|
+
};
|
|
20
|
+
var __decorateParam = (index, decorator) => (target, key) => decorator(target, key, index);
|
|
21
|
+
class A_CommandController extends aConcept.A_Component {
|
|
22
|
+
async handleCommand(req, res, scope, container, logger) {
|
|
23
|
+
const commandName = req.params.command;
|
|
24
|
+
const CommandConstructor = scope.resolveConstructor(commandName);
|
|
25
|
+
if (!CommandConstructor) {
|
|
26
|
+
res.status(404);
|
|
27
|
+
throw new AServer_error.A_ServerError({
|
|
28
|
+
title: "Command Not Found",
|
|
29
|
+
description: `Command constructor for ${commandName} not found`,
|
|
30
|
+
status: 404
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
const command = new CommandConstructor(req.body);
|
|
34
|
+
scope.register(command);
|
|
35
|
+
await command.execute();
|
|
36
|
+
const serialized = command.toJSON();
|
|
37
|
+
return res.status(200).send(serialized);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
__decorateClass([
|
|
41
|
+
AServerRouter_component.A_ServerRouter.Post({
|
|
42
|
+
path: "/:command",
|
|
43
|
+
version: "v1",
|
|
44
|
+
prefix: "a-command"
|
|
45
|
+
}),
|
|
46
|
+
__decorateParam(0, aConcept.A_Inject(ARequest_entity.A_Request)),
|
|
47
|
+
__decorateParam(1, aConcept.A_Inject(AResponse_entity.A_Response)),
|
|
48
|
+
__decorateParam(2, aConcept.A_Inject(aConcept.A_Scope)),
|
|
49
|
+
__decorateParam(3, aConcept.A_Inject(aConcept.A_Container)),
|
|
50
|
+
__decorateParam(4, aConcept.A_Inject(aLogger.A_Logger))
|
|
51
|
+
], A_CommandController.prototype, "handleCommand");
|
|
52
|
+
|
|
53
|
+
exports.A_CommandController = A_CommandController;
|
|
54
|
+
//# sourceMappingURL=A-CommandController.component.js.map
|
|
55
|
+
//# sourceMappingURL=A-CommandController.component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/controllers/A-CommandController/A-CommandController.component.ts"],"names":["A_Component","A_ServerError","A_ServerRouter","A_Request","A_Response","A_Scope","A_Container","A_Logger"],"mappings":";;;;;;;;;;;;;;;;;;;;AASO,MAAM,4BAA4BA,oBAAA,CAAY;AAAA,EAOjD,MAAM,aAAA,CACmB,GAAA,EACC,GAAA,EACH,KAAA,EACI,WACH,MAAA,EACP;AAEb,IAAA,MAAM,WAAA,GAAc,IAAI,MAAA,CAAO,OAAA;AAE/B,IAAA,MAAM,kBAAA,GAAqB,KAAA,CAAM,kBAAA,CAA8B,WAAW,CAAA;AAE1E,IAAA,IAAI,CAAC,kBAAA,EAAoB;AACrB,MAAA,GAAA,CAAI,OAAO,GAAG,CAAA;AAEd,MAAA,MAAM,IAAIC,2BAAA,CAAc;AAAA,QACpB,KAAA,EAAO,mBAAA;AAAA,QACP,WAAA,EAAa,2BAA2B,WAAW,CAAA,UAAA,CAAA;AAAA,QACnD,MAAA,EAAQ;AAAA,OACX,CAAA;AAAA,IACL;AAEA,IAAA,MAAM,OAAA,GAAU,IAAI,kBAAA,CAAmB,GAAA,CAAI,IAAI,CAAA;AAE/C,IAAA,KAAA,CAAM,SAAS,OAAO,CAAA;AAEtB,IAAA,MAAM,QAAQ,OAAA,EAAQ;AAEtB,IAAA,MAAM,UAAA,GAAa,QAAQ,MAAA,EAAO;AAElC,IAAA,OAAO,GAAA,CAAI,MAAA,CAAO,GAAG,CAAA,CAAE,KAAK,UAAU,CAAA;AAAA,EAC1C;AACJ;AAhCU,eAAA,CAAA;AAAA,EALLC,uCAAe,IAAA,CAAK;AAAA,IACjB,IAAA,EAAM,WAAA;AAAA,IACN,OAAA,EAAS,IAAA;AAAA,IACT,MAAA,EAAQ;AAAA,GACX,CAAA;AAAA,EAEI,qCAASC,yBAAS,CAAA,CAAA;AAAA,EAClB,qCAASC,2BAAU,CAAA,CAAA;AAAA,EACnB,qCAASC,gBAAO,CAAA,CAAA;AAAA,EAChB,qCAASC,oBAAW,CAAA,CAAA;AAAA,EACpB,qCAASC,gBAAQ,CAAA;AAAA,CAAA,EAZb,mBAAA,CAOH,SAAA,EAAA,eAAA,CAAA","file":"A-CommandController.component.js","sourcesContent":["import { A_Component, A_Container, A_Inject, A_Scope } from \"@adaas/a-concept\";\nimport { A_ServerRouter } from \"@adaas/a-server/router/A-ServerRouter.component\";\nimport { A_Request } from \"@adaas/a-server/request/A-Request.entity\";\nimport { A_Response } from \"@adaas/a-server/response/A-Response.entity\";\nimport { A_ServerError } from \"../../lib/A-Server/A-Server.error\";\nimport { A_Logger } from \"@adaas/a-utils/a-logger\";\nimport { A_Command } from \"@adaas/a-utils/a-command\";\n\n\nexport class A_CommandController extends A_Component {\n\n @A_ServerRouter.Post({\n path: \"/:command\",\n version: \"v1\",\n prefix: \"a-command\"\n })\n async handleCommand(\n @A_Inject(A_Request) req: A_Request<any, any, { command: string }>,\n @A_Inject(A_Response) res: A_Response,\n @A_Inject(A_Scope) scope: A_Scope,\n @A_Inject(A_Container) container: A_Container,\n @A_Inject(A_Logger) logger: A_Logger,\n ): Promise<void> {\n\n const commandName = req.params.command;\n\n const CommandConstructor = scope.resolveConstructor<A_Command>(commandName);\n\n if (!CommandConstructor) {\n res.status(404);\n\n throw new A_ServerError({\n title: 'Command Not Found',\n description: `Command constructor for ${commandName} not found`,\n status: 404,\n });\n }\n\n const command = new CommandConstructor(req.body);\n\n scope.register(command);\n\n await command.execute();\n\n const serialized = command.toJSON();\n\n return res.status(200).send(serialized);\n }\n}"]}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { __decorateClass, __decorateParam } from '../../chunk-EQQGB2QZ.mjs';
|
|
2
|
+
import { A_Inject, A_Scope, A_Container, A_Component } from '@adaas/a-concept';
|
|
3
|
+
import { A_ServerRouter } from '@adaas/a-server/router/A-ServerRouter.component';
|
|
4
|
+
import { A_Request } from '@adaas/a-server/request/A-Request.entity';
|
|
5
|
+
import { A_Response } from '@adaas/a-server/response/A-Response.entity';
|
|
6
|
+
import { A_ServerError } from '../../lib/A-Server/A-Server.error';
|
|
7
|
+
import { A_Logger } from '@adaas/a-utils/a-logger';
|
|
8
|
+
|
|
9
|
+
class A_CommandController extends A_Component {
|
|
10
|
+
async handleCommand(req, res, scope, container, logger) {
|
|
11
|
+
const commandName = req.params.command;
|
|
12
|
+
const CommandConstructor = scope.resolveConstructor(commandName);
|
|
13
|
+
if (!CommandConstructor) {
|
|
14
|
+
res.status(404);
|
|
15
|
+
throw new A_ServerError({
|
|
16
|
+
title: "Command Not Found",
|
|
17
|
+
description: `Command constructor for ${commandName} not found`,
|
|
18
|
+
status: 404
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
const command = new CommandConstructor(req.body);
|
|
22
|
+
scope.register(command);
|
|
23
|
+
await command.execute();
|
|
24
|
+
const serialized = command.toJSON();
|
|
25
|
+
return res.status(200).send(serialized);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
__decorateClass([
|
|
29
|
+
A_ServerRouter.Post({
|
|
30
|
+
path: "/:command",
|
|
31
|
+
version: "v1",
|
|
32
|
+
prefix: "a-command"
|
|
33
|
+
}),
|
|
34
|
+
__decorateParam(0, A_Inject(A_Request)),
|
|
35
|
+
__decorateParam(1, A_Inject(A_Response)),
|
|
36
|
+
__decorateParam(2, A_Inject(A_Scope)),
|
|
37
|
+
__decorateParam(3, A_Inject(A_Container)),
|
|
38
|
+
__decorateParam(4, A_Inject(A_Logger))
|
|
39
|
+
], A_CommandController.prototype, "handleCommand", 1);
|
|
40
|
+
|
|
41
|
+
export { A_CommandController };
|
|
42
|
+
//# sourceMappingURL=A-CommandController.component.mjs.map
|
|
43
|
+
//# sourceMappingURL=A-CommandController.component.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/controllers/A-CommandController/A-CommandController.component.ts"],"names":[],"mappings":";;;;;;;;AASO,MAAM,4BAA4B,WAAA,CAAY;AAAA,EAOjD,MAAM,aAAA,CACmB,GAAA,EACC,GAAA,EACH,KAAA,EACI,WACH,MAAA,EACP;AAEb,IAAA,MAAM,WAAA,GAAc,IAAI,MAAA,CAAO,OAAA;AAE/B,IAAA,MAAM,kBAAA,GAAqB,KAAA,CAAM,kBAAA,CAA8B,WAAW,CAAA;AAE1E,IAAA,IAAI,CAAC,kBAAA,EAAoB;AACrB,MAAA,GAAA,CAAI,OAAO,GAAG,CAAA;AAEd,MAAA,MAAM,IAAI,aAAA,CAAc;AAAA,QACpB,KAAA,EAAO,mBAAA;AAAA,QACP,WAAA,EAAa,2BAA2B,WAAW,CAAA,UAAA,CAAA;AAAA,QACnD,MAAA,EAAQ;AAAA,OACX,CAAA;AAAA,IACL;AAEA,IAAA,MAAM,OAAA,GAAU,IAAI,kBAAA,CAAmB,GAAA,CAAI,IAAI,CAAA;AAE/C,IAAA,KAAA,CAAM,SAAS,OAAO,CAAA;AAEtB,IAAA,MAAM,QAAQ,OAAA,EAAQ;AAEtB,IAAA,MAAM,UAAA,GAAa,QAAQ,MAAA,EAAO;AAElC,IAAA,OAAO,GAAA,CAAI,MAAA,CAAO,GAAG,CAAA,CAAE,KAAK,UAAU,CAAA;AAAA,EAC1C;AACJ;AAhCU,eAAA,CAAA;AAAA,EALL,eAAe,IAAA,CAAK;AAAA,IACjB,IAAA,EAAM,WAAA;AAAA,IACN,OAAA,EAAS,IAAA;AAAA,IACT,MAAA,EAAQ;AAAA,GACX,CAAA;AAAA,EAEI,4BAAS,SAAS,CAAA,CAAA;AAAA,EAClB,4BAAS,UAAU,CAAA,CAAA;AAAA,EACnB,4BAAS,OAAO,CAAA,CAAA;AAAA,EAChB,4BAAS,WAAW,CAAA,CAAA;AAAA,EACpB,4BAAS,QAAQ,CAAA;AAAA,CAAA,EAZb,mBAAA,CAOH,SAAA,EAAA,eAAA,EAAA,CAAA,CAAA","file":"A-CommandController.component.mjs","sourcesContent":["import { A_Component, A_Container, A_Inject, A_Scope } from \"@adaas/a-concept\";\nimport { A_ServerRouter } from \"@adaas/a-server/router/A-ServerRouter.component\";\nimport { A_Request } from \"@adaas/a-server/request/A-Request.entity\";\nimport { A_Response } from \"@adaas/a-server/response/A-Response.entity\";\nimport { A_ServerError } from \"../../lib/A-Server/A-Server.error\";\nimport { A_Logger } from \"@adaas/a-utils/a-logger\";\nimport { A_Command } from \"@adaas/a-utils/a-command\";\n\n\nexport class A_CommandController extends A_Component {\n\n @A_ServerRouter.Post({\n path: \"/:command\",\n version: \"v1\",\n prefix: \"a-command\"\n })\n async handleCommand(\n @A_Inject(A_Request) req: A_Request<any, any, { command: string }>,\n @A_Inject(A_Response) res: A_Response,\n @A_Inject(A_Scope) scope: A_Scope,\n @A_Inject(A_Container) container: A_Container,\n @A_Inject(A_Logger) logger: A_Logger,\n ): Promise<void> {\n\n const commandName = req.params.command;\n\n const CommandConstructor = scope.resolveConstructor<A_Command>(commandName);\n\n if (!CommandConstructor) {\n res.status(404);\n\n throw new A_ServerError({\n title: 'Command Not Found',\n description: `Command constructor for ${commandName} not found`,\n status: 404,\n });\n }\n\n const command = new CommandConstructor(req.body);\n\n scope.register(command);\n\n await command.execute();\n\n const serialized = command.toJSON();\n\n return res.status(200).send(serialized);\n }\n}"]}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { A_Component, A_Scope } from '@adaas/a-concept';
|
|
2
|
+
import { A as A_Request } from '../../A-Request.entity-r905O60G.mjs';
|
|
3
|
+
import { A as A_Response } from '../../A-Response.entity-6qhiV7BE.mjs';
|
|
4
|
+
import { A_Config } from '@adaas/a-utils/a-config';
|
|
5
|
+
import 'http';
|
|
6
|
+
import '../../lib/A-Server/A-HttpServer.error.mjs';
|
|
7
|
+
import '../../lib/A-Server/A-HttpServer.types.mjs';
|
|
8
|
+
import '../../lib/A-Server/A-HttpServer.constants.mjs';
|
|
9
|
+
import '../../lib/A-Request/A-Request.constants.mjs';
|
|
10
|
+
import '../../lib/A-Request/A-Request.env.mjs';
|
|
11
|
+
import '../../lib/A-Request/A-HttpServerRequest.context.mjs';
|
|
12
|
+
import '@adaas/a-utils/a-operation';
|
|
13
|
+
import '../../lib/A-Request/A-HttpRequestData.context.mjs';
|
|
14
|
+
import '@adaas/a-utils/a-execution';
|
|
15
|
+
import '../../lib/A-ServerRoute/A-ServerRoute.entity.mjs';
|
|
16
|
+
import '@adaas/a-utils/a-route';
|
|
17
|
+
import '../../lib/A-ServerRoute/A-ServerRoute.types.mjs';
|
|
18
|
+
import '../../lib/A-ServerRoute/A-ServerRoute.constants.mjs';
|
|
19
|
+
import 'stream';
|
|
20
|
+
import '../../lib/A-Response/A-Response.constants.mjs';
|
|
21
|
+
|
|
22
|
+
declare class A_EntityController extends A_Component {
|
|
23
|
+
list(request: A_Request<any, any, {
|
|
24
|
+
type: string;
|
|
25
|
+
}>, response: A_Response, scope: A_Scope, config: A_Config<['A_LIST_ITEMS_PER_PAGE', 'A_LIST_PAGE']>): Promise<void>;
|
|
26
|
+
load(request: A_Request<any, any, {
|
|
27
|
+
aseid: string;
|
|
28
|
+
}>, response: A_Response, scope: A_Scope): Promise<void>;
|
|
29
|
+
create(request: A_Request<any, any, {
|
|
30
|
+
aseid: string;
|
|
31
|
+
}>, scope: A_Scope): Promise<void>;
|
|
32
|
+
update(request: A_Request<any, any, {
|
|
33
|
+
aseid: string;
|
|
34
|
+
}>, response: A_Response, scope: A_Scope): Promise<void>;
|
|
35
|
+
delete(request: A_Request<any, any, {
|
|
36
|
+
aseid: string;
|
|
37
|
+
}>, response: A_Response, scope: A_Scope): Promise<void>;
|
|
38
|
+
callEntity(request: A_Request<any, any, {
|
|
39
|
+
aseid: string;
|
|
40
|
+
action: string;
|
|
41
|
+
}>, response: A_Response, scope: A_Scope): Promise<void>;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export { A_EntityController };
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { A_Component, A_Scope } from '@adaas/a-concept';
|
|
2
|
+
import { A as A_Request } from '../../A-Request.entity-8_9MCXT2.js';
|
|
3
|
+
import { A as A_Response } from '../../A-Response.entity-bjh6bofZ.js';
|
|
4
|
+
import { A_Config } from '@adaas/a-utils/a-config';
|
|
5
|
+
import 'http';
|
|
6
|
+
import '../../lib/A-Server/A-HttpServer.error.js';
|
|
7
|
+
import '../../lib/A-Server/A-HttpServer.types.js';
|
|
8
|
+
import '../../lib/A-Server/A-HttpServer.constants.js';
|
|
9
|
+
import '../../lib/A-Request/A-Request.constants.js';
|
|
10
|
+
import '../../lib/A-Request/A-Request.env.js';
|
|
11
|
+
import '../../lib/A-Request/A-HttpServerRequest.context.js';
|
|
12
|
+
import '@adaas/a-utils/a-operation';
|
|
13
|
+
import '../../lib/A-Request/A-HttpRequestData.context.js';
|
|
14
|
+
import '@adaas/a-utils/a-execution';
|
|
15
|
+
import '../../lib/A-ServerRoute/A-ServerRoute.entity.js';
|
|
16
|
+
import '@adaas/a-utils/a-route';
|
|
17
|
+
import '../../lib/A-ServerRoute/A-ServerRoute.types.js';
|
|
18
|
+
import '../../lib/A-ServerRoute/A-ServerRoute.constants.js';
|
|
19
|
+
import 'stream';
|
|
20
|
+
import '../../lib/A-Response/A-Response.constants.js';
|
|
21
|
+
|
|
22
|
+
declare class A_EntityController extends A_Component {
|
|
23
|
+
list(request: A_Request<any, any, {
|
|
24
|
+
type: string;
|
|
25
|
+
}>, response: A_Response, scope: A_Scope, config: A_Config<['A_LIST_ITEMS_PER_PAGE', 'A_LIST_PAGE']>): Promise<void>;
|
|
26
|
+
load(request: A_Request<any, any, {
|
|
27
|
+
aseid: string;
|
|
28
|
+
}>, response: A_Response, scope: A_Scope): Promise<void>;
|
|
29
|
+
create(request: A_Request<any, any, {
|
|
30
|
+
aseid: string;
|
|
31
|
+
}>, scope: A_Scope): Promise<void>;
|
|
32
|
+
update(request: A_Request<any, any, {
|
|
33
|
+
aseid: string;
|
|
34
|
+
}>, response: A_Response, scope: A_Scope): Promise<void>;
|
|
35
|
+
delete(request: A_Request<any, any, {
|
|
36
|
+
aseid: string;
|
|
37
|
+
}>, response: A_Response, scope: A_Scope): Promise<void>;
|
|
38
|
+
callEntity(request: A_Request<any, any, {
|
|
39
|
+
aseid: string;
|
|
40
|
+
action: string;
|
|
41
|
+
}>, response: A_Response, scope: A_Scope): Promise<void>;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export { A_EntityController };
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var aConcept = require('@adaas/a-concept');
|
|
4
|
+
var ARequest_entity = require('@adaas/a-server/request/A-Request.entity');
|
|
5
|
+
var AServerRouter_component = require('@adaas/a-server/router/A-ServerRouter.component');
|
|
6
|
+
var AResponse_entity = require('@adaas/a-server/response/A-Response.entity');
|
|
7
|
+
var AServer_error = require('../../lib/A-Server/A-Server.error');
|
|
8
|
+
var AServerListQueryFilter_context = require('@adaas/a-server/list-query/A-ServerListQueryFilter.context');
|
|
9
|
+
var AEntityList_entity = require('@adaas/a-server/entity-list/A-EntityList.entity');
|
|
10
|
+
var aConfig = require('@adaas/a-utils/a-config');
|
|
11
|
+
|
|
12
|
+
var __defProp = Object.defineProperty;
|
|
13
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
14
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
15
|
+
var result = __getOwnPropDesc(target, key) ;
|
|
16
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
17
|
+
if (decorator = decorators[i])
|
|
18
|
+
result = (decorator(target, key, result) ) || result;
|
|
19
|
+
if (result) __defProp(target, key, result);
|
|
20
|
+
return result;
|
|
21
|
+
};
|
|
22
|
+
var __decorateParam = (index, decorator) => (target, key) => decorator(target, key, index);
|
|
23
|
+
class A_EntityController extends aConcept.A_Component {
|
|
24
|
+
async list(request, response, scope, config) {
|
|
25
|
+
const constructor = scope.resolveConstructor(request.params.type);
|
|
26
|
+
if (constructor) {
|
|
27
|
+
const entityList = new AEntityList_entity.A_ServerEntityList({
|
|
28
|
+
name: request.params.type,
|
|
29
|
+
scope: scope.name,
|
|
30
|
+
constructor
|
|
31
|
+
});
|
|
32
|
+
scope.register(entityList);
|
|
33
|
+
const queryFilter = new AServerListQueryFilter_context.A_ServerListQueryFilter(request.query, {
|
|
34
|
+
itemsPerPage: String(config.get("A_LIST_ITEMS_PER_PAGE") || "10"),
|
|
35
|
+
page: String(config.get("A_LIST_PAGE") || "1")
|
|
36
|
+
});
|
|
37
|
+
const queryScope = new aConcept.A_Scope({
|
|
38
|
+
fragments: [queryFilter]
|
|
39
|
+
}).inherit(scope);
|
|
40
|
+
await entityList.load(queryScope);
|
|
41
|
+
response.add("items", entityList.items);
|
|
42
|
+
response.add("pagination", entityList.pagination);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
async load(request, response, scope) {
|
|
46
|
+
console.log("Request params:", request.params);
|
|
47
|
+
if (!aConcept.ASEID.isASEID(request.params.aseid)) {
|
|
48
|
+
response.add("A_EntityController.load", "Invalid ASEID");
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
const aseid = new aConcept.ASEID(request.params.aseid);
|
|
52
|
+
const constructor = scope.resolveConstructor(aseid.entity);
|
|
53
|
+
if (constructor) {
|
|
54
|
+
const entity = new constructor(request.params.aseid);
|
|
55
|
+
scope.register(entity);
|
|
56
|
+
await entity.load();
|
|
57
|
+
return response.status(200).send(entity.toJSON());
|
|
58
|
+
} else
|
|
59
|
+
throw new AServer_error.A_ServerError({
|
|
60
|
+
title: "Entity Not Found",
|
|
61
|
+
description: `Entity constructor for ASEID ${request.params.aseid} not found`,
|
|
62
|
+
status: 404
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
async create(request, scope) {
|
|
66
|
+
const constructor = scope.resolveConstructor(request.params.aseid);
|
|
67
|
+
if (constructor) {
|
|
68
|
+
const entity = new constructor(request.body);
|
|
69
|
+
scope.register(entity);
|
|
70
|
+
await entity.save();
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
async update(request, response, scope) {
|
|
74
|
+
if (!aConcept.ASEID.isASEID(request.params.aseid)) {
|
|
75
|
+
response.add("A_EntityController.update", "Invalid ASEID");
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
const constructor = scope.resolveConstructor(request.params.aseid);
|
|
79
|
+
if (constructor) {
|
|
80
|
+
const entity = new constructor(request.body);
|
|
81
|
+
scope.register(entity);
|
|
82
|
+
await entity.save();
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
async delete(request, response, scope) {
|
|
86
|
+
if (!aConcept.ASEID.isASEID(request.params.aseid)) {
|
|
87
|
+
response.add("A_EntityController.delete", "Invalid ASEID");
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
const constructor = scope.resolveConstructor(request.params.aseid);
|
|
91
|
+
if (constructor) {
|
|
92
|
+
const entity = new constructor(request.params.aseid);
|
|
93
|
+
scope.register(entity);
|
|
94
|
+
await entity.destroy();
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
async callEntity(request, response, scope) {
|
|
98
|
+
if (!aConcept.ASEID.isASEID(request.params.aseid)) {
|
|
99
|
+
response.add("A_EntityController.callEntity", "Invalid ASEID");
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
const constructor = scope.resolveConstructor(request.params.aseid);
|
|
103
|
+
if (!constructor) {
|
|
104
|
+
response.add("A_EntityController.callEntity", "Entity not found");
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
const meta = aConcept.A_Context.meta(constructor);
|
|
108
|
+
const targetFeature = meta.features().find((f) => f.name === `${constructor.name}.${request.params.action}`);
|
|
109
|
+
if (!targetFeature) {
|
|
110
|
+
response.add("A_EntityController.callEntity", "Feature not found");
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
113
|
+
const entity = new constructor(request.params.aseid);
|
|
114
|
+
scope.register(entity);
|
|
115
|
+
await entity.load(scope);
|
|
116
|
+
await entity[targetFeature.handler](scope);
|
|
117
|
+
response.add("result", scope.toJSON());
|
|
118
|
+
response.add("entity", entity);
|
|
119
|
+
response.add("type", entity.aseid.entity);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
__decorateClass([
|
|
123
|
+
AServerRouter_component.A_ServerRouter.Get({
|
|
124
|
+
path: "/:type",
|
|
125
|
+
version: "v1",
|
|
126
|
+
prefix: "a-list"
|
|
127
|
+
}),
|
|
128
|
+
__decorateParam(0, aConcept.A_Inject(ARequest_entity.A_Request)),
|
|
129
|
+
__decorateParam(1, aConcept.A_Inject(AResponse_entity.A_Response)),
|
|
130
|
+
__decorateParam(2, aConcept.A_Inject(aConcept.A_Scope)),
|
|
131
|
+
__decorateParam(3, aConcept.A_Inject(aConfig.A_Config))
|
|
132
|
+
], A_EntityController.prototype, "list");
|
|
133
|
+
__decorateClass([
|
|
134
|
+
aConcept.A_Feature.Define({
|
|
135
|
+
name: "getEntity",
|
|
136
|
+
invoke: false
|
|
137
|
+
}),
|
|
138
|
+
AServerRouter_component.A_ServerRouter.Get({
|
|
139
|
+
path: "/:aseid",
|
|
140
|
+
version: "v1",
|
|
141
|
+
prefix: "a-entity"
|
|
142
|
+
}),
|
|
143
|
+
__decorateParam(0, aConcept.A_Inject(ARequest_entity.A_Request)),
|
|
144
|
+
__decorateParam(1, aConcept.A_Inject(AResponse_entity.A_Response)),
|
|
145
|
+
__decorateParam(2, aConcept.A_Inject(aConcept.A_Scope))
|
|
146
|
+
], A_EntityController.prototype, "load");
|
|
147
|
+
__decorateClass([
|
|
148
|
+
AServerRouter_component.A_ServerRouter.Post({
|
|
149
|
+
path: "/",
|
|
150
|
+
version: "v1",
|
|
151
|
+
prefix: "a-entity"
|
|
152
|
+
}),
|
|
153
|
+
__decorateParam(0, aConcept.A_Inject(ARequest_entity.A_Request)),
|
|
154
|
+
__decorateParam(1, aConcept.A_Inject(aConcept.A_Scope))
|
|
155
|
+
], A_EntityController.prototype, "create");
|
|
156
|
+
__decorateClass([
|
|
157
|
+
AServerRouter_component.A_ServerRouter.Put({
|
|
158
|
+
path: "/:aseid",
|
|
159
|
+
version: "v1",
|
|
160
|
+
prefix: "a-entity"
|
|
161
|
+
}),
|
|
162
|
+
__decorateParam(0, aConcept.A_Inject(ARequest_entity.A_Request)),
|
|
163
|
+
__decorateParam(1, aConcept.A_Inject(AResponse_entity.A_Response)),
|
|
164
|
+
__decorateParam(2, aConcept.A_Inject(aConcept.A_Scope))
|
|
165
|
+
], A_EntityController.prototype, "update");
|
|
166
|
+
__decorateClass([
|
|
167
|
+
AServerRouter_component.A_ServerRouter.Delete({
|
|
168
|
+
path: "/:aseid",
|
|
169
|
+
version: "v1",
|
|
170
|
+
prefix: "a-entity"
|
|
171
|
+
}),
|
|
172
|
+
__decorateParam(0, aConcept.A_Inject(ARequest_entity.A_Request)),
|
|
173
|
+
__decorateParam(1, aConcept.A_Inject(AResponse_entity.A_Response)),
|
|
174
|
+
__decorateParam(2, aConcept.A_Inject(aConcept.A_Scope))
|
|
175
|
+
], A_EntityController.prototype, "delete");
|
|
176
|
+
__decorateClass([
|
|
177
|
+
AServerRouter_component.A_ServerRouter.Post({
|
|
178
|
+
path: "/:aseid/:action",
|
|
179
|
+
version: "v1",
|
|
180
|
+
prefix: "a-entity"
|
|
181
|
+
}),
|
|
182
|
+
__decorateParam(0, aConcept.A_Inject(ARequest_entity.A_Request)),
|
|
183
|
+
__decorateParam(1, aConcept.A_Inject(AResponse_entity.A_Response)),
|
|
184
|
+
__decorateParam(2, aConcept.A_Inject(aConcept.A_Scope))
|
|
185
|
+
], A_EntityController.prototype, "callEntity");
|
|
186
|
+
|
|
187
|
+
exports.A_EntityController = A_EntityController;
|
|
188
|
+
//# sourceMappingURL=A-EntityController.component.js.map
|
|
189
|
+
//# sourceMappingURL=A-EntityController.component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/controllers/A-EntityController/A-EntityController.component.ts"],"names":["A_Component","A_ServerEntityList","A_ServerListQueryFilter","A_Scope","ASEID","A_ServerError","A_Context","A_ServerRouter","A_Request","A_Response","A_Config","A_Feature"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAWO,MAAM,2BAA2BA,oBAAA,CAAY;AAAA,EAUhD,MAAM,IAAA,CACmB,OAAA,EACC,QAAA,EACH,OACC,MAAA,EACtB;AAEE,IAAA,MAAM,WAAA,GAAc,KAAA,CAAM,kBAAA,CAAmB,OAAA,CAAQ,OAAO,IAAI,CAAA;AAEhE,IAAA,IAAI,WAAA,EAAa;AAEb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;AAAA,CAAA,EA/JZ,kBAAA,CA4JH,SAAA,EAAA,QAAA,CAAA;AAgCA,eAAA,CAAA;AAAA,EALLI,uCAAe,IAAA,CAAK;AAAA,IACjB,IAAA,EAAM,iBAAA;AAAA,IACN,OAAA,EAAS,IAAA;AAAA,IACT,MAAA,EAAQ;AAAA,GACX,CAAA;AAAA,EAEI,qCAASC,yBAAS,CAAA,CAAA;AAAA,EAClB,qCAASC,2BAAU,CAAA,CAAA;AAAA,EACnB,qCAASN,gBAAO,CAAA;AAAA,CAAA,EA/LZ,kBAAA,CA4LH,SAAA,EAAA,YAAA,CAAA","file":"A-EntityController.component.js","sourcesContent":["import { A_Component, A_Context, A_Feature, A_Inject, A_Scope, A_TYPES__Entity_Constructor, ASEID } from \"@adaas/a-concept\";\nimport { A_Request } from \"@adaas/a-server/request/A-Request.entity\";\nimport { A_ServerRouter } from \"@adaas/a-server/router/A-ServerRouter.component\";\nimport { A_Response } from \"@adaas/a-server/response/A-Response.entity\";\nimport { A_ServerError } from \"../../lib/A-Server/A-Server.error\";\nimport { A_ServerListQueryFilter } from \"@adaas/a-server/list-query/A-ServerListQueryFilter.context\";\nimport { A_ServerEntityList } from \"@adaas/a-server/entity-list/A-EntityList.entity\";\nimport { A_Config } from \"@adaas/a-utils/a-config\";\n\n\n\nexport class A_EntityController extends A_Component {\n\n // =======================================================\n // ================ Method Definition=====================\n // =======================================================\n @A_ServerRouter.Get({\n path: '/:type',\n version: 'v1',\n prefix: 'a-list'\n })\n async list(\n @A_Inject(A_Request) request: A_Request<any, any, { type: string }>,\n @A_Inject(A_Response) response: A_Response,\n @A_Inject(A_Scope) scope: A_Scope,\n @A_Inject(A_Config) config: A_Config<['A_LIST_ITEMS_PER_PAGE', 'A_LIST_PAGE']>\n ) {\n\n const constructor = scope.resolveConstructor(request.params.type);\n\n if (constructor) {\n\n const entityList = new A_ServerEntityList({\n name: request.params.type,\n scope: scope.name,\n constructor\n });\n\n scope.register(entityList);\n\n const queryFilter = new A_ServerListQueryFilter(request.query, {\n itemsPerPage: String(config.get('A_LIST_ITEMS_PER_PAGE') || '10'),\n page: String(config.get('A_LIST_PAGE') || '1')\n });\n\n const queryScope = new A_Scope({\n fragments: [queryFilter]\n }).inherit(scope);\n\n await entityList.load(queryScope);\n\n response.add('items', entityList.items);\n response.add('pagination', entityList.pagination);\n }\n }\n\n\n @A_Feature.Define({\n name: 'getEntity',\n invoke: false\n })\n @A_ServerRouter.Get({\n path: '/:aseid',\n version: 'v1',\n prefix: 'a-entity'\n })\n async load(\n @A_Inject(A_Request) request: A_Request<any, any, { aseid: string }>,\n @A_Inject(A_Response) response: A_Response,\n @A_Inject(A_Scope) scope: A_Scope\n ) {\n // Check if the scope has a manifest and if the entity is allowed to save\n // if (\n // scope.has(A_Manifest) && !scope.resolve(A_Manifest)\n // .isAllowed(entity.constructor, 'save')\n // .for(entity.constructor as A_TYPES__Entity_Constructor)\n // )\n // return;\n\n\n console.log('Request params:', request.params);\n\n\n if (!ASEID.isASEID(request.params.aseid)) {\n response.add('A_EntityController.load', 'Invalid ASEID');\n return;\n }\n\n\n const aseid = new ASEID(request.params.aseid);\n\n const constructor = scope.resolveConstructor(aseid.entity);\n\n\n if (constructor) {\n const entity = new constructor(request.params.aseid);\n\n scope.register(entity);\n\n await entity.load();\n\n return response.status(200).send(entity.toJSON());\n }\n else\n throw new A_ServerError({\n title: 'Entity Not Found',\n description: `Entity constructor for ASEID ${request.params.aseid} not found`,\n status: 404,\n });\n }\n\n\n\n @A_ServerRouter.Post({\n path: '/',\n version: 'v1',\n prefix: 'a-entity'\n })\n async create(\n @A_Inject(A_Request) request: A_Request<any, any, { aseid: string }>,\n @A_Inject(A_Scope) scope: A_Scope\n ) {\n const constructor = scope.resolveConstructor(request.params.aseid);\n\n if (constructor) {\n const entity = new constructor(request.body);\n\n scope.register(entity);\n\n await entity.save();\n }\n }\n\n\n\n @A_ServerRouter.Put({\n path: '/:aseid',\n version: 'v1',\n prefix: 'a-entity'\n })\n async update(\n @A_Inject(A_Request) request: A_Request<any, any, { aseid: string }>,\n @A_Inject(A_Response) response: A_Response,\n @A_Inject(A_Scope) scope: A_Scope\n ) {\n if (!ASEID.isASEID(request.params.aseid)) {\n response.add('A_EntityController.update', 'Invalid ASEID');\n return;\n }\n\n const constructor = scope.resolveConstructor(request.params.aseid);\n\n if (constructor) {\n const entity = new constructor(request.body);\n\n scope.register(entity);\n\n await entity.save();\n }\n }\n\n\n @A_ServerRouter.Delete({\n path: '/:aseid',\n version: 'v1',\n prefix: 'a-entity'\n })\n async delete(\n @A_Inject(A_Request) request: A_Request<any, any, { aseid: string }>,\n @A_Inject(A_Response) response: A_Response,\n @A_Inject(A_Scope) scope: A_Scope\n ) {\n if (!ASEID.isASEID(request.params.aseid)) {\n response.add('A_EntityController.delete', 'Invalid ASEID');\n return;\n }\n\n const constructor = scope.resolveConstructor(request.params.aseid);\n\n if (constructor) {\n const entity = new constructor(request.params.aseid);\n\n scope.register(entity);\n\n await entity.destroy();\n }\n }\n\n\n\n // @A_Feature.Define({\n // name: 'callEntity',\n // invoke: false\n // })\n @A_ServerRouter.Post({\n path: '/:aseid/:action',\n version: 'v1',\n prefix: 'a-entity'\n })\n async callEntity(\n @A_Inject(A_Request) request: A_Request<any, any, { aseid: string, action: string }>,\n @A_Inject(A_Response) response: A_Response,\n @A_Inject(A_Scope) scope: A_Scope\n ) {\n if (!ASEID.isASEID(request.params.aseid)) {\n response.add('A_EntityController.callEntity', 'Invalid ASEID');\n return;\n }\n\n const constructor = scope.resolveConstructor(request.params.aseid);\n\n if (!constructor) {\n response.add('A_EntityController.callEntity', 'Entity not found');\n return;\n }\n\n const meta = A_Context.meta(constructor);\n\n const targetFeature = meta.features().find(f => f.name === `${constructor.name}.${request.params.action}`);\n\n if (!targetFeature) {\n response.add('A_EntityController.callEntity', 'Feature not found');\n return;\n }\n\n const entity = new constructor(request.params.aseid);\n\n scope.register(entity);\n\n await entity.load(scope);\n\n await entity[targetFeature.handler](scope);\n\n response.add('result', scope.toJSON());\n response.add('entity', entity);\n response.add('type', entity.aseid.entity);\n }\n}"]}
|