@adaas/a-server 0.0.21 → 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 -59
- 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/lib/A-ServerStatic/A-ServerStatic.component.ts +323 -0
- package/src/lib/A-ServerStatic/A-ServerStatic.context.ts +229 -0
- 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 -739
- package/dist/index.d.ts +0 -739
- package/dist/index.js +0 -1904
- package/dist/index.js.map +0 -1
- package/dist/index.mjs +0 -1863
- 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/components/A-StaticLoader/A-StaticLoader.component.ts +0 -133
- package/src/containers/A-Service/A-Service.container.ts +0 -202
- 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/context/A-StaticConfig/A-StaticConfig.context.ts +0 -36
- 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
package/dist/index.mjs
DELETED
|
@@ -1,1863 +0,0 @@
|
|
|
1
|
-
import { A_Concept, A_Inject, A_Feature, A_Scope, A_Container, A_Caller, A_Error, A_Entity, ASEID, A_Context, A_IdentityHelper, A_Fragment, A_Component, A_Feature_Define, A_Feature_Extend, A_TypeGuards } from '@adaas/a-concept';
|
|
2
|
-
import { A_Polyfill, A_Config, A_Logger, A_Channel, A_Manifest } from '@adaas/a-utils';
|
|
3
|
-
import crypto from 'crypto';
|
|
4
|
-
import fs from 'fs';
|
|
5
|
-
import path from 'path';
|
|
6
|
-
import { URL as URL$1 } from 'url';
|
|
7
|
-
import { A_TYPES__EntityFeatures } from '@adaas/a-concept/dist/src/global/A-Entity/A-Entity.constants';
|
|
8
|
-
|
|
9
|
-
var __defProp = Object.defineProperty;
|
|
10
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
11
|
-
var __decorateClass = (decorators, target, key, kind) => {
|
|
12
|
-
var result = __getOwnPropDesc(target, key) ;
|
|
13
|
-
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
14
|
-
if (decorator = decorators[i])
|
|
15
|
-
result = (decorator(target, key, result) ) || result;
|
|
16
|
-
if (result) __defProp(target, key, result);
|
|
17
|
-
return result;
|
|
18
|
-
};
|
|
19
|
-
var __decorateParam = (index, decorator) => (target, key) => decorator(target, key, index);
|
|
20
|
-
|
|
21
|
-
// src/containers/A-Service/A-Service.container.types.ts
|
|
22
|
-
var A_SERVER_TYPES__ServerFeature = /* @__PURE__ */ ((A_SERVER_TYPES__ServerFeature2) => {
|
|
23
|
-
A_SERVER_TYPES__ServerFeature2["beforeStart"] = "beforeStart";
|
|
24
|
-
A_SERVER_TYPES__ServerFeature2["afterStart"] = "afterStart";
|
|
25
|
-
A_SERVER_TYPES__ServerFeature2["beforeStop"] = "beforeStop";
|
|
26
|
-
A_SERVER_TYPES__ServerFeature2["afterStop"] = "afterStop";
|
|
27
|
-
A_SERVER_TYPES__ServerFeature2["beforeRequest"] = "beforeRequest";
|
|
28
|
-
A_SERVER_TYPES__ServerFeature2["onRequest"] = "onRequest";
|
|
29
|
-
A_SERVER_TYPES__ServerFeature2["afterRequest"] = "afterRequest";
|
|
30
|
-
return A_SERVER_TYPES__ServerFeature2;
|
|
31
|
-
})(A_SERVER_TYPES__ServerFeature || {});
|
|
32
|
-
var A_SERVER_TYPES__ServerMethod = /* @__PURE__ */ ((A_SERVER_TYPES__ServerMethod2) => {
|
|
33
|
-
A_SERVER_TYPES__ServerMethod2["GET"] = "GET";
|
|
34
|
-
A_SERVER_TYPES__ServerMethod2["POST"] = "POST";
|
|
35
|
-
A_SERVER_TYPES__ServerMethod2["PUT"] = "PUT";
|
|
36
|
-
A_SERVER_TYPES__ServerMethod2["DELETE"] = "DELETE";
|
|
37
|
-
A_SERVER_TYPES__ServerMethod2["PATCH"] = "PATCH";
|
|
38
|
-
A_SERVER_TYPES__ServerMethod2["OPTIONS"] = "OPTIONS";
|
|
39
|
-
A_SERVER_TYPES__ServerMethod2["HEAD"] = "HEAD";
|
|
40
|
-
A_SERVER_TYPES__ServerMethod2["CONNECT"] = "CONNECT";
|
|
41
|
-
A_SERVER_TYPES__ServerMethod2["TRACE"] = "TRACE";
|
|
42
|
-
A_SERVER_TYPES__ServerMethod2["DEFAULT"] = "DEFAULT";
|
|
43
|
-
return A_SERVER_TYPES__ServerMethod2;
|
|
44
|
-
})(A_SERVER_TYPES__ServerMethod || {});
|
|
45
|
-
var A_HTTPChannel_RequestContext = class extends A_Fragment {
|
|
46
|
-
constructor(params) {
|
|
47
|
-
super();
|
|
48
|
-
const {
|
|
49
|
-
method,
|
|
50
|
-
url,
|
|
51
|
-
data,
|
|
52
|
-
config
|
|
53
|
-
} = params;
|
|
54
|
-
this.url = url;
|
|
55
|
-
this.method = method;
|
|
56
|
-
this.data = data;
|
|
57
|
-
this.config = config;
|
|
58
|
-
}
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
// src/channels/A-Http/A-Http.channel.constants.ts
|
|
62
|
-
var A_SERVER_CONSTANTS__A_HttpChannel_Lifecycle = /* @__PURE__ */ ((A_SERVER_CONSTANTS__A_HttpChannel_Lifecycle2) => {
|
|
63
|
-
A_SERVER_CONSTANTS__A_HttpChannel_Lifecycle2["onAfterRequest"] = "onAfterHttpChannelRequest";
|
|
64
|
-
A_SERVER_CONSTANTS__A_HttpChannel_Lifecycle2["onError"] = "onHttpChannelError";
|
|
65
|
-
A_SERVER_CONSTANTS__A_HttpChannel_Lifecycle2["onBeforeRequest"] = "onBeforeHttpChannelRequest";
|
|
66
|
-
return A_SERVER_CONSTANTS__A_HttpChannel_Lifecycle2;
|
|
67
|
-
})(A_SERVER_CONSTANTS__A_HttpChannel_Lifecycle || {});
|
|
68
|
-
var A_ServerError = class extends A_Error {
|
|
69
|
-
constructor() {
|
|
70
|
-
super(...arguments);
|
|
71
|
-
this.status = 500;
|
|
72
|
-
}
|
|
73
|
-
// constructor(
|
|
74
|
-
// /**
|
|
75
|
-
// * A_Error Constructor params
|
|
76
|
-
// */
|
|
77
|
-
// params: A_SERVER_TYPES__ServerError_Init
|
|
78
|
-
// )
|
|
79
|
-
// constructor(
|
|
80
|
-
// /**
|
|
81
|
-
// * HTTP Status Code of the error
|
|
82
|
-
// */
|
|
83
|
-
// status: number,
|
|
84
|
-
// /**
|
|
85
|
-
// * Error message
|
|
86
|
-
// */
|
|
87
|
-
// message: string
|
|
88
|
-
// )
|
|
89
|
-
// constructor(
|
|
90
|
-
// /**
|
|
91
|
-
// * Original JS Error
|
|
92
|
-
// */
|
|
93
|
-
// error: Error
|
|
94
|
-
// )
|
|
95
|
-
// constructor(
|
|
96
|
-
// /**
|
|
97
|
-
// * HTTP Status Code of the error
|
|
98
|
-
// */
|
|
99
|
-
// status: number,
|
|
100
|
-
// /**
|
|
101
|
-
// * Error message
|
|
102
|
-
// */
|
|
103
|
-
// title: string,
|
|
104
|
-
// /**
|
|
105
|
-
// * Detailed description of the error
|
|
106
|
-
// */
|
|
107
|
-
// description: string
|
|
108
|
-
// )
|
|
109
|
-
// constructor(
|
|
110
|
-
// param1: A_SERVER_TYPES__ServerError_Init | Error | string | A_Error | number,
|
|
111
|
-
// param2?: string | A_Error,
|
|
112
|
-
// param3?: string
|
|
113
|
-
// ) {
|
|
114
|
-
// switch (true) {
|
|
115
|
-
// case typeof param1 === 'number':
|
|
116
|
-
// if (typeof param2 === 'string' && param3) {
|
|
117
|
-
// super({
|
|
118
|
-
// title: param2,
|
|
119
|
-
// description: param3
|
|
120
|
-
// });
|
|
121
|
-
// }
|
|
122
|
-
// else if (param2 instanceof A_Error) {
|
|
123
|
-
// super(param2);
|
|
124
|
-
// }
|
|
125
|
-
// else {
|
|
126
|
-
// super();
|
|
127
|
-
// }
|
|
128
|
-
// this.status = param1;
|
|
129
|
-
// break;
|
|
130
|
-
// case param1 instanceof A_Error:
|
|
131
|
-
// super (param1);
|
|
132
|
-
// break;
|
|
133
|
-
// case param1 instanceof Error:
|
|
134
|
-
// super (param1);
|
|
135
|
-
// break;
|
|
136
|
-
// default:
|
|
137
|
-
// break;
|
|
138
|
-
// }
|
|
139
|
-
// }
|
|
140
|
-
fromConstructor(params) {
|
|
141
|
-
super.fromConstructor(params);
|
|
142
|
-
if (params.status) {
|
|
143
|
-
this.status = params.status;
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
toJSON() {
|
|
147
|
-
return {
|
|
148
|
-
...super.toJSON(),
|
|
149
|
-
status: this.status
|
|
150
|
-
};
|
|
151
|
-
}
|
|
152
|
-
};
|
|
153
|
-
var A_HTTPChannelError = class extends A_Error {
|
|
154
|
-
};
|
|
155
|
-
A_HTTPChannelError.HttpRequestError = "HTTP Channel Request Error";
|
|
156
|
-
|
|
157
|
-
// src/channels/A-Http/A-Http.channel.ts
|
|
158
|
-
var A_HTTPChannel = class extends A_Channel {
|
|
159
|
-
async connect() {
|
|
160
|
-
return;
|
|
161
|
-
}
|
|
162
|
-
/**
|
|
163
|
-
* Allows to send an HTTP request without expecting a response
|
|
164
|
-
*
|
|
165
|
-
* @param params
|
|
166
|
-
*/
|
|
167
|
-
async send(params) {
|
|
168
|
-
this.request(params);
|
|
169
|
-
}
|
|
170
|
-
/**
|
|
171
|
-
* Makes an HTTP request
|
|
172
|
-
*
|
|
173
|
-
* @param params
|
|
174
|
-
* @returns
|
|
175
|
-
*/
|
|
176
|
-
async request(params) {
|
|
177
|
-
const { method, url, data, config } = params;
|
|
178
|
-
await this.initialize;
|
|
179
|
-
this._processing = true;
|
|
180
|
-
const fullUrl = this.buildURL(url, config?.params);
|
|
181
|
-
const requestScope = new A_Scope({ name: `a-http-channel-request-scope-${method}-${url}-${Date.now()}` });
|
|
182
|
-
const context = new A_HTTPChannel_RequestContext({
|
|
183
|
-
method,
|
|
184
|
-
url,
|
|
185
|
-
data,
|
|
186
|
-
config
|
|
187
|
-
});
|
|
188
|
-
requestScope.inherit(A_Context.scope(this));
|
|
189
|
-
requestScope.register(context);
|
|
190
|
-
try {
|
|
191
|
-
await this.call("onBeforeHttpChannelRequest" /* onBeforeRequest */, requestScope);
|
|
192
|
-
const headers = {
|
|
193
|
-
"Content-Type": "application/json",
|
|
194
|
-
...config?.headers
|
|
195
|
-
};
|
|
196
|
-
const options = {
|
|
197
|
-
method,
|
|
198
|
-
headers
|
|
199
|
-
};
|
|
200
|
-
if (data && method !== "GET" /* GET */) {
|
|
201
|
-
options.body = JSON.stringify(data);
|
|
202
|
-
}
|
|
203
|
-
const response = await fetch(fullUrl, options);
|
|
204
|
-
if (!response.ok) {
|
|
205
|
-
throw new A_ServerError({
|
|
206
|
-
status: response.status,
|
|
207
|
-
title: response.statusText,
|
|
208
|
-
description: `HTTP request to ${fullUrl} failed with status ${response.status}`
|
|
209
|
-
});
|
|
210
|
-
}
|
|
211
|
-
context.result = config?.params?.responseType === "text" ? await response.text() : config?.params?.responseType === "blob" ? await response.blob() : await response.json();
|
|
212
|
-
await this.call("onAfterHttpChannelRequest" /* onAfterRequest */, requestScope);
|
|
213
|
-
this._processing = false;
|
|
214
|
-
return context;
|
|
215
|
-
} catch (error) {
|
|
216
|
-
this._processing = false;
|
|
217
|
-
context.error = error;
|
|
218
|
-
await this.call("onHttpChannelError" /* onError */, requestScope);
|
|
219
|
-
if (config?.throwOnError === false)
|
|
220
|
-
return context;
|
|
221
|
-
else
|
|
222
|
-
throw error;
|
|
223
|
-
}
|
|
224
|
-
}
|
|
225
|
-
async post(url, body, config) {
|
|
226
|
-
return this.request(
|
|
227
|
-
{
|
|
228
|
-
method: "POST" /* POST */,
|
|
229
|
-
url,
|
|
230
|
-
data: body,
|
|
231
|
-
config
|
|
232
|
-
}
|
|
233
|
-
);
|
|
234
|
-
}
|
|
235
|
-
async get(url, params, config) {
|
|
236
|
-
return this.request(
|
|
237
|
-
{
|
|
238
|
-
method: "GET" /* GET */,
|
|
239
|
-
url,
|
|
240
|
-
config: {
|
|
241
|
-
...config,
|
|
242
|
-
params
|
|
243
|
-
}
|
|
244
|
-
}
|
|
245
|
-
);
|
|
246
|
-
}
|
|
247
|
-
async put(url, body, config) {
|
|
248
|
-
return this.request({
|
|
249
|
-
method: "PUT" /* PUT */,
|
|
250
|
-
url,
|
|
251
|
-
data: body,
|
|
252
|
-
config
|
|
253
|
-
});
|
|
254
|
-
}
|
|
255
|
-
async delete(url, params, config) {
|
|
256
|
-
return this.request({
|
|
257
|
-
method: "DELETE" /* DELETE */,
|
|
258
|
-
url,
|
|
259
|
-
data: params,
|
|
260
|
-
config
|
|
261
|
-
});
|
|
262
|
-
}
|
|
263
|
-
buildURL(path2 = "", params = {}) {
|
|
264
|
-
if (!this.baseUrl)
|
|
265
|
-
throw new A_HTTPChannelError(
|
|
266
|
-
A_HTTPChannelError.HttpRequestError,
|
|
267
|
-
"Base URL is not set for HTTP Channel"
|
|
268
|
-
);
|
|
269
|
-
const url = new URL(`${this.baseUrl}${path2.startsWith("/") ? path2 : `/${path2}`}`);
|
|
270
|
-
Object.keys(params).forEach((key) => {
|
|
271
|
-
if (params[key] !== void 0 && params[key] !== null) {
|
|
272
|
-
url.searchParams.append(key, params[key]);
|
|
273
|
-
}
|
|
274
|
-
});
|
|
275
|
-
return url.toString();
|
|
276
|
-
}
|
|
277
|
-
};
|
|
278
|
-
|
|
279
|
-
// src/constants/env.constants.ts
|
|
280
|
-
var A_SERVER_CONSTANTS__DEFAULT_ENV_VARIABLES = {
|
|
281
|
-
// ----------------------------------------------------------
|
|
282
|
-
// A-Server Environment Variables
|
|
283
|
-
// ----------------------------------------------------------
|
|
284
|
-
// These environment variables are used by A-Server to configure the application
|
|
285
|
-
// ----------------------------------------------------------
|
|
286
|
-
/**
|
|
287
|
-
* Port for the server to listen on
|
|
288
|
-
* [!] Default is 3000
|
|
289
|
-
* @default 3000
|
|
290
|
-
*/
|
|
291
|
-
A_SERVER_PORT: "A_SERVER_PORT"
|
|
292
|
-
};
|
|
293
|
-
var A_SERVER_CONSTANTS__DEFAULT_ENV_VARIABLES_ARRAY = [
|
|
294
|
-
A_SERVER_CONSTANTS__DEFAULT_ENV_VARIABLES.A_SERVER_PORT
|
|
295
|
-
];
|
|
296
|
-
var A_Server = class extends A_Fragment {
|
|
297
|
-
constructor(params) {
|
|
298
|
-
super(params);
|
|
299
|
-
this._routes = [];
|
|
300
|
-
this.port = params.port;
|
|
301
|
-
this.name = params.name;
|
|
302
|
-
this.version = params.version || "v1";
|
|
303
|
-
this._routes = params.routes || this._routes;
|
|
304
|
-
}
|
|
305
|
-
/**
|
|
306
|
-
* A list of routes that the server will listen to
|
|
307
|
-
*/
|
|
308
|
-
get routes() {
|
|
309
|
-
return this._routes;
|
|
310
|
-
}
|
|
311
|
-
};
|
|
312
|
-
|
|
313
|
-
// src/entities/A-Request/A-Request.entity.types.ts
|
|
314
|
-
var A_SERVER_TYPES__RequestEvent = /* @__PURE__ */ ((A_SERVER_TYPES__RequestEvent2) => {
|
|
315
|
-
A_SERVER_TYPES__RequestEvent2["Error"] = "error";
|
|
316
|
-
A_SERVER_TYPES__RequestEvent2["Finish"] = "finish";
|
|
317
|
-
A_SERVER_TYPES__RequestEvent2["Data"] = "data";
|
|
318
|
-
A_SERVER_TYPES__RequestEvent2["End"] = "end";
|
|
319
|
-
A_SERVER_TYPES__RequestEvent2["Close"] = "close";
|
|
320
|
-
return A_SERVER_TYPES__RequestEvent2;
|
|
321
|
-
})(A_SERVER_TYPES__RequestEvent || {});
|
|
322
|
-
|
|
323
|
-
// src/entities/A-Route/A-Route.entity.ts
|
|
324
|
-
var A_Route = class {
|
|
325
|
-
constructor(param1, param2) {
|
|
326
|
-
this.url = param1 instanceof RegExp ? param1.source : param1;
|
|
327
|
-
this.method = param2 || "GET";
|
|
328
|
-
}
|
|
329
|
-
/**
|
|
330
|
-
* returns path only without query and hash
|
|
331
|
-
*/
|
|
332
|
-
get path() {
|
|
333
|
-
const p = this.url.split("?")[0].split("#")[0];
|
|
334
|
-
return p.endsWith("/") ? p.slice(0, -1) : p;
|
|
335
|
-
}
|
|
336
|
-
get params() {
|
|
337
|
-
return this.path.match(/:([^\/]+)/g)?.map((param) => param.slice(1)) || [];
|
|
338
|
-
}
|
|
339
|
-
extractParams(url) {
|
|
340
|
-
const cleanUrl = url.split("?")[0];
|
|
341
|
-
const urlSegments = cleanUrl.split("/").filter(Boolean);
|
|
342
|
-
const maskSegments = this.path.split("/").filter(Boolean);
|
|
343
|
-
const params = {};
|
|
344
|
-
for (let i = 0; i < maskSegments.length; i++) {
|
|
345
|
-
const maskSegment = maskSegments[i];
|
|
346
|
-
const urlSegment = urlSegments[i];
|
|
347
|
-
if (maskSegment.startsWith(":")) {
|
|
348
|
-
const paramName = maskSegment.slice(1);
|
|
349
|
-
params[paramName] = urlSegment;
|
|
350
|
-
} else if (maskSegment !== urlSegment) {
|
|
351
|
-
return {};
|
|
352
|
-
}
|
|
353
|
-
}
|
|
354
|
-
return params;
|
|
355
|
-
}
|
|
356
|
-
extractQuery(url) {
|
|
357
|
-
const query = {};
|
|
358
|
-
const queryString = url.split("?")[1];
|
|
359
|
-
if (!queryString) return query;
|
|
360
|
-
const cleanQuery = queryString.split("#")[0];
|
|
361
|
-
for (const pair of cleanQuery.split("&")) {
|
|
362
|
-
if (!pair) continue;
|
|
363
|
-
const [key, value = ""] = pair.split("=");
|
|
364
|
-
query[decodeURIComponent(key)] = decodeURIComponent(value);
|
|
365
|
-
}
|
|
366
|
-
return query;
|
|
367
|
-
}
|
|
368
|
-
toString() {
|
|
369
|
-
return `${this.method}::${this.path}`;
|
|
370
|
-
}
|
|
371
|
-
toRegExp() {
|
|
372
|
-
return new RegExp(`^${this.method}::${this.path.replace(/\/:([^\/]+)/g, "/([^/]+)")}$`);
|
|
373
|
-
}
|
|
374
|
-
toAFeatureExtension(extensionScope = []) {
|
|
375
|
-
return new RegExp(`^${extensionScope.length ? `(${extensionScope.join("|")})` : ".*"}\\.${this.method}::${this.path.replace(/\/:([^\/]+)/g, "/([^/]+)")}$`);
|
|
376
|
-
}
|
|
377
|
-
};
|
|
378
|
-
|
|
379
|
-
// src/entities/A-Request/A-Request.entity.ts
|
|
380
|
-
var A_Request = class extends A_Entity {
|
|
381
|
-
constructor() {
|
|
382
|
-
super(...arguments);
|
|
383
|
-
this.body = {};
|
|
384
|
-
this.params = {};
|
|
385
|
-
this.query = {};
|
|
386
|
-
/**
|
|
387
|
-
* Duration of the request in milliseconds
|
|
388
|
-
*/
|
|
389
|
-
this.duration = 0;
|
|
390
|
-
}
|
|
391
|
-
static get namespace() {
|
|
392
|
-
return "a-server";
|
|
393
|
-
}
|
|
394
|
-
fromNew(newEntity) {
|
|
395
|
-
this.req = newEntity.request;
|
|
396
|
-
this.aseid = new ASEID({
|
|
397
|
-
concept: A_Context.root.name,
|
|
398
|
-
scope: newEntity.scope,
|
|
399
|
-
entity: this.constructor.entity,
|
|
400
|
-
id: newEntity.id
|
|
401
|
-
});
|
|
402
|
-
}
|
|
403
|
-
get startedAt() {
|
|
404
|
-
const timeId = A_IdentityHelper.parseTimeId(this.aseid.id.split("-")[0]);
|
|
405
|
-
return timeId ? new Date(timeId.timestamp) : void 0;
|
|
406
|
-
}
|
|
407
|
-
// Getter for request URL
|
|
408
|
-
get url() {
|
|
409
|
-
return this.req.url;
|
|
410
|
-
}
|
|
411
|
-
// Getter for request method
|
|
412
|
-
get method() {
|
|
413
|
-
return String(this.req.method).toUpperCase() || "DEFAULT";
|
|
414
|
-
}
|
|
415
|
-
get headers() {
|
|
416
|
-
return this.req.headers;
|
|
417
|
-
}
|
|
418
|
-
get route() {
|
|
419
|
-
return new A_Route(this.url, this.method);
|
|
420
|
-
}
|
|
421
|
-
pipe(destination, options) {
|
|
422
|
-
return this.req.pipe(destination, options);
|
|
423
|
-
}
|
|
424
|
-
async init() {
|
|
425
|
-
this.req.on("error", async (err) => {
|
|
426
|
-
this.error = new A_ServerError(err);
|
|
427
|
-
await this.call("error" /* Error */);
|
|
428
|
-
});
|
|
429
|
-
this.params = this.extractParams(this.url);
|
|
430
|
-
this.query = this.extractQuery(this.url);
|
|
431
|
-
}
|
|
432
|
-
extractParams(url) {
|
|
433
|
-
const cleanUrl = url.split("?")[0];
|
|
434
|
-
const urlSegments = cleanUrl.split("/").filter(Boolean);
|
|
435
|
-
const maskSegments = this.url.split("/").filter(Boolean);
|
|
436
|
-
const params = {};
|
|
437
|
-
for (let i = 0; i < maskSegments.length; i++) {
|
|
438
|
-
const maskSegment = maskSegments[i];
|
|
439
|
-
const urlSegment = urlSegments[i];
|
|
440
|
-
if (maskSegment.startsWith(":")) {
|
|
441
|
-
const paramName = maskSegment.slice(1);
|
|
442
|
-
params[paramName] = urlSegment;
|
|
443
|
-
} else if (maskSegment !== urlSegment) {
|
|
444
|
-
return {};
|
|
445
|
-
}
|
|
446
|
-
}
|
|
447
|
-
return params;
|
|
448
|
-
}
|
|
449
|
-
extractQuery(url) {
|
|
450
|
-
const query = {};
|
|
451
|
-
const queryString = url.split("?")[1];
|
|
452
|
-
if (!queryString) return query;
|
|
453
|
-
const cleanQuery = queryString.split("#")[0];
|
|
454
|
-
for (const pair of cleanQuery.split("&")) {
|
|
455
|
-
if (!pair) continue;
|
|
456
|
-
const [key, value = ""] = pair.split("=");
|
|
457
|
-
query[decodeURIComponent(key)] = decodeURIComponent(value);
|
|
458
|
-
}
|
|
459
|
-
return query;
|
|
460
|
-
}
|
|
461
|
-
parseBody() {
|
|
462
|
-
return new Promise((resolve, reject) => {
|
|
463
|
-
let body = "";
|
|
464
|
-
this.req.on("data", (chunk) => body += chunk);
|
|
465
|
-
this.req.on("end", () => {
|
|
466
|
-
try {
|
|
467
|
-
resolve(JSON.parse(body));
|
|
468
|
-
} catch (err) {
|
|
469
|
-
reject(err);
|
|
470
|
-
}
|
|
471
|
-
});
|
|
472
|
-
this.req.on("error", reject);
|
|
473
|
-
});
|
|
474
|
-
}
|
|
475
|
-
};
|
|
476
|
-
|
|
477
|
-
// src/entities/A-Response/A-Response.entity.types.ts
|
|
478
|
-
var A_SERVER_TYPES__ResponseEvent = /* @__PURE__ */ ((A_SERVER_TYPES__ResponseEvent2) => {
|
|
479
|
-
A_SERVER_TYPES__ResponseEvent2["Error"] = "error";
|
|
480
|
-
A_SERVER_TYPES__ResponseEvent2["Finish"] = "finish";
|
|
481
|
-
A_SERVER_TYPES__ResponseEvent2["Data"] = "data";
|
|
482
|
-
A_SERVER_TYPES__ResponseEvent2["End"] = "end";
|
|
483
|
-
A_SERVER_TYPES__ResponseEvent2["Close"] = "close";
|
|
484
|
-
return A_SERVER_TYPES__ResponseEvent2;
|
|
485
|
-
})(A_SERVER_TYPES__ResponseEvent || {});
|
|
486
|
-
var A_Response = class extends A_Entity {
|
|
487
|
-
constructor() {
|
|
488
|
-
super(...arguments);
|
|
489
|
-
/**
|
|
490
|
-
* Duration of the request in milliseconds
|
|
491
|
-
*/
|
|
492
|
-
this.duration = 0;
|
|
493
|
-
this.data = /* @__PURE__ */ new Map();
|
|
494
|
-
}
|
|
495
|
-
fromNew(newEntity) {
|
|
496
|
-
this.res = newEntity.response;
|
|
497
|
-
this.aseid = new ASEID({
|
|
498
|
-
concept: A_Context.root.name,
|
|
499
|
-
scope: newEntity.scope,
|
|
500
|
-
entity: this.constructor.entity,
|
|
501
|
-
id: newEntity.id
|
|
502
|
-
});
|
|
503
|
-
}
|
|
504
|
-
get headersSent() {
|
|
505
|
-
return this.res.headersSent;
|
|
506
|
-
}
|
|
507
|
-
get original() {
|
|
508
|
-
return this.res;
|
|
509
|
-
}
|
|
510
|
-
get statusCode() {
|
|
511
|
-
return this.res.statusCode;
|
|
512
|
-
}
|
|
513
|
-
async init() {
|
|
514
|
-
const startTime = process.hrtime();
|
|
515
|
-
this.res.on("finish", async () => {
|
|
516
|
-
const elapsedTime = process.hrtime(startTime);
|
|
517
|
-
const elapsedMilliseconds = elapsedTime[0] * 1e3 + elapsedTime[1] / 1e6;
|
|
518
|
-
this.duration = elapsedMilliseconds;
|
|
519
|
-
await this.call("finish" /* Finish */);
|
|
520
|
-
});
|
|
521
|
-
this.res.on("close", async () => {
|
|
522
|
-
await this.call("close" /* Close */);
|
|
523
|
-
});
|
|
524
|
-
}
|
|
525
|
-
failed(error) {
|
|
526
|
-
switch (true) {
|
|
527
|
-
case error instanceof A_ServerError:
|
|
528
|
-
this.error = error;
|
|
529
|
-
break;
|
|
530
|
-
case error instanceof A_Error:
|
|
531
|
-
this.error = new A_ServerError(error);
|
|
532
|
-
break;
|
|
533
|
-
default:
|
|
534
|
-
this.error = new A_ServerError(error);
|
|
535
|
-
break;
|
|
536
|
-
}
|
|
537
|
-
return this.status(this.error.status).json(this.error);
|
|
538
|
-
}
|
|
539
|
-
// Send a plain text or JSON response
|
|
540
|
-
send(data = this.toResponse()) {
|
|
541
|
-
const logger = A_Context.scope(this).resolve(A_Logger);
|
|
542
|
-
if (this.headersSent) {
|
|
543
|
-
logger.warning("Response headers already sent, cannot send response again.");
|
|
544
|
-
return;
|
|
545
|
-
}
|
|
546
|
-
try {
|
|
547
|
-
switch (true) {
|
|
548
|
-
case (!!data && typeof data === "object"):
|
|
549
|
-
return this.json(data);
|
|
550
|
-
case (!!data && typeof data === "string"):
|
|
551
|
-
this.res.setHeader("Content-Type", "text/plain");
|
|
552
|
-
this.res.writeHead(this.statusCode);
|
|
553
|
-
this.res.end(data);
|
|
554
|
-
return;
|
|
555
|
-
default:
|
|
556
|
-
this.res.writeHead(this.statusCode);
|
|
557
|
-
this.res.end(data);
|
|
558
|
-
return;
|
|
559
|
-
}
|
|
560
|
-
} catch (error) {
|
|
561
|
-
logger.warning("Response send error:", error);
|
|
562
|
-
}
|
|
563
|
-
}
|
|
564
|
-
destroy(error, scope) {
|
|
565
|
-
this.res.end();
|
|
566
|
-
return super.destroy(scope);
|
|
567
|
-
}
|
|
568
|
-
// Explicit JSON response
|
|
569
|
-
json(data = this.toResponse()) {
|
|
570
|
-
const logger = A_Context.scope(this).resolve(A_Logger);
|
|
571
|
-
if (this.headersSent) {
|
|
572
|
-
logger.warning("Response headers already sent, cannot send response again.");
|
|
573
|
-
return;
|
|
574
|
-
}
|
|
575
|
-
this.res.setHeader("Content-Type", "application/json");
|
|
576
|
-
this.res.writeHead(this.statusCode);
|
|
577
|
-
this.res.end(JSON.stringify(data));
|
|
578
|
-
}
|
|
579
|
-
// Set HTTP status code
|
|
580
|
-
status(code) {
|
|
581
|
-
this.res.statusCode = code;
|
|
582
|
-
return this;
|
|
583
|
-
}
|
|
584
|
-
writeHead(statusCode, headers) {
|
|
585
|
-
this.res.writeHead(statusCode, headers);
|
|
586
|
-
}
|
|
587
|
-
setHeader(key, value) {
|
|
588
|
-
this.res.setHeader(key, value);
|
|
589
|
-
}
|
|
590
|
-
getHeader(key) {
|
|
591
|
-
return this.res.getHeader(key);
|
|
592
|
-
}
|
|
593
|
-
add(key, data) {
|
|
594
|
-
this.data.set(key, data);
|
|
595
|
-
}
|
|
596
|
-
toResponse() {
|
|
597
|
-
return Array.from(this.data.entries()).reduce((acc, [key, value]) => {
|
|
598
|
-
if (value instanceof A_Entity)
|
|
599
|
-
acc[key] = value.toJSON();
|
|
600
|
-
else
|
|
601
|
-
acc[key] = value;
|
|
602
|
-
return acc;
|
|
603
|
-
}, {});
|
|
604
|
-
}
|
|
605
|
-
};
|
|
606
|
-
var A_Service = class extends A_Container {
|
|
607
|
-
async load(polyfill) {
|
|
608
|
-
let config;
|
|
609
|
-
if (!this.scope.has(A_Config)) {
|
|
610
|
-
const config2 = new A_Config({
|
|
611
|
-
variables: [...Array.from(A_SERVER_CONSTANTS__DEFAULT_ENV_VARIABLES_ARRAY)],
|
|
612
|
-
defaults: {
|
|
613
|
-
A_SERVER_PORT: 3e3
|
|
614
|
-
}
|
|
615
|
-
});
|
|
616
|
-
this.scope.register(config2);
|
|
617
|
-
}
|
|
618
|
-
config = this.scope.resolve(A_Config);
|
|
619
|
-
if (!this.scope.has(A_Server)) {
|
|
620
|
-
new A_Server({
|
|
621
|
-
port: config.get("A_SERVER_PORT"),
|
|
622
|
-
name: this.name,
|
|
623
|
-
version: "v1"
|
|
624
|
-
});
|
|
625
|
-
}
|
|
626
|
-
this.port = config.get("A_SERVER_PORT");
|
|
627
|
-
const http = await polyfill.http();
|
|
628
|
-
this.server = http.createServer(this.onRequest.bind(this));
|
|
629
|
-
}
|
|
630
|
-
listen() {
|
|
631
|
-
return new Promise((resolve, reject) => {
|
|
632
|
-
this.server.listen(this.port, () => {
|
|
633
|
-
resolve();
|
|
634
|
-
});
|
|
635
|
-
});
|
|
636
|
-
}
|
|
637
|
-
close() {
|
|
638
|
-
return new Promise((resolve, reject) => {
|
|
639
|
-
this.server.close(() => {
|
|
640
|
-
resolve();
|
|
641
|
-
});
|
|
642
|
-
});
|
|
643
|
-
}
|
|
644
|
-
/**
|
|
645
|
-
* Start the server
|
|
646
|
-
*/
|
|
647
|
-
async start() {
|
|
648
|
-
await this.beforeStart();
|
|
649
|
-
await this.listen();
|
|
650
|
-
await this.afterStart();
|
|
651
|
-
}
|
|
652
|
-
async beforeStart() {
|
|
653
|
-
}
|
|
654
|
-
async afterStart() {
|
|
655
|
-
}
|
|
656
|
-
/**
|
|
657
|
-
* Stop service
|
|
658
|
-
*/
|
|
659
|
-
async stop() {
|
|
660
|
-
await this.call("beforeStop" /* beforeStop */);
|
|
661
|
-
await this.server.close();
|
|
662
|
-
await this.call("afterStop" /* afterStop */);
|
|
663
|
-
}
|
|
664
|
-
async beforeRequest(scope) {
|
|
665
|
-
}
|
|
666
|
-
async afterRequest(scope) {
|
|
667
|
-
}
|
|
668
|
-
async onRequest(request, response) {
|
|
669
|
-
const scope = new A_Scope({
|
|
670
|
-
name: `a-server-request::${Date.now()}`
|
|
671
|
-
});
|
|
672
|
-
const { req, res } = await this.convertToAServer(request, response);
|
|
673
|
-
try {
|
|
674
|
-
scope.register(req);
|
|
675
|
-
scope.register(res);
|
|
676
|
-
scope.inherit(this.scope);
|
|
677
|
-
await this.beforeRequest(scope);
|
|
678
|
-
await this.call("onRequest" /* onRequest */, scope);
|
|
679
|
-
await this.afterRequest(scope);
|
|
680
|
-
await res.status(200).send();
|
|
681
|
-
} catch (error) {
|
|
682
|
-
const logger = this.scope.resolve(A_Logger);
|
|
683
|
-
logger.error(error);
|
|
684
|
-
return res.failed(error);
|
|
685
|
-
}
|
|
686
|
-
}
|
|
687
|
-
async convertToAServer(request, response) {
|
|
688
|
-
if (!request.method || !request.url)
|
|
689
|
-
throw new Error("Request method or url is missing");
|
|
690
|
-
const id = this.generateRequestId(request.method, request.url);
|
|
691
|
-
const req = new A_Request({ id, request, scope: this.scope.name });
|
|
692
|
-
const res = new A_Response({ id, response, scope: this.scope.name });
|
|
693
|
-
await req.init();
|
|
694
|
-
await res.init();
|
|
695
|
-
return { req, res };
|
|
696
|
-
}
|
|
697
|
-
generateRequestId(method, url) {
|
|
698
|
-
const hash = crypto.createHash("sha256");
|
|
699
|
-
const timeId = A_IdentityHelper.generateTimeId();
|
|
700
|
-
const randomValue = Math.random().toString();
|
|
701
|
-
hash.update(`${timeId}-${method}-${url}-${randomValue}`);
|
|
702
|
-
return `${timeId}-${hash.digest("hex")}`;
|
|
703
|
-
}
|
|
704
|
-
async beforeStop() {
|
|
705
|
-
}
|
|
706
|
-
async afterStop() {
|
|
707
|
-
}
|
|
708
|
-
};
|
|
709
|
-
__decorateClass([
|
|
710
|
-
A_Concept.Load(),
|
|
711
|
-
__decorateParam(0, A_Inject(A_Polyfill))
|
|
712
|
-
], A_Service.prototype, "load");
|
|
713
|
-
__decorateClass([
|
|
714
|
-
A_Concept.Start()
|
|
715
|
-
], A_Service.prototype, "start");
|
|
716
|
-
__decorateClass([
|
|
717
|
-
A_Feature.Define({ invoke: true })
|
|
718
|
-
], A_Service.prototype, "beforeStart");
|
|
719
|
-
__decorateClass([
|
|
720
|
-
A_Feature.Define({ invoke: true })
|
|
721
|
-
], A_Service.prototype, "afterStart");
|
|
722
|
-
__decorateClass([
|
|
723
|
-
A_Concept.Stop()
|
|
724
|
-
], A_Service.prototype, "stop");
|
|
725
|
-
__decorateClass([
|
|
726
|
-
A_Feature.Define({
|
|
727
|
-
name: "beforeRequest" /* beforeRequest */,
|
|
728
|
-
invoke: true
|
|
729
|
-
})
|
|
730
|
-
], A_Service.prototype, "beforeRequest");
|
|
731
|
-
__decorateClass([
|
|
732
|
-
A_Feature.Define({
|
|
733
|
-
name: "beforeRequest" /* beforeRequest */,
|
|
734
|
-
invoke: true
|
|
735
|
-
})
|
|
736
|
-
], A_Service.prototype, "afterRequest");
|
|
737
|
-
__decorateClass([
|
|
738
|
-
A_Feature.Define({
|
|
739
|
-
name: "onRequest" /* onRequest */,
|
|
740
|
-
invoke: false
|
|
741
|
-
})
|
|
742
|
-
], A_Service.prototype, "onRequest");
|
|
743
|
-
__decorateClass([
|
|
744
|
-
A_Feature.Define({ invoke: true })
|
|
745
|
-
], A_Service.prototype, "beforeStop");
|
|
746
|
-
__decorateClass([
|
|
747
|
-
A_Feature.Define({ invoke: true })
|
|
748
|
-
], A_Service.prototype, "afterStop");
|
|
749
|
-
|
|
750
|
-
// src/context/A-ProxyConfig/A_ProxyConfig.constants.ts
|
|
751
|
-
var PROXY_CONFIG_DEFAULTS = {
|
|
752
|
-
path: "/",
|
|
753
|
-
hostname: "localhost",
|
|
754
|
-
port: 80,
|
|
755
|
-
method: "GET",
|
|
756
|
-
headers: {},
|
|
757
|
-
protocol: "http"
|
|
758
|
-
};
|
|
759
|
-
|
|
760
|
-
// src/context/A-ProxyConfig/A_ProxyConfig.context.ts
|
|
761
|
-
var A_ProxyConfig = class extends A_Fragment {
|
|
762
|
-
constructor(configs = {}) {
|
|
763
|
-
super();
|
|
764
|
-
this._configs = Object.entries(configs).map(([path2, config]) => {
|
|
765
|
-
const targetUrl = new URL(typeof config === "string" ? config : config.hostname || "");
|
|
766
|
-
const port = targetUrl.port || (targetUrl.protocol === "https:" ? "443" : "80");
|
|
767
|
-
const prepared = {
|
|
768
|
-
...PROXY_CONFIG_DEFAULTS,
|
|
769
|
-
...typeof config === "string" ? {
|
|
770
|
-
path: path2,
|
|
771
|
-
port: parseInt(port),
|
|
772
|
-
protocol: targetUrl.protocol,
|
|
773
|
-
hostname: targetUrl.hostname
|
|
774
|
-
} : config
|
|
775
|
-
};
|
|
776
|
-
return {
|
|
777
|
-
route: new A_Route(prepared.path, prepared.method),
|
|
778
|
-
hostname: prepared.hostname,
|
|
779
|
-
port: prepared.port,
|
|
780
|
-
headers: prepared.headers,
|
|
781
|
-
protocol: prepared.protocol
|
|
782
|
-
};
|
|
783
|
-
});
|
|
784
|
-
}
|
|
785
|
-
/**
|
|
786
|
-
* Returns all configured proxy configs
|
|
787
|
-
*
|
|
788
|
-
*/
|
|
789
|
-
get configs() {
|
|
790
|
-
return this._configs;
|
|
791
|
-
}
|
|
792
|
-
/**
|
|
793
|
-
* Checks if a given path is configured in the proxy
|
|
794
|
-
*
|
|
795
|
-
* @param path
|
|
796
|
-
* @returns
|
|
797
|
-
*/
|
|
798
|
-
has(path2) {
|
|
799
|
-
return this._configs.some((route) => route.route.toRegExp().test(path2));
|
|
800
|
-
}
|
|
801
|
-
/**
|
|
802
|
-
* Returns the proxy configuration for a given path, if exists
|
|
803
|
-
*
|
|
804
|
-
* @param path
|
|
805
|
-
* @returns
|
|
806
|
-
*/
|
|
807
|
-
config(path2) {
|
|
808
|
-
return this._configs.find((route) => route.route.toRegExp().test(path2));
|
|
809
|
-
}
|
|
810
|
-
};
|
|
811
|
-
var A_StaticConfig = class extends A_Fragment {
|
|
812
|
-
constructor(directories = []) {
|
|
813
|
-
super();
|
|
814
|
-
this.directories = directories;
|
|
815
|
-
}
|
|
816
|
-
/**
|
|
817
|
-
* Checks if a given path is configured in the proxy
|
|
818
|
-
*
|
|
819
|
-
* @param path
|
|
820
|
-
* @returns
|
|
821
|
-
*/
|
|
822
|
-
has(path2) {
|
|
823
|
-
const found = this.directories.find((dir) => {
|
|
824
|
-
return new RegExp(`^/${dir.startsWith("/") ? dir.slice(1) : dir}/?.*`).test(path2);
|
|
825
|
-
});
|
|
826
|
-
return !!found && found;
|
|
827
|
-
}
|
|
828
|
-
};
|
|
829
|
-
var A_ListQueryFilter = class extends A_Fragment {
|
|
830
|
-
constructor(_query = {}, defaults = {}) {
|
|
831
|
-
super();
|
|
832
|
-
this._query = _query;
|
|
833
|
-
this.defaults = defaults;
|
|
834
|
-
this.parsedQuery = this.parseQueryString(_query);
|
|
835
|
-
}
|
|
836
|
-
get query() {
|
|
837
|
-
return this._query;
|
|
838
|
-
}
|
|
839
|
-
get(property, defaultValue = "") {
|
|
840
|
-
return this.parsedQuery[property] || this.defaults[property] || defaultValue;
|
|
841
|
-
}
|
|
842
|
-
parseQueryString(value = {}) {
|
|
843
|
-
if (typeof value === "string") {
|
|
844
|
-
return value.split("&").reduce((acc, part) => {
|
|
845
|
-
const [key, val] = part.split("=");
|
|
846
|
-
acc[decodeURIComponent(key)] = decodeURIComponent(val || "");
|
|
847
|
-
return acc;
|
|
848
|
-
}, {});
|
|
849
|
-
}
|
|
850
|
-
return value;
|
|
851
|
-
}
|
|
852
|
-
};
|
|
853
|
-
var A_EntityFactory = class extends A_Fragment {
|
|
854
|
-
constructor(param1, param2) {
|
|
855
|
-
super();
|
|
856
|
-
this._entities = /* @__PURE__ */ new Map();
|
|
857
|
-
this._setEntities(param1);
|
|
858
|
-
this._setEntities(param2);
|
|
859
|
-
}
|
|
860
|
-
_setEntities(entities = []) {
|
|
861
|
-
if (Array.isArray(entities)) {
|
|
862
|
-
entities.forEach((entity) => {
|
|
863
|
-
this._entities.set(entity.entity, entity);
|
|
864
|
-
});
|
|
865
|
-
} else {
|
|
866
|
-
Object.keys(entities).forEach((key) => {
|
|
867
|
-
this._entities.set(key, entities[key]);
|
|
868
|
-
});
|
|
869
|
-
}
|
|
870
|
-
}
|
|
871
|
-
add(param1, param2) {
|
|
872
|
-
switch (true) {
|
|
873
|
-
case (typeof param1 === "string" && !!param2):
|
|
874
|
-
this._entities.set(param1, param2);
|
|
875
|
-
break;
|
|
876
|
-
case typeof param1 !== "string":
|
|
877
|
-
this._entities.set(param1.entity, param1);
|
|
878
|
-
break;
|
|
879
|
-
}
|
|
880
|
-
}
|
|
881
|
-
has(param1) {
|
|
882
|
-
let name;
|
|
883
|
-
switch (true) {
|
|
884
|
-
case param1 instanceof ASEID:
|
|
885
|
-
name = param1.entity;
|
|
886
|
-
break;
|
|
887
|
-
case (!(param1 instanceof ASEID) && ASEID.isASEID(param1)):
|
|
888
|
-
name = new ASEID(param1).entity;
|
|
889
|
-
break;
|
|
890
|
-
default:
|
|
891
|
-
name = param1;
|
|
892
|
-
break;
|
|
893
|
-
}
|
|
894
|
-
return this._entities.has(name);
|
|
895
|
-
}
|
|
896
|
-
resolve(param1) {
|
|
897
|
-
let name;
|
|
898
|
-
switch (true) {
|
|
899
|
-
case param1 instanceof ASEID:
|
|
900
|
-
name = param1.entity;
|
|
901
|
-
break;
|
|
902
|
-
case (typeof param1 === "string" && ASEID.isASEID(param1)):
|
|
903
|
-
name = new ASEID(param1).entity;
|
|
904
|
-
break;
|
|
905
|
-
default:
|
|
906
|
-
name = param1;
|
|
907
|
-
break;
|
|
908
|
-
}
|
|
909
|
-
return this._entities.get(name);
|
|
910
|
-
}
|
|
911
|
-
resolveByName(name) {
|
|
912
|
-
return this._entities.get(name);
|
|
913
|
-
}
|
|
914
|
-
};
|
|
915
|
-
var A_EntityList = class extends A_Entity {
|
|
916
|
-
constructor() {
|
|
917
|
-
super(...arguments);
|
|
918
|
-
this._items = [];
|
|
919
|
-
this._pagination = {
|
|
920
|
-
total: 0,
|
|
921
|
-
page: 1,
|
|
922
|
-
pageSize: 10
|
|
923
|
-
};
|
|
924
|
-
}
|
|
925
|
-
static get scope() {
|
|
926
|
-
return "a-server";
|
|
927
|
-
}
|
|
928
|
-
/**
|
|
929
|
-
* Returns the entity constructor used for the list
|
|
930
|
-
*/
|
|
931
|
-
get entityConstructor() {
|
|
932
|
-
return this._entityConstructor;
|
|
933
|
-
}
|
|
934
|
-
/**
|
|
935
|
-
* Returns the list of items contained in the entity list
|
|
936
|
-
*/
|
|
937
|
-
get items() {
|
|
938
|
-
return this._items;
|
|
939
|
-
}
|
|
940
|
-
/**
|
|
941
|
-
* Returns pagination information about the entity list
|
|
942
|
-
*/
|
|
943
|
-
get pagination() {
|
|
944
|
-
return this._pagination;
|
|
945
|
-
}
|
|
946
|
-
/**
|
|
947
|
-
* Creates a new instance of A_EntityList
|
|
948
|
-
*
|
|
949
|
-
* @param newEntity
|
|
950
|
-
*/
|
|
951
|
-
fromNew(newEntity) {
|
|
952
|
-
this.aseid = new ASEID({
|
|
953
|
-
concept: A_Context.root.name,
|
|
954
|
-
scope: "default",
|
|
955
|
-
entity: "a-list" + (newEntity.name ? `.${newEntity.name}` : ""),
|
|
956
|
-
id: (/* @__PURE__ */ new Date()).getTime().toString()
|
|
957
|
-
});
|
|
958
|
-
this._entityConstructor = newEntity.constructor;
|
|
959
|
-
}
|
|
960
|
-
/**
|
|
961
|
-
* Allows to convert Repository Response data to EntityList instance
|
|
962
|
-
*
|
|
963
|
-
* [!] This method does not load the data from the repository, it only converts the data to the EntityList instance
|
|
964
|
-
*
|
|
965
|
-
* @param items
|
|
966
|
-
* @param pagination
|
|
967
|
-
*/
|
|
968
|
-
fromList(items, pagination) {
|
|
969
|
-
this._items = items.map((item) => {
|
|
970
|
-
if (item instanceof A_Entity) {
|
|
971
|
-
return item;
|
|
972
|
-
} else {
|
|
973
|
-
const entity = new this._entityConstructor(item);
|
|
974
|
-
return entity;
|
|
975
|
-
}
|
|
976
|
-
});
|
|
977
|
-
if (pagination) {
|
|
978
|
-
this._pagination = {
|
|
979
|
-
total: pagination.total,
|
|
980
|
-
page: pagination.page,
|
|
981
|
-
pageSize: pagination.pageSize
|
|
982
|
-
};
|
|
983
|
-
}
|
|
984
|
-
}
|
|
985
|
-
/**
|
|
986
|
-
* Serializes the EntityList to a JSON object
|
|
987
|
-
*
|
|
988
|
-
* @returns
|
|
989
|
-
*/
|
|
990
|
-
toJSON() {
|
|
991
|
-
return {
|
|
992
|
-
...super.toJSON(),
|
|
993
|
-
items: this._items.map((i) => i.toJSON()),
|
|
994
|
-
pagination: this._pagination
|
|
995
|
-
};
|
|
996
|
-
}
|
|
997
|
-
};
|
|
998
|
-
var A_ServerLogger = class extends A_Logger {
|
|
999
|
-
async onRequestEnd(request, response) {
|
|
1000
|
-
this.route({
|
|
1001
|
-
method: request.method,
|
|
1002
|
-
url: request.url,
|
|
1003
|
-
status: response.statusCode,
|
|
1004
|
-
responseTime: response.duration
|
|
1005
|
-
});
|
|
1006
|
-
}
|
|
1007
|
-
async onRequestError(request) {
|
|
1008
|
-
}
|
|
1009
|
-
logStart(container) {
|
|
1010
|
-
this.serverReady({
|
|
1011
|
-
port: container.port,
|
|
1012
|
-
app: {
|
|
1013
|
-
name: container.name
|
|
1014
|
-
}
|
|
1015
|
-
});
|
|
1016
|
-
}
|
|
1017
|
-
logStop(server) {
|
|
1018
|
-
this.log("red", `Server ${server.name} stopped`);
|
|
1019
|
-
}
|
|
1020
|
-
metrics() {
|
|
1021
|
-
}
|
|
1022
|
-
routes(routes) {
|
|
1023
|
-
const time = this.getTime();
|
|
1024
|
-
console.log(`\x1B[36m[${this.scope.name}] |${time}| Exposed Routes:
|
|
1025
|
-
${" ".repeat(this.scopeLength + 3)}|-------------------------------
|
|
1026
|
-
${routes.map((route) => `${" ".repeat(this.scopeLength + 3)}| [${route.method.toUpperCase()}]${" ".repeat(7 - route.method.length)} ${route.path}`).join("\n")}
|
|
1027
|
-
${" ".repeat(this.scopeLength + 3)}|-------------------------------\x1B[0m`);
|
|
1028
|
-
}
|
|
1029
|
-
/**
|
|
1030
|
-
* Logs the route information based on status code
|
|
1031
|
-
*
|
|
1032
|
-
* @param route
|
|
1033
|
-
*/
|
|
1034
|
-
route(route) {
|
|
1035
|
-
switch (route.status) {
|
|
1036
|
-
case 200:
|
|
1037
|
-
this.log200(route);
|
|
1038
|
-
break;
|
|
1039
|
-
case 404:
|
|
1040
|
-
this.log404(route);
|
|
1041
|
-
break;
|
|
1042
|
-
case 500:
|
|
1043
|
-
this.log500(route);
|
|
1044
|
-
break;
|
|
1045
|
-
case 400:
|
|
1046
|
-
this.log400(route);
|
|
1047
|
-
break;
|
|
1048
|
-
default:
|
|
1049
|
-
this.logDefault(route);
|
|
1050
|
-
break;
|
|
1051
|
-
}
|
|
1052
|
-
}
|
|
1053
|
-
log200(route) {
|
|
1054
|
-
if (this.config.get("SERVER_IGNORE_LOG_200"))
|
|
1055
|
-
return;
|
|
1056
|
-
console.log(`\x1B[32m[${this.scope.name}] |${this.getTime()}| ${route.status} | [${route.method.toUpperCase()}]${" ".repeat(7 - route.method.length)} ${route.url} | ${route.responseTime}ms\x1B[0m`);
|
|
1057
|
-
}
|
|
1058
|
-
log404(route) {
|
|
1059
|
-
if (this.config.get("SERVER_IGNORE_LOG_404"))
|
|
1060
|
-
return;
|
|
1061
|
-
console.log(`\x1B[33m[${this.scope.name}] |${this.getTime()}| ${route.status} | [${route.method.toUpperCase()}]${" ".repeat(7 - route.method.length)} ${route.url} | ${route.responseTime}ms\x1B[0m`);
|
|
1062
|
-
}
|
|
1063
|
-
log500(route) {
|
|
1064
|
-
if (this.config.get("SERVER_IGNORE_LOG_500"))
|
|
1065
|
-
return;
|
|
1066
|
-
console.log(`\x1B[31m[${this.scope.name}] |${this.getTime()}| ${route.status} | [${route.method.toUpperCase()}]${" ".repeat(7 - route.method.length)} ${route.url} | ${route.responseTime}ms\x1B[0m`);
|
|
1067
|
-
}
|
|
1068
|
-
log400(route) {
|
|
1069
|
-
if (this.config.get("SERVER_IGNORE_LOG_400"))
|
|
1070
|
-
return;
|
|
1071
|
-
console.log(`\x1B[33m[${this.scope.name}] |${this.getTime()}| ${route.status} | [${route.method.toUpperCase()}]${" ".repeat(7 - route.method.length)} ${route.url} | ${route.responseTime}ms\x1B[0m`);
|
|
1072
|
-
}
|
|
1073
|
-
logDefault(route) {
|
|
1074
|
-
if (this.config.get("SERVER_IGNORE_LOG_DEFAULT"))
|
|
1075
|
-
return;
|
|
1076
|
-
console.log(`\x1B[36m[${this.scope.name}] |${this.getTime()}| ${route.status} | [${route.method.toUpperCase()}]${" ".repeat(7 - route.method.length)} ${route.url} | ${route.responseTime}ms\x1B[0m`);
|
|
1077
|
-
}
|
|
1078
|
-
serverReady(params) {
|
|
1079
|
-
const processId = process.pid;
|
|
1080
|
-
console.log(`\x1B[36m[${this.scope.name}] |${this.getTime()}| Server Ready:
|
|
1081
|
-
${" ".repeat(this.scopeLength + 3)}|-------------------------------
|
|
1082
|
-
${" ".repeat(this.scopeLength + 3)}| ${params.app.name} v${params.app.version || "0.0.1"} is running on port ${params.port}
|
|
1083
|
-
${" ".repeat(this.scopeLength + 3)}| Process ID: ${processId}
|
|
1084
|
-
${" ".repeat(this.scopeLength + 3)}|-------------------------------
|
|
1085
|
-
${" ".repeat(this.scopeLength + 3)}| ==============================
|
|
1086
|
-
${" ".repeat(this.scopeLength + 3)}| LISTENING...
|
|
1087
|
-
${" ".repeat(this.scopeLength + 3)}| ==============================
|
|
1088
|
-
\x1B[0m`);
|
|
1089
|
-
}
|
|
1090
|
-
/**
|
|
1091
|
-
* Displays a proxy routes
|
|
1092
|
-
*
|
|
1093
|
-
* @param params
|
|
1094
|
-
*/
|
|
1095
|
-
proxy(params) {
|
|
1096
|
-
console.log(`\x1B[35m[${this.scope.name}] |${this.getTime()}| Proxy:
|
|
1097
|
-
${" ".repeat(this.scopeLength + 3)}| ${params.original} -> ${params.destination}
|
|
1098
|
-
${" ".repeat(this.scopeLength + 3)}|-------------------------------\x1B[0m`);
|
|
1099
|
-
}
|
|
1100
|
-
};
|
|
1101
|
-
__decorateClass([
|
|
1102
|
-
A_Feature.Extend({
|
|
1103
|
-
name: "finish" /* Finish */,
|
|
1104
|
-
scope: [A_Response]
|
|
1105
|
-
}),
|
|
1106
|
-
__decorateParam(0, A_Inject(A_Request)),
|
|
1107
|
-
__decorateParam(1, A_Inject(A_Response))
|
|
1108
|
-
], A_ServerLogger.prototype, "onRequestEnd");
|
|
1109
|
-
__decorateClass([
|
|
1110
|
-
A_Feature.Extend({
|
|
1111
|
-
name: "error" /* Error */
|
|
1112
|
-
}),
|
|
1113
|
-
__decorateParam(0, A_Inject(A_Request))
|
|
1114
|
-
], A_ServerLogger.prototype, "onRequestError");
|
|
1115
|
-
__decorateClass([
|
|
1116
|
-
A_Feature.Extend({
|
|
1117
|
-
name: "afterStart" /* afterStart */,
|
|
1118
|
-
scope: [A_Service]
|
|
1119
|
-
}),
|
|
1120
|
-
__decorateParam(0, A_Inject(A_Service))
|
|
1121
|
-
], A_ServerLogger.prototype, "logStart");
|
|
1122
|
-
__decorateClass([
|
|
1123
|
-
A_Feature.Extend({
|
|
1124
|
-
name: "afterStop" /* afterStop */,
|
|
1125
|
-
scope: [A_Service]
|
|
1126
|
-
}),
|
|
1127
|
-
__decorateParam(0, A_Inject(A_Server))
|
|
1128
|
-
], A_ServerLogger.prototype, "logStop");
|
|
1129
|
-
|
|
1130
|
-
// src/components/A-Router/A-Router.component.types.ts
|
|
1131
|
-
var A_SERVER_TYPES__RouterMethod = /* @__PURE__ */ ((A_SERVER_TYPES__RouterMethod2) => {
|
|
1132
|
-
A_SERVER_TYPES__RouterMethod2["POST"] = "POST";
|
|
1133
|
-
A_SERVER_TYPES__RouterMethod2["GET"] = "GET";
|
|
1134
|
-
A_SERVER_TYPES__RouterMethod2["PUT"] = "PUT";
|
|
1135
|
-
A_SERVER_TYPES__RouterMethod2["DELETE"] = "DELETE";
|
|
1136
|
-
A_SERVER_TYPES__RouterMethod2["PATCH"] = "PATCH";
|
|
1137
|
-
A_SERVER_TYPES__RouterMethod2["DEFAULT"] = "DEFAULT";
|
|
1138
|
-
return A_SERVER_TYPES__RouterMethod2;
|
|
1139
|
-
})(A_SERVER_TYPES__RouterMethod || {});
|
|
1140
|
-
var A_SERVER_TYPES__ARouterComponentMetaKey = /* @__PURE__ */ ((A_SERVER_TYPES__ARouterComponentMetaKey2) => {
|
|
1141
|
-
A_SERVER_TYPES__ARouterComponentMetaKey2["ROUTES"] = "ROUTES";
|
|
1142
|
-
return A_SERVER_TYPES__ARouterComponentMetaKey2;
|
|
1143
|
-
})(A_SERVER_TYPES__ARouterComponentMetaKey || {});
|
|
1144
|
-
var _A_Router = class _A_Router extends A_Component {
|
|
1145
|
-
// =======================================================
|
|
1146
|
-
// ================ Method Definition=====================
|
|
1147
|
-
// =======================================================
|
|
1148
|
-
/**
|
|
1149
|
-
* Allows to define a custom route for POST requests
|
|
1150
|
-
*
|
|
1151
|
-
* @param path
|
|
1152
|
-
* @returns
|
|
1153
|
-
*/
|
|
1154
|
-
static Post(path2) {
|
|
1155
|
-
return this.defineRoute({
|
|
1156
|
-
method: "POST" /* POST */,
|
|
1157
|
-
path: typeof path2 === "object" && "path" in path2 ? path2.path : path2,
|
|
1158
|
-
version: typeof path2 === "object" && "version" in path2 && path2.version ? path2.version : "v1",
|
|
1159
|
-
prefix: typeof path2 === "object" && "prefix" in path2 && path2.prefix ? path2.prefix : "api"
|
|
1160
|
-
});
|
|
1161
|
-
}
|
|
1162
|
-
/**
|
|
1163
|
-
* Allows to define a custom route for GET requests
|
|
1164
|
-
*
|
|
1165
|
-
* @param path
|
|
1166
|
-
* @returns
|
|
1167
|
-
*/
|
|
1168
|
-
static Get(path2) {
|
|
1169
|
-
return this.defineRoute({
|
|
1170
|
-
method: "GET" /* GET */,
|
|
1171
|
-
path: typeof path2 === "object" && "path" in path2 ? path2.path : path2,
|
|
1172
|
-
version: typeof path2 === "object" && "version" in path2 && path2.version ? path2.version : "v1",
|
|
1173
|
-
prefix: typeof path2 === "object" && "prefix" in path2 && path2.prefix ? path2.prefix : "api"
|
|
1174
|
-
});
|
|
1175
|
-
}
|
|
1176
|
-
/**
|
|
1177
|
-
* Allows to define a custom route for PUT requests
|
|
1178
|
-
*
|
|
1179
|
-
* @param path
|
|
1180
|
-
* @returns
|
|
1181
|
-
*/
|
|
1182
|
-
static Put(path2) {
|
|
1183
|
-
return this.defineRoute({
|
|
1184
|
-
method: "PUT" /* PUT */,
|
|
1185
|
-
path: typeof path2 === "object" && "path" in path2 ? path2.path : path2,
|
|
1186
|
-
version: typeof path2 === "object" && "version" in path2 && path2.version ? path2.version : "v1",
|
|
1187
|
-
prefix: typeof path2 === "object" && "prefix" in path2 && path2.prefix ? path2.prefix : "api"
|
|
1188
|
-
});
|
|
1189
|
-
}
|
|
1190
|
-
/**
|
|
1191
|
-
* Allows to define a custom route for DELETE requests
|
|
1192
|
-
*
|
|
1193
|
-
* @param path
|
|
1194
|
-
* @returns
|
|
1195
|
-
*/
|
|
1196
|
-
static Delete(path2) {
|
|
1197
|
-
return this.defineRoute({
|
|
1198
|
-
method: "DELETE" /* DELETE */,
|
|
1199
|
-
path: typeof path2 === "object" && "path" in path2 ? path2.path : path2,
|
|
1200
|
-
version: typeof path2 === "object" && "version" in path2 && path2.version ? path2.version : "v1",
|
|
1201
|
-
prefix: typeof path2 === "object" && "prefix" in path2 && path2.prefix ? path2.prefix : "api"
|
|
1202
|
-
});
|
|
1203
|
-
}
|
|
1204
|
-
/**
|
|
1205
|
-
* Allows to define a custom route for PATCH requests
|
|
1206
|
-
*
|
|
1207
|
-
* @param path
|
|
1208
|
-
* @returns
|
|
1209
|
-
*/
|
|
1210
|
-
static Patch(path2) {
|
|
1211
|
-
return this.defineRoute({
|
|
1212
|
-
method: "PATCH" /* PATCH */,
|
|
1213
|
-
path: typeof path2 === "object" && "path" in path2 ? path2.path : path2,
|
|
1214
|
-
version: typeof path2 === "object" && "version" in path2 && path2.version ? path2.version : "v1",
|
|
1215
|
-
prefix: typeof path2 === "object" && "prefix" in path2 && path2.prefix ? path2.prefix : "api"
|
|
1216
|
-
});
|
|
1217
|
-
}
|
|
1218
|
-
/**
|
|
1219
|
-
* Allows to define a custom route for DEFAULT requests
|
|
1220
|
-
*
|
|
1221
|
-
* @param path
|
|
1222
|
-
* @returns
|
|
1223
|
-
*/
|
|
1224
|
-
static Default(path2) {
|
|
1225
|
-
return this.defineRoute({
|
|
1226
|
-
method: "DEFAULT" /* DEFAULT */,
|
|
1227
|
-
path: typeof path2 === "object" && "path" in path2 ? path2.path : path2,
|
|
1228
|
-
version: typeof path2 === "object" && "version" in path2 && path2.version ? path2.version : "v1",
|
|
1229
|
-
prefix: typeof path2 === "object" && "prefix" in path2 && path2.prefix ? path2.prefix : "api"
|
|
1230
|
-
});
|
|
1231
|
-
}
|
|
1232
|
-
/**
|
|
1233
|
-
* Private method to have the same signature for all route methods
|
|
1234
|
-
*
|
|
1235
|
-
* @param method
|
|
1236
|
-
* @param path
|
|
1237
|
-
* @returns
|
|
1238
|
-
*/
|
|
1239
|
-
static defineRoute(config) {
|
|
1240
|
-
const route = typeof config.path === "string" || config.path instanceof RegExp ? new A_Route(
|
|
1241
|
-
`/${config.prefix}/${config.version}${config.path instanceof RegExp ? config.path.source : config.path.startsWith("/") ? config.path : `/${config.path}`}`,
|
|
1242
|
-
config.method
|
|
1243
|
-
) : config.path;
|
|
1244
|
-
this.routes.push(route);
|
|
1245
|
-
return function decorator(target, propertyKey, descriptor) {
|
|
1246
|
-
const meta = A_Context.meta(target);
|
|
1247
|
-
const routes = meta.get("ROUTES" /* ROUTES */) || /* @__PURE__ */ new Map();
|
|
1248
|
-
const searchKey = route.toAFeatureExtension(["A_Router", "A_Service"]);
|
|
1249
|
-
routes.set(searchKey.source, {
|
|
1250
|
-
component: target,
|
|
1251
|
-
handler: propertyKey,
|
|
1252
|
-
route
|
|
1253
|
-
});
|
|
1254
|
-
meta.set("ROUTES" /* ROUTES */, routes);
|
|
1255
|
-
A_Feature_Define({
|
|
1256
|
-
name: searchKey.source,
|
|
1257
|
-
invoke: false
|
|
1258
|
-
})(target, propertyKey, descriptor);
|
|
1259
|
-
return A_Feature_Extend(searchKey)(target, propertyKey, descriptor);
|
|
1260
|
-
};
|
|
1261
|
-
}
|
|
1262
|
-
async load(logger) {
|
|
1263
|
-
logger.routes(_A_Router.routes);
|
|
1264
|
-
}
|
|
1265
|
-
async identifyRoute(request, response, scope, config, logger) {
|
|
1266
|
-
const route = request.route;
|
|
1267
|
-
if (config.get("A_CONCEPT_ENVIRONMENT") === "development") {
|
|
1268
|
-
logger.log(`Incoming request: ${request.method} ${request.url}`);
|
|
1269
|
-
logger.log(`Identified route: ${route.toString()}`);
|
|
1270
|
-
}
|
|
1271
|
-
const feature = new A_Feature({
|
|
1272
|
-
name: route.toString(),
|
|
1273
|
-
component: this
|
|
1274
|
-
});
|
|
1275
|
-
for (const stage of feature) {
|
|
1276
|
-
if (A_TypeGuards.isComponentConstructor(stage.definition.component)) {
|
|
1277
|
-
const meta = A_Context.meta(stage.definition.component);
|
|
1278
|
-
const routes = meta.get("ROUTES" /* ROUTES */);
|
|
1279
|
-
if (routes) {
|
|
1280
|
-
const currentRoute = routes.get(stage.definition.name || "");
|
|
1281
|
-
if (currentRoute) {
|
|
1282
|
-
request.params = {
|
|
1283
|
-
...request.params,
|
|
1284
|
-
...currentRoute.route.extractParams(request.url)
|
|
1285
|
-
};
|
|
1286
|
-
}
|
|
1287
|
-
}
|
|
1288
|
-
}
|
|
1289
|
-
const stageScope = new A_Scope({
|
|
1290
|
-
name: `a-route--${A_IdentityHelper.generateTimeId()}`,
|
|
1291
|
-
entities: [request]
|
|
1292
|
-
}, {
|
|
1293
|
-
parent: scope
|
|
1294
|
-
});
|
|
1295
|
-
await stage.process(stageScope);
|
|
1296
|
-
}
|
|
1297
|
-
console.log("Finished processing route for request:", request.method, request.url);
|
|
1298
|
-
}
|
|
1299
|
-
};
|
|
1300
|
-
_A_Router.routes = [];
|
|
1301
|
-
__decorateClass([
|
|
1302
|
-
A_Concept.Load(),
|
|
1303
|
-
__decorateParam(0, A_Inject(A_ServerLogger))
|
|
1304
|
-
], _A_Router.prototype, "load");
|
|
1305
|
-
__decorateClass([
|
|
1306
|
-
A_Feature.Extend({
|
|
1307
|
-
name: "onRequest" /* onRequest */,
|
|
1308
|
-
scope: [A_Service]
|
|
1309
|
-
}),
|
|
1310
|
-
__decorateParam(0, A_Inject(A_Request)),
|
|
1311
|
-
__decorateParam(1, A_Inject(A_Response)),
|
|
1312
|
-
__decorateParam(2, A_Inject(A_Scope)),
|
|
1313
|
-
__decorateParam(3, A_Inject(A_Config)),
|
|
1314
|
-
__decorateParam(4, A_Inject(A_Logger))
|
|
1315
|
-
], _A_Router.prototype, "identifyRoute");
|
|
1316
|
-
var A_Router = _A_Router;
|
|
1317
|
-
var A_EntityController = class extends A_Component {
|
|
1318
|
-
async list(request, response, factory, scope, config) {
|
|
1319
|
-
const constructor = factory.resolveByName(request.params.type);
|
|
1320
|
-
if (constructor) {
|
|
1321
|
-
const entityList = new A_EntityList({
|
|
1322
|
-
name: request.params.type,
|
|
1323
|
-
scope: scope.name,
|
|
1324
|
-
constructor
|
|
1325
|
-
});
|
|
1326
|
-
scope.register(entityList);
|
|
1327
|
-
const queryFilter = new A_ListQueryFilter(request.query, {
|
|
1328
|
-
itemsPerPage: String(config.get("A_LIST_ITEMS_PER_PAGE") || "10"),
|
|
1329
|
-
page: String(config.get("A_LIST_PAGE") || "1")
|
|
1330
|
-
});
|
|
1331
|
-
const queryScope = new A_Scope({
|
|
1332
|
-
fragments: [queryFilter]
|
|
1333
|
-
}).inherit(scope);
|
|
1334
|
-
await entityList.load(queryScope);
|
|
1335
|
-
response.add("items", entityList.items);
|
|
1336
|
-
response.add("pagination", entityList.pagination);
|
|
1337
|
-
}
|
|
1338
|
-
}
|
|
1339
|
-
async load(request, response, scope) {
|
|
1340
|
-
if (!ASEID.isASEID(request.params.aseid)) {
|
|
1341
|
-
response.add("A_EntityController.load", "Invalid ASEID");
|
|
1342
|
-
return;
|
|
1343
|
-
}
|
|
1344
|
-
const aseid = new ASEID(request.params.aseid);
|
|
1345
|
-
const constructor = scope.resolveConstructor(aseid.entity);
|
|
1346
|
-
if (constructor) {
|
|
1347
|
-
const entity = new constructor(request.params.aseid);
|
|
1348
|
-
scope.register(entity);
|
|
1349
|
-
await entity.load();
|
|
1350
|
-
return response.status(200).json(entity.toJSON());
|
|
1351
|
-
} else
|
|
1352
|
-
throw new A_ServerError({
|
|
1353
|
-
title: "Entity Not Found",
|
|
1354
|
-
description: `Entity constructor for ASEID ${request.params.aseid} not found`,
|
|
1355
|
-
status: 404
|
|
1356
|
-
});
|
|
1357
|
-
}
|
|
1358
|
-
async create(request, factory, scope) {
|
|
1359
|
-
const constructor = factory.resolve(request.params.aseid);
|
|
1360
|
-
if (constructor) {
|
|
1361
|
-
const entity = new constructor(request.body);
|
|
1362
|
-
scope.register(entity);
|
|
1363
|
-
await entity.save();
|
|
1364
|
-
}
|
|
1365
|
-
}
|
|
1366
|
-
async update(request, response, factory, scope) {
|
|
1367
|
-
if (!ASEID.isASEID(request.params.aseid)) {
|
|
1368
|
-
response.add("A_EntityController.update", "Invalid ASEID");
|
|
1369
|
-
return;
|
|
1370
|
-
}
|
|
1371
|
-
const constructor = factory.resolve(request.params.aseid);
|
|
1372
|
-
if (constructor) {
|
|
1373
|
-
const entity = new constructor(request.body);
|
|
1374
|
-
scope.register(entity);
|
|
1375
|
-
await entity.save();
|
|
1376
|
-
}
|
|
1377
|
-
}
|
|
1378
|
-
async delete(request, response, factory, scope) {
|
|
1379
|
-
if (!ASEID.isASEID(request.params.aseid)) {
|
|
1380
|
-
response.add("A_EntityController.delete", "Invalid ASEID");
|
|
1381
|
-
return;
|
|
1382
|
-
}
|
|
1383
|
-
const constructor = factory.resolve(request.params.aseid);
|
|
1384
|
-
if (constructor) {
|
|
1385
|
-
const entity = new constructor(request.params.aseid);
|
|
1386
|
-
scope.register(entity);
|
|
1387
|
-
await entity.destroy();
|
|
1388
|
-
}
|
|
1389
|
-
}
|
|
1390
|
-
async callEntity(request, response, factory, scope) {
|
|
1391
|
-
if (!ASEID.isASEID(request.params.aseid)) {
|
|
1392
|
-
response.add("A_EntityController.callEntity", "Invalid ASEID");
|
|
1393
|
-
return;
|
|
1394
|
-
}
|
|
1395
|
-
const constructor = factory.resolve(request.params.aseid);
|
|
1396
|
-
if (!constructor) {
|
|
1397
|
-
response.add("A_EntityController.callEntity", "Entity not found");
|
|
1398
|
-
return;
|
|
1399
|
-
}
|
|
1400
|
-
const meta = A_Context.meta(constructor);
|
|
1401
|
-
const targetFeature = meta.features().find((f) => f.name === `${constructor.name}.${request.params.action}`);
|
|
1402
|
-
if (!targetFeature) {
|
|
1403
|
-
response.add("A_EntityController.callEntity", "Feature not found");
|
|
1404
|
-
return;
|
|
1405
|
-
}
|
|
1406
|
-
const entity = new constructor(request.params.aseid);
|
|
1407
|
-
scope.register(entity);
|
|
1408
|
-
await entity.load(scope);
|
|
1409
|
-
await entity[targetFeature.handler](scope);
|
|
1410
|
-
response.add("result", scope.toJSON());
|
|
1411
|
-
response.add("entity", entity);
|
|
1412
|
-
response.add("type", entity.aseid.entity);
|
|
1413
|
-
}
|
|
1414
|
-
};
|
|
1415
|
-
__decorateClass([
|
|
1416
|
-
A_Router.Get({
|
|
1417
|
-
path: "/:type",
|
|
1418
|
-
version: "v1",
|
|
1419
|
-
prefix: "a-list"
|
|
1420
|
-
}),
|
|
1421
|
-
__decorateParam(0, A_Inject(A_Request)),
|
|
1422
|
-
__decorateParam(1, A_Inject(A_Response)),
|
|
1423
|
-
__decorateParam(2, A_Inject(A_EntityFactory)),
|
|
1424
|
-
__decorateParam(3, A_Inject(A_Scope)),
|
|
1425
|
-
__decorateParam(4, A_Inject(A_Config))
|
|
1426
|
-
], A_EntityController.prototype, "list");
|
|
1427
|
-
__decorateClass([
|
|
1428
|
-
A_Feature.Define({
|
|
1429
|
-
name: "getEntity",
|
|
1430
|
-
invoke: false
|
|
1431
|
-
}),
|
|
1432
|
-
A_Router.Get({
|
|
1433
|
-
path: "/:aseid",
|
|
1434
|
-
version: "v1",
|
|
1435
|
-
prefix: "a-entity"
|
|
1436
|
-
}),
|
|
1437
|
-
__decorateParam(0, A_Inject(A_Request)),
|
|
1438
|
-
__decorateParam(1, A_Inject(A_Response)),
|
|
1439
|
-
__decorateParam(2, A_Inject(A_Scope))
|
|
1440
|
-
], A_EntityController.prototype, "load");
|
|
1441
|
-
__decorateClass([
|
|
1442
|
-
A_Router.Post({
|
|
1443
|
-
path: "/",
|
|
1444
|
-
version: "v1",
|
|
1445
|
-
prefix: "a-entity"
|
|
1446
|
-
}),
|
|
1447
|
-
__decorateParam(0, A_Inject(A_Request)),
|
|
1448
|
-
__decorateParam(1, A_Inject(A_EntityFactory)),
|
|
1449
|
-
__decorateParam(2, A_Inject(A_Scope))
|
|
1450
|
-
], A_EntityController.prototype, "create");
|
|
1451
|
-
__decorateClass([
|
|
1452
|
-
A_Router.Put({
|
|
1453
|
-
path: "/:aseid",
|
|
1454
|
-
version: "v1",
|
|
1455
|
-
prefix: "a-entity"
|
|
1456
|
-
}),
|
|
1457
|
-
__decorateParam(0, A_Inject(A_Request)),
|
|
1458
|
-
__decorateParam(1, A_Inject(A_Response)),
|
|
1459
|
-
__decorateParam(2, A_Inject(A_EntityFactory)),
|
|
1460
|
-
__decorateParam(3, A_Inject(A_Scope))
|
|
1461
|
-
], A_EntityController.prototype, "update");
|
|
1462
|
-
__decorateClass([
|
|
1463
|
-
A_Router.Delete({
|
|
1464
|
-
path: "/:aseid",
|
|
1465
|
-
version: "v1",
|
|
1466
|
-
prefix: "a-entity"
|
|
1467
|
-
}),
|
|
1468
|
-
__decorateParam(0, A_Inject(A_Request)),
|
|
1469
|
-
__decorateParam(1, A_Inject(A_Response)),
|
|
1470
|
-
__decorateParam(2, A_Inject(A_EntityFactory)),
|
|
1471
|
-
__decorateParam(3, A_Inject(A_Scope))
|
|
1472
|
-
], A_EntityController.prototype, "delete");
|
|
1473
|
-
__decorateClass([
|
|
1474
|
-
A_Router.Post({
|
|
1475
|
-
path: "/:aseid/:action",
|
|
1476
|
-
version: "v1",
|
|
1477
|
-
prefix: "a-entity"
|
|
1478
|
-
}),
|
|
1479
|
-
__decorateParam(0, A_Inject(A_Request)),
|
|
1480
|
-
__decorateParam(1, A_Inject(A_Response)),
|
|
1481
|
-
__decorateParam(2, A_Inject(A_EntityFactory)),
|
|
1482
|
-
__decorateParam(3, A_Inject(A_Scope))
|
|
1483
|
-
], A_EntityController.prototype, "callEntity");
|
|
1484
|
-
var A_ServerHealthMonitor = class extends A_Component {
|
|
1485
|
-
async get(config, request, response, logger) {
|
|
1486
|
-
logger.log("Health check requested", config.get("A_CONCEPT_ROOT_FOLDER"));
|
|
1487
|
-
const packageJSON = await import(`${config.get("A_CONCEPT_ROOT_FOLDER")}/package.json`);
|
|
1488
|
-
const exposedProperties = config.get("EXPOSED_PROPERTIES")?.split(",") || [
|
|
1489
|
-
"name",
|
|
1490
|
-
"version",
|
|
1491
|
-
"description"
|
|
1492
|
-
];
|
|
1493
|
-
exposedProperties.forEach((prop) => response.add(prop, packageJSON[prop]));
|
|
1494
|
-
console.log(`Health check accessed: ${request.method} ${request.url}`);
|
|
1495
|
-
}
|
|
1496
|
-
};
|
|
1497
|
-
__decorateClass([
|
|
1498
|
-
A_Router.Get({
|
|
1499
|
-
path: "/",
|
|
1500
|
-
prefix: "health",
|
|
1501
|
-
version: "v1"
|
|
1502
|
-
}),
|
|
1503
|
-
__decorateParam(0, A_Inject(A_Config)),
|
|
1504
|
-
__decorateParam(1, A_Inject(A_Request)),
|
|
1505
|
-
__decorateParam(2, A_Inject(A_Response)),
|
|
1506
|
-
__decorateParam(3, A_Inject(A_Logger))
|
|
1507
|
-
], A_ServerHealthMonitor.prototype, "get");
|
|
1508
|
-
var A_ServerProxy = class extends A_Component {
|
|
1509
|
-
async load(logger, config) {
|
|
1510
|
-
logger.log(
|
|
1511
|
-
"pink",
|
|
1512
|
-
`Proxy routes configured:`,
|
|
1513
|
-
config.configs.map((c) => c.route).join("\n")
|
|
1514
|
-
);
|
|
1515
|
-
}
|
|
1516
|
-
async onRequest(req, res, proxyConfig, logger, polyfill) {
|
|
1517
|
-
return new Promise(async (resolve, reject) => {
|
|
1518
|
-
const { method, url } = req;
|
|
1519
|
-
const route = new A_Route(url, method);
|
|
1520
|
-
const config = proxyConfig.config(route.toString());
|
|
1521
|
-
if (!config) {
|
|
1522
|
-
return resolve();
|
|
1523
|
-
}
|
|
1524
|
-
logger.log(
|
|
1525
|
-
"yellow",
|
|
1526
|
-
`Proxying request ${method} ${url} to ${config.hostname}`,
|
|
1527
|
-
config
|
|
1528
|
-
);
|
|
1529
|
-
const client = await (config.protocol === "https:" ? polyfill.https() : polyfill.http());
|
|
1530
|
-
const proxyReq = client.request(
|
|
1531
|
-
{
|
|
1532
|
-
method: config.route.method,
|
|
1533
|
-
hostname: config.hostname,
|
|
1534
|
-
port: config.port,
|
|
1535
|
-
headers: config.headers,
|
|
1536
|
-
path: route.path
|
|
1537
|
-
},
|
|
1538
|
-
(proxyRes) => {
|
|
1539
|
-
if (!res.headersSent) {
|
|
1540
|
-
res.writeHead(proxyRes.statusCode || 200, proxyRes.headers);
|
|
1541
|
-
}
|
|
1542
|
-
proxyRes.on("end", () => {
|
|
1543
|
-
logger.log("green", `Proxy request to ${config?.hostname} completed`);
|
|
1544
|
-
resolve();
|
|
1545
|
-
});
|
|
1546
|
-
proxyRes.pipe(res.original);
|
|
1547
|
-
}
|
|
1548
|
-
);
|
|
1549
|
-
proxyReq.on("error", (err) => reject(err));
|
|
1550
|
-
req.pipe(proxyReq);
|
|
1551
|
-
});
|
|
1552
|
-
}
|
|
1553
|
-
};
|
|
1554
|
-
__decorateClass([
|
|
1555
|
-
A_Concept.Load(),
|
|
1556
|
-
__decorateParam(0, A_Inject(A_Logger)),
|
|
1557
|
-
__decorateParam(1, A_Inject(A_ProxyConfig))
|
|
1558
|
-
], A_ServerProxy.prototype, "load");
|
|
1559
|
-
__decorateClass([
|
|
1560
|
-
A_Feature.Extend({
|
|
1561
|
-
name: "onRequest" /* onRequest */
|
|
1562
|
-
}),
|
|
1563
|
-
__decorateParam(0, A_Inject(A_Request)),
|
|
1564
|
-
__decorateParam(1, A_Inject(A_Response)),
|
|
1565
|
-
__decorateParam(2, A_Inject(A_ProxyConfig)),
|
|
1566
|
-
__decorateParam(3, A_Inject(A_Logger)),
|
|
1567
|
-
__decorateParam(4, A_Inject(A_Polyfill))
|
|
1568
|
-
], A_ServerProxy.prototype, "onRequest");
|
|
1569
|
-
|
|
1570
|
-
// src/components/A-ServerCORS/A_ServerCORS.component.defaults.ts
|
|
1571
|
-
var A_SERVER_DEFAULTS__CorsConfig = {
|
|
1572
|
-
origin: "*",
|
|
1573
|
-
// Default to allow all origins
|
|
1574
|
-
methods: ["GET", "POST", "PUT", "DELETE", "OPTIONS"],
|
|
1575
|
-
headers: ["Content-Type"],
|
|
1576
|
-
credentials: false,
|
|
1577
|
-
maxAge: 0
|
|
1578
|
-
};
|
|
1579
|
-
var A_ServerCORS = class extends A_Component {
|
|
1580
|
-
async init(config) {
|
|
1581
|
-
this.config = {
|
|
1582
|
-
origin: config.get("ORIGIN") || A_SERVER_DEFAULTS__CorsConfig.origin,
|
|
1583
|
-
methods: config.get("METHODS") || A_SERVER_DEFAULTS__CorsConfig.methods,
|
|
1584
|
-
headers: config.get("HEADERS") || A_SERVER_DEFAULTS__CorsConfig.headers,
|
|
1585
|
-
credentials: config.get("CREDENTIALS") || A_SERVER_DEFAULTS__CorsConfig.credentials,
|
|
1586
|
-
maxAge: config.get("MAX_AGE") || A_SERVER_DEFAULTS__CorsConfig.maxAge
|
|
1587
|
-
};
|
|
1588
|
-
}
|
|
1589
|
-
apply(aReq, aRes) {
|
|
1590
|
-
aRes.setHeader("Access-Control-Allow-Origin", this.config.origin);
|
|
1591
|
-
aRes.setHeader("Access-Control-Allow-Methods", this.config.methods.join(", "));
|
|
1592
|
-
aRes.setHeader("Access-Control-Allow-Headers", this.config.headers.join(", "));
|
|
1593
|
-
if (this.config.credentials) {
|
|
1594
|
-
aRes.setHeader("Access-Control-Allow-Credentials", "true");
|
|
1595
|
-
}
|
|
1596
|
-
if (this.config.maxAge) {
|
|
1597
|
-
aRes.setHeader("Access-Control-Max-Age", this.config.maxAge.toString());
|
|
1598
|
-
}
|
|
1599
|
-
if (aReq.req.method === "OPTIONS") {
|
|
1600
|
-
aRes.status(204).send();
|
|
1601
|
-
}
|
|
1602
|
-
}
|
|
1603
|
-
};
|
|
1604
|
-
__decorateClass([
|
|
1605
|
-
A_Feature.Extend({
|
|
1606
|
-
name: "beforeStart" /* beforeStart */
|
|
1607
|
-
}),
|
|
1608
|
-
__decorateParam(0, A_Inject(A_Config))
|
|
1609
|
-
], A_ServerCORS.prototype, "init");
|
|
1610
|
-
__decorateClass([
|
|
1611
|
-
A_Feature.Extend({
|
|
1612
|
-
name: "beforeRequest" /* beforeRequest */
|
|
1613
|
-
}),
|
|
1614
|
-
__decorateParam(0, A_Inject(A_Request)),
|
|
1615
|
-
__decorateParam(1, A_Inject(A_Response))
|
|
1616
|
-
], A_ServerCORS.prototype, "apply");
|
|
1617
|
-
var A_StaticLoader = class extends A_Component {
|
|
1618
|
-
async load(logger, config) {
|
|
1619
|
-
logger.log(
|
|
1620
|
-
"pink",
|
|
1621
|
-
`Static directories configured:`,
|
|
1622
|
-
config.directories.join("\n")
|
|
1623
|
-
);
|
|
1624
|
-
}
|
|
1625
|
-
async onRequest(req, res, logger, config) {
|
|
1626
|
-
if (req.method !== "GET" && req.method !== "HEAD") {
|
|
1627
|
-
return;
|
|
1628
|
-
}
|
|
1629
|
-
const { method, url } = req;
|
|
1630
|
-
const route = new A_Route(url, method);
|
|
1631
|
-
const staticDirConfig = config.has(route.path);
|
|
1632
|
-
if (!staticDirConfig) {
|
|
1633
|
-
return;
|
|
1634
|
-
}
|
|
1635
|
-
const staticDir = path.resolve(process.cwd(), staticDirConfig);
|
|
1636
|
-
if (!fs.existsSync(staticDir) || !fs.statSync(staticDir).isDirectory()) {
|
|
1637
|
-
logger.log("red", `Static directory ${staticDir} does not exist or is not a directory.`);
|
|
1638
|
-
return;
|
|
1639
|
-
}
|
|
1640
|
-
await this.serveFile(route.path.startsWith("/") ? route.path.slice(1) : route.path, res);
|
|
1641
|
-
}
|
|
1642
|
-
getMimeType(ext) {
|
|
1643
|
-
const mimeTypes = {
|
|
1644
|
-
".html": "text/html",
|
|
1645
|
-
".js": "application/javascript",
|
|
1646
|
-
".css": "text/css",
|
|
1647
|
-
".json": "application/json",
|
|
1648
|
-
".png": "image/png",
|
|
1649
|
-
".jpg": "image/jpeg",
|
|
1650
|
-
".jpeg": "image/jpeg",
|
|
1651
|
-
".gif": "image/gif",
|
|
1652
|
-
".svg": "image/svg+xml",
|
|
1653
|
-
".ico": "image/x-icon",
|
|
1654
|
-
".txt": "text/plain"
|
|
1655
|
-
};
|
|
1656
|
-
return mimeTypes[ext.toLowerCase()] || "application/octet-stream";
|
|
1657
|
-
}
|
|
1658
|
-
safeFilePath(staticDir, reqUrl, host) {
|
|
1659
|
-
const parsedUrl = new URL$1(reqUrl || "/", `http://${host || "localhost"}`);
|
|
1660
|
-
let pathname = decodeURIComponent(parsedUrl.pathname);
|
|
1661
|
-
pathname = pathname.replace(/\.\.[\/\\]/g, "");
|
|
1662
|
-
let filePath = path.join(staticDir, pathname);
|
|
1663
|
-
if (!fs.existsSync(filePath))
|
|
1664
|
-
throw new Error(`File not found: ${filePath}`);
|
|
1665
|
-
return filePath;
|
|
1666
|
-
}
|
|
1667
|
-
serveFile(filePath, res) {
|
|
1668
|
-
return new Promise((resolve, reject) => {
|
|
1669
|
-
if (fs.existsSync(filePath)) {
|
|
1670
|
-
const ext = path.extname(filePath);
|
|
1671
|
-
const contentType = this.getMimeType(ext);
|
|
1672
|
-
res.writeHead(200, { "Content-Type": contentType });
|
|
1673
|
-
const stream = fs.createReadStream(filePath);
|
|
1674
|
-
stream.pipe(res.original);
|
|
1675
|
-
stream.on("end", () => {
|
|
1676
|
-
resolve();
|
|
1677
|
-
});
|
|
1678
|
-
stream.on("error", (err) => {
|
|
1679
|
-
reject(new Error(`File stream error: ${err.message}`));
|
|
1680
|
-
});
|
|
1681
|
-
} else {
|
|
1682
|
-
reject(new Error(`File not found: ${filePath}`));
|
|
1683
|
-
}
|
|
1684
|
-
resolve();
|
|
1685
|
-
});
|
|
1686
|
-
}
|
|
1687
|
-
};
|
|
1688
|
-
__decorateClass([
|
|
1689
|
-
A_Concept.Load(),
|
|
1690
|
-
__decorateParam(0, A_Inject(A_Logger)),
|
|
1691
|
-
__decorateParam(1, A_Inject(A_StaticConfig))
|
|
1692
|
-
], A_StaticLoader.prototype, "load");
|
|
1693
|
-
__decorateClass([
|
|
1694
|
-
A_Feature.Extend({
|
|
1695
|
-
name: "onRequest" /* onRequest */
|
|
1696
|
-
}),
|
|
1697
|
-
__decorateParam(0, A_Inject(A_Request)),
|
|
1698
|
-
__decorateParam(1, A_Inject(A_Response)),
|
|
1699
|
-
__decorateParam(2, A_Inject(A_Logger)),
|
|
1700
|
-
__decorateParam(3, A_Inject(A_StaticConfig))
|
|
1701
|
-
], A_StaticLoader.prototype, "onRequest");
|
|
1702
|
-
var A_Controller = class extends A_Component {
|
|
1703
|
-
async callEntityMethod(request, response, scope) {
|
|
1704
|
-
if (!scope.has(request.params.component))
|
|
1705
|
-
return;
|
|
1706
|
-
if (!request.params.operation || typeof request.params.operation !== "string")
|
|
1707
|
-
return;
|
|
1708
|
-
const possibleComponent = scope.resolve(request.params.component);
|
|
1709
|
-
if (!possibleComponent || ![A_Component, A_Container].some((c) => possibleComponent instanceof c))
|
|
1710
|
-
return;
|
|
1711
|
-
const component = possibleComponent;
|
|
1712
|
-
const meta = A_Context.meta(component);
|
|
1713
|
-
const targetFeature = meta.features().find((f) => f.name === `${component.constructor.name}.${request.params.operation}`);
|
|
1714
|
-
if (!targetFeature)
|
|
1715
|
-
return;
|
|
1716
|
-
await component.call(request.params.operation, scope);
|
|
1717
|
-
}
|
|
1718
|
-
};
|
|
1719
|
-
__decorateClass([
|
|
1720
|
-
A_Router.Post({
|
|
1721
|
-
path: "/:component/:operation",
|
|
1722
|
-
version: "v1",
|
|
1723
|
-
prefix: "a-component"
|
|
1724
|
-
}),
|
|
1725
|
-
__decorateParam(0, A_Inject(A_Request)),
|
|
1726
|
-
__decorateParam(1, A_Inject(A_Response)),
|
|
1727
|
-
__decorateParam(2, A_Inject(A_Scope))
|
|
1728
|
-
], A_Controller.prototype, "callEntityMethod");
|
|
1729
|
-
var A_ListingController = class extends A_Component {
|
|
1730
|
-
async list(request, response, factory, scope, config) {
|
|
1731
|
-
const constructor = factory.resolveByName(request.params.type);
|
|
1732
|
-
if (constructor) {
|
|
1733
|
-
const entityList = new A_EntityList({
|
|
1734
|
-
name: request.params.type,
|
|
1735
|
-
scope: scope.name,
|
|
1736
|
-
constructor
|
|
1737
|
-
});
|
|
1738
|
-
scope.register(entityList);
|
|
1739
|
-
const queryFilter = new A_ListQueryFilter(request.query, {
|
|
1740
|
-
itemsPerPage: String(config.get("A_LIST_ITEMS_PER_PAGE") || "10"),
|
|
1741
|
-
page: String(config.get("A_LIST_PAGE") || "1")
|
|
1742
|
-
});
|
|
1743
|
-
const queryScope = new A_Scope({
|
|
1744
|
-
fragments: [queryFilter]
|
|
1745
|
-
}).inherit(scope);
|
|
1746
|
-
await entityList.load(queryScope);
|
|
1747
|
-
response.add("items", entityList.items);
|
|
1748
|
-
response.add("pagination", entityList.pagination);
|
|
1749
|
-
}
|
|
1750
|
-
}
|
|
1751
|
-
};
|
|
1752
|
-
__decorateClass([
|
|
1753
|
-
A_Router.Get({
|
|
1754
|
-
path: "/:type",
|
|
1755
|
-
version: "v1",
|
|
1756
|
-
prefix: "a-list"
|
|
1757
|
-
}),
|
|
1758
|
-
__decorateParam(0, A_Inject(A_Request)),
|
|
1759
|
-
__decorateParam(1, A_Inject(A_Response)),
|
|
1760
|
-
__decorateParam(2, A_Inject(A_EntityFactory)),
|
|
1761
|
-
__decorateParam(3, A_Inject(A_Scope)),
|
|
1762
|
-
__decorateParam(4, A_Inject(A_Config))
|
|
1763
|
-
], A_ListingController.prototype, "list");
|
|
1764
|
-
var A_CommandController = class extends A_Component {
|
|
1765
|
-
async handleCommand(req, res, scope, container) {
|
|
1766
|
-
const commandName = req.params.command;
|
|
1767
|
-
const CommandConstructor = scope.resolveConstructor(commandName);
|
|
1768
|
-
if (!CommandConstructor) {
|
|
1769
|
-
res.status(404);
|
|
1770
|
-
throw new Error(`Command ${commandName} not found`);
|
|
1771
|
-
}
|
|
1772
|
-
const command = new CommandConstructor(req.body);
|
|
1773
|
-
container.scope.register(command);
|
|
1774
|
-
await command.execute();
|
|
1775
|
-
const serialized = command.toJSON();
|
|
1776
|
-
return res.status(200).json(serialized);
|
|
1777
|
-
}
|
|
1778
|
-
};
|
|
1779
|
-
__decorateClass([
|
|
1780
|
-
A_Router.Get({
|
|
1781
|
-
path: "/:command/execute",
|
|
1782
|
-
version: "v1",
|
|
1783
|
-
prefix: "a-command"
|
|
1784
|
-
}),
|
|
1785
|
-
__decorateParam(0, A_Inject(A_Request)),
|
|
1786
|
-
__decorateParam(1, A_Inject(A_Response)),
|
|
1787
|
-
__decorateParam(2, A_Inject(A_Scope)),
|
|
1788
|
-
__decorateParam(3, A_Inject(A_Container))
|
|
1789
|
-
], A_CommandController.prototype, "handleCommand");
|
|
1790
|
-
var A_EntityRepository = class extends A_Component {
|
|
1791
|
-
async list(channel, entity, scope) {
|
|
1792
|
-
if (scope.has(A_Manifest) && !scope.resolve(A_Manifest).isAllowed(entity.constructor, "load").for(entity.constructor))
|
|
1793
|
-
return;
|
|
1794
|
-
const response = await channel.get(`/a-list/${entity.aseid.entity}`);
|
|
1795
|
-
entity.fromJSON(response.data);
|
|
1796
|
-
}
|
|
1797
|
-
async load(channel, entity, scope) {
|
|
1798
|
-
if (scope.has(A_Manifest) && !scope.resolve(A_Manifest).isAllowed(entity.constructor, "load").for(entity.constructor))
|
|
1799
|
-
return;
|
|
1800
|
-
const response = await channel.get(`/a-entity/${entity.aseid.toString()}`);
|
|
1801
|
-
entity.fromJSON(response.data);
|
|
1802
|
-
}
|
|
1803
|
-
async save(channel, entity, scope) {
|
|
1804
|
-
if (scope.has(A_Manifest) && !scope.resolve(A_Manifest).isAllowed(entity.constructor, "save").for(entity.constructor))
|
|
1805
|
-
return;
|
|
1806
|
-
const response = await channel.post(`/a-entity/${entity.aseid.toString()}`, entity.toJSON());
|
|
1807
|
-
entity.fromJSON(response.data);
|
|
1808
|
-
}
|
|
1809
|
-
async destroy(channel, entity, scope) {
|
|
1810
|
-
if (scope.has(A_Manifest) && !scope.resolve(A_Manifest).isAllowed(entity.constructor, "destroy").for(entity.constructor))
|
|
1811
|
-
return;
|
|
1812
|
-
const response = await channel.delete(`/a-entity/${entity.aseid.toString()}`);
|
|
1813
|
-
entity.fromJSON(response.data);
|
|
1814
|
-
}
|
|
1815
|
-
};
|
|
1816
|
-
__decorateClass([
|
|
1817
|
-
A_Feature.Extend({
|
|
1818
|
-
name: A_TYPES__EntityFeatures.LOAD,
|
|
1819
|
-
scope: {
|
|
1820
|
-
include: [A_EntityList]
|
|
1821
|
-
}
|
|
1822
|
-
}),
|
|
1823
|
-
__decorateParam(0, A_Inject(A_HTTPChannel)),
|
|
1824
|
-
__decorateParam(1, A_Inject(A_Caller)),
|
|
1825
|
-
__decorateParam(2, A_Inject(A_Scope))
|
|
1826
|
-
], A_EntityRepository.prototype, "list");
|
|
1827
|
-
__decorateClass([
|
|
1828
|
-
A_Feature.Extend({
|
|
1829
|
-
name: A_TYPES__EntityFeatures.LOAD,
|
|
1830
|
-
scope: {
|
|
1831
|
-
exclude: [A_EntityList]
|
|
1832
|
-
}
|
|
1833
|
-
}),
|
|
1834
|
-
__decorateParam(0, A_Inject(A_HTTPChannel)),
|
|
1835
|
-
__decorateParam(1, A_Inject(A_Caller)),
|
|
1836
|
-
__decorateParam(2, A_Inject(A_Scope))
|
|
1837
|
-
], A_EntityRepository.prototype, "load");
|
|
1838
|
-
__decorateClass([
|
|
1839
|
-
A_Feature.Extend({
|
|
1840
|
-
name: A_TYPES__EntityFeatures.SAVE,
|
|
1841
|
-
scope: {
|
|
1842
|
-
exclude: [A_EntityList]
|
|
1843
|
-
}
|
|
1844
|
-
}),
|
|
1845
|
-
__decorateParam(0, A_Inject(A_HTTPChannel)),
|
|
1846
|
-
__decorateParam(1, A_Inject(A_Caller)),
|
|
1847
|
-
__decorateParam(2, A_Inject(A_Scope))
|
|
1848
|
-
], A_EntityRepository.prototype, "save");
|
|
1849
|
-
__decorateClass([
|
|
1850
|
-
A_Feature.Extend({
|
|
1851
|
-
name: A_TYPES__EntityFeatures.DESTROY,
|
|
1852
|
-
scope: {
|
|
1853
|
-
exclude: [A_EntityList]
|
|
1854
|
-
}
|
|
1855
|
-
}),
|
|
1856
|
-
__decorateParam(0, A_Inject(A_HTTPChannel)),
|
|
1857
|
-
__decorateParam(1, A_Inject(A_Caller)),
|
|
1858
|
-
__decorateParam(2, A_Inject(A_Scope))
|
|
1859
|
-
], A_EntityRepository.prototype, "destroy");
|
|
1860
|
-
|
|
1861
|
-
export { A_CommandController, A_Controller, A_EntityController, A_EntityFactory, A_EntityList, A_EntityRepository, A_HTTPChannel, A_HTTPChannelError, A_HTTPChannel_RequestContext, A_ListQueryFilter, A_ListingController, A_ProxyConfig, A_Request, A_Response, A_Route, A_Router, A_SERVER_CONSTANTS__A_HttpChannel_Lifecycle, A_SERVER_CONSTANTS__DEFAULT_ENV_VARIABLES, A_SERVER_CONSTANTS__DEFAULT_ENV_VARIABLES_ARRAY, A_SERVER_TYPES__ARouterComponentMetaKey, A_SERVER_TYPES__RequestEvent, A_SERVER_TYPES__ResponseEvent, A_SERVER_TYPES__RouterMethod, A_SERVER_TYPES__ServerFeature, A_SERVER_TYPES__ServerMethod, A_Server, A_ServerCORS, A_ServerError, A_ServerHealthMonitor, A_ServerLogger, A_ServerProxy, A_Service, A_StaticConfig, A_StaticLoader };
|
|
1862
|
-
//# sourceMappingURL=index.mjs.map
|
|
1863
|
-
//# sourceMappingURL=index.mjs.map
|