@adaas/a-server 0.0.22 → 0.0.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.conf/tsconfig.base.json +79 -0
- package/.conf/tsconfig.browser.json +32 -0
- package/.conf/tsconfig.node.json +33 -0
- package/LICENSE +10 -19
- package/dist/browser/index.d.mts +1699 -0
- package/dist/browser/index.mjs +2935 -0
- package/dist/browser/index.mjs.map +1 -0
- package/dist/node/A-Request.entity-8_9MCXT2.d.ts +533 -0
- package/dist/node/A-Request.entity-r905O60G.d.mts +533 -0
- package/dist/node/A-Response.entity-6qhiV7BE.d.mts +348 -0
- package/dist/node/A-Response.entity-bjh6bofZ.d.ts +348 -0
- package/dist/node/channels/A-Http/A-Http.channel.constants.d.mts +9 -0
- package/dist/node/channels/A-Http/A-Http.channel.constants.d.ts +9 -0
- package/dist/node/channels/A-Http/A-Http.channel.constants.js +13 -0
- package/dist/node/channels/A-Http/A-Http.channel.constants.js.map +1 -0
- package/dist/node/channels/A-Http/A-Http.channel.constants.mjs +12 -0
- package/dist/node/channels/A-Http/A-Http.channel.constants.mjs.map +1 -0
- package/dist/node/channels/A-Http/A-Http.channel.d.mts +23 -0
- package/dist/node/channels/A-Http/A-Http.channel.d.ts +23 -0
- package/dist/node/channels/A-Http/A-Http.channel.error.d.mts +7 -0
- package/dist/node/channels/A-Http/A-Http.channel.error.d.ts +7 -0
- package/dist/node/channels/A-Http/A-Http.channel.error.js +11 -0
- package/dist/node/channels/A-Http/A-Http.channel.error.js.map +1 -0
- package/dist/node/channels/A-Http/A-Http.channel.error.mjs +10 -0
- package/dist/node/channels/A-Http/A-Http.channel.error.mjs.map +1 -0
- package/dist/node/channels/A-Http/A-Http.channel.js +122 -0
- package/dist/node/channels/A-Http/A-Http.channel.js.map +1 -0
- package/dist/node/channels/A-Http/A-Http.channel.mjs +110 -0
- package/dist/node/channels/A-Http/A-Http.channel.mjs.map +1 -0
- package/dist/node/channels/A-Http/A-Http.channel.types.d.mts +67 -0
- package/dist/node/channels/A-Http/A-Http.channel.types.d.ts +67 -0
- package/dist/node/channels/A-Http/A-Http.channel.types.js +4 -0
- package/dist/node/channels/A-Http/A-Http.channel.types.js.map +1 -0
- package/dist/node/channels/A-Http/A-Http.channel.types.mjs +3 -0
- package/dist/node/channels/A-Http/A-Http.channel.types.mjs.map +1 -0
- package/dist/node/channels/A-Websockets/A-Websockets.channel.d.mts +7 -0
- package/dist/node/channels/A-Websockets/A-Websockets.channel.d.ts +7 -0
- package/dist/node/channels/A-Websockets/A-Websockets.channel.js +13 -0
- package/dist/node/channels/A-Websockets/A-Websockets.channel.js.map +1 -0
- package/dist/node/channels/A-Websockets/A-Websockets.channel.mjs +12 -0
- package/dist/node/channels/A-Websockets/A-Websockets.channel.mjs.map +1 -0
- package/dist/node/chunk-EQQGB2QZ.mjs +15 -0
- package/dist/node/chunk-EQQGB2QZ.mjs.map +1 -0
- package/dist/node/constants/env.constants.d.mts +12 -0
- package/dist/node/constants/env.constants.d.ts +12 -0
- package/dist/node/constants/env.constants.js +23 -0
- package/dist/node/constants/env.constants.js.map +1 -0
- package/dist/node/constants/env.constants.mjs +22 -0
- package/dist/node/constants/env.constants.mjs.map +1 -0
- package/dist/node/controllers/A-CommandController/A-CommandController.component.d.mts +29 -0
- package/dist/node/controllers/A-CommandController/A-CommandController.component.d.ts +29 -0
- package/dist/node/controllers/A-CommandController/A-CommandController.component.js +55 -0
- package/dist/node/controllers/A-CommandController/A-CommandController.component.js.map +1 -0
- package/dist/node/controllers/A-CommandController/A-CommandController.component.mjs +43 -0
- package/dist/node/controllers/A-CommandController/A-CommandController.component.mjs.map +1 -0
- package/dist/node/controllers/A-EntityController/A-EntityController.component.d.mts +44 -0
- package/dist/node/controllers/A-EntityController/A-EntityController.component.d.ts +44 -0
- package/dist/node/controllers/A-EntityController/A-EntityController.component.js +189 -0
- package/dist/node/controllers/A-EntityController/A-EntityController.component.js.map +1 -0
- package/dist/node/controllers/A-EntityController/A-EntityController.component.mjs +177 -0
- package/dist/node/controllers/A-EntityController/A-EntityController.component.mjs.map +1 -0
- package/dist/node/controllers/A-EntityController/A-EntityController.component.types.d.mts +2 -0
- package/dist/node/controllers/A-EntityController/A-EntityController.component.types.d.ts +2 -0
- package/dist/node/controllers/A-EntityController/A-EntityController.component.types.js +4 -0
- package/dist/node/controllers/A-EntityController/A-EntityController.component.types.js.map +1 -0
- package/dist/node/controllers/A-EntityController/A-EntityController.component.types.mjs +3 -0
- package/dist/node/controllers/A-EntityController/A-EntityController.component.types.mjs.map +1 -0
- package/dist/node/controllers/A-ListingController/A-ListingController.component.d.mts +28 -0
- package/dist/node/controllers/A-ListingController/A-ListingController.component.d.ts +28 -0
- package/dist/node/controllers/A-ListingController/A-ListingController.component.js +59 -0
- package/dist/node/controllers/A-ListingController/A-ListingController.component.js.map +1 -0
- package/dist/node/controllers/A-ListingController/A-ListingController.component.mjs +47 -0
- package/dist/node/controllers/A-ListingController/A-ListingController.component.mjs.map +1 -0
- package/dist/node/controllers/A-ListingController/A-ListingController.types.d.mts +2 -0
- package/dist/node/controllers/A-ListingController/A-ListingController.types.d.ts +2 -0
- package/dist/node/controllers/A-ListingController/A-ListingController.types.js +4 -0
- package/dist/node/controllers/A-ListingController/A-ListingController.types.js.map +1 -0
- package/dist/node/controllers/A-ListingController/A-ListingController.types.mjs +3 -0
- package/dist/node/controllers/A-ListingController/A-ListingController.types.mjs.map +1 -0
- package/dist/node/controllers/A-ServerHealthMonitor/A-ServerHealthMonitor.component.d.mts +30 -0
- package/dist/node/controllers/A-ServerHealthMonitor/A-ServerHealthMonitor.component.d.ts +30 -0
- package/dist/node/controllers/A-ServerHealthMonitor/A-ServerHealthMonitor.component.js +46 -0
- package/dist/node/controllers/A-ServerHealthMonitor/A-ServerHealthMonitor.component.js.map +1 -0
- package/dist/node/controllers/A-ServerHealthMonitor/A-ServerHealthMonitor.component.mjs +34 -0
- package/dist/node/controllers/A-ServerHealthMonitor/A-ServerHealthMonitor.component.mjs.map +1 -0
- package/dist/node/controllers/A-ServerHealthMonitor/A-ServerHealthMonitor.types.d.mts +2 -0
- package/dist/node/controllers/A-ServerHealthMonitor/A-ServerHealthMonitor.types.d.ts +2 -0
- package/dist/node/controllers/A-ServerHealthMonitor/A-ServerHealthMonitor.types.js +4 -0
- package/dist/node/controllers/A-ServerHealthMonitor/A-ServerHealthMonitor.types.js.map +1 -0
- package/dist/node/controllers/A-ServerHealthMonitor/A-ServerHealthMonitor.types.mjs +3 -0
- package/dist/node/controllers/A-ServerHealthMonitor/A-ServerHealthMonitor.types.mjs.map +1 -0
- package/dist/node/index.d.mts +51 -0
- package/dist/node/index.d.ts +51 -0
- package/dist/node/index.js +320 -0
- package/dist/node/index.js.map +1 -0
- package/dist/node/index.mjs +48 -0
- package/dist/node/index.mjs.map +1 -0
- package/dist/node/lib/A-Request/A-HttpRequestData.context.d.mts +12 -0
- package/dist/node/lib/A-Request/A-HttpRequestData.context.d.ts +12 -0
- package/dist/node/lib/A-Request/A-HttpRequestData.context.js +25 -0
- package/dist/node/lib/A-Request/A-HttpRequestData.context.js.map +1 -0
- package/dist/node/lib/A-Request/A-HttpRequestData.context.mjs +24 -0
- package/dist/node/lib/A-Request/A-HttpRequestData.context.mjs.map +1 -0
- package/dist/node/lib/A-Request/A-HttpServerRequest.context.d.mts +39 -0
- package/dist/node/lib/A-Request/A-HttpServerRequest.context.d.ts +39 -0
- package/dist/node/lib/A-Request/A-HttpServerRequest.context.js +56 -0
- package/dist/node/lib/A-Request/A-HttpServerRequest.context.js.map +1 -0
- package/dist/node/lib/A-Request/A-HttpServerRequest.context.mjs +55 -0
- package/dist/node/lib/A-Request/A-HttpServerRequest.context.mjs.map +1 -0
- package/dist/node/lib/A-Request/A-Request.constants.d.mts +18 -0
- package/dist/node/lib/A-Request/A-Request.constants.d.ts +18 -0
- package/dist/node/lib/A-Request/A-Request.constants.js +22 -0
- package/dist/node/lib/A-Request/A-Request.constants.js.map +1 -0
- package/dist/node/lib/A-Request/A-Request.constants.mjs +22 -0
- package/dist/node/lib/A-Request/A-Request.constants.mjs.map +1 -0
- package/dist/node/lib/A-Request/A-Request.entity.d.mts +17 -0
- package/dist/node/lib/A-Request/A-Request.entity.d.ts +17 -0
- package/dist/node/lib/A-Request/A-Request.entity.js +651 -0
- package/dist/node/lib/A-Request/A-Request.entity.js.map +1 -0
- package/dist/node/lib/A-Request/A-Request.entity.mjs +639 -0
- package/dist/node/lib/A-Request/A-Request.entity.mjs.map +1 -0
- package/dist/node/lib/A-Request/A-Request.env.d.mts +37 -0
- package/dist/node/lib/A-Request/A-Request.env.d.ts +37 -0
- package/dist/node/lib/A-Request/A-Request.env.js +39 -0
- package/dist/node/lib/A-Request/A-Request.env.js.map +1 -0
- package/dist/node/lib/A-Request/A-Request.env.mjs +38 -0
- package/dist/node/lib/A-Request/A-Request.env.mjs.map +1 -0
- package/dist/node/lib/A-Request/A-Request.error.d.mts +11 -0
- package/dist/node/lib/A-Request/A-Request.error.d.ts +11 -0
- package/dist/node/lib/A-Request/A-Request.error.js +15 -0
- package/dist/node/lib/A-Request/A-Request.error.js.map +1 -0
- package/dist/node/lib/A-Request/A-Request.error.mjs +14 -0
- package/dist/node/lib/A-Request/A-Request.error.mjs.map +1 -0
- package/dist/node/lib/A-Request/A-Request.helper.d.mts +105 -0
- package/dist/node/lib/A-Request/A-Request.helper.d.ts +105 -0
- package/dist/node/lib/A-Request/A-Request.helper.js +181 -0
- package/dist/node/lib/A-Request/A-Request.helper.js.map +1 -0
- package/dist/node/lib/A-Request/A-Request.helper.mjs +180 -0
- package/dist/node/lib/A-Request/A-Request.helper.mjs.map +1 -0
- package/dist/node/lib/A-Request/A-Request.types.d.mts +17 -0
- package/dist/node/lib/A-Request/A-Request.types.d.ts +17 -0
- package/dist/node/lib/A-Request/A-Request.types.js +14 -0
- package/dist/node/lib/A-Request/A-Request.types.js.map +1 -0
- package/dist/node/lib/A-Request/A-Request.types.mjs +14 -0
- package/dist/node/lib/A-Request/A-Request.types.mjs.map +1 -0
- package/dist/node/lib/A-Response/A-Response.constants.d.mts +24 -0
- package/dist/node/lib/A-Response/A-Response.constants.d.ts +24 -0
- package/dist/node/lib/A-Response/A-Response.constants.js +28 -0
- package/dist/node/lib/A-Response/A-Response.constants.js.map +1 -0
- package/dist/node/lib/A-Response/A-Response.constants.mjs +28 -0
- package/dist/node/lib/A-Response/A-Response.constants.mjs.map +1 -0
- package/dist/node/lib/A-Response/A-Response.entity.d.mts +20 -0
- package/dist/node/lib/A-Response/A-Response.entity.d.ts +20 -0
- package/dist/node/lib/A-Response/A-Response.entity.js +608 -0
- package/dist/node/lib/A-Response/A-Response.entity.js.map +1 -0
- package/dist/node/lib/A-Response/A-Response.entity.mjs +596 -0
- package/dist/node/lib/A-Response/A-Response.entity.mjs.map +1 -0
- package/dist/node/lib/A-Response/A-Response.env.d.mts +2 -0
- package/dist/node/lib/A-Response/A-Response.env.d.ts +2 -0
- package/dist/node/lib/A-Response/A-Response.env.js +4 -0
- package/dist/node/lib/A-Response/A-Response.env.js.map +1 -0
- package/dist/node/lib/A-Response/A-Response.env.mjs +3 -0
- package/dist/node/lib/A-Response/A-Response.env.mjs.map +1 -0
- package/dist/node/lib/A-Response/A-Response.error.d.mts +6 -0
- package/dist/node/lib/A-Response/A-Response.error.d.ts +6 -0
- package/dist/node/lib/A-Response/A-Response.error.js +10 -0
- package/dist/node/lib/A-Response/A-Response.error.js.map +1 -0
- package/dist/node/lib/A-Response/A-Response.error.mjs +9 -0
- package/dist/node/lib/A-Response/A-Response.error.mjs.map +1 -0
- package/dist/node/lib/A-Response/A-Response.types.d.mts +20 -0
- package/dist/node/lib/A-Response/A-Response.types.d.ts +20 -0
- package/dist/node/lib/A-Response/A-Response.types.js +4 -0
- package/dist/node/lib/A-Response/A-Response.types.js.map +1 -0
- package/dist/node/lib/A-Response/A-Response.types.mjs +3 -0
- package/dist/node/lib/A-Response/A-Response.types.mjs.map +1 -0
- package/dist/node/lib/A-Server/A-HttpServer.constants.d.mts +7 -0
- package/dist/node/lib/A-Server/A-HttpServer.constants.d.ts +7 -0
- package/dist/node/lib/A-Server/A-HttpServer.constants.js +11 -0
- package/dist/node/lib/A-Server/A-HttpServer.constants.js.map +1 -0
- package/dist/node/lib/A-Server/A-HttpServer.constants.mjs +11 -0
- package/dist/node/lib/A-Server/A-HttpServer.constants.mjs.map +1 -0
- package/dist/node/lib/A-Server/A-HttpServer.container.d.mts +50 -0
- package/dist/node/lib/A-Server/A-HttpServer.container.d.ts +50 -0
- package/dist/node/lib/A-Server/A-HttpServer.container.js +196 -0
- package/dist/node/lib/A-Server/A-HttpServer.container.js.map +1 -0
- package/dist/node/lib/A-Server/A-HttpServer.container.mjs +184 -0
- package/dist/node/lib/A-Server/A-HttpServer.container.mjs.map +1 -0
- package/dist/node/lib/A-Server/A-HttpServer.error.d.mts +54 -0
- package/dist/node/lib/A-Server/A-HttpServer.error.d.ts +54 -0
- package/dist/node/lib/A-Server/A-HttpServer.error.js +118 -0
- package/dist/node/lib/A-Server/A-HttpServer.error.js.map +1 -0
- package/dist/node/lib/A-Server/A-HttpServer.error.mjs +117 -0
- package/dist/node/lib/A-Server/A-HttpServer.error.mjs.map +1 -0
- package/dist/node/lib/A-Server/A-HttpServer.types.d.mts +19 -0
- package/dist/node/lib/A-Server/A-HttpServer.types.d.ts +19 -0
- package/dist/node/lib/A-Server/A-HttpServer.types.js +4 -0
- package/dist/node/lib/A-Server/A-HttpServer.types.js.map +1 -0
- package/dist/node/lib/A-Server/A-HttpServer.types.mjs +3 -0
- package/dist/node/lib/A-Server/A-HttpServer.types.mjs.map +1 -0
- package/dist/node/lib/A-Server/A-Server.context.d.mts +22 -0
- package/dist/node/lib/A-Server/A-Server.context.d.ts +22 -0
- package/dist/node/lib/A-Server/A-Server.context.js +24 -0
- package/dist/node/lib/A-Server/A-Server.context.js.map +1 -0
- package/dist/node/lib/A-Server/A-Server.context.mjs +23 -0
- package/dist/node/lib/A-Server/A-Server.context.mjs.map +1 -0
- package/dist/node/lib/A-Server/A-Server.error.d.mts +14 -0
- package/dist/node/lib/A-Server/A-Server.error.d.ts +14 -0
- package/dist/node/lib/A-Server/A-Server.error.js +26 -0
- package/dist/node/lib/A-Server/A-Server.error.js.map +1 -0
- package/dist/node/lib/A-Server/A-Server.error.mjs +25 -0
- package/dist/node/lib/A-Server/A-Server.error.mjs.map +1 -0
- package/dist/node/lib/A-Server/A-Server.types.d.mts +26 -0
- package/dist/node/lib/A-Server/A-Server.types.d.ts +26 -0
- package/dist/node/lib/A-Server/A-Server.types.js +4 -0
- package/dist/node/lib/A-Server/A-Server.types.js.map +1 -0
- package/dist/node/lib/A-Server/A-Server.types.mjs +3 -0
- package/dist/node/lib/A-Server/A-Server.types.mjs.map +1 -0
- package/dist/node/lib/A-ServerController/A-ServerController.component.d.mts +29 -0
- package/dist/node/lib/A-ServerController/A-ServerController.component.d.ts +29 -0
- package/dist/node/lib/A-ServerController/A-ServerController.component.js +49 -0
- package/dist/node/lib/A-ServerController/A-ServerController.component.js.map +1 -0
- package/dist/node/lib/A-ServerController/A-ServerController.component.mjs +37 -0
- package/dist/node/lib/A-ServerController/A-ServerController.component.mjs.map +1 -0
- package/dist/node/lib/A-ServerController/A-ServerController.types.d.mts +2 -0
- package/dist/node/lib/A-ServerController/A-ServerController.types.d.ts +2 -0
- package/dist/node/lib/A-ServerController/A-ServerController.types.js +4 -0
- package/dist/node/lib/A-ServerController/A-ServerController.types.js.map +1 -0
- package/dist/node/lib/A-ServerController/A-ServerController.types.mjs +3 -0
- package/dist/node/lib/A-ServerController/A-ServerController.types.mjs.map +1 -0
- package/dist/node/lib/A-ServerEntityList/A-EntityList.entity.d.mts +49 -0
- package/dist/node/lib/A-ServerEntityList/A-EntityList.entity.d.ts +49 -0
- package/dist/node/lib/A-ServerEntityList/A-EntityList.entity.js +91 -0
- package/dist/node/lib/A-ServerEntityList/A-EntityList.entity.js.map +1 -0
- package/dist/node/lib/A-ServerEntityList/A-EntityList.entity.mjs +90 -0
- package/dist/node/lib/A-ServerEntityList/A-EntityList.entity.mjs.map +1 -0
- package/dist/node/lib/A-ServerEntityList/A-EntityList.types.d.mts +22 -0
- package/dist/node/lib/A-ServerEntityList/A-EntityList.types.d.ts +22 -0
- package/dist/node/lib/A-ServerEntityList/A-EntityList.types.js +10 -0
- package/dist/node/lib/A-ServerEntityList/A-EntityList.types.js.map +1 -0
- package/dist/node/lib/A-ServerEntityList/A-EntityList.types.mjs +10 -0
- package/dist/node/lib/A-ServerEntityList/A-EntityList.types.mjs.map +1 -0
- package/dist/node/lib/A-ServerListQuery/A-ServerListQueryFilter.context.d.mts +13 -0
- package/dist/node/lib/A-ServerListQuery/A-ServerListQueryFilter.context.d.ts +13 -0
- package/dist/node/lib/A-ServerListQuery/A-ServerListQueryFilter.context.js +32 -0
- package/dist/node/lib/A-ServerListQuery/A-ServerListQueryFilter.context.js.map +1 -0
- package/dist/node/lib/A-ServerListQuery/A-ServerListQueryFilter.context.mjs +31 -0
- package/dist/node/lib/A-ServerListQuery/A-ServerListQueryFilter.context.mjs.map +1 -0
- package/dist/node/lib/A-ServerLogger/A-ServerLogger.component.d.mts +48 -0
- package/dist/node/lib/A-ServerLogger/A-ServerLogger.component.d.ts +48 -0
- package/dist/node/lib/A-ServerLogger/A-ServerLogger.component.js +88 -0
- package/dist/node/lib/A-ServerLogger/A-ServerLogger.component.js.map +1 -0
- package/dist/node/lib/A-ServerLogger/A-ServerLogger.component.mjs +76 -0
- package/dist/node/lib/A-ServerLogger/A-ServerLogger.component.mjs.map +1 -0
- package/dist/node/lib/A-ServerLogger/A-ServerLogger.constants.d.mts +24 -0
- package/dist/node/lib/A-ServerLogger/A-ServerLogger.constants.d.ts +24 -0
- package/dist/node/lib/A-ServerLogger/A-ServerLogger.constants.js +33 -0
- package/dist/node/lib/A-ServerLogger/A-ServerLogger.constants.js.map +1 -0
- package/dist/node/lib/A-ServerLogger/A-ServerLogger.constants.mjs +33 -0
- package/dist/node/lib/A-ServerLogger/A-ServerLogger.constants.mjs.map +1 -0
- package/dist/node/lib/A-ServerLogger/A-ServerLogger.types.d.mts +12 -0
- package/dist/node/lib/A-ServerLogger/A-ServerLogger.types.d.ts +12 -0
- package/dist/node/lib/A-ServerLogger/A-ServerLogger.types.js +4 -0
- package/dist/node/lib/A-ServerLogger/A-ServerLogger.types.js.map +1 -0
- package/dist/node/lib/A-ServerLogger/A-ServerLogger.types.mjs +3 -0
- package/dist/node/lib/A-ServerLogger/A-ServerLogger.types.mjs.map +1 -0
- package/dist/node/lib/A-ServerMiddleware/A-ServerMiddleware.component.d.mts +6 -0
- package/dist/node/lib/A-ServerMiddleware/A-ServerMiddleware.component.d.ts +6 -0
- package/dist/node/lib/A-ServerMiddleware/A-ServerMiddleware.component.js +18 -0
- package/dist/node/lib/A-ServerMiddleware/A-ServerMiddleware.component.js.map +1 -0
- package/dist/node/lib/A-ServerMiddleware/A-ServerMiddleware.component.mjs +17 -0
- package/dist/node/lib/A-ServerMiddleware/A-ServerMiddleware.component.mjs.map +1 -0
- package/dist/node/lib/A-ServerMiddleware/A-ServerMiddleware.constants.d.mts +2 -0
- package/dist/node/lib/A-ServerMiddleware/A-ServerMiddleware.constants.d.ts +2 -0
- package/dist/node/lib/A-ServerMiddleware/A-ServerMiddleware.constants.js +4 -0
- package/dist/node/lib/A-ServerMiddleware/A-ServerMiddleware.constants.js.map +1 -0
- package/dist/node/lib/A-ServerMiddleware/A-ServerMiddleware.constants.mjs +3 -0
- package/dist/node/lib/A-ServerMiddleware/A-ServerMiddleware.constants.mjs.map +1 -0
- package/dist/node/lib/A-ServerMiddleware/A-ServerMiddleware.types.d.mts +2 -0
- package/dist/node/lib/A-ServerMiddleware/A-ServerMiddleware.types.d.ts +2 -0
- package/dist/node/lib/A-ServerMiddleware/A-ServerMiddleware.types.js +4 -0
- package/dist/node/lib/A-ServerMiddleware/A-ServerMiddleware.types.js.map +1 -0
- package/dist/node/lib/A-ServerMiddleware/A-ServerMiddleware.types.mjs +3 -0
- package/dist/node/lib/A-ServerMiddleware/A-ServerMiddleware.types.mjs.map +1 -0
- package/dist/node/lib/A-ServerProxy/A-ServerProxy.component.d.mts +31 -0
- package/dist/node/lib/A-ServerProxy/A-ServerProxy.component.d.ts +31 -0
- package/dist/node/lib/A-ServerProxy/A-ServerProxy.component.js +90 -0
- package/dist/node/lib/A-ServerProxy/A-ServerProxy.component.js.map +1 -0
- package/dist/node/lib/A-ServerProxy/A-ServerProxy.component.mjs +78 -0
- package/dist/node/lib/A-ServerProxy/A-ServerProxy.component.mjs.map +1 -0
- package/dist/node/lib/A-ServerProxy/A-ServerProxy.constants.d.mts +9 -0
- package/dist/node/lib/A-ServerProxy/A-ServerProxy.constants.d.ts +9 -0
- package/dist/node/lib/A-ServerProxy/A-ServerProxy.constants.js +14 -0
- package/dist/node/lib/A-ServerProxy/A-ServerProxy.constants.js.map +1 -0
- package/dist/node/lib/A-ServerProxy/A-ServerProxy.constants.mjs +14 -0
- package/dist/node/lib/A-ServerProxy/A-ServerProxy.constants.mjs.map +1 -0
- package/dist/node/lib/A-ServerProxy/A-ServerProxy.context.d.mts +36 -0
- package/dist/node/lib/A-ServerProxy/A-ServerProxy.context.d.ts +36 -0
- package/dist/node/lib/A-ServerProxy/A-ServerProxy.context.js +60 -0
- package/dist/node/lib/A-ServerProxy/A-ServerProxy.context.js.map +1 -0
- package/dist/node/lib/A-ServerProxy/A-ServerProxy.context.mjs +59 -0
- package/dist/node/lib/A-ServerProxy/A-ServerProxy.context.mjs.map +1 -0
- package/dist/node/lib/A-ServerProxy/A-ServerProxy.types.d.mts +23 -0
- package/dist/node/lib/A-ServerProxy/A-ServerProxy.types.d.ts +23 -0
- package/dist/node/lib/A-ServerProxy/A-ServerProxy.types.js +4 -0
- package/dist/node/lib/A-ServerProxy/A-ServerProxy.types.js.map +1 -0
- package/dist/node/lib/A-ServerProxy/A-ServerProxy.types.mjs +3 -0
- package/dist/node/lib/A-ServerProxy/A-ServerProxy.types.mjs.map +1 -0
- package/dist/node/lib/A-ServerRoute/A-ServerRoute.constants.d.mts +20 -0
- package/dist/node/lib/A-ServerRoute/A-ServerRoute.constants.d.ts +20 -0
- package/dist/node/lib/A-ServerRoute/A-ServerRoute.constants.js +25 -0
- package/dist/node/lib/A-ServerRoute/A-ServerRoute.constants.js.map +1 -0
- package/dist/node/lib/A-ServerRoute/A-ServerRoute.constants.mjs +24 -0
- package/dist/node/lib/A-ServerRoute/A-ServerRoute.constants.mjs.map +1 -0
- package/dist/node/lib/A-ServerRoute/A-ServerRoute.entity.d.mts +15 -0
- package/dist/node/lib/A-ServerRoute/A-ServerRoute.entity.d.ts +15 -0
- package/dist/node/lib/A-ServerRoute/A-ServerRoute.entity.js +24 -0
- package/dist/node/lib/A-ServerRoute/A-ServerRoute.entity.js.map +1 -0
- package/dist/node/lib/A-ServerRoute/A-ServerRoute.entity.mjs +23 -0
- package/dist/node/lib/A-ServerRoute/A-ServerRoute.entity.mjs.map +1 -0
- package/dist/node/lib/A-ServerRoute/A-ServerRoute.types.d.mts +6 -0
- package/dist/node/lib/A-ServerRoute/A-ServerRoute.types.d.ts +6 -0
- package/dist/node/lib/A-ServerRoute/A-ServerRoute.types.js +4 -0
- package/dist/node/lib/A-ServerRoute/A-ServerRoute.types.js.map +1 -0
- package/dist/node/lib/A-ServerRoute/A-ServerRoute.types.mjs +3 -0
- package/dist/node/lib/A-ServerRoute/A-ServerRoute.types.mjs.map +1 -0
- package/dist/node/lib/A-ServerRouter/A-ServerRouter.component.d.mts +84 -0
- package/dist/node/lib/A-ServerRouter/A-ServerRouter.component.d.ts +84 -0
- package/dist/node/lib/A-ServerRouter/A-ServerRouter.component.js +194 -0
- package/dist/node/lib/A-ServerRouter/A-ServerRouter.component.js.map +1 -0
- package/dist/node/lib/A-ServerRouter/A-ServerRouter.component.mjs +184 -0
- package/dist/node/lib/A-ServerRouter/A-ServerRouter.component.mjs.map +1 -0
- package/dist/node/lib/A-ServerRouter/A-ServerRouter.constants.d.mts +6 -0
- package/dist/node/lib/A-ServerRouter/A-ServerRouter.constants.d.ts +6 -0
- package/dist/node/lib/A-ServerRouter/A-ServerRouter.constants.js +10 -0
- package/dist/node/lib/A-ServerRouter/A-ServerRouter.constants.js.map +1 -0
- package/dist/node/lib/A-ServerRouter/A-ServerRouter.constants.mjs +10 -0
- package/dist/node/lib/A-ServerRouter/A-ServerRouter.constants.mjs.map +1 -0
- package/dist/node/lib/A-ServerRouter/A-ServerRouter.meta.d.mts +16 -0
- package/dist/node/lib/A-ServerRouter/A-ServerRouter.meta.d.ts +16 -0
- package/dist/node/lib/A-ServerRouter/A-ServerRouter.meta.js +40 -0
- package/dist/node/lib/A-ServerRouter/A-ServerRouter.meta.js.map +1 -0
- package/dist/node/lib/A-ServerRouter/A-ServerRouter.meta.mjs +39 -0
- package/dist/node/lib/A-ServerRouter/A-ServerRouter.meta.mjs.map +1 -0
- package/dist/node/lib/A-ServerRouter/A-ServerRouter.types.d.mts +24 -0
- package/dist/node/lib/A-ServerRouter/A-ServerRouter.types.d.ts +24 -0
- package/dist/node/lib/A-ServerRouter/A-ServerRouter.types.js +4 -0
- package/dist/node/lib/A-ServerRouter/A-ServerRouter.types.js.map +1 -0
- package/dist/node/lib/A-ServerRouter/A-ServerRouter.types.mjs +3 -0
- package/dist/node/lib/A-ServerRouter/A-ServerRouter.types.mjs.map +1 -0
- package/dist/node/lib/A-ServerRouter/A-ServerRouterDefine.decorator.d.mts +16 -0
- package/dist/node/lib/A-ServerRouter/A-ServerRouterDefine.decorator.d.ts +16 -0
- package/dist/node/lib/A-ServerRouter/A-ServerRouterDefine.decorator.js +25 -0
- package/dist/node/lib/A-ServerRouter/A-ServerRouterDefine.decorator.js.map +1 -0
- package/dist/node/lib/A-ServerRouter/A-ServerRouterDefine.decorator.mjs +24 -0
- package/dist/node/lib/A-ServerRouter/A-ServerRouterDefine.decorator.mjs.map +1 -0
- package/dist/node/lib/A-ServerStatic/A-ServerStatic.component.d.mts +65 -0
- package/dist/node/lib/A-ServerStatic/A-ServerStatic.component.d.ts +65 -0
- package/dist/node/lib/A-ServerStatic/A-ServerStatic.component.js +260 -0
- package/dist/node/lib/A-ServerStatic/A-ServerStatic.component.js.map +1 -0
- package/dist/node/lib/A-ServerStatic/A-ServerStatic.component.mjs +248 -0
- package/dist/node/lib/A-ServerStatic/A-ServerStatic.component.mjs.map +1 -0
- package/dist/node/lib/A-ServerStatic/A-ServerStatic.context.d.mts +110 -0
- package/dist/node/lib/A-ServerStatic/A-ServerStatic.context.d.ts +110 -0
- package/dist/node/lib/A-ServerStatic/A-ServerStatic.context.js +180 -0
- package/dist/node/lib/A-ServerStatic/A-ServerStatic.context.js.map +1 -0
- package/dist/node/lib/A-ServerStatic/A-ServerStatic.context.mjs +179 -0
- package/dist/node/lib/A-ServerStatic/A-ServerStatic.context.mjs.map +1 -0
- package/dist/node/lib/A-ServerStatic/A-ServerStatic.types.d.mts +8 -0
- package/dist/node/lib/A-ServerStatic/A-ServerStatic.types.d.ts +8 -0
- package/dist/node/lib/A-ServerStatic/A-ServerStatic.types.js +4 -0
- package/dist/node/lib/A-ServerStatic/A-ServerStatic.types.js.map +1 -0
- package/dist/node/lib/A-ServerStatic/A-ServerStatic.types.mjs +3 -0
- package/dist/node/lib/A-ServerStatic/A-ServerStatic.types.mjs.map +1 -0
- package/dist/node/middlewares/A-ServerCORS/A_ServerCORS.component.d.mts +29 -0
- package/dist/node/middlewares/A-ServerCORS/A_ServerCORS.component.d.ts +29 -0
- package/dist/node/middlewares/A-ServerCORS/A_ServerCORS.component.js +62 -0
- package/dist/node/middlewares/A-ServerCORS/A_ServerCORS.component.js.map +1 -0
- package/dist/node/middlewares/A-ServerCORS/A_ServerCORS.component.mjs +50 -0
- package/dist/node/middlewares/A-ServerCORS/A_ServerCORS.component.mjs.map +1 -0
- package/dist/node/middlewares/A-ServerCORS/A_ServerCORS.constants.d.mts +5 -0
- package/dist/node/middlewares/A-ServerCORS/A_ServerCORS.constants.d.ts +5 -0
- package/dist/node/middlewares/A-ServerCORS/A_ServerCORS.constants.js +14 -0
- package/dist/node/middlewares/A-ServerCORS/A_ServerCORS.constants.js.map +1 -0
- package/dist/node/middlewares/A-ServerCORS/A_ServerCORS.constants.mjs +14 -0
- package/dist/node/middlewares/A-ServerCORS/A_ServerCORS.constants.mjs.map +1 -0
- package/dist/node/middlewares/A-ServerCORS/A_ServerCORS.types.d.mts +9 -0
- package/dist/node/middlewares/A-ServerCORS/A_ServerCORS.types.d.ts +9 -0
- package/dist/node/middlewares/A-ServerCORS/A_ServerCORS.types.js +4 -0
- package/dist/node/middlewares/A-ServerCORS/A_ServerCORS.types.js.map +1 -0
- package/dist/node/middlewares/A-ServerCORS/A_ServerCORS.types.mjs +3 -0
- package/dist/node/middlewares/A-ServerCORS/A_ServerCORS.types.mjs.map +1 -0
- package/dist/node/repositories/A-EntityRepository/A-EntityRepository.component.d.mts +24 -0
- package/dist/node/repositories/A-EntityRepository/A-EntityRepository.component.d.ts +24 -0
- package/dist/node/repositories/A-EntityRepository/A-EntityRepository.component.js +94 -0
- package/dist/node/repositories/A-EntityRepository/A-EntityRepository.component.js.map +1 -0
- package/dist/node/repositories/A-EntityRepository/A-EntityRepository.component.mjs +82 -0
- package/dist/node/repositories/A-EntityRepository/A-EntityRepository.component.mjs.map +1 -0
- package/dist/node/repositories/A-EntityRepository/A-EntityRepository.error.d.mts +2 -0
- package/dist/node/repositories/A-EntityRepository/A-EntityRepository.error.d.ts +2 -0
- package/dist/node/repositories/A-EntityRepository/A-EntityRepository.error.js +4 -0
- package/dist/node/repositories/A-EntityRepository/A-EntityRepository.error.js.map +1 -0
- package/dist/node/repositories/A-EntityRepository/A-EntityRepository.error.mjs +3 -0
- package/dist/node/repositories/A-EntityRepository/A-EntityRepository.error.mjs.map +1 -0
- package/dist/node/repositories/A-EntityRepository/A-EntityRepository.types.d.mts +2 -0
- package/dist/node/repositories/A-EntityRepository/A-EntityRepository.types.d.ts +2 -0
- package/dist/node/repositories/A-EntityRepository/A-EntityRepository.types.js +4 -0
- package/dist/node/repositories/A-EntityRepository/A-EntityRepository.types.js.map +1 -0
- package/dist/node/repositories/A-EntityRepository/A-EntityRepository.types.mjs +3 -0
- package/dist/node/repositories/A-EntityRepository/A-EntityRepository.types.mjs.map +1 -0
- package/examples/simple-server/commands/SignIn.command.ts +17 -1
- package/examples/simple-server/components/Test.controller.ts +8 -7
- package/examples/simple-server/components/Users.repository.ts +28 -26
- package/examples/simple-server/concept.ts +56 -66
- package/examples/simple-server/entities/User/User.entity.ts +17 -7
- package/jest.config.ts +24 -10
- package/package.json +267 -25
- package/src/channels/A-Http/A-Http.channel.constants.ts +6 -7
- package/src/channels/A-Http/A-Http.channel.error.ts +2 -2
- package/src/channels/A-Http/A-Http.channel.ts +76 -125
- package/src/channels/A-Http/A-Http.channel.types.ts +6 -3
- package/src/channels/A-Websockets/A-Websockets.channel.ts +1 -1
- package/src/{components → controllers}/A-CommandController/A-CommandController.component.ts +16 -10
- package/src/{components → controllers}/A-EntityController/A-EntityController.component.ts +24 -28
- package/src/{components → controllers}/A-ListingController/A-ListingController.component.ts +10 -12
- package/src/{components → controllers}/A-ServerHealthMonitor/A-ServerHealthMonitor.component.ts +11 -11
- package/src/index.ts +58 -63
- package/src/lib/A-Request/A-HttpRequestData.context.ts +30 -0
- package/src/lib/A-Request/A-HttpServerRequest.context.ts +103 -0
- package/src/lib/A-Request/A-Request.constants.ts +30 -0
- package/src/lib/A-Request/A-Request.entity.ts +844 -0
- package/src/lib/A-Request/A-Request.env.ts +50 -0
- package/src/lib/A-Request/A-Request.error.ts +11 -0
- package/src/lib/A-Request/A-Request.helper.ts +276 -0
- package/src/lib/A-Request/A-Request.types.ts +284 -0
- package/src/lib/A-Request/README.md +567 -0
- package/src/lib/A-Response/A-Response.constants.ts +24 -0
- package/src/lib/A-Response/A-Response.entity.ts +751 -0
- package/src/lib/A-Response/A-Response.error.ts +6 -0
- package/src/lib/A-Response/A-Response.types.ts +127 -0
- package/src/lib/A-Response/README.md +793 -0
- package/src/lib/A-Server/A-HttpServer.constants.ts +9 -0
- package/src/lib/A-Server/A-HttpServer.container.ts +256 -0
- package/src/lib/A-Server/A-HttpServer.error.ts +165 -0
- package/src/lib/A-Server/A-HttpServer.types.ts +37 -0
- package/src/{context/A-Server/A_Server.context.ts → lib/A-Server/A-Server.context.ts} +6 -7
- package/src/lib/A-Server/A-Server.error.ts +26 -0
- package/src/{components/A-ServerError/A-ServerError.types.ts → lib/A-Server/A-Server.types.ts} +8 -0
- package/src/{components/A-Controller/A-Controller.component.ts → lib/A-ServerController/A-ServerController.component.ts} +5 -5
- package/src/{entities/A_EntityList/A_EntityList.entity.ts → lib/A-ServerEntityList/A-EntityList.entity.ts} +2 -2
- package/src/{entities/A_EntityList/A_EntityList.entity.types.ts → lib/A-ServerEntityList/A-EntityList.types.ts} +2 -2
- package/src/{context/A-ListQueryFilter/A_ListQueryFilter.context.ts → lib/A-ServerListQuery/A-ServerListQueryFilter.context.ts} +1 -1
- package/src/lib/A-ServerLogger/A-ServerLogger.component.ts +121 -0
- package/src/lib/A-ServerLogger/A-ServerLogger.types.ts +13 -0
- package/src/lib/A-ServerMiddleware/A-ServerMiddleware.component.ts +17 -0
- package/src/{components → lib}/A-ServerProxy/A-ServerProxy.component.ts +17 -12
- package/src/{context/A-ProxyConfig/A_ProxyConfig.constants.ts → lib/A-ServerProxy/A-ServerProxy.constants.ts} +1 -1
- package/src/{context/A-ProxyConfig/A_ProxyConfig.context.ts → lib/A-ServerProxy/A-ServerProxy.context.ts} +4 -4
- package/src/{context/A-ProxyConfig/A_ProxyConfig.types.ts → lib/A-ServerProxy/A-ServerProxy.types.ts} +4 -4
- package/src/lib/A-ServerRoute/A-ServerRoute.constants.ts +20 -0
- package/src/lib/A-ServerRoute/A-ServerRoute.entity.ts +48 -0
- package/src/lib/A-ServerRoute/A-ServerRoute.types.ts +6 -0
- package/src/{components/A-Router/A-Router.component.ts → lib/A-ServerRouter/A-ServerRouter.component.ts} +77 -97
- package/src/lib/A-ServerRouter/A-ServerRouter.constants.ts +8 -0
- package/src/lib/A-ServerRouter/A-ServerRouter.meta.ts +48 -0
- package/src/lib/A-ServerRouter/A-ServerRouter.types.ts +27 -0
- package/src/lib/A-ServerRouter/A-ServerRouterDefine.decorator.ts +37 -0
- package/src/{components/A-StaticLoader/A-StaticLoader.component.ts → lib/A-ServerStatic/A-ServerStatic.component.ts} +73 -54
- package/src/{context/A-StaticConfig/A-StaticConfig.context.ts → lib/A-ServerStatic/A-ServerStatic.context.ts} +16 -6
- package/src/{components → middlewares}/A-ServerCORS/A_ServerCORS.component.ts +16 -13
- package/src/{components/A-ServerCORS/A_ServerCORS.component.defaults.ts → middlewares/A-ServerCORS/A_ServerCORS.constants.ts} +2 -2
- package/src/{components → repositories}/A-EntityRepository/A-EntityRepository.component.ts +39 -30
- package/tests/A-HttpChannel.test.ts +41 -48
- package/tests/A-HttpServerError.test.ts +204 -0
- package/tests/A-Request.test.ts +351 -0
- package/tsconfig.json +40 -50
- package/tsup.config.ts +111 -13
- package/dist/index.d.mts +0 -855
- package/dist/index.d.ts +0 -855
- package/dist/index.js +0 -2179
- package/dist/index.js.map +0 -1
- package/dist/index.mjs +0 -2144
- package/dist/index.mjs.map +0 -1
- package/examples/microservices-server/components/controllers/Statistics.controller.ts +0 -18
- package/examples/microservices-server/components/repositories/Memory.repository.ts +0 -66
- package/examples/microservices-server/concept.ts +0 -43
- package/examples/microservices-server/context/MemoryStore.context.ts +0 -31
- package/examples/microservices-server/entities/Order.entity.ts +0 -7
- package/examples/microservices-server/entities/User.entity.ts +0 -8
- package/src/components/A-Router/A-Router.component.types.ts +0 -38
- package/src/components/A-ServerError/A-ServerError.class.ts +0 -98
- package/src/components/A-ServerLogger/A_ServerLogger.component.ts +0 -194
- package/src/components/A-ServerLogger/A_ServerLogger.component.types.ts +0 -14
- package/src/containers/A-Service/A-Service.container.ts +0 -218
- package/src/containers/A-Service/A-Service.container.types.ts +0 -46
- package/src/context/A-EntityFactory/A-EntityFactory.context.ts +0 -163
- package/src/context/A-EntityFactory/A-EntityFactory.context.types.ts +0 -11
- package/src/context/A-HttpChannel/A-HttpChannel.context.ts +0 -36
- package/src/context/A-Server/A_Server.context.types.ts +0 -9
- package/src/entities/A-Request/A-Request.entity.ts +0 -163
- package/src/entities/A-Request/A-Request.entity.types.ts +0 -41
- package/src/entities/A-Response/A-Response.entity.ts +0 -194
- package/src/entities/A-Response/A-Response.entity.types.ts +0 -26
- package/src/entities/A-Route/A-Route.entity.ts +0 -117
- package/tests/A-Service.test.ts +0 -18
- /package/src/{components → controllers}/A-EntityController/A-EntityController.component.types.ts +0 -0
- /package/src/{components/A-Controller/A-Controller.component.types.ts → controllers/A-ListingController/A-ListingController.types.ts} +0 -0
- /package/src/{components/A-ServerHealthMonitor/A-ServerHealthMonitor.component.types.ts → controllers/A-ServerHealthMonitor/A-ServerHealthMonitor.types.ts} +0 -0
- /package/src/{components/A-EntityRepository/A-EntityRepository.error.ts → lib/A-Response/A-Response.env.ts} +0 -0
- /package/src/{components/A-EntityRepository/A-EntityRepository.types.ts → lib/A-ServerController/A-ServerController.types.ts} +0 -0
- /package/src/{components → lib}/A-ServerLogger/A-ServerLogger.constants.ts +0 -0
- /package/src/{components/A-ListingController/A-ListingController.component.types.ts → lib/A-ServerMiddleware/A-ServerMiddleware.constants.ts} +0 -0
- /package/src/{components/A-ServerError/A-ServerError.constants.ts → lib/A-ServerMiddleware/A-ServerMiddleware.types.ts} +0 -0
- /package/src/{components/A-StaticLoader/A-StaticLoader.component.types.ts → lib/A-ServerStatic/A-ServerStatic.types.ts} +0 -0
- /package/src/{components/A-ServerCORS/A_ServerCORS.component.types.ts → middlewares/A-ServerCORS/A_ServerCORS.types.ts} +0 -0
- /package/src/{context/A-StaticConfig/A-StaticConfig.context.types.ts → repositories/A-EntityRepository/A-EntityRepository.error.ts} +0 -0
- /package/src/{entities/A-Route/A-Route.entity.types.ts → repositories/A-EntityRepository/A-EntityRepository.types.ts} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/lib/A-ServerProxy/A-ServerProxy.component.ts"],"names":[],"mappings":";;;;;;;;;;AAUO,MAAM,sBAAsB,WAAA,CAAY;AAAA,EAI3C,MAAM,IAAA,CACkB,MAAA,EACK,MAAA,EAC3B;AACE,IAAA,MAAA,CAAO,IAAA;AAAA,MACH,OAAA;AAAA,MACA,CAAA,wBAAA,CAAA;AAAA,MACA,GAAG,MAAA,CAAO,OAAA,CAAQ,IAAI,CAAA,CAAA,KAAK,CAAA,EAAG,EAAE,KAAA,CAAM,QAAA,EAAU,CAAA,IAAA,EAAO,CAAA,CAAE,QAAQ,CAAA,EAAA,EAAK,CAAA,CAAE,QAAQ,CAAA,CAAA,EAAI,CAAA,CAAE,IAAI,CAAA,CAAE;AAAA,KAChG;AAAA,EACJ;AAAA,EAQA,MAAM,SAAA,CACmB,GAAA,EACC,KACG,WAAA,EACL,MAAA,EACE,UACD,OAAA,EACvB;AACE,IAAA,OAAO,IAAI,OAAA,CAAc,OAAO,OAAA,EAAS,MAAA,KAAW;AAChD,MAAA,MAAM,EAAE,MAAA,EAAQ,GAAA,EAAI,GAAI,GAAA;AAExB,MAAA,MAAM,KAAA,GAAQ,IAAI,aAAA,CAAc,GAAA,EAAK,MAAM,CAAA;AAC3C,MAAA,MAAM,MAAA,GAAS,WAAA,CAAY,MAAA,CAAO,KAAA,CAAM,UAAU,CAAA;AAElD,MAAA,IAAI,CAAC,MAAA,EAAQ;AACT,QAAA,OAAO,OAAA,EAAQ;AAAA,MACnB;AAEA,MAAA,MAAA,CAAO,GAAA;AAAA,QACH,QAAA;AAAA,QACA,oBAAoB,MAAM,CAAA,CAAA,EAAI,GAAG,CAAA,IAAA,EAAO,OAAO,QAAQ,CAAA,CAAA;AAAA,QACvD;AAAA,OACJ;AAEA,MAAA,MAAM,MAAA,GAAS,OAAO,MAAA,CAAO,QAAA,KAAa,WACpC,QAAA,CAAS,KAAA,EAAM,GACf,QAAA,CAAS,IAAA,EAAK,CAAA;AAEpB,MAAA,MAAM,WAAW,MAAA,CAAO,OAAA;AAAA,QACpB;AAAA,UACI,MAAA,EAAQ,OAAO,KAAA,CAAM,MAAA;AAAA,UACrB,UAAU,MAAA,CAAO,QAAA;AAAA,UACjB,MAAM,MAAA,CAAO,IAAA;AAAA,UACb,SAAS,MAAA,CAAO,OAAA;AAAA,UAChB,MAAM,KAAA,CAAM;AAAA,SAChB;AAAA,QACA,CAAC,QAAA,KAAa;AACV,UAAA,IAAI,CAAC,IAAI,WAAA,EAAa;AAClB,YAAA,GAAA,CAAI,SAAA,CAAU,QAAA,CAAS,UAAA,IAAc,GAAA,EAAK,SAAS,OAAO,CAAA;AAAA,UAC9D;AACA,UAAA,QAAA,CAAS,EAAA,CAAG,OAAO,MAAM;AAErB,YAAA,MAAA,CAAO,GAAA,CAAI,OAAA,EAAS,CAAA,iBAAA,EAAoB,MAAA,EAAQ,QAAQ,CAAA,UAAA,CAAY,CAAA;AAEpE,YAAA,OAAA,EAAQ;AAAA,UACZ,CAAC,CAAA;AAED,UAAA,QAAA,CAAS,IAAA,CAAK,IAAI,QAAQ,CAAA;AAAA,QAC9B;AAAA,OACJ;AAEA,MAAA,QAAA,CAAS,GAAG,OAAA,EAAS,CAAC,GAAA,KAAQ,MAAA,CAAO,GAAG,CAAC,CAAA;AAEzC,MAAA,GAAA,CAAI,KAAK,QAAQ,CAAA;AAEjB,MAAA,OAAA,CAAQ,SAAA,EAAU;AAAA,IACtB,CAAC,CAAA;AAAA,EACL;AAEJ;AA5EU,eAAA,CAAA;AAAA,EADL,UAAU,IAAA,EAAK;AAAA,EAEX,4BAAS,QAAQ,CAAA,CAAA;AAAA,EACjB,4BAAS,aAAa,CAAA;AAAA,CAAA,EANlB,aAAA,CAIH,SAAA,EAAA,MAAA,EAAA,CAAA,CAAA;AAiBA,eAAA,CAAA;AAAA,EAJL,UAAU,MAAA,CAAO;AAAA,IACd,MAAM,oBAAA,CAAqB,SAAA;AAAA,IAC3B,MAAA,EAAO;AAAA,GACV,CAAA;AAAA,EAEI,4BAAS,SAAS,CAAA,CAAA;AAAA,EAClB,4BAAS,UAAU,CAAA,CAAA;AAAA,EACnB,4BAAS,aAAa,CAAA,CAAA;AAAA,EACtB,4BAAS,QAAQ,CAAA,CAAA;AAAA,EACjB,4BAAS,UAAU,CAAA,CAAA;AAAA,EACnB,4BAAS,SAAS,CAAA;AAAA,CAAA,EA3Bd,aAAA,CAqBH,SAAA,EAAA,WAAA,EAAA,CAAA,CAAA","file":"A-ServerProxy.component.mjs","sourcesContent":["import { A_Component, A_Concept, A_Feature, A_Inject } from \"@adaas/a-concept\";\nimport { A_HttpServerFeatures } from \"@adaas/a-server/server/A-HttpServer.constants\";\nimport { A_ProxyConfig } from \"./A-ServerProxy.context\";\nimport { A_Request } from \"@adaas/a-server/request/A-Request.entity\";\nimport { A_Response } from \"@adaas/a-server/response/A-Response.entity\";\nimport { A_ServerRoute } from \"@adaas/a-server/route/A-ServerRoute.entity\";\nimport { A_Logger, A_LOGGER_COLORS } from \"@adaas/a-utils/a-logger\";\nimport { A_Polyfill } from \"@adaas/a-utils/a-polyfill\";\n\n\nexport class A_ServerProxy extends A_Component {\n\n\n @A_Concept.Load()\n async load(\n @A_Inject(A_Logger) logger: A_Logger,\n @A_Inject(A_ProxyConfig) config: A_ProxyConfig\n ) {\n logger.info(\n 'green',\n `Proxy routes configured:`,\n ...config.configs.map(c => `${c.route.toString()} -> ${c.protocol}//${c.hostname}:${c.port}`)\n );\n }\n\n\n\n @A_Feature.Extend({\n name: A_HttpServerFeatures.onRequest,\n before:/.*/\n })\n async onRequest(\n @A_Inject(A_Request) req: A_Request,\n @A_Inject(A_Response) res: A_Response,\n @A_Inject(A_ProxyConfig) proxyConfig: A_ProxyConfig,\n @A_Inject(A_Logger) logger: A_Logger,\n @A_Inject(A_Polyfill) polyfill: A_Polyfill,\n @A_Inject(A_Feature) feature: A_Feature\n ) {\n return new Promise<void>(async (resolve, reject) => {\n const { method, url } = req;\n\n const route = new A_ServerRoute(url, method);\n const config = proxyConfig.config(route.toString());\n\n if (!config) {\n return resolve(); // nothing to proxy\n }\n\n logger.log(\n \"yellow\",\n `Proxying request ${method} ${url} to ${config.hostname}`,\n config\n );\n\n const client = await (config.protocol === \"https:\"\n ? polyfill.https()\n : polyfill.http());\n\n const proxyReq = client.request(\n {\n method: config.route.method,\n hostname: config.hostname,\n port: config.port,\n headers: config.headers,\n path: route.path,\n },\n (proxyRes) => {\n if (!res.headersSent) {\n res.writeHead(proxyRes.statusCode || 200, proxyRes.headers);\n }\n proxyRes.on(\"end\", () => {\n\n logger.log(\"green\", `Proxy request to ${config?.hostname} completed`);\n\n resolve();\n });\n\n proxyRes.pipe(res.original);\n }\n );\n\n proxyReq.on(\"error\", (err) => reject(err));\n\n req.pipe(proxyReq);\n\n feature.interrupt();\n });\n }\n\n}"]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { A_SERVER_TYPES__ProxyConfigConstructorConfig } from './A-ServerProxy.types.mjs';
|
|
2
|
+
import '../A-ServerRoute/A-ServerRoute.entity.mjs';
|
|
3
|
+
import '@adaas/a-utils/a-route';
|
|
4
|
+
import '../A-ServerRoute/A-ServerRoute.types.mjs';
|
|
5
|
+
import '../A-ServerRoute/A-ServerRoute.constants.mjs';
|
|
6
|
+
|
|
7
|
+
declare const PROXY_CONFIG_DEFAULTS: A_SERVER_TYPES__ProxyConfigConstructorConfig;
|
|
8
|
+
|
|
9
|
+
export { PROXY_CONFIG_DEFAULTS };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { A_SERVER_TYPES__ProxyConfigConstructorConfig } from './A-ServerProxy.types.js';
|
|
2
|
+
import '../A-ServerRoute/A-ServerRoute.entity.js';
|
|
3
|
+
import '@adaas/a-utils/a-route';
|
|
4
|
+
import '../A-ServerRoute/A-ServerRoute.types.js';
|
|
5
|
+
import '../A-ServerRoute/A-ServerRoute.constants.js';
|
|
6
|
+
|
|
7
|
+
declare const PROXY_CONFIG_DEFAULTS: A_SERVER_TYPES__ProxyConfigConstructorConfig;
|
|
8
|
+
|
|
9
|
+
export { PROXY_CONFIG_DEFAULTS };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const PROXY_CONFIG_DEFAULTS = {
|
|
4
|
+
path: "/",
|
|
5
|
+
hostname: "localhost",
|
|
6
|
+
port: 80,
|
|
7
|
+
method: "GET",
|
|
8
|
+
headers: {},
|
|
9
|
+
protocol: "http"
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
exports.PROXY_CONFIG_DEFAULTS = PROXY_CONFIG_DEFAULTS;
|
|
13
|
+
//# sourceMappingURL=A-ServerProxy.constants.js.map
|
|
14
|
+
//# sourceMappingURL=A-ServerProxy.constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/lib/A-ServerProxy/A-ServerProxy.constants.ts"],"names":[],"mappings":";;AAEO,MAAM,qBAAA,GAAsE;AAAA,EAC/E,IAAA,EAAM,GAAA;AAAA,EACN,QAAA,EAAU,WAAA;AAAA,EACV,IAAA,EAAM,EAAA;AAAA,EACN,MAAA,EAAQ,KAAA;AAAA,EACR,SAAS,EAAC;AAAA,EACV,QAAA,EAAU;AACd","file":"A-ServerProxy.constants.js","sourcesContent":["import { A_SERVER_TYPES__ProxyConfigConstructorConfig } from \"./A-ServerProxy.types\";\n\nexport const PROXY_CONFIG_DEFAULTS: A_SERVER_TYPES__ProxyConfigConstructorConfig = {\n path: '/',\n hostname: 'localhost',\n port: 80,\n method: 'GET',\n headers: {},\n protocol: 'http'\n};\n"]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import '../../chunk-EQQGB2QZ.mjs';
|
|
2
|
+
|
|
3
|
+
const PROXY_CONFIG_DEFAULTS = {
|
|
4
|
+
path: "/",
|
|
5
|
+
hostname: "localhost",
|
|
6
|
+
port: 80,
|
|
7
|
+
method: "GET",
|
|
8
|
+
headers: {},
|
|
9
|
+
protocol: "http"
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export { PROXY_CONFIG_DEFAULTS };
|
|
13
|
+
//# sourceMappingURL=A-ServerProxy.constants.mjs.map
|
|
14
|
+
//# sourceMappingURL=A-ServerProxy.constants.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/lib/A-ServerProxy/A-ServerProxy.constants.ts"],"names":[],"mappings":";;AAEO,MAAM,qBAAA,GAAsE;AAAA,EAC/E,IAAA,EAAM,GAAA;AAAA,EACN,QAAA,EAAU,WAAA;AAAA,EACV,IAAA,EAAM,EAAA;AAAA,EACN,MAAA,EAAQ,KAAA;AAAA,EACR,SAAS,EAAC;AAAA,EACV,QAAA,EAAU;AACd","file":"A-ServerProxy.constants.mjs","sourcesContent":["import { A_SERVER_TYPES__ProxyConfigConstructorConfig } from \"./A-ServerProxy.types\";\n\nexport const PROXY_CONFIG_DEFAULTS: A_SERVER_TYPES__ProxyConfigConstructorConfig = {\n path: '/',\n hostname: 'localhost',\n port: 80,\n method: 'GET',\n headers: {},\n protocol: 'http'\n};\n"]}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { A_Fragment } from '@adaas/a-concept';
|
|
2
|
+
import { A_SERVER_TYPES__RoutesConfig, A_SERVER_TYPES__ProxyConfigConstructor } from './A-ServerProxy.types.mjs';
|
|
3
|
+
import '../A-ServerRoute/A-ServerRoute.entity.mjs';
|
|
4
|
+
import '@adaas/a-utils/a-route';
|
|
5
|
+
import '../A-ServerRoute/A-ServerRoute.types.mjs';
|
|
6
|
+
import '../A-ServerRoute/A-ServerRoute.constants.mjs';
|
|
7
|
+
|
|
8
|
+
declare class A_ProxyConfig extends A_Fragment {
|
|
9
|
+
protected readonly _configs: Array<A_SERVER_TYPES__RoutesConfig>;
|
|
10
|
+
constructor(
|
|
11
|
+
/**
|
|
12
|
+
* Setup proxy configs, where key is the path to match, and value is either a full URL or a partial config object
|
|
13
|
+
*/
|
|
14
|
+
configs?: A_SERVER_TYPES__ProxyConfigConstructor);
|
|
15
|
+
/**
|
|
16
|
+
* Returns all configured proxy configs
|
|
17
|
+
*
|
|
18
|
+
*/
|
|
19
|
+
get configs(): Array<A_SERVER_TYPES__RoutesConfig>;
|
|
20
|
+
/**
|
|
21
|
+
* Checks if a given path is configured in the proxy
|
|
22
|
+
*
|
|
23
|
+
* @param path
|
|
24
|
+
* @returns
|
|
25
|
+
*/
|
|
26
|
+
has(path: string): boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Returns the proxy configuration for a given path, if exists
|
|
29
|
+
*
|
|
30
|
+
* @param path
|
|
31
|
+
* @returns
|
|
32
|
+
*/
|
|
33
|
+
config(path: string): A_SERVER_TYPES__RoutesConfig | undefined;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export { A_ProxyConfig };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { A_Fragment } from '@adaas/a-concept';
|
|
2
|
+
import { A_SERVER_TYPES__RoutesConfig, A_SERVER_TYPES__ProxyConfigConstructor } from './A-ServerProxy.types.js';
|
|
3
|
+
import '../A-ServerRoute/A-ServerRoute.entity.js';
|
|
4
|
+
import '@adaas/a-utils/a-route';
|
|
5
|
+
import '../A-ServerRoute/A-ServerRoute.types.js';
|
|
6
|
+
import '../A-ServerRoute/A-ServerRoute.constants.js';
|
|
7
|
+
|
|
8
|
+
declare class A_ProxyConfig extends A_Fragment {
|
|
9
|
+
protected readonly _configs: Array<A_SERVER_TYPES__RoutesConfig>;
|
|
10
|
+
constructor(
|
|
11
|
+
/**
|
|
12
|
+
* Setup proxy configs, where key is the path to match, and value is either a full URL or a partial config object
|
|
13
|
+
*/
|
|
14
|
+
configs?: A_SERVER_TYPES__ProxyConfigConstructor);
|
|
15
|
+
/**
|
|
16
|
+
* Returns all configured proxy configs
|
|
17
|
+
*
|
|
18
|
+
*/
|
|
19
|
+
get configs(): Array<A_SERVER_TYPES__RoutesConfig>;
|
|
20
|
+
/**
|
|
21
|
+
* Checks if a given path is configured in the proxy
|
|
22
|
+
*
|
|
23
|
+
* @param path
|
|
24
|
+
* @returns
|
|
25
|
+
*/
|
|
26
|
+
has(path: string): boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Returns the proxy configuration for a given path, if exists
|
|
29
|
+
*
|
|
30
|
+
* @param path
|
|
31
|
+
* @returns
|
|
32
|
+
*/
|
|
33
|
+
config(path: string): A_SERVER_TYPES__RoutesConfig | undefined;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export { A_ProxyConfig };
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var aConcept = require('@adaas/a-concept');
|
|
4
|
+
var AServerProxy_constants = require('./A-ServerProxy.constants');
|
|
5
|
+
var AServerRoute_entity = require('@adaas/a-server/route/A-ServerRoute.entity');
|
|
6
|
+
|
|
7
|
+
class A_ProxyConfig extends aConcept.A_Fragment {
|
|
8
|
+
constructor(configs = {}) {
|
|
9
|
+
super();
|
|
10
|
+
this._configs = Object.entries(configs).map(([path, config]) => {
|
|
11
|
+
const targetUrl = new URL(typeof config === "string" ? config : config.hostname || "");
|
|
12
|
+
const port = targetUrl.port || (targetUrl.protocol === "https:" ? "443" : "80");
|
|
13
|
+
const prepared = {
|
|
14
|
+
...AServerProxy_constants.PROXY_CONFIG_DEFAULTS,
|
|
15
|
+
...typeof config === "string" ? {
|
|
16
|
+
path,
|
|
17
|
+
port: parseInt(port),
|
|
18
|
+
protocol: targetUrl.protocol,
|
|
19
|
+
hostname: targetUrl.hostname
|
|
20
|
+
} : config
|
|
21
|
+
};
|
|
22
|
+
return {
|
|
23
|
+
route: new AServerRoute_entity.A_ServerRoute(prepared.path, prepared.method),
|
|
24
|
+
hostname: prepared.hostname,
|
|
25
|
+
port: prepared.port,
|
|
26
|
+
headers: prepared.headers,
|
|
27
|
+
protocol: prepared.protocol
|
|
28
|
+
};
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Returns all configured proxy configs
|
|
33
|
+
*
|
|
34
|
+
*/
|
|
35
|
+
get configs() {
|
|
36
|
+
return this._configs;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Checks if a given path is configured in the proxy
|
|
40
|
+
*
|
|
41
|
+
* @param path
|
|
42
|
+
* @returns
|
|
43
|
+
*/
|
|
44
|
+
has(path) {
|
|
45
|
+
return this._configs.some((route) => route.route.toRegExp().test(path));
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Returns the proxy configuration for a given path, if exists
|
|
49
|
+
*
|
|
50
|
+
* @param path
|
|
51
|
+
* @returns
|
|
52
|
+
*/
|
|
53
|
+
config(path) {
|
|
54
|
+
return this._configs.find((route) => route.route.toRegExp().test(path));
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
exports.A_ProxyConfig = A_ProxyConfig;
|
|
59
|
+
//# sourceMappingURL=A-ServerProxy.context.js.map
|
|
60
|
+
//# sourceMappingURL=A-ServerProxy.context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/lib/A-ServerProxy/A-ServerProxy.context.ts"],"names":["A_Fragment","PROXY_CONFIG_DEFAULTS","A_ServerRoute"],"mappings":";;;;;;AAOO,MAAM,sBAAsBA,mBAAA,CAAW;AAAA,EAI1C,WAAA,CAII,OAAA,GAAkD,EAAC,EACrD;AACE,IAAA,KAAA,EAAM;AAEN,IAAA,IAAA,CAAK,QAAA,GAAW,MAAA,CAAO,OAAA,CAAQ,OAAO,CAAA,CAAE,IAAI,CAAC,CAAC,IAAA,EAAM,MAAM,CAAA,KAAM;AAE5D,MAAA,MAAM,SAAA,GAAY,IAAI,GAAA,CAAI,OAAO,WAAW,QAAA,GAAW,MAAA,GAAS,MAAA,CAAO,QAAA,IAAY,EAAE,CAAA;AAErF,MAAA,MAAM,OACF,SAAA,CAAU,IAAA,KACT,SAAA,CAAU,QAAA,KAAa,WAAW,KAAA,GAAQ,IAAA,CAAA;AAG/C,MAAA,MAAM,QAAA,GAAW;AAAA,QACb,GAAGC,4CAAA;AAAA,QACH,GAAI,OAAO,MAAA,KAAW,QAAA,GAAW;AAAA,UAC7B,IAAA;AAAA,UACA,IAAA,EAAM,SAAS,IAAI,CAAA;AAAA,UACnB,UAAU,SAAA,CAAU,QAAA;AAAA,UACpB,UAAU,SAAA,CAAU;AAAA,SACxB,GAAI;AAAA,OACR;AAEA,MAAA,OAAO;AAAA,QACH,OAAO,IAAIC,iCAAA,CAAc,QAAA,CAAS,IAAA,EAAM,SAAS,MAAM,CAAA;AAAA,QACvD,UAAU,QAAA,CAAS,QAAA;AAAA,QACnB,MAAM,QAAA,CAAS,IAAA;AAAA,QACf,SAAS,QAAA,CAAS,OAAA;AAAA,QAClB,UAAU,QAAA,CAAS;AAAA,OACvB;AAAA,IACJ,CAAC,CAAA;AAAA,EACL;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,IAAI,OAAA,GAA+C;AAC/C,IAAA,OAAO,IAAA,CAAK,QAAA;AAAA,EAChB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASA,IAAI,IAAA,EAAuB;AACvB,IAAA,OAAO,IAAA,CAAK,QAAA,CAAS,IAAA,CAAK,CAAA,KAAA,KAAS,KAAA,CAAM,MAAM,QAAA,EAAS,CAAE,IAAA,CAAK,IAAI,CAAC,CAAA;AAAA,EACxE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQA,OAAO,IAAA,EAAwD;AAG3D,IAAA,OAAO,IAAA,CAAK,QAAA,CAAS,IAAA,CAAK,CAAA,KAAA,KAAS,KAAA,CAAM,MAAM,QAAA,EAAS,CAAE,IAAA,CAAK,IAAI,CAAC,CAAA;AAAA,EACxE;AACJ","file":"A-ServerProxy.context.js","sourcesContent":["import { A_Fragment } from \"@adaas/a-concept\";\nimport { A_SERVER_TYPES__ProxyConfigConstructor, A_SERVER_TYPES__ProxyConfigConstructorConfig, A_SERVER_TYPES__RoutesConfig } from \"./A-ServerProxy.types\";\nimport { PROXY_CONFIG_DEFAULTS } from \"./A-ServerProxy.constants\";\nimport { A_ServerRoute } from \"@adaas/a-server/route/A-ServerRoute.entity\";\n\n\n\nexport class A_ProxyConfig extends A_Fragment {\n\n protected readonly _configs: Array<A_SERVER_TYPES__RoutesConfig>\n\n constructor(\n /**\n * Setup proxy configs, where key is the path to match, and value is either a full URL or a partial config object\n */\n configs: A_SERVER_TYPES__ProxyConfigConstructor = {}\n ) {\n super();\n\n this._configs = Object.entries(configs).map(([path, config]) => {\n\n const targetUrl = new URL(typeof config === 'string' ? config : config.hostname || ''); // parse hostname, may include scheme\n\n const port =\n targetUrl.port ||\n (targetUrl.protocol === \"https:\" ? '443' : '80');\n\n\n const prepared = {\n ...PROXY_CONFIG_DEFAULTS,\n ...(typeof config === 'string' ? {\n path,\n port: parseInt(port),\n protocol: targetUrl.protocol,\n hostname: targetUrl.hostname\n } : config)\n }\n\n return {\n route: new A_ServerRoute(prepared.path, prepared.method),\n hostname: prepared.hostname,\n port: prepared.port,\n headers: prepared.headers,\n protocol: prepared.protocol\n }\n });\n }\n\n /**\n * Returns all configured proxy configs\n * \n */\n get configs(): Array<A_SERVER_TYPES__RoutesConfig> {\n return this._configs;\n }\n\n\n /**\n * Checks if a given path is configured in the proxy\n * \n * @param path \n * @returns \n */\n has(path: string): boolean {\n return this._configs.some(route => route.route.toRegExp().test(path));\n }\n\n /**\n * Returns the proxy configuration for a given path, if exists\n *\n * @param path \n * @returns \n */\n config(path: string): A_SERVER_TYPES__RoutesConfig | undefined {\n \n\n return this._configs.find(route => route.route.toRegExp().test(path));\n }\n}"]}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import '../../chunk-EQQGB2QZ.mjs';
|
|
2
|
+
import { A_Fragment } from '@adaas/a-concept';
|
|
3
|
+
import { PROXY_CONFIG_DEFAULTS } from './A-ServerProxy.constants';
|
|
4
|
+
import { A_ServerRoute } from '@adaas/a-server/route/A-ServerRoute.entity';
|
|
5
|
+
|
|
6
|
+
class A_ProxyConfig extends A_Fragment {
|
|
7
|
+
constructor(configs = {}) {
|
|
8
|
+
super();
|
|
9
|
+
this._configs = Object.entries(configs).map(([path, config]) => {
|
|
10
|
+
const targetUrl = new URL(typeof config === "string" ? config : config.hostname || "");
|
|
11
|
+
const port = targetUrl.port || (targetUrl.protocol === "https:" ? "443" : "80");
|
|
12
|
+
const prepared = {
|
|
13
|
+
...PROXY_CONFIG_DEFAULTS,
|
|
14
|
+
...typeof config === "string" ? {
|
|
15
|
+
path,
|
|
16
|
+
port: parseInt(port),
|
|
17
|
+
protocol: targetUrl.protocol,
|
|
18
|
+
hostname: targetUrl.hostname
|
|
19
|
+
} : config
|
|
20
|
+
};
|
|
21
|
+
return {
|
|
22
|
+
route: new A_ServerRoute(prepared.path, prepared.method),
|
|
23
|
+
hostname: prepared.hostname,
|
|
24
|
+
port: prepared.port,
|
|
25
|
+
headers: prepared.headers,
|
|
26
|
+
protocol: prepared.protocol
|
|
27
|
+
};
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Returns all configured proxy configs
|
|
32
|
+
*
|
|
33
|
+
*/
|
|
34
|
+
get configs() {
|
|
35
|
+
return this._configs;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Checks if a given path is configured in the proxy
|
|
39
|
+
*
|
|
40
|
+
* @param path
|
|
41
|
+
* @returns
|
|
42
|
+
*/
|
|
43
|
+
has(path) {
|
|
44
|
+
return this._configs.some((route) => route.route.toRegExp().test(path));
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Returns the proxy configuration for a given path, if exists
|
|
48
|
+
*
|
|
49
|
+
* @param path
|
|
50
|
+
* @returns
|
|
51
|
+
*/
|
|
52
|
+
config(path) {
|
|
53
|
+
return this._configs.find((route) => route.route.toRegExp().test(path));
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export { A_ProxyConfig };
|
|
58
|
+
//# sourceMappingURL=A-ServerProxy.context.mjs.map
|
|
59
|
+
//# sourceMappingURL=A-ServerProxy.context.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/lib/A-ServerProxy/A-ServerProxy.context.ts"],"names":[],"mappings":";;;;;AAOO,MAAM,sBAAsB,UAAA,CAAW;AAAA,EAI1C,WAAA,CAII,OAAA,GAAkD,EAAC,EACrD;AACE,IAAA,KAAA,EAAM;AAEN,IAAA,IAAA,CAAK,QAAA,GAAW,MAAA,CAAO,OAAA,CAAQ,OAAO,CAAA,CAAE,IAAI,CAAC,CAAC,IAAA,EAAM,MAAM,CAAA,KAAM;AAE5D,MAAA,MAAM,SAAA,GAAY,IAAI,GAAA,CAAI,OAAO,WAAW,QAAA,GAAW,MAAA,GAAS,MAAA,CAAO,QAAA,IAAY,EAAE,CAAA;AAErF,MAAA,MAAM,OACF,SAAA,CAAU,IAAA,KACT,SAAA,CAAU,QAAA,KAAa,WAAW,KAAA,GAAQ,IAAA,CAAA;AAG/C,MAAA,MAAM,QAAA,GAAW;AAAA,QACb,GAAG,qBAAA;AAAA,QACH,GAAI,OAAO,MAAA,KAAW,QAAA,GAAW;AAAA,UAC7B,IAAA;AAAA,UACA,IAAA,EAAM,SAAS,IAAI,CAAA;AAAA,UACnB,UAAU,SAAA,CAAU,QAAA;AAAA,UACpB,UAAU,SAAA,CAAU;AAAA,SACxB,GAAI;AAAA,OACR;AAEA,MAAA,OAAO;AAAA,QACH,OAAO,IAAI,aAAA,CAAc,QAAA,CAAS,IAAA,EAAM,SAAS,MAAM,CAAA;AAAA,QACvD,UAAU,QAAA,CAAS,QAAA;AAAA,QACnB,MAAM,QAAA,CAAS,IAAA;AAAA,QACf,SAAS,QAAA,CAAS,OAAA;AAAA,QAClB,UAAU,QAAA,CAAS;AAAA,OACvB;AAAA,IACJ,CAAC,CAAA;AAAA,EACL;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,IAAI,OAAA,GAA+C;AAC/C,IAAA,OAAO,IAAA,CAAK,QAAA;AAAA,EAChB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASA,IAAI,IAAA,EAAuB;AACvB,IAAA,OAAO,IAAA,CAAK,QAAA,CAAS,IAAA,CAAK,CAAA,KAAA,KAAS,KAAA,CAAM,MAAM,QAAA,EAAS,CAAE,IAAA,CAAK,IAAI,CAAC,CAAA;AAAA,EACxE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQA,OAAO,IAAA,EAAwD;AAG3D,IAAA,OAAO,IAAA,CAAK,QAAA,CAAS,IAAA,CAAK,CAAA,KAAA,KAAS,KAAA,CAAM,MAAM,QAAA,EAAS,CAAE,IAAA,CAAK,IAAI,CAAC,CAAA;AAAA,EACxE;AACJ","file":"A-ServerProxy.context.mjs","sourcesContent":["import { A_Fragment } from \"@adaas/a-concept\";\nimport { A_SERVER_TYPES__ProxyConfigConstructor, A_SERVER_TYPES__ProxyConfigConstructorConfig, A_SERVER_TYPES__RoutesConfig } from \"./A-ServerProxy.types\";\nimport { PROXY_CONFIG_DEFAULTS } from \"./A-ServerProxy.constants\";\nimport { A_ServerRoute } from \"@adaas/a-server/route/A-ServerRoute.entity\";\n\n\n\nexport class A_ProxyConfig extends A_Fragment {\n\n protected readonly _configs: Array<A_SERVER_TYPES__RoutesConfig>\n\n constructor(\n /**\n * Setup proxy configs, where key is the path to match, and value is either a full URL or a partial config object\n */\n configs: A_SERVER_TYPES__ProxyConfigConstructor = {}\n ) {\n super();\n\n this._configs = Object.entries(configs).map(([path, config]) => {\n\n const targetUrl = new URL(typeof config === 'string' ? config : config.hostname || ''); // parse hostname, may include scheme\n\n const port =\n targetUrl.port ||\n (targetUrl.protocol === \"https:\" ? '443' : '80');\n\n\n const prepared = {\n ...PROXY_CONFIG_DEFAULTS,\n ...(typeof config === 'string' ? {\n path,\n port: parseInt(port),\n protocol: targetUrl.protocol,\n hostname: targetUrl.hostname\n } : config)\n }\n\n return {\n route: new A_ServerRoute(prepared.path, prepared.method),\n hostname: prepared.hostname,\n port: prepared.port,\n headers: prepared.headers,\n protocol: prepared.protocol\n }\n });\n }\n\n /**\n * Returns all configured proxy configs\n * \n */\n get configs(): Array<A_SERVER_TYPES__RoutesConfig> {\n return this._configs;\n }\n\n\n /**\n * Checks if a given path is configured in the proxy\n * \n * @param path \n * @returns \n */\n has(path: string): boolean {\n return this._configs.some(route => route.route.toRegExp().test(path));\n }\n\n /**\n * Returns the proxy configuration for a given path, if exists\n *\n * @param path \n * @returns \n */\n config(path: string): A_SERVER_TYPES__RoutesConfig | undefined {\n \n\n return this._configs.find(route => route.route.toRegExp().test(path));\n }\n}"]}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { A_ServerRoute } from '../A-ServerRoute/A-ServerRoute.entity.mjs';
|
|
2
|
+
import { A_ServerRouteHttpMethodNames } from '../A-ServerRoute/A-ServerRoute.types.mjs';
|
|
3
|
+
import '@adaas/a-utils/a-route';
|
|
4
|
+
import '../A-ServerRoute/A-ServerRoute.constants.mjs';
|
|
5
|
+
|
|
6
|
+
type A_SERVER_TYPES__ProxyConfigConstructor = Record<string, string | Partial<A_SERVER_TYPES__ProxyConfigConstructorConfig>>;
|
|
7
|
+
type A_SERVER_TYPES__ProxyConfigConstructorConfig = {
|
|
8
|
+
hostname: string;
|
|
9
|
+
protocol: 'http' | 'https' | string;
|
|
10
|
+
port: number;
|
|
11
|
+
path: string;
|
|
12
|
+
method: A_ServerRouteHttpMethodNames;
|
|
13
|
+
headers: Record<string, string>;
|
|
14
|
+
};
|
|
15
|
+
type A_SERVER_TYPES__RoutesConfig = {
|
|
16
|
+
route: A_ServerRoute;
|
|
17
|
+
protocol: 'http' | 'https' | string;
|
|
18
|
+
hostname: string;
|
|
19
|
+
port: number;
|
|
20
|
+
headers: Record<string, string>;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export type { A_SERVER_TYPES__ProxyConfigConstructor, A_SERVER_TYPES__ProxyConfigConstructorConfig, A_SERVER_TYPES__RoutesConfig };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { A_ServerRoute } from '../A-ServerRoute/A-ServerRoute.entity.js';
|
|
2
|
+
import { A_ServerRouteHttpMethodNames } from '../A-ServerRoute/A-ServerRoute.types.js';
|
|
3
|
+
import '@adaas/a-utils/a-route';
|
|
4
|
+
import '../A-ServerRoute/A-ServerRoute.constants.js';
|
|
5
|
+
|
|
6
|
+
type A_SERVER_TYPES__ProxyConfigConstructor = Record<string, string | Partial<A_SERVER_TYPES__ProxyConfigConstructorConfig>>;
|
|
7
|
+
type A_SERVER_TYPES__ProxyConfigConstructorConfig = {
|
|
8
|
+
hostname: string;
|
|
9
|
+
protocol: 'http' | 'https' | string;
|
|
10
|
+
port: number;
|
|
11
|
+
path: string;
|
|
12
|
+
method: A_ServerRouteHttpMethodNames;
|
|
13
|
+
headers: Record<string, string>;
|
|
14
|
+
};
|
|
15
|
+
type A_SERVER_TYPES__RoutesConfig = {
|
|
16
|
+
route: A_ServerRoute;
|
|
17
|
+
protocol: 'http' | 'https' | string;
|
|
18
|
+
hostname: string;
|
|
19
|
+
port: number;
|
|
20
|
+
headers: Record<string, string>;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export type { A_SERVER_TYPES__ProxyConfigConstructor, A_SERVER_TYPES__ProxyConfigConstructorConfig, A_SERVER_TYPES__RoutesConfig };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"A-ServerProxy.types.js"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"A-ServerProxy.types.mjs"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
declare const A_ServerRouteHttpMethods: {
|
|
2
|
+
readonly DEFAULT: "DEFAULT";
|
|
3
|
+
readonly GET: "GET";
|
|
4
|
+
readonly POST: "POST";
|
|
5
|
+
readonly PUT: "PUT";
|
|
6
|
+
readonly DELETE: "DELETE";
|
|
7
|
+
readonly PATCH: "PATCH";
|
|
8
|
+
readonly OPTIONS: "OPTIONS";
|
|
9
|
+
readonly HEAD: "HEAD";
|
|
10
|
+
readonly CONNECT: "CONNECT";
|
|
11
|
+
readonly TRACE: "TRACE";
|
|
12
|
+
};
|
|
13
|
+
declare const A_ServerRouteProtocols: {
|
|
14
|
+
readonly HTTP: "http";
|
|
15
|
+
readonly HTTPS: "https";
|
|
16
|
+
readonly WS: "ws";
|
|
17
|
+
readonly WSS: "wss";
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export { A_ServerRouteHttpMethods, A_ServerRouteProtocols };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
declare const A_ServerRouteHttpMethods: {
|
|
2
|
+
readonly DEFAULT: "DEFAULT";
|
|
3
|
+
readonly GET: "GET";
|
|
4
|
+
readonly POST: "POST";
|
|
5
|
+
readonly PUT: "PUT";
|
|
6
|
+
readonly DELETE: "DELETE";
|
|
7
|
+
readonly PATCH: "PATCH";
|
|
8
|
+
readonly OPTIONS: "OPTIONS";
|
|
9
|
+
readonly HEAD: "HEAD";
|
|
10
|
+
readonly CONNECT: "CONNECT";
|
|
11
|
+
readonly TRACE: "TRACE";
|
|
12
|
+
};
|
|
13
|
+
declare const A_ServerRouteProtocols: {
|
|
14
|
+
readonly HTTP: "http";
|
|
15
|
+
readonly HTTPS: "https";
|
|
16
|
+
readonly WS: "ws";
|
|
17
|
+
readonly WSS: "wss";
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export { A_ServerRouteHttpMethods, A_ServerRouteProtocols };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const A_ServerRouteHttpMethods = {
|
|
4
|
+
DEFAULT: "DEFAULT",
|
|
5
|
+
GET: "GET",
|
|
6
|
+
POST: "POST",
|
|
7
|
+
PUT: "PUT",
|
|
8
|
+
DELETE: "DELETE",
|
|
9
|
+
PATCH: "PATCH",
|
|
10
|
+
OPTIONS: "OPTIONS",
|
|
11
|
+
HEAD: "HEAD",
|
|
12
|
+
CONNECT: "CONNECT",
|
|
13
|
+
TRACE: "TRACE"
|
|
14
|
+
};
|
|
15
|
+
const A_ServerRouteProtocols = {
|
|
16
|
+
HTTP: "http",
|
|
17
|
+
HTTPS: "https",
|
|
18
|
+
WS: "ws",
|
|
19
|
+
WSS: "wss"
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
exports.A_ServerRouteHttpMethods = A_ServerRouteHttpMethods;
|
|
23
|
+
exports.A_ServerRouteProtocols = A_ServerRouteProtocols;
|
|
24
|
+
//# sourceMappingURL=A-ServerRoute.constants.js.map
|
|
25
|
+
//# sourceMappingURL=A-ServerRoute.constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/lib/A-ServerRoute/A-ServerRoute.constants.ts"],"names":[],"mappings":";;AAAO,MAAM,wBAAA,GAA2B;AAAA,EACpC,OAAA,EAAS,SAAA;AAAA,EACT,GAAA,EAAK,KAAA;AAAA,EACL,IAAA,EAAM,MAAA;AAAA,EACN,GAAA,EAAK,KAAA;AAAA,EACL,MAAA,EAAQ,QAAA;AAAA,EACR,KAAA,EAAO,OAAA;AAAA,EACP,OAAA,EAAS,SAAA;AAAA,EACT,IAAA,EAAM,MAAA;AAAA,EACN,OAAA,EAAS,SAAA;AAAA,EACT,KAAA,EAAO;AACX;AAGO,MAAM,sBAAA,GAAyB;AAAA,EAClC,IAAA,EAAM,MAAA;AAAA,EACN,KAAA,EAAO,OAAA;AAAA,EACP,EAAA,EAAI,IAAA;AAAA,EACJ,GAAA,EAAK;AACT","file":"A-ServerRoute.constants.js","sourcesContent":["export const A_ServerRouteHttpMethods = {\n DEFAULT: 'DEFAULT',\n GET: 'GET',\n POST: 'POST',\n PUT: 'PUT',\n DELETE: 'DELETE',\n PATCH: 'PATCH',\n OPTIONS: 'OPTIONS',\n HEAD: 'HEAD',\n CONNECT: 'CONNECT',\n TRACE: 'TRACE',\n} as const\n\n\nexport const A_ServerRouteProtocols = {\n HTTP: 'http',\n HTTPS: 'https',\n WS: 'ws',\n WSS: 'wss',\n} as const"]}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import '../../chunk-EQQGB2QZ.mjs';
|
|
2
|
+
|
|
3
|
+
const A_ServerRouteHttpMethods = {
|
|
4
|
+
DEFAULT: "DEFAULT",
|
|
5
|
+
GET: "GET",
|
|
6
|
+
POST: "POST",
|
|
7
|
+
PUT: "PUT",
|
|
8
|
+
DELETE: "DELETE",
|
|
9
|
+
PATCH: "PATCH",
|
|
10
|
+
OPTIONS: "OPTIONS",
|
|
11
|
+
HEAD: "HEAD",
|
|
12
|
+
CONNECT: "CONNECT",
|
|
13
|
+
TRACE: "TRACE"
|
|
14
|
+
};
|
|
15
|
+
const A_ServerRouteProtocols = {
|
|
16
|
+
HTTP: "http",
|
|
17
|
+
HTTPS: "https",
|
|
18
|
+
WS: "ws",
|
|
19
|
+
WSS: "wss"
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export { A_ServerRouteHttpMethods, A_ServerRouteProtocols };
|
|
23
|
+
//# sourceMappingURL=A-ServerRoute.constants.mjs.map
|
|
24
|
+
//# sourceMappingURL=A-ServerRoute.constants.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/lib/A-ServerRoute/A-ServerRoute.constants.ts"],"names":[],"mappings":";;AAAO,MAAM,wBAAA,GAA2B;AAAA,EACpC,OAAA,EAAS,SAAA;AAAA,EACT,GAAA,EAAK,KAAA;AAAA,EACL,IAAA,EAAM,MAAA;AAAA,EACN,GAAA,EAAK,KAAA;AAAA,EACL,MAAA,EAAQ,QAAA;AAAA,EACR,KAAA,EAAO,OAAA;AAAA,EACP,OAAA,EAAS,SAAA;AAAA,EACT,IAAA,EAAM,MAAA;AAAA,EACN,OAAA,EAAS,SAAA;AAAA,EACT,KAAA,EAAO;AACX;AAGO,MAAM,sBAAA,GAAyB;AAAA,EAClC,IAAA,EAAM,MAAA;AAAA,EACN,KAAA,EAAO,OAAA;AAAA,EACP,EAAA,EAAI,IAAA;AAAA,EACJ,GAAA,EAAK;AACT","file":"A-ServerRoute.constants.mjs","sourcesContent":["export const A_ServerRouteHttpMethods = {\n DEFAULT: 'DEFAULT',\n GET: 'GET',\n POST: 'POST',\n PUT: 'PUT',\n DELETE: 'DELETE',\n PATCH: 'PATCH',\n OPTIONS: 'OPTIONS',\n HEAD: 'HEAD',\n CONNECT: 'CONNECT',\n TRACE: 'TRACE',\n} as const\n\n\nexport const A_ServerRouteProtocols = {\n HTTP: 'http',\n HTTPS: 'https',\n WS: 'ws',\n WSS: 'wss',\n} as const"]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { A_Route } from '@adaas/a-utils/a-route';
|
|
2
|
+
import { A_ServerRouteHttpMethodNames } from './A-ServerRoute.types.mjs';
|
|
3
|
+
import './A-ServerRoute.constants.mjs';
|
|
4
|
+
|
|
5
|
+
declare class A_ServerRoute extends A_Route {
|
|
6
|
+
url: string;
|
|
7
|
+
method: A_ServerRouteHttpMethodNames;
|
|
8
|
+
constructor(url: string | RegExp, method: A_ServerRouteHttpMethodNames);
|
|
9
|
+
constructor(url: string | RegExp);
|
|
10
|
+
toString(): string;
|
|
11
|
+
toRegExp(): RegExp;
|
|
12
|
+
toAFeatureExtension(extensionScope?: Array<string>): RegExp;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export { A_ServerRoute };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { A_Route } from '@adaas/a-utils/a-route';
|
|
2
|
+
import { A_ServerRouteHttpMethodNames } from './A-ServerRoute.types.js';
|
|
3
|
+
import './A-ServerRoute.constants.js';
|
|
4
|
+
|
|
5
|
+
declare class A_ServerRoute extends A_Route {
|
|
6
|
+
url: string;
|
|
7
|
+
method: A_ServerRouteHttpMethodNames;
|
|
8
|
+
constructor(url: string | RegExp, method: A_ServerRouteHttpMethodNames);
|
|
9
|
+
constructor(url: string | RegExp);
|
|
10
|
+
toString(): string;
|
|
11
|
+
toRegExp(): RegExp;
|
|
12
|
+
toAFeatureExtension(extensionScope?: Array<string>): RegExp;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export { A_ServerRoute };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var aRoute = require('@adaas/a-utils/a-route');
|
|
4
|
+
|
|
5
|
+
class A_ServerRoute extends aRoute.A_Route {
|
|
6
|
+
constructor(param1, param2) {
|
|
7
|
+
super(param1);
|
|
8
|
+
this.url = param1 instanceof RegExp ? param1.source : param1;
|
|
9
|
+
this.method = param2 || "GET";
|
|
10
|
+
}
|
|
11
|
+
toString() {
|
|
12
|
+
return `${this.method}::${this.path}`;
|
|
13
|
+
}
|
|
14
|
+
toRegExp() {
|
|
15
|
+
return new RegExp(`^${this.method}::${this.path.replace(/\/:([^\/]+)/g, "/([^/]+)")}$`);
|
|
16
|
+
}
|
|
17
|
+
toAFeatureExtension(extensionScope = []) {
|
|
18
|
+
return new RegExp(`^${extensionScope.length ? `(${extensionScope.join("|")})` : ".*"}\\.${this.method}::${this.path.replace(/\/:([^\/]+)/g, "/([^/]+)")}$`);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
exports.A_ServerRoute = A_ServerRoute;
|
|
23
|
+
//# sourceMappingURL=A-ServerRoute.entity.js.map
|
|
24
|
+
//# sourceMappingURL=A-ServerRoute.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/lib/A-ServerRoute/A-ServerRoute.entity.ts"],"names":["A_Route"],"mappings":";;;;AAKO,MAAM,sBAAsBA,cAAA,CAAQ;AAAA,EAavC,WAAA,CACI,QACA,MAAA,EACF;AACE,IAAA,KAAA,CAAM,MAAM,CAAA;AACZ,IAAA,IAAA,CAAK,GAAA,GAAM,MAAA,YAAkB,MAAA,GAAS,MAAA,CAAO,MAAA,GAAS,MAAA;AACtD,IAAA,IAAA,CAAK,SAAS,MAAA,IAAU,KAAA;AAAA,EAC5B;AAAA,EAGA,QAAA,GAAmB;AAGf,IAAA,OAAO,CAAA,EAAG,IAAA,CAAK,MAAM,CAAA,EAAA,EAAK,KAAK,IAAI,CAAA,CAAA;AAAA,EAGvC;AAAA,EAEA,QAAA,GAAmB;AACf,IAAA,OAAO,IAAI,MAAA,CAAO,CAAA,CAAA,EAAI,IAAA,CAAK,MAAM,CAAA,EAAA,EAAK,IAAA,CAAK,IAAA,CAAK,OAAA,CAAQ,cAAA,EAAgB,UAAU,CAAC,CAAA,CAAA,CAAG,CAAA;AAAA,EAC1F;AAAA,EAEA,mBAAA,CAAoB,cAAA,GAAgC,EAAC,EAAW;AAC5D,IAAA,OAAO,IAAI,OAAO,CAAA,CAAA,EAAI,cAAA,CAAe,SAC/B,CAAA,CAAA,EAAI,cAAA,CAAe,IAAA,CAAK,GAAG,CAAC,CAAA,CAAA,CAAA,GAC5B,IACF,CAAA,GAAA,EAAM,IAAA,CAAK,MAAM,CAAA,EAAA,EAAK,IAAA,CAAK,KAAK,OAAA,CAAQ,cAAA,EAAgB,UAAU,CAAC,CAAA,CAAA,CAAG,CAAA;AAAA,EAC9E;AACJ","file":"A-ServerRoute.entity.js","sourcesContent":["import { A_Route } from '@adaas/a-utils/a-route';\nimport { A_ServerRouteHttpMethodNames } from './A-ServerRoute.types';\n\n\n\nexport class A_ServerRoute extends A_Route {\n\n public url!: string;\n public method!: A_ServerRouteHttpMethodNames;\n\n\n constructor(\n url: string | RegExp,\n method: A_ServerRouteHttpMethodNames\n )\n constructor(\n url: string | RegExp,\n )\n constructor(\n param1: string | RegExp,\n param2?: A_ServerRouteHttpMethodNames\n ) {\n super(param1);\n this.url = param1 instanceof RegExp ? param1.source : param1;\n this.method = param2 || 'GET';\n }\n\n\n toString(): string {\n // path can be like /api/v1/users/:id\n // and because of that :id we need to replace it with regex that matches chars and numbers only \n return `${this.method}::${this.path}`;\n\n // .replace(/\\/:([^\\/]+)/g, '\\\\/([^\\/]+)')\n }\n\n toRegExp(): RegExp {\n return new RegExp(`^${this.method}::${this.path.replace(/\\/:([^\\/]+)/g, '/([^/]+)')}$`);\n }\n\n toAFeatureExtension(extensionScope: Array<string> = []): RegExp {\n return new RegExp(`^${extensionScope.length\n ? `(${extensionScope.join('|')})`\n : '.*'\n }\\\\.${this.method}::${this.path.replace(/\\/:([^\\/]+)/g, '/([^/]+)')}$`);\n }\n}\n\n"]}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import '../../chunk-EQQGB2QZ.mjs';
|
|
2
|
+
import { A_Route } from '@adaas/a-utils/a-route';
|
|
3
|
+
|
|
4
|
+
class A_ServerRoute extends A_Route {
|
|
5
|
+
constructor(param1, param2) {
|
|
6
|
+
super(param1);
|
|
7
|
+
this.url = param1 instanceof RegExp ? param1.source : param1;
|
|
8
|
+
this.method = param2 || "GET";
|
|
9
|
+
}
|
|
10
|
+
toString() {
|
|
11
|
+
return `${this.method}::${this.path}`;
|
|
12
|
+
}
|
|
13
|
+
toRegExp() {
|
|
14
|
+
return new RegExp(`^${this.method}::${this.path.replace(/\/:([^\/]+)/g, "/([^/]+)")}$`);
|
|
15
|
+
}
|
|
16
|
+
toAFeatureExtension(extensionScope = []) {
|
|
17
|
+
return new RegExp(`^${extensionScope.length ? `(${extensionScope.join("|")})` : ".*"}\\.${this.method}::${this.path.replace(/\/:([^\/]+)/g, "/([^/]+)")}$`);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export { A_ServerRoute };
|
|
22
|
+
//# sourceMappingURL=A-ServerRoute.entity.mjs.map
|
|
23
|
+
//# sourceMappingURL=A-ServerRoute.entity.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/lib/A-ServerRoute/A-ServerRoute.entity.ts"],"names":[],"mappings":";;;AAKO,MAAM,sBAAsB,OAAA,CAAQ;AAAA,EAavC,WAAA,CACI,QACA,MAAA,EACF;AACE,IAAA,KAAA,CAAM,MAAM,CAAA;AACZ,IAAA,IAAA,CAAK,GAAA,GAAM,MAAA,YAAkB,MAAA,GAAS,MAAA,CAAO,MAAA,GAAS,MAAA;AACtD,IAAA,IAAA,CAAK,SAAS,MAAA,IAAU,KAAA;AAAA,EAC5B;AAAA,EAGA,QAAA,GAAmB;AAGf,IAAA,OAAO,CAAA,EAAG,IAAA,CAAK,MAAM,CAAA,EAAA,EAAK,KAAK,IAAI,CAAA,CAAA;AAAA,EAGvC;AAAA,EAEA,QAAA,GAAmB;AACf,IAAA,OAAO,IAAI,MAAA,CAAO,CAAA,CAAA,EAAI,IAAA,CAAK,MAAM,CAAA,EAAA,EAAK,IAAA,CAAK,IAAA,CAAK,OAAA,CAAQ,cAAA,EAAgB,UAAU,CAAC,CAAA,CAAA,CAAG,CAAA;AAAA,EAC1F;AAAA,EAEA,mBAAA,CAAoB,cAAA,GAAgC,EAAC,EAAW;AAC5D,IAAA,OAAO,IAAI,OAAO,CAAA,CAAA,EAAI,cAAA,CAAe,SAC/B,CAAA,CAAA,EAAI,cAAA,CAAe,IAAA,CAAK,GAAG,CAAC,CAAA,CAAA,CAAA,GAC5B,IACF,CAAA,GAAA,EAAM,IAAA,CAAK,MAAM,CAAA,EAAA,EAAK,IAAA,CAAK,KAAK,OAAA,CAAQ,cAAA,EAAgB,UAAU,CAAC,CAAA,CAAA,CAAG,CAAA;AAAA,EAC9E;AACJ","file":"A-ServerRoute.entity.mjs","sourcesContent":["import { A_Route } from '@adaas/a-utils/a-route';\nimport { A_ServerRouteHttpMethodNames } from './A-ServerRoute.types';\n\n\n\nexport class A_ServerRoute extends A_Route {\n\n public url!: string;\n public method!: A_ServerRouteHttpMethodNames;\n\n\n constructor(\n url: string | RegExp,\n method: A_ServerRouteHttpMethodNames\n )\n constructor(\n url: string | RegExp,\n )\n constructor(\n param1: string | RegExp,\n param2?: A_ServerRouteHttpMethodNames\n ) {\n super(param1);\n this.url = param1 instanceof RegExp ? param1.source : param1;\n this.method = param2 || 'GET';\n }\n\n\n toString(): string {\n // path can be like /api/v1/users/:id\n // and because of that :id we need to replace it with regex that matches chars and numbers only \n return `${this.method}::${this.path}`;\n\n // .replace(/\\/:([^\\/]+)/g, '\\\\/([^\\/]+)')\n }\n\n toRegExp(): RegExp {\n return new RegExp(`^${this.method}::${this.path.replace(/\\/:([^\\/]+)/g, '/([^/]+)')}$`);\n }\n\n toAFeatureExtension(extensionScope: Array<string> = []): RegExp {\n return new RegExp(`^${extensionScope.length\n ? `(${extensionScope.join('|')})`\n : '.*'\n }\\\\.${this.method}::${this.path.replace(/\\/:([^\\/]+)/g, '/([^/]+)')}$`);\n }\n}\n\n"]}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { A_ServerRouteHttpMethods, A_ServerRouteProtocols } from './A-ServerRoute.constants.mjs';
|
|
2
|
+
|
|
3
|
+
type A_serverRouteProtocolNames = typeof A_ServerRouteProtocols[keyof typeof A_ServerRouteProtocols];
|
|
4
|
+
type A_ServerRouteHttpMethodNames = typeof A_ServerRouteHttpMethods[keyof typeof A_ServerRouteHttpMethods];
|
|
5
|
+
|
|
6
|
+
export type { A_ServerRouteHttpMethodNames, A_serverRouteProtocolNames };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { A_ServerRouteHttpMethods, A_ServerRouteProtocols } from './A-ServerRoute.constants.js';
|
|
2
|
+
|
|
3
|
+
type A_serverRouteProtocolNames = typeof A_ServerRouteProtocols[keyof typeof A_ServerRouteProtocols];
|
|
4
|
+
type A_ServerRouteHttpMethodNames = typeof A_ServerRouteHttpMethods[keyof typeof A_ServerRouteHttpMethods];
|
|
5
|
+
|
|
6
|
+
export type { A_ServerRouteHttpMethodNames, A_serverRouteProtocolNames };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"A-ServerRoute.types.js"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"A-ServerRoute.types.mjs"}
|