@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,29 @@
|
|
|
1
|
+
import { A as A_Request } from '../../A-Request.entity-r905O60G.mjs';
|
|
2
|
+
import { A as A_Response } from '../../A-Response.entity-6qhiV7BE.mjs';
|
|
3
|
+
import { A_Config } from '@adaas/a-utils/a-config';
|
|
4
|
+
import { A_ServerMiddleware } from '../../lib/A-ServerMiddleware/A-ServerMiddleware.component.mjs';
|
|
5
|
+
import 'http';
|
|
6
|
+
import '@adaas/a-concept';
|
|
7
|
+
import '../../lib/A-Server/A-HttpServer.error.mjs';
|
|
8
|
+
import '../../lib/A-Server/A-HttpServer.types.mjs';
|
|
9
|
+
import '../../lib/A-Server/A-HttpServer.constants.mjs';
|
|
10
|
+
import '../../lib/A-Request/A-Request.constants.mjs';
|
|
11
|
+
import '../../lib/A-Request/A-Request.env.mjs';
|
|
12
|
+
import '../../lib/A-Request/A-HttpServerRequest.context.mjs';
|
|
13
|
+
import '@adaas/a-utils/a-operation';
|
|
14
|
+
import '../../lib/A-Request/A-HttpRequestData.context.mjs';
|
|
15
|
+
import '@adaas/a-utils/a-execution';
|
|
16
|
+
import '../../lib/A-ServerRoute/A-ServerRoute.entity.mjs';
|
|
17
|
+
import '@adaas/a-utils/a-route';
|
|
18
|
+
import '../../lib/A-ServerRoute/A-ServerRoute.types.mjs';
|
|
19
|
+
import '../../lib/A-ServerRoute/A-ServerRoute.constants.mjs';
|
|
20
|
+
import 'stream';
|
|
21
|
+
import '../../lib/A-Response/A-Response.constants.mjs';
|
|
22
|
+
|
|
23
|
+
declare class A_ServerCORS extends A_ServerMiddleware {
|
|
24
|
+
private config;
|
|
25
|
+
init(config: A_Config<['ORIGIN', 'METHODS', 'HEADERS', 'CREDENTIALS', 'MAX_AGE']>): Promise<void>;
|
|
26
|
+
apply(aReq: A_Request, aRes: A_Response): void;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export { A_ServerCORS };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { A as A_Request } from '../../A-Request.entity-8_9MCXT2.js';
|
|
2
|
+
import { A as A_Response } from '../../A-Response.entity-bjh6bofZ.js';
|
|
3
|
+
import { A_Config } from '@adaas/a-utils/a-config';
|
|
4
|
+
import { A_ServerMiddleware } from '../../lib/A-ServerMiddleware/A-ServerMiddleware.component.js';
|
|
5
|
+
import 'http';
|
|
6
|
+
import '@adaas/a-concept';
|
|
7
|
+
import '../../lib/A-Server/A-HttpServer.error.js';
|
|
8
|
+
import '../../lib/A-Server/A-HttpServer.types.js';
|
|
9
|
+
import '../../lib/A-Server/A-HttpServer.constants.js';
|
|
10
|
+
import '../../lib/A-Request/A-Request.constants.js';
|
|
11
|
+
import '../../lib/A-Request/A-Request.env.js';
|
|
12
|
+
import '../../lib/A-Request/A-HttpServerRequest.context.js';
|
|
13
|
+
import '@adaas/a-utils/a-operation';
|
|
14
|
+
import '../../lib/A-Request/A-HttpRequestData.context.js';
|
|
15
|
+
import '@adaas/a-utils/a-execution';
|
|
16
|
+
import '../../lib/A-ServerRoute/A-ServerRoute.entity.js';
|
|
17
|
+
import '@adaas/a-utils/a-route';
|
|
18
|
+
import '../../lib/A-ServerRoute/A-ServerRoute.types.js';
|
|
19
|
+
import '../../lib/A-ServerRoute/A-ServerRoute.constants.js';
|
|
20
|
+
import 'stream';
|
|
21
|
+
import '../../lib/A-Response/A-Response.constants.js';
|
|
22
|
+
|
|
23
|
+
declare class A_ServerCORS extends A_ServerMiddleware {
|
|
24
|
+
private config;
|
|
25
|
+
init(config: A_Config<['ORIGIN', 'METHODS', 'HEADERS', 'CREDENTIALS', 'MAX_AGE']>): Promise<void>;
|
|
26
|
+
apply(aReq: A_Request, aRes: A_Response): void;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export { A_ServerCORS };
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var aConcept = require('@adaas/a-concept');
|
|
4
|
+
var aService = require('@adaas/a-utils/a-service');
|
|
5
|
+
var ARequest_entity = require('@adaas/a-server/request/A-Request.entity');
|
|
6
|
+
var AResponse_entity = require('@adaas/a-server/response/A-Response.entity');
|
|
7
|
+
var aConfig = require('@adaas/a-utils/a-config');
|
|
8
|
+
var AServerMiddleware_component = require('@adaas/a-server/middleware/A-ServerMiddleware.component');
|
|
9
|
+
var A_ServerCORS_constants = require('./A_ServerCORS.constants');
|
|
10
|
+
var AHttpServer_container = require('@adaas/a-server/server/A-HttpServer.container');
|
|
11
|
+
|
|
12
|
+
var __defProp = Object.defineProperty;
|
|
13
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
14
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
15
|
+
var result = __getOwnPropDesc(target, key) ;
|
|
16
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
17
|
+
if (decorator = decorators[i])
|
|
18
|
+
result = (decorator(target, key, result) ) || result;
|
|
19
|
+
if (result) __defProp(target, key, result);
|
|
20
|
+
return result;
|
|
21
|
+
};
|
|
22
|
+
var __decorateParam = (index, decorator) => (target, key) => decorator(target, key, index);
|
|
23
|
+
class A_ServerCORS extends AServerMiddleware_component.A_ServerMiddleware {
|
|
24
|
+
async init(config) {
|
|
25
|
+
this.config = {
|
|
26
|
+
origin: config.get("ORIGIN") || A_ServerCORS_constants.A_SERVER_DEFAULTS__CorsConfig.origin,
|
|
27
|
+
methods: config.get("METHODS") || A_ServerCORS_constants.A_SERVER_DEFAULTS__CorsConfig.methods,
|
|
28
|
+
headers: config.get("HEADERS") || A_ServerCORS_constants.A_SERVER_DEFAULTS__CorsConfig.headers,
|
|
29
|
+
credentials: config.get("CREDENTIALS") || A_ServerCORS_constants.A_SERVER_DEFAULTS__CorsConfig.credentials,
|
|
30
|
+
maxAge: config.get("MAX_AGE") || A_ServerCORS_constants.A_SERVER_DEFAULTS__CorsConfig.maxAge
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
apply(aReq, aRes) {
|
|
34
|
+
aRes.setHeader("Access-Control-Allow-Origin", this.config.origin);
|
|
35
|
+
aRes.setHeader("Access-Control-Allow-Methods", this.config.methods.join(", "));
|
|
36
|
+
aRes.setHeader("Access-Control-Allow-Headers", this.config.headers.join(", "));
|
|
37
|
+
if (this.config.credentials) {
|
|
38
|
+
aRes.setHeader("Access-Control-Allow-Credentials", "true");
|
|
39
|
+
}
|
|
40
|
+
if (this.config.maxAge) {
|
|
41
|
+
aRes.setHeader("Access-Control-Max-Age", this.config.maxAge.toString());
|
|
42
|
+
}
|
|
43
|
+
if (aReq.method === "OPTIONS") {
|
|
44
|
+
aRes.status(204).send();
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
__decorateClass([
|
|
49
|
+
aConcept.A_Feature.Extend({
|
|
50
|
+
name: aService.A_ServiceFeatures.onBeforeStart
|
|
51
|
+
}),
|
|
52
|
+
__decorateParam(0, aConcept.A_Inject(aConfig.A_Config))
|
|
53
|
+
], A_ServerCORS.prototype, "init");
|
|
54
|
+
__decorateClass([
|
|
55
|
+
AHttpServer_container.A_HttpServer.onAfterRequest,
|
|
56
|
+
__decorateParam(0, aConcept.A_Inject(ARequest_entity.A_Request)),
|
|
57
|
+
__decorateParam(1, aConcept.A_Inject(AResponse_entity.A_Response))
|
|
58
|
+
], A_ServerCORS.prototype, "apply");
|
|
59
|
+
|
|
60
|
+
exports.A_ServerCORS = A_ServerCORS;
|
|
61
|
+
//# sourceMappingURL=A_ServerCORS.component.js.map
|
|
62
|
+
//# sourceMappingURL=A_ServerCORS.component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/middlewares/A-ServerCORS/A_ServerCORS.component.ts"],"names":["A_ServerMiddleware","A_SERVER_DEFAULTS__CorsConfig","A_Feature","A_ServiceFeatures","A_Config","A_HttpServer","A_Request","A_Response"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAcO,MAAM,qBAAqBA,8CAAA,CAAmB;AAAA,EAOjD,MAAM,KACkB,MAAA,EACtB;AACE,IAAA,IAAA,CAAK,MAAA,G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AU,MAAA,CAAO;AAAA,IACd,MAAMC,0BAAA,CAAkB;AAAA,GAC3B,CAAA;AAAA,EAEI,qCAASC,gBAAQ,CAAA;AAAA,CAAA,EARb,YAAA,CAOH,SAAA,EAAA,MAAA,CAAA;AAcC,eAAA,CAAA;AAAA,EADNC,kCAAA,CAAa,cAAA;AAAA,EAET,qCAASC,yBAAS,CAAA,CAAA;AAAA,EAClB,qCAASC,2BAAU,CAAA;AAAA,CAAA,EAvBf,YAAA,CAqBF,SAAA,EAAA,OAAA,CAAA","file":"A_ServerCORS.component.js","sourcesContent":["import { A_Feature, A_Inject } from '@adaas/a-concept';\nimport { A_ServiceFeatures } from '@adaas/a-utils/a-service';\nimport { A_Request } from '@adaas/a-server/request/A-Request.entity';\nimport { A_Response } from '@adaas/a-server/response/A-Response.entity';\nimport { A_HttpServerFeatures } from '@adaas/a-server/server/A-HttpServer.constants';\nimport { A_Config } from '@adaas/a-utils/a-config';\nimport { A_ServerMiddleware } from '@adaas/a-server/middleware/A-ServerMiddleware.component';\nimport { A_SERVER_TYPES__CorsConfig } from './A_ServerCORS.types';\nimport { A_SERVER_DEFAULTS__CorsConfig } from './A_ServerCORS.constants';\nimport { A_HttpServer } from '@adaas/a-server/server/A-HttpServer.container';\n\n\n\n\nexport class A_ServerCORS extends A_ServerMiddleware {\n\n private config!: A_SERVER_TYPES__CorsConfig;\n\n @A_Feature.Extend({\n name: A_ServiceFeatures.onBeforeStart\n })\n async init(\n @A_Inject(A_Config) config: A_Config<['ORIGIN', 'METHODS', 'HEADERS', 'CREDENTIALS', 'MAX_AGE']>,\n ) {\n this.config = {\n origin: config.get('ORIGIN') || A_SERVER_DEFAULTS__CorsConfig.origin,\n methods: config.get('METHODS') || A_SERVER_DEFAULTS__CorsConfig.methods,\n headers: config.get('HEADERS') || A_SERVER_DEFAULTS__CorsConfig.headers,\n credentials: config.get('CREDENTIALS') || A_SERVER_DEFAULTS__CorsConfig.credentials,\n maxAge: config.get('MAX_AGE') || A_SERVER_DEFAULTS__CorsConfig.maxAge,\n };\n }\n\n\n @A_HttpServer.onAfterRequest\n public apply(\n @A_Inject(A_Request) aReq: A_Request,\n @A_Inject(A_Response) aRes: A_Response,\n ) {\n\n aRes.setHeader('Access-Control-Allow-Origin', this.config.origin);\n aRes.setHeader('Access-Control-Allow-Methods', this.config.methods.join(', '));\n aRes.setHeader('Access-Control-Allow-Headers', this.config.headers.join(', '));\n\n if (this.config.credentials) {\n aRes.setHeader('Access-Control-Allow-Credentials', 'true');\n }\n\n if (this.config.maxAge) {\n aRes.setHeader('Access-Control-Max-Age', this.config.maxAge.toString());\n }\n\n // Handle preflight OPTIONS requests\n if (aReq.method === 'OPTIONS') {\n aRes.status(204).send();\n }\n }\n}\n"]}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { __decorateClass, __decorateParam } from '../../chunk-EQQGB2QZ.mjs';
|
|
2
|
+
import { A_Feature, A_Inject } from '@adaas/a-concept';
|
|
3
|
+
import { A_ServiceFeatures } from '@adaas/a-utils/a-service';
|
|
4
|
+
import { A_Request } from '@adaas/a-server/request/A-Request.entity';
|
|
5
|
+
import { A_Response } from '@adaas/a-server/response/A-Response.entity';
|
|
6
|
+
import { A_Config } from '@adaas/a-utils/a-config';
|
|
7
|
+
import { A_ServerMiddleware } from '@adaas/a-server/middleware/A-ServerMiddleware.component';
|
|
8
|
+
import { A_SERVER_DEFAULTS__CorsConfig } from './A_ServerCORS.constants';
|
|
9
|
+
import { A_HttpServer } from '@adaas/a-server/server/A-HttpServer.container';
|
|
10
|
+
|
|
11
|
+
class A_ServerCORS extends A_ServerMiddleware {
|
|
12
|
+
async init(config) {
|
|
13
|
+
this.config = {
|
|
14
|
+
origin: config.get("ORIGIN") || A_SERVER_DEFAULTS__CorsConfig.origin,
|
|
15
|
+
methods: config.get("METHODS") || A_SERVER_DEFAULTS__CorsConfig.methods,
|
|
16
|
+
headers: config.get("HEADERS") || A_SERVER_DEFAULTS__CorsConfig.headers,
|
|
17
|
+
credentials: config.get("CREDENTIALS") || A_SERVER_DEFAULTS__CorsConfig.credentials,
|
|
18
|
+
maxAge: config.get("MAX_AGE") || A_SERVER_DEFAULTS__CorsConfig.maxAge
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
apply(aReq, aRes) {
|
|
22
|
+
aRes.setHeader("Access-Control-Allow-Origin", this.config.origin);
|
|
23
|
+
aRes.setHeader("Access-Control-Allow-Methods", this.config.methods.join(", "));
|
|
24
|
+
aRes.setHeader("Access-Control-Allow-Headers", this.config.headers.join(", "));
|
|
25
|
+
if (this.config.credentials) {
|
|
26
|
+
aRes.setHeader("Access-Control-Allow-Credentials", "true");
|
|
27
|
+
}
|
|
28
|
+
if (this.config.maxAge) {
|
|
29
|
+
aRes.setHeader("Access-Control-Max-Age", this.config.maxAge.toString());
|
|
30
|
+
}
|
|
31
|
+
if (aReq.method === "OPTIONS") {
|
|
32
|
+
aRes.status(204).send();
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
__decorateClass([
|
|
37
|
+
A_Feature.Extend({
|
|
38
|
+
name: A_ServiceFeatures.onBeforeStart
|
|
39
|
+
}),
|
|
40
|
+
__decorateParam(0, A_Inject(A_Config))
|
|
41
|
+
], A_ServerCORS.prototype, "init", 1);
|
|
42
|
+
__decorateClass([
|
|
43
|
+
A_HttpServer.onAfterRequest,
|
|
44
|
+
__decorateParam(0, A_Inject(A_Request)),
|
|
45
|
+
__decorateParam(1, A_Inject(A_Response))
|
|
46
|
+
], A_ServerCORS.prototype, "apply", 1);
|
|
47
|
+
|
|
48
|
+
export { A_ServerCORS };
|
|
49
|
+
//# sourceMappingURL=A_ServerCORS.component.mjs.map
|
|
50
|
+
//# sourceMappingURL=A_ServerCORS.component.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/middlewares/A-ServerCORS/A_ServerCORS.component.ts"],"names":[],"mappings":";;;;;;;;;;AAcO,MAAM,qBAAqB,kBAA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AAK;AAAA,IAC1B;AAAA,EACJ;AACJ;AApCU,eAAA,CAAA;AAAA,EAHL,UAAU,MAAA,CAAO;AAAA,IACd,MAAM,iBAAA,CAAkB;AAAA,GAC3B,CAAA;AAAA,EAEI,4BAAS,QAAQ,CAAA;AAAA,CAAA,EARb,YAAA,CAOH,SAAA,EAAA,MAAA,EAAA,CAAA,CAAA;AAcC,eAAA,CAAA;AAAA,EADN,YAAA,CAAa,cAAA;AAAA,EAET,4BAAS,SAAS,CAAA,CAAA;AAAA,EAClB,4BAAS,UAAU,CAAA;AAAA,CAAA,EAvBf,YAAA,CAqBF,SAAA,EAAA,OAAA,EAAA,CAAA,CAAA","file":"A_ServerCORS.component.mjs","sourcesContent":["import { A_Feature, A_Inject } from '@adaas/a-concept';\nimport { A_ServiceFeatures } from '@adaas/a-utils/a-service';\nimport { A_Request } from '@adaas/a-server/request/A-Request.entity';\nimport { A_Response } from '@adaas/a-server/response/A-Response.entity';\nimport { A_HttpServerFeatures } from '@adaas/a-server/server/A-HttpServer.constants';\nimport { A_Config } from '@adaas/a-utils/a-config';\nimport { A_ServerMiddleware } from '@adaas/a-server/middleware/A-ServerMiddleware.component';\nimport { A_SERVER_TYPES__CorsConfig } from './A_ServerCORS.types';\nimport { A_SERVER_DEFAULTS__CorsConfig } from './A_ServerCORS.constants';\nimport { A_HttpServer } from '@adaas/a-server/server/A-HttpServer.container';\n\n\n\n\nexport class A_ServerCORS extends A_ServerMiddleware {\n\n private config!: A_SERVER_TYPES__CorsConfig;\n\n @A_Feature.Extend({\n name: A_ServiceFeatures.onBeforeStart\n })\n async init(\n @A_Inject(A_Config) config: A_Config<['ORIGIN', 'METHODS', 'HEADERS', 'CREDENTIALS', 'MAX_AGE']>,\n ) {\n this.config = {\n origin: config.get('ORIGIN') || A_SERVER_DEFAULTS__CorsConfig.origin,\n methods: config.get('METHODS') || A_SERVER_DEFAULTS__CorsConfig.methods,\n headers: config.get('HEADERS') || A_SERVER_DEFAULTS__CorsConfig.headers,\n credentials: config.get('CREDENTIALS') || A_SERVER_DEFAULTS__CorsConfig.credentials,\n maxAge: config.get('MAX_AGE') || A_SERVER_DEFAULTS__CorsConfig.maxAge,\n };\n }\n\n\n @A_HttpServer.onAfterRequest\n public apply(\n @A_Inject(A_Request) aReq: A_Request,\n @A_Inject(A_Response) aRes: A_Response,\n ) {\n\n aRes.setHeader('Access-Control-Allow-Origin', this.config.origin);\n aRes.setHeader('Access-Control-Allow-Methods', this.config.methods.join(', '));\n aRes.setHeader('Access-Control-Allow-Headers', this.config.headers.join(', '));\n\n if (this.config.credentials) {\n aRes.setHeader('Access-Control-Allow-Credentials', 'true');\n }\n\n if (this.config.maxAge) {\n aRes.setHeader('Access-Control-Max-Age', this.config.maxAge.toString());\n }\n\n // Handle preflight OPTIONS requests\n if (aReq.method === 'OPTIONS') {\n aRes.status(204).send();\n }\n }\n}\n"]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const A_SERVER_DEFAULTS__CorsConfig = {
|
|
4
|
+
origin: "*",
|
|
5
|
+
// Default to allow all origins
|
|
6
|
+
methods: ["GET", "POST", "PUT", "DELETE", "OPTIONS"],
|
|
7
|
+
headers: ["Content-Type"],
|
|
8
|
+
credentials: false,
|
|
9
|
+
maxAge: 0
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
exports.A_SERVER_DEFAULTS__CorsConfig = A_SERVER_DEFAULTS__CorsConfig;
|
|
13
|
+
//# sourceMappingURL=A_ServerCORS.constants.js.map
|
|
14
|
+
//# sourceMappingURL=A_ServerCORS.constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/middlewares/A-ServerCORS/A_ServerCORS.constants.ts"],"names":[],"mappings":";;AAIO,MAAM,6BAAA,GAA4D;AAAA,EACrE,MAAA,EAAQ,GAAA;AAAA;AAAA,EACR,SAAS,CAAC,KAAA,EAAO,MAAA,EAAQ,KAAA,EAAO,UAAU,SAAS,CAAA;AAAA,EACnD,OAAA,EAAS,CAAC,cAAc,CAAA;AAAA,EACxB,WAAA,EAAa,KAAA;AAAA,EACb,MAAA,EAAQ;AACZ","file":"A_ServerCORS.constants.js","sourcesContent":["import { A_SERVER_TYPES__CorsConfig } from \"./A_ServerCORS.types\";\n\n\n\nexport const A_SERVER_DEFAULTS__CorsConfig: A_SERVER_TYPES__CorsConfig = {\n origin: '*', // Default to allow all origins\n methods: ['GET', 'POST', 'PUT', 'DELETE', 'OPTIONS'],\n headers: ['Content-Type'],\n credentials: false,\n maxAge: 0\n} as const;\n"]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import '../../chunk-EQQGB2QZ.mjs';
|
|
2
|
+
|
|
3
|
+
const A_SERVER_DEFAULTS__CorsConfig = {
|
|
4
|
+
origin: "*",
|
|
5
|
+
// Default to allow all origins
|
|
6
|
+
methods: ["GET", "POST", "PUT", "DELETE", "OPTIONS"],
|
|
7
|
+
headers: ["Content-Type"],
|
|
8
|
+
credentials: false,
|
|
9
|
+
maxAge: 0
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export { A_SERVER_DEFAULTS__CorsConfig };
|
|
13
|
+
//# sourceMappingURL=A_ServerCORS.constants.mjs.map
|
|
14
|
+
//# sourceMappingURL=A_ServerCORS.constants.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/middlewares/A-ServerCORS/A_ServerCORS.constants.ts"],"names":[],"mappings":";;AAIO,MAAM,6BAAA,GAA4D;AAAA,EACrE,MAAA,EAAQ,GAAA;AAAA;AAAA,EACR,SAAS,CAAC,KAAA,EAAO,MAAA,EAAQ,KAAA,EAAO,UAAU,SAAS,CAAA;AAAA,EACnD,OAAA,EAAS,CAAC,cAAc,CAAA;AAAA,EACxB,WAAA,EAAa,KAAA;AAAA,EACb,MAAA,EAAQ;AACZ","file":"A_ServerCORS.constants.mjs","sourcesContent":["import { A_SERVER_TYPES__CorsConfig } from \"./A_ServerCORS.types\";\n\n\n\nexport const A_SERVER_DEFAULTS__CorsConfig: A_SERVER_TYPES__CorsConfig = {\n origin: '*', // Default to allow all origins\n methods: ['GET', 'POST', 'PUT', 'DELETE', 'OPTIONS'],\n headers: ['Content-Type'],\n credentials: false,\n maxAge: 0\n} as const;\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"A_ServerCORS.types.js"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"A_ServerCORS.types.mjs"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { A_Scope, A_Entity } from '@adaas/a-concept';
|
|
2
|
+
import { A_HTTPChannel } from '../../channels/A-Http/A-Http.channel.mjs';
|
|
3
|
+
import { A_ServerEntityList } from '../../lib/A-ServerEntityList/A-EntityList.entity.mjs';
|
|
4
|
+
import { A_Command } from '@adaas/a-utils/a-command';
|
|
5
|
+
import '../../channels/A-Http/A-Http.channel.types.mjs';
|
|
6
|
+
import '../../lib/A-Server/A-HttpServer.types.mjs';
|
|
7
|
+
import '../../lib/A-Server/A-HttpServer.constants.mjs';
|
|
8
|
+
import '../../channels/A-Http/A-Http.channel.constants.mjs';
|
|
9
|
+
import '@adaas/a-utils/a-channel';
|
|
10
|
+
import '../../lib/A-ServerRoute/A-ServerRoute.entity.mjs';
|
|
11
|
+
import '@adaas/a-utils/a-route';
|
|
12
|
+
import '../../lib/A-ServerRoute/A-ServerRoute.types.mjs';
|
|
13
|
+
import '../../lib/A-ServerRoute/A-ServerRoute.constants.mjs';
|
|
14
|
+
import '../../lib/A-ServerEntityList/A-EntityList.types.mjs';
|
|
15
|
+
|
|
16
|
+
declare class A_EntityRepository extends A_HTTPChannel {
|
|
17
|
+
execute(command: A_Command, scope: A_Scope): Promise<void>;
|
|
18
|
+
list(entity: A_ServerEntityList, scope: A_Scope): Promise<void>;
|
|
19
|
+
load(entity: A_Entity, scope: A_Scope): Promise<void>;
|
|
20
|
+
save(entity: A_Entity, scope: A_Scope): Promise<void>;
|
|
21
|
+
destroy(entity: A_Entity, scope: A_Scope): Promise<void>;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export { A_EntityRepository };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { A_Scope, A_Entity } from '@adaas/a-concept';
|
|
2
|
+
import { A_HTTPChannel } from '../../channels/A-Http/A-Http.channel.js';
|
|
3
|
+
import { A_ServerEntityList } from '../../lib/A-ServerEntityList/A-EntityList.entity.js';
|
|
4
|
+
import { A_Command } from '@adaas/a-utils/a-command';
|
|
5
|
+
import '../../channels/A-Http/A-Http.channel.types.js';
|
|
6
|
+
import '../../lib/A-Server/A-HttpServer.types.js';
|
|
7
|
+
import '../../lib/A-Server/A-HttpServer.constants.js';
|
|
8
|
+
import '../../channels/A-Http/A-Http.channel.constants.js';
|
|
9
|
+
import '@adaas/a-utils/a-channel';
|
|
10
|
+
import '../../lib/A-ServerRoute/A-ServerRoute.entity.js';
|
|
11
|
+
import '@adaas/a-utils/a-route';
|
|
12
|
+
import '../../lib/A-ServerRoute/A-ServerRoute.types.js';
|
|
13
|
+
import '../../lib/A-ServerRoute/A-ServerRoute.constants.js';
|
|
14
|
+
import '../../lib/A-ServerEntityList/A-EntityList.types.js';
|
|
15
|
+
|
|
16
|
+
declare class A_EntityRepository extends A_HTTPChannel {
|
|
17
|
+
execute(command: A_Command, scope: A_Scope): Promise<void>;
|
|
18
|
+
list(entity: A_ServerEntityList, scope: A_Scope): Promise<void>;
|
|
19
|
+
load(entity: A_Entity, scope: A_Scope): Promise<void>;
|
|
20
|
+
save(entity: A_Entity, scope: A_Scope): Promise<void>;
|
|
21
|
+
destroy(entity: A_Entity, scope: A_Scope): Promise<void>;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export { A_EntityRepository };
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var aConcept = require('@adaas/a-concept');
|
|
4
|
+
var AHttp_channel = require('@adaas/a-server/channels/A-Http/A-Http.channel');
|
|
5
|
+
var AEntityList_entity = require('@adaas/a-server/entity-list/A-EntityList.entity');
|
|
6
|
+
var aCommand = require('@adaas/a-utils/a-command');
|
|
7
|
+
var aManifest = require('@adaas/a-utils/a-manifest');
|
|
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_EntityRepository extends AHttp_channel.A_HTTPChannel {
|
|
21
|
+
async execute(command, scope) {
|
|
22
|
+
if (scope.has(aManifest.A_Manifest) && !scope.resolve(aManifest.A_Manifest).isAllowed(command.constructor, "load").for(command.constructor))
|
|
23
|
+
return;
|
|
24
|
+
const response = await this.post(`/a-command/v1/${command.aseid.entity}`, command.toJSON());
|
|
25
|
+
command.fromJSON(response.data);
|
|
26
|
+
}
|
|
27
|
+
async list(entity, scope) {
|
|
28
|
+
if (scope.has(aManifest.A_Manifest) && !scope.resolve(aManifest.A_Manifest).isAllowed(entity.constructor, "load").for(entity.constructor))
|
|
29
|
+
return;
|
|
30
|
+
const response = await this.get(`/a-list/v1/${entity.aseid.entity}`);
|
|
31
|
+
entity.fromJSON(response.data);
|
|
32
|
+
}
|
|
33
|
+
async load(entity, scope) {
|
|
34
|
+
if (scope.has(aManifest.A_Manifest) && !scope.resolve(aManifest.A_Manifest).isAllowed(entity.constructor, "load").for(entity.constructor))
|
|
35
|
+
return;
|
|
36
|
+
const response = await this.get(`/a-entity/v1/${entity.aseid.toString()}`);
|
|
37
|
+
entity.fromJSON(response.data);
|
|
38
|
+
}
|
|
39
|
+
async save(entity, scope) {
|
|
40
|
+
if (scope.has(aManifest.A_Manifest) && !scope.resolve(aManifest.A_Manifest).isAllowed(entity.constructor, "save").for(entity.constructor))
|
|
41
|
+
return;
|
|
42
|
+
const response = await this.post(`/a-entity/v1/${entity.aseid.toString()}`, entity.toJSON());
|
|
43
|
+
entity.fromJSON(response.data);
|
|
44
|
+
}
|
|
45
|
+
async destroy(entity, scope) {
|
|
46
|
+
if (scope.has(aManifest.A_Manifest) && !scope.resolve(aManifest.A_Manifest).isAllowed(entity.constructor, "destroy").for(entity.constructor))
|
|
47
|
+
return;
|
|
48
|
+
const response = await this.delete(`/a-entity/v1/${entity.aseid.toString()}`);
|
|
49
|
+
entity.fromJSON(response.data);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
__decorateClass([
|
|
53
|
+
aConcept.A_Feature.Extend({
|
|
54
|
+
name: aCommand.A_CommandFeatures.onExecute
|
|
55
|
+
}),
|
|
56
|
+
__decorateParam(0, aConcept.A_Inject(aConcept.A_Caller)),
|
|
57
|
+
__decorateParam(1, aConcept.A_Inject(aConcept.A_Scope))
|
|
58
|
+
], A_EntityRepository.prototype, "execute");
|
|
59
|
+
__decorateClass([
|
|
60
|
+
aConcept.A_Feature.Extend({
|
|
61
|
+
name: aConcept.A_TYPES__EntityFeatures.LOAD,
|
|
62
|
+
scope: [AEntityList_entity.A_ServerEntityList]
|
|
63
|
+
}),
|
|
64
|
+
__decorateParam(0, aConcept.A_Inject(aConcept.A_Caller)),
|
|
65
|
+
__decorateParam(1, aConcept.A_Inject(aConcept.A_Scope))
|
|
66
|
+
], A_EntityRepository.prototype, "list");
|
|
67
|
+
__decorateClass([
|
|
68
|
+
aConcept.A_Feature.Extend({
|
|
69
|
+
name: aConcept.A_TYPES__EntityFeatures.LOAD,
|
|
70
|
+
scope: [AEntityList_entity.A_ServerEntityList]
|
|
71
|
+
}),
|
|
72
|
+
__decorateParam(0, aConcept.A_Inject(aConcept.A_Caller)),
|
|
73
|
+
__decorateParam(1, aConcept.A_Inject(aConcept.A_Scope))
|
|
74
|
+
], A_EntityRepository.prototype, "load");
|
|
75
|
+
__decorateClass([
|
|
76
|
+
aConcept.A_Feature.Extend({
|
|
77
|
+
name: aConcept.A_TYPES__EntityFeatures.SAVE,
|
|
78
|
+
scope: [AEntityList_entity.A_ServerEntityList]
|
|
79
|
+
}),
|
|
80
|
+
__decorateParam(0, aConcept.A_Inject(aConcept.A_Caller)),
|
|
81
|
+
__decorateParam(1, aConcept.A_Inject(aConcept.A_Scope))
|
|
82
|
+
], A_EntityRepository.prototype, "save");
|
|
83
|
+
__decorateClass([
|
|
84
|
+
aConcept.A_Feature.Extend({
|
|
85
|
+
name: aConcept.A_TYPES__EntityFeatures.DESTROY,
|
|
86
|
+
scope: [AEntityList_entity.A_ServerEntityList]
|
|
87
|
+
}),
|
|
88
|
+
__decorateParam(0, aConcept.A_Inject(aConcept.A_Caller)),
|
|
89
|
+
__decorateParam(1, aConcept.A_Inject(aConcept.A_Scope))
|
|
90
|
+
], A_EntityRepository.prototype, "destroy");
|
|
91
|
+
|
|
92
|
+
exports.A_EntityRepository = A_EntityRepository;
|
|
93
|
+
//# sourceMappingURL=A-EntityRepository.component.js.map
|
|
94
|
+
//# sourceMappingURL=A-EntityRepository.component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/repositories/A-EntityRepository/A-EntityRepository.component.ts"],"names":["A_HTTPChannel","A_Manifest","A_Feature","A_CommandFeatures","A_Caller","A_Scope","A_TYPES__EntityFeatures","A_ServerEntityList"],"mappings":";;;;;;;;;;;;;;;;;;;AASO,MAAM,2BAA2BA,2BAAA,CAAc;AAAA,EAMlD,MAAM,OAAA,CACkB,OAAA,EACD,KAAA,EACrB;AAEE,IAAA,IACI,MAAM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BAAU,MAAA,CAAO;AAAA,IACd,MAAMI,gCAAA,CAAwB,IAAA;AAAA,IAC9B,KAAA,EAAO,CAACC,qCAAkB;AAAA,GAC7B,CAAA;AAAA,EAEI,qCAASH,iBAAQ,CAAA,CAAA;AAAA,EACjB,qCAASC,gBAAO,CAAA;AAAA,CAAA,EA7BZ,kBAAA,CA2BH,SAAA,EAAA,MAAA,CAAA;AAsBA,eAAA,CAAA;AAAA,EAJLH,mBAAU,MAAA,CAAO;AAAA,IACd,MAAMI,gCAAA,CAAwB,IAAA;AAAA,IAC9B,KAAA,EAAO,CAACC,qCAAkB;AAAA,GAC7B,CAAA;AAAA,EAEI,qCAASH,iBAAQ,CAAA,CAAA;AAAA,EACjB,qCAASC,gBAAO,CAAA;AAAA,CAAA,EAnDZ,kBAAA,CAiDH,SAAA,EAAA,MAAA,CAAA;AAsBA,eAAA,CAAA;AAAA,EAJLH,mBAAU,MAAA,CAAO;AAAA,IACd,MAAMI,gCAAA,CAAwB,IAAA;AAAA,IAC9B,KAAA,EAAO,CAACC,qCAAkB;AAAA,GAC7B,CAAA;AAAA,EAEI,qCAASH,iBAAQ,CAAA,CAAA;AAAA,EACjB,qCAASC,gBAAO,CAAA;AAAA,CAAA,EAzEZ,kBAAA,CAuEH,SAAA,EAAA,MAAA,CAAA;AAsBA,eAAA,CAAA;AAAA,EAJLH,mBAAU,MAAA,CAAO;AAAA,IACd,MAAMI,gCAAA,CAAwB,OAAA;AAAA,IAC9B,KAAA,EAAO,CAACC,qCAAkB;AAAA,GAC7B,CAAA;AAAA,EAEI,qCAASH,iBAAQ,CAAA,CAAA;AAAA,EACjB,qCAASC,gBAAO,CAAA;AAAA,CAAA,EA/FZ,kBAAA,CA6FH,SAAA,EAAA,SAAA,CAAA","file":"A-EntityRepository.component.js","sourcesContent":["import { A_Caller, A_Entity, A_Feature, A_Inject, A_Scope, A_TYPES__Entity_Constructor, A_TYPES__EntityFeatures } from \"@adaas/a-concept\";\nimport { A_HTTPChannel } from \"@adaas/a-server/channels/A-Http/A-Http.channel\";\nimport { A_ServerEntityList } from \"@adaas/a-server/entity-list/A-EntityList.entity\";\nimport { A_Command, A_CommandFeatures, A_TYPES__Command_Serialized } from \"@adaas/a-utils/a-command\";\nimport { A_Manifest } from \"@adaas/a-utils/a-manifest\";\n\n\n\n\nexport class A_EntityRepository extends A_HTTPChannel {\n\n\n @A_Feature.Extend({\n name: A_CommandFeatures.onExecute,\n })\n async execute(\n @A_Inject(A_Caller) command: A_Command,\n @A_Inject(A_Scope) scope: A_Scope,\n ) {\n // Check if the scope has a manifest and if the entity is allowed to load\n if (\n scope.has(A_Manifest) && !scope.resolve(A_Manifest)!\n .isAllowed(command.constructor, 'load')\n .for(command.constructor as A_TYPES__Entity_Constructor)\n )\n return;\n\n const response = await this.post<A_TYPES__Command_Serialized>(`/a-command/v1/${command.aseid.entity}`, command.toJSON());\n\n command.fromJSON(response.data!);\n }\n\n @A_Feature.Extend({\n name: A_TYPES__EntityFeatures.LOAD,\n scope: [A_ServerEntityList]\n })\n async list(\n @A_Inject(A_Caller) entity: A_ServerEntityList,\n @A_Inject(A_Scope) scope: A_Scope,\n ) {\n // Check if the scope has a manifest and if the entity is allowed to load\n if (\n scope.has(A_Manifest) && !scope.resolve(A_Manifest)!\n .isAllowed(entity.constructor, 'load')\n .for(entity.constructor as A_TYPES__Entity_Constructor)\n )\n return;\n\n const response = await this.get(`/a-list/v1/${entity.aseid.entity}`);\n\n entity.fromJSON(response.data);\n }\n\n\n @A_Feature.Extend({\n name: A_TYPES__EntityFeatures.LOAD,\n scope: [A_ServerEntityList]\n })\n async load(\n @A_Inject(A_Caller) entity: A_Entity,\n @A_Inject(A_Scope) scope: A_Scope,\n ) {\n // Check if the scope has a manifest and if the entity is allowed to load\n if (\n scope.has(A_Manifest) && !scope.resolve(A_Manifest)!\n .isAllowed(entity.constructor, 'load')\n .for(entity.constructor as A_TYPES__Entity_Constructor)\n )\n return;\n\n const response = await this.get(`/a-entity/v1/${entity.aseid.toString()}`);\n\n entity.fromJSON(response.data);\n }\n\n\n @A_Feature.Extend({\n name: A_TYPES__EntityFeatures.SAVE,\n scope: [A_ServerEntityList]\n })\n async save(\n @A_Inject(A_Caller) entity: A_Entity,\n @A_Inject(A_Scope) scope: A_Scope,\n ) {\n // Check if the scope has a manifest and if the entity is allowed to save\n if (\n scope.has(A_Manifest) && !scope.resolve(A_Manifest)!\n .isAllowed(entity.constructor, 'save')\n .for(entity.constructor as A_TYPES__Entity_Constructor)\n )\n return;\n\n const response = await this.post(`/a-entity/v1/${entity.aseid.toString()}`, entity.toJSON());\n\n entity.fromJSON(response.data);\n }\n\n\n @A_Feature.Extend({\n name: A_TYPES__EntityFeatures.DESTROY,\n scope: [A_ServerEntityList]\n })\n async destroy(\n @A_Inject(A_Caller) entity: A_Entity,\n @A_Inject(A_Scope) scope: A_Scope,\n ) {\n // Check if the scope has a manifest and if the entity is allowed to destroy\n if (\n scope.has(A_Manifest) && !scope.resolve(A_Manifest)!\n .isAllowed(entity.constructor, 'destroy')\n .for(entity.constructor as A_TYPES__Entity_Constructor)\n )\n return;\n\n const response = await this.delete(`/a-entity/v1/${entity.aseid.toString()}`);\n\n entity.fromJSON(response.data);\n }\n\n\n}"]}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { __decorateClass, __decorateParam } from '../../chunk-EQQGB2QZ.mjs';
|
|
2
|
+
import { A_Feature, A_Inject, A_Caller, A_Scope, A_TYPES__EntityFeatures } from '@adaas/a-concept';
|
|
3
|
+
import { A_HTTPChannel } from '@adaas/a-server/channels/A-Http/A-Http.channel';
|
|
4
|
+
import { A_ServerEntityList } from '@adaas/a-server/entity-list/A-EntityList.entity';
|
|
5
|
+
import { A_CommandFeatures } from '@adaas/a-utils/a-command';
|
|
6
|
+
import { A_Manifest } from '@adaas/a-utils/a-manifest';
|
|
7
|
+
|
|
8
|
+
class A_EntityRepository extends A_HTTPChannel {
|
|
9
|
+
async execute(command, scope) {
|
|
10
|
+
if (scope.has(A_Manifest) && !scope.resolve(A_Manifest).isAllowed(command.constructor, "load").for(command.constructor))
|
|
11
|
+
return;
|
|
12
|
+
const response = await this.post(`/a-command/v1/${command.aseid.entity}`, command.toJSON());
|
|
13
|
+
command.fromJSON(response.data);
|
|
14
|
+
}
|
|
15
|
+
async list(entity, scope) {
|
|
16
|
+
if (scope.has(A_Manifest) && !scope.resolve(A_Manifest).isAllowed(entity.constructor, "load").for(entity.constructor))
|
|
17
|
+
return;
|
|
18
|
+
const response = await this.get(`/a-list/v1/${entity.aseid.entity}`);
|
|
19
|
+
entity.fromJSON(response.data);
|
|
20
|
+
}
|
|
21
|
+
async load(entity, scope) {
|
|
22
|
+
if (scope.has(A_Manifest) && !scope.resolve(A_Manifest).isAllowed(entity.constructor, "load").for(entity.constructor))
|
|
23
|
+
return;
|
|
24
|
+
const response = await this.get(`/a-entity/v1/${entity.aseid.toString()}`);
|
|
25
|
+
entity.fromJSON(response.data);
|
|
26
|
+
}
|
|
27
|
+
async save(entity, scope) {
|
|
28
|
+
if (scope.has(A_Manifest) && !scope.resolve(A_Manifest).isAllowed(entity.constructor, "save").for(entity.constructor))
|
|
29
|
+
return;
|
|
30
|
+
const response = await this.post(`/a-entity/v1/${entity.aseid.toString()}`, entity.toJSON());
|
|
31
|
+
entity.fromJSON(response.data);
|
|
32
|
+
}
|
|
33
|
+
async destroy(entity, scope) {
|
|
34
|
+
if (scope.has(A_Manifest) && !scope.resolve(A_Manifest).isAllowed(entity.constructor, "destroy").for(entity.constructor))
|
|
35
|
+
return;
|
|
36
|
+
const response = await this.delete(`/a-entity/v1/${entity.aseid.toString()}`);
|
|
37
|
+
entity.fromJSON(response.data);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
__decorateClass([
|
|
41
|
+
A_Feature.Extend({
|
|
42
|
+
name: A_CommandFeatures.onExecute
|
|
43
|
+
}),
|
|
44
|
+
__decorateParam(0, A_Inject(A_Caller)),
|
|
45
|
+
__decorateParam(1, A_Inject(A_Scope))
|
|
46
|
+
], A_EntityRepository.prototype, "execute", 1);
|
|
47
|
+
__decorateClass([
|
|
48
|
+
A_Feature.Extend({
|
|
49
|
+
name: A_TYPES__EntityFeatures.LOAD,
|
|
50
|
+
scope: [A_ServerEntityList]
|
|
51
|
+
}),
|
|
52
|
+
__decorateParam(0, A_Inject(A_Caller)),
|
|
53
|
+
__decorateParam(1, A_Inject(A_Scope))
|
|
54
|
+
], A_EntityRepository.prototype, "list", 1);
|
|
55
|
+
__decorateClass([
|
|
56
|
+
A_Feature.Extend({
|
|
57
|
+
name: A_TYPES__EntityFeatures.LOAD,
|
|
58
|
+
scope: [A_ServerEntityList]
|
|
59
|
+
}),
|
|
60
|
+
__decorateParam(0, A_Inject(A_Caller)),
|
|
61
|
+
__decorateParam(1, A_Inject(A_Scope))
|
|
62
|
+
], A_EntityRepository.prototype, "load", 1);
|
|
63
|
+
__decorateClass([
|
|
64
|
+
A_Feature.Extend({
|
|
65
|
+
name: A_TYPES__EntityFeatures.SAVE,
|
|
66
|
+
scope: [A_ServerEntityList]
|
|
67
|
+
}),
|
|
68
|
+
__decorateParam(0, A_Inject(A_Caller)),
|
|
69
|
+
__decorateParam(1, A_Inject(A_Scope))
|
|
70
|
+
], A_EntityRepository.prototype, "save", 1);
|
|
71
|
+
__decorateClass([
|
|
72
|
+
A_Feature.Extend({
|
|
73
|
+
name: A_TYPES__EntityFeatures.DESTROY,
|
|
74
|
+
scope: [A_ServerEntityList]
|
|
75
|
+
}),
|
|
76
|
+
__decorateParam(0, A_Inject(A_Caller)),
|
|
77
|
+
__decorateParam(1, A_Inject(A_Scope))
|
|
78
|
+
], A_EntityRepository.prototype, "destroy", 1);
|
|
79
|
+
|
|
80
|
+
export { A_EntityRepository };
|
|
81
|
+
//# sourceMappingURL=A-EntityRepository.component.mjs.map
|
|
82
|
+
//# sourceMappingURL=A-EntityRepository.component.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/repositories/A-EntityRepository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A,CAAA,CAAA","file":"A-EntityRepository.component.mjs","sourcesContent":["import { A_Caller, A_Entity, A_Feature, A_Inject, A_Scope, A_TYPES__Entity_Constructor, A_TYPES__EntityFeatures } from \"@adaas/a-concept\";\nimport { A_HTTPChannel } from \"@adaas/a-server/channels/A-Http/A-Http.channel\";\nimport { A_ServerEntityList } from \"@adaas/a-server/entity-list/A-EntityList.entity\";\nimport { A_Command, A_CommandFeatures, A_TYPES__Command_Serialized } from \"@adaas/a-utils/a-command\";\nimport { A_Manifest } from \"@adaas/a-utils/a-manifest\";\n\n\n\n\nexport class A_EntityRepository extends A_HTTPChannel {\n\n\n @A_Feature.Extend({\n name: A_CommandFeatures.onExecute,\n })\n async execute(\n @A_Inject(A_Caller) command: A_Command,\n @A_Inject(A_Scope) scope: A_Scope,\n ) {\n // Check if the scope has a manifest and if the entity is allowed to load\n if (\n scope.has(A_Manifest) && !scope.resolve(A_Manifest)!\n .isAllowed(command.constructor, 'load')\n .for(command.constructor as A_TYPES__Entity_Constructor)\n )\n return;\n\n const response = await this.post<A_TYPES__Command_Serialized>(`/a-command/v1/${command.aseid.entity}`, command.toJSON());\n\n command.fromJSON(response.data!);\n }\n\n @A_Feature.Extend({\n name: A_TYPES__EntityFeatures.LOAD,\n scope: [A_ServerEntityList]\n })\n async list(\n @A_Inject(A_Caller) entity: A_ServerEntityList,\n @A_Inject(A_Scope) scope: A_Scope,\n ) {\n // Check if the scope has a manifest and if the entity is allowed to load\n if (\n scope.has(A_Manifest) && !scope.resolve(A_Manifest)!\n .isAllowed(entity.constructor, 'load')\n .for(entity.constructor as A_TYPES__Entity_Constructor)\n )\n return;\n\n const response = await this.get(`/a-list/v1/${entity.aseid.entity}`);\n\n entity.fromJSON(response.data);\n }\n\n\n @A_Feature.Extend({\n name: A_TYPES__EntityFeatures.LOAD,\n scope: [A_ServerEntityList]\n })\n async load(\n @A_Inject(A_Caller) entity: A_Entity,\n @A_Inject(A_Scope) scope: A_Scope,\n ) {\n // Check if the scope has a manifest and if the entity is allowed to load\n if (\n scope.has(A_Manifest) && !scope.resolve(A_Manifest)!\n .isAllowed(entity.constructor, 'load')\n .for(entity.constructor as A_TYPES__Entity_Constructor)\n )\n return;\n\n const response = await this.get(`/a-entity/v1/${entity.aseid.toString()}`);\n\n entity.fromJSON(response.data);\n }\n\n\n @A_Feature.Extend({\n name: A_TYPES__EntityFeatures.SAVE,\n scope: [A_ServerEntityList]\n })\n async save(\n @A_Inject(A_Caller) entity: A_Entity,\n @A_Inject(A_Scope) scope: A_Scope,\n ) {\n // Check if the scope has a manifest and if the entity is allowed to save\n if (\n scope.has(A_Manifest) && !scope.resolve(A_Manifest)!\n .isAllowed(entity.constructor, 'save')\n .for(entity.constructor as A_TYPES__Entity_Constructor)\n )\n return;\n\n const response = await this.post(`/a-entity/v1/${entity.aseid.toString()}`, entity.toJSON());\n\n entity.fromJSON(response.data);\n }\n\n\n @A_Feature.Extend({\n name: A_TYPES__EntityFeatures.DESTROY,\n scope: [A_ServerEntityList]\n })\n async destroy(\n @A_Inject(A_Caller) entity: A_Entity,\n @A_Inject(A_Scope) scope: A_Scope,\n ) {\n // Check if the scope has a manifest and if the entity is allowed to destroy\n if (\n scope.has(A_Manifest) && !scope.resolve(A_Manifest)!\n .isAllowed(entity.constructor, 'destroy')\n .for(entity.constructor as A_TYPES__Entity_Constructor)\n )\n return;\n\n const response = await this.delete(`/a-entity/v1/${entity.aseid.toString()}`);\n\n entity.fromJSON(response.data);\n }\n\n\n}"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"A-EntityRepository.error.js"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"A-EntityRepository.error.mjs"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"A-EntityRepository.types.js"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"A-EntityRepository.types.mjs"}
|