@adaas/a-server 0.0.22 → 0.0.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.conf/tsconfig.base.json +79 -0
- package/.conf/tsconfig.browser.json +32 -0
- package/.conf/tsconfig.node.json +33 -0
- package/LICENSE +10 -19
- package/dist/browser/index.d.mts +1669 -0
- package/dist/browser/index.mjs +2869 -0
- package/dist/browser/index.mjs.map +1 -0
- package/dist/node/A-Request.entity-8_9MCXT2.d.ts +533 -0
- package/dist/node/A-Request.entity-r905O60G.d.mts +533 -0
- package/dist/node/A-Response.entity-BVYAc6-8.d.mts +318 -0
- package/dist/node/A-Response.entity-CRc-t-vr.d.ts +318 -0
- package/dist/node/channels/A-Http/A-Http.channel.constants.d.mts +9 -0
- package/dist/node/channels/A-Http/A-Http.channel.constants.d.ts +9 -0
- package/dist/node/channels/A-Http/A-Http.channel.constants.js +13 -0
- package/dist/node/channels/A-Http/A-Http.channel.constants.js.map +1 -0
- package/dist/node/channels/A-Http/A-Http.channel.constants.mjs +12 -0
- package/dist/node/channels/A-Http/A-Http.channel.constants.mjs.map +1 -0
- package/dist/node/channels/A-Http/A-Http.channel.d.mts +23 -0
- package/dist/node/channels/A-Http/A-Http.channel.d.ts +23 -0
- package/dist/node/channels/A-Http/A-Http.channel.error.d.mts +7 -0
- package/dist/node/channels/A-Http/A-Http.channel.error.d.ts +7 -0
- package/dist/node/channels/A-Http/A-Http.channel.error.js +11 -0
- package/dist/node/channels/A-Http/A-Http.channel.error.js.map +1 -0
- package/dist/node/channels/A-Http/A-Http.channel.error.mjs +10 -0
- package/dist/node/channels/A-Http/A-Http.channel.error.mjs.map +1 -0
- package/dist/node/channels/A-Http/A-Http.channel.js +122 -0
- package/dist/node/channels/A-Http/A-Http.channel.js.map +1 -0
- package/dist/node/channels/A-Http/A-Http.channel.mjs +110 -0
- package/dist/node/channels/A-Http/A-Http.channel.mjs.map +1 -0
- package/dist/node/channels/A-Http/A-Http.channel.types.d.mts +67 -0
- package/dist/node/channels/A-Http/A-Http.channel.types.d.ts +67 -0
- package/dist/node/channels/A-Http/A-Http.channel.types.js +4 -0
- package/dist/node/channels/A-Http/A-Http.channel.types.js.map +1 -0
- package/dist/node/channels/A-Http/A-Http.channel.types.mjs +3 -0
- package/dist/node/channels/A-Http/A-Http.channel.types.mjs.map +1 -0
- package/dist/node/channels/A-Websockets/A-Websockets.channel.d.mts +7 -0
- package/dist/node/channels/A-Websockets/A-Websockets.channel.d.ts +7 -0
- package/dist/node/channels/A-Websockets/A-Websockets.channel.js +13 -0
- package/dist/node/channels/A-Websockets/A-Websockets.channel.js.map +1 -0
- package/dist/node/channels/A-Websockets/A-Websockets.channel.mjs +12 -0
- package/dist/node/channels/A-Websockets/A-Websockets.channel.mjs.map +1 -0
- package/dist/node/chunk-EQQGB2QZ.mjs +15 -0
- package/dist/node/chunk-EQQGB2QZ.mjs.map +1 -0
- package/dist/node/constants/env.constants.d.mts +12 -0
- package/dist/node/constants/env.constants.d.ts +12 -0
- package/dist/node/constants/env.constants.js +23 -0
- package/dist/node/constants/env.constants.js.map +1 -0
- package/dist/node/constants/env.constants.mjs +22 -0
- package/dist/node/constants/env.constants.mjs.map +1 -0
- package/dist/node/controllers/A-CommandController/A-CommandController.component.d.mts +29 -0
- package/dist/node/controllers/A-CommandController/A-CommandController.component.d.ts +29 -0
- package/dist/node/controllers/A-CommandController/A-CommandController.component.js +55 -0
- package/dist/node/controllers/A-CommandController/A-CommandController.component.js.map +1 -0
- package/dist/node/controllers/A-CommandController/A-CommandController.component.mjs +43 -0
- package/dist/node/controllers/A-CommandController/A-CommandController.component.mjs.map +1 -0
- package/dist/node/controllers/A-EntityController/A-EntityController.component.d.mts +44 -0
- package/dist/node/controllers/A-EntityController/A-EntityController.component.d.ts +44 -0
- package/dist/node/controllers/A-EntityController/A-EntityController.component.js +189 -0
- package/dist/node/controllers/A-EntityController/A-EntityController.component.js.map +1 -0
- package/dist/node/controllers/A-EntityController/A-EntityController.component.mjs +177 -0
- package/dist/node/controllers/A-EntityController/A-EntityController.component.mjs.map +1 -0
- package/dist/node/controllers/A-EntityController/A-EntityController.component.types.d.mts +2 -0
- package/dist/node/controllers/A-EntityController/A-EntityController.component.types.d.ts +2 -0
- package/dist/node/controllers/A-EntityController/A-EntityController.component.types.js +4 -0
- package/dist/node/controllers/A-EntityController/A-EntityController.component.types.js.map +1 -0
- package/dist/node/controllers/A-EntityController/A-EntityController.component.types.mjs +3 -0
- package/dist/node/controllers/A-EntityController/A-EntityController.component.types.mjs.map +1 -0
- package/dist/node/controllers/A-ListingController/A-ListingController.component.d.mts +28 -0
- package/dist/node/controllers/A-ListingController/A-ListingController.component.d.ts +28 -0
- package/dist/node/controllers/A-ListingController/A-ListingController.component.js +59 -0
- package/dist/node/controllers/A-ListingController/A-ListingController.component.js.map +1 -0
- package/dist/node/controllers/A-ListingController/A-ListingController.component.mjs +47 -0
- package/dist/node/controllers/A-ListingController/A-ListingController.component.mjs.map +1 -0
- package/dist/node/controllers/A-ListingController/A-ListingController.types.d.mts +2 -0
- package/dist/node/controllers/A-ListingController/A-ListingController.types.d.ts +2 -0
- package/dist/node/controllers/A-ListingController/A-ListingController.types.js +4 -0
- package/dist/node/controllers/A-ListingController/A-ListingController.types.js.map +1 -0
- package/dist/node/controllers/A-ListingController/A-ListingController.types.mjs +3 -0
- package/dist/node/controllers/A-ListingController/A-ListingController.types.mjs.map +1 -0
- package/dist/node/controllers/A-ServerHealthMonitor/A-ServerHealthMonitor.component.d.mts +30 -0
- package/dist/node/controllers/A-ServerHealthMonitor/A-ServerHealthMonitor.component.d.ts +30 -0
- package/dist/node/controllers/A-ServerHealthMonitor/A-ServerHealthMonitor.component.js +46 -0
- package/dist/node/controllers/A-ServerHealthMonitor/A-ServerHealthMonitor.component.js.map +1 -0
- package/dist/node/controllers/A-ServerHealthMonitor/A-ServerHealthMonitor.component.mjs +34 -0
- package/dist/node/controllers/A-ServerHealthMonitor/A-ServerHealthMonitor.component.mjs.map +1 -0
- package/dist/node/controllers/A-ServerHealthMonitor/A-ServerHealthMonitor.types.d.mts +2 -0
- package/dist/node/controllers/A-ServerHealthMonitor/A-ServerHealthMonitor.types.d.ts +2 -0
- package/dist/node/controllers/A-ServerHealthMonitor/A-ServerHealthMonitor.types.js +4 -0
- package/dist/node/controllers/A-ServerHealthMonitor/A-ServerHealthMonitor.types.js.map +1 -0
- package/dist/node/controllers/A-ServerHealthMonitor/A-ServerHealthMonitor.types.mjs +3 -0
- package/dist/node/controllers/A-ServerHealthMonitor/A-ServerHealthMonitor.types.mjs.map +1 -0
- package/dist/node/index.d.mts +51 -0
- package/dist/node/index.d.ts +51 -0
- package/dist/node/index.js +320 -0
- package/dist/node/index.js.map +1 -0
- package/dist/node/index.mjs +48 -0
- package/dist/node/index.mjs.map +1 -0
- package/dist/node/lib/A-Request/A-HttpRequestData.context.d.mts +12 -0
- package/dist/node/lib/A-Request/A-HttpRequestData.context.d.ts +12 -0
- package/dist/node/lib/A-Request/A-HttpRequestData.context.js +25 -0
- package/dist/node/lib/A-Request/A-HttpRequestData.context.js.map +1 -0
- package/dist/node/lib/A-Request/A-HttpRequestData.context.mjs +24 -0
- package/dist/node/lib/A-Request/A-HttpRequestData.context.mjs.map +1 -0
- package/dist/node/lib/A-Request/A-HttpServerRequest.context.d.mts +39 -0
- package/dist/node/lib/A-Request/A-HttpServerRequest.context.d.ts +39 -0
- package/dist/node/lib/A-Request/A-HttpServerRequest.context.js +56 -0
- package/dist/node/lib/A-Request/A-HttpServerRequest.context.js.map +1 -0
- package/dist/node/lib/A-Request/A-HttpServerRequest.context.mjs +55 -0
- package/dist/node/lib/A-Request/A-HttpServerRequest.context.mjs.map +1 -0
- package/dist/node/lib/A-Request/A-Request.constants.d.mts +18 -0
- package/dist/node/lib/A-Request/A-Request.constants.d.ts +18 -0
- package/dist/node/lib/A-Request/A-Request.constants.js +22 -0
- package/dist/node/lib/A-Request/A-Request.constants.js.map +1 -0
- package/dist/node/lib/A-Request/A-Request.constants.mjs +22 -0
- package/dist/node/lib/A-Request/A-Request.constants.mjs.map +1 -0
- package/dist/node/lib/A-Request/A-Request.entity.d.mts +17 -0
- package/dist/node/lib/A-Request/A-Request.entity.d.ts +17 -0
- package/dist/node/lib/A-Request/A-Request.entity.js +651 -0
- package/dist/node/lib/A-Request/A-Request.entity.js.map +1 -0
- package/dist/node/lib/A-Request/A-Request.entity.mjs +639 -0
- package/dist/node/lib/A-Request/A-Request.entity.mjs.map +1 -0
- package/dist/node/lib/A-Request/A-Request.env.d.mts +37 -0
- package/dist/node/lib/A-Request/A-Request.env.d.ts +37 -0
- package/dist/node/lib/A-Request/A-Request.env.js +39 -0
- package/dist/node/lib/A-Request/A-Request.env.js.map +1 -0
- package/dist/node/lib/A-Request/A-Request.env.mjs +38 -0
- package/dist/node/lib/A-Request/A-Request.env.mjs.map +1 -0
- package/dist/node/lib/A-Request/A-Request.error.d.mts +11 -0
- package/dist/node/lib/A-Request/A-Request.error.d.ts +11 -0
- package/dist/node/lib/A-Request/A-Request.error.js +15 -0
- package/dist/node/lib/A-Request/A-Request.error.js.map +1 -0
- package/dist/node/lib/A-Request/A-Request.error.mjs +14 -0
- package/dist/node/lib/A-Request/A-Request.error.mjs.map +1 -0
- package/dist/node/lib/A-Request/A-Request.helper.d.mts +105 -0
- package/dist/node/lib/A-Request/A-Request.helper.d.ts +105 -0
- package/dist/node/lib/A-Request/A-Request.helper.js +181 -0
- package/dist/node/lib/A-Request/A-Request.helper.js.map +1 -0
- package/dist/node/lib/A-Request/A-Request.helper.mjs +180 -0
- package/dist/node/lib/A-Request/A-Request.helper.mjs.map +1 -0
- package/dist/node/lib/A-Request/A-Request.types.d.mts +17 -0
- package/dist/node/lib/A-Request/A-Request.types.d.ts +17 -0
- package/dist/node/lib/A-Request/A-Request.types.js +14 -0
- package/dist/node/lib/A-Request/A-Request.types.js.map +1 -0
- package/dist/node/lib/A-Request/A-Request.types.mjs +14 -0
- package/dist/node/lib/A-Request/A-Request.types.mjs.map +1 -0
- package/dist/node/lib/A-Response/A-Response.constants.d.mts +24 -0
- package/dist/node/lib/A-Response/A-Response.constants.d.ts +24 -0
- package/dist/node/lib/A-Response/A-Response.constants.js +28 -0
- package/dist/node/lib/A-Response/A-Response.constants.js.map +1 -0
- package/dist/node/lib/A-Response/A-Response.constants.mjs +28 -0
- package/dist/node/lib/A-Response/A-Response.constants.mjs.map +1 -0
- package/dist/node/lib/A-Response/A-Response.entity.d.mts +20 -0
- package/dist/node/lib/A-Response/A-Response.entity.d.ts +20 -0
- package/dist/node/lib/A-Response/A-Response.entity.js +544 -0
- package/dist/node/lib/A-Response/A-Response.entity.js.map +1 -0
- package/dist/node/lib/A-Response/A-Response.entity.mjs +532 -0
- package/dist/node/lib/A-Response/A-Response.entity.mjs.map +1 -0
- package/dist/node/lib/A-Response/A-Response.env.d.mts +2 -0
- package/dist/node/lib/A-Response/A-Response.env.d.ts +2 -0
- package/dist/node/lib/A-Response/A-Response.env.js +4 -0
- package/dist/node/lib/A-Response/A-Response.env.js.map +1 -0
- package/dist/node/lib/A-Response/A-Response.env.mjs +3 -0
- package/dist/node/lib/A-Response/A-Response.env.mjs.map +1 -0
- package/dist/node/lib/A-Response/A-Response.error.d.mts +6 -0
- package/dist/node/lib/A-Response/A-Response.error.d.ts +6 -0
- package/dist/node/lib/A-Response/A-Response.error.js +10 -0
- package/dist/node/lib/A-Response/A-Response.error.js.map +1 -0
- package/dist/node/lib/A-Response/A-Response.error.mjs +9 -0
- package/dist/node/lib/A-Response/A-Response.error.mjs.map +1 -0
- package/dist/node/lib/A-Response/A-Response.types.d.mts +20 -0
- package/dist/node/lib/A-Response/A-Response.types.d.ts +20 -0
- package/dist/node/lib/A-Response/A-Response.types.js +4 -0
- package/dist/node/lib/A-Response/A-Response.types.js.map +1 -0
- package/dist/node/lib/A-Response/A-Response.types.mjs +3 -0
- package/dist/node/lib/A-Response/A-Response.types.mjs.map +1 -0
- package/dist/node/lib/A-Server/A-HttpServer.constants.d.mts +7 -0
- package/dist/node/lib/A-Server/A-HttpServer.constants.d.ts +7 -0
- package/dist/node/lib/A-Server/A-HttpServer.constants.js +11 -0
- package/dist/node/lib/A-Server/A-HttpServer.constants.js.map +1 -0
- package/dist/node/lib/A-Server/A-HttpServer.constants.mjs +11 -0
- package/dist/node/lib/A-Server/A-HttpServer.constants.mjs.map +1 -0
- package/dist/node/lib/A-Server/A-HttpServer.container.d.mts +50 -0
- package/dist/node/lib/A-Server/A-HttpServer.container.d.ts +50 -0
- package/dist/node/lib/A-Server/A-HttpServer.container.js +194 -0
- package/dist/node/lib/A-Server/A-HttpServer.container.js.map +1 -0
- package/dist/node/lib/A-Server/A-HttpServer.container.mjs +182 -0
- package/dist/node/lib/A-Server/A-HttpServer.container.mjs.map +1 -0
- package/dist/node/lib/A-Server/A-HttpServer.error.d.mts +54 -0
- package/dist/node/lib/A-Server/A-HttpServer.error.d.ts +54 -0
- package/dist/node/lib/A-Server/A-HttpServer.error.js +118 -0
- package/dist/node/lib/A-Server/A-HttpServer.error.js.map +1 -0
- package/dist/node/lib/A-Server/A-HttpServer.error.mjs +117 -0
- package/dist/node/lib/A-Server/A-HttpServer.error.mjs.map +1 -0
- package/dist/node/lib/A-Server/A-HttpServer.types.d.mts +19 -0
- package/dist/node/lib/A-Server/A-HttpServer.types.d.ts +19 -0
- package/dist/node/lib/A-Server/A-HttpServer.types.js +4 -0
- package/dist/node/lib/A-Server/A-HttpServer.types.js.map +1 -0
- package/dist/node/lib/A-Server/A-HttpServer.types.mjs +3 -0
- package/dist/node/lib/A-Server/A-HttpServer.types.mjs.map +1 -0
- package/dist/node/lib/A-Server/A-Server.context.d.mts +22 -0
- package/dist/node/lib/A-Server/A-Server.context.d.ts +22 -0
- package/dist/node/lib/A-Server/A-Server.context.js +24 -0
- package/dist/node/lib/A-Server/A-Server.context.js.map +1 -0
- package/dist/node/lib/A-Server/A-Server.context.mjs +23 -0
- package/dist/node/lib/A-Server/A-Server.context.mjs.map +1 -0
- package/dist/node/lib/A-Server/A-Server.error.d.mts +14 -0
- package/dist/node/lib/A-Server/A-Server.error.d.ts +14 -0
- package/dist/node/lib/A-Server/A-Server.error.js +26 -0
- package/dist/node/lib/A-Server/A-Server.error.js.map +1 -0
- package/dist/node/lib/A-Server/A-Server.error.mjs +25 -0
- package/dist/node/lib/A-Server/A-Server.error.mjs.map +1 -0
- package/dist/node/lib/A-Server/A-Server.types.d.mts +26 -0
- package/dist/node/lib/A-Server/A-Server.types.d.ts +26 -0
- package/dist/node/lib/A-Server/A-Server.types.js +4 -0
- package/dist/node/lib/A-Server/A-Server.types.js.map +1 -0
- package/dist/node/lib/A-Server/A-Server.types.mjs +3 -0
- package/dist/node/lib/A-Server/A-Server.types.mjs.map +1 -0
- package/dist/node/lib/A-ServerController/A-ServerController.component.d.mts +29 -0
- package/dist/node/lib/A-ServerController/A-ServerController.component.d.ts +29 -0
- package/dist/node/lib/A-ServerController/A-ServerController.component.js +49 -0
- package/dist/node/lib/A-ServerController/A-ServerController.component.js.map +1 -0
- package/dist/node/lib/A-ServerController/A-ServerController.component.mjs +37 -0
- package/dist/node/lib/A-ServerController/A-ServerController.component.mjs.map +1 -0
- package/dist/node/lib/A-ServerController/A-ServerController.types.d.mts +2 -0
- package/dist/node/lib/A-ServerController/A-ServerController.types.d.ts +2 -0
- package/dist/node/lib/A-ServerController/A-ServerController.types.js +4 -0
- package/dist/node/lib/A-ServerController/A-ServerController.types.js.map +1 -0
- package/dist/node/lib/A-ServerController/A-ServerController.types.mjs +3 -0
- package/dist/node/lib/A-ServerController/A-ServerController.types.mjs.map +1 -0
- package/dist/node/lib/A-ServerEntityList/A-EntityList.entity.d.mts +49 -0
- package/dist/node/lib/A-ServerEntityList/A-EntityList.entity.d.ts +49 -0
- package/dist/node/lib/A-ServerEntityList/A-EntityList.entity.js +91 -0
- package/dist/node/lib/A-ServerEntityList/A-EntityList.entity.js.map +1 -0
- package/dist/node/lib/A-ServerEntityList/A-EntityList.entity.mjs +90 -0
- package/dist/node/lib/A-ServerEntityList/A-EntityList.entity.mjs.map +1 -0
- package/dist/node/lib/A-ServerEntityList/A-EntityList.types.d.mts +22 -0
- package/dist/node/lib/A-ServerEntityList/A-EntityList.types.d.ts +22 -0
- package/dist/node/lib/A-ServerEntityList/A-EntityList.types.js +10 -0
- package/dist/node/lib/A-ServerEntityList/A-EntityList.types.js.map +1 -0
- package/dist/node/lib/A-ServerEntityList/A-EntityList.types.mjs +10 -0
- package/dist/node/lib/A-ServerEntityList/A-EntityList.types.mjs.map +1 -0
- package/dist/node/lib/A-ServerListQuery/A-ServerListQueryFilter.context.d.mts +13 -0
- package/dist/node/lib/A-ServerListQuery/A-ServerListQueryFilter.context.d.ts +13 -0
- package/dist/node/lib/A-ServerListQuery/A-ServerListQueryFilter.context.js +32 -0
- package/dist/node/lib/A-ServerListQuery/A-ServerListQueryFilter.context.js.map +1 -0
- package/dist/node/lib/A-ServerListQuery/A-ServerListQueryFilter.context.mjs +31 -0
- package/dist/node/lib/A-ServerListQuery/A-ServerListQueryFilter.context.mjs.map +1 -0
- package/dist/node/lib/A-ServerLogger/A-ServerLogger.component.d.mts +48 -0
- package/dist/node/lib/A-ServerLogger/A-ServerLogger.component.d.ts +48 -0
- package/dist/node/lib/A-ServerLogger/A-ServerLogger.component.js +88 -0
- package/dist/node/lib/A-ServerLogger/A-ServerLogger.component.js.map +1 -0
- package/dist/node/lib/A-ServerLogger/A-ServerLogger.component.mjs +76 -0
- package/dist/node/lib/A-ServerLogger/A-ServerLogger.component.mjs.map +1 -0
- package/dist/node/lib/A-ServerLogger/A-ServerLogger.constants.d.mts +24 -0
- package/dist/node/lib/A-ServerLogger/A-ServerLogger.constants.d.ts +24 -0
- package/dist/node/lib/A-ServerLogger/A-ServerLogger.constants.js +33 -0
- package/dist/node/lib/A-ServerLogger/A-ServerLogger.constants.js.map +1 -0
- package/dist/node/lib/A-ServerLogger/A-ServerLogger.constants.mjs +33 -0
- package/dist/node/lib/A-ServerLogger/A-ServerLogger.constants.mjs.map +1 -0
- package/dist/node/lib/A-ServerLogger/A-ServerLogger.types.d.mts +12 -0
- package/dist/node/lib/A-ServerLogger/A-ServerLogger.types.d.ts +12 -0
- package/dist/node/lib/A-ServerLogger/A-ServerLogger.types.js +4 -0
- package/dist/node/lib/A-ServerLogger/A-ServerLogger.types.js.map +1 -0
- package/dist/node/lib/A-ServerLogger/A-ServerLogger.types.mjs +3 -0
- package/dist/node/lib/A-ServerLogger/A-ServerLogger.types.mjs.map +1 -0
- package/dist/node/lib/A-ServerMiddleware/A-ServerMiddleware.component.d.mts +6 -0
- package/dist/node/lib/A-ServerMiddleware/A-ServerMiddleware.component.d.ts +6 -0
- package/dist/node/lib/A-ServerMiddleware/A-ServerMiddleware.component.js +18 -0
- package/dist/node/lib/A-ServerMiddleware/A-ServerMiddleware.component.js.map +1 -0
- package/dist/node/lib/A-ServerMiddleware/A-ServerMiddleware.component.mjs +17 -0
- package/dist/node/lib/A-ServerMiddleware/A-ServerMiddleware.component.mjs.map +1 -0
- package/dist/node/lib/A-ServerMiddleware/A-ServerMiddleware.constants.d.mts +2 -0
- package/dist/node/lib/A-ServerMiddleware/A-ServerMiddleware.constants.d.ts +2 -0
- package/dist/node/lib/A-ServerMiddleware/A-ServerMiddleware.constants.js +4 -0
- package/dist/node/lib/A-ServerMiddleware/A-ServerMiddleware.constants.js.map +1 -0
- package/dist/node/lib/A-ServerMiddleware/A-ServerMiddleware.constants.mjs +3 -0
- package/dist/node/lib/A-ServerMiddleware/A-ServerMiddleware.constants.mjs.map +1 -0
- package/dist/node/lib/A-ServerMiddleware/A-ServerMiddleware.types.d.mts +2 -0
- package/dist/node/lib/A-ServerMiddleware/A-ServerMiddleware.types.d.ts +2 -0
- package/dist/node/lib/A-ServerMiddleware/A-ServerMiddleware.types.js +4 -0
- package/dist/node/lib/A-ServerMiddleware/A-ServerMiddleware.types.js.map +1 -0
- package/dist/node/lib/A-ServerMiddleware/A-ServerMiddleware.types.mjs +3 -0
- package/dist/node/lib/A-ServerMiddleware/A-ServerMiddleware.types.mjs.map +1 -0
- package/dist/node/lib/A-ServerProxy/A-ServerProxy.component.d.mts +31 -0
- package/dist/node/lib/A-ServerProxy/A-ServerProxy.component.d.ts +31 -0
- package/dist/node/lib/A-ServerProxy/A-ServerProxy.component.js +90 -0
- package/dist/node/lib/A-ServerProxy/A-ServerProxy.component.js.map +1 -0
- package/dist/node/lib/A-ServerProxy/A-ServerProxy.component.mjs +78 -0
- package/dist/node/lib/A-ServerProxy/A-ServerProxy.component.mjs.map +1 -0
- package/dist/node/lib/A-ServerProxy/A-ServerProxy.constants.d.mts +9 -0
- package/dist/node/lib/A-ServerProxy/A-ServerProxy.constants.d.ts +9 -0
- package/dist/node/lib/A-ServerProxy/A-ServerProxy.constants.js +14 -0
- package/dist/node/lib/A-ServerProxy/A-ServerProxy.constants.js.map +1 -0
- package/dist/node/lib/A-ServerProxy/A-ServerProxy.constants.mjs +14 -0
- package/dist/node/lib/A-ServerProxy/A-ServerProxy.constants.mjs.map +1 -0
- package/dist/node/lib/A-ServerProxy/A-ServerProxy.context.d.mts +36 -0
- package/dist/node/lib/A-ServerProxy/A-ServerProxy.context.d.ts +36 -0
- package/dist/node/lib/A-ServerProxy/A-ServerProxy.context.js +60 -0
- package/dist/node/lib/A-ServerProxy/A-ServerProxy.context.js.map +1 -0
- package/dist/node/lib/A-ServerProxy/A-ServerProxy.context.mjs +59 -0
- package/dist/node/lib/A-ServerProxy/A-ServerProxy.context.mjs.map +1 -0
- package/dist/node/lib/A-ServerProxy/A-ServerProxy.types.d.mts +23 -0
- package/dist/node/lib/A-ServerProxy/A-ServerProxy.types.d.ts +23 -0
- package/dist/node/lib/A-ServerProxy/A-ServerProxy.types.js +4 -0
- package/dist/node/lib/A-ServerProxy/A-ServerProxy.types.js.map +1 -0
- package/dist/node/lib/A-ServerProxy/A-ServerProxy.types.mjs +3 -0
- package/dist/node/lib/A-ServerProxy/A-ServerProxy.types.mjs.map +1 -0
- package/dist/node/lib/A-ServerRoute/A-ServerRoute.constants.d.mts +20 -0
- package/dist/node/lib/A-ServerRoute/A-ServerRoute.constants.d.ts +20 -0
- package/dist/node/lib/A-ServerRoute/A-ServerRoute.constants.js +25 -0
- package/dist/node/lib/A-ServerRoute/A-ServerRoute.constants.js.map +1 -0
- package/dist/node/lib/A-ServerRoute/A-ServerRoute.constants.mjs +24 -0
- package/dist/node/lib/A-ServerRoute/A-ServerRoute.constants.mjs.map +1 -0
- package/dist/node/lib/A-ServerRoute/A-ServerRoute.entity.d.mts +15 -0
- package/dist/node/lib/A-ServerRoute/A-ServerRoute.entity.d.ts +15 -0
- package/dist/node/lib/A-ServerRoute/A-ServerRoute.entity.js +24 -0
- package/dist/node/lib/A-ServerRoute/A-ServerRoute.entity.js.map +1 -0
- package/dist/node/lib/A-ServerRoute/A-ServerRoute.entity.mjs +23 -0
- package/dist/node/lib/A-ServerRoute/A-ServerRoute.entity.mjs.map +1 -0
- package/dist/node/lib/A-ServerRoute/A-ServerRoute.types.d.mts +6 -0
- package/dist/node/lib/A-ServerRoute/A-ServerRoute.types.d.ts +6 -0
- package/dist/node/lib/A-ServerRoute/A-ServerRoute.types.js +4 -0
- package/dist/node/lib/A-ServerRoute/A-ServerRoute.types.js.map +1 -0
- package/dist/node/lib/A-ServerRoute/A-ServerRoute.types.mjs +3 -0
- package/dist/node/lib/A-ServerRoute/A-ServerRoute.types.mjs.map +1 -0
- package/dist/node/lib/A-ServerRouter/A-ServerRouter.component.d.mts +84 -0
- package/dist/node/lib/A-ServerRouter/A-ServerRouter.component.d.ts +84 -0
- package/dist/node/lib/A-ServerRouter/A-ServerRouter.component.js +194 -0
- package/dist/node/lib/A-ServerRouter/A-ServerRouter.component.js.map +1 -0
- package/dist/node/lib/A-ServerRouter/A-ServerRouter.component.mjs +184 -0
- package/dist/node/lib/A-ServerRouter/A-ServerRouter.component.mjs.map +1 -0
- package/dist/node/lib/A-ServerRouter/A-ServerRouter.constants.d.mts +6 -0
- package/dist/node/lib/A-ServerRouter/A-ServerRouter.constants.d.ts +6 -0
- package/dist/node/lib/A-ServerRouter/A-ServerRouter.constants.js +10 -0
- package/dist/node/lib/A-ServerRouter/A-ServerRouter.constants.js.map +1 -0
- package/dist/node/lib/A-ServerRouter/A-ServerRouter.constants.mjs +10 -0
- package/dist/node/lib/A-ServerRouter/A-ServerRouter.constants.mjs.map +1 -0
- package/dist/node/lib/A-ServerRouter/A-ServerRouter.meta.d.mts +16 -0
- package/dist/node/lib/A-ServerRouter/A-ServerRouter.meta.d.ts +16 -0
- package/dist/node/lib/A-ServerRouter/A-ServerRouter.meta.js +40 -0
- package/dist/node/lib/A-ServerRouter/A-ServerRouter.meta.js.map +1 -0
- package/dist/node/lib/A-ServerRouter/A-ServerRouter.meta.mjs +39 -0
- package/dist/node/lib/A-ServerRouter/A-ServerRouter.meta.mjs.map +1 -0
- package/dist/node/lib/A-ServerRouter/A-ServerRouter.types.d.mts +24 -0
- package/dist/node/lib/A-ServerRouter/A-ServerRouter.types.d.ts +24 -0
- package/dist/node/lib/A-ServerRouter/A-ServerRouter.types.js +4 -0
- package/dist/node/lib/A-ServerRouter/A-ServerRouter.types.js.map +1 -0
- package/dist/node/lib/A-ServerRouter/A-ServerRouter.types.mjs +3 -0
- package/dist/node/lib/A-ServerRouter/A-ServerRouter.types.mjs.map +1 -0
- package/dist/node/lib/A-ServerRouter/A-ServerRouterDefine.decorator.d.mts +16 -0
- package/dist/node/lib/A-ServerRouter/A-ServerRouterDefine.decorator.d.ts +16 -0
- package/dist/node/lib/A-ServerRouter/A-ServerRouterDefine.decorator.js +25 -0
- package/dist/node/lib/A-ServerRouter/A-ServerRouterDefine.decorator.js.map +1 -0
- package/dist/node/lib/A-ServerRouter/A-ServerRouterDefine.decorator.mjs +24 -0
- package/dist/node/lib/A-ServerRouter/A-ServerRouterDefine.decorator.mjs.map +1 -0
- package/dist/node/lib/A-ServerStatic/A-ServerStatic.component.d.mts +65 -0
- package/dist/node/lib/A-ServerStatic/A-ServerStatic.component.d.ts +65 -0
- package/dist/node/lib/A-ServerStatic/A-ServerStatic.component.js +260 -0
- package/dist/node/lib/A-ServerStatic/A-ServerStatic.component.js.map +1 -0
- package/dist/node/lib/A-ServerStatic/A-ServerStatic.component.mjs +248 -0
- package/dist/node/lib/A-ServerStatic/A-ServerStatic.component.mjs.map +1 -0
- package/dist/node/lib/A-ServerStatic/A-ServerStatic.context.d.mts +110 -0
- package/dist/node/lib/A-ServerStatic/A-ServerStatic.context.d.ts +110 -0
- package/dist/node/lib/A-ServerStatic/A-ServerStatic.context.js +180 -0
- package/dist/node/lib/A-ServerStatic/A-ServerStatic.context.js.map +1 -0
- package/dist/node/lib/A-ServerStatic/A-ServerStatic.context.mjs +179 -0
- package/dist/node/lib/A-ServerStatic/A-ServerStatic.context.mjs.map +1 -0
- package/dist/node/lib/A-ServerStatic/A-ServerStatic.types.d.mts +8 -0
- package/dist/node/lib/A-ServerStatic/A-ServerStatic.types.d.ts +8 -0
- package/dist/node/lib/A-ServerStatic/A-ServerStatic.types.js +4 -0
- package/dist/node/lib/A-ServerStatic/A-ServerStatic.types.js.map +1 -0
- package/dist/node/lib/A-ServerStatic/A-ServerStatic.types.mjs +3 -0
- package/dist/node/lib/A-ServerStatic/A-ServerStatic.types.mjs.map +1 -0
- package/dist/node/middlewares/A-ServerCORS/A_ServerCORS.component.d.mts +29 -0
- package/dist/node/middlewares/A-ServerCORS/A_ServerCORS.component.d.ts +29 -0
- package/dist/node/middlewares/A-ServerCORS/A_ServerCORS.component.js +62 -0
- package/dist/node/middlewares/A-ServerCORS/A_ServerCORS.component.js.map +1 -0
- package/dist/node/middlewares/A-ServerCORS/A_ServerCORS.component.mjs +50 -0
- package/dist/node/middlewares/A-ServerCORS/A_ServerCORS.component.mjs.map +1 -0
- package/dist/node/middlewares/A-ServerCORS/A_ServerCORS.constants.d.mts +5 -0
- package/dist/node/middlewares/A-ServerCORS/A_ServerCORS.constants.d.ts +5 -0
- package/dist/node/middlewares/A-ServerCORS/A_ServerCORS.constants.js +14 -0
- package/dist/node/middlewares/A-ServerCORS/A_ServerCORS.constants.js.map +1 -0
- package/dist/node/middlewares/A-ServerCORS/A_ServerCORS.constants.mjs +14 -0
- package/dist/node/middlewares/A-ServerCORS/A_ServerCORS.constants.mjs.map +1 -0
- package/dist/node/middlewares/A-ServerCORS/A_ServerCORS.types.d.mts +9 -0
- package/dist/node/middlewares/A-ServerCORS/A_ServerCORS.types.d.ts +9 -0
- package/dist/node/middlewares/A-ServerCORS/A_ServerCORS.types.js +4 -0
- package/dist/node/middlewares/A-ServerCORS/A_ServerCORS.types.js.map +1 -0
- package/dist/node/middlewares/A-ServerCORS/A_ServerCORS.types.mjs +3 -0
- package/dist/node/middlewares/A-ServerCORS/A_ServerCORS.types.mjs.map +1 -0
- package/dist/node/repositories/A-EntityRepository/A-EntityRepository.component.d.mts +24 -0
- package/dist/node/repositories/A-EntityRepository/A-EntityRepository.component.d.ts +24 -0
- package/dist/node/repositories/A-EntityRepository/A-EntityRepository.component.js +94 -0
- package/dist/node/repositories/A-EntityRepository/A-EntityRepository.component.js.map +1 -0
- package/dist/node/repositories/A-EntityRepository/A-EntityRepository.component.mjs +82 -0
- package/dist/node/repositories/A-EntityRepository/A-EntityRepository.component.mjs.map +1 -0
- package/dist/node/repositories/A-EntityRepository/A-EntityRepository.error.d.mts +2 -0
- package/dist/node/repositories/A-EntityRepository/A-EntityRepository.error.d.ts +2 -0
- package/dist/node/repositories/A-EntityRepository/A-EntityRepository.error.js +4 -0
- package/dist/node/repositories/A-EntityRepository/A-EntityRepository.error.js.map +1 -0
- package/dist/node/repositories/A-EntityRepository/A-EntityRepository.error.mjs +3 -0
- package/dist/node/repositories/A-EntityRepository/A-EntityRepository.error.mjs.map +1 -0
- package/dist/node/repositories/A-EntityRepository/A-EntityRepository.types.d.mts +2 -0
- package/dist/node/repositories/A-EntityRepository/A-EntityRepository.types.d.ts +2 -0
- package/dist/node/repositories/A-EntityRepository/A-EntityRepository.types.js +4 -0
- package/dist/node/repositories/A-EntityRepository/A-EntityRepository.types.js.map +1 -0
- package/dist/node/repositories/A-EntityRepository/A-EntityRepository.types.mjs +3 -0
- package/dist/node/repositories/A-EntityRepository/A-EntityRepository.types.mjs.map +1 -0
- package/examples/simple-server/commands/SignIn.command.ts +17 -1
- package/examples/simple-server/components/Test.controller.ts +8 -7
- package/examples/simple-server/components/Users.repository.ts +28 -26
- package/examples/simple-server/concept.ts +56 -66
- package/examples/simple-server/entities/User/User.entity.ts +17 -7
- package/jest.config.ts +24 -10
- package/package.json +267 -25
- package/src/channels/A-Http/A-Http.channel.constants.ts +6 -7
- package/src/channels/A-Http/A-Http.channel.error.ts +2 -2
- package/src/channels/A-Http/A-Http.channel.ts +76 -125
- package/src/channels/A-Http/A-Http.channel.types.ts +6 -3
- package/src/channels/A-Websockets/A-Websockets.channel.ts +1 -1
- package/src/{components → controllers}/A-CommandController/A-CommandController.component.ts +16 -10
- package/src/{components → controllers}/A-EntityController/A-EntityController.component.ts +24 -28
- package/src/{components → controllers}/A-ListingController/A-ListingController.component.ts +10 -12
- package/src/{components → controllers}/A-ServerHealthMonitor/A-ServerHealthMonitor.component.ts +11 -11
- package/src/index.ts +58 -63
- package/src/lib/A-Request/A-HttpRequestData.context.ts +30 -0
- package/src/lib/A-Request/A-HttpServerRequest.context.ts +103 -0
- package/src/lib/A-Request/A-Request.constants.ts +30 -0
- package/src/lib/A-Request/A-Request.entity.ts +844 -0
- package/src/lib/A-Request/A-Request.env.ts +50 -0
- package/src/lib/A-Request/A-Request.error.ts +11 -0
- package/src/lib/A-Request/A-Request.helper.ts +276 -0
- package/src/lib/A-Request/A-Request.types.ts +284 -0
- package/src/lib/A-Request/README.md +567 -0
- package/src/lib/A-Response/A-Response.constants.ts +24 -0
- package/src/lib/A-Response/A-Response.entity.ts +689 -0
- package/src/lib/A-Response/A-Response.error.ts +6 -0
- package/src/lib/A-Response/A-Response.types.ts +127 -0
- package/src/lib/A-Response/README.md +793 -0
- package/src/lib/A-Server/A-HttpServer.constants.ts +9 -0
- package/src/lib/A-Server/A-HttpServer.container.ts +251 -0
- package/src/lib/A-Server/A-HttpServer.error.ts +165 -0
- package/src/lib/A-Server/A-HttpServer.types.ts +37 -0
- package/src/{context/A-Server/A_Server.context.ts → lib/A-Server/A-Server.context.ts} +6 -7
- package/src/lib/A-Server/A-Server.error.ts +26 -0
- package/src/{components/A-ServerError/A-ServerError.types.ts → lib/A-Server/A-Server.types.ts} +8 -0
- package/src/{components/A-Controller/A-Controller.component.ts → lib/A-ServerController/A-ServerController.component.ts} +5 -5
- package/src/{entities/A_EntityList/A_EntityList.entity.ts → lib/A-ServerEntityList/A-EntityList.entity.ts} +2 -2
- package/src/{entities/A_EntityList/A_EntityList.entity.types.ts → lib/A-ServerEntityList/A-EntityList.types.ts} +2 -2
- package/src/{context/A-ListQueryFilter/A_ListQueryFilter.context.ts → lib/A-ServerListQuery/A-ServerListQueryFilter.context.ts} +1 -1
- package/src/lib/A-ServerLogger/A-ServerLogger.component.ts +121 -0
- package/src/lib/A-ServerLogger/A-ServerLogger.types.ts +13 -0
- package/src/lib/A-ServerMiddleware/A-ServerMiddleware.component.ts +17 -0
- package/src/{components → lib}/A-ServerProxy/A-ServerProxy.component.ts +17 -12
- package/src/{context/A-ProxyConfig/A_ProxyConfig.constants.ts → lib/A-ServerProxy/A-ServerProxy.constants.ts} +1 -1
- package/src/{context/A-ProxyConfig/A_ProxyConfig.context.ts → lib/A-ServerProxy/A-ServerProxy.context.ts} +4 -4
- package/src/{context/A-ProxyConfig/A_ProxyConfig.types.ts → lib/A-ServerProxy/A-ServerProxy.types.ts} +4 -4
- package/src/lib/A-ServerRoute/A-ServerRoute.constants.ts +20 -0
- package/src/lib/A-ServerRoute/A-ServerRoute.entity.ts +48 -0
- package/src/lib/A-ServerRoute/A-ServerRoute.types.ts +6 -0
- package/src/{components/A-Router/A-Router.component.ts → lib/A-ServerRouter/A-ServerRouter.component.ts} +77 -97
- package/src/lib/A-ServerRouter/A-ServerRouter.constants.ts +8 -0
- package/src/lib/A-ServerRouter/A-ServerRouter.meta.ts +48 -0
- package/src/lib/A-ServerRouter/A-ServerRouter.types.ts +27 -0
- package/src/lib/A-ServerRouter/A-ServerRouterDefine.decorator.ts +37 -0
- package/src/{components/A-StaticLoader/A-StaticLoader.component.ts → lib/A-ServerStatic/A-ServerStatic.component.ts} +73 -54
- package/src/{context/A-StaticConfig/A-StaticConfig.context.ts → lib/A-ServerStatic/A-ServerStatic.context.ts} +16 -6
- package/src/{components → middlewares}/A-ServerCORS/A_ServerCORS.component.ts +16 -13
- package/src/{components/A-ServerCORS/A_ServerCORS.component.defaults.ts → middlewares/A-ServerCORS/A_ServerCORS.constants.ts} +2 -2
- package/src/{components → repositories}/A-EntityRepository/A-EntityRepository.component.ts +39 -30
- package/tests/A-HttpChannel.test.ts +41 -48
- package/tests/A-HttpServerError.test.ts +204 -0
- package/tests/A-Request.test.ts +351 -0
- package/tsconfig.json +40 -50
- package/tsup.config.ts +111 -13
- package/dist/index.d.mts +0 -855
- package/dist/index.d.ts +0 -855
- package/dist/index.js +0 -2179
- package/dist/index.js.map +0 -1
- package/dist/index.mjs +0 -2144
- package/dist/index.mjs.map +0 -1
- package/examples/microservices-server/components/controllers/Statistics.controller.ts +0 -18
- package/examples/microservices-server/components/repositories/Memory.repository.ts +0 -66
- package/examples/microservices-server/concept.ts +0 -43
- package/examples/microservices-server/context/MemoryStore.context.ts +0 -31
- package/examples/microservices-server/entities/Order.entity.ts +0 -7
- package/examples/microservices-server/entities/User.entity.ts +0 -8
- package/src/components/A-Router/A-Router.component.types.ts +0 -38
- package/src/components/A-ServerError/A-ServerError.class.ts +0 -98
- package/src/components/A-ServerLogger/A_ServerLogger.component.ts +0 -194
- package/src/components/A-ServerLogger/A_ServerLogger.component.types.ts +0 -14
- package/src/containers/A-Service/A-Service.container.ts +0 -218
- package/src/containers/A-Service/A-Service.container.types.ts +0 -46
- package/src/context/A-EntityFactory/A-EntityFactory.context.ts +0 -163
- package/src/context/A-EntityFactory/A-EntityFactory.context.types.ts +0 -11
- package/src/context/A-HttpChannel/A-HttpChannel.context.ts +0 -36
- package/src/context/A-Server/A_Server.context.types.ts +0 -9
- package/src/entities/A-Request/A-Request.entity.ts +0 -163
- package/src/entities/A-Request/A-Request.entity.types.ts +0 -41
- package/src/entities/A-Response/A-Response.entity.ts +0 -194
- package/src/entities/A-Response/A-Response.entity.types.ts +0 -26
- package/src/entities/A-Route/A-Route.entity.ts +0 -117
- package/tests/A-Service.test.ts +0 -18
- /package/src/{components → controllers}/A-EntityController/A-EntityController.component.types.ts +0 -0
- /package/src/{components/A-Controller/A-Controller.component.types.ts → controllers/A-ListingController/A-ListingController.types.ts} +0 -0
- /package/src/{components/A-ServerHealthMonitor/A-ServerHealthMonitor.component.types.ts → controllers/A-ServerHealthMonitor/A-ServerHealthMonitor.types.ts} +0 -0
- /package/src/{components/A-EntityRepository/A-EntityRepository.error.ts → lib/A-Response/A-Response.env.ts} +0 -0
- /package/src/{components/A-EntityRepository/A-EntityRepository.types.ts → lib/A-ServerController/A-ServerController.types.ts} +0 -0
- /package/src/{components → lib}/A-ServerLogger/A-ServerLogger.constants.ts +0 -0
- /package/src/{components/A-ListingController/A-ListingController.component.types.ts → lib/A-ServerMiddleware/A-ServerMiddleware.constants.ts} +0 -0
- /package/src/{components/A-ServerError/A-ServerError.constants.ts → lib/A-ServerMiddleware/A-ServerMiddleware.types.ts} +0 -0
- /package/src/{components/A-StaticLoader/A-StaticLoader.component.types.ts → lib/A-ServerStatic/A-ServerStatic.types.ts} +0 -0
- /package/src/{components/A-ServerCORS/A_ServerCORS.component.types.ts → middlewares/A-ServerCORS/A_ServerCORS.types.ts} +0 -0
- /package/src/{context/A-StaticConfig/A-StaticConfig.context.types.ts → repositories/A-EntityRepository/A-EntityRepository.error.ts} +0 -0
- /package/src/{entities/A-Route/A-Route.entity.types.ts → repositories/A-EntityRepository/A-EntityRepository.types.ts} +0 -0
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { A_SERVER_TYPES__HttpChannelRequestParams, A_SERVER_TYPES__HttpChannelRequestConfig } from './A-Http.channel.types.mjs';
|
|
2
|
+
import { A_ServerRoute } from '../../lib/A-ServerRoute/A-ServerRoute.entity.mjs';
|
|
3
|
+
import { A_Channel, A_ChannelRequest } from '@adaas/a-utils/a-channel';
|
|
4
|
+
import { A_Scope } from '@adaas/a-concept';
|
|
5
|
+
import '../../lib/A-Server/A-HttpServer.types.mjs';
|
|
6
|
+
import '../../lib/A-Server/A-HttpServer.constants.mjs';
|
|
7
|
+
import './A-Http.channel.constants.mjs';
|
|
8
|
+
import '@adaas/a-utils/a-route';
|
|
9
|
+
import '../../lib/A-ServerRoute/A-ServerRoute.types.mjs';
|
|
10
|
+
import '../../lib/A-ServerRoute/A-ServerRoute.constants.mjs';
|
|
11
|
+
|
|
12
|
+
declare class A_HTTPChannel extends A_Channel {
|
|
13
|
+
protected baseUrl?: string;
|
|
14
|
+
onBeforeRequest(context: A_ChannelRequest<A_SERVER_TYPES__HttpChannelRequestParams>, scope: A_Scope): Promise<void>;
|
|
15
|
+
onRequest(context: A_ChannelRequest<A_SERVER_TYPES__HttpChannelRequestParams>, route: A_ServerRoute): Promise<void>;
|
|
16
|
+
post<T extends Record<string, any> = any, M extends Record<string, any> = any>(url: string, body?: any, config?: Partial<A_SERVER_TYPES__HttpChannelRequestConfig>): Promise<A_ChannelRequest<A_SERVER_TYPES__HttpChannelRequestParams<M>, T>>;
|
|
17
|
+
get<T extends Record<string, any> = any, M extends Record<string, any> = any>(url: string, params?: any, config?: Partial<A_SERVER_TYPES__HttpChannelRequestConfig>): Promise<A_ChannelRequest<A_SERVER_TYPES__HttpChannelRequestParams<M>, T>>;
|
|
18
|
+
put<T extends Record<string, any> = any, M extends Record<string, any> = any>(url: string, body?: any, config?: Partial<A_SERVER_TYPES__HttpChannelRequestConfig>): Promise<A_ChannelRequest<A_SERVER_TYPES__HttpChannelRequestParams<M>, T>>;
|
|
19
|
+
delete<T extends Record<string, any> = any, M extends Record<string, any> = any>(url: string, params?: any, config?: Partial<A_SERVER_TYPES__HttpChannelRequestConfig>): Promise<A_ChannelRequest<A_SERVER_TYPES__HttpChannelRequestParams<M>, T>>;
|
|
20
|
+
protected buildURL(path?: string, params?: Record<string, any>): string;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export { A_HTTPChannel };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { A_SERVER_TYPES__HttpChannelRequestParams, A_SERVER_TYPES__HttpChannelRequestConfig } from './A-Http.channel.types.js';
|
|
2
|
+
import { A_ServerRoute } from '../../lib/A-ServerRoute/A-ServerRoute.entity.js';
|
|
3
|
+
import { A_Channel, A_ChannelRequest } from '@adaas/a-utils/a-channel';
|
|
4
|
+
import { A_Scope } from '@adaas/a-concept';
|
|
5
|
+
import '../../lib/A-Server/A-HttpServer.types.js';
|
|
6
|
+
import '../../lib/A-Server/A-HttpServer.constants.js';
|
|
7
|
+
import './A-Http.channel.constants.js';
|
|
8
|
+
import '@adaas/a-utils/a-route';
|
|
9
|
+
import '../../lib/A-ServerRoute/A-ServerRoute.types.js';
|
|
10
|
+
import '../../lib/A-ServerRoute/A-ServerRoute.constants.js';
|
|
11
|
+
|
|
12
|
+
declare class A_HTTPChannel extends A_Channel {
|
|
13
|
+
protected baseUrl?: string;
|
|
14
|
+
onBeforeRequest(context: A_ChannelRequest<A_SERVER_TYPES__HttpChannelRequestParams>, scope: A_Scope): Promise<void>;
|
|
15
|
+
onRequest(context: A_ChannelRequest<A_SERVER_TYPES__HttpChannelRequestParams>, route: A_ServerRoute): Promise<void>;
|
|
16
|
+
post<T extends Record<string, any> = any, M extends Record<string, any> = any>(url: string, body?: any, config?: Partial<A_SERVER_TYPES__HttpChannelRequestConfig>): Promise<A_ChannelRequest<A_SERVER_TYPES__HttpChannelRequestParams<M>, T>>;
|
|
17
|
+
get<T extends Record<string, any> = any, M extends Record<string, any> = any>(url: string, params?: any, config?: Partial<A_SERVER_TYPES__HttpChannelRequestConfig>): Promise<A_ChannelRequest<A_SERVER_TYPES__HttpChannelRequestParams<M>, T>>;
|
|
18
|
+
put<T extends Record<string, any> = any, M extends Record<string, any> = any>(url: string, body?: any, config?: Partial<A_SERVER_TYPES__HttpChannelRequestConfig>): Promise<A_ChannelRequest<A_SERVER_TYPES__HttpChannelRequestParams<M>, T>>;
|
|
19
|
+
delete<T extends Record<string, any> = any, M extends Record<string, any> = any>(url: string, params?: any, config?: Partial<A_SERVER_TYPES__HttpChannelRequestConfig>): Promise<A_ChannelRequest<A_SERVER_TYPES__HttpChannelRequestParams<M>, T>>;
|
|
20
|
+
protected buildURL(path?: string, params?: Record<string, any>): string;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export { A_HTTPChannel };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var aChannel = require('@adaas/a-utils/a-channel');
|
|
4
|
+
|
|
5
|
+
class A_HTTPChannelError extends aChannel.A_ChannelError {
|
|
6
|
+
}
|
|
7
|
+
A_HTTPChannelError.HttpRequestError = "HTTP Channel Request Error";
|
|
8
|
+
|
|
9
|
+
exports.A_HTTPChannelError = A_HTTPChannelError;
|
|
10
|
+
//# sourceMappingURL=A-Http.channel.error.js.map
|
|
11
|
+
//# sourceMappingURL=A-Http.channel.error.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/channels/A-Http/A-Http.channel.error.ts"],"names":["A_ChannelError"],"mappings":";;;;AAGO,MAAM,2BAA2BA,uBAAA,CAAe;AAIvD;AAJa,kBAAA,CAEO,gBAAA,GAAmB,4BAAA","file":"A-Http.channel.error.js","sourcesContent":["import { A_ChannelError } from \"@adaas/a-utils/a-channel\";\n\n\nexport class A_HTTPChannelError extends A_ChannelError {\n\n static readonly HttpRequestError = 'HTTP Channel Request Error';\n\n}"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import '../../chunk-EQQGB2QZ.mjs';
|
|
2
|
+
import { A_ChannelError } from '@adaas/a-utils/a-channel';
|
|
3
|
+
|
|
4
|
+
class A_HTTPChannelError extends A_ChannelError {
|
|
5
|
+
}
|
|
6
|
+
A_HTTPChannelError.HttpRequestError = "HTTP Channel Request Error";
|
|
7
|
+
|
|
8
|
+
export { A_HTTPChannelError };
|
|
9
|
+
//# sourceMappingURL=A-Http.channel.error.mjs.map
|
|
10
|
+
//# sourceMappingURL=A-Http.channel.error.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/channels/A-Http/A-Http.channel.error.ts"],"names":[],"mappings":";;;AAGO,MAAM,2BAA2B,cAAA,CAAe;AAIvD;AAJa,kBAAA,CAEO,gBAAA,GAAmB,4BAAA","file":"A-Http.channel.error.mjs","sourcesContent":["import { A_ChannelError } from \"@adaas/a-utils/a-channel\";\n\n\nexport class A_HTTPChannelError extends A_ChannelError {\n\n static readonly HttpRequestError = 'HTTP Channel Request Error';\n\n}"]}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var AServer_error = require('@adaas/a-server/server/A-Server.error');
|
|
4
|
+
var AHttp_channel_error = require('./A-Http.channel.error');
|
|
5
|
+
var AServerRoute_entity = require('@adaas/a-server/route/A-ServerRoute.entity');
|
|
6
|
+
var aChannel = require('@adaas/a-utils/a-channel');
|
|
7
|
+
var aConcept = require('@adaas/a-concept');
|
|
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
|
+
class A_HTTPChannel extends aChannel.A_Channel {
|
|
21
|
+
async onBeforeRequest(context, scope) {
|
|
22
|
+
const { method, url, data, config } = context.params;
|
|
23
|
+
const fullUrl = this.buildURL(url, config?.params);
|
|
24
|
+
const route = new AServerRoute_entity.A_ServerRoute(fullUrl, method);
|
|
25
|
+
scope.register(route);
|
|
26
|
+
context.params.config = context.params.config || {};
|
|
27
|
+
context.params.config.headers = {
|
|
28
|
+
"Content-Type": "application/json",
|
|
29
|
+
...config?.headers
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
async onRequest(context, route) {
|
|
33
|
+
const options = {
|
|
34
|
+
method: route.method,
|
|
35
|
+
headers: context.params.config?.headers || {}
|
|
36
|
+
};
|
|
37
|
+
if (context.params.data && route.method !== "GET") {
|
|
38
|
+
options.body = JSON.stringify(context.params.data);
|
|
39
|
+
}
|
|
40
|
+
const response = await fetch(route.url, options);
|
|
41
|
+
if (!response.ok) {
|
|
42
|
+
throw new AServer_error.A_ServerError({
|
|
43
|
+
status: response.status,
|
|
44
|
+
title: response.statusText,
|
|
45
|
+
description: `HTTP request to ${route.url} failed with status ${response.status}`
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
switch (context.params.config?.params?.responseType) {
|
|
49
|
+
case "text":
|
|
50
|
+
context.succeed({
|
|
51
|
+
data: await response.text()
|
|
52
|
+
});
|
|
53
|
+
break;
|
|
54
|
+
case "blob":
|
|
55
|
+
context.succeed(await response.blob());
|
|
56
|
+
break;
|
|
57
|
+
default:
|
|
58
|
+
context.succeed(await response.json());
|
|
59
|
+
break;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
async post(url, body, config) {
|
|
63
|
+
return this.request({
|
|
64
|
+
method: "POST",
|
|
65
|
+
url,
|
|
66
|
+
data: body,
|
|
67
|
+
config
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
async get(url, params, config) {
|
|
71
|
+
return this.request({
|
|
72
|
+
method: "GET",
|
|
73
|
+
url,
|
|
74
|
+
config: {
|
|
75
|
+
...config,
|
|
76
|
+
params
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
async put(url, body, config) {
|
|
81
|
+
return this.request({
|
|
82
|
+
method: "PUT",
|
|
83
|
+
url,
|
|
84
|
+
data: body,
|
|
85
|
+
config
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
async delete(url, params, config) {
|
|
89
|
+
return this.request({
|
|
90
|
+
method: "DELETE",
|
|
91
|
+
url,
|
|
92
|
+
data: params,
|
|
93
|
+
config
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
buildURL(path = "", params = {}) {
|
|
97
|
+
if (!this.baseUrl)
|
|
98
|
+
throw new AHttp_channel_error.A_HTTPChannelError(
|
|
99
|
+
AHttp_channel_error.A_HTTPChannelError.HttpRequestError,
|
|
100
|
+
"Base URL is not set for HTTP Channel"
|
|
101
|
+
);
|
|
102
|
+
const url = new URL(`${this.baseUrl}${path.startsWith("/") ? path : `/${path}`}`);
|
|
103
|
+
Object.keys(params).forEach((key) => {
|
|
104
|
+
if (params[key] !== void 0 && params[key] !== null) {
|
|
105
|
+
url.searchParams.append(key, params[key]);
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
return url.toString();
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
__decorateClass([
|
|
112
|
+
__decorateParam(0, aConcept.A_Inject(aChannel.A_ChannelRequest)),
|
|
113
|
+
__decorateParam(1, aConcept.A_Inject(aConcept.A_Scope))
|
|
114
|
+
], A_HTTPChannel.prototype, "onBeforeRequest");
|
|
115
|
+
__decorateClass([
|
|
116
|
+
__decorateParam(0, aConcept.A_Inject(aChannel.A_ChannelRequest)),
|
|
117
|
+
__decorateParam(1, aConcept.A_Inject(AServerRoute_entity.A_ServerRoute))
|
|
118
|
+
], A_HTTPChannel.prototype, "onRequest");
|
|
119
|
+
|
|
120
|
+
exports.A_HTTPChannel = A_HTTPChannel;
|
|
121
|
+
//# sourceMappingURL=A-Http.channel.js.map
|
|
122
|
+
//# sourceMappingURL=A-Http.channel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/channels/A-Http/A-Http.channel.ts"],"names":["A_Channel","A_ServerRoute","A_ServerError","A_HTTPChannelError","A_ChannelRequest","A_Scope"],"mappings":"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","file":"A-Http.channel.js","sourcesContent":["import { A_ServerError } from \"@adaas/a-server/server/A-Server.error\";\nimport { A_HTTPChannelError } from \"./A-Http.channel.error\";\nimport { A_SERVER_TYPES__HttpChannelRequestConfig, A_SERVER_TYPES__HttpChannelRequestParams } from \"./A-Http.channel.types\";\nimport { A_ServerRoute } from \"@adaas/a-server/route/A-ServerRoute.entity\";\nimport { A_Channel, A_ChannelRequest } from '@adaas/a-utils/a-channel'\nimport { A_Inject, A_Scope } from \"@adaas/a-concept\";\n\n\nexport class A_HTTPChannel extends A_Channel {\n\n protected baseUrl?: string;\n\n async onBeforeRequest(\n @A_Inject(A_ChannelRequest) context: A_ChannelRequest<A_SERVER_TYPES__HttpChannelRequestParams>,\n @A_Inject(A_Scope) scope: A_Scope,\n ): Promise<void> {\n const { method, url, data, config } = context.params;\n\n const fullUrl = this.buildURL(url, config?.params);\n\n const route = new A_ServerRoute(fullUrl, method);\n scope.register(route);\n\n context.params.config = context.params.config || {};\n\n context.params.config.headers = {\n \"Content-Type\": \"application/json\",\n ...config?.headers,\n };\n }\n\n async onRequest(\n @A_Inject(A_ChannelRequest) context: A_ChannelRequest<A_SERVER_TYPES__HttpChannelRequestParams>,\n @A_Inject(A_ServerRoute) route: A_ServerRoute,\n ): Promise<void> {\n const options: RequestInit = {\n method: route.method,\n headers: context.params.config?.headers || {\n },\n };\n\n if (context.params.data && route.method !== 'GET') {\n options.body = JSON.stringify(context.params.data);\n }\n\n const response = await fetch(route.url, options);\n\n if (!response.ok) {\n throw new A_ServerError({\n status: response.status,\n title: response.statusText,\n description: `HTTP request to ${route.url} failed with status ${response.status}`,\n });\n }\n\n\n switch (context.params.config?.params?.responseType) {\n case \"text\":\n context.succeed({\n data: await response.text()\n });\n break;\n case \"blob\":\n context.succeed(await response.blob());\n break;\n default:\n context.succeed(await response.json());\n break;\n }\n }\n\n\n async post<T extends Record<string, any> = any, M extends Record<string, any> = any>(\n url: string,\n body?: any,\n config?: Partial<A_SERVER_TYPES__HttpChannelRequestConfig>,\n ): Promise<A_ChannelRequest<A_SERVER_TYPES__HttpChannelRequestParams<M>, T>> {\n return this.request<A_SERVER_TYPES__HttpChannelRequestParams<M>, T>({\n method: 'POST',\n url,\n data: body,\n config,\n });\n }\n\n async get<T extends Record<string, any> = any, M extends Record<string, any> = any>(\n url: string,\n params?: any,\n config?: Partial<A_SERVER_TYPES__HttpChannelRequestConfig>,\n ): Promise<A_ChannelRequest<A_SERVER_TYPES__HttpChannelRequestParams<M>, T>> {\n return this.request<A_SERVER_TYPES__HttpChannelRequestParams<M>, T>({\n method: 'GET',\n url,\n config: {\n ...config,\n params,\n }\n });\n }\n\n async put<T extends Record<string, any> = any, M extends Record<string, any> = any>(\n url: string,\n body?: any,\n config?: Partial<A_SERVER_TYPES__HttpChannelRequestConfig>,\n ): Promise<A_ChannelRequest<A_SERVER_TYPES__HttpChannelRequestParams<M>, T>> {\n return this.request<A_SERVER_TYPES__HttpChannelRequestParams<M>, T>({\n method: 'PUT',\n url,\n data: body,\n config,\n });\n }\n\n async delete<T extends Record<string, any> = any, M extends Record<string, any> = any>(\n url: string,\n params?: any,\n config?: Partial<A_SERVER_TYPES__HttpChannelRequestConfig>,\n ): Promise<A_ChannelRequest<A_SERVER_TYPES__HttpChannelRequestParams<M>, T>> {\n return this.request<A_SERVER_TYPES__HttpChannelRequestParams<M>, T>({\n method: 'DELETE',\n url,\n data: params,\n config,\n });\n }\n\n\n protected buildURL(path: string = '', params: Record<string, any> = {}): string {\n if (!this.baseUrl)\n throw new A_HTTPChannelError(\n A_HTTPChannelError.HttpRequestError,\n \"Base URL is not set for HTTP Channel\"\n );\n\n const url = new URL(`${this.baseUrl}${path.startsWith('/') ? path : `/${path}`}`);\n\n Object.keys(params).forEach(key => {\n if (params[key] !== undefined && params[key] !== null) {\n url.searchParams.append(key, params[key]);\n }\n });\n\n return url.toString()\n }\n}\n"]}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { __decorateClass, __decorateParam } from '../../chunk-EQQGB2QZ.mjs';
|
|
2
|
+
import { A_ServerError } from '@adaas/a-server/server/A-Server.error';
|
|
3
|
+
import { A_HTTPChannelError } from './A-Http.channel.error';
|
|
4
|
+
import { A_ServerRoute } from '@adaas/a-server/route/A-ServerRoute.entity';
|
|
5
|
+
import { A_ChannelRequest, A_Channel } from '@adaas/a-utils/a-channel';
|
|
6
|
+
import { A_Inject, A_Scope } from '@adaas/a-concept';
|
|
7
|
+
|
|
8
|
+
class A_HTTPChannel extends A_Channel {
|
|
9
|
+
async onBeforeRequest(context, scope) {
|
|
10
|
+
const { method, url, data, config } = context.params;
|
|
11
|
+
const fullUrl = this.buildURL(url, config?.params);
|
|
12
|
+
const route = new A_ServerRoute(fullUrl, method);
|
|
13
|
+
scope.register(route);
|
|
14
|
+
context.params.config = context.params.config || {};
|
|
15
|
+
context.params.config.headers = {
|
|
16
|
+
"Content-Type": "application/json",
|
|
17
|
+
...config?.headers
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
async onRequest(context, route) {
|
|
21
|
+
const options = {
|
|
22
|
+
method: route.method,
|
|
23
|
+
headers: context.params.config?.headers || {}
|
|
24
|
+
};
|
|
25
|
+
if (context.params.data && route.method !== "GET") {
|
|
26
|
+
options.body = JSON.stringify(context.params.data);
|
|
27
|
+
}
|
|
28
|
+
const response = await fetch(route.url, options);
|
|
29
|
+
if (!response.ok) {
|
|
30
|
+
throw new A_ServerError({
|
|
31
|
+
status: response.status,
|
|
32
|
+
title: response.statusText,
|
|
33
|
+
description: `HTTP request to ${route.url} failed with status ${response.status}`
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
switch (context.params.config?.params?.responseType) {
|
|
37
|
+
case "text":
|
|
38
|
+
context.succeed({
|
|
39
|
+
data: await response.text()
|
|
40
|
+
});
|
|
41
|
+
break;
|
|
42
|
+
case "blob":
|
|
43
|
+
context.succeed(await response.blob());
|
|
44
|
+
break;
|
|
45
|
+
default:
|
|
46
|
+
context.succeed(await response.json());
|
|
47
|
+
break;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
async post(url, body, config) {
|
|
51
|
+
return this.request({
|
|
52
|
+
method: "POST",
|
|
53
|
+
url,
|
|
54
|
+
data: body,
|
|
55
|
+
config
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
async get(url, params, config) {
|
|
59
|
+
return this.request({
|
|
60
|
+
method: "GET",
|
|
61
|
+
url,
|
|
62
|
+
config: {
|
|
63
|
+
...config,
|
|
64
|
+
params
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
async put(url, body, config) {
|
|
69
|
+
return this.request({
|
|
70
|
+
method: "PUT",
|
|
71
|
+
url,
|
|
72
|
+
data: body,
|
|
73
|
+
config
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
async delete(url, params, config) {
|
|
77
|
+
return this.request({
|
|
78
|
+
method: "DELETE",
|
|
79
|
+
url,
|
|
80
|
+
data: params,
|
|
81
|
+
config
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
buildURL(path = "", params = {}) {
|
|
85
|
+
if (!this.baseUrl)
|
|
86
|
+
throw new A_HTTPChannelError(
|
|
87
|
+
A_HTTPChannelError.HttpRequestError,
|
|
88
|
+
"Base URL is not set for HTTP Channel"
|
|
89
|
+
);
|
|
90
|
+
const url = new URL(`${this.baseUrl}${path.startsWith("/") ? path : `/${path}`}`);
|
|
91
|
+
Object.keys(params).forEach((key) => {
|
|
92
|
+
if (params[key] !== void 0 && params[key] !== null) {
|
|
93
|
+
url.searchParams.append(key, params[key]);
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
return url.toString();
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
__decorateClass([
|
|
100
|
+
__decorateParam(0, A_Inject(A_ChannelRequest)),
|
|
101
|
+
__decorateParam(1, A_Inject(A_Scope))
|
|
102
|
+
], A_HTTPChannel.prototype, "onBeforeRequest", 1);
|
|
103
|
+
__decorateClass([
|
|
104
|
+
__decorateParam(0, A_Inject(A_ChannelRequest)),
|
|
105
|
+
__decorateParam(1, A_Inject(A_ServerRoute))
|
|
106
|
+
], A_HTTPChannel.prototype, "onRequest", 1);
|
|
107
|
+
|
|
108
|
+
export { A_HTTPChannel };
|
|
109
|
+
//# sourceMappingURL=A-Http.channel.mjs.map
|
|
110
|
+
//# sourceMappingURL=A-Http.channel.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/channels/A-Http/A-Http.channel.ts"],"names":[],"mappings":"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","file":"A-Http.channel.mjs","sourcesContent":["import { A_ServerError } from \"@adaas/a-server/server/A-Server.error\";\nimport { A_HTTPChannelError } from \"./A-Http.channel.error\";\nimport { A_SERVER_TYPES__HttpChannelRequestConfig, A_SERVER_TYPES__HttpChannelRequestParams } from \"./A-Http.channel.types\";\nimport { A_ServerRoute } from \"@adaas/a-server/route/A-ServerRoute.entity\";\nimport { A_Channel, A_ChannelRequest } from '@adaas/a-utils/a-channel'\nimport { A_Inject, A_Scope } from \"@adaas/a-concept\";\n\n\nexport class A_HTTPChannel extends A_Channel {\n\n protected baseUrl?: string;\n\n async onBeforeRequest(\n @A_Inject(A_ChannelRequest) context: A_ChannelRequest<A_SERVER_TYPES__HttpChannelRequestParams>,\n @A_Inject(A_Scope) scope: A_Scope,\n ): Promise<void> {\n const { method, url, data, config } = context.params;\n\n const fullUrl = this.buildURL(url, config?.params);\n\n const route = new A_ServerRoute(fullUrl, method);\n scope.register(route);\n\n context.params.config = context.params.config || {};\n\n context.params.config.headers = {\n \"Content-Type\": \"application/json\",\n ...config?.headers,\n };\n }\n\n async onRequest(\n @A_Inject(A_ChannelRequest) context: A_ChannelRequest<A_SERVER_TYPES__HttpChannelRequestParams>,\n @A_Inject(A_ServerRoute) route: A_ServerRoute,\n ): Promise<void> {\n const options: RequestInit = {\n method: route.method,\n headers: context.params.config?.headers || {\n },\n };\n\n if (context.params.data && route.method !== 'GET') {\n options.body = JSON.stringify(context.params.data);\n }\n\n const response = await fetch(route.url, options);\n\n if (!response.ok) {\n throw new A_ServerError({\n status: response.status,\n title: response.statusText,\n description: `HTTP request to ${route.url} failed with status ${response.status}`,\n });\n }\n\n\n switch (context.params.config?.params?.responseType) {\n case \"text\":\n context.succeed({\n data: await response.text()\n });\n break;\n case \"blob\":\n context.succeed(await response.blob());\n break;\n default:\n context.succeed(await response.json());\n break;\n }\n }\n\n\n async post<T extends Record<string, any> = any, M extends Record<string, any> = any>(\n url: string,\n body?: any,\n config?: Partial<A_SERVER_TYPES__HttpChannelRequestConfig>,\n ): Promise<A_ChannelRequest<A_SERVER_TYPES__HttpChannelRequestParams<M>, T>> {\n return this.request<A_SERVER_TYPES__HttpChannelRequestParams<M>, T>({\n method: 'POST',\n url,\n data: body,\n config,\n });\n }\n\n async get<T extends Record<string, any> = any, M extends Record<string, any> = any>(\n url: string,\n params?: any,\n config?: Partial<A_SERVER_TYPES__HttpChannelRequestConfig>,\n ): Promise<A_ChannelRequest<A_SERVER_TYPES__HttpChannelRequestParams<M>, T>> {\n return this.request<A_SERVER_TYPES__HttpChannelRequestParams<M>, T>({\n method: 'GET',\n url,\n config: {\n ...config,\n params,\n }\n });\n }\n\n async put<T extends Record<string, any> = any, M extends Record<string, any> = any>(\n url: string,\n body?: any,\n config?: Partial<A_SERVER_TYPES__HttpChannelRequestConfig>,\n ): Promise<A_ChannelRequest<A_SERVER_TYPES__HttpChannelRequestParams<M>, T>> {\n return this.request<A_SERVER_TYPES__HttpChannelRequestParams<M>, T>({\n method: 'PUT',\n url,\n data: body,\n config,\n });\n }\n\n async delete<T extends Record<string, any> = any, M extends Record<string, any> = any>(\n url: string,\n params?: any,\n config?: Partial<A_SERVER_TYPES__HttpChannelRequestConfig>,\n ): Promise<A_ChannelRequest<A_SERVER_TYPES__HttpChannelRequestParams<M>, T>> {\n return this.request<A_SERVER_TYPES__HttpChannelRequestParams<M>, T>({\n method: 'DELETE',\n url,\n data: params,\n config,\n });\n }\n\n\n protected buildURL(path: string = '', params: Record<string, any> = {}): string {\n if (!this.baseUrl)\n throw new A_HTTPChannelError(\n A_HTTPChannelError.HttpRequestError,\n \"Base URL is not set for HTTP Channel\"\n );\n\n const url = new URL(`${this.baseUrl}${path.startsWith('/') ? path : `/${path}`}`);\n\n Object.keys(params).forEach(key => {\n if (params[key] !== undefined && params[key] !== null) {\n url.searchParams.append(key, params[key]);\n }\n });\n\n return url.toString()\n }\n}\n"]}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { A_HttpServerRequestMethod } from '../../lib/A-Server/A-HttpServer.types.mjs';
|
|
2
|
+
import { A_SERVER_CONSTANTS__A_HttpChannel_Lifecycle } from './A-Http.channel.constants.mjs';
|
|
3
|
+
import '@adaas/a-concept';
|
|
4
|
+
import '../../lib/A-Server/A-HttpServer.constants.mjs';
|
|
5
|
+
import '@adaas/a-utils/a-channel';
|
|
6
|
+
|
|
7
|
+
type A_SERVER_CONSTANTS__A_HttpChannel_LifecycleNames = typeof A_SERVER_CONSTANTS__A_HttpChannel_Lifecycle[keyof typeof A_SERVER_CONSTANTS__A_HttpChannel_Lifecycle];
|
|
8
|
+
type A_SERVER_TYPES__HttpChannelSendParams<M extends Record<string, any> = any> = {
|
|
9
|
+
/**
|
|
10
|
+
* HTTP Method
|
|
11
|
+
*/
|
|
12
|
+
method: A_HttpServerRequestMethod;
|
|
13
|
+
/**
|
|
14
|
+
* Request URL
|
|
15
|
+
*/
|
|
16
|
+
url: string;
|
|
17
|
+
/**
|
|
18
|
+
* Request Body or Query Parameters
|
|
19
|
+
*/
|
|
20
|
+
data?: any;
|
|
21
|
+
/**
|
|
22
|
+
* Request Configuration
|
|
23
|
+
*/
|
|
24
|
+
config?: Partial<A_SERVER_TYPES__HttpChannelRequestConfig<M>>;
|
|
25
|
+
};
|
|
26
|
+
type A_SERVER_TYPES__HttpChannelRequestParams<M extends Record<string, any> = any> = {
|
|
27
|
+
/**
|
|
28
|
+
* HTTP Method
|
|
29
|
+
*/
|
|
30
|
+
method: A_HttpServerRequestMethod;
|
|
31
|
+
/**
|
|
32
|
+
* Request URL
|
|
33
|
+
*/
|
|
34
|
+
url: string;
|
|
35
|
+
/**
|
|
36
|
+
* Request Body or Query Parameters
|
|
37
|
+
*/
|
|
38
|
+
data?: any;
|
|
39
|
+
/**
|
|
40
|
+
* Request Configuration
|
|
41
|
+
*/
|
|
42
|
+
config?: Partial<A_SERVER_TYPES__HttpChannelRequestConfig<M>>;
|
|
43
|
+
};
|
|
44
|
+
type A_SERVER_TYPES__HttpChannelRequestConfig<M extends Record<string, any> = any> = {
|
|
45
|
+
/**
|
|
46
|
+
* Response Type
|
|
47
|
+
*/
|
|
48
|
+
responseType: "json" | "text" | "blob";
|
|
49
|
+
/**
|
|
50
|
+
* Request Headers
|
|
51
|
+
*/
|
|
52
|
+
headers: Record<string, string>;
|
|
53
|
+
/**
|
|
54
|
+
* Query Parameters
|
|
55
|
+
*/
|
|
56
|
+
params: Record<string, any>;
|
|
57
|
+
/**
|
|
58
|
+
* Metadata
|
|
59
|
+
*/
|
|
60
|
+
meta: M;
|
|
61
|
+
/**
|
|
62
|
+
* Throw on Error
|
|
63
|
+
*/
|
|
64
|
+
throwOnError: boolean;
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
export type { A_SERVER_CONSTANTS__A_HttpChannel_LifecycleNames, A_SERVER_TYPES__HttpChannelRequestConfig, A_SERVER_TYPES__HttpChannelRequestParams, A_SERVER_TYPES__HttpChannelSendParams };
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { A_HttpServerRequestMethod } from '../../lib/A-Server/A-HttpServer.types.js';
|
|
2
|
+
import { A_SERVER_CONSTANTS__A_HttpChannel_Lifecycle } from './A-Http.channel.constants.js';
|
|
3
|
+
import '@adaas/a-concept';
|
|
4
|
+
import '../../lib/A-Server/A-HttpServer.constants.js';
|
|
5
|
+
import '@adaas/a-utils/a-channel';
|
|
6
|
+
|
|
7
|
+
type A_SERVER_CONSTANTS__A_HttpChannel_LifecycleNames = typeof A_SERVER_CONSTANTS__A_HttpChannel_Lifecycle[keyof typeof A_SERVER_CONSTANTS__A_HttpChannel_Lifecycle];
|
|
8
|
+
type A_SERVER_TYPES__HttpChannelSendParams<M extends Record<string, any> = any> = {
|
|
9
|
+
/**
|
|
10
|
+
* HTTP Method
|
|
11
|
+
*/
|
|
12
|
+
method: A_HttpServerRequestMethod;
|
|
13
|
+
/**
|
|
14
|
+
* Request URL
|
|
15
|
+
*/
|
|
16
|
+
url: string;
|
|
17
|
+
/**
|
|
18
|
+
* Request Body or Query Parameters
|
|
19
|
+
*/
|
|
20
|
+
data?: any;
|
|
21
|
+
/**
|
|
22
|
+
* Request Configuration
|
|
23
|
+
*/
|
|
24
|
+
config?: Partial<A_SERVER_TYPES__HttpChannelRequestConfig<M>>;
|
|
25
|
+
};
|
|
26
|
+
type A_SERVER_TYPES__HttpChannelRequestParams<M extends Record<string, any> = any> = {
|
|
27
|
+
/**
|
|
28
|
+
* HTTP Method
|
|
29
|
+
*/
|
|
30
|
+
method: A_HttpServerRequestMethod;
|
|
31
|
+
/**
|
|
32
|
+
* Request URL
|
|
33
|
+
*/
|
|
34
|
+
url: string;
|
|
35
|
+
/**
|
|
36
|
+
* Request Body or Query Parameters
|
|
37
|
+
*/
|
|
38
|
+
data?: any;
|
|
39
|
+
/**
|
|
40
|
+
* Request Configuration
|
|
41
|
+
*/
|
|
42
|
+
config?: Partial<A_SERVER_TYPES__HttpChannelRequestConfig<M>>;
|
|
43
|
+
};
|
|
44
|
+
type A_SERVER_TYPES__HttpChannelRequestConfig<M extends Record<string, any> = any> = {
|
|
45
|
+
/**
|
|
46
|
+
* Response Type
|
|
47
|
+
*/
|
|
48
|
+
responseType: "json" | "text" | "blob";
|
|
49
|
+
/**
|
|
50
|
+
* Request Headers
|
|
51
|
+
*/
|
|
52
|
+
headers: Record<string, string>;
|
|
53
|
+
/**
|
|
54
|
+
* Query Parameters
|
|
55
|
+
*/
|
|
56
|
+
params: Record<string, any>;
|
|
57
|
+
/**
|
|
58
|
+
* Metadata
|
|
59
|
+
*/
|
|
60
|
+
meta: M;
|
|
61
|
+
/**
|
|
62
|
+
* Throw on Error
|
|
63
|
+
*/
|
|
64
|
+
throwOnError: boolean;
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
export type { A_SERVER_CONSTANTS__A_HttpChannel_LifecycleNames, A_SERVER_TYPES__HttpChannelRequestConfig, A_SERVER_TYPES__HttpChannelRequestParams, A_SERVER_TYPES__HttpChannelSendParams };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"A-Http.channel.types.js"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"A-Http.channel.types.mjs"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var aChannel = require('@adaas/a-utils/a-channel');
|
|
4
|
+
|
|
5
|
+
class A_WebsocketsChannel extends aChannel.A_Channel {
|
|
6
|
+
// Websockets specific implementations would go here
|
|
7
|
+
async request(params) {
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
exports.A_WebsocketsChannel = A_WebsocketsChannel;
|
|
12
|
+
//# sourceMappingURL=A-Websockets.channel.js.map
|
|
13
|
+
//# sourceMappingURL=A-Websockets.channel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/channels/A-Websockets/A-Websockets.channel.ts"],"names":["A_Channel"],"mappings":";;;;AAIO,MAAM,4BAA4BA,kBAAA,CAAU;AAAA;AAAA,EAO/C,MAAM,QAAQ,MAAA,EAA2B;AAAA,EAEzC;AACJ","file":"A-Websockets.channel.js","sourcesContent":["import { A_Channel } from \"@adaas/a-utils/a-channel\";\n\n\n\nexport class A_WebsocketsChannel extends A_Channel {\n // Websockets specific implementations would go here\n\n\n\n\n\n async request(params: any): Promise<any> {\n\n }\n}"]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import '../../chunk-EQQGB2QZ.mjs';
|
|
2
|
+
import { A_Channel } from '@adaas/a-utils/a-channel';
|
|
3
|
+
|
|
4
|
+
class A_WebsocketsChannel extends A_Channel {
|
|
5
|
+
// Websockets specific implementations would go here
|
|
6
|
+
async request(params) {
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export { A_WebsocketsChannel };
|
|
11
|
+
//# sourceMappingURL=A-Websockets.channel.mjs.map
|
|
12
|
+
//# sourceMappingURL=A-Websockets.channel.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/channels/A-Websockets/A-Websockets.channel.ts"],"names":[],"mappings":";;;AAIO,MAAM,4BAA4B,SAAA,CAAU;AAAA;AAAA,EAO/C,MAAM,QAAQ,MAAA,EAA2B;AAAA,EAEzC;AACJ","file":"A-Websockets.channel.mjs","sourcesContent":["import { A_Channel } from \"@adaas/a-utils/a-channel\";\n\n\n\nexport class A_WebsocketsChannel extends A_Channel {\n // Websockets specific implementations would go here\n\n\n\n\n\n async request(params: any): Promise<any> {\n\n }\n}"]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
4
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
5
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
6
|
+
if (decorator = decorators[i])
|
|
7
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
8
|
+
if (kind && result) __defProp(target, key, result);
|
|
9
|
+
return result;
|
|
10
|
+
};
|
|
11
|
+
var __decorateParam = (index, decorator) => (target, key) => decorator(target, key, index);
|
|
12
|
+
|
|
13
|
+
export { __decorateClass, __decorateParam };
|
|
14
|
+
//# sourceMappingURL=chunk-EQQGB2QZ.mjs.map
|
|
15
|
+
//# sourceMappingURL=chunk-EQQGB2QZ.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"chunk-EQQGB2QZ.mjs"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
declare const A_SERVER_CONSTANTS__DEFAULT_ENV_VARIABLES: {
|
|
2
|
+
/**
|
|
3
|
+
* Port for the server to listen on
|
|
4
|
+
* [!] Default is 3000
|
|
5
|
+
* @default 3000
|
|
6
|
+
*/
|
|
7
|
+
readonly A_SERVER_PORT: "A_SERVER_PORT";
|
|
8
|
+
};
|
|
9
|
+
type A_TYPES__ServerENVVariables = (typeof A_SERVER_CONSTANTS__DEFAULT_ENV_VARIABLES)[keyof typeof A_SERVER_CONSTANTS__DEFAULT_ENV_VARIABLES][];
|
|
10
|
+
declare const A_SERVER_CONSTANTS__DEFAULT_ENV_VARIABLES_ARRAY: readonly ["A_SERVER_PORT"];
|
|
11
|
+
|
|
12
|
+
export { A_SERVER_CONSTANTS__DEFAULT_ENV_VARIABLES, A_SERVER_CONSTANTS__DEFAULT_ENV_VARIABLES_ARRAY, type A_TYPES__ServerENVVariables };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
declare const A_SERVER_CONSTANTS__DEFAULT_ENV_VARIABLES: {
|
|
2
|
+
/**
|
|
3
|
+
* Port for the server to listen on
|
|
4
|
+
* [!] Default is 3000
|
|
5
|
+
* @default 3000
|
|
6
|
+
*/
|
|
7
|
+
readonly A_SERVER_PORT: "A_SERVER_PORT";
|
|
8
|
+
};
|
|
9
|
+
type A_TYPES__ServerENVVariables = (typeof A_SERVER_CONSTANTS__DEFAULT_ENV_VARIABLES)[keyof typeof A_SERVER_CONSTANTS__DEFAULT_ENV_VARIABLES][];
|
|
10
|
+
declare const A_SERVER_CONSTANTS__DEFAULT_ENV_VARIABLES_ARRAY: readonly ["A_SERVER_PORT"];
|
|
11
|
+
|
|
12
|
+
export { A_SERVER_CONSTANTS__DEFAULT_ENV_VARIABLES, A_SERVER_CONSTANTS__DEFAULT_ENV_VARIABLES_ARRAY, type A_TYPES__ServerENVVariables };
|